From: support Date: Tue, 27 Dec 2022 14:07:27 +0000 (+0000) Subject: Built motion from commit 44b1f254.|2.6.26 X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=9f23224471ca9250625aa7d60802d5afd88a7b67;p=motion2.git Built motion from commit 44b1f254.|2.6.26 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index b3a0837..17b1628 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-27T13:41:03.147Z", + "time": "2022-12-27T13:58:36.124Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 63d0801..be2c67e 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-12-27T13:41:03.147Z", + "time": "2022-12-27T13:58:36.124Z", "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 5821ae8..0298244 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 _0x8679=['VIRTUAL','STRING','contactManager','integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','urlForward[headers],\x20browser[wsindowHeight]','sequelize','exports'];(function(_0x4206f5,_0x21f338){var _0xa29cf3=function(_0x2d35d7){while(--_0x2d35d7){_0x4206f5['push'](_0x4206f5['shift']());}};_0xa29cf3(++_0x21f338);}(_0x8679,0x19e));var _0x9867=function(_0x272935,_0x51709e){_0x272935=_0x272935-0x0;var _0x45151d=_0x8679[_0x272935];return _0x45151d;};'use strict';var Sequelize=require(_0x9867('0x0'));module[_0x9867('0x1')]={'name':{'type':Sequelize[_0x9867('0x2')],'get':function(_0x41cbf0){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x9867('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9867('0x4'),_0x9867('0x5'),_0x9867('0x6'),'jscripty',_0x9867('0x7'),_0x9867('0x8'),_0x9867('0x9'),_0x9867('0xa')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x9867('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x9867('0x3')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x9867('0x3')](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[_0x9867('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x9867('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x9867('0x3')],'comments':_0x9867('0xc')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file +var _0x47d4=['motionbar','jscripty','urlForward','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','getDataValue','action','contactManager','integration'];(function(_0x5235a6,_0x680b76){var _0x1cf37e=function(_0x31c173){while(--_0x31c173){_0x5235a6['push'](_0x5235a6['shift']());}};_0x1cf37e(++_0x680b76);}(_0x47d4,0xfe));var _0x447d=function(_0x384998,_0x5f4964){_0x384998=_0x384998-0x0;var _0x48d50b=_0x47d4[_0x384998];return _0x48d50b;};'use strict';var Sequelize=require('sequelize');module[_0x447d('0x0')]={'name':{'type':Sequelize[_0x447d('0x1')],'get':function(_0x1d7c6b){return this[_0x447d('0x2')](_0x447d('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x447d('0x4'),_0x447d('0x5'),_0x447d('0x6'),_0x447d('0x7'),_0x447d('0x8'),'browser',_0x447d('0x9'),_0x447d('0xa')]],'msg':_0x447d('0xb')}},'comment':_0x447d('0xb')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x447d('0xc')](0x1000),'comment':_0x447d('0xd')},'data3':{'type':Sequelize[_0x447d('0xc')](0x1000),'comment':_0x447d('0xe')},'data4':{'type':Sequelize[_0x447d('0xc')](0x1000),'comments':_0x447d('0xf')},'data5':{'type':Sequelize[_0x447d('0xc')](0x1000),'comments':_0x447d('0x10')},'data6':{'type':Sequelize[_0x447d('0xc')],'comments':_0x447d('0x11')},'data7':{'type':Sequelize[_0x447d('0x12')],'comments':_0x447d('0x13')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index b3f8e5b..ea19f1f 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 _0x7042=['lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','status','json','offset','limit','count','set','apply','reject','save','update','then','destroy','end','sendStatus','name','send','body','Action','params','find','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x28a31b,_0xddc270){var _0x4f9173=function(_0x5b9b92){while(--_0x5b9b92){_0x28a31b['push'](_0x28a31b['shift']());}};_0x4f9173(++_0xddc270);}(_0x7042,0xdd));var _0x2704=function(_0xdee814,_0x401c80){_0xdee814=_0xdee814-0x0;var _0x346394=_0x7042[_0xdee814];return _0x346394;};'use strict';var emlformat=require(_0x2704('0x0'));var rimraf=require(_0x2704('0x1'));var zipdir=require(_0x2704('0x2'));var jsonpatch=require(_0x2704('0x3'));var rp=require(_0x2704('0x4'));var moment=require(_0x2704('0x5'));var BPromise=require(_0x2704('0x6'));var Mustache=require(_0x2704('0x7'));var util=require(_0x2704('0x8'));var path=require(_0x2704('0x9'));var sox=require(_0x2704('0xa'));var csv=require(_0x2704('0xb'));var ejs=require(_0x2704('0xc'));var fs=require('fs');var fs_extra=require(_0x2704('0xd'));var _=require(_0x2704('0xe'));var squel=require(_0x2704('0xf'));var crypto=require(_0x2704('0x10'));var jsforce=require(_0x2704('0x11'));var deskjs=require(_0x2704('0x12'));var toCsv=require(_0x2704('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2704('0x13'));var authService=require(_0x2704('0x14'));var qs=require(_0x2704('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2704('0x16'));var logger=require('../../config/logger')(_0x2704('0x17'));var utils=require(_0x2704('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x2704('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x36dd84,_0x26a9d3){_0x26a9d3=_0x26a9d3||0xcc;return function(_0x32994e){if(_0x32994e){return _0x36dd84['sendStatus'](_0x26a9d3);}return _0x36dd84[_0x2704('0x1a')](_0x26a9d3)['end']();};}function respondWithResult(_0x19d70e,_0x2fe777){_0x2fe777=_0x2fe777||0xc8;return function(_0x3a151f){if(_0x3a151f){return _0x19d70e[_0x2704('0x1a')](_0x2fe777)[_0x2704('0x1b')](_0x3a151f);}};}function respondWithFilteredResult(_0x500608,_0x21d51c){return function(_0xadf24){if(_0xadf24){var _0x43871f=typeof _0x21d51c[_0x2704('0x1c')]==='undefined'&&typeof _0x21d51c[_0x2704('0x1d')]==='undefined';var _0x5c425a=_0xadf24[_0x2704('0x1e')];var _0x347c05=_0x43871f?0x0:_0x21d51c['offset'];var _0x3e0b2f=_0x43871f?_0xadf24[_0x2704('0x1e')]:_0x21d51c[_0x2704('0x1c')]+_0x21d51c['limit'];var _0x32fe21;if(_0x3e0b2f>=_0x5c425a){_0x3e0b2f=_0x5c425a;_0x32fe21=0xc8;}else{_0x32fe21=0xce;}_0x500608[_0x2704('0x1a')](_0x32fe21);return _0x500608[_0x2704('0x1f')]('Content-Range',_0x347c05+'-'+_0x3e0b2f+'/'+_0x5c425a)[_0x2704('0x1b')](_0xadf24);}return null;};}function patchUpdates(_0xc88163){return function(_0x3fa018){try{jsonpatch[_0x2704('0x20')](_0x3fa018,_0xc88163,!![]);}catch(_0x579686){return BPromise[_0x2704('0x21')](_0x579686);}return _0x3fa018[_0x2704('0x22')]();};}function saveUpdates(_0x202c24,_0x22343d){return function(_0x49f1ee){if(_0x49f1ee){return _0x49f1ee[_0x2704('0x23')](_0x202c24)[_0x2704('0x24')](function(_0x3a9789){return _0x3a9789;});}return null;};}function removeEntity(_0x4da1bb,_0x47a54f){return function(_0x4d89af){if(_0x4d89af){return _0x4d89af[_0x2704('0x25')]()[_0x2704('0x24')](function(){_0x4da1bb[_0x2704('0x1a')](0xcc)[_0x2704('0x26')]();});}};}function handleEntityNotFound(_0x4f4544,_0x4d96af){return function(_0x42b708){if(!_0x42b708){_0x4f4544[_0x2704('0x27')](0x194);}return _0x42b708;};}function handleError(_0x212ff1,_0x5b0e71){_0x5b0e71=_0x5b0e71||0x1f4;return function(_0x1c45f8){logger['error'](_0x1c45f8['stack']);if(_0x1c45f8[_0x2704('0x28')]){delete _0x1c45f8['name'];}_0x212ff1['status'](_0x5b0e71)[_0x2704('0x29')](_0x1c45f8);};}exports[_0x2704('0x23')]=function(_0xd93088,_0x161af3){if(_0xd93088[_0x2704('0x2a')]['id']){delete _0xd93088[_0x2704('0x2a')]['id'];}return db[_0x2704('0x2b')]['find']({'where':{'id':_0xd93088[_0x2704('0x2c')]['id']}})[_0x2704('0x24')](handleEntityNotFound(_0x161af3,null))['then'](saveUpdates(_0xd93088[_0x2704('0x2a')],null))[_0x2704('0x24')](respondWithResult(_0x161af3,null))['catch'](handleError(_0x161af3,null));};exports[_0x2704('0x25')]=function(_0x4e4a52,_0x25f8c1){return db[_0x2704('0x2b')][_0x2704('0x2d')]({'where':{'id':_0x4e4a52['params']['id']}})[_0x2704('0x24')](handleEntityNotFound(_0x25f8c1,null))[_0x2704('0x24')](removeEntity(_0x25f8c1,null))[_0x2704('0x2e')](handleError(_0x25f8c1,null));}; \ No newline at end of file +var _0x55d9=['zip-dir','request-promise','moment','bluebird','path','sox','squel','jsforce','to-csv','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','Content-Range','apply','reject','save','update','destroy','then','name','send','body','Action','find','catch','params','eml-format','rimraf'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x55d9,0x12b));var _0x955d=function(_0x31acc7,_0x168431){_0x31acc7=_0x31acc7-0x0;var _0x10d549=_0x55d9[_0x31acc7];return _0x10d549;};'use strict';var emlformat=require(_0x955d('0x0'));var rimraf=require(_0x955d('0x1'));var zipdir=require(_0x955d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x955d('0x3'));var moment=require(_0x955d('0x4'));var BPromise=require(_0x955d('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x955d('0x6'));var sox=require(_0x955d('0x7'));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(_0x955d('0x8'));var crypto=require('crypto');var jsforce=require(_0x955d('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x955d('0xa'));var querystring=require(_0x955d('0xb'));var Papa=require(_0x955d('0xc'));var Redis=require('ioredis');var authService=require(_0x955d('0xd'));var qs=require(_0x955d('0xe'));var as=require(_0x955d('0xf'));var hardwareService=require(_0x955d('0x10'));var logger=require(_0x955d('0x11'))(_0x955d('0x12'));var utils=require('../../config/utils');var config=require(_0x955d('0x13'));var licenseUtil=require(_0x955d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37352d,_0x4e2817){_0x4e2817=_0x4e2817||0xcc;return function(_0x1fb4e6){if(_0x1fb4e6){return _0x37352d[_0x955d('0x15')](_0x4e2817);}return _0x37352d[_0x955d('0x16')](_0x4e2817)[_0x955d('0x17')]();};}function respondWithResult(_0x57cf5f,_0x361f39){_0x361f39=_0x361f39||0xc8;return function(_0x4e2873){if(_0x4e2873){return _0x57cf5f['status'](_0x361f39)[_0x955d('0x18')](_0x4e2873);}};}function respondWithFilteredResult(_0x39bd0a,_0x43a233){return function(_0x41edb0){if(_0x41edb0){var _0x1a3a41=typeof _0x43a233[_0x955d('0x19')]===_0x955d('0x1a')&&typeof _0x43a233[_0x955d('0x1b')]===_0x955d('0x1a');var _0x1ffffb=_0x41edb0[_0x955d('0x1c')];var _0x588e8d=_0x1a3a41?0x0:_0x43a233[_0x955d('0x19')];var _0x27f073=_0x1a3a41?_0x41edb0['count']:_0x43a233[_0x955d('0x19')]+_0x43a233['limit'];var _0x3732c4;if(_0x27f073>=_0x1ffffb){_0x27f073=_0x1ffffb;_0x3732c4=0xc8;}else{_0x3732c4=0xce;}_0x39bd0a[_0x955d('0x16')](_0x3732c4);return _0x39bd0a['set'](_0x955d('0x1d'),_0x588e8d+'-'+_0x27f073+'/'+_0x1ffffb)[_0x955d('0x18')](_0x41edb0);}return null;};}function patchUpdates(_0x50440d){return function(_0x18d43e){try{jsonpatch[_0x955d('0x1e')](_0x18d43e,_0x50440d,!![]);}catch(_0x69f8b4){return BPromise[_0x955d('0x1f')](_0x69f8b4);}return _0x18d43e[_0x955d('0x20')]();};}function saveUpdates(_0x3ea433,_0x221eb6){return function(_0x4c7618){if(_0x4c7618){return _0x4c7618[_0x955d('0x21')](_0x3ea433)['then'](function(_0x3f14bc){return _0x3f14bc;});}return null;};}function removeEntity(_0x2e1d21,_0x297068){return function(_0xacdf41){if(_0xacdf41){return _0xacdf41[_0x955d('0x22')]()[_0x955d('0x23')](function(){_0x2e1d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc1e3e3,_0x4496b5){return function(_0x590a4d){if(!_0x590a4d){_0xc1e3e3[_0x955d('0x15')](0x194);}return _0x590a4d;};}function handleError(_0x512e02,_0x2d9746){_0x2d9746=_0x2d9746||0x1f4;return function(_0x1d607b){logger['error'](_0x1d607b['stack']);if(_0x1d607b[_0x955d('0x24')]){delete _0x1d607b[_0x955d('0x24')];}_0x512e02[_0x955d('0x16')](_0x2d9746)[_0x955d('0x25')](_0x1d607b);};}exports[_0x955d('0x21')]=function(_0x4e2446,_0x16168a){if(_0x4e2446['body']['id']){delete _0x4e2446[_0x955d('0x26')]['id'];}return db[_0x955d('0x27')][_0x955d('0x28')]({'where':{'id':_0x4e2446['params']['id']}})[_0x955d('0x23')](handleEntityNotFound(_0x16168a,null))[_0x955d('0x23')](saveUpdates(_0x4e2446[_0x955d('0x26')],null))[_0x955d('0x23')](respondWithResult(_0x16168a,null))[_0x955d('0x29')](handleError(_0x16168a,null));};exports['destroy']=function(_0x5ccd49,_0x4f94a0){return db[_0x955d('0x27')][_0x955d('0x28')]({'where':{'id':_0x5ccd49[_0x955d('0x2a')]['id']}})[_0x955d('0x23')](handleEntityNotFound(_0x4f94a0,null))[_0x955d('0x23')](removeEntity(_0x4f94a0,null))[_0x955d('0x29')](handleError(_0x4f94a0,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index f7dfa3f..7cc8422 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 _0x7590=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x15d2c4,_0x4c65b2){var _0x4c9641=function(_0x3f73f3){while(--_0x3f73f3){_0x15d2c4['push'](_0x15d2c4['shift']());}};_0x4c9641(++_0x4c65b2);}(_0x7590,0x1c6));var _0x0759=function(_0x1bbe1a,_0xf961fd){_0x1bbe1a=_0x1bbe1a-0x0;var _0x492f96=_0x7590[_0x1bbe1a];return _0x492f96;};'use strict';var _=require('lodash');var util=require(_0x0759('0x0'));var logger=require(_0x0759('0x1'))(_0x0759('0x2'));var moment=require(_0x0759('0x3'));var BPromise=require(_0x0759('0x4'));var rp=require(_0x0759('0x5'));var fs=require('fs');var path=require(_0x0759('0x6'));var rimraf=require('rimraf');var config=require(_0x0759('0x7'));var attributes=require('./action.attributes');module[_0x0759('0x8')]=function(_0x4dfe42,_0x234acf){return _0x4dfe42[_0x0759('0x9')](_0x0759('0xa'),attributes,{'tableName':_0x0759('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbe33=['path','rimraf','./action.attributes','exports','define','Action','tools_actions','../../config/logger','moment','request-promise'];(function(_0x391af7,_0x4f4ce8){var _0x3ebba8=function(_0x37933d){while(--_0x37933d){_0x391af7['push'](_0x391af7['shift']());}};_0x3ebba8(++_0x4f4ce8);}(_0xbe33,0x183));var _0x3be3=function(_0x44ec14,_0x8a1bb6){_0x44ec14=_0x44ec14-0x0;var _0x2ffa38=_0xbe33[_0x44ec14];return _0x2ffa38;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3be3('0x0'))('api');var moment=require(_0x3be3('0x1'));var BPromise=require('bluebird');var rp=require(_0x3be3('0x2'));var fs=require('fs');var path=require(_0x3be3('0x3'));var rimraf=require(_0x3be3('0x4'));var config=require('../../config/environment');var attributes=require(_0x3be3('0x5'));module[_0x3be3('0x6')]=function(_0x137169,_0x698c4c){return _0x137169[_0x3be3('0x7')](_0x3be3('0x8'),attributes,{'tableName':_0x3be3('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 9dd35e4..6d0449d 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2c49b8,_0x3b9017){var _0x446126=function(_0x5cc1f9){while(--_0x5cc1f9){_0x2c49b8['push'](_0x2c49b8['shift']());}};_0x446126(++_0x3b9017);}(_0x326f,0xd1));var _0xf326=function(_0x35035f,_0xf847ed){_0x35035f=_0x35035f-0x0;var _0x2558b2=_0x326f[_0x35035f];return _0x2558b2;};'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')]('Action,\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')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});} \ No newline at end of file +var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x486c3b,_0x4aeb79){var _0x4ed294=function(_0xdc628c){while(--_0xdc628c){_0x486c3b['push'](_0x486c3b['shift']());}};_0x4ed294(++_0x4aeb79);}(_0xabce,0x103));var _0xeabc=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xabce[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index ac71749..b93909e 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 _0xdc21=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0xdc21,0x7a));var _0x1dc2=function(_0x5c2027,_0x74e81c){_0x5c2027=_0x5c2027-0x0;var _0xefc748=_0xdc21[_0x5c2027];return _0xefc748;};'use strict';var multer=require(_0x1dc2('0x0'));var util=require(_0x1dc2('0x1'));var path=require(_0x1dc2('0x2'));var timeout=require(_0x1dc2('0x3'));var express=require(_0x1dc2('0x4'));var router=express[_0x1dc2('0x5')]();var fs_extra=require(_0x1dc2('0x6'));var auth=require(_0x1dc2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1dc2('0x8'));var controller=require(_0x1dc2('0x9'));router[_0x1dc2('0xa')](_0x1dc2('0xb'),auth[_0x1dc2('0xc')](),controller[_0x1dc2('0xd')]);router[_0x1dc2('0xe')](_0x1dc2('0xb'),auth[_0x1dc2('0xc')](),controller[_0x1dc2('0xf')]);module[_0x1dc2('0x10')]=router; \ No newline at end of file +var _0xa113=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','update','/:id','isAuthenticated','destroy','exports','multer','util','path'];(function(_0x11c894,_0x2b69de){var _0x24dc88=function(_0x3b8602){while(--_0x3b8602){_0x11c894['push'](_0x11c894['shift']());}};_0x24dc88(++_0x2b69de);}(_0xa113,0xfd));var _0x3a11=function(_0x39fd11,_0x5d7883){_0x39fd11=_0x39fd11-0x0;var _0x302799=_0xa113[_0x39fd11];return _0x302799;};'use strict';var multer=require(_0x3a11('0x0'));var util=require(_0x3a11('0x1'));var path=require(_0x3a11('0x2'));var timeout=require(_0x3a11('0x3'));var express=require(_0x3a11('0x4'));var router=express[_0x3a11('0x5')]();var fs_extra=require(_0x3a11('0x6'));var auth=require(_0x3a11('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3a11('0x8'));var controller=require(_0x3a11('0x9'));router[_0x3a11('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3a11('0xb')]);router['delete'](_0x3a11('0xc'),auth[_0x3a11('0xd')](),controller[_0x3a11('0xe')]);module[_0x3a11('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index bb324b7..f488d33 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 _0x31f0=['sequelize','STRING','TEXT'];(function(_0x345e68,_0x45757c){var _0xb0411a=function(_0x2bf0d7){while(--_0x2bf0d7){_0x345e68['push'](_0x345e68['shift']());}};_0xb0411a(++_0x45757c);}(_0x31f0,0xb7));var _0x031f=function(_0x2228dc,_0x4973aa){_0x2228dc=_0x2228dc-0x0;var _0x58c52a=_0x31f0[_0x2228dc];return _0x58c52a;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}}; \ No newline at end of file +var _0xeff8=['STRING','TEXT','sequelize','exports'];(function(_0x565aa4,_0x1a5a32){var _0x4de3ea=function(_0x28dc46){while(--_0x28dc46){_0x565aa4['push'](_0x565aa4['shift']());}};_0x4de3ea(++_0x1a5a32);}(_0xeff8,0x186));var _0x8eff=function(_0x490be3,_0xf0fca3){_0x490be3=_0x490be3-0x0;var _0x3f5140=_0xeff8[_0x490be3];return _0x3f5140;};'use strict';var Sequelize=require(_0x8eff('0x0'));module[_0x8eff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x8eff('0x2')]},'parent':{'type':Sequelize[_0x8eff('0x2')]},'table':{'type':Sequelize[_0x8eff('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x8eff('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 55c78f9..4104ce7 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 _0x4546=['rows','catch','show','length','find','create','body','user','role','Reports','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','from','table','MetricId','function','format','replace','groupBy','orderBy','DESC','field','joins','includes','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','debug','Limited\x20Query:','toString','sequelize','join','left_join','AnalyticMetric','metric','clone','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','select','COUNT(*)','QueryTypes','SELECT','runReport','UNIX_TIMESTAMP(%s)','alias','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','CustomReports','UserProfileResource','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','filters','pick','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x5eef05,_0x1be989){var _0x56d4b8=function(_0x57993d){while(--_0x57993d){_0x5eef05['push'](_0x5eef05['shift']());}};_0x56d4b8(++_0x1be989);}(_0x4546,0x10a));var _0x6454=function(_0x543590,_0x5577bb){_0x543590=_0x543590-0x0;var _0x4bae6b=_0x4546[_0x543590];return _0x4bae6b;};'use strict';var emlformat=require(_0x6454('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6454('0x1'));var jsonpatch=require(_0x6454('0x2'));var rp=require(_0x6454('0x3'));var moment=require('moment');var BPromise=require(_0x6454('0x4'));var Mustache=require(_0x6454('0x5'));var util=require(_0x6454('0x6'));var path=require(_0x6454('0x7'));var sox=require(_0x6454('0x8'));var csv=require(_0x6454('0x9'));var ejs=require(_0x6454('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6454('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6454('0xc'));var deskjs=require(_0x6454('0xd'));var toCsv=require(_0x6454('0x9'));var querystring=require('querystring');var Papa=require(_0x6454('0xe'));var Redis=require(_0x6454('0xf'));var authService=require(_0x6454('0x10'));var qs=require(_0x6454('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6454('0x12'));var logger=require(_0x6454('0x13'))(_0x6454('0x14'));var utils=require(_0x6454('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x6454('0x16'));var db=require(_0x6454('0x17'))['db'];var dbH=require('../../mysqldb')[_0x6454('0x18')];function respondWithStatusCode(_0x6dea1b,_0x3909cf){_0x3909cf=_0x3909cf||0xcc;return function(_0x4d071d){if(_0x4d071d){return _0x6dea1b[_0x6454('0x19')](_0x3909cf);}return _0x6dea1b[_0x6454('0x1a')](_0x3909cf)[_0x6454('0x1b')]();};}function respondWithResult(_0x10518d,_0x5864ab){_0x5864ab=_0x5864ab||0xc8;return function(_0x3d63be){if(_0x3d63be){return _0x10518d[_0x6454('0x1a')](_0x5864ab)[_0x6454('0x1c')](_0x3d63be);}};}function respondWithFilteredResult(_0x53b1bb,_0x19c440){return function(_0x30f587){if(_0x30f587){var _0x122a53=typeof _0x19c440['offset']==='undefined'&&typeof _0x19c440['limit']===_0x6454('0x1d');var _0x56f82e=_0x30f587[_0x6454('0x1e')];var _0x29e1b2=_0x122a53?0x0:_0x19c440[_0x6454('0x1f')];var _0x396b18=_0x122a53?_0x30f587['count']:_0x19c440[_0x6454('0x1f')]+_0x19c440[_0x6454('0x20')];var _0x11fe9b;if(_0x396b18>=_0x56f82e){_0x396b18=_0x56f82e;_0x11fe9b=0xc8;}else{_0x11fe9b=0xce;}_0x53b1bb[_0x6454('0x1a')](_0x11fe9b);return _0x53b1bb[_0x6454('0x21')](_0x6454('0x22'),_0x29e1b2+'-'+_0x396b18+'/'+_0x56f82e)[_0x6454('0x1c')](_0x30f587);}return null;};}function patchUpdates(_0x58ce86){return function(_0x3e31f8){try{jsonpatch[_0x6454('0x23')](_0x3e31f8,_0x58ce86,!![]);}catch(_0x11d20c){return BPromise[_0x6454('0x24')](_0x11d20c);}return _0x3e31f8['save']();};}function saveUpdates(_0x4d12c1,_0x373a62){return function(_0x448937){if(_0x448937){return _0x448937[_0x6454('0x25')](_0x4d12c1)['then'](function(_0x18a493){return _0x18a493;});}return null;};}function removeEntity(_0x5bfaf8,_0x9396aa){return function(_0x29c251){if(_0x29c251){return _0x29c251[_0x6454('0x26')]()[_0x6454('0x27')](function(){var _0x2c3f93=_0x29c251[_0x6454('0x28')]({'plain':!![]});var _0x258f36=_0x6454('0x29');return db[_0x6454('0x2a')]['destroy']({'where':{'type':_0x258f36,'resourceId':_0x2c3f93['id']}})[_0x6454('0x27')](function(){return _0x29c251;});})[_0x6454('0x27')](function(){_0x5bfaf8[_0x6454('0x1a')](0xcc)[_0x6454('0x1b')]();});}};}function handleEntityNotFound(_0x254386,_0x51cc06){return function(_0x4bb049){if(!_0x4bb049){_0x254386[_0x6454('0x19')](0x194);}return _0x4bb049;};}function handleError(_0x10e785,_0x4404c8){_0x4404c8=_0x4404c8||0x1f4;return function(_0x4b7646){logger['error'](_0x4b7646[_0x6454('0x2b')]);if(_0x4b7646[_0x6454('0x2c')]){delete _0x4b7646['name'];}_0x10e785['status'](_0x4404c8)[_0x6454('0x2d')](_0x4b7646);};}exports[_0x6454('0x2e')]=function(_0x398a5e,_0x4ddc74){var _0x3bd610={},_0x5ad63e={},_0x22abb3={'count':0x0,'rows':[]};var _0x25c177=_[_0x6454('0x2f')](db[_0x6454('0x30')][_0x6454('0x31')],function(_0x18c127){return{'name':_0x18c127[_0x6454('0x32')],'type':_0x18c127[_0x6454('0x33')][_0x6454('0x34')]};});_0x5ad63e[_0x6454('0x35')]=_[_0x6454('0x2f')](_0x25c177,_0x6454('0x2c'));_0x5ad63e[_0x6454('0x36')]=_[_0x6454('0x37')](_0x398a5e['query']);_0x5ad63e['filters']=_[_0x6454('0x38')](_0x5ad63e['model'],_0x5ad63e['query']);_0x3bd610[_0x6454('0x39')]=_['intersection'](_0x5ad63e[_0x6454('0x35')],qs[_0x6454('0x3a')](_0x398a5e[_0x6454('0x36')][_0x6454('0x3a')]));_0x3bd610[_0x6454('0x39')]=_0x3bd610['attributes']['length']?_0x3bd610[_0x6454('0x39')]:_0x5ad63e[_0x6454('0x35')];if(!_0x398a5e[_0x6454('0x36')][_0x6454('0x3b')](_0x6454('0x3c'))){_0x3bd610[_0x6454('0x20')]=qs[_0x6454('0x20')](_0x398a5e[_0x6454('0x36')]['limit']);_0x3bd610[_0x6454('0x1f')]=qs[_0x6454('0x1f')](_0x398a5e['query'][_0x6454('0x1f')]);}_0x3bd610[_0x6454('0x3d')]=qs['sort'](_0x398a5e[_0x6454('0x36')]['sort']);_0x3bd610[_0x6454('0x3e')]=qs[_0x6454('0x3f')](_[_0x6454('0x40')](_0x398a5e[_0x6454('0x36')],_0x5ad63e[_0x6454('0x3f')]),_0x25c177);if(_0x398a5e[_0x6454('0x36')]['filter']){_0x3bd610[_0x6454('0x3e')]=_[_0x6454('0x41')](_0x3bd610[_0x6454('0x3e')],{'$or':_[_0x6454('0x2f')](_0x25c177,function(_0x2bfc9a){if(_0x2bfc9a[_0x6454('0x33')]!==_0x6454('0x42')){var _0x3ee83c={};_0x3ee83c[_0x2bfc9a[_0x6454('0x2c')]]={'$like':'%'+_0x398a5e[_0x6454('0x36')]['filter']+'%'};return _0x3ee83c;}})});}_0x3bd610=_[_0x6454('0x41')]({},_0x3bd610,_0x398a5e['options']);var _0x4b4626={'where':_0x3bd610['where']};return db[_0x6454('0x30')][_0x6454('0x1e')](_0x4b4626)[_0x6454('0x27')](function(_0x1726b1){_0x22abb3[_0x6454('0x1e')]=_0x1726b1;if(_0x398a5e['query'][_0x6454('0x43')]){_0x3bd610[_0x6454('0x44')]=[{'all':!![]}];}return db[_0x6454('0x30')][_0x6454('0x45')](_0x3bd610);})[_0x6454('0x27')](function(_0x2bf106){_0x22abb3[_0x6454('0x46')]=_0x2bf106;return _0x22abb3;})['then'](respondWithFilteredResult(_0x4ddc74,_0x3bd610))[_0x6454('0x47')](handleError(_0x4ddc74,null));};exports[_0x6454('0x48')]=function(_0x481e54,_0x41aad0){var _0x1d2757={'raw':![],'where':{'id':_0x481e54['params']['id']}},_0x4b70cc={};_0x4b70cc[_0x6454('0x35')]=_[_0x6454('0x37')](db[_0x6454('0x30')]['rawAttributes']);_0x4b70cc[_0x6454('0x36')]=_[_0x6454('0x37')](_0x481e54[_0x6454('0x36')]);_0x4b70cc[_0x6454('0x3f')]=_['intersection'](_0x4b70cc['model'],_0x4b70cc[_0x6454('0x36')]);_0x1d2757[_0x6454('0x39')]=_[_0x6454('0x38')](_0x4b70cc[_0x6454('0x35')],qs[_0x6454('0x3a')](_0x481e54['query'][_0x6454('0x3a')]));_0x1d2757[_0x6454('0x39')]=_0x1d2757[_0x6454('0x39')][_0x6454('0x49')]?_0x1d2757[_0x6454('0x39')]:_0x4b70cc[_0x6454('0x35')];if(_0x481e54['query'][_0x6454('0x43')]){_0x1d2757[_0x6454('0x44')]=[{'all':!![]}];}_0x1d2757=_[_0x6454('0x41')]({},_0x1d2757,_0x481e54['options']);return db[_0x6454('0x30')][_0x6454('0x4a')](_0x1d2757)[_0x6454('0x27')](handleEntityNotFound(_0x41aad0,null))[_0x6454('0x27')](respondWithResult(_0x41aad0,null))[_0x6454('0x47')](handleError(_0x41aad0,null));};exports[_0x6454('0x4b')]=function(_0x15da21,_0x304c50){return db[_0x6454('0x30')][_0x6454('0x4b')](_0x15da21[_0x6454('0x4c')],{})['then'](function(_0x3d471d){var _0x16224d=_0x15da21[_0x6454('0x4d')][_0x6454('0x28')]({'plain':!![]});if(!_0x16224d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x16224d[_0x6454('0x4e')]===_0x6454('0x4d')){var _0x3ee75a=_0x3d471d[_0x6454('0x28')]({'plain':!![]});var _0x5d88e3=_0x6454('0x4f');return db[_0x6454('0x50')]['find']({'where':{'name':_0x5d88e3,'userProfileId':_0x16224d[_0x6454('0x51')]},'raw':!![]})[_0x6454('0x27')](function(_0x5f1021){if(_0x5f1021&&_0x5f1021[_0x6454('0x52')]===0x0){return db[_0x6454('0x2a')][_0x6454('0x4b')]({'name':_0x3ee75a[_0x6454('0x2c')],'resourceId':_0x3ee75a['id'],'type':_0x6454('0x29'),'sectionId':_0x5f1021['id']},{})['then'](function(){return _0x3d471d;});}else{return _0x3d471d;}})['catch'](function(_0x58162b){logger[_0x6454('0x53')](_0x6454('0x54'),_0x58162b);throw _0x58162b;});}return _0x3d471d;})[_0x6454('0x27')](respondWithResult(_0x304c50,0xc9))['catch'](handleError(_0x304c50,null));};exports[_0x6454('0x25')]=function(_0x4fcc3e,_0x57ac51){if(_0x4fcc3e[_0x6454('0x4c')]['id']){delete _0x4fcc3e[_0x6454('0x4c')]['id'];}return db[_0x6454('0x30')][_0x6454('0x4a')]({'where':{'id':_0x4fcc3e[_0x6454('0x55')]['id']}})[_0x6454('0x27')](handleEntityNotFound(_0x57ac51,null))['then'](saveUpdates(_0x4fcc3e['body'],null))[_0x6454('0x27')](respondWithResult(_0x57ac51,null))[_0x6454('0x47')](handleError(_0x57ac51,null));};exports['destroy']=function(_0x1f5cf2,_0x3dfb2b){return db[_0x6454('0x30')]['find']({'where':{'id':_0x1f5cf2[_0x6454('0x55')]['id']}})['then'](handleEntityNotFound(_0x3dfb2b,null))[_0x6454('0x27')](removeEntity(_0x3dfb2b,null))[_0x6454('0x47')](handleError(_0x3dfb2b,null));};exports['preview']=function(_0x250802,_0x2c02eb){var _0x3555dd=0xa;var _0x3815ea=['join','left_join',_0x6454('0x56'),_0x6454('0x57')];var _0x589192={'SUM':_0x6454('0x58'),'COUNT':_0x6454('0x59'),'COUNT DISTINCT':_0x6454('0x5a'),'MAX':_0x6454('0x5b'),'MIN':_0x6454('0x5c'),'AVG':_0x6454('0x5d'),'GROUP_CONCAT':_0x6454('0x5e'),'GROUP_CONCAT ASC':_0x6454('0x5f'),'GROUP_CONCAT DESC':_0x6454('0x60')};var _0x54f951={'SEC_TO_TIME':_0x6454('0x61'),'DATE':_0x6454('0x62'),'HOUR':_0x6454('0x63'),'ROUND':_0x6454('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1aa911=function(_0x40e5bb){return!_['includes']([_0x6454('0x65'),_0x6454('0x66'),_0x6454('0x67'),_0x6454('0x68')],_0x40e5bb);};var _0xcc2877=function(_0x106846){if(!_0x106846||!_0x106846[_0x6454('0x69')]['length']){return'';}for(var _0x2156b1='(',_0x9058d4=0x0;_0x9058d4<_0x106846['rules'][_0x6454('0x49')];_0x9058d4+=0x1){_0x9058d4>0x0&&(_0x2156b1+='\x20'+_0x106846[_0x6454('0x6a')]+'\x20');_0x2156b1+=_0x106846[_0x6454('0x69')][_0x9058d4][_0x6454('0x6b')]?_0xcc2877(_0x106846[_0x6454('0x69')][_0x9058d4][_0x6454('0x6b')]):_0x106846[_0x6454('0x69')][_0x9058d4]['field']+'\x20'+_0x106846['rules'][_0x9058d4][_0x6454('0x6c')]+(_0x1aa911(_0x106846[_0x6454('0x69')][_0x9058d4][_0x6454('0x6c')])?'\x20'+_0x106846['rules'][_0x9058d4][_0x6454('0x6d')]:'');}return _0x2156b1+')';};var _0x5ddf91={'where':{'id':_0x250802[_0x6454('0x55')]['id']}},_0x5519f1,_0xe8a89f,_0x345376,_0x743c71,_0x79fda5;_0x5ddf91=_[_0x6454('0x41')]({},_0x5ddf91,_0x250802[_0x6454('0x6e')]);return db[_0x6454('0x30')][_0x6454('0x4a')](_0x5ddf91)[_0x6454('0x27')](function(_0x15ee8f){if(_0x15ee8f){_0x5519f1=_0x15ee8f;return _0x15ee8f[_0x6454('0x6f')]();}return null;})['then'](function(_0x18448f){if(_0x18448f){if(!_0x18448f[_0x6454('0x49')]){throw new db[(_0x6454('0x70'))][(_0x6454('0x71'))](_0x6454('0x72'),0x193);}_0xe8a89f=_0x18448f;return db['AnalyticMetric'][_0x6454('0x45')]({'raw':!![]});}return null;})['then'](function(_0x181208){if(_0x181208){_0x345376=_[_0x6454('0x73')](_0x181208,'id');var _0x36680c;var _0x209445=squel['select']();_0x209445[_0x6454('0x74')](_0x5519f1[_0x6454('0x75')]);for(var _0x24c6fc=0x0;_0x24c6fc<_0xe8a89f['length'];_0x24c6fc+=0x1){_0x36680c=_0xe8a89f[_0x24c6fc]['MetricId']?_0x345376[_0xe8a89f[_0x24c6fc][_0x6454('0x76')]]['metric']:_0xe8a89f[_0x24c6fc]['field'];_0x36680c=_0xe8a89f[_0x24c6fc][_0x6454('0x77')]?_['replace'](_0x589192[_0xe8a89f[_0x24c6fc]['function']],'%s',_0x36680c):_0x36680c;_0x36680c=_0xe8a89f[_0x24c6fc][_0x6454('0x78')]?_[_0x6454('0x79')](_0x54f951[_0xe8a89f[_0x24c6fc][_0x6454('0x78')]],'%s',_0x36680c):_0x36680c;if(_0xe8a89f[_0x24c6fc][_0x6454('0x7a')]){_0x209445[_0x6454('0x6b')](_0x36680c);}_0xe8a89f[_0x24c6fc][_0x6454('0x7b')]&&_0x209445[_0x6454('0x3d')](_0x36680c,_0xe8a89f[_0x24c6fc][_0x6454('0x7b')]===_0x6454('0x7c')?![]:!![]);_0x209445[_0x6454('0x7d')](_0x36680c,_0xe8a89f[_0x24c6fc]['alias']||_0x36680c);}if(_0x5519f1['joins']){_0x5519f1[_0x6454('0x7e')]=JSON['parse'](_0x5519f1[_0x6454('0x7e')]);for(var _0x880110=0x0;_0x880110<_0x5519f1[_0x6454('0x7e')][_0x6454('0x49')];_0x880110+=0x1){if(_0x5519f1['joins'][_0x880110][_0x6454('0x33')]&&_[_0x6454('0x7f')](_0x3815ea,_0x5519f1[_0x6454('0x7e')][_0x880110]['type'])&&_0x5519f1['joins'][_0x880110]['parentKey']&&_0x5519f1['joins'][_0x880110][_0x6454('0x80')]&&_0x5519f1['joins'][_0x880110][_0x6454('0x81')]){_0x209445[_0x5519f1['joins'][_0x880110]['type']](_0x5519f1['joins'][_0x880110][_0x6454('0x80')],null,util[_0x6454('0x78')](_0x6454('0x82'),_0x5519f1[_0x6454('0x75')],_0x5519f1[_0x6454('0x7e')][_0x880110][_0x6454('0x83')],_0x5519f1[_0x6454('0x7e')][_0x880110][_0x6454('0x80')],_0x5519f1[_0x6454('0x7e')][_0x880110]['foreignKey']));}}}if(_0x5519f1[_0x6454('0x84')]){_0x5519f1[_0x6454('0x84')]=JSON[_0x6454('0x85')](_0x5519f1[_0x6454('0x84')]);_0x209445[_0x6454('0x3e')](_0xcc2877(_0x5519f1['conditions'][_0x6454('0x6b')]));}_0x79fda5=_0x209445['clone']();_0x209445[_0x6454('0x20')](_0x3555dd);_0x209445[_0x6454('0x1f')](0x0);logger[_0x6454('0x86')](_0x6454('0x87'),_0x209445[_0x6454('0x88')]());return dbH[_0x6454('0x89')][_0x6454('0x36')](_0x209445[_0x6454('0x88')](),{'type':dbH[_0x6454('0x89')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x2c02eb,null))[_0x6454('0x47')](handleError(_0x2c02eb,null));};function runReport(_0x2495b3,_0x469033,_0x990271){var _0x4b9341=_0x469033[_0x6454('0x2c')];var _0x47ce28=0xa;var _0x711b23=[_0x6454('0x8a'),_0x6454('0x8b'),'right_join','cross_join'];var _0x57fc1f={'SUM':_0x6454('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x6454('0x5a'),'MAX':'MAX(%s)','MIN':_0x6454('0x5c'),'AVG':_0x6454('0x5d'),'GROUP_CONCAT':_0x6454('0x5e'),'GROUP_CONCAT ASC':_0x6454('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5742ac={'SEC_TO_TIME':_0x6454('0x61'),'DATE':_0x6454('0x62'),'HOUR':_0x6454('0x63'),'ROUND':_0x6454('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1591ef=function(_0x21d0f7){return!_[_0x6454('0x7f')]([_0x6454('0x65'),_0x6454('0x66'),'IS\x20EMPTY',_0x6454('0x68')],_0x21d0f7);};var _0x5a551b=function(_0x2156fa){if(!_0x2156fa||!_0x2156fa[_0x6454('0x69')][_0x6454('0x49')]){return'';}for(var _0x325047='(',_0x3ce406=0x0;_0x3ce406<_0x2156fa['rules'][_0x6454('0x49')];_0x3ce406+=0x1){_0x3ce406>0x0&&(_0x325047+='\x20'+_0x2156fa['operator']+'\x20');_0x325047+=_0x2156fa[_0x6454('0x69')][_0x3ce406]['group']?_0x5a551b(_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x6b')]):_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x7d')]+'\x20'+_0x2156fa[_0x6454('0x69')][_0x3ce406]['condition']+(_0x1591ef(_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x6c')])?'\x20'+_0x2156fa[_0x6454('0x69')][_0x3ce406][_0x6454('0x6d')]:'');}return _0x325047+')';};var _0x4b59={'where':{'id':_0x2495b3['id']}},_0x2aea6a,_0x4a8ec0,_0x26ffc8,_0x537beb,_0x55158a;_0x4b59=_[_0x6454('0x41')]({},_0x4b59,_0x990271);return db[_0x6454('0x30')][_0x6454('0x4a')](_0x4b59)['then'](function(_0x25d5df){if(_0x25d5df){_0x2aea6a=_0x25d5df;return _0x25d5df[_0x6454('0x6f')]();}return null;})[_0x6454('0x27')](function(_0x30ce7e){if(_0x30ce7e){if(!_0x30ce7e[_0x6454('0x49')]){throw new db['Sequelize'][(_0x6454('0x71'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4a8ec0=_0x30ce7e;return db[_0x6454('0x8c')][_0x6454('0x45')]({'raw':!![]});}return null;})[_0x6454('0x27')](function(_0x4450ef){if(_0x4450ef){_0x26ffc8=_[_0x6454('0x73')](_0x4450ef,'id');var _0x9d2a5e;var _0x2d5760=squel['select']();_0x2d5760['from'](_0x2aea6a[_0x6454('0x75')]);for(var _0x246cf1=0x0;_0x246cf1<_0x4a8ec0[_0x6454('0x49')];_0x246cf1+=0x1){_0x9d2a5e=_0x4a8ec0[_0x246cf1]['MetricId']?_0x26ffc8[_0x4a8ec0[_0x246cf1][_0x6454('0x76')]][_0x6454('0x8d')]:_0x4a8ec0[_0x246cf1]['field'];_0x9d2a5e=_0x4a8ec0[_0x246cf1]['function']?_['replace'](_0x57fc1f[_0x4a8ec0[_0x246cf1][_0x6454('0x77')]],'%s',_0x9d2a5e):_0x9d2a5e;_0x9d2a5e=_0x4a8ec0[_0x246cf1][_0x6454('0x78')]?_[_0x6454('0x79')](_0x5742ac[_0x4a8ec0[_0x246cf1]['format']],'%s',_0x9d2a5e):_0x9d2a5e;if(_0x4a8ec0[_0x246cf1]['groupBy']){_0x2d5760[_0x6454('0x6b')](_0x9d2a5e);}_0x4a8ec0[_0x246cf1][_0x6454('0x7b')]&&_0x2d5760[_0x6454('0x3d')](_0x9d2a5e,_0x4a8ec0[_0x246cf1][_0x6454('0x7b')]===_0x6454('0x7c')?![]:!![]);_0x2d5760[_0x6454('0x7d')](_0x9d2a5e,_0x4a8ec0[_0x246cf1]['alias']||_0x9d2a5e);}if(_0x2aea6a[_0x6454('0x7e')]){_0x2aea6a['joins']=JSON[_0x6454('0x85')](_0x2aea6a[_0x6454('0x7e')]);for(var _0x47a568=0x0;_0x47a568<_0x2aea6a[_0x6454('0x7e')][_0x6454('0x49')];_0x47a568+=0x1){if(_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x33')]&&_['includes'](_0x711b23,_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x33')])&&_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x83')]&&_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x80')]&&_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x81')]){_0x2d5760[_0x2aea6a[_0x6454('0x7e')][_0x47a568]['type']](_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x80')],null,util[_0x6454('0x78')](_0x6454('0x82'),_0x2aea6a[_0x6454('0x75')],_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x83')],_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x80')],_0x2aea6a[_0x6454('0x7e')][_0x47a568][_0x6454('0x81')]));}}}if(_0x2aea6a[_0x6454('0x84')]){_0x2aea6a[_0x6454('0x84')]=JSON[_0x6454('0x85')](_0x2aea6a[_0x6454('0x84')]);_0x2d5760['where'](_0x5a551b(_0x2aea6a[_0x6454('0x84')][_0x6454('0x6b')]));}_0x55158a=_0x2d5760[_0x6454('0x8e')]();_0x2d5760[_0x6454('0x20')](_0x47ce28);_0x2d5760[_0x6454('0x1f')](0x0);return;}})[_0x6454('0x27')](function(){if(_0x469033[_0x6454('0x8f')]===_0x6454('0x90')){return null;}var _0x56d925=_[_0x6454('0x41')](_0x469033,{'name':_0x469033[_0x6454('0x91')]||_0x469033[_0x6454('0x2c')]||_0x2aea6a[_0x6454('0x2c')],'basename':_0x4b9341,'savename':util[_0x6454('0x78')]('%s-%s.%s',_0x469033['name']||_0x2aea6a[_0x6454('0x2c')],require(_0x6454('0x92'))[_0x6454('0x93')](0x4),_0x469033[_0x6454('0x8f')]||_0x6454('0x94')),'reportId':_0x2aea6a['id'],'reportType':_0x6454('0x95')});return db[_0x6454('0x96')][_0x6454('0x4b')](_0x56d925,{'raw':!![]});})[_0x6454('0x27')](function(_0x3da583){if(_0x2aea6a[_0x6454('0x75')]===_0x6454('0x97')){_0x55158a[_0x6454('0x3e')](_0x2aea6a[_0x6454('0x75')]+_0x6454('0x98'),_0x469033[_0x6454('0x99')],_0x469033['endDate']);}else{_0x55158a['where'](_0x2aea6a[_0x6454('0x75')]+_0x6454('0x9a'),_0x469033[_0x6454('0x99')],_0x469033[_0x6454('0x9b')]);}if(_0x3da583){logger[_0x6454('0x9c')](_0x6454('0x9d'),_0x55158a[_0x6454('0x88')]());require(_0x6454('0x9e'))['fork'](path[_0x6454('0x8a')](__dirname,_0x6454('0x9f'),_0x3da583['output']),[_0x3da583['id'],_0x55158a[_0x6454('0x88')](),path[_0x6454('0x8a')](__dirname,_0x6454('0xa0'),_0x3da583['savename']),_0x4b9341]);return _0x3da583;}else{var _0x1b7d9b=squel[_0x6454('0xa1')]();_0x1b7d9b[_0x6454('0x74')]('('+_0x55158a['toString']()+')','countTable');_0x1b7d9b[_0x6454('0x7d')](_0x6454('0xa2'),_0x6454('0x1e'));_0x55158a[_0x6454('0x20')](_0x469033[_0x6454('0x20')]||_0x47ce28);_0x55158a[_0x6454('0x1f')](_0x469033['offset']||0x0);return dbH[_0x6454('0x89')]['query'](_0x1b7d9b[_0x6454('0x88')](),{'type':dbH[_0x6454('0x89')][_0x6454('0xa3')]['SELECT']})[_0x6454('0x27')](function(_0x165919){if(!_0x165919[_0x6454('0x49')]){_0x537beb=0x0;}else{_0x537beb=_0x165919[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x55158a['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x6454('0xa4')]});})['then'](function(_0x46c318){return{'rows':_0x46c318||[],'count':_0x537beb};});}});}exports['run']=function(_0x8a3e23,_0x568b57){return runReport(_0x8a3e23[_0x6454('0x55')],_0x8a3e23[_0x6454('0x36')],_0x8a3e23[_0x6454('0x6e')])[_0x6454('0x27')](respondWithResult(_0x568b57,null))[_0x6454('0x47')](handleError(_0x568b57,null));};exports[_0x6454('0xa5')]=runReport;exports['query']=function(_0x426d65,_0x42fa20){var _0x5087c3=0xa;var _0x8948b8=[_0x6454('0x8a'),_0x6454('0x8b'),_0x6454('0x56'),_0x6454('0x57')];var _0x1d180e={'SUM':'SUM(%s)','COUNT':_0x6454('0x59'),'COUNT DISTINCT':_0x6454('0x5a'),'MAX':_0x6454('0x5b'),'MIN':_0x6454('0x5c'),'AVG':_0x6454('0x5d'),'GROUP_CONCAT':_0x6454('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x6454('0x60')};var _0x47cb53={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x6454('0x62'),'HOUR':_0x6454('0x63'),'ROUND':_0x6454('0x64'),'UNIX_TIMESTAMP':_0x6454('0xa6')};var _0x5d8c61=function(_0x4a4db6){return!_['includes'](['IS\x20NULL',_0x6454('0x66'),_0x6454('0x67'),_0x6454('0x68')],_0x4a4db6);};var _0x103e31=function(_0x4d26ec){if(!_0x4d26ec||!_0x4d26ec['rules'][_0x6454('0x49')]){return'';}for(var _0x187a5c='(',_0x970c99=0x0;_0x970c99<_0x4d26ec[_0x6454('0x69')]['length'];_0x970c99+=0x1){_0x970c99>0x0&&(_0x187a5c+='\x20'+_0x4d26ec['operator']+'\x20');_0x187a5c+=_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6b')]?_0x103e31(_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6b')]):_0x4d26ec[_0x6454('0x69')][_0x970c99]['field']+'\x20'+_0x4d26ec[_0x6454('0x69')][_0x970c99]['condition']+(_0x5d8c61(_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6c')])?'\x20'+_0x4d26ec[_0x6454('0x69')][_0x970c99][_0x6454('0x6d')]:'');}return _0x187a5c+')';};var _0x29472b={'where':{'id':_0x426d65[_0x6454('0x55')]['id']}},_0x364749,_0x24bd06,_0x2919a4,_0x4664f1,_0x4aefd3;_0x29472b=_[_0x6454('0x41')]({},_0x29472b,_0x426d65[_0x6454('0x6e')]);return db[_0x6454('0x30')]['find'](_0x29472b)[_0x6454('0x27')](function(_0x15a988){if(_0x15a988){_0x364749=_0x15a988;return _0x15a988['getFields']();}return null;})[_0x6454('0x27')](function(_0x345d7c){if(_0x345d7c){if(!_0x345d7c[_0x6454('0x49')]){throw new db[(_0x6454('0x70'))]['ValidationErrorItem'](_0x6454('0x72'),0x193);}_0x24bd06=_0x345d7c;return db['AnalyticMetric'][_0x6454('0x45')]({'raw':!![]});}return null;})[_0x6454('0x27')](function(_0x170cd5){if(_0x170cd5){_0x2919a4=_['keyBy'](_0x170cd5,'id');var _0x1be96b;var _0x33fb42=squel[_0x6454('0xa1')]();_0x33fb42[_0x6454('0x74')](_0x364749[_0x6454('0x75')]);for(var _0x1e303b=0x0;_0x1e303b<_0x24bd06[_0x6454('0x49')];_0x1e303b+=0x1){_0x1be96b=_0x24bd06[_0x1e303b][_0x6454('0x76')]?_0x2919a4[_0x24bd06[_0x1e303b][_0x6454('0x76')]][_0x6454('0x8d')]:_0x24bd06[_0x1e303b][_0x6454('0x7d')];_0x1be96b=_0x24bd06[_0x1e303b][_0x6454('0x77')]?_[_0x6454('0x79')](_0x1d180e[_0x24bd06[_0x1e303b]['function']],'%s',_0x1be96b):_0x1be96b;_0x1be96b=_0x24bd06[_0x1e303b][_0x6454('0x78')]?_[_0x6454('0x79')](_0x47cb53[_0x24bd06[_0x1e303b][_0x6454('0x78')]],'%s',_0x1be96b):_0x1be96b;if(_0x24bd06[_0x1e303b][_0x6454('0x7a')]){_0x33fb42[_0x6454('0x6b')](_0x1be96b);}_0x24bd06[_0x1e303b][_0x6454('0x7b')]&&_0x33fb42['order'](_0x1be96b,_0x24bd06[_0x1e303b]['orderBy']===_0x6454('0x7c')?![]:!![]);_0x33fb42[_0x6454('0x7d')](_0x1be96b,_0x24bd06[_0x1e303b][_0x6454('0xa7')]||_0x1be96b);}if(_0x364749[_0x6454('0x7e')]){_0x364749[_0x6454('0x7e')]=JSON[_0x6454('0x85')](_0x364749[_0x6454('0x7e')]);for(var _0x52779e=0x0;_0x52779e<_0x364749[_0x6454('0x7e')][_0x6454('0x49')];_0x52779e+=0x1){if(_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x33')]&&_[_0x6454('0x7f')](_0x8948b8,_0x364749[_0x6454('0x7e')][_0x52779e]['type'])&&_0x364749[_0x6454('0x7e')][_0x52779e]['parentKey']&&_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x80')]&&_0x364749[_0x6454('0x7e')][_0x52779e]['foreignKey']){_0x33fb42[_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x33')]](_0x364749['joins'][_0x52779e][_0x6454('0x80')],null,util[_0x6454('0x78')](_0x6454('0x82'),_0x364749[_0x6454('0x75')],_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x83')],_0x364749[_0x6454('0x7e')][_0x52779e]['foreignTable'],_0x364749[_0x6454('0x7e')][_0x52779e][_0x6454('0x81')]));}}}if(_0x364749[_0x6454('0x84')]){_0x364749[_0x6454('0x84')]=JSON[_0x6454('0x85')](_0x364749[_0x6454('0x84')]);_0x33fb42[_0x6454('0x3e')](_0x103e31(_0x364749[_0x6454('0x84')][_0x6454('0x6b')]));}_0x4aefd3=_0x33fb42['clone']();_0x33fb42[_0x6454('0x20')](_0x5087c3);_0x33fb42[_0x6454('0x1f')](0x0);logger['debug'](_0x6454('0x87'),_0x33fb42[_0x6454('0x88')]());return dbH[_0x6454('0x89')][_0x6454('0x36')](_0x33fb42[_0x6454('0x88')](),{'type':dbH[_0x6454('0x89')][_0x6454('0xa3')][_0x6454('0xa4')]});}})[_0x6454('0x27')](function(){return{'sql':_0x4aefd3[_0x6454('0x88')]()};})[_0x6454('0x27')](respondWithResult(_0x42fa20,null))['catch'](handleError(_0x42fa20,null));}; \ No newline at end of file +var _0x98ee=['mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','send','index','map','AnalyticCustomReport','model','query','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','include','params','keys','fields','length','includeAll','merge','options','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','from','table','MetricId','function','replace','format','groupBy','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','debug','Limited\x20Query:','toString','sequelize','join','COUNT(%s)','IS\x20NOT\x20EMPTY','getFields','metric','orderBy','alias','clone','output','web','fullPath','%s-%s.%s','generate','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../files/reports','select','countTable','COUNT(*)','QueryTypes','SELECT','run','runReport','SUM(%s)','DATE(%s)','DESC','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x3472c6,_0x24af4c){var _0x5b85e8=function(_0x43eb06){while(--_0x43eb06){_0x3472c6['push'](_0x3472c6['shift']());}};_0x5b85e8(++_0x24af4c);}(_0x98ee,0x131));var _0xe98e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x98ee[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xe98e('0x0'));var rimraf=require(_0xe98e('0x1'));var zipdir=require(_0xe98e('0x2'));var jsonpatch=require(_0xe98e('0x3'));var rp=require(_0xe98e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe98e('0x5'));var util=require(_0xe98e('0x6'));var path=require(_0xe98e('0x7'));var sox=require(_0xe98e('0x8'));var csv=require(_0xe98e('0x9'));var ejs=require(_0xe98e('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe98e('0xb'));var squel=require('squel');var crypto=require(_0xe98e('0xc'));var jsforce=require(_0xe98e('0xd'));var deskjs=require(_0xe98e('0xe'));var toCsv=require(_0xe98e('0x9'));var querystring=require('querystring');var Papa=require(_0xe98e('0xf'));var Redis=require('ioredis');var authService=require(_0xe98e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe98e('0x11'));var hardwareService=require(_0xe98e('0x12'));var logger=require(_0xe98e('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe98e('0x14'));var db=require(_0xe98e('0x15'))['db'];var dbH=require('../../mysqldb')[_0xe98e('0x16')];function respondWithStatusCode(_0x26553d,_0x3c9d12){_0x3c9d12=_0x3c9d12||0xcc;return function(_0x2c8521){if(_0x2c8521){return _0x26553d[_0xe98e('0x17')](_0x3c9d12);}return _0x26553d[_0xe98e('0x18')](_0x3c9d12)[_0xe98e('0x19')]();};}function respondWithResult(_0x44f80e,_0x4d6e5c){_0x4d6e5c=_0x4d6e5c||0xc8;return function(_0x429f24){if(_0x429f24){return _0x44f80e['status'](_0x4d6e5c)[_0xe98e('0x1a')](_0x429f24);}};}function respondWithFilteredResult(_0x3735b1,_0x1549a1){return function(_0x2afe98){if(_0x2afe98){var _0x5b7c7b=typeof _0x1549a1[_0xe98e('0x1b')]===_0xe98e('0x1c')&&typeof _0x1549a1[_0xe98e('0x1d')]===_0xe98e('0x1c');var _0x1eacdb=_0x2afe98['count'];var _0x27fe66=_0x5b7c7b?0x0:_0x1549a1[_0xe98e('0x1b')];var _0x213bbe=_0x5b7c7b?_0x2afe98[_0xe98e('0x1e')]:_0x1549a1[_0xe98e('0x1b')]+_0x1549a1['limit'];var _0x5afe6d;if(_0x213bbe>=_0x1eacdb){_0x213bbe=_0x1eacdb;_0x5afe6d=0xc8;}else{_0x5afe6d=0xce;}_0x3735b1[_0xe98e('0x18')](_0x5afe6d);return _0x3735b1['set']('Content-Range',_0x27fe66+'-'+_0x213bbe+'/'+_0x1eacdb)['json'](_0x2afe98);}return null;};}function patchUpdates(_0x3057d6){return function(_0x12398a){try{jsonpatch['apply'](_0x12398a,_0x3057d6,!![]);}catch(_0x12b1b3){return BPromise[_0xe98e('0x1f')](_0x12b1b3);}return _0x12398a[_0xe98e('0x20')]();};}function saveUpdates(_0x389812,_0x2823e3){return function(_0x1f051e){if(_0x1f051e){return _0x1f051e[_0xe98e('0x21')](_0x389812)[_0xe98e('0x22')](function(_0x519162){return _0x519162;});}return null;};}function removeEntity(_0xd33468,_0x995f8c){return function(_0x35b6cf){if(_0x35b6cf){return _0x35b6cf[_0xe98e('0x23')]()['then'](function(){var _0x22fad5=_0x35b6cf[_0xe98e('0x24')]({'plain':!![]});var _0x3ad40b=_0xe98e('0x25');return db[_0xe98e('0x26')]['destroy']({'where':{'type':_0x3ad40b,'resourceId':_0x22fad5['id']}})[_0xe98e('0x22')](function(){return _0x35b6cf;});})['then'](function(){_0xd33468[_0xe98e('0x18')](0xcc)[_0xe98e('0x19')]();});}};}function handleEntityNotFound(_0x25d04d,_0x5c1e66){return function(_0x5bd850){if(!_0x5bd850){_0x25d04d[_0xe98e('0x17')](0x194);}return _0x5bd850;};}function handleError(_0x566858,_0x57438c){_0x57438c=_0x57438c||0x1f4;return function(_0xd3b22e){logger[_0xe98e('0x27')](_0xd3b22e[_0xe98e('0x28')]);if(_0xd3b22e['name']){delete _0xd3b22e[_0xe98e('0x29')];}_0x566858[_0xe98e('0x18')](_0x57438c)[_0xe98e('0x2a')](_0xd3b22e);};}exports[_0xe98e('0x2b')]=function(_0xe380d9,_0x513e16){var _0x26590c={},_0x248de1={},_0x288452={'count':0x0,'rows':[]};var _0x4a8143=_[_0xe98e('0x2c')](db[_0xe98e('0x2d')]['rawAttributes'],function(_0x3645a5){return{'name':_0x3645a5['fieldName'],'type':_0x3645a5['type']['key']};});_0x248de1[_0xe98e('0x2e')]=_[_0xe98e('0x2c')](_0x4a8143,_0xe98e('0x29'));_0x248de1[_0xe98e('0x2f')]=_['keys'](_0xe380d9[_0xe98e('0x2f')]);_0x248de1[_0xe98e('0x30')]=_['intersection'](_0x248de1['model'],_0x248de1[_0xe98e('0x2f')]);_0x26590c[_0xe98e('0x31')]=_[_0xe98e('0x32')](_0x248de1[_0xe98e('0x2e')],qs['fields'](_0xe380d9[_0xe98e('0x2f')]['fields']));_0x26590c[_0xe98e('0x31')]=_0x26590c[_0xe98e('0x31')]['length']?_0x26590c[_0xe98e('0x31')]:_0x248de1[_0xe98e('0x2e')];if(!_0xe380d9[_0xe98e('0x2f')][_0xe98e('0x33')](_0xe98e('0x34'))){_0x26590c['limit']=qs[_0xe98e('0x1d')](_0xe380d9['query'][_0xe98e('0x1d')]);_0x26590c[_0xe98e('0x1b')]=qs[_0xe98e('0x1b')](_0xe380d9[_0xe98e('0x2f')][_0xe98e('0x1b')]);}_0x26590c[_0xe98e('0x35')]=qs[_0xe98e('0x36')](_0xe380d9[_0xe98e('0x2f')]['sort']);_0x26590c[_0xe98e('0x37')]=qs[_0xe98e('0x30')](_['pick'](_0xe380d9[_0xe98e('0x2f')],_0x248de1[_0xe98e('0x30')]),_0x4a8143);if(_0xe380d9[_0xe98e('0x2f')][_0xe98e('0x38')]){_0x26590c[_0xe98e('0x37')]=_['merge'](_0x26590c['where'],{'$or':_[_0xe98e('0x2c')](_0x4a8143,function(_0x75476d){if(_0x75476d['type']!==_0xe98e('0x39')){var _0x22245b={};_0x22245b[_0x75476d[_0xe98e('0x29')]]={'$like':'%'+_0xe380d9[_0xe98e('0x2f')]['filter']+'%'};return _0x22245b;}})});}_0x26590c=_['merge']({},_0x26590c,_0xe380d9['options']);var _0x3f8fed={'where':_0x26590c[_0xe98e('0x37')]};return db['AnalyticCustomReport'][_0xe98e('0x1e')](_0x3f8fed)[_0xe98e('0x22')](function(_0x1c0bda){_0x288452[_0xe98e('0x1e')]=_0x1c0bda;if(_0xe380d9['query']['includeAll']){_0x26590c[_0xe98e('0x3a')]=[{'all':!![]}];}return db['AnalyticCustomReport']['findAll'](_0x26590c);})[_0xe98e('0x22')](function(_0x5c5ae9){_0x288452['rows']=_0x5c5ae9;return _0x288452;})[_0xe98e('0x22')](respondWithFilteredResult(_0x513e16,_0x26590c))['catch'](handleError(_0x513e16,null));};exports['show']=function(_0x227f53,_0x54d4e5){var _0x519416={'raw':![],'where':{'id':_0x227f53[_0xe98e('0x3b')]['id']}},_0x495928={};_0x495928['model']=_[_0xe98e('0x3c')](db['AnalyticCustomReport']['rawAttributes']);_0x495928[_0xe98e('0x2f')]=_['keys'](_0x227f53[_0xe98e('0x2f')]);_0x495928['filters']=_[_0xe98e('0x32')](_0x495928[_0xe98e('0x2e')],_0x495928[_0xe98e('0x2f')]);_0x519416['attributes']=_[_0xe98e('0x32')](_0x495928[_0xe98e('0x2e')],qs['fields'](_0x227f53[_0xe98e('0x2f')][_0xe98e('0x3d')]));_0x519416[_0xe98e('0x31')]=_0x519416[_0xe98e('0x31')][_0xe98e('0x3e')]?_0x519416[_0xe98e('0x31')]:_0x495928[_0xe98e('0x2e')];if(_0x227f53[_0xe98e('0x2f')][_0xe98e('0x3f')]){_0x519416[_0xe98e('0x3a')]=[{'all':!![]}];}_0x519416=_[_0xe98e('0x40')]({},_0x519416,_0x227f53[_0xe98e('0x41')]);return db['AnalyticCustomReport'][_0xe98e('0x42')](_0x519416)['then'](handleEntityNotFound(_0x54d4e5,null))[_0xe98e('0x22')](respondWithResult(_0x54d4e5,null))[_0xe98e('0x43')](handleError(_0x54d4e5,null));};exports['create']=function(_0x5627e4,_0x489344){return db[_0xe98e('0x2d')][_0xe98e('0x44')](_0x5627e4[_0xe98e('0x45')],{})[_0xe98e('0x22')](function(_0x43103c){var _0x935800=_0x5627e4['user'][_0xe98e('0x24')]({'plain':!![]});if(!_0x935800)throw new Error(_0xe98e('0x46'));if(_0x935800['role']==='user'){var _0x241507=_0x43103c[_0xe98e('0x24')]({'plain':!![]});var _0x34332d='Reports';return db[_0xe98e('0x47')][_0xe98e('0x42')]({'where':{'name':_0x34332d,'userProfileId':_0x935800['userProfileId']},'raw':!![]})[_0xe98e('0x22')](function(_0x3e036e){if(_0x3e036e&&_0x3e036e[_0xe98e('0x48')]===0x0){return db[_0xe98e('0x26')]['create']({'name':_0x241507[_0xe98e('0x29')],'resourceId':_0x241507['id'],'type':_0xe98e('0x25'),'sectionId':_0x3e036e['id']},{})[_0xe98e('0x22')](function(){return _0x43103c;});}else{return _0x43103c;}})['catch'](function(_0x420491){logger[_0xe98e('0x27')](_0xe98e('0x49'),_0x420491);throw _0x420491;});}return _0x43103c;})[_0xe98e('0x22')](respondWithResult(_0x489344,0xc9))[_0xe98e('0x43')](handleError(_0x489344,null));};exports[_0xe98e('0x21')]=function(_0x4d0144,_0x4159ff){if(_0x4d0144['body']['id']){delete _0x4d0144['body']['id'];}return db[_0xe98e('0x2d')][_0xe98e('0x42')]({'where':{'id':_0x4d0144[_0xe98e('0x3b')]['id']}})[_0xe98e('0x22')](handleEntityNotFound(_0x4159ff,null))[_0xe98e('0x22')](saveUpdates(_0x4d0144[_0xe98e('0x45')],null))[_0xe98e('0x22')](respondWithResult(_0x4159ff,null))[_0xe98e('0x43')](handleError(_0x4159ff,null));};exports[_0xe98e('0x23')]=function(_0x235caf,_0x5d8108){return db[_0xe98e('0x2d')]['find']({'where':{'id':_0x235caf['params']['id']}})[_0xe98e('0x22')](handleEntityNotFound(_0x5d8108,null))[_0xe98e('0x22')](removeEntity(_0x5d8108,null))['catch'](handleError(_0x5d8108,null));};exports[_0xe98e('0x4a')]=function(_0x29725c,_0x5192a9){var _0x52712d=0xa;var _0x2baa81=['join',_0xe98e('0x4b'),_0xe98e('0x4c'),_0xe98e('0x4d')];var _0x5bf7ab={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe98e('0x4e'),'MAX':_0xe98e('0x4f'),'MIN':_0xe98e('0x50'),'AVG':_0xe98e('0x51'),'GROUP_CONCAT':_0xe98e('0x52'),'GROUP_CONCAT ASC':_0xe98e('0x53'),'GROUP_CONCAT DESC':_0xe98e('0x54')};var _0x152975={'SEC_TO_TIME':_0xe98e('0x55'),'DATE':'DATE(%s)','HOUR':_0xe98e('0x56'),'ROUND':_0xe98e('0x57'),'UNIX_TIMESTAMP':_0xe98e('0x58')};var _0x3e0a20=function(_0x109fd7){return!_[_0xe98e('0x59')]([_0xe98e('0x5a'),_0xe98e('0x5b'),_0xe98e('0x5c'),'IS\x20NOT\x20EMPTY'],_0x109fd7);};var _0x127363=function(_0x5c1117){if(!_0x5c1117||!_0x5c1117['rules'][_0xe98e('0x3e')]){return'';}for(var _0x426431='(',_0x5c1f8e=0x0;_0x5c1f8e<_0x5c1117[_0xe98e('0x5d')][_0xe98e('0x3e')];_0x5c1f8e+=0x1){_0x5c1f8e>0x0&&(_0x426431+='\x20'+_0x5c1117[_0xe98e('0x5e')]+'\x20');_0x426431+=_0x5c1117['rules'][_0x5c1f8e][_0xe98e('0x5f')]?_0x127363(_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e]['group']):_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e][_0xe98e('0x60')]+'\x20'+_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e][_0xe98e('0x61')]+(_0x3e0a20(_0x5c1117[_0xe98e('0x5d')][_0x5c1f8e]['condition'])?'\x20'+_0x5c1117['rules'][_0x5c1f8e][_0xe98e('0x62')]:'');}return _0x426431+')';};var _0x573666={'where':{'id':_0x29725c[_0xe98e('0x3b')]['id']}},_0x383248,_0x4ecd11,_0x33cb2f,_0x1e01b8,_0x3140b3;_0x573666=_[_0xe98e('0x40')]({},_0x573666,_0x29725c['options']);return db[_0xe98e('0x2d')][_0xe98e('0x42')](_0x573666)[_0xe98e('0x22')](function(_0xa0cb19){if(_0xa0cb19){_0x383248=_0xa0cb19;return _0xa0cb19['getFields']();}return null;})['then'](function(_0x475dc1){if(_0x475dc1){if(!_0x475dc1[_0xe98e('0x3e')]){throw new db[(_0xe98e('0x63'))][(_0xe98e('0x64'))](_0xe98e('0x65'),0x193);}_0x4ecd11=_0x475dc1;return db[_0xe98e('0x66')][_0xe98e('0x67')]({'raw':!![]});}return null;})[_0xe98e('0x22')](function(_0x12e2ce){if(_0x12e2ce){_0x33cb2f=_[_0xe98e('0x68')](_0x12e2ce,'id');var _0x478987;var _0x4617cf=squel['select']();_0x4617cf[_0xe98e('0x69')](_0x383248[_0xe98e('0x6a')]);for(var _0x443721=0x0;_0x443721<_0x4ecd11[_0xe98e('0x3e')];_0x443721+=0x1){_0x478987=_0x4ecd11[_0x443721][_0xe98e('0x6b')]?_0x33cb2f[_0x4ecd11[_0x443721][_0xe98e('0x6b')]]['metric']:_0x4ecd11[_0x443721][_0xe98e('0x60')];_0x478987=_0x4ecd11[_0x443721][_0xe98e('0x6c')]?_[_0xe98e('0x6d')](_0x5bf7ab[_0x4ecd11[_0x443721][_0xe98e('0x6c')]],'%s',_0x478987):_0x478987;_0x478987=_0x4ecd11[_0x443721][_0xe98e('0x6e')]?_['replace'](_0x152975[_0x4ecd11[_0x443721][_0xe98e('0x6e')]],'%s',_0x478987):_0x478987;if(_0x4ecd11[_0x443721][_0xe98e('0x6f')]){_0x4617cf[_0xe98e('0x5f')](_0x478987);}_0x4ecd11[_0x443721]['orderBy']&&_0x4617cf[_0xe98e('0x35')](_0x478987,_0x4ecd11[_0x443721]['orderBy']==='DESC'?![]:!![]);_0x4617cf[_0xe98e('0x60')](_0x478987,_0x4ecd11[_0x443721]['alias']||_0x478987);}if(_0x383248[_0xe98e('0x70')]){_0x383248[_0xe98e('0x70')]=JSON[_0xe98e('0x71')](_0x383248[_0xe98e('0x70')]);for(var _0x35792a=0x0;_0x35792a<_0x383248[_0xe98e('0x70')]['length'];_0x35792a+=0x1){if(_0x383248[_0xe98e('0x70')][_0x35792a]['type']&&_['includes'](_0x2baa81,_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x72')])&&_0x383248['joins'][_0x35792a][_0xe98e('0x73')]&&_0x383248['joins'][_0x35792a][_0xe98e('0x74')]&&_0x383248['joins'][_0x35792a][_0xe98e('0x75')]){_0x4617cf[_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x72')]](_0x383248[_0xe98e('0x70')][_0x35792a]['foreignTable'],null,util[_0xe98e('0x6e')](_0xe98e('0x76'),_0x383248[_0xe98e('0x6a')],_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x73')],_0x383248[_0xe98e('0x70')][_0x35792a][_0xe98e('0x74')],_0x383248['joins'][_0x35792a][_0xe98e('0x75')]));}}}if(_0x383248[_0xe98e('0x77')]){_0x383248[_0xe98e('0x77')]=JSON[_0xe98e('0x71')](_0x383248[_0xe98e('0x77')]);_0x4617cf[_0xe98e('0x37')](_0x127363(_0x383248[_0xe98e('0x77')][_0xe98e('0x5f')]));}_0x3140b3=_0x4617cf['clone']();_0x4617cf[_0xe98e('0x1d')](_0x52712d);_0x4617cf['offset'](0x0);logger[_0xe98e('0x78')](_0xe98e('0x79'),_0x4617cf[_0xe98e('0x7a')]());return dbH[_0xe98e('0x7b')]['query'](_0x4617cf[_0xe98e('0x7a')](),{'type':dbH[_0xe98e('0x7b')]['QueryTypes']['SELECT']});}})['then'](respondWithResult(_0x5192a9,null))[_0xe98e('0x43')](handleError(_0x5192a9,null));};function runReport(_0x28d7e3,_0x204830,_0x56716a){var _0x3e6352=_0x204830[_0xe98e('0x29')];var _0x1512a4=0xa;var _0xd09344=[_0xe98e('0x7c'),'left_join','right_join',_0xe98e('0x4d')];var _0x507c98={'SUM':'SUM(%s)','COUNT':_0xe98e('0x7d'),'COUNT DISTINCT':_0xe98e('0x4e'),'MAX':_0xe98e('0x4f'),'MIN':_0xe98e('0x50'),'AVG':_0xe98e('0x51'),'GROUP_CONCAT':_0xe98e('0x52'),'GROUP_CONCAT ASC':_0xe98e('0x53'),'GROUP_CONCAT DESC':_0xe98e('0x54')};var _0x186ca0={'SEC_TO_TIME':_0xe98e('0x55'),'DATE':'DATE(%s)','HOUR':_0xe98e('0x56'),'ROUND':_0xe98e('0x57'),'UNIX_TIMESTAMP':_0xe98e('0x58')};var _0x3c9a96=function(_0x28dc14){return!_[_0xe98e('0x59')](['IS\x20NULL','IS\x20NOT\x20NULL',_0xe98e('0x5c'),_0xe98e('0x7e')],_0x28dc14);};var _0x3edd86=function(_0x3d1cb5){if(!_0x3d1cb5||!_0x3d1cb5['rules'][_0xe98e('0x3e')]){return'';}for(var _0x428be1='(',_0x5b330f=0x0;_0x5b330f<_0x3d1cb5[_0xe98e('0x5d')][_0xe98e('0x3e')];_0x5b330f+=0x1){_0x5b330f>0x0&&(_0x428be1+='\x20'+_0x3d1cb5[_0xe98e('0x5e')]+'\x20');_0x428be1+=_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f]['group']?_0x3edd86(_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f][_0xe98e('0x5f')]):_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f]['field']+'\x20'+_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f][_0xe98e('0x61')]+(_0x3c9a96(_0x3d1cb5[_0xe98e('0x5d')][_0x5b330f][_0xe98e('0x61')])?'\x20'+_0x3d1cb5['rules'][_0x5b330f][_0xe98e('0x62')]:'');}return _0x428be1+')';};var _0x30477c={'where':{'id':_0x28d7e3['id']}},_0x3120be,_0x19ee16,_0x21a732,_0x15471b,_0x4a4ab2;_0x30477c=_[_0xe98e('0x40')]({},_0x30477c,_0x56716a);return db[_0xe98e('0x2d')]['find'](_0x30477c)['then'](function(_0x22715b){if(_0x22715b){_0x3120be=_0x22715b;return _0x22715b[_0xe98e('0x7f')]();}return null;})[_0xe98e('0x22')](function(_0x2d9997){if(_0x2d9997){if(!_0x2d9997[_0xe98e('0x3e')]){throw new db[(_0xe98e('0x63'))][(_0xe98e('0x64'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x19ee16=_0x2d9997;return db[_0xe98e('0x66')][_0xe98e('0x67')]({'raw':!![]});}return null;})[_0xe98e('0x22')](function(_0x2e9b50){if(_0x2e9b50){_0x21a732=_['keyBy'](_0x2e9b50,'id');var _0x20a44a;var _0x3b256f=squel['select']();_0x3b256f[_0xe98e('0x69')](_0x3120be[_0xe98e('0x6a')]);for(var _0x225eb0=0x0;_0x225eb0<_0x19ee16['length'];_0x225eb0+=0x1){_0x20a44a=_0x19ee16[_0x225eb0][_0xe98e('0x6b')]?_0x21a732[_0x19ee16[_0x225eb0][_0xe98e('0x6b')]][_0xe98e('0x80')]:_0x19ee16[_0x225eb0][_0xe98e('0x60')];_0x20a44a=_0x19ee16[_0x225eb0][_0xe98e('0x6c')]?_['replace'](_0x507c98[_0x19ee16[_0x225eb0][_0xe98e('0x6c')]],'%s',_0x20a44a):_0x20a44a;_0x20a44a=_0x19ee16[_0x225eb0][_0xe98e('0x6e')]?_['replace'](_0x186ca0[_0x19ee16[_0x225eb0][_0xe98e('0x6e')]],'%s',_0x20a44a):_0x20a44a;if(_0x19ee16[_0x225eb0]['groupBy']){_0x3b256f[_0xe98e('0x5f')](_0x20a44a);}_0x19ee16[_0x225eb0][_0xe98e('0x81')]&&_0x3b256f['order'](_0x20a44a,_0x19ee16[_0x225eb0][_0xe98e('0x81')]==='DESC'?![]:!![]);_0x3b256f[_0xe98e('0x60')](_0x20a44a,_0x19ee16[_0x225eb0][_0xe98e('0x82')]||_0x20a44a);}if(_0x3120be['joins']){_0x3120be[_0xe98e('0x70')]=JSON[_0xe98e('0x71')](_0x3120be[_0xe98e('0x70')]);for(var _0x582617=0x0;_0x582617<_0x3120be[_0xe98e('0x70')][_0xe98e('0x3e')];_0x582617+=0x1){if(_0x3120be['joins'][_0x582617]['type']&&_[_0xe98e('0x59')](_0xd09344,_0x3120be['joins'][_0x582617][_0xe98e('0x72')])&&_0x3120be['joins'][_0x582617][_0xe98e('0x73')]&&_0x3120be[_0xe98e('0x70')][_0x582617]['foreignTable']&&_0x3120be[_0xe98e('0x70')][_0x582617][_0xe98e('0x75')]){_0x3b256f[_0x3120be[_0xe98e('0x70')][_0x582617]['type']](_0x3120be[_0xe98e('0x70')][_0x582617][_0xe98e('0x74')],null,util['format'](_0xe98e('0x76'),_0x3120be[_0xe98e('0x6a')],_0x3120be[_0xe98e('0x70')][_0x582617]['parentKey'],_0x3120be[_0xe98e('0x70')][_0x582617][_0xe98e('0x74')],_0x3120be['joins'][_0x582617]['foreignKey']));}}}if(_0x3120be[_0xe98e('0x77')]){_0x3120be[_0xe98e('0x77')]=JSON[_0xe98e('0x71')](_0x3120be[_0xe98e('0x77')]);_0x3b256f[_0xe98e('0x37')](_0x3edd86(_0x3120be[_0xe98e('0x77')][_0xe98e('0x5f')]));}_0x4a4ab2=_0x3b256f[_0xe98e('0x83')]();_0x3b256f[_0xe98e('0x1d')](_0x1512a4);_0x3b256f[_0xe98e('0x1b')](0x0);return;}})[_0xe98e('0x22')](function(){if(_0x204830[_0xe98e('0x84')]===_0xe98e('0x85')){return null;}var _0x3e3934=_[_0xe98e('0x40')](_0x204830,{'name':_0x204830[_0xe98e('0x86')]||_0x204830[_0xe98e('0x29')]||_0x3120be[_0xe98e('0x29')],'basename':_0x3e6352,'savename':util[_0xe98e('0x6e')](_0xe98e('0x87'),_0x204830[_0xe98e('0x29')]||_0x3120be[_0xe98e('0x29')],require('randomstring')[_0xe98e('0x88')](0x4),_0x204830['output']||'csv'),'reportId':_0x3120be['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xe98e('0x44')](_0x3e3934,{'raw':!![]});})[_0xe98e('0x22')](function(_0x55ca63){if(_0x3120be[_0xe98e('0x6a')]===_0xe98e('0x89')){_0x4a4ab2[_0xe98e('0x37')](_0x3120be[_0xe98e('0x6a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x204830[_0xe98e('0x8a')],_0x204830[_0xe98e('0x8b')]);}else{_0x4a4ab2[_0xe98e('0x37')](_0x3120be[_0xe98e('0x6a')]+_0xe98e('0x8c'),_0x204830[_0xe98e('0x8a')],_0x204830[_0xe98e('0x8b')]);}if(_0x55ca63){logger[_0xe98e('0x8d')]('Run\x20Query:',_0x4a4ab2[_0xe98e('0x7a')]());require(_0xe98e('0x8e'))[_0xe98e('0x8f')](path[_0xe98e('0x7c')](__dirname,'../../components/export/',_0x55ca63[_0xe98e('0x84')]),[_0x55ca63['id'],_0x4a4ab2[_0xe98e('0x7a')](),path[_0xe98e('0x7c')](__dirname,_0xe98e('0x90'),_0x55ca63['savename']),_0x3e6352]);return _0x55ca63;}else{var _0x2e00de=squel[_0xe98e('0x91')]();_0x2e00de[_0xe98e('0x69')]('('+_0x4a4ab2['toString']()+')',_0xe98e('0x92'));_0x2e00de[_0xe98e('0x60')](_0xe98e('0x93'),_0xe98e('0x1e'));_0x4a4ab2['limit'](_0x204830[_0xe98e('0x1d')]||_0x1512a4);_0x4a4ab2['offset'](_0x204830['offset']||0x0);return dbH[_0xe98e('0x7b')][_0xe98e('0x2f')](_0x2e00de[_0xe98e('0x7a')](),{'type':dbH[_0xe98e('0x7b')][_0xe98e('0x94')][_0xe98e('0x95')]})[_0xe98e('0x22')](function(_0x54c1a8){if(!_0x54c1a8[_0xe98e('0x3e')]){_0x15471b=0x0;}else{_0x15471b=_0x54c1a8[0x0][_0xe98e('0x1e')]||0x0;}return dbH[_0xe98e('0x7b')][_0xe98e('0x2f')](_0x4a4ab2[_0xe98e('0x7a')](),{'type':dbH[_0xe98e('0x7b')]['QueryTypes'][_0xe98e('0x95')]});})['then'](function(_0xa165cf){return{'rows':_0xa165cf||[],'count':_0x15471b};});}});}exports[_0xe98e('0x96')]=function(_0x3d9f3f,_0x51b47b){return runReport(_0x3d9f3f[_0xe98e('0x3b')],_0x3d9f3f[_0xe98e('0x2f')],_0x3d9f3f[_0xe98e('0x41')])[_0xe98e('0x22')](respondWithResult(_0x51b47b,null))['catch'](handleError(_0x51b47b,null));};exports[_0xe98e('0x97')]=runReport;exports[_0xe98e('0x2f')]=function(_0x11d570,_0x5c452f){var _0x306bae=0xa;var _0x1978cc=[_0xe98e('0x7c'),_0xe98e('0x4b'),'right_join',_0xe98e('0x4d')];var _0x22e991={'SUM':_0xe98e('0x98'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xe98e('0x4e'),'MAX':_0xe98e('0x4f'),'MIN':_0xe98e('0x50'),'AVG':_0xe98e('0x51'),'GROUP_CONCAT':_0xe98e('0x52'),'GROUP_CONCAT ASC':_0xe98e('0x53'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x54718b={'SEC_TO_TIME':_0xe98e('0x55'),'DATE':_0xe98e('0x99'),'HOUR':_0xe98e('0x56'),'ROUND':_0xe98e('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5a5039=function(_0xac35){return!_['includes']([_0xe98e('0x5a'),_0xe98e('0x5b'),_0xe98e('0x5c'),_0xe98e('0x7e')],_0xac35);};var _0x12979c=function(_0x418dae){if(!_0x418dae||!_0x418dae[_0xe98e('0x5d')][_0xe98e('0x3e')]){return'';}for(var _0x26166a='(',_0x35e346=0x0;_0x35e346<_0x418dae[_0xe98e('0x5d')]['length'];_0x35e346+=0x1){_0x35e346>0x0&&(_0x26166a+='\x20'+_0x418dae[_0xe98e('0x5e')]+'\x20');_0x26166a+=_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x5f')]?_0x12979c(_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x5f')]):_0x418dae[_0xe98e('0x5d')][_0x35e346]['field']+'\x20'+_0x418dae[_0xe98e('0x5d')][_0x35e346]['condition']+(_0x5a5039(_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x61')])?'\x20'+_0x418dae[_0xe98e('0x5d')][_0x35e346][_0xe98e('0x62')]:'');}return _0x26166a+')';};var _0x2c1828={'where':{'id':_0x11d570[_0xe98e('0x3b')]['id']}},_0x106046,_0x35e003,_0x5cc834,_0x299a22,_0x4a9138;_0x2c1828=_[_0xe98e('0x40')]({},_0x2c1828,_0x11d570[_0xe98e('0x41')]);return db[_0xe98e('0x2d')][_0xe98e('0x42')](_0x2c1828)[_0xe98e('0x22')](function(_0x11b8ef){if(_0x11b8ef){_0x106046=_0x11b8ef;return _0x11b8ef[_0xe98e('0x7f')]();}return null;})['then'](function(_0x132c35){if(_0x132c35){if(!_0x132c35['length']){throw new db[(_0xe98e('0x63'))]['ValidationErrorItem'](_0xe98e('0x65'),0x193);}_0x35e003=_0x132c35;return db[_0xe98e('0x66')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x2916dd){if(_0x2916dd){_0x5cc834=_['keyBy'](_0x2916dd,'id');var _0x4f9159;var _0x3c3164=squel['select']();_0x3c3164[_0xe98e('0x69')](_0x106046[_0xe98e('0x6a')]);for(var _0xbb36e=0x0;_0xbb36e<_0x35e003[_0xe98e('0x3e')];_0xbb36e+=0x1){_0x4f9159=_0x35e003[_0xbb36e][_0xe98e('0x6b')]?_0x5cc834[_0x35e003[_0xbb36e][_0xe98e('0x6b')]]['metric']:_0x35e003[_0xbb36e][_0xe98e('0x60')];_0x4f9159=_0x35e003[_0xbb36e]['function']?_[_0xe98e('0x6d')](_0x22e991[_0x35e003[_0xbb36e][_0xe98e('0x6c')]],'%s',_0x4f9159):_0x4f9159;_0x4f9159=_0x35e003[_0xbb36e][_0xe98e('0x6e')]?_[_0xe98e('0x6d')](_0x54718b[_0x35e003[_0xbb36e][_0xe98e('0x6e')]],'%s',_0x4f9159):_0x4f9159;if(_0x35e003[_0xbb36e][_0xe98e('0x6f')]){_0x3c3164['group'](_0x4f9159);}_0x35e003[_0xbb36e][_0xe98e('0x81')]&&_0x3c3164[_0xe98e('0x35')](_0x4f9159,_0x35e003[_0xbb36e][_0xe98e('0x81')]===_0xe98e('0x9a')?![]:!![]);_0x3c3164[_0xe98e('0x60')](_0x4f9159,_0x35e003[_0xbb36e][_0xe98e('0x82')]||_0x4f9159);}if(_0x106046[_0xe98e('0x70')]){_0x106046[_0xe98e('0x70')]=JSON[_0xe98e('0x71')](_0x106046['joins']);for(var _0x5b16a7=0x0;_0x5b16a7<_0x106046['joins']['length'];_0x5b16a7+=0x1){if(_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x72')]&&_[_0xe98e('0x59')](_0x1978cc,_0x106046['joins'][_0x5b16a7][_0xe98e('0x72')])&&_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x73')]&&_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x74')]&&_0x106046['joins'][_0x5b16a7][_0xe98e('0x75')]){_0x3c3164[_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x72')]](_0x106046['joins'][_0x5b16a7][_0xe98e('0x74')],null,util[_0xe98e('0x6e')]('%s.%s\x20=\x20%s.%s',_0x106046[_0xe98e('0x6a')],_0x106046['joins'][_0x5b16a7]['parentKey'],_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x74')],_0x106046[_0xe98e('0x70')][_0x5b16a7][_0xe98e('0x75')]));}}}if(_0x106046[_0xe98e('0x77')]){_0x106046['conditions']=JSON['parse'](_0x106046[_0xe98e('0x77')]);_0x3c3164[_0xe98e('0x37')](_0x12979c(_0x106046[_0xe98e('0x77')][_0xe98e('0x5f')]));}_0x4a9138=_0x3c3164['clone']();_0x3c3164[_0xe98e('0x1d')](_0x306bae);_0x3c3164[_0xe98e('0x1b')](0x0);logger[_0xe98e('0x78')](_0xe98e('0x79'),_0x3c3164[_0xe98e('0x7a')]());return dbH[_0xe98e('0x7b')]['query'](_0x3c3164['toString'](),{'type':dbH[_0xe98e('0x7b')][_0xe98e('0x94')]['SELECT']});}})[_0xe98e('0x22')](function(){return{'sql':_0x4a9138[_0xe98e('0x7a')]()};})[_0xe98e('0x22')](respondWithResult(_0x5c452f,null))[_0xe98e('0x43')](handleError(_0x5c452f,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 97eb51b..4972b9c 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 _0x5619=['AnalyticCustomReport','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5619,0x160));var _0x9561=function(_0x458ca2,_0x2f21b2){_0x458ca2=_0x458ca2-0x0;var _0xc2c061=_0x5619[_0x458ca2];return _0xc2c061;};'use strict';var _=require(_0x9561('0x0'));var util=require(_0x9561('0x1'));var logger=require(_0x9561('0x2'))(_0x9561('0x3'));var moment=require(_0x9561('0x4'));var BPromise=require(_0x9561('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9561('0x6'));var rimraf=require(_0x9561('0x7'));var config=require(_0x9561('0x8'));var attributes=require(_0x9561('0x9'));module[_0x9561('0xa')]=function(_0x32dc88,_0x1730dd){return _0x32dc88[_0x9561('0xb')](_0x9561('0xc'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf980=['bluebird','request-promise','path','rimraf','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x3bc8c2,_0x45e0f7){var _0x471d7a=function(_0x2d3afa){while(--_0x2d3afa){_0x3bc8c2['push'](_0x3bc8c2['shift']());}};_0x471d7a(++_0x45e0f7);}(_0xf980,0xd9));var _0x0f98=function(_0x42a571,_0x57321c){_0x42a571=_0x42a571-0x0;var _0x32afaf=_0xf980[_0x42a571];return _0x32afaf;};'use strict';var _=require(_0x0f98('0x0'));var util=require(_0x0f98('0x1'));var logger=require(_0x0f98('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0f98('0x3'));var rp=require(_0x0f98('0x4'));var fs=require('fs');var path=require(_0x0f98('0x5'));var rimraf=require(_0x0f98('0x6'));var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x0f98('0x7')]=function(_0x150f5f,_0x220eb4){return _0x150f5f['define'](_0x0f98('0x8'),attributes,{'tableName':_0x0f98('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index d0c552b..d783d8a 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 _0x81ad=['code','AnalyticCustomReport,\x20%s,\x20%s','message','info','request\x20sent','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2a7f3a,_0x272a49){var _0x22b597=function(_0x17eaaf){while(--_0x17eaaf){_0x2a7f3a['push'](_0x2a7f3a['shift']());}};_0x22b597(++_0x272a49);}(_0x81ad,0x1ea));var _0xd81a=function(_0x4c7b20,_0x361515){_0x4c7b20=_0x4c7b20-0x0;var _0x4872bd=_0x81ad[_0x4c7b20];return _0x4872bd;};'use strict';var _=require(_0xd81a('0x0'));var util=require(_0xd81a('0x1'));var moment=require(_0xd81a('0x2'));var BPromise=require(_0xd81a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd81a('0x4'))['db'];var utils=require(_0xd81a('0x5'));var logger=require(_0xd81a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd81a('0x7'));var client=jayson[_0xd81a('0x8')][_0xd81a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d822f,_0x5738e1,_0x134b66){return new BPromise(function(_0x1c95c7,_0x316888){return client[_0xd81a('0xa')](_0x3d822f,_0x134b66)[_0xd81a('0xb')](function(_0x15d5a7){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x5738e1,'request\x20sent');logger[_0xd81a('0xc')](_0xd81a('0xd'),_0x5738e1,'request\x20sent',JSON[_0xd81a('0xe')](_0x15d5a7));if(_0x15d5a7[_0xd81a('0xf')]){if(_0x15d5a7['error'][_0xd81a('0x10')]===0x1f4){logger[_0xd81a('0xf')](_0xd81a('0x11'),_0x5738e1,_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);return _0x316888(_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);}logger[_0xd81a('0xf')](_0xd81a('0x11'),_0x5738e1,_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);return _0x1c95c7(_0x15d5a7[_0xd81a('0xf')][_0xd81a('0x12')]);}else{logger[_0xd81a('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5738e1,_0xd81a('0x14'));_0x1c95c7(_0x15d5a7['result'][_0xd81a('0x12')]);}})[_0xd81a('0x15')](function(_0x42a293){logger[_0xd81a('0xf')](_0xd81a('0x11'),_0x5738e1,_0x42a293);_0x316888(_0x42a293);});});} \ No newline at end of file +var _0xfe16=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfe16,0x17e));var _0x6fe1=function(_0x2a9734,_0x3a1363){_0x2a9734=_0x2a9734-0x0;var _0x59d0d7=_0xfe16[_0x2a9734];return _0x59d0d7;};'use strict';var _=require(_0x6fe1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6fe1('0x1'));var rs=require(_0x6fe1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6fe1('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6fe1('0x4'))(_0x6fe1('0x5'));var config=require(_0x6fe1('0x6'));var jayson=require(_0x6fe1('0x7'));var client=jayson[_0x6fe1('0x8')][_0x6fe1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c51d6,_0x32d5f1,_0x5568af){return new BPromise(function(_0x446971,_0x5bdc67){return client[_0x6fe1('0xa')](_0x4c51d6,_0x5568af)[_0x6fe1('0xb')](function(_0x39f6d7){logger[_0x6fe1('0xc')](_0x6fe1('0xd'),_0x32d5f1,_0x6fe1('0xe'));logger[_0x6fe1('0xf')](_0x6fe1('0x10'),_0x32d5f1,_0x6fe1('0xe'),JSON[_0x6fe1('0x11')](_0x39f6d7));if(_0x39f6d7['error']){if(_0x39f6d7[_0x6fe1('0x12')][_0x6fe1('0x13')]===0x1f4){logger[_0x6fe1('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x32d5f1,_0x39f6d7[_0x6fe1('0x12')][_0x6fe1('0x14')]);return _0x5bdc67(_0x39f6d7['error'][_0x6fe1('0x14')]);}logger[_0x6fe1('0x12')](_0x6fe1('0xd'),_0x32d5f1,_0x39f6d7[_0x6fe1('0x12')]['message']);return _0x446971(_0x39f6d7[_0x6fe1('0x12')][_0x6fe1('0x14')]);}else{logger['info'](_0x6fe1('0xd'),_0x32d5f1,_0x6fe1('0xe'));_0x446971(_0x39f6d7[_0x6fe1('0x15')]['message']);}})[_0x6fe1('0x16')](function(_0x525995){logger[_0x6fe1('0x12')](_0x6fe1('0xd'),_0x32d5f1,_0x525995);_0x5bdc67(_0x525995);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index da84c45..0778a4a 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 _0xf14c=['run','/:id/query','query','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','preview','/:id/run'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xf14c,0x15b));var _0xcf14=function(_0x5a4f06,_0xc6e3f){_0x5a4f06=_0x5a4f06-0x0;var _0x4e2417=_0xf14c[_0x5a4f06];return _0x4e2417;};'use strict';var multer=require(_0xcf14('0x0'));var util=require(_0xcf14('0x1'));var path=require(_0xcf14('0x2'));var timeout=require(_0xcf14('0x3'));var express=require(_0xcf14('0x4'));var router=express[_0xcf14('0x5')]();var fs_extra=require(_0xcf14('0x6'));var auth=require(_0xcf14('0x7'));var interaction=require(_0xcf14('0x8'));var config=require(_0xcf14('0x9'));var controller=require(_0xcf14('0xa'));router[_0xcf14('0xb')]('/',auth[_0xcf14('0xc')](),controller['index']);router[_0xcf14('0xb')](_0xcf14('0xd'),auth[_0xcf14('0xc')](),controller[_0xcf14('0xe')]);router['get']('/:id/preview',auth[_0xcf14('0xc')](),controller[_0xcf14('0xf')]);router['get'](_0xcf14('0x10'),auth[_0xcf14('0xc')](),controller[_0xcf14('0x11')]);router[_0xcf14('0xb')](_0xcf14('0x12'),auth[_0xcf14('0xc')](),controller[_0xcf14('0x13')]);router[_0xcf14('0x14')]('/',auth[_0xcf14('0xc')](),controller[_0xcf14('0x15')]);router[_0xcf14('0x16')](_0xcf14('0xd'),auth[_0xcf14('0xc')](),controller['update']);router[_0xcf14('0x17')](_0xcf14('0xd'),auth[_0xcf14('0xc')](),controller[_0xcf14('0x18')]);module[_0xcf14('0x19')]=router; \ No newline at end of file +var _0xfa19=['destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','run','/:id/query','put','delete'];(function(_0x45ac0c,_0x2f8a58){var _0x4b4074=function(_0x1ddc53){while(--_0x1ddc53){_0x45ac0c['push'](_0x45ac0c['shift']());}};_0x4b4074(++_0x2f8a58);}(_0xfa19,0x73));var _0x9fa1=function(_0x221743,_0x186de6){_0x221743=_0x221743-0x0;var _0x38caa8=_0xfa19[_0x221743];return _0x38caa8;};'use strict';var multer=require(_0x9fa1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9fa1('0x1'));var express=require(_0x9fa1('0x2'));var router=express[_0x9fa1('0x3')]();var fs_extra=require(_0x9fa1('0x4'));var auth=require(_0x9fa1('0x5'));var interaction=require(_0x9fa1('0x6'));var config=require('../../config/environment');var controller=require(_0x9fa1('0x7'));router[_0x9fa1('0x8')]('/',auth[_0x9fa1('0x9')](),controller[_0x9fa1('0xa')]);router[_0x9fa1('0x8')](_0x9fa1('0xb'),auth[_0x9fa1('0x9')](),controller[_0x9fa1('0xc')]);router[_0x9fa1('0x8')](_0x9fa1('0xd'),auth[_0x9fa1('0x9')](),controller['preview']);router[_0x9fa1('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x9fa1('0xe')]);router[_0x9fa1('0x8')](_0x9fa1('0xf'),auth[_0x9fa1('0x9')](),controller['query']);router['post']('/',auth[_0x9fa1('0x9')](),controller['create']);router[_0x9fa1('0x10')](_0x9fa1('0xb'),auth[_0x9fa1('0x9')](),controller['update']);router[_0x9fa1('0x11')](_0x9fa1('0xb'),auth[_0x9fa1('0x9')](),controller[_0x9fa1('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index dab4bce..379aeca 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 _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x1ae78f,_0x122ed2){var _0x5baf80=function(_0x28a303){while(--_0x28a303){_0x1ae78f['push'](_0x1ae78f['shift']());}};_0x5baf80(++_0x122ed2);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4f1da5,_0x4ced17){_0x4f1da5=_0x4f1da5-0x0;var _0xe972a8=_0xfdbd[_0x4f1da5];return _0xe972a8;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file +var _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x55a787,_0x1466a3){var _0x5d90a0=function(_0x5405fb){while(--_0x5405fb){_0x55a787['push'](_0x55a787['shift']());}};_0x5d90a0(++_0x1466a3);}(_0x5fab,0x177));var _0xb5fa=function(_0xd98def,_0x19ebc7){_0xd98def=_0xd98def-0x0;var _0x55b182=_0x5fab[_0xd98def];return _0x55b182;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index bf8266e..d031a33 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 _0x7a54=['options','AnalyticDefaultReport','includeAll','include','show','keys','attributes','create','body','user','role','get','Reports','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','from','MetricId','metric','field','function','replace','format','orderBy','DESC','joins','parse','type','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','debug','toString','sequelize','QueryTypes','SELECT','join','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','operator','groupBy','alias','output','web','fullPath','%s-%s.%s','generate','default','AnalyticExtractedReport','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','getFields','clone','Limited\x20Query:','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','dbH','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','then','destroy','DefaultReports','error','stack','name','index','map','fieldName','model','query','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x7a54,0x106));var _0x47a5=function(_0xb14868,_0x3d56d3){_0xb14868=_0xb14868-0x0;var _0x1b1c55=_0x7a54[_0xb14868];return _0x1b1c55;};'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'];var dbH=require(_0x47a5('0x15'))[_0x47a5('0x16')];function respondWithStatusCode(_0x5beb89,_0x44bd3e){_0x44bd3e=_0x44bd3e||0xcc;return function(_0x221b54){if(_0x221b54){return _0x5beb89[_0x47a5('0x17')](_0x44bd3e);}return _0x5beb89[_0x47a5('0x18')](_0x44bd3e)[_0x47a5('0x19')]();};}function respondWithResult(_0x620ee9,_0x3c6c46){_0x3c6c46=_0x3c6c46||0xc8;return function(_0x190faa){if(_0x190faa){return _0x620ee9['status'](_0x3c6c46)[_0x47a5('0x1a')](_0x190faa);}};}function respondWithFilteredResult(_0x11faf5,_0x3b001e){return function(_0x2a2cbb){if(_0x2a2cbb){var _0x1ef44c=typeof _0x3b001e['offset']==='undefined'&&typeof _0x3b001e[_0x47a5('0x1b')]==='undefined';var _0x5247fd=_0x2a2cbb[_0x47a5('0x1c')];var _0xaf70a6=_0x1ef44c?0x0:_0x3b001e[_0x47a5('0x1d')];var _0x1ef371=_0x1ef44c?_0x2a2cbb[_0x47a5('0x1c')]:_0x3b001e[_0x47a5('0x1d')]+_0x3b001e[_0x47a5('0x1b')];var _0xe3c618;if(_0x1ef371>=_0x5247fd){_0x1ef371=_0x5247fd;_0xe3c618=0xc8;}else{_0xe3c618=0xce;}_0x11faf5[_0x47a5('0x18')](_0xe3c618);return _0x11faf5['set'](_0x47a5('0x1e'),_0xaf70a6+'-'+_0x1ef371+'/'+_0x5247fd)[_0x47a5('0x1a')](_0x2a2cbb);}return null;};}function patchUpdates(_0x47cf3c){return function(_0x2b0360){try{jsonpatch[_0x47a5('0x1f')](_0x2b0360,_0x47cf3c,!![]);}catch(_0x36874d){return BPromise['reject'](_0x36874d);}return _0x2b0360[_0x47a5('0x20')]();};}function saveUpdates(_0x2f142b,_0x23db32){return function(_0x7a9f9e){if(_0x7a9f9e){return _0x7a9f9e['update'](_0x2f142b)[_0x47a5('0x21')](function(_0x385687){return _0x385687;});}return null;};}function removeEntity(_0x513981,_0x28747d){return function(_0xc4cd63){if(_0xc4cd63){return _0xc4cd63[_0x47a5('0x22')]()[_0x47a5('0x21')](function(){var _0x3abd6a=_0xc4cd63['get']({'plain':!![]});var _0x53078a=_0x47a5('0x23');return db['UserProfileResource'][_0x47a5('0x22')]({'where':{'type':_0x53078a,'resourceId':_0x3abd6a['id']}})['then'](function(){return _0xc4cd63;});})[_0x47a5('0x21')](function(){_0x513981[_0x47a5('0x18')](0xcc)[_0x47a5('0x19')]();});}};}function handleEntityNotFound(_0x1dac65,_0x21f296){return function(_0x3ba0b7){if(!_0x3ba0b7){_0x1dac65[_0x47a5('0x17')](0x194);}return _0x3ba0b7;};}function handleError(_0x136b14,_0x16631f){_0x16631f=_0x16631f||0x1f4;return function(_0x361bfa){logger[_0x47a5('0x24')](_0x361bfa[_0x47a5('0x25')]);if(_0x361bfa[_0x47a5('0x26')]){delete _0x361bfa['name'];}_0x136b14[_0x47a5('0x18')](_0x16631f)['send'](_0x361bfa);};}exports[_0x47a5('0x27')]=function(_0x9ac908,_0x16901f){var _0x4d6b57={},_0x256650={},_0x625952={'count':0x0,'rows':[]};var _0x39b50b=_[_0x47a5('0x28')](db['AnalyticDefaultReport']['rawAttributes'],function(_0x6f9a12){return{'name':_0x6f9a12[_0x47a5('0x29')],'type':_0x6f9a12['type']['key']};});_0x256650[_0x47a5('0x2a')]=_[_0x47a5('0x28')](_0x39b50b,'name');_0x256650[_0x47a5('0x2b')]=_['keys'](_0x9ac908[_0x47a5('0x2b')]);_0x256650[_0x47a5('0x2c')]=_['intersection'](_0x256650['model'],_0x256650[_0x47a5('0x2b')]);_0x4d6b57['attributes']=_[_0x47a5('0x2d')](_0x256650[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x9ac908['query'][_0x47a5('0x2e')]));_0x4d6b57['attributes']=_0x4d6b57['attributes'][_0x47a5('0x2f')]?_0x4d6b57['attributes']:_0x256650[_0x47a5('0x2a')];if(!_0x9ac908['query'][_0x47a5('0x30')](_0x47a5('0x31'))){_0x4d6b57[_0x47a5('0x1b')]=qs[_0x47a5('0x1b')](_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x1b')]);_0x4d6b57[_0x47a5('0x1d')]=qs[_0x47a5('0x1d')](_0x9ac908[_0x47a5('0x2b')]['offset']);}_0x4d6b57[_0x47a5('0x32')]=qs[_0x47a5('0x33')](_0x9ac908['query'][_0x47a5('0x33')]);_0x4d6b57[_0x47a5('0x34')]=qs[_0x47a5('0x2c')](_['pick'](_0x9ac908[_0x47a5('0x2b')],_0x256650[_0x47a5('0x2c')]),_0x39b50b);if(_0x9ac908['query'][_0x47a5('0x35')]){_0x4d6b57[_0x47a5('0x34')]=_['merge'](_0x4d6b57['where'],{'$or':_['map'](_0x39b50b,function(_0x12d9f2){if(_0x12d9f2['type']!==_0x47a5('0x36')){var _0x1f9631={};_0x1f9631[_0x12d9f2[_0x47a5('0x26')]]={'$like':'%'+_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x35')]+'%'};return _0x1f9631;}})});}_0x4d6b57=_[_0x47a5('0x37')]({},_0x4d6b57,_0x9ac908[_0x47a5('0x38')]);var _0x1f3d01={'where':_0x4d6b57[_0x47a5('0x34')]};return db[_0x47a5('0x39')][_0x47a5('0x1c')](_0x1f3d01)[_0x47a5('0x21')](function(_0x23d6d8){_0x625952['count']=_0x23d6d8;if(_0x9ac908[_0x47a5('0x2b')][_0x47a5('0x3a')]){_0x4d6b57[_0x47a5('0x3b')]=[{'all':!![]}];}return db[_0x47a5('0x39')]['findAll'](_0x4d6b57);})[_0x47a5('0x21')](function(_0x528ef3){_0x625952['rows']=_0x528ef3;return _0x625952;})['then'](respondWithFilteredResult(_0x16901f,_0x4d6b57))['catch'](handleError(_0x16901f,null));};exports[_0x47a5('0x3c')]=function(_0x5ec4e5,_0x2bb502){var _0x3a740b={'raw':!![],'where':{'id':_0x5ec4e5['params']['id']}},_0x448610={};_0x448610[_0x47a5('0x2a')]=_[_0x47a5('0x3d')](db['AnalyticDefaultReport']['rawAttributes']);_0x448610[_0x47a5('0x2b')]=_['keys'](_0x5ec4e5[_0x47a5('0x2b')]);_0x448610[_0x47a5('0x2c')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],_0x448610[_0x47a5('0x2b')]);_0x3a740b[_0x47a5('0x3e')]=_[_0x47a5('0x2d')](_0x448610[_0x47a5('0x2a')],qs[_0x47a5('0x2e')](_0x5ec4e5[_0x47a5('0x2b')][_0x47a5('0x2e')]));_0x3a740b[_0x47a5('0x3e')]=_0x3a740b[_0x47a5('0x3e')][_0x47a5('0x2f')]?_0x3a740b[_0x47a5('0x3e')]:_0x448610[_0x47a5('0x2a')];if(_0x5ec4e5['query'][_0x47a5('0x3a')]){_0x3a740b[_0x47a5('0x3b')]=[{'all':!![]}];}_0x3a740b=_['merge']({},_0x3a740b,_0x5ec4e5['options']);return db[_0x47a5('0x39')]['find'](_0x3a740b)[_0x47a5('0x21')](handleEntityNotFound(_0x2bb502,null))[_0x47a5('0x21')](respondWithResult(_0x2bb502,null))['catch'](handleError(_0x2bb502,null));};exports['create']=function(_0x3d85cc,_0x52d409){return db[_0x47a5('0x39')][_0x47a5('0x3f')](_0x3d85cc[_0x47a5('0x40')],{})[_0x47a5('0x21')](function(_0x44fe8a){var _0x26acd2=_0x3d85cc[_0x47a5('0x41')]['get']({'plain':!![]});if(!_0x26acd2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26acd2[_0x47a5('0x42')]===_0x47a5('0x41')){var _0x1163e3=_0x44fe8a[_0x47a5('0x43')]({'plain':!![]});var _0x2c7020=_0x47a5('0x44');return db[_0x47a5('0x45')]['find']({'where':{'name':_0x2c7020,'userProfileId':_0x26acd2[_0x47a5('0x46')]},'raw':!![]})[_0x47a5('0x21')](function(_0x5f6a){if(_0x5f6a&&_0x5f6a['autoAssociation']===0x0){return db[_0x47a5('0x47')]['create']({'name':_0x1163e3[_0x47a5('0x26')],'resourceId':_0x1163e3['id'],'type':_0x47a5('0x23'),'sectionId':_0x5f6a['id']},{})[_0x47a5('0x21')](function(){return _0x44fe8a;});}else{return _0x44fe8a;}})[_0x47a5('0x48')](function(_0x588551){logger[_0x47a5('0x24')](_0x47a5('0x49'),_0x588551);throw _0x588551;});}return _0x44fe8a;})[_0x47a5('0x21')](respondWithResult(_0x52d409,0xc9))[_0x47a5('0x48')](handleError(_0x52d409,null));};exports[_0x47a5('0x4a')]=function(_0x6a53b3,_0x24e9f4){if(_0x6a53b3['body']['id']){delete _0x6a53b3[_0x47a5('0x40')]['id'];}return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x6a53b3[_0x47a5('0x4c')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x24e9f4,null))[_0x47a5('0x21')](saveUpdates(_0x6a53b3['body'],null))[_0x47a5('0x21')](respondWithResult(_0x24e9f4,null))[_0x47a5('0x48')](handleError(_0x24e9f4,null));};exports[_0x47a5('0x22')]=function(_0x53871e,_0x4c5ed){return db[_0x47a5('0x39')][_0x47a5('0x4b')]({'where':{'id':_0x53871e['params']['id']}})['then'](handleEntityNotFound(_0x4c5ed,null))[_0x47a5('0x21')](removeEntity(_0x4c5ed,null))[_0x47a5('0x48')](handleError(_0x4c5ed,null));};exports['preview']=function(_0x4cf792,_0x6d6b2b){var _0x4d6a82=0xa;var _0x16bb8a=['join','left_join',_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x53eedf={'SUM':_0x47a5('0x4f'),'COUNT':_0x47a5('0x50'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x199621={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':'HOUR(%s)','ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x485e3c=function(_0x470da6){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),_0x47a5('0x5a'),'IS\x20EMPTY',_0x47a5('0x5b')],_0x470da6);};var _0x5d1550=function(_0x5cbe97){if(!_0x5cbe97||!_0x5cbe97['rules']['length']){return'';}for(var _0x212d92='(',_0x6cd4ea=0x0;_0x6cd4ea<_0x5cbe97[_0x47a5('0x5c')]['length'];_0x6cd4ea+=0x1){_0x6cd4ea>0x0&&(_0x212d92+='\x20'+_0x5cbe97['operator']+'\x20');_0x212d92+=_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]?_0x5d1550(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5d')]):_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['field']+'\x20'+_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea]['condition']+(_0x485e3c(_0x5cbe97[_0x47a5('0x5c')][_0x6cd4ea][_0x47a5('0x5e')])?'\x20'+_0x5cbe97['rules'][_0x6cd4ea][_0x47a5('0x5f')]:'');}return _0x212d92+')';};var _0x345104={'where':{'id':_0x4cf792[_0x47a5('0x4c')]['id']}},_0x132854,_0x3e8274,_0x2d6494,_0x215634,_0x35cca8;_0x345104=_['merge']({},_0x345104,_0x4cf792[_0x47a5('0x38')]);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x345104)[_0x47a5('0x21')](function(_0x396cb0){if(_0x396cb0){_0x132854=_0x396cb0;return _0x396cb0['getFields']();}return null;})[_0x47a5('0x21')](function(_0xdfcecc){if(_0xdfcecc){if(!_0xdfcecc[_0x47a5('0x2f')]){throw new db[(_0x47a5('0x60'))][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x3e8274=_0xdfcecc;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x44cb90){if(_0x44cb90){_0x2d6494=_[_0x47a5('0x65')](_0x44cb90,'id');var _0x44fda9;var _0x3c0006=squel[_0x47a5('0x66')]();_0x3c0006[_0x47a5('0x67')](_0x132854['table']);for(var _0x42dd7d=0x0;_0x42dd7d<_0x3e8274[_0x47a5('0x2f')];_0x42dd7d+=0x1){_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x68')]?_0x2d6494[_0x3e8274[_0x42dd7d]['MetricId']][_0x47a5('0x69')]:_0x3e8274[_0x42dd7d][_0x47a5('0x6a')];_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6b')]?_[_0x47a5('0x6c')](_0x53eedf[_0x3e8274[_0x42dd7d]['function']],'%s',_0x44fda9):_0x44fda9;_0x44fda9=_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]?_['replace'](_0x199621[_0x3e8274[_0x42dd7d][_0x47a5('0x6d')]],'%s',_0x44fda9):_0x44fda9;if(_0x3e8274[_0x42dd7d]['groupBy']){_0x3c0006[_0x47a5('0x5d')](_0x44fda9);}_0x3e8274[_0x42dd7d]['orderBy']&&_0x3c0006[_0x47a5('0x32')](_0x44fda9,_0x3e8274[_0x42dd7d][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x3c0006['field'](_0x44fda9,_0x3e8274[_0x42dd7d]['alias']||_0x44fda9);}if(_0x132854['joins']){_0x132854[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x70')]);for(var _0x117510=0x0;_0x117510<_0x132854['joins'][_0x47a5('0x2f')];_0x117510+=0x1){if(_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')]&&_[_0x47a5('0x58')](_0x16bb8a,_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x72')])&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')]&&_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]){_0x3c0006[_0x132854['joins'][_0x117510][_0x47a5('0x72')]](_0x132854['joins'][_0x117510][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x132854[_0x47a5('0x77')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x73')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x74')],_0x132854[_0x47a5('0x70')][_0x117510][_0x47a5('0x75')]));}}}if(_0x132854[_0x47a5('0x78')]){_0x132854[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x132854[_0x47a5('0x78')]);_0x3c0006[_0x47a5('0x34')](_0x5d1550(_0x132854['conditions']['group']));}_0x35cca8=_0x3c0006['clone']();_0x3c0006['limit'](_0x4d6a82);_0x3c0006[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')]('Limited\x20Query:',_0x3c0006[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')][_0x47a5('0x2b')](_0x3c0006[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](respondWithResult(_0x6d6b2b,null))[_0x47a5('0x48')](handleError(_0x6d6b2b,null));};function runReport(_0x1ffe3c,_0x24a6c1,_0x5e5f16){var _0x18fa31=_0x24a6c1[_0x47a5('0x26')];var _0x420671=0xa;var _0x4f35ff=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),'cross_join'];var _0x19dc8c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':_0x47a5('0x53'),'GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x592322={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':'DATE(%s)','HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0xb16bdd=function(_0x53ea2b){return!_[_0x47a5('0x58')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0x53ea2b);};var _0x5b91f7=function(_0x1926bd){if(!_0x1926bd||!_0x1926bd[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x4c25ec='(',_0x280372=0x0;_0x280372<_0x1926bd['rules'][_0x47a5('0x2f')];_0x280372+=0x1){_0x280372>0x0&&(_0x4c25ec+='\x20'+_0x1926bd[_0x47a5('0x85')]+'\x20');_0x4c25ec+=_0x1926bd[_0x47a5('0x5c')][_0x280372]['group']?_0x5b91f7(_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5d')]):_0x1926bd[_0x47a5('0x5c')][_0x280372]['field']+'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition']+(_0xb16bdd(_0x1926bd[_0x47a5('0x5c')][_0x280372]['condition'])?'\x20'+_0x1926bd[_0x47a5('0x5c')][_0x280372][_0x47a5('0x5f')]:'');}return _0x4c25ec+')';};var _0x20a742={'where':{'id':_0x1ffe3c['id']}},_0x211fbf,_0x51738b,_0x42fcce,_0x2ae130,_0x23c393;_0x20a742=_[_0x47a5('0x37')]({},_0x20a742,_0x5e5f16);return db[_0x47a5('0x39')]['find'](_0x20a742)['then'](function(_0x569550){if(_0x569550){_0x211fbf=_0x569550;return _0x569550['getFields']();}return null;})[_0x47a5('0x21')](function(_0xa8809a){if(_0xa8809a){if(!_0xa8809a[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))](_0x47a5('0x62'),0x193);}_0x51738b=_0xa8809a;return db['AnalyticMetric'][_0x47a5('0x64')]({'raw':!![]});}return null;})[_0x47a5('0x21')](function(_0x19acfa){if(_0x19acfa){_0x42fcce=_[_0x47a5('0x65')](_0x19acfa,'id');var _0x58dacd;var _0x4b5353=squel[_0x47a5('0x66')]();_0x4b5353[_0x47a5('0x67')](_0x211fbf['table']);for(var _0x27d422=0x0;_0x27d422<_0x51738b[_0x47a5('0x2f')];_0x27d422+=0x1){_0x58dacd=_0x51738b[_0x27d422]['MetricId']?_0x42fcce[_0x51738b[_0x27d422][_0x47a5('0x68')]][_0x47a5('0x69')]:_0x51738b[_0x27d422][_0x47a5('0x6a')];_0x58dacd=_0x51738b[_0x27d422]['function']?_[_0x47a5('0x6c')](_0x19dc8c[_0x51738b[_0x27d422]['function']],'%s',_0x58dacd):_0x58dacd;_0x58dacd=_0x51738b[_0x27d422][_0x47a5('0x6d')]?_['replace'](_0x592322[_0x51738b[_0x27d422][_0x47a5('0x6d')]],'%s',_0x58dacd):_0x58dacd;if(_0x51738b[_0x27d422][_0x47a5('0x86')]){_0x4b5353['group'](_0x58dacd);}_0x51738b[_0x27d422][_0x47a5('0x6e')]&&_0x4b5353['order'](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x4b5353[_0x47a5('0x6a')](_0x58dacd,_0x51738b[_0x27d422][_0x47a5('0x87')]||_0x58dacd);}if(_0x211fbf['joins']){_0x211fbf[_0x47a5('0x70')]=JSON['parse'](_0x211fbf['joins']);for(var _0x2bb2df=0x0;_0x2bb2df<_0x211fbf[_0x47a5('0x70')][_0x47a5('0x2f')];_0x2bb2df+=0x1){if(_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]&&_['includes'](_0x4f35ff,_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')])&&_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x73')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x74')]&&_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]){_0x4b5353[_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x72')]](_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x211fbf[_0x47a5('0x77')],_0x211fbf[_0x47a5('0x70')][_0x2bb2df]['parentKey'],_0x211fbf[_0x47a5('0x70')][_0x2bb2df][_0x47a5('0x74')],_0x211fbf['joins'][_0x2bb2df][_0x47a5('0x75')]));}}}if(_0x211fbf[_0x47a5('0x78')]){_0x211fbf[_0x47a5('0x78')]=JSON['parse'](_0x211fbf['conditions']);_0x4b5353[_0x47a5('0x34')](_0x5b91f7(_0x211fbf[_0x47a5('0x78')]['group']));}_0x23c393=_0x4b5353['clone']();_0x4b5353[_0x47a5('0x1b')](_0x420671);_0x4b5353[_0x47a5('0x1d')](0x0);return;}})['then'](function(){if(_0x24a6c1[_0x47a5('0x88')]===_0x47a5('0x89')){return null;}var _0x4c9e6a=_[_0x47a5('0x37')](_0x24a6c1,{'name':_0x24a6c1[_0x47a5('0x8a')]||_0x24a6c1[_0x47a5('0x26')]||_0x211fbf[_0x47a5('0x26')],'basename':_0x18fa31,'savename':util[_0x47a5('0x6d')](_0x47a5('0x8b'),_0x24a6c1['name']||_0x211fbf['name'],require('randomstring')[_0x47a5('0x8c')](0x4),_0x24a6c1[_0x47a5('0x88')]||'csv'),'reportId':_0x211fbf['id'],'reportType':_0x47a5('0x8d')});return db[_0x47a5('0x8e')][_0x47a5('0x3f')](_0x4c9e6a,{'raw':!![]});})[_0x47a5('0x21')](function(_0xcdbfd7){if(_0x211fbf['table']===_0x47a5('0x8f')){_0x23c393['where'](_0x211fbf['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x24a6c1[_0x47a5('0x90')],_0x24a6c1['endDate']);}else{_0x23c393[_0x47a5('0x34')](_0x211fbf[_0x47a5('0x77')]+_0x47a5('0x91'),_0x24a6c1['startDate'],_0x24a6c1[_0x47a5('0x92')]);}if(_0xcdbfd7){logger[_0x47a5('0x93')](_0x47a5('0x94'),_0x23c393[_0x47a5('0x7a')]());require(_0x47a5('0x95'))['fork'](path[_0x47a5('0x7e')](__dirname,_0x47a5('0x96'),_0xcdbfd7['output']),[_0xcdbfd7['id'],_0x23c393[_0x47a5('0x7a')](),path[_0x47a5('0x7e')](__dirname,_0x47a5('0x97'),_0xcdbfd7[_0x47a5('0x98')]),_0x18fa31]);return _0xcdbfd7;}else{var _0x3c117a=squel[_0x47a5('0x66')]();_0x3c117a['from']('('+_0x23c393[_0x47a5('0x7a')]()+')',_0x47a5('0x99'));_0x3c117a['field'](_0x47a5('0x9a'),_0x47a5('0x1c'));_0x23c393[_0x47a5('0x1b')](_0x24a6c1[_0x47a5('0x1b')]||_0x420671);_0x23c393['offset'](_0x24a6c1['offset']||0x0);return dbH['sequelize']['query'](_0x3c117a[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')][_0x47a5('0x7d')]})[_0x47a5('0x21')](function(_0x6bc37b){if(!_0x6bc37b[_0x47a5('0x2f')]){_0x2ae130=0x0;}else{_0x2ae130=_0x6bc37b[0x0][_0x47a5('0x1c')]||0x0;}return dbH['sequelize'][_0x47a5('0x2b')](_0x23c393[_0x47a5('0x7a')](),{'type':dbH[_0x47a5('0x7b')][_0x47a5('0x7c')]['SELECT']});})['then'](function(_0x3770ae){return{'rows':_0x3770ae||[],'count':_0x2ae130};});}});}exports['run']=function(_0x4cb8e4,_0x1b6a5c){return runReport(_0x4cb8e4[_0x47a5('0x4c')],_0x4cb8e4['query'],_0x4cb8e4[_0x47a5('0x38')])[_0x47a5('0x21')](respondWithResult(_0x1b6a5c,null))[_0x47a5('0x48')](handleError(_0x1b6a5c,null));};exports['runReport']=runReport;exports[_0x47a5('0x2b')]=function(_0xee23c7,_0x48a491){var _0x1172fd=0xa;var _0x280b7b=[_0x47a5('0x7e'),_0x47a5('0x7f'),_0x47a5('0x4d'),_0x47a5('0x4e')];var _0x482c87={'SUM':_0x47a5('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x47a5('0x80'),'MAX':_0x47a5('0x81'),'MIN':_0x47a5('0x51'),'AVG':_0x47a5('0x52'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x47a5('0x54'),'GROUP_CONCAT DESC':_0x47a5('0x9b')};var _0x151540={'SEC_TO_TIME':_0x47a5('0x55'),'DATE':_0x47a5('0x56'),'HOUR':_0x47a5('0x82'),'ROUND':_0x47a5('0x57'),'UNIX_TIMESTAMP':_0x47a5('0x83')};var _0x1b3e82=function(_0xa2045c){return!_[_0x47a5('0x58')]([_0x47a5('0x59'),'IS\x20NOT\x20NULL',_0x47a5('0x84'),_0x47a5('0x5b')],_0xa2045c);};var _0x591bde=function(_0x55d955){if(!_0x55d955||!_0x55d955[_0x47a5('0x5c')][_0x47a5('0x2f')]){return'';}for(var _0x2ccf21='(',_0x2ff467=0x0;_0x2ff467<_0x55d955['rules'][_0x47a5('0x2f')];_0x2ff467+=0x1){_0x2ff467>0x0&&(_0x2ccf21+='\x20'+_0x55d955[_0x47a5('0x85')]+'\x20');_0x2ccf21+=_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]?_0x591bde(_0x55d955[_0x47a5('0x5c')][_0x2ff467][_0x47a5('0x5d')]):_0x55d955[_0x47a5('0x5c')][_0x2ff467]['field']+'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')]+(_0x1b3e82(_0x55d955['rules'][_0x2ff467][_0x47a5('0x5e')])?'\x20'+_0x55d955['rules'][_0x2ff467][_0x47a5('0x5f')]:'');}return _0x2ccf21+')';};var _0x8b4354={'where':{'id':_0xee23c7[_0x47a5('0x4c')]['id']}},_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b;_0x8b4354=_['merge']({},_0x8b4354,_0xee23c7['options']);return db[_0x47a5('0x39')][_0x47a5('0x4b')](_0x8b4354)[_0x47a5('0x21')](function(_0xfccf9c){if(_0xfccf9c){_0x134c1a=_0xfccf9c;return _0xfccf9c[_0x47a5('0x9c')]();}return null;})[_0x47a5('0x21')](function(_0x1c0323){if(_0x1c0323){if(!_0x1c0323[_0x47a5('0x2f')]){throw new db['Sequelize'][(_0x47a5('0x61'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2bc7ae=_0x1c0323;return db[_0x47a5('0x63')][_0x47a5('0x64')]({'raw':!![]});}return null;})['then'](function(_0x48d4cf){if(_0x48d4cf){_0x49cb8c=_[_0x47a5('0x65')](_0x48d4cf,'id');var _0x41d2da;var _0x530387=squel[_0x47a5('0x66')]();_0x530387[_0x47a5('0x67')](_0x134c1a[_0x47a5('0x77')]);for(var _0x44567e=0x0;_0x44567e<_0x2bc7ae['length'];_0x44567e+=0x1){_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x68')]?_0x49cb8c[_0x2bc7ae[_0x44567e]['MetricId']]['metric']:_0x2bc7ae[_0x44567e]['field'];_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]?_['replace'](_0x482c87[_0x2bc7ae[_0x44567e][_0x47a5('0x6b')]],'%s',_0x41d2da):_0x41d2da;_0x41d2da=_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]?_[_0x47a5('0x6c')](_0x151540[_0x2bc7ae[_0x44567e][_0x47a5('0x6d')]],'%s',_0x41d2da):_0x41d2da;if(_0x2bc7ae[_0x44567e][_0x47a5('0x86')]){_0x530387[_0x47a5('0x5d')](_0x41d2da);}_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]&&_0x530387[_0x47a5('0x32')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x6e')]===_0x47a5('0x6f')?![]:!![]);_0x530387[_0x47a5('0x6a')](_0x41d2da,_0x2bc7ae[_0x44567e][_0x47a5('0x87')]||_0x41d2da);}if(_0x134c1a[_0x47a5('0x70')]){_0x134c1a[_0x47a5('0x70')]=JSON[_0x47a5('0x71')](_0x134c1a['joins']);for(var _0xdd95c8=0x0;_0xdd95c8<_0x134c1a[_0x47a5('0x70')][_0x47a5('0x2f')];_0xdd95c8+=0x1){if(_0x134c1a[_0x47a5('0x70')][_0xdd95c8]['type']&&_[_0x47a5('0x58')](_0x280b7b,_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x72')])&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x73')]&&_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x74')]&&_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]){_0x530387[_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x72')]](_0x134c1a['joins'][_0xdd95c8]['foreignTable'],null,util[_0x47a5('0x6d')](_0x47a5('0x76'),_0x134c1a[_0x47a5('0x77')],_0x134c1a[_0x47a5('0x70')][_0xdd95c8][_0x47a5('0x73')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x74')],_0x134c1a['joins'][_0xdd95c8][_0x47a5('0x75')]));}}}if(_0x134c1a[_0x47a5('0x78')]){_0x134c1a[_0x47a5('0x78')]=JSON[_0x47a5('0x71')](_0x134c1a['conditions']);_0x530387['where'](_0x591bde(_0x134c1a[_0x47a5('0x78')][_0x47a5('0x5d')]));}_0x11f07b=_0x530387[_0x47a5('0x9d')]();_0x530387[_0x47a5('0x1b')](_0x1172fd);_0x530387[_0x47a5('0x1d')](0x0);logger[_0x47a5('0x79')](_0x47a5('0x9e'),_0x530387[_0x47a5('0x7a')]());return dbH[_0x47a5('0x7b')]['query'](_0x530387['toString'](),{'type':dbH[_0x47a5('0x7b')]['QueryTypes'][_0x47a5('0x7d')]});}})[_0x47a5('0x21')](function(){return{'sql':_0x11f07b[_0x47a5('0x7a')]()};})['then'](respondWithResult(_0x48a491,null))[_0x47a5('0x48')](handleError(_0x48a491,null));}; \ No newline at end of file +var _0x5fc3=['QueryTypes','right_join','HOUR(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','dbH','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','get','DefaultReports','destroy','error','stack','name','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','groupBy','orderBy','order','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','format','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','SELECT','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','getFields','ValidationErrorItem','fullPath','%s-%s.%s','generate','output','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','../../files/reports','countTable','COUNT(*)'];(function(_0x5b226b,_0x39b2e9){var _0x75cfba=function(_0x4a1686){while(--_0x4a1686){_0x5b226b['push'](_0x5b226b['shift']());}};_0x75cfba(++_0x39b2e9);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3ceb54,_0x5bddfd){_0x3ceb54=_0x3ceb54-0x0;var _0x26d8a6=_0x5fc3[_0x3ceb54];return _0x26d8a6;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x35fc('0x17')];function respondWithStatusCode(_0x5d462a,_0x397738){_0x397738=_0x397738||0xcc;return function(_0x22055e){if(_0x22055e){return _0x5d462a[_0x35fc('0x18')](_0x397738);}return _0x5d462a[_0x35fc('0x19')](_0x397738)[_0x35fc('0x1a')]();};}function respondWithResult(_0x5cfe94,_0x59507a){_0x59507a=_0x59507a||0xc8;return function(_0x5eac0f){if(_0x5eac0f){return _0x5cfe94['status'](_0x59507a)[_0x35fc('0x1b')](_0x5eac0f);}};}function respondWithFilteredResult(_0x229d56,_0x53b898){return function(_0x154958){if(_0x154958){var _0x227a49=typeof _0x53b898[_0x35fc('0x1c')]==='undefined'&&typeof _0x53b898[_0x35fc('0x1d')]===_0x35fc('0x1e');var _0x553677=_0x154958[_0x35fc('0x1f')];var _0x363e47=_0x227a49?0x0:_0x53b898[_0x35fc('0x1c')];var _0x5f56c6=_0x227a49?_0x154958[_0x35fc('0x1f')]:_0x53b898[_0x35fc('0x1c')]+_0x53b898[_0x35fc('0x1d')];var _0x488234;if(_0x5f56c6>=_0x553677){_0x5f56c6=_0x553677;_0x488234=0xc8;}else{_0x488234=0xce;}_0x229d56[_0x35fc('0x19')](_0x488234);return _0x229d56[_0x35fc('0x20')](_0x35fc('0x21'),_0x363e47+'-'+_0x5f56c6+'/'+_0x553677)[_0x35fc('0x1b')](_0x154958);}return null;};}function patchUpdates(_0x20ffde){return function(_0x21f1a9){try{jsonpatch[_0x35fc('0x22')](_0x21f1a9,_0x20ffde,!![]);}catch(_0x3b05b0){return BPromise[_0x35fc('0x23')](_0x3b05b0);}return _0x21f1a9[_0x35fc('0x24')]();};}function saveUpdates(_0x5bd2b8,_0x323aee){return function(_0xd5399f){if(_0xd5399f){return _0xd5399f[_0x35fc('0x25')](_0x5bd2b8)[_0x35fc('0x26')](function(_0x3b4743){return _0x3b4743;});}return null;};}function removeEntity(_0x55e9e7,_0x33f5e8){return function(_0x4c587a){if(_0x4c587a){return _0x4c587a['destroy']()[_0x35fc('0x26')](function(){var _0x5a93df=_0x4c587a[_0x35fc('0x27')]({'plain':!![]});var _0x51cfec=_0x35fc('0x28');return db['UserProfileResource'][_0x35fc('0x29')]({'where':{'type':_0x51cfec,'resourceId':_0x5a93df['id']}})[_0x35fc('0x26')](function(){return _0x4c587a;});})['then'](function(){_0x55e9e7['status'](0xcc)[_0x35fc('0x1a')]();});}};}function handleEntityNotFound(_0x58edb6,_0x274208){return function(_0x1a5d92){if(!_0x1a5d92){_0x58edb6['sendStatus'](0x194);}return _0x1a5d92;};}function handleError(_0x26b7cb,_0x645eac){_0x645eac=_0x645eac||0x1f4;return function(_0x383837){logger[_0x35fc('0x2a')](_0x383837[_0x35fc('0x2b')]);if(_0x383837[_0x35fc('0x2c')]){delete _0x383837[_0x35fc('0x2c')];}_0x26b7cb[_0x35fc('0x19')](_0x645eac)['send'](_0x383837);};}exports[_0x35fc('0x2d')]=function(_0x220931,_0x22af18){var _0x52acc5={},_0xe79f52={},_0x16f067={'count':0x0,'rows':[]};var _0x3822a8=_[_0x35fc('0x2e')](db[_0x35fc('0x2f')][_0x35fc('0x30')],function(_0x222ddb){return{'name':_0x222ddb[_0x35fc('0x31')],'type':_0x222ddb[_0x35fc('0x32')][_0x35fc('0x33')]};});_0xe79f52['model']=_['map'](_0x3822a8,_0x35fc('0x2c'));_0xe79f52['query']=_[_0x35fc('0x34')](_0x220931[_0x35fc('0x35')]);_0xe79f52[_0x35fc('0x36')]=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],_0xe79f52[_0x35fc('0x35')]);_0x52acc5['attributes']=_[_0x35fc('0x37')](_0xe79f52[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x220931[_0x35fc('0x35')][_0x35fc('0x39')]));_0x52acc5[_0x35fc('0x3a')]=_0x52acc5['attributes'][_0x35fc('0x3b')]?_0x52acc5[_0x35fc('0x3a')]:_0xe79f52[_0x35fc('0x38')];if(!_0x220931['query'][_0x35fc('0x3c')]('nolimit')){_0x52acc5[_0x35fc('0x1d')]=qs[_0x35fc('0x1d')](_0x220931[_0x35fc('0x35')][_0x35fc('0x1d')]);_0x52acc5['offset']=qs['offset'](_0x220931['query'][_0x35fc('0x1c')]);}_0x52acc5['order']=qs[_0x35fc('0x3d')](_0x220931['query'][_0x35fc('0x3d')]);_0x52acc5[_0x35fc('0x3e')]=qs[_0x35fc('0x36')](_[_0x35fc('0x3f')](_0x220931[_0x35fc('0x35')],_0xe79f52[_0x35fc('0x36')]),_0x3822a8);if(_0x220931[_0x35fc('0x35')]['filter']){_0x52acc5[_0x35fc('0x3e')]=_[_0x35fc('0x40')](_0x52acc5['where'],{'$or':_[_0x35fc('0x2e')](_0x3822a8,function(_0x1ccc41){if(_0x1ccc41[_0x35fc('0x32')]!==_0x35fc('0x41')){var _0x813866={};_0x813866[_0x1ccc41[_0x35fc('0x2c')]]={'$like':'%'+_0x220931['query'][_0x35fc('0x42')]+'%'};return _0x813866;}})});}_0x52acc5=_[_0x35fc('0x40')]({},_0x52acc5,_0x220931[_0x35fc('0x43')]);var _0x52543b={'where':_0x52acc5[_0x35fc('0x3e')]};return db[_0x35fc('0x2f')]['count'](_0x52543b)[_0x35fc('0x26')](function(_0x280af1){_0x16f067[_0x35fc('0x1f')]=_0x280af1;if(_0x220931[_0x35fc('0x35')][_0x35fc('0x44')]){_0x52acc5[_0x35fc('0x45')]=[{'all':!![]}];}return db[_0x35fc('0x2f')][_0x35fc('0x46')](_0x52acc5);})['then'](function(_0x596e83){_0x16f067[_0x35fc('0x47')]=_0x596e83;return _0x16f067;})[_0x35fc('0x26')](respondWithFilteredResult(_0x22af18,_0x52acc5))['catch'](handleError(_0x22af18,null));};exports['show']=function(_0x4ff202,_0x79677d){var _0x10f98b={'raw':!![],'where':{'id':_0x4ff202[_0x35fc('0x48')]['id']}},_0x4e56ed={};_0x4e56ed[_0x35fc('0x38')]=_[_0x35fc('0x34')](db[_0x35fc('0x2f')]['rawAttributes']);_0x4e56ed['query']=_['keys'](_0x4ff202['query']);_0x4e56ed['filters']=_[_0x35fc('0x37')](_0x4e56ed[_0x35fc('0x38')],_0x4e56ed['query']);_0x10f98b[_0x35fc('0x3a')]=_['intersection'](_0x4e56ed[_0x35fc('0x38')],qs[_0x35fc('0x39')](_0x4ff202[_0x35fc('0x35')][_0x35fc('0x39')]));_0x10f98b[_0x35fc('0x3a')]=_0x10f98b['attributes'][_0x35fc('0x3b')]?_0x10f98b[_0x35fc('0x3a')]:_0x4e56ed['model'];if(_0x4ff202[_0x35fc('0x35')][_0x35fc('0x44')]){_0x10f98b[_0x35fc('0x45')]=[{'all':!![]}];}_0x10f98b=_[_0x35fc('0x40')]({},_0x10f98b,_0x4ff202['options']);return db[_0x35fc('0x2f')]['find'](_0x10f98b)['then'](handleEntityNotFound(_0x79677d,null))[_0x35fc('0x26')](respondWithResult(_0x79677d,null))[_0x35fc('0x49')](handleError(_0x79677d,null));};exports[_0x35fc('0x4a')]=function(_0xca8aef,_0xf2ca20){return db[_0x35fc('0x2f')][_0x35fc('0x4a')](_0xca8aef[_0x35fc('0x4b')],{})['then'](function(_0x3e2961){var _0x91d7c0=_0xca8aef[_0x35fc('0x4c')][_0x35fc('0x27')]({'plain':!![]});if(!_0x91d7c0)throw new Error(_0x35fc('0x4d'));if(_0x91d7c0[_0x35fc('0x4e')]===_0x35fc('0x4c')){var _0x347a4a=_0x3e2961[_0x35fc('0x27')]({'plain':!![]});var _0xe6eb6a=_0x35fc('0x4f');return db[_0x35fc('0x50')][_0x35fc('0x51')]({'where':{'name':_0xe6eb6a,'userProfileId':_0x91d7c0[_0x35fc('0x52')]},'raw':!![]})['then'](function(_0x553ed6){if(_0x553ed6&&_0x553ed6[_0x35fc('0x53')]===0x0){return db[_0x35fc('0x54')][_0x35fc('0x4a')]({'name':_0x347a4a[_0x35fc('0x2c')],'resourceId':_0x347a4a['id'],'type':_0x35fc('0x28'),'sectionId':_0x553ed6['id']},{})[_0x35fc('0x26')](function(){return _0x3e2961;});}else{return _0x3e2961;}})['catch'](function(_0x4f024c){logger[_0x35fc('0x2a')](_0x35fc('0x55'),_0x4f024c);throw _0x4f024c;});}return _0x3e2961;})[_0x35fc('0x26')](respondWithResult(_0xf2ca20,0xc9))[_0x35fc('0x49')](handleError(_0xf2ca20,null));};exports['update']=function(_0x467980,_0x13281f){if(_0x467980['body']['id']){delete _0x467980[_0x35fc('0x4b')]['id'];}return db[_0x35fc('0x2f')]['find']({'where':{'id':_0x467980[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x13281f,null))[_0x35fc('0x26')](saveUpdates(_0x467980[_0x35fc('0x4b')],null))['then'](respondWithResult(_0x13281f,null))['catch'](handleError(_0x13281f,null));};exports['destroy']=function(_0x240338,_0x2ea8d6){return db['AnalyticDefaultReport'][_0x35fc('0x51')]({'where':{'id':_0x240338[_0x35fc('0x48')]['id']}})[_0x35fc('0x26')](handleEntityNotFound(_0x2ea8d6,null))[_0x35fc('0x26')](removeEntity(_0x2ea8d6,null))[_0x35fc('0x49')](handleError(_0x2ea8d6,null));};exports['preview']=function(_0x2d9d45,_0x757aa6){var _0x39d470=0xa;var _0x509e77=[_0x35fc('0x56'),_0x35fc('0x57'),'right_join',_0x35fc('0x58')];var _0x164c7b={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x303927={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x23b54f=function(_0xb1c68a){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0xb1c68a);};var _0x5353ea=function(_0x4faef4){if(!_0x4faef4||!_0x4faef4['rules'][_0x35fc('0x3b')]){return'';}for(var _0x44250b='(',_0xd470e8=0x0;_0xd470e8<_0x4faef4[_0x35fc('0x65')]['length'];_0xd470e8+=0x1){_0xd470e8>0x0&&(_0x44250b+='\x20'+_0x4faef4[_0x35fc('0x66')]+'\x20');_0x44250b+=_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]?_0x5353ea(_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x67')]):_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x68')]+'\x20'+_0x4faef4[_0x35fc('0x65')][_0xd470e8][_0x35fc('0x69')]+(_0x23b54f(_0x4faef4['rules'][_0xd470e8][_0x35fc('0x69')])?'\x20'+_0x4faef4['rules'][_0xd470e8][_0x35fc('0x6a')]:'');}return _0x44250b+')';};var _0x9029e3={'where':{'id':_0x2d9d45['params']['id']}},_0x2ac8e1,_0x2bc76c,_0x4bdde7,_0x465c14,_0x4af592;_0x9029e3=_['merge']({},_0x9029e3,_0x2d9d45[_0x35fc('0x43')]);return db['AnalyticDefaultReport'][_0x35fc('0x51')](_0x9029e3)['then'](function(_0x11717){if(_0x11717){_0x2ac8e1=_0x11717;return _0x11717['getFields']();}return null;})[_0x35fc('0x26')](function(_0x455b84){if(_0x455b84){if(!_0x455b84[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))]['ValidationErrorItem'](_0x35fc('0x6c'),0x193);}_0x2bc76c=_0x455b84;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})['then'](function(_0x3aa7fa){if(_0x3aa7fa){_0x4bdde7=_[_0x35fc('0x6e')](_0x3aa7fa,'id');var _0x37764b;var _0x3c1b56=squel[_0x35fc('0x6f')]();_0x3c1b56[_0x35fc('0x70')](_0x2ac8e1[_0x35fc('0x71')]);for(var _0x4464d5=0x0;_0x4464d5<_0x2bc76c['length'];_0x4464d5+=0x1){_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x72')]?_0x4bdde7[_0x2bc76c[_0x4464d5][_0x35fc('0x72')]][_0x35fc('0x73')]:_0x2bc76c[_0x4464d5]['field'];_0x37764b=_0x2bc76c[_0x4464d5][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x164c7b[_0x2bc76c[_0x4464d5]['function']],'%s',_0x37764b):_0x37764b;_0x37764b=_0x2bc76c[_0x4464d5]['format']?_[_0x35fc('0x75')](_0x303927[_0x2bc76c[_0x4464d5]['format']],'%s',_0x37764b):_0x37764b;if(_0x2bc76c[_0x4464d5][_0x35fc('0x76')]){_0x3c1b56[_0x35fc('0x67')](_0x37764b);}_0x2bc76c[_0x4464d5][_0x35fc('0x77')]&&_0x3c1b56[_0x35fc('0x78')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x77')]===_0x35fc('0x79')?![]:!![]);_0x3c1b56[_0x35fc('0x68')](_0x37764b,_0x2bc76c[_0x4464d5][_0x35fc('0x7a')]||_0x37764b);}if(_0x2ac8e1[_0x35fc('0x7b')]){_0x2ac8e1[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x2ac8e1[_0x35fc('0x7b')]);for(var _0x29f2b9=0x0;_0x29f2b9<_0x2ac8e1[_0x35fc('0x7b')][_0x35fc('0x3b')];_0x29f2b9+=0x1){if(_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]&&_[_0x35fc('0x62')](_0x509e77,_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')])&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7d')]&&_0x2ac8e1['joins'][_0x29f2b9][_0x35fc('0x7e')]&&_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]){_0x3c1b56[_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x32')]](_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],null,util[_0x35fc('0x80')](_0x35fc('0x81'),_0x2ac8e1[_0x35fc('0x71')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9]['parentKey'],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7e')],_0x2ac8e1[_0x35fc('0x7b')][_0x29f2b9][_0x35fc('0x7f')]));}}}if(_0x2ac8e1[_0x35fc('0x82')]){_0x2ac8e1[_0x35fc('0x82')]=JSON['parse'](_0x2ac8e1[_0x35fc('0x82')]);_0x3c1b56[_0x35fc('0x3e')](_0x5353ea(_0x2ac8e1[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x4af592=_0x3c1b56[_0x35fc('0x83')]();_0x3c1b56[_0x35fc('0x1d')](_0x39d470);_0x3c1b56[_0x35fc('0x1c')](0x0);logger[_0x35fc('0x84')](_0x35fc('0x85'),_0x3c1b56['toString']());return dbH[_0x35fc('0x86')]['query'](_0x3c1b56[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')]['QueryTypes'][_0x35fc('0x88')]});}})[_0x35fc('0x26')](respondWithResult(_0x757aa6,null))[_0x35fc('0x49')](handleError(_0x757aa6,null));};function runReport(_0x4274d6,_0x4026cc,_0x1a765f){var _0x42f87e=_0x4026cc[_0x35fc('0x2c')];var _0x25ee61=0xa;var _0x5806bf=['join','left_join','right_join',_0x35fc('0x58')];var _0x23cf84={'SUM':_0x35fc('0x59'),'COUNT':_0x35fc('0x5a'),'COUNT DISTINCT':_0x35fc('0x5b'),'MAX':'MAX(%s)','MIN':_0x35fc('0x5d'),'AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x15e936={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x319033=function(_0x9fe765){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x9fe765);};var _0x2faff7=function(_0xa2c5f8){if(!_0xa2c5f8||!_0xa2c5f8[_0x35fc('0x65')][_0x35fc('0x3b')]){return'';}for(var _0x221c5b='(',_0x1fcd36=0x0;_0x1fcd36<_0xa2c5f8['rules'][_0x35fc('0x3b')];_0x1fcd36+=0x1){_0x1fcd36>0x0&&(_0x221c5b+='\x20'+_0xa2c5f8['operator']+'\x20');_0x221c5b+=_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]?_0x2faff7(_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x67')]):_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x68')]+'\x20'+_0xa2c5f8['rules'][_0x1fcd36][_0x35fc('0x69')]+(_0x319033(_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x69')])?'\x20'+_0xa2c5f8[_0x35fc('0x65')][_0x1fcd36][_0x35fc('0x6a')]:'');}return _0x221c5b+')';};var _0x5abdf9={'where':{'id':_0x4274d6['id']}},_0x5512f6,_0x487cb5,_0x23b261,_0x4c742c,_0x2fae26;_0x5abdf9=_[_0x35fc('0x40')]({},_0x5abdf9,_0x1a765f);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x5abdf9)['then'](function(_0x28e80d){if(_0x28e80d){_0x5512f6=_0x28e80d;return _0x28e80d[_0x35fc('0x8e')]();}return null;})[_0x35fc('0x26')](function(_0x47c507){if(_0x47c507){if(!_0x47c507[_0x35fc('0x3b')]){throw new db[(_0x35fc('0x6b'))][(_0x35fc('0x8f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x487cb5=_0x47c507;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x2edb1b){if(_0x2edb1b){_0x23b261=_[_0x35fc('0x6e')](_0x2edb1b,'id');var _0x3858a9;var _0x4859be=squel[_0x35fc('0x6f')]();_0x4859be[_0x35fc('0x70')](_0x5512f6['table']);for(var _0x5849a0=0x0;_0x5849a0<_0x487cb5[_0x35fc('0x3b')];_0x5849a0+=0x1){_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x72')]?_0x23b261[_0x487cb5[_0x5849a0][_0x35fc('0x72')]]['metric']:_0x487cb5[_0x5849a0]['field'];_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0x23cf84[_0x487cb5[_0x5849a0]['function']],'%s',_0x3858a9):_0x3858a9;_0x3858a9=_0x487cb5[_0x5849a0][_0x35fc('0x80')]?_[_0x35fc('0x75')](_0x15e936[_0x487cb5[_0x5849a0][_0x35fc('0x80')]],'%s',_0x3858a9):_0x3858a9;if(_0x487cb5[_0x5849a0]['groupBy']){_0x4859be[_0x35fc('0x67')](_0x3858a9);}_0x487cb5[_0x5849a0][_0x35fc('0x77')]&&_0x4859be[_0x35fc('0x78')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x77')]==='DESC'?![]:!![]);_0x4859be[_0x35fc('0x68')](_0x3858a9,_0x487cb5[_0x5849a0][_0x35fc('0x7a')]||_0x3858a9);}if(_0x5512f6[_0x35fc('0x7b')]){_0x5512f6['joins']=JSON[_0x35fc('0x7c')](_0x5512f6[_0x35fc('0x7b')]);for(var _0x425f72=0x0;_0x425f72<_0x5512f6['joins'][_0x35fc('0x3b')];_0x425f72+=0x1){if(_0x5512f6[_0x35fc('0x7b')][_0x425f72]['type']&&_[_0x35fc('0x62')](_0x5806bf,_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x32')])&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')]&&_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]){_0x4859be[_0x5512f6['joins'][_0x425f72][_0x35fc('0x32')]](_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],null,util[_0x35fc('0x80')]('%s.%s\x20=\x20%s.%s',_0x5512f6[_0x35fc('0x71')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7d')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7e')],_0x5512f6[_0x35fc('0x7b')][_0x425f72][_0x35fc('0x7f')]));}}}if(_0x5512f6[_0x35fc('0x82')]){_0x5512f6['conditions']=JSON['parse'](_0x5512f6[_0x35fc('0x82')]);_0x4859be[_0x35fc('0x3e')](_0x2faff7(_0x5512f6[_0x35fc('0x82')]['group']));}_0x2fae26=_0x4859be[_0x35fc('0x83')]();_0x4859be[_0x35fc('0x1d')](_0x25ee61);_0x4859be[_0x35fc('0x1c')](0x0);return;}})[_0x35fc('0x26')](function(){if(_0x4026cc['output']==='web'){return null;}var _0x379650=_['merge'](_0x4026cc,{'name':_0x4026cc[_0x35fc('0x90')]||_0x4026cc[_0x35fc('0x2c')]||_0x5512f6['name'],'basename':_0x42f87e,'savename':util['format'](_0x35fc('0x91'),_0x4026cc[_0x35fc('0x2c')]||_0x5512f6[_0x35fc('0x2c')],require('randomstring')[_0x35fc('0x92')](0x4),_0x4026cc[_0x35fc('0x93')]||_0x35fc('0x94')),'reportId':_0x5512f6['id'],'reportType':'default'});return db[_0x35fc('0x95')][_0x35fc('0x4a')](_0x379650,{'raw':!![]});})[_0x35fc('0x26')](function(_0x328e90){if(_0x5512f6['table']===_0x35fc('0x96')){_0x2fae26[_0x35fc('0x3e')](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x97'),_0x4026cc[_0x35fc('0x98')],_0x4026cc[_0x35fc('0x99')]);}else{_0x2fae26['where'](_0x5512f6[_0x35fc('0x71')]+_0x35fc('0x9a'),_0x4026cc['startDate'],_0x4026cc[_0x35fc('0x99')]);}if(_0x328e90){logger[_0x35fc('0x9b')]('Run\x20Query:',_0x2fae26[_0x35fc('0x87')]());require(_0x35fc('0x9c'))[_0x35fc('0x9d')](path[_0x35fc('0x56')](__dirname,_0x35fc('0x9e'),_0x328e90['output']),[_0x328e90['id'],_0x2fae26[_0x35fc('0x87')](),path[_0x35fc('0x56')](__dirname,_0x35fc('0x9f'),_0x328e90['savename']),_0x42f87e]);return _0x328e90;}else{var _0x1224cd=squel['select']();_0x1224cd['from']('('+_0x2fae26[_0x35fc('0x87')]()+')',_0x35fc('0xa0'));_0x1224cd[_0x35fc('0x68')](_0x35fc('0xa1'),_0x35fc('0x1f'));_0x2fae26['limit'](_0x4026cc[_0x35fc('0x1d')]||_0x25ee61);_0x2fae26[_0x35fc('0x1c')](_0x4026cc[_0x35fc('0x1c')]||0x0);return dbH['sequelize'][_0x35fc('0x35')](_0x1224cd[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]})['then'](function(_0x1a2d73){if(!_0x1a2d73[_0x35fc('0x3b')]){_0x4c742c=0x0;}else{_0x4c742c=_0x1a2d73[0x0]['count']||0x0;}return dbH['sequelize'][_0x35fc('0x35')](_0x2fae26[_0x35fc('0x87')](),{'type':dbH[_0x35fc('0x86')][_0x35fc('0xa2')][_0x35fc('0x88')]});})[_0x35fc('0x26')](function(_0x8c80ca){return{'rows':_0x8c80ca||[],'count':_0x4c742c};});}});}exports['run']=function(_0x5dc286,_0x146ce1){return runReport(_0x5dc286[_0x35fc('0x48')],_0x5dc286[_0x35fc('0x35')],_0x5dc286[_0x35fc('0x43')])[_0x35fc('0x26')](respondWithResult(_0x146ce1,null))['catch'](handleError(_0x146ce1,null));};exports['runReport']=runReport;exports[_0x35fc('0x35')]=function(_0x2451f2,_0x3fff79){var _0x1c6ce9=0xa;var _0x4b2079=['join',_0x35fc('0x57'),_0x35fc('0xa3'),_0x35fc('0x58')];var _0xd46d64={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x35fc('0x5b'),'MAX':_0x35fc('0x5c'),'MIN':'MIN(%s)','AVG':_0x35fc('0x5e'),'GROUP_CONCAT':_0x35fc('0x89'),'GROUP_CONCAT ASC':_0x35fc('0x5f'),'GROUP_CONCAT DESC':_0x35fc('0x60')};var _0x274337={'SEC_TO_TIME':_0x35fc('0x8a'),'DATE':_0x35fc('0x61'),'HOUR':_0x35fc('0xa4'),'ROUND':_0x35fc('0x8b'),'UNIX_TIMESTAMP':_0x35fc('0x8c')};var _0x19ae76=function(_0x366a3b){return!_[_0x35fc('0x62')]([_0x35fc('0x63'),_0x35fc('0x64'),_0x35fc('0x8d'),'IS\x20NOT\x20EMPTY'],_0x366a3b);};var _0x345026=function(_0x553f7d){if(!_0x553f7d||!_0x553f7d[_0x35fc('0x65')]['length']){return'';}for(var _0x5aa072='(',_0x3c96ef=0x0;_0x3c96ef<_0x553f7d[_0x35fc('0x65')][_0x35fc('0x3b')];_0x3c96ef+=0x1){_0x3c96ef>0x0&&(_0x5aa072+='\x20'+_0x553f7d['operator']+'\x20');_0x5aa072+=_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]?_0x345026(_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x67')]):_0x553f7d[_0x35fc('0x65')][_0x3c96ef][_0x35fc('0x68')]+'\x20'+_0x553f7d['rules'][_0x3c96ef]['condition']+(_0x19ae76(_0x553f7d[_0x35fc('0x65')][_0x3c96ef]['condition'])?'\x20'+_0x553f7d['rules'][_0x3c96ef][_0x35fc('0x6a')]:'');}return _0x5aa072+')';};var _0x48b826={'where':{'id':_0x2451f2[_0x35fc('0x48')]['id']}},_0x556f9a,_0x5ae83f,_0x450769,_0x5d461c,_0x355154;_0x48b826=_[_0x35fc('0x40')]({},_0x48b826,_0x2451f2[_0x35fc('0x43')]);return db[_0x35fc('0x2f')][_0x35fc('0x51')](_0x48b826)['then'](function(_0x522ff2){if(_0x522ff2){_0x556f9a=_0x522ff2;return _0x522ff2[_0x35fc('0x8e')]();}return null;})['then'](function(_0x233c94){if(_0x233c94){if(!_0x233c94[_0x35fc('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5ae83f=_0x233c94;return db[_0x35fc('0x6d')][_0x35fc('0x46')]({'raw':!![]});}return null;})[_0x35fc('0x26')](function(_0x135e18){if(_0x135e18){_0x450769=_[_0x35fc('0x6e')](_0x135e18,'id');var _0x28525f;var _0x9116b1=squel[_0x35fc('0x6f')]();_0x9116b1['from'](_0x556f9a['table']);for(var _0x5cefdb=0x0;_0x5cefdb<_0x5ae83f['length'];_0x5cefdb+=0x1){_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x72')]?_0x450769[_0x5ae83f[_0x5cefdb]['MetricId']][_0x35fc('0x73')]:_0x5ae83f[_0x5cefdb]['field'];_0x28525f=_0x5ae83f[_0x5cefdb][_0x35fc('0x74')]?_[_0x35fc('0x75')](_0xd46d64[_0x5ae83f[_0x5cefdb]['function']],'%s',_0x28525f):_0x28525f;_0x28525f=_0x5ae83f[_0x5cefdb]['format']?_[_0x35fc('0x75')](_0x274337[_0x5ae83f[_0x5cefdb][_0x35fc('0x80')]],'%s',_0x28525f):_0x28525f;if(_0x5ae83f[_0x5cefdb][_0x35fc('0x76')]){_0x9116b1[_0x35fc('0x67')](_0x28525f);}_0x5ae83f[_0x5cefdb][_0x35fc('0x77')]&&_0x9116b1['order'](_0x28525f,_0x5ae83f[_0x5cefdb]['orderBy']===_0x35fc('0x79')?![]:!![]);_0x9116b1['field'](_0x28525f,_0x5ae83f[_0x5cefdb][_0x35fc('0x7a')]||_0x28525f);}if(_0x556f9a['joins']){_0x556f9a[_0x35fc('0x7b')]=JSON[_0x35fc('0x7c')](_0x556f9a[_0x35fc('0x7b')]);for(var _0x10e30e=0x0;_0x10e30e<_0x556f9a['joins'][_0x35fc('0x3b')];_0x10e30e+=0x1){if(_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')]&&_['includes'](_0x4b2079,_0x556f9a['joins'][_0x10e30e][_0x35fc('0x32')])&&_0x556f9a['joins'][_0x10e30e][_0x35fc('0x7d')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')]&&_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]){_0x9116b1[_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x32')]](_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],null,util['format'](_0x35fc('0x81'),_0x556f9a[_0x35fc('0x71')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7d')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7e')],_0x556f9a[_0x35fc('0x7b')][_0x10e30e][_0x35fc('0x7f')]));}}}if(_0x556f9a['conditions']){_0x556f9a['conditions']=JSON['parse'](_0x556f9a['conditions']);_0x9116b1['where'](_0x345026(_0x556f9a[_0x35fc('0x82')][_0x35fc('0x67')]));}_0x355154=_0x9116b1[_0x35fc('0x83')]();_0x9116b1[_0x35fc('0x1d')](_0x1c6ce9);_0x9116b1[_0x35fc('0x1c')](0x0);logger['debug'](_0x35fc('0x85'),_0x9116b1[_0x35fc('0x87')]());return dbH[_0x35fc('0x86')][_0x35fc('0x35')](_0x9116b1[_0x35fc('0x87')](),{'type':dbH['sequelize'][_0x35fc('0xa2')][_0x35fc('0x88')]});}})[_0x35fc('0x26')](function(){return{'sql':_0x355154['toString']()};})[_0x35fc('0x26')](respondWithResult(_0x3fff79,null))[_0x35fc('0x49')](handleError(_0x3fff79,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4601bcb..2d0bfab 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 _0x145a=['AnalyticDefaultReport','analytics_default_reports','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define'];(function(_0x1ad4cc,_0x4de4dd){var _0x4c81a0=function(_0x3a01a0){while(--_0x3a01a0){_0x1ad4cc['push'](_0x1ad4cc['shift']());}};_0x4c81a0(++_0x4de4dd);}(_0x145a,0x1e2));var _0xa145=function(_0x54e5c2,_0x60f1e8){_0x54e5c2=_0x54e5c2-0x0;var _0x2a8642=_0x145a[_0x54e5c2];return _0x2a8642;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa145('0x0'));var BPromise=require(_0xa145('0x1'));var rp=require(_0xa145('0x2'));var fs=require('fs');var path=require(_0xa145('0x3'));var rimraf=require('rimraf');var config=require(_0xa145('0x4'));var attributes=require(_0xa145('0x5'));module[_0xa145('0x6')]=function(_0x2247cc,_0x399539){return _0x2247cc[_0xa145('0x7')](_0xa145('0x8'),attributes,{'tableName':_0xa145('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb1cb=['path','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','bluebird'];(function(_0x35bdab,_0x28a695){var _0xbe96b0=function(_0x425977){while(--_0x425977){_0x35bdab['push'](_0x35bdab['shift']());}};_0xbe96b0(++_0x28a695);}(_0xb1cb,0xa7));var _0xbb1c=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xb1cb[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0xbb1c('0x0'));var util=require(_0xbb1c('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xbb1c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb1c('0x3'));var rimraf=require(_0xbb1c('0x4'));var config=require('../../config/environment');var attributes=require(_0xbb1c('0x5'));module[_0xbb1c('0x6')]=function(_0x1f49c2,_0x4844a7){return _0x1f49c2[_0xbb1c('0x7')](_0xbb1c('0x8'),attributes,{'tableName':_0xbb1c('0x9'),'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 ad815ba..41f90d9 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 _0x742d=['message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2fcd6e,_0xc2f135){var _0x7789a3=function(_0x2ea41b){while(--_0x2ea41b){_0x2fcd6e['push'](_0x2fcd6e['shift']());}};_0x7789a3(++_0xc2f135);}(_0x742d,0x192));var _0xd742=function(_0x408142,_0x90850c){_0x408142=_0x408142-0x0;var _0x3565ef=_0x742d[_0x408142];return _0x3565ef;};'use strict';var _=require(_0xd742('0x0'));var util=require('util');var moment=require(_0xd742('0x1'));var BPromise=require(_0xd742('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd742('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd742('0x4'));var logger=require(_0xd742('0x5'))(_0xd742('0x6'));var config=require(_0xd742('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd742('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ac896,_0x26ecbc,_0x4ebb5a){return new BPromise(function(_0x8b25e8,_0x1fd6e2){return client['request'](_0x4ac896,_0x4ebb5a)[_0xd742('0x9')](function(_0x388fb3){logger[_0xd742('0xa')](_0xd742('0xb'),_0x26ecbc,_0xd742('0xc'));logger[_0xd742('0xd')](_0xd742('0xe'),_0x26ecbc,_0xd742('0xc'),JSON[_0xd742('0xf')](_0x388fb3));if(_0x388fb3[_0xd742('0x10')]){if(_0x388fb3['error'][_0xd742('0x11')]===0x1f4){logger[_0xd742('0x10')](_0xd742('0xb'),_0x26ecbc,_0x388fb3['error'][_0xd742('0x12')]);return _0x1fd6e2(_0x388fb3[_0xd742('0x10')][_0xd742('0x12')]);}logger[_0xd742('0x10')](_0xd742('0xb'),_0x26ecbc,_0x388fb3['error'][_0xd742('0x12')]);return _0x8b25e8(_0x388fb3[_0xd742('0x10')][_0xd742('0x12')]);}else{logger[_0xd742('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26ecbc,_0xd742('0xc'));_0x8b25e8(_0x388fb3[_0xd742('0x13')][_0xd742('0x12')]);}})[_0xd742('0x14')](function(_0x2c518d){logger[_0xd742('0x10')](_0xd742('0xb'),_0x26ecbc,_0x2c518d);_0x1fd6e2(_0x2c518d);});});} \ No newline at end of file +var _0x7351=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3073e3,_0xf6dc21){var _0x5ab70b=function(_0x5820ed){while(--_0x5820ed){_0x3073e3['push'](_0x3073e3['shift']());}};_0x5ab70b(++_0xf6dc21);}(_0x7351,0x100));var _0x1735=function(_0xae6725,_0x325d12){_0xae6725=_0xae6725-0x0;var _0x2d5212=_0x7351[_0xae6725];return _0x2d5212;};'use strict';var _=require(_0x1735('0x0'));var util=require(_0x1735('0x1'));var moment=require(_0x1735('0x2'));var BPromise=require(_0x1735('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1735('0x4'));var db=require(_0x1735('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1735('0x6'))(_0x1735('0x7'));var config=require(_0x1735('0x8'));var jayson=require(_0x1735('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcf49a1,_0x4ea5f1,_0x119e83){return new BPromise(function(_0x217f72,_0x5c21e9){return client[_0x1735('0xa')](_0xcf49a1,_0x119e83)['then'](function(_0x423736){logger[_0x1735('0xb')](_0x1735('0xc'),_0x4ea5f1,_0x1735('0xd'));logger['debug'](_0x1735('0xe'),_0x4ea5f1,_0x1735('0xd'),JSON[_0x1735('0xf')](_0x423736));if(_0x423736[_0x1735('0x10')]){if(_0x423736[_0x1735('0x10')]['code']===0x1f4){logger[_0x1735('0x10')](_0x1735('0xc'),_0x4ea5f1,_0x423736[_0x1735('0x10')][_0x1735('0x11')]);return _0x5c21e9(_0x423736[_0x1735('0x10')][_0x1735('0x11')]);}logger[_0x1735('0x10')](_0x1735('0xc'),_0x4ea5f1,_0x423736[_0x1735('0x10')][_0x1735('0x11')]);return _0x217f72(_0x423736[_0x1735('0x10')][_0x1735('0x11')]);}else{logger[_0x1735('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ea5f1,_0x1735('0xd'));_0x217f72(_0x423736[_0x1735('0x12')][_0x1735('0x11')]);}})[_0x1735('0x13')](function(_0xe5a137){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x4ea5f1,_0xe5a137);_0x5c21e9(_0xe5a137);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index a5e93d4..7bbef41 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 _0x0b6e=['show','preview','get','/:id/run','run','/:id/query','create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','index','isAuthenticated'];(function(_0xf0ab7c,_0x23bbc2){var _0x198144=function(_0x1c3a40){while(--_0x1c3a40){_0xf0ab7c['push'](_0xf0ab7c['shift']());}};_0x198144(++_0x23bbc2);}(_0x0b6e,0x11f));var _0xe0b6=function(_0x4b9958,_0x8d7a2a){_0x4b9958=_0x4b9958-0x0;var _0x89ed74=_0x0b6e[_0x4b9958];return _0x89ed74;};'use strict';var multer=require(_0xe0b6('0x0'));var util=require(_0xe0b6('0x1'));var path=require(_0xe0b6('0x2'));var timeout=require(_0xe0b6('0x3'));var express=require(_0xe0b6('0x4'));var router=express[_0xe0b6('0x5')]();var fs_extra=require(_0xe0b6('0x6'));var auth=require(_0xe0b6('0x7'));var interaction=require(_0xe0b6('0x8'));var config=require('../../config/environment');var controller=require(_0xe0b6('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe0b6('0xa')]);router['get']('/:id',auth[_0xe0b6('0xb')](),controller[_0xe0b6('0xc')]);router['get']('/:id/preview',auth[_0xe0b6('0xb')](),controller[_0xe0b6('0xd')]);router[_0xe0b6('0xe')](_0xe0b6('0xf'),auth['isAuthenticated'](),controller[_0xe0b6('0x10')]);router['get'](_0xe0b6('0x11'),auth[_0xe0b6('0xb')](),controller['query']);router['post']('/',auth[_0xe0b6('0xb')](),controller[_0xe0b6('0x12')]);router['put'](_0xe0b6('0x13'),auth['isAuthenticated'](),controller[_0xe0b6('0x14')]);router[_0xe0b6('0x15')](_0xe0b6('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0xe0b6('0x16')]=router; \ No newline at end of file +var _0x07e5=['/:id/run','run','/:id/query','create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview'];(function(_0x4ad46d,_0xcd05ed){var _0x5dc091=function(_0x3e6ebf){while(--_0x3e6ebf){_0x4ad46d['push'](_0x4ad46d['shift']());}};_0x5dc091(++_0xcd05ed);}(_0x07e5,0x133));var _0x507e=function(_0x51107b,_0x1db2ba){_0x51107b=_0x51107b-0x0;var _0x141a58=_0x07e5[_0x51107b];return _0x141a58;};'use strict';var multer=require(_0x507e('0x0'));var util=require(_0x507e('0x1'));var path=require(_0x507e('0x2'));var timeout=require(_0x507e('0x3'));var express=require('express');var router=express[_0x507e('0x4')]();var fs_extra=require(_0x507e('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x507e('0x6'));router[_0x507e('0x7')]('/',auth[_0x507e('0x8')](),controller[_0x507e('0x9')]);router[_0x507e('0x7')](_0x507e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x507e('0x7')](_0x507e('0xb'),auth['isAuthenticated'](),controller[_0x507e('0xc')]);router[_0x507e('0x7')](_0x507e('0xd'),auth['isAuthenticated'](),controller[_0x507e('0xe')]);router['get'](_0x507e('0xf'),auth['isAuthenticated'](),controller['query']);router['post']('/',auth[_0x507e('0x8')](),controller[_0x507e('0x10')]);router[_0x507e('0x11')](_0x507e('0xa'),auth[_0x507e('0x8')](),controller['update']);router[_0x507e('0x12')](_0x507e('0xa'),auth[_0x507e('0x8')](),controller[_0x507e('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 7b70aed..923f9f8 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 _0x76c6=['manual','sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','Loading','scheduled'];(function(_0xc63188,_0xd51f21){var _0x5990b0=function(_0x1dc48d){while(--_0x1dc48d){_0xc63188['push'](_0xc63188['shift']());}};_0x5990b0(++_0xd51f21);}(_0x76c6,0x18d));var _0x676c=function(_0x256530,_0x5bed82){_0x256530=_0x256530-0x0;var _0x5865f3=_0x76c6[_0x256530];return _0x5865f3;};'use strict';var Sequelize=require(_0x676c('0x0'));var moment=require(_0x676c('0x1'));module[_0x676c('0x2')]={'name':{'type':Sequelize[_0x676c('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x676c('0x4')](_0x676c('0x5'),'pdf',_0x676c('0x6')),'allowNull':![],'defaultValue':_0x676c('0x5')},'savename':{'type':Sequelize[_0x676c('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x676c('0x7')]},'endDate':{'type':Sequelize[_0x676c('0x7')]},'status':{'type':Sequelize[_0x676c('0x3')],'defaultValue':_0x676c('0x8')},'type':{'type':Sequelize[_0x676c('0x4')]('manual',_0x676c('0x9')),'allowNull':![],'defaultValue':_0x676c('0xa')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x676c('0x3')]}}; \ No newline at end of file +var _0x83dd=['INTEGER','sequelize','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled'];(function(_0x46d58d,_0x131a3e){var _0x2d3ccf=function(_0x49c550){while(--_0x49c550){_0x46d58d['push'](_0x46d58d['shift']());}};_0x2d3ccf(++_0x131a3e);}(_0x83dd,0xb5));var _0xd83d=function(_0x5c46a9,_0x2548c7){_0x5c46a9=_0x5c46a9-0x0;var _0x250852=_0x83dd[_0x5c46a9];return _0x250852;};'use strict';var Sequelize=require(_0xd83d('0x0'));var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0xd83d('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd83d('0x2')](_0xd83d('0x3'),_0xd83d('0x4'),_0xd83d('0x5')),'allowNull':![],'defaultValue':_0xd83d('0x3')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xd83d('0x6')]},'status':{'type':Sequelize[_0xd83d('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0xd83d('0x7'),_0xd83d('0x8')),'allowNull':![],'defaultValue':_0xd83d('0x7')},'reportId':{'type':Sequelize[_0xd83d('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 8e54669..e2f892b 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 _0x0887=['../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','apply','reject','update','destroy','get','ExtractedReports','UserProfileResource','then','error','name','send','AnalyticExtractedReport','fieldName','type','key','model','map','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','filter','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','%s.%s','toLowerCase','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x12de48,_0x4913c7){var _0x2201ca=function(_0x278bd2){while(--_0x278bd2){_0x12de48['push'](_0x12de48['shift']());}};_0x2201ca(++_0x4913c7);}(_0x0887,0x1c1));var _0x7088=function(_0x511b17,_0xe6b453){_0x511b17=_0x511b17-0x0;var _0x4fa333=_0x0887[_0x511b17];return _0x4fa333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7088('0x0'));var zipdir=require(_0x7088('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7088('0x2'));var moment=require('moment');var BPromise=require(_0x7088('0x3'));var Mustache=require('mustache');var util=require(_0x7088('0x4'));var path=require(_0x7088('0x5'));var sox=require(_0x7088('0x6'));var csv=require(_0x7088('0x7'));var ejs=require(_0x7088('0x8'));var fs=require('fs');var fs_extra=require(_0x7088('0x9'));var _=require('lodash');var squel=require(_0x7088('0xa'));var crypto=require(_0x7088('0xb'));var jsforce=require(_0x7088('0xc'));var deskjs=require(_0x7088('0xd'));var toCsv=require(_0x7088('0x7'));var querystring=require(_0x7088('0xe'));var Papa=require(_0x7088('0xf'));var Redis=require('ioredis');var authService=require(_0x7088('0x10'));var qs=require(_0x7088('0x11'));var as=require(_0x7088('0x12'));var hardwareService=require(_0x7088('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7088('0x14'));var config=require(_0x7088('0x15'));var licenseUtil=require(_0x7088('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4132cb,_0x58ac71){_0x58ac71=_0x58ac71||0xcc;return function(_0x3c600a){if(_0x3c600a){return _0x4132cb[_0x7088('0x17')](_0x58ac71);}return _0x4132cb[_0x7088('0x18')](_0x58ac71)[_0x7088('0x19')]();};}function respondWithResult(_0x3a6137,_0x291819){_0x291819=_0x291819||0xc8;return function(_0x1949ba){if(_0x1949ba){return _0x3a6137[_0x7088('0x18')](_0x291819)[_0x7088('0x1a')](_0x1949ba);}};}function respondWithFilteredResult(_0x1a624d,_0x1cec73){return function(_0x5a385d){if(_0x5a385d){var _0x50592a=typeof _0x1cec73['offset']===_0x7088('0x1b')&&typeof _0x1cec73[_0x7088('0x1c')]==='undefined';var _0x1aaaba=_0x5a385d['count'];var _0x1f9d6b=_0x50592a?0x0:_0x1cec73[_0x7088('0x1d')];var _0x299a78=_0x50592a?_0x5a385d[_0x7088('0x1e')]:_0x1cec73['offset']+_0x1cec73['limit'];var _0x873a18;if(_0x299a78>=_0x1aaaba){_0x299a78=_0x1aaaba;_0x873a18=0xc8;}else{_0x873a18=0xce;}_0x1a624d['status'](_0x873a18);return _0x1a624d['set']('Content-Range',_0x1f9d6b+'-'+_0x299a78+'/'+_0x1aaaba)['json'](_0x5a385d);}return null;};}function patchUpdates(_0xcda5a7){return function(_0x2c3d3f){try{jsonpatch[_0x7088('0x1f')](_0x2c3d3f,_0xcda5a7,!![]);}catch(_0x9da8eb){return BPromise[_0x7088('0x20')](_0x9da8eb);}return _0x2c3d3f['save']();};}function saveUpdates(_0x1d2d1d,_0x6a860f){return function(_0x443b8d){if(_0x443b8d){return _0x443b8d[_0x7088('0x21')](_0x1d2d1d)['then'](function(_0xd3f7cb){return _0xd3f7cb;});}return null;};}function removeEntity(_0x4116e4,_0x5360c3){return function(_0xab9951){if(_0xab9951){return _0xab9951[_0x7088('0x22')]()['then'](function(){var _0x9a23e7=_0xab9951[_0x7088('0x23')]({'plain':!![]});var _0x17e9be=_0x7088('0x24');return db[_0x7088('0x25')][_0x7088('0x22')]({'where':{'type':_0x17e9be,'resourceId':_0x9a23e7['id']}})[_0x7088('0x26')](function(){return _0xab9951;});})[_0x7088('0x26')](function(){_0x4116e4[_0x7088('0x18')](0xcc)[_0x7088('0x19')]();});}};}function handleEntityNotFound(_0xd8aa99,_0x5dadb8){return function(_0x11ecbb){if(!_0x11ecbb){_0xd8aa99[_0x7088('0x17')](0x194);}return _0x11ecbb;};}function handleError(_0x5d1fab,_0x3b65dd){_0x3b65dd=_0x3b65dd||0x1f4;return function(_0x114109){logger[_0x7088('0x27')](_0x114109['stack']);if(_0x114109[_0x7088('0x28')]){delete _0x114109[_0x7088('0x28')];}_0x5d1fab[_0x7088('0x18')](_0x3b65dd)[_0x7088('0x29')](_0x114109);};}exports['index']=function(_0x4f8702,_0x5d32dd){var _0x1d33cf={},_0x30f23b={},_0x5d8bd3={'count':0x0,'rows':[]};var _0x346792=_['map'](db[_0x7088('0x2a')]['rawAttributes'],function(_0x17afdc){return{'name':_0x17afdc[_0x7088('0x2b')],'type':_0x17afdc[_0x7088('0x2c')][_0x7088('0x2d')]};});_0x30f23b[_0x7088('0x2e')]=_[_0x7088('0x2f')](_0x346792,_0x7088('0x28'));_0x30f23b['query']=_[_0x7088('0x30')](_0x4f8702[_0x7088('0x31')]);_0x30f23b['filters']=_['intersection'](_0x30f23b[_0x7088('0x2e')],_0x30f23b[_0x7088('0x31')]);_0x1d33cf[_0x7088('0x32')]=_[_0x7088('0x33')](_0x30f23b['model'],qs[_0x7088('0x34')](_0x4f8702[_0x7088('0x31')][_0x7088('0x34')]));_0x1d33cf[_0x7088('0x32')]=_0x1d33cf[_0x7088('0x32')][_0x7088('0x35')]?_0x1d33cf[_0x7088('0x32')]:_0x30f23b[_0x7088('0x2e')];if(!_0x4f8702[_0x7088('0x31')][_0x7088('0x36')](_0x7088('0x37'))){_0x1d33cf[_0x7088('0x1c')]=qs[_0x7088('0x1c')](_0x4f8702[_0x7088('0x31')]['limit']);_0x1d33cf[_0x7088('0x1d')]=qs[_0x7088('0x1d')](_0x4f8702[_0x7088('0x31')][_0x7088('0x1d')]);}_0x1d33cf[_0x7088('0x38')]=qs[_0x7088('0x39')](_0x4f8702[_0x7088('0x31')]['sort']);_0x1d33cf[_0x7088('0x3a')]=qs[_0x7088('0x3b')](_['pick'](_0x4f8702['query'],_0x30f23b[_0x7088('0x3b')]),_0x346792);if(_0x4f8702[_0x7088('0x31')]['filter']){_0x1d33cf[_0x7088('0x3a')]=_[_0x7088('0x3c')](_0x1d33cf[_0x7088('0x3a')],{'$or':_[_0x7088('0x2f')](_0x346792,function(_0x42da3b){if(_0x42da3b[_0x7088('0x2c')]!=='VIRTUAL'){var _0x231c9c={};_0x231c9c[_0x42da3b[_0x7088('0x28')]]={'$like':'%'+_0x4f8702[_0x7088('0x31')][_0x7088('0x3d')]+'%'};return _0x231c9c;}})});}_0x1d33cf=_['merge']({},_0x1d33cf,_0x4f8702[_0x7088('0x3e')]);var _0x27c499={'where':_0x1d33cf['where']};return db[_0x7088('0x2a')][_0x7088('0x1e')](_0x27c499)[_0x7088('0x26')](function(_0x4f6504){_0x5d8bd3[_0x7088('0x1e')]=_0x4f6504;if(_0x4f8702[_0x7088('0x31')][_0x7088('0x3f')]){_0x1d33cf['include']=[{'all':!![]}];}return db[_0x7088('0x2a')][_0x7088('0x40')](_0x1d33cf);})[_0x7088('0x26')](function(_0x3a5ddd){_0x5d8bd3[_0x7088('0x41')]=_0x3a5ddd;return _0x5d8bd3;})[_0x7088('0x26')](respondWithFilteredResult(_0x5d32dd,_0x1d33cf))[_0x7088('0x42')](handleError(_0x5d32dd,null));};exports[_0x7088('0x43')]=function(_0x18af69,_0x3e43cc){var _0x48bda3={'raw':!![],'where':{'id':_0x18af69[_0x7088('0x44')]['id']}},_0x39a9d7={};_0x39a9d7['model']=_[_0x7088('0x30')](db['AnalyticExtractedReport']['rawAttributes']);_0x39a9d7['query']=_[_0x7088('0x30')](_0x18af69[_0x7088('0x31')]);_0x39a9d7[_0x7088('0x3b')]=_['intersection'](_0x39a9d7[_0x7088('0x2e')],_0x39a9d7[_0x7088('0x31')]);_0x48bda3['attributes']=_[_0x7088('0x33')](_0x39a9d7[_0x7088('0x2e')],qs[_0x7088('0x34')](_0x18af69[_0x7088('0x31')][_0x7088('0x34')]));_0x48bda3[_0x7088('0x32')]=_0x48bda3[_0x7088('0x32')][_0x7088('0x35')]?_0x48bda3['attributes']:_0x39a9d7[_0x7088('0x2e')];if(_0x18af69[_0x7088('0x31')][_0x7088('0x3f')]){_0x48bda3[_0x7088('0x45')]=[{'all':!![]}];}_0x48bda3=_[_0x7088('0x3c')]({},_0x48bda3,_0x18af69[_0x7088('0x3e')]);return db['AnalyticExtractedReport']['find'](_0x48bda3)[_0x7088('0x26')](handleEntityNotFound(_0x3e43cc,null))[_0x7088('0x26')](respondWithResult(_0x3e43cc,null))['catch'](handleError(_0x3e43cc,null));};exports[_0x7088('0x46')]=function(_0x4f8b77,_0xe7094f){return db[_0x7088('0x2a')]['create'](_0x4f8b77[_0x7088('0x47')],{})[_0x7088('0x26')](function(_0x296c3b){var _0x3bd31f=_0x4f8b77[_0x7088('0x48')][_0x7088('0x23')]({'plain':!![]});if(!_0x3bd31f)throw new Error(_0x7088('0x49'));if(_0x3bd31f[_0x7088('0x4a')]==='user'){var _0x5c5318=_0x296c3b[_0x7088('0x23')]({'plain':!![]});var _0x146757='ExtractedReports';return db[_0x7088('0x4b')][_0x7088('0x4c')]({'where':{'name':_0x146757,'userProfileId':_0x3bd31f[_0x7088('0x4d')]},'raw':!![]})[_0x7088('0x26')](function(_0x55f453){if(_0x55f453&&_0x55f453['autoAssociation']===0x0){return db[_0x7088('0x25')]['create']({'name':_0x5c5318['name'],'resourceId':_0x5c5318['id'],'type':_0x55f453[_0x7088('0x28')],'sectionId':_0x55f453['id']},{})['then'](function(){return _0x296c3b;});}else{return _0x296c3b;}})[_0x7088('0x42')](function(_0x16643b){logger['error'](_0x7088('0x4e'),_0x16643b);throw _0x16643b;});}return _0x296c3b;})[_0x7088('0x26')](respondWithResult(_0xe7094f,0xc9))[_0x7088('0x42')](handleError(_0xe7094f,null));};exports[_0x7088('0x21')]=function(_0x1b7fd5,_0xe1bec9){if(_0x1b7fd5['body']['id']){delete _0x1b7fd5[_0x7088('0x47')]['id'];}return db[_0x7088('0x2a')][_0x7088('0x4c')]({'where':{'id':_0x1b7fd5['params']['id']}})[_0x7088('0x26')](handleEntityNotFound(_0xe1bec9,null))[_0x7088('0x26')](saveUpdates(_0x1b7fd5[_0x7088('0x47')],null))[_0x7088('0x26')](respondWithResult(_0xe1bec9,null))[_0x7088('0x42')](handleError(_0xe1bec9,null));};exports[_0x7088('0x22')]=function(_0xaea270,_0x1164c6){return db[_0x7088('0x2a')][_0x7088('0x4c')]({'where':{'id':_0xaea270[_0x7088('0x44')]['id']}})['then'](handleEntityNotFound(_0x1164c6,null))['then'](removeEntity(_0x1164c6,null))[_0x7088('0x42')](handleError(_0x1164c6,null));};exports[_0x7088('0x4f')]=function(_0x3bc0bf,_0x1ef473,_0x1d392e){return db[_0x7088('0x2a')][_0x7088('0x4c')]({'where':{'id':_0x3bc0bf[_0x7088('0x44')]['id']},'attributes':[_0x7088('0x28'),_0x7088('0x50'),'savename',_0x7088('0x51')],'raw':!![]})[_0x7088('0x26')](handleEntityNotFound(_0x1ef473,null))[_0x7088('0x26')](function(_0x4dd331){if(_0x4dd331){if(!fs[_0x7088('0x52')](path[_0x7088('0x53')](config[_0x7088('0x54')],_0x7088('0x55'),_0x4dd331[_0x7088('0x56')]))){throw new db[(_0x7088('0x57'))][(_0x7088('0x58'))](_0x7088('0x59'));}if(_0x3bc0bf['query'][_0x7088('0x5a')]){return _0x1ef473['sendStatus'](0xc8);}return _0x1ef473['download'](path[_0x7088('0x53')](config[_0x7088('0x54')],_0x7088('0x55'),_0x4dd331[_0x7088('0x56')]),util[_0x7088('0x5b')](_0x7088('0x5c'),_0x4dd331['basename']||_0x4dd331[_0x7088('0x28')],_0x4dd331[_0x7088('0x51')][_0x7088('0x5d')]()));}})[_0x7088('0x42')](handleError(_0x1ef473,null));}; \ No newline at end of file +var _0xe56e=['UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','AnalyticExtractedReport','rawAttributes','fieldName','type','key','map','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','catch','params','merge','find','create','body','user','get','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation'];(function(_0x2cea8b,_0x530338){var _0x2a98cb=function(_0x5593e4){while(--_0x5593e4){_0x2cea8b['push'](_0x2cea8b['shift']());}};_0x2a98cb(++_0x530338);}(_0xe56e,0x13d));var _0xee56=function(_0x520dac,_0x82ab00){_0x520dac=_0x520dac-0x0;var _0x418fc9=_0xe56e[_0x520dac];return _0x418fc9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee56('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xee56('0x1'));var rp=require('request-promise');var moment=require(_0xee56('0x2'));var BPromise=require(_0xee56('0x3'));var Mustache=require(_0xee56('0x4'));var util=require(_0xee56('0x5'));var path=require(_0xee56('0x6'));var sox=require(_0xee56('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xee56('0x8'));var _=require(_0xee56('0x9'));var squel=require(_0xee56('0xa'));var crypto=require(_0xee56('0xb'));var jsforce=require(_0xee56('0xc'));var deskjs=require(_0xee56('0xd'));var toCsv=require(_0xee56('0xe'));var querystring=require(_0xee56('0xf'));var Papa=require(_0xee56('0x10'));var Redis=require(_0xee56('0x11'));var authService=require(_0xee56('0x12'));var qs=require(_0xee56('0x13'));var as=require(_0xee56('0x14'));var hardwareService=require(_0xee56('0x15'));var logger=require('../../config/logger')(_0xee56('0x16'));var utils=require(_0xee56('0x17'));var config=require(_0xee56('0x18'));var licenseUtil=require(_0xee56('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x359edd,_0x4983ee){_0x4983ee=_0x4983ee||0xcc;return function(_0xdc7a8f){if(_0xdc7a8f){return _0x359edd[_0xee56('0x1a')](_0x4983ee);}return _0x359edd['status'](_0x4983ee)['end']();};}function respondWithResult(_0x2fa0d9,_0x46816c){_0x46816c=_0x46816c||0xc8;return function(_0x5348a6){if(_0x5348a6){return _0x2fa0d9['status'](_0x46816c)[_0xee56('0x1b')](_0x5348a6);}};}function respondWithFilteredResult(_0x14fa34,_0xdac875){return function(_0xdc69){if(_0xdc69){var _0x10d9c6=typeof _0xdac875[_0xee56('0x1c')]===_0xee56('0x1d')&&typeof _0xdac875[_0xee56('0x1e')]===_0xee56('0x1d');var _0x462f7b=_0xdc69[_0xee56('0x1f')];var _0x500fed=_0x10d9c6?0x0:_0xdac875[_0xee56('0x1c')];var _0x20df68=_0x10d9c6?_0xdc69[_0xee56('0x1f')]:_0xdac875[_0xee56('0x1c')]+_0xdac875['limit'];var _0x58b965;if(_0x20df68>=_0x462f7b){_0x20df68=_0x462f7b;_0x58b965=0xc8;}else{_0x58b965=0xce;}_0x14fa34[_0xee56('0x20')](_0x58b965);return _0x14fa34[_0xee56('0x21')](_0xee56('0x22'),_0x500fed+'-'+_0x20df68+'/'+_0x462f7b)['json'](_0xdc69);}return null;};}function patchUpdates(_0x25376d){return function(_0x261240){try{jsonpatch[_0xee56('0x23')](_0x261240,_0x25376d,!![]);}catch(_0x234f5f){return BPromise[_0xee56('0x24')](_0x234f5f);}return _0x261240[_0xee56('0x25')]();};}function saveUpdates(_0x21ff3a,_0x3c179a){return function(_0x4d3fa8){if(_0x4d3fa8){return _0x4d3fa8[_0xee56('0x26')](_0x21ff3a)['then'](function(_0x31ab64){return _0x31ab64;});}return null;};}function removeEntity(_0x51ac99,_0x5cd65c){return function(_0x54f58a){if(_0x54f58a){return _0x54f58a[_0xee56('0x27')]()[_0xee56('0x28')](function(){var _0x2dfb8e=_0x54f58a['get']({'plain':!![]});var _0x24ef2c='ExtractedReports';return db['UserProfileResource'][_0xee56('0x27')]({'where':{'type':_0x24ef2c,'resourceId':_0x2dfb8e['id']}})['then'](function(){return _0x54f58a;});})[_0xee56('0x28')](function(){_0x51ac99[_0xee56('0x20')](0xcc)[_0xee56('0x29')]();});}};}function handleEntityNotFound(_0x3974b3,_0x4edfb8){return function(_0x14d3e7){if(!_0x14d3e7){_0x3974b3[_0xee56('0x1a')](0x194);}return _0x14d3e7;};}function handleError(_0x328429,_0x52ec58){_0x52ec58=_0x52ec58||0x1f4;return function(_0x32a7bd){logger[_0xee56('0x2a')](_0x32a7bd[_0xee56('0x2b')]);if(_0x32a7bd['name']){delete _0x32a7bd[_0xee56('0x2c')];}_0x328429[_0xee56('0x20')](_0x52ec58)[_0xee56('0x2d')](_0x32a7bd);};}exports['index']=function(_0x5eea95,_0x48ce66){var _0x37249d={},_0x29ca7e={},_0x223413={'count':0x0,'rows':[]};var _0x2f6831=_['map'](db[_0xee56('0x2e')][_0xee56('0x2f')],function(_0x2550f4){return{'name':_0x2550f4[_0xee56('0x30')],'type':_0x2550f4[_0xee56('0x31')][_0xee56('0x32')]};});_0x29ca7e['model']=_[_0xee56('0x33')](_0x2f6831,_0xee56('0x2c'));_0x29ca7e['query']=_[_0xee56('0x34')](_0x5eea95[_0xee56('0x35')]);_0x29ca7e[_0xee56('0x36')]=_['intersection'](_0x29ca7e[_0xee56('0x37')],_0x29ca7e[_0xee56('0x35')]);_0x37249d[_0xee56('0x38')]=_[_0xee56('0x39')](_0x29ca7e[_0xee56('0x37')],qs[_0xee56('0x3a')](_0x5eea95['query'][_0xee56('0x3a')]));_0x37249d[_0xee56('0x38')]=_0x37249d[_0xee56('0x38')][_0xee56('0x3b')]?_0x37249d[_0xee56('0x38')]:_0x29ca7e[_0xee56('0x37')];if(!_0x5eea95[_0xee56('0x35')][_0xee56('0x3c')](_0xee56('0x3d'))){_0x37249d[_0xee56('0x1e')]=qs[_0xee56('0x1e')](_0x5eea95[_0xee56('0x35')][_0xee56('0x1e')]);_0x37249d[_0xee56('0x1c')]=qs[_0xee56('0x1c')](_0x5eea95['query'][_0xee56('0x1c')]);}_0x37249d['order']=qs[_0xee56('0x3e')](_0x5eea95[_0xee56('0x35')][_0xee56('0x3e')]);_0x37249d[_0xee56('0x3f')]=qs[_0xee56('0x36')](_['pick'](_0x5eea95[_0xee56('0x35')],_0x29ca7e[_0xee56('0x36')]),_0x2f6831);if(_0x5eea95[_0xee56('0x35')][_0xee56('0x40')]){_0x37249d['where']=_['merge'](_0x37249d[_0xee56('0x3f')],{'$or':_[_0xee56('0x33')](_0x2f6831,function(_0x4f82d9){if(_0x4f82d9[_0xee56('0x31')]!==_0xee56('0x41')){var _0x4fdf65={};_0x4fdf65[_0x4f82d9['name']]={'$like':'%'+_0x5eea95[_0xee56('0x35')][_0xee56('0x40')]+'%'};return _0x4fdf65;}})});}_0x37249d=_['merge']({},_0x37249d,_0x5eea95[_0xee56('0x42')]);var _0x122608={'where':_0x37249d[_0xee56('0x3f')]};return db[_0xee56('0x2e')][_0xee56('0x1f')](_0x122608)[_0xee56('0x28')](function(_0x4e5f5a){_0x223413['count']=_0x4e5f5a;if(_0x5eea95[_0xee56('0x35')][_0xee56('0x43')]){_0x37249d[_0xee56('0x44')]=[{'all':!![]}];}return db[_0xee56('0x2e')][_0xee56('0x45')](_0x37249d);})[_0xee56('0x28')](function(_0x2b85cc){_0x223413['rows']=_0x2b85cc;return _0x223413;})['then'](respondWithFilteredResult(_0x48ce66,_0x37249d))[_0xee56('0x46')](handleError(_0x48ce66,null));};exports['show']=function(_0x1909de,_0x22f361){var _0xd79901={'raw':!![],'where':{'id':_0x1909de[_0xee56('0x47')]['id']}},_0x6bf165={};_0x6bf165['model']=_[_0xee56('0x34')](db[_0xee56('0x2e')][_0xee56('0x2f')]);_0x6bf165['query']=_['keys'](_0x1909de[_0xee56('0x35')]);_0x6bf165[_0xee56('0x36')]=_[_0xee56('0x39')](_0x6bf165[_0xee56('0x37')],_0x6bf165[_0xee56('0x35')]);_0xd79901[_0xee56('0x38')]=_['intersection'](_0x6bf165[_0xee56('0x37')],qs[_0xee56('0x3a')](_0x1909de[_0xee56('0x35')]['fields']));_0xd79901[_0xee56('0x38')]=_0xd79901['attributes']['length']?_0xd79901[_0xee56('0x38')]:_0x6bf165[_0xee56('0x37')];if(_0x1909de[_0xee56('0x35')][_0xee56('0x43')]){_0xd79901[_0xee56('0x44')]=[{'all':!![]}];}_0xd79901=_[_0xee56('0x48')]({},_0xd79901,_0x1909de['options']);return db['AnalyticExtractedReport'][_0xee56('0x49')](_0xd79901)['then'](handleEntityNotFound(_0x22f361,null))[_0xee56('0x28')](respondWithResult(_0x22f361,null))[_0xee56('0x46')](handleError(_0x22f361,null));};exports['create']=function(_0x4170bf,_0x4c2855){return db[_0xee56('0x2e')][_0xee56('0x4a')](_0x4170bf[_0xee56('0x4b')],{})[_0xee56('0x28')](function(_0x2a57cd){var _0x1642dd=_0x4170bf[_0xee56('0x4c')][_0xee56('0x4d')]({'plain':!![]});if(!_0x1642dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1642dd[_0xee56('0x4e')]===_0xee56('0x4c')){var _0x4612f9=_0x2a57cd[_0xee56('0x4d')]({'plain':!![]});var _0x123837=_0xee56('0x4f');return db[_0xee56('0x50')][_0xee56('0x49')]({'where':{'name':_0x123837,'userProfileId':_0x1642dd[_0xee56('0x51')]},'raw':!![]})['then'](function(_0x545215){if(_0x545215&&_0x545215[_0xee56('0x52')]===0x0){return db[_0xee56('0x53')][_0xee56('0x4a')]({'name':_0x4612f9['name'],'resourceId':_0x4612f9['id'],'type':_0x545215[_0xee56('0x2c')],'sectionId':_0x545215['id']},{})[_0xee56('0x28')](function(){return _0x2a57cd;});}else{return _0x2a57cd;}})[_0xee56('0x46')](function(_0x478d32){logger[_0xee56('0x2a')](_0xee56('0x54'),_0x478d32);throw _0x478d32;});}return _0x2a57cd;})[_0xee56('0x28')](respondWithResult(_0x4c2855,0xc9))['catch'](handleError(_0x4c2855,null));};exports[_0xee56('0x26')]=function(_0x247e1d,_0x186981){if(_0x247e1d['body']['id']){delete _0x247e1d[_0xee56('0x4b')]['id'];}return db[_0xee56('0x2e')]['find']({'where':{'id':_0x247e1d[_0xee56('0x47')]['id']}})[_0xee56('0x28')](handleEntityNotFound(_0x186981,null))[_0xee56('0x28')](saveUpdates(_0x247e1d['body'],null))['then'](respondWithResult(_0x186981,null))[_0xee56('0x46')](handleError(_0x186981,null));};exports[_0xee56('0x27')]=function(_0x17f801,_0x1724d7){return db[_0xee56('0x2e')][_0xee56('0x49')]({'where':{'id':_0x17f801[_0xee56('0x47')]['id']}})[_0xee56('0x28')](handleEntityNotFound(_0x1724d7,null))[_0xee56('0x28')](removeEntity(_0x1724d7,null))[_0xee56('0x46')](handleError(_0x1724d7,null));};exports['download']=function(_0x15ee75,_0x4ed42d,_0x3d10cc){return db[_0xee56('0x2e')][_0xee56('0x49')]({'where':{'id':_0x15ee75['params']['id']},'attributes':[_0xee56('0x2c'),_0xee56('0x55'),_0xee56('0x56'),_0xee56('0x57')],'raw':!![]})[_0xee56('0x28')](handleEntityNotFound(_0x4ed42d,null))[_0xee56('0x28')](function(_0x3216ea){if(_0x3216ea){if(!fs[_0xee56('0x58')](path[_0xee56('0x59')](config[_0xee56('0x5a')],_0xee56('0x5b'),_0x3216ea['savename']))){throw new db[(_0xee56('0x5c'))][(_0xee56('0x5d'))](_0xee56('0x5e'));}if(_0x15ee75[_0xee56('0x35')][_0xee56('0x5f')]){return _0x4ed42d['sendStatus'](0xc8);}return _0x4ed42d[_0xee56('0x60')](path[_0xee56('0x59')](config['root'],_0xee56('0x5b'),_0x3216ea[_0xee56('0x56')]),util[_0xee56('0x61')](_0xee56('0x62'),_0x3216ea[_0xee56('0x55')]||_0x3216ea[_0xee56('0x2c')],_0x3216ea[_0xee56('0x57')][_0xee56('0x63')]()));}})[_0xee56('0x46')](handleError(_0x4ed42d,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 13f423c..d8a4a06 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 _0x6597=['../../config/logger','request-promise','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','util'];(function(_0x17ed21,_0x101669){var _0x4c0a91=function(_0x5e2b4d){while(--_0x5e2b4d){_0x17ed21['push'](_0x17ed21['shift']());}};_0x4c0a91(++_0x101669);}(_0x6597,0x170));var _0x7659=function(_0x18897,_0x3be3f9){_0x18897=_0x18897-0x0;var _0x158a47=_0x6597[_0x18897];return _0x158a47;};'use strict';var _=require(_0x7659('0x0'));var util=require(_0x7659('0x1'));var logger=require(_0x7659('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7659('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7659('0x4'));var config=require('../../config/environment');var attributes=require(_0x7659('0x5'));module[_0x7659('0x6')]=function(_0xe078d9,_0x17d582){return _0xe078d9[_0x7659('0x7')](_0x7659('0x8'),attributes,{'tableName':_0x7659('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8952=['./analyticExtractedReport.attributes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5e7a56,_0x5e9d15){var _0x968c99=function(_0x4e69e){while(--_0x4e69e){_0x5e7a56['push'](_0x5e7a56['shift']());}};_0x968c99(++_0x5e9d15);}(_0x8952,0xe2));var _0x2895=function(_0x1d6647,_0x19121a){_0x1d6647=_0x1d6647-0x0;var _0x5d3cd9=_0x8952[_0x1d6647];return _0x5d3cd9;};'use strict';var _=require(_0x2895('0x0'));var util=require(_0x2895('0x1'));var logger=require(_0x2895('0x2'))(_0x2895('0x3'));var moment=require(_0x2895('0x4'));var BPromise=require(_0x2895('0x5'));var rp=require(_0x2895('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2895('0x7'));var config=require('../../config/environment');var attributes=require(_0x2895('0x8'));module['exports']=function(_0x33fa97,_0x5cdef5){return _0x33fa97['define']('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 5988734..e82f460 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 _0xdadf=['client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2cbc96,_0xe213d8){var _0x4bd542=function(_0x3a49c7){while(--_0x3a49c7){_0x2cbc96['push'](_0x2cbc96['shift']());}};_0x4bd542(++_0xe213d8);}(_0xdadf,0x175));var _0xfdad=function(_0x10cb06,_0x33a6c9){_0x10cb06=_0x10cb06-0x0;var _0x3e598=_0xdadf[_0x10cb06];return _0x3e598;};'use strict';var _=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var moment=require('moment');var BPromise=require(_0xfdad('0x2'));var rs=require(_0xfdad('0x3'));var fs=require('fs');var Redis=require(_0xfdad('0x4'));var db=require(_0xfdad('0x5'))['db'];var utils=require(_0xfdad('0x6'));var logger=require(_0xfdad('0x7'))(_0xfdad('0x8'));var config=require(_0xfdad('0x9'));var jayson=require(_0xfdad('0xa'));var client=jayson[_0xfdad('0xb')][_0xfdad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc9af68,_0x199da6,_0x3bb44e){return new BPromise(function(_0x7ccc23,_0x364d98){return client[_0xfdad('0xd')](_0xc9af68,_0x3bb44e)[_0xfdad('0xe')](function(_0x432263){logger[_0xfdad('0xf')](_0xfdad('0x10'),_0x199da6,_0xfdad('0x11'));logger[_0xfdad('0x12')](_0xfdad('0x13'),_0x199da6,_0xfdad('0x11'),JSON[_0xfdad('0x14')](_0x432263));if(_0x432263[_0xfdad('0x15')]){if(_0x432263[_0xfdad('0x15')][_0xfdad('0x16')]===0x1f4){logger[_0xfdad('0x15')](_0xfdad('0x10'),_0x199da6,_0x432263['error'][_0xfdad('0x17')]);return _0x364d98(_0x432263['error'][_0xfdad('0x17')]);}logger[_0xfdad('0x15')](_0xfdad('0x10'),_0x199da6,_0x432263[_0xfdad('0x15')][_0xfdad('0x17')]);return _0x7ccc23(_0x432263[_0xfdad('0x15')][_0xfdad('0x17')]);}else{logger[_0xfdad('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x199da6,_0xfdad('0x11'));_0x7ccc23(_0x432263['result']['message']);}})['catch'](function(_0x2842b8){logger[_0xfdad('0x15')](_0xfdad('0x10'),_0x199da6,_0x2842b8);_0x364d98(_0x2842b8);});});} \ No newline at end of file +var _0xfe73=['../../config/utils','../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x392a7d,_0x1bfe73){var _0x1a9de0=function(_0x507152){while(--_0x507152){_0x392a7d['push'](_0x392a7d['shift']());}};_0x1a9de0(++_0x1bfe73);}(_0xfe73,0x185));var _0x3fe7=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xfe73[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require(_0x3fe7('0x0'));var util=require(_0x3fe7('0x1'));var moment=require(_0x3fe7('0x2'));var BPromise=require(_0x3fe7('0x3'));var rs=require(_0x3fe7('0x4'));var fs=require('fs');var Redis=require(_0x3fe7('0x5'));var db=require(_0x3fe7('0x6'))['db'];var utils=require(_0x3fe7('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3fe7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3fe7('0x9')][_0x3fe7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5643fb,_0x1a56f1,_0x5728c3){return new BPromise(function(_0x466c36,_0xccb96b){return client['request'](_0x5643fb,_0x5728c3)[_0x3fe7('0xb')](function(_0xf2182d){logger[_0x3fe7('0xc')](_0x3fe7('0xd'),_0x1a56f1,'request\x20sent');logger[_0x3fe7('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1a56f1,_0x3fe7('0xf'),JSON[_0x3fe7('0x10')](_0xf2182d));if(_0xf2182d[_0x3fe7('0x11')]){if(_0xf2182d[_0x3fe7('0x11')][_0x3fe7('0x12')]===0x1f4){logger[_0x3fe7('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a56f1,_0xf2182d['error'][_0x3fe7('0x13')]);return _0xccb96b(_0xf2182d[_0x3fe7('0x11')][_0x3fe7('0x13')]);}logger[_0x3fe7('0x11')](_0x3fe7('0xd'),_0x1a56f1,_0xf2182d[_0x3fe7('0x11')]['message']);return _0x466c36(_0xf2182d[_0x3fe7('0x11')][_0x3fe7('0x13')]);}else{logger[_0x3fe7('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1a56f1,_0x3fe7('0xf'));_0x466c36(_0xf2182d[_0x3fe7('0x14')][_0x3fe7('0x13')]);}})[_0x3fe7('0x15')](function(_0x295355){logger['error'](_0x3fe7('0xd'),_0x1a56f1,_0x295355);_0xccb96b(_0x295355);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c29fd17..40eff92 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 _0x1e85=['/:id/download','download','post','create','put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','show'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x1e85,0x1aa));var _0x51e8=function(_0x599c94,_0x464f0e){_0x599c94=_0x599c94-0x0;var _0x34e215=_0x1e85[_0x599c94];return _0x34e215;};'use strict';var multer=require(_0x51e8('0x0'));var util=require('util');var path=require(_0x51e8('0x1'));var timeout=require(_0x51e8('0x2'));var express=require(_0x51e8('0x3'));var router=express[_0x51e8('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x51e8('0x5'));var interaction=require(_0x51e8('0x6'));var config=require('../../config/environment');var controller=require(_0x51e8('0x7'));router[_0x51e8('0x8')]('/',auth[_0x51e8('0x9')](),controller['index']);router[_0x51e8('0x8')]('/:id',auth[_0x51e8('0x9')](),controller[_0x51e8('0xa')]);router['get'](_0x51e8('0xb'),auth['isAuthenticated'](),controller[_0x51e8('0xc')]);router[_0x51e8('0xd')]('/',auth[_0x51e8('0x9')](),controller[_0x51e8('0xe')]);router[_0x51e8('0xf')](_0x51e8('0x10'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x51e8('0x10'),auth[_0x51e8('0x9')](),controller[_0x51e8('0x11')]);module[_0x51e8('0x12')]=router; \ No newline at end of file +var _0xdd3c=['put','/:id','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','index','show','/:id/download','download','post','isAuthenticated'];(function(_0x278280,_0x16f8ad){var _0x49d587=function(_0x4751c8){while(--_0x4751c8){_0x278280['push'](_0x278280['shift']());}};_0x49d587(++_0x16f8ad);}(_0xdd3c,0x1bb));var _0xcdd3=function(_0x273e73,_0x3b07e3){_0x273e73=_0x273e73-0x0;var _0x1d3a2e=_0xdd3c[_0x273e73];return _0x1d3a2e;};'use strict';var multer=require(_0xcdd3('0x0'));var util=require('util');var path=require(_0xcdd3('0x1'));var timeout=require(_0xcdd3('0x2'));var express=require(_0xcdd3('0x3'));var router=express[_0xcdd3('0x4')]();var fs_extra=require(_0xcdd3('0x5'));var auth=require(_0xcdd3('0x6'));var interaction=require(_0xcdd3('0x7'));var config=require(_0xcdd3('0x8'));var controller=require(_0xcdd3('0x9'));router[_0xcdd3('0xa')]('/',auth['isAuthenticated'](),controller[_0xcdd3('0xb')]);router[_0xcdd3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xcdd3('0xc')]);router[_0xcdd3('0xa')](_0xcdd3('0xd'),auth['isAuthenticated'](),controller[_0xcdd3('0xe')]);router[_0xcdd3('0xf')]('/',auth[_0xcdd3('0x10')](),controller['create']);router[_0xcdd3('0x11')](_0xcdd3('0x12'),auth[_0xcdd3('0x10')](),controller['update']);router['delete'](_0xcdd3('0x12'),auth[_0xcdd3('0x10')](),controller['destroy']);module[_0xcdd3('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 472d174..0e75e6a 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 _0xb914=['STRING','BOOLEAN','sequelize','exports'];(function(_0x48233d,_0x512075){var _0x12ed53=function(_0x2c5aca){while(--_0x2c5aca){_0x48233d['push'](_0x48233d['shift']());}};_0x12ed53(++_0x512075);}(_0xb914,0xf2));var _0x4b91=function(_0x221b75,_0xd8389f){_0x221b75=_0x221b75-0x0;var _0x1fd01e=_0xb914[_0x221b75];return _0x1fd01e;};'use strict';var Sequelize=require(_0x4b91('0x0'));module[_0x4b91('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x4b91('0x2')]},'format':{'type':Sequelize[_0x4b91('0x2')]},'groupBy':{'type':Sequelize[_0x4b91('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x4b91('0x2')]},'custom':{'type':Sequelize[_0x4b91('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xefc7=['TEXT','STRING','BOOLEAN','exports'];(function(_0x27edbd,_0x9206ea){var _0x2f88a7=function(_0x15e465){while(--_0x15e465){_0x27edbd['push'](_0x27edbd['shift']());}};_0x2f88a7(++_0x9206ea);}(_0xefc7,0x1db));var _0x7efc=function(_0x3839be,_0x43296c){_0x3839be=_0x3839be-0x0;var _0x435631=_0xefc7[_0x3839be];return _0x435631;};'use strict';var Sequelize=require('sequelize');module[_0x7efc('0x0')]={'field':{'type':Sequelize[_0x7efc('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x7efc('0x2')]},'groupBy':{'type':Sequelize[_0x7efc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7efc('0x2')]},'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 df793f8..a735382 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 _0x1b4e=['merge','options','AnalyticFieldReport','include','findAll','rows','catch','show','includeAll','find','create','body','bulkCreate','params','bulkDestroy','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL'];(function(_0x3057b6,_0x389d5b){var _0x3019f2=function(_0x4d0072){while(--_0x4d0072){_0x3057b6['push'](_0x3057b6['shift']());}};_0x3019f2(++_0x389d5b);}(_0x1b4e,0x158));var _0xe1b4=function(_0x50200b,_0x584e9e){_0x50200b=_0x50200b-0x0;var _0x468a05=_0x1b4e[_0x50200b];return _0x468a05;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe1b4('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1b4('0x1'));var moment=require(_0xe1b4('0x2'));var BPromise=require(_0xe1b4('0x3'));var Mustache=require(_0xe1b4('0x4'));var util=require(_0xe1b4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xe1b4('0x6'));var ejs=require(_0xe1b4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe1b4('0x8'));var squel=require(_0xe1b4('0x9'));var crypto=require(_0xe1b4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe1b4('0xb'));var toCsv=require(_0xe1b4('0x6'));var querystring=require(_0xe1b4('0xc'));var Papa=require('papaparse');var Redis=require(_0xe1b4('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe1b4('0xe'));var hardwareService=require(_0xe1b4('0xf'));var logger=require(_0xe1b4('0x10'))(_0xe1b4('0x11'));var utils=require(_0xe1b4('0x12'));var config=require(_0xe1b4('0x13'));var licenseUtil=require(_0xe1b4('0x14'));var db=require(_0xe1b4('0x15'))['db'];function respondWithStatusCode(_0xd5afa,_0x2b86b4){_0x2b86b4=_0x2b86b4||0xcc;return function(_0x5ed345){if(_0x5ed345){return _0xd5afa[_0xe1b4('0x16')](_0x2b86b4);}return _0xd5afa[_0xe1b4('0x17')](_0x2b86b4)['end']();};}function respondWithResult(_0x4a01f8,_0x2ca7c1){_0x2ca7c1=_0x2ca7c1||0xc8;return function(_0x43c9ab){if(_0x43c9ab){return _0x4a01f8[_0xe1b4('0x17')](_0x2ca7c1)[_0xe1b4('0x18')](_0x43c9ab);}};}function respondWithFilteredResult(_0x21c02b,_0x4b061b){return function(_0x271ede){if(_0x271ede){var _0x55e4d0=typeof _0x4b061b['offset']===_0xe1b4('0x19')&&typeof _0x4b061b[_0xe1b4('0x1a')]===_0xe1b4('0x19');var _0x2c72b2=_0x271ede[_0xe1b4('0x1b')];var _0xce0724=_0x55e4d0?0x0:_0x4b061b['offset'];var _0x282b33=_0x55e4d0?_0x271ede[_0xe1b4('0x1b')]:_0x4b061b[_0xe1b4('0x1c')]+_0x4b061b[_0xe1b4('0x1a')];var _0x5293e6;if(_0x282b33>=_0x2c72b2){_0x282b33=_0x2c72b2;_0x5293e6=0xc8;}else{_0x5293e6=0xce;}_0x21c02b[_0xe1b4('0x17')](_0x5293e6);return _0x21c02b[_0xe1b4('0x1d')]('Content-Range',_0xce0724+'-'+_0x282b33+'/'+_0x2c72b2)['json'](_0x271ede);}return null;};}function patchUpdates(_0x3fe027){return function(_0x1ee215){try{jsonpatch[_0xe1b4('0x1e')](_0x1ee215,_0x3fe027,!![]);}catch(_0x4ada5f){return BPromise[_0xe1b4('0x1f')](_0x4ada5f);}return _0x1ee215[_0xe1b4('0x20')]();};}function saveUpdates(_0x2b4209,_0x2870a1){return function(_0x552c4c){if(_0x552c4c){return _0x552c4c[_0xe1b4('0x21')](_0x2b4209)[_0xe1b4('0x22')](function(_0x1ae7af){return _0x1ae7af;});}return null;};}function removeEntity(_0xb4749b,_0x54c7ec){return function(_0x5d0ae7){if(_0x5d0ae7){return _0x5d0ae7[_0xe1b4('0x23')]()[_0xe1b4('0x22')](function(){_0xb4749b[_0xe1b4('0x17')](0xcc)[_0xe1b4('0x24')]();});}};}function handleEntityNotFound(_0x42c9f0,_0x1ae427){return function(_0x4ab3b8){if(!_0x4ab3b8){_0x42c9f0[_0xe1b4('0x16')](0x194);}return _0x4ab3b8;};}function handleError(_0x53ba43,_0xe53d0b){_0xe53d0b=_0xe53d0b||0x1f4;return function(_0x4fc8cb){logger[_0xe1b4('0x25')](_0x4fc8cb[_0xe1b4('0x26')]);if(_0x4fc8cb[_0xe1b4('0x27')]){delete _0x4fc8cb[_0xe1b4('0x27')];}_0x53ba43['status'](_0xe53d0b)[_0xe1b4('0x28')](_0x4fc8cb);};}exports[_0xe1b4('0x29')]=function(_0x16a849,_0x2b138d){var _0x20f61b={},_0x383494={},_0x1aa79c={'count':0x0,'rows':[]};var _0x35c4e1=_[_0xe1b4('0x2a')](db['AnalyticFieldReport'][_0xe1b4('0x2b')],function(_0x2a8023){return{'name':_0x2a8023['fieldName'],'type':_0x2a8023[_0xe1b4('0x2c')][_0xe1b4('0x2d')]};});_0x383494[_0xe1b4('0x2e')]=_[_0xe1b4('0x2a')](_0x35c4e1,_0xe1b4('0x27'));_0x383494[_0xe1b4('0x2f')]=_[_0xe1b4('0x30')](_0x16a849[_0xe1b4('0x2f')]);_0x383494['filters']=_[_0xe1b4('0x31')](_0x383494[_0xe1b4('0x2e')],_0x383494[_0xe1b4('0x2f')]);_0x20f61b[_0xe1b4('0x32')]=_['intersection'](_0x383494[_0xe1b4('0x2e')],qs[_0xe1b4('0x33')](_0x16a849['query'][_0xe1b4('0x33')]));_0x20f61b[_0xe1b4('0x32')]=_0x20f61b[_0xe1b4('0x32')][_0xe1b4('0x34')]?_0x20f61b[_0xe1b4('0x32')]:_0x383494[_0xe1b4('0x2e')];if(!_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x35')](_0xe1b4('0x36'))){_0x20f61b[_0xe1b4('0x1a')]=qs[_0xe1b4('0x1a')](_0x16a849[_0xe1b4('0x2f')]['limit']);_0x20f61b[_0xe1b4('0x1c')]=qs[_0xe1b4('0x1c')](_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x1c')]);}_0x20f61b[_0xe1b4('0x37')]=qs[_0xe1b4('0x38')](_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x38')]);_0x20f61b[_0xe1b4('0x39')]=qs['filters'](_[_0xe1b4('0x3a')](_0x16a849[_0xe1b4('0x2f')],_0x383494['filters']),_0x35c4e1);if(_0x16a849[_0xe1b4('0x2f')][_0xe1b4('0x3b')]){_0x20f61b[_0xe1b4('0x39')]=_['merge'](_0x20f61b[_0xe1b4('0x39')],{'$or':_['map'](_0x35c4e1,function(_0x95ca0d){if(_0x95ca0d[_0xe1b4('0x2c')]!==_0xe1b4('0x3c')){var _0x5d32c6={};_0x5d32c6[_0x95ca0d[_0xe1b4('0x27')]]={'$like':'%'+_0x16a849[_0xe1b4('0x2f')]['filter']+'%'};return _0x5d32c6;}})});}_0x20f61b=_[_0xe1b4('0x3d')]({},_0x20f61b,_0x16a849[_0xe1b4('0x3e')]);var _0x34b830={'where':_0x20f61b[_0xe1b4('0x39')]};return db[_0xe1b4('0x3f')][_0xe1b4('0x1b')](_0x34b830)[_0xe1b4('0x22')](function(_0x23a35d){_0x1aa79c[_0xe1b4('0x1b')]=_0x23a35d;if(_0x16a849[_0xe1b4('0x2f')]['includeAll']){_0x20f61b[_0xe1b4('0x40')]=[{'all':!![]}];}return db[_0xe1b4('0x3f')][_0xe1b4('0x41')](_0x20f61b);})[_0xe1b4('0x22')](function(_0x1fafb8){_0x1aa79c[_0xe1b4('0x42')]=_0x1fafb8;return _0x1aa79c;})[_0xe1b4('0x22')](respondWithFilteredResult(_0x2b138d,_0x20f61b))[_0xe1b4('0x43')](handleError(_0x2b138d,null));};exports[_0xe1b4('0x44')]=function(_0x3a3df8,_0x330f7f){var _0xd3da01={'raw':![],'where':{'id':_0x3a3df8['params']['id']}},_0x20288b={};_0x20288b[_0xe1b4('0x2e')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0x20288b[_0xe1b4('0x2f')]=_['keys'](_0x3a3df8[_0xe1b4('0x2f')]);_0x20288b['filters']=_[_0xe1b4('0x31')](_0x20288b[_0xe1b4('0x2e')],_0x20288b[_0xe1b4('0x2f')]);_0xd3da01[_0xe1b4('0x32')]=_[_0xe1b4('0x31')](_0x20288b[_0xe1b4('0x2e')],qs[_0xe1b4('0x33')](_0x3a3df8['query'][_0xe1b4('0x33')]));_0xd3da01[_0xe1b4('0x32')]=_0xd3da01[_0xe1b4('0x32')]['length']?_0xd3da01['attributes']:_0x20288b['model'];if(_0x3a3df8[_0xe1b4('0x2f')][_0xe1b4('0x45')]){_0xd3da01['include']=[{'all':!![]}];}_0xd3da01=_[_0xe1b4('0x3d')]({},_0xd3da01,_0x3a3df8[_0xe1b4('0x3e')]);return db[_0xe1b4('0x3f')][_0xe1b4('0x46')](_0xd3da01)[_0xe1b4('0x22')](handleEntityNotFound(_0x330f7f,null))[_0xe1b4('0x22')](respondWithResult(_0x330f7f,null))['catch'](handleError(_0x330f7f,null));};exports[_0xe1b4('0x47')]=function(_0x3de057,_0x2ebed5){return db[_0xe1b4('0x3f')][_0xe1b4('0x47')](_0x3de057[_0xe1b4('0x48')],{})[_0xe1b4('0x22')](respondWithResult(_0x2ebed5,0xc9))[_0xe1b4('0x43')](handleError(_0x2ebed5,null));};exports[_0xe1b4('0x49')]=function(_0xbe0a06,_0x34ccc7){return db[_0xe1b4('0x3f')][_0xe1b4('0x49')](_0xbe0a06[_0xe1b4('0x48')],{'raw':![],'individualHooks':!![]})[_0xe1b4('0x22')](respondWithResult(_0x34ccc7,0xc9))[_0xe1b4('0x43')](handleError(_0x34ccc7,null));};exports['update']=function(_0x45eab2,_0x11446b){if(_0x45eab2[_0xe1b4('0x48')]['id']){delete _0x45eab2[_0xe1b4('0x48')]['id'];}return db[_0xe1b4('0x3f')][_0xe1b4('0x46')]({'where':{'id':_0x45eab2['params']['id']}})['then'](handleEntityNotFound(_0x11446b,null))[_0xe1b4('0x22')](saveUpdates(_0x45eab2[_0xe1b4('0x48')],null))[_0xe1b4('0x22')](respondWithResult(_0x11446b,null))['catch'](handleError(_0x11446b,null));};exports[_0xe1b4('0x23')]=function(_0x51a0ce,_0x3c1176){return db[_0xe1b4('0x3f')][_0xe1b4('0x46')]({'where':{'id':_0x51a0ce[_0xe1b4('0x4a')]['id']}})[_0xe1b4('0x22')](handleEntityNotFound(_0x3c1176,null))[_0xe1b4('0x22')](removeEntity(_0x3c1176,null))['catch'](handleError(_0x3c1176,null));};exports[_0xe1b4('0x4b')]=function(_0x4faa81,_0x65b56d){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x4faa81[_0xe1b4('0x2f')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0xe1b4('0x22')](respondWithResult(_0x65b56d,0xcc))[_0xe1b4('0x43')](handleError(_0x65b56d,null));};exports['addFields']=function(_0x506eb5,_0x1363f2,_0x4e4da5){return db[_0xe1b4('0x4c')][_0xe1b4('0x4d')]({'where':{'id':_0x506eb5[_0xe1b4('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1363f2,null))['then'](function(_0x2d64c3){if(_0x2d64c3){return db[_0xe1b4('0x4e')][_0xe1b4('0x4f')](function(_0x2daa55){return db[_0xe1b4('0x3f')][_0xe1b4('0x23')]({'where':{'CustomReportId':_0x506eb5[_0xe1b4('0x4a')]['id']},'transaction':_0x2daa55})['then'](function(_0x4abac3){var _0x12c959=_['map'](_0x506eb5[_0xe1b4('0x48')],function(_0x538839){delete _0x538839['id'];_0x538839[_0xe1b4('0x50')]=_0x506eb5[_0xe1b4('0x4a')]['id'];return _0x538839;});return db['AnalyticFieldReport'][_0xe1b4('0x49')](_0x12c959,{'transaction':_0x2daa55});});})[_0xe1b4('0x22')](function(){return db[_0xe1b4('0x3f')][_0xe1b4('0x41')]({'where':{'CustomReportId':_0x506eb5[_0xe1b4('0x4a')]['id']}});});}})[_0xe1b4('0x22')](respondWithResult(_0x1363f2,null))['catch'](handleError(_0x1363f2,null));}; \ No newline at end of file +var _0x7513=['keys','intersection','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','error','stack','name','send','index','AnalyticFieldReport','rawAttributes','fieldName','type','model','map','query','filters','fields','length','attributes','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','then','includeAll','findAll','rows','catch','params'];(function(_0x4d6387,_0x59f34b){var _0x4f9761=function(_0x498b5e){while(--_0x498b5e){_0x4d6387['push'](_0x4d6387['shift']());}};_0x4f9761(++_0x59f34b);}(_0x7513,0x101));var _0x3751=function(_0x24182f,_0x5b066b){_0x24182f=_0x24182f-0x0;var _0x479194=_0x7513[_0x24182f];return _0x479194;};'use strict';var emlformat=require(_0x3751('0x0'));var rimraf=require(_0x3751('0x1'));var zipdir=require(_0x3751('0x2'));var jsonpatch=require(_0x3751('0x3'));var rp=require(_0x3751('0x4'));var moment=require(_0x3751('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x3751('0x6'));var util=require('util');var path=require(_0x3751('0x7'));var sox=require('sox');var csv=require(_0x3751('0x8'));var ejs=require(_0x3751('0x9'));var fs=require('fs');var fs_extra=require(_0x3751('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3751('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3751('0xc'));var toCsv=require(_0x3751('0x8'));var querystring=require('querystring');var Papa=require(_0x3751('0xd'));var Redis=require('ioredis');var authService=require(_0x3751('0xe'));var qs=require(_0x3751('0xf'));var as=require(_0x3751('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3751('0x11'))('api');var utils=require(_0x3751('0x12'));var config=require(_0x3751('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3751('0x14'))['db'];function respondWithStatusCode(_0x3f930e,_0x18f8df){_0x18f8df=_0x18f8df||0xcc;return function(_0x6cb632){if(_0x6cb632){return _0x3f930e[_0x3751('0x15')](_0x18f8df);}return _0x3f930e['status'](_0x18f8df)[_0x3751('0x16')]();};}function respondWithResult(_0x2c08ad,_0x1e18d6){_0x1e18d6=_0x1e18d6||0xc8;return function(_0x30f326){if(_0x30f326){return _0x2c08ad[_0x3751('0x17')](_0x1e18d6)[_0x3751('0x18')](_0x30f326);}};}function respondWithFilteredResult(_0x16e0d7,_0x4ecac2){return function(_0x1a0b7d){if(_0x1a0b7d){var _0x294623=typeof _0x4ecac2[_0x3751('0x19')]===_0x3751('0x1a')&&typeof _0x4ecac2[_0x3751('0x1b')]==='undefined';var _0x450482=_0x1a0b7d[_0x3751('0x1c')];var _0x2e14b3=_0x294623?0x0:_0x4ecac2[_0x3751('0x19')];var _0x13d803=_0x294623?_0x1a0b7d[_0x3751('0x1c')]:_0x4ecac2[_0x3751('0x19')]+_0x4ecac2['limit'];var _0x2a1deb;if(_0x13d803>=_0x450482){_0x13d803=_0x450482;_0x2a1deb=0xc8;}else{_0x2a1deb=0xce;}_0x16e0d7[_0x3751('0x17')](_0x2a1deb);return _0x16e0d7[_0x3751('0x1d')](_0x3751('0x1e'),_0x2e14b3+'-'+_0x13d803+'/'+_0x450482)[_0x3751('0x18')](_0x1a0b7d);}return null;};}function patchUpdates(_0xefd3d4){return function(_0x5ccb6f){try{jsonpatch[_0x3751('0x1f')](_0x5ccb6f,_0xefd3d4,!![]);}catch(_0x76e71){return BPromise[_0x3751('0x20')](_0x76e71);}return _0x5ccb6f['save']();};}function saveUpdates(_0x175dc1,_0x463514){return function(_0x465dd0){if(_0x465dd0){return _0x465dd0[_0x3751('0x21')](_0x175dc1)['then'](function(_0x2b964c){return _0x2b964c;});}return null;};}function removeEntity(_0x4411d6,_0x2bec5f){return function(_0x2815a5){if(_0x2815a5){return _0x2815a5[_0x3751('0x22')]()['then'](function(){_0x4411d6['status'](0xcc)[_0x3751('0x16')]();});}};}function handleEntityNotFound(_0x7c54a1,_0x294b29){return function(_0x3225fe){if(!_0x3225fe){_0x7c54a1[_0x3751('0x15')](0x194);}return _0x3225fe;};}function handleError(_0x100451,_0x181b90){_0x181b90=_0x181b90||0x1f4;return function(_0x38d2a9){logger[_0x3751('0x23')](_0x38d2a9[_0x3751('0x24')]);if(_0x38d2a9[_0x3751('0x25')]){delete _0x38d2a9[_0x3751('0x25')];}_0x100451[_0x3751('0x17')](_0x181b90)[_0x3751('0x26')](_0x38d2a9);};}exports[_0x3751('0x27')]=function(_0x39fe17,_0x374238){var _0x37ff8b={},_0x2fe930={},_0x1c1c3d={'count':0x0,'rows':[]};var _0x265674=_['map'](db[_0x3751('0x28')][_0x3751('0x29')],function(_0x5c5909){return{'name':_0x5c5909[_0x3751('0x2a')],'type':_0x5c5909[_0x3751('0x2b')]['key']};});_0x2fe930[_0x3751('0x2c')]=_[_0x3751('0x2d')](_0x265674,_0x3751('0x25'));_0x2fe930[_0x3751('0x2e')]=_['keys'](_0x39fe17[_0x3751('0x2e')]);_0x2fe930[_0x3751('0x2f')]=_['intersection'](_0x2fe930[_0x3751('0x2c')],_0x2fe930[_0x3751('0x2e')]);_0x37ff8b['attributes']=_['intersection'](_0x2fe930[_0x3751('0x2c')],qs[_0x3751('0x30')](_0x39fe17[_0x3751('0x2e')][_0x3751('0x30')]));_0x37ff8b['attributes']=_0x37ff8b['attributes'][_0x3751('0x31')]?_0x37ff8b[_0x3751('0x32')]:_0x2fe930[_0x3751('0x2c')];if(!_0x39fe17[_0x3751('0x2e')][_0x3751('0x33')](_0x3751('0x34'))){_0x37ff8b[_0x3751('0x1b')]=qs[_0x3751('0x1b')](_0x39fe17[_0x3751('0x2e')][_0x3751('0x1b')]);_0x37ff8b[_0x3751('0x19')]=qs[_0x3751('0x19')](_0x39fe17['query'][_0x3751('0x19')]);}_0x37ff8b[_0x3751('0x35')]=qs[_0x3751('0x36')](_0x39fe17[_0x3751('0x2e')][_0x3751('0x36')]);_0x37ff8b['where']=qs[_0x3751('0x2f')](_[_0x3751('0x37')](_0x39fe17[_0x3751('0x2e')],_0x2fe930[_0x3751('0x2f')]),_0x265674);if(_0x39fe17[_0x3751('0x2e')]['filter']){_0x37ff8b[_0x3751('0x38')]=_[_0x3751('0x39')](_0x37ff8b[_0x3751('0x38')],{'$or':_[_0x3751('0x2d')](_0x265674,function(_0x3bb7d1){if(_0x3bb7d1[_0x3751('0x2b')]!==_0x3751('0x3a')){var _0x11e934={};_0x11e934[_0x3bb7d1['name']]={'$like':'%'+_0x39fe17[_0x3751('0x2e')][_0x3751('0x3b')]+'%'};return _0x11e934;}})});}_0x37ff8b=_['merge']({},_0x37ff8b,_0x39fe17[_0x3751('0x3c')]);var _0x4aaa15={'where':_0x37ff8b[_0x3751('0x38')]};return db['AnalyticFieldReport'][_0x3751('0x1c')](_0x4aaa15)[_0x3751('0x3d')](function(_0x5addc4){_0x1c1c3d[_0x3751('0x1c')]=_0x5addc4;if(_0x39fe17[_0x3751('0x2e')][_0x3751('0x3e')]){_0x37ff8b['include']=[{'all':!![]}];}return db[_0x3751('0x28')][_0x3751('0x3f')](_0x37ff8b);})[_0x3751('0x3d')](function(_0x392062){_0x1c1c3d[_0x3751('0x40')]=_0x392062;return _0x1c1c3d;})[_0x3751('0x3d')](respondWithFilteredResult(_0x374238,_0x37ff8b))[_0x3751('0x41')](handleError(_0x374238,null));};exports['show']=function(_0x3e2a26,_0x1544c7){var _0x13854b={'raw':![],'where':{'id':_0x3e2a26[_0x3751('0x42')]['id']}},_0x5247a8={};_0x5247a8[_0x3751('0x2c')]=_[_0x3751('0x43')](db[_0x3751('0x28')][_0x3751('0x29')]);_0x5247a8['query']=_[_0x3751('0x43')](_0x3e2a26['query']);_0x5247a8[_0x3751('0x2f')]=_[_0x3751('0x44')](_0x5247a8[_0x3751('0x2c')],_0x5247a8[_0x3751('0x2e')]);_0x13854b[_0x3751('0x32')]=_[_0x3751('0x44')](_0x5247a8['model'],qs[_0x3751('0x30')](_0x3e2a26[_0x3751('0x2e')][_0x3751('0x30')]));_0x13854b[_0x3751('0x32')]=_0x13854b[_0x3751('0x32')]['length']?_0x13854b[_0x3751('0x32')]:_0x5247a8[_0x3751('0x2c')];if(_0x3e2a26[_0x3751('0x2e')][_0x3751('0x3e')]){_0x13854b['include']=[{'all':!![]}];}_0x13854b=_[_0x3751('0x39')]({},_0x13854b,_0x3e2a26[_0x3751('0x3c')]);return db[_0x3751('0x28')][_0x3751('0x45')](_0x13854b)['then'](handleEntityNotFound(_0x1544c7,null))[_0x3751('0x3d')](respondWithResult(_0x1544c7,null))[_0x3751('0x41')](handleError(_0x1544c7,null));};exports[_0x3751('0x46')]=function(_0x4eb0bd,_0x56370a){return db['AnalyticFieldReport']['create'](_0x4eb0bd[_0x3751('0x47')],{})[_0x3751('0x3d')](respondWithResult(_0x56370a,0xc9))[_0x3751('0x41')](handleError(_0x56370a,null));};exports[_0x3751('0x48')]=function(_0x1ba4bb,_0x570ada){return db[_0x3751('0x28')][_0x3751('0x48')](_0x1ba4bb[_0x3751('0x47')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x570ada,0xc9))[_0x3751('0x41')](handleError(_0x570ada,null));};exports['update']=function(_0x457cf6,_0x599796){if(_0x457cf6[_0x3751('0x47')]['id']){delete _0x457cf6['body']['id'];}return db[_0x3751('0x28')][_0x3751('0x45')]({'where':{'id':_0x457cf6[_0x3751('0x42')]['id']}})[_0x3751('0x3d')](handleEntityNotFound(_0x599796,null))[_0x3751('0x3d')](saveUpdates(_0x457cf6['body'],null))['then'](respondWithResult(_0x599796,null))['catch'](handleError(_0x599796,null));};exports[_0x3751('0x22')]=function(_0x5b0be5,_0x31aa28){return db[_0x3751('0x28')][_0x3751('0x45')]({'where':{'id':_0x5b0be5[_0x3751('0x42')]['id']}})[_0x3751('0x3d')](handleEntityNotFound(_0x31aa28,null))[_0x3751('0x3d')](removeEntity(_0x31aa28,null))[_0x3751('0x41')](handleError(_0x31aa28,null));};exports[_0x3751('0x49')]=function(_0x5575c1,_0x378fba){return db[_0x3751('0x28')]['destroy']({'where':{'id':_0x5575c1[_0x3751('0x2e')][_0x3751('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x378fba,0xcc))[_0x3751('0x41')](handleError(_0x378fba,null));};exports[_0x3751('0x4b')]=function(_0x37f714,_0x2ee2a7,_0x5b814d){return db[_0x3751('0x4c')][_0x3751('0x4d')]({'where':{'id':_0x37f714[_0x3751('0x42')]['id']}})[_0x3751('0x3d')](handleEntityNotFound(_0x2ee2a7,null))['then'](function(_0x22b829){if(_0x22b829){return db[_0x3751('0x4e')][_0x3751('0x4f')](function(_0x2da871){return db['AnalyticFieldReport'][_0x3751('0x22')]({'where':{'CustomReportId':_0x37f714[_0x3751('0x42')]['id']},'transaction':_0x2da871})[_0x3751('0x3d')](function(_0x534b25){var _0x1eefbb=_[_0x3751('0x2d')](_0x37f714[_0x3751('0x47')],function(_0x3995ec){delete _0x3995ec['id'];_0x3995ec[_0x3751('0x50')]=_0x37f714[_0x3751('0x42')]['id'];return _0x3995ec;});return db[_0x3751('0x28')][_0x3751('0x48')](_0x1eefbb,{'transaction':_0x2da871});});})[_0x3751('0x3d')](function(){return db[_0x3751('0x28')][_0x3751('0x3f')]({'where':{'CustomReportId':_0x37f714['params']['id']}});});}})[_0x3751('0x3d')](respondWithResult(_0x2ee2a7,null))['catch'](handleError(_0x2ee2a7,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index a20b03e..f877be9 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 _0x3761=['moment','bluebird','request-promise','rimraf','./analyticFieldReport.attributes','exports','AnalyticFieldReport','lodash','util','api'];(function(_0x59ed0e,_0x41a60f){var _0x9a8307=function(_0x1f4421){while(--_0x1f4421){_0x59ed0e['push'](_0x59ed0e['shift']());}};_0x9a8307(++_0x41a60f);}(_0x3761,0xed));var _0x1376=function(_0x1dc3ef,_0x440625){_0x1dc3ef=_0x1dc3ef-0x0;var _0xe54c21=_0x3761[_0x1dc3ef];return _0xe54c21;};'use strict';var _=require(_0x1376('0x0'));var util=require(_0x1376('0x1'));var logger=require('../../config/logger')(_0x1376('0x2'));var moment=require(_0x1376('0x3'));var BPromise=require(_0x1376('0x4'));var rp=require(_0x1376('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1376('0x6'));var config=require('../../config/environment');var attributes=require(_0x1376('0x7'));module[_0x1376('0x8')]=function(_0x504304,_0x55fe01){return _0x504304['define'](_0x1376('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3df0=['bluebird','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','../../config/logger','moment'];(function(_0x44030a,_0x581291){var _0x3139a3=function(_0x55b8bd){while(--_0x55b8bd){_0x44030a['push'](_0x44030a['shift']());}};_0x3139a3(++_0x581291);}(_0x3df0,0x16f));var _0x03df=function(_0x5d89fe,_0x38bd7f){_0x5d89fe=_0x5d89fe-0x0;var _0xcdff77=_0x3df0[_0x5d89fe];return _0xcdff77;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x03df('0x0'))('api');var moment=require(_0x03df('0x1'));var BPromise=require(_0x03df('0x2'));var rp=require(_0x03df('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x03df('0x4'));var attributes=require(_0x03df('0x5'));module[_0x03df('0x6')]=function(_0x44de9c,_0xd1c8e0){return _0x44de9c[_0x03df('0x7')](_0x03df('0x8'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 9f3a2d8..3793c21 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 _0xaa27=['jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xaa27,0x115));var _0x7aa2=function(_0x45b47b,_0x33dcc0){_0x45b47b=_0x45b47b-0x0;var _0x7530f1=_0xaa27[_0x45b47b];return _0x7530f1;};'use strict';var _=require(_0x7aa2('0x0'));var util=require(_0x7aa2('0x1'));var moment=require(_0x7aa2('0x2'));var BPromise=require(_0x7aa2('0x3'));var rs=require(_0x7aa2('0x4'));var fs=require('fs');var Redis=require(_0x7aa2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7aa2('0x6'));var logger=require(_0x7aa2('0x7'))('rpc');var config=require(_0x7aa2('0x8'));var jayson=require(_0x7aa2('0x9'));var client=jayson[_0x7aa2('0xa')][_0x7aa2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9c46b5,_0x561ced,_0x10dd48){return new BPromise(function(_0x44cc40,_0x4594a7){return client[_0x7aa2('0xc')](_0x9c46b5,_0x10dd48)[_0x7aa2('0xd')](function(_0x47a12b){logger[_0x7aa2('0xe')](_0x7aa2('0xf'),_0x561ced,_0x7aa2('0x10'));logger[_0x7aa2('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x561ced,_0x7aa2('0x10'),JSON[_0x7aa2('0x12')](_0x47a12b));if(_0x47a12b[_0x7aa2('0x13')]){if(_0x47a12b[_0x7aa2('0x13')]['code']===0x1f4){logger[_0x7aa2('0x13')](_0x7aa2('0xf'),_0x561ced,_0x47a12b[_0x7aa2('0x13')][_0x7aa2('0x14')]);return _0x4594a7(_0x47a12b['error'][_0x7aa2('0x14')]);}logger['error'](_0x7aa2('0xf'),_0x561ced,_0x47a12b[_0x7aa2('0x13')][_0x7aa2('0x14')]);return _0x44cc40(_0x47a12b['error'][_0x7aa2('0x14')]);}else{logger[_0x7aa2('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x561ced,'request\x20sent');_0x44cc40(_0x47a12b[_0x7aa2('0x15')][_0x7aa2('0x14')]);}})['catch'](function(_0x4ce299){logger[_0x7aa2('0x13')](_0x7aa2('0xf'),_0x561ced,_0x4ce299);_0x4594a7(_0x4ce299);});});} \ No newline at end of file +var _0xaa83=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x535963,_0x326515){var _0x3975f6=function(_0x2e624f){while(--_0x2e624f){_0x535963['push'](_0x535963['shift']());}};_0x3975f6(++_0x326515);}(_0xaa83,0xf3));var _0x3aa8=function(_0x1b3fb0,_0x49325a){_0x1b3fb0=_0x1b3fb0-0x0;var _0x5eb66e=_0xaa83[_0x1b3fb0];return _0x5eb66e;};'use strict';var _=require(_0x3aa8('0x0'));var util=require(_0x3aa8('0x1'));var moment=require(_0x3aa8('0x2'));var BPromise=require(_0x3aa8('0x3'));var rs=require(_0x3aa8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3aa8('0x5'))['db'];var utils=require(_0x3aa8('0x6'));var logger=require('../../config/logger')(_0x3aa8('0x7'));var config=require(_0x3aa8('0x8'));var jayson=require(_0x3aa8('0x9'));var client=jayson[_0x3aa8('0xa')][_0x3aa8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x113559,_0x2b378b,_0x226ecf){return new BPromise(function(_0x4dc365,_0x583156){return client[_0x3aa8('0xc')](_0x113559,_0x226ecf)[_0x3aa8('0xd')](function(_0x5514bd){logger[_0x3aa8('0xe')](_0x3aa8('0xf'),_0x2b378b,_0x3aa8('0x10'));logger[_0x3aa8('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2b378b,_0x3aa8('0x10'),JSON[_0x3aa8('0x12')](_0x5514bd));if(_0x5514bd[_0x3aa8('0x13')]){if(_0x5514bd['error'][_0x3aa8('0x14')]===0x1f4){logger[_0x3aa8('0x13')](_0x3aa8('0xf'),_0x2b378b,_0x5514bd[_0x3aa8('0x13')][_0x3aa8('0x15')]);return _0x583156(_0x5514bd[_0x3aa8('0x13')][_0x3aa8('0x15')]);}logger[_0x3aa8('0x13')](_0x3aa8('0xf'),_0x2b378b,_0x5514bd['error'][_0x3aa8('0x15')]);return _0x4dc365(_0x5514bd[_0x3aa8('0x13')][_0x3aa8('0x15')]);}else{logger[_0x3aa8('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2b378b,_0x3aa8('0x10'));_0x4dc365(_0x5514bd[_0x3aa8('0x16')][_0x3aa8('0x15')]);}})[_0x3aa8('0x17')](function(_0x2d0563){logger[_0x3aa8('0x13')](_0x3aa8('0xf'),_0x2b378b,_0x2d0563);_0x583156(_0x2d0563);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index ea66d6b..b0e3925 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(_0x81031b,_0x1d3b77){var _0xe5ba4a=function(_0x182416){while(--_0x182416){_0x81031b['push'](_0x81031b['shift']());}};_0xe5ba4a(++_0x1d3b77);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'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(_0x36ccd0,_0x4d6767){var _0xf50b90=function(_0x363f5d){while(--_0x363f5d){_0x36ccd0['push'](_0x36ccd0['shift']());}};_0xf50b90(++_0x4d6767);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 b031f0a..954d809 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 _0x9af1=['sequelize','exports','STRING','TEXT'];(function(_0x7148a3,_0x1c6652){var _0x52f31d=function(_0x31c8a7){while(--_0x31c8a7){_0x7148a3['push'](_0x7148a3['shift']());}};_0x52f31d(++_0x1c6652);}(_0x9af1,0x68));var _0x19af=function(_0x30056a,_0x4b6322){_0x30056a=_0x30056a-0x0;var _0x2f0799=_0x9af1[_0x30056a];return _0x2f0799;};'use strict';var Sequelize=require(_0x19af('0x0'));module[_0x19af('0x1')]={'name':{'type':Sequelize[_0x19af('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0x19af('0x2')]},'metric':{'type':Sequelize[_0x19af('0x3')]},'description':{'type':Sequelize[_0x19af('0x2')]}}; \ No newline at end of file +var _0x93ed=['STRING','name','sequelize','exports'];(function(_0x31906e,_0x3bcb9d){var _0xd7353=function(_0x4cfba4){while(--_0x4cfba4){_0x31906e['push'](_0x31906e['shift']());}};_0xd7353(++_0x3bcb9d);}(_0x93ed,0xfe));var _0xd93e=function(_0x1428a1,_0x342a4c){_0x1428a1=_0x1428a1-0x0;var _0x56cd58=_0x93ed[_0x1428a1];return _0x56cd58;};'use strict';var Sequelize=require(_0xd93e('0x0'));module[_0xd93e('0x1')]={'name':{'type':Sequelize[_0xd93e('0x2')],'allowNull':![],'unique':_0xd93e('0x3')},'table':{'type':Sequelize[_0xd93e('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xd93e('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index ca188e9..a91e87b 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 _0xd6d6=['includeAll','catch','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','params','eml-format','rimraf','zip-dir','fast-json-patch','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','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','AnalyticMetric','rows','show'];(function(_0x242f71,_0x37747b){var _0x2c5568=function(_0x14c26b){while(--_0x14c26b){_0x242f71['push'](_0x242f71['shift']());}};_0x2c5568(++_0x37747b);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x40193b,_0x101a6d){_0x40193b=_0x40193b-0x0;var _0x2d19d1=_0xd6d6[_0x40193b];return _0x2d19d1;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){var _0x99f7d6=_0x583b10[_0x6d6d('0x29')]({'plain':!![]});var _0xf0df7f=_0x6d6d('0x2a');return db['UserProfileResource'][_0x6d6d('0x28')]({'where':{'type':_0xf0df7f,'resourceId':_0x99f7d6['id']}})[_0x6d6d('0x27')](function(){return _0x583b10;});})[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x408f98,_0x3641fc){return function(_0x4a57a1){if(!_0x4a57a1){_0x408f98[_0x6d6d('0x19')](0x194);}return _0x4a57a1;};}function handleError(_0x9595d8,_0x51bd68){_0x51bd68=_0x51bd68||0x1f4;return function(_0x553645){logger[_0x6d6d('0x2b')](_0x553645[_0x6d6d('0x2c')]);if(_0x553645[_0x6d6d('0x2d')]){delete _0x553645['name'];}_0x9595d8[_0x6d6d('0x1a')](_0x51bd68)[_0x6d6d('0x2e')](_0x553645);};}exports[_0x6d6d('0x2f')]=function(_0x1c8340,_0x64d1f7){var _0x428c17={},_0xdda3f2={},_0x359cfd={'count':0x0,'rows':[]};var _0x6c4741=_[_0x6d6d('0x30')](db['AnalyticMetric'][_0x6d6d('0x31')],function(_0x4f1fc5){return{'name':_0x4f1fc5[_0x6d6d('0x32')],'type':_0x4f1fc5[_0x6d6d('0x33')][_0x6d6d('0x34')]};});_0xdda3f2[_0x6d6d('0x35')]=_['map'](_0x6c4741,_0x6d6d('0x2d'));_0xdda3f2['query']=_[_0x6d6d('0x36')](_0x1c8340[_0x6d6d('0x37')]);_0xdda3f2['filters']=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],_0xdda3f2[_0x6d6d('0x37')]);_0x428c17[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xdda3f2[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x428c17[_0x6d6d('0x39')]=_0x428c17[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x428c17[_0x6d6d('0x39')]:_0xdda3f2[_0x6d6d('0x35')];if(!_0x1c8340['query'][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x428c17[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x1c8340['query']['limit']);_0x428c17[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x1c8340[_0x6d6d('0x37')]['offset']);}_0x428c17[_0x6d6d('0x3e')]=qs[_0x6d6d('0x3f')](_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x3f')]);_0x428c17['where']=qs['filters'](_['pick'](_0x1c8340[_0x6d6d('0x37')],_0xdda3f2[_0x6d6d('0x40')]),_0x6c4741);if(_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]){_0x428c17['where']=_[_0x6d6d('0x42')](_0x428c17[_0x6d6d('0x43')],{'$or':_[_0x6d6d('0x30')](_0x6c4741,function(_0x3c6d23){if(_0x3c6d23[_0x6d6d('0x33')]!==_0x6d6d('0x44')){var _0x4b457d={};_0x4b457d[_0x3c6d23[_0x6d6d('0x2d')]]={'$like':'%'+_0x1c8340[_0x6d6d('0x37')][_0x6d6d('0x41')]+'%'};return _0x4b457d;}})});}_0x428c17=_[_0x6d6d('0x42')]({},_0x428c17,_0x1c8340[_0x6d6d('0x45')]);var _0x3e27b7={'where':_0x428c17[_0x6d6d('0x43')]};return db['AnalyticMetric'][_0x6d6d('0x20')](_0x3e27b7)[_0x6d6d('0x27')](function(_0x16e177){_0x359cfd[_0x6d6d('0x20')]=_0x16e177;if(_0x1c8340[_0x6d6d('0x37')]['includeAll']){_0x428c17[_0x6d6d('0x46')]=[{'all':!![]}];}return db[_0x6d6d('0x47')]['findAll'](_0x428c17);})[_0x6d6d('0x27')](function(_0x50dc17){_0x359cfd[_0x6d6d('0x48')]=_0x50dc17;return _0x359cfd;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x64d1f7,_0x428c17))['catch'](handleError(_0x64d1f7,null));};exports[_0x6d6d('0x49')]=function(_0x3324ec,_0x252cbe){var _0x4041f3={'raw':!![],'where':{'id':_0x3324ec['params']['id']}},_0xf7ea0d={};_0xf7ea0d['model']=_[_0x6d6d('0x36')](db['AnalyticMetric']['rawAttributes']);_0xf7ea0d[_0x6d6d('0x37')]=_[_0x6d6d('0x36')](_0x3324ec[_0x6d6d('0x37')]);_0xf7ea0d['filters']=_[_0x6d6d('0x38')](_0xf7ea0d['model'],_0xf7ea0d[_0x6d6d('0x37')]);_0x4041f3[_0x6d6d('0x39')]=_[_0x6d6d('0x38')](_0xf7ea0d[_0x6d6d('0x35')],qs[_0x6d6d('0x3a')](_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x3a')]));_0x4041f3['attributes']=_0x4041f3[_0x6d6d('0x39')][_0x6d6d('0x3b')]?_0x4041f3[_0x6d6d('0x39')]:_0xf7ea0d[_0x6d6d('0x35')];if(_0x3324ec[_0x6d6d('0x37')][_0x6d6d('0x4a')]){_0x4041f3[_0x6d6d('0x46')]=[{'all':!![]}];}_0x4041f3=_[_0x6d6d('0x42')]({},_0x4041f3,_0x3324ec[_0x6d6d('0x45')]);return db['AnalyticMetric']['find'](_0x4041f3)[_0x6d6d('0x27')](handleEntityNotFound(_0x252cbe,null))[_0x6d6d('0x27')](respondWithResult(_0x252cbe,null))[_0x6d6d('0x4b')](handleError(_0x252cbe,null));};exports[_0x6d6d('0x4c')]=function(_0xe2a20e,_0x492834){return db[_0x6d6d('0x47')][_0x6d6d('0x4c')](_0xe2a20e[_0x6d6d('0x4d')],{})[_0x6d6d('0x27')](function(_0x2ee917){var _0x23c2db=_0xe2a20e[_0x6d6d('0x4e')][_0x6d6d('0x29')]({'plain':!![]});if(!_0x23c2db)throw new Error(_0x6d6d('0x4f'));if(_0x23c2db[_0x6d6d('0x50')]===_0x6d6d('0x4e')){var _0x175e26=_0x2ee917['get']({'plain':!![]});var _0x190786=_0x6d6d('0x2a');return db[_0x6d6d('0x51')][_0x6d6d('0x52')]({'where':{'name':_0x190786,'userProfileId':_0x23c2db[_0x6d6d('0x53')]},'raw':!![]})['then'](function(_0x38c307){if(_0x38c307&&_0x38c307[_0x6d6d('0x54')]===0x0){return db[_0x6d6d('0x55')]['create']({'name':_0x175e26['name'],'resourceId':_0x175e26['id'],'type':_0x38c307[_0x6d6d('0x2d')],'sectionId':_0x38c307['id']},{})['then'](function(){return _0x2ee917;});}else{return _0x2ee917;}})[_0x6d6d('0x4b')](function(_0x995fe2){logger[_0x6d6d('0x2b')](_0x6d6d('0x56'),_0x995fe2);throw _0x995fe2;});}return _0x2ee917;})[_0x6d6d('0x27')](respondWithResult(_0x492834,0xc9))[_0x6d6d('0x4b')](handleError(_0x492834,null));};exports[_0x6d6d('0x26')]=function(_0x26c23a,_0x1a8f33){if(_0x26c23a[_0x6d6d('0x4d')]['id']){delete _0x26c23a['body']['id'];}return db[_0x6d6d('0x47')][_0x6d6d('0x52')]({'where':{'id':_0x26c23a[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x1a8f33,null))[_0x6d6d('0x27')](saveUpdates(_0x26c23a[_0x6d6d('0x4d')],null))[_0x6d6d('0x27')](respondWithResult(_0x1a8f33,null))['catch'](handleError(_0x1a8f33,null));};exports['destroy']=function(_0x3ad9b0,_0x122865){return db['AnalyticMetric'][_0x6d6d('0x52')]({'where':{'id':_0x3ad9b0[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x122865,null))[_0x6d6d('0x27')](removeEntity(_0x122865,null))[_0x6d6d('0x4b')](handleError(_0x122865,null));}; \ No newline at end of file +var _0x7da7=['model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','merge','options','where','AnalyticMetric','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','json','apply','reject','update','then','destroy','get','Metrics','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x7da7,0x10d));var _0x77da=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x7da7[_0x38ced4];return _0x547c07;};'use strict';var emlformat=require(_0x77da('0x0'));var rimraf=require(_0x77da('0x1'));var zipdir=require(_0x77da('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x77da('0x3'));var BPromise=require(_0x77da('0x4'));var Mustache=require('mustache');var util=require(_0x77da('0x5'));var path=require(_0x77da('0x6'));var sox=require('sox');var csv=require(_0x77da('0x7'));var ejs=require(_0x77da('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x77da('0x9'));var squel=require('squel');var crypto=require(_0x77da('0xa'));var jsforce=require(_0x77da('0xb'));var deskjs=require(_0x77da('0xc'));var toCsv=require(_0x77da('0x7'));var querystring=require(_0x77da('0xd'));var Papa=require('papaparse');var Redis=require(_0x77da('0xe'));var authService=require(_0x77da('0xf'));var qs=require(_0x77da('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x77da('0x11'));var logger=require(_0x77da('0x12'))(_0x77da('0x13'));var utils=require(_0x77da('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x77da('0x15'));var db=require(_0x77da('0x16'))['db'];function respondWithStatusCode(_0x2acc65,_0x5d6e2f){_0x5d6e2f=_0x5d6e2f||0xcc;return function(_0x4a7748){if(_0x4a7748){return _0x2acc65[_0x77da('0x17')](_0x5d6e2f);}return _0x2acc65[_0x77da('0x18')](_0x5d6e2f)['end']();};}function respondWithResult(_0x3b0ff2,_0x369df0){_0x369df0=_0x369df0||0xc8;return function(_0x355719){if(_0x355719){return _0x3b0ff2[_0x77da('0x18')](_0x369df0)['json'](_0x355719);}};}function respondWithFilteredResult(_0x2172d0,_0x4e130c){return function(_0x29cd7b){if(_0x29cd7b){var _0x366443=typeof _0x4e130c[_0x77da('0x19')]===_0x77da('0x1a')&&typeof _0x4e130c['limit']==='undefined';var _0x514016=_0x29cd7b['count'];var _0x103e46=_0x366443?0x0:_0x4e130c[_0x77da('0x19')];var _0x289887=_0x366443?_0x29cd7b[_0x77da('0x1b')]:_0x4e130c[_0x77da('0x19')]+_0x4e130c[_0x77da('0x1c')];var _0x1d325c;if(_0x289887>=_0x514016){_0x289887=_0x514016;_0x1d325c=0xc8;}else{_0x1d325c=0xce;}_0x2172d0[_0x77da('0x18')](_0x1d325c);return _0x2172d0['set']('Content-Range',_0x103e46+'-'+_0x289887+'/'+_0x514016)[_0x77da('0x1d')](_0x29cd7b);}return null;};}function patchUpdates(_0x4d1512){return function(_0x507979){try{jsonpatch[_0x77da('0x1e')](_0x507979,_0x4d1512,!![]);}catch(_0x304a2b){return BPromise[_0x77da('0x1f')](_0x304a2b);}return _0x507979['save']();};}function saveUpdates(_0x58270c,_0x3e6cfe){return function(_0x58f6c1){if(_0x58f6c1){return _0x58f6c1[_0x77da('0x20')](_0x58270c)[_0x77da('0x21')](function(_0xc52f0e){return _0xc52f0e;});}return null;};}function removeEntity(_0x27b6c7,_0x10399a){return function(_0x270318){if(_0x270318){return _0x270318[_0x77da('0x22')]()['then'](function(){var _0x4885ec=_0x270318[_0x77da('0x23')]({'plain':!![]});var _0x2d009f=_0x77da('0x24');return db[_0x77da('0x25')]['destroy']({'where':{'type':_0x2d009f,'resourceId':_0x4885ec['id']}})[_0x77da('0x21')](function(){return _0x270318;});})[_0x77da('0x21')](function(){_0x27b6c7[_0x77da('0x18')](0xcc)[_0x77da('0x26')]();});}};}function handleEntityNotFound(_0x446ae7,_0x5997b6){return function(_0xce24b8){if(!_0xce24b8){_0x446ae7[_0x77da('0x17')](0x194);}return _0xce24b8;};}function handleError(_0x1f2279,_0x2913f7){_0x2913f7=_0x2913f7||0x1f4;return function(_0x496ecd){logger['error'](_0x496ecd['stack']);if(_0x496ecd[_0x77da('0x27')]){delete _0x496ecd[_0x77da('0x27')];}_0x1f2279[_0x77da('0x18')](_0x2913f7)[_0x77da('0x28')](_0x496ecd);};}exports[_0x77da('0x29')]=function(_0x4eeb99,_0x350b4e){var _0x26f5a0={},_0x356bfb={},_0x1d381b={'count':0x0,'rows':[]};var _0x1e7853=_[_0x77da('0x2a')](db['AnalyticMetric'][_0x77da('0x2b')],function(_0x228851){return{'name':_0x228851[_0x77da('0x2c')],'type':_0x228851[_0x77da('0x2d')][_0x77da('0x2e')]};});_0x356bfb[_0x77da('0x2f')]=_[_0x77da('0x2a')](_0x1e7853,_0x77da('0x27'));_0x356bfb['query']=_['keys'](_0x4eeb99[_0x77da('0x30')]);_0x356bfb[_0x77da('0x31')]=_['intersection'](_0x356bfb[_0x77da('0x2f')],_0x356bfb[_0x77da('0x30')]);_0x26f5a0[_0x77da('0x32')]=_[_0x77da('0x33')](_0x356bfb[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x4eeb99[_0x77da('0x30')]['fields']));_0x26f5a0[_0x77da('0x32')]=_0x26f5a0['attributes']['length']?_0x26f5a0['attributes']:_0x356bfb[_0x77da('0x2f')];if(!_0x4eeb99['query'][_0x77da('0x35')](_0x77da('0x36'))){_0x26f5a0[_0x77da('0x1c')]=qs[_0x77da('0x1c')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x1c')]);_0x26f5a0[_0x77da('0x19')]=qs['offset'](_0x4eeb99[_0x77da('0x30')][_0x77da('0x19')]);}_0x26f5a0[_0x77da('0x37')]=qs[_0x77da('0x38')](_0x4eeb99[_0x77da('0x30')][_0x77da('0x38')]);_0x26f5a0['where']=qs[_0x77da('0x31')](_[_0x77da('0x39')](_0x4eeb99[_0x77da('0x30')],_0x356bfb['filters']),_0x1e7853);if(_0x4eeb99[_0x77da('0x30')]['filter']){_0x26f5a0['where']=_['merge'](_0x26f5a0['where'],{'$or':_[_0x77da('0x2a')](_0x1e7853,function(_0x1adba5){if(_0x1adba5[_0x77da('0x2d')]!=='VIRTUAL'){var _0x21d337={};_0x21d337[_0x1adba5['name']]={'$like':'%'+_0x4eeb99[_0x77da('0x30')]['filter']+'%'};return _0x21d337;}})});}_0x26f5a0=_[_0x77da('0x3a')]({},_0x26f5a0,_0x4eeb99[_0x77da('0x3b')]);var _0x290667={'where':_0x26f5a0[_0x77da('0x3c')]};return db[_0x77da('0x3d')]['count'](_0x290667)[_0x77da('0x21')](function(_0x1f48bd){_0x1d381b[_0x77da('0x1b')]=_0x1f48bd;if(_0x4eeb99[_0x77da('0x30')][_0x77da('0x3e')]){_0x26f5a0[_0x77da('0x3f')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x77da('0x40')](_0x26f5a0);})[_0x77da('0x21')](function(_0x21de41){_0x1d381b[_0x77da('0x41')]=_0x21de41;return _0x1d381b;})[_0x77da('0x21')](respondWithFilteredResult(_0x350b4e,_0x26f5a0))[_0x77da('0x42')](handleError(_0x350b4e,null));};exports['show']=function(_0x10957b,_0x5abcd9){var _0x1ae806={'raw':!![],'where':{'id':_0x10957b[_0x77da('0x43')]['id']}},_0x373fb2={};_0x373fb2['model']=_[_0x77da('0x44')](db[_0x77da('0x3d')][_0x77da('0x2b')]);_0x373fb2[_0x77da('0x30')]=_[_0x77da('0x44')](_0x10957b[_0x77da('0x30')]);_0x373fb2[_0x77da('0x31')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],_0x373fb2['query']);_0x1ae806[_0x77da('0x32')]=_[_0x77da('0x33')](_0x373fb2[_0x77da('0x2f')],qs[_0x77da('0x34')](_0x10957b[_0x77da('0x30')][_0x77da('0x34')]));_0x1ae806['attributes']=_0x1ae806['attributes'][_0x77da('0x45')]?_0x1ae806[_0x77da('0x32')]:_0x373fb2[_0x77da('0x2f')];if(_0x10957b[_0x77da('0x30')][_0x77da('0x3e')]){_0x1ae806[_0x77da('0x3f')]=[{'all':!![]}];}_0x1ae806=_['merge']({},_0x1ae806,_0x10957b[_0x77da('0x3b')]);return db[_0x77da('0x3d')][_0x77da('0x46')](_0x1ae806)[_0x77da('0x21')](handleEntityNotFound(_0x5abcd9,null))['then'](respondWithResult(_0x5abcd9,null))[_0x77da('0x42')](handleError(_0x5abcd9,null));};exports['create']=function(_0x518fd5,_0x36263b){return db[_0x77da('0x3d')][_0x77da('0x47')](_0x518fd5[_0x77da('0x48')],{})['then'](function(_0x16bf4b){var _0x1e36ee=_0x518fd5['user'][_0x77da('0x23')]({'plain':!![]});if(!_0x1e36ee)throw new Error(_0x77da('0x49'));if(_0x1e36ee['role']===_0x77da('0x4a')){var _0x3aaf5b=_0x16bf4b[_0x77da('0x23')]({'plain':!![]});var _0xef2496=_0x77da('0x24');return db[_0x77da('0x4b')][_0x77da('0x46')]({'where':{'name':_0xef2496,'userProfileId':_0x1e36ee[_0x77da('0x4c')]},'raw':!![]})[_0x77da('0x21')](function(_0x3a34a8){if(_0x3a34a8&&_0x3a34a8['autoAssociation']===0x0){return db[_0x77da('0x25')]['create']({'name':_0x3aaf5b[_0x77da('0x27')],'resourceId':_0x3aaf5b['id'],'type':_0x3a34a8[_0x77da('0x27')],'sectionId':_0x3a34a8['id']},{})[_0x77da('0x21')](function(){return _0x16bf4b;});}else{return _0x16bf4b;}})[_0x77da('0x42')](function(_0x374179){logger[_0x77da('0x4d')](_0x77da('0x4e'),_0x374179);throw _0x374179;});}return _0x16bf4b;})['then'](respondWithResult(_0x36263b,0xc9))[_0x77da('0x42')](handleError(_0x36263b,null));};exports[_0x77da('0x20')]=function(_0x1a7115,_0x353be9){if(_0x1a7115['body']['id']){delete _0x1a7115[_0x77da('0x48')]['id'];}return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x1a7115['params']['id']}})['then'](handleEntityNotFound(_0x353be9,null))[_0x77da('0x21')](saveUpdates(_0x1a7115[_0x77da('0x48')],null))[_0x77da('0x21')](respondWithResult(_0x353be9,null))[_0x77da('0x42')](handleError(_0x353be9,null));};exports[_0x77da('0x22')]=function(_0x528a32,_0x50437b){return db[_0x77da('0x3d')][_0x77da('0x46')]({'where':{'id':_0x528a32['params']['id']}})[_0x77da('0x21')](handleEntityNotFound(_0x50437b,null))[_0x77da('0x21')](removeEntity(_0x50437b,null))[_0x77da('0x42')](handleError(_0x50437b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index da1e626..772e50e 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 _0x158f=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x158f,0x137));var _0xf158=function(_0x2c022a,_0x1ea7ba){_0x2c022a=_0x2c022a-0x0;var _0x422073=_0x158f[_0x2c022a];return _0x422073;};'use strict';var _=require('lodash');var util=require(_0xf158('0x0'));var logger=require(_0xf158('0x1'))(_0xf158('0x2'));var moment=require(_0xf158('0x3'));var BPromise=require(_0xf158('0x4'));var rp=require(_0xf158('0x5'));var fs=require('fs');var path=require(_0xf158('0x6'));var rimraf=require('rimraf');var config=require(_0xf158('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xf158('0x8')]=function(_0xb84ee0,_0x178e85){return _0xb84ee0[_0xf158('0x9')](_0xf158('0xa'),attributes,{'tableName':_0xf158('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6075=['path','rimraf','../../config/environment','exports','analytics_metrics','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x6075,0x191));var _0x5607=function(_0x28fc5b,_0x50a44c){_0x28fc5b=_0x28fc5b-0x0;var _0x1894c6=_0x6075[_0x28fc5b];return _0x1894c6;};'use strict';var _=require('lodash');var util=require(_0x5607('0x0'));var logger=require(_0x5607('0x1'))(_0x5607('0x2'));var moment=require(_0x5607('0x3'));var BPromise=require(_0x5607('0x4'));var rp=require(_0x5607('0x5'));var fs=require('fs');var path=require(_0x5607('0x6'));var rimraf=require(_0x5607('0x7'));var config=require(_0x5607('0x8'));var attributes=require('./analyticMetric.attributes');module[_0x5607('0x9')]=function(_0xabf691,_0x14b9f4){return _0xabf691['define']('AnalyticMetric',attributes,{'tableName':_0x5607('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 5648fdc..4ee22c6 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 _0x8a99=['AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then'];(function(_0x9e0cb3,_0x9cd497){var _0x5926b7=function(_0x30e82d){while(--_0x30e82d){_0x9e0cb3['push'](_0x9e0cb3['shift']());}};_0x5926b7(++_0x9cd497);}(_0x8a99,0x1d8));var _0x98a9=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x8a99[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x98a9('0x0'));var util=require(_0x98a9('0x1'));var moment=require(_0x98a9('0x2'));var BPromise=require(_0x98a9('0x3'));var rs=require(_0x98a9('0x4'));var fs=require('fs');var Redis=require(_0x98a9('0x5'));var db=require(_0x98a9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x98a9('0x7'))('rpc');var config=require(_0x98a9('0x8'));var jayson=require(_0x98a9('0x9'));var client=jayson['client'][_0x98a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x110e08,_0x2beb61,_0x4871f1){return new BPromise(function(_0x4dc2be,_0x5e2119){return client['request'](_0x110e08,_0x4871f1)[_0x98a9('0xb')](function(_0x321e8f){logger['info'](_0x98a9('0xc'),_0x2beb61,_0x98a9('0xd'));logger[_0x98a9('0xe')](_0x98a9('0xf'),_0x2beb61,_0x98a9('0xd'),JSON[_0x98a9('0x10')](_0x321e8f));if(_0x321e8f[_0x98a9('0x11')]){if(_0x321e8f[_0x98a9('0x11')]['code']===0x1f4){logger[_0x98a9('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x2beb61,_0x321e8f[_0x98a9('0x11')][_0x98a9('0x12')]);return _0x5e2119(_0x321e8f[_0x98a9('0x11')][_0x98a9('0x12')]);}logger[_0x98a9('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x2beb61,_0x321e8f['error'][_0x98a9('0x12')]);return _0x4dc2be(_0x321e8f[_0x98a9('0x11')][_0x98a9('0x12')]);}else{logger[_0x98a9('0x13')](_0x98a9('0xc'),_0x2beb61,_0x98a9('0xd'));_0x4dc2be(_0x321e8f[_0x98a9('0x14')][_0x98a9('0x12')]);}})[_0x98a9('0x15')](function(_0x5616d4){logger[_0x98a9('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x2beb61,_0x5616d4);_0x5e2119(_0x5616d4);});});} \ No newline at end of file +var _0x3cee=['AnalyticMetric,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x3e1305,_0x4f0c6d){var _0x478ad7=function(_0x316365){while(--_0x316365){_0x3e1305['push'](_0x3e1305['shift']());}};_0x478ad7(++_0x4f0c6d);}(_0x3cee,0x1e8));var _0xe3ce=function(_0x5d7902,_0x322d12){_0x5d7902=_0x5d7902-0x0;var _0x261cda=_0x3cee[_0x5d7902];return _0x261cda;};'use strict';var _=require(_0xe3ce('0x0'));var util=require(_0xe3ce('0x1'));var moment=require(_0xe3ce('0x2'));var BPromise=require('bluebird');var rs=require(_0xe3ce('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe3ce('0x4'));var logger=require(_0xe3ce('0x5'))('rpc');var config=require(_0xe3ce('0x6'));var jayson=require(_0xe3ce('0x7'));var client=jayson['client'][_0xe3ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29e429,_0x490663,_0x239342){return new BPromise(function(_0x4c2e7d,_0x358078){return client[_0xe3ce('0x9')](_0x29e429,_0x239342)[_0xe3ce('0xa')](function(_0x3be359){logger[_0xe3ce('0xb')](_0xe3ce('0xc'),_0x490663,'request\x20sent');logger[_0xe3ce('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x490663,_0xe3ce('0xe'),JSON[_0xe3ce('0xf')](_0x3be359));if(_0x3be359[_0xe3ce('0x10')]){if(_0x3be359['error']['code']===0x1f4){logger[_0xe3ce('0x10')](_0xe3ce('0xc'),_0x490663,_0x3be359[_0xe3ce('0x10')][_0xe3ce('0x11')]);return _0x358078(_0x3be359[_0xe3ce('0x10')]['message']);}logger[_0xe3ce('0x10')](_0xe3ce('0xc'),_0x490663,_0x3be359[_0xe3ce('0x10')][_0xe3ce('0x11')]);return _0x4c2e7d(_0x3be359['error'][_0xe3ce('0x11')]);}else{logger['info'](_0xe3ce('0xc'),_0x490663,_0xe3ce('0xe'));_0x4c2e7d(_0x3be359[_0xe3ce('0x12')][_0xe3ce('0x11')]);}})[_0xe3ce('0x13')](function(_0x93ea58){logger[_0xe3ce('0x10')](_0xe3ce('0xc'),_0x490663,_0x93ea58);_0x358078(_0x93ea58);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 10789ca..86b0beb 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 _0x0619=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x31206e,_0x38ab39){var _0x5c171c=function(_0x82aa8e){while(--_0x82aa8e){_0x31206e['push'](_0x31206e['shift']());}};_0x5c171c(++_0x38ab39);}(_0x0619,0x90));var _0x9061=function(_0x17bfb2,_0x3cbd05){_0x17bfb2=_0x17bfb2-0x0;var _0x3829d3=_0x0619[_0x17bfb2];return _0x3829d3;};'use strict';var multer=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var path=require(_0x9061('0x2'));var timeout=require(_0x9061('0x3'));var express=require('express');var router=express[_0x9061('0x4')]();var fs_extra=require(_0x9061('0x5'));var auth=require(_0x9061('0x6'));var interaction=require(_0x9061('0x7'));var config=require(_0x9061('0x8'));var controller=require(_0x9061('0x9'));router[_0x9061('0xa')]('/',auth[_0x9061('0xb')](),controller[_0x9061('0xc')]);router[_0x9061('0xa')](_0x9061('0xd'),auth['isAuthenticated'](),controller[_0x9061('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9061('0xf')]);router[_0x9061('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x9061('0x11')]);router[_0x9061('0x12')](_0x9061('0xd'),auth[_0x9061('0xb')](),controller[_0x9061('0x13')]);module[_0x9061('0x14')]=router; \ No newline at end of file +var _0xbbbd=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xbbbd,0x86));var _0xdbbb=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xbbbd[_0x2f45ea];return _0x485a84;};'use strict';var multer=require(_0xdbbb('0x0'));var util=require(_0xdbbb('0x1'));var path=require(_0xdbbb('0x2'));var timeout=require(_0xdbbb('0x3'));var express=require(_0xdbbb('0x4'));var router=express[_0xdbbb('0x5')]();var fs_extra=require(_0xdbbb('0x6'));var auth=require(_0xdbbb('0x7'));var interaction=require(_0xdbbb('0x8'));var config=require(_0xdbbb('0x9'));var controller=require(_0xdbbb('0xa'));router[_0xdbbb('0xb')]('/',auth['isAuthenticated'](),controller[_0xdbbb('0xc')]);router[_0xdbbb('0xb')](_0xdbbb('0xd'),auth[_0xdbbb('0xe')](),controller[_0xdbbb('0xf')]);router[_0xdbbb('0x10')]('/',auth[_0xdbbb('0xe')](),controller[_0xdbbb('0x11')]);router[_0xdbbb('0x12')](_0xdbbb('0xd'),auth['isAuthenticated'](),controller[_0xdbbb('0x13')]);router['delete'](_0xdbbb('0xd'),auth['isAuthenticated'](),controller[_0xdbbb('0x14')]);module[_0xdbbb('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 7305b71..cf49db9 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 _0x45ec=['exports','TEXT','sequelize'];(function(_0x59605c,_0x3efc27){var _0x40fb19=function(_0x2832d5){while(--_0x2832d5){_0x59605c['push'](_0x59605c['shift']());}};_0x40fb19(++_0x3efc27);}(_0x45ec,0x191));var _0xc45e=function(_0x59b498,_0x4c2a1e){_0x59b498=_0x59b498-0x0;var _0x391e6c=_0x45ec[_0x59b498];return _0x391e6c;};'use strict';var Sequelize=require(_0xc45e('0x0'));module[_0xc45e('0x1')]={'tree':{'type':Sequelize[_0xc45e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x7fcd=['TEXT','sequelize'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x7fcd,0x1cf));var _0xd7fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7fcd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7fc('0x0'));module['exports']={'tree':{'type':Sequelize[_0xd7fc('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 69654ba..a5253b6 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 _0xf924=['key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','VIRTUAL','options','AnalyticTreeReport','includeAll','include','findAll','catch','show','params','merge','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','type'];(function(_0x5cdbf5,_0x347499){var _0xe585e=function(_0x4bd265){while(--_0x4bd265){_0x5cdbf5['push'](_0x5cdbf5['shift']());}};_0xe585e(++_0x347499);}(_0xf924,0xa9));var _0x4f92=function(_0x3b0999,_0x3c9835){_0x3b0999=_0x3b0999-0x0;var _0x585226=_0xf924[_0x3b0999];return _0x585226;};'use strict';var emlformat=require(_0x4f92('0x0'));var rimraf=require(_0x4f92('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f92('0x2'));var rp=require('request-promise');var moment=require(_0x4f92('0x3'));var BPromise=require(_0x4f92('0x4'));var Mustache=require('mustache');var util=require(_0x4f92('0x5'));var path=require(_0x4f92('0x6'));var sox=require('sox');var csv=require(_0x4f92('0x7'));var ejs=require(_0x4f92('0x8'));var fs=require('fs');var fs_extra=require(_0x4f92('0x9'));var _=require(_0x4f92('0xa'));var squel=require(_0x4f92('0xb'));var crypto=require('crypto');var jsforce=require(_0x4f92('0xc'));var deskjs=require(_0x4f92('0xd'));var toCsv=require(_0x4f92('0x7'));var querystring=require(_0x4f92('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4f92('0xf'));var hardwareService=require(_0x4f92('0x10'));var logger=require('../../config/logger')(_0x4f92('0x11'));var utils=require(_0x4f92('0x12'));var config=require(_0x4f92('0x13'));var licenseUtil=require(_0x4f92('0x14'));var db=require(_0x4f92('0x15'))['db'];function respondWithStatusCode(_0x8b6b02,_0x1c90b3){_0x1c90b3=_0x1c90b3||0xcc;return function(_0x4a5a6c){if(_0x4a5a6c){return _0x8b6b02['sendStatus'](_0x1c90b3);}return _0x8b6b02[_0x4f92('0x16')](_0x1c90b3)[_0x4f92('0x17')]();};}function respondWithResult(_0x57ed89,_0x4138bb){_0x4138bb=_0x4138bb||0xc8;return function(_0x5f0139){if(_0x5f0139){return _0x57ed89[_0x4f92('0x16')](_0x4138bb)[_0x4f92('0x18')](_0x5f0139);}};}function respondWithFilteredResult(_0x414304,_0x1fa7fa){return function(_0x249328){if(_0x249328){var _0x2f5309=typeof _0x1fa7fa['offset']==='undefined'&&typeof _0x1fa7fa['limit']==='undefined';var _0x127c72=_0x249328[_0x4f92('0x19')];var _0xa7e608=_0x2f5309?0x0:_0x1fa7fa[_0x4f92('0x1a')];var _0x74fb45=_0x2f5309?_0x249328[_0x4f92('0x19')]:_0x1fa7fa[_0x4f92('0x1a')]+_0x1fa7fa[_0x4f92('0x1b')];var _0x101174;if(_0x74fb45>=_0x127c72){_0x74fb45=_0x127c72;_0x101174=0xc8;}else{_0x101174=0xce;}_0x414304[_0x4f92('0x16')](_0x101174);return _0x414304[_0x4f92('0x1c')](_0x4f92('0x1d'),_0xa7e608+'-'+_0x74fb45+'/'+_0x127c72)[_0x4f92('0x18')](_0x249328);}return null;};}function patchUpdates(_0x495693){return function(_0x4ebf9c){try{jsonpatch[_0x4f92('0x1e')](_0x4ebf9c,_0x495693,!![]);}catch(_0x27c5e7){return BPromise[_0x4f92('0x1f')](_0x27c5e7);}return _0x4ebf9c[_0x4f92('0x20')]();};}function saveUpdates(_0x458b0e,_0x4de228){return function(_0x1f3a35){if(_0x1f3a35){return _0x1f3a35[_0x4f92('0x21')](_0x458b0e)[_0x4f92('0x22')](function(_0x4a4864){return _0x4a4864;});}return null;};}function removeEntity(_0x23c357,_0x504b20){return function(_0x792235){if(_0x792235){return _0x792235[_0x4f92('0x23')]()[_0x4f92('0x22')](function(){_0x23c357[_0x4f92('0x16')](0xcc)[_0x4f92('0x17')]();});}};}function handleEntityNotFound(_0x209946,_0x2e4838){return function(_0x1002c4){if(!_0x1002c4){_0x209946[_0x4f92('0x24')](0x194);}return _0x1002c4;};}function handleError(_0x19e1a9,_0x3eca38){_0x3eca38=_0x3eca38||0x1f4;return function(_0x50f51c){logger[_0x4f92('0x25')](_0x50f51c[_0x4f92('0x26')]);if(_0x50f51c[_0x4f92('0x27')]){delete _0x50f51c[_0x4f92('0x27')];}_0x19e1a9['status'](_0x3eca38)[_0x4f92('0x28')](_0x50f51c);};}exports['index']=function(_0x5db022,_0x4437a7){var _0x280fa8={},_0x1cd192={},_0x1f35fc={'count':0x0,'rows':[]};var _0x4b9b5c=_[_0x4f92('0x29')](db['AnalyticTreeReport'][_0x4f92('0x2a')],function(_0x851b7b){return{'name':_0x851b7b['fieldName'],'type':_0x851b7b[_0x4f92('0x2b')][_0x4f92('0x2c')]};});_0x1cd192[_0x4f92('0x2d')]=_['map'](_0x4b9b5c,'name');_0x1cd192['query']=_[_0x4f92('0x2e')](_0x5db022[_0x4f92('0x2f')]);_0x1cd192[_0x4f92('0x30')]=_[_0x4f92('0x31')](_0x1cd192[_0x4f92('0x2d')],_0x1cd192['query']);_0x280fa8[_0x4f92('0x32')]=_['intersection'](_0x1cd192[_0x4f92('0x2d')],qs[_0x4f92('0x33')](_0x5db022[_0x4f92('0x2f')]['fields']));_0x280fa8[_0x4f92('0x32')]=_0x280fa8[_0x4f92('0x32')][_0x4f92('0x34')]?_0x280fa8[_0x4f92('0x32')]:_0x1cd192['model'];if(!_0x5db022[_0x4f92('0x2f')]['hasOwnProperty'](_0x4f92('0x35'))){_0x280fa8['limit']=qs['limit'](_0x5db022[_0x4f92('0x2f')][_0x4f92('0x1b')]);_0x280fa8[_0x4f92('0x1a')]=qs['offset'](_0x5db022['query'][_0x4f92('0x1a')]);}_0x280fa8[_0x4f92('0x36')]=qs['sort'](_0x5db022['query']['sort']);_0x280fa8['where']=qs[_0x4f92('0x30')](_[_0x4f92('0x37')](_0x5db022[_0x4f92('0x2f')],_0x1cd192[_0x4f92('0x30')]),_0x4b9b5c);if(_0x5db022[_0x4f92('0x2f')][_0x4f92('0x38')]){_0x280fa8[_0x4f92('0x39')]=_['merge'](_0x280fa8['where'],{'$or':_[_0x4f92('0x29')](_0x4b9b5c,function(_0x32adbd){if(_0x32adbd[_0x4f92('0x2b')]!==_0x4f92('0x3a')){var _0x562c0d={};_0x562c0d[_0x32adbd[_0x4f92('0x27')]]={'$like':'%'+_0x5db022['query'][_0x4f92('0x38')]+'%'};return _0x562c0d;}})});}_0x280fa8=_['merge']({},_0x280fa8,_0x5db022[_0x4f92('0x3b')]);var _0x3658cd={'where':_0x280fa8[_0x4f92('0x39')]};return db[_0x4f92('0x3c')][_0x4f92('0x19')](_0x3658cd)[_0x4f92('0x22')](function(_0x5bde0e){_0x1f35fc[_0x4f92('0x19')]=_0x5bde0e;if(_0x5db022[_0x4f92('0x2f')][_0x4f92('0x3d')]){_0x280fa8[_0x4f92('0x3e')]=[{'all':!![]}];}return db[_0x4f92('0x3c')][_0x4f92('0x3f')](_0x280fa8);})['then'](function(_0x5f1401){_0x1f35fc['rows']=_0x5f1401;return _0x1f35fc;})[_0x4f92('0x22')](respondWithFilteredResult(_0x4437a7,_0x280fa8))[_0x4f92('0x40')](handleError(_0x4437a7,null));};exports[_0x4f92('0x41')]=function(_0x1876ba,_0x14acfa){var _0x570328={'raw':!![],'where':{'id':_0x1876ba[_0x4f92('0x42')]['id']}},_0x421964={};_0x421964[_0x4f92('0x2d')]=_[_0x4f92('0x2e')](db[_0x4f92('0x3c')]['rawAttributes']);_0x421964[_0x4f92('0x2f')]=_['keys'](_0x1876ba['query']);_0x421964[_0x4f92('0x30')]=_['intersection'](_0x421964[_0x4f92('0x2d')],_0x421964[_0x4f92('0x2f')]);_0x570328[_0x4f92('0x32')]=_[_0x4f92('0x31')](_0x421964[_0x4f92('0x2d')],qs[_0x4f92('0x33')](_0x1876ba[_0x4f92('0x2f')]['fields']));_0x570328[_0x4f92('0x32')]=_0x570328['attributes'][_0x4f92('0x34')]?_0x570328[_0x4f92('0x32')]:_0x421964[_0x4f92('0x2d')];if(_0x1876ba['query'][_0x4f92('0x3d')]){_0x570328[_0x4f92('0x3e')]=[{'all':!![]}];}_0x570328=_[_0x4f92('0x43')]({},_0x570328,_0x1876ba[_0x4f92('0x3b')]);return db[_0x4f92('0x3c')][_0x4f92('0x44')](_0x570328)[_0x4f92('0x22')](handleEntityNotFound(_0x14acfa,null))[_0x4f92('0x22')](respondWithResult(_0x14acfa,null))['catch'](handleError(_0x14acfa,null));};exports[_0x4f92('0x45')]=function(_0x3fe4cc,_0x104d7b){return db[_0x4f92('0x3c')][_0x4f92('0x45')](_0x3fe4cc['body'],{})[_0x4f92('0x22')](respondWithResult(_0x104d7b,0xc9))[_0x4f92('0x40')](handleError(_0x104d7b,null));};exports['update']=function(_0x3d2d2c,_0x639508){if(_0x3d2d2c['body']['id']){delete _0x3d2d2c[_0x4f92('0x46')]['id'];}return db[_0x4f92('0x3c')]['find']({'where':{'id':_0x3d2d2c[_0x4f92('0x42')]['id']}})[_0x4f92('0x22')](handleEntityNotFound(_0x639508,null))['then'](saveUpdates(_0x3d2d2c[_0x4f92('0x46')],null))[_0x4f92('0x22')](respondWithResult(_0x639508,null))[_0x4f92('0x40')](handleError(_0x639508,null));};exports[_0x4f92('0x23')]=function(_0x4b8c31,_0x2e883c){return db[_0x4f92('0x3c')][_0x4f92('0x44')]({'where':{'id':_0x4b8c31[_0x4f92('0x42')]['id']}})[_0x4f92('0x22')](handleEntityNotFound(_0x2e883c,null))[_0x4f92('0x22')](removeEntity(_0x2e883c,null))[_0x4f92('0x40')](handleError(_0x2e883c,null));}; \ No newline at end of file +var _0xba43=['body','eml-format','rimraf','zip-dir','request-promise','util','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','find','create'];(function(_0x4bd59b,_0x33dd08){var _0x40382b=function(_0x303c65){while(--_0x303c65){_0x4bd59b['push'](_0x4bd59b['shift']());}};_0x40382b(++_0x33dd08);}(_0xba43,0x91));var _0x3ba4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xba43[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0x3ba4('0x0'));var rimraf=require(_0x3ba4('0x1'));var zipdir=require(_0x3ba4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3ba4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3ba4('0x4'));var path=require('path');var sox=require(_0x3ba4('0x5'));var csv=require('to-csv');var ejs=require(_0x3ba4('0x6'));var fs=require('fs');var fs_extra=require(_0x3ba4('0x7'));var _=require(_0x3ba4('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3ba4('0x9'));var deskjs=require(_0x3ba4('0xa'));var toCsv=require(_0x3ba4('0xb'));var querystring=require('querystring');var Papa=require(_0x3ba4('0xc'));var Redis=require(_0x3ba4('0xd'));var authService=require(_0x3ba4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x3ba4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3ba4('0x10'))(_0x3ba4('0x11'));var utils=require(_0x3ba4('0x12'));var config=require(_0x3ba4('0x13'));var licenseUtil=require(_0x3ba4('0x14'));var db=require(_0x3ba4('0x15'))['db'];function respondWithStatusCode(_0x4b02be,_0x1b9a46){_0x1b9a46=_0x1b9a46||0xcc;return function(_0x5b6351){if(_0x5b6351){return _0x4b02be[_0x3ba4('0x16')](_0x1b9a46);}return _0x4b02be[_0x3ba4('0x17')](_0x1b9a46)[_0x3ba4('0x18')]();};}function respondWithResult(_0x352ea0,_0x5d5f85){_0x5d5f85=_0x5d5f85||0xc8;return function(_0x46958f){if(_0x46958f){return _0x352ea0[_0x3ba4('0x17')](_0x5d5f85)[_0x3ba4('0x19')](_0x46958f);}};}function respondWithFilteredResult(_0x1fba1c,_0x2eb98a){return function(_0x537367){if(_0x537367){var _0x5bec86=typeof _0x2eb98a['offset']===_0x3ba4('0x1a')&&typeof _0x2eb98a[_0x3ba4('0x1b')]===_0x3ba4('0x1a');var _0x495be2=_0x537367[_0x3ba4('0x1c')];var _0x58bcdc=_0x5bec86?0x0:_0x2eb98a[_0x3ba4('0x1d')];var _0x3187bb=_0x5bec86?_0x537367[_0x3ba4('0x1c')]:_0x2eb98a['offset']+_0x2eb98a[_0x3ba4('0x1b')];var _0x359496;if(_0x3187bb>=_0x495be2){_0x3187bb=_0x495be2;_0x359496=0xc8;}else{_0x359496=0xce;}_0x1fba1c[_0x3ba4('0x17')](_0x359496);return _0x1fba1c[_0x3ba4('0x1e')](_0x3ba4('0x1f'),_0x58bcdc+'-'+_0x3187bb+'/'+_0x495be2)[_0x3ba4('0x19')](_0x537367);}return null;};}function patchUpdates(_0x521975){return function(_0x355aba){try{jsonpatch['apply'](_0x355aba,_0x521975,!![]);}catch(_0xdd1270){return BPromise[_0x3ba4('0x20')](_0xdd1270);}return _0x355aba[_0x3ba4('0x21')]();};}function saveUpdates(_0x4e7bbf,_0x36bf75){return function(_0x44c6e0){if(_0x44c6e0){return _0x44c6e0[_0x3ba4('0x22')](_0x4e7bbf)[_0x3ba4('0x23')](function(_0x3bb4f0){return _0x3bb4f0;});}return null;};}function removeEntity(_0x117480,_0x2c07a8){return function(_0x59cd85){if(_0x59cd85){return _0x59cd85[_0x3ba4('0x24')]()[_0x3ba4('0x23')](function(){_0x117480[_0x3ba4('0x17')](0xcc)[_0x3ba4('0x18')]();});}};}function handleEntityNotFound(_0x428388,_0x291ed2){return function(_0x208887){if(!_0x208887){_0x428388[_0x3ba4('0x16')](0x194);}return _0x208887;};}function handleError(_0x454f05,_0xd84db6){_0xd84db6=_0xd84db6||0x1f4;return function(_0x5c2a15){logger[_0x3ba4('0x25')](_0x5c2a15['stack']);if(_0x5c2a15[_0x3ba4('0x26')]){delete _0x5c2a15['name'];}_0x454f05[_0x3ba4('0x17')](_0xd84db6)[_0x3ba4('0x27')](_0x5c2a15);};}exports[_0x3ba4('0x28')]=function(_0xee5db6,_0x34fdff){var _0x4dbefa={},_0x16c5af={},_0x5033d8={'count':0x0,'rows':[]};var _0x1ed403=_[_0x3ba4('0x29')](db[_0x3ba4('0x2a')][_0x3ba4('0x2b')],function(_0x48c37f){return{'name':_0x48c37f[_0x3ba4('0x2c')],'type':_0x48c37f[_0x3ba4('0x2d')][_0x3ba4('0x2e')]};});_0x16c5af[_0x3ba4('0x2f')]=_[_0x3ba4('0x29')](_0x1ed403,'name');_0x16c5af['query']=_[_0x3ba4('0x30')](_0xee5db6[_0x3ba4('0x31')]);_0x16c5af[_0x3ba4('0x32')]=_[_0x3ba4('0x33')](_0x16c5af['model'],_0x16c5af[_0x3ba4('0x31')]);_0x4dbefa['attributes']=_[_0x3ba4('0x33')](_0x16c5af['model'],qs['fields'](_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x34')]));_0x4dbefa[_0x3ba4('0x35')]=_0x4dbefa[_0x3ba4('0x35')][_0x3ba4('0x36')]?_0x4dbefa[_0x3ba4('0x35')]:_0x16c5af[_0x3ba4('0x2f')];if(!_0xee5db6['query'][_0x3ba4('0x37')]('nolimit')){_0x4dbefa[_0x3ba4('0x1b')]=qs[_0x3ba4('0x1b')](_0xee5db6[_0x3ba4('0x31')]['limit']);_0x4dbefa[_0x3ba4('0x1d')]=qs[_0x3ba4('0x1d')](_0xee5db6[_0x3ba4('0x31')]['offset']);}_0x4dbefa[_0x3ba4('0x38')]=qs[_0x3ba4('0x39')](_0xee5db6[_0x3ba4('0x31')]['sort']);_0x4dbefa[_0x3ba4('0x3a')]=qs[_0x3ba4('0x32')](_[_0x3ba4('0x3b')](_0xee5db6[_0x3ba4('0x31')],_0x16c5af['filters']),_0x1ed403);if(_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x3c')]){_0x4dbefa['where']=_[_0x3ba4('0x3d')](_0x4dbefa['where'],{'$or':_['map'](_0x1ed403,function(_0x34bbfa){if(_0x34bbfa[_0x3ba4('0x2d')]!==_0x3ba4('0x3e')){var _0x1e01c3={};_0x1e01c3[_0x34bbfa[_0x3ba4('0x26')]]={'$like':'%'+_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x3c')]+'%'};return _0x1e01c3;}})});}_0x4dbefa=_['merge']({},_0x4dbefa,_0xee5db6[_0x3ba4('0x3f')]);var _0x1d783f={'where':_0x4dbefa[_0x3ba4('0x3a')]};return db[_0x3ba4('0x2a')]['count'](_0x1d783f)[_0x3ba4('0x23')](function(_0x26a5b7){_0x5033d8['count']=_0x26a5b7;if(_0xee5db6[_0x3ba4('0x31')][_0x3ba4('0x40')]){_0x4dbefa['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3ba4('0x41')](_0x4dbefa);})['then'](function(_0x1468e8){_0x5033d8['rows']=_0x1468e8;return _0x5033d8;})[_0x3ba4('0x23')](respondWithFilteredResult(_0x34fdff,_0x4dbefa))[_0x3ba4('0x42')](handleError(_0x34fdff,null));};exports[_0x3ba4('0x43')]=function(_0x35eb51,_0x24466e){var _0x468cee={'raw':!![],'where':{'id':_0x35eb51[_0x3ba4('0x44')]['id']}},_0x315bfa={};_0x315bfa[_0x3ba4('0x2f')]=_[_0x3ba4('0x30')](db[_0x3ba4('0x2a')][_0x3ba4('0x2b')]);_0x315bfa[_0x3ba4('0x31')]=_[_0x3ba4('0x30')](_0x35eb51[_0x3ba4('0x31')]);_0x315bfa[_0x3ba4('0x32')]=_['intersection'](_0x315bfa[_0x3ba4('0x2f')],_0x315bfa[_0x3ba4('0x31')]);_0x468cee['attributes']=_[_0x3ba4('0x33')](_0x315bfa[_0x3ba4('0x2f')],qs[_0x3ba4('0x34')](_0x35eb51[_0x3ba4('0x31')][_0x3ba4('0x34')]));_0x468cee[_0x3ba4('0x35')]=_0x468cee[_0x3ba4('0x35')]['length']?_0x468cee['attributes']:_0x315bfa[_0x3ba4('0x2f')];if(_0x35eb51[_0x3ba4('0x31')][_0x3ba4('0x40')]){_0x468cee['include']=[{'all':!![]}];}_0x468cee=_[_0x3ba4('0x3d')]({},_0x468cee,_0x35eb51[_0x3ba4('0x3f')]);return db[_0x3ba4('0x2a')][_0x3ba4('0x45')](_0x468cee)[_0x3ba4('0x23')](handleEntityNotFound(_0x24466e,null))[_0x3ba4('0x23')](respondWithResult(_0x24466e,null))[_0x3ba4('0x42')](handleError(_0x24466e,null));};exports[_0x3ba4('0x46')]=function(_0x4323f0,_0x39fe2f){return db[_0x3ba4('0x2a')][_0x3ba4('0x46')](_0x4323f0[_0x3ba4('0x47')],{})['then'](respondWithResult(_0x39fe2f,0xc9))[_0x3ba4('0x42')](handleError(_0x39fe2f,null));};exports[_0x3ba4('0x22')]=function(_0xafef8e,_0x54443c){if(_0xafef8e['body']['id']){delete _0xafef8e[_0x3ba4('0x47')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0xafef8e[_0x3ba4('0x44')]['id']}})[_0x3ba4('0x23')](handleEntityNotFound(_0x54443c,null))[_0x3ba4('0x23')](saveUpdates(_0xafef8e[_0x3ba4('0x47')],null))[_0x3ba4('0x23')](respondWithResult(_0x54443c,null))[_0x3ba4('0x42')](handleError(_0x54443c,null));};exports['destroy']=function(_0x2b9c4e,_0x431389){return db[_0x3ba4('0x2a')][_0x3ba4('0x45')]({'where':{'id':_0x2b9c4e[_0x3ba4('0x44')]['id']}})[_0x3ba4('0x23')](handleEntityNotFound(_0x431389,null))['then'](removeEntity(_0x431389,null))[_0x3ba4('0x42')](handleError(_0x431389,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index dedfa5a..88f1e48 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 _0x88a2=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes'];(function(_0xda312b,_0x21427b){var _0x3b5434=function(_0x1bc9be){while(--_0x1bc9be){_0xda312b['push'](_0xda312b['shift']());}};_0x3b5434(++_0x21427b);}(_0x88a2,0x64));var _0x288a=function(_0x531664,_0x723a7b){_0x531664=_0x531664-0x0;var _0x118f52=_0x88a2[_0x531664];return _0x118f52;};'use strict';var _=require(_0x288a('0x0'));var util=require(_0x288a('0x1'));var logger=require(_0x288a('0x2'))(_0x288a('0x3'));var moment=require(_0x288a('0x4'));var BPromise=require(_0x288a('0x5'));var rp=require(_0x288a('0x6'));var fs=require('fs');var path=require(_0x288a('0x7'));var rimraf=require(_0x288a('0x8'));var config=require('../../config/environment');var attributes=require(_0x288a('0x9'));module['exports']=function(_0x49e5a7,_0x3d4897){return _0x49e5a7[_0x288a('0xa')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1fd=['util','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xd1fd,0xe3));var _0xdd1f=function(_0x470bfb,_0x389787){_0x470bfb=_0x470bfb-0x0;var _0x2f5d97=_0xd1fd[_0x470bfb];return _0x2f5d97;};'use strict';var _=require(_0xdd1f('0x0'));var util=require(_0xdd1f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdd1f('0x2'));var BPromise=require(_0xdd1f('0x3'));var rp=require(_0xdd1f('0x4'));var fs=require('fs');var path=require(_0xdd1f('0x5'));var rimraf=require(_0xdd1f('0x6'));var config=require('../../config/environment');var attributes=require(_0xdd1f('0x7'));module[_0xdd1f('0x8')]=function(_0x4059ae,_0x40a35a){return _0x4059ae[_0xdd1f('0x9')](_0xdd1f('0xa'),attributes,{'tableName':_0xdd1f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 8f3935d..ac89f8e 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 _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x268436,_0x174f08){_0x268436=_0x268436-0x0;var _0x25327f=_0x7a54[_0x268436];return _0x25327f;};'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')]('AnalyticTreeReport,\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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\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(_0x2fdd6a,_0x512f37){var _0x33945f=function(_0x554881){while(--_0x554881){_0x2fdd6a['push'](_0x2fdd6a['shift']());}};_0x33945f(++_0x512f37);}(_0x1261,0x144));var _0x1126=function(_0x5fa520,_0xaf0e7d){_0x5fa520=_0x5fa520-0x0;var _0x1bf6c4=_0x1261[_0x5fa520];return _0x1bf6c4;};'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')]('AnalyticTreeReport,\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/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 8868901..0dcbe92 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 _0xc59d=['fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','update','destroy','exports','util','path','connect-timeout','Router'];(function(_0x5c07bb,_0x34ef41){var _0x3965c8=function(_0x189f3a){while(--_0x189f3a){_0x5c07bb['push'](_0x5c07bb['shift']());}};_0x3965c8(++_0x34ef41);}(_0xc59d,0x1c7));var _0xdc59=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc59d[_0x3947c9];return _0x2e7871;};'use strict';var multer=require('multer');var util=require(_0xdc59('0x0'));var path=require(_0xdc59('0x1'));var timeout=require(_0xdc59('0x2'));var express=require('express');var router=express[_0xdc59('0x3')]();var fs_extra=require(_0xdc59('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdc59('0x5'));var config=require(_0xdc59('0x6'));var controller=require(_0xdc59('0x7'));router[_0xdc59('0x8')]('/',auth[_0xdc59('0x9')](),controller['index']);router[_0xdc59('0x8')](_0xdc59('0xa'),auth['isAuthenticated'](),controller[_0xdc59('0xb')]);router[_0xdc59('0xc')]('/',auth[_0xdc59('0x9')](),controller[_0xdc59('0xd')]);router['put'](_0xdc59('0xa'),auth[_0xdc59('0x9')](),controller[_0xdc59('0xe')]);router['delete'](_0xdc59('0xa'),auth[_0xdc59('0x9')](),controller[_0xdc59('0xf')]);module[_0xdc59('0x10')]=router; \ No newline at end of file +var _0xd979=['show','create','update','delete','/:id','destroy','exports','util','path','connect-timeout','fs-extra','../../config/environment','./analyticTreeReport.controller','index','get','isAuthenticated'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0xd979,0x1c7));var _0x9d97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd979[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x9d97('0x0'));var path=require(_0x9d97('0x1'));var timeout=require(_0x9d97('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x9d97('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9d97('0x4'));var controller=require(_0x9d97('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x9d97('0x6')]);router[_0x9d97('0x7')]('/:id',auth[_0x9d97('0x8')](),controller[_0x9d97('0x9')]);router['post']('/',auth[_0x9d97('0x8')](),controller[_0x9d97('0xa')]);router['put']('/:id',auth[_0x9d97('0x8')](),controller[_0x9d97('0xb')]);router[_0x9d97('0xc')](_0x9d97('0xd'),auth[_0x9d97('0x8')](),controller[_0x9d97('0xe')]);module[_0x9d97('0xf')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index dcb4355..2f2b642 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 _0x39a9=['exports','STRING','sequelize'];(function(_0x371eb8,_0x11409b){var _0x224438=function(_0x2c6fc){while(--_0x2c6fc){_0x371eb8['push'](_0x371eb8['shift']());}};_0x224438(++_0x11409b);}(_0x39a9,0x1d0));var _0x939a=function(_0x3a2a3c,_0x37bd31){_0x3a2a3c=_0x3a2a3c-0x0;var _0x50ac9a=_0x39a9[_0x3a2a3c];return _0x50ac9a;};'use strict';var Sequelize=require(_0x939a('0x0'));module[_0x939a('0x1')]={'name':{'type':Sequelize[_0x939a('0x2')]},'basename':{'type':Sequelize[_0x939a('0x2')]},'type':{'type':Sequelize[_0x939a('0x2')]}}; \ No newline at end of file +var _0xcb18=['STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcb18,0x159));var _0x8cb1=function(_0x53cdd2,_0x22f364){_0x53cdd2=_0x53cdd2-0x0;var _0x2420ea=_0xcb18[_0x53cdd2];return _0x2420ea;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8cb1('0x0')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8cb1('0x0')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 48e830f..6955189 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 _0xe654=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','model','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','Attachment','findAll','catch','show','params','keys','intersection','options','find','clone','get','omit','createdAt','updatedAt','body','create','file','filename','download','ChatOfflineMessageId','join','root','offline-chat/','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x54ff7d,_0x27c0a6){var _0x3dfeac=function(_0x473272){while(--_0x473272){_0x54ff7d['push'](_0x54ff7d['shift']());}};_0x3dfeac(++_0x27c0a6);}(_0xe654,0x9d));var _0x4e65=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe654[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x4e65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e65('0x1'));var jsonpatch=require(_0x4e65('0x2'));var rp=require(_0x4e65('0x3'));var moment=require(_0x4e65('0x4'));var BPromise=require(_0x4e65('0x5'));var Mustache=require('mustache');var util=require(_0x4e65('0x6'));var path=require(_0x4e65('0x7'));var sox=require('sox');var csv=require(_0x4e65('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e65('0x9'));var _=require(_0x4e65('0xa'));var squel=require(_0x4e65('0xb'));var crypto=require(_0x4e65('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4e65('0x8'));var querystring=require(_0x4e65('0xd'));var Papa=require('papaparse');var Redis=require(_0x4e65('0xe'));var authService=require(_0x4e65('0xf'));var qs=require(_0x4e65('0x10'));var as=require(_0x4e65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e65('0x12'))(_0x4e65('0x13'));var utils=require(_0x4e65('0x14'));var config=require(_0x4e65('0x15'));var licenseUtil=require(_0x4e65('0x16'));var db=require(_0x4e65('0x17'))['db'];function respondWithStatusCode(_0x1b7ac8,_0x10181d){_0x10181d=_0x10181d||0xcc;return function(_0x33c3b4){if(_0x33c3b4){return _0x1b7ac8[_0x4e65('0x18')](_0x10181d);}return _0x1b7ac8[_0x4e65('0x19')](_0x10181d)[_0x4e65('0x1a')]();};}function respondWithResult(_0x92bd7f,_0x1894d6){_0x1894d6=_0x1894d6||0xc8;return function(_0x1be010){if(_0x1be010){return _0x92bd7f[_0x4e65('0x19')](_0x1894d6)[_0x4e65('0x1b')](_0x1be010);}};}function respondWithFilteredResult(_0x4f98e0,_0xb0bcdd){return function(_0x4e1d0c){if(_0x4e1d0c){var _0x28e1ca=typeof _0xb0bcdd[_0x4e65('0x1c')]===_0x4e65('0x1d')&&typeof _0xb0bcdd[_0x4e65('0x1e')]==='undefined';var _0x35d51b=_0x4e1d0c['count'];var _0x3a41da=_0x28e1ca?0x0:_0xb0bcdd[_0x4e65('0x1c')];var _0x5812c4=_0x28e1ca?_0x4e1d0c[_0x4e65('0x1f')]:_0xb0bcdd[_0x4e65('0x1c')]+_0xb0bcdd['limit'];var _0x43c1c4;if(_0x5812c4>=_0x35d51b){_0x5812c4=_0x35d51b;_0x43c1c4=0xc8;}else{_0x43c1c4=0xce;}_0x4f98e0[_0x4e65('0x19')](_0x43c1c4);return _0x4f98e0[_0x4e65('0x20')]('Content-Range',_0x3a41da+'-'+_0x5812c4+'/'+_0x35d51b)[_0x4e65('0x1b')](_0x4e1d0c);}return null;};}function patchUpdates(_0x27556d){return function(_0x344671){try{jsonpatch[_0x4e65('0x21')](_0x344671,_0x27556d,!![]);}catch(_0x4eeb78){return BPromise[_0x4e65('0x22')](_0x4eeb78);}return _0x344671[_0x4e65('0x23')]();};}function saveUpdates(_0x402cc8,_0x55fd5d){return function(_0x4654cc){if(_0x4654cc){return _0x4654cc[_0x4e65('0x24')](_0x402cc8)[_0x4e65('0x25')](function(_0x217c24){return _0x217c24;});}return null;};}function removeEntity(_0xca4999,_0x5c54f9){return function(_0x1b3b1b){if(_0x1b3b1b){return _0x1b3b1b[_0x4e65('0x26')]()[_0x4e65('0x25')](function(){_0xca4999[_0x4e65('0x19')](0xcc)[_0x4e65('0x1a')]();});}};}function handleEntityNotFound(_0x61addd,_0x39b360){return function(_0x2627b9){if(!_0x2627b9){_0x61addd[_0x4e65('0x18')](0x194);}return _0x2627b9;};}function handleError(_0x361e16,_0x1b8279){_0x1b8279=_0x1b8279||0x1f4;return function(_0x51daa4){logger[_0x4e65('0x27')](_0x51daa4[_0x4e65('0x28')]);if(_0x51daa4[_0x4e65('0x29')]){delete _0x51daa4[_0x4e65('0x29')];}_0x361e16[_0x4e65('0x19')](_0x1b8279)[_0x4e65('0x2a')](_0x51daa4);};}exports[_0x4e65('0x2b')]=function(_0x114178,_0xfc2ead){var _0x2dfa75={},_0x2ab001={},_0x4ff2de={'count':0x0,'rows':[]};var _0x5b7380=_[_0x4e65('0x2c')](db['Attachment'][_0x4e65('0x2d')],function(_0x29cc0b){return{'name':_0x29cc0b[_0x4e65('0x2e')],'type':_0x29cc0b['type'][_0x4e65('0x2f')]};});_0x2ab001['model']=_[_0x4e65('0x2c')](_0x5b7380,_0x4e65('0x29'));_0x2ab001[_0x4e65('0x30')]=_['keys'](_0x114178['query']);_0x2ab001[_0x4e65('0x31')]=_['intersection'](_0x2ab001[_0x4e65('0x32')],_0x2ab001[_0x4e65('0x30')]);_0x2dfa75[_0x4e65('0x33')]=_['intersection'](_0x2ab001[_0x4e65('0x32')],qs[_0x4e65('0x34')](_0x114178[_0x4e65('0x30')][_0x4e65('0x34')]));_0x2dfa75[_0x4e65('0x33')]=_0x2dfa75[_0x4e65('0x33')][_0x4e65('0x35')]?_0x2dfa75[_0x4e65('0x33')]:_0x2ab001[_0x4e65('0x32')];if(!_0x114178[_0x4e65('0x30')]['hasOwnProperty'](_0x4e65('0x36'))){_0x2dfa75['limit']=qs[_0x4e65('0x1e')](_0x114178[_0x4e65('0x30')][_0x4e65('0x1e')]);_0x2dfa75[_0x4e65('0x1c')]=qs[_0x4e65('0x1c')](_0x114178[_0x4e65('0x30')]['offset']);}_0x2dfa75['order']=qs[_0x4e65('0x37')](_0x114178[_0x4e65('0x30')][_0x4e65('0x37')]);_0x2dfa75[_0x4e65('0x38')]=qs[_0x4e65('0x31')](_[_0x4e65('0x39')](_0x114178[_0x4e65('0x30')],_0x2ab001[_0x4e65('0x31')]),_0x5b7380);if(_0x114178[_0x4e65('0x30')]['filter']){_0x2dfa75[_0x4e65('0x38')]=_[_0x4e65('0x3a')](_0x2dfa75[_0x4e65('0x38')],{'$or':_['map'](_0x5b7380,function(_0x19eb78){if(_0x19eb78[_0x4e65('0x3b')]!==_0x4e65('0x3c')){var _0x23591f={};_0x23591f[_0x19eb78[_0x4e65('0x29')]]={'$like':'%'+_0x114178[_0x4e65('0x30')][_0x4e65('0x3d')]+'%'};return _0x23591f;}})});}_0x2dfa75=_[_0x4e65('0x3a')]({},_0x2dfa75,_0x114178['options']);var _0x61aa8c={'where':_0x2dfa75[_0x4e65('0x38')]};return db['Attachment'][_0x4e65('0x1f')](_0x61aa8c)[_0x4e65('0x25')](function(_0x1f591a){_0x4ff2de['count']=_0x1f591a;if(_0x114178['query'][_0x4e65('0x3e')]){_0x2dfa75[_0x4e65('0x3f')]=[{'all':!![]}];}return db[_0x4e65('0x40')][_0x4e65('0x41')](_0x2dfa75);})[_0x4e65('0x25')](function(_0x50d2fd){_0x4ff2de['rows']=_0x50d2fd;return _0x4ff2de;})[_0x4e65('0x25')](respondWithFilteredResult(_0xfc2ead,_0x2dfa75))[_0x4e65('0x42')](handleError(_0xfc2ead,null));};exports[_0x4e65('0x43')]=function(_0x315300,_0x714302){var _0x1934e5={'raw':!![],'where':{'id':_0x315300[_0x4e65('0x44')]['id']}},_0x2550ee={};_0x2550ee[_0x4e65('0x32')]=_[_0x4e65('0x45')](db[_0x4e65('0x40')]['rawAttributes']);_0x2550ee[_0x4e65('0x30')]=_[_0x4e65('0x45')](_0x315300['query']);_0x2550ee['filters']=_[_0x4e65('0x46')](_0x2550ee['model'],_0x2550ee['query']);_0x1934e5[_0x4e65('0x33')]=_[_0x4e65('0x46')](_0x2550ee[_0x4e65('0x32')],qs[_0x4e65('0x34')](_0x315300['query']['fields']));_0x1934e5[_0x4e65('0x33')]=_0x1934e5['attributes'][_0x4e65('0x35')]?_0x1934e5[_0x4e65('0x33')]:_0x2550ee[_0x4e65('0x32')];if(_0x315300[_0x4e65('0x30')][_0x4e65('0x3e')]){_0x1934e5[_0x4e65('0x3f')]=[{'all':!![]}];}_0x1934e5=_[_0x4e65('0x3a')]({},_0x1934e5,_0x315300[_0x4e65('0x47')]);return db[_0x4e65('0x40')][_0x4e65('0x48')](_0x1934e5)[_0x4e65('0x25')](handleEntityNotFound(_0x714302,null))[_0x4e65('0x25')](respondWithResult(_0x714302,null))[_0x4e65('0x42')](handleError(_0x714302,null));};exports[_0x4e65('0x49')]=function(_0x48d26f,_0x1942a6){var _0x40dbe0={'where':{'id':_0x48d26f[_0x4e65('0x44')]['id']}},_0x2c7b43={};_0x2c7b43[_0x4e65('0x32')]=_['keys'](db['Attachment'][_0x4e65('0x2d')]);_0x40dbe0[_0x4e65('0x33')]=_[_0x4e65('0x46')](_0x2c7b43[_0x4e65('0x32')],qs[_0x4e65('0x34')](_0x48d26f[_0x4e65('0x30')][_0x4e65('0x34')]));_0x40dbe0[_0x4e65('0x33')]=_0x40dbe0['attributes'][_0x4e65('0x35')]?_0x40dbe0[_0x4e65('0x33')]:_0x2c7b43['model'];if(_0x48d26f[_0x4e65('0x30')][_0x4e65('0x3e')]){_0x40dbe0['include']=[{'all':!![]}];}_0x40dbe0=_[_0x4e65('0x3a')]({},_0x40dbe0,_0x48d26f[_0x4e65('0x47')]);return db[_0x4e65('0x40')][_0x4e65('0x48')](_0x40dbe0)[_0x4e65('0x25')](handleEntityNotFound(_0x1942a6,null))['then'](function(_0x56f410){if(_0x56f410){var _0x537cb5=_0x56f410[_0x4e65('0x4a')]({'plain':!![]});_0x537cb5=qs[_0x4e65('0x4b')](_0x537cb5,['id',_0x4e65('0x4c'),_0x4e65('0x4d')]);_0x48d26f[_0x4e65('0x4e')]=_[_0x4e65('0x4b')](_0x48d26f[_0x4e65('0x4e')],['id','createdAt',_0x4e65('0x4d')]);return db[_0x4e65('0x40')][_0x4e65('0x4f')](_[_0x4e65('0x3a')](_0x537cb5,_0x48d26f['body']),{'include':_0x48d26f['query']['includeAll']?[{'all':!![]}]:undefined});}})[_0x4e65('0x25')](respondWithResult(_0x1942a6,0xc9))[_0x4e65('0x42')](handleError(_0x1942a6,null));};exports['update']=function(_0x31b0f3,_0x4127f6){if(_0x31b0f3['body']['id']){delete _0x31b0f3['body']['id'];}return db[_0x4e65('0x40')][_0x4e65('0x48')]({'where':{'id':_0x31b0f3[_0x4e65('0x44')]['id']}})[_0x4e65('0x25')](handleEntityNotFound(_0x4127f6,null))[_0x4e65('0x25')](saveUpdates(_0x31b0f3[_0x4e65('0x4e')],null))[_0x4e65('0x25')](respondWithResult(_0x4127f6,null))['catch'](handleError(_0x4127f6,null));};exports[_0x4e65('0x26')]=function(_0x587fa6,_0x29f5de){return db['Attachment']['find']({'where':{'id':_0x587fa6[_0x4e65('0x44')]['id']}})['then'](handleEntityNotFound(_0x29f5de,null))[_0x4e65('0x25')](removeEntity(_0x29f5de,null))['catch'](handleError(_0x29f5de,null));};exports[_0x4e65('0x4f')]=function(_0x5da4e7,_0x132346,_0x17199a){_0x5da4e7[_0x4e65('0x4e')][_0x4e65('0x29')]=_0x5da4e7[_0x4e65('0x50')]['originalname'];_0x5da4e7['body']['basename']=_0x5da4e7[_0x4e65('0x50')][_0x4e65('0x51')];_0x5da4e7[_0x4e65('0x4e')][_0x4e65('0x3b')]=_0x5da4e7[_0x4e65('0x50')]['mimetype'];return db[_0x4e65('0x40')][_0x4e65('0x4f')](_0x5da4e7[_0x4e65('0x4e')])[_0x4e65('0x25')](respondWithResult(_0x132346,0xc9))['catch'](handleError(_0x132346,null));};exports[_0x4e65('0x52')]=function(_0x275613,_0x31e890,_0x1cb5c2){return db[_0x4e65('0x40')]['findOne']({'where':{'id':_0x275613[_0x4e65('0x44')]['id']},'raw':!![]})[_0x4e65('0x25')](handleEntityNotFound(_0x31e890,null))[_0x4e65('0x25')](function(_0x2e7f6d){if(_0x2e7f6d){var _0x5adafa=_0x2e7f6d[_0x4e65('0x53')]!==null;var _0x4258d6=path[_0x4e65('0x54')](config[_0x4e65('0x55')],'server/files/attachments/');if(_0x5adafa){_0x4258d6=path[_0x4e65('0x54')](_0x4258d6,_0x4e65('0x56'));}var _0x57809a=path['join'](_0x4258d6,_0x2e7f6d['basename']);return _0x31e890[_0x4e65('0x52')](_0x57809a);}})['catch'](handleError(_0x31e890,null));}; \ No newline at end of file +var _0x2112=['undefined','count','offset','set','Content-Range','reject','then','end','error','stack','name','send','map','Attachment','rawAttributes','key','model','keys','intersection','attributes','fields','query','length','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','includeAll','find','catch','clone','params','get','createdAt','updatedAt','body','omit','create','update','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit'];(function(_0x48e798,_0x351684){var _0x1bbc7d=function(_0x24d583){while(--_0x24d583){_0x48e798['push'](_0x48e798['shift']());}};_0x1bbc7d(++_0x351684);}(_0x2112,0x149));var _0x2211=function(_0x40ca61,_0x8ccae6){_0x40ca61=_0x40ca61-0x0;var _0x485cd4=_0x2112[_0x40ca61];return _0x485cd4;};'use strict';var emlformat=require(_0x2211('0x0'));var rimraf=require(_0x2211('0x1'));var zipdir=require(_0x2211('0x2'));var jsonpatch=require(_0x2211('0x3'));var rp=require(_0x2211('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2211('0x5'));var path=require(_0x2211('0x6'));var sox=require(_0x2211('0x7'));var csv=require(_0x2211('0x8'));var ejs=require(_0x2211('0x9'));var fs=require('fs');var fs_extra=require(_0x2211('0xa'));var _=require(_0x2211('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x2211('0xc'));var deskjs=require(_0x2211('0xd'));var toCsv=require(_0x2211('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2211('0xe'));var authService=require(_0x2211('0xf'));var qs=require(_0x2211('0x10'));var as=require(_0x2211('0x11'));var hardwareService=require(_0x2211('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x2211('0x13'));var config=require(_0x2211('0x14'));var licenseUtil=require(_0x2211('0x15'));var db=require(_0x2211('0x16'))['db'];function respondWithStatusCode(_0x1c9724,_0x42d376){_0x42d376=_0x42d376||0xcc;return function(_0x15bba7){if(_0x15bba7){return _0x1c9724[_0x2211('0x17')](_0x42d376);}return _0x1c9724[_0x2211('0x18')](_0x42d376)['end']();};}function respondWithResult(_0x472726,_0x2c4fcd){_0x2c4fcd=_0x2c4fcd||0xc8;return function(_0x2a7455){if(_0x2a7455){return _0x472726[_0x2211('0x18')](_0x2c4fcd)[_0x2211('0x19')](_0x2a7455);}};}function respondWithFilteredResult(_0x457ac4,_0x22d9df){return function(_0x23350b){if(_0x23350b){var _0x1ee42c=typeof _0x22d9df['offset']==='undefined'&&typeof _0x22d9df[_0x2211('0x1a')]===_0x2211('0x1b');var _0x283a4a=_0x23350b[_0x2211('0x1c')];var _0x10be9b=_0x1ee42c?0x0:_0x22d9df[_0x2211('0x1d')];var _0x2a7a1a=_0x1ee42c?_0x23350b[_0x2211('0x1c')]:_0x22d9df[_0x2211('0x1d')]+_0x22d9df[_0x2211('0x1a')];var _0x2b1c96;if(_0x2a7a1a>=_0x283a4a){_0x2a7a1a=_0x283a4a;_0x2b1c96=0xc8;}else{_0x2b1c96=0xce;}_0x457ac4[_0x2211('0x18')](_0x2b1c96);return _0x457ac4[_0x2211('0x1e')](_0x2211('0x1f'),_0x10be9b+'-'+_0x2a7a1a+'/'+_0x283a4a)['json'](_0x23350b);}return null;};}function patchUpdates(_0x57fd95){return function(_0x1fe0de){try{jsonpatch['apply'](_0x1fe0de,_0x57fd95,!![]);}catch(_0x42bc1f){return BPromise[_0x2211('0x20')](_0x42bc1f);}return _0x1fe0de['save']();};}function saveUpdates(_0x198772,_0x32c0ce){return function(_0x415b50){if(_0x415b50){return _0x415b50['update'](_0x198772)[_0x2211('0x21')](function(_0xa637ea){return _0xa637ea;});}return null;};}function removeEntity(_0x43a41f,_0x401746){return function(_0x104408){if(_0x104408){return _0x104408['destroy']()[_0x2211('0x21')](function(){_0x43a41f[_0x2211('0x18')](0xcc)[_0x2211('0x22')]();});}};}function handleEntityNotFound(_0x536a60,_0x4de501){return function(_0x9053e9){if(!_0x9053e9){_0x536a60[_0x2211('0x17')](0x194);}return _0x9053e9;};}function handleError(_0x236ed4,_0x3e621f){_0x3e621f=_0x3e621f||0x1f4;return function(_0x2c671a){logger[_0x2211('0x23')](_0x2c671a[_0x2211('0x24')]);if(_0x2c671a[_0x2211('0x25')]){delete _0x2c671a[_0x2211('0x25')];}_0x236ed4[_0x2211('0x18')](_0x3e621f)[_0x2211('0x26')](_0x2c671a);};}exports['index']=function(_0x4efd54,_0x920430){var _0x403a21={},_0x5b3747={},_0xcf7cee={'count':0x0,'rows':[]};var _0x2f5064=_[_0x2211('0x27')](db[_0x2211('0x28')][_0x2211('0x29')],function(_0x25f4a0){return{'name':_0x25f4a0['fieldName'],'type':_0x25f4a0['type'][_0x2211('0x2a')]};});_0x5b3747[_0x2211('0x2b')]=_[_0x2211('0x27')](_0x2f5064,_0x2211('0x25'));_0x5b3747['query']=_[_0x2211('0x2c')](_0x4efd54['query']);_0x5b3747['filters']=_[_0x2211('0x2d')](_0x5b3747[_0x2211('0x2b')],_0x5b3747['query']);_0x403a21[_0x2211('0x2e')]=_[_0x2211('0x2d')](_0x5b3747[_0x2211('0x2b')],qs[_0x2211('0x2f')](_0x4efd54[_0x2211('0x30')][_0x2211('0x2f')]));_0x403a21[_0x2211('0x2e')]=_0x403a21[_0x2211('0x2e')][_0x2211('0x31')]?_0x403a21[_0x2211('0x2e')]:_0x5b3747[_0x2211('0x2b')];if(!_0x4efd54[_0x2211('0x30')]['hasOwnProperty'](_0x2211('0x32'))){_0x403a21[_0x2211('0x1a')]=qs['limit'](_0x4efd54[_0x2211('0x30')]['limit']);_0x403a21[_0x2211('0x1d')]=qs[_0x2211('0x1d')](_0x4efd54[_0x2211('0x30')][_0x2211('0x1d')]);}_0x403a21[_0x2211('0x33')]=qs['sort'](_0x4efd54[_0x2211('0x30')][_0x2211('0x34')]);_0x403a21[_0x2211('0x35')]=qs[_0x2211('0x36')](_[_0x2211('0x37')](_0x4efd54[_0x2211('0x30')],_0x5b3747[_0x2211('0x36')]),_0x2f5064);if(_0x4efd54['query']['filter']){_0x403a21[_0x2211('0x35')]=_[_0x2211('0x38')](_0x403a21[_0x2211('0x35')],{'$or':_[_0x2211('0x27')](_0x2f5064,function(_0x2723f3){if(_0x2723f3[_0x2211('0x39')]!==_0x2211('0x3a')){var _0x56c100={};_0x56c100[_0x2723f3[_0x2211('0x25')]]={'$like':'%'+_0x4efd54[_0x2211('0x30')][_0x2211('0x3b')]+'%'};return _0x56c100;}})});}_0x403a21=_['merge']({},_0x403a21,_0x4efd54[_0x2211('0x3c')]);var _0xa77a94={'where':_0x403a21[_0x2211('0x35')]};return db[_0x2211('0x28')][_0x2211('0x1c')](_0xa77a94)[_0x2211('0x21')](function(_0x18e765){_0xcf7cee[_0x2211('0x1c')]=_0x18e765;if(_0x4efd54[_0x2211('0x30')]['includeAll']){_0x403a21[_0x2211('0x3d')]=[{'all':!![]}];}return db[_0x2211('0x28')][_0x2211('0x3e')](_0x403a21);})[_0x2211('0x21')](function(_0x50ba6d){_0xcf7cee[_0x2211('0x3f')]=_0x50ba6d;return _0xcf7cee;})[_0x2211('0x21')](respondWithFilteredResult(_0x920430,_0x403a21))['catch'](handleError(_0x920430,null));};exports['show']=function(_0x201426,_0x39cd57){var _0x35d143={'raw':!![],'where':{'id':_0x201426['params']['id']}},_0x549561={};_0x549561['model']=_[_0x2211('0x2c')](db['Attachment'][_0x2211('0x29')]);_0x549561['query']=_[_0x2211('0x2c')](_0x201426[_0x2211('0x30')]);_0x549561[_0x2211('0x36')]=_[_0x2211('0x2d')](_0x549561[_0x2211('0x2b')],_0x549561[_0x2211('0x30')]);_0x35d143['attributes']=_[_0x2211('0x2d')](_0x549561[_0x2211('0x2b')],qs[_0x2211('0x2f')](_0x201426[_0x2211('0x30')][_0x2211('0x2f')]));_0x35d143['attributes']=_0x35d143[_0x2211('0x2e')][_0x2211('0x31')]?_0x35d143[_0x2211('0x2e')]:_0x549561[_0x2211('0x2b')];if(_0x201426[_0x2211('0x30')][_0x2211('0x40')]){_0x35d143['include']=[{'all':!![]}];}_0x35d143=_[_0x2211('0x38')]({},_0x35d143,_0x201426[_0x2211('0x3c')]);return db[_0x2211('0x28')][_0x2211('0x41')](_0x35d143)[_0x2211('0x21')](handleEntityNotFound(_0x39cd57,null))[_0x2211('0x21')](respondWithResult(_0x39cd57,null))[_0x2211('0x42')](handleError(_0x39cd57,null));};exports[_0x2211('0x43')]=function(_0x1967d9,_0x1d208a){var _0xe46381={'where':{'id':_0x1967d9[_0x2211('0x44')]['id']}},_0x2e6375={};_0x2e6375['model']=_[_0x2211('0x2c')](db['Attachment']['rawAttributes']);_0xe46381[_0x2211('0x2e')]=_[_0x2211('0x2d')](_0x2e6375[_0x2211('0x2b')],qs['fields'](_0x1967d9[_0x2211('0x30')]['fields']));_0xe46381[_0x2211('0x2e')]=_0xe46381[_0x2211('0x2e')][_0x2211('0x31')]?_0xe46381[_0x2211('0x2e')]:_0x2e6375[_0x2211('0x2b')];if(_0x1967d9[_0x2211('0x30')][_0x2211('0x40')]){_0xe46381[_0x2211('0x3d')]=[{'all':!![]}];}_0xe46381=_[_0x2211('0x38')]({},_0xe46381,_0x1967d9[_0x2211('0x3c')]);return db[_0x2211('0x28')][_0x2211('0x41')](_0xe46381)[_0x2211('0x21')](handleEntityNotFound(_0x1d208a,null))[_0x2211('0x21')](function(_0x305d5a){if(_0x305d5a){var _0x20ac1b=_0x305d5a[_0x2211('0x45')]({'plain':!![]});_0x20ac1b=qs['omit'](_0x20ac1b,['id',_0x2211('0x46'),_0x2211('0x47')]);_0x1967d9[_0x2211('0x48')]=_[_0x2211('0x49')](_0x1967d9[_0x2211('0x48')],['id','createdAt','updatedAt']);return db['Attachment'][_0x2211('0x4a')](_['merge'](_0x20ac1b,_0x1967d9[_0x2211('0x48')]),{'include':_0x1967d9[_0x2211('0x30')][_0x2211('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x1d208a,0xc9))['catch'](handleError(_0x1d208a,null));};exports[_0x2211('0x4b')]=function(_0x54ff67,_0x583244){if(_0x54ff67[_0x2211('0x48')]['id']){delete _0x54ff67[_0x2211('0x48')]['id'];}return db['Attachment'][_0x2211('0x41')]({'where':{'id':_0x54ff67['params']['id']}})['then'](handleEntityNotFound(_0x583244,null))[_0x2211('0x21')](saveUpdates(_0x54ff67[_0x2211('0x48')],null))[_0x2211('0x21')](respondWithResult(_0x583244,null))[_0x2211('0x42')](handleError(_0x583244,null));};exports[_0x2211('0x4c')]=function(_0xb02044,_0x57f499){return db[_0x2211('0x28')][_0x2211('0x41')]({'where':{'id':_0xb02044[_0x2211('0x44')]['id']}})[_0x2211('0x21')](handleEntityNotFound(_0x57f499,null))[_0x2211('0x21')](removeEntity(_0x57f499,null))[_0x2211('0x42')](handleError(_0x57f499,null));};exports[_0x2211('0x4a')]=function(_0x365c18,_0x4b52e6,_0x568279){_0x365c18['body'][_0x2211('0x25')]=_0x365c18[_0x2211('0x4d')][_0x2211('0x4e')];_0x365c18['body'][_0x2211('0x4f')]=_0x365c18[_0x2211('0x4d')][_0x2211('0x50')];_0x365c18[_0x2211('0x48')][_0x2211('0x39')]=_0x365c18['file'][_0x2211('0x51')];return db[_0x2211('0x28')][_0x2211('0x4a')](_0x365c18[_0x2211('0x48')])['then'](respondWithResult(_0x4b52e6,0xc9))['catch'](handleError(_0x4b52e6,null));};exports[_0x2211('0x52')]=function(_0x19fd30,_0x2f2720,_0x4fdcd7){return db[_0x2211('0x28')][_0x2211('0x53')]({'where':{'id':_0x19fd30['params']['id']},'raw':!![]})[_0x2211('0x21')](handleEntityNotFound(_0x2f2720,null))['then'](function(_0x3d34ea){if(_0x3d34ea){var _0x54c2bf=_0x3d34ea[_0x2211('0x54')]!==null;var _0x15df2d=path[_0x2211('0x55')](config[_0x2211('0x56')],_0x2211('0x57'));if(_0x54c2bf){_0x15df2d=path[_0x2211('0x55')](_0x15df2d,_0x2211('0x58'));}var _0x8c65b3=path['join'](_0x15df2d,_0x3d34ea[_0x2211('0x4f')]);return _0x2f2720[_0x2211('0x52')](_0x8c65b3);}})[_0x2211('0x42')](handleError(_0x2f2720,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index b0dbe6f..4b5cf73 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 _0x804f=['attachments','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./attachment.attributes','exports','Attachment'];(function(_0xace29b,_0x529a09){var _0x373b71=function(_0x50748d){while(--_0x50748d){_0xace29b['push'](_0xace29b['shift']());}};_0x373b71(++_0x529a09);}(_0x804f,0x1b9));var _0xf804=function(_0x576267,_0x2906cf){_0x576267=_0x576267-0x0;var _0x22f0bd=_0x804f[_0x576267];return _0x22f0bd;};'use strict';var _=require(_0xf804('0x0'));var util=require(_0xf804('0x1'));var logger=require(_0xf804('0x2'))(_0xf804('0x3'));var moment=require(_0xf804('0x4'));var BPromise=require(_0xf804('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf804('0x6'));var config=require('../../config/environment');var attributes=require(_0xf804('0x7'));module[_0xf804('0x8')]=function(_0xb4631d,_0x1dcc81){return _0xb4631d['define'](_0xf804('0x9'),attributes,{'tableName':_0xf804('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4011=['path','../../config/environment','exports','Attachment','attachments','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x4011,0x1bd));var _0x1401=function(_0x141fdf,_0x243c24){_0x141fdf=_0x141fdf-0x0;var _0x24cad9=_0x4011[_0x141fdf];return _0x24cad9;};'use strict';var _=require('lodash');var util=require(_0x1401('0x0'));var logger=require(_0x1401('0x1'))(_0x1401('0x2'));var moment=require(_0x1401('0x3'));var BPromise=require(_0x1401('0x4'));var rp=require(_0x1401('0x5'));var fs=require('fs');var path=require(_0x1401('0x6'));var rimraf=require('rimraf');var config=require(_0x1401('0x7'));var attributes=require('./attachment.attributes');module[_0x1401('0x8')]=function(_0x19ce30,_0xbe2dd){return _0x19ce30['define'](_0x1401('0x9'),attributes,{'tableName':_0x1401('0xa'),'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 4103dab..707b742 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 _0x9f94=['rpc','jayson/promise','client','http','Attachment,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2377ba,_0x32fdd9){var _0x39ec68=function(_0x2cb7e6){while(--_0x2cb7e6){_0x2377ba['push'](_0x2377ba['shift']());}};_0x39ec68(++_0x32fdd9);}(_0x9f94,0x1e7));var _0x49f9=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x9f94[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('Attachment,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('Attachment,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});}exports[_0x49f9('0x14')]=function(_0x509610){var _0x3cc45e=this;return new Promise(function(_0x359d48,_0x32568b){return db[_0x49f9('0x15')][_0x49f9('0x16')](_0x509610[_0x49f9('0x17')],{'raw':_0x509610[_0x49f9('0x18')]?_0x509610[_0x49f9('0x18')][_0x49f9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f0bc9){logger[_0x49f9('0x11')]('CreateAttachment',_0x509610);logger[_0x49f9('0xd')]('CreateAttachment',_0x509610,JSON['stringify'](_0x4f0bc9));_0x359d48(_0x4f0bc9);})[_0x49f9('0x13')](function(_0xde1383){logger['error'](_0x49f9('0x14'),_0xde1383['message'],_0x509610);_0x32568b(_0x3cc45e['error'](0x1f4,_0xde1383[_0x49f9('0x10')]));});});}; \ No newline at end of file +var _0xf290=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateAttachment','create','body','options','raw','util','bluebird','ioredis'];(function(_0x3b39af,_0x1878df){var _0x25f1ea=function(_0x493c27){while(--_0x493c27){_0x3b39af['push'](_0x3b39af['shift']());}};_0x25f1ea(++_0x1878df);}(_0xf290,0xde));var _0x0f29=function(_0x685346,_0x3ef2e5){_0x685346=_0x685346-0x0;var _0x52e15b=_0xf290[_0x685346];return _0x52e15b;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('Attachment,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});}exports[_0x0f29('0x14')]=function(_0x5d72a5){var _0x17b994=this;return new Promise(function(_0x4ca5e8,_0x5ddc74){return db['Attachment'][_0x0f29('0x15')](_0x5d72a5[_0x0f29('0x16')],{'raw':_0x5d72a5[_0x0f29('0x17')]?_0x5d72a5[_0x0f29('0x17')][_0x0f29('0x18')]===undefined?!![]:![]:!![]})[_0x0f29('0xa')](function(_0x150271){logger['info'](_0x0f29('0x14'),_0x5d72a5);logger['debug']('CreateAttachment',_0x5d72a5,JSON['stringify'](_0x150271));_0x4ca5e8(_0x150271);})['catch'](function(_0x38a1ce){logger[_0x0f29('0x10')]('CreateAttachment',_0x38a1ce[_0x0f29('0x12')],_0x5d72a5);_0x5ddc74(_0x17b994[_0x0f29('0x10')](0x1f4,_0x38a1ce[_0x0f29('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a3d7827..5975e62 100644 --- a/server/api/attachment/index.js +++ b/server/api/attachment/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x189c31,_0x35b3d4){var _0x3bd2b5=function(_0x1ad22c){while(--_0x1ad22c){_0x189c31['push'](_0x189c31['shift']());}};_0x3bd2b5(++_0x35b3d4);}(_0xadb5,0xad));var _0x5adb=function(_0x48c6d0,_0x35e51c){_0x48c6d0=_0x48c6d0-0x0;var _0x440b7b=_0xadb5[_0x48c6d0];return _0x440b7b;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file +var _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(_0x569f1b,_0x28f4ae){var _0x56981f=function(_0x32dd9a){while(--_0x32dd9a){_0x569f1b['push'](_0x569f1b['shift']());}};_0x56981f(++_0x28f4ae);}(_0x2032,0xd9));var _0x2203=function(_0x3cbccd,_0x5606fd){_0x3cbccd=_0x3cbccd-0x0;var _0x532cd9=_0x2032[_0x3cbccd];return _0x532cd9;};'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 c31b4d0..3f5411f 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 _0xaaea=['getLicense','catch','send','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','password','User','passport','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','baseDN','url','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:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','disabled','blocked','blockedAt','online','admin','user','blockDuration','minutes','clearBlockUser'];(function(_0x328090,_0x5a7215){var _0x114776=function(_0x4bc712){while(--_0x4bc712){_0x328090['push'](_0x328090['shift']());}};_0x114776(++_0x5a7215);}(_0xaaea,0xc1));var _0xaaae=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xaaea[_0x17d9e3];return _0x14192d;};'use strict';var passport=require(_0xaaae('0x0'));var LocalStrategy=require(_0xaaae('0x1'))[_0xaaae('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xaaae('0x3'));var BPromise=require(_0xaaae('0x4'));var util=require('util');var db=require(_0xaaae('0x5'))['db'];var authService=require(_0xaaae('0x6'));var utils=require(_0xaaae('0x7'));var config=require('../../config/environment');var logger=require(_0xaaae('0x8'))(_0xaaae('0x9'));function isActiveDirectoryConfigured(_0x25e775){var _0x4c972a=![];if(typeof _0x25e775[_0xaaae('0xa')]!=='undefined'){_0x4c972a=_0x25e775['activedirectory'][_0xaaae('0xb')]&&_0x25e775[_0xaaae('0xa')][_0xaaae('0xc')]&&_0x25e775['activedirectory'][_0xaaae('0xd')];}return _0x4c972a;}function adAuthenticate(_0x367b14,_0x394441,_0x45b3e3){return new BPromise(function(_0x445670,_0x1a6476){try{var _0x2e9536=new ActiveDirectory(_0x367b14);_0x2e9536['authenticate'](_0x394441,_0x45b3e3,function(_0x23dfe3,_0x424b6f){if(_0x23dfe3){logger[_0xaaae('0xe')](_0xaaae('0xf'),_0x394441,util[_0xaaae('0x10')](_0x23dfe3,{'showHidden':![],'depth':null}));_0x1a6476(_0xaaae('0x11'));}else if(!_0x424b6f){logger[_0xaaae('0xe')](_0xaaae('0x12'),_0x394441);_0x1a6476(_0xaaae('0x11'));}else{_0x445670(_0x424b6f);}});}catch(_0x455081){_0x1a6476(_0x455081);}});}function ActiveDirectoryAuthenticate(_0x95fb1c,_0x53056c,_0x4d0bc7,_0x3f1476){var _0x483971,_0x298df7;if(!isActiveDirectoryConfigured(config)){logger[_0xaaae('0xe')](_0xaaae('0x13'),_0x53056c);return _0x3f1476(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xaaae('0x14')][_0xaaae('0x15')]({'where':{'id':0x1},'attributes':[_0xaaae('0x16'),'blockDuration'],'raw':!![]})[_0xaaae('0x17')](function(_0x58fd67){_0x483971=_0x58fd67;if(!_0x483971[_0xaaae('0x16')]){logger[_0xaaae('0xe')](_0xaaae('0x18'),_0x53056c);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x95fb1c[_0xaaae('0x15')]({'attributes':['id',_0xaaae('0x19'),'password',_0xaaae('0x1a'),_0xaaae('0x1b'),_0xaaae('0x1c'),_0xaaae('0x1d'),_0xaaae('0x1e'),_0xaaae('0x1f')],'where':{'name':_0x53056c,'role':{'$or':[_0xaaae('0x20'),_0xaaae('0x21'),'agent']},'adSsoEnabled':!![]}});})[_0xaaae('0x17')](function(_0x649671){if(!_0x649671||_0x649671&&_0x649671[_0xaaae('0x19')]!==_0x53056c){throw new Error(_0xaaae('0x11'));}_0x298df7=_0x649671;var _0x46a5b4=_0x298df7[_0xaaae('0x19')]+'@'+config['activedirectory'][_0xaaae('0xd')];return adAuthenticate(config[_0xaaae('0xa')],_0x46a5b4,_0x4d0bc7);})[_0xaaae('0x17')](function(_0x4e7a24){if(_0x298df7['disabled']){throw new Error(_0xaaae('0x11'));}if(_0x483971[_0xaaae('0x22')]>0x0){if(_0x298df7[_0xaaae('0x1d')]){if(moment(_0x298df7[_0xaaae('0x1e')])['add'](_0x483971['blockDuration'],_0xaaae('0x23'))>moment()){throw new Error(_0xaaae('0x11'));}return utils[_0xaaae('0x24')](_0x298df7,0x0,![],null)['then'](function(){return utils['getLicense'](_0x298df7);})[_0xaaae('0x17')](function(){return _0x3f1476(null,_0x298df7);});}else{return utils[_0xaaae('0x25')](_0x298df7)[_0xaaae('0x17')](function(){return _0x3f1476(null,_0x298df7);});}}else{return utils[_0xaaae('0x25')](_0x298df7)['then'](function(){return _0x3f1476(null,_0x298df7);});}})[_0xaaae('0x26')](function(_0x2e38df){return _0x3f1476(null,![],_0x2e38df);});}function handleError(_0x333fd9,_0x1c5d9e,_0xdbb26e){return _0x333fd9['status'](_0x1c5d9e||0x1f4)[_0xaaae('0x27')]({'message':_0xdbb26e?_0xdbb26e['message']||_0xdbb26e:''});}exports['login']=function(_0x3b8454,_0x4be37f,_0x4f4dca){passport['authenticate'](_0xaaae('0x28'),function(_0x3ad94f,_0x516ce1,_0x188888){var _0x18e653=_0x3ad94f||_0x188888;if(_0x18e653){return handleError(_0x4be37f,0x191,_0x18e653);}if(!_0x516ce1){return handleError(_0x4be37f,0x194,{'message':_0xaaae('0x29')});}else{var _0x4a5fcd={'payload':{'id':_0x516ce1['id'],'role':_0x516ce1['role']},'options':{'expiresIn':0x15180}};return authService[_0xaaae('0x2a')](_0x4a5fcd)['then'](function(_0x1aa006){_0x4be37f[_0xaaae('0x2b')]({'id':_0x516ce1['id'],'token':_0x1aa006,'statusCall':'','isAlreadyLogged':_0x516ce1[_0xaaae('0x1f')]});});}})(_0x3b8454,_0x4be37f,_0x4f4dca);};passport['use'](_0xaaae('0x28'),new LocalStrategy({'usernameField':_0xaaae('0x19'),'passwordField':_0xaaae('0x2c')},function(_0x48ac6e,_0x37d3bd,_0x4cf8d9){return ActiveDirectoryAuthenticate(db[_0xaaae('0x2d')],_0x48ac6e,_0x37d3bd,_0x4cf8d9);})); \ No newline at end of file +var _0xdcbc=['disabled','minutes','getLicense','catch','status','send','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','password','User','passport','passport-local','Strategy','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/environment','api','activedirectory','undefined','baseDN','url','domain','Error\x20authenticate\x20%s:\x20%s','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','salt','role','blocked','blockedAt','online','admin','user','agent'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xdcbc,0x16c));var _0xcdcb=function(_0x1b7e31,_0x230644){_0x1b7e31=_0x1b7e31-0x0;var _0x2220d5=_0xdcbc[_0x1b7e31];return _0x2220d5;};'use strict';var passport=require(_0xcdcb('0x0'));var LocalStrategy=require(_0xcdcb('0x1'))[_0xcdcb('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xcdcb('0x3'));var BPromise=require(_0xcdcb('0x4'));var util=require('util');var db=require(_0xcdcb('0x5'))['db'];var authService=require(_0xcdcb('0x6'));var utils=require('../../config/utils');var config=require(_0xcdcb('0x7'));var logger=require('../../config/logger')(_0xcdcb('0x8'));function isActiveDirectoryConfigured(_0x4ebdf1){var _0x21b62e=![];if(typeof _0x4ebdf1[_0xcdcb('0x9')]!==_0xcdcb('0xa')){_0x21b62e=_0x4ebdf1[_0xcdcb('0x9')][_0xcdcb('0xb')]&&_0x4ebdf1[_0xcdcb('0x9')][_0xcdcb('0xc')]&&_0x4ebdf1[_0xcdcb('0x9')][_0xcdcb('0xd')];}return _0x21b62e;}function adAuthenticate(_0x57d81d,_0x57e6d0,_0x1accb6){return new BPromise(function(_0x105844,_0x71bf06){try{var _0x2781e1=new ActiveDirectory(_0x57d81d);_0x2781e1['authenticate'](_0x57e6d0,_0x1accb6,function(_0x40ee2,_0x925488){if(_0x40ee2){logger['error'](_0xcdcb('0xe'),_0x57e6d0,util['inspect'](_0x40ee2,{'showHidden':![],'depth':null}));_0x71bf06('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x925488){logger[_0xcdcb('0xf')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x57e6d0);_0x71bf06(_0xcdcb('0x10'));}else{_0x105844(_0x925488);}});}catch(_0x4bfcb1){_0x71bf06(_0x4bfcb1);}});}function ActiveDirectoryAuthenticate(_0x5b891c,_0x5f285a,_0xed035,_0x53f7bc){var _0x2074c5,_0x288402;if(!isActiveDirectoryConfigured(config)){logger[_0xcdcb('0xf')](_0xcdcb('0x11'),_0x5f285a);return _0x53f7bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0xcdcb('0x12')]['findOne']({'where':{'id':0x1},'attributes':[_0xcdcb('0x13'),_0xcdcb('0x14')],'raw':!![]})[_0xcdcb('0x15')](function(_0x3e6913){_0x2074c5=_0x3e6913;if(!_0x2074c5[_0xcdcb('0x13')]){logger[_0xcdcb('0xf')](_0xcdcb('0x16'),_0x5f285a);throw new Error(_0xcdcb('0x10'));}return _0x5b891c['findOne']({'attributes':['id',_0xcdcb('0x17'),'password',_0xcdcb('0x18'),_0xcdcb('0x19'),'disabled',_0xcdcb('0x1a'),_0xcdcb('0x1b'),_0xcdcb('0x1c')],'where':{'name':_0x5f285a,'role':{'$or':[_0xcdcb('0x1d'),_0xcdcb('0x1e'),_0xcdcb('0x1f')]},'adSsoEnabled':!![]}});})[_0xcdcb('0x15')](function(_0x15306b){if(!_0x15306b||_0x15306b&&_0x15306b[_0xcdcb('0x17')]!==_0x5f285a){throw new Error(_0xcdcb('0x10'));}_0x288402=_0x15306b;var _0x400810=_0x288402[_0xcdcb('0x17')]+'@'+config[_0xcdcb('0x9')][_0xcdcb('0xd')];return adAuthenticate(config[_0xcdcb('0x9')],_0x400810,_0xed035);})[_0xcdcb('0x15')](function(_0x4905aa){if(_0x288402[_0xcdcb('0x20')]){throw new Error(_0xcdcb('0x10'));}if(_0x2074c5[_0xcdcb('0x14')]>0x0){if(_0x288402[_0xcdcb('0x1a')]){if(moment(_0x288402['blockedAt'])['add'](_0x2074c5[_0xcdcb('0x14')],_0xcdcb('0x21'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x288402,0x0,![],null)[_0xcdcb('0x15')](function(){return utils[_0xcdcb('0x22')](_0x288402);})[_0xcdcb('0x15')](function(){return _0x53f7bc(null,_0x288402);});}else{return utils['getLicense'](_0x288402)['then'](function(){return _0x53f7bc(null,_0x288402);});}}else{return utils[_0xcdcb('0x22')](_0x288402)['then'](function(){return _0x53f7bc(null,_0x288402);});}})[_0xcdcb('0x23')](function(_0xb5d770){return _0x53f7bc(null,![],_0xb5d770);});}function handleError(_0xc43b03,_0x2c5fb1,_0x23ad93){return _0xc43b03[_0xcdcb('0x24')](_0x2c5fb1||0x1f4)[_0xcdcb('0x25')]({'message':_0x23ad93?_0x23ad93['message']||_0x23ad93:''});}exports[_0xcdcb('0x26')]=function(_0x334b40,_0x1ac462,_0x4eedfa){passport[_0xcdcb('0x27')](_0xcdcb('0x28'),function(_0x4834fd,_0x39d7db,_0x1284e9){var _0x58f89f=_0x4834fd||_0x1284e9;if(_0x58f89f){return handleError(_0x1ac462,0x191,_0x58f89f);}if(!_0x39d7db){return handleError(_0x1ac462,0x194,{'message':_0xcdcb('0x29')});}else{var _0x4c951b={'payload':{'id':_0x39d7db['id'],'role':_0x39d7db[_0xcdcb('0x19')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4c951b)[_0xcdcb('0x15')](function(_0x4e90d5){_0x1ac462['json']({'id':_0x39d7db['id'],'token':_0x4e90d5,'statusCall':'','isAlreadyLogged':_0x39d7db['online']});});}})(_0x334b40,_0x1ac462,_0x4eedfa);};passport['use'](_0xcdcb('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0xcdcb('0x2a')},function(_0x59270d,_0x2a2a31,_0x24924e){return ActiveDirectoryAuthenticate(db[_0xcdcb('0x2b')],_0x59270d,_0x2a2a31,_0x24924e);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 3949440..bb153d7 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 _0x0690=['Router','./authActiveDirectory.controller','login','exports','express'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x0690,0x1d5));var _0x0069=function(_0x43f5ef,_0x1cb570){_0x43f5ef=_0x43f5ef-0x0;var _0x1cbff7=_0x0690[_0x43f5ef];return _0x1cbff7;};'use strict';var express=require(_0x0069('0x0'));var router=express[_0x0069('0x1')]();var controller=require(_0x0069('0x2'));router['post']('/',controller[_0x0069('0x3')]);module[_0x0069('0x4')]=router; \ No newline at end of file +var _0x5a47=['express','./authActiveDirectory.controller','post','exports'];(function(_0x62360d,_0x5a06f2){var _0x1fea1d=function(_0x32939b){while(--_0x32939b){_0x62360d['push'](_0x62360d['shift']());}};_0x1fea1d(++_0x5a06f2);}(_0x5a47,0x124));var _0x75a4=function(_0xf4a467,_0x3d2b5e){_0xf4a467=_0xf4a467-0x0;var _0x22c3bf=_0x5a47[_0xf4a467];return _0x22c3bf;};'use strict';var express=require(_0x75a4('0x0'));var router=express['Router']();var controller=require(_0x75a4('0x1'));router[_0x75a4('0x2')]('/',controller['login']);module[_0x75a4('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 5bebf13..e5508a3 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(_0x37f6e3,_0x157758){var _0x15a502=function(_0x19e4d0){while(--_0x19e4d0){_0x37f6e3['push'](_0x37f6e3['shift']());}};_0x15a502(++_0x157758);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +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(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x7a54,0x106));var _0x47a5=function(_0x424242,_0x1a3ff1){_0x424242=_0x424242-0x0;var _0x5b2342=_0x7a54[_0x424242];return _0x5b2342;};'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 fe9dab4..161832f 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 _0xdb13=['callback','isMiddleware','login','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback'];(function(_0x59d15a,_0x194286){var _0xbe0075=function(_0x1d8c75){while(--_0x1d8c75){_0x59d15a['push'](_0x59d15a['shift']());}};_0xbe0075(++_0x194286);}(_0xdb13,0x10c));var _0x3db1=function(_0x3dfee5,_0x5ab75e){_0x3dfee5=_0x3dfee5-0x0;var _0x116981=_0xdb13[_0x3dfee5];return _0x116981;};'use strict';var express=require('express');var passport=require(_0x3db1('0x0'));var router=express[_0x3db1('0x1')]();var controller=require(_0x3db1('0x2'));var userController=require(_0x3db1('0x3'));var authService=require(_0x3db1('0x4'));router[_0x3db1('0x5')]('/',controller['login']);router[_0x3db1('0x5')](_0x3db1('0x6'),controller[_0x3db1('0x7')],authService[_0x3db1('0x8')],userController[_0x3db1('0x9')],authService['setTokenCookie']);module[_0x3db1('0xa')]=router; \ No newline at end of file +var _0x447b=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback','isMiddleware','express','passport'];(function(_0x1a30ea,_0x22bf39){var _0x36b8f2=function(_0x32fbbb){while(--_0x32fbbb){_0x1a30ea['push'](_0x1a30ea['shift']());}};_0x36b8f2(++_0x22bf39);}(_0x447b,0xe4));var _0xb447=function(_0x49a2b4,_0x44b9ab){_0x49a2b4=_0x49a2b4-0x0;var _0x4c0ca4=_0x447b[_0x49a2b4];return _0x4c0ca4;};'use strict';var express=require(_0xb447('0x0'));var passport=require(_0xb447('0x1'));var router=express['Router']();var controller=require(_0xb447('0x2'));var userController=require(_0xb447('0x3'));var authService=require(_0xb447('0x4'));router[_0xb447('0x5')]('/',controller[_0xb447('0x6')]);router[_0xb447('0x5')](_0xb447('0x7'),controller[_0xb447('0x8')],authService[_0xb447('0x9')],userController[_0xb447('0x6')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 98409be..09e2a83 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 _0x4c6d=['stringify','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','email','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','find','This\x20email\x20is\x20not\x20registered.','add','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','https://','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','User','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','catch','use','util','passport-local','Strategy','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','blockDuration','name','password','salt','role','disabled','blocked','blockedAt','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','clearBlockUser','then','minutes','getLicense','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!'];(function(_0x28019c,_0x67743){var _0x48ca39=function(_0x4c161e){while(--_0x4c161e){_0x28019c['push'](_0x28019c['shift']());}};_0x48ca39(++_0x67743);}(_0x4c6d,0x1d5));var _0xd4c6=function(_0x29ebb8,_0x51d0d8){_0x29ebb8=_0x29ebb8-0x0;var _0x10c623=_0x4c6d[_0x29ebb8];return _0x10c623;};'use strict';var util=require(_0xd4c6('0x0'));var passport=require('passport');var LocalStrategy=require(_0xd4c6('0x1'))[_0xd4c6('0x2')];var jayson=require('jayson/promise');var _=require(_0xd4c6('0x3'));var rs=require(_0xd4c6('0x4'));var moment=require('moment');var db=require(_0xd4c6('0x5'))['db'];var authService=require(_0xd4c6('0x6'));var utils=require(_0xd4c6('0x7'));var client=jayson[_0xd4c6('0x8')][_0xd4c6('0x9')]({'port':0x232b});function localAuthenticate(_0x93f47f,_0x5d009e,_0x158328,_0x5b5654){var _0x2229f7,_0x49eaa2;return db[_0xd4c6('0xa')][_0xd4c6('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd4c6('0xc')],'raw':!![]})['then'](function(_0x507b32){_0x2229f7=_0x507b32;return _0x93f47f['findOne']({'attributes':['id',_0xd4c6('0xd'),_0xd4c6('0xe'),_0xd4c6('0xf'),_0xd4c6('0x10'),_0xd4c6('0x11'),_0xd4c6('0x12'),_0xd4c6('0x13'),'loginAttempts'],'where':{'name':_0x5d009e,'role':{'$or':[_0xd4c6('0x14'),'user',_0xd4c6('0x15')]}}});})['then'](function(_0x5a0855){if(!_0x5a0855||_0x5a0855&&_0x5a0855[_0xd4c6('0xd')]!==_0x5d009e){throw new Error(_0xd4c6('0x16'));}else{_0x49eaa2=_0x5a0855;return _0x49eaa2;}})['then'](function(){_0x49eaa2[_0xd4c6('0x17')](_0x158328,function(_0x302462,_0x78812c){var _0x1cf110=_0x49eaa2['loginAttempts']+0x1;if(_0x302462){return _0x5b5654(_0x302462);}else if(!_0x78812c){if(_0x49eaa2['disabled']){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else if(_0x2229f7[_0xd4c6('0x18')]>0x0){if(_0x49eaa2[_0xd4c6('0x12')]){if(_0x2229f7[_0xd4c6('0xc')]>0x0){if(moment(_0x49eaa2['blockedAt'])['add'](_0x2229f7[_0xd4c6('0xc')],'minutes')>moment()){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else{return utils[_0xd4c6('0x19')](_0x49eaa2,_0x1cf110,![],null)[_0xd4c6('0x1a')](function(){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});});}}else{return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}}else{if(_0x1cf110>=_0x2229f7['allowedLoginAttempts']){return utils[_0xd4c6('0x19')](_0x49eaa2,0x0,!![],moment())['then'](function(){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});});}else{return utils[_0xd4c6('0x19')](_0x49eaa2,_0x1cf110,![],null)[_0xd4c6('0x1a')](function(){return _0x5b5654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}}else{if(_0x49eaa2['disabled']){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else if(_0x2229f7[_0xd4c6('0x18')]>0x0){if(_0x49eaa2[_0xd4c6('0x12')]){if(_0x2229f7[_0xd4c6('0xc')]>0x0){if(moment(_0x49eaa2[_0xd4c6('0x13')])['add'](_0x2229f7['blockDuration'],_0xd4c6('0x1b'))>moment()){return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}else{return utils[_0xd4c6('0x19')](_0x49eaa2,0x0,![],null)[_0xd4c6('0x1a')](function(){return utils[_0xd4c6('0x1c')](_0x49eaa2);})[_0xd4c6('0x1a')](function(){return _0x5b5654(null,_0x49eaa2);});}}else{return _0x5b5654(null,![],{'message':_0xd4c6('0x16')});}}else{return utils[_0xd4c6('0x19')](_0x49eaa2,0x0,![],null)[_0xd4c6('0x1a')](function(){return utils[_0xd4c6('0x1c')](_0x49eaa2);})[_0xd4c6('0x1a')](function(){return _0x5b5654(null,_0x49eaa2);})['catch'](function(_0x4cfac3){return _0x5b5654(null,![],_0x4cfac3);});}}else{if(_0x49eaa2['blocked']){return _0x5b5654(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xd4c6('0x1c')](_0x49eaa2)[_0xd4c6('0x1a')](function(){return _0x5b5654(null,_0x49eaa2);});}}}});})['catch'](function(_0x35f6aa){return _0x5b5654(null,![],_0x35f6aa);});}function sendServiceMail(_0x2b67e9){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xd4c6('0xd'),'email'],'include':[{'model':db[_0xd4c6('0x1d')],'as':_0xd4c6('0x1e'),'include':[{'model':db[_0xd4c6('0x1f')],'as':'CloudProvider'}]}]})['then'](function(_0x5d6090){if(!_0x5d6090){throw new Error(_0xd4c6('0x20'));}var _0x12d9fa=_0x5d6090[_0xd4c6('0x21')]();var _0x19e3e7={'account':_0x12d9fa,'message':_[_0xd4c6('0x22')]({'from':util[_0xd4c6('0x23')]('\x22%s\x22\x20<%s>',_0x5d6090[_0xd4c6('0xd')],_0x5d6090['email']||_0x5d6090['Smtp'][_0xd4c6('0x24')])},_0x2b67e9)};return client[_0xd4c6('0x25')](_0xd4c6('0x26'),_0x19e3e7);})[_0xd4c6('0x1a')](function(_0x153762){if(_0x153762[_0xd4c6('0x27')]){throw new Error(util[_0xd4c6('0x23')](_0xd4c6('0x28'),_0x153762['error']['message']||JSON[_0xd4c6('0x29')](_0x153762['error'])));}return!![];});}function handleError(_0x5f366c,_0x41b608,_0x1489f0){return _0x5f366c['status'](_0x41b608||0x1f4)['send']({'message':_0x1489f0?_0x1489f0[_0xd4c6('0x2a')]||_0x1489f0:''});}exports[_0xd4c6('0x2b')]=function(_0x3ebe85,_0x54fbf7,_0x3ec4b1){passport[_0xd4c6('0x17')](_0xd4c6('0x2c'),function(_0x4fe21a,_0x3a4baa,_0x2ae29e){var _0x26992d=_0x4fe21a||_0x2ae29e;if(_0x26992d){return handleError(_0x54fbf7,0x191,_0x26992d);}if(!_0x3a4baa){return handleError(_0x54fbf7,0x194,{'message':_0xd4c6('0x2d')});}else{var _0x5871a6={'payload':{'id':_0x3a4baa['id'],'role':_0x3a4baa[_0xd4c6('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xd4c6('0x2e')](_0x5871a6)['then'](function(_0x92d5f9){_0x54fbf7[_0xd4c6('0x2f')]({'id':_0x3a4baa['id'],'token':_0x92d5f9,'statusCall':'','isAlreadyLogged':_0x3a4baa[_0xd4c6('0x30')]});});}})(_0x3ebe85,_0x54fbf7,_0x3ec4b1);};exports['forgot']=function(_0x3cab44,_0x466509){if(!_0x3cab44['body'][_0xd4c6('0x31')]){return handleError(_0x466509,0x1f4,{'message':_0xd4c6('0x32')});}var _0x3165a9=rs[_0xd4c6('0x33')]();_0x3cab44[_0xd4c6('0x34')][_0xd4c6('0x31')]=_0x3cab44[_0xd4c6('0x34')][_0xd4c6('0x31')][_0xd4c6('0x35')]()[_0xd4c6('0x36')]();var _0x193d21;return db[_0xd4c6('0xa')][_0xd4c6('0xb')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd4c6('0xc')],'raw':!![]})['then'](function(_0x34bb56){_0x193d21=_0x34bb56;return db['User'][_0xd4c6('0x37')]({'where':{'email':_0x3cab44['body'][_0xd4c6('0x31')]}});})[_0xd4c6('0x1a')](function(_0x934911){if(!_0x934911){throw new Error(_0xd4c6('0x38'));}if(_0x934911[_0xd4c6('0x11')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x934911[_0xd4c6('0x12')]){if(moment(_0x934911[_0xd4c6('0x13')])[_0xd4c6('0x39')](_0x193d21['blockDuration'],_0xd4c6('0x1b'))>moment()){throw new Error(_0xd4c6('0x3a'));}else{_0x934911[_0xd4c6('0x12')]=![];_0x934911['blockedAt']=null;}}_0x934911[_0xd4c6('0x3b')]=_0x3165a9;_0x934911[_0xd4c6('0x3c')]=Date[_0xd4c6('0x3d')]()+0x36ee80;return _0x934911[_0xd4c6('0x3e')]();})['then'](function(){return sendServiceMail({'to':_0x3cab44['body'][_0xd4c6('0x31')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd4c6('0x3f')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xd4c6('0x40')+_0x3cab44[_0xd4c6('0x41')][_0xd4c6('0x42')]+_0xd4c6('0x43')+_0x3165a9+'\x0a\x0a'+_0xd4c6('0x44')});})['then'](function(){_0x466509['status'](0xc8)[_0xd4c6('0x45')]({'message':_0xd4c6('0x46')});})['catch'](function(_0x13e15f){return handleError(_0x466509,0x1f4,_0x13e15f);});};exports[_0xd4c6('0x47')]=function(_0x446b4e,_0x4b79d0){return db[_0xd4c6('0x48')][_0xd4c6('0x37')]({'where':{'resetPasswordToken':_0x446b4e[_0xd4c6('0x49')][_0xd4c6('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xd4c6('0x3d')]()}}})[_0xd4c6('0x1a')](function(_0x347293){if(!_0x347293){throw new Error(_0xd4c6('0x4b'));}return db[_0xd4c6('0xa')][_0xd4c6('0xb')]({'attributes':['id','securePassword',_0xd4c6('0x4c'),_0xd4c6('0x4d')]})[_0xd4c6('0x1a')](function(_0x3aa821){if(_0x3aa821[_0xd4c6('0x4e')])authService[_0xd4c6('0x4f')](_0x446b4e[_0xd4c6('0x34')][_0xd4c6('0xe')]);if(!_0x3aa821[_0xd4c6('0x4c')]||!_0x347293[_0xd4c6('0x50')])return _0x347293;authService[_0xd4c6('0x51')](_0x446b4e[_0xd4c6('0x34')][_0xd4c6('0xe')],_0x347293['previousPasswords'],_0x3aa821[_0xd4c6('0x4d')]);return _0x347293;})['then'](function(){_0x347293[_0xd4c6('0xe')]=_0x446b4e['body']['password'];_0x347293[_0xd4c6('0x3b')]=null;_0x347293[_0xd4c6('0x3c')]=null;return _0x347293[_0xd4c6('0x3e')]();});})[_0xd4c6('0x1a')](function(){_0x4b79d0['status'](0xc8)[_0xd4c6('0x45')]({'message':_0xd4c6('0x52')});})[_0xd4c6('0x53')](function(_0x4cf124){return handleError(_0x4b79d0,0x1f4,_0x4cf124);});};passport[_0xd4c6('0x54')](_0xd4c6('0x2c'),new LocalStrategy({'usernameField':_0xd4c6('0xd'),'passwordField':_0xd4c6('0xe')},function(_0xdbc573,_0x1a0015,_0x1803d7){return localAuthenticate(db['User'],_0xdbc573,_0x1a0015,_0x1803d7);})); \ No newline at end of file +var _0xd0ea=['salt','role','disabled','blockedAt','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockDuration','add','minutes','clearBlockUser','allowedLoginAttempts','getLicense','catch','email','MailServerOut','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','login','authenticate','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','xCally\x20Motion\x20Password\x20Reset','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','validatePasswordPattern','password','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','Strategy','randomstring','../../components/auth/service','../../config/utils','client','http','findOne','then','name'];(function(_0x264d8e,_0x19ba32){var _0x4e04ee=function(_0x28c532){while(--_0x28c532){_0x264d8e['push'](_0x264d8e['shift']());}};_0x4e04ee(++_0x19ba32);}(_0xd0ea,0xe7));var _0xad0e=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0xd0ea[_0x29dda1];return _0x21b0ef;};'use strict';var util=require(_0xad0e('0x0'));var passport=require(_0xad0e('0x1'));var LocalStrategy=require(_0xad0e('0x2'))[_0xad0e('0x3')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require(_0xad0e('0x4'));var moment=require('moment');var db=require('../../mysqldb')['db'];var authService=require(_0xad0e('0x5'));var utils=require(_0xad0e('0x6'));var client=jayson[_0xad0e('0x7')][_0xad0e('0x8')]({'port':0x232b});function localAuthenticate(_0x1f0d71,_0x3e3e55,_0x22e6b9,_0x201e29){var _0x16bc25,_0x32d8fd;return db['Setting'][_0xad0e('0x9')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0xad0e('0xa')](function(_0x1dd9c7){_0x16bc25=_0x1dd9c7;return _0x1f0d71['findOne']({'attributes':['id',_0xad0e('0xb'),'password',_0xad0e('0xc'),_0xad0e('0xd'),_0xad0e('0xe'),'blocked',_0xad0e('0xf'),_0xad0e('0x10')],'where':{'name':_0x3e3e55,'role':{'$or':['admin',_0xad0e('0x11'),_0xad0e('0x12')]}}});})[_0xad0e('0xa')](function(_0xbed350){if(!_0xbed350||_0xbed350&&_0xbed350[_0xad0e('0xb')]!==_0x3e3e55){throw new Error(_0xad0e('0x13'));}else{_0x32d8fd=_0xbed350;return _0x32d8fd;}})['then'](function(){_0x32d8fd['authenticate'](_0x22e6b9,function(_0x9989bb,_0x840f13){var _0x3b8e27=_0x32d8fd[_0xad0e('0x10')]+0x1;if(_0x9989bb){return _0x201e29(_0x9989bb);}else if(!_0x840f13){if(_0x32d8fd[_0xad0e('0xe')]){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else if(_0x16bc25['allowedLoginAttempts']>0x0){if(_0x32d8fd[_0xad0e('0x14')]){if(_0x16bc25[_0xad0e('0x15')]>0x0){if(moment(_0x32d8fd[_0xad0e('0xf')])[_0xad0e('0x16')](_0x16bc25[_0xad0e('0x15')],_0xad0e('0x17'))>moment()){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else{return utils[_0xad0e('0x18')](_0x32d8fd,_0x3b8e27,![],null)[_0xad0e('0xa')](function(){return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3b8e27>=_0x16bc25[_0xad0e('0x19')]){return utils[_0xad0e('0x18')](_0x32d8fd,0x0,!![],moment())[_0xad0e('0xa')](function(){return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xad0e('0x18')](_0x32d8fd,_0x3b8e27,![],null)[_0xad0e('0xa')](function(){return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x201e29(null,![],{'message':_0xad0e('0x13')});}}else{if(_0x32d8fd[_0xad0e('0xe')]){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else if(_0x16bc25[_0xad0e('0x19')]>0x0){if(_0x32d8fd[_0xad0e('0x14')]){if(_0x16bc25['blockDuration']>0x0){if(moment(_0x32d8fd[_0xad0e('0xf')])['add'](_0x16bc25[_0xad0e('0x15')],'minutes')>moment()){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else{return utils['clearBlockUser'](_0x32d8fd,0x0,![],null)[_0xad0e('0xa')](function(){return utils[_0xad0e('0x1a')](_0x32d8fd);})[_0xad0e('0xa')](function(){return _0x201e29(null,_0x32d8fd);});}}else{return _0x201e29(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xad0e('0x18')](_0x32d8fd,0x0,![],null)[_0xad0e('0xa')](function(){return utils[_0xad0e('0x1a')](_0x32d8fd);})[_0xad0e('0xa')](function(){return _0x201e29(null,_0x32d8fd);})[_0xad0e('0x1b')](function(_0x19b2b3){return _0x201e29(null,![],_0x19b2b3);});}}else{if(_0x32d8fd[_0xad0e('0x14')]){return _0x201e29(null,![],{'message':_0xad0e('0x13')});}else{return utils[_0xad0e('0x1a')](_0x32d8fd)['then'](function(){return _0x201e29(null,_0x32d8fd);});}}}});})[_0xad0e('0x1b')](function(_0x5261db){return _0x201e29(null,![],_0x5261db);});}function sendServiceMail(_0x5710e8){return db['MailAccount']['find']({'where':{'service':!![]},'attributes':['id',_0xad0e('0xb'),_0xad0e('0x1c')],'include':[{'model':db[_0xad0e('0x1d')],'as':'Smtp','include':[{'model':db[_0xad0e('0x1e')],'as':'CloudProvider'}]}]})[_0xad0e('0xa')](function(_0x2ba2da){if(!_0x2ba2da){throw new Error(_0xad0e('0x1f'));}var _0x49bca7=_0x2ba2da[_0xad0e('0x20')]();var _0x377412={'account':_0x49bca7,'message':_[_0xad0e('0x21')]({'from':util['format'](_0xad0e('0x22'),_0x2ba2da[_0xad0e('0xb')],_0x2ba2da[_0xad0e('0x1c')]||_0x2ba2da['Smtp'][_0xad0e('0x11')])},_0x5710e8)};return client[_0xad0e('0x23')](_0xad0e('0x24'),_0x377412);})[_0xad0e('0xa')](function(_0x1a9db6){if(_0x1a9db6[_0xad0e('0x25')]){throw new Error(util[_0xad0e('0x26')](_0xad0e('0x27'),_0x1a9db6['error'][_0xad0e('0x28')]||JSON[_0xad0e('0x29')](_0x1a9db6[_0xad0e('0x25')])));}return!![];});}function handleError(_0x24ee7c,_0x34b901,_0x42005e){return _0x24ee7c['status'](_0x34b901||0x1f4)[_0xad0e('0x2a')]({'message':_0x42005e?_0x42005e[_0xad0e('0x28')]||_0x42005e:''});}exports[_0xad0e('0x2b')]=function(_0x177dbb,_0x45504b,_0x1d8c61){passport[_0xad0e('0x2c')](_0xad0e('0x2d'),function(_0x4cab4f,_0x291c83,_0x2f0937){var _0x2805be=_0x4cab4f||_0x2f0937;if(_0x2805be){return handleError(_0x45504b,0x191,_0x2805be);}if(!_0x291c83){return handleError(_0x45504b,0x194,{'message':_0xad0e('0x2e')});}else{var _0x4ebe9a={'payload':{'id':_0x291c83['id'],'role':_0x291c83[_0xad0e('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0xad0e('0x2f')](_0x4ebe9a)['then'](function(_0x36166a){_0x45504b[_0xad0e('0x30')]({'id':_0x291c83['id'],'token':_0x36166a,'statusCall':'','isAlreadyLogged':_0x291c83[_0xad0e('0x31')]});});}})(_0x177dbb,_0x45504b,_0x1d8c61);};exports['forgot']=function(_0x449210,_0x32ae33){if(!_0x449210[_0xad0e('0x32')][_0xad0e('0x1c')]){return handleError(_0x32ae33,0x1f4,{'message':_0xad0e('0x33')});}var _0xef2c70=rs[_0xad0e('0x34')]();_0x449210[_0xad0e('0x32')]['email']=_0x449210[_0xad0e('0x32')][_0xad0e('0x1c')][_0xad0e('0x35')]()[_0xad0e('0x36')]();var _0xb91e5e;return db[_0xad0e('0x37')][_0xad0e('0x9')]({'where':{'id':0x1},'attributes':[_0xad0e('0x19'),'blockDuration'],'raw':!![]})[_0xad0e('0xa')](function(_0x588111){_0xb91e5e=_0x588111;return db[_0xad0e('0x38')][_0xad0e('0x39')]({'where':{'email':_0x449210['body']['email']}});})[_0xad0e('0xa')](function(_0x4e66bb){if(!_0x4e66bb){throw new Error(_0xad0e('0x3a'));}if(_0x4e66bb[_0xad0e('0xe')]){throw new Error(_0xad0e('0x3b'));}if(_0x4e66bb['blocked']){if(moment(_0x4e66bb['blockedAt'])[_0xad0e('0x16')](_0xb91e5e[_0xad0e('0x15')],_0xad0e('0x17'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4e66bb[_0xad0e('0x14')]=![];_0x4e66bb['blockedAt']=null;}}_0x4e66bb[_0xad0e('0x3c')]=_0xef2c70;_0x4e66bb['resetPasswordExpires']=Date[_0xad0e('0x3d')]()+0x36ee80;return _0x4e66bb['save']();})[_0xad0e('0xa')](function(){return sendServiceMail({'to':_0x449210[_0xad0e('0x32')][_0xad0e('0x1c')],'subject':_0xad0e('0x3e'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x449210[_0xad0e('0x3f')][_0xad0e('0x40')]+_0xad0e('0x41')+_0xef2c70+'\x0a\x0a'+_0xad0e('0x42')});})[_0xad0e('0xa')](function(){_0x32ae33[_0xad0e('0x43')](0xc8)[_0xad0e('0x2a')]({'message':'Reset\x20Email\x20sent!'});})[_0xad0e('0x1b')](function(_0x42d322){return handleError(_0x32ae33,0x1f4,_0x42d322);});};exports['reset']=function(_0x184a7b,_0x407b92){return db['User'][_0xad0e('0x39')]({'where':{'resetPasswordToken':_0x184a7b[_0xad0e('0x44')][_0xad0e('0x45')],'resetPasswordExpires':{'$gt':Date[_0xad0e('0x3d')]()}}})[_0xad0e('0xa')](function(_0xcc8e83){if(!_0xcc8e83){throw new Error(_0xad0e('0x46'));}return db[_0xad0e('0x37')]['findOne']({'attributes':['id',_0xad0e('0x47'),'enforcePasswordHistory',_0xad0e('0x48')]})[_0xad0e('0xa')](function(_0x314e9e){if(_0x314e9e[_0xad0e('0x47')])authService[_0xad0e('0x49')](_0x184a7b['body'][_0xad0e('0x4a')]);if(!_0x314e9e[_0xad0e('0x4b')]||!_0xcc8e83[_0xad0e('0x4c')])return _0xcc8e83;authService[_0xad0e('0x4d')](_0x184a7b[_0xad0e('0x32')]['password'],_0xcc8e83['previousPasswords'],_0x314e9e[_0xad0e('0x48')]);return _0xcc8e83;})['then'](function(){_0xcc8e83['password']=_0x184a7b['body'][_0xad0e('0x4a')];_0xcc8e83['resetPasswordToken']=null;_0xcc8e83[_0xad0e('0x4e')]=null;return _0xcc8e83['save']();});})['then'](function(){_0x407b92[_0xad0e('0x43')](0xc8)[_0xad0e('0x2a')]({'message':_0xad0e('0x4f')});})[_0xad0e('0x1b')](function(_0x576c2a){return handleError(_0x407b92,0x1f4,_0x576c2a);});};passport[_0xad0e('0x50')](_0xad0e('0x2d'),new LocalStrategy({'usernameField':_0xad0e('0xb'),'passwordField':'password'},function(_0x4d36bd,_0x3ddd08,_0x2bcc77){return localAuthenticate(db['User'],_0x4d36bd,_0x3ddd08,_0x2bcc77);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 0345e77..83737e9 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 _0x5c67=['/forgot','forgot','exports','express','Router','./authLocal.controller','post','login'];(function(_0x50ea7f,_0x5322bd){var _0x4aab5a=function(_0x4b9517){while(--_0x4b9517){_0x50ea7f['push'](_0x50ea7f['shift']());}};_0x4aab5a(++_0x5322bd);}(_0x5c67,0x173));var _0x75c6=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x5c67[_0x397e5f];return _0x5302b8;};'use strict';var express=require(_0x75c6('0x0'));var router=express[_0x75c6('0x1')]();var controller=require(_0x75c6('0x2'));router[_0x75c6('0x3')]('/',controller[_0x75c6('0x4')]);router[_0x75c6('0x3')](_0x75c6('0x5'),controller[_0x75c6('0x6')]);router[_0x75c6('0x3')]('/reset/:token',controller['reset']);module[_0x75c6('0x7')]=router; \ No newline at end of file +var _0x83f6=['forgot','/reset/:token','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0x8c1005,_0x1f3f16){var _0x175354=function(_0xd0e9c4){while(--_0xd0e9c4){_0x8c1005['push'](_0x8c1005['shift']());}};_0x175354(++_0x1f3f16);}(_0x83f6,0x17b));var _0x683f=function(_0x870b62,_0x2143f9){_0x870b62=_0x870b62-0x0;var _0x2dcb39=_0x83f6[_0x870b62];return _0x2dcb39;};'use strict';var express=require(_0x683f('0x0'));var router=express[_0x683f('0x1')]();var controller=require(_0x683f('0x2'));router[_0x683f('0x3')]('/',controller['login']);router[_0x683f('0x3')](_0x683f('0x4'),controller[_0x683f('0x5')]);router[_0x683f('0x3')](_0x683f('0x6'),controller['reset']);module[_0x683f('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 971d553..7a3e80b 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 _0x4860=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4860,0x1bf));var _0x0486=function(_0x269e7d,_0x88b7f8){_0x269e7d=_0x269e7d-0x0;var _0x4fc9f2=_0x4860[_0x269e7d];return _0x4fc9f2;};'use strict';var Sequelize=require(_0x0486('0x0'));module[_0x0486('0x1')]={'name':{'type':Sequelize[_0x0486('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0486('0x2')]},'description':{'type':Sequelize[_0x0486('0x2')]},'status':{'type':Sequelize[_0x0486('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0486('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3a50=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x313df1,_0x5e46df){var _0x20ecb5=function(_0x45a453){while(--_0x45a453){_0x313df1['push'](_0x313df1['shift']());}};_0x20ecb5(++_0x5e46df);}(_0x3a50,0x18f));var _0x03a5=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x3a50[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x03a5('0x0'));module[_0x03a5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x03a5('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x03a5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x03a5('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 29317cb..4ac54ee 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 _0xee87=['sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','addConditions','Condition','ids','getConditions','addActions','Action','omit','getActions','findOne','keys','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','Content-Range','save','update','then','sendStatus','error','stack','name','send','index','map','Automation','rawAttributes','fieldName','key','model','query','intersection','fields','length','attributes','hasOwnProperty','nolimit','order'];(function(_0x26f081,_0x4277f3){var _0x4bf032=function(_0x1e49d8){while(--_0x1e49d8){_0x26f081['push'](_0x26f081['shift']());}};_0x4bf032(++_0x4277f3);}(_0xee87,0x17a));var _0x7ee8=function(_0x3cdac1,_0x57c6eb){_0x3cdac1=_0x3cdac1-0x0;var _0x2e7a09=_0xee87[_0x3cdac1];return _0x2e7a09;};'use strict';var emlformat=require(_0x7ee8('0x0'));var rimraf=require(_0x7ee8('0x1'));var zipdir=require(_0x7ee8('0x2'));var jsonpatch=require(_0x7ee8('0x3'));var rp=require(_0x7ee8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7ee8('0x5'));var util=require(_0x7ee8('0x6'));var path=require(_0x7ee8('0x7'));var sox=require(_0x7ee8('0x8'));var csv=require(_0x7ee8('0x9'));var ejs=require(_0x7ee8('0xa'));var fs=require('fs');var fs_extra=require(_0x7ee8('0xb'));var _=require(_0x7ee8('0xc'));var squel=require(_0x7ee8('0xd'));var crypto=require(_0x7ee8('0xe'));var jsforce=require(_0x7ee8('0xf'));var deskjs=require(_0x7ee8('0x10'));var toCsv=require(_0x7ee8('0x9'));var querystring=require(_0x7ee8('0x11'));var Papa=require(_0x7ee8('0x12'));var Redis=require(_0x7ee8('0x13'));var authService=require(_0x7ee8('0x14'));var qs=require(_0x7ee8('0x15'));var as=require(_0x7ee8('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7ee8('0x17'));var utils=require(_0x7ee8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7ee8('0x19'));var db=require(_0x7ee8('0x1a'))['db'];function respondWithStatusCode(_0x28e51e,_0x2fc833){_0x2fc833=_0x2fc833||0xcc;return function(_0x558093){if(_0x558093){return _0x28e51e['sendStatus'](_0x2fc833);}return _0x28e51e[_0x7ee8('0x1b')](_0x2fc833)[_0x7ee8('0x1c')]();};}function respondWithResult(_0x3d275c,_0x1f4132){_0x1f4132=_0x1f4132||0xc8;return function(_0x143af9){if(_0x143af9){return _0x3d275c[_0x7ee8('0x1b')](_0x1f4132)[_0x7ee8('0x1d')](_0x143af9);}};}function respondWithFilteredResult(_0x37a00e,_0x4eecd5){return function(_0x5cab2c){if(_0x5cab2c){var _0x12c5ac=typeof _0x4eecd5[_0x7ee8('0x1e')]==='undefined'&&typeof _0x4eecd5[_0x7ee8('0x1f')]==='undefined';var _0x4be85f=_0x5cab2c[_0x7ee8('0x20')];var _0x16e536=_0x12c5ac?0x0:_0x4eecd5[_0x7ee8('0x1e')];var _0x367bd3=_0x12c5ac?_0x5cab2c['count']:_0x4eecd5['offset']+_0x4eecd5['limit'];var _0x32c8f0;if(_0x367bd3>=_0x4be85f){_0x367bd3=_0x4be85f;_0x32c8f0=0xc8;}else{_0x32c8f0=0xce;}_0x37a00e[_0x7ee8('0x1b')](_0x32c8f0);return _0x37a00e['set'](_0x7ee8('0x21'),_0x16e536+'-'+_0x367bd3+'/'+_0x4be85f)[_0x7ee8('0x1d')](_0x5cab2c);}return null;};}function patchUpdates(_0x3a915c){return function(_0x867e22){try{jsonpatch['apply'](_0x867e22,_0x3a915c,!![]);}catch(_0x22279e){return BPromise['reject'](_0x22279e);}return _0x867e22[_0x7ee8('0x22')]();};}function saveUpdates(_0x3c1c1f,_0x480d32){return function(_0x2644eb){if(_0x2644eb){return _0x2644eb[_0x7ee8('0x23')](_0x3c1c1f)[_0x7ee8('0x24')](function(_0x432925){return _0x432925;});}return null;};}function removeEntity(_0x5d8818,_0x1da333){return function(_0x5ed31a){if(_0x5ed31a){return _0x5ed31a['destroy']()['then'](function(){_0x5d8818[_0x7ee8('0x1b')](0xcc)[_0x7ee8('0x1c')]();});}};}function handleEntityNotFound(_0x336539,_0x34eb01){return function(_0x35d3cd){if(!_0x35d3cd){_0x336539[_0x7ee8('0x25')](0x194);}return _0x35d3cd;};}function handleError(_0x524af7,_0x3f89d5){_0x3f89d5=_0x3f89d5||0x1f4;return function(_0x549517){logger[_0x7ee8('0x26')](_0x549517[_0x7ee8('0x27')]);if(_0x549517[_0x7ee8('0x28')]){delete _0x549517[_0x7ee8('0x28')];}_0x524af7[_0x7ee8('0x1b')](_0x3f89d5)[_0x7ee8('0x29')](_0x549517);};}exports[_0x7ee8('0x2a')]=function(_0x708b77,_0x42cb86){var _0x7416de={},_0x359394={},_0x1ca5e5={'count':0x0,'rows':[]};var _0x347729=_[_0x7ee8('0x2b')](db[_0x7ee8('0x2c')][_0x7ee8('0x2d')],function(_0x4aea4e){return{'name':_0x4aea4e[_0x7ee8('0x2e')],'type':_0x4aea4e['type'][_0x7ee8('0x2f')]};});_0x359394[_0x7ee8('0x30')]=_[_0x7ee8('0x2b')](_0x347729,_0x7ee8('0x28'));_0x359394[_0x7ee8('0x31')]=_['keys'](_0x708b77['query']);_0x359394['filters']=_[_0x7ee8('0x32')](_0x359394[_0x7ee8('0x30')],_0x359394[_0x7ee8('0x31')]);_0x7416de['attributes']=_[_0x7ee8('0x32')](_0x359394[_0x7ee8('0x30')],qs[_0x7ee8('0x33')](_0x708b77[_0x7ee8('0x31')]['fields']));_0x7416de['attributes']=_0x7416de['attributes'][_0x7ee8('0x34')]?_0x7416de[_0x7ee8('0x35')]:_0x359394[_0x7ee8('0x30')];if(!_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x36')](_0x7ee8('0x37'))){_0x7416de[_0x7ee8('0x1f')]=qs[_0x7ee8('0x1f')](_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x1f')]);_0x7416de[_0x7ee8('0x1e')]=qs[_0x7ee8('0x1e')](_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x1e')]);}_0x7416de[_0x7ee8('0x38')]=qs['sort'](_0x708b77['query'][_0x7ee8('0x39')]);_0x7416de[_0x7ee8('0x3a')]=qs[_0x7ee8('0x3b')](_[_0x7ee8('0x3c')](_0x708b77[_0x7ee8('0x31')],_0x359394[_0x7ee8('0x3b')]),_0x347729);if(_0x708b77[_0x7ee8('0x31')]['filter']){_0x7416de['where']=_[_0x7ee8('0x3d')](_0x7416de[_0x7ee8('0x3a')],{'$or':_[_0x7ee8('0x2b')](_0x347729,function(_0x4a27f5){if(_0x4a27f5[_0x7ee8('0x3e')]!==_0x7ee8('0x3f')){var _0x3cd395={};_0x3cd395[_0x4a27f5[_0x7ee8('0x28')]]={'$like':'%'+_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x40')]+'%'};return _0x3cd395;}})});}_0x7416de=_[_0x7ee8('0x3d')]({},_0x7416de,_0x708b77[_0x7ee8('0x41')]);var _0x410a39={'where':_0x7416de[_0x7ee8('0x3a')]};return db[_0x7ee8('0x2c')][_0x7ee8('0x20')](_0x410a39)[_0x7ee8('0x24')](function(_0xc22c0){_0x1ca5e5[_0x7ee8('0x20')]=_0xc22c0;if(_0x708b77[_0x7ee8('0x31')][_0x7ee8('0x42')]){_0x7416de[_0x7ee8('0x43')]=[{'all':!![]}];}return db[_0x7ee8('0x2c')][_0x7ee8('0x44')](_0x7416de);})[_0x7ee8('0x24')](function(_0x4e9164){_0x1ca5e5[_0x7ee8('0x45')]=_0x4e9164;return _0x1ca5e5;})[_0x7ee8('0x24')](respondWithFilteredResult(_0x42cb86,_0x7416de))[_0x7ee8('0x46')](handleError(_0x42cb86,null));};exports[_0x7ee8('0x47')]=function(_0x3a30eb,_0x27f66f){var _0x37e24f={'raw':![],'where':{'id':_0x3a30eb[_0x7ee8('0x48')]['id']}},_0x21cc0a={};_0x21cc0a[_0x7ee8('0x30')]=_['keys'](db[_0x7ee8('0x2c')][_0x7ee8('0x2d')]);_0x21cc0a['query']=_['keys'](_0x3a30eb[_0x7ee8('0x31')]);_0x21cc0a[_0x7ee8('0x3b')]=_[_0x7ee8('0x32')](_0x21cc0a[_0x7ee8('0x30')],_0x21cc0a[_0x7ee8('0x31')]);_0x37e24f[_0x7ee8('0x35')]=_[_0x7ee8('0x32')](_0x21cc0a['model'],qs['fields'](_0x3a30eb[_0x7ee8('0x31')][_0x7ee8('0x33')]));_0x37e24f[_0x7ee8('0x35')]=_0x37e24f['attributes']['length']?_0x37e24f[_0x7ee8('0x35')]:_0x21cc0a[_0x7ee8('0x30')];if(_0x3a30eb[_0x7ee8('0x31')][_0x7ee8('0x42')]){_0x37e24f[_0x7ee8('0x43')]=[{'all':!![]}];}_0x37e24f=_[_0x7ee8('0x3d')]({},_0x37e24f,_0x3a30eb['options']);return db[_0x7ee8('0x2c')][_0x7ee8('0x49')](_0x37e24f)[_0x7ee8('0x24')](handleEntityNotFound(_0x27f66f,null))['then'](respondWithResult(_0x27f66f,null))[_0x7ee8('0x46')](handleError(_0x27f66f,null));};exports[_0x7ee8('0x4a')]=function(_0x5caa07,_0x52bac1){return db[_0x7ee8('0x2c')][_0x7ee8('0x4a')](_0x5caa07[_0x7ee8('0x4b')],{})[_0x7ee8('0x24')](respondWithResult(_0x52bac1,0xc9))[_0x7ee8('0x46')](handleError(_0x52bac1,null));};exports[_0x7ee8('0x23')]=function(_0x94bd6e,_0x447737){if(_0x94bd6e[_0x7ee8('0x4b')]['id']){delete _0x94bd6e[_0x7ee8('0x4b')]['id'];}return db[_0x7ee8('0x2c')][_0x7ee8('0x49')]({'where':{'id':_0x94bd6e['params']['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x447737,null))[_0x7ee8('0x24')](saveUpdates(_0x94bd6e[_0x7ee8('0x4b')],null))['then'](respondWithResult(_0x447737,null))[_0x7ee8('0x46')](handleError(_0x447737,null));};exports[_0x7ee8('0x4c')]=function(_0x69fdd0,_0x4c1132){return db[_0x7ee8('0x2c')][_0x7ee8('0x49')]({'where':{'id':_0x69fdd0[_0x7ee8('0x48')]['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x4c1132,null))[_0x7ee8('0x24')](removeEntity(_0x4c1132,null))['catch'](handleError(_0x4c1132,null));};exports[_0x7ee8('0x4d')]=function(_0x300eb7,_0x2cd750,_0xf8844a){return db[_0x7ee8('0x4e')][_0x7ee8('0x49')]({'where':{'id':_0x300eb7[_0x7ee8('0x48')]['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x2cd750,null))['then'](function(_0x5b8e3e){if(_0x5b8e3e){return _0x5b8e3e['addConditions'](_0x300eb7[_0x7ee8('0x4b')][_0x7ee8('0x4f')],_['omit'](_0x300eb7[_0x7ee8('0x4b')],['ids','id'])||{});}})[_0x7ee8('0x24')](respondWithResult(_0x2cd750,null))['catch'](handleError(_0x2cd750,null));};exports[_0x7ee8('0x50')]=function(_0x4fbce9,_0x40fb6d,_0x326dbe){var _0x488520={};var _0xf34b78={};var _0x103ac5;var _0x464939;return db[_0x7ee8('0x2c')]['findOne']({'where':{'id':_0x4fbce9['params']['id']}})['then'](handleEntityNotFound(_0x40fb6d,null))['then'](function(_0x16e1ec){if(_0x16e1ec){_0x103ac5=_0x16e1ec;_0xf34b78[_0x7ee8('0x30')]=_['keys'](db[_0x7ee8('0x4e')][_0x7ee8('0x2d')]);_0xf34b78[_0x7ee8('0x31')]=_['keys'](_0x4fbce9[_0x7ee8('0x31')]);_0xf34b78[_0x7ee8('0x3b')]=_[_0x7ee8('0x32')](_0xf34b78[_0x7ee8('0x30')],_0xf34b78[_0x7ee8('0x31')]);_0x488520[_0x7ee8('0x35')]=_['intersection'](_0xf34b78[_0x7ee8('0x30')],qs[_0x7ee8('0x33')](_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x33')]));_0x488520[_0x7ee8('0x35')]=_0x488520['attributes'][_0x7ee8('0x34')]?_0x488520[_0x7ee8('0x35')]:_0xf34b78[_0x7ee8('0x30')];_0x488520['order']=qs[_0x7ee8('0x39')](_0x4fbce9['query'][_0x7ee8('0x39')]);_0x488520['where']=qs['filters'](_[_0x7ee8('0x3c')](_0x4fbce9[_0x7ee8('0x31')],_0xf34b78[_0x7ee8('0x3b')]));if(_0x4fbce9['query'][_0x7ee8('0x40')]){_0x488520[_0x7ee8('0x3a')]=_[_0x7ee8('0x3d')](_0x488520['where'],{'$or':_['map'](_0x488520['attributes'],function(_0x3de67b){var _0x26bfd2={};_0x26bfd2[_0x3de67b]={'$like':'%'+_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x40')]+'%'};return _0x26bfd2;})});}_0x488520=_['merge']({},_0x488520,_0x4fbce9[_0x7ee8('0x41')]);return _0x103ac5['getConditions'](_0x488520);}})[_0x7ee8('0x24')](function(_0x3b01ab){if(_0x3b01ab){_0x464939=_0x3b01ab[_0x7ee8('0x34')];if(!_0x4fbce9[_0x7ee8('0x31')]['hasOwnProperty'](_0x7ee8('0x37'))){_0x488520[_0x7ee8('0x1f')]=qs[_0x7ee8('0x1f')](_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x1f')]);_0x488520[_0x7ee8('0x1e')]=qs['offset'](_0x4fbce9[_0x7ee8('0x31')][_0x7ee8('0x1e')]);}return _0x103ac5['getConditions'](_0x488520);}})['then'](function(_0x2b7887){if(_0x2b7887){return _0x2b7887?{'count':_0x464939,'rows':_0x2b7887}:null;}})[_0x7ee8('0x24')](respondWithResult(_0x40fb6d,null))['catch'](handleError(_0x40fb6d,null));};exports[_0x7ee8('0x51')]=function(_0x2d957d,_0x12c513,_0x1c31ce){return db[_0x7ee8('0x52')][_0x7ee8('0x49')]({'where':{'id':_0x2d957d[_0x7ee8('0x48')]['id']}})[_0x7ee8('0x24')](handleEntityNotFound(_0x12c513,null))[_0x7ee8('0x24')](function(_0x58cf9d){if(_0x58cf9d){return _0x58cf9d[_0x7ee8('0x51')](_0x2d957d[_0x7ee8('0x4b')][_0x7ee8('0x4f')],_[_0x7ee8('0x53')](_0x2d957d[_0x7ee8('0x4b')],[_0x7ee8('0x4f'),'id'])||{});}})[_0x7ee8('0x24')](respondWithResult(_0x12c513,null))[_0x7ee8('0x46')](handleError(_0x12c513,null));};exports[_0x7ee8('0x54')]=function(_0x4cbf7f,_0x1aabcc,_0xd75c97){var _0x2d81b1={};var _0x421c7b={};var _0x185d6d;var _0x206a45;return db[_0x7ee8('0x2c')][_0x7ee8('0x55')]({'where':{'id':_0x4cbf7f[_0x7ee8('0x48')]['id']}})['then'](handleEntityNotFound(_0x1aabcc,null))[_0x7ee8('0x24')](function(_0x18d3d8){if(_0x18d3d8){_0x185d6d=_0x18d3d8;_0x421c7b[_0x7ee8('0x30')]=_['keys'](db[_0x7ee8('0x52')][_0x7ee8('0x2d')]);_0x421c7b['query']=_[_0x7ee8('0x56')](_0x4cbf7f[_0x7ee8('0x31')]);_0x421c7b['filters']=_[_0x7ee8('0x32')](_0x421c7b[_0x7ee8('0x30')],_0x421c7b['query']);_0x2d81b1[_0x7ee8('0x35')]=_[_0x7ee8('0x32')](_0x421c7b[_0x7ee8('0x30')],qs[_0x7ee8('0x33')](_0x4cbf7f[_0x7ee8('0x31')]['fields']));_0x2d81b1['attributes']=_0x2d81b1[_0x7ee8('0x35')][_0x7ee8('0x34')]?_0x2d81b1[_0x7ee8('0x35')]:_0x421c7b[_0x7ee8('0x30')];_0x2d81b1['order']=qs[_0x7ee8('0x39')](_0x4cbf7f[_0x7ee8('0x31')][_0x7ee8('0x39')]);_0x2d81b1[_0x7ee8('0x3a')]=qs[_0x7ee8('0x3b')](_[_0x7ee8('0x3c')](_0x4cbf7f[_0x7ee8('0x31')],_0x421c7b[_0x7ee8('0x3b')]));if(_0x4cbf7f['query'][_0x7ee8('0x40')]){_0x2d81b1[_0x7ee8('0x3a')]=_[_0x7ee8('0x3d')](_0x2d81b1['where'],{'$or':_['map'](_0x2d81b1['attributes'],function(_0x52813c){var _0x467ec6={};_0x467ec6[_0x52813c]={'$like':'%'+_0x4cbf7f[_0x7ee8('0x31')]['filter']+'%'};return _0x467ec6;})});}_0x2d81b1=_[_0x7ee8('0x3d')]({},_0x2d81b1,_0x4cbf7f[_0x7ee8('0x41')]);return _0x185d6d['getActions'](_0x2d81b1);}})[_0x7ee8('0x24')](function(_0x4c646a){if(_0x4c646a){_0x206a45=_0x4c646a['length'];if(!_0x4cbf7f[_0x7ee8('0x31')][_0x7ee8('0x36')]('nolimit')){_0x2d81b1['limit']=qs[_0x7ee8('0x1f')](_0x4cbf7f['query'][_0x7ee8('0x1f')]);_0x2d81b1[_0x7ee8('0x1e')]=qs[_0x7ee8('0x1e')](_0x4cbf7f[_0x7ee8('0x31')][_0x7ee8('0x1e')]);}return _0x185d6d['getActions'](_0x2d81b1);}})['then'](function(_0x281d2a){if(_0x281d2a){return _0x281d2a?{'count':_0x206a45,'rows':_0x281d2a}:null;}})[_0x7ee8('0x24')](respondWithResult(_0x1aabcc,null))['catch'](handleError(_0x1aabcc,null));}; \ No newline at end of file +var _0x3c20=['include','findAll','rows','catch','show','params','keys','create','body','Condition','ids','omit','findOne','filter','getConditions','addActions','Action','find','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','name','map','Automation','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll'];(function(_0x44268d,_0xad8443){var _0x4be92d=function(_0x8a57ff){while(--_0x8a57ff){_0x44268d['push'](_0x44268d['shift']());}};_0x4be92d(++_0xad8443);}(_0x3c20,0x66));var _0x03c2=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3c20[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x03c2('0x0'));var rimraf=require(_0x03c2('0x1'));var zipdir=require(_0x03c2('0x2'));var jsonpatch=require(_0x03c2('0x3'));var rp=require(_0x03c2('0x4'));var moment=require(_0x03c2('0x5'));var BPromise=require(_0x03c2('0x6'));var Mustache=require(_0x03c2('0x7'));var util=require(_0x03c2('0x8'));var path=require('path');var sox=require(_0x03c2('0x9'));var csv=require('to-csv');var ejs=require(_0x03c2('0xa'));var fs=require('fs');var fs_extra=require(_0x03c2('0xb'));var _=require(_0x03c2('0xc'));var squel=require('squel');var crypto=require(_0x03c2('0xd'));var jsforce=require(_0x03c2('0xe'));var deskjs=require(_0x03c2('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x03c2('0x10'));var Redis=require(_0x03c2('0x11'));var authService=require(_0x03c2('0x12'));var qs=require(_0x03c2('0x13'));var as=require(_0x03c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x03c2('0x15'))(_0x03c2('0x16'));var utils=require(_0x03c2('0x17'));var config=require(_0x03c2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x03c2('0x19'))['db'];function respondWithStatusCode(_0x36afd5,_0x81c504){_0x81c504=_0x81c504||0xcc;return function(_0x373343){if(_0x373343){return _0x36afd5[_0x03c2('0x1a')](_0x81c504);}return _0x36afd5[_0x03c2('0x1b')](_0x81c504)[_0x03c2('0x1c')]();};}function respondWithResult(_0x42ea50,_0x15d9ef){_0x15d9ef=_0x15d9ef||0xc8;return function(_0x560525){if(_0x560525){return _0x42ea50[_0x03c2('0x1b')](_0x15d9ef)[_0x03c2('0x1d')](_0x560525);}};}function respondWithFilteredResult(_0x13f525,_0x5c4e64){return function(_0x5cd51f){if(_0x5cd51f){var _0x1f600e=typeof _0x5c4e64[_0x03c2('0x1e')]===_0x03c2('0x1f')&&typeof _0x5c4e64[_0x03c2('0x20')]===_0x03c2('0x1f');var _0x3d733c=_0x5cd51f[_0x03c2('0x21')];var _0x3c8568=_0x1f600e?0x0:_0x5c4e64[_0x03c2('0x1e')];var _0xd12cd=_0x1f600e?_0x5cd51f[_0x03c2('0x21')]:_0x5c4e64['offset']+_0x5c4e64[_0x03c2('0x20')];var _0x382bf7;if(_0xd12cd>=_0x3d733c){_0xd12cd=_0x3d733c;_0x382bf7=0xc8;}else{_0x382bf7=0xce;}_0x13f525[_0x03c2('0x1b')](_0x382bf7);return _0x13f525['set'](_0x03c2('0x22'),_0x3c8568+'-'+_0xd12cd+'/'+_0x3d733c)[_0x03c2('0x1d')](_0x5cd51f);}return null;};}function patchUpdates(_0x3e6fb1){return function(_0x383037){try{jsonpatch[_0x03c2('0x23')](_0x383037,_0x3e6fb1,!![]);}catch(_0x47a700){return BPromise[_0x03c2('0x24')](_0x47a700);}return _0x383037['save']();};}function saveUpdates(_0x2ce82b,_0x43274d){return function(_0x102adc){if(_0x102adc){return _0x102adc[_0x03c2('0x25')](_0x2ce82b)[_0x03c2('0x26')](function(_0x347af2){return _0x347af2;});}return null;};}function removeEntity(_0x238e07,_0x590c6b){return function(_0x1a0061){if(_0x1a0061){return _0x1a0061[_0x03c2('0x27')]()[_0x03c2('0x26')](function(){_0x238e07[_0x03c2('0x1b')](0xcc)[_0x03c2('0x1c')]();});}};}function handleEntityNotFound(_0x4b7f18,_0x3b1b69){return function(_0x4532dd){if(!_0x4532dd){_0x4b7f18[_0x03c2('0x1a')](0x194);}return _0x4532dd;};}function handleError(_0x117f72,_0x4fae76){_0x4fae76=_0x4fae76||0x1f4;return function(_0x5ea7be){logger[_0x03c2('0x28')](_0x5ea7be['stack']);if(_0x5ea7be[_0x03c2('0x29')]){delete _0x5ea7be[_0x03c2('0x29')];}_0x117f72['status'](_0x4fae76)['send'](_0x5ea7be);};}exports['index']=function(_0xe5ae38,_0x20d7a3){var _0x20d032={},_0x2d4742={},_0x323711={'count':0x0,'rows':[]};var _0x9387b8=_[_0x03c2('0x2a')](db[_0x03c2('0x2b')][_0x03c2('0x2c')],function(_0x1e7884){return{'name':_0x1e7884['fieldName'],'type':_0x1e7884[_0x03c2('0x2d')][_0x03c2('0x2e')]};});_0x2d4742[_0x03c2('0x2f')]=_[_0x03c2('0x2a')](_0x9387b8,'name');_0x2d4742[_0x03c2('0x30')]=_['keys'](_0xe5ae38[_0x03c2('0x30')]);_0x2d4742[_0x03c2('0x31')]=_[_0x03c2('0x32')](_0x2d4742[_0x03c2('0x2f')],_0x2d4742[_0x03c2('0x30')]);_0x20d032[_0x03c2('0x33')]=_[_0x03c2('0x32')](_0x2d4742[_0x03c2('0x2f')],qs[_0x03c2('0x34')](_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x34')]));_0x20d032[_0x03c2('0x33')]=_0x20d032[_0x03c2('0x33')][_0x03c2('0x35')]?_0x20d032[_0x03c2('0x33')]:_0x2d4742['model'];if(!_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x36')](_0x03c2('0x37'))){_0x20d032[_0x03c2('0x20')]=qs[_0x03c2('0x20')](_0xe5ae38[_0x03c2('0x30')]['limit']);_0x20d032[_0x03c2('0x1e')]=qs[_0x03c2('0x1e')](_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x1e')]);}_0x20d032[_0x03c2('0x38')]=qs[_0x03c2('0x39')](_0xe5ae38['query']['sort']);_0x20d032[_0x03c2('0x3a')]=qs[_0x03c2('0x31')](_[_0x03c2('0x3b')](_0xe5ae38[_0x03c2('0x30')],_0x2d4742[_0x03c2('0x31')]),_0x9387b8);if(_0xe5ae38[_0x03c2('0x30')]['filter']){_0x20d032[_0x03c2('0x3a')]=_['merge'](_0x20d032[_0x03c2('0x3a')],{'$or':_['map'](_0x9387b8,function(_0x5be70a){if(_0x5be70a[_0x03c2('0x2d')]!==_0x03c2('0x3c')){var _0x50a76c={};_0x50a76c[_0x5be70a[_0x03c2('0x29')]]={'$like':'%'+_0xe5ae38[_0x03c2('0x30')]['filter']+'%'};return _0x50a76c;}})});}_0x20d032=_[_0x03c2('0x3d')]({},_0x20d032,_0xe5ae38[_0x03c2('0x3e')]);var _0x188a42={'where':_0x20d032[_0x03c2('0x3a')]};return db[_0x03c2('0x2b')][_0x03c2('0x21')](_0x188a42)[_0x03c2('0x26')](function(_0x560dc0){_0x323711['count']=_0x560dc0;if(_0xe5ae38[_0x03c2('0x30')][_0x03c2('0x3f')]){_0x20d032[_0x03c2('0x40')]=[{'all':!![]}];}return db[_0x03c2('0x2b')][_0x03c2('0x41')](_0x20d032);})['then'](function(_0x54c807){_0x323711[_0x03c2('0x42')]=_0x54c807;return _0x323711;})[_0x03c2('0x26')](respondWithFilteredResult(_0x20d7a3,_0x20d032))[_0x03c2('0x43')](handleError(_0x20d7a3,null));};exports[_0x03c2('0x44')]=function(_0x94cb72,_0x3d8517){var _0x1ec097={'raw':![],'where':{'id':_0x94cb72[_0x03c2('0x45')]['id']}},_0x17252f={};_0x17252f[_0x03c2('0x2f')]=_[_0x03c2('0x46')](db[_0x03c2('0x2b')][_0x03c2('0x2c')]);_0x17252f[_0x03c2('0x30')]=_[_0x03c2('0x46')](_0x94cb72[_0x03c2('0x30')]);_0x17252f[_0x03c2('0x31')]=_['intersection'](_0x17252f['model'],_0x17252f[_0x03c2('0x30')]);_0x1ec097[_0x03c2('0x33')]=_[_0x03c2('0x32')](_0x17252f[_0x03c2('0x2f')],qs[_0x03c2('0x34')](_0x94cb72[_0x03c2('0x30')]['fields']));_0x1ec097['attributes']=_0x1ec097[_0x03c2('0x33')][_0x03c2('0x35')]?_0x1ec097[_0x03c2('0x33')]:_0x17252f[_0x03c2('0x2f')];if(_0x94cb72[_0x03c2('0x30')][_0x03c2('0x3f')]){_0x1ec097[_0x03c2('0x40')]=[{'all':!![]}];}_0x1ec097=_['merge']({},_0x1ec097,_0x94cb72['options']);return db[_0x03c2('0x2b')]['find'](_0x1ec097)[_0x03c2('0x26')](handleEntityNotFound(_0x3d8517,null))[_0x03c2('0x26')](respondWithResult(_0x3d8517,null))[_0x03c2('0x43')](handleError(_0x3d8517,null));};exports[_0x03c2('0x47')]=function(_0x5409a9,_0x18af52){return db['Automation'][_0x03c2('0x47')](_0x5409a9['body'],{})[_0x03c2('0x26')](respondWithResult(_0x18af52,0xc9))['catch'](handleError(_0x18af52,null));};exports[_0x03c2('0x25')]=function(_0x84daba,_0xb4e4c0){if(_0x84daba[_0x03c2('0x48')]['id']){delete _0x84daba[_0x03c2('0x48')]['id'];}return db[_0x03c2('0x2b')]['find']({'where':{'id':_0x84daba['params']['id']}})[_0x03c2('0x26')](handleEntityNotFound(_0xb4e4c0,null))[_0x03c2('0x26')](saveUpdates(_0x84daba[_0x03c2('0x48')],null))['then'](respondWithResult(_0xb4e4c0,null))['catch'](handleError(_0xb4e4c0,null));};exports[_0x03c2('0x27')]=function(_0x361b55,_0x2667a3){return db[_0x03c2('0x2b')]['find']({'where':{'id':_0x361b55[_0x03c2('0x45')]['id']}})[_0x03c2('0x26')](handleEntityNotFound(_0x2667a3,null))['then'](removeEntity(_0x2667a3,null))[_0x03c2('0x43')](handleError(_0x2667a3,null));};exports['addConditions']=function(_0x22644b,_0x5e6ef5,_0x2353c5){return db[_0x03c2('0x49')]['find']({'where':{'id':_0x22644b['params']['id']}})['then'](handleEntityNotFound(_0x5e6ef5,null))[_0x03c2('0x26')](function(_0x3072a9){if(_0x3072a9){return _0x3072a9['addConditions'](_0x22644b[_0x03c2('0x48')][_0x03c2('0x4a')],_[_0x03c2('0x4b')](_0x22644b[_0x03c2('0x48')],['ids','id'])||{});}})['then'](respondWithResult(_0x5e6ef5,null))['catch'](handleError(_0x5e6ef5,null));};exports['getConditions']=function(_0x581688,_0x2a1129,_0x233643){var _0x148279={};var _0x2efadc={};var _0x3df497;var _0x215ab9;return db[_0x03c2('0x2b')][_0x03c2('0x4c')]({'where':{'id':_0x581688[_0x03c2('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a1129,null))[_0x03c2('0x26')](function(_0x5cf33d){if(_0x5cf33d){_0x3df497=_0x5cf33d;_0x2efadc['model']=_['keys'](db[_0x03c2('0x49')]['rawAttributes']);_0x2efadc[_0x03c2('0x30')]=_[_0x03c2('0x46')](_0x581688[_0x03c2('0x30')]);_0x2efadc['filters']=_[_0x03c2('0x32')](_0x2efadc[_0x03c2('0x2f')],_0x2efadc[_0x03c2('0x30')]);_0x148279['attributes']=_[_0x03c2('0x32')](_0x2efadc[_0x03c2('0x2f')],qs['fields'](_0x581688[_0x03c2('0x30')][_0x03c2('0x34')]));_0x148279[_0x03c2('0x33')]=_0x148279[_0x03c2('0x33')][_0x03c2('0x35')]?_0x148279[_0x03c2('0x33')]:_0x2efadc[_0x03c2('0x2f')];_0x148279[_0x03c2('0x38')]=qs[_0x03c2('0x39')](_0x581688[_0x03c2('0x30')][_0x03c2('0x39')]);_0x148279['where']=qs[_0x03c2('0x31')](_['pick'](_0x581688[_0x03c2('0x30')],_0x2efadc['filters']));if(_0x581688['query'][_0x03c2('0x4d')]){_0x148279['where']=_[_0x03c2('0x3d')](_0x148279[_0x03c2('0x3a')],{'$or':_[_0x03c2('0x2a')](_0x148279[_0x03c2('0x33')],function(_0x1c2d35){var _0x1f6667={};_0x1f6667[_0x1c2d35]={'$like':'%'+_0x581688[_0x03c2('0x30')][_0x03c2('0x4d')]+'%'};return _0x1f6667;})});}_0x148279=_[_0x03c2('0x3d')]({},_0x148279,_0x581688[_0x03c2('0x3e')]);return _0x3df497[_0x03c2('0x4e')](_0x148279);}})[_0x03c2('0x26')](function(_0x4d02b5){if(_0x4d02b5){_0x215ab9=_0x4d02b5['length'];if(!_0x581688[_0x03c2('0x30')][_0x03c2('0x36')]('nolimit')){_0x148279[_0x03c2('0x20')]=qs[_0x03c2('0x20')](_0x581688[_0x03c2('0x30')][_0x03c2('0x20')]);_0x148279[_0x03c2('0x1e')]=qs['offset'](_0x581688['query'][_0x03c2('0x1e')]);}return _0x3df497['getConditions'](_0x148279);}})['then'](function(_0x476d5c){if(_0x476d5c){return _0x476d5c?{'count':_0x215ab9,'rows':_0x476d5c}:null;}})['then'](respondWithResult(_0x2a1129,null))['catch'](handleError(_0x2a1129,null));};exports[_0x03c2('0x4f')]=function(_0x4d1f38,_0x4b07ad,_0x31d321){return db[_0x03c2('0x50')][_0x03c2('0x51')]({'where':{'id':_0x4d1f38[_0x03c2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b07ad,null))[_0x03c2('0x26')](function(_0x233c3c){if(_0x233c3c){return _0x233c3c[_0x03c2('0x4f')](_0x4d1f38['body'][_0x03c2('0x4a')],_[_0x03c2('0x4b')](_0x4d1f38[_0x03c2('0x48')],['ids','id'])||{});}})[_0x03c2('0x26')](respondWithResult(_0x4b07ad,null))[_0x03c2('0x43')](handleError(_0x4b07ad,null));};exports[_0x03c2('0x52')]=function(_0x2a7c4b,_0x535cfd,_0x57bd08){var _0x505dd4={};var _0x59f1d5={};var _0x947826;var _0x3d93bc;return db[_0x03c2('0x2b')][_0x03c2('0x4c')]({'where':{'id':_0x2a7c4b[_0x03c2('0x45')]['id']}})[_0x03c2('0x26')](handleEntityNotFound(_0x535cfd,null))[_0x03c2('0x26')](function(_0x24b112){if(_0x24b112){_0x947826=_0x24b112;_0x59f1d5['model']=_['keys'](db[_0x03c2('0x50')][_0x03c2('0x2c')]);_0x59f1d5[_0x03c2('0x30')]=_[_0x03c2('0x46')](_0x2a7c4b[_0x03c2('0x30')]);_0x59f1d5['filters']=_[_0x03c2('0x32')](_0x59f1d5[_0x03c2('0x2f')],_0x59f1d5[_0x03c2('0x30')]);_0x505dd4[_0x03c2('0x33')]=_[_0x03c2('0x32')](_0x59f1d5[_0x03c2('0x2f')],qs[_0x03c2('0x34')](_0x2a7c4b['query'][_0x03c2('0x34')]));_0x505dd4['attributes']=_0x505dd4[_0x03c2('0x33')]['length']?_0x505dd4['attributes']:_0x59f1d5[_0x03c2('0x2f')];_0x505dd4[_0x03c2('0x38')]=qs[_0x03c2('0x39')](_0x2a7c4b[_0x03c2('0x30')][_0x03c2('0x39')]);_0x505dd4[_0x03c2('0x3a')]=qs[_0x03c2('0x31')](_[_0x03c2('0x3b')](_0x2a7c4b[_0x03c2('0x30')],_0x59f1d5[_0x03c2('0x31')]));if(_0x2a7c4b[_0x03c2('0x30')]['filter']){_0x505dd4['where']=_[_0x03c2('0x3d')](_0x505dd4[_0x03c2('0x3a')],{'$or':_[_0x03c2('0x2a')](_0x505dd4[_0x03c2('0x33')],function(_0x246d62){var _0x3a02bc={};_0x3a02bc[_0x246d62]={'$like':'%'+_0x2a7c4b[_0x03c2('0x30')][_0x03c2('0x4d')]+'%'};return _0x3a02bc;})});}_0x505dd4=_[_0x03c2('0x3d')]({},_0x505dd4,_0x2a7c4b[_0x03c2('0x3e')]);return _0x947826[_0x03c2('0x52')](_0x505dd4);}})['then'](function(_0x208000){if(_0x208000){_0x3d93bc=_0x208000[_0x03c2('0x35')];if(!_0x2a7c4b['query']['hasOwnProperty']('nolimit')){_0x505dd4[_0x03c2('0x20')]=qs[_0x03c2('0x20')](_0x2a7c4b['query'][_0x03c2('0x20')]);_0x505dd4[_0x03c2('0x1e')]=qs[_0x03c2('0x1e')](_0x2a7c4b[_0x03c2('0x30')][_0x03c2('0x1e')]);}return _0x947826[_0x03c2('0x52')](_0x505dd4);}})[_0x03c2('0x26')](function(_0x3c1208){if(_0x3c1208){return _0x3c1208?{'count':_0x3d93bc,'rows':_0x3c1208}:null;}})[_0x03c2('0x26')](respondWithResult(_0x535cfd,null))[_0x03c2('0x43')](handleError(_0x535cfd,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 4fd512d..fefbfac 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 _0x50a8=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','define','tools_automations','lodash'];(function(_0xb4bd72,_0x51c0c9){var _0xd35be6=function(_0x424b2f){while(--_0x424b2f){_0xb4bd72['push'](_0xb4bd72['shift']());}};_0xd35be6(++_0x51c0c9);}(_0x50a8,0xe9));var _0x850a=function(_0x30abff,_0x5f2c5f){_0x30abff=_0x30abff-0x0;var _0x4c571e=_0x50a8[_0x30abff];return _0x4c571e;};'use strict';var _=require(_0x850a('0x0'));var util=require(_0x850a('0x1'));var logger=require(_0x850a('0x2'))(_0x850a('0x3'));var moment=require(_0x850a('0x4'));var BPromise=require(_0x850a('0x5'));var rp=require(_0x850a('0x6'));var fs=require('fs');var path=require(_0x850a('0x7'));var rimraf=require(_0x850a('0x8'));var config=require(_0x850a('0x9'));var attributes=require(_0x850a('0xa'));module['exports']=function(_0x340115,_0x2b60a6){return _0x340115[_0x850a('0xb')]('Automation',attributes,{'tableName':_0x850a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3394=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','./automation.attributes','exports','define'];(function(_0x63f0f5,_0x3bcb73){var _0x497e6f=function(_0x3a48d1){while(--_0x3a48d1){_0x63f0f5['push'](_0x63f0f5['shift']());}};_0x497e6f(++_0x3bcb73);}(_0x3394,0x19e));var _0x4339=function(_0x327322,_0x3cb679){_0x327322=_0x327322-0x0;var _0x5a199b=_0x3394[_0x327322];return _0x5a199b;};'use strict';var _=require(_0x4339('0x0'));var util=require(_0x4339('0x1'));var logger=require(_0x4339('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4339('0x3'));var rp=require(_0x4339('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4339('0x5'));var attributes=require(_0x4339('0x6'));module[_0x4339('0x7')]=function(_0x488227,_0x118cca){return _0x488227[_0x4339('0x8')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 108873a..0d6b377 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 _0xb8a0=['request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x2e7eaa,_0x1702d9){_0x2e7eaa=_0x2e7eaa-0x0;var _0x33e095=_0xb8a0[_0x2e7eaa];return _0x33e095;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0b8a('0x0'));var BPromise=require(_0x0b8a('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b8a('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x0b8a('0x3'));var jayson=require(_0x0b8a('0x4'));var client=jayson[_0x0b8a('0x5')][_0x0b8a('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3527dd,_0x4039c2,_0x33a5bd){return new BPromise(function(_0x463015,_0x29ebdc){return client[_0x0b8a('0x7')](_0x3527dd,_0x33a5bd)[_0x0b8a('0x8')](function(_0x478492){logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,_0x0b8a('0xb'));logger[_0x0b8a('0xc')](_0x0b8a('0xd'),_0x4039c2,_0x0b8a('0xb'),JSON[_0x0b8a('0xe')](_0x478492));if(_0x478492[_0x0b8a('0xf')]){if(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x10')]===0x1f4){logger['error'](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x29ebdc(_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);}logger[_0x0b8a('0xf')](_0x0b8a('0xa'),_0x4039c2,_0x478492[_0x0b8a('0xf')][_0x0b8a('0x11')]);return _0x463015(_0x478492['error'][_0x0b8a('0x11')]);}else{logger[_0x0b8a('0x9')](_0x0b8a('0xa'),_0x4039c2,'request\x20sent');_0x463015(_0x478492[_0x0b8a('0x12')][_0x0b8a('0x11')]);}})[_0x0b8a('0x13')](function(_0x5a2623){logger['error']('Automation,\x20%s,\x20%s',_0x4039c2,_0x5a2623);_0x29ebdc(_0x5a2623);});});} \ No newline at end of file +var _0x2fe5=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','message','Automation,\x20%s,\x20%s','info','result','catch','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x2fe5,0x14b));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x52fe('0x2'));var fs=require('fs');var Redis=require(_0x52fe('0x3'));var db=require(_0x52fe('0x4'))['db'];var utils=require(_0x52fe('0x5'));var logger=require(_0x52fe('0x6'))('rpc');var config=require(_0x52fe('0x7'));var jayson=require(_0x52fe('0x8'));var client=jayson['client'][_0x52fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x157c5a,_0x2b3f41,_0x31b5dd){return new BPromise(function(_0x408cef,_0x49f7d9){return client[_0x52fe('0xa')](_0x157c5a,_0x31b5dd)[_0x52fe('0xb')](function(_0xe73ece){logger['info']('Automation,\x20%s,\x20%s',_0x2b3f41,_0x52fe('0xc'));logger[_0x52fe('0xd')]('Automation,\x20%s,\x20%s,\x20%s',_0x2b3f41,_0x52fe('0xc'),JSON[_0x52fe('0xe')](_0xe73ece));if(_0xe73ece[_0x52fe('0xf')]){if(_0xe73ece[_0x52fe('0xf')]['code']===0x1f4){logger[_0x52fe('0xf')]('Automation,\x20%s,\x20%s',_0x2b3f41,_0xe73ece[_0x52fe('0xf')]['message']);return _0x49f7d9(_0xe73ece[_0x52fe('0xf')][_0x52fe('0x10')]);}logger[_0x52fe('0xf')](_0x52fe('0x11'),_0x2b3f41,_0xe73ece['error'][_0x52fe('0x10')]);return _0x408cef(_0xe73ece[_0x52fe('0xf')][_0x52fe('0x10')]);}else{logger[_0x52fe('0x12')](_0x52fe('0x11'),_0x2b3f41,_0x52fe('0xc'));_0x408cef(_0xe73ece[_0x52fe('0x13')][_0x52fe('0x10')]);}})[_0x52fe('0x14')](function(_0x33ab22){logger['error']('Automation,\x20%s,\x20%s',_0x2b3f41,_0x33ab22);_0x49f7d9(_0x33ab22);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index e6fc785..a3d253f 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 _0x899a=['/:id/conditions','getConditions','/:id/actions','getActions','addConditions','post','addActions','put','update','delete','/:id','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x899a,0x1b6));var _0xa899=function(_0x58290b,_0x147b41){_0x58290b=_0x58290b-0x0;var _0x461cd2=_0x899a[_0x58290b];return _0x461cd2;};'use strict';var multer=require(_0xa899('0x0'));var util=require(_0xa899('0x1'));var path=require('path');var timeout=require(_0xa899('0x2'));var express=require(_0xa899('0x3'));var router=express['Router']();var fs_extra=require(_0xa899('0x4'));var auth=require(_0xa899('0x5'));var interaction=require(_0xa899('0x6'));var config=require(_0xa899('0x7'));var controller=require('./automation.controller');router[_0xa899('0x8')]('/',auth[_0xa899('0x9')](),controller[_0xa899('0xa')]);router[_0xa899('0x8')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0xb')]);router[_0xa899('0x8')](_0xa899('0xc'),auth[_0xa899('0x9')](),controller[_0xa899('0xd')]);router[_0xa899('0x8')](_0xa899('0xe'),auth[_0xa899('0x9')](),controller[_0xa899('0xf')]);router['post']('/',auth[_0xa899('0x9')](),controller['create']);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xa899('0x10')]);router[_0xa899('0x11')](_0xa899('0xe'),auth['isAuthenticated'](),controller[_0xa899('0x12')]);router[_0xa899('0x13')]('/:id',auth[_0xa899('0x9')](),controller[_0xa899('0x14')]);router[_0xa899('0x15')](_0xa899('0x16'),auth['isAuthenticated'](),controller[_0xa899('0x17')]);module[_0xa899('0x18')]=router; \ No newline at end of file +var _0x04de=['getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','/:id','isAuthenticated','show','get','/:id/conditions','getConditions'];(function(_0x376b10,_0x3a5cd0){var _0xb187e8=function(_0x3c75ee){while(--_0x3c75ee){_0x376b10['push'](_0x376b10['shift']());}};_0xb187e8(++_0x3a5cd0);}(_0x04de,0x107));var _0xe04d=function(_0x210ee7,_0x5eb15b){_0x210ee7=_0x210ee7-0x0;var _0x4bd246=_0x04de[_0x210ee7];return _0x4bd246;};'use strict';var multer=require(_0xe04d('0x0'));var util=require(_0xe04d('0x1'));var path=require(_0xe04d('0x2'));var timeout=require(_0xe04d('0x3'));var express=require(_0xe04d('0x4'));var router=express[_0xe04d('0x5')]();var fs_extra=require(_0xe04d('0x6'));var auth=require(_0xe04d('0x7'));var interaction=require(_0xe04d('0x8'));var config=require(_0xe04d('0x9'));var controller=require(_0xe04d('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0xd')]);router[_0xe04d('0xe')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x10')]);router[_0xe04d('0xe')]('/:id/actions',auth[_0xe04d('0xc')](),controller[_0xe04d('0x11')]);router[_0xe04d('0x12')]('/',auth[_0xe04d('0xc')](),controller[_0xe04d('0x13')]);router[_0xe04d('0x12')](_0xe04d('0xf'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x14')]);router['post'](_0xe04d('0x15'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x16')]);router[_0xe04d('0x17')](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x18')]);router[_0xe04d('0x19')](_0xe04d('0xb'),auth[_0xe04d('0xc')](),controller[_0xe04d('0x1a')]);module[_0xe04d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 3fc10da..fd8dd23 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 _0x0f48=['UNSIGNED','Originate\x20Timeout\x20Seconds\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)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.'];(function(_0x3c7c93,_0x205471){var _0x1967f7=function(_0x3504e2){while(--_0x3504e2){_0x3c7c93['push'](_0x3c7c93['shift']());}};_0x1967f7(++_0x205471);}(_0x0f48,0x1be));var _0x80f4=function(_0xe8cf51,_0x4ef81b){_0xe8cf51=_0xe8cf51-0x0;var _0x268f06=_0x0f48[_0xe8cf51];return _0x268f06;};'use strict';var Sequelize=require(_0x80f4('0x0'));module[_0x80f4('0x1')]={'name':{'type':Sequelize[_0x80f4('0x2')],'unique':_0x80f4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x80f4('0x4')](_0x80f4('0x5')),'allowNull':![],'defaultValue':_0x80f4('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x80f4('0x6')},'limitCalls':{'type':Sequelize[_0x80f4('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x80f4('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x80f4('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x80f4('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'comment':_0x80f4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x80f4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x80f4('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x80f4('0x4')](_0x80f4('0xf'),_0x80f4('0x10'),_0x80f4('0x11')),'defaultValue':_0x80f4('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x80f4('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x80f4('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x80f4('0x7')](0x9)[_0x80f4('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x80f4('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x80f4('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x80f4('0x7')](0x9)[_0x80f4('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x80f4('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x80f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x80f4('0x7')](0x9)[_0x80f4('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x80f4('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x80f4('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x80f4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x80f4('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x80f4('0x18')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x80f4('0x19'),_0x80f4('0x1a')),'defaultValue':_0x80f4('0x19')},'dialPrefix':{'type':Sequelize[_0x80f4('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x80f4('0x1b')},'dialCutDigit':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x80f4('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)[_0x80f4('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x1f')},'dialMachineMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x80f4('0x7')](0x3)[_0x80f4('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x80f4('0x21')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x80f4('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x80f4('0x22')}}; \ No newline at end of file +var _0xafcd=['NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','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)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'];(function(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xafcd,0x157));var _0xdafc=function(_0x348ea7,_0x591405){_0x348ea7=_0x348ea7-0x0;var _0x5eafdf=_0xafcd[_0x348ea7];return _0x5eafdf;};'use strict';var Sequelize=require(_0xdafc('0x0'));module[_0xdafc('0x1')]={'name':{'type':Sequelize[_0xdafc('0x2')],'unique':_0xdafc('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xdafc('0x4')](_0xdafc('0x5')),'allowNull':![],'defaultValue':_0xdafc('0x5')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xdafc('0x6')],'defaultValue':0x0,'comment':_0xdafc('0x7')},'limitCalls':{'type':Sequelize[_0xdafc('0x8')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xdafc('0x9')},'dialOriginateCallerIdName':{'type':Sequelize[_0xdafc('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xdafc('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0xe')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0xf')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'comment':_0xdafc('0x10')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xdafc('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xdafc('0x11')},'dialCheckDuplicateType':{'type':Sequelize[_0xdafc('0x4')](_0xdafc('0x12'),_0xdafc('0x13'),'onlyIfOpen'),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xdafc('0x6')],'defaultValue':0x0,'comment':_0xdafc('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xdafc('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xdafc('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xdafc('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xdafc('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xdafc('0x8')](0x9)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xdafc('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xdafc('0x8')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xdafc('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0xdafc('0x4')](_0xdafc('0x1a'),_0xdafc('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xdafc('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xdafc('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdafc('0x1c')},'dialCutDigit':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xdafc('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xdafc('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xdafc('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xdafc('0x8')](0x3)[_0xdafc('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xdafc('0x8')](0x5)[_0xdafc('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4a1bc56..d160a1d 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 _0xfef3=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','set','Content-Range','apply','reject','save','update','destroy','IvrCampaigns','UserProfileResource','then','error','stack','name','send','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','createdAt','omit','userProfileId','findOne','CmHopper','hasOwnProperty','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','updatedAt','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','NOW()','OrderBy','h.id','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto'];(function(_0x14b41,_0x2ee4dc){var _0x2cd213=function(_0x5147be){while(--_0x5147be){_0x14b41['push'](_0x14b41['shift']());}};_0x2cd213(++_0x2ee4dc);}(_0xfef3,0x118));var _0x3fef=function(_0x4b92f0,_0x5255d3){_0x4b92f0=_0x4b92f0-0x0;var _0x1626a3=_0xfef3[_0x4b92f0];return _0x1626a3;};'use strict';var emlformat=require(_0x3fef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3fef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3fef('0x2'));var moment=require(_0x3fef('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3fef('0x4'));var util=require(_0x3fef('0x5'));var path=require('path');var sox=require(_0x3fef('0x6'));var csv=require(_0x3fef('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3fef('0x8'));var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0x7'));var querystring=require(_0x3fef('0xe'));var Papa=require(_0x3fef('0xf'));var Redis=require(_0x3fef('0x10'));var authService=require(_0x3fef('0x11'));var qs=require(_0x3fef('0x12'));var as=require(_0x3fef('0x13'));var hardwareService=require(_0x3fef('0x14'));var logger=require('../../config/logger')(_0x3fef('0x15'));var utils=require(_0x3fef('0x16'));var config=require(_0x3fef('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3fef('0x18'))['db'];function respondWithStatusCode(_0x4c4a47,_0x2c99ff){_0x2c99ff=_0x2c99ff||0xcc;return function(_0x3d2c2d){if(_0x3d2c2d){return _0x4c4a47[_0x3fef('0x19')](_0x2c99ff);}return _0x4c4a47['status'](_0x2c99ff)[_0x3fef('0x1a')]();};}function respondWithResult(_0x4be62f,_0x15b757){_0x15b757=_0x15b757||0xc8;return function(_0x14c053){if(_0x14c053){return _0x4be62f['status'](_0x15b757)[_0x3fef('0x1b')](_0x14c053);}};}function respondWithFilteredResult(_0x177e28,_0x40b479){return function(_0x79b617){if(_0x79b617){var _0x395df0=typeof _0x40b479[_0x3fef('0x1c')]==='undefined'&&typeof _0x40b479[_0x3fef('0x1d')]===_0x3fef('0x1e');var _0x1ec282=_0x79b617[_0x3fef('0x1f')];var _0x1613ad=_0x395df0?0x0:_0x40b479[_0x3fef('0x1c')];var _0x53d993=_0x395df0?_0x79b617[_0x3fef('0x1f')]:_0x40b479[_0x3fef('0x1c')]+_0x40b479['limit'];var _0x2c7f36;if(_0x53d993>=_0x1ec282){_0x53d993=_0x1ec282;_0x2c7f36=0xc8;}else{_0x2c7f36=0xce;}_0x177e28[_0x3fef('0x20')](_0x2c7f36);return _0x177e28[_0x3fef('0x21')](_0x3fef('0x22'),_0x1613ad+'-'+_0x53d993+'/'+_0x1ec282)[_0x3fef('0x1b')](_0x79b617);}return null;};}function patchUpdates(_0x2b5226){return function(_0x451d11){try{jsonpatch[_0x3fef('0x23')](_0x451d11,_0x2b5226,!![]);}catch(_0x124e7c){return BPromise[_0x3fef('0x24')](_0x124e7c);}return _0x451d11[_0x3fef('0x25')]();};}function saveUpdates(_0x3bb110,_0x2eb578){return function(_0x39a8ea){if(_0x39a8ea){return _0x39a8ea[_0x3fef('0x26')](_0x3bb110)['then'](function(_0x5b56de){return _0x5b56de;});}return null;};}function removeEntity(_0x50025f,_0x378b03){return function(_0x3ba38d){if(_0x3ba38d){return _0x3ba38d[_0x3fef('0x27')]()['then'](function(){var _0x4d462c=_0x3ba38d['get']({'plain':!![]});var _0x45464b=_0x3fef('0x28');return db[_0x3fef('0x29')][_0x3fef('0x27')]({'where':{'type':_0x45464b,'resourceId':_0x4d462c['id']}})[_0x3fef('0x2a')](function(){return _0x3ba38d;});})['then'](function(){_0x50025f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x121ff0,_0x3baa52){return function(_0x4ea2ab){if(!_0x4ea2ab){_0x121ff0[_0x3fef('0x19')](0x194);}return _0x4ea2ab;};}function handleError(_0x6d08cd,_0x4e08d8){_0x4e08d8=_0x4e08d8||0x1f4;return function(_0x30a954){logger[_0x3fef('0x2b')](_0x30a954[_0x3fef('0x2c')]);if(_0x30a954[_0x3fef('0x2d')]){delete _0x30a954[_0x3fef('0x2d')];}_0x6d08cd[_0x3fef('0x20')](_0x4e08d8)[_0x3fef('0x2e')](_0x30a954);};}exports['index']=function(_0x34576a,_0xc20ce5){var _0x21aad4={},_0x11bd40={},_0x5dbbc0={'count':0x0,'rows':[]};var _0xcd635d=_['map'](db[_0x3fef('0x2f')][_0x3fef('0x30')],function(_0x16009a){return{'name':_0x16009a[_0x3fef('0x31')],'type':_0x16009a[_0x3fef('0x32')][_0x3fef('0x33')]};});_0x11bd40[_0x3fef('0x34')]=_[_0x3fef('0x35')](_0xcd635d,_0x3fef('0x2d'));_0x11bd40[_0x3fef('0x36')]=_['keys'](_0x34576a['query']);_0x11bd40[_0x3fef('0x37')]=_['intersection'](_0x11bd40[_0x3fef('0x34')],_0x11bd40[_0x3fef('0x36')]);_0x21aad4[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x11bd40[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x21aad4[_0x3fef('0x38')]=_0x21aad4[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x21aad4[_0x3fef('0x38')]:_0x11bd40[_0x3fef('0x34')];if(!_0x34576a[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x21aad4[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x21aad4[_0x3fef('0x1c')]=qs['offset'](_0x34576a['query'][_0x3fef('0x1c')]);}_0x21aad4[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x34576a[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x21aad4[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x34576a[_0x3fef('0x36')],_0x11bd40[_0x3fef('0x37')]),_0xcd635d);if(_0x34576a[_0x3fef('0x36')]['filter']){_0x21aad4[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x21aad4['where'],{'$or':_['map'](_0xcd635d,function(_0x37c4af){if(_0x37c4af[_0x3fef('0x32')]!==_0x3fef('0x42')){var _0x21c531={};_0x21c531[_0x37c4af[_0x3fef('0x2d')]]={'$like':'%'+_0x34576a[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x21c531;}})});}_0x21aad4=_[_0x3fef('0x41')]({},_0x21aad4,_0x34576a['options']);var _0x107d42={'where':_0x21aad4[_0x3fef('0x3f')]};return db[_0x3fef('0x2f')][_0x3fef('0x1f')](_0x107d42)[_0x3fef('0x2a')](function(_0x2143ec){_0x5dbbc0[_0x3fef('0x1f')]=_0x2143ec;if(_0x34576a[_0x3fef('0x36')][_0x3fef('0x44')]){_0x21aad4[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x2f')][_0x3fef('0x46')](_0x21aad4);})[_0x3fef('0x2a')](function(_0x15d2c7){_0x5dbbc0[_0x3fef('0x47')]=_0x15d2c7;return _0x5dbbc0;})['then'](respondWithFilteredResult(_0xc20ce5,_0x21aad4))[_0x3fef('0x48')](handleError(_0xc20ce5,null));};exports[_0x3fef('0x49')]=function(_0x421fd1,_0x2120fd){var _0x1879c1={'raw':![],'where':{'id':_0x421fd1['params']['id']}},_0x33b145={};_0x33b145[_0x3fef('0x34')]=_['keys'](db[_0x3fef('0x2f')][_0x3fef('0x30')]);_0x33b145['query']=_[_0x3fef('0x4a')](_0x421fd1['query']);_0x33b145[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],_0x33b145[_0x3fef('0x36')]);_0x1879c1[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x33b145[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x421fd1[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x1879c1[_0x3fef('0x38')]=_0x1879c1[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x1879c1['attributes']:_0x33b145[_0x3fef('0x34')];if(_0x421fd1[_0x3fef('0x36')]['includeAll']){_0x1879c1[_0x3fef('0x45')]=[{'all':!![]}];}_0x1879c1=_[_0x3fef('0x41')]({},_0x1879c1,_0x421fd1[_0x3fef('0x4b')]);return db['Campaign'][_0x3fef('0x4c')](_0x1879c1)[_0x3fef('0x2a')](handleEntityNotFound(_0x2120fd,null))['then'](respondWithResult(_0x2120fd,null))[_0x3fef('0x48')](handleError(_0x2120fd,null));};exports['create']=function(_0x48322c,_0x15fb2c){return db['Campaign'][_0x3fef('0x4d')](_0x48322c[_0x3fef('0x4e')],{})['then'](function(_0x4535e8){var _0x2823f4=_0x48322c[_0x3fef('0x4f')]['get']({'plain':!![]});if(!_0x2823f4)throw new Error(_0x3fef('0x50'));if(_0x2823f4[_0x3fef('0x51')]===_0x3fef('0x4f')){var _0x5b1acb=_0x4535e8[_0x3fef('0x52')]({'plain':!![]});var _0x154311=_0x3fef('0x28');return db[_0x3fef('0x53')][_0x3fef('0x4c')]({'where':{'name':_0x154311,'userProfileId':_0x2823f4['userProfileId']},'raw':!![]})[_0x3fef('0x2a')](function(_0xbbf255){if(_0xbbf255&&_0xbbf255[_0x3fef('0x54')]===0x0){return db[_0x3fef('0x29')][_0x3fef('0x4d')]({'name':_0x5b1acb[_0x3fef('0x2d')],'resourceId':_0x5b1acb['id'],'type':_0xbbf255[_0x3fef('0x2d')],'sectionId':_0xbbf255['id']},{})[_0x3fef('0x2a')](function(){return _0x4535e8;});}else{return _0x4535e8;}})[_0x3fef('0x48')](function(_0x4862a5){logger['error'](_0x3fef('0x55'),_0x4862a5);throw _0x4862a5;});}return _0x4535e8;})[_0x3fef('0x2a')](respondWithResult(_0x15fb2c,0xc9))[_0x3fef('0x48')](handleError(_0x15fb2c,null));};exports[_0x3fef('0x56')]=function(_0xd57af2,_0x192f91){var _0xbc9e81={'where':{'id':_0xd57af2[_0x3fef('0x57')]['id']}},_0x17e188={};_0x17e188[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x2f')]['rawAttributes']);_0xbc9e81[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x17e188[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0xd57af2['query'][_0x3fef('0x3a')]));_0xbc9e81[_0x3fef('0x38')]=_0xbc9e81[_0x3fef('0x38')][_0x3fef('0x3b')]?_0xbc9e81['attributes']:_0x17e188[_0x3fef('0x34')];if(_0xd57af2[_0x3fef('0x36')][_0x3fef('0x44')]){_0xbc9e81['include']=[{'all':!![]}];}_0xbc9e81=_['merge']({},_0xbc9e81,_0xd57af2[_0x3fef('0x4b')]);return db[_0x3fef('0x2f')][_0x3fef('0x4c')](_0xbc9e81)[_0x3fef('0x2a')](handleEntityNotFound(_0x192f91,null))['then'](function(_0x3073da){if(_0x3073da){var _0x4824d0=_0x3073da[_0x3fef('0x52')]({'plain':!![]});_0x4824d0=qs['omit'](_0x4824d0,['id',_0x3fef('0x58'),'updatedAt']);_0xd57af2[_0x3fef('0x4e')]=_[_0x3fef('0x59')](_0xd57af2[_0x3fef('0x4e')],['id','createdAt','updatedAt']);return db[_0x3fef('0x2f')][_0x3fef('0x4d')](_[_0x3fef('0x41')](_0x4824d0,_0xd57af2[_0x3fef('0x4e')]),{'include':_0xd57af2[_0x3fef('0x36')][_0x3fef('0x44')]?[{'all':!![]}]:undefined})[_0x3fef('0x2a')](function(_0x2b9a5e){var _0x5493a8=_0xd57af2[_0x3fef('0x4f')]['get']({'plain':!![]});if(!_0x5493a8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5493a8[_0x3fef('0x51')]===_0x3fef('0x4f')){var _0xd01ee6=_0x2b9a5e[_0x3fef('0x52')]({'plain':!![]});var _0x14db4d=_0x3fef('0x28');return db[_0x3fef('0x53')][_0x3fef('0x4c')]({'where':{'name':_0x14db4d,'userProfileId':_0x5493a8[_0x3fef('0x5a')]},'raw':!![]})['then'](function(_0x2d36fd){if(_0x2d36fd&&_0x2d36fd['autoAssociation']===0x0){return db[_0x3fef('0x29')][_0x3fef('0x4d')]({'name':_0xd01ee6[_0x3fef('0x2d')],'resourceId':_0xd01ee6['id'],'type':_0x2d36fd[_0x3fef('0x2d')],'sectionId':_0x2d36fd['id']},{})[_0x3fef('0x2a')](function(){return _0x2b9a5e;});}else{return _0x2b9a5e;}})[_0x3fef('0x48')](function(_0x4a4631){logger[_0x3fef('0x2b')](_0x3fef('0x55'),_0x4a4631);throw _0x4a4631;});}return _0x2b9a5e;});}})[_0x3fef('0x2a')](respondWithResult(_0x192f91,0xc9))[_0x3fef('0x48')](handleError(_0x192f91,null));};exports[_0x3fef('0x26')]=function(_0x40bd7e,_0x10b869){if(_0x40bd7e[_0x3fef('0x4e')]['id']){delete _0x40bd7e[_0x3fef('0x4e')]['id'];}return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x40bd7e['params']['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x10b869,null))['then'](saveUpdates(_0x40bd7e['body'],null))['then'](respondWithResult(_0x10b869,null))[_0x3fef('0x48')](handleError(_0x10b869,null));};exports['destroy']=function(_0x3d89b1,_0x19daae){return db[_0x3fef('0x2f')]['find']({'where':{'id':_0x3d89b1[_0x3fef('0x57')]['id']}})['then'](handleEntityNotFound(_0x19daae,null))[_0x3fef('0x2a')](removeEntity(_0x19daae,null))[_0x3fef('0x48')](handleError(_0x19daae,null));};exports['getHoppers']=function(_0x1d0ae0,_0x458583,_0x10bf8e){var _0x134bea={'raw':!![],'where':{}};var _0xb68294={};var _0x2237f8={'count':0x0,'rows':[]};return db[_0x3fef('0x2f')][_0x3fef('0x5b')]({'where':{'id':_0x1d0ae0['params']['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x458583,null))[_0x3fef('0x2a')](function(_0x3c5ae9){if(_0x3c5ae9){_0xb68294[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x5c')][_0x3fef('0x30')]);_0xb68294[_0x3fef('0x36')]=_[_0x3fef('0x4a')](_0x1d0ae0[_0x3fef('0x36')]);_0xb68294[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0xb68294[_0x3fef('0x34')],_0xb68294[_0x3fef('0x36')]);_0x134bea['attributes']=_[_0x3fef('0x39')](_0xb68294[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x1d0ae0['query']['fields']));_0x134bea['attributes']=_0x134bea[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x134bea[_0x3fef('0x38')]:_0xb68294[_0x3fef('0x34')];if(!_0x1d0ae0['query'][_0x3fef('0x5d')](_0x3fef('0x3c'))){_0x134bea[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x1d0ae0['query'][_0x3fef('0x1d')]);_0x134bea[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0x134bea['order']=qs[_0x3fef('0x3e')](_0x1d0ae0['query'][_0x3fef('0x3e')]);_0x134bea['where']=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x1d0ae0[_0x3fef('0x36')],_0xb68294[_0x3fef('0x37')]));_0x134bea[_0x3fef('0x3f')][_0x3fef('0x5e')]=_0x3c5ae9['id'];if(_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x43')]){_0x134bea[_0x3fef('0x3f')]=_['merge'](_0x134bea[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x134bea[_0x3fef('0x38')],function(_0x1515fb){var _0x4d8a00={};_0x4d8a00[_0x1515fb]={'$like':'%'+_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x4d8a00;})});}_0x134bea=_[_0x3fef('0x41')]({},_0x134bea,_0x1d0ae0[_0x3fef('0x4b')]);return db[_0x3fef('0x5c')][_0x3fef('0x1f')]({'where':_0x134bea['where']})[_0x3fef('0x2a')](function(_0x3ddfc6){_0x2237f8[_0x3fef('0x1f')]=_0x3ddfc6;if(_0x1d0ae0[_0x3fef('0x36')][_0x3fef('0x44')]){_0x134bea[_0x3fef('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0x3fef('0x46')](_0x134bea);})[_0x3fef('0x2a')](function(_0x177a09){_0x2237f8[_0x3fef('0x47')]=_0x177a09;return _0x2237f8;});}})[_0x3fef('0x2a')](respondWithFilteredResult(_0x458583,_0x134bea))['catch'](handleError(_0x458583,null));};exports[_0x3fef('0x5f')]=function(_0x196d67,_0x34d9ca,_0x4cf064){var _0x18159c={'raw':!![],'where':{}};var _0x2dc963={};var _0x406afb={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x196d67[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x34d9ca,null))[_0x3fef('0x2a')](function(_0x25914c){if(_0x25914c){_0x2dc963['model']=_[_0x3fef('0x4a')](db[_0x3fef('0x60')][_0x3fef('0x30')]);_0x2dc963['query']=_[_0x3fef('0x4a')](_0x196d67[_0x3fef('0x36')]);_0x2dc963[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x2dc963[_0x3fef('0x34')],_0x2dc963[_0x3fef('0x36')]);_0x18159c[_0x3fef('0x38')]=_['intersection'](_0x2dc963['model'],qs[_0x3fef('0x3a')](_0x196d67['query'][_0x3fef('0x3a')]));_0x18159c[_0x3fef('0x38')]=_0x18159c[_0x3fef('0x38')]['length']?_0x18159c[_0x3fef('0x38')]:_0x2dc963['model'];if(!_0x196d67[_0x3fef('0x36')]['hasOwnProperty']('nolimit')){_0x18159c['limit']=qs[_0x3fef('0x1d')](_0x196d67[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x18159c[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x196d67[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0x18159c['order']=qs[_0x3fef('0x3e')](_0x196d67[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x18159c['where']=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x196d67[_0x3fef('0x36')],_0x2dc963[_0x3fef('0x37')]));_0x18159c['where'][_0x3fef('0x5e')]=_0x25914c['id'];if(_0x196d67['query'][_0x3fef('0x43')]){_0x18159c[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0x18159c[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x18159c[_0x3fef('0x38')],function(_0x3100c3){var _0x1f7227={};_0x1f7227[_0x3100c3]={'$like':'%'+_0x196d67['query'][_0x3fef('0x43')]+'%'};return _0x1f7227;})});}_0x18159c=_['merge']({},_0x18159c,_0x196d67['options']);return db[_0x3fef('0x60')][_0x3fef('0x1f')]({'where':_0x18159c[_0x3fef('0x3f')]})[_0x3fef('0x2a')](function(_0x47ceb7){_0x406afb[_0x3fef('0x1f')]=_0x47ceb7;if(_0x196d67[_0x3fef('0x36')][_0x3fef('0x44')]){_0x18159c[_0x3fef('0x45')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3fef('0x46')](_0x18159c);})[_0x3fef('0x2a')](function(_0x236567){_0x406afb[_0x3fef('0x47')]=_0x236567;return _0x406afb;});}})[_0x3fef('0x2a')](respondWithFilteredResult(_0x34d9ca,_0x18159c))['catch'](handleError(_0x34d9ca,null));};exports[_0x3fef('0x61')]=function(_0x23907f,_0x2be8cb,_0x1eb92c){var _0x14e142={'raw':!![],'where':{}};var _0x5894f5={};var _0xe6a6b7={'count':0x0,'rows':[]};return db[_0x3fef('0x2f')][_0x3fef('0x5b')]({'where':{'id':_0x23907f[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x2be8cb,null))['then'](function(_0x281fbd){if(_0x281fbd){_0x5894f5[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x62')][_0x3fef('0x30')]);_0x5894f5[_0x3fef('0x36')]=_['keys'](_0x23907f['query']);_0x5894f5['filters']=_['intersection'](_0x5894f5['model'],_0x5894f5[_0x3fef('0x36')]);_0x14e142[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x5894f5[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x23907f['query'][_0x3fef('0x3a')]));_0x14e142[_0x3fef('0x38')]=_0x14e142[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x14e142[_0x3fef('0x38')]:_0x5894f5[_0x3fef('0x34')];if(!_0x23907f[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x14e142['limit']=qs[_0x3fef('0x1d')](_0x23907f[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x14e142[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x23907f[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0x14e142['order']=qs['sort'](_0x23907f['query']['sort']);_0x14e142[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x23907f[_0x3fef('0x36')],_0x5894f5[_0x3fef('0x37')]));_0x14e142['where'][_0x3fef('0x5e')]=_0x281fbd['id'];if(_0x23907f[_0x3fef('0x36')][_0x3fef('0x43')]){_0x14e142['where']=_[_0x3fef('0x41')](_0x14e142[_0x3fef('0x3f')],{'$or':_['map'](_0x14e142['attributes'],function(_0x3c3978){var _0x50eb66={};_0x50eb66[_0x3c3978]={'$like':'%'+_0x23907f[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x50eb66;})});}_0x14e142=_['merge']({},_0x14e142,_0x23907f[_0x3fef('0x4b')]);return db[_0x3fef('0x62')][_0x3fef('0x1f')]({'where':_0x14e142['where']})[_0x3fef('0x2a')](function(_0x1d0fc8){_0xe6a6b7['count']=_0x1d0fc8;if(_0x23907f[_0x3fef('0x36')][_0x3fef('0x44')]){_0x14e142[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x62')]['findAll'](_0x14e142);})['then'](function(_0x91a872){_0xe6a6b7['rows']=_0x91a872;return _0xe6a6b7;});}})[_0x3fef('0x2a')](respondWithFilteredResult(_0x2be8cb,_0x14e142))[_0x3fef('0x48')](handleError(_0x2be8cb,null));};exports[_0x3fef('0x63')]=function(_0x2296ae,_0x4e4a3c,_0x21447f){var _0xb24519={'raw':!![],'where':{}};var _0x2fd355={};var _0x102808={'count':0x0,'rows':[]};return db['Campaign'][_0x3fef('0x5b')]({'where':{'id':_0x2296ae['params']['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x4e4a3c,null))[_0x3fef('0x2a')](function(_0x578303){if(_0x578303){_0x2fd355['model']=_[_0x3fef('0x4a')](db[_0x3fef('0x64')]['rawAttributes']);_0x2fd355[_0x3fef('0x36')]=_[_0x3fef('0x4a')](_0x2296ae['query']);_0x2fd355['filters']=_[_0x3fef('0x39')](_0x2fd355[_0x3fef('0x34')],_0x2fd355['query']);_0xb24519[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x2fd355[_0x3fef('0x34')],qs['fields'](_0x2296ae[_0x3fef('0x36')][_0x3fef('0x3a')]));_0xb24519[_0x3fef('0x38')]=_0xb24519[_0x3fef('0x38')][_0x3fef('0x3b')]?_0xb24519['attributes']:_0x2fd355[_0x3fef('0x34')];if(!_0x2296ae[_0x3fef('0x36')][_0x3fef('0x5d')]('nolimit')){_0xb24519[_0x3fef('0x1d')]=qs['limit'](_0x2296ae['query'][_0x3fef('0x1d')]);_0xb24519[_0x3fef('0x1c')]=qs['offset'](_0x2296ae[_0x3fef('0x36')][_0x3fef('0x1c')]);}_0xb24519['order']=qs['sort'](_0x2296ae[_0x3fef('0x36')][_0x3fef('0x3e')]);_0xb24519[_0x3fef('0x3f')]=qs['filters'](_[_0x3fef('0x40')](_0x2296ae[_0x3fef('0x36')],_0x2fd355[_0x3fef('0x37')]));_0xb24519[_0x3fef('0x3f')][_0x3fef('0x5e')]=_0x578303['id'];if(_0x2296ae[_0x3fef('0x36')][_0x3fef('0x43')]){_0xb24519[_0x3fef('0x3f')]=_[_0x3fef('0x41')](_0xb24519[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0xb24519['attributes'],function(_0x778837){var _0x1aca6d={};_0x1aca6d[_0x778837]={'$like':'%'+_0x2296ae[_0x3fef('0x36')][_0x3fef('0x43')]+'%'};return _0x1aca6d;})});}_0xb24519=_['merge']({},_0xb24519,_0x2296ae[_0x3fef('0x4b')]);return db[_0x3fef('0x64')][_0x3fef('0x1f')]({'where':_0xb24519[_0x3fef('0x3f')]})['then'](function(_0x4a8291){_0x102808[_0x3fef('0x1f')]=_0x4a8291;if(_0x2296ae[_0x3fef('0x36')][_0x3fef('0x44')]){_0xb24519[_0x3fef('0x45')]=[{'all':!![]}];}return db[_0x3fef('0x64')]['findAll'](_0xb24519);})[_0x3fef('0x2a')](function(_0x2aa67e){_0x102808['rows']=_0x2aa67e;return _0x102808;});}})['then'](respondWithFilteredResult(_0x4e4a3c,_0xb24519))[_0x3fef('0x48')](handleError(_0x4e4a3c,null));};exports[_0x3fef('0x65')]=function(_0x7efffe,_0x7211b3,_0xe29f79){var _0x3ee841={};var _0x50d888={};var _0x55f1ba;var _0xc625bf;return db['Campaign'][_0x3fef('0x5b')]({'where':{'id':_0x7efffe[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x7211b3,null))['then'](function(_0x203b84){if(_0x203b84){_0x55f1ba=_0x203b84;_0x50d888[_0x3fef('0x34')]=_[_0x3fef('0x4a')](db[_0x3fef('0x66')]['rawAttributes']);_0x50d888[_0x3fef('0x36')]=_[_0x3fef('0x4a')](_0x7efffe[_0x3fef('0x36')]);_0x50d888[_0x3fef('0x37')]=_['intersection'](_0x50d888[_0x3fef('0x34')],_0x50d888[_0x3fef('0x36')]);_0x3ee841[_0x3fef('0x38')]=_[_0x3fef('0x39')](_0x50d888[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x7efffe[_0x3fef('0x36')][_0x3fef('0x3a')]));_0x3ee841[_0x3fef('0x38')]=_0x3ee841['attributes']['length']?_0x3ee841[_0x3fef('0x38')]:_0x50d888[_0x3fef('0x34')];_0x3ee841[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x7efffe['query'][_0x3fef('0x3e')]);_0x3ee841[_0x3fef('0x3f')]=qs[_0x3fef('0x37')](_['pick'](_0x7efffe[_0x3fef('0x36')],_0x50d888['filters']));if(_0x7efffe['query'][_0x3fef('0x43')]){_0x3ee841[_0x3fef('0x3f')]=_['merge'](_0x3ee841[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x3ee841[_0x3fef('0x38')],function(_0x1bcdd9){var _0x5b788c={};_0x5b788c[_0x1bcdd9]={'$like':'%'+_0x7efffe[_0x3fef('0x36')]['filter']+'%'};return _0x5b788c;})});}_0x3ee841=_['merge']({},_0x3ee841,_0x7efffe[_0x3fef('0x4b')]);return _0x55f1ba[_0x3fef('0x65')](_0x3ee841);}})[_0x3fef('0x2a')](function(_0x4cd6a3){if(_0x4cd6a3){_0xc625bf=_0x4cd6a3[_0x3fef('0x3b')];if(!_0x7efffe['query'][_0x3fef('0x5d')](_0x3fef('0x3c'))){_0x3ee841[_0x3fef('0x1d')]=qs['limit'](_0x7efffe[_0x3fef('0x36')][_0x3fef('0x1d')]);_0x3ee841['offset']=qs[_0x3fef('0x1c')](_0x7efffe[_0x3fef('0x36')][_0x3fef('0x1c')]);}return _0x55f1ba['getLists'](_0x3ee841);}})[_0x3fef('0x2a')](function(_0x3a5177){if(_0x3a5177){return _0x3a5177?{'count':_0xc625bf,'rows':_0x3a5177}:null;}})[_0x3fef('0x2a')](respondWithResult(_0x7211b3,null))['catch'](handleError(_0x7211b3,null));};exports[_0x3fef('0x67')]=function(_0x1cc284,_0x3c92d0,_0x257d78){var _0x51a02e,_0x22dd20;var _0x547a21=[];var _0x21ab99=moment()[_0x3fef('0x68')](_0x3fef('0x69'));return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x1cc284[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x3c92d0,null))['then'](function(_0x419a8d){if(_0x419a8d){_0x22dd20=_0x419a8d;return _0x419a8d[_0x3fef('0x67')](_0x1cc284['body'][_0x3fef('0x6a')],_[_0x3fef('0x59')](_0x1cc284[_0x3fef('0x4e')],['ids','id'])||{});}return null;})['spread'](function(_0x518162){var _0x57fce9;var _0x2dd846;_0x51a02e=_0x518162||[];var _0x4b984c=[];if(_0x518162){for(var _0x102572=0x0;_0x102572<_0x518162['length'];_0x102572+=0x1){var _0x2bd5eb=_0x518162[_0x102572][_0x3fef('0x52')]({'plain':!![]});_0x22dd20[_0x3fef('0x6b')]=_0x1cc284[_0x3fef('0x4e')]['dialCheckDuplicateType']?_0x1cc284[_0x3fef('0x4e')][_0x3fef('0x6b')]:_0x22dd20[_0x3fef('0x6b')];switch(_0x22dd20[_0x3fef('0x6b')]){case'always':_0x57fce9=squel[_0x3fef('0x6c')]()[_0x3fef('0x6d')](_0x3fef('0x6e'))[_0x3fef('0x6f')]([_0x3fef('0x70'),_0x3fef('0x71'),'ContactId',_0x3fef('0x72'),'CampaignId',_0x3fef('0x58'),_0x3fef('0x73')],squel['select']()[_0x3fef('0x74')](_0x3fef('0x70'),_0x3fef('0x70'))[_0x3fef('0x74')]('NOW()',_0x3fef('0x71'))[_0x3fef('0x74')]('id',_0x3fef('0x75'))[_0x3fef('0x74')](_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')](),_0x3fef('0x72'))['field'](_0x1cc284['params']['id']['toString'](),'CampaignId')[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))['field']('\x27'+_0x21ab99+'\x27',_0x3fef('0x73'))[_0x3fef('0x78')](_0x3fef('0x79'))[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')](_0x3fef('0x7b'),_0x2bd5eb[_0x3fef('0x76')]['toString']())[_0x3fef('0x3f')](_0x3fef('0x7c'))[_0x3fef('0x3f')]('phone\x20NOT\x20IN\x20(?)',squel[_0x3fef('0x7d')]()[_0x3fef('0x74')](_0x3fef('0x7e'))[_0x3fef('0x78')](_0x3fef('0x7f'))[_0x3fef('0x3f')]('CampaignId\x20=\x20?',_0x1cc284['params']['id'][_0x3fef('0x77')]()))[_0x3fef('0x3f')](_0x3fef('0x80'),squel['select']()['field'](_0x3fef('0x81'))[_0x3fef('0x78')]('cm_hopper')[_0x3fef('0x3f')](_0x3fef('0x82'),_0x1cc284[_0x3fef('0x57')]['id']['toString']())))[_0x3fef('0x77')]();break;case _0x3fef('0x83'):_0x57fce9=squel[_0x3fef('0x6c')]()[_0x3fef('0x6d')](_0x3fef('0x6e'))[_0x3fef('0x6f')]([_0x3fef('0x70'),'scheduledAt',_0x3fef('0x75'),_0x3fef('0x72'),'CampaignId','createdAt',_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field'](_0x3fef('0x70'),'phone')['field'](_0x3fef('0x84'),_0x3fef('0x71'))['field']('id',_0x3fef('0x75'))[_0x3fef('0x74')](_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')](),_0x3fef('0x72'))[_0x3fef('0x74')](_0x1cc284[_0x3fef('0x57')]['id'][_0x3fef('0x77')](),_0x3fef('0x5e'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x73'))['from']('cm_contacts')[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')]('ListId\x20=\x20?',_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')]())[_0x3fef('0x3f')](_0x3fef('0x7c'))[_0x3fef('0x3f')](_0x3fef('0x80'),squel[_0x3fef('0x7d')]()[_0x3fef('0x74')](_0x3fef('0x81'))[_0x3fef('0x78')](_0x3fef('0x6e'))[_0x3fef('0x3f')]('CampaignId\x20=\x20?',_0x1cc284[_0x3fef('0x57')]['id'][_0x3fef('0x77')]())))[_0x3fef('0x77')]();break;default:_0x57fce9=squel[_0x3fef('0x6c')]()[_0x3fef('0x6d')](_0x3fef('0x6e'))[_0x3fef('0x6f')]([_0x3fef('0x70'),_0x3fef('0x71'),_0x3fef('0x75'),'ListId',_0x3fef('0x5e'),_0x3fef('0x58'),_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field'](_0x3fef('0x70'),_0x3fef('0x70'))[_0x3fef('0x74')](_0x3fef('0x84'),_0x3fef('0x71'))[_0x3fef('0x74')]('id','ContactId')[_0x3fef('0x74')](_0x2bd5eb['CmListId']['toString'](),_0x3fef('0x72'))[_0x3fef('0x74')](_0x1cc284[_0x3fef('0x57')]['id'][_0x3fef('0x77')](),'CampaignId')[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x73'))[_0x3fef('0x78')](_0x3fef('0x79'))[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')](_0x3fef('0x7b'),_0x2bd5eb['CmListId'][_0x3fef('0x77')]())[_0x3fef('0x3f')](_0x3fef('0x7c')))[_0x3fef('0x77')]();}_0x2dd846=squel['insert']()[_0x3fef('0x6d')]('cm_hopper_additional_phones')[_0x3fef('0x6f')](['cmHopperId','scheduledAt',_0x3fef('0x70'),_0x3fef('0x85'),_0x3fef('0x58'),_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field'](_0x3fef('0x86'),'id')[_0x3fef('0x74')](_0x3fef('0x84'),'scheduledAt')[_0x3fef('0x74')]('ci.item',_0x3fef('0x70'))[_0x3fef('0x74')]('ci.OrderBY',_0x3fef('0x85'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27',_0x3fef('0x58'))[_0x3fef('0x74')]('\x27'+_0x21ab99+'\x27','updatedAt')[_0x3fef('0x78')]('cm_contact_has_items','ci')['join'](_0x3fef('0x6e'),'h',_0x3fef('0x87'))[_0x3fef('0x3f')](_0x3fef('0x88'),_0x2bd5eb[_0x3fef('0x76')][_0x3fef('0x77')]())[_0x3fef('0x3f')]('h.CampaignId=?',_0x1cc284[_0x3fef('0x57')]['id']['toString']())[_0x3fef('0x3f')](_0x3fef('0x89'),_0x21ab99))[_0x3fef('0x77')]();_0x4b984c[_0x3fef('0x8a')](db[_0x3fef('0x8b')][_0x3fef('0x36')](_0x57fce9));_0x547a21[_0x3fef('0x8a')](db[_0x3fef('0x8b')][_0x3fef('0x36')](_0x2dd846));}return BPromise[_0x3fef('0x8c')](_0x4b984c);}})[_0x3fef('0x2a')](function(){return BPromise[_0x3fef('0x8c')](_0x547a21);})['then'](function(){return _0x51a02e;})[_0x3fef('0x2a')](respondWithResult(_0x3c92d0,null))[_0x3fef('0x48')](handleError(_0x3c92d0,null));};exports[_0x3fef('0x8d')]=function(_0x4897e7,_0x170afd,_0x477884){return db[_0x3fef('0x2f')]['find']({'where':{'id':_0x4897e7[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x170afd,null))['then'](function(_0x5a1144){if(_0x5a1144){return _0x5a1144['removeLists'](_0x4897e7[_0x3fef('0x36')][_0x3fef('0x6a')]);}})[_0x3fef('0x2a')](function(_0x546f63){if(_0x546f63){return db[_0x3fef('0x5c')][_0x3fef('0x27')]({'where':{'ListId':_0x4897e7[_0x3fef('0x36')]['ids'],'CampaignId':_0x4897e7[_0x3fef('0x57')]['id']}})['then'](function(){return _0x546f63;});}})[_0x3fef('0x2a')](respondWithStatusCode(_0x170afd,null))['catch'](handleError(_0x170afd,null));};exports[_0x3fef('0x8e')]=function(_0x2fb0dc,_0x57e857,_0x120a19){var _0x107346={};var _0x13c2fd={};var _0x31a97e;var _0x2c0e0c;return db[_0x3fef('0x2f')][_0x3fef('0x5b')]({'where':{'id':_0x2fb0dc['params']['id']}})['then'](handleEntityNotFound(_0x57e857,null))['then'](function(_0xcad35){if(_0xcad35){_0x31a97e=_0xcad35;_0x13c2fd[_0x3fef('0x34')]=_['keys'](db[_0x3fef('0x66')][_0x3fef('0x30')]);_0x13c2fd[_0x3fef('0x36')]=_['keys'](_0x2fb0dc[_0x3fef('0x36')]);_0x13c2fd[_0x3fef('0x37')]=_[_0x3fef('0x39')](_0x13c2fd[_0x3fef('0x34')],_0x13c2fd['query']);_0x107346['attributes']=_['intersection'](_0x13c2fd[_0x3fef('0x34')],qs[_0x3fef('0x3a')](_0x2fb0dc['query'][_0x3fef('0x3a')]));_0x107346[_0x3fef('0x38')]=_0x107346[_0x3fef('0x38')][_0x3fef('0x3b')]?_0x107346[_0x3fef('0x38')]:_0x13c2fd[_0x3fef('0x34')];_0x107346[_0x3fef('0x3d')]=qs[_0x3fef('0x3e')](_0x2fb0dc[_0x3fef('0x36')][_0x3fef('0x3e')]);_0x107346['where']=qs[_0x3fef('0x37')](_[_0x3fef('0x40')](_0x2fb0dc['query'],_0x13c2fd[_0x3fef('0x37')]));if(_0x2fb0dc[_0x3fef('0x36')]['filter']){_0x107346[_0x3fef('0x3f')]=_['merge'](_0x107346[_0x3fef('0x3f')],{'$or':_[_0x3fef('0x35')](_0x107346['attributes'],function(_0x185c77){var _0x4eee08={};_0x4eee08[_0x185c77]={'$like':'%'+_0x2fb0dc['query'][_0x3fef('0x43')]+'%'};return _0x4eee08;})});}_0x107346=_['merge']({},_0x107346,_0x2fb0dc[_0x3fef('0x4b')]);return _0x31a97e['getBlackLists'](_0x107346);}})['then'](function(_0x2104e4){if(_0x2104e4){_0x2c0e0c=_0x2104e4[_0x3fef('0x3b')];if(!_0x2fb0dc[_0x3fef('0x36')]['hasOwnProperty'](_0x3fef('0x3c'))){_0x107346[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x2fb0dc['query']['limit']);_0x107346['offset']=qs['offset'](_0x2fb0dc['query'][_0x3fef('0x1c')]);}return _0x31a97e['getBlackLists'](_0x107346);}})['then'](function(_0x37c791){if(_0x37c791){return _0x37c791?{'count':_0x2c0e0c,'rows':_0x37c791}:null;}})[_0x3fef('0x2a')](respondWithResult(_0x57e857,null))['catch'](handleError(_0x57e857,null));};exports[_0x3fef('0x8f')]=function(_0x3ab10d,_0x2c60bc,_0x44fe61){var _0x2cf8fd,_0x516cb7;var _0x2a9bca=[];var _0x319d92=moment()[_0x3fef('0x68')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x3fef('0x2f')][_0x3fef('0x4c')]({'where':{'id':_0x3ab10d[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x2c60bc,null))[_0x3fef('0x2a')](function(_0x265403){if(_0x265403){_0x516cb7=_0x265403;return _0x265403[_0x3fef('0x8f')](_0x3ab10d[_0x3fef('0x4e')][_0x3fef('0x6a')],_[_0x3fef('0x59')](_0x3ab10d[_0x3fef('0x4e')],[_0x3fef('0x6a'),'id'])||{});}return null;})['spread'](function(_0x4d1069){var _0x4e1a55;var _0x5bd354;_0x2cf8fd=_0x4d1069||[];var _0x474a9c=[];if(_0x4d1069){for(var _0x231e98=0x0;_0x231e98<_0x4d1069[_0x3fef('0x3b')];_0x231e98+=0x1){var _0x3096f9=_0x4d1069[_0x231e98][_0x3fef('0x52')]({'plain':!![]});_0x4e1a55=squel['insert']()[_0x3fef('0x6d')](_0x3fef('0x90'))[_0x3fef('0x6f')]([_0x3fef('0x70'),_0x3fef('0x75'),_0x3fef('0x72'),_0x3fef('0x5e'),_0x3fef('0x58'),_0x3fef('0x73')],squel[_0x3fef('0x7d')]()['field']('phone',_0x3fef('0x70'))[_0x3fef('0x74')]('id',_0x3fef('0x75'))[_0x3fef('0x74')](_0x3096f9['CmListId'][_0x3fef('0x77')](),'ListId')['field'](_0x3ab10d[_0x3fef('0x57')]['id'][_0x3fef('0x77')](),'CampaignId')[_0x3fef('0x74')](_0x3fef('0x84'),'createdAt')[_0x3fef('0x74')]('NOW()',_0x3fef('0x73'))['from'](_0x3fef('0x79'))[_0x3fef('0x3f')](_0x3fef('0x7a'))[_0x3fef('0x3f')](_0x3fef('0x7b'),_0x3096f9[_0x3fef('0x76')][_0x3fef('0x77')]())[_0x3fef('0x3f')](_0x3fef('0x7c')))[_0x3fef('0x77')]();_0x474a9c['push'](db[_0x3fef('0x8b')]['query'](_0x4e1a55));}return BPromise['all'](_0x474a9c);}})['then'](function(){return _0x2cf8fd;})['then'](respondWithResult(_0x2c60bc,null))['catch'](handleError(_0x2c60bc,null));};exports[_0x3fef('0x91')]=function(_0x5cbc4a,_0x119a9c,_0x568bc7){return db[_0x3fef('0x2f')]['find']({'where':{'id':_0x5cbc4a[_0x3fef('0x57')]['id']}})[_0x3fef('0x2a')](handleEntityNotFound(_0x119a9c,null))[_0x3fef('0x2a')](function(_0xb88a01){if(_0xb88a01){return _0xb88a01[_0x3fef('0x91')](_0x5cbc4a[_0x3fef('0x36')]['ids']);}})[_0x3fef('0x2a')](function(_0x2d07f6){if(_0x2d07f6){return db[_0x3fef('0x64')][_0x3fef('0x27')]({'where':{'ListId':_0x5cbc4a[_0x3fef('0x36')]['ids'],'CampaignId':_0x5cbc4a['params']['id']}})[_0x3fef('0x2a')](function(){return _0x2d07f6;});}})[_0x3fef('0x2a')](respondWithStatusCode(_0x119a9c,null))['catch'](handleError(_0x119a9c,null));}; \ No newline at end of file +var _0x18a9=['intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','getHoppers','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','CmList','getLists','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','ContactId','createdAt','field','NOW()','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','cm_hopper','scheduledAt','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','error','stack','name','send','index','Campaign','rawAttributes','type','key','model','map','query','keys','filters'];(function(_0x4f1a1c,_0x58251a){var _0x1abeeb=function(_0x3de157){while(--_0x3de157){_0x4f1a1c['push'](_0x4f1a1c['shift']());}};_0x1abeeb(++_0x58251a);}(_0x18a9,0x17e));var _0x918a=function(_0x365cf4,_0x54cd92){_0x365cf4=_0x365cf4-0x0;var _0x4f5059=_0x18a9[_0x365cf4];return _0x4f5059;};'use strict';var emlformat=require(_0x918a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x918a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x918a('0x2'));var moment=require(_0x918a('0x3'));var BPromise=require(_0x918a('0x4'));var Mustache=require(_0x918a('0x5'));var util=require(_0x918a('0x6'));var path=require(_0x918a('0x7'));var sox=require(_0x918a('0x8'));var csv=require(_0x918a('0x9'));var ejs=require(_0x918a('0xa'));var fs=require('fs');var fs_extra=require(_0x918a('0xb'));var _=require('lodash');var squel=require(_0x918a('0xc'));var crypto=require('crypto');var jsforce=require(_0x918a('0xd'));var deskjs=require(_0x918a('0xe'));var toCsv=require('to-csv');var querystring=require(_0x918a('0xf'));var Papa=require('papaparse');var Redis=require(_0x918a('0x10'));var authService=require(_0x918a('0x11'));var qs=require(_0x918a('0x12'));var as=require(_0x918a('0x13'));var hardwareService=require(_0x918a('0x14'));var logger=require('../../config/logger')(_0x918a('0x15'));var utils=require(_0x918a('0x16'));var config=require(_0x918a('0x17'));var licenseUtil=require(_0x918a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b8a42,_0x3f02af){_0x3f02af=_0x3f02af||0xcc;return function(_0x316b36){if(_0x316b36){return _0x1b8a42['sendStatus'](_0x3f02af);}return _0x1b8a42[_0x918a('0x19')](_0x3f02af)[_0x918a('0x1a')]();};}function respondWithResult(_0xb72115,_0x53f115){_0x53f115=_0x53f115||0xc8;return function(_0x41e8b0){if(_0x41e8b0){return _0xb72115[_0x918a('0x19')](_0x53f115)['json'](_0x41e8b0);}};}function respondWithFilteredResult(_0x543a84,_0x149566){return function(_0xf6ef2b){if(_0xf6ef2b){var _0x3ec709=typeof _0x149566['offset']===_0x918a('0x1b')&&typeof _0x149566[_0x918a('0x1c')]==='undefined';var _0x3912bc=_0xf6ef2b[_0x918a('0x1d')];var _0x3b5f4b=_0x3ec709?0x0:_0x149566['offset'];var _0x124804=_0x3ec709?_0xf6ef2b[_0x918a('0x1d')]:_0x149566['offset']+_0x149566[_0x918a('0x1c')];var _0x4b7458;if(_0x124804>=_0x3912bc){_0x124804=_0x3912bc;_0x4b7458=0xc8;}else{_0x4b7458=0xce;}_0x543a84['status'](_0x4b7458);return _0x543a84['set'](_0x918a('0x1e'),_0x3b5f4b+'-'+_0x124804+'/'+_0x3912bc)[_0x918a('0x1f')](_0xf6ef2b);}return null;};}function patchUpdates(_0x5e2cb0){return function(_0x1cc225){try{jsonpatch[_0x918a('0x20')](_0x1cc225,_0x5e2cb0,!![]);}catch(_0x34f0c2){return BPromise[_0x918a('0x21')](_0x34f0c2);}return _0x1cc225[_0x918a('0x22')]();};}function saveUpdates(_0xa9110d,_0x1c5f9b){return function(_0x18bdac){if(_0x18bdac){return _0x18bdac[_0x918a('0x23')](_0xa9110d)[_0x918a('0x24')](function(_0x3d090c){return _0x3d090c;});}return null;};}function removeEntity(_0x5a4d87,_0x186fb5){return function(_0x4e4399){if(_0x4e4399){return _0x4e4399[_0x918a('0x25')]()[_0x918a('0x24')](function(){var _0x55256a=_0x4e4399[_0x918a('0x26')]({'plain':!![]});var _0x2ac566=_0x918a('0x27');return db[_0x918a('0x28')]['destroy']({'where':{'type':_0x2ac566,'resourceId':_0x55256a['id']}})[_0x918a('0x24')](function(){return _0x4e4399;});})[_0x918a('0x24')](function(){_0x5a4d87['status'](0xcc)[_0x918a('0x1a')]();});}};}function handleEntityNotFound(_0x1604fd,_0x4cd551){return function(_0x2fe4e7){if(!_0x2fe4e7){_0x1604fd[_0x918a('0x29')](0x194);}return _0x2fe4e7;};}function handleError(_0x24e49c,_0x52a57b){_0x52a57b=_0x52a57b||0x1f4;return function(_0x3a2fe2){logger[_0x918a('0x2a')](_0x3a2fe2[_0x918a('0x2b')]);if(_0x3a2fe2['name']){delete _0x3a2fe2[_0x918a('0x2c')];}_0x24e49c['status'](_0x52a57b)[_0x918a('0x2d')](_0x3a2fe2);};}exports[_0x918a('0x2e')]=function(_0x52969e,_0xd21ff3){var _0x3e02c0={},_0x2b9d34={},_0x9d9a98={'count':0x0,'rows':[]};var _0x1c2e2f=_['map'](db[_0x918a('0x2f')][_0x918a('0x30')],function(_0x41aa2f){return{'name':_0x41aa2f['fieldName'],'type':_0x41aa2f[_0x918a('0x31')][_0x918a('0x32')]};});_0x2b9d34[_0x918a('0x33')]=_[_0x918a('0x34')](_0x1c2e2f,_0x918a('0x2c'));_0x2b9d34[_0x918a('0x35')]=_[_0x918a('0x36')](_0x52969e['query']);_0x2b9d34[_0x918a('0x37')]=_[_0x918a('0x38')](_0x2b9d34[_0x918a('0x33')],_0x2b9d34[_0x918a('0x35')]);_0x3e02c0[_0x918a('0x39')]=_[_0x918a('0x38')](_0x2b9d34[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x52969e[_0x918a('0x35')][_0x918a('0x3a')]));_0x3e02c0[_0x918a('0x39')]=_0x3e02c0['attributes'][_0x918a('0x3b')]?_0x3e02c0['attributes']:_0x2b9d34[_0x918a('0x33')];if(!_0x52969e[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x3e02c0[_0x918a('0x1c')]=qs[_0x918a('0x1c')](_0x52969e['query'][_0x918a('0x1c')]);_0x3e02c0[_0x918a('0x3e')]=qs['offset'](_0x52969e[_0x918a('0x35')][_0x918a('0x3e')]);}_0x3e02c0[_0x918a('0x3f')]=qs[_0x918a('0x40')](_0x52969e[_0x918a('0x35')][_0x918a('0x40')]);_0x3e02c0[_0x918a('0x41')]=qs[_0x918a('0x37')](_['pick'](_0x52969e[_0x918a('0x35')],_0x2b9d34['filters']),_0x1c2e2f);if(_0x52969e[_0x918a('0x35')][_0x918a('0x42')]){_0x3e02c0['where']=_[_0x918a('0x43')](_0x3e02c0[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x1c2e2f,function(_0x138a6c){if(_0x138a6c[_0x918a('0x31')]!==_0x918a('0x44')){var _0x4b3c5a={};_0x4b3c5a[_0x138a6c[_0x918a('0x2c')]]={'$like':'%'+_0x52969e['query'][_0x918a('0x42')]+'%'};return _0x4b3c5a;}})});}_0x3e02c0=_[_0x918a('0x43')]({},_0x3e02c0,_0x52969e[_0x918a('0x45')]);var _0x30e7b3={'where':_0x3e02c0[_0x918a('0x41')]};return db[_0x918a('0x2f')]['count'](_0x30e7b3)[_0x918a('0x24')](function(_0xf91204){_0x9d9a98['count']=_0xf91204;if(_0x52969e[_0x918a('0x35')]['includeAll']){_0x3e02c0[_0x918a('0x46')]=[{'all':!![]}];}return db['Campaign'][_0x918a('0x47')](_0x3e02c0);})[_0x918a('0x24')](function(_0x463fa0){_0x9d9a98[_0x918a('0x48')]=_0x463fa0;return _0x9d9a98;})[_0x918a('0x24')](respondWithFilteredResult(_0xd21ff3,_0x3e02c0))[_0x918a('0x49')](handleError(_0xd21ff3,null));};exports[_0x918a('0x4a')]=function(_0x53913d,_0x53de1c){var _0x58af7e={'raw':![],'where':{'id':_0x53913d[_0x918a('0x4b')]['id']}},_0x1b8298={};_0x1b8298['model']=_[_0x918a('0x36')](db[_0x918a('0x2f')]['rawAttributes']);_0x1b8298[_0x918a('0x35')]=_[_0x918a('0x36')](_0x53913d['query']);_0x1b8298['filters']=_[_0x918a('0x38')](_0x1b8298[_0x918a('0x33')],_0x1b8298['query']);_0x58af7e[_0x918a('0x39')]=_[_0x918a('0x38')](_0x1b8298['model'],qs[_0x918a('0x3a')](_0x53913d[_0x918a('0x35')][_0x918a('0x3a')]));_0x58af7e[_0x918a('0x39')]=_0x58af7e['attributes'][_0x918a('0x3b')]?_0x58af7e[_0x918a('0x39')]:_0x1b8298[_0x918a('0x33')];if(_0x53913d[_0x918a('0x35')][_0x918a('0x4c')]){_0x58af7e['include']=[{'all':!![]}];}_0x58af7e=_[_0x918a('0x43')]({},_0x58af7e,_0x53913d[_0x918a('0x45')]);return db[_0x918a('0x2f')][_0x918a('0x4d')](_0x58af7e)['then'](handleEntityNotFound(_0x53de1c,null))['then'](respondWithResult(_0x53de1c,null))[_0x918a('0x49')](handleError(_0x53de1c,null));};exports[_0x918a('0x4e')]=function(_0xb991d1,_0x248313){return db['Campaign'][_0x918a('0x4e')](_0xb991d1['body'],{})['then'](function(_0x49fde2){var _0x51d3c6=_0xb991d1[_0x918a('0x4f')][_0x918a('0x26')]({'plain':!![]});if(!_0x51d3c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x51d3c6[_0x918a('0x50')]===_0x918a('0x4f')){var _0x13f1fa=_0x49fde2['get']({'plain':!![]});var _0x4360cc='IvrCampaigns';return db[_0x918a('0x51')][_0x918a('0x4d')]({'where':{'name':_0x4360cc,'userProfileId':_0x51d3c6[_0x918a('0x52')]},'raw':!![]})[_0x918a('0x24')](function(_0x496c45){if(_0x496c45&&_0x496c45[_0x918a('0x53')]===0x0){return db[_0x918a('0x28')]['create']({'name':_0x13f1fa[_0x918a('0x2c')],'resourceId':_0x13f1fa['id'],'type':_0x496c45[_0x918a('0x2c')],'sectionId':_0x496c45['id']},{})[_0x918a('0x24')](function(){return _0x49fde2;});}else{return _0x49fde2;}})[_0x918a('0x49')](function(_0x19a8cb){logger[_0x918a('0x2a')](_0x918a('0x54'),_0x19a8cb);throw _0x19a8cb;});}return _0x49fde2;})[_0x918a('0x24')](respondWithResult(_0x248313,0xc9))['catch'](handleError(_0x248313,null));};exports['clone']=function(_0x14e64d,_0x298998){var _0x1047e5={'where':{'id':_0x14e64d[_0x918a('0x4b')]['id']}},_0x4cb14e={};_0x4cb14e[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x2f')][_0x918a('0x30')]);_0x1047e5[_0x918a('0x39')]=_[_0x918a('0x38')](_0x4cb14e[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x14e64d['query'][_0x918a('0x3a')]));_0x1047e5['attributes']=_0x1047e5[_0x918a('0x39')][_0x918a('0x3b')]?_0x1047e5[_0x918a('0x39')]:_0x4cb14e[_0x918a('0x33')];if(_0x14e64d[_0x918a('0x35')]['includeAll']){_0x1047e5['include']=[{'all':!![]}];}_0x1047e5=_[_0x918a('0x43')]({},_0x1047e5,_0x14e64d[_0x918a('0x45')]);return db[_0x918a('0x2f')][_0x918a('0x4d')](_0x1047e5)[_0x918a('0x24')](handleEntityNotFound(_0x298998,null))[_0x918a('0x24')](function(_0x9e1378){if(_0x9e1378){var _0x4c36a1=_0x9e1378[_0x918a('0x26')]({'plain':!![]});_0x4c36a1=qs[_0x918a('0x55')](_0x4c36a1,['id','createdAt',_0x918a('0x56')]);_0x14e64d[_0x918a('0x57')]=_['omit'](_0x14e64d[_0x918a('0x57')],['id','createdAt',_0x918a('0x56')]);return db[_0x918a('0x2f')]['create'](_[_0x918a('0x43')](_0x4c36a1,_0x14e64d[_0x918a('0x57')]),{'include':_0x14e64d[_0x918a('0x35')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x2be04c){var _0x4a8523=_0x14e64d[_0x918a('0x4f')][_0x918a('0x26')]({'plain':!![]});if(!_0x4a8523)throw new Error(_0x918a('0x58'));if(_0x4a8523[_0x918a('0x50')]===_0x918a('0x4f')){var _0x5d0a98=_0x2be04c[_0x918a('0x26')]({'plain':!![]});var _0x3676e0=_0x918a('0x27');return db[_0x918a('0x51')][_0x918a('0x4d')]({'where':{'name':_0x3676e0,'userProfileId':_0x4a8523[_0x918a('0x52')]},'raw':!![]})['then'](function(_0x20ea01){if(_0x20ea01&&_0x20ea01[_0x918a('0x53')]===0x0){return db[_0x918a('0x28')][_0x918a('0x4e')]({'name':_0x5d0a98[_0x918a('0x2c')],'resourceId':_0x5d0a98['id'],'type':_0x20ea01[_0x918a('0x2c')],'sectionId':_0x20ea01['id']},{})[_0x918a('0x24')](function(){return _0x2be04c;});}else{return _0x2be04c;}})[_0x918a('0x49')](function(_0x4a28a0){logger[_0x918a('0x2a')](_0x918a('0x54'),_0x4a28a0);throw _0x4a28a0;});}return _0x2be04c;});}})['then'](respondWithResult(_0x298998,0xc9))[_0x918a('0x49')](handleError(_0x298998,null));};exports['update']=function(_0x50f24f,_0x13c541){if(_0x50f24f[_0x918a('0x57')]['id']){delete _0x50f24f[_0x918a('0x57')]['id'];}return db['Campaign'][_0x918a('0x4d')]({'where':{'id':_0x50f24f[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x13c541,null))[_0x918a('0x24')](saveUpdates(_0x50f24f[_0x918a('0x57')],null))[_0x918a('0x24')](respondWithResult(_0x13c541,null))[_0x918a('0x49')](handleError(_0x13c541,null));};exports[_0x918a('0x25')]=function(_0x316857,_0x2c7b66){return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x316857[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x2c7b66,null))[_0x918a('0x24')](removeEntity(_0x2c7b66,null))['catch'](handleError(_0x2c7b66,null));};exports[_0x918a('0x59')]=function(_0xaeb91d,_0x5984cc,_0x3fdd9b){var _0x4a7c9c={'raw':!![],'where':{}};var _0x2871ff={};var _0x50a108={'count':0x0,'rows':[]};return db['Campaign'][_0x918a('0x5a')]({'where':{'id':_0xaeb91d['params']['id']}})['then'](handleEntityNotFound(_0x5984cc,null))['then'](function(_0x53a938){if(_0x53a938){_0x2871ff[_0x918a('0x33')]=_['keys'](db[_0x918a('0x5b')]['rawAttributes']);_0x2871ff[_0x918a('0x35')]=_[_0x918a('0x36')](_0xaeb91d['query']);_0x2871ff[_0x918a('0x37')]=_[_0x918a('0x38')](_0x2871ff['model'],_0x2871ff[_0x918a('0x35')]);_0x4a7c9c[_0x918a('0x39')]=_[_0x918a('0x38')](_0x2871ff['model'],qs[_0x918a('0x3a')](_0xaeb91d['query'][_0x918a('0x3a')]));_0x4a7c9c[_0x918a('0x39')]=_0x4a7c9c['attributes'][_0x918a('0x3b')]?_0x4a7c9c[_0x918a('0x39')]:_0x2871ff[_0x918a('0x33')];if(!_0xaeb91d[_0x918a('0x35')][_0x918a('0x3c')]('nolimit')){_0x4a7c9c[_0x918a('0x1c')]=qs[_0x918a('0x1c')](_0xaeb91d[_0x918a('0x35')][_0x918a('0x1c')]);_0x4a7c9c[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0xaeb91d[_0x918a('0x35')][_0x918a('0x3e')]);}_0x4a7c9c[_0x918a('0x3f')]=qs['sort'](_0xaeb91d['query'][_0x918a('0x40')]);_0x4a7c9c[_0x918a('0x41')]=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0xaeb91d[_0x918a('0x35')],_0x2871ff[_0x918a('0x37')]));_0x4a7c9c[_0x918a('0x41')][_0x918a('0x5d')]=_0x53a938['id'];if(_0xaeb91d[_0x918a('0x35')][_0x918a('0x42')]){_0x4a7c9c[_0x918a('0x41')]=_[_0x918a('0x43')](_0x4a7c9c[_0x918a('0x41')],{'$or':_['map'](_0x4a7c9c['attributes'],function(_0x1737d6){var _0x987a4a={};_0x987a4a[_0x1737d6]={'$like':'%'+_0xaeb91d['query'][_0x918a('0x42')]+'%'};return _0x987a4a;})});}_0x4a7c9c=_[_0x918a('0x43')]({},_0x4a7c9c,_0xaeb91d[_0x918a('0x45')]);return db['CmHopper'][_0x918a('0x1d')]({'where':_0x4a7c9c[_0x918a('0x41')]})[_0x918a('0x24')](function(_0x3afd72){_0x50a108[_0x918a('0x1d')]=_0x3afd72;if(_0xaeb91d[_0x918a('0x35')][_0x918a('0x4c')]){_0x4a7c9c[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x5b')][_0x918a('0x47')](_0x4a7c9c);})[_0x918a('0x24')](function(_0x53e2c1){_0x50a108['rows']=_0x53e2c1;return _0x50a108;});}})[_0x918a('0x24')](respondWithFilteredResult(_0x5984cc,_0x4a7c9c))[_0x918a('0x49')](handleError(_0x5984cc,null));};exports[_0x918a('0x5e')]=function(_0xcdb8d6,_0x55ffb5,_0x4eafa6){var _0x1639d={'raw':!![],'where':{}};var _0x2698ef={};var _0x323d94={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xcdb8d6['params']['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x55ffb5,null))[_0x918a('0x24')](function(_0x5d0965){if(_0x5d0965){_0x2698ef[_0x918a('0x33')]=_['keys'](db[_0x918a('0x5f')][_0x918a('0x30')]);_0x2698ef['query']=_['keys'](_0xcdb8d6[_0x918a('0x35')]);_0x2698ef['filters']=_['intersection'](_0x2698ef['model'],_0x2698ef[_0x918a('0x35')]);_0x1639d[_0x918a('0x39')]=_[_0x918a('0x38')](_0x2698ef[_0x918a('0x33')],qs[_0x918a('0x3a')](_0xcdb8d6[_0x918a('0x35')][_0x918a('0x3a')]));_0x1639d[_0x918a('0x39')]=_0x1639d[_0x918a('0x39')][_0x918a('0x3b')]?_0x1639d[_0x918a('0x39')]:_0x2698ef[_0x918a('0x33')];if(!_0xcdb8d6['query'][_0x918a('0x3c')](_0x918a('0x3d'))){_0x1639d['limit']=qs['limit'](_0xcdb8d6[_0x918a('0x35')][_0x918a('0x1c')]);_0x1639d['offset']=qs['offset'](_0xcdb8d6[_0x918a('0x35')][_0x918a('0x3e')]);}_0x1639d['order']=qs[_0x918a('0x40')](_0xcdb8d6['query'][_0x918a('0x40')]);_0x1639d[_0x918a('0x41')]=qs[_0x918a('0x37')](_['pick'](_0xcdb8d6[_0x918a('0x35')],_0x2698ef[_0x918a('0x37')]));_0x1639d[_0x918a('0x41')][_0x918a('0x5d')]=_0x5d0965['id'];if(_0xcdb8d6[_0x918a('0x35')][_0x918a('0x42')]){_0x1639d[_0x918a('0x41')]=_['merge'](_0x1639d[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x1639d[_0x918a('0x39')],function(_0xb47646){var _0x5722d0={};_0x5722d0[_0xb47646]={'$like':'%'+_0xcdb8d6[_0x918a('0x35')][_0x918a('0x42')]+'%'};return _0x5722d0;})});}_0x1639d=_[_0x918a('0x43')]({},_0x1639d,_0xcdb8d6['options']);return db[_0x918a('0x5f')]['count']({'where':_0x1639d[_0x918a('0x41')]})[_0x918a('0x24')](function(_0x420a76){_0x323d94[_0x918a('0x1d')]=_0x420a76;if(_0xcdb8d6[_0x918a('0x35')]['includeAll']){_0x1639d[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x5f')][_0x918a('0x47')](_0x1639d);})[_0x918a('0x24')](function(_0x495dee){_0x323d94[_0x918a('0x48')]=_0x495dee;return _0x323d94;});}})[_0x918a('0x24')](respondWithFilteredResult(_0x55ffb5,_0x1639d))['catch'](handleError(_0x55ffb5,null));};exports[_0x918a('0x60')]=function(_0x15646f,_0xeebdfc,_0x3be5ba){var _0x17fad2={'raw':!![],'where':{}};var _0x8647b1={};var _0x10c2a7={'count':0x0,'rows':[]};return db['Campaign'][_0x918a('0x5a')]({'where':{'id':_0x15646f[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0xeebdfc,null))['then'](function(_0xf2109){if(_0xf2109){_0x8647b1['model']=_[_0x918a('0x36')](db[_0x918a('0x61')][_0x918a('0x30')]);_0x8647b1[_0x918a('0x35')]=_['keys'](_0x15646f['query']);_0x8647b1[_0x918a('0x37')]=_['intersection'](_0x8647b1[_0x918a('0x33')],_0x8647b1[_0x918a('0x35')]);_0x17fad2[_0x918a('0x39')]=_['intersection'](_0x8647b1[_0x918a('0x33')],qs['fields'](_0x15646f[_0x918a('0x35')]['fields']));_0x17fad2[_0x918a('0x39')]=_0x17fad2['attributes'][_0x918a('0x3b')]?_0x17fad2[_0x918a('0x39')]:_0x8647b1[_0x918a('0x33')];if(!_0x15646f[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x17fad2[_0x918a('0x1c')]=qs['limit'](_0x15646f[_0x918a('0x35')][_0x918a('0x1c')]);_0x17fad2[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0x15646f[_0x918a('0x35')][_0x918a('0x3e')]);}_0x17fad2[_0x918a('0x3f')]=qs[_0x918a('0x40')](_0x15646f[_0x918a('0x35')][_0x918a('0x40')]);_0x17fad2[_0x918a('0x41')]=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x15646f[_0x918a('0x35')],_0x8647b1[_0x918a('0x37')]));_0x17fad2[_0x918a('0x41')]['CampaignId']=_0xf2109['id'];if(_0x15646f[_0x918a('0x35')][_0x918a('0x42')]){_0x17fad2[_0x918a('0x41')]=_[_0x918a('0x43')](_0x17fad2[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x17fad2['attributes'],function(_0x56480a){var _0x246b5b={};_0x246b5b[_0x56480a]={'$like':'%'+_0x15646f[_0x918a('0x35')][_0x918a('0x42')]+'%'};return _0x246b5b;})});}_0x17fad2=_[_0x918a('0x43')]({},_0x17fad2,_0x15646f[_0x918a('0x45')]);return db[_0x918a('0x61')][_0x918a('0x1d')]({'where':_0x17fad2[_0x918a('0x41')]})[_0x918a('0x24')](function(_0x18e9f8){_0x10c2a7[_0x918a('0x1d')]=_0x18e9f8;if(_0x15646f[_0x918a('0x35')]['includeAll']){_0x17fad2[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x61')][_0x918a('0x47')](_0x17fad2);})[_0x918a('0x24')](function(_0x1caa29){_0x10c2a7[_0x918a('0x48')]=_0x1caa29;return _0x10c2a7;});}})[_0x918a('0x24')](respondWithFilteredResult(_0xeebdfc,_0x17fad2))[_0x918a('0x49')](handleError(_0xeebdfc,null));};exports['getHopperBlacks']=function(_0x4ec4ce,_0x46ef36,_0x18cf89){var _0x53c6dd={'raw':!![],'where':{}};var _0x26689b={};var _0x485c0b={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4ec4ce[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x46ef36,null))[_0x918a('0x24')](function(_0x22b925){if(_0x22b925){_0x26689b[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x62')][_0x918a('0x30')]);_0x26689b['query']=_[_0x918a('0x36')](_0x4ec4ce[_0x918a('0x35')]);_0x26689b[_0x918a('0x37')]=_['intersection'](_0x26689b['model'],_0x26689b['query']);_0x53c6dd['attributes']=_[_0x918a('0x38')](_0x26689b[_0x918a('0x33')],qs['fields'](_0x4ec4ce[_0x918a('0x35')][_0x918a('0x3a')]));_0x53c6dd[_0x918a('0x39')]=_0x53c6dd[_0x918a('0x39')]['length']?_0x53c6dd[_0x918a('0x39')]:_0x26689b[_0x918a('0x33')];if(!_0x4ec4ce[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x53c6dd['limit']=qs[_0x918a('0x1c')](_0x4ec4ce['query'][_0x918a('0x1c')]);_0x53c6dd[_0x918a('0x3e')]=qs['offset'](_0x4ec4ce[_0x918a('0x35')]['offset']);}_0x53c6dd[_0x918a('0x3f')]=qs[_0x918a('0x40')](_0x4ec4ce['query'][_0x918a('0x40')]);_0x53c6dd[_0x918a('0x41')]=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x4ec4ce[_0x918a('0x35')],_0x26689b[_0x918a('0x37')]));_0x53c6dd['where'][_0x918a('0x5d')]=_0x22b925['id'];if(_0x4ec4ce[_0x918a('0x35')][_0x918a('0x42')]){_0x53c6dd[_0x918a('0x41')]=_['merge'](_0x53c6dd[_0x918a('0x41')],{'$or':_['map'](_0x53c6dd[_0x918a('0x39')],function(_0xe1717c){var _0x1a8334={};_0x1a8334[_0xe1717c]={'$like':'%'+_0x4ec4ce['query'][_0x918a('0x42')]+'%'};return _0x1a8334;})});}_0x53c6dd=_[_0x918a('0x43')]({},_0x53c6dd,_0x4ec4ce[_0x918a('0x45')]);return db['CmHopperBlack']['count']({'where':_0x53c6dd['where']})['then'](function(_0x4cad29){_0x485c0b[_0x918a('0x1d')]=_0x4cad29;if(_0x4ec4ce[_0x918a('0x35')][_0x918a('0x4c')]){_0x53c6dd[_0x918a('0x46')]=[{'all':!![]}];}return db[_0x918a('0x62')][_0x918a('0x47')](_0x53c6dd);})[_0x918a('0x24')](function(_0x5a1098){_0x485c0b[_0x918a('0x48')]=_0x5a1098;return _0x485c0b;});}})[_0x918a('0x24')](respondWithFilteredResult(_0x46ef36,_0x53c6dd))['catch'](handleError(_0x46ef36,null));};exports['getLists']=function(_0x3de307,_0x30bcfd,_0x1f5a9c){var _0x15f5d6={};var _0x4cb9aa={};var _0x53f040;var _0x10640d;return db[_0x918a('0x2f')][_0x918a('0x5a')]({'where':{'id':_0x3de307[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x30bcfd,null))[_0x918a('0x24')](function(_0x4669d8){if(_0x4669d8){_0x53f040=_0x4669d8;_0x4cb9aa[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x63')]['rawAttributes']);_0x4cb9aa['query']=_[_0x918a('0x36')](_0x3de307[_0x918a('0x35')]);_0x4cb9aa[_0x918a('0x37')]=_['intersection'](_0x4cb9aa[_0x918a('0x33')],_0x4cb9aa[_0x918a('0x35')]);_0x15f5d6['attributes']=_['intersection'](_0x4cb9aa[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x3de307['query']['fields']));_0x15f5d6[_0x918a('0x39')]=_0x15f5d6[_0x918a('0x39')][_0x918a('0x3b')]?_0x15f5d6[_0x918a('0x39')]:_0x4cb9aa['model'];_0x15f5d6['order']=qs[_0x918a('0x40')](_0x3de307['query'][_0x918a('0x40')]);_0x15f5d6['where']=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x3de307[_0x918a('0x35')],_0x4cb9aa[_0x918a('0x37')]));if(_0x3de307['query']['filter']){_0x15f5d6['where']=_['merge'](_0x15f5d6[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x15f5d6[_0x918a('0x39')],function(_0x1d4a3e){var _0x1e9c2f={};_0x1e9c2f[_0x1d4a3e]={'$like':'%'+_0x3de307[_0x918a('0x35')]['filter']+'%'};return _0x1e9c2f;})});}_0x15f5d6=_[_0x918a('0x43')]({},_0x15f5d6,_0x3de307[_0x918a('0x45')]);return _0x53f040[_0x918a('0x64')](_0x15f5d6);}})['then'](function(_0x1d15a8){if(_0x1d15a8){_0x10640d=_0x1d15a8['length'];if(!_0x3de307[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x15f5d6[_0x918a('0x1c')]=qs['limit'](_0x3de307[_0x918a('0x35')][_0x918a('0x1c')]);_0x15f5d6[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0x3de307['query'][_0x918a('0x3e')]);}return _0x53f040['getLists'](_0x15f5d6);}})['then'](function(_0x20075c){if(_0x20075c){return _0x20075c?{'count':_0x10640d,'rows':_0x20075c}:null;}})[_0x918a('0x24')](respondWithResult(_0x30bcfd,null))['catch'](handleError(_0x30bcfd,null));};exports[_0x918a('0x65')]=function(_0x3fffed,_0xe31374,_0x3599be){var _0x2c5130,_0x2eab1c;var _0x189d92=[];var _0x2e70ab=moment()[_0x918a('0x66')](_0x918a('0x67'));return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x3fffed[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0xe31374,null))['then'](function(_0xe23009){if(_0xe23009){_0x2eab1c=_0xe23009;return _0xe23009[_0x918a('0x65')](_0x3fffed[_0x918a('0x57')][_0x918a('0x68')],_[_0x918a('0x55')](_0x3fffed[_0x918a('0x57')],[_0x918a('0x68'),'id'])||{});}return null;})[_0x918a('0x69')](function(_0x16e805){var _0x50af09;var _0x4ae4b2;_0x2c5130=_0x16e805||[];var _0xd5ec6e=[];if(_0x16e805){for(var _0x581d17=0x0;_0x581d17<_0x16e805[_0x918a('0x3b')];_0x581d17+=0x1){var _0xb5dcb8=_0x16e805[_0x581d17][_0x918a('0x26')]({'plain':!![]});_0x2eab1c['dialCheckDuplicateType']=_0x3fffed[_0x918a('0x57')][_0x918a('0x6a')]?_0x3fffed['body']['dialCheckDuplicateType']:_0x2eab1c['dialCheckDuplicateType'];switch(_0x2eab1c['dialCheckDuplicateType']){case _0x918a('0x6b'):_0x50af09=squel[_0x918a('0x6c')]()[_0x918a('0x6d')]('cm_hopper')[_0x918a('0x6e')]([_0x918a('0x6f'),'scheduledAt',_0x918a('0x70'),'ListId',_0x918a('0x5d'),_0x918a('0x71'),'updatedAt'],squel['select']()[_0x918a('0x72')](_0x918a('0x6f'),_0x918a('0x6f'))[_0x918a('0x72')](_0x918a('0x73'),'scheduledAt')[_0x918a('0x72')]('id',_0x918a('0x70'))[_0x918a('0x72')](_0xb5dcb8[_0x918a('0x74')][_0x918a('0x75')](),_0x918a('0x76'))[_0x918a('0x72')](_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')](),_0x918a('0x5d'))['field']('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x56'))[_0x918a('0x77')](_0x918a('0x78'))[_0x918a('0x41')](_0x918a('0x79'))[_0x918a('0x41')](_0x918a('0x7a'),_0xb5dcb8[_0x918a('0x74')][_0x918a('0x75')]())['where'](_0x918a('0x7b'))[_0x918a('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x918a('0x7c')]()['field'](_0x918a('0x7d'))[_0x918a('0x77')](_0x918a('0x7e'))[_0x918a('0x41')](_0x918a('0x7f'),_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x918a('0x7c')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x918a('0x80'))[_0x918a('0x41')](_0x918a('0x7f'),_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')]())))[_0x918a('0x75')]();break;case'onlyIfOpen':_0x50af09=squel[_0x918a('0x6c')]()['into']('cm_hopper')[_0x918a('0x6e')]([_0x918a('0x6f'),_0x918a('0x81'),_0x918a('0x70'),_0x918a('0x76'),_0x918a('0x5d'),_0x918a('0x71'),'updatedAt'],squel['select']()[_0x918a('0x72')]('phone',_0x918a('0x6f'))['field']('NOW()',_0x918a('0x81'))['field']('id','ContactId')['field'](_0xb5dcb8[_0x918a('0x74')]['toString'](),_0x918a('0x76'))[_0x918a('0x72')](_0x3fffed['params']['id'][_0x918a('0x75')](),_0x918a('0x5d'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27','updatedAt')[_0x918a('0x77')](_0x918a('0x78'))[_0x918a('0x41')](_0x918a('0x79'))[_0x918a('0x41')](_0x918a('0x7a'),_0xb5dcb8['CmListId'][_0x918a('0x75')]())[_0x918a('0x41')](_0x918a('0x7b'))[_0x918a('0x41')]('phone\x20NOT\x20IN\x20(?)',squel[_0x918a('0x7c')]()[_0x918a('0x72')](_0x918a('0x82'))[_0x918a('0x77')](_0x918a('0x80'))['where'](_0x918a('0x7f'),_0x3fffed[_0x918a('0x4b')]['id'][_0x918a('0x75')]())))[_0x918a('0x75')]();break;default:_0x50af09=squel['insert']()[_0x918a('0x6d')]('cm_hopper')[_0x918a('0x6e')]([_0x918a('0x6f'),_0x918a('0x81'),_0x918a('0x70'),'ListId','CampaignId',_0x918a('0x71'),'updatedAt'],squel['select']()['field'](_0x918a('0x6f'),'phone')[_0x918a('0x72')](_0x918a('0x73'),_0x918a('0x81'))['field']('id',_0x918a('0x70'))[_0x918a('0x72')](_0xb5dcb8['CmListId'][_0x918a('0x75')](),'ListId')[_0x918a('0x72')](_0x3fffed[_0x918a('0x4b')]['id']['toString'](),_0x918a('0x5d'))['field']('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x56'))['from'](_0x918a('0x78'))['where'](_0x918a('0x79'))[_0x918a('0x41')]('ListId\x20=\x20?',_0xb5dcb8[_0x918a('0x74')]['toString']())[_0x918a('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x918a('0x75')]();}_0x4ae4b2=squel[_0x918a('0x6c')]()[_0x918a('0x6d')](_0x918a('0x83'))[_0x918a('0x6e')]([_0x918a('0x84'),_0x918a('0x81'),'phone',_0x918a('0x85'),'createdAt','updatedAt'],squel[_0x918a('0x7c')]()[_0x918a('0x72')](_0x918a('0x86'),'id')['field'](_0x918a('0x73'),_0x918a('0x81'))[_0x918a('0x72')]('ci.item','phone')[_0x918a('0x72')]('ci.OrderBY','OrderBy')['field']('\x27'+_0x2e70ab+'\x27',_0x918a('0x71'))[_0x918a('0x72')]('\x27'+_0x2e70ab+'\x27',_0x918a('0x56'))[_0x918a('0x77')](_0x918a('0x87'),'ci')['join'](_0x918a('0x80'),'h',_0x918a('0x88'))[_0x918a('0x41')](_0x918a('0x89'),_0xb5dcb8[_0x918a('0x74')][_0x918a('0x75')]())['where'](_0x918a('0x8a'),_0x3fffed['params']['id'][_0x918a('0x75')]())[_0x918a('0x41')]('h.createdAt\x20=\x20?',_0x2e70ab))[_0x918a('0x75')]();_0xd5ec6e[_0x918a('0x8b')](db['sequelize']['query'](_0x50af09));_0x189d92[_0x918a('0x8b')](db[_0x918a('0x8c')]['query'](_0x4ae4b2));}return BPromise[_0x918a('0x8d')](_0xd5ec6e);}})[_0x918a('0x24')](function(){return BPromise[_0x918a('0x8d')](_0x189d92);})[_0x918a('0x24')](function(){return _0x2c5130;})[_0x918a('0x24')](respondWithResult(_0xe31374,null))['catch'](handleError(_0xe31374,null));};exports[_0x918a('0x8e')]=function(_0x505efd,_0x1677ea,_0xd7fc11){return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x505efd[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x1677ea,null))[_0x918a('0x24')](function(_0x38bf23){if(_0x38bf23){return _0x38bf23[_0x918a('0x8e')](_0x505efd['query'][_0x918a('0x68')]);}})[_0x918a('0x24')](function(_0x159735){if(_0x159735){return db['CmHopper'][_0x918a('0x25')]({'where':{'ListId':_0x505efd['query'][_0x918a('0x68')],'CampaignId':_0x505efd[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](function(){return _0x159735;});}})['then'](respondWithStatusCode(_0x1677ea,null))[_0x918a('0x49')](handleError(_0x1677ea,null));};exports[_0x918a('0x8f')]=function(_0x36f84c,_0x4c1fc9,_0x3d5ec8){var _0x4ea36d={};var _0xcdbc95={};var _0x1973c6;var _0x332ac5;return db[_0x918a('0x2f')][_0x918a('0x5a')]({'where':{'id':_0x36f84c[_0x918a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4c1fc9,null))[_0x918a('0x24')](function(_0x3f8949){if(_0x3f8949){_0x1973c6=_0x3f8949;_0xcdbc95[_0x918a('0x33')]=_[_0x918a('0x36')](db[_0x918a('0x63')][_0x918a('0x30')]);_0xcdbc95[_0x918a('0x35')]=_[_0x918a('0x36')](_0x36f84c[_0x918a('0x35')]);_0xcdbc95[_0x918a('0x37')]=_[_0x918a('0x38')](_0xcdbc95[_0x918a('0x33')],_0xcdbc95[_0x918a('0x35')]);_0x4ea36d[_0x918a('0x39')]=_[_0x918a('0x38')](_0xcdbc95[_0x918a('0x33')],qs[_0x918a('0x3a')](_0x36f84c[_0x918a('0x35')][_0x918a('0x3a')]));_0x4ea36d[_0x918a('0x39')]=_0x4ea36d[_0x918a('0x39')]['length']?_0x4ea36d[_0x918a('0x39')]:_0xcdbc95[_0x918a('0x33')];_0x4ea36d[_0x918a('0x3f')]=qs['sort'](_0x36f84c['query']['sort']);_0x4ea36d['where']=qs[_0x918a('0x37')](_[_0x918a('0x5c')](_0x36f84c[_0x918a('0x35')],_0xcdbc95[_0x918a('0x37')]));if(_0x36f84c[_0x918a('0x35')][_0x918a('0x42')]){_0x4ea36d['where']=_[_0x918a('0x43')](_0x4ea36d[_0x918a('0x41')],{'$or':_[_0x918a('0x34')](_0x4ea36d[_0x918a('0x39')],function(_0x46fdf1){var _0x28458f={};_0x28458f[_0x46fdf1]={'$like':'%'+_0x36f84c[_0x918a('0x35')][_0x918a('0x42')]+'%'};return _0x28458f;})});}_0x4ea36d=_[_0x918a('0x43')]({},_0x4ea36d,_0x36f84c[_0x918a('0x45')]);return _0x1973c6['getBlackLists'](_0x4ea36d);}})[_0x918a('0x24')](function(_0x549bcd){if(_0x549bcd){_0x332ac5=_0x549bcd[_0x918a('0x3b')];if(!_0x36f84c[_0x918a('0x35')][_0x918a('0x3c')](_0x918a('0x3d'))){_0x4ea36d[_0x918a('0x1c')]=qs[_0x918a('0x1c')](_0x36f84c[_0x918a('0x35')][_0x918a('0x1c')]);_0x4ea36d[_0x918a('0x3e')]=qs[_0x918a('0x3e')](_0x36f84c[_0x918a('0x35')][_0x918a('0x3e')]);}return _0x1973c6[_0x918a('0x8f')](_0x4ea36d);}})[_0x918a('0x24')](function(_0xe9e553){if(_0xe9e553){return _0xe9e553?{'count':_0x332ac5,'rows':_0xe9e553}:null;}})[_0x918a('0x24')](respondWithResult(_0x4c1fc9,null))[_0x918a('0x49')](handleError(_0x4c1fc9,null));};exports['addBlackLists']=function(_0x1cd0c4,_0xe8e0e7,_0x5e7624){var _0x58bb2e,_0x8845f1;var _0x142839=[];var _0x451834=moment()['format'](_0x918a('0x67'));return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x1cd0c4[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0xe8e0e7,null))[_0x918a('0x24')](function(_0x15a827){if(_0x15a827){_0x8845f1=_0x15a827;return _0x15a827[_0x918a('0x90')](_0x1cd0c4['body'][_0x918a('0x68')],_[_0x918a('0x55')](_0x1cd0c4[_0x918a('0x57')],['ids','id'])||{});}return null;})['spread'](function(_0x559ea7){var _0x912ace;var _0x5b03cd;_0x58bb2e=_0x559ea7||[];var _0x775ab5=[];if(_0x559ea7){for(var _0x589a11=0x0;_0x589a11<_0x559ea7[_0x918a('0x3b')];_0x589a11+=0x1){var _0x4a5711=_0x559ea7[_0x589a11]['get']({'plain':!![]});_0x912ace=squel[_0x918a('0x6c')]()['into']('cm_hopper_black')[_0x918a('0x6e')](['phone','ContactId',_0x918a('0x76'),'CampaignId',_0x918a('0x71'),_0x918a('0x56')],squel['select']()[_0x918a('0x72')](_0x918a('0x6f'),'phone')[_0x918a('0x72')]('id',_0x918a('0x70'))[_0x918a('0x72')](_0x4a5711['CmListId'][_0x918a('0x75')](),'ListId')[_0x918a('0x72')](_0x1cd0c4[_0x918a('0x4b')]['id']['toString'](),_0x918a('0x5d'))['field'](_0x918a('0x73'),'createdAt')[_0x918a('0x72')](_0x918a('0x73'),_0x918a('0x56'))[_0x918a('0x77')](_0x918a('0x78'))['where'](_0x918a('0x79'))[_0x918a('0x41')](_0x918a('0x7a'),_0x4a5711['CmListId']['toString']())[_0x918a('0x41')]('phone\x20IS\x20NOT\x20NULL'))[_0x918a('0x75')]();_0x775ab5['push'](db['sequelize'][_0x918a('0x35')](_0x912ace));}return BPromise[_0x918a('0x8d')](_0x775ab5);}})['then'](function(){return _0x58bb2e;})[_0x918a('0x24')](respondWithResult(_0xe8e0e7,null))[_0x918a('0x49')](handleError(_0xe8e0e7,null));};exports[_0x918a('0x91')]=function(_0x178e56,_0x386ae1,_0x44552a){return db[_0x918a('0x2f')][_0x918a('0x4d')]({'where':{'id':_0x178e56[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](handleEntityNotFound(_0x386ae1,null))[_0x918a('0x24')](function(_0x430e38){if(_0x430e38){return _0x430e38['removeBlackLists'](_0x178e56[_0x918a('0x35')][_0x918a('0x68')]);}})[_0x918a('0x24')](function(_0x213c38){if(_0x213c38){return db[_0x918a('0x62')][_0x918a('0x25')]({'where':{'ListId':_0x178e56[_0x918a('0x35')]['ids'],'CampaignId':_0x178e56[_0x918a('0x4b')]['id']}})[_0x918a('0x24')](function(){return _0x213c38;});}})[_0x918a('0x24')](respondWithStatusCode(_0x386ae1,null))[_0x918a('0x49')](handleError(_0x386ae1,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 4b30fc1..ae9ef1d 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5627e1,_0x1b2dbf){var _0x2f013f=function(_0x142015){while(--_0x142015){_0x5627e1['push'](_0x5627e1['shift']());}};_0x2f013f(++_0x1b2dbf);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 42980f7..38e67b0 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 _0x89fe=['jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x70579e,_0x492e0c){var _0x53291c=function(_0xfb7134){while(--_0xfb7134){_0x70579e['push'](_0x70579e['shift']());}};_0x53291c(++_0x492e0c);}(_0x89fe,0x83));var _0xe89f=function(_0x51f54b,_0x11d336){_0x51f54b=_0x51f54b-0x0;var _0x37f35c=_0x89fe[_0x51f54b];return _0x37f35c;};'use strict';var _=require(_0xe89f('0x0'));var util=require(_0xe89f('0x1'));var moment=require(_0xe89f('0x2'));var BPromise=require(_0xe89f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe89f('0x4'));var db=require(_0xe89f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe89f('0x6'))(_0xe89f('0x7'));var config=require(_0xe89f('0x8'));var jayson=require(_0xe89f('0x9'));var client=jayson[_0xe89f('0xa')][_0xe89f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24358f,_0x5427d2,_0x4639f0){return new BPromise(function(_0x3e9998,_0x7043f3){return client[_0xe89f('0xc')](_0x24358f,_0x4639f0)[_0xe89f('0xd')](function(_0x4fa2fa){logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));logger[_0xe89f('0x11')](_0xe89f('0x12'),_0x5427d2,_0xe89f('0x10'),JSON[_0xe89f('0x13')](_0x4fa2fa));if(_0x4fa2fa[_0xe89f('0x14')]){if(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x15')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error']['message']);return _0x7043f3(_0x4fa2fa['error'][_0xe89f('0x16')]);}logger[_0xe89f('0x14')]('Campaign,\x20%s,\x20%s',_0x5427d2,_0x4fa2fa['error'][_0xe89f('0x16')]);return _0x3e9998(_0x4fa2fa[_0xe89f('0x14')][_0xe89f('0x16')]);}else{logger[_0xe89f('0xe')](_0xe89f('0xf'),_0x5427d2,_0xe89f('0x10'));_0x3e9998(_0x4fa2fa[_0xe89f('0x17')][_0xe89f('0x16')]);}})[_0xe89f('0x18')](function(_0x16bfe0){logger['error'](_0xe89f('0xf'),_0x5427d2,_0x16bfe0);_0x7043f3(_0x16bfe0);});});}exports[_0xe89f('0x19')]=function(_0x510e6e){var _0x5106e4=this;return new Promise(function(_0x11e5e1,_0x127517){return db[_0xe89f('0x1a')][_0xe89f('0x1b')]({'raw':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e['options']['raw']===undefined?!![]:![]:!![],'where':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e['options'][_0xe89f('0x1d')]||null:null,'attributes':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e[_0xe89f('0x1c')][_0xe89f('0x1e')]||null:null,'limit':_0x510e6e[_0xe89f('0x1c')]?_0x510e6e[_0xe89f('0x1c')][_0xe89f('0x1f')]||null:null,'include':_0x510e6e['options']?_0x510e6e[_0xe89f('0x1c')][_0xe89f('0x20')]?_['map'](_0x510e6e['options'][_0xe89f('0x20')],function(_0x5b548d){return{'model':db[_0x5b548d[_0xe89f('0x21')]],'as':_0x5b548d['as'],'attributes':_0x5b548d[_0xe89f('0x1e')],'include':_0x5b548d['include']?_[_0xe89f('0x22')](_0x5b548d[_0xe89f('0x20')],function(_0x5b3135){return{'model':db[_0x5b3135['model']],'as':_0x5b3135['as'],'attributes':_0x5b3135[_0xe89f('0x1e')],'include':_0x5b3135[_0xe89f('0x20')]?_[_0xe89f('0x22')](_0x5b3135[_0xe89f('0x20')],function(_0x288d8f){return{'model':db[_0x288d8f[_0xe89f('0x21')]],'as':_0x288d8f['as'],'attributes':_0x288d8f[_0xe89f('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x557bcb){logger[_0xe89f('0xe')](_0xe89f('0x19'),_0x510e6e);logger[_0xe89f('0x11')](_0xe89f('0x19'),_0x510e6e,JSON[_0xe89f('0x13')](_0x557bcb));_0x11e5e1(_0x557bcb);})['catch'](function(_0x3c773c){logger[_0xe89f('0x14')](_0xe89f('0x19'),_0x3c773c[_0xe89f('0x16')],_0x510e6e);_0x127517(_0x5106e4[_0xe89f('0x14')](0x1f4,_0x3c773c[_0xe89f('0x16')]));});});}; \ No newline at end of file +var _0x3299=['Campaign,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetCampaign','findAll','options','where','attributes','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug'];(function(_0x3be7fe,_0x315935){var _0x3b3cfa=function(_0x1134ba){while(--_0x1134ba){_0x3be7fe['push'](_0x3be7fe['shift']());}};_0x3b3cfa(++_0x315935);}(_0x3299,0x1bc));var _0x9329=function(_0x33847b,_0x31e38b){_0x33847b=_0x33847b-0x0;var _0x352058=_0x3299[_0x33847b];return _0x352058;};'use strict';var _=require('lodash');var util=require(_0x9329('0x0'));var moment=require(_0x9329('0x1'));var BPromise=require(_0x9329('0x2'));var rs=require(_0x9329('0x3'));var fs=require('fs');var Redis=require(_0x9329('0x4'));var db=require(_0x9329('0x5'))['db'];var utils=require(_0x9329('0x6'));var logger=require(_0x9329('0x7'))(_0x9329('0x8'));var config=require(_0x9329('0x9'));var jayson=require(_0x9329('0xa'));var client=jayson[_0x9329('0xb')][_0x9329('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x14bc45,_0x1fa6c4,_0x218cf3){return new BPromise(function(_0x182d15,_0x531cf1){return client[_0x9329('0xd')](_0x14bc45,_0x218cf3)[_0x9329('0xe')](function(_0x1c1033){logger[_0x9329('0xf')](_0x9329('0x10'),_0x1fa6c4,'request\x20sent');logger[_0x9329('0x11')](_0x9329('0x12'),_0x1fa6c4,'request\x20sent',JSON['stringify'](_0x1c1033));if(_0x1c1033['error']){if(_0x1c1033[_0x9329('0x13')][_0x9329('0x14')]===0x1f4){logger[_0x9329('0x13')](_0x9329('0x10'),_0x1fa6c4,_0x1c1033[_0x9329('0x13')]['message']);return _0x531cf1(_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);}logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x1c1033[_0x9329('0x13')][_0x9329('0x15')]);return _0x182d15(_0x1c1033['error'][_0x9329('0x15')]);}else{logger[_0x9329('0xf')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x9329('0x16'));_0x182d15(_0x1c1033[_0x9329('0x17')][_0x9329('0x15')]);}})[_0x9329('0x18')](function(_0x4dfbc1){logger[_0x9329('0x13')]('Campaign,\x20%s,\x20%s',_0x1fa6c4,_0x4dfbc1);_0x531cf1(_0x4dfbc1);});});}exports[_0x9329('0x19')]=function(_0x1b5eed){var _0x57718b=this;return new Promise(function(_0x41db73,_0x26a3c2){return db['Campaign'][_0x9329('0x1a')]({'raw':_0x1b5eed['options']?_0x1b5eed[_0x9329('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed['options'][_0x9329('0x1c')]||null:null,'attributes':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1d')]||null:null,'limit':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')]['limit']||null:null,'include':_0x1b5eed[_0x9329('0x1b')]?_0x1b5eed[_0x9329('0x1b')][_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x1b5eed[_0x9329('0x1b')]['include'],function(_0x22caa4){return{'model':db[_0x22caa4[_0x9329('0x20')]],'as':_0x22caa4['as'],'attributes':_0x22caa4['attributes'],'include':_0x22caa4[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x22caa4[_0x9329('0x1e')],function(_0x2da39d){return{'model':db[_0x2da39d['model']],'as':_0x2da39d['as'],'attributes':_0x2da39d['attributes'],'include':_0x2da39d[_0x9329('0x1e')]?_[_0x9329('0x1f')](_0x2da39d[_0x9329('0x1e')],function(_0x4f5fbf){return{'model':db[_0x4f5fbf[_0x9329('0x20')]],'as':_0x4f5fbf['as'],'attributes':_0x4f5fbf['attributes']};}):[]};}):[]};}):[]:[]})[_0x9329('0xe')](function(_0x192d0a){logger[_0x9329('0xf')]('GetCampaign',_0x1b5eed);logger['debug'](_0x9329('0x19'),_0x1b5eed,JSON['stringify'](_0x192d0a));_0x41db73(_0x192d0a);})[_0x9329('0x18')](function(_0x4a5d27){logger[_0x9329('0x13')]('GetCampaign',_0x4a5d27[_0x9329('0x15')],_0x1b5eed);_0x26a3c2(_0x57718b[_0x9329('0x13')](0x1f4,_0x4a5d27['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index c9ce345..0a5d519 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 _0xed01=['getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addBlackLists','put','update','delete','destroy','removeLists','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0xed01,0x111));var _0x1ed0=function(_0x508af7,_0x3341cd){_0x508af7=_0x508af7-0x0;var _0x5733e8=_0xed01[_0x508af7];return _0x5733e8;};'use strict';var multer=require(_0x1ed0('0x0'));var util=require(_0x1ed0('0x1'));var path=require('path');var timeout=require(_0x1ed0('0x2'));var express=require(_0x1ed0('0x3'));var router=express[_0x1ed0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x1ed0('0x5'));var config=require(_0x1ed0('0x6'));var controller=require(_0x1ed0('0x7'));router[_0x1ed0('0x8')]('/',auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xa')]);router[_0x1ed0('0x8')](_0x1ed0('0xb'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xc')]);router['get'](_0x1ed0('0xd'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xe')]);router['get']('/:id/hopper_histories',auth[_0x1ed0('0x9')](),controller[_0x1ed0('0xf')]);router[_0x1ed0('0x8')]('/:id/hopper_finals',auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x10')]);router[_0x1ed0('0x8')](_0x1ed0('0x11'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x12')]);router[_0x1ed0('0x8')](_0x1ed0('0x13'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x14')]);router[_0x1ed0('0x8')](_0x1ed0('0x15'),auth['isAuthenticated'](),controller[_0x1ed0('0x16')]);router[_0x1ed0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1ed0('0x17')](_0x1ed0('0x18'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x19')]);router[_0x1ed0('0x17')](_0x1ed0('0x13'),auth[_0x1ed0('0x9')](),controller['addLists']);router[_0x1ed0('0x17')](_0x1ed0('0x15'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x1a')]);router[_0x1ed0('0x1b')](_0x1ed0('0xb'),auth['isAuthenticated'](),controller[_0x1ed0('0x1c')]);router[_0x1ed0('0x1d')](_0x1ed0('0xb'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x1e')]);router['delete'](_0x1ed0('0x13'),auth[_0x1ed0('0x9')](),controller[_0x1ed0('0x1f')]);router[_0x1ed0('0x1d')](_0x1ed0('0x15'),auth['isAuthenticated'](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0xa7cf=['getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','/:id','update','delete','removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','isAuthenticated','index','/:id/hoppers','getHoppers'];(function(_0x59fb16,_0x45c22a){var _0x774d8e=function(_0x12400a){while(--_0x12400a){_0x59fb16['push'](_0x59fb16['shift']());}};_0x774d8e(++_0x45c22a);}(_0xa7cf,0xf9));var _0xfa7c=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0xa7cf[_0x12d951];return _0x44de17;};'use strict';var multer=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var path=require(_0xfa7c('0x2'));var timeout=require(_0xfa7c('0x3'));var express=require(_0xfa7c('0x4'));var router=express[_0xfa7c('0x5')]();var fs_extra=require(_0xfa7c('0x6'));var auth=require(_0xfa7c('0x7'));var interaction=require(_0xfa7c('0x8'));var config=require('../../config/environment');var controller=require(_0xfa7c('0x9'));router[_0xfa7c('0xa')]('/',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0xc')]);router[_0xfa7c('0xa')]('/:id',auth[_0xfa7c('0xb')](),controller['show']);router[_0xfa7c('0xa')](_0xfa7c('0xd'),auth['isAuthenticated'](),controller[_0xfa7c('0xe')]);router[_0xfa7c('0xa')]('/:id/hopper_histories',auth['isAuthenticated'](),controller[_0xfa7c('0xf')]);router[_0xfa7c('0xa')](_0xfa7c('0x10'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x11')]);router[_0xfa7c('0xa')](_0xfa7c('0x12'),auth[_0xfa7c('0xb')](),controller['getHopperBlacks']);router[_0xfa7c('0xa')](_0xfa7c('0x13'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x14')]);router['get'](_0xfa7c('0x15'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x16')]);router[_0xfa7c('0x17')]('/',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x18')]);router[_0xfa7c('0x17')](_0xfa7c('0x19'),auth[_0xfa7c('0xb')](),controller['clone']);router['post']('/:id/lists',auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x1a')]);router[_0xfa7c('0x17')](_0xfa7c('0x15'),auth['isAuthenticated'](),controller[_0xfa7c('0x1b')]);router['put'](_0xfa7c('0x1c'),auth[_0xfa7c('0xb')](),controller[_0xfa7c('0x1d')]);router[_0xfa7c('0x1e')](_0xfa7c('0x1c'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xfa7c('0x13'),auth['isAuthenticated'](),controller['removeLists']);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0xfa7c('0x1f')]);module[_0xfa7c('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 86c1a2d..23ef757 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 _0xf348=['STRING','getDataValue','exports'];(function(_0x1a3075,_0x3a861b){var _0x59843e=function(_0x258697){while(--_0x258697){_0x1a3075['push'](_0x1a3075['shift']());}};_0x59843e(++_0x3a861b);}(_0xf348,0xd1));var _0x8f34=function(_0x480039,_0x9668a0){_0x480039=_0x480039-0x0;var _0x21512f=_0xf348[_0x480039];return _0x21512f;};'use strict';var Sequelize=require('sequelize');module[_0x8f34('0x0')]={'key':{'type':Sequelize[_0x8f34('0x1')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x8f34('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x8f34('0x2')]('key');}}}; \ No newline at end of file +var _0x5263=['TEXT','medium','STRING','VIRTUAL','getDataValue','key','sequelize'];(function(_0x458c52,_0x5e3fb4){var _0x43f43b=function(_0x5cdfeb){while(--_0x5cdfeb){_0x458c52['push'](_0x458c52['shift']());}};_0x43f43b(++_0x5e3fb4);}(_0x5263,0x141));var _0x3526=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x5263[_0x288f5e];return _0x476cc9;};'use strict';var Sequelize=require(_0x3526('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3526('0x1')],'length':_0x3526('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x3526('0x3')]},'name':{'type':Sequelize[_0x3526('0x4')],'get':function(){return this[_0x3526('0x5')](_0x3526('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index f322ed4..2968b4a 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 _0xd403=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','show','params','intersection','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','limit','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','key'];(function(_0x33f5f2,_0x568494){var _0x53c022=function(_0x1b69b2){while(--_0x1b69b2){_0x33f5f2['push'](_0x33f5f2['shift']());}};_0x53c022(++_0x568494);}(_0xd403,0x1d2));var _0x3d40=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xd403[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x3d40('0x0'));var rimraf=require(_0x3d40('0x1'));var zipdir=require(_0x3d40('0x2'));var jsonpatch=require(_0x3d40('0x3'));var rp=require('request-promise');var moment=require(_0x3d40('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3d40('0x5'));var util=require(_0x3d40('0x6'));var path=require(_0x3d40('0x7'));var sox=require('sox');var csv=require(_0x3d40('0x8'));var ejs=require(_0x3d40('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3d40('0xa'));var crypto=require(_0x3d40('0xb'));var jsforce=require(_0x3d40('0xc'));var deskjs=require(_0x3d40('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3d40('0xe'));var Papa=require(_0x3d40('0xf'));var Redis=require(_0x3d40('0x10'));var authService=require(_0x3d40('0x11'));var qs=require(_0x3d40('0x12'));var as=require(_0x3d40('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3d40('0x14'));var utils=require(_0x3d40('0x15'));var config=require(_0x3d40('0x16'));var licenseUtil=require(_0x3d40('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2f353d,_0xaf462){_0xaf462=_0xaf462||0xcc;return function(_0x34e65f){if(_0x34e65f){return _0x2f353d[_0x3d40('0x18')](_0xaf462);}return _0x2f353d[_0x3d40('0x19')](_0xaf462)['end']();};}function respondWithResult(_0x41bde9,_0x577806){_0x577806=_0x577806||0xc8;return function(_0x38543a){if(_0x38543a){return _0x41bde9[_0x3d40('0x19')](_0x577806)['json'](_0x38543a);}};}function respondWithFilteredResult(_0x4f629e,_0x3e4457){return function(_0x3c33cd){if(_0x3c33cd){var _0xcda9b9=typeof _0x3e4457['offset']==='undefined'&&typeof _0x3e4457['limit']==='undefined';var _0x1fd8af=_0x3c33cd['count'];var _0x22df40=_0xcda9b9?0x0:_0x3e4457['offset'];var _0x1daf6c=_0xcda9b9?_0x3c33cd['count']:_0x3e4457['offset']+_0x3e4457[_0x3d40('0x1a')];var _0x57135e;if(_0x1daf6c>=_0x1fd8af){_0x1daf6c=_0x1fd8af;_0x57135e=0xc8;}else{_0x57135e=0xce;}_0x4f629e['status'](_0x57135e);return _0x4f629e['set'](_0x3d40('0x1b'),_0x22df40+'-'+_0x1daf6c+'/'+_0x1fd8af)[_0x3d40('0x1c')](_0x3c33cd);}return null;};}function patchUpdates(_0x3d205b){return function(_0x24aa9c){try{jsonpatch[_0x3d40('0x1d')](_0x24aa9c,_0x3d205b,!![]);}catch(_0x3b0a27){return BPromise['reject'](_0x3b0a27);}return _0x24aa9c[_0x3d40('0x1e')]();};}function saveUpdates(_0x1eb9c9,_0x449e3d){return function(_0x2832a2){if(_0x2832a2){return _0x2832a2[_0x3d40('0x1f')](_0x1eb9c9)[_0x3d40('0x20')](function(_0x41595c){return _0x41595c;});}return null;};}function removeEntity(_0x5b7307,_0x23a184){return function(_0x2cc654){if(_0x2cc654){return _0x2cc654['destroy']()['then'](function(){var _0x15d1eb=_0x2cc654['get']({'plain':!![]});var _0x3bf59d='CannedAnswers';return db['UserProfileResource'][_0x3d40('0x21')]({'where':{'type':_0x3bf59d,'resourceId':_0x15d1eb['id']}})[_0x3d40('0x20')](function(){return _0x2cc654;});})[_0x3d40('0x20')](function(){_0x5b7307[_0x3d40('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14435d,_0x4afbe2){return function(_0x2b78e1){if(!_0x2b78e1){_0x14435d['sendStatus'](0x194);}return _0x2b78e1;};}function handleError(_0x55ab23,_0x419f31){_0x419f31=_0x419f31||0x1f4;return function(_0x2dada9){logger[_0x3d40('0x22')](_0x2dada9[_0x3d40('0x23')]);if(_0x2dada9[_0x3d40('0x24')]){delete _0x2dada9[_0x3d40('0x24')];}_0x55ab23[_0x3d40('0x19')](_0x419f31)[_0x3d40('0x25')](_0x2dada9);};}exports[_0x3d40('0x26')]=function(_0x12596a,_0x2015ab){var _0xf4927f={},_0x1c5af4={},_0x2eaa4c={'count':0x0,'rows':[]};var _0xd79948=_[_0x3d40('0x27')](db[_0x3d40('0x28')][_0x3d40('0x29')],function(_0x6259e4){return{'name':_0x6259e4[_0x3d40('0x2a')],'type':_0x6259e4['type'][_0x3d40('0x2b')]};});_0x1c5af4['model']=_[_0x3d40('0x27')](_0xd79948,_0x3d40('0x24'));_0x1c5af4[_0x3d40('0x2c')]=_[_0x3d40('0x2d')](_0x12596a[_0x3d40('0x2c')]);_0x1c5af4[_0x3d40('0x2e')]=_['intersection'](_0x1c5af4[_0x3d40('0x2f')],_0x1c5af4[_0x3d40('0x2c')]);_0xf4927f[_0x3d40('0x30')]=_['intersection'](_0x1c5af4[_0x3d40('0x2f')],qs[_0x3d40('0x31')](_0x12596a[_0x3d40('0x2c')]['fields']));_0xf4927f[_0x3d40('0x30')]=_0xf4927f[_0x3d40('0x30')][_0x3d40('0x32')]?_0xf4927f[_0x3d40('0x30')]:_0x1c5af4[_0x3d40('0x2f')];if(!_0x12596a['query'][_0x3d40('0x33')](_0x3d40('0x34'))){_0xf4927f['limit']=qs[_0x3d40('0x1a')](_0x12596a['query'][_0x3d40('0x1a')]);_0xf4927f[_0x3d40('0x35')]=qs[_0x3d40('0x35')](_0x12596a['query'][_0x3d40('0x35')]);}_0xf4927f[_0x3d40('0x36')]=qs[_0x3d40('0x37')](_0x12596a[_0x3d40('0x2c')]['sort']);_0xf4927f['where']=qs[_0x3d40('0x2e')](_[_0x3d40('0x38')](_0x12596a[_0x3d40('0x2c')],_0x1c5af4[_0x3d40('0x2e')]),_0xd79948);if(_0x12596a[_0x3d40('0x2c')][_0x3d40('0x39')]){_0xf4927f[_0x3d40('0x3a')]=_[_0x3d40('0x3b')](_0xf4927f[_0x3d40('0x3a')],{'$or':[{'key':{'$like':'%'+_0x12596a[_0x3d40('0x2c')]['filter']+'%'}},{'value':{'$like':'%'+_0x12596a[_0x3d40('0x2c')][_0x3d40('0x39')]+'%'}}]});}_0xf4927f=_['merge']({},_0xf4927f,_0x12596a[_0x3d40('0x3c')]);var _0x16dc68={'where':_0xf4927f['where']};return db[_0x3d40('0x28')][_0x3d40('0x3d')](_0x16dc68)['then'](function(_0x45e9b5){_0x2eaa4c[_0x3d40('0x3d')]=_0x45e9b5;if(_0x12596a[_0x3d40('0x2c')][_0x3d40('0x3e')]){_0xf4927f[_0x3d40('0x3f')]=[{'all':!![]}];}return db[_0x3d40('0x28')][_0x3d40('0x40')](_0xf4927f);})[_0x3d40('0x20')](function(_0x4e7ebb){_0x2eaa4c['rows']=_0x4e7ebb;return _0x2eaa4c;})[_0x3d40('0x20')](respondWithFilteredResult(_0x2015ab,_0xf4927f))['catch'](handleError(_0x2015ab,null));};exports[_0x3d40('0x41')]=function(_0x12e9cf,_0xe46573){var _0xc037a6={'raw':!![],'where':{'id':_0x12e9cf[_0x3d40('0x42')]['id']}},_0x4eb6bb={};_0x4eb6bb[_0x3d40('0x2f')]=_[_0x3d40('0x2d')](db[_0x3d40('0x28')]['rawAttributes']);_0x4eb6bb[_0x3d40('0x2c')]=_[_0x3d40('0x2d')](_0x12e9cf[_0x3d40('0x2c')]);_0x4eb6bb[_0x3d40('0x2e')]=_[_0x3d40('0x43')](_0x4eb6bb[_0x3d40('0x2f')],_0x4eb6bb['query']);_0xc037a6[_0x3d40('0x30')]=_['intersection'](_0x4eb6bb[_0x3d40('0x2f')],qs['fields'](_0x12e9cf[_0x3d40('0x2c')]['fields']));_0xc037a6[_0x3d40('0x30')]=_0xc037a6['attributes'][_0x3d40('0x32')]?_0xc037a6[_0x3d40('0x30')]:_0x4eb6bb[_0x3d40('0x2f')];if(_0x12e9cf[_0x3d40('0x2c')][_0x3d40('0x3e')]){_0xc037a6['include']=[{'all':!![]}];}_0xc037a6=_['merge']({},_0xc037a6,_0x12e9cf[_0x3d40('0x3c')]);return db['CannedAnswer'][_0x3d40('0x44')](_0xc037a6)[_0x3d40('0x20')](handleEntityNotFound(_0xe46573,null))[_0x3d40('0x20')](respondWithResult(_0xe46573,null))[_0x3d40('0x45')](handleError(_0xe46573,null));};exports[_0x3d40('0x1f')]=function(_0x25f0df,_0xcf588){if(_0x25f0df[_0x3d40('0x46')]['id']){delete _0x25f0df['body']['id'];}return db[_0x3d40('0x28')][_0x3d40('0x44')]({'where':{'id':_0x25f0df['params']['id']}})[_0x3d40('0x20')](handleEntityNotFound(_0xcf588,null))[_0x3d40('0x20')](saveUpdates(_0x25f0df['body'],null))[_0x3d40('0x20')](respondWithResult(_0xcf588,null))['catch'](handleError(_0xcf588,null));};exports[_0x3d40('0x21')]=function(_0x23c6af,_0x19df1d){return db[_0x3d40('0x28')]['find']({'where':{'id':_0x23c6af['params']['id']}})[_0x3d40('0x20')](handleEntityNotFound(_0x19df1d,null))[_0x3d40('0x20')](removeEntity(_0x19df1d,null))[_0x3d40('0x45')](handleError(_0x19df1d,null));};exports[_0x3d40('0x47')]=function(_0x517db1,_0x3f9e6e){var _0x57ca91={'key':_0x517db1[_0x3d40('0x46')][_0x3d40('0x2b')]};if(_0x517db1[_0x3d40('0x46')][_0x3d40('0x48')]){_0x57ca91[_0x3d40('0x48')]=_0x517db1[_0x3d40('0x46')][_0x3d40('0x48')];}else if(_0x517db1[_0x3d40('0x46')]['SmsAccountId']){_0x57ca91[_0x3d40('0x49')]=_0x517db1['body'][_0x3d40('0x49')];}else if(_0x517db1[_0x3d40('0x46')]['OpenchannelAccountId']){_0x57ca91[_0x3d40('0x4a')]=_0x517db1[_0x3d40('0x46')][_0x3d40('0x4a')];}else if(_0x517db1[_0x3d40('0x46')][_0x3d40('0x4b')]){_0x57ca91[_0x3d40('0x4b')]=_0x517db1[_0x3d40('0x46')][_0x3d40('0x4b')];}return db[_0x3d40('0x28')]['find']({'where':_0x57ca91})['then'](function(_0x586252){if(_0x586252){throw new db['Sequelize'][(_0x3d40('0x4c'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x3d40('0x28')][_0x3d40('0x47')](_0x517db1[_0x3d40('0x46')]);})['then'](function(_0x1fbc56){var _0x5e6518=_0x517db1[_0x3d40('0x4d')][_0x3d40('0x4e')]({'plain':!![]});if(!_0x5e6518)throw new Error(_0x3d40('0x4f'));if(_0x5e6518[_0x3d40('0x50')]==='user'){var _0x5a0827=_0x1fbc56['get']({'plain':!![]});return db[_0x3d40('0x51')][_0x3d40('0x44')]({'where':{'name':_0x3d40('0x52'),'userProfileId':_0x5e6518[_0x3d40('0x53')]},'raw':!![]})[_0x3d40('0x20')](function(_0x49946e){if(_0x49946e&&_0x49946e['autoAssociation']===0x0){return db['UserProfileResource'][_0x3d40('0x47')]({'name':_0x5a0827[_0x3d40('0x24')],'resourceId':_0x5a0827['id'],'type':_0x49946e[_0x3d40('0x24')],'sectionId':_0x49946e['id']},{})[_0x3d40('0x20')](function(){return _0x1fbc56;});}else{return _0x1fbc56;}})['catch'](function(_0x2ff88f){logger['error'](_0x3d40('0x54'),_0x2ff88f);throw _0x2ff88f;});}return _0x1fbc56;})[_0x3d40('0x20')](respondWithResult(_0x3f9e6e,0xc9))[_0x3d40('0x45')](handleError(_0x3f9e6e,null));}; \ No newline at end of file +var _0xbd34=['query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','options','findAll','catch','show','params','intersection','length','includeAll','include','body','find','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','CannedAnswers','sendStatus','error','stack','name','send','index','CannedAnswer','rawAttributes','type','key','model','map'];(function(_0x3149ef,_0x12dc71){var _0x535e72=function(_0x2e351d){while(--_0x2e351d){_0x3149ef['push'](_0x3149ef['shift']());}};_0x535e72(++_0x12dc71);}(_0xbd34,0x189));var _0x4bd3=function(_0x423a85,_0x59e206){_0x423a85=_0x423a85-0x0;var _0x5bb0dc=_0xbd34[_0x423a85];return _0x5bb0dc;};'use strict';var emlformat=require(_0x4bd3('0x0'));var rimraf=require(_0x4bd3('0x1'));var zipdir=require(_0x4bd3('0x2'));var jsonpatch=require(_0x4bd3('0x3'));var rp=require(_0x4bd3('0x4'));var moment=require(_0x4bd3('0x5'));var BPromise=require(_0x4bd3('0x6'));var Mustache=require(_0x4bd3('0x7'));var util=require('util');var path=require(_0x4bd3('0x8'));var sox=require(_0x4bd3('0x9'));var csv=require(_0x4bd3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4bd3('0xb'));var squel=require('squel');var crypto=require(_0x4bd3('0xc'));var jsforce=require(_0x4bd3('0xd'));var deskjs=require(_0x4bd3('0xe'));var toCsv=require(_0x4bd3('0xa'));var querystring=require(_0x4bd3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4bd3('0x10'));var qs=require(_0x4bd3('0x11'));var as=require(_0x4bd3('0x12'));var hardwareService=require(_0x4bd3('0x13'));var logger=require(_0x4bd3('0x14'))(_0x4bd3('0x15'));var utils=require(_0x4bd3('0x16'));var config=require(_0x4bd3('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9d0e,_0x2dac95){_0x2dac95=_0x2dac95||0xcc;return function(_0x128d47){if(_0x128d47){return _0x1d9d0e['sendStatus'](_0x2dac95);}return _0x1d9d0e[_0x4bd3('0x18')](_0x2dac95)[_0x4bd3('0x19')]();};}function respondWithResult(_0x22afd6,_0x3f68c6){_0x3f68c6=_0x3f68c6||0xc8;return function(_0x5dcb9d){if(_0x5dcb9d){return _0x22afd6[_0x4bd3('0x18')](_0x3f68c6)[_0x4bd3('0x1a')](_0x5dcb9d);}};}function respondWithFilteredResult(_0x1f6565,_0x508342){return function(_0x5290db){if(_0x5290db){var _0x22fa57=typeof _0x508342[_0x4bd3('0x1b')]===_0x4bd3('0x1c')&&typeof _0x508342[_0x4bd3('0x1d')]==='undefined';var _0x52af2e=_0x5290db[_0x4bd3('0x1e')];var _0x15515e=_0x22fa57?0x0:_0x508342['offset'];var _0x1447c6=_0x22fa57?_0x5290db['count']:_0x508342[_0x4bd3('0x1b')]+_0x508342[_0x4bd3('0x1d')];var _0x48a395;if(_0x1447c6>=_0x52af2e){_0x1447c6=_0x52af2e;_0x48a395=0xc8;}else{_0x48a395=0xce;}_0x1f6565[_0x4bd3('0x18')](_0x48a395);return _0x1f6565[_0x4bd3('0x1f')](_0x4bd3('0x20'),_0x15515e+'-'+_0x1447c6+'/'+_0x52af2e)[_0x4bd3('0x1a')](_0x5290db);}return null;};}function patchUpdates(_0x29efd2){return function(_0x434d90){try{jsonpatch[_0x4bd3('0x21')](_0x434d90,_0x29efd2,!![]);}catch(_0x354507){return BPromise[_0x4bd3('0x22')](_0x354507);}return _0x434d90['save']();};}function saveUpdates(_0x30027c,_0x2c34c6){return function(_0x5eaccd){if(_0x5eaccd){return _0x5eaccd[_0x4bd3('0x23')](_0x30027c)[_0x4bd3('0x24')](function(_0x3c9909){return _0x3c9909;});}return null;};}function removeEntity(_0x220f65,_0x33ea49){return function(_0x381a57){if(_0x381a57){return _0x381a57[_0x4bd3('0x25')]()[_0x4bd3('0x24')](function(){var _0x50e15f=_0x381a57[_0x4bd3('0x26')]({'plain':!![]});var _0x5e373d=_0x4bd3('0x27');return db['UserProfileResource'][_0x4bd3('0x25')]({'where':{'type':_0x5e373d,'resourceId':_0x50e15f['id']}})['then'](function(){return _0x381a57;});})[_0x4bd3('0x24')](function(){_0x220f65['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3c2934,_0x5ef90d){return function(_0x59f57a){if(!_0x59f57a){_0x3c2934[_0x4bd3('0x28')](0x194);}return _0x59f57a;};}function handleError(_0x11570c,_0x32e73b){_0x32e73b=_0x32e73b||0x1f4;return function(_0x36a7bc){logger[_0x4bd3('0x29')](_0x36a7bc[_0x4bd3('0x2a')]);if(_0x36a7bc['name']){delete _0x36a7bc[_0x4bd3('0x2b')];}_0x11570c[_0x4bd3('0x18')](_0x32e73b)[_0x4bd3('0x2c')](_0x36a7bc);};}exports[_0x4bd3('0x2d')]=function(_0x538452,_0x4e6f71){var _0x316653={},_0x173f21={},_0x558dce={'count':0x0,'rows':[]};var _0x47e97c=_['map'](db[_0x4bd3('0x2e')][_0x4bd3('0x2f')],function(_0x274982){return{'name':_0x274982['fieldName'],'type':_0x274982[_0x4bd3('0x30')][_0x4bd3('0x31')]};});_0x173f21[_0x4bd3('0x32')]=_[_0x4bd3('0x33')](_0x47e97c,'name');_0x173f21[_0x4bd3('0x34')]=_[_0x4bd3('0x35')](_0x538452[_0x4bd3('0x34')]);_0x173f21['filters']=_['intersection'](_0x173f21[_0x4bd3('0x32')],_0x173f21[_0x4bd3('0x34')]);_0x316653[_0x4bd3('0x36')]=_['intersection'](_0x173f21[_0x4bd3('0x32')],qs[_0x4bd3('0x37')](_0x538452['query'][_0x4bd3('0x37')]));_0x316653[_0x4bd3('0x36')]=_0x316653[_0x4bd3('0x36')]['length']?_0x316653[_0x4bd3('0x36')]:_0x173f21[_0x4bd3('0x32')];if(!_0x538452[_0x4bd3('0x34')][_0x4bd3('0x38')](_0x4bd3('0x39'))){_0x316653[_0x4bd3('0x1d')]=qs[_0x4bd3('0x1d')](_0x538452[_0x4bd3('0x34')][_0x4bd3('0x1d')]);_0x316653['offset']=qs[_0x4bd3('0x1b')](_0x538452['query']['offset']);}_0x316653[_0x4bd3('0x3a')]=qs[_0x4bd3('0x3b')](_0x538452[_0x4bd3('0x34')][_0x4bd3('0x3b')]);_0x316653['where']=qs[_0x4bd3('0x3c')](_[_0x4bd3('0x3d')](_0x538452[_0x4bd3('0x34')],_0x173f21[_0x4bd3('0x3c')]),_0x47e97c);if(_0x538452[_0x4bd3('0x34')]['filter']){_0x316653[_0x4bd3('0x3e')]=_[_0x4bd3('0x3f')](_0x316653[_0x4bd3('0x3e')],{'$or':[{'key':{'$like':'%'+_0x538452['query']['filter']+'%'}},{'value':{'$like':'%'+_0x538452[_0x4bd3('0x34')]['filter']+'%'}}]});}_0x316653=_['merge']({},_0x316653,_0x538452[_0x4bd3('0x40')]);var _0x542639={'where':_0x316653[_0x4bd3('0x3e')]};return db[_0x4bd3('0x2e')][_0x4bd3('0x1e')](_0x542639)[_0x4bd3('0x24')](function(_0x1420d1){_0x558dce[_0x4bd3('0x1e')]=_0x1420d1;if(_0x538452[_0x4bd3('0x34')]['includeAll']){_0x316653['include']=[{'all':!![]}];}return db[_0x4bd3('0x2e')][_0x4bd3('0x41')](_0x316653);})['then'](function(_0x53827f){_0x558dce['rows']=_0x53827f;return _0x558dce;})[_0x4bd3('0x24')](respondWithFilteredResult(_0x4e6f71,_0x316653))[_0x4bd3('0x42')](handleError(_0x4e6f71,null));};exports[_0x4bd3('0x43')]=function(_0x55c020,_0x5c16ed){var _0x11c5d7={'raw':!![],'where':{'id':_0x55c020[_0x4bd3('0x44')]['id']}},_0x371ec5={};_0x371ec5[_0x4bd3('0x32')]=_[_0x4bd3('0x35')](db[_0x4bd3('0x2e')][_0x4bd3('0x2f')]);_0x371ec5[_0x4bd3('0x34')]=_['keys'](_0x55c020['query']);_0x371ec5[_0x4bd3('0x3c')]=_[_0x4bd3('0x45')](_0x371ec5['model'],_0x371ec5['query']);_0x11c5d7[_0x4bd3('0x36')]=_[_0x4bd3('0x45')](_0x371ec5[_0x4bd3('0x32')],qs['fields'](_0x55c020[_0x4bd3('0x34')][_0x4bd3('0x37')]));_0x11c5d7[_0x4bd3('0x36')]=_0x11c5d7[_0x4bd3('0x36')][_0x4bd3('0x46')]?_0x11c5d7[_0x4bd3('0x36')]:_0x371ec5[_0x4bd3('0x32')];if(_0x55c020[_0x4bd3('0x34')][_0x4bd3('0x47')]){_0x11c5d7[_0x4bd3('0x48')]=[{'all':!![]}];}_0x11c5d7=_[_0x4bd3('0x3f')]({},_0x11c5d7,_0x55c020[_0x4bd3('0x40')]);return db[_0x4bd3('0x2e')]['find'](_0x11c5d7)['then'](handleEntityNotFound(_0x5c16ed,null))['then'](respondWithResult(_0x5c16ed,null))[_0x4bd3('0x42')](handleError(_0x5c16ed,null));};exports['update']=function(_0xe4b018,_0xe3d653){if(_0xe4b018['body']['id']){delete _0xe4b018[_0x4bd3('0x49')]['id'];}return db[_0x4bd3('0x2e')][_0x4bd3('0x4a')]({'where':{'id':_0xe4b018[_0x4bd3('0x44')]['id']}})[_0x4bd3('0x24')](handleEntityNotFound(_0xe3d653,null))[_0x4bd3('0x24')](saveUpdates(_0xe4b018['body'],null))[_0x4bd3('0x24')](respondWithResult(_0xe3d653,null))[_0x4bd3('0x42')](handleError(_0xe3d653,null));};exports[_0x4bd3('0x25')]=function(_0x2e6a6a,_0x31cf72){return db[_0x4bd3('0x2e')]['find']({'where':{'id':_0x2e6a6a[_0x4bd3('0x44')]['id']}})['then'](handleEntityNotFound(_0x31cf72,null))[_0x4bd3('0x24')](removeEntity(_0x31cf72,null))[_0x4bd3('0x42')](handleError(_0x31cf72,null));};exports[_0x4bd3('0x4b')]=function(_0x4f6926,_0x535321){var _0xa3f6ae={'key':_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x31')]};if(_0x4f6926[_0x4bd3('0x49')]['MailAccountId']){_0xa3f6ae[_0x4bd3('0x4c')]=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4c')];}else if(_0x4f6926['body']['SmsAccountId']){_0xa3f6ae[_0x4bd3('0x4d')]=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4d')];}else if(_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4e')]){_0xa3f6ae[_0x4bd3('0x4e')]=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4e')];}else if(_0x4f6926['body'][_0x4bd3('0x4f')]){_0xa3f6ae['ChatWebsiteId']=_0x4f6926[_0x4bd3('0x49')][_0x4bd3('0x4f')];}return db[_0x4bd3('0x2e')][_0x4bd3('0x4a')]({'where':_0xa3f6ae})[_0x4bd3('0x24')](function(_0x1a7280){if(_0x1a7280){throw new db[(_0x4bd3('0x50'))][(_0x4bd3('0x51'))](_0x4bd3('0x52'));}return db[_0x4bd3('0x2e')]['create'](_0x4f6926[_0x4bd3('0x49')]);})[_0x4bd3('0x24')](function(_0x2846cf){var _0x9ed4fa=_0x4f6926[_0x4bd3('0x53')][_0x4bd3('0x26')]({'plain':!![]});if(!_0x9ed4fa)throw new Error(_0x4bd3('0x54'));if(_0x9ed4fa['role']===_0x4bd3('0x53')){var _0x4713e5=_0x2846cf['get']({'plain':!![]});return db[_0x4bd3('0x55')][_0x4bd3('0x4a')]({'where':{'name':_0x4bd3('0x27'),'userProfileId':_0x9ed4fa[_0x4bd3('0x56')]},'raw':!![]})[_0x4bd3('0x24')](function(_0x2c89da){if(_0x2c89da&&_0x2c89da['autoAssociation']===0x0){return db[_0x4bd3('0x57')][_0x4bd3('0x4b')]({'name':_0x4713e5[_0x4bd3('0x2b')],'resourceId':_0x4713e5['id'],'type':_0x2c89da['name'],'sectionId':_0x2c89da['id']},{})[_0x4bd3('0x24')](function(){return _0x2846cf;});}else{return _0x2846cf;}})[_0x4bd3('0x42')](function(_0x11cee6){logger[_0x4bd3('0x29')](_0x4bd3('0x58'),_0x11cee6);throw _0x11cee6;});}return _0x2846cf;})[_0x4bd3('0x24')](respondWithResult(_0x535321,0xc9))[_0x4bd3('0x42')](handleError(_0x535321,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 351402e..50e3934 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 _0x22c5=['./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','api','request-promise','rimraf','../../config/environment'];(function(_0xf53fe1,_0x2b2f62){var _0x1b1888=function(_0x5c9ba9){while(--_0x5c9ba9){_0xf53fe1['push'](_0xf53fe1['shift']());}};_0x1b1888(++_0x2b2f62);}(_0x22c5,0xc1));var _0x522c=function(_0x56876e,_0x4dec10){_0x56876e=_0x56876e-0x0;var _0xa92dd9=_0x22c5[_0x56876e];return _0xa92dd9;};'use strict';var _=require('lodash');var util=require(_0x522c('0x0'));var logger=require('../../config/logger')(_0x522c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x522c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x522c('0x3'));var config=require(_0x522c('0x4'));var attributes=require(_0x522c('0x5'));module['exports']=function(_0x39ec34,_0x17b225){return _0x39ec34[_0x522c('0x6')](_0x522c('0x7'),attributes,{'tableName':_0x522c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x522c('0x9'),'collate':_0x522c('0xa')});}; \ No newline at end of file +var _0x0922=['../../config/logger','api','bluebird','request-promise','./cannedAnswer.attributes','exports','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xea55c2,_0x2443b9){var _0x2c372d=function(_0x3a4e1b){while(--_0x3a4e1b){_0xea55c2['push'](_0xea55c2['shift']());}};_0x2c372d(++_0x2443b9);}(_0x0922,0x77));var _0x2092=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0x0922[_0x4ded65];return _0x5864fb;};'use strict';var _=require(_0x2092('0x0'));var util=require(_0x2092('0x1'));var logger=require(_0x2092('0x2'))(_0x2092('0x3'));var moment=require('moment');var BPromise=require(_0x2092('0x4'));var rp=require(_0x2092('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2092('0x6'));module[_0x2092('0x7')]=function(_0x40aebe,_0x14fab7){return _0x40aebe['define'](_0x2092('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2092('0x9'),'collate':_0x2092('0xa')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 36c373f..2dacd0e 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(_0x5168b6,_0x59c707){var _0x57fcd7=function(_0x2ace4a){while(--_0x2ace4a){_0x5168b6['push'](_0x5168b6['shift']());}};_0x57fcd7(++_0x59c707);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0xa9e0[_0x47b58b];return _0x46bebe;};'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(_0x5e7220,_0x12961d){var _0x1d2dfe=function(_0x551a00){while(--_0x551a00){_0x5e7220['push'](_0x5e7220['shift']());}};_0x1d2dfe(++_0x12961d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 b33e9fc..2f25f67 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 _0x53a2=['../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','put','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x43d68f,_0x53a5a9){var _0x3fcee2=function(_0x1bc5bb){while(--_0x1bc5bb){_0x43d68f['push'](_0x43d68f['shift']());}};_0x3fcee2(++_0x53a5a9);}(_0x53a2,0x1b4));var _0x253a=function(_0x28d18d,_0x55896b){_0x28d18d=_0x28d18d-0x0;var _0x470640=_0x53a2[_0x28d18d];return _0x470640;};'use strict';var multer=require('multer');var util=require(_0x253a('0x0'));var path=require(_0x253a('0x1'));var timeout=require(_0x253a('0x2'));var express=require(_0x253a('0x3'));var router=express[_0x253a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x253a('0x5'));var interaction=require(_0x253a('0x6'));var config=require(_0x253a('0x7'));var controller=require(_0x253a('0x8'));router[_0x253a('0x9')]('/',auth[_0x253a('0xa')](),controller[_0x253a('0xb')]);router[_0x253a('0x9')](_0x253a('0xc'),auth[_0x253a('0xa')](),controller['show']);router[_0x253a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x253a('0xe')]('/:id',auth[_0x253a('0xa')](),controller['update']);router[_0x253a('0xf')]('/:id',auth[_0x253a('0xa')](),controller['destroy']);module[_0x253a('0x10')]=router; \ No newline at end of file +var _0x40f5=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','show','post','create','update','delete','/:id','exports','multer','util'];(function(_0x3fa2c8,_0x2de01e){var _0x1b0f3e=function(_0xd6cde){while(--_0xd6cde){_0x3fa2c8['push'](_0x3fa2c8['shift']());}};_0x1b0f3e(++_0x2de01e);}(_0x40f5,0x1a0));var _0x540f=function(_0x20c512,_0x36c198){_0x20c512=_0x20c512-0x0;var _0x25236e=_0x40f5[_0x20c512];return _0x25236e;};'use strict';var multer=require(_0x540f('0x0'));var util=require(_0x540f('0x1'));var path=require(_0x540f('0x2'));var timeout=require('connect-timeout');var express=require(_0x540f('0x3'));var router=express[_0x540f('0x4')]();var fs_extra=require(_0x540f('0x5'));var auth=require(_0x540f('0x6'));var interaction=require(_0x540f('0x7'));var config=require('../../config/environment');var controller=require(_0x540f('0x8'));router[_0x540f('0x9')]('/',auth[_0x540f('0xa')](),controller[_0x540f('0xb')]);router[_0x540f('0x9')]('/:id',auth[_0x540f('0xa')](),controller[_0x540f('0xc')]);router[_0x540f('0xd')]('/',auth[_0x540f('0xa')](),controller[_0x540f('0xe')]);router['put']('/:id',auth[_0x540f('0xa')](),controller[_0x540f('0xf')]);router[_0x540f('0x10')](_0x540f('0x11'),auth[_0x540f('0xa')](),controller['destroy']);module[_0x540f('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 37199a4..014df62 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 _0xae88=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x20cc97,_0x5c23c6){var _0x9daa05=function(_0x5dd734){while(--_0x5dd734){_0x20cc97['push'](_0x20cc97['shift']());}};_0x9daa05(++_0x5c23c6);}(_0xae88,0xa1));var _0x8ae8=function(_0x252bfe,_0x373c22){_0x252bfe=_0x252bfe-0x0;var _0x6b39ab=_0xae88[_0x252bfe];return _0x6b39ab;};'use strict';var Sequelize=require(_0x8ae8('0x0'));module[_0x8ae8('0x1')]={'calldate':{'type':Sequelize[_0x8ae8('0x2')],'allowNull':![],'defaultValue':_0x8ae8('0x3')},'clid':{'type':Sequelize[_0x8ae8('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8ae8('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8ae8('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x8ae8('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x8ae8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8ae8('0x4')]},'amaflags':{'type':Sequelize[_0x8ae8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x8ae8('0x4')]},'uniqueid':{'type':Sequelize[_0x8ae8('0x4')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x8ae8('0x4')]},'peeraccount':{'type':Sequelize[_0x8ae8('0x4')]},'type':{'type':Sequelize[_0x8ae8('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xde9f=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x596c2e,_0x1f49e0){var _0x10ff6c=function(_0x712f24){while(--_0x712f24){_0x596c2e['push'](_0x596c2e['shift']());}};_0x10ff6c(++_0x1f49e0);}(_0xde9f,0x16d));var _0xfde9=function(_0x484cac,_0x30ad3a){_0x484cac=_0x484cac-0x0;var _0x1d6e77=_0xde9f[_0x484cac];return _0x1d6e77;};'use strict';var Sequelize=require(_0xfde9('0x0'));module[_0xfde9('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xfde9('0x2')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xfde9('0x3')]},'dst':{'type':Sequelize[_0xfde9('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfde9('0x3')]},'dstchannel':{'type':Sequelize[_0xfde9('0x3')]},'lastapp':{'type':Sequelize[_0xfde9('0x3')]},'lastdata':{'type':Sequelize[_0xfde9('0x3')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xfde9('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xfde9('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xfde9('0x3')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xfde9('0x3')]},'peeraccount':{'type':Sequelize[_0xfde9('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xfde9('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 4870d77..9ccb573 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 _0xfd20=['map','Cdr','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','options','create','body','find','destroy','describe','rimraf','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','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','undefined','count','offset','limit','set','Content-Range','json','apply','then','end','error','stack','name','send'];(function(_0x3452d0,_0x378e17){var _0x568b78=function(_0x5184c3){while(--_0x5184c3){_0x3452d0['push'](_0x3452d0['shift']());}};_0x568b78(++_0x378e17);}(_0xfd20,0x66));var _0x0fd2=function(_0x3c29a7,_0x1bec88){_0x3c29a7=_0x3c29a7-0x0;var _0x1482db=_0xfd20[_0x3c29a7];return _0x1482db;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0fd2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0fd2('0x1'));var moment=require(_0x0fd2('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x0fd2('0x3'));var util=require('util');var path=require(_0x0fd2('0x4'));var sox=require(_0x0fd2('0x5'));var csv=require(_0x0fd2('0x6'));var ejs=require(_0x0fd2('0x7'));var fs=require('fs');var fs_extra=require(_0x0fd2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x0fd2('0x9'));var jsforce=require(_0x0fd2('0xa'));var deskjs=require(_0x0fd2('0xb'));var toCsv=require(_0x0fd2('0x6'));var querystring=require(_0x0fd2('0xc'));var Papa=require(_0x0fd2('0xd'));var Redis=require(_0x0fd2('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0fd2('0xf'));var as=require(_0x0fd2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0fd2('0x11'))('api');var utils=require(_0x0fd2('0x12'));var config=require(_0x0fd2('0x13'));var licenseUtil=require(_0x0fd2('0x14'));var db=require(_0x0fd2('0x15'))['db'];function respondWithStatusCode(_0xdf592d,_0x3504cf){_0x3504cf=_0x3504cf||0xcc;return function(_0x1f7a6e){if(_0x1f7a6e){return _0xdf592d[_0x0fd2('0x16')](_0x3504cf);}return _0xdf592d['status'](_0x3504cf)['end']();};}function respondWithResult(_0x1a9acb,_0x99de24){_0x99de24=_0x99de24||0xc8;return function(_0x21dcc5){if(_0x21dcc5){return _0x1a9acb[_0x0fd2('0x17')](_0x99de24)['json'](_0x21dcc5);}};}function respondWithFilteredResult(_0x280253,_0x4f074a){return function(_0x50b723){if(_0x50b723){var _0x2b6254=typeof _0x4f074a['offset']===_0x0fd2('0x18')&&typeof _0x4f074a['limit']===_0x0fd2('0x18');var _0x4cd2bf=_0x50b723[_0x0fd2('0x19')];var _0x15c9de=_0x2b6254?0x0:_0x4f074a['offset'];var _0x2b25d2=_0x2b6254?_0x50b723['count']:_0x4f074a[_0x0fd2('0x1a')]+_0x4f074a[_0x0fd2('0x1b')];var _0x3fb07e;if(_0x2b25d2>=_0x4cd2bf){_0x2b25d2=_0x4cd2bf;_0x3fb07e=0xc8;}else{_0x3fb07e=0xce;}_0x280253[_0x0fd2('0x17')](_0x3fb07e);return _0x280253[_0x0fd2('0x1c')](_0x0fd2('0x1d'),_0x15c9de+'-'+_0x2b25d2+'/'+_0x4cd2bf)[_0x0fd2('0x1e')](_0x50b723);}return null;};}function patchUpdates(_0x1a72ca){return function(_0x1b848d){try{jsonpatch[_0x0fd2('0x1f')](_0x1b848d,_0x1a72ca,!![]);}catch(_0x5c50ad){return BPromise['reject'](_0x5c50ad);}return _0x1b848d['save']();};}function saveUpdates(_0x4156d2,_0x36072a){return function(_0x53ab17){if(_0x53ab17){return _0x53ab17['update'](_0x4156d2)[_0x0fd2('0x20')](function(_0x25563c){return _0x25563c;});}return null;};}function removeEntity(_0x6be8d8,_0x29398f){return function(_0x25cdd2){if(_0x25cdd2){return _0x25cdd2['destroy']()[_0x0fd2('0x20')](function(){_0x6be8d8[_0x0fd2('0x17')](0xcc)[_0x0fd2('0x21')]();});}};}function handleEntityNotFound(_0x54cce1,_0x4c77a8){return function(_0x11bb10){if(!_0x11bb10){_0x54cce1[_0x0fd2('0x16')](0x194);}return _0x11bb10;};}function handleError(_0x4d0924,_0x400133){_0x400133=_0x400133||0x1f4;return function(_0x429fef){logger[_0x0fd2('0x22')](_0x429fef[_0x0fd2('0x23')]);if(_0x429fef[_0x0fd2('0x24')]){delete _0x429fef[_0x0fd2('0x24')];}_0x4d0924[_0x0fd2('0x17')](_0x400133)[_0x0fd2('0x25')](_0x429fef);};}exports['index']=function(_0x37d519,_0x434018){var _0x235c90={},_0x1ca259={},_0x33cf1a={'count':0x0,'rows':[]};var _0x564419=_[_0x0fd2('0x26')](db[_0x0fd2('0x27')][_0x0fd2('0x28')],function(_0x1a7a98){return{'name':_0x1a7a98[_0x0fd2('0x29')],'type':_0x1a7a98[_0x0fd2('0x2a')][_0x0fd2('0x2b')]};});_0x1ca259[_0x0fd2('0x2c')]=_['map'](_0x564419,_0x0fd2('0x24'));_0x1ca259['query']=_['keys'](_0x37d519[_0x0fd2('0x2d')]);_0x1ca259['filters']=_[_0x0fd2('0x2e')](_0x1ca259['model'],_0x1ca259[_0x0fd2('0x2d')]);_0x235c90['attributes']=_['intersection'](_0x1ca259[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x37d519[_0x0fd2('0x2d')]['fields']));_0x235c90['attributes']=_0x235c90[_0x0fd2('0x30')]['length']?_0x235c90[_0x0fd2('0x30')]:_0x1ca259[_0x0fd2('0x2c')];if(!_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x31')](_0x0fd2('0x32'))){_0x235c90[_0x0fd2('0x1b')]=qs[_0x0fd2('0x1b')](_0x37d519['query'][_0x0fd2('0x1b')]);_0x235c90[_0x0fd2('0x1a')]=qs['offset'](_0x37d519['query'][_0x0fd2('0x1a')]);}_0x235c90['order']=qs['sort'](_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x33')]);_0x235c90[_0x0fd2('0x34')]=qs[_0x0fd2('0x35')](_[_0x0fd2('0x36')](_0x37d519[_0x0fd2('0x2d')],_0x1ca259[_0x0fd2('0x35')]),_0x564419);if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]){_0x235c90[_0x0fd2('0x34')]=_[_0x0fd2('0x38')](_0x235c90[_0x0fd2('0x34')],{'$or':_[_0x0fd2('0x26')](_0x564419,function(_0x3a3986){if(_0x3a3986[_0x0fd2('0x2a')]!==_0x0fd2('0x39')){var _0x50643e={};_0x50643e[_0x3a3986[_0x0fd2('0x24')]]={'$like':'%'+_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x37')]+'%'};return _0x50643e;}})});}_0x235c90=_[_0x0fd2('0x38')]({},_0x235c90,_0x37d519['options']);var _0x286543={'where':_0x235c90['where']};return db[_0x0fd2('0x27')][_0x0fd2('0x19')](_0x286543)['then'](function(_0x43e585){_0x33cf1a[_0x0fd2('0x19')]=_0x43e585;if(_0x37d519[_0x0fd2('0x2d')][_0x0fd2('0x3a')]){_0x235c90[_0x0fd2('0x3b')]=[{'all':!![]}];}return db[_0x0fd2('0x27')]['findAll'](_0x235c90);})[_0x0fd2('0x20')](function(_0x409321){_0x33cf1a[_0x0fd2('0x3c')]=_0x409321;return _0x33cf1a;})[_0x0fd2('0x20')](respondWithFilteredResult(_0x434018,_0x235c90))[_0x0fd2('0x3d')](handleError(_0x434018,null));};exports['show']=function(_0x258569,_0x2e804d){var _0x554476={'raw':!![],'where':{'id':_0x258569[_0x0fd2('0x3e')]['id']}},_0x252fb1={};_0x252fb1[_0x0fd2('0x2c')]=_[_0x0fd2('0x3f')](db[_0x0fd2('0x27')][_0x0fd2('0x28')]);_0x252fb1[_0x0fd2('0x2d')]=_[_0x0fd2('0x3f')](_0x258569['query']);_0x252fb1['filters']=_[_0x0fd2('0x2e')](_0x252fb1[_0x0fd2('0x2c')],_0x252fb1['query']);_0x554476[_0x0fd2('0x30')]=_['intersection'](_0x252fb1[_0x0fd2('0x2c')],qs[_0x0fd2('0x2f')](_0x258569[_0x0fd2('0x2d')][_0x0fd2('0x2f')]));_0x554476[_0x0fd2('0x30')]=_0x554476[_0x0fd2('0x30')]['length']?_0x554476['attributes']:_0x252fb1[_0x0fd2('0x2c')];if(_0x258569['query'][_0x0fd2('0x3a')]){_0x554476[_0x0fd2('0x3b')]=[{'all':!![]}];}_0x554476=_[_0x0fd2('0x38')]({},_0x554476,_0x258569[_0x0fd2('0x40')]);return db[_0x0fd2('0x27')]['find'](_0x554476)[_0x0fd2('0x20')](handleEntityNotFound(_0x2e804d,null))['then'](respondWithResult(_0x2e804d,null))[_0x0fd2('0x3d')](handleError(_0x2e804d,null));};exports[_0x0fd2('0x41')]=function(_0x5352cc,_0x337daa){return db['Cdr']['create'](_0x5352cc[_0x0fd2('0x42')],{})[_0x0fd2('0x20')](respondWithResult(_0x337daa,0xc9))[_0x0fd2('0x3d')](handleError(_0x337daa,null));};exports['update']=function(_0x30ac02,_0x119e21){if(_0x30ac02[_0x0fd2('0x42')]['id']){delete _0x30ac02[_0x0fd2('0x42')]['id'];}return db['Cdr'][_0x0fd2('0x43')]({'where':{'id':_0x30ac02[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x119e21,null))[_0x0fd2('0x20')](saveUpdates(_0x30ac02[_0x0fd2('0x42')],null))[_0x0fd2('0x20')](respondWithResult(_0x119e21,null))[_0x0fd2('0x3d')](handleError(_0x119e21,null));};exports[_0x0fd2('0x44')]=function(_0x2377bd,_0x4322b4){return db[_0x0fd2('0x27')]['find']({'where':{'id':_0x2377bd[_0x0fd2('0x3e')]['id']}})[_0x0fd2('0x20')](handleEntityNotFound(_0x4322b4,null))['then'](removeEntity(_0x4322b4,null))[_0x0fd2('0x3d')](handleError(_0x4322b4,null));};exports['describe']=function(_0x19650c,_0x5193b7){return db[_0x0fd2('0x27')][_0x0fd2('0x45')]()[_0x0fd2('0x20')](respondWithResult(_0x5193b7,null))['catch'](handleError(_0x5193b7,null));}; \ No newline at end of file +var _0x85d0=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','VIRTUAL','merge','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','describe','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x85d0,0x164));var _0x085d=function(_0x4a0223,_0x2d8972){_0x4a0223=_0x4a0223-0x0;var _0x5e3335=_0x85d0[_0x4a0223];return _0x5e3335;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x085d('0x0'));var moment=require(_0x085d('0x1'));var BPromise=require(_0x085d('0x2'));var Mustache=require(_0x085d('0x3'));var util=require(_0x085d('0x4'));var path=require(_0x085d('0x5'));var sox=require('sox');var csv=require(_0x085d('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x085d('0x7'));var _=require(_0x085d('0x8'));var squel=require(_0x085d('0x9'));var crypto=require('crypto');var jsforce=require(_0x085d('0xa'));var deskjs=require(_0x085d('0xb'));var toCsv=require(_0x085d('0x6'));var querystring=require(_0x085d('0xc'));var Papa=require(_0x085d('0xd'));var Redis=require(_0x085d('0xe'));var authService=require(_0x085d('0xf'));var qs=require(_0x085d('0x10'));var as=require(_0x085d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x085d('0x12'))(_0x085d('0x13'));var utils=require(_0x085d('0x14'));var config=require(_0x085d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x085d('0x16'))['db'];function respondWithStatusCode(_0x2bd6ae,_0x5c6c27){_0x5c6c27=_0x5c6c27||0xcc;return function(_0x2e0714){if(_0x2e0714){return _0x2bd6ae[_0x085d('0x17')](_0x5c6c27);}return _0x2bd6ae[_0x085d('0x18')](_0x5c6c27)[_0x085d('0x19')]();};}function respondWithResult(_0x5a5252,_0x4b87b9){_0x4b87b9=_0x4b87b9||0xc8;return function(_0x19ce18){if(_0x19ce18){return _0x5a5252['status'](_0x4b87b9)['json'](_0x19ce18);}};}function respondWithFilteredResult(_0x267374,_0x334263){return function(_0x1d041b){if(_0x1d041b){var _0x5f8e18=typeof _0x334263[_0x085d('0x1a')]==='undefined'&&typeof _0x334263[_0x085d('0x1b')]===_0x085d('0x1c');var _0x1efea9=_0x1d041b[_0x085d('0x1d')];var _0x3e566f=_0x5f8e18?0x0:_0x334263[_0x085d('0x1a')];var _0x5c046e=_0x5f8e18?_0x1d041b[_0x085d('0x1d')]:_0x334263[_0x085d('0x1a')]+_0x334263['limit'];var _0xba531c;if(_0x5c046e>=_0x1efea9){_0x5c046e=_0x1efea9;_0xba531c=0xc8;}else{_0xba531c=0xce;}_0x267374[_0x085d('0x18')](_0xba531c);return _0x267374[_0x085d('0x1e')](_0x085d('0x1f'),_0x3e566f+'-'+_0x5c046e+'/'+_0x1efea9)[_0x085d('0x20')](_0x1d041b);}return null;};}function patchUpdates(_0x54eff1){return function(_0xb9d0ad){try{jsonpatch[_0x085d('0x21')](_0xb9d0ad,_0x54eff1,!![]);}catch(_0x39a85e){return BPromise[_0x085d('0x22')](_0x39a85e);}return _0xb9d0ad['save']();};}function saveUpdates(_0x5b3f9c,_0x4cdb11){return function(_0x2b7cdc){if(_0x2b7cdc){return _0x2b7cdc[_0x085d('0x23')](_0x5b3f9c)[_0x085d('0x24')](function(_0x10aa9d){return _0x10aa9d;});}return null;};}function removeEntity(_0x4715d6,_0x17dafb){return function(_0x576d95){if(_0x576d95){return _0x576d95[_0x085d('0x25')]()[_0x085d('0x24')](function(){_0x4715d6[_0x085d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x38cddc,_0x290658){return function(_0xbacfbc){if(!_0xbacfbc){_0x38cddc[_0x085d('0x17')](0x194);}return _0xbacfbc;};}function handleError(_0x300295,_0x4b9032){_0x4b9032=_0x4b9032||0x1f4;return function(_0x5e5228){logger['error'](_0x5e5228[_0x085d('0x26')]);if(_0x5e5228[_0x085d('0x27')]){delete _0x5e5228[_0x085d('0x27')];}_0x300295['status'](_0x4b9032)[_0x085d('0x28')](_0x5e5228);};}exports[_0x085d('0x29')]=function(_0x3faf6b,_0x5c7849){var _0x2f670c={},_0x2eae2c={},_0x3f905d={'count':0x0,'rows':[]};var _0x26aa90=_['map'](db[_0x085d('0x2a')][_0x085d('0x2b')],function(_0x494070){return{'name':_0x494070[_0x085d('0x2c')],'type':_0x494070[_0x085d('0x2d')]['key']};});_0x2eae2c[_0x085d('0x2e')]=_[_0x085d('0x2f')](_0x26aa90,_0x085d('0x27'));_0x2eae2c['query']=_[_0x085d('0x30')](_0x3faf6b[_0x085d('0x31')]);_0x2eae2c[_0x085d('0x32')]=_['intersection'](_0x2eae2c[_0x085d('0x2e')],_0x2eae2c['query']);_0x2f670c[_0x085d('0x33')]=_[_0x085d('0x34')](_0x2eae2c[_0x085d('0x2e')],qs[_0x085d('0x35')](_0x3faf6b['query'][_0x085d('0x35')]));_0x2f670c[_0x085d('0x33')]=_0x2f670c[_0x085d('0x33')][_0x085d('0x36')]?_0x2f670c['attributes']:_0x2eae2c['model'];if(!_0x3faf6b[_0x085d('0x31')][_0x085d('0x37')](_0x085d('0x38'))){_0x2f670c[_0x085d('0x1b')]=qs[_0x085d('0x1b')](_0x3faf6b[_0x085d('0x31')][_0x085d('0x1b')]);_0x2f670c[_0x085d('0x1a')]=qs[_0x085d('0x1a')](_0x3faf6b['query'][_0x085d('0x1a')]);}_0x2f670c[_0x085d('0x39')]=qs['sort'](_0x3faf6b[_0x085d('0x31')]['sort']);_0x2f670c[_0x085d('0x3a')]=qs[_0x085d('0x32')](_['pick'](_0x3faf6b[_0x085d('0x31')],_0x2eae2c[_0x085d('0x32')]),_0x26aa90);if(_0x3faf6b[_0x085d('0x31')][_0x085d('0x3b')]){_0x2f670c[_0x085d('0x3a')]=_['merge'](_0x2f670c[_0x085d('0x3a')],{'$or':_['map'](_0x26aa90,function(_0x5d52be){if(_0x5d52be[_0x085d('0x2d')]!==_0x085d('0x3c')){var _0x31ee22={};_0x31ee22[_0x5d52be[_0x085d('0x27')]]={'$like':'%'+_0x3faf6b[_0x085d('0x31')]['filter']+'%'};return _0x31ee22;}})});}_0x2f670c=_[_0x085d('0x3d')]({},_0x2f670c,_0x3faf6b['options']);var _0x3a8646={'where':_0x2f670c[_0x085d('0x3a')]};return db[_0x085d('0x2a')]['count'](_0x3a8646)[_0x085d('0x24')](function(_0x55d81a){_0x3f905d[_0x085d('0x1d')]=_0x55d81a;if(_0x3faf6b[_0x085d('0x31')]['includeAll']){_0x2f670c[_0x085d('0x3e')]=[{'all':!![]}];}return db[_0x085d('0x2a')][_0x085d('0x3f')](_0x2f670c);})['then'](function(_0x56428e){_0x3f905d[_0x085d('0x40')]=_0x56428e;return _0x3f905d;})[_0x085d('0x24')](respondWithFilteredResult(_0x5c7849,_0x2f670c))[_0x085d('0x41')](handleError(_0x5c7849,null));};exports[_0x085d('0x42')]=function(_0x177f7d,_0x367a32){var _0x27e1c7={'raw':!![],'where':{'id':_0x177f7d[_0x085d('0x43')]['id']}},_0x120980={};_0x120980[_0x085d('0x2e')]=_['keys'](db['Cdr'][_0x085d('0x2b')]);_0x120980[_0x085d('0x31')]=_[_0x085d('0x30')](_0x177f7d[_0x085d('0x31')]);_0x120980[_0x085d('0x32')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],_0x120980[_0x085d('0x31')]);_0x27e1c7[_0x085d('0x33')]=_[_0x085d('0x34')](_0x120980[_0x085d('0x2e')],qs['fields'](_0x177f7d[_0x085d('0x31')][_0x085d('0x35')]));_0x27e1c7[_0x085d('0x33')]=_0x27e1c7[_0x085d('0x33')][_0x085d('0x36')]?_0x27e1c7['attributes']:_0x120980[_0x085d('0x2e')];if(_0x177f7d['query'][_0x085d('0x44')]){_0x27e1c7['include']=[{'all':!![]}];}_0x27e1c7=_['merge']({},_0x27e1c7,_0x177f7d[_0x085d('0x45')]);return db[_0x085d('0x2a')][_0x085d('0x46')](_0x27e1c7)[_0x085d('0x24')](handleEntityNotFound(_0x367a32,null))[_0x085d('0x24')](respondWithResult(_0x367a32,null))['catch'](handleError(_0x367a32,null));};exports['create']=function(_0x547723,_0x580b91){return db['Cdr'][_0x085d('0x47')](_0x547723[_0x085d('0x48')],{})['then'](respondWithResult(_0x580b91,0xc9))[_0x085d('0x41')](handleError(_0x580b91,null));};exports['update']=function(_0x5df4cf,_0x415a4b){if(_0x5df4cf[_0x085d('0x48')]['id']){delete _0x5df4cf[_0x085d('0x48')]['id'];}return db[_0x085d('0x2a')]['find']({'where':{'id':_0x5df4cf[_0x085d('0x43')]['id']}})['then'](handleEntityNotFound(_0x415a4b,null))[_0x085d('0x24')](saveUpdates(_0x5df4cf[_0x085d('0x48')],null))['then'](respondWithResult(_0x415a4b,null))[_0x085d('0x41')](handleError(_0x415a4b,null));};exports[_0x085d('0x25')]=function(_0x298f6f,_0x37b56c){return db['Cdr'][_0x085d('0x46')]({'where':{'id':_0x298f6f['params']['id']}})[_0x085d('0x24')](handleEntityNotFound(_0x37b56c,null))['then'](removeEntity(_0x37b56c,null))['catch'](handleError(_0x37b56c,null));};exports[_0x085d('0x49')]=function(_0x41e3e0,_0x236368){return db[_0x085d('0x2a')][_0x085d('0x49')]()[_0x085d('0x24')](respondWithResult(_0x236368,null))[_0x085d('0x41')](handleError(_0x236368,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index c834cbe..8468e43 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x341951,_0x57e851){var _0x577e2a=function(_0x1b15d0){while(--_0x1b15d0){_0x341951['push'](_0x341951['shift']());}};_0x577e2a(++_0x57e851);}(_0x7a54,0x106));var _0x47a5=function(_0x45169d,_0x102c83){_0x45169d=_0x45169d-0x0;var _0x3049ef=_0x7a54[_0x45169d];return _0x3049ef;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4dadeb,_0x4f99b9){var _0x39d793=function(_0x513e3e){while(--_0x513e3e){_0x4dadeb['push'](_0x4dadeb['shift']());}};_0x39d793(++_0x4f99b9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 81d9df7..38d0b25 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 _0x2ffa=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0xf903ea,_0x3cf8c2){var _0xe37d4b=function(_0x338ffa){while(--_0x338ffa){_0xf903ea['push'](_0xf903ea['shift']());}};_0xe37d4b(++_0x3cf8c2);}(_0x2ffa,0xac));var _0xa2ff=function(_0x5401e4,_0x520fff){_0x5401e4=_0x5401e4-0x0;var _0x4699c2=_0x2ffa[_0x5401e4];return _0x4699c2;};'use strict';var _=require(_0xa2ff('0x0'));var util=require(_0xa2ff('0x1'));var moment=require(_0xa2ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xa2ff('0x3'));var fs=require('fs');var Redis=require(_0xa2ff('0x4'));var db=require(_0xa2ff('0x5'))['db'];var utils=require(_0xa2ff('0x6'));var logger=require(_0xa2ff('0x7'))(_0xa2ff('0x8'));var config=require(_0xa2ff('0x9'));var jayson=require(_0xa2ff('0xa'));var client=jayson['client'][_0xa2ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec8fc,_0x53225a,_0x35b849){return new BPromise(function(_0x2b7de2,_0x1f3cf9){return client[_0xa2ff('0xc')](_0x3ec8fc,_0x35b849)[_0xa2ff('0xd')](function(_0x3ce434){logger[_0xa2ff('0xe')](_0xa2ff('0xf'),_0x53225a,_0xa2ff('0x10'));logger[_0xa2ff('0x11')](_0xa2ff('0x12'),_0x53225a,_0xa2ff('0x10'),JSON[_0xa2ff('0x13')](_0x3ce434));if(_0x3ce434[_0xa2ff('0x14')]){if(_0x3ce434[_0xa2ff('0x14')][_0xa2ff('0x15')]===0x1f4){logger[_0xa2ff('0x14')](_0xa2ff('0xf'),_0x53225a,_0x3ce434['error'][_0xa2ff('0x16')]);return _0x1f3cf9(_0x3ce434['error'][_0xa2ff('0x16')]);}logger[_0xa2ff('0x14')](_0xa2ff('0xf'),_0x53225a,_0x3ce434[_0xa2ff('0x14')]['message']);return _0x2b7de2(_0x3ce434[_0xa2ff('0x14')][_0xa2ff('0x16')]);}else{logger['info'](_0xa2ff('0xf'),_0x53225a,_0xa2ff('0x10'));_0x2b7de2(_0x3ce434[_0xa2ff('0x17')]['message']);}})[_0xa2ff('0x18')](function(_0x4aacd8){logger[_0xa2ff('0x14')]('Cdr,\x20%s,\x20%s',_0x53225a,_0x4aacd8);_0x1f3cf9(_0x4aacd8);});});} \ No newline at end of file +var _0xe4c0=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20f33f,_0xc3d779){var _0x3c0f3a=function(_0x563ae2){while(--_0x563ae2){_0x20f33f['push'](_0x20f33f['shift']());}};_0x3c0f3a(++_0xc3d779);}(_0xe4c0,0x195));var _0x0e4c=function(_0x19ef2b,_0x354f66){_0x19ef2b=_0x19ef2b-0x0;var _0x4df537=_0xe4c0[_0x19ef2b];return _0x4df537;};'use strict';var _=require(_0x0e4c('0x0'));var util=require('util');var moment=require(_0x0e4c('0x1'));var BPromise=require(_0x0e4c('0x2'));var rs=require(_0x0e4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0e4c('0x4'))['db'];var utils=require(_0x0e4c('0x5'));var logger=require(_0x0e4c('0x6'))(_0x0e4c('0x7'));var config=require(_0x0e4c('0x8'));var jayson=require(_0x0e4c('0x9'));var client=jayson[_0x0e4c('0xa')][_0x0e4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e465d,_0x56983c,_0x3cb9f0){return new BPromise(function(_0x441ad8,_0x44d2f3){return client[_0x0e4c('0xc')](_0x5e465d,_0x3cb9f0)[_0x0e4c('0xd')](function(_0x197e40){logger[_0x0e4c('0xe')](_0x0e4c('0xf'),_0x56983c,_0x0e4c('0x10'));logger[_0x0e4c('0x11')](_0x0e4c('0x12'),_0x56983c,'request\x20sent',JSON[_0x0e4c('0x13')](_0x197e40));if(_0x197e40[_0x0e4c('0x14')]){if(_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x15')]===0x1f4){logger['error'](_0x0e4c('0xf'),_0x56983c,_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x16')]);return _0x44d2f3(_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x16')]);}logger[_0x0e4c('0x14')](_0x0e4c('0xf'),_0x56983c,_0x197e40[_0x0e4c('0x14')][_0x0e4c('0x16')]);return _0x441ad8(_0x197e40['error'][_0x0e4c('0x16')]);}else{logger[_0x0e4c('0xe')](_0x0e4c('0xf'),_0x56983c,_0x0e4c('0x10'));_0x441ad8(_0x197e40[_0x0e4c('0x17')][_0x0e4c('0x16')]);}})[_0x0e4c('0x18')](function(_0x3a5251){logger[_0x0e4c('0x14')]('Cdr,\x20%s,\x20%s',_0x56983c,_0x3a5251);_0x44d2f3(_0x3a5251);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 9788d3c..d4973fe 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file +var _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(_0x31b5a5,_0x44376a){var _0x364cc9=function(_0x4e5f95){while(--_0x4e5f95){_0x31b5a5['push'](_0x31b5a5['shift']());}};_0x364cc9(++_0x44376a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 9aa3e5e..1e9ea1f 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 _0xb179=['TEXT','*,*,*,*','INTEGER','STRING','noop'];(function(_0x506344,_0x21aa82){var _0x2d6d80=function(_0x532f2c){while(--_0x532f2c){_0x506344['push'](_0x506344['shift']());}};_0x2d6d80(++_0x21aa82);}(_0xb179,0xfc));var _0x9b17=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb179[_0x138adb];return _0x1b27f2;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0x9b17('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0x9b17('0x1')],'allowNull':![],'defaultValue':_0x9b17('0x2')},'appdata':{'type':Sequelize[_0x9b17('0x3')]()},'description':{'type':Sequelize[_0x9b17('0x1')]},'interval':{'type':Sequelize[_0x9b17('0x1')],'defaultValue':_0x9b17('0x4')}}; \ No newline at end of file +var _0x758a=['STRING','noop','TEXT','sequelize','exports','INTEGER'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0x758a,0x1d1));var _0xa758=function(_0x4d955c,_0x2e8a78){_0x4d955c=_0x4d955c-0x0;var _0x46e26d=_0x758a[_0x4d955c];return _0x46e26d;};'use strict';var Sequelize=require(_0xa758('0x0'));module[_0xa758('0x1')]={'priority':{'type':Sequelize[_0xa758('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa758('0x3')],'allowNull':![],'defaultValue':_0xa758('0x4')},'appdata':{'type':Sequelize[_0xa758('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 7bc6823..97e3eac 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 _0xa0bc=['moment','bluebird','mustache','util','path','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','ChatApplication','body','find','catch','rimraf','zip-dir','request-promise'];(function(_0x14df77,_0x4741e7){var _0x4d6e7d=function(_0x200bd4){while(--_0x200bd4){_0x14df77['push'](_0x14df77['shift']());}};_0x4d6e7d(++_0x4741e7);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0b('0x0'));var zipdir=require(_0xca0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca0b('0x2'));var moment=require(_0xca0b('0x3'));var BPromise=require(_0xca0b('0x4'));var Mustache=require(_0xca0b('0x5'));var util=require(_0xca0b('0x6'));var path=require(_0xca0b('0x7'));var sox=require(_0xca0b('0x8'));var csv=require(_0xca0b('0x9'));var ejs=require(_0xca0b('0xa'));var fs=require('fs');var fs_extra=require(_0xca0b('0xb'));var _=require(_0xca0b('0xc'));var squel=require(_0xca0b('0xd'));var crypto=require(_0xca0b('0xe'));var jsforce=require(_0xca0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca0b('0x9'));var querystring=require(_0xca0b('0x10'));var Papa=require(_0xca0b('0x11'));var Redis=require(_0xca0b('0x12'));var authService=require(_0xca0b('0x13'));var qs=require(_0xca0b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca0b('0x15'));var logger=require(_0xca0b('0x16'))(_0xca0b('0x17'));var utils=require(_0xca0b('0x18'));var config=require(_0xca0b('0x19'));var licenseUtil=require(_0xca0b('0x1a'));var db=require(_0xca0b('0x1b'))['db'];function respondWithStatusCode(_0x3a2e25,_0x22ca9d){_0x22ca9d=_0x22ca9d||0xcc;return function(_0x2ce366){if(_0x2ce366){return _0x3a2e25['sendStatus'](_0x22ca9d);}return _0x3a2e25[_0xca0b('0x1c')](_0x22ca9d)[_0xca0b('0x1d')]();};}function respondWithResult(_0x358972,_0x5da205){_0x5da205=_0x5da205||0xc8;return function(_0x106ed6){if(_0x106ed6){return _0x358972[_0xca0b('0x1c')](_0x5da205)[_0xca0b('0x1e')](_0x106ed6);}};}function respondWithFilteredResult(_0x2beba9,_0x42b68e){return function(_0x404c6d){if(_0x404c6d){var _0x4d7620=typeof _0x42b68e[_0xca0b('0x1f')]===_0xca0b('0x20')&&typeof _0x42b68e['limit']===_0xca0b('0x20');var _0x5db810=_0x404c6d[_0xca0b('0x21')];var _0x5050b7=_0x4d7620?0x0:_0x42b68e[_0xca0b('0x1f')];var _0x32eff7=_0x4d7620?_0x404c6d[_0xca0b('0x21')]:_0x42b68e['offset']+_0x42b68e[_0xca0b('0x22')];var _0x2c0c53;if(_0x32eff7>=_0x5db810){_0x32eff7=_0x5db810;_0x2c0c53=0xc8;}else{_0x2c0c53=0xce;}_0x2beba9['status'](_0x2c0c53);return _0x2beba9[_0xca0b('0x23')](_0xca0b('0x24'),_0x5050b7+'-'+_0x32eff7+'/'+_0x5db810)[_0xca0b('0x1e')](_0x404c6d);}return null;};}function patchUpdates(_0x59bda9){return function(_0x865393){try{jsonpatch[_0xca0b('0x25')](_0x865393,_0x59bda9,!![]);}catch(_0x484e26){return BPromise[_0xca0b('0x26')](_0x484e26);}return _0x865393[_0xca0b('0x27')]();};}function saveUpdates(_0x2ae93b,_0x49e695){return function(_0x119589){if(_0x119589){return _0x119589[_0xca0b('0x28')](_0x2ae93b)[_0xca0b('0x29')](function(_0x504d91){return _0x504d91;});}return null;};}function removeEntity(_0x54fb03,_0x11f5c3){return function(_0x428459){if(_0x428459){return _0x428459[_0xca0b('0x2a')]()[_0xca0b('0x29')](function(){_0x54fb03[_0xca0b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe122e8,_0x10b5f3){return function(_0x131c0e){if(!_0x131c0e){_0xe122e8[_0xca0b('0x2b')](0x194);}return _0x131c0e;};}function handleError(_0x15478d,_0x48e172){_0x48e172=_0x48e172||0x1f4;return function(_0x4d2d1a){logger['error'](_0x4d2d1a[_0xca0b('0x2c')]);if(_0x4d2d1a[_0xca0b('0x2d')]){delete _0x4d2d1a[_0xca0b('0x2d')];}_0x15478d[_0xca0b('0x1c')](_0x48e172)[_0xca0b('0x2e')](_0x4d2d1a);};}exports['show']=function(_0x23af62,_0xbfcb5f){var _0x3b73ff={'raw':!![],'where':{'id':_0x23af62[_0xca0b('0x2f')]['id']}},_0x20f0d5={};_0x20f0d5[_0xca0b('0x30')]=_[_0xca0b('0x31')](db['ChatApplication'][_0xca0b('0x32')]);_0x20f0d5[_0xca0b('0x33')]=_[_0xca0b('0x31')](_0x23af62[_0xca0b('0x33')]);_0x20f0d5['filters']=_[_0xca0b('0x34')](_0x20f0d5[_0xca0b('0x30')],_0x20f0d5[_0xca0b('0x33')]);_0x3b73ff[_0xca0b('0x35')]=_[_0xca0b('0x34')](_0x20f0d5[_0xca0b('0x30')],qs[_0xca0b('0x36')](_0x23af62[_0xca0b('0x33')][_0xca0b('0x36')]));_0x3b73ff[_0xca0b('0x35')]=_0x3b73ff[_0xca0b('0x35')][_0xca0b('0x37')]?_0x3b73ff[_0xca0b('0x35')]:_0x20f0d5[_0xca0b('0x30')];if(_0x23af62[_0xca0b('0x33')]['includeAll']){_0x3b73ff[_0xca0b('0x38')]=[{'all':!![]}];}_0x3b73ff=_[_0xca0b('0x39')]({},_0x3b73ff,_0x23af62[_0xca0b('0x3a')]);return db[_0xca0b('0x3b')]['find'](_0x3b73ff)[_0xca0b('0x29')](handleEntityNotFound(_0xbfcb5f,null))[_0xca0b('0x29')](respondWithResult(_0xbfcb5f,null))['catch'](handleError(_0xbfcb5f,null));};exports[_0xca0b('0x28')]=function(_0x146f82,_0xe7f5f5){if(_0x146f82[_0xca0b('0x3c')]['id']){delete _0x146f82[_0xca0b('0x3c')]['id'];}return db[_0xca0b('0x3b')][_0xca0b('0x3d')]({'where':{'id':_0x146f82[_0xca0b('0x2f')]['id']}})['then'](handleEntityNotFound(_0xe7f5f5,null))['then'](saveUpdates(_0x146f82[_0xca0b('0x3c')],null))[_0xca0b('0x29')](respondWithResult(_0xe7f5f5,null))[_0xca0b('0x3e')](handleError(_0xe7f5f5,null));};exports[_0xca0b('0x2a')]=function(_0x351f5a,_0x246edf){return db[_0xca0b('0x3b')][_0xca0b('0x3d')]({'where':{'id':_0x351f5a[_0xca0b('0x2f')]['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x246edf,null))[_0xca0b('0x29')](removeEntity(_0x246edf,null))[_0xca0b('0x3e')](handleError(_0x246edf,null));}; \ No newline at end of file +var _0x9173=['ChatApplication','find','then','update','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','error','stack','send','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','fields','length','include','merge','options'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x9173,0xb4));var _0x3917=function(_0x1af7fd,_0x53876f){_0x1af7fd=_0x1af7fd-0x0;var _0x187916=_0x9173[_0x1af7fd];return _0x187916;};'use strict';var emlformat=require(_0x3917('0x0'));var rimraf=require(_0x3917('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3917('0x2'));var rp=require(_0x3917('0x3'));var moment=require(_0x3917('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3917('0x5'));var util=require('util');var path=require(_0x3917('0x6'));var sox=require(_0x3917('0x7'));var csv=require(_0x3917('0x8'));var ejs=require(_0x3917('0x9'));var fs=require('fs');var fs_extra=require(_0x3917('0xa'));var _=require('lodash');var squel=require(_0x3917('0xb'));var crypto=require(_0x3917('0xc'));var jsforce=require(_0x3917('0xd'));var deskjs=require(_0x3917('0xe'));var toCsv=require(_0x3917('0x8'));var querystring=require(_0x3917('0xf'));var Papa=require('papaparse');var Redis=require(_0x3917('0x10'));var authService=require(_0x3917('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3917('0x12'));var hardwareService=require(_0x3917('0x13'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3917('0x14'));var licenseUtil=require(_0x3917('0x15'));var db=require(_0x3917('0x16'))['db'];function respondWithStatusCode(_0x351db3,_0x3b3b40){_0x3b3b40=_0x3b3b40||0xcc;return function(_0xc0902d){if(_0xc0902d){return _0x351db3['sendStatus'](_0x3b3b40);}return _0x351db3[_0x3917('0x17')](_0x3b3b40)[_0x3917('0x18')]();};}function respondWithResult(_0x3268eb,_0x1d19bc){_0x1d19bc=_0x1d19bc||0xc8;return function(_0x4d7f6c){if(_0x4d7f6c){return _0x3268eb[_0x3917('0x17')](_0x1d19bc)[_0x3917('0x19')](_0x4d7f6c);}};}function respondWithFilteredResult(_0x36b162,_0x291147){return function(_0x23821c){if(_0x23821c){var _0x483e45=typeof _0x291147[_0x3917('0x1a')]==='undefined'&&typeof _0x291147['limit']===_0x3917('0x1b');var _0x42b9d4=_0x23821c[_0x3917('0x1c')];var _0x509b2b=_0x483e45?0x0:_0x291147[_0x3917('0x1a')];var _0x504934=_0x483e45?_0x23821c['count']:_0x291147[_0x3917('0x1a')]+_0x291147['limit'];var _0x1f91a5;if(_0x504934>=_0x42b9d4){_0x504934=_0x42b9d4;_0x1f91a5=0xc8;}else{_0x1f91a5=0xce;}_0x36b162[_0x3917('0x17')](_0x1f91a5);return _0x36b162[_0x3917('0x1d')](_0x3917('0x1e'),_0x509b2b+'-'+_0x504934+'/'+_0x42b9d4)[_0x3917('0x19')](_0x23821c);}return null;};}function patchUpdates(_0x2f9f7d){return function(_0x1d4e33){try{jsonpatch[_0x3917('0x1f')](_0x1d4e33,_0x2f9f7d,!![]);}catch(_0x15e00f){return BPromise[_0x3917('0x20')](_0x15e00f);}return _0x1d4e33[_0x3917('0x21')]();};}function saveUpdates(_0x4cc295,_0x1e3d24){return function(_0x1adbe4){if(_0x1adbe4){return _0x1adbe4['update'](_0x4cc295)['then'](function(_0xc3397){return _0xc3397;});}return null;};}function removeEntity(_0x52f027,_0x127ab5){return function(_0x337aba){if(_0x337aba){return _0x337aba[_0x3917('0x22')]()['then'](function(){_0x52f027[_0x3917('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x454b17,_0x1bc725){return function(_0x22f3e7){if(!_0x22f3e7){_0x454b17['sendStatus'](0x194);}return _0x22f3e7;};}function handleError(_0x1a79c2,_0x36892d){_0x36892d=_0x36892d||0x1f4;return function(_0x103729){logger[_0x3917('0x23')](_0x103729[_0x3917('0x24')]);if(_0x103729['name']){delete _0x103729['name'];}_0x1a79c2[_0x3917('0x17')](_0x36892d)[_0x3917('0x25')](_0x103729);};}exports[_0x3917('0x26')]=function(_0x29eb9b,_0x12302d){var _0x4060a8={'raw':!![],'where':{'id':_0x29eb9b[_0x3917('0x27')]['id']}},_0x2e80ca={};_0x2e80ca[_0x3917('0x28')]=_[_0x3917('0x29')](db['ChatApplication'][_0x3917('0x2a')]);_0x2e80ca['query']=_[_0x3917('0x29')](_0x29eb9b['query']);_0x2e80ca[_0x3917('0x2b')]=_[_0x3917('0x2c')](_0x2e80ca['model'],_0x2e80ca[_0x3917('0x2d')]);_0x4060a8[_0x3917('0x2e')]=_[_0x3917('0x2c')](_0x2e80ca[_0x3917('0x28')],qs['fields'](_0x29eb9b[_0x3917('0x2d')][_0x3917('0x2f')]));_0x4060a8[_0x3917('0x2e')]=_0x4060a8[_0x3917('0x2e')][_0x3917('0x30')]?_0x4060a8[_0x3917('0x2e')]:_0x2e80ca[_0x3917('0x28')];if(_0x29eb9b[_0x3917('0x2d')]['includeAll']){_0x4060a8[_0x3917('0x31')]=[{'all':!![]}];}_0x4060a8=_[_0x3917('0x32')]({},_0x4060a8,_0x29eb9b[_0x3917('0x33')]);return db[_0x3917('0x34')][_0x3917('0x35')](_0x4060a8)['then'](handleEntityNotFound(_0x12302d,null))[_0x3917('0x36')](respondWithResult(_0x12302d,null))['catch'](handleError(_0x12302d,null));};exports[_0x3917('0x37')]=function(_0x476630,_0x5c96f3){if(_0x476630[_0x3917('0x38')]['id']){delete _0x476630[_0x3917('0x38')]['id'];}return db[_0x3917('0x34')][_0x3917('0x35')]({'where':{'id':_0x476630[_0x3917('0x27')]['id']}})[_0x3917('0x36')](handleEntityNotFound(_0x5c96f3,null))[_0x3917('0x36')](saveUpdates(_0x476630[_0x3917('0x38')],null))[_0x3917('0x36')](respondWithResult(_0x5c96f3,null))[_0x3917('0x39')](handleError(_0x5c96f3,null));};exports[_0x3917('0x22')]=function(_0x404325,_0x48c22f){return db[_0x3917('0x34')][_0x3917('0x35')]({'where':{'id':_0x404325[_0x3917('0x27')]['id']}})[_0x3917('0x36')](handleEntityNotFound(_0x48c22f,null))[_0x3917('0x36')](removeEntity(_0x48c22f,null))['catch'](handleError(_0x48c22f,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 7e4c3aa..437b7c2 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 _0xb4cd=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatApplication.attributes','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x30e445,_0x3a0148){var _0x4fe98d=function(_0x5da324){while(--_0x5da324){_0x30e445['push'](_0x30e445['shift']());}};_0x4fe98d(++_0x3a0148);}(_0xb4cd,0x11b));var _0xdb4c=function(_0x23db46,_0x133949){_0x23db46=_0x23db46-0x0;var _0xbaed6b=_0xb4cd[_0x23db46];return _0xbaed6b;};'use strict';var _=require(_0xdb4c('0x0'));var util=require(_0xdb4c('0x1'));var logger=require(_0xdb4c('0x2'))(_0xdb4c('0x3'));var moment=require(_0xdb4c('0x4'));var BPromise=require(_0xdb4c('0x5'));var rp=require(_0xdb4c('0x6'));var fs=require('fs');var path=require(_0xdb4c('0x7'));var rimraf=require(_0xdb4c('0x8'));var config=require('../../config/environment');var attributes=require(_0xdb4c('0x9'));module['exports']=function(_0x14e9a4,_0x3495da){return _0x14e9a4[_0xdb4c('0xa')](_0xdb4c('0xb'),attributes,{'tableName':_0xdb4c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdb4c('0xd'),'collate':_0xdb4c('0xe')});}; \ No newline at end of file +var _0xc7ad=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','../../config/environment'];(function(_0x5124cf,_0x455717){var _0x41c979=function(_0x2d4efc){while(--_0x2d4efc){_0x5124cf['push'](_0x5124cf['shift']());}};_0x41c979(++_0x455717);}(_0xc7ad,0xca));var _0xdc7a=function(_0x162291,_0x92062b){_0x162291=_0x162291-0x0;var _0x3fc840=_0xc7ad[_0x162291];return _0x3fc840;};'use strict';var _=require(_0xdc7a('0x0'));var util=require(_0xdc7a('0x1'));var logger=require(_0xdc7a('0x2'))('api');var moment=require(_0xdc7a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc7a('0x4'));var rimraf=require('rimraf');var config=require(_0xdc7a('0x5'));var attributes=require(_0xdc7a('0x6'));module[_0xdc7a('0x7')]=function(_0x1eb79d,_0x45161c){return _0x1eb79d[_0xdc7a('0x8')](_0xdc7a('0x9'),attributes,{'tableName':_0xdc7a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdc7a('0xb'),'collate':_0xdc7a('0xc')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 28797a5..84c0953 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 _0x6de1=['ChatApplication,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','request','then','request\x20sent','debug','error'];(function(_0x41382c,_0xc3ffd1){var _0x4da35b=function(_0x5d56b8){while(--_0x5d56b8){_0x41382c['push'](_0x41382c['shift']());}};_0x4da35b(++_0xc3ffd1);}(_0x6de1,0x1f1));var _0x16de=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x6de1[_0x1b892b];return _0xa99e57;};'use strict';var _=require(_0x16de('0x0'));var util=require(_0x16de('0x1'));var moment=require('moment');var BPromise=require(_0x16de('0x2'));var rs=require(_0x16de('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x16de('0x5'))(_0x16de('0x6'));var config=require('../../config/environment');var jayson=require(_0x16de('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4322e5,_0x44a9a7,_0x1b091f){return new BPromise(function(_0x55c616,_0xf5f41f){return client[_0x16de('0x8')](_0x4322e5,_0x1b091f)[_0x16de('0x9')](function(_0x10dc6c){logger['info']('ChatApplication,\x20%s,\x20%s',_0x44a9a7,_0x16de('0xa'));logger[_0x16de('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x44a9a7,_0x16de('0xa'),JSON['stringify'](_0x10dc6c));if(_0x10dc6c[_0x16de('0xc')]){if(_0x10dc6c[_0x16de('0xc')]['code']===0x1f4){logger[_0x16de('0xc')](_0x16de('0xd'),_0x44a9a7,_0x10dc6c[_0x16de('0xc')][_0x16de('0xe')]);return _0xf5f41f(_0x10dc6c['error'][_0x16de('0xe')]);}logger[_0x16de('0xc')]('ChatApplication,\x20%s,\x20%s',_0x44a9a7,_0x10dc6c[_0x16de('0xc')][_0x16de('0xe')]);return _0x55c616(_0x10dc6c['error'][_0x16de('0xe')]);}else{logger[_0x16de('0xf')](_0x16de('0xd'),_0x44a9a7,_0x16de('0xa'));_0x55c616(_0x10dc6c[_0x16de('0x10')]['message']);}})['catch'](function(_0x1e1ab4){logger[_0x16de('0xc')](_0x16de('0xd'),_0x44a9a7,_0x1e1ab4);_0xf5f41f(_0x1e1ab4);});});} \ No newline at end of file +var _0x4596=['rpc','../../config/environment','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x2a9c81,_0x434c00){var _0xf92bb3=function(_0xe0560a){while(--_0xe0560a){_0x2a9c81['push'](_0x2a9c81['shift']());}};_0xf92bb3(++_0x434c00);}(_0x4596,0xf5));var _0x6459=function(_0x2f2b47,_0x27fd21){_0x2f2b47=_0x2f2b47-0x0;var _0x279bf8=_0x4596[_0x2f2b47];return _0x279bf8;};'use strict';var _=require(_0x6459('0x0'));var util=require(_0x6459('0x1'));var moment=require(_0x6459('0x2'));var BPromise=require(_0x6459('0x3'));var rs=require(_0x6459('0x4'));var fs=require('fs');var Redis=require(_0x6459('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6459('0x6'));var logger=require(_0x6459('0x7'))(_0x6459('0x8'));var config=require(_0x6459('0x9'));var jayson=require(_0x6459('0xa'));var client=jayson['client'][_0x6459('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5173e7,_0x6b7e66,_0x110b5e){return new BPromise(function(_0x4a7404,_0x26bc6a){return client[_0x6459('0xc')](_0x5173e7,_0x110b5e)[_0x6459('0xd')](function(_0x170b96){logger[_0x6459('0xe')](_0x6459('0xf'),_0x6b7e66,_0x6459('0x10'));logger[_0x6459('0x11')](_0x6459('0x12'),_0x6b7e66,_0x6459('0x10'),JSON['stringify'](_0x170b96));if(_0x170b96[_0x6459('0x13')]){if(_0x170b96[_0x6459('0x13')][_0x6459('0x14')]===0x1f4){logger[_0x6459('0x13')](_0x6459('0xf'),_0x6b7e66,_0x170b96[_0x6459('0x13')][_0x6459('0x15')]);return _0x26bc6a(_0x170b96[_0x6459('0x13')][_0x6459('0x15')]);}logger[_0x6459('0x13')](_0x6459('0xf'),_0x6b7e66,_0x170b96[_0x6459('0x13')][_0x6459('0x15')]);return _0x4a7404(_0x170b96['error'][_0x6459('0x15')]);}else{logger[_0x6459('0xe')](_0x6459('0xf'),_0x6b7e66,_0x6459('0x10'));_0x4a7404(_0x170b96['result']['message']);}})[_0x6459('0x16')](function(_0x496d11){logger['error'](_0x6459('0xf'),_0x6b7e66,_0x496d11);_0x26bc6a(_0x496d11);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index df56057..2380a7f 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 _0xb62b=['util','path','connect-timeout','express','Router','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','destroy','multer'];(function(_0x50313d,_0x533f0b){var _0x1b8f00=function(_0x2c1599){while(--_0x2c1599){_0x50313d['push'](_0x50313d['shift']());}};_0x1b8f00(++_0x533f0b);}(_0xb62b,0x158));var _0xbb62=function(_0x180b37,_0x1d24c6){_0x180b37=_0x180b37-0x0;var _0x59a09b=_0xb62b[_0x180b37];return _0x59a09b;};'use strict';var multer=require(_0xbb62('0x0'));var util=require(_0xbb62('0x1'));var path=require(_0xbb62('0x2'));var timeout=require(_0xbb62('0x3'));var express=require(_0xbb62('0x4'));var router=express[_0xbb62('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbb62('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb62('0x7'));router[_0xbb62('0x8')](_0xbb62('0x9'),auth[_0xbb62('0xa')](),controller[_0xbb62('0xb')]);router[_0xbb62('0xc')](_0xbb62('0x9'),auth[_0xbb62('0xa')](),controller[_0xbb62('0xd')]);router['delete'](_0xbb62('0x9'),auth[_0xbb62('0xa')](),controller[_0xbb62('0xe')]);module['exports']=router; \ No newline at end of file +var _0x9537=['update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x2b91c5,_0x3b6db5){var _0xbd5531=function(_0x54783d){while(--_0x54783d){_0x2b91c5['push'](_0x2b91c5['shift']());}};_0xbd5531(++_0x3b6db5);}(_0x9537,0x1ce));var _0x7953=function(_0x23525c,_0x17b6ee){_0x23525c=_0x23525c-0x0;var _0x3eaeb9=_0x9537[_0x23525c];return _0x3eaeb9;};'use strict';var multer=require('multer');var util=require(_0x7953('0x0'));var path=require('path');var timeout=require(_0x7953('0x1'));var express=require(_0x7953('0x2'));var router=express[_0x7953('0x3')]();var fs_extra=require(_0x7953('0x4'));var auth=require(_0x7953('0x5'));var interaction=require(_0x7953('0x6'));var config=require(_0x7953('0x7'));var controller=require(_0x7953('0x8'));router[_0x7953('0x9')](_0x7953('0xa'),auth[_0x7953('0xb')](),controller[_0x7953('0xc')]);router[_0x7953('0xd')](_0x7953('0xa'),auth[_0x7953('0xb')](),controller[_0x7953('0xe')]);router['delete'](_0x7953('0xa'),auth[_0x7953('0xb')](),controller[_0x7953('0xf')]);module[_0x7953('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index d89b3e0..542dfa0 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 _0x222a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4c05da,_0x414720){var _0x1614db=function(_0xa19cf6){while(--_0xa19cf6){_0x4c05da['push'](_0x4c05da['shift']());}};_0x1614db(++_0x414720);}(_0x222a,0xb3));var _0xa222=function(_0x488695,_0x1d612f){_0x488695=_0x488695-0x0;var _0x375732=_0x222a[_0x488695];return _0x375732;};'use strict';var Sequelize=require(_0xa222('0x0'));module[_0xa222('0x1')]={'name':{'type':Sequelize[_0xa222('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa222('0x2')]},'write':{'type':Sequelize[_0xa222('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbf25=['BOOLEAN','sequelize','exports','STRING'];(function(_0x230f58,_0x1f8377){var _0x3fdd2c=function(_0x4fb155){while(--_0x4fb155){_0x230f58['push'](_0x230f58['shift']());}};_0x3fdd2c(++_0x1f8377);}(_0xbf25,0x12d));var _0x5bf2=function(_0x10fb80,_0x5936f2){_0x10fb80=_0x10fb80-0x0;var _0x2dc53b=_0xbf25[_0x10fb80];return _0x2dc53b;};'use strict';var Sequelize=require(_0x5bf2('0x0'));module[_0x5bf2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x5bf2('0x2')]},'write':{'type':Sequelize[_0x5bf2('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 49e528f..9f10206 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 _0x4324=['getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','then','stack','name','send','index','ChatGroup','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','ids','getMembers','findOne','User','hasOwnProperty','removeMembers','ChatGroupId'];(function(_0x1e9519,_0x4a3445){var _0x5e9690=function(_0x3a2256){while(--_0x3a2256){_0x1e9519['push'](_0x1e9519['shift']());}};_0x5e9690(++_0x4a3445);}(_0x4324,0x12b));var _0x4432=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0x4324[_0x3227c1];return _0x31fd48;};'use strict';var emlformat=require(_0x4432('0x0'));var rimraf=require(_0x4432('0x1'));var zipdir=require(_0x4432('0x2'));var jsonpatch=require(_0x4432('0x3'));var rp=require(_0x4432('0x4'));var moment=require(_0x4432('0x5'));var BPromise=require(_0x4432('0x6'));var Mustache=require(_0x4432('0x7'));var util=require(_0x4432('0x8'));var path=require(_0x4432('0x9'));var sox=require('sox');var csv=require(_0x4432('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4432('0xb'));var _=require('lodash');var squel=require(_0x4432('0xc'));var crypto=require(_0x4432('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4432('0xa'));var querystring=require(_0x4432('0xe'));var Papa=require(_0x4432('0xf'));var Redis=require(_0x4432('0x10'));var authService=require(_0x4432('0x11'));var qs=require(_0x4432('0x12'));var as=require(_0x4432('0x13'));var hardwareService=require(_0x4432('0x14'));var logger=require(_0x4432('0x15'))('api');var utils=require(_0x4432('0x16'));var config=require(_0x4432('0x17'));var licenseUtil=require(_0x4432('0x18'));var db=require(_0x4432('0x19'))['db'];config[_0x4432('0x1a')]=_[_0x4432('0x1b')](config['redis'],{'host':_0x4432('0x1c'),'port':0x18eb});var socket=require(_0x4432('0x1d'))(new Redis(config[_0x4432('0x1a')]));require(_0x4432('0x1e'))['register'](socket);function respondWithStatusCode(_0x3ceb3e,_0x3f7a76){_0x3f7a76=_0x3f7a76||0xcc;return function(_0xb0cbe9){if(_0xb0cbe9){return _0x3ceb3e[_0x4432('0x1f')](_0x3f7a76);}return _0x3ceb3e[_0x4432('0x20')](_0x3f7a76)[_0x4432('0x21')]();};}function respondWithResult(_0x7d18fe,_0x7aac86){_0x7aac86=_0x7aac86||0xc8;return function(_0x20c011){if(_0x20c011){return _0x7d18fe[_0x4432('0x20')](_0x7aac86)[_0x4432('0x22')](_0x20c011);}};}function respondWithFilteredResult(_0x4fb53e,_0x397bd8){return function(_0x226e13){if(_0x226e13){var _0x544b34=typeof _0x397bd8['offset']==='undefined'&&typeof _0x397bd8[_0x4432('0x23')]==='undefined';var _0x32b9df=_0x226e13[_0x4432('0x24')];var _0x30bab2=_0x544b34?0x0:_0x397bd8[_0x4432('0x25')];var _0x320b00=_0x544b34?_0x226e13[_0x4432('0x24')]:_0x397bd8[_0x4432('0x25')]+_0x397bd8[_0x4432('0x23')];var _0x3e93a4;if(_0x320b00>=_0x32b9df){_0x320b00=_0x32b9df;_0x3e93a4=0xc8;}else{_0x3e93a4=0xce;}_0x4fb53e[_0x4432('0x20')](_0x3e93a4);return _0x4fb53e[_0x4432('0x26')](_0x4432('0x27'),_0x30bab2+'-'+_0x320b00+'/'+_0x32b9df)['json'](_0x226e13);}return null;};}function patchUpdates(_0x18f83c){return function(_0x351592){try{jsonpatch[_0x4432('0x28')](_0x351592,_0x18f83c,!![]);}catch(_0x1fd61f){return BPromise[_0x4432('0x29')](_0x1fd61f);}return _0x351592[_0x4432('0x2a')]();};}function saveUpdates(_0x44408e,_0x4c4cbf){return function(_0x3271c1){if(_0x3271c1){return _0x3271c1['update'](_0x44408e)[_0x4432('0x2b')](function(_0x4ec975){return _0x4ec975;});}return null;};}function removeEntity(_0x467c9d,_0x42e649){return function(_0x214b52){if(_0x214b52){return _0x214b52['destroy']()['then'](function(){_0x467c9d['status'](0xcc)[_0x4432('0x21')]();});}};}function handleEntityNotFound(_0x474248,_0x29c117){return function(_0x2be347){if(!_0x2be347){_0x474248[_0x4432('0x1f')](0x194);}return _0x2be347;};}function handleError(_0xea663e,_0x41cf48){_0x41cf48=_0x41cf48||0x1f4;return function(_0x40c57d){logger['error'](_0x40c57d[_0x4432('0x2c')]);if(_0x40c57d[_0x4432('0x2d')]){delete _0x40c57d['name'];}_0xea663e[_0x4432('0x20')](_0x41cf48)[_0x4432('0x2e')](_0x40c57d);};}exports[_0x4432('0x2f')]=function(_0xe48d32,_0x1e4d70){var _0x29524f={},_0x2ce81a={},_0x421285={'count':0x0,'rows':[]};var _0x18a6c9=_['map'](db[_0x4432('0x30')][_0x4432('0x31')],function(_0x200ade){return{'name':_0x200ade[_0x4432('0x32')],'type':_0x200ade['type'][_0x4432('0x33')]};});_0x2ce81a[_0x4432('0x34')]=_[_0x4432('0x35')](_0x18a6c9,_0x4432('0x2d'));_0x2ce81a['query']=_[_0x4432('0x36')](_0xe48d32[_0x4432('0x37')]);_0x2ce81a[_0x4432('0x38')]=_[_0x4432('0x39')](_0x2ce81a[_0x4432('0x34')],_0x2ce81a[_0x4432('0x37')]);_0x29524f['attributes']=_[_0x4432('0x39')](_0x2ce81a[_0x4432('0x34')],qs[_0x4432('0x3a')](_0xe48d32[_0x4432('0x37')][_0x4432('0x3a')]));_0x29524f[_0x4432('0x3b')]=_0x29524f[_0x4432('0x3b')]['length']?_0x29524f['attributes']:_0x2ce81a['model'];if(!_0xe48d32[_0x4432('0x37')]['hasOwnProperty'](_0x4432('0x3c'))){_0x29524f[_0x4432('0x23')]=qs[_0x4432('0x23')](_0xe48d32[_0x4432('0x37')][_0x4432('0x23')]);_0x29524f['offset']=qs[_0x4432('0x25')](_0xe48d32[_0x4432('0x37')][_0x4432('0x25')]);}_0x29524f[_0x4432('0x3d')]=qs[_0x4432('0x3e')](_0xe48d32[_0x4432('0x37')][_0x4432('0x3e')]);_0x29524f[_0x4432('0x3f')]=qs['filters'](_[_0x4432('0x40')](_0xe48d32['query'],_0x2ce81a['filters']),_0x18a6c9);if(_0xe48d32[_0x4432('0x37')]['filter']){_0x29524f[_0x4432('0x3f')]=_[_0x4432('0x41')](_0x29524f[_0x4432('0x3f')],{'$or':_[_0x4432('0x35')](_0x18a6c9,function(_0x1db267){if(_0x1db267['type']!==_0x4432('0x42')){var _0xc862af={};_0xc862af[_0x1db267[_0x4432('0x2d')]]={'$like':'%'+_0xe48d32['query'][_0x4432('0x43')]+'%'};return _0xc862af;}})});}_0x29524f=_[_0x4432('0x41')]({},_0x29524f,_0xe48d32[_0x4432('0x44')]);var _0x7a085f={'where':_0x29524f[_0x4432('0x3f')]};return db[_0x4432('0x30')][_0x4432('0x24')](_0x7a085f)[_0x4432('0x2b')](function(_0x1f0f03){_0x421285[_0x4432('0x24')]=_0x1f0f03;if(_0xe48d32[_0x4432('0x37')][_0x4432('0x45')]){_0x29524f[_0x4432('0x46')]=[{'all':!![]}];}return db[_0x4432('0x30')][_0x4432('0x47')](_0x29524f);})[_0x4432('0x2b')](function(_0x300472){_0x421285[_0x4432('0x48')]=_0x300472;return _0x421285;})[_0x4432('0x2b')](respondWithFilteredResult(_0x1e4d70,_0x29524f))[_0x4432('0x49')](handleError(_0x1e4d70,null));};exports[_0x4432('0x4a')]=function(_0x2beef0,_0x276ad4){var _0xbd1ea9={'raw':!![],'where':{'id':_0x2beef0[_0x4432('0x4b')]['id']}},_0x18a1d8={};_0x18a1d8[_0x4432('0x34')]=_[_0x4432('0x36')](db[_0x4432('0x30')][_0x4432('0x31')]);_0x18a1d8[_0x4432('0x37')]=_['keys'](_0x2beef0[_0x4432('0x37')]);_0x18a1d8[_0x4432('0x38')]=_[_0x4432('0x39')](_0x18a1d8[_0x4432('0x34')],_0x18a1d8[_0x4432('0x37')]);_0xbd1ea9[_0x4432('0x3b')]=_[_0x4432('0x39')](_0x18a1d8[_0x4432('0x34')],qs[_0x4432('0x3a')](_0x2beef0[_0x4432('0x37')][_0x4432('0x3a')]));_0xbd1ea9[_0x4432('0x3b')]=_0xbd1ea9['attributes'][_0x4432('0x4c')]?_0xbd1ea9[_0x4432('0x3b')]:_0x18a1d8['model'];if(_0x2beef0[_0x4432('0x37')][_0x4432('0x45')]){_0xbd1ea9['include']=[{'all':!![]}];}_0xbd1ea9=_[_0x4432('0x41')]({},_0xbd1ea9,_0x2beef0['options']);return db[_0x4432('0x30')][_0x4432('0x4d')](_0xbd1ea9)['then'](handleEntityNotFound(_0x276ad4,null))[_0x4432('0x2b')](respondWithResult(_0x276ad4,null))[_0x4432('0x49')](handleError(_0x276ad4,null));};exports[_0x4432('0x4e')]=function(_0x1c0f4d,_0xbf535b){return db[_0x4432('0x30')][_0x4432('0x4e')](_0x1c0f4d[_0x4432('0x4f')],{})['then'](respondWithResult(_0xbf535b,0xc9))[_0x4432('0x49')](handleError(_0xbf535b,null));};exports['update']=function(_0x14c871,_0x41bf10){if(_0x14c871['body']['id']){delete _0x14c871[_0x4432('0x4f')]['id'];}return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0x14c871[_0x4432('0x4b')]['id']}})['then'](handleEntityNotFound(_0x41bf10,null))['then'](saveUpdates(_0x14c871[_0x4432('0x4f')],null))[_0x4432('0x2b')](respondWithResult(_0x41bf10,null))[_0x4432('0x49')](handleError(_0x41bf10,null));};exports[_0x4432('0x50')]=function(_0x4eaac3,_0x3853a2){return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0x4eaac3[_0x4432('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3853a2,null))['then'](removeEntity(_0x3853a2,null))['catch'](handleError(_0x3853a2,null));};exports['describe']=function(_0x5a03eb,_0x3cdc2b){return db[_0x4432('0x30')][_0x4432('0x51')]()[_0x4432('0x2b')](respondWithResult(_0x3cdc2b,null))[_0x4432('0x49')](handleError(_0x3cdc2b,null));};exports[_0x4432('0x52')]=function(_0x562d40,_0x6e2b9e,_0x1e35db){return db[_0x4432('0x53')][_0x4432('0x24')]({'where':{'ChatGroupId':_0x562d40[_0x4432('0x4b')]['id'],'ToId':_0x562d40[_0x4432('0x54')]['id'],'read':![]}})['then'](function(_0x58bc63){return{'id':_[_0x4432('0x55')](_0x562d40[_0x4432('0x4b')]['id']),'count':_0x58bc63};})[_0x4432('0x2b')](respondWithResult(_0x6e2b9e,null))[_0x4432('0x49')](handleError(_0x6e2b9e,null));};exports['addMembers']=function(_0x3457cb,_0x200ef7,_0x8f92f0){return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0x3457cb[_0x4432('0x4b')]['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x200ef7,null))[_0x4432('0x2b')](function(_0x31ce71){if(_0x31ce71){return _0x31ce71['addMembers'](_0x3457cb[_0x4432('0x4f')]['ids'],_['omit'](_0x3457cb[_0x4432('0x4f')],[_0x4432('0x56'),'id'])||{});}})['then'](respondWithResult(_0x200ef7,null))['catch'](handleError(_0x200ef7,null));};exports[_0x4432('0x57')]=function(_0xaaf6ea,_0x5d7a44,_0x486e83){var _0x4dc276={};var _0x19dc76={};var _0x153f7f;var _0x517d8e;return db[_0x4432('0x30')][_0x4432('0x58')]({'where':{'id':_0xaaf6ea['params']['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x5d7a44,null))['then'](function(_0x380e0d){if(_0x380e0d){_0x153f7f=_0x380e0d;_0x19dc76['model']=_[_0x4432('0x36')](db[_0x4432('0x59')]['rawAttributes']);_0x19dc76[_0x4432('0x37')]=_[_0x4432('0x36')](_0xaaf6ea['query']);_0x19dc76[_0x4432('0x38')]=_[_0x4432('0x39')](_0x19dc76[_0x4432('0x34')],_0x19dc76[_0x4432('0x37')]);_0x4dc276[_0x4432('0x3b')]=_[_0x4432('0x39')](_0x19dc76[_0x4432('0x34')],qs[_0x4432('0x3a')](_0xaaf6ea[_0x4432('0x37')]['fields']));_0x4dc276[_0x4432('0x3b')]=_0x4dc276[_0x4432('0x3b')]['length']?_0x4dc276[_0x4432('0x3b')]:_0x19dc76[_0x4432('0x34')];_0x4dc276[_0x4432('0x3d')]=qs[_0x4432('0x3e')](_0xaaf6ea[_0x4432('0x37')]['sort']);_0x4dc276[_0x4432('0x3f')]=qs[_0x4432('0x38')](_[_0x4432('0x40')](_0xaaf6ea['query'],_0x19dc76[_0x4432('0x38')]));if(_0xaaf6ea['query'][_0x4432('0x43')]){_0x4dc276[_0x4432('0x3f')]=_[_0x4432('0x41')](_0x4dc276[_0x4432('0x3f')],{'$or':_[_0x4432('0x35')](_0x4dc276[_0x4432('0x3b')],function(_0x18a44b){var _0x28e1d8={};_0x28e1d8[_0x18a44b]={'$like':'%'+_0xaaf6ea['query']['filter']+'%'};return _0x28e1d8;})});}_0x4dc276=_[_0x4432('0x41')]({},_0x4dc276,_0xaaf6ea[_0x4432('0x44')]);return _0x153f7f['getMembers'](_0x4dc276);}})[_0x4432('0x2b')](function(_0x37e4cb){if(_0x37e4cb){_0x517d8e=_0x37e4cb['length'];if(!_0xaaf6ea[_0x4432('0x37')][_0x4432('0x5a')](_0x4432('0x3c'))){_0x4dc276[_0x4432('0x23')]=qs[_0x4432('0x23')](_0xaaf6ea[_0x4432('0x37')][_0x4432('0x23')]);_0x4dc276[_0x4432('0x25')]=qs[_0x4432('0x25')](_0xaaf6ea[_0x4432('0x37')][_0x4432('0x25')]);}return _0x153f7f[_0x4432('0x57')](_0x4dc276);}})[_0x4432('0x2b')](function(_0x362a78){if(_0x362a78){return _0x362a78?{'count':_0x517d8e,'rows':_0x362a78}:null;}})[_0x4432('0x2b')](respondWithResult(_0x5d7a44,null))[_0x4432('0x49')](handleError(_0x5d7a44,null));};exports[_0x4432('0x5b')]=function(_0xd92065,_0x87e160,_0x3ac8af){return db[_0x4432('0x30')][_0x4432('0x4d')]({'where':{'id':_0xd92065[_0x4432('0x4b')]['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x87e160,null))[_0x4432('0x2b')](function(_0x25cb67){if(_0x25cb67){return _0x25cb67['removeMembers'](_0xd92065[_0x4432('0x37')][_0x4432('0x56')]);}})['then'](respondWithStatusCode(_0x87e160,null))[_0x4432('0x49')](handleError(_0x87e160,null));};exports['addMessage']=function(_0x6cfd3d,_0x1a8bf9,_0x55d223){if(_0x6cfd3d[_0x4432('0x4f')]['id']){delete _0x6cfd3d[_0x4432('0x4f')]['id'];}return db['ChatGroup'][_0x4432('0x4d')]({'where':{'id':_0x6cfd3d['params']['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0x1a8bf9,null))[_0x4432('0x2b')](function(_0x3a3105){if(_0x3a3105){_0x6cfd3d['body'][_0x4432('0x5c')]=_0x3a3105['id'];return db[_0x4432('0x53')][_0x4432('0x4e')](_0x6cfd3d[_0x4432('0x4f')]);}})[_0x4432('0x2b')](respondWithResult(_0x1a8bf9,null))[_0x4432('0x49')](handleError(_0x1a8bf9,null));};exports[_0x4432('0x5d')]=function(_0x17b08b,_0xc7497a,_0x5df26d){var _0x315c69={};var _0x3a4599={};var _0x25af9e;var _0x1e6651;return db[_0x4432('0x30')]['findOne']({'where':{'id':_0x17b08b[_0x4432('0x4b')]['id']}})[_0x4432('0x2b')](handleEntityNotFound(_0xc7497a,null))['then'](function(_0x1a5402){if(_0x1a5402){_0x25af9e=_0x1a5402;_0x3a4599[_0x4432('0x34')]=_[_0x4432('0x36')](db[_0x4432('0x53')][_0x4432('0x31')]);_0x3a4599[_0x4432('0x37')]=_['keys'](_0x17b08b['query']);_0x3a4599[_0x4432('0x38')]=_['intersection'](_0x3a4599['model'],_0x3a4599['query']);_0x315c69['attributes']=_[_0x4432('0x39')](_0x3a4599[_0x4432('0x34')],qs[_0x4432('0x3a')](_0x17b08b['query'][_0x4432('0x3a')]));_0x315c69['attributes']=_0x315c69['attributes'][_0x4432('0x4c')]?_0x315c69[_0x4432('0x3b')]:_0x3a4599[_0x4432('0x34')];_0x315c69[_0x4432('0x3d')]=qs[_0x4432('0x3e')](_0x17b08b[_0x4432('0x37')][_0x4432('0x3e')]);_0x315c69[_0x4432('0x3f')]=qs[_0x4432('0x38')](_[_0x4432('0x40')](_0x17b08b[_0x4432('0x37')],_0x3a4599[_0x4432('0x38')]));if(_0x17b08b[_0x4432('0x37')]['filter']){_0x315c69['where']=_['merge'](_0x315c69[_0x4432('0x3f')],{'$or':_[_0x4432('0x35')](_0x315c69['attributes'],function(_0x308eaf){var _0xd1d37={};_0xd1d37[_0x308eaf]={'$like':'%'+_0x17b08b[_0x4432('0x37')][_0x4432('0x43')]+'%'};return _0xd1d37;})});}if(_0x17b08b[_0x4432('0x37')][_0x4432('0x5e')]){var _0x3fd186=_0x17b08b[_0x4432('0x37')][_0x4432('0x5e')][_0x4432('0x5f')](',');var _0x351540={};_0x351540[_0x3fd186[0x0]]={'$gte':moment(_0x3fd186[0x1])[_0x4432('0x60')](_0x4432('0x61'))};_0x315c69[_0x4432('0x3f')]=_[_0x4432('0x41')](_0x315c69[_0x4432('0x3f')],_0x351540);}_0x315c69=_['merge']({},_0x315c69,_0x17b08b[_0x4432('0x44')]);return _0x25af9e[_0x4432('0x5d')](_0x315c69);}})['then'](function(_0x10022b){if(_0x10022b){_0x1e6651=_0x10022b[_0x4432('0x4c')];if(!_0x17b08b[_0x4432('0x37')][_0x4432('0x5a')](_0x4432('0x3c'))){_0x315c69['limit']=qs[_0x4432('0x23')](_0x17b08b[_0x4432('0x37')][_0x4432('0x23')]);_0x315c69[_0x4432('0x25')]=qs[_0x4432('0x25')](_0x17b08b[_0x4432('0x37')][_0x4432('0x25')]);}return _0x25af9e['getMessages'](_0x315c69);}})[_0x4432('0x2b')](function(_0x5604f1){if(_0x5604f1){return _0x5604f1?{'count':_0x1e6651,'rows':_0x5604f1}:null;}})[_0x4432('0x2b')](respondWithResult(_0xc7497a,null))[_0x4432('0x49')](handleError(_0xc7497a,null));}; \ No newline at end of file +var _0x5b6c=['length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','rawAttributes','find','create','body','update','params','describe','getUnread','toInteger','addMembers','omit','ids','getMembers','findOne','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','format','getMessages','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','localhost','socket.io-emitter','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','ChatGroup','fieldName','type','key','model','query','filters','intersection','fields','attributes'];(function(_0x2e9e80,_0x34cf78){var _0x13ccc4=function(_0x3222a5){while(--_0x3222a5){_0x2e9e80['push'](_0x2e9e80['shift']());}};_0x13ccc4(++_0x34cf78);}(_0x5b6c,0x1a6));var _0xc5b6=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x5b6c[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0xc5b6('0x0'));var rimraf=require(_0xc5b6('0x1'));var zipdir=require(_0xc5b6('0x2'));var jsonpatch=require(_0xc5b6('0x3'));var rp=require('request-promise');var moment=require(_0xc5b6('0x4'));var BPromise=require(_0xc5b6('0x5'));var Mustache=require(_0xc5b6('0x6'));var util=require(_0xc5b6('0x7'));var path=require(_0xc5b6('0x8'));var sox=require(_0xc5b6('0x9'));var csv=require(_0xc5b6('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5b6('0xb'));var _=require('lodash');var squel=require(_0xc5b6('0xc'));var crypto=require(_0xc5b6('0xd'));var jsforce=require(_0xc5b6('0xe'));var deskjs=require(_0xc5b6('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc5b6('0x10'));var Redis=require(_0xc5b6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc5b6('0x12'));var hardwareService=require(_0xc5b6('0x13'));var logger=require(_0xc5b6('0x14'))(_0xc5b6('0x15'));var utils=require(_0xc5b6('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xc5b6('0x17'));var db=require('../../mysqldb')['db'];config[_0xc5b6('0x18')]=_['defaults'](config[_0xc5b6('0x18')],{'host':_0xc5b6('0x19'),'port':0x18eb});var socket=require(_0xc5b6('0x1a'))(new Redis(config[_0xc5b6('0x18')]));require('./chatGroup.socket')[_0xc5b6('0x1b')](socket);function respondWithStatusCode(_0x5c1164,_0x26b013){_0x26b013=_0x26b013||0xcc;return function(_0x42b2ef){if(_0x42b2ef){return _0x5c1164['sendStatus'](_0x26b013);}return _0x5c1164[_0xc5b6('0x1c')](_0x26b013)[_0xc5b6('0x1d')]();};}function respondWithResult(_0xe70f97,_0x4b8066){_0x4b8066=_0x4b8066||0xc8;return function(_0x5793d1){if(_0x5793d1){return _0xe70f97[_0xc5b6('0x1c')](_0x4b8066)['json'](_0x5793d1);}};}function respondWithFilteredResult(_0x3058fe,_0x4382e2){return function(_0x536f25){if(_0x536f25){var _0x116474=typeof _0x4382e2[_0xc5b6('0x1e')]===_0xc5b6('0x1f')&&typeof _0x4382e2[_0xc5b6('0x20')]==='undefined';var _0x45e86a=_0x536f25[_0xc5b6('0x21')];var _0x3a1e8b=_0x116474?0x0:_0x4382e2[_0xc5b6('0x1e')];var _0x5db647=_0x116474?_0x536f25[_0xc5b6('0x21')]:_0x4382e2['offset']+_0x4382e2['limit'];var _0x58445f;if(_0x5db647>=_0x45e86a){_0x5db647=_0x45e86a;_0x58445f=0xc8;}else{_0x58445f=0xce;}_0x3058fe['status'](_0x58445f);return _0x3058fe[_0xc5b6('0x22')](_0xc5b6('0x23'),_0x3a1e8b+'-'+_0x5db647+'/'+_0x45e86a)[_0xc5b6('0x24')](_0x536f25);}return null;};}function patchUpdates(_0x32f178){return function(_0x1fae0f){try{jsonpatch[_0xc5b6('0x25')](_0x1fae0f,_0x32f178,!![]);}catch(_0x181fd3){return BPromise[_0xc5b6('0x26')](_0x181fd3);}return _0x1fae0f[_0xc5b6('0x27')]();};}function saveUpdates(_0xfa2254,_0x567064){return function(_0x2194ef){if(_0x2194ef){return _0x2194ef['update'](_0xfa2254)[_0xc5b6('0x28')](function(_0x11a823){return _0x11a823;});}return null;};}function removeEntity(_0x377a92,_0x4bc731){return function(_0x3f4f0f){if(_0x3f4f0f){return _0x3f4f0f[_0xc5b6('0x29')]()['then'](function(){_0x377a92['status'](0xcc)[_0xc5b6('0x1d')]();});}};}function handleEntityNotFound(_0x503fc1,_0x3ec673){return function(_0x2ad1a7){if(!_0x2ad1a7){_0x503fc1[_0xc5b6('0x2a')](0x194);}return _0x2ad1a7;};}function handleError(_0x5cc3ce,_0x5edb79){_0x5edb79=_0x5edb79||0x1f4;return function(_0x3385b1){logger['error'](_0x3385b1[_0xc5b6('0x2b')]);if(_0x3385b1[_0xc5b6('0x2c')]){delete _0x3385b1['name'];}_0x5cc3ce[_0xc5b6('0x1c')](_0x5edb79)[_0xc5b6('0x2d')](_0x3385b1);};}exports[_0xc5b6('0x2e')]=function(_0x44f038,_0x5a0679){var _0x129721={},_0x20ebe5={},_0x21d1c7={'count':0x0,'rows':[]};var _0x177508=_[_0xc5b6('0x2f')](db[_0xc5b6('0x30')]['rawAttributes'],function(_0x31ec03){return{'name':_0x31ec03[_0xc5b6('0x31')],'type':_0x31ec03[_0xc5b6('0x32')][_0xc5b6('0x33')]};});_0x20ebe5[_0xc5b6('0x34')]=_[_0xc5b6('0x2f')](_0x177508,_0xc5b6('0x2c'));_0x20ebe5[_0xc5b6('0x35')]=_['keys'](_0x44f038[_0xc5b6('0x35')]);_0x20ebe5[_0xc5b6('0x36')]=_[_0xc5b6('0x37')](_0x20ebe5[_0xc5b6('0x34')],_0x20ebe5[_0xc5b6('0x35')]);_0x129721['attributes']=_['intersection'](_0x20ebe5[_0xc5b6('0x34')],qs['fields'](_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x38')]));_0x129721[_0xc5b6('0x39')]=_0x129721[_0xc5b6('0x39')][_0xc5b6('0x3a')]?_0x129721[_0xc5b6('0x39')]:_0x20ebe5[_0xc5b6('0x34')];if(!_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x3b')]('nolimit')){_0x129721[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x20')]);_0x129721[_0xc5b6('0x1e')]=qs[_0xc5b6('0x1e')](_0x44f038[_0xc5b6('0x35')]['offset']);}_0x129721[_0xc5b6('0x3c')]=qs[_0xc5b6('0x3d')](_0x44f038[_0xc5b6('0x35')]['sort']);_0x129721[_0xc5b6('0x3e')]=qs['filters'](_[_0xc5b6('0x3f')](_0x44f038[_0xc5b6('0x35')],_0x20ebe5[_0xc5b6('0x36')]),_0x177508);if(_0x44f038['query']['filter']){_0x129721[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x129721[_0xc5b6('0x3e')],{'$or':_[_0xc5b6('0x2f')](_0x177508,function(_0x3e11fe){if(_0x3e11fe[_0xc5b6('0x32')]!==_0xc5b6('0x41')){var _0x1cafa4={};_0x1cafa4[_0x3e11fe[_0xc5b6('0x2c')]]={'$like':'%'+_0x44f038[_0xc5b6('0x35')][_0xc5b6('0x42')]+'%'};return _0x1cafa4;}})});}_0x129721=_[_0xc5b6('0x40')]({},_0x129721,_0x44f038[_0xc5b6('0x43')]);var _0x33f7f1={'where':_0x129721[_0xc5b6('0x3e')]};return db['ChatGroup'][_0xc5b6('0x21')](_0x33f7f1)[_0xc5b6('0x28')](function(_0x3a26cf){_0x21d1c7[_0xc5b6('0x21')]=_0x3a26cf;if(_0x44f038['query'][_0xc5b6('0x44')]){_0x129721[_0xc5b6('0x45')]=[{'all':!![]}];}return db['ChatGroup'][_0xc5b6('0x46')](_0x129721);})[_0xc5b6('0x28')](function(_0x1bd72f){_0x21d1c7[_0xc5b6('0x47')]=_0x1bd72f;return _0x21d1c7;})[_0xc5b6('0x28')](respondWithFilteredResult(_0x5a0679,_0x129721))[_0xc5b6('0x48')](handleError(_0x5a0679,null));};exports['show']=function(_0x3970ed,_0xfb4883){var _0x55e1ce={'raw':!![],'where':{'id':_0x3970ed['params']['id']}},_0x2c7381={};_0x2c7381[_0xc5b6('0x34')]=_[_0xc5b6('0x49')](db[_0xc5b6('0x30')][_0xc5b6('0x4a')]);_0x2c7381['query']=_[_0xc5b6('0x49')](_0x3970ed[_0xc5b6('0x35')]);_0x2c7381[_0xc5b6('0x36')]=_[_0xc5b6('0x37')](_0x2c7381[_0xc5b6('0x34')],_0x2c7381[_0xc5b6('0x35')]);_0x55e1ce[_0xc5b6('0x39')]=_[_0xc5b6('0x37')](_0x2c7381[_0xc5b6('0x34')],qs[_0xc5b6('0x38')](_0x3970ed[_0xc5b6('0x35')]['fields']));_0x55e1ce[_0xc5b6('0x39')]=_0x55e1ce[_0xc5b6('0x39')]['length']?_0x55e1ce[_0xc5b6('0x39')]:_0x2c7381[_0xc5b6('0x34')];if(_0x3970ed[_0xc5b6('0x35')]['includeAll']){_0x55e1ce[_0xc5b6('0x45')]=[{'all':!![]}];}_0x55e1ce=_[_0xc5b6('0x40')]({},_0x55e1ce,_0x3970ed[_0xc5b6('0x43')]);return db[_0xc5b6('0x30')][_0xc5b6('0x4b')](_0x55e1ce)[_0xc5b6('0x28')](handleEntityNotFound(_0xfb4883,null))[_0xc5b6('0x28')](respondWithResult(_0xfb4883,null))[_0xc5b6('0x48')](handleError(_0xfb4883,null));};exports['create']=function(_0x4e8714,_0x4b326f){return db['ChatGroup'][_0xc5b6('0x4c')](_0x4e8714[_0xc5b6('0x4d')],{})['then'](respondWithResult(_0x4b326f,0xc9))[_0xc5b6('0x48')](handleError(_0x4b326f,null));};exports[_0xc5b6('0x4e')]=function(_0x504487,_0x21e2a1){if(_0x504487['body']['id']){delete _0x504487[_0xc5b6('0x4d')]['id'];}return db[_0xc5b6('0x30')][_0xc5b6('0x4b')]({'where':{'id':_0x504487[_0xc5b6('0x4f')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x21e2a1,null))[_0xc5b6('0x28')](saveUpdates(_0x504487[_0xc5b6('0x4d')],null))[_0xc5b6('0x28')](respondWithResult(_0x21e2a1,null))[_0xc5b6('0x48')](handleError(_0x21e2a1,null));};exports['destroy']=function(_0x64116f,_0x390267){return db['ChatGroup'][_0xc5b6('0x4b')]({'where':{'id':_0x64116f[_0xc5b6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x390267,null))[_0xc5b6('0x28')](removeEntity(_0x390267,null))[_0xc5b6('0x48')](handleError(_0x390267,null));};exports[_0xc5b6('0x50')]=function(_0x52e160,_0x326fab){return db[_0xc5b6('0x30')]['describe']()[_0xc5b6('0x28')](respondWithResult(_0x326fab,null))[_0xc5b6('0x48')](handleError(_0x326fab,null));};exports[_0xc5b6('0x51')]=function(_0x490730,_0xbcb902,_0x50f95b){return db['ChatInternalMessage'][_0xc5b6('0x21')]({'where':{'ChatGroupId':_0x490730[_0xc5b6('0x4f')]['id'],'ToId':_0x490730['user']['id'],'read':![]}})['then'](function(_0x13ac11){return{'id':_[_0xc5b6('0x52')](_0x490730[_0xc5b6('0x4f')]['id']),'count':_0x13ac11};})[_0xc5b6('0x28')](respondWithResult(_0xbcb902,null))[_0xc5b6('0x48')](handleError(_0xbcb902,null));};exports[_0xc5b6('0x53')]=function(_0x841779,_0x57260e,_0x436582){return db[_0xc5b6('0x30')][_0xc5b6('0x4b')]({'where':{'id':_0x841779[_0xc5b6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x57260e,null))['then'](function(_0x35d575){if(_0x35d575){return _0x35d575[_0xc5b6('0x53')](_0x841779['body']['ids'],_[_0xc5b6('0x54')](_0x841779['body'],[_0xc5b6('0x55'),'id'])||{});}})[_0xc5b6('0x28')](respondWithResult(_0x57260e,null))[_0xc5b6('0x48')](handleError(_0x57260e,null));};exports[_0xc5b6('0x56')]=function(_0x5e3e78,_0x53a593,_0x4a7f72){var _0x4e42c0={};var _0x410291={};var _0x1589de;var _0x157942;return db[_0xc5b6('0x30')][_0xc5b6('0x57')]({'where':{'id':_0x5e3e78[_0xc5b6('0x4f')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x53a593,null))[_0xc5b6('0x28')](function(_0x5e064f){if(_0x5e064f){_0x1589de=_0x5e064f;_0x410291[_0xc5b6('0x34')]=_[_0xc5b6('0x49')](db['User'][_0xc5b6('0x4a')]);_0x410291['query']=_[_0xc5b6('0x49')](_0x5e3e78[_0xc5b6('0x35')]);_0x410291['filters']=_[_0xc5b6('0x37')](_0x410291['model'],_0x410291[_0xc5b6('0x35')]);_0x4e42c0[_0xc5b6('0x39')]=_[_0xc5b6('0x37')](_0x410291['model'],qs['fields'](_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x38')]));_0x4e42c0[_0xc5b6('0x39')]=_0x4e42c0[_0xc5b6('0x39')]['length']?_0x4e42c0[_0xc5b6('0x39')]:_0x410291[_0xc5b6('0x34')];_0x4e42c0[_0xc5b6('0x3c')]=qs[_0xc5b6('0x3d')](_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x3d')]);_0x4e42c0['where']=qs['filters'](_['pick'](_0x5e3e78[_0xc5b6('0x35')],_0x410291['filters']));if(_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x42')]){_0x4e42c0[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x4e42c0[_0xc5b6('0x3e')],{'$or':_[_0xc5b6('0x2f')](_0x4e42c0[_0xc5b6('0x39')],function(_0x82c86d){var _0x338fdd={};_0x338fdd[_0x82c86d]={'$like':'%'+_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x42')]+'%'};return _0x338fdd;})});}_0x4e42c0=_['merge']({},_0x4e42c0,_0x5e3e78[_0xc5b6('0x43')]);return _0x1589de['getMembers'](_0x4e42c0);}})[_0xc5b6('0x28')](function(_0x5e34c8){if(_0x5e34c8){_0x157942=_0x5e34c8[_0xc5b6('0x3a')];if(!_0x5e3e78[_0xc5b6('0x35')][_0xc5b6('0x3b')](_0xc5b6('0x58'))){_0x4e42c0[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x5e3e78['query']['limit']);_0x4e42c0[_0xc5b6('0x1e')]=qs[_0xc5b6('0x1e')](_0x5e3e78['query']['offset']);}return _0x1589de[_0xc5b6('0x56')](_0x4e42c0);}})['then'](function(_0x3daeda){if(_0x3daeda){return _0x3daeda?{'count':_0x157942,'rows':_0x3daeda}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x53a593,null))[_0xc5b6('0x48')](handleError(_0x53a593,null));};exports[_0xc5b6('0x59')]=function(_0x8e5c0f,_0x59b5c1,_0x255bd4){return db[_0xc5b6('0x30')][_0xc5b6('0x4b')]({'where':{'id':_0x8e5c0f['params']['id']}})['then'](handleEntityNotFound(_0x59b5c1,null))[_0xc5b6('0x28')](function(_0x2d1007){if(_0x2d1007){return _0x2d1007[_0xc5b6('0x59')](_0x8e5c0f[_0xc5b6('0x35')]['ids']);}})[_0xc5b6('0x28')](respondWithStatusCode(_0x59b5c1,null))[_0xc5b6('0x48')](handleError(_0x59b5c1,null));};exports[_0xc5b6('0x5a')]=function(_0x19b665,_0x5f06fc,_0x53dda4){if(_0x19b665[_0xc5b6('0x4d')]['id']){delete _0x19b665['body']['id'];}return db['ChatGroup'][_0xc5b6('0x4b')]({'where':{'id':_0x19b665[_0xc5b6('0x4f')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x5f06fc,null))[_0xc5b6('0x28')](function(_0xe6f006){if(_0xe6f006){_0x19b665[_0xc5b6('0x4d')][_0xc5b6('0x5b')]=_0xe6f006['id'];return db[_0xc5b6('0x5c')]['create'](_0x19b665[_0xc5b6('0x4d')]);}})[_0xc5b6('0x28')](respondWithResult(_0x5f06fc,null))[_0xc5b6('0x48')](handleError(_0x5f06fc,null));};exports['getMessages']=function(_0x798c3e,_0x5aa850,_0x2c48d2){var _0x57f63b={};var _0x1b9ffd={};var _0x48f1c0;var _0x257f89;return db[_0xc5b6('0x30')][_0xc5b6('0x57')]({'where':{'id':_0x798c3e['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x5aa850,null))['then'](function(_0x167a0c){if(_0x167a0c){_0x48f1c0=_0x167a0c;_0x1b9ffd['model']=_[_0xc5b6('0x49')](db[_0xc5b6('0x5c')][_0xc5b6('0x4a')]);_0x1b9ffd[_0xc5b6('0x35')]=_[_0xc5b6('0x49')](_0x798c3e['query']);_0x1b9ffd[_0xc5b6('0x36')]=_[_0xc5b6('0x37')](_0x1b9ffd[_0xc5b6('0x34')],_0x1b9ffd[_0xc5b6('0x35')]);_0x57f63b[_0xc5b6('0x39')]=_[_0xc5b6('0x37')](_0x1b9ffd[_0xc5b6('0x34')],qs[_0xc5b6('0x38')](_0x798c3e[_0xc5b6('0x35')]['fields']));_0x57f63b[_0xc5b6('0x39')]=_0x57f63b[_0xc5b6('0x39')][_0xc5b6('0x3a')]?_0x57f63b['attributes']:_0x1b9ffd[_0xc5b6('0x34')];_0x57f63b[_0xc5b6('0x3c')]=qs[_0xc5b6('0x3d')](_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x3d')]);_0x57f63b[_0xc5b6('0x3e')]=qs[_0xc5b6('0x36')](_[_0xc5b6('0x3f')](_0x798c3e['query'],_0x1b9ffd[_0xc5b6('0x36')]));if(_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x42')]){_0x57f63b[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x57f63b[_0xc5b6('0x3e')],{'$or':_[_0xc5b6('0x2f')](_0x57f63b[_0xc5b6('0x39')],function(_0x19d6dd){var _0x38c4ec={};_0x38c4ec[_0x19d6dd]={'$like':'%'+_0x798c3e['query'][_0xc5b6('0x42')]+'%'};return _0x38c4ec;})});}if(_0x798c3e['query'][_0xc5b6('0x5d')]){var _0x4d6fb6=_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x5d')]['split'](',');var _0x1ec341={};_0x1ec341[_0x4d6fb6[0x0]]={'$gte':moment(_0x4d6fb6[0x1])[_0xc5b6('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x57f63b[_0xc5b6('0x3e')]=_[_0xc5b6('0x40')](_0x57f63b[_0xc5b6('0x3e')],_0x1ec341);}_0x57f63b=_[_0xc5b6('0x40')]({},_0x57f63b,_0x798c3e[_0xc5b6('0x43')]);return _0x48f1c0[_0xc5b6('0x5f')](_0x57f63b);}})[_0xc5b6('0x28')](function(_0x37528c){if(_0x37528c){_0x257f89=_0x37528c['length'];if(!_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x3b')](_0xc5b6('0x58'))){_0x57f63b['limit']=qs['limit'](_0x798c3e[_0xc5b6('0x35')][_0xc5b6('0x20')]);_0x57f63b[_0xc5b6('0x1e')]=qs[_0xc5b6('0x1e')](_0x798c3e[_0xc5b6('0x35')]['offset']);}return _0x48f1c0['getMessages'](_0x57f63b);}})[_0xc5b6('0x28')](function(_0x124f6d){if(_0x124f6d){return _0x124f6d?{'count':_0x257f89,'rows':_0x124f6d}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x5aa850,null))[_0xc5b6('0x48')](handleError(_0x5aa850,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index f7092ef..8087cfe 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 _0x3504=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x4f8f3b,_0x43281b){var _0x4c250c=function(_0x19a7ff){while(--_0x19a7ff){_0x4f8f3b['push'](_0x4f8f3b['shift']());}};_0x4c250c(++_0x43281b);}(_0x3504,0xce));var _0x4350=function(_0x3ce2d0,_0x230d91){_0x3ce2d0=_0x3ce2d0-0x0;var _0x369790=_0x3504[_0x3ce2d0];return _0x369790;};'use strict';var EventEmitter=require(_0x4350('0x0'));var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x4350('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4350('0x2'),'afterDestroy':_0x4350('0x3')};function emitEvent(_0x568470){return function(_0x1b5485,_0x3b0f42,_0x5aa5a3){ChatGroupEvents[_0x4350('0x4')](_0x568470+':'+_0x1b5485['id'],_0x1b5485);ChatGroupEvents[_0x4350('0x4')](_0x568470,_0x1b5485);_0x5aa5a3(null);};}for(var e in events){if(events[_0x4350('0x5')](e)){var event=events[e];ChatGroup[_0x4350('0x6')](e,emitEvent(event));}}module[_0x4350('0x7')]=ChatGroupEvents; \ No newline at end of file +var _0xb422=['emit','hasOwnProperty','hook','setMaxListeners','remove'];(function(_0x17ebd1,_0x5bc2e3){var _0x3fe498=function(_0x202150){while(--_0x202150){_0x17ebd1['push'](_0x17ebd1['shift']());}};_0x3fe498(++_0x5bc2e3);}(_0xb422,0x85));var _0x2b42=function(_0x332933,_0x3f58df){_0x332933=_0x332933-0x0;var _0x34fb7b=_0xb422[_0x332933];return _0x34fb7b;};'use strict';var EventEmitter=require('events');var ChatGroup=require('../../mysqldb')['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x2b42('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2b42('0x1')};function emitEvent(_0x5a42d2){return function(_0x14330f,_0x5df2d3,_0x1b469f){ChatGroupEvents['emit'](_0x5a42d2+':'+_0x14330f['id'],_0x14330f);ChatGroupEvents[_0x2b42('0x2')](_0x5a42d2,_0x14330f);_0x1b469f(null);};}for(var e in events){if(events[_0x2b42('0x3')](e)){var event=events[e];ChatGroup[_0x2b42('0x4')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index b81a6c9..368766f 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 _0x1e7f=['moment','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','define','chat_groups','lodash','../../config/logger','api'];(function(_0x25fb18,_0x5837bc){var _0x1a2625=function(_0x2be3f2){while(--_0x2be3f2){_0x25fb18['push'](_0x25fb18['shift']());}};_0x1a2625(++_0x5837bc);}(_0x1e7f,0x173));var _0xf1e7=function(_0x2bf9ed,_0x4e2de7){_0x2bf9ed=_0x2bf9ed-0x0;var _0x508979=_0x1e7f[_0x2bf9ed];return _0x508979;};'use strict';var _=require(_0xf1e7('0x0'));var util=require('util');var logger=require(_0xf1e7('0x1'))(_0xf1e7('0x2'));var moment=require(_0xf1e7('0x3'));var BPromise=require('bluebird');var rp=require(_0xf1e7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1e7('0x5'));var config=require(_0xf1e7('0x6'));var attributes=require(_0xf1e7('0x7'));module[_0xf1e7('0x8')]=function(_0x4b3b6e,_0x18df32){return _0x4b3b6e[_0xf1e7('0x9')]('ChatGroup',attributes,{'tableName':_0xf1e7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea39=['./chatGroup.attributes','exports','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xea39,0x1a8));var _0x9ea3=function(_0x4b27dc,_0x3f7afb){_0x4b27dc=_0x4b27dc-0x0;var _0x1a37f2=_0xea39[_0x4b27dc];return _0x1a37f2;};'use strict';var _=require(_0x9ea3('0x0'));var util=require(_0x9ea3('0x1'));var logger=require(_0x9ea3('0x2'))(_0x9ea3('0x3'));var moment=require(_0x9ea3('0x4'));var BPromise=require(_0x9ea3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ea3('0x6'));var rimraf=require(_0x9ea3('0x7'));var config=require('../../config/environment');var attributes=require(_0x9ea3('0x8'));module[_0x9ea3('0x9')]=function(_0x4b7aaf,_0xf5e61a){return _0x4b7aaf[_0x9ea3('0xa')]('ChatGroup',attributes,{'tableName':_0x9ea3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index e9ea356..3d76203 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 _0x51f2=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5cdede,_0x5287a5){var _0x274b8d=function(_0x539ce8){while(--_0x539ce8){_0x5cdede['push'](_0x5cdede['shift']());}};_0x274b8d(++_0x5287a5);}(_0x51f2,0xeb));var _0x251f=function(_0x1dd28a,_0x82c27d){_0x1dd28a=_0x1dd28a-0x0;var _0x47c8bf=_0x51f2[_0x1dd28a];return _0x47c8bf;};'use strict';var _=require(_0x251f('0x0'));var util=require(_0x251f('0x1'));var moment=require(_0x251f('0x2'));var BPromise=require(_0x251f('0x3'));var rs=require(_0x251f('0x4'));var fs=require('fs');var Redis=require(_0x251f('0x5'));var db=require(_0x251f('0x6'))['db'];var utils=require(_0x251f('0x7'));var logger=require(_0x251f('0x8'))('rpc');var config=require(_0x251f('0x9'));var jayson=require(_0x251f('0xa'));var client=jayson[_0x251f('0xb')][_0x251f('0xc')]({'port':0x232a});config[_0x251f('0xd')]=_['defaults'](config[_0x251f('0xd')],{'host':_0x251f('0xe'),'port':0x18eb});var socket=require(_0x251f('0xf'))(new Redis(config[_0x251f('0xd')]));require('./chatGroup.socket')[_0x251f('0x10')](socket);function respondWithRpcPromise(_0x2ca056,_0x863651,_0x35694d){return new BPromise(function(_0x5aedae,_0x12e9f7){return client[_0x251f('0x11')](_0x2ca056,_0x35694d)[_0x251f('0x12')](function(_0x1c851f){logger['info'](_0x251f('0x13'),_0x863651,_0x251f('0x14'));logger[_0x251f('0x15')](_0x251f('0x16'),_0x863651,_0x251f('0x14'),JSON[_0x251f('0x17')](_0x1c851f));if(_0x1c851f[_0x251f('0x18')]){if(_0x1c851f[_0x251f('0x18')][_0x251f('0x19')]===0x1f4){logger[_0x251f('0x18')](_0x251f('0x13'),_0x863651,_0x1c851f['error'][_0x251f('0x1a')]);return _0x12e9f7(_0x1c851f[_0x251f('0x18')]['message']);}logger[_0x251f('0x18')](_0x251f('0x13'),_0x863651,_0x1c851f[_0x251f('0x18')][_0x251f('0x1a')]);return _0x5aedae(_0x1c851f[_0x251f('0x18')]['message']);}else{logger['info'](_0x251f('0x13'),_0x863651,_0x251f('0x14'));_0x5aedae(_0x1c851f[_0x251f('0x1b')][_0x251f('0x1a')]);}})[_0x251f('0x1c')](function(_0x49d2eb){logger[_0x251f('0x18')](_0x251f('0x13'),_0x863651,_0x49d2eb);_0x12e9f7(_0x49d2eb);});});} \ No newline at end of file +var _0x3f19=['info','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1e2f07,_0x4da21b){var _0x42d8c1=function(_0x466378){while(--_0x466378){_0x1e2f07['push'](_0x1e2f07['shift']());}};_0x42d8c1(++_0x4da21b);}(_0x3f19,0x1f1));var _0x93f1=function(_0x1d6eb4,_0x2a20d7){_0x1d6eb4=_0x1d6eb4-0x0;var _0x1277f0=_0x3f19[_0x1d6eb4];return _0x1277f0;};'use strict';var _=require('lodash');var util=require(_0x93f1('0x0'));var moment=require('moment');var BPromise=require(_0x93f1('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x93f1('0x2'));var db=require(_0x93f1('0x3'))['db'];var utils=require(_0x93f1('0x4'));var logger=require(_0x93f1('0x5'))(_0x93f1('0x6'));var config=require(_0x93f1('0x7'));var jayson=require(_0x93f1('0x8'));var client=jayson[_0x93f1('0x9')][_0x93f1('0xa')]({'port':0x232a});config[_0x93f1('0xb')]=_[_0x93f1('0xc')](config[_0x93f1('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x93f1('0xd'))(new Redis(config['redis']));require(_0x93f1('0xe'))[_0x93f1('0xf')](socket);function respondWithRpcPromise(_0x4052b4,_0x45d171,_0x30fed4){return new BPromise(function(_0x5c8cda,_0x4a6776){return client[_0x93f1('0x10')](_0x4052b4,_0x30fed4)['then'](function(_0x3eb625){logger['info'](_0x93f1('0x11'),_0x45d171,_0x93f1('0x12'));logger['debug'](_0x93f1('0x13'),_0x45d171,_0x93f1('0x12'),JSON['stringify'](_0x3eb625));if(_0x3eb625[_0x93f1('0x14')]){if(_0x3eb625[_0x93f1('0x14')][_0x93f1('0x15')]===0x1f4){logger[_0x93f1('0x14')](_0x93f1('0x11'),_0x45d171,_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);return _0x4a6776(_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x45d171,_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);return _0x5c8cda(_0x3eb625[_0x93f1('0x14')][_0x93f1('0x16')]);}else{logger[_0x93f1('0x17')]('ChatGroup,\x20%s,\x20%s',_0x45d171,_0x93f1('0x12'));_0x5c8cda(_0x3eb625[_0x93f1('0x18')][_0x93f1('0x16')]);}})[_0x93f1('0x19')](function(_0x31f4d9){logger[_0x93f1('0x14')](_0x93f1('0x11'),_0x45d171,_0x31f4d9);_0x4a6776(_0x31f4d9);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 148961a..63bfc51 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 _0x3979=['remove','emit','save'];(function(_0x1e3d1f,_0x2e6703){var _0xa955a7=function(_0x4c6b13){while(--_0x4c6b13){_0x1e3d1f['push'](_0x1e3d1f['shift']());}};_0xa955a7(++_0x2e6703);}(_0x3979,0xe6));var _0x9397=function(_0x29d170,_0x35bf92){_0x29d170=_0x29d170-0x0;var _0x5b0ada=_0x3979[_0x29d170];return _0x5b0ada;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x9397('0x0'),_0x9397('0x1'),'update'];function createListener(_0x36cf38,_0xd81e42){return function(_0x46030e){_0xd81e42[_0x9397('0x2')](_0x36cf38,_0x46030e);};}function removeListener(_0x12be69,_0x57d172){return function(){ChatGroupEvents['removeListener'](_0x12be69,_0x57d172);};}exports['register']=function(_0x2d61bf){for(var _0x4c4230=0x0,_0xd5cd4c=events['length'];_0x4c4230<_0xd5cd4c;_0x4c4230++){var _0x5da763=events[_0x4c4230];var _0x1bb436=createListener('chatGroup:'+_0x5da763,_0x2d61bf);ChatGroupEvents['on'](_0x5da763,_0x1bb436);}}; \ No newline at end of file +var _0xc5f3=['save','update','emit','removeListener','length','chatGroup:'];(function(_0x15443e,_0x5d70c1){var _0x4b93d7=function(_0x15586b){while(--_0x15586b){_0x15443e['push'](_0x15443e['shift']());}};_0x4b93d7(++_0x5d70c1);}(_0xc5f3,0x162));var _0x3c5f=function(_0x4ba811,_0x4428f2){_0x4ba811=_0x4ba811-0x0;var _0x3b616f=_0xc5f3[_0x4ba811];return _0x3b616f;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x3c5f('0x0'),'remove',_0x3c5f('0x1')];function createListener(_0x56b973,_0x487b0e){return function(_0x2956d9){_0x487b0e[_0x3c5f('0x2')](_0x56b973,_0x2956d9);};}function removeListener(_0x3dac93,_0x273b6e){return function(){ChatGroupEvents[_0x3c5f('0x3')](_0x3dac93,_0x273b6e);};}exports['register']=function(_0x5334b9){for(var _0x3a2a57=0x0,_0x27548c=events[_0x3c5f('0x4')];_0x3a2a57<_0x27548c;_0x3a2a57++){var _0x53181e=events[_0x3a2a57];var _0x11dfa7=createListener(_0x3c5f('0x5')+_0x53181e,_0x5334b9);ChatGroupEvents['on'](_0x53181e,_0x11dfa7);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 54bd127..940fb75 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 _0x758d=['getMessages','create','post','addMembers','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','getUnread','/:id/members','/:id/messages'];(function(_0x3ed984,_0x465732){var _0x2ef7a9=function(_0x562086){while(--_0x562086){_0x3ed984['push'](_0x3ed984['shift']());}};_0x2ef7a9(++_0x465732);}(_0x758d,0x103));var _0xd758=function(_0x18ea27,_0x1eae6a){_0x18ea27=_0x18ea27-0x0;var _0x44cb1e=_0x758d[_0x18ea27];return _0x44cb1e;};'use strict';var multer=require(_0xd758('0x0'));var util=require(_0xd758('0x1'));var path=require(_0xd758('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd758('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd758('0x4'));var interaction=require(_0xd758('0x5'));var config=require(_0xd758('0x6'));var controller=require('./chatGroup.controller');router[_0xd758('0x7')]('/',auth[_0xd758('0x8')](),controller[_0xd758('0x9')]);router[_0xd758('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xd758('0xa')]);router['get'](_0xd758('0xb'),auth[_0xd758('0x8')](),controller[_0xd758('0xc')]);router[_0xd758('0x7')]('/:id/unread',auth[_0xd758('0x8')](),controller[_0xd758('0xd')]);router[_0xd758('0x7')](_0xd758('0xe'),auth[_0xd758('0x8')](),controller['getMembers']);router[_0xd758('0x7')](_0xd758('0xf'),auth[_0xd758('0x8')](),controller[_0xd758('0x10')]);router['post']('/',auth[_0xd758('0x8')](),controller[_0xd758('0x11')]);router[_0xd758('0x12')](_0xd758('0xe'),auth['isAuthenticated'](),controller[_0xd758('0x13')]);router[_0xd758('0x12')](_0xd758('0xf'),auth[_0xd758('0x8')](),controller['addMessage']);router[_0xd758('0x14')](_0xd758('0xb'),auth[_0xd758('0x8')](),controller[_0xd758('0x15')]);router[_0xd758('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xd758('0x17')]);router[_0xd758('0x16')](_0xd758('0xe'),auth[_0xd758('0x8')](),controller['removeMembers']);module[_0xd758('0x18')]=router; \ No newline at end of file +var _0xdcb7=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','/describe','get','/:id','/:id/unread','getUnread','/:id/messages','getMessages','post','/:id/members','addMembers','addMessage','put','update','delete','destroy','removeMembers','exports','multer','connect-timeout'];(function(_0xc140f6,_0x295d7f){var _0x2d4f70=function(_0x173f49){while(--_0x173f49){_0xc140f6['push'](_0xc140f6['shift']());}};_0x2d4f70(++_0x295d7f);}(_0xdcb7,0x10c));var _0x7dcb=function(_0x337c60,_0x52db2a){_0x337c60=_0x337c60-0x0;var _0xea2304=_0xdcb7[_0x337c60];return _0xea2304;};'use strict';var multer=require(_0x7dcb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7dcb('0x1'));var express=require(_0x7dcb('0x2'));var router=express['Router']();var fs_extra=require(_0x7dcb('0x3'));var auth=require(_0x7dcb('0x4'));var interaction=require(_0x7dcb('0x5'));var config=require(_0x7dcb('0x6'));var controller=require(_0x7dcb('0x7'));router['get']('/',auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x9')]);router['get'](_0x7dcb('0xa'),auth[_0x7dcb('0x8')](),controller['describe']);router[_0x7dcb('0xb')](_0x7dcb('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7dcb('0xd'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0xe')]);router[_0x7dcb('0xb')]('/:id/members',auth[_0x7dcb('0x8')](),controller['getMembers']);router[_0x7dcb('0xb')](_0x7dcb('0xf'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x10')]);router[_0x7dcb('0x11')]('/',auth[_0x7dcb('0x8')](),controller['create']);router[_0x7dcb('0x11')](_0x7dcb('0x12'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x13')]);router[_0x7dcb('0x11')](_0x7dcb('0xf'),auth['isAuthenticated'](),controller[_0x7dcb('0x14')]);router[_0x7dcb('0x15')](_0x7dcb('0xc'),auth['isAuthenticated'](),controller[_0x7dcb('0x16')]);router[_0x7dcb('0x17')]('/:id',auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x18')]);router[_0x7dcb('0x17')](_0x7dcb('0x12'),auth[_0x7dcb('0x8')](),controller[_0x7dcb('0x19')]);module[_0x7dcb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index b7402d1..59511dc 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 _0xd3b6=['BOOLEAN','INTEGER','star','thumb','TEXT','STRING','DATE','long','ENUM','out','sequelize','exports'];(function(_0x4c5b52,_0x1a945a){var _0x24fce3=function(_0x5be371){while(--_0x5be371){_0x4c5b52['push'](_0x4c5b52['shift']());}};_0x24fce3(++_0x1a945a);}(_0xd3b6,0x136));var _0x6d3b=function(_0x34126c,_0x25b6e0){_0x34126c=_0x34126c-0x0;var _0x5c3852=_0xd3b6[_0x34126c];return _0x5c3852;};'use strict';var Sequelize=require(_0x6d3b('0x0'));module[_0x6d3b('0x1')]={'closed':{'type':Sequelize[_0x6d3b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6d3b('0x3')]},'ratingType':{'type':Sequelize['ENUM'](_0x6d3b('0x4'),_0x6d3b('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x6d3b('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x6d3b('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6d3b('0x8')]},'disposition':{'type':Sequelize[_0x6d3b('0x7')]},'secondDisposition':{'type':Sequelize[_0x6d3b('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x6d3b('0x7')]},'browserName':{'type':Sequelize[_0x6d3b('0x7')]},'browserVersion':{'type':Sequelize[_0x6d3b('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x6d3b('0x7')]},'deviceVendor':{'type':Sequelize[_0x6d3b('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x6d3b('0x6')]},'customerIp':{'type':Sequelize[_0x6d3b('0x7')]},'formData':{'type':Sequelize['TEXT'](_0x6d3b('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6d3b('0xa')]('in',_0x6d3b('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x6d3b('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x6d3b('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x6d3b('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x274a=['BOOLEAN','ENUM','star','TEXT','STRING','DATE','long','out','exports'];(function(_0x57041d,_0x3c34ad){var _0x5c5372=function(_0x248f05){while(--_0x248f05){_0x57041d['push'](_0x57041d['shift']());}};_0x5c5372(++_0x3c34ad);}(_0x274a,0x1ca));var _0xa274=function(_0x264b9b,_0xa1181e){_0x264b9b=_0x264b9b-0x0;var _0x4c7a0e=_0x274a[_0x264b9b];return _0x4c7a0e;};'use strict';var Sequelize=require('sequelize');module[_0xa274('0x0')]={'closed':{'type':Sequelize[_0xa274('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xa274('0x2')](_0xa274('0x3'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xa274('0x4')]},'pathTranscript':{'type':Sequelize[_0xa274('0x4')]},'mailTranscript':{'type':Sequelize[_0xa274('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xa274('0x6')]},'disposition':{'type':Sequelize[_0xa274('0x5')]},'secondDisposition':{'type':Sequelize[_0xa274('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa274('0x5')]},'browserName':{'type':Sequelize[_0xa274('0x5')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xa274('0x5')]},'deviceModel':{'type':Sequelize[_0xa274('0x5')]},'deviceVendor':{'type':Sequelize[_0xa274('0x5')]},'deviceType':{'type':Sequelize[_0xa274('0x5')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xa274('0x5')]},'formData':{'type':Sequelize[_0xa274('0x4')](_0xa274('0x7'))},'read1stAt':{'type':Sequelize[_0xa274('0x6')]},'lastMsgAt':{'type':Sequelize[_0xa274('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa274('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xa274('0x5')]},'customerPort':{'type':Sequelize[_0xa274('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xa274('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xa274('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index a92cb54..740d87e 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 _0xb0ac=['pathTranscript','Messages','User','CmContact','ContactId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','addMessage','ids','getMessages','length','hasOwnProperty','order','sort','where','filters','pick','ChatInteractionId','filter','map','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','nolimit','includeAgent','push','include','addTags','omit','spread','Tag','color','emit','chatInteractionTags:save','removeTags','toString','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','read','Owner','mkdirSync','Chat','Account','N.A.','browserName','osName','referer','customerIp','customerPort','tail','existsSync','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','rimraf','request-promise','moment','bluebird','mustache','path','ejs','lodash','ioredis','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','update','destroy','stack','name','send','render','body','contact','agent','interaction','account','index','ChatInteraction','rawAttributes','type','key','getOptions','findAll','chat','query','user','show','params','keys','intersection','model','attributes','fields','includeAll','merge','options','find','create','describe','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooNote','vidaooMetadata','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooTopic','follow','isNull','parse','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','closed','disposition','file','basename','mimetype','Attachment','attachmentDownload','ChatOfflineMessageId','root','server/files/attachments/','offline-chat/','join','download','close','server/files/chat/upload/','format','transcript-%s.txt','now'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xb0ac,0x12c));var _0xcb0a=function(_0x20fdfb,_0x3e2839){_0x20fdfb=_0x20fdfb-0x0;var _0x3e7a2b=_0xb0ac[_0x20fdfb];return _0x3e7a2b;};'use strict';var rimraf=require(_0xcb0a('0x0'));var zipdir=require('zip-dir');var rp=require(_0xcb0a('0x1'));var moment=require(_0xcb0a('0x2'));var BPromise=require(_0xcb0a('0x3'));var Mustache=require(_0xcb0a('0x4'));var util=require('util');var path=require(_0xcb0a('0x5'));var ejs=require(_0xcb0a('0x6'));var fs=require('fs');var _=require(_0xcb0a('0x7'));var Redis=require(_0xcb0a('0x8'));var interaction=require('../../components/interaction/service');var qs=require(_0xcb0a('0x9'));var pdf=require(_0xcb0a('0xa'));var logger=require(_0xcb0a('0xb'))(_0xcb0a('0xc'));var config=require(_0xcb0a('0xd'));var db=require(_0xcb0a('0xe'))['db'];config[_0xcb0a('0xf')]=_[_0xcb0a('0x10')](config[_0xcb0a('0xf')],{'host':_0xcb0a('0x11'),'port':0x18eb});var socket=require(_0xcb0a('0x12'))(new Redis(config[_0xcb0a('0xf')]));require('./chatInteraction.socket')[_0xcb0a('0x13')](socket);var jayson=require(_0xcb0a('0x14'));var client=jayson[_0xcb0a('0x15')][_0xcb0a('0x16')]({'port':0x232b});var client9004=jayson[_0xcb0a('0x15')][_0xcb0a('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x5653ac,_0x46f890,_0x5a9d65,_0x24d13b){return new BPromise(function(_0x1dcb9e,_0x55d1c9){var _0x37cc0b=_0x24d13b||client;return _0x37cc0b[_0xcb0a('0x17')](_0x5653ac,_0x5a9d65)[_0xcb0a('0x18')](function(_0x3f6baf){logger['info'](_0xcb0a('0x19'),_0x46f890,_0xcb0a('0x1a'));logger[_0xcb0a('0x1b')](_0xcb0a('0x1c'),_0x46f890,_0xcb0a('0x1a'),JSON[_0xcb0a('0x1d')](_0x3f6baf));if(_0x3f6baf[_0xcb0a('0x1e')]){if(_0x3f6baf[_0xcb0a('0x1e')]['code']===0x1f4){logger[_0xcb0a('0x1e')](_0xcb0a('0x19'),_0x46f890,_0x3f6baf[_0xcb0a('0x1e')][_0xcb0a('0x1f')]);return _0x55d1c9(_0x3f6baf[_0xcb0a('0x1e')][_0xcb0a('0x1f')]);}logger['error'](_0xcb0a('0x19'),_0x46f890,_0x3f6baf[_0xcb0a('0x1e')]['message']);return _0x1dcb9e(_0x3f6baf[_0xcb0a('0x1e')][_0xcb0a('0x1f')]);}else{logger[_0xcb0a('0x20')]('ChatInteraction,\x20%s,\x20%s',_0x46f890,'request\x20sent');_0x1dcb9e(_0x3f6baf[_0xcb0a('0x21')][_0xcb0a('0x1f')]);}})[_0xcb0a('0x22')](function(_0x43e59e){logger['error'](_0xcb0a('0x19'),_0x46f890,_0x43e59e);_0x55d1c9(_0x43e59e);});});}function respondWithStatusCode(_0x2ee73c,_0x54306f){_0x54306f=_0x54306f||0xcc;return function(_0x13e694){if(_0x13e694){return _0x2ee73c[_0xcb0a('0x23')](_0x54306f);}return _0x2ee73c[_0xcb0a('0x24')](_0x54306f)[_0xcb0a('0x25')]();};}function respondWithResult(_0xd1c59e,_0x4674f7){_0x4674f7=_0x4674f7||0xc8;return function(_0x538bf5){if(_0x538bf5){return _0xd1c59e[_0xcb0a('0x24')](_0x4674f7)[_0xcb0a('0x26')](_0x538bf5);}};}function respondWithFilteredResult(_0x508e75,_0x590350){return function(_0x302807){if(_0x302807){var _0x4956e9=typeof _0x590350['offset']===_0xcb0a('0x27')&&typeof _0x590350['limit']===_0xcb0a('0x27');var _0x4639a3=_0x302807['count'];var _0x125a63=_0x4956e9?0x0:_0x590350[_0xcb0a('0x28')];var _0xa6283e=_0x4956e9?_0x302807[_0xcb0a('0x29')]:_0x590350[_0xcb0a('0x28')]+_0x590350[_0xcb0a('0x2a')];var _0x16f7c8;if(_0xa6283e>=_0x4639a3){_0xa6283e=_0x4639a3;_0x16f7c8=0xc8;}else{_0x16f7c8=0xce;}_0x508e75[_0xcb0a('0x24')](_0x16f7c8);return _0x508e75[_0xcb0a('0x2b')](_0xcb0a('0x2c'),_0x125a63+'-'+_0xa6283e+'/'+_0x4639a3)[_0xcb0a('0x26')](_0x302807);}return null;};}function saveUpdates(_0x1ec3f5){return function(_0xa8487f){if(_0xa8487f){return _0xa8487f[_0xcb0a('0x2d')](_0x1ec3f5)[_0xcb0a('0x18')](function(_0x7a2659){return _0x7a2659;});}return null;};}function removeEntity(_0x2d20de){return function(_0x2bfa0d){if(_0x2bfa0d){return _0x2bfa0d[_0xcb0a('0x2e')]()[_0xcb0a('0x18')](function(){_0x2d20de[_0xcb0a('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59a9dd){return function(_0x59d5b4){if(!_0x59d5b4){_0x59a9dd[_0xcb0a('0x23')](0x194);}return _0x59d5b4;};}function handleError(_0x554c3f,_0x4fc43e){_0x4fc43e=_0x4fc43e||0x1f4;return function(_0x26e17b){logger['error'](_0x26e17b[_0xcb0a('0x2f')]);if(_0x26e17b[_0xcb0a('0x30')]){delete _0x26e17b[_0xcb0a('0x30')];}_0x554c3f[_0xcb0a('0x24')](_0x4fc43e)[_0xcb0a('0x31')](_0x26e17b);};}function getMustacheRender(_0x431f0e,_0x42a90e){return Mustache[_0xcb0a('0x32')](_0x431f0e,_['merge'](_0x42a90e[_0xcb0a('0x33')],{'contact':_0x42a90e[_0xcb0a('0x34')],'message':_0x42a90e[_0xcb0a('0x1f')],'agent':_0x42a90e[_0xcb0a('0x35')],'interaction':_0x42a90e[_0xcb0a('0x36')],'account':_0x42a90e[_0xcb0a('0x37')]}))||'';}exports[_0xcb0a('0x38')]=function(_0x5d25b5,_0x329746){var _0x423413={};var _0x1aa7f6=_['map'](db[_0xcb0a('0x39')][_0xcb0a('0x3a')],function(_0xaa5ca4){return{'name':_0xaa5ca4['fieldName'],'type':_0xaa5ca4[_0xcb0a('0x3b')][_0xcb0a('0x3c')]};});_0x423413=qs[_0xcb0a('0x3d')](_0x1aa7f6,_0x5d25b5);return interaction[_0xcb0a('0x3e')](_0xcb0a('0x3f'),_0x5d25b5[_0xcb0a('0x40')],_0x5d25b5[_0xcb0a('0x41')],_0x423413,_0x1aa7f6)[_0xcb0a('0x18')](respondWithFilteredResult(_0x329746,_0x423413))[_0xcb0a('0x22')](handleError(_0x329746,null));};exports[_0xcb0a('0x42')]=function(_0x100c5f,_0x145afb){var _0x292771={'raw':![],'where':{'id':_0x100c5f[_0xcb0a('0x43')]['id']}},_0x1e9b7c={};_0x1e9b7c['model']=_['keys'](db[_0xcb0a('0x39')][_0xcb0a('0x3a')]);_0x1e9b7c[_0xcb0a('0x40')]=_[_0xcb0a('0x44')](_0x100c5f['query']);_0x1e9b7c['filters']=_[_0xcb0a('0x45')](_0x1e9b7c[_0xcb0a('0x46')],_0x1e9b7c['query']);_0x292771[_0xcb0a('0x47')]=_[_0xcb0a('0x45')](_0x1e9b7c[_0xcb0a('0x46')],qs[_0xcb0a('0x48')](_0x100c5f[_0xcb0a('0x40')]['fields']));_0x292771['attributes']=_0x292771['attributes']['length']?_0x292771['attributes']:_0x1e9b7c['model'];if(_0x100c5f['query'][_0xcb0a('0x49')]){_0x292771['include']=[{'all':!![]}];}_0x292771=_[_0xcb0a('0x4a')]({},_0x292771,_0x100c5f[_0xcb0a('0x4b')]);return db[_0xcb0a('0x39')][_0xcb0a('0x4c')](_0x292771)['then'](handleEntityNotFound(_0x145afb,null))[_0xcb0a('0x18')](respondWithResult(_0x145afb,null))[_0xcb0a('0x22')](handleError(_0x145afb,null));};exports[_0xcb0a('0x4d')]=function(_0x3bf934,_0x538cfd){return db[_0xcb0a('0x39')][_0xcb0a('0x4d')](_0x3bf934[_0xcb0a('0x33')],{})[_0xcb0a('0x18')](respondWithResult(_0x538cfd,0xc9))[_0xcb0a('0x22')](handleError(_0x538cfd,null));};exports[_0xcb0a('0x2d')]=function(_0x39a403,_0x2f3e68){if(_0x39a403[_0xcb0a('0x33')]['id']){delete _0x39a403[_0xcb0a('0x33')]['id'];}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x39a403[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x2f3e68,null))['then'](saveUpdates(_0x39a403[_0xcb0a('0x33')],null))['then'](respondWithResult(_0x2f3e68,null))['catch'](handleError(_0x2f3e68,null));};exports[_0xcb0a('0x2e')]=function(_0x11bca7,_0x42bd04){return db['ChatInteraction'][_0xcb0a('0x4c')]({'where':{'id':_0x11bca7[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x42bd04,null))['then'](removeEntity(_0x42bd04,null))['catch'](handleError(_0x42bd04,null));};exports[_0xcb0a('0x4e')]=function(_0x2f7482,_0x44a065){return db[_0xcb0a('0x39')][_0xcb0a('0x4e')]()[_0xcb0a('0x18')](respondWithResult(_0x44a065,null))['catch'](handleError(_0x44a065,null));};exports['createVidaooSession']=function(_0x561abc,_0x12cf60){var _0x1bc01d=_0x561abc['params']['id'];var _0x152b3e;var _0x527e1d;var _0x5c8237;return db[_0xcb0a('0x39')][_0xcb0a('0x4f')]({'where':{'id':_0x1bc01d}})[_0xcb0a('0x18')](function(_0x3c1b0e){_0x152b3e=_0x3c1b0e;return db[_0xcb0a('0x50')][_0xcb0a('0x4f')]({'where':{'id':_0x3c1b0e[_0xcb0a('0x51')]},'attributes':['id',_0xcb0a('0x52'),'vidaooEscalation','vidaooTopic',_0xcb0a('0x53'),_0xcb0a('0x54')],'raw':!![]});})[_0xcb0a('0x18')](function(_0x5ceca9){if(_0x5ceca9&&_0x5ceca9[_0xcb0a('0x52')]&&_0x5ceca9[_0xcb0a('0x55')]){_0x527e1d=_0x5ceca9;var _0x16bf23={'interaction':{'id':_0x1bc01d},'agent':{'id':_0x561abc[_0xcb0a('0x41')]['id'],'name':_0x561abc['user']['name'],'fullname':_0x561abc[_0xcb0a('0x41')]['fullname'],'email':_0x561abc[_0xcb0a('0x41')]['email']},'contact':_0x561abc[_0xcb0a('0x33')][_0xcb0a('0x34')],'account':_0x561abc[_0xcb0a('0x33')][_0xcb0a('0x37')]};var _0x148af1={'rejectUnauthorized':![],'method':_0xcb0a('0x56'),'url':_0xcb0a('0x57'),'headers':{'X-APIKEY':_0x5ceca9[_0xcb0a('0x52')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x561abc[_0xcb0a('0x41')][_0xcb0a('0x58')]],'buttons':null,'topic':_0x527e1d[_0xcb0a('0x59')],'note':_['isNull'](_0x527e1d[_0xcb0a('0x53')])?null:getMustacheRender(_0x527e1d[_0xcb0a('0x53')],_0x16bf23),'metadata':null},'redirect':_0xcb0a('0x5a'),'json':!![]};try{if(!_[_0xcb0a('0x5b')](_0x527e1d[_0xcb0a('0x54')])){var _0x3dcb43=getMustacheRender(_0x527e1d['vidaooMetadata'],_0x16bf23);var _0x4b73bd=JSON[_0xcb0a('0x5c')](_0x3dcb43);_0x148af1[_0xcb0a('0x33')]['metadata']=_0x4b73bd;}}catch(_0xff2f92){throw new db[(_0xcb0a('0x5d'))][(_0xcb0a('0x5e'))](_0xcb0a('0x5f'));}return rp(_0x148af1);}else{throw new db[(_0xcb0a('0x5d'))][(_0xcb0a('0x5e'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xcb0a('0x18')](function(_0x44e874){_0x5c8237=_0x44e874;if(_0x5c8237['id']){var _0x8beee4={'body':_0x5c8237['join_url'],'ChatWebsiteId':_0x527e1d['id'],'ChatInteractionId':_0x152b3e['id'],'direction':_0xcb0a('0x60'),'UserId':_0x561abc[_0xcb0a('0x41')]['id']};return db[_0xcb0a('0x61')][_0xcb0a('0x4d')](_0x8beee4,{});}else{throw new db['Sequelize'][(_0xcb0a('0x5e'))](_0xcb0a('0x62'));}})[_0xcb0a('0x18')](function(){return _0x152b3e[_0xcb0a('0x63')]({'vidaooSessionId':_0x5c8237['id']});})[_0xcb0a('0x18')](respondWithResult(_0x12cf60,null))['catch'](handleError(_0x12cf60,null));};exports[_0xcb0a('0x64')]=function(_0x341720,_0x4000b0){if(_0x341720[_0xcb0a('0x33')]['id']){delete _0x341720['body']['id'];}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x341720[_0xcb0a('0x43')]['id']},'include':[{'model':db['CmContact'],'as':_0xcb0a('0x65')}]})[_0xcb0a('0x18')](handleEntityNotFound(_0x4000b0,null))[_0xcb0a('0x18')](saveUpdates(_0x341720[_0xcb0a('0x33')],null))['then'](respondWithResult(_0x4000b0,null))['catch'](handleError(_0x4000b0,null));};exports[_0xcb0a('0x66')]=function(_0x42f465,_0x3f8ccc){if(_0x42f465[_0xcb0a('0x33')]['id']){delete _0x42f465[_0xcb0a('0x33')]['id'];}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x42f465[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](function(_0x49576c){if(!_0x49576c){logger[_0xcb0a('0x1e')](_0xcb0a('0x67'),_0xcb0a('0x66'),0x194,_0xcb0a('0x68'));_0x3f8ccc[_0xcb0a('0x23')](0x194);}else{if(_0x49576c[_0xcb0a('0x69')]){throw new db[(_0xcb0a('0x5d'))][(_0xcb0a('0x5e'))]('Interaction\x20already\x20assigned');}}return _0x49576c;})['then'](function(_0x413ab0){if(_0x413ab0){return _0x413ab0[_0xcb0a('0x2d')]({'closed':_0x42f465['body'][_0xcb0a('0x6a')],'disposition':_0x42f465[_0xcb0a('0x33')][_0xcb0a('0x6b')]})[_0xcb0a('0x18')](function(_0x37ad3b){return _0x37ad3b;});}})[_0xcb0a('0x18')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x42f465[_0xcb0a('0x33')],client9004);})[_0xcb0a('0x18')](respondWithResult(_0x3f8ccc,null))[_0xcb0a('0x22')](handleError(_0x3f8ccc,null));};exports['attachmentUpload']=function(_0x58c981,_0x45a9d0){_0x58c981[_0xcb0a('0x33')][_0xcb0a('0x30')]=_0x58c981[_0xcb0a('0x6c')]['originalname'];_0x58c981[_0xcb0a('0x33')][_0xcb0a('0x6d')]=_0x58c981[_0xcb0a('0x6c')]['filename'];_0x58c981[_0xcb0a('0x33')]['type']=_0x58c981['file'][_0xcb0a('0x6e')];return db[_0xcb0a('0x6f')][_0xcb0a('0x4d')](_0x58c981['body'])[_0xcb0a('0x18')](respondWithResult(_0x45a9d0,0xc9))[_0xcb0a('0x22')](handleError(_0x45a9d0,null));};exports[_0xcb0a('0x70')]=function(_0x2402f7,_0x196242){return db[_0xcb0a('0x39')]['findOne']({'where':{'id':_0x2402f7['params']['id']},'raw':!![]})[_0xcb0a('0x18')](handleEntityNotFound(_0x196242,null))[_0xcb0a('0x18')](function(_0x364431){if(_0x364431){if(_0x364431[_0xcb0a('0x6a')]){return _0x196242[_0xcb0a('0x24')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xcb0a('0x6f')][_0xcb0a('0x4f')]({'where':{'id':_0x2402f7[_0xcb0a('0x40')]['attachId']},'raw':!![]})[_0xcb0a('0x18')](handleEntityNotFound(_0x196242,null));}})[_0xcb0a('0x18')](function(_0x5db9e6){if(_0x5db9e6){var _0x2c21d6=_0x5db9e6[_0xcb0a('0x71')]!==null;var _0x2205b8=path['join'](config[_0xcb0a('0x72')],_0xcb0a('0x73'));if(_0x2c21d6){_0x2205b8=path['join'](_0x2205b8,_0xcb0a('0x74'));}var _0x4a90a9=path[_0xcb0a('0x75')](_0x2205b8,_0x5db9e6[_0xcb0a('0x6d')]);return _0x196242[_0xcb0a('0x76')](_0x4a90a9);}})[_0xcb0a('0x22')](handleError(_0x196242,null));};exports[_0xcb0a('0x77')]=function(_0x674d20,_0x3b4d17){var _0xe4cbcb=null;var _0x18df8f=null;var _0x36d222=null;if(_0x674d20[_0xcb0a('0x33')]['id']){delete _0x674d20[_0xcb0a('0x33')]['id'];}if(_0x674d20[_0xcb0a('0x33')]['mailTranscript']){_0x36d222=path[_0xcb0a('0x75')](config[_0xcb0a('0x72')],_0xcb0a('0x78'),util[_0xcb0a('0x79')](_0xcb0a('0x7a'),Date[_0xcb0a('0x7b')]()));_0x674d20[_0xcb0a('0x33')][_0xcb0a('0x7c')]=_0x36d222;}return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x674d20['params']['id']},'include':[{'model':db[_0xcb0a('0x61')],'as':_0xcb0a('0x7d'),'include':[{'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0x7e')}]}]})[_0xcb0a('0x18')](handleEntityNotFound(_0x3b4d17,null))[_0xcb0a('0x18')](saveUpdates(_0x674d20['body'],null))[_0xcb0a('0x18')](function(_0x30e049){if(_0x30e049){_0xe4cbcb=_0x30e049;return db[_0xcb0a('0x50')][_0xcb0a('0x4c')]({'where':{'id':_0xe4cbcb['ChatWebsiteId']}});}})[_0xcb0a('0x18')](function(_0x85b249){if(_0x85b249){_0x18df8f=_0x85b249;return db[_0xcb0a('0x7f')][_0xcb0a('0x4c')]({'where':{'id':_0xe4cbcb[_0xcb0a('0x80')]}});}})['then'](function(_0x426730){if(_0x426730){if(_0x36d222){var _0x10279a=null;for(var _0x519ffd=0x1;_0x519ffd<_0xe4cbcb[_0xcb0a('0x7d')]['length'];++_0x519ffd){_0x10279a=_0xe4cbcb[_0xcb0a('0x7d')][_0x519ffd];var _0x3924fe=_0x10279a['UserId']?util[_0xcb0a('0x79')](_0xcb0a('0x81'),_0x18df8f[_0xcb0a('0x82')],_0x10279a[_0xcb0a('0x69')]):_0xcb0a('0x83');var _0x10a84d=_0x674d20['body'][_0xcb0a('0x84')]||util[_0xcb0a('0x79')](_0xcb0a('0x81'),_0xcb0a('0x85'),_0x10279a[_0xcb0a('0x80')]);switch(_0x18df8f[_0xcb0a('0x86')]){case _0xcb0a('0x87'):_0x3924fe=_0x10279a[_0xcb0a('0x69')]?util['format'](_0xcb0a('0x81'),_0x18df8f[_0xcb0a('0x82')],_0x10279a[_0xcb0a('0x69')]):'System';break;case _0xcb0a('0x88'):_0x3924fe=_0x10279a[_0xcb0a('0x69')]?_0x10279a[_0xcb0a('0x7e')]['alias']||_0x10279a['User'][_0xcb0a('0x89')]:'System';break;case'agent_fullname':_0x3924fe=_0x10279a[_0xcb0a('0x69')]?_0x10279a[_0xcb0a('0x7e')][_0xcb0a('0x89')]:_0xcb0a('0x83');break;default:_0x3924fe=_0x10279a['UserId']?util['format']('%s%d',_0x18df8f[_0xcb0a('0x82')],_0x10279a[_0xcb0a('0x69')]):'System';}var _0x46ea5c=util[_0xcb0a('0x79')](_0xcb0a('0x8a'),moment(_0x10279a[_0xcb0a('0x8b')])[_0xcb0a('0x79')](_0xcb0a('0x8c')),_0x10279a[_0xcb0a('0x8d')]==='in'?_0x10a84d:_0x3924fe,_0x10279a[_0xcb0a('0x33')]);if(!_0x10279a[_0xcb0a('0x8e')]){fs[_0xcb0a('0x8f')](_0x36d222,_0x46ea5c);}}return db[_0xcb0a('0x90')][_0xcb0a('0x4f')]({'where':{'service':!![]},'include':[{'model':db[_0xcb0a('0x91')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xcb0a('0x92')],'as':_0xcb0a('0x92'),'raw':!![]}]}]});}}})[_0xcb0a('0x18')](function(_0x106e01){if(!_0x106e01||!_0x106e01[_0xcb0a('0x93')]||!_0x674d20[_0xcb0a('0x33')])return _0xe4cbcb;var _0x5e43aa=_0x106e01[_0xcb0a('0x94')]();return respondWithRpcPromise(_0xcb0a('0x95'),'sendMail',{'account':_0x5e43aa,'message':{'from':util[_0xcb0a('0x79')](_0xcb0a('0x96'),_0x106e01[_0xcb0a('0x30')],_0x106e01[_0xcb0a('0x58')]||_0x106e01[_0xcb0a('0x93')]['user']),'to':_0x674d20['body'][_0xcb0a('0x97')],'subject':_0xcb0a('0x98'),'text':util[_0xcb0a('0x79')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x674d20[_0xcb0a('0x33')][_0xcb0a('0x97')]),'attachments':[{'path':_0x36d222}]}})[_0xcb0a('0x18')](function(){return _0xe4cbcb;})[_0xcb0a('0x22')](function(_0x21cab7){logger['error'](_0x21cab7);});})['then'](respondWithStatusCode(_0x3b4d17,0xc8))[_0xcb0a('0x22')](handleError(_0x3b4d17,null));};exports[_0xcb0a('0x99')]=function(_0x785847,_0x589003){return db[_0xcb0a('0x61')][_0xcb0a('0x4c')]({'where':{'id':_0x785847['params']['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x589003,null))[_0xcb0a('0x18')](function(_0x212a87){if(_0x212a87){return _0x212a87[_0xcb0a('0x99')](_0x785847[_0xcb0a('0x33')]['ids'],_['omit'](_0x785847[_0xcb0a('0x33')],[_0xcb0a('0x9a'),'id'])||{});}})[_0xcb0a('0x18')](respondWithResult(_0x589003,null))['catch'](handleError(_0x589003,null));};exports[_0xcb0a('0x9b')]=function(_0x58a0f0,_0x16e99b){var _0x2ec876={'raw':![],'where':{}};var _0x4d4716={};var _0x45a042={'count':0x0,'rows':[]};return db[_0xcb0a('0x39')][_0xcb0a('0x4f')]({'where':{'id':_0x58a0f0[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x16e99b,null))[_0xcb0a('0x18')](function(_0x356c04){if(_0x356c04){_0x4d4716[_0xcb0a('0x46')]=_[_0xcb0a('0x44')](db[_0xcb0a('0x61')][_0xcb0a('0x3a')]);_0x4d4716['query']=_[_0xcb0a('0x44')](_0x58a0f0[_0xcb0a('0x40')]);_0x4d4716['filters']=_[_0xcb0a('0x45')](_0x4d4716[_0xcb0a('0x46')],_0x4d4716[_0xcb0a('0x40')]);_0x2ec876[_0xcb0a('0x47')]=_[_0xcb0a('0x45')](_0x4d4716['model'],qs[_0xcb0a('0x48')](_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0x48')]));_0x2ec876[_0xcb0a('0x47')]=_0x2ec876['attributes'][_0xcb0a('0x9c')]?_0x2ec876[_0xcb0a('0x47')]:_0x4d4716['model'];if(!_0x58a0f0['query'][_0xcb0a('0x9d')]('nolimit')){_0x2ec876[_0xcb0a('0x2a')]=qs[_0xcb0a('0x2a')](_0x58a0f0['query'][_0xcb0a('0x2a')]);_0x2ec876[_0xcb0a('0x28')]=qs['offset'](_0x58a0f0['query'][_0xcb0a('0x28')]);}_0x2ec876[_0xcb0a('0x9e')]=qs[_0xcb0a('0x9f')](_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0x9f')]);_0x2ec876[_0xcb0a('0xa0')]=qs[_0xcb0a('0xa1')](_[_0xcb0a('0xa2')](_0x58a0f0[_0xcb0a('0x40')],_0x4d4716['filters']));_0x2ec876[_0xcb0a('0xa0')][_0xcb0a('0xa3')]=_0x356c04['id'];if(_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0xa4')]){_0x2ec876[_0xcb0a('0xa0')]=_['merge'](_0x2ec876[_0xcb0a('0xa0')],{'$or':_[_0xcb0a('0xa5')](_0x2ec876['attributes'],function(_0x5aa244){var _0x42e001={};_0x42e001[_0x5aa244]={'$like':'%'+_0x58a0f0['query'][_0xcb0a('0xa4')]+'%'};return _0x42e001;})});}if(_0x58a0f0[_0xcb0a('0x40')][_0xcb0a('0xa6')]){var _0x3b5e10=_0x58a0f0[_0xcb0a('0x40')]['$gte']['split'](',');var _0x588478={};_0x588478[_0x3b5e10[0x0]]={'$gte':moment(_0x3b5e10[0x1])[_0xcb0a('0x79')](_0xcb0a('0xa7'))};_0x2ec876[_0xcb0a('0xa0')]=_[_0xcb0a('0x4a')](_0x2ec876[_0xcb0a('0xa0')],_0x588478);}_0x2ec876=_[_0xcb0a('0x4a')]({},_0x2ec876,_0x58a0f0[_0xcb0a('0x4b')]);return db[_0xcb0a('0x61')][_0xcb0a('0x29')]({'where':_0x2ec876[_0xcb0a('0xa0')]})[_0xcb0a('0x18')](function(_0x2ce46f){_0x45a042[_0xcb0a('0x29')]=_0x2ce46f;if(_0x58a0f0[_0xcb0a('0x40')]['includeAll']){_0x2ec876['include']=[{'all':!![]}];}return db[_0xcb0a('0x61')][_0xcb0a('0x3e')](_0x2ec876);})['then'](function(_0x190daf){_0x45a042[_0xcb0a('0xa8')]=_0x190daf;return _0x45a042;});}})[_0xcb0a('0x18')](respondWithFilteredResult(_0x16e99b,_0x2ec876))[_0xcb0a('0x22')](handleError(_0x16e99b,null));};exports[_0xcb0a('0xa9')]=function(_0x22c589,_0x1cb38c){var _0x3c45f9={'where':{}},_0x599bb1={},_0x261699={'count':0x0,'rows':[]};return db[_0xcb0a('0x39')][_0xcb0a('0x4f')]({'where':{'id':_0x22c589[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x1cb38c,null))[_0xcb0a('0x18')](function(_0x51329e){if(_0x51329e){_0x599bb1[_0xcb0a('0x46')]=_[_0xcb0a('0x44')](db['ChatMessage'][_0xcb0a('0x3a')]);_0x599bb1[_0xcb0a('0x40')]=_['keys'](_0x22c589[_0xcb0a('0x40')]);_0x599bb1[_0xcb0a('0xa1')]=_[_0xcb0a('0x45')](_0x599bb1['model'],_0x599bb1[_0xcb0a('0x40')]);_0x3c45f9[_0xcb0a('0x47')]=_['intersection'](_0x599bb1[_0xcb0a('0x46')],qs[_0xcb0a('0x48')](_0x22c589[_0xcb0a('0x40')]['fields']));_0x3c45f9[_0xcb0a('0x47')]=_0x3c45f9[_0xcb0a('0x47')]['length']?_0x3c45f9[_0xcb0a('0x47')]:_0x599bb1[_0xcb0a('0x46')];if(!_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x9d')](_0xcb0a('0xaa'))){_0x3c45f9[_0xcb0a('0x2a')]=qs[_0xcb0a('0x2a')](_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x2a')]);_0x3c45f9[_0xcb0a('0x28')]=qs[_0xcb0a('0x28')](_0x22c589[_0xcb0a('0x40')]['offset']);}_0x3c45f9['order']=qs[_0xcb0a('0x9f')](_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x9f')]);_0x3c45f9[_0xcb0a('0xa0')]=qs[_0xcb0a('0xa1')](_[_0xcb0a('0xa2')](_0x22c589[_0xcb0a('0x40')],_0x599bb1['filters']));_0x3c45f9['where'][_0xcb0a('0xa3')]=_0x51329e['id'];if(_0x22c589['query']['filter']){_0x3c45f9['where']=_[_0xcb0a('0x4a')](_0x3c45f9[_0xcb0a('0xa0')],{'$or':_[_0xcb0a('0xa5')](_0x3c45f9['attributes'],function(_0x55b695){var _0x440a3d={};_0x440a3d[_0x55b695]={'$like':'%'+_0x22c589[_0xcb0a('0x40')][_0xcb0a('0xa4')]+'%'};return _0x440a3d;})});}_0x3c45f9[_0xcb0a('0xa0')][_0xcb0a('0x8e')]=![];if(_0x22c589[_0xcb0a('0x40')]['id']){_0x3c45f9['where']['id']={'$gt':_0x22c589[_0xcb0a('0x40')]['id']};}_0x3c45f9=_['merge']({},_0x3c45f9,_0x22c589[_0xcb0a('0x4b')]);return db[_0xcb0a('0x61')][_0xcb0a('0x29')]({'where':_0x3c45f9[_0xcb0a('0xa0')]})[_0xcb0a('0x18')](function(_0x11854d){_0x261699[_0xcb0a('0x29')]=_0x11854d;_0x3c45f9['include']=[];if(_0x22c589[_0xcb0a('0x40')][_0xcb0a('0xab')]){_0x3c45f9['include'][_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0x7e'),'attributes':['id','fullname','alias']});}if(_0x22c589[_0xcb0a('0x40')][_0xcb0a('0x49')]){_0x3c45f9[_0xcb0a('0xad')]=[{'all':!![]}];}return db[_0xcb0a('0x61')]['findAll'](_0x3c45f9);})[_0xcb0a('0x18')](function(_0x4d37bf){_0x261699[_0xcb0a('0xa8')]=_0x4d37bf;return _0x261699;});}})['then'](respondWithFilteredResult(_0x1cb38c,_0x3c45f9))[_0xcb0a('0x22')](handleError(_0x1cb38c,null));};exports[_0xcb0a('0xae')]=function(_0x42416a,_0x11f547){return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x42416a[_0xcb0a('0x43')]['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x11f547,null))[_0xcb0a('0x18')](function(_0xa42248){if(_0xa42248){return _0xa42248['setTags'](_0x42416a[_0xcb0a('0x33')][_0xcb0a('0x9a')],_[_0xcb0a('0xaf')](_0x42416a[_0xcb0a('0x33')],['ids','id'])||{})[_0xcb0a('0xb0')](function(){return db[_0xcb0a('0xb1')][_0xcb0a('0x3e')]({'attributes':['id',_0xcb0a('0x30'),_0xcb0a('0xb2')],'where':{'id':_0x42416a[_0xcb0a('0x33')][_0xcb0a('0x9a')]}});})[_0xcb0a('0x18')](function(_0x8eebaf){socket[_0xcb0a('0xb3')](_0xcb0a('0xb4'),{'id':Number(_0x42416a[_0xcb0a('0x43')]['id']),'tags':_0x8eebaf||[]});return{'id':Number(_0x42416a[_0xcb0a('0x43')]['id']),'tags':_0x8eebaf||[]};});}})[_0xcb0a('0x18')](respondWithResult(_0x11f547,null))[_0xcb0a('0x22')](handleError(_0x11f547,null));};exports[_0xcb0a('0xb5')]=function(_0xd747e9,_0x5f4905){return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0xd747e9['params']['id']}})[_0xcb0a('0x18')](handleEntityNotFound(_0x5f4905,null))[_0xcb0a('0x18')](function(_0x1844fa){if(_0x1844fa){return _0x1844fa[_0xcb0a('0xb5')](_0xd747e9['query'][_0xcb0a('0x9a')]);}})['then'](respondWithStatusCode(_0x5f4905,null))['catch'](handleError(_0x5f4905,null));};exports[_0xcb0a('0x76')]=function(_0x1873b8,_0x2df513){var _0x3be652=moment()['unix']()[_0xcb0a('0xb6')]();var _0x3aab83=path[_0xcb0a('0x75')](config[_0xcb0a('0x72')],'server',_0xcb0a('0xb7'),_0xcb0a('0xb8'));var _0x4c6a7c=path[_0xcb0a('0x75')](config[_0xcb0a('0x72')],_0xcb0a('0xb9'),'files',_0xcb0a('0xba'));var _0xfc2c45=path[_0xcb0a('0x75')](_0x3aab83,_0x3be652);var _0x264535=util[_0xcb0a('0x79')](_0xcb0a('0xbb'),_0x1873b8[_0xcb0a('0x43')]['id'],_0x3be652);var _0x1ca39a=path['join'](_0x3aab83,_0x264535);var _0x4c459c=[];_0x4c459c[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0x7e'),'attributes':['id',_0xcb0a('0x89')],'raw':!![]});_0x4c459c[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7f')],'as':_0xcb0a('0x65'),'attributes':['id',_0xcb0a('0xbc'),_0xcb0a('0xbd')],'raw':!![]});if(_0x1873b8[_0xcb0a('0x40')][_0xcb0a('0xba')]){_0x4c459c[_0xcb0a('0xac')]({'model':db['Attachment'],'as':_0xcb0a('0x6f'),'raw':!![]});}var _0x597a27=[{'model':db[_0xcb0a('0x61')],'as':_0xcb0a('0x7d'),'attributes':['id',_0xcb0a('0x33'),_0xcb0a('0x8b'),_0xcb0a('0x8d'),_0xcb0a('0x8e'),_0xcb0a('0xbe')],'include':_0x4c459c}];_0x597a27[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x50')],'as':'Account','attributes':['id',_0xcb0a('0x30')]});_0x597a27[_0xcb0a('0xac')]({'model':db[_0xcb0a('0x7e')],'as':_0xcb0a('0xbf'),'attributes':['id',_0xcb0a('0x89')]});return db[_0xcb0a('0x39')][_0xcb0a('0x4c')]({'where':{'id':_0x1873b8[_0xcb0a('0x43')]['id']},'include':_0x597a27})[_0xcb0a('0x18')](handleEntityNotFound(_0x2df513,null))[_0xcb0a('0x18')](function(_0x48c42e){if(_0x48c42e){var _0x55bdce=_0x48c42e['get']({'plain':!![]});fs[_0xcb0a('0xc0')](_0xfc2c45);var _0x3d8515={'channel':_0xcb0a('0xc1'),'account':_0x55bdce[_0xcb0a('0xc2')][_0xcb0a('0x30')],'agent':_0x55bdce[_0xcb0a('0xbf')]?_0x55bdce[_0xcb0a('0xbf')][_0xcb0a('0x89')]:_0xcb0a('0xc3'),'createdAt':moment(_0x55bdce['createdAt'])[_0xcb0a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcb0a('0xb6')](),'closedAt':_0x55bdce['closed']?moment(_0x55bdce['closedAt'])[_0xcb0a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')[_0xcb0a('0xb6')]():'','disposition':_0x55bdce[_0xcb0a('0x6b')],'chatInfo':{'browser':_0x55bdce[_0xcb0a('0xc4')],'os':_0x55bdce[_0xcb0a('0xc5')],'referer':_0x55bdce[_0xcb0a('0xc6')],'customerIp':_0x55bdce[_0xcb0a('0xc7')],'customerPort':_0x55bdce[_0xcb0a('0xc8')]?_0x55bdce['customerPort']:_0xcb0a('0xc3')},'messages':_(_0x55bdce['Messages'])[_0xcb0a('0xc9')]()['filter']({'secret':![]})['map'](function(_0x13e174){if(_0x13e174[_0xcb0a('0x6f')]){var _0x2e05f3=path[_0xcb0a('0x75')](_0x4c6a7c,_0x13e174[_0xcb0a('0x6f')][_0xcb0a('0x6d')]);if(fs[_0xcb0a('0xca')](_0x2e05f3)){fs['createReadStream'](_0x2e05f3)[_0xcb0a('0xcb')](fs[_0xcb0a('0xcc')](path[_0xcb0a('0x75')](_0xfc2c45,_0x13e174[_0xcb0a('0x6f')][_0xcb0a('0x6d')])));}}return{'date':moment(_0x13e174[_0xcb0a('0x8b')])[_0xcb0a('0x79')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x13e174['direction']===_0xcb0a('0x60')?_0x13e174[_0xcb0a('0x7e')]?_0x13e174[_0xcb0a('0x7e')]['fullname']:_0xcb0a('0x83'):_0x13e174['Contact'][_0xcb0a('0xbc')]+(_0x13e174[_0xcb0a('0x65')][_0xcb0a('0xbd')]?'\x20'+_0x13e174['Contact'][_0xcb0a('0xbd')]:''),'body':_0x13e174[_0xcb0a('0x6f')]?_0x13e174[_0xcb0a('0x6f')][_0xcb0a('0x6d')]:_0x13e174[_0xcb0a('0x33')],'direction':_0x13e174[_0xcb0a('0x8d')]===_0xcb0a('0x60')?'A':'C','secret':_0x13e174['secret'],'read':_0x13e174[_0xcb0a('0xbe')],'attachment':_0x13e174[_0xcb0a('0x6f')]};})['value']()};return ejs[_0xcb0a('0xcd')](path[_0xcb0a('0x75')](config['root'],_0xcb0a('0xb9'),_0xcb0a('0xce'),_0xcb0a('0xcf')),{'interaction':_0x3d8515})[_0xcb0a('0x18')](function(_0x454233){var _0x17cdcd=path[_0xcb0a('0x75')](_0xfc2c45,_0xcb0a('0xd0')+_0x55bdce['id']+'-'+_0x3be652+_0xcb0a('0xd1'));var _0x4c546d={'path':_0x17cdcd,'channel':_0xcb0a('0xc1'),'interactionId':_0x55bdce['id']};return pdf[_0xcb0a('0xd2')](_0x454233,_0x4c546d);})['then'](function(){return new Promise(function(_0x595aba,_0x3e7c08){zipdir(_0xfc2c45,{'saveTo':_0x1ca39a},function(_0x55256e,_0x31495a){if(_0x55256e)return _0x3e7c08(_0x55256e);return _0x595aba(_0x31495a);});})['then'](function(){return new BPromise(function(_0xc0338f,_0x1fad0d){rimraf(_0xfc2c45,function(_0x12b8e7){if(_0x12b8e7)_0x1fad0d(_0x12b8e7);return _0xc0338f();});});})[_0xcb0a('0x18')](function(){return _0x2df513[_0xcb0a('0x76')](_0x1ca39a,_0x264535,function(_0x454d68){if(_0x454d68){logger['error']('err',_0x454d68);}else{fs[_0xcb0a('0xd3')](_0x1ca39a);}});});});}else{return _0x2df513[_0xcb0a('0x23')](0xc8);}})[_0xcb0a('0x22')](handleError(_0x2df513,null));}; \ No newline at end of file +var _0xbb9f=['sort','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','pick','options','includeAgent','push','addTags','setTags','spread','color','emit','chatInteractionTags:save','download','toString','server','files','tmp','attachments','CmContact','firstName','lastName','read','Account','Chat','Owner','N.A.','closedAt','browserName','customerIp','customerPort','existsSync','createReadStream','pipe','value','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../mysqldb','redis','localhost','register','client','http','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','stack','name','send','render','merge','body','contact','agent','account','map','ChatInteraction','type','key','getOptions','user','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','describe','createVidaooSession','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','disposition','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','closed','Unauthorized','findOne','attachId','join','server/files/attachments/','offline-chat/','mailTranscript','root','server/files/chat/upload/','format','Messages','User','ChatWebsite','ContactId','%s%d','System','customer','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','hasOwnProperty','nolimit','order'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xbb9f,0x1c7));var _0xfbb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb9f[_0x3dd15e];return _0x231fd0;};'use strict';var rimraf=require(_0xfbb9('0x0'));var zipdir=require(_0xfbb9('0x1'));var rp=require(_0xfbb9('0x2'));var moment=require(_0xfbb9('0x3'));var BPromise=require(_0xfbb9('0x4'));var Mustache=require(_0xfbb9('0x5'));var util=require(_0xfbb9('0x6'));var path=require(_0xfbb9('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfbb9('0x8'));var Redis=require(_0xfbb9('0x9'));var interaction=require(_0xfbb9('0xa'));var qs=require('../../components/parsers/qs');var pdf=require(_0xfbb9('0xb'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0xfbb9('0xc'))['db'];config[_0xfbb9('0xd')]=_['defaults'](config[_0xfbb9('0xd')],{'host':_0xfbb9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbb9('0xd')]));require('./chatInteraction.socket')[_0xfbb9('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfbb9('0x10')][_0xfbb9('0x11')]({'port':0x232b});var client9004=jayson[_0xfbb9('0x10')][_0xfbb9('0x11')]({'port':0x232c});function respondWithRpcPromise(_0xcb9c56,_0x3f6753,_0x251484,_0x3505b2){return new BPromise(function(_0x4d44ef,_0xf3c4bd){var _0x4b65ac=_0x3505b2||client;return _0x4b65ac[_0xfbb9('0x12')](_0xcb9c56,_0x251484)['then'](function(_0x29f3a9){logger['info'](_0xfbb9('0x13'),_0x3f6753,_0xfbb9('0x14'));logger[_0xfbb9('0x15')](_0xfbb9('0x16'),_0x3f6753,_0xfbb9('0x14'),JSON[_0xfbb9('0x17')](_0x29f3a9));if(_0x29f3a9[_0xfbb9('0x18')]){if(_0x29f3a9[_0xfbb9('0x18')][_0xfbb9('0x19')]===0x1f4){logger[_0xfbb9('0x18')](_0xfbb9('0x13'),_0x3f6753,_0x29f3a9['error'][_0xfbb9('0x1a')]);return _0xf3c4bd(_0x29f3a9[_0xfbb9('0x18')]['message']);}logger[_0xfbb9('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x3f6753,_0x29f3a9['error'][_0xfbb9('0x1a')]);return _0x4d44ef(_0x29f3a9[_0xfbb9('0x18')][_0xfbb9('0x1a')]);}else{logger[_0xfbb9('0x1b')](_0xfbb9('0x13'),_0x3f6753,_0xfbb9('0x14'));_0x4d44ef(_0x29f3a9['result'][_0xfbb9('0x1a')]);}})[_0xfbb9('0x1c')](function(_0x15bc33){logger[_0xfbb9('0x18')](_0xfbb9('0x13'),_0x3f6753,_0x15bc33);_0xf3c4bd(_0x15bc33);});});}function respondWithStatusCode(_0x4aec49,_0x13f4df){_0x13f4df=_0x13f4df||0xcc;return function(_0x2ec282){if(_0x2ec282){return _0x4aec49[_0xfbb9('0x1d')](_0x13f4df);}return _0x4aec49[_0xfbb9('0x1e')](_0x13f4df)[_0xfbb9('0x1f')]();};}function respondWithResult(_0x46cc4e,_0x9ac921){_0x9ac921=_0x9ac921||0xc8;return function(_0x3c4b4c){if(_0x3c4b4c){return _0x46cc4e[_0xfbb9('0x1e')](_0x9ac921)[_0xfbb9('0x20')](_0x3c4b4c);}};}function respondWithFilteredResult(_0x48cb8f,_0x47e001){return function(_0x2cd645){if(_0x2cd645){var _0x349742=typeof _0x47e001[_0xfbb9('0x21')]===_0xfbb9('0x22')&&typeof _0x47e001[_0xfbb9('0x23')]===_0xfbb9('0x22');var _0xa9f413=_0x2cd645[_0xfbb9('0x24')];var _0x2862e6=_0x349742?0x0:_0x47e001[_0xfbb9('0x21')];var _0x33afdd=_0x349742?_0x2cd645[_0xfbb9('0x24')]:_0x47e001[_0xfbb9('0x21')]+_0x47e001[_0xfbb9('0x23')];var _0x4fb1a1;if(_0x33afdd>=_0xa9f413){_0x33afdd=_0xa9f413;_0x4fb1a1=0xc8;}else{_0x4fb1a1=0xce;}_0x48cb8f[_0xfbb9('0x1e')](_0x4fb1a1);return _0x48cb8f[_0xfbb9('0x25')](_0xfbb9('0x26'),_0x2862e6+'-'+_0x33afdd+'/'+_0xa9f413)[_0xfbb9('0x20')](_0x2cd645);}return null;};}function saveUpdates(_0x3d99fe){return function(_0x7bfe73){if(_0x7bfe73){return _0x7bfe73[_0xfbb9('0x27')](_0x3d99fe)[_0xfbb9('0x28')](function(_0x2a9ce1){return _0x2a9ce1;});}return null;};}function removeEntity(_0x1183c6){return function(_0x1f9901){if(_0x1f9901){return _0x1f9901[_0xfbb9('0x29')]()[_0xfbb9('0x28')](function(){_0x1183c6[_0xfbb9('0x1e')](0xcc)[_0xfbb9('0x1f')]();});}};}function handleEntityNotFound(_0x30d3cd){return function(_0x3ebb43){if(!_0x3ebb43){_0x30d3cd[_0xfbb9('0x1d')](0x194);}return _0x3ebb43;};}function handleError(_0xf1164e,_0x1ef65b){_0x1ef65b=_0x1ef65b||0x1f4;return function(_0xf49d08){logger[_0xfbb9('0x18')](_0xf49d08[_0xfbb9('0x2a')]);if(_0xf49d08[_0xfbb9('0x2b')]){delete _0xf49d08[_0xfbb9('0x2b')];}_0xf1164e['status'](_0x1ef65b)[_0xfbb9('0x2c')](_0xf49d08);};}function getMustacheRender(_0x486372,_0x3c2da6){return Mustache[_0xfbb9('0x2d')](_0x486372,_[_0xfbb9('0x2e')](_0x3c2da6[_0xfbb9('0x2f')],{'contact':_0x3c2da6[_0xfbb9('0x30')],'message':_0x3c2da6[_0xfbb9('0x1a')],'agent':_0x3c2da6[_0xfbb9('0x31')],'interaction':_0x3c2da6['interaction'],'account':_0x3c2da6[_0xfbb9('0x32')]}))||'';}exports['index']=function(_0x4f2c4b,_0x2188dc){var _0x139689={};var _0x440cd3=_[_0xfbb9('0x33')](db[_0xfbb9('0x34')]['rawAttributes'],function(_0x271a5e){return{'name':_0x271a5e['fieldName'],'type':_0x271a5e[_0xfbb9('0x35')][_0xfbb9('0x36')]};});_0x139689=qs[_0xfbb9('0x37')](_0x440cd3,_0x4f2c4b);return interaction['findAll']('chat',_0x4f2c4b['query'],_0x4f2c4b[_0xfbb9('0x38')],_0x139689,_0x440cd3)[_0xfbb9('0x28')](respondWithFilteredResult(_0x2188dc,_0x139689))[_0xfbb9('0x1c')](handleError(_0x2188dc,null));};exports[_0xfbb9('0x39')]=function(_0x8d9af3,_0x2cd18e){var _0x5b6dc6={'raw':![],'where':{'id':_0x8d9af3[_0xfbb9('0x3a')]['id']}},_0x554e8b={};_0x554e8b[_0xfbb9('0x3b')]=_['keys'](db[_0xfbb9('0x34')][_0xfbb9('0x3c')]);_0x554e8b[_0xfbb9('0x3d')]=_[_0xfbb9('0x3e')](_0x8d9af3['query']);_0x554e8b[_0xfbb9('0x3f')]=_[_0xfbb9('0x40')](_0x554e8b[_0xfbb9('0x3b')],_0x554e8b['query']);_0x5b6dc6[_0xfbb9('0x41')]=_[_0xfbb9('0x40')](_0x554e8b['model'],qs[_0xfbb9('0x42')](_0x8d9af3['query']['fields']));_0x5b6dc6['attributes']=_0x5b6dc6[_0xfbb9('0x41')][_0xfbb9('0x43')]?_0x5b6dc6[_0xfbb9('0x41')]:_0x554e8b['model'];if(_0x8d9af3[_0xfbb9('0x3d')][_0xfbb9('0x44')]){_0x5b6dc6[_0xfbb9('0x45')]=[{'all':!![]}];}_0x5b6dc6=_[_0xfbb9('0x2e')]({},_0x5b6dc6,_0x8d9af3['options']);return db[_0xfbb9('0x34')][_0xfbb9('0x46')](_0x5b6dc6)[_0xfbb9('0x28')](handleEntityNotFound(_0x2cd18e,null))[_0xfbb9('0x28')](respondWithResult(_0x2cd18e,null))['catch'](handleError(_0x2cd18e,null));};exports[_0xfbb9('0x47')]=function(_0x533ae4,_0x377a9b){return db[_0xfbb9('0x34')][_0xfbb9('0x47')](_0x533ae4[_0xfbb9('0x2f')],{})[_0xfbb9('0x28')](respondWithResult(_0x377a9b,0xc9))[_0xfbb9('0x1c')](handleError(_0x377a9b,null));};exports[_0xfbb9('0x27')]=function(_0x5c51e3,_0x880b10){if(_0x5c51e3[_0xfbb9('0x2f')]['id']){delete _0x5c51e3['body']['id'];}return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x5c51e3['params']['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x880b10,null))[_0xfbb9('0x28')](saveUpdates(_0x5c51e3[_0xfbb9('0x2f')],null))['then'](respondWithResult(_0x880b10,null))[_0xfbb9('0x1c')](handleError(_0x880b10,null));};exports[_0xfbb9('0x29')]=function(_0x38d7db,_0x29f113){return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x38d7db[_0xfbb9('0x3a')]['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x29f113,null))['then'](removeEntity(_0x29f113,null))[_0xfbb9('0x1c')](handleError(_0x29f113,null));};exports[_0xfbb9('0x48')]=function(_0x942455,_0x8166d7){return db[_0xfbb9('0x34')][_0xfbb9('0x48')]()[_0xfbb9('0x28')](respondWithResult(_0x8166d7,null))['catch'](handleError(_0x8166d7,null));};exports[_0xfbb9('0x49')]=function(_0x373233,_0x39a177){var _0x776d87=_0x373233[_0xfbb9('0x3a')]['id'];var _0x114811;var _0x12a3ab;var _0x1d843e;return db[_0xfbb9('0x34')]['findOne']({'where':{'id':_0x776d87}})['then'](function(_0x1e5e2c){_0x114811=_0x1e5e2c;return db['ChatWebsite']['findOne']({'where':{'id':_0x1e5e2c[_0xfbb9('0x4a')]},'attributes':['id',_0xfbb9('0x4b'),_0xfbb9('0x4c'),_0xfbb9('0x4d'),'vidaooNote',_0xfbb9('0x4e')],'raw':!![]});})[_0xfbb9('0x28')](function(_0x533d37){if(_0x533d37&&_0x533d37['vidaooApiKey']&&_0x533d37['vidaooEscalation']){_0x12a3ab=_0x533d37;var _0x1de93c={'interaction':{'id':_0x776d87},'agent':{'id':_0x373233[_0xfbb9('0x38')]['id'],'name':_0x373233[_0xfbb9('0x38')][_0xfbb9('0x2b')],'fullname':_0x373233['user'][_0xfbb9('0x4f')],'email':_0x373233['user']['email']},'contact':_0x373233['body'][_0xfbb9('0x30')],'account':_0x373233[_0xfbb9('0x2f')][_0xfbb9('0x32')]};var _0x1f5b71={'rejectUnauthorized':![],'method':'POST','url':_0xfbb9('0x50'),'headers':{'X-APIKEY':_0x533d37['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x373233['user']['email']],'buttons':null,'topic':_0x12a3ab['vidaooTopic'],'note':_[_0xfbb9('0x51')](_0x12a3ab[_0xfbb9('0x52')])?null:getMustacheRender(_0x12a3ab[_0xfbb9('0x52')],_0x1de93c),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x12a3ab[_0xfbb9('0x4e')])){var _0x137c61=getMustacheRender(_0x12a3ab['vidaooMetadata'],_0x1de93c);var _0x499eac=JSON[_0xfbb9('0x53')](_0x137c61);_0x1f5b71[_0xfbb9('0x2f')][_0xfbb9('0x54')]=_0x499eac;}}catch(_0x3142f1){throw new db[(_0xfbb9('0x55'))]['ValidationError'](_0xfbb9('0x56'));}return rp(_0x1f5b71);}else{throw new db[(_0xfbb9('0x55'))][(_0xfbb9('0x57'))](_0xfbb9('0x58'));}})['then'](function(_0x53c925){_0x1d843e=_0x53c925;if(_0x1d843e['id']){var _0x1c6fab={'body':_0x1d843e['join_url'],'ChatWebsiteId':_0x12a3ab['id'],'ChatInteractionId':_0x114811['id'],'direction':_0xfbb9('0x59'),'UserId':_0x373233['user']['id']};return db[_0xfbb9('0x5a')]['create'](_0x1c6fab,{});}else{throw new db['Sequelize'][(_0xfbb9('0x57'))](_0xfbb9('0x5b'));}})[_0xfbb9('0x28')](function(){return _0x114811[_0xfbb9('0x5c')]({'vidaooSessionId':_0x1d843e['id']});})[_0xfbb9('0x28')](respondWithResult(_0x39a177,null))[_0xfbb9('0x1c')](handleError(_0x39a177,null));};exports[_0xfbb9('0x5d')]=function(_0x379c46,_0x104dfb){if(_0x379c46[_0xfbb9('0x2f')]['id']){delete _0x379c46['body']['id'];}return db['ChatInteraction'][_0xfbb9('0x46')]({'where':{'id':_0x379c46[_0xfbb9('0x3a')]['id']},'include':[{'model':db['CmContact'],'as':_0xfbb9('0x5e')}]})[_0xfbb9('0x28')](handleEntityNotFound(_0x104dfb,null))[_0xfbb9('0x28')](saveUpdates(_0x379c46['body'],null))[_0xfbb9('0x28')](respondWithResult(_0x104dfb,null))[_0xfbb9('0x1c')](handleError(_0x104dfb,null));};exports[_0xfbb9('0x5f')]=function(_0x37adea,_0x3e5626){if(_0x37adea[_0xfbb9('0x2f')]['id']){delete _0x37adea[_0xfbb9('0x2f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x37adea[_0xfbb9('0x3a')]['id']}})['then'](function(_0x1b5a48){if(!_0x1b5a48){logger['error']('abandonInteraction,\x20%s,\x20%s,\x20%s',_0xfbb9('0x5f'),0x194,_0xfbb9('0x60'));_0x3e5626[_0xfbb9('0x1d')](0x194);}else{if(_0x1b5a48[_0xfbb9('0x61')]){throw new db[(_0xfbb9('0x55'))][(_0xfbb9('0x57'))](_0xfbb9('0x62'));}}return _0x1b5a48;})[_0xfbb9('0x28')](function(_0x8f4d90){if(_0x8f4d90){return _0x8f4d90[_0xfbb9('0x27')]({'closed':_0x37adea[_0xfbb9('0x2f')]['closed'],'disposition':_0x37adea[_0xfbb9('0x2f')][_0xfbb9('0x63')]})[_0xfbb9('0x28')](function(_0x207f6f){return _0x207f6f;});}})['then'](function(){return respondWithRpcPromise('AbandonInteraction',_0xfbb9('0x5f'),_0x37adea[_0xfbb9('0x2f')],client9004);})['then'](respondWithResult(_0x3e5626,null))[_0xfbb9('0x1c')](handleError(_0x3e5626,null));};exports['attachmentUpload']=function(_0x36bcf0,_0xa565de){_0x36bcf0[_0xfbb9('0x2f')][_0xfbb9('0x2b')]=_0x36bcf0[_0xfbb9('0x64')][_0xfbb9('0x65')];_0x36bcf0[_0xfbb9('0x2f')][_0xfbb9('0x66')]=_0x36bcf0[_0xfbb9('0x64')][_0xfbb9('0x67')];_0x36bcf0[_0xfbb9('0x2f')]['type']=_0x36bcf0['file'][_0xfbb9('0x68')];return db[_0xfbb9('0x69')]['create'](_0x36bcf0[_0xfbb9('0x2f')])[_0xfbb9('0x28')](respondWithResult(_0xa565de,0xc9))[_0xfbb9('0x1c')](handleError(_0xa565de,null));};exports[_0xfbb9('0x6a')]=function(_0x102b50,_0x337c64){return db['ChatInteraction']['findOne']({'where':{'id':_0x102b50['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x337c64,null))[_0xfbb9('0x28')](function(_0x139c7d){if(_0x139c7d){if(_0x139c7d[_0xfbb9('0x6b')]){return _0x337c64[_0xfbb9('0x1e')](0x193)[_0xfbb9('0x20')]({'status':0x193,'message':_0xfbb9('0x6c')});}return db[_0xfbb9('0x69')][_0xfbb9('0x6d')]({'where':{'id':_0x102b50[_0xfbb9('0x3d')][_0xfbb9('0x6e')]},'raw':!![]})[_0xfbb9('0x28')](handleEntityNotFound(_0x337c64,null));}})[_0xfbb9('0x28')](function(_0x26ac6c){if(_0x26ac6c){var _0x2e98c4=_0x26ac6c['ChatOfflineMessageId']!==null;var _0x58c861=path[_0xfbb9('0x6f')](config['root'],_0xfbb9('0x70'));if(_0x2e98c4){_0x58c861=path[_0xfbb9('0x6f')](_0x58c861,_0xfbb9('0x71'));}var _0x335d27=path[_0xfbb9('0x6f')](_0x58c861,_0x26ac6c[_0xfbb9('0x66')]);return _0x337c64['download'](_0x335d27);}})[_0xfbb9('0x1c')](handleError(_0x337c64,null));};exports['close']=function(_0x4b8ef1,_0x13c42f){var _0x11baaa=null;var _0x364128=null;var _0x20d69f=null;if(_0x4b8ef1[_0xfbb9('0x2f')]['id']){delete _0x4b8ef1[_0xfbb9('0x2f')]['id'];}if(_0x4b8ef1['body'][_0xfbb9('0x72')]){_0x20d69f=path['join'](config[_0xfbb9('0x73')],_0xfbb9('0x74'),util[_0xfbb9('0x75')]('transcript-%s.txt',Date['now']()));_0x4b8ef1['body']['pathTranscript']=_0x20d69f;}return db['ChatInteraction'][_0xfbb9('0x46')]({'where':{'id':_0x4b8ef1[_0xfbb9('0x3a')]['id']},'include':[{'model':db[_0xfbb9('0x5a')],'as':_0xfbb9('0x76'),'include':[{'model':db[_0xfbb9('0x77')],'as':'User'}]}]})[_0xfbb9('0x28')](handleEntityNotFound(_0x13c42f,null))['then'](saveUpdates(_0x4b8ef1['body'],null))[_0xfbb9('0x28')](function(_0x2dce65){if(_0x2dce65){_0x11baaa=_0x2dce65;return db[_0xfbb9('0x78')][_0xfbb9('0x46')]({'where':{'id':_0x11baaa[_0xfbb9('0x4a')]}});}})[_0xfbb9('0x28')](function(_0x4e539e){if(_0x4e539e){_0x364128=_0x4e539e;return db['CmContact'][_0xfbb9('0x46')]({'where':{'id':_0x11baaa[_0xfbb9('0x79')]}});}})['then'](function(_0x43efba){if(_0x43efba){if(_0x20d69f){var _0xaabb3f=null;for(var _0x483b9d=0x1;_0x483b9d<_0x11baaa['Messages'][_0xfbb9('0x43')];++_0x483b9d){_0xaabb3f=_0x11baaa['Messages'][_0x483b9d];var _0x57d701=_0xaabb3f[_0xfbb9('0x61')]?util[_0xfbb9('0x75')](_0xfbb9('0x7a'),_0x364128['agentAlias'],_0xaabb3f['UserId']):_0xfbb9('0x7b');var _0x47074d=_0x4b8ef1[_0xfbb9('0x2f')][_0xfbb9('0x7c')]||util[_0xfbb9('0x75')]('%s%d','Visitor',_0xaabb3f[_0xfbb9('0x79')]);switch(_0x364128[_0xfbb9('0x7d')]){case _0xfbb9('0x7e'):_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?util['format'](_0xfbb9('0x7a'),_0x364128[_0xfbb9('0x7f')],_0xaabb3f[_0xfbb9('0x61')]):_0xfbb9('0x7b');break;case _0xfbb9('0x80'):_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?_0xaabb3f['User'][_0xfbb9('0x81')]||_0xaabb3f[_0xfbb9('0x77')][_0xfbb9('0x4f')]:_0xfbb9('0x7b');break;case _0xfbb9('0x82'):_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?_0xaabb3f[_0xfbb9('0x77')][_0xfbb9('0x4f')]:_0xfbb9('0x7b');break;default:_0x57d701=_0xaabb3f[_0xfbb9('0x61')]?util['format'](_0xfbb9('0x7a'),_0x364128['agentAlias'],_0xaabb3f['UserId']):_0xfbb9('0x7b');}var _0x12e6b8=util[_0xfbb9('0x75')](_0xfbb9('0x83'),moment(_0xaabb3f[_0xfbb9('0x84')])[_0xfbb9('0x75')](_0xfbb9('0x85')),_0xaabb3f[_0xfbb9('0x86')]==='in'?_0x47074d:_0x57d701,_0xaabb3f[_0xfbb9('0x2f')]);if(!_0xaabb3f[_0xfbb9('0x87')]){fs[_0xfbb9('0x88')](_0x20d69f,_0x12e6b8);}}return db[_0xfbb9('0x89')][_0xfbb9('0x6d')]({'where':{'service':!![]},'include':[{'model':db[_0xfbb9('0x8a')],'as':_0xfbb9('0x8b'),'raw':!![],'include':[{'model':db[_0xfbb9('0x8c')],'as':_0xfbb9('0x8c'),'raw':!![]}]}]});}}})[_0xfbb9('0x28')](function(_0x3b58e3){if(!_0x3b58e3||!_0x3b58e3[_0xfbb9('0x8b')]||!_0x4b8ef1[_0xfbb9('0x2f')])return _0x11baaa;var _0x223d4a=_0x3b58e3[_0xfbb9('0x8d')]();return respondWithRpcPromise(_0xfbb9('0x8e'),_0xfbb9('0x8f'),{'account':_0x223d4a,'message':{'from':util['format'](_0xfbb9('0x90'),_0x3b58e3['name'],_0x3b58e3[_0xfbb9('0x91')]||_0x3b58e3[_0xfbb9('0x8b')][_0xfbb9('0x38')]),'to':_0x4b8ef1[_0xfbb9('0x2f')][_0xfbb9('0x72')],'subject':_0xfbb9('0x92'),'text':util[_0xfbb9('0x75')](_0xfbb9('0x93'),_0x4b8ef1[_0xfbb9('0x2f')]['mailTranscript']),'attachments':[{'path':_0x20d69f}]}})['then'](function(){return _0x11baaa;})['catch'](function(_0x3475d2){logger[_0xfbb9('0x18')](_0x3475d2);});})['then'](respondWithStatusCode(_0x13c42f,0xc8))['catch'](handleError(_0x13c42f,null));};exports[_0xfbb9('0x94')]=function(_0x500578,_0x18cd0e){return db['ChatMessage'][_0xfbb9('0x46')]({'where':{'id':_0x500578[_0xfbb9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x18cd0e,null))[_0xfbb9('0x28')](function(_0x411bd8){if(_0x411bd8){return _0x411bd8[_0xfbb9('0x94')](_0x500578[_0xfbb9('0x2f')][_0xfbb9('0x95')],_[_0xfbb9('0x96')](_0x500578[_0xfbb9('0x2f')],[_0xfbb9('0x95'),'id'])||{});}})[_0xfbb9('0x28')](respondWithResult(_0x18cd0e,null))[_0xfbb9('0x1c')](handleError(_0x18cd0e,null));};exports['getMessages']=function(_0x3efac8,_0x188ce1){var _0x40aada={'raw':![],'where':{}};var _0x362b57={};var _0x680500={'count':0x0,'rows':[]};return db[_0xfbb9('0x34')][_0xfbb9('0x6d')]({'where':{'id':_0x3efac8[_0xfbb9('0x3a')]['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x188ce1,null))[_0xfbb9('0x28')](function(_0x4ed886){if(_0x4ed886){_0x362b57[_0xfbb9('0x3b')]=_[_0xfbb9('0x3e')](db['ChatMessage'][_0xfbb9('0x3c')]);_0x362b57['query']=_[_0xfbb9('0x3e')](_0x3efac8['query']);_0x362b57[_0xfbb9('0x3f')]=_[_0xfbb9('0x40')](_0x362b57[_0xfbb9('0x3b')],_0x362b57[_0xfbb9('0x3d')]);_0x40aada[_0xfbb9('0x41')]=_['intersection'](_0x362b57[_0xfbb9('0x3b')],qs[_0xfbb9('0x42')](_0x3efac8['query'][_0xfbb9('0x42')]));_0x40aada[_0xfbb9('0x41')]=_0x40aada[_0xfbb9('0x41')][_0xfbb9('0x43')]?_0x40aada[_0xfbb9('0x41')]:_0x362b57[_0xfbb9('0x3b')];if(!_0x3efac8['query'][_0xfbb9('0x97')](_0xfbb9('0x98'))){_0x40aada[_0xfbb9('0x23')]=qs[_0xfbb9('0x23')](_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x23')]);_0x40aada[_0xfbb9('0x21')]=qs[_0xfbb9('0x21')](_0x3efac8[_0xfbb9('0x3d')]['offset']);}_0x40aada[_0xfbb9('0x99')]=qs[_0xfbb9('0x9a')](_0x3efac8[_0xfbb9('0x3d')]['sort']);_0x40aada[_0xfbb9('0x9b')]=qs[_0xfbb9('0x3f')](_['pick'](_0x3efac8[_0xfbb9('0x3d')],_0x362b57[_0xfbb9('0x3f')]));_0x40aada[_0xfbb9('0x9b')][_0xfbb9('0x9c')]=_0x4ed886['id'];if(_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9d')]){_0x40aada[_0xfbb9('0x9b')]=_[_0xfbb9('0x2e')](_0x40aada['where'],{'$or':_['map'](_0x40aada[_0xfbb9('0x41')],function(_0x45a37d){var _0x453c74={};_0x453c74[_0x45a37d]={'$like':'%'+_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9d')]+'%'};return _0x453c74;})});}if(_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9e')]){var _0x3500cd=_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x9e')][_0xfbb9('0x9f')](',');var _0x3c3104={};_0x3c3104[_0x3500cd[0x0]]={'$gte':moment(_0x3500cd[0x1])[_0xfbb9('0x75')](_0xfbb9('0xa0'))};_0x40aada[_0xfbb9('0x9b')]=_[_0xfbb9('0x2e')](_0x40aada['where'],_0x3c3104);}_0x40aada=_[_0xfbb9('0x2e')]({},_0x40aada,_0x3efac8['options']);return db[_0xfbb9('0x5a')][_0xfbb9('0x24')]({'where':_0x40aada[_0xfbb9('0x9b')]})[_0xfbb9('0x28')](function(_0x5c411c){_0x680500[_0xfbb9('0x24')]=_0x5c411c;if(_0x3efac8[_0xfbb9('0x3d')][_0xfbb9('0x44')]){_0x40aada['include']=[{'all':!![]}];}return db[_0xfbb9('0x5a')][_0xfbb9('0xa1')](_0x40aada);})['then'](function(_0x708c84){_0x680500[_0xfbb9('0xa2')]=_0x708c84;return _0x680500;});}})[_0xfbb9('0x28')](respondWithFilteredResult(_0x188ce1,_0x40aada))[_0xfbb9('0x1c')](handleError(_0x188ce1,null));};exports[_0xfbb9('0xa3')]=function(_0x1b7a3f,_0x314296){var _0x2a8976={'where':{}},_0x344def={},_0x441631={'count':0x0,'rows':[]};return db[_0xfbb9('0x34')][_0xfbb9('0x6d')]({'where':{'id':_0x1b7a3f[_0xfbb9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x314296,null))[_0xfbb9('0x28')](function(_0x2ffeb7){if(_0x2ffeb7){_0x344def['model']=_['keys'](db[_0xfbb9('0x5a')]['rawAttributes']);_0x344def[_0xfbb9('0x3d')]=_['keys'](_0x1b7a3f['query']);_0x344def[_0xfbb9('0x3f')]=_[_0xfbb9('0x40')](_0x344def[_0xfbb9('0x3b')],_0x344def['query']);_0x2a8976[_0xfbb9('0x41')]=_['intersection'](_0x344def[_0xfbb9('0x3b')],qs[_0xfbb9('0x42')](_0x1b7a3f['query'][_0xfbb9('0x42')]));_0x2a8976[_0xfbb9('0x41')]=_0x2a8976['attributes'][_0xfbb9('0x43')]?_0x2a8976[_0xfbb9('0x41')]:_0x344def[_0xfbb9('0x3b')];if(!_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x97')](_0xfbb9('0x98'))){_0x2a8976[_0xfbb9('0x23')]=qs['limit'](_0x1b7a3f['query']['limit']);_0x2a8976[_0xfbb9('0x21')]=qs[_0xfbb9('0x21')](_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x21')]);}_0x2a8976[_0xfbb9('0x99')]=qs[_0xfbb9('0x9a')](_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x9a')]);_0x2a8976['where']=qs[_0xfbb9('0x3f')](_[_0xfbb9('0xa4')](_0x1b7a3f[_0xfbb9('0x3d')],_0x344def[_0xfbb9('0x3f')]));_0x2a8976[_0xfbb9('0x9b')][_0xfbb9('0x9c')]=_0x2ffeb7['id'];if(_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x9d')]){_0x2a8976[_0xfbb9('0x9b')]=_[_0xfbb9('0x2e')](_0x2a8976[_0xfbb9('0x9b')],{'$or':_[_0xfbb9('0x33')](_0x2a8976[_0xfbb9('0x41')],function(_0x358c57){var _0x20a755={};_0x20a755[_0x358c57]={'$like':'%'+_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0x9d')]+'%'};return _0x20a755;})});}_0x2a8976[_0xfbb9('0x9b')][_0xfbb9('0x87')]=![];if(_0x1b7a3f[_0xfbb9('0x3d')]['id']){_0x2a8976['where']['id']={'$gt':_0x1b7a3f['query']['id']};}_0x2a8976=_['merge']({},_0x2a8976,_0x1b7a3f[_0xfbb9('0xa5')]);return db[_0xfbb9('0x5a')][_0xfbb9('0x24')]({'where':_0x2a8976[_0xfbb9('0x9b')]})[_0xfbb9('0x28')](function(_0x28ed93){_0x441631[_0xfbb9('0x24')]=_0x28ed93;_0x2a8976[_0xfbb9('0x45')]=[];if(_0x1b7a3f[_0xfbb9('0x3d')][_0xfbb9('0xa6')]){_0x2a8976['include'][_0xfbb9('0xa7')]({'model':db[_0xfbb9('0x77')],'as':'User','attributes':['id',_0xfbb9('0x4f'),_0xfbb9('0x81')]});}if(_0x1b7a3f['query']['includeAll']){_0x2a8976[_0xfbb9('0x45')]=[{'all':!![]}];}return db[_0xfbb9('0x5a')]['findAll'](_0x2a8976);})['then'](function(_0x14f55e){_0x441631[_0xfbb9('0xa2')]=_0x14f55e;return _0x441631;});}})['then'](respondWithFilteredResult(_0x314296,_0x2a8976))[_0xfbb9('0x1c')](handleError(_0x314296,null));};exports[_0xfbb9('0xa8')]=function(_0x4b76d1,_0x540706){return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x4b76d1[_0xfbb9('0x3a')]['id']}})[_0xfbb9('0x28')](handleEntityNotFound(_0x540706,null))[_0xfbb9('0x28')](function(_0x877837){if(_0x877837){return _0x877837[_0xfbb9('0xa9')](_0x4b76d1[_0xfbb9('0x2f')][_0xfbb9('0x95')],_['omit'](_0x4b76d1[_0xfbb9('0x2f')],[_0xfbb9('0x95'),'id'])||{})[_0xfbb9('0xaa')](function(){return db['Tag'][_0xfbb9('0xa1')]({'attributes':['id',_0xfbb9('0x2b'),_0xfbb9('0xab')],'where':{'id':_0x4b76d1[_0xfbb9('0x2f')][_0xfbb9('0x95')]}});})[_0xfbb9('0x28')](function(_0x1efde0){socket[_0xfbb9('0xac')](_0xfbb9('0xad'),{'id':Number(_0x4b76d1['params']['id']),'tags':_0x1efde0||[]});return{'id':Number(_0x4b76d1[_0xfbb9('0x3a')]['id']),'tags':_0x1efde0||[]};});}})[_0xfbb9('0x28')](respondWithResult(_0x540706,null))[_0xfbb9('0x1c')](handleError(_0x540706,null));};exports['removeTags']=function(_0x469b24,_0x449e5f){return db[_0xfbb9('0x34')]['find']({'where':{'id':_0x469b24[_0xfbb9('0x3a')]['id']}})['then'](handleEntityNotFound(_0x449e5f,null))['then'](function(_0x1e1332){if(_0x1e1332){return _0x1e1332['removeTags'](_0x469b24[_0xfbb9('0x3d')]['ids']);}})[_0xfbb9('0x28')](respondWithStatusCode(_0x449e5f,null))['catch'](handleError(_0x449e5f,null));};exports[_0xfbb9('0xae')]=function(_0x5d09ba,_0xae875b){var _0x21c908=moment()['unix']()[_0xfbb9('0xaf')]();var _0x4ebb17=path[_0xfbb9('0x6f')](config[_0xfbb9('0x73')],_0xfbb9('0xb0'),_0xfbb9('0xb1'),_0xfbb9('0xb2'));var _0x5c7e0a=path[_0xfbb9('0x6f')](config['root'],_0xfbb9('0xb0'),_0xfbb9('0xb1'),_0xfbb9('0xb3'));var _0x5e11e3=path['join'](_0x4ebb17,_0x21c908);var _0x409a4c=util[_0xfbb9('0x75')]('transcript-%d-%s.zip',_0x5d09ba[_0xfbb9('0x3a')]['id'],_0x21c908);var _0x39c35d=path['join'](_0x4ebb17,_0x409a4c);var _0x36deaf=[];_0x36deaf[_0xfbb9('0xa7')]({'model':db['User'],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x36deaf[_0xfbb9('0xa7')]({'model':db[_0xfbb9('0xb4')],'as':'Contact','attributes':['id',_0xfbb9('0xb5'),_0xfbb9('0xb6')],'raw':!![]});if(_0x5d09ba[_0xfbb9('0x3d')]['attachments']){_0x36deaf[_0xfbb9('0xa7')]({'model':db[_0xfbb9('0x69')],'as':_0xfbb9('0x69'),'raw':!![]});}var _0x494da5=[{'model':db['ChatMessage'],'as':_0xfbb9('0x76'),'attributes':['id',_0xfbb9('0x2f'),_0xfbb9('0x84'),_0xfbb9('0x86'),'secret',_0xfbb9('0xb7')],'include':_0x36deaf}];_0x494da5[_0xfbb9('0xa7')]({'model':db['ChatWebsite'],'as':_0xfbb9('0xb8'),'attributes':['id',_0xfbb9('0x2b')]});_0x494da5[_0xfbb9('0xa7')]({'model':db[_0xfbb9('0x77')],'as':'Owner','attributes':['id',_0xfbb9('0x4f')]});return db[_0xfbb9('0x34')][_0xfbb9('0x46')]({'where':{'id':_0x5d09ba[_0xfbb9('0x3a')]['id']},'include':_0x494da5})[_0xfbb9('0x28')](handleEntityNotFound(_0xae875b,null))[_0xfbb9('0x28')](function(_0x523051){if(_0x523051){var _0x57141b=_0x523051['get']({'plain':!![]});fs['mkdirSync'](_0x5e11e3);var _0x28fdc2={'channel':_0xfbb9('0xb9'),'account':_0x57141b['Account']['name'],'agent':_0x57141b['Owner']?_0x57141b[_0xfbb9('0xba')]['fullname']:_0xfbb9('0xbb'),'createdAt':moment(_0x57141b['createdAt'])[_0xfbb9('0x75')](_0xfbb9('0xa0'))[_0xfbb9('0xaf')](),'closedAt':_0x57141b[_0xfbb9('0x6b')]?moment(_0x57141b[_0xfbb9('0xbc')])[_0xfbb9('0x75')](_0xfbb9('0xa0'))[_0xfbb9('0xaf')]():'','disposition':_0x57141b[_0xfbb9('0x63')],'chatInfo':{'browser':_0x57141b[_0xfbb9('0xbd')],'os':_0x57141b['osName'],'referer':_0x57141b['referer'],'customerIp':_0x57141b[_0xfbb9('0xbe')],'customerPort':_0x57141b[_0xfbb9('0xbf')]?_0x57141b[_0xfbb9('0xbf')]:'N.A.'},'messages':_(_0x57141b[_0xfbb9('0x76')])['tail']()[_0xfbb9('0x9d')]({'secret':![]})['map'](function(_0x28c870){if(_0x28c870[_0xfbb9('0x69')]){var _0x214696=path[_0xfbb9('0x6f')](_0x5c7e0a,_0x28c870[_0xfbb9('0x69')][_0xfbb9('0x66')]);if(fs[_0xfbb9('0xc0')](_0x214696)){fs[_0xfbb9('0xc1')](_0x214696)[_0xfbb9('0xc2')](fs['createWriteStream'](path['join'](_0x5e11e3,_0x28c870[_0xfbb9('0x69')]['basename'])));}}return{'date':moment(_0x28c870[_0xfbb9('0x84')])[_0xfbb9('0x75')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfbb9('0xaf')](),'sender':_0x28c870['direction']===_0xfbb9('0x59')?_0x28c870['User']?_0x28c870[_0xfbb9('0x77')][_0xfbb9('0x4f')]:_0xfbb9('0x7b'):_0x28c870[_0xfbb9('0x5e')][_0xfbb9('0xb5')]+(_0x28c870[_0xfbb9('0x5e')][_0xfbb9('0xb6')]?'\x20'+_0x28c870[_0xfbb9('0x5e')][_0xfbb9('0xb6')]:''),'body':_0x28c870['Attachment']?_0x28c870[_0xfbb9('0x69')][_0xfbb9('0x66')]:_0x28c870[_0xfbb9('0x2f')],'direction':_0x28c870['direction']===_0xfbb9('0x59')?'A':'C','secret':_0x28c870[_0xfbb9('0x87')],'read':_0x28c870[_0xfbb9('0xb7')],'attachment':_0x28c870[_0xfbb9('0x69')]};})[_0xfbb9('0xc3')]()};return ejs[_0xfbb9('0xc4')](path[_0xfbb9('0x6f')](config['root'],'server',_0xfbb9('0xc5'),_0xfbb9('0xc6')),{'interaction':_0x28fdc2})[_0xfbb9('0x28')](function(_0x811392){var _0x4ae59c=path[_0xfbb9('0x6f')](_0x5e11e3,'transcript-'+_0x57141b['id']+'-'+_0x21c908+_0xfbb9('0xc7'));var _0x399b9a={'path':_0x4ae59c,'channel':'Chat','interactionId':_0x57141b['id']};return pdf[_0xfbb9('0xc8')](_0x811392,_0x399b9a);})['then'](function(){return new Promise(function(_0x4cecde,_0x4a3114){zipdir(_0x5e11e3,{'saveTo':_0x39c35d},function(_0x106737,_0x5dbe3c){if(_0x106737)return _0x4a3114(_0x106737);return _0x4cecde(_0x5dbe3c);});})[_0xfbb9('0x28')](function(){return new BPromise(function(_0x53208e,_0x256f6c){rimraf(_0x5e11e3,function(_0x2dbd34){if(_0x2dbd34)_0x256f6c(_0x2dbd34);return _0x53208e();});});})[_0xfbb9('0x28')](function(){return _0xae875b[_0xfbb9('0xae')](_0x39c35d,_0x409a4c,function(_0x5dd0b2){if(_0x5dd0b2){logger[_0xfbb9('0x18')](_0xfbb9('0xc9'),_0x5dd0b2);}else{fs[_0xfbb9('0xca')](_0x39c35d);}});});});}else{return _0xae875b[_0xfbb9('0x1d')](0xc8);}})['catch'](handleError(_0xae875b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 959730a..1560322 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 _0x822f=['Users','map','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','save','update','remove','then','setDataValue'];(function(_0x406739,_0x2d91cb){var _0x251490=function(_0x39de53){while(--_0x39de53){_0x406739['push'](_0x406739['shift']());}};_0x251490(++_0x2d91cb);}(_0x822f,0x17f));var _0xf822=function(_0x514410,_0x1c7b26){_0x514410=_0x514410-0x0;var _0x2c5ee2=_0x822f[_0x514410];return _0x2c5ee2;};'use strict';var EventEmitter=require(_0xf822('0x0'));var ChatInteraction=require(_0xf822('0x1'))['db'][_0xf822('0x2')];var ChatMessage=require(_0xf822('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf822('0x3'),'afterUpdate':_0xf822('0x4'),'afterDestroy':_0xf822('0x5')};function emitEvent(_0x56bcd0){return function(_0x49b9b7,_0x10a181,_0x385176){_0x49b9b7['getUsers']({'attributes':['id'],'raw':!![]})[_0xf822('0x6')](function(_0x375cc2){_0x49b9b7[_0xf822('0x7')](_0xf822('0x8'),_0x375cc2[_0xf822('0x9')](function(_0x4bcbf3){return{'id':_0x4bcbf3['id']};}));return ChatMessage[_0xf822('0xa')]({'where':{'ChatInteractionId':_0x49b9b7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf822('0x6')](function(_0x8e3f1f){_0x49b9b7[_0xf822('0x7')](_0xf822('0xb'),_0x8e3f1f[_0xf822('0xc')]);ChatInteractionEvents[_0xf822('0xd')](_0x56bcd0+':'+_0x49b9b7['id'],_0x49b9b7);ChatInteractionEvents[_0xf822('0xd')](_0x56bcd0,_0x49b9b7);_0x385176(null);})['catch'](_0x385176(null));};}for(var e in events){if(events[_0xf822('0xe')](e)){var event=events[e];ChatInteraction[_0xf822('0xf')](e,emitEvent(event));}}module[_0xf822('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0x5cd4=['then','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','remove','getUsers','setDataValue','Users','findAll'];(function(_0x474653,_0x223a06){var _0x184990=function(_0x43af56){while(--_0x43af56){_0x474653['push'](_0x474653['shift']());}};_0x184990(++_0x223a06);}(_0x5cd4,0xd3));var _0x45cd=function(_0x7107de,_0x1be6e9){_0x7107de=_0x7107de-0x0;var _0x3b0349=_0x5cd4[_0x7107de];return _0x3b0349;};'use strict';var EventEmitter=require(_0x45cd('0x0'));var ChatInteraction=require(_0x45cd('0x1'))['db'][_0x45cd('0x2')];var ChatMessage=require(_0x45cd('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x45cd('0x3')](0x0);var events={'afterCreate':_0x45cd('0x4'),'afterUpdate':'update','afterDestroy':_0x45cd('0x5')};function emitEvent(_0x2f2774){return function(_0x544c57,_0x22f019,_0x4afaf9){_0x544c57[_0x45cd('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4bc763){_0x544c57[_0x45cd('0x7')](_0x45cd('0x8'),_0x4bc763['map'](function(_0x497a5c){return{'id':_0x497a5c['id']};}));return ChatMessage[_0x45cd('0x9')]({'where':{'ChatInteractionId':_0x544c57['id'],'direction':'in','read':![]},'raw':!![]});})[_0x45cd('0xa')](function(_0x2bbd30){_0x544c57[_0x45cd('0x7')](_0x45cd('0xb'),_0x2bbd30[_0x45cd('0xc')]);ChatInteractionEvents['emit'](_0x2f2774+':'+_0x544c57['id'],_0x544c57);ChatInteractionEvents['emit'](_0x2f2774,_0x544c57);_0x4afaf9(null);})[_0x45cd('0xd')](_0x4afaf9(null));};}for(var e in events){if(events[_0x45cd('0xe')](e)){var event=events[e];ChatInteraction[_0x45cd('0xf')](e,emitEvent(event));}}module[_0x45cd('0x10')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index ccc6010..e3119c2 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 _0xdba3=['ChatInteraction','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','define'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdba3,0x14c));var _0x3dba=function(_0x17986f,_0x3584bc){_0x17986f=_0x17986f-0x0;var _0x25699f=_0xdba3[_0x17986f];return _0x25699f;};'use strict';var _=require(_0x3dba('0x0'));var util=require(_0x3dba('0x1'));var logger=require('../../config/logger')(_0x3dba('0x2'));var moment=require(_0x3dba('0x3'));var BPromise=require('bluebird');var rp=require(_0x3dba('0x4'));var fs=require('fs');var path=require(_0x3dba('0x5'));var rimraf=require(_0x3dba('0x6'));var config=require(_0x3dba('0x7'));var attributes=require(_0x3dba('0x8'));module['exports']=function(_0xe4945d,_0x2e67c6){return _0xe4945d[_0x3dba('0x9')](_0x3dba('0xa'),attributes,{'tableName':_0x3dba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19f649,_0x229f0d,_0x4236c6){if(_0x19f649['changed'](_0x3dba('0xc'))){_0x19f649[_0x3dba('0xd')]=moment()[_0x3dba('0xe')](_0x3dba('0xf'));}_0x4236c6(null,_0x19f649);}},'charset':_0x3dba('0x10'),'collate':_0x3dba('0x11')});}; \ No newline at end of file +var _0xc9e2=['ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports'];(function(_0x3f3f75,_0x5e215f){var _0x322635=function(_0x1ff524){while(--_0x1ff524){_0x3f3f75['push'](_0x3f3f75['shift']());}};_0x322635(++_0x5e215f);}(_0xc9e2,0xf8));var _0x2c9e=function(_0x45c767,_0x8800d5){_0x45c767=_0x45c767-0x0;var _0x3e1344=_0xc9e2[_0x45c767];return _0x3e1344;};'use strict';var _=require('lodash');var util=require(_0x2c9e('0x0'));var logger=require(_0x2c9e('0x1'))(_0x2c9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2c9e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2c9e('0x4'));var config=require(_0x2c9e('0x5'));var attributes=require('./chatInteraction.attributes');module[_0x2c9e('0x6')]=function(_0x14f479,_0x4ecc30){return _0x14f479['define'](_0x2c9e('0x7'),attributes,{'tableName':_0x2c9e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5741e5,_0xcea004,_0x4f9d3f){if(_0x5741e5[_0x2c9e('0x9')](_0x2c9e('0xa'))){_0x5741e5[_0x2c9e('0xb')]=moment()[_0x2c9e('0xc')](_0x2c9e('0xd'));}_0x4f9d3f(null,_0x5741e5);}},'charset':_0x2c9e('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index e72c7fb..ded7462 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 _0x9880=['spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','where','attributes','limit','AddTagsToChatInteraction','find','then','addTags','body'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x9880,0x173));var _0x0988=function(_0x483102,_0x54e93d){_0x483102=_0x483102-0x0;var _0x5cc885=_0x9880[_0x483102];return _0x5cc885;};'use strict';var _=require(_0x0988('0x0'));var util=require(_0x0988('0x1'));var moment=require(_0x0988('0x2'));var BPromise=require(_0x0988('0x3'));var rs=require(_0x0988('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0988('0x5'))['db'];var utils=require(_0x0988('0x6'));var logger=require('../../config/logger')(_0x0988('0x7'));var config=require('../../config/environment');var jayson=require(_0x0988('0x8'));var client=jayson[_0x0988('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0988('0xa')](config[_0x0988('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0988('0xc'))(new Redis(config['redis']));require(_0x0988('0xd'))[_0x0988('0xe')](socket);function respondWithRpcPromise(_0x475214,_0x1a0dd8,_0x394d34){return new BPromise(function(_0x259e98,_0x336798){return client[_0x0988('0xf')](_0x475214,_0x394d34)['then'](function(_0x313385){logger[_0x0988('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x1a0dd8,_0x0988('0x11'));logger[_0x0988('0x12')](_0x0988('0x13'),_0x1a0dd8,_0x0988('0x11'),JSON[_0x0988('0x14')](_0x313385));if(_0x313385[_0x0988('0x15')]){if(_0x313385[_0x0988('0x15')][_0x0988('0x16')]===0x1f4){logger[_0x0988('0x15')](_0x0988('0x17'),_0x1a0dd8,_0x313385[_0x0988('0x15')][_0x0988('0x18')]);return _0x336798(_0x313385[_0x0988('0x15')][_0x0988('0x18')]);}logger[_0x0988('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x1a0dd8,_0x313385[_0x0988('0x15')][_0x0988('0x18')]);return _0x259e98(_0x313385[_0x0988('0x15')][_0x0988('0x18')]);}else{logger[_0x0988('0x10')](_0x0988('0x17'),_0x1a0dd8,_0x0988('0x11'));_0x259e98(_0x313385[_0x0988('0x19')]['message']);}})[_0x0988('0x1a')](function(_0x4ae282){logger[_0x0988('0x15')](_0x0988('0x17'),_0x1a0dd8,_0x4ae282);_0x336798(_0x4ae282);});});}exports[_0x0988('0x1b')]=function(_0x5af572){var _0x564a3f=this;return new Promise(function(_0x206c2b,_0x2dc580){return db[_0x0988('0x1c')][_0x0988('0x1d')](_0x5af572['body'],{'raw':_0x5af572['options']?_0x5af572[_0x0988('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5af572[_0x0988('0x1e')]?_0x5af572[_0x0988('0x1e')][_0x0988('0x1f')]||null:null,'attributes':_0x5af572[_0x0988('0x1e')]?_0x5af572['options'][_0x0988('0x20')]||null:null,'limit':_0x5af572[_0x0988('0x1e')]?_0x5af572[_0x0988('0x1e')][_0x0988('0x21')]||null:null})['then'](function(_0x131897){logger[_0x0988('0x10')](_0x0988('0x1b'),_0x5af572);logger[_0x0988('0x12')](_0x0988('0x1b'),_0x5af572,JSON[_0x0988('0x14')](_0x131897));_0x206c2b(_0x131897);})[_0x0988('0x1a')](function(_0x2143bf){logger['error'](_0x0988('0x1b'),_0x2143bf[_0x0988('0x18')],_0x5af572);_0x2dc580(_0x564a3f[_0x0988('0x15')](0x1f4,_0x2143bf[_0x0988('0x18')]));});});};exports[_0x0988('0x22')]=function(_0x3374a3){return new Promise(function(_0x1e5345,_0x310441){return db[_0x0988('0x1c')][_0x0988('0x23')]({'where':_0x3374a3[_0x0988('0x1e')]?_0x3374a3[_0x0988('0x1e')][_0x0988('0x1f')]||null:null})[_0x0988('0x24')](function(_0x2e32fb){if(_0x2e32fb){return _0x2e32fb[_0x0988('0x25')](_0x3374a3[_0x0988('0x26')]['ids'],_['omit'](_0x3374a3[_0x0988('0x26')],['ids','id'])||{});}})[_0x0988('0x27')](function(_0x58831f){logger[_0x0988('0x10')](_0x0988('0x28'),_0x3374a3);logger[_0x0988('0x12')](_0x0988('0x28'),_0x3374a3,JSON['stringify'](_0x58831f));_0x1e5345(_0x58831f);})[_0x0988('0x1a')](function(_0x5ba770){logger[_0x0988('0x15')]('AddTags',_0x5ba770[_0x0988('0x18')],_0x3374a3);_0x310441(_this[_0x0988('0x15')](0x1f4,_0x5ba770[_0x0988('0x18')]));});});}; \ No newline at end of file +var _0xc474=['./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','raw','options','where','limit','stringify','find','addTags','body','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x5a5879,_0xa14804){var _0x4fa85e=function(_0x3a4461){while(--_0x3a4461){_0x5a5879['push'](_0x5a5879['shift']());}};_0x4fa85e(++_0xa14804);}(_0xc474,0x15b));var _0x4c47=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xc474[_0x5f0089];return _0x193892;};'use strict';var _=require('lodash');var util=require(_0x4c47('0x0'));var moment=require(_0x4c47('0x1'));var BPromise=require(_0x4c47('0x2'));var rs=require(_0x4c47('0x3'));var fs=require('fs');var Redis=require(_0x4c47('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c47('0x5'));var logger=require(_0x4c47('0x6'))(_0x4c47('0x7'));var config=require(_0x4c47('0x8'));var jayson=require(_0x4c47('0x9'));var client=jayson[_0x4c47('0xa')][_0x4c47('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x4c47('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4c47('0xd'))['register'](socket);function respondWithRpcPromise(_0x14f03,_0x56351b,_0x415d4e){return new BPromise(function(_0x363105,_0x596d97){return client[_0x4c47('0xe')](_0x14f03,_0x415d4e)[_0x4c47('0xf')](function(_0x412f7f){logger[_0x4c47('0x10')](_0x4c47('0x11'),_0x56351b,_0x4c47('0x12'));logger[_0x4c47('0x13')](_0x4c47('0x14'),_0x56351b,'request\x20sent',JSON['stringify'](_0x412f7f));if(_0x412f7f[_0x4c47('0x15')]){if(_0x412f7f[_0x4c47('0x15')][_0x4c47('0x16')]===0x1f4){logger['error'](_0x4c47('0x11'),_0x56351b,_0x412f7f['error'][_0x4c47('0x17')]);return _0x596d97(_0x412f7f[_0x4c47('0x15')][_0x4c47('0x17')]);}logger[_0x4c47('0x15')](_0x4c47('0x11'),_0x56351b,_0x412f7f[_0x4c47('0x15')][_0x4c47('0x17')]);return _0x363105(_0x412f7f['error'][_0x4c47('0x17')]);}else{logger[_0x4c47('0x10')](_0x4c47('0x11'),_0x56351b,_0x4c47('0x12'));_0x363105(_0x412f7f[_0x4c47('0x18')]['message']);}})[_0x4c47('0x19')](function(_0x4bdec5){logger[_0x4c47('0x15')](_0x4c47('0x11'),_0x56351b,_0x4bdec5);_0x596d97(_0x4bdec5);});});}exports[_0x4c47('0x1a')]=function(_0x2d3578){var _0x17c0f2=this;return new Promise(function(_0x5e1000,_0x4e794b){return db[_0x4c47('0x1b')][_0x4c47('0x1c')](_0x2d3578['body'],{'raw':_0x2d3578['options']?_0x2d3578['options'][_0x4c47('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d3578['options']?_0x2d3578[_0x4c47('0x1e')][_0x4c47('0x1f')]||null:null,'attributes':_0x2d3578[_0x4c47('0x1e')]?_0x2d3578[_0x4c47('0x1e')]['attributes']||null:null,'limit':_0x2d3578[_0x4c47('0x1e')]?_0x2d3578[_0x4c47('0x1e')][_0x4c47('0x20')]||null:null})[_0x4c47('0xf')](function(_0x20a47a){logger[_0x4c47('0x10')](_0x4c47('0x1a'),_0x2d3578);logger[_0x4c47('0x13')]('UpdateChatInteraction',_0x2d3578,JSON[_0x4c47('0x21')](_0x20a47a));_0x5e1000(_0x20a47a);})[_0x4c47('0x19')](function(_0x126733){logger[_0x4c47('0x15')](_0x4c47('0x1a'),_0x126733[_0x4c47('0x17')],_0x2d3578);_0x4e794b(_0x17c0f2[_0x4c47('0x15')](0x1f4,_0x126733[_0x4c47('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x1751a5){return new Promise(function(_0x14c8da,_0x5cc2f8){return db[_0x4c47('0x1b')][_0x4c47('0x22')]({'where':_0x1751a5[_0x4c47('0x1e')]?_0x1751a5[_0x4c47('0x1e')][_0x4c47('0x1f')]||null:null})['then'](function(_0x5e51d8){if(_0x5e51d8){return _0x5e51d8[_0x4c47('0x23')](_0x1751a5[_0x4c47('0x24')]['ids'],_[_0x4c47('0x25')](_0x1751a5[_0x4c47('0x24')],['ids','id'])||{});}})[_0x4c47('0x26')](function(_0x1aa752){logger[_0x4c47('0x10')]('AddTags',_0x1751a5);logger['debug']('AddTags',_0x1751a5,JSON['stringify'](_0x1aa752));_0x14c8da(_0x1aa752);})[_0x4c47('0x19')](function(_0x1c6b9d){logger['error'](_0x4c47('0x27'),_0x1c6b9d[_0x4c47('0x17')],_0x1751a5);_0x5cc2f8(_this[_0x4c47('0x15')](0x1f4,_0x1c6b9d['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index b6d06ae..9f38d22 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 _0x4bb7=['save','remove','update','register','length'];(function(_0x405657,_0x5d2317){var _0x5e3e84=function(_0x55d8f2){while(--_0x55d8f2){_0x405657['push'](_0x405657['shift']());}};_0x5e3e84(++_0x5d2317);}(_0x4bb7,0xe6));var _0x74bb=function(_0x2e486d,_0x47d57a){_0x2e486d=_0x2e486d-0x0;var _0x29efca=_0x4bb7[_0x2e486d];return _0x29efca;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x74bb('0x0'),_0x74bb('0x1'),_0x74bb('0x2')];function createListener(_0x51fefd,_0x5b7233){return function(_0x3b4128){_0x5b7233['emit'](_0x51fefd,_0x3b4128);};}function removeListener(_0x44dbf2,_0x49ffce){return function(){ChatInteractionEvents['removeListener'](_0x44dbf2,_0x49ffce);};}exports[_0x74bb('0x3')]=function(_0x733469){for(var _0x2d97b1=0x0,_0x2c624f=events[_0x74bb('0x4')];_0x2d97b1<_0x2c624f;_0x2d97b1++){var _0x4125fb=events[_0x2d97b1];var _0x27ab86=createListener('chatInteraction:'+_0x4125fb,_0x733469);ChatInteractionEvents['on'](_0x4125fb,_0x27ab86);}}; \ No newline at end of file +var _0x453a=['save','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x453a,0x8b));var _0xa453=function(_0x57de35,_0x2ef99a){_0x57de35=_0x57de35-0x0;var _0x2a94eb=_0x453a[_0x57de35];return _0x2a94eb;};'use strict';var ChatInteractionEvents=require(_0xa453('0x0'));var events=[_0xa453('0x1'),'remove','update'];function createListener(_0x964877,_0x382b33){return function(_0x3e09ea){_0x382b33[_0xa453('0x2')](_0x964877,_0x3e09ea);};}function removeListener(_0x24d284,_0x1d24a9){return function(){ChatInteractionEvents[_0xa453('0x3')](_0x24d284,_0x1d24a9);};}exports[_0xa453('0x4')]=function(_0x5bf452){for(var _0x394f72=0x0,_0xd21183=events[_0xa453('0x5')];_0x394f72<_0xd21183;_0x394f72++){var _0x4f83de=events[_0x394f72];var _0xa06651=createListener(_0xa453('0x6')+_0x4f83de,_0x5bf452);ChatInteractionEvents['on'](_0x4f83de,_0xa06651);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 05be906..c28d2e1 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 _0x5e6c=['format','%s-%s','now','replace','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','download','post','create','/:id/vidaoo','createVidaooSession','join','root','server/files/attachments/'];(function(_0x21315c,_0x2f7590){var _0x139461=function(_0x46d949){while(--_0x46d949){_0x21315c['push'](_0x21315c['shift']());}};_0x139461(++_0x2f7590);}(_0x5e6c,0x142));var _0xc5e6=function(_0x422fd1,_0x44ee23){_0x422fd1=_0x422fd1-0x0;var _0x147b15=_0x5e6c[_0x422fd1];return _0x147b15;};'use strict';var multer=require(_0xc5e6('0x0'));var util=require(_0xc5e6('0x1'));var path=require(_0xc5e6('0x2'));var timeout=require(_0xc5e6('0x3'));var express=require(_0xc5e6('0x4'));var router=express['Router']();var fs_extra=require(_0xc5e6('0x5'));var auth=require(_0xc5e6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc5e6('0x7'));var controller=require(_0xc5e6('0x8'));router[_0xc5e6('0x9')]('/',auth[_0xc5e6('0xa')](),controller[_0xc5e6('0xb')]);router[_0xc5e6('0x9')](_0xc5e6('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xc5e6('0x9')](_0xc5e6('0xd'),auth[_0xc5e6('0xe')](),controller['show']);router[_0xc5e6('0x9')](_0xc5e6('0xf'),auth[_0xc5e6('0xe')](),controller['attachmentDownload']);router[_0xc5e6('0x9')](_0xc5e6('0x10'),auth[_0xc5e6('0xa')](),controller[_0xc5e6('0x11')]);router[_0xc5e6('0x9')](_0xc5e6('0x12'),auth[_0xc5e6('0xe')](),controller[_0xc5e6('0x13')]);router['get']('/:id/download',auth[_0xc5e6('0xa')](),controller[_0xc5e6('0x14')]);router[_0xc5e6('0x15')]('/',auth['isAuthenticated'](),controller[_0xc5e6('0x16')]);router[_0xc5e6('0x15')](_0xc5e6('0x17'),auth[_0xc5e6('0xa')](),controller[_0xc5e6('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x55af87,_0x2b021a,_0x558d82){_0x558d82(null,path[_0xc5e6('0x19')](config[_0xc5e6('0x1a')],_0xc5e6('0x1b')));},'filename':function(_0x4c92b4,_0x2fe772,_0x550d81){_0x550d81(null,util[_0xc5e6('0x1c')](_0xc5e6('0x1d'),Date[_0xc5e6('0x1e')](),_0x2fe772['originalname'][_0xc5e6('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0xc5e6('0x20')),controller[_0xc5e6('0x21')]);router[_0xc5e6('0x15')](_0xc5e6('0x10'),auth[_0xc5e6('0xe')](),controller[_0xc5e6('0x22')]);router[_0xc5e6('0x15')](_0xc5e6('0x23'),auth['isAuthenticated'](),interaction[_0xc5e6('0x24')](_0xc5e6('0x25'),_0xc5e6('0x26')),controller[_0xc5e6('0x27')]);router['put'](_0xc5e6('0xd'),auth[_0xc5e6('0xa')](),interaction[_0xc5e6('0x24')](_0xc5e6('0x25'),'chatinteraction:update'),controller['update']);router[_0xc5e6('0x28')](_0xc5e6('0x29'),controller[_0xc5e6('0x2a')]);router[_0xc5e6('0x28')](_0xc5e6('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0xc5e6('0x2c')]);router[_0xc5e6('0x28')](_0xc5e6('0x2d'),controller[_0xc5e6('0x2e')]);router[_0xc5e6('0x2f')]('/:id',auth[_0xc5e6('0xa')](),interaction[_0xc5e6('0x24')](_0xc5e6('0x25'),'chatinteraction:destroy'),controller[_0xc5e6('0x30')]);router[_0xc5e6('0x2f')]('/:id/tags',auth['isAuthenticated'](),controller[_0xc5e6('0x31')]);module['exports']=router; \ No newline at end of file +var _0xb8d6=['chat','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','destroy','removeTags','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','index','get','isAuthenticated','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','attachmentUpload','post','/:id/messages','/:id/tags','chatinteraction:addtags','addTags','put','/:id','tracked'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xb8d6,0x70));var _0x6b8d=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xb8d6[_0x484e36];return _0xafc85d;};'use strict';var multer=require('multer');var util=require(_0x6b8d('0x0'));var path=require(_0x6b8d('0x1'));var timeout=require('connect-timeout');var express=require(_0x6b8d('0x2'));var router=express[_0x6b8d('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6b8d('0x4'));var interaction=require(_0x6b8d('0x5'));var config=require('../../config/environment');var controller=require(_0x6b8d('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x6b8d('0x7')]);router[_0x6b8d('0x8')]('/describe',auth[_0x6b8d('0x9')](),controller['describe']);router[_0x6b8d('0x8')]('/:id',auth[_0x6b8d('0xa')](),controller[_0x6b8d('0xb')]);router[_0x6b8d('0x8')](_0x6b8d('0xc'),auth['isChatInteractionAuthorized'](),controller[_0x6b8d('0xd')]);router[_0x6b8d('0x8')]('/:id/messages',auth[_0x6b8d('0x9')](),controller[_0x6b8d('0xe')]);router[_0x6b8d('0x8')](_0x6b8d('0xf'),auth[_0x6b8d('0xa')](),controller[_0x6b8d('0x10')]);router[_0x6b8d('0x8')](_0x6b8d('0x11'),auth[_0x6b8d('0x9')](),controller[_0x6b8d('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6b8d('0x13')]);router['post'](_0x6b8d('0x14'),auth[_0x6b8d('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x6b8d('0x15')]({'destination':function(_0x307292,_0x657d45,_0x517745){_0x517745(null,path[_0x6b8d('0x16')](config[_0x6b8d('0x17')],_0x6b8d('0x18')));},'filename':function(_0x587d21,_0x422f29,_0x181fe4){_0x181fe4(null,util[_0x6b8d('0x19')](_0x6b8d('0x1a'),Date[_0x6b8d('0x1b')](),_0x422f29[_0x6b8d('0x1c')][_0x6b8d('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x6b8d('0x1e'),upload[_0x6b8d('0x1f')]('file'),controller[_0x6b8d('0x20')]);router[_0x6b8d('0x21')](_0x6b8d('0x22'),auth[_0x6b8d('0xa')](),controller['addMessage']);router[_0x6b8d('0x21')](_0x6b8d('0x23'),auth[_0x6b8d('0x9')](),interaction['tracked']('chat',_0x6b8d('0x24')),controller[_0x6b8d('0x25')]);router[_0x6b8d('0x26')](_0x6b8d('0x27'),auth[_0x6b8d('0x9')](),interaction[_0x6b8d('0x28')](_0x6b8d('0x29'),'chatinteraction:update'),controller['update']);router[_0x6b8d('0x26')]('/:id/custom_update',controller[_0x6b8d('0x2a')]);router[_0x6b8d('0x26')](_0x6b8d('0x2b'),auth['isChatInteractionAuthorized'](),controller[_0x6b8d('0x2c')]);router[_0x6b8d('0x26')](_0x6b8d('0x2d'),controller[_0x6b8d('0x2e')]);router[_0x6b8d('0x2f')](_0x6b8d('0x27'),auth[_0x6b8d('0x9')](),interaction[_0x6b8d('0x28')](_0x6b8d('0x29'),'chatinteraction:destroy'),controller[_0x6b8d('0x30')]);router[_0x6b8d('0x2f')]('/:id/tags',auth[_0x6b8d('0x9')](),controller[_0x6b8d('0x31')]);module[_0x6b8d('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index f4f23a4..70594a7 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 _0x9449=['INTEGER','exports','TEXT','BOOLEAN'];(function(_0x5e4cac,_0x3837d4){var _0x41c450=function(_0x5702be){while(--_0x5702be){_0x5e4cac['push'](_0x5e4cac['shift']());}};_0x41c450(++_0x3837d4);}(_0x9449,0x119));var _0x9944=function(_0x171b10,_0xaada95){_0x171b10=_0x171b10-0x0;var _0x369be0=_0x9449[_0x171b10];return _0x369be0;};'use strict';var Sequelize=require('sequelize');module[_0x9944('0x0')]={'body':{'type':Sequelize[_0x9944('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9944('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9944('0x3')]}}; \ No newline at end of file +var _0x8669=['TEXT','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x8669,0x99));var _0x9866=function(_0x43e372,_0x1cc703){_0x43e372=_0x43e372-0x0;var _0x29d492=_0x8669[_0x43e372];return _0x29d492;};'use strict';var Sequelize=require(_0x9866('0x0'));module[_0x9866('0x1')]={'body':{'type':Sequelize[_0x9866('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x9866('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x9866('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index f5e3266..e797cf4 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 _0x6e72=['get','UserProfileSection','autoAssociation','UserProfileResource','findAll','length','resourceId','push','messages','user','FromId','read','-createdAt','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','rows','catch','show','params','find','create','body','describe','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','User','agent','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues'];(function(_0x345728,_0x30017c){var _0x3dbe1f=function(_0x5f7147){while(--_0x5f7147){_0x345728['push'](_0x345728['shift']());}};_0x3dbe1f(++_0x30017c);}(_0x6e72,0xe9));var _0x26e7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e72[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x26e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26e7('0x1'));var jsonpatch=require(_0x26e7('0x2'));var rp=require(_0x26e7('0x3'));var moment=require(_0x26e7('0x4'));var BPromise=require(_0x26e7('0x5'));var Mustache=require(_0x26e7('0x6'));var util=require(_0x26e7('0x7'));var path=require(_0x26e7('0x8'));var sox=require(_0x26e7('0x9'));var csv=require(_0x26e7('0xa'));var ejs=require(_0x26e7('0xb'));var fs=require('fs');var fs_extra=require(_0x26e7('0xc'));var _=require('lodash');var squel=require(_0x26e7('0xd'));var crypto=require(_0x26e7('0xe'));var jsforce=require(_0x26e7('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x26e7('0xa'));var querystring=require(_0x26e7('0x10'));var Papa=require(_0x26e7('0x11'));var Redis=require('ioredis');var authService=require(_0x26e7('0x12'));var qs=require(_0x26e7('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26e7('0x14'));var logger=require('../../config/logger')(_0x26e7('0x15'));var utils=require(_0x26e7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x26e7('0x17'));var db=require(_0x26e7('0x18'))['db'];config['redis']=_[_0x26e7('0x19')](config[_0x26e7('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x26e7('0x1b'))(new Redis(config[_0x26e7('0x1a')]));require(_0x26e7('0x1c'))[_0x26e7('0x1d')](socket);function respondWithStatusCode(_0x37ec41,_0x4a356b){_0x4a356b=_0x4a356b||0xcc;return function(_0x279469){if(_0x279469){return _0x37ec41[_0x26e7('0x1e')](_0x4a356b);}return _0x37ec41[_0x26e7('0x1f')](_0x4a356b)['end']();};}function respondWithResult(_0x50c543,_0x481c0e){_0x481c0e=_0x481c0e||0xc8;return function(_0x5136b7){if(_0x5136b7){return _0x50c543[_0x26e7('0x1f')](_0x481c0e)[_0x26e7('0x20')](_0x5136b7);}};}function respondWithFilteredResult(_0x4636f5,_0x45489e){return function(_0x1745bd){if(_0x1745bd){var _0x58fc7d=typeof _0x45489e[_0x26e7('0x21')]===_0x26e7('0x22')&&typeof _0x45489e['limit']===_0x26e7('0x22');var _0x305542=_0x1745bd[_0x26e7('0x23')];var _0x372fce=_0x58fc7d?0x0:_0x45489e['offset'];var _0x9b9d68=_0x58fc7d?_0x1745bd['count']:_0x45489e[_0x26e7('0x21')]+_0x45489e['limit'];var _0x47d5b6;if(_0x9b9d68>=_0x305542){_0x9b9d68=_0x305542;_0x47d5b6=0xc8;}else{_0x47d5b6=0xce;}_0x4636f5[_0x26e7('0x1f')](_0x47d5b6);return _0x4636f5['set'](_0x26e7('0x24'),_0x372fce+'-'+_0x9b9d68+'/'+_0x305542)[_0x26e7('0x20')](_0x1745bd);}return null;};}function patchUpdates(_0x586350){return function(_0x366e40){try{jsonpatch[_0x26e7('0x25')](_0x366e40,_0x586350,!![]);}catch(_0x33fb1b){return BPromise[_0x26e7('0x26')](_0x33fb1b);}return _0x366e40[_0x26e7('0x27')]();};}function saveUpdates(_0x2f9324,_0x5a2ae3){return function(_0x1181e5){if(_0x1181e5){return _0x1181e5[_0x26e7('0x28')](_0x2f9324)[_0x26e7('0x29')](function(_0x223e1e){return _0x223e1e;});}return null;};}function removeEntity(_0x14d6a1,_0x4032e8){return function(_0x24201a){if(_0x24201a){return _0x24201a[_0x26e7('0x2a')]()[_0x26e7('0x29')](function(){_0x14d6a1['status'](0xcc)[_0x26e7('0x2b')]();});}};}function handleEntityNotFound(_0x5ced9b,_0x5d349f){return function(_0x1254c1){if(!_0x1254c1){_0x5ced9b['sendStatus'](0x194);}return _0x1254c1;};}function handleError(_0x3510d9,_0x242670){_0x242670=_0x242670||0x1f4;return function(_0x2cb860){logger['error'](_0x2cb860[_0x26e7('0x2c')]);if(_0x2cb860['name']){delete _0x2cb860['name'];}_0x3510d9[_0x26e7('0x1f')](_0x242670)['send'](_0x2cb860);};}exports[_0x26e7('0x2d')]=function(_0x565af0,_0x50d522){var _0x52170d={},_0x842d08={},_0x377572={'count':0x0,'rows':[]};var _0x401cfe=_[_0x26e7('0x2e')](db['ChatInternalMessage'][_0x26e7('0x2f')],function(_0x4ec1ab){return{'name':_0x4ec1ab[_0x26e7('0x30')],'type':_0x4ec1ab[_0x26e7('0x31')][_0x26e7('0x32')]};});_0x842d08[_0x26e7('0x33')]=_['map'](_0x401cfe,_0x26e7('0x34'));_0x842d08[_0x26e7('0x35')]=_[_0x26e7('0x36')](_0x565af0[_0x26e7('0x35')]);_0x842d08['filters']=_[_0x26e7('0x37')](_0x842d08[_0x26e7('0x33')],_0x842d08[_0x26e7('0x35')]);_0x52170d['attributes']=_['intersection'](_0x842d08['model'],qs['fields'](_0x565af0['query'][_0x26e7('0x38')]));_0x52170d[_0x26e7('0x39')]=_0x52170d['attributes']['length']?_0x52170d[_0x26e7('0x39')]:_0x842d08['model'];if(!_0x565af0[_0x26e7('0x35')][_0x26e7('0x3a')](_0x26e7('0x3b'))){_0x52170d[_0x26e7('0x3c')]=qs['limit'](_0x565af0[_0x26e7('0x35')][_0x26e7('0x3c')]);_0x52170d[_0x26e7('0x21')]=qs['offset'](_0x565af0[_0x26e7('0x35')][_0x26e7('0x21')]);}_0x52170d[_0x26e7('0x3d')]=qs[_0x26e7('0x3e')](_0x565af0[_0x26e7('0x35')][_0x26e7('0x3e')]);_0x52170d[_0x26e7('0x3f')]=qs[_0x26e7('0x40')](_[_0x26e7('0x41')](_0x565af0[_0x26e7('0x35')],_0x842d08[_0x26e7('0x40')]),_0x401cfe);if(_0x565af0[_0x26e7('0x35')][_0x26e7('0x42')]){_0x52170d[_0x26e7('0x3f')]=_[_0x26e7('0x43')](_0x52170d[_0x26e7('0x3f')],{'$or':_[_0x26e7('0x2e')](_0x401cfe,function(_0x190b0c){if(_0x190b0c['type']!==_0x26e7('0x44')){var _0x457f23={};_0x457f23[_0x190b0c[_0x26e7('0x34')]]={'$like':'%'+_0x565af0[_0x26e7('0x35')][_0x26e7('0x42')]+'%'};return _0x457f23;}})});}_0x52170d=_['merge']({},_0x52170d,_0x565af0[_0x26e7('0x45')]);var _0x291a85={'where':_0x52170d[_0x26e7('0x3f')]};return db[_0x26e7('0x46')][_0x26e7('0x23')](_0x291a85)[_0x26e7('0x29')](function(_0x2ead4d){_0x377572[_0x26e7('0x23')]=_0x2ead4d;if(_0x565af0['query'][_0x26e7('0x47')]){_0x52170d[_0x26e7('0x48')]=[{'all':!![]}];}return db[_0x26e7('0x46')]['findAll'](_0x52170d);})[_0x26e7('0x29')](function(_0x2f500c){_0x377572[_0x26e7('0x49')]=_0x2f500c;return _0x377572;})[_0x26e7('0x29')](respondWithFilteredResult(_0x50d522,_0x52170d))[_0x26e7('0x4a')](handleError(_0x50d522,null));};exports[_0x26e7('0x4b')]=function(_0x58a763,_0x148d2f){var _0x2176a6={'raw':!![],'where':{'id':_0x58a763[_0x26e7('0x4c')]['id']}},_0xc082e7={};_0xc082e7[_0x26e7('0x33')]=_[_0x26e7('0x36')](db[_0x26e7('0x46')]['rawAttributes']);_0xc082e7[_0x26e7('0x35')]=_['keys'](_0x58a763[_0x26e7('0x35')]);_0xc082e7[_0x26e7('0x40')]=_[_0x26e7('0x37')](_0xc082e7['model'],_0xc082e7[_0x26e7('0x35')]);_0x2176a6['attributes']=_[_0x26e7('0x37')](_0xc082e7['model'],qs[_0x26e7('0x38')](_0x58a763[_0x26e7('0x35')][_0x26e7('0x38')]));_0x2176a6[_0x26e7('0x39')]=_0x2176a6['attributes']['length']?_0x2176a6[_0x26e7('0x39')]:_0xc082e7[_0x26e7('0x33')];if(_0x58a763[_0x26e7('0x35')]['includeAll']){_0x2176a6['include']=[{'all':!![]}];}_0x2176a6=_[_0x26e7('0x43')]({},_0x2176a6,_0x58a763[_0x26e7('0x45')]);return db[_0x26e7('0x46')][_0x26e7('0x4d')](_0x2176a6)[_0x26e7('0x29')](handleEntityNotFound(_0x148d2f,null))[_0x26e7('0x29')](respondWithResult(_0x148d2f,null))[_0x26e7('0x4a')](handleError(_0x148d2f,null));};exports[_0x26e7('0x4e')]=function(_0x22d28d,_0x2f9506){return db[_0x26e7('0x46')][_0x26e7('0x4e')](_0x22d28d[_0x26e7('0x4f')],{})[_0x26e7('0x29')](respondWithResult(_0x2f9506,0xc9))['catch'](handleError(_0x2f9506,null));};exports[_0x26e7('0x28')]=function(_0x1f17e,_0x1d26c5){if(_0x1f17e[_0x26e7('0x4f')]['id']){delete _0x1f17e[_0x26e7('0x4f')]['id'];}return db[_0x26e7('0x46')]['find']({'where':{'id':_0x1f17e[_0x26e7('0x4c')]['id']}})[_0x26e7('0x29')](handleEntityNotFound(_0x1d26c5,null))[_0x26e7('0x29')](saveUpdates(_0x1f17e[_0x26e7('0x4f')],null))[_0x26e7('0x29')](respondWithResult(_0x1d26c5,null))[_0x26e7('0x4a')](handleError(_0x1d26c5,null));};exports['destroy']=function(_0xd6124c,_0x23848c){return db[_0x26e7('0x46')][_0x26e7('0x4d')]({'where':{'id':_0xd6124c['params']['id']}})[_0x26e7('0x29')](handleEntityNotFound(_0x23848c,null))[_0x26e7('0x29')](removeEntity(_0x23848c,null))[_0x26e7('0x4a')](handleError(_0x23848c,null));};exports['describe']=function(_0x154db6,_0x3f68e7){return db[_0x26e7('0x46')][_0x26e7('0x50')]()[_0x26e7('0x29')](respondWithResult(_0x3f68e7,null))['catch'](handleError(_0x3f68e7,null));};function wrapUser(_0x1c7714){return function(_0x345556){var _0x25ce1c=_0x1c7714['get']({'plain':!![]});_0x25ce1c['messages']=[];if(_0x345556){_0x25ce1c[_0x26e7('0x51')]=_0x345556[_0x26e7('0x52')];_0x25ce1c['lastMessage']=_0x345556;}else{_0x25ce1c[_0x26e7('0x51')]=moment(0x0)[_0x26e7('0x53')](_0x26e7('0x54'));_0x25ce1c[_0x26e7('0x55')]={};}return _0x25ce1c;};}exports['getUsers']=function(_0x450ba8,_0x40a363,_0x54e6ac){var _0x5650f1=[];return db[_0x26e7('0x56')]['findAll']({'where':{'role':[_0x26e7('0x57'),'admin','user']},'attributes':['id',_0x26e7('0x58'),_0x26e7('0x34'),_0x26e7('0x59'),_0x26e7('0x5a'),'internal',_0x26e7('0x5b'),_0x26e7('0x5c'),_0x26e7('0x5d'),_0x26e7('0x5e')],'order':qs[_0x26e7('0x3e')](_0x26e7('0x5f')),'include':[{'model':db['VoiceQueue'],'as':_0x26e7('0x60'),'attributes':['id',_0x26e7('0x34'),_0x26e7('0x31')],'through':{'attributes':[]}}]})[_0x26e7('0x29')](function(_0x379b05){if(_0x379b05){var _0xa483ae=_0x450ba8['user'][_0x26e7('0x61')]({'plain':!![]});if(!_0xa483ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa483ae[_0x26e7('0x59')]==='user'){return db[_0x26e7('0x62')][_0x26e7('0x4d')]({'where':{'name':'Agents','userProfileId':_0xa483ae['userProfileId']},'raw':!![]})['then'](function(_0x9613a){if(_0x9613a){if(_0x9613a[_0x26e7('0x63')]===0x0){return db[_0x26e7('0x64')][_0x26e7('0x65')]({'where':{'sectionId':_0x9613a['id']},'raw':!![]})[_0x26e7('0x29')](function(_0x525f18){var _0x2cdfb5=[];if(_['isEmpty'](_0x525f18)){_0x2cdfb5=_[_0x26e7('0x42')](_0x379b05,function(_0x575339){if(_0x575339[_0x26e7('0x59')]!=='agent'){return _0x575339;}});return _0x2cdfb5;}else{for(var _0x4bc97d=0x0;_0x4bc97d<_0x379b05[_0x26e7('0x66')];_0x4bc97d++){var _0x1ce9c8=_0x379b05[_0x4bc97d];if(_0x1ce9c8[_0x26e7('0x59')]===_0x26e7('0x57')){var _0x259ae6=_[_0x26e7('0x4d')](_0x525f18,function(_0x5dfb0d){return _0x5dfb0d[_0x26e7('0x67')]===_0x1ce9c8['id'];});if(_0x259ae6)_0x2cdfb5['push'](_0x1ce9c8);}else{_0x2cdfb5[_0x26e7('0x68')](_0x1ce9c8);}}return _0x2cdfb5;}});}else{return _0x379b05;}}else{var _0x3f9323=_[_0x26e7('0x42')](_0x379b05,function(_0x2875ef){if(_0x2875ef[_0x26e7('0x59')]!==_0x26e7('0x57')){return _0x2875ef;}});return _0x3f9323;}});}else{return _0x379b05;}}})[_0x26e7('0x29')](function(_0x2a31b4){var _0x5094ad=[];if(_0x2a31b4){_0x5650f1=_0x2a31b4;for(var _0x5718a8=0x0;_0x5718a8<_0x2a31b4[_0x26e7('0x66')];_0x5718a8+=0x1){_0x5650f1[_0x5718a8][_0x26e7('0x69')]=[];_0x5094ad[_0x26e7('0x68')](db[_0x26e7('0x46')][_0x26e7('0x4d')]({'where':{'FromId':[_0x450ba8[_0x26e7('0x6a')]['id'],_0x2a31b4[_0x5718a8]['id']],'ToId':[_0x450ba8['user']['id'],_0x2a31b4[_0x5718a8]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x26e7('0x6b'),'ToId',_0x26e7('0x6c'),_0x26e7('0x4f')],'order':qs[_0x26e7('0x3e')](_0x26e7('0x6d')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x26e7('0x29')](wrapUser(_0x2a31b4[_0x5718a8])));}return BPromise['all'](_0x5094ad);}return[];})['then'](function(_0x31e16f){return{'rows':_0x31e16f,'count':_0x31e16f[_0x26e7('0x66')]};})['then'](respondWithResult(_0x40a363,null))[_0x26e7('0x4a')](handleError(_0x40a363,null));}; \ No newline at end of file +var _0xbc18=['Agents','userProfileId','UserProfileResource','agent','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','update','then','destroy','stack','name','send','index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xbc18,0x7e));var _0x8bc1=function(_0xdeac17,_0x19ad66){_0xdeac17=_0xdeac17-0x0;var _0x33aabd=_0xbc18[_0xdeac17];return _0x33aabd;};'use strict';var emlformat=require(_0x8bc1('0x0'));var rimraf=require(_0x8bc1('0x1'));var zipdir=require(_0x8bc1('0x2'));var jsonpatch=require(_0x8bc1('0x3'));var rp=require(_0x8bc1('0x4'));var moment=require(_0x8bc1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8bc1('0x6'));var util=require(_0x8bc1('0x7'));var path=require(_0x8bc1('0x8'));var sox=require(_0x8bc1('0x9'));var csv=require(_0x8bc1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8bc1('0xb'));var _=require(_0x8bc1('0xc'));var squel=require(_0x8bc1('0xd'));var crypto=require(_0x8bc1('0xe'));var jsforce=require(_0x8bc1('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8bc1('0x10'));var Papa=require(_0x8bc1('0x11'));var Redis=require(_0x8bc1('0x12'));var authService=require(_0x8bc1('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8bc1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8bc1('0x15'))(_0x8bc1('0x16'));var utils=require(_0x8bc1('0x17'));var config=require(_0x8bc1('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x8bc1('0x19'))['db'];config[_0x8bc1('0x1a')]=_[_0x8bc1('0x1b')](config['redis'],{'host':_0x8bc1('0x1c'),'port':0x18eb});var socket=require(_0x8bc1('0x1d'))(new Redis(config[_0x8bc1('0x1a')]));require(_0x8bc1('0x1e'))[_0x8bc1('0x1f')](socket);function respondWithStatusCode(_0x1fad03,_0x1dec5e){_0x1dec5e=_0x1dec5e||0xcc;return function(_0x1c484c){if(_0x1c484c){return _0x1fad03[_0x8bc1('0x20')](_0x1dec5e);}return _0x1fad03[_0x8bc1('0x21')](_0x1dec5e)[_0x8bc1('0x22')]();};}function respondWithResult(_0x268cd3,_0x5f444d){_0x5f444d=_0x5f444d||0xc8;return function(_0x546335){if(_0x546335){return _0x268cd3[_0x8bc1('0x21')](_0x5f444d)['json'](_0x546335);}};}function respondWithFilteredResult(_0x6eaede,_0x52e946){return function(_0x3d769e){if(_0x3d769e){var _0x44822b=typeof _0x52e946[_0x8bc1('0x23')]===_0x8bc1('0x24')&&typeof _0x52e946[_0x8bc1('0x25')]==='undefined';var _0x2b4811=_0x3d769e[_0x8bc1('0x26')];var _0xf6c417=_0x44822b?0x0:_0x52e946[_0x8bc1('0x23')];var _0x34302d=_0x44822b?_0x3d769e['count']:_0x52e946['offset']+_0x52e946[_0x8bc1('0x25')];var _0xb05f29;if(_0x34302d>=_0x2b4811){_0x34302d=_0x2b4811;_0xb05f29=0xc8;}else{_0xb05f29=0xce;}_0x6eaede[_0x8bc1('0x21')](_0xb05f29);return _0x6eaede[_0x8bc1('0x27')](_0x8bc1('0x28'),_0xf6c417+'-'+_0x34302d+'/'+_0x2b4811)[_0x8bc1('0x29')](_0x3d769e);}return null;};}function patchUpdates(_0x2d19ce){return function(_0x500307){try{jsonpatch['apply'](_0x500307,_0x2d19ce,!![]);}catch(_0x2c6fdd){return BPromise[_0x8bc1('0x2a')](_0x2c6fdd);}return _0x500307['save']();};}function saveUpdates(_0x187aa6,_0x19d309){return function(_0x1b13ec){if(_0x1b13ec){return _0x1b13ec[_0x8bc1('0x2b')](_0x187aa6)[_0x8bc1('0x2c')](function(_0x2a6e68){return _0x2a6e68;});}return null;};}function removeEntity(_0x19aaf0,_0x1cf4eb){return function(_0x56ee5c){if(_0x56ee5c){return _0x56ee5c[_0x8bc1('0x2d')]()[_0x8bc1('0x2c')](function(){_0x19aaf0[_0x8bc1('0x21')](0xcc)[_0x8bc1('0x22')]();});}};}function handleEntityNotFound(_0x1e75c9,_0x3f94f3){return function(_0x5e4404){if(!_0x5e4404){_0x1e75c9[_0x8bc1('0x20')](0x194);}return _0x5e4404;};}function handleError(_0x12922b,_0x498931){_0x498931=_0x498931||0x1f4;return function(_0x1e3173){logger['error'](_0x1e3173[_0x8bc1('0x2e')]);if(_0x1e3173['name']){delete _0x1e3173[_0x8bc1('0x2f')];}_0x12922b[_0x8bc1('0x21')](_0x498931)[_0x8bc1('0x30')](_0x1e3173);};}exports[_0x8bc1('0x31')]=function(_0x34be12,_0x16ccd4){var _0x14bf96={},_0x481227={},_0x526d75={'count':0x0,'rows':[]};var _0xa47735=_[_0x8bc1('0x32')](db[_0x8bc1('0x33')]['rawAttributes'],function(_0x32982b){return{'name':_0x32982b[_0x8bc1('0x34')],'type':_0x32982b[_0x8bc1('0x35')][_0x8bc1('0x36')]};});_0x481227[_0x8bc1('0x37')]=_[_0x8bc1('0x32')](_0xa47735,_0x8bc1('0x2f'));_0x481227[_0x8bc1('0x38')]=_[_0x8bc1('0x39')](_0x34be12[_0x8bc1('0x38')]);_0x481227[_0x8bc1('0x3a')]=_['intersection'](_0x481227['model'],_0x481227[_0x8bc1('0x38')]);_0x14bf96[_0x8bc1('0x3b')]=_[_0x8bc1('0x3c')](_0x481227[_0x8bc1('0x37')],qs[_0x8bc1('0x3d')](_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x3d')]));_0x14bf96['attributes']=_0x14bf96[_0x8bc1('0x3b')][_0x8bc1('0x3e')]?_0x14bf96[_0x8bc1('0x3b')]:_0x481227[_0x8bc1('0x37')];if(!_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x3f')](_0x8bc1('0x40'))){_0x14bf96[_0x8bc1('0x25')]=qs['limit'](_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x25')]);_0x14bf96[_0x8bc1('0x23')]=qs['offset'](_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x23')]);}_0x14bf96['order']=qs[_0x8bc1('0x41')](_0x34be12['query'][_0x8bc1('0x41')]);_0x14bf96[_0x8bc1('0x42')]=qs[_0x8bc1('0x3a')](_[_0x8bc1('0x43')](_0x34be12[_0x8bc1('0x38')],_0x481227[_0x8bc1('0x3a')]),_0xa47735);if(_0x34be12[_0x8bc1('0x38')]['filter']){_0x14bf96[_0x8bc1('0x42')]=_[_0x8bc1('0x44')](_0x14bf96[_0x8bc1('0x42')],{'$or':_[_0x8bc1('0x32')](_0xa47735,function(_0x42af36){if(_0x42af36[_0x8bc1('0x35')]!==_0x8bc1('0x45')){var _0x245012={};_0x245012[_0x42af36[_0x8bc1('0x2f')]]={'$like':'%'+_0x34be12['query'][_0x8bc1('0x46')]+'%'};return _0x245012;}})});}_0x14bf96=_['merge']({},_0x14bf96,_0x34be12[_0x8bc1('0x47')]);var _0x8c7c58={'where':_0x14bf96[_0x8bc1('0x42')]};return db[_0x8bc1('0x33')]['count'](_0x8c7c58)[_0x8bc1('0x2c')](function(_0x485793){_0x526d75['count']=_0x485793;if(_0x34be12[_0x8bc1('0x38')][_0x8bc1('0x48')]){_0x14bf96[_0x8bc1('0x49')]=[{'all':!![]}];}return db[_0x8bc1('0x33')][_0x8bc1('0x4a')](_0x14bf96);})[_0x8bc1('0x2c')](function(_0x24b522){_0x526d75[_0x8bc1('0x4b')]=_0x24b522;return _0x526d75;})['then'](respondWithFilteredResult(_0x16ccd4,_0x14bf96))[_0x8bc1('0x4c')](handleError(_0x16ccd4,null));};exports[_0x8bc1('0x4d')]=function(_0x233d7b,_0x393ff8){var _0x28f26e={'raw':!![],'where':{'id':_0x233d7b[_0x8bc1('0x4e')]['id']}},_0x3ef639={};_0x3ef639[_0x8bc1('0x37')]=_[_0x8bc1('0x39')](db[_0x8bc1('0x33')]['rawAttributes']);_0x3ef639['query']=_['keys'](_0x233d7b['query']);_0x3ef639[_0x8bc1('0x3a')]=_[_0x8bc1('0x3c')](_0x3ef639[_0x8bc1('0x37')],_0x3ef639[_0x8bc1('0x38')]);_0x28f26e[_0x8bc1('0x3b')]=_['intersection'](_0x3ef639['model'],qs['fields'](_0x233d7b[_0x8bc1('0x38')][_0x8bc1('0x3d')]));_0x28f26e[_0x8bc1('0x3b')]=_0x28f26e[_0x8bc1('0x3b')][_0x8bc1('0x3e')]?_0x28f26e[_0x8bc1('0x3b')]:_0x3ef639[_0x8bc1('0x37')];if(_0x233d7b[_0x8bc1('0x38')][_0x8bc1('0x48')]){_0x28f26e['include']=[{'all':!![]}];}_0x28f26e=_[_0x8bc1('0x44')]({},_0x28f26e,_0x233d7b[_0x8bc1('0x47')]);return db[_0x8bc1('0x33')][_0x8bc1('0x4f')](_0x28f26e)[_0x8bc1('0x2c')](handleEntityNotFound(_0x393ff8,null))[_0x8bc1('0x2c')](respondWithResult(_0x393ff8,null))['catch'](handleError(_0x393ff8,null));};exports[_0x8bc1('0x50')]=function(_0x5c5622,_0x183790){return db[_0x8bc1('0x33')][_0x8bc1('0x50')](_0x5c5622['body'],{})[_0x8bc1('0x2c')](respondWithResult(_0x183790,0xc9))[_0x8bc1('0x4c')](handleError(_0x183790,null));};exports[_0x8bc1('0x2b')]=function(_0x118fc4,_0x4f676b){if(_0x118fc4[_0x8bc1('0x51')]['id']){delete _0x118fc4[_0x8bc1('0x51')]['id'];}return db['ChatInternalMessage'][_0x8bc1('0x4f')]({'where':{'id':_0x118fc4[_0x8bc1('0x4e')]['id']}})[_0x8bc1('0x2c')](handleEntityNotFound(_0x4f676b,null))[_0x8bc1('0x2c')](saveUpdates(_0x118fc4[_0x8bc1('0x51')],null))[_0x8bc1('0x2c')](respondWithResult(_0x4f676b,null))['catch'](handleError(_0x4f676b,null));};exports[_0x8bc1('0x2d')]=function(_0x4c99e6,_0x5dad7a){return db['ChatInternalMessage'][_0x8bc1('0x4f')]({'where':{'id':_0x4c99e6['params']['id']}})[_0x8bc1('0x2c')](handleEntityNotFound(_0x5dad7a,null))[_0x8bc1('0x2c')](removeEntity(_0x5dad7a,null))[_0x8bc1('0x4c')](handleError(_0x5dad7a,null));};exports[_0x8bc1('0x52')]=function(_0x1eb8f4,_0x514e44){return db[_0x8bc1('0x33')][_0x8bc1('0x52')]()[_0x8bc1('0x2c')](respondWithResult(_0x514e44,null))['catch'](handleError(_0x514e44,null));};function wrapUser(_0x151f8f){return function(_0x2a9efe){var _0x352866=_0x151f8f[_0x8bc1('0x53')]({'plain':!![]});_0x352866[_0x8bc1('0x54')]=[];if(_0x2a9efe){_0x352866[_0x8bc1('0x55')]=_0x2a9efe[_0x8bc1('0x56')];_0x352866[_0x8bc1('0x57')]=_0x2a9efe;}else{_0x352866[_0x8bc1('0x55')]=moment(0x0)[_0x8bc1('0x58')](_0x8bc1('0x59'));_0x352866[_0x8bc1('0x57')]={};}return _0x352866;};}exports[_0x8bc1('0x5a')]=function(_0x224be4,_0x3a07ba,_0xd4975c){var _0x1275d7=[];return db[_0x8bc1('0x5b')]['findAll']({'where':{'role':['agent',_0x8bc1('0x5c'),_0x8bc1('0x5d')]},'attributes':['id',_0x8bc1('0x5e'),'name',_0x8bc1('0x5f'),_0x8bc1('0x60'),_0x8bc1('0x61'),_0x8bc1('0x62'),_0x8bc1('0x63'),_0x8bc1('0x64'),'showWebBar'],'order':qs['sort'](_0x8bc1('0x65')),'include':[{'model':db[_0x8bc1('0x66')],'as':_0x8bc1('0x67'),'attributes':['id',_0x8bc1('0x2f'),_0x8bc1('0x35')],'through':{'attributes':[]}}]})[_0x8bc1('0x2c')](function(_0x2a21df){if(_0x2a21df){var _0x5ab56b=_0x224be4['user']['get']({'plain':!![]});if(!_0x5ab56b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5ab56b['role']===_0x8bc1('0x5d')){return db['UserProfileSection'][_0x8bc1('0x4f')]({'where':{'name':_0x8bc1('0x68'),'userProfileId':_0x5ab56b[_0x8bc1('0x69')]},'raw':!![]})[_0x8bc1('0x2c')](function(_0x41b576){if(_0x41b576){if(_0x41b576['autoAssociation']===0x0){return db[_0x8bc1('0x6a')][_0x8bc1('0x4a')]({'where':{'sectionId':_0x41b576['id']},'raw':!![]})[_0x8bc1('0x2c')](function(_0x360517){var _0x4e2ed=[];if(_['isEmpty'](_0x360517)){_0x4e2ed=_[_0x8bc1('0x46')](_0x2a21df,function(_0x2c01da){if(_0x2c01da[_0x8bc1('0x5f')]!==_0x8bc1('0x6b')){return _0x2c01da;}});return _0x4e2ed;}else{for(var _0x17cb21=0x0;_0x17cb21<_0x2a21df[_0x8bc1('0x3e')];_0x17cb21++){var _0x4c07e2=_0x2a21df[_0x17cb21];if(_0x4c07e2['role']===_0x8bc1('0x6b')){var _0x39fc0e=_['find'](_0x360517,function(_0x1ba0d5){return _0x1ba0d5[_0x8bc1('0x6c')]===_0x4c07e2['id'];});if(_0x39fc0e)_0x4e2ed['push'](_0x4c07e2);}else{_0x4e2ed[_0x8bc1('0x6d')](_0x4c07e2);}}return _0x4e2ed;}});}else{return _0x2a21df;}}else{var _0x5143d6=_['filter'](_0x2a21df,function(_0x1bd191){if(_0x1bd191[_0x8bc1('0x5f')]!=='agent'){return _0x1bd191;}});return _0x5143d6;}});}else{return _0x2a21df;}}})[_0x8bc1('0x2c')](function(_0x1bdb98){var _0x7447ef=[];if(_0x1bdb98){_0x1275d7=_0x1bdb98;for(var _0x102396=0x0;_0x102396<_0x1bdb98[_0x8bc1('0x3e')];_0x102396+=0x1){_0x1275d7[_0x102396][_0x8bc1('0x54')]=[];_0x7447ef[_0x8bc1('0x6d')](db[_0x8bc1('0x33')][_0x8bc1('0x4f')]({'where':{'FromId':[_0x224be4[_0x8bc1('0x5d')]['id'],_0x1bdb98[_0x102396]['id']],'ToId':[_0x224be4[_0x8bc1('0x5d')]['id'],_0x1bdb98[_0x102396]['id']],'ChatGroupId':null},'attributes':['id',_0x8bc1('0x56'),_0x8bc1('0x6e'),_0x8bc1('0x6f'),_0x8bc1('0x70'),_0x8bc1('0x51')],'order':qs[_0x8bc1('0x41')](_0x8bc1('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x8bc1('0x2c')](wrapUser(_0x1bdb98[_0x102396])));}return BPromise[_0x8bc1('0x72')](_0x7447ef);}return[];})[_0x8bc1('0x2c')](function(_0x3c555b){return{'rows':_0x3c555b,'count':_0x3c555b[_0x8bc1('0x3e')]};})[_0x8bc1('0x2c')](respondWithResult(_0x3a07ba,null))[_0x8bc1('0x4c')](handleError(_0x3a07ba,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d076f9a..4856fa7 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 _0xc5a5=['setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x2237a7,_0x5b6bca){var _0x96b057=function(_0x2e59a7){while(--_0x2e59a7){_0x2237a7['push'](_0x2237a7['shift']());}};_0x96b057(++_0x5b6bca);}(_0xc5a5,0x1b1));var _0x5c5a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc5a5[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0x5c5a('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x5c5a('0x1')](0x0);var events={'afterCreate':_0x5c5a('0x2'),'afterUpdate':_0x5c5a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x294e12){return function(_0x2cce17,_0xb17644,_0x1b18ab){ChatInternalMessageEvents[_0x5c5a('0x4')](_0x294e12+':'+_0x2cce17['id'],_0x2cce17);ChatInternalMessageEvents[_0x5c5a('0x4')](_0x294e12,_0x2cce17);_0x1b18ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x5c5a('0x5')](e,emitEvent(event));}}module[_0x5c5a('0x6')]=ChatInternalMessageEvents; \ No newline at end of file +var _0xd993=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4d1667,_0x44ff2e){var _0x6a267f=function(_0x1269a0){while(--_0x1269a0){_0x4d1667['push'](_0x4d1667['shift']());}};_0x6a267f(++_0x44ff2e);}(_0xd993,0x19e));var _0x3d99=function(_0x1cca23,_0x228d03){_0x1cca23=_0x1cca23-0x0;var _0x38b568=_0xd993[_0x1cca23];return _0x38b568;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3d99('0x0'))['db'][_0x3d99('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3d99('0x2')](0x0);var events={'afterCreate':_0x3d99('0x3'),'afterUpdate':_0x3d99('0x4'),'afterDestroy':_0x3d99('0x5')};function emitEvent(_0x1efa42){return function(_0x4ad11a,_0x104559,_0x5ec2d6){ChatInternalMessageEvents[_0x3d99('0x6')](_0x1efa42+':'+_0x4ad11a['id'],_0x4ad11a);ChatInternalMessageEvents[_0x3d99('0x6')](_0x1efa42,_0x4ad11a);_0x5ec2d6(null);};}for(var e in events){if(events[_0x3d99('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3d99('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 9c2e810..44cd292 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 _0x69c4=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x69c4,0x161));var _0x469c=function(_0x1a5abe,_0x38b592){_0x1a5abe=_0x1a5abe-0x0;var _0x1948a7=_0x69c4[_0x1a5abe];return _0x1948a7;};'use strict';var _=require(_0x469c('0x0'));var util=require(_0x469c('0x1'));var logger=require(_0x469c('0x2'))(_0x469c('0x3'));var moment=require(_0x469c('0x4'));var BPromise=require(_0x469c('0x5'));var rp=require(_0x469c('0x6'));var fs=require('fs');var path=require(_0x469c('0x7'));var rimraf=require(_0x469c('0x8'));var config=require(_0x469c('0x9'));var attributes=require(_0x469c('0xa'));module[_0x469c('0xb')]=function(_0x37ddc4,_0x1778ce){return _0x37ddc4[_0x469c('0xc')](_0x469c('0xd'),attributes,{'tableName':_0x469c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x469c('0xf'),'collate':_0x469c('0x10')});}; \ No newline at end of file +var _0x2a8f=['path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x2a8f,0xe9));var _0xf2a8=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x2a8f[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0xf2a8('0x0'));var util=require('util');var logger=require(_0xf2a8('0x1'))(_0xf2a8('0x2'));var moment=require('moment');var BPromise=require(_0xf2a8('0x3'));var rp=require(_0xf2a8('0x4'));var fs=require('fs');var path=require(_0xf2a8('0x5'));var rimraf=require(_0xf2a8('0x6'));var config=require(_0xf2a8('0x7'));var attributes=require(_0xf2a8('0x8'));module[_0xf2a8('0x9')]=function(_0x571d78,_0xe063ad){return _0x571d78[_0xf2a8('0xa')](_0xf2a8('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf2a8('0xc'),'collate':_0xf2a8('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 9ee0c81..642ae23 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 _0x8e52=['request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s'];(function(_0x14f33d,_0x22315a){var _0x52ea7a=function(_0x27ca92){while(--_0x27ca92){_0x14f33d['push'](_0x14f33d['shift']());}};_0x52ea7a(++_0x22315a);}(_0x8e52,0x1c6));var _0x28e5=function(_0x5f3905,_0x43a651){_0x5f3905=_0x5f3905-0x0;var _0x2923b1=_0x8e52[_0x5f3905];return _0x2923b1;};'use strict';var _=require('lodash');var util=require(_0x28e5('0x0'));var moment=require(_0x28e5('0x1'));var BPromise=require(_0x28e5('0x2'));var rs=require(_0x28e5('0x3'));var fs=require('fs');var Redis=require(_0x28e5('0x4'));var db=require(_0x28e5('0x5'))['db'];var utils=require(_0x28e5('0x6'));var logger=require(_0x28e5('0x7'))(_0x28e5('0x8'));var config=require(_0x28e5('0x9'));var jayson=require(_0x28e5('0xa'));var client=jayson[_0x28e5('0xb')][_0x28e5('0xc')]({'port':0x232a});config[_0x28e5('0xd')]=_[_0x28e5('0xe')](config['redis'],{'host':_0x28e5('0xf'),'port':0x18eb});var socket=require(_0x28e5('0x10'))(new Redis(config['redis']));require(_0x28e5('0x11'))['register'](socket);function respondWithRpcPromise(_0x43306d,_0xd9be8d,_0x33d9bd){return new BPromise(function(_0x9f21e5,_0x26d60a){return client['request'](_0x43306d,_0x33d9bd)['then'](function(_0x50a50d){logger[_0x28e5('0x12')](_0x28e5('0x13'),_0xd9be8d,'request\x20sent');logger[_0x28e5('0x14')](_0x28e5('0x15'),_0xd9be8d,_0x28e5('0x16'),JSON['stringify'](_0x50a50d));if(_0x50a50d[_0x28e5('0x17')]){if(_0x50a50d['error'][_0x28e5('0x18')]===0x1f4){logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);return _0x26d60a(_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);}logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);return _0x9f21e5(_0x50a50d[_0x28e5('0x17')][_0x28e5('0x19')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0xd9be8d,_0x28e5('0x16'));_0x9f21e5(_0x50a50d[_0x28e5('0x1a')][_0x28e5('0x19')]);}})[_0x28e5('0x1b')](function(_0x151a8b){logger[_0x28e5('0x17')](_0x28e5('0x13'),_0xd9be8d,_0x151a8b);_0x26d60a(_0x151a8b);});});} \ No newline at end of file +var _0xac21=['localhost','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x2d2ca2,_0x51873f){var _0x48489d=function(_0x1a2cf7){while(--_0x1a2cf7){_0x2d2ca2['push'](_0x2d2ca2['shift']());}};_0x48489d(++_0x51873f);}(_0xac21,0x1af));var _0x1ac2=function(_0x471ce7,_0x23b291){_0x471ce7=_0x471ce7-0x0;var _0x3591ff=_0xac21[_0x471ce7];return _0x3591ff;};'use strict';var _=require('lodash');var util=require(_0x1ac2('0x0'));var moment=require(_0x1ac2('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ac2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ac2('0x3'))['db'];var utils=require(_0x1ac2('0x4'));var logger=require('../../config/logger')(_0x1ac2('0x5'));var config=require('../../config/environment');var jayson=require(_0x1ac2('0x6'));var client=jayson[_0x1ac2('0x7')][_0x1ac2('0x8')]({'port':0x232a});config[_0x1ac2('0x9')]=_[_0x1ac2('0xa')](config[_0x1ac2('0x9')],{'host':_0x1ac2('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ac2('0x9')]));require(_0x1ac2('0xc'))[_0x1ac2('0xd')](socket);function respondWithRpcPromise(_0x2ea4e1,_0x2f0079,_0x4a264a){return new BPromise(function(_0x50a79f,_0x469363){return client[_0x1ac2('0xe')](_0x2ea4e1,_0x4a264a)[_0x1ac2('0xf')](function(_0x225c01){logger[_0x1ac2('0x10')](_0x1ac2('0x11'),_0x2f0079,'request\x20sent');logger[_0x1ac2('0x12')](_0x1ac2('0x13'),_0x2f0079,_0x1ac2('0x14'),JSON[_0x1ac2('0x15')](_0x225c01));if(_0x225c01[_0x1ac2('0x16')]){if(_0x225c01[_0x1ac2('0x16')][_0x1ac2('0x17')]===0x1f4){logger[_0x1ac2('0x16')](_0x1ac2('0x11'),_0x2f0079,_0x225c01['error'][_0x1ac2('0x18')]);return _0x469363(_0x225c01[_0x1ac2('0x16')][_0x1ac2('0x18')]);}logger[_0x1ac2('0x16')](_0x1ac2('0x11'),_0x2f0079,_0x225c01[_0x1ac2('0x16')][_0x1ac2('0x18')]);return _0x50a79f(_0x225c01[_0x1ac2('0x16')]['message']);}else{logger[_0x1ac2('0x10')](_0x1ac2('0x11'),_0x2f0079,'request\x20sent');_0x50a79f(_0x225c01[_0x1ac2('0x19')][_0x1ac2('0x18')]);}})['catch'](function(_0x3c0300){logger['error'](_0x1ac2('0x11'),_0x2f0079,_0x3c0300);_0x469363(_0x3c0300);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 5d28eb2..c442b32 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 _0x559d=['emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update'];(function(_0x58202b,_0x2d63e1){var _0x1b85d6=function(_0x3d86ce){while(--_0x3d86ce){_0x58202b['push'](_0x58202b['shift']());}};_0x1b85d6(++_0x2d63e1);}(_0x559d,0x195));var _0xd559=function(_0x4e3b9c,_0x4d76a3){_0x4e3b9c=_0x4e3b9c-0x0;var _0x358b13=_0x559d[_0x4e3b9c];return _0x358b13;};'use strict';var ChatInternalMessageEvents=require(_0xd559('0x0'));var events=[_0xd559('0x1'),'remove',_0xd559('0x2')];function createListener(_0x1fc935,_0x2f2016){return function(_0x3bf044){_0x2f2016[_0xd559('0x3')](_0x1fc935,_0x3bf044);};}function removeListener(_0x59c516,_0xd41692){return function(){ChatInternalMessageEvents[_0xd559('0x4')](_0x59c516,_0xd41692);};}exports[_0xd559('0x5')]=function(_0x287363){for(var _0x4d5e2c=0x0,_0x4c2f1f=events[_0xd559('0x6')];_0x4d5e2c<_0x4c2f1f;_0x4d5e2c++){var _0xd3f317=events[_0x4d5e2c];var _0x3392bc=createListener(_0xd559('0x7')+_0xd3f317,_0x287363);ChatInternalMessageEvents['on'](_0xd3f317,_0x3392bc);}}; \ No newline at end of file +var _0x29aa=['remove','update','emit','removeListener','register','length','./chatInternalMessage.events','save'];(function(_0x1c5142,_0x30ea72){var _0x1268cb=function(_0xaa2299){while(--_0xaa2299){_0x1c5142['push'](_0x1c5142['shift']());}};_0x1268cb(++_0x30ea72);}(_0x29aa,0x10e));var _0xa29a=function(_0x45d1bb,_0x35d9b4){_0x45d1bb=_0x45d1bb-0x0;var _0x4cdcba=_0x29aa[_0x45d1bb];return _0x4cdcba;};'use strict';var ChatInternalMessageEvents=require(_0xa29a('0x0'));var events=[_0xa29a('0x1'),_0xa29a('0x2'),_0xa29a('0x3')];function createListener(_0xcc3432,_0x1cb410){return function(_0x445902){_0x1cb410[_0xa29a('0x4')](_0xcc3432,_0x445902);};}function removeListener(_0x2dc5a5,_0x5b4053){return function(){ChatInternalMessageEvents[_0xa29a('0x5')](_0x2dc5a5,_0x5b4053);};}exports[_0xa29a('0x6')]=function(_0x5be15f){for(var _0x30a1b2=0x0,_0x48046c=events[_0xa29a('0x7')];_0x30a1b2<_0x48046c;_0x30a1b2++){var _0xf8165a=events[_0x30a1b2];var _0x50ba7c=createListener('chatInternalMessage:'+_0xf8165a,_0x5be15f);ChatInternalMessageEvents['on'](_0xf8165a,_0x50ba7c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 7470267..d83804c 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 _0x2771=['getUsers','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','describe','/users'];(function(_0x58a0d0,_0x5510a7){var _0x31f808=function(_0x147be8){while(--_0x147be8){_0x58a0d0['push'](_0x58a0d0['shift']());}};_0x31f808(++_0x5510a7);}(_0x2771,0x12d));var _0x1277=function(_0x2da854,_0xb44978){_0x2da854=_0x2da854-0x0;var _0x44bf04=_0x2771[_0x2da854];return _0x44bf04;};'use strict';var multer=require(_0x1277('0x0'));var util=require(_0x1277('0x1'));var path=require(_0x1277('0x2'));var timeout=require(_0x1277('0x3'));var express=require(_0x1277('0x4'));var router=express[_0x1277('0x5')]();var fs_extra=require(_0x1277('0x6'));var auth=require(_0x1277('0x7'));var interaction=require(_0x1277('0x8'));var config=require('../../config/environment');var controller=require(_0x1277('0x9'));router[_0x1277('0xa')]('/',auth[_0x1277('0xb')](),controller['index']);router[_0x1277('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x1277('0xc')]);router[_0x1277('0xa')](_0x1277('0xd'),auth['isAuthenticated'](),controller[_0x1277('0xe')]);router[_0x1277('0xa')](_0x1277('0xf'),auth[_0x1277('0xb')](),controller[_0x1277('0x10')]);router['post']('/',auth[_0x1277('0xb')](),controller['create']);router[_0x1277('0x11')](_0x1277('0xf'),controller[_0x1277('0x12')]);router['delete'](_0x1277('0xf'),auth['isAuthenticated'](),controller[_0x1277('0x13')]);module[_0x1277('0x14')]=router; \ No newline at end of file +var _0x299d=['/describe','getUsers','/:id','post','put','delete','destroy','exports','path','connect-timeout','express','Router','./chatInternalMessage.controller','get','isAuthenticated','index'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x299d,0x168));var _0xd299=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x299d[_0x1d9aa0];return _0x226868;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd299('0x0'));var timeout=require(_0xd299('0x1'));var express=require(_0xd299('0x2'));var router=express[_0xd299('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd299('0x4'));router[_0xd299('0x5')]('/',auth[_0xd299('0x6')](),controller[_0xd299('0x7')]);router[_0xd299('0x5')](_0xd299('0x8'),auth[_0xd299('0x6')](),controller['describe']);router[_0xd299('0x5')]('/users',auth[_0xd299('0x6')](),controller[_0xd299('0x9')]);router[_0xd299('0x5')](_0xd299('0xa'),auth[_0xd299('0x6')](),controller['show']);router[_0xd299('0xb')]('/',auth[_0xd299('0x6')](),controller['create']);router[_0xd299('0xc')](_0xd299('0xa'),controller['update']);router[_0xd299('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xd299('0xe')]);module[_0xd299('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 3a8c4d0..55c44da 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 _0x215d=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize'];(function(_0x509b2a,_0xf91802){var _0x59ff9e=function(_0x5af97a){while(--_0x5af97a){_0x509b2a['push'](_0x509b2a['shift']());}};_0x59ff9e(++_0xf91802);}(_0x215d,0x187));var _0xd215=function(_0x4eacb8,_0x912ea){_0x4eacb8=_0x4eacb8-0x0;var _0x2ae0db=_0x215d[_0x4eacb8];return _0x2ae0db;};'use strict';var Sequelize=require(_0xd215('0x0'));module['exports']={'body':{'type':Sequelize[_0xd215('0x1')](_0xd215('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd215('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd215('0x4')]('in',_0xd215('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xd215('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xd215('0x1')]}}; \ No newline at end of file +var _0xc584=['BOOLEAN','out','DATE','exports','TEXT'];(function(_0x4a5faf,_0x12de1c){var _0x208bb6=function(_0x2b1fd7){while(--_0x2b1fd7){_0x4a5faf['push'](_0x4a5faf['shift']());}};_0x208bb6(++_0x12de1c);}(_0xc584,0xa8));var _0x4c58=function(_0x1c8cc6,_0x411e5c){_0x1c8cc6=_0x1c8cc6-0x0;var _0x522936=_0xc584[_0x1c8cc6];return _0x522936;};'use strict';var Sequelize=require('sequelize');module[_0x4c58('0x0')]={'body':{'type':Sequelize[_0x4c58('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x4c58('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x4c58('0x3')),'defaultValue':_0x4c58('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x4c58('0x4')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x4c58('0x1')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index e3129ac..173c874 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 _0xbc9a=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','rawAttributes','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','catch','show','params','create','body','update','describe','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','find','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','chat-interactions','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','User','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x1b8699,_0x40d2f6){var _0x3dafee=function(_0x959584){while(--_0x959584){_0x1b8699['push'](_0x1b8699['shift']());}};_0x3dafee(++_0x40d2f6);}(_0xbc9a,0x185));var _0xabc9=function(_0x2a558d,_0x2df0ff){_0x2a558d=_0x2a558d-0x0;var _0xa7bc9c=_0xbc9a[_0x2a558d];return _0xa7bc9c;};'use strict';var emlformat=require(_0xabc9('0x0'));var rimraf=require(_0xabc9('0x1'));var zipdir=require(_0xabc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xabc9('0x3'));var moment=require(_0xabc9('0x4'));var BPromise=require(_0xabc9('0x5'));var Mustache=require(_0xabc9('0x6'));var util=require(_0xabc9('0x7'));var path=require('path');var sox=require(_0xabc9('0x8'));var csv=require('to-csv');var ejs=require(_0xabc9('0x9'));var fs=require('fs');var fs_extra=require(_0xabc9('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xabc9('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xabc9('0xc'));var toCsv=require(_0xabc9('0xd'));var querystring=require('querystring');var Papa=require(_0xabc9('0xe'));var Redis=require(_0xabc9('0xf'));var authService=require(_0xabc9('0x10'));var qs=require(_0xabc9('0x11'));var as=require(_0xabc9('0x12'));var hardwareService=require(_0xabc9('0x13'));var logger=require(_0xabc9('0x14'))(_0xabc9('0x15'));var utils=require(_0xabc9('0x16'));var config=require(_0xabc9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xabc9('0x18'))['db'];config['redis']=_[_0xabc9('0x19')](config[_0xabc9('0x1a')],{'host':_0xabc9('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xabc9('0x1a')]));require(_0xabc9('0x1c'))[_0xabc9('0x1d')](socket);var jayson=require(_0xabc9('0x1e'));var client=jayson[_0xabc9('0x1f')][_0xabc9('0x20')]({'port':0x232c});var client9002=jayson[_0xabc9('0x1f')][_0xabc9('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5d5377,_0x2aa7cf,_0x29c44a,_0x5e9b1a){return new BPromise(function(_0x5f3785,_0x227a77){var _0x581c0a=_0x5e9b1a||client;return _0x581c0a[_0xabc9('0x21')](_0x5d5377,_0x29c44a)[_0xabc9('0x22')](function(_0x22ab8f){logger[_0xabc9('0x23')](_0xabc9('0x24'),_0x2aa7cf,_0xabc9('0x25'));logger[_0xabc9('0x26')](_0xabc9('0x27'),_0x2aa7cf,_0xabc9('0x25'),JSON[_0xabc9('0x28')](_0x22ab8f));if(_0x22ab8f[_0xabc9('0x29')]){if(_0x22ab8f['error'][_0xabc9('0x2a')]===0x1f4){logger[_0xabc9('0x29')](_0xabc9('0x24'),_0x2aa7cf,_0x22ab8f[_0xabc9('0x29')]['message']);return _0x227a77(_0x22ab8f[_0xabc9('0x29')][_0xabc9('0x2b')]);}logger[_0xabc9('0x29')]('ChatMessage,\x20%s,\x20%s',_0x2aa7cf,_0x22ab8f[_0xabc9('0x29')][_0xabc9('0x2b')]);return _0x5f3785(_0x22ab8f[_0xabc9('0x29')]['message']);}else{logger[_0xabc9('0x23')]('ChatMessage,\x20%s,\x20%s',_0x2aa7cf,'request\x20sent');_0x5f3785(_0x22ab8f[_0xabc9('0x2c')][_0xabc9('0x2b')]);}})['catch'](function(_0x10196a){logger[_0xabc9('0x29')]('ChatMessage,\x20%s,\x20%s',_0x2aa7cf,_0x10196a);_0x227a77(_0x10196a);});});}function respondWithStatusCode(_0x59613f,_0x4046be){_0x4046be=_0x4046be||0xcc;return function(_0x5478ac){if(_0x5478ac){return _0x59613f[_0xabc9('0x2d')](_0x4046be);}return _0x59613f[_0xabc9('0x2e')](_0x4046be)[_0xabc9('0x2f')]();};}function respondWithResult(_0x3eeb6f,_0x3babfe){_0x3babfe=_0x3babfe||0xc8;return function(_0x22cead){if(_0x22cead){return _0x3eeb6f[_0xabc9('0x2e')](_0x3babfe)['json'](_0x22cead);}};}function respondWithFilteredResult(_0x3c98c8,_0x59b388){return function(_0x3db835){if(_0x3db835){var _0x2cec75=typeof _0x59b388[_0xabc9('0x30')]===_0xabc9('0x31')&&typeof _0x59b388[_0xabc9('0x32')]===_0xabc9('0x31');var _0x277096=_0x3db835[_0xabc9('0x33')];var _0x203479=_0x2cec75?0x0:_0x59b388[_0xabc9('0x30')];var _0x558289=_0x2cec75?_0x3db835['count']:_0x59b388[_0xabc9('0x30')]+_0x59b388[_0xabc9('0x32')];var _0x237a38;if(_0x558289>=_0x277096){_0x558289=_0x277096;_0x237a38=0xc8;}else{_0x237a38=0xce;}_0x3c98c8['status'](_0x237a38);return _0x3c98c8[_0xabc9('0x34')](_0xabc9('0x35'),_0x203479+'-'+_0x558289+'/'+_0x277096)['json'](_0x3db835);}return null;};}function patchUpdates(_0x58f799){return function(_0xbb8800){try{jsonpatch[_0xabc9('0x36')](_0xbb8800,_0x58f799,!![]);}catch(_0x4c26ee){return BPromise[_0xabc9('0x37')](_0x4c26ee);}return _0xbb8800[_0xabc9('0x38')]();};}function saveUpdates(_0x174eef,_0x483a63){return function(_0x38eb0c){if(_0x38eb0c){return _0x38eb0c['update'](_0x174eef)[_0xabc9('0x22')](function(_0x1bfc40){return _0x1bfc40;});}return null;};}function removeEntity(_0x4d325a,_0x1b9e5d){return function(_0x301f66){if(_0x301f66){return _0x301f66[_0xabc9('0x39')]()[_0xabc9('0x22')](function(){_0x4d325a['status'](0xcc)[_0xabc9('0x2f')]();});}};}function handleEntityNotFound(_0x5c8063,_0x48032b){return function(_0x175d8e){if(!_0x175d8e){_0x5c8063[_0xabc9('0x2d')](0x194);}return _0x175d8e;};}function handleError(_0x11a3fe,_0x3cd636){_0x3cd636=_0x3cd636||0x1f4;return function(_0x36de2e){logger['error'](_0x36de2e[_0xabc9('0x3a')]);if(_0x36de2e[_0xabc9('0x3b')]){delete _0x36de2e[_0xabc9('0x3b')];}_0x11a3fe[_0xabc9('0x2e')](_0x3cd636)[_0xabc9('0x3c')](_0x36de2e);};}exports['index']=function(_0x17f607,_0x53bcb9){var _0x189afc={},_0x2f9b10={},_0x34d660={'count':0x0,'rows':[]};var _0x5398ea=_['map'](db['ChatMessage'][_0xabc9('0x3d')],function(_0x2a5dd1){return{'name':_0x2a5dd1['fieldName'],'type':_0x2a5dd1[_0xabc9('0x3e')]['key']};});_0x2f9b10[_0xabc9('0x3f')]=_[_0xabc9('0x40')](_0x5398ea,'name');_0x2f9b10['query']=_[_0xabc9('0x41')](_0x17f607[_0xabc9('0x42')]);_0x2f9b10[_0xabc9('0x43')]=_[_0xabc9('0x44')](_0x2f9b10[_0xabc9('0x3f')],_0x2f9b10[_0xabc9('0x42')]);_0x189afc[_0xabc9('0x45')]=_[_0xabc9('0x44')](_0x2f9b10[_0xabc9('0x3f')],qs['fields'](_0x17f607[_0xabc9('0x42')][_0xabc9('0x46')]));_0x189afc[_0xabc9('0x45')]=_0x189afc[_0xabc9('0x45')][_0xabc9('0x47')]?_0x189afc[_0xabc9('0x45')]:_0x2f9b10['model'];if(!_0x17f607[_0xabc9('0x42')][_0xabc9('0x48')](_0xabc9('0x49'))){_0x189afc[_0xabc9('0x32')]=qs[_0xabc9('0x32')](_0x17f607[_0xabc9('0x42')][_0xabc9('0x32')]);_0x189afc[_0xabc9('0x30')]=qs[_0xabc9('0x30')](_0x17f607[_0xabc9('0x42')]['offset']);}_0x189afc['order']=qs[_0xabc9('0x4a')](_0x17f607['query'][_0xabc9('0x4a')]);_0x189afc[_0xabc9('0x4b')]=qs[_0xabc9('0x43')](_[_0xabc9('0x4c')](_0x17f607[_0xabc9('0x42')],_0x2f9b10[_0xabc9('0x43')]),_0x5398ea);if(_0x17f607[_0xabc9('0x42')][_0xabc9('0x4d')]){_0x189afc[_0xabc9('0x4b')]=_[_0xabc9('0x4e')](_0x189afc['where'],{'$or':_[_0xabc9('0x40')](_0x5398ea,function(_0x18b9d8){if(_0x18b9d8['type']!==_0xabc9('0x4f')){var _0xbee613={};_0xbee613[_0x18b9d8['name']]={'$like':'%'+_0x17f607[_0xabc9('0x42')]['filter']+'%'};return _0xbee613;}})});}_0x189afc=_['merge']({},_0x189afc,_0x17f607[_0xabc9('0x50')]);var _0x320939={'where':_0x189afc[_0xabc9('0x4b')]};return db[_0xabc9('0x51')][_0xabc9('0x33')](_0x320939)[_0xabc9('0x22')](function(_0x49cea0){_0x34d660['count']=_0x49cea0;if(_0x17f607[_0xabc9('0x42')][_0xabc9('0x52')]){_0x189afc[_0xabc9('0x53')]=[{'all':!![]}];}return db[_0xabc9('0x51')][_0xabc9('0x54')](_0x189afc);})[_0xabc9('0x22')](function(_0x3ed930){_0x34d660[_0xabc9('0x55')]=_0x3ed930;return _0x34d660;})[_0xabc9('0x22')](respondWithFilteredResult(_0x53bcb9,_0x189afc))[_0xabc9('0x56')](handleError(_0x53bcb9,null));};exports[_0xabc9('0x57')]=function(_0x14682f,_0x466813){var _0x5bad92={'raw':!![],'where':{'id':_0x14682f[_0xabc9('0x58')]['id']}},_0x132b30={};_0x132b30[_0xabc9('0x3f')]=_[_0xabc9('0x41')](db[_0xabc9('0x51')][_0xabc9('0x3d')]);_0x132b30[_0xabc9('0x42')]=_[_0xabc9('0x41')](_0x14682f[_0xabc9('0x42')]);_0x132b30[_0xabc9('0x43')]=_[_0xabc9('0x44')](_0x132b30['model'],_0x132b30['query']);_0x5bad92[_0xabc9('0x45')]=_[_0xabc9('0x44')](_0x132b30[_0xabc9('0x3f')],qs['fields'](_0x14682f[_0xabc9('0x42')][_0xabc9('0x46')]));_0x5bad92[_0xabc9('0x45')]=_0x5bad92[_0xabc9('0x45')][_0xabc9('0x47')]?_0x5bad92[_0xabc9('0x45')]:_0x132b30[_0xabc9('0x3f')];if(_0x14682f['query']['includeAll']){_0x5bad92[_0xabc9('0x53')]=[{'all':!![]}];}_0x5bad92=_[_0xabc9('0x4e')]({},_0x5bad92,_0x14682f[_0xabc9('0x50')]);return db['ChatMessage']['find'](_0x5bad92)[_0xabc9('0x22')](handleEntityNotFound(_0x466813,null))[_0xabc9('0x22')](respondWithResult(_0x466813,null))[_0xabc9('0x56')](handleError(_0x466813,null));};exports[_0xabc9('0x59')]=function(_0x291d7d,_0xd44c79){return db[_0xabc9('0x51')]['create'](_0x291d7d[_0xabc9('0x5a')],{})[_0xabc9('0x22')](respondWithResult(_0xd44c79,0xc9))['catch'](handleError(_0xd44c79,null));};exports[_0xabc9('0x5b')]=function(_0x3665c9,_0x538993){if(_0x3665c9[_0xabc9('0x5a')]['id']){delete _0x3665c9[_0xabc9('0x5a')]['id'];}return db[_0xabc9('0x51')]['find']({'where':{'id':_0x3665c9['params']['id']}})[_0xabc9('0x22')](handleEntityNotFound(_0x538993,null))[_0xabc9('0x22')](saveUpdates(_0x3665c9[_0xabc9('0x5a')],null))[_0xabc9('0x22')](respondWithResult(_0x538993,null))[_0xabc9('0x56')](handleError(_0x538993,null));};exports[_0xabc9('0x39')]=function(_0x53ac58,_0x245c2b){return db['ChatMessage']['find']({'where':{'id':_0x53ac58[_0xabc9('0x58')]['id']}})[_0xabc9('0x22')](handleEntityNotFound(_0x245c2b,null))['then'](removeEntity(_0x245c2b,null))[_0xabc9('0x56')](handleError(_0x245c2b,null));};exports['describe']=function(_0x25dcac,_0x2ac54d){return db['ChatMessage'][_0xabc9('0x5c')]()[_0xabc9('0x22')](respondWithResult(_0x2ac54d,null))[_0xabc9('0x56')](handleError(_0x2ac54d,null));};var interaction_log=require(_0xabc9('0x14'))('chat-interactions');exports[_0xabc9('0x5d')]=function(_0x1c0027,_0xf3031b,_0x244b50){var _0x2264ec={'agent':{},'channel':_0xabc9('0x5e')};if(_0x1c0027['body']['id']){delete _0x1c0027['body']['id'];}_0x1c0027[_0xabc9('0x5a')][_0xabc9('0x5f')]=!![];_0x1c0027[_0xabc9('0x5a')][_0xabc9('0x60')]=moment()[_0xabc9('0x61')](_0xabc9('0x62'));_0x1c0027[_0xabc9('0x5a')]['UserId']=_0x1c0027[_0xabc9('0x5a')][_0xabc9('0x63')]||_0x1c0027[_0xabc9('0x64')]['id'];_0x2264ec['agent']['id']=_0x1c0027[_0xabc9('0x5a')]['UserId'];return db[_0xabc9('0x51')][_0xabc9('0x65')]({'where':{'id':_0x1c0027[_0xabc9('0x58')]['id'],'UserId':null}})[_0xabc9('0x22')](handleEntityNotFound(_0xf3031b,null))[_0xabc9('0x22')](saveUpdates(_0x1c0027[_0xabc9('0x5a')],null))['then'](function(_0x4d2527){if(_0x4d2527){_0x2264ec[_0xabc9('0x2b')]=_0x4d2527[_0xabc9('0x66')]({'plain':!![]});return db[_0xabc9('0x67')][_0xabc9('0x65')]({'where':{'id':_0x4d2527[_0xabc9('0x68')]}});}return null;})[_0xabc9('0x22')](handleEntityNotFound(_0xf3031b,null))['then'](function(_0x362da0){if(_0x362da0){return _0x362da0[_0xabc9('0x5b')]({'UserId':_0x1c0027[_0xabc9('0x5a')]['UserId'],'read1stAt':_[_0xabc9('0x69')](_0x362da0[_0xabc9('0x6a')])?moment()[_0xabc9('0x61')](_0xabc9('0x62')):undefined});}return null;})[_0xabc9('0x22')](function(_0x3bf637){if(_0x3bf637){_0x2264ec[_0xabc9('0x6b')]=_0x3bf637[_0xabc9('0x66')]({'plain':!![]});interaction_log[_0xabc9('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c0027['user']['id'],_0x1c0027['user'][_0xabc9('0x3b')],_0x1c0027[_0xabc9('0x64')]['role'],_0x2264ec[_0xabc9('0x6b')]['id'],_0x1c0027[_0xabc9('0x5a')]?JSON[_0xabc9('0x28')](_0x1c0027[_0xabc9('0x5a')]):_0xabc9('0x6c'));return respondWithRpcPromise(_0xabc9('0x6d'),_0xabc9('0x6e'),_0x2264ec);}return null;})[_0xabc9('0x22')](function(_0x393281){var _0x5dcc49=_0xabc9('0x6f')+_0x393281[_0xabc9('0x2b')][_0xabc9('0x70')];return db[_0xabc9('0x71')][_0xabc9('0x42')](_0x5dcc49,{'type':db[_0xabc9('0x72')][_0xabc9('0x73')][_0xabc9('0x74')],'raw':!![]})[_0xabc9('0x22')](function(_0x995f16){return _0x995f16;});})[_0xabc9('0x22')](function(_0xc33c17){if(_0xc33c17){_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x75')]=_0xc33c17[0x0];if(!_0x1c0027['body']['UserId'])return;return db['User'][_0xabc9('0x65')]({'where':{'id':_0x1c0027[_0xabc9('0x5a')]['UserId'],'role':_0xabc9('0x76')},'attributes':['id',_0xabc9('0x3b'),_0xabc9('0x77'),'email',_0xabc9('0x78')],'raw':!![]});}return null;})['then'](function(_0x1da167){if(!_0x1da167)return null;_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x76')]=_0x1da167;return _0x2264ec;})[_0xabc9('0x22')](function(_0x583a8a){if(_0x583a8a){if(_0x1c0027['body']['manual']){_0x2264ec['message'][_0xabc9('0x79')]=util[_0xabc9('0x61')](_0xabc9('0x7a'),_0x1c0027['user']['name']);_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x7b')]=_0x2264ec[_0xabc9('0x7b')];_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x7c')]=_0x2264ec[_0xabc9('0x7b')];_0x2264ec[_0xabc9('0x2b')][_0xabc9('0x7d')]='accept';return respondWithRpcPromise('EventManager',_0xabc9('0x7e'),{'event':_0xabc9('0x7f'),'message':_[_0xabc9('0x4e')](_0x2264ec[_0xabc9('0x2b')],JSON[_0xabc9('0x80')](_0x2264ec[_0xabc9('0x6b')]['formData']))},client9002)[_0xabc9('0x22')](function(){return _0x2264ec;});}return _0x2264ec;}return null;})[_0xabc9('0x22')](respondWithResult(_0xf3031b,null))[_0xabc9('0x56')](handleError(_0xf3031b,null));};var interaction_log=require('../../config/logger')(_0xabc9('0x81'));exports[_0xabc9('0x37')]=function(_0x336879,_0x562d07,_0x2394a9){var _0x113d46={'agent':{},'channel':'chat'};if(_0x336879[_0xabc9('0x5a')]['id']){delete _0x336879['body']['id'];}_0x336879['body']['UserId']=_0x336879['body'][_0xabc9('0x63')]||_0x336879['user']['id'];_0x113d46[_0xabc9('0x76')]['id']=_0x336879[_0xabc9('0x5a')][_0xabc9('0x63')];return db[_0xabc9('0x51')][_0xabc9('0x65')]({'where':{'id':_0x336879[_0xabc9('0x58')]['id'],'UserId':null}})[_0xabc9('0x22')](handleEntityNotFound(_0x562d07,null))[_0xabc9('0x22')](function(_0x49959b){if(_0x49959b){_0x113d46['message']=_0x49959b[_0xabc9('0x66')]({'plain':!![]});return db[_0xabc9('0x67')][_0xabc9('0x65')]({'where':{'id':_0x49959b[_0xabc9('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x562d07,null))[_0xabc9('0x22')](function(_0x3893cd){if(_0x3893cd){_0x113d46['interaction']=_0x3893cd[_0xabc9('0x66')]({'plain':!![]});interaction_log[_0xabc9('0x23')](_0xabc9('0x82'),_0x336879['user']['id'],_0x336879[_0xabc9('0x64')][_0xabc9('0x3b')],_0x336879[_0xabc9('0x64')][_0xabc9('0x83')],_0x113d46[_0xabc9('0x6b')]['id'],_0x336879[_0xabc9('0x5a')]?JSON[_0xabc9('0x28')](_0x336879[_0xabc9('0x5a')]):'null');return respondWithRpcPromise(_0xabc9('0x84'),_0xabc9('0x85'),_0x113d46);}return null;})[_0xabc9('0x22')](function(_0x93981b){var _0x51657c=_0xabc9('0x6f')+_0x93981b['message'][_0xabc9('0x70')];return db[_0xabc9('0x71')]['query'](_0x51657c,{'type':db[_0xabc9('0x72')][_0xabc9('0x73')][_0xabc9('0x74')],'raw':!![]})[_0xabc9('0x22')](function(_0x24de3e){return _0x24de3e;});})[_0xabc9('0x22')](function(_0x33989e){if(_0x33989e){_0x113d46[_0xabc9('0x2b')][_0xabc9('0x75')]=_0x33989e[0x0];if(!_0x336879[_0xabc9('0x5a')][_0xabc9('0x63')])return;return db[_0xabc9('0x86')][_0xabc9('0x65')]({'where':{'id':_0x336879[_0xabc9('0x5a')][_0xabc9('0x63')],'role':_0xabc9('0x76')},'attributes':['id',_0xabc9('0x3b'),_0xabc9('0x77'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x25a315){if(!_0x25a315)return null;_0x113d46[_0xabc9('0x2b')]['agent']=_0x25a315;return _0x113d46;})[_0xabc9('0x22')](function(_0x5e4ea3){if(_0x5e4ea3){_0x5e4ea3['message'][_0xabc9('0x79')]=util[_0xabc9('0x61')](_0xabc9('0x7a'),_0x336879[_0xabc9('0x64')][_0xabc9('0x3b')]);_0x5e4ea3[_0xabc9('0x2b')][_0xabc9('0x7b')]=_0x113d46[_0xabc9('0x7b')];_0x5e4ea3[_0xabc9('0x2b')][_0xabc9('0x7c')]=_0x113d46['channel'];_0x5e4ea3[_0xabc9('0x2b')][_0xabc9('0x7d')]=_0xabc9('0x37');respondWithRpcPromise(_0xabc9('0x7e'),_0xabc9('0x7e'),{'event':_0xabc9('0x87'),'message':_[_0xabc9('0x4e')](_0x113d46[_0xabc9('0x2b')],JSON[_0xabc9('0x80')](_0x113d46[_0xabc9('0x6b')]['formData']))},client9002);return _0x113d46;}return null;})[_0xabc9('0x22')](respondWithResult(_0x562d07,null))['catch'](handleError(_0x562d07,null));}; \ No newline at end of file +var _0xb306=['params','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','manual','interface','SIP/%s','motionChannel','channel','event','acceptmessage','parse','formData','reject','ChatInteraction','role','RejectMessage','Sequelize','fullname','EventManager','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','destroy','stack','name','index','map','ChatMessage','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show'];(function(_0x19bd2f,_0xc0fce){var _0x51ed84=function(_0x5d9479){while(--_0x5d9479){_0x19bd2f['push'](_0x19bd2f['shift']());}};_0x51ed84(++_0xc0fce);}(_0xb306,0x132));var _0x6b30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb306[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6b30('0x0'));var zipdir=require(_0x6b30('0x1'));var jsonpatch=require(_0x6b30('0x2'));var rp=require(_0x6b30('0x3'));var moment=require(_0x6b30('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6b30('0x5'));var util=require(_0x6b30('0x6'));var path=require(_0x6b30('0x7'));var sox=require(_0x6b30('0x8'));var csv=require('to-csv');var ejs=require(_0x6b30('0x9'));var fs=require('fs');var fs_extra=require(_0x6b30('0xa'));var _=require(_0x6b30('0xb'));var squel=require(_0x6b30('0xc'));var crypto=require(_0x6b30('0xd'));var jsforce=require(_0x6b30('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6b30('0xf'));var querystring=require(_0x6b30('0x10'));var Papa=require(_0x6b30('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6b30('0x12'));var as=require(_0x6b30('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b30('0x14'))(_0x6b30('0x15'));var utils=require('../../config/utils');var config=require(_0x6b30('0x16'));var licenseUtil=require(_0x6b30('0x17'));var db=require('../../mysqldb')['db'];config[_0x6b30('0x18')]=_['defaults'](config[_0x6b30('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6b30('0x19'))(new Redis(config[_0x6b30('0x18')]));require(_0x6b30('0x1a'))[_0x6b30('0x1b')](socket);var jayson=require(_0x6b30('0x1c'));var client=jayson[_0x6b30('0x1d')][_0x6b30('0x1e')]({'port':0x232c});var client9002=jayson[_0x6b30('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x476006,_0x5dd1b3,_0x12a48f,_0x59ac4d){return new BPromise(function(_0x1d270d,_0x58f593){var _0x525898=_0x59ac4d||client;return _0x525898[_0x6b30('0x1f')](_0x476006,_0x12a48f)[_0x6b30('0x20')](function(_0x208236){logger[_0x6b30('0x21')]('ChatMessage,\x20%s,\x20%s',_0x5dd1b3,_0x6b30('0x22'));logger[_0x6b30('0x23')](_0x6b30('0x24'),_0x5dd1b3,_0x6b30('0x22'),JSON[_0x6b30('0x25')](_0x208236));if(_0x208236[_0x6b30('0x26')]){if(_0x208236[_0x6b30('0x26')][_0x6b30('0x27')]===0x1f4){logger[_0x6b30('0x26')]('ChatMessage,\x20%s,\x20%s',_0x5dd1b3,_0x208236[_0x6b30('0x26')]['message']);return _0x58f593(_0x208236[_0x6b30('0x26')][_0x6b30('0x28')]);}logger[_0x6b30('0x26')](_0x6b30('0x29'),_0x5dd1b3,_0x208236[_0x6b30('0x26')][_0x6b30('0x28')]);return _0x1d270d(_0x208236[_0x6b30('0x26')][_0x6b30('0x28')]);}else{logger[_0x6b30('0x21')]('ChatMessage,\x20%s,\x20%s',_0x5dd1b3,'request\x20sent');_0x1d270d(_0x208236[_0x6b30('0x2a')][_0x6b30('0x28')]);}})[_0x6b30('0x2b')](function(_0x43f2a4){logger[_0x6b30('0x26')](_0x6b30('0x29'),_0x5dd1b3,_0x43f2a4);_0x58f593(_0x43f2a4);});});}function respondWithStatusCode(_0x259580,_0x57d8c7){_0x57d8c7=_0x57d8c7||0xcc;return function(_0x13e2d6){if(_0x13e2d6){return _0x259580[_0x6b30('0x2c')](_0x57d8c7);}return _0x259580[_0x6b30('0x2d')](_0x57d8c7)[_0x6b30('0x2e')]();};}function respondWithResult(_0x428114,_0x1a49c9){_0x1a49c9=_0x1a49c9||0xc8;return function(_0x324e21){if(_0x324e21){return _0x428114['status'](_0x1a49c9)['json'](_0x324e21);}};}function respondWithFilteredResult(_0x28a523,_0x2c0cc4){return function(_0x403d3a){if(_0x403d3a){var _0x1d5478=typeof _0x2c0cc4[_0x6b30('0x2f')]===_0x6b30('0x30')&&typeof _0x2c0cc4[_0x6b30('0x31')]===_0x6b30('0x30');var _0x5128b5=_0x403d3a[_0x6b30('0x32')];var _0x5aa7c5=_0x1d5478?0x0:_0x2c0cc4[_0x6b30('0x2f')];var _0x13877a=_0x1d5478?_0x403d3a[_0x6b30('0x32')]:_0x2c0cc4[_0x6b30('0x2f')]+_0x2c0cc4['limit'];var _0x7b7631;if(_0x13877a>=_0x5128b5){_0x13877a=_0x5128b5;_0x7b7631=0xc8;}else{_0x7b7631=0xce;}_0x28a523[_0x6b30('0x2d')](_0x7b7631);return _0x28a523[_0x6b30('0x33')](_0x6b30('0x34'),_0x5aa7c5+'-'+_0x13877a+'/'+_0x5128b5)[_0x6b30('0x35')](_0x403d3a);}return null;};}function patchUpdates(_0x4680c4){return function(_0x276d22){try{jsonpatch[_0x6b30('0x36')](_0x276d22,_0x4680c4,!![]);}catch(_0x19fdb3){return BPromise['reject'](_0x19fdb3);}return _0x276d22[_0x6b30('0x37')]();};}function saveUpdates(_0x5e9841,_0x11602e){return function(_0x28581e){if(_0x28581e){return _0x28581e[_0x6b30('0x38')](_0x5e9841)[_0x6b30('0x20')](function(_0x1c0288){return _0x1c0288;});}return null;};}function removeEntity(_0x2181d1,_0x359189){return function(_0x2849de){if(_0x2849de){return _0x2849de[_0x6b30('0x39')]()[_0x6b30('0x20')](function(){_0x2181d1[_0x6b30('0x2d')](0xcc)[_0x6b30('0x2e')]();});}};}function handleEntityNotFound(_0x4866df,_0x5a772c){return function(_0x58db64){if(!_0x58db64){_0x4866df[_0x6b30('0x2c')](0x194);}return _0x58db64;};}function handleError(_0x5d9178,_0x17d877){_0x17d877=_0x17d877||0x1f4;return function(_0xf1a0a0){logger[_0x6b30('0x26')](_0xf1a0a0[_0x6b30('0x3a')]);if(_0xf1a0a0[_0x6b30('0x3b')]){delete _0xf1a0a0['name'];}_0x5d9178[_0x6b30('0x2d')](_0x17d877)['send'](_0xf1a0a0);};}exports[_0x6b30('0x3c')]=function(_0x6944ec,_0x1ba7ab){var _0x462e1a={},_0x4b77d5={},_0x21d1ad={'count':0x0,'rows':[]};var _0x104595=_[_0x6b30('0x3d')](db[_0x6b30('0x3e')][_0x6b30('0x3f')],function(_0x33f521){return{'name':_0x33f521['fieldName'],'type':_0x33f521[_0x6b30('0x40')]['key']};});_0x4b77d5[_0x6b30('0x41')]=_[_0x6b30('0x3d')](_0x104595,_0x6b30('0x3b'));_0x4b77d5[_0x6b30('0x42')]=_[_0x6b30('0x43')](_0x6944ec[_0x6b30('0x42')]);_0x4b77d5[_0x6b30('0x44')]=_[_0x6b30('0x45')](_0x4b77d5[_0x6b30('0x41')],_0x4b77d5[_0x6b30('0x42')]);_0x462e1a[_0x6b30('0x46')]=_['intersection'](_0x4b77d5[_0x6b30('0x41')],qs[_0x6b30('0x47')](_0x6944ec[_0x6b30('0x42')][_0x6b30('0x47')]));_0x462e1a[_0x6b30('0x46')]=_0x462e1a[_0x6b30('0x46')][_0x6b30('0x48')]?_0x462e1a['attributes']:_0x4b77d5['model'];if(!_0x6944ec[_0x6b30('0x42')][_0x6b30('0x49')](_0x6b30('0x4a'))){_0x462e1a['limit']=qs[_0x6b30('0x31')](_0x6944ec[_0x6b30('0x42')][_0x6b30('0x31')]);_0x462e1a[_0x6b30('0x2f')]=qs[_0x6b30('0x2f')](_0x6944ec[_0x6b30('0x42')][_0x6b30('0x2f')]);}_0x462e1a[_0x6b30('0x4b')]=qs[_0x6b30('0x4c')](_0x6944ec['query'][_0x6b30('0x4c')]);_0x462e1a[_0x6b30('0x4d')]=qs[_0x6b30('0x44')](_[_0x6b30('0x4e')](_0x6944ec[_0x6b30('0x42')],_0x4b77d5[_0x6b30('0x44')]),_0x104595);if(_0x6944ec['query'][_0x6b30('0x4f')]){_0x462e1a[_0x6b30('0x4d')]=_['merge'](_0x462e1a[_0x6b30('0x4d')],{'$or':_[_0x6b30('0x3d')](_0x104595,function(_0x36ded7){if(_0x36ded7[_0x6b30('0x40')]!==_0x6b30('0x50')){var _0x4992da={};_0x4992da[_0x36ded7['name']]={'$like':'%'+_0x6944ec[_0x6b30('0x42')][_0x6b30('0x4f')]+'%'};return _0x4992da;}})});}_0x462e1a=_[_0x6b30('0x51')]({},_0x462e1a,_0x6944ec[_0x6b30('0x52')]);var _0x3a6688={'where':_0x462e1a[_0x6b30('0x4d')]};return db[_0x6b30('0x3e')][_0x6b30('0x32')](_0x3a6688)[_0x6b30('0x20')](function(_0x4bf99c){_0x21d1ad[_0x6b30('0x32')]=_0x4bf99c;if(_0x6944ec['query'][_0x6b30('0x53')]){_0x462e1a[_0x6b30('0x54')]=[{'all':!![]}];}return db[_0x6b30('0x3e')][_0x6b30('0x55')](_0x462e1a);})[_0x6b30('0x20')](function(_0x23ab07){_0x21d1ad['rows']=_0x23ab07;return _0x21d1ad;})['then'](respondWithFilteredResult(_0x1ba7ab,_0x462e1a))[_0x6b30('0x2b')](handleError(_0x1ba7ab,null));};exports[_0x6b30('0x56')]=function(_0x74bd2d,_0x47e099){var _0x454b5c={'raw':!![],'where':{'id':_0x74bd2d[_0x6b30('0x57')]['id']}},_0x28c688={};_0x28c688['model']=_['keys'](db[_0x6b30('0x3e')]['rawAttributes']);_0x28c688[_0x6b30('0x42')]=_[_0x6b30('0x43')](_0x74bd2d[_0x6b30('0x42')]);_0x28c688[_0x6b30('0x44')]=_[_0x6b30('0x45')](_0x28c688[_0x6b30('0x41')],_0x28c688['query']);_0x454b5c[_0x6b30('0x46')]=_[_0x6b30('0x45')](_0x28c688['model'],qs[_0x6b30('0x47')](_0x74bd2d['query'][_0x6b30('0x47')]));_0x454b5c[_0x6b30('0x46')]=_0x454b5c[_0x6b30('0x46')][_0x6b30('0x48')]?_0x454b5c[_0x6b30('0x46')]:_0x28c688[_0x6b30('0x41')];if(_0x74bd2d['query'][_0x6b30('0x53')]){_0x454b5c[_0x6b30('0x54')]=[{'all':!![]}];}_0x454b5c=_['merge']({},_0x454b5c,_0x74bd2d[_0x6b30('0x52')]);return db[_0x6b30('0x3e')][_0x6b30('0x58')](_0x454b5c)[_0x6b30('0x20')](handleEntityNotFound(_0x47e099,null))[_0x6b30('0x20')](respondWithResult(_0x47e099,null))[_0x6b30('0x2b')](handleError(_0x47e099,null));};exports[_0x6b30('0x59')]=function(_0xd8828,_0x4ca664){return db['ChatMessage']['create'](_0xd8828[_0x6b30('0x5a')],{})[_0x6b30('0x20')](respondWithResult(_0x4ca664,0xc9))[_0x6b30('0x2b')](handleError(_0x4ca664,null));};exports[_0x6b30('0x38')]=function(_0x4b5664,_0x2f2548){if(_0x4b5664['body']['id']){delete _0x4b5664[_0x6b30('0x5a')]['id'];}return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x4b5664[_0x6b30('0x57')]['id']}})[_0x6b30('0x20')](handleEntityNotFound(_0x2f2548,null))[_0x6b30('0x20')](saveUpdates(_0x4b5664[_0x6b30('0x5a')],null))[_0x6b30('0x20')](respondWithResult(_0x2f2548,null))[_0x6b30('0x2b')](handleError(_0x2f2548,null));};exports[_0x6b30('0x39')]=function(_0x43ce19,_0x100581){return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x43ce19['params']['id']}})['then'](handleEntityNotFound(_0x100581,null))['then'](removeEntity(_0x100581,null))[_0x6b30('0x2b')](handleError(_0x100581,null));};exports['describe']=function(_0x5b379f,_0x299c7d){return db[_0x6b30('0x3e')][_0x6b30('0x5b')]()[_0x6b30('0x20')](respondWithResult(_0x299c7d,null))['catch'](handleError(_0x299c7d,null));};var interaction_log=require('../../config/logger')(_0x6b30('0x5c'));exports[_0x6b30('0x5d')]=function(_0x10791a,_0x1c8101,_0x51b9d9){var _0x4d26bb={'agent':{},'channel':_0x6b30('0x5e')};if(_0x10791a[_0x6b30('0x5a')]['id']){delete _0x10791a[_0x6b30('0x5a')]['id'];}_0x10791a[_0x6b30('0x5a')][_0x6b30('0x5f')]=!![];_0x10791a[_0x6b30('0x5a')]['readAt']=moment()[_0x6b30('0x60')](_0x6b30('0x61'));_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')]=_0x10791a[_0x6b30('0x5a')]['UserId']||_0x10791a[_0x6b30('0x63')]['id'];_0x4d26bb[_0x6b30('0x64')]['id']=_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')];return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x10791a[_0x6b30('0x57')]['id'],'UserId':null}})[_0x6b30('0x20')](handleEntityNotFound(_0x1c8101,null))[_0x6b30('0x20')](saveUpdates(_0x10791a[_0x6b30('0x5a')],null))[_0x6b30('0x20')](function(_0x580416){if(_0x580416){_0x4d26bb[_0x6b30('0x28')]=_0x580416[_0x6b30('0x65')]({'plain':!![]});return db['ChatInteraction'][_0x6b30('0x58')]({'where':{'id':_0x580416[_0x6b30('0x66')]}});}return null;})[_0x6b30('0x20')](handleEntityNotFound(_0x1c8101,null))[_0x6b30('0x20')](function(_0x432524){if(_0x432524){return _0x432524[_0x6b30('0x38')]({'UserId':_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')],'read1stAt':_[_0x6b30('0x67')](_0x432524['read1stAt'])?moment()[_0x6b30('0x60')](_0x6b30('0x61')):undefined});}return null;})[_0x6b30('0x20')](function(_0x18b2e2){if(_0x18b2e2){_0x4d26bb[_0x6b30('0x68')]=_0x18b2e2[_0x6b30('0x65')]({'plain':!![]});interaction_log[_0x6b30('0x21')](_0x6b30('0x69'),_0x10791a[_0x6b30('0x63')]['id'],_0x10791a[_0x6b30('0x63')][_0x6b30('0x3b')],_0x10791a[_0x6b30('0x63')]['role'],_0x4d26bb['interaction']['id'],_0x10791a['body']?JSON[_0x6b30('0x25')](_0x10791a['body']):_0x6b30('0x6a'));return respondWithRpcPromise(_0x6b30('0x6b'),_0x6b30('0x6c'),_0x4d26bb);}return null;})[_0x6b30('0x20')](function(_0x20aae9){var _0x46244f=_0x6b30('0x6d')+_0x20aae9[_0x6b30('0x28')][_0x6b30('0x6e')];return db['sequelize'][_0x6b30('0x42')](_0x46244f,{'type':db['Sequelize'][_0x6b30('0x6f')][_0x6b30('0x70')],'raw':!![]})['then'](function(_0x1de2b7){return _0x1de2b7;});})[_0x6b30('0x20')](function(_0x1c2b4c){if(_0x1c2b4c){_0x4d26bb[_0x6b30('0x28')][_0x6b30('0x71')]=_0x1c2b4c[0x0];if(!_0x10791a['body'][_0x6b30('0x62')])return;return db[_0x6b30('0x72')][_0x6b30('0x58')]({'where':{'id':_0x10791a[_0x6b30('0x5a')][_0x6b30('0x62')],'role':_0x6b30('0x64')},'attributes':['id',_0x6b30('0x3b'),'fullname','email','internal'],'raw':!![]});}return null;})['then'](function(_0xb0aa24){if(!_0xb0aa24)return null;_0x4d26bb['message'][_0x6b30('0x64')]=_0xb0aa24;return _0x4d26bb;})[_0x6b30('0x20')](function(_0x3d4547){if(_0x3d4547){if(_0x10791a[_0x6b30('0x5a')][_0x6b30('0x73')]){_0x4d26bb['message'][_0x6b30('0x74')]=util[_0x6b30('0x60')](_0x6b30('0x75'),_0x10791a[_0x6b30('0x63')][_0x6b30('0x3b')]);_0x4d26bb[_0x6b30('0x28')]['channel']=_0x4d26bb['channel'];_0x4d26bb[_0x6b30('0x28')][_0x6b30('0x76')]=_0x4d26bb[_0x6b30('0x77')];_0x4d26bb[_0x6b30('0x28')][_0x6b30('0x78')]=_0x6b30('0x5d');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x6b30('0x79'),'message':_[_0x6b30('0x51')](_0x4d26bb[_0x6b30('0x28')],JSON[_0x6b30('0x7a')](_0x4d26bb['interaction'][_0x6b30('0x7b')]))},client9002)[_0x6b30('0x20')](function(){return _0x4d26bb;});}return _0x4d26bb;}return null;})[_0x6b30('0x20')](respondWithResult(_0x1c8101,null))['catch'](handleError(_0x1c8101,null));};var interaction_log=require(_0x6b30('0x14'))('chat-interactions');exports[_0x6b30('0x7c')]=function(_0x10f4ed,_0x24387a,_0x305062){var _0x4380df={'agent':{},'channel':'chat'};if(_0x10f4ed[_0x6b30('0x5a')]['id']){delete _0x10f4ed[_0x6b30('0x5a')]['id'];}_0x10f4ed[_0x6b30('0x5a')]['UserId']=_0x10f4ed[_0x6b30('0x5a')][_0x6b30('0x62')]||_0x10f4ed[_0x6b30('0x63')]['id'];_0x4380df['agent']['id']=_0x10f4ed[_0x6b30('0x5a')][_0x6b30('0x62')];return db[_0x6b30('0x3e')][_0x6b30('0x58')]({'where':{'id':_0x10f4ed[_0x6b30('0x57')]['id'],'UserId':null}})[_0x6b30('0x20')](handleEntityNotFound(_0x24387a,null))[_0x6b30('0x20')](function(_0x430c28){if(_0x430c28){_0x4380df[_0x6b30('0x28')]=_0x430c28['get']({'plain':!![]});return db[_0x6b30('0x7d')][_0x6b30('0x58')]({'where':{'id':_0x430c28[_0x6b30('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x24387a,null))['then'](function(_0x32a973){if(_0x32a973){_0x4380df['interaction']=_0x32a973[_0x6b30('0x65')]({'plain':!![]});interaction_log[_0x6b30('0x21')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x10f4ed['user']['id'],_0x10f4ed[_0x6b30('0x63')]['name'],_0x10f4ed['user'][_0x6b30('0x7e')],_0x4380df[_0x6b30('0x68')]['id'],_0x10f4ed[_0x6b30('0x5a')]?JSON[_0x6b30('0x25')](_0x10f4ed[_0x6b30('0x5a')]):_0x6b30('0x6a'));return respondWithRpcPromise(_0x6b30('0x7f'),'rejectMessage',_0x4380df);}return null;})[_0x6b30('0x20')](function(_0xc29b89){var _0x112964=_0x6b30('0x6d')+_0xc29b89['message'][_0x6b30('0x6e')];return db['sequelize'][_0x6b30('0x42')](_0x112964,{'type':db[_0x6b30('0x80')]['QueryTypes'][_0x6b30('0x70')],'raw':!![]})[_0x6b30('0x20')](function(_0x5075dc){return _0x5075dc;});})[_0x6b30('0x20')](function(_0xffd2a6){if(_0xffd2a6){_0x4380df[_0x6b30('0x28')][_0x6b30('0x71')]=_0xffd2a6[0x0];if(!_0x10f4ed[_0x6b30('0x5a')][_0x6b30('0x62')])return;return db[_0x6b30('0x72')][_0x6b30('0x58')]({'where':{'id':_0x10f4ed['body'][_0x6b30('0x62')],'role':_0x6b30('0x64')},'attributes':['id',_0x6b30('0x3b'),_0x6b30('0x81'),'email','internal'],'raw':!![]});}return null;})[_0x6b30('0x20')](function(_0x12224e){if(!_0x12224e)return null;_0x4380df['message'][_0x6b30('0x64')]=_0x12224e;return _0x4380df;})['then'](function(_0x26a9c4){if(_0x26a9c4){_0x26a9c4[_0x6b30('0x28')][_0x6b30('0x74')]=util[_0x6b30('0x60')](_0x6b30('0x75'),_0x10f4ed[_0x6b30('0x63')][_0x6b30('0x3b')]);_0x26a9c4[_0x6b30('0x28')][_0x6b30('0x77')]=_0x4380df[_0x6b30('0x77')];_0x26a9c4[_0x6b30('0x28')][_0x6b30('0x76')]=_0x4380df[_0x6b30('0x77')];_0x26a9c4['message'][_0x6b30('0x78')]=_0x6b30('0x7c');respondWithRpcPromise(_0x6b30('0x82'),_0x6b30('0x82'),{'event':'rejectmessage','message':_['merge'](_0x4380df[_0x6b30('0x28')],JSON['parse'](_0x4380df[_0x6b30('0x68')][_0x6b30('0x7b')]))},client9002);return _0x4380df;}return null;})[_0x6b30('0x20')](respondWithResult(_0x24387a,null))['catch'](handleError(_0x24387a,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index a579110..c4e73a4 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 _0xd8b0=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x449158,_0x44e1b0){var _0x1f3c3a=function(_0x5f1053){while(--_0x5f1053){_0x449158['push'](_0x449158['shift']());}};_0x1f3c3a(++_0x44e1b0);}(_0xd8b0,0x108));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0d8b('0x0'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0d8b('0x1')](0x0);var events={'afterCreate':_0x0d8b('0x2'),'afterUpdate':_0x0d8b('0x3'),'afterDestroy':_0x0d8b('0x4')};function emitEvent(_0x391b44){return function(_0xd9ccbe,_0x1688a9,_0x544507){ChatMessageEvents[_0x0d8b('0x5')](_0x391b44+':'+_0xd9ccbe['id'],_0xd9ccbe);ChatMessageEvents['emit'](_0x391b44,_0xd9ccbe);_0x544507(null);};}for(var e in events){if(events[_0x0d8b('0x6')](e)){var event=events[e];ChatMessage[_0x0d8b('0x7')](e,emitEvent(event));}}module[_0x0d8b('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x689b=['save','update','remove','hook','events','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x39bf45,_0x2d3553){var _0xf3f2b6=function(_0x1c5bb2){while(--_0x1c5bb2){_0x39bf45['push'](_0x39bf45['shift']());}};_0xf3f2b6(++_0x2d3553);}(_0x689b,0x10c));var _0xb689=function(_0x472455,_0xd1931e){_0x472455=_0x472455-0x0;var _0x338b67=_0x689b[_0x472455];return _0x338b67;};'use strict';var EventEmitter=require(_0xb689('0x0'));var ChatMessage=require(_0xb689('0x1'))['db'][_0xb689('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xb689('0x3')](0x0);var events={'afterCreate':_0xb689('0x4'),'afterUpdate':_0xb689('0x5'),'afterDestroy':_0xb689('0x6')};function emitEvent(_0x49d31f){return function(_0x394957,_0x4fb7fd,_0x3f1e7c){ChatMessageEvents['emit'](_0x49d31f+':'+_0x394957['id'],_0x394957);ChatMessageEvents['emit'](_0x49d31f,_0x394957);_0x3f1e7c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xb689('0x7')](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 6291268..d7cc13b 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 _0x1d99=['bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','findOne','then','update','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment'];(function(_0x35d114,_0x3ae2ec){var _0x1a2c9b=function(_0x559618){while(--_0x559618){_0x35d114['push'](_0x35d114['shift']());}};_0x1a2c9b(++_0x3ae2ec);}(_0x1d99,0xaa));var _0x91d9=function(_0x427100,_0x5815c5){_0x427100=_0x427100-0x0;var _0x473b2a=_0x1d99[_0x427100];return _0x473b2a;};'use strict';var _=require(_0x91d9('0x0'));var util=require(_0x91d9('0x1'));var logger=require(_0x91d9('0x2'))('api');var moment=require(_0x91d9('0x3'));var BPromise=require(_0x91d9('0x4'));var rp=require(_0x91d9('0x5'));var fs=require('fs');var path=require(_0x91d9('0x6'));var rimraf=require(_0x91d9('0x7'));var config=require('../../config/environment');var attributes=require(_0x91d9('0x8'));module[_0x91d9('0x9')]=function(_0x10f31b,_0x57a450){return _0x10f31b[_0x91d9('0xa')](_0x91d9('0xb'),attributes,{'tableName':_0x91d9('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x91d9('0xd')],'type':_0x91d9('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32403e,_0x46dc9c,_0x2a1db4){var _0x3a2b11=_0x10f31b[_0x91d9('0xf')];var _0x15c926=_0x32403e[_0x91d9('0x10')]({'plain':!![]});if(_0x15c926[_0x91d9('0x11')][_0x91d9('0x12')]()==='in'||_0x15c926[_0x91d9('0x11')][_0x91d9('0x12')]()===_0x91d9('0x13')&&!_0x15c926['secret']&&!_[_0x91d9('0x14')](_0x15c926[_0x91d9('0x15')])){_0x3a2b11[_0x91d9('0x16')][_0x91d9('0x17')]({'where':{'id':_0x15c926['ChatInteractionId']}})[_0x91d9('0x18')](function(_0x33545e){if(_0x33545e){_0x33545e[_0x91d9('0x19')]({'lastMsgAt':_0x15c926['createdAt'],'lastMsgDirection':_0x15c926[_0x91d9('0x11')][_0x91d9('0x12')]()});}})['catch'](function(_0x3716bf){console[_0x91d9('0x1a')](_0x3716bf);});}_0x2a1db4();}},'charset':_0x91d9('0x1b'),'collate':_0x91d9('0x1c')});}; \ No newline at end of file +var _0xd2df=['secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction','toLowerCase','out'];(function(_0x238148,_0x5b1614){var _0x173093=function(_0x4b0708){while(--_0x4b0708){_0x238148['push'](_0x238148['shift']());}};_0x173093(++_0x5b1614);}(_0xd2df,0x1ea));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd2d('0x0'));var util=require(_0xfd2d('0x1'));var logger=require(_0xfd2d('0x2'))(_0xfd2d('0x3'));var moment=require(_0xfd2d('0x4'));var BPromise=require(_0xfd2d('0x5'));var rp=require(_0xfd2d('0x6'));var fs=require('fs');var path=require(_0xfd2d('0x7'));var rimraf=require('rimraf');var config=require(_0xfd2d('0x8'));var attributes=require(_0xfd2d('0x9'));module[_0xfd2d('0xa')]=function(_0x527e96,_0x2e0208){return _0x527e96[_0xfd2d('0xb')](_0xfd2d('0xc'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0xfd2d('0xd'),'fields':['body'],'type':_0xfd2d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x502f3d,_0x5ea753,_0x2fe79c){var _0x33c46e=_0x527e96[_0xfd2d('0xf')];var _0x5f4ee3=_0x502f3d[_0xfd2d('0x10')]({'plain':!![]});if(_0x5f4ee3[_0xfd2d('0x11')]['toLowerCase']()==='in'||_0x5f4ee3[_0xfd2d('0x11')][_0xfd2d('0x12')]()===_0xfd2d('0x13')&&!_0x5f4ee3[_0xfd2d('0x14')]&&!_[_0xfd2d('0x15')](_0x5f4ee3[_0xfd2d('0x16')])){_0x33c46e[_0xfd2d('0x17')][_0xfd2d('0x18')]({'where':{'id':_0x5f4ee3['ChatInteractionId']}})[_0xfd2d('0x19')](function(_0x2b86c0){if(_0x2b86c0){_0x2b86c0[_0xfd2d('0x1a')]({'lastMsgAt':_0x5f4ee3[_0xfd2d('0x1b')],'lastMsgDirection':_0x5f4ee3[_0xfd2d('0x11')]['toLowerCase']()});}})['catch'](function(_0x44cdc3){console['error'](_0x44cdc3);});}_0x2fe79c();}},'charset':_0xfd2d('0x1c'),'collate':_0xfd2d('0x1d')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 032e8b6..d1696e7 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 _0x88cf=['stringify','error','message','catch','create','body','options','CreateChatMessage','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s'];(function(_0x4ef534,_0x47a7d0){var _0x8fffbb=function(_0x2ae897){while(--_0x2ae897){_0x4ef534['push'](_0x4ef534['shift']());}};_0x8fffbb(++_0x47a7d0);}(_0x88cf,0x1a9));var _0xf88c=function(_0x2df52e,_0x36a22a){_0x2df52e=_0x2df52e-0x0;var _0x4b7122=_0x88cf[_0x2df52e];return _0x4b7122;};'use strict';var _=require(_0xf88c('0x0'));var util=require(_0xf88c('0x1'));var moment=require(_0xf88c('0x2'));var BPromise=require('bluebird');var rs=require(_0xf88c('0x3'));var fs=require('fs');var Redis=require(_0xf88c('0x4'));var db=require(_0xf88c('0x5'))['db'];var utils=require(_0xf88c('0x6'));var logger=require(_0xf88c('0x7'))(_0xf88c('0x8'));var config=require(_0xf88c('0x9'));var jayson=require(_0xf88c('0xa'));var client=jayson[_0xf88c('0xb')][_0xf88c('0xc')]({'port':0x232a});config['redis']=_[_0xf88c('0xd')](config[_0xf88c('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xf88c('0xf'))(new Redis(config[_0xf88c('0xe')]));require('./chatMessage.socket')[_0xf88c('0x10')](socket);function respondWithRpcPromise(_0x208254,_0x523faf,_0x6501b2){return new BPromise(function(_0x2565ef,_0x381803){return client[_0xf88c('0x11')](_0x208254,_0x6501b2)[_0xf88c('0x12')](function(_0x55cdbc){logger[_0xf88c('0x13')](_0xf88c('0x14'),_0x523faf,_0xf88c('0x15'));logger['debug'](_0xf88c('0x16'),_0x523faf,'request\x20sent',JSON[_0xf88c('0x17')](_0x55cdbc));if(_0x55cdbc[_0xf88c('0x18')]){if(_0x55cdbc[_0xf88c('0x18')]['code']===0x1f4){logger['error'](_0xf88c('0x14'),_0x523faf,_0x55cdbc[_0xf88c('0x18')]['message']);return _0x381803(_0x55cdbc[_0xf88c('0x18')][_0xf88c('0x19')]);}logger['error'](_0xf88c('0x14'),_0x523faf,_0x55cdbc[_0xf88c('0x18')]['message']);return _0x2565ef(_0x55cdbc['error'][_0xf88c('0x19')]);}else{logger['info'](_0xf88c('0x14'),_0x523faf,_0xf88c('0x15'));_0x2565ef(_0x55cdbc['result'][_0xf88c('0x19')]);}})[_0xf88c('0x1a')](function(_0x321bad){logger[_0xf88c('0x18')](_0xf88c('0x14'),_0x523faf,_0x321bad);_0x381803(_0x321bad);});});}exports['CreateChatMessage']=function(_0x8dbb60){var _0x143a98=this;return new Promise(function(_0x36b945,_0x535aa){return db['ChatMessage'][_0xf88c('0x1b')](_0x8dbb60[_0xf88c('0x1c')],{'raw':_0x8dbb60[_0xf88c('0x1d')]?_0x8dbb60['options']['raw']===undefined?!![]:![]:!![]})[_0xf88c('0x12')](function(_0x834a6a){logger[_0xf88c('0x13')](_0xf88c('0x1e'),_0x8dbb60);logger[_0xf88c('0x1f')](_0xf88c('0x1e'),_0x8dbb60,JSON[_0xf88c('0x17')](_0x834a6a));_0x36b945(_0x834a6a);})[_0xf88c('0x1a')](function(_0x44e68c){logger[_0xf88c('0x18')](_0xf88c('0x1e'),_0x44e68c[_0xf88c('0x19')],_0x8dbb60);_0x535aa(_0x143a98[_0xf88c('0x18')](0x1f4,_0x44e68c[_0xf88c('0x19')]));});});}; \ No newline at end of file +var _0x5203=['./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','create','body','options','raw','debug','util','moment','randomstring','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost'];(function(_0xa1b6,_0x22e95e){var _0x5e789b=function(_0x533b58){while(--_0x533b58){_0xa1b6['push'](_0xa1b6['shift']());}};_0x5e789b(++_0x22e95e);}(_0x5203,0x12a));var _0x3520=function(_0x70049e,_0x52c59b){_0x70049e=_0x70049e-0x0;var _0x1691b0=_0x5203[_0x70049e];return _0x1691b0;};'use strict';var _=require('lodash');var util=require(_0x3520('0x0'));var moment=require(_0x3520('0x1'));var BPromise=require('bluebird');var rs=require(_0x3520('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3520('0x3'))(_0x3520('0x4'));var config=require(_0x3520('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3520('0x6')]['http']({'port':0x232a});config[_0x3520('0x7')]=_[_0x3520('0x8')](config['redis'],{'host':_0x3520('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3520('0x7')]));require(_0x3520('0xa'))['register'](socket);function respondWithRpcPromise(_0x56015e,_0x313ddd,_0x8e6318){return new BPromise(function(_0x2b425d,_0x352b08){return client[_0x3520('0xb')](_0x56015e,_0x8e6318)[_0x3520('0xc')](function(_0x4f51b9){logger[_0x3520('0xd')](_0x3520('0xe'),_0x313ddd,_0x3520('0xf'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x313ddd,_0x3520('0xf'),JSON[_0x3520('0x10')](_0x4f51b9));if(_0x4f51b9[_0x3520('0x11')]){if(_0x4f51b9[_0x3520('0x11')]['code']===0x1f4){logger[_0x3520('0x11')]('ChatMessage,\x20%s,\x20%s',_0x313ddd,_0x4f51b9['error'][_0x3520('0x12')]);return _0x352b08(_0x4f51b9['error']['message']);}logger[_0x3520('0x11')](_0x3520('0xe'),_0x313ddd,_0x4f51b9[_0x3520('0x11')][_0x3520('0x12')]);return _0x2b425d(_0x4f51b9[_0x3520('0x11')][_0x3520('0x12')]);}else{logger['info'](_0x3520('0xe'),_0x313ddd,_0x3520('0xf'));_0x2b425d(_0x4f51b9[_0x3520('0x13')][_0x3520('0x12')]);}})[_0x3520('0x14')](function(_0x32c534){logger[_0x3520('0x11')](_0x3520('0xe'),_0x313ddd,_0x32c534);_0x352b08(_0x32c534);});});}exports[_0x3520('0x15')]=function(_0x579c42){var _0x53cbfb=this;return new Promise(function(_0x16bfce,_0x120c65){return db[_0x3520('0x16')][_0x3520('0x17')](_0x579c42[_0x3520('0x18')],{'raw':_0x579c42[_0x3520('0x19')]?_0x579c42[_0x3520('0x19')][_0x3520('0x1a')]===undefined?!![]:![]:!![]})[_0x3520('0xc')](function(_0x4aa64c){logger['info']('CreateChatMessage',_0x579c42);logger[_0x3520('0x1b')]('CreateChatMessage',_0x579c42,JSON[_0x3520('0x10')](_0x4aa64c));_0x16bfce(_0x4aa64c);})[_0x3520('0x14')](function(_0x45d2eb){logger['error'](_0x3520('0x15'),_0x45d2eb[_0x3520('0x12')],_0x579c42);_0x120c65(_0x53cbfb[_0x3520('0x11')](0x1f4,_0x45d2eb[_0x3520('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 9d8d5e6..5349f65 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 _0x5a2a=['removeListener','register','chatMessage:','./chatMessage.events','save','remove','update','emit'];(function(_0x302d39,_0x463596){var _0x3efb40=function(_0xcb50eb){while(--_0xcb50eb){_0x302d39['push'](_0x302d39['shift']());}};_0x3efb40(++_0x463596);}(_0x5a2a,0x1c3));var _0xa5a2=function(_0x5a0bc6,_0x954bbe){_0x5a0bc6=_0x5a0bc6-0x0;var _0x22c3b6=_0x5a2a[_0x5a0bc6];return _0x22c3b6;};'use strict';var ChatMessageEvents=require(_0xa5a2('0x0'));var events=[_0xa5a2('0x1'),_0xa5a2('0x2'),_0xa5a2('0x3')];function createListener(_0x5d3456,_0x525e94){return function(_0x48308f){_0x525e94[_0xa5a2('0x4')](_0x5d3456,_0x48308f);};}function removeListener(_0x2cf196,_0x479d0a){return function(){ChatMessageEvents[_0xa5a2('0x5')](_0x2cf196,_0x479d0a);};}exports[_0xa5a2('0x6')]=function(_0x2e97d3){for(var _0x55728b=0x0,_0x179722=events['length'];_0x55728b<_0x179722;_0x55728b++){var _0x38a5fe=events[_0x55728b];var _0x97f75c=createListener(_0xa5a2('0x7')+_0x38a5fe,_0x2e97d3);ChatMessageEvents['on'](_0x38a5fe,_0x97f75c);}}; \ No newline at end of file +var _0xfb65=['emit','removeListener','register','length','save','remove'];(function(_0x2abc3d,_0x48edca){var _0x252745=function(_0x32bb6f){while(--_0x32bb6f){_0x2abc3d['push'](_0x2abc3d['shift']());}};_0x252745(++_0x48edca);}(_0xfb65,0x82));var _0x5fb6=function(_0x211ee1,_0x2eb0a3){_0x211ee1=_0x211ee1-0x0;var _0x3d1c69=_0xfb65[_0x211ee1];return _0x3d1c69;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x5fb6('0x0'),_0x5fb6('0x1'),'update'];function createListener(_0x860687,_0x54af6d){return function(_0x194bac){_0x54af6d[_0x5fb6('0x2')](_0x860687,_0x194bac);};}function removeListener(_0xca6345,_0xb5f7c4){return function(){ChatMessageEvents[_0x5fb6('0x3')](_0xca6345,_0xb5f7c4);};}exports[_0x5fb6('0x4')]=function(_0x4dec8f){for(var _0x50782b=0x0,_0x238914=events[_0x5fb6('0x5')];_0x50782b<_0x238914;_0x50782b++){var _0x1f99b8=events[_0x50782b];var _0x840390=createListener('chatMessage:'+_0x1f99b8,_0x4dec8f);ChatMessageEvents['on'](_0x1f99b8,_0x840390);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 139f218..76f04e1 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 _0x3a5a=['chat','chatmessage:create','create','put','/:id/accept','accept','/:id/reject','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/:id','show','post','tracked'];(function(_0x3efd98,_0x5a231a){var _0x3d99b7=function(_0x5d8a4e){while(--_0x5d8a4e){_0x3efd98['push'](_0x3efd98['shift']());}};_0x3d99b7(++_0x5a231a);}(_0x3a5a,0xb8));var _0xa3a5=function(_0x51c560,_0x4e6c0e){_0x51c560=_0x51c560-0x0;var _0x594579=_0x3a5a[_0x51c560];return _0x594579;};'use strict';var multer=require('multer');var util=require(_0xa3a5('0x0'));var path=require(_0xa3a5('0x1'));var timeout=require(_0xa3a5('0x2'));var express=require(_0xa3a5('0x3'));var router=express[_0xa3a5('0x4')]();var fs_extra=require(_0xa3a5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa3a5('0x6'));var config=require(_0xa3a5('0x7'));var controller=require(_0xa3a5('0x8'));router[_0xa3a5('0x9')]('/',auth[_0xa3a5('0xa')](),controller[_0xa3a5('0xb')]);router[_0xa3a5('0x9')]('/describe',auth[_0xa3a5('0xa')](),controller['describe']);router[_0xa3a5('0x9')](_0xa3a5('0xc'),auth[_0xa3a5('0xa')](),controller[_0xa3a5('0xd')]);router[_0xa3a5('0xe')]('/',auth[_0xa3a5('0xa')](),interaction[_0xa3a5('0xf')](_0xa3a5('0x10'),_0xa3a5('0x11')),controller[_0xa3a5('0x12')]);router['put']('/:id',controller['update']);router[_0xa3a5('0x13')](_0xa3a5('0x14'),auth[_0xa3a5('0xa')](),controller[_0xa3a5('0x15')]);router[_0xa3a5('0x13')](_0xa3a5('0x16'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0xa3a5('0xc'),auth[_0xa3a5('0xa')](),controller[_0xa3a5('0x17')]);module[_0xa3a5('0x18')]=router; \ No newline at end of file +var _0xf631=['put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf631,0x1a7));var _0x1f63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf631[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x1f63('0x0'));var util=require(_0x1f63('0x1'));var path=require('path');var timeout=require(_0x1f63('0x2'));var express=require('express');var router=express[_0x1f63('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1f63('0x4'));var interaction=require(_0x1f63('0x5'));var config=require(_0x1f63('0x6'));var controller=require('./chatMessage.controller');router[_0x1f63('0x7')]('/',auth[_0x1f63('0x8')](),controller[_0x1f63('0x9')]);router['get'](_0x1f63('0xa'),auth[_0x1f63('0x8')](),controller[_0x1f63('0xb')]);router[_0x1f63('0x7')](_0x1f63('0xc'),auth[_0x1f63('0x8')](),controller[_0x1f63('0xd')]);router[_0x1f63('0xe')]('/',auth[_0x1f63('0x8')](),interaction[_0x1f63('0xf')](_0x1f63('0x10'),_0x1f63('0x11')),controller[_0x1f63('0x12')]);router[_0x1f63('0x13')](_0x1f63('0xc'),controller[_0x1f63('0x14')]);router[_0x1f63('0x13')](_0x1f63('0x15'),auth['isAuthenticated'](),controller[_0x1f63('0x16')]);router[_0x1f63('0x13')](_0x1f63('0x17'),auth[_0x1f63('0x8')](),controller['reject']);router['delete'](_0x1f63('0xc'),auth[_0x1f63('0x8')](),controller[_0x1f63('0x18')]);module[_0x1f63('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 3b426d6..1fa7aa7 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x3461f2,_0x1e93f9){var _0x59f44a=function(_0x509c86){while(--_0x509c86){_0x3461f2['push'](_0x3461f2['shift']());}};_0x59f44a(++_0x1e93f9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x190690,_0x2885ea){_0x190690=_0x190690-0x0;var _0x362375=_0x5f2f[_0x190690];return _0x362375;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x5f66=['medium','TEXT','exports'];(function(_0x1528fe,_0x23836f){var _0x3241ee=function(_0x241b06){while(--_0x241b06){_0x1528fe['push'](_0x1528fe['shift']());}};_0x3241ee(++_0x23836f);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x5f66[_0x3ab9ee];return _0x82ee88;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 960fce8..9523fdb 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(_0x5447fd,_0x52a6b5){var _0x15b28a=function(_0x370d4f){while(--_0x370d4f){_0x5447fd['push'](_0x5447fd['shift']());}};_0x15b28a(++_0x52a6b5);}(_0x7a54,0x106));var _0x47a5=function(_0x5b860c,_0x296311){_0x5b860c=_0x5b860c-0x0;var _0x32b630=_0x7a54[_0x5b860c];return _0x32b630;};'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(_0x47a443,_0x1c1b3f){var _0x2848c0=function(_0x2314d1){while(--_0x2314d1){_0x47a443['push'](_0x47a443['shift']());}};_0x2848c0(++_0x1c1b3f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 6eee19d..eb991cc 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e50=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','save','remove'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x4e50,0xdc));var _0x04e5=function(_0x448f50,_0x5587ba){_0x448f50=_0x448f50-0x0;var _0x2af4c3=_0x4e50[_0x448f50];return _0x2af4c3;};'use strict';var EventEmitter=require(_0x04e5('0x0'));var ChatOfflineMessage=require(_0x04e5('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x04e5('0x2'),'afterUpdate':'update','afterDestroy':_0x04e5('0x3')};function emitEvent(_0x1bd796){return function(_0x36b094,_0x48b2bd,_0x10a33d){ChatOfflineMessageEvents[_0x04e5('0x4')](_0x1bd796+':'+_0x36b094['id'],_0x36b094);ChatOfflineMessageEvents['emit'](_0x1bd796,_0x36b094);_0x10a33d(null);};}for(var e in events){if(events[_0x04e5('0x5')](e)){var event=events[e];ChatOfflineMessage[_0x04e5('0x6')](e,emitEvent(event));}}module[_0x04e5('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0x5ee2=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0xe14c69,_0x5a8843){var _0x32641e=function(_0x49f343){while(--_0x49f343){_0xe14c69['push'](_0xe14c69['shift']());}};_0x32641e(++_0x5a8843);}(_0x5ee2,0x1b3));var _0x25ee=function(_0x1c81c6,_0x154f45){_0x1c81c6=_0x1c81c6-0x0;var _0x178c1b=_0x5ee2[_0x1c81c6];return _0x178c1b;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x25ee('0x0'))['db'][_0x25ee('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x25ee('0x2')](0x0);var events={'afterCreate':_0x25ee('0x3'),'afterUpdate':_0x25ee('0x4'),'afterDestroy':_0x25ee('0x5')};function emitEvent(_0x4a70da){return function(_0x1df61c,_0x5aeab4,_0x5d6b1c){ChatOfflineMessageEvents[_0x25ee('0x6')](_0x4a70da+':'+_0x1df61c['id'],_0x1df61c);ChatOfflineMessageEvents[_0x25ee('0x6')](_0x4a70da,_0x1df61c);_0x5d6b1c(null);};}for(var e in events){if(events[_0x25ee('0x7')](e)){var event=events[e];ChatOfflineMessage[_0x25ee('0x8')](e,emitEvent(event));}}module[_0x25ee('0x9')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f21dea6..389d851 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 _0x663d=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages'];(function(_0xe32be3,_0x328dd7){var _0x3764d1=function(_0x58fd51){while(--_0x58fd51){_0xe32be3['push'](_0xe32be3['shift']());}};_0x3764d1(++_0x328dd7);}(_0x663d,0x10c));var _0xd663=function(_0x4ef8fc,_0x583a22){_0x4ef8fc=_0x4ef8fc-0x0;var _0x1a753c=_0x663d[_0x4ef8fc];return _0x1a753c;};'use strict';var attributes=require(_0xd663('0x0'));module[_0xd663('0x1')]=function(_0x2ad2c2){return _0x2ad2c2[_0xd663('0x2')](_0xd663('0x3'),attributes,{'tableName':_0xd663('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd663('0x5'),'collate':_0xd663('0x6')});}; \ No newline at end of file +var _0x99dc=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x20fb02,_0x96c029){var _0x24a33e=function(_0x4b5c8a){while(--_0x4b5c8a){_0x20fb02['push'](_0x20fb02['shift']());}};_0x24a33e(++_0x96c029);}(_0x99dc,0x9a));var _0xc99d=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x99dc[_0x5c6299];return _0x23b564;};'use strict';var attributes=require(_0xc99d('0x0'));module[_0xc99d('0x1')]=function(_0x18202b){return _0x18202b[_0xc99d('0x2')](_0xc99d('0x3'),attributes,{'tableName':_0xc99d('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc99d('0x5'),'collate':_0xc99d('0x6')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index f2ec268..eb42b09 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 _0xb6aa=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','ChatOfflineMessage,\x20%s,\x20%s','debug'];(function(_0x4b8d84,_0x347c3c){var _0xe15825=function(_0x52954f){while(--_0x52954f){_0x4b8d84['push'](_0x4b8d84['shift']());}};_0xe15825(++_0x347c3c);}(_0xb6aa,0x10b));var _0xab6a=function(_0x312df2,_0x2e1d03){_0x312df2=_0x312df2-0x0;var _0x52b45a=_0xb6aa[_0x312df2];return _0x52b45a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab6a('0x0'));var BPromise=require(_0xab6a('0x1'));var rs=require(_0xab6a('0x2'));var fs=require('fs');var Redis=require(_0xab6a('0x3'));var db=require(_0xab6a('0x4'))['db'];var utils=require(_0xab6a('0x5'));var logger=require(_0xab6a('0x6'))(_0xab6a('0x7'));var config=require('../../config/environment');var jayson=require(_0xab6a('0x8'));var client=jayson['client'][_0xab6a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f2ab9,_0x554c88,_0x15df84){return new BPromise(function(_0x2c6d33,_0x57697c){return client['request'](_0x2f2ab9,_0x15df84)['then'](function(_0xf8166c){logger[_0xab6a('0xa')](_0xab6a('0xb'),_0x554c88,'request\x20sent');logger[_0xab6a('0xc')](_0xab6a('0xd'),_0x554c88,_0xab6a('0xe'),JSON[_0xab6a('0xf')](_0xf8166c));if(_0xf8166c[_0xab6a('0x10')]){if(_0xf8166c[_0xab6a('0x10')]['code']===0x1f4){logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0xf8166c['error']['message']);return _0x57697c(_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);}logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);return _0x2c6d33(_0xf8166c[_0xab6a('0x10')][_0xab6a('0x11')]);}else{logger[_0xab6a('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x554c88,_0xab6a('0xe'));_0x2c6d33(_0xf8166c[_0xab6a('0x12')][_0xab6a('0x11')]);}})[_0xab6a('0x13')](function(_0x579096){logger[_0xab6a('0x10')](_0xab6a('0xb'),_0x554c88,_0x579096);_0x57697c(_0x579096);});});} \ No newline at end of file +var _0x83b4=['message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83b4,0x1a7));var _0x483b=function(_0xdd8706,_0x5f1e86){_0xdd8706=_0xdd8706-0x0;var _0x2b2843=_0x83b4[_0xdd8706];return _0x2b2843;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x483b('0x0'));var BPromise=require(_0x483b('0x1'));var rs=require(_0x483b('0x2'));var fs=require('fs');var Redis=require(_0x483b('0x3'));var db=require(_0x483b('0x4'))['db'];var utils=require(_0x483b('0x5'));var logger=require(_0x483b('0x6'))(_0x483b('0x7'));var config=require(_0x483b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x483b('0x9')][_0x483b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1065f8,_0x303de0,_0x440e98){return new BPromise(function(_0x989b7f,_0x155398){return client[_0x483b('0xb')](_0x1065f8,_0x440e98)[_0x483b('0xc')](function(_0x4befb7){logger[_0x483b('0xd')](_0x483b('0xe'),_0x303de0,'request\x20sent');logger['debug'](_0x483b('0xf'),_0x303de0,_0x483b('0x10'),JSON['stringify'](_0x4befb7));if(_0x4befb7[_0x483b('0x11')]){if(_0x4befb7[_0x483b('0x11')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x303de0,_0x4befb7[_0x483b('0x11')][_0x483b('0x12')]);return _0x155398(_0x4befb7['error'][_0x483b('0x12')]);}logger['error'](_0x483b('0xe'),_0x303de0,_0x4befb7[_0x483b('0x11')][_0x483b('0x12')]);return _0x989b7f(_0x4befb7[_0x483b('0x11')][_0x483b('0x12')]);}else{logger['info'](_0x483b('0xe'),_0x303de0,_0x483b('0x10'));_0x989b7f(_0x4befb7[_0x483b('0x13')][_0x483b('0x12')]);}})[_0x483b('0x14')](function(_0x20181a){logger[_0x483b('0x11')](_0x483b('0xe'),_0x303de0,_0x20181a);_0x155398(_0x20181a);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 098fc95..6707e96 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 _0xbe7b=['describe','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','/describe','isAuthenticated'];(function(_0xb096ef,_0x20ebdf){var _0x5ac5b=function(_0x11b4be){while(--_0x11b4be){_0xb096ef['push'](_0xb096ef['shift']());}};_0x5ac5b(++_0x20ebdf);}(_0xbe7b,0x1ac));var _0xbbe7=function(_0x4d3a9b,_0x20b47d){_0x4d3a9b=_0x4d3a9b-0x0;var _0x1b5471=_0xbe7b[_0x4d3a9b];return _0x1b5471;};'use strict';var multer=require(_0xbbe7('0x0'));var util=require('util');var path=require(_0xbbe7('0x1'));var timeout=require(_0xbbe7('0x2'));var express=require(_0xbbe7('0x3'));var router=express[_0xbbe7('0x4')]();var fs_extra=require(_0xbbe7('0x5'));var auth=require(_0xbbe7('0x6'));var interaction=require(_0xbbe7('0x7'));var config=require(_0xbbe7('0x8'));var controller=require(_0xbbe7('0x9'));router[_0xbbe7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbbe7('0xa')](_0xbbe7('0xb'),auth[_0xbbe7('0xc')](),controller[_0xbbe7('0xd')]);router[_0xbbe7('0xa')](_0xbbe7('0xe'),auth[_0xbbe7('0xc')](),controller[_0xbbe7('0xf')]);router[_0xbbe7('0x10')]('/',auth[_0xbbe7('0xc')](),controller[_0xbbe7('0x11')]);router['put'](_0xbbe7('0xe'),auth[_0xbbe7('0xc')](),controller[_0xbbe7('0x12')]);router[_0xbbe7('0x13')]('/:id',auth[_0xbbe7('0xc')](),controller['destroy']);module[_0xbbe7('0x14')]=router; \ No newline at end of file +var _0x7579=['../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/:id','post','create','put','destroy','exports','multer','express','Router','fs-extra'];(function(_0x3d7181,_0x2027f1){var _0x4fdf6c=function(_0x1a5a35){while(--_0x1a5a35){_0x3d7181['push'](_0x3d7181['shift']());}};_0x4fdf6c(++_0x2027f1);}(_0x7579,0x10a));var _0x9757=function(_0x276ec7,_0x3bc9f9){_0x276ec7=_0x276ec7-0x0;var _0xffa130=_0x7579[_0x276ec7];return _0xffa130;};'use strict';var multer=require(_0x9757('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9757('0x1'));var router=express[_0x9757('0x2')]();var fs_extra=require(_0x9757('0x3'));var auth=require(_0x9757('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9757('0x5'));var controller=require(_0x9757('0x6'));router[_0x9757('0x7')]('/',auth[_0x9757('0x8')](),controller['index']);router['get']('/describe',auth[_0x9757('0x8')](),controller['describe']);router['get'](_0x9757('0x9'),auth[_0x9757('0x8')](),controller['show']);router[_0x9757('0xa')]('/',auth[_0x9757('0x8')](),controller[_0x9757('0xb')]);router[_0x9757('0xc')](_0x9757('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x9757('0x9'),auth[_0x9757('0x8')](),controller[_0x9757('0xd')]);module[_0x9757('0xe')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0afc9b9..7a86cc5 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 _0x5f2f=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0x5f2f,0x1c2));var _0xf5f2=function(_0x327d37,_0x89de5e){_0x327d37=_0x327d37-0x0;var _0x10a776=_0x5f2f[_0x327d37];return _0x10a776;};'use strict';var Sequelize=require('sequelize');module[_0xf5f2('0x0')]={'name':{'type':Sequelize[_0xf5f2('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3'),_0xf5f2('0x4')),'defaultValue':_0xf5f2('0x3')},'selector':{'type':Sequelize[_0xf5f2('0x1')]},'timeout':{'type':Sequelize[_0xf5f2('0x5')]}}; \ No newline at end of file +var _0xcfd1=['INTEGER','sequelize','exports','ENUM','mouseOver'];(function(_0x51db38,_0x1f8778){var _0x21db64=function(_0x3276f5){while(--_0x3276f5){_0x51db38['push'](_0x51db38['shift']());}};_0x21db64(++_0x1f8778);}(_0xcfd1,0x150));var _0x1cfd=function(_0x5ced50,_0x3f8d27){_0x5ced50=_0x5ced50-0x0;var _0x50a749=_0xcfd1[_0x5ced50];return _0x50a749;};'use strict';var Sequelize=require(_0x1cfd('0x0'));module[_0x1cfd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x1cfd('0x2')](_0x1cfd('0x3'),'timeout'),'defaultValue':_0x1cfd('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x1cfd('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 228c60b..913ee24 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 _0x0686=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','update','then','destroy','error','stack','name','send','show','params','model','keys','ChatProactiveAction','rawAttributes','query','intersection','attributes','fields','length','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x5c0919,_0x13b252){var _0x457116=function(_0x4d58e7){while(--_0x4d58e7){_0x5c0919['push'](_0x5c0919['shift']());}};_0x457116(++_0x13b252);}(_0x0686,0x123));var _0x6068=function(_0xf52cca,_0x134bba){_0xf52cca=_0xf52cca-0x0;var _0x11d19c=_0x0686[_0xf52cca];return _0x11d19c;};'use strict';var emlformat=require(_0x6068('0x0'));var rimraf=require(_0x6068('0x1'));var zipdir=require(_0x6068('0x2'));var jsonpatch=require(_0x6068('0x3'));var rp=require(_0x6068('0x4'));var moment=require(_0x6068('0x5'));var BPromise=require(_0x6068('0x6'));var Mustache=require('mustache');var util=require(_0x6068('0x7'));var path=require(_0x6068('0x8'));var sox=require(_0x6068('0x9'));var csv=require(_0x6068('0xa'));var ejs=require(_0x6068('0xb'));var fs=require('fs');var fs_extra=require(_0x6068('0xc'));var _=require(_0x6068('0xd'));var squel=require(_0x6068('0xe'));var crypto=require(_0x6068('0xf'));var jsforce=require(_0x6068('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x6068('0xa'));var querystring=require(_0x6068('0x11'));var Papa=require(_0x6068('0x12'));var Redis=require(_0x6068('0x13'));var authService=require(_0x6068('0x14'));var qs=require(_0x6068('0x15'));var as=require(_0x6068('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6068('0x17'))(_0x6068('0x18'));var utils=require(_0x6068('0x19'));var config=require(_0x6068('0x1a'));var licenseUtil=require(_0x6068('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f8918,_0x3a67ec){_0x3a67ec=_0x3a67ec||0xcc;return function(_0x5eba85){if(_0x5eba85){return _0x1f8918[_0x6068('0x1c')](_0x3a67ec);}return _0x1f8918[_0x6068('0x1d')](_0x3a67ec)[_0x6068('0x1e')]();};}function respondWithResult(_0x31b190,_0x1257b2){_0x1257b2=_0x1257b2||0xc8;return function(_0x1eb53c){if(_0x1eb53c){return _0x31b190[_0x6068('0x1d')](_0x1257b2)[_0x6068('0x1f')](_0x1eb53c);}};}function respondWithFilteredResult(_0xcb09de,_0x5d50c5){return function(_0x45a455){if(_0x45a455){var _0x1416b7=typeof _0x5d50c5['offset']===_0x6068('0x20')&&typeof _0x5d50c5[_0x6068('0x21')]===_0x6068('0x20');var _0x321d80=_0x45a455['count'];var _0x47e38a=_0x1416b7?0x0:_0x5d50c5[_0x6068('0x22')];var _0x1f0e7e=_0x1416b7?_0x45a455[_0x6068('0x23')]:_0x5d50c5[_0x6068('0x22')]+_0x5d50c5['limit'];var _0x4d5a09;if(_0x1f0e7e>=_0x321d80){_0x1f0e7e=_0x321d80;_0x4d5a09=0xc8;}else{_0x4d5a09=0xce;}_0xcb09de[_0x6068('0x1d')](_0x4d5a09);return _0xcb09de[_0x6068('0x24')](_0x6068('0x25'),_0x47e38a+'-'+_0x1f0e7e+'/'+_0x321d80)[_0x6068('0x1f')](_0x45a455);}return null;};}function patchUpdates(_0x247c2d){return function(_0x149512){try{jsonpatch[_0x6068('0x26')](_0x149512,_0x247c2d,!![]);}catch(_0x4ee2eb){return BPromise['reject'](_0x4ee2eb);}return _0x149512['save']();};}function saveUpdates(_0x3fea81,_0x138946){return function(_0x1b4f91){if(_0x1b4f91){return _0x1b4f91[_0x6068('0x27')](_0x3fea81)[_0x6068('0x28')](function(_0xa6c2a0){return _0xa6c2a0;});}return null;};}function removeEntity(_0x1046f3,_0x132793){return function(_0x5cf58c){if(_0x5cf58c){return _0x5cf58c[_0x6068('0x29')]()[_0x6068('0x28')](function(){_0x1046f3['status'](0xcc)[_0x6068('0x1e')]();});}};}function handleEntityNotFound(_0x57783a,_0x11f226){return function(_0x464999){if(!_0x464999){_0x57783a[_0x6068('0x1c')](0x194);}return _0x464999;};}function handleError(_0x59cfeb,_0x26b754){_0x26b754=_0x26b754||0x1f4;return function(_0x5a880b){logger[_0x6068('0x2a')](_0x5a880b[_0x6068('0x2b')]);if(_0x5a880b[_0x6068('0x2c')]){delete _0x5a880b[_0x6068('0x2c')];}_0x59cfeb[_0x6068('0x1d')](_0x26b754)[_0x6068('0x2d')](_0x5a880b);};}exports[_0x6068('0x2e')]=function(_0x360ffc,_0x20fc70){var _0xcdc594={'raw':!![],'where':{'id':_0x360ffc[_0x6068('0x2f')]['id']}},_0x49adb6={};_0x49adb6[_0x6068('0x30')]=_[_0x6068('0x31')](db[_0x6068('0x32')][_0x6068('0x33')]);_0x49adb6[_0x6068('0x34')]=_[_0x6068('0x31')](_0x360ffc[_0x6068('0x34')]);_0x49adb6['filters']=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],_0x49adb6[_0x6068('0x34')]);_0xcdc594[_0x6068('0x36')]=_[_0x6068('0x35')](_0x49adb6[_0x6068('0x30')],qs[_0x6068('0x37')](_0x360ffc[_0x6068('0x34')]['fields']));_0xcdc594[_0x6068('0x36')]=_0xcdc594[_0x6068('0x36')][_0x6068('0x38')]?_0xcdc594[_0x6068('0x36')]:_0x49adb6[_0x6068('0x30')];if(_0x360ffc[_0x6068('0x34')]['includeAll']){_0xcdc594['include']=[{'all':!![]}];}_0xcdc594=_[_0x6068('0x39')]({},_0xcdc594,_0x360ffc['options']);return db['ChatProactiveAction'][_0x6068('0x3a')](_0xcdc594)[_0x6068('0x28')](handleEntityNotFound(_0x20fc70,null))['then'](respondWithResult(_0x20fc70,null))[_0x6068('0x3b')](handleError(_0x20fc70,null));};exports[_0x6068('0x3c')]=function(_0x22aadb,_0x44abfd){return db[_0x6068('0x32')][_0x6068('0x3c')](_0x22aadb['body'],{})[_0x6068('0x28')](respondWithResult(_0x44abfd,0xc9))[_0x6068('0x3b')](handleError(_0x44abfd,null));};exports[_0x6068('0x27')]=function(_0x2d8674,_0x10e384){if(_0x2d8674[_0x6068('0x3d')]['id']){delete _0x2d8674[_0x6068('0x3d')]['id'];}return db['ChatProactiveAction']['find']({'where':{'id':_0x2d8674[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x10e384,null))[_0x6068('0x28')](saveUpdates(_0x2d8674[_0x6068('0x3d')],null))[_0x6068('0x28')](respondWithResult(_0x10e384,null))[_0x6068('0x3b')](handleError(_0x10e384,null));};exports[_0x6068('0x29')]=function(_0x4f1dd0,_0x2c350d){return db[_0x6068('0x32')]['find']({'where':{'id':_0x4f1dd0[_0x6068('0x2f')]['id']}})['then'](handleEntityNotFound(_0x2c350d,null))['then'](removeEntity(_0x2c350d,null))[_0x6068('0x3b')](handleError(_0x2c350d,null));}; \ No newline at end of file +var _0x68f5=['end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','show','params','keys','rawAttributes','query','filters','intersection','model','attributes','fields','includeAll','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x58fbb0,_0xe497b5){var _0x1783d2=function(_0x5554a8){while(--_0x5554a8){_0x58fbb0['push'](_0x58fbb0['shift']());}};_0x1783d2(++_0xe497b5);}(_0x68f5,0x11a));var _0x568f=function(_0x32904d,_0x28b13c){_0x32904d=_0x32904d-0x0;var _0x252bd9=_0x68f5[_0x32904d];return _0x252bd9;};'use strict';var emlformat=require(_0x568f('0x0'));var rimraf=require(_0x568f('0x1'));var zipdir=require(_0x568f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x568f('0x3'));var moment=require(_0x568f('0x4'));var BPromise=require(_0x568f('0x5'));var Mustache=require(_0x568f('0x6'));var util=require(_0x568f('0x7'));var path=require('path');var sox=require(_0x568f('0x8'));var csv=require(_0x568f('0x9'));var ejs=require(_0x568f('0xa'));var fs=require('fs');var fs_extra=require(_0x568f('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x568f('0xc'));var jsforce=require(_0x568f('0xd'));var deskjs=require(_0x568f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x568f('0xf'));var Papa=require('papaparse');var Redis=require(_0x568f('0x10'));var authService=require(_0x568f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x568f('0x12'));var hardwareService=require(_0x568f('0x13'));var logger=require(_0x568f('0x14'))(_0x568f('0x15'));var utils=require(_0x568f('0x16'));var config=require(_0x568f('0x17'));var licenseUtil=require(_0x568f('0x18'));var db=require(_0x568f('0x19'))['db'];function respondWithStatusCode(_0x200172,_0x4acf24){_0x4acf24=_0x4acf24||0xcc;return function(_0x341cde){if(_0x341cde){return _0x200172[_0x568f('0x1a')](_0x4acf24);}return _0x200172[_0x568f('0x1b')](_0x4acf24)[_0x568f('0x1c')]();};}function respondWithResult(_0x55fc40,_0x87b903){_0x87b903=_0x87b903||0xc8;return function(_0x53c270){if(_0x53c270){return _0x55fc40['status'](_0x87b903)[_0x568f('0x1d')](_0x53c270);}};}function respondWithFilteredResult(_0x15a4e5,_0x47316e){return function(_0x25e488){if(_0x25e488){var _0xcd73a2=typeof _0x47316e[_0x568f('0x1e')]===_0x568f('0x1f')&&typeof _0x47316e[_0x568f('0x20')]===_0x568f('0x1f');var _0x3d9645=_0x25e488[_0x568f('0x21')];var _0x49b64e=_0xcd73a2?0x0:_0x47316e[_0x568f('0x1e')];var _0x5cc7e2=_0xcd73a2?_0x25e488[_0x568f('0x21')]:_0x47316e[_0x568f('0x1e')]+_0x47316e[_0x568f('0x20')];var _0x1f4912;if(_0x5cc7e2>=_0x3d9645){_0x5cc7e2=_0x3d9645;_0x1f4912=0xc8;}else{_0x1f4912=0xce;}_0x15a4e5[_0x568f('0x1b')](_0x1f4912);return _0x15a4e5[_0x568f('0x22')](_0x568f('0x23'),_0x49b64e+'-'+_0x5cc7e2+'/'+_0x3d9645)[_0x568f('0x1d')](_0x25e488);}return null;};}function patchUpdates(_0x1a09a9){return function(_0x22c4e0){try{jsonpatch[_0x568f('0x24')](_0x22c4e0,_0x1a09a9,!![]);}catch(_0x2c65c6){return BPromise[_0x568f('0x25')](_0x2c65c6);}return _0x22c4e0[_0x568f('0x26')]();};}function saveUpdates(_0x3eb76d,_0x2afe66){return function(_0x2c61ea){if(_0x2c61ea){return _0x2c61ea[_0x568f('0x27')](_0x3eb76d)[_0x568f('0x28')](function(_0x4a248e){return _0x4a248e;});}return null;};}function removeEntity(_0xa2225a,_0x4590a8){return function(_0x20daca){if(_0x20daca){return _0x20daca[_0x568f('0x29')]()['then'](function(){_0xa2225a['status'](0xcc)[_0x568f('0x1c')]();});}};}function handleEntityNotFound(_0x45826b,_0x67f06c){return function(_0x6bb377){if(!_0x6bb377){_0x45826b['sendStatus'](0x194);}return _0x6bb377;};}function handleError(_0x51d57f,_0x3de8ce){_0x3de8ce=_0x3de8ce||0x1f4;return function(_0x577ca6){logger['error'](_0x577ca6['stack']);if(_0x577ca6[_0x568f('0x2a')]){delete _0x577ca6['name'];}_0x51d57f[_0x568f('0x1b')](_0x3de8ce)['send'](_0x577ca6);};}exports[_0x568f('0x2b')]=function(_0x2ff19b,_0x182a1f){var _0x52acac={'raw':!![],'where':{'id':_0x2ff19b[_0x568f('0x2c')]['id']}},_0x209db2={};_0x209db2['model']=_[_0x568f('0x2d')](db['ChatProactiveAction'][_0x568f('0x2e')]);_0x209db2['query']=_['keys'](_0x2ff19b[_0x568f('0x2f')]);_0x209db2[_0x568f('0x30')]=_[_0x568f('0x31')](_0x209db2[_0x568f('0x32')],_0x209db2[_0x568f('0x2f')]);_0x52acac[_0x568f('0x33')]=_[_0x568f('0x31')](_0x209db2[_0x568f('0x32')],qs['fields'](_0x2ff19b[_0x568f('0x2f')][_0x568f('0x34')]));_0x52acac[_0x568f('0x33')]=_0x52acac[_0x568f('0x33')]['length']?_0x52acac[_0x568f('0x33')]:_0x209db2[_0x568f('0x32')];if(_0x2ff19b[_0x568f('0x2f')][_0x568f('0x35')]){_0x52acac[_0x568f('0x36')]=[{'all':!![]}];}_0x52acac=_[_0x568f('0x37')]({},_0x52acac,_0x2ff19b[_0x568f('0x38')]);return db['ChatProactiveAction'][_0x568f('0x39')](_0x52acac)[_0x568f('0x28')](handleEntityNotFound(_0x182a1f,null))[_0x568f('0x28')](respondWithResult(_0x182a1f,null))[_0x568f('0x3a')](handleError(_0x182a1f,null));};exports[_0x568f('0x3b')]=function(_0x4b6608,_0x57c011){return db[_0x568f('0x3c')][_0x568f('0x3b')](_0x4b6608[_0x568f('0x3d')],{})[_0x568f('0x28')](respondWithResult(_0x57c011,0xc9))[_0x568f('0x3a')](handleError(_0x57c011,null));};exports['update']=function(_0x2f78f3,_0x3ca904){if(_0x2f78f3[_0x568f('0x3d')]['id']){delete _0x2f78f3[_0x568f('0x3d')]['id'];}return db[_0x568f('0x3c')][_0x568f('0x39')]({'where':{'id':_0x2f78f3[_0x568f('0x2c')]['id']}})[_0x568f('0x28')](handleEntityNotFound(_0x3ca904,null))[_0x568f('0x28')](saveUpdates(_0x2f78f3[_0x568f('0x3d')],null))[_0x568f('0x28')](respondWithResult(_0x3ca904,null))[_0x568f('0x3a')](handleError(_0x3ca904,null));};exports[_0x568f('0x29')]=function(_0x3e7212,_0x3a2772){return db['ChatProactiveAction'][_0x568f('0x39')]({'where':{'id':_0x3e7212['params']['id']}})['then'](handleEntityNotFound(_0x3a2772,null))[_0x568f('0x28')](removeEntity(_0x3a2772,null))['catch'](handleError(_0x3a2772,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index d0017df..c06ef71 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 _0x0e33=['rimraf','../../config/environment','exports','define','ChatProactiveAction','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x414d9f,_0x11b943){var _0xa4f0de=function(_0xad3c83){while(--_0xad3c83){_0x414d9f['push'](_0x414d9f['shift']());}};_0xa4f0de(++_0x11b943);}(_0x0e33,0xec));var _0x30e3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x0e33[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x30e3('0x0'));var util=require(_0x30e3('0x1'));var logger=require(_0x30e3('0x2'))(_0x30e3('0x3'));var moment=require('moment');var BPromise=require(_0x30e3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30e3('0x5'));var rimraf=require(_0x30e3('0x6'));var config=require(_0x30e3('0x7'));var attributes=require('./chatProactiveAction.attributes');module[_0x30e3('0x8')]=function(_0x57ade1,_0xeef9cf){return _0x57ade1[_0x30e3('0x9')](_0x30e3('0xa'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x013b=['request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','api','moment'];(function(_0x53b6aa,_0x175561){var _0x4160f8=function(_0x4fe530){while(--_0x4fe530){_0x53b6aa['push'](_0x53b6aa['shift']());}};_0x4160f8(++_0x175561);}(_0x013b,0x99));var _0xb013=function(_0x2f88bf,_0x761a0e){_0x2f88bf=_0x2f88bf-0x0;var _0x1b451e=_0x013b[_0x2f88bf];return _0x1b451e;};'use strict';var _=require('lodash');var util=require(_0xb013('0x0'));var logger=require('../../config/logger')(_0xb013('0x1'));var moment=require(_0xb013('0x2'));var BPromise=require('bluebird');var rp=require(_0xb013('0x3'));var fs=require('fs');var path=require(_0xb013('0x4'));var rimraf=require(_0xb013('0x5'));var config=require(_0xb013('0x6'));var attributes=require(_0xb013('0x7'));module[_0xb013('0x8')]=function(_0x16fa4c,_0x411d3e){return _0x16fa4c[_0xb013('0x9')](_0xb013('0xa'),attributes,{'tableName':_0xb013('0xb'),'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 edf38b4..6986bcd 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 _0xd10e=['code','message','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0xd10e,0x1e3));var _0xed10=function(_0x382c73,_0x199cab){_0x382c73=_0x382c73-0x0;var _0x1dd0bf=_0xd10e[_0x382c73];return _0x1dd0bf;};'use strict';var _=require(_0xed10('0x0'));var util=require(_0xed10('0x1'));var moment=require(_0xed10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed10('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xed10('0x4'));var logger=require(_0xed10('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xed10('0x6'));var client=jayson[_0xed10('0x7')][_0xed10('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x111746,_0x4a9cd2,_0x541b32){return new BPromise(function(_0x4a4819,_0x22a649){return client[_0xed10('0x9')](_0x111746,_0x541b32)[_0xed10('0xa')](function(_0x1889c6){logger[_0xed10('0xb')](_0xed10('0xc'),_0x4a9cd2,_0xed10('0xd'));logger['debug'](_0xed10('0xe'),_0x4a9cd2,'request\x20sent',JSON[_0xed10('0xf')](_0x1889c6));if(_0x1889c6[_0xed10('0x10')]){if(_0x1889c6[_0xed10('0x10')][_0xed10('0x11')]===0x1f4){logger[_0xed10('0x10')](_0xed10('0xc'),_0x4a9cd2,_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);return _0x22a649(_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);}logger[_0xed10('0x10')](_0xed10('0xc'),_0x4a9cd2,_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);return _0x4a4819(_0x1889c6[_0xed10('0x10')][_0xed10('0x12')]);}else{logger[_0xed10('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x4a9cd2,'request\x20sent');_0x4a4819(_0x1889c6['result'][_0xed10('0x12')]);}})[_0xed10('0x13')](function(_0x155af2){logger[_0xed10('0x10')](_0xed10('0xc'),_0x4a9cd2,_0x155af2);_0x22a649(_0x155af2);});});} \ No newline at end of file +var _0x1169=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x1169,0x1f2));var _0x9116=function(_0x29b956,_0x1d62d7){_0x29b956=_0x29b956-0x0;var _0xbacdb1=_0x1169[_0x29b956];return _0xbacdb1;};'use strict';var _=require(_0x9116('0x0'));var util=require(_0x9116('0x1'));var moment=require(_0x9116('0x2'));var BPromise=require(_0x9116('0x3'));var rs=require(_0x9116('0x4'));var fs=require('fs');var Redis=require(_0x9116('0x5'));var db=require(_0x9116('0x6'))['db'];var utils=require(_0x9116('0x7'));var logger=require(_0x9116('0x8'))(_0x9116('0x9'));var config=require('../../config/environment');var jayson=require(_0x9116('0xa'));var client=jayson[_0x9116('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x497a09,_0x592c9f,_0x34f8f1){return new BPromise(function(_0x3db7b8,_0x291e6e){return client[_0x9116('0xc')](_0x497a09,_0x34f8f1)['then'](function(_0x469f64){logger[_0x9116('0xd')](_0x9116('0xe'),_0x592c9f,_0x9116('0xf'));logger[_0x9116('0x10')](_0x9116('0x11'),_0x592c9f,_0x9116('0xf'),JSON[_0x9116('0x12')](_0x469f64));if(_0x469f64[_0x9116('0x13')]){if(_0x469f64[_0x9116('0x13')][_0x9116('0x14')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x592c9f,_0x469f64[_0x9116('0x13')][_0x9116('0x15')]);return _0x291e6e(_0x469f64[_0x9116('0x13')][_0x9116('0x15')]);}logger[_0x9116('0x13')](_0x9116('0xe'),_0x592c9f,_0x469f64[_0x9116('0x13')][_0x9116('0x15')]);return _0x3db7b8(_0x469f64['error'][_0x9116('0x15')]);}else{logger['info'](_0x9116('0xe'),_0x592c9f,_0x9116('0xf'));_0x3db7b8(_0x469f64[_0x9116('0x16')][_0x9116('0x15')]);}})[_0x9116('0x17')](function(_0x184388){logger[_0x9116('0x13')](_0x9116('0xe'),_0x592c9f,_0x184388);_0x291e6e(_0x184388);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 00f8960..907db19 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 _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0xa89c7b,_0x1c4674){var _0x365802=function(_0x593675){while(--_0x593675){_0xa89c7b['push'](_0xa89c7b['shift']());}};_0x365802(++_0x1c4674);}(_0x032e,0x124));var _0xe032=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x032e[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router; \ No newline at end of file +var _0xdbf5=['post','put','update','delete','destroy','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x3de2b3,_0x5cb745){var _0x4ba243=function(_0x4a84c2){while(--_0x4a84c2){_0x3de2b3['push'](_0x3de2b3['shift']());}};_0x4ba243(++_0x5cb745);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x29c1c1,_0x34e6b4){_0x29c1c1=_0x29c1c1-0x0;var _0x3e72a0=_0xdbf5[_0x29c1c1];return _0x3e72a0;};'use strict';var multer=require('multer');var util=require(_0x5dbf('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dbf('0x1'));var router=express[_0x5dbf('0x2')]();var fs_extra=require(_0x5dbf('0x3'));var auth=require(_0x5dbf('0x4'));var interaction=require(_0x5dbf('0x5'));var config=require(_0x5dbf('0x6'));var controller=require(_0x5dbf('0x7'));router[_0x5dbf('0x8')](_0x5dbf('0x9'),auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xb')]);router[_0x5dbf('0xc')]('/',auth[_0x5dbf('0xa')](),controller['create']);router[_0x5dbf('0xd')]('/:id',auth[_0x5dbf('0xa')](),controller[_0x5dbf('0xe')]);router[_0x5dbf('0xf')](_0x5dbf('0x9'),auth['isAuthenticated'](),controller[_0x5dbf('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index cc26add..8adbc32 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 _0xfa9c=['INTEGER','ENUM','rrmemory','exports','STRING','name'];(function(_0xce44ee,_0x387d70){var _0xf97a49=function(_0x3ceab0){while(--_0x3ceab0){_0xce44ee['push'](_0xce44ee['shift']());}};_0xf97a49(++_0x387d70);}(_0xfa9c,0x75));var _0xcfa9=function(_0x4ce00c,_0x1738ab){_0x4ce00c=_0x4ce00c-0x0;var _0x1b7d60=_0xfa9c[_0x4ce00c];return _0x1b7d60;};'use strict';var Sequelize=require('sequelize');module[_0xcfa9('0x0')]={'name':{'type':Sequelize[_0xcfa9('0x1')],'unique':_0xcfa9('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xcfa9('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcfa9('0x4')](_0xcfa9('0x5'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x0609=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x534e29,_0x44e544){var _0x12a7c8=function(_0xb3e7e9){while(--_0xb3e7e9){_0x534e29['push'](_0x534e29['shift']());}};_0x12a7c8(++_0x44e544);}(_0x0609,0x90));var _0x9060=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x0609[_0x2d7f0e];return _0x110b07;};'use strict';var Sequelize=require(_0x9060('0x0'));module[_0x9060('0x1')]={'name':{'type':Sequelize[_0x9060('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9060('0x2')]},'timeout':{'type':Sequelize[_0x9060('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9060('0x4')](_0x9060('0x5'),_0x9060('0x6'),_0x9060('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 77a3104..7cffcb7 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 _0xe147=['findOrCreate','forEach','emit','userChatQueue:save','field','tq.TeamId','from','team_has_chat_queues','join','ut.UserId\x20=\x20?','push','toString','QueryTypes','all','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','ChatQueue','include','findAll','show','params','model','keys','query','intersection','attributes','fields','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','filters','length','nolimit','sort','pick','filter','User','UserId','agent','chatPause','createdAt','rows','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe147,0x93));var _0x7e14=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xe147[_0x19e35c];return _0x3e1fe8;};'use strict';var BPromise=require(_0x7e14('0x0'));var util=require(_0x7e14('0x1'));var _=require(_0x7e14('0x2'));var squel=require(_0x7e14('0x3'));var Redis=require(_0x7e14('0x4'));var qs=require(_0x7e14('0x5'));var logger=require('../../config/logger')(_0x7e14('0x6'));var config=require(_0x7e14('0x7'));var db=require(_0x7e14('0x8'))['db'];config[_0x7e14('0x9')]=_[_0x7e14('0xa')](config[_0x7e14('0x9')],{'host':_0x7e14('0xb'),'port':0x18eb});var socket=require(_0x7e14('0xc'))(new Redis(config['redis']));require(_0x7e14('0xd'))['register'](socket);function respondWithStatusCode(_0x23c2c5,_0x594e7f){_0x594e7f=_0x594e7f||0xcc;return function(_0x485a0f){if(_0x485a0f){return _0x23c2c5[_0x7e14('0xe')](_0x594e7f);}return _0x23c2c5[_0x7e14('0xf')](_0x594e7f)[_0x7e14('0x10')]();};}function respondWithResult(_0x42de97,_0x256a20){_0x256a20=_0x256a20||0xc8;return function(_0x41e482){if(_0x41e482){return _0x42de97[_0x7e14('0xf')](_0x256a20)[_0x7e14('0x11')](_0x41e482);}};}function respondWithFilteredResult(_0x279ad4,_0x1ce2a0){return function(_0x1d549e){if(_0x1d549e){var _0x2953b4=typeof _0x1ce2a0[_0x7e14('0x12')]===_0x7e14('0x13')&&typeof _0x1ce2a0['limit']==='undefined';var _0x225183=_0x1d549e[_0x7e14('0x14')];var _0x54a7ef=_0x2953b4?0x0:_0x1ce2a0[_0x7e14('0x12')];var _0x21efe8=_0x2953b4?_0x1d549e[_0x7e14('0x14')]:_0x1ce2a0[_0x7e14('0x12')]+_0x1ce2a0[_0x7e14('0x15')];var _0x2b6bd2;if(_0x21efe8>=_0x225183){_0x21efe8=_0x225183;_0x2b6bd2=0xc8;}else{_0x2b6bd2=0xce;}_0x279ad4[_0x7e14('0xf')](_0x2b6bd2);return _0x279ad4[_0x7e14('0x16')](_0x7e14('0x17'),_0x54a7ef+'-'+_0x21efe8+'/'+_0x225183)['json'](_0x1d549e);}return null;};}function saveUpdates(_0x4a3953){return function(_0x32671d){if(_0x32671d){return _0x32671d[_0x7e14('0x18')](_0x4a3953)[_0x7e14('0x19')](function(_0xae8ddf){return _0xae8ddf;});}return null;};}function removeEntity(_0x5d8582){return function(_0x51995b){if(_0x51995b){return _0x51995b[_0x7e14('0x1a')]()[_0x7e14('0x19')](function(){var _0x36ba8d=_0x51995b[_0x7e14('0x1b')]({'plain':!![]});var _0x543759=_0x7e14('0x1c');return db[_0x7e14('0x1d')]['destroy']({'where':{'type':_0x543759,'resourceId':_0x36ba8d['id']}})[_0x7e14('0x19')](function(){return _0x51995b;});})[_0x7e14('0x19')](function(){_0x5d8582[_0x7e14('0xf')](0xcc)[_0x7e14('0x10')]();});}};}function handleEntityNotFound(_0x7f802){return function(_0x1a4ac8){if(!_0x1a4ac8){_0x7f802[_0x7e14('0xe')](0x194);}return _0x1a4ac8;};}function handleError(_0x2fab9f,_0xf8788a){_0xf8788a=_0xf8788a||0x1f4;return function(_0x19112d){logger[_0x7e14('0x1e')](_0x19112d[_0x7e14('0x1f')]);if(_0x19112d['name']){delete _0x19112d[_0x7e14('0x20')];}_0x2fab9f['status'](_0xf8788a)[_0x7e14('0x21')](_0x19112d);};}exports[_0x7e14('0x22')]=function(_0x35b2ab,_0xc38132){var _0x14f574={};var _0xf2c04c={'count':0x0,'rows':[]};var _0x1ffb31=_[_0x7e14('0x23')](db['ChatQueue'][_0x7e14('0x24')],function(_0x4b3e2c){return{'name':_0x4b3e2c[_0x7e14('0x25')],'type':_0x4b3e2c[_0x7e14('0x26')][_0x7e14('0x27')]};});_0x14f574=qs[_0x7e14('0x28')](_0x1ffb31,_0x35b2ab);var _0x3fa64b={'where':_0x14f574[_0x7e14('0x29')]};return db[_0x7e14('0x2a')][_0x7e14('0x14')](_0x3fa64b)[_0x7e14('0x19')](function(_0x4e3f80){_0xf2c04c['count']=_0x4e3f80;_0x14f574[_0x7e14('0x2b')]=qs[_0x7e14('0x2b')](_0x35b2ab['query']);return db[_0x7e14('0x2a')][_0x7e14('0x2c')](_0x14f574);})[_0x7e14('0x19')](function(_0x1003e8){_0xf2c04c['rows']=_0x1003e8;return _0xf2c04c;})['then'](respondWithFilteredResult(_0xc38132,_0x14f574))['catch'](handleError(_0xc38132,null));};exports[_0x7e14('0x2d')]=function(_0x1e2520,_0x2eba18){var _0x3bebc4={'raw':!![],'where':{'id':_0x1e2520[_0x7e14('0x2e')]['id']}},_0x232c0a={};_0x232c0a[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db['ChatQueue'][_0x7e14('0x24')]);_0x232c0a['query']=_[_0x7e14('0x30')](_0x1e2520[_0x7e14('0x31')]);_0x232c0a['filters']=_[_0x7e14('0x32')](_0x232c0a[_0x7e14('0x2f')],_0x232c0a[_0x7e14('0x31')]);_0x3bebc4[_0x7e14('0x33')]=_[_0x7e14('0x32')](_0x232c0a[_0x7e14('0x2f')],qs[_0x7e14('0x34')](_0x1e2520[_0x7e14('0x31')][_0x7e14('0x34')]));_0x3bebc4[_0x7e14('0x33')]=_0x3bebc4['attributes']['length']?_0x3bebc4[_0x7e14('0x33')]:_0x232c0a[_0x7e14('0x2f')];if(_0x1e2520[_0x7e14('0x31')]['includeAll']){_0x3bebc4[_0x7e14('0x2b')]=[{'all':!![]}];}_0x3bebc4=_[_0x7e14('0x35')]({},_0x3bebc4,_0x1e2520[_0x7e14('0x36')]);return db[_0x7e14('0x2a')][_0x7e14('0x37')](_0x3bebc4)[_0x7e14('0x19')](handleEntityNotFound(_0x2eba18,null))[_0x7e14('0x19')](respondWithResult(_0x2eba18,null))[_0x7e14('0x38')](handleError(_0x2eba18,null));};exports[_0x7e14('0x39')]=function(_0x78c5af,_0x5a0507){return db[_0x7e14('0x2a')][_0x7e14('0x39')](_0x78c5af[_0x7e14('0x3a')],{})['then'](function(_0x1b50c6){var _0xd8cd7f=_0x78c5af[_0x7e14('0x3b')][_0x7e14('0x1b')]({'plain':!![]});if(!_0xd8cd7f)throw new Error(_0x7e14('0x3c'));if(_0xd8cd7f['role']===_0x7e14('0x3b')){var _0x17aa2e=_0x1b50c6[_0x7e14('0x1b')]({'plain':!![]});var _0x1f1801=_0x7e14('0x1c');return db[_0x7e14('0x3d')][_0x7e14('0x37')]({'where':{'name':_0x1f1801,'userProfileId':_0xd8cd7f[_0x7e14('0x3e')]},'raw':!![]})[_0x7e14('0x19')](function(_0x591636){if(_0x591636&&_0x591636[_0x7e14('0x3f')]===0x0){return db['UserProfileResource']['create']({'name':_0x17aa2e[_0x7e14('0x20')],'resourceId':_0x17aa2e['id'],'type':_0x591636[_0x7e14('0x20')],'sectionId':_0x591636['id']},{})[_0x7e14('0x19')](function(){return _0x1b50c6;});}else{return _0x1b50c6;}})[_0x7e14('0x38')](function(_0xa6e8f4){logger[_0x7e14('0x1e')](_0x7e14('0x40'),_0xa6e8f4);throw _0xa6e8f4;});}return _0x1b50c6;})[_0x7e14('0x19')](respondWithResult(_0x5a0507,0xc9))[_0x7e14('0x38')](handleError(_0x5a0507,null));};exports[_0x7e14('0x18')]=function(_0x2bf541,_0x265dae){if(_0x2bf541[_0x7e14('0x3a')]['id']){delete _0x2bf541[_0x7e14('0x3a')]['id'];}return db[_0x7e14('0x2a')]['find']({'where':{'id':_0x2bf541[_0x7e14('0x2e')]['id']}})['then'](handleEntityNotFound(_0x265dae,null))[_0x7e14('0x19')](saveUpdates(_0x2bf541['body'],null))[_0x7e14('0x19')](respondWithResult(_0x265dae,null))[_0x7e14('0x38')](handleError(_0x265dae,null));};exports[_0x7e14('0x1a')]=function(_0x261ec9,_0x28579c){return db['ChatQueue'][_0x7e14('0x37')]({'where':{'id':_0x261ec9[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x28579c,null))[_0x7e14('0x19')](removeEntity(_0x28579c,null))[_0x7e14('0x38')](handleError(_0x28579c,null));};exports[_0x7e14('0x41')]=function(_0x575f7a,_0x1fa6cf){return db[_0x7e14('0x2a')]['describe']()['then'](respondWithResult(_0x1fa6cf,null))['catch'](handleError(_0x1fa6cf,null));};exports[_0x7e14('0x42')]=function(_0x1a4542,_0x16c11f){var _0x169149={'raw':!![],'where':{}},_0x2bc5b9={},_0x42a366;return db[_0x7e14('0x2a')][_0x7e14('0x43')]({'where':{'id':_0x1a4542[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x16c11f,null))[_0x7e14('0x19')](function(_0x5541b2){if(_0x5541b2){_0x42a366=_0x5541b2[_0x7e14('0x1b')]({'plain':!![]});_0x2bc5b9[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db[_0x7e14('0x44')]['rawAttributes']);_0x2bc5b9['query']=_[_0x7e14('0x30')](_0x1a4542[_0x7e14('0x31')]);_0x2bc5b9[_0x7e14('0x45')]=_[_0x7e14('0x32')](_0x2bc5b9[_0x7e14('0x2f')],_0x2bc5b9[_0x7e14('0x31')]);_0x169149['attributes']=_[_0x7e14('0x32')](_0x2bc5b9[_0x7e14('0x2f')],qs[_0x7e14('0x34')](_0x1a4542[_0x7e14('0x31')][_0x7e14('0x34')]));_0x169149[_0x7e14('0x33')]=_0x169149['attributes'][_0x7e14('0x46')]?_0x169149[_0x7e14('0x33')]:_0x2bc5b9['model'];if(!_0x1a4542[_0x7e14('0x31')]['hasOwnProperty'](_0x7e14('0x47'))){_0x169149[_0x7e14('0x15')]=qs['limit'](_0x1a4542['query'][_0x7e14('0x15')]);_0x169149['offset']=qs[_0x7e14('0x12')](_0x1a4542[_0x7e14('0x31')]['offset']);}_0x169149['order']=qs[_0x7e14('0x48')](_0x1a4542[_0x7e14('0x31')][_0x7e14('0x48')]);_0x169149['where']=qs[_0x7e14('0x45')](_[_0x7e14('0x49')](_0x1a4542['query'],_0x2bc5b9[_0x7e14('0x45')]));_0x169149[_0x7e14('0x29')]['ChatQueueId']=_0x5541b2['id'];if(_0x1a4542[_0x7e14('0x31')][_0x7e14('0x4a')]){_0x169149[_0x7e14('0x29')]=_['merge'](_0x169149[_0x7e14('0x29')],{'$or':_['map'](_0x169149[_0x7e14('0x33')],function(_0xbc8420){var _0x5edf38={};_0x5edf38[_0xbc8420]={'$like':'%'+_0x1a4542[_0x7e14('0x31')][_0x7e14('0x4a')]+'%'};return _0x5edf38;})});}_0x169149=_[_0x7e14('0x35')]({},_0x169149,_0x1a4542[_0x7e14('0x36')]);return db[_0x7e14('0x44')][_0x7e14('0x2c')](_0x169149);}})[_0x7e14('0x19')](function(_0x396d7){if(_0x396d7){return db[_0x7e14('0x4b')]['findAndCountAll']({'where':{'id':_['map'](_0x396d7,_0x7e14('0x4c')),'role':_0x7e14('0x4d')},'attributes':['id',_0x7e14('0x20'),_0x7e14('0x4e'),'updatedAt',_0x7e14('0x4f')]});}})['then'](function(_0x76514c){if(_0x76514c){return{'count':_0x76514c['count'],'rows':_['map'](_0x76514c[_0x7e14('0x50')],function(_0x925824){return{'membername':_0x925824[_0x7e14('0x20')],'UserId':_0x925824['id'],'queue_name':_0x42a366[_0x7e14('0x20')],'ChatQueueId':_0x42a366['id'],'interface':util[_0x7e14('0x51')](_0x7e14('0x52'),_0x7e14('0x53'),_0x925824['name']),'penalty':0x0,'paused':_0x925824['chatPause'],'createdAt':_0x925824['createdAt'],'updatedAt':_0x925824['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7e14('0x19')](respondWithFilteredResult(_0x16c11f,_0x169149))[_0x7e14('0x38')](handleError(_0x16c11f,null));};exports[_0x7e14('0x54')]=function(_0x4e2242,_0x42a80b){var _0x492dd5={};var _0x5945b2={};var _0x2f10e0;var _0x55536c;return db[_0x7e14('0x2a')][_0x7e14('0x43')]({'where':{'id':_0x4e2242['params']['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x42a80b,null))['then'](function(_0x2d88e7){if(_0x2d88e7){_0x2f10e0=_0x2d88e7;_0x5945b2[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db[_0x7e14('0x55')][_0x7e14('0x24')]);_0x5945b2['query']=_[_0x7e14('0x30')](_0x4e2242[_0x7e14('0x31')]);_0x5945b2[_0x7e14('0x45')]=_[_0x7e14('0x32')](_0x5945b2[_0x7e14('0x2f')],_0x5945b2[_0x7e14('0x31')]);_0x492dd5[_0x7e14('0x33')]=_[_0x7e14('0x32')](_0x5945b2[_0x7e14('0x2f')],qs['fields'](_0x4e2242[_0x7e14('0x31')][_0x7e14('0x34')]));_0x492dd5['attributes']=_0x492dd5[_0x7e14('0x33')][_0x7e14('0x46')]?_0x492dd5[_0x7e14('0x33')]:_0x5945b2[_0x7e14('0x2f')];_0x492dd5[_0x7e14('0x56')]=qs['sort'](_0x4e2242['query'][_0x7e14('0x48')]);_0x492dd5['where']=qs[_0x7e14('0x45')](_['pick'](_0x4e2242['query'],_0x5945b2[_0x7e14('0x45')]));if(_0x4e2242[_0x7e14('0x31')][_0x7e14('0x4a')]){_0x492dd5[_0x7e14('0x29')]=_['merge'](_0x492dd5[_0x7e14('0x29')],{'$or':_[_0x7e14('0x23')](_0x492dd5['attributes'],function(_0x256525){var _0x539873={};_0x539873[_0x256525]={'$like':'%'+_0x4e2242['query'][_0x7e14('0x4a')]+'%'};return _0x539873;})});}_0x492dd5=_['merge']({},_0x492dd5,_0x4e2242['options']);return _0x2f10e0['getTeams'](_0x492dd5);}})['then'](function(_0x568c6a){if(_0x568c6a){_0x55536c=_0x568c6a[_0x7e14('0x46')];if(!_0x4e2242[_0x7e14('0x31')]['hasOwnProperty'](_0x7e14('0x47'))){_0x492dd5['limit']=qs[_0x7e14('0x15')](_0x4e2242[_0x7e14('0x31')][_0x7e14('0x15')]);_0x492dd5[_0x7e14('0x12')]=qs[_0x7e14('0x12')](_0x4e2242[_0x7e14('0x31')][_0x7e14('0x12')]);}return _0x2f10e0['getTeams'](_0x492dd5);}})[_0x7e14('0x19')](function(_0x24ab32){if(_0x24ab32){return _0x24ab32?{'count':_0x55536c,'rows':_0x24ab32}:null;}})[_0x7e14('0x19')](respondWithResult(_0x42a80b,null))['catch'](handleError(_0x42a80b,null));};exports[_0x7e14('0x57')]=function(_0x4146d3,_0x43702d){var _0x3f37c8=_0x4146d3['body'][_0x7e14('0x58')];return db[_0x7e14('0x55')]['findAll']({'where':{'id':_0x3f37c8},'attributes':['id'],'include':[{'model':db[_0x7e14('0x4b')],'as':_0x7e14('0x59'),'attributes':['id',_0x7e14('0x20'),_0x7e14('0x5a'),_0x7e14('0x5b'),_0x7e14('0x5c')],'raw':!![]}]})[_0x7e14('0x19')](function(_0x29dfbe){if(_0x29dfbe){var _0x413db0=_[_0x7e14('0x5d')](_0x29dfbe,function(_0x5ebdfe){var _0x558eee=_0x5ebdfe['get']({'plain':!![]});return _0x558eee[_0x7e14('0x59')];});return db[_0x7e14('0x2a')][_0x7e14('0x37')]({'where':{'id':_0x4146d3['params']['id']}})[_0x7e14('0x19')](function(_0x3443df){return db[_0x7e14('0x5e')][_0x7e14('0x5f')](function(_0x3eb1de){return _0x3443df['addTeams'](_0x3f37c8,{'transaction':_0x3eb1de})[_0x7e14('0x19')](function(){return BPromise[_0x7e14('0x60')](_0x413db0,function(_0x34b2b5){return db[_0x7e14('0x44')][_0x7e14('0x61')]({'where':{'UserId':_0x34b2b5['id'],'ChatQueueId':_0x4146d3[_0x7e14('0x2e')]['id']},'transaction':_0x3eb1de});});})[_0x7e14('0x19')](function(){_0x413db0[_0x7e14('0x62')](function(_0x30cdfa){socket[_0x7e14('0x63')](_0x7e14('0x64'),{'UserId':_0x30cdfa['id'],'ChatQueueId':_0x3443df['id']});});});});});}})['then'](respondWithStatusCode(_0x43702d,null))['catch'](handleError(_0x43702d,null));};exports['removeTeams']=function(_0x449a4e,_0x1beb79){return db[_0x7e14('0x55')][_0x7e14('0x2c')]({'where':{'id':_0x449a4e[_0x7e14('0x31')][_0x7e14('0x58')]},'attributes':['id'],'include':[{'model':db[_0x7e14('0x4b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7e14('0x19')](handleEntityNotFound(_0x1beb79,null))[_0x7e14('0x19')](function(_0x5f21fd){var _0x4cf273=_[_0x7e14('0x23')](_0x5f21fd,'id');var _0xb2e2f7=[];var _0x34ed7a=[];var _0x53df6e=squel['select']();_0x53df6e[_0x7e14('0x65')](_0x7e14('0x66'))[_0x7e14('0x67')](_0x7e14('0x68'),'tq')[_0x7e14('0x69')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x449a4e[_0x7e14('0x2e')]['id']);for(var _0x1a8dff=0x0;_0x1a8dff<_0x5f21fd[_0x7e14('0x46')];_0x1a8dff+=0x1){let _0x198d4f=_0x5f21fd[_0x1a8dff];for(var _0x23da0e=0x0;_0x23da0e<_0x198d4f['Agents'][_0x7e14('0x46')];_0x23da0e+=0x1){let _0x596ca3=_0x198d4f['Agents'][_0x23da0e];var _0x8060f0=_0x53df6e['clone']();_0x8060f0[_0x7e14('0x29')](_0x7e14('0x6a'),_0x596ca3['id']);_0x34ed7a[_0x7e14('0x6b')](db[_0x7e14('0x5e')][_0x7e14('0x31')](_0x8060f0[_0x7e14('0x6c')](),{'type':db[_0x7e14('0x5e')][_0x7e14('0x6d')]['SELECT']})['then'](function(_0x277821){if(_0x277821[_0x7e14('0x46')]===0x1){return _0x596ca3['id'];}else{var _0x25b4f0=_['every'](_[_0x7e14('0x23')](_0x277821,'TeamId'),function(_0xfa6f9f){return _['includes'](_0x4cf273,_0xfa6f9f);});if(_0x25b4f0){return _0x596ca3['id'];}}}));}}return BPromise[_0x7e14('0x6e')](_0x34ed7a)[_0x7e14('0x19')](function(_0x446cd8){_0xb2e2f7=_(_0xb2e2f7)['union'](_0x446cd8)['compact']()[_0x7e14('0x6f')]();return db[_0x7e14('0x2a')][_0x7e14('0x37')]({'where':{'id':_0x449a4e[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](function(_0x45defe){return db['sequelize']['transaction'](function(_0x168521){return _0x45defe[_0x7e14('0x70')](_0x449a4e[_0x7e14('0x31')][_0x7e14('0x58')],{'transaction':_0x168521})['then'](function(){if(!_[_0x7e14('0x71')](_0xb2e2f7)){return _0x45defe[_0x7e14('0x72')](_0xb2e2f7,{'transaction':_0x168521});}})[_0x7e14('0x19')](function(){_0xb2e2f7[_0x7e14('0x62')](function(_0x41b070){socket['emit'](_0x7e14('0x73'),{'UserId':_0x41b070,'ChatQueueId':_0x45defe['id']});});});});});});})[_0x7e14('0x19')](respondWithStatusCode(_0x1beb79,null))[_0x7e14('0x38')](handleError(_0x1beb79,null));};exports[_0x7e14('0x74')]=function(_0xe7ad54,_0x198ffc){return db['ChatQueue']['find']({'where':{'id':_0xe7ad54[_0x7e14('0x2e')]['id']}})['then'](handleEntityNotFound(_0x198ffc,null))['then'](function(_0x5b7187){if(_0x5b7187){return _0x5b7187[_0x7e14('0x74')](_0xe7ad54[_0x7e14('0x3a')][_0x7e14('0x58')],_[_0x7e14('0x75')](_0xe7ad54[_0x7e14('0x3a')],[_0x7e14('0x58'),'id'])||{})[_0x7e14('0x76')](function(_0x23a80e){for(var _0x353ab4=0x0;_0x353ab4<_0xe7ad54[_0x7e14('0x3a')]['ids'][_0x7e14('0x46')];_0x353ab4+=0x1){socket[_0x7e14('0x63')](_0x7e14('0x64'),{'UserId':Number(_0xe7ad54[_0x7e14('0x3a')][_0x7e14('0x58')][_0x353ab4]),'ChatQueueId':Number(_0xe7ad54[_0x7e14('0x2e')]['id'])});}return _0x23a80e;});}})[_0x7e14('0x19')](respondWithResult(_0x198ffc,null))[_0x7e14('0x38')](handleError(_0x198ffc,null));};exports[_0x7e14('0x72')]=function(_0x45312a,_0x2ee150){return db[_0x7e14('0x2a')][_0x7e14('0x37')]({'where':{'id':_0x45312a[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x2ee150,null))[_0x7e14('0x19')](function(_0xa2e659){if(_0xa2e659){return _0xa2e659[_0x7e14('0x72')](_0x45312a[_0x7e14('0x31')][_0x7e14('0x58')])['then'](function(){if(_[_0x7e14('0x77')](_0x45312a['query'][_0x7e14('0x58')])){for(var _0x256a27=0x0;_0x256a27<_0x45312a[_0x7e14('0x31')][_0x7e14('0x58')][_0x7e14('0x46')];_0x256a27+=0x1){socket[_0x7e14('0x63')]('userChatQueue:remove',{'UserId':Number(_0x45312a['query'][_0x7e14('0x58')][_0x256a27]),'ChatQueueId':Number(_0x45312a[_0x7e14('0x2e')]['id'])});}}else{socket[_0x7e14('0x63')](_0x7e14('0x73'),{'UserId':Number(_0x45312a[_0x7e14('0x31')][_0x7e14('0x58')]),'ChatQueueId':Number(_0x45312a[_0x7e14('0x2e')]['id'])});}});}})[_0x7e14('0x19')](respondWithStatusCode(_0x2ee150,null))[_0x7e14('0x38')](handleError(_0x2ee150,null));};exports[_0x7e14('0x78')]=function(_0x3b8afb,_0x551997){var _0x5647b6={};var _0x58fb8a={};var _0x3ff3e7;var _0x538937;return db[_0x7e14('0x2a')][_0x7e14('0x43')]({'where':{'id':_0x3b8afb[_0x7e14('0x2e')]['id']}})[_0x7e14('0x19')](handleEntityNotFound(_0x551997,null))[_0x7e14('0x19')](function(_0x14d73f){if(_0x14d73f){_0x3ff3e7=_0x14d73f;_0x58fb8a[_0x7e14('0x2f')]=_[_0x7e14('0x30')](db[_0x7e14('0x4b')][_0x7e14('0x24')]);_0x58fb8a[_0x7e14('0x31')]=_[_0x7e14('0x30')](_0x3b8afb[_0x7e14('0x31')]);_0x58fb8a[_0x7e14('0x45')]=_[_0x7e14('0x32')](_0x58fb8a['model'],_0x58fb8a[_0x7e14('0x31')]);_0x5647b6['attributes']=_[_0x7e14('0x32')](_0x58fb8a[_0x7e14('0x2f')],qs[_0x7e14('0x34')](_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x34')]));_0x5647b6[_0x7e14('0x33')]=_0x5647b6[_0x7e14('0x33')][_0x7e14('0x46')]?_0x5647b6[_0x7e14('0x33')]:_0x58fb8a[_0x7e14('0x2f')];_0x5647b6[_0x7e14('0x56')]=qs[_0x7e14('0x48')](_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x48')]);_0x5647b6['where']=qs[_0x7e14('0x45')](_[_0x7e14('0x49')](_0x3b8afb[_0x7e14('0x31')],_0x58fb8a[_0x7e14('0x45')]));if(_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x4a')]){_0x5647b6[_0x7e14('0x29')]=_['merge'](_0x5647b6[_0x7e14('0x29')],{'$or':_['map'](_0x5647b6[_0x7e14('0x33')],function(_0x47293e){var _0x29a803={};_0x29a803[_0x47293e]={'$like':'%'+_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x4a')]+'%'};return _0x29a803;})});}_0x5647b6=_[_0x7e14('0x35')]({},_0x5647b6,_0x3b8afb[_0x7e14('0x36')]);return _0x3ff3e7['getAgents'](_0x5647b6);}})[_0x7e14('0x19')](function(_0x264f67){if(_0x264f67){_0x538937=_0x264f67[_0x7e14('0x46')];if(!_0x3b8afb[_0x7e14('0x31')][_0x7e14('0x79')]('nolimit')){_0x5647b6[_0x7e14('0x15')]=qs[_0x7e14('0x15')](_0x3b8afb['query'][_0x7e14('0x15')]);_0x5647b6[_0x7e14('0x12')]=qs[_0x7e14('0x12')](_0x3b8afb['query']['offset']);}return _0x3ff3e7['getAgents'](_0x5647b6);}})['then'](function(_0x2a7046){if(_0x2a7046){return _0x2a7046?{'count':_0x538937,'rows':_0x2a7046}:null;}})['then'](respondWithResult(_0x551997,null))[_0x7e14('0x38')](handleError(_0x551997,null));}; \ No newline at end of file +var _0xa986=['redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','set','Content-Range','json','then','destroy','get','ChatQueues','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','type','getOptions','where','count','include','query','ChatQueue','findAll','catch','params','keys','filters','attributes','intersection','fields','length','model','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','UserChatQueue','hasOwnProperty','nolimit','limit','order','sort','pick','ChatQueueId','filter','map','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','SIP','getTeams','Team','ids','voicePause','interface','flatMap','Agents','sequelize','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','tq.TeamId','from','team_has_chat_queues','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','transaction','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove','getAgents','bluebird','util','squel','api','../../config/environment'];(function(_0x2ebe90,_0x2825d9){var _0x184e90=function(_0x1115a7){while(--_0x1115a7){_0x2ebe90['push'](_0x2ebe90['shift']());}};_0x184e90(++_0x2825d9);}(_0xa986,0x6f));var _0x6a98=function(_0x2bb675,_0x10e35c){_0x2bb675=_0x2bb675-0x0;var _0x606be5=_0xa986[_0x2bb675];return _0x606be5;};'use strict';var BPromise=require(_0x6a98('0x0'));var util=require(_0x6a98('0x1'));var _=require('lodash');var squel=require(_0x6a98('0x2'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x6a98('0x3'));var config=require(_0x6a98('0x4'));var db=require('../../mysqldb')['db'];config[_0x6a98('0x5')]=_[_0x6a98('0x6')](config[_0x6a98('0x5')],{'host':_0x6a98('0x7'),'port':0x18eb});var socket=require(_0x6a98('0x8'))(new Redis(config['redis']));require('./chatQueue.socket')['register'](socket);function respondWithStatusCode(_0xb58711,_0x214a79){_0x214a79=_0x214a79||0xcc;return function(_0x21283e){if(_0x21283e){return _0xb58711[_0x6a98('0x9')](_0x214a79);}return _0xb58711[_0x6a98('0xa')](_0x214a79)[_0x6a98('0xb')]();};}function respondWithResult(_0x59cb94,_0x442d70){_0x442d70=_0x442d70||0xc8;return function(_0x2f29a4){if(_0x2f29a4){return _0x59cb94[_0x6a98('0xa')](_0x442d70)['json'](_0x2f29a4);}};}function respondWithFilteredResult(_0xb96254,_0x3f6b7d){return function(_0x40c75f){if(_0x40c75f){var _0x389163=typeof _0x3f6b7d[_0x6a98('0xc')]===_0x6a98('0xd')&&typeof _0x3f6b7d['limit']==='undefined';var _0x3cbe2e=_0x40c75f['count'];var _0x19cdc5=_0x389163?0x0:_0x3f6b7d['offset'];var _0x3eded6=_0x389163?_0x40c75f['count']:_0x3f6b7d[_0x6a98('0xc')]+_0x3f6b7d['limit'];var _0x3c0630;if(_0x3eded6>=_0x3cbe2e){_0x3eded6=_0x3cbe2e;_0x3c0630=0xc8;}else{_0x3c0630=0xce;}_0xb96254[_0x6a98('0xa')](_0x3c0630);return _0xb96254[_0x6a98('0xe')](_0x6a98('0xf'),_0x19cdc5+'-'+_0x3eded6+'/'+_0x3cbe2e)[_0x6a98('0x10')](_0x40c75f);}return null;};}function saveUpdates(_0x598fd6){return function(_0x314211){if(_0x314211){return _0x314211['update'](_0x598fd6)[_0x6a98('0x11')](function(_0x5ae647){return _0x5ae647;});}return null;};}function removeEntity(_0xd375e9){return function(_0xe3c130){if(_0xe3c130){return _0xe3c130[_0x6a98('0x12')]()[_0x6a98('0x11')](function(){var _0x3ac12d=_0xe3c130[_0x6a98('0x13')]({'plain':!![]});var _0x321a5a=_0x6a98('0x14');return db[_0x6a98('0x15')][_0x6a98('0x12')]({'where':{'type':_0x321a5a,'resourceId':_0x3ac12d['id']}})[_0x6a98('0x11')](function(){return _0xe3c130;});})['then'](function(){_0xd375e9['status'](0xcc)[_0x6a98('0xb')]();});}};}function handleEntityNotFound(_0x3dbd05){return function(_0x20312d){if(!_0x20312d){_0x3dbd05[_0x6a98('0x9')](0x194);}return _0x20312d;};}function handleError(_0xc43b1c,_0x2ea573){_0x2ea573=_0x2ea573||0x1f4;return function(_0x1c3804){logger[_0x6a98('0x16')](_0x1c3804[_0x6a98('0x17')]);if(_0x1c3804[_0x6a98('0x18')]){delete _0x1c3804[_0x6a98('0x18')];}_0xc43b1c[_0x6a98('0xa')](_0x2ea573)['send'](_0x1c3804);};}exports[_0x6a98('0x19')]=function(_0x5a714c,_0x68cd46){var _0x53627f={};var _0x298fb0={'count':0x0,'rows':[]};var _0x5472fa=_['map'](db['ChatQueue'][_0x6a98('0x1a')],function(_0x3eb2ce){return{'name':_0x3eb2ce[_0x6a98('0x1b')],'type':_0x3eb2ce[_0x6a98('0x1c')]['key']};});_0x53627f=qs[_0x6a98('0x1d')](_0x5472fa,_0x5a714c);var _0x366048={'where':_0x53627f[_0x6a98('0x1e')]};return db['ChatQueue']['count'](_0x366048)['then'](function(_0x3d85b3){_0x298fb0[_0x6a98('0x1f')]=_0x3d85b3;_0x53627f[_0x6a98('0x20')]=qs[_0x6a98('0x20')](_0x5a714c[_0x6a98('0x21')]);return db[_0x6a98('0x22')][_0x6a98('0x23')](_0x53627f);})[_0x6a98('0x11')](function(_0x88bb1b){_0x298fb0['rows']=_0x88bb1b;return _0x298fb0;})['then'](respondWithFilteredResult(_0x68cd46,_0x53627f))[_0x6a98('0x24')](handleError(_0x68cd46,null));};exports['show']=function(_0x13dbbd,_0x1adb00){var _0x1ddce4={'raw':!![],'where':{'id':_0x13dbbd[_0x6a98('0x25')]['id']}},_0x386f75={};_0x386f75['model']=_[_0x6a98('0x26')](db[_0x6a98('0x22')]['rawAttributes']);_0x386f75[_0x6a98('0x21')]=_[_0x6a98('0x26')](_0x13dbbd[_0x6a98('0x21')]);_0x386f75[_0x6a98('0x27')]=_['intersection'](_0x386f75['model'],_0x386f75[_0x6a98('0x21')]);_0x1ddce4[_0x6a98('0x28')]=_[_0x6a98('0x29')](_0x386f75['model'],qs['fields'](_0x13dbbd[_0x6a98('0x21')][_0x6a98('0x2a')]));_0x1ddce4[_0x6a98('0x28')]=_0x1ddce4[_0x6a98('0x28')][_0x6a98('0x2b')]?_0x1ddce4[_0x6a98('0x28')]:_0x386f75[_0x6a98('0x2c')];if(_0x13dbbd[_0x6a98('0x21')]['includeAll']){_0x1ddce4['include']=[{'all':!![]}];}_0x1ddce4=_[_0x6a98('0x2d')]({},_0x1ddce4,_0x13dbbd[_0x6a98('0x2e')]);return db[_0x6a98('0x22')]['find'](_0x1ddce4)['then'](handleEntityNotFound(_0x1adb00,null))[_0x6a98('0x11')](respondWithResult(_0x1adb00,null))['catch'](handleError(_0x1adb00,null));};exports['create']=function(_0x50f91f,_0xbadb6b){return db[_0x6a98('0x22')][_0x6a98('0x2f')](_0x50f91f[_0x6a98('0x30')],{})[_0x6a98('0x11')](function(_0x178981){var _0x558876=_0x50f91f[_0x6a98('0x31')][_0x6a98('0x13')]({'plain':!![]});if(!_0x558876)throw new Error(_0x6a98('0x32'));if(_0x558876[_0x6a98('0x33')]===_0x6a98('0x31')){var _0x377af9=_0x178981[_0x6a98('0x13')]({'plain':!![]});var _0x4d553e=_0x6a98('0x14');return db[_0x6a98('0x34')][_0x6a98('0x35')]({'where':{'name':_0x4d553e,'userProfileId':_0x558876['userProfileId']},'raw':!![]})[_0x6a98('0x11')](function(_0x2d1859){if(_0x2d1859&&_0x2d1859[_0x6a98('0x36')]===0x0){return db['UserProfileResource'][_0x6a98('0x2f')]({'name':_0x377af9[_0x6a98('0x18')],'resourceId':_0x377af9['id'],'type':_0x2d1859[_0x6a98('0x18')],'sectionId':_0x2d1859['id']},{})['then'](function(){return _0x178981;});}else{return _0x178981;}})[_0x6a98('0x24')](function(_0x4c712f){logger[_0x6a98('0x16')](_0x6a98('0x37'),_0x4c712f);throw _0x4c712f;});}return _0x178981;})[_0x6a98('0x11')](respondWithResult(_0xbadb6b,0xc9))[_0x6a98('0x24')](handleError(_0xbadb6b,null));};exports[_0x6a98('0x38')]=function(_0xe728ee,_0x427790){if(_0xe728ee['body']['id']){delete _0xe728ee[_0x6a98('0x30')]['id'];}return db[_0x6a98('0x22')]['find']({'where':{'id':_0xe728ee[_0x6a98('0x25')]['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x427790,null))[_0x6a98('0x11')](saveUpdates(_0xe728ee[_0x6a98('0x30')],null))['then'](respondWithResult(_0x427790,null))['catch'](handleError(_0x427790,null));};exports['destroy']=function(_0xae6d9b,_0x2396f8){return db[_0x6a98('0x22')][_0x6a98('0x35')]({'where':{'id':_0xae6d9b[_0x6a98('0x25')]['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x2396f8,null))[_0x6a98('0x11')](removeEntity(_0x2396f8,null))['catch'](handleError(_0x2396f8,null));};exports['describe']=function(_0xa3c68f,_0x316e1a){return db['ChatQueue']['describe']()[_0x6a98('0x11')](respondWithResult(_0x316e1a,null))[_0x6a98('0x24')](handleError(_0x316e1a,null));};exports[_0x6a98('0x39')]=function(_0x347fcc,_0x1d08a8){var _0x3b108b={'raw':!![],'where':{}},_0x39039d={},_0x1ab3f0;return db[_0x6a98('0x22')][_0x6a98('0x3a')]({'where':{'id':_0x347fcc['params']['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x1d08a8,null))[_0x6a98('0x11')](function(_0xa05f74){if(_0xa05f74){_0x1ab3f0=_0xa05f74['get']({'plain':!![]});_0x39039d[_0x6a98('0x2c')]=_[_0x6a98('0x26')](db[_0x6a98('0x3b')]['rawAttributes']);_0x39039d['query']=_['keys'](_0x347fcc[_0x6a98('0x21')]);_0x39039d[_0x6a98('0x27')]=_['intersection'](_0x39039d[_0x6a98('0x2c')],_0x39039d[_0x6a98('0x21')]);_0x3b108b['attributes']=_[_0x6a98('0x29')](_0x39039d[_0x6a98('0x2c')],qs[_0x6a98('0x2a')](_0x347fcc['query'][_0x6a98('0x2a')]));_0x3b108b['attributes']=_0x3b108b[_0x6a98('0x28')][_0x6a98('0x2b')]?_0x3b108b[_0x6a98('0x28')]:_0x39039d['model'];if(!_0x347fcc[_0x6a98('0x21')][_0x6a98('0x3c')](_0x6a98('0x3d'))){_0x3b108b['limit']=qs['limit'](_0x347fcc[_0x6a98('0x21')][_0x6a98('0x3e')]);_0x3b108b[_0x6a98('0xc')]=qs[_0x6a98('0xc')](_0x347fcc['query'][_0x6a98('0xc')]);}_0x3b108b[_0x6a98('0x3f')]=qs['sort'](_0x347fcc['query'][_0x6a98('0x40')]);_0x3b108b['where']=qs[_0x6a98('0x27')](_[_0x6a98('0x41')](_0x347fcc[_0x6a98('0x21')],_0x39039d[_0x6a98('0x27')]));_0x3b108b[_0x6a98('0x1e')][_0x6a98('0x42')]=_0xa05f74['id'];if(_0x347fcc[_0x6a98('0x21')][_0x6a98('0x43')]){_0x3b108b['where']=_[_0x6a98('0x2d')](_0x3b108b[_0x6a98('0x1e')],{'$or':_[_0x6a98('0x44')](_0x3b108b[_0x6a98('0x28')],function(_0x59715f){var _0x41c0ba={};_0x41c0ba[_0x59715f]={'$like':'%'+_0x347fcc['query'][_0x6a98('0x43')]+'%'};return _0x41c0ba;})});}_0x3b108b=_['merge']({},_0x3b108b,_0x347fcc[_0x6a98('0x2e')]);return db[_0x6a98('0x3b')][_0x6a98('0x23')](_0x3b108b);}})[_0x6a98('0x11')](function(_0x4c1a2f){if(_0x4c1a2f){return db[_0x6a98('0x45')][_0x6a98('0x46')]({'where':{'id':_[_0x6a98('0x44')](_0x4c1a2f,_0x6a98('0x47')),'role':_0x6a98('0x48')},'attributes':['id',_0x6a98('0x18'),_0x6a98('0x49'),_0x6a98('0x4a'),_0x6a98('0x4b')]});}})['then'](function(_0x125977){if(_0x125977){return{'count':_0x125977[_0x6a98('0x1f')],'rows':_['map'](_0x125977['rows'],function(_0x321c93){return{'membername':_0x321c93['name'],'UserId':_0x321c93['id'],'queue_name':_0x1ab3f0['name'],'ChatQueueId':_0x1ab3f0['id'],'interface':util[_0x6a98('0x4c')]('%s/%s',_0x6a98('0x4d'),_0x321c93[_0x6a98('0x18')]),'penalty':0x0,'paused':_0x321c93[_0x6a98('0x49')],'createdAt':_0x321c93['createdAt'],'updatedAt':_0x321c93[_0x6a98('0x4a')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1d08a8,_0x3b108b))[_0x6a98('0x24')](handleError(_0x1d08a8,null));};exports[_0x6a98('0x4e')]=function(_0x53853e,_0x3b0b5b){var _0x36524a={};var _0x581206={};var _0x291747;var _0x1cdcc1;return db[_0x6a98('0x22')]['findOne']({'where':{'id':_0x53853e['params']['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x3b0b5b,null))[_0x6a98('0x11')](function(_0xa8ff64){if(_0xa8ff64){_0x291747=_0xa8ff64;_0x581206[_0x6a98('0x2c')]=_[_0x6a98('0x26')](db[_0x6a98('0x4f')][_0x6a98('0x1a')]);_0x581206[_0x6a98('0x21')]=_[_0x6a98('0x26')](_0x53853e[_0x6a98('0x21')]);_0x581206[_0x6a98('0x27')]=_[_0x6a98('0x29')](_0x581206['model'],_0x581206[_0x6a98('0x21')]);_0x36524a['attributes']=_['intersection'](_0x581206[_0x6a98('0x2c')],qs[_0x6a98('0x2a')](_0x53853e[_0x6a98('0x21')][_0x6a98('0x2a')]));_0x36524a[_0x6a98('0x28')]=_0x36524a['attributes'][_0x6a98('0x2b')]?_0x36524a[_0x6a98('0x28')]:_0x581206[_0x6a98('0x2c')];_0x36524a['order']=qs[_0x6a98('0x40')](_0x53853e[_0x6a98('0x21')][_0x6a98('0x40')]);_0x36524a[_0x6a98('0x1e')]=qs[_0x6a98('0x27')](_['pick'](_0x53853e['query'],_0x581206[_0x6a98('0x27')]));if(_0x53853e[_0x6a98('0x21')][_0x6a98('0x43')]){_0x36524a['where']=_[_0x6a98('0x2d')](_0x36524a[_0x6a98('0x1e')],{'$or':_[_0x6a98('0x44')](_0x36524a[_0x6a98('0x28')],function(_0x3f8e76){var _0x13936b={};_0x13936b[_0x3f8e76]={'$like':'%'+_0x53853e[_0x6a98('0x21')]['filter']+'%'};return _0x13936b;})});}_0x36524a=_[_0x6a98('0x2d')]({},_0x36524a,_0x53853e[_0x6a98('0x2e')]);return _0x291747[_0x6a98('0x4e')](_0x36524a);}})[_0x6a98('0x11')](function(_0x51fc78){if(_0x51fc78){_0x1cdcc1=_0x51fc78[_0x6a98('0x2b')];if(!_0x53853e[_0x6a98('0x21')][_0x6a98('0x3c')](_0x6a98('0x3d'))){_0x36524a[_0x6a98('0x3e')]=qs[_0x6a98('0x3e')](_0x53853e[_0x6a98('0x21')][_0x6a98('0x3e')]);_0x36524a[_0x6a98('0xc')]=qs[_0x6a98('0xc')](_0x53853e[_0x6a98('0x21')][_0x6a98('0xc')]);}return _0x291747[_0x6a98('0x4e')](_0x36524a);}})[_0x6a98('0x11')](function(_0x4c619c){if(_0x4c619c){return _0x4c619c?{'count':_0x1cdcc1,'rows':_0x4c619c}:null;}})['then'](respondWithResult(_0x3b0b5b,null))[_0x6a98('0x24')](handleError(_0x3b0b5b,null));};exports['addTeams']=function(_0x22f375,_0x529c3a){var _0x3ce51c=_0x22f375[_0x6a98('0x30')][_0x6a98('0x50')];return db['Team'][_0x6a98('0x23')]({'where':{'id':_0x3ce51c},'attributes':['id'],'include':[{'model':db[_0x6a98('0x45')],'as':'Agents','attributes':['id',_0x6a98('0x18'),'online',_0x6a98('0x51'),_0x6a98('0x52')],'raw':!![]}]})['then'](function(_0x51c5ce){if(_0x51c5ce){var _0x56aab9=_[_0x6a98('0x53')](_0x51c5ce,function(_0x4ba627){var _0x3b092e=_0x4ba627[_0x6a98('0x13')]({'plain':!![]});return _0x3b092e[_0x6a98('0x54')];});return db[_0x6a98('0x22')][_0x6a98('0x35')]({'where':{'id':_0x22f375['params']['id']}})[_0x6a98('0x11')](function(_0x2375b5){return db[_0x6a98('0x55')]['transaction'](function(_0x3f7ffc){return _0x2375b5[_0x6a98('0x56')](_0x3ce51c,{'transaction':_0x3f7ffc})['then'](function(){return BPromise[_0x6a98('0x57')](_0x56aab9,function(_0x3c943b){return db[_0x6a98('0x3b')][_0x6a98('0x58')]({'where':{'UserId':_0x3c943b['id'],'ChatQueueId':_0x22f375['params']['id']},'transaction':_0x3f7ffc});});})['then'](function(){_0x56aab9[_0x6a98('0x59')](function(_0x37ed1f){socket[_0x6a98('0x5a')](_0x6a98('0x5b'),{'UserId':_0x37ed1f['id'],'ChatQueueId':_0x2375b5['id']});});});});});}})[_0x6a98('0x11')](respondWithStatusCode(_0x529c3a,null))[_0x6a98('0x24')](handleError(_0x529c3a,null));};exports[_0x6a98('0x5c')]=function(_0x30f926,_0x4a5d1f){return db[_0x6a98('0x4f')]['findAll']({'where':{'id':_0x30f926['query'][_0x6a98('0x50')]},'attributes':['id'],'include':[{'model':db[_0x6a98('0x45')],'as':_0x6a98('0x54'),'attributes':['id'],'raw':!![]}]})[_0x6a98('0x11')](handleEntityNotFound(_0x4a5d1f,null))[_0x6a98('0x11')](function(_0x3d0ccf){var _0x35b2d8=_['map'](_0x3d0ccf,'id');var _0x50486d=[];var _0x1f3029=[];var _0x85944f=squel[_0x6a98('0x5d')]();_0x85944f['field'](_0x6a98('0x5e'))[_0x6a98('0x5f')](_0x6a98('0x60'),'tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x6a98('0x1e')](_0x6a98('0x61'),_0x30f926[_0x6a98('0x25')]['id']);for(var _0xce52da=0x0;_0xce52da<_0x3d0ccf[_0x6a98('0x2b')];_0xce52da+=0x1){let _0x4c5869=_0x3d0ccf[_0xce52da];for(var _0x4d8e48=0x0;_0x4d8e48<_0x4c5869[_0x6a98('0x54')][_0x6a98('0x2b')];_0x4d8e48+=0x1){let _0x5e4914=_0x4c5869['Agents'][_0x4d8e48];var _0x29d7b9=_0x85944f[_0x6a98('0x62')]();_0x29d7b9[_0x6a98('0x1e')](_0x6a98('0x63'),_0x5e4914['id']);_0x1f3029[_0x6a98('0x64')](db['sequelize'][_0x6a98('0x21')](_0x29d7b9['toString'](),{'type':db[_0x6a98('0x55')][_0x6a98('0x65')][_0x6a98('0x66')]})['then'](function(_0x47e85d){if(_0x47e85d['length']===0x1){return _0x5e4914['id'];}else{var _0x421b35=_[_0x6a98('0x67')](_[_0x6a98('0x44')](_0x47e85d,_0x6a98('0x68')),function(_0xfc9cd1){return _[_0x6a98('0x69')](_0x35b2d8,_0xfc9cd1);});if(_0x421b35){return _0x5e4914['id'];}}}));}}return BPromise['all'](_0x1f3029)[_0x6a98('0x11')](function(_0x69688c){_0x50486d=_(_0x50486d)[_0x6a98('0x6a')](_0x69688c)[_0x6a98('0x6b')]()['value']();return db[_0x6a98('0x22')]['find']({'where':{'id':_0x30f926[_0x6a98('0x25')]['id']}})['then'](function(_0x3d0228){return db['sequelize'][_0x6a98('0x6c')](function(_0x4dacb3){return _0x3d0228['removeTeams'](_0x30f926[_0x6a98('0x21')][_0x6a98('0x50')],{'transaction':_0x4dacb3})[_0x6a98('0x11')](function(){if(!_['isEmpty'](_0x50486d)){return _0x3d0228[_0x6a98('0x6d')](_0x50486d,{'transaction':_0x4dacb3});}})[_0x6a98('0x11')](function(){_0x50486d['forEach'](function(_0x235e57){socket[_0x6a98('0x5a')]('userChatQueue:remove',{'UserId':_0x235e57,'ChatQueueId':_0x3d0228['id']});});});});});});})[_0x6a98('0x11')](respondWithStatusCode(_0x4a5d1f,null))[_0x6a98('0x24')](handleError(_0x4a5d1f,null));};exports[_0x6a98('0x6e')]=function(_0x3826ea,_0x4bdb77){return db[_0x6a98('0x22')][_0x6a98('0x35')]({'where':{'id':_0x3826ea[_0x6a98('0x25')]['id']}})[_0x6a98('0x11')](handleEntityNotFound(_0x4bdb77,null))[_0x6a98('0x11')](function(_0x515110){if(_0x515110){return _0x515110[_0x6a98('0x6e')](_0x3826ea[_0x6a98('0x30')]['ids'],_[_0x6a98('0x6f')](_0x3826ea[_0x6a98('0x30')],[_0x6a98('0x50'),'id'])||{})[_0x6a98('0x70')](function(_0x455fb9){for(var _0x298a2b=0x0;_0x298a2b<_0x3826ea[_0x6a98('0x30')][_0x6a98('0x50')][_0x6a98('0x2b')];_0x298a2b+=0x1){socket[_0x6a98('0x5a')]('userChatQueue:save',{'UserId':Number(_0x3826ea[_0x6a98('0x30')][_0x6a98('0x50')][_0x298a2b]),'ChatQueueId':Number(_0x3826ea[_0x6a98('0x25')]['id'])});}return _0x455fb9;});}})[_0x6a98('0x11')](respondWithResult(_0x4bdb77,null))['catch'](handleError(_0x4bdb77,null));};exports[_0x6a98('0x6d')]=function(_0x332061,_0xac1919){return db['ChatQueue'][_0x6a98('0x35')]({'where':{'id':_0x332061[_0x6a98('0x25')]['id']}})['then'](handleEntityNotFound(_0xac1919,null))[_0x6a98('0x11')](function(_0x8189ad){if(_0x8189ad){return _0x8189ad[_0x6a98('0x6d')](_0x332061[_0x6a98('0x21')][_0x6a98('0x50')])[_0x6a98('0x11')](function(){if(_[_0x6a98('0x71')](_0x332061[_0x6a98('0x21')][_0x6a98('0x50')])){for(var _0x47ad7e=0x0;_0x47ad7e<_0x332061['query'][_0x6a98('0x50')][_0x6a98('0x2b')];_0x47ad7e+=0x1){socket[_0x6a98('0x5a')](_0x6a98('0x72'),{'UserId':Number(_0x332061[_0x6a98('0x21')][_0x6a98('0x50')][_0x47ad7e]),'ChatQueueId':Number(_0x332061[_0x6a98('0x25')]['id'])});}}else{socket[_0x6a98('0x5a')](_0x6a98('0x72'),{'UserId':Number(_0x332061['query'][_0x6a98('0x50')]),'ChatQueueId':Number(_0x332061[_0x6a98('0x25')]['id'])});}});}})[_0x6a98('0x11')](respondWithStatusCode(_0xac1919,null))[_0x6a98('0x24')](handleError(_0xac1919,null));};exports['getAgents']=function(_0x3a743b,_0x3c03be){var _0x5c8807={};var _0x43a44a={};var _0x40b000;var _0x34d52b;return db['ChatQueue']['findOne']({'where':{'id':_0x3a743b[_0x6a98('0x25')]['id']}})['then'](handleEntityNotFound(_0x3c03be,null))[_0x6a98('0x11')](function(_0x543534){if(_0x543534){_0x40b000=_0x543534;_0x43a44a['model']=_['keys'](db[_0x6a98('0x45')][_0x6a98('0x1a')]);_0x43a44a[_0x6a98('0x21')]=_[_0x6a98('0x26')](_0x3a743b['query']);_0x43a44a[_0x6a98('0x27')]=_[_0x6a98('0x29')](_0x43a44a[_0x6a98('0x2c')],_0x43a44a[_0x6a98('0x21')]);_0x5c8807[_0x6a98('0x28')]=_[_0x6a98('0x29')](_0x43a44a[_0x6a98('0x2c')],qs[_0x6a98('0x2a')](_0x3a743b['query'][_0x6a98('0x2a')]));_0x5c8807[_0x6a98('0x28')]=_0x5c8807[_0x6a98('0x28')][_0x6a98('0x2b')]?_0x5c8807[_0x6a98('0x28')]:_0x43a44a[_0x6a98('0x2c')];_0x5c8807[_0x6a98('0x3f')]=qs[_0x6a98('0x40')](_0x3a743b['query']['sort']);_0x5c8807[_0x6a98('0x1e')]=qs[_0x6a98('0x27')](_[_0x6a98('0x41')](_0x3a743b[_0x6a98('0x21')],_0x43a44a[_0x6a98('0x27')]));if(_0x3a743b['query'][_0x6a98('0x43')]){_0x5c8807[_0x6a98('0x1e')]=_[_0x6a98('0x2d')](_0x5c8807['where'],{'$or':_['map'](_0x5c8807[_0x6a98('0x28')],function(_0x2b486c){var _0x27bc6e={};_0x27bc6e[_0x2b486c]={'$like':'%'+_0x3a743b[_0x6a98('0x21')]['filter']+'%'};return _0x27bc6e;})});}_0x5c8807=_['merge']({},_0x5c8807,_0x3a743b[_0x6a98('0x2e')]);return _0x40b000[_0x6a98('0x73')](_0x5c8807);}})['then'](function(_0x560e76){if(_0x560e76){_0x34d52b=_0x560e76['length'];if(!_0x3a743b[_0x6a98('0x21')][_0x6a98('0x3c')](_0x6a98('0x3d'))){_0x5c8807['limit']=qs['limit'](_0x3a743b['query'][_0x6a98('0x3e')]);_0x5c8807['offset']=qs[_0x6a98('0xc')](_0x3a743b[_0x6a98('0x21')][_0x6a98('0xc')]);}return _0x40b000['getAgents'](_0x5c8807);}})[_0x6a98('0x11')](function(_0x41fff8){if(_0x41fff8){return _0x41fff8?{'count':_0x34d52b,'rows':_0x41fff8}:null;}})[_0x6a98('0x11')](respondWithResult(_0x3c03be,null))[_0x6a98('0x24')](handleError(_0x3c03be,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index f5a9eb0..75ac84b 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 _0xb6d1=['exports','events','ChatQueue','update','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb6d1,0x151));var _0x1b6d=function(_0x3544a4,_0x2b801c){_0x3544a4=_0x3544a4-0x0;var _0x3ad501=_0xb6d1[_0x3544a4];return _0x3ad501;};'use strict';var EventEmitter=require(_0x1b6d('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x1b6d('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1b6d('0x2'),'afterDestroy':_0x1b6d('0x3')};function emitEvent(_0x1ef620){return function(_0x3fcf8b,_0x3d5351,_0x2962f1){ChatQueueEvents['emit'](_0x1ef620+':'+_0x3fcf8b['id'],_0x3fcf8b);ChatQueueEvents[_0x1b6d('0x4')](_0x1ef620,_0x3fcf8b);_0x2962f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x1b6d('0x5')](e,emitEvent(event));}}module[_0x1b6d('0x6')]=ChatQueueEvents; \ No newline at end of file +var _0x9246=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x5c418a,_0x5392ac){var _0x20f968=function(_0x4891b9){while(--_0x4891b9){_0x5c418a['push'](_0x5c418a['shift']());}};_0x20f968(++_0x5392ac);}(_0x9246,0x18a));var _0x6924=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x9246[_0x476bf4];return _0x788ffe;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x6924('0x0'))['db'][_0x6924('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6924('0x2'),'afterUpdate':_0x6924('0x3'),'afterDestroy':_0x6924('0x4')};function emitEvent(_0x1ecff7){return function(_0x7656fe,_0x47a87d,_0x441d72){ChatQueueEvents[_0x6924('0x5')](_0x1ecff7+':'+_0x7656fe['id'],_0x7656fe);ChatQueueEvents['emit'](_0x1ecff7,_0x7656fe);_0x441d72(null);};}for(var e in events){if(events[_0x6924('0x6')](e)){var event=events[e];ChatQueue[_0x6924('0x7')](e,emitEvent(event));}}module[_0x6924('0x8')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index e444e57..d74500f 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 _0xcf43=['moment','request-promise','path','rimraf','../../config/environment','exports','define','ChatQueue','chat_queues','lodash','../../config/logger'];(function(_0x481674,_0x139f2d){var _0xecbabf=function(_0x377404){while(--_0x377404){_0x481674['push'](_0x481674['shift']());}};_0xecbabf(++_0x139f2d);}(_0xcf43,0x8d));var _0x3cf4=function(_0xfa514e,_0x2665aa){_0xfa514e=_0xfa514e-0x0;var _0x39d8b0=_0xcf43[_0xfa514e];return _0x39d8b0;};'use strict';var _=require(_0x3cf4('0x0'));var util=require('util');var logger=require(_0x3cf4('0x1'))('api');var moment=require(_0x3cf4('0x2'));var BPromise=require('bluebird');var rp=require(_0x3cf4('0x3'));var fs=require('fs');var path=require(_0x3cf4('0x4'));var rimraf=require(_0x3cf4('0x5'));var config=require(_0x3cf4('0x6'));var attributes=require('./chatQueue.attributes');module[_0x3cf4('0x7')]=function(_0x592077,_0xd7f82){return _0x592077[_0x3cf4('0x8')](_0x3cf4('0x9'),attributes,{'tableName':_0x3cf4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd6b=['request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0xcd6b,0x96));var _0xbcd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd6b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xbcd6('0x0'));var util=require('util');var logger=require(_0xbcd6('0x1'))(_0xbcd6('0x2'));var moment=require('moment');var BPromise=require(_0xbcd6('0x3'));var rp=require(_0xbcd6('0x4'));var fs=require('fs');var path=require(_0xbcd6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbcd6('0x6'));module[_0xbcd6('0x7')]=function(_0xb21e55,_0x39f36f){return _0xb21e55[_0xbcd6('0x8')](_0xbcd6('0x9'),attributes,{'tableName':_0xbcd6('0xa'),'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 0052d6c..35486fb 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 _0x0c8d=['error','code','ChatQueue,\x20%s,\x20%s','message','info','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','ShowChatQueue','find','debug','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./chatQueue.socket','then','request\x20sent','stringify'];(function(_0x50c125,_0x17a7af){var _0x1c1f49=function(_0x1643fd){while(--_0x1643fd){_0x50c125['push'](_0x50c125['shift']());}};_0x1c1f49(++_0x17a7af);}(_0x0c8d,0x79));var _0xd0c8=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x0c8d[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require(_0xd0c8('0x0'));var moment=require(_0xd0c8('0x1'));var BPromise=require(_0xd0c8('0x2'));var rs=require(_0xd0c8('0x3'));var fs=require('fs');var Redis=require(_0xd0c8('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd0c8('0x5'));var jayson=require(_0xd0c8('0x6'));var client=jayson[_0xd0c8('0x7')]['http']({'port':0x232a});config[_0xd0c8('0x8')]=_['defaults'](config[_0xd0c8('0x8')],{'host':_0xd0c8('0x9'),'port':0x18eb});var socket=require(_0xd0c8('0xa'))(new Redis(config[_0xd0c8('0x8')]));require(_0xd0c8('0xb'))['register'](socket);function respondWithRpcPromise(_0x82ca40,_0x22df4d,_0x3b9aed){return new BPromise(function(_0x1a38b9,_0x557607){return client['request'](_0x82ca40,_0x3b9aed)[_0xd0c8('0xc')](function(_0x10f4ea){logger['info']('ChatQueue,\x20%s,\x20%s',_0x22df4d,'request\x20sent');logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x22df4d,_0xd0c8('0xd'),JSON[_0xd0c8('0xe')](_0x10f4ea));if(_0x10f4ea['error']){if(_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x10')]===0x1f4){logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);return _0x557607(_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);}logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x10f4ea[_0xd0c8('0xf')][_0xd0c8('0x12')]);return _0x1a38b9(_0x10f4ea['error'][_0xd0c8('0x12')]);}else{logger[_0xd0c8('0x13')](_0xd0c8('0x11'),_0x22df4d,'request\x20sent');_0x1a38b9(_0x10f4ea['result'][_0xd0c8('0x12')]);}})['catch'](function(_0x5e797c){logger[_0xd0c8('0xf')](_0xd0c8('0x11'),_0x22df4d,_0x5e797c);_0x557607(_0x5e797c);});});}exports['GetChatQueue']=function(_0x10c878){var _0x42ba67=this;return new Promise(function(_0x559ddd,_0x1a5a3d){return db[_0xd0c8('0x14')][_0xd0c8('0x15')]({'raw':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x17')]===undefined?!![]:![]:!![],'where':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x18')]||null:null,'attributes':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x19')]||null:null,'limit':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x1a')]||null:null,'include':_0x10c878[_0xd0c8('0x16')]?_0x10c878[_0xd0c8('0x16')][_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0x10c878['options']['include'],function(_0xc109ee){return{'model':db[_0xc109ee[_0xd0c8('0x1d')]],'as':_0xc109ee['as'],'attributes':_0xc109ee[_0xd0c8('0x19')],'include':_0xc109ee[_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0xc109ee[_0xd0c8('0x1b')],function(_0x39ec6d){return{'model':db[_0x39ec6d[_0xd0c8('0x1d')]],'as':_0x39ec6d['as'],'attributes':_0x39ec6d[_0xd0c8('0x19')],'include':_0x39ec6d['include']?_[_0xd0c8('0x1c')](_0x39ec6d[_0xd0c8('0x1b')],function(_0x160032){return{'model':db[_0x160032['model']],'as':_0x160032['as'],'attributes':_0x160032['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x22e125){logger['info'](_0xd0c8('0x1e'),_0x10c878);logger['debug'](_0xd0c8('0x1e'),_0x10c878,JSON[_0xd0c8('0xe')](_0x22e125));_0x559ddd(_0x22e125);})['catch'](function(_0x30336a){logger[_0xd0c8('0xf')](_0xd0c8('0x1e'),_0x30336a['message'],_0x10c878);_0x1a5a3d(_0x42ba67[_0xd0c8('0xf')](0x1f4,_0x30336a[_0xd0c8('0x12')]));});});};exports[_0xd0c8('0x1f')]=function(_0x21d7fb){var _0x87f472=this;return new Promise(function(_0x1f4b11,_0x3cf0f1){return db[_0xd0c8('0x14')][_0xd0c8('0x20')]({'raw':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x21d7fb['options']?_0x21d7fb[_0xd0c8('0x16')]['where']||null:null,'attributes':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb['options'][_0xd0c8('0x19')]||null:null,'include':_0x21d7fb[_0xd0c8('0x16')]?_0x21d7fb[_0xd0c8('0x16')][_0xd0c8('0x1b')]?_[_0xd0c8('0x1c')](_0x21d7fb[_0xd0c8('0x16')][_0xd0c8('0x1b')],function(_0x481cef){return{'model':db[_0x481cef[_0xd0c8('0x1d')]],'as':_0x481cef['as'],'attributes':_0x481cef[_0xd0c8('0x19')],'include':_0x481cef['include']?_[_0xd0c8('0x1c')](_0x481cef[_0xd0c8('0x1b')],function(_0x321fe7){return{'model':db[_0x321fe7[_0xd0c8('0x1d')]],'as':_0x321fe7['as'],'attributes':_0x321fe7[_0xd0c8('0x19')],'include':_0x321fe7[_0xd0c8('0x1b')]?_['map'](_0x321fe7[_0xd0c8('0x1b')],function(_0x17f58c){return{'model':db[_0x17f58c[_0xd0c8('0x1d')]],'as':_0x17f58c['as'],'attributes':_0x17f58c[_0xd0c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0xd0c8('0xc')](function(_0x3d533f){logger[_0xd0c8('0x13')]('ShowChatQueue',_0x21d7fb);logger[_0xd0c8('0x21')](_0xd0c8('0x1f'),_0x21d7fb,JSON[_0xd0c8('0xe')](_0x3d533f));_0x1f4b11(_0x3d533f);})['catch'](function(_0x265a4d){logger[_0xd0c8('0xf')](_0xd0c8('0x1f'),_0x265a4d[_0xd0c8('0x12')],_0x21d7fb);_0x3cf0f1(_0x87f472[_0xd0c8('0xf')](0x1f4,_0x265a4d[_0xd0c8('0x12')]));});});}; \ No newline at end of file +var _0x1794=['GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowChatQueue','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1794,0x19d));var _0x4179=function(_0x3ff150,_0x228f06){_0x3ff150=_0x3ff150-0x0;var _0xb6ac18=_0x1794[_0x3ff150];return _0xb6ac18;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4179('0x0'));var BPromise=require(_0x4179('0x1'));var rs=require(_0x4179('0x2'));var fs=require('fs');var Redis=require(_0x4179('0x3'));var db=require(_0x4179('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4179('0x5'));var config=require(_0x4179('0x6'));var jayson=require(_0x4179('0x7'));var client=jayson[_0x4179('0x8')][_0x4179('0x9')]({'port':0x232a});config[_0x4179('0xa')]=_[_0x4179('0xb')](config[_0x4179('0xa')],{'host':_0x4179('0xc'),'port':0x18eb});var socket=require(_0x4179('0xd'))(new Redis(config['redis']));require(_0x4179('0xe'))[_0x4179('0xf')](socket);function respondWithRpcPromise(_0xa0bd21,_0x5ed1c6,_0x71c3df){return new BPromise(function(_0x591de5,_0x345270){return client['request'](_0xa0bd21,_0x71c3df)[_0x4179('0x10')](function(_0x5ad5e7){logger[_0x4179('0x11')](_0x4179('0x12'),_0x5ed1c6,_0x4179('0x13'));logger['debug'](_0x4179('0x14'),_0x5ed1c6,'request\x20sent',JSON[_0x4179('0x15')](_0x5ad5e7));if(_0x5ad5e7[_0x4179('0x16')]){if(_0x5ad5e7['error'][_0x4179('0x17')]===0x1f4){logger[_0x4179('0x16')]('ChatQueue,\x20%s,\x20%s',_0x5ed1c6,_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);return _0x345270(_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);}logger[_0x4179('0x16')](_0x4179('0x12'),_0x5ed1c6,_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);return _0x591de5(_0x5ad5e7[_0x4179('0x16')][_0x4179('0x18')]);}else{logger[_0x4179('0x11')](_0x4179('0x12'),_0x5ed1c6,_0x4179('0x13'));_0x591de5(_0x5ad5e7[_0x4179('0x19')]['message']);}})[_0x4179('0x1a')](function(_0x508074){logger[_0x4179('0x16')]('ChatQueue,\x20%s,\x20%s',_0x5ed1c6,_0x508074);_0x345270(_0x508074);});});}exports[_0x4179('0x1b')]=function(_0x2cdea0){var _0x55b04f=this;return new Promise(function(_0x5968ae,_0x3d3264){return db[_0x4179('0x1c')][_0x4179('0x1d')]({'raw':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x1f')]===undefined?!![]:![]:!![],'where':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x20')]||null:null,'attributes':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')]['attributes']||null:null,'limit':_0x2cdea0['options']?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x21')]||null:null,'include':_0x2cdea0[_0x4179('0x1e')]?_0x2cdea0[_0x4179('0x1e')][_0x4179('0x22')]?_[_0x4179('0x23')](_0x2cdea0['options'][_0x4179('0x22')],function(_0x45cb7e){return{'model':db[_0x45cb7e[_0x4179('0x24')]],'as':_0x45cb7e['as'],'attributes':_0x45cb7e[_0x4179('0x25')],'include':_0x45cb7e['include']?_[_0x4179('0x23')](_0x45cb7e[_0x4179('0x22')],function(_0x230f53){return{'model':db[_0x230f53[_0x4179('0x24')]],'as':_0x230f53['as'],'attributes':_0x230f53[_0x4179('0x25')],'include':_0x230f53[_0x4179('0x22')]?_[_0x4179('0x23')](_0x230f53['include'],function(_0x5cbfb2){return{'model':db[_0x5cbfb2[_0x4179('0x24')]],'as':_0x5cbfb2['as'],'attributes':_0x5cbfb2[_0x4179('0x25')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x38906d){logger['info']('GetChatQueue',_0x2cdea0);logger[_0x4179('0x26')](_0x4179('0x1b'),_0x2cdea0,JSON[_0x4179('0x15')](_0x38906d));_0x5968ae(_0x38906d);})[_0x4179('0x1a')](function(_0x194fd2){logger['error']('GetChatQueue',_0x194fd2[_0x4179('0x18')],_0x2cdea0);_0x3d3264(_0x55b04f['error'](0x1f4,_0x194fd2['message']));});});};exports[_0x4179('0x27')]=function(_0x123b36){var _0x63aa5a=this;return new Promise(function(_0x49bf5d,_0x40cbed){return db[_0x4179('0x1c')]['find']({'raw':_0x123b36[_0x4179('0x1e')]?_0x123b36['options'][_0x4179('0x1f')]===undefined?!![]:![]:!![],'where':_0x123b36[_0x4179('0x1e')]?_0x123b36['options'][_0x4179('0x20')]||null:null,'attributes':_0x123b36[_0x4179('0x1e')]?_0x123b36[_0x4179('0x1e')][_0x4179('0x25')]||null:null,'include':_0x123b36[_0x4179('0x1e')]?_0x123b36[_0x4179('0x1e')][_0x4179('0x22')]?_['map'](_0x123b36['options'][_0x4179('0x22')],function(_0x72d6f5){return{'model':db[_0x72d6f5['model']],'as':_0x72d6f5['as'],'attributes':_0x72d6f5[_0x4179('0x25')],'include':_0x72d6f5[_0x4179('0x22')]?_[_0x4179('0x23')](_0x72d6f5[_0x4179('0x22')],function(_0x27289c){return{'model':db[_0x27289c['model']],'as':_0x27289c['as'],'attributes':_0x27289c[_0x4179('0x25')],'include':_0x27289c[_0x4179('0x22')]?_[_0x4179('0x23')](_0x27289c['include'],function(_0x507a4a){return{'model':db[_0x507a4a[_0x4179('0x24')]],'as':_0x507a4a['as'],'attributes':_0x507a4a[_0x4179('0x25')]};}):[]};}):[]};}):[]:[]})[_0x4179('0x10')](function(_0x394485){logger[_0x4179('0x11')]('ShowChatQueue',_0x123b36);logger['debug'](_0x4179('0x27'),_0x123b36,JSON[_0x4179('0x15')](_0x394485));_0x49bf5d(_0x394485);})[_0x4179('0x1a')](function(_0x37e838){logger['error'](_0x4179('0x27'),_0x37e838['message'],_0x123b36);_0x40cbed(_0x63aa5a[_0x4179('0x16')](0x1f4,_0x37e838['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index fc776b4..151bc17 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 _0x68fc=['emit','removeListener','register','chatQueue:','./chatQueue.events','save','remove'];(function(_0x4452dc,_0x479149){var _0x52b892=function(_0x4a0098){while(--_0x4a0098){_0x4452dc['push'](_0x4452dc['shift']());}};_0x52b892(++_0x479149);}(_0x68fc,0xa5));var _0xc68f=function(_0x165fb3,_0x42d4d6){_0x165fb3=_0x165fb3-0x0;var _0xf7b888=_0x68fc[_0x165fb3];return _0xf7b888;};'use strict';var ChatQueueEvents=require(_0xc68f('0x0'));var events=[_0xc68f('0x1'),_0xc68f('0x2'),'update'];function createListener(_0x49aa95,_0x26513f){return function(_0x506fb5){_0x26513f[_0xc68f('0x3')](_0x49aa95,_0x506fb5);};}function removeListener(_0x593648,_0x5899ea){return function(){ChatQueueEvents[_0xc68f('0x4')](_0x593648,_0x5899ea);};}exports[_0xc68f('0x5')]=function(_0x1c6df9){for(var _0x363cdf=0x0,_0x4fcce4=events['length'];_0x363cdf<_0x4fcce4;_0x363cdf++){var _0x9f2705=events[_0x363cdf];var _0x2bf3fd=createListener(_0xc68f('0x6')+_0x9f2705,_0x1c6df9);ChatQueueEvents['on'](_0x9f2705,_0x2bf3fd);}}; \ No newline at end of file +var _0x5c12=['removeListener','chatQueue:','save','remove','emit'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5c12,0x188));var _0x25c1=function(_0x221b8c,_0x2c7afc){_0x221b8c=_0x221b8c-0x0;var _0x3fab9f=_0x5c12[_0x221b8c];return _0x3fab9f;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x25c1('0x0'),_0x25c1('0x1'),'update'];function createListener(_0x44bc2e,_0x1991e5){return function(_0x4042fe){_0x1991e5[_0x25c1('0x2')](_0x44bc2e,_0x4042fe);};}function removeListener(_0x2c5df0,_0x21ec20){return function(){ChatQueueEvents[_0x25c1('0x3')](_0x2c5df0,_0x21ec20);};}exports['register']=function(_0x204287){for(var _0x42ac16=0x0,_0x382922=events['length'];_0x42ac16<_0x382922;_0x42ac16++){var _0x5c69b1=events[_0x42ac16];var _0x24981c=createListener(_0x25c1('0x4')+_0x5c69b1,_0x204287);ChatQueueEvents['on'](_0x5c69b1,_0x24981c);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 8120bbb..477ddf6 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x1a7938,_0x20527a){var _0x3f0f7d=function(_0x3d84f0){while(--_0x3d84f0){_0x1a7938['push'](_0x1a7938['shift']());}};_0x3f0f7d(++_0x20527a);}(_0x7217,0x19e));var _0x7721=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0x7217[_0x2576d7];return _0x16a08c;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router; \ No newline at end of file +var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x30fbf5,_0x487ca){var _0x4babde=function(_0x11fda2){while(--_0x11fda2){_0x30fbf5['push'](_0x30fbf5['shift']());}};_0x4babde(++_0x487ca);}(_0x814b,0x1a2));var _0xb814=function(_0x5cf90e,_0x5df405){_0x5cf90e=_0x5cf90e-0x0;var _0xae958d=_0x814b[_0x5cf90e];return _0xae958d;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 6fab48d..e038191 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 _0xef6c=['moment','sequelize','exports','DATE','STRING'];(function(_0x2d9800,_0xf0f64b){var _0x291946=function(_0x14fa8c){while(--_0x14fa8c){_0x2d9800['push'](_0x2d9800['shift']());}};_0x291946(++_0xf0f64b);}(_0xef6c,0x10e));var _0xcef6=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xef6c[_0x151721];return _0x2deaa7;};'use strict';var moment=require(_0xcef6('0x0'));var Sequelize=require(_0xcef6('0x1'));module[_0xcef6('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xcef6('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xcef6('0x3')]},'reason':{'type':Sequelize[_0xcef6('0x4')]}}; \ No newline at end of file +var _0x5c91=['sequelize','exports','STRING','DATE','moment'];(function(_0x1fc773,_0x299be7){var _0x2965cf=function(_0x33914d){while(--_0x33914d){_0x1fc773['push'](_0x1fc773['shift']());}};_0x2965cf(++_0x299be7);}(_0x5c91,0x1e9));var _0x15c9=function(_0xc706fd,_0x33ce12){_0xc706fd=_0xc706fd-0x0;var _0x8834e0=_0x5c91[_0xc706fd];return _0x8834e0;};'use strict';var moment=require(_0x15c9('0x0'));var Sequelize=require(_0x15c9('0x1'));module[_0x15c9('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x15c9('0x3')]},'joinAt':{'type':Sequelize[_0x15c9('0x4')]},'leaveAt':{'type':Sequelize[_0x15c9('0x4')]},'acceptAt':{'type':Sequelize[_0x15c9('0x4')]},'exitAt':{'type':Sequelize[_0x15c9('0x4')]},'reason':{'type':Sequelize[_0x15c9('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 43bb500..0876b54 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 _0x1261=['end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','ChatQueueReport','model','map','name','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','pick','filters','where','type','VIRTUAL','filter','merge','options','findAll','rows','params','include','find','create','catch','body','describe','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','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x46ba68,_0x1a6d8e){var _0x53b37a=function(_0x37ab2c){while(--_0x37ab2c){_0x46ba68['push'](_0x46ba68['shift']());}};_0x53b37a(++_0x1a6d8e);}(_0x1261,0x144));var _0x1126=function(_0x315d84,_0x3dacc3){_0x315d84=_0x315d84-0x0;var _0x560da1=_0x1261[_0x315d84];return _0x560da1;};'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);};}exports['index']=function(_0x2fb797,_0x23d2bc){var _0x4a334a={},_0x3fa694={},_0x4bf807={'count':0x0,'rows':[]};var _0xc62460=_['map'](db[_0x1126('0x29')]['rawAttributes'],function(_0x378f4d){return{'name':_0x378f4d['fieldName'],'type':_0x378f4d['type']['key']};});_0x3fa694[_0x1126('0x2a')]=_[_0x1126('0x2b')](_0xc62460,_0x1126('0x2c'));_0x3fa694['query']=_[_0x1126('0x2d')](_0x2fb797[_0x1126('0x2e')]);_0x3fa694['filters']=_[_0x1126('0x2f')](_0x3fa694[_0x1126('0x2a')],_0x3fa694[_0x1126('0x2e')]);_0x4a334a[_0x1126('0x30')]=_['intersection'](_0x3fa694['model'],qs[_0x1126('0x31')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x31')]));_0x4a334a[_0x1126('0x30')]=_0x4a334a['attributes'][_0x1126('0x32')]?_0x4a334a[_0x1126('0x30')]:_0x3fa694[_0x1126('0x2a')];if(!_0x2fb797[_0x1126('0x2e')][_0x1126('0x33')]('nolimit')){_0x4a334a[_0x1126('0x1e')]=qs[_0x1126('0x1e')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1e')]);_0x4a334a['offset']=qs['offset'](_0x2fb797[_0x1126('0x2e')][_0x1126('0x1c')]);}_0x4a334a['order']=qs[_0x1126('0x34')](_0x2fb797[_0x1126('0x2e')][_0x1126('0x34')]);_0x4a334a['where']=qs['filters'](_[_0x1126('0x35')](_0x2fb797[_0x1126('0x2e')],_0x3fa694[_0x1126('0x36')]),_0xc62460);if(_0x2fb797[_0x1126('0x2e')]['filter']){_0x4a334a[_0x1126('0x37')]=_['merge'](_0x4a334a[_0x1126('0x37')],{'$or':_[_0x1126('0x2b')](_0xc62460,function(_0xfa96e0){if(_0xfa96e0[_0x1126('0x38')]!==_0x1126('0x39')){var _0x5746f6={};_0x5746f6[_0xfa96e0[_0x1126('0x2c')]]={'$like':'%'+_0x2fb797[_0x1126('0x2e')][_0x1126('0x3a')]+'%'};return _0x5746f6;}})});}_0x4a334a=_[_0x1126('0x3b')]({},_0x4a334a,_0x2fb797[_0x1126('0x3c')]);var _0x3442b8={'where':_0x4a334a[_0x1126('0x37')]};return db['ChatQueueReport'][_0x1126('0x1f')](_0x3442b8)[_0x1126('0x25')](function(_0x227a6b){_0x4bf807[_0x1126('0x1f')]=_0x227a6b;if(_0x2fb797[_0x1126('0x2e')]['includeAll']){_0x4a334a['include']=[{'all':!![]}];}return db[_0x1126('0x29')][_0x1126('0x3d')](_0x4a334a);})[_0x1126('0x25')](function(_0x21c38e){_0x4bf807[_0x1126('0x3e')]=_0x21c38e;return _0x4bf807;})[_0x1126('0x25')](respondWithFilteredResult(_0x23d2bc,_0x4a334a))['catch'](handleError(_0x23d2bc,null));};exports['show']=function(_0x4cb1db,_0xb8054e){var _0x5d4194={'raw':!![],'where':{'id':_0x4cb1db[_0x1126('0x3f')]['id']}},_0xf84005={};_0xf84005[_0x1126('0x2a')]=_[_0x1126('0x2d')](db['ChatQueueReport']['rawAttributes']);_0xf84005[_0x1126('0x2e')]=_[_0x1126('0x2d')](_0x4cb1db[_0x1126('0x2e')]);_0xf84005['filters']=_[_0x1126('0x2f')](_0xf84005['model'],_0xf84005[_0x1126('0x2e')]);_0x5d4194['attributes']=_[_0x1126('0x2f')](_0xf84005[_0x1126('0x2a')],qs[_0x1126('0x31')](_0x4cb1db['query'][_0x1126('0x31')]));_0x5d4194[_0x1126('0x30')]=_0x5d4194[_0x1126('0x30')]['length']?_0x5d4194['attributes']:_0xf84005['model'];if(_0x4cb1db[_0x1126('0x2e')]['includeAll']){_0x5d4194[_0x1126('0x40')]=[{'all':!![]}];}_0x5d4194=_['merge']({},_0x5d4194,_0x4cb1db[_0x1126('0x3c')]);return db[_0x1126('0x29')][_0x1126('0x41')](_0x5d4194)[_0x1126('0x25')](handleEntityNotFound(_0xb8054e,null))[_0x1126('0x25')](respondWithResult(_0xb8054e,null))['catch'](handleError(_0xb8054e,null));};exports[_0x1126('0x42')]=function(_0x512f60,_0x5111d3){return db[_0x1126('0x29')][_0x1126('0x42')](_0x512f60['body'],{})[_0x1126('0x25')](respondWithResult(_0x5111d3,0xc9))[_0x1126('0x43')](handleError(_0x5111d3,null));};exports['update']=function(_0x3e4eeb,_0xbdde58){if(_0x3e4eeb[_0x1126('0x44')]['id']){delete _0x3e4eeb['body']['id'];}return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x3e4eeb[_0x1126('0x3f')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x25')](saveUpdates(_0x3e4eeb[_0x1126('0x44')],null))[_0x1126('0x25')](respondWithResult(_0xbdde58,null))[_0x1126('0x43')](handleError(_0xbdde58,null));};exports['destroy']=function(_0x1b8b83,_0x5a2287){return db[_0x1126('0x29')][_0x1126('0x41')]({'where':{'id':_0x1b8b83['params']['id']}})['then'](handleEntityNotFound(_0x5a2287,null))[_0x1126('0x25')](removeEntity(_0x5a2287,null))[_0x1126('0x43')](handleError(_0x5a2287,null));};exports[_0x1126('0x45')]=function(_0x52a9a4,_0x3cb44c){return db[_0x1126('0x29')][_0x1126('0x45')]()[_0x1126('0x25')](respondWithResult(_0x3cb44c,null))['catch'](handleError(_0x3cb44c,null));}; \ No newline at end of file +var _0xbedb=['hasOwnProperty','order','sort','filters','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','include','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','ChatQueueReport','rawAttributes','fieldName','type','keys','query','model','intersection','fields','attributes','length'];(function(_0x8ef0c5,_0x1a3644){var _0x5d8249=function(_0x438ea7){while(--_0x438ea7){_0x8ef0c5['push'](_0x8ef0c5['shift']());}};_0x5d8249(++_0x1a3644);}(_0xbedb,0x12e));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xbbed('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbbed('0x1'));var jsonpatch=require(_0xbbed('0x2'));var rp=require(_0xbbed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbbed('0x4'));var util=require(_0xbbed('0x5'));var path=require(_0xbbed('0x6'));var sox=require(_0xbbed('0x7'));var csv=require(_0xbbed('0x8'));var ejs=require(_0xbbed('0x9'));var fs=require('fs');var fs_extra=require(_0xbbed('0xa'));var _=require(_0xbbed('0xb'));var squel=require(_0xbbed('0xc'));var crypto=require(_0xbbed('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbed('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbbed('0xf'));var Redis=require(_0xbbed('0x10'));var authService=require(_0xbbed('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbbed('0x12'));var logger=require(_0xbbed('0x13'))(_0xbbed('0x14'));var utils=require(_0xbbed('0x15'));var config=require(_0xbbed('0x16'));var licenseUtil=require(_0xbbed('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4324b5,_0x4ed197){_0x4ed197=_0x4ed197||0xcc;return function(_0x13e24e){if(_0x13e24e){return _0x4324b5[_0xbbed('0x18')](_0x4ed197);}return _0x4324b5[_0xbbed('0x19')](_0x4ed197)[_0xbbed('0x1a')]();};}function respondWithResult(_0xebc428,_0x194cea){_0x194cea=_0x194cea||0xc8;return function(_0x161bef){if(_0x161bef){return _0xebc428[_0xbbed('0x19')](_0x194cea)[_0xbbed('0x1b')](_0x161bef);}};}function respondWithFilteredResult(_0x286048,_0x5eb641){return function(_0x359469){if(_0x359469){var _0x5dfb44=typeof _0x5eb641[_0xbbed('0x1c')]===_0xbbed('0x1d')&&typeof _0x5eb641[_0xbbed('0x1e')]===_0xbbed('0x1d');var _0xe9dc82=_0x359469['count'];var _0x19e9ce=_0x5dfb44?0x0:_0x5eb641[_0xbbed('0x1c')];var _0x44fd74=_0x5dfb44?_0x359469[_0xbbed('0x1f')]:_0x5eb641[_0xbbed('0x1c')]+_0x5eb641[_0xbbed('0x1e')];var _0x31eea9;if(_0x44fd74>=_0xe9dc82){_0x44fd74=_0xe9dc82;_0x31eea9=0xc8;}else{_0x31eea9=0xce;}_0x286048[_0xbbed('0x19')](_0x31eea9);return _0x286048[_0xbbed('0x20')](_0xbbed('0x21'),_0x19e9ce+'-'+_0x44fd74+'/'+_0xe9dc82)[_0xbbed('0x1b')](_0x359469);}return null;};}function patchUpdates(_0xf166a4){return function(_0x8031d3){try{jsonpatch['apply'](_0x8031d3,_0xf166a4,!![]);}catch(_0x2b4ad0){return BPromise[_0xbbed('0x22')](_0x2b4ad0);}return _0x8031d3[_0xbbed('0x23')]();};}function saveUpdates(_0x493773,_0x40ce77){return function(_0xcc9f37){if(_0xcc9f37){return _0xcc9f37[_0xbbed('0x24')](_0x493773)[_0xbbed('0x25')](function(_0x4ebc1e){return _0x4ebc1e;});}return null;};}function removeEntity(_0x13c422,_0x479c81){return function(_0x163893){if(_0x163893){return _0x163893[_0xbbed('0x26')]()['then'](function(){_0x13c422[_0xbbed('0x19')](0xcc)[_0xbbed('0x1a')]();});}};}function handleEntityNotFound(_0x11ebcf,_0xe1993e){return function(_0x3a77c6){if(!_0x3a77c6){_0x11ebcf[_0xbbed('0x18')](0x194);}return _0x3a77c6;};}function handleError(_0x4fba6e,_0x1231ad){_0x1231ad=_0x1231ad||0x1f4;return function(_0x5dd187){logger[_0xbbed('0x27')](_0x5dd187['stack']);if(_0x5dd187[_0xbbed('0x28')]){delete _0x5dd187[_0xbbed('0x28')];}_0x4fba6e[_0xbbed('0x19')](_0x1231ad)[_0xbbed('0x29')](_0x5dd187);};}exports['index']=function(_0x1339b9,_0x45aff2){var _0x381cb8={},_0x446c21={},_0x565a82={'count':0x0,'rows':[]};var _0xb7fb6c=_['map'](db[_0xbbed('0x2a')][_0xbbed('0x2b')],function(_0x4e0137){return{'name':_0x4e0137[_0xbbed('0x2c')],'type':_0x4e0137[_0xbbed('0x2d')]['key']};});_0x446c21['model']=_['map'](_0xb7fb6c,'name');_0x446c21['query']=_[_0xbbed('0x2e')](_0x1339b9[_0xbbed('0x2f')]);_0x446c21['filters']=_['intersection'](_0x446c21[_0xbbed('0x30')],_0x446c21[_0xbbed('0x2f')]);_0x381cb8['attributes']=_[_0xbbed('0x31')](_0x446c21['model'],qs[_0xbbed('0x32')](_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x32')]));_0x381cb8['attributes']=_0x381cb8[_0xbbed('0x33')][_0xbbed('0x34')]?_0x381cb8[_0xbbed('0x33')]:_0x446c21[_0xbbed('0x30')];if(!_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x35')]('nolimit')){_0x381cb8[_0xbbed('0x1e')]=qs['limit'](_0x1339b9['query'][_0xbbed('0x1e')]);_0x381cb8['offset']=qs[_0xbbed('0x1c')](_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x1c')]);}_0x381cb8[_0xbbed('0x36')]=qs['sort'](_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x37')]);_0x381cb8['where']=qs['filters'](_['pick'](_0x1339b9[_0xbbed('0x2f')],_0x446c21[_0xbbed('0x38')]),_0xb7fb6c);if(_0x1339b9[_0xbbed('0x2f')][_0xbbed('0x39')]){_0x381cb8[_0xbbed('0x3a')]=_[_0xbbed('0x3b')](_0x381cb8[_0xbbed('0x3a')],{'$or':_['map'](_0xb7fb6c,function(_0x2e62e8){if(_0x2e62e8[_0xbbed('0x2d')]!==_0xbbed('0x3c')){var _0xc50bb2={};_0xc50bb2[_0x2e62e8[_0xbbed('0x28')]]={'$like':'%'+_0x1339b9['query'][_0xbbed('0x39')]+'%'};return _0xc50bb2;}})});}_0x381cb8=_[_0xbbed('0x3b')]({},_0x381cb8,_0x1339b9['options']);var _0x1278d1={'where':_0x381cb8[_0xbbed('0x3a')]};return db[_0xbbed('0x2a')][_0xbbed('0x1f')](_0x1278d1)[_0xbbed('0x25')](function(_0x45f514){_0x565a82['count']=_0x45f514;if(_0x1339b9['query'][_0xbbed('0x3d')]){_0x381cb8['include']=[{'all':!![]}];}return db[_0xbbed('0x2a')]['findAll'](_0x381cb8);})[_0xbbed('0x25')](function(_0x2d9b79){_0x565a82[_0xbbed('0x3e')]=_0x2d9b79;return _0x565a82;})[_0xbbed('0x25')](respondWithFilteredResult(_0x45aff2,_0x381cb8))[_0xbbed('0x3f')](handleError(_0x45aff2,null));};exports[_0xbbed('0x40')]=function(_0x540903,_0x2caabb){var _0x515bd3={'raw':!![],'where':{'id':_0x540903[_0xbbed('0x41')]['id']}},_0x401344={};_0x401344[_0xbbed('0x30')]=_['keys'](db[_0xbbed('0x2a')]['rawAttributes']);_0x401344['query']=_[_0xbbed('0x2e')](_0x540903['query']);_0x401344['filters']=_[_0xbbed('0x31')](_0x401344[_0xbbed('0x30')],_0x401344[_0xbbed('0x2f')]);_0x515bd3['attributes']=_[_0xbbed('0x31')](_0x401344[_0xbbed('0x30')],qs['fields'](_0x540903[_0xbbed('0x2f')][_0xbbed('0x32')]));_0x515bd3[_0xbbed('0x33')]=_0x515bd3[_0xbbed('0x33')][_0xbbed('0x34')]?_0x515bd3[_0xbbed('0x33')]:_0x401344[_0xbbed('0x30')];if(_0x540903['query'][_0xbbed('0x3d')]){_0x515bd3[_0xbbed('0x42')]=[{'all':!![]}];}_0x515bd3=_[_0xbbed('0x3b')]({},_0x515bd3,_0x540903[_0xbbed('0x43')]);return db[_0xbbed('0x2a')][_0xbbed('0x44')](_0x515bd3)['then'](handleEntityNotFound(_0x2caabb,null))[_0xbbed('0x25')](respondWithResult(_0x2caabb,null))['catch'](handleError(_0x2caabb,null));};exports['create']=function(_0x3d5eeb,_0x42a655){return db['ChatQueueReport'][_0xbbed('0x45')](_0x3d5eeb[_0xbbed('0x46')],{})[_0xbbed('0x25')](respondWithResult(_0x42a655,0xc9))['catch'](handleError(_0x42a655,null));};exports[_0xbbed('0x24')]=function(_0x1f2e0b,_0x50168e){if(_0x1f2e0b[_0xbbed('0x46')]['id']){delete _0x1f2e0b[_0xbbed('0x46')]['id'];}return db[_0xbbed('0x2a')][_0xbbed('0x44')]({'where':{'id':_0x1f2e0b[_0xbbed('0x41')]['id']}})[_0xbbed('0x25')](handleEntityNotFound(_0x50168e,null))[_0xbbed('0x25')](saveUpdates(_0x1f2e0b[_0xbbed('0x46')],null))[_0xbbed('0x25')](respondWithResult(_0x50168e,null))[_0xbbed('0x3f')](handleError(_0x50168e,null));};exports[_0xbbed('0x26')]=function(_0x1bb0d6,_0x63d030){return db[_0xbbed('0x2a')][_0xbbed('0x44')]({'where':{'id':_0x1bb0d6[_0xbbed('0x41')]['id']}})[_0xbbed('0x25')](handleEntityNotFound(_0x63d030,null))[_0xbbed('0x25')](removeEntity(_0x63d030,null))[_0xbbed('0x3f')](handleError(_0x63d030,null));};exports['describe']=function(_0x256188,_0x5aff2e){return db['ChatQueueReport']['describe']()[_0xbbed('0x25')](respondWithResult(_0x5aff2e,null))['catch'](handleError(_0x5aff2e,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index cfc816d..420714f 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x1c21fe,_0x3774a4){var _0x2532d9=function(_0x482a04){while(--_0x482a04){_0x1c21fe['push'](_0x1c21fe['shift']());}};_0x2532d9(++_0x3774a4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xb7e7[_0x34bc30];return _0x5706de;};'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_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x3d73ba,_0x356e23){var _0x47e406=function(_0x90df31){while(--_0x90df31){_0x3d73ba['push'](_0x3d73ba['shift']());}};_0x47e406(++_0x356e23);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index bb6006e..272b465 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 _0x33ad=['request','info','request\x20sent','stringify','error','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','create','body','options','raw','then','debug','UpdateChatQueueReport','ChatQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x7cb841,_0x49f5d4){var _0x52383f=function(_0x5c194a){while(--_0x5c194a){_0x7cb841['push'](_0x7cb841['shift']());}};_0x52383f(++_0x49f5d4);}(_0x33ad,0xb2));var _0xd33a=function(_0x50798e,_0x19c6fe){_0x50798e=_0x50798e-0x0;var _0x3c5939=_0x33ad[_0x50798e];return _0x3c5939;};'use strict';var _=require(_0xd33a('0x0'));var util=require(_0xd33a('0x1'));var moment=require(_0xd33a('0x2'));var BPromise=require(_0xd33a('0x3'));var rs=require(_0xd33a('0x4'));var fs=require('fs');var Redis=require(_0xd33a('0x5'));var db=require(_0xd33a('0x6'))['db'];var utils=require(_0xd33a('0x7'));var logger=require(_0xd33a('0x8'))(_0xd33a('0x9'));var config=require(_0xd33a('0xa'));var jayson=require(_0xd33a('0xb'));var client=jayson[_0xd33a('0xc')][_0xd33a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x24bc45,_0x9a8fba,_0x5e7845){return new BPromise(function(_0x32f404,_0x11b37d){return client[_0xd33a('0xe')](_0x24bc45,_0x5e7845)['then'](function(_0x479c6b){logger[_0xd33a('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x9a8fba,'request\x20sent');logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x9a8fba,_0xd33a('0x10'),JSON[_0xd33a('0x11')](_0x479c6b));if(_0x479c6b[_0xd33a('0x12')]){if(_0x479c6b[_0xd33a('0x12')]['code']===0x1f4){logger[_0xd33a('0x12')](_0xd33a('0x13'),_0x9a8fba,_0x479c6b[_0xd33a('0x12')][_0xd33a('0x14')]);return _0x11b37d(_0x479c6b[_0xd33a('0x12')]['message']);}logger[_0xd33a('0x12')](_0xd33a('0x13'),_0x9a8fba,_0x479c6b[_0xd33a('0x12')][_0xd33a('0x14')]);return _0x32f404(_0x479c6b['error'][_0xd33a('0x14')]);}else{logger[_0xd33a('0xf')](_0xd33a('0x13'),_0x9a8fba,_0xd33a('0x10'));_0x32f404(_0x479c6b[_0xd33a('0x15')]['message']);}})[_0xd33a('0x16')](function(_0x71e8ce){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x9a8fba,_0x71e8ce);_0x11b37d(_0x71e8ce);});});}exports[_0xd33a('0x17')]=function(_0x260d1c){var _0x2f1de8=this;return new Promise(function(_0xf12073,_0x445a7e){return db['ChatQueueReport'][_0xd33a('0x18')](_0x260d1c[_0xd33a('0x19')],{'raw':_0x260d1c[_0xd33a('0x1a')]?_0x260d1c[_0xd33a('0x1a')][_0xd33a('0x1b')]===undefined?!![]:![]:!![]})[_0xd33a('0x1c')](function(_0x10b21c){logger['info'](_0xd33a('0x17'),_0x260d1c);logger[_0xd33a('0x1d')](_0xd33a('0x17'),_0x260d1c,JSON[_0xd33a('0x11')](_0x10b21c));_0xf12073(_0x10b21c);})[_0xd33a('0x16')](function(_0x47ef70){logger['error'](_0xd33a('0x17'),_0x47ef70[_0xd33a('0x14')],_0x260d1c);_0x445a7e(_0x2f1de8['error'](0x1f4,_0x47ef70[_0xd33a('0x14')]));});});};exports[_0xd33a('0x1e')]=function(_0x5587d8){var _0x49ff23=this;return new Promise(function(_0xf50391,_0x2fc0a4){return db[_0xd33a('0x1f')]['update'](_0x5587d8['body'],{'raw':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8[_0xd33a('0x1a')][_0xd33a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8['options']['where']||null:null,'attributes':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8[_0xd33a('0x1a')]['attributes']||null:null,'limit':_0x5587d8[_0xd33a('0x1a')]?_0x5587d8[_0xd33a('0x1a')]['limit']||null:null})[_0xd33a('0x1c')](function(_0x23b0da){logger[_0xd33a('0xf')]('UpdateChatQueueReport',_0x5587d8);logger[_0xd33a('0x1d')](_0xd33a('0x1e'),_0x5587d8,JSON['stringify'](_0x23b0da));_0xf50391(_0x23b0da);})['catch'](function(_0x130785){logger['error']('UpdateChatQueueReport',_0x130785[_0xd33a('0x14')],_0x5587d8);_0x2fc0a4(_0x49ff23[_0xd33a('0x12')](0x1f4,_0x130785[_0xd33a('0x14')]));});});}; \ No newline at end of file +var _0xe3f5=['limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','ChatQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','info','request\x20sent','result','CreateChatQueueReport','ChatQueueReport','create','options','raw','catch','UpdateChatQueueReport','update','where','attributes'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe3f5,0x118));var _0x5e3f=function(_0x31b75a,_0x383d5a){_0x31b75a=_0x31b75a-0x0;var _0x3328d2=_0xe3f5[_0x31b75a];return _0x3328d2;};'use strict';var _=require(_0x5e3f('0x0'));var util=require('util');var moment=require(_0x5e3f('0x1'));var BPromise=require(_0x5e3f('0x2'));var rs=require(_0x5e3f('0x3'));var fs=require('fs');var Redis=require(_0x5e3f('0x4'));var db=require(_0x5e3f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e3f('0x6'))('rpc');var config=require(_0x5e3f('0x7'));var jayson=require(_0x5e3f('0x8'));var client=jayson['client'][_0x5e3f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55d06f,_0x259d81,_0x16b6bb){return new BPromise(function(_0x8fbf08,_0x25e080){return client['request'](_0x55d06f,_0x16b6bb)[_0x5e3f('0xa')](function(_0x1b4bfe){logger['info'](_0x5e3f('0xb'),_0x259d81,'request\x20sent');logger[_0x5e3f('0xc')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x259d81,'request\x20sent',JSON[_0x5e3f('0xd')](_0x1b4bfe));if(_0x1b4bfe[_0x5e3f('0xe')]){if(_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0xf')]===0x1f4){logger[_0x5e3f('0xe')](_0x5e3f('0xb'),_0x259d81,_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0x10')]);return _0x25e080(_0x1b4bfe['error'][_0x5e3f('0x10')]);}logger[_0x5e3f('0xe')](_0x5e3f('0xb'),_0x259d81,_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0x10')]);return _0x8fbf08(_0x1b4bfe[_0x5e3f('0xe')][_0x5e3f('0x10')]);}else{logger[_0x5e3f('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x259d81,_0x5e3f('0x12'));_0x8fbf08(_0x1b4bfe[_0x5e3f('0x13')][_0x5e3f('0x10')]);}})['catch'](function(_0x14f830){logger[_0x5e3f('0xe')](_0x5e3f('0xb'),_0x259d81,_0x14f830);_0x25e080(_0x14f830);});});}exports[_0x5e3f('0x14')]=function(_0x5b84b9){var _0x244c5a=this;return new Promise(function(_0xda0686,_0x1b7fb9){return db[_0x5e3f('0x15')][_0x5e3f('0x16')](_0x5b84b9['body'],{'raw':_0x5b84b9['options']?_0x5b84b9[_0x5e3f('0x17')][_0x5e3f('0x18')]===undefined?!![]:![]:!![]})[_0x5e3f('0xa')](function(_0x3fa250){logger[_0x5e3f('0x11')](_0x5e3f('0x14'),_0x5b84b9);logger[_0x5e3f('0xc')](_0x5e3f('0x14'),_0x5b84b9,JSON['stringify'](_0x3fa250));_0xda0686(_0x3fa250);})[_0x5e3f('0x19')](function(_0x3a95d7){logger[_0x5e3f('0xe')]('CreateChatQueueReport',_0x3a95d7[_0x5e3f('0x10')],_0x5b84b9);_0x1b7fb9(_0x244c5a['error'](0x1f4,_0x3a95d7[_0x5e3f('0x10')]));});});};exports[_0x5e3f('0x1a')]=function(_0x1cbb21){var _0xcd1eda=this;return new Promise(function(_0x8d36c1,_0x2cc5cc){return db[_0x5e3f('0x15')][_0x5e3f('0x1b')](_0x1cbb21['body'],{'raw':_0x1cbb21[_0x5e3f('0x17')]?_0x1cbb21['options'][_0x5e3f('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1cbb21[_0x5e3f('0x17')]?_0x1cbb21[_0x5e3f('0x17')][_0x5e3f('0x1c')]||null:null,'attributes':_0x1cbb21[_0x5e3f('0x17')]?_0x1cbb21[_0x5e3f('0x17')][_0x5e3f('0x1d')]||null:null,'limit':_0x1cbb21['options']?_0x1cbb21[_0x5e3f('0x17')][_0x5e3f('0x1e')]||null:null})[_0x5e3f('0xa')](function(_0x371425){logger['info'](_0x5e3f('0x1a'),_0x1cbb21);logger[_0x5e3f('0xc')](_0x5e3f('0x1a'),_0x1cbb21,JSON[_0x5e3f('0xd')](_0x371425));_0x8d36c1(_0x371425);})[_0x5e3f('0x19')](function(_0x2b73f5){logger[_0x5e3f('0xe')](_0x5e3f('0x1a'),_0x2b73f5[_0x5e3f('0x10')],_0x1cbb21);_0x2cc5cc(_0xcd1eda[_0x5e3f('0xe')](0x1f4,_0x2b73f5[_0x5e3f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 4af925a..6682a48 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 _0x14e7=['isAuthenticated','/:id','show','post','create','update','delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','index','/describe'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x14e7,0x1d4));var _0x714e=function(_0x185683,_0x3efc9a){_0x185683=_0x185683-0x0;var _0x3828f9=_0x14e7[_0x185683];return _0x3828f9;};'use strict';var multer=require('multer');var util=require(_0x714e('0x0'));var path=require('path');var timeout=require(_0x714e('0x1'));var express=require(_0x714e('0x2'));var router=express[_0x714e('0x3')]();var fs_extra=require(_0x714e('0x4'));var auth=require(_0x714e('0x5'));var interaction=require(_0x714e('0x6'));var config=require(_0x714e('0x7'));var controller=require(_0x714e('0x8'));router[_0x714e('0x9')]('/',auth['isAuthenticated'](),controller[_0x714e('0xa')]);router['get'](_0x714e('0xb'),auth[_0x714e('0xc')](),controller['describe']);router['get'](_0x714e('0xd'),auth[_0x714e('0xc')](),controller[_0x714e('0xe')]);router[_0x714e('0xf')]('/',auth['isAuthenticated'](),controller[_0x714e('0x10')]);router['put'](_0x714e('0xd'),auth[_0x714e('0xc')](),controller[_0x714e('0x11')]);router[_0x714e('0x12')]('/:id',auth[_0x714e('0xc')](),controller[_0x714e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6136=['/describe','describe','show','create','put','update','delete','/:id','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x35d8ad,_0x24b5f0){var _0x3fb9e0=function(_0x5bd58f){while(--_0x5bd58f){_0x35d8ad['push'](_0x35d8ad['shift']());}};_0x3fb9e0(++_0x24b5f0);}(_0x6136,0x105));var _0x6613=function(_0x543898,_0x1e504b){_0x543898=_0x543898-0x0;var _0x4ac0ae=_0x6136[_0x543898];return _0x4ac0ae;};'use strict';var multer=require(_0x6613('0x0'));var util=require('util');var path=require(_0x6613('0x1'));var timeout=require(_0x6613('0x2'));var express=require(_0x6613('0x3'));var router=express[_0x6613('0x4')]();var fs_extra=require(_0x6613('0x5'));var auth=require(_0x6613('0x6'));var interaction=require(_0x6613('0x7'));var config=require(_0x6613('0x8'));var controller=require(_0x6613('0x9'));router[_0x6613('0xa')]('/',auth[_0x6613('0xb')](),controller['index']);router['get'](_0x6613('0xc'),auth[_0x6613('0xb')](),controller[_0x6613('0xd')]);router[_0x6613('0xa')]('/:id',auth[_0x6613('0xb')](),controller[_0x6613('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6613('0xf')]);router[_0x6613('0x10')]('/:id',auth[_0x6613('0xb')](),controller[_0x6613('0x11')]);router[_0x6613('0x12')](_0x6613('0x13'),auth['isAuthenticated'](),controller[_0x6613('0x14')]);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 1a55a7b..1c6ff41 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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2a0034,_0x51c1a1){var _0x55c1b0=function(_0x349508){while(--_0x349508){_0x2a0034['push'](_0x2a0034['shift']());}};_0x55c1b0(++_0x51c1a1);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file +var _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0x008c,0x188));var _0xc008=function(_0xf3b3e7,_0x1b2afc){_0xf3b3e7=_0xf3b3e7-0x0;var _0x4a22a2=_0x008c[_0xf3b3e7];return _0x4a22a2;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index f552050..6ca7e92 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 _0x87f5=['sendStatus','status','end','json','limit','offset','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','rows','show','rawAttributes','fields','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x87f5,0xc5));var _0x587f=function(_0x25667f,_0x57980b){_0x25667f=_0x25667f-0x0;var _0x39ad0e=_0x87f5[_0x25667f];return _0x39ad0e;};'use strict';var emlformat=require(_0x587f('0x0'));var rimraf=require(_0x587f('0x1'));var zipdir=require(_0x587f('0x2'));var jsonpatch=require(_0x587f('0x3'));var rp=require(_0x587f('0x4'));var moment=require(_0x587f('0x5'));var BPromise=require(_0x587f('0x6'));var Mustache=require('mustache');var util=require(_0x587f('0x7'));var path=require('path');var sox=require(_0x587f('0x8'));var csv=require(_0x587f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x587f('0xa'));var _=require(_0x587f('0xb'));var squel=require(_0x587f('0xc'));var crypto=require('crypto');var jsforce=require(_0x587f('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x587f('0xe'));var Papa=require('papaparse');var Redis=require(_0x587f('0xf'));var authService=require(_0x587f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x587f('0x11'));var hardwareService=require(_0x587f('0x12'));var logger=require('../../config/logger')(_0x587f('0x13'));var utils=require(_0x587f('0x14'));var config=require(_0x587f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50765a,_0x40f98a){_0x40f98a=_0x40f98a||0xcc;return function(_0x21eac7){if(_0x21eac7){return _0x50765a[_0x587f('0x16')](_0x40f98a);}return _0x50765a[_0x587f('0x17')](_0x40f98a)[_0x587f('0x18')]();};}function respondWithResult(_0x9af2d8,_0x5119c7){_0x5119c7=_0x5119c7||0xc8;return function(_0x96f12c){if(_0x96f12c){return _0x9af2d8[_0x587f('0x17')](_0x5119c7)[_0x587f('0x19')](_0x96f12c);}};}function respondWithFilteredResult(_0x3a9faf,_0x124bf3){return function(_0x4bf832){if(_0x4bf832){var _0x10629d=typeof _0x124bf3['offset']==='undefined'&&typeof _0x124bf3[_0x587f('0x1a')]==='undefined';var _0x2bf8c6=_0x4bf832['count'];var _0xd3c399=_0x10629d?0x0:_0x124bf3[_0x587f('0x1b')];var _0x51002b=_0x10629d?_0x4bf832[_0x587f('0x1c')]:_0x124bf3[_0x587f('0x1b')]+_0x124bf3[_0x587f('0x1a')];var _0x5cb237;if(_0x51002b>=_0x2bf8c6){_0x51002b=_0x2bf8c6;_0x5cb237=0xc8;}else{_0x5cb237=0xce;}_0x3a9faf[_0x587f('0x17')](_0x5cb237);return _0x3a9faf[_0x587f('0x1d')](_0x587f('0x1e'),_0xd3c399+'-'+_0x51002b+'/'+_0x2bf8c6)[_0x587f('0x19')](_0x4bf832);}return null;};}function patchUpdates(_0x35f5c5){return function(_0x71294f){try{jsonpatch['apply'](_0x71294f,_0x35f5c5,!![]);}catch(_0xad18d){return BPromise[_0x587f('0x1f')](_0xad18d);}return _0x71294f[_0x587f('0x20')]();};}function saveUpdates(_0x91a9c2,_0x2c5bdb){return function(_0x9ae7f8){if(_0x9ae7f8){return _0x9ae7f8[_0x587f('0x21')](_0x91a9c2)['then'](function(_0x25f2da){return _0x25f2da;});}return null;};}function removeEntity(_0x339eeb,_0x4e2a84){return function(_0x3580d4){if(_0x3580d4){return _0x3580d4[_0x587f('0x22')]()[_0x587f('0x23')](function(){_0x339eeb['status'](0xcc)[_0x587f('0x18')]();});}};}function handleEntityNotFound(_0x17c8d5,_0x459874){return function(_0x1b62d4){if(!_0x1b62d4){_0x17c8d5[_0x587f('0x16')](0x194);}return _0x1b62d4;};}function handleError(_0x55a952,_0x34b6a2){_0x34b6a2=_0x34b6a2||0x1f4;return function(_0x58ad7b){logger[_0x587f('0x24')](_0x58ad7b[_0x587f('0x25')]);if(_0x58ad7b[_0x587f('0x26')]){delete _0x58ad7b[_0x587f('0x26')];}_0x55a952[_0x587f('0x17')](_0x34b6a2)[_0x587f('0x27')](_0x58ad7b);};}exports[_0x587f('0x28')]=function(_0x57a159,_0x1bfa92){var _0x57461a={},_0x57d813={},_0x2ed6b1={'count':0x0,'rows':[]};var _0x49f2f4=_[_0x587f('0x29')](db['ChatTransferReport']['rawAttributes'],function(_0x2388cf){return{'name':_0x2388cf[_0x587f('0x2a')],'type':_0x2388cf[_0x587f('0x2b')]['key']};});_0x57d813[_0x587f('0x2c')]=_[_0x587f('0x29')](_0x49f2f4,'name');_0x57d813[_0x587f('0x2d')]=_['keys'](_0x57a159[_0x587f('0x2d')]);_0x57d813[_0x587f('0x2e')]=_[_0x587f('0x2f')](_0x57d813[_0x587f('0x2c')],_0x57d813[_0x587f('0x2d')]);_0x57461a[_0x587f('0x30')]=_[_0x587f('0x2f')](_0x57d813[_0x587f('0x2c')],qs['fields'](_0x57a159[_0x587f('0x2d')]['fields']));_0x57461a[_0x587f('0x30')]=_0x57461a[_0x587f('0x30')][_0x587f('0x31')]?_0x57461a['attributes']:_0x57d813[_0x587f('0x2c')];if(!_0x57a159[_0x587f('0x2d')][_0x587f('0x32')](_0x587f('0x33'))){_0x57461a[_0x587f('0x1a')]=qs['limit'](_0x57a159[_0x587f('0x2d')][_0x587f('0x1a')]);_0x57461a[_0x587f('0x1b')]=qs['offset'](_0x57a159[_0x587f('0x2d')]['offset']);}_0x57461a[_0x587f('0x34')]=qs[_0x587f('0x35')](_0x57a159[_0x587f('0x2d')]['sort']);_0x57461a[_0x587f('0x36')]=qs[_0x587f('0x2e')](_[_0x587f('0x37')](_0x57a159[_0x587f('0x2d')],_0x57d813[_0x587f('0x2e')]),_0x49f2f4);if(_0x57a159[_0x587f('0x2d')][_0x587f('0x38')]){_0x57461a[_0x587f('0x36')]=_[_0x587f('0x39')](_0x57461a[_0x587f('0x36')],{'$or':_[_0x587f('0x29')](_0x49f2f4,function(_0x1576e8){if(_0x1576e8['type']!==_0x587f('0x3a')){var _0x38a223={};_0x38a223[_0x1576e8[_0x587f('0x26')]]={'$like':'%'+_0x57a159[_0x587f('0x2d')]['filter']+'%'};return _0x38a223;}})});}_0x57461a=_[_0x587f('0x39')]({},_0x57461a,_0x57a159[_0x587f('0x3b')]);var _0x41e765={'where':_0x57461a['where']};return db[_0x587f('0x3c')][_0x587f('0x1c')](_0x41e765)['then'](function(_0x38c510){_0x2ed6b1[_0x587f('0x1c')]=_0x38c510;if(_0x57a159[_0x587f('0x2d')][_0x587f('0x3d')]){_0x57461a[_0x587f('0x3e')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x57461a);})[_0x587f('0x23')](function(_0x582b54){_0x2ed6b1[_0x587f('0x3f')]=_0x582b54;return _0x2ed6b1;})[_0x587f('0x23')](respondWithFilteredResult(_0x1bfa92,_0x57461a))['catch'](handleError(_0x1bfa92,null));};exports[_0x587f('0x40')]=function(_0x3cf4d0,_0x257a3e){var _0x5b52ee={'raw':!![],'where':{'id':_0x3cf4d0['params']['id']}},_0x406a5b={};_0x406a5b['model']=_['keys'](db[_0x587f('0x3c')][_0x587f('0x41')]);_0x406a5b[_0x587f('0x2d')]=_['keys'](_0x3cf4d0[_0x587f('0x2d')]);_0x406a5b[_0x587f('0x2e')]=_[_0x587f('0x2f')](_0x406a5b['model'],_0x406a5b[_0x587f('0x2d')]);_0x5b52ee['attributes']=_[_0x587f('0x2f')](_0x406a5b['model'],qs[_0x587f('0x42')](_0x3cf4d0[_0x587f('0x2d')][_0x587f('0x42')]));_0x5b52ee[_0x587f('0x30')]=_0x5b52ee[_0x587f('0x30')]['length']?_0x5b52ee[_0x587f('0x30')]:_0x406a5b[_0x587f('0x2c')];if(_0x3cf4d0[_0x587f('0x2d')][_0x587f('0x3d')]){_0x5b52ee[_0x587f('0x3e')]=[{'all':!![]}];}_0x5b52ee=_[_0x587f('0x39')]({},_0x5b52ee,_0x3cf4d0[_0x587f('0x3b')]);return db[_0x587f('0x3c')][_0x587f('0x43')](_0x5b52ee)[_0x587f('0x23')](handleEntityNotFound(_0x257a3e,null))[_0x587f('0x23')](respondWithResult(_0x257a3e,null))[_0x587f('0x44')](handleError(_0x257a3e,null));};exports[_0x587f('0x45')]=function(_0x594934,_0x360a36){return db[_0x587f('0x3c')][_0x587f('0x45')](_0x594934[_0x587f('0x46')],{})[_0x587f('0x23')](respondWithResult(_0x360a36,0xc9))['catch'](handleError(_0x360a36,null));};exports['update']=function(_0x29cded,_0x2155b6){if(_0x29cded[_0x587f('0x46')]['id']){delete _0x29cded[_0x587f('0x46')]['id'];}return db[_0x587f('0x3c')][_0x587f('0x43')]({'where':{'id':_0x29cded['params']['id']}})['then'](handleEntityNotFound(_0x2155b6,null))[_0x587f('0x23')](saveUpdates(_0x29cded[_0x587f('0x46')],null))[_0x587f('0x23')](respondWithResult(_0x2155b6,null))['catch'](handleError(_0x2155b6,null));};exports[_0x587f('0x22')]=function(_0x257960,_0x3033c1){return db['ChatTransferReport']['find']({'where':{'id':_0x257960[_0x587f('0x47')]['id']}})[_0x587f('0x23')](handleEntityNotFound(_0x3033c1,null))['then'](removeEntity(_0x3033c1,null))[_0x587f('0x44')](handleError(_0x3033c1,null));};exports[_0x587f('0x48')]=function(_0x2d7067,_0x51bdb1){return db[_0x587f('0x3c')][_0x587f('0x48')]()[_0x587f('0x23')](respondWithResult(_0x51bdb1,null))['catch'](handleError(_0x51bdb1,null));}; \ No newline at end of file +var _0x8f01=['where','filters','pick','filter','merge','VIRTUAL','include','rows','catch','show','params','keys','includeAll','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','reject','save','update','then','end','name','send','index','ChatTransferReport','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x22f85a,_0x195ed5){var _0xaa717=function(_0xe9828e){while(--_0xe9828e){_0x22f85a['push'](_0x22f85a['shift']());}};_0xaa717(++_0x195ed5);}(_0x8f01,0x147));var _0x18f0=function(_0x19f9e6,_0x4f59a6){_0x19f9e6=_0x19f9e6-0x0;var _0x45c862=_0x8f01[_0x19f9e6];return _0x45c862;};'use strict';var emlformat=require(_0x18f0('0x0'));var rimraf=require(_0x18f0('0x1'));var zipdir=require(_0x18f0('0x2'));var jsonpatch=require(_0x18f0('0x3'));var rp=require(_0x18f0('0x4'));var moment=require('moment');var BPromise=require(_0x18f0('0x5'));var Mustache=require(_0x18f0('0x6'));var util=require(_0x18f0('0x7'));var path=require('path');var sox=require(_0x18f0('0x8'));var csv=require(_0x18f0('0x9'));var ejs=require(_0x18f0('0xa'));var fs=require('fs');var fs_extra=require(_0x18f0('0xb'));var _=require(_0x18f0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x18f0('0xd'));var deskjs=require(_0x18f0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x18f0('0xf'));var Papa=require(_0x18f0('0x10'));var Redis=require(_0x18f0('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x18f0('0x12'));var hardwareService=require(_0x18f0('0x13'));var logger=require(_0x18f0('0x14'))(_0x18f0('0x15'));var utils=require(_0x18f0('0x16'));var config=require(_0x18f0('0x17'));var licenseUtil=require(_0x18f0('0x18'));var db=require(_0x18f0('0x19'))['db'];function respondWithStatusCode(_0x246213,_0x2f3188){_0x2f3188=_0x2f3188||0xcc;return function(_0x3edee3){if(_0x3edee3){return _0x246213[_0x18f0('0x1a')](_0x2f3188);}return _0x246213[_0x18f0('0x1b')](_0x2f3188)['end']();};}function respondWithResult(_0x4f0f1f,_0x4a976d){_0x4a976d=_0x4a976d||0xc8;return function(_0x1149af){if(_0x1149af){return _0x4f0f1f['status'](_0x4a976d)[_0x18f0('0x1c')](_0x1149af);}};}function respondWithFilteredResult(_0x2a1e84,_0x3ec71e){return function(_0x3c1a6f){if(_0x3c1a6f){var _0x5b81ec=typeof _0x3ec71e['offset']===_0x18f0('0x1d')&&typeof _0x3ec71e[_0x18f0('0x1e')]==='undefined';var _0x36883d=_0x3c1a6f['count'];var _0x2f36f3=_0x5b81ec?0x0:_0x3ec71e[_0x18f0('0x1f')];var _0x2ce895=_0x5b81ec?_0x3c1a6f[_0x18f0('0x20')]:_0x3ec71e[_0x18f0('0x1f')]+_0x3ec71e[_0x18f0('0x1e')];var _0x43ff81;if(_0x2ce895>=_0x36883d){_0x2ce895=_0x36883d;_0x43ff81=0xc8;}else{_0x43ff81=0xce;}_0x2a1e84[_0x18f0('0x1b')](_0x43ff81);return _0x2a1e84['set'](_0x18f0('0x21'),_0x2f36f3+'-'+_0x2ce895+'/'+_0x36883d)[_0x18f0('0x1c')](_0x3c1a6f);}return null;};}function patchUpdates(_0x29dc9c){return function(_0xd92e3f){try{jsonpatch['apply'](_0xd92e3f,_0x29dc9c,!![]);}catch(_0x5e5303){return BPromise[_0x18f0('0x22')](_0x5e5303);}return _0xd92e3f[_0x18f0('0x23')]();};}function saveUpdates(_0x4d4064,_0x128fa0){return function(_0x4cb7ba){if(_0x4cb7ba){return _0x4cb7ba[_0x18f0('0x24')](_0x4d4064)[_0x18f0('0x25')](function(_0x42fbf0){return _0x42fbf0;});}return null;};}function removeEntity(_0x3f5958,_0x55a6db){return function(_0x320226){if(_0x320226){return _0x320226['destroy']()['then'](function(){_0x3f5958[_0x18f0('0x1b')](0xcc)[_0x18f0('0x26')]();});}};}function handleEntityNotFound(_0x302ead,_0x2cfd8f){return function(_0xdc1c04){if(!_0xdc1c04){_0x302ead[_0x18f0('0x1a')](0x194);}return _0xdc1c04;};}function handleError(_0x4b03c6,_0x1d4575){_0x1d4575=_0x1d4575||0x1f4;return function(_0x36cea8){logger['error'](_0x36cea8['stack']);if(_0x36cea8['name']){delete _0x36cea8[_0x18f0('0x27')];}_0x4b03c6['status'](_0x1d4575)[_0x18f0('0x28')](_0x36cea8);};}exports[_0x18f0('0x29')]=function(_0x29c3b5,_0x36b718){var _0x32d879={},_0x5b6cfc={},_0x53bd7e={'count':0x0,'rows':[]};var _0x35e4d2=_['map'](db[_0x18f0('0x2a')][_0x18f0('0x2b')],function(_0x4a46b9){return{'name':_0x4a46b9[_0x18f0('0x2c')],'type':_0x4a46b9[_0x18f0('0x2d')][_0x18f0('0x2e')]};});_0x5b6cfc[_0x18f0('0x2f')]=_[_0x18f0('0x30')](_0x35e4d2,'name');_0x5b6cfc[_0x18f0('0x31')]=_['keys'](_0x29c3b5[_0x18f0('0x31')]);_0x5b6cfc['filters']=_[_0x18f0('0x32')](_0x5b6cfc[_0x18f0('0x2f')],_0x5b6cfc[_0x18f0('0x31')]);_0x32d879[_0x18f0('0x33')]=_['intersection'](_0x5b6cfc[_0x18f0('0x2f')],qs[_0x18f0('0x34')](_0x29c3b5['query'][_0x18f0('0x34')]));_0x32d879[_0x18f0('0x33')]=_0x32d879[_0x18f0('0x33')][_0x18f0('0x35')]?_0x32d879[_0x18f0('0x33')]:_0x5b6cfc[_0x18f0('0x2f')];if(!_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x36')](_0x18f0('0x37'))){_0x32d879[_0x18f0('0x1e')]=qs[_0x18f0('0x1e')](_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x1e')]);_0x32d879[_0x18f0('0x1f')]=qs[_0x18f0('0x1f')](_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x1f')]);}_0x32d879[_0x18f0('0x38')]=qs[_0x18f0('0x39')](_0x29c3b5['query']['sort']);_0x32d879[_0x18f0('0x3a')]=qs[_0x18f0('0x3b')](_[_0x18f0('0x3c')](_0x29c3b5[_0x18f0('0x31')],_0x5b6cfc[_0x18f0('0x3b')]),_0x35e4d2);if(_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x3d')]){_0x32d879['where']=_[_0x18f0('0x3e')](_0x32d879['where'],{'$or':_[_0x18f0('0x30')](_0x35e4d2,function(_0x5ac32e){if(_0x5ac32e[_0x18f0('0x2d')]!==_0x18f0('0x3f')){var _0x333dc6={};_0x333dc6[_0x5ac32e[_0x18f0('0x27')]]={'$like':'%'+_0x29c3b5[_0x18f0('0x31')][_0x18f0('0x3d')]+'%'};return _0x333dc6;}})});}_0x32d879=_[_0x18f0('0x3e')]({},_0x32d879,_0x29c3b5['options']);var _0x4a3942={'where':_0x32d879[_0x18f0('0x3a')]};return db['ChatTransferReport'][_0x18f0('0x20')](_0x4a3942)[_0x18f0('0x25')](function(_0x40d94f){_0x53bd7e[_0x18f0('0x20')]=_0x40d94f;if(_0x29c3b5[_0x18f0('0x31')]['includeAll']){_0x32d879[_0x18f0('0x40')]=[{'all':!![]}];}return db[_0x18f0('0x2a')]['findAll'](_0x32d879);})[_0x18f0('0x25')](function(_0x200278){_0x53bd7e[_0x18f0('0x41')]=_0x200278;return _0x53bd7e;})[_0x18f0('0x25')](respondWithFilteredResult(_0x36b718,_0x32d879))[_0x18f0('0x42')](handleError(_0x36b718,null));};exports[_0x18f0('0x43')]=function(_0x4d915c,_0x24ef97){var _0x298583={'raw':!![],'where':{'id':_0x4d915c[_0x18f0('0x44')]['id']}},_0x14dbff={};_0x14dbff[_0x18f0('0x2f')]=_[_0x18f0('0x45')](db[_0x18f0('0x2a')][_0x18f0('0x2b')]);_0x14dbff['query']=_[_0x18f0('0x45')](_0x4d915c[_0x18f0('0x31')]);_0x14dbff[_0x18f0('0x3b')]=_[_0x18f0('0x32')](_0x14dbff['model'],_0x14dbff['query']);_0x298583[_0x18f0('0x33')]=_['intersection'](_0x14dbff[_0x18f0('0x2f')],qs[_0x18f0('0x34')](_0x4d915c['query']['fields']));_0x298583[_0x18f0('0x33')]=_0x298583[_0x18f0('0x33')][_0x18f0('0x35')]?_0x298583[_0x18f0('0x33')]:_0x14dbff['model'];if(_0x4d915c[_0x18f0('0x31')][_0x18f0('0x46')]){_0x298583[_0x18f0('0x40')]=[{'all':!![]}];}_0x298583=_[_0x18f0('0x3e')]({},_0x298583,_0x4d915c[_0x18f0('0x47')]);return db[_0x18f0('0x2a')][_0x18f0('0x48')](_0x298583)[_0x18f0('0x25')](handleEntityNotFound(_0x24ef97,null))[_0x18f0('0x25')](respondWithResult(_0x24ef97,null))[_0x18f0('0x42')](handleError(_0x24ef97,null));};exports[_0x18f0('0x49')]=function(_0x49cc40,_0x1e92e7){return db[_0x18f0('0x2a')]['create'](_0x49cc40[_0x18f0('0x4a')],{})[_0x18f0('0x25')](respondWithResult(_0x1e92e7,0xc9))['catch'](handleError(_0x1e92e7,null));};exports[_0x18f0('0x24')]=function(_0x18a6f2,_0x17e21a){if(_0x18a6f2['body']['id']){delete _0x18a6f2[_0x18f0('0x4a')]['id'];}return db[_0x18f0('0x2a')][_0x18f0('0x48')]({'where':{'id':_0x18a6f2[_0x18f0('0x44')]['id']}})[_0x18f0('0x25')](handleEntityNotFound(_0x17e21a,null))[_0x18f0('0x25')](saveUpdates(_0x18a6f2[_0x18f0('0x4a')],null))[_0x18f0('0x25')](respondWithResult(_0x17e21a,null))['catch'](handleError(_0x17e21a,null));};exports[_0x18f0('0x4b')]=function(_0x440eb2,_0x1b2e5e){return db['ChatTransferReport'][_0x18f0('0x48')]({'where':{'id':_0x440eb2['params']['id']}})['then'](handleEntityNotFound(_0x1b2e5e,null))[_0x18f0('0x25')](removeEntity(_0x1b2e5e,null))[_0x18f0('0x42')](handleError(_0x1b2e5e,null));};exports[_0x18f0('0x4c')]=function(_0x2dbb33,_0x2af8fd){return db[_0x18f0('0x2a')][_0x18f0('0x4c')]()['then'](respondWithResult(_0x2af8fd,null))[_0x18f0('0x42')](handleError(_0x2af8fd,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d829a29..51a6d45 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 _0x4cd5=['api','moment','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer','uniqueid','util','../../config/logger'];(function(_0x3ca314,_0x46c226){var _0x9e31d8=function(_0x30ba8d){while(--_0x30ba8d){_0x3ca314['push'](_0x3ca314['shift']());}};_0x9e31d8(++_0x46c226);}(_0x4cd5,0x76));var _0x54cd=function(_0x2313ec,_0x629664){_0x2313ec=_0x2313ec-0x0;var _0x2594f6=_0x4cd5[_0x2313ec];return _0x2594f6;};'use strict';var _=require('lodash');var util=require(_0x54cd('0x0'));var logger=require(_0x54cd('0x1'))(_0x54cd('0x2'));var moment=require(_0x54cd('0x3'));var BPromise=require('bluebird');var rp=require(_0x54cd('0x4'));var fs=require('fs');var path=require(_0x54cd('0x5'));var rimraf=require(_0x54cd('0x6'));var config=require(_0x54cd('0x7'));var attributes=require(_0x54cd('0x8'));module['exports']=function(_0x5966c6,_0x1c66c0){return _0x5966c6['define'](_0x54cd('0x9'),attributes,{'tableName':_0x54cd('0xa'),'paranoid':![],'indexes':[{'name':_0x54cd('0xb'),'fields':[_0x54cd('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb9e8=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x2faf2d,_0x272b51){var _0x2bbb8f=function(_0x52228e){while(--_0x52228e){_0x2faf2d['push'](_0x2faf2d['shift']());}};_0x2bbb8f(++_0x272b51);}(_0xb9e8,0x1a1));var _0x8b9e=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0xb9e8[_0x59145a];return _0xf04d7;};'use strict';var _=require(_0x8b9e('0x0'));var util=require(_0x8b9e('0x1'));var logger=require(_0x8b9e('0x2'))(_0x8b9e('0x3'));var moment=require(_0x8b9e('0x4'));var BPromise=require(_0x8b9e('0x5'));var rp=require(_0x8b9e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b9e('0x7'));var config=require(_0x8b9e('0x8'));var attributes=require(_0x8b9e('0x9'));module[_0x8b9e('0xa')]=function(_0x43fbca,_0x3b3530){return _0x43fbca[_0x8b9e('0xb')]('ChatTransferReport',attributes,{'tableName':_0x8b9e('0xc'),'paranoid':![],'indexes':[{'name':_0x8b9e('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 6e94fe7..7822b92 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 _0x9fec=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatTransferReport,\x20%s,\x20%s'];(function(_0x1c0f41,_0x26d95d){var _0x369a9f=function(_0x251234){while(--_0x251234){_0x1c0f41['push'](_0x1c0f41['shift']());}};_0x369a9f(++_0x26d95d);}(_0x9fec,0x14e));var _0xc9fe=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x9fec[_0x3c51d4];return _0x53c45f;};'use strict';var _=require('lodash');var util=require(_0xc9fe('0x0'));var moment=require('moment');var BPromise=require(_0xc9fe('0x1'));var rs=require(_0xc9fe('0x2'));var fs=require('fs');var Redis=require(_0xc9fe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc9fe('0x4'));var logger=require(_0xc9fe('0x5'))(_0xc9fe('0x6'));var config=require(_0xc9fe('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc9fe('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc0fdc5,_0xd2a574,_0x4591c1){return new BPromise(function(_0x1b8461,_0x2fb4b2){return client[_0xc9fe('0x9')](_0xc0fdc5,_0x4591c1)[_0xc9fe('0xa')](function(_0x40c738){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0xd2a574,_0xc9fe('0xb'));logger[_0xc9fe('0xc')](_0xc9fe('0xd'),_0xd2a574,_0xc9fe('0xb'),JSON[_0xc9fe('0xe')](_0x40c738));if(_0x40c738[_0xc9fe('0xf')]){if(_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x10')]===0x1f4){logger['error'](_0xc9fe('0x11'),_0xd2a574,_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);return _0x2fb4b2(_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);}logger[_0xc9fe('0xf')](_0xc9fe('0x11'),_0xd2a574,_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);return _0x1b8461(_0x40c738[_0xc9fe('0xf')][_0xc9fe('0x12')]);}else{logger[_0xc9fe('0x13')](_0xc9fe('0x11'),_0xd2a574,_0xc9fe('0xb'));_0x1b8461(_0x40c738[_0xc9fe('0x14')][_0xc9fe('0x12')]);}})[_0xc9fe('0x15')](function(_0xe8e4f2){logger['error'](_0xc9fe('0x11'),_0xd2a574,_0xe8e4f2);_0x2fb4b2(_0xe8e4f2);});});} \ No newline at end of file +var _0xe191=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util'];(function(_0x57fc31,_0x11fcc6){var _0x4640e6=function(_0x85a791){while(--_0x85a791){_0x57fc31['push'](_0x57fc31['shift']());}};_0x4640e6(++_0x11fcc6);}(_0xe191,0x8e));var _0x1e19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe191[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1e19('0x0'));var util=require(_0x1e19('0x1'));var moment=require(_0x1e19('0x2'));var BPromise=require(_0x1e19('0x3'));var rs=require(_0x1e19('0x4'));var fs=require('fs');var Redis=require(_0x1e19('0x5'));var db=require(_0x1e19('0x6'))['db'];var utils=require(_0x1e19('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x1e19('0x8'));var jayson=require(_0x1e19('0x9'));var client=jayson[_0x1e19('0xa')][_0x1e19('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c9d86,_0x5d1468,_0x1a90b3){return new BPromise(function(_0x4f4647,_0xa9482b){return client['request'](_0x3c9d86,_0x1a90b3)[_0x1e19('0xc')](function(_0xa4636d){logger[_0x1e19('0xd')](_0x1e19('0xe'),_0x5d1468,_0x1e19('0xf'));logger[_0x1e19('0x10')](_0x1e19('0x11'),_0x5d1468,_0x1e19('0xf'),JSON[_0x1e19('0x12')](_0xa4636d));if(_0xa4636d['error']){if(_0xa4636d['error'][_0x1e19('0x13')]===0x1f4){logger[_0x1e19('0x14')](_0x1e19('0xe'),_0x5d1468,_0xa4636d['error'][_0x1e19('0x15')]);return _0xa9482b(_0xa4636d[_0x1e19('0x14')]['message']);}logger[_0x1e19('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x5d1468,_0xa4636d['error'][_0x1e19('0x15')]);return _0x4f4647(_0xa4636d[_0x1e19('0x14')][_0x1e19('0x15')]);}else{logger[_0x1e19('0xd')](_0x1e19('0xe'),_0x5d1468,_0x1e19('0xf'));_0x4f4647(_0xa4636d[_0x1e19('0x16')][_0x1e19('0x15')]);}})[_0x1e19('0x17')](function(_0x186014){logger[_0x1e19('0x14')](_0x1e19('0xe'),_0x5d1468,_0x186014);_0xa9482b(_0x186014);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 62dff95..0553207 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 _0x4a86=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','show','post','update','delete','/:id','destroy','exports','multer','util','path'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0x4a86,0x8d));var _0x64a8=function(_0x4b2df9,_0x11571e){_0x4b2df9=_0x4b2df9-0x0;var _0x4fcb0f=_0x4a86[_0x4b2df9];return _0x4fcb0f;};'use strict';var multer=require(_0x64a8('0x0'));var util=require(_0x64a8('0x1'));var path=require(_0x64a8('0x2'));var timeout=require(_0x64a8('0x3'));var express=require('express');var router=express[_0x64a8('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x64a8('0x5'));var config=require(_0x64a8('0x6'));var controller=require(_0x64a8('0x7'));router['get']('/',auth[_0x64a8('0x8')](),controller[_0x64a8('0x9')]);router['get']('/describe',auth[_0x64a8('0x8')](),controller['describe']);router[_0x64a8('0xa')]('/:id',auth[_0x64a8('0x8')](),controller[_0x64a8('0xb')]);router[_0x64a8('0xc')]('/',auth[_0x64a8('0x8')](),controller['create']);router['put']('/:id',auth[_0x64a8('0x8')](),controller[_0x64a8('0xd')]);router[_0x64a8('0xe')](_0x64a8('0xf'),auth['isAuthenticated'](),controller[_0x64a8('0x10')]);module[_0x64a8('0x11')]=router; \ No newline at end of file +var _0x9b8e=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','index','get','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b8e,0x166));var _0xe9b8=function(_0x517171,_0x68eebb){_0x517171=_0x517171-0x0;var _0x5471af=_0x9b8e[_0x517171];return _0x5471af;};'use strict';var multer=require(_0xe9b8('0x0'));var util=require(_0xe9b8('0x1'));var path=require(_0xe9b8('0x2'));var timeout=require('connect-timeout');var express=require(_0xe9b8('0x3'));var router=express[_0xe9b8('0x4')]();var fs_extra=require(_0xe9b8('0x5'));var auth=require(_0xe9b8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe9b8('0x7'));var controller=require('./chatTransferReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe9b8('0x8')]);router[_0xe9b8('0x9')]('/describe',auth[_0xe9b8('0xa')](),controller[_0xe9b8('0xb')]);router[_0xe9b8('0x9')](_0xe9b8('0xc'),auth[_0xe9b8('0xa')](),controller['show']);router[_0xe9b8('0xd')]('/',auth[_0xe9b8('0xa')](),controller[_0xe9b8('0xe')]);router[_0xe9b8('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xe9b8('0x10')]);router[_0xe9b8('0x11')]('/:id',auth[_0xe9b8('0xa')](),controller[_0xe9b8('0x12')]);module[_0xe9b8('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index f825a29..ce962ae 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 _0xee78=['squared','rounded','We\x20are\x20here!','Chat','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Skip','Feedback','star','thumb','TEXT','stringify','input','name','text','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','getDataValue','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x5a6dc3,_0x30c3fc){var _0x3cf73c=function(_0xe3b432){while(--_0xe3b432){_0x5a6dc3['push'](_0x5a6dc3['shift']());}};_0x3cf73c(++_0x30c3fc);}(_0xee78,0xc9));var _0x8ee7=function(_0x14c600,_0x3ae909){_0x14c600=_0x14c600-0x0;var _0x319da5=_0xee78[_0x14c600];return _0x319da5;};'use strict';var Sequelize=require(_0x8ee7('0x0'));var rs=require(_0x8ee7('0x1'));module['exports']={'name':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'unique':_0x8ee7('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x4')},'mapKeyOffline':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x4')},'key':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8ee7('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x8ee7('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x8ee7('0x2')]},'animation':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x8ee7('0xa')]('rounded',_0x8ee7('0xb')),'defaultValue':_0x8ee7('0xc')},'header_online':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xd')},'start_chat_button':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xe')},'offline_chat_button':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xf')},'header_offline':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x13')},'noteTitle':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x14')},'placeholderMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0xf')},'skipMessageButton':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x16')},'ratingType':{'type':Sequelize[_0x8ee7('0xa')](_0x8ee7('0x17'),_0x8ee7('0x18')),'defaultValue':_0x8ee7('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x8ee7('0x19')],'defaultValue':function(){return JSON[_0x8ee7('0x1a')]({'items':[{'type':_0x8ee7('0x1b'),'variable':null,'config':{'placeholder':_0x8ee7('0x1c'),'type':_0x8ee7('0x1d'),'required':!![]},'props':{'title':_0x8ee7('0x1c'),'helpText':''}},{'type':_0x8ee7('0x1b'),'props':{'title':_0x8ee7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8ee7('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x8ee7('0x1e'))?JSON[_0x8ee7('0x1f')](this['getDataValue'](_0x8ee7('0x1e'))):{};},'set':function(_0x4a5f1e){return this[_0x8ee7('0x20')]('onlineForm',JSON[_0x8ee7('0x1a')](_0x4a5f1e));}},'offlineForm':{'type':Sequelize[_0x8ee7('0x19')],'defaultValue':function(){return JSON[_0x8ee7('0x1a')]({'items':[{'type':'input','props':{'title':_0x8ee7('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x8ee7('0x4'),'type':_0x8ee7('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0x8ee7('0x21')},'props':{'title':_0x8ee7('0x21'),'helpText':_0x8ee7('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x8ee7('0x23'))?JSON['parse'](this[_0x8ee7('0x24')](_0x8ee7('0x23'))):{};},'set':function(_0x344727){return this[_0x8ee7('0x20')](_0x8ee7('0x23'),JSON[_0x8ee7('0x1a')](_0x344727));}},'token':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x8ee7('0x2')]},'waitingTitle':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x25')},'offlineMessageSubject':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x26')},'offlineMessageBody':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x28')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0x15')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x8ee7('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x8ee7('0x29');}},'notificationSound':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x8ee7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x8ee7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x2b')},'verticalAlignment':{'type':Sequelize[_0x8ee7('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x8ee7('0x2')],'defaultValue':_0x8ee7('0x2c')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x8ee7('0x2')]},'customerAvatar':{'type':Sequelize[_0x8ee7('0x19')]},'showCustomerAvatar':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x8ee7('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8ee7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x8ee7('0x2e')},'systemAvatar':{'type':Sequelize[_0x8ee7('0x19')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8ee7('0x8')],'comment':_0x8ee7('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8ee7('0x30'),'set':function(_0x3772b3){if(!_0x3772b3)this[_0x8ee7('0x20')](_0x8ee7('0x31'),null);this['setDataValue'](_0x8ee7('0x32'),_0x3772b3);}},'vidaooEscalation':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x8ee7('0x2')]},'vidaooTopic':{'type':Sequelize[_0x8ee7('0x2')],'allowNull':![],'defaultValue':_0x8ee7('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x8ee7('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x8ee7('0x19')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x8ee7('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x720c=['email','Agent','#011F6A','#ffffff','INTEGER','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','stringify','input','name','getDataValue','onlineForm','parse','TEXT','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','website_alias','bottom_right','CHAT','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING'];(function(_0x263106,_0x30a27a){var _0x35dfca=function(_0x58f38d){while(--_0x58f38d){_0x263106['push'](_0x263106['shift']());}};_0x35dfca(++_0x30a27a);}(_0x720c,0x1be));var _0xc720=function(_0x1dcbc6,_0x219d61){_0x1dcbc6=_0x1dcbc6-0x0;var _0x1a0893=_0x720c[_0x1dcbc6];return _0x1a0893;};'use strict';var Sequelize=require(_0xc720('0x0'));var rs=require(_0xc720('0x1'));module[_0xc720('0x2')]={'name':{'type':Sequelize[_0xc720('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xc720('0x3')]},'mapKey':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x4')},'key':{'type':Sequelize[_0xc720('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x5')},'customerAlias':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xc720('0x3')],'allowNull':![],'defaultValue':_0xc720('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc720('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc720('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xc720('0x3')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xc720('0x9')](_0xc720('0xa'),_0xc720('0xb')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xc')},'start_chat_button':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xd')},'offline_chat_button':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xe')},'header_offline':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x13')},'noteTitle':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x14')},'placeholderMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0xe')},'skipMessageButton':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x16')},'ratingType':{'type':Sequelize[_0xc720('0x9')]('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0xc720('0x17')]({'items':[{'type':_0xc720('0x18'),'variable':null,'config':{'placeholder':_0xc720('0x19'),'type':'text','required':!![]},'props':{'title':_0xc720('0x19'),'helpText':''}},{'type':_0xc720('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xc720('0x4'),'type':_0xc720('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xc720('0x1a')](_0xc720('0x1b'))?JSON[_0xc720('0x1c')](this[_0xc720('0x1a')](_0xc720('0x1b'))):{};},'set':function(_0xce74ad){return this['setDataValue'](_0xc720('0x1b'),JSON[_0xc720('0x17')](_0xce74ad));}},'offlineForm':{'type':Sequelize[_0xc720('0x1d')],'defaultValue':function(){return JSON[_0xc720('0x17')]({'items':[{'type':_0xc720('0x18'),'props':{'title':_0xc720('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xc720('0x4'),'type':'email'},'variable':null},{'type':_0xc720('0x1e'),'config':{'placeholder':_0xc720('0x1f')},'props':{'title':_0xc720('0x1f'),'helpText':_0xc720('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0xc720('0x1a')](_0xc720('0x21'))?JSON[_0xc720('0x1c')](this[_0xc720('0x1a')](_0xc720('0x21'))):{};},'set':function(_0x258a98){return this[_0xc720('0x22')](_0xc720('0x21'),JSON['stringify'](_0x258a98));}},'token':{'type':Sequelize[_0xc720('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xc720('0x3')]},'forwardOffline':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xc720('0x3')]},'waitingTitle':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x23')},'waitingMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x24')},'offlineMessageSubject':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xc720('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x25')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0xc720('0x26')},'sendUnmanaged':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0xe')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0xc720('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xc720('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0xc720('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xc720('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x28')},'verticalAlignment':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x29')},'messagesAlignment':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x2a')},'defaultTitle':{'type':Sequelize[_0xc720('0x3')]},'customerAvatar':{'type':Sequelize[_0xc720('0x1d')]},'showCustomerAvatar':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xc720('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc720('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xc720('0x3')],'defaultValue':_0xc720('0x2b')},'systemAvatar':{'type':Sequelize[_0xc720('0x1d')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xc720('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![],'comment':_0xc720('0x2d'),'set':function(_0x5793ff){if(!_0x5793ff)this[_0xc720('0x22')](_0xc720('0x2e'),null);this[_0xc720('0x22')](_0xc720('0x2f'),_0x5793ff);}},'vidaooEscalation':{'type':Sequelize[_0xc720('0x10')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xc720('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc720('0x30')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0xc720('0x31');}},'vidaooMetadata':{'type':Sequelize[_0xc720('0x1d')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xc720('0x1d')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 7c7ca6c..02a548a 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 _0x4173=['get','ChatWebsites','destroy','stack','name','send','setUA','user-agent','getResult','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','model','vendor','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','length','includeAll','include','find','create','body','address','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','testWildcardValidity','params','describe','ChatWebsiteId','Disposition','getDispositions','findOne','nolimit','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','addSystemAvatar','systemAvatar','getLogo','join','../../config/license/util','getLicense','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','Interval','ifTime','mapKey','MapKey\x20is\x20mandatory','isEmpty','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','includes','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','asc','list','List','contact','headers','threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','ContactId','interaction','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','ChatQueue','queueId','waitForTheAssignedQueue','Start','startRouting','EventManager','notify','files','Sequelize','ValidationError','no\x20available\x20attributes','difference','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','spread','readFileSync','utf8','offlineMessageBody','fromString','originalname','mimetype','server','attachments','basename','sequelize','transaction','Attachment','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','getSnippet','getProactiveActions','virtual','License','increment','chatLicenseExceeded','timezone','server/files/chat/iframe.ejs','replace','remote','stringify','connection','render','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','html-to-text','ioredis','jayson/promise','../../config/environment','../../errors/api','APIBadRequestError','handleError','APIConflictError','./helpers/wildcard-expressions','url','URL','redis','defaults','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update'];(function(_0x387d8f,_0x54167a){var _0x189c53=function(_0x14a9d3){while(--_0x14a9d3){_0x387d8f['push'](_0x387d8f['shift']());}};_0x189c53(++_0x54167a);}(_0x4173,0x101));var _0x3417=function(_0x3c9a89,_0x378778){_0x3c9a89=_0x3c9a89-0x0;var _0x1eb47b=_0x4173[_0x3c9a89];return _0x1eb47b;};'use strict';var Mustache=require(_0x3417('0x0'));var util=require(_0x3417('0x1'));var path=require(_0x3417('0x2'));var ejs=require(_0x3417('0x3'));var fs=require('fs');var fs_extra=require(_0x3417('0x4'));var _=require(_0x3417('0x5'));var querystring=require('querystring');var htmlToText=require(_0x3417('0x6'));var Redis=require(_0x3417('0x7'));var jayson=require(_0x3417('0x8'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x3417('0x9'));var APIBadRequestError=require(_0x3417('0xa'))[_0x3417('0xb')];var APINotFoundError=require(_0x3417('0xa'))['APINotFoundError'];var APIOutOfIntervalError=require(_0x3417('0xa'))['APIOutOfIntervalError'];var APIHandleError=require(_0x3417('0xa'))[_0x3417('0xc')];var APIConflictError=require(_0x3417('0xa'))[_0x3417('0xd')];var wildcardUtils=require(_0x3417('0xe'));var URL=require(_0x3417('0xf'))[_0x3417('0x10')];var db=require('../../mysqldb')['db'];config[_0x3417('0x11')]=_[_0x3417('0x12')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3417('0x11')]));require('./chatWebsite.socket')[_0x3417('0x13')](socket);var client=jayson[_0x3417('0x14')][_0x3417('0x15')]({'port':0x232c});var client9002=jayson[_0x3417('0x14')][_0x3417('0x15')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson['client'][_0x3417('0x15')]({'port':0x2329});function respondWithRpcPromise(_0x52cd91,_0x593a67,_0x505523,_0x59ea65){return new Promise(function(_0x5dd004,_0x2b60fc){var _0x408fdd=_0x59ea65||client;return _0x408fdd[_0x3417('0x16')](_0x52cd91,_0x505523)[_0x3417('0x17')](function(_0x4f1c93){logger[_0x3417('0x18')](_0x3417('0x19'),_0x593a67,_0x3417('0x1a'));logger[_0x3417('0x1b')](_0x3417('0x1c'),_0x593a67,_0x3417('0x1a'),JSON['stringify'](_0x4f1c93));if(_0x4f1c93[_0x3417('0x1d')]){if(_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1e')]===0x1f4){logger[_0x3417('0x1d')](_0x3417('0x19'),_0x593a67,_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1f')]);return _0x2b60fc(_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1f')]);}logger[_0x3417('0x1d')](_0x3417('0x19'),_0x593a67,_0x4f1c93[_0x3417('0x1d')][_0x3417('0x1f')]);return _0x5dd004(_0x4f1c93['error'][_0x3417('0x1f')]);}else{logger[_0x3417('0x18')](_0x3417('0x19'),_0x593a67,_0x3417('0x1a'));_0x5dd004(_0x4f1c93[_0x3417('0x20')][_0x3417('0x1f')]);}})[_0x3417('0x21')](function(_0x3b2902){logger[_0x3417('0x1d')](_0x3417('0x19'),_0x593a67,_0x3b2902);_0x2b60fc(_0x3b2902);});});}function respondWithStatusCode(_0x8ed410,_0x30219b){_0x30219b=_0x30219b||0xcc;return function(_0xec0335){if(_0xec0335){return _0x8ed410[_0x3417('0x22')](_0x30219b);}return _0x8ed410[_0x3417('0x23')](_0x30219b)[_0x3417('0x24')]();};}function respondWithResult(_0x220ef5,_0x8052e7){_0x8052e7=_0x8052e7||0xc8;return function(_0x498127){if(_0x498127){return _0x220ef5[_0x3417('0x23')](_0x8052e7)[_0x3417('0x25')](_0x498127);}};}function respondWithFilteredResult(_0x67e516,_0x427adc){return function(_0x3013ef){if(_0x3013ef){var _0x30aecb=typeof _0x427adc[_0x3417('0x26')]===_0x3417('0x27')&&typeof _0x427adc[_0x3417('0x28')]==='undefined';var _0x443d14=_0x3013ef[_0x3417('0x29')];var _0x1ab2cf=_0x30aecb?0x0:_0x427adc[_0x3417('0x26')];var _0x11509a=_0x30aecb?_0x3013ef[_0x3417('0x29')]:_0x427adc[_0x3417('0x26')]+_0x427adc['limit'];var _0x56d318;if(_0x11509a>=_0x443d14){_0x11509a=_0x443d14;_0x56d318=0xc8;}else{_0x56d318=0xce;}_0x67e516[_0x3417('0x23')](_0x56d318);return _0x67e516[_0x3417('0x2a')](_0x3417('0x2b'),_0x1ab2cf+'-'+_0x11509a+'/'+_0x443d14)['json'](_0x3013ef);}return null;};}function saveUpdates(_0x5c80dc){return function(_0x45ae82){if(_0x45ae82){return _0x45ae82[_0x3417('0x2c')](_0x5c80dc)[_0x3417('0x17')](function(_0x7d30d1){return _0x7d30d1;});}return null;};}function removeEntity(_0x1053c4){return function(_0x40a070){if(_0x40a070){return _0x40a070['destroy']()[_0x3417('0x17')](function(){var _0x167bf4=_0x40a070[_0x3417('0x2d')]({'plain':!![]});var _0x5917d8=_0x3417('0x2e');return db['UserProfileResource'][_0x3417('0x2f')]({'where':{'type':_0x5917d8,'resourceId':_0x167bf4['id']}})[_0x3417('0x17')](function(){return _0x40a070;});})['then'](function(){_0x1053c4['status'](0xcc)[_0x3417('0x24')]();});}};}function handleEntityNotFound(_0x2f7362){return function(_0x4d30d7){if(!_0x4d30d7){_0x2f7362['sendStatus'](0x194);}return _0x4d30d7;};}function handleError(_0x58ffa8,_0x4c630d){_0x4c630d=_0x4c630d||0x1f4;return function(_0x18c675){logger[_0x3417('0x1d')](_0x18c675[_0x3417('0x30')]);if(_0x18c675[_0x3417('0x31')]){delete _0x18c675[_0x3417('0x31')];}_0x58ffa8[_0x3417('0x23')](_0x4c630d)[_0x3417('0x32')](_0x18c675);};}function createInteractionObject(_0x1212c6,_0x5d4dc1,_0xe95af5,_0x1fc47b){var _0x188977=require('user-agent-parser');var _0x5ada7d=new _0x188977();var _0x55f53e=_0x5ada7d[_0x3417('0x33')](_0xe95af5[_0x3417('0x34')])[_0x3417('0x35')]();var _0x5183cc=_0x5d4dc1[_0x3417('0x36')];if(_0xe95af5[_0x3417('0x37')]){_0x5183cc=_0xe95af5[_0x3417('0x37')];}else if(_0xe95af5[_0x3417('0x38')]){_0x5183cc=_[_0x3417('0x39')](_0xe95af5[_0x3417('0x38')][_0x3417('0x3a')](','));}return{'ContactId':_0x1fc47b['id'],'ChatWebsiteId':_0x1212c6,'from':(_0x1fc47b[_0x3417('0x3b')]||'')+'\x20'+(_0x1fc47b[_0x3417('0x3c')]||''),'customerIp':_0x5183cc,'customerPort':_0xe95af5[_0x3417('0x3d')]?_0xe95af5[_0x3417('0x3d')]:null,'referer':_0x5d4dc1[_0x3417('0x3e')],'browserName':_0x55f53e[_0x3417('0x3f')]['name']&&_0x55f53e['browser'][_0x3417('0x40')]?util[_0x3417('0x41')]('%s\x20%s',_0x55f53e[_0x3417('0x3f')][_0x3417('0x31')],_0x55f53e[_0x3417('0x3f')][_0x3417('0x40')]):_0x3417('0x42'),'browserVersion':_0x55f53e[_0x3417('0x3f')][_0x3417('0x40')]||_0x3417('0x42'),'osName':util[_0x3417('0x41')](_0x3417('0x43'),_0x55f53e['os'][_0x3417('0x31')],_0x55f53e['os'][_0x3417('0x40')]),'osVersion':_0x55f53e['os'][_0x3417('0x40')],'deviceModel':_0x55f53e[_0x3417('0x44')][_0x3417('0x45')]&&_0x55f53e[_0x3417('0x44')][_0x3417('0x46')]?util[_0x3417('0x41')]('%s\x20%s\x20%s',_0x55f53e[_0x3417('0x44')]['model'],_0x55f53e[_0x3417('0x44')][_0x3417('0x46')],_0x55f53e[_0x3417('0x44')][_0x3417('0x47')]):null,'deviceVendor':_0x55f53e[_0x3417('0x44')][_0x3417('0x46')],'deviceType':_0x55f53e[_0x3417('0x44')][_0x3417('0x47')],'formData':JSON['stringify'](_0x5d4dc1)};}exports[_0x3417('0x48')]=function(_0x575d23,_0x13f543){var _0x36338e={'include':[{'model':db[_0x3417('0x49')],'as':_0x3417('0x4a')}]},_0x678393={},_0x551f22={'count':0x0,'rows':[]};var _0x53c102=_[_0x3417('0x4b')](db[_0x3417('0x4c')][_0x3417('0x4d')],function(_0x399db9){return{'name':_0x399db9[_0x3417('0x4e')],'type':_0x399db9[_0x3417('0x47')][_0x3417('0x4f')]};});_0x678393['model']=_[_0x3417('0x4b')](_0x53c102,_0x3417('0x31'));_0x678393[_0x3417('0x50')]=_[_0x3417('0x51')](_0x575d23['query']);_0x678393[_0x3417('0x52')]=_[_0x3417('0x53')](_0x678393[_0x3417('0x45')],_0x678393[_0x3417('0x50')]);_0x36338e[_0x3417('0x54')]=_[_0x3417('0x53')](_0x678393[_0x3417('0x45')],qs['fields'](_0x575d23['query'][_0x3417('0x55')]));_0x36338e[_0x3417('0x54')]=_0x36338e[_0x3417('0x54')]['length']?_0x36338e['attributes']:_0x678393[_0x3417('0x45')];if(!_0x575d23[_0x3417('0x50')][_0x3417('0x56')]('nolimit')){_0x36338e[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x575d23[_0x3417('0x50')]['limit']);_0x36338e[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x575d23['query'][_0x3417('0x26')]);}_0x36338e[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x575d23[_0x3417('0x50')]['sort']);_0x36338e[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x575d23[_0x3417('0x50')],_0x678393[_0x3417('0x52')]),_0x53c102);if(_0x575d23[_0x3417('0x50')][_0x3417('0x5b')]){_0x36338e[_0x3417('0x59')]=_['merge'](_0x36338e[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0x53c102,function(_0x591d05){if(_0x591d05[_0x3417('0x47')]!==_0x3417('0x5c')){var _0x32021a={};_0x32021a[_0x591d05['name']]={'$like':'%'+_0x575d23[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x32021a;}})});}_0x36338e=_[_0x3417('0x5d')]({},_0x36338e,_0x575d23[_0x3417('0x5e')]);var _0x542b4b={'where':_0x36338e[_0x3417('0x59')]};return db['ChatWebsite'][_0x3417('0x29')](_0x542b4b)[_0x3417('0x17')](function(_0x639b2e){_0x551f22[_0x3417('0x29')]=_0x639b2e;if(_0x575d23[_0x3417('0x50')]['includeAll']){_0x36338e['include']=[{'all':!![]}];}return db['ChatWebsite'][_0x3417('0x5f')](_0x36338e);})[_0x3417('0x17')](function(_0x57026f){_0x551f22[_0x3417('0x60')]=_0x57026f;return _0x551f22;})[_0x3417('0x17')](respondWithFilteredResult(_0x13f543,_0x36338e))[_0x3417('0x21')](handleError(_0x13f543,null));};exports['show']=function(_0x1f6924,_0x2a3170){var _0x3c2cd5={'raw':![],'where':{'id':_0x1f6924['params']['id']},'include':[{'model':db[_0x3417('0x49')],'as':_0x3417('0x4a')}]},_0x281134={};_0x281134[_0x3417('0x45')]=_[_0x3417('0x51')](db['ChatWebsite'][_0x3417('0x4d')]);_0x281134['query']=_[_0x3417('0x51')](_0x1f6924[_0x3417('0x50')]);_0x281134[_0x3417('0x52')]=_[_0x3417('0x53')](_0x281134[_0x3417('0x45')],_0x281134[_0x3417('0x50')]);_0x3c2cd5[_0x3417('0x54')]=_['intersection'](_0x281134[_0x3417('0x45')],qs['fields'](_0x1f6924[_0x3417('0x50')][_0x3417('0x55')]));_0x3c2cd5[_0x3417('0x54')]=_0x3c2cd5[_0x3417('0x54')][_0x3417('0x61')]?_0x3c2cd5[_0x3417('0x54')]:_0x281134[_0x3417('0x45')];if(_0x1f6924['query'][_0x3417('0x62')]){_0x3c2cd5[_0x3417('0x63')]=[{'all':!![]}];}_0x3c2cd5=_[_0x3417('0x5d')]({},_0x3c2cd5,_0x1f6924[_0x3417('0x5e')]);return db['ChatWebsite'][_0x3417('0x64')](_0x3c2cd5)['then'](handleEntityNotFound(_0x2a3170,null))['then'](respondWithResult(_0x2a3170,null))[_0x3417('0x21')](handleError(_0x2a3170,null));};exports[_0x3417('0x65')]=function(_0x30d5ef,_0x3ad105){if(!wildcardUtils['testWildcardValidity'](_0x30d5ef[_0x3417('0x66')][_0x3417('0x67')])){return handleError(_0x3ad105,null)(new APIBadRequestError('\x22'+_0x30d5ef[_0x3417('0x66')]['address']+_0x3417('0x68')));}return db[_0x3417('0x4c')][_0x3417('0x65')](_0x30d5ef[_0x3417('0x66')],{})[_0x3417('0x17')](function(_0x1e2582){var _0x2892b8=_0x30d5ef['user'][_0x3417('0x2d')]({'plain':!![]});if(!_0x2892b8)throw new Error(_0x3417('0x69'));if(_0x2892b8[_0x3417('0x6a')]===_0x3417('0x6b')){var _0xaa1b62=_0x1e2582[_0x3417('0x2d')]({'plain':!![]});var _0x24eba6=_0x3417('0x2e');return db[_0x3417('0x6c')][_0x3417('0x64')]({'where':{'name':_0x24eba6,'userProfileId':_0x2892b8['userProfileId']},'raw':!![]})[_0x3417('0x17')](function(_0x5a42ea){if(_0x5a42ea&&_0x5a42ea[_0x3417('0x6d')]===0x0){return db[_0x3417('0x6e')][_0x3417('0x65')]({'name':_0xaa1b62[_0x3417('0x31')],'resourceId':_0xaa1b62['id'],'type':_0x5a42ea[_0x3417('0x31')],'sectionId':_0x5a42ea['id']},{})[_0x3417('0x17')](function(){return _0x1e2582;});}else{return _0x1e2582;}})[_0x3417('0x21')](function(_0x76925a){logger[_0x3417('0x1d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x76925a);throw _0x76925a;});}return _0x1e2582;})[_0x3417('0x17')](respondWithResult(_0x3ad105,0xc9))['catch'](handleError(_0x3ad105,null));};exports[_0x3417('0x2c')]=function(_0x386f32,_0x52ee89){if(!wildcardUtils[_0x3417('0x6f')](_0x386f32[_0x3417('0x66')][_0x3417('0x67')])){return handleError(_0x52ee89,null)(new APIBadRequestError('\x22'+_0x386f32[_0x3417('0x66')][_0x3417('0x67')]+_0x3417('0x68')));}if(_0x386f32['body']['id']){delete _0x386f32[_0x3417('0x66')]['id'];}return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x386f32[_0x3417('0x70')]['id']},'include':[{'model':db[_0x3417('0x49')],'as':'mandatoryDispositionPause'}]})[_0x3417('0x17')](handleEntityNotFound(_0x52ee89,null))[_0x3417('0x17')](saveUpdates(_0x386f32[_0x3417('0x66')],null))[_0x3417('0x17')](respondWithResult(_0x52ee89,null))['catch'](handleError(_0x52ee89,null));};exports[_0x3417('0x2f')]=function(_0x2be3c7,_0xdd055c){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x2be3c7[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0xdd055c,null))[_0x3417('0x17')](removeEntity(_0xdd055c,null))['catch'](handleError(_0xdd055c,null));};exports[_0x3417('0x71')]=function(_0x14febb,_0x1c1013){return db[_0x3417('0x4c')]['describe']()[_0x3417('0x17')](respondWithResult(_0x1c1013,null))['catch'](handleError(_0x1c1013,null));};exports['addDisposition']=function(_0x13b7c6,_0x3b5c5d){if(_0x13b7c6[_0x3417('0x66')]['id']){delete _0x13b7c6[_0x3417('0x66')]['id'];}return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x13b7c6[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x3b5c5d,null))[_0x3417('0x17')](function(_0x3a9d1c){if(_0x3a9d1c){_0x13b7c6[_0x3417('0x66')][_0x3417('0x72')]=_0x3a9d1c['id'];return db[_0x3417('0x73')][_0x3417('0x65')](_0x13b7c6[_0x3417('0x66')]);}})[_0x3417('0x17')](respondWithResult(_0x3b5c5d,null))['catch'](handleError(_0x3b5c5d,null));};exports[_0x3417('0x74')]=function(_0x1d990d,_0x1ad84a){var _0x5b7e25={'raw':![],'where':{}};var _0x3b9d56={};var _0x20bdca={'count':0x0,'rows':[]};return db[_0x3417('0x4c')][_0x3417('0x75')]({'where':{'id':_0x1d990d['params']['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x1ad84a,null))[_0x3417('0x17')](function(_0x386020){if(_0x386020){_0x3b9d56[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0x73')][_0x3417('0x4d')]);_0x3b9d56['query']=_[_0x3417('0x51')](_0x1d990d[_0x3417('0x50')]);_0x3b9d56[_0x3417('0x52')]=_[_0x3417('0x53')](_0x3b9d56[_0x3417('0x45')],_0x3b9d56[_0x3417('0x50')]);_0x5b7e25[_0x3417('0x54')]=_['intersection'](_0x3b9d56['model'],qs[_0x3417('0x55')](_0x1d990d['query'][_0x3417('0x55')]));_0x5b7e25[_0x3417('0x54')]=_0x5b7e25[_0x3417('0x54')][_0x3417('0x61')]?_0x5b7e25['attributes']:_0x3b9d56[_0x3417('0x45')];if(!_0x1d990d[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x5b7e25[_0x3417('0x28')]=qs['limit'](_0x1d990d['query']['limit']);_0x5b7e25['offset']=qs[_0x3417('0x26')](_0x1d990d[_0x3417('0x50')]['offset']);}_0x5b7e25[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x1d990d[_0x3417('0x50')]['sort']);_0x5b7e25[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x1d990d[_0x3417('0x50')],_0x3b9d56['filters']));_0x5b7e25[_0x3417('0x59')][_0x3417('0x72')]=_0x386020['id'];if(_0x1d990d[_0x3417('0x50')][_0x3417('0x5b')]){_0x5b7e25[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x5b7e25['where'],{'$or':_['map'](_0x5b7e25[_0x3417('0x54')],function(_0xd581b3){var _0x521c78={};_0x521c78[_0xd581b3]={'$like':'%'+_0x1d990d['query'][_0x3417('0x5b')]+'%'};return _0x521c78;})});}_0x5b7e25=_[_0x3417('0x5d')]({},_0x5b7e25,_0x1d990d[_0x3417('0x5e')]);return db[_0x3417('0x73')][_0x3417('0x29')]({'where':_0x5b7e25[_0x3417('0x59')]})[_0x3417('0x17')](function(_0x302685){_0x20bdca[_0x3417('0x29')]=_0x302685;if(_0x1d990d[_0x3417('0x50')][_0x3417('0x62')]){_0x5b7e25[_0x3417('0x63')]=[{'all':!![]}];}return db['Disposition'][_0x3417('0x5f')](_0x5b7e25);})[_0x3417('0x17')](function(_0x1a205b){_0x20bdca['rows']=_0x1a205b;return _0x20bdca;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x1ad84a,_0x5b7e25))[_0x3417('0x21')](handleError(_0x1ad84a,null));};exports[_0x3417('0x77')]=function(_0x2c2c37,_0x1b9b07){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x2c2c37[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x1b9b07,null))[_0x3417('0x17')](function(_0x19370d){if(_0x19370d){return _0x19370d[_0x3417('0x77')](_0x2c2c37[_0x3417('0x50')][_0x3417('0x78')]);}})['then'](respondWithStatusCode(_0x1b9b07,null))[_0x3417('0x21')](handleError(_0x1b9b07,null));};exports[_0x3417('0x79')]=function(_0x1b5c11,_0x48d0c5){if(_0x1b5c11['body']['id']){delete _0x1b5c11['body']['id'];}return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x1b5c11[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x48d0c5,null))['then'](function(_0x4cab53){if(_0x4cab53){_0x1b5c11[_0x3417('0x66')]['ChatWebsiteId']=_0x4cab53['id'];return db['CannedAnswer'][_0x3417('0x65')](_0x1b5c11['body']);}})[_0x3417('0x17')](respondWithResult(_0x48d0c5,null))[_0x3417('0x21')](handleError(_0x48d0c5,null));};exports[_0x3417('0x7a')]=function(_0x20aa81,_0x44e305){var _0x2d4b18={'raw':![],'where':{}};var _0x17e655={};var _0x15836c={'count':0x0,'rows':[]};return db[_0x3417('0x4c')]['findOne']({'where':{'id':_0x20aa81[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x44e305,null))[_0x3417('0x17')](function(_0x26d8f7){if(_0x26d8f7){_0x17e655['model']=_[_0x3417('0x51')](db[_0x3417('0x7b')]['rawAttributes']);_0x17e655[_0x3417('0x50')]=_['keys'](_0x20aa81[_0x3417('0x50')]);_0x17e655['filters']=_[_0x3417('0x53')](_0x17e655['model'],_0x17e655[_0x3417('0x50')]);_0x2d4b18[_0x3417('0x54')]=_[_0x3417('0x53')](_0x17e655['model'],qs[_0x3417('0x55')](_0x20aa81['query'][_0x3417('0x55')]));_0x2d4b18[_0x3417('0x54')]=_0x2d4b18[_0x3417('0x54')][_0x3417('0x61')]?_0x2d4b18[_0x3417('0x54')]:_0x17e655[_0x3417('0x45')];if(!_0x20aa81[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x2d4b18[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x20aa81['query'][_0x3417('0x28')]);_0x2d4b18['offset']=qs[_0x3417('0x26')](_0x20aa81['query'][_0x3417('0x26')]);}_0x2d4b18[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x20aa81['query']['sort']);_0x2d4b18['where']=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x20aa81[_0x3417('0x50')],_0x17e655['filters']));_0x2d4b18['where'][_0x3417('0x72')]=_0x26d8f7['id'];if(_0x20aa81['query'][_0x3417('0x5b')]){_0x2d4b18[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x2d4b18[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0x2d4b18['attributes'],function(_0x5030a6){var _0x74c1d1={};_0x74c1d1[_0x5030a6]={'$like':'%'+_0x20aa81[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x74c1d1;})});}_0x2d4b18=_[_0x3417('0x5d')]({},_0x2d4b18,_0x20aa81[_0x3417('0x5e')]);return db[_0x3417('0x7b')][_0x3417('0x29')]({'where':_0x2d4b18[_0x3417('0x59')]})[_0x3417('0x17')](function(_0x4f1916){_0x15836c[_0x3417('0x29')]=_0x4f1916;if(_0x20aa81[_0x3417('0x50')][_0x3417('0x62')]){_0x2d4b18[_0x3417('0x63')]=[{'all':!![]}];}return db[_0x3417('0x7b')][_0x3417('0x5f')](_0x2d4b18);})['then'](function(_0x5a7e63){_0x15836c[_0x3417('0x60')]=_0x5a7e63;return _0x15836c;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x44e305,_0x2d4b18))[_0x3417('0x21')](handleError(_0x44e305,null));};exports[_0x3417('0x7c')]=function(_0x357092,_0x28847f){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x357092[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x28847f,null))['then'](function(_0x3ee990){if(_0x3ee990){return _0x3ee990[_0x3417('0x7c')](_0x357092[_0x3417('0x50')][_0x3417('0x78')]);}})[_0x3417('0x17')](respondWithStatusCode(_0x28847f,null))['catch'](handleError(_0x28847f,null));};exports[_0x3417('0x7d')]=function(_0x44dd64,_0x32cdc4){_0x44dd64[_0x3417('0x66')][_0x3417('0x7e')]=_0x44dd64[_0x3417('0x7f')][_0x3417('0x80')];return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x44dd64[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x32cdc4,null))[_0x3417('0x17')](saveUpdates(_0x44dd64[_0x3417('0x66')],null))[_0x3417('0x17')](respondWithResult(_0x32cdc4,null))['catch'](handleError(_0x32cdc4,null));};exports['addAvatar']=function(_0x548c3a,_0x3d87d2){_0x548c3a[_0x3417('0x66')][_0x3417('0x81')]=_0x548c3a[_0x3417('0x7f')][_0x3417('0x80')];return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x548c3a[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x3d87d2,null))['then'](saveUpdates(_0x548c3a[_0x3417('0x66')],null))[_0x3417('0x17')](respondWithResult(_0x3d87d2,null))[_0x3417('0x21')](handleError(_0x3d87d2,null));};exports[_0x3417('0x82')]=function(_0x1d847f,_0x226e0d){_0x1d847f['body']['customerAvatar']=_0x1d847f[_0x3417('0x7f')][_0x3417('0x80')];return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x1d847f[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x226e0d,null))[_0x3417('0x17')](saveUpdates(_0x1d847f['body'],null))['then'](respondWithResult(_0x226e0d,null))['catch'](handleError(_0x226e0d,null));};exports[_0x3417('0x83')]=function(_0x3e70e9,_0xbac790){_0x3e70e9[_0x3417('0x66')][_0x3417('0x84')]=_0x3e70e9[_0x3417('0x7f')][_0x3417('0x80')];return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x3e70e9[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0xbac790,null))[_0x3417('0x17')](saveUpdates(_0x3e70e9['body'],null))[_0x3417('0x17')](respondWithResult(_0xbac790,null))[_0x3417('0x21')](handleError(_0xbac790,null));};exports[_0x3417('0x85')]=function(_0x2b2a28,_0x36e936){var _0x4dd3d8=path[_0x3417('0x86')](config['root'],'server/files/images/logos/default_logo.svg');var _0x4dcca1={'where':{'id':_0x2b2a28[_0x3417('0x70')]['id']},'attributes':['id',_0x3417('0x7e')],'raw':!![]};var _0x38be10=![];return require(_0x3417('0x87'))[_0x3417('0x88')]()['then'](function(_0x356073){if(_0x356073){_0x38be10=_0x356073[_0x3417('0x89')];}})[_0x3417('0x17')](function(){return db[_0x3417('0x4c')][_0x3417('0x64')](_0x4dcca1);})[_0x3417('0x17')](handleEntityNotFound(_0x36e936,null))[_0x3417('0x17')](function(_0x37dca2){if(_0x37dca2){if(!_[_0x3417('0x8a')](_0x37dca2[_0x3417('0x7e')])){if(fs[_0x3417('0x8b')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x8d'),_0x37dca2[_0x3417('0x7e')]))&&_0x38be10){_0x4dd3d8=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x8d'),_0x37dca2[_0x3417('0x7e')]);}}return _0x36e936[_0x3417('0x8e')](_0x4dd3d8);}})[_0x3417('0x21')](handleError(_0x36e936,null));};exports[_0x3417('0x8f')]=function(_0x2940c1,_0x3bd900){var _0x993fa7=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x90'));var _0x491b4c={'where':{'id':_0x2940c1[_0x3417('0x70')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x3417('0x4c')][_0x3417('0x64')](_0x491b4c)['then'](handleEntityNotFound(_0x3bd900,null))['then'](function(_0x58e45d){if(_0x58e45d){if(!_[_0x3417('0x8a')](_0x58e45d[_0x3417('0x81')])){if(fs[_0x3417('0x8b')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x58e45d['agentAvatar']))){_0x993fa7=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x58e45d[_0x3417('0x81')]);}}return _0x3bd900[_0x3417('0x8e')](_0x993fa7);}})[_0x3417('0x21')](handleError(_0x3bd900,null));};exports[_0x3417('0x92')]=function(_0x278ac6,_0x57a96d){var _0x59ed34=path[_0x3417('0x86')](config[_0x3417('0x8c')],'server/files/images/avatars/customer_avatar.png');var _0x37845d={'where':{'id':_0x278ac6[_0x3417('0x70')]['id']},'attributes':['id',_0x3417('0x93'),'showCustomerAvatar'],'raw':!![]};return db[_0x3417('0x4c')][_0x3417('0x64')](_0x37845d)[_0x3417('0x17')](handleEntityNotFound(_0x57a96d,null))[_0x3417('0x17')](function(_0x469529){if(_0x469529){if(!_[_0x3417('0x8a')](_0x469529[_0x3417('0x93')])){if(fs[_0x3417('0x8b')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x469529['customerAvatar']))&&_0x469529[_0x3417('0x94')]){_0x59ed34=path[_0x3417('0x86')](config['root'],_0x3417('0x91'),_0x469529[_0x3417('0x93')]);}}return _0x57a96d[_0x3417('0x8e')](_0x59ed34);}})['catch'](handleError(_0x57a96d,null));};exports[_0x3417('0x95')]=function(_0x4c3eec,_0x1aa3cd){var _0xbcd2de=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x96'));var _0x4eefe1={'where':{'id':_0x4c3eec[_0x3417('0x70')]['id']},'attributes':['id',_0x3417('0x84')],'raw':!![]};return db[_0x3417('0x4c')][_0x3417('0x64')](_0x4eefe1)[_0x3417('0x17')](handleEntityNotFound(_0x1aa3cd,null))[_0x3417('0x17')](function(_0x492b27){if(_0x492b27){if(!_[_0x3417('0x8a')](_0x492b27['systemAvatar'])){if(fs[_0x3417('0x8b')](path['join'](config[_0x3417('0x8c')],_0x3417('0x91'),_0x492b27['systemAvatar']))){_0xbcd2de=path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x91'),_0x492b27[_0x3417('0x84')]);}}return _0x1aa3cd[_0x3417('0x8e')](_0xbcd2de);}})[_0x3417('0x21')](handleError(_0x1aa3cd,null));};function checkWebsiteInterval(_0x3c615d){var _0x1ef61=_0x3c615d[_0x3417('0x97')];if(!_0x1ef61){return Promise['resolve'](_0x3c615d);}var _0x2157e2=_0x3c615d['timezone']||undefined;return _0x1ef61[_0x3417('0x98')](_0x2157e2)[_0x3417('0x17')](function(_0x543846){if(!_0x543846){throw new APIOutOfIntervalError();}return _0x3c615d;});}exports['notify']=function(_0x1ae5d7,_0x18f3ad){var _0x1bc3c2={'body':_0x1ae5d7[_0x3417('0x66')],'channel':'chat'};var _0xbb8c34=[];var _0x249c53=[];var _0x314f6f={};var _0x4bd9a6=![];if(_0x1ae5d7[_0x3417('0x66')]['id']){delete _0x1ae5d7[_0x3417('0x66')]['id'];}if(_[_0x3417('0x8a')](_0x1ae5d7[_0x3417('0x66')]['from'])){throw new APIBadRequestError('From\x20is\x20mandatory');}if(_[_0x3417('0x8a')](_0x1ae5d7[_0x3417('0x66')][_0x3417('0x99')])){throw new APIBadRequestError(_0x3417('0x9a'));}if(_[_0x3417('0x9b')](_0x1ae5d7[_0x3417('0x66')][_0x3417('0x66')])){throw new APIBadRequestError('Body\x20is\x20mandatory');}var _0x48a1ba=_0x1ae5d7[_0x3417('0x66')]['customerIp']&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0x3e')];return db['CmContact'][_0x3417('0x71')]()['then'](function(_0x4c37f5){if(!_0x4c37f5){throw new Error(_0x3417('0x9c'));}_0xbb8c34=Object[_0x3417('0x51')](_0x4c37f5)[_0x3417('0x5b')](function(_0x5bf874){return![_0x3417('0x9d'),_0x3417('0x9e')]['includes'](_0x5bf874);});_0x249c53=Object['keys'](_0x4c37f5)[_0x3417('0x5b')](function(_0x4c29dd){return!['createdAt',_0x3417('0x9e'),_0x3417('0x9f'),_0x3417('0xa0')][_0x3417('0xa1')](_0x4c29dd);});if(!_['includes'](_0x249c53,_0x1ae5d7[_0x3417('0x66')][_0x3417('0x99')])){throw new APIBadRequestError('Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20'+_0x249c53['join'](',\x20'));}_0x314f6f[_0x1ae5d7[_0x3417('0x66')][_0x3417('0x99')]]=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xa2')];})[_0x3417('0x17')](function(){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x1ae5d7[_0x3417('0x70')]['id']},'include':[{'model':db[_0x3417('0xa3')],'as':'List','include':[{'model':db[_0x3417('0xa4')],'as':_0x3417('0xa5'),'where':_0x314f6f,'limit':0x1,'order':[[_0x3417('0x9e'),_0x3417('0xa6')]]}]},{'model':db[_0x3417('0xa7')],'as':_0x3417('0xa8')},{'model':db[_0x3417('0x97')],'as':'Interval','include':[{'model':db[_0x3417('0x97')],'as':_0x3417('0xa9'),'attributes':['id',_0x3417('0xaa')],'raw':!![]}]}]});})[_0x3417('0x17')](function(_0x5a953d){if(!_0x5a953d){throw new APINotFoundError(util[_0x3417('0x41')](_0x3417('0xab'),_0x1ae5d7[_0x3417('0x70')]['id']));}if(_0x48a1ba){return checkWebsiteInterval(_0x5a953d);}return _0x5a953d;})[_0x3417('0x17')](function(_0x2e098f){_0x1bc3c2[_0x3417('0xac')]=_0x2e098f;_0x1bc3c2[_0x3417('0xad')]=_[_0x3417('0xae')](_0x2e098f[_0x3417('0xa8')],['priority'],[_0x3417('0xaf')]);if(_0x1bc3c2[_0x3417('0xac')]['Applications']){delete _0x1bc3c2[_0x3417('0xac')][_0x3417('0xa8')];}_0x1bc3c2[_0x3417('0xb0')]=_0x2e098f[_0x3417('0xb1')]||{'id':_0x2e098f[_0x3417('0xa0')]};if(_0x1bc3c2[_0x3417('0xb0')]&&_0x1bc3c2['list'][_0x3417('0xa5')][_0x3417('0x61')]){return _0x1bc3c2[_0x3417('0xb0')][_0x3417('0xa5')][0x0];}var _0x5c621e=_[_0x3417('0x12')](_0x1ae5d7[_0x3417('0x66')],{'firstName':_0x1ae5d7[_0x3417('0x66')]['from'],'ListId':_0x2e098f[_0x3417('0xa0')]});_0x5c621e[_0x1ae5d7[_0x3417('0x66')]['mapKey']]=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xa2')];return db[_0x3417('0xa4')][_0x3417('0x65')](_0x5c621e,{'fields':_0xbb8c34,'raw':!![]});})[_0x3417('0x17')](function(_0x1ece3d){_0x1bc3c2[_0x3417('0xb2')]=_0x1ece3d;var _0x2232b1=createInteractionObject(_0x1ae5d7[_0x3417('0x70')]['id'],_0x1ae5d7[_0x3417('0x66')],_0x1ae5d7[_0x3417('0xb3')],_0x1ece3d);var _0x16c61d={'ChatWebsiteId':_0x1ae5d7[_0x3417('0x70')]['id']};if(_0x1ae5d7[_0x3417('0x66')]['threadId']){_0x16c61d[_0x3417('0xb4')]=_0x1ae5d7['body'][_0x3417('0xb4')];_0x16c61d[_0x3417('0xb5')]=![];return db[_0x3417('0xb6')][_0x3417('0x64')]({'where':_0x16c61d})[_0x3417('0x17')](function(_0x1233b1){if(_0x1233b1){_0x4bd9a6=!![];return _0x1233b1;}else if(!_0x48a1ba&&_0x1233b1&&_0x1233b1[_0x3417('0xb5')]){throw new APIConflictError(_0x3417('0xb7'));}_0x2232b1[_0x3417('0xb4')]=_0x1ae5d7[_0x3417('0x66')]['threadId'];_0x2232b1['externalUrl']=_0x1ae5d7[_0x3417('0x66')]['externalUrl'];return db[_0x3417('0xb6')]['create'](_0x2232b1);});}_0x16c61d[_0x3417('0xb8')]=_0x1ece3d['id'];if(_0x1ae5d7[_0x3417('0x66')]['interaction']&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb9')]['id']){_0x16c61d['id']=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb9')]['id'];return db[_0x3417('0xb6')][_0x3417('0x64')]({'where':_0x16c61d})['then'](function(_0x3ab6fb){var _0x4ebf0a=_0x1ae5d7[_0x3417('0x66')]['customerIp']&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0x3e')];if(!_0x4ebf0a&&_0x3ab6fb&&_0x3ab6fb[_0x3417('0xb5')]){throw new APIConflictError(_0x3417('0xb7'));}else if(_0x3ab6fb){_0x4bd9a6=!![];return _0x3ab6fb;}else{return db['ChatInteraction'][_0x3417('0x65')](_0x2232b1);}});}return db['ChatInteraction'][_0x3417('0x65')](_0x2232b1);})['then'](function(_0x3a6c45){if(!_0x4bd9a6){return _0x3a6c45;}var _0x2a144f={'from':(_0x1bc3c2[_0x3417('0xb2')]['firstName']||'')+'\x20'+(_0x1bc3c2[_0x3417('0xb2')][_0x3417('0x3c')]||'')};if(_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb4')]&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0xba')]&&_0x1ae5d7[_0x3417('0x66')][_0x3417('0xb4')]!=_0x1ae5d7[_0x3417('0x66')]['messageId']){_0x2a144f['threadId']=_0x1ae5d7[_0x3417('0x66')][_0x3417('0xba')];}return _0x3a6c45[_0x3417('0x2c')](_0x2a144f);})[_0x3417('0x17')](function(_0x38e149){_0x1bc3c2[_0x3417('0xb9')]=_0x38e149[_0x3417('0x2d')]({'plain':!![]});_0x1bc3c2['interaction'][_0x3417('0xbb')]=!_0x4bd9a6;if(_0x1bc3c2[_0x3417('0xb9')]['created']){if(_0x1bc3c2[_0x3417('0xac')][_0x3417('0xbc')]){_0x1bc3c2[_0x3417('0xad')][_0x3417('0xbd')]({'id':0x0,'priority':_0x1bc3c2['applications'][_0x3417('0x61')]+0x1,'app':_0x3417('0xbe'),'appdata':'unmanaged','interval':_0x3417('0xbf')});}}return db[_0x3417('0xc0')][_0x3417('0x65')]({'body':_0x1ae5d7[_0x3417('0x66')]['body'],'ChatWebsiteId':_0x1ae5d7[_0x3417('0x70')]['id'],'ChatInteractionId':_0x38e149['id'],'direction':'in','ContactId':_0x1bc3c2[_0x3417('0xb2')]['id'],'AttachmentId':_0x1ae5d7[_0x3417('0x66')][_0x3417('0xc1')]});})['then'](function(_0x3f68c6){_0x1bc3c2[_0x3417('0x1f')]=_0x3f68c6;if(!_0x1bc3c2[_0x3417('0xb9')][_0x3417('0xc2')]){return;}return db[_0x3417('0xc3')][_0x3417('0x64')]({'attributes':['id',_0x3417('0x31')],'where':{'id':_0x1bc3c2[_0x3417('0xb9')][_0x3417('0xc2')]}});})['then'](function(_0x401ccb){if(_0x401ccb){_0x1bc3c2[_0x3417('0xad')][_0x3417('0xc4')]({'id':0x0,'priority':0x0,'app':_0x3417('0xc5'),'appdata':_0x401ccb[_0x3417('0x31')]+','+(_0x1bc3c2[_0x3417('0xac')][_0x3417('0xc6')]||0xa),'interval':_0x3417('0xbf')});_0x1bc3c2[_0x3417('0xc7')]=!![];}if(!_0x1bc3c2['interaction']['queueId']){return;}return db[_0x3417('0xc8')][_0x3417('0x64')]({'attributes':['id',_0x3417('0x31')],'where':{'id':_0x1bc3c2[_0x3417('0xb9')][_0x3417('0xc9')]}});})[_0x3417('0x17')](function(_0x42cf7e){if(_0x42cf7e){_0x1bc3c2[_0x3417('0xad')]['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x42cf7e[_0x3417('0x31')]+','+(_0x1bc3c2[_0x3417('0xac')][_0x3417('0xca')]||0x12c),'interval':_0x3417('0xbf')});}return respondWithRpcPromise(_0x3417('0xcb'),_0x3417('0xcc'),_0x1bc3c2);})['then'](function(_0x434d24){respondWithRpcPromise('EventManager',_0x3417('0xcd'),{'event':_0x3417('0xce'),'message':_0x434d24},client9002);return _0x434d24;})[_0x3417('0x17')](respondWithResult(_0x18f3ad,null))[_0x3417('0x21')](APIHandleError(_0x18f3ad));};exports['offline']=function(_0x19834a,_0x3e5a38){var _0x388d8b,_0x378e1d,_0xaf54b8;var _0x3b2d64=[];var _0x4da1c5={};var _0x39b32f=_0x19834a[_0x3417('0xcf')]||[];var _0xc27193=[];var _0x12e05a;return db['CmContact'][_0x3417('0x71')]()['then'](function(_0x297b47){if(!_0x297b47){throw new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd2'));}_0x3b2d64=_[_0x3417('0xd3')](_[_0x3417('0x51')](_0x297b47),['createdAt','updatedAt','CompanyId',_0x3417('0xa0')]);if(_0x19834a[_0x3417('0x66')]['id']){delete _0x19834a[_0x3417('0x66')]['id'];}if(_['isNil'](_0x19834a[_0x3417('0x66')][_0x3417('0xa2')])){throw _0x3e5a38[_0x3417('0x23')](0x1f4)[_0x3417('0x32')](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd4')));}if(_[_0x3417('0x8a')](_0x19834a[_0x3417('0x66')][_0x3417('0x66')])||_0x19834a['body'][_0x3417('0x66')]===''){throw _0x3e5a38[_0x3417('0x23')](0x1f4)['send'](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd5')));}if(_['isNil'](_0x19834a[_0x3417('0x66')]['mapKeyOffline'])){throw _0x3e5a38[_0x3417('0x23')](0x1f4)['send'](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))](_0x3417('0xd6')+_0x3b2d64));}if(!_[_0x3417('0xa1')](_0x3b2d64,_0x19834a[_0x3417('0x66')]['mapKeyOffline'])){throw _0x3e5a38[_0x3417('0x23')](0x1f4)[_0x3417('0x32')](new db[(_0x3417('0xd0'))][(_0x3417('0xd1'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3b2d64));}_0x4da1c5[_0x19834a[_0x3417('0x66')][_0x3417('0xd7')]]=_0x19834a[_0x3417('0x66')][_0x3417('0xa2')];})[_0x3417('0x17')](function(){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x19834a[_0x3417('0x70')]['id']},'include':[{'model':db[_0x3417('0xa3')],'as':_0x3417('0xb1')},{'model':db[_0x3417('0xd8')],'as':_0x3417('0xd8')}]});})['then'](handleEntityNotFound(_0x3e5a38,null))['then'](function(_0x4a154b){if(_0x4a154b&&_0x4a154b['List']){_0x378e1d=_0x4a154b;var _0x142225=_[_0x3417('0x12')](_0x19834a[_0x3417('0x66')],{'firstName':_0x19834a[_0x3417('0x66')][_0x3417('0xa2')],'phone':_0x19834a[_0x3417('0x66')][_0x3417('0xa2')],'ListId':_0x4a154b['ListId']});_0x142225[_0x19834a[_0x3417('0x66')]['mapKeyOffline']]=_0x19834a[_0x3417('0x66')][_0x3417('0xa2')];return db[_0x3417('0xa4')]['findOrCreate']({'where':_0x4da1c5,'defaults':_0x142225});}})[_0x3417('0xd9')](function(_0x5cb569){if(_0x5cb569){_0xaf54b8=_0x5cb569;var _0x186960=fs[_0x3417('0xda')](path[_0x3417('0x86')](config['root'],'server/files/templates/chatOfflineMessage.ejs'),_0x3417('0xdb'));var _0x2fc255=ejs['render'](_0x186960,{'body':_['toPairs'](_0x19834a[_0x3417('0x66')]['body']),'bodyTitle':_0x378e1d[_0x3417('0xdc')]});return db['ChatOfflineMessage']['create']({'body':_0x2fc255,'plainBody':htmlToText[_0x3417('0xdd')](_0x2fc255),'ContactId':_0x5cb569['id'],'ChatWebsiteId':_0x378e1d['id']});}})[_0x3417('0x17')](function(_0xa3aa2a){_0x12e05a=_0xa3aa2a;if(_0x39b32f[_0x3417('0x61')]){var _0x49b8a6=_0x39b32f[_0x3417('0x4b')](function(_0x4895eb){return{'name':_0x4895eb[_0x3417('0xde')],'basename':_0x4895eb[_0x3417('0x80')],'type':_0x4895eb[_0x3417('0xdf')],'ChatOfflineMessageId':_0xa3aa2a['id']};});_0xc27193=_0x49b8a6[_0x3417('0x4b')](_0x5018d8=>{var _0x247300={'filename':_0x5018d8[_0x3417('0x31')],'path':path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0xe0'),_0x3417('0xcf'),_0x3417('0xe1'),'offline-chat',_0x5018d8[_0x3417('0xe2')])};return _0x247300;});if(!_0x378e1d['openNewInteraction']){return db[_0x3417('0xe3')][_0x3417('0xe4')](function(_0x207f61){return db[_0x3417('0xe5')][_0x3417('0xe6')](_0x49b8a6,{'transaction':_0x207f61});});}}})[_0x3417('0x17')](function(){if(_0x12e05a){_0x388d8b=_0x12e05a;return db[_0x3417('0xd8')][_0x3417('0x75')]({'where':{'service':!![]},'include':[{'model':db[_0x3417('0xe7')],'as':_0x3417('0xe8'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x3417('0xe9'),'raw':!![]}]}]});}})['then'](function(_0x40c991){if(_0x40c991&&_0x40c991[_0x3417('0xe8')]&&_0x378e1d[_0x3417('0xea')]&&_0x378e1d['forwardOfflineAddress']){var _0x1b97c0=_0x40c991[_0x3417('0xeb')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x1b97c0,'message':{'from':util[_0x3417('0x41')]('\x22%s\x22\x20<%s>',_0x40c991['name'],_0x40c991['email']||_0x40c991[_0x3417('0xe8')][_0x3417('0x6b')]),'to':_0x378e1d[_0x3417('0xec')],'subject':_0x378e1d[_0x3417('0xed')],'html':_0x388d8b[_0x3417('0x66')],'attachments':_0xc27193}},client9003)[_0x3417('0x17')](function(){return _0x388d8b;})[_0x3417('0x21')](function(_0x2bb8e2){logger[_0x3417('0x1d')](_0x2bb8e2);});}})[_0x3417('0x17')](function(){if(_0x378e1d&&_0x378e1d[_0x3417('0xee')]&&_0x378e1d[_0x3417('0xef')]){var _0x1ba490=[];if(_0x39b32f[_0x3417('0x61')]){_0x1ba490=_0x39b32f['map'](function(_0x534671){return{'name':_0x534671[_0x3417('0xde')],'basename':_0x534671[_0x3417('0x80')],'type':_0x534671[_0x3417('0xdf')],'ChatOfflineMessageId':_0x12e05a['id']};});}var _0x3889ac;if(!_[_0x3417('0x8a')](_0x378e1d[_0x3417('0xf0')])){var _0x23991d=_['map'](_0x19834a[_0x3417('0x66')],function(_0xd04d99){return _0xd04d99;});var _0x6e1236=_[_0x3417('0xf1')](_0x23991d)[0x0];var _0x11ae9b=_[_0x3417('0xf2')](_0x6e1236,function(_0x2abf7f){return _0x2abf7f;});_0x3889ac=_0x11ae9b[0x1][_0x378e1d[_0x3417('0xf0')]];}var _0x1c64e7={'from':_0xaf54b8['email'],'firstName':_0xaf54b8[_0x3417('0x3b')],'lastName':_0xaf54b8[_0x3417('0x3c')],'mapKey':_0x3417('0xf3'),'message':{'from':_0xaf54b8[_0x3417('0xf3')],'to':_0x378e1d[_0x3417('0xd8')][_0x3417('0xf3')],'cc':'','subject':_[_0x3417('0x8a')](_0x3889ac)?_0x378e1d[_0x3417('0xed')]:_0x3889ac,'messageId':'','sentAt':new Date(),'attach':_0x1ba490[_0x3417('0x61')],'attachments':_0x1ba490,'originChannel':'Chat','ChatWebsiteId':_0x378e1d['id'],'ChatOfflineMessageId':_0x388d8b['id'],'originTo':_0x378e1d[_0x3417('0xd8')][_0x3417('0xf3')]},'body':_0x388d8b[_0x3417('0x66')]};var _0x3b8492={'account':{'id':_0x378e1d['MailAccountId']},'body':_0x1c64e7,'log':_0x3417('0xf4')};return respondWithRpcPromise(_0x3417('0xf4'),_0x3417('0xf5'),_0x3b8492,client9001)['then'](function(){return _0x388d8b;})[_0x3417('0x21')](function(_0x4f152d){logger[_0x3417('0x1d')](_0x4f152d);});}return;})['then'](function(){if(_0x388d8b){return _0x388d8b;}})[_0x3417('0x17')](respondWithResult(_0x3e5a38,null))[_0x3417('0x21')](function(){for(var _0x2654dc of _0x39b32f){var _0x3167fa=path[_0x3417('0x86')](config[_0x3417('0x8c')],'server','files',_0x3417('0xe1'),'offline-chat',_0x2654dc[_0x3417('0x80')]);fs_extra[_0x3417('0xf6')](_0x3167fa)['catch'](function(_0x4cc9e2){logger[_0x3417('0x1d')](_0x3417('0xf7'),_0x3167fa,_0x4cc9e2);});}});};exports['addInteraction']=function(_0x5f3af6,_0x12b4f8){return db['ChatInteraction'][_0x3417('0x64')]({'where':{'id':_0x5f3af6[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x12b4f8,null))[_0x3417('0x17')](function(_0x1b3276){if(_0x1b3276){return _0x1b3276[_0x3417('0xf8')](_0x5f3af6[_0x3417('0x66')][_0x3417('0x78')],_[_0x3417('0xf9')](_0x5f3af6[_0x3417('0x66')],[_0x3417('0x78'),'id'])||{});}})[_0x3417('0x17')](respondWithResult(_0x12b4f8,null))[_0x3417('0x21')](handleError(_0x12b4f8,null));};exports[_0x3417('0xfa')]=function(_0x4a258f,_0x1c244c){var _0x52fd2a={'raw':![],'where':{}};var _0x3e6bf9={};var _0x3217cf={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3417('0x75')]({'where':{'id':_0x4a258f[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x1c244c,null))[_0x3417('0x17')](function(_0x4a95c0){if(_0x4a95c0){_0x3e6bf9[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0xb6')][_0x3417('0x4d')]);_0x3e6bf9[_0x3417('0x50')]=_[_0x3417('0x51')](_0x4a258f[_0x3417('0x50')]);_0x3e6bf9[_0x3417('0x52')]=_[_0x3417('0x53')](_0x3e6bf9[_0x3417('0x45')],_0x3e6bf9[_0x3417('0x50')]);_0x52fd2a[_0x3417('0x54')]=_[_0x3417('0x53')](_0x3e6bf9[_0x3417('0x45')],qs['fields'](_0x4a258f[_0x3417('0x50')][_0x3417('0x55')]));_0x52fd2a[_0x3417('0x54')]=_0x52fd2a[_0x3417('0x54')]['length']?_0x52fd2a['attributes']:_0x3e6bf9[_0x3417('0x45')];if(!_0x4a258f['query'][_0x3417('0x56')]('nolimit')){_0x52fd2a[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x4a258f[_0x3417('0x50')][_0x3417('0x28')]);_0x52fd2a[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x4a258f[_0x3417('0x50')][_0x3417('0x26')]);}_0x52fd2a[_0x3417('0x57')]=qs['sort'](_0x4a258f[_0x3417('0x50')][_0x3417('0x58')]);_0x52fd2a['where']=qs['filters'](_[_0x3417('0x5a')](_0x4a258f[_0x3417('0x50')],_0x3e6bf9[_0x3417('0x52')]));_0x52fd2a[_0x3417('0x59')][_0x3417('0x72')]=_0x4a95c0['id'];if(_0x4a258f[_0x3417('0x50')][_0x3417('0x5b')]){_0x52fd2a[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x52fd2a[_0x3417('0x59')],{'$or':_['map'](_0x52fd2a['attributes'],function(_0x35a9f6){var _0x5f91b5={};_0x5f91b5[_0x35a9f6]={'$like':'%'+_0x4a258f[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x5f91b5;})});}_0x52fd2a=_[_0x3417('0x5d')]({},_0x52fd2a,_0x4a258f[_0x3417('0x5e')]);return db[_0x3417('0xb6')][_0x3417('0x29')]({'where':_0x52fd2a['where']})[_0x3417('0x17')](function(_0x2d0d52){_0x3217cf[_0x3417('0x29')]=_0x2d0d52;if(_0x4a258f[_0x3417('0x50')][_0x3417('0x62')]){_0x52fd2a[_0x3417('0x63')]=[{'model':db['CmContact'],'as':_0x3417('0xfb'),'required':![]},{'model':db[_0x3417('0xc3')],'as':_0x3417('0xfc'),'attributes':[_0x3417('0x31'),_0x3417('0xfd'),_0x3417('0xfe')],'required':![]},{'model':db['Tag'],'as':_0x3417('0xff'),'attributes':['id',_0x3417('0x31'),_0x3417('0x100')],'where':_0x4a258f['query'][_0x3417('0x101')]?{'id':_0x4a258f['query']['tag']}:undefined,'required':_0x4a258f[_0x3417('0x50')][_0x3417('0x101')]?!![]:![]}];}return db[_0x3417('0xb6')][_0x3417('0x5f')](_0x52fd2a);})['then'](function(_0x5cdf0c){_0x3217cf[_0x3417('0x60')]=_0x5cdf0c;return _0x3217cf;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x1c244c,_0x52fd2a))[_0x3417('0x21')](handleError(_0x1c244c,null));};exports[_0x3417('0x102')]=function(_0x28278c,_0x3a5272){var _0x51f9a2=0x0;var _0x2600bb=0x0;var _0x214a5b=![];var _0x2e9c6d;var _0x169abf;return db['ChatWebsite'][_0x3417('0x64')]({'where':{'id':_0x28278c[_0x3417('0x70')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x3417('0x97')],'as':'Intervals','attributes':['id',_0x3417('0xaa')]}]}]})['then'](handleEntityNotFound(_0x3a5272,null))['then'](function(_0x516293){if(_0x516293){_0x2e9c6d=_0x516293;return _0x516293[_0x3417('0x103')]({'raw':!![]});}})[_0x3417('0x17')](function(_0x5519fa){if(_0x2e9c6d){if(_0x5519fa){_0x169abf=_0x5519fa;}}return require(_0x3417('0x87'))[_0x3417('0x88')]();})[_0x3417('0x17')](function(_0x43bb00){if(_0x43bb00){_0x2600bb=_0x43bb00[_0x3417('0x104')];_0x214a5b=_0x43bb00[_0x3417('0x89')];}})[_0x3417('0x17')](function(){return db[_0x3417('0xb6')][_0x3417('0x29')]({'where':{'closed':![]}});})[_0x3417('0x17')](function(_0x479da9){_0x51f9a2=_0x479da9;if(_0x2600bb&&_0x479da9>_0x2600bb){return db[_0x3417('0x105')][_0x3417('0x75')]({'where':{'id':0x1}})['then'](function(_0x556b25){if(_0x556b25){_0x556b25[_0x3417('0x106')](_0x3417('0x107'));}});}})['then'](function(){var _0x5904d7=_0x2e9c6d[_0x3417('0x97')];var _0x235604=_0x2e9c6d[_0x3417('0x108')]||undefined;return _0x5904d7?_0x5904d7[_0x3417('0x98')](_0x235604):!![];})['then'](function(_0x5ea15e){var _0x3f04a1=fs[_0x3417('0xda')](path[_0x3417('0x86')](config[_0x3417('0x8c')],_0x3417('0x109')),_0x3417('0xdb'));var _0x518db0='3.8.1';var _0x79a087=![];try{const _0x38a485=new URL(_0x2e9c6d['address']);_0x2e9c6d[_0x3417('0x67')]=_0x38a485['origin'];}catch(_0x41767d){}var _0x2404f6;if(_0x28278c[_0x3417('0xb3')]['referer']){_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')]=_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')][_0x3417('0x10a')](/\/$/,'');_0x2404f6=wildcardUtils['testWebsiteWithWildcard'](_0x2e9c6d[_0x3417('0x67')],_0x28278c['headers'][_0x3417('0x3e')]);}else{_0x28278c[_0x3417('0xb3')]['referer']=_0x2e9c6d[_0x3417('0x67')];_0x2404f6=!![];}var _0x53512c={'chatVersion':_0x518db0,'chatWebsiteAddressOrigin':_0x2404f6?_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')]:_0x2e9c6d['address'],'remote':_0x2e9c6d[_0x3417('0x10b')],'query':querystring[_0x3417('0x10c')](_[_0x3417('0x5d')](_0x2e9c6d['get']({'plain':!![]}),{'customerIp':_0x28278c[_0x3417('0xb3')][_0x3417('0x38')]||_0x28278c[_0x3417('0xb3')]['x-real-ip']||_0x28278c[_0x3417('0x10d')]['remoteAddress']||_0x28278c['ip'],'referer':_0x28278c['headers']['referer'],'openedInteractions':_0x51f9a2,'maxInteractions':_0x2600bb,'virtual':_0x214a5b[_0x3417('0x104')],'online':_0x5ea15e,'custom':_0x214a5b,'address':_0x2404f6?_0x28278c[_0x3417('0xb3')][_0x3417('0x3e')]:null}))[_0x3417('0x10a')](/'/g,'\x5c\x27')};_0x3a5272[_0x3417('0x32')](ejs[_0x3417('0x10e')](Mustache['render'](_0x3f04a1,_0x53512c),{'proactiveActions':_0x169abf,'alignment':_0x2e9c6d['alignment'],'verticalAlignment':_0x2e9c6d[_0x3417('0x10f')],'div_color':_0x2e9c6d[_0x3417('0x100')],'labelText':_0x2e9c6d[_0x3417('0x110')],'text_color':_0x2e9c6d[_0x3417('0x111')],'text_button_color':_0x2e9c6d[_0x3417('0x112')],'button_color':_0x2e9c6d[_0x3417('0x113')],'background_color':_0x2e9c6d[_0x3417('0x114')],'hideWhenOffline':_0x2e9c6d['hideWhenOffline'],'intervalId':_0x2e9c6d[_0x3417('0x115')],'isDevelopment':_0x79a087,'chatVersion':_0x518db0}));})[_0x3417('0x21')](handleError(_0x3a5272,null));};exports['addApplications']=function(_0x1aad65,_0x1e46df){var _0x49c01d=_0x1aad65['params']['id'];var _0x34ca6b=_0x1aad65[_0x3417('0x66')];var _0x238b32=0xc8;var _0x111d2e=null;return db[_0x3417('0xe3')][_0x3417('0xe4')]({'isolationLevel':db[_0x3417('0xe3')][_0x3417('0x116')][_0x3417('0x117')][_0x3417('0x118')]},function(_0x1bd6e1){return db['ChatWebsite'][_0x3417('0x75')]({'where':{'id':_0x49c01d},'transaction':_0x1bd6e1})['then'](function(_0x2084ed){if(_0x2084ed){return db[_0x3417('0xa7')][_0x3417('0x2f')]({'where':{'ChatWebsiteId':_0x49c01d},'transaction':_0x1bd6e1})[_0x3417('0x17')](function(){var _0x1639cf=_[_0x3417('0x4b')](_0x34ca6b,function(_0x3e8d62){_0x3e8d62[_0x3417('0x72')]=_0x49c01d;return _0x3e8d62;});return db[_0x3417('0xa7')][_0x3417('0xe6')](_0x1639cf,{'transaction':_0x1bd6e1});});}else{_0x238b32=0x194;_0x111d2e=[];}});})['then'](function(){if(_0x238b32!==0x194){return db[_0x3417('0xa7')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x49c01d},'order':'priority'})['then'](function(_0x2f9731){_0x111d2e=_0x2f9731;});}})['catch'](function(_0x460992){_0x238b32=0x1f4;logger[_0x3417('0x1d')](_0x460992[_0x3417('0x30')]);if(_0x460992[_0x3417('0x31')]){delete _0x460992['name'];}_0x111d2e=_0x460992;})[_0x3417('0x119')](function(){if(_0x111d2e===null){_0x1e46df[_0x3417('0x22')](_0x238b32);}else{if(_0x238b32===0x1f4){_0x1e46df[_0x3417('0x23')](_0x238b32)[_0x3417('0x32')](_0x111d2e);}else{_0x1e46df['status'](_0x238b32)[_0x3417('0x25')](_0x111d2e);}}});};exports[_0x3417('0x11a')]=function(_0x2d88af,_0x16a88d){var _0x3e6cda={};var _0x426a53={};var _0x1e5b73;var _0x25279a;return db[_0x3417('0x4c')]['findOne']({'where':{'id':_0x2d88af[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x16a88d,null))[_0x3417('0x17')](function(_0x3f5906){if(_0x3f5906){_0x1e5b73=_0x3f5906;_0x426a53[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0xa7')][_0x3417('0x4d')]);_0x426a53[_0x3417('0x50')]=_[_0x3417('0x51')](_0x2d88af[_0x3417('0x50')]);_0x426a53[_0x3417('0x52')]=_['intersection'](_0x426a53[_0x3417('0x45')],_0x426a53[_0x3417('0x50')]);_0x3e6cda[_0x3417('0x54')]=_['intersection'](_0x426a53[_0x3417('0x45')],qs[_0x3417('0x55')](_0x2d88af[_0x3417('0x50')][_0x3417('0x55')]));_0x3e6cda[_0x3417('0x54')]=_0x3e6cda[_0x3417('0x54')][_0x3417('0x61')]?_0x3e6cda['attributes']:_0x426a53[_0x3417('0x45')];_0x3e6cda[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x2d88af[_0x3417('0x50')][_0x3417('0x58')]);_0x3e6cda[_0x3417('0x59')]=qs['filters'](_[_0x3417('0x5a')](_0x2d88af[_0x3417('0x50')],_0x426a53[_0x3417('0x52')]));if(_0x2d88af['query'][_0x3417('0x5b')]){_0x3e6cda[_0x3417('0x59')]=_[_0x3417('0x5d')](_0x3e6cda[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0x3e6cda[_0x3417('0x54')],function(_0x48ecb7){var _0xa872cd={};_0xa872cd[_0x48ecb7]={'$like':'%'+_0x2d88af[_0x3417('0x50')]['filter']+'%'};return _0xa872cd;})});}_0x3e6cda=_[_0x3417('0x5d')]({},_0x3e6cda,_0x2d88af[_0x3417('0x5e')]);return _0x1e5b73[_0x3417('0x11a')](_0x3e6cda);}})[_0x3417('0x17')](function(_0x16e83f){if(_0x16e83f){_0x25279a=_0x16e83f[_0x3417('0x61')];if(!_0x2d88af[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x3e6cda[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x2d88af[_0x3417('0x50')][_0x3417('0x28')]);_0x3e6cda[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x2d88af[_0x3417('0x50')][_0x3417('0x26')]);}return _0x1e5b73['getApplications'](_0x3e6cda);}})[_0x3417('0x17')](function(_0x1e557c){if(_0x1e557c){return _0x1e557c?{'count':_0x25279a,'rows':_0x1e557c}:null;}})[_0x3417('0x17')](respondWithResult(_0x16a88d,null))[_0x3417('0x21')](handleError(_0x16a88d,null));};exports[_0x3417('0x11b')]=function(_0x4b103d,_0xe8d21f){return db[_0x3417('0x11c')][_0x3417('0x64')]({'where':{'id':_0x4b103d[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0xe8d21f,null))[_0x3417('0x17')](function(_0x542ccf){if(_0x542ccf){return _0x542ccf['addProactiveActions'](_0x4b103d[_0x3417('0x66')][_0x3417('0x78')],_[_0x3417('0xf9')](_0x4b103d[_0x3417('0x66')],[_0x3417('0x78'),'id'])||{});}})[_0x3417('0x17')](respondWithResult(_0xe8d21f,null))[_0x3417('0x21')](handleError(_0xe8d21f,null));};exports['getProactiveActions']=function(_0x2f6f85,_0x12b8ac){var _0xa533ae={};var _0x466ec5={};var _0x901f70;var _0x288e68;return db[_0x3417('0x4c')][_0x3417('0x75')]({'where':{'id':_0x2f6f85[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x12b8ac,null))[_0x3417('0x17')](function(_0x2e1e90){if(_0x2e1e90){_0x901f70=_0x2e1e90;_0x466ec5[_0x3417('0x45')]=_['keys'](db[_0x3417('0x11d')][_0x3417('0x4d')]);_0x466ec5[_0x3417('0x50')]=_[_0x3417('0x51')](_0x2f6f85[_0x3417('0x50')]);_0x466ec5[_0x3417('0x52')]=_[_0x3417('0x53')](_0x466ec5[_0x3417('0x45')],_0x466ec5['query']);_0xa533ae['attributes']=_[_0x3417('0x53')](_0x466ec5[_0x3417('0x45')],qs[_0x3417('0x55')](_0x2f6f85['query'][_0x3417('0x55')]));_0xa533ae[_0x3417('0x54')]=_0xa533ae[_0x3417('0x54')][_0x3417('0x61')]?_0xa533ae[_0x3417('0x54')]:_0x466ec5['model'];_0xa533ae[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x2f6f85[_0x3417('0x50')][_0x3417('0x58')]);_0xa533ae['where']=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x2f6f85[_0x3417('0x50')],_0x466ec5[_0x3417('0x52')]));if(_0x2f6f85[_0x3417('0x50')][_0x3417('0x5b')]){_0xa533ae['where']=_['merge'](_0xa533ae[_0x3417('0x59')],{'$or':_[_0x3417('0x4b')](_0xa533ae['attributes'],function(_0x59b31c){var _0x2cee7b={};_0x2cee7b[_0x59b31c]={'$like':'%'+_0x2f6f85[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x2cee7b;})});}_0xa533ae=_[_0x3417('0x5d')]({},_0xa533ae,_0x2f6f85[_0x3417('0x5e')]);return _0x901f70[_0x3417('0x103')](_0xa533ae);}})[_0x3417('0x17')](function(_0x58e639){if(_0x58e639){_0x288e68=_0x58e639[_0x3417('0x61')];if(!_0x2f6f85[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0xa533ae['limit']=qs[_0x3417('0x28')](_0x2f6f85['query'][_0x3417('0x28')]);_0xa533ae['offset']=qs[_0x3417('0x26')](_0x2f6f85[_0x3417('0x50')][_0x3417('0x26')]);}return _0x901f70[_0x3417('0x103')](_0xa533ae);}})[_0x3417('0x17')](function(_0x2a6aec){if(_0x2a6aec){return _0x2a6aec?{'count':_0x288e68,'rows':_0x2a6aec}:null;}})['then'](respondWithResult(_0x12b8ac,null))[_0x3417('0x21')](handleError(_0x12b8ac,null));};exports[_0x3417('0x11e')]=function(_0x519e6e,_0xd467e6){var _0x318634=_0x519e6e[_0x3417('0x50')][_0x3417('0x11f')]===_0x3417('0x120')?'offlineForm':_0x3417('0x121');return db[_0x3417('0x4c')][_0x3417('0x64')]({'attributes':['id',_0x318634],'where':{'id':_0x519e6e[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0xd467e6,null))[_0x3417('0x17')](function(_0x50d29a){if(_0x50d29a){var _0x517923=_0x50d29a[_0x318634];var _0x28371f=_0x517923&&_0x517923[_0x3417('0x122')]?_0x517923['items']:[];_0xd467e6[_0x3417('0x32')]({'fromKey':_[_0x3417('0x8a')](_0x517923[_0x3417('0x123')])?undefined:_0x517923['fromKey'],'count':_0x28371f['length'],'rows':_0x28371f});}})[_0x3417('0x21')](handleError(_0xd467e6,null));};exports[_0x3417('0x124')]=function(_0x8c4b91,_0x179e23){var _0x51bd82={'raw':![],'where':{}};var _0x39975a={};var _0x1e842f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x3417('0x75')]({'where':{'id':_0x8c4b91[_0x3417('0x70')]['id']}})['then'](handleEntityNotFound(_0x179e23,null))[_0x3417('0x17')](function(_0x4ad502){if(_0x4ad502){_0x39975a[_0x3417('0x45')]=_['keys'](db[_0x3417('0x125')][_0x3417('0x4d')]);_0x39975a[_0x3417('0x50')]=_[_0x3417('0x51')](_0x8c4b91[_0x3417('0x50')]);_0x39975a[_0x3417('0x52')]=_[_0x3417('0x53')](_0x39975a[_0x3417('0x45')],_0x39975a['query']);_0x51bd82['attributes']=_[_0x3417('0x53')](_0x39975a[_0x3417('0x45')],qs[_0x3417('0x55')](_0x8c4b91['query'][_0x3417('0x55')]));_0x51bd82[_0x3417('0x54')]=_0x51bd82[_0x3417('0x54')]['length']?_0x51bd82['attributes']:_0x39975a[_0x3417('0x45')];if(!_0x8c4b91[_0x3417('0x50')][_0x3417('0x56')]('nolimit')){_0x51bd82[_0x3417('0x28')]=qs[_0x3417('0x28')](_0x8c4b91[_0x3417('0x50')][_0x3417('0x28')]);_0x51bd82[_0x3417('0x26')]=qs['offset'](_0x8c4b91[_0x3417('0x50')][_0x3417('0x26')]);}_0x51bd82[_0x3417('0x57')]=qs['sort'](_0x8c4b91[_0x3417('0x50')]['sort']);_0x51bd82[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x8c4b91[_0x3417('0x50')],_0x39975a[_0x3417('0x52')]));_0x51bd82[_0x3417('0x59')][_0x3417('0x72')]=_0x4ad502['id'];if(_0x8c4b91[_0x3417('0x50')]['filter']){_0x51bd82['where']=_['merge'](_0x51bd82['where'],{'$or':_[_0x3417('0x4b')](_0x51bd82[_0x3417('0x54')],function(_0x4825fc){var _0x49c83a={};_0x49c83a[_0x4825fc]={'$like':'%'+_0x8c4b91[_0x3417('0x50')]['filter']+'%'};return _0x49c83a;})});}_0x51bd82=_[_0x3417('0x5d')]({},_0x51bd82,_0x8c4b91['options']);return db[_0x3417('0x125')][_0x3417('0x29')]({'where':_0x51bd82['where']})[_0x3417('0x17')](function(_0x2eaf01){_0x1e842f[_0x3417('0x29')]=_0x2eaf01;if(_0x8c4b91[_0x3417('0x50')][_0x3417('0x62')]){_0x51bd82[_0x3417('0x63')]=[{'all':!![]}];}else{_0x51bd82[_0x3417('0x63')]=[{'model':db[_0x3417('0xa4')],'as':_0x3417('0xfb'),'required':![]},{'model':db[_0x3417('0xe5')],'as':_0x3417('0x126'),'required':![]}];}return db[_0x3417('0x125')][_0x3417('0x5f')](_0x51bd82);})[_0x3417('0x17')](function(_0x46f489){_0x1e842f[_0x3417('0x60')]=_0x46f489;return _0x1e842f;});}})[_0x3417('0x17')](respondWithFilteredResult(_0x179e23,_0x51bd82))[_0x3417('0x21')](handleError(_0x179e23,null));};exports[_0x3417('0x127')]=function(_0x2edc53,_0x4d8f57){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x2edc53['params']['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x4d8f57,null))[_0x3417('0x17')](function(_0x1a344e){if(_0x1a344e){return _0x1a344e['addAgents'](_0x2edc53[_0x3417('0x66')]['ids'],_[_0x3417('0xf9')](_0x2edc53[_0x3417('0x66')],[_0x3417('0x78'),'id'])||{})[_0x3417('0xd9')](function(_0x2da7d6){for(var _0x5b6d02=0x0;_0x5b6d02<_0x2edc53[_0x3417('0x66')][_0x3417('0x78')][_0x3417('0x61')];_0x5b6d02+=0x1){socket[_0x3417('0x128')](_0x3417('0x129'),{'UserId':Number(_0x2edc53[_0x3417('0x66')]['ids'][_0x5b6d02]),'ChatWebsiteId':Number(_0x2edc53[_0x3417('0x70')]['id'])});}return _0x2da7d6;});}})[_0x3417('0x17')](respondWithResult(_0x4d8f57,null))['catch'](handleError(_0x4d8f57,null));};exports[_0x3417('0x12a')]=function(_0x41cd8b,_0x1dc61b){return db[_0x3417('0x4c')][_0x3417('0x64')]({'where':{'id':_0x41cd8b[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x1dc61b,null))['then'](function(_0x1f5388){if(_0x1f5388){return _0x1f5388['removeAgents'](_0x41cd8b[_0x3417('0x50')]['ids'])['then'](function(){if(_[_0x3417('0x12b')](_0x41cd8b['query'][_0x3417('0x78')])){for(var _0x47ad23=0x0;_0x47ad23<_0x41cd8b[_0x3417('0x50')][_0x3417('0x78')][_0x3417('0x61')];_0x47ad23+=0x1){socket['emit'](_0x3417('0x12c'),{'UserId':Number(_0x41cd8b['query'][_0x3417('0x78')][_0x47ad23]),'ChatWebsiteId':Number(_0x41cd8b[_0x3417('0x70')]['id'])});}}else{socket['emit'](_0x3417('0x12c'),{'UserId':Number(_0x41cd8b[_0x3417('0x50')][_0x3417('0x78')]),'ChatWebsiteId':Number(_0x41cd8b['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1dc61b,null))[_0x3417('0x21')](handleError(_0x1dc61b,null));};exports[_0x3417('0x12d')]=function(_0x15e769,_0x745465){var _0x276b90={};var _0x37551c={};var _0x28bcb0;var _0x324b2c;return db[_0x3417('0x4c')][_0x3417('0x75')]({'where':{'id':_0x15e769[_0x3417('0x70')]['id']}})[_0x3417('0x17')](handleEntityNotFound(_0x745465,null))[_0x3417('0x17')](function(_0x36850c){if(_0x36850c){_0x28bcb0=_0x36850c;_0x37551c[_0x3417('0x45')]=_[_0x3417('0x51')](db[_0x3417('0xc3')][_0x3417('0x4d')]);_0x37551c[_0x3417('0x50')]=_[_0x3417('0x51')](_0x15e769[_0x3417('0x50')]);_0x37551c[_0x3417('0x52')]=_[_0x3417('0x53')](_0x37551c[_0x3417('0x45')],_0x37551c[_0x3417('0x50')]);_0x276b90[_0x3417('0x54')]=_[_0x3417('0x53')](_0x37551c[_0x3417('0x45')],qs[_0x3417('0x55')](_0x15e769[_0x3417('0x50')][_0x3417('0x55')]));_0x276b90['attributes']=_0x276b90[_0x3417('0x54')][_0x3417('0x61')]?_0x276b90['attributes']:_0x37551c['model'];_0x276b90[_0x3417('0x57')]=qs[_0x3417('0x58')](_0x15e769[_0x3417('0x50')][_0x3417('0x58')]);_0x276b90[_0x3417('0x59')]=qs[_0x3417('0x52')](_[_0x3417('0x5a')](_0x15e769[_0x3417('0x50')],_0x37551c[_0x3417('0x52')]));if(_0x15e769['query'][_0x3417('0x5b')]){_0x276b90['where']=_[_0x3417('0x5d')](_0x276b90['where'],{'$or':_[_0x3417('0x4b')](_0x276b90[_0x3417('0x54')],function(_0x1304e2){var _0x4e0529={};_0x4e0529[_0x1304e2]={'$like':'%'+_0x15e769[_0x3417('0x50')][_0x3417('0x5b')]+'%'};return _0x4e0529;})});}_0x276b90=_[_0x3417('0x5d')]({},_0x276b90,_0x15e769[_0x3417('0x5e')]);return _0x28bcb0[_0x3417('0x12d')](_0x276b90);}})['then'](function(_0xe927f6){if(_0xe927f6){_0x324b2c=_0xe927f6[_0x3417('0x61')];if(!_0x15e769[_0x3417('0x50')][_0x3417('0x56')](_0x3417('0x76'))){_0x276b90['limit']=qs['limit'](_0x15e769['query'][_0x3417('0x28')]);_0x276b90[_0x3417('0x26')]=qs[_0x3417('0x26')](_0x15e769[_0x3417('0x50')][_0x3417('0x26')]);}return _0x28bcb0['getAgents'](_0x276b90);}})[_0x3417('0x17')](function(_0x414181){if(_0x414181){return _0x414181?{'count':_0x324b2c,'rows':_0x414181}:null;}})[_0x3417('0x17')](respondWithResult(_0x745465,null))[_0x3417('0x21')](handleError(_0x745465,null));}; \ No newline at end of file +var _0xc30f=['threadId','closed','ChatInteraction','Writing\x20on\x20closed\x20interaction','externalUrl','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','unshift','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','Sequelize','no\x20available\x20attributes','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','toPairsIn','mapValues','email','firstName','Chat','MailAccountId','NotifyMailAccount','remove','omit','getInteractions','Contact','fullname','color','tag','getSnippet','../../config/license/util','virtual','License','chatLicenseExceeded','utf8','3.8.1','origin','replace','testWebsiteWithWildcard','remoteAddress','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','ISOLATION_LEVELS','ChatApplication','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','mustache','path','ejs','fs-extra','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','APINotFoundError','APIOutOfIntervalError','handleError','./helpers/wildcard-expressions','url','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','end','status','json','undefined','limit','count','offset','Content-Range','destroy','get','ChatWebsites','UserProfileResource','name','send','user-agent-parser','setUA','user-agent','getResult','first','x-forwarded-for','lastName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','model','%s\x20%s\x20%s','vendor','type','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','key','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','merge','filter','options','includeAll','include','findAll','rows','show','params','find','create','testWildcardValidity','address','body','\x22\x20is\x20not\x20a\x20valid\x20website\x20domain','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','nolimit','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','addAvatar','agentAvatar','filename','addCustomerAvatar','addSystemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','systemAvatar','Interval','resolve','timezone','ifTime','notify','from','From\x20is\x20mandatory','MapKey\x20is\x20mandatory','isEmpty','Body\x20is\x20mandatory','customerIp','CmContact','No\x20available\x20attributes','createdAt','updatedAt','CompanyId','includes','mapKey','Invalid\x20MapKey\x20parameter.\x20Allowed\x20values:\x20','CmList','List','Contacts','DESC','Applications','Intervals','interval','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','account','applications','orderBy','priority','asc','list','ListId','defaults','contact','headers'];(function(_0x1cc9cc,_0x1d7711){var _0x3dce09=function(_0x19a5b4){while(--_0x19a5b4){_0x1cc9cc['push'](_0x1cc9cc['shift']());}};_0x3dce09(++_0x1d7711);}(_0xc30f,0x75));var _0xfc30=function(_0x228d93,_0x5b5a75){_0x228d93=_0x228d93-0x0;var _0x11c8ad=_0xc30f[_0x228d93];return _0x11c8ad;};'use strict';var Mustache=require(_0xfc30('0x0'));var util=require('util');var path=require(_0xfc30('0x1'));var ejs=require(_0xfc30('0x2'));var fs=require('fs');var fs_extra=require(_0xfc30('0x3'));var _=require(_0xfc30('0x4'));var querystring=require('querystring');var htmlToText=require('html-to-text');var Redis=require(_0xfc30('0x5'));var jayson=require('jayson/promise');var qs=require(_0xfc30('0x6'));var logger=require(_0xfc30('0x7'))(_0xfc30('0x8'));var config=require(_0xfc30('0x9'));var APIBadRequestError=require(_0xfc30('0xa'))['APIBadRequestError'];var APINotFoundError=require(_0xfc30('0xa'))[_0xfc30('0xb')];var APIOutOfIntervalError=require(_0xfc30('0xa'))[_0xfc30('0xc')];var APIHandleError=require(_0xfc30('0xa'))[_0xfc30('0xd')];var APIConflictError=require('../../errors/api')['APIConflictError'];var wildcardUtils=require(_0xfc30('0xe'));var URL=require(_0xfc30('0xf'))['URL'];var db=require(_0xfc30('0x10'))['db'];config[_0xfc30('0x11')]=_['defaults'](config['redis'],{'host':_0xfc30('0x12'),'port':0x18eb});var socket=require(_0xfc30('0x13'))(new Redis(config['redis']));require(_0xfc30('0x14'))[_0xfc30('0x15')](socket);var client=jayson[_0xfc30('0x16')][_0xfc30('0x17')]({'port':0x232c});var client9002=jayson[_0xfc30('0x16')]['http']({'port':0x232a});var client9003=jayson[_0xfc30('0x16')]['http']({'port':0x232b});var client9001=jayson[_0xfc30('0x16')][_0xfc30('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x2c598b,_0x228993,_0x109bad,_0x4784b5){return new Promise(function(_0x21b0db,_0x15b049){var _0x48c33f=_0x4784b5||client;return _0x48c33f[_0xfc30('0x18')](_0x2c598b,_0x109bad)[_0xfc30('0x19')](function(_0x4cd29b){logger[_0xfc30('0x1a')](_0xfc30('0x1b'),_0x228993,_0xfc30('0x1c'));logger[_0xfc30('0x1d')](_0xfc30('0x1e'),_0x228993,_0xfc30('0x1c'),JSON[_0xfc30('0x1f')](_0x4cd29b));if(_0x4cd29b['error']){if(_0x4cd29b[_0xfc30('0x20')]['code']===0x1f4){logger['error'](_0xfc30('0x1b'),_0x228993,_0x4cd29b[_0xfc30('0x20')][_0xfc30('0x21')]);return _0x15b049(_0x4cd29b[_0xfc30('0x20')]['message']);}logger['error'](_0xfc30('0x1b'),_0x228993,_0x4cd29b[_0xfc30('0x20')][_0xfc30('0x21')]);return _0x21b0db(_0x4cd29b[_0xfc30('0x20')][_0xfc30('0x21')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x228993,_0xfc30('0x1c'));_0x21b0db(_0x4cd29b[_0xfc30('0x22')]['message']);}})[_0xfc30('0x23')](function(_0x3e0928){logger[_0xfc30('0x20')](_0xfc30('0x1b'),_0x228993,_0x3e0928);_0x15b049(_0x3e0928);});});}function respondWithStatusCode(_0x293057,_0x49a935){_0x49a935=_0x49a935||0xcc;return function(_0x38d3a2){if(_0x38d3a2){return _0x293057[_0xfc30('0x24')](_0x49a935);}return _0x293057['status'](_0x49a935)[_0xfc30('0x25')]();};}function respondWithResult(_0x549e23,_0x1224ca){_0x1224ca=_0x1224ca||0xc8;return function(_0x2da686){if(_0x2da686){return _0x549e23[_0xfc30('0x26')](_0x1224ca)[_0xfc30('0x27')](_0x2da686);}};}function respondWithFilteredResult(_0x17b7df,_0x585952){return function(_0x3cc4f0){if(_0x3cc4f0){var _0xef0105=typeof _0x585952['offset']===_0xfc30('0x28')&&typeof _0x585952[_0xfc30('0x29')]===_0xfc30('0x28');var _0x4d0819=_0x3cc4f0[_0xfc30('0x2a')];var _0x19ea28=_0xef0105?0x0:_0x585952[_0xfc30('0x2b')];var _0x1cce6e=_0xef0105?_0x3cc4f0['count']:_0x585952[_0xfc30('0x2b')]+_0x585952[_0xfc30('0x29')];var _0x5e0763;if(_0x1cce6e>=_0x4d0819){_0x1cce6e=_0x4d0819;_0x5e0763=0xc8;}else{_0x5e0763=0xce;}_0x17b7df[_0xfc30('0x26')](_0x5e0763);return _0x17b7df['set'](_0xfc30('0x2c'),_0x19ea28+'-'+_0x1cce6e+'/'+_0x4d0819)['json'](_0x3cc4f0);}return null;};}function saveUpdates(_0x10a809){return function(_0xedea83){if(_0xedea83){return _0xedea83['update'](_0x10a809)[_0xfc30('0x19')](function(_0x2c566b){return _0x2c566b;});}return null;};}function removeEntity(_0x49a921){return function(_0x1c55a8){if(_0x1c55a8){return _0x1c55a8[_0xfc30('0x2d')]()[_0xfc30('0x19')](function(){var _0x290e42=_0x1c55a8[_0xfc30('0x2e')]({'plain':!![]});var _0x1e1b16=_0xfc30('0x2f');return db[_0xfc30('0x30')][_0xfc30('0x2d')]({'where':{'type':_0x1e1b16,'resourceId':_0x290e42['id']}})[_0xfc30('0x19')](function(){return _0x1c55a8;});})[_0xfc30('0x19')](function(){_0x49a921['status'](0xcc)[_0xfc30('0x25')]();});}};}function handleEntityNotFound(_0x3c1452){return function(_0x1e54b9){if(!_0x1e54b9){_0x3c1452[_0xfc30('0x24')](0x194);}return _0x1e54b9;};}function handleError(_0x45b4d6,_0xb4d412){_0xb4d412=_0xb4d412||0x1f4;return function(_0x2b0bc0){logger[_0xfc30('0x20')](_0x2b0bc0['stack']);if(_0x2b0bc0[_0xfc30('0x31')]){delete _0x2b0bc0[_0xfc30('0x31')];}_0x45b4d6[_0xfc30('0x26')](_0xb4d412)[_0xfc30('0x32')](_0x2b0bc0);};}function createInteractionObject(_0x397e3d,_0x1f180d,_0x575a99,_0x12d7d5){var _0x3e4dc2=require(_0xfc30('0x33'));var _0x3d0a9a=new _0x3e4dc2();var _0x15db7a=_0x3d0a9a[_0xfc30('0x34')](_0x575a99[_0xfc30('0x35')])[_0xfc30('0x36')]();var _0x3bd7df=_0x1f180d['customerIp'];if(_0x575a99['cf-connecting-ip']){_0x3bd7df=_0x575a99['cf-connecting-ip'];}else if(_0x575a99['x-forwarded-for']){_0x3bd7df=_[_0xfc30('0x37')](_0x575a99[_0xfc30('0x38')]['split'](','));}return{'ContactId':_0x12d7d5['id'],'ChatWebsiteId':_0x397e3d,'from':(_0x12d7d5['firstName']||'')+'\x20'+(_0x12d7d5[_0xfc30('0x39')]||''),'customerIp':_0x3bd7df,'customerPort':_0x575a99[_0xfc30('0x3a')]?_0x575a99[_0xfc30('0x3a')]:null,'referer':_0x1f180d[_0xfc30('0x3b')],'browserName':_0x15db7a[_0xfc30('0x3c')][_0xfc30('0x31')]&&_0x15db7a[_0xfc30('0x3c')][_0xfc30('0x3d')]?util[_0xfc30('0x3e')]('%s\x20%s',_0x15db7a[_0xfc30('0x3c')]['name'],_0x15db7a[_0xfc30('0x3c')]['version']):_0xfc30('0x3f'),'browserVersion':_0x15db7a[_0xfc30('0x3c')][_0xfc30('0x3d')]||_0xfc30('0x3f'),'osName':util[_0xfc30('0x3e')](_0xfc30('0x40'),_0x15db7a['os']['name'],_0x15db7a['os'][_0xfc30('0x3d')]),'osVersion':_0x15db7a['os']['version'],'deviceModel':_0x15db7a[_0xfc30('0x41')][_0xfc30('0x42')]&&_0x15db7a[_0xfc30('0x41')]['vendor']?util[_0xfc30('0x3e')](_0xfc30('0x43'),_0x15db7a[_0xfc30('0x41')]['model'],_0x15db7a[_0xfc30('0x41')][_0xfc30('0x44')],_0x15db7a['device'][_0xfc30('0x45')]):null,'deviceVendor':_0x15db7a[_0xfc30('0x41')]['vendor'],'deviceType':_0x15db7a['device']['type'],'formData':JSON[_0xfc30('0x1f')](_0x1f180d)};}exports[_0xfc30('0x46')]=function(_0x21c001,_0x28f175){var _0x254170={'include':[{'model':db[_0xfc30('0x47')],'as':_0xfc30('0x48')}]},_0x45b71b={},_0x38cfd7={'count':0x0,'rows':[]};var _0x50128=_[_0xfc30('0x49')](db[_0xfc30('0x4a')][_0xfc30('0x4b')],function(_0x57b660){return{'name':_0x57b660['fieldName'],'type':_0x57b660['type'][_0xfc30('0x4c')]};});_0x45b71b[_0xfc30('0x42')]=_['map'](_0x50128,'name');_0x45b71b[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x21c001[_0xfc30('0x4d')]);_0x45b71b['filters']=_[_0xfc30('0x4f')](_0x45b71b['model'],_0x45b71b['query']);_0x254170[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x45b71b[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x21c001[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x254170['attributes']=_0x254170[_0xfc30('0x50')][_0xfc30('0x52')]?_0x254170[_0xfc30('0x50')]:_0x45b71b['model'];if(!_0x21c001['query'][_0xfc30('0x53')]('nolimit')){_0x254170[_0xfc30('0x29')]=qs[_0xfc30('0x29')](_0x21c001[_0xfc30('0x4d')]['limit']);_0x254170[_0xfc30('0x2b')]=qs[_0xfc30('0x2b')](_0x21c001[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x254170[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x21c001[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x254170[_0xfc30('0x56')]=qs['filters'](_[_0xfc30('0x57')](_0x21c001['query'],_0x45b71b[_0xfc30('0x58')]),_0x50128);if(_0x21c001['query']['filter']){_0x254170[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x254170['where'],{'$or':_[_0xfc30('0x49')](_0x50128,function(_0x35a959){if(_0x35a959[_0xfc30('0x45')]!=='VIRTUAL'){var _0x23c626={};_0x23c626[_0x35a959[_0xfc30('0x31')]]={'$like':'%'+_0x21c001[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x23c626;}})});}_0x254170=_['merge']({},_0x254170,_0x21c001[_0xfc30('0x5b')]);var _0xa4e99c={'where':_0x254170[_0xfc30('0x56')]};return db[_0xfc30('0x4a')]['count'](_0xa4e99c)['then'](function(_0x53c515){_0x38cfd7[_0xfc30('0x2a')]=_0x53c515;if(_0x21c001[_0xfc30('0x4d')][_0xfc30('0x5c')]){_0x254170[_0xfc30('0x5d')]=[{'all':!![]}];}return db[_0xfc30('0x4a')][_0xfc30('0x5e')](_0x254170);})[_0xfc30('0x19')](function(_0x1c4743){_0x38cfd7[_0xfc30('0x5f')]=_0x1c4743;return _0x38cfd7;})[_0xfc30('0x19')](respondWithFilteredResult(_0x28f175,_0x254170))[_0xfc30('0x23')](handleError(_0x28f175,null));};exports[_0xfc30('0x60')]=function(_0x4d5506,_0xaf03a4){var _0x4fe49={'raw':![],'where':{'id':_0x4d5506[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0x47')],'as':_0xfc30('0x48')}]},_0x4800d5={};_0x4800d5[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db['ChatWebsite'][_0xfc30('0x4b')]);_0x4800d5[_0xfc30('0x4d')]=_['keys'](_0x4d5506[_0xfc30('0x4d')]);_0x4800d5[_0xfc30('0x58')]=_['intersection'](_0x4800d5['model'],_0x4800d5['query']);_0x4fe49[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x4800d5[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x4d5506['query'][_0xfc30('0x51')]));_0x4fe49['attributes']=_0x4fe49[_0xfc30('0x50')][_0xfc30('0x52')]?_0x4fe49[_0xfc30('0x50')]:_0x4800d5[_0xfc30('0x42')];if(_0x4d5506['query'][_0xfc30('0x5c')]){_0x4fe49[_0xfc30('0x5d')]=[{'all':!![]}];}_0x4fe49=_[_0xfc30('0x59')]({},_0x4fe49,_0x4d5506[_0xfc30('0x5b')]);return db['ChatWebsite'][_0xfc30('0x62')](_0x4fe49)[_0xfc30('0x19')](handleEntityNotFound(_0xaf03a4,null))['then'](respondWithResult(_0xaf03a4,null))[_0xfc30('0x23')](handleError(_0xaf03a4,null));};exports[_0xfc30('0x63')]=function(_0x4ed13d,_0x27315e){if(!wildcardUtils[_0xfc30('0x64')](_0x4ed13d['body'][_0xfc30('0x65')])){return handleError(_0x27315e,null)(new APIBadRequestError('\x22'+_0x4ed13d[_0xfc30('0x66')][_0xfc30('0x65')]+_0xfc30('0x67')));}return db[_0xfc30('0x4a')][_0xfc30('0x63')](_0x4ed13d[_0xfc30('0x66')],{})[_0xfc30('0x19')](function(_0x16d4ab){var _0x481ff6=_0x4ed13d[_0xfc30('0x68')][_0xfc30('0x2e')]({'plain':!![]});if(!_0x481ff6)throw new Error(_0xfc30('0x69'));if(_0x481ff6['role']==='user'){var _0x44da5a=_0x16d4ab[_0xfc30('0x2e')]({'plain':!![]});var _0x95f02a=_0xfc30('0x2f');return db['UserProfileSection']['find']({'where':{'name':_0x95f02a,'userProfileId':_0x481ff6[_0xfc30('0x6a')]},'raw':!![]})['then'](function(_0x1bda7c){if(_0x1bda7c&&_0x1bda7c[_0xfc30('0x6b')]===0x0){return db[_0xfc30('0x30')][_0xfc30('0x63')]({'name':_0x44da5a[_0xfc30('0x31')],'resourceId':_0x44da5a['id'],'type':_0x1bda7c[_0xfc30('0x31')],'sectionId':_0x1bda7c['id']},{})[_0xfc30('0x19')](function(){return _0x16d4ab;});}else{return _0x16d4ab;}})[_0xfc30('0x23')](function(_0x271b80){logger[_0xfc30('0x20')](_0xfc30('0x6c'),_0x271b80);throw _0x271b80;});}return _0x16d4ab;})[_0xfc30('0x19')](respondWithResult(_0x27315e,0xc9))[_0xfc30('0x23')](handleError(_0x27315e,null));};exports[_0xfc30('0x6d')]=function(_0x38001b,_0x1b9b00){if(!wildcardUtils[_0xfc30('0x64')](_0x38001b['body']['address'])){return handleError(_0x1b9b00,null)(new APIBadRequestError('\x22'+_0x38001b[_0xfc30('0x66')][_0xfc30('0x65')]+_0xfc30('0x67')));}if(_0x38001b[_0xfc30('0x66')]['id']){delete _0x38001b[_0xfc30('0x66')]['id'];}return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x38001b[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0x47')],'as':_0xfc30('0x48')}]})[_0xfc30('0x19')](handleEntityNotFound(_0x1b9b00,null))[_0xfc30('0x19')](saveUpdates(_0x38001b['body'],null))[_0xfc30('0x19')](respondWithResult(_0x1b9b00,null))[_0xfc30('0x23')](handleError(_0x1b9b00,null));};exports[_0xfc30('0x2d')]=function(_0xdcf3cd,_0x4e6ee3){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0xdcf3cd[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x4e6ee3,null))[_0xfc30('0x19')](removeEntity(_0x4e6ee3,null))[_0xfc30('0x23')](handleError(_0x4e6ee3,null));};exports[_0xfc30('0x6e')]=function(_0x4690a5,_0x15f243){return db[_0xfc30('0x4a')]['describe']()[_0xfc30('0x19')](respondWithResult(_0x15f243,null))[_0xfc30('0x23')](handleError(_0x15f243,null));};exports[_0xfc30('0x6f')]=function(_0x3c1496,_0x125be3){if(_0x3c1496[_0xfc30('0x66')]['id']){delete _0x3c1496[_0xfc30('0x66')]['id'];}return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x3c1496['params']['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x125be3,null))[_0xfc30('0x19')](function(_0x4eedc7){if(_0x4eedc7){_0x3c1496['body'][_0xfc30('0x70')]=_0x4eedc7['id'];return db['Disposition'][_0xfc30('0x63')](_0x3c1496[_0xfc30('0x66')]);}})[_0xfc30('0x19')](respondWithResult(_0x125be3,null))[_0xfc30('0x23')](handleError(_0x125be3,null));};exports[_0xfc30('0x71')]=function(_0x58bdae,_0x1ebdc1){var _0x2e45e1={'raw':![],'where':{}};var _0x4fed2a={};var _0x39f168={'count':0x0,'rows':[]};return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x58bdae[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x1ebdc1,null))[_0xfc30('0x19')](function(_0x3cefca){if(_0x3cefca){_0x4fed2a[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db['Disposition'][_0xfc30('0x4b')]);_0x4fed2a['query']=_[_0xfc30('0x4e')](_0x58bdae[_0xfc30('0x4d')]);_0x4fed2a[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x4fed2a[_0xfc30('0x42')],_0x4fed2a[_0xfc30('0x4d')]);_0x2e45e1[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x4fed2a['model'],qs['fields'](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x2e45e1[_0xfc30('0x50')]=_0x2e45e1[_0xfc30('0x50')][_0xfc30('0x52')]?_0x2e45e1[_0xfc30('0x50')]:_0x4fed2a[_0xfc30('0x42')];if(!_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0x2e45e1['limit']=qs[_0xfc30('0x29')](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x2e45e1[_0xfc30('0x2b')]=qs['offset'](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x2e45e1['order']=qs[_0xfc30('0x55')](_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x2e45e1['where']=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x58bdae[_0xfc30('0x4d')],_0x4fed2a[_0xfc30('0x58')]));_0x2e45e1[_0xfc30('0x56')][_0xfc30('0x70')]=_0x3cefca['id'];if(_0x58bdae[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x2e45e1['where']=_[_0xfc30('0x59')](_0x2e45e1[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x2e45e1[_0xfc30('0x50')],function(_0x588b23){var _0x40767a={};_0x40767a[_0x588b23]={'$like':'%'+_0x58bdae['query'][_0xfc30('0x5a')]+'%'};return _0x40767a;})});}_0x2e45e1=_['merge']({},_0x2e45e1,_0x58bdae[_0xfc30('0x5b')]);return db[_0xfc30('0x74')][_0xfc30('0x2a')]({'where':_0x2e45e1['where']})[_0xfc30('0x19')](function(_0x5b631a){_0x39f168[_0xfc30('0x2a')]=_0x5b631a;if(_0x58bdae[_0xfc30('0x4d')]['includeAll']){_0x2e45e1[_0xfc30('0x5d')]=[{'all':!![]}];}return db['Disposition'][_0xfc30('0x5e')](_0x2e45e1);})[_0xfc30('0x19')](function(_0x3d489b){_0x39f168[_0xfc30('0x5f')]=_0x3d489b;return _0x39f168;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x1ebdc1,_0x2e45e1))[_0xfc30('0x23')](handleError(_0x1ebdc1,null));};exports[_0xfc30('0x75')]=function(_0x574d7a,_0x5803bb){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x574d7a[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x5803bb,null))[_0xfc30('0x19')](function(_0x4ac6e5){if(_0x4ac6e5){return _0x4ac6e5[_0xfc30('0x75')](_0x574d7a[_0xfc30('0x4d')][_0xfc30('0x76')]);}})[_0xfc30('0x19')](respondWithStatusCode(_0x5803bb,null))[_0xfc30('0x23')](handleError(_0x5803bb,null));};exports[_0xfc30('0x77')]=function(_0x36972e,_0x4296b3){if(_0x36972e[_0xfc30('0x66')]['id']){delete _0x36972e[_0xfc30('0x66')]['id'];}return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x36972e[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x4296b3,null))[_0xfc30('0x19')](function(_0x13dc0a){if(_0x13dc0a){_0x36972e[_0xfc30('0x66')]['ChatWebsiteId']=_0x13dc0a['id'];return db[_0xfc30('0x78')][_0xfc30('0x63')](_0x36972e['body']);}})[_0xfc30('0x19')](respondWithResult(_0x4296b3,null))[_0xfc30('0x23')](handleError(_0x4296b3,null));};exports[_0xfc30('0x79')]=function(_0x4cb0e0,_0x45faa7){var _0x1724b1={'raw':![],'where':{}};var _0x5439e2={};var _0x11e7df={'count':0x0,'rows':[]};return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x4cb0e0['params']['id']}})['then'](handleEntityNotFound(_0x45faa7,null))['then'](function(_0x25b221){if(_0x25b221){_0x5439e2['model']=_[_0xfc30('0x4e')](db[_0xfc30('0x78')][_0xfc30('0x4b')]);_0x5439e2[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x4cb0e0['query']);_0x5439e2[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x5439e2['model'],_0x5439e2[_0xfc30('0x4d')]);_0x1724b1[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x5439e2[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x1724b1[_0xfc30('0x50')]=_0x1724b1[_0xfc30('0x50')][_0xfc30('0x52')]?_0x1724b1[_0xfc30('0x50')]:_0x5439e2[_0xfc30('0x42')];if(!_0x4cb0e0['query'][_0xfc30('0x53')](_0xfc30('0x73'))){_0x1724b1['limit']=qs[_0xfc30('0x29')](_0x4cb0e0['query'][_0xfc30('0x29')]);_0x1724b1['offset']=qs[_0xfc30('0x2b')](_0x4cb0e0['query'][_0xfc30('0x2b')]);}_0x1724b1[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x1724b1['where']=qs[_0xfc30('0x58')](_['pick'](_0x4cb0e0[_0xfc30('0x4d')],_0x5439e2['filters']));_0x1724b1[_0xfc30('0x56')]['ChatWebsiteId']=_0x25b221['id'];if(_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x1724b1[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x1724b1['where'],{'$or':_[_0xfc30('0x49')](_0x1724b1[_0xfc30('0x50')],function(_0x4c81a8){var _0x165512={};_0x165512[_0x4c81a8]={'$like':'%'+_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x165512;})});}_0x1724b1=_[_0xfc30('0x59')]({},_0x1724b1,_0x4cb0e0['options']);return db['CannedAnswer'][_0xfc30('0x2a')]({'where':_0x1724b1[_0xfc30('0x56')]})[_0xfc30('0x19')](function(_0x5e4330){_0x11e7df[_0xfc30('0x2a')]=_0x5e4330;if(_0x4cb0e0[_0xfc30('0x4d')][_0xfc30('0x5c')]){_0x1724b1[_0xfc30('0x5d')]=[{'all':!![]}];}return db[_0xfc30('0x78')]['findAll'](_0x1724b1);})[_0xfc30('0x19')](function(_0xf03fe4){_0x11e7df[_0xfc30('0x5f')]=_0xf03fe4;return _0x11e7df;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x45faa7,_0x1724b1))['catch'](handleError(_0x45faa7,null));};exports[_0xfc30('0x7a')]=function(_0x1dcc90,_0x2b8cf5){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x1dcc90['params']['id']}})['then'](handleEntityNotFound(_0x2b8cf5,null))[_0xfc30('0x19')](function(_0x172fda){if(_0x172fda){return _0x172fda[_0xfc30('0x7a')](_0x1dcc90[_0xfc30('0x4d')]['ids']);}})['then'](respondWithStatusCode(_0x2b8cf5,null))[_0xfc30('0x23')](handleError(_0x2b8cf5,null));};exports[_0xfc30('0x7b')]=function(_0x372769,_0x1a92b9){_0x372769[_0xfc30('0x66')][_0xfc30('0x7c')]=_0x372769[_0xfc30('0x7d')]['filename'];return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x372769[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x1a92b9,null))['then'](saveUpdates(_0x372769[_0xfc30('0x66')],null))[_0xfc30('0x19')](respondWithResult(_0x1a92b9,null))['catch'](handleError(_0x1a92b9,null));};exports[_0xfc30('0x7e')]=function(_0x2e34aa,_0x4433a4){_0x2e34aa[_0xfc30('0x66')][_0xfc30('0x7f')]=_0x2e34aa[_0xfc30('0x7d')][_0xfc30('0x80')];return db[_0xfc30('0x4a')]['find']({'where':{'id':_0x2e34aa[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x4433a4,null))[_0xfc30('0x19')](saveUpdates(_0x2e34aa[_0xfc30('0x66')],null))[_0xfc30('0x19')](respondWithResult(_0x4433a4,null))[_0xfc30('0x23')](handleError(_0x4433a4,null));};exports[_0xfc30('0x81')]=function(_0xe75982,_0x14f47c){_0xe75982[_0xfc30('0x66')]['customerAvatar']=_0xe75982[_0xfc30('0x7d')][_0xfc30('0x80')];return db[_0xfc30('0x4a')]['find']({'where':{'id':_0xe75982[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x14f47c,null))[_0xfc30('0x19')](saveUpdates(_0xe75982[_0xfc30('0x66')],null))['then'](respondWithResult(_0x14f47c,null))[_0xfc30('0x23')](handleError(_0x14f47c,null));};exports[_0xfc30('0x82')]=function(_0x3fdc25,_0x357e73){_0x3fdc25[_0xfc30('0x66')]['systemAvatar']=_0x3fdc25['file']['filename'];return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x3fdc25[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x357e73,null))[_0xfc30('0x19')](saveUpdates(_0x3fdc25['body'],null))[_0xfc30('0x19')](respondWithResult(_0x357e73,null))[_0xfc30('0x23')](handleError(_0x357e73,null));};exports[_0xfc30('0x83')]=function(_0x4e0f36,_0x5c2701){var _0x5b550a=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x86'));var _0x85e8ab={'where':{'id':_0x4e0f36[_0xfc30('0x61')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x31f566=![];return require('../../config/license/util')[_0xfc30('0x87')]()[_0xfc30('0x19')](function(_0x58c128){if(_0x58c128){_0x31f566=_0x58c128[_0xfc30('0x88')];}})[_0xfc30('0x19')](function(){return db[_0xfc30('0x4a')][_0xfc30('0x62')](_0x85e8ab);})[_0xfc30('0x19')](handleEntityNotFound(_0x5c2701,null))['then'](function(_0x47cb72){if(_0x47cb72){if(!_[_0xfc30('0x89')](_0x47cb72[_0xfc30('0x7c')])){if(fs[_0xfc30('0x8a')](path[_0xfc30('0x84')](config[_0xfc30('0x85')],'server/files/images/logos/',_0x47cb72[_0xfc30('0x7c')]))&&_0x31f566){_0x5b550a=path['join'](config[_0xfc30('0x85')],_0xfc30('0x8b'),_0x47cb72['sitepic']);}}return _0x5c2701[_0xfc30('0x8c')](_0x5b550a);}})[_0xfc30('0x23')](handleError(_0x5c2701,null));};exports[_0xfc30('0x8d')]=function(_0x432352,_0x2c73cc){var _0x43a5b1=path['join'](config[_0xfc30('0x85')],_0xfc30('0x8e'));var _0x44aa46={'where':{'id':_0x432352[_0xfc30('0x61')]['id']},'attributes':['id',_0xfc30('0x7f')],'raw':!![]};return db[_0xfc30('0x4a')][_0xfc30('0x62')](_0x44aa46)[_0xfc30('0x19')](handleEntityNotFound(_0x2c73cc,null))[_0xfc30('0x19')](function(_0x4dd29d){if(_0x4dd29d){if(!_[_0xfc30('0x89')](_0x4dd29d['agentAvatar'])){if(fs[_0xfc30('0x8a')](path['join'](config['root'],'server/files/images/avatars/',_0x4dd29d[_0xfc30('0x7f')]))){_0x43a5b1=path[_0xfc30('0x84')](config['root'],_0xfc30('0x8f'),_0x4dd29d[_0xfc30('0x7f')]);}}return _0x2c73cc[_0xfc30('0x8c')](_0x43a5b1);}})[_0xfc30('0x23')](handleError(_0x2c73cc,null));};exports[_0xfc30('0x90')]=function(_0x3af42d,_0xe67fa5){var _0x9a063d=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x91'));var _0x2f561d={'where':{'id':_0x3af42d[_0xfc30('0x61')]['id']},'attributes':['id',_0xfc30('0x92'),'showCustomerAvatar'],'raw':!![]};return db[_0xfc30('0x4a')][_0xfc30('0x62')](_0x2f561d)['then'](handleEntityNotFound(_0xe67fa5,null))[_0xfc30('0x19')](function(_0x449019){if(_0x449019){if(!_[_0xfc30('0x89')](_0x449019[_0xfc30('0x92')])){if(fs[_0xfc30('0x8a')](path['join'](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x449019[_0xfc30('0x92')]))&&_0x449019[_0xfc30('0x93')]){_0x9a063d=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x449019[_0xfc30('0x92')]);}}return _0xe67fa5[_0xfc30('0x8c')](_0x9a063d);}})[_0xfc30('0x23')](handleError(_0xe67fa5,null));};exports['getSystemAvatar']=function(_0x11745a,_0x59f133){var _0x4639ff=path[_0xfc30('0x84')](config[_0xfc30('0x85')],'server/files/images/avatars/system_avatar.png');var _0x4d175e={'where':{'id':_0x11745a[_0xfc30('0x61')]['id']},'attributes':['id',_0xfc30('0x94')],'raw':!![]};return db['ChatWebsite'][_0xfc30('0x62')](_0x4d175e)[_0xfc30('0x19')](handleEntityNotFound(_0x59f133,null))[_0xfc30('0x19')](function(_0x4fda34){if(_0x4fda34){if(!_[_0xfc30('0x89')](_0x4fda34['systemAvatar'])){if(fs[_0xfc30('0x8a')](path['join'](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x4fda34[_0xfc30('0x94')]))){_0x4639ff=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0x8f'),_0x4fda34['systemAvatar']);}}return _0x59f133['download'](_0x4639ff);}})[_0xfc30('0x23')](handleError(_0x59f133,null));};function checkWebsiteInterval(_0x536002){var _0x512723=_0x536002[_0xfc30('0x95')];if(!_0x512723){return Promise[_0xfc30('0x96')](_0x536002);}var _0x418c79=_0x536002[_0xfc30('0x97')]||undefined;return _0x512723[_0xfc30('0x98')](_0x418c79)['then'](function(_0x220206){if(!_0x220206){throw new APIOutOfIntervalError();}return _0x536002;});}exports[_0xfc30('0x99')]=function(_0x396d3e,_0x5928b8){var _0x71abfb={'body':_0x396d3e['body'],'channel':'chat'};var _0x176430=[];var _0x413415=[];var _0x519f65={};var _0xa0c526=![];if(_0x396d3e[_0xfc30('0x66')]['id']){delete _0x396d3e['body']['id'];}if(_[_0xfc30('0x89')](_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9a')])){throw new APIBadRequestError(_0xfc30('0x9b'));}if(_[_0xfc30('0x89')](_0x396d3e[_0xfc30('0x66')]['mapKey'])){throw new APIBadRequestError(_0xfc30('0x9c'));}if(_[_0xfc30('0x9d')](_0x396d3e[_0xfc30('0x66')][_0xfc30('0x66')])){throw new APIBadRequestError(_0xfc30('0x9e'));}var _0x844552=_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9f')]&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0x3b')];return db[_0xfc30('0xa0')][_0xfc30('0x6e')]()[_0xfc30('0x19')](function(_0x1e88bd){if(!_0x1e88bd){throw new Error(_0xfc30('0xa1'));}_0x176430=Object[_0xfc30('0x4e')](_0x1e88bd)[_0xfc30('0x5a')](function(_0x26212b){return![_0xfc30('0xa2'),_0xfc30('0xa3')]['includes'](_0x26212b);});_0x413415=Object[_0xfc30('0x4e')](_0x1e88bd)[_0xfc30('0x5a')](function(_0x7c57b){return![_0xfc30('0xa2'),'updatedAt',_0xfc30('0xa4'),'ListId']['includes'](_0x7c57b);});if(!_[_0xfc30('0xa5')](_0x413415,_0x396d3e[_0xfc30('0x66')][_0xfc30('0xa6')])){throw new APIBadRequestError(_0xfc30('0xa7')+_0x413415[_0xfc30('0x84')](',\x20'));}_0x519f65[_0x396d3e[_0xfc30('0x66')]['mapKey']]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9a')];})[_0xfc30('0x19')](function(){return db[_0xfc30('0x4a')]['find']({'where':{'id':_0x396d3e[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0xa8')],'as':_0xfc30('0xa9'),'include':[{'model':db[_0xfc30('0xa0')],'as':_0xfc30('0xaa'),'where':_0x519f65,'limit':0x1,'order':[[_0xfc30('0xa3'),_0xfc30('0xab')]]}]},{'model':db['ChatApplication'],'as':_0xfc30('0xac')},{'model':db['Interval'],'as':_0xfc30('0x95'),'include':[{'model':db[_0xfc30('0x95')],'as':_0xfc30('0xad'),'attributes':['id',_0xfc30('0xae')],'raw':!![]}]}]});})[_0xfc30('0x19')](function(_0x3dbe04){if(!_0x3dbe04){throw new APINotFoundError(util[_0xfc30('0x3e')](_0xfc30('0xaf'),_0x396d3e[_0xfc30('0x61')]['id']));}if(_0x844552){return checkWebsiteInterval(_0x3dbe04);}return _0x3dbe04;})['then'](function(_0x27da3f){_0x71abfb[_0xfc30('0xb0')]=_0x27da3f;_0x71abfb[_0xfc30('0xb1')]=_[_0xfc30('0xb2')](_0x27da3f[_0xfc30('0xac')],[_0xfc30('0xb3')],[_0xfc30('0xb4')]);if(_0x71abfb[_0xfc30('0xb0')][_0xfc30('0xac')]){delete _0x71abfb[_0xfc30('0xb0')][_0xfc30('0xac')];}_0x71abfb[_0xfc30('0xb5')]=_0x27da3f[_0xfc30('0xa9')]||{'id':_0x27da3f[_0xfc30('0xb6')]};if(_0x71abfb['list']&&_0x71abfb[_0xfc30('0xb5')]['Contacts']['length']){return _0x71abfb['list'][_0xfc30('0xaa')][0x0];}var _0x34a352=_[_0xfc30('0xb7')](_0x396d3e[_0xfc30('0x66')],{'firstName':_0x396d3e['body'][_0xfc30('0x9a')],'ListId':_0x27da3f[_0xfc30('0xb6')]});_0x34a352[_0x396d3e[_0xfc30('0x66')]['mapKey']]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0x9a')];return db[_0xfc30('0xa0')][_0xfc30('0x63')](_0x34a352,{'fields':_0x176430,'raw':!![]});})[_0xfc30('0x19')](function(_0x3f828f){_0x71abfb[_0xfc30('0xb8')]=_0x3f828f;var _0x1735d9=createInteractionObject(_0x396d3e[_0xfc30('0x61')]['id'],_0x396d3e[_0xfc30('0x66')],_0x396d3e[_0xfc30('0xb9')],_0x3f828f);var _0x558fac={'ChatWebsiteId':_0x396d3e['params']['id']};if(_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')]){_0x558fac['threadId']=_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')];_0x558fac[_0xfc30('0xbb')]=![];return db[_0xfc30('0xbc')]['find']({'where':_0x558fac})[_0xfc30('0x19')](function(_0x59a8f2){if(_0x59a8f2){_0xa0c526=!![];return _0x59a8f2;}else if(!_0x844552&&_0x59a8f2&&_0x59a8f2[_0xfc30('0xbb')]){throw new APIConflictError(_0xfc30('0xbd'));}_0x1735d9[_0xfc30('0xba')]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')];_0x1735d9[_0xfc30('0xbe')]=_0x396d3e[_0xfc30('0x66')][_0xfc30('0xbe')];return db[_0xfc30('0xbc')][_0xfc30('0x63')](_0x1735d9);});}_0x558fac[_0xfc30('0xbf')]=_0x3f828f['id'];if(_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc0')]&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc0')]['id']){_0x558fac['id']=_0x396d3e['body'][_0xfc30('0xc0')]['id'];return db['ChatInteraction']['find']({'where':_0x558fac})[_0xfc30('0x19')](function(_0x25a638){var _0x1c313f=_0x396d3e['body']['customerIp']&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0x3b')];if(!_0x1c313f&&_0x25a638&&_0x25a638[_0xfc30('0xbb')]){throw new APIConflictError('Writing\x20on\x20closed\x20interaction');}else if(_0x25a638){_0xa0c526=!![];return _0x25a638;}else{return db['ChatInteraction'][_0xfc30('0x63')](_0x1735d9);}});}return db[_0xfc30('0xbc')][_0xfc30('0x63')](_0x1735d9);})[_0xfc30('0x19')](function(_0x4659d1){if(!_0xa0c526){return _0x4659d1;}var _0x2d56d2={'from':(_0x71abfb['contact']['firstName']||'')+'\x20'+(_0x71abfb['contact']['lastName']||'')};if(_0x396d3e[_0xfc30('0x66')][_0xfc30('0xba')]&&_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc1')]&&_0x396d3e[_0xfc30('0x66')]['threadId']!=_0x396d3e[_0xfc30('0x66')]['messageId']){_0x2d56d2[_0xfc30('0xba')]=_0x396d3e['body'][_0xfc30('0xc1')];}return _0x4659d1[_0xfc30('0x6d')](_0x2d56d2);})[_0xfc30('0x19')](function(_0x2a7952){_0x71abfb['interaction']=_0x2a7952['get']({'plain':!![]});_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xc2')]=!_0xa0c526;if(_0x71abfb[_0xfc30('0xc0')]['created']){if(_0x71abfb[_0xfc30('0xb0')][_0xfc30('0xc3')]){_0x71abfb[_0xfc30('0xb1')][_0xfc30('0xc4')]({'id':0x0,'priority':_0x71abfb[_0xfc30('0xb1')][_0xfc30('0x52')]+0x1,'app':_0xfc30('0xc5'),'appdata':_0xfc30('0xc6'),'interval':_0xfc30('0xc7')});}}return db[_0xfc30('0xc8')][_0xfc30('0x63')]({'body':_0x396d3e[_0xfc30('0x66')][_0xfc30('0x66')],'ChatWebsiteId':_0x396d3e[_0xfc30('0x61')]['id'],'ChatInteractionId':_0x2a7952['id'],'direction':'in','ContactId':_0x71abfb[_0xfc30('0xb8')]['id'],'AttachmentId':_0x396d3e[_0xfc30('0x66')][_0xfc30('0xc9')]});})[_0xfc30('0x19')](function(_0x1db411){_0x71abfb[_0xfc30('0x21')]=_0x1db411;if(!_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xca')]){return;}return db[_0xfc30('0xcb')]['find']({'attributes':['id','name'],'where':{'id':_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xca')]}});})[_0xfc30('0x19')](function(_0x587da5){if(_0x587da5){_0x71abfb['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xfc30('0xcc'),'appdata':_0x587da5[_0xfc30('0x31')]+','+(_0x71abfb['account'][_0xfc30('0xcd')]||0xa),'interval':_0xfc30('0xc7')});_0x71abfb[_0xfc30('0xce')]=!![];}if(!_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xcf')]){return;}return db[_0xfc30('0xd0')]['find']({'attributes':['id','name'],'where':{'id':_0x71abfb[_0xfc30('0xc0')][_0xfc30('0xcf')]}});})[_0xfc30('0x19')](function(_0x96eda9){if(_0x96eda9){_0x71abfb[_0xfc30('0xb1')][_0xfc30('0xd1')]({'id':0x0,'priority':0x1,'app':_0xfc30('0xd2'),'appdata':_0x96eda9[_0xfc30('0x31')]+','+(_0x71abfb[_0xfc30('0xb0')][_0xfc30('0xd3')]||0x12c),'interval':_0xfc30('0xc7')});}return respondWithRpcPromise(_0xfc30('0xd4'),_0xfc30('0xd5'),_0x71abfb);})[_0xfc30('0x19')](function(_0x160c27){respondWithRpcPromise('EventManager',_0xfc30('0xd6'),{'event':_0xfc30('0x99'),'message':_0x160c27},client9002);return _0x160c27;})[_0xfc30('0x19')](respondWithResult(_0x5928b8,null))[_0xfc30('0x23')](APIHandleError(_0x5928b8));};exports[_0xfc30('0xd7')]=function(_0x24a6f7,_0x2b5449){var _0x3038a1,_0xc1c6e7,_0x103296;var _0x307633=[];var _0x16a2d5={};var _0x1268f4=_0x24a6f7[_0xfc30('0xd8')]||[];var _0x240466=[];var _0x143221;return db[_0xfc30('0xa0')][_0xfc30('0x6e')]()[_0xfc30('0x19')](function(_0x508f5f){if(!_0x508f5f){throw new db[(_0xfc30('0xd9'))]['ValidationError'](_0xfc30('0xda'));}_0x307633=_['difference'](_['keys'](_0x508f5f),[_0xfc30('0xa2'),'updatedAt','CompanyId',_0xfc30('0xb6')]);if(_0x24a6f7['body']['id']){delete _0x24a6f7['body']['id'];}if(_[_0xfc30('0x89')](_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x9a')])){throw _0x2b5449[_0xfc30('0x26')](0x1f4)['send'](new db[(_0xfc30('0xd9'))][(_0xfc30('0xdb'))](_0xfc30('0xdc')));}if(_[_0xfc30('0x89')](_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x66')])||_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x66')]===''){throw _0x2b5449[_0xfc30('0x26')](0x1f4)[_0xfc30('0x32')](new db['Sequelize'][(_0xfc30('0xdb'))](_0xfc30('0xdd')));}if(_[_0xfc30('0x89')](_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')])){throw _0x2b5449[_0xfc30('0x26')](0x1f4)[_0xfc30('0x32')](new db[(_0xfc30('0xd9'))][(_0xfc30('0xdb'))](_0xfc30('0xdf')+_0x307633));}if(!_[_0xfc30('0xa5')](_0x307633,_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')])){throw _0x2b5449[_0xfc30('0x26')](0x1f4)['send'](new db[(_0xfc30('0xd9'))][(_0xfc30('0xdb'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x307633));}_0x16a2d5[_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')]]=_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x9a')];})[_0xfc30('0x19')](function(){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x24a6f7['params']['id']},'include':[{'model':db[_0xfc30('0xa8')],'as':'List'},{'model':db['MailAccount'],'as':_0xfc30('0xe0')}]});})['then'](handleEntityNotFound(_0x2b5449,null))[_0xfc30('0x19')](function(_0x40881b){if(_0x40881b&&_0x40881b['List']){_0xc1c6e7=_0x40881b;var _0x4cca52=_[_0xfc30('0xb7')](_0x24a6f7[_0xfc30('0x66')],{'firstName':_0x24a6f7['body'][_0xfc30('0x9a')],'phone':_0x24a6f7[_0xfc30('0x66')]['from'],'ListId':_0x40881b[_0xfc30('0xb6')]});_0x4cca52[_0x24a6f7[_0xfc30('0x66')][_0xfc30('0xde')]]=_0x24a6f7[_0xfc30('0x66')][_0xfc30('0x9a')];return db[_0xfc30('0xa0')][_0xfc30('0xe1')]({'where':_0x16a2d5,'defaults':_0x4cca52});}})['spread'](function(_0x9b9303){if(_0x9b9303){_0x103296=_0x9b9303;var _0x269cec=fs[_0xfc30('0xe2')](path['join'](config[_0xfc30('0x85')],'server/files/templates/chatOfflineMessage.ejs'),'utf8');var _0x92203=ejs[_0xfc30('0xe3')](_0x269cec,{'body':_[_0xfc30('0xe4')](_0x24a6f7['body'][_0xfc30('0x66')]),'bodyTitle':_0xc1c6e7[_0xfc30('0xe5')]});return db[_0xfc30('0xe6')][_0xfc30('0x63')]({'body':_0x92203,'plainBody':htmlToText[_0xfc30('0xe7')](_0x92203),'ContactId':_0x9b9303['id'],'ChatWebsiteId':_0xc1c6e7['id']});}})[_0xfc30('0x19')](function(_0x108916){_0x143221=_0x108916;if(_0x1268f4[_0xfc30('0x52')]){var _0x376d70=_0x1268f4[_0xfc30('0x49')](function(_0x2a41c7){return{'name':_0x2a41c7[_0xfc30('0xe8')],'basename':_0x2a41c7[_0xfc30('0x80')],'type':_0x2a41c7[_0xfc30('0xe9')],'ChatOfflineMessageId':_0x108916['id']};});_0x240466=_0x376d70[_0xfc30('0x49')](_0x42a055=>{var _0x3ef026={'filename':_0x42a055[_0xfc30('0x31')],'path':path[_0xfc30('0x84')](config['root'],_0xfc30('0xea'),_0xfc30('0xd8'),_0xfc30('0xeb'),_0xfc30('0xec'),_0x42a055[_0xfc30('0xed')])};return _0x3ef026;});if(!_0xc1c6e7[_0xfc30('0xee')]){return db[_0xfc30('0xef')][_0xfc30('0xf0')](function(_0x1ad45d){return db[_0xfc30('0xf1')][_0xfc30('0xf2')](_0x376d70,{'transaction':_0x1ad45d});});}}})[_0xfc30('0x19')](function(){if(_0x143221){_0x3038a1=_0x143221;return db['MailAccount'][_0xfc30('0x72')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xfc30('0xf3'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0xfc30('0xf4'),'raw':!![]}]}]});}})['then'](function(_0x48f72c){if(_0x48f72c&&_0x48f72c['Smtp']&&_0xc1c6e7['forwardOffline']&&_0xc1c6e7['forwardOfflineAddress']){var _0x43e422=_0x48f72c[_0xfc30('0xf5')]();return respondWithRpcPromise('SendMail',_0xfc30('0xf6'),{'account':_0x43e422,'message':{'from':util[_0xfc30('0x3e')](_0xfc30('0xf7'),_0x48f72c[_0xfc30('0x31')],_0x48f72c['email']||_0x48f72c[_0xfc30('0xf3')][_0xfc30('0x68')]),'to':_0xc1c6e7['forwardOfflineAddress'],'subject':_0xc1c6e7[_0xfc30('0xf8')],'html':_0x3038a1['body'],'attachments':_0x240466}},client9003)[_0xfc30('0x19')](function(){return _0x3038a1;})['catch'](function(_0x39544a){logger[_0xfc30('0x20')](_0x39544a);});}})[_0xfc30('0x19')](function(){if(_0xc1c6e7&&_0xc1c6e7[_0xfc30('0xee')]&&_0xc1c6e7['MailAccountId']){var _0x2a7c37=[];if(_0x1268f4['length']){_0x2a7c37=_0x1268f4[_0xfc30('0x49')](function(_0x54a6d5){return{'name':_0x54a6d5[_0xfc30('0xe8')],'basename':_0x54a6d5['filename'],'type':_0x54a6d5[_0xfc30('0xe9')],'ChatOfflineMessageId':_0x143221['id']};});}var _0x473a01;if(!_['isNil'](_0xc1c6e7['subjectOffline'])){var _0x508b31=_[_0xfc30('0x49')](_0x24a6f7[_0xfc30('0x66')],function(_0x5278fc){return _0x5278fc;});var _0x4b7128=_[_0xfc30('0xf9')](_0x508b31)[0x0];var _0x186dea=_[_0xfc30('0xfa')](_0x4b7128,function(_0xe19826){return _0xe19826;});_0x473a01=_0x186dea[0x1][_0xc1c6e7['subjectOffline']];}var _0x286608={'from':_0x103296[_0xfc30('0xfb')],'firstName':_0x103296[_0xfc30('0xfc')],'lastName':_0x103296[_0xfc30('0x39')],'mapKey':_0xfc30('0xfb'),'message':{'from':_0x103296['email'],'to':_0xc1c6e7[_0xfc30('0xe0')][_0xfc30('0xfb')],'cc':'','subject':_[_0xfc30('0x89')](_0x473a01)?_0xc1c6e7[_0xfc30('0xf8')]:_0x473a01,'messageId':'','sentAt':new Date(),'attach':_0x2a7c37[_0xfc30('0x52')],'attachments':_0x2a7c37,'originChannel':_0xfc30('0xfd'),'ChatWebsiteId':_0xc1c6e7['id'],'ChatOfflineMessageId':_0x3038a1['id'],'originTo':_0xc1c6e7[_0xfc30('0xe0')][_0xfc30('0xfb')]},'body':_0x3038a1[_0xfc30('0x66')]};var _0x46377a={'account':{'id':_0xc1c6e7[_0xfc30('0xfe')]},'body':_0x286608,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xfc30('0xff'),'notifyMail',_0x46377a,client9001)[_0xfc30('0x19')](function(){return _0x3038a1;})[_0xfc30('0x23')](function(_0x2285ab){logger[_0xfc30('0x20')](_0x2285ab);});}return;})[_0xfc30('0x19')](function(){if(_0x3038a1){return _0x3038a1;}})['then'](respondWithResult(_0x2b5449,null))[_0xfc30('0x23')](function(){for(var _0x11bbc3 of _0x1268f4){var _0x3e084b=path[_0xfc30('0x84')](config[_0xfc30('0x85')],_0xfc30('0xea'),_0xfc30('0xd8'),_0xfc30('0xeb'),_0xfc30('0xec'),_0x11bbc3[_0xfc30('0x80')]);fs_extra[_0xfc30('0x100')](_0x3e084b)[_0xfc30('0x23')](function(_0x4da83d){logger[_0xfc30('0x20')]('Could\x20not\x20remove\x20attachment\x20file',_0x3e084b,_0x4da83d);});}});};exports['addInteraction']=function(_0x329863,_0xfe439b){return db[_0xfc30('0xbc')][_0xfc30('0x62')]({'where':{'id':_0x329863[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0xfe439b,null))['then'](function(_0x4a7570){if(_0x4a7570){return _0x4a7570['addInteraction'](_0x329863['body'][_0xfc30('0x76')],_[_0xfc30('0x101')](_0x329863[_0xfc30('0x66')],[_0xfc30('0x76'),'id'])||{});}})[_0xfc30('0x19')](respondWithResult(_0xfe439b,null))[_0xfc30('0x23')](handleError(_0xfe439b,null));};exports[_0xfc30('0x102')]=function(_0x14e589,_0x63b746){var _0x2c689c={'raw':![],'where':{}};var _0x48f797={};var _0x442966={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfc30('0x72')]({'where':{'id':_0x14e589[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x63b746,null))['then'](function(_0x2d4f56){if(_0x2d4f56){_0x48f797[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db['ChatInteraction'][_0xfc30('0x4b')]);_0x48f797['query']=_[_0xfc30('0x4e')](_0x14e589[_0xfc30('0x4d')]);_0x48f797[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x48f797['model'],_0x48f797[_0xfc30('0x4d')]);_0x2c689c[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x48f797['model'],qs['fields'](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x2c689c[_0xfc30('0x50')]=_0x2c689c[_0xfc30('0x50')][_0xfc30('0x52')]?_0x2c689c[_0xfc30('0x50')]:_0x48f797[_0xfc30('0x42')];if(!_0x14e589[_0xfc30('0x4d')]['hasOwnProperty']('nolimit')){_0x2c689c['limit']=qs[_0xfc30('0x29')](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x2c689c[_0xfc30('0x2b')]=qs['offset'](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x2c689c[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x14e589[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x2c689c[_0xfc30('0x56')]=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x14e589[_0xfc30('0x4d')],_0x48f797[_0xfc30('0x58')]));_0x2c689c[_0xfc30('0x56')][_0xfc30('0x70')]=_0x2d4f56['id'];if(_0x14e589[_0xfc30('0x4d')]['filter']){_0x2c689c[_0xfc30('0x56')]=_['merge'](_0x2c689c[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x2c689c[_0xfc30('0x50')],function(_0x21b87e){var _0x1c0b20={};_0x1c0b20[_0x21b87e]={'$like':'%'+_0x14e589['query'][_0xfc30('0x5a')]+'%'};return _0x1c0b20;})});}_0x2c689c=_['merge']({},_0x2c689c,_0x14e589[_0xfc30('0x5b')]);return db[_0xfc30('0xbc')][_0xfc30('0x2a')]({'where':_0x2c689c[_0xfc30('0x56')]})['then'](function(_0x1918f7){_0x442966[_0xfc30('0x2a')]=_0x1918f7;if(_0x14e589['query'][_0xfc30('0x5c')]){_0x2c689c[_0xfc30('0x5d')]=[{'model':db['CmContact'],'as':_0xfc30('0x103'),'required':![]},{'model':db[_0xfc30('0xcb')],'as':'Owner','attributes':[_0xfc30('0x31'),_0xfc30('0x104'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfc30('0x31'),_0xfc30('0x105')],'where':_0x14e589['query'][_0xfc30('0x106')]?{'id':_0x14e589[_0xfc30('0x4d')][_0xfc30('0x106')]}:undefined,'required':_0x14e589['query'][_0xfc30('0x106')]?!![]:![]}];}return db['ChatInteraction'][_0xfc30('0x5e')](_0x2c689c);})[_0xfc30('0x19')](function(_0x5aa9f5){_0x442966[_0xfc30('0x5f')]=_0x5aa9f5;return _0x442966;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x63b746,_0x2c689c))['catch'](handleError(_0x63b746,null));};exports[_0xfc30('0x107')]=function(_0x4097fc,_0xfe7bc2){var _0x14d5b3=0x0;var _0x56786e=0x0;var _0x20f1d1=![];var _0x3fa802;var _0x5d93d9;return db['ChatWebsite'][_0xfc30('0x62')]({'where':{'id':_0x4097fc[_0xfc30('0x61')]['id']},'include':[{'model':db[_0xfc30('0x95')],'as':'Interval','include':[{'model':db[_0xfc30('0x95')],'as':'Intervals','attributes':['id','interval']}]}]})[_0xfc30('0x19')](handleEntityNotFound(_0xfe7bc2,null))[_0xfc30('0x19')](function(_0x56882a){if(_0x56882a){_0x3fa802=_0x56882a;return _0x56882a['getProactiveActions']({'raw':!![]});}})['then'](function(_0x530108){if(_0x3fa802){if(_0x530108){_0x5d93d9=_0x530108;}}return require(_0xfc30('0x108'))['getLicense']();})[_0xfc30('0x19')](function(_0x198ae7){if(_0x198ae7){_0x56786e=_0x198ae7[_0xfc30('0x109')];_0x20f1d1=_0x198ae7[_0xfc30('0x88')];}})[_0xfc30('0x19')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x5971fd){_0x14d5b3=_0x5971fd;if(_0x56786e&&_0x5971fd>_0x56786e){return db[_0xfc30('0x10a')][_0xfc30('0x72')]({'where':{'id':0x1}})[_0xfc30('0x19')](function(_0x49c078){if(_0x49c078){_0x49c078['increment'](_0xfc30('0x10b'));}});}})['then'](function(){var _0x8701f4=_0x3fa802[_0xfc30('0x95')];var _0x56f61f=_0x3fa802[_0xfc30('0x97')]||undefined;return _0x8701f4?_0x8701f4[_0xfc30('0x98')](_0x56f61f):!![];})[_0xfc30('0x19')](function(_0x4bdef5){var _0xccc47=fs[_0xfc30('0xe2')](path[_0xfc30('0x84')](config['root'],'server/files/chat/iframe.ejs'),_0xfc30('0x10c'));var _0x5ce529=_0xfc30('0x10d');var _0x74e72f=![];try{const _0x4c261d=new URL(_0x3fa802[_0xfc30('0x65')]);_0x3fa802[_0xfc30('0x65')]=_0x4c261d[_0xfc30('0x10e')];}catch(_0x2b8d21){}var _0xde49d0;if(_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')]){_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')]=_0x4097fc['headers'][_0xfc30('0x3b')][_0xfc30('0x10f')](/\/$/,'');_0xde49d0=wildcardUtils[_0xfc30('0x110')](_0x3fa802[_0xfc30('0x65')],_0x4097fc['headers'][_0xfc30('0x3b')]);}else{_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')]=_0x3fa802[_0xfc30('0x65')];_0xde49d0=!![];}var _0x5ef957={'chatVersion':_0x5ce529,'chatWebsiteAddressOrigin':_0xde49d0?_0x4097fc[_0xfc30('0xb9')]['referer']:_0x3fa802[_0xfc30('0x65')],'remote':_0x3fa802['remote'],'query':querystring[_0xfc30('0x1f')](_['merge'](_0x3fa802[_0xfc30('0x2e')]({'plain':!![]}),{'customerIp':_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x38')]||_0x4097fc[_0xfc30('0xb9')]['x-real-ip']||_0x4097fc['connection'][_0xfc30('0x111')]||_0x4097fc['ip'],'referer':_0x4097fc[_0xfc30('0xb9')][_0xfc30('0x3b')],'openedInteractions':_0x14d5b3,'maxInteractions':_0x56786e,'virtual':_0x20f1d1[_0xfc30('0x109')],'online':_0x4bdef5,'custom':_0x20f1d1,'address':_0xde49d0?_0x4097fc[_0xfc30('0xb9')]['referer']:null}))[_0xfc30('0x10f')](/'/g,'\x5c\x27')};_0xfe7bc2[_0xfc30('0x32')](ejs[_0xfc30('0xe3')](Mustache['render'](_0xccc47,_0x5ef957),{'proactiveActions':_0x5d93d9,'alignment':_0x3fa802[_0xfc30('0x112')],'verticalAlignment':_0x3fa802[_0xfc30('0x113')],'div_color':_0x3fa802[_0xfc30('0x105')],'labelText':_0x3fa802[_0xfc30('0x114')],'text_color':_0x3fa802[_0xfc30('0x115')],'text_button_color':_0x3fa802[_0xfc30('0x116')],'button_color':_0x3fa802[_0xfc30('0x117')],'background_color':_0x3fa802['backgroundColor'],'hideWhenOffline':_0x3fa802['hideWhenOffline'],'intervalId':_0x3fa802['IntervalId'],'isDevelopment':_0x74e72f,'chatVersion':_0x5ce529}));})[_0xfc30('0x23')](handleError(_0xfe7bc2,null));};exports['addApplications']=function(_0xd32274,_0x4aa431){var _0x2f0958=_0xd32274[_0xfc30('0x61')]['id'];var _0x493361=_0xd32274[_0xfc30('0x66')];var _0x11caa2=0xc8;var _0x11d220=null;return db[_0xfc30('0xef')][_0xfc30('0xf0')]({'isolationLevel':db[_0xfc30('0xef')]['Transaction'][_0xfc30('0x118')]['READ_COMMITTED']},function(_0x5a0661){return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x2f0958},'transaction':_0x5a0661})[_0xfc30('0x19')](function(_0x59aa06){if(_0x59aa06){return db[_0xfc30('0x119')][_0xfc30('0x2d')]({'where':{'ChatWebsiteId':_0x2f0958},'transaction':_0x5a0661})[_0xfc30('0x19')](function(){var _0x23851b=_['map'](_0x493361,function(_0x3435eb){_0x3435eb[_0xfc30('0x70')]=_0x2f0958;return _0x3435eb;});return db['ChatApplication'][_0xfc30('0xf2')](_0x23851b,{'transaction':_0x5a0661});});}else{_0x11caa2=0x194;_0x11d220=[];}});})[_0xfc30('0x19')](function(){if(_0x11caa2!==0x194){return db[_0xfc30('0x119')][_0xfc30('0x11a')]({'where':{'ChatWebsiteId':_0x2f0958},'order':_0xfc30('0xb3')})[_0xfc30('0x19')](function(_0x5035df){_0x11d220=_0x5035df;});}})[_0xfc30('0x23')](function(_0x21e58b){_0x11caa2=0x1f4;logger[_0xfc30('0x20')](_0x21e58b[_0xfc30('0x11b')]);if(_0x21e58b['name']){delete _0x21e58b[_0xfc30('0x31')];}_0x11d220=_0x21e58b;})[_0xfc30('0x11c')](function(){if(_0x11d220===null){_0x4aa431[_0xfc30('0x24')](_0x11caa2);}else{if(_0x11caa2===0x1f4){_0x4aa431[_0xfc30('0x26')](_0x11caa2)[_0xfc30('0x32')](_0x11d220);}else{_0x4aa431['status'](_0x11caa2)[_0xfc30('0x27')](_0x11d220);}}});};exports['getApplications']=function(_0x3391ef,_0x17800b){var _0x56be3a={};var _0x357c09={};var _0x25348c;var _0x3e1283;return db['ChatWebsite'][_0xfc30('0x72')]({'where':{'id':_0x3391ef[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x17800b,null))['then'](function(_0x432169){if(_0x432169){_0x25348c=_0x432169;_0x357c09[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db[_0xfc30('0x119')][_0xfc30('0x4b')]);_0x357c09['query']=_[_0xfc30('0x4e')](_0x3391ef[_0xfc30('0x4d')]);_0x357c09[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x357c09['model'],_0x357c09['query']);_0x56be3a[_0xfc30('0x50')]=_['intersection'](_0x357c09[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x3391ef['query']['fields']));_0x56be3a[_0xfc30('0x50')]=_0x56be3a['attributes'][_0xfc30('0x52')]?_0x56be3a['attributes']:_0x357c09[_0xfc30('0x42')];_0x56be3a['order']=qs[_0xfc30('0x55')](_0x3391ef['query']['sort']);_0x56be3a[_0xfc30('0x56')]=qs['filters'](_[_0xfc30('0x57')](_0x3391ef['query'],_0x357c09[_0xfc30('0x58')]));if(_0x3391ef[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x56be3a[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x56be3a['where'],{'$or':_[_0xfc30('0x49')](_0x56be3a['attributes'],function(_0x1e63dd){var _0x7242da={};_0x7242da[_0x1e63dd]={'$like':'%'+_0x3391ef[_0xfc30('0x4d')]['filter']+'%'};return _0x7242da;})});}_0x56be3a=_['merge']({},_0x56be3a,_0x3391ef[_0xfc30('0x5b')]);return _0x25348c[_0xfc30('0x11d')](_0x56be3a);}})[_0xfc30('0x19')](function(_0x3526c9){if(_0x3526c9){_0x3e1283=_0x3526c9['length'];if(!_0x3391ef[_0xfc30('0x4d')]['hasOwnProperty'](_0xfc30('0x73'))){_0x56be3a[_0xfc30('0x29')]=qs['limit'](_0x3391ef[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x56be3a['offset']=qs['offset'](_0x3391ef[_0xfc30('0x4d')][_0xfc30('0x2b')]);}return _0x25348c[_0xfc30('0x11d')](_0x56be3a);}})[_0xfc30('0x19')](function(_0x4cd855){if(_0x4cd855){return _0x4cd855?{'count':_0x3e1283,'rows':_0x4cd855}:null;}})[_0xfc30('0x19')](respondWithResult(_0x17800b,null))[_0xfc30('0x23')](handleError(_0x17800b,null));};exports[_0xfc30('0x11e')]=function(_0x1119e8,_0x2d72b6){return db[_0xfc30('0x11f')][_0xfc30('0x62')]({'where':{'id':_0x1119e8['params']['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x2d72b6,null))[_0xfc30('0x19')](function(_0x1112a7){if(_0x1112a7){return _0x1112a7[_0xfc30('0x11e')](_0x1119e8['body'][_0xfc30('0x76')],_[_0xfc30('0x101')](_0x1119e8[_0xfc30('0x66')],[_0xfc30('0x76'),'id'])||{});}})[_0xfc30('0x19')](respondWithResult(_0x2d72b6,null))['catch'](handleError(_0x2d72b6,null));};exports['getProactiveActions']=function(_0x5d1286,_0x2fc363){var _0x355022={};var _0x495cae={};var _0x214d9e;var _0x505c63;return db[_0xfc30('0x4a')][_0xfc30('0x72')]({'where':{'id':_0x5d1286['params']['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x2fc363,null))[_0xfc30('0x19')](function(_0x413e95){if(_0x413e95){_0x214d9e=_0x413e95;_0x495cae[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db[_0xfc30('0x120')][_0xfc30('0x4b')]);_0x495cae[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x5d1286['query']);_0x495cae[_0xfc30('0x58')]=_[_0xfc30('0x4f')](_0x495cae[_0xfc30('0x42')],_0x495cae[_0xfc30('0x4d')]);_0x355022[_0xfc30('0x50')]=_[_0xfc30('0x4f')](_0x495cae[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x5d1286['query'][_0xfc30('0x51')]));_0x355022[_0xfc30('0x50')]=_0x355022[_0xfc30('0x50')][_0xfc30('0x52')]?_0x355022[_0xfc30('0x50')]:_0x495cae[_0xfc30('0x42')];_0x355022[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x355022[_0xfc30('0x56')]=qs['filters'](_[_0xfc30('0x57')](_0x5d1286['query'],_0x495cae['filters']));if(_0x5d1286['query'][_0xfc30('0x5a')]){_0x355022['where']=_['merge'](_0x355022[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x355022['attributes'],function(_0x18efb5){var _0x1d3700={};_0x1d3700[_0x18efb5]={'$like':'%'+_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x1d3700;})});}_0x355022=_[_0xfc30('0x59')]({},_0x355022,_0x5d1286['options']);return _0x214d9e[_0xfc30('0x121')](_0x355022);}})[_0xfc30('0x19')](function(_0x3f1210){if(_0x3f1210){_0x505c63=_0x3f1210[_0xfc30('0x52')];if(!_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0x355022['limit']=qs[_0xfc30('0x29')](_0x5d1286[_0xfc30('0x4d')]['limit']);_0x355022[_0xfc30('0x2b')]=qs[_0xfc30('0x2b')](_0x5d1286[_0xfc30('0x4d')][_0xfc30('0x2b')]);}return _0x214d9e[_0xfc30('0x121')](_0x355022);}})['then'](function(_0x35b9b6){if(_0x35b9b6){return _0x35b9b6?{'count':_0x505c63,'rows':_0x35b9b6}:null;}})[_0xfc30('0x19')](respondWithResult(_0x2fc363,null))[_0xfc30('0x23')](handleError(_0x2fc363,null));};exports[_0xfc30('0x122')]=function(_0x39e0ff,_0x53a976){var _0x24fff6=_0x39e0ff[_0xfc30('0x4d')][_0xfc30('0x123')]===_0xfc30('0x124')?'offlineForm':'onlineForm';return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'attributes':['id',_0x24fff6],'where':{'id':_0x39e0ff[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x53a976,null))[_0xfc30('0x19')](function(_0x8a14b1){if(_0x8a14b1){var _0x14e69e=_0x8a14b1[_0x24fff6];var _0x4fd953=_0x14e69e&&_0x14e69e[_0xfc30('0x125')]?_0x14e69e[_0xfc30('0x125')]:[];_0x53a976[_0xfc30('0x32')]({'fromKey':_['isNil'](_0x14e69e[_0xfc30('0x126')])?undefined:_0x14e69e[_0xfc30('0x126')],'count':_0x4fd953[_0xfc30('0x52')],'rows':_0x4fd953});}})[_0xfc30('0x23')](handleError(_0x53a976,null));};exports[_0xfc30('0x127')]=function(_0x2d18a8,_0x21f301){var _0x1359ba={'raw':![],'where':{}};var _0x2e48b8={};var _0x4c92e9={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x2d18a8[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x21f301,null))[_0xfc30('0x19')](function(_0x27ecdb){if(_0x27ecdb){_0x2e48b8['model']=_[_0xfc30('0x4e')](db['ChatOfflineMessage'][_0xfc30('0x4b')]);_0x2e48b8[_0xfc30('0x4d')]=_['keys'](_0x2d18a8[_0xfc30('0x4d')]);_0x2e48b8['filters']=_[_0xfc30('0x4f')](_0x2e48b8[_0xfc30('0x42')],_0x2e48b8['query']);_0x1359ba['attributes']=_[_0xfc30('0x4f')](_0x2e48b8[_0xfc30('0x42')],qs[_0xfc30('0x51')](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x51')]));_0x1359ba[_0xfc30('0x50')]=_0x1359ba[_0xfc30('0x50')][_0xfc30('0x52')]?_0x1359ba[_0xfc30('0x50')]:_0x2e48b8[_0xfc30('0x42')];if(!_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0x1359ba[_0xfc30('0x29')]=qs['limit'](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x29')]);_0x1359ba['offset']=qs[_0xfc30('0x2b')](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x2b')]);}_0x1359ba[_0xfc30('0x54')]=qs['sort'](_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x55')]);_0x1359ba[_0xfc30('0x56')]=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x2d18a8[_0xfc30('0x4d')],_0x2e48b8['filters']));_0x1359ba[_0xfc30('0x56')][_0xfc30('0x70')]=_0x27ecdb['id'];if(_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0x1359ba[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0x1359ba[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0x1359ba['attributes'],function(_0x3a695c){var _0x2fa611={};_0x2fa611[_0x3a695c]={'$like':'%'+_0x2d18a8[_0xfc30('0x4d')][_0xfc30('0x5a')]+'%'};return _0x2fa611;})});}_0x1359ba=_[_0xfc30('0x59')]({},_0x1359ba,_0x2d18a8['options']);return db[_0xfc30('0xe6')][_0xfc30('0x2a')]({'where':_0x1359ba[_0xfc30('0x56')]})['then'](function(_0x2bd1e6){_0x4c92e9[_0xfc30('0x2a')]=_0x2bd1e6;if(_0x2d18a8['query'][_0xfc30('0x5c')]){_0x1359ba[_0xfc30('0x5d')]=[{'all':!![]}];}else{_0x1359ba[_0xfc30('0x5d')]=[{'model':db[_0xfc30('0xa0')],'as':_0xfc30('0x103'),'required':![]},{'model':db['Attachment'],'as':_0xfc30('0x128'),'required':![]}];}return db[_0xfc30('0xe6')][_0xfc30('0x5e')](_0x1359ba);})['then'](function(_0x3d1ca4){_0x4c92e9[_0xfc30('0x5f')]=_0x3d1ca4;return _0x4c92e9;});}})[_0xfc30('0x19')](respondWithFilteredResult(_0x21f301,_0x1359ba))[_0xfc30('0x23')](handleError(_0x21f301,null));};exports[_0xfc30('0x129')]=function(_0x25551f,_0x27c2cb){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x25551f[_0xfc30('0x61')]['id']}})[_0xfc30('0x19')](handleEntityNotFound(_0x27c2cb,null))[_0xfc30('0x19')](function(_0x18662a){if(_0x18662a){return _0x18662a[_0xfc30('0x129')](_0x25551f['body'][_0xfc30('0x76')],_[_0xfc30('0x101')](_0x25551f['body'],[_0xfc30('0x76'),'id'])||{})['spread'](function(_0x5eb9b9){for(var _0x1267b7=0x0;_0x1267b7<_0x25551f[_0xfc30('0x66')]['ids'][_0xfc30('0x52')];_0x1267b7+=0x1){socket[_0xfc30('0x12a')](_0xfc30('0x12b'),{'UserId':Number(_0x25551f[_0xfc30('0x66')][_0xfc30('0x76')][_0x1267b7]),'ChatWebsiteId':Number(_0x25551f[_0xfc30('0x61')]['id'])});}return _0x5eb9b9;});}})[_0xfc30('0x19')](respondWithResult(_0x27c2cb,null))[_0xfc30('0x23')](handleError(_0x27c2cb,null));};exports[_0xfc30('0x12c')]=function(_0x7a2fd1,_0x383db9){return db[_0xfc30('0x4a')][_0xfc30('0x62')]({'where':{'id':_0x7a2fd1[_0xfc30('0x61')]['id']}})['then'](handleEntityNotFound(_0x383db9,null))['then'](function(_0x3b3a3c){if(_0x3b3a3c){return _0x3b3a3c['removeAgents'](_0x7a2fd1[_0xfc30('0x4d')]['ids'])[_0xfc30('0x19')](function(){if(_['isArray'](_0x7a2fd1[_0xfc30('0x4d')]['ids'])){for(var _0x5baa80=0x0;_0x5baa80<_0x7a2fd1[_0xfc30('0x4d')]['ids'][_0xfc30('0x52')];_0x5baa80+=0x1){socket[_0xfc30('0x12a')](_0xfc30('0x12d'),{'UserId':Number(_0x7a2fd1[_0xfc30('0x4d')][_0xfc30('0x76')][_0x5baa80]),'ChatWebsiteId':Number(_0x7a2fd1[_0xfc30('0x61')]['id'])});}}else{socket[_0xfc30('0x12a')](_0xfc30('0x12d'),{'UserId':Number(_0x7a2fd1['query'][_0xfc30('0x76')]),'ChatWebsiteId':Number(_0x7a2fd1[_0xfc30('0x61')]['id'])});}});}})[_0xfc30('0x19')](respondWithStatusCode(_0x383db9,null))[_0xfc30('0x23')](handleError(_0x383db9,null));};exports[_0xfc30('0x12e')]=function(_0x66f37d,_0x5bc155){var _0xdbee4b={};var _0x22c9f7={};var _0x1a6c55;var _0x73a15e;return db['ChatWebsite']['findOne']({'where':{'id':_0x66f37d['params']['id']}})['then'](handleEntityNotFound(_0x5bc155,null))[_0xfc30('0x19')](function(_0x27d6ca){if(_0x27d6ca){_0x1a6c55=_0x27d6ca;_0x22c9f7[_0xfc30('0x42')]=_[_0xfc30('0x4e')](db[_0xfc30('0xcb')][_0xfc30('0x4b')]);_0x22c9f7[_0xfc30('0x4d')]=_[_0xfc30('0x4e')](_0x66f37d[_0xfc30('0x4d')]);_0x22c9f7[_0xfc30('0x58')]=_['intersection'](_0x22c9f7[_0xfc30('0x42')],_0x22c9f7['query']);_0xdbee4b[_0xfc30('0x50')]=_['intersection'](_0x22c9f7['model'],qs[_0xfc30('0x51')](_0x66f37d['query'][_0xfc30('0x51')]));_0xdbee4b[_0xfc30('0x50')]=_0xdbee4b[_0xfc30('0x50')][_0xfc30('0x52')]?_0xdbee4b['attributes']:_0x22c9f7['model'];_0xdbee4b[_0xfc30('0x54')]=qs[_0xfc30('0x55')](_0x66f37d['query'][_0xfc30('0x55')]);_0xdbee4b[_0xfc30('0x56')]=qs[_0xfc30('0x58')](_[_0xfc30('0x57')](_0x66f37d[_0xfc30('0x4d')],_0x22c9f7[_0xfc30('0x58')]));if(_0x66f37d[_0xfc30('0x4d')][_0xfc30('0x5a')]){_0xdbee4b[_0xfc30('0x56')]=_[_0xfc30('0x59')](_0xdbee4b[_0xfc30('0x56')],{'$or':_[_0xfc30('0x49')](_0xdbee4b['attributes'],function(_0x2f4379){var _0x55aeae={};_0x55aeae[_0x2f4379]={'$like':'%'+_0x66f37d['query'][_0xfc30('0x5a')]+'%'};return _0x55aeae;})});}_0xdbee4b=_[_0xfc30('0x59')]({},_0xdbee4b,_0x66f37d[_0xfc30('0x5b')]);return _0x1a6c55[_0xfc30('0x12e')](_0xdbee4b);}})[_0xfc30('0x19')](function(_0x24a208){if(_0x24a208){_0x73a15e=_0x24a208['length'];if(!_0x66f37d[_0xfc30('0x4d')][_0xfc30('0x53')](_0xfc30('0x73'))){_0xdbee4b[_0xfc30('0x29')]=qs[_0xfc30('0x29')](_0x66f37d['query'][_0xfc30('0x29')]);_0xdbee4b[_0xfc30('0x2b')]=qs[_0xfc30('0x2b')](_0x66f37d[_0xfc30('0x4d')][_0xfc30('0x2b')]);}return _0x1a6c55['getAgents'](_0xdbee4b);}})[_0xfc30('0x19')](function(_0x122204){if(_0x122204){return _0x122204?{'count':_0x73a15e,'rows':_0x122204}:null;}})[_0xfc30('0x19')](respondWithResult(_0x5bc155,null))['catch'](handleError(_0x5bc155,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 2227459..9a564fd 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 _0x3a5e=['save','update','emit','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x37906a,_0xee412){var _0x512778=function(_0x4c25c8){while(--_0x4c25c8){_0x37906a['push'](_0x37906a['shift']());}};_0x512778(++_0xee412);}(_0x3a5e,0x14c));var _0xe3a5=function(_0x40609f,_0xdbfb71){_0x40609f=_0x40609f-0x0;var _0xcf48a9=_0x3a5e[_0x40609f];return _0xcf48a9;};'use strict';var EventEmitter=require(_0xe3a5('0x0'));var ChatWebsite=require(_0xe3a5('0x1'))['db'][_0xe3a5('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe3a5('0x3')](0x0);var events={'afterCreate':_0xe3a5('0x4'),'afterUpdate':_0xe3a5('0x5'),'afterDestroy':'remove'};function emitEvent(_0xa86e6b){return function(_0x189d9c,_0x46dbe3,_0xff984c){ChatWebsiteEvents[_0xe3a5('0x6')](_0xa86e6b+':'+_0x189d9c['id'],_0x189d9c);ChatWebsiteEvents['emit'](_0xa86e6b,_0x189d9c);_0xff984c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xe3a5('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x0207=['remove','hasOwnProperty','hook','exports','../../mysqldb','save','update'];(function(_0x52bb1e,_0x47c818){var _0x15d57d=function(_0x551cd3){while(--_0x551cd3){_0x52bb1e['push'](_0x52bb1e['shift']());}};_0x15d57d(++_0x47c818);}(_0x0207,0x162));var _0x7020=function(_0x1848c0,_0xbe5c3){_0x1848c0=_0x1848c0-0x0;var _0x137cb5=_0x0207[_0x1848c0];return _0x137cb5;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x7020('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7020('0x1'),'afterUpdate':_0x7020('0x2'),'afterDestroy':_0x7020('0x3')};function emitEvent(_0x15db09){return function(_0x2e62fd,_0x25174b,_0x1066dd){ChatWebsiteEvents['emit'](_0x15db09+':'+_0x2e62fd['id'],_0x2e62fd);ChatWebsiteEvents['emit'](_0x15db09,_0x2e62fd);_0x1066dd(null);};}for(var e in events){if(events[_0x7020('0x4')](e)){var event=events[e];ChatWebsite[_0x7020('0x5')](e,emitEvent(event));}}module[_0x7020('0x6')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index c010f2c..5d22bc1 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 _0xa7da=['chat_websites','lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa7da,0x151));var _0xaa7d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7da[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa7d('0x0'));var util=require(_0xaa7d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xaa7d('0x2'));var BPromise=require(_0xaa7d('0x3'));var rp=require(_0xaa7d('0x4'));var fs=require('fs');var path=require(_0xaa7d('0x5'));var rimraf=require(_0xaa7d('0x6'));var config=require(_0xaa7d('0x7'));var attributes=require(_0xaa7d('0x8'));module[_0xaa7d('0x9')]=function(_0x583cfd,_0x5f5751){return _0x583cfd[_0xaa7d('0xa')]('ChatWebsite',attributes,{'tableName':_0xaa7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc1a=['request-promise','rimraf','./chatWebsite.attributes','exports','define','chat_websites','lodash','util','moment','bluebird'];(function(_0x2ac060,_0x24b1c5){var _0x32174a=function(_0x369d12){while(--_0x369d12){_0x2ac060['push'](_0x2ac060['shift']());}};_0x32174a(++_0x24b1c5);}(_0xdc1a,0x1f0));var _0xadc1=function(_0x5c187a,_0x564285){_0x5c187a=_0x5c187a-0x0;var _0x109ed8=_0xdc1a[_0x5c187a];return _0x109ed8;};'use strict';var _=require(_0xadc1('0x0'));var util=require(_0xadc1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xadc1('0x2'));var BPromise=require(_0xadc1('0x3'));var rp=require(_0xadc1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xadc1('0x5'));var config=require('../../config/environment');var attributes=require(_0xadc1('0x6'));module[_0xadc1('0x7')]=function(_0x52b0fd,_0x19e897){return _0x52b0fd[_0xadc1('0x8')]('ChatWebsite',attributes,{'tableName':_0xadc1('0x9'),'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 590793f..cf347e3 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 _0xfd79=['message','lodash','util','moment','bluebird','../../mysqldb','rpc','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0xfd79,0x7e));var _0x9fd7=function(_0x492140,_0x55c4f4){_0x492140=_0x492140-0x0;var _0x34e813=_0xfd79[_0x492140];return _0x34e813;};'use strict';var _=require(_0x9fd7('0x0'));var util=require(_0x9fd7('0x1'));var moment=require(_0x9fd7('0x2'));var BPromise=require(_0x9fd7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9fd7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fd7('0x5'));var config=require(_0x9fd7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9fd7('0x7')][_0x9fd7('0x8')]({'port':0x232a});config['redis']=_[_0x9fd7('0x9')](config[_0x9fd7('0xa')],{'host':_0x9fd7('0xb'),'port':0x18eb});var socket=require(_0x9fd7('0xc'))(new Redis(config[_0x9fd7('0xa')]));require(_0x9fd7('0xd'))['register'](socket);function respondWithRpcPromise(_0x65d719,_0x1b2573,_0x8ea6bf){return new BPromise(function(_0x116e17,_0x2c47b0){return client[_0x9fd7('0xe')](_0x65d719,_0x8ea6bf)[_0x9fd7('0xf')](function(_0xd9e954){logger[_0x9fd7('0x10')](_0x9fd7('0x11'),_0x1b2573,_0x9fd7('0x12'));logger[_0x9fd7('0x13')](_0x9fd7('0x14'),_0x1b2573,'request\x20sent',JSON[_0x9fd7('0x15')](_0xd9e954));if(_0xd9e954['error']){if(_0xd9e954[_0x9fd7('0x16')][_0x9fd7('0x17')]===0x1f4){logger[_0x9fd7('0x16')](_0x9fd7('0x11'),_0x1b2573,_0xd9e954['error'][_0x9fd7('0x18')]);return _0x2c47b0(_0xd9e954['error']['message']);}logger[_0x9fd7('0x16')](_0x9fd7('0x11'),_0x1b2573,_0xd9e954[_0x9fd7('0x16')]['message']);return _0x116e17(_0xd9e954[_0x9fd7('0x16')][_0x9fd7('0x18')]);}else{logger[_0x9fd7('0x10')](_0x9fd7('0x11'),_0x1b2573,_0x9fd7('0x12'));_0x116e17(_0xd9e954['result'][_0x9fd7('0x18')]);}})['catch'](function(_0x3e60b3){logger[_0x9fd7('0x16')](_0x9fd7('0x11'),_0x1b2573,_0x3e60b3);_0x2c47b0(_0x3e60b3);});});} \ No newline at end of file +var _0xe44d=['moment','bluebird','randomstring','../../config/logger','client','http','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','util'];(function(_0x20b577,_0x38f6d1){var _0xf3e247=function(_0x3db409){while(--_0x3db409){_0x20b577['push'](_0x20b577['shift']());}};_0xf3e247(++_0x38f6d1);}(_0xe44d,0xfb));var _0xde44=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xe44d[_0x2dadb9];return _0x2f0097;};'use strict';var _=require('lodash');var util=require(_0xde44('0x0'));var moment=require(_0xde44('0x1'));var BPromise=require(_0xde44('0x2'));var rs=require(_0xde44('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xde44('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xde44('0x5')][_0xde44('0x6')]({'port':0x232a});config[_0xde44('0x7')]=_['defaults'](config[_0xde44('0x7')],{'host':_0xde44('0x8'),'port':0x18eb});var socket=require(_0xde44('0x9'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0xc8d5fb,_0x3a88f6,_0x486898){return new BPromise(function(_0x29b0c3,_0x3cf7da){return client[_0xde44('0xa')](_0xc8d5fb,_0x486898)[_0xde44('0xb')](function(_0x408e3c){logger[_0xde44('0xc')]('ChatWebsite,\x20%s,\x20%s',_0x3a88f6,_0xde44('0xd'));logger[_0xde44('0xe')](_0xde44('0xf'),_0x3a88f6,'request\x20sent',JSON['stringify'](_0x408e3c));if(_0x408e3c[_0xde44('0x10')]){if(_0x408e3c[_0xde44('0x10')]['code']===0x1f4){logger[_0xde44('0x10')](_0xde44('0x11'),_0x3a88f6,_0x408e3c[_0xde44('0x10')][_0xde44('0x12')]);return _0x3cf7da(_0x408e3c[_0xde44('0x10')][_0xde44('0x12')]);}logger[_0xde44('0x10')](_0xde44('0x11'),_0x3a88f6,_0x408e3c['error']['message']);return _0x29b0c3(_0x408e3c[_0xde44('0x10')]['message']);}else{logger[_0xde44('0xc')](_0xde44('0x11'),_0x3a88f6,'request\x20sent');_0x29b0c3(_0x408e3c[_0xde44('0x13')]['message']);}})[_0xde44('0x14')](function(_0x222d83){logger['error'](_0xde44('0x11'),_0x3a88f6,_0x222d83);_0x3cf7da(_0x222d83);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index a378c00..e129b99 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 _0x7b78=['chatWebsite:','./chatWebsite.events','save','remove','update','removeListener','register'];(function(_0x28286e,_0xd8c672){var _0x3a253e=function(_0x1830e7){while(--_0x1830e7){_0x28286e['push'](_0x28286e['shift']());}};_0x3a253e(++_0xd8c672);}(_0x7b78,0x151));var _0x87b7=function(_0x9e97b0,_0x299854){_0x9e97b0=_0x9e97b0-0x0;var _0x206495=_0x7b78[_0x9e97b0];return _0x206495;};'use strict';var ChatWebsiteEvents=require(_0x87b7('0x0'));var events=[_0x87b7('0x1'),_0x87b7('0x2'),_0x87b7('0x3')];function createListener(_0x691156,_0x328e0d){return function(_0x5ef5cf){_0x328e0d['emit'](_0x691156,_0x5ef5cf);};}function removeListener(_0x3ce43c,_0x46b141){return function(){ChatWebsiteEvents[_0x87b7('0x4')](_0x3ce43c,_0x46b141);};}exports[_0x87b7('0x5')]=function(_0x247627){for(var _0xad5a3c=0x0,_0x20fdcc=events['length'];_0xad5a3c<_0x20fdcc;_0xad5a3c++){var _0x4ce537=events[_0xad5a3c];var _0x5f1150=createListener(_0x87b7('0x6')+_0x4ce537,_0x247627);ChatWebsiteEvents['on'](_0x4ce537,_0x5f1150);}}; \ No newline at end of file +var _0xbc7a=['update','emit','length','chatWebsite:','./chatWebsite.events','save','remove'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xbc7a,0xdd));var _0xabc7=function(_0x2e9f8e,_0x3eafc1){_0x2e9f8e=_0x2e9f8e-0x0;var _0x2e7192=_0xbc7a[_0x2e9f8e];return _0x2e7192;};'use strict';var ChatWebsiteEvents=require(_0xabc7('0x0'));var events=[_0xabc7('0x1'),_0xabc7('0x2'),_0xabc7('0x3')];function createListener(_0x3c85d2,_0x3e53be){return function(_0x1d9e72){_0x3e53be[_0xabc7('0x4')](_0x3c85d2,_0x1d9e72);};}function removeListener(_0x168700,_0x5b750f){return function(){ChatWebsiteEvents['removeListener'](_0x168700,_0x5b750f);};}exports['register']=function(_0x3cd907){for(var _0x77f25d=0x0,_0x425321=events[_0xabc7('0x5')];_0x77f25d<_0x425321;_0x77f25d++){var _0x5d1b8b=events[_0x77f25d];var _0x170c23=createListener(_0xabc7('0x6')+_0x5d1b8b,_0x3cd907);ChatWebsiteEvents['on'](_0x5d1b8b,_0x170c23);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/helpers/wildcard-expressions.js b/server/api/chatWebsite/helpers/wildcard-expressions.js index 8b4c704..ca076de 100644 --- a/server/api/chatWebsite/helpers/wildcard-expressions.js +++ b/server/api/chatWebsite/helpers/wildcard-expressions.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x39cb=['test','replace','([\x5cw]+)','exports','escapeRegExp','url','localhost'];(function(_0x225c16,_0x58fef4){var _0x503a75=function(_0x4409c6){while(--_0x4409c6){_0x225c16['push'](_0x225c16['shift']());}};_0x503a75(++_0x58fef4);}(_0x39cb,0x1bd));var _0xb39c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x39cb[_0x167cc1];return _0x10bc4b;};var escapeRegExp=require('../../../utils/misc')[_0xb39c('0x0')];var URL=require(_0xb39c('0x1'))['URL'];function testWildcardValidity(_0x266bb4){let _0x3aacb4=!![];try{new URL(_0x266bb4['replace']('*',_0xb39c('0x2')));}catch(_0x285eca){_0x3aacb4=![];}return _0x3aacb4&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)[_0xb39c('0x3')](_0x266bb4);}function testWebsiteWithWildcard(_0x2bca14,_0x8a0b3f){let _0x4ae4cf;const _0x32cdcd=escapeRegExp(_0x2bca14)[_0xb39c('0x4')]('\x5c*',_0xb39c('0x5'));try{new URL(_0x2bca14[_0xb39c('0x4')]('\x5c*','localhost'));_0x4ae4cf=new RegExp(_0x32cdcd)['test'](_0x8a0b3f);}catch(_0x41557b){_0x4ae4cf=![];}return _0x4ae4cf;}module[_0xb39c('0x6')]={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file +var _0xa4fb=['../../../utils/misc','escapeRegExp','url','URL','replace','localhost','([\x5cw]+)','test'];(function(_0x1528c6,_0x6d8317){var _0x149cb5=function(_0xfea5b3){while(--_0xfea5b3){_0x1528c6['push'](_0x1528c6['shift']());}};_0x149cb5(++_0x6d8317);}(_0xa4fb,0x150));var _0xba4f=function(_0xfb0cfd,_0x500179){_0xfb0cfd=_0xfb0cfd-0x0;var _0x2fd8aa=_0xa4fb[_0xfb0cfd];return _0x2fd8aa;};var escapeRegExp=require(_0xba4f('0x0'))[_0xba4f('0x1')];var URL=require(_0xba4f('0x2'))[_0xba4f('0x3')];function testWildcardValidity(_0x569bf7){let _0x5d2269=!![];try{new URL(_0x569bf7[_0xba4f('0x4')]('*',_0xba4f('0x5')));}catch(_0x27a519){_0x5d2269=![];}return _0x5d2269&&new RegExp(/(http(s)?):\/\/(\*|(((\*\.)+)?([a-zA-Z0-9\-_]+\.){0,}([a-zA-Z0-9\-_]+)))(:[\d]+)?\/?$/)['test'](_0x569bf7);}function testWebsiteWithWildcard(_0x413f97,_0x3dc285){let _0x379b0f;const _0x18baa8=escapeRegExp(_0x413f97)[_0xba4f('0x4')]('\x5c*',_0xba4f('0x6'));try{new URL(_0x413f97[_0xba4f('0x4')]('\x5c*',_0xba4f('0x5')));_0x379b0f=new RegExp(_0x18baa8)[_0xba4f('0x7')](_0x3dc285);}catch(_0x27f65a){_0x379b0f=![];}return _0x379b0f;}module['exports']={'testWebsiteWithWildcard':testWebsiteWithWildcard,'testWildcardValidity':testWildcardValidity}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a320534..e465df3 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 _0xb32f=['server/files','ensureDir','replace','extname','/:id/offline','any','offline','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','multer','util','path','express','Router','fs-extra','./chatWebsite.controller','get','index','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','addAnswer','join','format','now','originalname','file','diskStorage','root','server/files/images/avatars/','%s-%s','single','addAvatar','/:id/customer_avatar','/:id/notify'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xb32f,0x1ee));var _0xfb32=function(_0x555786,_0x2770c5){_0x555786=_0x555786-0x0;var _0x5e594d=_0xb32f[_0x555786];return _0x5e594d;};'use strict';var multer=require(_0xfb32('0x0'));var util=require(_0xfb32('0x1'));var path=require(_0xfb32('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb32('0x3'));var router=express[_0xfb32('0x4')]();var fs_extra=require(_0xfb32('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xfb32('0x6'));router[_0xfb32('0x7')]('/',auth['isAuthenticated'](),controller[_0xfb32('0x8')]);router[_0xfb32('0x7')]('/describe',auth[_0xfb32('0x9')](),controller[_0xfb32('0xa')]);router['get']('/:id',auth[_0xfb32('0x9')](),controller[_0xfb32('0xb')]);router[_0xfb32('0x7')](_0xfb32('0xc'),auth[_0xfb32('0x9')](),controller[_0xfb32('0xd')]);router[_0xfb32('0x7')](_0xfb32('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xfb32('0x7')](_0xfb32('0xf'),controller[_0xfb32('0x10')]);router[_0xfb32('0x7')](_0xfb32('0x11'),controller[_0xfb32('0x12')]);router[_0xfb32('0x7')]('/:id/customer_avatar',controller[_0xfb32('0x13')]);router[_0xfb32('0x7')](_0xfb32('0x14'),controller[_0xfb32('0x15')]);router[_0xfb32('0x7')](_0xfb32('0x16'),auth['isAuthenticated'](),controller[_0xfb32('0x17')]);router[_0xfb32('0x7')]('/:id/snippet',controller[_0xfb32('0x18')]);router[_0xfb32('0x7')](_0xfb32('0x19'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x1a')]);router[_0xfb32('0x7')]('/:id/proactive_actions',auth[_0xfb32('0x9')](),controller[_0xfb32('0x1b')]);router[_0xfb32('0x7')]('/:id/fields',controller[_0xfb32('0x1c')]);router[_0xfb32('0x7')](_0xfb32('0x1d'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x1e')]);router[_0xfb32('0x7')](_0xfb32('0x1f'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x20')]);router['post']('/',auth[_0xfb32('0x9')](),controller[_0xfb32('0x21')]);router[_0xfb32('0x22')](_0xfb32('0xc'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x23')]);router['post'](_0xfb32('0xe'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x238055,_0x530b9c,_0x51d261){_0x51d261(null,path[_0xfb32('0x25')](config['root'],'server/files/images/logos/'));},'filename':function(_0x59fcfe,_0x4d5c56,_0x34f688){_0x34f688(null,util[_0xfb32('0x26')]('%s-%s',Date[_0xfb32('0x27')](),_0x4d5c56[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')](_0xfb32('0xf'),upload['single'](_0xfb32('0x29')),controller['addLogo']);var upload=multer({'storage':multer[_0xfb32('0x2a')]({'destination':function(_0x5f4c0e,_0x4237cb,_0x2e803d){_0x2e803d(null,path[_0xfb32('0x25')](config[_0xfb32('0x2b')],_0xfb32('0x2c')));},'filename':function(_0x1184a3,_0x396902,_0x5746e4){_0x5746e4(null,util['format'](_0xfb32('0x2d'),Date['now'](),_0x396902[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')]('/:id/avatar',upload[_0xfb32('0x2e')](_0xfb32('0x29')),controller[_0xfb32('0x2f')]);var upload=multer({'storage':multer[_0xfb32('0x2a')]({'destination':function(_0x5caaf3,_0x2863b1,_0x3f7090){_0x3f7090(null,path['join'](config[_0xfb32('0x2b')],_0xfb32('0x2c')));},'filename':function(_0x2f8818,_0x22dc63,_0x22d55c){_0x22d55c(null,util[_0xfb32('0x26')](_0xfb32('0x2d'),Date['now'](),_0x22dc63[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')](_0xfb32('0x30'),upload['single'](_0xfb32('0x29')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2df540,_0xf52ea9,_0x31cca7){_0x31cca7(null,path[_0xfb32('0x25')](config['root'],_0xfb32('0x2c')));},'filename':function(_0x123d22,_0x2b9455,_0x39ece0){_0x39ece0(null,util[_0xfb32('0x26')](_0xfb32('0x2d'),Date[_0xfb32('0x27')](),_0x2b9455[_0xfb32('0x28')]));}})});router[_0xfb32('0x22')](_0xfb32('0x14'),upload[_0xfb32('0x2e')](_0xfb32('0x29')),controller['addSystemAvatar']);router[_0xfb32('0x22')](_0xfb32('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xfb32('0x2a')]({'destination':function(_0x5cb1cf,_0x112aee,_0x52b3ff){const _0x1bd11c=path[_0xfb32('0x25')](config[_0xfb32('0x2b')],_0xfb32('0x32'),'attachments','offline-chat');fs_extra[_0xfb32('0x33')](_0x1bd11c,function(){_0x52b3ff(null,_0x1bd11c);});},'filename':function(_0x197b97,_0x32734f,_0x43c739){const _0x11665b=_0x32734f[_0xfb32('0x28')][_0xfb32('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x4aa4d6=path[_0xfb32('0x35')](_0x11665b);const _0x33562c=Date[_0xfb32('0x27')]()+'-'+_0x11665b[_0xfb32('0x34')](_0x4aa4d6,'')+_0x4aa4d6;_0x43c739(null,_0x33562c);}})});router[_0xfb32('0x22')](_0xfb32('0x36'),offlineUploadMulter[_0xfb32('0x37')](),controller[_0xfb32('0x38')]);router[_0xfb32('0x22')](_0xfb32('0x16'),auth[_0xfb32('0x9')](),controller['addInteraction']);router[_0xfb32('0x22')](_0xfb32('0x19'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x39')]);router['post'](_0xfb32('0x3a'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x3b')]);router[_0xfb32('0x22')](_0xfb32('0x1f'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x3c')]);router[_0xfb32('0x3d')](_0xfb32('0x3e'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x3f')]);router['delete']('/:id',auth[_0xfb32('0x9')](),controller[_0xfb32('0x40')]);router[_0xfb32('0x41')](_0xfb32('0xc'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x42')]);router['delete'](_0xfb32('0xe'),auth[_0xfb32('0x9')](),controller[_0xfb32('0x43')]);router[_0xfb32('0x41')](_0xfb32('0x1f'),auth[_0xfb32('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x4777=['/:id/system_avatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/users','getAgents','post','create','diskStorage','join','root','server/files/images/logos/','format','%s-%s','originalname','/:id/logo','single','file','addLogo','server/files/images/avatars/','now','addAvatar','addCustomerAvatar'];(function(_0x47c8ef,_0x3395d5){var _0x4dd012=function(_0x2ee9b0){while(--_0x2ee9b0){_0x47c8ef['push'](_0x47c8ef['shift']());}};_0x4dd012(++_0x3395d5);}(_0x4777,0x18f));var _0x7477=function(_0x903228,_0x42c429){_0x903228=_0x903228-0x0;var _0xcec81d=_0x4777[_0x903228];return _0xcec81d;};'use strict';var multer=require('multer');var util=require(_0x7477('0x0'));var path=require(_0x7477('0x1'));var timeout=require(_0x7477('0x2'));var express=require(_0x7477('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7477('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7477('0x5'));var controller=require(_0x7477('0x6'));router[_0x7477('0x7')]('/',auth[_0x7477('0x8')](),controller['index']);router['get'](_0x7477('0x9'),auth[_0x7477('0x8')](),controller[_0x7477('0xa')]);router[_0x7477('0x7')](_0x7477('0xb'),auth[_0x7477('0x8')](),controller[_0x7477('0xc')]);router['get'](_0x7477('0xd'),auth[_0x7477('0x8')](),controller[_0x7477('0xe')]);router[_0x7477('0x7')](_0x7477('0xf'),auth[_0x7477('0x8')](),controller[_0x7477('0x10')]);router[_0x7477('0x7')]('/:id/logo',controller[_0x7477('0x11')]);router[_0x7477('0x7')](_0x7477('0x12'),controller[_0x7477('0x13')]);router[_0x7477('0x7')](_0x7477('0x14'),controller[_0x7477('0x15')]);router[_0x7477('0x7')]('/:id/system_avatar',controller[_0x7477('0x16')]);router[_0x7477('0x7')](_0x7477('0x17'),auth['isAuthenticated'](),controller[_0x7477('0x18')]);router[_0x7477('0x7')](_0x7477('0x19'),controller[_0x7477('0x1a')]);router[_0x7477('0x7')](_0x7477('0x1b'),auth[_0x7477('0x8')](),controller[_0x7477('0x1c')]);router[_0x7477('0x7')](_0x7477('0x1d'),auth[_0x7477('0x8')](),controller[_0x7477('0x1e')]);router[_0x7477('0x7')](_0x7477('0x1f'),controller['getFields']);router[_0x7477('0x7')]('/:id/offline_messages',auth['isAuthenticated'](),controller['getOfflineMessages']);router['get'](_0x7477('0x20'),auth[_0x7477('0x8')](),controller[_0x7477('0x21')]);router[_0x7477('0x22')]('/',auth[_0x7477('0x8')](),controller[_0x7477('0x23')]);router[_0x7477('0x22')](_0x7477('0xd'),auth[_0x7477('0x8')](),controller['addDisposition']);router[_0x7477('0x22')](_0x7477('0xf'),auth[_0x7477('0x8')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x7477('0x24')]({'destination':function(_0x1321ff,_0x3d8e3d,_0x2c43eb){_0x2c43eb(null,path[_0x7477('0x25')](config[_0x7477('0x26')],_0x7477('0x27')));},'filename':function(_0x5ab427,_0x594859,_0x79358d){_0x79358d(null,util[_0x7477('0x28')](_0x7477('0x29'),Date['now'](),_0x594859[_0x7477('0x2a')]));}})});router[_0x7477('0x22')](_0x7477('0x2b'),upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5b607e,_0x94817c,_0x53783e){_0x53783e(null,path[_0x7477('0x25')](config[_0x7477('0x26')],_0x7477('0x2f')));},'filename':function(_0x56e815,_0x28f7e7,_0x2fab98){_0x2fab98(null,util['format'](_0x7477('0x29'),Date[_0x7477('0x30')](),_0x28f7e7[_0x7477('0x2a')]));}})});router[_0x7477('0x22')](_0x7477('0x12'),upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x31')]);var upload=multer({'storage':multer[_0x7477('0x24')]({'destination':function(_0x47032e,_0x56dcfd,_0x713230){_0x713230(null,path['join'](config['root'],_0x7477('0x2f')));},'filename':function(_0x491d54,_0x715956,_0x42a39){_0x42a39(null,util['format'](_0x7477('0x29'),Date[_0x7477('0x30')](),_0x715956['originalname']));}})});router[_0x7477('0x22')]('/:id/customer_avatar',upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x32')]);var upload=multer({'storage':multer[_0x7477('0x24')]({'destination':function(_0x5e355a,_0x415509,_0x2dad9c){_0x2dad9c(null,path[_0x7477('0x25')](config[_0x7477('0x26')],'server/files/images/avatars/'));},'filename':function(_0x3e7959,_0x3a33f3,_0x22ff31){_0x22ff31(null,util[_0x7477('0x28')](_0x7477('0x29'),Date['now'](),_0x3a33f3[_0x7477('0x2a')]));}})});router[_0x7477('0x22')](_0x7477('0x33'),upload[_0x7477('0x2c')](_0x7477('0x2d')),controller[_0x7477('0x34')]);router[_0x7477('0x22')](_0x7477('0x35'),controller[_0x7477('0x36')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x13d777,_0x1cac2b,_0x2c1417){const _0x521f94=path['join'](config['root'],_0x7477('0x37'),_0x7477('0x38'),_0x7477('0x39'));fs_extra[_0x7477('0x3a')](_0x521f94,function(){_0x2c1417(null,_0x521f94);});},'filename':function(_0x4850c6,_0xe476c2,_0x284f66){const _0x140976=_0xe476c2[_0x7477('0x2a')][_0x7477('0x3b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3ca7e7=path[_0x7477('0x3c')](_0x140976);const _0x186ecd=Date[_0x7477('0x30')]()+'-'+_0x140976[_0x7477('0x3b')](_0x3ca7e7,'')+_0x3ca7e7;_0x284f66(null,_0x186ecd);}})});router[_0x7477('0x22')](_0x7477('0x3d'),offlineUploadMulter[_0x7477('0x3e')](),controller[_0x7477('0x3f')]);router['post']('/:id/interactions',auth['isAuthenticated'](),controller[_0x7477('0x40')]);router[_0x7477('0x22')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7477('0x41')]);router['post'](_0x7477('0x1d'),auth[_0x7477('0x8')](),controller[_0x7477('0x42')]);router[_0x7477('0x22')](_0x7477('0x20'),auth[_0x7477('0x8')](),controller[_0x7477('0x43')]);router[_0x7477('0x44')](_0x7477('0xb'),auth[_0x7477('0x8')](),controller[_0x7477('0x45')]);router[_0x7477('0x46')]('/:id',auth[_0x7477('0x8')](),controller[_0x7477('0x47')]);router['delete'](_0x7477('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x7477('0x46')]('/:id/canned_answers',auth[_0x7477('0x8')](),controller[_0x7477('0x48')]);router[_0x7477('0x46')](_0x7477('0x20'),auth['isAuthenticated'](),controller[_0x7477('0x49')]);module[_0x7477('0x4a')]=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index fef0cef..5e32e27 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfa56=['beaver-logger/server','express','../components/auth/service','Router','env','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','exports'];(function(_0x568ae7,_0x2b5fa3){var _0x257050=function(_0x43e8df){while(--_0x43e8df){_0x568ae7['push'](_0x568ae7['shift']());}};_0x257050(++_0x2b5fa3);}(_0xfa56,0x10e));var _0x6fa5=function(_0x38d759,_0x3a55b9){_0x38d759=_0x38d759-0x0;var _0x379e54=_0xfa56[_0x38d759];return _0x379e54;};var beaverLogger=require(_0x6fa5('0x0'));var express=require(_0x6fa5('0x1'));var auth=require(_0x6fa5('0x2'));var config=require('../config/environment');var router=express[_0x6fa5('0x3')]();var isProduction=config[_0x6fa5('0x4')]==='production'||![];function clientSideLogs(_0x2bb699,_0x3623b8,_0x4c77a8){var _0x57a36f=_0x2bb699['app'][_0x6fa5('0x5')](_0x6fa5('0x6'));if(!_0x57a36f){throw new Error(_0x6fa5('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x6fa5('0x8'),'logger':_0x57a36f,'enableCors':!isProduction})(_0x2bb699,_0x3623b8,_0x4c77a8);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x6fa5('0x9')]=router; \ No newline at end of file +var _0xb85f=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','env','production','get','client-side-logger'];(function(_0x4b420a,_0x37a42f){var _0x5e6392=function(_0x58c14e){while(--_0x58c14e){_0x4b420a['push'](_0x4b420a['shift']());}};_0x5e6392(++_0x37a42f);}(_0xb85f,0x10d));var _0xfb85=function(_0x444b29,_0x127582){_0x444b29=_0x444b29-0x0;var _0x428314=_0xb85f[_0x444b29];return _0x428314;};var beaverLogger=require(_0xfb85('0x0'));var express=require(_0xfb85('0x1'));var auth=require('../components/auth/service');var config=require('../config/environment');var router=express['Router']();var isProduction=config[_0xfb85('0x2')]===_0xfb85('0x3')||![];function clientSideLogs(_0x25e064,_0x9dda23,_0x1494cd){var _0x5ada75=_0x25e064['app'][_0xfb85('0x4')](_0xfb85('0x5'));if(!_0x5ada75){throw new Error(_0xfb85('0x6'));}return beaverLogger[_0xfb85('0x7')]({'uri':_0xfb85('0x8'),'logger':_0x5ada75,'enableCors':!isProduction})(_0x25e064,_0x9dda23,_0x1494cd);}router[_0xfb85('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0xfb85('0xa')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index d2a70a3..5ffd190 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 _0x4357=['MicrosoftAzure\x20=>\x20refresh_token','sequelize','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4357,0x105));var _0x7435=function(_0x200ced,_0x503efa){_0x200ced=_0x200ced-0x0;var _0x28e175=_0x4357[_0x200ced];return _0x28e175;};'use strict';var Sequelize=require(_0x7435('0x0'));module['exports']={'name':{'type':Sequelize[_0x7435('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x7435('0x2')](_0x7435('0x3'),_0x7435('0x4'),_0x7435('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x7435('0x2')](_0x7435('0x6'),_0x7435('0x7'))},'data1':{'type':Sequelize[_0x7435('0x1')],'comment':_0x7435('0x8')},'data2':{'type':Sequelize[_0x7435('0x1')],'comment':_0x7435('0x9')},'data3':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0x7435('0x1')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x7435('0xa')],'comment':_0x7435('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x7435('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0x4584=['MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','ENUM','AmazonAWS','Google','Outlook365','Dynamics365','STRING'];(function(_0x1d53cb,_0x4cf3f1){var _0x1de5fe=function(_0x438bbf){while(--_0x438bbf){_0x1d53cb['push'](_0x1d53cb['shift']());}};_0x1de5fe(++_0x4cf3f1);}(_0x4584,0x18c));var _0x4458=function(_0x335e51,_0x3c63fb){_0x335e51=_0x335e51-0x0;var _0x11637f=_0x4584[_0x335e51];return _0x11637f;};'use strict';var Sequelize=require(_0x4458('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x4458('0x1')](_0x4458('0x2'),_0x4458('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x4458('0x1')](_0x4458('0x4'),_0x4458('0x5'))},'data1':{'type':Sequelize[_0x4458('0x6')],'comment':_0x4458('0x7')},'data2':{'type':Sequelize[_0x4458('0x6')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x4458('0x6')],'comment':_0x4458('0x8')},'data4':{'type':Sequelize[_0x4458('0x6')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x4458('0x9')],'comment':_0x4458('0xa')},'data6':{'type':Sequelize[_0x4458('0x9')],'comment':_0x4458('0xb')},'data7':{'type':Sequelize[_0x4458('0x9')],'comment':_0x4458('0xc')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 3e8b0d0..2b7253c 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 _0xcf4c=['sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','padEnd','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','service','MicrosoftAzure','catch','show','params','keys','intersection','length','find','decryptString','data3','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','parse','base64','toString','ascii','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','code','data5','access_token','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','stringify','ioredis','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost'];(function(_0x3f2deb,_0x4df580){var _0x48760a=function(_0xae8d56){while(--_0xae8d56){_0x3f2deb['push'](_0x3f2deb['shift']());}};_0x48760a(++_0x4df580);}(_0xcf4c,0x1d6));var _0xccf4=function(_0xe7520a,_0x5c2098){_0xe7520a=_0xe7520a-0x0;var _0x54f45b=_0xcf4c[_0xe7520a];return _0x54f45b;};'use strict';var _=require('lodash');var Redis=require(_0xccf4('0x0'));var qs=require('../../components/parsers/qs');var encryptor=require(_0xccf4('0x1'));var config=require(_0xccf4('0x2'));var logger=require(_0xccf4('0x3'))(_0xccf4('0x4'));var db=require(_0xccf4('0x5'))['db'];var oauth=require(_0xccf4('0x6'));config['redis']=_[_0xccf4('0x7')](config[_0xccf4('0x8')],{'host':_0xccf4('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xccf4('0x8')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x117556,_0x5d51e4){_0x5d51e4=_0x5d51e4||0xcc;return function(_0x40f354){if(_0x40f354){return _0x117556[_0xccf4('0xa')](_0x5d51e4);}return _0x117556['status'](_0x5d51e4)[_0xccf4('0xb')]();};}function respondWithResult(_0x10f37b,_0x53b97e){_0x53b97e=_0x53b97e||0xc8;return function(_0x1dbacf){if(_0x1dbacf){return _0x10f37b[_0xccf4('0xc')](_0x53b97e)[_0xccf4('0xd')](_0x1dbacf);}};}function respondWithFilteredResult(_0x11dd5c,_0x499152){return function(_0x4624b1){if(_0x4624b1){var _0x345e2a=typeof _0x499152[_0xccf4('0xe')]==='undefined'&&typeof _0x499152[_0xccf4('0xf')]===_0xccf4('0x10');var _0x588833=_0x4624b1[_0xccf4('0x11')];var _0x50415e=_0x345e2a?0x0:_0x499152['offset'];var _0x30fa7a=_0x345e2a?_0x4624b1[_0xccf4('0x11')]:_0x499152[_0xccf4('0xe')]+_0x499152[_0xccf4('0xf')];var _0x356190;if(_0x30fa7a>=_0x588833){_0x30fa7a=_0x588833;_0x356190=0xc8;}else{_0x356190=0xce;}_0x11dd5c['status'](_0x356190);return _0x11dd5c[_0xccf4('0x12')](_0xccf4('0x13'),_0x50415e+'-'+_0x30fa7a+'/'+_0x588833)[_0xccf4('0xd')](_0x4624b1);}return null;};}function saveUpdates(_0xacb5fb){return function(_0x5ebafc){if(_0x5ebafc){return _0x5ebafc[_0xccf4('0x14')](_0xacb5fb)[_0xccf4('0x15')](function(_0x4e7500){return _0x4e7500;});}return null;};}function removeEntity(_0x55d766){return function(_0x1727c2){if(_0x1727c2){return _0x1727c2[_0xccf4('0x16')]()[_0xccf4('0x15')](function(){_0x55d766[_0xccf4('0xc')](0xcc)[_0xccf4('0xb')]();});}};}function handleEntityNotFound(_0x2c1f6){return function(_0x2c2bce){if(!_0x2c2bce){_0x2c1f6[_0xccf4('0xa')](0x194);}return _0x2c2bce;};}function handleError(_0x345c7c,_0x637fcd){_0x637fcd=_0x637fcd||0x1f4;return function(_0x75e4db){logger[_0xccf4('0x17')](_0x75e4db[_0xccf4('0x18')]);if(_0x75e4db[_0xccf4('0x19')]){delete _0x75e4db[_0xccf4('0x19')];}_0x345c7c['status'](_0x637fcd)['send'](_0x75e4db);};}function maskClientSecret(_0x386e90){return _[_0xccf4('0x1a')](_0x386e90['slice'](0x0,0x3),0x14,'*');}exports[_0xccf4('0x1b')]=function(_0x1275e6,_0x2d8a7d){var _0x18fe1e={},_0x463cec={},_0x2e2e48={'count':0x0,'rows':[]};var _0x24f608=_['map'](db[_0xccf4('0x1c')][_0xccf4('0x1d')],function(_0x3bb9ea){return{'name':_0x3bb9ea[_0xccf4('0x1e')],'type':_0x3bb9ea[_0xccf4('0x1f')][_0xccf4('0x20')]};});_0x463cec[_0xccf4('0x21')]=_[_0xccf4('0x22')](_0x24f608,_0xccf4('0x19'));_0x463cec[_0xccf4('0x23')]=_['keys'](_0x1275e6[_0xccf4('0x23')]);_0x463cec[_0xccf4('0x24')]=_['intersection'](_0x463cec[_0xccf4('0x21')],_0x463cec[_0xccf4('0x23')]);_0x18fe1e[_0xccf4('0x25')]=_['intersection'](_0x463cec[_0xccf4('0x21')],qs['fields'](_0x1275e6['query'][_0xccf4('0x26')]));_0x18fe1e[_0xccf4('0x25')]=_0x18fe1e['attributes']['length']?_0x18fe1e[_0xccf4('0x25')]:_0x463cec[_0xccf4('0x21')];if(!_0x1275e6[_0xccf4('0x23')][_0xccf4('0x27')](_0xccf4('0x28'))){_0x18fe1e['limit']=qs['limit'](_0x1275e6[_0xccf4('0x23')]['limit']);_0x18fe1e[_0xccf4('0xe')]=qs[_0xccf4('0xe')](_0x1275e6[_0xccf4('0x23')][_0xccf4('0xe')]);}_0x18fe1e[_0xccf4('0x29')]=qs['sort'](_0x1275e6[_0xccf4('0x23')][_0xccf4('0x2a')]);_0x18fe1e[_0xccf4('0x2b')]=qs[_0xccf4('0x24')](_[_0xccf4('0x2c')](_0x1275e6[_0xccf4('0x23')],_0x463cec[_0xccf4('0x24')]),_0x24f608);if(_0x1275e6[_0xccf4('0x23')][_0xccf4('0x2d')]){_0x18fe1e[_0xccf4('0x2b')]=_[_0xccf4('0x2e')](_0x18fe1e[_0xccf4('0x2b')],{'$or':_['map'](_0x24f608,function(_0x326f41){if(_0x326f41[_0xccf4('0x1f')]!==_0xccf4('0x2f')){var _0x26b7b4={};_0x26b7b4[_0x326f41[_0xccf4('0x19')]]={'$like':'%'+_0x1275e6['query'][_0xccf4('0x2d')]+'%'};return _0x26b7b4;}})});}_0x18fe1e=_[_0xccf4('0x2e')]({},_0x18fe1e,_0x1275e6[_0xccf4('0x30')]);var _0x47d43d={'where':_0x18fe1e[_0xccf4('0x2b')]};return db[_0xccf4('0x1c')]['count'](_0x47d43d)[_0xccf4('0x15')](function(_0x1e9659){_0x2e2e48['count']=_0x1e9659;if(_0x1275e6[_0xccf4('0x23')][_0xccf4('0x31')]){_0x18fe1e[_0xccf4('0x32')]=[{'all':!![]}];}return db[_0xccf4('0x1c')]['findAll'](_0x18fe1e);})['then'](function(_0x4ee9aa){_0x2e2e48[_0xccf4('0x33')]=_[_0xccf4('0x22')](_0x4ee9aa,function(_0x5c39a7){if(_0x5c39a7[_0xccf4('0x34')]===_0xccf4('0x35')){var _0x4f0bb0=encryptor['decryptString'](_0x5c39a7['data3']);_0x5c39a7['data3']=maskClientSecret(_0x4f0bb0);}return _0x5c39a7;});return _0x2e2e48;})[_0xccf4('0x15')](respondWithFilteredResult(_0x2d8a7d,_0x18fe1e))[_0xccf4('0x36')](handleError(_0x2d8a7d,null));};exports[_0xccf4('0x37')]=function(_0x2b8558,_0x489594){var _0x402630={'raw':!![],'where':{'id':_0x2b8558[_0xccf4('0x38')]['id']}},_0x2fdb1b={};_0x2fdb1b['model']=_[_0xccf4('0x39')](db['CloudProvider'][_0xccf4('0x1d')]);_0x2fdb1b[_0xccf4('0x23')]=_[_0xccf4('0x39')](_0x2b8558[_0xccf4('0x23')]);_0x2fdb1b[_0xccf4('0x24')]=_[_0xccf4('0x3a')](_0x2fdb1b[_0xccf4('0x21')],_0x2fdb1b[_0xccf4('0x23')]);_0x402630[_0xccf4('0x25')]=_[_0xccf4('0x3a')](_0x2fdb1b[_0xccf4('0x21')],qs['fields'](_0x2b8558['query']['fields']));_0x402630[_0xccf4('0x25')]=_0x402630['attributes'][_0xccf4('0x3b')]?_0x402630[_0xccf4('0x25')]:_0x2fdb1b[_0xccf4('0x21')];if(_0x2b8558[_0xccf4('0x23')]['includeAll']){_0x402630['include']=[{'all':!![]}];}_0x402630=_['merge']({},_0x402630,_0x2b8558[_0xccf4('0x30')]);return db[_0xccf4('0x1c')][_0xccf4('0x3c')](_0x402630)[_0xccf4('0x15')](handleEntityNotFound(_0x489594,null))[_0xccf4('0x15')](function(_0x500d43){if(_0x500d43['service']===_0xccf4('0x35')){var _0x53eb55=encryptor[_0xccf4('0x3d')](_0x500d43['data3']);_0x500d43[_0xccf4('0x3e')]=maskClientSecret(_0x53eb55);}return _0x500d43;})[_0xccf4('0x15')](respondWithResult(_0x489594,null))[_0xccf4('0x36')](handleError(_0x489594,null));};exports[_0xccf4('0x3f')]=function(_0x5449a8,_0xf44638){if(!_0x5449a8[_0xccf4('0x40')]['name'])throw new Error(_0xccf4('0x41'));if(!_0x5449a8[_0xccf4('0x40')][_0xccf4('0x34')])throw new Error(_0xccf4('0x42'));var _0x222411=db[_0xccf4('0x1c')][_0xccf4('0x1d')]['service']['values'];if(!_0x222411[_0xccf4('0x43')](_0x5449a8[_0xccf4('0x40')][_0xccf4('0x34')]))throw new Error(_0xccf4('0x44')+_0x222411[_0xccf4('0x45')](',\x20'));if(_0x5449a8['body']['service']===_0xccf4('0x35')&&_0x5449a8[_0xccf4('0x40')][_0xccf4('0x3e')]){_0x5449a8[_0xccf4('0x40')][_0xccf4('0x3e')]=encryptor['encryptString'](_0x5449a8[_0xccf4('0x40')][_0xccf4('0x3e')]);}return db[_0xccf4('0x1c')][_0xccf4('0x3f')](_0x5449a8[_0xccf4('0x40')],{})['then'](respondWithResult(_0xf44638,0xc9))[_0xccf4('0x36')](handleError(_0xf44638,null));};exports[_0xccf4('0x14')]=function(_0x2d4e09,_0x2f2c7d){if(_0x2d4e09[_0xccf4('0x40')]['id']){delete _0x2d4e09[_0xccf4('0x40')]['id'];}return db['CloudProvider'][_0xccf4('0x3c')]({'where':{'id':_0x2d4e09[_0xccf4('0x38')]['id']}})[_0xccf4('0x15')](handleEntityNotFound(_0x2f2c7d,null))['then'](function(_0x57e532){if(_0x57e532[_0xccf4('0x34')]===_0xccf4('0x35')&&_0x2d4e09[_0xccf4('0x40')][_0xccf4('0x3e')]){_0x2d4e09[_0xccf4('0x40')][_0xccf4('0x3e')]=encryptor[_0xccf4('0x46')](_0x2d4e09['body'][_0xccf4('0x3e')]);}return _0x57e532;})[_0xccf4('0x15')](saveUpdates(_0x2d4e09[_0xccf4('0x40')],null))['then'](respondWithResult(_0x2f2c7d,null))[_0xccf4('0x36')](handleError(_0x2f2c7d,null));};exports[_0xccf4('0x16')]=function(_0x308b8b,_0x1a5fab){return db[_0xccf4('0x1c')]['find']({'where':{'id':_0x308b8b[_0xccf4('0x38')]['id']}})[_0xccf4('0x15')](handleEntityNotFound(_0x1a5fab,null))[_0xccf4('0x15')](removeEntity(_0x1a5fab,null))['catch'](handleError(_0x1a5fab,null));};exports[_0xccf4('0x47')]=function(_0x42c859,_0x5827c2){return db[_0xccf4('0x1c')][_0xccf4('0x48')]({'where':{'id':_0x42c859[_0xccf4('0x38')]['id']},'raw':!![]})['then'](function(_0x520597){if(!_0x520597)return _0x5827c2[_0xccf4('0xa')](0x194);return{'url':oauth[_0xccf4('0x49')](_0x520597,_0x42c859[_0xccf4('0x4a')]['id'])};})[_0xccf4('0x15')](respondWithResult(_0x5827c2,null))[_0xccf4('0x36')](handleError(_0x5827c2,null));};exports[_0xccf4('0x4b')]=function(_0x16c8b6,_0x144586){var _0x38cd4e=_0x16c8b6[_0xccf4('0x40')];var _0x58f724;var _0x53ed6b;if(_0x38cd4e[_0xccf4('0x17')])throw _0x38cd4e;redis[_0xccf4('0x4c')](_0x38cd4e[_0xccf4('0x4d')])['then'](function(_0x774dd){if(!_0x774dd)throw new Error('Invalid\x20state\x20parameter');_0x58f724=JSON[_0xccf4('0x4e')](_0x774dd);var _0x38f5e0=Buffer['from'](_0x38cd4e[_0xccf4('0x4d')],_0xccf4('0x4f'))[_0xccf4('0x50')](_0xccf4('0x51'));_0x53ed6b=JSON['parse'](_0x38f5e0);if(!oauth['isValidIdToken'](_0x38cd4e[_0xccf4('0x52')],_0x58f724[_0xccf4('0x53')]))throw new Error(_0xccf4('0x54'));redis[_0xccf4('0x55')](_0x38cd4e[_0xccf4('0x4d')]);return oauth['getOauth2MicrosoftAccessToken'](_0x38cd4e[_0xccf4('0x56')],_0x58f724);})[_0xccf4('0x15')](function(_0x44f3ae){_0x58f724[_0xccf4('0x57')]=_0x44f3ae[_0xccf4('0x58')];_0x58f724[_0xccf4('0x59')]=_0x44f3ae[_0xccf4('0x5a')];return db[_0xccf4('0x1c')]['update']({'data5':_0x58f724[_0xccf4('0x57')],'data6':_0x58f724[_0xccf4('0x59')]},{'where':{'id':_0x58f724['id']}});})[_0xccf4('0x15')](function(){oauth[_0xccf4('0x5b')](_0x58f724);socket[_0xccf4('0x5c')](_0xccf4('0x5d'),{'id':_0x53ed6b['id']});return;})[_0xccf4('0x15')](respondWithStatusCode(_0x144586,null))[_0xccf4('0x36')](function(_0x362be9){if(_0x53ed6b){socket[_0xccf4('0x5c')](_0xccf4('0x5e'),{'id':_0x53ed6b['id']});}if(!_0x58f724){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x362be9);return _0x144586[_0xccf4('0xc')](0x1f4)['send'](_0x362be9['message']);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x58f724['id'],JSON[_0xccf4('0x5f')](_0x362be9));});}; \ No newline at end of file +var _0x4e61=['CloudProvider','count','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','catch','length','merge','data3','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','update','find','oauth2MicrosoftAuthorize','findOne','params','user','get','state','parse','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','data6','refresh_token','startRefreshInterval','microsoftAuthorization:success','emit','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','status','end','offset','undefined','limit','set','Content-Range','json','destroy','then','sendStatus','error','stack','send','padEnd','slice','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','VIRTUAL','filter','options'];(function(_0x441f7a,_0x576321){var _0x4821da=function(_0x5c5b52){while(--_0x5c5b52){_0x441f7a['push'](_0x441f7a['shift']());}};_0x4821da(++_0x576321);}(_0x4e61,0x19e));var _0x14e6=function(_0x2bd1ec,_0x3fe65f){_0x2bd1ec=_0x2bd1ec-0x0;var _0x2f7577=_0x4e61[_0x2bd1ec];return _0x2f7577;};'use strict';var _=require(_0x14e6('0x0'));var Redis=require('ioredis');var qs=require(_0x14e6('0x1'));var encryptor=require(_0x14e6('0x2'));var config=require('../../config/environment');var logger=require(_0x14e6('0x3'))(_0x14e6('0x4'));var db=require(_0x14e6('0x5'))['db'];var oauth=require('./cloudProvider.oauth');config['redis']=_[_0x14e6('0x6')](config[_0x14e6('0x7')],{'host':_0x14e6('0x8'),'port':0x18eb});var socket=require(_0x14e6('0x9'))(new Redis(config[_0x14e6('0x7')]));var redis=new Redis(config[_0x14e6('0x7')]);function respondWithStatusCode(_0xf0bfb9,_0x5d2b78){_0x5d2b78=_0x5d2b78||0xcc;return function(_0x2ad943){if(_0x2ad943){return _0xf0bfb9['sendStatus'](_0x5d2b78);}return _0xf0bfb9[_0x14e6('0xa')](_0x5d2b78)[_0x14e6('0xb')]();};}function respondWithResult(_0x2a6b8d,_0x4eeddb){_0x4eeddb=_0x4eeddb||0xc8;return function(_0x213328){if(_0x213328){return _0x2a6b8d[_0x14e6('0xa')](_0x4eeddb)['json'](_0x213328);}};}function respondWithFilteredResult(_0x300bf9,_0xaed4aa){return function(_0x22a7d3){if(_0x22a7d3){var _0xb62a92=typeof _0xaed4aa[_0x14e6('0xc')]===_0x14e6('0xd')&&typeof _0xaed4aa[_0x14e6('0xe')]===_0x14e6('0xd');var _0x25615f=_0x22a7d3['count'];var _0x406a45=_0xb62a92?0x0:_0xaed4aa[_0x14e6('0xc')];var _0x450f06=_0xb62a92?_0x22a7d3['count']:_0xaed4aa['offset']+_0xaed4aa['limit'];var _0x470138;if(_0x450f06>=_0x25615f){_0x450f06=_0x25615f;_0x470138=0xc8;}else{_0x470138=0xce;}_0x300bf9[_0x14e6('0xa')](_0x470138);return _0x300bf9[_0x14e6('0xf')](_0x14e6('0x10'),_0x406a45+'-'+_0x450f06+'/'+_0x25615f)[_0x14e6('0x11')](_0x22a7d3);}return null;};}function saveUpdates(_0x5931ef){return function(_0x31607b){if(_0x31607b){return _0x31607b['update'](_0x5931ef)['then'](function(_0x2d1d4e){return _0x2d1d4e;});}return null;};}function removeEntity(_0x267f4){return function(_0x510628){if(_0x510628){return _0x510628[_0x14e6('0x12')]()[_0x14e6('0x13')](function(){_0x267f4[_0x14e6('0xa')](0xcc)[_0x14e6('0xb')]();});}};}function handleEntityNotFound(_0x5f26ce){return function(_0xb7d922){if(!_0xb7d922){_0x5f26ce[_0x14e6('0x14')](0x194);}return _0xb7d922;};}function handleError(_0x131f7c,_0x347764){_0x347764=_0x347764||0x1f4;return function(_0x4d4fad){logger[_0x14e6('0x15')](_0x4d4fad[_0x14e6('0x16')]);if(_0x4d4fad['name']){delete _0x4d4fad['name'];}_0x131f7c[_0x14e6('0xa')](_0x347764)[_0x14e6('0x17')](_0x4d4fad);};}function maskClientSecret(_0x359c9a){return _[_0x14e6('0x18')](_0x359c9a[_0x14e6('0x19')](0x0,0x3),0x14,'*');}exports[_0x14e6('0x1a')]=function(_0x3877d8,_0x3041a4){var _0x4ffc91={},_0x3de028={},_0x1a8037={'count':0x0,'rows':[]};var _0x467690=_[_0x14e6('0x1b')](db['CloudProvider'][_0x14e6('0x1c')],function(_0x34464d){return{'name':_0x34464d[_0x14e6('0x1d')],'type':_0x34464d[_0x14e6('0x1e')]['key']};});_0x3de028[_0x14e6('0x1f')]=_[_0x14e6('0x1b')](_0x467690,_0x14e6('0x20'));_0x3de028[_0x14e6('0x21')]=_[_0x14e6('0x22')](_0x3877d8[_0x14e6('0x21')]);_0x3de028[_0x14e6('0x23')]=_[_0x14e6('0x24')](_0x3de028[_0x14e6('0x1f')],_0x3de028[_0x14e6('0x21')]);_0x4ffc91[_0x14e6('0x25')]=_['intersection'](_0x3de028['model'],qs[_0x14e6('0x26')](_0x3877d8[_0x14e6('0x21')]['fields']));_0x4ffc91[_0x14e6('0x25')]=_0x4ffc91['attributes']['length']?_0x4ffc91[_0x14e6('0x25')]:_0x3de028['model'];if(!_0x3877d8['query']['hasOwnProperty']('nolimit')){_0x4ffc91[_0x14e6('0xe')]=qs[_0x14e6('0xe')](_0x3877d8[_0x14e6('0x21')][_0x14e6('0xe')]);_0x4ffc91['offset']=qs['offset'](_0x3877d8[_0x14e6('0x21')][_0x14e6('0xc')]);}_0x4ffc91[_0x14e6('0x27')]=qs[_0x14e6('0x28')](_0x3877d8['query']['sort']);_0x4ffc91[_0x14e6('0x29')]=qs[_0x14e6('0x23')](_[_0x14e6('0x2a')](_0x3877d8['query'],_0x3de028['filters']),_0x467690);if(_0x3877d8[_0x14e6('0x21')]['filter']){_0x4ffc91[_0x14e6('0x29')]=_['merge'](_0x4ffc91[_0x14e6('0x29')],{'$or':_[_0x14e6('0x1b')](_0x467690,function(_0x97ac3c){if(_0x97ac3c[_0x14e6('0x1e')]!==_0x14e6('0x2b')){var _0x41ab81={};_0x41ab81[_0x97ac3c['name']]={'$like':'%'+_0x3877d8[_0x14e6('0x21')][_0x14e6('0x2c')]+'%'};return _0x41ab81;}})});}_0x4ffc91=_['merge']({},_0x4ffc91,_0x3877d8[_0x14e6('0x2d')]);var _0x3e6c19={'where':_0x4ffc91[_0x14e6('0x29')]};return db[_0x14e6('0x2e')][_0x14e6('0x2f')](_0x3e6c19)[_0x14e6('0x13')](function(_0x54e5ac){_0x1a8037['count']=_0x54e5ac;if(_0x3877d8[_0x14e6('0x21')][_0x14e6('0x30')]){_0x4ffc91[_0x14e6('0x31')]=[{'all':!![]}];}return db['CloudProvider'][_0x14e6('0x32')](_0x4ffc91);})[_0x14e6('0x13')](function(_0x5d7c48){_0x1a8037[_0x14e6('0x33')]=_[_0x14e6('0x1b')](_0x5d7c48,function(_0x24a9e7){if(_0x24a9e7[_0x14e6('0x34')]===_0x14e6('0x35')){var _0x36cb69=encryptor[_0x14e6('0x36')](_0x24a9e7['data3']);_0x24a9e7['data3']=maskClientSecret(_0x36cb69);}return _0x24a9e7;});return _0x1a8037;})[_0x14e6('0x13')](respondWithFilteredResult(_0x3041a4,_0x4ffc91))[_0x14e6('0x37')](handleError(_0x3041a4,null));};exports['show']=function(_0x22845c,_0x75b342){var _0xfadc4e={'raw':!![],'where':{'id':_0x22845c['params']['id']}},_0xdf704f={};_0xdf704f[_0x14e6('0x1f')]=_[_0x14e6('0x22')](db[_0x14e6('0x2e')][_0x14e6('0x1c')]);_0xdf704f[_0x14e6('0x21')]=_[_0x14e6('0x22')](_0x22845c[_0x14e6('0x21')]);_0xdf704f['filters']=_['intersection'](_0xdf704f[_0x14e6('0x1f')],_0xdf704f['query']);_0xfadc4e['attributes']=_[_0x14e6('0x24')](_0xdf704f[_0x14e6('0x1f')],qs[_0x14e6('0x26')](_0x22845c[_0x14e6('0x21')][_0x14e6('0x26')]));_0xfadc4e[_0x14e6('0x25')]=_0xfadc4e[_0x14e6('0x25')][_0x14e6('0x38')]?_0xfadc4e[_0x14e6('0x25')]:_0xdf704f[_0x14e6('0x1f')];if(_0x22845c['query'][_0x14e6('0x30')]){_0xfadc4e['include']=[{'all':!![]}];}_0xfadc4e=_[_0x14e6('0x39')]({},_0xfadc4e,_0x22845c['options']);return db[_0x14e6('0x2e')]['find'](_0xfadc4e)['then'](handleEntityNotFound(_0x75b342,null))[_0x14e6('0x13')](function(_0x12054c){if(_0x12054c['service']===_0x14e6('0x35')){var _0x3dc717=encryptor[_0x14e6('0x36')](_0x12054c[_0x14e6('0x3a')]);_0x12054c['data3']=maskClientSecret(_0x3dc717);}return _0x12054c;})['then'](respondWithResult(_0x75b342,null))[_0x14e6('0x37')](handleError(_0x75b342,null));};exports[_0x14e6('0x3b')]=function(_0x21bf8d,_0x873f27){if(!_0x21bf8d[_0x14e6('0x3c')][_0x14e6('0x20')])throw new Error(_0x14e6('0x3d'));if(!_0x21bf8d['body'][_0x14e6('0x34')])throw new Error(_0x14e6('0x3e'));var _0xc11f1c=db[_0x14e6('0x2e')]['rawAttributes'][_0x14e6('0x34')]['values'];if(!_0xc11f1c['includes'](_0x21bf8d[_0x14e6('0x3c')]['service']))throw new Error(_0x14e6('0x3f')+_0xc11f1c[_0x14e6('0x40')](',\x20'));if(_0x21bf8d[_0x14e6('0x3c')]['service']===_0x14e6('0x35')&&_0x21bf8d[_0x14e6('0x3c')][_0x14e6('0x3a')]){_0x21bf8d[_0x14e6('0x3c')]['data3']=encryptor['encryptString'](_0x21bf8d[_0x14e6('0x3c')]['data3']);}return db['CloudProvider'][_0x14e6('0x3b')](_0x21bf8d[_0x14e6('0x3c')],{})['then'](respondWithResult(_0x873f27,0xc9))['catch'](handleError(_0x873f27,null));};exports[_0x14e6('0x41')]=function(_0x3c87b3,_0x307271){if(_0x3c87b3[_0x14e6('0x3c')]['id']){delete _0x3c87b3['body']['id'];}return db[_0x14e6('0x2e')][_0x14e6('0x42')]({'where':{'id':_0x3c87b3['params']['id']}})[_0x14e6('0x13')](handleEntityNotFound(_0x307271,null))[_0x14e6('0x13')](function(_0xba895d){if(_0xba895d['service']===_0x14e6('0x35')&&_0x3c87b3['body']['data3']){_0x3c87b3[_0x14e6('0x3c')][_0x14e6('0x3a')]=encryptor['encryptString'](_0x3c87b3[_0x14e6('0x3c')][_0x14e6('0x3a')]);}return _0xba895d;})[_0x14e6('0x13')](saveUpdates(_0x3c87b3[_0x14e6('0x3c')],null))[_0x14e6('0x13')](respondWithResult(_0x307271,null))[_0x14e6('0x37')](handleError(_0x307271,null));};exports[_0x14e6('0x12')]=function(_0x3c9e0b,_0x112aad){return db[_0x14e6('0x2e')][_0x14e6('0x42')]({'where':{'id':_0x3c9e0b['params']['id']}})[_0x14e6('0x13')](handleEntityNotFound(_0x112aad,null))[_0x14e6('0x13')](removeEntity(_0x112aad,null))['catch'](handleError(_0x112aad,null));};exports[_0x14e6('0x43')]=function(_0x3c10bc,_0xa42148){return db['CloudProvider'][_0x14e6('0x44')]({'where':{'id':_0x3c10bc[_0x14e6('0x45')]['id']},'raw':!![]})[_0x14e6('0x13')](function(_0x3ec93e){if(!_0x3ec93e)return _0xa42148[_0x14e6('0x14')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x3ec93e,_0x3c10bc[_0x14e6('0x46')]['id'])};})[_0x14e6('0x13')](respondWithResult(_0xa42148,null))[_0x14e6('0x37')](handleError(_0xa42148,null));};exports['oauth2MicrosoftCallback']=function(_0x3b0d72,_0x3f7813){var _0x3a7cab=_0x3b0d72[_0x14e6('0x3c')];var _0x238437;var _0x443aa7;if(_0x3a7cab[_0x14e6('0x15')])throw _0x3a7cab;redis[_0x14e6('0x47')](_0x3a7cab[_0x14e6('0x48')])[_0x14e6('0x13')](function(_0x40b81d){if(!_0x40b81d)throw new Error('Invalid\x20state\x20parameter');_0x238437=JSON[_0x14e6('0x49')](_0x40b81d);var _0x3cd8de=Buffer['from'](_0x3a7cab[_0x14e6('0x48')],_0x14e6('0x4a'))[_0x14e6('0x4b')](_0x14e6('0x4c'));_0x443aa7=JSON['parse'](_0x3cd8de);if(!oauth[_0x14e6('0x4d')](_0x3a7cab[_0x14e6('0x4e')],_0x238437[_0x14e6('0x4f')]))throw new Error(_0x14e6('0x50'));redis['del'](_0x3a7cab[_0x14e6('0x48')]);return oauth[_0x14e6('0x51')](_0x3a7cab[_0x14e6('0x52')],_0x238437);})[_0x14e6('0x13')](function(_0x364d82){_0x238437[_0x14e6('0x53')]=_0x364d82[_0x14e6('0x54')];_0x238437[_0x14e6('0x55')]=_0x364d82[_0x14e6('0x56')];return db[_0x14e6('0x2e')][_0x14e6('0x41')]({'data5':_0x238437['data5'],'data6':_0x238437[_0x14e6('0x55')]},{'where':{'id':_0x238437['id']}});})[_0x14e6('0x13')](function(){oauth[_0x14e6('0x57')](_0x238437);socket['emit'](_0x14e6('0x58'),{'id':_0x443aa7['id']});return;})[_0x14e6('0x13')](respondWithStatusCode(_0x3f7813,null))[_0x14e6('0x37')](function(_0xf9c90d){if(_0x443aa7){socket[_0x14e6('0x59')]('microsoftAuthorization:error',{'id':_0x443aa7['id']});}if(!_0x238437){logger[_0x14e6('0x15')]('Invalid\x20authentication\x20state\x20parameter',_0xf9c90d);return _0x3f7813[_0x14e6('0xa')](0x1f4)[_0x14e6('0x17')](_0xf9c90d[_0x14e6('0x5a')]);}logger[_0x14e6('0x15')](_0x14e6('0x5b'),_0x238437['id'],JSON['stringify'](_0xf9c90d));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index c80f370..4816e90 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 _0x0369=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0x0369,0x198));var _0x9036=function(_0x1d7503,_0x307723){_0x1d7503=_0x1d7503-0x0;var _0x16a0b2=_0x0369[_0x1d7503];return _0x16a0b2;};'use strict';var _=require(_0x9036('0x0'));var util=require(_0x9036('0x1'));var logger=require(_0x9036('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9036('0x3'));var rp=require(_0x9036('0x4'));var fs=require('fs');var path=require(_0x9036('0x5'));var rimraf=require(_0x9036('0x6'));var config=require(_0x9036('0x7'));var attributes=require(_0x9036('0x8'));module['exports']=function(_0x162dc9,_0x580165){return _0x162dc9[_0x9036('0x9')](_0x9036('0xa'),attributes,{'tableName':_0x9036('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf79=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xaf79,0xe6));var _0x9af7=function(_0x1fe5f6,_0xd1e86b){_0x1fe5f6=_0x1fe5f6-0x0;var _0x501ac6=_0xaf79[_0x1fe5f6];return _0x501ac6;};'use strict';var _=require('lodash');var util=require(_0x9af7('0x0'));var logger=require(_0x9af7('0x1'))(_0x9af7('0x2'));var moment=require('moment');var BPromise=require(_0x9af7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9af7('0x4'));var config=require(_0x9af7('0x5'));var attributes=require(_0x9af7('0x6'));module['exports']=function(_0x4b6a2e,_0x5c7594){return _0x4b6a2e[_0x9af7('0x7')](_0x9af7('0x8'),attributes,{'tableName':_0x9af7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 3b66134..e97f799 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70a5=['catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','POST','intervals','bind','findAll','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','replace','{TENANT_ID}','code','id_token','from','stringify','base64','randomBytes','toString','data1','response_type','join','redirect_uri','data4','response_mode','form_post','scope','state','nonce','prompt','login','oauth2Claims','set','payload','iss','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','data2','data5','refresh_token','update'];(function(_0x121f5e,_0x42d56a){var _0x391c11=function(_0x2564bf){while(--_0x2564bf){_0x121f5e['push'](_0x121f5e['shift']());}};_0x391c11(++_0x42d56a);}(_0x70a5,0x143));var _0x570a=function(_0x3b363e,_0x1707ab){_0x3b363e=_0x3b363e-0x0;var _0x2d1389=_0x70a5[_0x3b363e];return _0x2d1389;};'use strict';var _=require('lodash');var crypto=require(_0x570a('0x0'));var jwt=require(_0x570a('0x1'));var moment=require(_0x570a('0x2'));var Redis=require(_0x570a('0x3'));var rp=require(_0x570a('0x4'));var util=require(_0x570a('0x5'));var encryptor=require(_0x570a('0x6'));var config=require(_0x570a('0x7'));var logger=require(_0x570a('0x8'))(_0x570a('0x9'));var schedule=require(_0x570a('0xa'));var db=require(_0x570a('0xb'))['db'];config[_0x570a('0xc')]=_['defaults'](config[_0x570a('0xc')],{'host':_0x570a('0xd'),'port':0x18eb});var redis=new Redis(config[_0x570a('0xc')]);var MICROSOFT_AUTH_URL=_0x570a('0xe');var AZURE_AUTH_SCOPES={'Outlook365':[_0x570a('0xf'),'profile','email',_0x570a('0x10'),_0x570a('0x11'),_0x570a('0x12'),_0x570a('0x13')],'Dynamics365':[_0x570a('0xf'),_0x570a('0x10')]};var MICROSOFT_AUTH_ENDPOINT=_0x570a('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x570a('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5c8f20){var _0x32614b=_[_0x570a('0x16')](AZURE_AUTH_SCOPES[_0x5c8f20[_0x570a('0x17')]]);if(_0x5c8f20[_0x570a('0x17')]===_0x570a('0x18'))_0x32614b[_0x570a('0x19')](_0x5c8f20['data7']+'/.default');return _0x32614b['join']('\x20');}function getAccessTokenScope(_0xafc98e){if(_0xafc98e['type']==='Outlook365')return _0x570a('0x11');if(_0xafc98e[_0x570a('0x17')]===_0x570a('0x18'))return _0xafc98e[_0x570a('0x1a')]+_0x570a('0x1b');}function generateMicrosoftAuthorizationUrl(_0x8431fd,_0x57837b){var _0x3be1d0=MICROSOFT_AUTH_URL[_0x570a('0x1c')](_0x570a('0x1d'),_0x8431fd['data2']);var _0x21f17c=[_0x570a('0x1e'),_0x570a('0x1f')];var _0x31194a=Buffer[_0x570a('0x20')](JSON[_0x570a('0x21')]({'id':_0x57837b}))['toString'](_0x570a('0x22'));var _0x2ccf27=crypto[_0x570a('0x23')](0x10)[_0x570a('0x24')]('hex');var _0x541616=getAuthorizationScopes(_0x8431fd);var _0x4686db=[{'key':'client_id','value':_0x8431fd[_0x570a('0x25')]},{'key':_0x570a('0x26'),'value':encodeURIComponent(_0x21f17c[_0x570a('0x27')]('\x20'))},{'key':_0x570a('0x28'),'value':_0x8431fd[_0x570a('0x29')]},{'key':_0x570a('0x2a'),'value':_0x570a('0x2b')},{'key':_0x570a('0x2c'),'value':encodeURIComponent(_0x541616)},{'key':_0x570a('0x2d'),'value':_0x31194a},{'key':_0x570a('0x2e'),'value':_0x2ccf27},{'key':_0x570a('0x2f'),'value':_0x570a('0x30')}];var _0x5afa9a=_0x3be1d0+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x570a('0x16')](_0x4686db,function(_0x5e03a6){return _0x5e03a6['key']+'='+_0x5e03a6['value'];})[_0x570a('0x27')]('&');_0x8431fd[_0x570a('0x31')]={'issuer':_0x3be1d0['replace']('oauth2/',''),'audience':_0x8431fd['data1'],'state':_0x31194a,'nonce':_0x2ccf27};redis[_0x570a('0x32')](_0x31194a,JSON['stringify'](_0x8431fd));return _0x5afa9a;}function isValidIdToken(_0x35b476,_0x211c76){try{var _0x2f43b4=jwt['decode'](_0x35b476,{'complete':!![]});var _0x3bbb6d=_0x2f43b4[_0x570a('0x33')];if(_0x3bbb6d[_0x570a('0x34')]!==_0x211c76['issuer'])return![];if(_0x3bbb6d['aud']!==_0x211c76[_0x570a('0x35')])return![];if(_0x3bbb6d[_0x570a('0x2e')]!==_0x211c76['nonce'])return![];if(moment()[_0x570a('0x36')](moment[_0x570a('0x37')](_0x3bbb6d[_0x570a('0x38')])))return![];return!![];}catch(_0x38a7ad){throw _0x38a7ad;}}function refreshOauth2MicrosoftAccessToken(_0x5743bf){return Promise[_0x570a('0x39')]()[_0x570a('0x3a')](function(){if(_0x5743bf[_0x570a('0x3b')])return _0x5743bf;return db[_0x570a('0x3c')][_0x570a('0x3d')]({'where':{'id':_0x5743bf['id']},'raw':!![]});})[_0x570a('0x3a')](function(_0x50b78f){var _0x2f24e2={'grant_type':'refresh_token','refresh_token':_0x50b78f[_0x570a('0x3e')],'scope':getAccessTokenScope(_0x50b78f),'redirect_uri':_0x50b78f[_0x570a('0x29')],'client_id':_0x50b78f['data1'],'client_secret':encryptor['decryptString'](_0x50b78f[_0x570a('0x3b')])};var _0x5312eb={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x570a('0x1c')]('{TENANT_ID}',_0x50b78f[_0x570a('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2f24e2,'json':!![]};return rp(_0x5312eb);})[_0x570a('0x3a')](function(_0x4e19c7){_0x5743bf[_0x570a('0x40')]=_0x4e19c7['access_token'];_0x5743bf[_0x570a('0x3e')]=_0x4e19c7[_0x570a('0x41')];return db[_0x570a('0x3c')][_0x570a('0x42')]({'data5':_0x5743bf[_0x570a('0x40')],'data6':_0x5743bf[_0x570a('0x3e')]},{'where':{'id':_0x5743bf['id']}});})[_0x570a('0x3a')](function(){return _0x5743bf;})[_0x570a('0x43')](function(_0x5016a4){logger[_0x570a('0x44')](_0x570a('0x45'),_0x5743bf['id'],_0x5016a4);});}function getOauth2MicrosoftAccessToken(_0x352291,_0x3c9122){var _0x381794={'grant_type':'authorization_code','code':_0x352291,'scope':getAccessTokenScope(_0x3c9122),'redirect_uri':_0x3c9122[_0x570a('0x29')],'client_id':_0x3c9122[_0x570a('0x25')],'client_secret':encryptor['decryptString'](_0x3c9122[_0x570a('0x3b')])};var _0x15f7cf={'method':_0x570a('0x46'),'uri':MICROSOFT_AUTH_URL[_0x570a('0x1c')](_0x570a('0x1d'),_0x3c9122[_0x570a('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x381794,'json':!![]};return rp(_0x15f7cf);}function startRefreshInterval(_0x1d2115){var _0x38bac1=schedule[_0x570a('0x47')];if(_0x38bac1[_0x1d2115['id']])clearInterval(_0x38bac1[_0x1d2115['id']]);_0x38bac1[_0x1d2115['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x570a('0x48')](this,{'id':_0x1d2115['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x570a('0x47')]=_0x38bac1;}function startAllRefreshIntervals(){return db[_0x570a('0x3c')][_0x570a('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x570a('0x3a')](function(_0x3f22de){var _0x211175=_0x3f22de[_0x570a('0x16')](function(_0x55b41f){return refreshOauth2MicrosoftAccessToken(_0x55b41f)['then'](function(_0x5eadfd){startRefreshInterval(_0x5eadfd);});});return Promise[_0x570a('0x4a')](_0x211175);})[_0x570a('0x43')](function(_0x194480){var _0x7aa014=_0x194480?util[_0x570a('0x4b')](_0x194480,{'showHidden':![],'depth':null}):'';logger[_0x570a('0x44')](_0x570a('0x4c'),_0x7aa014);});}module[_0x570a('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0x316e=['oauth2/','data1','stringify','decode','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','CloudProvider','findOne','refresh_token','data6','data4','decryptString','data3','POST','{TENANT_ID}','data5','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','inspect','error','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','data2','code','id_token','from','toString','hex','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','login','value','oauth2Claims'];(function(_0x15a0c1,_0x285dfe){var _0x348db1=function(_0x3af209){while(--_0x3af209){_0x15a0c1['push'](_0x15a0c1['shift']());}};_0x348db1(++_0x285dfe);}(_0x316e,0x122));var _0xe316=function(_0x125a0f,_0x570263){_0x125a0f=_0x125a0f-0x0;var _0x49b79f=_0x316e[_0x125a0f];return _0x49b79f;};'use strict';var _=require(_0xe316('0x0'));var crypto=require(_0xe316('0x1'));var jwt=require(_0xe316('0x2'));var moment=require(_0xe316('0x3'));var Redis=require(_0xe316('0x4'));var rp=require('request-promise');var util=require(_0xe316('0x5'));var encryptor=require(_0xe316('0x6'));var config=require(_0xe316('0x7'));var logger=require(_0xe316('0x8'))(_0xe316('0x9'));var schedule=require(_0xe316('0xa'));var db=require(_0xe316('0xb'))['db'];config[_0xe316('0xc')]=_[_0xe316('0xd')](config[_0xe316('0xc')],{'host':_0xe316('0xe'),'port':0x18eb});var redis=new Redis(config[_0xe316('0xc')]);var MICROSOFT_AUTH_URL=_0xe316('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0xe316('0x10'),_0xe316('0x11'),_0xe316('0x12'),'offline_access',_0xe316('0x13'),_0xe316('0x14'),_0xe316('0x15')],'Dynamics365':['openid',_0xe316('0x16')]};var MICROSOFT_AUTH_ENDPOINT=_0xe316('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0xe316('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x447531){var _0x5557f8=_[_0xe316('0x19')](AZURE_AUTH_SCOPES[_0x447531[_0xe316('0x1a')]]);if(_0x447531['type']===_0xe316('0x1b'))_0x5557f8[_0xe316('0x1c')](_0x447531[_0xe316('0x1d')]+_0xe316('0x1e'));return _0x5557f8[_0xe316('0x1f')]('\x20');}function getAccessTokenScope(_0x1f7cee){if(_0x1f7cee[_0xe316('0x1a')]===_0xe316('0x20'))return _0xe316('0x13');if(_0x1f7cee['type']==='Dynamics365')return _0x1f7cee['data7']+'/.default';}function generateMicrosoftAuthorizationUrl(_0x26f740,_0x4b002c){var _0x4ac518=MICROSOFT_AUTH_URL[_0xe316('0x21')]('{TENANT_ID}',_0x26f740[_0xe316('0x22')]);var _0x50a5ce=[_0xe316('0x23'),_0xe316('0x24')];var _0x100cd8=Buffer[_0xe316('0x25')](JSON['stringify']({'id':_0x4b002c}))[_0xe316('0x26')]('base64');var _0x41c577=crypto['randomBytes'](0x10)[_0xe316('0x26')](_0xe316('0x27'));var _0x4fe265=getAuthorizationScopes(_0x26f740);var _0x408323=[{'key':'client_id','value':_0x26f740['data1']},{'key':'response_type','value':encodeURIComponent(_0x50a5ce[_0xe316('0x1f')]('\x20'))},{'key':_0xe316('0x28'),'value':_0x26f740['data4']},{'key':_0xe316('0x29'),'value':_0xe316('0x2a')},{'key':_0xe316('0x2b'),'value':encodeURIComponent(_0x4fe265)},{'key':_0xe316('0x2c'),'value':_0x100cd8},{'key':_0xe316('0x2d'),'value':_0x41c577},{'key':_0xe316('0x2e'),'value':_0xe316('0x2f')}];var _0x4afb4d=_0x4ac518+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xe316('0x19')](_0x408323,function(_0x22b8c4){return _0x22b8c4['key']+'='+_0x22b8c4[_0xe316('0x30')];})[_0xe316('0x1f')]('&');_0x26f740[_0xe316('0x31')]={'issuer':_0x4ac518[_0xe316('0x21')](_0xe316('0x32'),''),'audience':_0x26f740[_0xe316('0x33')],'state':_0x100cd8,'nonce':_0x41c577};redis['set'](_0x100cd8,JSON[_0xe316('0x34')](_0x26f740));return _0x4afb4d;}function isValidIdToken(_0x572eec,_0x3540a5){try{var _0x3c92e1=jwt[_0xe316('0x35')](_0x572eec,{'complete':!![]});var _0x188d7e=_0x3c92e1[_0xe316('0x36')];if(_0x188d7e['iss']!==_0x3540a5[_0xe316('0x37')])return![];if(_0x188d7e[_0xe316('0x38')]!==_0x3540a5[_0xe316('0x39')])return![];if(_0x188d7e[_0xe316('0x2d')]!==_0x3540a5['nonce'])return![];if(moment()[_0xe316('0x3a')](moment[_0xe316('0x3b')](_0x188d7e[_0xe316('0x3c')])))return![];return!![];}catch(_0x5a58b2){throw _0x5a58b2;}}function refreshOauth2MicrosoftAccessToken(_0x360006){return Promise[_0xe316('0x3d')]()[_0xe316('0x3e')](function(){if(_0x360006['data3'])return _0x360006;return db[_0xe316('0x3f')][_0xe316('0x40')]({'where':{'id':_0x360006['id']},'raw':!![]});})[_0xe316('0x3e')](function(_0x4389c7){var _0x1beb21={'grant_type':_0xe316('0x41'),'refresh_token':_0x4389c7[_0xe316('0x42')],'scope':getAccessTokenScope(_0x4389c7),'redirect_uri':_0x4389c7[_0xe316('0x43')],'client_id':_0x4389c7[_0xe316('0x33')],'client_secret':encryptor[_0xe316('0x44')](_0x4389c7[_0xe316('0x45')])};var _0x5b6fdc={'method':_0xe316('0x46'),'uri':MICROSOFT_AUTH_URL[_0xe316('0x21')](_0xe316('0x47'),_0x4389c7[_0xe316('0x22')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x1beb21,'json':!![]};return rp(_0x5b6fdc);})[_0xe316('0x3e')](function(_0x162238){_0x360006[_0xe316('0x48')]=_0x162238[_0xe316('0x49')];_0x360006[_0xe316('0x42')]=_0x162238[_0xe316('0x41')];return db[_0xe316('0x3f')][_0xe316('0x4a')]({'data5':_0x360006[_0xe316('0x48')],'data6':_0x360006['data6']},{'where':{'id':_0x360006['id']}});})[_0xe316('0x3e')](function(){return _0x360006;})[_0xe316('0x4b')](function(_0x351b0b){logger['error'](_0xe316('0x4c'),_0x360006['id'],_0x351b0b);});}function getOauth2MicrosoftAccessToken(_0x4f8031,_0x574bf6){var _0x5b7b6e={'grant_type':_0xe316('0x4d'),'code':_0x4f8031,'scope':getAccessTokenScope(_0x574bf6),'redirect_uri':_0x574bf6[_0xe316('0x43')],'client_id':_0x574bf6['data1'],'client_secret':encryptor['decryptString'](_0x574bf6[_0xe316('0x45')])};var _0x3bc25a={'method':'POST','uri':MICROSOFT_AUTH_URL[_0xe316('0x21')]('{TENANT_ID}',_0x574bf6['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5b7b6e,'json':!![]};return rp(_0x3bc25a);}function startRefreshInterval(_0x2be29d){var _0x25f734=schedule[_0xe316('0x4e')];if(_0x25f734[_0x2be29d['id']])clearInterval(_0x25f734[_0x2be29d['id']]);_0x25f734[_0x2be29d['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xe316('0x4f')](this,{'id':_0x2be29d['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xe316('0x4e')]=_0x25f734;}function startAllRefreshIntervals(){return db[_0xe316('0x3f')][_0xe316('0x50')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe316('0x3e')](function(_0x534f81){var _0x40942d=_0x534f81['map'](function(_0x244807){return refreshOauth2MicrosoftAccessToken(_0x244807)[_0xe316('0x3e')](function(_0x2f2f5a){startRefreshInterval(_0x2f2f5a);});});return Promise[_0xe316('0x51')](_0x40942d);})[_0xe316('0x4b')](function(_0xd77436){var _0x4fa644=_0xd77436?util[_0xe316('0x52')](_0xd77436,{'showHidden':![],'depth':null}):'';logger[_0xe316('0x53')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x4fa644);});}module[_0xe316('0x54')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 9997601..9f27971 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 _0xd1ca=['../../mysqldb','../../config/utils','rpc','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','ioredis'];(function(_0xd7b9f8,_0x12e168){var _0x5063fd=function(_0x116d09){while(--_0x116d09){_0xd7b9f8['push'](_0xd7b9f8['shift']());}};_0x5063fd(++_0x12e168);}(_0xd1ca,0x140));var _0xad1c=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xd1ca[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require('../../config/logger')(_0xad1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad1c('0x6')][_0xad1c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3953ef,_0x5eb923,_0x353097){return new BPromise(function(_0x51b05c,_0x45bfc8){return client[_0xad1c('0x8')](_0x3953ef,_0x353097)[_0xad1c('0x9')](function(_0x8238ed){logger[_0xad1c('0xa')](_0xad1c('0xb'),_0x5eb923,_0xad1c('0xc'));logger[_0xad1c('0xd')](_0xad1c('0xe'),_0x5eb923,_0xad1c('0xc'),JSON['stringify'](_0x8238ed));if(_0x8238ed[_0xad1c('0xf')]){if(_0x8238ed[_0xad1c('0xf')]['code']===0x1f4){logger[_0xad1c('0xf')](_0xad1c('0xb'),_0x5eb923,_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);return _0x45bfc8(_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);}logger[_0xad1c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x5eb923,_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);return _0x51b05c(_0x8238ed[_0xad1c('0xf')][_0xad1c('0x10')]);}else{logger[_0xad1c('0xa')]('CloudProvider,\x20%s,\x20%s',_0x5eb923,_0xad1c('0xc'));_0x51b05c(_0x8238ed[_0xad1c('0x11')][_0xad1c('0x10')]);}})[_0xad1c('0x12')](function(_0x4aa785){logger[_0xad1c('0xf')]('CloudProvider,\x20%s,\x20%s',_0x5eb923,_0x4aa785);_0x45bfc8(_0x4aa785);});});} \ No newline at end of file +var _0x45d8=['../../config/utils','rpc','../../config/environment','http','request','then','info','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x21188a,_0x437f2b){var _0x3fb3fa=function(_0x12f8e4){while(--_0x12f8e4){_0x21188a['push'](_0x21188a['shift']());}};_0x3fb3fa(++_0x437f2b);}(_0x45d8,0x174));var _0x845d=function(_0x7a6aed,_0x335e68){_0x7a6aed=_0x7a6aed-0x0;var _0x9dbabf=_0x45d8[_0x7a6aed];return _0x9dbabf;};'use strict';var _=require(_0x845d('0x0'));var util=require(_0x845d('0x1'));var moment=require(_0x845d('0x2'));var BPromise=require(_0x845d('0x3'));var rs=require(_0x845d('0x4'));var fs=require('fs');var Redis=require(_0x845d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x845d('0x6'));var logger=require('../../config/logger')(_0x845d('0x7'));var config=require(_0x845d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x845d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a59a2,_0x33c493,_0x94a7f5){return new BPromise(function(_0x34a0bf,_0xc26c7d){return client[_0x845d('0xa')](_0x4a59a2,_0x94a7f5)[_0x845d('0xb')](function(_0x5a9113){logger[_0x845d('0xc')](_0x845d('0xd'),_0x33c493,'request\x20sent');logger['debug'](_0x845d('0xe'),_0x33c493,_0x845d('0xf'),JSON[_0x845d('0x10')](_0x5a9113));if(_0x5a9113[_0x845d('0x11')]){if(_0x5a9113[_0x845d('0x11')]['code']===0x1f4){logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')][_0x845d('0x12')]);return _0xc26c7d(_0x5a9113['error']['message']);}logger[_0x845d('0x11')](_0x845d('0xd'),_0x33c493,_0x5a9113[_0x845d('0x11')]['message']);return _0x34a0bf(_0x5a9113[_0x845d('0x11')]['message']);}else{logger[_0x845d('0xc')]('CloudProvider,\x20%s,\x20%s',_0x33c493,_0x845d('0xf'));_0x34a0bf(_0x5a9113[_0x845d('0x13')][_0x845d('0x12')]);}})[_0x845d('0x14')](function(_0x2a592){logger['error']('CloudProvider,\x20%s,\x20%s',_0x33c493,_0x2a592);_0xc26c7d(_0x2a592);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8265db8..db7f719 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['isAuthenticated','/:id','show','post','create','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','exports','express','Router','../../components/auth/service','get'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x7a54,0x106));var _0x47a5=function(_0x225060,_0xfbd6b3){_0x225060=_0x225060-0x0;var _0x89f328=_0x7a54[_0x225060];return _0x89f328;};'use strict';var express=require(_0x47a5('0x0'));var router=express[_0x47a5('0x1')]();var auth=require(_0x47a5('0x2'));var controller=require('./cloudProvider.controller');router[_0x47a5('0x3')]('/',auth[_0x47a5('0x4')](),controller['index']);router[_0x47a5('0x3')](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller[_0x47a5('0x6')]);router[_0x47a5('0x7')]('/',auth['isAuthenticated'](),controller[_0x47a5('0x8')]);router['put'](_0x47a5('0x5'),auth[_0x47a5('0x4')](),controller['update']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x47a5('0x3')](_0x47a5('0xa'),auth['isAuthenticated'](),controller[_0x47a5('0xb')]);router['post']('/oauth2/microsoft/callback',controller[_0x47a5('0xc')]);module[_0x47a5('0xd')]=router; \ No newline at end of file +var _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x5576a4,_0x10841d){var _0xc5011e=function(_0x2d3532){while(--_0x2d3532){_0x5576a4['push'](_0x5576a4['shift']());}};_0xc5011e(++_0x10841d);}(_0xdb28,0x106));var _0x8db2=function(_0x24a65c,_0x38a5e8){_0x24a65c=_0x24a65c-0x0;var _0x1807ac=_0xdb28[_0x24a65c];return _0x1807ac;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 214b3a9..c5bfc07 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 _0xe889=['name','STRING','sequelize','exports'];(function(_0x2a86b0,_0x5480b5){var _0x10d1b5=function(_0x38c759){while(--_0x38c759){_0x2a86b0['push'](_0x2a86b0['shift']());}};_0x10d1b5(++_0x5480b5);}(_0xe889,0xd6));var _0x9e88=function(_0x14577b,_0x260f8b){_0x14577b=_0x14577b-0x0;var _0x7cb38f=_0xe889[_0x14577b];return _0x7cb38f;};'use strict';var Sequelize=require(_0x9e88('0x0'));module[_0x9e88('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9e88('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9e88('0x3')]},'companyId':{'type':Sequelize[_0x9e88('0x3')]},'website':{'type':Sequelize[_0x9e88('0x3')]},'phone':{'type':Sequelize[_0x9e88('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x9e88('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x9e88('0x3')]},'email':{'type':Sequelize[_0x9e88('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x9e88('0x3')]},'sPostalCode':{'type':Sequelize[_0x9e88('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9e88('0x3')]},'description':{'type':Sequelize[_0x9e88('0x3')]}}; \ No newline at end of file +var _0xf61e=['STRING','name','sequelize','exports'];(function(_0x526deb,_0x13850c){var _0x150f5f=function(_0x2db91a){while(--_0x2db91a){_0x526deb['push'](_0x526deb['shift']());}};_0x150f5f(++_0x13850c);}(_0xf61e,0x15e));var _0xef61=function(_0x1d37f3,_0x26530d){_0x1d37f3=_0x1d37f3-0x0;var _0x5c72ae=_0xf61e[_0x1d37f3];return _0x5c72ae;};'use strict';var Sequelize=require(_0xef61('0x0'));module[_0xef61('0x1')]={'name':{'type':Sequelize[_0xef61('0x2')],'unique':_0xef61('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xef61('0x2')]},'companyId':{'type':Sequelize[_0xef61('0x2')]},'website':{'type':Sequelize[_0xef61('0x2')]},'phone':{'type':Sequelize[_0xef61('0x2')]},'fax':{'type':Sequelize[_0xef61('0x2')]},'type':{'type':Sequelize[_0xef61('0x2')]},'street':{'type':Sequelize[_0xef61('0x2')]},'postalCode':{'type':Sequelize[_0xef61('0x2')]},'city':{'type':Sequelize[_0xef61('0x2')]},'country':{'type':Sequelize[_0xef61('0x2')]},'email':{'type':Sequelize[_0xef61('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0xef61('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xef61('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 6b6aa31..d830db7 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 _0x78f8=['fields','attributes','length','model','nolimit','sort','where','pick','filter','merge','map','options','includeAll','include','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','rawAttributes','order','getContacts','hasOwnProperty','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','sendStatus','name','send','index','CmCompany','describe','keys','query','filters','intersection'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x78f8,0x76));var _0x878f=function(_0xaad6b9,_0x2d8417){_0xaad6b9=_0xaad6b9-0x0;var _0x396828=_0x78f8[_0xaad6b9];return _0x396828;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x878f('0x0'));var rp=require(_0x878f('0x1'));var moment=require(_0x878f('0x2'));var BPromise=require(_0x878f('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x878f('0x4'));var sox=require(_0x878f('0x5'));var csv=require(_0x878f('0x6'));var ejs=require(_0x878f('0x7'));var fs=require('fs');var fs_extra=require(_0x878f('0x8'));var _=require(_0x878f('0x9'));var squel=require(_0x878f('0xa'));var crypto=require(_0x878f('0xb'));var jsforce=require(_0x878f('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x878f('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x878f('0xe'));var as=require(_0x878f('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x878f('0x10'))(_0x878f('0x11'));var utils=require(_0x878f('0x12'));var config=require(_0x878f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x242207,_0xc2e088){_0xc2e088=_0xc2e088||0xcc;return function(_0x1a301c){if(_0x1a301c){return _0x242207['sendStatus'](_0xc2e088);}return _0x242207[_0x878f('0x14')](_0xc2e088)[_0x878f('0x15')]();};}function respondWithResult(_0x558d43,_0x129b63){_0x129b63=_0x129b63||0xc8;return function(_0x110911){if(_0x110911){return _0x558d43[_0x878f('0x14')](_0x129b63)['json'](_0x110911);}};}function respondWithFilteredResult(_0x2a4b11,_0x267ff4){return function(_0x11dcaa){if(_0x11dcaa){var _0x118304=typeof _0x267ff4[_0x878f('0x16')]==='undefined'&&typeof _0x267ff4[_0x878f('0x17')]===_0x878f('0x18');var _0x2c3ae1=_0x11dcaa['count'];var _0x774f0a=_0x118304?0x0:_0x267ff4['offset'];var _0x33a6f9=_0x118304?_0x11dcaa[_0x878f('0x19')]:_0x267ff4[_0x878f('0x16')]+_0x267ff4[_0x878f('0x17')];var _0x47bf49;if(_0x33a6f9>=_0x2c3ae1){_0x33a6f9=_0x2c3ae1;_0x47bf49=0xc8;}else{_0x47bf49=0xce;}_0x2a4b11[_0x878f('0x14')](_0x47bf49);return _0x2a4b11[_0x878f('0x1a')](_0x878f('0x1b'),_0x774f0a+'-'+_0x33a6f9+'/'+_0x2c3ae1)[_0x878f('0x1c')](_0x11dcaa);}return null;};}function patchUpdates(_0xbeabaa){return function(_0x2afdeb){try{jsonpatch[_0x878f('0x1d')](_0x2afdeb,_0xbeabaa,!![]);}catch(_0x117786){return BPromise[_0x878f('0x1e')](_0x117786);}return _0x2afdeb[_0x878f('0x1f')]();};}function saveUpdates(_0x77289b,_0x2369d8){return function(_0x3e9d9e){if(_0x3e9d9e){return _0x3e9d9e[_0x878f('0x20')](_0x77289b)['then'](function(_0x23256f){return _0x23256f;});}return null;};}function removeEntity(_0xf6ae9b,_0x2c611f){return function(_0x14e272){if(_0x14e272){return _0x14e272[_0x878f('0x21')]()[_0x878f('0x22')](function(){var _0x19c561=_0x14e272[_0x878f('0x23')]({'plain':!![]});var _0x463dc9=_0x878f('0x24');return db[_0x878f('0x25')][_0x878f('0x21')]({'where':{'type':_0x463dc9,'resourceId':_0x19c561['id']}})[_0x878f('0x22')](function(){return _0x14e272;});})[_0x878f('0x22')](function(){_0xf6ae9b[_0x878f('0x14')](0xcc)[_0x878f('0x15')]();});}};}function handleEntityNotFound(_0x4306ef,_0x1dd645){return function(_0x2be587){if(!_0x2be587){_0x4306ef[_0x878f('0x26')](0x194);}return _0x2be587;};}function handleError(_0x59f96c,_0x2fc51a){_0x2fc51a=_0x2fc51a||0x1f4;return function(_0x164f6b){logger['error'](_0x164f6b['stack']);if(_0x164f6b[_0x878f('0x27')]){delete _0x164f6b['name'];}_0x59f96c['status'](_0x2fc51a)[_0x878f('0x28')](_0x164f6b);};}exports[_0x878f('0x29')]=function(_0x1d538c,_0x962205){var _0x55b94b={},_0x229ae7={},_0x33301a={'count':0x0,'rows':[]};return db[_0x878f('0x2a')][_0x878f('0x2b')]()[_0x878f('0x22')](function(_0x5d52ab){_0x229ae7['model']=_[_0x878f('0x2c')](_0x5d52ab);_0x229ae7['query']=_[_0x878f('0x2c')](_0x1d538c[_0x878f('0x2d')]);_0x229ae7[_0x878f('0x2e')]=_[_0x878f('0x2f')](_0x229ae7['model'],_0x229ae7[_0x878f('0x2d')]);_0x55b94b['attributes']=_['intersection'](_0x229ae7['model'],qs[_0x878f('0x30')](_0x1d538c[_0x878f('0x2d')][_0x878f('0x30')]));_0x55b94b[_0x878f('0x31')]=_0x55b94b[_0x878f('0x31')][_0x878f('0x32')]?_0x55b94b[_0x878f('0x31')]:_0x229ae7[_0x878f('0x33')];if(!_0x1d538c['query']['hasOwnProperty'](_0x878f('0x34'))){_0x55b94b[_0x878f('0x17')]=qs[_0x878f('0x17')](_0x1d538c['query']['limit']);_0x55b94b[_0x878f('0x16')]=qs[_0x878f('0x16')](_0x1d538c[_0x878f('0x2d')][_0x878f('0x16')]);}_0x55b94b['order']=qs['sort'](_0x1d538c[_0x878f('0x2d')][_0x878f('0x35')]);_0x55b94b[_0x878f('0x36')]=qs[_0x878f('0x2e')](_[_0x878f('0x37')](_0x1d538c[_0x878f('0x2d')],_0x229ae7[_0x878f('0x2e')]),_0x5d52ab);if(_0x1d538c[_0x878f('0x2d')][_0x878f('0x38')]){_0x55b94b[_0x878f('0x36')]=_[_0x878f('0x39')](_0x55b94b[_0x878f('0x36')],{'$or':_[_0x878f('0x3a')](_0x55b94b[_0x878f('0x31')],function(_0x106c82){var _0x12dd01={};_0x12dd01[_0x106c82]={'$like':'%'+_0x1d538c[_0x878f('0x2d')]['filter']+'%'};return _0x12dd01;})});}_0x55b94b=_[_0x878f('0x39')]({},_0x55b94b,_0x1d538c[_0x878f('0x3b')]);var _0x9da32c={'where':_0x55b94b[_0x878f('0x36')]};return db[_0x878f('0x2a')]['count'](_0x9da32c)[_0x878f('0x22')](function(_0x4776ea){_0x33301a['count']=_0x4776ea;if(_0x1d538c[_0x878f('0x2d')][_0x878f('0x3c')]){_0x55b94b[_0x878f('0x3d')]=[{'all':!![]}];}return db[_0x878f('0x2a')]['findAll'](_0x55b94b);})[_0x878f('0x22')](function(_0x16b02b){_0x33301a[_0x878f('0x3e')]=_0x16b02b;return _0x33301a;})['then'](respondWithFilteredResult(_0x962205,_0x55b94b))[_0x878f('0x3f')](handleError(_0x962205,null));})[_0x878f('0x3f')](handleError(_0x962205,null));};exports[_0x878f('0x40')]=function(_0x58f580,_0x4bdb07){var _0x72130b={'raw':![],'where':{'id':_0x58f580['params']['id']}},_0x325aaa={};_0x325aaa[_0x878f('0x33')]=_[_0x878f('0x2c')](db[_0x878f('0x2a')]['rawAttributes']);_0x325aaa[_0x878f('0x2d')]=_[_0x878f('0x2c')](_0x58f580[_0x878f('0x2d')]);_0x325aaa['filters']=_['intersection'](_0x325aaa[_0x878f('0x33')],_0x325aaa[_0x878f('0x2d')]);_0x72130b['attributes']=_['intersection'](_0x325aaa[_0x878f('0x33')],qs[_0x878f('0x30')](_0x58f580[_0x878f('0x2d')][_0x878f('0x30')]));_0x72130b[_0x878f('0x31')]=_0x72130b[_0x878f('0x31')][_0x878f('0x32')]?_0x72130b[_0x878f('0x31')]:_0x325aaa[_0x878f('0x33')];if(_0x58f580[_0x878f('0x2d')][_0x878f('0x3c')]){_0x72130b[_0x878f('0x3d')]=[{'all':!![]}];}_0x72130b=_[_0x878f('0x39')]({},_0x72130b,_0x58f580[_0x878f('0x3b')]);return db[_0x878f('0x2a')][_0x878f('0x41')](_0x72130b)[_0x878f('0x22')](handleEntityNotFound(_0x4bdb07,null))['then'](respondWithResult(_0x4bdb07,null))[_0x878f('0x3f')](handleError(_0x4bdb07,null));};exports[_0x878f('0x42')]=function(_0x54a7ed,_0x5b8882){return db[_0x878f('0x2a')][_0x878f('0x42')](_0x54a7ed[_0x878f('0x43')],{})[_0x878f('0x22')](function(_0x3ae16c){var _0x350f08=_0x54a7ed[_0x878f('0x44')]['get']({'plain':!![]});if(!_0x350f08)throw new Error(_0x878f('0x45'));if(_0x350f08['role']===_0x878f('0x44')){var _0x573d9f=_0x3ae16c['get']({'plain':!![]});var _0x409e41=_0x878f('0x24');return db[_0x878f('0x46')][_0x878f('0x41')]({'where':{'name':_0x409e41,'userProfileId':_0x350f08[_0x878f('0x47')]},'raw':!![]})[_0x878f('0x22')](function(_0x49ff44){if(_0x49ff44&&_0x49ff44[_0x878f('0x48')]===0x0){return db[_0x878f('0x25')][_0x878f('0x42')]({'name':_0x573d9f['name'],'resourceId':_0x573d9f['id'],'type':_0x49ff44['name'],'sectionId':_0x49ff44['id']},{})[_0x878f('0x22')](function(){return _0x3ae16c;});}else{return _0x3ae16c;}})['catch'](function(_0x5e0f49){logger[_0x878f('0x49')](_0x878f('0x4a'),_0x5e0f49);throw _0x5e0f49;});}return _0x3ae16c;})[_0x878f('0x22')](respondWithResult(_0x5b8882,0xc9))[_0x878f('0x3f')](handleError(_0x5b8882,null));};exports[_0x878f('0x20')]=function(_0x11303b,_0x594606){if(_0x11303b[_0x878f('0x43')]['id']){delete _0x11303b[_0x878f('0x43')]['id'];}return db[_0x878f('0x2a')][_0x878f('0x41')]({'where':{'id':_0x11303b['params']['id']}})[_0x878f('0x22')](handleEntityNotFound(_0x594606,null))[_0x878f('0x22')](saveUpdates(_0x11303b['body'],null))[_0x878f('0x22')](respondWithResult(_0x594606,null))['catch'](handleError(_0x594606,null));};exports[_0x878f('0x21')]=function(_0x4a86d6,_0x11a879){return db['CmCompany'][_0x878f('0x41')]({'where':{'id':_0x4a86d6[_0x878f('0x4b')]['id']}})[_0x878f('0x22')](handleEntityNotFound(_0x11a879,null))[_0x878f('0x22')](removeEntity(_0x11a879,null))[_0x878f('0x3f')](handleError(_0x11a879,null));};exports['describe']=function(_0x28b562,_0x1ee070){return db[_0x878f('0x2a')][_0x878f('0x2b')]()[_0x878f('0x22')](respondWithResult(_0x1ee070,null))[_0x878f('0x3f')](handleError(_0x1ee070,null));};exports[_0x878f('0x4c')]=function(_0x199e95,_0x384fd5,_0x40b89e){return db[_0x878f('0x4d')][_0x878f('0x41')]({'where':{'id':_0x199e95[_0x878f('0x4b')]['id']}})[_0x878f('0x22')](handleEntityNotFound(_0x384fd5,null))['then'](function(_0x247283){if(_0x247283){return _0x247283[_0x878f('0x4c')](_0x199e95[_0x878f('0x43')][_0x878f('0x4e')],_['omit'](_0x199e95['body'],[_0x878f('0x4e'),'id'])||{});}})[_0x878f('0x22')](respondWithResult(_0x384fd5,null))[_0x878f('0x3f')](handleError(_0x384fd5,null));};exports['getContacts']=function(_0xa74226,_0x39bdae,_0x4d14da){var _0x19065d={};var _0x5a7ac4={};var _0x3f36d8;var _0x1bd419;return db[_0x878f('0x2a')]['findOne']({'where':{'id':_0xa74226[_0x878f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39bdae,null))[_0x878f('0x22')](function(_0x1c4b33){if(_0x1c4b33){_0x3f36d8=_0x1c4b33;_0x5a7ac4[_0x878f('0x33')]=_[_0x878f('0x2c')](db[_0x878f('0x4d')][_0x878f('0x4f')]);_0x5a7ac4[_0x878f('0x2d')]=_[_0x878f('0x2c')](_0xa74226[_0x878f('0x2d')]);_0x5a7ac4[_0x878f('0x2e')]=_['intersection'](_0x5a7ac4[_0x878f('0x33')],_0x5a7ac4[_0x878f('0x2d')]);_0x19065d[_0x878f('0x31')]=_[_0x878f('0x2f')](_0x5a7ac4[_0x878f('0x33')],qs[_0x878f('0x30')](_0xa74226[_0x878f('0x2d')][_0x878f('0x30')]));_0x19065d[_0x878f('0x31')]=_0x19065d['attributes']['length']?_0x19065d['attributes']:_0x5a7ac4[_0x878f('0x33')];_0x19065d[_0x878f('0x50')]=qs[_0x878f('0x35')](_0xa74226[_0x878f('0x2d')][_0x878f('0x35')]);_0x19065d['where']=qs['filters'](_['pick'](_0xa74226[_0x878f('0x2d')],_0x5a7ac4[_0x878f('0x2e')]));if(_0xa74226[_0x878f('0x2d')][_0x878f('0x38')]){_0x19065d[_0x878f('0x36')]=_['merge'](_0x19065d[_0x878f('0x36')],{'$or':_['map'](_0x19065d[_0x878f('0x31')],function(_0x2763cb){var _0x1870a2={};_0x1870a2[_0x2763cb]={'$like':'%'+_0xa74226['query'][_0x878f('0x38')]+'%'};return _0x1870a2;})});}_0x19065d=_[_0x878f('0x39')]({},_0x19065d,_0xa74226[_0x878f('0x3b')]);return _0x3f36d8[_0x878f('0x51')](_0x19065d);}})[_0x878f('0x22')](function(_0x1ff19f){if(_0x1ff19f){_0x1bd419=_0x1ff19f[_0x878f('0x32')];if(!_0xa74226[_0x878f('0x2d')][_0x878f('0x52')](_0x878f('0x34'))){_0x19065d[_0x878f('0x17')]=qs['limit'](_0xa74226[_0x878f('0x2d')][_0x878f('0x17')]);_0x19065d['offset']=qs[_0x878f('0x16')](_0xa74226[_0x878f('0x2d')][_0x878f('0x16')]);}return _0x3f36d8[_0x878f('0x51')](_0x19065d);}})[_0x878f('0x22')](function(_0xf41596){if(_0xf41596){return _0xf41596?{'count':_0x1bd419,'rows':_0xf41596}:null;}})[_0x878f('0x22')](respondWithResult(_0x39bdae,null))[_0x878f('0x3f')](handleError(_0x39bdae,null));}; \ No newline at end of file +var _0x2f7c=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','get','Companies','UserProfileResource','destroy','end','error','name','CmCompany','describe','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','options','includeAll','include','rows','catch','params','rawAttributes','intersection','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','CmContact','ids','omit','getContacts','findOne','pick','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x39db8d,_0x37bc60){var _0x5a6e3d=function(_0x44fdb1){while(--_0x44fdb1){_0x39db8d['push'](_0x39db8d['shift']());}};_0x5a6e3d(++_0x37bc60);}(_0x2f7c,0xf2));var _0xc2f7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2f7c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc2f7('0x0'));var rimraf=require(_0xc2f7('0x1'));var zipdir=require(_0xc2f7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc2f7('0x3'));var BPromise=require(_0xc2f7('0x4'));var Mustache=require(_0xc2f7('0x5'));var util=require('util');var path=require(_0xc2f7('0x6'));var sox=require(_0xc2f7('0x7'));var csv=require(_0xc2f7('0x8'));var ejs=require(_0xc2f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc2f7('0xa'));var squel=require(_0xc2f7('0xb'));var crypto=require(_0xc2f7('0xc'));var jsforce=require(_0xc2f7('0xd'));var deskjs=require(_0xc2f7('0xe'));var toCsv=require(_0xc2f7('0x8'));var querystring=require(_0xc2f7('0xf'));var Papa=require('papaparse');var Redis=require(_0xc2f7('0x10'));var authService=require(_0xc2f7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc2f7('0x12'));var hardwareService=require(_0xc2f7('0x13'));var logger=require(_0xc2f7('0x14'))(_0xc2f7('0x15'));var utils=require('../../config/utils');var config=require(_0xc2f7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc2f7('0x17'))['db'];function respondWithStatusCode(_0x11fce2,_0x37c1cd){_0x37c1cd=_0x37c1cd||0xcc;return function(_0xaa3046){if(_0xaa3046){return _0x11fce2[_0xc2f7('0x18')](_0x37c1cd);}return _0x11fce2[_0xc2f7('0x19')](_0x37c1cd)['end']();};}function respondWithResult(_0x44240a,_0x582a52){_0x582a52=_0x582a52||0xc8;return function(_0x46007f){if(_0x46007f){return _0x44240a[_0xc2f7('0x19')](_0x582a52)[_0xc2f7('0x1a')](_0x46007f);}};}function respondWithFilteredResult(_0x243d80,_0x5a0fc5){return function(_0x463bad){if(_0x463bad){var _0xafdff5=typeof _0x5a0fc5[_0xc2f7('0x1b')]==='undefined'&&typeof _0x5a0fc5[_0xc2f7('0x1c')]===_0xc2f7('0x1d');var _0x51cd88=_0x463bad[_0xc2f7('0x1e')];var _0x5d87dd=_0xafdff5?0x0:_0x5a0fc5[_0xc2f7('0x1b')];var _0x34af41=_0xafdff5?_0x463bad[_0xc2f7('0x1e')]:_0x5a0fc5[_0xc2f7('0x1b')]+_0x5a0fc5[_0xc2f7('0x1c')];var _0x4c93d1;if(_0x34af41>=_0x51cd88){_0x34af41=_0x51cd88;_0x4c93d1=0xc8;}else{_0x4c93d1=0xce;}_0x243d80[_0xc2f7('0x19')](_0x4c93d1);return _0x243d80['set'](_0xc2f7('0x1f'),_0x5d87dd+'-'+_0x34af41+'/'+_0x51cd88)[_0xc2f7('0x1a')](_0x463bad);}return null;};}function patchUpdates(_0x361170){return function(_0x2d52c0){try{jsonpatch[_0xc2f7('0x20')](_0x2d52c0,_0x361170,!![]);}catch(_0x4f52df){return BPromise[_0xc2f7('0x21')](_0x4f52df);}return _0x2d52c0[_0xc2f7('0x22')]();};}function saveUpdates(_0x2f72eb,_0x2f8649){return function(_0x202e12){if(_0x202e12){return _0x202e12['update'](_0x2f72eb)[_0xc2f7('0x23')](function(_0x5477ef){return _0x5477ef;});}return null;};}function removeEntity(_0x1a3059,_0x39d84d){return function(_0x246908){if(_0x246908){return _0x246908['destroy']()['then'](function(){var _0x752087=_0x246908[_0xc2f7('0x24')]({'plain':!![]});var _0x43a8dc=_0xc2f7('0x25');return db[_0xc2f7('0x26')][_0xc2f7('0x27')]({'where':{'type':_0x43a8dc,'resourceId':_0x752087['id']}})[_0xc2f7('0x23')](function(){return _0x246908;});})[_0xc2f7('0x23')](function(){_0x1a3059[_0xc2f7('0x19')](0xcc)[_0xc2f7('0x28')]();});}};}function handleEntityNotFound(_0x39d0fa,_0x5c73f5){return function(_0x468d9a){if(!_0x468d9a){_0x39d0fa[_0xc2f7('0x18')](0x194);}return _0x468d9a;};}function handleError(_0xab47ec,_0x110e46){_0x110e46=_0x110e46||0x1f4;return function(_0x271505){logger[_0xc2f7('0x29')](_0x271505['stack']);if(_0x271505[_0xc2f7('0x2a')]){delete _0x271505[_0xc2f7('0x2a')];}_0xab47ec[_0xc2f7('0x19')](_0x110e46)['send'](_0x271505);};}exports['index']=function(_0x59a753,_0x38a861){var _0x4e62d7={},_0x2d681e={},_0x4a64cc={'count':0x0,'rows':[]};return db[_0xc2f7('0x2b')][_0xc2f7('0x2c')]()[_0xc2f7('0x23')](function(_0x1f0c68){_0x2d681e[_0xc2f7('0x2d')]=_['keys'](_0x1f0c68);_0x2d681e[_0xc2f7('0x2e')]=_[_0xc2f7('0x2f')](_0x59a753['query']);_0x2d681e['filters']=_['intersection'](_0x2d681e[_0xc2f7('0x2d')],_0x2d681e[_0xc2f7('0x2e')]);_0x4e62d7[_0xc2f7('0x30')]=_['intersection'](_0x2d681e['model'],qs[_0xc2f7('0x31')](_0x59a753['query'][_0xc2f7('0x31')]));_0x4e62d7[_0xc2f7('0x30')]=_0x4e62d7['attributes'][_0xc2f7('0x32')]?_0x4e62d7[_0xc2f7('0x30')]:_0x2d681e['model'];if(!_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x33')](_0xc2f7('0x34'))){_0x4e62d7[_0xc2f7('0x1c')]=qs[_0xc2f7('0x1c')](_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x1c')]);_0x4e62d7[_0xc2f7('0x1b')]=qs[_0xc2f7('0x1b')](_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x1b')]);}_0x4e62d7[_0xc2f7('0x35')]=qs[_0xc2f7('0x36')](_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x36')]);_0x4e62d7[_0xc2f7('0x37')]=qs[_0xc2f7('0x38')](_['pick'](_0x59a753[_0xc2f7('0x2e')],_0x2d681e[_0xc2f7('0x38')]),_0x1f0c68);if(_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x39')]){_0x4e62d7['where']=_[_0xc2f7('0x3a')](_0x4e62d7[_0xc2f7('0x37')],{'$or':_[_0xc2f7('0x3b')](_0x4e62d7['attributes'],function(_0x1860c7){var _0x4a6015={};_0x4a6015[_0x1860c7]={'$like':'%'+_0x59a753['query']['filter']+'%'};return _0x4a6015;})});}_0x4e62d7=_[_0xc2f7('0x3a')]({},_0x4e62d7,_0x59a753[_0xc2f7('0x3c')]);var _0xb869b4={'where':_0x4e62d7['where']};return db[_0xc2f7('0x2b')]['count'](_0xb869b4)['then'](function(_0x4abce8){_0x4a64cc[_0xc2f7('0x1e')]=_0x4abce8;if(_0x59a753[_0xc2f7('0x2e')][_0xc2f7('0x3d')]){_0x4e62d7[_0xc2f7('0x3e')]=[{'all':!![]}];}return db[_0xc2f7('0x2b')]['findAll'](_0x4e62d7);})['then'](function(_0x38d731){_0x4a64cc[_0xc2f7('0x3f')]=_0x38d731;return _0x4a64cc;})[_0xc2f7('0x23')](respondWithFilteredResult(_0x38a861,_0x4e62d7))[_0xc2f7('0x40')](handleError(_0x38a861,null));})[_0xc2f7('0x40')](handleError(_0x38a861,null));};exports['show']=function(_0xdaafdd,_0x547f0f){var _0x206699={'raw':![],'where':{'id':_0xdaafdd[_0xc2f7('0x41')]['id']}},_0xd1443={};_0xd1443[_0xc2f7('0x2d')]=_[_0xc2f7('0x2f')](db[_0xc2f7('0x2b')][_0xc2f7('0x42')]);_0xd1443['query']=_[_0xc2f7('0x2f')](_0xdaafdd['query']);_0xd1443['filters']=_[_0xc2f7('0x43')](_0xd1443[_0xc2f7('0x2d')],_0xd1443['query']);_0x206699['attributes']=_['intersection'](_0xd1443['model'],qs['fields'](_0xdaafdd[_0xc2f7('0x2e')][_0xc2f7('0x31')]));_0x206699['attributes']=_0x206699[_0xc2f7('0x30')][_0xc2f7('0x32')]?_0x206699['attributes']:_0xd1443[_0xc2f7('0x2d')];if(_0xdaafdd[_0xc2f7('0x2e')][_0xc2f7('0x3d')]){_0x206699[_0xc2f7('0x3e')]=[{'all':!![]}];}_0x206699=_[_0xc2f7('0x3a')]({},_0x206699,_0xdaafdd[_0xc2f7('0x3c')]);return db[_0xc2f7('0x2b')][_0xc2f7('0x44')](_0x206699)[_0xc2f7('0x23')](handleEntityNotFound(_0x547f0f,null))['then'](respondWithResult(_0x547f0f,null))[_0xc2f7('0x40')](handleError(_0x547f0f,null));};exports[_0xc2f7('0x45')]=function(_0x4405e5,_0x57283c){return db['CmCompany'][_0xc2f7('0x45')](_0x4405e5[_0xc2f7('0x46')],{})[_0xc2f7('0x23')](function(_0x44fa63){var _0x57099b=_0x4405e5['user'][_0xc2f7('0x24')]({'plain':!![]});if(!_0x57099b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57099b['role']===_0xc2f7('0x47')){var _0x519ae3=_0x44fa63[_0xc2f7('0x24')]({'plain':!![]});var _0x7e2c04='Companies';return db[_0xc2f7('0x48')][_0xc2f7('0x44')]({'where':{'name':_0x7e2c04,'userProfileId':_0x57099b[_0xc2f7('0x49')]},'raw':!![]})[_0xc2f7('0x23')](function(_0x195ed0){if(_0x195ed0&&_0x195ed0[_0xc2f7('0x4a')]===0x0){return db['UserProfileResource'][_0xc2f7('0x45')]({'name':_0x519ae3['name'],'resourceId':_0x519ae3['id'],'type':_0x195ed0[_0xc2f7('0x2a')],'sectionId':_0x195ed0['id']},{})['then'](function(){return _0x44fa63;});}else{return _0x44fa63;}})[_0xc2f7('0x40')](function(_0x59a6e6){logger[_0xc2f7('0x29')](_0xc2f7('0x4b'),_0x59a6e6);throw _0x59a6e6;});}return _0x44fa63;})[_0xc2f7('0x23')](respondWithResult(_0x57283c,0xc9))['catch'](handleError(_0x57283c,null));};exports[_0xc2f7('0x4c')]=function(_0x20f595,_0x3ab0c8){if(_0x20f595[_0xc2f7('0x46')]['id']){delete _0x20f595[_0xc2f7('0x46')]['id'];}return db[_0xc2f7('0x2b')][_0xc2f7('0x44')]({'where':{'id':_0x20f595[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x3ab0c8,null))[_0xc2f7('0x23')](saveUpdates(_0x20f595[_0xc2f7('0x46')],null))['then'](respondWithResult(_0x3ab0c8,null))[_0xc2f7('0x40')](handleError(_0x3ab0c8,null));};exports[_0xc2f7('0x27')]=function(_0x2735c9,_0x4cb09f){return db[_0xc2f7('0x2b')][_0xc2f7('0x44')]({'where':{'id':_0x2735c9[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x4cb09f,null))[_0xc2f7('0x23')](removeEntity(_0x4cb09f,null))[_0xc2f7('0x40')](handleError(_0x4cb09f,null));};exports['describe']=function(_0x37c293,_0x42b8aa){return db[_0xc2f7('0x2b')]['describe']()['then'](respondWithResult(_0x42b8aa,null))[_0xc2f7('0x40')](handleError(_0x42b8aa,null));};exports[_0xc2f7('0x4d')]=function(_0x4161f3,_0x5d6177,_0x2537c4){return db[_0xc2f7('0x4e')][_0xc2f7('0x44')]({'where':{'id':_0x4161f3[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x5d6177,null))[_0xc2f7('0x23')](function(_0x228515){if(_0x228515){return _0x228515[_0xc2f7('0x4d')](_0x4161f3[_0xc2f7('0x46')][_0xc2f7('0x4f')],_[_0xc2f7('0x50')](_0x4161f3[_0xc2f7('0x46')],[_0xc2f7('0x4f'),'id'])||{});}})[_0xc2f7('0x23')](respondWithResult(_0x5d6177,null))['catch'](handleError(_0x5d6177,null));};exports[_0xc2f7('0x51')]=function(_0x8ffed4,_0x2e3363,_0x4388cf){var _0x480bf7={};var _0x1e088b={};var _0x2a1caa;var _0x316539;return db[_0xc2f7('0x2b')][_0xc2f7('0x52')]({'where':{'id':_0x8ffed4[_0xc2f7('0x41')]['id']}})[_0xc2f7('0x23')](handleEntityNotFound(_0x2e3363,null))[_0xc2f7('0x23')](function(_0x28601e){if(_0x28601e){_0x2a1caa=_0x28601e;_0x1e088b[_0xc2f7('0x2d')]=_[_0xc2f7('0x2f')](db[_0xc2f7('0x4e')][_0xc2f7('0x42')]);_0x1e088b[_0xc2f7('0x2e')]=_[_0xc2f7('0x2f')](_0x8ffed4[_0xc2f7('0x2e')]);_0x1e088b[_0xc2f7('0x38')]=_[_0xc2f7('0x43')](_0x1e088b[_0xc2f7('0x2d')],_0x1e088b[_0xc2f7('0x2e')]);_0x480bf7[_0xc2f7('0x30')]=_['intersection'](_0x1e088b[_0xc2f7('0x2d')],qs[_0xc2f7('0x31')](_0x8ffed4['query'][_0xc2f7('0x31')]));_0x480bf7[_0xc2f7('0x30')]=_0x480bf7['attributes'][_0xc2f7('0x32')]?_0x480bf7[_0xc2f7('0x30')]:_0x1e088b[_0xc2f7('0x2d')];_0x480bf7['order']=qs[_0xc2f7('0x36')](_0x8ffed4[_0xc2f7('0x2e')][_0xc2f7('0x36')]);_0x480bf7['where']=qs[_0xc2f7('0x38')](_[_0xc2f7('0x53')](_0x8ffed4[_0xc2f7('0x2e')],_0x1e088b['filters']));if(_0x8ffed4[_0xc2f7('0x2e')]['filter']){_0x480bf7['where']=_['merge'](_0x480bf7[_0xc2f7('0x37')],{'$or':_[_0xc2f7('0x3b')](_0x480bf7[_0xc2f7('0x30')],function(_0x1b6af1){var _0x5f4bd1={};_0x5f4bd1[_0x1b6af1]={'$like':'%'+_0x8ffed4[_0xc2f7('0x2e')]['filter']+'%'};return _0x5f4bd1;})});}_0x480bf7=_[_0xc2f7('0x3a')]({},_0x480bf7,_0x8ffed4[_0xc2f7('0x3c')]);return _0x2a1caa[_0xc2f7('0x51')](_0x480bf7);}})['then'](function(_0x4b9b62){if(_0x4b9b62){_0x316539=_0x4b9b62[_0xc2f7('0x32')];if(!_0x8ffed4['query'][_0xc2f7('0x33')](_0xc2f7('0x34'))){_0x480bf7[_0xc2f7('0x1c')]=qs['limit'](_0x8ffed4[_0xc2f7('0x2e')][_0xc2f7('0x1c')]);_0x480bf7[_0xc2f7('0x1b')]=qs[_0xc2f7('0x1b')](_0x8ffed4['query'][_0xc2f7('0x1b')]);}return _0x2a1caa['getContacts'](_0x480bf7);}})[_0xc2f7('0x23')](function(_0x227ef8){if(_0x227ef8){return _0x227ef8?{'count':_0x316539,'rows':_0x227ef8}:null;}})['then'](respondWithResult(_0x2e3363,null))['catch'](handleError(_0x2e3363,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 85f7f4d..aa1d87e 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 _0x2d91=['api','moment','bluebird','request-promise','../../config/environment','./cmCompany.attributes','exports','define','cm_companies','lodash','util','../../config/logger'];(function(_0x5eaac9,_0x1359a3){var _0x4dc4d7=function(_0x4a0f36){while(--_0x4a0f36){_0x5eaac9['push'](_0x5eaac9['shift']());}};_0x4dc4d7(++_0x1359a3);}(_0x2d91,0x171));var _0x12d9=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0x2d91[_0x5da27f];return _0x54a3fb;};'use strict';var _=require(_0x12d9('0x0'));var util=require(_0x12d9('0x1'));var logger=require(_0x12d9('0x2'))(_0x12d9('0x3'));var moment=require(_0x12d9('0x4'));var BPromise=require(_0x12d9('0x5'));var rp=require(_0x12d9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x12d9('0x7'));var attributes=require(_0x12d9('0x8'));module[_0x12d9('0x9')]=function(_0x1e372b,_0x305482){return _0x1e372b[_0x12d9('0xa')]('CmCompany',attributes,{'tableName':_0x12d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa22b=['bluebird','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','../../config/logger','api'];(function(_0x52fbb5,_0x35eafb){var _0x55bcbc=function(_0x4b58cb){while(--_0x4b58cb){_0x52fbb5['push'](_0x52fbb5['shift']());}};_0x55bcbc(++_0x35eafb);}(_0xa22b,0x165));var _0xba22=function(_0xe70ad1,_0x5ba59b){_0xe70ad1=_0xe70ad1-0x0;var _0x58d349=_0xa22b[_0xe70ad1];return _0x58d349;};'use strict';var _=require(_0xba22('0x0'));var util=require('util');var logger=require(_0xba22('0x1'))(_0xba22('0x2'));var moment=require('moment');var BPromise=require(_0xba22('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xba22('0x4'));var rimraf=require(_0xba22('0x5'));var config=require('../../config/environment');var attributes=require(_0xba22('0x6'));module[_0xba22('0x7')]=function(_0x333b50,_0x81b0ec){return _0x333b50[_0xba22('0x8')](_0xba22('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index b010be3..d4d6e60 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 _0x2141=['jayson/promise','client','http','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','CmCompany,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment'];(function(_0x59a762,_0x47e190){var _0x88bc4e=function(_0x3c82b1){while(--_0x3c82b1){_0x59a762['push'](_0x59a762['shift']());}};_0x88bc4e(++_0x47e190);}(_0x2141,0xea));var _0x1214=function(_0x566bb3,_0x4ef53f){_0x566bb3=_0x566bb3-0x0;var _0x16b08e=_0x2141[_0x566bb3];return _0x16b08e;};'use strict';var _=require('lodash');var util=require(_0x1214('0x0'));var moment=require(_0x1214('0x1'));var BPromise=require(_0x1214('0x2'));var rs=require(_0x1214('0x3'));var fs=require('fs');var Redis=require(_0x1214('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1214('0x5'));var logger=require(_0x1214('0x6'))('rpc');var config=require(_0x1214('0x7'));var jayson=require(_0x1214('0x8'));var client=jayson[_0x1214('0x9')][_0x1214('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b2afa,_0x50ba27,_0x28ddda){return new BPromise(function(_0xeeaf6d,_0x4989c0){return client[_0x1214('0xb')](_0x1b2afa,_0x28ddda)[_0x1214('0xc')](function(_0xb3c4d4){logger[_0x1214('0xd')]('CmCompany,\x20%s,\x20%s',_0x50ba27,_0x1214('0xe'));logger[_0x1214('0xf')](_0x1214('0x10'),_0x50ba27,_0x1214('0xe'),JSON[_0x1214('0x11')](_0xb3c4d4));if(_0xb3c4d4[_0x1214('0x12')]){if(_0xb3c4d4[_0x1214('0x12')]['code']===0x1f4){logger[_0x1214('0x12')](_0x1214('0x13'),_0x50ba27,_0xb3c4d4[_0x1214('0x12')]['message']);return _0x4989c0(_0xb3c4d4['error'][_0x1214('0x14')]);}logger['error'](_0x1214('0x13'),_0x50ba27,_0xb3c4d4[_0x1214('0x12')][_0x1214('0x14')]);return _0xeeaf6d(_0xb3c4d4['error'][_0x1214('0x14')]);}else{logger['info'](_0x1214('0x13'),_0x50ba27,_0x1214('0xe'));_0xeeaf6d(_0xb3c4d4['result'][_0x1214('0x14')]);}})[_0x1214('0x15')](function(_0x165566){logger['error'](_0x1214('0x13'),_0x50ba27,_0x165566);_0x4989c0(_0x165566);});});} \ No newline at end of file +var _0x2248=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x238743,_0x4449b9){var _0xf62818=function(_0x50fd5a){while(--_0x50fd5a){_0x238743['push'](_0x238743['shift']());}};_0xf62818(++_0x4449b9);}(_0x2248,0x15d));var _0x8224=function(_0x5846fc,_0x20ec41){_0x5846fc=_0x5846fc-0x0;var _0xdcd96b=_0x2248[_0x5846fc];return _0xdcd96b;};'use strict';var _=require(_0x8224('0x0'));var util=require(_0x8224('0x1'));var moment=require(_0x8224('0x2'));var BPromise=require(_0x8224('0x3'));var rs=require(_0x8224('0x4'));var fs=require('fs');var Redis=require(_0x8224('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8224('0x6'));var logger=require('../../config/logger')(_0x8224('0x7'));var config=require('../../config/environment');var jayson=require(_0x8224('0x8'));var client=jayson['client'][_0x8224('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20bda1,_0x22892e,_0x25b96f){return new BPromise(function(_0x1e7da2,_0x3c7a90){return client[_0x8224('0xa')](_0x20bda1,_0x25b96f)[_0x8224('0xb')](function(_0x190ffb){logger[_0x8224('0xc')](_0x8224('0xd'),_0x22892e,_0x8224('0xe'));logger[_0x8224('0xf')](_0x8224('0x10'),_0x22892e,_0x8224('0xe'),JSON[_0x8224('0x11')](_0x190ffb));if(_0x190ffb[_0x8224('0x12')]){if(_0x190ffb[_0x8224('0x12')][_0x8224('0x13')]===0x1f4){logger[_0x8224('0x12')](_0x8224('0xd'),_0x22892e,_0x190ffb[_0x8224('0x12')][_0x8224('0x14')]);return _0x3c7a90(_0x190ffb[_0x8224('0x12')]['message']);}logger[_0x8224('0x12')](_0x8224('0xd'),_0x22892e,_0x190ffb['error']['message']);return _0x1e7da2(_0x190ffb[_0x8224('0x12')][_0x8224('0x14')]);}else{logger[_0x8224('0xc')](_0x8224('0xd'),_0x22892e,_0x8224('0xe'));_0x1e7da2(_0x190ffb[_0x8224('0x15')][_0x8224('0x14')]);}})[_0x8224('0x16')](function(_0x8a9673){logger['error']('CmCompany,\x20%s,\x20%s',_0x22892e,_0x8a9673);_0x3c7a90(_0x8a9673);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 690bf76..a163984 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 _0xe262=['post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','/:id/contacts','getContacts'];(function(_0xc1c948,_0x122a61){var _0x11e655=function(_0x465d18){while(--_0x465d18){_0xc1c948['push'](_0xc1c948['shift']());}};_0x11e655(++_0x122a61);}(_0xe262,0x103));var _0x2e26=function(_0x586f40,_0x4cb712){_0x586f40=_0x586f40-0x0;var _0xedde8d=_0xe262[_0x586f40];return _0xedde8d;};'use strict';var multer=require(_0x2e26('0x0'));var util=require(_0x2e26('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2e26('0x2'));var router=express[_0x2e26('0x3')]();var fs_extra=require(_0x2e26('0x4'));var auth=require(_0x2e26('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x2e26('0x6')]('/',auth[_0x2e26('0x7')](),controller[_0x2e26('0x8')]);router[_0x2e26('0x6')](_0x2e26('0x9'),auth[_0x2e26('0x7')](),controller[_0x2e26('0xa')]);router[_0x2e26('0x6')]('/:id',auth[_0x2e26('0x7')](),controller[_0x2e26('0xb')]);router['get'](_0x2e26('0xc'),auth['isAuthenticated'](),controller[_0x2e26('0xd')]);router[_0x2e26('0xe')]('/',auth['isAuthenticated'](),controller[_0x2e26('0xf')]);router[_0x2e26('0xe')]('/:id/contacts',auth[_0x2e26('0x7')](),controller['addContacts']);router[_0x2e26('0x10')]('/:id',auth[_0x2e26('0x7')](),controller[_0x2e26('0x11')]);router[_0x2e26('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2e26('0x13')]);module[_0x2e26('0x14')]=router; \ No newline at end of file +var _0xa25d=['../../config/environment','get','/describe','isAuthenticated','describe','show','create','post','addContacts','put','/:id','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x329e45,_0x2a09db){var _0x25c632=function(_0x257b65){while(--_0x257b65){_0x329e45['push'](_0x329e45['shift']());}};_0x25c632(++_0x2a09db);}(_0xa25d,0x1e0));var _0xda25=function(_0x529587,_0x7b9e47){_0x529587=_0x529587-0x0;var _0x4ea039=_0xa25d[_0x529587];return _0x4ea039;};'use strict';var multer=require(_0xda25('0x0'));var util=require(_0xda25('0x1'));var path=require('path');var timeout=require(_0xda25('0x2'));var express=require('express');var router=express[_0xda25('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xda25('0x4'));var interaction=require(_0xda25('0x5'));var config=require(_0xda25('0x6'));var controller=require('./cmCompany.controller');router[_0xda25('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xda25('0x7')](_0xda25('0x8'),auth[_0xda25('0x9')](),controller[_0xda25('0xa')]);router[_0xda25('0x7')]('/:id',auth[_0xda25('0x9')](),controller[_0xda25('0xb')]);router[_0xda25('0x7')]('/:id/contacts',auth[_0xda25('0x9')](),controller['getContacts']);router['post']('/',auth[_0xda25('0x9')](),controller[_0xda25('0xc')]);router[_0xda25('0xd')]('/:id/contacts',auth[_0xda25('0x9')](),controller[_0xda25('0xe')]);router[_0xda25('0xf')](_0xda25('0x10'),auth[_0xda25('0x9')](),controller['update']);router['delete'](_0xda25('0x10'),auth['isAuthenticated'](),controller[_0xda25('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index add9b62..3c4df86 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 _0x2fbc=['STRING','TEXT','INTEGER','DATE','lodash','sequelize'];(function(_0x555772,_0x5c34cf){var _0x427064=function(_0x4ba13e){while(--_0x4ba13e){_0x555772['push'](_0x555772['shift']());}};_0x427064(++_0x5c34cf);}(_0x2fbc,0xf4));var _0xc2fb=function(_0xd12f0f,_0x176947){_0xd12f0f=_0xd12f0f-0x0;var _0x5a0473=_0x2fbc[_0xd12f0f];return _0x5a0473;};'use strict';var _=require(_0xc2fb('0x0'));var Sequelize=require(_0xc2fb('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xc2fb('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xc2fb('0x2')]},'street':{'type':Sequelize[_0xc2fb('0x2')]},'postalCode':{'type':Sequelize[_0xc2fb('0x2')]},'city':{'type':Sequelize[_0xc2fb('0x2')]},'country':{'type':Sequelize[_0xc2fb('0x2')]},'dateOfBirth':{'type':Sequelize[_0xc2fb('0x2')]},'description':{'type':Sequelize[_0xc2fb('0x3')]},'phone':{'type':Sequelize[_0xc2fb('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xc2fb('0x2')]},'email':{'type':Sequelize[_0xc2fb('0x2')]},'url':{'type':Sequelize[_0xc2fb('0x2')]},'facebook':{'type':Sequelize[_0xc2fb('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xc2fb('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xc2fb('0x2')]},'viber':{'type':Sequelize[_0xc2fb('0x2')]},'line':{'type':Sequelize[_0xc2fb('0x2')]},'wechat':{'type':Sequelize[_0xc2fb('0x2')]},'telegram':{'type':Sequelize[_0xc2fb('0x2')]},'UserId':{'type':Sequelize[_0xc2fb('0x4')]},'AdditionalPhones':{'type':Sequelize[_0xc2fb('0x2')]},'priority':{'type':Sequelize[_0xc2fb('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xc2fb('0x5')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0xc2fb('0x4')]}}; \ No newline at end of file +var _0x580f=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x580f,0x172));var _0xf580=function(_0x3a923c,_0x18c5e0){_0x3a923c=_0x3a923c-0x0;var _0x14096d=_0x580f[_0x3a923c];return _0x14096d;};'use strict';var _=require(_0xf580('0x0'));var Sequelize=require('sequelize');module[_0xf580('0x1')]={'firstName':{'type':Sequelize[_0xf580('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xf580('0x2')]},'street':{'type':Sequelize[_0xf580('0x2')]},'postalCode':{'type':Sequelize[_0xf580('0x2')]},'city':{'type':Sequelize[_0xf580('0x2')]},'country':{'type':Sequelize[_0xf580('0x2')]},'dateOfBirth':{'type':Sequelize[_0xf580('0x2')]},'description':{'type':Sequelize[_0xf580('0x3')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xf580('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xf580('0x2')]},'url':{'type':Sequelize[_0xf580('0x2')]},'facebook':{'type':Sequelize[_0xf580('0x2')]},'fb_data':{'type':Sequelize[_0xf580('0x2')]},'twitter':{'type':Sequelize[_0xf580('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xf580('0x2')]},'viber':{'type':Sequelize[_0xf580('0x2')]},'line':{'type':Sequelize[_0xf580('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0xf580('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0xf580('0x2')]},'priority':{'type':Sequelize[_0xf580('0x4')](0x2)[_0xf580('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf580('0x6')],'defaultValue':Sequelize[_0xf580('0x7')]},'dialTimezone':{'type':Sequelize[_0xf580('0x2')]},'utcOffset':{'type':Sequelize[_0xf580('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index be619cd..477fd11 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 _0xc99f=['stringify','message','pid','exit','error\x20child\x20process','importUpdates','agent','binding','../../components/import/cm/csvUpdates','start\x20child\x20process\x20correctly!','getJourney','mail','chat','sms','openchannel','whatsapp','-createdAt','resolve','channel','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','voice','uniqueid','source','destination','callerid','starttime','endtime','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','startCase','Website','Account','disposition','thirdDisposition','key','Owner','browserName','deviceModel','ratingMessage','ratingType','ratingValue','referer','subject','substatus','threadId','findAndCountAll','reverse','value','slice','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','error','stack','name','index','describe','getOptions','query','catch','find','params','CmContact','keys','length','cf_','columnName','displayName','analytics','CmCustomField','custom','type','info','hasOwnProperty','body','findAll','from','get','mergeWith','isArray','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','create','isNil','dialTimezone','utcOffset','timezones','additionalPhones','each','duplicates','where','ListId','findOrCreate','push','contact','Tag','Tags','color','tag','ContactItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','pickBy','startsWith','table','cm_contacts','setFields','id\x20=\x20?','toParam','values','phone','CmHopper','getTags','findOne','model','rawAttributes','filters','intersection','fields','attributes','order','pick','filter','merge','options','nolimit','setTags','ids','setAdditionalPhones','all','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','PHONE','CmHopperAdditionalPhone','item','ItemType','`ItemType`.OrderBy','CmHopperId','bulkCreate','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','toContactId','sort','ContactId','includeAll','include','rows','getHopperHistories','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','socket_timestamp','split','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','send','upload','createReadStream','meta','User','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2'];(function(_0xb38268,_0x4e101e){var _0x4963d0=function(_0xc9d95c){while(--_0xc9d95c){_0xb38268['push'](_0xb38268['shift']());}};_0x4963d0(++_0x4e101e);}(_0xc99f,0x139));var _0xfc99=function(_0x36ee10,_0x3e4e4b){_0x36ee10=_0x36ee10-0x0;var _0x1ae7e8=_0xc99f[_0x36ee10];return _0x1ae7e8;};'use strict';var moment=require(_0xfc99('0x0'));var BPromise=require(_0xfc99('0x1'));var util=require(_0xfc99('0x2'));var path=require(_0xfc99('0x3'));var fs=require('fs');var _=require(_0xfc99('0x4'));var squel=require(_0xfc99('0x5'));var Papa=require(_0xfc99('0x6'));var Redis=require(_0xfc99('0x7'));var contacts=require(_0xfc99('0x8'));var qs=require(_0xfc99('0x9'));var logger=require(_0xfc99('0xa'))(_0xfc99('0xb'));var config=require(_0xfc99('0xc'));var shared=require(_0xfc99('0xd'));var db=require('../../mysqldb')['db'];config[_0xfc99('0xe')]=_[_0xfc99('0xf')](config[_0xfc99('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc99('0x10'))(new Redis(config['redis']));require(_0xfc99('0x11'))[_0xfc99('0x12')](socket);function respondWithResult(_0x529c45,_0x39f1a2){_0x39f1a2=_0x39f1a2||0xc8;return function(_0x5e699c){if(_0x5e699c){return _0x529c45[_0xfc99('0x13')](_0x39f1a2)[_0xfc99('0x14')](_0x5e699c);}};}function respondWithFilteredResult(_0x331724,_0x31d44a){return function(_0xbecf0d){if(_0xbecf0d){var _0x5806c0=typeof _0x31d44a[_0xfc99('0x15')]===_0xfc99('0x16')&&typeof _0x31d44a[_0xfc99('0x17')]==='undefined';var _0x628625=_0xbecf0d[_0xfc99('0x18')];var _0x305da9=_0x5806c0?0x0:_0x31d44a['offset'];var _0x2ae414=_0x5806c0?_0xbecf0d[_0xfc99('0x18')]:_0x31d44a[_0xfc99('0x15')]+_0x31d44a[_0xfc99('0x17')];var _0x4d65d0;if(_0x2ae414>=_0x628625){_0x2ae414=_0x628625;_0x4d65d0=0xc8;}else{_0x4d65d0=0xce;}_0x331724[_0xfc99('0x13')](_0x4d65d0);return _0x331724[_0xfc99('0x19')](_0xfc99('0x1a'),_0x305da9+'-'+_0x2ae414+'/'+_0x628625)['json'](_0xbecf0d);}return null;};}function saveUpdates(_0x5b7fab){return function(_0x57fa8c){if(_0x57fa8c){return _0x57fa8c[_0xfc99('0x1b')](_0x5b7fab)[_0xfc99('0x1c')](function(_0x496061){return _0x496061;});}return null;};}function removeEntity(_0x5b5d9c){return function(_0x26162a){if(_0x26162a){return _0x26162a[_0xfc99('0x1d')]()['then'](function(){_0x5b5d9c[_0xfc99('0x13')](0xcc)[_0xfc99('0x1e')]();});}};}function handleEntityNotFound(_0x52095c){return function(_0x57301f){if(!_0x57301f){_0x52095c['sendStatus'](0x194);}return _0x57301f;};}function handleError(_0x5b927b,_0x4a94d4){_0x4a94d4=_0x4a94d4||0x1f4;return function(_0x40d088){logger[_0xfc99('0x1f')](_0x40d088[_0xfc99('0x20')]);if(_0x40d088[_0xfc99('0x21')]){delete _0x40d088[_0xfc99('0x21')];}_0x5b927b['status'](_0x4a94d4)['send'](_0x40d088);};}exports[_0xfc99('0x22')]=function(_0x1fc924,_0x4a314c){var _0x158784={};return contacts[_0xfc99('0x23')]()['then'](function(_0x142481){_0x158784=qs[_0xfc99('0x24')](_0x142481,_0x1fc924);return contacts['findAll'](_0x1fc924[_0xfc99('0x25')],_0x1fc924['user'],_0x158784,_0x142481);})[_0xfc99('0x1c')](respondWithFilteredResult(_0x4a314c,_0x158784))[_0xfc99('0x26')](handleError(_0x4a314c,null));};exports[_0xfc99('0x1d')]=function(_0x332c63,_0x59e1b8){return db['CmContact'][_0xfc99('0x27')]({'where':{'id':_0x332c63[_0xfc99('0x28')]['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x59e1b8,null))[_0xfc99('0x1c')](removeEntity(_0x59e1b8,null))[_0xfc99('0x26')](handleError(_0x59e1b8,null));};exports[_0xfc99('0x23')]=function(_0x1c4825,_0x5d9201){return db[_0xfc99('0x29')]['describe']()[_0xfc99('0x1c')](function(_0x443c83){delete _0x443c83['tags'];for(var _0xc86b72=0x0;_0xc86b720x0){return new Promise(function(_0x5ded95){var _0x3637f9=[];for(var _0x11f2a5=0x0;_0x11f2a5<_0x2494d1['length'];_0x11f2a5++){_0x3637f9[_0xfc99('0x62')](insertAdditionalPhones(_0x2494d1[_0x11f2a5][_0xfc99('0x63')],_0x2494d1[_0x11f2a5][_0xfc99('0x5c')]));}Promise['all'](_0x3637f9)['then'](function(){_0x5ded95(0x1);});})[_0xfc99('0x1c')](function(){return{'success':_0x282441,'failure':_0x48cf8d,'duplicates':_0x1dc63f};});}else{return{'success':_0x282441,'failure':_0x48cf8d,'duplicates':_0x1dc63f};}}})[_0xfc99('0x1c')](respondWithResult(_0x567467,0xc9))[_0xfc99('0x26')](handleError(_0x567467,null));};exports['show']=function(_0x29f079,_0x542501){var _0x588f73;return db[_0xfc99('0x29')][_0xfc99('0x23')]()[_0xfc99('0x1c')](function(_0x31fff7){return db[_0xfc99('0x29')][_0xfc99('0x27')]({'where':{'id':_0x29f079[_0xfc99('0x28')]['id']},'include':[{'model':db[_0xfc99('0x64')],'as':_0xfc99('0x65'),'attributes':['id',_0xfc99('0x21'),_0xfc99('0x66')],'required':_0x29f079[_0xfc99('0x25')][_0xfc99('0x67')]?!![]:![]},{'model':db['CmContactHasItem'],'as':'Phones','where':{'CmContactId':_0x29f079['params']['id']},'required':![],'include':[{'model':db[_0xfc99('0x68')],'as':'ItemType'}]}],'order':[db[_0xfc99('0x69')][_0xfc99('0x6a')](_0xfc99('0x6b'))],'attributes':_['keys'](_0x31fff7)});})['then'](function(_0x43a13e){if(!_[_0xfc99('0x58')](_0x43a13e)){_0x588f73=_0x43a13e['get']({'plain':!![]});var _0x4c337d={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x43a13e&&_0x43a13e[_0xfc99('0x60')]){if(_0x43a13e[_0xfc99('0x60')]){_0x4c337d['where'][_0xfc99('0x6c')][_0xfc99('0x62')]({'ListId':{'$ne':_0x43a13e['ListId']}});}}return db['CmCustomField'][_0xfc99('0x36')](_0x4c337d);}})[_0xfc99('0x1c')](function(_0x5d0a64){if(!_['isNil'](_0x5d0a64)){return _[_0xfc99('0x6d')](_0x588f73,_[_0xfc99('0x6e')](_0x5d0a64,function(_0x23cfb6){return util[_0xfc99('0x6f')](_0xfc99('0x70'),_0x23cfb6['id']);}));}})[_0xfc99('0x1c')](handleEntityNotFound(_0x542501,null))[_0xfc99('0x1c')](respondWithResult(_0x542501,null))[_0xfc99('0x26')](handleError(_0x542501,null));};exports['update']=function(_0x3b8008,_0x1cacad){var _0x369167;if(_0x3b8008['body']['id']){delete _0x3b8008[_0xfc99('0x35')]['id'];}if(!_[_0xfc99('0x58')](_0x3b8008[_0xfc99('0x35')][_0xfc99('0x59')])){var _0x22e59c=_0x3b8008[_0xfc99('0x35')][_0xfc99('0x59')];if(!_[_0xfc99('0x58')](shared[_0xfc99('0x5b')][_0x22e59c]))_0x3b8008[_0xfc99('0x35')]['utcOffset']=shared[_0xfc99('0x5b')][_0x22e59c]['utcOffset'];}return db['CmContact']['find']({'where':{'id':_0x3b8008[_0xfc99('0x28')]['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x1cacad,null))[_0xfc99('0x1c')](saveUpdates(_0x3b8008[_0xfc99('0x35')],null))[_0xfc99('0x1c')](function(_0x3b28d9){_0x369167=_0x3b28d9;var _0x1f73cc={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3b28d9&&_0x3b28d9[_0xfc99('0x60')]){if(_0x3b28d9[_0xfc99('0x60')]){_0x1f73cc[_0xfc99('0x5f')][_0xfc99('0x6c')][_0xfc99('0x62')]({'ListId':{'$ne':_0x3b28d9[_0xfc99('0x60')]}});}}return db[_0xfc99('0x30')]['findAll'](_0x1f73cc);})[_0xfc99('0x1c')](function(_0x4c5bd4){if(_0x4c5bd4){return _['omit'](_[_0xfc99('0x71')](_0x3b8008['body'],function(_0x350725,_0x1e2642){return _[_0xfc99('0x72')](_0x1e2642,_0xfc99('0x2c'));}),_[_0xfc99('0x6e')](_0x4c5bd4,function(_0x555cb0){return util[_0xfc99('0x6f')](_0xfc99('0x70'),_0x555cb0['id']);}));}})[_0xfc99('0x1c')](function(_0x12d0e6){if(_0x12d0e6&&!_['isEmpty'](_0x12d0e6)){var _0x2e654d=squel[_0xfc99('0x1b')]()[_0xfc99('0x73')](_0xfc99('0x74'))[_0xfc99('0x75')](_0x12d0e6)[_0xfc99('0x5f')](_0xfc99('0x76'),_0x3b8008[_0xfc99('0x28')]['id'])[_0xfc99('0x77')]();return db[_0xfc99('0x69')][_0xfc99('0x25')](_0x2e654d['text'],{'replacements':_0x2e654d[_0xfc99('0x78')]});}})['then'](function(){if(_0x3b8008['body'][_0xfc99('0x79')]&&_0x369167){return db[_0xfc99('0x7a')][_0xfc99('0x1b')]({'phone':_0x3b8008[_0xfc99('0x35')][_0xfc99('0x79')],'OrderBy':0x0},{'where':{'ContactId':_0x369167['id']}});}})['then'](function(){return _0x369167;})[_0xfc99('0x1c')](respondWithResult(_0x1cacad,null))[_0xfc99('0x26')](handleError(_0x1cacad,null));};exports[_0xfc99('0x7b')]=function(_0x418306,_0x166d65){var _0x362d00={};var _0x12e0bd={};var _0x1c9928;var _0x403e26;return db[_0xfc99('0x29')][_0xfc99('0x7c')]({'where':{'id':_0x418306['params']['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x166d65,null))['then'](function(_0x25f828){if(_0x25f828){_0x1c9928=_0x25f828;_0x12e0bd[_0xfc99('0x7d')]=_[_0xfc99('0x2a')](db[_0xfc99('0x64')][_0xfc99('0x7e')]);_0x12e0bd[_0xfc99('0x25')]=_[_0xfc99('0x2a')](_0x418306[_0xfc99('0x25')]);_0x12e0bd[_0xfc99('0x7f')]=_['intersection'](_0x12e0bd[_0xfc99('0x7d')],_0x12e0bd['query']);_0x362d00['attributes']=_[_0xfc99('0x80')](_0x12e0bd[_0xfc99('0x7d')],qs[_0xfc99('0x81')](_0x418306[_0xfc99('0x25')][_0xfc99('0x81')]));_0x362d00[_0xfc99('0x82')]=_0x362d00[_0xfc99('0x82')]['length']?_0x362d00['attributes']:_0x12e0bd['model'];_0x362d00[_0xfc99('0x83')]=qs['sort'](_0x418306[_0xfc99('0x25')]['sort']);_0x362d00[_0xfc99('0x5f')]=qs[_0xfc99('0x7f')](_[_0xfc99('0x84')](_0x418306[_0xfc99('0x25')],_0x12e0bd[_0xfc99('0x7f')]));if(_0x418306[_0xfc99('0x25')][_0xfc99('0x85')]){_0x362d00[_0xfc99('0x5f')]=_[_0xfc99('0x86')](_0x362d00[_0xfc99('0x5f')],{'$or':_[_0xfc99('0x6e')](_0x362d00[_0xfc99('0x82')],function(_0x453d0d){var _0x19734d={};_0x19734d[_0x453d0d]={'$like':'%'+_0x418306[_0xfc99('0x25')][_0xfc99('0x85')]+'%'};return _0x19734d;})});}_0x362d00=_[_0xfc99('0x86')]({},_0x362d00,_0x418306[_0xfc99('0x87')]);return _0x1c9928[_0xfc99('0x7b')](_0x362d00);}})['then'](function(_0x5add1a){if(_0x5add1a){_0x403e26=_0x5add1a['length'];if(!_0x418306[_0xfc99('0x25')]['hasOwnProperty'](_0xfc99('0x88'))){_0x362d00[_0xfc99('0x17')]=qs['limit'](_0x418306[_0xfc99('0x25')]['limit']);_0x362d00[_0xfc99('0x15')]=qs[_0xfc99('0x15')](_0x418306[_0xfc99('0x25')][_0xfc99('0x15')]);}return _0x1c9928[_0xfc99('0x7b')](_0x362d00);}})[_0xfc99('0x1c')](function(_0x3401d1){if(_0x3401d1){return _0x3401d1?{'count':_0x403e26,'rows':_0x3401d1}:null;}})[_0xfc99('0x1c')](respondWithResult(_0x166d65,null))['catch'](handleError(_0x166d65,null));};exports[_0xfc99('0x89')]=function(_0x2efce9,_0x196ed9){if(_0x2efce9['body']['id']){delete _0x2efce9['body']['id'];}return db[_0xfc99('0x29')][_0xfc99('0x7c')]({'where':{'id':_0x2efce9[_0xfc99('0x28')]['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x196ed9,null))['then'](function(_0x543d8f){if(_0x543d8f){return _0x543d8f['setTags'](_0x2efce9[_0xfc99('0x35')][_0xfc99('0x8a')]||[]);}return null;})[_0xfc99('0x1c')](respondWithResult(_0x196ed9,null))[_0xfc99('0x26')](handleError(_0x196ed9,null));};exports[_0xfc99('0x8b')]=function(_0x41e6f7,_0x2985c0){var _0x1c1e7e=[];_0x1c1e7e[_0xfc99('0x62')](addAdditionalPhones(_0x41e6f7[_0xfc99('0x35')]));Promise['all'](_0x1c1e7e)['then'](function(){_0x1c1e7e=[];_0x1c1e7e[_0xfc99('0x62')](deleteCmHopperPhones(_0x41e6f7[_0xfc99('0x35')]['id']));_0x1c1e7e[_0xfc99('0x62')](addCmHopperPhones(_0x41e6f7['body']['id']));Promise[_0xfc99('0x8c')](_0x1c1e7e)[_0xfc99('0x1c')](function(){return[0x1];})[_0xfc99('0x1c')](respondWithResult(_0x2985c0,null));});};function addAdditionalPhones(_0x9f8e19){var _0x17df7d;return new Promise(function(_0x4e5075){return db['CmContactHasItem'][_0xfc99('0x1d')]({'where':{'CmContactId':_0x9f8e19['id']}})['then'](function(){db[_0xfc99('0x68')][_0xfc99('0x36')]({'raw':!![],'attributes':['id',_0xfc99('0x8d')]})['then'](function(_0x5091d4){var _0x20ea6a=[];for(var _0x28c485=0x0;_0x28c485<_0x9f8e19[_0xfc99('0x8e')][_0xfc99('0x2b')];_0x28c485++){var _0x54ac56=_0x9f8e19['item_types']?_['isNil'](_0x9f8e19['item_types'][_0x28c485])?'':_0x9f8e19[_0xfc99('0x8f')][_0x28c485]:_0x9f8e19[_0xfc99('0x8e')][_0x28c485][_0xfc99('0x90')]?_0x9f8e19[_0xfc99('0x8e')][_0x28c485]['ItemTypeId']:'';var _0x4f54d1=_[_0xfc99('0x58')](_0x9f8e19[_0xfc99('0x8e')][_0x28c485][_0xfc99('0x91')])?'':_0x9f8e19[_0xfc99('0x8e')][_0x28c485][_0xfc99('0x91')];var _0x6910f2=_0x54ac56+':'+_0x9f8e19[_0xfc99('0x8e')][_0x28c485][_0xfc99('0x79')]+'§'+_0x4f54d1;if(_[_0xfc99('0x58')](_0x17df7d))_0x17df7d=_0x6910f2;else _0x17df7d+=';'+_0x6910f2;var _0x2c6162=null;var _0x309685=null;if(_0x9f8e19[_0xfc99('0x8f')]){if(!_[_0xfc99('0x58')](_0x9f8e19[_0xfc99('0x8f')][_0x28c485])){_0x309685=_[_0xfc99('0x27')](_0x5091d4,function(_0x3becc5){return _0x3becc5['id']===_0x9f8e19[_0xfc99('0x8f')][_0x28c485];});if(!_[_0xfc99('0x58')](_0x309685)){_0x2c6162=_0x309685['OrderBy'];}}}else{if(!_[_0xfc99('0x58')](_0x9f8e19[_0xfc99('0x8e')][_0x28c485])){_0x309685=_[_0xfc99('0x27')](_0x5091d4,function(_0x4c850f){return _0x4c850f['id']===_0x9f8e19[_0xfc99('0x8e')][_0x28c485][_0xfc99('0x90')];});if(!_['isNil'](_0x309685)){_0x2c6162=_0x28c485;}}}if(_[_0xfc99('0x58')](_0x2c6162)){_0x2c6162=0x64;}_0x20ea6a[_0xfc99('0x62')](addAdditionalPhone(_0x9f8e19['id'],_0x9f8e19[_0xfc99('0x8e')][_0x28c485][_0xfc99('0x79')],_0x9f8e19['item_types']?_['isNil'](_0x9f8e19[_0xfc99('0x8f')][_0x28c485])?null:_0x9f8e19[_0xfc99('0x8f')][_0x28c485]:_0x9f8e19['items'][_0x28c485]['ItemTypeId']?_0x9f8e19['items'][_0x28c485][_0xfc99('0x90')]:null,_0x2c6162,_0x4f54d1));}Promise['all'](_0x20ea6a)['then'](function(){db[_0xfc99('0x29')][_0xfc99('0x1b')]({'AdditionalPhones':_0x17df7d},{'where':{'id':_0x9f8e19['id']}})['then'](function(){_0x4e5075(0x1);});});});});});}function addAdditionalPhone(_0x2b34b0,_0x4aa797,_0x546de5,_0x2eb0c0,_0x58c528){return db[_0xfc99('0x4c')][_0xfc99('0x27')]({'where':{'CmContactId':_0x2b34b0,'item':_0x4aa797}})['then'](function(_0x2f223f){if(_0x2f223f)logger['info'](_0xfc99('0x92'),_0x2f223f);else{db[_0xfc99('0x4c')][_0xfc99('0x57')]({'CmContactId':_0x2b34b0,'item':_0x4aa797,'ItemTypeId':_0x546de5,'OrderBy':_0x2eb0c0,'ItemClass':_0xfc99('0x93'),'description':_0x58c528});}});}function deleteCmHopperPhones(_0x405264){return new Promise(function(_0x15eaf5){return db[_0xfc99('0x7a')][_0xfc99('0x36')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x405264}})[_0xfc99('0x1c')](function(_0x1e554d){db[_0xfc99('0x94')]['destroy']({'where':{'CmHopperId':{'$in':_[_0xfc99('0x6e')](_0x1e554d,'id')}}});})[_0xfc99('0x1c')](function(){_0x15eaf5(0x1);});});}function addCmHopperPhones(_0x143983){return new Promise(function(_0x546bb7){return db[_0xfc99('0x7a')][_0xfc99('0x36')]({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x143983}})[_0xfc99('0x1c')](function(_0x220b03){var _0x47ff51=[];_['map'](_0x220b03,function(_0x416a20){_0x47ff51['push'](createCmHopperPhone(_0x143983,_0x416a20['id']));});Promise[_0xfc99('0x8c')](_0x47ff51)[_0xfc99('0x1c')](function(){_0x546bb7(0x1);});});});}function createCmHopperPhone(_0x18c589,_0x4e7a90){return new Promise(function(_0x5a9aac){db['CmContactHasItem']['findAll']({'raw':!![],'attributes':[_0xfc99('0x95'),_0xfc99('0x8d')],'where':{'CmContactId':_0x18c589,'ItemClass':_0xfc99('0x93')},'include':[{'model':db['ContactItemType'],'attributes':[_0xfc99('0x8d')],'as':_0xfc99('0x96')}],'order':[_0xfc99('0x8d'),db[_0xfc99('0x69')]['literal'](_0xfc99('0x97'))]})[_0xfc99('0x1c')](function(_0xe91a7a){var _0x2cc33d=0x1;var _0x12dab9=_[_0xfc99('0x6e')](_0xe91a7a,function(_0x5c81ca){_0x5c81ca[_0xfc99('0x98')]=_0x4e7a90;_0x5c81ca[_0xfc99('0x79')]=_0x5c81ca[_0xfc99('0x95')];_0x5c81ca[_0xfc99('0x8d')]=_0x2cc33d;delete _0x5c81ca['ItemType.OrderBy'];_0x2cc33d=_0x2cc33d+0x1;return _0x5c81ca;});return db[_0xfc99('0x94')][_0xfc99('0x99')](_0x12dab9,{});})['then'](function(){_0x5a9aac(0x1);});});}function insertAdditionalPhones(_0x2cfa78,_0x337267){return new Promise(function(_0x15354d){var _0x197647=[];for(var _0x25bc5c=0x0;_0x25bc5c<_0x337267[_0xfc99('0x2b')];_0x25bc5c++){var _0x507ea8=_0x337267[_0x25bc5c];_0x197647['push'](parseContactItemType(_0x507ea8));}Promise['all'](_0x197647)[_0xfc99('0x1c')](function(){var _0x19f04a={'id':_0x2cfa78['id'],'items':_0x337267};return addAdditionalPhones(_0x19f04a)[_0xfc99('0x1c')](function(){return addCmHopperPhones(_0x2cfa78['id']);});})[_0xfc99('0x1c')](function(){_0x15354d(_0x2cfa78);});});}function parseContactItemType(_0x3d743a){return new Promise(function(_0x121087){if(_0x3d743a[_0xfc99('0x34')](_0xfc99('0x90'))){_0x121087(_0x3d743a);}else{return db[_0xfc99('0x68')]['find']({'where':{'name':_0x3d743a[_0xfc99('0x96')]}})[_0xfc99('0x1c')](function(_0x21d471){if(_[_0xfc99('0x58')](_0x21d471))_0x3d743a['ItemTypeId']=null;else _0x3d743a[_0xfc99('0x90')]=_0x21d471['id'];_0x121087(_0x3d743a);});}});}exports[_0xfc99('0x9a')]=function(_0x1d6a2d,_0x41d7a1){return db['CmContactHasItem']['findAll']({'raw':!![],'where':{'CmContactId':_0x1d6a2d[_0xfc99('0x28')]['id'],'ItemClass':_0xfc99('0x93')},'include':[{'model':db[_0xfc99('0x68')],'as':'ItemType'}],'order':[[_0xfc99('0x8d')],[db[_0xfc99('0x69')]['literal']('`ItemType`.OrderBy')]]})[_0xfc99('0x1c')](function(_0x2e6862){return _0x2e6862;})[_0xfc99('0x1c')](respondWithResult(_0x41d7a1,null))['catch'](handleError(_0x41d7a1,null));};exports[_0xfc99('0x9b')]=function(_0x2de0a0,_0x86d62b){return db[_0xfc99('0x4c')]['findAll']({'raw':!![],'where':{'CmContactId':_0x2de0a0[_0xfc99('0x35')][_0xfc99('0x9c')]}})[_0xfc99('0x1c')](function(_0x1396e1){var _0x417550=_['map'](_0x1396e1,function(_0x39d042){_0x39d042['CmContactId']=_0x2de0a0[_0xfc99('0x35')][_0xfc99('0x9d')];return _0x39d042;});return db['CmContactHasItem'][_0xfc99('0x99')](_0x417550,{});})['then'](function(){return addCmHopperPhones(_0x2de0a0[_0xfc99('0x35')][_0xfc99('0x9d')]);})[_0xfc99('0x1c')](function(){return['ok'];})[_0xfc99('0x1c')](respondWithResult(_0x86d62b,null))[_0xfc99('0x26')](handleError(_0x86d62b,null));};exports['rescheduleAdditionalPhones']=function(_0xf1eac2,_0x11674e){var _0x45ab34=[];_0x45ab34[_0xfc99('0x62')](createCmHopperPhone(_0xf1eac2[_0xfc99('0x35')]['id'],_0xf1eac2[_0xfc99('0x35')]['hopperId']));Promise[_0xfc99('0x8c')](_0x45ab34)['then'](function(){return[0x1];})[_0xfc99('0x1c')](respondWithResult(_0x11674e,null));};exports['getHoppers']=function(_0x2ad6cd,_0x568b58){var _0x12b546={'raw':![],'where':{}};var _0x3972b1={};var _0x3b04a6={'count':0x0,'rows':[]};return db[_0xfc99('0x29')]['findOne']({'where':{'id':_0x2ad6cd[_0xfc99('0x28')]['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x568b58,null))[_0xfc99('0x1c')](function(_0x466466){if(_0x466466){_0x3972b1[_0xfc99('0x7d')]=_[_0xfc99('0x2a')](db[_0xfc99('0x7a')][_0xfc99('0x7e')]);_0x3972b1['query']=_[_0xfc99('0x2a')](_0x2ad6cd[_0xfc99('0x25')]);_0x3972b1[_0xfc99('0x7f')]=_[_0xfc99('0x80')](_0x3972b1[_0xfc99('0x7d')],_0x3972b1[_0xfc99('0x25')]);_0x12b546[_0xfc99('0x82')]=_[_0xfc99('0x80')](_0x3972b1[_0xfc99('0x7d')],qs['fields'](_0x2ad6cd[_0xfc99('0x25')]['fields']));_0x12b546[_0xfc99('0x82')]=_0x12b546[_0xfc99('0x82')]['length']?_0x12b546[_0xfc99('0x82')]:_0x3972b1[_0xfc99('0x7d')];if(!_0x2ad6cd['query'][_0xfc99('0x34')]('nolimit')){_0x12b546[_0xfc99('0x17')]=qs[_0xfc99('0x17')](_0x2ad6cd[_0xfc99('0x25')][_0xfc99('0x17')]);_0x12b546[_0xfc99('0x15')]=qs[_0xfc99('0x15')](_0x2ad6cd[_0xfc99('0x25')][_0xfc99('0x15')]);}_0x12b546[_0xfc99('0x83')]=qs['sort'](_0x2ad6cd[_0xfc99('0x25')][_0xfc99('0x9e')]);_0x12b546[_0xfc99('0x5f')]=qs[_0xfc99('0x7f')](_[_0xfc99('0x84')](_0x2ad6cd[_0xfc99('0x25')],_0x3972b1['filters']));_0x12b546[_0xfc99('0x5f')][_0xfc99('0x9f')]=_0x466466['id'];if(_0x2ad6cd[_0xfc99('0x25')][_0xfc99('0x85')]){_0x12b546[_0xfc99('0x5f')]=_[_0xfc99('0x86')](_0x12b546['where'],{'$or':_[_0xfc99('0x6e')](_0x12b546[_0xfc99('0x82')],function(_0x2184a8){var _0x4a347c={};_0x4a347c[_0x2184a8]={'$like':'%'+_0x2ad6cd['query'][_0xfc99('0x85')]+'%'};return _0x4a347c;})});}_0x12b546=_[_0xfc99('0x86')]({},_0x12b546,_0x2ad6cd[_0xfc99('0x87')]);return db['CmHopper'][_0xfc99('0x18')]({'where':_0x12b546[_0xfc99('0x5f')]})['then'](function(_0xd18843){_0x3b04a6[_0xfc99('0x18')]=_0xd18843;if(_0x2ad6cd[_0xfc99('0x25')][_0xfc99('0xa0')]){_0x12b546[_0xfc99('0xa1')]=[{'all':!![]}];}return db[_0xfc99('0x7a')]['findAll'](_0x12b546);})[_0xfc99('0x1c')](function(_0x582ee4){_0x3b04a6[_0xfc99('0xa2')]=_0x582ee4;return _0x3b04a6;});}})[_0xfc99('0x1c')](respondWithFilteredResult(_0x568b58,_0x12b546))[_0xfc99('0x26')](handleError(_0x568b58,null));};exports[_0xfc99('0xa3')]=function(_0x5c96c5,_0x8f475c){var _0x162c13={'raw':!![],'where':{}};var _0x36ee00={};var _0xb383f4={'count':0x0,'rows':[]};return db['CmContact'][_0xfc99('0x7c')]({'where':{'id':_0x5c96c5['params']['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x8f475c,null))['then'](function(_0x4babd7){if(_0x4babd7){_0x36ee00[_0xfc99('0x7d')]=_[_0xfc99('0x2a')](db[_0xfc99('0x4e')][_0xfc99('0x7e')]);_0x36ee00['query']=_['keys'](_0x5c96c5[_0xfc99('0x25')]);_0x36ee00[_0xfc99('0x7f')]=_[_0xfc99('0x80')](_0x36ee00[_0xfc99('0x7d')],_0x36ee00[_0xfc99('0x25')]);_0x162c13['attributes']=_[_0xfc99('0x80')](_0x36ee00[_0xfc99('0x7d')],qs[_0xfc99('0x81')](_0x5c96c5[_0xfc99('0x25')][_0xfc99('0x81')]));_0x162c13[_0xfc99('0x82')]=_0x162c13[_0xfc99('0x82')][_0xfc99('0x2b')]?_0x162c13[_0xfc99('0x82')]:_0x36ee00[_0xfc99('0x7d')];if(!_0x5c96c5[_0xfc99('0x25')][_0xfc99('0x34')](_0xfc99('0x88'))){_0x162c13['limit']=qs['limit'](_0x5c96c5['query'][_0xfc99('0x17')]);_0x162c13[_0xfc99('0x15')]=qs['offset'](_0x5c96c5['query'][_0xfc99('0x15')]);}_0x162c13[_0xfc99('0x83')]=qs[_0xfc99('0x9e')](_0x5c96c5[_0xfc99('0x25')]['sort']);_0x162c13[_0xfc99('0x5f')]=qs[_0xfc99('0x7f')](_[_0xfc99('0x84')](_0x5c96c5[_0xfc99('0x25')],_0x36ee00[_0xfc99('0x7f')]));_0x162c13[_0xfc99('0x5f')]['ContactId']=_0x4babd7['id'];if(_0x5c96c5['query'][_0xfc99('0x85')]){_0x162c13[_0xfc99('0x5f')]=_['merge'](_0x162c13[_0xfc99('0x5f')],{'$or':_[_0xfc99('0x6e')](_0x162c13[_0xfc99('0x82')],function(_0x1d17ef){var _0x294991={};_0x294991[_0x1d17ef]={'$like':'%'+_0x5c96c5[_0xfc99('0x25')][_0xfc99('0x85')]+'%'};return _0x294991;})});}_0x162c13=_['merge']({},_0x162c13,_0x5c96c5['options']);return db[_0xfc99('0x4e')]['count']({'where':_0x162c13[_0xfc99('0x5f')]})[_0xfc99('0x1c')](function(_0x3ad40e){_0xb383f4[_0xfc99('0x18')]=_0x3ad40e;if(_0x5c96c5[_0xfc99('0x25')][_0xfc99('0xa0')]){_0x162c13[_0xfc99('0xa1')]=[{'all':!![]}];}return db[_0xfc99('0x4e')][_0xfc99('0x36')](_0x162c13);})[_0xfc99('0x1c')](function(_0x2de450){_0xb383f4['rows']=_0x2de450;return _0xb383f4;});}})['then'](respondWithFilteredResult(_0x8f475c,_0x162c13))[_0xfc99('0x26')](handleError(_0x8f475c,null));};exports[_0xfc99('0xa4')]=function(_0x2674d1,_0x857b5){var _0x3cf4e7={'raw':!![],'where':{}};var _0x170d5f={};var _0x2afc9c={'count':0x0,'rows':[]};return db[_0xfc99('0x29')]['findOne']({'where':{'id':_0x2674d1[_0xfc99('0x28')]['id']}})[_0xfc99('0x1c')](handleEntityNotFound(_0x857b5,null))[_0xfc99('0x1c')](function(_0x197339){if(_0x197339){_0x170d5f['model']=_[_0xfc99('0x2a')](db[_0xfc99('0x4d')][_0xfc99('0x7e')]);_0x170d5f[_0xfc99('0x25')]=_['keys'](_0x2674d1[_0xfc99('0x25')]);_0x170d5f[_0xfc99('0x7f')]=_[_0xfc99('0x80')](_0x170d5f[_0xfc99('0x7d')],_0x170d5f[_0xfc99('0x25')]);_0x3cf4e7[_0xfc99('0x82')]=_[_0xfc99('0x80')](_0x170d5f[_0xfc99('0x7d')],qs[_0xfc99('0x81')](_0x2674d1[_0xfc99('0x25')][_0xfc99('0x81')]));_0x3cf4e7[_0xfc99('0x82')]=_0x3cf4e7['attributes']['length']?_0x3cf4e7[_0xfc99('0x82')]:_0x170d5f[_0xfc99('0x7d')];if(!_0x2674d1[_0xfc99('0x25')][_0xfc99('0x34')]('nolimit')){_0x3cf4e7[_0xfc99('0x17')]=qs[_0xfc99('0x17')](_0x2674d1[_0xfc99('0x25')]['limit']);_0x3cf4e7['offset']=qs[_0xfc99('0x15')](_0x2674d1[_0xfc99('0x25')]['offset']);}_0x3cf4e7[_0xfc99('0x83')]=qs[_0xfc99('0x9e')](_0x2674d1['query'][_0xfc99('0x9e')]);_0x3cf4e7[_0xfc99('0x5f')]=qs['filters'](_['pick'](_0x2674d1[_0xfc99('0x25')],_0x170d5f[_0xfc99('0x7f')]));_0x3cf4e7[_0xfc99('0x5f')][_0xfc99('0x9f')]=_0x197339['id'];if(_0x2674d1[_0xfc99('0x25')][_0xfc99('0x85')]){_0x3cf4e7[_0xfc99('0x5f')]=_['merge'](_0x3cf4e7[_0xfc99('0x5f')],{'$or':_[_0xfc99('0x6e')](_0x3cf4e7[_0xfc99('0x82')],function(_0x518cfa){var _0x18e5e2={};_0x18e5e2[_0x518cfa]={'$like':'%'+_0x2674d1['query'][_0xfc99('0x85')]+'%'};return _0x18e5e2;})});}_0x3cf4e7=_['merge']({},_0x3cf4e7,_0x2674d1[_0xfc99('0x87')]);return db[_0xfc99('0x4d')][_0xfc99('0x18')]({'where':_0x3cf4e7[_0xfc99('0x5f')]})['then'](function(_0x4ec05e){_0x2afc9c[_0xfc99('0x18')]=_0x4ec05e;if(_0x2674d1[_0xfc99('0x25')][_0xfc99('0xa0')]){_0x3cf4e7[_0xfc99('0xa1')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xfc99('0x36')](_0x3cf4e7);})['then'](function(_0x1801d1){_0x2afc9c[_0xfc99('0xa2')]=_0x1801d1;return _0x2afc9c;});}})[_0xfc99('0x1c')](respondWithFilteredResult(_0x857b5,_0x3cf4e7))[_0xfc99('0x26')](handleError(_0x857b5,null));};exports[_0xfc99('0xa5')]=function(_0x981bd3,_0xbfa985){var _0x1cdfe9={'raw':!![],'where':{}};var _0x36f77c={};var _0x5bc09b={'count':0x0,'rows':[]};return db[_0xfc99('0x29')][_0xfc99('0x7c')]({'where':{'id':_0x981bd3[_0xfc99('0x28')]['id']}})['then'](handleEntityNotFound(_0xbfa985,null))[_0xfc99('0x1c')](function(_0x66afe8){if(_0x66afe8){_0x36f77c[_0xfc99('0x7d')]=_[_0xfc99('0x2a')](db['JscriptySessionReport'][_0xfc99('0x7e')]);_0x36f77c['query']=_['keys'](_0x981bd3[_0xfc99('0x25')]);_0x36f77c[_0xfc99('0x7f')]=_[_0xfc99('0x80')](_0x36f77c[_0xfc99('0x7d')],_0x36f77c[_0xfc99('0x25')]);_0x1cdfe9[_0xfc99('0x82')]=_[_0xfc99('0x80')](_0x36f77c['model'],qs[_0xfc99('0x81')](_0x981bd3[_0xfc99('0x25')][_0xfc99('0x81')]));_0x1cdfe9['attributes']=_0x1cdfe9[_0xfc99('0x82')][_0xfc99('0x2b')]?_0x1cdfe9['attributes']:_0x36f77c[_0xfc99('0x7d')];if(!_0x981bd3[_0xfc99('0x25')][_0xfc99('0x34')](_0xfc99('0x88'))){_0x1cdfe9[_0xfc99('0x17')]=qs['limit'](_0x981bd3[_0xfc99('0x25')]['limit']);_0x1cdfe9[_0xfc99('0x15')]=qs['offset'](_0x981bd3[_0xfc99('0x25')]['offset']);}_0x1cdfe9['order']=qs['sort'](_0x981bd3[_0xfc99('0x25')][_0xfc99('0x9e')]);_0x1cdfe9['where']=qs[_0xfc99('0x7f')](_[_0xfc99('0x84')](_0x981bd3[_0xfc99('0x25')],_0x36f77c['filters']));_0x1cdfe9[_0xfc99('0x5f')]['ContactId']=_0x66afe8['id'];if(_0x981bd3[_0xfc99('0x25')][_0xfc99('0x85')]){_0x1cdfe9[_0xfc99('0x5f')]=_[_0xfc99('0x86')](_0x1cdfe9[_0xfc99('0x5f')],{'$or':_[_0xfc99('0x6e')](_0x1cdfe9['attributes'],function(_0x3e092e){var _0x110b24={};_0x110b24[_0x3e092e]={'$like':'%'+_0x981bd3[_0xfc99('0x25')][_0xfc99('0x85')]+'%'};return _0x110b24;})});}_0x1cdfe9=_[_0xfc99('0x86')]({},_0x1cdfe9,_0x981bd3['options']);return db[_0xfc99('0x53')][_0xfc99('0x18')]({'where':_0x1cdfe9[_0xfc99('0x5f')]})[_0xfc99('0x1c')](function(_0x24d038){_0x5bc09b[_0xfc99('0x18')]=_0x24d038;if(_0x981bd3[_0xfc99('0x25')][_0xfc99('0xa0')]){_0x1cdfe9['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x1cdfe9);})['then'](function(_0x2b51d1){_0x5bc09b[_0xfc99('0xa2')]=_0x2b51d1;return _0x5bc09b;});}})['then'](respondWithFilteredResult(_0xbfa985,_0x1cdfe9))['catch'](handleError(_0xbfa985,null));};exports['uploadCsv']=function(_0x359dcf,_0x5f091c){try{if(!_0x359dcf[_0xfc99('0x35')]['ListId']){throw new Error(_0xfc99('0xa6'));}if(!_0x359dcf['body'][_0xfc99('0xa7')]){throw new Error(_0xfc99('0xa8'));}if(!_0x359dcf['body'][_0xfc99('0xa9')]){throw new Error('No\x20association\x20values\x20specified!');}if(!_0x359dcf[_0xfc99('0x35')][_0xfc99('0xaa')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4bd232=_0x359dcf[_0xfc99('0x35')][_0xfc99('0xa7')][_0xfc99('0xab')](',');var _0x855dbe=_0x359dcf[_0xfc99('0x35')][_0xfc99('0xa9')][_0xfc99('0xab')](',');if(!_0x4bd232[_0xfc99('0x2b')]||!_0x855dbe['length']||_0x4bd232[_0xfc99('0x2b')]!==_0x855dbe[_0xfc99('0x2b')]){throw new Error('Incorrect\x20binding\x20parameters\x20passed!');}_0x359dcf[_0xfc99('0x35')][_0xfc99('0x81')]=_[_0xfc99('0xac')](_0x4bd232,_0x855dbe);if(!_0x359dcf[_0xfc99('0x35')][_0xfc99('0x81')][_0xfc99('0x79')]){throw new Error(_0xfc99('0xad'));}if(!_0x359dcf['body'][_0xfc99('0x81')][_0xfc99('0xae')]){throw new Error(_0xfc99('0xaf'));}var _0x28882e=path[_0xfc99('0x3c')](config[_0xfc99('0xb0')],_0xfc99('0xb1'),_0x359dcf[_0xfc99('0xb2')][_0xfc99('0xb3')]);fs['chmodSync'](_0x28882e,parseInt(_0xfc99('0xb4'),0x8));var _0x7180ef=require(_0xfc99('0xb5'))[_0xfc99('0xb6')](path[_0xfc99('0x3c')](__dirname,_0xfc99('0xb7')),[_0x28882e,_0x359dcf[_0xfc99('0x35')][_0xfc99('0xa7')],_0x359dcf[_0xfc99('0x35')][_0xfc99('0xa9')],_0x359dcf['body']['ListId'],_0x359dcf[_0xfc99('0x35')][_0xfc99('0xb8')],_0x359dcf[_0xfc99('0x35')][_0xfc99('0x5e')],_0x359dcf[_0xfc99('0x35')][_0xfc99('0xaa')]]);return _0x5f091c['status'](0xc8)[_0xfc99('0x14')]({'message':_0xfc99('0xb9'),'pid':_0x7180ef['pid']});}catch(_0x441236){return _0x5f091c[_0xfc99('0x13')](0x1f4)[_0xfc99('0xba')](_0x441236);}};exports[_0xfc99('0xbb')]=function(_0x5735db,_0x5b5e0c){var _0x41facf=fs[_0xfc99('0xbc')](_0x5735db['file'][_0xfc99('0x3')]);Papa['parse'](_0x41facf,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x4dc6b4){return _0x5b5e0c[_0xfc99('0x13')](0xc8)['json']({'file':_0x5735db[_0xfc99('0xb2')],'fields':_0x4dc6b4[_0xfc99('0xbd')][_0xfc99('0x81')]});}});};exports['import']=function(_0x538c67,_0x5c06ad){return db[_0xfc99('0xbe')][_0xfc99('0x36')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})['then'](function(_0x1b264d){var _0x523c09=![];if(!_0x538c67['body'][_0xfc99('0x60')]){throw new Error('No\x20ListId\x20specified');}if(!_0x538c67['body']['binding'][_0xfc99('0x79')]){throw new Error(_0xfc99('0xad'));}if(!_0x538c67[_0xfc99('0x35')]['binding'][_0xfc99('0xae')]){throw new Error(_0xfc99('0xaf'));}if(!_0x538c67[_0xfc99('0x35')][_0xfc99('0xaa')]){throw new Error(_0xfc99('0xbf'));}var _0x1a5f58=require(_0xfc99('0xb5'))[_0xfc99('0xb6')](path['join'](__dirname,_0xfc99('0xc0')),[_0x538c67[_0xfc99('0x28')]['id'],JSON[_0xfc99('0xc1')](_0x538c67['body']),JSON['stringify'](_0x1b264d)]);_0x1a5f58['on'](_0xfc99('0xc2'),function(){_0x523c09=!![];return _0x5c06ad[_0xfc99('0x13')](0xc8)['json']({'message':'start\x20child\x20process\x20correctly!','pid':_0x1a5f58[_0xfc99('0xc3')]});});_0x1a5f58['on'](_0xfc99('0xc4'),function(_0x1dd0a1){if(_0x1dd0a1&&!_0x523c09){return _0x5c06ad[_0xfc99('0x13')](0x1f4)[_0xfc99('0x14')]({'message':_0xfc99('0xc5'),'pid':_0x1a5f58[_0xfc99('0xc3')]});}});})[_0xfc99('0x26')](handleError(_0x5c06ad,null));};exports[_0xfc99('0xc6')]=function(_0x4a3860,_0x238c2c){return db['User'][_0xfc99('0x36')]({'raw':!![],'attributes':['id'],'where':{'role':_0xfc99('0xc7')}})[_0xfc99('0x1c')](function(_0x472f13){var _0x1f726f=![];if(!_0x4a3860[_0xfc99('0x35')][_0xfc99('0x60')]){throw new Error(_0xfc99('0xa6'));}if(!_0x4a3860[_0xfc99('0x35')][_0xfc99('0xc8')][_0xfc99('0x79')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x4a3860[_0xfc99('0x35')][_0xfc99('0xc8')][_0xfc99('0xae')]){throw new Error(_0xfc99('0xaf'));}if(!_0x4a3860[_0xfc99('0x35')][_0xfc99('0xaa')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x9ae71d=require(_0xfc99('0xb5'))[_0xfc99('0xb6')](path[_0xfc99('0x3c')](__dirname,_0xfc99('0xc9')),[_0x4a3860[_0xfc99('0x28')]['id'],JSON[_0xfc99('0xc1')](_0x4a3860['body']),JSON[_0xfc99('0xc1')](_0x472f13)]);_0x9ae71d['on'](_0xfc99('0xc2'),function(){_0x1f726f=!![];return _0x238c2c[_0xfc99('0x13')](0xc8)[_0xfc99('0x14')]({'message':_0xfc99('0xca'),'pid':_0x9ae71d['pid']});});_0x9ae71d['on'](_0xfc99('0xc4'),function(_0x2e20fb){if(_0x2e20fb&&!_0x1f726f){return _0x238c2c[_0xfc99('0x13')](0x1f4)[_0xfc99('0x14')]({'message':'error\x20child\x20process','pid':_0x9ae71d[_0xfc99('0xc3')]});}});})[_0xfc99('0x26')](handleError(_0x238c2c,null));};exports[_0xfc99('0xcb')]=function(_0x53bb9b,_0x3be14b){var _0xcf308e=[_0xfc99('0xcc'),_0xfc99('0xcd'),_0xfc99('0xce'),_0xfc99('0xcf'),'fax',_0xfc99('0xd0'),'voice'];var _0xba1556={'offset':0x0,'order':qs['sort'](_0xfc99('0xd1'))},_0x41a384={'count':0x0,'rows':[]};Promise[_0xfc99('0xd2')]()[_0xfc99('0x1c')](function(){if(_0x53bb9b['query']['channel']){if(!_['includes'](_0xcf308e,_0x53bb9b[_0xfc99('0x25')][_0xfc99('0xd3')][_0xfc99('0xd4')]())){throw new Error(_0xfc99('0xd5'));}_0xcf308e=[_0x53bb9b['query'][_0xfc99('0xd3')][_0xfc99('0xd4')]()];}if(_0x53bb9b[_0xfc99('0x25')][_0xfc99('0xd6')]){try{var _0x4780bd=JSON['parse'](_0x53bb9b['query'][_0xfc99('0xd6')]);if(!moment(_0x4780bd[_0xfc99('0x37')])[_0xfc99('0xd7')]()){throw new Error(_0xfc99('0xd8'));}if(!moment(_0x4780bd['to'])[_0xfc99('0xd7')]()){throw new Error('Invalid\x20date\x20for\x20range\x20to\x20filter');}}catch(_0x49e076){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x53bb9b[_0xfc99('0x25')]['hasOwnProperty'](_0xfc99('0x88'))){_0xba1556[_0xfc99('0x17')]=qs[_0xfc99('0x17')](_0x53bb9b[_0xfc99('0x25')][_0xfc99('0x17')]||0xa);_0xba1556[_0xfc99('0x15')]=qs[_0xfc99('0x15')](_0x53bb9b[_0xfc99('0x25')][_0xfc99('0x15')]);}var _0x1e580e=_0xcf308e['map'](function(_0x137f31){if(_0x137f31===_0xfc99('0xd9')){var _0x3b755c={'attributes':['id',_0xfc99('0xda'),'type',_0xfc99('0xdb'),_0xfc99('0xdc'),_0xfc99('0xdd'),_0xfc99('0xde'),_0xfc99('0xdf'),'duration',_0xfc99('0xe0'),_0xfc99('0xe1'),_0xfc99('0xe2'),_0xfc99('0xe3'),_0xfc99('0xe4'),_0xfc99('0xe5')],'where':{'ContactId':_0x53bb9b[_0xfc99('0x28')]['id']},'include':[{'model':db['User'],'as':'User','attributes':['id',_0xfc99('0x21'),_0xfc99('0xe6'),_0xfc99('0xe7')]}],'order':[[_0xfc99('0xe1'),_0xfc99('0xe8')]]};if(_0x53bb9b[_0xfc99('0x25')][_0xfc99('0xd6')]){_0x3b755c['where']['createdAt']={'$gte':_0x4780bd[_0xfc99('0x37')],'$lte':_0x4780bd['to']};}return db[_0xfc99('0x50')]['findAndCountAll'](_0x3b755c)['then'](function(_0x46090f){_0x41a384['count']+=_0x46090f[_0xfc99('0x18')];return _['map'](_0x46090f['rows'],function(_0x5cfb7d){var _0x11864e=_0x5cfb7d['get']({'plain':!![]});_0x11864e[_0xfc99('0xd3')]=_0x137f31;if(_0x11864e[_0xfc99('0xbe')]){_0x11864e[_0xfc99('0xbe')]={'id':_0x11864e[_0xfc99('0xbe')]['id'],'name':_0x11864e[_0xfc99('0xbe')][_0xfc99('0x21')],'fullname':_0x11864e[_0xfc99('0xbe')][_0xfc99('0xe6')],'alias':_0x11864e[_0xfc99('0xbe')][_0xfc99('0xe7')]};}return _0x11864e;});});}else{var _0x401cde=_[_0xfc99('0xe9')](_0x137f31)+(_0x137f31===_0xfc99('0xcd')?_0xfc99('0xea'):_0xfc99('0xeb'));var _0x11cbb2={'attributes':['id','closed','closedAt',_0xfc99('0xe1'),_0xfc99('0xe0'),_0xfc99('0xec'),'secondDisposition',_0xfc99('0xed'),_0xfc99('0xe5'),_0x401cde+'Id'],'where':{'ContactId':_0x53bb9b[_0xfc99('0x28')]['id']},'include':[{'model':db[_0x401cde],'as':_0xfc99('0xeb'),'attributes':['id',_0xfc99('0x21'),_0xfc99('0xee')]},{'model':db['User'],'as':_0xfc99('0xef'),'attributes':['id','name',_0xfc99('0xe6')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xfc99('0x21'),_0xfc99('0x66')],'through':{'attributes':[]}}],'order':[[_0xfc99('0xe1'),'DESC']]};if(_0x53bb9b[_0xfc99('0x25')]['range']){_0x11cbb2[_0xfc99('0x5f')]['createdAt']={'$gte':_0x4780bd[_0xfc99('0x37')],'$lte':_0x4780bd['to']};}switch(_0x137f31){case _0xfc99('0xcd'):_0x11cbb2[_0xfc99('0x82')][_0xfc99('0x62')](_0xfc99('0xf0'),'customerIp','customerPort',_0xfc99('0xf1'),'osName',_0xfc99('0xf2'),_0xfc99('0xf3'),_0xfc99('0xf4'),_0xfc99('0xf5'));break;case _0xfc99('0xcc'):_0x11cbb2[_0xfc99('0x82')][_0xfc99('0x62')](_0xfc99('0xf6'),_0xfc99('0xf7'));break;case _0xfc99('0xcf'):_0x11cbb2[_0xfc99('0x82')][_0xfc99('0x62')]('externalUrl',_0xfc99('0xf8'));break;}return db[_[_0xfc99('0xe9')](_0x137f31)+'Interaction'][_0xfc99('0xf9')](_0x11cbb2)[_0xfc99('0x1c')](function(_0x52a038){_0x41a384['count']+=_0x52a038[_0xfc99('0x18')];return _[_0xfc99('0x6e')](_0x52a038['rows'],function(_0x351b3a){var _0xdabaaa=_0x351b3a[_0xfc99('0x38')]({'plain':!![]});_0xdabaaa[_0xfc99('0xd3')]=_0x137f31;if(_0xdabaaa['Owner']){_0xdabaaa['Owner']={'id':_0xdabaaa['Owner']['id'],'name':_0xdabaaa['Owner'][_0xfc99('0x21')],'fullname':_0xdabaaa[_0xfc99('0xef')]['fullname']};}return _0xdabaaa;});});}});return Promise['all'](_0x1e580e);})[_0xfc99('0x1c')](function(_0x339149){return _(_0x339149)['flatten']()['sortBy'](_0xfc99('0xe1'))[_0xfc99('0xfa')]()[_0xfc99('0xfb')]();})[_0xfc99('0x1c')](function(_0x2796b8){_0x41a384[_0xfc99('0xa2')]=_0xba1556[_0xfc99('0x17')]?_0x2796b8[_0xfc99('0xfc')](_0xba1556[_0xfc99('0x15')],_0xba1556[_0xfc99('0x15')]+_0xba1556['limit']):_0x2796b8;return _0x41a384;})[_0xfc99('0x1c')](respondWithFilteredResult(_0x3be14b,_0xba1556))[_0xfc99('0x26')](handleError(_0x3be14b,null));}; \ No newline at end of file +var _0x5194=['keys','startsWith','columnName','displayName','CmCustomField','length','cf_','alias','custom','info','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','merge','body','from','get','mergeWith','isArray','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','WhatsappMessage','WhatsappQueueReport','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','contact','show','Tag','color','ContactItemType','ItemType','sequelize','literal','Phones.OrderBy','$and','omit','map','format','cf_%d','pickBy','isEmpty','table','setFields','id\x20=\x20?','toParam','text','phone','findOne','filters','intersection','model','attributes','fields','order','sort','pick','filter','options','getTags','nolimit','setTags','ids','all','OrderBy','item_types','items','ItemTypeId','description','PHONE','CmHopperAdditionalPhone','item','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','includeAll','getHopperHistories','rawAttributes','rows','getHopperFinals','include','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','child_process','fork','upload','createReadStream','parse','meta','import','User','agent','binding','stringify','start\x20child\x20process\x20correctly!','pid','exit','importUpdates','../../components/import/cm/csvUpdates','message','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','whatsapp','-createdAt','resolve','includes','Invalid\x20channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','voice','type','source','callerid','starttime','endtime','duration','userDisposition','userThirdDisposition','UserId','DESC','createdAt','findAndCountAll','channel','fullname','startCase','Website','Account','closedAt','note','disposition','secondDisposition','thirdDisposition','key','Owner','Tags','browserName','customerPort','osName','ratingMessage','ratingValue','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','slice','moment','bluebird','lodash','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','status','undefined','limit','count','offset','json','update','then','destroy','end','sendStatus','stack','name','send','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags'];(function(_0x5d1823,_0x2b8f1a){var _0x582fc9=function(_0x4b4718){while(--_0x4b4718){_0x5d1823['push'](_0x5d1823['shift']());}};_0x582fc9(++_0x2b8f1a);}(_0x5194,0x1cc));var _0x4519=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5194[_0x8c43de];return _0xa6591b;};'use strict';var moment=require(_0x4519('0x0'));var BPromise=require(_0x4519('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x4519('0x2'));var squel=require('squel');var Papa=require(_0x4519('0x3'));var Redis=require(_0x4519('0x4'));var contacts=require('../../components/contacts');var qs=require(_0x4519('0x5'));var logger=require(_0x4519('0x6'))(_0x4519('0x7'));var config=require(_0x4519('0x8'));var shared=require(_0x4519('0x9'));var db=require('../../mysqldb')['db'];config[_0x4519('0xa')]=_[_0x4519('0xb')](config['redis'],{'host':_0x4519('0xc'),'port':0x18eb});var socket=require(_0x4519('0xd'))(new Redis(config[_0x4519('0xa')]));require(_0x4519('0xe'))[_0x4519('0xf')](socket);function respondWithResult(_0x4c878c,_0x3145cf){_0x3145cf=_0x3145cf||0xc8;return function(_0x35c8f0){if(_0x35c8f0){return _0x4c878c[_0x4519('0x10')](_0x3145cf)['json'](_0x35c8f0);}};}function respondWithFilteredResult(_0x19b196,_0x326105){return function(_0x31aaad){if(_0x31aaad){var _0x21c8ea=typeof _0x326105['offset']===_0x4519('0x11')&&typeof _0x326105[_0x4519('0x12')]==='undefined';var _0x115b5a=_0x31aaad[_0x4519('0x13')];var _0x3630f8=_0x21c8ea?0x0:_0x326105[_0x4519('0x14')];var _0x26c2d7=_0x21c8ea?_0x31aaad[_0x4519('0x13')]:_0x326105['offset']+_0x326105[_0x4519('0x12')];var _0x281ae1;if(_0x26c2d7>=_0x115b5a){_0x26c2d7=_0x115b5a;_0x281ae1=0xc8;}else{_0x281ae1=0xce;}_0x19b196[_0x4519('0x10')](_0x281ae1);return _0x19b196['set']('Content-Range',_0x3630f8+'-'+_0x26c2d7+'/'+_0x115b5a)[_0x4519('0x15')](_0x31aaad);}return null;};}function saveUpdates(_0x56775b){return function(_0xeac163){if(_0xeac163){return _0xeac163[_0x4519('0x16')](_0x56775b)[_0x4519('0x17')](function(_0x262c82){return _0x262c82;});}return null;};}function removeEntity(_0x116fff){return function(_0x3aeb3f){if(_0x3aeb3f){return _0x3aeb3f[_0x4519('0x18')]()[_0x4519('0x17')](function(){_0x116fff[_0x4519('0x10')](0xcc)[_0x4519('0x19')]();});}};}function handleEntityNotFound(_0x31b2f4){return function(_0x24f4eb){if(!_0x24f4eb){_0x31b2f4[_0x4519('0x1a')](0x194);}return _0x24f4eb;};}function handleError(_0x3a9421,_0x28a6f9){_0x28a6f9=_0x28a6f9||0x1f4;return function(_0x142692){logger['error'](_0x142692[_0x4519('0x1b')]);if(_0x142692[_0x4519('0x1c')]){delete _0x142692[_0x4519('0x1c')];}_0x3a9421[_0x4519('0x10')](_0x28a6f9)[_0x4519('0x1d')](_0x142692);};}exports['index']=function(_0x47f3bc,_0x4bb05a){var _0x23bf0a={};return contacts[_0x4519('0x1e')]()['then'](function(_0x2a68a0){_0x23bf0a=qs[_0x4519('0x1f')](_0x2a68a0,_0x47f3bc);return contacts[_0x4519('0x20')](_0x47f3bc[_0x4519('0x21')],_0x47f3bc[_0x4519('0x22')],_0x23bf0a,_0x2a68a0);})[_0x4519('0x17')](respondWithFilteredResult(_0x4bb05a,_0x23bf0a))[_0x4519('0x23')](handleError(_0x4bb05a,null));};exports[_0x4519('0x18')]=function(_0xee3ae8,_0x1c4d12){return db[_0x4519('0x24')][_0x4519('0x25')]({'where':{'id':_0xee3ae8[_0x4519('0x26')]['id']}})[_0x4519('0x17')](handleEntityNotFound(_0x1c4d12,null))[_0x4519('0x17')](removeEntity(_0x1c4d12,null))[_0x4519('0x23')](handleError(_0x1c4d12,null));};exports['describe']=function(_0x3661a0,_0x5b9b23){return db[_0x4519('0x24')][_0x4519('0x1e')]()[_0x4519('0x17')](function(_0x33c0ac){delete _0x33c0ac[_0x4519('0x27')];for(var _0x11db6d=0x0;_0x11db6d0x0){return new Promise(function(_0x272f41){var _0x156ff2=[];for(var _0x456cb7=0x0;_0x456cb7<_0x441043[_0x4519('0x2d')];_0x456cb7++){_0x156ff2[_0x4519('0x5e')](insertAdditionalPhones(_0x441043[_0x456cb7][_0x4519('0x60')],_0x441043[_0x456cb7][_0x4519('0x58')]));}Promise['all'](_0x156ff2)[_0x4519('0x17')](function(){_0x272f41(0x1);});})[_0x4519('0x17')](function(){return{'success':_0xc50234,'failure':_0x29ec5c,'duplicates':_0x2f77d9};});}else{return{'success':_0xc50234,'failure':_0x29ec5c,'duplicates':_0x2f77d9};}}})[_0x4519('0x17')](respondWithResult(_0xc5668c,0xc9))['catch'](handleError(_0xc5668c,null));};exports[_0x4519('0x61')]=function(_0x57e767,_0x25bfd0){var _0x43ea36;return db[_0x4519('0x24')][_0x4519('0x1e')]()[_0x4519('0x17')](function(_0x3fd454){return db['CmContact'][_0x4519('0x25')]({'where':{'id':_0x57e767[_0x4519('0x26')]['id']},'include':[{'model':db[_0x4519('0x62')],'as':'Tags','attributes':['id',_0x4519('0x1c'),_0x4519('0x63')],'required':_0x57e767['query']['tag']?!![]:![]},{'model':db[_0x4519('0x49')],'as':'Phones','where':{'CmContactId':_0x57e767[_0x4519('0x26')]['id']},'required':![],'include':[{'model':db[_0x4519('0x64')],'as':_0x4519('0x65')}]}],'order':[db[_0x4519('0x66')][_0x4519('0x67')](_0x4519('0x68'))],'attributes':_['keys'](_0x3fd454)});})[_0x4519('0x17')](function(_0x3c8c0f){if(!_[_0x4519('0x54')](_0x3c8c0f)){_0x43ea36=_0x3c8c0f[_0x4519('0x38')]({'plain':!![]});var _0x1db6f4={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3c8c0f&&_0x3c8c0f[_0x4519('0x5f')]){if(_0x3c8c0f['ListId']){_0x1db6f4['where'][_0x4519('0x69')][_0x4519('0x5e')]({'ListId':{'$ne':_0x3c8c0f[_0x4519('0x5f')]}});}}return db[_0x4519('0x2c')]['findAll'](_0x1db6f4);}})[_0x4519('0x17')](function(_0x4e5dd5){if(!_[_0x4519('0x54')](_0x4e5dd5)){return _[_0x4519('0x6a')](_0x43ea36,_[_0x4519('0x6b')](_0x4e5dd5,function(_0x396822){return util[_0x4519('0x6c')](_0x4519('0x6d'),_0x396822['id']);}));}})[_0x4519('0x17')](handleEntityNotFound(_0x25bfd0,null))[_0x4519('0x17')](respondWithResult(_0x25bfd0,null))[_0x4519('0x23')](handleError(_0x25bfd0,null));};exports[_0x4519('0x16')]=function(_0x2fecd2,_0x4c8117){var _0x18e691;if(_0x2fecd2[_0x4519('0x36')]['id']){delete _0x2fecd2[_0x4519('0x36')]['id'];}if(!_[_0x4519('0x54')](_0x2fecd2[_0x4519('0x36')][_0x4519('0x55')])){var _0xe453ed=_0x2fecd2[_0x4519('0x36')][_0x4519('0x55')];if(!_[_0x4519('0x54')](shared[_0x4519('0x56')][_0xe453ed]))_0x2fecd2[_0x4519('0x36')]['utcOffset']=shared[_0x4519('0x56')][_0xe453ed][_0x4519('0x57')];}return db[_0x4519('0x24')]['find']({'where':{'id':_0x2fecd2['params']['id']}})[_0x4519('0x17')](handleEntityNotFound(_0x4c8117,null))[_0x4519('0x17')](saveUpdates(_0x2fecd2[_0x4519('0x36')],null))[_0x4519('0x17')](function(_0x3f321f){_0x18e691=_0x3f321f;var _0x1ee28c={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x3f321f&&_0x3f321f['ListId']){if(_0x3f321f[_0x4519('0x5f')]){_0x1ee28c['where'][_0x4519('0x69')]['push']({'ListId':{'$ne':_0x3f321f[_0x4519('0x5f')]}});}}return db[_0x4519('0x2c')]['findAll'](_0x1ee28c);})['then'](function(_0x7e49c6){if(_0x7e49c6){return _[_0x4519('0x6a')](_[_0x4519('0x6e')](_0x2fecd2[_0x4519('0x36')],function(_0x565389,_0x2eafff){return _[_0x4519('0x29')](_0x2eafff,_0x4519('0x2e'));}),_[_0x4519('0x6b')](_0x7e49c6,function(_0x4dad11){return util['format']('cf_%d',_0x4dad11['id']);}));}})[_0x4519('0x17')](function(_0x856498){if(_0x856498&&!_[_0x4519('0x6f')](_0x856498)){var _0x20a745=squel[_0x4519('0x16')]()[_0x4519('0x70')]('cm_contacts')[_0x4519('0x71')](_0x856498)['where'](_0x4519('0x72'),_0x2fecd2[_0x4519('0x26')]['id'])[_0x4519('0x73')]();return db[_0x4519('0x66')]['query'](_0x20a745[_0x4519('0x74')],{'replacements':_0x20a745['values']});}})[_0x4519('0x17')](function(){if(_0x2fecd2[_0x4519('0x36')][_0x4519('0x75')]&&_0x18e691){return db[_0x4519('0x3b')][_0x4519('0x16')]({'phone':_0x2fecd2[_0x4519('0x36')][_0x4519('0x75')],'OrderBy':0x0},{'where':{'ContactId':_0x18e691['id']}});}})['then'](function(){return _0x18e691;})['then'](respondWithResult(_0x4c8117,null))[_0x4519('0x23')](handleError(_0x4c8117,null));};exports['getTags']=function(_0x1b6833,_0x232fd9){var _0x201cb3={};var _0x5ed3d0={};var _0x54e94c;var _0x18221a;return db[_0x4519('0x24')][_0x4519('0x76')]({'where':{'id':_0x1b6833[_0x4519('0x26')]['id']}})[_0x4519('0x17')](handleEntityNotFound(_0x232fd9,null))[_0x4519('0x17')](function(_0x3ddc95){if(_0x3ddc95){_0x54e94c=_0x3ddc95;_0x5ed3d0['model']=_[_0x4519('0x28')](db[_0x4519('0x62')]['rawAttributes']);_0x5ed3d0['query']=_[_0x4519('0x28')](_0x1b6833[_0x4519('0x21')]);_0x5ed3d0[_0x4519('0x77')]=_[_0x4519('0x78')](_0x5ed3d0[_0x4519('0x79')],_0x5ed3d0[_0x4519('0x21')]);_0x201cb3[_0x4519('0x7a')]=_[_0x4519('0x78')](_0x5ed3d0[_0x4519('0x79')],qs[_0x4519('0x7b')](_0x1b6833['query'][_0x4519('0x7b')]));_0x201cb3[_0x4519('0x7a')]=_0x201cb3[_0x4519('0x7a')][_0x4519('0x2d')]?_0x201cb3[_0x4519('0x7a')]:_0x5ed3d0[_0x4519('0x79')];_0x201cb3[_0x4519('0x7c')]=qs[_0x4519('0x7d')](_0x1b6833['query'][_0x4519('0x7d')]);_0x201cb3[_0x4519('0x5c')]=qs['filters'](_[_0x4519('0x7e')](_0x1b6833[_0x4519('0x21')],_0x5ed3d0[_0x4519('0x77')]));if(_0x1b6833[_0x4519('0x21')][_0x4519('0x7f')]){_0x201cb3['where']=_[_0x4519('0x35')](_0x201cb3[_0x4519('0x5c')],{'$or':_[_0x4519('0x6b')](_0x201cb3[_0x4519('0x7a')],function(_0x3a33dd){var _0x5de309={};_0x5de309[_0x3a33dd]={'$like':'%'+_0x1b6833[_0x4519('0x21')][_0x4519('0x7f')]+'%'};return _0x5de309;})});}_0x201cb3=_[_0x4519('0x35')]({},_0x201cb3,_0x1b6833[_0x4519('0x80')]);return _0x54e94c[_0x4519('0x81')](_0x201cb3);}})[_0x4519('0x17')](function(_0x45b2f8){if(_0x45b2f8){_0x18221a=_0x45b2f8[_0x4519('0x2d')];if(!_0x1b6833[_0x4519('0x21')]['hasOwnProperty'](_0x4519('0x82'))){_0x201cb3[_0x4519('0x12')]=qs[_0x4519('0x12')](_0x1b6833['query']['limit']);_0x201cb3['offset']=qs[_0x4519('0x14')](_0x1b6833[_0x4519('0x21')]['offset']);}return _0x54e94c[_0x4519('0x81')](_0x201cb3);}})['then'](function(_0x41115f){if(_0x41115f){return _0x41115f?{'count':_0x18221a,'rows':_0x41115f}:null;}})['then'](respondWithResult(_0x232fd9,null))[_0x4519('0x23')](handleError(_0x232fd9,null));};exports[_0x4519('0x83')]=function(_0x2a0608,_0xc5fb76){if(_0x2a0608[_0x4519('0x36')]['id']){delete _0x2a0608['body']['id'];}return db['CmContact'][_0x4519('0x76')]({'where':{'id':_0x2a0608[_0x4519('0x26')]['id']}})[_0x4519('0x17')](handleEntityNotFound(_0xc5fb76,null))[_0x4519('0x17')](function(_0x1ad561){if(_0x1ad561){return _0x1ad561[_0x4519('0x83')](_0x2a0608[_0x4519('0x36')][_0x4519('0x84')]||[]);}return null;})[_0x4519('0x17')](respondWithResult(_0xc5fb76,null))[_0x4519('0x23')](handleError(_0xc5fb76,null));};exports['setAdditionalPhones']=function(_0x2eadd6,_0x3fdd71){var _0xfcaf15=[];_0xfcaf15[_0x4519('0x5e')](addAdditionalPhones(_0x2eadd6['body']));Promise[_0x4519('0x85')](_0xfcaf15)[_0x4519('0x17')](function(){_0xfcaf15=[];_0xfcaf15['push'](deleteCmHopperPhones(_0x2eadd6['body']['id']));_0xfcaf15[_0x4519('0x5e')](addCmHopperPhones(_0x2eadd6[_0x4519('0x36')]['id']));Promise['all'](_0xfcaf15)[_0x4519('0x17')](function(){return[0x1];})[_0x4519('0x17')](respondWithResult(_0x3fdd71,null));});};function addAdditionalPhones(_0x5188ee){var _0x713e38;return new Promise(function(_0x6744a9){return db[_0x4519('0x49')][_0x4519('0x18')]({'where':{'CmContactId':_0x5188ee['id']}})[_0x4519('0x17')](function(){db[_0x4519('0x64')][_0x4519('0x20')]({'raw':!![],'attributes':['id',_0x4519('0x86')]})[_0x4519('0x17')](function(_0x119ff4){var _0x2e113e=[];for(var _0x10a0d9=0x0;_0x10a0d9<_0x5188ee['items']['length'];_0x10a0d9++){var _0x5c1e2=_0x5188ee['item_types']?_[_0x4519('0x54')](_0x5188ee['item_types'][_0x10a0d9])?'':_0x5188ee[_0x4519('0x87')][_0x10a0d9]:_0x5188ee[_0x4519('0x88')][_0x10a0d9][_0x4519('0x89')]?_0x5188ee[_0x4519('0x88')][_0x10a0d9][_0x4519('0x89')]:'';var _0x397ba9=_[_0x4519('0x54')](_0x5188ee[_0x4519('0x88')][_0x10a0d9][_0x4519('0x8a')])?'':_0x5188ee['items'][_0x10a0d9][_0x4519('0x8a')];var _0x57bc78=_0x5c1e2+':'+_0x5188ee['items'][_0x10a0d9][_0x4519('0x75')]+'§'+_0x397ba9;if(_[_0x4519('0x54')](_0x713e38))_0x713e38=_0x57bc78;else _0x713e38+=';'+_0x57bc78;var _0x2a6072=null;var _0x20ed42=null;if(_0x5188ee[_0x4519('0x87')]){if(!_['isNil'](_0x5188ee[_0x4519('0x87')][_0x10a0d9])){_0x20ed42=_[_0x4519('0x25')](_0x119ff4,function(_0x1366d9){return _0x1366d9['id']===_0x5188ee[_0x4519('0x87')][_0x10a0d9];});if(!_[_0x4519('0x54')](_0x20ed42)){_0x2a6072=_0x20ed42[_0x4519('0x86')];}}}else{if(!_[_0x4519('0x54')](_0x5188ee[_0x4519('0x88')][_0x10a0d9])){_0x20ed42=_['find'](_0x119ff4,function(_0x11e9d7){return _0x11e9d7['id']===_0x5188ee[_0x4519('0x88')][_0x10a0d9]['ItemTypeId'];});if(!_[_0x4519('0x54')](_0x20ed42)){_0x2a6072=_0x10a0d9;}}}if(_['isNil'](_0x2a6072)){_0x2a6072=0x64;}_0x2e113e[_0x4519('0x5e')](addAdditionalPhone(_0x5188ee['id'],_0x5188ee[_0x4519('0x88')][_0x10a0d9][_0x4519('0x75')],_0x5188ee['item_types']?_[_0x4519('0x54')](_0x5188ee[_0x4519('0x87')][_0x10a0d9])?null:_0x5188ee[_0x4519('0x87')][_0x10a0d9]:_0x5188ee['items'][_0x10a0d9][_0x4519('0x89')]?_0x5188ee[_0x4519('0x88')][_0x10a0d9][_0x4519('0x89')]:null,_0x2a6072,_0x397ba9));}Promise[_0x4519('0x85')](_0x2e113e)[_0x4519('0x17')](function(){db[_0x4519('0x24')]['update']({'AdditionalPhones':_0x713e38},{'where':{'id':_0x5188ee['id']}})[_0x4519('0x17')](function(){_0x6744a9(0x1);});});});});});}function addAdditionalPhone(_0x57b617,_0x575428,_0x452337,_0x4846d4,_0xb051f3){return db[_0x4519('0x49')][_0x4519('0x25')]({'where':{'CmContactId':_0x57b617,'item':_0x575428}})[_0x4519('0x17')](function(_0x51b617){if(_0x51b617)logger[_0x4519('0x31')]('contact\x20phone\x20exists',_0x51b617);else{db['CmContactHasItem']['create']({'CmContactId':_0x57b617,'item':_0x575428,'ItemTypeId':_0x452337,'OrderBy':_0x4846d4,'ItemClass':_0x4519('0x8b'),'description':_0xb051f3});}});}function deleteCmHopperPhones(_0x1d3c56){return new Promise(function(_0x31aeac){return db[_0x4519('0x3b')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d3c56}})[_0x4519('0x17')](function(_0x19b3b1){db[_0x4519('0x8c')]['destroy']({'where':{'CmHopperId':{'$in':_['map'](_0x19b3b1,'id')}}});})[_0x4519('0x17')](function(){_0x31aeac(0x1);});});}function addCmHopperPhones(_0xd2c73f){return new Promise(function(_0x20e1d6){return db[_0x4519('0x3b')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0xd2c73f}})[_0x4519('0x17')](function(_0x6c07c0){var _0x2d98a9=[];_[_0x4519('0x6b')](_0x6c07c0,function(_0x233d3d){_0x2d98a9[_0x4519('0x5e')](createCmHopperPhone(_0xd2c73f,_0x233d3d['id']));});Promise['all'](_0x2d98a9)[_0x4519('0x17')](function(){_0x20e1d6(0x1);});});});}function createCmHopperPhone(_0x4edfe1,_0x18177e){return new Promise(function(_0x33ac59){db[_0x4519('0x49')]['findAll']({'raw':!![],'attributes':[_0x4519('0x8d'),_0x4519('0x86')],'where':{'CmContactId':_0x4edfe1,'ItemClass':_0x4519('0x8b')},'include':[{'model':db[_0x4519('0x64')],'attributes':[_0x4519('0x86')],'as':_0x4519('0x65')}],'order':['OrderBy',db['sequelize'][_0x4519('0x67')](_0x4519('0x8e'))]})[_0x4519('0x17')](function(_0x4b630f){var _0x17c094=0x1;var _0x49ac98=_[_0x4519('0x6b')](_0x4b630f,function(_0x42af4f){_0x42af4f[_0x4519('0x8f')]=_0x18177e;_0x42af4f[_0x4519('0x75')]=_0x42af4f['item'];_0x42af4f[_0x4519('0x86')]=_0x17c094;delete _0x42af4f[_0x4519('0x90')];_0x17c094=_0x17c094+0x1;return _0x42af4f;});return db['CmHopperAdditionalPhone'][_0x4519('0x59')](_0x49ac98,{});})[_0x4519('0x17')](function(){_0x33ac59(0x1);});});}function insertAdditionalPhones(_0x53ef31,_0x3f7c1c){return new Promise(function(_0xb84efd){var _0x2361e5=[];for(var _0x26c8df=0x0;_0x26c8df<_0x3f7c1c[_0x4519('0x2d')];_0x26c8df++){var _0x31a588=_0x3f7c1c[_0x26c8df];_0x2361e5[_0x4519('0x5e')](parseContactItemType(_0x31a588));}Promise[_0x4519('0x85')](_0x2361e5)[_0x4519('0x17')](function(){var _0x2248a9={'id':_0x53ef31['id'],'items':_0x3f7c1c};return addAdditionalPhones(_0x2248a9)[_0x4519('0x17')](function(){return addCmHopperPhones(_0x53ef31['id']);});})[_0x4519('0x17')](function(){_0xb84efd(_0x53ef31);});});}function parseContactItemType(_0x4c15b9){return new Promise(function(_0x52d59f){if(_0x4c15b9['hasOwnProperty'](_0x4519('0x89'))){_0x52d59f(_0x4c15b9);}else{return db[_0x4519('0x64')][_0x4519('0x25')]({'where':{'name':_0x4c15b9[_0x4519('0x65')]}})[_0x4519('0x17')](function(_0xb02e6d){if(_[_0x4519('0x54')](_0xb02e6d))_0x4c15b9['ItemTypeId']=null;else _0x4c15b9[_0x4519('0x89')]=_0xb02e6d['id'];_0x52d59f(_0x4c15b9);});}});}exports[_0x4519('0x91')]=function(_0x40627c,_0x5353db){return db[_0x4519('0x49')][_0x4519('0x20')]({'raw':!![],'where':{'CmContactId':_0x40627c[_0x4519('0x26')]['id'],'ItemClass':_0x4519('0x8b')},'include':[{'model':db['ContactItemType'],'as':'ItemType'}],'order':[[_0x4519('0x86')],[db[_0x4519('0x66')][_0x4519('0x67')](_0x4519('0x8e'))]]})[_0x4519('0x17')](function(_0x23fa18){return _0x23fa18;})[_0x4519('0x17')](respondWithResult(_0x5353db,null))[_0x4519('0x23')](handleError(_0x5353db,null));};exports[_0x4519('0x92')]=function(_0x2d4583,_0x982b45){return db[_0x4519('0x49')][_0x4519('0x20')]({'raw':!![],'where':{'CmContactId':_0x2d4583[_0x4519('0x36')][_0x4519('0x93')]}})[_0x4519('0x17')](function(_0x336626){var _0x79fdff=_[_0x4519('0x6b')](_0x336626,function(_0x3016a8){_0x3016a8[_0x4519('0x94')]=_0x2d4583[_0x4519('0x36')][_0x4519('0x95')];return _0x3016a8;});return db[_0x4519('0x49')][_0x4519('0x59')](_0x79fdff,{});})[_0x4519('0x17')](function(){return addCmHopperPhones(_0x2d4583[_0x4519('0x36')]['toContactId']);})[_0x4519('0x17')](function(){return['ok'];})['then'](respondWithResult(_0x982b45,null))[_0x4519('0x23')](handleError(_0x982b45,null));};exports[_0x4519('0x96')]=function(_0x5aa7a9,_0x539d04){var _0x52a926=[];_0x52a926[_0x4519('0x5e')](createCmHopperPhone(_0x5aa7a9['body']['id'],_0x5aa7a9['body']['hopperId']));Promise[_0x4519('0x85')](_0x52a926)[_0x4519('0x17')](function(){return[0x1];})[_0x4519('0x17')](respondWithResult(_0x539d04,null));};exports[_0x4519('0x97')]=function(_0x133ab8,_0x20344b){var _0x3f50da={'raw':![],'where':{}};var _0x3bb71e={};var _0x552cce={'count':0x0,'rows':[]};return db[_0x4519('0x24')][_0x4519('0x76')]({'where':{'id':_0x133ab8[_0x4519('0x26')]['id']}})['then'](handleEntityNotFound(_0x20344b,null))['then'](function(_0x1cc228){if(_0x1cc228){_0x3bb71e['model']=_['keys'](db['CmHopper']['rawAttributes']);_0x3bb71e[_0x4519('0x21')]=_[_0x4519('0x28')](_0x133ab8['query']);_0x3bb71e['filters']=_[_0x4519('0x78')](_0x3bb71e[_0x4519('0x79')],_0x3bb71e[_0x4519('0x21')]);_0x3f50da[_0x4519('0x7a')]=_[_0x4519('0x78')](_0x3bb71e[_0x4519('0x79')],qs[_0x4519('0x7b')](_0x133ab8[_0x4519('0x21')][_0x4519('0x7b')]));_0x3f50da[_0x4519('0x7a')]=_0x3f50da[_0x4519('0x7a')][_0x4519('0x2d')]?_0x3f50da[_0x4519('0x7a')]:_0x3bb71e[_0x4519('0x79')];if(!_0x133ab8[_0x4519('0x21')]['hasOwnProperty'](_0x4519('0x82'))){_0x3f50da['limit']=qs[_0x4519('0x12')](_0x133ab8['query'][_0x4519('0x12')]);_0x3f50da[_0x4519('0x14')]=qs[_0x4519('0x14')](_0x133ab8['query'][_0x4519('0x14')]);}_0x3f50da[_0x4519('0x7c')]=qs['sort'](_0x133ab8[_0x4519('0x21')][_0x4519('0x7d')]);_0x3f50da[_0x4519('0x5c')]=qs[_0x4519('0x77')](_['pick'](_0x133ab8['query'],_0x3bb71e[_0x4519('0x77')]));_0x3f50da[_0x4519('0x5c')][_0x4519('0x98')]=_0x1cc228['id'];if(_0x133ab8[_0x4519('0x21')][_0x4519('0x7f')]){_0x3f50da[_0x4519('0x5c')]=_[_0x4519('0x35')](_0x3f50da['where'],{'$or':_[_0x4519('0x6b')](_0x3f50da['attributes'],function(_0x5820fa){var _0x276e5b={};_0x276e5b[_0x5820fa]={'$like':'%'+_0x133ab8['query']['filter']+'%'};return _0x276e5b;})});}_0x3f50da=_['merge']({},_0x3f50da,_0x133ab8[_0x4519('0x80')]);return db[_0x4519('0x3b')][_0x4519('0x13')]({'where':_0x3f50da[_0x4519('0x5c')]})[_0x4519('0x17')](function(_0x5d46f7){_0x552cce[_0x4519('0x13')]=_0x5d46f7;if(_0x133ab8[_0x4519('0x21')][_0x4519('0x99')]){_0x3f50da['include']=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x3f50da);})[_0x4519('0x17')](function(_0x1b0e2c){_0x552cce['rows']=_0x1b0e2c;return _0x552cce;});}})[_0x4519('0x17')](respondWithFilteredResult(_0x20344b,_0x3f50da))[_0x4519('0x23')](handleError(_0x20344b,null));};exports[_0x4519('0x9a')]=function(_0x17fa12,_0x47daa2){var _0x55ad30={'raw':!![],'where':{}};var _0x15e7c7={};var _0x504c8d={'count':0x0,'rows':[]};return db[_0x4519('0x24')][_0x4519('0x76')]({'where':{'id':_0x17fa12['params']['id']}})[_0x4519('0x17')](handleEntityNotFound(_0x47daa2,null))[_0x4519('0x17')](function(_0x8a2b5c){if(_0x8a2b5c){_0x15e7c7[_0x4519('0x79')]=_[_0x4519('0x28')](db[_0x4519('0x4b')][_0x4519('0x9b')]);_0x15e7c7[_0x4519('0x21')]=_[_0x4519('0x28')](_0x17fa12[_0x4519('0x21')]);_0x15e7c7[_0x4519('0x77')]=_['intersection'](_0x15e7c7[_0x4519('0x79')],_0x15e7c7[_0x4519('0x21')]);_0x55ad30['attributes']=_[_0x4519('0x78')](_0x15e7c7[_0x4519('0x79')],qs[_0x4519('0x7b')](_0x17fa12[_0x4519('0x21')][_0x4519('0x7b')]));_0x55ad30[_0x4519('0x7a')]=_0x55ad30['attributes'][_0x4519('0x2d')]?_0x55ad30[_0x4519('0x7a')]:_0x15e7c7[_0x4519('0x79')];if(!_0x17fa12[_0x4519('0x21')][_0x4519('0x34')](_0x4519('0x82'))){_0x55ad30['limit']=qs['limit'](_0x17fa12[_0x4519('0x21')][_0x4519('0x12')]);_0x55ad30[_0x4519('0x14')]=qs[_0x4519('0x14')](_0x17fa12[_0x4519('0x21')]['offset']);}_0x55ad30['order']=qs[_0x4519('0x7d')](_0x17fa12[_0x4519('0x21')][_0x4519('0x7d')]);_0x55ad30[_0x4519('0x5c')]=qs['filters'](_[_0x4519('0x7e')](_0x17fa12[_0x4519('0x21')],_0x15e7c7[_0x4519('0x77')]));_0x55ad30['where'][_0x4519('0x98')]=_0x8a2b5c['id'];if(_0x17fa12['query']['filter']){_0x55ad30['where']=_[_0x4519('0x35')](_0x55ad30[_0x4519('0x5c')],{'$or':_[_0x4519('0x6b')](_0x55ad30[_0x4519('0x7a')],function(_0x2d24bb){var _0xd434de={};_0xd434de[_0x2d24bb]={'$like':'%'+_0x17fa12['query'][_0x4519('0x7f')]+'%'};return _0xd434de;})});}_0x55ad30=_['merge']({},_0x55ad30,_0x17fa12[_0x4519('0x80')]);return db[_0x4519('0x4b')]['count']({'where':_0x55ad30[_0x4519('0x5c')]})[_0x4519('0x17')](function(_0x4ca642){_0x504c8d[_0x4519('0x13')]=_0x4ca642;if(_0x17fa12['query'][_0x4519('0x99')]){_0x55ad30['include']=[{'all':!![]}];}return db[_0x4519('0x4b')][_0x4519('0x20')](_0x55ad30);})[_0x4519('0x17')](function(_0x54494f){_0x504c8d[_0x4519('0x9c')]=_0x54494f;return _0x504c8d;});}})['then'](respondWithFilteredResult(_0x47daa2,_0x55ad30))[_0x4519('0x23')](handleError(_0x47daa2,null));};exports[_0x4519('0x9d')]=function(_0x439dc7,_0x2cf67c){var _0x21455b={'raw':!![],'where':{}};var _0x1b0140={};var _0x29925b={'count':0x0,'rows':[]};return db['CmContact'][_0x4519('0x76')]({'where':{'id':_0x439dc7[_0x4519('0x26')]['id']}})['then'](handleEntityNotFound(_0x2cf67c,null))[_0x4519('0x17')](function(_0x482b47){if(_0x482b47){_0x1b0140[_0x4519('0x79')]=_['keys'](db[_0x4519('0x4a')]['rawAttributes']);_0x1b0140[_0x4519('0x21')]=_[_0x4519('0x28')](_0x439dc7['query']);_0x1b0140[_0x4519('0x77')]=_['intersection'](_0x1b0140[_0x4519('0x79')],_0x1b0140[_0x4519('0x21')]);_0x21455b[_0x4519('0x7a')]=_[_0x4519('0x78')](_0x1b0140[_0x4519('0x79')],qs['fields'](_0x439dc7[_0x4519('0x21')][_0x4519('0x7b')]));_0x21455b['attributes']=_0x21455b['attributes'][_0x4519('0x2d')]?_0x21455b[_0x4519('0x7a')]:_0x1b0140['model'];if(!_0x439dc7[_0x4519('0x21')][_0x4519('0x34')](_0x4519('0x82'))){_0x21455b[_0x4519('0x12')]=qs[_0x4519('0x12')](_0x439dc7['query'][_0x4519('0x12')]);_0x21455b[_0x4519('0x14')]=qs[_0x4519('0x14')](_0x439dc7['query']['offset']);}_0x21455b[_0x4519('0x7c')]=qs[_0x4519('0x7d')](_0x439dc7[_0x4519('0x21')][_0x4519('0x7d')]);_0x21455b[_0x4519('0x5c')]=qs[_0x4519('0x77')](_[_0x4519('0x7e')](_0x439dc7[_0x4519('0x21')],_0x1b0140['filters']));_0x21455b[_0x4519('0x5c')][_0x4519('0x98')]=_0x482b47['id'];if(_0x439dc7[_0x4519('0x21')][_0x4519('0x7f')]){_0x21455b[_0x4519('0x5c')]=_[_0x4519('0x35')](_0x21455b['where'],{'$or':_[_0x4519('0x6b')](_0x21455b[_0x4519('0x7a')],function(_0x344ea0){var _0x3b0220={};_0x3b0220[_0x344ea0]={'$like':'%'+_0x439dc7[_0x4519('0x21')]['filter']+'%'};return _0x3b0220;})});}_0x21455b=_[_0x4519('0x35')]({},_0x21455b,_0x439dc7[_0x4519('0x80')]);return db[_0x4519('0x4a')][_0x4519('0x13')]({'where':_0x21455b[_0x4519('0x5c')]})[_0x4519('0x17')](function(_0x867de1){_0x29925b[_0x4519('0x13')]=_0x867de1;if(_0x439dc7['query'][_0x4519('0x99')]){_0x21455b[_0x4519('0x9e')]=[{'all':!![]}];}return db[_0x4519('0x4a')][_0x4519('0x20')](_0x21455b);})[_0x4519('0x17')](function(_0x1e37ef){_0x29925b[_0x4519('0x9c')]=_0x1e37ef;return _0x29925b;});}})[_0x4519('0x17')](respondWithFilteredResult(_0x2cf67c,_0x21455b))[_0x4519('0x23')](handleError(_0x2cf67c,null));};exports[_0x4519('0x9f')]=function(_0x5afee5,_0x44749b){var _0x4334f2={'raw':!![],'where':{}};var _0x582809={};var _0x22b507={'count':0x0,'rows':[]};return db[_0x4519('0x24')][_0x4519('0x76')]({'where':{'id':_0x5afee5[_0x4519('0x26')]['id']}})[_0x4519('0x17')](handleEntityNotFound(_0x44749b,null))['then'](function(_0x289786){if(_0x289786){_0x582809[_0x4519('0x79')]=_[_0x4519('0x28')](db[_0x4519('0xa0')][_0x4519('0x9b')]);_0x582809['query']=_[_0x4519('0x28')](_0x5afee5[_0x4519('0x21')]);_0x582809['filters']=_[_0x4519('0x78')](_0x582809[_0x4519('0x79')],_0x582809[_0x4519('0x21')]);_0x4334f2[_0x4519('0x7a')]=_['intersection'](_0x582809[_0x4519('0x79')],qs[_0x4519('0x7b')](_0x5afee5[_0x4519('0x21')][_0x4519('0x7b')]));_0x4334f2[_0x4519('0x7a')]=_0x4334f2[_0x4519('0x7a')][_0x4519('0x2d')]?_0x4334f2['attributes']:_0x582809[_0x4519('0x79')];if(!_0x5afee5[_0x4519('0x21')][_0x4519('0x34')](_0x4519('0x82'))){_0x4334f2[_0x4519('0x12')]=qs[_0x4519('0x12')](_0x5afee5[_0x4519('0x21')][_0x4519('0x12')]);_0x4334f2[_0x4519('0x14')]=qs[_0x4519('0x14')](_0x5afee5['query']['offset']);}_0x4334f2['order']=qs['sort'](_0x5afee5[_0x4519('0x21')]['sort']);_0x4334f2[_0x4519('0x5c')]=qs[_0x4519('0x77')](_[_0x4519('0x7e')](_0x5afee5[_0x4519('0x21')],_0x582809[_0x4519('0x77')]));_0x4334f2[_0x4519('0x5c')][_0x4519('0x98')]=_0x289786['id'];if(_0x5afee5[_0x4519('0x21')]['filter']){_0x4334f2[_0x4519('0x5c')]=_[_0x4519('0x35')](_0x4334f2[_0x4519('0x5c')],{'$or':_[_0x4519('0x6b')](_0x4334f2['attributes'],function(_0x15b763){var _0x765854={};_0x765854[_0x15b763]={'$like':'%'+_0x5afee5[_0x4519('0x21')]['filter']+'%'};return _0x765854;})});}_0x4334f2=_[_0x4519('0x35')]({},_0x4334f2,_0x5afee5[_0x4519('0x80')]);return db[_0x4519('0xa0')]['count']({'where':_0x4334f2[_0x4519('0x5c')]})[_0x4519('0x17')](function(_0x1c0f7c){_0x22b507[_0x4519('0x13')]=_0x1c0f7c;if(_0x5afee5[_0x4519('0x21')][_0x4519('0x99')]){_0x4334f2[_0x4519('0x9e')]=[{'all':!![]}];}return db[_0x4519('0xa0')][_0x4519('0x20')](_0x4334f2);})[_0x4519('0x17')](function(_0x4f5678){_0x22b507[_0x4519('0x9c')]=_0x4f5678;return _0x22b507;});}})['then'](respondWithFilteredResult(_0x44749b,_0x4334f2))['catch'](handleError(_0x44749b,null));};exports[_0x4519('0xa1')]=function(_0x82d554,_0x5e5047){try{if(!_0x82d554[_0x4519('0x36')]['ListId']){throw new Error(_0x4519('0xa2'));}if(!_0x82d554[_0x4519('0x36')][_0x4519('0xa3')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x82d554[_0x4519('0x36')][_0x4519('0xa4')]){throw new Error(_0x4519('0xa5'));}if(!_0x82d554[_0x4519('0x36')][_0x4519('0xa6')]){throw new Error(_0x4519('0xa7'));}var _0x4a424b=_0x82d554['body'][_0x4519('0xa3')][_0x4519('0xa8')](',');var _0x4eafc5=_0x82d554['body']['binding_values'][_0x4519('0xa8')](',');if(!_0x4a424b[_0x4519('0x2d')]||!_0x4eafc5[_0x4519('0x2d')]||_0x4a424b[_0x4519('0x2d')]!==_0x4eafc5[_0x4519('0x2d')]){throw new Error(_0x4519('0xa9'));}_0x82d554[_0x4519('0x36')][_0x4519('0x7b')]=_['zipObject'](_0x4a424b,_0x4eafc5);if(!_0x82d554[_0x4519('0x36')][_0x4519('0x7b')][_0x4519('0x75')]){throw new Error(_0x4519('0xaa'));}if(!_0x82d554[_0x4519('0x36')]['fields'][_0x4519('0xab')]){throw new Error(_0x4519('0xac'));}var _0x4cf3b6=path[_0x4519('0x53')](config[_0x4519('0xad')],_0x4519('0xae'),_0x82d554[_0x4519('0xaf')][_0x4519('0xb0')]);fs[_0x4519('0xb1')](_0x4cf3b6,parseInt('0777',0x8));var _0x82b00b=require(_0x4519('0xb2'))[_0x4519('0xb3')](path[_0x4519('0x53')](__dirname,'../../components/import/cm/csv'),[_0x4cf3b6,_0x82d554['body'][_0x4519('0xa3')],_0x82d554[_0x4519('0x36')][_0x4519('0xa4')],_0x82d554[_0x4519('0x36')]['ListId'],_0x82d554[_0x4519('0x36')]['CompanyId'],_0x82d554['body']['duplicates'],_0x82d554[_0x4519('0x36')][_0x4519('0xa6')]]);return _0x5e5047[_0x4519('0x10')](0xc8)[_0x4519('0x15')]({'message':'File\x20uploaded\x20correctly!','pid':_0x82b00b['pid']});}catch(_0x10d45e){return _0x5e5047['status'](0x1f4)[_0x4519('0x1d')](_0x10d45e);}};exports[_0x4519('0xb4')]=function(_0x5e71c7,_0x176016){var _0x7ceb02=fs[_0x4519('0xb5')](_0x5e71c7[_0x4519('0xaf')]['path']);Papa[_0x4519('0xb6')](_0x7ceb02,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x39a2ea){return _0x176016[_0x4519('0x10')](0xc8)[_0x4519('0x15')]({'file':_0x5e71c7[_0x4519('0xaf')],'fields':_0x39a2ea[_0x4519('0xb7')][_0x4519('0x7b')]});}});};exports[_0x4519('0xb8')]=function(_0xf791d6,_0x195fe9){return db[_0x4519('0xb9')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x4519('0xba')}})[_0x4519('0x17')](function(_0x93edc0){var _0x4b102e=![];if(!_0xf791d6[_0x4519('0x36')][_0x4519('0x5f')]){throw new Error(_0x4519('0xa2'));}if(!_0xf791d6[_0x4519('0x36')][_0x4519('0xbb')][_0x4519('0x75')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0xf791d6[_0x4519('0x36')]['binding']['firstName']){throw new Error(_0x4519('0xac'));}if(!_0xf791d6[_0x4519('0x36')][_0x4519('0xa6')]){throw new Error(_0x4519('0xa7'));}var _0x3ea9be=require(_0x4519('0xb2'))[_0x4519('0xb3')](path[_0x4519('0x53')](__dirname,'../../components/import/cm/csv2'),[_0xf791d6[_0x4519('0x26')]['id'],JSON[_0x4519('0xbc')](_0xf791d6['body']),JSON[_0x4519('0xbc')](_0x93edc0)]);_0x3ea9be['on']('message',function(){_0x4b102e=!![];return _0x195fe9['status'](0xc8)[_0x4519('0x15')]({'message':_0x4519('0xbd'),'pid':_0x3ea9be[_0x4519('0xbe')]});});_0x3ea9be['on'](_0x4519('0xbf'),function(_0x29f020){if(_0x29f020&&!_0x4b102e){return _0x195fe9['status'](0x1f4)[_0x4519('0x15')]({'message':'error\x20child\x20process','pid':_0x3ea9be[_0x4519('0xbe')]});}});})['catch'](handleError(_0x195fe9,null));};exports[_0x4519('0xc0')]=function(_0x1d3c2e,_0x58178b){return db['User']['findAll']({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x4519('0x17')](function(_0x553069){var _0x22d8c3=![];if(!_0x1d3c2e['body']['ListId']){throw new Error(_0x4519('0xa2'));}if(!_0x1d3c2e[_0x4519('0x36')]['binding'][_0x4519('0x75')]){throw new Error('No\x20phone\x20column\x20specified');}if(!_0x1d3c2e[_0x4519('0x36')][_0x4519('0xbb')][_0x4519('0xab')]){throw new Error(_0x4519('0xac'));}if(!_0x1d3c2e[_0x4519('0x36')][_0x4519('0xa6')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x4c1fac=require(_0x4519('0xb2'))[_0x4519('0xb3')](path[_0x4519('0x53')](__dirname,_0x4519('0xc1')),[_0x1d3c2e['params']['id'],JSON['stringify'](_0x1d3c2e[_0x4519('0x36')]),JSON['stringify'](_0x553069)]);_0x4c1fac['on'](_0x4519('0xc2'),function(){_0x22d8c3=!![];return _0x58178b['status'](0xc8)[_0x4519('0x15')]({'message':_0x4519('0xbd'),'pid':_0x4c1fac[_0x4519('0xbe')]});});_0x4c1fac['on'](_0x4519('0xbf'),function(_0x1b7d45){if(_0x1b7d45&&!_0x22d8c3){return _0x58178b[_0x4519('0x10')](0x1f4)[_0x4519('0x15')]({'message':_0x4519('0xc3'),'pid':_0x4c1fac['pid']});}});})[_0x4519('0x23')](handleError(_0x58178b,null));};exports[_0x4519('0xc4')]=function(_0x5176b8,_0xc4eb45){var _0x4f7996=[_0x4519('0xc5'),_0x4519('0xc6'),_0x4519('0xc7'),_0x4519('0xc8'),'fax',_0x4519('0xc9'),'voice'];var _0x3aa0fa={'offset':0x0,'order':qs[_0x4519('0x7d')](_0x4519('0xca'))},_0x5d6cfb={'count':0x0,'rows':[]};Promise[_0x4519('0xcb')]()[_0x4519('0x17')](function(){if(_0x5176b8[_0x4519('0x21')]['channel']){if(!_[_0x4519('0xcc')](_0x4f7996,_0x5176b8[_0x4519('0x21')]['channel']['toLowerCase']())){throw new Error(_0x4519('0xcd'));}_0x4f7996=[_0x5176b8['query']['channel'][_0x4519('0xce')]()];}if(_0x5176b8[_0x4519('0x21')][_0x4519('0xcf')]){try{var _0x245d08=JSON[_0x4519('0xb6')](_0x5176b8['query'][_0x4519('0xcf')]);if(!moment(_0x245d08[_0x4519('0x37')])[_0x4519('0xd0')]()){throw new Error(_0x4519('0xd1'));}if(!moment(_0x245d08['to'])[_0x4519('0xd0')]()){throw new Error(_0x4519('0xd2'));}}catch(_0x45dc83){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x5176b8['query'][_0x4519('0x34')]('nolimit')){_0x3aa0fa[_0x4519('0x12')]=qs[_0x4519('0x12')](_0x5176b8[_0x4519('0x21')]['limit']||0xa);_0x3aa0fa[_0x4519('0x14')]=qs[_0x4519('0x14')](_0x5176b8[_0x4519('0x21')][_0x4519('0x14')]);}var _0x2bf04c=_0x4f7996[_0x4519('0x6b')](function(_0x2a8bab){if(_0x2a8bab===_0x4519('0xd3')){var _0x35321b={'attributes':['id','uniqueid',_0x4519('0xd4'),_0x4519('0xd5'),'destination',_0x4519('0xd6'),_0x4519('0xd7'),_0x4519('0xd8'),_0x4519('0xd9'),'note','createdAt',_0x4519('0xda'),'userSecondDisposition',_0x4519('0xdb'),_0x4519('0xdc')],'where':{'ContactId':_0x5176b8[_0x4519('0x26')]['id']},'include':[{'model':db[_0x4519('0xb9')],'as':'User','attributes':['id',_0x4519('0x1c'),'fullname',_0x4519('0x2f')]}],'order':[['createdAt',_0x4519('0xdd')]]};if(_0x5176b8['query']['range']){_0x35321b['where'][_0x4519('0xde')]={'$gte':_0x245d08['from'],'$lte':_0x245d08['to']};}return db[_0x4519('0x4d')][_0x4519('0xdf')](_0x35321b)[_0x4519('0x17')](function(_0x4efaf4){_0x5d6cfb[_0x4519('0x13')]+=_0x4efaf4[_0x4519('0x13')];return _[_0x4519('0x6b')](_0x4efaf4[_0x4519('0x9c')],function(_0xb166af){var _0x54bcb7=_0xb166af['get']({'plain':!![]});_0x54bcb7[_0x4519('0xe0')]=_0x2a8bab;if(_0x54bcb7[_0x4519('0xb9')]){_0x54bcb7['User']={'id':_0x54bcb7[_0x4519('0xb9')]['id'],'name':_0x54bcb7[_0x4519('0xb9')][_0x4519('0x1c')],'fullname':_0x54bcb7[_0x4519('0xb9')][_0x4519('0xe1')],'alias':_0x54bcb7[_0x4519('0xb9')][_0x4519('0x2f')]};}return _0x54bcb7;});});}else{var _0x4ad7c8=_[_0x4519('0xe2')](_0x2a8bab)+(_0x2a8bab===_0x4519('0xc6')?_0x4519('0xe3'):_0x4519('0xe4'));var _0xac5687={'attributes':['id','closed',_0x4519('0xe5'),_0x4519('0xde'),_0x4519('0xe6'),_0x4519('0xe7'),_0x4519('0xe8'),_0x4519('0xe9'),_0x4519('0xdc'),_0x4ad7c8+'Id'],'where':{'ContactId':_0x5176b8[_0x4519('0x26')]['id']},'include':[{'model':db[_0x4ad7c8],'as':_0x4519('0xe4'),'attributes':['id',_0x4519('0x1c'),_0x4519('0xea')]},{'model':db[_0x4519('0xb9')],'as':_0x4519('0xeb'),'attributes':['id',_0x4519('0x1c'),_0x4519('0xe1')]},{'model':db[_0x4519('0x62')],'as':_0x4519('0xec'),'attributes':['id','name',_0x4519('0x63')],'through':{'attributes':[]}}],'order':[[_0x4519('0xde'),_0x4519('0xdd')]]};if(_0x5176b8[_0x4519('0x21')]['range']){_0xac5687[_0x4519('0x5c')][_0x4519('0xde')]={'$gte':_0x245d08['from'],'$lte':_0x245d08['to']};}switch(_0x2a8bab){case _0x4519('0xc6'):_0xac5687['attributes'][_0x4519('0x5e')](_0x4519('0xed'),'customerIp',_0x4519('0xee'),'deviceModel',_0x4519('0xef'),_0x4519('0xf0'),'ratingType',_0x4519('0xf1'),_0x4519('0xf2'));break;case _0x4519('0xc5'):_0xac5687[_0x4519('0x7a')]['push'](_0x4519('0xf3'),_0x4519('0xf4'));break;case _0x4519('0xc8'):_0xac5687['attributes'][_0x4519('0x5e')](_0x4519('0xf5'),_0x4519('0xf6'));break;}return db[_['startCase'](_0x2a8bab)+_0x4519('0xf7')]['findAndCountAll'](_0xac5687)[_0x4519('0x17')](function(_0x393a06){_0x5d6cfb['count']+=_0x393a06['count'];return _[_0x4519('0x6b')](_0x393a06[_0x4519('0x9c')],function(_0x3add8c){var _0x18b68c=_0x3add8c[_0x4519('0x38')]({'plain':!![]});_0x18b68c[_0x4519('0xe0')]=_0x2a8bab;if(_0x18b68c[_0x4519('0xeb')]){_0x18b68c[_0x4519('0xeb')]={'id':_0x18b68c['Owner']['id'],'name':_0x18b68c[_0x4519('0xeb')][_0x4519('0x1c')],'fullname':_0x18b68c['Owner'][_0x4519('0xe1')]};}return _0x18b68c;});});}});return Promise['all'](_0x2bf04c);})['then'](function(_0x94abab){return _(_0x94abab)[_0x4519('0xf8')]()['sortBy'](_0x4519('0xde'))['reverse']()['value']();})[_0x4519('0x17')](function(_0x366068){_0x5d6cfb[_0x4519('0x9c')]=_0x3aa0fa['limit']?_0x366068[_0x4519('0xf9')](_0x3aa0fa['offset'],_0x3aa0fa[_0x4519('0x14')]+_0x3aa0fa[_0x4519('0x12')]):_0x366068;return _0x5d6cfb;})[_0x4519('0x17')](respondWithFilteredResult(_0xc4eb45,_0x3aa0fa))['catch'](handleError(_0xc4eb45,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index d78342b..0a8b5f5 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb70f=['hasOwnProperty','hook','exports','events','CmContact','setMaxListeners','save','remove','emit'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xb70f,0x81));var _0xfb70=function(_0x1872ce,_0x55640f){_0x1872ce=_0x1872ce-0x0;var _0x3e7942=_0xb70f[_0x1872ce];return _0x3e7942;};'use strict';var EventEmitter=require(_0xfb70('0x0'));var CmContact=require('../../mysqldb')['db'][_0xfb70('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xfb70('0x2')](0x0);var events={'afterCreate':_0xfb70('0x3'),'afterUpdate':'update','afterDestroy':_0xfb70('0x4')};function emitEvent(_0x53368d){return function(_0x15592c,_0x4a4cb4,_0x1b399b){CmContactEvents[_0xfb70('0x5')](_0x53368d+':'+_0x15592c['id'],_0x15592c);CmContactEvents[_0xfb70('0x5')](_0x53368d,_0x15592c);_0x1b399b(null);};}for(var e in events){if(events[_0xfb70('0x6')](e)){var event=events[e];CmContact[_0xfb70('0x7')](e,emitEvent(event));}}module[_0xfb70('0x8')]=CmContactEvents; \ No newline at end of file +var _0x7bd8=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','CmContact'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7bd8,0x127));var _0x87bd=function(_0x83f1f,_0x42d753){_0x83f1f=_0x83f1f-0x0;var _0x37234e=_0x7bd8[_0x83f1f];return _0x37234e;};'use strict';var EventEmitter=require('events');var CmContact=require('../../mysqldb')['db'][_0x87bd('0x0')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x87bd('0x1')](0x0);var events={'afterCreate':_0x87bd('0x2'),'afterUpdate':_0x87bd('0x3'),'afterDestroy':_0x87bd('0x4')};function emitEvent(_0x4a1713){return function(_0x59d8ec,_0x224860,_0x3accb3){CmContactEvents[_0x87bd('0x5')](_0x4a1713+':'+_0x59d8ec['id'],_0x59d8ec);CmContactEvents['emit'](_0x4a1713,_0x59d8ec);_0x3accb3(null);};}for(var e in events){if(events[_0x87bd('0x6')](e)){var event=events[e];CmContact[_0x87bd('0x7')](e,emitEvent(event));}}module['exports']=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index f868816..c09533e 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x330c=['../../config/environment/shared','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','FULLTEXT','utf8mb4','models','get','error','cmContact','afterCreate','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','VoiceQueue','then','isNil','utcOffset','add','minutes','CmHopper','cmContact,\x20afterCreate\x20','create','ListId','priority','callbackUniqueid','catch','findOne','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','inspect','dialTimezone','Campaign','timezones','ret','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','dialCheckDuplicateType','Lists','always','onlyIfOpen','CmList','CmHopperBlack','cmContact,\x20%s,\x20%s','message','length','List\x20not\x20found','isEmpty','destroy','CampaignId','push','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x330c,0x8a));var _0xc330=function(_0x2b02f0,_0x34f79b){_0x2b02f0=_0x2b02f0-0x0;var _0x24e04c=_0x330c[_0x2b02f0];return _0x24e04c;};'use strict';var _=require('lodash');var util=require(_0xc330('0x0'));var logger=require(_0xc330('0x1'))(_0xc330('0x2'));var moment=require('moment');var BPromise=require(_0xc330('0x3'));var rp=require(_0xc330('0x4'));var fs=require('fs');var path=require(_0xc330('0x5'));var rimraf=require(_0xc330('0x6'));var config=require(_0xc330('0x7'));var shared=require(_0xc330('0x8'));var attributes=require(_0xc330('0x9'));module[_0xc330('0xa')]=function(_0xcaaa40,_0x34c85b){return _0xcaaa40[_0xc330('0xb')](_0xc330('0xc'),attributes,{'tableName':_0xc330('0xd'),'paranoid':!![],'indexes':[{'name':_0xc330('0xe'),'fields':[_0xc330('0xe')]},{'name':_0xc330('0xf'),'fields':[_0xc330('0x10'),_0xc330('0x11'),_0xc330('0xe'),_0xc330('0x12'),_0xc330('0x13'),_0xc330('0x14')],'type':_0xc330('0x15')}],'timestamps':!![],'charset':_0xc330('0x16'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x8c47cc,_0x148705,_0x3a91a1){var _0x2d50ca=_0xcaaa40[_0xc330('0x17')];var _0x10de7f=_0x8c47cc[_0xc330('0x18')]({'plain':!![]});function _0x2a72b4(){return function(_0x142ebf){logger[_0xc330('0x19')](_0xc330('0x1a'),_0xc330('0x1b'),util['inspect'](_0x142ebf,{'showHidden':![],'depth':null}));};}function _0x3a36f3(_0xd164a7,_0x2efcf9){var _0x3799fa=_0x2efcf9[_0xc330('0x1c')]?_0x2efcf9[_0xc330('0x1c')]:moment()[_0xc330('0x1d')](_0xc330('0x1e'));return new BPromise(function(_0x1aa3c4,_0x3ec0f8){if(_['isNil'](_0x2efcf9['dialTimezone'])){_0x1aa3c4({'ret':_0x3799fa});}else{_0x2d50ca[_0xc330('0x1f')]['findOne']({'where':{'id':_0xd164a7['id']}})[_0xc330('0x20')](function(_0x18bbd6){if(!_[_0xc330('0x21')](_0x18bbd6)){var _0xb04dfd=_0x18bbd6['dialTimezone'];if(!_['isNil'](_0xb04dfd)){var _0x563d76=shared['timezones'];var _0x17031b=_0x563d76[_0xb04dfd];var _0x151018=_0x563d76[_0x2efcf9['dialTimezone']];if(!_['isNil'](_0x17031b)&&!_[_0xc330('0x21')](_0x151018)){var _0x1798b2=_0x17031b[_0xc330('0x22')]-_0x151018[_0xc330('0x22')];_0x3799fa=_0x2efcf9[_0xc330('0x1c')]?_0x2efcf9['scheduledat']:moment();var _0x1c1034=moment(_0x3799fa)[_0xc330('0x23')](_0x1798b2,_0xc330('0x24'));_0x1aa3c4({'ret':_0x1c1034[_0xc330('0x1d')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x1aa3c4({'ret':_0x3799fa});}else _0x1aa3c4({'ret':_0x3799fa});}else{_0x1aa3c4({'ret':_0x3799fa});}});}});return 0xa;}var _0x599948=function(_0xc1c91d){return new BPromise(function(_0x30d0be,_0x1ea3b){_0x3a36f3(_0xc1c91d,_0x10de7f)[_0xc330('0x20')](function(_0x519b19){_0x10de7f[_0xc330('0x1c')]=_0x519b19['ret'];_0x2d50ca[_0xc330('0x25')]['findOne']({'where':{'phone':_0x10de7f[_0xc330('0xe')],'VoiceQueueId':_0xc1c91d['id']}})[_0xc330('0x20')](function(_0x28b94c){if(!_['isNil'](_0x28b94c)){throw new Error(_0xc330('0x26')+_0x10de7f[_0xc330('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20'+_0xc1c91d['id']);}return _0x2d50ca[_0xc330('0x25')][_0xc330('0x27')]({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f[_0xc330('0x28')],'priority':_0x10de7f[_0xc330('0x29')]?_0x10de7f['priority']:0x2,'scheduledat':_0x10de7f[_0xc330('0x1c')]?_0x10de7f[_0xc330('0x1c')]:moment()[_0xc330('0x1d')](_0xc330('0x1e')),'callback':_0x10de7f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x10de7f['callbackUniqueid']?_0x10de7f[_0xc330('0x2a')]:undefined,'callbackat':_0x10de7f[_0xc330('0x2a')]?moment()['format'](_0xc330('0x1e')):undefined,'VoiceQueueId':_0xc1c91d['id']});})[_0xc330('0x2b')](function(_0x29cbc3){_0x1ea3b(_0x29cbc3);});});});};var _0x35622e=function(_0x4ece33){return new BPromise(function(_0x5629e3,_0x5e0c0e){_0x3a36f3(_0x4ece33,_0x10de7f)[_0xc330('0x20')](function(_0x5420c2){_0x10de7f[_0xc330('0x1c')]=_0x5420c2['ret'];_0x2d50ca['CmHopper'][_0xc330('0x2c')]({'where':{'phone':_0x10de7f[_0xc330('0xe')],'VoiceQueueId':_0x4ece33['id']}})[_0xc330('0x20')](function(_0x3986a5){if(!_[_0xc330('0x21')](_0x3986a5)){throw new Error(_0xc330('0x26')+_0x10de7f[_0xc330('0xe')]+_0xc330('0x2d')+_0x4ece33['id']);}return _0x2d50ca[_0xc330('0x2e')][_0xc330('0x2c')]({'where':{'calleridnum':_0x10de7f[_0xc330('0xe')],'VoiceQueueId':_0x4ece33['id']}});})[_0xc330('0x20')](function(_0x4770b1){if(!_[_0xc330('0x21')](_0x4770b1)){throw new Error(_0xc330('0x2f')+_0x10de7f[_0xc330('0xe')]+_0xc330('0x30')+_0x4ece33['id']);}return _0x2d50ca[_0xc330('0x25')][_0xc330('0x27')]({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f[_0xc330('0x28')],'priority':_0x10de7f['priority']?_0x10de7f[_0xc330('0x29')]:0x2,'scheduledat':_0x10de7f[_0xc330('0x1c')]?_0x10de7f['scheduledat']:moment()[_0xc330('0x1d')](_0xc330('0x1e')),'callback':_0x10de7f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x10de7f['callbackUniqueid']?_0x10de7f['callbackUniqueid']:undefined,'callbackat':_0x10de7f[_0xc330('0x2a')]?moment()['format'](_0xc330('0x1e')):undefined,'VoiceQueueId':_0x4ece33['id']});})['catch'](function(_0x581b12){_0x5e0c0e(_0x581b12);});});});};function _0x244137(){return function(_0x392e25){logger[_0xc330('0x19')](_0xc330('0x1a'),'afterCreate',util[_0xc330('0x31')](_0x392e25,{'showHidden':![],'depth':null}));};}function _0x14b7e2(_0x5d8b73,_0x5c7716){var _0x2e109f=_0x5c7716[_0xc330('0x1c')]?_0x5c7716['scheduledat']:moment()[_0xc330('0x1d')](_0xc330('0x1e'));return new BPromise(function(_0xdb6adb,_0x583ce6){if(_[_0xc330('0x21')](_0x5c7716[_0xc330('0x32')])){_0xdb6adb({'ret':_0x2e109f});}else{_0x2d50ca[_0xc330('0x33')][_0xc330('0x2c')]({'where':{'id':_0x5d8b73['id']}})[_0xc330('0x20')](function(_0x211e12){if(!_[_0xc330('0x21')](_0x211e12)){var _0x15abb8=_0x211e12[_0xc330('0x32')];if(!_[_0xc330('0x21')](_0x15abb8)){var _0x8d0767=shared[_0xc330('0x34')];var _0x4385dd=_0x8d0767[_0x15abb8];var _0x5c4546=_0x8d0767[_0x5c7716[_0xc330('0x32')]];if(!_[_0xc330('0x21')](_0x4385dd)&&!_[_0xc330('0x21')](_0x5c4546)){var _0x31db04=_0x4385dd[_0xc330('0x22')]-_0x5c4546[_0xc330('0x22')];_0x2e109f=_0x5c7716['scheduledat']?_0x5c7716[_0xc330('0x1c')]:moment();var _0x3ba98c=moment(_0x2e109f)[_0xc330('0x23')](_0x31db04,'minutes');_0xdb6adb({'ret':_0x3ba98c[_0xc330('0x1d')](_0xc330('0x1e'))});}else _0xdb6adb({'ret':_0x2e109f});}else _0xdb6adb({'ret':_0x2e109f});}else{_0xdb6adb({'ret':_0x2e109f});}});}});return 0xa;}var _0x33b637=function(_0x2c5542){return new BPromise(function(_0x38e918,_0x1d379c){_0x14b7e2(_0x2c5542,_0x10de7f)[_0xc330('0x20')](function(_0x2db292){_0x10de7f[_0xc330('0x1c')]=_0x2db292[_0xc330('0x35')];_0x2d50ca[_0xc330('0x25')][_0xc330('0x2c')]({'where':{'phone':_0x10de7f['phone'],'CampaignId':_0x2c5542['id']}})[_0xc330('0x20')](function(_0x583de8){if(!_[_0xc330('0x21')](_0x583de8)){throw new Error(_0xc330('0x26')+_0x10de7f[_0xc330('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x2c5542['id']);}return _0x2d50ca[_0xc330('0x25')]['create']({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f[_0xc330('0x28')],'priority':_0x10de7f['priority']?_0x10de7f[_0xc330('0x29')]:0x2,'scheduledat':_0x10de7f[_0xc330('0x1c')]?_0x10de7f[_0xc330('0x1c')]:moment()[_0xc330('0x1d')](_0xc330('0x1e')),'callback':_0x10de7f[_0xc330('0x2a')]?!![]:![],'callbackuniqueid':_0x10de7f[_0xc330('0x2a')]?_0x10de7f['callbackUniqueid']:undefined,'callbackat':_0x10de7f[_0xc330('0x2a')]?moment()[_0xc330('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x2c5542['id']});})[_0xc330('0x2b')](function(_0x24c461){_0x1d379c(_0x24c461);});});});};var _0x295472=function(_0x1239e4){return new BPromise(function(_0x5c7449,_0x3c59a){_0x14b7e2(_0x1239e4,_0x10de7f)[_0xc330('0x20')](function(_0x42cbdc){_0x10de7f[_0xc330('0x1c')]=_0x42cbdc[_0xc330('0x35')];_0x2d50ca['CmHopper'][_0xc330('0x2c')]({'where':{'phone':_0x10de7f[_0xc330('0xe')],'CampaignId':_0x1239e4['id']}})['then'](function(_0x73a22){if(!_['isNil'](_0x73a22)){throw new Error(_0xc330('0x26')+_0x10de7f[_0xc330('0xe')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x1239e4['id']);}return _0x2d50ca['CmHopperFinal'][_0xc330('0x2c')]({'where':{'calleridnum':_0x10de7f[_0xc330('0xe')],'CampaignId':_0x1239e4['id']}});})[_0xc330('0x20')](function(_0x38bad9){if(!_[_0xc330('0x21')](_0x38bad9)){throw new Error(_0xc330('0x2f')+_0x10de7f['phone']+_0xc330('0x36')+_0x1239e4['id']);}return _0x2d50ca['CmHopper']['create']({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f[_0xc330('0x28')],'priority':_0x10de7f[_0xc330('0x29')]?_0x10de7f[_0xc330('0x29')]:0x2,'scheduledat':_0x10de7f[_0xc330('0x1c')]?_0x10de7f[_0xc330('0x1c')]:moment()[_0xc330('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x10de7f['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x10de7f[_0xc330('0x2a')]?_0x10de7f['callbackUniqueid']:undefined,'callbackat':_0x10de7f[_0xc330('0x2a')]?moment()[_0xc330('0x1d')](_0xc330('0x1e')):undefined,'CampaignId':_0x1239e4['id']});})['catch'](function(_0x444d60){_0x3c59a(_0x444d60);});});});};if(_0x10de7f[_0xc330('0x28')]){_0x2d50ca[_0xc330('0x1f')][_0xc330('0x37')]({'where':{'type':'outbound'},'attributes':['id',_0xc330('0x38'),_0xc330('0x32')],'include':[{'model':_0x2d50ca['CmList'],'as':_0xc330('0x39'),'where':{'id':_0x10de7f[_0xc330('0x28')]}}]})[_0xc330('0x20')](function(_0x2e4611){if(_0x2e4611){var _0x41520c=[];for(var _0x539d36=0x0,_0x4c1dcf;_0x539d36<_0x2e4611['length'];_0x539d36+=0x1){_0x4c1dcf=_0x2e4611[_0x539d36][_0xc330('0x18')]({'plain':!![]});switch(_0x4c1dcf[_0xc330('0x38')]){case _0xc330('0x3a'):_0x35622e(_0x4c1dcf)['catch'](_0x2a72b4());break;case _0xc330('0x3b'):_0x599948(_0x4c1dcf)[_0xc330('0x2b')](_0x2a72b4());break;default:_0x14b7e2(_0x4c1dcf,_0x10de7f)['then'](function(_0x10b375){_0x10de7f[_0xc330('0x1c')]=_0x10b375['ret'];_0x2d50ca['CmHopper'][_0xc330('0x27')]({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f['ListId'],'scheduledat':_0x10de7f['scheduledat']?_0x10de7f[_0xc330('0x1c')]:moment()[_0xc330('0x1d')](_0xc330('0x1e')),'priority':_0x10de7f['priority']?_0x10de7f[_0xc330('0x29')]:0x2,'callback':_0x10de7f[_0xc330('0x2a')]?!![]:![],'callbackuniqueid':_0x10de7f[_0xc330('0x2a')]?_0x10de7f['callbackUniqueid']:undefined,'callbackat':_0x10de7f[_0xc330('0x2a')]?moment()[_0xc330('0x1d')](_0xc330('0x1e')):undefined,'VoiceQueueId':_0x4c1dcf['id']})['catch'](_0x2a72b4());});}}}})[_0xc330('0x20')](function(){return _0x2d50ca[_0xc330('0x1f')][_0xc330('0x37')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0x2d50ca[_0xc330('0x3c')],'as':'BlackLists','where':{'id':_0x10de7f['ListId']}}]})[_0xc330('0x20')](function(_0x14bd1f){if(_0x14bd1f){var _0x36046c=[];for(var _0x4ec880=0x0,_0x346981;_0x4ec880<_0x14bd1f['length'];_0x4ec880+=0x1){_0x346981=_0x14bd1f[_0x4ec880]['get']({'plain':!![]});_0x2d50ca[_0xc330('0x3d')][_0xc330('0x27')]({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f[_0xc330('0x28')],'VoiceQueueId':_0x346981['id']})[_0xc330('0x2b')](function(_0xdb59b2){logger[_0xc330('0x19')](_0xc330('0x3e'),_0xc330('0x1b'),_0xdb59b2[_0xc330('0x3f')]);});}}});})[_0xc330('0x20')](function(){return _0x2d50ca[_0xc330('0x33')]['findAll']({'attributes':['id',_0xc330('0x38'),'dialTimezone'],'include':[{'model':_0x2d50ca[_0xc330('0x3c')],'as':_0xc330('0x39'),'where':{'id':_0x10de7f[_0xc330('0x28')]}}]})[_0xc330('0x20')](function(_0x4e1c01){if(_0x4e1c01){var _0xee1058=[];for(var _0x5dfdca=0x0,_0x576591;_0x5dfdca<_0x4e1c01[_0xc330('0x40')];_0x5dfdca+=0x1){_0x576591=_0x4e1c01[_0x5dfdca][_0xc330('0x18')]({'plain':!![]});switch(_0x576591[_0xc330('0x38')]){case _0xc330('0x3a'):_0x295472(_0x576591)[_0xc330('0x2b')](_0x244137());break;case'onlyIfOpen':_0x33b637(_0x576591)[_0xc330('0x2b')](_0x244137());break;default:_0x2d50ca[_0xc330('0x25')][_0xc330('0x27')]({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f['ListId'],'scheduledat':_0x10de7f[_0xc330('0x1c')]?_0x10de7f[_0xc330('0x1c')]:moment()[_0xc330('0x1d')](_0xc330('0x1e')),'priority':_0x10de7f[_0xc330('0x29')]?_0x10de7f[_0xc330('0x29')]:0x2,'callback':_0x10de7f[_0xc330('0x2a')]?!![]:![],'callbackuniqueid':_0x10de7f[_0xc330('0x2a')]?_0x10de7f[_0xc330('0x2a')]:undefined,'callbackat':_0x10de7f['callbackUniqueid']?moment()[_0xc330('0x1d')](_0xc330('0x1e')):undefined,'CampaignId':_0x576591['id']})[_0xc330('0x2b')](_0x244137());}}}});})['then'](function(){return _0x2d50ca[_0xc330('0x33')][_0xc330('0x37')]({'attributes':['id'],'include':[{'model':_0x2d50ca[_0xc330('0x3c')],'as':'BlackLists','where':{'id':_0x10de7f[_0xc330('0x28')]}}]})['then'](function(_0x512eb1){if(_0x512eb1){var _0x4a1556=[];for(var _0xba0cbc=0x0,_0x420608;_0xba0cbc<_0x512eb1[_0xc330('0x40')];_0xba0cbc+=0x1){_0x420608=_0x512eb1[_0xba0cbc][_0xc330('0x18')]({'plain':!![]});_0x2d50ca[_0xc330('0x3d')][_0xc330('0x27')]({'phone':_0x10de7f[_0xc330('0xe')],'ContactId':_0x10de7f['id'],'ListId':_0x10de7f['ListId'],'CampaignId':_0x420608['id']})[_0xc330('0x2b')](function(_0x2fd5da){logger[_0xc330('0x19')]('cmContact,\x20%s,\x20%s',_0xc330('0x1b'),_0x2fd5da[_0xc330('0x3f')]);});}}});})[_0xc330('0x20')](function(){_0x3a91a1();})[_0xc330('0x2b')](function(_0x3a6ba7){logger[_0xc330('0x19')](_0xc330('0x3e'),_0xc330('0x1b'),_0x3a6ba7[_0xc330('0x3f')]);_0x3a91a1(_0x3a6ba7);});}else{_0x3a91a1(new Error(_0xc330('0x41')));}},'afterDestroy':function(_0x523fdb,_0x277611,_0x4dee4b){var _0x1dbf96=_0xcaaa40[_0xc330('0x17')];var _0x2425e2=_0x523fdb[_0xc330('0x18')]({'plain':!![]});return _0x1dbf96[_0xc330('0x25')]['findAll']({'raw':!![],'where':{'ListId':_0x2425e2['ListId'],'ContactId':_0x2425e2['id']}})[_0xc330('0x20')](function(_0x1e9d77){if(!_[_0xc330('0x42')](_0x1e9d77)){var _0x2d23cc=[];for(var _0x2113a1=0x0;_0x2113a1<_0x1e9d77[_0xc330('0x40')];_0x2113a1+=0x1){var _0x4fc3e5=_0x1dbf96[_0xc330('0x25')][_0xc330('0x43')]({'where':{'ListId':_0x1e9d77[_0x2113a1][_0xc330('0x28')],'ContactId':_0x1e9d77[_0x2113a1]['ContactId'],'VoiceQueueId':_0x1e9d77[_0x2113a1]['VoiceQueueId'],'CampaignId':_0x1e9d77[_0x2113a1][_0xc330('0x44')]}});_0x2d23cc[_0xc330('0x45')](_0x4fc3e5);}return BPromise['all'](_0x2d23cc);}})[_0xc330('0x20')](function(_0x1dbdb1){logger[_0xc330('0x46')](_0xc330('0x47'),util[_0xc330('0x31')](_0x1dbdb1,{'showHidden':![],'depth':null}));_0x4dee4b();})[_0xc330('0x2b')](function(_0x34bbf0){logger[_0xc330('0x19')](_0xc330('0x48'),util[_0xc330('0x31')](_0x34bbf0,{'showHidden':![],'depth':null}));_0x4dee4b(_0x34bbf0);});}}});}; \ No newline at end of file +var _0x64d1=['utcOffset','format','ret','findOne','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','priority','callbackUniqueid','catch','CmHopper','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','ListId','afterCreate','Campaign','add','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','create','findAll','outbound','dialCheckDuplicateType','CmList','always','onlyIfOpen','BlackLists','length','CmHopperBlack','cmContact,\x20%s,\x20%s','message','Lists','List\x20not\x20found','isEmpty','destroy','ContactId','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Succesfull]','[CmContact][afterDestroy][Error]','util','api','bluebird','path','rimraf','../../config/environment/shared','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','fax','email','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','inspect','scheduledat','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','then','timezones'];(function(_0x3b6a06,_0x5bae73){var _0x56dbba=function(_0x463ab6){while(--_0x463ab6){_0x3b6a06['push'](_0x3b6a06['shift']());}};_0x56dbba(++_0x5bae73);}(_0x64d1,0x153));var _0x164d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x64d1[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require(_0x164d('0x0'));var logger=require('../../config/logger')(_0x164d('0x1'));var moment=require('moment');var BPromise=require(_0x164d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x164d('0x3'));var rimraf=require(_0x164d('0x4'));var config=require('../../config/environment');var shared=require(_0x164d('0x5'));var attributes=require(_0x164d('0x6'));module[_0x164d('0x7')]=function(_0x18e2b4,_0xd98574){return _0x18e2b4['define'](_0x164d('0x8'),attributes,{'tableName':_0x164d('0x9'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0x164d('0xa')]},{'name':_0x164d('0xb'),'fields':[_0x164d('0xc'),_0x164d('0xd'),_0x164d('0xa'),_0x164d('0xe'),_0x164d('0xf'),_0x164d('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0x164d('0x11'),'collate':_0x164d('0x12'),'hooks':{'afterCreate':function(_0x3e1ac0,_0x3cce1d,_0x33a144){var _0xf6a1f6=_0x18e2b4[_0x164d('0x13')];var _0x23d7bb=_0x3e1ac0[_0x164d('0x14')]({'plain':!![]});function _0xf11426(){return function(_0x4e35fe){logger[_0x164d('0x15')](_0x164d('0x16'),'afterCreate',util[_0x164d('0x17')](_0x4e35fe,{'showHidden':![],'depth':null}));};}function _0x344835(_0x1f05f,_0x4c983a){var _0x4c974a=_0x4c983a[_0x164d('0x18')]?_0x4c983a[_0x164d('0x18')]:moment()['format'](_0x164d('0x19'));return new BPromise(function(_0x45a92a,_0x596f54){if(_[_0x164d('0x1a')](_0x4c983a[_0x164d('0x1b')])){_0x45a92a({'ret':_0x4c974a});}else{_0xf6a1f6[_0x164d('0x1c')]['findOne']({'where':{'id':_0x1f05f['id']}})[_0x164d('0x1d')](function(_0x2402c7){if(!_[_0x164d('0x1a')](_0x2402c7)){var _0x7848bf=_0x2402c7[_0x164d('0x1b')];if(!_[_0x164d('0x1a')](_0x7848bf)){var _0x9cb9d2=shared[_0x164d('0x1e')];var _0x171825=_0x9cb9d2[_0x7848bf];var _0x3eb6a3=_0x9cb9d2[_0x4c983a[_0x164d('0x1b')]];if(!_[_0x164d('0x1a')](_0x171825)&&!_[_0x164d('0x1a')](_0x3eb6a3)){var _0x5f3ab6=_0x171825[_0x164d('0x1f')]-_0x3eb6a3['utcOffset'];_0x4c974a=_0x4c983a['scheduledat']?_0x4c983a['scheduledat']:moment();var _0x5d9fc6=moment(_0x4c974a)['add'](_0x5f3ab6,'minutes');_0x45a92a({'ret':_0x5d9fc6[_0x164d('0x20')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x45a92a({'ret':_0x4c974a});}else _0x45a92a({'ret':_0x4c974a});}else{_0x45a92a({'ret':_0x4c974a});}});}});return 0xa;}var _0x30fac7=function(_0x3702df){return new BPromise(function(_0x3b0c7d,_0x158b5f){_0x344835(_0x3702df,_0x23d7bb)['then'](function(_0x3602e2){_0x23d7bb[_0x164d('0x18')]=_0x3602e2[_0x164d('0x21')];_0xf6a1f6['CmHopper'][_0x164d('0x22')]({'where':{'phone':_0x23d7bb[_0x164d('0xa')],'VoiceQueueId':_0x3702df['id']}})[_0x164d('0x1d')](function(_0x407c62){if(!_[_0x164d('0x1a')](_0x407c62)){throw new Error(_0x164d('0x23')+_0x23d7bb['phone']+_0x164d('0x24')+_0x3702df['id']);}return _0xf6a1f6['CmHopper']['create']({'phone':_0x23d7bb[_0x164d('0xa')],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb['ListId'],'priority':_0x23d7bb[_0x164d('0x25')]?_0x23d7bb[_0x164d('0x25')]:0x2,'scheduledat':_0x23d7bb[_0x164d('0x18')]?_0x23d7bb['scheduledat']:moment()[_0x164d('0x20')](_0x164d('0x19')),'callback':_0x23d7bb[_0x164d('0x26')]?!![]:![],'callbackuniqueid':_0x23d7bb[_0x164d('0x26')]?_0x23d7bb['callbackUniqueid']:undefined,'callbackat':_0x23d7bb[_0x164d('0x26')]?moment()[_0x164d('0x20')](_0x164d('0x19')):undefined,'VoiceQueueId':_0x3702df['id']});})[_0x164d('0x27')](function(_0x35fb16){_0x158b5f(_0x35fb16);});});});};var _0x2b1009=function(_0x5f5be2){return new BPromise(function(_0xbf25e5,_0x5eba6d){_0x344835(_0x5f5be2,_0x23d7bb)['then'](function(_0x57cdaf){_0x23d7bb[_0x164d('0x18')]=_0x57cdaf[_0x164d('0x21')];_0xf6a1f6[_0x164d('0x28')][_0x164d('0x22')]({'where':{'phone':_0x23d7bb[_0x164d('0xa')],'VoiceQueueId':_0x5f5be2['id']}})['then'](function(_0x2c273d){if(!_[_0x164d('0x1a')](_0x2c273d)){throw new Error(_0x164d('0x23')+_0x23d7bb[_0x164d('0xa')]+_0x164d('0x29')+_0x5f5be2['id']);}return _0xf6a1f6['CmHopperFinal']['findOne']({'where':{'calleridnum':_0x23d7bb[_0x164d('0xa')],'VoiceQueueId':_0x5f5be2['id']}});})['then'](function(_0x32ceff){if(!_[_0x164d('0x1a')](_0x32ceff)){throw new Error(_0x164d('0x2a')+_0x23d7bb[_0x164d('0xa')]+_0x164d('0x2b')+_0x5f5be2['id']);}return _0xf6a1f6[_0x164d('0x28')]['create']({'phone':_0x23d7bb[_0x164d('0xa')],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb[_0x164d('0x2c')],'priority':_0x23d7bb[_0x164d('0x25')]?_0x23d7bb[_0x164d('0x25')]:0x2,'scheduledat':_0x23d7bb['scheduledat']?_0x23d7bb[_0x164d('0x18')]:moment()['format'](_0x164d('0x19')),'callback':_0x23d7bb[_0x164d('0x26')]?!![]:![],'callbackuniqueid':_0x23d7bb[_0x164d('0x26')]?_0x23d7bb[_0x164d('0x26')]:undefined,'callbackat':_0x23d7bb[_0x164d('0x26')]?moment()[_0x164d('0x20')](_0x164d('0x19')):undefined,'VoiceQueueId':_0x5f5be2['id']});})[_0x164d('0x27')](function(_0x2481be){_0x5eba6d(_0x2481be);});});});};function _0x25be8a(){return function(_0x2293cf){logger[_0x164d('0x15')]('cmContact',_0x164d('0x2d'),util[_0x164d('0x17')](_0x2293cf,{'showHidden':![],'depth':null}));};}function _0x528338(_0x12fbae,_0x52af53){var _0x475d29=_0x52af53['scheduledat']?_0x52af53[_0x164d('0x18')]:moment()['format'](_0x164d('0x19'));return new BPromise(function(_0x32ce56,_0x35ab02){if(_[_0x164d('0x1a')](_0x52af53[_0x164d('0x1b')])){_0x32ce56({'ret':_0x475d29});}else{_0xf6a1f6[_0x164d('0x2e')]['findOne']({'where':{'id':_0x12fbae['id']}})[_0x164d('0x1d')](function(_0x10be68){if(!_[_0x164d('0x1a')](_0x10be68)){var _0x180664=_0x10be68['dialTimezone'];if(!_[_0x164d('0x1a')](_0x180664)){var _0x599388=shared[_0x164d('0x1e')];var _0x4c7e21=_0x599388[_0x180664];var _0x4180b4=_0x599388[_0x52af53[_0x164d('0x1b')]];if(!_[_0x164d('0x1a')](_0x4c7e21)&&!_[_0x164d('0x1a')](_0x4180b4)){var _0x2fa9df=_0x4c7e21[_0x164d('0x1f')]-_0x4180b4[_0x164d('0x1f')];_0x475d29=_0x52af53[_0x164d('0x18')]?_0x52af53[_0x164d('0x18')]:moment();var _0x568502=moment(_0x475d29)[_0x164d('0x2f')](_0x2fa9df,_0x164d('0x30'));_0x32ce56({'ret':_0x568502['format'](_0x164d('0x19'))});}else _0x32ce56({'ret':_0x475d29});}else _0x32ce56({'ret':_0x475d29});}else{_0x32ce56({'ret':_0x475d29});}});}});return 0xa;}var _0x34b7b2=function(_0x13c6ca){return new BPromise(function(_0x42c62d,_0x221ced){_0x528338(_0x13c6ca,_0x23d7bb)['then'](function(_0x3df70b){_0x23d7bb['scheduledat']=_0x3df70b[_0x164d('0x21')];_0xf6a1f6[_0x164d('0x28')]['findOne']({'where':{'phone':_0x23d7bb[_0x164d('0xa')],'CampaignId':_0x13c6ca['id']}})[_0x164d('0x1d')](function(_0x5f7e2c){if(!_['isNil'](_0x5f7e2c)){throw new Error('cmContact,\x20afterCreate\x20'+_0x23d7bb['phone']+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20'+_0x13c6ca['id']);}return _0xf6a1f6['CmHopper']['create']({'phone':_0x23d7bb[_0x164d('0xa')],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb[_0x164d('0x2c')],'priority':_0x23d7bb[_0x164d('0x25')]?_0x23d7bb[_0x164d('0x25')]:0x2,'scheduledat':_0x23d7bb[_0x164d('0x18')]?_0x23d7bb[_0x164d('0x18')]:moment()[_0x164d('0x20')](_0x164d('0x19')),'callback':_0x23d7bb[_0x164d('0x26')]?!![]:![],'callbackuniqueid':_0x23d7bb['callbackUniqueid']?_0x23d7bb[_0x164d('0x26')]:undefined,'callbackat':_0x23d7bb[_0x164d('0x26')]?moment()[_0x164d('0x20')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x13c6ca['id']});})[_0x164d('0x27')](function(_0x129fdf){_0x221ced(_0x129fdf);});});});};var _0x155a8c=function(_0x19b3c3){return new BPromise(function(_0x34e569,_0x36156c){_0x528338(_0x19b3c3,_0x23d7bb)['then'](function(_0x3b4bbe){_0x23d7bb[_0x164d('0x18')]=_0x3b4bbe[_0x164d('0x21')];_0xf6a1f6[_0x164d('0x28')][_0x164d('0x22')]({'where':{'phone':_0x23d7bb[_0x164d('0xa')],'CampaignId':_0x19b3c3['id']}})[_0x164d('0x1d')](function(_0x3b133a){if(!_['isNil'](_0x3b133a)){throw new Error('cmContact,\x20afterCreate\x20'+_0x23d7bb[_0x164d('0xa')]+_0x164d('0x31')+_0x19b3c3['id']);}return _0xf6a1f6['CmHopperFinal'][_0x164d('0x22')]({'where':{'calleridnum':_0x23d7bb[_0x164d('0xa')],'CampaignId':_0x19b3c3['id']}});})[_0x164d('0x1d')](function(_0x199039){if(!_['isNil'](_0x199039)){throw new Error(_0x164d('0x2a')+_0x23d7bb[_0x164d('0xa')]+_0x164d('0x32')+_0x19b3c3['id']);}return _0xf6a1f6[_0x164d('0x28')][_0x164d('0x33')]({'phone':_0x23d7bb[_0x164d('0xa')],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb[_0x164d('0x2c')],'priority':_0x23d7bb['priority']?_0x23d7bb[_0x164d('0x25')]:0x2,'scheduledat':_0x23d7bb[_0x164d('0x18')]?_0x23d7bb['scheduledat']:moment()[_0x164d('0x20')](_0x164d('0x19')),'callback':_0x23d7bb['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x23d7bb[_0x164d('0x26')]?_0x23d7bb[_0x164d('0x26')]:undefined,'callbackat':_0x23d7bb[_0x164d('0x26')]?moment()[_0x164d('0x20')](_0x164d('0x19')):undefined,'CampaignId':_0x19b3c3['id']});})['catch'](function(_0x5a8b4d){_0x36156c(_0x5a8b4d);});});});};if(_0x23d7bb['ListId']){_0xf6a1f6['VoiceQueue'][_0x164d('0x34')]({'where':{'type':_0x164d('0x35')},'attributes':['id',_0x164d('0x36'),_0x164d('0x1b')],'include':[{'model':_0xf6a1f6[_0x164d('0x37')],'as':'Lists','where':{'id':_0x23d7bb[_0x164d('0x2c')]}}]})[_0x164d('0x1d')](function(_0x1bf962){if(_0x1bf962){var _0x493b3f=[];for(var _0x4c3adb=0x0,_0x4f9ae4;_0x4c3adb<_0x1bf962['length'];_0x4c3adb+=0x1){_0x4f9ae4=_0x1bf962[_0x4c3adb][_0x164d('0x14')]({'plain':!![]});switch(_0x4f9ae4[_0x164d('0x36')]){case _0x164d('0x38'):_0x2b1009(_0x4f9ae4)[_0x164d('0x27')](_0xf11426());break;case _0x164d('0x39'):_0x30fac7(_0x4f9ae4)['catch'](_0xf11426());break;default:_0x528338(_0x4f9ae4,_0x23d7bb)[_0x164d('0x1d')](function(_0x23d8fd){_0x23d7bb[_0x164d('0x18')]=_0x23d8fd['ret'];_0xf6a1f6['CmHopper']['create']({'phone':_0x23d7bb[_0x164d('0xa')],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb['ListId'],'scheduledat':_0x23d7bb['scheduledat']?_0x23d7bb[_0x164d('0x18')]:moment()[_0x164d('0x20')](_0x164d('0x19')),'priority':_0x23d7bb[_0x164d('0x25')]?_0x23d7bb[_0x164d('0x25')]:0x2,'callback':_0x23d7bb[_0x164d('0x26')]?!![]:![],'callbackuniqueid':_0x23d7bb['callbackUniqueid']?_0x23d7bb[_0x164d('0x26')]:undefined,'callbackat':_0x23d7bb[_0x164d('0x26')]?moment()[_0x164d('0x20')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x4f9ae4['id']})[_0x164d('0x27')](_0xf11426());});}}}})[_0x164d('0x1d')](function(){return _0xf6a1f6['VoiceQueue'][_0x164d('0x34')]({'where':{'type':_0x164d('0x35')},'attributes':['id'],'include':[{'model':_0xf6a1f6[_0x164d('0x37')],'as':_0x164d('0x3a'),'where':{'id':_0x23d7bb['ListId']}}]})[_0x164d('0x1d')](function(_0x4eeeb5){if(_0x4eeeb5){var _0x3f7e1f=[];for(var _0x1ffe18=0x0,_0x26fc8e;_0x1ffe18<_0x4eeeb5[_0x164d('0x3b')];_0x1ffe18+=0x1){_0x26fc8e=_0x4eeeb5[_0x1ffe18][_0x164d('0x14')]({'plain':!![]});_0xf6a1f6[_0x164d('0x3c')][_0x164d('0x33')]({'phone':_0x23d7bb[_0x164d('0xa')],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb[_0x164d('0x2c')],'VoiceQueueId':_0x26fc8e['id']})[_0x164d('0x27')](function(_0x421d39){logger[_0x164d('0x15')](_0x164d('0x3d'),_0x164d('0x2d'),_0x421d39[_0x164d('0x3e')]);});}}});})[_0x164d('0x1d')](function(){return _0xf6a1f6['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType',_0x164d('0x1b')],'include':[{'model':_0xf6a1f6[_0x164d('0x37')],'as':_0x164d('0x3f'),'where':{'id':_0x23d7bb['ListId']}}]})[_0x164d('0x1d')](function(_0x55d0c5){if(_0x55d0c5){var _0x6d03c1=[];for(var _0x4657ad=0x0,_0x389f3c;_0x4657ad<_0x55d0c5[_0x164d('0x3b')];_0x4657ad+=0x1){_0x389f3c=_0x55d0c5[_0x4657ad][_0x164d('0x14')]({'plain':!![]});switch(_0x389f3c[_0x164d('0x36')]){case'always':_0x155a8c(_0x389f3c)['catch'](_0x25be8a());break;case'onlyIfOpen':_0x34b7b2(_0x389f3c)[_0x164d('0x27')](_0x25be8a());break;default:_0xf6a1f6[_0x164d('0x28')][_0x164d('0x33')]({'phone':_0x23d7bb[_0x164d('0xa')],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb['ListId'],'scheduledat':_0x23d7bb[_0x164d('0x18')]?_0x23d7bb[_0x164d('0x18')]:moment()[_0x164d('0x20')](_0x164d('0x19')),'priority':_0x23d7bb['priority']?_0x23d7bb[_0x164d('0x25')]:0x2,'callback':_0x23d7bb['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x23d7bb[_0x164d('0x26')]?_0x23d7bb['callbackUniqueid']:undefined,'callbackat':_0x23d7bb[_0x164d('0x26')]?moment()[_0x164d('0x20')](_0x164d('0x19')):undefined,'CampaignId':_0x389f3c['id']})[_0x164d('0x27')](_0x25be8a());}}}});})[_0x164d('0x1d')](function(){return _0xf6a1f6[_0x164d('0x2e')]['findAll']({'attributes':['id'],'include':[{'model':_0xf6a1f6['CmList'],'as':'BlackLists','where':{'id':_0x23d7bb[_0x164d('0x2c')]}}]})['then'](function(_0x1f7e6e){if(_0x1f7e6e){var _0x452bdd=[];for(var _0x1bb1af=0x0,_0x30faa9;_0x1bb1af<_0x1f7e6e[_0x164d('0x3b')];_0x1bb1af+=0x1){_0x30faa9=_0x1f7e6e[_0x1bb1af][_0x164d('0x14')]({'plain':!![]});_0xf6a1f6[_0x164d('0x3c')][_0x164d('0x33')]({'phone':_0x23d7bb['phone'],'ContactId':_0x23d7bb['id'],'ListId':_0x23d7bb[_0x164d('0x2c')],'CampaignId':_0x30faa9['id']})[_0x164d('0x27')](function(_0x4a3e7d){logger['error'](_0x164d('0x3d'),'afterCreate',_0x4a3e7d[_0x164d('0x3e')]);});}}});})['then'](function(){_0x33a144();})[_0x164d('0x27')](function(_0x5f1cc8){logger[_0x164d('0x15')](_0x164d('0x3d'),_0x164d('0x2d'),_0x5f1cc8[_0x164d('0x3e')]);_0x33a144(_0x5f1cc8);});}else{_0x33a144(new Error(_0x164d('0x40')));}},'afterDestroy':function(_0x1ad683,_0x4ff81e,_0x4810f3){var _0x1e863c=_0x18e2b4['models'];var _0x16e43a=_0x1ad683[_0x164d('0x14')]({'plain':!![]});return _0x1e863c[_0x164d('0x28')][_0x164d('0x34')]({'raw':!![],'where':{'ListId':_0x16e43a[_0x164d('0x2c')],'ContactId':_0x16e43a['id']}})[_0x164d('0x1d')](function(_0x277192){if(!_[_0x164d('0x41')](_0x277192)){var _0x8d7d92=[];for(var _0x3d1602=0x0;_0x3d1602<_0x277192[_0x164d('0x3b')];_0x3d1602+=0x1){var _0x29f0bb=_0x1e863c[_0x164d('0x28')][_0x164d('0x42')]({'where':{'ListId':_0x277192[_0x3d1602]['ListId'],'ContactId':_0x277192[_0x3d1602][_0x164d('0x43')],'VoiceQueueId':_0x277192[_0x3d1602][_0x164d('0x44')],'CampaignId':_0x277192[_0x3d1602]['CampaignId']}});_0x8d7d92[_0x164d('0x45')](_0x29f0bb);}return BPromise[_0x164d('0x46')](_0x8d7d92);}})[_0x164d('0x1d')](function(_0x1a91a8){logger[_0x164d('0x47')](_0x164d('0x48'),util[_0x164d('0x17')](_0x1a91a8,{'showHidden':![],'depth':null}));_0x4810f3();})[_0x164d('0x27')](function(_0x567420){logger[_0x164d('0x15')](_0x164d('0x49'),util[_0x164d('0x17')](_0x567420,{'showHidden':![],'depth':null}));_0x4810f3(_0x567420);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index ddbce54..dc901ed 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x46e447,_0x383ee1){var _0x5ad63b=function(_0x23b92d){while(--_0x23b92d){_0x46e447['push'](_0x46e447['shift']());}};_0x5ad63b(++_0x383ee1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xa9e0[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index 22025e2..ef78a91 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1f38=['exports','INTEGER','STRING','sequelize'];(function(_0x21c8a6,_0xb7fd51){var _0x104019=function(_0x235cd8){while(--_0x235cd8){_0x21c8a6['push'](_0x21c8a6['shift']());}};_0x104019(++_0xb7fd51);}(_0x1f38,0xd7));var _0x81f3=function(_0x4f7ca7,_0x5099e7){_0x4f7ca7=_0x4f7ca7-0x0;var _0x55f6b0=_0x1f38[_0x4f7ca7];return _0x55f6b0;};'use strict';var Sequelize=require(_0x81f3('0x0'));module[_0x81f3('0x1')]={'CmContactId':{'type':Sequelize[_0x81f3('0x2')],'primaryKey':!![]},'item':{'type':Sequelize[_0x81f3('0x3')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x81f3('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x81f3('0x3')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x81f3('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x81f3('0x3')],'defaultValue':null}}; \ No newline at end of file +var _0xb0b9=['STRING','INTEGER','PHONE','sequelize'];(function(_0x6d6e8f,_0x1db6d3){var _0x5cca22=function(_0x3791b6){while(--_0x3791b6){_0x6d6e8f['push'](_0x6d6e8f['shift']());}};_0x5cca22(++_0x1db6d3);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x51fa0b,_0x35878b){_0x51fa0b=_0x51fa0b-0x0;var _0x4a9ca4=_0xb0b9[_0x51fa0b];return _0x4a9ca4;};'use strict';var Sequelize=require(_0x9b0b('0x0'));module['exports']={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x9b0b('0x1')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x9b0b('0x1')],'defaultValue':_0x9b0b('0x3')},'OrderBy':{'type':Sequelize[_0x9b0b('0x2')],'defaultValue':null},'description':{'type':Sequelize[_0x9b0b('0x1')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index 393ee61..df649d0 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2714=['role','CmContactHasItems','UserProfileSection','find','userProfileId','error','update','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','save','then','get','UserProfileResource','stack','name','send','index','map','CmContactHasItem','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','filter','where','merge','options','include','rows','catch','show','params','includeAll','create','user'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x2714,0x155));var _0x4271=function(_0x389006,_0x1c0ff1){_0x389006=_0x389006-0x0;var _0x18282c=_0x2714[_0x389006];return _0x18282c;};'use strict';var emlformat=require(_0x4271('0x0'));var rimraf=require(_0x4271('0x1'));var zipdir=require(_0x4271('0x2'));var jsonpatch=require(_0x4271('0x3'));var rp=require(_0x4271('0x4'));var moment=require(_0x4271('0x5'));var BPromise=require(_0x4271('0x6'));var Mustache=require(_0x4271('0x7'));var util=require(_0x4271('0x8'));var path=require('path');var sox=require(_0x4271('0x9'));var csv=require(_0x4271('0xa'));var ejs=require(_0x4271('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4271('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4271('0xd'));var deskjs=require(_0x4271('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4271('0xf'));var authService=require(_0x4271('0x10'));var qs=require(_0x4271('0x11'));var as=require(_0x4271('0x12'));var hardwareService=require(_0x4271('0x13'));var logger=require(_0x4271('0x14'))(_0x4271('0x15'));var utils=require('../../config/utils');var config=require(_0x4271('0x16'));var licenseUtil=require(_0x4271('0x17'));var db=require(_0x4271('0x18'))['db'];function respondWithStatusCode(_0x35e3ad,_0x3d6535){_0x3d6535=_0x3d6535||0xcc;return function(_0x35147d){if(_0x35147d){return _0x35e3ad[_0x4271('0x19')](_0x3d6535);}return _0x35e3ad[_0x4271('0x1a')](_0x3d6535)[_0x4271('0x1b')]();};}function respondWithResult(_0x4e0358,_0x3de7d9){_0x3de7d9=_0x3de7d9||0xc8;return function(_0x45d95c){if(_0x45d95c){return _0x4e0358[_0x4271('0x1a')](_0x3de7d9)[_0x4271('0x1c')](_0x45d95c);}};}function respondWithFilteredResult(_0x5ec460,_0xaa4d8){return function(_0x2d375d){if(_0x2d375d){var _0x2c5acd=typeof _0xaa4d8[_0x4271('0x1d')]===_0x4271('0x1e')&&typeof _0xaa4d8['limit']==='undefined';var _0x1faec9=_0x2d375d[_0x4271('0x1f')];var _0x47449f=_0x2c5acd?0x0:_0xaa4d8[_0x4271('0x1d')];var _0x17177d=_0x2c5acd?_0x2d375d[_0x4271('0x1f')]:_0xaa4d8[_0x4271('0x1d')]+_0xaa4d8['limit'];var _0x56ecfc;if(_0x17177d>=_0x1faec9){_0x17177d=_0x1faec9;_0x56ecfc=0xc8;}else{_0x56ecfc=0xce;}_0x5ec460['status'](_0x56ecfc);return _0x5ec460[_0x4271('0x20')](_0x4271('0x21'),_0x47449f+'-'+_0x17177d+'/'+_0x1faec9)['json'](_0x2d375d);}return null;};}function patchUpdates(_0xf38cc3){return function(_0x1cfe2b){try{jsonpatch[_0x4271('0x22')](_0x1cfe2b,_0xf38cc3,!![]);}catch(_0x1b8aa2){return BPromise['reject'](_0x1b8aa2);}return _0x1cfe2b[_0x4271('0x23')]();};}function saveUpdates(_0x1ecf7a,_0x37d6ac){return function(_0x38f869){if(_0x38f869){return _0x38f869['update'](_0x1ecf7a)[_0x4271('0x24')](function(_0x195d10){return _0x195d10;});}return null;};}function removeEntity(_0x589a0a,_0x991f9){return function(_0x3af46c){if(_0x3af46c){return _0x3af46c['destroy']()['then'](function(){var _0x197706=_0x3af46c[_0x4271('0x25')]({'plain':!![]});var _0x4524e3='CmContactHasItems';return db[_0x4271('0x26')]['destroy']({'where':{'type':_0x4524e3,'resourceId':_0x197706['id']}})['then'](function(){return _0x3af46c;});})[_0x4271('0x24')](function(){_0x589a0a[_0x4271('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x196b78,_0x117b89){return function(_0x331bf8){if(!_0x331bf8){_0x196b78[_0x4271('0x19')](0x194);}return _0x331bf8;};}function handleError(_0xbd77b3,_0x237ab0){_0x237ab0=_0x237ab0||0x1f4;return function(_0x417bbb){logger['error'](_0x417bbb[_0x4271('0x27')]);if(_0x417bbb[_0x4271('0x28')]){delete _0x417bbb[_0x4271('0x28')];}_0xbd77b3[_0x4271('0x1a')](_0x237ab0)[_0x4271('0x29')](_0x417bbb);};}exports[_0x4271('0x2a')]=function(_0x582f18,_0x245a3c){var _0x435aec={},_0x2caad5={},_0x3ec7c8={'count':0x0,'rows':[]};var _0x2c395c=_[_0x4271('0x2b')](db[_0x4271('0x2c')][_0x4271('0x2d')],function(_0xdddcac){return{'name':_0xdddcac[_0x4271('0x2e')],'type':_0xdddcac[_0x4271('0x2f')][_0x4271('0x30')]};});_0x2caad5[_0x4271('0x31')]=_[_0x4271('0x2b')](_0x2c395c,_0x4271('0x28'));_0x2caad5['query']=_[_0x4271('0x32')](_0x582f18['query']);_0x2caad5[_0x4271('0x33')]=_[_0x4271('0x34')](_0x2caad5[_0x4271('0x31')],_0x2caad5[_0x4271('0x35')]);_0x435aec[_0x4271('0x36')]=_[_0x4271('0x34')](_0x2caad5['model'],qs[_0x4271('0x37')](_0x582f18[_0x4271('0x35')][_0x4271('0x37')]));_0x435aec[_0x4271('0x36')]=_0x435aec[_0x4271('0x36')][_0x4271('0x38')]?_0x435aec[_0x4271('0x36')]:_0x2caad5[_0x4271('0x31')];if(!_0x582f18[_0x4271('0x35')][_0x4271('0x39')](_0x4271('0x3a'))){_0x435aec['limit']=qs['limit'](_0x582f18[_0x4271('0x35')][_0x4271('0x3b')]);_0x435aec['offset']=qs[_0x4271('0x1d')](_0x582f18[_0x4271('0x35')][_0x4271('0x1d')]);}_0x435aec['order']=qs['sort'](_0x582f18['query'][_0x4271('0x3c')]);_0x435aec['where']=qs[_0x4271('0x33')](_[_0x4271('0x3d')](_0x582f18[_0x4271('0x35')],_0x2caad5[_0x4271('0x33')]),_0x2c395c);if(_0x582f18['query'][_0x4271('0x3e')]){_0x435aec[_0x4271('0x3f')]=_[_0x4271('0x40')](_0x435aec[_0x4271('0x3f')],{'$or':_['map'](_0x2c395c,function(_0x2c7bf5){if(_0x2c7bf5['type']!=='VIRTUAL'){var _0x16124e={};_0x16124e[_0x2c7bf5[_0x4271('0x28')]]={'$like':'%'+_0x582f18[_0x4271('0x35')][_0x4271('0x3e')]+'%'};return _0x16124e;}})});}_0x435aec=_['merge']({},_0x435aec,_0x582f18[_0x4271('0x41')]);var _0xe3bc82={'where':_0x435aec['where']};return db[_0x4271('0x2c')][_0x4271('0x1f')](_0xe3bc82)[_0x4271('0x24')](function(_0x3ad0da){_0x3ec7c8['count']=_0x3ad0da;if(_0x582f18[_0x4271('0x35')]['includeAll']){_0x435aec[_0x4271('0x42')]=[{'all':!![]}];}return db[_0x4271('0x2c')]['findAll'](_0x435aec);})['then'](function(_0x2a6246){_0x3ec7c8[_0x4271('0x43')]=_0x2a6246;return _0x3ec7c8;})['then'](respondWithFilteredResult(_0x245a3c,_0x435aec))[_0x4271('0x44')](handleError(_0x245a3c,null));};exports[_0x4271('0x45')]=function(_0x272f72,_0x107748){var _0x20f873={'raw':!![],'where':{'id':_0x272f72[_0x4271('0x46')]['id']}},_0x4d1d6a={};_0x4d1d6a[_0x4271('0x31')]=_[_0x4271('0x32')](db[_0x4271('0x2c')]['rawAttributes']);_0x4d1d6a[_0x4271('0x35')]=_['keys'](_0x272f72[_0x4271('0x35')]);_0x4d1d6a['filters']=_['intersection'](_0x4d1d6a['model'],_0x4d1d6a[_0x4271('0x35')]);_0x20f873[_0x4271('0x36')]=_[_0x4271('0x34')](_0x4d1d6a[_0x4271('0x31')],qs[_0x4271('0x37')](_0x272f72['query'][_0x4271('0x37')]));_0x20f873['attributes']=_0x20f873[_0x4271('0x36')][_0x4271('0x38')]?_0x20f873['attributes']:_0x4d1d6a['model'];if(_0x272f72[_0x4271('0x35')][_0x4271('0x47')]){_0x20f873[_0x4271('0x42')]=[{'all':!![]}];}_0x20f873=_[_0x4271('0x40')]({},_0x20f873,_0x272f72['options']);return db[_0x4271('0x2c')]['find'](_0x20f873)['then'](handleEntityNotFound(_0x107748,null))[_0x4271('0x24')](respondWithResult(_0x107748,null))['catch'](handleError(_0x107748,null));};exports[_0x4271('0x48')]=function(_0xb5133d,_0x316f78){return db[_0x4271('0x2c')]['create'](_0xb5133d['body'],{})[_0x4271('0x24')](function(_0x20262b){var _0x7fb37e=_0xb5133d[_0x4271('0x49')][_0x4271('0x25')]({'plain':!![]});if(!_0x7fb37e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7fb37e[_0x4271('0x4a')]===_0x4271('0x49')){var _0x11067a=_0x20262b[_0x4271('0x25')]({'plain':!![]});var _0x40ca11=_0x4271('0x4b');return db[_0x4271('0x4c')][_0x4271('0x4d')]({'where':{'name':_0x40ca11,'userProfileId':_0x7fb37e[_0x4271('0x4e')]},'raw':!![]})[_0x4271('0x24')](function(_0x71f0fa){if(_0x71f0fa&&_0x71f0fa['autoAssociation']===0x0){return db[_0x4271('0x26')][_0x4271('0x48')]({'name':_0x11067a['name'],'resourceId':_0x11067a['id'],'type':_0x71f0fa[_0x4271('0x28')],'sectionId':_0x71f0fa['id']},{})['then'](function(){return _0x20262b;});}else{return _0x20262b;}})[_0x4271('0x44')](function(_0x4ef60d){logger[_0x4271('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4ef60d);throw _0x4ef60d;});}return _0x20262b;})[_0x4271('0x24')](respondWithResult(_0x316f78,0xc9))[_0x4271('0x44')](handleError(_0x316f78,null));};exports[_0x4271('0x50')]=function(_0x409236,_0x1841ad){if(_0x409236[_0x4271('0x51')]['id']){delete _0x409236[_0x4271('0x51')]['id'];}return db[_0x4271('0x2c')][_0x4271('0x4d')]({'where':{'id':_0x409236['params']['id']}})[_0x4271('0x24')](handleEntityNotFound(_0x1841ad,null))[_0x4271('0x24')](saveUpdates(_0x409236[_0x4271('0x51')],null))[_0x4271('0x24')](respondWithResult(_0x1841ad,null))['catch'](handleError(_0x1841ad,null));};exports[_0x4271('0x52')]=function(_0x2ec8c2,_0x38cc3c){return db[_0x4271('0x2c')][_0x4271('0x4d')]({'where':{'id':_0x2ec8c2[_0x4271('0x46')]['id']}})[_0x4271('0x24')](handleEntityNotFound(_0x38cc3c,null))['then'](removeEntity(_0x38cc3c,null))[_0x4271('0x44')](handleError(_0x38cc3c,null));}; \ No newline at end of file +var _0x6c9d=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','merge','create','user','get','role','UserProfileSection','find','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','map','CmContactHasItem','rawAttributes','fieldName'];(function(_0x12cc7b,_0x240ec1){var _0xd07668=function(_0x48b3b4){while(--_0x48b3b4){_0x12cc7b['push'](_0x12cc7b['shift']());}};_0xd07668(++_0x240ec1);}(_0x6c9d,0x75));var _0xd6c9=function(_0x4a55e0,_0x160a3c){_0x4a55e0=_0x4a55e0-0x0;var _0x2d06ff=_0x6c9d[_0x4a55e0];return _0x2d06ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd6c9('0x0'));var zipdir=require(_0xd6c9('0x1'));var jsonpatch=require(_0xd6c9('0x2'));var rp=require('request-promise');var moment=require(_0xd6c9('0x3'));var BPromise=require(_0xd6c9('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd6c9('0x5'));var sox=require(_0xd6c9('0x6'));var csv=require(_0xd6c9('0x7'));var ejs=require(_0xd6c9('0x8'));var fs=require('fs');var fs_extra=require(_0xd6c9('0x9'));var _=require(_0xd6c9('0xa'));var squel=require('squel');var crypto=require(_0xd6c9('0xb'));var jsforce=require(_0xd6c9('0xc'));var deskjs=require(_0xd6c9('0xd'));var toCsv=require(_0xd6c9('0x7'));var querystring=require(_0xd6c9('0xe'));var Papa=require(_0xd6c9('0xf'));var Redis=require(_0xd6c9('0x10'));var authService=require(_0xd6c9('0x11'));var qs=require(_0xd6c9('0x12'));var as=require(_0xd6c9('0x13'));var hardwareService=require(_0xd6c9('0x14'));var logger=require(_0xd6c9('0x15'))('api');var utils=require(_0xd6c9('0x16'));var config=require(_0xd6c9('0x17'));var licenseUtil=require(_0xd6c9('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d6307,_0x2872de){_0x2872de=_0x2872de||0xcc;return function(_0x49f1e2){if(_0x49f1e2){return _0x2d6307[_0xd6c9('0x19')](_0x2872de);}return _0x2d6307[_0xd6c9('0x1a')](_0x2872de)[_0xd6c9('0x1b')]();};}function respondWithResult(_0x547cf3,_0x63b0dc){_0x63b0dc=_0x63b0dc||0xc8;return function(_0x3a4086){if(_0x3a4086){return _0x547cf3[_0xd6c9('0x1a')](_0x63b0dc)['json'](_0x3a4086);}};}function respondWithFilteredResult(_0x5b229e,_0x189227){return function(_0x5af60c){if(_0x5af60c){var _0x5a5486=typeof _0x189227[_0xd6c9('0x1c')]===_0xd6c9('0x1d')&&typeof _0x189227[_0xd6c9('0x1e')]===_0xd6c9('0x1d');var _0x16648d=_0x5af60c[_0xd6c9('0x1f')];var _0x4d6df9=_0x5a5486?0x0:_0x189227[_0xd6c9('0x1c')];var _0x308490=_0x5a5486?_0x5af60c[_0xd6c9('0x1f')]:_0x189227[_0xd6c9('0x1c')]+_0x189227[_0xd6c9('0x1e')];var _0x4c6db5;if(_0x308490>=_0x16648d){_0x308490=_0x16648d;_0x4c6db5=0xc8;}else{_0x4c6db5=0xce;}_0x5b229e['status'](_0x4c6db5);return _0x5b229e[_0xd6c9('0x20')](_0xd6c9('0x21'),_0x4d6df9+'-'+_0x308490+'/'+_0x16648d)[_0xd6c9('0x22')](_0x5af60c);}return null;};}function patchUpdates(_0x4c2594){return function(_0x1dd274){try{jsonpatch[_0xd6c9('0x23')](_0x1dd274,_0x4c2594,!![]);}catch(_0x5dce28){return BPromise[_0xd6c9('0x24')](_0x5dce28);}return _0x1dd274[_0xd6c9('0x25')]();};}function saveUpdates(_0x17a253,_0x2eb5f0){return function(_0x577c73){if(_0x577c73){return _0x577c73[_0xd6c9('0x26')](_0x17a253)[_0xd6c9('0x27')](function(_0xb46d70){return _0xb46d70;});}return null;};}function removeEntity(_0x214446,_0x4dd130){return function(_0x2a9dda){if(_0x2a9dda){return _0x2a9dda[_0xd6c9('0x28')]()[_0xd6c9('0x27')](function(){var _0x498e23=_0x2a9dda['get']({'plain':!![]});var _0x3ce4f6='CmContactHasItems';return db['UserProfileResource'][_0xd6c9('0x28')]({'where':{'type':_0x3ce4f6,'resourceId':_0x498e23['id']}})[_0xd6c9('0x27')](function(){return _0x2a9dda;});})[_0xd6c9('0x27')](function(){_0x214446[_0xd6c9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x497949,_0x293391){return function(_0x352bb6){if(!_0x352bb6){_0x497949[_0xd6c9('0x19')](0x194);}return _0x352bb6;};}function handleError(_0x2fdb80,_0x42545c){_0x42545c=_0x42545c||0x1f4;return function(_0x24f815){logger['error'](_0x24f815['stack']);if(_0x24f815[_0xd6c9('0x29')]){delete _0x24f815['name'];}_0x2fdb80[_0xd6c9('0x1a')](_0x42545c)[_0xd6c9('0x2a')](_0x24f815);};}exports['index']=function(_0x2cd22c,_0x4cde3a){var _0x23c8d3={},_0x57010b={},_0x2e73d3={'count':0x0,'rows':[]};var _0x25a678=_[_0xd6c9('0x2b')](db[_0xd6c9('0x2c')][_0xd6c9('0x2d')],function(_0x427579){return{'name':_0x427579[_0xd6c9('0x2e')],'type':_0x427579['type']['key']};});_0x57010b[_0xd6c9('0x2f')]=_[_0xd6c9('0x2b')](_0x25a678,_0xd6c9('0x29'));_0x57010b[_0xd6c9('0x30')]=_[_0xd6c9('0x31')](_0x2cd22c['query']);_0x57010b[_0xd6c9('0x32')]=_[_0xd6c9('0x33')](_0x57010b[_0xd6c9('0x2f')],_0x57010b[_0xd6c9('0x30')]);_0x23c8d3[_0xd6c9('0x34')]=_['intersection'](_0x57010b[_0xd6c9('0x2f')],qs[_0xd6c9('0x35')](_0x2cd22c[_0xd6c9('0x30')][_0xd6c9('0x35')]));_0x23c8d3[_0xd6c9('0x34')]=_0x23c8d3[_0xd6c9('0x34')][_0xd6c9('0x36')]?_0x23c8d3[_0xd6c9('0x34')]:_0x57010b[_0xd6c9('0x2f')];if(!_0x2cd22c['query'][_0xd6c9('0x37')]('nolimit')){_0x23c8d3[_0xd6c9('0x1e')]=qs[_0xd6c9('0x1e')](_0x2cd22c[_0xd6c9('0x30')][_0xd6c9('0x1e')]);_0x23c8d3[_0xd6c9('0x1c')]=qs[_0xd6c9('0x1c')](_0x2cd22c['query'][_0xd6c9('0x1c')]);}_0x23c8d3[_0xd6c9('0x38')]=qs[_0xd6c9('0x39')](_0x2cd22c[_0xd6c9('0x30')][_0xd6c9('0x39')]);_0x23c8d3[_0xd6c9('0x3a')]=qs['filters'](_[_0xd6c9('0x3b')](_0x2cd22c[_0xd6c9('0x30')],_0x57010b[_0xd6c9('0x32')]),_0x25a678);if(_0x2cd22c['query']['filter']){_0x23c8d3[_0xd6c9('0x3a')]=_['merge'](_0x23c8d3['where'],{'$or':_[_0xd6c9('0x2b')](_0x25a678,function(_0xbcfc24){if(_0xbcfc24[_0xd6c9('0x3c')]!==_0xd6c9('0x3d')){var _0x1808a9={};_0x1808a9[_0xbcfc24['name']]={'$like':'%'+_0x2cd22c['query'][_0xd6c9('0x3e')]+'%'};return _0x1808a9;}})});}_0x23c8d3=_['merge']({},_0x23c8d3,_0x2cd22c[_0xd6c9('0x3f')]);var _0x2d5a66={'where':_0x23c8d3[_0xd6c9('0x3a')]};return db[_0xd6c9('0x2c')][_0xd6c9('0x1f')](_0x2d5a66)[_0xd6c9('0x27')](function(_0x27d43a){_0x2e73d3['count']=_0x27d43a;if(_0x2cd22c[_0xd6c9('0x30')][_0xd6c9('0x40')]){_0x23c8d3[_0xd6c9('0x41')]=[{'all':!![]}];}return db[_0xd6c9('0x2c')][_0xd6c9('0x42')](_0x23c8d3);})[_0xd6c9('0x27')](function(_0x548cf8){_0x2e73d3[_0xd6c9('0x43')]=_0x548cf8;return _0x2e73d3;})[_0xd6c9('0x27')](respondWithFilteredResult(_0x4cde3a,_0x23c8d3))[_0xd6c9('0x44')](handleError(_0x4cde3a,null));};exports['show']=function(_0x284475,_0x3739fe){var _0x4ddd55={'raw':!![],'where':{'id':_0x284475[_0xd6c9('0x45')]['id']}},_0x1575cd={};_0x1575cd[_0xd6c9('0x2f')]=_[_0xd6c9('0x31')](db[_0xd6c9('0x2c')][_0xd6c9('0x2d')]);_0x1575cd['query']=_[_0xd6c9('0x31')](_0x284475[_0xd6c9('0x30')]);_0x1575cd['filters']=_[_0xd6c9('0x33')](_0x1575cd[_0xd6c9('0x2f')],_0x1575cd[_0xd6c9('0x30')]);_0x4ddd55[_0xd6c9('0x34')]=_['intersection'](_0x1575cd[_0xd6c9('0x2f')],qs[_0xd6c9('0x35')](_0x284475[_0xd6c9('0x30')][_0xd6c9('0x35')]));_0x4ddd55[_0xd6c9('0x34')]=_0x4ddd55[_0xd6c9('0x34')]['length']?_0x4ddd55['attributes']:_0x1575cd[_0xd6c9('0x2f')];if(_0x284475[_0xd6c9('0x30')][_0xd6c9('0x40')]){_0x4ddd55[_0xd6c9('0x41')]=[{'all':!![]}];}_0x4ddd55=_[_0xd6c9('0x46')]({},_0x4ddd55,_0x284475['options']);return db['CmContactHasItem']['find'](_0x4ddd55)[_0xd6c9('0x27')](handleEntityNotFound(_0x3739fe,null))[_0xd6c9('0x27')](respondWithResult(_0x3739fe,null))['catch'](handleError(_0x3739fe,null));};exports[_0xd6c9('0x47')]=function(_0x182c5d,_0x70614f){return db[_0xd6c9('0x2c')][_0xd6c9('0x47')](_0x182c5d['body'],{})['then'](function(_0x2ddfcc){var _0x553de4=_0x182c5d[_0xd6c9('0x48')][_0xd6c9('0x49')]({'plain':!![]});if(!_0x553de4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x553de4[_0xd6c9('0x4a')]==='user'){var _0x589963=_0x2ddfcc[_0xd6c9('0x49')]({'plain':!![]});var _0x2cfa29='CmContactHasItems';return db[_0xd6c9('0x4b')][_0xd6c9('0x4c')]({'where':{'name':_0x2cfa29,'userProfileId':_0x553de4['userProfileId']},'raw':!![]})[_0xd6c9('0x27')](function(_0x4eab42){if(_0x4eab42&&_0x4eab42[_0xd6c9('0x4d')]===0x0){return db[_0xd6c9('0x4e')][_0xd6c9('0x47')]({'name':_0x589963['name'],'resourceId':_0x589963['id'],'type':_0x4eab42['name'],'sectionId':_0x4eab42['id']},{})[_0xd6c9('0x27')](function(){return _0x2ddfcc;});}else{return _0x2ddfcc;}})[_0xd6c9('0x44')](function(_0x4e9dad){logger[_0xd6c9('0x4f')](_0xd6c9('0x50'),_0x4e9dad);throw _0x4e9dad;});}return _0x2ddfcc;})[_0xd6c9('0x27')](respondWithResult(_0x70614f,0xc9))[_0xd6c9('0x44')](handleError(_0x70614f,null));};exports[_0xd6c9('0x26')]=function(_0x2307c1,_0x3d068c){if(_0x2307c1['body']['id']){delete _0x2307c1[_0xd6c9('0x51')]['id'];}return db['CmContactHasItem'][_0xd6c9('0x4c')]({'where':{'id':_0x2307c1[_0xd6c9('0x45')]['id']}})[_0xd6c9('0x27')](handleEntityNotFound(_0x3d068c,null))[_0xd6c9('0x27')](saveUpdates(_0x2307c1[_0xd6c9('0x51')],null))['then'](respondWithResult(_0x3d068c,null))[_0xd6c9('0x44')](handleError(_0x3d068c,null));};exports['destroy']=function(_0x5a36fc,_0x332214){return db[_0xd6c9('0x2c')]['find']({'where':{'id':_0x5a36fc[_0xd6c9('0x45')]['id']}})[_0xd6c9('0x27')](handleEntityNotFound(_0x332214,null))[_0xd6c9('0x27')](removeEntity(_0x332214,null))['catch'](handleError(_0x332214,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 19f9af0..4118212 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x98a4=['cm_contact_has_items','lodash','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','CmContactHasItem'];(function(_0x285b48,_0x41b4c6){var _0x5020e9=function(_0x537f18){while(--_0x537f18){_0x285b48['push'](_0x285b48['shift']());}};_0x5020e9(++_0x41b4c6);}(_0x98a4,0xab));var _0x498a=function(_0x53d5c7,_0x4212b3){_0x53d5c7=_0x53d5c7-0x0;var _0x40cc26=_0x98a4[_0x53d5c7];return _0x40cc26;};'use strict';var _=require(_0x498a('0x0'));var util=require('util');var logger=require(_0x498a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x498a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x498a('0x3'));var rimraf=require(_0x498a('0x4'));var config=require(_0x498a('0x5'));var attributes=require('./cmContactHasItem.attributes');module[_0x498a('0x6')]=function(_0x1caddd,_0xd70f48){return _0x1caddd[_0x498a('0x7')](_0x498a('0x8'),attributes,{'tableName':_0x498a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11d3=['CmContactHasItem','cm_contact_has_items','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','define'];(function(_0x52e363,_0x48062a){var _0x3fc2b5=function(_0x1b0cf9){while(--_0x1b0cf9){_0x52e363['push'](_0x52e363['shift']());}};_0x3fc2b5(++_0x48062a);}(_0x11d3,0x1f0));var _0x311d=function(_0x39622b,_0x1241c2){_0x39622b=_0x39622b-0x0;var _0x2b6a97=_0x11d3[_0x39622b];return _0x2b6a97;};'use strict';var _=require(_0x311d('0x0'));var util=require(_0x311d('0x1'));var logger=require(_0x311d('0x2'))(_0x311d('0x3'));var moment=require(_0x311d('0x4'));var BPromise=require('bluebird');var rp=require(_0x311d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x311d('0x6'));var config=require(_0x311d('0x7'));var attributes=require(_0x311d('0x8'));module[_0x311d('0x9')]=function(_0x18afc1,_0x1a198d){return _0x18afc1[_0x311d('0xa')](_0x311d('0xb'),attributes,{'tableName':_0x311d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 245da26..885c1e0 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x25b0=['CmContactHasItem,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','code','error'];(function(_0xfbe44c,_0x5c83a7){var _0x75e5f6=function(_0xb86a09){while(--_0xb86a09){_0xfbe44c['push'](_0xfbe44c['shift']());}};_0x75e5f6(++_0x5c83a7);}(_0x25b0,0xac));var _0x025b=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0x25b0[_0x594ece];return _0x471bc4;};'use strict';var _=require(_0x025b('0x0'));var util=require('util');var moment=require(_0x025b('0x1'));var BPromise=require(_0x025b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x025b('0x3'));var db=require(_0x025b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x025b('0x5'));var config=require('../../config/environment');var jayson=require(_0x025b('0x6'));var client=jayson[_0x025b('0x7')][_0x025b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12f5fd,_0x5e7671,_0x268557){return new BPromise(function(_0x31345f,_0x5c2fba){return client[_0x025b('0x9')](_0x12f5fd,_0x268557)[_0x025b('0xa')](function(_0x6804f0){logger[_0x025b('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x5e7671,_0x025b('0xc'));logger[_0x025b('0xd')](_0x025b('0xe'),_0x5e7671,_0x025b('0xc'),JSON['stringify'](_0x6804f0));if(_0x6804f0['error']){if(_0x6804f0['error'][_0x025b('0xf')]===0x1f4){logger[_0x025b('0x10')](_0x025b('0x11'),_0x5e7671,_0x6804f0[_0x025b('0x10')][_0x025b('0x12')]);return _0x5c2fba(_0x6804f0[_0x025b('0x10')]['message']);}logger[_0x025b('0x10')](_0x025b('0x11'),_0x5e7671,_0x6804f0[_0x025b('0x10')][_0x025b('0x12')]);return _0x31345f(_0x6804f0['error'][_0x025b('0x12')]);}else{logger[_0x025b('0xb')](_0x025b('0x11'),_0x5e7671,_0x025b('0xc'));_0x31345f(_0x6804f0[_0x025b('0x13')][_0x025b('0x12')]);}})[_0x025b('0x14')](function(_0x6a7ad9){logger[_0x025b('0x10')](_0x025b('0x11'),_0x5e7671,_0x6a7ad9);_0x5c2fba(_0x6a7ad9);});});} \ No newline at end of file +var _0x759e=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','CmContactHasItem,\x20%s,\x20%s','message','info','result'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x759e,0x1e1));var _0xe759=function(_0x53b14b,_0x35fbf7){_0x53b14b=_0x53b14b-0x0;var _0x43e84e=_0x759e[_0x53b14b];return _0x43e84e;};'use strict';var _=require(_0xe759('0x0'));var util=require(_0xe759('0x1'));var moment=require(_0xe759('0x2'));var BPromise=require('bluebird');var rs=require(_0xe759('0x3'));var fs=require('fs');var Redis=require(_0xe759('0x4'));var db=require(_0xe759('0x5'))['db'];var utils=require(_0xe759('0x6'));var logger=require(_0xe759('0x7'))(_0xe759('0x8'));var config=require(_0xe759('0x9'));var jayson=require(_0xe759('0xa'));var client=jayson[_0xe759('0xb')][_0xe759('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f1f27,_0x4591f2,_0x3d7f93){return new BPromise(function(_0x594141,_0x238151){return client[_0xe759('0xd')](_0x3f1f27,_0x3d7f93)[_0xe759('0xe')](function(_0x524944){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x4591f2,'request\x20sent');logger[_0xe759('0xf')]('CmContactHasItem,\x20%s,\x20%s,\x20%s',_0x4591f2,_0xe759('0x10'),JSON['stringify'](_0x524944));if(_0x524944[_0xe759('0x11')]){if(_0x524944[_0xe759('0x11')][_0xe759('0x12')]===0x1f4){logger[_0xe759('0x11')](_0xe759('0x13'),_0x4591f2,_0x524944[_0xe759('0x11')]['message']);return _0x238151(_0x524944['error'][_0xe759('0x14')]);}logger['error'](_0xe759('0x13'),_0x4591f2,_0x524944['error'][_0xe759('0x14')]);return _0x594141(_0x524944['error'][_0xe759('0x14')]);}else{logger[_0xe759('0x15')](_0xe759('0x13'),_0x4591f2,_0xe759('0x10'));_0x594141(_0x524944[_0xe759('0x16')]['message']);}})[_0xe759('0x17')](function(_0x459125){logger[_0xe759('0x11')](_0xe759('0x13'),_0x4591f2,_0x459125);_0x238151(_0x459125);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index e1d804d..b3c1a20 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9ddf=['/:id','post','create','put','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','index'];(function(_0x4de4ca,_0x17abc5){var _0x77f8ec=function(_0x570668){while(--_0x570668){_0x4de4ca['push'](_0x4de4ca['shift']());}};_0x77f8ec(++_0x17abc5);}(_0x9ddf,0x1b7));var _0xf9dd=function(_0x4f0f3f,_0x57f1a9){_0x4f0f3f=_0x4f0f3f-0x0;var _0x1131cd=_0x9ddf[_0x4f0f3f];return _0x1131cd;};'use strict';var multer=require('multer');var util=require(_0xf9dd('0x0'));var path=require(_0xf9dd('0x1'));var timeout=require('connect-timeout');var express=require(_0xf9dd('0x2'));var router=express[_0xf9dd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xf9dd('0x4'));var interaction=require(_0xf9dd('0x5'));var config=require(_0xf9dd('0x6'));var controller=require(_0xf9dd('0x7'));router[_0xf9dd('0x8')]('/',auth[_0xf9dd('0x9')](),controller[_0xf9dd('0xa')]);router['get'](_0xf9dd('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf9dd('0xc')]('/',auth['isAuthenticated'](),controller[_0xf9dd('0xd')]);router[_0xf9dd('0xe')](_0xf9dd('0xb'),auth[_0xf9dd('0x9')](),controller['update']);router[_0xf9dd('0xf')]('/:id',auth[_0xf9dd('0x9')](),controller[_0xf9dd('0x10')]);module[_0xf9dd('0x11')]=router; \ No newline at end of file +var _0xc99f=['get','isAuthenticated','index','/:id','show','put','update','destroy','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x7d2691,_0x4f4058){var _0x2ae662=function(_0x4d4075){while(--_0x4d4075){_0x7d2691['push'](_0x7d2691['shift']());}};_0x2ae662(++_0x4f4058);}(_0xc99f,0x19c));var _0xfc99=function(_0x274d4b,_0x128681){_0x274d4b=_0x274d4b-0x0;var _0x1a1f03=_0xc99f[_0x274d4b];return _0x1a1f03;};'use strict';var multer=require('multer');var util=require(_0xfc99('0x0'));var path=require('path');var timeout=require(_0xfc99('0x1'));var express=require('express');var router=express[_0xfc99('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xfc99('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmContactHasItem.controller');router[_0xfc99('0x4')]('/',auth[_0xfc99('0x5')](),controller[_0xfc99('0x6')]);router[_0xfc99('0x4')](_0xfc99('0x7'),auth[_0xfc99('0x5')](),controller[_0xfc99('0x8')]);router['post']('/',auth[_0xfc99('0x5')](),controller['create']);router[_0xfc99('0x9')](_0xfc99('0x7'),auth[_0xfc99('0x5')](),controller[_0xfc99('0xa')]);router['delete']('/:id',auth[_0xfc99('0x5')](),controller[_0xfc99('0xb')]);module[_0xfc99('0xc')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 99e664e..82f63e0 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 _0xa579=['values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','VIRTUAL','alias','STRING','setDataValue','name','TEXT','long','getDataValue','type','select','parse'];(function(_0x298dac,_0x324516){var _0x5a2ff5=function(_0x563a44){while(--_0x563a44){_0x298dac['push'](_0x298dac['shift']());}};_0x5a2ff5(++_0x324516);}(_0xa579,0x1be));var _0x9a57=function(_0x51ed2a,_0x187504){_0x51ed2a=_0x51ed2a-0x0;var _0x5b2022=_0xa579[_0x51ed2a];return _0x5b2022;};'use strict';var Sequelize=require(_0x9a57('0x0'));var _=require(_0x9a57('0x1'));module[_0x9a57('0x2')]={'name':{'type':Sequelize[_0x9a57('0x3')],'get':function(_0x2040fb){return this['getDataValue'](_0x9a57('0x4'));}},'alias':{'type':Sequelize[_0x9a57('0x5')],'allowNull':![],'set':function(_0xc15e53){this[_0x9a57('0x6')](_0x9a57('0x4'),_0xc15e53?_0xc15e53:this['getDataValue'](_0x9a57('0x7')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x9a57('0x8')](_0x9a57('0x9')),'get':function(){if(this[_0x9a57('0xa')](_0x9a57('0xb'))===_0x9a57('0xc')){return JSON[_0x9a57('0xd')](this[_0x9a57('0xa')](_0x9a57('0xe')));}else{return this[_0x9a57('0xa')]('values');}},'set':function(_0x1c2849){if(Array[_0x9a57('0xf')](_0x1c2849)){this[_0x9a57('0x6')](_0x9a57('0xe'),JSON[_0x9a57('0x10')](_0x1c2849));}else{this[_0x9a57('0x6')]('values',_0x1c2849);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x9a57('0x11')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x9a57('0x12')](_0x9a57('0x13'))}}; \ No newline at end of file +var _0x71a8=['sequelize','lodash','exports','getDataValue','name','STRING','TEXT','long','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','ENUM','voice'];(function(_0x342483,_0x52d735){var _0x111dce=function(_0xa2e763){while(--_0xa2e763){_0x342483['push'](_0x342483['shift']());}};_0x111dce(++_0x52d735);}(_0x71a8,0x7e));var _0x871a=function(_0x3e3873,_0xf2c1d){_0x3e3873=_0x3e3873-0x0;var _0x1ebf7e=_0x71a8[_0x3e3873];return _0x1ebf7e;};'use strict';var Sequelize=require(_0x871a('0x0'));var _=require(_0x871a('0x1'));module[_0x871a('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x594d21){return this['getDataValue']('alias');}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x3a6b32){this['setDataValue']('alias',_0x3a6b32?_0x3a6b32:this[_0x871a('0x3')](_0x871a('0x4')));}},'type':{'type':Sequelize[_0x871a('0x5')],'allowNull':![]},'values':{'type':Sequelize[_0x871a('0x6')](_0x871a('0x7')),'get':function(){if(this['getDataValue'](_0x871a('0x8'))===_0x871a('0x9')){return JSON[_0x871a('0xa')](this[_0x871a('0x3')](_0x871a('0xb')));}else{return this[_0x871a('0x3')](_0x871a('0xb'));}},'set':function(_0xeeff3f){if(Array[_0x871a('0xc')](_0xeeff3f)){this[_0x871a('0xd')](_0x871a('0xb'),JSON[_0x871a('0xe')](_0xeeff3f));}else{this[_0x871a('0xd')]('values',_0xeeff3f);}}},'required':{'type':Sequelize[_0x871a('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x871a('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x871a('0x10')](_0x871a('0x11'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 6c9f10b..7cdc694 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 _0xced2=['where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','update','body','create','transaction','TEXT','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','fast-json-patch','moment','bluebird','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','error','stack','map','CmCustomField','rawAttributes','type','model','differenceBy','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x423097,_0x8a09f4){var _0x3a73f1=function(_0x9314f0){while(--_0x9314f0){_0x423097['push'](_0x423097['shift']());}};_0x3a73f1(++_0x8a09f4);}(_0xced2,0x1bf));var _0x2ced=function(_0x3b78b2,_0x2b1dfd){_0x3b78b2=_0x3b78b2-0x0;var _0x12d5f8=_0xced2[_0x3b78b2];return _0x12d5f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2ced('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2ced('0x1'));var rp=require('request-promise');var moment=require(_0x2ced('0x2'));var BPromise=require(_0x2ced('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2ced('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2ced('0x5'));var _=require('lodash');var squel=require(_0x2ced('0x6'));var crypto=require(_0x2ced('0x7'));var jsforce=require(_0x2ced('0x8'));var deskjs=require(_0x2ced('0x9'));var toCsv=require('to-csv');var querystring=require(_0x2ced('0xa'));var Papa=require(_0x2ced('0xb'));var Redis=require('ioredis');var authService=require(_0x2ced('0xc'));var qs=require(_0x2ced('0xd'));var as=require(_0x2ced('0xe'));var hardwareService=require(_0x2ced('0xf'));var logger=require('../../config/logger')(_0x2ced('0x10'));var utils=require(_0x2ced('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x2ced('0x12'));var db=require(_0x2ced('0x13'))['db'];function respondWithStatusCode(_0x44181e,_0x43ff3a){_0x43ff3a=_0x43ff3a||0xcc;return function(_0x50b7b1){if(_0x50b7b1){return _0x44181e['sendStatus'](_0x43ff3a);}return _0x44181e[_0x2ced('0x14')](_0x43ff3a)['end']();};}function respondWithResult(_0x429221,_0x23074c){_0x23074c=_0x23074c||0xc8;return function(_0x575734){if(_0x575734){return _0x429221[_0x2ced('0x14')](_0x23074c)[_0x2ced('0x15')](_0x575734);}};}function respondWithFilteredResult(_0x216654,_0x2c6d59){return function(_0x358426){if(_0x358426){var _0x839eb=typeof _0x2c6d59[_0x2ced('0x16')]===_0x2ced('0x17')&&typeof _0x2c6d59[_0x2ced('0x18')]===_0x2ced('0x17');var _0x5b4e35=_0x358426['count'];var _0x4dd308=_0x839eb?0x0:_0x2c6d59[_0x2ced('0x16')];var _0x4a83da=_0x839eb?_0x358426[_0x2ced('0x19')]:_0x2c6d59[_0x2ced('0x16')]+_0x2c6d59[_0x2ced('0x18')];var _0x53739d;if(_0x4a83da>=_0x5b4e35){_0x4a83da=_0x5b4e35;_0x53739d=0xc8;}else{_0x53739d=0xce;}_0x216654['status'](_0x53739d);return _0x216654['set'](_0x2ced('0x1a'),_0x4dd308+'-'+_0x4a83da+'/'+_0x5b4e35)[_0x2ced('0x15')](_0x358426);}return null;};}function patchUpdates(_0x17a8dc){return function(_0x3155e3){try{jsonpatch[_0x2ced('0x1b')](_0x3155e3,_0x17a8dc,!![]);}catch(_0xe404f0){return BPromise[_0x2ced('0x1c')](_0xe404f0);}return _0x3155e3[_0x2ced('0x1d')]();};}function saveUpdates(_0x530001,_0x228244){return function(_0x1f7e78){if(_0x1f7e78){return _0x1f7e78['update'](_0x530001)[_0x2ced('0x1e')](function(_0x4a1e17){return _0x4a1e17;});}return null;};}function removeEntity(_0x58151f,_0x2ff120){return function(_0x552c20){if(_0x552c20){return _0x552c20['destroy']()[_0x2ced('0x1e')](function(){_0x58151f[_0x2ced('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5dc9af,_0x25214c){return function(_0x335c88){if(!_0x335c88){_0x5dc9af[_0x2ced('0x1f')](0x194);}return _0x335c88;};}function handleError(_0x57c327,_0x131884){_0x131884=_0x131884||0x1f4;return function(_0x13332e){logger[_0x2ced('0x20')](_0x13332e[_0x2ced('0x21')]);if(_0x13332e['name']){delete _0x13332e['name'];}_0x57c327[_0x2ced('0x14')](_0x131884)['send'](_0x13332e);};}exports['index']=function(_0x15ec2c,_0x394877){var _0x39a309={},_0x366253={},_0x50386c={'count':0x0,'rows':[]};var _0x5305e5=_[_0x2ced('0x22')](db[_0x2ced('0x23')][_0x2ced('0x24')],function(_0x31542e){return{'name':_0x31542e['fieldName'],'type':_0x31542e[_0x2ced('0x25')]['key']};});_0x366253[_0x2ced('0x26')]=_[_0x2ced('0x27')](_[_0x2ced('0x22')](_0x5305e5,_0x2ced('0x28')),['name']);_0x366253[_0x2ced('0x29')]=_[_0x2ced('0x2a')](_0x15ec2c[_0x2ced('0x29')]);_0x366253['filters']=_[_0x2ced('0x2b')](_0x366253[_0x2ced('0x26')],_0x366253[_0x2ced('0x29')]);_0x39a309[_0x2ced('0x2c')]=_['intersection'](_0x366253['model'],qs[_0x2ced('0x2d')](_0x15ec2c[_0x2ced('0x29')]['fields']));_0x39a309[_0x2ced('0x2c')]=_0x39a309[_0x2ced('0x2c')][_0x2ced('0x2e')]?_0x39a309['attributes']:_0x366253['model'];if(!_0x15ec2c[_0x2ced('0x29')][_0x2ced('0x2f')](_0x2ced('0x30'))){_0x39a309[_0x2ced('0x18')]=qs[_0x2ced('0x18')](_0x15ec2c[_0x2ced('0x29')][_0x2ced('0x18')]);_0x39a309['offset']=qs[_0x2ced('0x16')](_0x15ec2c[_0x2ced('0x29')]['offset']);}_0x39a309[_0x2ced('0x31')]=qs[_0x2ced('0x32')](_0x15ec2c[_0x2ced('0x29')][_0x2ced('0x32')]);_0x39a309[_0x2ced('0x33')]=qs[_0x2ced('0x34')](_[_0x2ced('0x35')](_0x15ec2c[_0x2ced('0x29')],_0x366253['filters']),_0x5305e5);if(_0x15ec2c[_0x2ced('0x29')][_0x2ced('0x36')]){_0x39a309[_0x2ced('0x33')]=_[_0x2ced('0x37')](_0x39a309['where'],{'$or':_[_0x2ced('0x22')](_0x5305e5,function(_0x258f45){if(_0x258f45[_0x2ced('0x25')]!==_0x2ced('0x38')){var _0x2548a9={};_0x2548a9[_0x258f45['name']]={'$like':'%'+_0x15ec2c[_0x2ced('0x29')][_0x2ced('0x36')]+'%'};return _0x2548a9;}})});}_0x39a309=_['merge']({},_0x39a309,_0x15ec2c[_0x2ced('0x39')]);var _0x2fb69f={'where':_0x39a309[_0x2ced('0x33')]};return db[_0x2ced('0x23')][_0x2ced('0x19')](_0x2fb69f)['then'](function(_0x588dff){_0x50386c[_0x2ced('0x19')]=_0x588dff;if(_0x15ec2c[_0x2ced('0x29')][_0x2ced('0x3a')]){_0x39a309[_0x2ced('0x3b')]=[{'all':!![]}];}return db[_0x2ced('0x23')][_0x2ced('0x3c')](_0x39a309);})['then'](function(_0x458b74){_0x50386c[_0x2ced('0x3d')]=_0x458b74;return _0x50386c;})[_0x2ced('0x1e')](respondWithFilteredResult(_0x394877,_0x39a309))['catch'](handleError(_0x394877,null));};exports[_0x2ced('0x3e')]=function(_0x3e44fc,_0x42b3ee){var _0x150dd2={'raw':!![],'where':{'id':_0x3e44fc[_0x2ced('0x3f')]['id']}},_0x1711fc={};_0x1711fc[_0x2ced('0x26')]=_['keys'](db[_0x2ced('0x23')]['rawAttributes']);_0x1711fc[_0x2ced('0x29')]=_[_0x2ced('0x2a')](_0x3e44fc[_0x2ced('0x29')]);_0x1711fc[_0x2ced('0x34')]=_['intersection'](_0x1711fc[_0x2ced('0x26')],_0x1711fc[_0x2ced('0x29')]);_0x150dd2[_0x2ced('0x2c')]=_['intersection'](_0x1711fc['model'],qs['fields'](_0x3e44fc['query']['fields']));_0x150dd2[_0x2ced('0x2c')]=_0x150dd2[_0x2ced('0x2c')][_0x2ced('0x2e')]?_0x150dd2[_0x2ced('0x2c')]:_0x1711fc[_0x2ced('0x26')];if(_0x3e44fc[_0x2ced('0x29')][_0x2ced('0x3a')]){_0x150dd2['include']=[{'all':!![]}];}_0x150dd2=_[_0x2ced('0x37')]({},_0x150dd2,_0x3e44fc[_0x2ced('0x39')]);return db['CmCustomField'][_0x2ced('0x40')](_0x150dd2)['then'](handleEntityNotFound(_0x42b3ee,null))[_0x2ced('0x1e')](respondWithResult(_0x42b3ee,null))[_0x2ced('0x41')](handleError(_0x42b3ee,null));};exports[_0x2ced('0x42')]=function(_0x42b1ee,_0x733f7e){if(_0x42b1ee[_0x2ced('0x43')]['id']){delete _0x42b1ee['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x42b1ee[_0x2ced('0x3f')]['id']}})[_0x2ced('0x1e')](handleEntityNotFound(_0x733f7e,null))[_0x2ced('0x1e')](saveUpdates(_0x42b1ee[_0x2ced('0x43')],null))[_0x2ced('0x1e')](respondWithResult(_0x733f7e,null))[_0x2ced('0x41')](handleError(_0x733f7e,null));};exports['destroy']=function(_0xebf31,_0xee0c42){return db[_0x2ced('0x23')]['find']({'where':{'id':_0xebf31[_0x2ced('0x3f')]['id']}})[_0x2ced('0x1e')](handleEntityNotFound(_0xee0c42,null))[_0x2ced('0x1e')](removeEntity(_0xee0c42,null))[_0x2ced('0x41')](handleError(_0xee0c42,null));};exports[_0x2ced('0x44')]=function(_0x316c43,_0x119559){var _0x4fc2e1;return db['sequelize'][_0x2ced('0x45')](function(_0xfcd8d3){return db[_0x2ced('0x23')]['create'](_0x316c43[_0x2ced('0x43')],{'transaction':_0xfcd8d3})['then'](function(_0xd25bf8){_0x4fc2e1=_0xd25bf8;var _0xe014b8={'type':db['Sequelize'][_0x2ced('0x46')],'transaction':_0xfcd8d3};switch(_0x316c43[_0x2ced('0x43')][_0x2ced('0x25')]){case'text':_0xe014b8[_0x2ced('0x25')]=db['Sequelize'][_0x2ced('0x46')];break;case _0x2ced('0x47'):_0xe014b8[_0x2ced('0x25')]=db[_0x2ced('0x48')][_0x2ced('0x49')];break;case _0x2ced('0x4a'):_0xe014b8[_0x2ced('0x25')]=db[_0x2ced('0x48')][_0x2ced('0x4b')];_0xe014b8[_0x2ced('0x4c')]=![];break;default:}return db[_0x2ced('0x4d')][_0x2ced('0x4e')][_0x2ced('0x4f')](_0x2ced('0x50'),util[_0x2ced('0x51')](_0x2ced('0x52'),_0x4fc2e1['id']),_0xe014b8);})[_0x2ced('0x1e')](function(){return _0x4fc2e1;});})[_0x2ced('0x1e')](respondWithResult(_0x119559,0xc9))[_0x2ced('0x41')](handleError(_0x119559,null));}; \ No newline at end of file +var _0x39bb=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','name','send','index','map','CmCustomField','rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','include','findAll','rows','catch','show','params','find','body','sequelize','create','Sequelize','text','number','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse'];(function(_0x11acf6,_0x864458){var _0x4cdacc=function(_0x41f990){while(--_0x41f990){_0x11acf6['push'](_0x11acf6['shift']());}};_0x4cdacc(++_0x864458);}(_0x39bb,0x1e3));var _0xb39b=function(_0x43a84a,_0x6c500e){_0x43a84a=_0x43a84a-0x0;var _0x2ed43a=_0x39bb[_0x43a84a];return _0x2ed43a;};'use strict';var emlformat=require(_0xb39b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb39b('0x1'));var jsonpatch=require(_0xb39b('0x2'));var rp=require('request-promise');var moment=require(_0xb39b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb39b('0x4'));var util=require(_0xb39b('0x5'));var path=require(_0xb39b('0x6'));var sox=require(_0xb39b('0x7'));var csv=require(_0xb39b('0x8'));var ejs=require(_0xb39b('0x9'));var fs=require('fs');var fs_extra=require(_0xb39b('0xa'));var _=require('lodash');var squel=require(_0xb39b('0xb'));var crypto=require(_0xb39b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb39b('0xd'));var toCsv=require(_0xb39b('0x8'));var querystring=require('querystring');var Papa=require(_0xb39b('0xe'));var Redis=require('ioredis');var authService=require(_0xb39b('0xf'));var qs=require(_0xb39b('0x10'));var as=require(_0xb39b('0x11'));var hardwareService=require(_0xb39b('0x12'));var logger=require(_0xb39b('0x13'))(_0xb39b('0x14'));var utils=require(_0xb39b('0x15'));var config=require(_0xb39b('0x16'));var licenseUtil=require(_0xb39b('0x17'));var db=require(_0xb39b('0x18'))['db'];function respondWithStatusCode(_0x2bcc96,_0x166e49){_0x166e49=_0x166e49||0xcc;return function(_0x42a0a4){if(_0x42a0a4){return _0x2bcc96[_0xb39b('0x19')](_0x166e49);}return _0x2bcc96[_0xb39b('0x1a')](_0x166e49)['end']();};}function respondWithResult(_0x20c8ab,_0x45e70a){_0x45e70a=_0x45e70a||0xc8;return function(_0x59f845){if(_0x59f845){return _0x20c8ab[_0xb39b('0x1a')](_0x45e70a)[_0xb39b('0x1b')](_0x59f845);}};}function respondWithFilteredResult(_0x45538,_0xca0436){return function(_0x2f8d82){if(_0x2f8d82){var _0x4153ef=typeof _0xca0436[_0xb39b('0x1c')]==='undefined'&&typeof _0xca0436['limit']===_0xb39b('0x1d');var _0x4127ea=_0x2f8d82[_0xb39b('0x1e')];var _0x1924f9=_0x4153ef?0x0:_0xca0436[_0xb39b('0x1c')];var _0x1914d6=_0x4153ef?_0x2f8d82['count']:_0xca0436['offset']+_0xca0436[_0xb39b('0x1f')];var _0x506932;if(_0x1914d6>=_0x4127ea){_0x1914d6=_0x4127ea;_0x506932=0xc8;}else{_0x506932=0xce;}_0x45538[_0xb39b('0x1a')](_0x506932);return _0x45538[_0xb39b('0x20')](_0xb39b('0x21'),_0x1924f9+'-'+_0x1914d6+'/'+_0x4127ea)[_0xb39b('0x1b')](_0x2f8d82);}return null;};}function patchUpdates(_0x5ccaa1){return function(_0x2d0ec4){try{jsonpatch[_0xb39b('0x22')](_0x2d0ec4,_0x5ccaa1,!![]);}catch(_0x8134e6){return BPromise[_0xb39b('0x23')](_0x8134e6);}return _0x2d0ec4[_0xb39b('0x24')]();};}function saveUpdates(_0x3c2cd3,_0x57d407){return function(_0x5b6acd){if(_0x5b6acd){return _0x5b6acd[_0xb39b('0x25')](_0x3c2cd3)[_0xb39b('0x26')](function(_0x557092){return _0x557092;});}return null;};}function removeEntity(_0x4ee541,_0x5116f2){return function(_0x2894bd){if(_0x2894bd){return _0x2894bd['destroy']()[_0xb39b('0x26')](function(){_0x4ee541['status'](0xcc)[_0xb39b('0x27')]();});}};}function handleEntityNotFound(_0x18cea3,_0x13263b){return function(_0x43d99e){if(!_0x43d99e){_0x18cea3[_0xb39b('0x19')](0x194);}return _0x43d99e;};}function handleError(_0x396c7b,_0x546084){_0x546084=_0x546084||0x1f4;return function(_0x94168f){logger['error'](_0x94168f['stack']);if(_0x94168f[_0xb39b('0x28')]){delete _0x94168f['name'];}_0x396c7b['status'](_0x546084)[_0xb39b('0x29')](_0x94168f);};}exports[_0xb39b('0x2a')]=function(_0x5c357c,_0x56bfcf){var _0x18389d={},_0x314f7a={},_0x4e37cf={'count':0x0,'rows':[]};var _0x10e216=_[_0xb39b('0x2b')](db[_0xb39b('0x2c')][_0xb39b('0x2d')],function(_0x2023c1){return{'name':_0x2023c1['fieldName'],'type':_0x2023c1[_0xb39b('0x2e')][_0xb39b('0x2f')]};});_0x314f7a[_0xb39b('0x30')]=_[_0xb39b('0x31')](_[_0xb39b('0x2b')](_0x10e216,'name'),['name']);_0x314f7a[_0xb39b('0x32')]=_[_0xb39b('0x33')](_0x5c357c['query']);_0x314f7a[_0xb39b('0x34')]=_[_0xb39b('0x35')](_0x314f7a[_0xb39b('0x30')],_0x314f7a[_0xb39b('0x32')]);_0x18389d[_0xb39b('0x36')]=_[_0xb39b('0x35')](_0x314f7a[_0xb39b('0x30')],qs[_0xb39b('0x37')](_0x5c357c[_0xb39b('0x32')][_0xb39b('0x37')]));_0x18389d[_0xb39b('0x36')]=_0x18389d[_0xb39b('0x36')][_0xb39b('0x38')]?_0x18389d[_0xb39b('0x36')]:_0x314f7a['model'];if(!_0x5c357c['query']['hasOwnProperty'](_0xb39b('0x39'))){_0x18389d[_0xb39b('0x1f')]=qs[_0xb39b('0x1f')](_0x5c357c['query'][_0xb39b('0x1f')]);_0x18389d[_0xb39b('0x1c')]=qs[_0xb39b('0x1c')](_0x5c357c[_0xb39b('0x32')]['offset']);}_0x18389d[_0xb39b('0x3a')]=qs[_0xb39b('0x3b')](_0x5c357c[_0xb39b('0x32')][_0xb39b('0x3b')]);_0x18389d[_0xb39b('0x3c')]=qs[_0xb39b('0x34')](_[_0xb39b('0x3d')](_0x5c357c['query'],_0x314f7a[_0xb39b('0x34')]),_0x10e216);if(_0x5c357c[_0xb39b('0x32')][_0xb39b('0x3e')]){_0x18389d[_0xb39b('0x3c')]=_[_0xb39b('0x3f')](_0x18389d['where'],{'$or':_[_0xb39b('0x2b')](_0x10e216,function(_0x4541dd){if(_0x4541dd[_0xb39b('0x2e')]!=='VIRTUAL'){var _0x45d096={};_0x45d096[_0x4541dd[_0xb39b('0x28')]]={'$like':'%'+_0x5c357c[_0xb39b('0x32')][_0xb39b('0x3e')]+'%'};return _0x45d096;}})});}_0x18389d=_[_0xb39b('0x3f')]({},_0x18389d,_0x5c357c['options']);var _0x57f31c={'where':_0x18389d['where']};return db[_0xb39b('0x2c')][_0xb39b('0x1e')](_0x57f31c)[_0xb39b('0x26')](function(_0x22fbdf){_0x4e37cf[_0xb39b('0x1e')]=_0x22fbdf;if(_0x5c357c[_0xb39b('0x32')]['includeAll']){_0x18389d[_0xb39b('0x40')]=[{'all':!![]}];}return db[_0xb39b('0x2c')][_0xb39b('0x41')](_0x18389d);})[_0xb39b('0x26')](function(_0x2d00d0){_0x4e37cf[_0xb39b('0x42')]=_0x2d00d0;return _0x4e37cf;})[_0xb39b('0x26')](respondWithFilteredResult(_0x56bfcf,_0x18389d))[_0xb39b('0x43')](handleError(_0x56bfcf,null));};exports[_0xb39b('0x44')]=function(_0x4594a9,_0x57692c){var _0x3e58dc={'raw':!![],'where':{'id':_0x4594a9[_0xb39b('0x45')]['id']}},_0x1bf3c3={};_0x1bf3c3[_0xb39b('0x30')]=_[_0xb39b('0x33')](db['CmCustomField'][_0xb39b('0x2d')]);_0x1bf3c3[_0xb39b('0x32')]=_[_0xb39b('0x33')](_0x4594a9[_0xb39b('0x32')]);_0x1bf3c3['filters']=_[_0xb39b('0x35')](_0x1bf3c3[_0xb39b('0x30')],_0x1bf3c3[_0xb39b('0x32')]);_0x3e58dc['attributes']=_['intersection'](_0x1bf3c3[_0xb39b('0x30')],qs[_0xb39b('0x37')](_0x4594a9['query'][_0xb39b('0x37')]));_0x3e58dc[_0xb39b('0x36')]=_0x3e58dc[_0xb39b('0x36')][_0xb39b('0x38')]?_0x3e58dc['attributes']:_0x1bf3c3[_0xb39b('0x30')];if(_0x4594a9[_0xb39b('0x32')]['includeAll']){_0x3e58dc[_0xb39b('0x40')]=[{'all':!![]}];}_0x3e58dc=_[_0xb39b('0x3f')]({},_0x3e58dc,_0x4594a9['options']);return db[_0xb39b('0x2c')]['find'](_0x3e58dc)['then'](handleEntityNotFound(_0x57692c,null))['then'](respondWithResult(_0x57692c,null))[_0xb39b('0x43')](handleError(_0x57692c,null));};exports[_0xb39b('0x25')]=function(_0x5558b0,_0x1d9139){if(_0x5558b0['body']['id']){delete _0x5558b0['body']['id'];}return db[_0xb39b('0x2c')][_0xb39b('0x46')]({'where':{'id':_0x5558b0[_0xb39b('0x45')]['id']}})[_0xb39b('0x26')](handleEntityNotFound(_0x1d9139,null))[_0xb39b('0x26')](saveUpdates(_0x5558b0[_0xb39b('0x47')],null))[_0xb39b('0x26')](respondWithResult(_0x1d9139,null))[_0xb39b('0x43')](handleError(_0x1d9139,null));};exports['destroy']=function(_0x354a79,_0x28b16c){return db[_0xb39b('0x2c')][_0xb39b('0x46')]({'where':{'id':_0x354a79[_0xb39b('0x45')]['id']}})['then'](handleEntityNotFound(_0x28b16c,null))[_0xb39b('0x26')](removeEntity(_0x28b16c,null))[_0xb39b('0x43')](handleError(_0x28b16c,null));};exports['create']=function(_0x3b8b2f,_0xecf7f3){var _0x2fdd35;return db[_0xb39b('0x48')]['transaction'](function(_0x170f97){return db[_0xb39b('0x2c')][_0xb39b('0x49')](_0x3b8b2f[_0xb39b('0x47')],{'transaction':_0x170f97})['then'](function(_0x91dd85){_0x2fdd35=_0x91dd85;var _0x5c2422={'type':db[_0xb39b('0x4a')]['TEXT'],'transaction':_0x170f97};switch(_0x3b8b2f[_0xb39b('0x47')][_0xb39b('0x2e')]){case _0xb39b('0x4b'):_0x5c2422[_0xb39b('0x2e')]=db[_0xb39b('0x4a')]['TEXT'];break;case _0xb39b('0x4c'):_0x5c2422[_0xb39b('0x2e')]=db['Sequelize']['INTEGER'];break;case _0xb39b('0x4d'):_0x5c2422[_0xb39b('0x2e')]=db[_0xb39b('0x4a')]['BOOLEAN'];_0x5c2422[_0xb39b('0x4e')]=![];break;default:}return db['sequelize'][_0xb39b('0x4f')][_0xb39b('0x50')](_0xb39b('0x51'),util[_0xb39b('0x52')]('cf_%d',_0x2fdd35['id']),_0x5c2422);})[_0xb39b('0x26')](function(){return _0x2fdd35;});})[_0xb39b('0x26')](respondWithResult(_0xecf7f3,0xc9))[_0xb39b('0x43')](handleError(_0xecf7f3,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 11252a6..6a4b19f 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 _0x7018=['CmCustomField','cm_custom_fields','lodash','util','bluebird','request-promise','exports','define'];(function(_0x2d92cf,_0x434a92){var _0x592841=function(_0x4e5c22){while(--_0x4e5c22){_0x2d92cf['push'](_0x2d92cf['shift']());}};_0x592841(++_0x434a92);}(_0x7018,0xaa));var _0x8701=function(_0x234406,_0x547f48){_0x234406=_0x234406-0x0;var _0x42d889=_0x7018[_0x234406];return _0x42d889;};'use strict';var _=require(_0x8701('0x0'));var util=require(_0x8701('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x8701('0x2'));var rp=require(_0x8701('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x8701('0x4')]=function(_0x497de0,_0xa1a93a){return _0x497de0[_0x8701('0x5')](_0x8701('0x6'),attributes,{'tableName':_0x8701('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8801=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','moment'];(function(_0x1b2893,_0x4e11c7){var _0x529c63=function(_0x1cf98a){while(--_0x1cf98a){_0x1b2893['push'](_0x1b2893['shift']());}};_0x529c63(++_0x4e11c7);}(_0x8801,0x96));var _0x1880=function(_0x16627e,_0x559d93){_0x16627e=_0x16627e-0x0;var _0x4e52db=_0x8801[_0x16627e];return _0x4e52db;};'use strict';var _=require(_0x1880('0x0'));var util=require(_0x1880('0x1'));var logger=require(_0x1880('0x2'))('api');var moment=require(_0x1880('0x3'));var BPromise=require(_0x1880('0x4'));var rp=require(_0x1880('0x5'));var fs=require('fs');var path=require(_0x1880('0x6'));var rimraf=require(_0x1880('0x7'));var config=require(_0x1880('0x8'));var attributes=require(_0x1880('0x9'));module[_0x1880('0xa')]=function(_0x5abb33,_0x3ee106){return _0x5abb33[_0x1880('0xb')](_0x1880('0xc'),attributes,{'tableName':_0x1880('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 11ec490..41fdfb0 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 _0x5f19=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','util','moment'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x5f19,0x8a));var _0x95f1=function(_0x4ae829,_0x2c842c){_0x4ae829=_0x4ae829-0x0;var _0x256b31=_0x5f19[_0x4ae829];return _0x256b31;};'use strict';var _=require('lodash');var util=require(_0x95f1('0x0'));var moment=require(_0x95f1('0x1'));var BPromise=require(_0x95f1('0x2'));var rs=require(_0x95f1('0x3'));var fs=require('fs');var Redis=require(_0x95f1('0x4'));var db=require(_0x95f1('0x5'))['db'];var utils=require(_0x95f1('0x6'));var logger=require(_0x95f1('0x7'))(_0x95f1('0x8'));var config=require(_0x95f1('0x9'));var jayson=require(_0x95f1('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38e3d5,_0x1213b2,_0x44c96a){return new BPromise(function(_0x2107aa,_0x3bba3a){return client['request'](_0x38e3d5,_0x44c96a)[_0x95f1('0xb')](function(_0x54d80f){logger[_0x95f1('0xc')](_0x95f1('0xd'),_0x1213b2,_0x95f1('0xe'));logger[_0x95f1('0xf')](_0x95f1('0x10'),_0x1213b2,_0x95f1('0xe'),JSON[_0x95f1('0x11')](_0x54d80f));if(_0x54d80f[_0x95f1('0x12')]){if(_0x54d80f[_0x95f1('0x12')]['code']===0x1f4){logger[_0x95f1('0x12')](_0x95f1('0xd'),_0x1213b2,_0x54d80f[_0x95f1('0x12')][_0x95f1('0x13')]);return _0x3bba3a(_0x54d80f[_0x95f1('0x12')][_0x95f1('0x13')]);}logger[_0x95f1('0x12')](_0x95f1('0xd'),_0x1213b2,_0x54d80f[_0x95f1('0x12')][_0x95f1('0x13')]);return _0x2107aa(_0x54d80f[_0x95f1('0x12')][_0x95f1('0x13')]);}else{logger[_0x95f1('0xc')](_0x95f1('0xd'),_0x1213b2,_0x95f1('0xe'));_0x2107aa(_0x54d80f['result']['message']);}})['catch'](function(_0x20fad6){logger[_0x95f1('0x12')](_0x95f1('0xd'),_0x1213b2,_0x20fad6);_0x3bba3a(_0x20fad6);});});} \ No newline at end of file +var _0x4067=['lodash','randomstring','../../mysqldb','../../config/utils','jayson/promise','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x4067,0xd0));var _0x7406=function(_0x300e03,_0x35bf0a){_0x300e03=_0x300e03-0x0;var _0xf4711b=_0x4067[_0x300e03];return _0xf4711b;};'use strict';var _=require(_0x7406('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7406('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7406('0x2'))['db'];var utils=require(_0x7406('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x7406('0x4'));var client=jayson['client'][_0x7406('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x157903,_0x3f9913,_0x33c21d){return new BPromise(function(_0x18caf2,_0xf2ca45){return client[_0x7406('0x6')](_0x157903,_0x33c21d)['then'](function(_0xdf28e3){logger['info'](_0x7406('0x7'),_0x3f9913,_0x7406('0x8'));logger[_0x7406('0x9')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x3f9913,_0x7406('0x8'),JSON[_0x7406('0xa')](_0xdf28e3));if(_0xdf28e3[_0x7406('0xb')]){if(_0xdf28e3[_0x7406('0xb')][_0x7406('0xc')]===0x1f4){logger[_0x7406('0xb')](_0x7406('0x7'),_0x3f9913,_0xdf28e3[_0x7406('0xb')][_0x7406('0xd')]);return _0xf2ca45(_0xdf28e3[_0x7406('0xb')][_0x7406('0xd')]);}logger['error'](_0x7406('0x7'),_0x3f9913,_0xdf28e3['error']['message']);return _0x18caf2(_0xdf28e3[_0x7406('0xb')][_0x7406('0xd')]);}else{logger[_0x7406('0xe')](_0x7406('0x7'),_0x3f9913,_0x7406('0x8'));_0x18caf2(_0xdf28e3[_0x7406('0xf')][_0x7406('0xd')]);}})['catch'](function(_0x55c710){logger[_0x7406('0xb')](_0x7406('0x7'),_0x3f9913,_0x55c710);_0xf2ca45(_0x55c710);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index e6af06a..6a55521 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 _0xb2cb=['../../components/auth/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x1959c1,_0x56378a){var _0x2cfccb=function(_0x1138c5){while(--_0x1138c5){_0x1959c1['push'](_0x1959c1['shift']());}};_0x2cfccb(++_0x56378a);}(_0xb2cb,0x8a));var _0xbb2c=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0xb2cb[_0x5f25b3];return _0x4ab9bf;};'use strict';var multer=require(_0xbb2c('0x0'));var util=require(_0xbb2c('0x1'));var path=require(_0xbb2c('0x2'));var timeout=require(_0xbb2c('0x3'));var express=require('express');var router=express[_0xbb2c('0x4')]();var fs_extra=require(_0xbb2c('0x5'));var auth=require(_0xbb2c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbb2c('0x7'));var controller=require(_0xbb2c('0x8'));router[_0xbb2c('0x9')]('/',auth[_0xbb2c('0xa')](),controller['index']);router[_0xbb2c('0x9')](_0xbb2c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xbb2c('0xc')]('/',auth[_0xbb2c('0xa')](),controller[_0xbb2c('0xd')]);router[_0xbb2c('0xe')](_0xbb2c('0xb'),auth[_0xbb2c('0xa')](),controller[_0xbb2c('0xf')]);router[_0xbb2c('0x10')](_0xbb2c('0xb'),auth[_0xbb2c('0xa')](),controller[_0xbb2c('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6b8f=['update','delete','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','put'];(function(_0xd3d75b,_0x23da46){var _0x1a6fe3=function(_0x5a61d2){while(--_0x5a61d2){_0xd3d75b['push'](_0xd3d75b['shift']());}};_0x1a6fe3(++_0x23da46);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x4ca13b,_0x155784){_0x4ca13b=_0x4ca13b-0x0;var _0x38e76a=_0x6b8f[_0x4ca13b];return _0x38e76a;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['show']);router['post']('/',auth[_0xf6b8('0x9')](),controller['create']);router[_0xf6b8('0xa')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0xc')](_0xf6b8('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 7681e05..0171b07 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 _0x7785=['UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','DATE','format','INTEGER'];(function(_0x882fa2,_0x180f1c){var _0x447f4e=function(_0x1a2423){while(--_0x1a2423){_0x882fa2['push'](_0x882fa2['shift']());}};_0x447f4e(++_0x180f1c);}(_0x7785,0x6e));var _0x5778=function(_0x8e84c,_0x248a38){_0x8e84c=_0x8e84c-0x0;var _0x361f93=_0x7785[_0x8e84c];return _0x361f93;};'use strict';var moment=require('moment');var Sequelize=require(_0x5778('0x0'));module[_0x5778('0x1')]={'phone':{'type':Sequelize[_0x5778('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x5778('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x5778('0x4')],'defaultValue':moment()[_0x5778('0x5')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x5778('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5778('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5778('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5778('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5778('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x5778('0x6')](0x2)[_0x5778('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5778('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5778('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x5778('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x5778('0x8')},'CampaignId':{'type':Sequelize[_0x5778('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5778('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5778('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5778('0x6')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x5778('0x6')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x5778('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x5778('0x4')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0x50ab=['DATE','INTEGER','BOOLEAN','contactListQueue','moment','exports','STRING'];(function(_0x463e64,_0x2dda3e){var _0x15e7ce=function(_0x109e84){while(--_0x109e84){_0x463e64['push'](_0x463e64['shift']());}};_0x15e7ce(++_0x2dda3e);}(_0x50ab,0x1cb));var _0xb50a=function(_0x1d0c7a,_0x39d7a8){_0x1d0c7a=_0x1d0c7a-0x0;var _0x3edec4=_0x50ab[_0x1d0c7a];return _0x3edec4;};'use strict';var moment=require(_0xb50a('0x0'));var Sequelize=require('sequelize');module[_0xb50a('0x1')]={'phone':{'type':Sequelize[_0xb50a('0x2')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xb50a('0x3')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb50a('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb50a('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xb50a('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb50a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb50a('0x3')]},'priority':{'type':Sequelize[_0xb50a('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xb50a('0x5')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xb50a('0x4')],'unique':_0xb50a('0x6')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xb50a('0x6')},'UserId':{'type':Sequelize[_0xb50a('0x4')]},'VoiceQueueId':{'type':Sequelize[_0xb50a('0x4')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xb50a('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xb50a('0x4')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xb50a('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb50a('0x4')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0xb50a('0x4')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xb50a('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0xb50a('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 9ebb3a0..d9f7912 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 _0x23f4=['VIRTUAL','merge','options','CmHopper','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','destroy','VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','updatedAt','state','statedesc','deleted','campaign','UserId','user','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','queue','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','getPreview','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','direction','prev','isEmpty','hopperIds','ASC','scheduledAt','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','findOne','recallme','LOCK','Contact','CmCompany','Queue','dialActive','getPreviewRecall','transaction','scheduledat','UPDATE','Company','CmList','List','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','lodash','api','../../config/environment','../../mysqldb','status','json','undefined','limit','offset','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','keys','query','intersection','filters','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notILike','$overlap','$any','attributes','model','fields','length','hasOwnProperty','nolimit','sort','filter','where'];(function(_0x17b1c0,_0x5f48f5){var _0x5b0ff5=function(_0x404a6c){while(--_0x404a6c){_0x17b1c0['push'](_0x17b1c0['shift']());}};_0x5b0ff5(++_0x5f48f5);}(_0x23f4,0x1ee));var _0x423f=function(_0x59cf6a,_0x17fa60){_0x59cf6a=_0x59cf6a-0x0;var _0xc4d1bb=_0x23f4[_0x59cf6a];return _0xc4d1bb;};'use strict';var moment=require('moment');var _=require(_0x423f('0x0'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x423f('0x1'));var shared=require(_0x423f('0x2'));var db=require(_0x423f('0x3'))['db'];function respondWithResult(_0x3503a0,_0x1ab106){_0x1ab106=_0x1ab106||0xc8;return function(_0x129dba){if(_0x129dba){return _0x3503a0[_0x423f('0x4')](_0x1ab106)[_0x423f('0x5')](_0x129dba);}};}function respondWithFilteredResult(_0x34a2d9,_0x51066b){return function(_0x260eae){if(_0x260eae){var _0x47716d=typeof _0x51066b['offset']===_0x423f('0x6')&&typeof _0x51066b[_0x423f('0x7')]===_0x423f('0x6');var _0x50301a=_0x260eae['count'];var _0x4b8a90=_0x47716d?0x0:_0x51066b[_0x423f('0x8')];var _0x481c41=_0x47716d?_0x260eae[_0x423f('0x9')]:_0x51066b[_0x423f('0x8')]+_0x51066b[_0x423f('0x7')];var _0x162c83;if(_0x481c41>=_0x50301a){_0x481c41=_0x50301a;_0x162c83=0xc8;}else{_0x162c83=0xce;}_0x34a2d9['status'](_0x162c83);return _0x34a2d9[_0x423f('0xa')](_0x423f('0xb'),_0x4b8a90+'-'+_0x481c41+'/'+_0x50301a)[_0x423f('0x5')](_0x260eae);}return null;};}function saveUpdates(_0x3d4027,_0x216360){return function(_0x5275b0){if(_0x5275b0){return _0x5275b0[_0x423f('0xc')](_0x3d4027)[_0x423f('0xd')](function(_0x2ebc8c){return _0x2ebc8c;});}return null;};}function handleEntityNotFound(_0x1c894f,_0x44e1d5){return function(_0x3b531d){if(!_0x3b531d){_0x1c894f[_0x423f('0xe')](0x194);}return _0x3b531d;};}function handleError(_0x21d804,_0x252e6c){_0x252e6c=_0x252e6c||0x1f4;return function(_0x235c86){logger[_0x423f('0xf')](_0x235c86[_0x423f('0x10')]);if(_0x235c86[_0x423f('0x11')]){delete _0x235c86[_0x423f('0x11')];}_0x21d804[_0x423f('0x4')](_0x252e6c)[_0x423f('0x12')](_0x235c86);};}exports[_0x423f('0x13')]=function(_0x34e968,_0x26b6d1){var _0x5424e6={},_0x99435f={},_0x569fd0={'count':0x0,'rows':[]};var _0x504d8b=_[_0x423f('0x14')](db['CmHopper'][_0x423f('0x15')],function(_0xd7b80e){return{'name':_0xd7b80e['fieldName'],'type':_0xd7b80e[_0x423f('0x16')][_0x423f('0x17')]};});_0x99435f['model']=_[_0x423f('0x14')](_0x504d8b,_0x423f('0x11'));_0x99435f['query']=_[_0x423f('0x18')](_0x34e968[_0x423f('0x19')]);_0x99435f['filters']=_[_0x423f('0x1a')](_0x99435f['model'],_0x99435f[_0x423f('0x19')]);_0x99435f[_0x423f('0x1b')]=_[_0x423f('0x1c')](_0x99435f[_0x423f('0x1b')],[_0x423f('0x1d'),_0x423f('0x1e'),_0x423f('0x1f'),_0x423f('0x20'),_0x423f('0x21'),_0x423f('0x22'),_0x423f('0x23'),_0x423f('0x24'),_0x423f('0x25'),_0x423f('0x26'),'$notBetween',_0x423f('0x27'),_0x423f('0x28'),_0x423f('0x29'),'$notLike','$iLike',_0x423f('0x2a'),_0x423f('0x29'),_0x423f('0x2b'),'$contains','$contained',_0x423f('0x2c')]);_0x5424e6[_0x423f('0x2d')]=_['intersection'](_0x99435f[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x34e968[_0x423f('0x19')][_0x423f('0x2f')]));_0x5424e6['attributes']=_0x5424e6[_0x423f('0x2d')][_0x423f('0x30')]?_0x5424e6[_0x423f('0x2d')]:_0x99435f[_0x423f('0x2e')];if(!_0x34e968['query'][_0x423f('0x31')](_0x423f('0x32'))){_0x5424e6[_0x423f('0x7')]=qs[_0x423f('0x7')](_0x34e968[_0x423f('0x19')][_0x423f('0x7')]);_0x5424e6[_0x423f('0x8')]=qs[_0x423f('0x8')](_0x34e968[_0x423f('0x19')][_0x423f('0x8')]);}_0x5424e6['order']=qs[_0x423f('0x33')](_0x34e968[_0x423f('0x19')][_0x423f('0x33')]);_0x5424e6['where']=qs[_0x423f('0x1b')](_['pick'](_0x34e968[_0x423f('0x19')],_0x99435f[_0x423f('0x1b')]),_0x504d8b);if(_0x34e968[_0x423f('0x19')][_0x423f('0x34')]){_0x5424e6[_0x423f('0x35')]=_['merge'](_0x5424e6['where'],{'$or':_[_0x423f('0x14')](_0x504d8b,function(_0x5a2225){if(_0x5a2225[_0x423f('0x16')]!==_0x423f('0x36')){var _0x3e4c9f={};_0x3e4c9f[_0x5a2225[_0x423f('0x11')]]={'$like':'%'+_0x34e968[_0x423f('0x19')][_0x423f('0x34')]+'%'};return _0x3e4c9f;}})});}_0x5424e6=_[_0x423f('0x37')]({},_0x5424e6,_0x34e968[_0x423f('0x38')]);var _0x3aeb17={'where':_0x5424e6[_0x423f('0x35')]};return db[_0x423f('0x39')]['count'](_0x3aeb17)['then'](function(_0x382f91){_0x569fd0[_0x423f('0x9')]=_0x382f91;if(_0x34e968[_0x423f('0x19')][_0x423f('0x3a')]){_0x5424e6[_0x423f('0x3b')]=[{'all':!![]}];}return db['CmHopper'][_0x423f('0x3c')](_0x5424e6);})[_0x423f('0xd')](function(_0x2e6d28){_0x569fd0[_0x423f('0x3d')]=_0x2e6d28;return _0x569fd0;})[_0x423f('0xd')](respondWithFilteredResult(_0x26b6d1,_0x5424e6))[_0x423f('0x3e')](handleError(_0x26b6d1,null));};exports[_0x423f('0x3f')]=function(_0x1d280f,_0x3464e3){var _0x40571a={'raw':!![],'where':{'id':_0x1d280f['params']['id']}},_0x4fb566={};_0x4fb566[_0x423f('0x2e')]=_[_0x423f('0x18')](db[_0x423f('0x39')][_0x423f('0x15')]);_0x4fb566[_0x423f('0x19')]=_[_0x423f('0x18')](_0x1d280f['query']);_0x4fb566[_0x423f('0x1b')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],_0x4fb566[_0x423f('0x19')]);_0x40571a[_0x423f('0x2d')]=_[_0x423f('0x1a')](_0x4fb566[_0x423f('0x2e')],qs[_0x423f('0x2f')](_0x1d280f['query'][_0x423f('0x2f')]));_0x40571a[_0x423f('0x2d')]=_0x40571a[_0x423f('0x2d')][_0x423f('0x30')]?_0x40571a[_0x423f('0x2d')]:_0x4fb566[_0x423f('0x2e')];if(_0x1d280f[_0x423f('0x19')][_0x423f('0x3a')]){_0x40571a[_0x423f('0x3b')]=[{'all':!![]}];}_0x40571a=_['merge']({},_0x40571a,_0x1d280f[_0x423f('0x38')]);return db['CmHopper'][_0x423f('0x40')](_0x40571a)[_0x423f('0xd')](handleEntityNotFound(_0x3464e3,null))[_0x423f('0xd')](respondWithResult(_0x3464e3,null))[_0x423f('0x3e')](handleError(_0x3464e3,null));};exports[_0x423f('0x41')]=function(_0x3ad48c,_0x3087e4){return db[_0x423f('0x39')][_0x423f('0x41')](_0x3ad48c[_0x423f('0x42')],{})[_0x423f('0xd')](respondWithResult(_0x3087e4,0xc9))[_0x423f('0x3e')](handleError(_0x3087e4,null));};exports[_0x423f('0xc')]=function(_0x350e11,_0xa7708c){if(_0x350e11[_0x423f('0x42')]['id']){delete _0x350e11[_0x423f('0x42')]['id'];}return db[_0x423f('0x39')][_0x423f('0x40')]({'where':{'id':_0x350e11[_0x423f('0x43')]['id']}})['then'](handleEntityNotFound(_0xa7708c,null))[_0x423f('0xd')](saveUpdates(_0x350e11['body'],null))[_0x423f('0xd')](respondWithResult(_0xa7708c,null))[_0x423f('0x3e')](handleError(_0xa7708c,null));};exports[_0x423f('0x44')]=function(_0x37035a,_0x57f5d6){return db[_0x423f('0x39')][_0x423f('0x44')]()[_0x423f('0xd')](respondWithResult(_0x57f5d6,null))[_0x423f('0x3e')](handleError(_0x57f5d6,null));};exports[_0x423f('0x45')]=function(_0x31b88e,_0x2dcbec){var _0x489894;var _0x1e2b9f=_0x31b88e[_0x423f('0x43')]['id'];return db['CmHopper'][_0x423f('0x40')]({'where':{'id':_0x31b88e['params']['id']}})[_0x423f('0xd')](handleEntityNotFound(_0x2dcbec,null))['then'](function(_0x56e907){if(_0x56e907){return _0x56e907[_0x423f('0x45')]()[_0x423f('0xd')](function(_0x1668d4){return _0x1668d4;});}})[_0x423f('0xd')](function(_0x545476){_0x489894=_0x545476;if(_0x545476){if(_0x545476[_0x423f('0x46')]||_0x545476['CampaignId']){return db[_0x545476[_0x423f('0x46')]?_0x423f('0x47'):_0x423f('0x48')][_0x423f('0x40')]({'where':{'id':_0x545476[_0x423f('0x46')]?_0x545476[_0x423f('0x46')]:_0x545476[_0x423f('0x49')]},'attributes':['id',_0x423f('0x11')],'raw':!![]});}}})[_0x423f('0xd')](function(_0x4e3003){var _0x104fd9={};if(_0x4e3003){_[_0x423f('0x37')](_0x104fd9,_['omit'](_0x489894[_0x423f('0x4a')],['createdAt',_0x423f('0x4b'),'id']));_0x104fd9[_0x423f('0x4c')]=0x15;_0x104fd9[_0x423f('0x4d')]=_0x423f('0x4e');_0x104fd9[_0x423f('0x4f')]=_0x4e3003[_0x423f('0x11')];_0x104fd9['membername']=_0x31b88e['user'][_0x423f('0x11')];_0x104fd9[_0x423f('0x50')]=_0x31b88e[_0x423f('0x51')]['id'];_0x104fd9[_0x423f('0x4e')]=!![];_0x104fd9[_0x423f('0x52')]=moment()[_0x423f('0x53')](_0x423f('0x54'));_0x104fd9[_0x423f('0x55')]=_0x489894[_0x423f('0x56')];_0x104fd9['campaigntype']=_0x489894[_0x423f('0x46')]?_0x423f('0x57'):'ivr';return db[_0x423f('0x58')]['find']({'where':{'id':_0x104fd9[_0x423f('0x59')]},'attributes':[_0x423f('0x5a'),_0x423f('0x5b')]})['then'](function(_0x5c39e4){if(!_[_0x423f('0x5c')](_0x2dcbec)&&!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5a')])){_0x104fd9['calleridname']=_0x5c39e4[_0x423f('0x5a')];if(!_[_0x423f('0x5c')](_0x5c39e4[_0x423f('0x5b')])){_0x104fd9[_0x423f('0x5d')]+='\x20'+_0x5c39e4[_0x423f('0x5b')];}}})[_0x423f('0x5e')](function(){return db[_0x423f('0x5f')]['create'](_0x104fd9);});}})[_0x423f('0xd')](function(_0x588483){return db[_0x423f('0x60')][_0x423f('0x45')]({'where':{'CmHopperId':_0x1e2b9f}});})[_0x423f('0xd')](function(){return _0x2dcbec[_0x423f('0x4')](0xcc)['end']();})[_0x423f('0x3e')](handleError(_0x2dcbec,null));};exports[_0x423f('0x61')]=function(_0x4c33c7,_0x5ae8a9){var _0xfe89a9=[];return db[_0x423f('0x58')]['describe']()[_0x423f('0xd')](function(_0x1897ff){_0xfe89a9=_['keys'](_0x1897ff);return _0x4c33c7['user']['getVoiceQueues']({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':_0x423f('0x63')},'attributes':['id',_0x423f('0x64'),_0x423f('0x65')],'raw':!![]});})['then'](function(_0x4fa0ef){if(_0x4fa0ef&&_0x4fa0ef[_0x423f('0x30')]){return db[_0x423f('0x66')]['transaction'](function(_0x43b569){var _0x13ed0b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_[_0x423f('0x14')](_0x4fa0ef,'id')},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x116605={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x4fa0ef)['filter']([_0x423f('0x65'),0x0])[_0x423f('0x14')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x4c33c7[_0x423f('0x51')]['id']}]};var _0x223e8c={'$or':[_0x13ed0b,_0x116605]};var _0x3e5d47=[];if(_0x4c33c7['body'][_0x423f('0x67')]&&_0x4c33c7[_0x423f('0x42')][_0x423f('0x67')]===_0x423f('0x68')){if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')])){_0x223e8c['id']={'$in':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[['priority',_0x423f('0x6b')],[_0x423f('0x6c'),_0x4fa0ef[0x0][_0x423f('0x64')]===_0x423f('0x6b')?'DESC':_0x423f('0x6b')],db[_0x423f('0x66')][_0x423f('0x6d')](_0x423f('0x6e')),['id',_0x423f('0x6f')]];}else{if(!_[_0x423f('0x69')](_0x4c33c7[_0x423f('0x42')]['hopperIds'])){_0x223e8c['id']={'$notIn':_0x4c33c7[_0x423f('0x42')][_0x423f('0x6a')]};}_0x3e5d47=[[_0x423f('0x70'),_0x423f('0x6f')],['scheduledAt',_0x4fa0ef[0x0][_0x423f('0x64')]],db[_0x423f('0x66')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x423f('0x6b')]];}return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id','scheduledat',_0x423f('0x56'),_0x423f('0x72')],'where':_0x223e8c,'order':_0x3e5d47,'transaction':_0x43b569,'lock':_0x43b569[_0x423f('0x73')]['UPDATE'],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0xfe89a9,'include':[{'model':db[_0x423f('0x75')],'as':'Company','attributes':['id',_0x423f('0x11')]}]},{'model':db['CmList'],'as':'List','attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':_0x423f('0x76'),'attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})['then'](function(_0x29e60c){if(_0x29e60c){return _0x29e60c[_0x423f('0xc')]({'UserId':_0x4c33c7[_0x423f('0x51')]['id']},{'transaction':_0x43b569});}});});}})[_0x423f('0xd')](handleEntityNotFound(_0x5ae8a9,null))[_0x423f('0xd')](respondWithResult(_0x5ae8a9,null))[_0x423f('0x3e')](handleError(_0x5ae8a9,null));};exports[_0x423f('0x78')]=function(_0x5b9577,_0x4e1e04,_0xd9409e){var _0x320528=[];var _0xe76487=_0x5b9577[_0x423f('0x43')]['id'];var _0x3cffc3=_0x5b9577['user']['id'];return db[_0x423f('0x58')][_0x423f('0x44')]()[_0x423f('0xd')](function(_0x358ab3){_0x320528=_[_0x423f('0x18')](_0x358ab3);return db[_0x423f('0x66')][_0x423f('0x79')](function(_0x1db383){const _0x20bd00={'id':_0xe76487};return db[_0x423f('0x39')][_0x423f('0x71')]({'attributes':['id',_0x423f('0x7a'),_0x423f('0x72')],'where':_0x20bd00,'transaction':_0x1db383,'lock':_0x1db383['LOCK'][_0x423f('0x7b')],'include':[{'model':db[_0x423f('0x58')],'as':_0x423f('0x74'),'attributes':_0x320528,'include':[{'model':db[_0x423f('0x75')],'as':_0x423f('0x7c'),'attributes':['id','name']}]},{'model':db[_0x423f('0x7d')],'as':_0x423f('0x7e'),'attributes':['id',_0x423f('0x11')]},{'model':db[_0x423f('0x47')],'as':'Queue','attributes':['id',_0x423f('0x11'),_0x423f('0x77')]}]})[_0x423f('0xd')](function(_0x3832b6){if(_0x3832b6){return _0x3832b6[_0x423f('0xc')]({'UserId':_0x3cffc3},{'transaction':_0x1db383});}});});})[_0x423f('0xd')](handleEntityNotFound(_0x4e1e04,null))[_0x423f('0xd')](respondWithResult(_0x4e1e04,null))[_0x423f('0x3e')](handleError(_0x4e1e04,null));};exports[_0x423f('0x7f')]=function(_0x22f2af,_0x3c78c7){return _0x22f2af[_0x423f('0x51')][_0x423f('0x80')]({'where':{'type':_0x423f('0x62'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x423f('0xd')](function(_0x5333b7){if(_0x5333b7&&_0x5333b7['length']){return db[_0x423f('0x39')][_0x423f('0x9')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x423f('0x53')](_0x423f('0x54'))},'VoiceQueueId':{'$in':_['map'](_0x5333b7,'id')},'$or':[{'UserId':null},{'UserId':_0x22f2af[_0x423f('0x51')]['id']}]}});}return 0x0;})['then'](function(_0xf18525){if(!_[_0x423f('0x5c')](_0xf18525)&&_[_0x423f('0x81')](_0xf18525)){return _0x3c78c7[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'contacts':_0xf18525});}else{logger['error'](_0x423f('0x82'),'getOpenContacts',0x194,_0x423f('0x83'));_0x3c78c7['sendStatus'](0x194);}})[_0x423f('0x3e')](handleError(_0x3c78c7,null));};exports[_0x423f('0x84')]=function(_0x1990ec,_0x5697e8){var _0xbcf529=shared[_0x423f('0x85')];var _0x3ecfd5=[];_[_0x423f('0x14')](_0xbcf529,function(_0x5baf51){_0x3ecfd5[_0x423f('0x86')]({'id':_0x5baf51[_0x423f('0x11')],'name':_0x5baf51['name'],'utcOffset':_0x5baf51[_0x423f('0x87')]});});return _0x5697e8[_0x423f('0x4')](0xc8)[_0x423f('0x5')]({'tz':_0x3ecfd5});};exports[_0x423f('0x88')]=function(_0x36241e,_0x2bb2ba){var _0x140db1=shared[_0x423f('0x85')];var _0x2ede33={};if(!_[_0x423f('0x5c')](_0x140db1[_0x36241e['body']['id']]))_0x2ede33=_0x140db1[_0x36241e['body']['id']];return _0x2bb2ba[_0x423f('0x4')](0xc8)['json'](_0x2ede33);}; \ No newline at end of file +var _0x7dfd=['ASC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','phone','UPDATE','Contact','CmCompany','Company','CmList','List','Queue','getPreviewRecall','keys','recallme','LOCK','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','push','utcOffset','getTimezone','moment','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','limit','undefined','count','set','Content-Range','update','then','sendStatus','error','name','send','index','map','CmHopper','rawAttributes','fieldName','key','query','intersection','model','filters','concat','$and','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','fields','length','find','catch','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','format','calleridnum','campaigntype','queue','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','CmContact','getVoiceQueues','outbound','preview','dialPreviewAutoRecallMe','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','dialOrderByScheduledAt','DESC'];(function(_0x29b3c7,_0x238e37){var _0x4c979b=function(_0x37ace1){while(--_0x37ace1){_0x29b3c7['push'](_0x29b3c7['shift']());}};_0x4c979b(++_0x238e37);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xd7df('0x0'));var _=require(_0xd7df('0x1'));var qs=require(_0xd7df('0x2'));var logger=require(_0xd7df('0x3'))(_0xd7df('0x4'));var shared=require(_0xd7df('0x5'));var db=require(_0xd7df('0x6'))['db'];function respondWithResult(_0x38eee7,_0x3ef231){_0x3ef231=_0x3ef231||0xc8;return function(_0x3d8c5a){if(_0x3d8c5a){return _0x38eee7[_0xd7df('0x7')](_0x3ef231)[_0xd7df('0x8')](_0x3d8c5a);}};}function respondWithFilteredResult(_0x36cf0f,_0x39ce98){return function(_0x354ea7){if(_0x354ea7){var _0x16e50=typeof _0x39ce98[_0xd7df('0x9')]==='undefined'&&typeof _0x39ce98[_0xd7df('0xa')]===_0xd7df('0xb');var _0x14ba9c=_0x354ea7[_0xd7df('0xc')];var _0x5e59c3=_0x16e50?0x0:_0x39ce98[_0xd7df('0x9')];var _0x532c14=_0x16e50?_0x354ea7[_0xd7df('0xc')]:_0x39ce98['offset']+_0x39ce98[_0xd7df('0xa')];var _0x82f1c0;if(_0x532c14>=_0x14ba9c){_0x532c14=_0x14ba9c;_0x82f1c0=0xc8;}else{_0x82f1c0=0xce;}_0x36cf0f[_0xd7df('0x7')](_0x82f1c0);return _0x36cf0f[_0xd7df('0xd')](_0xd7df('0xe'),_0x5e59c3+'-'+_0x532c14+'/'+_0x14ba9c)[_0xd7df('0x8')](_0x354ea7);}return null;};}function saveUpdates(_0x2e8187,_0x3da618){return function(_0x7ba3c){if(_0x7ba3c){return _0x7ba3c[_0xd7df('0xf')](_0x2e8187)[_0xd7df('0x10')](function(_0x4723b7){return _0x4723b7;});}return null;};}function handleEntityNotFound(_0xe1595f,_0x196632){return function(_0x3b2559){if(!_0x3b2559){_0xe1595f[_0xd7df('0x11')](0x194);}return _0x3b2559;};}function handleError(_0x31f557,_0x57b8be){_0x57b8be=_0x57b8be||0x1f4;return function(_0x4c5cf){logger[_0xd7df('0x12')](_0x4c5cf['stack']);if(_0x4c5cf[_0xd7df('0x13')]){delete _0x4c5cf[_0xd7df('0x13')];}_0x31f557['status'](_0x57b8be)[_0xd7df('0x14')](_0x4c5cf);};}exports[_0xd7df('0x15')]=function(_0x35e0a,_0x5210e5){var _0x40167d={},_0x471621={},_0x3cea3={'count':0x0,'rows':[]};var _0x5ba653=_[_0xd7df('0x16')](db[_0xd7df('0x17')][_0xd7df('0x18')],function(_0x5acb0a){return{'name':_0x5acb0a[_0xd7df('0x19')],'type':_0x5acb0a['type'][_0xd7df('0x1a')]};});_0x471621['model']=_[_0xd7df('0x16')](_0x5ba653,_0xd7df('0x13'));_0x471621[_0xd7df('0x1b')]=_['keys'](_0x35e0a[_0xd7df('0x1b')]);_0x471621['filters']=_[_0xd7df('0x1c')](_0x471621[_0xd7df('0x1d')],_0x471621[_0xd7df('0x1b')]);_0x471621[_0xd7df('0x1e')]=_[_0xd7df('0x1f')](_0x471621[_0xd7df('0x1e')],[_0xd7df('0x20'),'$or','$gt',_0xd7df('0x21'),_0xd7df('0x22'),_0xd7df('0x23'),_0xd7df('0x24'),_0xd7df('0x25'),_0xd7df('0x26'),_0xd7df('0x27'),_0xd7df('0x28'),_0xd7df('0x29'),'$notIn',_0xd7df('0x2a'),_0xd7df('0x2b'),_0xd7df('0x2c'),_0xd7df('0x2d'),_0xd7df('0x2a'),_0xd7df('0x2e'),_0xd7df('0x2f'),_0xd7df('0x30'),'$any']);_0x40167d['attributes']=_['intersection'](_0x471621['model'],qs['fields'](_0x35e0a[_0xd7df('0x1b')]['fields']));_0x40167d[_0xd7df('0x31')]=_0x40167d[_0xd7df('0x31')]['length']?_0x40167d[_0xd7df('0x31')]:_0x471621[_0xd7df('0x1d')];if(!_0x35e0a['query'][_0xd7df('0x32')](_0xd7df('0x33'))){_0x40167d[_0xd7df('0xa')]=qs[_0xd7df('0xa')](_0x35e0a[_0xd7df('0x1b')][_0xd7df('0xa')]);_0x40167d['offset']=qs[_0xd7df('0x9')](_0x35e0a[_0xd7df('0x1b')][_0xd7df('0x9')]);}_0x40167d[_0xd7df('0x34')]=qs[_0xd7df('0x35')](_0x35e0a[_0xd7df('0x1b')][_0xd7df('0x35')]);_0x40167d[_0xd7df('0x36')]=qs[_0xd7df('0x1e')](_[_0xd7df('0x37')](_0x35e0a[_0xd7df('0x1b')],_0x471621['filters']),_0x5ba653);if(_0x35e0a['query'][_0xd7df('0x38')]){_0x40167d['where']=_[_0xd7df('0x39')](_0x40167d[_0xd7df('0x36')],{'$or':_[_0xd7df('0x16')](_0x5ba653,function(_0x1417eb){if(_0x1417eb['type']!=='VIRTUAL'){var _0x57481a={};_0x57481a[_0x1417eb[_0xd7df('0x13')]]={'$like':'%'+_0x35e0a[_0xd7df('0x1b')]['filter']+'%'};return _0x57481a;}})});}_0x40167d=_[_0xd7df('0x39')]({},_0x40167d,_0x35e0a[_0xd7df('0x3a')]);var _0x4bda0e={'where':_0x40167d[_0xd7df('0x36')]};return db['CmHopper'][_0xd7df('0xc')](_0x4bda0e)[_0xd7df('0x10')](function(_0x5f0a6d){_0x3cea3[_0xd7df('0xc')]=_0x5f0a6d;if(_0x35e0a['query'][_0xd7df('0x3b')]){_0x40167d[_0xd7df('0x3c')]=[{'all':!![]}];}return db[_0xd7df('0x17')]['findAll'](_0x40167d);})[_0xd7df('0x10')](function(_0x2a7252){_0x3cea3[_0xd7df('0x3d')]=_0x2a7252;return _0x3cea3;})[_0xd7df('0x10')](respondWithFilteredResult(_0x5210e5,_0x40167d))['catch'](handleError(_0x5210e5,null));};exports[_0xd7df('0x3e')]=function(_0x230857,_0x2314e6){var _0x4f6286={'raw':!![],'where':{'id':_0x230857[_0xd7df('0x3f')]['id']}},_0x49177a={};_0x49177a[_0xd7df('0x1d')]=_['keys'](db[_0xd7df('0x17')][_0xd7df('0x18')]);_0x49177a['query']=_['keys'](_0x230857[_0xd7df('0x1b')]);_0x49177a[_0xd7df('0x1e')]=_[_0xd7df('0x1c')](_0x49177a['model'],_0x49177a['query']);_0x4f6286[_0xd7df('0x31')]=_['intersection'](_0x49177a[_0xd7df('0x1d')],qs['fields'](_0x230857['query'][_0xd7df('0x40')]));_0x4f6286['attributes']=_0x4f6286[_0xd7df('0x31')][_0xd7df('0x41')]?_0x4f6286[_0xd7df('0x31')]:_0x49177a[_0xd7df('0x1d')];if(_0x230857[_0xd7df('0x1b')][_0xd7df('0x3b')]){_0x4f6286[_0xd7df('0x3c')]=[{'all':!![]}];}_0x4f6286=_[_0xd7df('0x39')]({},_0x4f6286,_0x230857[_0xd7df('0x3a')]);return db['CmHopper'][_0xd7df('0x42')](_0x4f6286)['then'](handleEntityNotFound(_0x2314e6,null))[_0xd7df('0x10')](respondWithResult(_0x2314e6,null))[_0xd7df('0x43')](handleError(_0x2314e6,null));};exports[_0xd7df('0x44')]=function(_0xdcf9b3,_0x29d2d9){return db[_0xd7df('0x17')][_0xd7df('0x44')](_0xdcf9b3[_0xd7df('0x45')],{})[_0xd7df('0x10')](respondWithResult(_0x29d2d9,0xc9))['catch'](handleError(_0x29d2d9,null));};exports[_0xd7df('0xf')]=function(_0x563f90,_0x49085b){if(_0x563f90['body']['id']){delete _0x563f90[_0xd7df('0x45')]['id'];}return db[_0xd7df('0x17')][_0xd7df('0x42')]({'where':{'id':_0x563f90['params']['id']}})['then'](handleEntityNotFound(_0x49085b,null))[_0xd7df('0x10')](saveUpdates(_0x563f90['body'],null))[_0xd7df('0x10')](respondWithResult(_0x49085b,null))[_0xd7df('0x43')](handleError(_0x49085b,null));};exports[_0xd7df('0x46')]=function(_0x1506c4,_0x1838aa){return db[_0xd7df('0x17')][_0xd7df('0x46')]()[_0xd7df('0x10')](respondWithResult(_0x1838aa,null))[_0xd7df('0x43')](handleError(_0x1838aa,null));};exports[_0xd7df('0x47')]=function(_0x1fd63a,_0x3a7c84){var _0x54222c;var _0x1f2f99=_0x1fd63a[_0xd7df('0x3f')]['id'];return db[_0xd7df('0x17')][_0xd7df('0x42')]({'where':{'id':_0x1fd63a[_0xd7df('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3a7c84,null))[_0xd7df('0x10')](function(_0x32b147){if(_0x32b147){return _0x32b147[_0xd7df('0x47')]()['then'](function(_0x19f610){return _0x19f610;});}})['then'](function(_0x201b2f){_0x54222c=_0x201b2f;if(_0x201b2f){if(_0x201b2f[_0xd7df('0x48')]||_0x201b2f[_0xd7df('0x49')]){return db[_0x201b2f[_0xd7df('0x48')]?_0xd7df('0x4a'):'Campaign']['find']({'where':{'id':_0x201b2f['VoiceQueueId']?_0x201b2f[_0xd7df('0x48')]:_0x201b2f['CampaignId']},'attributes':['id',_0xd7df('0x13')],'raw':!![]});}}})[_0xd7df('0x10')](function(_0x32cdfa){var _0xdf3046={};if(_0x32cdfa){_[_0xd7df('0x39')](_0xdf3046,_[_0xd7df('0x4b')](_0x54222c[_0xd7df('0x4c')],[_0xd7df('0x4d'),_0xd7df('0x4e'),'id']));_0xdf3046[_0xd7df('0x4f')]=0x15;_0xdf3046[_0xd7df('0x50')]=_0xd7df('0x51');_0xdf3046[_0xd7df('0x52')]=_0x32cdfa[_0xd7df('0x13')];_0xdf3046[_0xd7df('0x53')]=_0x1fd63a[_0xd7df('0x54')]['name'];_0xdf3046[_0xd7df('0x55')]=_0x1fd63a[_0xd7df('0x54')]['id'];_0xdf3046['deleted']=!![];_0xdf3046['deletedat']=moment()[_0xd7df('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0xdf3046[_0xd7df('0x57')]=_0x54222c['phone'];_0xdf3046[_0xd7df('0x58')]=_0x54222c[_0xd7df('0x48')]?_0xd7df('0x59'):'ivr';return db['CmContact']['find']({'where':{'id':_0xdf3046[_0xd7df('0x5a')]},'attributes':[_0xd7df('0x5b'),_0xd7df('0x5c')]})[_0xd7df('0x10')](function(_0x41249b){if(!_[_0xd7df('0x5d')](_0x3a7c84)&&!_['isNil'](_0x41249b[_0xd7df('0x5b')])){_0xdf3046[_0xd7df('0x5e')]=_0x41249b[_0xd7df('0x5b')];if(!_[_0xd7df('0x5d')](_0x41249b[_0xd7df('0x5c')])){_0xdf3046[_0xd7df('0x5e')]+='\x20'+_0x41249b[_0xd7df('0x5c')];}}})[_0xd7df('0x5f')](function(){return db[_0xd7df('0x60')][_0xd7df('0x44')](_0xdf3046);});}})[_0xd7df('0x10')](function(_0x398e43){return db[_0xd7df('0x61')][_0xd7df('0x47')]({'where':{'CmHopperId':_0x1f2f99}});})[_0xd7df('0x10')](function(){return _0x3a7c84[_0xd7df('0x7')](0xcc)[_0xd7df('0x62')]();})[_0xd7df('0x43')](handleError(_0x3a7c84,null));};exports[_0xd7df('0x63')]=function(_0x1e6277,_0x146e2a){var _0x393a3a=[];return db[_0xd7df('0x64')][_0xd7df('0x46')]()[_0xd7df('0x10')](function(_0x3912d6){_0x393a3a=_['keys'](_0x3912d6);return _0x1e6277['user'][_0xd7df('0x65')]({'where':{'type':_0xd7df('0x66'),'dialActive':!![],'dialMethod':_0xd7df('0x67')},'attributes':['id','dialOrderByScheduledAt',_0xd7df('0x68')],'raw':!![]});})[_0xd7df('0x10')](function(_0x1e87aa){if(_0x1e87aa&&_0x1e87aa[_0xd7df('0x41')]){return db['sequelize'][_0xd7df('0x69')](function(_0x20ad50){var _0xb06a56={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd7df('0x56')](_0xd7df('0x6a'))},'VoiceQueueId':{'$in':_[_0xd7df('0x16')](_0x1e87aa,'id')},'$or':[{'UserId':null},{'UserId':_0x1e6277[_0xd7df('0x54')]['id']}]};var _0x2fdad0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x1e87aa)['filter']([_0xd7df('0x68'),0x0])[_0xd7df('0x16')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x1e6277['user']['id']}]};var _0x481fa5={'$or':[_0xb06a56,_0x2fdad0]};var _0x264c5b=[];if(_0x1e6277[_0xd7df('0x45')][_0xd7df('0x6b')]&&_0x1e6277[_0xd7df('0x45')]['direction']===_0xd7df('0x6c')){if(!_[_0xd7df('0x6d')](_0x1e6277[_0xd7df('0x45')][_0xd7df('0x6e')])){_0x481fa5['id']={'$in':_0x1e6277[_0xd7df('0x45')][_0xd7df('0x6e')]};}_0x264c5b=[[_0xd7df('0x6f'),'ASC'],['scheduledAt',_0x1e87aa[0x0][_0xd7df('0x70')]==='ASC'?_0xd7df('0x71'):_0xd7df('0x72')],db[_0xd7df('0x73')]['literal']('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xd7df('0x71')]];}else{if(!_[_0xd7df('0x6d')](_0x1e6277['body'][_0xd7df('0x6e')])){_0x481fa5['id']={'$notIn':_0x1e6277[_0xd7df('0x45')]['hopperIds']};}_0x264c5b=[[_0xd7df('0x6f'),_0xd7df('0x71')],['scheduledAt',_0x1e87aa[0x0][_0xd7df('0x70')]],db[_0xd7df('0x73')][_0xd7df('0x74')](_0xd7df('0x75')),['id',_0xd7df('0x72')]];}return db[_0xd7df('0x17')][_0xd7df('0x76')]({'attributes':['id',_0xd7df('0x77'),_0xd7df('0x78'),'recallme'],'where':_0x481fa5,'order':_0x264c5b,'transaction':_0x20ad50,'lock':_0x20ad50['LOCK'][_0xd7df('0x79')],'include':[{'model':db[_0xd7df('0x64')],'as':_0xd7df('0x7a'),'attributes':_0x393a3a,'include':[{'model':db[_0xd7df('0x7b')],'as':_0xd7df('0x7c'),'attributes':['id',_0xd7df('0x13')]}]},{'model':db[_0xd7df('0x7d')],'as':_0xd7df('0x7e'),'attributes':['id',_0xd7df('0x13')]},{'model':db['VoiceQueue'],'as':_0xd7df('0x7f'),'attributes':['id',_0xd7df('0x13'),'dialActive']}]})[_0xd7df('0x10')](function(_0x726d1b){if(_0x726d1b){return _0x726d1b[_0xd7df('0xf')]({'UserId':_0x1e6277[_0xd7df('0x54')]['id']},{'transaction':_0x20ad50});}});});}})['then'](handleEntityNotFound(_0x146e2a,null))['then'](respondWithResult(_0x146e2a,null))['catch'](handleError(_0x146e2a,null));};exports[_0xd7df('0x80')]=function(_0x57040f,_0x6992f1,_0x2b1b30){var _0x2c7354=[];var _0xf05d82=_0x57040f[_0xd7df('0x3f')]['id'];var _0x16d782=_0x57040f['user']['id'];return db[_0xd7df('0x64')][_0xd7df('0x46')]()[_0xd7df('0x10')](function(_0x5d8c37){_0x2c7354=_[_0xd7df('0x81')](_0x5d8c37);return db[_0xd7df('0x73')]['transaction'](function(_0x280694){const _0x33f8fb={'id':_0xf05d82};return db[_0xd7df('0x17')][_0xd7df('0x76')]({'attributes':['id',_0xd7df('0x77'),_0xd7df('0x82')],'where':_0x33f8fb,'transaction':_0x280694,'lock':_0x280694[_0xd7df('0x83')]['UPDATE'],'include':[{'model':db[_0xd7df('0x64')],'as':_0xd7df('0x7a'),'attributes':_0x2c7354,'include':[{'model':db[_0xd7df('0x7b')],'as':_0xd7df('0x7c'),'attributes':['id','name']}]},{'model':db['CmList'],'as':_0xd7df('0x7e'),'attributes':['id',_0xd7df('0x13')]},{'model':db[_0xd7df('0x4a')],'as':_0xd7df('0x7f'),'attributes':['id',_0xd7df('0x13'),'dialActive']}]})[_0xd7df('0x10')](function(_0x4f739b){if(_0x4f739b){return _0x4f739b['update']({'UserId':_0x16d782},{'transaction':_0x280694});}});});})[_0xd7df('0x10')](handleEntityNotFound(_0x6992f1,null))[_0xd7df('0x10')](respondWithResult(_0x6992f1,null))[_0xd7df('0x43')](handleError(_0x6992f1,null));};exports[_0xd7df('0x84')]=function(_0x30c401,_0x3ece24){return _0x30c401['user']['getVoiceQueues']({'where':{'type':_0xd7df('0x66'),'dialActive':!![],'dialMethod':_0xd7df('0x67')},'attributes':['id'],'raw':!![]})[_0xd7df('0x10')](function(_0x175a36){if(_0x175a36&&_0x175a36['length']){return db[_0xd7df('0x17')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd7df('0x56')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xd7df('0x16')](_0x175a36,'id')},'$or':[{'UserId':null},{'UserId':_0x30c401[_0xd7df('0x54')]['id']}]}});}return 0x0;})[_0xd7df('0x10')](function(_0x223a64){if(!_[_0xd7df('0x5d')](_0x223a64)&&_[_0xd7df('0x85')](_0x223a64)){return _0x3ece24['status'](0xc8)[_0xd7df('0x8')]({'contacts':_0x223a64});}else{logger['error'](_0xd7df('0x86'),_0xd7df('0x84'),0x194,_0xd7df('0x87'));_0x3ece24[_0xd7df('0x11')](0x194);}})['catch'](handleError(_0x3ece24,null));};exports[_0xd7df('0x88')]=function(_0x89e217,_0x31c191){var _0x307310=shared[_0xd7df('0x89')];var _0x30aff7=[];_[_0xd7df('0x16')](_0x307310,function(_0x3052f7){_0x30aff7[_0xd7df('0x8a')]({'id':_0x3052f7[_0xd7df('0x13')],'name':_0x3052f7[_0xd7df('0x13')],'utcOffset':_0x3052f7[_0xd7df('0x8b')]});});return _0x31c191['status'](0xc8)[_0xd7df('0x8')]({'tz':_0x30aff7});};exports[_0xd7df('0x8c')]=function(_0x36a83b,_0x50c701){var _0x56eeb9=shared[_0xd7df('0x89')];var _0x3657cb={};if(!_[_0xd7df('0x5d')](_0x56eeb9[_0x36a83b[_0xd7df('0x45')]['id']]))_0x3657cb=_0x56eeb9[_0x36a83b[_0xd7df('0x45')]['id']];return _0x50c701[_0xd7df('0x7')](0xc8)[_0xd7df('0x8')](_0x3657cb);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index f8d6f28..d366bd9 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 _0x90b1=['priority','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','define','CmHopper','cm_hopper','scheduledat','phone'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x90b1,0x1bb));var _0x190b=function(_0x56b32c,_0xbbb33e){_0x56b32c=_0x56b32c-0x0;var _0x3093fe=_0x90b1[_0x56b32c];return _0x3093fe;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var logger=require(_0x190b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x190b('0x3'));var rp=require(_0x190b('0x4'));var fs=require('fs');var path=require(_0x190b('0x5'));var rimraf=require(_0x190b('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[{'name':_0x190b('0xa'),'fields':[_0x190b('0xa')]},{'name':_0x190b('0xb'),'fields':['phone']},{'name':_0x190b('0xc'),'fields':[_0x190b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xacf4=['define','CmHopper','cm_hopper','scheduledat','phone','priority','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./cmHopper.attributes','exports'];(function(_0x8966d9,_0xe6df61){var _0x324ca9=function(_0x2bbc63){while(--_0x2bbc63){_0x8966d9['push'](_0x8966d9['shift']());}};_0x324ca9(++_0xe6df61);}(_0xacf4,0xe7));var _0x4acf=function(_0x20f784,_0x219af1){_0x20f784=_0x20f784-0x0;var _0x4c12e3=_0xacf4[_0x20f784];return _0x4c12e3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['scheduledat']},{'name':'phone','fields':[_0x4acf('0xd')]},{'name':'priority','fields':[_0x4acf('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 118656a..8af0f53 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 _0x749a=['voicePause','length','UserId','push','update','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','transaction','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','CmList','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','then','stringify','catch','error','message','CmHopper','find','raw','ShowCmHopper','CreateCmHopper','create','body','info','debug','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact','keys','User','Agent'];(function(_0x3512c3,_0x346843){var _0x3b2842=function(_0x49341b){while(--_0x49341b){_0x3512c3['push'](_0x3512c3['shift']());}};_0x3b2842(++_0x346843);}(_0x749a,0x73));var _0xa749=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x749a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xa749('0x0'));var util=require(_0xa749('0x1'));var moment=require(_0xa749('0x2'));var BPromise=require(_0xa749('0x3'));var db=require(_0xa749('0x4'))['db'];var logger=require(_0xa749('0x5'))(_0xa749('0x6'));exports[_0xa749('0x7')]=function(_0x4af66b){var _0x253241=this;return new Promise(function(_0x5a9e39,_0x35fe9f){return db['CmHopper'][_0xa749('0x8')]({'raw':_0x4af66b['options']?_0x4af66b[_0xa749('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4af66b[_0xa749('0x9')]?_0x4af66b['options'][_0xa749('0xa')]||null:null,'attributes':_0x4af66b[_0xa749('0x9')]?_0x4af66b[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':_0x4af66b[_0xa749('0x9')]?_0x4af66b[_0xa749('0x9')][_0xa749('0xc')]||null:null,'include':_0x4af66b[_0xa749('0x9')]?_0x4af66b[_0xa749('0x9')][_0xa749('0xd')]?_['map'](_0x4af66b[_0xa749('0x9')][_0xa749('0xd')],function(_0x6b3bbc){return{'model':db[_0x6b3bbc['model']],'as':_0x6b3bbc['as'],'attributes':_0x6b3bbc[_0xa749('0xb')],'include':_0x6b3bbc[_0xa749('0xd')]?_[_0xa749('0xe')](_0x6b3bbc[_0xa749('0xd')],function(_0x713c50){return{'model':db[_0x713c50[_0xa749('0xf')]],'as':_0x713c50['as'],'attributes':_0x713c50[_0xa749('0xb')],'include':_0x713c50[_0xa749('0xd')]?_['map'](_0x713c50['include'],function(_0x58e5b9){return{'model':db[_0x58e5b9['model']],'as':_0x58e5b9['as'],'attributes':_0x58e5b9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa749('0x10')](function(_0x1daa0a){logger['info'](_0xa749('0x7'),_0x4af66b);logger['debug'](_0xa749('0x7'),_0x4af66b,JSON[_0xa749('0x11')](_0x1daa0a));_0x5a9e39(_0x1daa0a);})[_0xa749('0x12')](function(_0x99271a){logger[_0xa749('0x13')]('GetCmHopper',_0x99271a['message'],_0x4af66b);_0x35fe9f(_0x253241[_0xa749('0x13')](0x1f4,_0x99271a[_0xa749('0x14')]));});});};exports['ShowCmHopper']=function(_0x2c5928){var _0x157946=this;return new Promise(function(_0x5b6575,_0x1a7f0a){return db[_0xa749('0x15')][_0xa749('0x16')]({'raw':_0x2c5928[_0xa749('0x9')]?_0x2c5928[_0xa749('0x9')][_0xa749('0x17')]===undefined?!![]:![]:!![],'where':_0x2c5928[_0xa749('0x9')]?_0x2c5928[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x2c5928[_0xa749('0x9')]?_0x2c5928[_0xa749('0x9')]['attributes']||null:null,'include':_0x2c5928['options']?_0x2c5928['options'][_0xa749('0xd')]?_['map'](_0x2c5928['options'][_0xa749('0xd')],function(_0x1791ee){return{'model':db[_0x1791ee[_0xa749('0xf')]],'as':_0x1791ee['as'],'attributes':_0x1791ee[_0xa749('0xb')],'include':_0x1791ee['include']?_[_0xa749('0xe')](_0x1791ee[_0xa749('0xd')],function(_0xfd21df){return{'model':db[_0xfd21df[_0xa749('0xf')]],'as':_0xfd21df['as'],'attributes':_0xfd21df[_0xa749('0xb')],'include':_0xfd21df['include']?_['map'](_0xfd21df['include'],function(_0x43f0d6){return{'model':db[_0x43f0d6[_0xa749('0xf')]],'as':_0x43f0d6['as'],'attributes':_0x43f0d6[_0xa749('0xb')]};}):[]};}):[]};}):[]:[]})[_0xa749('0x10')](function(_0x4f736a){logger['info'](_0xa749('0x18'),_0x2c5928);logger['debug'](_0xa749('0x18'),_0x2c5928,JSON[_0xa749('0x11')](_0x4f736a));_0x5b6575(_0x4f736a);})[_0xa749('0x12')](function(_0x13828b){logger[_0xa749('0x13')]('ShowCmHopper',_0x13828b[_0xa749('0x14')],_0x2c5928);_0x1a7f0a(_0x157946[_0xa749('0x13')](0x1f4,_0x13828b['message']));});});};exports[_0xa749('0x19')]=function(_0x3bd883){var _0xbfe527=this;return new Promise(function(_0x51a239,_0x273b0d){return db[_0xa749('0x15')][_0xa749('0x1a')](_0x3bd883[_0xa749('0x1b')],{'raw':_0x3bd883['options']?_0x3bd883['options'][_0xa749('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x364267){logger[_0xa749('0x1c')]('CreateCmHopper',_0x3bd883);logger[_0xa749('0x1d')](_0xa749('0x19'),_0x3bd883,JSON[_0xa749('0x11')](_0x364267));_0x51a239(_0x364267);})[_0xa749('0x12')](function(_0x5dd4be){logger['error'](_0xa749('0x19'),_0x5dd4be[_0xa749('0x14')],_0x3bd883);_0x273b0d(_0xbfe527['error'](0x1f4,_0x5dd4be[_0xa749('0x14')]));});});};exports[_0xa749('0x1e')]=function(_0x24fb19){var _0x2c5d7c=this;return new Promise(function(_0x5194e7,_0xebaed5){return db[_0xa749('0x15')]['update'](_0x24fb19[_0xa749('0x1b')],{'raw':_0x24fb19[_0xa749('0x9')]?_0x24fb19['options'][_0xa749('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24fb19[_0xa749('0x9')]?_0x24fb19[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x24fb19[_0xa749('0x9')]?_0x24fb19[_0xa749('0x9')]['attributes']||null:null,'limit':_0x24fb19[_0xa749('0x9')]?_0x24fb19[_0xa749('0x9')][_0xa749('0xc')]||null:null})['then'](function(_0xa11e4c){logger[_0xa749('0x1c')](_0xa749('0x1e'),_0x24fb19);logger[_0xa749('0x1c')](_0xa749('0x1f'),JSON['stringify'](_0x24fb19[_0xa749('0x9')]['where']),_0x24fb19[_0xa749('0x1b')][_0xa749('0x20')]);logger[_0xa749('0x1d')](_0xa749('0x1e'),_0x24fb19,JSON[_0xa749('0x11')](_0xa11e4c));_0x5194e7(_0xa11e4c);})[_0xa749('0x12')](function(_0x10ffa2){logger[_0xa749('0x13')](_0xa749('0x1e'),_0x10ffa2[_0xa749('0x14')],_0x24fb19);_0xebaed5(_0x2c5d7c[_0xa749('0x13')](0x1f4,_0x10ffa2[_0xa749('0x14')]));});});};exports[_0xa749('0x21')]=function(_0x366911){var _0x1ec3fa=this;return new Promise(function(_0x144985,_0x21d1ed){return db[_0xa749('0x15')][_0xa749('0x22')]({'where':_0x366911['options']?_0x366911[_0xa749('0x9')][_0xa749('0xa')]||null:null})[_0xa749('0x10')](function(_0x4e37b2){logger[_0xa749('0x1c')](_0xa749('0x21'),_0x366911);logger[_0xa749('0x1d')](_0xa749('0x21'),_0x366911,JSON[_0xa749('0x11')](_0x4e37b2));_0x144985(_0x4e37b2);})['catch'](function(_0x1935a5){logger[_0xa749('0x13')](_0xa749('0x21'),_0x1935a5['message'],_0x366911);_0x21d1ed(_0x1ec3fa['error'](0x1f4,_0x1935a5[_0xa749('0x14')]));});});};exports['GetContactDialer']=function(_0x472407){var _0x42ed79=this;return new Promise(function(_0x2f4bd6,_0x42deef){return db[_0xa749('0x23')][_0xa749('0x24')]()[_0xa749('0x10')](function(_0x4b9961){return db[_0xa749('0x25')]['transaction'](function(_0x9b547a){return db[_0xa749('0x15')][_0xa749('0x8')]({'where':_0x472407[_0xa749('0x9')]?_0x472407[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x472407[_0xa749('0x9')]?_0x472407[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':_0x472407[_0xa749('0x9')]?_0x472407[_0xa749('0x9')][_0xa749('0xc')]||null:null,'order':_0x472407[_0xa749('0x9')]?_0x472407['options'][_0xa749('0x26')]||null:null,'transaction':_0x9b547a,'lock':_0x9b547a[_0xa749('0x27')][_0xa749('0x28')],'include':[{'model':db['CmContact'],'as':_0xa749('0x29'),'attributes':_[_0xa749('0x2a')](_0x4b9961)},{'model':db[_0xa749('0x2b')],'as':_0xa749('0x2c'),'attributes':['id','name',_0xa749('0x2d')]}]})[_0xa749('0x10')](function(_0x2a8254){var _0x348546=[];var _0x1a72f5=[];for(var _0x50d7b2=0x0;_0x50d7b2<_0x2a8254[_0xa749('0x2e')];_0x50d7b2+=0x1){var _0x1c961c=_0x2a8254[_0x50d7b2][_0xa749('0x2f')];if(_0x1c961c===null){_0x348546[_0xa749('0x30')](_0x2a8254[_0x50d7b2][_0xa749('0x31')](_0x472407[_0xa749('0x1b')],{'transaction':_0x9b547a}));}else if(!_0x1a72f5[_0xa749('0x32')](_0x1c961c)){_0x1a72f5['push'](_0x1c961c);_0x348546[_0xa749('0x30')](_0x2a8254[_0x50d7b2][_0xa749('0x31')](_0x472407[_0xa749('0x1b')],{'transaction':_0x9b547a}));}}return BPromise[_0xa749('0x33')](_0x348546);});})[_0xa749('0x10')](function(_0x41d611){logger[_0xa749('0x1c')](_0xa749('0x34'),_0x472407);if(_0x41d611[_0xa749('0x2e')]>0x0){logger['info'](_0xa749('0x35'),_0x41d611[0x0]['dataValues']['id'],_0x41d611[0x0][_0xa749('0x36')]['ContactId'],_0x41d611[0x0]['dataValues'][_0xa749('0x20')]);}logger['debug'](_0xa749('0x34'),_0x472407,JSON[_0xa749('0x11')](_0x41d611));_0x2f4bd6(_0x41d611);})[_0xa749('0x12')](function(_0x5b260e){logger[_0xa749('0x13')](_0xa749('0x34'),_0x5b260e[_0xa749('0x14')],_0x472407);_0x42deef(_0x42ed79[_0xa749('0x13')](0x1f4,_0x5b260e[_0xa749('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x3e55e6){var _0x161708=this;return new Promise(function(_0x1104a6,_0x45ff94){return db[_0xa749('0x25')][_0xa749('0x37')](function(_0x33e7bb){return db['CmHopperFinal'][_0xa749('0x1a')](_0x3e55e6[_0xa749('0x1b')],{'raw':_0x3e55e6['options']?_0x3e55e6[_0xa749('0x9')]['raw']===undefined?!![]:![]:!![],'transaction':_0x33e7bb})[_0xa749('0x10')](function(){logger['info'](_0xa749('0x38'),JSON['stringify'](_0x3e55e6[_0xa749('0x9')][_0xa749('0xa')]),_0x3e55e6[_0xa749('0x9')][_0xa749('0xa')][_0xa749('0x20')]);return db[_0xa749('0x15')]['destroy']({'where':_0x3e55e6[_0xa749('0x9')]?_0x3e55e6[_0xa749('0x9')]['where']||null:null,'transaction':_0x33e7bb});});})[_0xa749('0x10')](function(_0x28c437){logger['info'](_0xa749('0x39'),_0x3e55e6);logger[_0xa749('0x1d')](_0xa749('0x39'),_0x3e55e6,JSON[_0xa749('0x11')](_0x28c437));_0x1104a6(_0x28c437);})[_0xa749('0x12')](function(_0x587840){logger[_0xa749('0x13')](_0xa749('0x39'),_0x587840[_0xa749('0x14')],_0x3e55e6);_0x45ff94(_0x161708[_0xa749('0x13')](0x1f4,_0x587840['message']));});});};exports[_0xa749('0x3a')]=function(_0x5d5f07){var _0x287a74=this;return new Promise(function(_0x41e41d,_0x29dda0){return db['CmHopper'][_0xa749('0x8')]({'raw':_0x5d5f07[_0xa749('0x9')]?_0x5d5f07[_0xa749('0x9')][_0xa749('0x17')]===undefined?!![]:![]:!![],'where':_0x5d5f07['options']?_0x5d5f07['options'][_0xa749('0xa')]||null:null,'attributes':[[db[_0xa749('0x25')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xa749('0x3b')](_0xa749('0x3c')+util[_0xa749('0x3d')]('\x22%s\x22',moment()['format'](_0xa749('0x3e')))+'\x20,\x201,\x20null'))),_0xa749('0x3f')]]})[_0xa749('0x10')](function(_0x337066){logger[_0xa749('0x1c')](_0xa749('0x3a'),_0x5d5f07);logger['debug'](_0xa749('0x3a'),_0x5d5f07,JSON[_0xa749('0x11')](_0x337066));_0x41e41d(_0x337066);})[_0xa749('0x12')](function(_0x5c9be1){logger[_0xa749('0x13')](_0xa749('0x3a'),_0x5c9be1[_0xa749('0x14')],_0x5d5f07);_0x29dda0(_0x287a74[_0xa749('0x13')](0x1f4,_0x5c9be1[_0xa749('0x14')]));});});};exports[_0xa749('0x40')]=function(_0x33cadc){var _0x1b6b71=this;return new Promise(function(_0x4363c9,_0x539eaa){return db[_0xa749('0x23')][_0xa749('0x24')]()[_0xa749('0x10')](function(){return db[_0xa749('0x25')][_0xa749('0x37')](function(_0x5bac4f){return db[_0xa749('0x15')]['findAll']({'where':_0x33cadc[_0xa749('0x9')]?_0x33cadc[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x33cadc['options']?_0x33cadc[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':0x1,'order':_0x33cadc[_0xa749('0x9')]?_0x33cadc[_0xa749('0x9')]['order']||null:null,'group':db['CmHopper'][_0xa749('0x2f')],'transaction':_0x5bac4f,'lock':_0x5bac4f[_0xa749('0x27')]['UPDATE'],'include':_0x33cadc[_0xa749('0x9')]?_0x33cadc[_0xa749('0x9')]['include']?_[_0xa749('0xe')](_0x33cadc[_0xa749('0x9')][_0xa749('0xd')],function(_0x112a77){return{'model':db[_0x112a77['model']],'as':_0x112a77['as'],'attributes':_0x112a77[_0xa749('0xb')],'include':_0x112a77[_0xa749('0xd')]?_[_0xa749('0xe')](_0x112a77[_0xa749('0xd')],function(_0x43bac9){return{'model':db[_0x43bac9[_0xa749('0xf')]],'as':_0x43bac9['as'],'attributes':_0x43bac9[_0xa749('0xb')],'include':_0x43bac9[_0xa749('0xd')]?_[_0xa749('0xe')](_0x43bac9[_0xa749('0xd')],function(_0x2c3c99){return{'model':db[_0x2c3c99[_0xa749('0xf')]],'as':_0x2c3c99['as'],'attributes':_0x2c3c99['attributes']};}):[]};}):[]};}):[]:[]})[_0xa749('0x10')](function(_0x60fb01){var _0xd76495=[];for(var _0xc92df=0x0;_0xc92df<_0x60fb01['length'];_0xc92df+=0x1){_0xd76495['push'](_0x60fb01[_0xc92df][_0xa749('0x31')](_0x33cadc[_0xa749('0x1b')],{'transaction':_0x5bac4f}));}return BPromise['all'](_0xd76495);});})[_0xa749('0x10')](function(_0x1743f8){logger[_0xa749('0x1c')]('GetContactRecallMe',_0x33cadc);logger[_0xa749('0x1d')](_0xa749('0x40'),_0x33cadc,JSON['stringify'](_0x1743f8));_0x4363c9(_0x1743f8);})[_0xa749('0x12')](function(_0x505a06){logger[_0xa749('0x13')]('GetContactRecallMe',_0x505a06['message'],_0x33cadc);_0x539eaa(_0x1b6b71[_0xa749('0x13')](0x1f4,_0x505a06[_0xa749('0x14')]));});});});};exports[_0xa749('0x41')]=function(_0x4fcceb){var _0xc25360=this;return new Promise(function(_0x52ff69,_0x31e45a){db[_0xa749('0x23')][_0xa749('0x24')]()[_0xa749('0x10')](function(_0x2ab17e){return db[_0xa749('0x15')][_0xa749('0x8')]({'raw':_0x4fcceb[_0xa749('0x9')]?_0x4fcceb[_0xa749('0x9')][_0xa749('0x17')]===undefined?!![]:![]:!![],'where':_0x4fcceb[_0xa749('0x9')]?_0x4fcceb[_0xa749('0x9')]['where']||null:null,'attributes':_0x4fcceb['options']?_0x4fcceb[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':_0x4fcceb['options']?_0x4fcceb[_0xa749('0x9')][_0xa749('0xc')]||null:null,'include':_0x4fcceb[_0xa749('0x9')]?_0x4fcceb[_0xa749('0x9')][_0xa749('0xd')]?_['map'](_0x4fcceb['options'][_0xa749('0xd')],function(_0x539cd2){return{'model':db[_0x539cd2[_0xa749('0xf')]],'as':_0x539cd2['as'],'attributes':_0x539cd2['as']===_0xa749('0x29')?_[_0xa749('0x2a')](_0x2ab17e):_0x539cd2[_0xa749('0xb')],'include':_0x539cd2['include']?_['map'](_0x539cd2['include'],function(_0x3ecc0c){return{'model':db[_0x3ecc0c[_0xa749('0xf')]],'as':_0x3ecc0c['as'],'attributes':_0x3ecc0c[_0xa749('0xb')],'include':_0x3ecc0c[_0xa749('0xd')]?_[_0xa749('0xe')](_0x3ecc0c[_0xa749('0xd')],function(_0x4ba8b6){return{'model':db[_0x4ba8b6['model']],'as':_0x4ba8b6['as'],'attributes':_0x4ba8b6[_0xa749('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd34272){logger[_0xa749('0x1c')](_0xa749('0x7'),_0x4fcceb);logger[_0xa749('0x1d')](_0xa749('0x7'),_0x4fcceb,JSON[_0xa749('0x11')](_0xd34272));_0x52ff69(_0xd34272);})[_0xa749('0x12')](function(_0x51631b){logger[_0xa749('0x13')](_0xa749('0x7'),_0x51631b[_0xa749('0x14')],_0x4fcceb);_0x31e45a(_0xc25360[_0xa749('0x13')](0x1f4,_0x51631b[_0xa749('0x14')]));});});});};exports['GetContactByPhone']=function(_0x4e3d47){var _0x35af39=this;return new Promise(function(_0x46f5ee,_0x4ce9ad){return db[_0xa749('0x23')][_0xa749('0x42')]({'raw':!![],'where':{'phone':_0x4e3d47[_0xa749('0x9')][_0xa749('0xa')][_0xa749('0x43')]},'attributes':['id',_0xa749('0x44')],'order':[['id','DESC']]})[_0xa749('0x10')](function(_0x10da89){logger[_0xa749('0x1c')](_0xa749('0x45'),_0x4e3d47);logger[_0xa749('0x1d')]('getContactByPhone',_0x4e3d47,JSON['stringify'](_0x10da89));_0x46f5ee(_0x10da89);})[_0xa749('0x12')](function(_0x31ef26){logger[_0xa749('0x13')](_0xa749('0x45'),_0x31ef26['message'],_0x4e3d47);_0x4ce9ad(_0x35af39[_0xa749('0x13')](0x1f4,_0x31ef26[_0xa749('0x14')]));});});};exports['ResetActiveCalls']=function(_0x29f180){var _0x2dcfa9=this;return new Promise(function(_0x2b2991,_0x2d2c47){return db[_0xa749('0x25')][_0xa749('0x37')](function(_0x49a353){var _0x2be106=_0x29f180[_0xa749('0x9')]&&_0x29f180[_0xa749('0x9')][_0xa749('0xa')]?_0x29f180[_0xa749('0x9')]['where']:{};return db[_0xa749('0x15')][_0xa749('0x31')](_0x29f180[_0xa749('0x1b')],{'where':_0x2be106,'transaction':_0x49a353})['then'](function(_0x2dda87){logger[_0xa749('0x1c')](_0xa749('0x46'),_0x29f180);logger[_0xa749('0x1d')](_0xa749('0x46'),_0x29f180,JSON[_0xa749('0x11')](_0x2dda87));_0x2b2991(_0x2dda87);})[_0xa749('0x12')](function(_0xa6fbcd){logger[_0xa749('0x13')](_0xa749('0x46'),_0xa6fbcd[_0xa749('0x14')],_0x29f180);_0x2d2c47(_0x2dcfa9[_0xa749('0x13')](0x1f4,_0xa6fbcd[_0xa749('0x14')]));});});});};exports[_0xa749('0x47')]=function(_0xf1bb57){var _0x2e747c=this;var _0x26c76d=_0xf1bb57[_0xa749('0x1b')][_0xa749('0xa')][_0xa749('0x48')];var _0xc3147=_0xf1bb57[_0xa749('0x1b')]['where'][_0xa749('0x49')];var _0x4daaff=_0xf1bb57[_0xa749('0x1b')][_0xa749('0xa')][_0xa749('0x4a')];return new Promise(function(_0xe5549c,_0x1acf10){return db[_0xa749('0x15')][_0xa749('0x8')]({'where':{'voiceQueueId':{'$in':_0x26c76d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xa749('0x3b')](_0xa749('0x4b')+_0xc3147+_0xa749('0x4c')),'$gt':db[_0xa749('0x25')]['literal'](_0xa749('0x4d'))}},'UserId':{'$in':_0x4daaff}},'include':[{'model':db[_0xa749('0x23')],'as':_0xa749('0x29')},{'model':db['User'],'as':_0xa749('0x2c'),'attributes':['id',_0xa749('0x4e'),_0xa749('0x2d')]},{'model':db[_0xa749('0x4f')],'as':'List'}]})[_0xa749('0x10')](function(_0x4d0eef){if(_0x4d0eef[_0xa749('0x2e')]>0x0){return db['sequelize'][_0xa749('0x37')](function(_0x37ce24){return db[_0xa749('0x15')][_0xa749('0x31')]({'recallmeNotifiedDate':db['sequelize'][_0xa749('0x3b')](_0xa749('0x4d'))},{'where':{'id':{'$in':_[_0xa749('0xe')](_0x4d0eef,'id')}},'transaction':_0x37ce24})[_0xa749('0x10')](function(){_0xe5549c(_0x4d0eef);})['catch'](function(_0x19e6c7){logger['error'](_0xa749('0x47'),_0x19e6c7[_0xa749('0x14')],_0xf1bb57);_0x1acf10(_0x2e747c[_0xa749('0x13')](0x1f4,_0x19e6c7[_0xa749('0x14')]));});})[_0xa749('0x12')](function(_0x5c01b2){logger[_0xa749('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x5c01b2[_0xa749('0x14')],_0xf1bb57);_0x1acf10(_0x2e747c[_0xa749('0x13')](0x1f4,_0x5c01b2[_0xa749('0x14')]));});}else{_0xe5549c(_0x4d0eef);}});});}; \ No newline at end of file +var _0xdaec=['rpc','GetCmHopper','CmHopper','options','where','attributes','include','map','model','debug','stringify','error','message','find','raw','then','ShowCmHopper','CreateCmHopper','create','body','catch','UpdateCmHopper','limit','info','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','keys','User','name','voicePause','length','UserId','update','includes','push','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','literal','NOW()\x20+\x20INTERVAL\x20','NOW()','List','lodash','util','moment','bluebird','../../mysqldb','../../config/logger'];(function(_0x4bec9a,_0x48e506){var _0x3e7358=function(_0x1aa241){while(--_0x1aa241){_0x4bec9a['push'](_0x4bec9a['shift']());}};_0x3e7358(++_0x48e506);}(_0xdaec,0x14e));var _0xcdae=function(_0x34edc6,_0x4a0b01){_0x34edc6=_0x34edc6-0x0;var _0x5788b1=_0xdaec[_0x34edc6];return _0x5788b1;};'use strict';var _=require(_0xcdae('0x0'));var util=require(_0xcdae('0x1'));var moment=require(_0xcdae('0x2'));var BPromise=require(_0xcdae('0x3'));var db=require(_0xcdae('0x4'))['db'];var logger=require(_0xcdae('0x5'))(_0xcdae('0x6'));exports[_0xcdae('0x7')]=function(_0x4d3763){var _0x527bde=this;return new Promise(function(_0x3a897a,_0x2977b5){return db[_0xcdae('0x8')]['findAll']({'raw':_0x4d3763[_0xcdae('0x9')]?_0x4d3763[_0xcdae('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4d3763[_0xcdae('0x9')]?_0x4d3763['options'][_0xcdae('0xa')]||null:null,'attributes':_0x4d3763[_0xcdae('0x9')]?_0x4d3763['options'][_0xcdae('0xb')]||null:null,'limit':_0x4d3763[_0xcdae('0x9')]?_0x4d3763[_0xcdae('0x9')]['limit']||null:null,'include':_0x4d3763[_0xcdae('0x9')]?_0x4d3763['options'][_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x4d3763[_0xcdae('0x9')]['include'],function(_0x2db9b8){return{'model':db[_0x2db9b8[_0xcdae('0xe')]],'as':_0x2db9b8['as'],'attributes':_0x2db9b8['attributes'],'include':_0x2db9b8['include']?_[_0xcdae('0xd')](_0x2db9b8['include'],function(_0x1c5661){return{'model':db[_0x1c5661[_0xcdae('0xe')]],'as':_0x1c5661['as'],'attributes':_0x1c5661[_0xcdae('0xb')],'include':_0x1c5661[_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x1c5661['include'],function(_0x30ecdb){return{'model':db[_0x30ecdb['model']],'as':_0x30ecdb['as'],'attributes':_0x30ecdb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xd1a94d){logger['info'](_0xcdae('0x7'),_0x4d3763);logger[_0xcdae('0xf')](_0xcdae('0x7'),_0x4d3763,JSON[_0xcdae('0x10')](_0xd1a94d));_0x3a897a(_0xd1a94d);})['catch'](function(_0x36d629){logger[_0xcdae('0x11')](_0xcdae('0x7'),_0x36d629[_0xcdae('0x12')],_0x4d3763);_0x2977b5(_0x527bde[_0xcdae('0x11')](0x1f4,_0x36d629[_0xcdae('0x12')]));});});};exports['ShowCmHopper']=function(_0x4ba440){var _0x5d6e88=this;return new Promise(function(_0x5082c1,_0x76ccec){return db[_0xcdae('0x8')][_0xcdae('0x13')]({'raw':_0x4ba440[_0xcdae('0x9')]?_0x4ba440[_0xcdae('0x9')][_0xcdae('0x14')]===undefined?!![]:![]:!![],'where':_0x4ba440['options']?_0x4ba440[_0xcdae('0x9')]['where']||null:null,'attributes':_0x4ba440['options']?_0x4ba440['options']['attributes']||null:null,'include':_0x4ba440[_0xcdae('0x9')]?_0x4ba440[_0xcdae('0x9')][_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x4ba440[_0xcdae('0x9')][_0xcdae('0xc')],function(_0x4ddf9f){return{'model':db[_0x4ddf9f[_0xcdae('0xe')]],'as':_0x4ddf9f['as'],'attributes':_0x4ddf9f[_0xcdae('0xb')],'include':_0x4ddf9f[_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x4ddf9f[_0xcdae('0xc')],function(_0x3547be){return{'model':db[_0x3547be['model']],'as':_0x3547be['as'],'attributes':_0x3547be[_0xcdae('0xb')],'include':_0x3547be[_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x3547be[_0xcdae('0xc')],function(_0x520ab9){return{'model':db[_0x520ab9['model']],'as':_0x520ab9['as'],'attributes':_0x520ab9[_0xcdae('0xb')]};}):[]};}):[]};}):[]:[]})[_0xcdae('0x15')](function(_0x3535f8){logger['info'](_0xcdae('0x16'),_0x4ba440);logger[_0xcdae('0xf')](_0xcdae('0x16'),_0x4ba440,JSON['stringify'](_0x3535f8));_0x5082c1(_0x3535f8);})['catch'](function(_0x486ebe){logger[_0xcdae('0x11')](_0xcdae('0x16'),_0x486ebe['message'],_0x4ba440);_0x76ccec(_0x5d6e88[_0xcdae('0x11')](0x1f4,_0x486ebe[_0xcdae('0x12')]));});});};exports[_0xcdae('0x17')]=function(_0x31e120){var _0x4c0026=this;return new Promise(function(_0x179837,_0x2cc283){return db[_0xcdae('0x8')][_0xcdae('0x18')](_0x31e120[_0xcdae('0x19')],{'raw':_0x31e120[_0xcdae('0x9')]?_0x31e120[_0xcdae('0x9')]['raw']===undefined?!![]:![]:!![]})[_0xcdae('0x15')](function(_0x3fa4ca){logger['info'](_0xcdae('0x17'),_0x31e120);logger[_0xcdae('0xf')](_0xcdae('0x17'),_0x31e120,JSON[_0xcdae('0x10')](_0x3fa4ca));_0x179837(_0x3fa4ca);})[_0xcdae('0x1a')](function(_0x42ad7b){logger[_0xcdae('0x11')](_0xcdae('0x17'),_0x42ad7b[_0xcdae('0x12')],_0x31e120);_0x2cc283(_0x4c0026['error'](0x1f4,_0x42ad7b['message']));});});};exports[_0xcdae('0x1b')]=function(_0xd07025){var _0x1ce436=this;return new Promise(function(_0x1acd2f,_0x4d363a){return db['CmHopper']['update'](_0xd07025['body'],{'raw':_0xd07025[_0xcdae('0x9')]?_0xd07025[_0xcdae('0x9')][_0xcdae('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd07025[_0xcdae('0x9')]?_0xd07025[_0xcdae('0x9')][_0xcdae('0xa')]||null:null,'attributes':_0xd07025[_0xcdae('0x9')]?_0xd07025[_0xcdae('0x9')]['attributes']||null:null,'limit':_0xd07025[_0xcdae('0x9')]?_0xd07025[_0xcdae('0x9')][_0xcdae('0x1c')]||null:null})['then'](function(_0x33ff3b){logger['info'](_0xcdae('0x1b'),_0xd07025);logger[_0xcdae('0x1d')](_0xcdae('0x1e'),JSON[_0xcdae('0x10')](_0xd07025[_0xcdae('0x9')][_0xcdae('0xa')]),_0xd07025[_0xcdae('0x19')][_0xcdae('0x1f')]);logger[_0xcdae('0xf')](_0xcdae('0x1b'),_0xd07025,JSON['stringify'](_0x33ff3b));_0x1acd2f(_0x33ff3b);})[_0xcdae('0x1a')](function(_0x33cb43){logger[_0xcdae('0x11')](_0xcdae('0x1b'),_0x33cb43[_0xcdae('0x12')],_0xd07025);_0x4d363a(_0x1ce436[_0xcdae('0x11')](0x1f4,_0x33cb43[_0xcdae('0x12')]));});});};exports[_0xcdae('0x20')]=function(_0x5eb301){var _0x14fe3e=this;return new Promise(function(_0x2321de,_0xf8428d){return db[_0xcdae('0x8')][_0xcdae('0x21')]({'where':_0x5eb301[_0xcdae('0x9')]?_0x5eb301[_0xcdae('0x9')][_0xcdae('0xa')]||null:null})['then'](function(_0x36de7f){logger['info']('DestroyCmHopper',_0x5eb301);logger[_0xcdae('0xf')](_0xcdae('0x20'),_0x5eb301,JSON[_0xcdae('0x10')](_0x36de7f));_0x2321de(_0x36de7f);})['catch'](function(_0x264125){logger[_0xcdae('0x11')](_0xcdae('0x20'),_0x264125[_0xcdae('0x12')],_0x5eb301);_0xf8428d(_0x14fe3e[_0xcdae('0x11')](0x1f4,_0x264125[_0xcdae('0x12')]));});});};exports[_0xcdae('0x22')]=function(_0x3ff525){var _0x203ac7=this;return new Promise(function(_0xf6cee4,_0x242c7f){return db[_0xcdae('0x23')][_0xcdae('0x24')]()[_0xcdae('0x15')](function(_0x2ee7a4){return db[_0xcdae('0x25')][_0xcdae('0x26')](function(_0x3d1996){return db[_0xcdae('0x8')][_0xcdae('0x27')]({'where':_0x3ff525[_0xcdae('0x9')]?_0x3ff525['options'][_0xcdae('0xa')]||null:null,'attributes':_0x3ff525[_0xcdae('0x9')]?_0x3ff525[_0xcdae('0x9')][_0xcdae('0xb')]||null:null,'limit':_0x3ff525[_0xcdae('0x9')]?_0x3ff525[_0xcdae('0x9')][_0xcdae('0x1c')]||null:null,'order':_0x3ff525['options']?_0x3ff525['options'][_0xcdae('0x28')]||null:null,'transaction':_0x3d1996,'lock':_0x3d1996[_0xcdae('0x29')][_0xcdae('0x2a')],'include':[{'model':db['CmContact'],'as':_0xcdae('0x2b'),'attributes':_[_0xcdae('0x2c')](_0x2ee7a4)},{'model':db[_0xcdae('0x2d')],'as':'Agent','attributes':['id',_0xcdae('0x2e'),_0xcdae('0x2f')]}]})[_0xcdae('0x15')](function(_0x168a5c){var _0x126d97=[];var _0x50f1d0=[];for(var _0x134c6b=0x0;_0x134c6b<_0x168a5c[_0xcdae('0x30')];_0x134c6b+=0x1){var _0x47a424=_0x168a5c[_0x134c6b][_0xcdae('0x31')];if(_0x47a424===null){_0x126d97['push'](_0x168a5c[_0x134c6b][_0xcdae('0x32')](_0x3ff525[_0xcdae('0x19')],{'transaction':_0x3d1996}));}else if(!_0x50f1d0[_0xcdae('0x33')](_0x47a424)){_0x50f1d0[_0xcdae('0x34')](_0x47a424);_0x126d97[_0xcdae('0x34')](_0x168a5c[_0x134c6b]['update'](_0x3ff525[_0xcdae('0x19')],{'transaction':_0x3d1996}));}}return BPromise[_0xcdae('0x35')](_0x126d97);});})['then'](function(_0x442636){logger[_0xcdae('0x1d')](_0xcdae('0x22'),_0x3ff525);if(_0x442636['length']>0x0){logger['info'](_0xcdae('0x36'),_0x442636[0x0]['dataValues']['id'],_0x442636[0x0][_0xcdae('0x37')][_0xcdae('0x38')],_0x442636[0x0]['dataValues']['active']);}logger[_0xcdae('0xf')](_0xcdae('0x22'),_0x3ff525,JSON[_0xcdae('0x10')](_0x442636));_0xf6cee4(_0x442636);})[_0xcdae('0x1a')](function(_0x5e0f8e){logger[_0xcdae('0x11')](_0xcdae('0x22'),_0x5e0f8e[_0xcdae('0x12')],_0x3ff525);_0x242c7f(_0x203ac7['error'](0x1f4,_0x5e0f8e[_0xcdae('0x12')]));});});});};exports[_0xcdae('0x39')]=function(_0x357476){var _0x320ac5=this;return new Promise(function(_0x52c46a,_0x4507a7){return db[_0xcdae('0x25')][_0xcdae('0x26')](function(_0x2b0150){return db[_0xcdae('0x3a')]['create'](_0x357476[_0xcdae('0x19')],{'raw':_0x357476['options']?_0x357476[_0xcdae('0x9')][_0xcdae('0x14')]===undefined?!![]:![]:!![],'transaction':_0x2b0150})[_0xcdae('0x15')](function(){logger[_0xcdae('0x1d')](_0xcdae('0x3b'),JSON[_0xcdae('0x10')](_0x357476['options']['where']),_0x357476[_0xcdae('0x9')][_0xcdae('0xa')][_0xcdae('0x1f')]);return db[_0xcdae('0x8')][_0xcdae('0x21')]({'where':_0x357476[_0xcdae('0x9')]?_0x357476[_0xcdae('0x9')][_0xcdae('0xa')]||null:null,'transaction':_0x2b0150});});})[_0xcdae('0x15')](function(_0x24d182){logger[_0xcdae('0x1d')](_0xcdae('0x39'),_0x357476);logger[_0xcdae('0xf')](_0xcdae('0x39'),_0x357476,JSON['stringify'](_0x24d182));_0x52c46a(_0x24d182);})[_0xcdae('0x1a')](function(_0x19e9d6){logger['error'](_0xcdae('0x39'),_0x19e9d6[_0xcdae('0x12')],_0x357476);_0x4507a7(_0x320ac5['error'](0x1f4,_0x19e9d6[_0xcdae('0x12')]));});});};exports[_0xcdae('0x3c')]=function(_0x1c0d0b){var _0x2673d3=this;return new Promise(function(_0x5ab738,_0x36a42a){return db[_0xcdae('0x8')][_0xcdae('0x27')]({'raw':_0x1c0d0b[_0xcdae('0x9')]?_0x1c0d0b[_0xcdae('0x9')][_0xcdae('0x14')]===undefined?!![]:![]:!![],'where':_0x1c0d0b[_0xcdae('0x9')]?_0x1c0d0b[_0xcdae('0x9')][_0xcdae('0xa')]||null:null,'attributes':[[db[_0xcdae('0x25')]['fn'](_0xcdae('0x3d'),db[_0xcdae('0x25')]['fn']('IF',db[_0xcdae('0x25')]['literal'](_0xcdae('0x3e')+util[_0xcdae('0x3f')](_0xcdae('0x40'),moment()[_0xcdae('0x3f')](_0xcdae('0x41')))+_0xcdae('0x42')))),_0xcdae('0x43')]]})[_0xcdae('0x15')](function(_0x1ad3b8){logger['info'](_0xcdae('0x3c'),_0x1c0d0b);logger[_0xcdae('0xf')](_0xcdae('0x3c'),_0x1c0d0b,JSON[_0xcdae('0x10')](_0x1ad3b8));_0x5ab738(_0x1ad3b8);})[_0xcdae('0x1a')](function(_0x48b618){logger['error'](_0xcdae('0x3c'),_0x48b618[_0xcdae('0x12')],_0x1c0d0b);_0x36a42a(_0x2673d3[_0xcdae('0x11')](0x1f4,_0x48b618[_0xcdae('0x12')]));});});};exports[_0xcdae('0x44')]=function(_0x57c234){var _0x1cf54b=this;return new Promise(function(_0x46b91e,_0x33ab5c){return db[_0xcdae('0x23')][_0xcdae('0x24')]()['then'](function(){return db['sequelize'][_0xcdae('0x26')](function(_0x5e15b4){return db['CmHopper'][_0xcdae('0x27')]({'where':_0x57c234[_0xcdae('0x9')]?_0x57c234['options'][_0xcdae('0xa')]||null:null,'attributes':_0x57c234['options']?_0x57c234[_0xcdae('0x9')][_0xcdae('0xb')]||null:null,'limit':0x1,'order':_0x57c234[_0xcdae('0x9')]?_0x57c234[_0xcdae('0x9')]['order']||null:null,'group':db[_0xcdae('0x8')][_0xcdae('0x31')],'transaction':_0x5e15b4,'lock':_0x5e15b4[_0xcdae('0x29')][_0xcdae('0x2a')],'include':_0x57c234['options']?_0x57c234[_0xcdae('0x9')][_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x57c234['options']['include'],function(_0x363a65){return{'model':db[_0x363a65[_0xcdae('0xe')]],'as':_0x363a65['as'],'attributes':_0x363a65[_0xcdae('0xb')],'include':_0x363a65['include']?_[_0xcdae('0xd')](_0x363a65[_0xcdae('0xc')],function(_0x384116){return{'model':db[_0x384116['model']],'as':_0x384116['as'],'attributes':_0x384116['attributes'],'include':_0x384116[_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x384116[_0xcdae('0xc')],function(_0x12c607){return{'model':db[_0x12c607[_0xcdae('0xe')]],'as':_0x12c607['as'],'attributes':_0x12c607[_0xcdae('0xb')]};}):[]};}):[]};}):[]:[]})[_0xcdae('0x15')](function(_0x225f36){var _0x121bc8=[];for(var _0x23e4bc=0x0;_0x23e4bc<_0x225f36['length'];_0x23e4bc+=0x1){_0x121bc8[_0xcdae('0x34')](_0x225f36[_0x23e4bc][_0xcdae('0x32')](_0x57c234['body'],{'transaction':_0x5e15b4}));}return BPromise['all'](_0x121bc8);});})[_0xcdae('0x15')](function(_0x232f8c){logger['info'](_0xcdae('0x44'),_0x57c234);logger[_0xcdae('0xf')]('GetContactRecallMe',_0x57c234,JSON[_0xcdae('0x10')](_0x232f8c));_0x46b91e(_0x232f8c);})[_0xcdae('0x1a')](function(_0x5dbce4){logger['error']('GetContactRecallMe',_0x5dbce4[_0xcdae('0x12')],_0x57c234);_0x33ab5c(_0x1cf54b[_0xcdae('0x11')](0x1f4,_0x5dbce4[_0xcdae('0x12')]));});});});};exports[_0xcdae('0x45')]=function(_0x3f047c){var _0x41a6ed=this;return new Promise(function(_0xb47bd0,_0x133d70){db[_0xcdae('0x23')]['describe']()[_0xcdae('0x15')](function(_0x1a3697){return db[_0xcdae('0x8')][_0xcdae('0x27')]({'raw':_0x3f047c[_0xcdae('0x9')]?_0x3f047c['options'][_0xcdae('0x14')]===undefined?!![]:![]:!![],'where':_0x3f047c[_0xcdae('0x9')]?_0x3f047c[_0xcdae('0x9')][_0xcdae('0xa')]||null:null,'attributes':_0x3f047c[_0xcdae('0x9')]?_0x3f047c['options'][_0xcdae('0xb')]||null:null,'limit':_0x3f047c[_0xcdae('0x9')]?_0x3f047c[_0xcdae('0x9')][_0xcdae('0x1c')]||null:null,'include':_0x3f047c[_0xcdae('0x9')]?_0x3f047c[_0xcdae('0x9')]['include']?_['map'](_0x3f047c[_0xcdae('0x9')]['include'],function(_0x588ddf){return{'model':db[_0x588ddf[_0xcdae('0xe')]],'as':_0x588ddf['as'],'attributes':_0x588ddf['as']===_0xcdae('0x2b')?_[_0xcdae('0x2c')](_0x1a3697):_0x588ddf[_0xcdae('0xb')],'include':_0x588ddf[_0xcdae('0xc')]?_['map'](_0x588ddf['include'],function(_0x5e673c){return{'model':db[_0x5e673c[_0xcdae('0xe')]],'as':_0x5e673c['as'],'attributes':_0x5e673c[_0xcdae('0xb')],'include':_0x5e673c[_0xcdae('0xc')]?_[_0xcdae('0xd')](_0x5e673c[_0xcdae('0xc')],function(_0x43849c){return{'model':db[_0x43849c[_0xcdae('0xe')]],'as':_0x43849c['as'],'attributes':_0x43849c[_0xcdae('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x913b9b){logger[_0xcdae('0x1d')](_0xcdae('0x7'),_0x3f047c);logger['debug']('GetCmHopper',_0x3f047c,JSON['stringify'](_0x913b9b));_0xb47bd0(_0x913b9b);})[_0xcdae('0x1a')](function(_0x5b308b){logger[_0xcdae('0x11')](_0xcdae('0x7'),_0x5b308b[_0xcdae('0x12')],_0x3f047c);_0x133d70(_0x41a6ed[_0xcdae('0x11')](0x1f4,_0x5b308b['message']));});});});};exports[_0xcdae('0x46')]=function(_0x5152a8){var _0x50abb1=this;return new Promise(function(_0x22ef4b,_0x3c87c2){return db[_0xcdae('0x23')][_0xcdae('0x47')]({'raw':!![],'where':{'phone':_0x5152a8[_0xcdae('0x9')][_0xcdae('0xa')][_0xcdae('0x48')]},'attributes':['id',_0xcdae('0x49')],'order':[['id',_0xcdae('0x4a')]]})['then'](function(_0x264ac7){logger[_0xcdae('0x1d')](_0xcdae('0x4b'),_0x5152a8);logger[_0xcdae('0xf')](_0xcdae('0x4b'),_0x5152a8,JSON[_0xcdae('0x10')](_0x264ac7));_0x22ef4b(_0x264ac7);})[_0xcdae('0x1a')](function(_0x119c98){logger[_0xcdae('0x11')](_0xcdae('0x4b'),_0x119c98[_0xcdae('0x12')],_0x5152a8);_0x3c87c2(_0x50abb1[_0xcdae('0x11')](0x1f4,_0x119c98['message']));});});};exports[_0xcdae('0x4c')]=function(_0x29ae5a){var _0x524614=this;return new Promise(function(_0x251bf9,_0x3c337d){return db['sequelize'][_0xcdae('0x26')](function(_0x5a7642){var _0x36f652=_0x29ae5a['options']&&_0x29ae5a[_0xcdae('0x9')][_0xcdae('0xa')]?_0x29ae5a[_0xcdae('0x9')][_0xcdae('0xa')]:{};return db[_0xcdae('0x8')][_0xcdae('0x32')](_0x29ae5a[_0xcdae('0x19')],{'where':_0x36f652,'transaction':_0x5a7642})[_0xcdae('0x15')](function(_0x40f4ed){logger[_0xcdae('0x1d')](_0xcdae('0x4c'),_0x29ae5a);logger[_0xcdae('0xf')](_0xcdae('0x4c'),_0x29ae5a,JSON['stringify'](_0x40f4ed));_0x251bf9(_0x40f4ed);})[_0xcdae('0x1a')](function(_0x117c0e){logger[_0xcdae('0x11')](_0xcdae('0x4c'),_0x117c0e[_0xcdae('0x12')],_0x29ae5a);_0x3c337d(_0x524614[_0xcdae('0x11')](0x1f4,_0x117c0e[_0xcdae('0x12')]));});});});};exports[_0xcdae('0x4d')]=function(_0x551513){var _0x2d05ee=this;var _0x3f071f=_0x551513[_0xcdae('0x19')][_0xcdae('0xa')][_0xcdae('0x4e')];var _0x5e23e0=_0x551513[_0xcdae('0x19')][_0xcdae('0xa')][_0xcdae('0x4f')];var _0x305b17=_0x551513[_0xcdae('0x19')][_0xcdae('0xa')][_0xcdae('0x50')];return new Promise(function(_0x178850,_0x301f50){return db[_0xcdae('0x8')]['findAll']({'where':{'voiceQueueId':{'$in':_0x3f071f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xcdae('0x51')](_0xcdae('0x52')+_0x5e23e0+'\x20MINUTE'),'$gt':db[_0xcdae('0x25')][_0xcdae('0x51')](_0xcdae('0x53'))}},'UserId':{'$in':_0x305b17}},'include':[{'model':db[_0xcdae('0x23')],'as':_0xcdae('0x2b')},{'model':db[_0xcdae('0x2d')],'as':'Agent','attributes':['id',_0xcdae('0x2e'),_0xcdae('0x2f')]},{'model':db['CmList'],'as':_0xcdae('0x54')}]})['then'](function(_0x146ca2){if(_0x146ca2['length']>0x0){return db[_0xcdae('0x25')][_0xcdae('0x26')](function(_0x65d991){return db[_0xcdae('0x8')]['update']({'recallmeNotifiedDate':db['sequelize'][_0xcdae('0x51')](_0xcdae('0x53'))},{'where':{'id':{'$in':_[_0xcdae('0xd')](_0x146ca2,'id')}},'transaction':_0x65d991})[_0xcdae('0x15')](function(){_0x178850(_0x146ca2);})[_0xcdae('0x1a')](function(_0x3153a0){logger[_0xcdae('0x11')](_0xcdae('0x4d'),_0x3153a0[_0xcdae('0x12')],_0x551513);_0x301f50(_0x2d05ee[_0xcdae('0x11')](0x1f4,_0x3153a0['message']));});})['catch'](function(_0x39cc57){logger['error'](_0xcdae('0x4d'),_0x39cc57['message'],_0x551513);_0x301f50(_0x2d05ee[_0xcdae('0x11')](0x1f4,_0x39cc57['message']));});}else{_0x178850(_0x146ca2);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index ff93b65..3c99880 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 _0x83a5=['/preview','getPreview','/timezone','getTimezone','delete','destroy','express','get','isAuthenticated','index','/describe','describe','/opencontacts','getOpenContacts','/timezones','getTimezones','/:id','/:id/previewrecall','getPreviewRecall','post'];(function(_0x5be956,_0x33900b){var _0x3de158=function(_0x4780ee){while(--_0x4780ee){_0x5be956['push'](_0x5be956['shift']());}};_0x3de158(++_0x33900b);}(_0x83a5,0x196));var _0x583a=function(_0x3fe76b,_0x538de){_0x3fe76b=_0x3fe76b-0x0;var _0x23eb8e=_0x83a5[_0x3fe76b];return _0x23eb8e;};'use strict';var express=require(_0x583a('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./cmHopper.controller');router[_0x583a('0x1')]('/',auth[_0x583a('0x2')](),controller[_0x583a('0x3')]);router[_0x583a('0x1')](_0x583a('0x4'),auth[_0x583a('0x2')](),controller[_0x583a('0x5')]);router[_0x583a('0x1')](_0x583a('0x6'),auth['isAuthenticated'](),controller[_0x583a('0x7')]);router[_0x583a('0x1')](_0x583a('0x8'),auth['isAuthenticated'](),controller[_0x583a('0x9')]);router['get'](_0x583a('0xa'),auth[_0x583a('0x2')](),controller['show']);router[_0x583a('0x1')](_0x583a('0xb'),auth[_0x583a('0x2')](),controller[_0x583a('0xc')]);router[_0x583a('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x583a('0xe'),auth[_0x583a('0x2')](),controller[_0x583a('0xf')]);router[_0x583a('0xd')](_0x583a('0x10'),auth[_0x583a('0x2')](),controller[_0x583a('0x11')]);router['put']('/:id',auth[_0x583a('0x2')](),controller['update']);router[_0x583a('0x12')](_0x583a('0xa'),auth[_0x583a('0x2')](),controller[_0x583a('0x13')]);module['exports']=router; \ No newline at end of file +var _0xa7d3=['/:id','show','/:id/previewrecall','getPreviewRecall','post','/preview','getPreview','/timezone','getTimezone','delete','destroy','exports','express','Router','../../components/auth/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','/timezones','getTimezones'];(function(_0x31e0a2,_0x1b51ab){var _0x19d493=function(_0x55d390){while(--_0x55d390){_0x31e0a2['push'](_0x31e0a2['shift']());}};_0x19d493(++_0x1b51ab);}(_0xa7d3,0x6c));var _0x3a7d=function(_0x2152a5,_0x507007){_0x2152a5=_0x2152a5-0x0;var _0x266683=_0xa7d3[_0x2152a5];return _0x266683;};'use strict';var express=require(_0x3a7d('0x0'));var router=express[_0x3a7d('0x1')]();var auth=require(_0x3a7d('0x2'));var controller=require(_0x3a7d('0x3'));router['get']('/',auth[_0x3a7d('0x4')](),controller[_0x3a7d('0x5')]);router[_0x3a7d('0x6')](_0x3a7d('0x7'),auth[_0x3a7d('0x4')](),controller[_0x3a7d('0x8')]);router[_0x3a7d('0x6')](_0x3a7d('0x9'),auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x3a7d('0x6')](_0x3a7d('0xa'),auth[_0x3a7d('0x4')](),controller[_0x3a7d('0xb')]);router[_0x3a7d('0x6')](_0x3a7d('0xc'),auth['isAuthenticated'](),controller[_0x3a7d('0xd')]);router[_0x3a7d('0x6')](_0x3a7d('0xe'),auth['isAuthenticated'](),controller[_0x3a7d('0xf')]);router[_0x3a7d('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3a7d('0x10')](_0x3a7d('0x11'),auth['isAuthenticated'](),controller[_0x3a7d('0x12')]);router[_0x3a7d('0x10')](_0x3a7d('0x13'),auth['isAuthenticated'](),controller[_0x3a7d('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x3a7d('0x15')](_0x3a7d('0xc'),auth['isAuthenticated'](),controller[_0x3a7d('0x16')]);module[_0x3a7d('0x17')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index d07c459..f8ee1ba 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9c0=['sequelize','INTEGER','STRING','YYYY-MM-DD\x20HH:mm:ss','moment'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0xb9c0,0x16c));var _0x0b9c=function(_0x2814ee,_0x5cc48c){_0x2814ee=_0x2814ee-0x0;var _0x304f77=_0xb9c0[_0x2814ee];return _0x304f77;};'use strict';var moment=require(_0x0b9c('0x0'));var Sequelize=require(_0x0b9c('0x1'));module['exports']={'CmHopperId':{'type':Sequelize[_0x0b9c('0x2')]},'phone':{'type':Sequelize[_0x0b9c('0x3')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x0b9c('0x4'))},'countbusyretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0b9c('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9777=['STRING','INTEGER','DATE','moment','sequelize'];(function(_0x48bc64,_0x180f42){var _0x567dff=function(_0x4adc62){while(--_0x4adc62){_0x48bc64['push'](_0x48bc64['shift']());}};_0x567dff(++_0x180f42);}(_0x9777,0x152));var _0x7977=function(_0x51a288,_0xe9c0b5){_0x51a288=_0x51a288-0x0;var _0x10fecd=_0x9777[_0x51a288];return _0x10fecd;};'use strict';var moment=require(_0x7977('0x0'));var Sequelize=require(_0x7977('0x1'));module['exports']={'CmHopperId':{'type':Sequelize['INTEGER']},'phone':{'type':Sequelize[_0x7977('0x2')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0x7977('0x4')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7977('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index b2e9d5a..8ecc7e6 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a8=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','end','error','stack','name','send','CmHopperAdditionalPhone','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs'];(function(_0x4026c2,_0x544cc5){var _0x51d885=function(_0x8d43ad){while(--_0x8d43ad){_0x4026c2['push'](_0x4026c2['shift']());}};_0x51d885(++_0x544cc5);}(_0xb9a8,0x1b6));var _0x8b9a=function(_0x11ed09,_0x3f2a20){_0x11ed09=_0x11ed09-0x0;var _0x2a4e3f=_0xb9a8[_0x11ed09];return _0x2a4e3f;};'use strict';var emlformat=require(_0x8b9a('0x0'));var rimraf=require(_0x8b9a('0x1'));var zipdir=require(_0x8b9a('0x2'));var jsonpatch=require(_0x8b9a('0x3'));var rp=require(_0x8b9a('0x4'));var moment=require(_0x8b9a('0x5'));var BPromise=require(_0x8b9a('0x6'));var Mustache=require(_0x8b9a('0x7'));var util=require('util');var path=require('path');var sox=require(_0x8b9a('0x8'));var csv=require(_0x8b9a('0x9'));var ejs=require(_0x8b9a('0xa'));var fs=require('fs');var fs_extra=require(_0x8b9a('0xb'));var _=require('lodash');var squel=require(_0x8b9a('0xc'));var crypto=require(_0x8b9a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8b9a('0xe'));var toCsv=require(_0x8b9a('0x9'));var querystring=require('querystring');var Papa=require(_0x8b9a('0xf'));var Redis=require(_0x8b9a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8b9a('0x11'));var as=require(_0x8b9a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b9a('0x13'))(_0x8b9a('0x14'));var utils=require(_0x8b9a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8b9a('0x16'));var db=require(_0x8b9a('0x17'))['db'];function respondWithStatusCode(_0x57a207,_0x1f1786){_0x1f1786=_0x1f1786||0xcc;return function(_0xad048a){if(_0xad048a){return _0x57a207[_0x8b9a('0x18')](_0x1f1786);}return _0x57a207['status'](_0x1f1786)['end']();};}function respondWithResult(_0x34a1c5,_0x3f3b85){_0x3f3b85=_0x3f3b85||0xc8;return function(_0x5ab921){if(_0x5ab921){return _0x34a1c5[_0x8b9a('0x19')](_0x3f3b85)['json'](_0x5ab921);}};}function respondWithFilteredResult(_0x2ff0f,_0x991e37){return function(_0x43d77c){if(_0x43d77c){var _0x11b895=typeof _0x991e37[_0x8b9a('0x1a')]===_0x8b9a('0x1b')&&typeof _0x991e37[_0x8b9a('0x1c')]===_0x8b9a('0x1b');var _0x5ed388=_0x43d77c[_0x8b9a('0x1d')];var _0x45fc16=_0x11b895?0x0:_0x991e37[_0x8b9a('0x1a')];var _0x16e905=_0x11b895?_0x43d77c[_0x8b9a('0x1d')]:_0x991e37[_0x8b9a('0x1a')]+_0x991e37[_0x8b9a('0x1c')];var _0x469f07;if(_0x16e905>=_0x5ed388){_0x16e905=_0x5ed388;_0x469f07=0xc8;}else{_0x469f07=0xce;}_0x2ff0f[_0x8b9a('0x19')](_0x469f07);return _0x2ff0f['set'](_0x8b9a('0x1e'),_0x45fc16+'-'+_0x16e905+'/'+_0x5ed388)['json'](_0x43d77c);}return null;};}function patchUpdates(_0x15bdda){return function(_0xc80a9f){try{jsonpatch['apply'](_0xc80a9f,_0x15bdda,!![]);}catch(_0x330758){return BPromise[_0x8b9a('0x1f')](_0x330758);}return _0xc80a9f['save']();};}function saveUpdates(_0x32f29f,_0x4234ae){return function(_0x45e583){if(_0x45e583){return _0x45e583[_0x8b9a('0x20')](_0x32f29f)[_0x8b9a('0x21')](function(_0x15f241){return _0x15f241;});}return null;};}function removeEntity(_0x23f55b,_0x15b7c0){return function(_0x558e14){if(_0x558e14){return _0x558e14[_0x8b9a('0x22')]()[_0x8b9a('0x21')](function(){var _0x1ececf=_0x558e14[_0x8b9a('0x23')]({'plain':!![]});var _0x4f2fae=_0x8b9a('0x24');return db[_0x8b9a('0x25')][_0x8b9a('0x22')]({'where':{'type':_0x4f2fae,'resourceId':_0x1ececf['id']}})['then'](function(){return _0x558e14;});})[_0x8b9a('0x21')](function(){_0x23f55b[_0x8b9a('0x19')](0xcc)[_0x8b9a('0x26')]();});}};}function handleEntityNotFound(_0x52a9c9,_0x2f214d){return function(_0x36f14d){if(!_0x36f14d){_0x52a9c9[_0x8b9a('0x18')](0x194);}return _0x36f14d;};}function handleError(_0x2acf7c,_0x2b0b1c){_0x2b0b1c=_0x2b0b1c||0x1f4;return function(_0x573120){logger[_0x8b9a('0x27')](_0x573120[_0x8b9a('0x28')]);if(_0x573120[_0x8b9a('0x29')]){delete _0x573120[_0x8b9a('0x29')];}_0x2acf7c[_0x8b9a('0x19')](_0x2b0b1c)[_0x8b9a('0x2a')](_0x573120);};}exports['index']=function(_0x289224,_0x2f7670){var _0x1f21c7={},_0x164407={},_0x2452b7={'count':0x0,'rows':[]};var _0x4ef7d8=_['map'](db[_0x8b9a('0x2b')]['rawAttributes'],function(_0x382f03){return{'name':_0x382f03['fieldName'],'type':_0x382f03[_0x8b9a('0x2c')]['key']};});_0x164407[_0x8b9a('0x2d')]=_['map'](_0x4ef7d8,_0x8b9a('0x29'));_0x164407[_0x8b9a('0x2e')]=_[_0x8b9a('0x2f')](_0x289224[_0x8b9a('0x2e')]);_0x164407[_0x8b9a('0x30')]=_[_0x8b9a('0x31')](_0x164407[_0x8b9a('0x2d')],_0x164407['query']);_0x1f21c7[_0x8b9a('0x32')]=_[_0x8b9a('0x31')](_0x164407['model'],qs[_0x8b9a('0x33')](_0x289224[_0x8b9a('0x2e')]['fields']));_0x1f21c7[_0x8b9a('0x32')]=_0x1f21c7[_0x8b9a('0x32')]['length']?_0x1f21c7['attributes']:_0x164407['model'];if(!_0x289224[_0x8b9a('0x2e')][_0x8b9a('0x34')]('nolimit')){_0x1f21c7['limit']=qs[_0x8b9a('0x1c')](_0x289224[_0x8b9a('0x2e')][_0x8b9a('0x1c')]);_0x1f21c7[_0x8b9a('0x1a')]=qs[_0x8b9a('0x1a')](_0x289224[_0x8b9a('0x2e')][_0x8b9a('0x1a')]);}_0x1f21c7['order']=qs[_0x8b9a('0x35')](_0x289224[_0x8b9a('0x2e')][_0x8b9a('0x35')]);_0x1f21c7[_0x8b9a('0x36')]=qs[_0x8b9a('0x30')](_[_0x8b9a('0x37')](_0x289224[_0x8b9a('0x2e')],_0x164407[_0x8b9a('0x30')]),_0x4ef7d8);if(_0x289224[_0x8b9a('0x2e')][_0x8b9a('0x38')]){_0x1f21c7['where']=_['merge'](_0x1f21c7['where'],{'$or':_[_0x8b9a('0x39')](_0x4ef7d8,function(_0x449db9){if(_0x449db9[_0x8b9a('0x2c')]!==_0x8b9a('0x3a')){var _0xd528bd={};_0xd528bd[_0x449db9[_0x8b9a('0x29')]]={'$like':'%'+_0x289224[_0x8b9a('0x2e')][_0x8b9a('0x38')]+'%'};return _0xd528bd;}})});}_0x1f21c7=_[_0x8b9a('0x3b')]({},_0x1f21c7,_0x289224[_0x8b9a('0x3c')]);var _0xb925c3={'where':_0x1f21c7[_0x8b9a('0x36')]};return db[_0x8b9a('0x2b')][_0x8b9a('0x1d')](_0xb925c3)[_0x8b9a('0x21')](function(_0xe285e9){_0x2452b7['count']=_0xe285e9;if(_0x289224[_0x8b9a('0x2e')][_0x8b9a('0x3d')]){_0x1f21c7[_0x8b9a('0x3e')]=[{'all':!![]}];}return db[_0x8b9a('0x2b')][_0x8b9a('0x3f')](_0x1f21c7);})[_0x8b9a('0x21')](function(_0x54e4c8){_0x2452b7[_0x8b9a('0x40')]=_0x54e4c8;return _0x2452b7;})['then'](respondWithFilteredResult(_0x2f7670,_0x1f21c7))[_0x8b9a('0x41')](handleError(_0x2f7670,null));};exports[_0x8b9a('0x42')]=function(_0x5d7e5a,_0x578248){var _0x5d6e46={'raw':!![],'where':{'id':_0x5d7e5a[_0x8b9a('0x43')]['id']}},_0x2389e2={};_0x2389e2[_0x8b9a('0x2d')]=_[_0x8b9a('0x2f')](db[_0x8b9a('0x2b')][_0x8b9a('0x44')]);_0x2389e2[_0x8b9a('0x2e')]=_[_0x8b9a('0x2f')](_0x5d7e5a[_0x8b9a('0x2e')]);_0x2389e2['filters']=_[_0x8b9a('0x31')](_0x2389e2[_0x8b9a('0x2d')],_0x2389e2[_0x8b9a('0x2e')]);_0x5d6e46[_0x8b9a('0x32')]=_[_0x8b9a('0x31')](_0x2389e2['model'],qs[_0x8b9a('0x33')](_0x5d7e5a[_0x8b9a('0x2e')][_0x8b9a('0x33')]));_0x5d6e46[_0x8b9a('0x32')]=_0x5d6e46[_0x8b9a('0x32')]['length']?_0x5d6e46['attributes']:_0x2389e2[_0x8b9a('0x2d')];if(_0x5d7e5a[_0x8b9a('0x2e')]['includeAll']){_0x5d6e46[_0x8b9a('0x3e')]=[{'all':!![]}];}_0x5d6e46=_['merge']({},_0x5d6e46,_0x5d7e5a[_0x8b9a('0x3c')]);return db['CmHopperAdditionalPhone'][_0x8b9a('0x45')](_0x5d6e46)[_0x8b9a('0x21')](handleEntityNotFound(_0x578248,null))[_0x8b9a('0x21')](respondWithResult(_0x578248,null))[_0x8b9a('0x41')](handleError(_0x578248,null));};exports['create']=function(_0xec5311,_0x128d8d){return db[_0x8b9a('0x2b')][_0x8b9a('0x46')](_0xec5311[_0x8b9a('0x47')],{})[_0x8b9a('0x21')](function(_0xbf74f8){var _0x488949=_0xec5311['user'][_0x8b9a('0x23')]({'plain':!![]});if(!_0x488949)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x488949['role']===_0x8b9a('0x48')){var _0x36ef98=_0xbf74f8['get']({'plain':!![]});var _0x126ee5='CmHopperAdditionalPhones';return db['UserProfileSection'][_0x8b9a('0x45')]({'where':{'name':_0x126ee5,'userProfileId':_0x488949[_0x8b9a('0x49')]},'raw':!![]})[_0x8b9a('0x21')](function(_0x3c7adb){if(_0x3c7adb&&_0x3c7adb[_0x8b9a('0x4a')]===0x0){return db[_0x8b9a('0x25')][_0x8b9a('0x46')]({'name':_0x36ef98[_0x8b9a('0x29')],'resourceId':_0x36ef98['id'],'type':_0x3c7adb[_0x8b9a('0x29')],'sectionId':_0x3c7adb['id']},{})[_0x8b9a('0x21')](function(){return _0xbf74f8;});}else{return _0xbf74f8;}})[_0x8b9a('0x41')](function(_0x26ec8e){logger['error'](_0x8b9a('0x4b'),_0x26ec8e);throw _0x26ec8e;});}return _0xbf74f8;})[_0x8b9a('0x21')](respondWithResult(_0x128d8d,0xc9))[_0x8b9a('0x41')](handleError(_0x128d8d,null));};exports[_0x8b9a('0x20')]=function(_0x29c49c,_0x4f7f79){if(_0x29c49c['body']['id']){delete _0x29c49c['body']['id'];}return db[_0x8b9a('0x2b')][_0x8b9a('0x45')]({'where':{'id':_0x29c49c['params']['id']}})[_0x8b9a('0x21')](handleEntityNotFound(_0x4f7f79,null))[_0x8b9a('0x21')](saveUpdates(_0x29c49c['body'],null))[_0x8b9a('0x21')](respondWithResult(_0x4f7f79,null))['catch'](handleError(_0x4f7f79,null));};exports['destroy']=function(_0x4ece9c,_0xadbed2){return db[_0x8b9a('0x2b')][_0x8b9a('0x45')]({'where':{'id':_0x4ece9c[_0x8b9a('0x43')]['id']}})[_0x8b9a('0x21')](handleEntityNotFound(_0xadbed2,null))[_0x8b9a('0x21')](removeEntity(_0xadbed2,null))[_0x8b9a('0x41')](handleError(_0xadbed2,null));}; \ No newline at end of file +var _0xa094=['filter','merge','CmHopperAdditionalPhone','includeAll','findAll','rows','show','params','keys','include','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CmHopperAdditionalPhones','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick'];(function(_0x581ce1,_0x48799e){var _0x404586=function(_0x3a366f){while(--_0x3a366f){_0x581ce1['push'](_0x581ce1['shift']());}};_0x404586(++_0x48799e);}(_0xa094,0xba));var _0x4a09=function(_0x14176e,_0x455e99){_0x14176e=_0x14176e-0x0;var _0x151a2f=_0xa094[_0x14176e];return _0x151a2f;};'use strict';var emlformat=require(_0x4a09('0x0'));var rimraf=require(_0x4a09('0x1'));var zipdir=require(_0x4a09('0x2'));var jsonpatch=require(_0x4a09('0x3'));var rp=require('request-promise');var moment=require(_0x4a09('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4a09('0x5'));var util=require(_0x4a09('0x6'));var path=require(_0x4a09('0x7'));var sox=require(_0x4a09('0x8'));var csv=require(_0x4a09('0x9'));var ejs=require(_0x4a09('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a09('0xb'));var squel=require(_0x4a09('0xc'));var crypto=require(_0x4a09('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4a09('0xe'));var toCsv=require(_0x4a09('0x9'));var querystring=require(_0x4a09('0xf'));var Papa=require(_0x4a09('0x10'));var Redis=require(_0x4a09('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4a09('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a09('0x13'));var logger=require(_0x4a09('0x14'))(_0x4a09('0x15'));var utils=require(_0x4a09('0x16'));var config=require(_0x4a09('0x17'));var licenseUtil=require(_0x4a09('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1785ce,_0x2af100){_0x2af100=_0x2af100||0xcc;return function(_0x525b12){if(_0x525b12){return _0x1785ce['sendStatus'](_0x2af100);}return _0x1785ce[_0x4a09('0x19')](_0x2af100)[_0x4a09('0x1a')]();};}function respondWithResult(_0x1e68a1,_0x1b1f5e){_0x1b1f5e=_0x1b1f5e||0xc8;return function(_0x32a3bd){if(_0x32a3bd){return _0x1e68a1[_0x4a09('0x19')](_0x1b1f5e)[_0x4a09('0x1b')](_0x32a3bd);}};}function respondWithFilteredResult(_0x4b9047,_0x415828){return function(_0x2a645f){if(_0x2a645f){var _0x599847=typeof _0x415828[_0x4a09('0x1c')]===_0x4a09('0x1d')&&typeof _0x415828[_0x4a09('0x1e')]===_0x4a09('0x1d');var _0x43814b=_0x2a645f[_0x4a09('0x1f')];var _0x2a95f8=_0x599847?0x0:_0x415828[_0x4a09('0x1c')];var _0x3092c8=_0x599847?_0x2a645f[_0x4a09('0x1f')]:_0x415828[_0x4a09('0x1c')]+_0x415828[_0x4a09('0x1e')];var _0xe36e88;if(_0x3092c8>=_0x43814b){_0x3092c8=_0x43814b;_0xe36e88=0xc8;}else{_0xe36e88=0xce;}_0x4b9047[_0x4a09('0x19')](_0xe36e88);return _0x4b9047[_0x4a09('0x20')](_0x4a09('0x21'),_0x2a95f8+'-'+_0x3092c8+'/'+_0x43814b)[_0x4a09('0x1b')](_0x2a645f);}return null;};}function patchUpdates(_0x23f7dc){return function(_0x2bcf73){try{jsonpatch['apply'](_0x2bcf73,_0x23f7dc,!![]);}catch(_0x4c4c80){return BPromise[_0x4a09('0x22')](_0x4c4c80);}return _0x2bcf73['save']();};}function saveUpdates(_0x3a09f2,_0x1c51e3){return function(_0x507f3e){if(_0x507f3e){return _0x507f3e[_0x4a09('0x23')](_0x3a09f2)[_0x4a09('0x24')](function(_0x326c44){return _0x326c44;});}return null;};}function removeEntity(_0x63d968,_0x449b48){return function(_0x418616){if(_0x418616){return _0x418616[_0x4a09('0x25')]()[_0x4a09('0x24')](function(){var _0x3b55aa=_0x418616[_0x4a09('0x26')]({'plain':!![]});var _0xd93db4='CmHopperAdditionalPhones';return db[_0x4a09('0x27')][_0x4a09('0x25')]({'where':{'type':_0xd93db4,'resourceId':_0x3b55aa['id']}})[_0x4a09('0x24')](function(){return _0x418616;});})[_0x4a09('0x24')](function(){_0x63d968[_0x4a09('0x19')](0xcc)[_0x4a09('0x1a')]();});}};}function handleEntityNotFound(_0x464584,_0x19b644){return function(_0x2cc0b1){if(!_0x2cc0b1){_0x464584[_0x4a09('0x28')](0x194);}return _0x2cc0b1;};}function handleError(_0x35da89,_0x484603){_0x484603=_0x484603||0x1f4;return function(_0x4b0080){logger[_0x4a09('0x29')](_0x4b0080['stack']);if(_0x4b0080['name']){delete _0x4b0080[_0x4a09('0x2a')];}_0x35da89[_0x4a09('0x19')](_0x484603)[_0x4a09('0x2b')](_0x4b0080);};}exports[_0x4a09('0x2c')]=function(_0xce68c8,_0x5426e2){var _0x54cf8d={},_0x4bc096={},_0x127895={'count':0x0,'rows':[]};var _0x2aa124=_[_0x4a09('0x2d')](db['CmHopperAdditionalPhone'][_0x4a09('0x2e')],function(_0x39d91c){return{'name':_0x39d91c['fieldName'],'type':_0x39d91c[_0x4a09('0x2f')][_0x4a09('0x30')]};});_0x4bc096['model']=_[_0x4a09('0x2d')](_0x2aa124,_0x4a09('0x2a'));_0x4bc096[_0x4a09('0x31')]=_['keys'](_0xce68c8[_0x4a09('0x31')]);_0x4bc096[_0x4a09('0x32')]=_[_0x4a09('0x33')](_0x4bc096[_0x4a09('0x34')],_0x4bc096[_0x4a09('0x31')]);_0x54cf8d[_0x4a09('0x35')]=_['intersection'](_0x4bc096[_0x4a09('0x34')],qs[_0x4a09('0x36')](_0xce68c8[_0x4a09('0x31')][_0x4a09('0x36')]));_0x54cf8d['attributes']=_0x54cf8d['attributes'][_0x4a09('0x37')]?_0x54cf8d[_0x4a09('0x35')]:_0x4bc096[_0x4a09('0x34')];if(!_0xce68c8[_0x4a09('0x31')][_0x4a09('0x38')]('nolimit')){_0x54cf8d[_0x4a09('0x1e')]=qs[_0x4a09('0x1e')](_0xce68c8[_0x4a09('0x31')][_0x4a09('0x1e')]);_0x54cf8d[_0x4a09('0x1c')]=qs[_0x4a09('0x1c')](_0xce68c8['query'][_0x4a09('0x1c')]);}_0x54cf8d['order']=qs[_0x4a09('0x39')](_0xce68c8[_0x4a09('0x31')][_0x4a09('0x39')]);_0x54cf8d[_0x4a09('0x3a')]=qs[_0x4a09('0x32')](_[_0x4a09('0x3b')](_0xce68c8['query'],_0x4bc096[_0x4a09('0x32')]),_0x2aa124);if(_0xce68c8[_0x4a09('0x31')][_0x4a09('0x3c')]){_0x54cf8d['where']=_[_0x4a09('0x3d')](_0x54cf8d[_0x4a09('0x3a')],{'$or':_[_0x4a09('0x2d')](_0x2aa124,function(_0x22c560){if(_0x22c560[_0x4a09('0x2f')]!=='VIRTUAL'){var _0x27f873={};_0x27f873[_0x22c560[_0x4a09('0x2a')]]={'$like':'%'+_0xce68c8[_0x4a09('0x31')]['filter']+'%'};return _0x27f873;}})});}_0x54cf8d=_[_0x4a09('0x3d')]({},_0x54cf8d,_0xce68c8['options']);var _0x311bb6={'where':_0x54cf8d[_0x4a09('0x3a')]};return db[_0x4a09('0x3e')][_0x4a09('0x1f')](_0x311bb6)['then'](function(_0x49aaa2){_0x127895[_0x4a09('0x1f')]=_0x49aaa2;if(_0xce68c8[_0x4a09('0x31')][_0x4a09('0x3f')]){_0x54cf8d['include']=[{'all':!![]}];}return db[_0x4a09('0x3e')][_0x4a09('0x40')](_0x54cf8d);})[_0x4a09('0x24')](function(_0x29eeb3){_0x127895[_0x4a09('0x41')]=_0x29eeb3;return _0x127895;})[_0x4a09('0x24')](respondWithFilteredResult(_0x5426e2,_0x54cf8d))['catch'](handleError(_0x5426e2,null));};exports[_0x4a09('0x42')]=function(_0x2f48d7,_0x1934f3){var _0xd9a1a4={'raw':!![],'where':{'id':_0x2f48d7[_0x4a09('0x43')]['id']}},_0x424544={};_0x424544[_0x4a09('0x34')]=_[_0x4a09('0x44')](db[_0x4a09('0x3e')]['rawAttributes']);_0x424544[_0x4a09('0x31')]=_[_0x4a09('0x44')](_0x2f48d7[_0x4a09('0x31')]);_0x424544[_0x4a09('0x32')]=_[_0x4a09('0x33')](_0x424544[_0x4a09('0x34')],_0x424544['query']);_0xd9a1a4[_0x4a09('0x35')]=_[_0x4a09('0x33')](_0x424544[_0x4a09('0x34')],qs[_0x4a09('0x36')](_0x2f48d7['query'][_0x4a09('0x36')]));_0xd9a1a4[_0x4a09('0x35')]=_0xd9a1a4[_0x4a09('0x35')][_0x4a09('0x37')]?_0xd9a1a4[_0x4a09('0x35')]:_0x424544[_0x4a09('0x34')];if(_0x2f48d7['query'][_0x4a09('0x3f')]){_0xd9a1a4[_0x4a09('0x45')]=[{'all':!![]}];}_0xd9a1a4=_[_0x4a09('0x3d')]({},_0xd9a1a4,_0x2f48d7[_0x4a09('0x46')]);return db[_0x4a09('0x3e')][_0x4a09('0x47')](_0xd9a1a4)[_0x4a09('0x24')](handleEntityNotFound(_0x1934f3,null))[_0x4a09('0x24')](respondWithResult(_0x1934f3,null))[_0x4a09('0x48')](handleError(_0x1934f3,null));};exports[_0x4a09('0x49')]=function(_0x472af5,_0x502334){return db[_0x4a09('0x3e')]['create'](_0x472af5[_0x4a09('0x4a')],{})['then'](function(_0x80b4c8){var _0x2f3c3=_0x472af5[_0x4a09('0x4b')][_0x4a09('0x26')]({'plain':!![]});if(!_0x2f3c3)throw new Error(_0x4a09('0x4c'));if(_0x2f3c3[_0x4a09('0x4d')]==='user'){var _0x6f856e=_0x80b4c8[_0x4a09('0x26')]({'plain':!![]});var _0x5e5197=_0x4a09('0x4e');return db[_0x4a09('0x4f')][_0x4a09('0x47')]({'where':{'name':_0x5e5197,'userProfileId':_0x2f3c3['userProfileId']},'raw':!![]})[_0x4a09('0x24')](function(_0x128797){if(_0x128797&&_0x128797[_0x4a09('0x50')]===0x0){return db['UserProfileResource'][_0x4a09('0x49')]({'name':_0x6f856e['name'],'resourceId':_0x6f856e['id'],'type':_0x128797['name'],'sectionId':_0x128797['id']},{})['then'](function(){return _0x80b4c8;});}else{return _0x80b4c8;}})['catch'](function(_0x471859){logger[_0x4a09('0x29')](_0x4a09('0x51'),_0x471859);throw _0x471859;});}return _0x80b4c8;})[_0x4a09('0x24')](respondWithResult(_0x502334,0xc9))['catch'](handleError(_0x502334,null));};exports[_0x4a09('0x23')]=function(_0x4452ff,_0x281687){if(_0x4452ff[_0x4a09('0x4a')]['id']){delete _0x4452ff['body']['id'];}return db['CmHopperAdditionalPhone'][_0x4a09('0x47')]({'where':{'id':_0x4452ff['params']['id']}})[_0x4a09('0x24')](handleEntityNotFound(_0x281687,null))[_0x4a09('0x24')](saveUpdates(_0x4452ff[_0x4a09('0x4a')],null))[_0x4a09('0x24')](respondWithResult(_0x281687,null))[_0x4a09('0x48')](handleError(_0x281687,null));};exports[_0x4a09('0x25')]=function(_0x13443d,_0x44f295){return db['CmHopperAdditionalPhone']['find']({'where':{'id':_0x13443d[_0x4a09('0x43')]['id']}})['then'](handleEntityNotFound(_0x44f295,null))[_0x4a09('0x24')](removeEntity(_0x44f295,null))[_0x4a09('0x48')](handleError(_0x44f295,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index f652ffe..0a4ca4a 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcfc7=['path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','define','cm_hopper_additional_phones','../../config/logger'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcfc7,0x1c7));var _0x7cfc=function(_0x38c050,_0x51a968){_0x38c050=_0x38c050-0x0;var _0x1f01c8=_0xcfc7[_0x38c050];return _0x1f01c8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7cfc('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7cfc('0x1'));var rimraf=require(_0x7cfc('0x2'));var config=require(_0x7cfc('0x3'));var attributes=require(_0x7cfc('0x4'));module[_0x7cfc('0x5')]=function(_0x2eef96,_0x1c4d3b){return _0x2eef96[_0x7cfc('0x6')]('CmHopperAdditionalPhone',attributes,{'tableName':_0x7cfc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4aae=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','CmHopperAdditionalPhone','cm_hopper_additional_phones','lodash'];(function(_0x2dd615,_0x18099c){var _0x5255a4=function(_0x3f4c54){while(--_0x3f4c54){_0x2dd615['push'](_0x2dd615['shift']());}};_0x5255a4(++_0x18099c);}(_0x4aae,0x18b));var _0xe4aa=function(_0x4543d8,_0x212a77){_0x4543d8=_0x4543d8-0x0;var _0x5ca5a8=_0x4aae[_0x4543d8];return _0x5ca5a8;};'use strict';var _=require(_0xe4aa('0x0'));var util=require(_0xe4aa('0x1'));var logger=require(_0xe4aa('0x2'))('api');var moment=require(_0xe4aa('0x3'));var BPromise=require(_0xe4aa('0x4'));var rp=require(_0xe4aa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4aa('0x6'));var config=require(_0xe4aa('0x7'));var attributes=require(_0xe4aa('0x8'));module['exports']=function(_0x1f93d5,_0x157c9f){return _0x1f93d5['define'](_0xe4aa('0x9'),attributes,{'tableName':_0xe4aa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index 09de944..8eae52d 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29e8=['countmachineretry','VerifyAdditionalPhones','SwapAdditionalPhones','ContactId','VoiceQueueId','duration','waitTime','isNil','scheduledat','add','minutes','phone','countabandonedretry','createdAt','updatedAt','transaction','update','activateAdditionalPhone','IncrementPreviewCounters','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CmHopper','findOne','body','CampaignId','then','OrderBy','ASC','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countagentrejectretry','entity','dialGlobalMaxRetry','CmHopperAdditionalPhone','countnosuchnumberretry'];(function(_0x41c746,_0x59ddf0){var _0x2d7282=function(_0x288680){while(--_0x288680){_0x41c746['push'](_0x41c746['shift']());}};_0x2d7282(++_0x59ddf0);}(_0x29e8,0x15d));var _0x829e=function(_0x4e38df,_0x2f892a){_0x4e38df=_0x4e38df-0x0;var _0x28a0ea=_0x29e8[_0x4e38df];return _0x28a0ea;};'use strict';var _=require(_0x829e('0x0'));var util=require('util');var moment=require(_0x829e('0x1'));var BPromise=require(_0x829e('0x2'));var rs=require(_0x829e('0x3'));var fs=require('fs');var Redis=require(_0x829e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x829e('0x5'))(_0x829e('0x6'));var config=require('../../config/environment');var jayson=require(_0x829e('0x7'));var client=jayson[_0x829e('0x8')][_0x829e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1e4036,_0x52e6da,_0x4caba4){return new BPromise(function(_0x516db0,_0x427b65){return client['request'](_0x1e4036,_0x4caba4)['then'](function(_0x319b66){logger[_0x829e('0xa')](_0x829e('0xb'),_0x52e6da,_0x829e('0xc'));logger[_0x829e('0xd')](_0x829e('0xe'),_0x52e6da,_0x829e('0xc'),JSON[_0x829e('0xf')](_0x319b66));if(_0x319b66[_0x829e('0x10')]){if(_0x319b66['error'][_0x829e('0x11')]===0x1f4){logger[_0x829e('0x10')](_0x829e('0xb'),_0x52e6da,_0x319b66['error'][_0x829e('0x12')]);return _0x427b65(_0x319b66[_0x829e('0x10')][_0x829e('0x12')]);}logger[_0x829e('0x10')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x52e6da,_0x319b66[_0x829e('0x10')][_0x829e('0x12')]);return _0x516db0(_0x319b66[_0x829e('0x10')]['message']);}else{logger['info'](_0x829e('0xb'),_0x52e6da,_0x829e('0xc'));_0x516db0(_0x319b66['result']['message']);}})[_0x829e('0x13')](function(_0x45fa7f){logger[_0x829e('0x10')](_0x829e('0xb'),_0x52e6da,_0x45fa7f);_0x427b65(_0x45fa7f);});});}exports['VerifyAdditionalPhones']=function(_0xb44374){var _0x423707=this;return new Promise(function(_0x3f2e45,_0x1b8d2d){return db[_0x829e('0x14')][_0x829e('0x15')]({'raw':!![],'where':{'ContactId':_0xb44374[_0x829e('0x16')]['ContactId'],'ListId':_0xb44374['body']['ListId'],'VoiceQueueId':_0xb44374['body']['VoiceQueueId']===undefined?null:_0xb44374['body']['VoiceQueueId'],'CampaignId':_0xb44374['body'][_0x829e('0x17')]===undefined?null:_0xb44374['body'][_0x829e('0x17')]}})[_0x829e('0x18')](function(_0x144e54){if(_0x144e54!=null){return db['CmHopperAdditionalPhone'][_0x829e('0x15')]({'raw':!![],'where':{'CmHopperId':_0x144e54['id'],'OrderBy':{'$gt':_0x144e54[_0x829e('0x19')]}},'order':[['OrderBy',_0x829e('0x1a')]]})['then'](function(_0x3d1870){var _0x197679=0x0;if(_0x3d1870){if(_0x3d1870[_0x829e('0x1b')]+_0x3d1870[_0x829e('0x1c')]+_0x3d1870[_0x829e('0x1d')]+_0x3d1870['countnosuchnumberretry']+_0x3d1870[_0x829e('0x1e')]+_0x3d1870['countabandonedretry']+_0x3d1870['countmachineretry']+_0x3d1870[_0x829e('0x1f')]<_0xb44374[_0x829e('0x20')][_0x829e('0x21')])_0x197679=0x1;_0x3f2e45({'additional':_0x197679});}else{return db[_0x829e('0x22')][_0x829e('0x15')]({'raw':!![],'where':{'CmHopperId':_0x144e54['id']},'order':[[_0x829e('0x19'),_0x829e('0x1a')]]})[_0x829e('0x18')](function(_0x5c4671){var _0x341f4d=0x0;if(_0x5c4671){if(_0x5c4671[_0x829e('0x1b')]+_0x5c4671[_0x829e('0x1c')]+_0x5c4671[_0x829e('0x1d')]+_0x5c4671[_0x829e('0x23')]+_0x5c4671[_0x829e('0x1e')]+_0x5c4671['countabandonedretry']+_0x5c4671[_0x829e('0x24')]+_0x5c4671[_0x829e('0x1f')]<_0xb44374[_0x829e('0x20')][_0x829e('0x21')])_0x341f4d=0x1;_0x3f2e45({'additional':_0x341f4d});}else{_0x3f2e45({'additional':0x0});}})[_0x829e('0x13')](function(_0x5b00a1){logger['error'](_0x829e('0x25'),_0x5b00a1[_0x829e('0x12')]);_0x1b8d2d(_0x423707[_0x829e('0x10')](0x1f4,_0x5b00a1[_0x829e('0x12')]));});}})[_0x829e('0x13')](function(_0x15c696){logger[_0x829e('0x10')]('VerifyAdditionalPhones',_0x15c696[_0x829e('0x12')]);_0x1b8d2d(_0x423707['error'](0x1f4,_0x15c696[_0x829e('0x12')]));});}else _0x3f2e45({'additional':0x0});});});};exports[_0x829e('0x26')]=function(_0xdec3ad){var _0x28ec40=this;return new Promise(function(_0x4619d6,_0x3d3a63){return db['CmHopper'][_0x829e('0x15')]({'raw':!![],'where':{'ContactId':_0xdec3ad[_0x829e('0x16')][_0x829e('0x27')],'ListId':_0xdec3ad[_0x829e('0x16')]['ListId'],'VoiceQueueId':_0xdec3ad[_0x829e('0x16')][_0x829e('0x28')]===undefined?null:_0xdec3ad[_0x829e('0x16')][_0x829e('0x28')],'CampaignId':_0xdec3ad[_0x829e('0x16')][_0x829e('0x17')]===undefined?null:_0xdec3ad[_0x829e('0x16')][_0x829e('0x17')]}})['then'](function(_0xe35e04){if(_0xe35e04!=null){return db[_0x829e('0x22')][_0x829e('0x15')]({'raw':!![],'where':{'CmHopperId':_0xe35e04['id'],'OrderBy':{'$gte':_0xe35e04['OrderBy']}},'order':[['OrderBy','ASC']]})[_0x829e('0x18')](function(_0x4434aa){if(_0x4434aa)return activateAdditionalPhone(_0xe35e04,_0xdec3ad[_0x829e('0x16')],_0x4434aa,_0xdec3ad[_0x829e('0x29')],_0xdec3ad[_0x829e('0x2a')])[_0x829e('0x18')](function(_0x507ee0){_0x4619d6(_0x507ee0);});else{return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0xe35e04['id']},'order':[[_0x829e('0x19'),_0x829e('0x1a')]]})['then'](function(_0x580420){if(_0x580420)return activateAdditionalPhone(_0xe35e04,_0xdec3ad[_0x829e('0x16')],_0x580420,_0xdec3ad[_0x829e('0x29')],_0xdec3ad[_0x829e('0x2a')])[_0x829e('0x18')](function(_0xd131bb){_0x4619d6(_0xd131bb);});else{_0x4619d6({'id':_0xe35e04['id'],'phone':''});}})['catch'](function(_0x5307f8){logger[_0x829e('0x10')]('VerifyAdditionalPhones',_0x5307f8[_0x829e('0x12')]);_0x3d3a63(_0x28ec40[_0x829e('0x10')](0x1f4,_0x5307f8['message']));});}})[_0x829e('0x13')](function(_0x2c5b77){logger['error'](_0x829e('0x25'),_0x2c5b77[_0x829e('0x12')]);_0x3d3a63(_0x28ec40[_0x829e('0x10')](0x1f4,_0x2c5b77[_0x829e('0x12')]));});}else _0x4619d6(0x1);});});};function activateAdditionalPhone(_0x5a576a,_0x4fe9a8,_0x2578ec,_0x43e849,_0x468c93){return new Promise(function(_0x55fd46,_0x4f1e26){var _0x2179bb;if(_[_0x829e('0x2b')](_0x2578ec[_0x829e('0x2c')])){_0x2578ec['scheduledat']=moment();}if(moment()>moment(_0x2578ec[_0x829e('0x2c')])){_0x2179bb=moment()[_0x829e('0x2d')](_0x468c93||0x3,_0x829e('0x2e'));}else{if(_0x2578ec[_0x829e('0x19')]==0x0){_0x2179bb=moment(_0x2578ec[_0x829e('0x2c')]);}else{_0x2179bb=moment()['add'](_0x468c93||0x3,_0x829e('0x2e'));}}if(_[_0x829e('0x2b')](_0x2179bb)){_0x2179bb=moment()[_0x829e('0x2d')](_0x468c93||0x3,_0x829e('0x2e'));}var _0x23c3e3={'phone':_0x5a576a[_0x829e('0x2f')],'active':0x0,'OrderBy':_[_0x829e('0x2b')](_0x5a576a['OrderBy'])?0x0:_0x5a576a[_0x829e('0x19')],'scheduledat':moment()['add'](_0x43e849||0x1,'minutes'),'countbusyretry':_0x4fe9a8[_0x829e('0x1b')],'countcongestionretry':_0x4fe9a8[_0x829e('0x1c')],'countnoanswerretry':_0x4fe9a8[_0x829e('0x1d')],'countnosuchnumberretry':_0x4fe9a8[_0x829e('0x23')],'countdropretry':_0x4fe9a8[_0x829e('0x1e')],'countabandonedretry':_0x4fe9a8[_0x829e('0x30')],'countmachineretry':_0x4fe9a8[_0x829e('0x24')],'countagentrejectretry':_0x4fe9a8[_0x829e('0x1f')],'createdAt':_0x4fe9a8[_0x829e('0x31')],'updatedAt':_0x4fe9a8['updatedAt']};var _0x21975b={'CmHopperId':_0x5a576a['id'],'phone':_0x2578ec[_0x829e('0x2f')],'active':0x0,'OrderBy':_['isNil'](_0x2578ec['OrderBy'])?0x0:_0x2578ec[_0x829e('0x19')],'scheduledat':_0x2179bb,'countbusyretry':_0x2578ec[_0x829e('0x1b')],'countcongestionretry':_0x2578ec['countcongestionretry'],'countnoanswerretry':_0x2578ec[_0x829e('0x1d')],'countnosuchnumberretry':_0x2578ec[_0x829e('0x23')],'countdropretry':_0x2578ec[_0x829e('0x1e')],'countabandonedretry':_0x2578ec['countabandonedretry'],'countmachineretry':_0x2578ec[_0x829e('0x24')],'countagentrejectretry':_0x2578ec['countagentrejectretry'],'createdAt':_0x2578ec[_0x829e('0x31')],'updatedAt':_0x2578ec[_0x829e('0x32')]};return db['sequelize'][_0x829e('0x33')](function(_0x57f3b5){return db['CmHopperAdditionalPhone'][_0x829e('0x34')](_0x23c3e3,{'where':{'id':_0x2578ec['id']}},{'transaction':_0x57f3b5})['then'](function(){return db['CmHopper'][_0x829e('0x34')](_0x21975b,{'where':{'id':_0x5a576a['id']}},{'transaction':_0x57f3b5});});})[_0x829e('0x18')](function(_0x595712){_0x55fd46({'id':_0x5a576a['id'],'phone':_0x2578ec['phone']});})[_0x829e('0x13')](function(_0x3326b0){logger[_0x829e('0x10')](_0x829e('0x35'),_0x3326b0[_0x829e('0x12')]);_0x4f1e26({'error':_0x3326b0['message']});});});}exports[_0x829e('0x36')]=function(_0x34ef7c){var _0x4c0927=this;return new Promise(function(_0x55de67,_0x4e65b4){return db[_0x829e('0x14')][_0x829e('0x34')](_0x34ef7c[_0x829e('0x16')]['field'],{'where':{'id':_0x34ef7c[_0x829e('0x16')]['id']}})['then'](function(_0x3c2440){_0x55de67(_0x3c2440);})[_0x829e('0x13')](function(_0x539bc2){logger[_0x829e('0x10')](_0x829e('0x36'),_0x539bc2[_0x829e('0x12')]);_0x4e65b4(_0x4c0927[_0x829e('0x10')](0x1f4,_0x539bc2[_0x829e('0x12')]));});});}; \ No newline at end of file +var _0x965e=['countagentrejectretry','entity','dialGlobalMaxRetry','ASC','waitTime','isNil','scheduledat','minutes','add','phone','countnosuchnumberretry','createdAt','transaction','activateAdditionalPhone','update','field','IncrementPreviewCounters','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','VerifyAdditionalPhones','CmHopper','body','ContactId','ListId','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','findOne','OrderBy','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x2ebc4a,_0x390266){var _0x2ad424=function(_0x541df7){while(--_0x541df7){_0x2ebc4a['push'](_0x2ebc4a['shift']());}};_0x2ad424(++_0x390266);}(_0x965e,0x199));var _0xe965=function(_0x233e09,_0x3c965b){_0x233e09=_0x233e09-0x0;var _0x33baba=_0x965e[_0x233e09];return _0x33baba;};'use strict';var _=require(_0xe965('0x0'));var util=require('util');var moment=require(_0xe965('0x1'));var BPromise=require(_0xe965('0x2'));var rs=require(_0xe965('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe965('0x4'))['db'];var utils=require(_0xe965('0x5'));var logger=require(_0xe965('0x6'))(_0xe965('0x7'));var config=require(_0xe965('0x8'));var jayson=require(_0xe965('0x9'));var client=jayson['client'][_0xe965('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x468d5b,_0x49d723,_0x375e7e){return new BPromise(function(_0x20a841,_0x5b9836){return client['request'](_0x468d5b,_0x375e7e)[_0xe965('0xb')](function(_0x28332c){logger[_0xe965('0xc')](_0xe965('0xd'),_0x49d723,_0xe965('0xe'));logger[_0xe965('0xf')](_0xe965('0x10'),_0x49d723,_0xe965('0xe'),JSON[_0xe965('0x11')](_0x28332c));if(_0x28332c[_0xe965('0x12')]){if(_0x28332c[_0xe965('0x12')][_0xe965('0x13')]===0x1f4){logger['error']('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x49d723,_0x28332c[_0xe965('0x12')][_0xe965('0x14')]);return _0x5b9836(_0x28332c['error'][_0xe965('0x14')]);}logger[_0xe965('0x12')](_0xe965('0xd'),_0x49d723,_0x28332c[_0xe965('0x12')][_0xe965('0x14')]);return _0x20a841(_0x28332c[_0xe965('0x12')][_0xe965('0x14')]);}else{logger[_0xe965('0xc')](_0xe965('0xd'),_0x49d723,_0xe965('0xe'));_0x20a841(_0x28332c[_0xe965('0x15')][_0xe965('0x14')]);}})[_0xe965('0x16')](function(_0x49ae32){logger[_0xe965('0x12')](_0xe965('0xd'),_0x49d723,_0x49ae32);_0x5b9836(_0x49ae32);});});}exports[_0xe965('0x17')]=function(_0x28e4a3){var _0x42992c=this;return new Promise(function(_0x4a8fad,_0x3ebd3c){return db[_0xe965('0x18')]['findOne']({'raw':!![],'where':{'ContactId':_0x28e4a3[_0xe965('0x19')][_0xe965('0x1a')],'ListId':_0x28e4a3['body'][_0xe965('0x1b')],'VoiceQueueId':_0x28e4a3[_0xe965('0x19')]['VoiceQueueId']===undefined?null:_0x28e4a3[_0xe965('0x19')][_0xe965('0x1c')],'CampaignId':_0x28e4a3[_0xe965('0x19')][_0xe965('0x1d')]===undefined?null:_0x28e4a3['body'][_0xe965('0x1d')]}})['then'](function(_0x4fa489){if(_0x4fa489!=null){return db[_0xe965('0x1e')][_0xe965('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x4fa489['id'],'OrderBy':{'$gt':_0x4fa489[_0xe965('0x20')]}},'order':[[_0xe965('0x20'),'ASC']]})[_0xe965('0xb')](function(_0x5bf7b8){var _0x207222=0x0;if(_0x5bf7b8){if(_0x5bf7b8[_0xe965('0x21')]+_0x5bf7b8[_0xe965('0x22')]+_0x5bf7b8[_0xe965('0x23')]+_0x5bf7b8['countnosuchnumberretry']+_0x5bf7b8[_0xe965('0x24')]+_0x5bf7b8[_0xe965('0x25')]+_0x5bf7b8[_0xe965('0x26')]+_0x5bf7b8[_0xe965('0x27')]<_0x28e4a3[_0xe965('0x28')]['dialGlobalMaxRetry'])_0x207222=0x1;_0x4a8fad({'additional':_0x207222});}else{return db[_0xe965('0x1e')][_0xe965('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x4fa489['id']},'order':[[_0xe965('0x20'),'ASC']]})[_0xe965('0xb')](function(_0x271e62){var _0x3d32e0=0x0;if(_0x271e62){if(_0x271e62[_0xe965('0x21')]+_0x271e62['countcongestionretry']+_0x271e62[_0xe965('0x23')]+_0x271e62['countnosuchnumberretry']+_0x271e62[_0xe965('0x24')]+_0x271e62[_0xe965('0x25')]+_0x271e62[_0xe965('0x26')]+_0x271e62[_0xe965('0x27')]<_0x28e4a3['entity'][_0xe965('0x29')])_0x3d32e0=0x1;_0x4a8fad({'additional':_0x3d32e0});}else{_0x4a8fad({'additional':0x0});}})[_0xe965('0x16')](function(_0x4ab59c){logger[_0xe965('0x12')](_0xe965('0x17'),_0x4ab59c['message']);_0x3ebd3c(_0x42992c[_0xe965('0x12')](0x1f4,_0x4ab59c[_0xe965('0x14')]));});}})['catch'](function(_0xfc793c){logger[_0xe965('0x12')](_0xe965('0x17'),_0xfc793c[_0xe965('0x14')]);_0x3ebd3c(_0x42992c[_0xe965('0x12')](0x1f4,_0xfc793c[_0xe965('0x14')]));});}else _0x4a8fad({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x4cd26b){var _0x12cec5=this;return new Promise(function(_0x2da84f,_0x19fc54){return db[_0xe965('0x18')][_0xe965('0x1f')]({'raw':!![],'where':{'ContactId':_0x4cd26b[_0xe965('0x19')]['ContactId'],'ListId':_0x4cd26b['body'][_0xe965('0x1b')],'VoiceQueueId':_0x4cd26b[_0xe965('0x19')][_0xe965('0x1c')]===undefined?null:_0x4cd26b[_0xe965('0x19')][_0xe965('0x1c')],'CampaignId':_0x4cd26b[_0xe965('0x19')][_0xe965('0x1d')]===undefined?null:_0x4cd26b[_0xe965('0x19')][_0xe965('0x1d')]}})[_0xe965('0xb')](function(_0x43477b){if(_0x43477b!=null){return db[_0xe965('0x1e')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x43477b['id'],'OrderBy':{'$gte':_0x43477b[_0xe965('0x20')]}},'order':[[_0xe965('0x20'),_0xe965('0x2a')]]})['then'](function(_0x5a5762){if(_0x5a5762)return activateAdditionalPhone(_0x43477b,_0x4cd26b['body'],_0x5a5762,_0x4cd26b['duration'],_0x4cd26b[_0xe965('0x2b')])[_0xe965('0xb')](function(_0x455d4c){_0x2da84f(_0x455d4c);});else{return db[_0xe965('0x1e')][_0xe965('0x1f')]({'raw':!![],'where':{'CmHopperId':_0x43477b['id']},'order':[[_0xe965('0x20'),_0xe965('0x2a')]]})['then'](function(_0xbb7438){if(_0xbb7438)return activateAdditionalPhone(_0x43477b,_0x4cd26b[_0xe965('0x19')],_0xbb7438,_0x4cd26b['duration'],_0x4cd26b[_0xe965('0x2b')])[_0xe965('0xb')](function(_0x5d2521){_0x2da84f(_0x5d2521);});else{_0x2da84f({'id':_0x43477b['id'],'phone':''});}})[_0xe965('0x16')](function(_0x139e8b){logger['error']('VerifyAdditionalPhones',_0x139e8b[_0xe965('0x14')]);_0x19fc54(_0x12cec5[_0xe965('0x12')](0x1f4,_0x139e8b[_0xe965('0x14')]));});}})[_0xe965('0x16')](function(_0x2c1cd4){logger[_0xe965('0x12')]('VerifyAdditionalPhones',_0x2c1cd4[_0xe965('0x14')]);_0x19fc54(_0x12cec5[_0xe965('0x12')](0x1f4,_0x2c1cd4[_0xe965('0x14')]));});}else _0x2da84f(0x1);});});};function activateAdditionalPhone(_0x1ee00a,_0x521a32,_0x1ed8a6,_0x37c616,_0x48c8c7){return new Promise(function(_0x8630e,_0x3a6323){var _0x137889;if(_[_0xe965('0x2c')](_0x1ed8a6[_0xe965('0x2d')])){_0x1ed8a6[_0xe965('0x2d')]=moment();}if(moment()>moment(_0x1ed8a6[_0xe965('0x2d')])){_0x137889=moment()['add'](_0x48c8c7||0x3,_0xe965('0x2e'));}else{if(_0x1ed8a6['OrderBy']==0x0){_0x137889=moment(_0x1ed8a6[_0xe965('0x2d')]);}else{_0x137889=moment()[_0xe965('0x2f')](_0x48c8c7||0x3,'minutes');}}if(_[_0xe965('0x2c')](_0x137889)){_0x137889=moment()[_0xe965('0x2f')](_0x48c8c7||0x3,_0xe965('0x2e'));}var _0x1932ee={'phone':_0x1ee00a[_0xe965('0x30')],'active':0x0,'OrderBy':_['isNil'](_0x1ee00a[_0xe965('0x20')])?0x0:_0x1ee00a[_0xe965('0x20')],'scheduledat':moment()['add'](_0x37c616||0x1,'minutes'),'countbusyretry':_0x521a32['countbusyretry'],'countcongestionretry':_0x521a32['countcongestionretry'],'countnoanswerretry':_0x521a32[_0xe965('0x23')],'countnosuchnumberretry':_0x521a32[_0xe965('0x31')],'countdropretry':_0x521a32[_0xe965('0x24')],'countabandonedretry':_0x521a32['countabandonedretry'],'countmachineretry':_0x521a32['countmachineretry'],'countagentrejectretry':_0x521a32[_0xe965('0x27')],'createdAt':_0x521a32[_0xe965('0x32')],'updatedAt':_0x521a32['updatedAt']};var _0x17600e={'CmHopperId':_0x1ee00a['id'],'phone':_0x1ed8a6[_0xe965('0x30')],'active':0x0,'OrderBy':_[_0xe965('0x2c')](_0x1ed8a6[_0xe965('0x20')])?0x0:_0x1ed8a6['OrderBy'],'scheduledat':_0x137889,'countbusyretry':_0x1ed8a6[_0xe965('0x21')],'countcongestionretry':_0x1ed8a6['countcongestionretry'],'countnoanswerretry':_0x1ed8a6[_0xe965('0x23')],'countnosuchnumberretry':_0x1ed8a6[_0xe965('0x31')],'countdropretry':_0x1ed8a6['countdropretry'],'countabandonedretry':_0x1ed8a6[_0xe965('0x25')],'countmachineretry':_0x1ed8a6['countmachineretry'],'countagentrejectretry':_0x1ed8a6[_0xe965('0x27')],'createdAt':_0x1ed8a6['createdAt'],'updatedAt':_0x1ed8a6['updatedAt']};return db['sequelize'][_0xe965('0x33')](function(_0x5e8aff){return db[_0xe965('0x1e')]['update'](_0x1932ee,{'where':{'id':_0x1ed8a6['id']}},{'transaction':_0x5e8aff})['then'](function(){return db[_0xe965('0x18')]['update'](_0x17600e,{'where':{'id':_0x1ee00a['id']}},{'transaction':_0x5e8aff});});})[_0xe965('0xb')](function(_0x37cc4c){_0x8630e({'id':_0x1ee00a['id'],'phone':_0x1ed8a6[_0xe965('0x30')]});})['catch'](function(_0x105ae2){logger[_0xe965('0x12')](_0xe965('0x34'),_0x105ae2[_0xe965('0x14')]);_0x3a6323({'error':_0x105ae2[_0xe965('0x14')]});});});}exports['IncrementPreviewCounters']=function(_0x20b70c){var _0x51e99f=this;return new Promise(function(_0x265368,_0x5c7938){return db[_0xe965('0x18')][_0xe965('0x35')](_0x20b70c[_0xe965('0x19')][_0xe965('0x36')],{'where':{'id':_0x20b70c[_0xe965('0x19')]['id']}})['then'](function(_0x23e002){_0x265368(_0x23e002);})[_0xe965('0x16')](function(_0x5d5e7b){logger[_0xe965('0x12')](_0xe965('0x37'),_0x5d5e7b[_0xe965('0x14')]);_0x5c7938(_0x51e99f[_0xe965('0x12')](0x1f4,_0x5d5e7b[_0xe965('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index beac5fb..b39f1bb 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3d4e=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','isAuthenticated','index','/:id','show','post','put'];(function(_0x1a1843,_0x56b413){var _0x494d5c=function(_0x1a6b5d){while(--_0x1a6b5d){_0x1a1843['push'](_0x1a1843['shift']());}};_0x494d5c(++_0x56b413);}(_0x3d4e,0x1dd));var _0xe3d4=function(_0x5902f2,_0x48ea58){_0x5902f2=_0x5902f2-0x0;var _0x379a0b=_0x3d4e[_0x5902f2];return _0x379a0b;};'use strict';var multer=require(_0xe3d4('0x0'));var util=require(_0xe3d4('0x1'));var path=require(_0xe3d4('0x2'));var timeout=require(_0xe3d4('0x3'));var express=require(_0xe3d4('0x4'));var router=express[_0xe3d4('0x5')]();var fs_extra=require(_0xe3d4('0x6'));var auth=require(_0xe3d4('0x7'));var interaction=require(_0xe3d4('0x8'));var config=require(_0xe3d4('0x9'));var controller=require(_0xe3d4('0xa'));router['get']('/',auth[_0xe3d4('0xb')](),controller[_0xe3d4('0xc')]);router['get'](_0xe3d4('0xd'),auth[_0xe3d4('0xb')](),controller[_0xe3d4('0xe')]);router[_0xe3d4('0xf')]('/',auth[_0xe3d4('0xb')](),controller['create']);router[_0xe3d4('0x10')](_0xe3d4('0xd'),auth[_0xe3d4('0xb')](),controller['update']);router[_0xe3d4('0x11')](_0xe3d4('0xd'),auth['isAuthenticated'](),controller[_0xe3d4('0x12')]);module['exports']=router; \ No newline at end of file +var _0xe152=['delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','post','create','update'];(function(_0x5503e2,_0x426323){var _0x27b7e5=function(_0x593a03){while(--_0x593a03){_0x5503e2['push'](_0x5503e2['shift']());}};_0x27b7e5(++_0x426323);}(_0xe152,0x158));var _0x2e15=function(_0x36db17,_0x2d0a60){_0x36db17=_0x36db17-0x0;var _0x5ddf47=_0xe152[_0x36db17];return _0x5ddf47;};'use strict';var multer=require(_0x2e15('0x0'));var util=require('util');var path=require(_0x2e15('0x1'));var timeout=require(_0x2e15('0x2'));var express=require(_0x2e15('0x3'));var router=express[_0x2e15('0x4')]();var fs_extra=require(_0x2e15('0x5'));var auth=require(_0x2e15('0x6'));var interaction=require(_0x2e15('0x7'));var config=require(_0x2e15('0x8'));var controller=require(_0x2e15('0x9'));router[_0x2e15('0xa')]('/',auth[_0x2e15('0xb')](),controller[_0x2e15('0xc')]);router[_0x2e15('0xa')](_0x2e15('0xd'),auth[_0x2e15('0xb')](),controller['show']);router[_0x2e15('0xe')]('/',auth[_0x2e15('0xb')](),controller[_0x2e15('0xf')]);router['put']('/:id',auth[_0x2e15('0xb')](),controller[_0x2e15('0x10')]);router[_0x2e15('0x11')](_0x2e15('0xd'),auth[_0x2e15('0xb')](),controller[_0x2e15('0x12')]);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 4b1792c..d3b5f67 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 _0xf0c2=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xf0c2,0x6e));var _0x2f0c=function(_0x22cc71,_0x58f502){_0x22cc71=_0x22cc71-0x0;var _0x14743f=_0xf0c2[_0x22cc71];return _0x14743f;};'use strict';var moment=require('moment');var Sequelize=require(_0x2f0c('0x0'));module[_0x2f0c('0x1')]={'phone':{'type':Sequelize[_0x2f0c('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x2f0c('0x3')],'unique':_0x2f0c('0x4')},'ListId':{'type':Sequelize[_0x2f0c('0x3')],'unique':_0x2f0c('0x4')},'VoiceQueueId':{'type':Sequelize[_0x2f0c('0x3')],'unique':_0x2f0c('0x4')}}; \ No newline at end of file +var _0xf385=['STRING','INTEGER','contactListQueue','moment'];(function(_0x55f742,_0x25a1f4){var _0x6f3e56=function(_0x4867fa){while(--_0x4867fa){_0x55f742['push'](_0x55f742['shift']());}};_0x6f3e56(++_0x25a1f4);}(_0xf385,0xab));var _0x5f38=function(_0x57ee1d,_0x54111b){_0x57ee1d=_0x57ee1d-0x0;var _0x12a933=_0xf385[_0x57ee1d];return _0x12a933;};'use strict';var moment=require(_0x5f38('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x5f38('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x5f38('0x2')],'unique':_0x5f38('0x3')},'ListId':{'type':Sequelize[_0x5f38('0x2')],'unique':_0x5f38('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 48d164e..ec1cc50 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 _0x78ca=['find','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','update','then','error','stack','name','send','map','CmHopperBlack','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','include','rows','catch','params','length'];(function(_0x59f322,_0x531389){var _0x29f11c=function(_0x2d0783){while(--_0x2d0783){_0x59f322['push'](_0x59f322['shift']());}};_0x29f11c(++_0x531389);}(_0x78ca,0xee));var _0xa78c=function(_0x493618,_0x2c3464){_0x493618=_0x493618-0x0;var _0x137c46=_0x78ca[_0x493618];return _0x137c46;};'use strict';var emlformat=require(_0xa78c('0x0'));var rimraf=require(_0xa78c('0x1'));var zipdir=require(_0xa78c('0x2'));var jsonpatch=require(_0xa78c('0x3'));var rp=require(_0xa78c('0x4'));var moment=require(_0xa78c('0x5'));var BPromise=require(_0xa78c('0x6'));var Mustache=require(_0xa78c('0x7'));var util=require('util');var path=require(_0xa78c('0x8'));var sox=require('sox');var csv=require(_0xa78c('0x9'));var ejs=require(_0xa78c('0xa'));var fs=require('fs');var fs_extra=require(_0xa78c('0xb'));var _=require(_0xa78c('0xc'));var squel=require('squel');var crypto=require(_0xa78c('0xd'));var jsforce=require(_0xa78c('0xe'));var deskjs=require(_0xa78c('0xf'));var toCsv=require(_0xa78c('0x9'));var querystring=require(_0xa78c('0x10'));var Papa=require(_0xa78c('0x11'));var Redis=require(_0xa78c('0x12'));var authService=require(_0xa78c('0x13'));var qs=require(_0xa78c('0x14'));var as=require(_0xa78c('0x15'));var hardwareService=require(_0xa78c('0x16'));var logger=require(_0xa78c('0x17'))(_0xa78c('0x18'));var utils=require(_0xa78c('0x19'));var config=require(_0xa78c('0x1a'));var licenseUtil=require(_0xa78c('0x1b'));var db=require(_0xa78c('0x1c'))['db'];function respondWithStatusCode(_0x381a09,_0x1b1491){_0x1b1491=_0x1b1491||0xcc;return function(_0x1b1ca4){if(_0x1b1ca4){return _0x381a09[_0xa78c('0x1d')](_0x1b1491);}return _0x381a09[_0xa78c('0x1e')](_0x1b1491)[_0xa78c('0x1f')]();};}function respondWithResult(_0x16bc78,_0x594218){_0x594218=_0x594218||0xc8;return function(_0x53bbfc){if(_0x53bbfc){return _0x16bc78['status'](_0x594218)['json'](_0x53bbfc);}};}function respondWithFilteredResult(_0x1c55f3,_0x1943cf){return function(_0x39c589){if(_0x39c589){var _0x562ab9=typeof _0x1943cf[_0xa78c('0x20')]==='undefined'&&typeof _0x1943cf[_0xa78c('0x21')]===_0xa78c('0x22');var _0x235aab=_0x39c589[_0xa78c('0x23')];var _0x4064b8=_0x562ab9?0x0:_0x1943cf[_0xa78c('0x20')];var _0x1ebbd4=_0x562ab9?_0x39c589[_0xa78c('0x23')]:_0x1943cf['offset']+_0x1943cf['limit'];var _0x258e42;if(_0x1ebbd4>=_0x235aab){_0x1ebbd4=_0x235aab;_0x258e42=0xc8;}else{_0x258e42=0xce;}_0x1c55f3[_0xa78c('0x1e')](_0x258e42);return _0x1c55f3[_0xa78c('0x24')]('Content-Range',_0x4064b8+'-'+_0x1ebbd4+'/'+_0x235aab)[_0xa78c('0x25')](_0x39c589);}return null;};}function patchUpdates(_0x4edf5e){return function(_0x435712){try{jsonpatch[_0xa78c('0x26')](_0x435712,_0x4edf5e,!![]);}catch(_0x462674){return BPromise[_0xa78c('0x27')](_0x462674);}return _0x435712[_0xa78c('0x28')]();};}function saveUpdates(_0x51547f,_0x317a10){return function(_0x2adac2){if(_0x2adac2){return _0x2adac2[_0xa78c('0x29')](_0x51547f)[_0xa78c('0x2a')](function(_0x4711a2){return _0x4711a2;});}return null;};}function removeEntity(_0x2d3788,_0x2cd217){return function(_0x30e98f){if(_0x30e98f){return _0x30e98f['destroy']()[_0xa78c('0x2a')](function(){_0x2d3788[_0xa78c('0x1e')](0xcc)[_0xa78c('0x1f')]();});}};}function handleEntityNotFound(_0x2421bd,_0x404485){return function(_0x186c23){if(!_0x186c23){_0x2421bd[_0xa78c('0x1d')](0x194);}return _0x186c23;};}function handleError(_0x12a987,_0x530a7){_0x530a7=_0x530a7||0x1f4;return function(_0x3dc9a6){logger[_0xa78c('0x2b')](_0x3dc9a6[_0xa78c('0x2c')]);if(_0x3dc9a6[_0xa78c('0x2d')]){delete _0x3dc9a6['name'];}_0x12a987[_0xa78c('0x1e')](_0x530a7)[_0xa78c('0x2e')](_0x3dc9a6);};}exports['index']=function(_0x53269d,_0x14a57b){var _0x3a9488={},_0x12b068={},_0x49e71e={'count':0x0,'rows':[]};var _0x14ff89=_[_0xa78c('0x2f')](db[_0xa78c('0x30')][_0xa78c('0x31')],function(_0x317293){return{'name':_0x317293[_0xa78c('0x32')],'type':_0x317293['type'][_0xa78c('0x33')]};});_0x12b068[_0xa78c('0x34')]=_['map'](_0x14ff89,'name');_0x12b068['query']=_[_0xa78c('0x35')](_0x53269d[_0xa78c('0x36')]);_0x12b068[_0xa78c('0x37')]=_['intersection'](_0x12b068['model'],_0x12b068[_0xa78c('0x36')]);_0x3a9488[_0xa78c('0x38')]=_[_0xa78c('0x39')](_0x12b068[_0xa78c('0x34')],qs[_0xa78c('0x3a')](_0x53269d[_0xa78c('0x36')][_0xa78c('0x3a')]));_0x3a9488['attributes']=_0x3a9488[_0xa78c('0x38')]['length']?_0x3a9488['attributes']:_0x12b068['model'];if(!_0x53269d[_0xa78c('0x36')][_0xa78c('0x3b')](_0xa78c('0x3c'))){_0x3a9488[_0xa78c('0x21')]=qs[_0xa78c('0x21')](_0x53269d['query']['limit']);_0x3a9488[_0xa78c('0x20')]=qs[_0xa78c('0x20')](_0x53269d['query']['offset']);}_0x3a9488[_0xa78c('0x3d')]=qs['sort'](_0x53269d['query'][_0xa78c('0x3e')]);_0x3a9488[_0xa78c('0x3f')]=qs[_0xa78c('0x37')](_['pick'](_0x53269d[_0xa78c('0x36')],_0x12b068['filters']),_0x14ff89);if(_0x53269d[_0xa78c('0x36')][_0xa78c('0x40')]){_0x3a9488[_0xa78c('0x3f')]=_[_0xa78c('0x41')](_0x3a9488[_0xa78c('0x3f')],{'$or':_[_0xa78c('0x2f')](_0x14ff89,function(_0x50b123){if(_0x50b123[_0xa78c('0x42')]!=='VIRTUAL'){var _0x31ad98={};_0x31ad98[_0x50b123[_0xa78c('0x2d')]]={'$like':'%'+_0x53269d[_0xa78c('0x36')][_0xa78c('0x40')]+'%'};return _0x31ad98;}})});}_0x3a9488=_[_0xa78c('0x41')]({},_0x3a9488,_0x53269d[_0xa78c('0x43')]);var _0x11c0be={'where':_0x3a9488[_0xa78c('0x3f')]};return db[_0xa78c('0x30')][_0xa78c('0x23')](_0x11c0be)[_0xa78c('0x2a')](function(_0x4afcef){_0x49e71e[_0xa78c('0x23')]=_0x4afcef;if(_0x53269d[_0xa78c('0x36')][_0xa78c('0x44')]){_0x3a9488[_0xa78c('0x45')]=[{'all':!![]}];}return db[_0xa78c('0x30')]['findAll'](_0x3a9488);})[_0xa78c('0x2a')](function(_0x2b1c78){_0x49e71e[_0xa78c('0x46')]=_0x2b1c78;return _0x49e71e;})[_0xa78c('0x2a')](respondWithFilteredResult(_0x14a57b,_0x3a9488))[_0xa78c('0x47')](handleError(_0x14a57b,null));};exports['show']=function(_0x2ab011,_0x1e587d){var _0x3b6f65={'raw':!![],'where':{'id':_0x2ab011[_0xa78c('0x48')]['id']}},_0x588d48={};_0x588d48[_0xa78c('0x34')]=_[_0xa78c('0x35')](db[_0xa78c('0x30')][_0xa78c('0x31')]);_0x588d48[_0xa78c('0x36')]=_['keys'](_0x2ab011[_0xa78c('0x36')]);_0x588d48['filters']=_['intersection'](_0x588d48['model'],_0x588d48['query']);_0x3b6f65[_0xa78c('0x38')]=_[_0xa78c('0x39')](_0x588d48['model'],qs[_0xa78c('0x3a')](_0x2ab011['query']['fields']));_0x3b6f65[_0xa78c('0x38')]=_0x3b6f65[_0xa78c('0x38')][_0xa78c('0x49')]?_0x3b6f65[_0xa78c('0x38')]:_0x588d48[_0xa78c('0x34')];if(_0x2ab011['query']['includeAll']){_0x3b6f65[_0xa78c('0x45')]=[{'all':!![]}];}_0x3b6f65=_[_0xa78c('0x41')]({},_0x3b6f65,_0x2ab011[_0xa78c('0x43')]);return db['CmHopperBlack'][_0xa78c('0x4a')](_0x3b6f65)[_0xa78c('0x2a')](handleEntityNotFound(_0x1e587d,null))[_0xa78c('0x2a')](respondWithResult(_0x1e587d,null))['catch'](handleError(_0x1e587d,null));};exports[_0xa78c('0x29')]=function(_0x2653ee,_0x2e96e1){if(_0x2653ee['body']['id']){delete _0x2653ee[_0xa78c('0x4b')]['id'];}return db[_0xa78c('0x30')][_0xa78c('0x4a')]({'where':{'id':_0x2653ee[_0xa78c('0x48')]['id']}})[_0xa78c('0x2a')](handleEntityNotFound(_0x2e96e1,null))[_0xa78c('0x2a')](saveUpdates(_0x2653ee[_0xa78c('0x4b')],null))[_0xa78c('0x2a')](respondWithResult(_0x2e96e1,null))[_0xa78c('0x47')](handleError(_0x2e96e1,null));};exports[_0xa78c('0x4c')]=function(_0x16ef8e,_0x4329f6){return db[_0xa78c('0x30')][_0xa78c('0x4a')]({'where':{'id':_0x16ef8e['params']['id']}})[_0xa78c('0x2a')](handleEntityNotFound(_0x4329f6,null))[_0xa78c('0x2a')](removeEntity(_0x4329f6,null))['catch'](handleError(_0x4329f6,null));};exports[_0xa78c('0x4d')]=function(_0x690239,_0x4696a2){return db['CmHopperBlack'][_0xa78c('0x4d')]()[_0xa78c('0x2a')](respondWithResult(_0x4696a2,null))[_0xa78c('0x47')](handleError(_0x4696a2,null));}; \ No newline at end of file +var _0xdbed=['zip-dir','fast-json-patch','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','CmHopperBlack','includeAll','include','findAll','rows','catch','params','find','body','destroy','eml-format','rimraf'];(function(_0x51fbd7,_0x1ed2eb){var _0x8dd910=function(_0x3bf290){while(--_0x3bf290){_0x51fbd7['push'](_0x51fbd7['shift']());}};_0x8dd910(++_0x1ed2eb);}(_0xdbed,0xca));var _0xddbe=function(_0x485485,_0x3dc9b6){_0x485485=_0x485485-0x0;var _0x4f15ed=_0xdbed[_0x485485];return _0x4f15ed;};'use strict';var emlformat=require(_0xddbe('0x0'));var rimraf=require(_0xddbe('0x1'));var zipdir=require(_0xddbe('0x2'));var jsonpatch=require(_0xddbe('0x3'));var rp=require('request-promise');var moment=require(_0xddbe('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xddbe('0x5'));var ejs=require(_0xddbe('0x6'));var fs=require('fs');var fs_extra=require(_0xddbe('0x7'));var _=require(_0xddbe('0x8'));var squel=require(_0xddbe('0x9'));var crypto=require(_0xddbe('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xddbe('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xddbe('0xc'));var Redis=require(_0xddbe('0xd'));var authService=require(_0xddbe('0xe'));var qs=require(_0xddbe('0xf'));var as=require(_0xddbe('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xddbe('0x11'));var config=require(_0xddbe('0x12'));var licenseUtil=require(_0xddbe('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13b4ef,_0x422964){_0x422964=_0x422964||0xcc;return function(_0x8ab39b){if(_0x8ab39b){return _0x13b4ef[_0xddbe('0x14')](_0x422964);}return _0x13b4ef[_0xddbe('0x15')](_0x422964)[_0xddbe('0x16')]();};}function respondWithResult(_0x17314c,_0x1b77c3){_0x1b77c3=_0x1b77c3||0xc8;return function(_0x2eaa66){if(_0x2eaa66){return _0x17314c[_0xddbe('0x15')](_0x1b77c3)[_0xddbe('0x17')](_0x2eaa66);}};}function respondWithFilteredResult(_0x507b72,_0x38ba04){return function(_0x1abeea){if(_0x1abeea){var _0xb2d0ee=typeof _0x38ba04[_0xddbe('0x18')]===_0xddbe('0x19')&&typeof _0x38ba04[_0xddbe('0x1a')]==='undefined';var _0x557a1b=_0x1abeea[_0xddbe('0x1b')];var _0x449bc1=_0xb2d0ee?0x0:_0x38ba04[_0xddbe('0x18')];var _0x4a2f37=_0xb2d0ee?_0x1abeea[_0xddbe('0x1b')]:_0x38ba04['offset']+_0x38ba04[_0xddbe('0x1a')];var _0x449c29;if(_0x4a2f37>=_0x557a1b){_0x4a2f37=_0x557a1b;_0x449c29=0xc8;}else{_0x449c29=0xce;}_0x507b72['status'](_0x449c29);return _0x507b72[_0xddbe('0x1c')]('Content-Range',_0x449bc1+'-'+_0x4a2f37+'/'+_0x557a1b)['json'](_0x1abeea);}return null;};}function patchUpdates(_0x12d36b){return function(_0x1c5ce0){try{jsonpatch[_0xddbe('0x1d')](_0x1c5ce0,_0x12d36b,!![]);}catch(_0x5bb269){return BPromise[_0xddbe('0x1e')](_0x5bb269);}return _0x1c5ce0['save']();};}function saveUpdates(_0x43ac7d,_0x3a8f51){return function(_0x21b2d5){if(_0x21b2d5){return _0x21b2d5[_0xddbe('0x1f')](_0x43ac7d)[_0xddbe('0x20')](function(_0x501a59){return _0x501a59;});}return null;};}function removeEntity(_0x452397,_0x2db05a){return function(_0x324d5b){if(_0x324d5b){return _0x324d5b['destroy']()['then'](function(){_0x452397[_0xddbe('0x15')](0xcc)[_0xddbe('0x16')]();});}};}function handleEntityNotFound(_0x3759b6,_0x35d0db){return function(_0x46f2aa){if(!_0x46f2aa){_0x3759b6[_0xddbe('0x14')](0x194);}return _0x46f2aa;};}function handleError(_0x5cc9bd,_0x5aa8e7){_0x5aa8e7=_0x5aa8e7||0x1f4;return function(_0x4d7b8c){logger[_0xddbe('0x21')](_0x4d7b8c[_0xddbe('0x22')]);if(_0x4d7b8c[_0xddbe('0x23')]){delete _0x4d7b8c[_0xddbe('0x23')];}_0x5cc9bd[_0xddbe('0x15')](_0x5aa8e7)['send'](_0x4d7b8c);};}exports[_0xddbe('0x24')]=function(_0x4e5d8a,_0x5f17fd){var _0x2114aa={},_0x375dfa={},_0x5a7228={'count':0x0,'rows':[]};var _0x169562=_[_0xddbe('0x25')](db['CmHopperBlack'][_0xddbe('0x26')],function(_0x1c80f8){return{'name':_0x1c80f8[_0xddbe('0x27')],'type':_0x1c80f8[_0xddbe('0x28')][_0xddbe('0x29')]};});_0x375dfa['model']=_[_0xddbe('0x25')](_0x169562,_0xddbe('0x23'));_0x375dfa[_0xddbe('0x2a')]=_[_0xddbe('0x2b')](_0x4e5d8a['query']);_0x375dfa[_0xddbe('0x2c')]=_[_0xddbe('0x2d')](_0x375dfa['model'],_0x375dfa[_0xddbe('0x2a')]);_0x2114aa['attributes']=_[_0xddbe('0x2d')](_0x375dfa[_0xddbe('0x2e')],qs[_0xddbe('0x2f')](_0x4e5d8a[_0xddbe('0x2a')]['fields']));_0x2114aa[_0xddbe('0x30')]=_0x2114aa[_0xddbe('0x30')][_0xddbe('0x31')]?_0x2114aa['attributes']:_0x375dfa[_0xddbe('0x2e')];if(!_0x4e5d8a[_0xddbe('0x2a')][_0xddbe('0x32')](_0xddbe('0x33'))){_0x2114aa[_0xddbe('0x1a')]=qs['limit'](_0x4e5d8a[_0xddbe('0x2a')][_0xddbe('0x1a')]);_0x2114aa[_0xddbe('0x18')]=qs[_0xddbe('0x18')](_0x4e5d8a['query'][_0xddbe('0x18')]);}_0x2114aa['order']=qs[_0xddbe('0x34')](_0x4e5d8a['query'][_0xddbe('0x34')]);_0x2114aa[_0xddbe('0x35')]=qs['filters'](_['pick'](_0x4e5d8a['query'],_0x375dfa[_0xddbe('0x2c')]),_0x169562);if(_0x4e5d8a[_0xddbe('0x2a')]['filter']){_0x2114aa['where']=_[_0xddbe('0x36')](_0x2114aa[_0xddbe('0x35')],{'$or':_[_0xddbe('0x25')](_0x169562,function(_0x318ef8){if(_0x318ef8['type']!==_0xddbe('0x37')){var _0x36b8a9={};_0x36b8a9[_0x318ef8[_0xddbe('0x23')]]={'$like':'%'+_0x4e5d8a[_0xddbe('0x2a')][_0xddbe('0x38')]+'%'};return _0x36b8a9;}})});}_0x2114aa=_[_0xddbe('0x36')]({},_0x2114aa,_0x4e5d8a[_0xddbe('0x39')]);var _0x2dae58={'where':_0x2114aa['where']};return db[_0xddbe('0x3a')][_0xddbe('0x1b')](_0x2dae58)[_0xddbe('0x20')](function(_0x182c4e){_0x5a7228[_0xddbe('0x1b')]=_0x182c4e;if(_0x4e5d8a['query'][_0xddbe('0x3b')]){_0x2114aa[_0xddbe('0x3c')]=[{'all':!![]}];}return db[_0xddbe('0x3a')][_0xddbe('0x3d')](_0x2114aa);})[_0xddbe('0x20')](function(_0x5d3e8e){_0x5a7228[_0xddbe('0x3e')]=_0x5d3e8e;return _0x5a7228;})[_0xddbe('0x20')](respondWithFilteredResult(_0x5f17fd,_0x2114aa))[_0xddbe('0x3f')](handleError(_0x5f17fd,null));};exports['show']=function(_0x488dd4,_0x398a14){var _0x456935={'raw':!![],'where':{'id':_0x488dd4[_0xddbe('0x40')]['id']}},_0x15319e={};_0x15319e[_0xddbe('0x2e')]=_['keys'](db[_0xddbe('0x3a')][_0xddbe('0x26')]);_0x15319e['query']=_[_0xddbe('0x2b')](_0x488dd4[_0xddbe('0x2a')]);_0x15319e['filters']=_['intersection'](_0x15319e[_0xddbe('0x2e')],_0x15319e['query']);_0x456935[_0xddbe('0x30')]=_[_0xddbe('0x2d')](_0x15319e[_0xddbe('0x2e')],qs[_0xddbe('0x2f')](_0x488dd4[_0xddbe('0x2a')][_0xddbe('0x2f')]));_0x456935[_0xddbe('0x30')]=_0x456935[_0xddbe('0x30')][_0xddbe('0x31')]?_0x456935[_0xddbe('0x30')]:_0x15319e[_0xddbe('0x2e')];if(_0x488dd4[_0xddbe('0x2a')][_0xddbe('0x3b')]){_0x456935['include']=[{'all':!![]}];}_0x456935=_[_0xddbe('0x36')]({},_0x456935,_0x488dd4[_0xddbe('0x39')]);return db[_0xddbe('0x3a')][_0xddbe('0x41')](_0x456935)[_0xddbe('0x20')](handleEntityNotFound(_0x398a14,null))['then'](respondWithResult(_0x398a14,null))[_0xddbe('0x3f')](handleError(_0x398a14,null));};exports[_0xddbe('0x1f')]=function(_0x42de54,_0x28519e){if(_0x42de54[_0xddbe('0x42')]['id']){delete _0x42de54[_0xddbe('0x42')]['id'];}return db[_0xddbe('0x3a')][_0xddbe('0x41')]({'where':{'id':_0x42de54[_0xddbe('0x40')]['id']}})['then'](handleEntityNotFound(_0x28519e,null))[_0xddbe('0x20')](saveUpdates(_0x42de54[_0xddbe('0x42')],null))[_0xddbe('0x20')](respondWithResult(_0x28519e,null))[_0xddbe('0x3f')](handleError(_0x28519e,null));};exports[_0xddbe('0x43')]=function(_0xfbc2f,_0x2f3ecf){return db[_0xddbe('0x3a')][_0xddbe('0x41')]({'where':{'id':_0xfbc2f[_0xddbe('0x40')]['id']}})[_0xddbe('0x20')](handleEntityNotFound(_0x2f3ecf,null))['then'](removeEntity(_0x2f3ecf,null))['catch'](handleError(_0x2f3ecf,null));};exports['describe']=function(_0x48447d,_0x28ad23){return db['CmHopperBlack']['describe']()[_0xddbe('0x20')](respondWithResult(_0x28ad23,null))['catch'](handleError(_0x28ad23,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 7e61cf8..d32a194 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 _0xca09=['CmHopperBlack','cm_hopper_black','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperBlack.attributes','define'];(function(_0x4f8a83,_0x2d5356){var _0x5d4ad5=function(_0x59eb1a){while(--_0x59eb1a){_0x4f8a83['push'](_0x4f8a83['shift']());}};_0x5d4ad5(++_0x2d5356);}(_0xca09,0x1c4));var _0x9ca0=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca09[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9ca0('0x0'))(_0x9ca0('0x1'));var moment=require(_0x9ca0('0x2'));var BPromise=require(_0x9ca0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ca0('0x4'));var rimraf=require(_0x9ca0('0x5'));var config=require('../../config/environment');var attributes=require(_0x9ca0('0x6'));module['exports']=function(_0x523c5f,_0x9b2261){return _0x523c5f[_0x9ca0('0x7')](_0x9ca0('0x8'),attributes,{'tableName':_0x9ca0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77ab=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','../../config/logger','api','moment'];(function(_0x1796ca,_0x116132){var _0xd267e8=function(_0x4687b7){while(--_0x4687b7){_0x1796ca['push'](_0x1796ca['shift']());}};_0xd267e8(++_0x116132);}(_0x77ab,0x19f));var _0xb77a=function(_0x4cc391,_0xea2582){_0x4cc391=_0x4cc391-0x0;var _0x7e2cd5=_0x77ab[_0x4cc391];return _0x7e2cd5;};'use strict';var _=require(_0xb77a('0x0'));var util=require(_0xb77a('0x1'));var logger=require(_0xb77a('0x2'))(_0xb77a('0x3'));var moment=require(_0xb77a('0x4'));var BPromise=require(_0xb77a('0x5'));var rp=require(_0xb77a('0x6'));var fs=require('fs');var path=require(_0xb77a('0x7'));var rimraf=require(_0xb77a('0x8'));var config=require(_0xb77a('0x9'));var attributes=require(_0xb77a('0xa'));module[_0xb77a('0xb')]=function(_0x12d2c7,_0x48a3b9){return _0x12d2c7[_0xb77a('0xc')]('CmHopperBlack',attributes,{'tableName':_0xb77a('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 bc4f587..cec66f5 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 _0x0f95=['findAll','options','raw','where','limit','map','attributes','include','model','UpdateCmHopperBlack','update','body','catch','DestroyCmHopperBlack','destroy','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetCmHopperBlack','CmHopperBlack'];(function(_0x1cc90d,_0x2cce0e){var _0x451db6=function(_0x547157){while(--_0x547157){_0x1cc90d['push'](_0x1cc90d['shift']());}};_0x451db6(++_0x2cce0e);}(_0x0f95,0xd2));var _0x50f9=function(_0x316c42,_0x3391f0){_0x316c42=_0x316c42-0x0;var _0x2b38f7=_0x0f95[_0x316c42];return _0x2b38f7;};'use strict';var _=require(_0x50f9('0x0'));var util=require(_0x50f9('0x1'));var moment=require(_0x50f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x50f9('0x3'));var fs=require('fs');var Redis=require(_0x50f9('0x4'));var db=require(_0x50f9('0x5'))['db'];var utils=require(_0x50f9('0x6'));var logger=require('../../config/logger')(_0x50f9('0x7'));var config=require(_0x50f9('0x8'));var jayson=require(_0x50f9('0x9'));var client=jayson['client'][_0x50f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x529ab2,_0x48f04d,_0xeb2fda){return new BPromise(function(_0x5803a6,_0x7a6036){return client[_0x50f9('0xb')](_0x529ab2,_0xeb2fda)[_0x50f9('0xc')](function(_0x2750a2){logger[_0x50f9('0xd')](_0x50f9('0xe'),_0x48f04d,'request\x20sent');logger[_0x50f9('0xf')](_0x50f9('0x10'),_0x48f04d,_0x50f9('0x11'),JSON[_0x50f9('0x12')](_0x2750a2));if(_0x2750a2['error']){if(_0x2750a2[_0x50f9('0x13')][_0x50f9('0x14')]===0x1f4){logger['error'](_0x50f9('0xe'),_0x48f04d,_0x2750a2[_0x50f9('0x13')][_0x50f9('0x15')]);return _0x7a6036(_0x2750a2[_0x50f9('0x13')]['message']);}logger[_0x50f9('0x13')](_0x50f9('0xe'),_0x48f04d,_0x2750a2[_0x50f9('0x13')][_0x50f9('0x15')]);return _0x5803a6(_0x2750a2[_0x50f9('0x13')]['message']);}else{logger[_0x50f9('0xd')](_0x50f9('0xe'),_0x48f04d,_0x50f9('0x11'));_0x5803a6(_0x2750a2['result'][_0x50f9('0x15')]);}})['catch'](function(_0x12efc9){logger[_0x50f9('0x13')](_0x50f9('0xe'),_0x48f04d,_0x12efc9);_0x7a6036(_0x12efc9);});});}exports[_0x50f9('0x16')]=function(_0x16f79c){var _0x42caf2=this;return new Promise(function(_0x51d900,_0x11ca1b){return db[_0x50f9('0x17')][_0x50f9('0x18')]({'raw':_0x16f79c[_0x50f9('0x19')]?_0x16f79c[_0x50f9('0x19')][_0x50f9('0x1a')]===undefined?!![]:![]:!![],'where':_0x16f79c[_0x50f9('0x19')]?_0x16f79c[_0x50f9('0x19')][_0x50f9('0x1b')]||null:null,'attributes':_0x16f79c[_0x50f9('0x19')]?_0x16f79c[_0x50f9('0x19')]['attributes']||null:null,'limit':_0x16f79c[_0x50f9('0x19')]?_0x16f79c['options'][_0x50f9('0x1c')]||null:null,'include':_0x16f79c[_0x50f9('0x19')]?_0x16f79c['options']['include']?_[_0x50f9('0x1d')](_0x16f79c[_0x50f9('0x19')]['include'],function(_0x486525){return{'model':db[_0x486525['model']],'as':_0x486525['as'],'attributes':_0x486525[_0x50f9('0x1e')],'include':_0x486525[_0x50f9('0x1f')]?_['map'](_0x486525[_0x50f9('0x1f')],function(_0x20a81f){return{'model':db[_0x20a81f[_0x50f9('0x20')]],'as':_0x20a81f['as'],'attributes':_0x20a81f[_0x50f9('0x1e')],'include':_0x20a81f[_0x50f9('0x1f')]?_['map'](_0x20a81f[_0x50f9('0x1f')],function(_0x4ae15a){return{'model':db[_0x4ae15a[_0x50f9('0x20')]],'as':_0x4ae15a['as'],'attributes':_0x4ae15a[_0x50f9('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x50f9('0xc')](function(_0x37ae45){logger[_0x50f9('0xd')](_0x50f9('0x16'),_0x16f79c);logger[_0x50f9('0xf')]('GetCmHopperBlack',_0x16f79c,JSON[_0x50f9('0x12')](_0x37ae45));_0x51d900(_0x37ae45);})['catch'](function(_0xf54950){logger[_0x50f9('0x13')](_0x50f9('0x16'),_0xf54950['message'],_0x16f79c);_0x11ca1b(_0x42caf2[_0x50f9('0x13')](0x1f4,_0xf54950[_0x50f9('0x15')]));});});};exports[_0x50f9('0x21')]=function(_0x341d40){var _0x300105=this;return new Promise(function(_0x3ed222,_0x573e10){return db[_0x50f9('0x17')][_0x50f9('0x22')](_0x341d40[_0x50f9('0x23')],{'raw':_0x341d40[_0x50f9('0x19')]?_0x341d40[_0x50f9('0x19')][_0x50f9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x341d40[_0x50f9('0x19')]?_0x341d40[_0x50f9('0x19')][_0x50f9('0x1b')]||null:null,'attributes':_0x341d40['options']?_0x341d40['options'][_0x50f9('0x1e')]||null:null,'limit':_0x341d40[_0x50f9('0x19')]?_0x341d40[_0x50f9('0x19')]['limit']||null:null})[_0x50f9('0xc')](function(_0x1e45b2){logger[_0x50f9('0xd')](_0x50f9('0x21'),_0x341d40);logger[_0x50f9('0xf')](_0x50f9('0x21'),_0x341d40,JSON[_0x50f9('0x12')](_0x1e45b2));_0x3ed222(_0x1e45b2);})[_0x50f9('0x24')](function(_0x240658){logger['error'](_0x50f9('0x21'),_0x240658[_0x50f9('0x15')],_0x341d40);_0x573e10(_0x300105['error'](0x1f4,_0x240658[_0x50f9('0x15')]));});});};exports[_0x50f9('0x25')]=function(_0x2a6e60){var _0x1846c0=this;return new Promise(function(_0x2db1cc,_0x3e2e9f){return db[_0x50f9('0x17')][_0x50f9('0x26')]({'where':_0x2a6e60[_0x50f9('0x19')]?_0x2a6e60[_0x50f9('0x19')][_0x50f9('0x1b')]||null:null})[_0x50f9('0xc')](function(_0x5817ad){logger['info'](_0x50f9('0x25'),_0x2a6e60);logger[_0x50f9('0xf')](_0x50f9('0x25'),_0x2a6e60,JSON[_0x50f9('0x12')](_0x5817ad));_0x2db1cc(_0x5817ad);})[_0x50f9('0x24')](function(_0x4a475d){logger[_0x50f9('0x13')]('DestroyCmHopperBlack',_0x4a475d['message'],_0x2a6e60);_0x3e2e9f(_0x1846c0[_0x50f9('0x13')](0x1f4,_0x4a475d[_0x50f9('0x15')]));});});}; \ No newline at end of file +var _0xcbd2=['then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','map','model','debug','UpdateCmHopperBlack','body','DestroyCmHopperBlack','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x13b405,_0x430d9d){var _0x4aed46=function(_0x29b9f5){while(--_0x29b9f5){_0x13b405['push'](_0x13b405['shift']());}};_0x4aed46(++_0x430d9d);}(_0xcbd2,0xd3));var _0x2cbd=function(_0x367361,_0x311488){_0x367361=_0x367361-0x0;var _0x195d2d=_0xcbd2[_0x367361];return _0x195d2d;};'use strict';var _=require('lodash');var util=require(_0x2cbd('0x0'));var moment=require('moment');var BPromise=require(_0x2cbd('0x1'));var rs=require(_0x2cbd('0x2'));var fs=require('fs');var Redis=require(_0x2cbd('0x3'));var db=require(_0x2cbd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cbd('0x5'))(_0x2cbd('0x6'));var config=require(_0x2cbd('0x7'));var jayson=require(_0x2cbd('0x8'));var client=jayson[_0x2cbd('0x9')][_0x2cbd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56d2fe,_0x3601dd,_0x208879){return new BPromise(function(_0x23030a,_0x38eeaf){return client['request'](_0x56d2fe,_0x208879)[_0x2cbd('0xb')](function(_0x34f3a3){logger[_0x2cbd('0xc')](_0x2cbd('0xd'),_0x3601dd,_0x2cbd('0xe'));logger['debug'](_0x2cbd('0xf'),_0x3601dd,_0x2cbd('0xe'),JSON[_0x2cbd('0x10')](_0x34f3a3));if(_0x34f3a3['error']){if(_0x34f3a3[_0x2cbd('0x11')][_0x2cbd('0x12')]===0x1f4){logger['error'](_0x2cbd('0xd'),_0x3601dd,_0x34f3a3[_0x2cbd('0x11')][_0x2cbd('0x13')]);return _0x38eeaf(_0x34f3a3['error'][_0x2cbd('0x13')]);}logger[_0x2cbd('0x11')](_0x2cbd('0xd'),_0x3601dd,_0x34f3a3[_0x2cbd('0x11')][_0x2cbd('0x13')]);return _0x23030a(_0x34f3a3[_0x2cbd('0x11')]['message']);}else{logger[_0x2cbd('0xc')](_0x2cbd('0xd'),_0x3601dd,_0x2cbd('0xe'));_0x23030a(_0x34f3a3[_0x2cbd('0x14')]['message']);}})[_0x2cbd('0x15')](function(_0x40fe09){logger['error'](_0x2cbd('0xd'),_0x3601dd,_0x40fe09);_0x38eeaf(_0x40fe09);});});}exports[_0x2cbd('0x16')]=function(_0x515dfe){var _0x229592=this;return new Promise(function(_0x204dda,_0xb27407){return db[_0x2cbd('0x17')][_0x2cbd('0x18')]({'raw':_0x515dfe[_0x2cbd('0x19')]?_0x515dfe[_0x2cbd('0x19')][_0x2cbd('0x1a')]===undefined?!![]:![]:!![],'where':_0x515dfe['options']?_0x515dfe[_0x2cbd('0x19')][_0x2cbd('0x1b')]||null:null,'attributes':_0x515dfe[_0x2cbd('0x19')]?_0x515dfe[_0x2cbd('0x19')][_0x2cbd('0x1c')]||null:null,'limit':_0x515dfe[_0x2cbd('0x19')]?_0x515dfe[_0x2cbd('0x19')][_0x2cbd('0x1d')]||null:null,'include':_0x515dfe[_0x2cbd('0x19')]?_0x515dfe[_0x2cbd('0x19')][_0x2cbd('0x1e')]?_[_0x2cbd('0x1f')](_0x515dfe[_0x2cbd('0x19')]['include'],function(_0x33cb95){return{'model':db[_0x33cb95[_0x2cbd('0x20')]],'as':_0x33cb95['as'],'attributes':_0x33cb95[_0x2cbd('0x1c')],'include':_0x33cb95[_0x2cbd('0x1e')]?_['map'](_0x33cb95[_0x2cbd('0x1e')],function(_0x141071){return{'model':db[_0x141071[_0x2cbd('0x20')]],'as':_0x141071['as'],'attributes':_0x141071[_0x2cbd('0x1c')],'include':_0x141071['include']?_[_0x2cbd('0x1f')](_0x141071[_0x2cbd('0x1e')],function(_0x5b6a55){return{'model':db[_0x5b6a55[_0x2cbd('0x20')]],'as':_0x5b6a55['as'],'attributes':_0x5b6a55['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c6023){logger[_0x2cbd('0xc')](_0x2cbd('0x16'),_0x515dfe);logger[_0x2cbd('0x21')]('GetCmHopperBlack',_0x515dfe,JSON[_0x2cbd('0x10')](_0x5c6023));_0x204dda(_0x5c6023);})[_0x2cbd('0x15')](function(_0x4d2282){logger[_0x2cbd('0x11')](_0x2cbd('0x16'),_0x4d2282[_0x2cbd('0x13')],_0x515dfe);_0xb27407(_0x229592[_0x2cbd('0x11')](0x1f4,_0x4d2282[_0x2cbd('0x13')]));});});};exports[_0x2cbd('0x22')]=function(_0x28f20c){var _0xdfeef1=this;return new Promise(function(_0x2d32a7,_0x5145a6){return db[_0x2cbd('0x17')]['update'](_0x28f20c[_0x2cbd('0x23')],{'raw':_0x28f20c['options']?_0x28f20c[_0x2cbd('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28f20c['options']?_0x28f20c['options'][_0x2cbd('0x1b')]||null:null,'attributes':_0x28f20c[_0x2cbd('0x19')]?_0x28f20c[_0x2cbd('0x19')][_0x2cbd('0x1c')]||null:null,'limit':_0x28f20c['options']?_0x28f20c[_0x2cbd('0x19')]['limit']||null:null})[_0x2cbd('0xb')](function(_0x3b8bfe){logger['info'](_0x2cbd('0x22'),_0x28f20c);logger[_0x2cbd('0x21')](_0x2cbd('0x22'),_0x28f20c,JSON[_0x2cbd('0x10')](_0x3b8bfe));_0x2d32a7(_0x3b8bfe);})[_0x2cbd('0x15')](function(_0x42aed2){logger[_0x2cbd('0x11')](_0x2cbd('0x22'),_0x42aed2[_0x2cbd('0x13')],_0x28f20c);_0x5145a6(_0xdfeef1['error'](0x1f4,_0x42aed2[_0x2cbd('0x13')]));});});};exports[_0x2cbd('0x24')]=function(_0x49fbf3){var _0x3f4904=this;return new Promise(function(_0x2024f5,_0x4984d4){return db['CmHopperBlack']['destroy']({'where':_0x49fbf3[_0x2cbd('0x19')]?_0x49fbf3[_0x2cbd('0x19')][_0x2cbd('0x1b')]||null:null})['then'](function(_0x3ffab1){logger[_0x2cbd('0xc')](_0x2cbd('0x24'),_0x49fbf3);logger['debug']('DestroyCmHopperBlack',_0x49fbf3,JSON['stringify'](_0x3ffab1));_0x2024f5(_0x3ffab1);})['catch'](function(_0x1dce55){logger['error'](_0x2cbd('0x24'),_0x1dce55[_0x2cbd('0x13')],_0x49fbf3);_0x4984d4(_0x3f4904[_0x2cbd('0x11')](0x1f4,_0x1dce55[_0x2cbd('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 58f65e3..b7d8cf4 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 _0x3a6d=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3a6d,0x143));var _0xd3a6=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x3a6d[_0x11005e];return _0x29338f;};'use strict';var multer=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var path=require('path');var timeout=require(_0xd3a6('0x2'));var express=require(_0xd3a6('0x3'));var router=express[_0xd3a6('0x4')]();var fs_extra=require(_0xd3a6('0x5'));var auth=require(_0xd3a6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd3a6('0x7'));var controller=require(_0xd3a6('0x8'));router[_0xd3a6('0x9')]('/',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xb')]);router[_0xd3a6('0x9')]('/describe',auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xc')]);router[_0xd3a6('0x9')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0xe')]);router[_0xd3a6('0xf')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller['update']);router[_0xd3a6('0x10')](_0xd3a6('0xd'),auth[_0xd3a6('0xa')](),controller[_0xd3a6('0x11')]);module[_0xd3a6('0x12')]=router; \ No newline at end of file +var _0x1883=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','/:id','show','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2f47f1,_0x17f6a7){var _0x1e2329=function(_0x8f5900){while(--_0x8f5900){_0x2f47f1['push'](_0x2f47f1['shift']());}};_0x1e2329(++_0x17f6a7);}(_0x1883,0xab));var _0x3188=function(_0x27d233,_0x18ffad){_0x27d233=_0x27d233-0x0;var _0x5963be=_0x1883[_0x27d233];return _0x5963be;};'use strict';var multer=require(_0x3188('0x0'));var util=require(_0x3188('0x1'));var path=require(_0x3188('0x2'));var timeout=require(_0x3188('0x3'));var express=require(_0x3188('0x4'));var router=express[_0x3188('0x5')]();var fs_extra=require(_0x3188('0x6'));var auth=require(_0x3188('0x7'));var interaction=require(_0x3188('0x8'));var config=require(_0x3188('0x9'));var controller=require(_0x3188('0xa'));router[_0x3188('0xb')]('/',auth[_0x3188('0xc')](),controller[_0x3188('0xd')]);router[_0x3188('0xb')](_0x3188('0xe'),auth[_0x3188('0xc')](),controller['describe']);router[_0x3188('0xb')](_0x3188('0xf'),auth['isAuthenticated'](),controller[_0x3188('0x10')]);router['put'](_0x3188('0xf'),auth[_0x3188('0xc')](),controller[_0x3188('0x11')]);router[_0x3188('0x12')]('/:id',auth[_0x3188('0xc')](),controller[_0x3188('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index fd54680..3b5e8f1 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 _0x00fb=['getDataValue','setDataValue','followuptime','seconds','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x2d7425,_0x1d9f1e){var _0x11b926=function(_0x204717){while(--_0x204717){_0x2d7425['push'](_0x2d7425['shift']());}};_0x11b926(++_0x1d9f1e);}(_0x00fb,0xb5));var _0xb00f=function(_0x35ba0a,_0x57eaeb){_0x35ba0a=_0x35ba0a-0x0;var _0x4bddb0=_0x00fb[_0x35ba0a];return _0x4bddb0;};'use strict';var Sequelize=require(_0xb00f('0x0'));var moment=require(_0xb00f('0x1'));module[_0xb00f('0x2')]={'state':{'type':Sequelize[_0xb00f('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb00f('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb00f('0x5')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb00f('0x5')]},'droptime':{'type':Sequelize[_0xb00f('0x5')]},'endtime':{'type':Sequelize[_0xb00f('0x5')]},'ringtime':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb00f('0x4')]},'campaign':{'type':Sequelize[_0xb00f('0x4')]},'campaigntype':{'type':Sequelize[_0xb00f('0x4')]},'membername':{'type':Sequelize[_0xb00f('0x4')]},'reason':{'type':Sequelize[_0xb00f('0x4')]},'disposition':{'type':Sequelize[_0xb00f('0x4')]},'secondDisposition':{'type':Sequelize[_0xb00f('0x4')]},'thirdDisposition':{'type':Sequelize[_0xb00f('0x4')]},'dispositionat':{'type':Sequelize[_0xb00f('0x5')],'set':function(_0x92823e){var _0x1f989c=this[_0xb00f('0x6')]('endtime');if(_0x1f989c&&_0x92823e){this[_0xb00f('0x7')](_0xb00f('0x8'),moment(_0x92823e)['diff'](moment(_0x1f989c),_0xb00f('0x9')));}}},'amd':{'type':Sequelize[_0xb00f('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb00f('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb00f('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb00f('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb00f('0x5')]},'deleted':{'type':Sequelize[_0xb00f('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb00f('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb00f('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb00f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcc7b=['INTEGER','STRING','DATE','endtime','followuptime','BOOLEAN','moment','exports'];(function(_0x39336c,_0x5ef836){var _0x36aba1=function(_0x5a0209){while(--_0x5a0209){_0x39336c['push'](_0x39336c['shift']());}};_0x36aba1(++_0x5ef836);}(_0xcc7b,0x15e));var _0xbcc7=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcc7b[_0x4b055c];return _0x4b62bb;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xbcc7('0x0'));module[_0xbcc7('0x1')]={'state':{'type':Sequelize[_0xbcc7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xbcc7('0x3')]},'scheduledat':{'type':Sequelize[_0xbcc7('0x4')]},'countbusyretry':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xbcc7('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xbcc7('0x3')]},'originatecalleridname':{'type':Sequelize[_0xbcc7('0x3')]},'calleridnum':{'type':Sequelize[_0xbcc7('0x3')]},'calleridname':{'type':Sequelize[_0xbcc7('0x3')]},'starttime':{'type':Sequelize[_0xbcc7('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xbcc7('0x4')]},'droptime':{'type':Sequelize[_0xbcc7('0x4')]},'endtime':{'type':Sequelize[_0xbcc7('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xbcc7('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xbcc7('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xbcc7('0x3')]},'disposition':{'type':Sequelize[_0xbcc7('0x3')]},'secondDisposition':{'type':Sequelize[_0xbcc7('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x4a2a20){var _0x3dffc8=this['getDataValue'](_0xbcc7('0x5'));if(_0x3dffc8&&_0x4a2a20){this['setDataValue'](_0xbcc7('0x6'),moment(_0x4a2a20)['diff'](moment(_0x3dffc8),'seconds'));}}},'amd':{'type':Sequelize[_0xbcc7('0x7')],'defaultValue':![]},'fax':{'type':Sequelize[_0xbcc7('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xbcc7('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xbcc7('0x7')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xbcc7('0x4')]},'callback':{'type':Sequelize[_0xbcc7('0x7')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xbcc7('0x4')]},'recallme':{'type':Sequelize[_0xbcc7('0x7')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xbcc7('0x4')]},'countnosuchnumberretry':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xbcc7('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 5bc5add..50f7cb7 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 _0xc2c7=['`state`\x20=\x205,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','select','field','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','updatedAt','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','group','moveContactsIvrCampaignHopperFinal','Campaign','ANY_VALUE(calleridnum)','CampaignId','CampaignId\x20=\x20?','calleridnum','state\x20=\x204','checkContactHopper','CmHopper','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','uniqueid','params','body','countContactsQueueCampaignHopperFinal','sequelize','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','countContactsIvrCampaignHopperFinal'];(function(_0x597054,_0x300930){var _0x41db54=function(_0x299c45){while(--_0x299c45){_0x597054['push'](_0x597054['shift']());}};_0x41db54(++_0x300930);}(_0xc2c7,0x134));var _0x7c2c=function(_0x5e6b7f,_0x5e5339){_0x5e6b7f=_0x5e6b7f-0x0;var _0x1ab986=_0xc2c7[_0x5e6b7f];return _0x1ab986;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['CmHopperFinal'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['describe']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['describe']()['then'](respondWithResult(_0x3091bd,null))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x39d5af,_0x2b79d5){if(_0x39d5af['body']['uniqueid']){delete _0x39d5af['body'][_0x7c2c('0x48')];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'uniqueid':_0x39d5af[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x2b79d5,null))['then'](saveUpdates(_0x39d5af[_0x7c2c('0x4a')],null))[_0x7c2c('0x26')](respondWithResult(_0x2b79d5,null))['catch'](handleError(_0x2b79d5,null));};exports[_0x7c2c('0x4b')]=function(_0x56e09d,_0xfba6a7,_0x3806f4){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x56e09d['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x4d')))),_0x7c2c('0x4e')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')]('`state`\x20=\x205,\x201,\x20null'))),_0x7c2c('0x53')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x54')))),'congestionContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x58')))),_0x7c2c('0x59')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})[_0x7c2c('0x26')](handleEntityNotFound(_0xfba6a7,null))[_0x7c2c('0x26')](respondWithResult(_0xfba6a7,null))[_0x7c2c('0x45')](handleError(_0xfba6a7,null));};exports[_0x7c2c('0x5a')]=function(_0x44602a,_0x1ad537,_0x2d04da){return db[_0x7c2c('0x2c')]['findAll']({'raw':![],'where':{'CampaignId':_0x44602a['params']['id']},'attributes':[[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal']('`state`\x20=\x200,\x201,\x20null'))),_0x7c2c('0x4e')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x51')))),_0x7c2c('0x52')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')][_0x7c2c('0x50')](_0x7c2c('0x5b')))),'busyContacts'],[db[_0x7c2c('0x4c')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x7c2c('0x54')))),_0x7c2c('0x5c')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x55')))),_0x7c2c('0x56')],[db[_0x7c2c('0x4c')]['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5d')))),_0x7c2c('0x57')],[db['sequelize']['fn'](_0x7c2c('0x4f'),db[_0x7c2c('0x4c')]['fn']('IF',db['sequelize'][_0x7c2c('0x50')](_0x7c2c('0x58')))),'reCallContacts'],[db['sequelize']['fn'](_0x7c2c('0x4f'),db['sequelize']['fn']('IF',db[_0x7c2c('0x4c')]['literal'](_0x7c2c('0x5e')))),_0x7c2c('0x5f')]]})['then'](handleEntityNotFound(_0x1ad537,null))[_0x7c2c('0x26')](respondWithResult(_0x1ad537,null))['catch'](handleError(_0x1ad537,null));};exports[_0x7c2c('0x60')]=function(_0x2b597d,_0x20eb63,_0x56f737){return db[_0x7c2c('0x61')][_0x7c2c('0x47')]({'where':{'id':_0x2b597d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x20eb63,null))['then'](function(_0x158352){var _0x1e711e;if(_0x158352){_0x1e711e=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')](_0x7c2c('0x64'))[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),'ListId',_0x7c2c('0x69'),_0x7c2c('0x6a'),'updatedAt'],squel[_0x7c2c('0x6b')]()['field']('ANY_VALUE(calleridnum)',_0x7c2c('0x66'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),'scheduledAt')[_0x7c2c('0x6c')](_0x7c2c('0x6e'),_0x7c2c('0x68'))['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')](_0x7c2c('0x71'),'VoiceQueueId')[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),_0x7c2c('0x72'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2b597d[_0x7c2c('0x4a')][_0x7c2c('0x77')][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x66'))[_0x7c2c('0x73')](_0x7c2c('0x64'))['where'](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id']['toString']()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel['select']()[_0x7c2c('0x6c')]('calleridnum')[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')](_0x7c2c('0x75'),_0x2b597d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')]('state\x20=\x204'))[_0x7c2c('0x7b')](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x1e711e);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x20eb63,null))[_0x7c2c('0x45')](handleError(_0x20eb63,null));};exports[_0x7c2c('0x7c')]=function(_0x2f249d,_0x136226,_0x354236){return db[_0x7c2c('0x7d')][_0x7c2c('0x47')]({'where':{'id':_0x2f249d[_0x7c2c('0x49')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x136226,null))[_0x7c2c('0x26')](function(_0xb47bf0){var _0x4d0922;if(_0xb47bf0){_0x4d0922=squel[_0x7c2c('0x62')]()[_0x7c2c('0x63')]('cm_hopper')[_0x7c2c('0x65')]([_0x7c2c('0x66'),_0x7c2c('0x67'),_0x7c2c('0x68'),_0x7c2c('0x70'),'CampaignId',_0x7c2c('0x6a'),_0x7c2c('0x72')],squel[_0x7c2c('0x6b')]()['field'](_0x7c2c('0x7e'),_0x7c2c('0x66'))[_0x7c2c('0x6c')]('NOW()',_0x7c2c('0x67'))['field'](_0x7c2c('0x6e'),'ContactId')['field'](_0x7c2c('0x6f'),_0x7c2c('0x70'))[_0x7c2c('0x6c')]('ANY_VALUE(CampaignId)',_0x7c2c('0x7f'))[_0x7c2c('0x6c')](_0x7c2c('0x6d'),_0x7c2c('0x6a'))['field'](_0x7c2c('0x6d'),'updatedAt')['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x76'),_0x2f249d[_0x7c2c('0x4a')]['state'][_0x7c2c('0x78')]())[_0x7c2c('0x3d')](_0x7c2c('0x79'))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()['field']('phone')[_0x7c2c('0x73')](_0x7c2c('0x64'))[_0x7c2c('0x3d')](_0x7c2c('0x80'),_0x2f249d['params']['id'][_0x7c2c('0x78')]()))[_0x7c2c('0x3d')](_0x7c2c('0x7a'),squel[_0x7c2c('0x6b')]()[_0x7c2c('0x6c')](_0x7c2c('0x81'))[_0x7c2c('0x73')](_0x7c2c('0x74'))[_0x7c2c('0x3d')]('CampaignId\x20=\x20?',_0x2f249d[_0x7c2c('0x49')]['id'][_0x7c2c('0x78')]())['where'](_0x7c2c('0x82')))['group'](_0x7c2c('0x68')))['toString']();return db[_0x7c2c('0x4c')][_0x7c2c('0x32')](_0x4d0922);}return[];})[_0x7c2c('0x26')](respondWithResult(_0x136226,null))[_0x7c2c('0x45')](handleError(_0x136226,null));};exports[_0x7c2c('0x83')]=function(_0x309051,_0x3f8683,_0x1eeb00){return db[_0x7c2c('0x84')]['findOne']({'where':{'VoiceQueueId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x69')],'CampaignId':_0x309051[_0x7c2c('0x4a')]['CampaignId'],'ContactId':_0x309051[_0x7c2c('0x4a')][_0x7c2c('0x68')]}})['then'](handleEntityNotFound(_0x3f8683,null))[_0x7c2c('0x26')](function(_0x511158){if(_0x511158){return _0x511158;}return null;})[_0x7c2c('0x26')](respondWithResult(_0x3f8683,null))['catch'](handleError(_0x3f8683,null));}; \ No newline at end of file +var _0xbd51=['ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','from','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','then','includeAll','include','rows','show','params','keys','length','catch','describe','body','uniqueid','find','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','findAll','`state`\x20=\x208,\x201,\x20null','reCallContacts','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','NOW()','scheduledAt'];(function(_0x1454bc,_0x59d1b7){var _0x42e132=function(_0x98acf6){while(--_0x98acf6){_0x1454bc['push'](_0x1454bc['shift']());}};_0x42e132(++_0x59d1b7);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x2af764,_0x18618b){_0x2af764=_0x2af764-0x0;var _0x969fe=_0xbd51[_0x2af764];return _0x969fe;};'use strict';var emlformat=require(_0x1bd5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1bd5('0x1'));var jsonpatch=require(_0x1bd5('0x2'));var rp=require(_0x1bd5('0x3'));var moment=require(_0x1bd5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x1bd5('0x5'));var csv=require(_0x1bd5('0x6'));var ejs=require(_0x1bd5('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1bd5('0x8'));var squel=require(_0x1bd5('0x9'));var crypto=require(_0x1bd5('0xa'));var jsforce=require(_0x1bd5('0xb'));var deskjs=require(_0x1bd5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1bd5('0xd'));var Papa=require('papaparse');var Redis=require(_0x1bd5('0xe'));var authService=require(_0x1bd5('0xf'));var qs=require(_0x1bd5('0x10'));var as=require(_0x1bd5('0x11'));var hardwareService=require(_0x1bd5('0x12'));var logger=require(_0x1bd5('0x13'))('api');var utils=require(_0x1bd5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1bd5('0x15'));var db=require(_0x1bd5('0x16'))['db'];function respondWithStatusCode(_0x37e8e1,_0x14606b){_0x14606b=_0x14606b||0xcc;return function(_0x177be0){if(_0x177be0){return _0x37e8e1[_0x1bd5('0x17')](_0x14606b);}return _0x37e8e1[_0x1bd5('0x18')](_0x14606b)['end']();};}function respondWithResult(_0x5650b5,_0x8b2390){_0x8b2390=_0x8b2390||0xc8;return function(_0x6d2c40){if(_0x6d2c40){return _0x5650b5[_0x1bd5('0x18')](_0x8b2390)[_0x1bd5('0x19')](_0x6d2c40);}};}function respondWithFilteredResult(_0x48d048,_0x5072c2){return function(_0xa63190){if(_0xa63190){var _0xc7277e=typeof _0x5072c2[_0x1bd5('0x1a')]===_0x1bd5('0x1b')&&typeof _0x5072c2[_0x1bd5('0x1c')]===_0x1bd5('0x1b');var _0x13cf34=_0xa63190[_0x1bd5('0x1d')];var _0x4670b5=_0xc7277e?0x0:_0x5072c2['offset'];var _0x53ad5e=_0xc7277e?_0xa63190[_0x1bd5('0x1d')]:_0x5072c2[_0x1bd5('0x1a')]+_0x5072c2[_0x1bd5('0x1c')];var _0xb95d4e;if(_0x53ad5e>=_0x13cf34){_0x53ad5e=_0x13cf34;_0xb95d4e=0xc8;}else{_0xb95d4e=0xce;}_0x48d048[_0x1bd5('0x18')](_0xb95d4e);return _0x48d048[_0x1bd5('0x1e')](_0x1bd5('0x1f'),_0x4670b5+'-'+_0x53ad5e+'/'+_0x13cf34)[_0x1bd5('0x19')](_0xa63190);}return null;};}function patchUpdates(_0x456051){return function(_0xb1ac1e){try{jsonpatch[_0x1bd5('0x20')](_0xb1ac1e,_0x456051,!![]);}catch(_0x2447c4){return BPromise[_0x1bd5('0x21')](_0x2447c4);}return _0xb1ac1e[_0x1bd5('0x22')]();};}function saveUpdates(_0x253d79,_0x46c580){return function(_0x1f13e7){if(_0x1f13e7){return _0x1f13e7[_0x1bd5('0x23')](_0x253d79)['then'](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x50c663,_0x18fd18){return function(_0x1e534e){if(_0x1e534e){return _0x1e534e[_0x1bd5('0x24')]()['then'](function(){_0x50c663[_0x1bd5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ed551,_0x30676d){return function(_0x3dba4f){if(!_0x3dba4f){_0x2ed551[_0x1bd5('0x17')](0x194);}return _0x3dba4f;};}function handleError(_0x47c84b,_0x202ed3){_0x202ed3=_0x202ed3||0x1f4;return function(_0x69bb17){logger[_0x1bd5('0x25')](_0x69bb17[_0x1bd5('0x26')]);if(_0x69bb17['name']){delete _0x69bb17[_0x1bd5('0x27')];}_0x47c84b[_0x1bd5('0x18')](_0x202ed3)[_0x1bd5('0x28')](_0x69bb17);};}exports[_0x1bd5('0x29')]=function(_0xe54b9f,_0xc73670){var _0x4e72b2={},_0x289097={},_0x472b22={'count':0x0,'rows':[]};var _0x8d53ba=_['map'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')],function(_0x345181){return{'name':_0x345181[_0x1bd5('0x2c')],'type':_0x345181[_0x1bd5('0x2d')][_0x1bd5('0x2e')]};});_0x289097['model']=_['map'](_0x8d53ba,_0x1bd5('0x27'));_0x289097[_0x1bd5('0x2f')]=_['keys'](_0xe54b9f[_0x1bd5('0x2f')]);_0x289097[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],_0x289097['query']);_0x4e72b2[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x289097[_0x1bd5('0x32')],qs[_0x1bd5('0x34')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x4e72b2[_0x1bd5('0x33')]=_0x4e72b2[_0x1bd5('0x33')]['length']?_0x4e72b2[_0x1bd5('0x33')]:_0x289097[_0x1bd5('0x32')];if(!_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x35')](_0x1bd5('0x36'))){_0x4e72b2[_0x1bd5('0x1c')]=qs[_0x1bd5('0x1c')](_0xe54b9f['query'][_0x1bd5('0x1c')]);_0x4e72b2[_0x1bd5('0x1a')]=qs[_0x1bd5('0x1a')](_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x1a')]);}_0x4e72b2[_0x1bd5('0x37')]=qs[_0x1bd5('0x38')](_0xe54b9f['query']['sort']);_0x4e72b2[_0x1bd5('0x39')]=qs[_0x1bd5('0x30')](_[_0x1bd5('0x3a')](_0xe54b9f['query'],_0x289097[_0x1bd5('0x30')]),_0x8d53ba);if(_0xe54b9f['query'][_0x1bd5('0x3b')]){_0x4e72b2[_0x1bd5('0x39')]=_[_0x1bd5('0x3c')](_0x4e72b2[_0x1bd5('0x39')],{'$or':_[_0x1bd5('0x3d')](_0x8d53ba,function(_0x2470ec){if(_0x2470ec[_0x1bd5('0x2d')]!==_0x1bd5('0x3e')){var _0x4bbefc={};_0x4bbefc[_0x2470ec[_0x1bd5('0x27')]]={'$like':'%'+_0xe54b9f[_0x1bd5('0x2f')]['filter']+'%'};return _0x4bbefc;}})});}_0x4e72b2=_[_0x1bd5('0x3c')]({},_0x4e72b2,_0xe54b9f[_0x1bd5('0x3f')]);var _0x20b25c={'where':_0x4e72b2['where']};return db[_0x1bd5('0x2a')][_0x1bd5('0x1d')](_0x20b25c)[_0x1bd5('0x40')](function(_0x4074f1){_0x472b22['count']=_0x4074f1;if(_0xe54b9f[_0x1bd5('0x2f')][_0x1bd5('0x41')]){_0x4e72b2[_0x1bd5('0x42')]=[{'all':!![]}];}return db[_0x1bd5('0x2a')]['findAll'](_0x4e72b2);})['then'](function(_0x40eeff){_0x472b22[_0x1bd5('0x43')]=_0x40eeff;return _0x472b22;})[_0x1bd5('0x40')](respondWithFilteredResult(_0xc73670,_0x4e72b2))['catch'](handleError(_0xc73670,null));};exports[_0x1bd5('0x44')]=function(_0x3b1092,_0x574d95){var _0x1eacac={'raw':!![],'where':{'id':_0x3b1092[_0x1bd5('0x45')]['id']}},_0x5761b8={};_0x5761b8[_0x1bd5('0x32')]=_['keys'](db[_0x1bd5('0x2a')][_0x1bd5('0x2b')]);_0x5761b8[_0x1bd5('0x2f')]=_[_0x1bd5('0x46')](_0x3b1092[_0x1bd5('0x2f')]);_0x5761b8[_0x1bd5('0x30')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],_0x5761b8[_0x1bd5('0x2f')]);_0x1eacac[_0x1bd5('0x33')]=_[_0x1bd5('0x31')](_0x5761b8[_0x1bd5('0x32')],qs['fields'](_0x3b1092[_0x1bd5('0x2f')][_0x1bd5('0x34')]));_0x1eacac[_0x1bd5('0x33')]=_0x1eacac['attributes'][_0x1bd5('0x47')]?_0x1eacac[_0x1bd5('0x33')]:_0x5761b8['model'];if(_0x3b1092[_0x1bd5('0x2f')]['includeAll']){_0x1eacac[_0x1bd5('0x42')]=[{'all':!![]}];}_0x1eacac=_['merge']({},_0x1eacac,_0x3b1092[_0x1bd5('0x3f')]);return db[_0x1bd5('0x2a')]['find'](_0x1eacac)[_0x1bd5('0x40')](handleEntityNotFound(_0x574d95,null))['then'](respondWithResult(_0x574d95,null))[_0x1bd5('0x48')](handleError(_0x574d95,null));};exports[_0x1bd5('0x49')]=function(_0x1a29f3,_0xe71454){return db[_0x1bd5('0x2a')][_0x1bd5('0x49')]()[_0x1bd5('0x40')](respondWithResult(_0xe71454,null))[_0x1bd5('0x48')](handleError(_0xe71454,null));};exports['update']=function(_0x13985e,_0x227a68){if(_0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')]){delete _0x13985e[_0x1bd5('0x4a')][_0x1bd5('0x4b')];}return db['CmHopperFinal'][_0x1bd5('0x4c')]({'where':{'uniqueid':_0x13985e[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x227a68,null))[_0x1bd5('0x40')](saveUpdates(_0x13985e[_0x1bd5('0x4a')],null))[_0x1bd5('0x40')](respondWithResult(_0x227a68,null))[_0x1bd5('0x48')](handleError(_0x227a68,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x587c46,_0x126221,_0x2d713b){return db[_0x1bd5('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x587c46[_0x1bd5('0x45')]['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x51')))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x52')))),_0x1bd5('0x53')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),_0x1bd5('0x54')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x55')))),_0x1bd5('0x56')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),_0x1bd5('0x58')],[db['sequelize']['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),'reCallContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x126221,null))['then'](respondWithResult(_0x126221,null))['catch'](handleError(_0x126221,null));};exports[_0x1bd5('0x5c')]=function(_0xec9fac,_0x1790af,_0x54a8c4){return db['CmHopperFinal'][_0x1bd5('0x5d')]({'raw':![],'where':{'CampaignId':_0xec9fac['params']['id']},'attributes':[[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')]['literal'](_0x1bd5('0x50')))),'noSuchContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db['sequelize']['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')]('`state`\x20=\x205,\x201,\x20null'))),'busyContacts'],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db['sequelize'][_0x1bd5('0x4f')](_0x1bd5('0x5e')))),'congestionContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x55')))),'dropContacts'],[db[_0x1bd5('0x4d')]['fn']('COUNT',db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x57')))),'abandonedContacts'],[db['sequelize']['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x59')))),_0x1bd5('0x5f')],[db[_0x1bd5('0x4d')]['fn'](_0x1bd5('0x4e'),db[_0x1bd5('0x4d')]['fn']('IF',db[_0x1bd5('0x4d')][_0x1bd5('0x4f')](_0x1bd5('0x5a')))),_0x1bd5('0x5b')]]})[_0x1bd5('0x40')](handleEntityNotFound(_0x1790af,null))[_0x1bd5('0x40')](respondWithResult(_0x1790af,null))[_0x1bd5('0x48')](handleError(_0x1790af,null));};exports[_0x1bd5('0x60')]=function(_0x195176,_0x393a8f,_0x1ffbab){return db[_0x1bd5('0x61')][_0x1bd5('0x4c')]({'where':{'id':_0x195176[_0x1bd5('0x45')]['id']}})[_0x1bd5('0x40')](handleEntityNotFound(_0x393a8f,null))['then'](function(_0x3bd058){var _0x1d6223;if(_0x3bd058){_0x1d6223=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),'scheduledAt',_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x69'),_0x1bd5('0x6a'),'updatedAt'],squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),'ContactId')['field'](_0x1bd5('0x71'),'ListId')[_0x1bd5('0x6c')](_0x1bd5('0x72'),'VoiceQueueId')[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')](_0x1bd5('0x6e'),_0x1bd5('0x73'))['from'](_0x1bd5('0x74'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x195176[_0x1bd5('0x4a')][_0x1bd5('0x77')][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()['field'](_0x1bd5('0x66'))[_0x1bd5('0x7a')](_0x1bd5('0x64'))[_0x1bd5('0x39')](_0x1bd5('0x75'),_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')['from']('cm_hopper_final')[_0x1bd5('0x39')]('VoiceQueueId\x20=\x20?',_0x195176[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')](_0x1bd5('0x7c')))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db['sequelize'][_0x1bd5('0x2f')](_0x1d6223);}return[];})['then'](respondWithResult(_0x393a8f,null))[_0x1bd5('0x48')](handleError(_0x393a8f,null));};exports[_0x1bd5('0x7e')]=function(_0x7d097,_0x50f2ac,_0x5db61c){return db[_0x1bd5('0x7f')]['find']({'where':{'id':_0x7d097[_0x1bd5('0x45')]['id']}})['then'](handleEntityNotFound(_0x50f2ac,null))[_0x1bd5('0x40')](function(_0x16f996){var _0x248d66;if(_0x16f996){_0x248d66=squel[_0x1bd5('0x62')]()[_0x1bd5('0x63')](_0x1bd5('0x64'))[_0x1bd5('0x65')]([_0x1bd5('0x66'),_0x1bd5('0x6f'),_0x1bd5('0x67'),_0x1bd5('0x68'),_0x1bd5('0x80'),_0x1bd5('0x6a'),_0x1bd5('0x73')],squel['select']()[_0x1bd5('0x6c')](_0x1bd5('0x6d'),_0x1bd5('0x66'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6f'))['field'](_0x1bd5('0x70'),_0x1bd5('0x67'))[_0x1bd5('0x6c')]('ANY_VALUE(ListId)',_0x1bd5('0x68'))[_0x1bd5('0x6c')](_0x1bd5('0x81'),_0x1bd5('0x80'))['field'](_0x1bd5('0x6e'),_0x1bd5('0x6a'))[_0x1bd5('0x6c')]('NOW()',_0x1bd5('0x73'))[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id']['toString']())['where'](_0x1bd5('0x76'),_0x7d097['body']['state'][_0x1bd5('0x78')]())['where'](_0x1bd5('0x79'))[_0x1bd5('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x1bd5('0x6b')]()[_0x1bd5('0x6c')](_0x1bd5('0x66'))['from'](_0x1bd5('0x64'))['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]()))[_0x1bd5('0x39')](_0x1bd5('0x7b'),squel['select']()[_0x1bd5('0x6c')]('calleridnum')[_0x1bd5('0x7a')]('cm_hopper_final')['where'](_0x1bd5('0x82'),_0x7d097[_0x1bd5('0x45')]['id'][_0x1bd5('0x78')]())[_0x1bd5('0x39')]('state\x20=\x204'))[_0x1bd5('0x7d')](_0x1bd5('0x67')))[_0x1bd5('0x78')]();return db[_0x1bd5('0x4d')][_0x1bd5('0x2f')](_0x248d66);}return[];})[_0x1bd5('0x40')](respondWithResult(_0x50f2ac,null))[_0x1bd5('0x48')](handleError(_0x50f2ac,null));};exports[_0x1bd5('0x83')]=function(_0x22e1f4,_0x347d06,_0x3cf023){return db[_0x1bd5('0x84')][_0x1bd5('0x85')]({'where':{'VoiceQueueId':_0x22e1f4[_0x1bd5('0x4a')]['VoiceQueueId'],'CampaignId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x80')],'ContactId':_0x22e1f4[_0x1bd5('0x4a')][_0x1bd5('0x67')]}})[_0x1bd5('0x40')](handleEntityNotFound(_0x347d06,null))[_0x1bd5('0x40')](function(_0x28f567){if(_0x28f567){return _0x28f567;}return null;})[_0x1bd5('0x40')](respondWithResult(_0x347d06,null))[_0x1bd5('0x48')](handleError(_0x347d06,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 41c74fc..f37b8ff 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 _0x398a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','cm_hopper_final','calleridnum','uniqueid','lodash','util'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0x398a,0x7c));var _0xa398=function(_0x4325bd,_0x4aabae){_0x4325bd=_0x4325bd-0x0;var _0x100637=_0x398a[_0x4325bd];return _0x100637;};'use strict';var _=require(_0xa398('0x0'));var util=require(_0xa398('0x1'));var logger=require(_0xa398('0x2'))(_0xa398('0x3'));var moment=require(_0xa398('0x4'));var BPromise=require('bluebird');var rp=require(_0xa398('0x5'));var fs=require('fs');var path=require(_0xa398('0x6'));var rimraf=require(_0xa398('0x7'));var config=require(_0xa398('0x8'));var attributes=require(_0xa398('0x9'));module[_0xa398('0xa')]=function(_0x5859b9,_0x32d4ad){return _0x5859b9['define']('CmHopperFinal',attributes,{'tableName':_0xa398('0xb'),'paranoid':![],'indexes':[{'name':_0xa398('0xc'),'fields':[_0xa398('0xc')]},{'name':_0xa398('0xd'),'fields':[_0xa398('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0859=['exports','define','CmHopperFinal','calleridnum','uniqueid','lodash','api','moment','request-promise','path','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0859,0x68));var _0x9085=function(_0x1803c1,_0x5cce9e){_0x1803c1=_0x1803c1-0x0;var _0x5af456=_0x0859[_0x1803c1];return _0x5af456;};'use strict';var _=require(_0x9085('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x9085('0x1'));var moment=require(_0x9085('0x2'));var BPromise=require('bluebird');var rp=require(_0x9085('0x3'));var fs=require('fs');var path=require(_0x9085('0x4'));var rimraf=require('rimraf');var config=require(_0x9085('0x5'));var attributes=require('./cmHopperFinal.attributes');module[_0x9085('0x6')]=function(_0x102821,_0x274e6d){return _0x102821[_0x9085('0x7')](_0x9085('0x8'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x9085('0x9')]},{'name':_0x9085('0xa'),'fields':[_0x9085('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 9314496..6ea12f9 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x382c21,_0x1bb8eb){var _0x275242=function(_0xdc0adc){while(--_0xdc0adc){_0x382c21['push'](_0x382c21['shift']());}};_0x275242(++_0x1bb8eb);}(_0x7a54,0x106));var _0x47a5=function(_0x361d2e,_0xa4ad3e){_0x361d2e=_0x361d2e-0x0;var _0x24b96e=_0x7a54[_0x361d2e];return _0x24b96e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _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(_0x19e84c,_0x2fea10){var _0x1bd91a=function(_0x5de63e){while(--_0x5de63e){_0x19e84c['push'](_0x19e84c['shift']());}};_0x1bd91a(++_0x2fea10);}(_0x7a54,0x106));var _0x47a5=function(_0x849c3d,_0x514df8){_0x849c3d=_0x849c3d-0x0;var _0x39e80b=_0x7a54[_0x849c3d];return _0x39e80b;};'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 3ec6e04..0537179 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 _0x9f89=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post'];(function(_0x5cc78e,_0x40d858){var _0x43870f=function(_0x1ba40b){while(--_0x1ba40b){_0x5cc78e['push'](_0x5cc78e['shift']());}};_0x43870f(++_0x40d858);}(_0x9f89,0x13d));var _0x99f8=function(_0x5b69a4,_0x2b8ee5){_0x5b69a4=_0x5b69a4-0x0;var _0x5cc057=_0x9f89[_0x5b69a4];return _0x5cc057;};'use strict';var multer=require('multer');var util=require(_0x99f8('0x0'));var path=require('path');var timeout=require(_0x99f8('0x1'));var express=require(_0x99f8('0x2'));var router=express[_0x99f8('0x3')]();var fs_extra=require(_0x99f8('0x4'));var auth=require(_0x99f8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x99f8('0x6'));var controller=require(_0x99f8('0x7'));router[_0x99f8('0x8')]('/',auth[_0x99f8('0x9')](),controller[_0x99f8('0xa')]);router[_0x99f8('0x8')](_0x99f8('0xb'),auth['isAuthenticated'](),controller[_0x99f8('0xc')]);router[_0x99f8('0x8')](_0x99f8('0xd'),auth[_0x99f8('0x9')](),controller['show']);router[_0x99f8('0x8')](_0x99f8('0xe'),auth[_0x99f8('0x9')](),controller[_0x99f8('0xf')]);router['get'](_0x99f8('0x10'),auth[_0x99f8('0x9')](),controller[_0x99f8('0x11')]);router[_0x99f8('0x12')](_0x99f8('0x13'),auth[_0x99f8('0x9')](),controller[_0x99f8('0x14')]);router[_0x99f8('0x12')](_0x99f8('0x15'),auth[_0x99f8('0x9')](),controller[_0x99f8('0x16')]);router['post'](_0x99f8('0x17'),auth[_0x99f8('0x9')](),controller[_0x99f8('0x18')]);router[_0x99f8('0x19')](_0x99f8('0xd'),auth[_0x99f8('0x9')](),controller[_0x99f8('0x1a')]);module[_0x99f8('0x1b')]=router; \ No newline at end of file +var _0xb90a=['util','connect-timeout','../../config/environment','./cmHopperFinal.controller','index','get','/describe','describe','/:id','isAuthenticated','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','multer'];(function(_0x450beb,_0x30d4d0){var _0x160f0c=function(_0xb78cc7){while(--_0xb78cc7){_0x450beb['push'](_0x450beb['shift']());}};_0x160f0c(++_0x30d4d0);}(_0xb90a,0x12a));var _0xab90=function(_0x3db9e0,_0x1068ee){_0x3db9e0=_0x3db9e0-0x0;var _0x528569=_0xb90a[_0x3db9e0];return _0x528569;};'use strict';var multer=require(_0xab90('0x0'));var util=require(_0xab90('0x1'));var path=require('path');var timeout=require(_0xab90('0x2'));var express=require('express');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(_0xab90('0x3'));var controller=require(_0xab90('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0xab90('0x5')]);router[_0xab90('0x6')](_0xab90('0x7'),auth['isAuthenticated'](),controller[_0xab90('0x8')]);router[_0xab90('0x6')](_0xab90('0x9'),auth[_0xab90('0xa')](),controller[_0xab90('0xb')]);router[_0xab90('0x6')](_0xab90('0xc'),auth[_0xab90('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0xab90('0x6')](_0xab90('0xd'),auth[_0xab90('0xa')](),controller[_0xab90('0xe')]);router[_0xab90('0xf')]('/voice/queue/moveContacts/:id',auth[_0xab90('0xa')](),controller[_0xab90('0x10')]);router[_0xab90('0xf')](_0xab90('0x11'),auth[_0xab90('0xa')](),controller[_0xab90('0x12')]);router[_0xab90('0xf')](_0xab90('0x13'),auth[_0xab90('0xa')](),controller[_0xab90('0x14')]);router[_0xab90('0x15')](_0xab90('0x9'),auth[_0xab90('0xa')](),controller['update']);module[_0xab90('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index c096a40..8d65ceb 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 _0x9fb1=['DATE','BOOLEAN','sequelize','exports','INTEGER','STRING'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x9fb1,0xe6));var _0x19fb=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x9fb1[_0x2f1762];return _0x8ab21;};'use strict';var Sequelize=require(_0x19fb('0x0'));module[_0x19fb('0x1')]={'state':{'type':Sequelize[_0x19fb('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x19fb('0x3')]},'scheduledat':{'type':Sequelize[_0x19fb('0x4')]},'countbusyretry':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x19fb('0x3')]},'originatecalleridname':{'type':Sequelize[_0x19fb('0x3')]},'calleridnum':{'type':Sequelize[_0x19fb('0x3')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x19fb('0x4')]},'responsetime':{'type':Sequelize[_0x19fb('0x4')]},'answertime':{'type':Sequelize[_0x19fb('0x4')]},'droptime':{'type':Sequelize[_0x19fb('0x4')]},'endtime':{'type':Sequelize[_0x19fb('0x4')]},'ringtime':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x19fb('0x3')]},'campaign':{'type':Sequelize[_0x19fb('0x3')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x19fb('0x3')]},'amd':{'type':Sequelize[_0x19fb('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x19fb('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x19fb('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x19fb('0x4')]},'recallme':{'type':Sequelize[_0x19fb('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x19fb('0x4')]},'edited':{'type':Sequelize[_0x19fb('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x19fb('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x19fb('0x3')]}}; \ No newline at end of file +var _0xd2d9=['STRING','INTEGER','DATE','BOOLEAN','sequelize'];(function(_0x46f282,_0x300c8b){var _0x5d4ae6=function(_0x4e7cc7){while(--_0x4e7cc7){_0x46f282['push'](_0x46f282['shift']());}};_0x5d4ae6(++_0x300c8b);}(_0xd2d9,0x16c));var _0x9d2d=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xd2d9[_0x4687df];return _0x32eaef;};'use strict';var Sequelize=require(_0x9d2d('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9d2d('0x1')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9d2d('0x1')]},'originatecalleridnum':{'type':Sequelize[_0x9d2d('0x1')]},'originatecalleridname':{'type':Sequelize[_0x9d2d('0x1')]},'calleridnum':{'type':Sequelize[_0x9d2d('0x1')]},'calleridname':{'type':Sequelize[_0x9d2d('0x1')]},'starttime':{'type':Sequelize[_0x9d2d('0x3')]},'responsetime':{'type':Sequelize[_0x9d2d('0x3')]},'answertime':{'type':Sequelize[_0x9d2d('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9d2d('0x3')]},'ringtime':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9d2d('0x1')]},'campaign':{'type':Sequelize[_0x9d2d('0x1')]},'campaigntype':{'type':Sequelize[_0x9d2d('0x1')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x9d2d('0x1')]},'amd':{'type':Sequelize[_0x9d2d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x9d2d('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9d2d('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9d2d('0x3')]},'recallme':{'type':Sequelize[_0x9d2d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize[_0x9d2d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9d2d('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x9d2d('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 5232827..96a7b0a 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 _0xd003=['model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','CmHopperHistory','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','describe','body','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','fieldName','type'];(function(_0x42155e,_0x590c76){var _0x2a3d4b=function(_0x25d32e){while(--_0x25d32e){_0x42155e['push'](_0x42155e['shift']());}};_0x2a3d4b(++_0x590c76);}(_0xd003,0x6c));var _0x3d00=function(_0x1f9f83,_0x2fc8f2){_0x1f9f83=_0x1f9f83-0x0;var _0x250314=_0xd003[_0x1f9f83];return _0x250314;};'use strict';var emlformat=require(_0x3d00('0x0'));var rimraf=require(_0x3d00('0x1'));var zipdir=require(_0x3d00('0x2'));var jsonpatch=require(_0x3d00('0x3'));var rp=require(_0x3d00('0x4'));var moment=require('moment');var BPromise=require(_0x3d00('0x5'));var Mustache=require(_0x3d00('0x6'));var util=require(_0x3d00('0x7'));var path=require(_0x3d00('0x8'));var sox=require(_0x3d00('0x9'));var csv=require(_0x3d00('0xa'));var ejs=require(_0x3d00('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3d00('0xc'));var crypto=require(_0x3d00('0xd'));var jsforce=require(_0x3d00('0xe'));var deskjs=require(_0x3d00('0xf'));var toCsv=require(_0x3d00('0xa'));var querystring=require(_0x3d00('0x10'));var Papa=require(_0x3d00('0x11'));var Redis=require(_0x3d00('0x12'));var authService=require(_0x3d00('0x13'));var qs=require(_0x3d00('0x14'));var as=require(_0x3d00('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3d00('0x16'));var db=require(_0x3d00('0x17'))['db'];function respondWithStatusCode(_0x2b0c18,_0x5ddad5){_0x5ddad5=_0x5ddad5||0xcc;return function(_0xe6c30a){if(_0xe6c30a){return _0x2b0c18[_0x3d00('0x18')](_0x5ddad5);}return _0x2b0c18['status'](_0x5ddad5)[_0x3d00('0x19')]();};}function respondWithResult(_0x430855,_0x1d3426){_0x1d3426=_0x1d3426||0xc8;return function(_0x20923c){if(_0x20923c){return _0x430855[_0x3d00('0x1a')](_0x1d3426)[_0x3d00('0x1b')](_0x20923c);}};}function respondWithFilteredResult(_0x1936fb,_0x198c90){return function(_0x575453){if(_0x575453){var _0x1e3c25=typeof _0x198c90[_0x3d00('0x1c')]===_0x3d00('0x1d')&&typeof _0x198c90['limit']==='undefined';var _0x2f5244=_0x575453[_0x3d00('0x1e')];var _0x51e3b6=_0x1e3c25?0x0:_0x198c90[_0x3d00('0x1c')];var _0x8e9bdc=_0x1e3c25?_0x575453['count']:_0x198c90[_0x3d00('0x1c')]+_0x198c90[_0x3d00('0x1f')];var _0x2dfb2c;if(_0x8e9bdc>=_0x2f5244){_0x8e9bdc=_0x2f5244;_0x2dfb2c=0xc8;}else{_0x2dfb2c=0xce;}_0x1936fb[_0x3d00('0x1a')](_0x2dfb2c);return _0x1936fb[_0x3d00('0x20')](_0x3d00('0x21'),_0x51e3b6+'-'+_0x8e9bdc+'/'+_0x2f5244)['json'](_0x575453);}return null;};}function patchUpdates(_0x5ba7eb){return function(_0x432c34){try{jsonpatch[_0x3d00('0x22')](_0x432c34,_0x5ba7eb,!![]);}catch(_0x4a5c36){return BPromise[_0x3d00('0x23')](_0x4a5c36);}return _0x432c34[_0x3d00('0x24')]();};}function saveUpdates(_0x46ef9a,_0x30d85c){return function(_0x357561){if(_0x357561){return _0x357561[_0x3d00('0x25')](_0x46ef9a)[_0x3d00('0x26')](function(_0x27ab19){return _0x27ab19;});}return null;};}function removeEntity(_0x262300,_0x2d452c){return function(_0x5ecca6){if(_0x5ecca6){return _0x5ecca6[_0x3d00('0x27')]()['then'](function(){_0x262300[_0x3d00('0x1a')](0xcc)[_0x3d00('0x19')]();});}};}function handleEntityNotFound(_0x855c78,_0x23f07c){return function(_0x2fdb69){if(!_0x2fdb69){_0x855c78[_0x3d00('0x18')](0x194);}return _0x2fdb69;};}function handleError(_0x367169,_0x4f7d40){_0x4f7d40=_0x4f7d40||0x1f4;return function(_0x13ca37){logger[_0x3d00('0x28')](_0x13ca37['stack']);if(_0x13ca37[_0x3d00('0x29')]){delete _0x13ca37[_0x3d00('0x29')];}_0x367169[_0x3d00('0x1a')](_0x4f7d40)['send'](_0x13ca37);};}exports['index']=function(_0x3863c9,_0x2dddfa){var _0x21eea1={},_0xc36c7e={},_0x4d9d11={'count':0x0,'rows':[]};var _0x59c7ec=_['map'](db['CmHopperHistory']['rawAttributes'],function(_0x1308f8){return{'name':_0x1308f8[_0x3d00('0x2a')],'type':_0x1308f8[_0x3d00('0x2b')]['key']};});_0xc36c7e[_0x3d00('0x2c')]=_['map'](_0x59c7ec,_0x3d00('0x29'));_0xc36c7e['query']=_[_0x3d00('0x2d')](_0x3863c9[_0x3d00('0x2e')]);_0xc36c7e[_0x3d00('0x2f')]=_[_0x3d00('0x30')](_0xc36c7e['model'],_0xc36c7e[_0x3d00('0x2e')]);_0x21eea1['attributes']=_[_0x3d00('0x30')](_0xc36c7e[_0x3d00('0x2c')],qs[_0x3d00('0x31')](_0x3863c9['query']['fields']));_0x21eea1['attributes']=_0x21eea1['attributes'][_0x3d00('0x32')]?_0x21eea1[_0x3d00('0x33')]:_0xc36c7e[_0x3d00('0x2c')];if(!_0x3863c9['query'][_0x3d00('0x34')](_0x3d00('0x35'))){_0x21eea1[_0x3d00('0x1f')]=qs[_0x3d00('0x1f')](_0x3863c9[_0x3d00('0x2e')][_0x3d00('0x1f')]);_0x21eea1[_0x3d00('0x1c')]=qs[_0x3d00('0x1c')](_0x3863c9[_0x3d00('0x2e')][_0x3d00('0x1c')]);}_0x21eea1[_0x3d00('0x36')]=qs[_0x3d00('0x37')](_0x3863c9['query'][_0x3d00('0x37')]);_0x21eea1[_0x3d00('0x38')]=qs[_0x3d00('0x2f')](_[_0x3d00('0x39')](_0x3863c9[_0x3d00('0x2e')],_0xc36c7e['filters']),_0x59c7ec);if(_0x3863c9[_0x3d00('0x2e')]['filter']){_0x21eea1[_0x3d00('0x38')]=_[_0x3d00('0x3a')](_0x21eea1[_0x3d00('0x38')],{'$or':_['map'](_0x59c7ec,function(_0xdb66fe){if(_0xdb66fe['type']!==_0x3d00('0x3b')){var _0x2ce119={};_0x2ce119[_0xdb66fe[_0x3d00('0x29')]]={'$like':'%'+_0x3863c9[_0x3d00('0x2e')][_0x3d00('0x3c')]+'%'};return _0x2ce119;}})});}_0x21eea1=_[_0x3d00('0x3a')]({},_0x21eea1,_0x3863c9[_0x3d00('0x3d')]);var _0x3a742f={'where':_0x21eea1[_0x3d00('0x38')]};return db[_0x3d00('0x3e')][_0x3d00('0x1e')](_0x3a742f)[_0x3d00('0x26')](function(_0x51070d){_0x4d9d11[_0x3d00('0x1e')]=_0x51070d;if(_0x3863c9[_0x3d00('0x2e')]['includeAll']){_0x21eea1[_0x3d00('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x3d00('0x40')](_0x21eea1);})[_0x3d00('0x26')](function(_0x46000b){_0x4d9d11[_0x3d00('0x41')]=_0x46000b;return _0x4d9d11;})[_0x3d00('0x26')](respondWithFilteredResult(_0x2dddfa,_0x21eea1))[_0x3d00('0x42')](handleError(_0x2dddfa,null));};exports[_0x3d00('0x43')]=function(_0x2ada30,_0x606067){var _0x3287d0={'raw':!![],'where':{'id':_0x2ada30[_0x3d00('0x44')]['id']}},_0xe2813b={};_0xe2813b[_0x3d00('0x2c')]=_[_0x3d00('0x2d')](db[_0x3d00('0x3e')][_0x3d00('0x45')]);_0xe2813b[_0x3d00('0x2e')]=_['keys'](_0x2ada30[_0x3d00('0x2e')]);_0xe2813b[_0x3d00('0x2f')]=_['intersection'](_0xe2813b[_0x3d00('0x2c')],_0xe2813b[_0x3d00('0x2e')]);_0x3287d0[_0x3d00('0x33')]=_[_0x3d00('0x30')](_0xe2813b[_0x3d00('0x2c')],qs[_0x3d00('0x31')](_0x2ada30[_0x3d00('0x2e')][_0x3d00('0x31')]));_0x3287d0[_0x3d00('0x33')]=_0x3287d0[_0x3d00('0x33')][_0x3d00('0x32')]?_0x3287d0[_0x3d00('0x33')]:_0xe2813b[_0x3d00('0x2c')];if(_0x2ada30[_0x3d00('0x2e')][_0x3d00('0x46')]){_0x3287d0[_0x3d00('0x3f')]=[{'all':!![]}];}_0x3287d0=_['merge']({},_0x3287d0,_0x2ada30[_0x3d00('0x3d')]);return db[_0x3d00('0x3e')][_0x3d00('0x47')](_0x3287d0)['then'](handleEntityNotFound(_0x606067,null))[_0x3d00('0x26')](respondWithResult(_0x606067,null))[_0x3d00('0x42')](handleError(_0x606067,null));};exports[_0x3d00('0x48')]=function(_0x17179e,_0x4aff2d){return db[_0x3d00('0x3e')][_0x3d00('0x48')](_0x17179e['body'],{})[_0x3d00('0x26')](respondWithResult(_0x4aff2d,0xc9))[_0x3d00('0x42')](handleError(_0x4aff2d,null));};exports['describe']=function(_0x18a365,_0x19b239){return db['CmHopperHistory'][_0x3d00('0x49')]()[_0x3d00('0x26')](respondWithResult(_0x19b239,null))[_0x3d00('0x42')](handleError(_0x19b239,null));};exports[_0x3d00('0x25')]=function(_0x464043,_0x13b83a){if(_0x464043[_0x3d00('0x4a')][_0x3d00('0x4b')]){delete _0x464043[_0x3d00('0x4a')]['uniqueid'];}return db[_0x3d00('0x3e')][_0x3d00('0x47')]({'where':{'uniqueid':_0x464043[_0x3d00('0x44')]['id']}})[_0x3d00('0x26')](handleEntityNotFound(_0x13b83a,null))[_0x3d00('0x26')](saveUpdates(_0x464043['body'],null))[_0x3d00('0x26')](respondWithResult(_0x13b83a,null))[_0x3d00('0x42')](handleError(_0x13b83a,null));}; \ No newline at end of file +var _0x865f=['util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','stack','name','map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','then','findAll','rows','show','params','includeAll','include','merge','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x507b80,_0x1d915f){var _0x29b4d2=function(_0x12df17){while(--_0x12df17){_0x507b80['push'](_0x507b80['shift']());}};_0x29b4d2(++_0x1d915f);}(_0x865f,0x17b));var _0xf865=function(_0x1ef65d,_0x44d1bc){_0x1ef65d=_0x1ef65d-0x0;var _0x638ab=_0x865f[_0x1ef65d];return _0x638ab;};'use strict';var emlformat=require(_0xf865('0x0'));var rimraf=require(_0xf865('0x1'));var zipdir=require(_0xf865('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf865('0x3'));var BPromise=require(_0xf865('0x4'));var Mustache=require(_0xf865('0x5'));var util=require(_0xf865('0x6'));var path=require(_0xf865('0x7'));var sox=require(_0xf865('0x8'));var csv=require(_0xf865('0x9'));var ejs=require(_0xf865('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf865('0xb'));var squel=require('squel');var crypto=require(_0xf865('0xc'));var jsforce=require(_0xf865('0xd'));var deskjs=require(_0xf865('0xe'));var toCsv=require(_0xf865('0x9'));var querystring=require('querystring');var Papa=require(_0xf865('0xf'));var Redis=require(_0xf865('0x10'));var authService=require(_0xf865('0x11'));var qs=require(_0xf865('0x12'));var as=require(_0xf865('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf865('0x14'))(_0xf865('0x15'));var utils=require('../../config/utils');var config=require(_0xf865('0x16'));var licenseUtil=require(_0xf865('0x17'));var db=require(_0xf865('0x18'))['db'];function respondWithStatusCode(_0x4d5cf9,_0x5cac57){_0x5cac57=_0x5cac57||0xcc;return function(_0x5499ba){if(_0x5499ba){return _0x4d5cf9[_0xf865('0x19')](_0x5cac57);}return _0x4d5cf9['status'](_0x5cac57)[_0xf865('0x1a')]();};}function respondWithResult(_0x275387,_0x5e0284){_0x5e0284=_0x5e0284||0xc8;return function(_0x164f0f){if(_0x164f0f){return _0x275387[_0xf865('0x1b')](_0x5e0284)[_0xf865('0x1c')](_0x164f0f);}};}function respondWithFilteredResult(_0x14d538,_0x120c85){return function(_0x3a5be6){if(_0x3a5be6){var _0x1a4520=typeof _0x120c85[_0xf865('0x1d')]===_0xf865('0x1e')&&typeof _0x120c85[_0xf865('0x1f')]===_0xf865('0x1e');var _0xa48953=_0x3a5be6[_0xf865('0x20')];var _0x5dcc=_0x1a4520?0x0:_0x120c85[_0xf865('0x1d')];var _0x3e14e7=_0x1a4520?_0x3a5be6[_0xf865('0x20')]:_0x120c85[_0xf865('0x1d')]+_0x120c85['limit'];var _0x4301ac;if(_0x3e14e7>=_0xa48953){_0x3e14e7=_0xa48953;_0x4301ac=0xc8;}else{_0x4301ac=0xce;}_0x14d538[_0xf865('0x1b')](_0x4301ac);return _0x14d538[_0xf865('0x21')]('Content-Range',_0x5dcc+'-'+_0x3e14e7+'/'+_0xa48953)['json'](_0x3a5be6);}return null;};}function patchUpdates(_0x2de08e){return function(_0x30d20e){try{jsonpatch[_0xf865('0x22')](_0x30d20e,_0x2de08e,!![]);}catch(_0x9af5d3){return BPromise[_0xf865('0x23')](_0x9af5d3);}return _0x30d20e[_0xf865('0x24')]();};}function saveUpdates(_0x1ed445,_0x42c23c){return function(_0x5eaf0a){if(_0x5eaf0a){return _0x5eaf0a[_0xf865('0x25')](_0x1ed445)['then'](function(_0x4dc3f2){return _0x4dc3f2;});}return null;};}function removeEntity(_0xdb91d9,_0x13a166){return function(_0x507f9a){if(_0x507f9a){return _0x507f9a[_0xf865('0x26')]()['then'](function(){_0xdb91d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44e48a,_0x2e3275){return function(_0x381b19){if(!_0x381b19){_0x44e48a[_0xf865('0x19')](0x194);}return _0x381b19;};}function handleError(_0x3424f0,_0x598ab1){_0x598ab1=_0x598ab1||0x1f4;return function(_0x2fcf5a){logger['error'](_0x2fcf5a[_0xf865('0x27')]);if(_0x2fcf5a[_0xf865('0x28')]){delete _0x2fcf5a['name'];}_0x3424f0[_0xf865('0x1b')](_0x598ab1)['send'](_0x2fcf5a);};}exports['index']=function(_0xd877c6,_0x370049){var _0x1e83cf={},_0x414107={},_0xc6dc75={'count':0x0,'rows':[]};var _0x4e9ad4=_[_0xf865('0x29')](db[_0xf865('0x2a')][_0xf865('0x2b')],function(_0xada745){return{'name':_0xada745[_0xf865('0x2c')],'type':_0xada745['type'][_0xf865('0x2d')]};});_0x414107[_0xf865('0x2e')]=_['map'](_0x4e9ad4,'name');_0x414107[_0xf865('0x2f')]=_[_0xf865('0x30')](_0xd877c6[_0xf865('0x2f')]);_0x414107[_0xf865('0x31')]=_['intersection'](_0x414107['model'],_0x414107['query']);_0x1e83cf['attributes']=_[_0xf865('0x32')](_0x414107['model'],qs[_0xf865('0x33')](_0xd877c6['query']['fields']));_0x1e83cf[_0xf865('0x34')]=_0x1e83cf[_0xf865('0x34')][_0xf865('0x35')]?_0x1e83cf['attributes']:_0x414107[_0xf865('0x2e')];if(!_0xd877c6[_0xf865('0x2f')][_0xf865('0x36')](_0xf865('0x37'))){_0x1e83cf[_0xf865('0x1f')]=qs[_0xf865('0x1f')](_0xd877c6['query'][_0xf865('0x1f')]);_0x1e83cf['offset']=qs[_0xf865('0x1d')](_0xd877c6[_0xf865('0x2f')][_0xf865('0x1d')]);}_0x1e83cf[_0xf865('0x38')]=qs[_0xf865('0x39')](_0xd877c6['query'][_0xf865('0x39')]);_0x1e83cf[_0xf865('0x3a')]=qs[_0xf865('0x31')](_[_0xf865('0x3b')](_0xd877c6['query'],_0x414107[_0xf865('0x31')]),_0x4e9ad4);if(_0xd877c6[_0xf865('0x2f')]['filter']){_0x1e83cf[_0xf865('0x3a')]=_['merge'](_0x1e83cf[_0xf865('0x3a')],{'$or':_['map'](_0x4e9ad4,function(_0x1e0dfd){if(_0x1e0dfd['type']!==_0xf865('0x3c')){var _0x54d12b={};_0x54d12b[_0x1e0dfd['name']]={'$like':'%'+_0xd877c6['query'][_0xf865('0x3d')]+'%'};return _0x54d12b;}})});}_0x1e83cf=_['merge']({},_0x1e83cf,_0xd877c6[_0xf865('0x3e')]);var _0x15eb12={'where':_0x1e83cf[_0xf865('0x3a')]};return db[_0xf865('0x2a')][_0xf865('0x20')](_0x15eb12)[_0xf865('0x3f')](function(_0x4a2d03){_0xc6dc75[_0xf865('0x20')]=_0x4a2d03;if(_0xd877c6['query']['includeAll']){_0x1e83cf['include']=[{'all':!![]}];}return db[_0xf865('0x2a')][_0xf865('0x40')](_0x1e83cf);})[_0xf865('0x3f')](function(_0xd321a8){_0xc6dc75[_0xf865('0x41')]=_0xd321a8;return _0xc6dc75;})[_0xf865('0x3f')](respondWithFilteredResult(_0x370049,_0x1e83cf))['catch'](handleError(_0x370049,null));};exports[_0xf865('0x42')]=function(_0x41732e,_0x2fff43){var _0xcd3ac6={'raw':!![],'where':{'id':_0x41732e[_0xf865('0x43')]['id']}},_0x33975b={};_0x33975b[_0xf865('0x2e')]=_[_0xf865('0x30')](db['CmHopperHistory'][_0xf865('0x2b')]);_0x33975b['query']=_['keys'](_0x41732e['query']);_0x33975b[_0xf865('0x31')]=_[_0xf865('0x32')](_0x33975b[_0xf865('0x2e')],_0x33975b['query']);_0xcd3ac6[_0xf865('0x34')]=_['intersection'](_0x33975b[_0xf865('0x2e')],qs[_0xf865('0x33')](_0x41732e[_0xf865('0x2f')][_0xf865('0x33')]));_0xcd3ac6[_0xf865('0x34')]=_0xcd3ac6[_0xf865('0x34')][_0xf865('0x35')]?_0xcd3ac6[_0xf865('0x34')]:_0x33975b[_0xf865('0x2e')];if(_0x41732e[_0xf865('0x2f')][_0xf865('0x44')]){_0xcd3ac6[_0xf865('0x45')]=[{'all':!![]}];}_0xcd3ac6=_[_0xf865('0x46')]({},_0xcd3ac6,_0x41732e['options']);return db[_0xf865('0x2a')][_0xf865('0x47')](_0xcd3ac6)[_0xf865('0x3f')](handleEntityNotFound(_0x2fff43,null))[_0xf865('0x3f')](respondWithResult(_0x2fff43,null))[_0xf865('0x48')](handleError(_0x2fff43,null));};exports['create']=function(_0x22f8c0,_0x583da0){return db[_0xf865('0x2a')][_0xf865('0x49')](_0x22f8c0[_0xf865('0x4a')],{})[_0xf865('0x3f')](respondWithResult(_0x583da0,0xc9))['catch'](handleError(_0x583da0,null));};exports[_0xf865('0x4b')]=function(_0x193eec,_0x55a031){return db[_0xf865('0x2a')][_0xf865('0x4b')]()[_0xf865('0x3f')](respondWithResult(_0x55a031,null))['catch'](handleError(_0x55a031,null));};exports[_0xf865('0x25')]=function(_0xddd814,_0x13abcb){if(_0xddd814[_0xf865('0x4a')][_0xf865('0x4c')]){delete _0xddd814[_0xf865('0x4a')]['uniqueid'];}return db[_0xf865('0x2a')][_0xf865('0x47')]({'where':{'uniqueid':_0xddd814[_0xf865('0x43')]['id']}})[_0xf865('0x3f')](handleEntityNotFound(_0x13abcb,null))['then'](saveUpdates(_0xddd814[_0xf865('0x4a')],null))[_0xf865('0x3f')](respondWithResult(_0x13abcb,null))['catch'](handleError(_0x13abcb,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 68842d8..ed5dbf3 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 _0x97b2=['exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./cmHopperHistory.attributes'];(function(_0x4d422f,_0x2fbb49){var _0x4c56a6=function(_0x4737b0){while(--_0x4737b0){_0x4d422f['push'](_0x4d422f['shift']());}};_0x4c56a6(++_0x2fbb49);}(_0x97b2,0x1b7));var _0x297b=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0x97b2[_0x48cb1f];return _0x172c4d;};'use strict';var _=require(_0x297b('0x0'));var util=require(_0x297b('0x1'));var logger=require(_0x297b('0x2'))(_0x297b('0x3'));var moment=require(_0x297b('0x4'));var BPromise=require(_0x297b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x297b('0x6'));var rimraf=require(_0x297b('0x7'));var config=require('../../config/environment');var attributes=require(_0x297b('0x8'));module[_0x297b('0x9')]=function(_0x5ef74e,_0x596f9c){return _0x5ef74e['define'](_0x297b('0xa'),attributes,{'tableName':_0x297b('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0x297b('0xc')]},{'name':_0x297b('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xedf1=['request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','moment','bluebird'];(function(_0x22e9fe,_0x3d019f){var _0x47cd19=function(_0x8fd5fc){while(--_0x8fd5fc){_0x22e9fe['push'](_0x22e9fe['shift']());}};_0x47cd19(++_0x3d019f);}(_0xedf1,0xb2));var _0x1edf=function(_0x557fa5,_0x3b954b){_0x557fa5=_0x557fa5-0x0;var _0x4c003c=_0xedf1[_0x557fa5];return _0x4c003c;};'use strict';var _=require(_0x1edf('0x0'));var util=require(_0x1edf('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1edf('0x2'));var BPromise=require(_0x1edf('0x3'));var rp=require(_0x1edf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1edf('0x5'));var config=require(_0x1edf('0x6'));var attributes=require(_0x1edf('0x7'));module['exports']=function(_0x52238d,_0x1b84af){return _0x52238d[_0x1edf('0x8')](_0x1edf('0x9'),attributes,{'tableName':_0x1edf('0xa'),'paranoid':![],'indexes':[{'name':_0x1edf('0xb'),'fields':[_0x1edf('0xb')]},{'name':_0x1edf('0xc'),'fields':[_0x1edf('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index e300cb0..da12bd4 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 _0x7d98=['then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateCmHopperHistory','CmHopperHistory','create','options','raw','findAll','where','sequelize','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','AvgHandleTime','campaign','COUNT','`state`\x20=\x200,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','name','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','request'];(function(_0x5179a5,_0x419746){var _0x15c8ce=function(_0x1b13c4){while(--_0x1b13c4){_0x5179a5['push'](_0x5179a5['shift']());}};_0x15c8ce(++_0x419746);}(_0x7d98,0xe7));var _0x87d9=function(_0x202d24,_0x5e8641){_0x202d24=_0x202d24-0x0;var _0x2b3a8e=_0x7d98[_0x202d24];return _0x2b3a8e;};'use strict';var _=require(_0x87d9('0x0'));var util=require('util');var moment=require(_0x87d9('0x1'));var BPromise=require(_0x87d9('0x2'));var rs=require(_0x87d9('0x3'));var fs=require('fs');var Redis=require(_0x87d9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x87d9('0x5'));var logger=require(_0x87d9('0x6'))('rpc');var config=require(_0x87d9('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fe56d,_0x24c05f,_0x2dc542){return new BPromise(function(_0x5f2693,_0x2aa885){return client[_0x87d9('0x8')](_0x3fe56d,_0x2dc542)[_0x87d9('0x9')](function(_0x545f4f){logger[_0x87d9('0xa')](_0x87d9('0xb'),_0x24c05f,_0x87d9('0xc'));logger[_0x87d9('0xd')](_0x87d9('0xe'),_0x24c05f,_0x87d9('0xc'),JSON[_0x87d9('0xf')](_0x545f4f));if(_0x545f4f[_0x87d9('0x10')]){if(_0x545f4f[_0x87d9('0x10')][_0x87d9('0x11')]===0x1f4){logger[_0x87d9('0x10')](_0x87d9('0xb'),_0x24c05f,_0x545f4f[_0x87d9('0x10')][_0x87d9('0x12')]);return _0x2aa885(_0x545f4f[_0x87d9('0x10')][_0x87d9('0x12')]);}logger[_0x87d9('0x10')](_0x87d9('0xb'),_0x24c05f,_0x545f4f[_0x87d9('0x10')][_0x87d9('0x12')]);return _0x5f2693(_0x545f4f['error']['message']);}else{logger[_0x87d9('0xa')](_0x87d9('0xb'),_0x24c05f,_0x87d9('0xc'));_0x5f2693(_0x545f4f['result']['message']);}})[_0x87d9('0x13')](function(_0x109d61){logger[_0x87d9('0x10')](_0x87d9('0xb'),_0x24c05f,_0x109d61);_0x2aa885(_0x109d61);});});}exports[_0x87d9('0x14')]=function(_0xebc1eb){var _0x3ad8d5=this;return new Promise(function(_0x1f33a3,_0x6cbbca){return db[_0x87d9('0x15')][_0x87d9('0x16')](_0xebc1eb['body'],{'raw':_0xebc1eb[_0x87d9('0x17')]?_0xebc1eb['options'][_0x87d9('0x18')]===undefined?!![]:![]:!![]})[_0x87d9('0x9')](function(_0x334d31){logger['info']('CreateCmHopperHistory',_0xebc1eb);logger['debug'](_0x87d9('0x14'),_0xebc1eb,JSON[_0x87d9('0xf')](_0x334d31));_0x1f33a3(_0x334d31);})[_0x87d9('0x13')](function(_0x6ab839){logger[_0x87d9('0x10')](_0x87d9('0x14'),_0x6ab839[_0x87d9('0x12')],_0xebc1eb);_0x6cbbca(_0x3ad8d5[_0x87d9('0x10')](0x1f4,_0x6ab839[_0x87d9('0x12')]));});});};exports['AvgHandleTime']=function(_0x31e1b2){var _0x3e23b1=this;return new Promise(function(_0x40a7ed,_0xb2a651){return db[_0x87d9('0x15')][_0x87d9('0x19')]({'raw':_0x31e1b2[_0x87d9('0x17')]?_0x31e1b2[_0x87d9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x31e1b2[_0x87d9('0x17')]?_0x31e1b2[_0x87d9('0x17')][_0x87d9('0x1a')]||null:null,'attributes':[[db[_0x87d9('0x1b')]['fn']('COUNT',db[_0x87d9('0x1b')][_0x87d9('0x1c')]('id')),_0x87d9('0x1d')],[db[_0x87d9('0x1b')]['fn']('COUNT',db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0x87d9('0x1f')],[db[_0x87d9('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x87d9('0x1e')](_0x87d9('0x20')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x87d9('0x1b')]['fn']('COUNT',db[_0x87d9('0x1b')]['fn']('IF',db['sequelize'][_0x87d9('0x1e')](_0x87d9('0x21')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x87d9('0x1b')]['fn']('AVG',db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')](_0x87d9('0x22')))),_0x87d9('0x23')],[db[_0x87d9('0x1b')]['fn']('AVG',db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')](_0x87d9('0x24')))),_0x87d9('0x25')]]})[_0x87d9('0x9')](function(_0x31f4af){logger[_0x87d9('0xa')](_0x87d9('0x26'),_0x31e1b2);logger['debug'](_0x87d9('0x26'),_0x31e1b2,JSON[_0x87d9('0xf')](_0x31f4af));_0x40a7ed(_0x31f4af);})[_0x87d9('0x13')](function(_0x417aa8){logger[_0x87d9('0x10')]('AvgHandleTime',_0x417aa8[_0x87d9('0x12')],_0x31e1b2);_0xb2a651(_0x3e23b1[_0x87d9('0x10')](0x1f4,_0x417aa8[_0x87d9('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x469306){var _0x4c01e1=this;return new Promise(function(_0x37431c,_0x2a18cf){return db[_0x87d9('0x15')][_0x87d9('0x19')]({'raw':_0x469306['options']?_0x469306[_0x87d9('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x469306[_0x87d9('0x17')]?_0x469306[_0x87d9('0x17')][_0x87d9('0x1a')]||null:null,'attributes':[[_0x87d9('0x27'),'name'],[db['sequelize']['fn'](_0x87d9('0x28'),db['sequelize']['fn']('IF',db[_0x87d9('0x1b')]['literal'](_0x87d9('0x29')))),'outboundNoSuchCallsDay'],[db[_0x87d9('0x1b')]['fn'](_0x87d9('0x28'),db['sequelize']['fn']('IF',db[_0x87d9('0x1b')]['literal']('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db[_0x87d9('0x1b')]['fn']('COUNT',db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')]('`state`\x20=\x204,\x201,\x20null'))),_0x87d9('0x2a')],[db[_0x87d9('0x1b')]['fn'](_0x87d9('0x28'),db['sequelize']['fn']('IF',db[_0x87d9('0x1b')]['literal']('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x87d9('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')](_0x87d9('0x2b')))),_0x87d9('0x2c')],[db[_0x87d9('0x1b')]['fn']('COUNT',db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')]['literal']('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x87d9('0x2d')],[db[_0x87d9('0x1b')]['fn'](_0x87d9('0x28'),db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')](_0x87d9('0x2e')))),_0x87d9('0x2f')],[db['sequelize']['fn'](_0x87d9('0x28'),db[_0x87d9('0x1b')]['fn']('IF',db['sequelize']['literal'](_0x87d9('0x30')))),_0x87d9('0x31')],[db['sequelize']['fn'](_0x87d9('0x28'),db['sequelize']['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x87d9('0x32')],[db[_0x87d9('0x1b')]['fn']('COUNT',db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')]('`state`\x20=\x2014,\x201,\x20null'))),_0x87d9('0x33')],[db[_0x87d9('0x1b')]['fn'](_0x87d9('0x28'),db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')]('`state`\x20=\x2018,\x201,\x20null'))),_0x87d9('0x34')],[db['sequelize']['fn']('COUNT',db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')](_0x87d9('0x35')))),_0x87d9('0x36')],[db['sequelize']['fn'](_0x87d9('0x28'),db[_0x87d9('0x1b')]['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')]('`state`\x20=\x2020,\x201,\x20null'))),_0x87d9('0x34')],[db[_0x87d9('0x1b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x87d9('0x1b')][_0x87d9('0x1e')](_0x87d9('0x37')))),_0x87d9('0x38')]],'group':[_0x87d9('0x27')]})['then'](function(_0x3b1409){logger[_0x87d9('0xa')](_0x87d9('0x39'),_0x469306);logger[_0x87d9('0xd')](_0x87d9('0x39'),_0x469306,JSON[_0x87d9('0xf')](_0x3b1409));_0x37431c(_0x3b1409);})[_0x87d9('0x13')](function(_0x844e10){logger[_0x87d9('0x10')](_0x87d9('0x39'),_0x844e10[_0x87d9('0x12')],_0x469306);_0x2a18cf(_0x4c01e1['error'](0x1f4,_0x844e10[_0x87d9('0x12')]));});});};exports[_0x87d9('0x3a')]=function(_0xf06c22){var _0x2e1f57=this;return new Promise(function(_0x20a221,_0x10c0ae){return db['CmHopperHistory'][_0x87d9('0x19')]({'raw':_0xf06c22[_0x87d9('0x17')]?_0xf06c22['options'][_0x87d9('0x18')]===undefined?!![]:![]:!![],'where':_0xf06c22[_0x87d9('0x17')]?_0xf06c22[_0x87d9('0x17')]['where']||null:null,'attributes':[[_0x87d9('0x27'),_0x87d9('0x3b')],[db[_0x87d9('0x1b')]['fn'](_0x87d9('0x28'),db[_0x87d9('0x1b')][_0x87d9('0x1c')]('id')),'ivrTotalCallsDays'],[db[_0x87d9('0x1b')]['fn'](_0x87d9('0x28'),db[_0x87d9('0x1b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0x87d9('0x27')]})[_0x87d9('0x9')](function(_0x57fa40){logger[_0x87d9('0xa')](_0x87d9('0x3a'),_0xf06c22);logger[_0x87d9('0xd')](_0x87d9('0x3a'),_0xf06c22,JSON['stringify'](_0x57fa40));_0x20a221(_0x57fa40);})[_0x87d9('0x13')](function(_0x3c03da){logger[_0x87d9('0x10')](_0x87d9('0x3a'),_0x3c03da['message'],_0xf06c22);_0x10c0ae(_0x2e1f57[_0x87d9('0x10')](0x1f4,_0x3c03da[_0x87d9('0x12')]));});});}; \ No newline at end of file +var _0xca7b=['bluebird','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateCmHopperHistory','CmHopperHistory','create','body','options','raw','findAll','where','sequelize','COUNT','col','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','AvgHandleTime','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`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','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','moment'];(function(_0x353879,_0x31e2d4){var _0x45949f=function(_0x3367a0){while(--_0x3367a0){_0x353879['push'](_0x353879['shift']());}};_0x45949f(++_0x31e2d4);}(_0xca7b,0x14e));var _0xbca7=function(_0x29717d,_0x1260c8){_0x29717d=_0x29717d-0x0;var _0x45b150=_0xca7b[_0x29717d];return _0x45b150;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbca7('0x0'));var BPromise=require(_0xbca7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbca7('0x2'));var db=require(_0xbca7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbca7('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbca7('0x5'));var client=jayson['client'][_0xbca7('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x53e0e6,_0x1dc1a8,_0x140a73){return new BPromise(function(_0x438f99,_0x2ae5d4){return client[_0xbca7('0x7')](_0x53e0e6,_0x140a73)[_0xbca7('0x8')](function(_0x491b64){logger[_0xbca7('0x9')](_0xbca7('0xa'),_0x1dc1a8,_0xbca7('0xb'));logger[_0xbca7('0xc')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x1dc1a8,_0xbca7('0xb'),JSON[_0xbca7('0xd')](_0x491b64));if(_0x491b64['error']){if(_0x491b64[_0xbca7('0xe')][_0xbca7('0xf')]===0x1f4){logger[_0xbca7('0xe')](_0xbca7('0xa'),_0x1dc1a8,_0x491b64[_0xbca7('0xe')][_0xbca7('0x10')]);return _0x2ae5d4(_0x491b64[_0xbca7('0xe')]['message']);}logger[_0xbca7('0xe')](_0xbca7('0xa'),_0x1dc1a8,_0x491b64['error'][_0xbca7('0x10')]);return _0x438f99(_0x491b64[_0xbca7('0xe')]['message']);}else{logger[_0xbca7('0x9')]('CmHopperHistory,\x20%s,\x20%s',_0x1dc1a8,_0xbca7('0xb'));_0x438f99(_0x491b64[_0xbca7('0x11')]['message']);}})[_0xbca7('0x12')](function(_0x40d273){logger[_0xbca7('0xe')](_0xbca7('0xa'),_0x1dc1a8,_0x40d273);_0x2ae5d4(_0x40d273);});});}exports[_0xbca7('0x13')]=function(_0x454cdd){var _0x9541e6=this;return new Promise(function(_0x30f973,_0x45d256){return db[_0xbca7('0x14')][_0xbca7('0x15')](_0x454cdd[_0xbca7('0x16')],{'raw':_0x454cdd[_0xbca7('0x17')]?_0x454cdd[_0xbca7('0x17')][_0xbca7('0x18')]===undefined?!![]:![]:!![]})[_0xbca7('0x8')](function(_0x26ee70){logger['info'](_0xbca7('0x13'),_0x454cdd);logger[_0xbca7('0xc')](_0xbca7('0x13'),_0x454cdd,JSON[_0xbca7('0xd')](_0x26ee70));_0x30f973(_0x26ee70);})[_0xbca7('0x12')](function(_0x37eca2){logger[_0xbca7('0xe')](_0xbca7('0x13'),_0x37eca2[_0xbca7('0x10')],_0x454cdd);_0x45d256(_0x9541e6['error'](0x1f4,_0x37eca2[_0xbca7('0x10')]));});});};exports['AvgHandleTime']=function(_0x4650d2){var _0x2f2833=this;return new Promise(function(_0x27e78d,_0x409380){return db['CmHopperHistory'][_0xbca7('0x19')]({'raw':_0x4650d2[_0xbca7('0x17')]?_0x4650d2[_0xbca7('0x17')][_0xbca7('0x18')]===undefined?!![]:![]:!![],'where':_0x4650d2[_0xbca7('0x17')]?_0x4650d2[_0xbca7('0x17')][_0xbca7('0x1a')]||null:null,'attributes':[[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')][_0xbca7('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db['sequelize']['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0xbca7('0x1e')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x20')))),_0xbca7('0x21')],[db['sequelize']['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')]['literal'](_0xbca7('0x22')))),_0xbca7('0x23')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x24'),db[_0xbca7('0x1b')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xbca7('0x25')],[db['sequelize']['fn'](_0xbca7('0x24'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x26')))),'predictiveIntervalAvgTalktime']]})[_0xbca7('0x8')](function(_0x47928d){logger[_0xbca7('0x9')]('AvgHandleTime',_0x4650d2);logger[_0xbca7('0xc')](_0xbca7('0x27'),_0x4650d2,JSON[_0xbca7('0xd')](_0x47928d));_0x27e78d(_0x47928d);})[_0xbca7('0x12')](function(_0x54cedb){logger[_0xbca7('0xe')](_0xbca7('0x27'),_0x54cedb[_0xbca7('0x10')],_0x4650d2);_0x409380(_0x2f2833[_0xbca7('0xe')](0x1f4,_0x54cedb['message']));});});};exports['GetVoiceQueueHopperHistory']=function(_0x4dcf38){var _0x68e863=this;return new Promise(function(_0x158028,_0x215edf){return db[_0xbca7('0x14')][_0xbca7('0x19')]({'raw':_0x4dcf38[_0xbca7('0x17')]?_0x4dcf38[_0xbca7('0x17')][_0xbca7('0x18')]===undefined?!![]:![]:!![],'where':_0x4dcf38[_0xbca7('0x17')]?_0x4dcf38['options']['where']||null:null,'attributes':[['campaign','name'],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')]('`state`\x20=\x200,\x201,\x20null'))),_0xbca7('0x28')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')]['literal'](_0xbca7('0x29')))),'outboundNoAnswerCallsDay'],[db[_0xbca7('0x1b')]['fn']('COUNT',db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')]['literal'](_0xbca7('0x2a')))),_0xbca7('0x2b')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db['sequelize'][_0xbca7('0x1f')](_0xbca7('0x2c')))),_0xbca7('0x2d')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db['sequelize']['literal'](_0xbca7('0x2e')))),_0xbca7('0x2f')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x30')))),_0xbca7('0x31')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x32')))),_0xbca7('0x33')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x34')))),_0xbca7('0x35')],[db['sequelize']['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x36')))),_0xbca7('0x37')],[db[_0xbca7('0x1b')]['fn']('COUNT',db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x38')))),_0xbca7('0x39')],[db['sequelize']['fn']('COUNT',db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x3a')))),_0xbca7('0x3b')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')]['literal'](_0xbca7('0x3c')))),_0xbca7('0x3d')],[db['sequelize']['fn'](_0xbca7('0x1c'),db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')]('`state`\x20=\x2020,\x201,\x20null'))),_0xbca7('0x3b')],[db[_0xbca7('0x1b')]['fn']('COUNT',db[_0xbca7('0x1b')]['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),'outboundReCallsDay']],'group':[_0xbca7('0x3e')]})[_0xbca7('0x8')](function(_0x2d29a0){logger[_0xbca7('0x9')](_0xbca7('0x3f'),_0x4dcf38);logger[_0xbca7('0xc')](_0xbca7('0x3f'),_0x4dcf38,JSON[_0xbca7('0xd')](_0x2d29a0));_0x158028(_0x2d29a0);})[_0xbca7('0x12')](function(_0x5f0ab0){logger['error'](_0xbca7('0x3f'),_0x5f0ab0[_0xbca7('0x10')],_0x4dcf38);_0x215edf(_0x68e863[_0xbca7('0xe')](0x1f4,_0x5f0ab0[_0xbca7('0x10')]));});});};exports[_0xbca7('0x40')]=function(_0x2e120e){var _0x3aa813=this;return new Promise(function(_0xf81929,_0x320e14){return db[_0xbca7('0x14')]['findAll']({'raw':_0x2e120e[_0xbca7('0x17')]?_0x2e120e[_0xbca7('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x2e120e[_0xbca7('0x17')]?_0x2e120e[_0xbca7('0x17')][_0xbca7('0x1a')]||null:null,'attributes':[['campaign','name'],[db[_0xbca7('0x1b')]['fn']('COUNT',db[_0xbca7('0x1b')]['col']('id')),_0xbca7('0x41')],[db[_0xbca7('0x1b')]['fn'](_0xbca7('0x1c'),db['sequelize']['fn']('IF',db[_0xbca7('0x1b')][_0xbca7('0x1f')](_0xbca7('0x2a')))),_0xbca7('0x42')]],'group':[_0xbca7('0x3e')]})[_0xbca7('0x8')](function(_0x3a7089){logger['info'](_0xbca7('0x40'),_0x2e120e);logger['debug'](_0xbca7('0x40'),_0x2e120e,JSON['stringify'](_0x3a7089));_0xf81929(_0x3a7089);})[_0xbca7('0x12')](function(_0x34d80a){logger[_0xbca7('0xe')](_0xbca7('0x40'),_0x34d80a[_0xbca7('0x10')],_0x2e120e);_0x320e14(_0x3aa813[_0xbca7('0xe')](0x1f4,_0x34d80a[_0xbca7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 1710f10..7886eb9 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 _0x194f=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','/describe','describe','get','show','create','put','update','exports','multer','util'];(function(_0x4b61c4,_0x38e010){var _0x7a486f=function(_0x3212bb){while(--_0x3212bb){_0x4b61c4['push'](_0x4b61c4['shift']());}};_0x7a486f(++_0x38e010);}(_0x194f,0xf5));var _0xf194=function(_0x9a0776,_0x337bbe){_0x9a0776=_0x9a0776-0x0;var _0x473205=_0x194f[_0x9a0776];return _0x473205;};'use strict';var multer=require(_0xf194('0x0'));var util=require(_0xf194('0x1'));var path=require(_0xf194('0x2'));var timeout=require(_0xf194('0x3'));var express=require(_0xf194('0x4'));var router=express['Router']();var fs_extra=require(_0xf194('0x5'));var auth=require(_0xf194('0x6'));var interaction=require(_0xf194('0x7'));var config=require(_0xf194('0x8'));var controller=require(_0xf194('0x9'));router['get']('/',auth[_0xf194('0xa')](),controller['index']);router['get'](_0xf194('0xb'),auth['isAuthenticated'](),controller[_0xf194('0xc')]);router[_0xf194('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xf194('0xe')]);router['post']('/',auth[_0xf194('0xa')](),controller[_0xf194('0xf')]);router[_0xf194('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xf194('0x11')]);module[_0xf194('0x12')]=router; \ No newline at end of file +var _0xf6ce=['fs-extra','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','exports','multer','util','connect-timeout','Router'];(function(_0x500157,_0x256708){var _0x574598=function(_0x2a9f46){while(--_0x2a9f46){_0x500157['push'](_0x500157['shift']());}};_0x574598(++_0x256708);}(_0xf6ce,0x176));var _0xef6c=function(_0x31ce5f,_0x21296e){_0x31ce5f=_0x31ce5f-0x0;var _0x2779a8=_0xf6ce[_0x31ce5f];return _0x2779a8;};'use strict';var multer=require(_0xef6c('0x0'));var util=require(_0xef6c('0x1'));var path=require('path');var timeout=require(_0xef6c('0x2'));var express=require('express');var router=express[_0xef6c('0x3')]();var fs_extra=require(_0xef6c('0x4'));var auth=require(_0xef6c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef6c('0x6'));var controller=require(_0xef6c('0x7'));router[_0xef6c('0x8')]('/',auth['isAuthenticated'](),controller[_0xef6c('0x9')]);router[_0xef6c('0x8')](_0xef6c('0xa'),auth[_0xef6c('0xb')](),controller[_0xef6c('0xc')]);router[_0xef6c('0x8')](_0xef6c('0xd'),auth[_0xef6c('0xb')](),controller['show']);router[_0xef6c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xef6c('0xf')](_0xef6c('0xd'),auth[_0xef6c('0xb')](),controller[_0xef6c('0x10')]);module[_0xef6c('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 2fce2e8..3cd31ad 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 _0x94b1=['exports','name','STRING'];(function(_0x291867,_0x44491c){var _0x468aef=function(_0x3fe0cc){while(--_0x3fe0cc){_0x291867['push'](_0x291867['shift']());}};_0x468aef(++_0x44491c);}(_0x94b1,0x102));var _0x194b=function(_0xcf12fa,_0x13fbd9){_0xcf12fa=_0xcf12fa-0x0;var _0x3a81dc=_0x94b1[_0xcf12fa];return _0x3a81dc;};'use strict';var Sequelize=require('sequelize');module[_0x194b('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x194b('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x194b('0x2')]},'dialPrefix':{'type':Sequelize[_0x194b('0x2')]}}; \ No newline at end of file +var _0xeb5d=['exports','STRING','name'];(function(_0x549791,_0x418474){var _0x51c6c9=function(_0x5aba47){while(--_0x5aba47){_0x549791['push'](_0x549791['shift']());}};_0x51c6c9(++_0x418474);}(_0xeb5d,0x16b));var _0xdeb5=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xeb5d[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require('sequelize');module[_0xdeb5('0x0')]={'name':{'type':Sequelize[_0xdeb5('0x1')],'unique':_0xdeb5('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xdeb5('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 454fd41..881b919 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 _0x4fa8=['../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','offset','count','limit','set','json','apply','save','update','then','destroy','get','Lists','UserProfileResource','stack','name','send','index','map','CmList','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','keys','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','describe','addDisposition','getDispositions','findOne','ListId','Disposition','rows','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','raw','getContactsCsv','ContactItemType','OrderBy','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','field','customField_','item','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','additionalPhone_','description','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','sequelize','transaction','addCustomFields','text','Sequelize','TEXT','INTEGER','switch','BOOLEAN','queryInterface','cf_%s','getCustomFields','findAndCountAll','addAgents','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','spread','error','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x12e3f5,_0x434c80){var _0x5c50f3=function(_0x5de4e3){while(--_0x5de4e3){_0x12e3f5['push'](_0x12e3f5['shift']());}};_0x5c50f3(++_0x434c80);}(_0x4fa8,0x12e));var _0x84fa=function(_0x53cb7a,_0x586316){_0x53cb7a=_0x53cb7a-0x0;var _0x35bcda=_0x4fa8[_0x53cb7a];return _0x35bcda;};'use strict';var emlformat=require(_0x84fa('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x84fa('0x1'));var jsonpatch=require(_0x84fa('0x2'));var rp=require(_0x84fa('0x3'));var moment=require(_0x84fa('0x4'));var BPromise=require(_0x84fa('0x5'));var Mustache=require(_0x84fa('0x6'));var util=require(_0x84fa('0x7'));var path=require(_0x84fa('0x8'));var sox=require(_0x84fa('0x9'));var csv=require(_0x84fa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84fa('0xb'));var _=require(_0x84fa('0xc'));var squel=require('squel');var crypto=require(_0x84fa('0xd'));var jsforce=require(_0x84fa('0xe'));var deskjs=require(_0x84fa('0xf'));var toCsv=require(_0x84fa('0xa'));var querystring=require(_0x84fa('0x10'));var Papa=require(_0x84fa('0x11'));var Redis=require(_0x84fa('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x84fa('0x13'));var logger=require(_0x84fa('0x14'))(_0x84fa('0x15'));var utils=require(_0x84fa('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x84fa('0x17'));var db=require(_0x84fa('0x18'))['db'];var csv_results;config[_0x84fa('0x19')]=_[_0x84fa('0x1a')](config[_0x84fa('0x19')],{'host':_0x84fa('0x1b'),'port':0x18eb});var socket=require(_0x84fa('0x1c'))(new Redis(config['redis']));require('./cmList.socket')[_0x84fa('0x1d')](socket);function respondWithStatusCode(_0x31f5eb,_0x1f92bf){_0x1f92bf=_0x1f92bf||0xcc;return function(_0x3b49d9){if(_0x3b49d9){return _0x31f5eb[_0x84fa('0x1e')](_0x1f92bf);}return _0x31f5eb[_0x84fa('0x1f')](_0x1f92bf)[_0x84fa('0x20')]();};}function respondWithResult(_0x77152c,_0x26fc76){_0x26fc76=_0x26fc76||0xc8;return function(_0xfcdc29){if(_0xfcdc29){return _0x77152c[_0x84fa('0x1f')](_0x26fc76)['json'](_0xfcdc29);}};}function respondWithFilteredResult(_0x205c5a,_0x2f8461){return function(_0x26fce4){if(_0x26fce4){var _0x1eed40=typeof _0x2f8461['offset']===_0x84fa('0x21')&&typeof _0x2f8461['limit']==='undefined';var _0x1bb42e=_0x26fce4['count'];var _0x5b6481=_0x1eed40?0x0:_0x2f8461[_0x84fa('0x22')];var _0x41b241=_0x1eed40?_0x26fce4[_0x84fa('0x23')]:_0x2f8461[_0x84fa('0x22')]+_0x2f8461[_0x84fa('0x24')];var _0x1e4b91;if(_0x41b241>=_0x1bb42e){_0x41b241=_0x1bb42e;_0x1e4b91=0xc8;}else{_0x1e4b91=0xce;}_0x205c5a[_0x84fa('0x1f')](_0x1e4b91);return _0x205c5a[_0x84fa('0x25')]('Content-Range',_0x5b6481+'-'+_0x41b241+'/'+_0x1bb42e)[_0x84fa('0x26')](_0x26fce4);}return null;};}function patchUpdates(_0x5227fb){return function(_0x50f9d5){try{jsonpatch[_0x84fa('0x27')](_0x50f9d5,_0x5227fb,!![]);}catch(_0x14d4fa){return BPromise['reject'](_0x14d4fa);}return _0x50f9d5[_0x84fa('0x28')]();};}function saveUpdates(_0x1774f3,_0x3ba944){return function(_0x4b3a4e){if(_0x4b3a4e){return _0x4b3a4e[_0x84fa('0x29')](_0x1774f3)[_0x84fa('0x2a')](function(_0x14f148){return _0x14f148;});}return null;};}function removeEntity(_0x334db7,_0x125bf3){return function(_0x1c5dd0){if(_0x1c5dd0){return _0x1c5dd0[_0x84fa('0x2b')]()['then'](function(){var _0x2fa1e3=_0x1c5dd0[_0x84fa('0x2c')]({'plain':!![]});var _0x513742=_0x84fa('0x2d');return db[_0x84fa('0x2e')][_0x84fa('0x2b')]({'where':{'type':_0x513742,'resourceId':_0x2fa1e3['id']}})['then'](function(){return _0x1c5dd0;});})[_0x84fa('0x2a')](function(){_0x334db7['status'](0xcc)[_0x84fa('0x20')]();});}};}function handleEntityNotFound(_0x3e723c,_0x119c35){return function(_0xe6d251){if(!_0xe6d251){_0x3e723c[_0x84fa('0x1e')](0x194);}return _0xe6d251;};}function handleError(_0x42bb07,_0xa5f5e9){_0xa5f5e9=_0xa5f5e9||0x1f4;return function(_0xd70e94){logger['error'](_0xd70e94[_0x84fa('0x2f')]);if(_0xd70e94[_0x84fa('0x30')]){delete _0xd70e94['name'];}_0x42bb07['status'](_0xa5f5e9)[_0x84fa('0x31')](_0xd70e94);};}exports[_0x84fa('0x32')]=function(_0x1389c8,_0x5ea343){var _0x57c09c={},_0x13c685={},_0x5a6dc4={'count':0x0,'rows':[]};var _0x710bb0=_[_0x84fa('0x33')](db[_0x84fa('0x34')]['rawAttributes'],function(_0x14dbe7){return{'name':_0x14dbe7[_0x84fa('0x35')],'type':_0x14dbe7[_0x84fa('0x36')][_0x84fa('0x37')]};});_0x13c685[_0x84fa('0x38')]=_[_0x84fa('0x33')](_0x710bb0,_0x84fa('0x30'));_0x13c685[_0x84fa('0x39')]=_['keys'](_0x1389c8[_0x84fa('0x39')]);_0x13c685[_0x84fa('0x3a')]=_[_0x84fa('0x3b')](_0x13c685[_0x84fa('0x38')],_0x13c685[_0x84fa('0x39')]);_0x57c09c[_0x84fa('0x3c')]=_['intersection'](_0x13c685[_0x84fa('0x38')],qs[_0x84fa('0x3d')](_0x1389c8['query']['fields']));_0x57c09c[_0x84fa('0x3c')]=_0x57c09c['attributes'][_0x84fa('0x3e')]?_0x57c09c[_0x84fa('0x3c')]:_0x13c685['model'];if(!_0x1389c8['query'][_0x84fa('0x3f')](_0x84fa('0x40'))){_0x57c09c['limit']=qs[_0x84fa('0x24')](_0x1389c8[_0x84fa('0x39')][_0x84fa('0x24')]);_0x57c09c['offset']=qs[_0x84fa('0x22')](_0x1389c8[_0x84fa('0x39')][_0x84fa('0x22')]);}_0x57c09c[_0x84fa('0x41')]=qs[_0x84fa('0x42')](_0x1389c8[_0x84fa('0x39')][_0x84fa('0x42')]);_0x57c09c[_0x84fa('0x43')]=qs[_0x84fa('0x3a')](_[_0x84fa('0x44')](_0x1389c8[_0x84fa('0x39')],_0x13c685[_0x84fa('0x3a')]),_0x710bb0);if(_0x1389c8[_0x84fa('0x39')][_0x84fa('0x45')]){_0x57c09c[_0x84fa('0x43')]=_[_0x84fa('0x46')](_0x57c09c['where'],{'$or':_[_0x84fa('0x33')](_0x710bb0,function(_0x31588e){if(_0x31588e[_0x84fa('0x36')]!==_0x84fa('0x47')){var _0x29292d={};_0x29292d[_0x31588e[_0x84fa('0x30')]]={'$like':'%'+_0x1389c8[_0x84fa('0x39')][_0x84fa('0x45')]+'%'};return _0x29292d;}})});}_0x57c09c=_['merge']({},_0x57c09c,_0x1389c8[_0x84fa('0x48')]);var _0x18403a={'where':_0x57c09c[_0x84fa('0x43')]};return db[_0x84fa('0x34')][_0x84fa('0x23')](_0x18403a)['then'](function(_0xf34fb5){_0x5a6dc4['count']=_0xf34fb5;if(_0x1389c8['query'][_0x84fa('0x49')]){_0x57c09c[_0x84fa('0x4a')]=[{'all':!![]}];}return db[_0x84fa('0x34')][_0x84fa('0x4b')](_0x57c09c);})[_0x84fa('0x2a')](function(_0x5256f3){_0x5a6dc4['rows']=_0x5256f3;return _0x5a6dc4;})[_0x84fa('0x2a')](respondWithFilteredResult(_0x5ea343,_0x57c09c))['catch'](handleError(_0x5ea343,null));};exports[_0x84fa('0x4c')]=function(_0x26677f,_0x7596a2){var _0x5f1be1={'raw':![],'where':{'id':_0x26677f[_0x84fa('0x4d')]['id']}},_0x393d37={};_0x393d37[_0x84fa('0x38')]=_['keys'](db[_0x84fa('0x34')][_0x84fa('0x4e')]);_0x393d37[_0x84fa('0x39')]=_[_0x84fa('0x4f')](_0x26677f['query']);_0x393d37['filters']=_[_0x84fa('0x3b')](_0x393d37[_0x84fa('0x38')],_0x393d37[_0x84fa('0x39')]);_0x5f1be1[_0x84fa('0x3c')]=_[_0x84fa('0x3b')](_0x393d37['model'],qs[_0x84fa('0x3d')](_0x26677f[_0x84fa('0x39')]['fields']));_0x5f1be1[_0x84fa('0x3c')]=_0x5f1be1['attributes'][_0x84fa('0x3e')]?_0x5f1be1[_0x84fa('0x3c')]:_0x393d37[_0x84fa('0x38')];if(_0x26677f[_0x84fa('0x39')][_0x84fa('0x49')]){_0x5f1be1['include']=[{'all':!![]}];}_0x5f1be1=_[_0x84fa('0x46')]({},_0x5f1be1,_0x26677f[_0x84fa('0x48')]);return db[_0x84fa('0x34')]['find'](_0x5f1be1)[_0x84fa('0x2a')](handleEntityNotFound(_0x7596a2,null))[_0x84fa('0x2a')](respondWithResult(_0x7596a2,null))[_0x84fa('0x50')](handleError(_0x7596a2,null));};exports[_0x84fa('0x51')]=function(_0x1006a3,_0x42515d){return db[_0x84fa('0x34')][_0x84fa('0x51')](_0x1006a3[_0x84fa('0x52')],{})[_0x84fa('0x2a')](function(_0xb8a747){var _0x56a2bb=_0x1006a3[_0x84fa('0x53')][_0x84fa('0x2c')]({'plain':!![]});if(!_0x56a2bb)throw new Error(_0x84fa('0x54'));if(_0x56a2bb[_0x84fa('0x55')]===_0x84fa('0x53')){var _0x1d8e98=_0xb8a747[_0x84fa('0x2c')]({'plain':!![]});var _0x5368d2='Lists';return db['UserProfileSection'][_0x84fa('0x56')]({'where':{'name':_0x5368d2,'userProfileId':_0x56a2bb[_0x84fa('0x57')]},'raw':!![]})[_0x84fa('0x2a')](function(_0x125693){if(_0x125693&&_0x125693[_0x84fa('0x58')]===0x0){return db[_0x84fa('0x2e')][_0x84fa('0x51')]({'name':_0x1d8e98['name'],'resourceId':_0x1d8e98['id'],'type':_0x125693[_0x84fa('0x30')],'sectionId':_0x125693['id']},{})['then'](function(){return _0xb8a747;});}else{return _0xb8a747;}})['catch'](function(_0x810397){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x810397);throw _0x810397;});}return _0xb8a747;})['then'](respondWithResult(_0x42515d,0xc9))['catch'](handleError(_0x42515d,null));};exports['update']=function(_0x1bb9d2,_0x2660c6){if(_0x1bb9d2[_0x84fa('0x52')]['id']){delete _0x1bb9d2[_0x84fa('0x52')]['id'];}return db[_0x84fa('0x34')]['find']({'where':{'id':_0x1bb9d2[_0x84fa('0x4d')]['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x2660c6,null))[_0x84fa('0x2a')](saveUpdates(_0x1bb9d2[_0x84fa('0x52')],null))[_0x84fa('0x2a')](respondWithResult(_0x2660c6,null))['catch'](handleError(_0x2660c6,null));};exports[_0x84fa('0x2b')]=function(_0x3ca589,_0x293ebf){return db['CmList'][_0x84fa('0x56')]({'where':{'id':_0x3ca589[_0x84fa('0x4d')]['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x293ebf,null))['then'](removeEntity(_0x293ebf,null))[_0x84fa('0x50')](handleError(_0x293ebf,null));};exports[_0x84fa('0x59')]=function(_0x584fb8,_0x2cff80){return db[_0x84fa('0x34')]['describe']()[_0x84fa('0x2a')](respondWithResult(_0x2cff80,null))['catch'](handleError(_0x2cff80,null));};exports[_0x84fa('0x5a')]=function(_0x2faf4c,_0x2c93ff,_0x382bda){if(_0x2faf4c['body']['id']){delete _0x2faf4c['body']['id'];}return db[_0x84fa('0x34')][_0x84fa('0x56')]({'where':{'id':_0x2faf4c['params']['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x2c93ff,null))[_0x84fa('0x2a')](function(_0x567335){if(_0x567335){_0x2faf4c[_0x84fa('0x52')]['ListId']=_0x567335['id'];return db['Disposition']['create'](_0x2faf4c[_0x84fa('0x52')]);}})[_0x84fa('0x2a')](respondWithResult(_0x2c93ff,null))[_0x84fa('0x50')](handleError(_0x2c93ff,null));};exports[_0x84fa('0x5b')]=function(_0x159e0a,_0x1033a3,_0x2144f6){var _0x50b2c7={'raw':![],'where':{}};var _0x30633={};var _0x13731e={'count':0x0,'rows':[]};return db['CmList'][_0x84fa('0x5c')]({'where':{'id':_0x159e0a[_0x84fa('0x4d')]['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x1033a3,null))[_0x84fa('0x2a')](function(_0x29afaf){if(_0x29afaf){_0x30633[_0x84fa('0x38')]=_[_0x84fa('0x4f')](db['Disposition'][_0x84fa('0x4e')]);_0x30633[_0x84fa('0x39')]=_['keys'](_0x159e0a['query']);_0x30633['filters']=_['intersection'](_0x30633[_0x84fa('0x38')],_0x30633['query']);_0x50b2c7[_0x84fa('0x3c')]=_[_0x84fa('0x3b')](_0x30633['model'],qs[_0x84fa('0x3d')](_0x159e0a[_0x84fa('0x39')][_0x84fa('0x3d')]));_0x50b2c7[_0x84fa('0x3c')]=_0x50b2c7[_0x84fa('0x3c')]['length']?_0x50b2c7[_0x84fa('0x3c')]:_0x30633[_0x84fa('0x38')];if(!_0x159e0a['query']['hasOwnProperty'](_0x84fa('0x40'))){_0x50b2c7[_0x84fa('0x24')]=qs['limit'](_0x159e0a['query']['limit']);_0x50b2c7['offset']=qs[_0x84fa('0x22')](_0x159e0a[_0x84fa('0x39')][_0x84fa('0x22')]);}_0x50b2c7[_0x84fa('0x41')]=qs[_0x84fa('0x42')](_0x159e0a[_0x84fa('0x39')]['sort']);_0x50b2c7[_0x84fa('0x43')]=qs[_0x84fa('0x3a')](_['pick'](_0x159e0a[_0x84fa('0x39')],_0x30633[_0x84fa('0x3a')]));_0x50b2c7['where'][_0x84fa('0x5d')]=_0x29afaf['id'];if(_0x159e0a[_0x84fa('0x39')][_0x84fa('0x45')]){_0x50b2c7[_0x84fa('0x43')]=_[_0x84fa('0x46')](_0x50b2c7[_0x84fa('0x43')],{'$or':_[_0x84fa('0x33')](_0x50b2c7['attributes'],function(_0x11e338){var _0xa97dd6={};_0xa97dd6[_0x11e338]={'$like':'%'+_0x159e0a[_0x84fa('0x39')][_0x84fa('0x45')]+'%'};return _0xa97dd6;})});}_0x50b2c7=_['merge']({},_0x50b2c7,_0x159e0a[_0x84fa('0x48')]);return db[_0x84fa('0x5e')][_0x84fa('0x23')]({'where':_0x50b2c7[_0x84fa('0x43')]})[_0x84fa('0x2a')](function(_0xf81c9){_0x13731e[_0x84fa('0x23')]=_0xf81c9;if(_0x159e0a[_0x84fa('0x39')]['includeAll']){_0x50b2c7[_0x84fa('0x4a')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x50b2c7);})[_0x84fa('0x2a')](function(_0xb0c8fe){_0x13731e[_0x84fa('0x5f')]=_0xb0c8fe;return _0x13731e;});}})[_0x84fa('0x2a')](respondWithFilteredResult(_0x1033a3,_0x50b2c7))[_0x84fa('0x50')](handleError(_0x1033a3,null));};exports[_0x84fa('0x60')]=function(_0x7344e3,_0x24e002,_0x33a2da){return db['CmList']['find']({'where':{'id':_0x7344e3['params']['id']}})['then'](handleEntityNotFound(_0x24e002,null))[_0x84fa('0x2a')](function(_0x5e12f6){if(_0x5e12f6){return _0x5e12f6[_0x84fa('0x60')](_0x7344e3['query'][_0x84fa('0x61')]);}})[_0x84fa('0x2a')](respondWithStatusCode(_0x24e002,null))['catch'](handleError(_0x24e002,null));};exports[_0x84fa('0x62')]=function(_0x286e57,_0x3b7219,_0x5b59aa){return db[_0x84fa('0x34')][_0x84fa('0x56')]({'where':{'id':_0x286e57[_0x84fa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3b7219,null))['then'](function(_0x26136c){if(_0x26136c){var _0x388abb=[];var _0x46873b={'success':[],'errors':[]};return db[_0x84fa('0x63')]['describe']()[_0x84fa('0x2a')](function(_0x4a3ef8){if(_0x286e57['body'][_0x84fa('0x64')]&&_[_0x84fa('0x65')](_0x286e57[_0x84fa('0x52')]['tags'])){if(_0x286e57[_0x84fa('0x52')][_0x84fa('0x64')]['length']){_0x286e57['body'][_0x84fa('0x64')]=_0x286e57[_0x84fa('0x52')][_0x84fa('0x64')][_0x84fa('0x66')](';')+';';}else{_0x286e57['body']['tags']=null;}}else{_0x286e57[_0x84fa('0x52')][_0x84fa('0x64')]=null;}if(_0x286e57['body']&&_['isArray'](_0x286e57['body'])){for(var _0x25f237=0x0;_0x25f237<_0x286e57[_0x84fa('0x52')][_0x84fa('0x3e')];_0x25f237+=0x1){_0x286e57[_0x84fa('0x52')][_0x25f237][_0x84fa('0x5d')]=_0x286e57['params']['id'];_0x388abb[_0x84fa('0x67')](_0x286e57['body'][_0x25f237]);}return BPromise[_0x84fa('0x68')](_0x388abb,function(_0x3d074b){return db[_0x84fa('0x63')][_0x84fa('0x51')](_[_0x84fa('0x69')](_0x3d074b,['ids','id'])||{},{'fields':_[_0x84fa('0x4f')](_0x4a3ef8),'raw':!![]})[_0x84fa('0x2a')](function(_0xca5a21){_0x46873b[_0x84fa('0x6a')][_0x84fa('0x67')](_0xca5a21[_0x84fa('0x6b')]);})[_0x84fa('0x50')](function(_0xa23c40){_0x46873b[_0x84fa('0x6c')][_0x84fa('0x67')]({'data':_0x3d074b,'error':_0xa23c40[_0x84fa('0x6d')]});});})['then'](function(_0x3e3e89){return _0x46873b;})[_0x84fa('0x50')](function(_0x2bc6ee){return _0x2bc6ee;});}else{_0x3b7219[_0x84fa('0x1f')](0x190)['json']({'message':_0x84fa('0x6e')});}});}})[_0x84fa('0x2a')](respondWithResult(_0x3b7219,null))[_0x84fa('0x50')](handleError(_0x3b7219,null));};exports[_0x84fa('0x6f')]=function(_0x28ce9e,_0x3a82d9,_0x528ff5){var _0x27cd98;return db[_0x84fa('0x34')][_0x84fa('0x56')]({'where':{'id':_0x28ce9e[_0x84fa('0x4d')]['id']},'include':[{'model':db[_0x84fa('0x70')],'as':_0x84fa('0x71')}]})['then'](handleEntityNotFound(_0x3a82d9,null))[_0x84fa('0x2a')](function(_0x1918f8){if(_0x1918f8){_0x27cd98=_0x1918f8;return db[_0x84fa('0x63')]['rawAttributes'];}})[_0x84fa('0x2a')](function(_0x460cf5){if(_0x460cf5){var _0x327ef8={};var _0x2285b={};_0x2285b[_0x84fa('0x38')]=_['concat'](_[_0x84fa('0x4f')](_0x460cf5),_['map'](_0x27cd98[_0x84fa('0x71')],function(_0x5645ae){return util[_0x84fa('0x72')]('cf_%d',_0x5645ae['id']);}));_0x2285b[_0x84fa('0x39')]=_[_0x84fa('0x4f')](_0x28ce9e['query']);_0x2285b['filters']=_[_0x84fa('0x3b')](_0x2285b[_0x84fa('0x38')],_0x2285b[_0x84fa('0x39')]);_0x327ef8[_0x84fa('0x3c')]=_[_0x84fa('0x3b')](_0x2285b['model'],qs[_0x84fa('0x3d')](_0x28ce9e[_0x84fa('0x39')][_0x84fa('0x3d')]));_0x327ef8[_0x84fa('0x3c')]=_0x327ef8[_0x84fa('0x3c')]['length']?_0x327ef8['attributes']:_0x2285b[_0x84fa('0x38')];if(!_0x28ce9e[_0x84fa('0x39')]['hasOwnProperty'](_0x84fa('0x40'))){_0x327ef8[_0x84fa('0x24')]=qs['limit'](_0x28ce9e['query'][_0x84fa('0x24')]);_0x327ef8['offset']=qs[_0x84fa('0x22')](_0x28ce9e[_0x84fa('0x39')][_0x84fa('0x22')]);}_0x327ef8[_0x84fa('0x41')]=qs['sort'](_0x28ce9e[_0x84fa('0x39')][_0x84fa('0x42')]);_0x327ef8[_0x84fa('0x43')]=qs[_0x84fa('0x3a')](_['pick'](_0x28ce9e[_0x84fa('0x39')],_0x2285b['filters']));_0x327ef8[_0x84fa('0x73')]=!![];if(_0x28ce9e['query'][_0x84fa('0x45')]){_0x327ef8[_0x84fa('0x43')]=_['merge'](_0x327ef8[_0x84fa('0x43')],{'$or':_[_0x84fa('0x33')](_0x327ef8[_0x84fa('0x3c')],function(_0x41ac95){var _0x28b36a={};_0x28b36a[_0x41ac95]={'$like':'%'+_0x28ce9e['query'][_0x84fa('0x45')]+'%'};return _0x28b36a;})});}_0x327ef8=_[_0x84fa('0x46')]({},_0x327ef8,_0x28ce9e[_0x84fa('0x48')]);return _0x27cd98[_0x84fa('0x6f')](_0x327ef8);}})[_0x84fa('0x2a')](respondWithResult(_0x3a82d9,null))[_0x84fa('0x50')](handleError(_0x3a82d9,null));};exports[_0x84fa('0x74')]=function(_0x4eeb5f,_0x3c3298,_0x4c64ad){var _0x270e5a;var _0x4e1e1f;var _0x38a428;var _0x2fc2a1=_0x4eeb5f[_0x84fa('0x4d')]['id'];csv_results=[];return db[_0x84fa('0x75')][_0x84fa('0x4b')]({'attributes':['id',_0x84fa('0x30')],'raw':!![],'order':[_0x84fa('0x76')]})['then'](function(_0x1577bf){_0x270e5a=_0x1577bf;var _0x38e944=_[_0x84fa('0x4f')](db[_0x84fa('0x63')][_0x84fa('0x4e')]);return db[_0x84fa('0x70')]['findAll']({'raw':!![],'attributes':['id',_0x84fa('0x77')]})[_0x84fa('0x2a')](function(_0x31ad86){_0x4e1e1f=_0x31ad86;var _0x38b7eb=squel[_0x84fa('0x78')]()['fields'](_0x38e944)[_0x84fa('0x79')](_0x84fa('0x7a'),'c')[_0x84fa('0x43')](_0x84fa('0x7b'),_0x2fc2a1)['where'](_0x84fa('0x7c'))['distinct']();for(var _0x12386b=0x0;_0x12386b<_0x4e1e1f[_0x84fa('0x3e')];_0x12386b++){_0x38b7eb[_0x84fa('0x7d')]('c.cf_'+_0x4e1e1f[_0x12386b]['id'],_0x84fa('0x7e')+_0x4e1e1f[_0x12386b]['alias']);}for(var _0x12386b=0x0;_0x12386b<_0x270e5a[_0x84fa('0x3e')];_0x12386b++){_0x38b7eb[_0x84fa('0x7d')](squel['select']()[_0x84fa('0x7d')](_0x84fa('0x7f'))[_0x84fa('0x79')](_0x84fa('0x80'))['where'](_0x84fa('0x81'),_0x270e5a[_0x12386b]['id'])[_0x84fa('0x43')](_0x84fa('0x82')),_0x84fa('0x83')+_0x270e5a[_0x12386b]['name']);_0x38b7eb[_0x84fa('0x7d')](squel[_0x84fa('0x78')]()[_0x84fa('0x7d')](_0x84fa('0x84'))[_0x84fa('0x79')](_0x84fa('0x80'))[_0x84fa('0x43')](_0x84fa('0x81'),_0x270e5a[_0x12386b]['id'])['where']('CmContactId\x20=\x20c.id'),'description_additionalPhone_'+_0x270e5a[_0x12386b][_0x84fa('0x30')]);}var _0x241600=[];_0x241600[_0x84fa('0x67')](_0x38b7eb['toString']());BPromise['each'](_0x241600,handleQuery)['then'](function(_0x3ae0d0){handleQuery(_0x38b7eb[_0x84fa('0x85')]());var _0x3fb5ef=csv_results[0x0];if(!_[_0x84fa('0x86')](_0x3fb5ef)){var _0x4eca76=toCsv(_0x3fb5ef);var _0x5cff09=Date[_0x84fa('0x87')]();fs[_0x84fa('0x88')](util[_0x84fa('0x72')](_0x84fa('0x89'),_0x2fc2a1,_0x5cff09),_0x4eca76);_0x3c3298[_0x84fa('0x8a')](_0x84fa('0x8b'),_0x84fa('0x8c')+util[_0x84fa('0x72')](_0x84fa('0x8d'),_0x2fc2a1,_0x5cff09));_0x3c3298[_0x84fa('0x8a')]('Content-type','text/csv');return _0x3c3298['download'](util[_0x84fa('0x72')]('/tmp/list_%d_%s.csv',_0x2fc2a1,_0x5cff09));}else{return _0x3c3298['sendStatus'](0xcc);}});});});};exports['addCustomField']=function(_0x2322db,_0x28619a,_0x23d628){var _0x501436;delete _0x2322db['body']['id'];return db[_0x84fa('0x34')][_0x84fa('0x5c')]({'where':{'id':_0x2322db[_0x84fa('0x4d')]['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x28619a,null))[_0x84fa('0x2a')](function(_0x2b3d04){if(_0x2b3d04){return db[_0x84fa('0x8e')][_0x84fa('0x8f')](function(_0x3319a1){return db[_0x84fa('0x70')][_0x84fa('0x51')](_0x2322db[_0x84fa('0x52')],{'transaction':_0x3319a1})['then'](function(_0x1c5bce){_0x501436=_0x1c5bce;return _0x2b3d04[_0x84fa('0x90')](_0x1c5bce,{'transaction':_0x3319a1});})[_0x84fa('0x2a')](function(){var _0x2dd46f={'type':db['Sequelize']['TEXT'],'transaction':_0x3319a1};switch(_0x2322db[_0x84fa('0x52')][_0x84fa('0x36')]){case _0x84fa('0x91'):_0x2dd46f['type']=db[_0x84fa('0x92')][_0x84fa('0x93')];break;case'number':_0x2dd46f[_0x84fa('0x36')]=db[_0x84fa('0x92')][_0x84fa('0x94')];break;case _0x84fa('0x95'):_0x2dd46f[_0x84fa('0x36')]=db[_0x84fa('0x92')][_0x84fa('0x96')];_0x2dd46f['defaultValue']=![];break;default:}return db[_0x84fa('0x8e')][_0x84fa('0x97')]['addColumn'](_0x84fa('0x7a'),util[_0x84fa('0x72')](_0x84fa('0x98'),_0x501436['id']),_0x2dd46f);})[_0x84fa('0x2a')](function(){return _0x501436;});});}})[_0x84fa('0x2a')](respondWithResult(_0x28619a,null))[_0x84fa('0x50')](handleError(_0x28619a,null));};exports[_0x84fa('0x99')]=function(_0x2fa280,_0x534124,_0x19dfc2){var _0x1cc41d={};var _0x5520da={};var _0x57fc61;var _0x50241e;return db['CmList']['findOne']({'where':{'id':_0x2fa280[_0x84fa('0x4d')]['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x534124,null))[_0x84fa('0x2a')](function(_0x1e529d){if(_0x1e529d){_0x57fc61=_0x1e529d;_0x5520da[_0x84fa('0x38')]=_[_0x84fa('0x4f')](db[_0x84fa('0x70')][_0x84fa('0x4e')]);_0x5520da[_0x84fa('0x39')]=_[_0x84fa('0x4f')](_0x2fa280[_0x84fa('0x39')]);_0x5520da[_0x84fa('0x3a')]=_[_0x84fa('0x3b')](_0x5520da['model'],_0x5520da[_0x84fa('0x39')]);_0x1cc41d['attributes']=_[_0x84fa('0x3b')](_0x5520da[_0x84fa('0x38')],qs[_0x84fa('0x3d')](_0x2fa280[_0x84fa('0x39')][_0x84fa('0x3d')]));_0x1cc41d[_0x84fa('0x3c')]=_0x1cc41d[_0x84fa('0x3c')][_0x84fa('0x3e')]?_0x1cc41d['attributes']:_0x5520da[_0x84fa('0x38')];_0x1cc41d['order']=qs['sort'](_0x2fa280[_0x84fa('0x39')][_0x84fa('0x42')]);_0x1cc41d['where']=qs['filters'](_[_0x84fa('0x44')](_0x2fa280[_0x84fa('0x39')],_0x5520da[_0x84fa('0x3a')]));_0x1cc41d['where']=_[_0x84fa('0x46')](_0x1cc41d['where'],{'$or':[{'ListId':_0x1e529d['id']},{'ListId':null}]});if(_0x2fa280[_0x84fa('0x39')][_0x84fa('0x45')]){_0x1cc41d[_0x84fa('0x43')]=_[_0x84fa('0x46')](_0x1cc41d[_0x84fa('0x43')],{'$or':_[_0x84fa('0x33')](_0x1cc41d['attributes'],function(_0x4671bb){var _0x545446={};_0x545446[_0x4671bb]={'$like':'%'+_0x2fa280[_0x84fa('0x39')][_0x84fa('0x45')]+'%'};return _0x545446;})});}_0x1cc41d=_['merge']({},_0x1cc41d,_0x2fa280[_0x84fa('0x48')]);return db['CmCustomField']['findAndCountAll'](_0x1cc41d);}})[_0x84fa('0x2a')](respondWithResult(_0x534124,null))[_0x84fa('0x50')](handleError(_0x534124,null));};exports['getGlobalCustomFields']=function(_0x34c96c,_0x238fd4){return db['CmCustomField'][_0x84fa('0x9a')]({'where':{'ListId':null}})[_0x84fa('0x2a')](handleEntityNotFound(_0x238fd4,null))['then'](function(_0x167d3f){return _0x167d3f;})[_0x84fa('0x2a')](respondWithResult(_0x238fd4,null))[_0x84fa('0x50')](handleError(_0x238fd4,null));};exports[_0x84fa('0x9b')]=function(_0x2dc1d9,_0x474987,_0x1e14e5){return db[_0x84fa('0x34')][_0x84fa('0x56')]({'where':{'id':_0x2dc1d9[_0x84fa('0x4d')]['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x474987,null))[_0x84fa('0x2a')](function(_0xd186cb){if(_0xd186cb){return _0xd186cb[_0x84fa('0x9b')](_0x2dc1d9[_0x84fa('0x52')]['ids'],_[_0x84fa('0x69')](_0x2dc1d9['body'],[_0x84fa('0x61'),'id'])||{})['spread'](function(_0x13cd4f){for(var _0xed8e7=0x0;_0xed8e7<_0x2dc1d9[_0x84fa('0x52')]['ids'][_0x84fa('0x3e')];_0xed8e7+=0x1){socket['emit'](_0x84fa('0x9c'),{'UserId':Number(_0x2dc1d9[_0x84fa('0x52')][_0x84fa('0x61')][_0xed8e7]),'CmListId':Number(_0x2dc1d9[_0x84fa('0x4d')]['id'])});}return _0x13cd4f;});}})[_0x84fa('0x2a')](respondWithResult(_0x474987,null))['catch'](handleError(_0x474987,null));};exports[_0x84fa('0x9d')]=function(_0x64bd4b,_0x27f216,_0xc3f7f7){return db['CmList'][_0x84fa('0x56')]({'where':{'id':_0x64bd4b[_0x84fa('0x4d')]['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x27f216,null))[_0x84fa('0x2a')](function(_0x992f39){if(_0x992f39){return _0x992f39[_0x84fa('0x9d')](_0x64bd4b[_0x84fa('0x39')][_0x84fa('0x61')])['then'](function(){if(_[_0x84fa('0x65')](_0x64bd4b['query'][_0x84fa('0x61')])){for(var _0x3e0729=0x0;_0x3e0729<_0x64bd4b[_0x84fa('0x39')][_0x84fa('0x61')][_0x84fa('0x3e')];_0x3e0729+=0x1){socket[_0x84fa('0x9e')](_0x84fa('0x9f'),{'UserId':Number(_0x64bd4b['query'][_0x84fa('0x61')][_0x3e0729]),'CmListId':Number(_0x64bd4b[_0x84fa('0x4d')]['id'])});}}else{socket[_0x84fa('0x9e')](_0x84fa('0x9f'),{'UserId':Number(_0x64bd4b[_0x84fa('0x39')]['ids']),'CmListId':Number(_0x64bd4b[_0x84fa('0x4d')]['id'])});}});}})[_0x84fa('0x2a')](respondWithStatusCode(_0x27f216,null))[_0x84fa('0x50')](handleError(_0x27f216,null));};exports[_0x84fa('0xa0')]=function(_0x14ec3f,_0x534622,_0x2f3178){var _0x1dc6fb={};var _0x32c553={};var _0x294176;var _0x4a022d;return db[_0x84fa('0x34')][_0x84fa('0x5c')]({'where':{'id':_0x14ec3f['params']['id']}})[_0x84fa('0x2a')](handleEntityNotFound(_0x534622,null))[_0x84fa('0x2a')](function(_0x29f131){if(_0x29f131){_0x294176=_0x29f131;_0x32c553['model']=_[_0x84fa('0x4f')](db['User']['rawAttributes']);_0x32c553['query']=_[_0x84fa('0x4f')](_0x14ec3f[_0x84fa('0x39')]);_0x32c553[_0x84fa('0x3a')]=_[_0x84fa('0x3b')](_0x32c553[_0x84fa('0x38')],_0x32c553['query']);_0x1dc6fb[_0x84fa('0x3c')]=_[_0x84fa('0x3b')](_0x32c553[_0x84fa('0x38')],qs[_0x84fa('0x3d')](_0x14ec3f[_0x84fa('0x39')][_0x84fa('0x3d')]));_0x1dc6fb['attributes']=_0x1dc6fb[_0x84fa('0x3c')][_0x84fa('0x3e')]?_0x1dc6fb[_0x84fa('0x3c')]:_0x32c553['model'];_0x1dc6fb[_0x84fa('0x41')]=qs[_0x84fa('0x42')](_0x14ec3f[_0x84fa('0x39')]['sort']);_0x1dc6fb[_0x84fa('0x43')]=qs[_0x84fa('0x3a')](_[_0x84fa('0x44')](_0x14ec3f[_0x84fa('0x39')],_0x32c553[_0x84fa('0x3a')]));if(_0x14ec3f[_0x84fa('0x39')][_0x84fa('0x45')]){_0x1dc6fb[_0x84fa('0x43')]=_[_0x84fa('0x46')](_0x1dc6fb[_0x84fa('0x43')],{'$or':_[_0x84fa('0x33')](_0x1dc6fb['attributes'],function(_0x2b7deb){var _0x36f85a={};_0x36f85a[_0x2b7deb]={'$like':'%'+_0x14ec3f[_0x84fa('0x39')]['filter']+'%'};return _0x36f85a;})});}_0x1dc6fb=_['merge']({},_0x1dc6fb,_0x14ec3f[_0x84fa('0x48')]);return _0x294176[_0x84fa('0xa0')](_0x1dc6fb);}})['then'](function(_0x2e5202){if(_0x2e5202){_0x4a022d=_0x2e5202[_0x84fa('0x3e')];if(!_0x14ec3f[_0x84fa('0x39')]['hasOwnProperty'](_0x84fa('0x40'))){_0x1dc6fb['limit']=qs[_0x84fa('0x24')](_0x14ec3f[_0x84fa('0x39')][_0x84fa('0x24')]);_0x1dc6fb[_0x84fa('0x22')]=qs[_0x84fa('0x22')](_0x14ec3f['query'][_0x84fa('0x22')]);}return _0x294176[_0x84fa('0xa0')](_0x1dc6fb);}})['then'](function(_0x36bf37){if(_0x36bf37){return _0x36bf37?{'count':_0x4a022d,'rows':_0x36bf37}:null;}})['then'](respondWithResult(_0x534622,null))[_0x84fa('0x50')](handleError(_0x534622,null));};function handleQuery(_0x42272a){logger['info'](_0x42272a);return db[_0x84fa('0x8e')][_0x84fa('0x39')](_0x42272a)[_0x84fa('0xa1')](function(_0x356837){csv_results[_0x84fa('0x67')](_0x356837);})['catch'](function(_0x332579){logger[_0x84fa('0xa2')](_0x332579[_0x84fa('0x6d')]);});} \ No newline at end of file +var _0x03d6=['filters','merge','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','intersection','fields','find','body','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','ListId','Disposition','findOne','removeDispositions','ids','addContacts','CmContact','tags','isArray','each','omit','success','push','dataValues','errors','message','status','getContacts','CustomFields','concat','format','cf_%d','pick','raw','ContactItemType','OrderBy','CmCustomField','alias','select','from','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','customField_','CmContactId\x20=\x20c.id','additionalPhone_','description','cm_contact_has_items','ItemTypeId\x20=\x20?','toString','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','download','addCustomField','transaction','addCustomFields','Sequelize','text','TEXT','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','spread','userCmList:save','removeAgents','userCmList:remove','emit','getAgents','User','info','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','./cmList.socket','sendStatus','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','Lists','UserProfileResource','error','name','send','map','CmList','rawAttributes','fieldName','type','key','model','query','keys','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x03d6,0x1aa));var _0x603d=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x03d6[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x603d('0x0'));var rimraf=require(_0x603d('0x1'));var zipdir=require(_0x603d('0x2'));var jsonpatch=require(_0x603d('0x3'));var rp=require(_0x603d('0x4'));var moment=require(_0x603d('0x5'));var BPromise=require(_0x603d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x603d('0x7'));var sox=require(_0x603d('0x8'));var csv=require(_0x603d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x603d('0xa'));var squel=require(_0x603d('0xb'));var crypto=require(_0x603d('0xc'));var jsforce=require(_0x603d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x603d('0x9'));var querystring=require(_0x603d('0xe'));var Papa=require('papaparse');var Redis=require(_0x603d('0xf'));var authService=require(_0x603d('0x10'));var qs=require(_0x603d('0x11'));var as=require(_0x603d('0x12'));var hardwareService=require(_0x603d('0x13'));var logger=require('../../config/logger')(_0x603d('0x14'));var utils=require(_0x603d('0x15'));var config=require(_0x603d('0x16'));var licenseUtil=require(_0x603d('0x17'));var db=require(_0x603d('0x18'))['db'];var csv_results;config['redis']=_[_0x603d('0x19')](config['redis'],{'host':_0x603d('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x603d('0x1b')]));require(_0x603d('0x1c'))['register'](socket);function respondWithStatusCode(_0x46090c,_0x354228){_0x354228=_0x354228||0xcc;return function(_0x3ddce4){if(_0x3ddce4){return _0x46090c[_0x603d('0x1d')](_0x354228);}return _0x46090c['status'](_0x354228)['end']();};}function respondWithResult(_0x3625c0,_0x5c1b1b){_0x5c1b1b=_0x5c1b1b||0xc8;return function(_0x431c7d){if(_0x431c7d){return _0x3625c0['status'](_0x5c1b1b)[_0x603d('0x1e')](_0x431c7d);}};}function respondWithFilteredResult(_0x26a845,_0xbd9609){return function(_0x54dc0d){if(_0x54dc0d){var _0x122852=typeof _0xbd9609[_0x603d('0x1f')]===_0x603d('0x20')&&typeof _0xbd9609[_0x603d('0x21')]==='undefined';var _0x1646d4=_0x54dc0d[_0x603d('0x22')];var _0x45b0f6=_0x122852?0x0:_0xbd9609[_0x603d('0x1f')];var _0x5c349e=_0x122852?_0x54dc0d['count']:_0xbd9609[_0x603d('0x1f')]+_0xbd9609[_0x603d('0x21')];var _0x2bd25f;if(_0x5c349e>=_0x1646d4){_0x5c349e=_0x1646d4;_0x2bd25f=0xc8;}else{_0x2bd25f=0xce;}_0x26a845['status'](_0x2bd25f);return _0x26a845[_0x603d('0x23')](_0x603d('0x24'),_0x45b0f6+'-'+_0x5c349e+'/'+_0x1646d4)[_0x603d('0x1e')](_0x54dc0d);}return null;};}function patchUpdates(_0x58fa7c){return function(_0x3873c1){try{jsonpatch['apply'](_0x3873c1,_0x58fa7c,!![]);}catch(_0x2bda83){return BPromise[_0x603d('0x25')](_0x2bda83);}return _0x3873c1[_0x603d('0x26')]();};}function saveUpdates(_0x9f57bd,_0x3e6ce9){return function(_0x4c9c5e){if(_0x4c9c5e){return _0x4c9c5e[_0x603d('0x27')](_0x9f57bd)[_0x603d('0x28')](function(_0x5b5746){return _0x5b5746;});}return null;};}function removeEntity(_0x520a81,_0x39efe9){return function(_0x34e9cc){if(_0x34e9cc){return _0x34e9cc['destroy']()[_0x603d('0x28')](function(){var _0x903f78=_0x34e9cc[_0x603d('0x29')]({'plain':!![]});var _0x5d3b1b=_0x603d('0x2a');return db[_0x603d('0x2b')]['destroy']({'where':{'type':_0x5d3b1b,'resourceId':_0x903f78['id']}})[_0x603d('0x28')](function(){return _0x34e9cc;});})[_0x603d('0x28')](function(){_0x520a81['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f1ba8,_0x5741c9){return function(_0x465508){if(!_0x465508){_0x5f1ba8[_0x603d('0x1d')](0x194);}return _0x465508;};}function handleError(_0xf6b552,_0x375027){_0x375027=_0x375027||0x1f4;return function(_0x78e55f){logger[_0x603d('0x2c')](_0x78e55f['stack']);if(_0x78e55f[_0x603d('0x2d')]){delete _0x78e55f[_0x603d('0x2d')];}_0xf6b552['status'](_0x375027)[_0x603d('0x2e')](_0x78e55f);};}exports['index']=function(_0x616e80,_0x5361b2){var _0x25a814={},_0x3460ee={},_0x4f8736={'count':0x0,'rows':[]};var _0x22101b=_[_0x603d('0x2f')](db[_0x603d('0x30')][_0x603d('0x31')],function(_0x1541e5){return{'name':_0x1541e5[_0x603d('0x32')],'type':_0x1541e5[_0x603d('0x33')][_0x603d('0x34')]};});_0x3460ee[_0x603d('0x35')]=_[_0x603d('0x2f')](_0x22101b,_0x603d('0x2d'));_0x3460ee[_0x603d('0x36')]=_[_0x603d('0x37')](_0x616e80[_0x603d('0x36')]);_0x3460ee['filters']=_['intersection'](_0x3460ee[_0x603d('0x35')],_0x3460ee[_0x603d('0x36')]);_0x25a814[_0x603d('0x38')]=_['intersection'](_0x3460ee[_0x603d('0x35')],qs['fields'](_0x616e80[_0x603d('0x36')]['fields']));_0x25a814['attributes']=_0x25a814[_0x603d('0x38')][_0x603d('0x39')]?_0x25a814['attributes']:_0x3460ee[_0x603d('0x35')];if(!_0x616e80[_0x603d('0x36')][_0x603d('0x3a')](_0x603d('0x3b'))){_0x25a814['limit']=qs['limit'](_0x616e80['query'][_0x603d('0x21')]);_0x25a814[_0x603d('0x1f')]=qs['offset'](_0x616e80['query'][_0x603d('0x1f')]);}_0x25a814[_0x603d('0x3c')]=qs[_0x603d('0x3d')](_0x616e80['query'][_0x603d('0x3d')]);_0x25a814[_0x603d('0x3e')]=qs[_0x603d('0x3f')](_['pick'](_0x616e80[_0x603d('0x36')],_0x3460ee[_0x603d('0x3f')]),_0x22101b);if(_0x616e80['query']['filter']){_0x25a814[_0x603d('0x3e')]=_[_0x603d('0x40')](_0x25a814['where'],{'$or':_[_0x603d('0x2f')](_0x22101b,function(_0x3aa0d1){if(_0x3aa0d1[_0x603d('0x33')]!==_0x603d('0x41')){var _0x2abe67={};_0x2abe67[_0x3aa0d1[_0x603d('0x2d')]]={'$like':'%'+_0x616e80['query'][_0x603d('0x42')]+'%'};return _0x2abe67;}})});}_0x25a814=_[_0x603d('0x40')]({},_0x25a814,_0x616e80[_0x603d('0x43')]);var _0x463596={'where':_0x25a814[_0x603d('0x3e')]};return db[_0x603d('0x30')][_0x603d('0x22')](_0x463596)[_0x603d('0x28')](function(_0x17ad8e){_0x4f8736[_0x603d('0x22')]=_0x17ad8e;if(_0x616e80[_0x603d('0x36')][_0x603d('0x44')]){_0x25a814['include']=[{'all':!![]}];}return db['CmList'][_0x603d('0x45')](_0x25a814);})[_0x603d('0x28')](function(_0x3ea2b9){_0x4f8736['rows']=_0x3ea2b9;return _0x4f8736;})[_0x603d('0x28')](respondWithFilteredResult(_0x5361b2,_0x25a814))[_0x603d('0x46')](handleError(_0x5361b2,null));};exports[_0x603d('0x47')]=function(_0x231e89,_0x56081f){var _0x2feda7={'raw':![],'where':{'id':_0x231e89[_0x603d('0x48')]['id']}},_0x16c788={};_0x16c788[_0x603d('0x35')]=_[_0x603d('0x37')](db[_0x603d('0x30')][_0x603d('0x31')]);_0x16c788[_0x603d('0x36')]=_['keys'](_0x231e89['query']);_0x16c788['filters']=_['intersection'](_0x16c788['model'],_0x16c788[_0x603d('0x36')]);_0x2feda7[_0x603d('0x38')]=_[_0x603d('0x49')](_0x16c788[_0x603d('0x35')],qs[_0x603d('0x4a')](_0x231e89[_0x603d('0x36')][_0x603d('0x4a')]));_0x2feda7[_0x603d('0x38')]=_0x2feda7[_0x603d('0x38')][_0x603d('0x39')]?_0x2feda7[_0x603d('0x38')]:_0x16c788[_0x603d('0x35')];if(_0x231e89['query'][_0x603d('0x44')]){_0x2feda7['include']=[{'all':!![]}];}_0x2feda7=_[_0x603d('0x40')]({},_0x2feda7,_0x231e89[_0x603d('0x43')]);return db[_0x603d('0x30')][_0x603d('0x4b')](_0x2feda7)['then'](handleEntityNotFound(_0x56081f,null))['then'](respondWithResult(_0x56081f,null))[_0x603d('0x46')](handleError(_0x56081f,null));};exports['create']=function(_0x6c6825,_0xad666c){return db['CmList']['create'](_0x6c6825[_0x603d('0x4c')],{})[_0x603d('0x28')](function(_0x4beff7){var _0xd39670=_0x6c6825[_0x603d('0x4d')][_0x603d('0x29')]({'plain':!![]});if(!_0xd39670)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd39670['role']===_0x603d('0x4d')){var _0x1cfd90=_0x4beff7[_0x603d('0x29')]({'plain':!![]});var _0x511d88=_0x603d('0x2a');return db[_0x603d('0x4e')][_0x603d('0x4b')]({'where':{'name':_0x511d88,'userProfileId':_0xd39670[_0x603d('0x4f')]},'raw':!![]})[_0x603d('0x28')](function(_0x4b126b){if(_0x4b126b&&_0x4b126b['autoAssociation']===0x0){return db[_0x603d('0x2b')][_0x603d('0x50')]({'name':_0x1cfd90[_0x603d('0x2d')],'resourceId':_0x1cfd90['id'],'type':_0x4b126b['name'],'sectionId':_0x4b126b['id']},{})[_0x603d('0x28')](function(){return _0x4beff7;});}else{return _0x4beff7;}})['catch'](function(_0x3d0ec3){logger[_0x603d('0x2c')](_0x603d('0x51'),_0x3d0ec3);throw _0x3d0ec3;});}return _0x4beff7;})[_0x603d('0x28')](respondWithResult(_0xad666c,0xc9))['catch'](handleError(_0xad666c,null));};exports[_0x603d('0x27')]=function(_0x265bcf,_0x377c32){if(_0x265bcf['body']['id']){delete _0x265bcf['body']['id'];}return db[_0x603d('0x30')][_0x603d('0x4b')]({'where':{'id':_0x265bcf[_0x603d('0x48')]['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x377c32,null))[_0x603d('0x28')](saveUpdates(_0x265bcf['body'],null))[_0x603d('0x28')](respondWithResult(_0x377c32,null))[_0x603d('0x46')](handleError(_0x377c32,null));};exports[_0x603d('0x52')]=function(_0x467ce4,_0x49bc93){return db[_0x603d('0x30')][_0x603d('0x4b')]({'where':{'id':_0x467ce4['params']['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x49bc93,null))[_0x603d('0x28')](removeEntity(_0x49bc93,null))[_0x603d('0x46')](handleError(_0x49bc93,null));};exports[_0x603d('0x53')]=function(_0x5d45,_0x269523){return db[_0x603d('0x30')][_0x603d('0x53')]()['then'](respondWithResult(_0x269523,null))[_0x603d('0x46')](handleError(_0x269523,null));};exports[_0x603d('0x54')]=function(_0x3efe40,_0x9c7801,_0x381958){if(_0x3efe40[_0x603d('0x4c')]['id']){delete _0x3efe40[_0x603d('0x4c')]['id'];}return db[_0x603d('0x30')][_0x603d('0x4b')]({'where':{'id':_0x3efe40[_0x603d('0x48')]['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x9c7801,null))[_0x603d('0x28')](function(_0x1dfbd8){if(_0x1dfbd8){_0x3efe40[_0x603d('0x4c')][_0x603d('0x55')]=_0x1dfbd8['id'];return db[_0x603d('0x56')][_0x603d('0x50')](_0x3efe40['body']);}})[_0x603d('0x28')](respondWithResult(_0x9c7801,null))[_0x603d('0x46')](handleError(_0x9c7801,null));};exports['getDispositions']=function(_0x2a8da8,_0x9aa17a,_0x30ec3d){var _0x496402={'raw':![],'where':{}};var _0x194c93={};var _0x580b37={'count':0x0,'rows':[]};return db[_0x603d('0x30')][_0x603d('0x57')]({'where':{'id':_0x2a8da8[_0x603d('0x48')]['id']}})['then'](handleEntityNotFound(_0x9aa17a,null))[_0x603d('0x28')](function(_0x1be6b8){if(_0x1be6b8){_0x194c93['model']=_[_0x603d('0x37')](db[_0x603d('0x56')][_0x603d('0x31')]);_0x194c93['query']=_['keys'](_0x2a8da8[_0x603d('0x36')]);_0x194c93[_0x603d('0x3f')]=_[_0x603d('0x49')](_0x194c93['model'],_0x194c93[_0x603d('0x36')]);_0x496402['attributes']=_[_0x603d('0x49')](_0x194c93[_0x603d('0x35')],qs[_0x603d('0x4a')](_0x2a8da8[_0x603d('0x36')]['fields']));_0x496402[_0x603d('0x38')]=_0x496402[_0x603d('0x38')][_0x603d('0x39')]?_0x496402['attributes']:_0x194c93[_0x603d('0x35')];if(!_0x2a8da8[_0x603d('0x36')]['hasOwnProperty'](_0x603d('0x3b'))){_0x496402['limit']=qs[_0x603d('0x21')](_0x2a8da8[_0x603d('0x36')][_0x603d('0x21')]);_0x496402[_0x603d('0x1f')]=qs[_0x603d('0x1f')](_0x2a8da8[_0x603d('0x36')][_0x603d('0x1f')]);}_0x496402[_0x603d('0x3c')]=qs[_0x603d('0x3d')](_0x2a8da8[_0x603d('0x36')][_0x603d('0x3d')]);_0x496402[_0x603d('0x3e')]=qs[_0x603d('0x3f')](_['pick'](_0x2a8da8[_0x603d('0x36')],_0x194c93['filters']));_0x496402[_0x603d('0x3e')][_0x603d('0x55')]=_0x1be6b8['id'];if(_0x2a8da8[_0x603d('0x36')][_0x603d('0x42')]){_0x496402[_0x603d('0x3e')]=_[_0x603d('0x40')](_0x496402['where'],{'$or':_[_0x603d('0x2f')](_0x496402[_0x603d('0x38')],function(_0x442000){var _0x3ce5ee={};_0x3ce5ee[_0x442000]={'$like':'%'+_0x2a8da8[_0x603d('0x36')][_0x603d('0x42')]+'%'};return _0x3ce5ee;})});}_0x496402=_[_0x603d('0x40')]({},_0x496402,_0x2a8da8[_0x603d('0x43')]);return db['Disposition'][_0x603d('0x22')]({'where':_0x496402[_0x603d('0x3e')]})[_0x603d('0x28')](function(_0x402b32){_0x580b37[_0x603d('0x22')]=_0x402b32;if(_0x2a8da8[_0x603d('0x36')][_0x603d('0x44')]){_0x496402['include']=[{'all':!![]}];}return db[_0x603d('0x56')][_0x603d('0x45')](_0x496402);})['then'](function(_0x590529){_0x580b37['rows']=_0x590529;return _0x580b37;});}})[_0x603d('0x28')](respondWithFilteredResult(_0x9aa17a,_0x496402))['catch'](handleError(_0x9aa17a,null));};exports[_0x603d('0x58')]=function(_0x49b63a,_0x47db39,_0x449e37){return db[_0x603d('0x30')][_0x603d('0x4b')]({'where':{'id':_0x49b63a[_0x603d('0x48')]['id']}})['then'](handleEntityNotFound(_0x47db39,null))['then'](function(_0x4dcdb9){if(_0x4dcdb9){return _0x4dcdb9[_0x603d('0x58')](_0x49b63a[_0x603d('0x36')][_0x603d('0x59')]);}})[_0x603d('0x28')](respondWithStatusCode(_0x47db39,null))[_0x603d('0x46')](handleError(_0x47db39,null));};exports[_0x603d('0x5a')]=function(_0x49d703,_0x3d368c,_0x4b4aec){return db[_0x603d('0x30')][_0x603d('0x4b')]({'where':{'id':_0x49d703[_0x603d('0x48')]['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x3d368c,null))['then'](function(_0xd239ba){if(_0xd239ba){var _0x4fdb20=[];var _0x422fca={'success':[],'errors':[]};return db[_0x603d('0x5b')][_0x603d('0x53')]()[_0x603d('0x28')](function(_0x419aa8){if(_0x49d703['body'][_0x603d('0x5c')]&&_[_0x603d('0x5d')](_0x49d703['body'][_0x603d('0x5c')])){if(_0x49d703[_0x603d('0x4c')][_0x603d('0x5c')][_0x603d('0x39')]){_0x49d703[_0x603d('0x4c')][_0x603d('0x5c')]=_0x49d703[_0x603d('0x4c')][_0x603d('0x5c')]['join'](';')+';';}else{_0x49d703['body'][_0x603d('0x5c')]=null;}}else{_0x49d703[_0x603d('0x4c')][_0x603d('0x5c')]=null;}if(_0x49d703[_0x603d('0x4c')]&&_[_0x603d('0x5d')](_0x49d703['body'])){for(var _0x149e15=0x0;_0x149e15<_0x49d703[_0x603d('0x4c')]['length'];_0x149e15+=0x1){_0x49d703[_0x603d('0x4c')][_0x149e15]['ListId']=_0x49d703[_0x603d('0x48')]['id'];_0x4fdb20['push'](_0x49d703['body'][_0x149e15]);}return BPromise[_0x603d('0x5e')](_0x4fdb20,function(_0x3b2d9d){return db['CmContact'][_0x603d('0x50')](_[_0x603d('0x5f')](_0x3b2d9d,[_0x603d('0x59'),'id'])||{},{'fields':_[_0x603d('0x37')](_0x419aa8),'raw':!![]})['then'](function(_0x20d1f5){_0x422fca[_0x603d('0x60')][_0x603d('0x61')](_0x20d1f5[_0x603d('0x62')]);})[_0x603d('0x46')](function(_0x573599){_0x422fca[_0x603d('0x63')][_0x603d('0x61')]({'data':_0x3b2d9d,'error':_0x573599[_0x603d('0x64')]});});})['then'](function(_0x4f1f23){return _0x422fca;})[_0x603d('0x46')](function(_0x23a168){return _0x23a168;});}else{_0x3d368c[_0x603d('0x65')](0x190)[_0x603d('0x1e')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x603d('0x28')](respondWithResult(_0x3d368c,null))[_0x603d('0x46')](handleError(_0x3d368c,null));};exports[_0x603d('0x66')]=function(_0x280dd6,_0x482597,_0x44b6ff){var _0x4522c8;return db[_0x603d('0x30')][_0x603d('0x4b')]({'where':{'id':_0x280dd6[_0x603d('0x48')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x603d('0x67')}]})[_0x603d('0x28')](handleEntityNotFound(_0x482597,null))['then'](function(_0x33c18f){if(_0x33c18f){_0x4522c8=_0x33c18f;return db[_0x603d('0x5b')]['rawAttributes'];}})[_0x603d('0x28')](function(_0x41292c){if(_0x41292c){var _0x27c438={};var _0x1a028f={};_0x1a028f[_0x603d('0x35')]=_[_0x603d('0x68')](_[_0x603d('0x37')](_0x41292c),_[_0x603d('0x2f')](_0x4522c8[_0x603d('0x67')],function(_0x19bec3){return util[_0x603d('0x69')](_0x603d('0x6a'),_0x19bec3['id']);}));_0x1a028f[_0x603d('0x36')]=_[_0x603d('0x37')](_0x280dd6[_0x603d('0x36')]);_0x1a028f[_0x603d('0x3f')]=_[_0x603d('0x49')](_0x1a028f['model'],_0x1a028f[_0x603d('0x36')]);_0x27c438[_0x603d('0x38')]=_[_0x603d('0x49')](_0x1a028f[_0x603d('0x35')],qs['fields'](_0x280dd6[_0x603d('0x36')][_0x603d('0x4a')]));_0x27c438['attributes']=_0x27c438[_0x603d('0x38')]['length']?_0x27c438[_0x603d('0x38')]:_0x1a028f[_0x603d('0x35')];if(!_0x280dd6[_0x603d('0x36')]['hasOwnProperty']('nolimit')){_0x27c438[_0x603d('0x21')]=qs[_0x603d('0x21')](_0x280dd6[_0x603d('0x36')][_0x603d('0x21')]);_0x27c438[_0x603d('0x1f')]=qs[_0x603d('0x1f')](_0x280dd6['query'][_0x603d('0x1f')]);}_0x27c438[_0x603d('0x3c')]=qs[_0x603d('0x3d')](_0x280dd6[_0x603d('0x36')][_0x603d('0x3d')]);_0x27c438[_0x603d('0x3e')]=qs[_0x603d('0x3f')](_[_0x603d('0x6b')](_0x280dd6[_0x603d('0x36')],_0x1a028f[_0x603d('0x3f')]));_0x27c438[_0x603d('0x6c')]=!![];if(_0x280dd6[_0x603d('0x36')][_0x603d('0x42')]){_0x27c438[_0x603d('0x3e')]=_[_0x603d('0x40')](_0x27c438[_0x603d('0x3e')],{'$or':_['map'](_0x27c438[_0x603d('0x38')],function(_0x599b65){var _0x2571fb={};_0x2571fb[_0x599b65]={'$like':'%'+_0x280dd6[_0x603d('0x36')][_0x603d('0x42')]+'%'};return _0x2571fb;})});}_0x27c438=_['merge']({},_0x27c438,_0x280dd6[_0x603d('0x43')]);return _0x4522c8[_0x603d('0x66')](_0x27c438);}})[_0x603d('0x28')](respondWithResult(_0x482597,null))[_0x603d('0x46')](handleError(_0x482597,null));};exports['getContactsCsv']=function(_0x396e79,_0x21e049,_0xca9d53){var _0x58fdf2;var _0x1fb7de;var _0x551d12;var _0x4fac46=_0x396e79['params']['id'];csv_results=[];return db[_0x603d('0x6d')][_0x603d('0x45')]({'attributes':['id','name'],'raw':!![],'order':[_0x603d('0x6e')]})['then'](function(_0x2f1a34){_0x58fdf2=_0x2f1a34;var _0xea67d6=_[_0x603d('0x37')](db[_0x603d('0x5b')][_0x603d('0x31')]);return db[_0x603d('0x6f')][_0x603d('0x45')]({'raw':!![],'attributes':['id',_0x603d('0x70')]})['then'](function(_0x3f2306){_0x1fb7de=_0x3f2306;var _0x2ae9b6=squel[_0x603d('0x71')]()[_0x603d('0x4a')](_0xea67d6)[_0x603d('0x72')](_0x603d('0x73'),'c')[_0x603d('0x3e')](_0x603d('0x74'),_0x4fac46)[_0x603d('0x3e')](_0x603d('0x75'))[_0x603d('0x76')]();for(var _0x4483d0=0x0;_0x4483d0<_0x1fb7de['length'];_0x4483d0++){_0x2ae9b6[_0x603d('0x77')]('c.cf_'+_0x1fb7de[_0x4483d0]['id'],_0x603d('0x78')+_0x1fb7de[_0x4483d0][_0x603d('0x70')]);}for(var _0x4483d0=0x0;_0x4483d0<_0x58fdf2[_0x603d('0x39')];_0x4483d0++){_0x2ae9b6['field'](squel['select']()['field']('item')[_0x603d('0x72')]('cm_contact_has_items')[_0x603d('0x3e')]('ItemTypeId\x20=\x20?',_0x58fdf2[_0x4483d0]['id'])['where'](_0x603d('0x79')),_0x603d('0x7a')+_0x58fdf2[_0x4483d0][_0x603d('0x2d')]);_0x2ae9b6[_0x603d('0x77')](squel[_0x603d('0x71')]()['field'](_0x603d('0x7b'))[_0x603d('0x72')](_0x603d('0x7c'))[_0x603d('0x3e')](_0x603d('0x7d'),_0x58fdf2[_0x4483d0]['id'])['where'](_0x603d('0x79')),'description_additionalPhone_'+_0x58fdf2[_0x4483d0]['name']);}var _0x562dbf=[];_0x562dbf[_0x603d('0x61')](_0x2ae9b6[_0x603d('0x7e')]());BPromise['each'](_0x562dbf,handleQuery)[_0x603d('0x28')](function(_0x58e5eb){handleQuery(_0x2ae9b6[_0x603d('0x7e')]());var _0x455a6e=csv_results[0x0];if(!_[_0x603d('0x7f')](_0x455a6e)){var _0x4d305b=toCsv(_0x455a6e);var _0x21e80c=Date[_0x603d('0x80')]();fs[_0x603d('0x81')](util[_0x603d('0x69')](_0x603d('0x82'),_0x4fac46,_0x21e80c),_0x4d305b);_0x21e049['setHeader'](_0x603d('0x83'),_0x603d('0x84')+util[_0x603d('0x69')](_0x603d('0x85'),_0x4fac46,_0x21e80c));_0x21e049[_0x603d('0x86')](_0x603d('0x87'),'text/csv');return _0x21e049[_0x603d('0x88')](util['format'](_0x603d('0x82'),_0x4fac46,_0x21e80c));}else{return _0x21e049[_0x603d('0x1d')](0xcc);}});});});};exports[_0x603d('0x89')]=function(_0x1753df,_0x2ab4b8,_0x196913){var _0x1f9cab;delete _0x1753df[_0x603d('0x4c')]['id'];return db[_0x603d('0x30')][_0x603d('0x57')]({'where':{'id':_0x1753df['params']['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x2ab4b8,null))[_0x603d('0x28')](function(_0x4c4ebb){if(_0x4c4ebb){return db['sequelize'][_0x603d('0x8a')](function(_0x77ebbe){return db[_0x603d('0x6f')][_0x603d('0x50')](_0x1753df[_0x603d('0x4c')],{'transaction':_0x77ebbe})[_0x603d('0x28')](function(_0x124ab4){_0x1f9cab=_0x124ab4;return _0x4c4ebb[_0x603d('0x8b')](_0x124ab4,{'transaction':_0x77ebbe});})[_0x603d('0x28')](function(){var _0x1c9aa5={'type':db[_0x603d('0x8c')]['TEXT'],'transaction':_0x77ebbe};switch(_0x1753df['body'][_0x603d('0x33')]){case _0x603d('0x8d'):_0x1c9aa5[_0x603d('0x33')]=db['Sequelize'][_0x603d('0x8e')];break;case'number':_0x1c9aa5[_0x603d('0x33')]=db['Sequelize'][_0x603d('0x8f')];break;case _0x603d('0x90'):_0x1c9aa5['type']=db[_0x603d('0x8c')][_0x603d('0x91')];_0x1c9aa5[_0x603d('0x92')]=![];break;default:}return db[_0x603d('0x93')][_0x603d('0x94')][_0x603d('0x95')](_0x603d('0x73'),util['format'](_0x603d('0x96'),_0x1f9cab['id']),_0x1c9aa5);})[_0x603d('0x28')](function(){return _0x1f9cab;});});}})['then'](respondWithResult(_0x2ab4b8,null))[_0x603d('0x46')](handleError(_0x2ab4b8,null));};exports[_0x603d('0x97')]=function(_0x2da998,_0x7ea469,_0x184c55){var _0x346ef4={};var _0x1aa1fb={};var _0x5a84c6;var _0x16fa4c;return db['CmList'][_0x603d('0x57')]({'where':{'id':_0x2da998[_0x603d('0x48')]['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x7ea469,null))[_0x603d('0x28')](function(_0x3d3bd8){if(_0x3d3bd8){_0x5a84c6=_0x3d3bd8;_0x1aa1fb[_0x603d('0x35')]=_[_0x603d('0x37')](db[_0x603d('0x6f')][_0x603d('0x31')]);_0x1aa1fb[_0x603d('0x36')]=_[_0x603d('0x37')](_0x2da998['query']);_0x1aa1fb['filters']=_[_0x603d('0x49')](_0x1aa1fb[_0x603d('0x35')],_0x1aa1fb[_0x603d('0x36')]);_0x346ef4[_0x603d('0x38')]=_[_0x603d('0x49')](_0x1aa1fb[_0x603d('0x35')],qs['fields'](_0x2da998[_0x603d('0x36')][_0x603d('0x4a')]));_0x346ef4['attributes']=_0x346ef4[_0x603d('0x38')]['length']?_0x346ef4['attributes']:_0x1aa1fb['model'];_0x346ef4[_0x603d('0x3c')]=qs[_0x603d('0x3d')](_0x2da998[_0x603d('0x36')][_0x603d('0x3d')]);_0x346ef4[_0x603d('0x3e')]=qs[_0x603d('0x3f')](_[_0x603d('0x6b')](_0x2da998['query'],_0x1aa1fb['filters']));_0x346ef4[_0x603d('0x3e')]=_[_0x603d('0x40')](_0x346ef4[_0x603d('0x3e')],{'$or':[{'ListId':_0x3d3bd8['id']},{'ListId':null}]});if(_0x2da998['query'][_0x603d('0x42')]){_0x346ef4['where']=_[_0x603d('0x40')](_0x346ef4[_0x603d('0x3e')],{'$or':_['map'](_0x346ef4[_0x603d('0x38')],function(_0x544799){var _0x4b554a={};_0x4b554a[_0x544799]={'$like':'%'+_0x2da998[_0x603d('0x36')][_0x603d('0x42')]+'%'};return _0x4b554a;})});}_0x346ef4=_[_0x603d('0x40')]({},_0x346ef4,_0x2da998['options']);return db[_0x603d('0x6f')][_0x603d('0x98')](_0x346ef4);}})[_0x603d('0x28')](respondWithResult(_0x7ea469,null))[_0x603d('0x46')](handleError(_0x7ea469,null));};exports[_0x603d('0x99')]=function(_0x295f4c,_0x5a36ac){return db['CmCustomField']['findAndCountAll']({'where':{'ListId':null}})[_0x603d('0x28')](handleEntityNotFound(_0x5a36ac,null))['then'](function(_0x6306d2){return _0x6306d2;})[_0x603d('0x28')](respondWithResult(_0x5a36ac,null))['catch'](handleError(_0x5a36ac,null));};exports[_0x603d('0x9a')]=function(_0x2bcbe8,_0x3240bf,_0xae28db){return db['CmList'][_0x603d('0x4b')]({'where':{'id':_0x2bcbe8[_0x603d('0x48')]['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x3240bf,null))[_0x603d('0x28')](function(_0xfa2c28){if(_0xfa2c28){return _0xfa2c28[_0x603d('0x9a')](_0x2bcbe8[_0x603d('0x4c')][_0x603d('0x59')],_[_0x603d('0x5f')](_0x2bcbe8[_0x603d('0x4c')],[_0x603d('0x59'),'id'])||{})[_0x603d('0x9b')](function(_0x5ad0ec){for(var _0x1ddeee=0x0;_0x1ddeee<_0x2bcbe8['body'][_0x603d('0x59')]['length'];_0x1ddeee+=0x1){socket['emit'](_0x603d('0x9c'),{'UserId':Number(_0x2bcbe8['body']['ids'][_0x1ddeee]),'CmListId':Number(_0x2bcbe8[_0x603d('0x48')]['id'])});}return _0x5ad0ec;});}})['then'](respondWithResult(_0x3240bf,null))[_0x603d('0x46')](handleError(_0x3240bf,null));};exports[_0x603d('0x9d')]=function(_0x86f8d8,_0x31a2ff,_0x174482){return db[_0x603d('0x30')]['find']({'where':{'id':_0x86f8d8[_0x603d('0x48')]['id']}})['then'](handleEntityNotFound(_0x31a2ff,null))[_0x603d('0x28')](function(_0x457a28){if(_0x457a28){return _0x457a28[_0x603d('0x9d')](_0x86f8d8[_0x603d('0x36')][_0x603d('0x59')])[_0x603d('0x28')](function(){if(_[_0x603d('0x5d')](_0x86f8d8['query'][_0x603d('0x59')])){for(var _0x2ec0da=0x0;_0x2ec0da<_0x86f8d8[_0x603d('0x36')]['ids'][_0x603d('0x39')];_0x2ec0da+=0x1){socket['emit'](_0x603d('0x9e'),{'UserId':Number(_0x86f8d8[_0x603d('0x36')]['ids'][_0x2ec0da]),'CmListId':Number(_0x86f8d8[_0x603d('0x48')]['id'])});}}else{socket[_0x603d('0x9f')](_0x603d('0x9e'),{'UserId':Number(_0x86f8d8[_0x603d('0x36')][_0x603d('0x59')]),'CmListId':Number(_0x86f8d8[_0x603d('0x48')]['id'])});}});}})[_0x603d('0x28')](respondWithStatusCode(_0x31a2ff,null))[_0x603d('0x46')](handleError(_0x31a2ff,null));};exports[_0x603d('0xa0')]=function(_0x2b9ff2,_0x3cff22,_0x24c643){var _0x85e5c1={};var _0x2d6d49={};var _0x412d1e;var _0x431d98;return db[_0x603d('0x30')][_0x603d('0x57')]({'where':{'id':_0x2b9ff2[_0x603d('0x48')]['id']}})[_0x603d('0x28')](handleEntityNotFound(_0x3cff22,null))['then'](function(_0x205807){if(_0x205807){_0x412d1e=_0x205807;_0x2d6d49[_0x603d('0x35')]=_[_0x603d('0x37')](db[_0x603d('0xa1')][_0x603d('0x31')]);_0x2d6d49['query']=_[_0x603d('0x37')](_0x2b9ff2[_0x603d('0x36')]);_0x2d6d49[_0x603d('0x3f')]=_[_0x603d('0x49')](_0x2d6d49[_0x603d('0x35')],_0x2d6d49[_0x603d('0x36')]);_0x85e5c1['attributes']=_[_0x603d('0x49')](_0x2d6d49['model'],qs['fields'](_0x2b9ff2[_0x603d('0x36')]['fields']));_0x85e5c1[_0x603d('0x38')]=_0x85e5c1['attributes'][_0x603d('0x39')]?_0x85e5c1[_0x603d('0x38')]:_0x2d6d49[_0x603d('0x35')];_0x85e5c1[_0x603d('0x3c')]=qs[_0x603d('0x3d')](_0x2b9ff2[_0x603d('0x36')]['sort']);_0x85e5c1['where']=qs[_0x603d('0x3f')](_['pick'](_0x2b9ff2[_0x603d('0x36')],_0x2d6d49['filters']));if(_0x2b9ff2['query'][_0x603d('0x42')]){_0x85e5c1[_0x603d('0x3e')]=_[_0x603d('0x40')](_0x85e5c1[_0x603d('0x3e')],{'$or':_[_0x603d('0x2f')](_0x85e5c1[_0x603d('0x38')],function(_0x5f5077){var _0x1d4799={};_0x1d4799[_0x5f5077]={'$like':'%'+_0x2b9ff2['query'][_0x603d('0x42')]+'%'};return _0x1d4799;})});}_0x85e5c1=_['merge']({},_0x85e5c1,_0x2b9ff2['options']);return _0x412d1e['getAgents'](_0x85e5c1);}})[_0x603d('0x28')](function(_0x5b4aff){if(_0x5b4aff){_0x431d98=_0x5b4aff['length'];if(!_0x2b9ff2['query'][_0x603d('0x3a')](_0x603d('0x3b'))){_0x85e5c1[_0x603d('0x21')]=qs[_0x603d('0x21')](_0x2b9ff2[_0x603d('0x36')][_0x603d('0x21')]);_0x85e5c1[_0x603d('0x1f')]=qs['offset'](_0x2b9ff2['query'][_0x603d('0x1f')]);}return _0x412d1e[_0x603d('0xa0')](_0x85e5c1);}})[_0x603d('0x28')](function(_0x31e159){if(_0x31e159){return _0x31e159?{'count':_0x431d98,'rows':_0x31e159}:null;}})[_0x603d('0x28')](respondWithResult(_0x3cff22,null))[_0x603d('0x46')](handleError(_0x3cff22,null));};function handleQuery(_0x72250e){logger[_0x603d('0xa2')](_0x72250e);return db[_0x603d('0x93')][_0x603d('0x36')](_0x72250e)[_0x603d('0x9b')](function(_0x2e2796){csv_results[_0x603d('0x61')](_0x2e2796);})[_0x603d('0x46')](function(_0x14ce70){logger[_0x603d('0x2c')](_0x14ce70[_0x603d('0x64')]);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 9368c63..b79d9da 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x55ca,0x126));var _0xa55c=function(_0x401d67,_0xeb1592){_0x401d67=_0x401d67-0x0;var _0x25076b=_0x55ca[_0x401d67];return _0x25076b;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x1ece77,_0x1291e2){var _0x5973b3=function(_0x2d3a99){while(--_0x2d3a99){_0x1ece77['push'](_0x1ece77['shift']());}};_0x5973b3(++_0x1291e2);}(_0x814b,0x1a2));var _0xb814=function(_0x34d346,_0x4c6502){_0x34d346=_0x34d346-0x0;var _0x122d76=_0x814b[_0x34d346];return _0x122d76;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 4ca7e47..557f4c6 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 _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x323921,_0x25ecdd){var _0x54ae0d=function(_0x4da983){while(--_0x4da983){_0x323921['push'](_0x323921['shift']());}};_0x54ae0d(++_0x25ecdd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x668b=['cm_lists','lodash','util','api','moment','request-promise','rimraf','../../config/environment','./cmList.attributes','define','CmList'];(function(_0x1b1261,_0x38ea96){var _0x58a2bd=function(_0x5cfe2c){while(--_0x5cfe2c){_0x1b1261['push'](_0x1b1261['shift']());}};_0x58a2bd(++_0x38ea96);}(_0x668b,0x140));var _0xb668=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x668b[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var logger=require('../../config/logger')(_0xb668('0x2'));var moment=require(_0xb668('0x3'));var BPromise=require('bluebird');var rp=require(_0xb668('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb668('0x5'));var config=require(_0xb668('0x6'));var attributes=require(_0xb668('0x7'));module['exports']=function(_0x9b99a8,_0x296fa9){return _0x9b99a8[_0xb668('0x8')](_0xb668('0x9'),attributes,{'tableName':_0xb668('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index d9a26a5..07c79f7 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 _0x3966=['rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','then','info','request\x20sent','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','../../config/utils'];(function(_0x55a1ee,_0x2d709c){var _0x5e5170=function(_0x18e0e8){while(--_0x18e0e8){_0x55a1ee['push'](_0x55a1ee['shift']());}};_0x5e5170(++_0x2d709c);}(_0x3966,0x193));var _0x6396=function(_0x10638b,_0x2cc604){_0x10638b=_0x10638b-0x0;var _0x14c8bc=_0x3966[_0x10638b];return _0x14c8bc;};'use strict';var _=require('lodash');var util=require(_0x6396('0x0'));var moment=require(_0x6396('0x1'));var BPromise=require(_0x6396('0x2'));var rs=require(_0x6396('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6396('0x4'));var logger=require('../../config/logger')(_0x6396('0x5'));var config=require('../../config/environment');var jayson=require(_0x6396('0x6'));var client=jayson['client'][_0x6396('0x7')]({'port':0x232a});config[_0x6396('0x8')]=_[_0x6396('0x9')](config[_0x6396('0x8')],{'host':_0x6396('0xa'),'port':0x18eb});var socket=require(_0x6396('0xb'))(new Redis(config[_0x6396('0x8')]));require(_0x6396('0xc'))[_0x6396('0xd')](socket);function respondWithRpcPromise(_0x520814,_0x3114f1,_0x169059){return new BPromise(function(_0x2ac71f,_0x390ca8){return client['request'](_0x520814,_0x169059)[_0x6396('0xe')](function(_0xc0e4ef){logger[_0x6396('0xf')]('CmList,\x20%s,\x20%s',_0x3114f1,_0x6396('0x10'));logger['debug']('CmList,\x20%s,\x20%s,\x20%s',_0x3114f1,_0x6396('0x10'),JSON[_0x6396('0x11')](_0xc0e4ef));if(_0xc0e4ef['error']){if(_0xc0e4ef[_0x6396('0x12')][_0x6396('0x13')]===0x1f4){logger[_0x6396('0x12')]('CmList,\x20%s,\x20%s',_0x3114f1,_0xc0e4ef[_0x6396('0x12')]['message']);return _0x390ca8(_0xc0e4ef['error'][_0x6396('0x14')]);}logger[_0x6396('0x12')](_0x6396('0x15'),_0x3114f1,_0xc0e4ef[_0x6396('0x12')][_0x6396('0x14')]);return _0x2ac71f(_0xc0e4ef[_0x6396('0x12')]['message']);}else{logger[_0x6396('0xf')]('CmList,\x20%s,\x20%s',_0x3114f1,_0x6396('0x10'));_0x2ac71f(_0xc0e4ef[_0x6396('0x16')]['message']);}})[_0x6396('0x17')](function(_0x3f0359){logger[_0x6396('0x12')](_0x6396('0x15'),_0x3114f1,_0x3f0359);_0x390ca8(_0x3f0359);});});} \ No newline at end of file +var _0x0c5a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmList,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x24ecdd,_0x5cad30){var _0x11c5bc=function(_0x56138b){while(--_0x56138b){_0x24ecdd['push'](_0x24ecdd['shift']());}};_0x11c5bc(++_0x5cad30);}(_0x0c5a,0x19a));var _0xa0c5=function(_0x4bf5cd,_0xddf2f2){_0x4bf5cd=_0x4bf5cd-0x0;var _0x2f9e5a=_0x0c5a[_0x4bf5cd];return _0x2f9e5a;};'use strict';var _=require(_0xa0c5('0x0'));var util=require(_0xa0c5('0x1'));var moment=require(_0xa0c5('0x2'));var BPromise=require(_0xa0c5('0x3'));var rs=require(_0xa0c5('0x4'));var fs=require('fs');var Redis=require(_0xa0c5('0x5'));var db=require(_0xa0c5('0x6'))['db'];var utils=require(_0xa0c5('0x7'));var logger=require(_0xa0c5('0x8'))(_0xa0c5('0x9'));var config=require(_0xa0c5('0xa'));var jayson=require(_0xa0c5('0xb'));var client=jayson[_0xa0c5('0xc')][_0xa0c5('0xd')]({'port':0x232a});config['redis']=_[_0xa0c5('0xe')](config[_0xa0c5('0xf')],{'host':_0xa0c5('0x10'),'port':0x18eb});var socket=require(_0xa0c5('0x11'))(new Redis(config[_0xa0c5('0xf')]));require(_0xa0c5('0x12'))[_0xa0c5('0x13')](socket);function respondWithRpcPromise(_0x22820e,_0xa49304,_0x22bab1){return new BPromise(function(_0x360c27,_0x59c9e2){return client[_0xa0c5('0x14')](_0x22820e,_0x22bab1)[_0xa0c5('0x15')](function(_0x2a4073){logger[_0xa0c5('0x16')]('CmList,\x20%s,\x20%s',_0xa49304,_0xa0c5('0x17'));logger['debug'](_0xa0c5('0x18'),_0xa49304,_0xa0c5('0x17'),JSON[_0xa0c5('0x19')](_0x2a4073));if(_0x2a4073['error']){if(_0x2a4073[_0xa0c5('0x1a')][_0xa0c5('0x1b')]===0x1f4){logger[_0xa0c5('0x1a')]('CmList,\x20%s,\x20%s',_0xa49304,_0x2a4073[_0xa0c5('0x1a')][_0xa0c5('0x1c')]);return _0x59c9e2(_0x2a4073[_0xa0c5('0x1a')][_0xa0c5('0x1c')]);}logger[_0xa0c5('0x1a')](_0xa0c5('0x1d'),_0xa49304,_0x2a4073[_0xa0c5('0x1a')]['message']);return _0x360c27(_0x2a4073['error'][_0xa0c5('0x1c')]);}else{logger['info'](_0xa0c5('0x1d'),_0xa49304,_0xa0c5('0x17'));_0x360c27(_0x2a4073[_0xa0c5('0x1e')][_0xa0c5('0x1c')]);}})[_0xa0c5('0x1f')](function(_0x4fc264){logger[_0xa0c5('0x1a')](_0xa0c5('0x1d'),_0xa49304,_0x4fc264);_0x59c9e2(_0x4fc264);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 24e855a..3fca663 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 _0x336a=['emit','removeListener','length','./cmList.events','save','remove','update'];(function(_0x5ad3fa,_0xc3be5){var _0x9bcefe=function(_0x46530d){while(--_0x46530d){_0x5ad3fa['push'](_0x5ad3fa['shift']());}};_0x9bcefe(++_0xc3be5);}(_0x336a,0x88));var _0xa336=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x336a[_0x243b2f];return _0xcb3c2d;};'use strict';var CmListEvents=require(_0xa336('0x0'));var events=[_0xa336('0x1'),_0xa336('0x2'),_0xa336('0x3')];function createListener(_0xca3d4d,_0x377ed4){return function(_0x16d69f){_0x377ed4[_0xa336('0x4')](_0xca3d4d,_0x16d69f);};}function removeListener(_0x230c8a,_0x1c37e7){return function(){CmListEvents[_0xa336('0x5')](_0x230c8a,_0x1c37e7);};}exports['register']=function(_0x1f6def){for(var _0x5e1e7e=0x0,_0xb706d=events[_0xa336('0x6')];_0x5e1e7e<_0xb706d;_0x5e1e7e++){var _0x4e7b34=events[_0x5e1e7e];var _0x31b406=createListener('cmList:'+_0x4e7b34,_0x1f6def);CmListEvents['on'](_0x4e7b34,_0x31b406);}}; \ No newline at end of file +var _0xdaec=['register','length','cmList:','save','remove','update','emit'];(function(_0x1340f2,_0x56588b){var _0x1b4be5=function(_0x7183a3){while(--_0x7183a3){_0x1340f2['push'](_0x1340f2['shift']());}};_0x1b4be5(++_0x56588b);}(_0xdaec,0x1a0));var _0xcdae=function(_0x42c7ed,_0x25d73d){_0x42c7ed=_0x42c7ed-0x0;var _0x478d3b=_0xdaec[_0x42c7ed];return _0x478d3b;};'use strict';var CmListEvents=require('./cmList.events');var events=[_0xcdae('0x0'),_0xcdae('0x1'),_0xcdae('0x2')];function createListener(_0x19ff89,_0x566abe){return function(_0x3b8f20){_0x566abe[_0xcdae('0x3')](_0x19ff89,_0x3b8f20);};}function removeListener(_0x16232e,_0xf25170){return function(){CmListEvents['removeListener'](_0x16232e,_0xf25170);};}exports[_0xcdae('0x4')]=function(_0x1bc2d7){for(var _0x56eb94=0x0,_0x3b29d5=events[_0xcdae('0x5')];_0x56eb94<_0x3b29d5;_0x56eb94++){var _0x22f5ab=events[_0x56eb94];var _0x1e42b6=createListener(_0xcdae('0x6')+_0x22f5ab,_0x1bc2d7);CmListEvents['on'](_0x22f5ab,_0x1e42b6);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 93a2b4e..fe362ec 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 _0x5b26=['update','delete','destroy','removeDispositions','/:id/users','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./cmList.controller','isAuthenticated','index','/describe','describe','/global_fields','/:id','get','/:id/dispositions','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','post','create','addContacts','addAgents','put'];(function(_0x111c4b,_0x1a374a){var _0x49d934=function(_0x2d855b){while(--_0x2d855b){_0x111c4b['push'](_0x111c4b['shift']());}};_0x49d934(++_0x1a374a);}(_0x5b26,0x172));var _0x65b2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5b26[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x65b2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x65b2('0x1'));var express=require(_0x65b2('0x2'));var router=express[_0x65b2('0x3')]();var fs_extra=require(_0x65b2('0x4'));var auth=require(_0x65b2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x65b2('0x6'));router['get']('/',auth[_0x65b2('0x7')](),controller[_0x65b2('0x8')]);router['get'](_0x65b2('0x9'),auth[_0x65b2('0x7')](),controller[_0x65b2('0xa')]);router['get'](_0x65b2('0xb'),auth[_0x65b2('0x7')](),controller['getGlobalCustomFields']);router['get'](_0x65b2('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x65b2('0xd')](_0x65b2('0xe'),auth['isAuthenticated'](),controller[_0x65b2('0xf')]);router[_0x65b2('0xd')](_0x65b2('0x10'),auth[_0x65b2('0x7')](),controller['getContacts']);router[_0x65b2('0xd')](_0x65b2('0x11'),auth[_0x65b2('0x7')](),controller[_0x65b2('0x12')]);router[_0x65b2('0xd')](_0x65b2('0x13'),auth[_0x65b2('0x7')](),controller[_0x65b2('0x14')]);router[_0x65b2('0xd')]('/:id/users',auth[_0x65b2('0x7')](),controller['getAgents']);router[_0x65b2('0x15')]('/',auth[_0x65b2('0x7')](),controller[_0x65b2('0x16')]);router[_0x65b2('0x15')](_0x65b2('0xe'),auth[_0x65b2('0x7')](),controller['addDisposition']);router[_0x65b2('0x15')](_0x65b2('0x10'),auth[_0x65b2('0x7')](),controller[_0x65b2('0x17')]);router['post'](_0x65b2('0x13'),auth[_0x65b2('0x7')](),controller['addCustomField']);router['post']('/:id/users',auth[_0x65b2('0x7')](),controller[_0x65b2('0x18')]);router[_0x65b2('0x19')](_0x65b2('0xc'),auth[_0x65b2('0x7')](),controller[_0x65b2('0x1a')]);router[_0x65b2('0x1b')](_0x65b2('0xc'),auth[_0x65b2('0x7')](),controller[_0x65b2('0x1c')]);router['delete'](_0x65b2('0xe'),auth[_0x65b2('0x7')](),controller[_0x65b2('0x1d')]);router[_0x65b2('0x1b')](_0x65b2('0x1e'),auth[_0x65b2('0x7')](),controller[_0x65b2('0x1f')]);module[_0x65b2('0x20')]=router; \ No newline at end of file +var _0xe16b=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','/describe','/global_fields','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','getCustomFields','/:id/users','getAgents','create','post','addDisposition','addContacts','addCustomField','addAgents','put','delete','destroy','removeDispositions','removeAgents'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0xe16b,0x155));var _0xbe16=function(_0x52568e,_0x1698a4){_0x52568e=_0x52568e-0x0;var _0x5c64d7=_0xe16b[_0x52568e];return _0x5c64d7;};'use strict';var multer=require('multer');var util=require(_0xbe16('0x0'));var path=require(_0xbe16('0x1'));var timeout=require(_0xbe16('0x2'));var express=require(_0xbe16('0x3'));var router=express[_0xbe16('0x4')]();var fs_extra=require(_0xbe16('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbe16('0x6'));var config=require(_0xbe16('0x7'));var controller=require(_0xbe16('0x8'));router[_0xbe16('0x9')]('/',auth[_0xbe16('0xa')](),controller['index']);router[_0xbe16('0x9')](_0xbe16('0xb'),auth[_0xbe16('0xa')](),controller['describe']);router[_0xbe16('0x9')](_0xbe16('0xc'),auth[_0xbe16('0xa')](),controller['getGlobalCustomFields']);router[_0xbe16('0x9')](_0xbe16('0xd'),auth['isAuthenticated'](),controller[_0xbe16('0xe')]);router['get'](_0xbe16('0xf'),auth[_0xbe16('0xa')](),controller[_0xbe16('0x10')]);router[_0xbe16('0x9')](_0xbe16('0x11'),auth[_0xbe16('0xa')](),controller[_0xbe16('0x12')]);router['get']('/:id/contacts/csv',auth[_0xbe16('0xa')](),controller['getContactsCsv']);router[_0xbe16('0x9')]('/:id/fields',auth[_0xbe16('0xa')](),controller[_0xbe16('0x13')]);router[_0xbe16('0x9')](_0xbe16('0x14'),auth[_0xbe16('0xa')](),controller[_0xbe16('0x15')]);router['post']('/',auth[_0xbe16('0xa')](),controller[_0xbe16('0x16')]);router[_0xbe16('0x17')](_0xbe16('0xf'),auth['isAuthenticated'](),controller[_0xbe16('0x18')]);router[_0xbe16('0x17')](_0xbe16('0x11'),auth[_0xbe16('0xa')](),controller[_0xbe16('0x19')]);router[_0xbe16('0x17')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbe16('0x1a')]);router['post'](_0xbe16('0x14'),auth[_0xbe16('0xa')](),controller[_0xbe16('0x1b')]);router[_0xbe16('0x1c')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xbe16('0x1d')]('/:id',auth[_0xbe16('0xa')](),controller[_0xbe16('0x1e')]);router['delete'](_0xbe16('0xf'),auth['isAuthenticated'](),controller[_0xbe16('0x1f')]);router[_0xbe16('0x1d')](_0xbe16('0x14'),auth[_0xbe16('0xa')](),controller[_0xbe16('0x20')]);module[_0xbe16('0x21')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 9911a27..d95f88b 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 _0xcf29=['VIRTUAL','getDataValue','field','STRING','sequelize'];(function(_0xb1e609,_0x11761c){var _0x1f37f1=function(_0x5862ae){while(--_0x5862ae){_0xb1e609['push'](_0xb1e609['shift']());}};_0x1f37f1(++_0x11761c);}(_0xcf29,0x86));var _0x9cf2=function(_0x409fb8,_0x5ab3d3){_0x409fb8=_0x409fb8-0x0;var _0x278270=_0xcf29[_0x409fb8];return _0x278270;};'use strict';var Sequelize=require(_0x9cf2('0x0'));module['exports']={'name':{'type':Sequelize[_0x9cf2('0x1')],'get':function(_0x5d6f29){return this[_0x9cf2('0x2')](_0x9cf2('0x3'));}},'field':{'type':Sequelize[_0x9cf2('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x9cf2('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x9cf2('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x7ebc=['exports','VIRTUAL','field','STRING','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x7ebc,0xf4));var _0xc7eb=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0x7ebc[_0x30bd4d];return _0x306915;};'use strict';var Sequelize=require(_0xc7eb('0x0'));module[_0xc7eb('0x1')]={'name':{'type':Sequelize[_0xc7eb('0x2')],'get':function(_0x36b859){return this['getDataValue'](_0xc7eb('0x3'));}},'field':{'type':Sequelize[_0xc7eb('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xc7eb('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xc7eb('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 9c473b3..2043eb8 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(_0x1ad352,_0x3f72ca){var _0x415e85=function(_0xd48ea1){while(--_0xd48ea1){_0x1ad352['push'](_0x1ad352['shift']());}};_0x415e85(++_0x3f72ca);}(_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){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(_0x1d4233,_0x5d1db4){var _0x9f1176=function(_0x34375d){while(--_0x34375d){_0x1d4233['push'](_0x1d4233['shift']());}};_0x9f1176(++_0x5d1db4);}(_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){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 89753c6..eaa18ba 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 _0x220c=['./condition.attributes','exports','define','Condition','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment'];(function(_0x3454c2,_0x577103){var _0x18f140=function(_0x3408d7){while(--_0x3408d7){_0x3454c2['push'](_0x3454c2['shift']());}};_0x18f140(++_0x577103);}(_0x220c,0xeb));var _0xc220=function(_0x2ce029,_0x381364){_0x2ce029=_0x2ce029-0x0;var _0x2b8407=_0x220c[_0x2ce029];return _0x2b8407;};'use strict';var _=require(_0xc220('0x0'));var util=require(_0xc220('0x1'));var logger=require(_0xc220('0x2'))(_0xc220('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc220('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc220('0x5'));var config=require(_0xc220('0x6'));var attributes=require(_0xc220('0x7'));module[_0xc220('0x8')]=function(_0x2630fb,_0x4b560c){return _0x2630fb[_0xc220('0x9')](_0xc220('0xa'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf93e=['bluebird','request-promise','path','rimraf','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment'];(function(_0x34aec4,_0x3801da){var _0x51e1a7=function(_0x24e87f){while(--_0x24e87f){_0x34aec4['push'](_0x34aec4['shift']());}};_0x51e1a7(++_0x3801da);}(_0xf93e,0x133));var _0xef93=function(_0x363435,_0x5d27b2){_0x363435=_0x363435-0x0;var _0x3e4e89=_0xf93e[_0x363435];return _0x3e4e89;};'use strict';var _=require(_0xef93('0x0'));var util=require(_0xef93('0x1'));var logger=require(_0xef93('0x2'))(_0xef93('0x3'));var moment=require(_0xef93('0x4'));var BPromise=require(_0xef93('0x5'));var rp=require(_0xef93('0x6'));var fs=require('fs');var path=require(_0xef93('0x7'));var rimraf=require(_0xef93('0x8'));var config=require('../../config/environment');var attributes=require('./condition.attributes');module[_0xef93('0x9')]=function(_0x35472b,_0xe8c3c2){return _0x35472b[_0xef93('0xa')]('Condition',attributes,{'tableName':_0xef93('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 5af9ea3..5a010dd 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 _0x50b9=['info','Condition,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0x50b9,0x9c));var _0x950b=function(_0xb179b5,_0x3601bf){_0xb179b5=_0xb179b5-0x0;var _0x4088a7=_0x50b9[_0xb179b5];return _0x4088a7;};'use strict';var _=require('lodash');var util=require(_0x950b('0x0'));var moment=require(_0x950b('0x1'));var BPromise=require(_0x950b('0x2'));var rs=require(_0x950b('0x3'));var fs=require('fs');var Redis=require(_0x950b('0x4'));var db=require(_0x950b('0x5'))['db'];var utils=require(_0x950b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x950b('0x7'));var jayson=require(_0x950b('0x8'));var client=jayson[_0x950b('0x9')][_0x950b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b7b5c,_0x56613d,_0x3c8f83){return new BPromise(function(_0xac496d,_0x4982d4){return client[_0x950b('0xb')](_0x2b7b5c,_0x3c8f83)['then'](function(_0x211db8){logger[_0x950b('0xc')](_0x950b('0xd'),_0x56613d,'request\x20sent');logger[_0x950b('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x56613d,_0x950b('0xf'),JSON[_0x950b('0x10')](_0x211db8));if(_0x211db8[_0x950b('0x11')]){if(_0x211db8[_0x950b('0x11')][_0x950b('0x12')]===0x1f4){logger['error'](_0x950b('0xd'),_0x56613d,_0x211db8[_0x950b('0x11')][_0x950b('0x13')]);return _0x4982d4(_0x211db8[_0x950b('0x11')][_0x950b('0x13')]);}logger[_0x950b('0x11')]('Condition,\x20%s,\x20%s',_0x56613d,_0x211db8[_0x950b('0x11')][_0x950b('0x13')]);return _0xac496d(_0x211db8[_0x950b('0x11')]['message']);}else{logger['info'](_0x950b('0xd'),_0x56613d,'request\x20sent');_0xac496d(_0x211db8['result'][_0x950b('0x13')]);}})[_0x950b('0x14')](function(_0x193fce){logger['error']('Condition,\x20%s,\x20%s',_0x56613d,_0x193fce);_0x4982d4(_0x193fce);});});} \ No newline at end of file +var _0x4168=['rpc','../../config/environment','jayson/promise','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x527230,_0xdc83e8){var _0x2f6870=function(_0x30126b){while(--_0x30126b){_0x527230['push'](_0x527230['shift']());}};_0x2f6870(++_0xdc83e8);}(_0x4168,0x185));var _0x8416=function(_0xdeda17,_0x3ef130){_0xdeda17=_0xdeda17-0x0;var _0x1531dc=_0x4168[_0xdeda17];return _0x1531dc;};'use strict';var _=require(_0x8416('0x0'));var util=require(_0x8416('0x1'));var moment=require(_0x8416('0x2'));var BPromise=require(_0x8416('0x3'));var rs=require(_0x8416('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8416('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8416('0x6'))(_0x8416('0x7'));var config=require(_0x8416('0x8'));var jayson=require(_0x8416('0x9'));var client=jayson[_0x8416('0xa')][_0x8416('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x158423,_0x439ad4,_0x434ff0){return new BPromise(function(_0x5dbd87,_0x3ff5a6){return client[_0x8416('0xc')](_0x158423,_0x434ff0)['then'](function(_0x57eb36){logger[_0x8416('0xd')](_0x8416('0xe'),_0x439ad4,_0x8416('0xf'));logger[_0x8416('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x439ad4,'request\x20sent',JSON[_0x8416('0x11')](_0x57eb36));if(_0x57eb36['error']){if(_0x57eb36[_0x8416('0x12')]['code']===0x1f4){logger[_0x8416('0x12')](_0x8416('0xe'),_0x439ad4,_0x57eb36[_0x8416('0x12')][_0x8416('0x13')]);return _0x3ff5a6(_0x57eb36[_0x8416('0x12')][_0x8416('0x13')]);}logger[_0x8416('0x12')](_0x8416('0xe'),_0x439ad4,_0x57eb36[_0x8416('0x12')][_0x8416('0x13')]);return _0x5dbd87(_0x57eb36['error']['message']);}else{logger[_0x8416('0xd')](_0x8416('0xe'),_0x439ad4,_0x8416('0xf'));_0x5dbd87(_0x57eb36[_0x8416('0x14')][_0x8416('0x13')]);}})[_0x8416('0x15')](function(_0x4e1a42){logger[_0x8416('0x12')](_0x8416('0xe'),_0x439ad4,_0x4e1a42);_0x3ff5a6(_0x4e1a42);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index e9b4708..c88f705 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 _0xa078=['./condition.controller','/:id','isAuthenticated','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x454db3,_0xcd150e){var _0x3b36da=function(_0xcbf82c){while(--_0xcbf82c){_0x454db3['push'](_0x454db3['shift']());}};_0x3b36da(++_0xcd150e);}(_0xa078,0x19e));var _0x8a07=function(_0x568db7,_0x305fcf){_0x568db7=_0x568db7-0x0;var _0x458f68=_0xa078[_0x568db7];return _0x458f68;};'use strict';var multer=require(_0x8a07('0x0'));var util=require(_0x8a07('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8a07('0x2'));var router=express['Router']();var fs_extra=require(_0x8a07('0x3'));var auth=require(_0x8a07('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8a07('0x5'));var controller=require(_0x8a07('0x6'));router['put'](_0x8a07('0x7'),auth[_0x8a07('0x8')](),controller[_0x8a07('0x9')]);router['delete'](_0x8a07('0x7'),auth[_0x8a07('0x8')](),controller[_0x8a07('0xa')]);module[_0x8a07('0xb')]=router; \ No newline at end of file +var _0x8681=['delete','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0xa720af,_0x28b50f){var _0x32c277=function(_0x4ddf96){while(--_0x4ddf96){_0xa720af['push'](_0xa720af['shift']());}};_0x32c277(++_0x28b50f);}(_0x8681,0x144));var _0x1868=function(_0x1d9163,_0x79567d){_0x1d9163=_0x1d9163-0x0;var _0xb42197=_0x8681[_0x1d9163];return _0xb42197;};'use strict';var multer=require(_0x1868('0x0'));var util=require(_0x1868('0x1'));var path=require(_0x1868('0x2'));var timeout=require(_0x1868('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x1868('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1868('0x5'));var config=require(_0x1868('0x6'));var controller=require(_0x1868('0x7'));router[_0x1868('0x8')](_0x1868('0x9'),auth[_0x1868('0xa')](),controller[_0x1868('0xb')]);router[_0x1868('0xc')]('/:id',auth[_0x1868('0xa')](),controller[_0x1868('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index c02e011..3034be3 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2c2=['exports','STRING','INTEGER'];(function(_0x2a8865,_0x17b5bc){var _0x128813=function(_0xffde1a){while(--_0xffde1a){_0x2a8865['push'](_0x2a8865['shift']());}};_0x128813(++_0x17b5bc);}(_0xd2c2,0x1ce));var _0x2d2c=function(_0x42485d,_0x1a137d){_0x42485d=_0x42485d-0x0;var _0x33a37e=_0xd2c2[_0x42485d];return _0x33a37e;};'use strict';var Sequelize=require('sequelize');module[_0x2d2c('0x0')]={'name':{'type':Sequelize[_0x2d2c('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x2d2c('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x23ca=['INTEGER','sequelize','STRING'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x23ca,0x130));var _0xa23c=function(_0x2ab5fa,_0x2d9aed){_0x2ab5fa=_0x2ab5fa-0x0;var _0x43d5e4=_0x23ca[_0x2ab5fa];return _0x43d5e4;};'use strict';var Sequelize=require(_0xa23c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa23c('0x1')],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0xa23c('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xa23c('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 241d1ee..e85103b 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2da6=['keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','findAll','show','params','includeAll','include','options','catch','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ContactItemTypes','destroy','sendStatus','error','stack','name','send','index','map','ContactItemType','rawAttributes','fieldName','type','model'];(function(_0x5d30b4,_0x199248){var _0x1acfb8=function(_0x3544b2){while(--_0x3544b2){_0x5d30b4['push'](_0x5d30b4['shift']());}};_0x1acfb8(++_0x199248);}(_0x2da6,0x1dd));var _0x62da=function(_0x1ea342,_0x2471bb){_0x1ea342=_0x1ea342-0x0;var _0x2ec909=_0x2da6[_0x1ea342];return _0x2ec909;};'use strict';var emlformat=require(_0x62da('0x0'));var rimraf=require(_0x62da('0x1'));var zipdir=require(_0x62da('0x2'));var jsonpatch=require(_0x62da('0x3'));var rp=require(_0x62da('0x4'));var moment=require(_0x62da('0x5'));var BPromise=require(_0x62da('0x6'));var Mustache=require(_0x62da('0x7'));var util=require('util');var path=require('path');var sox=require(_0x62da('0x8'));var csv=require(_0x62da('0x9'));var ejs=require(_0x62da('0xa'));var fs=require('fs');var fs_extra=require(_0x62da('0xb'));var _=require(_0x62da('0xc'));var squel=require(_0x62da('0xd'));var crypto=require(_0x62da('0xe'));var jsforce=require(_0x62da('0xf'));var deskjs=require(_0x62da('0x10'));var toCsv=require('to-csv');var querystring=require(_0x62da('0x11'));var Papa=require(_0x62da('0x12'));var Redis=require(_0x62da('0x13'));var authService=require(_0x62da('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x62da('0x15'));var hardwareService=require(_0x62da('0x16'));var logger=require(_0x62da('0x17'))(_0x62da('0x18'));var utils=require(_0x62da('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x62da('0x1a'));var db=require(_0x62da('0x1b'))['db'];function respondWithStatusCode(_0xd27693,_0x362eeb){_0x362eeb=_0x362eeb||0xcc;return function(_0x37ba2e){if(_0x37ba2e){return _0xd27693['sendStatus'](_0x362eeb);}return _0xd27693['status'](_0x362eeb)[_0x62da('0x1c')]();};}function respondWithResult(_0x27a000,_0x1bd7f9){_0x1bd7f9=_0x1bd7f9||0xc8;return function(_0x191ed5){if(_0x191ed5){return _0x27a000[_0x62da('0x1d')](_0x1bd7f9)[_0x62da('0x1e')](_0x191ed5);}};}function respondWithFilteredResult(_0x3c6498,_0x624a1c){return function(_0x2cbdf6){if(_0x2cbdf6){var _0xcc1a25=typeof _0x624a1c[_0x62da('0x1f')]===_0x62da('0x20')&&typeof _0x624a1c[_0x62da('0x21')]===_0x62da('0x20');var _0x4bdab9=_0x2cbdf6['count'];var _0xa7050b=_0xcc1a25?0x0:_0x624a1c['offset'];var _0x4d6482=_0xcc1a25?_0x2cbdf6[_0x62da('0x22')]:_0x624a1c[_0x62da('0x1f')]+_0x624a1c['limit'];var _0x29191b;if(_0x4d6482>=_0x4bdab9){_0x4d6482=_0x4bdab9;_0x29191b=0xc8;}else{_0x29191b=0xce;}_0x3c6498['status'](_0x29191b);return _0x3c6498[_0x62da('0x23')](_0x62da('0x24'),_0xa7050b+'-'+_0x4d6482+'/'+_0x4bdab9)[_0x62da('0x1e')](_0x2cbdf6);}return null;};}function patchUpdates(_0x2f7b01){return function(_0x3d015f){try{jsonpatch[_0x62da('0x25')](_0x3d015f,_0x2f7b01,!![]);}catch(_0x183033){return BPromise[_0x62da('0x26')](_0x183033);}return _0x3d015f[_0x62da('0x27')]();};}function saveUpdates(_0x583fc0,_0x13bf6d){return function(_0x866a76){if(_0x866a76){return _0x866a76[_0x62da('0x28')](_0x583fc0)[_0x62da('0x29')](function(_0x35f687){return _0x35f687;});}return null;};}function removeEntity(_0x54b936,_0x24298a){return function(_0x50ed6b){if(_0x50ed6b){return _0x50ed6b['destroy']()['then'](function(){var _0x292535=_0x50ed6b[_0x62da('0x2a')]({'plain':!![]});var _0x14897c=_0x62da('0x2b');return db['UserProfileResource'][_0x62da('0x2c')]({'where':{'type':_0x14897c,'resourceId':_0x292535['id']}})[_0x62da('0x29')](function(){return _0x50ed6b;});})['then'](function(){_0x54b936[_0x62da('0x1d')](0xcc)[_0x62da('0x1c')]();});}};}function handleEntityNotFound(_0x1775ea,_0x5b7d26){return function(_0x41de3a){if(!_0x41de3a){_0x1775ea[_0x62da('0x2d')](0x194);}return _0x41de3a;};}function handleError(_0x438aa5,_0x54da45){_0x54da45=_0x54da45||0x1f4;return function(_0x4f5657){logger[_0x62da('0x2e')](_0x4f5657[_0x62da('0x2f')]);if(_0x4f5657[_0x62da('0x30')]){delete _0x4f5657['name'];}_0x438aa5[_0x62da('0x1d')](_0x54da45)[_0x62da('0x31')](_0x4f5657);};}exports[_0x62da('0x32')]=function(_0x1f841c,_0xd8cf3b){var _0x1cf765={},_0x592c6c={},_0xbe398f={'count':0x0,'rows':[]};var _0x4f71bc=_[_0x62da('0x33')](db[_0x62da('0x34')][_0x62da('0x35')],function(_0x336a5c){return{'name':_0x336a5c[_0x62da('0x36')],'type':_0x336a5c[_0x62da('0x37')]['key']};});_0x592c6c[_0x62da('0x38')]=_[_0x62da('0x33')](_0x4f71bc,_0x62da('0x30'));_0x592c6c['query']=_[_0x62da('0x39')](_0x1f841c[_0x62da('0x3a')]);_0x592c6c[_0x62da('0x3b')]=_['intersection'](_0x592c6c[_0x62da('0x38')],_0x592c6c[_0x62da('0x3a')]);_0x1cf765['attributes']=_[_0x62da('0x3c')](_0x592c6c[_0x62da('0x38')],qs['fields'](_0x1f841c[_0x62da('0x3a')][_0x62da('0x3d')]));_0x1cf765[_0x62da('0x3e')]=_0x1cf765[_0x62da('0x3e')][_0x62da('0x3f')]?_0x1cf765[_0x62da('0x3e')]:_0x592c6c[_0x62da('0x38')];if(!_0x1f841c[_0x62da('0x3a')][_0x62da('0x40')](_0x62da('0x41'))){_0x1cf765[_0x62da('0x21')]=qs[_0x62da('0x21')](_0x1f841c[_0x62da('0x3a')][_0x62da('0x21')]);_0x1cf765[_0x62da('0x1f')]=qs[_0x62da('0x1f')](_0x1f841c[_0x62da('0x3a')]['offset']);}_0x1cf765[_0x62da('0x42')]=qs['sort'](_0x1f841c[_0x62da('0x3a')][_0x62da('0x43')]);_0x1cf765[_0x62da('0x44')]=qs['filters'](_[_0x62da('0x45')](_0x1f841c[_0x62da('0x3a')],_0x592c6c[_0x62da('0x3b')]),_0x4f71bc);if(_0x1f841c[_0x62da('0x3a')]['filter']){_0x1cf765[_0x62da('0x44')]=_[_0x62da('0x46')](_0x1cf765[_0x62da('0x44')],{'$or':_[_0x62da('0x33')](_0x4f71bc,function(_0x160ac5){if(_0x160ac5[_0x62da('0x37')]!==_0x62da('0x47')){var _0x13b53f={};_0x13b53f[_0x160ac5[_0x62da('0x30')]]={'$like':'%'+_0x1f841c['query'][_0x62da('0x48')]+'%'};return _0x13b53f;}})});}_0x1cf765=_[_0x62da('0x46')]({},_0x1cf765,_0x1f841c['options']);var _0x2eef19={'where':_0x1cf765[_0x62da('0x44')]};return db[_0x62da('0x34')][_0x62da('0x22')](_0x2eef19)[_0x62da('0x29')](function(_0xde827d){_0xbe398f[_0x62da('0x22')]=_0xde827d;if(_0x1f841c[_0x62da('0x3a')]['includeAll']){_0x1cf765['include']=[{'all':!![]}];}return db['ContactItemType'][_0x62da('0x49')](_0x1cf765);})['then'](function(_0x86f5a8){_0xbe398f['rows']=_0x86f5a8;return _0xbe398f;})['then'](respondWithFilteredResult(_0xd8cf3b,_0x1cf765))['catch'](handleError(_0xd8cf3b,null));};exports[_0x62da('0x4a')]=function(_0x303563,_0x554d5f){var _0x2d4e0c={'raw':!![],'where':{'id':_0x303563[_0x62da('0x4b')]['id']}},_0x4fe444={};_0x4fe444['model']=_['keys'](db[_0x62da('0x34')][_0x62da('0x35')]);_0x4fe444[_0x62da('0x3a')]=_['keys'](_0x303563[_0x62da('0x3a')]);_0x4fe444[_0x62da('0x3b')]=_[_0x62da('0x3c')](_0x4fe444[_0x62da('0x38')],_0x4fe444[_0x62da('0x3a')]);_0x2d4e0c['attributes']=_['intersection'](_0x4fe444[_0x62da('0x38')],qs[_0x62da('0x3d')](_0x303563[_0x62da('0x3a')][_0x62da('0x3d')]));_0x2d4e0c[_0x62da('0x3e')]=_0x2d4e0c['attributes']['length']?_0x2d4e0c[_0x62da('0x3e')]:_0x4fe444[_0x62da('0x38')];if(_0x303563['query'][_0x62da('0x4c')]){_0x2d4e0c[_0x62da('0x4d')]=[{'all':!![]}];}_0x2d4e0c=_[_0x62da('0x46')]({},_0x2d4e0c,_0x303563[_0x62da('0x4e')]);return db[_0x62da('0x34')]['find'](_0x2d4e0c)[_0x62da('0x29')](handleEntityNotFound(_0x554d5f,null))[_0x62da('0x29')](respondWithResult(_0x554d5f,null))[_0x62da('0x4f')](handleError(_0x554d5f,null));};exports[_0x62da('0x50')]=function(_0x4d3ec0,_0x1f2ab5){return db[_0x62da('0x34')][_0x62da('0x50')](_0x4d3ec0[_0x62da('0x51')],{})['then'](function(_0x3571b2){var _0x169560=_0x4d3ec0['user']['get']({'plain':!![]});if(!_0x169560)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x169560[_0x62da('0x52')]===_0x62da('0x53')){var _0x33fbfc=_0x3571b2['get']({'plain':!![]});var _0x39a15d=_0x62da('0x2b');return db[_0x62da('0x54')]['find']({'where':{'name':_0x39a15d,'userProfileId':_0x169560[_0x62da('0x55')]},'raw':!![]})[_0x62da('0x29')](function(_0x227d40){if(_0x227d40&&_0x227d40[_0x62da('0x56')]===0x0){return db['UserProfileResource'][_0x62da('0x50')]({'name':_0x33fbfc[_0x62da('0x30')],'resourceId':_0x33fbfc['id'],'type':_0x227d40[_0x62da('0x30')],'sectionId':_0x227d40['id']},{})[_0x62da('0x29')](function(){return _0x3571b2;});}else{return _0x3571b2;}})[_0x62da('0x4f')](function(_0x247d2f){logger[_0x62da('0x2e')](_0x62da('0x57'),_0x247d2f);throw _0x247d2f;});}return _0x3571b2;})[_0x62da('0x29')](respondWithResult(_0x1f2ab5,0xc9))['catch'](handleError(_0x1f2ab5,null));};exports['update']=function(_0x17e629,_0x5eb746){if(_0x17e629['body']['id']){delete _0x17e629['body']['id'];}return db[_0x62da('0x34')][_0x62da('0x58')]({'where':{'id':_0x17e629[_0x62da('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5eb746,null))[_0x62da('0x29')](saveUpdates(_0x17e629[_0x62da('0x51')],null))[_0x62da('0x29')](respondWithResult(_0x5eb746,null))[_0x62da('0x4f')](handleError(_0x5eb746,null));};exports['destroy']=function(_0x1cb3b2,_0x30e05c){return db[_0x62da('0x34')]['find']({'where':{'id':_0x1cb3b2[_0x62da('0x4b')]['id']}})['then'](handleEntityNotFound(_0x30e05c,null))[_0x62da('0x29')](db['CmContactHasItem'][_0x62da('0x28')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x1cb3b2[_0x62da('0x4b')]['id']}}))[_0x62da('0x29')](removeEntity(_0x30e05c,null))[_0x62da('0x4f')](handleError(_0x30e05c,null));}; \ No newline at end of file +var _0xd7d1=['autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','get','end','error','stack','name','index','map','ContactItemType','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','params','include','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ContactItemTypes','UserProfileSection','userProfileId'];(function(_0x1d8c4b,_0x1e4ed4){var _0x3e2819=function(_0x496603){while(--_0x496603){_0x1d8c4b['push'](_0x1d8c4b['shift']());}};_0x3e2819(++_0x1e4ed4);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x1f6762,_0x36679c){_0x1f6762=_0x1f6762-0x0;var _0x3b41f4=_0xd7d1[_0x1f6762];return _0x3b41f4;};'use strict';var emlformat=require(_0x1d7d('0x0'));var rimraf=require(_0x1d7d('0x1'));var zipdir=require(_0x1d7d('0x2'));var jsonpatch=require(_0x1d7d('0x3'));var rp=require(_0x1d7d('0x4'));var moment=require(_0x1d7d('0x5'));var BPromise=require(_0x1d7d('0x6'));var Mustache=require(_0x1d7d('0x7'));var util=require(_0x1d7d('0x8'));var path=require(_0x1d7d('0x9'));var sox=require(_0x1d7d('0xa'));var csv=require(_0x1d7d('0xb'));var ejs=require(_0x1d7d('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xb'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var licenseUtil=require(_0x1d7d('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11b83f,_0x5ae1c9){_0x5ae1c9=_0x5ae1c9||0xcc;return function(_0x577e07){if(_0x577e07){return _0x11b83f[_0x1d7d('0x1c')](_0x5ae1c9);}return _0x11b83f[_0x1d7d('0x1d')](_0x5ae1c9)['end']();};}function respondWithResult(_0x55dba7,_0x1d3822){_0x1d3822=_0x1d3822||0xc8;return function(_0x334e78){if(_0x334e78){return _0x55dba7[_0x1d7d('0x1d')](_0x1d3822)[_0x1d7d('0x1e')](_0x334e78);}};}function respondWithFilteredResult(_0xeb05b3,_0x53423f){return function(_0x28adf3){if(_0x28adf3){var _0x1de6cc=typeof _0x53423f['offset']===_0x1d7d('0x1f')&&typeof _0x53423f[_0x1d7d('0x20')]===_0x1d7d('0x1f');var _0x47826a=_0x28adf3[_0x1d7d('0x21')];var _0x4db4f2=_0x1de6cc?0x0:_0x53423f[_0x1d7d('0x22')];var _0x191024=_0x1de6cc?_0x28adf3['count']:_0x53423f['offset']+_0x53423f[_0x1d7d('0x20')];var _0x1a5101;if(_0x191024>=_0x47826a){_0x191024=_0x47826a;_0x1a5101=0xc8;}else{_0x1a5101=0xce;}_0xeb05b3[_0x1d7d('0x1d')](_0x1a5101);return _0xeb05b3[_0x1d7d('0x23')](_0x1d7d('0x24'),_0x4db4f2+'-'+_0x191024+'/'+_0x47826a)[_0x1d7d('0x1e')](_0x28adf3);}return null;};}function patchUpdates(_0x54d401){return function(_0x225f85){try{jsonpatch[_0x1d7d('0x25')](_0x225f85,_0x54d401,!![]);}catch(_0x3a93d0){return BPromise['reject'](_0x3a93d0);}return _0x225f85[_0x1d7d('0x26')]();};}function saveUpdates(_0x12c54b,_0x4a1cdc){return function(_0x5950bd){if(_0x5950bd){return _0x5950bd[_0x1d7d('0x27')](_0x12c54b)[_0x1d7d('0x28')](function(_0x3d631f){return _0x3d631f;});}return null;};}function removeEntity(_0x5097b8,_0x377653){return function(_0x106376){if(_0x106376){return _0x106376[_0x1d7d('0x29')]()[_0x1d7d('0x28')](function(){var _0x4fa346=_0x106376[_0x1d7d('0x2a')]({'plain':!![]});var _0x151198='ContactItemTypes';return db['UserProfileResource'][_0x1d7d('0x29')]({'where':{'type':_0x151198,'resourceId':_0x4fa346['id']}})['then'](function(){return _0x106376;});})[_0x1d7d('0x28')](function(){_0x5097b8[_0x1d7d('0x1d')](0xcc)[_0x1d7d('0x2b')]();});}};}function handleEntityNotFound(_0x22c40d,_0x465938){return function(_0x59f827){if(!_0x59f827){_0x22c40d[_0x1d7d('0x1c')](0x194);}return _0x59f827;};}function handleError(_0x98c1ad,_0x352d5a){_0x352d5a=_0x352d5a||0x1f4;return function(_0x58672c){logger[_0x1d7d('0x2c')](_0x58672c[_0x1d7d('0x2d')]);if(_0x58672c[_0x1d7d('0x2e')]){delete _0x58672c['name'];}_0x98c1ad['status'](_0x352d5a)['send'](_0x58672c);};}exports[_0x1d7d('0x2f')]=function(_0x329f56,_0x559f19){var _0x1ebcbc={},_0x3e4136={},_0x16a81d={'count':0x0,'rows':[]};var _0x3336ab=_[_0x1d7d('0x30')](db[_0x1d7d('0x31')][_0x1d7d('0x32')],function(_0x803dc9){return{'name':_0x803dc9[_0x1d7d('0x33')],'type':_0x803dc9[_0x1d7d('0x34')]['key']};});_0x3e4136['model']=_[_0x1d7d('0x30')](_0x3336ab,_0x1d7d('0x2e'));_0x3e4136[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x329f56[_0x1d7d('0x35')]);_0x3e4136[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x3e4136[_0x1d7d('0x39')],_0x3e4136[_0x1d7d('0x35')]);_0x1ebcbc['attributes']=_[_0x1d7d('0x38')](_0x3e4136[_0x1d7d('0x39')],qs[_0x1d7d('0x3a')](_0x329f56[_0x1d7d('0x35')]['fields']));_0x1ebcbc['attributes']=_0x1ebcbc[_0x1d7d('0x3b')][_0x1d7d('0x3c')]?_0x1ebcbc['attributes']:_0x3e4136[_0x1d7d('0x39')];if(!_0x329f56[_0x1d7d('0x35')]['hasOwnProperty']('nolimit')){_0x1ebcbc[_0x1d7d('0x20')]=qs[_0x1d7d('0x20')](_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x20')]);_0x1ebcbc[_0x1d7d('0x22')]=qs[_0x1d7d('0x22')](_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x22')]);}_0x1ebcbc[_0x1d7d('0x3d')]=qs[_0x1d7d('0x3e')](_0x329f56['query']['sort']);_0x1ebcbc['where']=qs['filters'](_[_0x1d7d('0x3f')](_0x329f56['query'],_0x3e4136[_0x1d7d('0x37')]),_0x3336ab);if(_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x40')]){_0x1ebcbc['where']=_[_0x1d7d('0x41')](_0x1ebcbc[_0x1d7d('0x42')],{'$or':_[_0x1d7d('0x30')](_0x3336ab,function(_0x5b7e01){if(_0x5b7e01[_0x1d7d('0x34')]!==_0x1d7d('0x43')){var _0xfb9845={};_0xfb9845[_0x5b7e01[_0x1d7d('0x2e')]]={'$like':'%'+_0x329f56['query'][_0x1d7d('0x40')]+'%'};return _0xfb9845;}})});}_0x1ebcbc=_[_0x1d7d('0x41')]({},_0x1ebcbc,_0x329f56[_0x1d7d('0x44')]);var _0x456d51={'where':_0x1ebcbc['where']};return db[_0x1d7d('0x31')]['count'](_0x456d51)[_0x1d7d('0x28')](function(_0x31b850){_0x16a81d[_0x1d7d('0x21')]=_0x31b850;if(_0x329f56[_0x1d7d('0x35')][_0x1d7d('0x45')]){_0x1ebcbc['include']=[{'all':!![]}];}return db['ContactItemType'][_0x1d7d('0x46')](_0x1ebcbc);})[_0x1d7d('0x28')](function(_0x1637fc){_0x16a81d['rows']=_0x1637fc;return _0x16a81d;})['then'](respondWithFilteredResult(_0x559f19,_0x1ebcbc))[_0x1d7d('0x47')](handleError(_0x559f19,null));};exports['show']=function(_0x86e7bc,_0x379e75){var _0x1d1064={'raw':!![],'where':{'id':_0x86e7bc[_0x1d7d('0x48')]['id']}},_0x21394c={};_0x21394c[_0x1d7d('0x39')]=_[_0x1d7d('0x36')](db['ContactItemType'][_0x1d7d('0x32')]);_0x21394c[_0x1d7d('0x35')]=_['keys'](_0x86e7bc[_0x1d7d('0x35')]);_0x21394c[_0x1d7d('0x37')]=_[_0x1d7d('0x38')](_0x21394c[_0x1d7d('0x39')],_0x21394c[_0x1d7d('0x35')]);_0x1d1064[_0x1d7d('0x3b')]=_[_0x1d7d('0x38')](_0x21394c[_0x1d7d('0x39')],qs[_0x1d7d('0x3a')](_0x86e7bc[_0x1d7d('0x35')][_0x1d7d('0x3a')]));_0x1d1064[_0x1d7d('0x3b')]=_0x1d1064['attributes'][_0x1d7d('0x3c')]?_0x1d1064['attributes']:_0x21394c[_0x1d7d('0x39')];if(_0x86e7bc['query'][_0x1d7d('0x45')]){_0x1d1064[_0x1d7d('0x49')]=[{'all':!![]}];}_0x1d1064=_[_0x1d7d('0x41')]({},_0x1d1064,_0x86e7bc[_0x1d7d('0x44')]);return db['ContactItemType'][_0x1d7d('0x4a')](_0x1d1064)['then'](handleEntityNotFound(_0x379e75,null))['then'](respondWithResult(_0x379e75,null))[_0x1d7d('0x47')](handleError(_0x379e75,null));};exports['create']=function(_0x57e416,_0x3727be){return db[_0x1d7d('0x31')]['create'](_0x57e416[_0x1d7d('0x4b')],{})[_0x1d7d('0x28')](function(_0x527711){var _0x1f3a63=_0x57e416[_0x1d7d('0x4c')][_0x1d7d('0x2a')]({'plain':!![]});if(!_0x1f3a63)throw new Error(_0x1d7d('0x4d'));if(_0x1f3a63['role']==='user'){var _0x3f73eb=_0x527711[_0x1d7d('0x2a')]({'plain':!![]});var _0x35ff5d=_0x1d7d('0x4e');return db[_0x1d7d('0x4f')]['find']({'where':{'name':_0x35ff5d,'userProfileId':_0x1f3a63[_0x1d7d('0x50')]},'raw':!![]})[_0x1d7d('0x28')](function(_0x344b66){if(_0x344b66&&_0x344b66[_0x1d7d('0x51')]===0x0){return db[_0x1d7d('0x52')][_0x1d7d('0x53')]({'name':_0x3f73eb[_0x1d7d('0x2e')],'resourceId':_0x3f73eb['id'],'type':_0x344b66[_0x1d7d('0x2e')],'sectionId':_0x344b66['id']},{})[_0x1d7d('0x28')](function(){return _0x527711;});}else{return _0x527711;}})['catch'](function(_0x3e7c4c){logger[_0x1d7d('0x2c')](_0x1d7d('0x54'),_0x3e7c4c);throw _0x3e7c4c;});}return _0x527711;})['then'](respondWithResult(_0x3727be,0xc9))['catch'](handleError(_0x3727be,null));};exports[_0x1d7d('0x27')]=function(_0x2d4cc3,_0x3f5434){if(_0x2d4cc3['body']['id']){delete _0x2d4cc3[_0x1d7d('0x4b')]['id'];}return db[_0x1d7d('0x31')]['find']({'where':{'id':_0x2d4cc3[_0x1d7d('0x48')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x3f5434,null))[_0x1d7d('0x28')](saveUpdates(_0x2d4cc3[_0x1d7d('0x4b')],null))['then'](respondWithResult(_0x3f5434,null))[_0x1d7d('0x47')](handleError(_0x3f5434,null));};exports[_0x1d7d('0x29')]=function(_0x4ba6ec,_0x4d4c34){return db[_0x1d7d('0x31')][_0x1d7d('0x4a')]({'where':{'id':_0x4ba6ec['params']['id']}})['then'](handleEntityNotFound(_0x4d4c34,null))[_0x1d7d('0x28')](db[_0x1d7d('0x55')][_0x1d7d('0x27')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4ba6ec[_0x1d7d('0x48')]['id']}}))['then'](removeEntity(_0x4d4c34,null))[_0x1d7d('0x47')](handleError(_0x4d4c34,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index 876de7d..f6e10ec 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x85e5=['api','moment','bluebird','request-promise','path','rimraf','define','ContactItemType','tools_contact_item_types','lodash','util'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x85e5,0x77));var _0x585e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x85e5[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x585e('0x0'));var util=require(_0x585e('0x1'));var logger=require('../../config/logger')(_0x585e('0x2'));var moment=require(_0x585e('0x3'));var BPromise=require(_0x585e('0x4'));var rp=require(_0x585e('0x5'));var fs=require('fs');var path=require(_0x585e('0x6'));var rimraf=require(_0x585e('0x7'));var config=require('../../config/environment');var attributes=require('./contactItemType.attributes');module['exports']=function(_0x208f3a,_0x4180ff){return _0x208f3a[_0x585e('0x8')](_0x585e('0x9'),attributes,{'tableName':_0x585e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x10f2=['bluebird','./contactItemType.attributes','define','ContactItemType','lodash','util','../../config/logger','api','moment'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x10f2,0xc1));var _0x210f=function(_0x3bd5e8,_0x41086b){_0x3bd5e8=_0x3bd5e8-0x0;var _0x4b9db9=_0x10f2[_0x3bd5e8];return _0x4b9db9;};'use strict';var _=require(_0x210f('0x0'));var util=require(_0x210f('0x1'));var logger=require(_0x210f('0x2'))(_0x210f('0x3'));var moment=require(_0x210f('0x4'));var BPromise=require(_0x210f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x210f('0x6'));module['exports']=function(_0x4c89f2,_0x51fcd0){return _0x4c89f2[_0x210f('0x7')](_0x210f('0x8'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index f179486..75d42a4 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bae=['ContactItemType,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','ContactItemType,\x20%s,\x20%s','debug'];(function(_0xbaa49e,_0xa5db08){var _0x5ef806=function(_0x2adcb4){while(--_0x2adcb4){_0xbaa49e['push'](_0xbaa49e['shift']());}};_0x5ef806(++_0xa5db08);}(_0x9bae,0x115));var _0xe9ba=function(_0x21a2a3,_0x326499){_0x21a2a3=_0x21a2a3-0x0;var _0x68ec75=_0x9bae[_0x21a2a3];return _0x68ec75;};'use strict';var _=require(_0xe9ba('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe9ba('0x1'));var fs=require('fs');var Redis=require(_0xe9ba('0x2'));var db=require(_0xe9ba('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe9ba('0x4'));var config=require(_0xe9ba('0x5'));var jayson=require(_0xe9ba('0x6'));var client=jayson[_0xe9ba('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ace9e,_0x293538,_0x3954d4){return new BPromise(function(_0x871c0c,_0x39a04f){return client[_0xe9ba('0x8')](_0x1ace9e,_0x3954d4)['then'](function(_0x3fd726){logger['info'](_0xe9ba('0x9'),_0x293538,'request\x20sent');logger[_0xe9ba('0xa')](_0xe9ba('0xb'),_0x293538,_0xe9ba('0xc'),JSON[_0xe9ba('0xd')](_0x3fd726));if(_0x3fd726['error']){if(_0x3fd726[_0xe9ba('0xe')][_0xe9ba('0xf')]===0x1f4){logger['error'](_0xe9ba('0x9'),_0x293538,_0x3fd726[_0xe9ba('0xe')][_0xe9ba('0x10')]);return _0x39a04f(_0x3fd726[_0xe9ba('0xe')]['message']);}logger[_0xe9ba('0xe')](_0xe9ba('0x9'),_0x293538,_0x3fd726['error'][_0xe9ba('0x10')]);return _0x871c0c(_0x3fd726[_0xe9ba('0xe')][_0xe9ba('0x10')]);}else{logger['info']('ContactItemType,\x20%s,\x20%s',_0x293538,'request\x20sent');_0x871c0c(_0x3fd726['result']['message']);}})[_0xe9ba('0x11')](function(_0x56d230){logger[_0xe9ba('0xe')]('ContactItemType,\x20%s,\x20%s',_0x293538,_0x56d230);_0x39a04f(_0x56d230);});});} \ No newline at end of file +var _0x29da=['info','request\x20sent','stringify','error','ContactItemType,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1b08d4,_0x8a710c){var _0x9aef3e=function(_0x4da607){while(--_0x4da607){_0x1b08d4['push'](_0x1b08d4['shift']());}};_0x9aef3e(++_0x8a710c);}(_0x29da,0xf8));var _0xa29d=function(_0x2e1e1d,_0xc94d35){_0x2e1e1d=_0x2e1e1d-0x0;var _0x1fefb6=_0x29da[_0x2e1e1d];return _0x1fefb6;};'use strict';var _=require(_0xa29d('0x0'));var util=require(_0xa29d('0x1'));var moment=require('moment');var BPromise=require(_0xa29d('0x2'));var rs=require(_0xa29d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa29d('0x4'))['db'];var utils=require(_0xa29d('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa29d('0x6'));var jayson=require(_0xa29d('0x7'));var client=jayson[_0xa29d('0x8')][_0xa29d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1461d5,_0x592367,_0x43e47a){return new BPromise(function(_0x26502a,_0x2bfe02){return client[_0xa29d('0xa')](_0x1461d5,_0x43e47a)[_0xa29d('0xb')](function(_0xf9d714){logger[_0xa29d('0xc')]('ContactItemType,\x20%s,\x20%s',_0x592367,_0xa29d('0xd'));logger['debug']('ContactItemType,\x20%s,\x20%s,\x20%s',_0x592367,'request\x20sent',JSON[_0xa29d('0xe')](_0xf9d714));if(_0xf9d714['error']){if(_0xf9d714[_0xa29d('0xf')]['code']===0x1f4){logger[_0xa29d('0xf')](_0xa29d('0x10'),_0x592367,_0xf9d714[_0xa29d('0xf')][_0xa29d('0x11')]);return _0x2bfe02(_0xf9d714[_0xa29d('0xf')][_0xa29d('0x11')]);}logger[_0xa29d('0xf')](_0xa29d('0x10'),_0x592367,_0xf9d714[_0xa29d('0xf')][_0xa29d('0x11')]);return _0x26502a(_0xf9d714[_0xa29d('0xf')][_0xa29d('0x11')]);}else{logger[_0xa29d('0xc')](_0xa29d('0x10'),_0x592367,_0xa29d('0xd'));_0x26502a(_0xf9d714[_0xa29d('0x12')][_0xa29d('0x11')]);}})[_0xa29d('0x13')](function(_0x239aab){logger[_0xa29d('0xf')]('ContactItemType,\x20%s,\x20%s',_0x592367,_0x239aab);_0x2bfe02(_0x239aab);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index d5411e3..b4e6792 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7fba=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./contactItemType.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','exports','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fba,0x143));var _0xa7fb=function(_0x540c20,_0x196525){_0x540c20=_0x540c20-0x0;var _0x304213=_0x7fba[_0x540c20];return _0x304213;};'use strict';var multer=require('multer');var util=require(_0xa7fb('0x0'));var path=require(_0xa7fb('0x1'));var timeout=require('connect-timeout');var express=require(_0xa7fb('0x2'));var router=express[_0xa7fb('0x3')]();var fs_extra=require(_0xa7fb('0x4'));var auth=require(_0xa7fb('0x5'));var interaction=require(_0xa7fb('0x6'));var config=require('../../config/environment');var controller=require(_0xa7fb('0x7'));router[_0xa7fb('0x8')]('/',auth[_0xa7fb('0x9')](),controller['index']);router['get'](_0xa7fb('0xa'),auth['isAuthenticated'](),controller[_0xa7fb('0xb')]);router[_0xa7fb('0xc')]('/',auth[_0xa7fb('0x9')](),controller[_0xa7fb('0xd')]);router[_0xa7fb('0xe')](_0xa7fb('0xa'),auth['isAuthenticated'](),controller[_0xa7fb('0xf')]);router[_0xa7fb('0x10')](_0xa7fb('0xa'),auth[_0xa7fb('0x9')](),controller['destroy']);module[_0xa7fb('0x11')]=router; \ No newline at end of file +var _0x1d75=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller'];(function(_0x11dc4e,_0x2016e4){var _0xcc6792=function(_0x5f5cfe){while(--_0x5f5cfe){_0x11dc4e['push'](_0x11dc4e['shift']());}};_0xcc6792(++_0x2016e4);}(_0x1d75,0x118));var _0x51d7=function(_0x4ba379,_0x5da19d){_0x4ba379=_0x4ba379-0x0;var _0x1a1ff8=_0x1d75[_0x4ba379];return _0x1a1ff8;};'use strict';var multer=require(_0x51d7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x51d7('0x1'));var express=require(_0x51d7('0x2'));var router=express['Router']();var fs_extra=require(_0x51d7('0x3'));var auth=require(_0x51d7('0x4'));var interaction=require(_0x51d7('0x5'));var config=require(_0x51d7('0x6'));var controller=require(_0x51d7('0x7'));router[_0x51d7('0x8')]('/',auth[_0x51d7('0x9')](),controller[_0x51d7('0xa')]);router[_0x51d7('0x8')](_0x51d7('0xb'),auth[_0x51d7('0x9')](),controller[_0x51d7('0xc')]);router[_0x51d7('0xd')]('/',auth[_0x51d7('0x9')](),controller[_0x51d7('0xe')]);router[_0x51d7('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x51d7('0x10')]);router[_0x51d7('0x11')](_0x51d7('0xb'),auth[_0x51d7('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index ce9932a..c20ec42 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 _0xb7e7=['STRING','sequelize'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xb7e7,0x121));var _0x7b7e=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xb7e7[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x497ce5,_0x37ff88){var _0x5234f5=function(_0x4f2854){while(--_0x4f2854){_0x497ce5['push'](_0x497ce5['shift']());}};_0x5234f5(++_0x37ff88);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 7ffb30d..f81ce21 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 _0x01e0=['localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','error','stack','name','send','index','Dashboard','rawAttributes','type','query','keys','filters','intersection','attributes','fields','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','catch','show','params','length','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','omit','userProfileId','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x41d1e0,_0x42e8bd){var _0x345349=function(_0x2f078a){while(--_0x2f078a){_0x41d1e0['push'](_0x41d1e0['shift']());}};_0x345349(++_0x42e8bd);}(_0x01e0,0xec));var _0x001e=function(_0x37a042,_0x2c307a){_0x37a042=_0x37a042-0x0;var _0x19a727=_0x01e0[_0x37a042];return _0x19a727;};'use strict';var emlformat=require(_0x001e('0x0'));var rimraf=require(_0x001e('0x1'));var zipdir=require(_0x001e('0x2'));var jsonpatch=require(_0x001e('0x3'));var rp=require(_0x001e('0x4'));var moment=require(_0x001e('0x5'));var BPromise=require(_0x001e('0x6'));var Mustache=require(_0x001e('0x7'));var util=require(_0x001e('0x8'));var path=require(_0x001e('0x9'));var sox=require('sox');var csv=require(_0x001e('0xa'));var ejs=require(_0x001e('0xb'));var fs=require('fs');var fs_extra=require(_0x001e('0xc'));var _=require(_0x001e('0xd'));var squel=require(_0x001e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x001e('0xf'));var toCsv=require(_0x001e('0xa'));var querystring=require(_0x001e('0x10'));var Papa=require(_0x001e('0x11'));var Redis=require(_0x001e('0x12'));var authService=require(_0x001e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x001e('0x14'));var hardwareService=require(_0x001e('0x15'));var logger=require(_0x001e('0x16'))(_0x001e('0x17'));var utils=require(_0x001e('0x18'));var config=require(_0x001e('0x19'));var licenseUtil=require(_0x001e('0x1a'));var db=require(_0x001e('0x1b'))['db'];config[_0x001e('0x1c')]=_[_0x001e('0x1d')](config[_0x001e('0x1c')],{'host':_0x001e('0x1e'),'port':0x18eb});var socket=require(_0x001e('0x1f'))(new Redis(config[_0x001e('0x1c')]));require('./dashboard.socket')[_0x001e('0x20')](socket);function respondWithStatusCode(_0x33da3a,_0x541906){_0x541906=_0x541906||0xcc;return function(_0x8ffb8b){if(_0x8ffb8b){return _0x33da3a[_0x001e('0x21')](_0x541906);}return _0x33da3a[_0x001e('0x22')](_0x541906)[_0x001e('0x23')]();};}function respondWithResult(_0x4d9074,_0x498715){_0x498715=_0x498715||0xc8;return function(_0x2405d8){if(_0x2405d8){return _0x4d9074[_0x001e('0x22')](_0x498715)['json'](_0x2405d8);}};}function respondWithFilteredResult(_0x3e6904,_0x255670){return function(_0x3e904b){if(_0x3e904b){var _0x24f92e=typeof _0x255670[_0x001e('0x24')]===_0x001e('0x25')&&typeof _0x255670['limit']===_0x001e('0x25');var _0x43d429=_0x3e904b['count'];var _0x14d516=_0x24f92e?0x0:_0x255670[_0x001e('0x24')];var _0x5e6ddc=_0x24f92e?_0x3e904b[_0x001e('0x26')]:_0x255670[_0x001e('0x24')]+_0x255670[_0x001e('0x27')];var _0x551792;if(_0x5e6ddc>=_0x43d429){_0x5e6ddc=_0x43d429;_0x551792=0xc8;}else{_0x551792=0xce;}_0x3e6904[_0x001e('0x22')](_0x551792);return _0x3e6904[_0x001e('0x28')](_0x001e('0x29'),_0x14d516+'-'+_0x5e6ddc+'/'+_0x43d429)[_0x001e('0x2a')](_0x3e904b);}return null;};}function patchUpdates(_0x105f62){return function(_0x26c855){try{jsonpatch[_0x001e('0x2b')](_0x26c855,_0x105f62,!![]);}catch(_0x12f92f){return BPromise['reject'](_0x12f92f);}return _0x26c855[_0x001e('0x2c')]();};}function saveUpdates(_0x34582f,_0x3b5441){return function(_0x50a3c2){if(_0x50a3c2){return _0x50a3c2['update'](_0x34582f)[_0x001e('0x2d')](function(_0x112a22){return _0x112a22;});}return null;};}function removeEntity(_0xdc7135,_0x5dac03){return function(_0x99ef12){if(_0x99ef12){return _0x99ef12[_0x001e('0x2e')]()['then'](function(){var _0x8b66e4=_0x99ef12[_0x001e('0x2f')]({'plain':!![]});var _0x5cd606=_0x001e('0x30');return db[_0x001e('0x31')][_0x001e('0x2e')]({'where':{'type':_0x5cd606,'resourceId':_0x8b66e4['id']}})[_0x001e('0x2d')](function(){return _0x99ef12;});})[_0x001e('0x2d')](function(){_0xdc7135[_0x001e('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18e735,_0x2f85e4){return function(_0x29cc47){if(!_0x29cc47){_0x18e735[_0x001e('0x21')](0x194);}return _0x29cc47;};}function handleError(_0x2cc046,_0x52b303){_0x52b303=_0x52b303||0x1f4;return function(_0x2ea1a5){logger[_0x001e('0x32')](_0x2ea1a5[_0x001e('0x33')]);if(_0x2ea1a5[_0x001e('0x34')]){delete _0x2ea1a5[_0x001e('0x34')];}_0x2cc046[_0x001e('0x22')](_0x52b303)[_0x001e('0x35')](_0x2ea1a5);};}exports[_0x001e('0x36')]=function(_0x40b41e,_0x18e142){var _0x9bb6d9={},_0x9987aa={},_0x2f6ce2={'count':0x0,'rows':[]};var _0x516537=_['map'](db[_0x001e('0x37')][_0x001e('0x38')],function(_0x283d37){return{'name':_0x283d37['fieldName'],'type':_0x283d37[_0x001e('0x39')]['key']};});_0x9987aa['model']=_['map'](_0x516537,_0x001e('0x34'));_0x9987aa[_0x001e('0x3a')]=_[_0x001e('0x3b')](_0x40b41e[_0x001e('0x3a')]);_0x9987aa[_0x001e('0x3c')]=_[_0x001e('0x3d')](_0x9987aa['model'],_0x9987aa[_0x001e('0x3a')]);_0x9bb6d9[_0x001e('0x3e')]=_[_0x001e('0x3d')](_0x9987aa['model'],qs[_0x001e('0x3f')](_0x40b41e[_0x001e('0x3a')][_0x001e('0x3f')]));_0x9bb6d9[_0x001e('0x3e')]=_0x9bb6d9['attributes']['length']?_0x9bb6d9[_0x001e('0x3e')]:_0x9987aa[_0x001e('0x40')];if(!_0x40b41e['query'][_0x001e('0x41')](_0x001e('0x42'))){_0x9bb6d9[_0x001e('0x27')]=qs[_0x001e('0x27')](_0x40b41e[_0x001e('0x3a')][_0x001e('0x27')]);_0x9bb6d9[_0x001e('0x24')]=qs[_0x001e('0x24')](_0x40b41e[_0x001e('0x3a')][_0x001e('0x24')]);}_0x9bb6d9[_0x001e('0x43')]=qs[_0x001e('0x44')](_0x40b41e[_0x001e('0x3a')]['sort']);_0x9bb6d9[_0x001e('0x45')]=qs['filters'](_[_0x001e('0x46')](_0x40b41e[_0x001e('0x3a')],_0x9987aa['filters']),_0x516537);if(_0x40b41e[_0x001e('0x3a')][_0x001e('0x47')]){_0x9bb6d9[_0x001e('0x45')]=_[_0x001e('0x48')](_0x9bb6d9[_0x001e('0x45')],{'$or':_['map'](_0x516537,function(_0x2b43c3){if(_0x2b43c3[_0x001e('0x39')]!=='VIRTUAL'){var _0x4eb3ab={};_0x4eb3ab[_0x2b43c3[_0x001e('0x34')]]={'$like':'%'+_0x40b41e[_0x001e('0x3a')][_0x001e('0x47')]+'%'};return _0x4eb3ab;}})});}_0x9bb6d9=_['merge']({},_0x9bb6d9,_0x40b41e[_0x001e('0x49')]);var _0x3f3bb4={'where':_0x9bb6d9[_0x001e('0x45')]};return db['Dashboard']['count'](_0x3f3bb4)[_0x001e('0x2d')](function(_0xc8e1c4){_0x2f6ce2[_0x001e('0x26')]=_0xc8e1c4;if(_0x40b41e[_0x001e('0x3a')][_0x001e('0x4a')]){_0x9bb6d9['include']=[{'all':!![]}];}return db[_0x001e('0x37')]['findAll'](_0x9bb6d9);})[_0x001e('0x2d')](function(_0x4a283e){_0x2f6ce2[_0x001e('0x4b')]=_0x4a283e;return _0x2f6ce2;})['then'](respondWithFilteredResult(_0x18e142,_0x9bb6d9))[_0x001e('0x4c')](handleError(_0x18e142,null));};exports[_0x001e('0x4d')]=function(_0x3bf320,_0xecf316){var _0x528bae={'raw':![],'where':{'id':_0x3bf320[_0x001e('0x4e')]['id']}},_0x480407={};_0x480407[_0x001e('0x40')]=_[_0x001e('0x3b')](db['Dashboard'][_0x001e('0x38')]);_0x480407['query']=_[_0x001e('0x3b')](_0x3bf320[_0x001e('0x3a')]);_0x480407['filters']=_[_0x001e('0x3d')](_0x480407[_0x001e('0x40')],_0x480407['query']);_0x528bae[_0x001e('0x3e')]=_[_0x001e('0x3d')](_0x480407[_0x001e('0x40')],qs[_0x001e('0x3f')](_0x3bf320[_0x001e('0x3a')][_0x001e('0x3f')]));_0x528bae[_0x001e('0x3e')]=_0x528bae[_0x001e('0x3e')][_0x001e('0x4f')]?_0x528bae[_0x001e('0x3e')]:_0x480407['model'];if(_0x3bf320[_0x001e('0x3a')][_0x001e('0x4a')]){_0x528bae[_0x001e('0x50')]=[{'all':!![]}];}_0x528bae=_[_0x001e('0x48')]({},_0x528bae,_0x3bf320['options']);return db[_0x001e('0x37')][_0x001e('0x51')](_0x528bae)[_0x001e('0x2d')](handleEntityNotFound(_0xecf316,null))[_0x001e('0x2d')](respondWithResult(_0xecf316,null))[_0x001e('0x4c')](handleError(_0xecf316,null));};exports[_0x001e('0x52')]=function(_0x52b7aa,_0x5f3807){return db[_0x001e('0x37')]['create'](_0x52b7aa[_0x001e('0x53')],{})['then'](function(_0x47e999){var _0x20163c=_0x52b7aa[_0x001e('0x54')][_0x001e('0x2f')]({'plain':!![]});if(!_0x20163c)throw new Error(_0x001e('0x55'));if(_0x20163c['role']==='user'){var _0x3fe3ab=_0x47e999[_0x001e('0x2f')]({'plain':!![]});var _0x20994a=_0x001e('0x30');return db[_0x001e('0x56')][_0x001e('0x51')]({'where':{'name':_0x20994a,'userProfileId':_0x20163c['userProfileId']},'raw':!![]})[_0x001e('0x2d')](function(_0x35be18){if(_0x35be18&&_0x35be18[_0x001e('0x57')]===0x0){return db[_0x001e('0x31')][_0x001e('0x52')]({'name':_0x3fe3ab[_0x001e('0x34')],'resourceId':_0x3fe3ab['id'],'type':_0x35be18['name'],'sectionId':_0x35be18['id']},{})[_0x001e('0x2d')](function(){return _0x47e999;});}else{return _0x47e999;}})['catch'](function(_0x280ef3){logger['error'](_0x001e('0x58'),_0x280ef3);throw _0x280ef3;});}return _0x47e999;})[_0x001e('0x2d')](respondWithResult(_0x5f3807,0xc9))[_0x001e('0x4c')](handleError(_0x5f3807,null));};exports[_0x001e('0x59')]=function(_0x525561,_0x37f81f){var _0x133688={'where':{'id':_0x525561[_0x001e('0x4e')]['id']}},_0x5da06c={};_0x5da06c[_0x001e('0x40')]=_[_0x001e('0x3b')](db[_0x001e('0x37')]['rawAttributes']);_0x133688[_0x001e('0x3e')]=_[_0x001e('0x3d')](_0x5da06c[_0x001e('0x40')],qs[_0x001e('0x3f')](_0x525561[_0x001e('0x3a')][_0x001e('0x3f')]));_0x133688[_0x001e('0x3e')]=_0x133688['attributes'][_0x001e('0x4f')]?_0x133688[_0x001e('0x3e')]:_0x5da06c['model'];if(_0x525561[_0x001e('0x3a')][_0x001e('0x4a')]){_0x133688['include']=[{'all':!![]}];}_0x133688=_[_0x001e('0x48')]({},_0x133688,_0x525561['options']);return db[_0x001e('0x37')][_0x001e('0x51')](_0x133688)[_0x001e('0x2d')](handleEntityNotFound(_0x37f81f,null))[_0x001e('0x2d')](function(_0x277f89){if(_0x277f89){var _0xd3e94e=_0x277f89['get']({'plain':!![]});_0xd3e94e=qs['omit'](_0xd3e94e,['id',_0x001e('0x5a'),_0x001e('0x5b')]);_0x525561[_0x001e('0x53')]=_[_0x001e('0x5c')](_0x525561[_0x001e('0x53')],['id',_0x001e('0x5a'),_0x001e('0x5b')]);return db[_0x001e('0x37')]['create'](_[_0x001e('0x48')](_0xd3e94e,_0x525561[_0x001e('0x53')]),{'include':_0x525561[_0x001e('0x3a')][_0x001e('0x4a')]?[{'all':!![]}]:undefined})[_0x001e('0x2d')](function(_0x733f5){var _0x2c9120=_0x525561['user'][_0x001e('0x2f')]({'plain':!![]});if(!_0x2c9120)throw new Error(_0x001e('0x55'));if(_0x2c9120['role']===_0x001e('0x54')){var _0x2310b9=_0x733f5[_0x001e('0x2f')]({'plain':!![]});var _0x10f560=_0x001e('0x30');return db[_0x001e('0x56')][_0x001e('0x51')]({'where':{'name':_0x10f560,'userProfileId':_0x2c9120[_0x001e('0x5d')]},'raw':!![]})[_0x001e('0x2d')](function(_0x536ce8){if(_0x536ce8&&_0x536ce8[_0x001e('0x57')]===0x0){return db[_0x001e('0x31')][_0x001e('0x52')]({'name':_0x2310b9[_0x001e('0x34')],'resourceId':_0x2310b9['id'],'type':_0x536ce8[_0x001e('0x34')],'sectionId':_0x536ce8['id']},{})['then'](function(){return _0x733f5;});}else{return _0x733f5;}})['catch'](function(_0x16b944){logger[_0x001e('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x16b944);throw _0x16b944;});}return _0x733f5;});}})['then'](respondWithResult(_0x37f81f,0xc9))[_0x001e('0x4c')](handleError(_0x37f81f,null));};exports['update']=function(_0x53fa96,_0x3c3e2e){if(_0x53fa96[_0x001e('0x53')]['id']){delete _0x53fa96[_0x001e('0x53')]['id'];}return db[_0x001e('0x37')][_0x001e('0x51')]({'where':{'id':_0x53fa96[_0x001e('0x4e')]['id']}})[_0x001e('0x2d')](handleEntityNotFound(_0x3c3e2e,null))[_0x001e('0x2d')](saveUpdates(_0x53fa96[_0x001e('0x53')],null))[_0x001e('0x2d')](respondWithResult(_0x3c3e2e,null))[_0x001e('0x4c')](handleError(_0x3c3e2e,null));};exports[_0x001e('0x2e')]=function(_0x41af16,_0x16ee86){return db[_0x001e('0x37')][_0x001e('0x51')]({'where':{'id':_0x41af16['params']['id']}})[_0x001e('0x2d')](handleEntityNotFound(_0x16ee86,null))[_0x001e('0x2d')](removeEntity(_0x16ee86,null))['catch'](handleError(_0x16ee86,null));};function widgetAttributes(_0x2b8be1){try{switch(_0x2b8be1[_0x001e('0x39')]){case _0x001e('0x5e'):return[{'name':'attrUrl','value':_0x2b8be1['attrUrl']||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x0]?_0x2b8be1['attrs'][0x0][_0x001e('0x60')]:undefined)||_0x001e('0x61')}];case _0x001e('0x62'):return[{'name':_0x001e('0x63'),'value':_0x2b8be1[_0x001e('0x63')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x0]?_0x2b8be1['attrs'][0x0][_0x001e('0x60')]:undefined)||''}];case _0x001e('0x64'):return[{'name':'attrHourFormat','value':_0x2b8be1[_0x001e('0x65')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x0]?_0x2b8be1['attrs'][0x0][_0x001e('0x60')]:undefined)||_0x001e('0x66')},{'name':_0x001e('0x67'),'value':_0x2b8be1[_0x001e('0x67')]||(_0x2b8be1['attrs']&&_0x2b8be1['attrs'][0x1]?_0x2b8be1[_0x001e('0x5f')][0x1][_0x001e('0x60')]:undefined)||_0x001e('0x68')},{'name':_0x001e('0x69'),'value':_0x2b8be1[_0x001e('0x69')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x2]?_0x2b8be1['attrs'][0x2][_0x001e('0x60')]:undefined)||0xc}];case _0x001e('0x6a'):return[{'name':_0x001e('0x6b'),'value':_0x2b8be1['attrMetric']||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x0]?_0x2b8be1[_0x001e('0x5f')][0x0][_0x001e('0x60')]:undefined)||_0x001e('0x6c')},{'name':'attrVoiceQueues','value':_0x2b8be1[_0x001e('0x6d')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1['attrs'][0x1]?_0x2b8be1[_0x001e('0x5f')][0x1][_0x001e('0x60')]:undefined)||[]},{'name':_0x001e('0x69'),'value':_0x2b8be1[_0x001e('0x69')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1['attrs'][0x2]?_0x2b8be1[_0x001e('0x5f')][0x2][_0x001e('0x60')]:undefined)||0x14},{'name':_0x001e('0x6e'),'value':_0x2b8be1['attrChannel']||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x3]?_0x2b8be1[_0x001e('0x5f')][0x3]['value']:undefined)||'voice'},{'name':_0x001e('0x6f'),'value':_0x2b8be1[_0x001e('0x6f')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x4]?_0x2b8be1['attrs'][0x4][_0x001e('0x60')]:undefined)||''},{'name':_0x001e('0x70'),'value':_0x2b8be1[_0x001e('0x70')]||(_0x2b8be1['attrs']&&_0x2b8be1[_0x001e('0x5f')][0x5]?_0x2b8be1[_0x001e('0x5f')][0x5][_0x001e('0x60')]:undefined)||''},{'name':_0x001e('0x71'),'value':_0x2b8be1[_0x001e('0x71')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x6]?_0x2b8be1[_0x001e('0x5f')][0x6][_0x001e('0x60')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x2b8be1[_0x001e('0x72')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x7]?_0x2b8be1[_0x001e('0x5f')][0x7]['value']:undefined)||''},{'name':_0x001e('0x73'),'value':_0x2b8be1['attrWhatsappAccounts']||(_0x2b8be1['attrs']&&_0x2b8be1[_0x001e('0x5f')][0x8]?_0x2b8be1[_0x001e('0x5f')][0x8]['value']:undefined)||''},{'name':_0x001e('0x74'),'value':_0x2b8be1[_0x001e('0x74')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x9]?_0x2b8be1[_0x001e('0x5f')][0x9][_0x001e('0x60')]:undefined)||''}];case _0x001e('0x75'):case _0x001e('0x76'):return[{'name':'attrSerie1','value':_0x2b8be1[_0x001e('0x77')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x0]?_0x2b8be1[_0x001e('0x5f')][0x0]['value']:undefined)||_0x001e('0x6c')},{'name':_0x001e('0x78'),'value':_0x2b8be1[_0x001e('0x78')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x1]?_0x2b8be1['attrs'][0x1][_0x001e('0x60')]:undefined)||null},{'name':_0x001e('0x79'),'value':_0x2b8be1[_0x001e('0x79')]||(_0x2b8be1['attrs']&&_0x2b8be1['attrs'][0x2]?_0x2b8be1['attrs'][0x2][_0x001e('0x60')]:undefined)||null},{'name':_0x001e('0x6d'),'value':_0x2b8be1['attrVoiceQueues']||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1['attrs'][0x3]?_0x2b8be1[_0x001e('0x5f')][0x3][_0x001e('0x60')]:undefined)||[]},{'name':_0x001e('0x6e'),'value':_0x2b8be1[_0x001e('0x6e')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x4]?_0x2b8be1[_0x001e('0x5f')][0x4][_0x001e('0x60')]:undefined)||_0x001e('0x7a')},{'name':_0x001e('0x6f'),'value':_0x2b8be1[_0x001e('0x6f')]||(_0x2b8be1['attrs']&&_0x2b8be1['attrs'][0x5]?_0x2b8be1[_0x001e('0x5f')][0x5]['value']:undefined)||''},{'name':_0x001e('0x70'),'value':_0x2b8be1[_0x001e('0x70')]||(_0x2b8be1['attrs']&&_0x2b8be1[_0x001e('0x5f')][0x6]?_0x2b8be1[_0x001e('0x5f')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x2b8be1[_0x001e('0x71')]||(_0x2b8be1['attrs']&&_0x2b8be1[_0x001e('0x5f')][0x7]?_0x2b8be1[_0x001e('0x5f')][0x7][_0x001e('0x60')]:undefined)||''},{'name':_0x001e('0x72'),'value':_0x2b8be1[_0x001e('0x72')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x8]?_0x2b8be1[_0x001e('0x5f')][0x8][_0x001e('0x60')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x2b8be1[_0x001e('0x73')]||(_0x2b8be1['attrs']&&_0x2b8be1[_0x001e('0x5f')][0x9]?_0x2b8be1[_0x001e('0x5f')][0x9][_0x001e('0x60')]:undefined)||''},{'name':_0x001e('0x74'),'value':_0x2b8be1['attrChatWebsites']||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0xa]?_0x2b8be1['attrs'][0xa]['value']:undefined)||''}];case _0x001e('0x7b'):return[{'name':_0x001e('0x7c'),'type':_0x2b8be1[_0x001e('0x7d')]||(_0x2b8be1['attrs']&&_0x2b8be1[_0x001e('0x5f')][0x0]?_0x2b8be1[_0x001e('0x5f')][0x0][_0x001e('0x39')]:undefined)||null,'value':_0x2b8be1[_0x001e('0x7c')]||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1['attrs'][0x0]?_0x2b8be1[_0x001e('0x5f')][0x0][_0x001e('0x60')]:undefined)||null},{'name':'attrRefresh','value':_0x2b8be1['attrRefresh']||(_0x2b8be1[_0x001e('0x5f')]&&_0x2b8be1[_0x001e('0x5f')][0x1]?_0x2b8be1[_0x001e('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x206cda){logger[_0x001e('0x32')](_0x001e('0x7e'),JSON[_0x001e('0x7f')](_0x206cda));return[];}}exports[_0x001e('0x80')]=function(_0x23c5d1,_0x1092c3,_0x5016f4){if(_0x23c5d1[_0x001e('0x53')]['id']){delete _0x23c5d1['body']['id'];}return db[_0x001e('0x37')]['find']({'where':{'id':_0x23c5d1[_0x001e('0x4e')]['id']}})[_0x001e('0x2d')](handleEntityNotFound(_0x1092c3,null))['then'](function(_0x342dcc){if(_0x342dcc){_0x23c5d1[_0x001e('0x53')][_0x001e('0x81')]=_0x342dcc['id'];_0x23c5d1[_0x001e('0x53')][_0x001e('0x5f')]=widgetAttributes(_0x23c5d1[_0x001e('0x53')]);return db[_0x001e('0x82')][_0x001e('0x52')](_0x23c5d1[_0x001e('0x53')]);}})['then'](respondWithResult(_0x1092c3,null))[_0x001e('0x4c')](handleError(_0x1092c3,null));};exports['getItems']=function(_0x5b5ea6,_0x309ca2,_0x23f641){var _0x5c09c7={};var _0x32fff0={};var _0x4192ec;var _0x5a3f94;return db[_0x001e('0x37')][_0x001e('0x83')]({'where':{'id':_0x5b5ea6[_0x001e('0x4e')]['id']}})[_0x001e('0x2d')](handleEntityNotFound(_0x309ca2,null))[_0x001e('0x2d')](function(_0x21cc39){if(_0x21cc39){_0x4192ec=_0x21cc39;_0x32fff0[_0x001e('0x40')]=_[_0x001e('0x3b')](db[_0x001e('0x82')][_0x001e('0x38')]);_0x32fff0['query']=_['keys'](_0x5b5ea6[_0x001e('0x3a')]);_0x32fff0[_0x001e('0x3c')]=_[_0x001e('0x3d')](_0x32fff0[_0x001e('0x40')],_0x32fff0['query']);_0x5c09c7[_0x001e('0x3e')]=_[_0x001e('0x3d')](_0x32fff0[_0x001e('0x40')],qs[_0x001e('0x3f')](_0x5b5ea6[_0x001e('0x3a')][_0x001e('0x3f')]));_0x5c09c7[_0x001e('0x3e')]=_0x5c09c7['attributes'][_0x001e('0x4f')]?_0x5c09c7[_0x001e('0x3e')]:_0x32fff0[_0x001e('0x40')];_0x5c09c7['order']=qs[_0x001e('0x44')](_0x5b5ea6[_0x001e('0x3a')][_0x001e('0x44')]);_0x5c09c7[_0x001e('0x45')]=qs[_0x001e('0x3c')](_['pick'](_0x5b5ea6[_0x001e('0x3a')],_0x32fff0['filters']));if(_0x5b5ea6[_0x001e('0x3a')][_0x001e('0x47')]){_0x5c09c7['where']=_[_0x001e('0x48')](_0x5c09c7['where'],{'$or':_['map'](_0x5c09c7[_0x001e('0x3e')],function(_0x2faddf){var _0xb9b7fc={};_0xb9b7fc[_0x2faddf]={'$like':'%'+_0x5b5ea6[_0x001e('0x3a')][_0x001e('0x47')]+'%'};return _0xb9b7fc;})});}_0x5c09c7=_[_0x001e('0x48')]({},_0x5c09c7,_0x5b5ea6[_0x001e('0x49')]);return _0x4192ec['getItems'](_0x5c09c7);}})[_0x001e('0x2d')](function(_0x395448){if(_0x395448){_0x5a3f94=_0x395448[_0x001e('0x4f')];if(!_0x5b5ea6[_0x001e('0x3a')][_0x001e('0x41')](_0x001e('0x42'))){_0x5c09c7[_0x001e('0x27')]=qs[_0x001e('0x27')](_0x5b5ea6['query']['limit']);_0x5c09c7[_0x001e('0x24')]=qs[_0x001e('0x24')](_0x5b5ea6[_0x001e('0x3a')][_0x001e('0x24')]);}return _0x4192ec[_0x001e('0x84')](_0x5c09c7);}})[_0x001e('0x2d')](function(_0x58dea9){if(_0x58dea9){return _0x58dea9?{'count':_0x5a3f94,'rows':_0x58dea9}:null;}})[_0x001e('0x2d')](respondWithResult(_0x309ca2,null))[_0x001e('0x4c')](handleError(_0x309ca2,null));}; \ No newline at end of file +var _0x84bb=['redis','defaults','localhost','./dashboard.socket','register','status','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','get','CustomDashboards','sendStatus','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','VIRTUAL','options','where','includeAll','include','rows','catch','show','params','keys','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','attrUrl','attrs','value','https://','custom','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','stringify','addItem','DashboardId','DashboardItem','getItems','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x5f47a7,_0xb765cf){var _0x1a167c=function(_0x2b3029){while(--_0x2b3029){_0x5f47a7['push'](_0x5f47a7['shift']());}};_0x1a167c(++_0xb765cf);}(_0x84bb,0x161));var _0xb84b=function(_0x4c6b93,_0x19880d){_0x4c6b93=_0x4c6b93-0x0;var _0x119770=_0x84bb[_0x4c6b93];return _0x119770;};'use strict';var emlformat=require(_0xb84b('0x0'));var rimraf=require(_0xb84b('0x1'));var zipdir=require(_0xb84b('0x2'));var jsonpatch=require(_0xb84b('0x3'));var rp=require(_0xb84b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb84b('0x5'));var path=require(_0xb84b('0x6'));var sox=require('sox');var csv=require(_0xb84b('0x7'));var ejs=require(_0xb84b('0x8'));var fs=require('fs');var fs_extra=require(_0xb84b('0x9'));var _=require(_0xb84b('0xa'));var squel=require(_0xb84b('0xb'));var crypto=require('crypto');var jsforce=require(_0xb84b('0xc'));var deskjs=require(_0xb84b('0xd'));var toCsv=require(_0xb84b('0x7'));var querystring=require(_0xb84b('0xe'));var Papa=require(_0xb84b('0xf'));var Redis=require('ioredis');var authService=require(_0xb84b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb84b('0x11'));var logger=require('../../config/logger')(_0xb84b('0x12'));var utils=require(_0xb84b('0x13'));var config=require(_0xb84b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb84b('0x15'))['db'];config[_0xb84b('0x16')]=_[_0xb84b('0x17')](config['redis'],{'host':_0xb84b('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb84b('0x16')]));require(_0xb84b('0x19'))[_0xb84b('0x1a')](socket);function respondWithStatusCode(_0x1082f6,_0x7bd182){_0x7bd182=_0x7bd182||0xcc;return function(_0x106030){if(_0x106030){return _0x1082f6['sendStatus'](_0x7bd182);}return _0x1082f6[_0xb84b('0x1b')](_0x7bd182)['end']();};}function respondWithResult(_0x5090b6,_0x413c84){_0x413c84=_0x413c84||0xc8;return function(_0xb72894){if(_0xb72894){return _0x5090b6['status'](_0x413c84)['json'](_0xb72894);}};}function respondWithFilteredResult(_0x2e5e14,_0x42d3bc){return function(_0x206bbb){if(_0x206bbb){var _0x5a7b21=typeof _0x42d3bc[_0xb84b('0x1c')]===_0xb84b('0x1d')&&typeof _0x42d3bc[_0xb84b('0x1e')]===_0xb84b('0x1d');var _0x1a75a4=_0x206bbb['count'];var _0x52a81b=_0x5a7b21?0x0:_0x42d3bc[_0xb84b('0x1c')];var _0x267ef6=_0x5a7b21?_0x206bbb[_0xb84b('0x1f')]:_0x42d3bc[_0xb84b('0x1c')]+_0x42d3bc[_0xb84b('0x1e')];var _0x8280d3;if(_0x267ef6>=_0x1a75a4){_0x267ef6=_0x1a75a4;_0x8280d3=0xc8;}else{_0x8280d3=0xce;}_0x2e5e14[_0xb84b('0x1b')](_0x8280d3);return _0x2e5e14[_0xb84b('0x20')]('Content-Range',_0x52a81b+'-'+_0x267ef6+'/'+_0x1a75a4)[_0xb84b('0x21')](_0x206bbb);}return null;};}function patchUpdates(_0x27d29a){return function(_0x2e31e5){try{jsonpatch[_0xb84b('0x22')](_0x2e31e5,_0x27d29a,!![]);}catch(_0x30bc7a){return BPromise['reject'](_0x30bc7a);}return _0x2e31e5[_0xb84b('0x23')]();};}function saveUpdates(_0x4b69c6,_0x1e72ee){return function(_0x4cb4a6){if(_0x4cb4a6){return _0x4cb4a6[_0xb84b('0x24')](_0x4b69c6)['then'](function(_0xec6e16){return _0xec6e16;});}return null;};}function removeEntity(_0x191a87,_0x2c47b1){return function(_0x8501){if(_0x8501){return _0x8501[_0xb84b('0x25')]()[_0xb84b('0x26')](function(){var _0xb5b447=_0x8501[_0xb84b('0x27')]({'plain':!![]});var _0xddef30=_0xb84b('0x28');return db['UserProfileResource'][_0xb84b('0x25')]({'where':{'type':_0xddef30,'resourceId':_0xb5b447['id']}})[_0xb84b('0x26')](function(){return _0x8501;});})[_0xb84b('0x26')](function(){_0x191a87[_0xb84b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32a9a9,_0x4bafba){return function(_0x1da857){if(!_0x1da857){_0x32a9a9[_0xb84b('0x29')](0x194);}return _0x1da857;};}function handleError(_0x5cf62d,_0x17cda9){_0x17cda9=_0x17cda9||0x1f4;return function(_0x4382f8){logger[_0xb84b('0x2a')](_0x4382f8[_0xb84b('0x2b')]);if(_0x4382f8[_0xb84b('0x2c')]){delete _0x4382f8[_0xb84b('0x2c')];}_0x5cf62d['status'](_0x17cda9)[_0xb84b('0x2d')](_0x4382f8);};}exports[_0xb84b('0x2e')]=function(_0x88b8db,_0x534e18){var _0x40e39f={},_0x1031bb={},_0x22b61a={'count':0x0,'rows':[]};var _0x55a22b=_[_0xb84b('0x2f')](db[_0xb84b('0x30')][_0xb84b('0x31')],function(_0x399586){return{'name':_0x399586[_0xb84b('0x32')],'type':_0x399586[_0xb84b('0x33')][_0xb84b('0x34')]};});_0x1031bb[_0xb84b('0x35')]=_[_0xb84b('0x2f')](_0x55a22b,_0xb84b('0x2c'));_0x1031bb[_0xb84b('0x36')]=_['keys'](_0x88b8db[_0xb84b('0x36')]);_0x1031bb[_0xb84b('0x37')]=_[_0xb84b('0x38')](_0x1031bb[_0xb84b('0x35')],_0x1031bb[_0xb84b('0x36')]);_0x40e39f[_0xb84b('0x39')]=_[_0xb84b('0x38')](_0x1031bb[_0xb84b('0x35')],qs[_0xb84b('0x3a')](_0x88b8db[_0xb84b('0x36')]['fields']));_0x40e39f[_0xb84b('0x39')]=_0x40e39f[_0xb84b('0x39')]['length']?_0x40e39f[_0xb84b('0x39')]:_0x1031bb[_0xb84b('0x35')];if(!_0x88b8db[_0xb84b('0x36')][_0xb84b('0x3b')](_0xb84b('0x3c'))){_0x40e39f[_0xb84b('0x1e')]=qs[_0xb84b('0x1e')](_0x88b8db[_0xb84b('0x36')][_0xb84b('0x1e')]);_0x40e39f[_0xb84b('0x1c')]=qs[_0xb84b('0x1c')](_0x88b8db[_0xb84b('0x36')][_0xb84b('0x1c')]);}_0x40e39f['order']=qs[_0xb84b('0x3d')](_0x88b8db[_0xb84b('0x36')][_0xb84b('0x3d')]);_0x40e39f['where']=qs[_0xb84b('0x37')](_[_0xb84b('0x3e')](_0x88b8db['query'],_0x1031bb[_0xb84b('0x37')]),_0x55a22b);if(_0x88b8db[_0xb84b('0x36')][_0xb84b('0x3f')]){_0x40e39f['where']=_[_0xb84b('0x40')](_0x40e39f['where'],{'$or':_[_0xb84b('0x2f')](_0x55a22b,function(_0x3cb627){if(_0x3cb627[_0xb84b('0x33')]!==_0xb84b('0x41')){var _0x42250a={};_0x42250a[_0x3cb627['name']]={'$like':'%'+_0x88b8db[_0xb84b('0x36')][_0xb84b('0x3f')]+'%'};return _0x42250a;}})});}_0x40e39f=_[_0xb84b('0x40')]({},_0x40e39f,_0x88b8db[_0xb84b('0x42')]);var _0x514cf0={'where':_0x40e39f[_0xb84b('0x43')]};return db[_0xb84b('0x30')]['count'](_0x514cf0)[_0xb84b('0x26')](function(_0x587223){_0x22b61a[_0xb84b('0x1f')]=_0x587223;if(_0x88b8db[_0xb84b('0x36')][_0xb84b('0x44')]){_0x40e39f[_0xb84b('0x45')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x40e39f);})[_0xb84b('0x26')](function(_0x5500c3){_0x22b61a[_0xb84b('0x46')]=_0x5500c3;return _0x22b61a;})[_0xb84b('0x26')](respondWithFilteredResult(_0x534e18,_0x40e39f))[_0xb84b('0x47')](handleError(_0x534e18,null));};exports[_0xb84b('0x48')]=function(_0x3bc65a,_0x2559c7){var _0x5d17eb={'raw':![],'where':{'id':_0x3bc65a[_0xb84b('0x49')]['id']}},_0x105e9a={};_0x105e9a[_0xb84b('0x35')]=_[_0xb84b('0x4a')](db['Dashboard']['rawAttributes']);_0x105e9a[_0xb84b('0x36')]=_['keys'](_0x3bc65a[_0xb84b('0x36')]);_0x105e9a[_0xb84b('0x37')]=_[_0xb84b('0x38')](_0x105e9a[_0xb84b('0x35')],_0x105e9a[_0xb84b('0x36')]);_0x5d17eb[_0xb84b('0x39')]=_['intersection'](_0x105e9a['model'],qs['fields'](_0x3bc65a[_0xb84b('0x36')][_0xb84b('0x3a')]));_0x5d17eb[_0xb84b('0x39')]=_0x5d17eb[_0xb84b('0x39')][_0xb84b('0x4b')]?_0x5d17eb[_0xb84b('0x39')]:_0x105e9a['model'];if(_0x3bc65a[_0xb84b('0x36')][_0xb84b('0x44')]){_0x5d17eb['include']=[{'all':!![]}];}_0x5d17eb=_['merge']({},_0x5d17eb,_0x3bc65a[_0xb84b('0x42')]);return db[_0xb84b('0x30')][_0xb84b('0x4c')](_0x5d17eb)[_0xb84b('0x26')](handleEntityNotFound(_0x2559c7,null))[_0xb84b('0x26')](respondWithResult(_0x2559c7,null))[_0xb84b('0x47')](handleError(_0x2559c7,null));};exports[_0xb84b('0x4d')]=function(_0x4b65d5,_0x56b3b9){return db['Dashboard'][_0xb84b('0x4d')](_0x4b65d5['body'],{})[_0xb84b('0x26')](function(_0x5605cd){var _0xc1c6ef=_0x4b65d5['user']['get']({'plain':!![]});if(!_0xc1c6ef)throw new Error(_0xb84b('0x4e'));if(_0xc1c6ef[_0xb84b('0x4f')]===_0xb84b('0x50')){var _0x5ad7cb=_0x5605cd[_0xb84b('0x27')]({'plain':!![]});var _0x578388=_0xb84b('0x28');return db['UserProfileSection'][_0xb84b('0x4c')]({'where':{'name':_0x578388,'userProfileId':_0xc1c6ef[_0xb84b('0x51')]},'raw':!![]})[_0xb84b('0x26')](function(_0x17b256){if(_0x17b256&&_0x17b256[_0xb84b('0x52')]===0x0){return db['UserProfileResource'][_0xb84b('0x4d')]({'name':_0x5ad7cb[_0xb84b('0x2c')],'resourceId':_0x5ad7cb['id'],'type':_0x17b256[_0xb84b('0x2c')],'sectionId':_0x17b256['id']},{})[_0xb84b('0x26')](function(){return _0x5605cd;});}else{return _0x5605cd;}})[_0xb84b('0x47')](function(_0x1128b5){logger[_0xb84b('0x2a')](_0xb84b('0x53'),_0x1128b5);throw _0x1128b5;});}return _0x5605cd;})[_0xb84b('0x26')](respondWithResult(_0x56b3b9,0xc9))[_0xb84b('0x47')](handleError(_0x56b3b9,null));};exports[_0xb84b('0x54')]=function(_0x193150,_0x4a0280){var _0x5da318={'where':{'id':_0x193150[_0xb84b('0x49')]['id']}},_0x44d22f={};_0x44d22f[_0xb84b('0x35')]=_[_0xb84b('0x4a')](db[_0xb84b('0x30')]['rawAttributes']);_0x5da318[_0xb84b('0x39')]=_[_0xb84b('0x38')](_0x44d22f[_0xb84b('0x35')],qs[_0xb84b('0x3a')](_0x193150[_0xb84b('0x36')][_0xb84b('0x3a')]));_0x5da318['attributes']=_0x5da318[_0xb84b('0x39')][_0xb84b('0x4b')]?_0x5da318[_0xb84b('0x39')]:_0x44d22f[_0xb84b('0x35')];if(_0x193150[_0xb84b('0x36')][_0xb84b('0x44')]){_0x5da318[_0xb84b('0x45')]=[{'all':!![]}];}_0x5da318=_[_0xb84b('0x40')]({},_0x5da318,_0x193150[_0xb84b('0x42')]);return db[_0xb84b('0x30')][_0xb84b('0x4c')](_0x5da318)[_0xb84b('0x26')](handleEntityNotFound(_0x4a0280,null))[_0xb84b('0x26')](function(_0x3227fd){if(_0x3227fd){var _0x1889f5=_0x3227fd[_0xb84b('0x27')]({'plain':!![]});_0x1889f5=qs[_0xb84b('0x55')](_0x1889f5,['id',_0xb84b('0x56'),_0xb84b('0x57')]);_0x193150[_0xb84b('0x58')]=_[_0xb84b('0x55')](_0x193150[_0xb84b('0x58')],['id','createdAt',_0xb84b('0x57')]);return db[_0xb84b('0x30')][_0xb84b('0x4d')](_[_0xb84b('0x40')](_0x1889f5,_0x193150[_0xb84b('0x58')]),{'include':_0x193150[_0xb84b('0x36')][_0xb84b('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x37c0da){var _0x27b085=_0x193150[_0xb84b('0x50')]['get']({'plain':!![]});if(!_0x27b085)throw new Error(_0xb84b('0x4e'));if(_0x27b085[_0xb84b('0x4f')]===_0xb84b('0x50')){var _0x442369=_0x37c0da[_0xb84b('0x27')]({'plain':!![]});var _0x3f60b3=_0xb84b('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x3f60b3,'userProfileId':_0x27b085[_0xb84b('0x51')]},'raw':!![]})['then'](function(_0x5aea9f){if(_0x5aea9f&&_0x5aea9f[_0xb84b('0x52')]===0x0){return db['UserProfileResource'][_0xb84b('0x4d')]({'name':_0x442369[_0xb84b('0x2c')],'resourceId':_0x442369['id'],'type':_0x5aea9f['name'],'sectionId':_0x5aea9f['id']},{})[_0xb84b('0x26')](function(){return _0x37c0da;});}else{return _0x37c0da;}})[_0xb84b('0x47')](function(_0x532487){logger[_0xb84b('0x2a')](_0xb84b('0x53'),_0x532487);throw _0x532487;});}return _0x37c0da;});}})[_0xb84b('0x26')](respondWithResult(_0x4a0280,0xc9))[_0xb84b('0x47')](handleError(_0x4a0280,null));};exports[_0xb84b('0x24')]=function(_0x4ace4f,_0x546119){if(_0x4ace4f[_0xb84b('0x58')]['id']){delete _0x4ace4f[_0xb84b('0x58')]['id'];}return db['Dashboard'][_0xb84b('0x4c')]({'where':{'id':_0x4ace4f[_0xb84b('0x49')]['id']}})['then'](handleEntityNotFound(_0x546119,null))[_0xb84b('0x26')](saveUpdates(_0x4ace4f[_0xb84b('0x58')],null))['then'](respondWithResult(_0x546119,null))[_0xb84b('0x47')](handleError(_0x546119,null));};exports[_0xb84b('0x25')]=function(_0x4d70e6,_0x321afe){return db['Dashboard'][_0xb84b('0x4c')]({'where':{'id':_0x4d70e6[_0xb84b('0x49')]['id']}})[_0xb84b('0x26')](handleEntityNotFound(_0x321afe,null))[_0xb84b('0x26')](removeEntity(_0x321afe,null))[_0xb84b('0x47')](handleError(_0x321afe,null));};function widgetAttributes(_0x3da963){try{switch(_0x3da963[_0xb84b('0x33')]){case'iframe':return[{'name':_0xb84b('0x59'),'value':_0x3da963['attrUrl']||(_0x3da963['attrs']&&_0x3da963[_0xb84b('0x5a')][0x0]?_0x3da963[_0xb84b('0x5a')][0x0][_0xb84b('0x5b')]:undefined)||_0xb84b('0x5c')}];case _0xb84b('0x5d'):return[{'name':'attrPath','value':_0x3da963['attrPath']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x0]?_0x3da963[_0xb84b('0x5a')][0x0][_0xb84b('0x5b')]:undefined)||''}];case _0xb84b('0x5e'):return[{'name':_0xb84b('0x5f'),'value':_0x3da963[_0xb84b('0x5f')]||(_0x3da963['attrs']&&_0x3da963[_0xb84b('0x5a')][0x0]?_0x3da963['attrs'][0x0]['value']:undefined)||_0xb84b('0x60')},{'name':_0xb84b('0x61'),'value':_0x3da963[_0xb84b('0x61')]||(_0x3da963['attrs']&&_0x3da963[_0xb84b('0x5a')][0x1]?_0x3da963['attrs'][0x1][_0xb84b('0x5b')]:undefined)||_0xb84b('0x62')},{'name':_0xb84b('0x63'),'value':_0x3da963[_0xb84b('0x63')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x2]?_0x3da963[_0xb84b('0x5a')][0x2][_0xb84b('0x5b')]:undefined)||0xc}];case _0xb84b('0x64'):return[{'name':_0xb84b('0x65'),'value':_0x3da963['attrMetric']||(_0x3da963['attrs']&&_0x3da963['attrs'][0x0]?_0x3da963['attrs'][0x0][_0xb84b('0x5b')]:undefined)||_0xb84b('0x66')},{'name':_0xb84b('0x67'),'value':_0x3da963['attrVoiceQueues']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x1]?_0x3da963[_0xb84b('0x5a')][0x1][_0xb84b('0x5b')]:undefined)||[]},{'name':_0xb84b('0x63'),'value':_0x3da963[_0xb84b('0x63')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x2]?_0x3da963['attrs'][0x2][_0xb84b('0x5b')]:undefined)||0x14},{'name':_0xb84b('0x68'),'value':_0x3da963['attrChannel']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x3]?_0x3da963['attrs'][0x3][_0xb84b('0x5b')]:undefined)||_0xb84b('0x69')},{'name':'attrEmailAccounts','value':_0x3da963[_0xb84b('0x6a')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x4]?_0x3da963['attrs'][0x4][_0xb84b('0x5b')]:undefined)||''},{'name':_0xb84b('0x6b'),'value':_0x3da963[_0xb84b('0x6b')]||(_0x3da963['attrs']&&_0x3da963[_0xb84b('0x5a')][0x5]?_0x3da963['attrs'][0x5][_0xb84b('0x5b')]:undefined)||''},{'name':_0xb84b('0x6c'),'value':_0x3da963[_0xb84b('0x6c')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x6]?_0x3da963[_0xb84b('0x5a')][0x6][_0xb84b('0x5b')]:undefined)||''},{'name':_0xb84b('0x6d'),'value':_0x3da963[_0xb84b('0x6d')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x7]?_0x3da963[_0xb84b('0x5a')][0x7]['value']:undefined)||''},{'name':_0xb84b('0x6e'),'value':_0x3da963[_0xb84b('0x6e')]||(_0x3da963['attrs']&&_0x3da963[_0xb84b('0x5a')][0x8]?_0x3da963[_0xb84b('0x5a')][0x8][_0xb84b('0x5b')]:undefined)||''},{'name':_0xb84b('0x6f'),'value':_0x3da963[_0xb84b('0x6f')]||(_0x3da963['attrs']&&_0x3da963[_0xb84b('0x5a')][0x9]?_0x3da963[_0xb84b('0x5a')][0x9][_0xb84b('0x5b')]:undefined)||''}];case'multibar-chart':case _0xb84b('0x70'):return[{'name':'attrSerie1','value':_0x3da963['attrSerie1']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x0]?_0x3da963[_0xb84b('0x5a')][0x0]['value']:undefined)||'total'},{'name':'attrSerie2','value':_0x3da963[_0xb84b('0x71')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x1]?_0x3da963['attrs'][0x1][_0xb84b('0x5b')]:undefined)||null},{'name':_0xb84b('0x72'),'value':_0x3da963[_0xb84b('0x72')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x2]?_0x3da963['attrs'][0x2]['value']:undefined)||null},{'name':_0xb84b('0x67'),'value':_0x3da963[_0xb84b('0x67')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x3]?_0x3da963['attrs'][0x3][_0xb84b('0x5b')]:undefined)||[]},{'name':'attrChannel','value':_0x3da963[_0xb84b('0x68')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x4]?_0x3da963[_0xb84b('0x5a')][0x4]['value']:undefined)||_0xb84b('0x69')},{'name':_0xb84b('0x6a'),'value':_0x3da963['attrEmailAccounts']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x5]?_0x3da963['attrs'][0x5][_0xb84b('0x5b')]:undefined)||''},{'name':_0xb84b('0x6b'),'value':_0x3da963['attrFaxAccounts']||(_0x3da963['attrs']&&_0x3da963[_0xb84b('0x5a')][0x6]?_0x3da963[_0xb84b('0x5a')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x3da963['attrSmsAccounts']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x7]?_0x3da963['attrs'][0x7][_0xb84b('0x5b')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x3da963[_0xb84b('0x6d')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x8]?_0x3da963['attrs'][0x8][_0xb84b('0x5b')]:undefined)||''},{'name':_0xb84b('0x6e'),'value':_0x3da963['attrWhatsappAccounts']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x9]?_0x3da963[_0xb84b('0x5a')][0x9][_0xb84b('0x5b')]:undefined)||''},{'name':'attrChatWebsites','value':_0x3da963['attrChatWebsites']||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0xa]?_0x3da963[_0xb84b('0x5a')][0xa][_0xb84b('0x5b')]:undefined)||''}];case _0xb84b('0x73'):return[{'name':_0xb84b('0x74'),'type':_0x3da963[_0xb84b('0x75')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x0]?_0x3da963['attrs'][0x0][_0xb84b('0x33')]:undefined)||null,'value':_0x3da963[_0xb84b('0x74')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963['attrs'][0x0]?_0x3da963[_0xb84b('0x5a')][0x0]['value']:undefined)||null},{'name':_0xb84b('0x76'),'value':_0x3da963[_0xb84b('0x76')]||(_0x3da963[_0xb84b('0x5a')]&&_0x3da963[_0xb84b('0x5a')][0x1]?_0x3da963[_0xb84b('0x5a')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x3a4d5e){logger[_0xb84b('0x2a')]('widgetAttributes:\x20%s',JSON[_0xb84b('0x77')](_0x3a4d5e));return[];}}exports[_0xb84b('0x78')]=function(_0x323695,_0x47c39f,_0x520ade){if(_0x323695[_0xb84b('0x58')]['id']){delete _0x323695[_0xb84b('0x58')]['id'];}return db[_0xb84b('0x30')][_0xb84b('0x4c')]({'where':{'id':_0x323695[_0xb84b('0x49')]['id']}})[_0xb84b('0x26')](handleEntityNotFound(_0x47c39f,null))['then'](function(_0x4079a0){if(_0x4079a0){_0x323695['body'][_0xb84b('0x79')]=_0x4079a0['id'];_0x323695[_0xb84b('0x58')][_0xb84b('0x5a')]=widgetAttributes(_0x323695[_0xb84b('0x58')]);return db[_0xb84b('0x7a')][_0xb84b('0x4d')](_0x323695[_0xb84b('0x58')]);}})[_0xb84b('0x26')](respondWithResult(_0x47c39f,null))['catch'](handleError(_0x47c39f,null));};exports[_0xb84b('0x7b')]=function(_0x5dadd7,_0x3cf7dc,_0x2ab47b){var _0x709cf2={};var _0x457976={};var _0x49457c;var _0x2cff40;return db['Dashboard']['findOne']({'where':{'id':_0x5dadd7[_0xb84b('0x49')]['id']}})[_0xb84b('0x26')](handleEntityNotFound(_0x3cf7dc,null))[_0xb84b('0x26')](function(_0x5b740d){if(_0x5b740d){_0x49457c=_0x5b740d;_0x457976[_0xb84b('0x35')]=_[_0xb84b('0x4a')](db[_0xb84b('0x7a')][_0xb84b('0x31')]);_0x457976[_0xb84b('0x36')]=_[_0xb84b('0x4a')](_0x5dadd7['query']);_0x457976['filters']=_['intersection'](_0x457976['model'],_0x457976[_0xb84b('0x36')]);_0x709cf2[_0xb84b('0x39')]=_[_0xb84b('0x38')](_0x457976[_0xb84b('0x35')],qs[_0xb84b('0x3a')](_0x5dadd7['query'][_0xb84b('0x3a')]));_0x709cf2[_0xb84b('0x39')]=_0x709cf2[_0xb84b('0x39')]['length']?_0x709cf2[_0xb84b('0x39')]:_0x457976[_0xb84b('0x35')];_0x709cf2[_0xb84b('0x7c')]=qs[_0xb84b('0x3d')](_0x5dadd7[_0xb84b('0x36')][_0xb84b('0x3d')]);_0x709cf2[_0xb84b('0x43')]=qs[_0xb84b('0x37')](_['pick'](_0x5dadd7[_0xb84b('0x36')],_0x457976[_0xb84b('0x37')]));if(_0x5dadd7[_0xb84b('0x36')][_0xb84b('0x3f')]){_0x709cf2[_0xb84b('0x43')]=_[_0xb84b('0x40')](_0x709cf2[_0xb84b('0x43')],{'$or':_[_0xb84b('0x2f')](_0x709cf2[_0xb84b('0x39')],function(_0x415000){var _0x41802b={};_0x41802b[_0x415000]={'$like':'%'+_0x5dadd7[_0xb84b('0x36')]['filter']+'%'};return _0x41802b;})});}_0x709cf2=_[_0xb84b('0x40')]({},_0x709cf2,_0x5dadd7[_0xb84b('0x42')]);return _0x49457c[_0xb84b('0x7b')](_0x709cf2);}})[_0xb84b('0x26')](function(_0x42fc1a){if(_0x42fc1a){_0x2cff40=_0x42fc1a[_0xb84b('0x4b')];if(!_0x5dadd7['query'][_0xb84b('0x3b')](_0xb84b('0x3c'))){_0x709cf2[_0xb84b('0x1e')]=qs[_0xb84b('0x1e')](_0x5dadd7['query'][_0xb84b('0x1e')]);_0x709cf2[_0xb84b('0x1c')]=qs['offset'](_0x5dadd7[_0xb84b('0x36')][_0xb84b('0x1c')]);}return _0x49457c[_0xb84b('0x7b')](_0x709cf2);}})[_0xb84b('0x26')](function(_0x1acfef){if(_0x1acfef){return _0x1acfef?{'count':_0x2cff40,'rows':_0x1acfef}:null;}})[_0xb84b('0x26')](respondWithResult(_0x3cf7dc,null))['catch'](handleError(_0x3cf7dc,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index e286034..95f9419 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 _0x21bd=['exports','events','../../mysqldb','Dashboard','save','update','remove','emit','hasOwnProperty'];(function(_0x22e95c,_0x4207f3){var _0x4ea309=function(_0x42b451){while(--_0x42b451){_0x22e95c['push'](_0x22e95c['shift']());}};_0x4ea309(++_0x4207f3);}(_0x21bd,0x157));var _0xd21b=function(_0x44764d,_0x2e3275){_0x44764d=_0x44764d-0x0;var _0x3c8c4f=_0x21bd[_0x44764d];return _0x3c8c4f;};'use strict';var EventEmitter=require(_0xd21b('0x0'));var Dashboard=require(_0xd21b('0x1'))['db'][_0xd21b('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd21b('0x3'),'afterUpdate':_0xd21b('0x4'),'afterDestroy':_0xd21b('0x5')};function emitEvent(_0xcab9a3){return function(_0x579393,_0x2792a1,_0x4871ff){DashboardEvents['emit'](_0xcab9a3+':'+_0x579393['id'],_0x579393);DashboardEvents[_0xd21b('0x6')](_0xcab9a3,_0x579393);_0x4871ff(null);};}for(var e in events){if(events[_0xd21b('0x7')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xd21b('0x8')]=DashboardEvents; \ No newline at end of file +var _0xd08c=['hasOwnProperty','hook','exports','Dashboard','save','remove'];(function(_0x4dff8a,_0x390f72){var _0x26c892=function(_0x213e0d){while(--_0x213e0d){_0x4dff8a['push'](_0x4dff8a['shift']());}};_0x26c892(++_0x390f72);}(_0xd08c,0x13b));var _0xcd08=function(_0x86ed6b,_0x1012fb){_0x86ed6b=_0x86ed6b-0x0;var _0x67b2bf=_0xd08c[_0x86ed6b];return _0x67b2bf;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db'][_0xcd08('0x0')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd08('0x1'),'afterUpdate':'update','afterDestroy':_0xcd08('0x2')};function emitEvent(_0x19d03b){return function(_0x279c06,_0x97758d,_0x38dc98){DashboardEvents['emit'](_0x19d03b+':'+_0x279c06['id'],_0x279c06);DashboardEvents['emit'](_0x19d03b,_0x279c06);_0x38dc98(null);};}for(var e in events){if(events[_0xcd08('0x3')](e)){var event=events[e];Dashboard[_0xcd08('0x4')](e,emitEvent(event));}}module[_0xcd08('0x5')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index e4685b6..17f20ec 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 _0xf0b4=['request-promise','path','rimraf','../../config/environment','./dashboard.attributes','define','Dashboard','lodash','util','../../config/logger','bluebird'];(function(_0x17e1f7,_0x2894ad){var _0x1ac7ea=function(_0x504c10){while(--_0x504c10){_0x17e1f7['push'](_0x17e1f7['shift']());}};_0x1ac7ea(++_0x2894ad);}(_0xf0b4,0x193));var _0x4f0b=function(_0x237a97,_0x3c67df){_0x237a97=_0x237a97-0x0;var _0x445729=_0xf0b4[_0x237a97];return _0x445729;};'use strict';var _=require(_0x4f0b('0x0'));var util=require(_0x4f0b('0x1'));var logger=require(_0x4f0b('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4f0b('0x3'));var rp=require(_0x4f0b('0x4'));var fs=require('fs');var path=require(_0x4f0b('0x5'));var rimraf=require(_0x4f0b('0x6'));var config=require(_0x4f0b('0x7'));var attributes=require(_0x4f0b('0x8'));module['exports']=function(_0xd9b2,_0x20bb37){return _0xd9b2[_0x4f0b('0x9')](_0x4f0b('0xa'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc662=['Dashboard','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x1d18c2,_0x3413e3){var _0x40cecd=function(_0x2eeacf){while(--_0x2eeacf){_0x1d18c2['push'](_0x1d18c2['shift']());}};_0x40cecd(++_0x3413e3);}(_0xc662,0xc6));var _0x2c66=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xc662[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x2c66('0x0'));var util=require(_0x2c66('0x1'));var logger=require(_0x2c66('0x2'))(_0x2c66('0x3'));var moment=require(_0x2c66('0x4'));var BPromise=require(_0x2c66('0x5'));var rp=require(_0x2c66('0x6'));var fs=require('fs');var path=require(_0x2c66('0x7'));var rimraf=require(_0x2c66('0x8'));var config=require(_0x2c66('0x9'));var attributes=require('./dashboard.attributes');module[_0x2c66('0xa')]=function(_0xa7b235,_0x52ed35){return _0xa7b235[_0x2c66('0xb')](_0x2c66('0xc'),attributes,{'tableName':_0x2c66('0xd'),'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 d6455b8..25e2ed7 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 _0x811d=['error','code','message','catch','lodash','ioredis','jayson/promise','client','http','redis','defaults','localhost','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4c5ea1,_0x5438d0){var _0x18016c=function(_0x478cb2){while(--_0x478cb2){_0x4c5ea1['push'](_0x4c5ea1['shift']());}};_0x18016c(++_0x5438d0);}(_0x811d,0x10c));var _0xd811=function(_0x1a1baf,_0x32d99e){_0x1a1baf=_0x1a1baf-0x0;var _0x256a81=_0x811d[_0x1a1baf];return _0x256a81;};'use strict';var _=require(_0xd811('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd811('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd811('0x2'));var client=jayson[_0xd811('0x3')][_0xd811('0x4')]({'port':0x232a});config[_0xd811('0x5')]=_[_0xd811('0x6')](config[_0xd811('0x5')],{'host':_0xd811('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd811('0x5')]));require(_0xd811('0x8'))[_0xd811('0x9')](socket);function respondWithRpcPromise(_0x140fc7,_0x29c87c,_0x15eaef){return new BPromise(function(_0x3087ae,_0x51b7e3){return client[_0xd811('0xa')](_0x140fc7,_0x15eaef)[_0xd811('0xb')](function(_0x51f67a){logger[_0xd811('0xc')](_0xd811('0xd'),_0x29c87c,_0xd811('0xe'));logger[_0xd811('0xf')](_0xd811('0x10'),_0x29c87c,_0xd811('0xe'),JSON[_0xd811('0x11')](_0x51f67a));if(_0x51f67a[_0xd811('0x12')]){if(_0x51f67a[_0xd811('0x12')][_0xd811('0x13')]===0x1f4){logger[_0xd811('0x12')](_0xd811('0xd'),_0x29c87c,_0x51f67a[_0xd811('0x12')][_0xd811('0x14')]);return _0x51b7e3(_0x51f67a[_0xd811('0x12')][_0xd811('0x14')]);}logger[_0xd811('0x12')](_0xd811('0xd'),_0x29c87c,_0x51f67a[_0xd811('0x12')][_0xd811('0x14')]);return _0x3087ae(_0x51f67a[_0xd811('0x12')][_0xd811('0x14')]);}else{logger[_0xd811('0xc')](_0xd811('0xd'),_0x29c87c,_0xd811('0xe'));_0x3087ae(_0x51f67a['result']['message']);}})[_0xd811('0x15')](function(_0x238132){logger['error'](_0xd811('0xd'),_0x29c87c,_0x238132);_0x51b7e3(_0x238132);});});} \ No newline at end of file +var _0x910d=['stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x5b26be,_0x24893b){var _0x4c02c9=function(_0x17dac2){while(--_0x17dac2){_0x5b26be['push'](_0x5b26be['shift']());}};_0x4c02c9(++_0x24893b);}(_0x910d,0x11e));var _0xd910=function(_0x1a9e78,_0x426c88){_0x1a9e78=_0x1a9e78-0x0;var _0x25cd28=_0x910d[_0x1a9e78];return _0x25cd28;};'use strict';var _=require(_0xd910('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd910('0x1'));var rs=require(_0xd910('0x2'));var fs=require('fs');var Redis=require(_0xd910('0x3'));var db=require(_0xd910('0x4'))['db'];var utils=require(_0xd910('0x5'));var logger=require(_0xd910('0x6'))(_0xd910('0x7'));var config=require(_0xd910('0x8'));var jayson=require(_0xd910('0x9'));var client=jayson[_0xd910('0xa')][_0xd910('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd910('0xc')],{'host':_0xd910('0xd'),'port':0x18eb});var socket=require(_0xd910('0xe'))(new Redis(config['redis']));require('./dashboard.socket')[_0xd910('0xf')](socket);function respondWithRpcPromise(_0x1965b1,_0x4f20e9,_0x457e5c){return new BPromise(function(_0x2be54a,_0xfe438b){return client[_0xd910('0x10')](_0x1965b1,_0x457e5c)['then'](function(_0xe399c2){logger[_0xd910('0x11')](_0xd910('0x12'),_0x4f20e9,_0xd910('0x13'));logger[_0xd910('0x14')](_0xd910('0x15'),_0x4f20e9,_0xd910('0x13'),JSON[_0xd910('0x16')](_0xe399c2));if(_0xe399c2[_0xd910('0x17')]){if(_0xe399c2[_0xd910('0x17')][_0xd910('0x18')]===0x1f4){logger[_0xd910('0x17')]('Dashboard,\x20%s,\x20%s',_0x4f20e9,_0xe399c2[_0xd910('0x17')][_0xd910('0x19')]);return _0xfe438b(_0xe399c2[_0xd910('0x17')][_0xd910('0x19')]);}logger[_0xd910('0x17')]('Dashboard,\x20%s,\x20%s',_0x4f20e9,_0xe399c2[_0xd910('0x17')][_0xd910('0x19')]);return _0x2be54a(_0xe399c2[_0xd910('0x17')][_0xd910('0x19')]);}else{logger[_0xd910('0x11')](_0xd910('0x12'),_0x4f20e9,'request\x20sent');_0x2be54a(_0xe399c2[_0xd910('0x1a')][_0xd910('0x19')]);}})[_0xd910('0x1b')](function(_0x29c6b5){logger[_0xd910('0x17')](_0xd910('0x12'),_0x4f20e9,_0x29c6b5);_0xfe438b(_0x29c6b5);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 877137f..caed712 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 _0xbaa4=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','register'];(function(_0x57de2e,_0x43b244){var _0x17c67e=function(_0x469965){while(--_0x469965){_0x57de2e['push'](_0x57de2e['shift']());}};_0x17c67e(++_0x43b244);}(_0xbaa4,0x69));var _0x4baa=function(_0x520ed9,_0x4af05a){_0x520ed9=_0x520ed9-0x0;var _0x1aaece=_0xbaa4[_0x520ed9];return _0x1aaece;};'use strict';var DashboardEvents=require(_0x4baa('0x0'));var events=[_0x4baa('0x1'),_0x4baa('0x2'),_0x4baa('0x3')];function createListener(_0x445cbc,_0xd9cc8d){return function(_0x5cbbe9){_0xd9cc8d[_0x4baa('0x4')](_0x445cbc,_0x5cbbe9);};}function removeListener(_0x2636dd,_0x2f55cd){return function(){DashboardEvents[_0x4baa('0x5')](_0x2636dd,_0x2f55cd);};}exports[_0x4baa('0x6')]=function(_0x2b1c48){for(var _0x1790bd=0x0,_0x273979=events['length'];_0x1790bd<_0x273979;_0x1790bd++){var _0x53da1e=events[_0x1790bd];var _0xae69d0=createListener(_0x4baa('0x7')+_0x53da1e,_0x2b1c48);DashboardEvents['on'](_0x53da1e,_0xae69d0);}}; \ No newline at end of file +var _0xfc8d=['./dashboard.events','save','remove','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc8d,0x138));var _0xdfc8=function(_0x4040d5,_0x482d13){_0x4040d5=_0x4040d5-0x0;var _0x230d7a=_0xfc8d[_0x4040d5];return _0x230d7a;};'use strict';var DashboardEvents=require(_0xdfc8('0x0'));var events=[_0xdfc8('0x1'),_0xdfc8('0x2'),'update'];function createListener(_0x534b37,_0x340051){return function(_0x310b39){_0x340051[_0xdfc8('0x3')](_0x534b37,_0x310b39);};}function removeListener(_0x2a48c7,_0x3e1709){return function(){DashboardEvents[_0xdfc8('0x4')](_0x2a48c7,_0x3e1709);};}exports[_0xdfc8('0x5')]=function(_0x4ba47c){for(var _0x1f3a5f=0x0,_0x1d3475=events['length'];_0x1f3a5f<_0x1d3475;_0x1f3a5f++){var _0x36dc46=events[_0x1f3a5f];var _0x52afe8=createListener('dashboard:'+_0x36dc46,_0x4ba47c);DashboardEvents['on'](_0x36dc46,_0x52afe8);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index efbdc17..dbe5a3b 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 _0x1ec9=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','show','/:id/items','create','/:id/clone','clone','post','addItem','update','delete','destroy','exports'];(function(_0x585c74,_0xe5b892){var _0x439591=function(_0x467de0){while(--_0x467de0){_0x585c74['push'](_0x585c74['shift']());}};_0x439591(++_0xe5b892);}(_0x1ec9,0x9a));var _0x91ec=function(_0x14c581,_0x2e7cff){_0x14c581=_0x14c581-0x0;var _0x1c44eb=_0x1ec9[_0x14c581];return _0x1c44eb;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x91ec('0x0'));var express=require(_0x91ec('0x1'));var router=express[_0x91ec('0x2')]();var fs_extra=require(_0x91ec('0x3'));var auth=require(_0x91ec('0x4'));var interaction=require(_0x91ec('0x5'));var config=require(_0x91ec('0x6'));var controller=require(_0x91ec('0x7'));router[_0x91ec('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91ec('0x8')](_0x91ec('0x9'),auth[_0x91ec('0xa')](),controller[_0x91ec('0xb')]);router[_0x91ec('0x8')](_0x91ec('0xc'),auth[_0x91ec('0xa')](),controller['getItems']);router['post']('/',auth[_0x91ec('0xa')](),controller[_0x91ec('0xd')]);router['post'](_0x91ec('0xe'),auth[_0x91ec('0xa')](),controller[_0x91ec('0xf')]);router[_0x91ec('0x10')]('/:id/items',auth['isAuthenticated'](),controller[_0x91ec('0x11')]);router['put']('/:id',auth[_0x91ec('0xa')](),controller[_0x91ec('0x12')]);router[_0x91ec('0x13')]('/:id',auth[_0x91ec('0xa')](),controller[_0x91ec('0x14')]);module[_0x91ec('0x15')]=router; \ No newline at end of file +var _0x9be0=['get','isAuthenticated','index','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller'];(function(_0x455ed1,_0x22bcd6){var _0x4e6145=function(_0x561519){while(--_0x561519){_0x455ed1['push'](_0x455ed1['shift']());}};_0x4e6145(++_0x22bcd6);}(_0x9be0,0x1f0));var _0x09be=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9be0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x09be('0x0'));var path=require('path');var timeout=require(_0x09be('0x1'));var express=require('express');var router=express[_0x09be('0x2')]();var fs_extra=require(_0x09be('0x3'));var auth=require(_0x09be('0x4'));var interaction=require(_0x09be('0x5'));var config=require(_0x09be('0x6'));var controller=require(_0x09be('0x7'));router[_0x09be('0x8')]('/',auth[_0x09be('0x9')](),controller[_0x09be('0xa')]);router[_0x09be('0x8')](_0x09be('0xb'),auth[_0x09be('0x9')](),controller[_0x09be('0xc')]);router[_0x09be('0x8')](_0x09be('0xd'),auth[_0x09be('0x9')](),controller[_0x09be('0xe')]);router[_0x09be('0xf')]('/',auth[_0x09be('0x9')](),controller[_0x09be('0x10')]);router[_0x09be('0xf')](_0x09be('0x11'),auth['isAuthenticated'](),controller[_0x09be('0x12')]);router[_0x09be('0xf')](_0x09be('0xd'),auth[_0x09be('0x9')](),controller[_0x09be('0x13')]);router[_0x09be('0x14')]('/:id',auth[_0x09be('0x9')](),controller[_0x09be('0x15')]);router[_0x09be('0x16')](_0x09be('0xb'),auth[_0x09be('0x9')](),controller['destroy']);module[_0x09be('0x17')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index ef155de..6432042 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 _0x5d17=['#ffffff','sequelize','squel','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x5d17,0x114));var _0x75d1=function(_0x56a871,_0x18b7fe){_0x56a871=_0x56a871-0x0;var _0x124954=_0x5d17[_0x56a871];return _0x124954;};'use strict';var Sequelize=require(_0x75d1('0x0'));var squel=require(_0x75d1('0x1'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x75d1('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x75d1('0x3')]('long'),'get':function(){try{return JSON[_0x75d1('0x4')](this[_0x75d1('0x5')](_0x75d1('0x6')));}catch(_0x32bd45){return[];}},'set':function(_0x56ac0a){try{this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')](_0x56ac0a));}catch(_0x1ee61b){this[_0x75d1('0x7')](_0x75d1('0x6'),JSON[_0x75d1('0x8')]([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x75d1('0x9')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x75d1('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x75d1('0x2')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x75d1('0x2')]},'titleFontSize':{'type':Sequelize[_0x75d1('0x9')],'defaultValue':0xc}}; \ No newline at end of file +var _0x0295=['#ffffff','sequelize','exports','TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','STRING'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0x0295,0x1f0));var _0x5029=function(_0x1c7377,_0x8a8698){_0x1c7377=_0x1c7377-0x0;var _0x5d03e3=_0x0295[_0x1c7377];return _0x5d03e3;};'use strict';var Sequelize=require(_0x5029('0x0'));var squel=require('squel');var _=require('lodash');module[_0x5029('0x1')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5029('0x2')](_0x5029('0x3')),'get':function(){try{return JSON[_0x5029('0x4')](this[_0x5029('0x5')](_0x5029('0x6')));}catch(_0x69a497){return[];}},'set':function(_0x200217){try{this[_0x5029('0x7')](_0x5029('0x6'),JSON['stringify'](_0x200217));}catch(_0x54978f){this['setDataValue'](_0x5029('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5029('0x8')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5029('0x8')]},'col':{'type':Sequelize['INTEGER']},'background':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':_0x5029('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5029('0x9')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5029('0x9')]},'titleFontSize':{'type':Sequelize[_0x5029('0x8')],'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 ed5fb3e..345aade 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 _0xed20=['web-report','reportType','type','attrReport','attrRefresh','error','widgetAttributes:\x20%s','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','stack','send','show','keys','DashboardItem','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','destroy','params','iframe','attrUrl','attrs','value','attrPath','attrHourFormat','HH:mm:ss','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','voice'];(function(_0x3c378a,_0x57df7a){var _0x5a8a01=function(_0x29c034){while(--_0x29c034){_0x3c378a['push'](_0x3c378a['shift']());}};_0x5a8a01(++_0x57df7a);}(_0xed20,0xce));var _0x0ed2=function(_0x3f233b,_0x45a0a5){_0x3f233b=_0x3f233b-0x0;var _0xb7baca=_0xed20[_0x3f233b];return _0xb7baca;};'use strict';var emlformat=require(_0x0ed2('0x0'));var rimraf=require(_0x0ed2('0x1'));var zipdir=require(_0x0ed2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0ed2('0x3'));var moment=require(_0x0ed2('0x4'));var BPromise=require(_0x0ed2('0x5'));var Mustache=require(_0x0ed2('0x6'));var util=require(_0x0ed2('0x7'));var path=require(_0x0ed2('0x8'));var sox=require('sox');var csv=require(_0x0ed2('0x9'));var ejs=require(_0x0ed2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0ed2('0xb'));var squel=require(_0x0ed2('0xc'));var crypto=require(_0x0ed2('0xd'));var jsforce=require(_0x0ed2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0ed2('0x9'));var querystring=require(_0x0ed2('0xf'));var Papa=require(_0x0ed2('0x10'));var Redis=require(_0x0ed2('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0ed2('0x12'));var hardwareService=require(_0x0ed2('0x13'));var logger=require(_0x0ed2('0x14'))(_0x0ed2('0x15'));var utils=require(_0x0ed2('0x16'));var config=require(_0x0ed2('0x17'));var licenseUtil=require(_0x0ed2('0x18'));var db=require(_0x0ed2('0x19'))['db'];config[_0x0ed2('0x1a')]=_[_0x0ed2('0x1b')](config[_0x0ed2('0x1a')],{'host':_0x0ed2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0ed2('0x1a')]));require(_0x0ed2('0x1d'))[_0x0ed2('0x1e')](socket);function respondWithStatusCode(_0x11b884,_0xcbed53){_0xcbed53=_0xcbed53||0xcc;return function(_0x4be1ad){if(_0x4be1ad){return _0x11b884[_0x0ed2('0x1f')](_0xcbed53);}return _0x11b884[_0x0ed2('0x20')](_0xcbed53)[_0x0ed2('0x21')]();};}function respondWithResult(_0x5101f2,_0x41bea7){_0x41bea7=_0x41bea7||0xc8;return function(_0x565cc7){if(_0x565cc7){return _0x5101f2[_0x0ed2('0x20')](_0x41bea7)[_0x0ed2('0x22')](_0x565cc7);}};}function respondWithFilteredResult(_0xc0f621,_0x4c2726){return function(_0x50c142){if(_0x50c142){var _0x90b88e=typeof _0x4c2726[_0x0ed2('0x23')]==='undefined'&&typeof _0x4c2726[_0x0ed2('0x24')]==='undefined';var _0x25e4dc=_0x50c142[_0x0ed2('0x25')];var _0x4d5c76=_0x90b88e?0x0:_0x4c2726['offset'];var _0x585ac1=_0x90b88e?_0x50c142[_0x0ed2('0x25')]:_0x4c2726[_0x0ed2('0x23')]+_0x4c2726[_0x0ed2('0x24')];var _0x1206e3;if(_0x585ac1>=_0x25e4dc){_0x585ac1=_0x25e4dc;_0x1206e3=0xc8;}else{_0x1206e3=0xce;}_0xc0f621[_0x0ed2('0x20')](_0x1206e3);return _0xc0f621[_0x0ed2('0x26')](_0x0ed2('0x27'),_0x4d5c76+'-'+_0x585ac1+'/'+_0x25e4dc)['json'](_0x50c142);}return null;};}function patchUpdates(_0x4c1dbd){return function(_0x41f251){try{jsonpatch[_0x0ed2('0x28')](_0x41f251,_0x4c1dbd,!![]);}catch(_0x7a3157){return BPromise[_0x0ed2('0x29')](_0x7a3157);}return _0x41f251[_0x0ed2('0x2a')]();};}function saveUpdates(_0x306f97,_0x311261){return function(_0x1d742c){if(_0x1d742c){return _0x1d742c['update'](_0x306f97)[_0x0ed2('0x2b')](function(_0x24983e){return _0x24983e;});}return null;};}function removeEntity(_0x1abc6f,_0x19ffde){return function(_0x466b49){if(_0x466b49){return _0x466b49['destroy']()[_0x0ed2('0x2b')](function(){_0x1abc6f[_0x0ed2('0x20')](0xcc)[_0x0ed2('0x21')]();});}};}function handleEntityNotFound(_0x182471,_0x2faa62){return function(_0xe5cacc){if(!_0xe5cacc){_0x182471[_0x0ed2('0x1f')](0x194);}return _0xe5cacc;};}function handleError(_0x1d90ee,_0x1e62a8){_0x1e62a8=_0x1e62a8||0x1f4;return function(_0x1e6efe){logger['error'](_0x1e6efe[_0x0ed2('0x2c')]);if(_0x1e6efe['name']){delete _0x1e6efe['name'];}_0x1d90ee[_0x0ed2('0x20')](_0x1e62a8)[_0x0ed2('0x2d')](_0x1e6efe);};}exports[_0x0ed2('0x2e')]=function(_0x236c7a,_0x2a9b01){var _0xc0c69a={'raw':![],'where':{'id':_0x236c7a['params']['id']}},_0x5b7bf9={};_0x5b7bf9['model']=_[_0x0ed2('0x2f')](db[_0x0ed2('0x30')][_0x0ed2('0x31')]);_0x5b7bf9[_0x0ed2('0x32')]=_['keys'](_0x236c7a[_0x0ed2('0x32')]);_0x5b7bf9['filters']=_[_0x0ed2('0x33')](_0x5b7bf9[_0x0ed2('0x34')],_0x5b7bf9['query']);_0xc0c69a[_0x0ed2('0x35')]=_['intersection'](_0x5b7bf9[_0x0ed2('0x34')],qs[_0x0ed2('0x36')](_0x236c7a[_0x0ed2('0x32')][_0x0ed2('0x36')]));_0xc0c69a['attributes']=_0xc0c69a[_0x0ed2('0x35')][_0x0ed2('0x37')]?_0xc0c69a['attributes']:_0x5b7bf9[_0x0ed2('0x34')];if(_0x236c7a[_0x0ed2('0x32')][_0x0ed2('0x38')]){_0xc0c69a[_0x0ed2('0x39')]=[{'all':!![]}];}_0xc0c69a=_[_0x0ed2('0x3a')]({},_0xc0c69a,_0x236c7a[_0x0ed2('0x3b')]);return db[_0x0ed2('0x30')][_0x0ed2('0x3c')](_0xc0c69a)[_0x0ed2('0x2b')](handleEntityNotFound(_0x2a9b01,null))[_0x0ed2('0x2b')](respondWithResult(_0x2a9b01,null))[_0x0ed2('0x3d')](handleError(_0x2a9b01,null));};exports[_0x0ed2('0x3e')]=function(_0x58a3ad,_0x533114){return db[_0x0ed2('0x30')]['find']({'where':{'id':_0x58a3ad[_0x0ed2('0x3f')]['id']}})[_0x0ed2('0x2b')](handleEntityNotFound(_0x533114,null))[_0x0ed2('0x2b')](removeEntity(_0x533114,null))[_0x0ed2('0x3d')](handleError(_0x533114,null));};function widgetAttributes(_0x344661){try{switch(_0x344661['type']){case _0x0ed2('0x40'):return[{'name':_0x0ed2('0x41'),'value':_0x344661[_0x0ed2('0x41')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x0]?_0x344661[_0x0ed2('0x42')][0x0][_0x0ed2('0x43')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x344661[_0x0ed2('0x44')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x0]?_0x344661['attrs'][0x0][_0x0ed2('0x43')]:undefined)||''}];case'clock':return[{'name':_0x0ed2('0x45'),'value':_0x344661[_0x0ed2('0x45')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x0]?_0x344661[_0x0ed2('0x42')][0x0][_0x0ed2('0x43')]:undefined)||_0x0ed2('0x46')},{'name':'attrTimezone','value':_0x344661['attrTimezone']||(_0x344661[_0x0ed2('0x42')]&&_0x344661['attrs'][0x1]?_0x344661[_0x0ed2('0x42')][0x1][_0x0ed2('0x43')]:undefined)||'0.00'},{'name':_0x0ed2('0x47'),'value':_0x344661[_0x0ed2('0x47')]||(_0x344661['attrs']&&_0x344661[_0x0ed2('0x42')][0x2]?_0x344661[_0x0ed2('0x42')][0x2]['value']:undefined)||0xc}];case _0x0ed2('0x48'):return[{'name':'attrMetric','value':_0x344661[_0x0ed2('0x49')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x0]?_0x344661['attrs'][0x0]['value']:undefined)||_0x0ed2('0x4a')},{'name':_0x0ed2('0x4b'),'value':_0x344661[_0x0ed2('0x4b')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661['attrs'][0x1]?_0x344661['attrs'][0x1][_0x0ed2('0x43')]:undefined)||[]},{'name':'attrFontSize','value':_0x344661[_0x0ed2('0x47')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x2]?_0x344661[_0x0ed2('0x42')][0x2][_0x0ed2('0x43')]:undefined)||0x14},{'name':'attrChannel','value':_0x344661[_0x0ed2('0x4c')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661['attrs'][0x3]?_0x344661[_0x0ed2('0x42')][0x3]['value']:undefined)||'voice'},{'name':_0x0ed2('0x4d'),'value':_0x344661[_0x0ed2('0x4d')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x4]?_0x344661[_0x0ed2('0x42')][0x4]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x344661[_0x0ed2('0x4e')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x5]?_0x344661[_0x0ed2('0x42')][0x5][_0x0ed2('0x43')]:undefined)||''},{'name':_0x0ed2('0x4f'),'value':_0x344661[_0x0ed2('0x4f')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x6]?_0x344661[_0x0ed2('0x42')][0x6][_0x0ed2('0x43')]:undefined)||''},{'name':_0x0ed2('0x50'),'value':_0x344661[_0x0ed2('0x50')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x7]?_0x344661[_0x0ed2('0x42')][0x7][_0x0ed2('0x43')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x344661[_0x0ed2('0x51')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x8]?_0x344661['attrs'][0x8][_0x0ed2('0x43')]:undefined)||''},{'name':'attrChatWebsites','value':_0x344661[_0x0ed2('0x52')]||(_0x344661['attrs']&&_0x344661[_0x0ed2('0x42')][0x9]?_0x344661[_0x0ed2('0x42')][0x9][_0x0ed2('0x43')]:undefined)||''}];case _0x0ed2('0x53'):case'pie-chart':return[{'name':'attrSerie1','value':_0x344661[_0x0ed2('0x54')]||(_0x344661['attrs']&&_0x344661[_0x0ed2('0x42')][0x0]?_0x344661[_0x0ed2('0x42')][0x0][_0x0ed2('0x43')]:undefined)||'total'},{'name':_0x0ed2('0x55'),'value':_0x344661['attrSerie2']||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x1]?_0x344661[_0x0ed2('0x42')][0x1][_0x0ed2('0x43')]:undefined)||null},{'name':_0x0ed2('0x56'),'value':_0x344661[_0x0ed2('0x56')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x2]?_0x344661['attrs'][0x2][_0x0ed2('0x43')]:undefined)||null},{'name':_0x0ed2('0x4b'),'value':_0x344661[_0x0ed2('0x4b')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x3]?_0x344661[_0x0ed2('0x42')][0x3][_0x0ed2('0x43')]:undefined)||[]},{'name':_0x0ed2('0x4c'),'value':_0x344661[_0x0ed2('0x4c')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661['attrs'][0x4]?_0x344661[_0x0ed2('0x42')][0x4][_0x0ed2('0x43')]:undefined)||_0x0ed2('0x57')},{'name':_0x0ed2('0x4d'),'value':_0x344661[_0x0ed2('0x4d')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x5]?_0x344661[_0x0ed2('0x42')][0x5][_0x0ed2('0x43')]:undefined)||''},{'name':_0x0ed2('0x4e'),'value':_0x344661[_0x0ed2('0x4e')]||(_0x344661['attrs']&&_0x344661[_0x0ed2('0x42')][0x6]?_0x344661['attrs'][0x6]['value']:undefined)||''},{'name':_0x0ed2('0x4f'),'value':_0x344661['attrSmsAccounts']||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x7]?_0x344661['attrs'][0x7][_0x0ed2('0x43')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x344661[_0x0ed2('0x50')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x8]?_0x344661[_0x0ed2('0x42')][0x8][_0x0ed2('0x43')]:undefined)||''},{'name':_0x0ed2('0x51'),'value':_0x344661['attrWhatsappAccounts']||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x9]?_0x344661['attrs'][0x9][_0x0ed2('0x43')]:undefined)||''},{'name':_0x0ed2('0x52'),'value':_0x344661[_0x0ed2('0x52')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661['attrs'][0xa]?_0x344661[_0x0ed2('0x42')][0xa]['value']:undefined)||''}];case _0x0ed2('0x58'):return[{'name':'attrReport','type':_0x344661[_0x0ed2('0x59')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661['attrs'][0x0]?_0x344661[_0x0ed2('0x42')][0x0][_0x0ed2('0x5a')]:undefined)||null,'value':_0x344661[_0x0ed2('0x5b')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x0]?_0x344661[_0x0ed2('0x42')][0x0][_0x0ed2('0x43')]:undefined)||null},{'name':_0x0ed2('0x5c'),'value':_0x344661[_0x0ed2('0x5c')]||(_0x344661[_0x0ed2('0x42')]&&_0x344661[_0x0ed2('0x42')][0x1]?_0x344661['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x56fd26){logger[_0x0ed2('0x5d')](_0x0ed2('0x5e'),JSON['stringify'](_0x56fd26));return[];}}exports[_0x0ed2('0x5f')]=function(_0x1a404f,_0x16a781){if(_0x1a404f[_0x0ed2('0x60')]){_0x1a404f[_0x0ed2('0x60')]['attrs']=widgetAttributes(_0x1a404f['body']);}return db[_0x0ed2('0x30')][_0x0ed2('0x5f')](_0x1a404f['body'],{})[_0x0ed2('0x2b')](respondWithResult(_0x16a781,0xc9))['catch'](handleError(_0x16a781,null));};exports[_0x0ed2('0x61')]=function(_0x299023,_0x19639a){if(_0x299023[_0x0ed2('0x60')]['id']){delete _0x299023['body']['id'];}_0x299023[_0x0ed2('0x60')][_0x0ed2('0x42')]=widgetAttributes(_0x299023[_0x0ed2('0x60')]);return db['DashboardItem']['find']({'where':{'id':_0x299023[_0x0ed2('0x3f')]['id']}})[_0x0ed2('0x2b')](handleEntityNotFound(_0x19639a,null))[_0x0ed2('0x2b')](saveUpdates(_0x299023[_0x0ed2('0x60')],null))[_0x0ed2('0x2b')](respondWithResult(_0x19639a,null))['catch'](handleError(_0x19639a,null));}; \ No newline at end of file +var _0xd916=['attrReport','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','end','status','json','offset','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','params','model','keys','DashboardItem','rawAttributes','query','filters','attributes','fields','length','includeAll','options','catch','find','type','iframe','attrUrl','attrs','custom','attrPath','clock','attrHourFormat','value','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','total','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','voice','web-report'];(function(_0x48cdc1,_0x3a8edd){var _0x3e4eca=function(_0x313489){while(--_0x313489){_0x48cdc1['push'](_0x48cdc1['shift']());}};_0x3e4eca(++_0x3a8edd);}(_0xd916,0x18a));var _0x6d91=function(_0x19b5c0,_0x18ca6d){_0x19b5c0=_0x19b5c0-0x0;var _0x2fb804=_0xd916[_0x19b5c0];return _0x2fb804;};'use strict';var emlformat=require(_0x6d91('0x0'));var rimraf=require(_0x6d91('0x1'));var zipdir=require(_0x6d91('0x2'));var jsonpatch=require(_0x6d91('0x3'));var rp=require(_0x6d91('0x4'));var moment=require('moment');var BPromise=require(_0x6d91('0x5'));var Mustache=require(_0x6d91('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6d91('0x7'));var csv=require(_0x6d91('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d91('0x9'));var _=require(_0x6d91('0xa'));var squel=require(_0x6d91('0xb'));var crypto=require(_0x6d91('0xc'));var jsforce=require(_0x6d91('0xd'));var deskjs=require(_0x6d91('0xe'));var toCsv=require(_0x6d91('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6d91('0xf'));var as=require(_0x6d91('0x10'));var hardwareService=require(_0x6d91('0x11'));var logger=require(_0x6d91('0x12'))(_0x6d91('0x13'));var utils=require('../../config/utils');var config=require(_0x6d91('0x14'));var licenseUtil=require(_0x6d91('0x15'));var db=require(_0x6d91('0x16'))['db'];config[_0x6d91('0x17')]=_[_0x6d91('0x18')](config[_0x6d91('0x17')],{'host':_0x6d91('0x19'),'port':0x18eb});var socket=require(_0x6d91('0x1a'))(new Redis(config[_0x6d91('0x17')]));require(_0x6d91('0x1b'))[_0x6d91('0x1c')](socket);function respondWithStatusCode(_0x460ffb,_0x293e25){_0x293e25=_0x293e25||0xcc;return function(_0x1cdbeb){if(_0x1cdbeb){return _0x460ffb[_0x6d91('0x1d')](_0x293e25);}return _0x460ffb['status'](_0x293e25)[_0x6d91('0x1e')]();};}function respondWithResult(_0x33fbbe,_0x25debb){_0x25debb=_0x25debb||0xc8;return function(_0x2143ac){if(_0x2143ac){return _0x33fbbe[_0x6d91('0x1f')](_0x25debb)[_0x6d91('0x20')](_0x2143ac);}};}function respondWithFilteredResult(_0x51738a,_0x1311ed){return function(_0x4c81fe){if(_0x4c81fe){var _0x4dd339=typeof _0x1311ed[_0x6d91('0x21')]==='undefined'&&typeof _0x1311ed[_0x6d91('0x22')]==='undefined';var _0x539c29=_0x4c81fe[_0x6d91('0x23')];var _0x2a0ce7=_0x4dd339?0x0:_0x1311ed[_0x6d91('0x21')];var _0x4b5980=_0x4dd339?_0x4c81fe[_0x6d91('0x23')]:_0x1311ed[_0x6d91('0x21')]+_0x1311ed[_0x6d91('0x22')];var _0x95c65d;if(_0x4b5980>=_0x539c29){_0x4b5980=_0x539c29;_0x95c65d=0xc8;}else{_0x95c65d=0xce;}_0x51738a[_0x6d91('0x1f')](_0x95c65d);return _0x51738a[_0x6d91('0x24')](_0x6d91('0x25'),_0x2a0ce7+'-'+_0x4b5980+'/'+_0x539c29)[_0x6d91('0x20')](_0x4c81fe);}return null;};}function patchUpdates(_0x468142){return function(_0x3e67bd){try{jsonpatch[_0x6d91('0x26')](_0x3e67bd,_0x468142,!![]);}catch(_0x91ab12){return BPromise['reject'](_0x91ab12);}return _0x3e67bd[_0x6d91('0x27')]();};}function saveUpdates(_0xad1a51,_0x34ed05){return function(_0x4898d0){if(_0x4898d0){return _0x4898d0[_0x6d91('0x28')](_0xad1a51)[_0x6d91('0x29')](function(_0x5a8c2a){return _0x5a8c2a;});}return null;};}function removeEntity(_0x41fa64,_0x72505e){return function(_0x3ed163){if(_0x3ed163){return _0x3ed163[_0x6d91('0x2a')]()['then'](function(){_0x41fa64[_0x6d91('0x1f')](0xcc)[_0x6d91('0x1e')]();});}};}function handleEntityNotFound(_0x1689f9,_0x52db14){return function(_0x34479e){if(!_0x34479e){_0x1689f9[_0x6d91('0x1d')](0x194);}return _0x34479e;};}function handleError(_0x385237,_0xb0c85f){_0xb0c85f=_0xb0c85f||0x1f4;return function(_0x5c99fc){logger[_0x6d91('0x2b')](_0x5c99fc[_0x6d91('0x2c')]);if(_0x5c99fc[_0x6d91('0x2d')]){delete _0x5c99fc['name'];}_0x385237[_0x6d91('0x1f')](_0xb0c85f)[_0x6d91('0x2e')](_0x5c99fc);};}exports['show']=function(_0x15ea4d,_0x54b0bc){var _0x52b88d={'raw':![],'where':{'id':_0x15ea4d[_0x6d91('0x2f')]['id']}},_0x5a48fe={};_0x5a48fe[_0x6d91('0x30')]=_[_0x6d91('0x31')](db[_0x6d91('0x32')][_0x6d91('0x33')]);_0x5a48fe[_0x6d91('0x34')]=_[_0x6d91('0x31')](_0x15ea4d[_0x6d91('0x34')]);_0x5a48fe[_0x6d91('0x35')]=_['intersection'](_0x5a48fe[_0x6d91('0x30')],_0x5a48fe[_0x6d91('0x34')]);_0x52b88d[_0x6d91('0x36')]=_['intersection'](_0x5a48fe[_0x6d91('0x30')],qs['fields'](_0x15ea4d[_0x6d91('0x34')][_0x6d91('0x37')]));_0x52b88d[_0x6d91('0x36')]=_0x52b88d[_0x6d91('0x36')][_0x6d91('0x38')]?_0x52b88d[_0x6d91('0x36')]:_0x5a48fe[_0x6d91('0x30')];if(_0x15ea4d['query'][_0x6d91('0x39')]){_0x52b88d['include']=[{'all':!![]}];}_0x52b88d=_['merge']({},_0x52b88d,_0x15ea4d[_0x6d91('0x3a')]);return db['DashboardItem']['find'](_0x52b88d)['then'](handleEntityNotFound(_0x54b0bc,null))['then'](respondWithResult(_0x54b0bc,null))[_0x6d91('0x3b')](handleError(_0x54b0bc,null));};exports[_0x6d91('0x2a')]=function(_0x3cd4be,_0x4ffac2){return db[_0x6d91('0x32')][_0x6d91('0x3c')]({'where':{'id':_0x3cd4be[_0x6d91('0x2f')]['id']}})[_0x6d91('0x29')](handleEntityNotFound(_0x4ffac2,null))['then'](removeEntity(_0x4ffac2,null))[_0x6d91('0x3b')](handleError(_0x4ffac2,null));};function widgetAttributes(_0x54448b){try{switch(_0x54448b[_0x6d91('0x3d')]){case _0x6d91('0x3e'):return[{'name':_0x6d91('0x3f'),'value':_0x54448b[_0x6d91('0x3f')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x0]?_0x54448b[_0x6d91('0x40')][0x0]['value']:undefined)||'https://'}];case _0x6d91('0x41'):return[{'name':'attrPath','value':_0x54448b[_0x6d91('0x42')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x0]?_0x54448b[_0x6d91('0x40')][0x0]['value']:undefined)||''}];case _0x6d91('0x43'):return[{'name':_0x6d91('0x44'),'value':_0x54448b['attrHourFormat']||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x0]?_0x54448b[_0x6d91('0x40')][0x0][_0x6d91('0x45')]:undefined)||_0x6d91('0x46')},{'name':_0x6d91('0x47'),'value':_0x54448b[_0x6d91('0x47')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x1]?_0x54448b[_0x6d91('0x40')][0x1][_0x6d91('0x45')]:undefined)||_0x6d91('0x48')},{'name':_0x6d91('0x49'),'value':_0x54448b['attrFontSize']||(_0x54448b['attrs']&&_0x54448b['attrs'][0x2]?_0x54448b['attrs'][0x2]['value']:undefined)||0xc}];case _0x6d91('0x4a'):return[{'name':'attrMetric','value':_0x54448b['attrMetric']||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x0]?_0x54448b[_0x6d91('0x40')][0x0][_0x6d91('0x45')]:undefined)||_0x6d91('0x4b')},{'name':'attrVoiceQueues','value':_0x54448b['attrVoiceQueues']||(_0x54448b['attrs']&&_0x54448b[_0x6d91('0x40')][0x1]?_0x54448b[_0x6d91('0x40')][0x1][_0x6d91('0x45')]:undefined)||[]},{'name':'attrFontSize','value':_0x54448b[_0x6d91('0x49')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x2]?_0x54448b['attrs'][0x2][_0x6d91('0x45')]:undefined)||0x14},{'name':_0x6d91('0x4c'),'value':_0x54448b[_0x6d91('0x4c')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x3]?_0x54448b[_0x6d91('0x40')][0x3][_0x6d91('0x45')]:undefined)||'voice'},{'name':'attrEmailAccounts','value':_0x54448b[_0x6d91('0x4d')]||(_0x54448b['attrs']&&_0x54448b[_0x6d91('0x40')][0x4]?_0x54448b['attrs'][0x4][_0x6d91('0x45')]:undefined)||''},{'name':_0x6d91('0x4e'),'value':_0x54448b[_0x6d91('0x4e')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x5]?_0x54448b[_0x6d91('0x40')][0x5][_0x6d91('0x45')]:undefined)||''},{'name':_0x6d91('0x4f'),'value':_0x54448b[_0x6d91('0x4f')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x6]?_0x54448b[_0x6d91('0x40')][0x6][_0x6d91('0x45')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x54448b[_0x6d91('0x50')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x7]?_0x54448b['attrs'][0x7][_0x6d91('0x45')]:undefined)||''},{'name':_0x6d91('0x51'),'value':_0x54448b[_0x6d91('0x51')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x8]?_0x54448b[_0x6d91('0x40')][0x8][_0x6d91('0x45')]:undefined)||''},{'name':_0x6d91('0x52'),'value':_0x54448b[_0x6d91('0x52')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x9]?_0x54448b[_0x6d91('0x40')][0x9][_0x6d91('0x45')]:undefined)||''}];case _0x6d91('0x53'):case _0x6d91('0x54'):return[{'name':_0x6d91('0x55'),'value':_0x54448b[_0x6d91('0x55')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x0]?_0x54448b[_0x6d91('0x40')][0x0]['value']:undefined)||_0x6d91('0x4b')},{'name':_0x6d91('0x56'),'value':_0x54448b[_0x6d91('0x56')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x1]?_0x54448b[_0x6d91('0x40')][0x1][_0x6d91('0x45')]:undefined)||null},{'name':_0x6d91('0x57'),'value':_0x54448b[_0x6d91('0x57')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x2]?_0x54448b[_0x6d91('0x40')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x54448b[_0x6d91('0x58')]||(_0x54448b['attrs']&&_0x54448b[_0x6d91('0x40')][0x3]?_0x54448b[_0x6d91('0x40')][0x3][_0x6d91('0x45')]:undefined)||[]},{'name':_0x6d91('0x4c'),'value':_0x54448b[_0x6d91('0x4c')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x4]?_0x54448b[_0x6d91('0x40')][0x4][_0x6d91('0x45')]:undefined)||_0x6d91('0x59')},{'name':'attrEmailAccounts','value':_0x54448b[_0x6d91('0x4d')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x5]?_0x54448b[_0x6d91('0x40')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x54448b[_0x6d91('0x4e')]||(_0x54448b['attrs']&&_0x54448b[_0x6d91('0x40')][0x6]?_0x54448b[_0x6d91('0x40')][0x6][_0x6d91('0x45')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x54448b[_0x6d91('0x4f')]||(_0x54448b['attrs']&&_0x54448b[_0x6d91('0x40')][0x7]?_0x54448b[_0x6d91('0x40')][0x7][_0x6d91('0x45')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x54448b[_0x6d91('0x50')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x8]?_0x54448b[_0x6d91('0x40')][0x8][_0x6d91('0x45')]:undefined)||''},{'name':_0x6d91('0x51'),'value':_0x54448b['attrWhatsappAccounts']||(_0x54448b[_0x6d91('0x40')]&&_0x54448b[_0x6d91('0x40')][0x9]?_0x54448b['attrs'][0x9][_0x6d91('0x45')]:undefined)||''},{'name':_0x6d91('0x52'),'value':_0x54448b[_0x6d91('0x52')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0xa]?_0x54448b[_0x6d91('0x40')][0xa][_0x6d91('0x45')]:undefined)||''}];case _0x6d91('0x5a'):return[{'name':_0x6d91('0x5b'),'type':_0x54448b['reportType']||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x0]?_0x54448b[_0x6d91('0x40')][0x0][_0x6d91('0x3d')]:undefined)||null,'value':_0x54448b[_0x6d91('0x5b')]||(_0x54448b[_0x6d91('0x40')]&&_0x54448b['attrs'][0x0]?_0x54448b[_0x6d91('0x40')][0x0][_0x6d91('0x45')]:undefined)||null},{'name':'attrRefresh','value':_0x54448b[_0x6d91('0x5c')]||(_0x54448b['attrs']&&_0x54448b[_0x6d91('0x40')][0x1]?_0x54448b[_0x6d91('0x40')][0x1][_0x6d91('0x45')]:undefined)||0x0}];default:return[];}}catch(_0x4c77ec){logger['error'](_0x6d91('0x5d'),JSON[_0x6d91('0x5e')](_0x4c77ec));return[];}}exports[_0x6d91('0x5f')]=function(_0x27a2c5,_0xa741f0){if(_0x27a2c5[_0x6d91('0x60')]){_0x27a2c5[_0x6d91('0x60')][_0x6d91('0x40')]=widgetAttributes(_0x27a2c5[_0x6d91('0x60')]);}return db[_0x6d91('0x32')][_0x6d91('0x5f')](_0x27a2c5['body'],{})[_0x6d91('0x29')](respondWithResult(_0xa741f0,0xc9))[_0x6d91('0x3b')](handleError(_0xa741f0,null));};exports[_0x6d91('0x28')]=function(_0xf8df64,_0x718642){if(_0xf8df64['body']['id']){delete _0xf8df64[_0x6d91('0x60')]['id'];}_0xf8df64[_0x6d91('0x60')][_0x6d91('0x40')]=widgetAttributes(_0xf8df64[_0x6d91('0x60')]);return db[_0x6d91('0x32')][_0x6d91('0x3c')]({'where':{'id':_0xf8df64['params']['id']}})[_0x6d91('0x29')](handleEntityNotFound(_0x718642,null))['then'](saveUpdates(_0xf8df64['body'],null))[_0x6d91('0x29')](respondWithResult(_0x718642,null))[_0x6d91('0x3b')](handleError(_0x718642,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 3e9f909..39b2625 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 _0xd945=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','DashboardItem'];(function(_0x5b7894,_0x3c1adf){var _0x10b257=function(_0x2bbc21){while(--_0x2bbc21){_0x5b7894['push'](_0x5b7894['shift']());}};_0x10b257(++_0x3c1adf);}(_0xd945,0x84));var _0x5d94=function(_0x4f2444,_0x3dc547){_0x4f2444=_0x4f2444-0x0;var _0x38f360=_0xd945[_0x4f2444];return _0x38f360;};'use strict';var EventEmitter=require(_0x5d94('0x0'));var DashboardItem=require(_0x5d94('0x1'))['db'][_0x5d94('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5d94('0x3'),'afterUpdate':_0x5d94('0x4'),'afterDestroy':_0x5d94('0x5')};function emitEvent(_0x1a0db7){return function(_0x16f002,_0x49df2e,_0x353703){DashboardItemEvents[_0x5d94('0x6')](_0x1a0db7+':'+_0x16f002['id'],_0x16f002);DashboardItemEvents[_0x5d94('0x6')](_0x1a0db7,_0x16f002);_0x353703(null);};}for(var e in events){if(events[_0x5d94('0x7')](e)){var event=events[e];DashboardItem[_0x5d94('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x77cb=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','DashboardItem','setMaxListeners','remove'];(function(_0x1eb027,_0x2ded9a){var _0x3572cb=function(_0xf0a844){while(--_0xf0a844){_0x1eb027['push'](_0x1eb027['shift']());}};_0x3572cb(++_0x2ded9a);}(_0x77cb,0x1e1));var _0xb77c=function(_0x332a18,_0x41e562){_0x332a18=_0x332a18-0x0;var _0xcb1bbc=_0x77cb[_0x332a18];return _0xcb1bbc;};'use strict';var EventEmitter=require(_0xb77c('0x0'));var DashboardItem=require(_0xb77c('0x1'))['db'][_0xb77c('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xb77c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb77c('0x4')};function emitEvent(_0x24ae55){return function(_0x5533c8,_0x236c21,_0x5ced87){DashboardItemEvents[_0xb77c('0x5')](_0x24ae55+':'+_0x5533c8['id'],_0x5533c8);DashboardItemEvents[_0xb77c('0x5')](_0x24ae55,_0x5533c8);_0x5ced87(null);};}for(var e in events){if(events[_0xb77c('0x6')](e)){var event=events[e];DashboardItem[_0xb77c('0x7')](e,emitEvent(event));}}module[_0xb77c('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 15a30dc..6e6f095 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 _0x947e=['dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./dashboardItem.attributes','exports'];(function(_0x5f2108,_0x2e2cd5){var _0x10ef49=function(_0xd286b4){while(--_0xd286b4){_0x5f2108['push'](_0x5f2108['shift']());}};_0x10ef49(++_0x2e2cd5);}(_0x947e,0x9b));var _0xe947=function(_0x9cea07,_0x58eca2){_0x9cea07=_0x9cea07-0x0;var _0x1194dc=_0x947e[_0x9cea07];return _0x1194dc;};'use strict';var _=require(_0xe947('0x0'));var util=require(_0xe947('0x1'));var logger=require(_0xe947('0x2'))(_0xe947('0x3'));var moment=require(_0xe947('0x4'));var BPromise=require(_0xe947('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe947('0x6'));var config=require(_0xe947('0x7'));var attributes=require(_0xe947('0x8'));module[_0xe947('0x9')]=function(_0x175cc6,_0x1de1c1){return _0x175cc6['define']('DashboardItem',attributes,{'tableName':_0xe947('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1433=['dashboard_items','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem'];(function(_0x32d1ae,_0x575e52){var _0x49cf0b=function(_0x7dc05c){while(--_0x7dc05c){_0x32d1ae['push'](_0x32d1ae['shift']());}};_0x49cf0b(++_0x575e52);}(_0x1433,0x121));var _0x3143=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x1433[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x3143('0x0'));var util=require(_0x3143('0x1'));var logger=require('../../config/logger')(_0x3143('0x2'));var moment=require(_0x3143('0x3'));var BPromise=require(_0x3143('0x4'));var rp=require(_0x3143('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3143('0x6'));var attributes=require(_0x3143('0x7'));module[_0x3143('0x8')]=function(_0x216e7a,_0xe029e4){return _0x216e7a[_0x3143('0x9')](_0x3143('0xa'),attributes,{'tableName':_0x3143('0xb'),'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 37ce9c7..7cc76d5 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 _0x9c0b=['DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','randomstring','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3e9568,_0x3a5ddc){var _0x2329fe=function(_0x1af3d2){while(--_0x1af3d2){_0x3e9568['push'](_0x3e9568['shift']());}};_0x2329fe(++_0x3a5ddc);}(_0x9c0b,0xf6));var _0xb9c0=function(_0x40bcf9,_0x409033){_0x40bcf9=_0x40bcf9-0x0;var _0x10ab13=_0x9c0b[_0x40bcf9];return _0x10ab13;};'use strict';var _=require('lodash');var util=require(_0xb9c0('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9c0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9c0('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9c0('0x3'));var config=require(_0xb9c0('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xb9c0('0x5')][_0xb9c0('0x6')]({'port':0x232a});config[_0xb9c0('0x7')]=_[_0xb9c0('0x8')](config[_0xb9c0('0x7')],{'host':_0xb9c0('0x9'),'port':0x18eb});var socket=require(_0xb9c0('0xa'))(new Redis(config[_0xb9c0('0x7')]));require('./dashboardItem.socket')[_0xb9c0('0xb')](socket);function respondWithRpcPromise(_0xe83cfa,_0x863c06,_0x36588b){return new BPromise(function(_0x56d040,_0x1b1d3a){return client[_0xb9c0('0xc')](_0xe83cfa,_0x36588b)[_0xb9c0('0xd')](function(_0x4e90e6){logger[_0xb9c0('0xe')](_0xb9c0('0xf'),_0x863c06,_0xb9c0('0x10'));logger[_0xb9c0('0x11')](_0xb9c0('0x12'),_0x863c06,_0xb9c0('0x10'),JSON['stringify'](_0x4e90e6));if(_0x4e90e6[_0xb9c0('0x13')]){if(_0x4e90e6[_0xb9c0('0x13')][_0xb9c0('0x14')]===0x1f4){logger['error'](_0xb9c0('0xf'),_0x863c06,_0x4e90e6[_0xb9c0('0x13')][_0xb9c0('0x15')]);return _0x1b1d3a(_0x4e90e6[_0xb9c0('0x13')][_0xb9c0('0x15')]);}logger[_0xb9c0('0x13')](_0xb9c0('0xf'),_0x863c06,_0x4e90e6[_0xb9c0('0x13')][_0xb9c0('0x15')]);return _0x56d040(_0x4e90e6[_0xb9c0('0x13')][_0xb9c0('0x15')]);}else{logger['info'](_0xb9c0('0xf'),_0x863c06,_0xb9c0('0x10'));_0x56d040(_0x4e90e6[_0xb9c0('0x16')][_0xb9c0('0x15')]);}})[_0xb9c0('0x17')](function(_0x122b04){logger[_0xb9c0('0x13')]('DashboardItem,\x20%s,\x20%s',_0x863c06,_0x122b04);_0x1b1d3a(_0x122b04);});});} \ No newline at end of file +var _0x0266=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','DashboardItem,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger'];(function(_0x1884dd,_0x1bbe84){var _0x41cb84=function(_0x3ebde3){while(--_0x3ebde3){_0x1884dd['push'](_0x1884dd['shift']());}};_0x41cb84(++_0x1bbe84);}(_0x0266,0x132));var _0x6026=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x0266[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x6026('0x0'));var util=require(_0x6026('0x1'));var moment=require(_0x6026('0x2'));var BPromise=require(_0x6026('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6026('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6026('0x5'))(_0x6026('0x6'));var config=require(_0x6026('0x7'));var jayson=require(_0x6026('0x8'));var client=jayson[_0x6026('0x9')][_0x6026('0xa')]({'port':0x232a});config[_0x6026('0xb')]=_[_0x6026('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6026('0xd'))(new Redis(config[_0x6026('0xb')]));require('./dashboardItem.socket')[_0x6026('0xe')](socket);function respondWithRpcPromise(_0x13260d,_0x5bf310,_0x6eef78){return new BPromise(function(_0x4907b6,_0x505d14){return client[_0x6026('0xf')](_0x13260d,_0x6eef78)[_0x6026('0x10')](function(_0x394ba1){logger['info']('DashboardItem,\x20%s,\x20%s',_0x5bf310,'request\x20sent');logger[_0x6026('0x11')](_0x6026('0x12'),_0x5bf310,_0x6026('0x13'),JSON['stringify'](_0x394ba1));if(_0x394ba1['error']){if(_0x394ba1[_0x6026('0x14')][_0x6026('0x15')]===0x1f4){logger[_0x6026('0x14')](_0x6026('0x16'),_0x5bf310,_0x394ba1['error'][_0x6026('0x17')]);return _0x505d14(_0x394ba1['error'][_0x6026('0x17')]);}logger['error'](_0x6026('0x16'),_0x5bf310,_0x394ba1[_0x6026('0x14')][_0x6026('0x17')]);return _0x4907b6(_0x394ba1['error'][_0x6026('0x17')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x5bf310,_0x6026('0x13'));_0x4907b6(_0x394ba1[_0x6026('0x18')][_0x6026('0x17')]);}})[_0x6026('0x19')](function(_0x4a778e){logger[_0x6026('0x14')]('DashboardItem,\x20%s,\x20%s',_0x5bf310,_0x4a778e);_0x505d14(_0x4a778e);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index bda5a7c..d6c968f 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 _0xfa6a=['save','emit','removeListener','register','dashboardItem:','./dashboardItem.events'];(function(_0x2a970e,_0x45f657){var _0x498cda=function(_0x1bb19d){while(--_0x1bb19d){_0x2a970e['push'](_0x2a970e['shift']());}};_0x498cda(++_0x45f657);}(_0xfa6a,0x1f1));var _0xafa6=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xfa6a[_0x19950b];return _0x3c6b41;};'use strict';var DashboardItemEvents=require(_0xafa6('0x0'));var events=[_0xafa6('0x1'),'remove','update'];function createListener(_0x288bb2,_0xc08ee2){return function(_0x2a1799){_0xc08ee2[_0xafa6('0x2')](_0x288bb2,_0x2a1799);};}function removeListener(_0x39b1f5,_0x544934){return function(){DashboardItemEvents[_0xafa6('0x3')](_0x39b1f5,_0x544934);};}exports[_0xafa6('0x4')]=function(_0x1b06a2){for(var _0x3229a8=0x0,_0xab18eb=events['length'];_0x3229a8<_0xab18eb;_0x3229a8++){var _0x1eb200=events[_0x3229a8];var _0x1a38c6=createListener(_0xafa6('0x5')+_0x1eb200,_0x1b06a2);DashboardItemEvents['on'](_0x1eb200,_0x1a38c6);}}; \ No newline at end of file +var _0xa589=['length','./dashboardItem.events','save','remove','update','emit','removeListener','register'];(function(_0xaaf1cc,_0x4f137d){var _0x1d0b4a=function(_0xa88a77){while(--_0xa88a77){_0xaaf1cc['push'](_0xaaf1cc['shift']());}};_0x1d0b4a(++_0x4f137d);}(_0xa589,0xc1));var _0x9a58=function(_0x392412,_0x20fd5c){_0x392412=_0x392412-0x0;var _0x1b417c=_0xa589[_0x392412];return _0x1b417c;};'use strict';var DashboardItemEvents=require(_0x9a58('0x0'));var events=[_0x9a58('0x1'),_0x9a58('0x2'),_0x9a58('0x3')];function createListener(_0xc63e17,_0x45445){return function(_0x17a38b){_0x45445[_0x9a58('0x4')](_0xc63e17,_0x17a38b);};}function removeListener(_0x2851de,_0x3aac44){return function(){DashboardItemEvents[_0x9a58('0x5')](_0x2851de,_0x3aac44);};}exports[_0x9a58('0x6')]=function(_0x3212b0){for(var _0x3aa19a=0x0,_0x40e130=events[_0x9a58('0x7')];_0x3aa19a<_0x40e130;_0x3aa19a++){var _0x88ff5b=events[_0x3aa19a];var _0x51b50a=createListener('dashboardItem:'+_0x88ff5b,_0x3212b0);DashboardItemEvents['on'](_0x88ff5b,_0x51b50a);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a5f5930..6d3d0e1 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 _0x1de6=['delete','destroy','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./dashboardItem.controller','/:id','post','isAuthenticated','create','put','update'];(function(_0xe56fcb,_0x42f237){var _0x6037c7=function(_0x489ccf){while(--_0x489ccf){_0xe56fcb['push'](_0xe56fcb['shift']());}};_0x6037c7(++_0x42f237);}(_0x1de6,0x16a));var _0x61de=function(_0x3df93e,_0x5af13a){_0x3df93e=_0x3df93e-0x0;var _0x2d4f2a=_0x1de6[_0x3df93e];return _0x2d4f2a;};'use strict';var multer=require(_0x61de('0x0'));var util=require(_0x61de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x61de('0x2')]();var fs_extra=require(_0x61de('0x3'));var auth=require(_0x61de('0x4'));var interaction=require(_0x61de('0x5'));var config=require('../../config/environment');var controller=require(_0x61de('0x6'));router['get'](_0x61de('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x61de('0x8')]('/',auth[_0x61de('0x9')](),controller[_0x61de('0xa')]);router[_0x61de('0xb')]('/:id',auth[_0x61de('0x9')](),controller[_0x61de('0xc')]);router[_0x61de('0xd')](_0x61de('0x7'),auth[_0x61de('0x9')](),controller[_0x61de('0xe')]);module['exports']=router; \ No newline at end of file +var _0x1c5f=['isAuthenticated','show','post','put','update','delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id'];(function(_0x2ce372,_0x2bccba){var _0x18dec7=function(_0x335592){while(--_0x335592){_0x2ce372['push'](_0x2ce372['shift']());}};_0x18dec7(++_0x2bccba);}(_0x1c5f,0x85));var _0xf1c5=function(_0x26226e,_0x3f78e9){_0x26226e=_0x26226e-0x0;var _0x3539c8=_0x1c5f[_0x26226e];return _0x3539c8;};'use strict';var multer=require(_0xf1c5('0x0'));var util=require(_0xf1c5('0x1'));var path=require(_0xf1c5('0x2'));var timeout=require('connect-timeout');var express=require(_0xf1c5('0x3'));var router=express['Router']();var fs_extra=require(_0xf1c5('0x4'));var auth=require(_0xf1c5('0x5'));var interaction=require(_0xf1c5('0x6'));var config=require(_0xf1c5('0x7'));var controller=require(_0xf1c5('0x8'));router[_0xf1c5('0x9')](_0xf1c5('0xa'),auth[_0xf1c5('0xb')](),controller[_0xf1c5('0xc')]);router[_0xf1c5('0xd')]('/',auth[_0xf1c5('0xb')](),controller['create']);router[_0xf1c5('0xe')](_0xf1c5('0xa'),auth[_0xf1c5('0xb')](),controller[_0xf1c5('0xf')]);router[_0xf1c5('0x10')](_0xf1c5('0xa'),auth[_0xf1c5('0xb')](),controller[_0xf1c5('0x11')]);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 46db658..0765b9e 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 _0x6e6f=['first','exports','STRING','ENUM'];(function(_0x4ca333,_0x1218a3){var _0x13b2e1=function(_0x1eaf45){while(--_0x1eaf45){_0x4ca333['push'](_0x4ca333['shift']());}};_0x13b2e1(++_0x1218a3);}(_0x6e6f,0x171));var _0xf6e6=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0x6e6f[_0xee5d2a];return _0x346948;};'use strict';var Sequelize=require('sequelize');module[_0xf6e6('0x0')]={'name':{'type':Sequelize[_0xf6e6('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xf6e6('0x2')](_0xf6e6('0x3'),'second','third'),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfb45=['ENUM','first','second','third','sequelize','exports','STRING'];(function(_0x370013,_0x147d1e){var _0x2458df=function(_0x268c40){while(--_0x268c40){_0x370013['push'](_0x370013['shift']());}};_0x2458df(++_0x147d1e);}(_0xfb45,0x185));var _0x5fb4=function(_0xb13d69,_0x5941ed){_0xb13d69=_0xb13d69-0x0;var _0x2d9a47=_0xfb45[_0xb13d69];return _0x2d9a47;};'use strict';var Sequelize=require(_0x5fb4('0x0'));module[_0x5fb4('0x1')]={'name':{'type':Sequelize[_0x5fb4('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x5fb4('0x3')](_0x5fb4('0x4'),_0x5fb4('0x5'),_0x5fb4('0x6')),'allowNull':![],'defaultValue':_0x5fb4('0x4')},'description':{'type':Sequelize[_0x5fb4('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index ec170e5..245a98e 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 _0x2e8a=['filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','options','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','rimraf','zip-dir','request-promise','moment','mustache','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','type','key','query'];(function(_0x3e9e4e,_0xe72526){var _0x598fe8=function(_0x37aebd){while(--_0x37aebd){_0x3e9e4e['push'](_0x3e9e4e['shift']());}};_0x598fe8(++_0xe72526);}(_0x2e8a,0xc7));var _0xa2e8=function(_0x28fe94,_0x120b9b){_0x28fe94=_0x28fe94-0x0;var _0x3560da=_0x2e8a[_0x28fe94];return _0x3560da;};'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(){var _0x1c4c97=_0x32758e[_0xa2e8('0x22')]({'plain':!![]});var _0x2b50cb=_0xa2e8('0x23');return db[_0xa2e8('0x24')][_0xa2e8('0x21')]({'where':{'type':_0x2b50cb,'resourceId':_0x1c4c97['id']}})[_0xa2e8('0x20')](function(){return _0x32758e;});})[_0xa2e8('0x20')](function(){_0x518532[_0xa2e8('0x16')](0xcc)[_0xa2e8('0x25')]();});}};}function handleEntityNotFound(_0x529078,_0x3f03a4){return function(_0x14bcf7){if(!_0x14bcf7){_0x529078[_0xa2e8('0x15')](0x194);}return _0x14bcf7;};}function handleError(_0x29b706,_0x4e47a8){_0x4e47a8=_0x4e47a8||0x1f4;return function(_0x54775c){logger[_0xa2e8('0x26')](_0x54775c[_0xa2e8('0x27')]);if(_0x54775c['name']){delete _0x54775c[_0xa2e8('0x28')];}_0x29b706[_0xa2e8('0x16')](_0x4e47a8)[_0xa2e8('0x29')](_0x54775c);};}exports[_0xa2e8('0x2a')]=function(_0x205292,_0x1142e2){var _0x163fbc={},_0x4a4904={},_0x580ae1={'count':0x0,'rows':[]};var _0x432116=_[_0xa2e8('0x2b')](db[_0xa2e8('0x2c')][_0xa2e8('0x2d')],function(_0x2acf71){return{'name':_0x2acf71[_0xa2e8('0x2e')],'type':_0x2acf71[_0xa2e8('0x2f')][_0xa2e8('0x30')]};});_0x4a4904['model']=_[_0xa2e8('0x2b')](_0x432116,_0xa2e8('0x28'));_0x4a4904[_0xa2e8('0x31')]=_['keys'](_0x205292[_0xa2e8('0x31')]);_0x4a4904[_0xa2e8('0x32')]=_[_0xa2e8('0x33')](_0x4a4904[_0xa2e8('0x34')],_0x4a4904[_0xa2e8('0x31')]);_0x163fbc[_0xa2e8('0x35')]=_[_0xa2e8('0x33')](_0x4a4904[_0xa2e8('0x34')],qs[_0xa2e8('0x36')](_0x205292[_0xa2e8('0x31')][_0xa2e8('0x36')]));_0x163fbc[_0xa2e8('0x35')]=_0x163fbc['attributes'][_0xa2e8('0x37')]?_0x163fbc[_0xa2e8('0x35')]:_0x4a4904[_0xa2e8('0x34')];if(!_0x205292[_0xa2e8('0x31')][_0xa2e8('0x38')](_0xa2e8('0x39'))){_0x163fbc[_0xa2e8('0x3a')]=qs['limit'](_0x205292['query']['limit']);_0x163fbc['offset']=qs[_0xa2e8('0x17')](_0x205292[_0xa2e8('0x31')][_0xa2e8('0x17')]);}_0x163fbc[_0xa2e8('0x3b')]=qs['sort'](_0x205292[_0xa2e8('0x31')][_0xa2e8('0x3c')]);_0x163fbc['where']=qs[_0xa2e8('0x32')](_[_0xa2e8('0x3d')](_0x205292[_0xa2e8('0x31')],_0x4a4904[_0xa2e8('0x32')]),_0x432116);if(_0x205292[_0xa2e8('0x31')][_0xa2e8('0x3e')]){_0x163fbc[_0xa2e8('0x3f')]=_[_0xa2e8('0x40')](_0x163fbc[_0xa2e8('0x3f')],{'$or':_[_0xa2e8('0x2b')](_0x432116,function(_0x37278a){if(_0x37278a[_0xa2e8('0x2f')]!==_0xa2e8('0x41')){var _0x4db14f={};_0x4db14f[_0x37278a[_0xa2e8('0x28')]]={'$like':'%'+_0x205292[_0xa2e8('0x31')][_0xa2e8('0x3e')]+'%'};return _0x4db14f;}})});}_0x163fbc=_[_0xa2e8('0x40')]({},_0x163fbc,_0x205292['options']);var _0x193c93={'where':_0x163fbc[_0xa2e8('0x3f')]};return db[_0xa2e8('0x2c')][_0xa2e8('0x19')](_0x193c93)['then'](function(_0x2b24ad){_0x580ae1[_0xa2e8('0x19')]=_0x2b24ad;if(_0x205292[_0xa2e8('0x31')][_0xa2e8('0x42')]){_0x163fbc['include']=[{'all':!![]}];}return db[_0xa2e8('0x2c')][_0xa2e8('0x43')](_0x163fbc);})['then'](function(_0x415671){_0x580ae1[_0xa2e8('0x44')]=_0x415671;return _0x580ae1;})[_0xa2e8('0x20')](respondWithFilteredResult(_0x1142e2,_0x163fbc))[_0xa2e8('0x45')](handleError(_0x1142e2,null));};exports[_0xa2e8('0x46')]=function(_0x2da5e7,_0x59e419){var _0x5f5a6c={'raw':!![],'where':{'id':_0x2da5e7['params']['id']}},_0x55cc69={};_0x55cc69[_0xa2e8('0x34')]=_[_0xa2e8('0x47')](db[_0xa2e8('0x2c')][_0xa2e8('0x2d')]);_0x55cc69[_0xa2e8('0x31')]=_[_0xa2e8('0x47')](_0x2da5e7['query']);_0x55cc69[_0xa2e8('0x32')]=_[_0xa2e8('0x33')](_0x55cc69['model'],_0x55cc69['query']);_0x5f5a6c[_0xa2e8('0x35')]=_['intersection'](_0x55cc69[_0xa2e8('0x34')],qs['fields'](_0x2da5e7['query'][_0xa2e8('0x36')]));_0x5f5a6c[_0xa2e8('0x35')]=_0x5f5a6c[_0xa2e8('0x35')][_0xa2e8('0x37')]?_0x5f5a6c[_0xa2e8('0x35')]:_0x55cc69[_0xa2e8('0x34')];if(_0x2da5e7[_0xa2e8('0x31')][_0xa2e8('0x42')]){_0x5f5a6c['include']=[{'all':!![]}];}_0x5f5a6c=_[_0xa2e8('0x40')]({},_0x5f5a6c,_0x2da5e7[_0xa2e8('0x48')]);return db[_0xa2e8('0x2c')][_0xa2e8('0x49')](_0x5f5a6c)[_0xa2e8('0x20')](handleEntityNotFound(_0x59e419,null))[_0xa2e8('0x20')](respondWithResult(_0x59e419,null))['catch'](handleError(_0x59e419,null));};exports[_0xa2e8('0x4a')]=function(_0x4dfa8c,_0x4721fd){return db[_0xa2e8('0x2c')][_0xa2e8('0x4a')](_0x4dfa8c[_0xa2e8('0x4b')],{})['then'](function(_0x24525b){var _0x1a5802=_0x4dfa8c[_0xa2e8('0x4c')][_0xa2e8('0x22')]({'plain':!![]});if(!_0x1a5802)throw new Error(_0xa2e8('0x4d'));if(_0x1a5802[_0xa2e8('0x4e')]===_0xa2e8('0x4c')){var _0x88e2f8=_0x24525b[_0xa2e8('0x22')]({'plain':!![]});var _0x228bc6='Dispositions';return db[_0xa2e8('0x4f')][_0xa2e8('0x49')]({'where':{'name':_0x228bc6,'userProfileId':_0x1a5802[_0xa2e8('0x50')]},'raw':!![]})[_0xa2e8('0x20')](function(_0x1554ae){if(_0x1554ae&&_0x1554ae['autoAssociation']===0x0){return db[_0xa2e8('0x24')][_0xa2e8('0x4a')]({'name':_0x88e2f8[_0xa2e8('0x28')],'resourceId':_0x88e2f8['id'],'type':_0x1554ae[_0xa2e8('0x28')],'sectionId':_0x1554ae['id']},{})['then'](function(){return _0x24525b;});}else{return _0x24525b;}})[_0xa2e8('0x45')](function(_0x25995d){logger[_0xa2e8('0x26')](_0xa2e8('0x51'),_0x25995d);throw _0x25995d;});}return _0x24525b;})[_0xa2e8('0x20')](respondWithResult(_0x4721fd,0xc9))['catch'](handleError(_0x4721fd,null));};exports[_0xa2e8('0x1f')]=function(_0x34b3fe,_0x4a8101){if(_0x34b3fe['body']['id']){delete _0x34b3fe[_0xa2e8('0x4b')]['id'];}return db[_0xa2e8('0x2c')][_0xa2e8('0x49')]({'where':{'id':_0x34b3fe[_0xa2e8('0x52')]['id']}})['then'](handleEntityNotFound(_0x4a8101,null))[_0xa2e8('0x20')](saveUpdates(_0x34b3fe[_0xa2e8('0x4b')],null))[_0xa2e8('0x20')](respondWithResult(_0x4a8101,null))['catch'](handleError(_0x4a8101,null));};exports[_0xa2e8('0x21')]=function(_0x14903f,_0x10b0ac){return db[_0xa2e8('0x2c')][_0xa2e8('0x49')]({'where':{'id':_0x14903f['params']['id']}})[_0xa2e8('0x20')](handleEntityNotFound(_0x10b0ac,null))[_0xa2e8('0x20')](removeEntity(_0x10b0ac,null))[_0xa2e8('0x45')](handleError(_0x10b0ac,null));}; \ No newline at end of file +var _0x5046=['VIRTUAL','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','end','error','stack','name','send','index','map','Disposition','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters','pick','filter'];(function(_0x2a3bd9,_0x27d71e){var _0x526111=function(_0x44f1dd){while(--_0x44f1dd){_0x2a3bd9['push'](_0x2a3bd9['shift']());}};_0x526111(++_0x27d71e);}(_0x5046,0x6d));var _0x6504=function(_0x320a39,_0x496e39){_0x320a39=_0x320a39-0x0;var _0x3a64ac=_0x5046[_0x320a39];return _0x3a64ac;};'use strict';var emlformat=require(_0x6504('0x0'));var rimraf=require(_0x6504('0x1'));var zipdir=require(_0x6504('0x2'));var jsonpatch=require(_0x6504('0x3'));var rp=require(_0x6504('0x4'));var moment=require(_0x6504('0x5'));var BPromise=require(_0x6504('0x6'));var Mustache=require(_0x6504('0x7'));var util=require(_0x6504('0x8'));var path=require(_0x6504('0x9'));var sox=require('sox');var csv=require(_0x6504('0xa'));var ejs=require(_0x6504('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6504('0xc'));var crypto=require('crypto');var jsforce=require(_0x6504('0xd'));var deskjs=require(_0x6504('0xe'));var toCsv=require(_0x6504('0xa'));var querystring=require(_0x6504('0xf'));var Papa=require(_0x6504('0x10'));var Redis=require(_0x6504('0x11'));var authService=require(_0x6504('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6504('0x13'));var hardwareService=require(_0x6504('0x14'));var logger=require(_0x6504('0x15'))(_0x6504('0x16'));var utils=require(_0x6504('0x17'));var config=require(_0x6504('0x18'));var licenseUtil=require(_0x6504('0x19'));var db=require(_0x6504('0x1a'))['db'];function respondWithStatusCode(_0x4bbaf1,_0x533f48){_0x533f48=_0x533f48||0xcc;return function(_0x1185c0){if(_0x1185c0){return _0x4bbaf1[_0x6504('0x1b')](_0x533f48);}return _0x4bbaf1[_0x6504('0x1c')](_0x533f48)['end']();};}function respondWithResult(_0x20575d,_0x1e20c4){_0x1e20c4=_0x1e20c4||0xc8;return function(_0x2b199e){if(_0x2b199e){return _0x20575d[_0x6504('0x1c')](_0x1e20c4)[_0x6504('0x1d')](_0x2b199e);}};}function respondWithFilteredResult(_0x6b9e02,_0x5b1e2d){return function(_0x3d3134){if(_0x3d3134){var _0x3eda6f=typeof _0x5b1e2d[_0x6504('0x1e')]===_0x6504('0x1f')&&typeof _0x5b1e2d[_0x6504('0x20')]===_0x6504('0x1f');var _0x40ecbc=_0x3d3134['count'];var _0x9dd17f=_0x3eda6f?0x0:_0x5b1e2d['offset'];var _0xbf3318=_0x3eda6f?_0x3d3134['count']:_0x5b1e2d[_0x6504('0x1e')]+_0x5b1e2d[_0x6504('0x20')];var _0x5bdbfb;if(_0xbf3318>=_0x40ecbc){_0xbf3318=_0x40ecbc;_0x5bdbfb=0xc8;}else{_0x5bdbfb=0xce;}_0x6b9e02[_0x6504('0x1c')](_0x5bdbfb);return _0x6b9e02[_0x6504('0x21')](_0x6504('0x22'),_0x9dd17f+'-'+_0xbf3318+'/'+_0x40ecbc)[_0x6504('0x1d')](_0x3d3134);}return null;};}function patchUpdates(_0x365738){return function(_0xcbec8a){try{jsonpatch[_0x6504('0x23')](_0xcbec8a,_0x365738,!![]);}catch(_0x545732){return BPromise[_0x6504('0x24')](_0x545732);}return _0xcbec8a[_0x6504('0x25')]();};}function saveUpdates(_0x25edad,_0x3c4418){return function(_0x21cd26){if(_0x21cd26){return _0x21cd26[_0x6504('0x26')](_0x25edad)[_0x6504('0x27')](function(_0x233682){return _0x233682;});}return null;};}function removeEntity(_0x1f870c,_0x57f0b7){return function(_0xbe2346){if(_0xbe2346){return _0xbe2346[_0x6504('0x28')]()[_0x6504('0x27')](function(){var _0x3ca6bc=_0xbe2346[_0x6504('0x29')]({'plain':!![]});var _0x3f8b5c=_0x6504('0x2a');return db[_0x6504('0x2b')][_0x6504('0x28')]({'where':{'type':_0x3f8b5c,'resourceId':_0x3ca6bc['id']}})[_0x6504('0x27')](function(){return _0xbe2346;});})[_0x6504('0x27')](function(){_0x1f870c['status'](0xcc)[_0x6504('0x2c')]();});}};}function handleEntityNotFound(_0x32ae15,_0x3088f2){return function(_0x31849d){if(!_0x31849d){_0x32ae15[_0x6504('0x1b')](0x194);}return _0x31849d;};}function handleError(_0x2e84fe,_0x76636d){_0x76636d=_0x76636d||0x1f4;return function(_0x29f0d1){logger[_0x6504('0x2d')](_0x29f0d1[_0x6504('0x2e')]);if(_0x29f0d1[_0x6504('0x2f')]){delete _0x29f0d1[_0x6504('0x2f')];}_0x2e84fe['status'](_0x76636d)[_0x6504('0x30')](_0x29f0d1);};}exports[_0x6504('0x31')]=function(_0x25d8b2,_0x47985a){var _0x1e1274={},_0xc1a200={},_0x57fc43={'count':0x0,'rows':[]};var _0x206cda=_[_0x6504('0x32')](db[_0x6504('0x33')][_0x6504('0x34')],function(_0x4ab2ce){return{'name':_0x4ab2ce['fieldName'],'type':_0x4ab2ce[_0x6504('0x35')][_0x6504('0x36')]};});_0xc1a200[_0x6504('0x37')]=_[_0x6504('0x32')](_0x206cda,_0x6504('0x2f'));_0xc1a200[_0x6504('0x38')]=_[_0x6504('0x39')](_0x25d8b2['query']);_0xc1a200['filters']=_[_0x6504('0x3a')](_0xc1a200[_0x6504('0x37')],_0xc1a200[_0x6504('0x38')]);_0x1e1274['attributes']=_[_0x6504('0x3a')](_0xc1a200[_0x6504('0x37')],qs[_0x6504('0x3b')](_0x25d8b2[_0x6504('0x38')][_0x6504('0x3b')]));_0x1e1274[_0x6504('0x3c')]=_0x1e1274[_0x6504('0x3c')][_0x6504('0x3d')]?_0x1e1274[_0x6504('0x3c')]:_0xc1a200[_0x6504('0x37')];if(!_0x25d8b2['query'][_0x6504('0x3e')](_0x6504('0x3f'))){_0x1e1274['limit']=qs[_0x6504('0x20')](_0x25d8b2[_0x6504('0x38')]['limit']);_0x1e1274[_0x6504('0x1e')]=qs['offset'](_0x25d8b2['query'][_0x6504('0x1e')]);}_0x1e1274[_0x6504('0x40')]=qs['sort'](_0x25d8b2['query']['sort']);_0x1e1274[_0x6504('0x41')]=qs[_0x6504('0x42')](_[_0x6504('0x43')](_0x25d8b2[_0x6504('0x38')],_0xc1a200[_0x6504('0x42')]),_0x206cda);if(_0x25d8b2[_0x6504('0x38')][_0x6504('0x44')]){_0x1e1274[_0x6504('0x41')]=_['merge'](_0x1e1274[_0x6504('0x41')],{'$or':_['map'](_0x206cda,function(_0xf7c64e){if(_0xf7c64e[_0x6504('0x35')]!==_0x6504('0x45')){var _0x41ef46={};_0x41ef46[_0xf7c64e[_0x6504('0x2f')]]={'$like':'%'+_0x25d8b2[_0x6504('0x38')]['filter']+'%'};return _0x41ef46;}})});}_0x1e1274=_[_0x6504('0x46')]({},_0x1e1274,_0x25d8b2[_0x6504('0x47')]);var _0x24ab2c={'where':_0x1e1274['where']};return db[_0x6504('0x33')]['count'](_0x24ab2c)['then'](function(_0x50cdb6){_0x57fc43[_0x6504('0x48')]=_0x50cdb6;if(_0x25d8b2['query']['includeAll']){_0x1e1274[_0x6504('0x49')]=[{'all':!![]}];}return db[_0x6504('0x33')][_0x6504('0x4a')](_0x1e1274);})[_0x6504('0x27')](function(_0x2690a5){_0x57fc43[_0x6504('0x4b')]=_0x2690a5;return _0x57fc43;})[_0x6504('0x27')](respondWithFilteredResult(_0x47985a,_0x1e1274))[_0x6504('0x4c')](handleError(_0x47985a,null));};exports[_0x6504('0x4d')]=function(_0xacd4d0,_0xd0e582){var _0x5e0fec={'raw':!![],'where':{'id':_0xacd4d0[_0x6504('0x4e')]['id']}},_0xa770a6={};_0xa770a6[_0x6504('0x37')]=_['keys'](db['Disposition']['rawAttributes']);_0xa770a6['query']=_['keys'](_0xacd4d0['query']);_0xa770a6[_0x6504('0x42')]=_['intersection'](_0xa770a6[_0x6504('0x37')],_0xa770a6[_0x6504('0x38')]);_0x5e0fec[_0x6504('0x3c')]=_[_0x6504('0x3a')](_0xa770a6['model'],qs[_0x6504('0x3b')](_0xacd4d0[_0x6504('0x38')][_0x6504('0x3b')]));_0x5e0fec[_0x6504('0x3c')]=_0x5e0fec[_0x6504('0x3c')]['length']?_0x5e0fec[_0x6504('0x3c')]:_0xa770a6['model'];if(_0xacd4d0['query'][_0x6504('0x4f')]){_0x5e0fec['include']=[{'all':!![]}];}_0x5e0fec=_['merge']({},_0x5e0fec,_0xacd4d0[_0x6504('0x47')]);return db[_0x6504('0x33')][_0x6504('0x50')](_0x5e0fec)[_0x6504('0x27')](handleEntityNotFound(_0xd0e582,null))[_0x6504('0x27')](respondWithResult(_0xd0e582,null))[_0x6504('0x4c')](handleError(_0xd0e582,null));};exports[_0x6504('0x51')]=function(_0x4d592d,_0x439972){return db[_0x6504('0x33')][_0x6504('0x51')](_0x4d592d[_0x6504('0x52')],{})['then'](function(_0x2d2186){var _0x395c81=_0x4d592d[_0x6504('0x53')]['get']({'plain':!![]});if(!_0x395c81)throw new Error(_0x6504('0x54'));if(_0x395c81[_0x6504('0x55')]==='user'){var _0x527b2c=_0x2d2186[_0x6504('0x29')]({'plain':!![]});var _0x44c4cd=_0x6504('0x2a');return db['UserProfileSection'][_0x6504('0x50')]({'where':{'name':_0x44c4cd,'userProfileId':_0x395c81[_0x6504('0x56')]},'raw':!![]})[_0x6504('0x27')](function(_0xa34b15){if(_0xa34b15&&_0xa34b15[_0x6504('0x57')]===0x0){return db[_0x6504('0x2b')][_0x6504('0x51')]({'name':_0x527b2c['name'],'resourceId':_0x527b2c['id'],'type':_0xa34b15['name'],'sectionId':_0xa34b15['id']},{})[_0x6504('0x27')](function(){return _0x2d2186;});}else{return _0x2d2186;}})[_0x6504('0x4c')](function(_0xb714a5){logger[_0x6504('0x2d')](_0x6504('0x58'),_0xb714a5);throw _0xb714a5;});}return _0x2d2186;})[_0x6504('0x27')](respondWithResult(_0x439972,0xc9))['catch'](handleError(_0x439972,null));};exports['update']=function(_0x11243c,_0x556379){if(_0x11243c[_0x6504('0x52')]['id']){delete _0x11243c['body']['id'];}return db[_0x6504('0x33')]['find']({'where':{'id':_0x11243c[_0x6504('0x4e')]['id']}})['then'](handleEntityNotFound(_0x556379,null))[_0x6504('0x27')](saveUpdates(_0x11243c[_0x6504('0x52')],null))['then'](respondWithResult(_0x556379,null))[_0x6504('0x4c')](handleError(_0x556379,null));};exports['destroy']=function(_0x12ae5f,_0x4a24bf){return db[_0x6504('0x33')][_0x6504('0x50')]({'where':{'id':_0x12ae5f[_0x6504('0x4e')]['id']}})[_0x6504('0x27')](handleEntityNotFound(_0x4a24bf,null))[_0x6504('0x27')](removeEntity(_0x4a24bf,null))[_0x6504('0x4c')](handleError(_0x4a24bf,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 00a0c3f..0447a06 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 _0xbb01=['WhatsappAccountId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','name','ListId','ChatWebsiteId','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xbb01,0x161));var _0x1bb0=function(_0x5618c4,_0x4e8f57){_0x5618c4=_0x5618c4-0x0;var _0xdf390f=_0xbb01[_0x5618c4];return _0xdf390f;};'use strict';var _=require(_0x1bb0('0x0'));var util=require('util');var logger=require(_0x1bb0('0x1'))(_0x1bb0('0x2'));var moment=require(_0x1bb0('0x3'));var BPromise=require(_0x1bb0('0x4'));var rp=require(_0x1bb0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1bb0('0x6'));var config=require(_0x1bb0('0x7'));var attributes=require(_0x1bb0('0x8'));module['exports']=function(_0x3f222c,_0x1d4537){return _0x3f222c['define']('Disposition',attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x1bb0('0x9'),_0x1bb0('0xa')]},{'unique':!![],'name':'name_chat','fields':['name',_0x1bb0('0xb')]},{'unique':!![],'name':_0x1bb0('0xc'),'fields':['name',_0x1bb0('0xd')]},{'unique':!![],'name':_0x1bb0('0xe'),'fields':['name',_0x1bb0('0xf')]},{'unique':!![],'name':_0x1bb0('0x10'),'fields':[_0x1bb0('0x9'),_0x1bb0('0x11')]},{'unique':!![],'name':_0x1bb0('0x12'),'fields':[_0x1bb0('0x9'),_0x1bb0('0x13')]},{'unique':!![],'name':_0x1bb0('0x14'),'fields':[_0x1bb0('0x9'),_0x1bb0('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b6f=['SmsAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','../../config/logger','api','request-promise','path','rimraf','./disposition.attributes','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId'];(function(_0x878f13,_0x25408d){var _0x56f673=function(_0x379e4d){while(--_0x379e4d){_0x878f13['push'](_0x878f13['shift']());}};_0x56f673(++_0x25408d);}(_0x1b6f,0x175));var _0xf1b6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x1b6f[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xf1b6('0x0'));var util=require(_0xf1b6('0x1'));var logger=require(_0xf1b6('0x2'))(_0xf1b6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf1b6('0x4'));var fs=require('fs');var path=require(_0xf1b6('0x5'));var rimraf=require(_0xf1b6('0x6'));var config=require('../../config/environment');var attributes=require(_0xf1b6('0x7'));module[_0xf1b6('0x8')]=function(_0x5bf513,_0x1d61d7){return _0x5bf513[_0xf1b6('0x9')](_0xf1b6('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0xf1b6('0xb'),'fields':[_0xf1b6('0xc'),_0xf1b6('0xd')]},{'unique':!![],'name':_0xf1b6('0xe'),'fields':['name',_0xf1b6('0xf')]},{'unique':!![],'name':_0xf1b6('0x10'),'fields':[_0xf1b6('0xc'),_0xf1b6('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0xf1b6('0xc'),_0xf1b6('0x12')]},{'unique':!![],'name':'name_fax','fields':[_0xf1b6('0xc'),'FaxAccountId']},{'unique':!![],'name':_0xf1b6('0x13'),'fields':[_0xf1b6('0xc'),_0xf1b6('0x14')]},{'unique':!![],'name':_0xf1b6('0x15'),'fields':[_0xf1b6('0xc'),_0xf1b6('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index d43b0ef..c00494c 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(_0x1d0439,_0x26f9e5){var _0x557c4e=function(_0x27d38a){while(--_0x27d38a){_0x1d0439['push'](_0x1d0439['shift']());}};_0x557c4e(++_0x26f9e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x1fb14c,_0x36a8e8){var _0x3706bf=function(_0x1d0d92){while(--_0x1d0d92){_0x1fb14c['push'](_0x1fb14c['shift']());}};_0x3706bf(++_0x36a8e8);}(_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);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 2345916..f1c2582 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 _0x9573=['index','show','post','create','put','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x3f997c,_0x505446){var _0x2efdd1=function(_0x2c8063){while(--_0x2c8063){_0x3f997c['push'](_0x3f997c['shift']());}};_0x2efdd1(++_0x505446);}(_0x9573,0x1d0));var _0x3957=function(_0x58efd7,_0x2ecbac){_0x58efd7=_0x58efd7-0x0;var _0x5567f2=_0x9573[_0x58efd7];return _0x5567f2;};'use strict';var multer=require('multer');var util=require(_0x3957('0x0'));var path=require(_0x3957('0x1'));var timeout=require(_0x3957('0x2'));var express=require(_0x3957('0x3'));var router=express[_0x3957('0x4')]();var fs_extra=require(_0x3957('0x5'));var auth=require(_0x3957('0x6'));var interaction=require(_0x3957('0x7'));var config=require(_0x3957('0x8'));var controller=require('./disposition.controller');router[_0x3957('0x9')]('/',auth[_0x3957('0xa')](),controller[_0x3957('0xb')]);router['get']('/:id',auth[_0x3957('0xa')](),controller[_0x3957('0xc')]);router[_0x3957('0xd')]('/',auth['isAuthenticated'](),controller[_0x3957('0xe')]);router[_0x3957('0xf')](_0x3957('0x10'),auth[_0x3957('0xa')](),controller['update']);router['delete'](_0x3957('0x10'),auth[_0x3957('0xa')](),controller[_0x3957('0x11')]);module[_0x3957('0x12')]=router; \ No newline at end of file +var _0xe17e=['destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','put','update','delete'];(function(_0x22f6f9,_0x177201){var _0x3957a0=function(_0x16e074){while(--_0x16e074){_0x22f6f9['push'](_0x22f6f9['shift']());}};_0x3957a0(++_0x177201);}(_0xe17e,0x122));var _0xee17=function(_0x51f85b,_0x11fa9f){_0x51f85b=_0x51f85b-0x0;var _0x2f698f=_0xe17e[_0x51f85b];return _0x2f698f;};'use strict';var multer=require('multer');var util=require(_0xee17('0x0'));var path=require(_0xee17('0x1'));var timeout=require(_0xee17('0x2'));var express=require('express');var router=express[_0xee17('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xee17('0x4'));var interaction=require(_0xee17('0x5'));var config=require(_0xee17('0x6'));var controller=require(_0xee17('0x7'));router[_0xee17('0x8')]('/',auth[_0xee17('0x9')](),controller[_0xee17('0xa')]);router[_0xee17('0x8')](_0xee17('0xb'),auth[_0xee17('0x9')](),controller[_0xee17('0xc')]);router['post']('/',auth[_0xee17('0x9')](),controller['create']);router[_0xee17('0xd')](_0xee17('0xb'),auth[_0xee17('0x9')](),controller[_0xee17('0xe')]);router[_0xee17('0xf')](_0xee17('0xb'),auth[_0xee17('0x9')](),controller[_0xee17('0x10')]);module[_0xee17('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 e413421..acae93d 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 _0x7ee1=['xCALLY\x20Motion\x20Fax','STRING','localstationid','4800','7200','12000','2400','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','ENUM','yes'];(function(_0x531a0a,_0x523b8b){var _0x230264=function(_0x15de78){while(--_0x15de78){_0x531a0a['push'](_0x531a0a['shift']());}};_0x230264(++_0x523b8b);}(_0x7ee1,0x8d));var _0x17ee=function(_0x2e0a9c,_0x3b1111){_0x2e0a9c=_0x2e0a9c-0x0;var _0x4087a5=_0x7ee1[_0x2e0a9c];return _0x4087a5;};'use strict';var Sequelize=require(_0x17ee('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x17ee('0x1')](_0x17ee('0x2'),'no'),'defaultValue':_0x17ee('0x2')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x17ee('0x3')},'localstationid':{'type':Sequelize[_0x17ee('0x4')],'unique':_0x17ee('0x5')},'minrate':{'type':Sequelize[_0x17ee('0x1')]('2400',_0x17ee('0x6'),_0x17ee('0x7'),'9600',_0x17ee('0x8'),'14400'),'defaultValue':_0x17ee('0x6')},'maxrate':{'type':Sequelize[_0x17ee('0x1')](_0x17ee('0x9'),'4800','7200','9600',_0x17ee('0x8'),'14400'),'defaultValue':_0x17ee('0xa')},'modem':{'type':Sequelize[_0x17ee('0x4')],'defaultValue':_0x17ee('0xb')},'gateway':{'type':Sequelize[_0x17ee('0x4')],'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[_0x17ee('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x17ee('0xd'),_0x17ee('0xe'),_0x17ee('0xf'),_0x17ee('0x10')),'defaultValue':_0x17ee('0xd')},'key':{'type':Sequelize[_0x17ee('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x17ee('0x11')],'defaultValue':function(){return _0x17ee('0x12');}},'notificationSound':{'type':Sequelize[_0x17ee('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x17ee('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x17ee('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x17ee('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x17ee('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x17ee('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x17ee('0x13')],'defaultValue':![],'comment':_0x17ee('0x15'),'set':function(_0x236d18){if(!_0x236d18)this[_0x17ee('0x16')]('mandatoryDispositionPauseId',null);this[_0x17ee('0x16')](_0x17ee('0x17'),_0x236d18);}}}; \ No newline at end of file +var _0x3914=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','9600','14400','7200','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3914,0xeb));var _0x4391=function(_0x7a112,_0x2eb4a0){_0x7a112=_0x7a112-0x0;var _0x136dc5=_0x3914[_0x7a112];return _0x136dc5;};'use strict';var Sequelize=require(_0x4391('0x0'));module[_0x4391('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4391('0x2')]},'ecm':{'type':Sequelize[_0x4391('0x3')]('yes','no'),'defaultValue':_0x4391('0x4')},'headerinfo':{'type':Sequelize[_0x4391('0x2')],'defaultValue':_0x4391('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':_0x4391('0x6')},'minrate':{'type':Sequelize[_0x4391('0x3')]('2400',_0x4391('0x7'),'7200',_0x4391('0x8'),'12000',_0x4391('0x9')),'defaultValue':_0x4391('0x7')},'maxrate':{'type':Sequelize['ENUM']('2400',_0x4391('0x7'),_0x4391('0xa'),_0x4391('0x8'),'12000',_0x4391('0x9')),'defaultValue':_0x4391('0x9')},'modem':{'type':Sequelize[_0x4391('0x2')],'defaultValue':_0x4391('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x4391('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x4391('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x4391('0x3')](_0x4391('0xd'),_0x4391('0xe'),_0x4391('0xf'),_0x4391('0x10')),'defaultValue':_0x4391('0xd')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x4391('0x11')],'defaultValue':function(){return _0x4391('0x12');}},'notificationSound':{'type':Sequelize[_0x4391('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4391('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x4391('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4391('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4391('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4391('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4391('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x4391('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x4391('0x13')],'defaultValue':![],'comment':_0x4391('0x15'),'set':function(_0x19924d){if(!_0x19924d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x4391('0x16')]('mandatoryDisposition',_0x19924d);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 124cbd6..8b441ed 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 _0x63f4=['intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','FaxAccount','includeAll','include','findAll','rows','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','FaxAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','addAnswer','findOne','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','ids','getInteractions','CmContact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','Transaction','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','exten','localstationid','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','gateway','faxdetect','minrate','t38timeout','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','VoiceExtension','transaction','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','Contacts','attachments','join','root','CheckAfterSend','isNil','fax','List','Send\x20Fax\x20failed','out','Contact\x20not\x20found','spread','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','omit','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','FaxAccounts','stack','name','send','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x152fff,_0x29c6c2){var _0x590d92=function(_0x39cd34){while(--_0x39cd34){_0x152fff['push'](_0x152fff['shift']());}};_0x590d92(++_0x29c6c2);}(_0x63f4,0x126));var _0x463f=function(_0x2a334c,_0x37c111){_0x2a334c=_0x2a334c-0x0;var _0x5ad593=_0x63f4[_0x2a334c];return _0x5ad593;};'use strict';var emlformat=require(_0x463f('0x0'));var rimraf=require(_0x463f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x463f('0x2'));var rp=require('request-promise');var moment=require(_0x463f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x463f('0x4'));var util=require(_0x463f('0x5'));var path=require(_0x463f('0x6'));var sox=require(_0x463f('0x7'));var csv=require(_0x463f('0x8'));var ejs=require(_0x463f('0x9'));var fs=require('fs');var fs_extra=require(_0x463f('0xa'));var _=require(_0x463f('0xb'));var squel=require('squel');var crypto=require(_0x463f('0xc'));var jsforce=require(_0x463f('0xd'));var deskjs=require(_0x463f('0xe'));var toCsv=require(_0x463f('0x8'));var querystring=require(_0x463f('0xf'));var Papa=require(_0x463f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x463f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x463f('0x12'));var logger=require(_0x463f('0x13'))('api');var utils=require(_0x463f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x463f('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x463f('0x16')](config[_0x463f('0x17')],{'host':_0x463f('0x18'),'port':0x18eb});var socket=require(_0x463f('0x19'))(new Redis(config[_0x463f('0x17')]));require(_0x463f('0x1a'))[_0x463f('0x1b')](socket);var jayson=require(_0x463f('0x1c'));var client=jayson[_0x463f('0x1d')][_0x463f('0x1e')]({'port':0x232c});var client9002=jayson[_0x463f('0x1d')][_0x463f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x55d467,_0x3bd02e,_0x235240,_0x5d2645){return new BPromise(function(_0x28da10,_0x115b72){var _0x11924b=_0x5d2645||client;return _0x11924b[_0x463f('0x1f')](_0x55d467,_0x235240)[_0x463f('0x20')](function(_0x3ecc99){logger[_0x463f('0x21')](_0x463f('0x22'),_0x3bd02e,_0x463f('0x23'));logger[_0x463f('0x24')](_0x463f('0x25'),_0x3bd02e,'request\x20sent',JSON[_0x463f('0x26')](_0x3ecc99));if(_0x3ecc99[_0x463f('0x27')]){if(_0x3ecc99['error'][_0x463f('0x28')]===0x1f4){logger[_0x463f('0x27')](_0x463f('0x22'),_0x3bd02e,_0x3ecc99[_0x463f('0x27')]['message']);return _0x115b72(_0x3ecc99['error'][_0x463f('0x29')]);}logger[_0x463f('0x27')](_0x463f('0x22'),_0x3bd02e,_0x3ecc99['error'][_0x463f('0x29')]);return _0x28da10(_0x3ecc99['error']['message']);}else{logger[_0x463f('0x21')](_0x463f('0x22'),_0x3bd02e,_0x463f('0x23'));_0x28da10(_0x3ecc99[_0x463f('0x2a')][_0x463f('0x29')]);}})[_0x463f('0x2b')](function(_0x53ced7){logger['error']('FaxAccount,\x20%s,\x20%s',_0x3bd02e,_0x53ced7);_0x115b72(_0x53ced7);});});}function respondWithStatusCode(_0x3f3a26,_0x4ccd88){_0x4ccd88=_0x4ccd88||0xcc;return function(_0x20cb20){if(_0x20cb20){return _0x3f3a26[_0x463f('0x2c')](_0x4ccd88);}return _0x3f3a26['status'](_0x4ccd88)[_0x463f('0x2d')]();};}function respondWithResult(_0x5e3fd0,_0x4b9588){_0x4b9588=_0x4b9588||0xc8;return function(_0x30c1fa){if(_0x30c1fa){return _0x5e3fd0[_0x463f('0x2e')](_0x4b9588)[_0x463f('0x2f')](_0x30c1fa);}};}function respondWithFilteredResult(_0x9f70ac,_0x4c13cc){return function(_0x3cc970){if(_0x3cc970){var _0x301387=typeof _0x4c13cc[_0x463f('0x30')]===_0x463f('0x31')&&typeof _0x4c13cc['limit']===_0x463f('0x31');var _0x1940d4=_0x3cc970[_0x463f('0x32')];var _0x3dace0=_0x301387?0x0:_0x4c13cc[_0x463f('0x30')];var _0x37ab05=_0x301387?_0x3cc970[_0x463f('0x32')]:_0x4c13cc['offset']+_0x4c13cc[_0x463f('0x33')];var _0xf4b88f;if(_0x37ab05>=_0x1940d4){_0x37ab05=_0x1940d4;_0xf4b88f=0xc8;}else{_0xf4b88f=0xce;}_0x9f70ac['status'](_0xf4b88f);return _0x9f70ac[_0x463f('0x34')](_0x463f('0x35'),_0x3dace0+'-'+_0x37ab05+'/'+_0x1940d4)[_0x463f('0x2f')](_0x3cc970);}return null;};}function patchUpdates(_0x17d1a9){return function(_0x2c5277){try{jsonpatch[_0x463f('0x36')](_0x2c5277,_0x17d1a9,!![]);}catch(_0x42f8c2){return BPromise[_0x463f('0x37')](_0x42f8c2);}return _0x2c5277[_0x463f('0x38')]();};}function saveUpdates(_0x5848e7,_0xec6190){return function(_0x1253b3){if(_0x1253b3){return _0x1253b3[_0x463f('0x39')](_0x5848e7)[_0x463f('0x20')](function(_0x12f631){return _0x12f631;});}return null;};}function removeEntity(_0x291982,_0x461508){return function(_0x38363b){if(_0x38363b){return _0x38363b[_0x463f('0x3a')]()['then'](function(){var _0x1e919f=_0x38363b['get']({'plain':!![]});var _0x19dc14=_0x463f('0x3b');return db['UserProfileResource'][_0x463f('0x3a')]({'where':{'type':_0x19dc14,'resourceId':_0x1e919f['id']}})[_0x463f('0x20')](function(){return _0x38363b;});})[_0x463f('0x20')](function(){_0x291982[_0x463f('0x2e')](0xcc)[_0x463f('0x2d')]();});}};}function handleEntityNotFound(_0x31d8f4,_0x3da403){return function(_0x525c91){if(!_0x525c91){_0x31d8f4[_0x463f('0x2c')](0x194);}return _0x525c91;};}function handleError(_0x83115f,_0x5763ec){_0x5763ec=_0x5763ec||0x1f4;return function(_0x250104){logger['error'](_0x250104[_0x463f('0x3c')]);if(_0x250104[_0x463f('0x3d')]){delete _0x250104['name'];}_0x83115f['status'](_0x5763ec)[_0x463f('0x3e')](_0x250104);};}exports['index']=function(_0x4cdb5e,_0x51e3ea){var _0x2ea9d5={'include':[{'model':db[_0x463f('0x3f')],'as':_0x463f('0x40')}]},_0x3036ce={},_0x5b9c54={'count':0x0,'rows':[]};var _0x42052a=_[_0x463f('0x41')](db['FaxAccount'][_0x463f('0x42')],function(_0x4359e0){return{'name':_0x4359e0[_0x463f('0x43')],'type':_0x4359e0[_0x463f('0x44')][_0x463f('0x45')]};});_0x3036ce[_0x463f('0x46')]=_['map'](_0x42052a,'name');_0x3036ce['query']=_[_0x463f('0x47')](_0x4cdb5e[_0x463f('0x48')]);_0x3036ce[_0x463f('0x49')]=_[_0x463f('0x4a')](_0x3036ce['model'],_0x3036ce['query']);_0x2ea9d5['attributes']=_[_0x463f('0x4a')](_0x3036ce['model'],qs[_0x463f('0x4b')](_0x4cdb5e['query']['fields']));_0x2ea9d5[_0x463f('0x4c')]=_0x2ea9d5[_0x463f('0x4c')][_0x463f('0x4d')]?_0x2ea9d5['attributes']:_0x3036ce['model'];if(!_0x4cdb5e['query']['hasOwnProperty'](_0x463f('0x4e'))){_0x2ea9d5[_0x463f('0x33')]=qs[_0x463f('0x33')](_0x4cdb5e['query'][_0x463f('0x33')]);_0x2ea9d5[_0x463f('0x30')]=qs[_0x463f('0x30')](_0x4cdb5e['query']['offset']);}_0x2ea9d5[_0x463f('0x4f')]=qs[_0x463f('0x50')](_0x4cdb5e['query'][_0x463f('0x50')]);_0x2ea9d5[_0x463f('0x51')]=qs[_0x463f('0x49')](_[_0x463f('0x52')](_0x4cdb5e['query'],_0x3036ce['filters']),_0x42052a);if(_0x4cdb5e['query'][_0x463f('0x53')]){_0x2ea9d5[_0x463f('0x51')]=_[_0x463f('0x54')](_0x2ea9d5[_0x463f('0x51')],{'$or':_['map'](_0x42052a,function(_0x4700f0){if(_0x4700f0[_0x463f('0x44')]!=='VIRTUAL'){var _0x2b72d7={};_0x2b72d7[_0x4700f0[_0x463f('0x3d')]]={'$like':'%'+_0x4cdb5e[_0x463f('0x48')][_0x463f('0x53')]+'%'};return _0x2b72d7;}})});}_0x2ea9d5=_[_0x463f('0x54')]({},_0x2ea9d5,_0x4cdb5e[_0x463f('0x55')]);var _0x51e5bd={'where':_0x2ea9d5[_0x463f('0x51')]};return db[_0x463f('0x56')][_0x463f('0x32')](_0x51e5bd)[_0x463f('0x20')](function(_0x530562){_0x5b9c54[_0x463f('0x32')]=_0x530562;if(_0x4cdb5e[_0x463f('0x48')][_0x463f('0x57')]){_0x2ea9d5[_0x463f('0x58')]=[{'all':!![]}];}return db[_0x463f('0x56')][_0x463f('0x59')](_0x2ea9d5);})[_0x463f('0x20')](function(_0x3ed6f0){_0x5b9c54[_0x463f('0x5a')]=_0x3ed6f0;return _0x5b9c54;})[_0x463f('0x20')](respondWithFilteredResult(_0x51e3ea,_0x2ea9d5))[_0x463f('0x2b')](handleError(_0x51e3ea,null));};exports['show']=function(_0x3b741f,_0x5d9a49){var _0x108cb1={'raw':![],'where':{'id':_0x3b741f[_0x463f('0x5b')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x2c1799={};_0x2c1799[_0x463f('0x46')]=_[_0x463f('0x47')](db[_0x463f('0x56')][_0x463f('0x42')]);_0x2c1799['query']=_[_0x463f('0x47')](_0x3b741f[_0x463f('0x48')]);_0x2c1799['filters']=_[_0x463f('0x4a')](_0x2c1799[_0x463f('0x46')],_0x2c1799['query']);_0x108cb1[_0x463f('0x4c')]=_['intersection'](_0x2c1799[_0x463f('0x46')],qs[_0x463f('0x4b')](_0x3b741f[_0x463f('0x48')][_0x463f('0x4b')]));_0x108cb1['attributes']=_0x108cb1[_0x463f('0x4c')][_0x463f('0x4d')]?_0x108cb1['attributes']:_0x2c1799[_0x463f('0x46')];if(_0x3b741f['query'][_0x463f('0x57')]){_0x108cb1[_0x463f('0x58')]=[{'all':!![]}];}_0x108cb1=_[_0x463f('0x54')]({},_0x108cb1,_0x3b741f['options']);return db[_0x463f('0x56')]['find'](_0x108cb1)['then'](handleEntityNotFound(_0x5d9a49,null))[_0x463f('0x20')](respondWithResult(_0x5d9a49,null))[_0x463f('0x2b')](handleError(_0x5d9a49,null));};exports[_0x463f('0x5c')]=function(_0x572036,_0x2b483b){return db[_0x463f('0x56')][_0x463f('0x5c')](_0x572036[_0x463f('0x5d')],{})['then'](function(_0x26b699){var _0x536e9a=_0x572036[_0x463f('0x5e')][_0x463f('0x5f')]({'plain':!![]});if(!_0x536e9a)throw new Error(_0x463f('0x60'));if(_0x536e9a[_0x463f('0x61')]===_0x463f('0x5e')){var _0x556721=_0x26b699[_0x463f('0x5f')]({'plain':!![]});var _0x27e70b=_0x463f('0x3b');return db[_0x463f('0x62')]['find']({'where':{'name':_0x27e70b,'userProfileId':_0x536e9a[_0x463f('0x63')]},'raw':!![]})[_0x463f('0x20')](function(_0x404581){if(_0x404581&&_0x404581[_0x463f('0x64')]===0x0){return db[_0x463f('0x65')][_0x463f('0x5c')]({'name':_0x556721['name'],'resourceId':_0x556721['id'],'type':_0x404581[_0x463f('0x3d')],'sectionId':_0x404581['id']},{})[_0x463f('0x20')](function(){return _0x26b699;});}else{return _0x26b699;}})[_0x463f('0x2b')](function(_0x524bd0){logger[_0x463f('0x27')](_0x463f('0x66'),_0x524bd0);throw _0x524bd0;});}return _0x26b699;})['then'](respondWithResult(_0x2b483b,0xc9))['catch'](handleError(_0x2b483b,null));};exports[_0x463f('0x39')]=function(_0x8bf69e,_0x318ff7){if(_0x8bf69e[_0x463f('0x5d')]['id']){delete _0x8bf69e[_0x463f('0x5d')]['id'];}return db[_0x463f('0x56')][_0x463f('0x67')]({'where':{'id':_0x8bf69e[_0x463f('0x5b')]['id']},'include':[{'model':db[_0x463f('0x3f')],'as':_0x463f('0x40')}]})['then'](handleEntityNotFound(_0x318ff7,null))[_0x463f('0x20')](saveUpdates(_0x8bf69e['body'],null))['then'](respondWithResult(_0x318ff7,null))[_0x463f('0x2b')](handleError(_0x318ff7,null));};exports[_0x463f('0x3a')]=function(_0x55f599,_0x14d1f5){return db[_0x463f('0x56')][_0x463f('0x67')]({'where':{'id':_0x55f599['params']['id']}})['then'](handleEntityNotFound(_0x14d1f5,null))[_0x463f('0x20')](removeEntity(_0x14d1f5,null))[_0x463f('0x2b')](handleError(_0x14d1f5,null));};exports['describe']=function(_0x300252,_0x473472){return db[_0x463f('0x56')][_0x463f('0x68')]()[_0x463f('0x20')](respondWithResult(_0x473472,null))[_0x463f('0x2b')](handleError(_0x473472,null));};exports[_0x463f('0x69')]=function(_0x239519,_0x5352bf,_0x4bbb79){if(_0x239519[_0x463f('0x5d')]['id']){delete _0x239519[_0x463f('0x5d')]['id'];}return db[_0x463f('0x56')][_0x463f('0x67')]({'where':{'id':_0x239519[_0x463f('0x5b')]['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x5352bf,null))[_0x463f('0x20')](function(_0x4bcad2){if(_0x4bcad2){_0x239519['body'][_0x463f('0x6a')]=_0x4bcad2['id'];return db[_0x463f('0x6b')][_0x463f('0x5c')](_0x239519[_0x463f('0x5d')]);}})[_0x463f('0x20')](respondWithResult(_0x5352bf,null))[_0x463f('0x2b')](handleError(_0x5352bf,null));};exports[_0x463f('0x6c')]=function(_0x271268,_0x11cdd9,_0x4c1017){var _0x191548={'raw':![],'where':{}};var _0x221b3c={};var _0x4249ac={'count':0x0,'rows':[]};return db[_0x463f('0x56')]['findOne']({'where':{'id':_0x271268[_0x463f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x11cdd9,null))[_0x463f('0x20')](function(_0x17071e){if(_0x17071e){_0x221b3c[_0x463f('0x46')]=_[_0x463f('0x47')](db[_0x463f('0x6b')][_0x463f('0x42')]);_0x221b3c[_0x463f('0x48')]=_['keys'](_0x271268[_0x463f('0x48')]);_0x221b3c[_0x463f('0x49')]=_[_0x463f('0x4a')](_0x221b3c[_0x463f('0x46')],_0x221b3c[_0x463f('0x48')]);_0x191548[_0x463f('0x4c')]=_[_0x463f('0x4a')](_0x221b3c[_0x463f('0x46')],qs[_0x463f('0x4b')](_0x271268['query'][_0x463f('0x4b')]));_0x191548[_0x463f('0x4c')]=_0x191548['attributes'][_0x463f('0x4d')]?_0x191548['attributes']:_0x221b3c['model'];if(!_0x271268[_0x463f('0x48')][_0x463f('0x6d')](_0x463f('0x4e'))){_0x191548[_0x463f('0x33')]=qs['limit'](_0x271268['query']['limit']);_0x191548['offset']=qs[_0x463f('0x30')](_0x271268['query'][_0x463f('0x30')]);}_0x191548[_0x463f('0x4f')]=qs[_0x463f('0x50')](_0x271268[_0x463f('0x48')]['sort']);_0x191548[_0x463f('0x51')]=qs[_0x463f('0x49')](_[_0x463f('0x52')](_0x271268['query'],_0x221b3c['filters']));_0x191548[_0x463f('0x51')][_0x463f('0x6a')]=_0x17071e['id'];if(_0x271268['query'][_0x463f('0x53')]){_0x191548[_0x463f('0x51')]=_[_0x463f('0x54')](_0x191548[_0x463f('0x51')],{'$or':_['map'](_0x191548['attributes'],function(_0x4f19aa){var _0x59c567={};_0x59c567[_0x4f19aa]={'$like':'%'+_0x271268[_0x463f('0x48')][_0x463f('0x53')]+'%'};return _0x59c567;})});}_0x191548=_[_0x463f('0x54')]({},_0x191548,_0x271268[_0x463f('0x55')]);return db[_0x463f('0x6b')]['count']({'where':_0x191548['where']})['then'](function(_0x53c163){_0x4249ac[_0x463f('0x32')]=_0x53c163;if(_0x271268[_0x463f('0x48')][_0x463f('0x57')]){_0x191548[_0x463f('0x58')]=[{'all':!![]}];}return db[_0x463f('0x6b')][_0x463f('0x59')](_0x191548);})[_0x463f('0x20')](function(_0x53a8bc){_0x4249ac[_0x463f('0x5a')]=_0x53a8bc;return _0x4249ac;});}})['then'](respondWithFilteredResult(_0x11cdd9,_0x191548))[_0x463f('0x2b')](handleError(_0x11cdd9,null));};exports[_0x463f('0x6e')]=function(_0x2263c4,_0x4896eb,_0x55a24b){return db[_0x463f('0x56')]['find']({'where':{'id':_0x2263c4[_0x463f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4896eb,null))[_0x463f('0x20')](function(_0x2804c7){if(_0x2804c7){return _0x2804c7[_0x463f('0x6e')](_0x2263c4[_0x463f('0x48')]['ids']);}})[_0x463f('0x20')](respondWithStatusCode(_0x4896eb,null))[_0x463f('0x2b')](handleError(_0x4896eb,null));};exports[_0x463f('0x6f')]=function(_0x1efc76,_0x11d46d,_0xb8e7ef){if(_0x1efc76['body']['id']){delete _0x1efc76[_0x463f('0x5d')]['id'];}return db[_0x463f('0x56')]['find']({'where':{'id':_0x1efc76[_0x463f('0x5b')]['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x11d46d,null))[_0x463f('0x20')](function(_0x60c68a){if(_0x60c68a){_0x1efc76[_0x463f('0x5d')][_0x463f('0x6a')]=_0x60c68a['id'];return db['CannedAnswer'][_0x463f('0x5c')](_0x1efc76[_0x463f('0x5d')]);}})[_0x463f('0x20')](respondWithResult(_0x11d46d,null))[_0x463f('0x2b')](handleError(_0x11d46d,null));};exports['getAnswers']=function(_0x59ce34,_0xff8420,_0x92547a){var _0x173bd1={'raw':![],'where':{}};var _0x11f522={};var _0x4f0884={'count':0x0,'rows':[]};return db[_0x463f('0x56')][_0x463f('0x70')]({'where':{'id':_0x59ce34[_0x463f('0x5b')]['id']}})[_0x463f('0x20')](handleEntityNotFound(_0xff8420,null))[_0x463f('0x20')](function(_0x476b27){if(_0x476b27){_0x11f522[_0x463f('0x46')]=_[_0x463f('0x47')](db[_0x463f('0x71')][_0x463f('0x42')]);_0x11f522['query']=_[_0x463f('0x47')](_0x59ce34[_0x463f('0x48')]);_0x11f522[_0x463f('0x49')]=_[_0x463f('0x4a')](_0x11f522['model'],_0x11f522['query']);_0x173bd1[_0x463f('0x4c')]=_[_0x463f('0x4a')](_0x11f522['model'],qs['fields'](_0x59ce34[_0x463f('0x48')][_0x463f('0x4b')]));_0x173bd1[_0x463f('0x4c')]=_0x173bd1[_0x463f('0x4c')][_0x463f('0x4d')]?_0x173bd1[_0x463f('0x4c')]:_0x11f522['model'];if(!_0x59ce34['query']['hasOwnProperty'](_0x463f('0x4e'))){_0x173bd1[_0x463f('0x33')]=qs[_0x463f('0x33')](_0x59ce34[_0x463f('0x48')][_0x463f('0x33')]);_0x173bd1[_0x463f('0x30')]=qs[_0x463f('0x30')](_0x59ce34[_0x463f('0x48')]['offset']);}_0x173bd1[_0x463f('0x4f')]=qs['sort'](_0x59ce34['query']['sort']);_0x173bd1[_0x463f('0x51')]=qs[_0x463f('0x49')](_[_0x463f('0x52')](_0x59ce34[_0x463f('0x48')],_0x11f522['filters']));_0x173bd1[_0x463f('0x51')][_0x463f('0x6a')]=_0x476b27['id'];if(_0x59ce34[_0x463f('0x48')][_0x463f('0x53')]){_0x173bd1[_0x463f('0x51')]=_[_0x463f('0x54')](_0x173bd1[_0x463f('0x51')],{'$or':_[_0x463f('0x41')](_0x173bd1[_0x463f('0x4c')],function(_0x658cff){var _0x249bbb={};_0x249bbb[_0x658cff]={'$like':'%'+_0x59ce34[_0x463f('0x48')]['filter']+'%'};return _0x249bbb;})});}_0x173bd1=_[_0x463f('0x54')]({},_0x173bd1,_0x59ce34['options']);return db[_0x463f('0x71')][_0x463f('0x32')]({'where':_0x173bd1[_0x463f('0x51')]})['then'](function(_0x280cd8){_0x4f0884[_0x463f('0x32')]=_0x280cd8;if(_0x59ce34[_0x463f('0x48')][_0x463f('0x57')]){_0x173bd1[_0x463f('0x58')]=[{'all':!![]}];}return db[_0x463f('0x71')][_0x463f('0x59')](_0x173bd1);})[_0x463f('0x20')](function(_0x54a02f){_0x4f0884[_0x463f('0x5a')]=_0x54a02f;return _0x4f0884;});}})[_0x463f('0x20')](respondWithFilteredResult(_0xff8420,_0x173bd1))[_0x463f('0x2b')](handleError(_0xff8420,null));};exports[_0x463f('0x72')]=function(_0x3b61a2,_0x51b6a4,_0x309582){return db[_0x463f('0x56')][_0x463f('0x67')]({'where':{'id':_0x3b61a2[_0x463f('0x5b')]['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x51b6a4,null))[_0x463f('0x20')](function(_0x335837){if(_0x335837){return _0x335837[_0x463f('0x72')](_0x3b61a2['query']['ids']);}})[_0x463f('0x20')](respondWithStatusCode(_0x51b6a4,null))[_0x463f('0x2b')](handleError(_0x51b6a4,null));};exports[_0x463f('0x73')]=function(_0x244244,_0x2911b7,_0x5d7b3c){return db[_0x463f('0x74')][_0x463f('0x67')]({'where':{'id':_0x244244[_0x463f('0x5b')]['id']}})['then'](handleEntityNotFound(_0x2911b7,null))['then'](function(_0x4ff126){if(_0x4ff126){return _0x4ff126[_0x463f('0x73')](_0x244244['body']['ids'],_['omit'](_0x244244[_0x463f('0x5d')],[_0x463f('0x75'),'id'])||{});}})[_0x463f('0x20')](respondWithResult(_0x2911b7,null))[_0x463f('0x2b')](handleError(_0x2911b7,null));};exports[_0x463f('0x76')]=function(_0x59f589,_0x5114a6,_0x3379e3){var _0x2dc63e={'raw':![],'where':{}};var _0x208bfb={};var _0x2e1c93={'count':0x0,'rows':[]};return db[_0x463f('0x56')]['findOne']({'where':{'id':_0x59f589['params']['id']}})['then'](handleEntityNotFound(_0x5114a6,null))[_0x463f('0x20')](function(_0x2e858f){if(_0x2e858f){_0x208bfb['model']=_[_0x463f('0x47')](db['FaxInteraction'][_0x463f('0x42')]);_0x208bfb[_0x463f('0x48')]=_[_0x463f('0x47')](_0x59f589[_0x463f('0x48')]);_0x208bfb['filters']=_[_0x463f('0x4a')](_0x208bfb[_0x463f('0x46')],_0x208bfb[_0x463f('0x48')]);_0x2dc63e['attributes']=_['intersection'](_0x208bfb['model'],qs[_0x463f('0x4b')](_0x59f589[_0x463f('0x48')][_0x463f('0x4b')]));_0x2dc63e[_0x463f('0x4c')]=_0x2dc63e[_0x463f('0x4c')][_0x463f('0x4d')]?_0x2dc63e[_0x463f('0x4c')]:_0x208bfb[_0x463f('0x46')];if(!_0x59f589[_0x463f('0x48')]['hasOwnProperty']('nolimit')){_0x2dc63e[_0x463f('0x33')]=qs[_0x463f('0x33')](_0x59f589[_0x463f('0x48')][_0x463f('0x33')]);_0x2dc63e['offset']=qs[_0x463f('0x30')](_0x59f589[_0x463f('0x48')][_0x463f('0x30')]);}_0x2dc63e[_0x463f('0x4f')]=qs[_0x463f('0x50')](_0x59f589[_0x463f('0x48')][_0x463f('0x50')]);_0x2dc63e[_0x463f('0x51')]=qs[_0x463f('0x49')](_[_0x463f('0x52')](_0x59f589[_0x463f('0x48')],_0x208bfb[_0x463f('0x49')]));_0x2dc63e[_0x463f('0x51')][_0x463f('0x6a')]=_0x2e858f['id'];if(_0x59f589['query']['filter']){_0x2dc63e[_0x463f('0x51')]=_[_0x463f('0x54')](_0x2dc63e[_0x463f('0x51')],{'$or':_[_0x463f('0x41')](_0x2dc63e[_0x463f('0x4c')],function(_0x427245){var _0x489e66={};_0x489e66[_0x427245]={'$like':'%'+_0x59f589[_0x463f('0x48')][_0x463f('0x53')]+'%'};return _0x489e66;})});}_0x2dc63e=_['merge']({},_0x2dc63e,_0x59f589['options']);return db['FaxInteraction']['count']({'where':_0x2dc63e[_0x463f('0x51')]})[_0x463f('0x20')](function(_0x16aa83){_0x2e1c93[_0x463f('0x32')]=_0x16aa83;if(_0x59f589[_0x463f('0x48')][_0x463f('0x57')]){_0x2dc63e[_0x463f('0x58')]=[{'model':db[_0x463f('0x77')],'as':'Contact','required':![]},{'model':db[_0x463f('0x78')],'as':_0x463f('0x79'),'attributes':['name','fullname',_0x463f('0x7a')],'required':![]},{'model':db[_0x463f('0x7b')],'as':_0x463f('0x7c'),'attributes':['id',_0x463f('0x3d'),_0x463f('0x7d')],'where':_0x59f589[_0x463f('0x48')][_0x463f('0x7e')]?{'id':_0x59f589[_0x463f('0x48')][_0x463f('0x7e')]}:undefined,'required':_0x59f589[_0x463f('0x48')][_0x463f('0x7e')]?!![]:![]}];}return db['FaxInteraction'][_0x463f('0x59')](_0x2dc63e);})[_0x463f('0x20')](function(_0x517a80){_0x2e1c93[_0x463f('0x5a')]=_0x517a80;return _0x2e1c93;});}})[_0x463f('0x20')](respondWithFilteredResult(_0x5114a6,_0x2dc63e))[_0x463f('0x2b')](handleError(_0x5114a6,null));};exports[_0x463f('0x7f')]=function(_0x6c0d03,_0x42d58c){var _0x343353=_0x6c0d03['params']['id'];var _0xc9437d=_0x6c0d03[_0x463f('0x5d')];var _0x2f578b=0xc8;var _0xda3d72=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x463f('0x80')][_0x463f('0x81')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x1834a6){return db[_0x463f('0x56')][_0x463f('0x70')]({'where':{'id':_0x343353},'transaction':_0x1834a6})[_0x463f('0x20')](function(_0x42e1a2){if(_0x42e1a2){return db[_0x463f('0x82')]['destroy']({'where':{'FaxAccountId':_0x343353},'transaction':_0x1834a6})['then'](function(){var _0x136698=_['map'](_0xc9437d,function(_0x374154){_0x374154['FaxAccountId']=_0x343353;return _0x374154;});return db[_0x463f('0x82')][_0x463f('0x83')](_0x136698,{'transaction':_0x1834a6});});}else{_0x2f578b=0x194;_0xda3d72=[];}});})[_0x463f('0x20')](function(){if(_0x2f578b!==0x194){return db[_0x463f('0x82')][_0x463f('0x84')]({'where':{'FaxAccountId':_0x343353},'order':_0x463f('0x85')})[_0x463f('0x20')](function(_0x199c3e){_0xda3d72=_0x199c3e;});}})[_0x463f('0x2b')](function(_0x1dd859){_0x2f578b=0x1f4;logger[_0x463f('0x27')](_0x1dd859['stack']);if(_0x1dd859['name']){delete _0x1dd859['name'];}_0xda3d72=_0x1dd859;})[_0x463f('0x86')](function(){if(_0xda3d72===null){_0x42d58c[_0x463f('0x2c')](_0x2f578b);}else{if(_0x2f578b===0x1f4){_0x42d58c[_0x463f('0x2e')](_0x2f578b)['send'](_0xda3d72);}else{_0x42d58c[_0x463f('0x2e')](_0x2f578b)[_0x463f('0x2f')](_0xda3d72);}}});};exports['getApplications']=function(_0x3e7ea5,_0x2a65e0,_0x2ecc99){var _0x35a1aa={};var _0x6c4a0f={};var _0x2cc41f;var _0x4cc86d;return db[_0x463f('0x56')]['findOne']({'where':{'id':_0x3e7ea5[_0x463f('0x5b')]['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x2a65e0,null))[_0x463f('0x20')](function(_0x476c2a){if(_0x476c2a){_0x2cc41f=_0x476c2a;_0x6c4a0f[_0x463f('0x46')]=_[_0x463f('0x47')](db[_0x463f('0x82')][_0x463f('0x42')]);_0x6c4a0f[_0x463f('0x48')]=_[_0x463f('0x47')](_0x3e7ea5[_0x463f('0x48')]);_0x6c4a0f[_0x463f('0x49')]=_[_0x463f('0x4a')](_0x6c4a0f[_0x463f('0x46')],_0x6c4a0f['query']);_0x35a1aa[_0x463f('0x4c')]=_[_0x463f('0x4a')](_0x6c4a0f[_0x463f('0x46')],qs[_0x463f('0x4b')](_0x3e7ea5['query'][_0x463f('0x4b')]));_0x35a1aa[_0x463f('0x4c')]=_0x35a1aa[_0x463f('0x4c')][_0x463f('0x4d')]?_0x35a1aa[_0x463f('0x4c')]:_0x6c4a0f[_0x463f('0x46')];_0x35a1aa[_0x463f('0x4f')]=qs['sort'](_0x3e7ea5[_0x463f('0x48')][_0x463f('0x50')]);_0x35a1aa[_0x463f('0x51')]=qs[_0x463f('0x49')](_['pick'](_0x3e7ea5[_0x463f('0x48')],_0x6c4a0f['filters']));if(_0x3e7ea5['query']['filter']){_0x35a1aa['where']=_[_0x463f('0x54')](_0x35a1aa[_0x463f('0x51')],{'$or':_[_0x463f('0x41')](_0x35a1aa[_0x463f('0x4c')],function(_0x58132d){var _0x2d3d03={};_0x2d3d03[_0x58132d]={'$like':'%'+_0x3e7ea5[_0x463f('0x48')][_0x463f('0x53')]+'%'};return _0x2d3d03;})});}_0x35a1aa=_[_0x463f('0x54')]({},_0x35a1aa,_0x3e7ea5[_0x463f('0x55')]);return _0x2cc41f[_0x463f('0x87')](_0x35a1aa);}})[_0x463f('0x20')](function(_0x4fb3e6){if(_0x4fb3e6){_0x4cc86d=_0x4fb3e6[_0x463f('0x4d')];if(!_0x3e7ea5['query'][_0x463f('0x6d')]('nolimit')){_0x35a1aa[_0x463f('0x33')]=qs['limit'](_0x3e7ea5[_0x463f('0x48')][_0x463f('0x33')]);_0x35a1aa['offset']=qs[_0x463f('0x30')](_0x3e7ea5['query']['offset']);}return _0x2cc41f[_0x463f('0x87')](_0x35a1aa);}})['then'](function(_0x57e7c3){if(_0x57e7c3){return _0x57e7c3?{'count':_0x4cc86d,'rows':_0x57e7c3}:null;}})[_0x463f('0x20')](respondWithResult(_0x2a65e0,null))['catch'](handleError(_0x2a65e0,null));};function Extension(_0x43d5e7,_0x2f18ba,_0x2203f4,_0x5d9af9){this['context']='from-voip-provider';this[_0x463f('0x88')]=_0x43d5e7[_0x463f('0x89')];this['app']=_0x5d9af9;this[_0x463f('0x44')]=_0x463f('0x8a');this[_0x463f('0x8b')]=_0x463f('0x8c');this['FaxAccountId']=_0x43d5e7['id'];this[_0x463f('0x85')]=_0x2f18ba;this[_0x463f('0x8d')]=_0x2203f4;}function createExtensionsReciveFax(_0x39a87d){var _0x1a052c=0x1;var _0x5c8fdb=[];_0x5c8fdb[_0x463f('0x8e')](new Extension(_0x39a87d,_0x1a052c,'','Answer'));_0x1a052c+=0x1;_0x5c8fdb[_0x463f('0x8e')](new Extension(_0x39a87d,_0x1a052c,_0x463f('0x8f'),_0x463f('0x90')));_0x1a052c+=0x1;for(var _0x3a4a9a in _0x39a87d){if(_0x39a87d['hasOwnProperty'](_0x3a4a9a)&&(_0x3a4a9a==='ecm'||_0x3a4a9a===_0x463f('0x89')||_0x3a4a9a===_0x463f('0x91')||_0x3a4a9a===_0x463f('0x92')||_0x3a4a9a==='headerinfo'||_0x3a4a9a==='maxrate'||_0x3a4a9a===_0x463f('0x93')||_0x3a4a9a==='modem'||_0x3a4a9a===_0x463f('0x94'))){_0x5c8fdb[_0x463f('0x8e')](new Extension(_0x39a87d,_0x1a052c,'FAXOPT('+_0x3a4a9a+')='+_0x39a87d[_0x3a4a9a],'Set'));_0x1a052c+=0x1;}}_0x5c8fdb[_0x463f('0x8e')](new Extension(_0x39a87d,_0x1a052c,'6',_0x463f('0x95')));_0x1a052c+=0x1;_0x5c8fdb[_0x463f('0x8e')](new Extension(_0x39a87d,_0x1a052c,_0x463f('0x96'),'ReceiveFax'));_0x1a052c=0x0;return _0x5c8fdb;}exports['addAccountApplications']=function(_0x43edea,_0x4464ee,_0x24f8de){var _0x216340;return db['sequelize']['transaction'](function(_0x399c7e){return db[_0x463f('0x56')][_0x463f('0x5c')](_0x43edea['body'],{'transaction':_0x399c7e})[_0x463f('0x20')](function(_0x393060){_0x216340=_0x393060[_0x463f('0x5f')]({'plain':!![]});return db[_0x463f('0x97')]['bulkCreate'](createExtensionsReciveFax(_0x216340),{'transaction':_0x399c7e});});})['then'](function(){return _0x216340;})[_0x463f('0x20')](respondWithResult(_0x4464ee,null))[_0x463f('0x2b')](handleError(_0x4464ee,null));};exports['updateAccountApplications']=function(_0x27ae2e,_0x5cff7b,_0x4e1c28){var _0x524826;return db['sequelize'][_0x463f('0x98')](function(_0x41924b){return db[_0x463f('0x56')][_0x463f('0x39')](_0x27ae2e[_0x463f('0x5d')],{'where':{'id':_0x27ae2e[_0x463f('0x5d')]['id']},'transaction':_0x41924b})['then'](function(_0x46d1bd){return db[_0x463f('0x97')][_0x463f('0x3a')]({'where':{'FaxAccountId':_0x27ae2e[_0x463f('0x5d')]['id']},'transaction':_0x41924b})[_0x463f('0x20')](function(_0x138306){return db[_0x463f('0x97')][_0x463f('0x83')](createExtensionsReciveFax(_['omit'](_0x27ae2e[_0x463f('0x5d')],['tech','key',_0x463f('0x99'),_0x463f('0x9a'),_0x463f('0x9b'),_0x463f('0x9c')])),{'transaction':_0x41924b});});});})[_0x463f('0x20')](function(){return db[_0x463f('0x56')][_0x463f('0x9d')](_0x27ae2e[_0x463f('0x5d')]['id']);})[_0x463f('0x20')](respondWithResult(_0x5cff7b,null))[_0x463f('0x2b')](handleError(_0x5cff7b,null));};exports[_0x463f('0x9e')]=function(_0x2d84b0,_0x2e9f66,_0x4c3707){var _0x54dc5d={'raw':!![],'where':{}};var _0x4d6b5f={};var _0x360db2={'count':0x0,'rows':[]};return db[_0x463f('0x56')]['findOne']({'where':{'id':_0x2d84b0[_0x463f('0x5b')]['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x2e9f66,null))['then'](function(_0x45467b){if(_0x45467b){_0x4d6b5f['model']=_[_0x463f('0x47')](db[_0x463f('0x9f')][_0x463f('0x42')]);_0x4d6b5f[_0x463f('0x48')]=_['keys'](_0x2d84b0['query']);_0x4d6b5f[_0x463f('0x49')]=_[_0x463f('0x4a')](_0x4d6b5f['model'],_0x4d6b5f[_0x463f('0x48')]);_0x54dc5d[_0x463f('0x4c')]=_['intersection'](_0x4d6b5f[_0x463f('0x46')],qs[_0x463f('0x4b')](_0x2d84b0['query'][_0x463f('0x4b')]));_0x54dc5d[_0x463f('0x4c')]=_0x54dc5d[_0x463f('0x4c')][_0x463f('0x4d')]?_0x54dc5d[_0x463f('0x4c')]:_0x4d6b5f[_0x463f('0x46')];if(!_0x2d84b0[_0x463f('0x48')][_0x463f('0x6d')]('nolimit')){_0x54dc5d[_0x463f('0x33')]=qs[_0x463f('0x33')](_0x2d84b0['query'][_0x463f('0x33')]);_0x54dc5d[_0x463f('0x30')]=qs[_0x463f('0x30')](_0x2d84b0[_0x463f('0x48')]['offset']);}_0x54dc5d[_0x463f('0x4f')]=qs[_0x463f('0x50')](_0x2d84b0[_0x463f('0x48')]['sort']);_0x54dc5d[_0x463f('0x51')]=qs[_0x463f('0x49')](_[_0x463f('0x52')](_0x2d84b0[_0x463f('0x48')],_0x4d6b5f[_0x463f('0x49')]));_0x54dc5d[_0x463f('0x51')]['FaxAccountId']=_0x45467b['id'];if(_0x2d84b0['query'][_0x463f('0x53')]){_0x54dc5d['where']=_['merge'](_0x54dc5d[_0x463f('0x51')],{'$or':_[_0x463f('0x41')](_0x54dc5d[_0x463f('0x4c')],function(_0x36f6cf){var _0x525e98={};_0x525e98[_0x36f6cf]={'$like':'%'+_0x2d84b0[_0x463f('0x48')]['filter']+'%'};return _0x525e98;})});}if(_0x2d84b0[_0x463f('0x48')][_0x463f('0xa0')]){var _0x56c656=_0x2d84b0[_0x463f('0x48')][_0x463f('0xa0')]['split'](',');var _0x571805={};_0x571805[_0x56c656[0x0]]={'$gte':moment(_0x56c656[0x1])[_0x463f('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x54dc5d[_0x463f('0x51')]=_['merge'](_0x54dc5d[_0x463f('0x51')],_0x571805);}_0x54dc5d=_[_0x463f('0x54')]({},_0x54dc5d,_0x2d84b0[_0x463f('0x55')]);return db[_0x463f('0x9f')]['count']({'where':_0x54dc5d[_0x463f('0x51')]})[_0x463f('0x20')](function(_0x51b1c4){_0x360db2[_0x463f('0x32')]=_0x51b1c4;if(_0x2d84b0['query']['includeAll']){_0x54dc5d[_0x463f('0x58')]=[{'all':!![]}];}return db[_0x463f('0x9f')][_0x463f('0x59')](_0x54dc5d);})[_0x463f('0x20')](function(_0x26311b){_0x360db2[_0x463f('0x5a')]=_0x26311b;return _0x360db2;});}})[_0x463f('0x20')](respondWithFilteredResult(_0x2e9f66,_0x54dc5d))['catch'](handleError(_0x2e9f66,null));};exports[_0x463f('0x3e')]=function(_0x284fe9,_0x39ec18,_0x104e6c){var _0x3a5174,_0x514a4e={},_0x18274b;if(_0x284fe9[_0x463f('0x5d')]['to']){_0x18274b=_0x284fe9[_0x463f('0x5d')]['to'][0x0];}return db[_0x463f('0x56')]['find']({'where':{'id':_0x284fe9[_0x463f('0x5b')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x463f('0x77')],'as':_0x463f('0xa2'),'where':{'fax':_0x18274b},'limit':0x1,'order':[[_0x463f('0x9a'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x39ec18,null))[_0x463f('0x20')](function(_0x16a1e3){_0x3a5174=_0x16a1e3;if(_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')]&&_0x284fe9[_0x463f('0x5d')]['attachments'][_0x463f('0x4d')]){for(var _0x3d1134=0x0;_0x3d1134<_0x284fe9[_0x463f('0x5d')]['attachments'][_0x463f('0x4d')];_0x3d1134+=0x1){_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][_0x3d1134]={'filename':_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][_0x3d1134][_0x463f('0x3d')],'id':_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][_0x3d1134]['id'],'path':path[_0x463f('0xa4')](config[_0x463f('0xa5')],'server/files/attachments',_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][_0x3d1134]['basename'])};}}return respondWithRpcPromise(_0x463f('0xa6'),_0x463f('0xa6'),{'FaxAccountId':_[_0x463f('0xa7')](_0x284fe9[_0x463f('0x5b')]['id'])?undefined:_0x284fe9[_0x463f('0x5b')]['id'],'path':_[_0x463f('0xa7')](_0x284fe9['body']['attachments'][0x0]['path'])?undefined:_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][0x0][_0x463f('0x6')],'fax':_[_0x463f('0xa7')](_0x284fe9['body']['to'][0x0])?undefined:_0x284fe9[_0x463f('0x5d')]['to'][0x0]},client9002);})[_0x463f('0x20')](function(){if(_0x3a5174){if(_['isNil'](_0x284fe9[_0x463f('0x5d')]['from'])){_0x284fe9[_0x463f('0x5d')]['from']=util['format']('\x22%s\x22\x20<%s>',_0x3a5174[_0x463f('0x3d')],_0x3a5174[_0x463f('0xa8')]);}if(_0x3a5174[_0x463f('0xa9')]){if(_0x3a5174['List'][_0x463f('0xa2')][_0x463f('0x4d')]){return _0x3a5174[_0x463f('0xa9')][_0x463f('0xa2')][0x0];}else{return db[_0x463f('0x77')][_0x463f('0x5c')](_[_0x463f('0x16')](_0x284fe9[_0x463f('0x5d')],{'firstName':_0x284fe9['body']['to'][0x0],'phone':_0x284fe9[_0x463f('0x5d')]['to'][0x0],'fax':_0x284fe9[_0x463f('0x5d')]['to'][0x0],'ListId':_0x3a5174[_0x463f('0x9c')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x463f('0xaa'));}})[_0x463f('0x20')](function(_0x14686e){if(_0x14686e){return db['FaxInteraction'][_0x463f('0x67')]({'where':{'ContactId':_0x14686e['id'],'closed':![],'FaxAccountId':_0x3a5174['id']}})[_0x463f('0x20')](function(_0x3526c9){if(_0x3526c9){return[_0x3526c9,![]];}return db[_0x463f('0x74')]['create']({'UserId':_0x284fe9[_0x463f('0x5e')]['id'],'ContactId':_0x14686e['id'],'FaxAccountId':_0x3a5174['id'],'fax':_0x284fe9[_0x463f('0x5d')]['to'][0x0],'firstMsgDirection':_0x463f('0xab'),'Messages':[_['merge'](_0x284fe9[_0x463f('0x5d')],{'read':![],'body':_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][0x0]['filename'],'FaxAccountId':_0x3a5174['id'],'UserId':_0x284fe9[_0x463f('0x5e')]['id'],'ContactId':_0x14686e['id'],'AttachmentId':_0x284fe9['body'][_0x463f('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x463f('0x9f')],'as':'Messages'}]})[_0x463f('0x20')](function(_0x8081c9){return[_0x8081c9,!![]];});});}else{throw new Error(_0x463f('0xac'));}})[_0x463f('0xad')](function(_0x1cdb4b,_0x49ef16){if(_0x49ef16){return _0x1cdb4b;}return db['FaxMessage'][_0x463f('0x5c')]({'direction':'out','read':![],'body':_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][0x0]['filename'],'FaxAccountId':_0x3a5174['id'],'FaxInteractionId':_0x1cdb4b['id'],'UserId':_0x284fe9[_0x463f('0x5e')]['id'],'ContactId':_0x1cdb4b[_0x463f('0xae')],'AttachmentId':_0x284fe9['body'][_0x463f('0xa3')][0x0]['id']})['then'](function(_0x54ddd6){_0x1cdb4b[_0x463f('0xaf')]['Messages']=[];_0x1cdb4b[_0x463f('0xaf')][_0x463f('0xb0')]['push'](_0x54ddd6['dataValues']);return _0x1cdb4b;});})[_0x463f('0x20')](function(_0x4c6b9b){respondWithRpcPromise(_0x463f('0xb1'),_0x463f('0xb1'),{'FaxAccountId':_[_0x463f('0xa7')](_0x284fe9[_0x463f('0x5b')]['id'])?undefined:_0x284fe9[_0x463f('0x5b')]['id'],'path':_['isNil'](_0x284fe9[_0x463f('0x5d')]['attachments'][0x0][_0x463f('0x6')])?undefined:_0x284fe9['body'][_0x463f('0xa3')][0x0][_0x463f('0x6')],'fax':_[_0x463f('0xa7')](_0x284fe9[_0x463f('0x5d')]['to'][0x0])?undefined:_0x284fe9[_0x463f('0x5d')]['to'][0x0],'AttachmentId':_0x284fe9[_0x463f('0x5d')][_0x463f('0xa3')][0x0]['id']},client9002)[_0x463f('0x20')](function(_0x99f116){logger[_0x463f('0x21')](_0x463f('0xb2'),_0x99f116);})[_0x463f('0x2b')](function(_0x5ad31d){logger[_0x463f('0x21')]('SendFaxRpc,\x20%s',_0x5ad31d);});return _0x4c6b9b;})[_0x463f('0x20')](respondWithResult(_0x39ec18,null))[_0x463f('0x2b')](handleError(_0x39ec18,null));};exports[_0x463f('0xb3')]=function(_0x129d6c,_0x527969,_0x5e6578){return db[_0x463f('0x56')][_0x463f('0x67')]({'where':{'id':_0x129d6c['params']['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x527969,null))[_0x463f('0x20')](function(_0x2852e9){if(_0x2852e9){return _0x2852e9['addAgents'](_0x129d6c[_0x463f('0x5d')][_0x463f('0x75')],_[_0x463f('0xb4')](_0x129d6c[_0x463f('0x5d')],[_0x463f('0x75'),'id'])||{})['spread'](function(_0x37a055){for(var _0x136f0a=0x0;_0x136f0a<_0x129d6c[_0x463f('0x5d')]['ids']['length'];_0x136f0a+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x129d6c['body'][_0x463f('0x75')][_0x136f0a]),'FaxAccountId':Number(_0x129d6c[_0x463f('0x5b')]['id'])});}return _0x37a055;});}})['then'](respondWithResult(_0x527969,null))[_0x463f('0x2b')](handleError(_0x527969,null));};exports[_0x463f('0xb5')]=function(_0x450335,_0x4131a9,_0x7d99e9){return db[_0x463f('0x56')][_0x463f('0x67')]({'where':{'id':_0x450335['params']['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x4131a9,null))[_0x463f('0x20')](function(_0x484fff){if(_0x484fff){return _0x484fff[_0x463f('0xb5')](_0x450335['query'][_0x463f('0x75')])[_0x463f('0x20')](function(){if(_['isArray'](_0x450335[_0x463f('0x48')][_0x463f('0x75')])){for(var _0x2b3bdf=0x0;_0x2b3bdf<_0x450335[_0x463f('0x48')][_0x463f('0x75')][_0x463f('0x4d')];_0x2b3bdf+=0x1){socket['emit'](_0x463f('0xb6'),{'UserId':Number(_0x450335[_0x463f('0x48')][_0x463f('0x75')][_0x2b3bdf]),'FaxAccountId':Number(_0x450335[_0x463f('0x5b')]['id'])});}}else{socket['emit'](_0x463f('0xb6'),{'UserId':Number(_0x450335['query'][_0x463f('0x75')]),'FaxAccountId':Number(_0x450335[_0x463f('0x5b')]['id'])});}});}})[_0x463f('0x20')](respondWithStatusCode(_0x4131a9,null))[_0x463f('0x2b')](handleError(_0x4131a9,null));};exports['getAgents']=function(_0x1b7049,_0x369b1f,_0x2d1f5e){var _0x77c5b3={};var _0x125e30={};var _0x36c931;var _0x3a1c2b;return db[_0x463f('0x56')][_0x463f('0x70')]({'where':{'id':_0x1b7049[_0x463f('0x5b')]['id']}})[_0x463f('0x20')](handleEntityNotFound(_0x369b1f,null))['then'](function(_0x109a04){if(_0x109a04){_0x36c931=_0x109a04;_0x125e30[_0x463f('0x46')]=_[_0x463f('0x47')](db[_0x463f('0x78')][_0x463f('0x42')]);_0x125e30['query']=_[_0x463f('0x47')](_0x1b7049[_0x463f('0x48')]);_0x125e30[_0x463f('0x49')]=_[_0x463f('0x4a')](_0x125e30[_0x463f('0x46')],_0x125e30['query']);_0x77c5b3[_0x463f('0x4c')]=_[_0x463f('0x4a')](_0x125e30['model'],qs[_0x463f('0x4b')](_0x1b7049[_0x463f('0x48')][_0x463f('0x4b')]));_0x77c5b3[_0x463f('0x4c')]=_0x77c5b3[_0x463f('0x4c')][_0x463f('0x4d')]?_0x77c5b3[_0x463f('0x4c')]:_0x125e30[_0x463f('0x46')];_0x77c5b3[_0x463f('0x4f')]=qs[_0x463f('0x50')](_0x1b7049[_0x463f('0x48')][_0x463f('0x50')]);_0x77c5b3[_0x463f('0x51')]=qs[_0x463f('0x49')](_['pick'](_0x1b7049[_0x463f('0x48')],_0x125e30[_0x463f('0x49')]));if(_0x1b7049[_0x463f('0x48')][_0x463f('0x53')]){_0x77c5b3['where']=_[_0x463f('0x54')](_0x77c5b3[_0x463f('0x51')],{'$or':_[_0x463f('0x41')](_0x77c5b3[_0x463f('0x4c')],function(_0x566c74){var _0x58b89d={};_0x58b89d[_0x566c74]={'$like':'%'+_0x1b7049['query'][_0x463f('0x53')]+'%'};return _0x58b89d;})});}_0x77c5b3=_[_0x463f('0x54')]({},_0x77c5b3,_0x1b7049['options']);return _0x36c931[_0x463f('0xb7')](_0x77c5b3);}})[_0x463f('0x20')](function(_0x1b7a05){if(_0x1b7a05){_0x3a1c2b=_0x1b7a05[_0x463f('0x4d')];if(!_0x1b7049[_0x463f('0x48')][_0x463f('0x6d')](_0x463f('0x4e'))){_0x77c5b3[_0x463f('0x33')]=qs[_0x463f('0x33')](_0x1b7049[_0x463f('0x48')][_0x463f('0x33')]);_0x77c5b3[_0x463f('0x30')]=qs['offset'](_0x1b7049[_0x463f('0x48')][_0x463f('0x30')]);}return _0x36c931[_0x463f('0xb7')](_0x77c5b3);}})['then'](function(_0xe03028){if(_0xe03028){return _0xe03028?{'count':_0x3a1c2b,'rows':_0xe03028}:null;}})[_0x463f('0x20')](respondWithResult(_0x369b1f,null))[_0x463f('0x2b')](handleError(_0x369b1f,null));}; \ No newline at end of file +var _0x6893=['localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','FaxAccounts','stack','name','send','index','Pause','map','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','order','sort','pick','where','merge','filter','options','includeAll','include','FaxAccount','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','addDisposition','Disposition','findOne','hasOwnProperty','FaxAccountId','findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','nolimit','CmContact','Contact','User','fullname','internal','Tag','color','tag','FaxInteraction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','context','from-voip-provider','localstationid','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','ecm','gateway','faxdetect','headerinfo','minrate','modem','t38timeout','Set','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','createdAt','updatedAt','findById','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','path','isNil','from','\x22%s\x22\x20<%s>','fax','ListId','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','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/environment','../../config/license/util','../../mysqldb','redis','defaults'];(function(_0x3b4688,_0x3994b1){var _0x8ff6c=function(_0x1ef090){while(--_0x1ef090){_0x3b4688['push'](_0x3b4688['shift']());}};_0x8ff6c(++_0x3994b1);}(_0x6893,0xb6));var _0x3689=function(_0xbd201,_0x2d26d0){_0xbd201=_0xbd201-0x0;var _0x103c69=_0x6893[_0xbd201];return _0x103c69;};'use strict';var emlformat=require(_0x3689('0x0'));var rimraf=require(_0x3689('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3689('0x2'));var rp=require('request-promise');var moment=require(_0x3689('0x3'));var BPromise=require(_0x3689('0x4'));var Mustache=require(_0x3689('0x5'));var util=require(_0x3689('0x6'));var path=require('path');var sox=require(_0x3689('0x7'));var csv=require(_0x3689('0x8'));var ejs=require(_0x3689('0x9'));var fs=require('fs');var fs_extra=require(_0x3689('0xa'));var _=require(_0x3689('0xb'));var squel=require(_0x3689('0xc'));var crypto=require(_0x3689('0xd'));var jsforce=require(_0x3689('0xe'));var deskjs=require(_0x3689('0xf'));var toCsv=require(_0x3689('0x8'));var querystring=require('querystring');var Papa=require(_0x3689('0x10'));var Redis=require(_0x3689('0x11'));var authService=require(_0x3689('0x12'));var qs=require(_0x3689('0x13'));var as=require(_0x3689('0x14'));var hardwareService=require(_0x3689('0x15'));var logger=require(_0x3689('0x16'))(_0x3689('0x17'));var utils=require(_0x3689('0x18'));var config=require(_0x3689('0x19'));var licenseUtil=require(_0x3689('0x1a'));var db=require(_0x3689('0x1b'))['db'];config[_0x3689('0x1c')]=_[_0x3689('0x1d')](config[_0x3689('0x1c')],{'host':_0x3689('0x1e'),'port':0x18eb});var socket=require(_0x3689('0x1f'))(new Redis(config[_0x3689('0x1c')]));require(_0x3689('0x20'))[_0x3689('0x21')](socket);var jayson=require(_0x3689('0x22'));var client=jayson[_0x3689('0x23')][_0x3689('0x24')]({'port':0x232c});var client9002=jayson[_0x3689('0x23')][_0x3689('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x2b2b2e,_0x28f095,_0x1768c8,_0x523d12){return new BPromise(function(_0x525b78,_0x4d5790){var _0x4820b7=_0x523d12||client;return _0x4820b7[_0x3689('0x25')](_0x2b2b2e,_0x1768c8)[_0x3689('0x26')](function(_0x45a992){logger[_0x3689('0x27')](_0x3689('0x28'),_0x28f095,_0x3689('0x29'));logger[_0x3689('0x2a')](_0x3689('0x2b'),_0x28f095,'request\x20sent',JSON[_0x3689('0x2c')](_0x45a992));if(_0x45a992[_0x3689('0x2d')]){if(_0x45a992['error'][_0x3689('0x2e')]===0x1f4){logger[_0x3689('0x2d')]('FaxAccount,\x20%s,\x20%s',_0x28f095,_0x45a992[_0x3689('0x2d')][_0x3689('0x2f')]);return _0x4d5790(_0x45a992[_0x3689('0x2d')][_0x3689('0x2f')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x28f095,_0x45a992[_0x3689('0x2d')][_0x3689('0x2f')]);return _0x525b78(_0x45a992[_0x3689('0x2d')][_0x3689('0x2f')]);}else{logger[_0x3689('0x27')]('FaxAccount,\x20%s,\x20%s',_0x28f095,_0x3689('0x29'));_0x525b78(_0x45a992[_0x3689('0x30')][_0x3689('0x2f')]);}})['catch'](function(_0x3df4ad){logger[_0x3689('0x2d')](_0x3689('0x28'),_0x28f095,_0x3df4ad);_0x4d5790(_0x3df4ad);});});}function respondWithStatusCode(_0x2833dd,_0x567dfc){_0x567dfc=_0x567dfc||0xcc;return function(_0x3625d3){if(_0x3625d3){return _0x2833dd[_0x3689('0x31')](_0x567dfc);}return _0x2833dd[_0x3689('0x32')](_0x567dfc)[_0x3689('0x33')]();};}function respondWithResult(_0x5c53f1,_0xf9bdf5){_0xf9bdf5=_0xf9bdf5||0xc8;return function(_0x1a602f){if(_0x1a602f){return _0x5c53f1['status'](_0xf9bdf5)[_0x3689('0x34')](_0x1a602f);}};}function respondWithFilteredResult(_0xf8bd06,_0x435005){return function(_0x47a228){if(_0x47a228){var _0x470c89=typeof _0x435005[_0x3689('0x35')]===_0x3689('0x36')&&typeof _0x435005[_0x3689('0x37')]==='undefined';var _0x57274d=_0x47a228[_0x3689('0x38')];var _0x376919=_0x470c89?0x0:_0x435005['offset'];var _0x18963d=_0x470c89?_0x47a228[_0x3689('0x38')]:_0x435005[_0x3689('0x35')]+_0x435005[_0x3689('0x37')];var _0x1fca17;if(_0x18963d>=_0x57274d){_0x18963d=_0x57274d;_0x1fca17=0xc8;}else{_0x1fca17=0xce;}_0xf8bd06[_0x3689('0x32')](_0x1fca17);return _0xf8bd06[_0x3689('0x39')](_0x3689('0x3a'),_0x376919+'-'+_0x18963d+'/'+_0x57274d)[_0x3689('0x34')](_0x47a228);}return null;};}function patchUpdates(_0x41a9e4){return function(_0x5631ef){try{jsonpatch[_0x3689('0x3b')](_0x5631ef,_0x41a9e4,!![]);}catch(_0x2799da){return BPromise[_0x3689('0x3c')](_0x2799da);}return _0x5631ef[_0x3689('0x3d')]();};}function saveUpdates(_0x1155a8,_0x195e1f){return function(_0x2e5323){if(_0x2e5323){return _0x2e5323['update'](_0x1155a8)['then'](function(_0xce3326){return _0xce3326;});}return null;};}function removeEntity(_0x1e1012,_0x41cb8a){return function(_0x5e617b){if(_0x5e617b){return _0x5e617b[_0x3689('0x3e')]()[_0x3689('0x26')](function(){var _0x46128a=_0x5e617b[_0x3689('0x3f')]({'plain':!![]});var _0x120d22=_0x3689('0x40');return db['UserProfileResource']['destroy']({'where':{'type':_0x120d22,'resourceId':_0x46128a['id']}})[_0x3689('0x26')](function(){return _0x5e617b;});})[_0x3689('0x26')](function(){_0x1e1012[_0x3689('0x32')](0xcc)[_0x3689('0x33')]();});}};}function handleEntityNotFound(_0xf1cad4,_0x16a863){return function(_0x23323d){if(!_0x23323d){_0xf1cad4[_0x3689('0x31')](0x194);}return _0x23323d;};}function handleError(_0x179f2f,_0x1f9ee3){_0x1f9ee3=_0x1f9ee3||0x1f4;return function(_0x5e42ba){logger[_0x3689('0x2d')](_0x5e42ba[_0x3689('0x41')]);if(_0x5e42ba[_0x3689('0x42')]){delete _0x5e42ba[_0x3689('0x42')];}_0x179f2f[_0x3689('0x32')](_0x1f9ee3)[_0x3689('0x43')](_0x5e42ba);};}exports[_0x3689('0x44')]=function(_0x43473e,_0x52d06b){var _0x2addec={'include':[{'model':db[_0x3689('0x45')],'as':'mandatoryDispositionPause'}]},_0x2a7653={},_0x1e5519={'count':0x0,'rows':[]};var _0x40d4ec=_[_0x3689('0x46')](db['FaxAccount'][_0x3689('0x47')],function(_0x3c434e){return{'name':_0x3c434e[_0x3689('0x48')],'type':_0x3c434e[_0x3689('0x49')][_0x3689('0x4a')]};});_0x2a7653[_0x3689('0x4b')]=_[_0x3689('0x46')](_0x40d4ec,_0x3689('0x42'));_0x2a7653['query']=_[_0x3689('0x4c')](_0x43473e[_0x3689('0x4d')]);_0x2a7653[_0x3689('0x4e')]=_[_0x3689('0x4f')](_0x2a7653[_0x3689('0x4b')],_0x2a7653[_0x3689('0x4d')]);_0x2addec['attributes']=_[_0x3689('0x4f')](_0x2a7653[_0x3689('0x4b')],qs['fields'](_0x43473e[_0x3689('0x4d')][_0x3689('0x50')]));_0x2addec[_0x3689('0x51')]=_0x2addec[_0x3689('0x51')][_0x3689('0x52')]?_0x2addec[_0x3689('0x51')]:_0x2a7653[_0x3689('0x4b')];if(!_0x43473e[_0x3689('0x4d')]['hasOwnProperty']('nolimit')){_0x2addec[_0x3689('0x37')]=qs[_0x3689('0x37')](_0x43473e[_0x3689('0x4d')]['limit']);_0x2addec[_0x3689('0x35')]=qs[_0x3689('0x35')](_0x43473e[_0x3689('0x4d')][_0x3689('0x35')]);}_0x2addec[_0x3689('0x53')]=qs[_0x3689('0x54')](_0x43473e[_0x3689('0x4d')][_0x3689('0x54')]);_0x2addec['where']=qs['filters'](_[_0x3689('0x55')](_0x43473e['query'],_0x2a7653[_0x3689('0x4e')]),_0x40d4ec);if(_0x43473e[_0x3689('0x4d')]['filter']){_0x2addec[_0x3689('0x56')]=_[_0x3689('0x57')](_0x2addec[_0x3689('0x56')],{'$or':_[_0x3689('0x46')](_0x40d4ec,function(_0x4d2f6c){if(_0x4d2f6c['type']!=='VIRTUAL'){var _0x552f26={};_0x552f26[_0x4d2f6c[_0x3689('0x42')]]={'$like':'%'+_0x43473e[_0x3689('0x4d')][_0x3689('0x58')]+'%'};return _0x552f26;}})});}_0x2addec=_[_0x3689('0x57')]({},_0x2addec,_0x43473e[_0x3689('0x59')]);var _0xdb21dd={'where':_0x2addec[_0x3689('0x56')]};return db['FaxAccount'][_0x3689('0x38')](_0xdb21dd)[_0x3689('0x26')](function(_0x39c3a8){_0x1e5519[_0x3689('0x38')]=_0x39c3a8;if(_0x43473e[_0x3689('0x4d')][_0x3689('0x5a')]){_0x2addec[_0x3689('0x5b')]=[{'all':!![]}];}return db[_0x3689('0x5c')]['findAll'](_0x2addec);})[_0x3689('0x26')](function(_0x17dc58){_0x1e5519[_0x3689('0x5d')]=_0x17dc58;return _0x1e5519;})['then'](respondWithFilteredResult(_0x52d06b,_0x2addec))[_0x3689('0x5e')](handleError(_0x52d06b,null));};exports[_0x3689('0x5f')]=function(_0x23a7e0,_0x240842){var _0x1081f6={'raw':![],'where':{'id':_0x23a7e0[_0x3689('0x60')]['id']},'include':[{'model':db[_0x3689('0x45')],'as':'mandatoryDispositionPause'}]},_0xf2f078={};_0xf2f078['model']=_[_0x3689('0x4c')](db[_0x3689('0x5c')][_0x3689('0x47')]);_0xf2f078[_0x3689('0x4d')]=_[_0x3689('0x4c')](_0x23a7e0['query']);_0xf2f078[_0x3689('0x4e')]=_[_0x3689('0x4f')](_0xf2f078[_0x3689('0x4b')],_0xf2f078[_0x3689('0x4d')]);_0x1081f6['attributes']=_[_0x3689('0x4f')](_0xf2f078[_0x3689('0x4b')],qs[_0x3689('0x50')](_0x23a7e0['query']['fields']));_0x1081f6['attributes']=_0x1081f6[_0x3689('0x51')]['length']?_0x1081f6[_0x3689('0x51')]:_0xf2f078[_0x3689('0x4b')];if(_0x23a7e0[_0x3689('0x4d')][_0x3689('0x5a')]){_0x1081f6[_0x3689('0x5b')]=[{'all':!![]}];}_0x1081f6=_[_0x3689('0x57')]({},_0x1081f6,_0x23a7e0[_0x3689('0x59')]);return db[_0x3689('0x5c')][_0x3689('0x61')](_0x1081f6)[_0x3689('0x26')](handleEntityNotFound(_0x240842,null))[_0x3689('0x26')](respondWithResult(_0x240842,null))[_0x3689('0x5e')](handleError(_0x240842,null));};exports['create']=function(_0x502b5f,_0x25d34b){return db[_0x3689('0x5c')]['create'](_0x502b5f[_0x3689('0x62')],{})[_0x3689('0x26')](function(_0xef1e76){var _0x37c68e=_0x502b5f[_0x3689('0x63')]['get']({'plain':!![]});if(!_0x37c68e)throw new Error(_0x3689('0x64'));if(_0x37c68e[_0x3689('0x65')]===_0x3689('0x63')){var _0x3089ad=_0xef1e76[_0x3689('0x3f')]({'plain':!![]});var _0x503e67='FaxAccounts';return db[_0x3689('0x66')][_0x3689('0x61')]({'where':{'name':_0x503e67,'userProfileId':_0x37c68e[_0x3689('0x67')]},'raw':!![]})[_0x3689('0x26')](function(_0x2cc4ec){if(_0x2cc4ec&&_0x2cc4ec[_0x3689('0x68')]===0x0){return db[_0x3689('0x69')][_0x3689('0x6a')]({'name':_0x3089ad[_0x3689('0x42')],'resourceId':_0x3089ad['id'],'type':_0x2cc4ec[_0x3689('0x42')],'sectionId':_0x2cc4ec['id']},{})[_0x3689('0x26')](function(){return _0xef1e76;});}else{return _0xef1e76;}})[_0x3689('0x5e')](function(_0x32f81e){logger['error'](_0x3689('0x6b'),_0x32f81e);throw _0x32f81e;});}return _0xef1e76;})[_0x3689('0x26')](respondWithResult(_0x25d34b,0xc9))[_0x3689('0x5e')](handleError(_0x25d34b,null));};exports[_0x3689('0x6c')]=function(_0x386b1e,_0x30a303){if(_0x386b1e['body']['id']){delete _0x386b1e[_0x3689('0x62')]['id'];}return db[_0x3689('0x5c')][_0x3689('0x61')]({'where':{'id':_0x386b1e[_0x3689('0x60')]['id']},'include':[{'model':db[_0x3689('0x45')],'as':_0x3689('0x6d')}]})[_0x3689('0x26')](handleEntityNotFound(_0x30a303,null))[_0x3689('0x26')](saveUpdates(_0x386b1e[_0x3689('0x62')],null))[_0x3689('0x26')](respondWithResult(_0x30a303,null))[_0x3689('0x5e')](handleError(_0x30a303,null));};exports['destroy']=function(_0x17d6ea,_0x20a6f4){return db[_0x3689('0x5c')][_0x3689('0x61')]({'where':{'id':_0x17d6ea['params']['id']}})['then'](handleEntityNotFound(_0x20a6f4,null))[_0x3689('0x26')](removeEntity(_0x20a6f4,null))[_0x3689('0x5e')](handleError(_0x20a6f4,null));};exports[_0x3689('0x6e')]=function(_0x5e493c,_0x2975b3){return db[_0x3689('0x5c')][_0x3689('0x6e')]()[_0x3689('0x26')](respondWithResult(_0x2975b3,null))[_0x3689('0x5e')](handleError(_0x2975b3,null));};exports[_0x3689('0x6f')]=function(_0x34461a,_0x3cceec,_0x3afa5d){if(_0x34461a[_0x3689('0x62')]['id']){delete _0x34461a[_0x3689('0x62')]['id'];}return db[_0x3689('0x5c')][_0x3689('0x61')]({'where':{'id':_0x34461a[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x3cceec,null))['then'](function(_0x31fa99){if(_0x31fa99){_0x34461a[_0x3689('0x62')]['FaxAccountId']=_0x31fa99['id'];return db[_0x3689('0x70')][_0x3689('0x6a')](_0x34461a['body']);}})[_0x3689('0x26')](respondWithResult(_0x3cceec,null))[_0x3689('0x5e')](handleError(_0x3cceec,null));};exports['getDispositions']=function(_0x42a8a,_0x326547,_0xe7d165){var _0x5c9de1={'raw':![],'where':{}};var _0x17a20d={};var _0x266367={'count':0x0,'rows':[]};return db[_0x3689('0x5c')][_0x3689('0x71')]({'where':{'id':_0x42a8a['params']['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x326547,null))[_0x3689('0x26')](function(_0x3a32c8){if(_0x3a32c8){_0x17a20d[_0x3689('0x4b')]=_[_0x3689('0x4c')](db[_0x3689('0x70')]['rawAttributes']);_0x17a20d[_0x3689('0x4d')]=_[_0x3689('0x4c')](_0x42a8a['query']);_0x17a20d[_0x3689('0x4e')]=_[_0x3689('0x4f')](_0x17a20d[_0x3689('0x4b')],_0x17a20d[_0x3689('0x4d')]);_0x5c9de1['attributes']=_[_0x3689('0x4f')](_0x17a20d[_0x3689('0x4b')],qs[_0x3689('0x50')](_0x42a8a['query'][_0x3689('0x50')]));_0x5c9de1[_0x3689('0x51')]=_0x5c9de1[_0x3689('0x51')]['length']?_0x5c9de1[_0x3689('0x51')]:_0x17a20d['model'];if(!_0x42a8a[_0x3689('0x4d')][_0x3689('0x72')]('nolimit')){_0x5c9de1[_0x3689('0x37')]=qs[_0x3689('0x37')](_0x42a8a[_0x3689('0x4d')][_0x3689('0x37')]);_0x5c9de1[_0x3689('0x35')]=qs[_0x3689('0x35')](_0x42a8a[_0x3689('0x4d')][_0x3689('0x35')]);}_0x5c9de1['order']=qs[_0x3689('0x54')](_0x42a8a[_0x3689('0x4d')][_0x3689('0x54')]);_0x5c9de1['where']=qs['filters'](_[_0x3689('0x55')](_0x42a8a['query'],_0x17a20d['filters']));_0x5c9de1[_0x3689('0x56')][_0x3689('0x73')]=_0x3a32c8['id'];if(_0x42a8a[_0x3689('0x4d')]['filter']){_0x5c9de1['where']=_['merge'](_0x5c9de1[_0x3689('0x56')],{'$or':_[_0x3689('0x46')](_0x5c9de1[_0x3689('0x51')],function(_0x4f7efb){var _0x253798={};_0x253798[_0x4f7efb]={'$like':'%'+_0x42a8a['query']['filter']+'%'};return _0x253798;})});}_0x5c9de1=_['merge']({},_0x5c9de1,_0x42a8a[_0x3689('0x59')]);return db[_0x3689('0x70')][_0x3689('0x38')]({'where':_0x5c9de1[_0x3689('0x56')]})['then'](function(_0x115723){_0x266367[_0x3689('0x38')]=_0x115723;if(_0x42a8a[_0x3689('0x4d')][_0x3689('0x5a')]){_0x5c9de1[_0x3689('0x5b')]=[{'all':!![]}];}return db[_0x3689('0x70')][_0x3689('0x74')](_0x5c9de1);})['then'](function(_0x9a39f3){_0x266367['rows']=_0x9a39f3;return _0x266367;});}})['then'](respondWithFilteredResult(_0x326547,_0x5c9de1))[_0x3689('0x5e')](handleError(_0x326547,null));};exports[_0x3689('0x75')]=function(_0x535169,_0x2ecbdd,_0x9d9bb){return db[_0x3689('0x5c')]['find']({'where':{'id':_0x535169[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x2ecbdd,null))[_0x3689('0x26')](function(_0x2fc439){if(_0x2fc439){return _0x2fc439[_0x3689('0x75')](_0x535169[_0x3689('0x4d')][_0x3689('0x76')]);}})[_0x3689('0x26')](respondWithStatusCode(_0x2ecbdd,null))[_0x3689('0x5e')](handleError(_0x2ecbdd,null));};exports['addAnswer']=function(_0x122c4f,_0x549eee,_0x23d6af){if(_0x122c4f[_0x3689('0x62')]['id']){delete _0x122c4f[_0x3689('0x62')]['id'];}return db[_0x3689('0x5c')][_0x3689('0x61')]({'where':{'id':_0x122c4f[_0x3689('0x60')]['id']}})['then'](handleEntityNotFound(_0x549eee,null))[_0x3689('0x26')](function(_0x314f05){if(_0x314f05){_0x122c4f[_0x3689('0x62')][_0x3689('0x73')]=_0x314f05['id'];return db[_0x3689('0x77')][_0x3689('0x6a')](_0x122c4f['body']);}})[_0x3689('0x26')](respondWithResult(_0x549eee,null))['catch'](handleError(_0x549eee,null));};exports[_0x3689('0x78')]=function(_0x28601f,_0x12d332,_0x488132){var _0x408170={'raw':![],'where':{}};var _0x5e4bdd={};var _0x8d9de7={'count':0x0,'rows':[]};return db[_0x3689('0x5c')][_0x3689('0x71')]({'where':{'id':_0x28601f['params']['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x12d332,null))[_0x3689('0x26')](function(_0x3a3ba6){if(_0x3a3ba6){_0x5e4bdd[_0x3689('0x4b')]=_['keys'](db[_0x3689('0x77')][_0x3689('0x47')]);_0x5e4bdd[_0x3689('0x4d')]=_[_0x3689('0x4c')](_0x28601f[_0x3689('0x4d')]);_0x5e4bdd[_0x3689('0x4e')]=_[_0x3689('0x4f')](_0x5e4bdd[_0x3689('0x4b')],_0x5e4bdd[_0x3689('0x4d')]);_0x408170['attributes']=_['intersection'](_0x5e4bdd[_0x3689('0x4b')],qs['fields'](_0x28601f[_0x3689('0x4d')][_0x3689('0x50')]));_0x408170[_0x3689('0x51')]=_0x408170['attributes'][_0x3689('0x52')]?_0x408170[_0x3689('0x51')]:_0x5e4bdd['model'];if(!_0x28601f[_0x3689('0x4d')]['hasOwnProperty']('nolimit')){_0x408170[_0x3689('0x37')]=qs[_0x3689('0x37')](_0x28601f[_0x3689('0x4d')]['limit']);_0x408170[_0x3689('0x35')]=qs[_0x3689('0x35')](_0x28601f['query'][_0x3689('0x35')]);}_0x408170[_0x3689('0x53')]=qs[_0x3689('0x54')](_0x28601f[_0x3689('0x4d')][_0x3689('0x54')]);_0x408170[_0x3689('0x56')]=qs[_0x3689('0x4e')](_['pick'](_0x28601f[_0x3689('0x4d')],_0x5e4bdd[_0x3689('0x4e')]));_0x408170[_0x3689('0x56')]['FaxAccountId']=_0x3a3ba6['id'];if(_0x28601f[_0x3689('0x4d')]['filter']){_0x408170['where']=_[_0x3689('0x57')](_0x408170['where'],{'$or':_['map'](_0x408170['attributes'],function(_0x1d1b8a){var _0x5869a7={};_0x5869a7[_0x1d1b8a]={'$like':'%'+_0x28601f[_0x3689('0x4d')][_0x3689('0x58')]+'%'};return _0x5869a7;})});}_0x408170=_[_0x3689('0x57')]({},_0x408170,_0x28601f[_0x3689('0x59')]);return db[_0x3689('0x77')]['count']({'where':_0x408170[_0x3689('0x56')]})[_0x3689('0x26')](function(_0xbcedad){_0x8d9de7[_0x3689('0x38')]=_0xbcedad;if(_0x28601f[_0x3689('0x4d')][_0x3689('0x5a')]){_0x408170[_0x3689('0x5b')]=[{'all':!![]}];}return db[_0x3689('0x77')][_0x3689('0x74')](_0x408170);})[_0x3689('0x26')](function(_0x4e279f){_0x8d9de7[_0x3689('0x5d')]=_0x4e279f;return _0x8d9de7;});}})[_0x3689('0x26')](respondWithFilteredResult(_0x12d332,_0x408170))['catch'](handleError(_0x12d332,null));};exports[_0x3689('0x79')]=function(_0xf3c187,_0xbed047,_0x1c357d){return db[_0x3689('0x5c')][_0x3689('0x61')]({'where':{'id':_0xf3c187['params']['id']}})[_0x3689('0x26')](handleEntityNotFound(_0xbed047,null))[_0x3689('0x26')](function(_0xc8ad0c){if(_0xc8ad0c){return _0xc8ad0c[_0x3689('0x79')](_0xf3c187[_0x3689('0x4d')]['ids']);}})[_0x3689('0x26')](respondWithStatusCode(_0xbed047,null))['catch'](handleError(_0xbed047,null));};exports[_0x3689('0x7a')]=function(_0x390065,_0x4a7934,_0x4e01ad){return db['FaxInteraction']['find']({'where':{'id':_0x390065[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x4a7934,null))[_0x3689('0x26')](function(_0x12ded1){if(_0x12ded1){return _0x12ded1['addInteraction'](_0x390065[_0x3689('0x62')]['ids'],_[_0x3689('0x7b')](_0x390065['body'],[_0x3689('0x76'),'id'])||{});}})['then'](respondWithResult(_0x4a7934,null))[_0x3689('0x5e')](handleError(_0x4a7934,null));};exports[_0x3689('0x7c')]=function(_0x511393,_0x1b7072,_0xb8af21){var _0x48821e={'raw':![],'where':{}};var _0x47fb99={};var _0x5c69c1={'count':0x0,'rows':[]};return db[_0x3689('0x5c')][_0x3689('0x71')]({'where':{'id':_0x511393[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x1b7072,null))[_0x3689('0x26')](function(_0x1617de){if(_0x1617de){_0x47fb99[_0x3689('0x4b')]=_[_0x3689('0x4c')](db['FaxInteraction'][_0x3689('0x47')]);_0x47fb99[_0x3689('0x4d')]=_[_0x3689('0x4c')](_0x511393['query']);_0x47fb99[_0x3689('0x4e')]=_[_0x3689('0x4f')](_0x47fb99[_0x3689('0x4b')],_0x47fb99[_0x3689('0x4d')]);_0x48821e[_0x3689('0x51')]=_[_0x3689('0x4f')](_0x47fb99[_0x3689('0x4b')],qs[_0x3689('0x50')](_0x511393[_0x3689('0x4d')]['fields']));_0x48821e[_0x3689('0x51')]=_0x48821e[_0x3689('0x51')]['length']?_0x48821e[_0x3689('0x51')]:_0x47fb99[_0x3689('0x4b')];if(!_0x511393['query'][_0x3689('0x72')](_0x3689('0x7d'))){_0x48821e[_0x3689('0x37')]=qs['limit'](_0x511393['query'][_0x3689('0x37')]);_0x48821e[_0x3689('0x35')]=qs[_0x3689('0x35')](_0x511393[_0x3689('0x4d')][_0x3689('0x35')]);}_0x48821e[_0x3689('0x53')]=qs[_0x3689('0x54')](_0x511393[_0x3689('0x4d')][_0x3689('0x54')]);_0x48821e['where']=qs[_0x3689('0x4e')](_[_0x3689('0x55')](_0x511393[_0x3689('0x4d')],_0x47fb99[_0x3689('0x4e')]));_0x48821e[_0x3689('0x56')][_0x3689('0x73')]=_0x1617de['id'];if(_0x511393[_0x3689('0x4d')][_0x3689('0x58')]){_0x48821e[_0x3689('0x56')]=_[_0x3689('0x57')](_0x48821e[_0x3689('0x56')],{'$or':_[_0x3689('0x46')](_0x48821e[_0x3689('0x51')],function(_0x30c078){var _0x210525={};_0x210525[_0x30c078]={'$like':'%'+_0x511393[_0x3689('0x4d')][_0x3689('0x58')]+'%'};return _0x210525;})});}_0x48821e=_[_0x3689('0x57')]({},_0x48821e,_0x511393[_0x3689('0x59')]);return db['FaxInteraction'][_0x3689('0x38')]({'where':_0x48821e['where']})[_0x3689('0x26')](function(_0x599663){_0x5c69c1[_0x3689('0x38')]=_0x599663;if(_0x511393[_0x3689('0x4d')][_0x3689('0x5a')]){_0x48821e[_0x3689('0x5b')]=[{'model':db[_0x3689('0x7e')],'as':_0x3689('0x7f'),'required':![]},{'model':db[_0x3689('0x80')],'as':'Owner','attributes':[_0x3689('0x42'),_0x3689('0x81'),_0x3689('0x82')],'required':![]},{'model':db[_0x3689('0x83')],'as':'Tags','attributes':['id',_0x3689('0x42'),_0x3689('0x84')],'where':_0x511393['query'][_0x3689('0x85')]?{'id':_0x511393['query']['tag']}:undefined,'required':_0x511393[_0x3689('0x4d')][_0x3689('0x85')]?!![]:![]}];}return db[_0x3689('0x86')][_0x3689('0x74')](_0x48821e);})[_0x3689('0x26')](function(_0x3e48a4){_0x5c69c1[_0x3689('0x5d')]=_0x3e48a4;return _0x5c69c1;});}})['then'](respondWithFilteredResult(_0x1b7072,_0x48821e))[_0x3689('0x5e')](handleError(_0x1b7072,null));};exports['addApplications']=function(_0x409673,_0x316ed0){var _0x255a50=_0x409673[_0x3689('0x60')]['id'];var _0x2654ff=_0x409673[_0x3689('0x62')];var _0x52bfe6=0xc8;var _0x267937=null;return db[_0x3689('0x87')]['transaction']({'isolationLevel':db[_0x3689('0x87')][_0x3689('0x88')][_0x3689('0x89')][_0x3689('0x8a')]},function(_0x4fc8cc){return db[_0x3689('0x5c')][_0x3689('0x71')]({'where':{'id':_0x255a50},'transaction':_0x4fc8cc})[_0x3689('0x26')](function(_0x515391){if(_0x515391){return db['FaxApplication'][_0x3689('0x3e')]({'where':{'FaxAccountId':_0x255a50},'transaction':_0x4fc8cc})[_0x3689('0x26')](function(){var _0x2c36a6=_[_0x3689('0x46')](_0x2654ff,function(_0xea2640){_0xea2640[_0x3689('0x73')]=_0x255a50;return _0xea2640;});return db[_0x3689('0x8b')][_0x3689('0x8c')](_0x2c36a6,{'transaction':_0x4fc8cc});});}else{_0x52bfe6=0x194;_0x267937=[];}});})['then'](function(){if(_0x52bfe6!==0x194){return db[_0x3689('0x8b')][_0x3689('0x8d')]({'where':{'FaxAccountId':_0x255a50},'order':_0x3689('0x8e')})[_0x3689('0x26')](function(_0x34abe3){_0x267937=_0x34abe3;});}})[_0x3689('0x5e')](function(_0x59e53d){_0x52bfe6=0x1f4;logger[_0x3689('0x2d')](_0x59e53d[_0x3689('0x41')]);if(_0x59e53d['name']){delete _0x59e53d[_0x3689('0x42')];}_0x267937=_0x59e53d;})[_0x3689('0x8f')](function(){if(_0x267937===null){_0x316ed0[_0x3689('0x31')](_0x52bfe6);}else{if(_0x52bfe6===0x1f4){_0x316ed0['status'](_0x52bfe6)[_0x3689('0x43')](_0x267937);}else{_0x316ed0['status'](_0x52bfe6)[_0x3689('0x34')](_0x267937);}}});};exports[_0x3689('0x90')]=function(_0xd29adc,_0x56826b,_0x37e6c5){var _0x5e9018={};var _0x542b90={};var _0x1c7619;var _0x586e1c;return db['FaxAccount'][_0x3689('0x71')]({'where':{'id':_0xd29adc[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x56826b,null))[_0x3689('0x26')](function(_0x2e7919){if(_0x2e7919){_0x1c7619=_0x2e7919;_0x542b90[_0x3689('0x4b')]=_[_0x3689('0x4c')](db[_0x3689('0x8b')][_0x3689('0x47')]);_0x542b90[_0x3689('0x4d')]=_[_0x3689('0x4c')](_0xd29adc[_0x3689('0x4d')]);_0x542b90[_0x3689('0x4e')]=_[_0x3689('0x4f')](_0x542b90[_0x3689('0x4b')],_0x542b90[_0x3689('0x4d')]);_0x5e9018[_0x3689('0x51')]=_[_0x3689('0x4f')](_0x542b90['model'],qs[_0x3689('0x50')](_0xd29adc[_0x3689('0x4d')][_0x3689('0x50')]));_0x5e9018['attributes']=_0x5e9018[_0x3689('0x51')][_0x3689('0x52')]?_0x5e9018[_0x3689('0x51')]:_0x542b90[_0x3689('0x4b')];_0x5e9018[_0x3689('0x53')]=qs['sort'](_0xd29adc[_0x3689('0x4d')][_0x3689('0x54')]);_0x5e9018['where']=qs[_0x3689('0x4e')](_[_0x3689('0x55')](_0xd29adc[_0x3689('0x4d')],_0x542b90['filters']));if(_0xd29adc[_0x3689('0x4d')][_0x3689('0x58')]){_0x5e9018['where']=_[_0x3689('0x57')](_0x5e9018[_0x3689('0x56')],{'$or':_[_0x3689('0x46')](_0x5e9018['attributes'],function(_0x1d7852){var _0x5a92fb={};_0x5a92fb[_0x1d7852]={'$like':'%'+_0xd29adc[_0x3689('0x4d')]['filter']+'%'};return _0x5a92fb;})});}_0x5e9018=_[_0x3689('0x57')]({},_0x5e9018,_0xd29adc[_0x3689('0x59')]);return _0x1c7619[_0x3689('0x90')](_0x5e9018);}})[_0x3689('0x26')](function(_0x365c0d){if(_0x365c0d){_0x586e1c=_0x365c0d['length'];if(!_0xd29adc[_0x3689('0x4d')]['hasOwnProperty'](_0x3689('0x7d'))){_0x5e9018[_0x3689('0x37')]=qs['limit'](_0xd29adc[_0x3689('0x4d')]['limit']);_0x5e9018[_0x3689('0x35')]=qs[_0x3689('0x35')](_0xd29adc[_0x3689('0x4d')][_0x3689('0x35')]);}return _0x1c7619[_0x3689('0x90')](_0x5e9018);}})[_0x3689('0x26')](function(_0x339958){if(_0x339958){return _0x339958?{'count':_0x586e1c,'rows':_0x339958}:null;}})[_0x3689('0x26')](respondWithResult(_0x56826b,null))[_0x3689('0x5e')](handleError(_0x56826b,null));};function Extension(_0x234ff,_0x3ff224,_0x219574,_0x38a9f7){this[_0x3689('0x91')]=_0x3689('0x92');this['exten']=_0x234ff[_0x3689('0x93')];this[_0x3689('0x94')]=_0x38a9f7;this[_0x3689('0x49')]=_0x3689('0x95');this[_0x3689('0x96')]='Fax\x20Extension';this[_0x3689('0x73')]=_0x234ff['id'];this[_0x3689('0x8e')]=_0x3ff224;this[_0x3689('0x97')]=_0x219574;}function createExtensionsReciveFax(_0x37e729){var _0x7ac106=0x1;var _0x3dd76e=[];_0x3dd76e[_0x3689('0x98')](new Extension(_0x37e729,_0x7ac106,'',_0x3689('0x99')));_0x7ac106+=0x1;_0x3dd76e[_0x3689('0x98')](new Extension(_0x37e729,_0x7ac106,_0x3689('0x9a'),'Set'));_0x7ac106+=0x1;for(var _0x479f8f in _0x37e729){if(_0x37e729[_0x3689('0x72')](_0x479f8f)&&(_0x479f8f===_0x3689('0x9b')||_0x479f8f==='localstationid'||_0x479f8f===_0x3689('0x9c')||_0x479f8f===_0x3689('0x9d')||_0x479f8f===_0x3689('0x9e')||_0x479f8f==='maxrate'||_0x479f8f===_0x3689('0x9f')||_0x479f8f===_0x3689('0xa0')||_0x479f8f===_0x3689('0xa1'))){_0x3dd76e[_0x3689('0x98')](new Extension(_0x37e729,_0x7ac106,'FAXOPT('+_0x479f8f+')='+_0x37e729[_0x479f8f],_0x3689('0xa2')));_0x7ac106+=0x1;}}_0x3dd76e[_0x3689('0x98')](new Extension(_0x37e729,_0x7ac106,'6',_0x3689('0xa3')));_0x7ac106+=0x1;_0x3dd76e['push'](new Extension(_0x37e729,_0x7ac106,_0x3689('0xa4'),_0x3689('0xa5')));_0x7ac106=0x0;return _0x3dd76e;}exports[_0x3689('0xa6')]=function(_0x4e6812,_0x4f34a2,_0x336072){var _0x367ab6;return db[_0x3689('0x87')][_0x3689('0xa7')](function(_0x3465e1){return db[_0x3689('0x5c')][_0x3689('0x6a')](_0x4e6812[_0x3689('0x62')],{'transaction':_0x3465e1})[_0x3689('0x26')](function(_0x4573f8){_0x367ab6=_0x4573f8[_0x3689('0x3f')]({'plain':!![]});return db[_0x3689('0xa8')]['bulkCreate'](createExtensionsReciveFax(_0x367ab6),{'transaction':_0x3465e1});});})['then'](function(){return _0x367ab6;})['then'](respondWithResult(_0x4f34a2,null))['catch'](handleError(_0x4f34a2,null));};exports[_0x3689('0xa9')]=function(_0x4a45ee,_0x2e9948,_0x535d99){var _0x39e561;return db[_0x3689('0x87')][_0x3689('0xa7')](function(_0x41d2c4){return db[_0x3689('0x5c')][_0x3689('0x6c')](_0x4a45ee['body'],{'where':{'id':_0x4a45ee[_0x3689('0x62')]['id']},'transaction':_0x41d2c4})[_0x3689('0x26')](function(_0x185af2){return db[_0x3689('0xa8')][_0x3689('0x3e')]({'where':{'FaxAccountId':_0x4a45ee[_0x3689('0x62')]['id']},'transaction':_0x41d2c4})[_0x3689('0x26')](function(_0x2953cb){return db[_0x3689('0xa8')][_0x3689('0x8c')](createExtensionsReciveFax(_[_0x3689('0x7b')](_0x4a45ee[_0x3689('0x62')],[_0x3689('0xaa'),'key',_0x3689('0xab'),_0x3689('0xac'),'TrunkId','ListId'])),{'transaction':_0x41d2c4});});});})['then'](function(){return db[_0x3689('0x5c')][_0x3689('0xad')](_0x4a45ee[_0x3689('0x62')]['id']);})['then'](respondWithResult(_0x2e9948,null))[_0x3689('0x5e')](handleError(_0x2e9948,null));};exports['getMessages']=function(_0x269b8d,_0x2634a3,_0x30a1df){var _0x2fb209={'raw':!![],'where':{}};var _0x1136b5={};var _0x2ab401={'count':0x0,'rows':[]};return db[_0x3689('0x5c')]['findOne']({'where':{'id':_0x269b8d[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x2634a3,null))[_0x3689('0x26')](function(_0x4dfd8d){if(_0x4dfd8d){_0x1136b5[_0x3689('0x4b')]=_['keys'](db['FaxMessage'][_0x3689('0x47')]);_0x1136b5[_0x3689('0x4d')]=_['keys'](_0x269b8d[_0x3689('0x4d')]);_0x1136b5[_0x3689('0x4e')]=_['intersection'](_0x1136b5[_0x3689('0x4b')],_0x1136b5[_0x3689('0x4d')]);_0x2fb209[_0x3689('0x51')]=_['intersection'](_0x1136b5[_0x3689('0x4b')],qs[_0x3689('0x50')](_0x269b8d[_0x3689('0x4d')][_0x3689('0x50')]));_0x2fb209[_0x3689('0x51')]=_0x2fb209[_0x3689('0x51')]['length']?_0x2fb209[_0x3689('0x51')]:_0x1136b5[_0x3689('0x4b')];if(!_0x269b8d[_0x3689('0x4d')]['hasOwnProperty'](_0x3689('0x7d'))){_0x2fb209[_0x3689('0x37')]=qs[_0x3689('0x37')](_0x269b8d[_0x3689('0x4d')][_0x3689('0x37')]);_0x2fb209[_0x3689('0x35')]=qs[_0x3689('0x35')](_0x269b8d['query'][_0x3689('0x35')]);}_0x2fb209[_0x3689('0x53')]=qs['sort'](_0x269b8d[_0x3689('0x4d')][_0x3689('0x54')]);_0x2fb209[_0x3689('0x56')]=qs['filters'](_[_0x3689('0x55')](_0x269b8d['query'],_0x1136b5[_0x3689('0x4e')]));_0x2fb209[_0x3689('0x56')][_0x3689('0x73')]=_0x4dfd8d['id'];if(_0x269b8d[_0x3689('0x4d')][_0x3689('0x58')]){_0x2fb209[_0x3689('0x56')]=_[_0x3689('0x57')](_0x2fb209[_0x3689('0x56')],{'$or':_[_0x3689('0x46')](_0x2fb209[_0x3689('0x51')],function(_0x167093){var _0x273e47={};_0x273e47[_0x167093]={'$like':'%'+_0x269b8d[_0x3689('0x4d')][_0x3689('0x58')]+'%'};return _0x273e47;})});}if(_0x269b8d[_0x3689('0x4d')][_0x3689('0xae')]){var _0x171bf2=_0x269b8d[_0x3689('0x4d')][_0x3689('0xae')][_0x3689('0xaf')](',');var _0x2417bd={};_0x2417bd[_0x171bf2[0x0]]={'$gte':moment(_0x171bf2[0x1])[_0x3689('0xb0')](_0x3689('0xb1'))};_0x2fb209['where']=_[_0x3689('0x57')](_0x2fb209['where'],_0x2417bd);}_0x2fb209=_[_0x3689('0x57')]({},_0x2fb209,_0x269b8d['options']);return db[_0x3689('0xb2')]['count']({'where':_0x2fb209[_0x3689('0x56')]})[_0x3689('0x26')](function(_0x30d1da){_0x2ab401[_0x3689('0x38')]=_0x30d1da;if(_0x269b8d[_0x3689('0x4d')]['includeAll']){_0x2fb209[_0x3689('0x5b')]=[{'all':!![]}];}return db[_0x3689('0xb2')][_0x3689('0x74')](_0x2fb209);})[_0x3689('0x26')](function(_0x3dda82){_0x2ab401[_0x3689('0x5d')]=_0x3dda82;return _0x2ab401;});}})[_0x3689('0x26')](respondWithFilteredResult(_0x2634a3,_0x2fb209))[_0x3689('0x5e')](handleError(_0x2634a3,null));};exports[_0x3689('0x43')]=function(_0xada84c,_0x102dc4,_0x48e4d3){var _0x596789,_0x3b66be={},_0x51f0e4;if(_0xada84c[_0x3689('0x62')]['to']){_0x51f0e4=_0xada84c[_0x3689('0x62')]['to'][0x0];}return db['FaxAccount']['find']({'where':{'id':_0xada84c[_0x3689('0x60')]['id']},'include':[{'model':db[_0x3689('0xb3')],'as':_0x3689('0xb4'),'include':[{'model':db[_0x3689('0x7e')],'as':_0x3689('0xb5'),'where':{'fax':_0x51f0e4},'limit':0x1,'order':[[_0x3689('0xac'),_0x3689('0xb6')]]}]}]})[_0x3689('0x26')](handleEntityNotFound(_0x102dc4,null))[_0x3689('0x26')](function(_0x43c1c7){_0x596789=_0x43c1c7;if(_0xada84c[_0x3689('0x62')]['attachments']&&_0xada84c[_0x3689('0x62')]['attachments'][_0x3689('0x52')]){for(var _0x1ed546=0x0;_0x1ed546<_0xada84c[_0x3689('0x62')]['attachments'][_0x3689('0x52')];_0x1ed546+=0x1){_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][_0x1ed546]={'filename':_0xada84c[_0x3689('0x62')]['attachments'][_0x1ed546][_0x3689('0x42')],'id':_0xada84c[_0x3689('0x62')]['attachments'][_0x1ed546]['id'],'path':path[_0x3689('0xb8')](config[_0x3689('0xb9')],_0x3689('0xba'),_0xada84c[_0x3689('0x62')]['attachments'][_0x1ed546][_0x3689('0xbb')])};}}return respondWithRpcPromise('CheckAfterSend',_0x3689('0xbc'),{'FaxAccountId':_['isNil'](_0xada84c[_0x3689('0x60')]['id'])?undefined:_0xada84c[_0x3689('0x60')]['id'],'path':_['isNil'](_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0][_0x3689('0xbd')])?undefined:_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0][_0x3689('0xbd')],'fax':_[_0x3689('0xbe')](_0xada84c[_0x3689('0x62')]['to'][0x0])?undefined:_0xada84c[_0x3689('0x62')]['to'][0x0]},client9002);})['then'](function(){if(_0x596789){if(_[_0x3689('0xbe')](_0xada84c[_0x3689('0x62')]['from'])){_0xada84c[_0x3689('0x62')][_0x3689('0xbf')]=util['format'](_0x3689('0xc0'),_0x596789[_0x3689('0x42')],_0x596789[_0x3689('0xc1')]);}if(_0x596789[_0x3689('0xb4')]){if(_0x596789[_0x3689('0xb4')][_0x3689('0xb5')][_0x3689('0x52')]){return _0x596789[_0x3689('0xb4')][_0x3689('0xb5')][0x0];}else{return db['CmContact'][_0x3689('0x6a')](_[_0x3689('0x1d')](_0xada84c[_0x3689('0x62')],{'firstName':_0xada84c['body']['to'][0x0],'phone':_0xada84c[_0x3689('0x62')]['to'][0x0],'fax':_0xada84c[_0x3689('0x62')]['to'][0x0],'ListId':_0x596789[_0x3689('0xc2')]}));}}else{throw new Error(_0x3689('0xc3'));}}else{throw new Error(_0x3689('0xc4'));}})[_0x3689('0x26')](function(_0x1310e0){if(_0x1310e0){return db['FaxInteraction'][_0x3689('0x61')]({'where':{'ContactId':_0x1310e0['id'],'closed':![],'FaxAccountId':_0x596789['id']}})[_0x3689('0x26')](function(_0x26a8a5){if(_0x26a8a5){return[_0x26a8a5,![]];}return db[_0x3689('0x86')]['create']({'UserId':_0xada84c[_0x3689('0x63')]['id'],'ContactId':_0x1310e0['id'],'FaxAccountId':_0x596789['id'],'fax':_0xada84c[_0x3689('0x62')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x3689('0x57')](_0xada84c[_0x3689('0x62')],{'read':![],'body':_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0][_0x3689('0xc5')],'FaxAccountId':_0x596789['id'],'UserId':_0xada84c[_0x3689('0x63')]['id'],'ContactId':_0x1310e0['id'],'AttachmentId':_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0]['id']})]},{'include':[{'model':db[_0x3689('0xb2')],'as':_0x3689('0xc6')}]})[_0x3689('0x26')](function(_0x3dc78c){return[_0x3dc78c,!![]];});});}else{throw new Error(_0x3689('0xc7'));}})[_0x3689('0xc8')](function(_0x5a3586,_0x5a8975){if(_0x5a8975){return _0x5a3586;}return db[_0x3689('0xb2')][_0x3689('0x6a')]({'direction':'out','read':![],'body':_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0][_0x3689('0xc5')],'FaxAccountId':_0x596789['id'],'FaxInteractionId':_0x5a3586['id'],'UserId':_0xada84c[_0x3689('0x63')]['id'],'ContactId':_0x5a3586[_0x3689('0xc9')],'AttachmentId':_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0]['id']})[_0x3689('0x26')](function(_0x5d3939){_0x5a3586[_0x3689('0xca')]['Messages']=[];_0x5a3586[_0x3689('0xca')][_0x3689('0xc6')]['push'](_0x5d3939['dataValues']);return _0x5a3586;});})[_0x3689('0x26')](function(_0x3df86b){respondWithRpcPromise(_0x3689('0xcb'),_0x3689('0xcb'),{'FaxAccountId':_[_0x3689('0xbe')](_0xada84c[_0x3689('0x60')]['id'])?undefined:_0xada84c['params']['id'],'path':_['isNil'](_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0][_0x3689('0xbd')])?undefined:_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0][_0x3689('0xbd')],'fax':_[_0x3689('0xbe')](_0xada84c[_0x3689('0x62')]['to'][0x0])?undefined:_0xada84c[_0x3689('0x62')]['to'][0x0],'AttachmentId':_0xada84c[_0x3689('0x62')][_0x3689('0xb7')][0x0]['id']},client9002)[_0x3689('0x26')](function(_0x5e7402){logger[_0x3689('0x27')]('SendFaxRpc,\x20%s',_0x5e7402);})[_0x3689('0x5e')](function(_0x2a819c){logger[_0x3689('0x27')](_0x3689('0xcc'),_0x2a819c);});return _0x3df86b;})[_0x3689('0x26')](respondWithResult(_0x102dc4,null))[_0x3689('0x5e')](handleError(_0x102dc4,null));};exports[_0x3689('0xcd')]=function(_0x478180,_0x4a6157,_0x49056e){return db[_0x3689('0x5c')][_0x3689('0x61')]({'where':{'id':_0x478180[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x4a6157,null))[_0x3689('0x26')](function(_0x1904d2){if(_0x1904d2){return _0x1904d2[_0x3689('0xcd')](_0x478180[_0x3689('0x62')]['ids'],_[_0x3689('0x7b')](_0x478180[_0x3689('0x62')],[_0x3689('0x76'),'id'])||{})[_0x3689('0xc8')](function(_0xf88108){for(var _0x3039a9=0x0;_0x3039a9<_0x478180['body'][_0x3689('0x76')][_0x3689('0x52')];_0x3039a9+=0x1){socket[_0x3689('0xce')](_0x3689('0xcf'),{'UserId':Number(_0x478180['body'][_0x3689('0x76')][_0x3039a9]),'FaxAccountId':Number(_0x478180[_0x3689('0x60')]['id'])});}return _0xf88108;});}})[_0x3689('0x26')](respondWithResult(_0x4a6157,null))[_0x3689('0x5e')](handleError(_0x4a6157,null));};exports[_0x3689('0xd0')]=function(_0xa307d1,_0x3a010b,_0x20bb61){return db['FaxAccount'][_0x3689('0x61')]({'where':{'id':_0xa307d1[_0x3689('0x60')]['id']}})['then'](handleEntityNotFound(_0x3a010b,null))['then'](function(_0x5a26df){if(_0x5a26df){return _0x5a26df[_0x3689('0xd0')](_0xa307d1[_0x3689('0x4d')]['ids'])[_0x3689('0x26')](function(){if(_[_0x3689('0xd1')](_0xa307d1[_0x3689('0x4d')][_0x3689('0x76')])){for(var _0x2b0098=0x0;_0x2b0098<_0xa307d1[_0x3689('0x4d')][_0x3689('0x76')][_0x3689('0x52')];_0x2b0098+=0x1){socket[_0x3689('0xce')]('userFaxAccount:remove',{'UserId':Number(_0xa307d1['query'][_0x3689('0x76')][_0x2b0098]),'FaxAccountId':Number(_0xa307d1['params']['id'])});}}else{socket[_0x3689('0xce')](_0x3689('0xd2'),{'UserId':Number(_0xa307d1[_0x3689('0x4d')][_0x3689('0x76')]),'FaxAccountId':Number(_0xa307d1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x3a010b,null))[_0x3689('0x5e')](handleError(_0x3a010b,null));};exports[_0x3689('0xd3')]=function(_0x5b2f4b,_0x18ce15,_0x17239c){var _0x79d504={};var _0x574472={};var _0x8e6786;var _0x14f5b7;return db['FaxAccount']['findOne']({'where':{'id':_0x5b2f4b[_0x3689('0x60')]['id']}})[_0x3689('0x26')](handleEntityNotFound(_0x18ce15,null))['then'](function(_0x18fefa){if(_0x18fefa){_0x8e6786=_0x18fefa;_0x574472[_0x3689('0x4b')]=_[_0x3689('0x4c')](db[_0x3689('0x80')][_0x3689('0x47')]);_0x574472[_0x3689('0x4d')]=_[_0x3689('0x4c')](_0x5b2f4b[_0x3689('0x4d')]);_0x574472['filters']=_[_0x3689('0x4f')](_0x574472['model'],_0x574472[_0x3689('0x4d')]);_0x79d504[_0x3689('0x51')]=_[_0x3689('0x4f')](_0x574472['model'],qs[_0x3689('0x50')](_0x5b2f4b[_0x3689('0x4d')][_0x3689('0x50')]));_0x79d504['attributes']=_0x79d504[_0x3689('0x51')][_0x3689('0x52')]?_0x79d504[_0x3689('0x51')]:_0x574472['model'];_0x79d504[_0x3689('0x53')]=qs['sort'](_0x5b2f4b[_0x3689('0x4d')]['sort']);_0x79d504['where']=qs[_0x3689('0x4e')](_[_0x3689('0x55')](_0x5b2f4b[_0x3689('0x4d')],_0x574472['filters']));if(_0x5b2f4b['query'][_0x3689('0x58')]){_0x79d504[_0x3689('0x56')]=_[_0x3689('0x57')](_0x79d504[_0x3689('0x56')],{'$or':_[_0x3689('0x46')](_0x79d504[_0x3689('0x51')],function(_0x28a074){var _0x3ac802={};_0x3ac802[_0x28a074]={'$like':'%'+_0x5b2f4b[_0x3689('0x4d')][_0x3689('0x58')]+'%'};return _0x3ac802;})});}_0x79d504=_[_0x3689('0x57')]({},_0x79d504,_0x5b2f4b['options']);return _0x8e6786['getAgents'](_0x79d504);}})['then'](function(_0x4e1688){if(_0x4e1688){_0x14f5b7=_0x4e1688[_0x3689('0x52')];if(!_0x5b2f4b[_0x3689('0x4d')][_0x3689('0x72')]('nolimit')){_0x79d504[_0x3689('0x37')]=qs[_0x3689('0x37')](_0x5b2f4b[_0x3689('0x4d')]['limit']);_0x79d504[_0x3689('0x35')]=qs[_0x3689('0x35')](_0x5b2f4b[_0x3689('0x4d')]['offset']);}return _0x8e6786[_0x3689('0xd3')](_0x79d504);}})[_0x3689('0x26')](function(_0x21b269){if(_0x21b269){return _0x21b269?{'count':_0x14f5b7,'rows':_0x21b269}:null;}})['then'](respondWithResult(_0x18ce15,null))[_0x3689('0x5e')](handleError(_0x18ce15,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 847268e..d339e4d 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 _0xb6a0=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0xd8baf3,_0x238fd0){var _0x492838=function(_0xaffd75){while(--_0xaffd75){_0xd8baf3['push'](_0xd8baf3['shift']());}};_0x492838(++_0x238fd0);}(_0xb6a0,0xf0));var _0x0b6a=function(_0x573322,_0x265979){_0x573322=_0x573322-0x0;var _0x30e01c=_0xb6a0[_0x573322];return _0x30e01c;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x0b6a('0x0'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0b6a('0x1')](0x0);var events={'afterCreate':_0x0b6a('0x2'),'afterUpdate':'update','afterDestroy':_0x0b6a('0x3')};function emitEvent(_0x3534ac){return function(_0x5b5ac6,_0x4f5d04,_0x177954){FaxAccountEvents['emit'](_0x3534ac+':'+_0x5b5ac6['id'],_0x5b5ac6);FaxAccountEvents[_0x0b6a('0x4')](_0x3534ac,_0x5b5ac6);_0x177954(null);};}for(var e in events){if(events[_0x0b6a('0x5')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0x8da8=['update','emit','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x44247a,_0x4b5e6e){var _0x508d36=function(_0x32fc39){while(--_0x32fc39){_0x44247a['push'](_0x44247a['shift']());}};_0x508d36(++_0x4b5e6e);}(_0x8da8,0x187));var _0x88da=function(_0xd1428f,_0x3e332f){_0xd1428f=_0xd1428f-0x0;var _0x4566a9=_0x8da8[_0xd1428f];return _0x4566a9;};'use strict';var EventEmitter=require(_0x88da('0x0'));var FaxAccount=require(_0x88da('0x1'))['db'][_0x88da('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x88da('0x3')](0x0);var events={'afterCreate':_0x88da('0x4'),'afterUpdate':_0x88da('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1e0e68){return function(_0x105998,_0x3f5e32,_0x2bac72){FaxAccountEvents[_0x88da('0x6')](_0x1e0e68+':'+_0x105998['id'],_0x105998);FaxAccountEvents[_0x88da('0x6')](_0x1e0e68,_0x105998);_0x2bac72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0x88da('0x7')](e,emitEvent(event));}}module[_0x88da('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 7f5b02c..a575707 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 _0xface=['lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','FaxAccount'];(function(_0x50c98c,_0x44e16d){var _0x7ee519=function(_0x3a6e98){while(--_0x3a6e98){_0x50c98c['push'](_0x50c98c['shift']());}};_0x7ee519(++_0x44e16d);}(_0xface,0x1cc));var _0xefac=function(_0x5a3545,_0x2da854){_0x5a3545=_0x5a3545-0x0;var _0x523913=_0xface[_0x5a3545];return _0x523913;};'use strict';var _=require(_0xefac('0x0'));var util=require(_0xefac('0x1'));var logger=require(_0xefac('0x2'))(_0xefac('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xefac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xefac('0x5'));var config=require(_0xefac('0x6'));var attributes=require('./faxAccount.attributes');module[_0xefac('0x7')]=function(_0x313c90,_0x31e59f){return _0x313c90[_0xefac('0x8')](_0xefac('0x9'),attributes,{'tableName':'fax_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4b40=['define','FaxAccount','fax_accounts','lodash','util','api','moment','request-promise','path','rimraf','exports'];(function(_0x125233,_0x522bf1){var _0x42d385=function(_0x5544d5){while(--_0x5544d5){_0x125233['push'](_0x125233['shift']());}};_0x42d385(++_0x522bf1);}(_0x4b40,0x1bb));var _0x04b4=function(_0x48fb82,_0x2a0c0c){_0x48fb82=_0x48fb82-0x0;var _0x4bca6f=_0x4b40[_0x48fb82];return _0x4bca6f;};'use strict';var _=require(_0x04b4('0x0'));var util=require(_0x04b4('0x1'));var logger=require('../../config/logger')(_0x04b4('0x2'));var moment=require(_0x04b4('0x3'));var BPromise=require('bluebird');var rp=require(_0x04b4('0x4'));var fs=require('fs');var path=require(_0x04b4('0x5'));var rimraf=require(_0x04b4('0x6'));var config=require('../../config/environment');var attributes=require('./faxAccount.attributes');module[_0x04b4('0x7')]=function(_0x2f3158,_0x28be1a){return _0x2f3158[_0x04b4('0x8')](_0x04b4('0x9'),attributes,{'tableName':_0x04b4('0xa'),'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 a9248bc..7ec56fb 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 _0x8714=['name','UserId','agent','waitForTheAssignedAgent','queueId','FaxQueue','unshift','queue','waitForTheAssignedQueue','startRouting','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxAccount.socket','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','stringify','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','DESC','FaxApplication','Applications','List','get','account','applications','orderBy','priority','asc','Contacts','ListId','contact','FaxInteraction','create','Contact\x20not\x20found','spread','autoclose','push','length','close','unmanaged','created','interaction','FaxMessage','ContactId'];(function(_0x508acd,_0x852c77){var _0x4e8524=function(_0x10ea09){while(--_0x10ea09){_0x508acd['push'](_0x508acd['shift']());}};_0x4e8524(++_0x852c77);}(_0x8714,0x1ea));var _0x4871=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8714[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0x4871('0x0'));var util=require('util');var moment=require(_0x4871('0x1'));var BPromise=require(_0x4871('0x2'));var rs=require(_0x4871('0x3'));var fs=require('fs');var Redis=require(_0x4871('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4871('0x5'));var logger=require(_0x4871('0x6'))(_0x4871('0x7'));var config=require(_0x4871('0x8'));var jayson=require(_0x4871('0x9'));var client=jayson[_0x4871('0xa')][_0x4871('0xb')]({'port':0x232c});config[_0x4871('0xc')]=_[_0x4871('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4871('0xe'))(new Redis(config['redis']));require(_0x4871('0xf'))['register'](socket);function respondWithRpcPromise(_0x4a96e3,_0x23040d,_0x1339c8){return new BPromise(function(_0x2c2ad7,_0xad6e54){return client['request'](_0x4a96e3,_0x1339c8)[_0x4871('0x10')](function(_0x5a70f3){logger[_0x4871('0x11')](_0x4871('0x12'),_0x23040d,_0x4871('0x13'));logger['debug'](_0x4871('0x14'),_0x23040d,_0x4871('0x13'),JSON['stringify'](_0x5a70f3));if(_0x5a70f3[_0x4871('0x15')]){if(_0x5a70f3[_0x4871('0x15')][_0x4871('0x16')]===0x1f4){logger[_0x4871('0x15')](_0x4871('0x12'),_0x23040d,_0x5a70f3[_0x4871('0x15')][_0x4871('0x17')]);return _0xad6e54(_0x5a70f3[_0x4871('0x15')][_0x4871('0x17')]);}logger[_0x4871('0x15')](_0x4871('0x12'),_0x23040d,_0x5a70f3[_0x4871('0x15')][_0x4871('0x17')]);return _0x2c2ad7(_0x5a70f3[_0x4871('0x15')][_0x4871('0x17')]);}else{logger[_0x4871('0x11')]('FaxAccount,\x20%s,\x20%s',_0x23040d,_0x4871('0x13'));_0x2c2ad7(_0x5a70f3[_0x4871('0x18')][_0x4871('0x17')]);}})[_0x4871('0x19')](function(_0x4d4239){logger[_0x4871('0x15')](_0x4871('0x12'),_0x23040d,_0x4d4239);_0xad6e54(_0x4d4239);});});}exports[_0x4871('0x1a')]=function(_0x5388b){var _0x2cfd35=this;return new Promise(function(_0x155f73,_0x551da2){return db[_0x4871('0x1b')][_0x4871('0x1c')]({'raw':_0x5388b['options']?_0x5388b[_0x4871('0x1d')][_0x4871('0x1e')]===undefined?!![]:![]:!![],'where':_0x5388b['options']?_0x5388b[_0x4871('0x1d')][_0x4871('0x1f')]||null:null,'attributes':_0x5388b[_0x4871('0x1d')]?_0x5388b[_0x4871('0x1d')][_0x4871('0x20')]||null:null,'limit':_0x5388b[_0x4871('0x1d')]?_0x5388b['options'][_0x4871('0x21')]||null:null,'include':_0x5388b['options']?_0x5388b[_0x4871('0x1d')][_0x4871('0x22')]?_[_0x4871('0x23')](_0x5388b[_0x4871('0x1d')][_0x4871('0x22')],function(_0x373926){return{'model':db[_0x373926['model']],'as':_0x373926['as'],'attributes':_0x373926[_0x4871('0x20')],'include':_0x373926[_0x4871('0x22')]?_[_0x4871('0x23')](_0x373926['include'],function(_0x44b77e){return{'model':db[_0x44b77e[_0x4871('0x24')]],'as':_0x44b77e['as'],'attributes':_0x44b77e[_0x4871('0x20')],'include':_0x44b77e['include']?_['map'](_0x44b77e['include'],function(_0x4a2ca8){return{'model':db[_0x4a2ca8['model']],'as':_0x4a2ca8['as'],'attributes':_0x4a2ca8[_0x4871('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4871('0x10')](function(_0x2d3621){logger[_0x4871('0x11')](_0x4871('0x1a'),_0x5388b);logger[_0x4871('0x25')](_0x4871('0x1a'),_0x5388b,JSON[_0x4871('0x26')](_0x2d3621));_0x155f73(_0x2d3621);})[_0x4871('0x19')](function(_0x2c938b){logger[_0x4871('0x15')](_0x4871('0x1a'),_0x2c938b['message'],_0x5388b);_0x551da2(_0x2cfd35['error'](0x1f4,_0x2c938b[_0x4871('0x17')]));});});};exports[_0x4871('0x27')]=function(_0x9679cf,_0x3366fa,_0xce5699){var _0x519eff=this;return new Promise(function(_0x4e86ef,_0x5bf0d7){var _0x5a0d4a={'body':_0x9679cf[_0x4871('0x28')],'channel':_0x4871('0x29')};var _0x3a2d73=[];var _0x5961ce=[];var _0x1ca693={};return db[_0x4871('0x2a')][_0x4871('0x2b')]()[_0x4871('0x10')](function(_0x156348){if(!_0x156348){throw new db[(_0x4871('0x2c'))][(_0x4871('0x2d'))](_0x4871('0x2e'));}_0x3a2d73=_[_0x4871('0x2f')](_['keys'](_0x156348),[_0x4871('0x30'),_0x4871('0x31')]);_0x5961ce=_[_0x4871('0x2f')](_[_0x4871('0x32')](_0x156348),['createdAt',_0x4871('0x31'),_0x4871('0x33'),'ListId']);if(_0x9679cf[_0x4871('0x28')]['id']){delete _0x9679cf[_0x4871('0x28')]['id'];}if(_[_0x4871('0x34')](_0x9679cf[_0x4871('0x28')][_0x4871('0x35')])){throw new db['Sequelize'][(_0x4871('0x2d'))](_0x4871('0x36'));}if(_['isNil'](_0x9679cf['body'][_0x4871('0x28')])||_0x9679cf['body']['body']===''){throw new db[(_0x4871('0x2c'))][(_0x4871('0x2d'))](_0x4871('0x37'));}if(_[_0x4871('0x34')](_0x9679cf[_0x4871('0x28')][_0x4871('0x38')])){throw new db[(_0x4871('0x2c'))][(_0x4871('0x2d'))](_0x4871('0x39')+_0x5961ce);}if(!_['includes'](_0x5961ce,_0x9679cf[_0x4871('0x28')][_0x4871('0x38')])){throw new db[(_0x4871('0x2c'))][(_0x4871('0x2d'))](_0x4871('0x3a')+_0x5961ce);}_0x1ca693[_0x9679cf['body'][_0x4871('0x38')]]=_0x9679cf[_0x4871('0x28')]['from'];})['then'](function(){return db[_0x4871('0x1b')][_0x4871('0x3b')]({'where':{'id':_0x9679cf['account']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x1ca693,'limit':0x1,'order':[['updatedAt',_0x4871('0x3c')]]}]},{'model':db[_0x4871('0x3d')],'as':_0x4871('0x3e')}]});})[_0x4871('0x10')](function(_0x376ece){if(_0x376ece&&_0x376ece[_0x4871('0x3f')]){var _0x49516e=_0x376ece[_0x4871('0x40')]({'plain':!![]});_0x5a0d4a[_0x4871('0x41')]=_0x49516e;_0x5a0d4a[_0x4871('0x42')]=_0x49516e[_0x4871('0x3e')];_0x5a0d4a['list']=_0x49516e['List'];_0x5a0d4a[_0x4871('0x42')]=_[_0x4871('0x43')](_0x5a0d4a[_0x4871('0x42')],[_0x4871('0x44')],[_0x4871('0x45')]);if(_0x5a0d4a[_0x4871('0x41')][_0x4871('0x3e')]){delete _0x5a0d4a['account'][_0x4871('0x3e')];}if(_0x5a0d4a[_0x4871('0x41')][_0x4871('0x3f')]&&_0x5a0d4a[_0x4871('0x41')][_0x4871('0x3f')][_0x4871('0x46')]['length']){return _0x5a0d4a[_0x4871('0x41')]['List']['Contacts'][0x0];}var _0x11f0b0=_['defaults'](_0x9679cf[_0x4871('0x28')],{'firstName':_0x9679cf['body']['from'],'ListId':_0x49516e[_0x4871('0x47')]});_0x11f0b0[_0x9679cf['body']['mapKey']]=_0x9679cf[_0x4871('0x28')][_0x4871('0x35')];return db[_0x4871('0x2a')]['create'](_0x11f0b0,{'fields':_0x3a2d73,'raw':!![]});}})[_0x4871('0x10')](function(_0x451bd7){_0x5a0d4a[_0x4871('0x48')]=_0x451bd7;if(_0x451bd7){var _0xe13b17={'ContactId':_0x451bd7['id'],'FaxAccountId':_0x9679cf[_0x4871('0x41')]['id'],'fax':_0x451bd7[_0x4871('0x29')]};return db[_0x4871('0x49')][_0x4871('0x3b')]({'where':{'ContactId':_0x451bd7['id'],'closed':![],'FaxAccountId':_0x9679cf['account']['id']}})['then'](function(_0x15f951){if(_0x15f951){return[_0x15f951,![]];}return db[_0x4871('0x49')][_0x4871('0x4a')](_0xe13b17)[_0x4871('0x10')](function(_0x5ad9e8){return[_0x5ad9e8,!![]];});});}else{throw new Error(_0x4871('0x4b'));}})[_0x4871('0x4c')](function(_0x48b111,_0x1b95c2){var _0x46db91=_0x48b111[_0x4871('0x40')]({'plain':!![]});if(_0x1b95c2){if(_0x5a0d4a[_0x4871('0x41')][_0x4871('0x4d')]){_0x5a0d4a[_0x4871('0x42')][_0x4871('0x4e')]({'id':0x0,'priority':_0x5a0d4a[_0x4871('0x42')][_0x4871('0x4f')]+0x1,'app':_0x4871('0x50'),'appdata':_0x4871('0x51'),'interval':'*,*,*,*'});}_0x46db91[_0x4871('0x52')]=!![];}else{_0x46db91[_0x4871('0x52')]=![];}_0x5a0d4a[_0x4871('0x53')]=_0x46db91;return db[_0x4871('0x54')][_0x4871('0x4a')]({'body':_0x9679cf[_0x4871('0x28')][_0x4871('0x28')],'FaxAccountId':_0x9679cf[_0x4871('0x41')]['id'],'FaxInteractionId':_0x48b111['id'],'direction':'in','ContactId':_0x48b111[_0x4871('0x55')],'AttachmentId':_0x9679cf[_0x4871('0x28')]['AttachmentId']});})[_0x4871('0x10')](function(_0x26d460){_0x5a0d4a[_0x4871('0x17')]=_0x26d460;if(!_0x5a0d4a[_0x4871('0x53')]['UserId'])return;return db['User'][_0x4871('0x3b')]({'attributes':['id',_0x4871('0x56')],'where':{'id':_0x5a0d4a[_0x4871('0x53')][_0x4871('0x57')]}});})['then'](function(_0x22f78e){if(_0x22f78e){_0x5a0d4a[_0x4871('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4871('0x58'),'appdata':_0x22f78e[_0x4871('0x56')]+','+(_0x5a0d4a[_0x4871('0x41')][_0x4871('0x59')]||0xa),'interval':'*,*,*,*'});}if(!_0x5a0d4a[_0x4871('0x53')][_0x4871('0x5a')])return;return db[_0x4871('0x5b')]['find']({'attributes':['id',_0x4871('0x56')],'where':{'id':_0x5a0d4a[_0x4871('0x53')][_0x4871('0x5a')]}});})[_0x4871('0x10')](function(_0x2b68c6){if(_0x2b68c6){_0x5a0d4a[_0x4871('0x42')][_0x4871('0x5c')]({'id':0x0,'priority':0x1,'app':_0x4871('0x5d'),'appdata':_0x2b68c6[_0x4871('0x56')]+','+(_0x5a0d4a['account'][_0x4871('0x5e')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x4871('0x5f'),_0x5a0d4a);})[_0x4871('0x10')](function(_0x5f06d6){_0x4e86ef(_0x5f06d6);})['catch'](function(_0x2274ee){_0x5bf0d7(_0x519eff[_0x4871('0x15')](0x1f4,_0x2274ee[_0x4871('0x17')]));});});}; \ No newline at end of file +var _0xc16d=['findAll','options','raw','where','limit','map','include','model','attributes','stringify','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','get','applications','Applications','list','priority','asc','length','defaults','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','create','ContactId','User','name','unshift','agent','waitForTheAssignedAgent','queueId','queue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount'];(function(_0x2648f3,_0x38a797){var _0x9ef187=function(_0x2a4eaf){while(--_0x2a4eaf){_0x2648f3['push'](_0x2648f3['shift']());}};_0x9ef187(++_0x38a797);}(_0xc16d,0x1b3));var _0xdc16=function(_0x2ce874,_0x2bd2c9){_0x2ce874=_0x2ce874-0x0;var _0x407f5b=_0xc16d[_0x2ce874];return _0x407f5b;};'use strict';var _=require(_0xdc16('0x0'));var util=require(_0xdc16('0x1'));var moment=require(_0xdc16('0x2'));var BPromise=require(_0xdc16('0x3'));var rs=require(_0xdc16('0x4'));var fs=require('fs');var Redis=require(_0xdc16('0x5'));var db=require(_0xdc16('0x6'))['db'];var utils=require(_0xdc16('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xdc16('0x8'));var jayson=require(_0xdc16('0x9'));var client=jayson[_0xdc16('0xa')][_0xdc16('0xb')]({'port':0x232c});config[_0xdc16('0xc')]=_['defaults'](config[_0xdc16('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdc16('0xd'))(new Redis(config[_0xdc16('0xc')]));require(_0xdc16('0xe'))[_0xdc16('0xf')](socket);function respondWithRpcPromise(_0x223ab,_0x522d90,_0x157d69){return new BPromise(function(_0x4e278d,_0x4d7db2){return client[_0xdc16('0x10')](_0x223ab,_0x157d69)[_0xdc16('0x11')](function(_0x552fe8){logger[_0xdc16('0x12')](_0xdc16('0x13'),_0x522d90,_0xdc16('0x14'));logger[_0xdc16('0x15')](_0xdc16('0x16'),_0x522d90,_0xdc16('0x14'),JSON['stringify'](_0x552fe8));if(_0x552fe8[_0xdc16('0x17')]){if(_0x552fe8[_0xdc16('0x17')][_0xdc16('0x18')]===0x1f4){logger[_0xdc16('0x17')]('FaxAccount,\x20%s,\x20%s',_0x522d90,_0x552fe8[_0xdc16('0x17')][_0xdc16('0x19')]);return _0x4d7db2(_0x552fe8['error'][_0xdc16('0x19')]);}logger[_0xdc16('0x17')]('FaxAccount,\x20%s,\x20%s',_0x522d90,_0x552fe8[_0xdc16('0x17')][_0xdc16('0x19')]);return _0x4e278d(_0x552fe8[_0xdc16('0x17')][_0xdc16('0x19')]);}else{logger[_0xdc16('0x12')](_0xdc16('0x13'),_0x522d90,_0xdc16('0x14'));_0x4e278d(_0x552fe8[_0xdc16('0x1a')]['message']);}})[_0xdc16('0x1b')](function(_0x522b43){logger[_0xdc16('0x17')](_0xdc16('0x13'),_0x522d90,_0x522b43);_0x4d7db2(_0x522b43);});});}exports[_0xdc16('0x1c')]=function(_0xeabd66){var _0x109947=this;return new Promise(function(_0x352176,_0x4acc3d){return db[_0xdc16('0x1d')][_0xdc16('0x1e')]({'raw':_0xeabd66[_0xdc16('0x1f')]?_0xeabd66[_0xdc16('0x1f')][_0xdc16('0x20')]===undefined?!![]:![]:!![],'where':_0xeabd66[_0xdc16('0x1f')]?_0xeabd66[_0xdc16('0x1f')][_0xdc16('0x21')]||null:null,'attributes':_0xeabd66[_0xdc16('0x1f')]?_0xeabd66[_0xdc16('0x1f')]['attributes']||null:null,'limit':_0xeabd66[_0xdc16('0x1f')]?_0xeabd66[_0xdc16('0x1f')][_0xdc16('0x22')]||null:null,'include':_0xeabd66[_0xdc16('0x1f')]?_0xeabd66[_0xdc16('0x1f')]['include']?_[_0xdc16('0x23')](_0xeabd66[_0xdc16('0x1f')][_0xdc16('0x24')],function(_0x527dde){return{'model':db[_0x527dde[_0xdc16('0x25')]],'as':_0x527dde['as'],'attributes':_0x527dde[_0xdc16('0x26')],'include':_0x527dde[_0xdc16('0x24')]?_[_0xdc16('0x23')](_0x527dde[_0xdc16('0x24')],function(_0x284d05){return{'model':db[_0x284d05['model']],'as':_0x284d05['as'],'attributes':_0x284d05['attributes'],'include':_0x284d05[_0xdc16('0x24')]?_['map'](_0x284d05[_0xdc16('0x24')],function(_0xca3145){return{'model':db[_0xca3145[_0xdc16('0x25')]],'as':_0xca3145['as'],'attributes':_0xca3145['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc16('0x11')](function(_0xa62650){logger[_0xdc16('0x12')](_0xdc16('0x1c'),_0xeabd66);logger[_0xdc16('0x15')](_0xdc16('0x1c'),_0xeabd66,JSON[_0xdc16('0x27')](_0xa62650));_0x352176(_0xa62650);})[_0xdc16('0x1b')](function(_0x4c16a3){logger[_0xdc16('0x17')](_0xdc16('0x1c'),_0x4c16a3['message'],_0xeabd66);_0x4acc3d(_0x109947[_0xdc16('0x17')](0x1f4,_0x4c16a3[_0xdc16('0x19')]));});});};exports[_0xdc16('0x28')]=function(_0x5dcee8,_0x5982d9,_0x3c414f){var _0x52a708=this;return new Promise(function(_0x484b60,_0x25e9e1){var _0x59324c={'body':_0x5dcee8[_0xdc16('0x29')],'channel':_0xdc16('0x2a')};var _0x49234e=[];var _0x399dfb=[];var _0x8822ad={};return db[_0xdc16('0x2b')]['describe']()['then'](function(_0x4a870f){if(!_0x4a870f){throw new db[(_0xdc16('0x2c'))][(_0xdc16('0x2d'))](_0xdc16('0x2e'));}_0x49234e=_[_0xdc16('0x2f')](_[_0xdc16('0x30')](_0x4a870f),[_0xdc16('0x31'),_0xdc16('0x32')]);_0x399dfb=_[_0xdc16('0x2f')](_['keys'](_0x4a870f),[_0xdc16('0x31'),'updatedAt',_0xdc16('0x33'),_0xdc16('0x34')]);if(_0x5dcee8[_0xdc16('0x29')]['id']){delete _0x5dcee8[_0xdc16('0x29')]['id'];}if(_[_0xdc16('0x35')](_0x5dcee8[_0xdc16('0x29')][_0xdc16('0x36')])){throw new db[(_0xdc16('0x2c'))][(_0xdc16('0x2d'))](_0xdc16('0x37'));}if(_[_0xdc16('0x35')](_0x5dcee8['body']['body'])||_0x5dcee8[_0xdc16('0x29')]['body']===''){throw new db[(_0xdc16('0x2c'))][(_0xdc16('0x2d'))](_0xdc16('0x38'));}if(_[_0xdc16('0x35')](_0x5dcee8[_0xdc16('0x29')][_0xdc16('0x39')])){throw new db['Sequelize'][(_0xdc16('0x2d'))](_0xdc16('0x3a')+_0x399dfb);}if(!_[_0xdc16('0x3b')](_0x399dfb,_0x5dcee8['body']['mapKey'])){throw new db[(_0xdc16('0x2c'))][(_0xdc16('0x2d'))](_0xdc16('0x3c')+_0x399dfb);}_0x8822ad[_0x5dcee8['body'][_0xdc16('0x39')]]=_0x5dcee8['body'][_0xdc16('0x36')];})['then'](function(){return db[_0xdc16('0x1d')][_0xdc16('0x3d')]({'where':{'id':_0x5dcee8[_0xdc16('0x3e')]['id']},'include':[{'model':db['CmList'],'as':_0xdc16('0x3f'),'include':[{'model':db[_0xdc16('0x2b')],'as':_0xdc16('0x40'),'where':_0x8822ad,'limit':0x1,'order':[['updatedAt',_0xdc16('0x41')]]}]},{'model':db[_0xdc16('0x42')],'as':'Applications'}]});})['then'](function(_0x185795){if(_0x185795&&_0x185795['List']){var _0x1bce26=_0x185795[_0xdc16('0x43')]({'plain':!![]});_0x59324c[_0xdc16('0x3e')]=_0x1bce26;_0x59324c[_0xdc16('0x44')]=_0x1bce26[_0xdc16('0x45')];_0x59324c[_0xdc16('0x46')]=_0x1bce26[_0xdc16('0x3f')];_0x59324c['applications']=_['orderBy'](_0x59324c['applications'],[_0xdc16('0x47')],[_0xdc16('0x48')]);if(_0x59324c[_0xdc16('0x3e')][_0xdc16('0x45')]){delete _0x59324c[_0xdc16('0x3e')][_0xdc16('0x45')];}if(_0x59324c['account']['List']&&_0x59324c[_0xdc16('0x3e')][_0xdc16('0x3f')][_0xdc16('0x40')][_0xdc16('0x49')]){return _0x59324c[_0xdc16('0x3e')]['List'][_0xdc16('0x40')][0x0];}var _0x55c0e7=_[_0xdc16('0x4a')](_0x5dcee8[_0xdc16('0x29')],{'firstName':_0x5dcee8[_0xdc16('0x29')]['from'],'ListId':_0x1bce26[_0xdc16('0x34')]});_0x55c0e7[_0x5dcee8['body'][_0xdc16('0x39')]]=_0x5dcee8['body']['from'];return db[_0xdc16('0x2b')]['create'](_0x55c0e7,{'fields':_0x49234e,'raw':!![]});}})['then'](function(_0x3acefe){_0x59324c['contact']=_0x3acefe;if(_0x3acefe){var _0x34fd16={'ContactId':_0x3acefe['id'],'FaxAccountId':_0x5dcee8['account']['id'],'fax':_0x3acefe[_0xdc16('0x2a')]};return db[_0xdc16('0x4b')][_0xdc16('0x3d')]({'where':{'ContactId':_0x3acefe['id'],'closed':![],'FaxAccountId':_0x5dcee8['account']['id']}})['then'](function(_0x480232){if(_0x480232){return[_0x480232,![]];}return db['FaxInteraction']['create'](_0x34fd16)[_0xdc16('0x11')](function(_0xc78819){return[_0xc78819,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xdc16('0x4c')](function(_0x3cc2db,_0xd4adb1){var _0x5008fd=_0x3cc2db['get']({'plain':!![]});if(_0xd4adb1){if(_0x59324c['account'][_0xdc16('0x4d')]){_0x59324c[_0xdc16('0x44')][_0xdc16('0x4e')]({'id':0x0,'priority':_0x59324c[_0xdc16('0x44')]['length']+0x1,'app':_0xdc16('0x4f'),'appdata':_0xdc16('0x50'),'interval':_0xdc16('0x51')});}_0x5008fd['created']=!![];}else{_0x5008fd[_0xdc16('0x52')]=![];}_0x59324c[_0xdc16('0x53')]=_0x5008fd;return db['FaxMessage'][_0xdc16('0x54')]({'body':_0x5dcee8[_0xdc16('0x29')][_0xdc16('0x29')],'FaxAccountId':_0x5dcee8['account']['id'],'FaxInteractionId':_0x3cc2db['id'],'direction':'in','ContactId':_0x3cc2db[_0xdc16('0x55')],'AttachmentId':_0x5dcee8[_0xdc16('0x29')]['AttachmentId']});})[_0xdc16('0x11')](function(_0x26755e){_0x59324c['message']=_0x26755e;if(!_0x59324c[_0xdc16('0x53')]['UserId'])return;return db[_0xdc16('0x56')][_0xdc16('0x3d')]({'attributes':['id',_0xdc16('0x57')],'where':{'id':_0x59324c[_0xdc16('0x53')]['UserId']}});})[_0xdc16('0x11')](function(_0x5b3ea7){if(_0x5b3ea7){_0x59324c[_0xdc16('0x44')][_0xdc16('0x58')]({'id':0x0,'priority':0x0,'app':_0xdc16('0x59'),'appdata':_0x5b3ea7[_0xdc16('0x57')]+','+(_0x59324c['account'][_0xdc16('0x5a')]||0xa),'interval':_0xdc16('0x51')});}if(!_0x59324c[_0xdc16('0x53')][_0xdc16('0x5b')])return;return db['FaxQueue']['find']({'attributes':['id',_0xdc16('0x57')],'where':{'id':_0x59324c[_0xdc16('0x53')][_0xdc16('0x5b')]}});})[_0xdc16('0x11')](function(_0x35354c){if(_0x35354c){_0x59324c[_0xdc16('0x44')][_0xdc16('0x58')]({'id':0x0,'priority':0x1,'app':_0xdc16('0x5c'),'appdata':_0x35354c['name']+','+(_0x59324c['account']['waitForTheAssignedQueue']||0x12c),'interval':_0xdc16('0x51')});}return respondWithRpcPromise('Start','startRouting',_0x59324c);})[_0xdc16('0x11')](function(_0x128805){_0x484b60(_0x128805);})[_0xdc16('0x1b')](function(_0x5621eb){_0x25e9e1(_0x52a708[_0xdc16('0x17')](0x1f4,_0x5621eb[_0xdc16('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 482a137..e27991b 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 _0xe8f7=['update','emit','removeListener','register','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x556927,_0x34b53f){var _0x5f1235=function(_0x4f4e44){while(--_0x4f4e44){_0x556927['push'](_0x556927['shift']());}};_0x5f1235(++_0x34b53f);}(_0xe8f7,0x165));var _0x7e8f=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe8f7[_0x2641f9];return _0x585741;};'use strict';var FaxAccountEvents=require(_0x7e8f('0x0'));var events=[_0x7e8f('0x1'),_0x7e8f('0x2'),_0x7e8f('0x3')];function createListener(_0x4be303,_0x35c488){return function(_0x549cc5){_0x35c488[_0x7e8f('0x4')](_0x4be303,_0x549cc5);};}function removeListener(_0x2aefb2,_0x18150f){return function(){FaxAccountEvents[_0x7e8f('0x5')](_0x2aefb2,_0x18150f);};}exports[_0x7e8f('0x6')]=function(_0x4a568a){for(var _0x5b2cb2=0x0,_0x458301=events[_0x7e8f('0x7')];_0x5b2cb2<_0x458301;_0x5b2cb2++){var _0x55c528=events[_0x5b2cb2];var _0x35e81d=createListener(_0x7e8f('0x8')+_0x55c528,_0x4a568a);FaxAccountEvents['on'](_0x55c528,_0x35e81d);}}; \ No newline at end of file +var _0x5072=['removeListener','register','faxAccount:','./faxAccount.events','save','remove','update','emit'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x5072,0xf3));var _0x2507=function(_0x3308f4,_0x131eb5){_0x3308f4=_0x3308f4-0x0;var _0x4837e6=_0x5072[_0x3308f4];return _0x4837e6;};'use strict';var FaxAccountEvents=require(_0x2507('0x0'));var events=[_0x2507('0x1'),_0x2507('0x2'),_0x2507('0x3')];function createListener(_0xced3f5,_0x50dac5){return function(_0x4595d6){_0x50dac5[_0x2507('0x4')](_0xced3f5,_0x4595d6);};}function removeListener(_0x2b5108,_0x4aff62){return function(){FaxAccountEvents[_0x2507('0x5')](_0x2b5108,_0x4aff62);};}exports[_0x2507('0x6')]=function(_0x13de1c){for(var _0x4a5cd8=0x0,_0x51caf3=events['length'];_0x4a5cd8<_0x51caf3;_0x4a5cd8++){var _0x5569d6=events[_0x4a5cd8];var _0x415ad1=createListener(_0x2507('0x7')+_0x5569d6,_0x13de1c);FaxAccountEvents['on'](_0x5569d6,_0x415ad1);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 9856bf5..6664d6c 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 _0x1294=['send','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','getAnswers','/:id/applications','/:id/messages','getAgents','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','/:id/interactions','/addaccountapplications','addAccountApplications','updateAccountApplications','/:id/send'];(function(_0x2eb3db,_0x4a32c0){var _0x358f33=function(_0x1d0588){while(--_0x1d0588){_0x2eb3db['push'](_0x2eb3db['shift']());}};_0x358f33(++_0x4a32c0);}(_0x1294,0x169));var _0x4129=function(_0x2a403a,_0x4ec334){_0x2a403a=_0x2a403a-0x0;var _0x3a0f0d=_0x1294[_0x2a403a];return _0x3a0f0d;};'use strict';var multer=require(_0x4129('0x0'));var util=require(_0x4129('0x1'));var path=require(_0x4129('0x2'));var timeout=require('connect-timeout');var express=require(_0x4129('0x3'));var router=express[_0x4129('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4129('0x5'));var interaction=require(_0x4129('0x6'));var config=require(_0x4129('0x7'));var controller=require('./faxAccount.controller');router['get']('/',auth[_0x4129('0x8')](),controller[_0x4129('0x9')]);router[_0x4129('0xa')]('/describe',auth[_0x4129('0x8')](),controller[_0x4129('0xb')]);router['get'](_0x4129('0xc'),auth[_0x4129('0x8')](),controller[_0x4129('0xd')]);router[_0x4129('0xa')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x4129('0xa')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x4129('0xe')]);router[_0x4129('0xa')]('/:id/interactions',auth[_0x4129('0x8')](),controller['getInteractions']);router[_0x4129('0xa')](_0x4129('0xf'),auth[_0x4129('0x8')](),controller['getApplications']);router[_0x4129('0xa')](_0x4129('0x10'),auth[_0x4129('0x8')](),controller['getMessages']);router['get']('/:id/users',auth[_0x4129('0x8')](),controller[_0x4129('0x11')]);router[_0x4129('0x12')]('/',auth['isAuthenticated'](),controller[_0x4129('0x13')]);router[_0x4129('0x12')](_0x4129('0x14'),auth[_0x4129('0x8')](),controller[_0x4129('0x15')]);router[_0x4129('0x12')](_0x4129('0x16'),auth[_0x4129('0x8')](),controller[_0x4129('0x17')]);router[_0x4129('0x12')](_0x4129('0x18'),auth[_0x4129('0x8')](),controller['addInteraction']);router[_0x4129('0x12')](_0x4129('0xf'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x4129('0x19'),auth[_0x4129('0x8')](),controller[_0x4129('0x1a')]);router[_0x4129('0x12')]('/updateaccountapplications',auth[_0x4129('0x8')](),controller[_0x4129('0x1b')]);router[_0x4129('0x12')](_0x4129('0x1c'),auth[_0x4129('0x8')](),controller[_0x4129('0x1d')]);router[_0x4129('0x12')](_0x4129('0x1e'),auth[_0x4129('0x8')](),controller[_0x4129('0x1f')]);router[_0x4129('0x20')]('/:id',auth[_0x4129('0x8')](),controller[_0x4129('0x21')]);router[_0x4129('0x22')](_0x4129('0xc'),auth[_0x4129('0x8')](),controller[_0x4129('0x23')]);router[_0x4129('0x22')](_0x4129('0x14'),auth[_0x4129('0x8')](),controller[_0x4129('0x24')]);router[_0x4129('0x22')](_0x4129('0x16'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x4129('0x1e'),auth['isAuthenticated'](),controller[_0x4129('0x25')]);module[_0x4129('0x26')]=router; \ No newline at end of file +var _0x8690=['fs-extra','../../components/auth/service','./faxAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','create','post','/:id/dispositions','/:id/interactions','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','util','path'];(function(_0x56cf29,_0x1acb97){var _0x510f78=function(_0x5e80e0){while(--_0x5e80e0){_0x56cf29['push'](_0x56cf29['shift']());}};_0x510f78(++_0x1acb97);}(_0x8690,0xbc));var _0x0869=function(_0x695b76,_0x551526){_0x695b76=_0x695b76-0x0;var _0x1dc21f=_0x8690[_0x695b76];return _0x1dc21f;};'use strict';var multer=require('multer');var util=require(_0x0869('0x0'));var path=require(_0x0869('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0869('0x2'));var auth=require(_0x0869('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0869('0x4'));router[_0x0869('0x5')]('/',auth[_0x0869('0x6')](),controller[_0x0869('0x7')]);router[_0x0869('0x5')](_0x0869('0x8'),auth[_0x0869('0x6')](),controller[_0x0869('0x9')]);router['get'](_0x0869('0xa'),auth[_0x0869('0x6')](),controller['show']);router[_0x0869('0x5')]('/:id/dispositions',auth[_0x0869('0x6')](),controller[_0x0869('0xb')]);router[_0x0869('0x5')](_0x0869('0xc'),auth['isAuthenticated'](),controller[_0x0869('0xd')]);router[_0x0869('0x5')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x0869('0xe')]);router['get'](_0x0869('0xf'),auth[_0x0869('0x6')](),controller[_0x0869('0x10')]);router['get'](_0x0869('0x11'),auth[_0x0869('0x6')](),controller[_0x0869('0x12')]);router[_0x0869('0x5')](_0x0869('0x13'),auth[_0x0869('0x6')](),controller[_0x0869('0x14')]);router['post']('/',auth[_0x0869('0x6')](),controller[_0x0869('0x15')]);router[_0x0869('0x16')](_0x0869('0x17'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x0869('0xc'),auth[_0x0869('0x6')](),controller['addAnswer']);router[_0x0869('0x16')](_0x0869('0x18'),auth['isAuthenticated'](),controller[_0x0869('0x19')]);router[_0x0869('0x16')]('/:id/applications',auth[_0x0869('0x6')](),controller[_0x0869('0x1a')]);router[_0x0869('0x16')](_0x0869('0x1b'),auth['isAuthenticated'](),controller[_0x0869('0x1c')]);router[_0x0869('0x16')](_0x0869('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0869('0x16')](_0x0869('0x1e'),auth[_0x0869('0x6')](),controller['send']);router[_0x0869('0x16')]('/:id/users',auth[_0x0869('0x6')](),controller[_0x0869('0x1f')]);router[_0x0869('0x20')]('/:id',auth[_0x0869('0x6')](),controller[_0x0869('0x21')]);router['delete']('/:id',auth[_0x0869('0x6')](),controller['destroy']);router[_0x0869('0x22')](_0x0869('0x17'),auth[_0x0869('0x6')](),controller[_0x0869('0x23')]);router[_0x0869('0x22')](_0x0869('0xc'),auth[_0x0869('0x6')](),controller[_0x0869('0x24')]);router[_0x0869('0x22')](_0x0869('0x13'),auth[_0x0869('0x6')](),controller['removeAgents']);module[_0x0869('0x25')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index dbbff32..8e06bf4 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 _0x4648=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x4648,0x137));var _0x8464=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x4648[_0x28947d];return _0x12d2ee;};'use strict';var Sequelize=require('sequelize');module[_0x8464('0x0')]={'priority':{'type':Sequelize[_0x8464('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x8464('0x2')],'allowNull':![],'defaultValue':_0x8464('0x3')},'appdata':{'type':Sequelize[_0x8464('0x4')]()},'description':{'type':Sequelize[_0x8464('0x2')]},'interval':{'type':Sequelize[_0x8464('0x2')],'defaultValue':_0x8464('0x5')}}; \ No newline at end of file +var _0x1f22=['exports','INTEGER','STRING','noop','TEXT'];(function(_0xcecc7d,_0x2f2899){var _0x5883ba=function(_0x4f618d){while(--_0x4f618d){_0xcecc7d['push'](_0xcecc7d['shift']());}};_0x5883ba(++_0x2f2899);}(_0x1f22,0x113));var _0x21f2=function(_0xd02af1,_0x31b6f8){_0xd02af1=_0xd02af1-0x0;var _0x12f101=_0x1f22[_0xd02af1];return _0x12f101;};'use strict';var Sequelize=require('sequelize');module[_0x21f2('0x0')]={'priority':{'type':Sequelize[_0x21f2('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x21f2('0x2')],'allowNull':![],'defaultValue':_0x21f2('0x3')},'appdata':{'type':Sequelize[_0x21f2('0x4')]()},'description':{'type':Sequelize[_0x21f2('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index cf8f550..76ae532 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 _0x5b3b=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','FaxApplication','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x5b3b,0x116));var _0xb5b3=function(_0x1af63a,_0x215b9d){_0x1af63a=_0x1af63a-0x0;var _0x6fe0d4=_0x5b3b[_0x1af63a];return _0x6fe0d4;};'use strict';var emlformat=require(_0xb5b3('0x0'));var rimraf=require(_0xb5b3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5b3('0x2'));var rp=require(_0xb5b3('0x3'));var moment=require(_0xb5b3('0x4'));var BPromise=require(_0xb5b3('0x5'));var Mustache=require('mustache');var util=require(_0xb5b3('0x6'));var path=require(_0xb5b3('0x7'));var sox=require(_0xb5b3('0x8'));var csv=require(_0xb5b3('0x9'));var ejs=require(_0xb5b3('0xa'));var fs=require('fs');var fs_extra=require(_0xb5b3('0xb'));var _=require(_0xb5b3('0xc'));var squel=require('squel');var crypto=require(_0xb5b3('0xd'));var jsforce=require(_0xb5b3('0xe'));var deskjs=require(_0xb5b3('0xf'));var toCsv=require(_0xb5b3('0x9'));var querystring=require('querystring');var Papa=require(_0xb5b3('0x10'));var Redis=require(_0xb5b3('0x11'));var authService=require(_0xb5b3('0x12'));var qs=require(_0xb5b3('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb5b3('0x14'));var logger=require(_0xb5b3('0x15'))(_0xb5b3('0x16'));var utils=require(_0xb5b3('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb5b3('0x18'));var db=require(_0xb5b3('0x19'))['db'];function respondWithStatusCode(_0x512094,_0x2bb0fe){_0x2bb0fe=_0x2bb0fe||0xcc;return function(_0x1509b5){if(_0x1509b5){return _0x512094[_0xb5b3('0x1a')](_0x2bb0fe);}return _0x512094[_0xb5b3('0x1b')](_0x2bb0fe)[_0xb5b3('0x1c')]();};}function respondWithResult(_0x1ecaaf,_0x101979){_0x101979=_0x101979||0xc8;return function(_0x1b0e5d){if(_0x1b0e5d){return _0x1ecaaf[_0xb5b3('0x1b')](_0x101979)[_0xb5b3('0x1d')](_0x1b0e5d);}};}function respondWithFilteredResult(_0x55ee82,_0x50153d){return function(_0x3386b4){if(_0x3386b4){var _0x4d28bc=typeof _0x50153d[_0xb5b3('0x1e')]===_0xb5b3('0x1f')&&typeof _0x50153d[_0xb5b3('0x20')]===_0xb5b3('0x1f');var _0x3c97ac=_0x3386b4[_0xb5b3('0x21')];var _0x119272=_0x4d28bc?0x0:_0x50153d['offset'];var _0x5705a5=_0x4d28bc?_0x3386b4[_0xb5b3('0x21')]:_0x50153d[_0xb5b3('0x1e')]+_0x50153d[_0xb5b3('0x20')];var _0x4c9d8a;if(_0x5705a5>=_0x3c97ac){_0x5705a5=_0x3c97ac;_0x4c9d8a=0xc8;}else{_0x4c9d8a=0xce;}_0x55ee82[_0xb5b3('0x1b')](_0x4c9d8a);return _0x55ee82['set'](_0xb5b3('0x22'),_0x119272+'-'+_0x5705a5+'/'+_0x3c97ac)[_0xb5b3('0x1d')](_0x3386b4);}return null;};}function patchUpdates(_0x650f8a){return function(_0x32f97f){try{jsonpatch[_0xb5b3('0x23')](_0x32f97f,_0x650f8a,!![]);}catch(_0x4cdc46){return BPromise[_0xb5b3('0x24')](_0x4cdc46);}return _0x32f97f[_0xb5b3('0x25')]();};}function saveUpdates(_0x587a00,_0x2ebae4){return function(_0x1e8e10){if(_0x1e8e10){return _0x1e8e10[_0xb5b3('0x26')](_0x587a00)[_0xb5b3('0x27')](function(_0xa2919c){return _0xa2919c;});}return null;};}function removeEntity(_0x246bd5,_0x382e5d){return function(_0x2febb9){if(_0x2febb9){return _0x2febb9[_0xb5b3('0x28')]()[_0xb5b3('0x27')](function(){_0x246bd5['status'](0xcc)[_0xb5b3('0x1c')]();});}};}function handleEntityNotFound(_0x3b04bb,_0x572e6e){return function(_0x551d4b){if(!_0x551d4b){_0x3b04bb['sendStatus'](0x194);}return _0x551d4b;};}function handleError(_0x35e839,_0x2dc754){_0x2dc754=_0x2dc754||0x1f4;return function(_0x33b238){logger[_0xb5b3('0x29')](_0x33b238[_0xb5b3('0x2a')]);if(_0x33b238[_0xb5b3('0x2b')]){delete _0x33b238[_0xb5b3('0x2b')];}_0x35e839[_0xb5b3('0x1b')](_0x2dc754)['send'](_0x33b238);};}exports[_0xb5b3('0x2c')]=function(_0x53cab,_0x4d5dcd){var _0x40f96c={},_0x45fc67={},_0x58adc5={'count':0x0,'rows':[]};var _0x463f8a=_['map'](db[_0xb5b3('0x2d')]['rawAttributes'],function(_0xa524df){return{'name':_0xa524df['fieldName'],'type':_0xa524df[_0xb5b3('0x2e')][_0xb5b3('0x2f')]};});_0x45fc67['model']=_[_0xb5b3('0x30')](_0x463f8a,_0xb5b3('0x2b'));_0x45fc67[_0xb5b3('0x31')]=_[_0xb5b3('0x32')](_0x53cab[_0xb5b3('0x31')]);_0x45fc67[_0xb5b3('0x33')]=_[_0xb5b3('0x34')](_0x45fc67[_0xb5b3('0x35')],_0x45fc67['query']);_0x40f96c[_0xb5b3('0x36')]=_[_0xb5b3('0x34')](_0x45fc67[_0xb5b3('0x35')],qs[_0xb5b3('0x37')](_0x53cab[_0xb5b3('0x31')][_0xb5b3('0x37')]));_0x40f96c[_0xb5b3('0x36')]=_0x40f96c[_0xb5b3('0x36')][_0xb5b3('0x38')]?_0x40f96c['attributes']:_0x45fc67['model'];if(!_0x53cab[_0xb5b3('0x31')][_0xb5b3('0x39')](_0xb5b3('0x3a'))){_0x40f96c[_0xb5b3('0x20')]=qs['limit'](_0x53cab[_0xb5b3('0x31')][_0xb5b3('0x20')]);_0x40f96c[_0xb5b3('0x1e')]=qs[_0xb5b3('0x1e')](_0x53cab[_0xb5b3('0x31')][_0xb5b3('0x1e')]);}_0x40f96c[_0xb5b3('0x3b')]=qs[_0xb5b3('0x3c')](_0x53cab['query']['sort']);_0x40f96c[_0xb5b3('0x3d')]=qs[_0xb5b3('0x33')](_['pick'](_0x53cab[_0xb5b3('0x31')],_0x45fc67[_0xb5b3('0x33')]),_0x463f8a);if(_0x53cab[_0xb5b3('0x31')]['filter']){_0x40f96c[_0xb5b3('0x3d')]=_['merge'](_0x40f96c['where'],{'$or':_['map'](_0x463f8a,function(_0xeb4234){if(_0xeb4234[_0xb5b3('0x2e')]!==_0xb5b3('0x3e')){var _0xc545a9={};_0xc545a9[_0xeb4234[_0xb5b3('0x2b')]]={'$like':'%'+_0x53cab[_0xb5b3('0x31')]['filter']+'%'};return _0xc545a9;}})});}_0x40f96c=_['merge']({},_0x40f96c,_0x53cab[_0xb5b3('0x3f')]);var _0x442831={'where':_0x40f96c[_0xb5b3('0x3d')]};return db[_0xb5b3('0x2d')][_0xb5b3('0x21')](_0x442831)[_0xb5b3('0x27')](function(_0x510456){_0x58adc5[_0xb5b3('0x21')]=_0x510456;if(_0x53cab[_0xb5b3('0x31')][_0xb5b3('0x40')]){_0x40f96c[_0xb5b3('0x41')]=[{'all':!![]}];}return db[_0xb5b3('0x2d')]['findAll'](_0x40f96c);})[_0xb5b3('0x27')](function(_0x255058){_0x58adc5[_0xb5b3('0x42')]=_0x255058;return _0x58adc5;})[_0xb5b3('0x27')](respondWithFilteredResult(_0x4d5dcd,_0x40f96c))[_0xb5b3('0x43')](handleError(_0x4d5dcd,null));};exports[_0xb5b3('0x44')]=function(_0x2c7ef4,_0x2fc0c3){var _0x5304f1={'raw':!![],'where':{'id':_0x2c7ef4[_0xb5b3('0x45')]['id']}},_0x432417={};_0x432417[_0xb5b3('0x35')]=_[_0xb5b3('0x32')](db['FaxApplication'][_0xb5b3('0x46')]);_0x432417[_0xb5b3('0x31')]=_[_0xb5b3('0x32')](_0x2c7ef4[_0xb5b3('0x31')]);_0x432417['filters']=_[_0xb5b3('0x34')](_0x432417[_0xb5b3('0x35')],_0x432417[_0xb5b3('0x31')]);_0x5304f1[_0xb5b3('0x36')]=_[_0xb5b3('0x34')](_0x432417[_0xb5b3('0x35')],qs['fields'](_0x2c7ef4[_0xb5b3('0x31')]['fields']));_0x5304f1['attributes']=_0x5304f1[_0xb5b3('0x36')][_0xb5b3('0x38')]?_0x5304f1[_0xb5b3('0x36')]:_0x432417[_0xb5b3('0x35')];if(_0x2c7ef4[_0xb5b3('0x31')][_0xb5b3('0x40')]){_0x5304f1['include']=[{'all':!![]}];}_0x5304f1=_['merge']({},_0x5304f1,_0x2c7ef4[_0xb5b3('0x3f')]);return db[_0xb5b3('0x2d')][_0xb5b3('0x47')](_0x5304f1)['then'](handleEntityNotFound(_0x2fc0c3,null))[_0xb5b3('0x27')](respondWithResult(_0x2fc0c3,null))['catch'](handleError(_0x2fc0c3,null));};exports['create']=function(_0x2b349f,_0x3755c5){return db[_0xb5b3('0x2d')][_0xb5b3('0x48')](_0x2b349f[_0xb5b3('0x49')],{})[_0xb5b3('0x27')](respondWithResult(_0x3755c5,0xc9))[_0xb5b3('0x43')](handleError(_0x3755c5,null));};exports[_0xb5b3('0x26')]=function(_0x436de0,_0x1464c7){if(_0x436de0[_0xb5b3('0x49')]['id']){delete _0x436de0['body']['id'];}return db['FaxApplication'][_0xb5b3('0x47')]({'where':{'id':_0x436de0[_0xb5b3('0x45')]['id']}})[_0xb5b3('0x27')](handleEntityNotFound(_0x1464c7,null))['then'](saveUpdates(_0x436de0[_0xb5b3('0x49')],null))[_0xb5b3('0x27')](respondWithResult(_0x1464c7,null))[_0xb5b3('0x43')](handleError(_0x1464c7,null));};exports['destroy']=function(_0x3de304,_0x305610){return db[_0xb5b3('0x2d')][_0xb5b3('0x47')]({'where':{'id':_0x3de304[_0xb5b3('0x45')]['id']}})[_0xb5b3('0x27')](handleEntityNotFound(_0x305610,null))[_0xb5b3('0x27')](removeEntity(_0x305610,null))[_0xb5b3('0x43')](handleError(_0x305610,null));}; \ No newline at end of file +var _0x1086=['keys','find','create','body','update','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','then','destroy','error','name','map','FaxApplication','rawAttributes','fieldName','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show'];(function(_0x358bca,_0x676719){var _0x58a0a2=function(_0x50ba30){while(--_0x50ba30){_0x358bca['push'](_0x358bca['shift']());}};_0x58a0a2(++_0x676719);}(_0x1086,0x1b0));var _0x6108=function(_0x391c12,_0x31943d){_0x391c12=_0x391c12-0x0;var _0x238675=_0x1086[_0x391c12];return _0x238675;};'use strict';var emlformat=require(_0x6108('0x0'));var rimraf=require(_0x6108('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6108('0x2'));var rp=require(_0x6108('0x3'));var moment=require(_0x6108('0x4'));var BPromise=require(_0x6108('0x5'));var Mustache=require(_0x6108('0x6'));var util=require(_0x6108('0x7'));var path=require(_0x6108('0x8'));var sox=require(_0x6108('0x9'));var csv=require(_0x6108('0xa'));var ejs=require(_0x6108('0xb'));var fs=require('fs');var fs_extra=require(_0x6108('0xc'));var _=require('lodash');var squel=require(_0x6108('0xd'));var crypto=require(_0x6108('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6108('0xf'));var toCsv=require(_0x6108('0xa'));var querystring=require(_0x6108('0x10'));var Papa=require(_0x6108('0x11'));var Redis=require(_0x6108('0x12'));var authService=require(_0x6108('0x13'));var qs=require(_0x6108('0x14'));var as=require(_0x6108('0x15'));var hardwareService=require(_0x6108('0x16'));var logger=require(_0x6108('0x17'))(_0x6108('0x18'));var utils=require(_0x6108('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3885e4,_0x39d035){_0x39d035=_0x39d035||0xcc;return function(_0x12d416){if(_0x12d416){return _0x3885e4[_0x6108('0x1a')](_0x39d035);}return _0x3885e4[_0x6108('0x1b')](_0x39d035)[_0x6108('0x1c')]();};}function respondWithResult(_0x397b5d,_0x2ca513){_0x2ca513=_0x2ca513||0xc8;return function(_0x4e5f82){if(_0x4e5f82){return _0x397b5d[_0x6108('0x1b')](_0x2ca513)[_0x6108('0x1d')](_0x4e5f82);}};}function respondWithFilteredResult(_0x20466c,_0x9c3691){return function(_0x36f1b3){if(_0x36f1b3){var _0x40cd08=typeof _0x9c3691[_0x6108('0x1e')]===_0x6108('0x1f')&&typeof _0x9c3691[_0x6108('0x20')]===_0x6108('0x1f');var _0x2f69d4=_0x36f1b3[_0x6108('0x21')];var _0x2cfbbd=_0x40cd08?0x0:_0x9c3691['offset'];var _0x11c997=_0x40cd08?_0x36f1b3['count']:_0x9c3691[_0x6108('0x1e')]+_0x9c3691[_0x6108('0x20')];var _0x1a7c22;if(_0x11c997>=_0x2f69d4){_0x11c997=_0x2f69d4;_0x1a7c22=0xc8;}else{_0x1a7c22=0xce;}_0x20466c[_0x6108('0x1b')](_0x1a7c22);return _0x20466c[_0x6108('0x22')]('Content-Range',_0x2cfbbd+'-'+_0x11c997+'/'+_0x2f69d4)[_0x6108('0x1d')](_0x36f1b3);}return null;};}function patchUpdates(_0x3ed746){return function(_0x39a717){try{jsonpatch[_0x6108('0x23')](_0x39a717,_0x3ed746,!![]);}catch(_0x2aaa15){return BPromise['reject'](_0x2aaa15);}return _0x39a717[_0x6108('0x24')]();};}function saveUpdates(_0x2fe61c,_0x290d3c){return function(_0x828b13){if(_0x828b13){return _0x828b13['update'](_0x2fe61c)[_0x6108('0x25')](function(_0x48fa8e){return _0x48fa8e;});}return null;};}function removeEntity(_0x19030e,_0x1b325c){return function(_0x3b958a){if(_0x3b958a){return _0x3b958a[_0x6108('0x26')]()[_0x6108('0x25')](function(){_0x19030e[_0x6108('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21e184,_0x170b97){return function(_0x4fac8e){if(!_0x4fac8e){_0x21e184['sendStatus'](0x194);}return _0x4fac8e;};}function handleError(_0x33a9e1,_0x1697de){_0x1697de=_0x1697de||0x1f4;return function(_0x13f28e){logger[_0x6108('0x27')](_0x13f28e['stack']);if(_0x13f28e[_0x6108('0x28')]){delete _0x13f28e['name'];}_0x33a9e1[_0x6108('0x1b')](_0x1697de)['send'](_0x13f28e);};}exports['index']=function(_0x3c8567,_0x446fb3){var _0x4d507a={},_0x437e5c={},_0x590a2b={'count':0x0,'rows':[]};var _0x1f607c=_[_0x6108('0x29')](db[_0x6108('0x2a')][_0x6108('0x2b')],function(_0x196316){return{'name':_0x196316[_0x6108('0x2c')],'type':_0x196316['type']['key']};});_0x437e5c['model']=_['map'](_0x1f607c,_0x6108('0x28'));_0x437e5c[_0x6108('0x2d')]=_['keys'](_0x3c8567[_0x6108('0x2d')]);_0x437e5c[_0x6108('0x2e')]=_[_0x6108('0x2f')](_0x437e5c['model'],_0x437e5c[_0x6108('0x2d')]);_0x4d507a[_0x6108('0x30')]=_[_0x6108('0x2f')](_0x437e5c[_0x6108('0x31')],qs[_0x6108('0x32')](_0x3c8567[_0x6108('0x2d')][_0x6108('0x32')]));_0x4d507a[_0x6108('0x30')]=_0x4d507a[_0x6108('0x30')][_0x6108('0x33')]?_0x4d507a[_0x6108('0x30')]:_0x437e5c[_0x6108('0x31')];if(!_0x3c8567[_0x6108('0x2d')][_0x6108('0x34')](_0x6108('0x35'))){_0x4d507a[_0x6108('0x20')]=qs['limit'](_0x3c8567[_0x6108('0x2d')]['limit']);_0x4d507a['offset']=qs['offset'](_0x3c8567[_0x6108('0x2d')][_0x6108('0x1e')]);}_0x4d507a['order']=qs[_0x6108('0x36')](_0x3c8567[_0x6108('0x2d')][_0x6108('0x36')]);_0x4d507a['where']=qs['filters'](_['pick'](_0x3c8567[_0x6108('0x2d')],_0x437e5c[_0x6108('0x2e')]),_0x1f607c);if(_0x3c8567[_0x6108('0x2d')]['filter']){_0x4d507a[_0x6108('0x37')]=_[_0x6108('0x38')](_0x4d507a[_0x6108('0x37')],{'$or':_[_0x6108('0x29')](_0x1f607c,function(_0x29b473){if(_0x29b473[_0x6108('0x39')]!==_0x6108('0x3a')){var _0xbe9bdc={};_0xbe9bdc[_0x29b473[_0x6108('0x28')]]={'$like':'%'+_0x3c8567[_0x6108('0x2d')]['filter']+'%'};return _0xbe9bdc;}})});}_0x4d507a=_[_0x6108('0x38')]({},_0x4d507a,_0x3c8567[_0x6108('0x3b')]);var _0x563077={'where':_0x4d507a[_0x6108('0x37')]};return db[_0x6108('0x2a')]['count'](_0x563077)[_0x6108('0x25')](function(_0x55db21){_0x590a2b[_0x6108('0x21')]=_0x55db21;if(_0x3c8567[_0x6108('0x2d')][_0x6108('0x3c')]){_0x4d507a[_0x6108('0x3d')]=[{'all':!![]}];}return db[_0x6108('0x2a')]['findAll'](_0x4d507a);})[_0x6108('0x25')](function(_0x259b8c){_0x590a2b[_0x6108('0x3e')]=_0x259b8c;return _0x590a2b;})[_0x6108('0x25')](respondWithFilteredResult(_0x446fb3,_0x4d507a))[_0x6108('0x3f')](handleError(_0x446fb3,null));};exports[_0x6108('0x40')]=function(_0x48147b,_0x39a4ca){var _0x2e834d={'raw':!![],'where':{'id':_0x48147b['params']['id']}},_0xfaf219={};_0xfaf219[_0x6108('0x31')]=_[_0x6108('0x41')](db[_0x6108('0x2a')][_0x6108('0x2b')]);_0xfaf219['query']=_[_0x6108('0x41')](_0x48147b[_0x6108('0x2d')]);_0xfaf219[_0x6108('0x2e')]=_[_0x6108('0x2f')](_0xfaf219[_0x6108('0x31')],_0xfaf219['query']);_0x2e834d['attributes']=_[_0x6108('0x2f')](_0xfaf219[_0x6108('0x31')],qs[_0x6108('0x32')](_0x48147b[_0x6108('0x2d')][_0x6108('0x32')]));_0x2e834d['attributes']=_0x2e834d[_0x6108('0x30')][_0x6108('0x33')]?_0x2e834d[_0x6108('0x30')]:_0xfaf219['model'];if(_0x48147b[_0x6108('0x2d')][_0x6108('0x3c')]){_0x2e834d[_0x6108('0x3d')]=[{'all':!![]}];}_0x2e834d=_[_0x6108('0x38')]({},_0x2e834d,_0x48147b['options']);return db[_0x6108('0x2a')][_0x6108('0x42')](_0x2e834d)['then'](handleEntityNotFound(_0x39a4ca,null))[_0x6108('0x25')](respondWithResult(_0x39a4ca,null))[_0x6108('0x3f')](handleError(_0x39a4ca,null));};exports[_0x6108('0x43')]=function(_0x1f442f,_0x4cac64){return db[_0x6108('0x2a')][_0x6108('0x43')](_0x1f442f[_0x6108('0x44')],{})[_0x6108('0x25')](respondWithResult(_0x4cac64,0xc9))[_0x6108('0x3f')](handleError(_0x4cac64,null));};exports[_0x6108('0x45')]=function(_0x33357b,_0x8d8109){if(_0x33357b[_0x6108('0x44')]['id']){delete _0x33357b[_0x6108('0x44')]['id'];}return db[_0x6108('0x2a')][_0x6108('0x42')]({'where':{'id':_0x33357b[_0x6108('0x46')]['id']}})[_0x6108('0x25')](handleEntityNotFound(_0x8d8109,null))[_0x6108('0x25')](saveUpdates(_0x33357b[_0x6108('0x44')],null))[_0x6108('0x25')](respondWithResult(_0x8d8109,null))[_0x6108('0x3f')](handleError(_0x8d8109,null));};exports[_0x6108('0x26')]=function(_0x4cf9e1,_0x4bf372){return db['FaxApplication'][_0x6108('0x42')]({'where':{'id':_0x4cf9e1[_0x6108('0x46')]['id']}})[_0x6108('0x25')](handleEntityNotFound(_0x4bf372,null))['then'](removeEntity(_0x4bf372,null))[_0x6108('0x3f')](handleError(_0x4bf372,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 567804d..6cc6e70 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 _0x2e42=['exports','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x102977,_0x3a99a6){var _0x15c466=function(_0x1a6a12){while(--_0x1a6a12){_0x102977['push'](_0x102977['shift']());}};_0x15c466(++_0x3a99a6);}(_0x2e42,0x104));var _0x22e4=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2e42[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x22e4('0x0'));var util=require(_0x22e4('0x1'));var logger=require(_0x22e4('0x2'))(_0x22e4('0x3'));var moment=require(_0x22e4('0x4'));var BPromise=require(_0x22e4('0x5'));var rp=require(_0x22e4('0x6'));var fs=require('fs');var path=require(_0x22e4('0x7'));var rimraf=require(_0x22e4('0x8'));var config=require(_0x22e4('0x9'));var attributes=require('./faxApplication.attributes');module[_0x22e4('0xa')]=function(_0x30d0ae,_0x1ea5d4){return _0x30d0ae['define'](_0x22e4('0xb'),attributes,{'tableName':_0x22e4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x22e4('0xd'),'collate':_0x22e4('0xe')});}; \ No newline at end of file +var _0x0f8f=['exports','FaxApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes'];(function(_0x8cb470,_0x2b9757){var _0x2ca139=function(_0x5251be){while(--_0x5251be){_0x8cb470['push'](_0x8cb470['shift']());}};_0x2ca139(++_0x2b9757);}(_0x0f8f,0x7c));var _0xf0f8=function(_0x1cbcf1,_0x3f9fd9){_0x1cbcf1=_0x1cbcf1-0x0;var _0x3a06f0=_0x0f8f[_0x1cbcf1];return _0x3a06f0;};'use strict';var _=require(_0xf0f8('0x0'));var util=require(_0xf0f8('0x1'));var logger=require(_0xf0f8('0x2'))(_0xf0f8('0x3'));var moment=require(_0xf0f8('0x4'));var BPromise=require(_0xf0f8('0x5'));var rp=require(_0xf0f8('0x6'));var fs=require('fs');var path=require(_0xf0f8('0x7'));var rimraf=require(_0xf0f8('0x8'));var config=require(_0xf0f8('0x9'));var attributes=require(_0xf0f8('0xa'));module[_0xf0f8('0xb')]=function(_0x1eeea8,_0x30e060){return _0x1eeea8['define'](_0xf0f8('0xc'),attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf0f8('0xd'),'collate':_0xf0f8('0xe')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index ba6ee3f..f778735 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 _0xb647=['debug','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','FaxApplication,\x20%s,\x20%s','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','FaxApplication','body','options','raw','where','limit','then','UpdateFaxApplication'];(function(_0x3cc5a7,_0x51a385){var _0x18958d=function(_0x4b65a6){while(--_0x4b65a6){_0x3cc5a7['push'](_0x3cc5a7['shift']());}};_0x18958d(++_0x51a385);}(_0xb647,0xdb));var _0x7b64=function(_0x271d15,_0x18286d){_0x271d15=_0x271d15-0x0;var _0x3cd120=_0xb647[_0x271d15];return _0x3cd120;};'use strict';var _=require(_0x7b64('0x0'));var util=require(_0x7b64('0x1'));var moment=require(_0x7b64('0x2'));var BPromise=require(_0x7b64('0x3'));var rs=require(_0x7b64('0x4'));var fs=require('fs');var Redis=require(_0x7b64('0x5'));var db=require(_0x7b64('0x6'))['db'];var utils=require(_0x7b64('0x7'));var logger=require('../../config/logger')(_0x7b64('0x8'));var config=require('../../config/environment');var jayson=require(_0x7b64('0x9'));var client=jayson[_0x7b64('0xa')][_0x7b64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x80721a,_0xcdec41,_0x22eca3){return new BPromise(function(_0x727684,_0x2ff650){return client[_0x7b64('0xc')](_0x80721a,_0x22eca3)['then'](function(_0x1b8b2a){logger['info'](_0x7b64('0xd'),_0xcdec41,'request\x20sent');logger['debug'](_0x7b64('0xe'),_0xcdec41,_0x7b64('0xf'),JSON['stringify'](_0x1b8b2a));if(_0x1b8b2a[_0x7b64('0x10')]){if(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x11')]===0x1f4){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x2ff650(_0x1b8b2a['error'][_0x7b64('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0xcdec41,_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);return _0x727684(_0x1b8b2a[_0x7b64('0x10')][_0x7b64('0x12')]);}else{logger[_0x7b64('0x13')](_0x7b64('0xd'),_0xcdec41,_0x7b64('0xf'));_0x727684(_0x1b8b2a['result'][_0x7b64('0x12')]);}})[_0x7b64('0x14')](function(_0x16ff72){logger[_0x7b64('0x10')](_0x7b64('0xd'),_0xcdec41,_0x16ff72);_0x2ff650(_0x16ff72);});});}exports['UpdateFaxApplication']=function(_0x3935c3){var _0x1a248a=this;return new Promise(function(_0x58517e,_0x138dfd){return db[_0x7b64('0x15')]['update'](_0x3935c3[_0x7b64('0x16')],{'raw':_0x3935c3[_0x7b64('0x17')]?_0x3935c3[_0x7b64('0x17')][_0x7b64('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3935c3['options']?_0x3935c3[_0x7b64('0x17')][_0x7b64('0x19')]||null:null,'attributes':_0x3935c3['options']?_0x3935c3[_0x7b64('0x17')]['attributes']||null:null,'limit':_0x3935c3[_0x7b64('0x17')]?_0x3935c3['options'][_0x7b64('0x1a')]||null:null})[_0x7b64('0x1b')](function(_0x2b8350){logger[_0x7b64('0x13')](_0x7b64('0x1c'),_0x3935c3);logger[_0x7b64('0x1d')](_0x7b64('0x1c'),_0x3935c3,JSON[_0x7b64('0x1e')](_0x2b8350));_0x58517e(_0x2b8350);})[_0x7b64('0x14')](function(_0x78a6d1){logger[_0x7b64('0x10')](_0x7b64('0x1c'),_0x78a6d1[_0x7b64('0x12')],_0x3935c3);_0x138dfd(_0x1a248a[_0x7b64('0x10')](0x1f4,_0x78a6d1['message']));});});}; \ No newline at end of file +var _0xe35c=['randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxApplication,\x20%s,\x20%s','message','result','catch','FaxApplication','body','options','raw','where','attributes','limit','then','UpdateFaxApplication','lodash','util','moment','bluebird'];(function(_0x2a6153,_0x1ac255){var _0x3ca986=function(_0x415818){while(--_0x415818){_0x2a6153['push'](_0x2a6153['shift']());}};_0x3ca986(++_0x1ac255);}(_0xe35c,0x146));var _0xce35=function(_0x17a249,_0x4f941c){_0x17a249=_0x17a249-0x0;var _0x19e05f=_0xe35c[_0x17a249];return _0x19e05f;};'use strict';var _=require(_0xce35('0x0'));var util=require(_0xce35('0x1'));var moment=require(_0xce35('0x2'));var BPromise=require(_0xce35('0x3'));var rs=require(_0xce35('0x4'));var fs=require('fs');var Redis=require(_0xce35('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xce35('0x6'))('rpc');var config=require(_0xce35('0x7'));var jayson=require(_0xce35('0x8'));var client=jayson[_0xce35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x270b81,_0x2df0d0,_0x2b4a82){return new BPromise(function(_0x74ae5e,_0x55e7f0){return client[_0xce35('0xa')](_0x270b81,_0x2b4a82)['then'](function(_0x549f60){logger[_0xce35('0xb')]('FaxApplication,\x20%s,\x20%s',_0x2df0d0,'request\x20sent');logger[_0xce35('0xc')](_0xce35('0xd'),_0x2df0d0,_0xce35('0xe'),JSON[_0xce35('0xf')](_0x549f60));if(_0x549f60[_0xce35('0x10')]){if(_0x549f60['error']['code']===0x1f4){logger[_0xce35('0x10')](_0xce35('0x11'),_0x2df0d0,_0x549f60[_0xce35('0x10')][_0xce35('0x12')]);return _0x55e7f0(_0x549f60[_0xce35('0x10')]['message']);}logger['error'](_0xce35('0x11'),_0x2df0d0,_0x549f60[_0xce35('0x10')]['message']);return _0x74ae5e(_0x549f60[_0xce35('0x10')][_0xce35('0x12')]);}else{logger[_0xce35('0xb')](_0xce35('0x11'),_0x2df0d0,_0xce35('0xe'));_0x74ae5e(_0x549f60[_0xce35('0x13')][_0xce35('0x12')]);}})[_0xce35('0x14')](function(_0x4388fd){logger[_0xce35('0x10')](_0xce35('0x11'),_0x2df0d0,_0x4388fd);_0x55e7f0(_0x4388fd);});});}exports['UpdateFaxApplication']=function(_0x8d7f28){var _0x9681d6=this;return new Promise(function(_0x3efb22,_0x3ee426){return db[_0xce35('0x15')]['update'](_0x8d7f28[_0xce35('0x16')],{'raw':_0x8d7f28[_0xce35('0x17')]?_0x8d7f28[_0xce35('0x17')][_0xce35('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8d7f28[_0xce35('0x17')]?_0x8d7f28[_0xce35('0x17')][_0xce35('0x19')]||null:null,'attributes':_0x8d7f28[_0xce35('0x17')]?_0x8d7f28['options'][_0xce35('0x1a')]||null:null,'limit':_0x8d7f28[_0xce35('0x17')]?_0x8d7f28[_0xce35('0x17')][_0xce35('0x1b')]||null:null})[_0xce35('0x1c')](function(_0x2f049e){logger[_0xce35('0xb')](_0xce35('0x1d'),_0x8d7f28);logger[_0xce35('0xc')](_0xce35('0x1d'),_0x8d7f28,JSON['stringify'](_0x2f049e));_0x3efb22(_0x2f049e);})[_0xce35('0x14')](function(_0x3d3b5c){logger[_0xce35('0x10')]('UpdateFaxApplication',_0x3d3b5c[_0xce35('0x12')],_0x8d7f28);_0x3ee426(_0x9681d6[_0xce35('0x10')](0x1f4,_0x3d3b5c['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 9690efa..8c94666 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 _0x955f=['path','connect-timeout','express','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','destroy','exports','multer','util'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x955f,0x1eb));var _0xf955=function(_0x231a0a,_0x23c469){_0x231a0a=_0x231a0a-0x0;var _0xc93a61=_0x955f[_0x231a0a];return _0xc93a61;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./faxApplication.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['show']);router[_0xf955('0xb')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0xd')](_0xf955('0xa'),auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router['delete'](_0xf955('0xa'),auth['isAuthenticated'](),controller[_0xf955('0xf')]);module[_0xf955('0x10')]=router; \ No newline at end of file +var _0x34b7=['express','Router','fs-extra','../../components/auth/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show','post','update','delete','destroy','exports','path','connect-timeout'];(function(_0x115e61,_0x3ff173){var _0x15ba77=function(_0x35e491){while(--_0x35e491){_0x115e61['push'](_0x115e61['shift']());}};_0x15ba77(++_0x3ff173);}(_0x34b7,0x196));var _0x734b=function(_0x552b03,_0x48e023){_0x552b03=_0x552b03-0x0;var _0x14ab19=_0x34b7[_0x552b03];return _0x14ab19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x734b('0x0'));var timeout=require(_0x734b('0x1'));var express=require(_0x734b('0x2'));var router=express[_0x734b('0x3')]();var fs_extra=require(_0x734b('0x4'));var auth=require(_0x734b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x734b('0x6'));router[_0x734b('0x7')]('/',auth[_0x734b('0x8')](),controller[_0x734b('0x9')]);router[_0x734b('0x7')](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xb')]);router[_0x734b('0xc')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x734b('0xa'),auth['isAuthenticated'](),controller[_0x734b('0xd')]);router[_0x734b('0xe')](_0x734b('0xa'),auth[_0x734b('0x8')](),controller[_0x734b('0xf')]);module[_0x734b('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index c70b897..7e0ed2f 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 _0x0adf=['out','INTEGER','sequelize','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x3a9b7b,_0x279aef){var _0x3e7b2f=function(_0x1d8394){while(--_0x1d8394){_0x3a9b7b['push'](_0x3a9b7b['shift']());}};_0x3e7b2f(++_0x279aef);}(_0x0adf,0x1d2));var _0xf0ad=function(_0x36e58a,_0x39b4b6){_0x36e58a=_0x36e58a-0x0;var _0x805436=_0x0adf[_0x36e58a];return _0x805436;};'use strict';var Sequelize=require(_0xf0ad('0x0'));module[_0xf0ad('0x1')]={'closed':{'type':Sequelize[_0xf0ad('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xf0ad('0x3')]},'secondDisposition':{'type':Sequelize[_0xf0ad('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf0ad('0x3')]},'note':{'type':Sequelize[_0xf0ad('0x3')]},'read1stAt':{'type':Sequelize[_0xf0ad('0x4')]},'fax':{'type':Sequelize[_0xf0ad('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xf0ad('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xf0ad('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xf0ad('0x6')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize[_0xf0ad('0x7')]}}; \ No newline at end of file +var _0x8aad=['ENUM','out','sequelize','exports','DATE','STRING'];(function(_0x2f2d70,_0x31a920){var _0x597948=function(_0x5248ad){while(--_0x5248ad){_0x2f2d70['push'](_0x2f2d70['shift']());}};_0x597948(++_0x31a920);}(_0x8aad,0x146));var _0xd8aa=function(_0x10a4f6,_0x588619){_0x10a4f6=_0x10a4f6-0x0;var _0x7e6890=_0x8aad[_0x10a4f6];return _0x7e6890;};'use strict';var Sequelize=require(_0xd8aa('0x0'));module[_0xd8aa('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd8aa('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xd8aa('0x3')]},'thirdDisposition':{'type':Sequelize[_0xd8aa('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xd8aa('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd8aa('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xd8aa('0x4')]('in',_0xd8aa('0x5')),'defaultValue':'in','allowNull':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index d6fd1f8..9071f8e 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 _0xcd2e=['stack','send','index','rawAttributes','fieldName','type','key','getOptions','findAll','catch','show','params','model','keys','query','filters','attributes','intersection','fields','length','include','merge','options','FaxInteraction','find','create','body','update','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','order','sort','pick','FaxInteractionId','filter','where','map','$gte','split','format','includeAll','rows','setTags','spread','Tag','color','emit','removeTags','download','toString','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','push','Attachment','Messages','createdAt','get','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','rimraf','bluebird','util','path','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','destroy','then','error'];(function(_0x2673a4,_0x4d0b8d){var _0x5e3a6a=function(_0x59e268){while(--_0x59e268){_0x2673a4['push'](_0x2673a4['shift']());}};_0x5e3a6a(++_0x4d0b8d);}(_0xcd2e,0x181));var _0xecd2=function(_0x10dfdf,_0x36b623){_0x10dfdf=_0x10dfdf-0x0;var _0x4d857d=_0xcd2e[_0x10dfdf];return _0x4d857d;};'use strict';var rimraf=require(_0xecd2('0x0'));var zipdir=require('zip-dir');var moment=require('moment');var BPromise=require(_0xecd2('0x1'));var util=require(_0xecd2('0x2'));var path=require(_0xecd2('0x3'));var fs=require('fs');var _=require(_0xecd2('0x4'));var Redis=require(_0xecd2('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0xecd2('0x6'));var logger=require(_0xecd2('0x7'))(_0xecd2('0x8'));var config=require(_0xecd2('0x9'));var db=require(_0xecd2('0xa'))['db'];config[_0xecd2('0xb')]=_['defaults'](config[_0xecd2('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xecd2('0xc'))(new Redis(config[_0xecd2('0xb')]));require(_0xecd2('0xd'))[_0xecd2('0xe')](socket);function respondWithStatusCode(_0x59232f,_0xcadaac){_0xcadaac=_0xcadaac||0xcc;return function(_0x7d3297){if(_0x7d3297){return _0x59232f[_0xecd2('0xf')](_0xcadaac);}return _0x59232f[_0xecd2('0x10')](_0xcadaac)['end']();};}function respondWithResult(_0x1f0d30,_0x154a31){_0x154a31=_0x154a31||0xc8;return function(_0x13e83a){if(_0x13e83a){return _0x1f0d30['status'](_0x154a31)['json'](_0x13e83a);}};}function respondWithFilteredResult(_0x3dbd7b,_0x426e82){return function(_0x3d52c7){if(_0x3d52c7){var _0x55b373=typeof _0x426e82[_0xecd2('0x11')]===_0xecd2('0x12')&&typeof _0x426e82[_0xecd2('0x13')]===_0xecd2('0x12');var _0x369266=_0x3d52c7[_0xecd2('0x14')];var _0x329cd0=_0x55b373?0x0:_0x426e82[_0xecd2('0x11')];var _0x836d4c=_0x55b373?_0x3d52c7[_0xecd2('0x14')]:_0x426e82[_0xecd2('0x11')]+_0x426e82[_0xecd2('0x13')];var _0x4c3e7f;if(_0x836d4c>=_0x369266){_0x836d4c=_0x369266;_0x4c3e7f=0xc8;}else{_0x4c3e7f=0xce;}_0x3dbd7b[_0xecd2('0x10')](_0x4c3e7f);return _0x3dbd7b[_0xecd2('0x15')](_0xecd2('0x16'),_0x329cd0+'-'+_0x836d4c+'/'+_0x369266)[_0xecd2('0x17')](_0x3d52c7);}return null;};}function saveUpdates(_0x250266){return function(_0x562bd5){if(_0x562bd5){return _0x562bd5['update'](_0x250266)['then'](function(_0xa7a505){return _0xa7a505;});}return null;};}function removeEntity(_0x555d34){return function(_0x277a82){if(_0x277a82){return _0x277a82[_0xecd2('0x18')]()[_0xecd2('0x19')](function(){_0x555d34[_0xecd2('0x10')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a578f){return function(_0x8c8c54){if(!_0x8c8c54){_0x5a578f[_0xecd2('0xf')](0x194);}return _0x8c8c54;};}function handleError(_0x286249,_0x125525){_0x125525=_0x125525||0x1f4;return function(_0x2476bc){logger[_0xecd2('0x1a')](_0x2476bc[_0xecd2('0x1b')]);if(_0x2476bc['name']){delete _0x2476bc['name'];}_0x286249[_0xecd2('0x10')](_0x125525)[_0xecd2('0x1c')](_0x2476bc);};}exports[_0xecd2('0x1d')]=function(_0x4ca3d7,_0x12b378){var _0x425383={};var _0x1da517=_['map'](db['FaxInteraction'][_0xecd2('0x1e')],function(_0x234be2){return{'name':_0x234be2[_0xecd2('0x1f')],'type':_0x234be2[_0xecd2('0x20')][_0xecd2('0x21')]};});_0x425383=qs[_0xecd2('0x22')](_0x1da517,_0x4ca3d7);return interaction[_0xecd2('0x23')]('fax',_0x4ca3d7['query'],_0x4ca3d7['user'],_0x425383,_0x1da517)[_0xecd2('0x19')](respondWithFilteredResult(_0x12b378,_0x425383))[_0xecd2('0x24')](handleError(_0x12b378,null));};exports[_0xecd2('0x25')]=function(_0x49de71,_0x211030){var _0x5663c8={'raw':![],'where':{'id':_0x49de71[_0xecd2('0x26')]['id']}},_0x3a7e5c={};_0x3a7e5c[_0xecd2('0x27')]=_[_0xecd2('0x28')](db['FaxInteraction'][_0xecd2('0x1e')]);_0x3a7e5c[_0xecd2('0x29')]=_[_0xecd2('0x28')](_0x49de71[_0xecd2('0x29')]);_0x3a7e5c[_0xecd2('0x2a')]=_['intersection'](_0x3a7e5c[_0xecd2('0x27')],_0x3a7e5c[_0xecd2('0x29')]);_0x5663c8[_0xecd2('0x2b')]=_[_0xecd2('0x2c')](_0x3a7e5c[_0xecd2('0x27')],qs[_0xecd2('0x2d')](_0x49de71[_0xecd2('0x29')][_0xecd2('0x2d')]));_0x5663c8[_0xecd2('0x2b')]=_0x5663c8['attributes'][_0xecd2('0x2e')]?_0x5663c8[_0xecd2('0x2b')]:_0x3a7e5c[_0xecd2('0x27')];if(_0x49de71[_0xecd2('0x29')]['includeAll']){_0x5663c8[_0xecd2('0x2f')]=[{'all':!![]}];}_0x5663c8=_[_0xecd2('0x30')]({},_0x5663c8,_0x49de71[_0xecd2('0x31')]);return db[_0xecd2('0x32')][_0xecd2('0x33')](_0x5663c8)[_0xecd2('0x19')](handleEntityNotFound(_0x211030,null))[_0xecd2('0x19')](respondWithResult(_0x211030,null))[_0xecd2('0x24')](handleError(_0x211030,null));};exports['create']=function(_0x346634,_0x53a76f){return db[_0xecd2('0x32')][_0xecd2('0x34')](_0x346634[_0xecd2('0x35')],{})[_0xecd2('0x19')](respondWithResult(_0x53a76f,0xc9))['catch'](handleError(_0x53a76f,null));};exports[_0xecd2('0x36')]=function(_0xb83285,_0x233d11){if(_0xb83285[_0xecd2('0x35')]['id']){delete _0xb83285[_0xecd2('0x35')]['id'];}return db['FaxInteraction'][_0xecd2('0x33')]({'where':{'id':_0xb83285[_0xecd2('0x26')]['id']}})['then'](handleEntityNotFound(_0x233d11,null))[_0xecd2('0x19')](saveUpdates(_0xb83285[_0xecd2('0x35')],null))[_0xecd2('0x19')](respondWithResult(_0x233d11,null))[_0xecd2('0x24')](handleError(_0x233d11,null));};exports[_0xecd2('0x18')]=function(_0x46b631,_0x219b6c){return db[_0xecd2('0x32')][_0xecd2('0x33')]({'where':{'id':_0x46b631[_0xecd2('0x26')]['id']}})[_0xecd2('0x19')](handleEntityNotFound(_0x219b6c,null))[_0xecd2('0x19')](removeEntity(_0x219b6c,null))['catch'](handleError(_0x219b6c,null));};exports['describe']=function(_0x1ae3b6,_0x3448f4){return db[_0xecd2('0x32')][_0xecd2('0x37')]()['then'](respondWithResult(_0x3448f4,null))[_0xecd2('0x24')](handleError(_0x3448f4,null));};exports[_0xecd2('0x38')]=function(_0xda3565,_0x198424){return db[_0xecd2('0x39')][_0xecd2('0x33')]({'where':{'id':_0xda3565[_0xecd2('0x26')]['id']}})['then'](handleEntityNotFound(_0x198424,null))['then'](function(_0x3baea2){if(_0x3baea2){return _0x3baea2[_0xecd2('0x38')](_0xda3565[_0xecd2('0x35')][_0xecd2('0x3a')],_[_0xecd2('0x3b')](_0xda3565[_0xecd2('0x35')],[_0xecd2('0x3a'),'id'])||{});}})[_0xecd2('0x19')](respondWithResult(_0x198424,null))['catch'](handleError(_0x198424,null));};exports[_0xecd2('0x3c')]=function(_0x23ca56,_0x396443){var _0x39264a={'raw':![],'where':{}};var _0x4f747d={};var _0x2d796e={'count':0x0,'rows':[]};return db[_0xecd2('0x32')][_0xecd2('0x3d')]({'where':{'id':_0x23ca56[_0xecd2('0x26')]['id']}})['then'](handleEntityNotFound(_0x396443,null))[_0xecd2('0x19')](function(_0x20fbcf){if(_0x20fbcf){_0x4f747d[_0xecd2('0x27')]=_[_0xecd2('0x28')](db[_0xecd2('0x39')][_0xecd2('0x1e')]);_0x4f747d[_0xecd2('0x29')]=_[_0xecd2('0x28')](_0x23ca56[_0xecd2('0x29')]);_0x4f747d[_0xecd2('0x2a')]=_[_0xecd2('0x2c')](_0x4f747d['model'],_0x4f747d[_0xecd2('0x29')]);_0x39264a[_0xecd2('0x2b')]=_[_0xecd2('0x2c')](_0x4f747d[_0xecd2('0x27')],qs['fields'](_0x23ca56['query'][_0xecd2('0x2d')]));_0x39264a[_0xecd2('0x2b')]=_0x39264a['attributes'][_0xecd2('0x2e')]?_0x39264a[_0xecd2('0x2b')]:_0x4f747d[_0xecd2('0x27')];if(!_0x23ca56['query']['hasOwnProperty'](_0xecd2('0x3e'))){_0x39264a[_0xecd2('0x13')]=qs[_0xecd2('0x13')](_0x23ca56[_0xecd2('0x29')][_0xecd2('0x13')]);_0x39264a[_0xecd2('0x11')]=qs[_0xecd2('0x11')](_0x23ca56['query'][_0xecd2('0x11')]);}_0x39264a[_0xecd2('0x3f')]=qs['sort'](_0x23ca56[_0xecd2('0x29')][_0xecd2('0x40')]);_0x39264a['where']=qs[_0xecd2('0x2a')](_[_0xecd2('0x41')](_0x23ca56[_0xecd2('0x29')],_0x4f747d[_0xecd2('0x2a')]));_0x39264a['where'][_0xecd2('0x42')]=_0x20fbcf['id'];if(_0x23ca56[_0xecd2('0x29')][_0xecd2('0x43')]){_0x39264a['where']=_[_0xecd2('0x30')](_0x39264a[_0xecd2('0x44')],{'$or':_[_0xecd2('0x45')](_0x39264a['attributes'],function(_0x15e200){var _0x3326e9={};_0x3326e9[_0x15e200]={'$like':'%'+_0x23ca56['query']['filter']+'%'};return _0x3326e9;})});}if(_0x23ca56[_0xecd2('0x29')][_0xecd2('0x46')]){var _0x2fbace=_0x23ca56['query']['$gte'][_0xecd2('0x47')](',');var _0x531b68={};_0x531b68[_0x2fbace[0x0]]={'$gte':moment(_0x2fbace[0x1])[_0xecd2('0x48')]('YYYY-MM-DD\x20HH:mm:ss')};_0x39264a['where']=_[_0xecd2('0x30')](_0x39264a[_0xecd2('0x44')],_0x531b68);}_0x39264a=_[_0xecd2('0x30')]({},_0x39264a,_0x23ca56[_0xecd2('0x31')]);return db[_0xecd2('0x39')]['count']({'where':_0x39264a['where']})[_0xecd2('0x19')](function(_0x5f10a8){_0x2d796e[_0xecd2('0x14')]=_0x5f10a8;if(_0x23ca56[_0xecd2('0x29')][_0xecd2('0x49')]){_0x39264a[_0xecd2('0x2f')]=[{'all':!![]}];}return db[_0xecd2('0x39')][_0xecd2('0x23')](_0x39264a);})['then'](function(_0x1d6556){_0x2d796e[_0xecd2('0x4a')]=_0x1d6556;return _0x2d796e;});}})[_0xecd2('0x19')](respondWithFilteredResult(_0x396443,_0x39264a))['catch'](handleError(_0x396443,null));};exports['addTags']=function(_0x8b56c0,_0xca6fec){return db[_0xecd2('0x32')][_0xecd2('0x33')]({'where':{'id':_0x8b56c0[_0xecd2('0x26')]['id']}})[_0xecd2('0x19')](handleEntityNotFound(_0xca6fec,null))['then'](function(_0x50c7db){if(_0x50c7db){return _0x50c7db[_0xecd2('0x4b')](_0x8b56c0[_0xecd2('0x35')][_0xecd2('0x3a')],_[_0xecd2('0x3b')](_0x8b56c0[_0xecd2('0x35')],[_0xecd2('0x3a'),'id'])||{})[_0xecd2('0x4c')](function(){return db[_0xecd2('0x4d')][_0xecd2('0x23')]({'attributes':['id','name',_0xecd2('0x4e')],'where':{'id':_0x8b56c0[_0xecd2('0x35')][_0xecd2('0x3a')]}});})[_0xecd2('0x19')](function(_0x3841dc){socket[_0xecd2('0x4f')]('faxInteractionTags:save',{'id':Number(_0x8b56c0[_0xecd2('0x26')]['id']),'tags':_0x3841dc||[]});return{'id':Number(_0x8b56c0['params']['id']),'tags':_0x3841dc||[]};});}})[_0xecd2('0x19')](respondWithResult(_0xca6fec,null))[_0xecd2('0x24')](handleError(_0xca6fec,null));};exports['removeTags']=function(_0x1c401f,_0x27ed99){return db['FaxInteraction'][_0xecd2('0x33')]({'where':{'id':_0x1c401f[_0xecd2('0x26')]['id']}})[_0xecd2('0x19')](handleEntityNotFound(_0x27ed99,null))[_0xecd2('0x19')](function(_0x2e5e09){if(_0x2e5e09){return _0x2e5e09[_0xecd2('0x50')](_0x1c401f[_0xecd2('0x29')][_0xecd2('0x3a')]);}})['then'](respondWithStatusCode(_0x27ed99,null))['catch'](handleError(_0x27ed99,null));};exports[_0xecd2('0x51')]=function(_0x3be23d,_0x5c9720){var _0x31e6df=moment()['unix']()[_0xecd2('0x52')]();var _0x3bb25b=path[_0xecd2('0x53')](config[_0xecd2('0x54')],_0xecd2('0x55'),'files',_0xecd2('0x56'));var _0x2f263f=path[_0xecd2('0x53')](config[_0xecd2('0x54')],'server',_0xecd2('0x57'),_0xecd2('0x58'));var _0x2c5fe1=path['join'](_0x3bb25b,_0x31e6df);var _0x535f18=util[_0xecd2('0x48')](_0xecd2('0x59'),_0x3be23d[_0xecd2('0x26')]['id'],_0x31e6df);var _0x3ab843=path[_0xecd2('0x53')](_0x3bb25b,_0x535f18);var _0x4860fe=[];_0x4860fe[_0xecd2('0x5a')]({'model':db['Attachment'],'as':_0xecd2('0x5b'),'raw':!![]});var _0x40fd9d=[{'model':db[_0xecd2('0x39')],'as':_0xecd2('0x5c'),'attributes':['id','body',_0xecd2('0x5d')],'include':_0x4860fe}];return db[_0xecd2('0x32')][_0xecd2('0x33')]({'where':{'id':_0x3be23d['params']['id']},'include':_0x40fd9d})[_0xecd2('0x19')](handleEntityNotFound(_0x5c9720,null))['then'](function(_0x3b95a9){if(_0x3b95a9&&_0x3b95a9['Messages']){var _0x23c3ca=_0x3b95a9[_0xecd2('0x5e')]({'plain':!![]});fs['mkdirSync'](_0x2c5fe1);for(var _0x1fc169=0x0;_0x1fc169<_0x23c3ca[_0xecd2('0x5c')][_0xecd2('0x2e')];_0x1fc169++){var _0x3ca464=_0x23c3ca[_0xecd2('0x5c')][_0x1fc169][_0xecd2('0x5b')];if(_0x3ca464){var _0x42e8e1=path['join'](_0x2f263f,_0x3ca464[_0xecd2('0x5f')]);if(fs[_0xecd2('0x60')](_0x42e8e1)){fs[_0xecd2('0x61')](_0x42e8e1)[_0xecd2('0x62')](fs[_0xecd2('0x63')](path[_0xecd2('0x53')](_0x2c5fe1,_0x3ca464[_0xecd2('0x5f')])));}}}return BPromise[_0xecd2('0x64')]()[_0xecd2('0x19')](function(){return new BPromise(function(_0x25b842,_0x35e140){zipdir(_0x2c5fe1,{'saveTo':_0x3ab843},function(_0x151312,_0x128202){if(_0x151312)return _0x35e140(_0x151312);return _0x25b842(_0x128202);});})[_0xecd2('0x19')](function(){return new BPromise(function(_0x4810f7,_0x47dcba){rimraf(_0x2c5fe1,function(_0x63c6a1){if(_0x63c6a1)_0x47dcba(_0x63c6a1);return _0x4810f7();});});})[_0xecd2('0x19')](function(){return _0x5c9720[_0xecd2('0x51')](_0x3ab843,_0x535f18,function(_0x48131f){if(_0x48131f){console[_0xecd2('0x65')]('err',_0x48131f);}else{fs[_0xecd2('0x66')](_0x3ab843);}});});});}else{return _0x5c9720[_0xecd2('0xf')](0xc8);}})[_0xecd2('0x24')](handleError(_0x5c9720,null));}; \ No newline at end of file +var _0x987e=['tmp','attachments','push','Attachment','Messages','createdAt','get','mkdirSync','existsSync','createReadStream','basename','resolve','log','rimraf','zip-dir','moment','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','error','stack','name','send','index','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','query','user','catch','model','keys','filters','intersection','attributes','fields','includeAll','include','merge','options','find','then','create','body','params','describe','FaxMessage','addMessage','ids','findOne','length','hasOwnProperty','nolimit','order','sort','where','filter','map','$gte','format','YYYY-MM-DD\x20HH:mm:ss','omit','Tag','color','faxInteractionTags:save','removeTags','download','toString','join','root','server','files'];(function(_0x4c9316,_0x5c7f6f){var _0x146aad=function(_0x4fa179){while(--_0x4fa179){_0x4c9316['push'](_0x4c9316['shift']());}};_0x146aad(++_0x5c7f6f);}(_0x987e,0x1f2));var _0xe987=function(_0x27c23b,_0x20ee2c){_0x27c23b=_0x27c23b-0x0;var _0x195172=_0x987e[_0x27c23b];return _0x195172;};'use strict';var rimraf=require(_0xe987('0x0'));var zipdir=require(_0xe987('0x1'));var moment=require(_0xe987('0x2'));var BPromise=require('bluebird');var util=require(_0xe987('0x3'));var path=require(_0xe987('0x4'));var fs=require('fs');var _=require(_0xe987('0x5'));var Redis=require('ioredis');var interaction=require(_0xe987('0x6'));var qs=require(_0xe987('0x7'));var logger=require(_0xe987('0x8'))(_0xe987('0x9'));var config=require(_0xe987('0xa'));var db=require(_0xe987('0xb'))['db'];config[_0xe987('0xc')]=_[_0xe987('0xd')](config[_0xe987('0xc')],{'host':_0xe987('0xe'),'port':0x18eb});var socket=require(_0xe987('0xf'))(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithStatusCode(_0x30940e,_0x1e4dc7){_0x1e4dc7=_0x1e4dc7||0xcc;return function(_0xe1224a){if(_0xe1224a){return _0x30940e[_0xe987('0x10')](_0x1e4dc7);}return _0x30940e[_0xe987('0x11')](_0x1e4dc7)[_0xe987('0x12')]();};}function respondWithResult(_0x2cb861,_0x173bd6){_0x173bd6=_0x173bd6||0xc8;return function(_0xa7595b){if(_0xa7595b){return _0x2cb861['status'](_0x173bd6)[_0xe987('0x13')](_0xa7595b);}};}function respondWithFilteredResult(_0x4943d3,_0x4f5780){return function(_0x9927bd){if(_0x9927bd){var _0x5761ac=typeof _0x4f5780[_0xe987('0x14')]===_0xe987('0x15')&&typeof _0x4f5780[_0xe987('0x16')]==='undefined';var _0x2593b7=_0x9927bd[_0xe987('0x17')];var _0x58411a=_0x5761ac?0x0:_0x4f5780[_0xe987('0x14')];var _0x21314b=_0x5761ac?_0x9927bd[_0xe987('0x17')]:_0x4f5780[_0xe987('0x14')]+_0x4f5780['limit'];var _0x31820d;if(_0x21314b>=_0x2593b7){_0x21314b=_0x2593b7;_0x31820d=0xc8;}else{_0x31820d=0xce;}_0x4943d3[_0xe987('0x11')](_0x31820d);return _0x4943d3[_0xe987('0x18')](_0xe987('0x19'),_0x58411a+'-'+_0x21314b+'/'+_0x2593b7)[_0xe987('0x13')](_0x9927bd);}return null;};}function saveUpdates(_0x431847){return function(_0x4280f4){if(_0x4280f4){return _0x4280f4[_0xe987('0x1a')](_0x431847)['then'](function(_0x1584bd){return _0x1584bd;});}return null;};}function removeEntity(_0x2d2a9b){return function(_0x2d6170){if(_0x2d6170){return _0x2d6170['destroy']()['then'](function(){_0x2d2a9b[_0xe987('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e6444){return function(_0x452bee){if(!_0x452bee){_0x2e6444[_0xe987('0x10')](0x194);}return _0x452bee;};}function handleError(_0x1b9fd0,_0x1d3888){_0x1d3888=_0x1d3888||0x1f4;return function(_0x406e07){logger[_0xe987('0x1b')](_0x406e07[_0xe987('0x1c')]);if(_0x406e07[_0xe987('0x1d')]){delete _0x406e07[_0xe987('0x1d')];}_0x1b9fd0[_0xe987('0x11')](_0x1d3888)[_0xe987('0x1e')](_0x406e07);};}exports[_0xe987('0x1f')]=function(_0x191002,_0x3865e0){var _0x3464d5={};var _0x404df9=_['map'](db[_0xe987('0x20')][_0xe987('0x21')],function(_0x2cf988){return{'name':_0x2cf988['fieldName'],'type':_0x2cf988[_0xe987('0x22')][_0xe987('0x23')]};});_0x3464d5=qs[_0xe987('0x24')](_0x404df9,_0x191002);return interaction[_0xe987('0x25')](_0xe987('0x26'),_0x191002[_0xe987('0x27')],_0x191002[_0xe987('0x28')],_0x3464d5,_0x404df9)['then'](respondWithFilteredResult(_0x3865e0,_0x3464d5))[_0xe987('0x29')](handleError(_0x3865e0,null));};exports['show']=function(_0x5cea5a,_0x3c9f03){var _0x2271c9={'raw':![],'where':{'id':_0x5cea5a['params']['id']}},_0x2a3853={};_0x2a3853[_0xe987('0x2a')]=_[_0xe987('0x2b')](db['FaxInteraction'][_0xe987('0x21')]);_0x2a3853['query']=_[_0xe987('0x2b')](_0x5cea5a[_0xe987('0x27')]);_0x2a3853[_0xe987('0x2c')]=_[_0xe987('0x2d')](_0x2a3853[_0xe987('0x2a')],_0x2a3853[_0xe987('0x27')]);_0x2271c9[_0xe987('0x2e')]=_['intersection'](_0x2a3853[_0xe987('0x2a')],qs[_0xe987('0x2f')](_0x5cea5a[_0xe987('0x27')][_0xe987('0x2f')]));_0x2271c9[_0xe987('0x2e')]=_0x2271c9[_0xe987('0x2e')]['length']?_0x2271c9[_0xe987('0x2e')]:_0x2a3853[_0xe987('0x2a')];if(_0x5cea5a[_0xe987('0x27')][_0xe987('0x30')]){_0x2271c9[_0xe987('0x31')]=[{'all':!![]}];}_0x2271c9=_[_0xe987('0x32')]({},_0x2271c9,_0x5cea5a[_0xe987('0x33')]);return db[_0xe987('0x20')][_0xe987('0x34')](_0x2271c9)['then'](handleEntityNotFound(_0x3c9f03,null))[_0xe987('0x35')](respondWithResult(_0x3c9f03,null))['catch'](handleError(_0x3c9f03,null));};exports['create']=function(_0x165406,_0x225484){return db[_0xe987('0x20')][_0xe987('0x36')](_0x165406['body'],{})['then'](respondWithResult(_0x225484,0xc9))[_0xe987('0x29')](handleError(_0x225484,null));};exports['update']=function(_0x551414,_0x249ecb){if(_0x551414[_0xe987('0x37')]['id']){delete _0x551414[_0xe987('0x37')]['id'];}return db[_0xe987('0x20')][_0xe987('0x34')]({'where':{'id':_0x551414['params']['id']}})[_0xe987('0x35')](handleEntityNotFound(_0x249ecb,null))[_0xe987('0x35')](saveUpdates(_0x551414[_0xe987('0x37')],null))[_0xe987('0x35')](respondWithResult(_0x249ecb,null))[_0xe987('0x29')](handleError(_0x249ecb,null));};exports['destroy']=function(_0xa8c2d,_0x125cf6){return db[_0xe987('0x20')][_0xe987('0x34')]({'where':{'id':_0xa8c2d[_0xe987('0x38')]['id']}})[_0xe987('0x35')](handleEntityNotFound(_0x125cf6,null))[_0xe987('0x35')](removeEntity(_0x125cf6,null))[_0xe987('0x29')](handleError(_0x125cf6,null));};exports[_0xe987('0x39')]=function(_0x36c96f,_0x244f59){return db[_0xe987('0x20')][_0xe987('0x39')]()[_0xe987('0x35')](respondWithResult(_0x244f59,null))[_0xe987('0x29')](handleError(_0x244f59,null));};exports['addMessage']=function(_0x4fc3d8,_0x4f3aec){return db[_0xe987('0x3a')][_0xe987('0x34')]({'where':{'id':_0x4fc3d8[_0xe987('0x38')]['id']}})[_0xe987('0x35')](handleEntityNotFound(_0x4f3aec,null))['then'](function(_0x5b05b8){if(_0x5b05b8){return _0x5b05b8[_0xe987('0x3b')](_0x4fc3d8[_0xe987('0x37')][_0xe987('0x3c')],_['omit'](_0x4fc3d8[_0xe987('0x37')],[_0xe987('0x3c'),'id'])||{});}})[_0xe987('0x35')](respondWithResult(_0x4f3aec,null))['catch'](handleError(_0x4f3aec,null));};exports['getMessages']=function(_0x11d89a,_0x7e603c){var _0x40f93c={'raw':![],'where':{}};var _0x5dd0a4={};var _0x5029b9={'count':0x0,'rows':[]};return db[_0xe987('0x20')][_0xe987('0x3d')]({'where':{'id':_0x11d89a['params']['id']}})[_0xe987('0x35')](handleEntityNotFound(_0x7e603c,null))[_0xe987('0x35')](function(_0x2224ba){if(_0x2224ba){_0x5dd0a4['model']=_[_0xe987('0x2b')](db[_0xe987('0x3a')]['rawAttributes']);_0x5dd0a4[_0xe987('0x27')]=_['keys'](_0x11d89a['query']);_0x5dd0a4[_0xe987('0x2c')]=_[_0xe987('0x2d')](_0x5dd0a4[_0xe987('0x2a')],_0x5dd0a4[_0xe987('0x27')]);_0x40f93c[_0xe987('0x2e')]=_[_0xe987('0x2d')](_0x5dd0a4[_0xe987('0x2a')],qs['fields'](_0x11d89a[_0xe987('0x27')]['fields']));_0x40f93c[_0xe987('0x2e')]=_0x40f93c[_0xe987('0x2e')][_0xe987('0x3e')]?_0x40f93c[_0xe987('0x2e')]:_0x5dd0a4['model'];if(!_0x11d89a[_0xe987('0x27')][_0xe987('0x3f')](_0xe987('0x40'))){_0x40f93c[_0xe987('0x16')]=qs[_0xe987('0x16')](_0x11d89a[_0xe987('0x27')][_0xe987('0x16')]);_0x40f93c[_0xe987('0x14')]=qs[_0xe987('0x14')](_0x11d89a[_0xe987('0x27')][_0xe987('0x14')]);}_0x40f93c[_0xe987('0x41')]=qs[_0xe987('0x42')](_0x11d89a[_0xe987('0x27')]['sort']);_0x40f93c[_0xe987('0x43')]=qs['filters'](_['pick'](_0x11d89a[_0xe987('0x27')],_0x5dd0a4[_0xe987('0x2c')]));_0x40f93c[_0xe987('0x43')]['FaxInteractionId']=_0x2224ba['id'];if(_0x11d89a[_0xe987('0x27')][_0xe987('0x44')]){_0x40f93c['where']=_[_0xe987('0x32')](_0x40f93c[_0xe987('0x43')],{'$or':_[_0xe987('0x45')](_0x40f93c[_0xe987('0x2e')],function(_0x30b325){var _0x2e8dd3={};_0x2e8dd3[_0x30b325]={'$like':'%'+_0x11d89a['query'][_0xe987('0x44')]+'%'};return _0x2e8dd3;})});}if(_0x11d89a[_0xe987('0x27')][_0xe987('0x46')]){var _0x223af6=_0x11d89a[_0xe987('0x27')][_0xe987('0x46')]['split'](',');var _0x5ecbef={};_0x5ecbef[_0x223af6[0x0]]={'$gte':moment(_0x223af6[0x1])[_0xe987('0x47')](_0xe987('0x48'))};_0x40f93c[_0xe987('0x43')]=_[_0xe987('0x32')](_0x40f93c[_0xe987('0x43')],_0x5ecbef);}_0x40f93c=_[_0xe987('0x32')]({},_0x40f93c,_0x11d89a[_0xe987('0x33')]);return db[_0xe987('0x3a')]['count']({'where':_0x40f93c[_0xe987('0x43')]})[_0xe987('0x35')](function(_0x4513de){_0x5029b9['count']=_0x4513de;if(_0x11d89a[_0xe987('0x27')][_0xe987('0x30')]){_0x40f93c['include']=[{'all':!![]}];}return db[_0xe987('0x3a')][_0xe987('0x25')](_0x40f93c);})[_0xe987('0x35')](function(_0x3297d9){_0x5029b9['rows']=_0x3297d9;return _0x5029b9;});}})[_0xe987('0x35')](respondWithFilteredResult(_0x7e603c,_0x40f93c))[_0xe987('0x29')](handleError(_0x7e603c,null));};exports['addTags']=function(_0x22e541,_0xca3925){return db['FaxInteraction'][_0xe987('0x34')]({'where':{'id':_0x22e541[_0xe987('0x38')]['id']}})[_0xe987('0x35')](handleEntityNotFound(_0xca3925,null))['then'](function(_0x3466cf){if(_0x3466cf){return _0x3466cf['setTags'](_0x22e541[_0xe987('0x37')][_0xe987('0x3c')],_[_0xe987('0x49')](_0x22e541[_0xe987('0x37')],[_0xe987('0x3c'),'id'])||{})['spread'](function(){return db[_0xe987('0x4a')]['findAll']({'attributes':['id',_0xe987('0x1d'),_0xe987('0x4b')],'where':{'id':_0x22e541[_0xe987('0x37')][_0xe987('0x3c')]}});})['then'](function(_0x1a97d2){socket['emit'](_0xe987('0x4c'),{'id':Number(_0x22e541[_0xe987('0x38')]['id']),'tags':_0x1a97d2||[]});return{'id':Number(_0x22e541['params']['id']),'tags':_0x1a97d2||[]};});}})[_0xe987('0x35')](respondWithResult(_0xca3925,null))[_0xe987('0x29')](handleError(_0xca3925,null));};exports[_0xe987('0x4d')]=function(_0x570120,_0x37336d){return db[_0xe987('0x20')][_0xe987('0x34')]({'where':{'id':_0x570120[_0xe987('0x38')]['id']}})['then'](handleEntityNotFound(_0x37336d,null))[_0xe987('0x35')](function(_0x520e76){if(_0x520e76){return _0x520e76[_0xe987('0x4d')](_0x570120[_0xe987('0x27')][_0xe987('0x3c')]);}})[_0xe987('0x35')](respondWithStatusCode(_0x37336d,null))['catch'](handleError(_0x37336d,null));};exports[_0xe987('0x4e')]=function(_0x2d6643,_0x2e1f97){var _0x5152a9=moment()['unix']()[_0xe987('0x4f')]();var _0x2158ae=path[_0xe987('0x50')](config[_0xe987('0x51')],_0xe987('0x52'),_0xe987('0x53'),_0xe987('0x54'));var _0x39c415=path[_0xe987('0x50')](config[_0xe987('0x51')],_0xe987('0x52'),_0xe987('0x53'),_0xe987('0x55'));var _0x1e8850=path[_0xe987('0x50')](_0x2158ae,_0x5152a9);var _0x1109d9=util['format']('transcript-%d-%s.zip',_0x2d6643['params']['id'],_0x5152a9);var _0x356380=path[_0xe987('0x50')](_0x2158ae,_0x1109d9);var _0xc3f430=[];_0xc3f430[_0xe987('0x56')]({'model':db[_0xe987('0x57')],'as':_0xe987('0x57'),'raw':!![]});var _0x29fa2c=[{'model':db['FaxMessage'],'as':_0xe987('0x58'),'attributes':['id',_0xe987('0x37'),_0xe987('0x59')],'include':_0xc3f430}];return db[_0xe987('0x20')][_0xe987('0x34')]({'where':{'id':_0x2d6643[_0xe987('0x38')]['id']},'include':_0x29fa2c})[_0xe987('0x35')](handleEntityNotFound(_0x2e1f97,null))['then'](function(_0x1ebd6a){if(_0x1ebd6a&&_0x1ebd6a['Messages']){var _0x2843ff=_0x1ebd6a[_0xe987('0x5a')]({'plain':!![]});fs[_0xe987('0x5b')](_0x1e8850);for(var _0x4a19fd=0x0;_0x4a19fd<_0x2843ff[_0xe987('0x58')][_0xe987('0x3e')];_0x4a19fd++){var _0x1a555d=_0x2843ff['Messages'][_0x4a19fd][_0xe987('0x57')];if(_0x1a555d){var _0x258659=path[_0xe987('0x50')](_0x39c415,_0x1a555d['basename']);if(fs[_0xe987('0x5c')](_0x258659)){fs[_0xe987('0x5d')](_0x258659)['pipe'](fs['createWriteStream'](path[_0xe987('0x50')](_0x1e8850,_0x1a555d[_0xe987('0x5e')])));}}}return BPromise[_0xe987('0x5f')]()['then'](function(){return new BPromise(function(_0x2eafef,_0x5c8d85){zipdir(_0x1e8850,{'saveTo':_0x356380},function(_0x123867,_0x1b60cc){if(_0x123867)return _0x5c8d85(_0x123867);return _0x2eafef(_0x1b60cc);});})[_0xe987('0x35')](function(){return new BPromise(function(_0x15477c,_0x3af50b){rimraf(_0x1e8850,function(_0x5d931c){if(_0x5d931c)_0x3af50b(_0x5d931c);return _0x15477c();});});})[_0xe987('0x35')](function(){return _0x2e1f97[_0xe987('0x4e')](_0x356380,_0x1109d9,function(_0x560ed9){if(_0x560ed9){console[_0xe987('0x60')]('err',_0x560ed9);}else{fs['unlinkSync'](_0x356380);}});});});}else{return _0x2e1f97[_0xe987('0x10')](0xc8);}})[_0xe987('0x29')](handleError(_0x2e1f97,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index b556b75..661b94e 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 _0x496d=['catch','hasOwnProperty','hook','exports','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','getUsers','Users','map','findAll','then','unreadMessages','length','emit'];(function(_0x312589,_0x3e0d3c){var _0x12f080=function(_0x2ace28){while(--_0x2ace28){_0x312589['push'](_0x312589['shift']());}};_0x12f080(++_0x3e0d3c);}(_0x496d,0x1d4));var _0xd496=function(_0x90f4e5,_0x446d1e){_0x90f4e5=_0x90f4e5-0x0;var _0x4378d1=_0x496d[_0x90f4e5];return _0x4378d1;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0xd496('0x0'))['db'][_0xd496('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xd496('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xd496('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x93b49e){return function(_0x1c3711,_0x1c06f1,_0xccf281){_0x1c3711[_0xd496('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3fca68){_0x1c3711['setDataValue'](_0xd496('0x5'),_0x3fca68[_0xd496('0x6')](function(_0x499215){return{'id':_0x499215['id']};}));return FaxMessage[_0xd496('0x7')]({'where':{'FaxInteractionId':_0x1c3711['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd496('0x8')](function(_0x28c410){_0x1c3711['setDataValue'](_0xd496('0x9'),_0x28c410[_0xd496('0xa')]);FaxInteractionEvents[_0xd496('0xb')](_0x93b49e+':'+_0x1c3711['id'],_0x1c3711);FaxInteractionEvents[_0xd496('0xb')](_0x93b49e,_0x1c3711);_0xccf281(null);})[_0xd496('0xc')](_0xccf281(null));};}for(var e in events){if(events[_0xd496('0xd')](e)){var event=events[e];FaxInteraction[_0xd496('0xe')](e,emitEvent(event));}}module[_0xd496('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0x7b7e=['exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0x7b7e,0x190));var _0xe7b7=function(_0x648163,_0x241576){_0x648163=_0x648163-0x0;var _0x199d4d=_0x7b7e[_0x648163];return _0x199d4d;};'use strict';var EventEmitter=require(_0xe7b7('0x0'));var FaxInteraction=require(_0xe7b7('0x1'))['db'][_0xe7b7('0x2')];var FaxMessage=require(_0xe7b7('0x1'))['db'][_0xe7b7('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xe7b7('0x4')](0x0);var events={'afterCreate':_0xe7b7('0x5'),'afterUpdate':_0xe7b7('0x6'),'afterDestroy':_0xe7b7('0x7')};function emitEvent(_0x4719ed){return function(_0x1750c7,_0x5c7dea,_0x105a47){_0x1750c7[_0xe7b7('0x8')]({'attributes':['id'],'raw':!![]})[_0xe7b7('0x9')](function(_0x5b2e21){_0x1750c7[_0xe7b7('0xa')](_0xe7b7('0xb'),_0x5b2e21[_0xe7b7('0xc')](function(_0x12e568){return{'id':_0x12e568['id']};}));return FaxMessage[_0xe7b7('0xd')]({'where':{'FaxInteractionId':_0x1750c7['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe7b7('0x9')](function(_0x552480){_0x1750c7['setDataValue'](_0xe7b7('0xe'),_0x552480[_0xe7b7('0xf')]);FaxInteractionEvents[_0xe7b7('0x10')](_0x4719ed+':'+_0x1750c7['id'],_0x1750c7);FaxInteractionEvents[_0xe7b7('0x10')](_0x4719ed,_0x1750c7);_0x105a47(null);})[_0xe7b7('0x11')](_0x105a47(null));};}for(var e in events){if(events[_0xe7b7('0x12')](e)){var event=events[e];FaxInteraction[_0xe7b7('0x13')](e,emitEvent(event));}}module[_0xe7b7('0x14')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index b7b9ced..0fcde82 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 _0xb1fc=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','moment','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt'];(function(_0x50b73a,_0x5b1339){var _0x25bdda=function(_0x180d25){while(--_0x180d25){_0x50b73a['push'](_0x50b73a['shift']());}};_0x25bdda(++_0x5b1339);}(_0xb1fc,0xf2));var _0xcb1f=function(_0x35f28f,_0x18c2d4){_0x35f28f=_0x35f28f-0x0;var _0x3f0325=_0xb1fc[_0x35f28f];return _0x3f0325;};'use strict';var _=require(_0xcb1f('0x0'));var util=require(_0xcb1f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xcb1f('0x2'));var BPromise=require('bluebird');var rp=require(_0xcb1f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb1f('0x4'));var config=require(_0xcb1f('0x5'));var attributes=require(_0xcb1f('0x6'));module['exports']=function(_0x48f9c5,_0xede29c){return _0x48f9c5[_0xcb1f('0x7')](_0xcb1f('0x8'),attributes,{'tableName':_0xcb1f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xd21c9e,_0x1849e0,_0xe62505){if(_0xd21c9e[_0xcb1f('0xa')](_0xcb1f('0xb'))){_0xd21c9e[_0xcb1f('0xc')]=moment()[_0xcb1f('0xd')](_0xcb1f('0xe'));}_0xe62505(null,_0xd21c9e);}}});}; \ No newline at end of file +var _0x14d8=['bluebird','path','exports','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x19a08b,_0x15b96e){var _0x17b856=function(_0x2c1199){while(--_0x2c1199){_0x19a08b['push'](_0x19a08b['shift']());}};_0x17b856(++_0x15b96e);}(_0x14d8,0x87));var _0x814d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x14d8[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x814d('0x0'));var util=require(_0x814d('0x1'));var logger=require(_0x814d('0x2'))(_0x814d('0x3'));var moment=require(_0x814d('0x4'));var BPromise=require(_0x814d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x814d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0x814d('0x7')]=function(_0x1ce727,_0x105932){return _0x1ce727['define'](_0x814d('0x8'),attributes,{'tableName':_0x814d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ac802,_0xa745c8,_0x3c176e){if(_0x2ac802[_0x814d('0xa')](_0x814d('0xb'))){_0x2ac802['closedAt']=moment()[_0x814d('0xc')](_0x814d('0xd'));}_0x3c176e(null,_0x2ac802);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index a304ad3..a84575c 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 _0x59d8=['redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','where','then','debug','stringify','AddTagsToFaxInteraction','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x59d8,0x14b));var _0x859d=function(_0x247fa1,_0x4ec37c){_0x247fa1=_0x247fa1-0x0;var _0x244f35=_0x59d8[_0x247fa1];return _0x244f35;};'use strict';var _=require(_0x859d('0x0'));var util=require('util');var moment=require(_0x859d('0x1'));var BPromise=require(_0x859d('0x2'));var rs=require(_0x859d('0x3'));var fs=require('fs');var Redis=require(_0x859d('0x4'));var db=require(_0x859d('0x5'))['db'];var utils=require(_0x859d('0x6'));var logger=require(_0x859d('0x7'))(_0x859d('0x8'));var config=require(_0x859d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x859d('0xa')][_0x859d('0xb')]({'port':0x232a});config['redis']=_[_0x859d('0xc')](config[_0x859d('0xd')],{'host':_0x859d('0xe'),'port':0x18eb});var socket=require(_0x859d('0xf'))(new Redis(config[_0x859d('0xd')]));require(_0x859d('0x10'))[_0x859d('0x11')](socket);function respondWithRpcPromise(_0x540cfb,_0x34a541,_0x2f2a51){return new BPromise(function(_0x884b84,_0x2bdd4e){return client[_0x859d('0x12')](_0x540cfb,_0x2f2a51)['then'](function(_0x8916f2){logger[_0x859d('0x13')](_0x859d('0x14'),_0x34a541,_0x859d('0x15'));logger['debug'](_0x859d('0x16'),_0x34a541,_0x859d('0x15'),JSON['stringify'](_0x8916f2));if(_0x8916f2['error']){if(_0x8916f2[_0x859d('0x17')][_0x859d('0x18')]===0x1f4){logger['error'](_0x859d('0x14'),_0x34a541,_0x8916f2[_0x859d('0x17')][_0x859d('0x19')]);return _0x2bdd4e(_0x8916f2[_0x859d('0x17')][_0x859d('0x19')]);}logger['error'](_0x859d('0x14'),_0x34a541,_0x8916f2[_0x859d('0x17')][_0x859d('0x19')]);return _0x884b84(_0x8916f2[_0x859d('0x17')][_0x859d('0x19')]);}else{logger['info'](_0x859d('0x14'),_0x34a541,_0x859d('0x15'));_0x884b84(_0x8916f2[_0x859d('0x1a')][_0x859d('0x19')]);}})[_0x859d('0x1b')](function(_0x111723){logger[_0x859d('0x17')](_0x859d('0x14'),_0x34a541,_0x111723);_0x2bdd4e(_0x111723);});});}exports[_0x859d('0x1c')]=function(_0x257826){var _0x51a40c=this;return new Promise(function(_0x4944b8,_0x52c7b9){return db[_0x859d('0x1d')]['update'](_0x257826[_0x859d('0x1e')],{'raw':_0x257826[_0x859d('0x1f')]?_0x257826[_0x859d('0x1f')][_0x859d('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x257826[_0x859d('0x1f')]?_0x257826[_0x859d('0x1f')][_0x859d('0x21')]||null:null,'attributes':_0x257826[_0x859d('0x1f')]?_0x257826[_0x859d('0x1f')]['attributes']||null:null,'limit':_0x257826[_0x859d('0x1f')]?_0x257826[_0x859d('0x1f')]['limit']||null:null})[_0x859d('0x22')](function(_0x48ed9a){logger[_0x859d('0x13')](_0x859d('0x1c'),_0x257826);logger[_0x859d('0x23')](_0x859d('0x1c'),_0x257826,JSON[_0x859d('0x24')](_0x48ed9a));_0x4944b8(_0x48ed9a);})[_0x859d('0x1b')](function(_0x4a9d0e){logger[_0x859d('0x17')](_0x859d('0x1c'),_0x4a9d0e[_0x859d('0x19')],_0x257826);_0x52c7b9(_0x51a40c[_0x859d('0x17')](0x1f4,_0x4a9d0e[_0x859d('0x19')]));});});};exports[_0x859d('0x25')]=function(_0x1a1508){return new Promise(function(_0x4e6caf,_0xd47471){return db[_0x859d('0x1d')]['find']({'where':_0x1a1508[_0x859d('0x1f')]?_0x1a1508['options'][_0x859d('0x21')]||null:null})[_0x859d('0x22')](function(_0x1c207e){if(_0x1c207e){return _0x1c207e[_0x859d('0x26')](_0x1a1508[_0x859d('0x1e')][_0x859d('0x27')],_[_0x859d('0x28')](_0x1a1508[_0x859d('0x1e')],[_0x859d('0x27'),'id'])||{});}})[_0x859d('0x29')](function(_0x358c94){logger[_0x859d('0x13')](_0x859d('0x2a'),_0x1a1508);logger[_0x859d('0x23')](_0x859d('0x2a'),_0x1a1508,JSON[_0x859d('0x24')](_0x358c94));_0x4e6caf(_0x358c94);})[_0x859d('0x1b')](function(_0x55ca53){logger[_0x859d('0x17')]('AddTags',_0x55ca53[_0x859d('0x19')],_0x1a1508);_0xd47471(_this[_0x859d('0x17')](0x1f4,_0x55ca53['message']));});});}; \ No newline at end of file +var _0x3785=['stringify','error','code','message','request\x20sent','result','catch','UpdateFaxInteraction','FaxInteraction','options','where','attributes','limit','debug','AddTagsToFaxInteraction','find','addTags','body','ids','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x3785,0xbd));var _0x5378=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x3785[_0x2d61b2];return _0x12df89;};'use strict';var _=require(_0x5378('0x0'));var util=require('util');var moment=require(_0x5378('0x1'));var BPromise=require(_0x5378('0x2'));var rs=require(_0x5378('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5378('0x4'))['db'];var utils=require(_0x5378('0x5'));var logger=require(_0x5378('0x6'))(_0x5378('0x7'));var config=require(_0x5378('0x8'));var jayson=require(_0x5378('0x9'));var client=jayson[_0x5378('0xa')][_0x5378('0xb')]({'port':0x232a});config[_0x5378('0xc')]=_[_0x5378('0xd')](config[_0x5378('0xc')],{'host':_0x5378('0xe'),'port':0x18eb});var socket=require(_0x5378('0xf'))(new Redis(config['redis']));require(_0x5378('0x10'))[_0x5378('0x11')](socket);function respondWithRpcPromise(_0x38c6a2,_0x23513a,_0x376fcb){return new BPromise(function(_0x329330,_0x27c6d9){return client['request'](_0x38c6a2,_0x376fcb)[_0x5378('0x12')](function(_0x49c0aa){logger[_0x5378('0x13')](_0x5378('0x14'),_0x23513a,'request\x20sent');logger['debug']('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x23513a,'request\x20sent',JSON[_0x5378('0x15')](_0x49c0aa));if(_0x49c0aa[_0x5378('0x16')]){if(_0x49c0aa[_0x5378('0x16')][_0x5378('0x17')]===0x1f4){logger[_0x5378('0x16')](_0x5378('0x14'),_0x23513a,_0x49c0aa['error'][_0x5378('0x18')]);return _0x27c6d9(_0x49c0aa[_0x5378('0x16')][_0x5378('0x18')]);}logger[_0x5378('0x16')](_0x5378('0x14'),_0x23513a,_0x49c0aa['error'][_0x5378('0x18')]);return _0x329330(_0x49c0aa[_0x5378('0x16')]['message']);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x23513a,_0x5378('0x19'));_0x329330(_0x49c0aa[_0x5378('0x1a')][_0x5378('0x18')]);}})[_0x5378('0x1b')](function(_0x1bddff){logger[_0x5378('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x23513a,_0x1bddff);_0x27c6d9(_0x1bddff);});});}exports[_0x5378('0x1c')]=function(_0x1c734d){var _0x4b5a97=this;return new Promise(function(_0x2fb3b8,_0x5530c1){return db[_0x5378('0x1d')]['update'](_0x1c734d['body'],{'raw':_0x1c734d[_0x5378('0x1e')]?_0x1c734d[_0x5378('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c734d[_0x5378('0x1e')]?_0x1c734d[_0x5378('0x1e')][_0x5378('0x1f')]||null:null,'attributes':_0x1c734d[_0x5378('0x1e')]?_0x1c734d[_0x5378('0x1e')][_0x5378('0x20')]||null:null,'limit':_0x1c734d[_0x5378('0x1e')]?_0x1c734d[_0x5378('0x1e')][_0x5378('0x21')]||null:null})['then'](function(_0x3898fb){logger[_0x5378('0x13')](_0x5378('0x1c'),_0x1c734d);logger[_0x5378('0x22')](_0x5378('0x1c'),_0x1c734d,JSON[_0x5378('0x15')](_0x3898fb));_0x2fb3b8(_0x3898fb);})[_0x5378('0x1b')](function(_0x87a587){logger[_0x5378('0x16')](_0x5378('0x1c'),_0x87a587[_0x5378('0x18')],_0x1c734d);_0x5530c1(_0x4b5a97[_0x5378('0x16')](0x1f4,_0x87a587['message']));});});};exports[_0x5378('0x23')]=function(_0x503113){return new Promise(function(_0x1e4b36,_0x1af175){return db[_0x5378('0x1d')][_0x5378('0x24')]({'where':_0x503113['options']?_0x503113[_0x5378('0x1e')][_0x5378('0x1f')]||null:null})[_0x5378('0x12')](function(_0x5ab318){if(_0x5ab318){return _0x5ab318[_0x5378('0x25')](_0x503113[_0x5378('0x26')][_0x5378('0x27')],_['omit'](_0x503113[_0x5378('0x26')],[_0x5378('0x27'),'id'])||{});}})[_0x5378('0x28')](function(_0x3bc0d7){logger['info']('AddTags',_0x503113);logger[_0x5378('0x22')](_0x5378('0x29'),_0x503113,JSON[_0x5378('0x15')](_0x3bc0d7));_0x1e4b36(_0x3bc0d7);})['catch'](function(_0x255e9a){logger[_0x5378('0x16')]('AddTags',_0x255e9a['message'],_0x503113);_0x1af175(_this[_0x5378('0x16')](0x1f4,_0x255e9a['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 86be7a2..8e61712 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 _0xa594=['register','length','faxInteraction:','./faxInteraction.events','save','emit','removeListener'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa594,0xa4));var _0x4a59=function(_0x529296,_0x1a6a23){_0x529296=_0x529296-0x0;var _0x1796bf=_0xa594[_0x529296];return _0x1796bf;};'use strict';var FaxInteractionEvents=require(_0x4a59('0x0'));var events=[_0x4a59('0x1'),'remove','update'];function createListener(_0x4631ff,_0x4fa746){return function(_0x5fa018){_0x4fa746[_0x4a59('0x2')](_0x4631ff,_0x5fa018);};}function removeListener(_0x58873e,_0x253970){return function(){FaxInteractionEvents[_0x4a59('0x3')](_0x58873e,_0x253970);};}exports[_0x4a59('0x4')]=function(_0x1b6de9){for(var _0x503473=0x0,_0x1b91b4=events[_0x4a59('0x5')];_0x503473<_0x1b91b4;_0x503473++){var _0xcf909b=events[_0x503473];var _0x1ba901=createListener(_0x4a59('0x6')+_0xcf909b,_0x1b6de9);FaxInteractionEvents['on'](_0xcf909b,_0x1ba901);}}; \ No newline at end of file +var _0xdb47=['./faxInteraction.events','save','register','faxInteraction:'];(function(_0xb7a459,_0xc13228){var _0x104ab5=function(_0x186a0e){while(--_0x186a0e){_0xb7a459['push'](_0xb7a459['shift']());}};_0x104ab5(++_0xc13228);}(_0xdb47,0x94));var _0x7db4=function(_0x490074,_0x45d1d8){_0x490074=_0x490074-0x0;var _0x169b2f=_0xdb47[_0x490074];return _0x169b2f;};'use strict';var FaxInteractionEvents=require(_0x7db4('0x0'));var events=[_0x7db4('0x1'),'remove','update'];function createListener(_0x203b04,_0x1ef9f3){return function(_0x4cc33){_0x1ef9f3['emit'](_0x203b04,_0x4cc33);};}function removeListener(_0x352a8c,_0x449dc8){return function(){FaxInteractionEvents['removeListener'](_0x352a8c,_0x449dc8);};}exports[_0x7db4('0x2')]=function(_0x26f654){for(var _0x42983f=0x0,_0x49e851=events['length'];_0x42983f<_0x49e851;_0x42983f++){var _0x5a23d3=events[_0x42983f];var _0x567f12=createListener(_0x7db4('0x3')+_0x5a23d3,_0x26f654);FaxInteractionEvents['on'](_0x5a23d3,_0x567f12);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index cd482b8..33f3fe6 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 _0x9eca=['download','post','create','/:id/messages','/:id/tags','fax','addTags','put','tracked','faxinteraction:update','faxinteraction:destroy','destroy','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','/describe','describe','/:id','show','isAuthenticated','/:id/download'];(function(_0x9aeaf1,_0x38b34b){var _0x2a4dbe=function(_0x49863a){while(--_0x49863a){_0x9aeaf1['push'](_0x9aeaf1['shift']());}};_0x2a4dbe(++_0x38b34b);}(_0x9eca,0xd2));var _0xa9ec=function(_0x23ed5d,_0x25c460){_0x23ed5d=_0x23ed5d-0x0;var _0x12fbdd=_0x9eca[_0x23ed5d];return _0x12fbdd;};'use strict';var multer=require(_0xa9ec('0x0'));var util=require('util');var path=require(_0xa9ec('0x1'));var timeout=require(_0xa9ec('0x2'));var express=require(_0xa9ec('0x3'));var router=express[_0xa9ec('0x4')]();var fs_extra=require(_0xa9ec('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9ec('0x6'));var config=require('../../config/environment');var controller=require('./faxInteraction.controller');router[_0xa9ec('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa9ec('0x7')](_0xa9ec('0x8'),auth['isAuthenticated'](),controller[_0xa9ec('0x9')]);router['get'](_0xa9ec('0xa'),auth['isAuthenticated'](),controller[_0xa9ec('0xb')]);router['get']('/:id/messages',auth[_0xa9ec('0xc')](),controller['getMessages']);router[_0xa9ec('0x7')](_0xa9ec('0xd'),auth['isAuthenticated'](),controller[_0xa9ec('0xe')]);router[_0xa9ec('0xf')]('/',auth[_0xa9ec('0xc')](),controller[_0xa9ec('0x10')]);router[_0xa9ec('0xf')](_0xa9ec('0x11'),auth[_0xa9ec('0xc')](),controller['addMessage']);router['post'](_0xa9ec('0x12'),auth[_0xa9ec('0xc')](),interaction['tracked'](_0xa9ec('0x13'),'faxinteraction:addtags'),controller[_0xa9ec('0x14')]);router[_0xa9ec('0x15')](_0xa9ec('0xa'),auth[_0xa9ec('0xc')](),interaction[_0xa9ec('0x16')](_0xa9ec('0x13'),_0xa9ec('0x17')),controller['update']);router['delete']('/:id',auth[_0xa9ec('0xc')](),interaction['tracked'](_0xa9ec('0x13'),_0xa9ec('0x18')),controller[_0xa9ec('0x19')]);router[_0xa9ec('0x1a')](_0xa9ec('0x12'),auth[_0xa9ec('0xc')](),controller['removeTags']);module[_0xa9ec('0x1b')]=router; \ No newline at end of file +var _0x52b4=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','describe','show','getMessages','post','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','/:id','destroy','removeTags','exports','multer','util','path'];(function(_0x34f7bb,_0x547eb3){var _0x2efee3=function(_0x1fc766){while(--_0x1fc766){_0x34f7bb['push'](_0x34f7bb['shift']());}};_0x2efee3(++_0x547eb3);}(_0x52b4,0xdd));var _0x452b=function(_0x323cae,_0x50929d){_0x323cae=_0x323cae-0x0;var _0x40c4c1=_0x52b4[_0x323cae];return _0x40c4c1;};'use strict';var multer=require(_0x452b('0x0'));var util=require(_0x452b('0x1'));var path=require(_0x452b('0x2'));var timeout=require(_0x452b('0x3'));var express=require(_0x452b('0x4'));var router=express[_0x452b('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x452b('0x6'));var config=require(_0x452b('0x7'));var controller=require(_0x452b('0x8'));router[_0x452b('0x9')]('/',auth[_0x452b('0xa')](),controller['index']);router[_0x452b('0x9')]('/describe',auth[_0x452b('0xa')](),controller[_0x452b('0xb')]);router[_0x452b('0x9')]('/:id',auth[_0x452b('0xa')](),controller[_0x452b('0xc')]);router[_0x452b('0x9')]('/:id/messages',auth[_0x452b('0xa')](),controller[_0x452b('0xd')]);router['get']('/:id/download',auth[_0x452b('0xa')](),controller['download']);router['post']('/',auth[_0x452b('0xa')](),controller['create']);router[_0x452b('0xe')](_0x452b('0xf'),auth[_0x452b('0xa')](),controller['addMessage']);router[_0x452b('0xe')](_0x452b('0x10'),auth[_0x452b('0xa')](),interaction[_0x452b('0x11')](_0x452b('0x12'),_0x452b('0x13')),controller[_0x452b('0x14')]);router[_0x452b('0x15')]('/:id',auth[_0x452b('0xa')](),interaction['tracked']('fax',_0x452b('0x16')),controller['update']);router[_0x452b('0x17')](_0x452b('0x18'),auth[_0x452b('0xa')](),interaction['tracked'](_0x452b('0x12'),'faxinteraction:destroy'),controller[_0x452b('0x19')]);router[_0x452b('0x17')]('/:id/tags',auth['isAuthenticated'](),controller[_0x452b('0x1a')]);module[_0x452b('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 4ae0519..115dd65 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 _0xc576=['sequelize','exports','TEXT','medium','BOOLEAN','out','DATE'];(function(_0xb4d68c,_0x298b00){var _0x5183f2=function(_0x113c69){while(--_0x113c69){_0xb4d68c['push'](_0xb4d68c['shift']());}};_0x5183f2(++_0x298b00);}(_0xc576,0x1ea));var _0x6c57=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0xc576[_0x7cb10c];return _0x11df59;};'use strict';var Sequelize=require(_0x6c57('0x0'));module[_0x6c57('0x1')]={'body':{'type':Sequelize[_0x6c57('0x2')](_0x6c57('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x6c57('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x6c57('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x6c57('0x6')]}}; \ No newline at end of file +var _0x5ff3=['TEXT','exports','medium','ENUM','out'];(function(_0x4c2395,_0x4d3378){var _0x1ea522=function(_0x596366){while(--_0x596366){_0x4c2395['push'](_0x4c2395['shift']());}};_0x1ea522(++_0x4d3378);}(_0x5ff3,0x17d));var _0x35ff=function(_0x3768d8,_0xd04d27){_0x3768d8=_0x3768d8-0x0;var _0x332800=_0x5ff3[_0x3768d8];return _0x332800;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'body':{'type':Sequelize['TEXT'](_0x35ff('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x35ff('0x2')]('in',_0x35ff('0x3')),'defaultValue':_0x35ff('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x35ff('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 08b66c4..483798f 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 _0x3b58=['email','event','rejectmessage','create','CmContact','findOne','fax','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','Attachment','basename','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','end','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','sendStatus','stack','name','send','map','FaxMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','show','params','merge','body','find','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteractionId','isNil','read1stAt','interaction','user','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','fax-interactions','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize'];(function(_0x5b5879,_0x2efc63){var _0x47ab8c=function(_0x1b029f){while(--_0x1b029f){_0x5b5879['push'](_0x5b5879['shift']());}};_0x47ab8c(++_0x2efc63);}(_0x3b58,0x1c8));var _0x83b5=function(_0xb71f9c,_0x3e8e8d){_0xb71f9c=_0xb71f9c-0x0;var _0xc0b2ec=_0x3b58[_0xb71f9c];return _0xc0b2ec;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x83b5('0x0'));var zipdir=require(_0x83b5('0x1'));var jsonpatch=require(_0x83b5('0x2'));var rp=require(_0x83b5('0x3'));var moment=require(_0x83b5('0x4'));var BPromise=require(_0x83b5('0x5'));var Mustache=require(_0x83b5('0x6'));var util=require(_0x83b5('0x7'));var path=require(_0x83b5('0x8'));var sox=require(_0x83b5('0x9'));var csv=require(_0x83b5('0xa'));var ejs=require(_0x83b5('0xb'));var fs=require('fs');var fs_extra=require(_0x83b5('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x83b5('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x83b5('0xe'));var Redis=require('ioredis');var authService=require(_0x83b5('0xf'));var qs=require(_0x83b5('0x10'));var as=require(_0x83b5('0x11'));var hardwareService=require(_0x83b5('0x12'));var logger=require(_0x83b5('0x13'))(_0x83b5('0x14'));var utils=require(_0x83b5('0x15'));var config=require(_0x83b5('0x16'));var licenseUtil=require(_0x83b5('0x17'));var db=require('../../mysqldb')['db'];config[_0x83b5('0x18')]=_[_0x83b5('0x19')](config[_0x83b5('0x18')],{'host':_0x83b5('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x83b5('0x1b'))[_0x83b5('0x1c')](socket);var jayson=require(_0x83b5('0x1d'));var client=jayson[_0x83b5('0x1e')][_0x83b5('0x1f')]({'port':0x232c});var client9002=jayson[_0x83b5('0x1e')][_0x83b5('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x17d534,_0x533c43,_0x5611c4,_0x38c3eb){return new BPromise(function(_0x2af039,_0x490583){var _0x5ddf8e=_0x38c3eb||client;return _0x5ddf8e[_0x83b5('0x20')](_0x17d534,_0x5611c4)[_0x83b5('0x21')](function(_0x1dea9e){logger[_0x83b5('0x22')]('FaxMessage,\x20%s,\x20%s',_0x533c43,_0x83b5('0x23'));logger[_0x83b5('0x24')](_0x83b5('0x25'),_0x533c43,'request\x20sent',JSON[_0x83b5('0x26')](_0x1dea9e));if(_0x1dea9e[_0x83b5('0x27')]){if(_0x1dea9e[_0x83b5('0x27')][_0x83b5('0x28')]===0x1f4){logger[_0x83b5('0x27')](_0x83b5('0x29'),_0x533c43,_0x1dea9e[_0x83b5('0x27')]['message']);return _0x490583(_0x1dea9e[_0x83b5('0x27')][_0x83b5('0x2a')]);}logger['error'](_0x83b5('0x29'),_0x533c43,_0x1dea9e[_0x83b5('0x27')]['message']);return _0x2af039(_0x1dea9e['error'][_0x83b5('0x2a')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x533c43,'request\x20sent');_0x2af039(_0x1dea9e[_0x83b5('0x2b')][_0x83b5('0x2a')]);}})[_0x83b5('0x2c')](function(_0x334cc1){logger['error']('FaxMessage,\x20%s,\x20%s',_0x533c43,_0x334cc1);_0x490583(_0x334cc1);});});}function respondWithStatusCode(_0x4dea6e,_0x4beaae){_0x4beaae=_0x4beaae||0xcc;return function(_0x3806b9){if(_0x3806b9){return _0x4dea6e['sendStatus'](_0x4beaae);}return _0x4dea6e['status'](_0x4beaae)[_0x83b5('0x2d')]();};}function respondWithResult(_0x5ec394,_0x5628ae){_0x5628ae=_0x5628ae||0xc8;return function(_0x19b8cf){if(_0x19b8cf){return _0x5ec394[_0x83b5('0x2e')](_0x5628ae)['json'](_0x19b8cf);}};}function respondWithFilteredResult(_0x27bd0c,_0x12d5be){return function(_0x5e2809){if(_0x5e2809){var _0x68bdc7=typeof _0x12d5be['offset']===_0x83b5('0x2f')&&typeof _0x12d5be[_0x83b5('0x30')]===_0x83b5('0x2f');var _0x337c2c=_0x5e2809[_0x83b5('0x31')];var _0x4c4f72=_0x68bdc7?0x0:_0x12d5be[_0x83b5('0x32')];var _0x231817=_0x68bdc7?_0x5e2809[_0x83b5('0x31')]:_0x12d5be[_0x83b5('0x32')]+_0x12d5be['limit'];var _0x42566f;if(_0x231817>=_0x337c2c){_0x231817=_0x337c2c;_0x42566f=0xc8;}else{_0x42566f=0xce;}_0x27bd0c['status'](_0x42566f);return _0x27bd0c[_0x83b5('0x33')](_0x83b5('0x34'),_0x4c4f72+'-'+_0x231817+'/'+_0x337c2c)[_0x83b5('0x35')](_0x5e2809);}return null;};}function patchUpdates(_0x32feca){return function(_0x537e0a){try{jsonpatch[_0x83b5('0x36')](_0x537e0a,_0x32feca,!![]);}catch(_0x371bd1){return BPromise[_0x83b5('0x37')](_0x371bd1);}return _0x537e0a['save']();};}function saveUpdates(_0x160e09,_0x5514d6){return function(_0x49bb7e){if(_0x49bb7e){return _0x49bb7e[_0x83b5('0x38')](_0x160e09)[_0x83b5('0x21')](function(_0x20bde0){return _0x20bde0;});}return null;};}function removeEntity(_0x4f27c1,_0x5b36b8){return function(_0x578a2d){if(_0x578a2d){return _0x578a2d[_0x83b5('0x39')]()[_0x83b5('0x21')](function(){_0x4f27c1[_0x83b5('0x2e')](0xcc)[_0x83b5('0x2d')]();});}};}function handleEntityNotFound(_0x3faa46,_0x4c1d47){return function(_0x5b8551){if(!_0x5b8551){_0x3faa46[_0x83b5('0x3a')](0x194);}return _0x5b8551;};}function handleError(_0x1fefe4,_0xa5e641){_0xa5e641=_0xa5e641||0x1f4;return function(_0x5d0e8d){logger[_0x83b5('0x27')](_0x5d0e8d[_0x83b5('0x3b')]);if(_0x5d0e8d['name']){delete _0x5d0e8d[_0x83b5('0x3c')];}_0x1fefe4[_0x83b5('0x2e')](_0xa5e641)[_0x83b5('0x3d')](_0x5d0e8d);};}exports['index']=function(_0x20414e,_0x50da8d){var _0x4d03e6={},_0x9e34c4={},_0x5d2eac={'count':0x0,'rows':[]};var _0xc4c59f=_[_0x83b5('0x3e')](db[_0x83b5('0x3f')][_0x83b5('0x40')],function(_0x23af03){return{'name':_0x23af03['fieldName'],'type':_0x23af03[_0x83b5('0x41')][_0x83b5('0x42')]};});_0x9e34c4[_0x83b5('0x43')]=_[_0x83b5('0x3e')](_0xc4c59f,_0x83b5('0x3c'));_0x9e34c4[_0x83b5('0x44')]=_[_0x83b5('0x45')](_0x20414e[_0x83b5('0x44')]);_0x9e34c4[_0x83b5('0x46')]=_[_0x83b5('0x47')](_0x9e34c4[_0x83b5('0x43')],_0x9e34c4['query']);_0x4d03e6[_0x83b5('0x48')]=_[_0x83b5('0x47')](_0x9e34c4[_0x83b5('0x43')],qs[_0x83b5('0x49')](_0x20414e[_0x83b5('0x44')][_0x83b5('0x49')]));_0x4d03e6[_0x83b5('0x48')]=_0x4d03e6[_0x83b5('0x48')][_0x83b5('0x4a')]?_0x4d03e6[_0x83b5('0x48')]:_0x9e34c4[_0x83b5('0x43')];if(!_0x20414e[_0x83b5('0x44')][_0x83b5('0x4b')]('nolimit')){_0x4d03e6['limit']=qs[_0x83b5('0x30')](_0x20414e[_0x83b5('0x44')][_0x83b5('0x30')]);_0x4d03e6[_0x83b5('0x32')]=qs[_0x83b5('0x32')](_0x20414e[_0x83b5('0x44')][_0x83b5('0x32')]);}_0x4d03e6[_0x83b5('0x4c')]=qs['sort'](_0x20414e[_0x83b5('0x44')][_0x83b5('0x4d')]);_0x4d03e6['where']=qs[_0x83b5('0x46')](_['pick'](_0x20414e[_0x83b5('0x44')],_0x9e34c4[_0x83b5('0x46')]),_0xc4c59f);if(_0x20414e[_0x83b5('0x44')][_0x83b5('0x4e')]){_0x4d03e6[_0x83b5('0x4f')]=_['merge'](_0x4d03e6['where'],{'$or':_[_0x83b5('0x3e')](_0xc4c59f,function(_0x241c2a){if(_0x241c2a['type']!==_0x83b5('0x50')){var _0x2f8588={};_0x2f8588[_0x241c2a[_0x83b5('0x3c')]]={'$like':'%'+_0x20414e[_0x83b5('0x44')][_0x83b5('0x4e')]+'%'};return _0x2f8588;}})});}_0x4d03e6=_['merge']({},_0x4d03e6,_0x20414e[_0x83b5('0x51')]);var _0x4bea74={'where':_0x4d03e6[_0x83b5('0x4f')]};return db[_0x83b5('0x3f')][_0x83b5('0x31')](_0x4bea74)['then'](function(_0x4e6e04){_0x5d2eac[_0x83b5('0x31')]=_0x4e6e04;if(_0x20414e[_0x83b5('0x44')][_0x83b5('0x52')]){_0x4d03e6[_0x83b5('0x53')]=[{'all':!![]}];}return db[_0x83b5('0x3f')][_0x83b5('0x54')](_0x4d03e6);})[_0x83b5('0x21')](function(_0x444f56){_0x5d2eac[_0x83b5('0x55')]=_0x444f56;return _0x5d2eac;})['then'](respondWithFilteredResult(_0x50da8d,_0x4d03e6))['catch'](handleError(_0x50da8d,null));};exports[_0x83b5('0x56')]=function(_0xf07c67,_0x47aa7a){var _0x2655d1={'raw':!![],'where':{'id':_0xf07c67[_0x83b5('0x57')]['id']}},_0x51f7db={};_0x51f7db['model']=_['keys'](db[_0x83b5('0x3f')]['rawAttributes']);_0x51f7db[_0x83b5('0x44')]=_['keys'](_0xf07c67[_0x83b5('0x44')]);_0x51f7db['filters']=_[_0x83b5('0x47')](_0x51f7db[_0x83b5('0x43')],_0x51f7db['query']);_0x2655d1['attributes']=_['intersection'](_0x51f7db[_0x83b5('0x43')],qs[_0x83b5('0x49')](_0xf07c67[_0x83b5('0x44')][_0x83b5('0x49')]));_0x2655d1['attributes']=_0x2655d1[_0x83b5('0x48')][_0x83b5('0x4a')]?_0x2655d1[_0x83b5('0x48')]:_0x51f7db[_0x83b5('0x43')];if(_0xf07c67[_0x83b5('0x44')][_0x83b5('0x52')]){_0x2655d1[_0x83b5('0x53')]=[{'all':!![]}];}_0x2655d1=_[_0x83b5('0x58')]({},_0x2655d1,_0xf07c67[_0x83b5('0x51')]);return db['FaxMessage']['find'](_0x2655d1)[_0x83b5('0x21')](handleEntityNotFound(_0x47aa7a,null))[_0x83b5('0x21')](respondWithResult(_0x47aa7a,null))[_0x83b5('0x2c')](handleError(_0x47aa7a,null));};exports[_0x83b5('0x38')]=function(_0x465d66,_0x5e3bbf){if(_0x465d66['body']['id']){delete _0x465d66[_0x83b5('0x59')]['id'];}return db[_0x83b5('0x3f')][_0x83b5('0x5a')]({'where':{'id':_0x465d66[_0x83b5('0x57')]['id']}})[_0x83b5('0x21')](handleEntityNotFound(_0x5e3bbf,null))['then'](saveUpdates(_0x465d66[_0x83b5('0x59')],null))[_0x83b5('0x21')](respondWithResult(_0x5e3bbf,null))['catch'](handleError(_0x5e3bbf,null));};exports[_0x83b5('0x39')]=function(_0xbb4b8f,_0x1f41a3){return db[_0x83b5('0x3f')][_0x83b5('0x5a')]({'where':{'id':_0xbb4b8f[_0x83b5('0x57')]['id']}})['then'](handleEntityNotFound(_0x1f41a3,null))[_0x83b5('0x21')](removeEntity(_0x1f41a3,null))['catch'](handleError(_0x1f41a3,null));};exports[_0x83b5('0x5b')]=function(_0x267952,_0x41b94c){return db[_0x83b5('0x3f')][_0x83b5('0x5b')]()['then'](respondWithResult(_0x41b94c,null))[_0x83b5('0x2c')](handleError(_0x41b94c,null));};var interaction_log=require(_0x83b5('0x13'))('fax-interactions');exports[_0x83b5('0x5c')]=function(_0x3ccd48,_0x41e62e,_0x40c6f6){var _0x592af5={'agent':{},'channel':'fax'};if(_0x3ccd48[_0x83b5('0x59')]['id']){delete _0x3ccd48[_0x83b5('0x59')]['id'];}_0x3ccd48['body']['read']=!![];_0x3ccd48[_0x83b5('0x59')][_0x83b5('0x5d')]=moment()[_0x83b5('0x5e')](_0x83b5('0x5f'));_0x3ccd48['body'][_0x83b5('0x60')]=_0x3ccd48[_0x83b5('0x59')][_0x83b5('0x60')]||_0x3ccd48['user']['id'];_0x592af5['agent']['id']=_0x3ccd48[_0x83b5('0x59')][_0x83b5('0x60')];return db[_0x83b5('0x3f')][_0x83b5('0x5a')]({'where':{'id':_0x3ccd48['params']['id'],'UserId':null}})[_0x83b5('0x21')](handleEntityNotFound(_0x41e62e,null))[_0x83b5('0x21')](saveUpdates(_0x3ccd48['body'],null))['then'](function(_0x360452){if(_0x360452){_0x592af5['message']=_0x360452[_0x83b5('0x61')]({'plain':!![]});return db['FaxInteraction'][_0x83b5('0x5a')]({'where':{'id':_0x360452[_0x83b5('0x62')]}});}return null;})[_0x83b5('0x21')](handleEntityNotFound(_0x41e62e,null))[_0x83b5('0x21')](function(_0x629ca){if(_0x629ca){return _0x629ca[_0x83b5('0x38')]({'UserId':_0x3ccd48[_0x83b5('0x59')][_0x83b5('0x60')],'read1stAt':_[_0x83b5('0x63')](_0x629ca[_0x83b5('0x64')])?moment()[_0x83b5('0x5e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x83b5('0x21')](function(_0xb7e2d8){if(_0xb7e2d8){_0x592af5[_0x83b5('0x65')]=_0xb7e2d8['get']({'plain':!![]});interaction_log[_0x83b5('0x22')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3ccd48[_0x83b5('0x66')]['id'],_0x3ccd48[_0x83b5('0x66')][_0x83b5('0x3c')],_0x3ccd48[_0x83b5('0x66')]['role'],_0x592af5['interaction']['id'],_0x3ccd48[_0x83b5('0x59')]?JSON[_0x83b5('0x26')](_0x3ccd48[_0x83b5('0x59')]):_0x83b5('0x67'));return respondWithRpcPromise(_0x83b5('0x68'),'acceptMessage',_0x592af5);}return null;})[_0x83b5('0x21')](function(_0xcf1796){var _0x306db3=_0x83b5('0x69')+_0xcf1796[_0x83b5('0x2a')][_0x83b5('0x6a')];return db['sequelize']['query'](_0x306db3,{'type':db[_0x83b5('0x6b')][_0x83b5('0x6c')][_0x83b5('0x6d')],'raw':!![]})[_0x83b5('0x21')](function(_0x1e81da){return _0x1e81da;});})[_0x83b5('0x21')](function(_0x2b139c){if(_0x2b139c){_0x592af5[_0x83b5('0x2a')][_0x83b5('0x6e')]=_0x2b139c[0x0];if(!_0x3ccd48[_0x83b5('0x59')][_0x83b5('0x60')])return;return db[_0x83b5('0x6f')][_0x83b5('0x5a')]({'where':{'id':_0x3ccd48[_0x83b5('0x59')][_0x83b5('0x60')],'role':_0x83b5('0x70')},'attributes':['id','name',_0x83b5('0x71'),'email',_0x83b5('0x72')],'raw':!![]});}return null;})[_0x83b5('0x21')](function(_0x32cb9b){if(!_0x32cb9b)return null;_0x592af5[_0x83b5('0x2a')][_0x83b5('0x70')]=_0x32cb9b;return _0x592af5;})[_0x83b5('0x21')](function(_0x2b8ee5){if(_0x2b8ee5){if(_0x3ccd48[_0x83b5('0x59')][_0x83b5('0x73')]){_0x592af5[_0x83b5('0x2a')][_0x83b5('0x74')]=util[_0x83b5('0x5e')](_0x83b5('0x75'),_0x3ccd48[_0x83b5('0x66')][_0x83b5('0x3c')]);_0x592af5[_0x83b5('0x2a')][_0x83b5('0x76')]=_0x592af5['channel'];_0x592af5['message'][_0x83b5('0x77')]=_0x592af5['channel'];_0x592af5[_0x83b5('0x2a')]['event']=_0x83b5('0x5c');return respondWithRpcPromise(_0x83b5('0x78'),_0x83b5('0x78'),{'event':_0x83b5('0x79'),'message':_0x592af5[_0x83b5('0x2a')]},client9002)[_0x83b5('0x21')](function(){return _0x592af5;});}return _0x592af5;}return null;})[_0x83b5('0x21')](respondWithResult(_0x41e62e,null))[_0x83b5('0x2c')](handleError(_0x41e62e,null));};var interaction_log=require(_0x83b5('0x13'))(_0x83b5('0x7a'));exports['reject']=function(_0x33a9ea,_0x27c616,_0x3e1882){var _0x41d1a3={'agent':{},'channel':'fax'};if(_0x33a9ea[_0x83b5('0x59')]['id']){delete _0x33a9ea['body']['id'];}_0x33a9ea[_0x83b5('0x59')][_0x83b5('0x60')]=_0x33a9ea[_0x83b5('0x59')]['UserId']||_0x33a9ea['user']['id'];_0x41d1a3[_0x83b5('0x70')]['id']=_0x33a9ea[_0x83b5('0x59')][_0x83b5('0x60')];return db[_0x83b5('0x3f')][_0x83b5('0x5a')]({'where':{'id':_0x33a9ea[_0x83b5('0x57')]['id'],'UserId':null}})[_0x83b5('0x21')](handleEntityNotFound(_0x27c616,null))[_0x83b5('0x21')](function(_0x61b09e){if(_0x61b09e){_0x41d1a3[_0x83b5('0x2a')]=_0x61b09e[_0x83b5('0x61')]({'plain':!![]});return db[_0x83b5('0x7b')][_0x83b5('0x5a')]({'where':{'id':_0x61b09e['FaxInteractionId']}});}return null;})[_0x83b5('0x21')](handleEntityNotFound(_0x27c616,null))[_0x83b5('0x21')](function(_0x509416){if(_0x509416){_0x41d1a3['interaction']=_0x509416[_0x83b5('0x61')]({'plain':!![]});interaction_log[_0x83b5('0x22')](_0x83b5('0x7c'),_0x33a9ea[_0x83b5('0x66')]['id'],_0x33a9ea['user'][_0x83b5('0x3c')],_0x33a9ea[_0x83b5('0x66')]['role'],_0x41d1a3[_0x83b5('0x65')]['id'],_0x33a9ea[_0x83b5('0x59')]?JSON[_0x83b5('0x26')](_0x33a9ea[_0x83b5('0x59')]):_0x83b5('0x67'));return respondWithRpcPromise(_0x83b5('0x7d'),_0x83b5('0x7e'),_0x41d1a3);}return null;})[_0x83b5('0x21')](function(_0x558ccb){var _0x29f960='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x558ccb[_0x83b5('0x2a')]['ContactId'];return db[_0x83b5('0x7f')][_0x83b5('0x44')](_0x29f960,{'type':db['Sequelize'][_0x83b5('0x6c')]['SELECT'],'raw':!![]})[_0x83b5('0x21')](function(_0x3a7752){return _0x3a7752;});})[_0x83b5('0x21')](function(_0xb58060){if(_0xb58060){_0x41d1a3['message'][_0x83b5('0x6e')]=_0xb58060[0x0];if(!_0x33a9ea['body']['UserId'])return;return db['User'][_0x83b5('0x5a')]({'where':{'id':_0x33a9ea['body'][_0x83b5('0x60')],'role':'agent'},'attributes':['id',_0x83b5('0x3c'),'fullname',_0x83b5('0x80'),'internal'],'raw':!![]});}return null;})['then'](function(_0x20e227){if(!_0x20e227)return null;_0x41d1a3[_0x83b5('0x2a')][_0x83b5('0x70')]=_0x20e227;return _0x41d1a3;})['then'](function(_0x2dc1a6){if(_0x2dc1a6){_0x2dc1a6['message'][_0x83b5('0x74')]=util[_0x83b5('0x5e')](_0x83b5('0x75'),_0x33a9ea['user'][_0x83b5('0x3c')]);_0x2dc1a6['message']['channel']=_0x41d1a3[_0x83b5('0x76')];_0x2dc1a6[_0x83b5('0x2a')]['motionChannel']=_0x41d1a3[_0x83b5('0x76')];_0x2dc1a6[_0x83b5('0x2a')][_0x83b5('0x81')]=_0x83b5('0x37');respondWithRpcPromise('EventManager',_0x83b5('0x78'),{'event':_0x83b5('0x82'),'message':_0x2dc1a6[_0x83b5('0x2a')]},client9002);return _0x41d1a3;}return null;})[_0x83b5('0x21')](respondWithResult(_0x27c616,null))['catch'](handleError(_0x27c616,null));};exports['create']=function(_0x41f6e5,_0x49bb0f){var _0xd6b4d8;return db[_0x83b5('0x3f')][_0x83b5('0x83')](_0x41f6e5[_0x83b5('0x59')],{})[_0x83b5('0x21')](function(_0x580881){_0xd6b4d8=_0x580881;return db[_0x83b5('0x84')][_0x83b5('0x85')]({'where':{'id':_0xd6b4d8[_0x83b5('0x6a')]}});})[_0x83b5('0x21')](function(_0x18c045){if(_[_0x83b5('0x63')](_0x18c045)){return;}else{_0xd6b4d8[_0x83b5('0x86')]=_0x18c045[_0x83b5('0x86')];return db['Attachment'][_0x83b5('0x85')]({'where':{'id':_0xd6b4d8['AttachmentId']}});}})['then'](function(_0x4dbfb8){return respondWithRpcPromise(_0x83b5('0x87'),_0x83b5('0x87'),{'FaxAccountId':_[_0x83b5('0x63')](_0x41f6e5[_0x83b5('0x59')])?undefined:_0x41f6e5['body'][_0x83b5('0x88')],'path':_[_0x83b5('0x63')](_0x4dbfb8)?undefined:util[_0x83b5('0x5e')](_0x83b5('0x89'),_0x4dbfb8['basename']),'fax':_['isNil'](_0xd6b4d8[_0x83b5('0x86')])?undefined:_0xd6b4d8['fax'],'AttachmentId':_0xd6b4d8['AttachmentId']},client9002);})[_0x83b5('0x21')](respondWithResult(_0x49bb0f,0xc9))[_0x83b5('0x2c')](handleError(_0x49bb0f,null));};exports[_0x83b5('0x8a')]=function(_0x196466,_0x218705){var _0x3c1a38=path[_0x83b5('0x8b')](config[_0x83b5('0x8c')],_0x83b5('0x8d'),_0x83b5('0x8e'),_0x83b5('0x8f'));return db[_0x83b5('0x3f')][_0x83b5('0x5a')]({'where':{'id':_0x196466[_0x83b5('0x57')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x83b5('0x21')](handleEntityNotFound(_0x218705,null))['then'](function(_0x3196a1){if(_0x3196a1){return _0x218705[_0x83b5('0x8a')](path['join'](_0x3c1a38,_0x3196a1[_0x83b5('0x90')][_0x83b5('0x91')]));}})['catch'](handleError(_0x218705,null));}; \ No newline at end of file +var _0x3abf=['squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','set','apply','save','update','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','FaxMessage','catch','show','params','fields','includeAll','include','options','find','body','describe','fax-interactions','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','contact','User','agent','fullname','email','interface','motionChannel','channel','event','EventManager','acceptmessage','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SIP/%s','rejectmessage','create','CmContact','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','root','attachments','join','basename','rimraf','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra'];(function(_0x499be0,_0xfb24d1){var _0x10fd53=function(_0x3e7cfa){while(--_0x3e7cfa){_0x499be0['push'](_0x499be0['shift']());}};_0x10fd53(++_0xfb24d1);}(_0x3abf,0x110));var _0xf3ab=function(_0x465aac,_0x25f884){_0x465aac=_0x465aac-0x0;var _0xbaa3c9=_0x3abf[_0x465aac];return _0xbaa3c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3ab('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf3ab('0x1'));var rp=require('request-promise');var moment=require(_0xf3ab('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf3ab('0x3'));var util=require(_0xf3ab('0x4'));var path=require('path');var sox=require(_0xf3ab('0x5'));var csv=require('to-csv');var ejs=require(_0xf3ab('0x6'));var fs=require('fs');var fs_extra=require(_0xf3ab('0x7'));var _=require('lodash');var squel=require(_0xf3ab('0x8'));var crypto=require(_0xf3ab('0x9'));var jsforce=require(_0xf3ab('0xa'));var deskjs=require(_0xf3ab('0xb'));var toCsv=require('to-csv');var querystring=require(_0xf3ab('0xc'));var Papa=require('papaparse');var Redis=require(_0xf3ab('0xd'));var authService=require(_0xf3ab('0xe'));var qs=require(_0xf3ab('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3ab('0x10'))('api');var utils=require('../../config/utils');var config=require(_0xf3ab('0x11'));var licenseUtil=require(_0xf3ab('0x12'));var db=require(_0xf3ab('0x13'))['db'];config[_0xf3ab('0x14')]=_['defaults'](config[_0xf3ab('0x14')],{'host':_0xf3ab('0x15'),'port':0x18eb});var socket=require(_0xf3ab('0x16'))(new Redis(config[_0xf3ab('0x14')]));require(_0xf3ab('0x17'))[_0xf3ab('0x18')](socket);var jayson=require(_0xf3ab('0x19'));var client=jayson[_0xf3ab('0x1a')][_0xf3ab('0x1b')]({'port':0x232c});var client9002=jayson[_0xf3ab('0x1a')][_0xf3ab('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x17c8a9,_0x5707c6,_0x111fed,_0x1e4df2){return new BPromise(function(_0x6f238,_0x3b2de7){var _0x2035c4=_0x1e4df2||client;return _0x2035c4[_0xf3ab('0x1c')](_0x17c8a9,_0x111fed)[_0xf3ab('0x1d')](function(_0x221363){logger[_0xf3ab('0x1e')](_0xf3ab('0x1f'),_0x5707c6,_0xf3ab('0x20'));logger[_0xf3ab('0x21')](_0xf3ab('0x22'),_0x5707c6,_0xf3ab('0x20'),JSON[_0xf3ab('0x23')](_0x221363));if(_0x221363[_0xf3ab('0x24')]){if(_0x221363[_0xf3ab('0x24')][_0xf3ab('0x25')]===0x1f4){logger[_0xf3ab('0x24')](_0xf3ab('0x1f'),_0x5707c6,_0x221363[_0xf3ab('0x24')][_0xf3ab('0x26')]);return _0x3b2de7(_0x221363[_0xf3ab('0x24')][_0xf3ab('0x26')]);}logger[_0xf3ab('0x24')](_0xf3ab('0x1f'),_0x5707c6,_0x221363[_0xf3ab('0x24')][_0xf3ab('0x26')]);return _0x6f238(_0x221363[_0xf3ab('0x24')][_0xf3ab('0x26')]);}else{logger[_0xf3ab('0x1e')]('FaxMessage,\x20%s,\x20%s',_0x5707c6,_0xf3ab('0x20'));_0x6f238(_0x221363[_0xf3ab('0x27')]['message']);}})['catch'](function(_0x5ebb7e){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5707c6,_0x5ebb7e);_0x3b2de7(_0x5ebb7e);});});}function respondWithStatusCode(_0xa8f3f4,_0x380d60){_0x380d60=_0x380d60||0xcc;return function(_0x565810){if(_0x565810){return _0xa8f3f4['sendStatus'](_0x380d60);}return _0xa8f3f4[_0xf3ab('0x28')](_0x380d60)['end']();};}function respondWithResult(_0x4c64f3,_0x1cdca5){_0x1cdca5=_0x1cdca5||0xc8;return function(_0x18a247){if(_0x18a247){return _0x4c64f3[_0xf3ab('0x28')](_0x1cdca5)[_0xf3ab('0x29')](_0x18a247);}};}function respondWithFilteredResult(_0xa17d89,_0x55b3fd){return function(_0x549cec){if(_0x549cec){var _0x5838ba=typeof _0x55b3fd[_0xf3ab('0x2a')]===_0xf3ab('0x2b')&&typeof _0x55b3fd[_0xf3ab('0x2c')]===_0xf3ab('0x2b');var _0x3bc552=_0x549cec['count'];var _0x13a1c9=_0x5838ba?0x0:_0x55b3fd['offset'];var _0x2a6a3f=_0x5838ba?_0x549cec[_0xf3ab('0x2d')]:_0x55b3fd[_0xf3ab('0x2a')]+_0x55b3fd[_0xf3ab('0x2c')];var _0x1e6e97;if(_0x2a6a3f>=_0x3bc552){_0x2a6a3f=_0x3bc552;_0x1e6e97=0xc8;}else{_0x1e6e97=0xce;}_0xa17d89[_0xf3ab('0x28')](_0x1e6e97);return _0xa17d89[_0xf3ab('0x2e')]('Content-Range',_0x13a1c9+'-'+_0x2a6a3f+'/'+_0x3bc552)['json'](_0x549cec);}return null;};}function patchUpdates(_0x3e9c25){return function(_0x1db265){try{jsonpatch[_0xf3ab('0x2f')](_0x1db265,_0x3e9c25,!![]);}catch(_0x3c08c4){return BPromise['reject'](_0x3c08c4);}return _0x1db265[_0xf3ab('0x30')]();};}function saveUpdates(_0xa37d17,_0x161697){return function(_0x59d830){if(_0x59d830){return _0x59d830[_0xf3ab('0x31')](_0xa37d17)['then'](function(_0x166022){return _0x166022;});}return null;};}function removeEntity(_0x2df60e,_0xb881c7){return function(_0x4d4ccb){if(_0x4d4ccb){return _0x4d4ccb[_0xf3ab('0x32')]()[_0xf3ab('0x1d')](function(){_0x2df60e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15efe1,_0x557685){return function(_0x2bb041){if(!_0x2bb041){_0x15efe1[_0xf3ab('0x33')](0x194);}return _0x2bb041;};}function handleError(_0xbdb2a1,_0x16b0bd){_0x16b0bd=_0x16b0bd||0x1f4;return function(_0x56b073){logger[_0xf3ab('0x24')](_0x56b073[_0xf3ab('0x34')]);if(_0x56b073[_0xf3ab('0x35')]){delete _0x56b073[_0xf3ab('0x35')];}_0xbdb2a1[_0xf3ab('0x28')](_0x16b0bd)[_0xf3ab('0x36')](_0x56b073);};}exports[_0xf3ab('0x37')]=function(_0x34b581,_0x342c67){var _0xf036d8={},_0xe3c6c6={},_0x23f042={'count':0x0,'rows':[]};var _0x4aad5d=_['map'](db['FaxMessage'][_0xf3ab('0x38')],function(_0x47dc85){return{'name':_0x47dc85[_0xf3ab('0x39')],'type':_0x47dc85[_0xf3ab('0x3a')]['key']};});_0xe3c6c6[_0xf3ab('0x3b')]=_['map'](_0x4aad5d,_0xf3ab('0x35'));_0xe3c6c6[_0xf3ab('0x3c')]=_[_0xf3ab('0x3d')](_0x34b581[_0xf3ab('0x3c')]);_0xe3c6c6[_0xf3ab('0x3e')]=_['intersection'](_0xe3c6c6[_0xf3ab('0x3b')],_0xe3c6c6['query']);_0xf036d8[_0xf3ab('0x3f')]=_[_0xf3ab('0x40')](_0xe3c6c6['model'],qs['fields'](_0x34b581[_0xf3ab('0x3c')]['fields']));_0xf036d8[_0xf3ab('0x3f')]=_0xf036d8['attributes'][_0xf3ab('0x41')]?_0xf036d8[_0xf3ab('0x3f')]:_0xe3c6c6[_0xf3ab('0x3b')];if(!_0x34b581[_0xf3ab('0x3c')][_0xf3ab('0x42')](_0xf3ab('0x43'))){_0xf036d8['limit']=qs[_0xf3ab('0x2c')](_0x34b581['query']['limit']);_0xf036d8['offset']=qs[_0xf3ab('0x2a')](_0x34b581[_0xf3ab('0x3c')]['offset']);}_0xf036d8[_0xf3ab('0x44')]=qs['sort'](_0x34b581['query'][_0xf3ab('0x45')]);_0xf036d8['where']=qs[_0xf3ab('0x3e')](_[_0xf3ab('0x46')](_0x34b581[_0xf3ab('0x3c')],_0xe3c6c6[_0xf3ab('0x3e')]),_0x4aad5d);if(_0x34b581[_0xf3ab('0x3c')][_0xf3ab('0x47')]){_0xf036d8[_0xf3ab('0x48')]=_[_0xf3ab('0x49')](_0xf036d8['where'],{'$or':_[_0xf3ab('0x4a')](_0x4aad5d,function(_0x146a72){if(_0x146a72[_0xf3ab('0x3a')]!=='VIRTUAL'){var _0x5dd279={};_0x5dd279[_0x146a72['name']]={'$like':'%'+_0x34b581[_0xf3ab('0x3c')][_0xf3ab('0x47')]+'%'};return _0x5dd279;}})});}_0xf036d8=_['merge']({},_0xf036d8,_0x34b581['options']);var _0x39a53c={'where':_0xf036d8[_0xf3ab('0x48')]};return db['FaxMessage']['count'](_0x39a53c)[_0xf3ab('0x1d')](function(_0x8747f3){_0x23f042[_0xf3ab('0x2d')]=_0x8747f3;if(_0x34b581['query']['includeAll']){_0xf036d8['include']=[{'all':!![]}];}return db[_0xf3ab('0x4b')]['findAll'](_0xf036d8);})[_0xf3ab('0x1d')](function(_0x2d6d49){_0x23f042['rows']=_0x2d6d49;return _0x23f042;})['then'](respondWithFilteredResult(_0x342c67,_0xf036d8))[_0xf3ab('0x4c')](handleError(_0x342c67,null));};exports[_0xf3ab('0x4d')]=function(_0x400123,_0x1e82f5){var _0x422d8f={'raw':!![],'where':{'id':_0x400123[_0xf3ab('0x4e')]['id']}},_0xfdf832={};_0xfdf832[_0xf3ab('0x3b')]=_[_0xf3ab('0x3d')](db['FaxMessage']['rawAttributes']);_0xfdf832['query']=_[_0xf3ab('0x3d')](_0x400123[_0xf3ab('0x3c')]);_0xfdf832[_0xf3ab('0x3e')]=_[_0xf3ab('0x40')](_0xfdf832[_0xf3ab('0x3b')],_0xfdf832[_0xf3ab('0x3c')]);_0x422d8f[_0xf3ab('0x3f')]=_[_0xf3ab('0x40')](_0xfdf832[_0xf3ab('0x3b')],qs[_0xf3ab('0x4f')](_0x400123[_0xf3ab('0x3c')][_0xf3ab('0x4f')]));_0x422d8f[_0xf3ab('0x3f')]=_0x422d8f[_0xf3ab('0x3f')][_0xf3ab('0x41')]?_0x422d8f['attributes']:_0xfdf832['model'];if(_0x400123[_0xf3ab('0x3c')][_0xf3ab('0x50')]){_0x422d8f[_0xf3ab('0x51')]=[{'all':!![]}];}_0x422d8f=_[_0xf3ab('0x49')]({},_0x422d8f,_0x400123[_0xf3ab('0x52')]);return db[_0xf3ab('0x4b')][_0xf3ab('0x53')](_0x422d8f)[_0xf3ab('0x1d')](handleEntityNotFound(_0x1e82f5,null))[_0xf3ab('0x1d')](respondWithResult(_0x1e82f5,null))[_0xf3ab('0x4c')](handleError(_0x1e82f5,null));};exports[_0xf3ab('0x31')]=function(_0x53d188,_0x4178e9){if(_0x53d188[_0xf3ab('0x54')]['id']){delete _0x53d188[_0xf3ab('0x54')]['id'];}return db[_0xf3ab('0x4b')][_0xf3ab('0x53')]({'where':{'id':_0x53d188[_0xf3ab('0x4e')]['id']}})[_0xf3ab('0x1d')](handleEntityNotFound(_0x4178e9,null))[_0xf3ab('0x1d')](saveUpdates(_0x53d188[_0xf3ab('0x54')],null))[_0xf3ab('0x1d')](respondWithResult(_0x4178e9,null))[_0xf3ab('0x4c')](handleError(_0x4178e9,null));};exports[_0xf3ab('0x32')]=function(_0x1ce6dc,_0x6b90df){return db['FaxMessage'][_0xf3ab('0x53')]({'where':{'id':_0x1ce6dc[_0xf3ab('0x4e')]['id']}})[_0xf3ab('0x1d')](handleEntityNotFound(_0x6b90df,null))[_0xf3ab('0x1d')](removeEntity(_0x6b90df,null))['catch'](handleError(_0x6b90df,null));};exports['describe']=function(_0x20dc7a,_0x3131cb){return db[_0xf3ab('0x4b')][_0xf3ab('0x55')]()[_0xf3ab('0x1d')](respondWithResult(_0x3131cb,null))[_0xf3ab('0x4c')](handleError(_0x3131cb,null));};var interaction_log=require('../../config/logger')(_0xf3ab('0x56'));exports[_0xf3ab('0x57')]=function(_0x576b6b,_0x3c1dab,_0x19c4fc){var _0x23899a={'agent':{},'channel':'fax'};if(_0x576b6b[_0xf3ab('0x54')]['id']){delete _0x576b6b[_0xf3ab('0x54')]['id'];}_0x576b6b[_0xf3ab('0x54')][_0xf3ab('0x58')]=!![];_0x576b6b['body'][_0xf3ab('0x59')]=moment()[_0xf3ab('0x5a')](_0xf3ab('0x5b'));_0x576b6b[_0xf3ab('0x54')][_0xf3ab('0x5c')]=_0x576b6b[_0xf3ab('0x54')][_0xf3ab('0x5c')]||_0x576b6b['user']['id'];_0x23899a['agent']['id']=_0x576b6b[_0xf3ab('0x54')]['UserId'];return db[_0xf3ab('0x4b')]['find']({'where':{'id':_0x576b6b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3c1dab,null))['then'](saveUpdates(_0x576b6b[_0xf3ab('0x54')],null))['then'](function(_0x21290c){if(_0x21290c){_0x23899a[_0xf3ab('0x26')]=_0x21290c[_0xf3ab('0x5d')]({'plain':!![]});return db[_0xf3ab('0x5e')][_0xf3ab('0x53')]({'where':{'id':_0x21290c[_0xf3ab('0x5f')]}});}return null;})[_0xf3ab('0x1d')](handleEntityNotFound(_0x3c1dab,null))['then'](function(_0x75a4b){if(_0x75a4b){return _0x75a4b['update']({'UserId':_0x576b6b[_0xf3ab('0x54')][_0xf3ab('0x5c')],'read1stAt':_[_0xf3ab('0x60')](_0x75a4b[_0xf3ab('0x61')])?moment()[_0xf3ab('0x5a')](_0xf3ab('0x5b')):undefined});}return null;})[_0xf3ab('0x1d')](function(_0xd71d85){if(_0xd71d85){_0x23899a['interaction']=_0xd71d85[_0xf3ab('0x5d')]({'plain':!![]});interaction_log[_0xf3ab('0x1e')](_0xf3ab('0x62'),_0x576b6b[_0xf3ab('0x63')]['id'],_0x576b6b[_0xf3ab('0x63')][_0xf3ab('0x35')],_0x576b6b[_0xf3ab('0x63')][_0xf3ab('0x64')],_0x23899a[_0xf3ab('0x65')]['id'],_0x576b6b['body']?JSON[_0xf3ab('0x23')](_0x576b6b['body']):_0xf3ab('0x66'));return respondWithRpcPromise(_0xf3ab('0x67'),_0xf3ab('0x68'),_0x23899a);}return null;})[_0xf3ab('0x1d')](function(_0x2c7e29){var _0x50cb63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2c7e29[_0xf3ab('0x26')][_0xf3ab('0x69')];return db['sequelize'][_0xf3ab('0x3c')](_0x50cb63,{'type':db[_0xf3ab('0x6a')][_0xf3ab('0x6b')][_0xf3ab('0x6c')],'raw':!![]})['then'](function(_0x245c73){return _0x245c73;});})['then'](function(_0x51504a){if(_0x51504a){_0x23899a[_0xf3ab('0x26')][_0xf3ab('0x6d')]=_0x51504a[0x0];if(!_0x576b6b[_0xf3ab('0x54')]['UserId'])return;return db[_0xf3ab('0x6e')][_0xf3ab('0x53')]({'where':{'id':_0x576b6b[_0xf3ab('0x54')]['UserId'],'role':_0xf3ab('0x6f')},'attributes':['id',_0xf3ab('0x35'),_0xf3ab('0x70'),_0xf3ab('0x71'),'internal'],'raw':!![]});}return null;})[_0xf3ab('0x1d')](function(_0x284bd8){if(!_0x284bd8)return null;_0x23899a[_0xf3ab('0x26')]['agent']=_0x284bd8;return _0x23899a;})[_0xf3ab('0x1d')](function(_0x3ff60b){if(_0x3ff60b){if(_0x576b6b[_0xf3ab('0x54')]['manual']){_0x23899a[_0xf3ab('0x26')][_0xf3ab('0x72')]=util[_0xf3ab('0x5a')]('SIP/%s',_0x576b6b[_0xf3ab('0x63')][_0xf3ab('0x35')]);_0x23899a[_0xf3ab('0x26')]['channel']=_0x23899a['channel'];_0x23899a['message'][_0xf3ab('0x73')]=_0x23899a[_0xf3ab('0x74')];_0x23899a[_0xf3ab('0x26')][_0xf3ab('0x75')]=_0xf3ab('0x57');return respondWithRpcPromise('EventManager',_0xf3ab('0x76'),{'event':_0xf3ab('0x77'),'message':_0x23899a[_0xf3ab('0x26')]},client9002)['then'](function(){return _0x23899a;});}return _0x23899a;}return null;})['then'](respondWithResult(_0x3c1dab,null))[_0xf3ab('0x4c')](handleError(_0x3c1dab,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0xf3ab('0x78')]=function(_0x52f4d2,_0x4e3c12,_0x21c74f){var _0x20ff97={'agent':{},'channel':_0xf3ab('0x79')};if(_0x52f4d2[_0xf3ab('0x54')]['id']){delete _0x52f4d2[_0xf3ab('0x54')]['id'];}_0x52f4d2[_0xf3ab('0x54')][_0xf3ab('0x5c')]=_0x52f4d2[_0xf3ab('0x54')][_0xf3ab('0x5c')]||_0x52f4d2['user']['id'];_0x20ff97[_0xf3ab('0x6f')]['id']=_0x52f4d2['body'][_0xf3ab('0x5c')];return db[_0xf3ab('0x4b')][_0xf3ab('0x53')]({'where':{'id':_0x52f4d2['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e3c12,null))[_0xf3ab('0x1d')](function(_0x2d23f0){if(_0x2d23f0){_0x20ff97[_0xf3ab('0x26')]=_0x2d23f0['get']({'plain':!![]});return db[_0xf3ab('0x5e')][_0xf3ab('0x53')]({'where':{'id':_0x2d23f0[_0xf3ab('0x5f')]}});}return null;})[_0xf3ab('0x1d')](handleEntityNotFound(_0x4e3c12,null))['then'](function(_0x2d0d2d){if(_0x2d0d2d){_0x20ff97[_0xf3ab('0x65')]=_0x2d0d2d[_0xf3ab('0x5d')]({'plain':!![]});interaction_log[_0xf3ab('0x1e')](_0xf3ab('0x7a'),_0x52f4d2[_0xf3ab('0x63')]['id'],_0x52f4d2[_0xf3ab('0x63')][_0xf3ab('0x35')],_0x52f4d2[_0xf3ab('0x63')][_0xf3ab('0x64')],_0x20ff97[_0xf3ab('0x65')]['id'],_0x52f4d2[_0xf3ab('0x54')]?JSON[_0xf3ab('0x23')](_0x52f4d2[_0xf3ab('0x54')]):_0xf3ab('0x66'));return respondWithRpcPromise('RejectMessage',_0xf3ab('0x7b'),_0x20ff97);}return null;})['then'](function(_0x528b51){var _0x587dae=_0xf3ab('0x7c')+_0x528b51[_0xf3ab('0x26')][_0xf3ab('0x69')];return db[_0xf3ab('0x7d')][_0xf3ab('0x3c')](_0x587dae,{'type':db[_0xf3ab('0x6a')][_0xf3ab('0x6b')][_0xf3ab('0x6c')],'raw':!![]})[_0xf3ab('0x1d')](function(_0xe5c6df){return _0xe5c6df;});})[_0xf3ab('0x1d')](function(_0x2614e7){if(_0x2614e7){_0x20ff97[_0xf3ab('0x26')][_0xf3ab('0x6d')]=_0x2614e7[0x0];if(!_0x52f4d2[_0xf3ab('0x54')][_0xf3ab('0x5c')])return;return db[_0xf3ab('0x6e')][_0xf3ab('0x53')]({'where':{'id':_0x52f4d2[_0xf3ab('0x54')]['UserId'],'role':_0xf3ab('0x6f')},'attributes':['id','name','fullname',_0xf3ab('0x71'),'internal'],'raw':!![]});}return null;})[_0xf3ab('0x1d')](function(_0x4ae123){if(!_0x4ae123)return null;_0x20ff97['message'][_0xf3ab('0x6f')]=_0x4ae123;return _0x20ff97;})[_0xf3ab('0x1d')](function(_0xb36e0c){if(_0xb36e0c){_0xb36e0c['message']['interface']=util[_0xf3ab('0x5a')](_0xf3ab('0x7e'),_0x52f4d2[_0xf3ab('0x63')][_0xf3ab('0x35')]);_0xb36e0c[_0xf3ab('0x26')][_0xf3ab('0x74')]=_0x20ff97['channel'];_0xb36e0c['message']['motionChannel']=_0x20ff97[_0xf3ab('0x74')];_0xb36e0c[_0xf3ab('0x26')][_0xf3ab('0x75')]=_0xf3ab('0x78');respondWithRpcPromise('EventManager','EventManager',{'event':_0xf3ab('0x7f'),'message':_0xb36e0c[_0xf3ab('0x26')]},client9002);return _0x20ff97;}return null;})[_0xf3ab('0x1d')](respondWithResult(_0x4e3c12,null))[_0xf3ab('0x4c')](handleError(_0x4e3c12,null));};exports[_0xf3ab('0x80')]=function(_0x4207f1,_0x5a7a02){var _0x479000;return db[_0xf3ab('0x4b')][_0xf3ab('0x80')](_0x4207f1[_0xf3ab('0x54')],{})['then'](function(_0x39ccf){_0x479000=_0x39ccf;return db[_0xf3ab('0x81')]['findOne']({'where':{'id':_0x479000['ContactId']}});})[_0xf3ab('0x1d')](function(_0x4ea730){if(_[_0xf3ab('0x60')](_0x4ea730)){return;}else{_0x479000[_0xf3ab('0x79')]=_0x4ea730[_0xf3ab('0x79')];return db[_0xf3ab('0x82')]['findOne']({'where':{'id':_0x479000[_0xf3ab('0x83')]}});}})['then'](function(_0x10599c){return respondWithRpcPromise(_0xf3ab('0x84'),_0xf3ab('0x84'),{'FaxAccountId':_[_0xf3ab('0x60')](_0x4207f1[_0xf3ab('0x54')])?undefined:_0x4207f1[_0xf3ab('0x54')][_0xf3ab('0x85')],'path':_[_0xf3ab('0x60')](_0x10599c)?undefined:util[_0xf3ab('0x5a')](_0xf3ab('0x86'),_0x10599c['basename']),'fax':_[_0xf3ab('0x60')](_0x479000[_0xf3ab('0x79')])?undefined:_0x479000[_0xf3ab('0x79')],'AttachmentId':_0x479000['AttachmentId']},client9002);})[_0xf3ab('0x1d')](respondWithResult(_0x5a7a02,0xc9))['catch'](handleError(_0x5a7a02,null));};exports[_0xf3ab('0x87')]=function(_0x4aa262,_0x1bfc3c){var _0x57bced=path['join'](config[_0xf3ab('0x88')],'server','files',_0xf3ab('0x89'));return db[_0xf3ab('0x4b')]['find']({'where':{'id':_0x4aa262[_0xf3ab('0x4e')]['id']},'include':[{'model':db['Attachment'],'as':_0xf3ab('0x82')}]})[_0xf3ab('0x1d')](handleEntityNotFound(_0x1bfc3c,null))[_0xf3ab('0x1d')](function(_0x1e5fc9){if(_0x1e5fc9){return _0x1bfc3c[_0xf3ab('0x87')](path[_0xf3ab('0x8a')](_0x57bced,_0x1e5fc9[_0xf3ab('0x82')][_0xf3ab('0x8b')]));}})[_0xf3ab('0x4c')](handleError(_0x1bfc3c,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 03150ae..0cc0b13 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 _0xac41=['exports','events','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x209264,_0xb9d344){var _0x3ac43e=function(_0x31e305){while(--_0x31e305){_0x209264['push'](_0x209264['shift']());}};_0x3ac43e(++_0xb9d344);}(_0xac41,0xdd));var _0x1ac4=function(_0x109074,_0x508b4f){_0x109074=_0x109074-0x0;var _0x49ce45=_0xac41[_0x109074];return _0x49ce45;};'use strict';var EventEmitter=require(_0x1ac4('0x0'));var FaxMessage=require(_0x1ac4('0x1'))['db'][_0x1ac4('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1ac4('0x3')](0x0);var events={'afterCreate':_0x1ac4('0x4'),'afterUpdate':_0x1ac4('0x5'),'afterDestroy':_0x1ac4('0x6')};function emitEvent(_0x3a1763){return function(_0x54386c,_0x2c33d6,_0x216c0d){FaxMessageEvents[_0x1ac4('0x7')](_0x3a1763+':'+_0x54386c['id'],_0x54386c);FaxMessageEvents[_0x1ac4('0x7')](_0x3a1763,_0x54386c);_0x216c0d(null);};}for(var e in events){if(events[_0x1ac4('0x8')](e)){var event=events[e];FaxMessage[_0x1ac4('0x9')](e,emitEvent(event));}}module[_0x1ac4('0xa')]=FaxMessageEvents; \ No newline at end of file +var _0xd101=['hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove','emit'];(function(_0x3b63f5,_0x47791d){var _0x4fc0ef=function(_0x44303c){while(--_0x44303c){_0x3b63f5['push'](_0x3b63f5['shift']());}};_0x4fc0ef(++_0x47791d);}(_0xd101,0xc1));var _0x1d10=function(_0x3f58c1,_0x17cdca){_0x3f58c1=_0x3f58c1-0x0;var _0x59cbed=_0xd101[_0x3f58c1];return _0x59cbed;};'use strict';var EventEmitter=require(_0x1d10('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x1d10('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1d10('0x2')](0x0);var events={'afterCreate':_0x1d10('0x3'),'afterUpdate':_0x1d10('0x4'),'afterDestroy':_0x1d10('0x5')};function emitEvent(_0x25b425){return function(_0x12c320,_0x1e83e0,_0x5c5c42){FaxMessageEvents[_0x1d10('0x6')](_0x25b425+':'+_0x12c320['id'],_0x12c320);FaxMessageEvents[_0x1d10('0x6')](_0x25b425,_0x12c320);_0x5c5c42(null);};}for(var e in events){if(events[_0x1d10('0x7')](e)){var event=events[e];FaxMessage[_0x1d10('0x8')](e,emitEvent(event));}}module[_0x1d10('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 36bfa9a..01411fa 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 _0x88dc=['models','get','direction','toLowerCase','out','secret','isNil','FaxInteraction','findOne','FaxInteractionId','createdAt','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0x88dc,0x1e1));var _0xc88d=function(_0x59fd63,_0x35f1dc){_0x59fd63=_0x59fd63-0x0;var _0x3243df=_0x88dc[_0x59fd63];return _0x3243df;};'use strict';var _=require(_0xc88d('0x0'));var util=require(_0xc88d('0x1'));var logger=require(_0xc88d('0x2'))('api');var moment=require(_0xc88d('0x3'));var BPromise=require(_0xc88d('0x4'));var rp=require(_0xc88d('0x5'));var fs=require('fs');var path=require(_0xc88d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0xc88d('0x7')]=function(_0x5da15b,_0x5f010d){return _0x5da15b[_0xc88d('0x8')](_0xc88d('0x9'),attributes,{'tableName':_0xc88d('0xa'),'paranoid':![],'indexes':[{'name':_0xc88d('0xb'),'fields':['body'],'type':_0xc88d('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x30043a,_0x147d53,_0x57023e){var _0x44f530=_0x5da15b[_0xc88d('0xd')];var _0xe57702=_0x30043a[_0xc88d('0xe')]({'plain':!![]});if(_0xe57702[_0xc88d('0xf')][_0xc88d('0x10')]()==='in'||_0xe57702['direction'][_0xc88d('0x10')]()===_0xc88d('0x11')&&!_0xe57702[_0xc88d('0x12')]&&!_[_0xc88d('0x13')](_0xe57702['UserId'])){_0x44f530[_0xc88d('0x14')][_0xc88d('0x15')]({'where':{'id':_0xe57702[_0xc88d('0x16')]}})['then'](function(_0x5970b7){if(_0x5970b7){_0x5970b7['update']({'lastMsgAt':_0xe57702[_0xc88d('0x17')],'lastMsgDirection':_0xe57702[_0xc88d('0xf')][_0xc88d('0x10')]()});}})['catch'](function(_0x38b45e){console['error'](_0x38b45e);});}_0x57023e();}},'charset':_0xc88d('0x18'),'collate':_0xc88d('0x19')});}; \ No newline at end of file +var _0x179b=['FULLTEXT','models','direction','toLowerCase','out','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','exports','define','FaxMessage','fax_messages','fti_fax_messages','body'];(function(_0x263452,_0x513079){var _0x2796c2=function(_0x5d1e13){while(--_0x5d1e13){_0x263452['push'](_0x263452['shift']());}};_0x2796c2(++_0x513079);}(_0x179b,0x1f0));var _0xb179=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x179b[_0x1ed116];return _0x574066;};'use strict';var _=require(_0xb179('0x0'));var util=require(_0xb179('0x1'));var logger=require('../../config/logger')(_0xb179('0x2'));var moment=require(_0xb179('0x3'));var BPromise=require(_0xb179('0x4'));var rp=require(_0xb179('0x5'));var fs=require('fs');var path=require(_0xb179('0x6'));var rimraf=require(_0xb179('0x7'));var config=require('../../config/environment');var attributes=require('./faxMessage.attributes');module[_0xb179('0x8')]=function(_0x30cc0d,_0x4a5d76){return _0x30cc0d[_0xb179('0x9')](_0xb179('0xa'),attributes,{'tableName':_0xb179('0xb'),'paranoid':![],'indexes':[{'name':_0xb179('0xc'),'fields':[_0xb179('0xd')],'type':_0xb179('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x58ed8f,_0x35732b,_0x1a4589){var _0x25ab38=_0x30cc0d[_0xb179('0xf')];var _0x56b07b=_0x58ed8f['get']({'plain':!![]});if(_0x56b07b[_0xb179('0x10')]['toLowerCase']()==='in'||_0x56b07b[_0xb179('0x10')][_0xb179('0x11')]()===_0xb179('0x12')&&!_0x56b07b['secret']&&!_[_0xb179('0x13')](_0x56b07b[_0xb179('0x14')])){_0x25ab38[_0xb179('0x15')][_0xb179('0x16')]({'where':{'id':_0x56b07b[_0xb179('0x17')]}})[_0xb179('0x18')](function(_0x557b29){if(_0x557b29){_0x557b29['update']({'lastMsgAt':_0x56b07b[_0xb179('0x19')],'lastMsgDirection':_0x56b07b[_0xb179('0x10')][_0xb179('0x11')]()});}})[_0xb179('0x1a')](function(_0x3c31e2){console[_0xb179('0x1b')](_0x3c31e2);});}_0x1a4589();}},'charset':_0xb179('0x1c'),'collate':_0xb179('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index e8bba37..b9d5150 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 _0x207c=['result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','UpdateFaxMessage','attributes','limit','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message'];(function(_0x3b05fb,_0x4a83fe){var _0xebb426=function(_0x20bae0){while(--_0x20bae0){_0x3b05fb['push'](_0x3b05fb['shift']());}};_0xebb426(++_0x4a83fe);}(_0x207c,0x1e8));var _0xc207=function(_0x109db8,_0xf0e481){_0x109db8=_0x109db8-0x0;var _0x3448f7=_0x207c[_0x109db8];return _0x3448f7;};'use strict';var _=require('lodash');var util=require(_0xc207('0x0'));var moment=require(_0xc207('0x1'));var BPromise=require(_0xc207('0x2'));var rs=require(_0xc207('0x3'));var fs=require('fs');var Redis=require(_0xc207('0x4'));var db=require(_0xc207('0x5'))['db'];var utils=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc207('0x8')]({'port':0x232a});config[_0xc207('0x9')]=_[_0xc207('0xa')](config['redis'],{'host':_0xc207('0xb'),'port':0x18eb});var socket=require(_0xc207('0xc'))(new Redis(config[_0xc207('0x9')]));require('./faxMessage.socket')[_0xc207('0xd')](socket);function respondWithRpcPromise(_0x817576,_0x216e14,_0x13ec41){return new BPromise(function(_0x201162,_0x347549){return client['request'](_0x817576,_0x13ec41)['then'](function(_0x5b556f){logger[_0xc207('0xe')]('FaxMessage,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'));logger[_0xc207('0x10')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x216e14,_0xc207('0xf'),JSON[_0xc207('0x11')](_0x5b556f));if(_0x5b556f[_0xc207('0x12')]){if(_0x5b556f[_0xc207('0x12')][_0xc207('0x13')]===0x1f4){logger['error'](_0xc207('0x14'),_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x347549(_0x5b556f[_0xc207('0x12')]['message']);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x216e14,_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);return _0x201162(_0x5b556f[_0xc207('0x12')][_0xc207('0x15')]);}else{logger['info'](_0xc207('0x14'),_0x216e14,_0xc207('0xf'));_0x201162(_0x5b556f[_0xc207('0x16')]['message']);}})[_0xc207('0x17')](function(_0x488cc0){logger[_0xc207('0x12')](_0xc207('0x14'),_0x216e14,_0x488cc0);_0x347549(_0x488cc0);});});}exports[_0xc207('0x18')]=function(_0x461f6a){var _0xce0770=this;return new Promise(function(_0x2caec5,_0x35c0b0){return db[_0xc207('0x19')][_0xc207('0x1a')](_0x461f6a[_0xc207('0x1b')],{'raw':_0x461f6a[_0xc207('0x1c')]?_0x461f6a[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x163b36){logger['info'](_0xc207('0x18'),_0x461f6a);logger[_0xc207('0x10')](_0xc207('0x18'),_0x461f6a,JSON[_0xc207('0x11')](_0x163b36));_0x2caec5(_0x163b36);})[_0xc207('0x17')](function(_0xd209ac){logger[_0xc207('0x12')](_0xc207('0x18'),_0xd209ac[_0xc207('0x15')],_0x461f6a);_0x35c0b0(_0xce0770[_0xc207('0x12')](0x1f4,_0xd209ac[_0xc207('0x15')]));});});};exports[_0xc207('0x1e')]=function(_0x3f738e){var _0x138970=this;return new Promise(function(_0x1445d3,_0x56a066){return db[_0xc207('0x19')]['update'](_0x3f738e['body'],{'raw':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')]['where']||null:null,'attributes':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x1f')]||null:null,'limit':_0x3f738e[_0xc207('0x1c')]?_0x3f738e[_0xc207('0x1c')][_0xc207('0x20')]||null:null})[_0xc207('0x21')](function(_0x27bc72){logger[_0xc207('0xe')](_0xc207('0x1e'),_0x3f738e);logger[_0xc207('0x10')](_0xc207('0x1e'),_0x3f738e,JSON[_0xc207('0x11')](_0x27bc72));_0x1445d3(_0x27bc72);})['catch'](function(_0x1cc799){logger[_0xc207('0x12')](_0xc207('0x1e'),_0x1cc799[_0xc207('0x15')],_0x3f738e);_0x56a066(_0x138970[_0xc207('0x12')](0x1f4,_0x1cc799[_0xc207('0x15')]));});});}; \ No newline at end of file +var _0x9f62=['util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','request','info','request\x20sent','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','CreateFaxMessage','FaxMessage','body','raw','then','debug','catch','UpdateFaxMessage','update','options','where','attributes','limit'];(function(_0x1c9d2e,_0x3caac7){var _0x6f70c7=function(_0xbf9b5c){while(--_0xbf9b5c){_0x1c9d2e['push'](_0x1c9d2e['shift']());}};_0x6f70c7(++_0x3caac7);}(_0x9f62,0x154));var _0x29f6=function(_0x110305,_0x7ffb67){_0x110305=_0x110305-0x0;var _0x276b5c=_0x9f62[_0x110305];return _0x276b5c;};'use strict';var _=require('lodash');var util=require(_0x29f6('0x0'));var moment=require('moment');var BPromise=require(_0x29f6('0x1'));var rs=require(_0x29f6('0x2'));var fs=require('fs');var Redis=require(_0x29f6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x29f6('0x4'))(_0x29f6('0x5'));var config=require(_0x29f6('0x6'));var jayson=require(_0x29f6('0x7'));var client=jayson['client'][_0x29f6('0x8')]({'port':0x232a});config[_0x29f6('0x9')]=_[_0x29f6('0xa')](config[_0x29f6('0x9')],{'host':_0x29f6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0xe25841,_0x44db16,_0x4fb455){return new BPromise(function(_0x5a0724,_0x29b3f5){return client[_0x29f6('0xc')](_0xe25841,_0x4fb455)['then'](function(_0x17b69c){logger[_0x29f6('0xd')]('FaxMessage,\x20%s,\x20%s',_0x44db16,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'),JSON[_0x29f6('0xf')](_0x17b69c));if(_0x17b69c[_0x29f6('0x10')]){if(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x11')]===0x1f4){logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x29b3f5(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}logger[_0x29f6('0x10')](_0x29f6('0x12'),_0x44db16,_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);return _0x5a0724(_0x17b69c[_0x29f6('0x10')][_0x29f6('0x13')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x44db16,_0x29f6('0xe'));_0x5a0724(_0x17b69c[_0x29f6('0x14')][_0x29f6('0x13')]);}})['catch'](function(_0xcb90){logger[_0x29f6('0x10')]('FaxMessage,\x20%s,\x20%s',_0x44db16,_0xcb90);_0x29b3f5(_0xcb90);});});}exports[_0x29f6('0x15')]=function(_0x3e81af){var _0x42a8fa=this;return new Promise(function(_0x41b9f0,_0xb6e7a9){return db[_0x29f6('0x16')]['create'](_0x3e81af[_0x29f6('0x17')],{'raw':_0x3e81af['options']?_0x3e81af['options'][_0x29f6('0x18')]===undefined?!![]:![]:!![]})[_0x29f6('0x19')](function(_0x39c6b3){logger[_0x29f6('0xd')]('CreateFaxMessage',_0x3e81af);logger[_0x29f6('0x1a')]('CreateFaxMessage',_0x3e81af,JSON[_0x29f6('0xf')](_0x39c6b3));_0x41b9f0(_0x39c6b3);})[_0x29f6('0x1b')](function(_0x4200cc){logger[_0x29f6('0x10')]('CreateFaxMessage',_0x4200cc[_0x29f6('0x13')],_0x3e81af);_0xb6e7a9(_0x42a8fa[_0x29f6('0x10')](0x1f4,_0x4200cc['message']));});});};exports[_0x29f6('0x1c')]=function(_0x45f792){var _0x2519ac=this;return new Promise(function(_0x342038,_0x84ccb7){return db[_0x29f6('0x16')][_0x29f6('0x1d')](_0x45f792['body'],{'raw':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x1f')]||null:null,'attributes':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x20')]||null:null,'limit':_0x45f792[_0x29f6('0x1e')]?_0x45f792[_0x29f6('0x1e')][_0x29f6('0x21')]||null:null})[_0x29f6('0x19')](function(_0x304c28){logger[_0x29f6('0xd')](_0x29f6('0x1c'),_0x45f792);logger[_0x29f6('0x1a')]('UpdateFaxMessage',_0x45f792,JSON['stringify'](_0x304c28));_0x342038(_0x304c28);})[_0x29f6('0x1b')](function(_0x489897){logger[_0x29f6('0x10')](_0x29f6('0x1c'),_0x489897[_0x29f6('0x13')],_0x45f792);_0x84ccb7(_0x2519ac[_0x29f6('0x10')](0x1f4,_0x489897['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index a2989ab..0d252c8 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 _0xe938=['remove','update','removeListener','length','faxMessage:','./faxMessage.events'];(function(_0x59606e,_0x429521){var _0x19e449=function(_0x1a0483){while(--_0x1a0483){_0x59606e['push'](_0x59606e['shift']());}};_0x19e449(++_0x429521);}(_0xe938,0x173));var _0x8e93=function(_0x706ff3,_0x4b1796){_0x706ff3=_0x706ff3-0x0;var _0x3652f5=_0xe938[_0x706ff3];return _0x3652f5;};'use strict';var FaxMessageEvents=require(_0x8e93('0x0'));var events=['save',_0x8e93('0x1'),_0x8e93('0x2')];function createListener(_0x443310,_0x647952){return function(_0x5603e9){_0x647952['emit'](_0x443310,_0x5603e9);};}function removeListener(_0x2c3068,_0x3aabeb){return function(){FaxMessageEvents[_0x8e93('0x3')](_0x2c3068,_0x3aabeb);};}exports['register']=function(_0x59055e){for(var _0x38d2fa=0x0,_0x6ac803=events[_0x8e93('0x4')];_0x38d2fa<_0x6ac803;_0x38d2fa++){var _0x4f3a82=events[_0x38d2fa];var _0x24c80d=createListener(_0x8e93('0x5')+_0x4f3a82,_0x59055e);FaxMessageEvents['on'](_0x4f3a82,_0x24c80d);}}; \ No newline at end of file +var _0x3824=['register','length','faxMessage:','./faxMessage.events','remove','update','removeListener'];(function(_0x3fa59c,_0x2302f9){var _0x239a2c=function(_0x410d0f){while(--_0x410d0f){_0x3fa59c['push'](_0x3fa59c['shift']());}};_0x239a2c(++_0x2302f9);}(_0x3824,0x65));var _0x4382=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0x3824[_0x5a6644];return _0x3a2a5d;};'use strict';var FaxMessageEvents=require(_0x4382('0x0'));var events=['save',_0x4382('0x1'),_0x4382('0x2')];function createListener(_0x384497,_0x55f6a2){return function(_0x5e3ee3){_0x55f6a2['emit'](_0x384497,_0x5e3ee3);};}function removeListener(_0x3d9e3c,_0x573d25){return function(){FaxMessageEvents[_0x4382('0x3')](_0x3d9e3c,_0x573d25);};}exports[_0x4382('0x4')]=function(_0x5bb0e1){for(var _0x88ca87=0x0,_0x25abcc=events[_0x4382('0x5')];_0x88ca87<_0x25abcc;_0x88ca87++){var _0x3e3e3c=events[_0x88ca87];var _0x170b47=createListener(_0x4382('0x6')+_0x3e3e3c,_0x5bb0e1);FaxMessageEvents['on'](_0x3e3e3c,_0x170b47);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 58e8494..f86a299 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 _0xa571=['download','post','tracked','fax','put','/:id/accept','accept','/:id/reject','reject','delete','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/download'];(function(_0x1c5e8d,_0x149ded){var _0x10046e=function(_0x53f67a){while(--_0x53f67a){_0x1c5e8d['push'](_0x1c5e8d['shift']());}};_0x10046e(++_0x149ded);}(_0xa571,0x107));var _0x1a57=function(_0x4692a1,_0x41f54f){_0x4692a1=_0x4692a1-0x0;var _0x128700=_0xa571[_0x4692a1];return _0x128700;};'use strict';var multer=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var path=require(_0x1a57('0x2'));var timeout=require(_0x1a57('0x3'));var express=require('express');var router=express[_0x1a57('0x4')]();var fs_extra=require(_0x1a57('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1a57('0x6'));var controller=require('./faxMessage.controller');router[_0x1a57('0x7')]('/',auth[_0x1a57('0x8')](),controller[_0x1a57('0x9')]);router[_0x1a57('0x7')](_0x1a57('0xa'),auth[_0x1a57('0x8')](),controller['describe']);router[_0x1a57('0x7')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['show']);router[_0x1a57('0x7')](_0x1a57('0xc'),auth[_0x1a57('0x8')](),controller[_0x1a57('0xd')]);router[_0x1a57('0xe')]('/',auth[_0x1a57('0x8')](),interaction[_0x1a57('0xf')](_0x1a57('0x10'),'faxmessage:create'),controller['create']);router[_0x1a57('0x11')](_0x1a57('0xb'),auth[_0x1a57('0x8')](),controller['update']);router[_0x1a57('0x11')](_0x1a57('0x12'),auth['isAuthenticated'](),controller[_0x1a57('0x13')]);router['put'](_0x1a57('0x14'),auth[_0x1a57('0x8')](),controller[_0x1a57('0x15')]);router[_0x1a57('0x16')]('/:id',auth[_0x1a57('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0102=['show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','/:id','update','accept','/:id/reject','reject','exports','util','path','connect-timeout','express','./faxMessage.controller','get','isAuthenticated','index','/describe','describe'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x0102,0x186));var _0x2010=function(_0x4b3f93,_0x2ff713){_0x4b3f93=_0x4b3f93-0x0;var _0x1153ad=_0x0102[_0x4b3f93];return _0x1153ad;};'use strict';var multer=require('multer');var util=require(_0x2010('0x0'));var path=require(_0x2010('0x1'));var timeout=require(_0x2010('0x2'));var express=require(_0x2010('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('../../config/environment');var controller=require(_0x2010('0x4'));router[_0x2010('0x5')]('/',auth[_0x2010('0x6')](),controller[_0x2010('0x7')]);router['get'](_0x2010('0x8'),auth['isAuthenticated'](),controller[_0x2010('0x9')]);router[_0x2010('0x5')]('/:id',auth[_0x2010('0x6')](),controller[_0x2010('0xa')]);router[_0x2010('0x5')](_0x2010('0xb'),auth[_0x2010('0x6')](),controller[_0x2010('0xc')]);router[_0x2010('0xd')]('/',auth[_0x2010('0x6')](),interaction[_0x2010('0xe')](_0x2010('0xf'),_0x2010('0x10')),controller[_0x2010('0x11')]);router[_0x2010('0x12')](_0x2010('0x13'),auth[_0x2010('0x6')](),controller[_0x2010('0x14')]);router['put']('/:id/accept',auth[_0x2010('0x6')](),controller[_0x2010('0x15')]);router[_0x2010('0x12')](_0x2010('0x16'),auth[_0x2010('0x6')](),controller[_0x2010('0x17')]);router['delete'](_0x2010('0x13'),auth[_0x2010('0x6')](),controller['destroy']);module[_0x2010('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index ae19d48..c2f0523 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 _0xfa00=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x15ad02,_0x56ace9){var _0x3c87da=function(_0x32ced0){while(--_0x32ced0){_0x15ad02['push'](_0x15ad02['shift']());}};_0x3c87da(++_0x56ace9);}(_0xfa00,0x129));var _0x0fa0=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xfa00[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x0fa0('0x0'));module[_0x0fa0('0x1')]={'name':{'type':Sequelize[_0x0fa0('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0fa0('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0fa0('0x4')](_0x0fa0('0x5'),_0x0fa0('0x6'),_0x0fa0('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd3ef=['ENUM','beepall','INTEGER','sequelize','STRING','name'];(function(_0x1e0b23,_0x534b27){var _0x2c6972=function(_0x22f5d6){while(--_0x22f5d6){_0x1e0b23['push'](_0x1e0b23['shift']());}};_0x2c6972(++_0x534b27);}(_0xd3ef,0x69));var _0xfd3e=function(_0x2e9afc,_0x434e1b){_0x2e9afc=_0x2e9afc-0x0;var _0x2b6f3d=_0xd3ef[_0x2e9afc];return _0x2b6f3d;};'use strict';var Sequelize=require(_0xfd3e('0x0'));module['exports']={'name':{'type':Sequelize[_0xfd3e('0x1')],'unique':_0xfd3e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfd3e('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfd3e('0x3')]('rrmemory',_0xfd3e('0x4'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xfd3e('0x5')],'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 13dbd25..da5b063 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 _0xcd2f=['userFaxQueue:remove','omit','spread','userFaxQueue:save','isArray','getAgents','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','then','get','FaxQueues','UserProfileResource','end','error','name','send','FaxQueue','rawAttributes','fieldName','key','where','include','query','rows','show','params','model','keys','filters','intersection','attributes','fields','includeAll','options','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserFaxQueue','length','hasOwnProperty','nolimit','order','sort','filter','merge','map','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','faxPause','getTeams','findOne','Team','pick','addTeams','ids','findAll','User','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','from','team_has_fax_queues','join','user_has_teams','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','all','union','compact','value','isEmpty','removeAgents'];(function(_0x5c4a27,_0xd54db9){var _0x1bfe25=function(_0x2a387c){while(--_0x2a387c){_0x5c4a27['push'](_0x5c4a27['shift']());}};_0x1bfe25(++_0xd54db9);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xcd2f[_0x2aec52];return _0x3b8835;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var squel=require(_0xfcd2('0x0'));var Redis=require(_0xfcd2('0x1'));var qs=require(_0xfcd2('0x2'));var logger=require(_0xfcd2('0x3'))(_0xfcd2('0x4'));var config=require(_0xfcd2('0x5'));var db=require(_0xfcd2('0x6'))['db'];config[_0xfcd2('0x7')]=_['defaults'](config[_0xfcd2('0x7')],{'host':_0xfcd2('0x8'),'port':0x18eb});var socket=require(_0xfcd2('0x9'))(new Redis(config[_0xfcd2('0x7')]));require(_0xfcd2('0xa'))[_0xfcd2('0xb')](socket);function respondWithStatusCode(_0xae2219,_0x46c99b){_0x46c99b=_0x46c99b||0xcc;return function(_0x178eb1){if(_0x178eb1){return _0xae2219[_0xfcd2('0xc')](_0x46c99b);}return _0xae2219[_0xfcd2('0xd')](_0x46c99b)['end']();};}function respondWithResult(_0x5994cf,_0x18fa4d){_0x18fa4d=_0x18fa4d||0xc8;return function(_0x24cd5d){if(_0x24cd5d){return _0x5994cf[_0xfcd2('0xd')](_0x18fa4d)[_0xfcd2('0xe')](_0x24cd5d);}};}function respondWithFilteredResult(_0x53777e,_0x4fb319){return function(_0x4791e9){if(_0x4791e9){var _0x5c4994=typeof _0x4fb319['offset']===_0xfcd2('0xf')&&typeof _0x4fb319[_0xfcd2('0x10')]==='undefined';var _0x12a537=_0x4791e9[_0xfcd2('0x11')];var _0x5ad180=_0x5c4994?0x0:_0x4fb319['offset'];var _0x2825df=_0x5c4994?_0x4791e9[_0xfcd2('0x11')]:_0x4fb319[_0xfcd2('0x12')]+_0x4fb319[_0xfcd2('0x10')];var _0x428cf3;if(_0x2825df>=_0x12a537){_0x2825df=_0x12a537;_0x428cf3=0xc8;}else{_0x428cf3=0xce;}_0x53777e['status'](_0x428cf3);return _0x53777e[_0xfcd2('0x13')](_0xfcd2('0x14'),_0x5ad180+'-'+_0x2825df+'/'+_0x12a537)[_0xfcd2('0xe')](_0x4791e9);}return null;};}function saveUpdates(_0x34aa38){return function(_0x38a776){if(_0x38a776){return _0x38a776[_0xfcd2('0x15')](_0x34aa38)['then'](function(_0xba3186){return _0xba3186;});}return null;};}function removeEntity(_0x268e00){return function(_0x32607c){if(_0x32607c){return _0x32607c[_0xfcd2('0x16')]()[_0xfcd2('0x17')](function(){var _0x17edd6=_0x32607c[_0xfcd2('0x18')]({'plain':!![]});var _0x25371f=_0xfcd2('0x19');return db[_0xfcd2('0x1a')][_0xfcd2('0x16')]({'where':{'type':_0x25371f,'resourceId':_0x17edd6['id']}})[_0xfcd2('0x17')](function(){return _0x32607c;});})['then'](function(){_0x268e00[_0xfcd2('0xd')](0xcc)[_0xfcd2('0x1b')]();});}};}function handleEntityNotFound(_0x25e801){return function(_0x457099){if(!_0x457099){_0x25e801[_0xfcd2('0xc')](0x194);}return _0x457099;};}function handleError(_0x37dafa,_0x19ea4a){_0x19ea4a=_0x19ea4a||0x1f4;return function(_0x40ae55){logger[_0xfcd2('0x1c')](_0x40ae55['stack']);if(_0x40ae55[_0xfcd2('0x1d')]){delete _0x40ae55['name'];}_0x37dafa[_0xfcd2('0xd')](_0x19ea4a)[_0xfcd2('0x1e')](_0x40ae55);};}exports['index']=function(_0x567436,_0x187ae5){var _0xe7fde9={};var _0x193dc3={'count':0x0,'rows':[]};var _0x2b0364=_['map'](db[_0xfcd2('0x1f')][_0xfcd2('0x20')],function(_0x13e447){return{'name':_0x13e447[_0xfcd2('0x21')],'type':_0x13e447['type'][_0xfcd2('0x22')]};});_0xe7fde9=qs['getOptions'](_0x2b0364,_0x567436);var _0x9cf49a={'where':_0xe7fde9[_0xfcd2('0x23')]};return db['FaxQueue'][_0xfcd2('0x11')](_0x9cf49a)[_0xfcd2('0x17')](function(_0x41ecc9){_0x193dc3['count']=_0x41ecc9;_0xe7fde9[_0xfcd2('0x24')]=qs[_0xfcd2('0x24')](_0x567436[_0xfcd2('0x25')]);return db['FaxQueue']['findAll'](_0xe7fde9);})['then'](function(_0xfe01e3){_0x193dc3[_0xfcd2('0x26')]=_0xfe01e3;return _0x193dc3;})[_0xfcd2('0x17')](respondWithFilteredResult(_0x187ae5,_0xe7fde9))['catch'](handleError(_0x187ae5,null));};exports[_0xfcd2('0x27')]=function(_0x3d1273,_0x2934b1){var _0x3e9768={'raw':!![],'where':{'id':_0x3d1273[_0xfcd2('0x28')]['id']}},_0xc5d81e={};_0xc5d81e[_0xfcd2('0x29')]=_['keys'](db['FaxQueue'][_0xfcd2('0x20')]);_0xc5d81e['query']=_[_0xfcd2('0x2a')](_0x3d1273[_0xfcd2('0x25')]);_0xc5d81e[_0xfcd2('0x2b')]=_[_0xfcd2('0x2c')](_0xc5d81e[_0xfcd2('0x29')],_0xc5d81e[_0xfcd2('0x25')]);_0x3e9768[_0xfcd2('0x2d')]=_[_0xfcd2('0x2c')](_0xc5d81e[_0xfcd2('0x29')],qs['fields'](_0x3d1273[_0xfcd2('0x25')][_0xfcd2('0x2e')]));_0x3e9768[_0xfcd2('0x2d')]=_0x3e9768[_0xfcd2('0x2d')]['length']?_0x3e9768['attributes']:_0xc5d81e[_0xfcd2('0x29')];if(_0x3d1273[_0xfcd2('0x25')][_0xfcd2('0x2f')]){_0x3e9768[_0xfcd2('0x24')]=[{'all':!![]}];}_0x3e9768=_['merge']({},_0x3e9768,_0x3d1273[_0xfcd2('0x30')]);return db[_0xfcd2('0x1f')]['find'](_0x3e9768)[_0xfcd2('0x17')](handleEntityNotFound(_0x2934b1,null))['then'](respondWithResult(_0x2934b1,null))[_0xfcd2('0x31')](handleError(_0x2934b1,null));};exports['create']=function(_0x45c9a3,_0x3a7d19){return db[_0xfcd2('0x1f')]['create'](_0x45c9a3[_0xfcd2('0x32')],{})[_0xfcd2('0x17')](function(_0x31f0c0){var _0x89e532=_0x45c9a3[_0xfcd2('0x33')][_0xfcd2('0x18')]({'plain':!![]});if(!_0x89e532)throw new Error(_0xfcd2('0x34'));if(_0x89e532[_0xfcd2('0x35')]===_0xfcd2('0x33')){var _0x293db3=_0x31f0c0[_0xfcd2('0x18')]({'plain':!![]});var _0x180e52=_0xfcd2('0x19');return db[_0xfcd2('0x36')][_0xfcd2('0x37')]({'where':{'name':_0x180e52,'userProfileId':_0x89e532[_0xfcd2('0x38')]},'raw':!![]})[_0xfcd2('0x17')](function(_0x47d6b6){if(_0x47d6b6&&_0x47d6b6[_0xfcd2('0x39')]===0x0){return db['UserProfileResource'][_0xfcd2('0x3a')]({'name':_0x293db3[_0xfcd2('0x1d')],'resourceId':_0x293db3['id'],'type':_0x47d6b6[_0xfcd2('0x1d')],'sectionId':_0x47d6b6['id']},{})[_0xfcd2('0x17')](function(){return _0x31f0c0;});}else{return _0x31f0c0;}})['catch'](function(_0x20f985){logger[_0xfcd2('0x1c')](_0xfcd2('0x3b'),_0x20f985);throw _0x20f985;});}return _0x31f0c0;})[_0xfcd2('0x17')](respondWithResult(_0x3a7d19,0xc9))[_0xfcd2('0x31')](handleError(_0x3a7d19,null));};exports[_0xfcd2('0x15')]=function(_0x20c15b,_0x34ffd6){if(_0x20c15b['body']['id']){delete _0x20c15b[_0xfcd2('0x32')]['id'];}return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x20c15b[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x34ffd6,null))['then'](saveUpdates(_0x20c15b[_0xfcd2('0x32')],null))[_0xfcd2('0x17')](respondWithResult(_0x34ffd6,null))[_0xfcd2('0x31')](handleError(_0x34ffd6,null));};exports[_0xfcd2('0x16')]=function(_0x5ae388,_0x318fce){return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x5ae388[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x318fce,null))[_0xfcd2('0x17')](removeEntity(_0x318fce,null))[_0xfcd2('0x31')](handleError(_0x318fce,null));};exports[_0xfcd2('0x3c')]=function(_0x391f54,_0x5895c7){return db['FaxQueue']['describe']()[_0xfcd2('0x17')](respondWithResult(_0x5895c7,null))[_0xfcd2('0x31')](handleError(_0x5895c7,null));};exports[_0xfcd2('0x3d')]=function(_0x3b4b1c,_0x4e6647){var _0x401ce1={'raw':!![],'where':{}},_0x2d78b9={},_0x11e68a;return db[_0xfcd2('0x1f')]['findOne']({'where':{'id':_0x3b4b1c[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x4e6647,null))[_0xfcd2('0x17')](function(_0x5b7954){if(_0x5b7954){_0x11e68a=_0x5b7954[_0xfcd2('0x18')]({'plain':!![]});_0x2d78b9[_0xfcd2('0x29')]=_['keys'](db[_0xfcd2('0x3e')]['rawAttributes']);_0x2d78b9['query']=_[_0xfcd2('0x2a')](_0x3b4b1c[_0xfcd2('0x25')]);_0x2d78b9[_0xfcd2('0x2b')]=_[_0xfcd2('0x2c')](_0x2d78b9['model'],_0x2d78b9[_0xfcd2('0x25')]);_0x401ce1[_0xfcd2('0x2d')]=_[_0xfcd2('0x2c')](_0x2d78b9['model'],qs[_0xfcd2('0x2e')](_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x2e')]));_0x401ce1[_0xfcd2('0x2d')]=_0x401ce1[_0xfcd2('0x2d')][_0xfcd2('0x3f')]?_0x401ce1[_0xfcd2('0x2d')]:_0x2d78b9[_0xfcd2('0x29')];if(!_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x40')](_0xfcd2('0x41'))){_0x401ce1[_0xfcd2('0x10')]=qs[_0xfcd2('0x10')](_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x10')]);_0x401ce1[_0xfcd2('0x12')]=qs['offset'](_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x12')]);}_0x401ce1[_0xfcd2('0x42')]=qs[_0xfcd2('0x43')](_0x3b4b1c['query'][_0xfcd2('0x43')]);_0x401ce1[_0xfcd2('0x23')]=qs['filters'](_['pick'](_0x3b4b1c[_0xfcd2('0x25')],_0x2d78b9[_0xfcd2('0x2b')]));_0x401ce1[_0xfcd2('0x23')]['FaxQueueId']=_0x5b7954['id'];if(_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x44')]){_0x401ce1[_0xfcd2('0x23')]=_[_0xfcd2('0x45')](_0x401ce1['where'],{'$or':_[_0xfcd2('0x46')](_0x401ce1[_0xfcd2('0x2d')],function(_0xbd4c3f){var _0x4371e1={};_0x4371e1[_0xbd4c3f]={'$like':'%'+_0x3b4b1c[_0xfcd2('0x25')][_0xfcd2('0x44')]+'%'};return _0x4371e1;})});}_0x401ce1=_[_0xfcd2('0x45')]({},_0x401ce1,_0x3b4b1c[_0xfcd2('0x30')]);return db[_0xfcd2('0x3e')]['findAll'](_0x401ce1);}})['then'](function(_0x3e22fb){if(_0x3e22fb){return db['User'][_0xfcd2('0x47')]({'where':{'id':_['map'](_0x3e22fb,_0xfcd2('0x48')),'role':'agent'},'attributes':['id',_0xfcd2('0x1d'),'faxPause',_0xfcd2('0x49'),_0xfcd2('0x4a')]});}})[_0xfcd2('0x17')](function(_0x1455c0){if(_0x1455c0){return{'count':_0x1455c0[_0xfcd2('0x11')],'rows':_[_0xfcd2('0x46')](_0x1455c0['rows'],function(_0x1a71c1){return{'membername':_0x1a71c1[_0xfcd2('0x1d')],'UserId':_0x1a71c1['id'],'queue_name':_0x11e68a[_0xfcd2('0x1d')],'FaxQueueId':_0x11e68a['id'],'interface':util[_0xfcd2('0x4b')](_0xfcd2('0x4c'),_0xfcd2('0x4d'),_0x1a71c1['name']),'penalty':0x0,'paused':_0x1a71c1[_0xfcd2('0x4e')],'createdAt':_0x1a71c1[_0xfcd2('0x4a')],'updatedAt':_0x1a71c1[_0xfcd2('0x49')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4e6647,_0x401ce1))[_0xfcd2('0x31')](handleError(_0x4e6647,null));};exports[_0xfcd2('0x4f')]=function(_0x187bcd,_0x46a051){var _0x4bb16e={};var _0x478f15={};var _0x574885;var _0x1aeb13;return db[_0xfcd2('0x1f')][_0xfcd2('0x50')]({'where':{'id':_0x187bcd['params']['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x46a051,null))[_0xfcd2('0x17')](function(_0x3b69cb){if(_0x3b69cb){_0x574885=_0x3b69cb;_0x478f15[_0xfcd2('0x29')]=_[_0xfcd2('0x2a')](db[_0xfcd2('0x51')][_0xfcd2('0x20')]);_0x478f15['query']=_[_0xfcd2('0x2a')](_0x187bcd[_0xfcd2('0x25')]);_0x478f15[_0xfcd2('0x2b')]=_[_0xfcd2('0x2c')](_0x478f15[_0xfcd2('0x29')],_0x478f15[_0xfcd2('0x25')]);_0x4bb16e['attributes']=_[_0xfcd2('0x2c')](_0x478f15['model'],qs[_0xfcd2('0x2e')](_0x187bcd[_0xfcd2('0x25')]['fields']));_0x4bb16e[_0xfcd2('0x2d')]=_0x4bb16e[_0xfcd2('0x2d')][_0xfcd2('0x3f')]?_0x4bb16e['attributes']:_0x478f15['model'];_0x4bb16e[_0xfcd2('0x42')]=qs[_0xfcd2('0x43')](_0x187bcd['query']['sort']);_0x4bb16e['where']=qs['filters'](_[_0xfcd2('0x52')](_0x187bcd[_0xfcd2('0x25')],_0x478f15[_0xfcd2('0x2b')]));if(_0x187bcd[_0xfcd2('0x25')][_0xfcd2('0x44')]){_0x4bb16e['where']=_[_0xfcd2('0x45')](_0x4bb16e['where'],{'$or':_[_0xfcd2('0x46')](_0x4bb16e['attributes'],function(_0x48a240){var _0x2fe735={};_0x2fe735[_0x48a240]={'$like':'%'+_0x187bcd[_0xfcd2('0x25')]['filter']+'%'};return _0x2fe735;})});}_0x4bb16e=_['merge']({},_0x4bb16e,_0x187bcd[_0xfcd2('0x30')]);return _0x574885['getTeams'](_0x4bb16e);}})[_0xfcd2('0x17')](function(_0x4fb2a9){if(_0x4fb2a9){_0x1aeb13=_0x4fb2a9[_0xfcd2('0x3f')];if(!_0x187bcd[_0xfcd2('0x25')][_0xfcd2('0x40')]('nolimit')){_0x4bb16e[_0xfcd2('0x10')]=qs[_0xfcd2('0x10')](_0x187bcd['query'][_0xfcd2('0x10')]);_0x4bb16e['offset']=qs['offset'](_0x187bcd[_0xfcd2('0x25')][_0xfcd2('0x12')]);}return _0x574885['getTeams'](_0x4bb16e);}})[_0xfcd2('0x17')](function(_0x5d8278){if(_0x5d8278){return _0x5d8278?{'count':_0x1aeb13,'rows':_0x5d8278}:null;}})[_0xfcd2('0x17')](respondWithResult(_0x46a051,null))[_0xfcd2('0x31')](handleError(_0x46a051,null));};exports[_0xfcd2('0x53')]=function(_0x11b664,_0x317072){var _0x1051f7=_0x11b664[_0xfcd2('0x32')][_0xfcd2('0x54')];return db[_0xfcd2('0x51')][_0xfcd2('0x55')]({'where':{'id':_0x1051f7},'attributes':['id'],'include':[{'model':db[_0xfcd2('0x56')],'as':'Agents','attributes':['id',_0xfcd2('0x1d'),_0xfcd2('0x57'),_0xfcd2('0x58'),'interface'],'raw':!![]}]})[_0xfcd2('0x17')](function(_0x3952b4){if(_0x3952b4){var _0x3a3e95=_[_0xfcd2('0x59')](_0x3952b4,function(_0x2bbb4){var _0x586316=_0x2bbb4[_0xfcd2('0x18')]({'plain':!![]});return _0x586316[_0xfcd2('0x5a')];});return db['FaxQueue'][_0xfcd2('0x37')]({'where':{'id':_0x11b664[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](function(_0x55c929){return db[_0xfcd2('0x5b')][_0xfcd2('0x5c')](function(_0x476add){return _0x55c929[_0xfcd2('0x53')](_0x1051f7,{'transaction':_0x476add})[_0xfcd2('0x17')](function(){return BPromise[_0xfcd2('0x5d')](_0x3a3e95,function(_0x25495d){return db[_0xfcd2('0x3e')][_0xfcd2('0x5e')]({'where':{'UserId':_0x25495d['id'],'FaxQueueId':_0x11b664[_0xfcd2('0x28')]['id']},'transaction':_0x476add});});})['then'](function(){_0x3a3e95[_0xfcd2('0x5f')](function(_0x4bc6c7){socket[_0xfcd2('0x60')]('userFaxQueue:save',{'UserId':_0x4bc6c7['id'],'FaxQueueId':_0x55c929['id']});});});});});}})[_0xfcd2('0x17')](respondWithStatusCode(_0x317072,null))[_0xfcd2('0x31')](handleError(_0x317072,null));};exports[_0xfcd2('0x61')]=function(_0x470636,_0x1055bd){return db[_0xfcd2('0x51')]['findAll']({'where':{'id':_0x470636[_0xfcd2('0x25')][_0xfcd2('0x54')]},'attributes':['id'],'include':[{'model':db[_0xfcd2('0x56')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfcd2('0x17')](handleEntityNotFound(_0x1055bd,null))[_0xfcd2('0x17')](function(_0x593323){var _0x3550ad=_[_0xfcd2('0x46')](_0x593323,'id');var _0x1c0c28=[];var _0x126037=[];var _0x2603fe=squel[_0xfcd2('0x62')]();_0x2603fe[_0xfcd2('0x63')]('tq.TeamId')[_0xfcd2('0x64')](_0xfcd2('0x65'),'tq')[_0xfcd2('0x66')](_0xfcd2('0x67'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfcd2('0x23')]('FaxQueueId\x20=\x20?',_0x470636[_0xfcd2('0x28')]['id']);for(var _0x517017=0x0;_0x517017<_0x593323[_0xfcd2('0x3f')];_0x517017+=0x1){let _0x398f38=_0x593323[_0x517017];for(var _0x233f00=0x0;_0x233f00<_0x398f38[_0xfcd2('0x5a')][_0xfcd2('0x3f')];_0x233f00+=0x1){let _0x11428c=_0x398f38[_0xfcd2('0x5a')][_0x233f00];var _0x5211b3=_0x2603fe['clone']();_0x5211b3[_0xfcd2('0x23')](_0xfcd2('0x68'),_0x11428c['id']);_0x126037['push'](db[_0xfcd2('0x5b')][_0xfcd2('0x25')](_0x5211b3[_0xfcd2('0x69')](),{'type':db['sequelize'][_0xfcd2('0x6a')]['SELECT']})[_0xfcd2('0x17')](function(_0x5a8ffc){if(_0x5a8ffc[_0xfcd2('0x3f')]===0x1){return _0x11428c['id'];}else{var _0x7e5368=_['every'](_[_0xfcd2('0x46')](_0x5a8ffc,_0xfcd2('0x6b')),function(_0x752a93){return _[_0xfcd2('0x6c')](_0x3550ad,_0x752a93);});if(_0x7e5368){return _0x11428c['id'];}}}));}}return BPromise[_0xfcd2('0x6d')](_0x126037)[_0xfcd2('0x17')](function(_0x5cdc84){_0x1c0c28=_(_0x1c0c28)[_0xfcd2('0x6e')](_0x5cdc84)[_0xfcd2('0x6f')]()[_0xfcd2('0x70')]();return db['FaxQueue'][_0xfcd2('0x37')]({'where':{'id':_0x470636[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](function(_0xdf68b5){return db['sequelize'][_0xfcd2('0x5c')](function(_0x9e5deb){return _0xdf68b5[_0xfcd2('0x61')](_0x470636[_0xfcd2('0x25')][_0xfcd2('0x54')],{'transaction':_0x9e5deb})[_0xfcd2('0x17')](function(){if(!_[_0xfcd2('0x71')](_0x1c0c28)){return _0xdf68b5[_0xfcd2('0x72')](_0x1c0c28,{'transaction':_0x9e5deb});}})[_0xfcd2('0x17')](function(){_0x1c0c28['forEach'](function(_0x3b93bb){socket['emit'](_0xfcd2('0x73'),{'UserId':_0x3b93bb,'FaxQueueId':_0xdf68b5['id']});});});});});});})['then'](respondWithStatusCode(_0x1055bd,null))[_0xfcd2('0x31')](handleError(_0x1055bd,null));};exports['addAgents']=function(_0x181274,_0x555f7a){return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x181274[_0xfcd2('0x28')]['id']}})['then'](handleEntityNotFound(_0x555f7a,null))[_0xfcd2('0x17')](function(_0x5d4f34){if(_0x5d4f34){return _0x5d4f34['addAgents'](_0x181274[_0xfcd2('0x32')][_0xfcd2('0x54')],_[_0xfcd2('0x74')](_0x181274[_0xfcd2('0x32')],['ids','id'])||{})[_0xfcd2('0x75')](function(_0x553c83){for(var _0x4af5ee=0x0;_0x4af5ee<_0x181274[_0xfcd2('0x32')][_0xfcd2('0x54')][_0xfcd2('0x3f')];_0x4af5ee+=0x1){socket[_0xfcd2('0x60')](_0xfcd2('0x76'),{'UserId':Number(_0x181274[_0xfcd2('0x32')][_0xfcd2('0x54')][_0x4af5ee]),'FaxQueueId':Number(_0x181274[_0xfcd2('0x28')]['id'])});}return _0x553c83;});}})[_0xfcd2('0x17')](respondWithResult(_0x555f7a,null))['catch'](handleError(_0x555f7a,null));};exports[_0xfcd2('0x72')]=function(_0x3c4c35,_0x355b29){return db[_0xfcd2('0x1f')][_0xfcd2('0x37')]({'where':{'id':_0x3c4c35[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x355b29,null))['then'](function(_0x40a5b3){if(_0x40a5b3){return _0x40a5b3['removeAgents'](_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')])[_0xfcd2('0x17')](function(){if(_[_0xfcd2('0x77')](_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')])){for(var _0x11a268=0x0;_0x11a268<_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')][_0xfcd2('0x3f')];_0x11a268+=0x1){socket[_0xfcd2('0x60')](_0xfcd2('0x73'),{'UserId':Number(_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')][_0x11a268]),'FaxQueueId':Number(_0x3c4c35['params']['id'])});}}else{socket[_0xfcd2('0x60')]('userFaxQueue:remove',{'UserId':Number(_0x3c4c35[_0xfcd2('0x25')][_0xfcd2('0x54')]),'FaxQueueId':Number(_0x3c4c35['params']['id'])});}});}})[_0xfcd2('0x17')](respondWithStatusCode(_0x355b29,null))[_0xfcd2('0x31')](handleError(_0x355b29,null));};exports[_0xfcd2('0x78')]=function(_0x16b341,_0x23a74d){var _0x37ddef={};var _0x4d7374={};var _0x26c9a4;var _0x482e92;return db['FaxQueue'][_0xfcd2('0x50')]({'where':{'id':_0x16b341[_0xfcd2('0x28')]['id']}})[_0xfcd2('0x17')](handleEntityNotFound(_0x23a74d,null))[_0xfcd2('0x17')](function(_0x3c7aa2){if(_0x3c7aa2){_0x26c9a4=_0x3c7aa2;_0x4d7374[_0xfcd2('0x29')]=_[_0xfcd2('0x2a')](db['User'][_0xfcd2('0x20')]);_0x4d7374[_0xfcd2('0x25')]=_[_0xfcd2('0x2a')](_0x16b341['query']);_0x4d7374['filters']=_[_0xfcd2('0x2c')](_0x4d7374[_0xfcd2('0x29')],_0x4d7374[_0xfcd2('0x25')]);_0x37ddef[_0xfcd2('0x2d')]=_[_0xfcd2('0x2c')](_0x4d7374[_0xfcd2('0x29')],qs[_0xfcd2('0x2e')](_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x2e')]));_0x37ddef[_0xfcd2('0x2d')]=_0x37ddef['attributes'][_0xfcd2('0x3f')]?_0x37ddef[_0xfcd2('0x2d')]:_0x4d7374[_0xfcd2('0x29')];_0x37ddef[_0xfcd2('0x42')]=qs[_0xfcd2('0x43')](_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x43')]);_0x37ddef[_0xfcd2('0x23')]=qs[_0xfcd2('0x2b')](_[_0xfcd2('0x52')](_0x16b341['query'],_0x4d7374[_0xfcd2('0x2b')]));if(_0x16b341[_0xfcd2('0x25')]['filter']){_0x37ddef[_0xfcd2('0x23')]=_[_0xfcd2('0x45')](_0x37ddef[_0xfcd2('0x23')],{'$or':_[_0xfcd2('0x46')](_0x37ddef['attributes'],function(_0x234c88){var _0x37bc07={};_0x37bc07[_0x234c88]={'$like':'%'+_0x16b341[_0xfcd2('0x25')]['filter']+'%'};return _0x37bc07;})});}_0x37ddef=_[_0xfcd2('0x45')]({},_0x37ddef,_0x16b341[_0xfcd2('0x30')]);return _0x26c9a4[_0xfcd2('0x78')](_0x37ddef);}})[_0xfcd2('0x17')](function(_0x16a822){if(_0x16a822){_0x482e92=_0x16a822['length'];if(!_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x40')]('nolimit')){_0x37ddef[_0xfcd2('0x10')]=qs['limit'](_0x16b341[_0xfcd2('0x25')]['limit']);_0x37ddef[_0xfcd2('0x12')]=qs[_0xfcd2('0x12')](_0x16b341[_0xfcd2('0x25')][_0xfcd2('0x12')]);}return _0x26c9a4['getAgents'](_0x37ddef);}})['then'](function(_0x4298b8){if(_0x4298b8){return _0x4298b8?{'count':_0x482e92,'rows':_0x4298b8}:null;}})[_0xfcd2('0x17')](respondWithResult(_0x23a74d,null))['catch'](handleError(_0x23a74d,null));}; \ No newline at end of file +var _0x524e=['userFaxQueue:remove','addAgents','omit','isArray','getAgents','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','destroy','then','FaxQueues','name','send','map','FaxQueue','rawAttributes','key','getOptions','where','include','query','findAll','catch','params','model','keys','filters','intersection','fields','attributes','length','includeAll','options','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','error','update','describe','getMembers','findOne','hasOwnProperty','nolimit','order','sort','pick','FaxQueueId','filter','merge','UserFaxQueue','findAndCountAll','updatedAt','createdAt','rows','SIP','faxPause','Team','getTeams','addTeams','ids','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','findOrCreate','forEach','userFaxQueue:save','select','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','emit'];(function(_0x28bdf9,_0x2c1783){var _0x2dc752=function(_0x454133){while(--_0x454133){_0x28bdf9['push'](_0x28bdf9['shift']());}};_0x2dc752(++_0x2c1783);}(_0x524e,0x15e));var _0xe524=function(_0x1ac9d0,_0x580123){_0x1ac9d0=_0x1ac9d0-0x0;var _0x4f1a2c=_0x524e[_0x1ac9d0];return _0x4f1a2c;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0xe524('0x0'));var squel=require(_0xe524('0x1'));var Redis=require(_0xe524('0x2'));var qs=require(_0xe524('0x3'));var logger=require(_0xe524('0x4'))(_0xe524('0x5'));var config=require(_0xe524('0x6'));var db=require(_0xe524('0x7'))['db'];config[_0xe524('0x8')]=_[_0xe524('0x9')](config['redis'],{'host':_0xe524('0xa'),'port':0x18eb});var socket=require(_0xe524('0xb'))(new Redis(config[_0xe524('0x8')]));require('./faxQueue.socket')[_0xe524('0xc')](socket);function respondWithStatusCode(_0x3e4cda,_0x24114d){_0x24114d=_0x24114d||0xcc;return function(_0x1f36e5){if(_0x1f36e5){return _0x3e4cda[_0xe524('0xd')](_0x24114d);}return _0x3e4cda[_0xe524('0xe')](_0x24114d)[_0xe524('0xf')]();};}function respondWithResult(_0xb3eb9f,_0x1b75bd){_0x1b75bd=_0x1b75bd||0xc8;return function(_0x1641ec){if(_0x1641ec){return _0xb3eb9f[_0xe524('0xe')](_0x1b75bd)[_0xe524('0x10')](_0x1641ec);}};}function respondWithFilteredResult(_0x1184df,_0x2f0e86){return function(_0x1bdcee){if(_0x1bdcee){var _0x26cc77=typeof _0x2f0e86['offset']==='undefined'&&typeof _0x2f0e86[_0xe524('0x11')]===_0xe524('0x12');var _0x11adbc=_0x1bdcee[_0xe524('0x13')];var _0x20a852=_0x26cc77?0x0:_0x2f0e86['offset'];var _0x12ff75=_0x26cc77?_0x1bdcee['count']:_0x2f0e86[_0xe524('0x14')]+_0x2f0e86[_0xe524('0x11')];var _0x48165e;if(_0x12ff75>=_0x11adbc){_0x12ff75=_0x11adbc;_0x48165e=0xc8;}else{_0x48165e=0xce;}_0x1184df[_0xe524('0xe')](_0x48165e);return _0x1184df['set'](_0xe524('0x15'),_0x20a852+'-'+_0x12ff75+'/'+_0x11adbc)['json'](_0x1bdcee);}return null;};}function saveUpdates(_0x29a031){return function(_0x5f17fe){if(_0x5f17fe){return _0x5f17fe['update'](_0x29a031)['then'](function(_0x3a4027){return _0x3a4027;});}return null;};}function removeEntity(_0x4f1dfb){return function(_0x11b2a1){if(_0x11b2a1){return _0x11b2a1[_0xe524('0x16')]()[_0xe524('0x17')](function(){var _0x209d0b=_0x11b2a1['get']({'plain':!![]});var _0x1fd93a=_0xe524('0x18');return db['UserProfileResource'][_0xe524('0x16')]({'where':{'type':_0x1fd93a,'resourceId':_0x209d0b['id']}})[_0xe524('0x17')](function(){return _0x11b2a1;});})[_0xe524('0x17')](function(){_0x4f1dfb[_0xe524('0xe')](0xcc)[_0xe524('0xf')]();});}};}function handleEntityNotFound(_0x1cab6c){return function(_0xbf059b){if(!_0xbf059b){_0x1cab6c[_0xe524('0xd')](0x194);}return _0xbf059b;};}function handleError(_0x7dfe97,_0x5c4d21){_0x5c4d21=_0x5c4d21||0x1f4;return function(_0x7d1f92){logger['error'](_0x7d1f92['stack']);if(_0x7d1f92[_0xe524('0x19')]){delete _0x7d1f92[_0xe524('0x19')];}_0x7dfe97[_0xe524('0xe')](_0x5c4d21)[_0xe524('0x1a')](_0x7d1f92);};}exports['index']=function(_0x158f07,_0x4a03bc){var _0x17e245={};var _0xcf5db={'count':0x0,'rows':[]};var _0xd62772=_[_0xe524('0x1b')](db[_0xe524('0x1c')][_0xe524('0x1d')],function(_0x2141db){return{'name':_0x2141db['fieldName'],'type':_0x2141db['type'][_0xe524('0x1e')]};});_0x17e245=qs[_0xe524('0x1f')](_0xd62772,_0x158f07);var _0x476572={'where':_0x17e245[_0xe524('0x20')]};return db[_0xe524('0x1c')]['count'](_0x476572)['then'](function(_0x4b1ff){_0xcf5db[_0xe524('0x13')]=_0x4b1ff;_0x17e245[_0xe524('0x21')]=qs[_0xe524('0x21')](_0x158f07[_0xe524('0x22')]);return db['FaxQueue'][_0xe524('0x23')](_0x17e245);})[_0xe524('0x17')](function(_0x4a4e15){_0xcf5db['rows']=_0x4a4e15;return _0xcf5db;})[_0xe524('0x17')](respondWithFilteredResult(_0x4a03bc,_0x17e245))[_0xe524('0x24')](handleError(_0x4a03bc,null));};exports['show']=function(_0x31d4a7,_0x535354){var _0x3fec06={'raw':!![],'where':{'id':_0x31d4a7[_0xe524('0x25')]['id']}},_0x54af2a={};_0x54af2a[_0xe524('0x26')]=_[_0xe524('0x27')](db['FaxQueue'][_0xe524('0x1d')]);_0x54af2a['query']=_[_0xe524('0x27')](_0x31d4a7[_0xe524('0x22')]);_0x54af2a[_0xe524('0x28')]=_['intersection'](_0x54af2a[_0xe524('0x26')],_0x54af2a[_0xe524('0x22')]);_0x3fec06['attributes']=_[_0xe524('0x29')](_0x54af2a[_0xe524('0x26')],qs[_0xe524('0x2a')](_0x31d4a7[_0xe524('0x22')]['fields']));_0x3fec06[_0xe524('0x2b')]=_0x3fec06[_0xe524('0x2b')][_0xe524('0x2c')]?_0x3fec06[_0xe524('0x2b')]:_0x54af2a[_0xe524('0x26')];if(_0x31d4a7[_0xe524('0x22')][_0xe524('0x2d')]){_0x3fec06[_0xe524('0x21')]=[{'all':!![]}];}_0x3fec06=_['merge']({},_0x3fec06,_0x31d4a7[_0xe524('0x2e')]);return db['FaxQueue'][_0xe524('0x2f')](_0x3fec06)[_0xe524('0x17')](handleEntityNotFound(_0x535354,null))['then'](respondWithResult(_0x535354,null))[_0xe524('0x24')](handleError(_0x535354,null));};exports['create']=function(_0x1c3aae,_0x41af26){return db[_0xe524('0x1c')][_0xe524('0x30')](_0x1c3aae[_0xe524('0x31')],{})[_0xe524('0x17')](function(_0x3a0d20){var _0x13762c=_0x1c3aae['user'][_0xe524('0x32')]({'plain':!![]});if(!_0x13762c)throw new Error(_0xe524('0x33'));if(_0x13762c[_0xe524('0x34')]===_0xe524('0x35')){var _0xbd4ae3=_0x3a0d20[_0xe524('0x32')]({'plain':!![]});var _0x1d9648=_0xe524('0x18');return db['UserProfileSection'][_0xe524('0x2f')]({'where':{'name':_0x1d9648,'userProfileId':_0x13762c[_0xe524('0x36')]},'raw':!![]})[_0xe524('0x17')](function(_0x59781b){if(_0x59781b&&_0x59781b[_0xe524('0x37')]===0x0){return db['UserProfileResource'][_0xe524('0x30')]({'name':_0xbd4ae3[_0xe524('0x19')],'resourceId':_0xbd4ae3['id'],'type':_0x59781b[_0xe524('0x19')],'sectionId':_0x59781b['id']},{})[_0xe524('0x17')](function(){return _0x3a0d20;});}else{return _0x3a0d20;}})[_0xe524('0x24')](function(_0x4746cd){logger[_0xe524('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4746cd);throw _0x4746cd;});}return _0x3a0d20;})[_0xe524('0x17')](respondWithResult(_0x41af26,0xc9))[_0xe524('0x24')](handleError(_0x41af26,null));};exports[_0xe524('0x39')]=function(_0x376505,_0x438962){if(_0x376505[_0xe524('0x31')]['id']){delete _0x376505['body']['id'];}return db[_0xe524('0x1c')][_0xe524('0x2f')]({'where':{'id':_0x376505[_0xe524('0x25')]['id']}})['then'](handleEntityNotFound(_0x438962,null))[_0xe524('0x17')](saveUpdates(_0x376505['body'],null))['then'](respondWithResult(_0x438962,null))[_0xe524('0x24')](handleError(_0x438962,null));};exports[_0xe524('0x16')]=function(_0x4da26f,_0x1e4e9f){return db[_0xe524('0x1c')][_0xe524('0x2f')]({'where':{'id':_0x4da26f[_0xe524('0x25')]['id']}})['then'](handleEntityNotFound(_0x1e4e9f,null))['then'](removeEntity(_0x1e4e9f,null))[_0xe524('0x24')](handleError(_0x1e4e9f,null));};exports[_0xe524('0x3a')]=function(_0x53c204,_0x30d278){return db['FaxQueue'][_0xe524('0x3a')]()[_0xe524('0x17')](respondWithResult(_0x30d278,null))[_0xe524('0x24')](handleError(_0x30d278,null));};exports[_0xe524('0x3b')]=function(_0xbde17b,_0x36f90a){var _0x305503={'raw':!![],'where':{}},_0x22fb42={},_0x1642a7;return db[_0xe524('0x1c')][_0xe524('0x3c')]({'where':{'id':_0xbde17b[_0xe524('0x25')]['id']}})[_0xe524('0x17')](handleEntityNotFound(_0x36f90a,null))[_0xe524('0x17')](function(_0x37d44d){if(_0x37d44d){_0x1642a7=_0x37d44d['get']({'plain':!![]});_0x22fb42[_0xe524('0x26')]=_['keys'](db['UserFaxQueue'][_0xe524('0x1d')]);_0x22fb42['query']=_[_0xe524('0x27')](_0xbde17b[_0xe524('0x22')]);_0x22fb42['filters']=_[_0xe524('0x29')](_0x22fb42['model'],_0x22fb42['query']);_0x305503[_0xe524('0x2b')]=_[_0xe524('0x29')](_0x22fb42[_0xe524('0x26')],qs['fields'](_0xbde17b['query']['fields']));_0x305503['attributes']=_0x305503['attributes']['length']?_0x305503[_0xe524('0x2b')]:_0x22fb42[_0xe524('0x26')];if(!_0xbde17b['query'][_0xe524('0x3d')](_0xe524('0x3e'))){_0x305503[_0xe524('0x11')]=qs[_0xe524('0x11')](_0xbde17b[_0xe524('0x22')]['limit']);_0x305503[_0xe524('0x14')]=qs[_0xe524('0x14')](_0xbde17b[_0xe524('0x22')]['offset']);}_0x305503[_0xe524('0x3f')]=qs['sort'](_0xbde17b[_0xe524('0x22')][_0xe524('0x40')]);_0x305503[_0xe524('0x20')]=qs[_0xe524('0x28')](_[_0xe524('0x41')](_0xbde17b[_0xe524('0x22')],_0x22fb42[_0xe524('0x28')]));_0x305503[_0xe524('0x20')][_0xe524('0x42')]=_0x37d44d['id'];if(_0xbde17b[_0xe524('0x22')][_0xe524('0x43')]){_0x305503[_0xe524('0x20')]=_['merge'](_0x305503['where'],{'$or':_['map'](_0x305503[_0xe524('0x2b')],function(_0x469f67){var _0xe7de83={};_0xe7de83[_0x469f67]={'$like':'%'+_0xbde17b[_0xe524('0x22')][_0xe524('0x43')]+'%'};return _0xe7de83;})});}_0x305503=_[_0xe524('0x44')]({},_0x305503,_0xbde17b[_0xe524('0x2e')]);return db[_0xe524('0x45')][_0xe524('0x23')](_0x305503);}})[_0xe524('0x17')](function(_0x3cc1ab){if(_0x3cc1ab){return db['User'][_0xe524('0x46')]({'where':{'id':_[_0xe524('0x1b')](_0x3cc1ab,'UserId'),'role':'agent'},'attributes':['id','name','faxPause',_0xe524('0x47'),_0xe524('0x48')]});}})[_0xe524('0x17')](function(_0x8a2c00){if(_0x8a2c00){return{'count':_0x8a2c00['count'],'rows':_[_0xe524('0x1b')](_0x8a2c00[_0xe524('0x49')],function(_0xefe0e0){return{'membername':_0xefe0e0[_0xe524('0x19')],'UserId':_0xefe0e0['id'],'queue_name':_0x1642a7['name'],'FaxQueueId':_0x1642a7['id'],'interface':util['format']('%s/%s',_0xe524('0x4a'),_0xefe0e0['name']),'penalty':0x0,'paused':_0xefe0e0[_0xe524('0x4b')],'createdAt':_0xefe0e0[_0xe524('0x48')],'updatedAt':_0xefe0e0[_0xe524('0x47')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe524('0x17')](respondWithFilteredResult(_0x36f90a,_0x305503))[_0xe524('0x24')](handleError(_0x36f90a,null));};exports['getTeams']=function(_0x5d0507,_0x29a519){var _0x415476={};var _0x3b0c8f={};var _0x8e6e1f;var _0x214c66;return db[_0xe524('0x1c')]['findOne']({'where':{'id':_0x5d0507[_0xe524('0x25')]['id']}})[_0xe524('0x17')](handleEntityNotFound(_0x29a519,null))[_0xe524('0x17')](function(_0x5d3b9c){if(_0x5d3b9c){_0x8e6e1f=_0x5d3b9c;_0x3b0c8f[_0xe524('0x26')]=_[_0xe524('0x27')](db[_0xe524('0x4c')]['rawAttributes']);_0x3b0c8f['query']=_[_0xe524('0x27')](_0x5d0507[_0xe524('0x22')]);_0x3b0c8f[_0xe524('0x28')]=_[_0xe524('0x29')](_0x3b0c8f[_0xe524('0x26')],_0x3b0c8f['query']);_0x415476[_0xe524('0x2b')]=_[_0xe524('0x29')](_0x3b0c8f[_0xe524('0x26')],qs[_0xe524('0x2a')](_0x5d0507[_0xe524('0x22')][_0xe524('0x2a')]));_0x415476[_0xe524('0x2b')]=_0x415476[_0xe524('0x2b')][_0xe524('0x2c')]?_0x415476[_0xe524('0x2b')]:_0x3b0c8f[_0xe524('0x26')];_0x415476['order']=qs[_0xe524('0x40')](_0x5d0507[_0xe524('0x22')][_0xe524('0x40')]);_0x415476[_0xe524('0x20')]=qs[_0xe524('0x28')](_['pick'](_0x5d0507[_0xe524('0x22')],_0x3b0c8f[_0xe524('0x28')]));if(_0x5d0507[_0xe524('0x22')][_0xe524('0x43')]){_0x415476[_0xe524('0x20')]=_[_0xe524('0x44')](_0x415476[_0xe524('0x20')],{'$or':_['map'](_0x415476[_0xe524('0x2b')],function(_0x245501){var _0x35ca22={};_0x35ca22[_0x245501]={'$like':'%'+_0x5d0507[_0xe524('0x22')]['filter']+'%'};return _0x35ca22;})});}_0x415476=_[_0xe524('0x44')]({},_0x415476,_0x5d0507['options']);return _0x8e6e1f[_0xe524('0x4d')](_0x415476);}})[_0xe524('0x17')](function(_0x52e84e){if(_0x52e84e){_0x214c66=_0x52e84e['length'];if(!_0x5d0507[_0xe524('0x22')][_0xe524('0x3d')](_0xe524('0x3e'))){_0x415476[_0xe524('0x11')]=qs[_0xe524('0x11')](_0x5d0507['query'][_0xe524('0x11')]);_0x415476[_0xe524('0x14')]=qs[_0xe524('0x14')](_0x5d0507[_0xe524('0x22')][_0xe524('0x14')]);}return _0x8e6e1f['getTeams'](_0x415476);}})[_0xe524('0x17')](function(_0x629baa){if(_0x629baa){return _0x629baa?{'count':_0x214c66,'rows':_0x629baa}:null;}})[_0xe524('0x17')](respondWithResult(_0x29a519,null))[_0xe524('0x24')](handleError(_0x29a519,null));};exports[_0xe524('0x4e')]=function(_0x1bde09,_0x54a1e1){var _0x42b95d=_0x1bde09[_0xe524('0x31')][_0xe524('0x4f')];return db['Team'][_0xe524('0x23')]({'where':{'id':_0x42b95d},'attributes':['id'],'include':[{'model':db[_0xe524('0x50')],'as':'Agents','attributes':['id',_0xe524('0x19'),_0xe524('0x51'),_0xe524('0x52'),_0xe524('0x53')],'raw':!![]}]})[_0xe524('0x17')](function(_0xf6934){if(_0xf6934){var _0x52e1bd=_[_0xe524('0x54')](_0xf6934,function(_0x3fd61e){var _0x410bd3=_0x3fd61e[_0xe524('0x32')]({'plain':!![]});return _0x410bd3[_0xe524('0x55')];});return db[_0xe524('0x1c')][_0xe524('0x2f')]({'where':{'id':_0x1bde09[_0xe524('0x25')]['id']}})[_0xe524('0x17')](function(_0x16893f){return db[_0xe524('0x56')][_0xe524('0x57')](function(_0x3c82e7){return _0x16893f[_0xe524('0x4e')](_0x42b95d,{'transaction':_0x3c82e7})[_0xe524('0x17')](function(){return BPromise['each'](_0x52e1bd,function(_0x933c2a){return db[_0xe524('0x45')][_0xe524('0x58')]({'where':{'UserId':_0x933c2a['id'],'FaxQueueId':_0x1bde09['params']['id']},'transaction':_0x3c82e7});});})[_0xe524('0x17')](function(){_0x52e1bd[_0xe524('0x59')](function(_0x5c29aa){socket['emit'](_0xe524('0x5a'),{'UserId':_0x5c29aa['id'],'FaxQueueId':_0x16893f['id']});});});});});}})['then'](respondWithStatusCode(_0x54a1e1,null))[_0xe524('0x24')](handleError(_0x54a1e1,null));};exports['removeTeams']=function(_0x22b3fd,_0x1ed60b){return db[_0xe524('0x4c')][_0xe524('0x23')]({'where':{'id':_0x22b3fd['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe524('0x50')],'as':_0xe524('0x55'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1ed60b,null))[_0xe524('0x17')](function(_0x449842){var _0x1f3ed1=_['map'](_0x449842,'id');var _0x19b063=[];var _0x140a4e=[];var _0x3f9d65=squel[_0xe524('0x5b')]();_0x3f9d65[_0xe524('0x5c')](_0xe524('0x5d'))['from']('team_has_fax_queues','tq')[_0xe524('0x5e')]('user_has_teams','ut',_0xe524('0x5f'))[_0xe524('0x20')](_0xe524('0x60'),_0x22b3fd['params']['id']);for(var _0x216a77=0x0;_0x216a77<_0x449842['length'];_0x216a77+=0x1){let _0x1681c5=_0x449842[_0x216a77];for(var _0x41e693=0x0;_0x41e693<_0x1681c5[_0xe524('0x55')][_0xe524('0x2c')];_0x41e693+=0x1){let _0x382ecc=_0x1681c5[_0xe524('0x55')][_0x41e693];var _0x50f5e3=_0x3f9d65[_0xe524('0x61')]();_0x50f5e3[_0xe524('0x20')](_0xe524('0x62'),_0x382ecc['id']);_0x140a4e['push'](db[_0xe524('0x56')][_0xe524('0x22')](_0x50f5e3['toString'](),{'type':db[_0xe524('0x56')][_0xe524('0x63')][_0xe524('0x64')]})[_0xe524('0x17')](function(_0x58d29e){if(_0x58d29e[_0xe524('0x2c')]===0x1){return _0x382ecc['id'];}else{var _0x20779a=_[_0xe524('0x65')](_['map'](_0x58d29e,_0xe524('0x66')),function(_0x494333){return _[_0xe524('0x67')](_0x1f3ed1,_0x494333);});if(_0x20779a){return _0x382ecc['id'];}}}));}}return BPromise[_0xe524('0x68')](_0x140a4e)[_0xe524('0x17')](function(_0x4d0ce5){_0x19b063=_(_0x19b063)[_0xe524('0x69')](_0x4d0ce5)[_0xe524('0x6a')]()[_0xe524('0x6b')]();return db['FaxQueue']['find']({'where':{'id':_0x22b3fd[_0xe524('0x25')]['id']}})['then'](function(_0x903e24){return db['sequelize'][_0xe524('0x57')](function(_0x246c62){return _0x903e24['removeTeams'](_0x22b3fd[_0xe524('0x22')][_0xe524('0x4f')],{'transaction':_0x246c62})['then'](function(){if(!_['isEmpty'](_0x19b063)){return _0x903e24[_0xe524('0x6c')](_0x19b063,{'transaction':_0x246c62});}})[_0xe524('0x17')](function(){_0x19b063[_0xe524('0x59')](function(_0x5b6313){socket[_0xe524('0x6d')](_0xe524('0x6e'),{'UserId':_0x5b6313,'FaxQueueId':_0x903e24['id']});});});});});});})[_0xe524('0x17')](respondWithStatusCode(_0x1ed60b,null))[_0xe524('0x24')](handleError(_0x1ed60b,null));};exports[_0xe524('0x6f')]=function(_0x1b2277,_0x57501c){return db[_0xe524('0x1c')][_0xe524('0x2f')]({'where':{'id':_0x1b2277['params']['id']}})['then'](handleEntityNotFound(_0x57501c,null))[_0xe524('0x17')](function(_0x1fb002){if(_0x1fb002){return _0x1fb002[_0xe524('0x6f')](_0x1b2277[_0xe524('0x31')]['ids'],_[_0xe524('0x70')](_0x1b2277[_0xe524('0x31')],['ids','id'])||{})['spread'](function(_0x475f24){for(var _0x269e79=0x0;_0x269e79<_0x1b2277[_0xe524('0x31')][_0xe524('0x4f')][_0xe524('0x2c')];_0x269e79+=0x1){socket[_0xe524('0x6d')]('userFaxQueue:save',{'UserId':Number(_0x1b2277['body'][_0xe524('0x4f')][_0x269e79]),'FaxQueueId':Number(_0x1b2277[_0xe524('0x25')]['id'])});}return _0x475f24;});}})['then'](respondWithResult(_0x57501c,null))['catch'](handleError(_0x57501c,null));};exports[_0xe524('0x6c')]=function(_0x187872,_0x30fa81){return db[_0xe524('0x1c')][_0xe524('0x2f')]({'where':{'id':_0x187872[_0xe524('0x25')]['id']}})['then'](handleEntityNotFound(_0x30fa81,null))['then'](function(_0x3e8668){if(_0x3e8668){return _0x3e8668[_0xe524('0x6c')](_0x187872[_0xe524('0x22')][_0xe524('0x4f')])[_0xe524('0x17')](function(){if(_[_0xe524('0x71')](_0x187872[_0xe524('0x22')][_0xe524('0x4f')])){for(var _0x507a9d=0x0;_0x507a9d<_0x187872[_0xe524('0x22')][_0xe524('0x4f')][_0xe524('0x2c')];_0x507a9d+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x187872[_0xe524('0x22')][_0xe524('0x4f')][_0x507a9d]),'FaxQueueId':Number(_0x187872[_0xe524('0x25')]['id'])});}}else{socket[_0xe524('0x6d')]('userFaxQueue:remove',{'UserId':Number(_0x187872[_0xe524('0x22')][_0xe524('0x4f')]),'FaxQueueId':Number(_0x187872[_0xe524('0x25')]['id'])});}});}})[_0xe524('0x17')](respondWithStatusCode(_0x30fa81,null))[_0xe524('0x24')](handleError(_0x30fa81,null));};exports['getAgents']=function(_0x2fa9c7,_0x5d8c54){var _0x4217ff={};var _0x37f754={};var _0x4a86bf;var _0x412e2f;return db[_0xe524('0x1c')]['findOne']({'where':{'id':_0x2fa9c7[_0xe524('0x25')]['id']}})['then'](handleEntityNotFound(_0x5d8c54,null))[_0xe524('0x17')](function(_0xf2058c){if(_0xf2058c){_0x4a86bf=_0xf2058c;_0x37f754[_0xe524('0x26')]=_[_0xe524('0x27')](db[_0xe524('0x50')][_0xe524('0x1d')]);_0x37f754[_0xe524('0x22')]=_[_0xe524('0x27')](_0x2fa9c7['query']);_0x37f754[_0xe524('0x28')]=_['intersection'](_0x37f754['model'],_0x37f754[_0xe524('0x22')]);_0x4217ff['attributes']=_[_0xe524('0x29')](_0x37f754[_0xe524('0x26')],qs[_0xe524('0x2a')](_0x2fa9c7[_0xe524('0x22')][_0xe524('0x2a')]));_0x4217ff[_0xe524('0x2b')]=_0x4217ff['attributes']['length']?_0x4217ff[_0xe524('0x2b')]:_0x37f754[_0xe524('0x26')];_0x4217ff[_0xe524('0x3f')]=qs[_0xe524('0x40')](_0x2fa9c7[_0xe524('0x22')][_0xe524('0x40')]);_0x4217ff[_0xe524('0x20')]=qs[_0xe524('0x28')](_[_0xe524('0x41')](_0x2fa9c7[_0xe524('0x22')],_0x37f754['filters']));if(_0x2fa9c7[_0xe524('0x22')][_0xe524('0x43')]){_0x4217ff[_0xe524('0x20')]=_[_0xe524('0x44')](_0x4217ff[_0xe524('0x20')],{'$or':_[_0xe524('0x1b')](_0x4217ff['attributes'],function(_0x1cc750){var _0x43f3bf={};_0x43f3bf[_0x1cc750]={'$like':'%'+_0x2fa9c7[_0xe524('0x22')][_0xe524('0x43')]+'%'};return _0x43f3bf;})});}_0x4217ff=_[_0xe524('0x44')]({},_0x4217ff,_0x2fa9c7[_0xe524('0x2e')]);return _0x4a86bf[_0xe524('0x72')](_0x4217ff);}})[_0xe524('0x17')](function(_0x599bd9){if(_0x599bd9){_0x412e2f=_0x599bd9['length'];if(!_0x2fa9c7['query'][_0xe524('0x3d')](_0xe524('0x3e'))){_0x4217ff['limit']=qs[_0xe524('0x11')](_0x2fa9c7[_0xe524('0x22')]['limit']);_0x4217ff[_0xe524('0x14')]=qs[_0xe524('0x14')](_0x2fa9c7['query'][_0xe524('0x14')]);}return _0x4a86bf[_0xe524('0x72')](_0x4217ff);}})[_0xe524('0x17')](function(_0x542182){if(_0x542182){return _0x542182?{'count':_0x412e2f,'rows':_0x542182}:null;}})[_0xe524('0x17')](respondWithResult(_0x5d8c54,null))[_0xe524('0x24')](handleError(_0x5d8c54,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index bda6971..6289496 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 _0x61a1=['FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1217d9,_0x4f7ecc){var _0x47f27c=function(_0x2c9c7c){while(--_0x2c9c7c){_0x1217d9['push'](_0x1217d9['shift']());}};_0x47f27c(++_0x4f7ecc);}(_0x61a1,0x1dc));var _0x161a=function(_0x42ca15,_0x193ccb){_0x42ca15=_0x42ca15-0x0;var _0x1c6ded=_0x61a1[_0x42ca15];return _0x1c6ded;};'use strict';var EventEmitter=require(_0x161a('0x0'));var FaxQueue=require('../../mysqldb')['db'][_0x161a('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x161a('0x2')](0x0);var events={'afterCreate':_0x161a('0x3'),'afterUpdate':_0x161a('0x4'),'afterDestroy':_0x161a('0x5')};function emitEvent(_0xd8f0ee){return function(_0x13d027,_0xa20774,_0x3eb5ae){FaxQueueEvents['emit'](_0xd8f0ee+':'+_0x13d027['id'],_0x13d027);FaxQueueEvents[_0x161a('0x6')](_0xd8f0ee,_0x13d027);_0x3eb5ae(null);};}for(var e in events){if(events[_0x161a('0x7')](e)){var event=events[e];FaxQueue[_0x161a('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xc9e2=['hook','exports','events','../../mysqldb','FaxQueue','setMaxListeners','update','emit'];(function(_0x2d184e,_0x48c401){var _0x780c98=function(_0x185e46){while(--_0x185e46){_0x2d184e['push'](_0x2d184e['shift']());}};_0x780c98(++_0x48c401);}(_0xc9e2,0x19a));var _0x2c9e=function(_0x209eb8,_0x5b26ce){_0x209eb8=_0x209eb8-0x0;var _0x239624=_0xc9e2[_0x209eb8];return _0x239624;};'use strict';var EventEmitter=require(_0x2c9e('0x0'));var FaxQueue=require(_0x2c9e('0x1'))['db'][_0x2c9e('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2c9e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2c9e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5ee37b){return function(_0xea0f84,_0x4dc8d1,_0x52aba7){FaxQueueEvents[_0x2c9e('0x5')](_0x5ee37b+':'+_0xea0f84['id'],_0xea0f84);FaxQueueEvents[_0x2c9e('0x5')](_0x5ee37b,_0xea0f84);_0x52aba7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x2c9e('0x6')](e,emitEvent(event));}}module[_0x2c9e('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index a7e71c8..9ac36ba 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 _0x81d6=['api','bluebird','request-promise','path','rimraf','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','lodash','../../config/logger'];(function(_0x19f19f,_0x5ee9f5){var _0x381643=function(_0xeb6c6){while(--_0xeb6c6){_0x19f19f['push'](_0x19f19f['shift']());}};_0x381643(++_0x5ee9f5);}(_0x81d6,0x15a));var _0x681d=function(_0x109018,_0x3c23e1){_0x109018=_0x109018-0x0;var _0x2afe8f=_0x81d6[_0x109018];return _0x2afe8f;};'use strict';var _=require(_0x681d('0x0'));var util=require('util');var logger=require(_0x681d('0x1'))(_0x681d('0x2'));var moment=require('moment');var BPromise=require(_0x681d('0x3'));var rp=require(_0x681d('0x4'));var fs=require('fs');var path=require(_0x681d('0x5'));var rimraf=require(_0x681d('0x6'));var config=require('../../config/environment');var attributes=require(_0x681d('0x7'));module[_0x681d('0x8')]=function(_0x592900,_0x2746df){return _0x592900[_0x681d('0x9')](_0x681d('0xa'),attributes,{'tableName':_0x681d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xead9=['rimraf','../../config/environment','./faxQueue.attributes','exports','define','fax_queues','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x14206a,_0x266258){var _0x304578=function(_0x1a21af){while(--_0x1a21af){_0x14206a['push'](_0x14206a['shift']());}};_0x304578(++_0x266258);}(_0xead9,0x1a6));var _0x9ead=function(_0x18b189,_0x21e3ec){_0x18b189=_0x18b189-0x0;var _0x3536d1=_0xead9[_0x18b189];return _0x3536d1;};'use strict';var _=require('lodash');var util=require(_0x9ead('0x0'));var logger=require(_0x9ead('0x1'))(_0x9ead('0x2'));var moment=require(_0x9ead('0x3'));var BPromise=require(_0x9ead('0x4'));var rp=require(_0x9ead('0x5'));var fs=require('fs');var path=require(_0x9ead('0x6'));var rimraf=require(_0x9ead('0x7'));var config=require(_0x9ead('0x8'));var attributes=require(_0x9ead('0x9'));module[_0x9ead('0xa')]=function(_0x1fa803,_0x552407){return _0x1fa803[_0x9ead('0xb')]('FaxQueue',attributes,{'tableName':_0x9ead('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index d331fc7..2ae2c69 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 _0xc66b=['../../config/logger','../../config/environment','http','defaults','localhost','socket.io-emitter','redis','request','then','info','request\x20sent','debug','error','code','message','FaxQueue,\x20%s,\x20%s','result','catch','GetFaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowFaxQueue','FaxQueue','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x842667,_0x462596){var _0x5430d9=function(_0xd5fb40){while(--_0xd5fb40){_0x842667['push'](_0x842667['shift']());}};_0x5430d9(++_0x462596);}(_0xc66b,0x1e7));var _0xbc66=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xc66b[_0x2fc012];return _0x2891f9;};'use strict';var _=require(_0xbc66('0x0'));var util=require(_0xbc66('0x1'));var moment=require('moment');var BPromise=require(_0xbc66('0x2'));var rs=require(_0xbc66('0x3'));var fs=require('fs');var Redis=require(_0xbc66('0x4'));var db=require(_0xbc66('0x5'))['db'];var utils=require(_0xbc66('0x6'));var logger=require(_0xbc66('0x7'))('rpc');var config=require(_0xbc66('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbc66('0x9')]({'port':0x232a});config['redis']=_[_0xbc66('0xa')](config['redis'],{'host':_0xbc66('0xb'),'port':0x18eb});var socket=require(_0xbc66('0xc'))(new Redis(config[_0xbc66('0xd')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x1b85d3,_0x3ddfde,_0x88b4c3){return new BPromise(function(_0x27f63d,_0x43eb77){return client[_0xbc66('0xe')](_0x1b85d3,_0x88b4c3)[_0xbc66('0xf')](function(_0x5ad067){logger[_0xbc66('0x10')]('FaxQueue,\x20%s,\x20%s',_0x3ddfde,_0xbc66('0x11'));logger[_0xbc66('0x12')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3ddfde,'request\x20sent',JSON['stringify'](_0x5ad067));if(_0x5ad067[_0xbc66('0x13')]){if(_0x5ad067['error'][_0xbc66('0x14')]===0x1f4){logger[_0xbc66('0x13')]('FaxQueue,\x20%s,\x20%s',_0x3ddfde,_0x5ad067[_0xbc66('0x13')][_0xbc66('0x15')]);return _0x43eb77(_0x5ad067[_0xbc66('0x13')][_0xbc66('0x15')]);}logger[_0xbc66('0x13')]('FaxQueue,\x20%s,\x20%s',_0x3ddfde,_0x5ad067[_0xbc66('0x13')]['message']);return _0x27f63d(_0x5ad067['error'][_0xbc66('0x15')]);}else{logger[_0xbc66('0x10')](_0xbc66('0x16'),_0x3ddfde,'request\x20sent');_0x27f63d(_0x5ad067[_0xbc66('0x17')][_0xbc66('0x15')]);}})[_0xbc66('0x18')](function(_0x44384d){logger[_0xbc66('0x13')](_0xbc66('0x16'),_0x3ddfde,_0x44384d);_0x43eb77(_0x44384d);});});}exports[_0xbc66('0x19')]=function(_0x5dd80c){var _0x58afd0=this;return new Promise(function(_0x3459fc,_0x53551d){return db['FaxQueue'][_0xbc66('0x1a')]({'raw':_0x5dd80c['options']?_0x5dd80c[_0xbc66('0x1b')][_0xbc66('0x1c')]===undefined?!![]:![]:!![],'where':_0x5dd80c['options']?_0x5dd80c[_0xbc66('0x1b')][_0xbc66('0x1d')]||null:null,'attributes':_0x5dd80c[_0xbc66('0x1b')]?_0x5dd80c[_0xbc66('0x1b')][_0xbc66('0x1e')]||null:null,'limit':_0x5dd80c[_0xbc66('0x1b')]?_0x5dd80c[_0xbc66('0x1b')][_0xbc66('0x1f')]||null:null,'include':_0x5dd80c[_0xbc66('0x1b')]?_0x5dd80c[_0xbc66('0x1b')][_0xbc66('0x20')]?_['map'](_0x5dd80c[_0xbc66('0x1b')]['include'],function(_0x54c4c4){return{'model':db[_0x54c4c4['model']],'as':_0x54c4c4['as'],'attributes':_0x54c4c4[_0xbc66('0x1e')],'include':_0x54c4c4[_0xbc66('0x20')]?_['map'](_0x54c4c4[_0xbc66('0x20')],function(_0x223e27){return{'model':db[_0x223e27[_0xbc66('0x21')]],'as':_0x223e27['as'],'attributes':_0x223e27[_0xbc66('0x1e')],'include':_0x223e27[_0xbc66('0x20')]?_[_0xbc66('0x22')](_0x223e27[_0xbc66('0x20')],function(_0x3600da){return{'model':db[_0x3600da[_0xbc66('0x21')]],'as':_0x3600da['as'],'attributes':_0x3600da[_0xbc66('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbc66('0xf')](function(_0x540630){logger[_0xbc66('0x10')](_0xbc66('0x19'),_0x5dd80c);logger[_0xbc66('0x12')](_0xbc66('0x19'),_0x5dd80c,JSON[_0xbc66('0x23')](_0x540630));_0x3459fc(_0x540630);})['catch'](function(_0x3e8b98){logger['error']('GetFaxQueue',_0x3e8b98[_0xbc66('0x15')],_0x5dd80c);_0x53551d(_0x58afd0['error'](0x1f4,_0x3e8b98[_0xbc66('0x15')]));});});};exports[_0xbc66('0x24')]=function(_0x736bf){var _0x53e785=this;return new Promise(function(_0x5abf83,_0xc270ee){return db[_0xbc66('0x25')]['find']({'raw':_0x736bf['options']?_0x736bf[_0xbc66('0x1b')][_0xbc66('0x1c')]===undefined?!![]:![]:!![],'where':_0x736bf[_0xbc66('0x1b')]?_0x736bf[_0xbc66('0x1b')][_0xbc66('0x1d')]||null:null,'attributes':_0x736bf['options']?_0x736bf[_0xbc66('0x1b')][_0xbc66('0x1e')]||null:null,'include':_0x736bf[_0xbc66('0x1b')]?_0x736bf[_0xbc66('0x1b')]['include']?_['map'](_0x736bf['options'][_0xbc66('0x20')],function(_0x4e9a06){return{'model':db[_0x4e9a06[_0xbc66('0x21')]],'as':_0x4e9a06['as'],'attributes':_0x4e9a06[_0xbc66('0x1e')],'include':_0x4e9a06[_0xbc66('0x20')]?_[_0xbc66('0x22')](_0x4e9a06[_0xbc66('0x20')],function(_0x5271f2){return{'model':db[_0x5271f2[_0xbc66('0x21')]],'as':_0x5271f2['as'],'attributes':_0x5271f2['attributes'],'include':_0x5271f2[_0xbc66('0x20')]?_[_0xbc66('0x22')](_0x5271f2[_0xbc66('0x20')],function(_0x147e73){return{'model':db[_0x147e73[_0xbc66('0x21')]],'as':_0x147e73['as'],'attributes':_0x147e73[_0xbc66('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xbc66('0xf')](function(_0x4ca21c){logger['info'](_0xbc66('0x24'),_0x736bf);logger[_0xbc66('0x12')](_0xbc66('0x24'),_0x736bf,JSON[_0xbc66('0x23')](_0x4ca21c));_0x5abf83(_0x4ca21c);})['catch'](function(_0x53b4e3){logger[_0xbc66('0x13')]('ShowFaxQueue',_0x53b4e3[_0xbc66('0x15')],_0x736bf);_0xc270ee(_0x53e785[_0xbc66('0x13')](0x1f4,_0x53b4e3[_0xbc66('0x15')]));});});}; \ No newline at end of file +var _0x8791=['error','code','message','FaxQueue,\x20%s,\x20%s','result','catch','GetFaxQueue','findAll','options','raw','include','map','model','attributes','then','ShowFaxQueue','FaxQueue','find','where','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x40bc8b,_0xe55594){var _0x4c04d3=function(_0x193cf5){while(--_0x193cf5){_0x40bc8b['push'](_0x40bc8b['shift']());}};_0x4c04d3(++_0xe55594);}(_0x8791,0x1e1));var _0x1879=function(_0x254311,_0x31a764){_0x254311=_0x254311-0x0;var _0x3a2771=_0x8791[_0x254311];return _0x3a2771;};'use strict';var _=require('lodash');var util=require(_0x1879('0x0'));var moment=require(_0x1879('0x1'));var BPromise=require(_0x1879('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1879('0x3'));var db=require(_0x1879('0x4'))['db'];var utils=require(_0x1879('0x5'));var logger=require(_0x1879('0x6'))(_0x1879('0x7'));var config=require('../../config/environment');var jayson=require(_0x1879('0x8'));var client=jayson[_0x1879('0x9')][_0x1879('0xa')]({'port':0x232a});config[_0x1879('0xb')]=_[_0x1879('0xc')](config[_0x1879('0xb')],{'host':_0x1879('0xd'),'port':0x18eb});var socket=require(_0x1879('0xe'))(new Redis(config['redis']));require(_0x1879('0xf'))[_0x1879('0x10')](socket);function respondWithRpcPromise(_0x19da1a,_0x1ca697,_0x2a5a08){return new BPromise(function(_0x12b3bc,_0x28cd86){return client[_0x1879('0x11')](_0x19da1a,_0x2a5a08)['then'](function(_0x2a92e7){logger[_0x1879('0x12')]('FaxQueue,\x20%s,\x20%s',_0x1ca697,_0x1879('0x13'));logger[_0x1879('0x14')](_0x1879('0x15'),_0x1ca697,_0x1879('0x13'),JSON[_0x1879('0x16')](_0x2a92e7));if(_0x2a92e7['error']){if(_0x2a92e7[_0x1879('0x17')][_0x1879('0x18')]===0x1f4){logger[_0x1879('0x17')]('FaxQueue,\x20%s,\x20%s',_0x1ca697,_0x2a92e7[_0x1879('0x17')]['message']);return _0x28cd86(_0x2a92e7[_0x1879('0x17')][_0x1879('0x19')]);}logger[_0x1879('0x17')](_0x1879('0x1a'),_0x1ca697,_0x2a92e7[_0x1879('0x17')][_0x1879('0x19')]);return _0x12b3bc(_0x2a92e7[_0x1879('0x17')][_0x1879('0x19')]);}else{logger[_0x1879('0x12')]('FaxQueue,\x20%s,\x20%s',_0x1ca697,_0x1879('0x13'));_0x12b3bc(_0x2a92e7[_0x1879('0x1b')][_0x1879('0x19')]);}})[_0x1879('0x1c')](function(_0x4f95a9){logger[_0x1879('0x17')]('FaxQueue,\x20%s,\x20%s',_0x1ca697,_0x4f95a9);_0x28cd86(_0x4f95a9);});});}exports[_0x1879('0x1d')]=function(_0x3d69ae){var _0x2fe816=this;return new Promise(function(_0x4d815d,_0x3e358f){return db['FaxQueue'][_0x1879('0x1e')]({'raw':_0x3d69ae['options']?_0x3d69ae[_0x1879('0x1f')][_0x1879('0x20')]===undefined?!![]:![]:!![],'where':_0x3d69ae[_0x1879('0x1f')]?_0x3d69ae['options']['where']||null:null,'attributes':_0x3d69ae[_0x1879('0x1f')]?_0x3d69ae[_0x1879('0x1f')]['attributes']||null:null,'limit':_0x3d69ae[_0x1879('0x1f')]?_0x3d69ae['options']['limit']||null:null,'include':_0x3d69ae['options']?_0x3d69ae['options'][_0x1879('0x21')]?_[_0x1879('0x22')](_0x3d69ae['options'][_0x1879('0x21')],function(_0x3253cb){return{'model':db[_0x3253cb[_0x1879('0x23')]],'as':_0x3253cb['as'],'attributes':_0x3253cb[_0x1879('0x24')],'include':_0x3253cb[_0x1879('0x21')]?_[_0x1879('0x22')](_0x3253cb['include'],function(_0x7da7fa){return{'model':db[_0x7da7fa['model']],'as':_0x7da7fa['as'],'attributes':_0x7da7fa['attributes'],'include':_0x7da7fa[_0x1879('0x21')]?_[_0x1879('0x22')](_0x7da7fa[_0x1879('0x21')],function(_0xaaa7a5){return{'model':db[_0xaaa7a5[_0x1879('0x23')]],'as':_0xaaa7a5['as'],'attributes':_0xaaa7a5[_0x1879('0x24')]};}):[]};}):[]};}):[]:[]})[_0x1879('0x25')](function(_0x3d2029){logger[_0x1879('0x12')]('GetFaxQueue',_0x3d69ae);logger[_0x1879('0x14')](_0x1879('0x1d'),_0x3d69ae,JSON[_0x1879('0x16')](_0x3d2029));_0x4d815d(_0x3d2029);})[_0x1879('0x1c')](function(_0x3af0c3){logger[_0x1879('0x17')](_0x1879('0x1d'),_0x3af0c3[_0x1879('0x19')],_0x3d69ae);_0x3e358f(_0x2fe816[_0x1879('0x17')](0x1f4,_0x3af0c3['message']));});});};exports[_0x1879('0x26')]=function(_0xfff8b){var _0x734e91=this;return new Promise(function(_0x4be913,_0x4a269a){return db[_0x1879('0x27')][_0x1879('0x28')]({'raw':_0xfff8b[_0x1879('0x1f')]?_0xfff8b[_0x1879('0x1f')][_0x1879('0x20')]===undefined?!![]:![]:!![],'where':_0xfff8b[_0x1879('0x1f')]?_0xfff8b[_0x1879('0x1f')][_0x1879('0x29')]||null:null,'attributes':_0xfff8b['options']?_0xfff8b[_0x1879('0x1f')][_0x1879('0x24')]||null:null,'include':_0xfff8b[_0x1879('0x1f')]?_0xfff8b[_0x1879('0x1f')]['include']?_[_0x1879('0x22')](_0xfff8b[_0x1879('0x1f')][_0x1879('0x21')],function(_0x400003){return{'model':db[_0x400003[_0x1879('0x23')]],'as':_0x400003['as'],'attributes':_0x400003[_0x1879('0x24')],'include':_0x400003[_0x1879('0x21')]?_[_0x1879('0x22')](_0x400003[_0x1879('0x21')],function(_0x1436fa){return{'model':db[_0x1436fa[_0x1879('0x23')]],'as':_0x1436fa['as'],'attributes':_0x1436fa[_0x1879('0x24')],'include':_0x1436fa[_0x1879('0x21')]?_[_0x1879('0x22')](_0x1436fa[_0x1879('0x21')],function(_0x2d4d36){return{'model':db[_0x2d4d36[_0x1879('0x23')]],'as':_0x2d4d36['as'],'attributes':_0x2d4d36['attributes']};}):[]};}):[]};}):[]:[]})[_0x1879('0x25')](function(_0x1d06f9){logger[_0x1879('0x12')](_0x1879('0x26'),_0xfff8b);logger['debug'](_0x1879('0x26'),_0xfff8b,JSON[_0x1879('0x16')](_0x1d06f9));_0x4be913(_0x1d06f9);})[_0x1879('0x1c')](function(_0x4fb23e){logger['error'](_0x1879('0x26'),_0x4fb23e['message'],_0xfff8b);_0x4a269a(_0x734e91[_0x1879('0x17')](0x1f4,_0x4fb23e[_0x1879('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 243e0f1..83e29b3 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 _0x1974=['register','length','remove','emit','removeListener'];(function(_0x57083b,_0x1fb1d8){var _0x4eb46c=function(_0x24e634){while(--_0x24e634){_0x57083b['push'](_0x57083b['shift']());}};_0x4eb46c(++_0x1fb1d8);}(_0x1974,0x1d3));var _0x4197=function(_0x5a0c40,_0x382b6f){_0x5a0c40=_0x5a0c40-0x0;var _0x196c6b=_0x1974[_0x5a0c40];return _0x196c6b;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=['save',_0x4197('0x0'),'update'];function createListener(_0x25ea7d,_0x28bb62){return function(_0x4fb916){_0x28bb62[_0x4197('0x1')](_0x25ea7d,_0x4fb916);};}function removeListener(_0xe0d6dd,_0x28ca14){return function(){FaxQueueEvents[_0x4197('0x2')](_0xe0d6dd,_0x28ca14);};}exports[_0x4197('0x3')]=function(_0x43687d){for(var _0x1b0404=0x0,_0x356c9a=events[_0x4197('0x4')];_0x1b0404<_0x356c9a;_0x1b0404++){var _0x1d904b=events[_0x1b0404];var _0x4c6ac1=createListener('faxQueue:'+_0x1d904b,_0x43687d);FaxQueueEvents['on'](_0x1d904b,_0x4c6ac1);}}; \ No newline at end of file +var _0x38db=['register','length','./faxQueue.events','save','remove','update','emit','removeListener'];(function(_0x14c8a9,_0x3033ad){var _0x1f74b9=function(_0xb9b783){while(--_0xb9b783){_0x14c8a9['push'](_0x14c8a9['shift']());}};_0x1f74b9(++_0x3033ad);}(_0x38db,0x18a));var _0xb38d=function(_0x452552,_0x9428f9){_0x452552=_0x452552-0x0;var _0x13b606=_0x38db[_0x452552];return _0x13b606;};'use strict';var FaxQueueEvents=require(_0xb38d('0x0'));var events=[_0xb38d('0x1'),_0xb38d('0x2'),_0xb38d('0x3')];function createListener(_0x1885b8,_0x2f2e96){return function(_0x4ee52d){_0x2f2e96[_0xb38d('0x4')](_0x1885b8,_0x4ee52d);};}function removeListener(_0x381e52,_0xb13683){return function(){FaxQueueEvents[_0xb38d('0x5')](_0x381e52,_0xb13683);};}exports[_0xb38d('0x6')]=function(_0x436792){for(var _0x3d5042=0x0,_0x58fbdc=events[_0xb38d('0x7')];_0x3d5042<_0x58fbdc;_0x3d5042++){var _0x5ed0d8=events[_0x3d5042];var _0x14947b=createListener('faxQueue:'+_0x5ed0d8,_0x436792);FaxQueueEvents['on'](_0x5ed0d8,_0x14947b);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 77be587..9d94995 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 _0x1893=['describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x57de43,_0x35b1bd){var _0x59ecbf=function(_0x2e11b7){while(--_0x2e11b7){_0x57de43['push'](_0x57de43['shift']());}};_0x59ecbf(++_0x35b1bd);}(_0x1893,0xa2));var _0x3189=function(_0x57bd4f,_0x42a4f5){_0x57bd4f=_0x57bd4f-0x0;var _0x25c08f=_0x1893[_0x57bd4f];return _0x25c08f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['get'](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0xe')]);router['get'](_0x3189('0xf'),auth[_0x3189('0x9')](),controller[_0x3189('0x10')]);router[_0x3189('0x8')]('/:id/teams',auth[_0x3189('0x9')](),controller[_0x3189('0x11')]);router[_0x3189('0x8')](_0x3189('0x12'),auth[_0x3189('0x9')](),controller['getAgents']);router[_0x3189('0x13')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0x14')]);router[_0x3189('0x13')](_0x3189('0x15'),auth[_0x3189('0x9')](),controller[_0x3189('0x16')]);router[_0x3189('0x13')]('/:id/users',auth[_0x3189('0x9')](),controller[_0x3189('0x17')]);router[_0x3189('0x18')](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0x19')]);router['delete']('/:id',auth[_0x3189('0x9')](),controller['destroy']);router[_0x3189('0x1a')](_0x3189('0x15'),auth[_0x3189('0x9')](),controller[_0x3189('0x1b')]);router['delete'](_0x3189('0x12'),auth[_0x3189('0x9')](),controller[_0x3189('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x6931=['post','create','addAgents','removeTeams','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x178c6f,_0x1de7fe){var _0x6e3770=function(_0x322fb1){while(--_0x322fb1){_0x178c6f['push'](_0x178c6f['shift']());}};_0x6e3770(++_0x1de7fe);}(_0x6931,0x1a9));var _0x1693=function(_0xbbca29,_0x38c765){_0xbbca29=_0xbbca29-0x0;var _0x887f72=_0x6931[_0xbbca29];return _0x887f72;};'use strict';var multer=require(_0x1693('0x0'));var util=require(_0x1693('0x1'));var path=require(_0x1693('0x2'));var timeout=require(_0x1693('0x3'));var express=require(_0x1693('0x4'));var router=express[_0x1693('0x5')]();var fs_extra=require(_0x1693('0x6'));var auth=require(_0x1693('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1693('0x8'));var controller=require(_0x1693('0x9'));router[_0x1693('0xa')]('/',auth[_0x1693('0xb')](),controller[_0x1693('0xc')]);router['get'](_0x1693('0xd'),auth[_0x1693('0xb')](),controller[_0x1693('0xe')]);router['get'](_0x1693('0xf'),auth[_0x1693('0xb')](),controller[_0x1693('0x10')]);router[_0x1693('0xa')](_0x1693('0x11'),auth[_0x1693('0xb')](),controller[_0x1693('0x12')]);router[_0x1693('0xa')](_0x1693('0x13'),auth[_0x1693('0xb')](),controller[_0x1693('0x14')]);router['get'](_0x1693('0x15'),auth[_0x1693('0xb')](),controller[_0x1693('0x16')]);router[_0x1693('0x17')]('/',auth[_0x1693('0xb')](),controller[_0x1693('0x18')]);router[_0x1693('0x17')]('/:id/teams',auth[_0x1693('0xb')](),controller['addTeams']);router[_0x1693('0x17')]('/:id/users',auth[_0x1693('0xb')](),controller[_0x1693('0x19')]);router['put']('/:id',auth[_0x1693('0xb')](),controller['update']);router['delete']('/:id',auth[_0x1693('0xb')](),controller['destroy']);router['delete'](_0x1693('0x13'),auth[_0x1693('0xb')](),controller[_0x1693('0x1a')]);router[_0x1693('0x1b')](_0x1693('0x15'),auth[_0x1693('0xb')](),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 979936b..bc9e1cd 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 _0xdb1a=['STRING','DATE','moment','sequelize','exports'];(function(_0x4df583,_0x1b3f7b){var _0xc5fcac=function(_0x2d7985){while(--_0x2d7985){_0x4df583['push'](_0x4df583['shift']());}};_0xc5fcac(++_0x1b3f7b);}(_0xdb1a,0xca));var _0xadb1=function(_0x1f11ea,_0x13a216){_0x1f11ea=_0x1f11ea-0x0;var _0x3f55c6=_0xdb1a[_0x1f11ea];return _0x3f55c6;};'use strict';var moment=require(_0xadb1('0x0'));var Sequelize=require(_0xadb1('0x1'));module[_0xadb1('0x2')]={'uniqueid':{'type':Sequelize[_0xadb1('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xadb1('0x4')]},'leaveAt':{'type':Sequelize[_0xadb1('0x4')]},'acceptAt':{'type':Sequelize[_0xadb1('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xadb1('0x3')]}}; \ No newline at end of file +var _0xe889=['STRING','DATE','moment','sequelize'];(function(_0x2a863f,_0x3e7a74){var _0x525dac=function(_0x476b9f){while(--_0x476b9f){_0x2a863f['push'](_0x2a863f['shift']());}};_0x525dac(++_0x3e7a74);}(_0xe889,0xd6));var _0x9e88=function(_0x555740,_0x4f2067){_0x555740=_0x555740-0x0;var _0x201490=_0xe889[_0x555740];return _0x201490;};'use strict';var moment=require(_0x9e88('0x0'));var Sequelize=require(_0x9e88('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9e88('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9e88('0x2')]},'joinAt':{'type':Sequelize[_0x9e88('0x3')]},'leaveAt':{'type':Sequelize[_0x9e88('0x3')]},'acceptAt':{'type':Sequelize[_0x9e88('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 5084498..ac253b1 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 _0xc39c=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','send','index','map','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','then','includeAll','include','FaxQueueReport','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x1809c5,_0x46cabc){var _0x5254a4=function(_0xd1d319){while(--_0xd1d319){_0x1809c5['push'](_0x1809c5['shift']());}};_0x5254a4(++_0x46cabc);}(_0xc39c,0xd2));var _0xcc39=function(_0xcc4542,_0x23c0af){_0xcc4542=_0xcc4542-0x0;var _0x3ddc76=_0xc39c[_0xcc4542];return _0x3ddc76;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcc39('0x0'));var zipdir=require(_0xcc39('0x1'));var jsonpatch=require(_0xcc39('0x2'));var rp=require('request-promise');var moment=require(_0xcc39('0x3'));var BPromise=require(_0xcc39('0x4'));var Mustache=require(_0xcc39('0x5'));var util=require('util');var path=require(_0xcc39('0x6'));var sox=require(_0xcc39('0x7'));var csv=require(_0xcc39('0x8'));var ejs=require(_0xcc39('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc39('0xa'));var squel=require(_0xcc39('0xb'));var crypto=require(_0xcc39('0xc'));var jsforce=require(_0xcc39('0xd'));var deskjs=require(_0xcc39('0xe'));var toCsv=require(_0xcc39('0x8'));var querystring=require(_0xcc39('0xf'));var Papa=require(_0xcc39('0x10'));var Redis=require(_0xcc39('0x11'));var authService=require(_0xcc39('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcc39('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc39('0x14'))(_0xcc39('0x15'));var utils=require(_0xcc39('0x16'));var config=require(_0xcc39('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4245fe,_0x415abc){_0x415abc=_0x415abc||0xcc;return function(_0x532f88){if(_0x532f88){return _0x4245fe[_0xcc39('0x18')](_0x415abc);}return _0x4245fe[_0xcc39('0x19')](_0x415abc)[_0xcc39('0x1a')]();};}function respondWithResult(_0x31dc50,_0x1e0d4f){_0x1e0d4f=_0x1e0d4f||0xc8;return function(_0x999b61){if(_0x999b61){return _0x31dc50['status'](_0x1e0d4f)['json'](_0x999b61);}};}function respondWithFilteredResult(_0x465334,_0x2ae7e5){return function(_0x205a38){if(_0x205a38){var _0x425c73=typeof _0x2ae7e5[_0xcc39('0x1b')]===_0xcc39('0x1c')&&typeof _0x2ae7e5['limit']===_0xcc39('0x1c');var _0x197eb3=_0x205a38[_0xcc39('0x1d')];var _0x3f04f4=_0x425c73?0x0:_0x2ae7e5['offset'];var _0x4bd2ae=_0x425c73?_0x205a38[_0xcc39('0x1d')]:_0x2ae7e5['offset']+_0x2ae7e5[_0xcc39('0x1e')];var _0x425b24;if(_0x4bd2ae>=_0x197eb3){_0x4bd2ae=_0x197eb3;_0x425b24=0xc8;}else{_0x425b24=0xce;}_0x465334[_0xcc39('0x19')](_0x425b24);return _0x465334['set'](_0xcc39('0x1f'),_0x3f04f4+'-'+_0x4bd2ae+'/'+_0x197eb3)[_0xcc39('0x20')](_0x205a38);}return null;};}function patchUpdates(_0x195ffd){return function(_0x4c2fe5){try{jsonpatch[_0xcc39('0x21')](_0x4c2fe5,_0x195ffd,!![]);}catch(_0x5b2b0a){return BPromise[_0xcc39('0x22')](_0x5b2b0a);}return _0x4c2fe5[_0xcc39('0x23')]();};}function saveUpdates(_0x4796a7,_0x1ade0d){return function(_0x21c982){if(_0x21c982){return _0x21c982[_0xcc39('0x24')](_0x4796a7)['then'](function(_0x34656c){return _0x34656c;});}return null;};}function removeEntity(_0x249b29,_0x21243f){return function(_0x1ec9c6){if(_0x1ec9c6){return _0x1ec9c6[_0xcc39('0x25')]()['then'](function(){_0x249b29[_0xcc39('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x568ee7,_0x1bdce6){return function(_0x2b96ec){if(!_0x2b96ec){_0x568ee7[_0xcc39('0x18')](0x194);}return _0x2b96ec;};}function handleError(_0x488527,_0x477355){_0x477355=_0x477355||0x1f4;return function(_0x3e1ae6){logger[_0xcc39('0x26')](_0x3e1ae6[_0xcc39('0x27')]);if(_0x3e1ae6[_0xcc39('0x28')]){delete _0x3e1ae6[_0xcc39('0x28')];}_0x488527[_0xcc39('0x19')](_0x477355)[_0xcc39('0x29')](_0x3e1ae6);};}exports[_0xcc39('0x2a')]=function(_0x113c9d,_0x1dac9a){var _0x6a2286={},_0x20b4de={},_0x3b7a73={'count':0x0,'rows':[]};var _0x5a6b7b=_[_0xcc39('0x2b')](db['FaxQueueReport']['rawAttributes'],function(_0x42d77a){return{'name':_0x42d77a['fieldName'],'type':_0x42d77a['type']['key']};});_0x20b4de[_0xcc39('0x2c')]=_[_0xcc39('0x2b')](_0x5a6b7b,'name');_0x20b4de[_0xcc39('0x2d')]=_['keys'](_0x113c9d[_0xcc39('0x2d')]);_0x20b4de[_0xcc39('0x2e')]=_[_0xcc39('0x2f')](_0x20b4de[_0xcc39('0x2c')],_0x20b4de[_0xcc39('0x2d')]);_0x6a2286[_0xcc39('0x30')]=_[_0xcc39('0x2f')](_0x20b4de['model'],qs[_0xcc39('0x31')](_0x113c9d['query'][_0xcc39('0x31')]));_0x6a2286[_0xcc39('0x30')]=_0x6a2286[_0xcc39('0x30')][_0xcc39('0x32')]?_0x6a2286[_0xcc39('0x30')]:_0x20b4de[_0xcc39('0x2c')];if(!_0x113c9d[_0xcc39('0x2d')][_0xcc39('0x33')](_0xcc39('0x34'))){_0x6a2286[_0xcc39('0x1e')]=qs[_0xcc39('0x1e')](_0x113c9d[_0xcc39('0x2d')][_0xcc39('0x1e')]);_0x6a2286['offset']=qs[_0xcc39('0x1b')](_0x113c9d[_0xcc39('0x2d')]['offset']);}_0x6a2286[_0xcc39('0x35')]=qs[_0xcc39('0x36')](_0x113c9d[_0xcc39('0x2d')][_0xcc39('0x36')]);_0x6a2286[_0xcc39('0x37')]=qs[_0xcc39('0x2e')](_[_0xcc39('0x38')](_0x113c9d[_0xcc39('0x2d')],_0x20b4de[_0xcc39('0x2e')]),_0x5a6b7b);if(_0x113c9d[_0xcc39('0x2d')][_0xcc39('0x39')]){_0x6a2286[_0xcc39('0x37')]=_['merge'](_0x6a2286['where'],{'$or':_['map'](_0x5a6b7b,function(_0x50d881){if(_0x50d881[_0xcc39('0x3a')]!==_0xcc39('0x3b')){var _0x1e7ac7={};_0x1e7ac7[_0x50d881[_0xcc39('0x28')]]={'$like':'%'+_0x113c9d[_0xcc39('0x2d')][_0xcc39('0x39')]+'%'};return _0x1e7ac7;}})});}_0x6a2286=_[_0xcc39('0x3c')]({},_0x6a2286,_0x113c9d[_0xcc39('0x3d')]);var _0x440df7={'where':_0x6a2286[_0xcc39('0x37')]};return db['FaxQueueReport'][_0xcc39('0x1d')](_0x440df7)[_0xcc39('0x3e')](function(_0x345d37){_0x3b7a73[_0xcc39('0x1d')]=_0x345d37;if(_0x113c9d[_0xcc39('0x2d')][_0xcc39('0x3f')]){_0x6a2286[_0xcc39('0x40')]=[{'all':!![]}];}return db[_0xcc39('0x41')][_0xcc39('0x42')](_0x6a2286);})['then'](function(_0x2137f3){_0x3b7a73[_0xcc39('0x43')]=_0x2137f3;return _0x3b7a73;})[_0xcc39('0x3e')](respondWithFilteredResult(_0x1dac9a,_0x6a2286))[_0xcc39('0x44')](handleError(_0x1dac9a,null));};exports[_0xcc39('0x45')]=function(_0x39eb63,_0x402fe1){var _0xaf1cd4={'raw':!![],'where':{'id':_0x39eb63[_0xcc39('0x46')]['id']}},_0x27501f={};_0x27501f[_0xcc39('0x2c')]=_['keys'](db[_0xcc39('0x41')]['rawAttributes']);_0x27501f['query']=_['keys'](_0x39eb63[_0xcc39('0x2d')]);_0x27501f[_0xcc39('0x2e')]=_[_0xcc39('0x2f')](_0x27501f[_0xcc39('0x2c')],_0x27501f[_0xcc39('0x2d')]);_0xaf1cd4['attributes']=_[_0xcc39('0x2f')](_0x27501f[_0xcc39('0x2c')],qs[_0xcc39('0x31')](_0x39eb63['query'][_0xcc39('0x31')]));_0xaf1cd4[_0xcc39('0x30')]=_0xaf1cd4['attributes'][_0xcc39('0x32')]?_0xaf1cd4[_0xcc39('0x30')]:_0x27501f['model'];if(_0x39eb63[_0xcc39('0x2d')][_0xcc39('0x3f')]){_0xaf1cd4[_0xcc39('0x40')]=[{'all':!![]}];}_0xaf1cd4=_[_0xcc39('0x3c')]({},_0xaf1cd4,_0x39eb63[_0xcc39('0x3d')]);return db[_0xcc39('0x41')][_0xcc39('0x47')](_0xaf1cd4)['then'](handleEntityNotFound(_0x402fe1,null))['then'](respondWithResult(_0x402fe1,null))[_0xcc39('0x44')](handleError(_0x402fe1,null));};exports[_0xcc39('0x48')]=function(_0x321b0f,_0x166c87){return db['FaxQueueReport'][_0xcc39('0x48')](_0x321b0f[_0xcc39('0x49')],{})[_0xcc39('0x3e')](respondWithResult(_0x166c87,0xc9))[_0xcc39('0x44')](handleError(_0x166c87,null));};exports[_0xcc39('0x24')]=function(_0x95ce9f,_0x45814c){if(_0x95ce9f[_0xcc39('0x49')]['id']){delete _0x95ce9f['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x95ce9f[_0xcc39('0x46')]['id']}})[_0xcc39('0x3e')](handleEntityNotFound(_0x45814c,null))[_0xcc39('0x3e')](saveUpdates(_0x95ce9f[_0xcc39('0x49')],null))[_0xcc39('0x3e')](respondWithResult(_0x45814c,null))['catch'](handleError(_0x45814c,null));};exports['destroy']=function(_0x5b386f,_0x27e3e8){return db[_0xcc39('0x41')][_0xcc39('0x47')]({'where':{'id':_0x5b386f[_0xcc39('0x46')]['id']}})[_0xcc39('0x3e')](handleEntityNotFound(_0x27e3e8,null))[_0xcc39('0x3e')](removeEntity(_0x27e3e8,null))[_0xcc39('0x44')](handleError(_0x27e3e8,null));};exports[_0xcc39('0x4a')]=function(_0x1f0ebe,_0x32da81){return db['FaxQueueReport'][_0xcc39('0x4a')]()[_0xcc39('0x3e')](respondWithResult(_0x32da81,null))[_0xcc39('0x44')](handleError(_0x32da81,null));}; \ No newline at end of file +var _0x028d=['nolimit','sort','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FaxQueueReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty'];(function(_0x33aad0,_0x26f6ab){var _0x35512a=function(_0x477db5){while(--_0x477db5){_0x33aad0['push'](_0x33aad0['shift']());}};_0x35512a(++_0x26f6ab);}(_0x028d,0xff));var _0xd028=function(_0x11278a,_0x97706c){_0x11278a=_0x11278a-0x0;var _0x11d9af=_0x028d[_0x11278a];return _0x11d9af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd028('0x0'));var zipdir=require(_0xd028('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd028('0x2'));var moment=require(_0xd028('0x3'));var BPromise=require(_0xd028('0x4'));var Mustache=require(_0xd028('0x5'));var util=require(_0xd028('0x6'));var path=require(_0xd028('0x7'));var sox=require('sox');var csv=require(_0xd028('0x8'));var ejs=require(_0xd028('0x9'));var fs=require('fs');var fs_extra=require(_0xd028('0xa'));var _=require(_0xd028('0xb'));var squel=require(_0xd028('0xc'));var crypto=require(_0xd028('0xd'));var jsforce=require(_0xd028('0xe'));var deskjs=require(_0xd028('0xf'));var toCsv=require(_0xd028('0x8'));var querystring=require(_0xd028('0x10'));var Papa=require(_0xd028('0x11'));var Redis=require(_0xd028('0x12'));var authService=require(_0xd028('0x13'));var qs=require(_0xd028('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd028('0x15'));var logger=require(_0xd028('0x16'))(_0xd028('0x17'));var utils=require(_0xd028('0x18'));var config=require(_0xd028('0x19'));var licenseUtil=require(_0xd028('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x34b5fa,_0x144696){_0x144696=_0x144696||0xcc;return function(_0x4817a4){if(_0x4817a4){return _0x34b5fa[_0xd028('0x1b')](_0x144696);}return _0x34b5fa[_0xd028('0x1c')](_0x144696)[_0xd028('0x1d')]();};}function respondWithResult(_0x17b112,_0x1667bf){_0x1667bf=_0x1667bf||0xc8;return function(_0x5ec067){if(_0x5ec067){return _0x17b112[_0xd028('0x1c')](_0x1667bf)[_0xd028('0x1e')](_0x5ec067);}};}function respondWithFilteredResult(_0x3937b4,_0x3bac54){return function(_0x12450d){if(_0x12450d){var _0x463d38=typeof _0x3bac54['offset']===_0xd028('0x1f')&&typeof _0x3bac54['limit']===_0xd028('0x1f');var _0x2f4af6=_0x12450d[_0xd028('0x20')];var _0x4df54f=_0x463d38?0x0:_0x3bac54[_0xd028('0x21')];var _0x5a47a6=_0x463d38?_0x12450d[_0xd028('0x20')]:_0x3bac54['offset']+_0x3bac54[_0xd028('0x22')];var _0x415d6c;if(_0x5a47a6>=_0x2f4af6){_0x5a47a6=_0x2f4af6;_0x415d6c=0xc8;}else{_0x415d6c=0xce;}_0x3937b4[_0xd028('0x1c')](_0x415d6c);return _0x3937b4['set'](_0xd028('0x23'),_0x4df54f+'-'+_0x5a47a6+'/'+_0x2f4af6)[_0xd028('0x1e')](_0x12450d);}return null;};}function patchUpdates(_0x1a2767){return function(_0x1648a7){try{jsonpatch[_0xd028('0x24')](_0x1648a7,_0x1a2767,!![]);}catch(_0x4830a4){return BPromise[_0xd028('0x25')](_0x4830a4);}return _0x1648a7[_0xd028('0x26')]();};}function saveUpdates(_0x8a964d,_0x75657f){return function(_0x3203f9){if(_0x3203f9){return _0x3203f9[_0xd028('0x27')](_0x8a964d)[_0xd028('0x28')](function(_0x54beee){return _0x54beee;});}return null;};}function removeEntity(_0x115fef,_0x10d629){return function(_0x13e5f4){if(_0x13e5f4){return _0x13e5f4[_0xd028('0x29')]()['then'](function(){_0x115fef[_0xd028('0x1c')](0xcc)[_0xd028('0x1d')]();});}};}function handleEntityNotFound(_0x26eb4e,_0x3249ea){return function(_0x5b9f3d){if(!_0x5b9f3d){_0x26eb4e[_0xd028('0x1b')](0x194);}return _0x5b9f3d;};}function handleError(_0x128c63,_0x115004){_0x115004=_0x115004||0x1f4;return function(_0x3481be){logger[_0xd028('0x2a')](_0x3481be[_0xd028('0x2b')]);if(_0x3481be[_0xd028('0x2c')]){delete _0x3481be[_0xd028('0x2c')];}_0x128c63[_0xd028('0x1c')](_0x115004)[_0xd028('0x2d')](_0x3481be);};}exports[_0xd028('0x2e')]=function(_0x3112e8,_0x112578){var _0x17594f={},_0x23d9dd={},_0x3b46bb={'count':0x0,'rows':[]};var _0x5d6f95=_['map'](db[_0xd028('0x2f')][_0xd028('0x30')],function(_0x2caf5d){return{'name':_0x2caf5d[_0xd028('0x31')],'type':_0x2caf5d[_0xd028('0x32')][_0xd028('0x33')]};});_0x23d9dd['model']=_['map'](_0x5d6f95,_0xd028('0x2c'));_0x23d9dd[_0xd028('0x34')]=_[_0xd028('0x35')](_0x3112e8[_0xd028('0x34')]);_0x23d9dd[_0xd028('0x36')]=_[_0xd028('0x37')](_0x23d9dd[_0xd028('0x38')],_0x23d9dd['query']);_0x17594f['attributes']=_[_0xd028('0x37')](_0x23d9dd[_0xd028('0x38')],qs['fields'](_0x3112e8['query'][_0xd028('0x39')]));_0x17594f[_0xd028('0x3a')]=_0x17594f[_0xd028('0x3a')][_0xd028('0x3b')]?_0x17594f[_0xd028('0x3a')]:_0x23d9dd[_0xd028('0x38')];if(!_0x3112e8[_0xd028('0x34')][_0xd028('0x3c')](_0xd028('0x3d'))){_0x17594f[_0xd028('0x22')]=qs[_0xd028('0x22')](_0x3112e8['query']['limit']);_0x17594f['offset']=qs['offset'](_0x3112e8['query'][_0xd028('0x21')]);}_0x17594f['order']=qs['sort'](_0x3112e8['query'][_0xd028('0x3e')]);_0x17594f['where']=qs[_0xd028('0x36')](_['pick'](_0x3112e8['query'],_0x23d9dd[_0xd028('0x36')]),_0x5d6f95);if(_0x3112e8[_0xd028('0x34')]['filter']){_0x17594f[_0xd028('0x3f')]=_['merge'](_0x17594f['where'],{'$or':_['map'](_0x5d6f95,function(_0x5941ed){if(_0x5941ed['type']!==_0xd028('0x40')){var _0x24ba63={};_0x24ba63[_0x5941ed['name']]={'$like':'%'+_0x3112e8[_0xd028('0x34')][_0xd028('0x41')]+'%'};return _0x24ba63;}})});}_0x17594f=_[_0xd028('0x42')]({},_0x17594f,_0x3112e8[_0xd028('0x43')]);var _0xc79c76={'where':_0x17594f[_0xd028('0x3f')]};return db['FaxQueueReport'][_0xd028('0x20')](_0xc79c76)[_0xd028('0x28')](function(_0x2d5fab){_0x3b46bb['count']=_0x2d5fab;if(_0x3112e8[_0xd028('0x34')][_0xd028('0x44')]){_0x17594f[_0xd028('0x45')]=[{'all':!![]}];}return db['FaxQueueReport'][_0xd028('0x46')](_0x17594f);})['then'](function(_0x26e51c){_0x3b46bb[_0xd028('0x47')]=_0x26e51c;return _0x3b46bb;})[_0xd028('0x28')](respondWithFilteredResult(_0x112578,_0x17594f))[_0xd028('0x48')](handleError(_0x112578,null));};exports[_0xd028('0x49')]=function(_0x3f86ed,_0x1de847){var _0x42a3fc={'raw':!![],'where':{'id':_0x3f86ed['params']['id']}},_0x3065f2={};_0x3065f2[_0xd028('0x38')]=_[_0xd028('0x35')](db[_0xd028('0x2f')][_0xd028('0x30')]);_0x3065f2['query']=_[_0xd028('0x35')](_0x3f86ed[_0xd028('0x34')]);_0x3065f2[_0xd028('0x36')]=_['intersection'](_0x3065f2[_0xd028('0x38')],_0x3065f2[_0xd028('0x34')]);_0x42a3fc['attributes']=_[_0xd028('0x37')](_0x3065f2[_0xd028('0x38')],qs[_0xd028('0x39')](_0x3f86ed[_0xd028('0x34')][_0xd028('0x39')]));_0x42a3fc[_0xd028('0x3a')]=_0x42a3fc[_0xd028('0x3a')][_0xd028('0x3b')]?_0x42a3fc[_0xd028('0x3a')]:_0x3065f2[_0xd028('0x38')];if(_0x3f86ed['query'][_0xd028('0x44')]){_0x42a3fc[_0xd028('0x45')]=[{'all':!![]}];}_0x42a3fc=_[_0xd028('0x42')]({},_0x42a3fc,_0x3f86ed[_0xd028('0x43')]);return db[_0xd028('0x2f')][_0xd028('0x4a')](_0x42a3fc)['then'](handleEntityNotFound(_0x1de847,null))[_0xd028('0x28')](respondWithResult(_0x1de847,null))[_0xd028('0x48')](handleError(_0x1de847,null));};exports[_0xd028('0x4b')]=function(_0xf0bd53,_0x30d7b6){return db['FaxQueueReport']['create'](_0xf0bd53['body'],{})['then'](respondWithResult(_0x30d7b6,0xc9))[_0xd028('0x48')](handleError(_0x30d7b6,null));};exports[_0xd028('0x27')]=function(_0x2ca45d,_0x3db4b8){if(_0x2ca45d[_0xd028('0x4c')]['id']){delete _0x2ca45d[_0xd028('0x4c')]['id'];}return db[_0xd028('0x2f')][_0xd028('0x4a')]({'where':{'id':_0x2ca45d[_0xd028('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3db4b8,null))[_0xd028('0x28')](saveUpdates(_0x2ca45d[_0xd028('0x4c')],null))[_0xd028('0x28')](respondWithResult(_0x3db4b8,null))[_0xd028('0x48')](handleError(_0x3db4b8,null));};exports[_0xd028('0x29')]=function(_0x13b619,_0x4a2c39){return db['FaxQueueReport'][_0xd028('0x4a')]({'where':{'id':_0x13b619[_0xd028('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a2c39,null))[_0xd028('0x28')](removeEntity(_0x4a2c39,null))[_0xd028('0x48')](handleError(_0x4a2c39,null));};exports[_0xd028('0x4e')]=function(_0x1d337d,_0x29d5d2){return db[_0xd028('0x2f')][_0xd028('0x4e')]()[_0xd028('0x28')](respondWithResult(_0x29d5d2,null))[_0xd028('0x48')](handleError(_0x29d5d2,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 3779164..c6d5aa1 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 _0x5fab=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','util','api'];(function(_0x12d57b,_0x8b3641){var _0x37c897=function(_0x26e4f1){while(--_0x26e4f1){_0x12d57b['push'](_0x12d57b['shift']());}};_0x37c897(++_0x8b3641);}(_0x5fab,0x177));var _0xb5fa=function(_0x3333a6,_0x2c1150){_0x3333a6=_0x3333a6-0x0;var _0x36f253=_0x5fab[_0x3333a6];return _0x36f253;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[{'name':_0xb5fa('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x326f=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid','lodash'];(function(_0x435548,_0x424769){var _0x404fdb=function(_0x3224fc){while(--_0x3224fc){_0x435548['push'](_0x435548['shift']());}};_0x404fdb(++_0x424769);}(_0x326f,0xd1));var _0xf326=function(_0x987874,_0x2cd758){_0x987874=_0x987874-0x0;var _0x4efd91=_0x326f[_0x987874];return _0x4efd91;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf326('0x1'));var moment=require(_0xf326('0x2'));var BPromise=require(_0xf326('0x3'));var rp=require(_0xf326('0x4'));var fs=require('fs');var path=require(_0xf326('0x5'));var rimraf=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var attributes=require(_0xf326('0x8'));module[_0xf326('0x9')]=function(_0x3ace29,_0x4c2249){return _0x3ace29[_0xf326('0xa')](_0xf326('0xb'),attributes,{'tableName':_0xf326('0xc'),'paranoid':![],'indexes':[{'name':_0xf326('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 8e5815f..078fad6 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 _0xd2ee=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','create','body','options','raw','CreateFaxQueueReport','debug','update','where','attributes','limit','UpdateFaxQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x322cae,_0x347b10){var _0x24d1d8=function(_0x2514c3){while(--_0x2514c3){_0x322cae['push'](_0x322cae['shift']());}};_0x24d1d8(++_0x347b10);}(_0xd2ee,0x96));var _0xed2e=function(_0x385a0c,_0x19838f){_0x385a0c=_0x385a0c-0x0;var _0x49d136=_0xd2ee[_0x385a0c];return _0x49d136;};'use strict';var _=require('lodash');var util=require(_0xed2e('0x0'));var moment=require('moment');var BPromise=require(_0xed2e('0x1'));var rs=require(_0xed2e('0x2'));var fs=require('fs');var Redis=require(_0xed2e('0x3'));var db=require(_0xed2e('0x4'))['db'];var utils=require(_0xed2e('0x5'));var logger=require('../../config/logger')(_0xed2e('0x6'));var config=require(_0xed2e('0x7'));var jayson=require(_0xed2e('0x8'));var client=jayson[_0xed2e('0x9')][_0xed2e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x49a84e,_0x279717,_0x1caf95){return new BPromise(function(_0x342006,_0x5ecbf8){return client['request'](_0x49a84e,_0x1caf95)[_0xed2e('0xb')](function(_0x213bc4){logger[_0xed2e('0xc')](_0xed2e('0xd'),_0x279717,_0xed2e('0xe'));logger['debug'](_0xed2e('0xf'),_0x279717,_0xed2e('0xe'),JSON[_0xed2e('0x10')](_0x213bc4));if(_0x213bc4[_0xed2e('0x11')]){if(_0x213bc4[_0xed2e('0x11')]['code']===0x1f4){logger[_0xed2e('0x11')](_0xed2e('0xd'),_0x279717,_0x213bc4['error'][_0xed2e('0x12')]);return _0x5ecbf8(_0x213bc4['error'][_0xed2e('0x12')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x279717,_0x213bc4[_0xed2e('0x11')][_0xed2e('0x12')]);return _0x342006(_0x213bc4['error'][_0xed2e('0x12')]);}else{logger[_0xed2e('0xc')](_0xed2e('0xd'),_0x279717,_0xed2e('0xe'));_0x342006(_0x213bc4['result'][_0xed2e('0x12')]);}})[_0xed2e('0x13')](function(_0x4dbab7){logger[_0xed2e('0x11')](_0xed2e('0xd'),_0x279717,_0x4dbab7);_0x5ecbf8(_0x4dbab7);});});}exports['CreateFaxQueueReport']=function(_0x4b9870){var _0x4a0a0e=this;return new Promise(function(_0x1d69c5,_0x278f41){return db['FaxQueueReport'][_0xed2e('0x14')](_0x4b9870[_0xed2e('0x15')],{'raw':_0x4b9870[_0xed2e('0x16')]?_0x4b9870['options'][_0xed2e('0x17')]===undefined?!![]:![]:!![]})[_0xed2e('0xb')](function(_0x1a5ed1){logger[_0xed2e('0xc')](_0xed2e('0x18'),_0x4b9870);logger[_0xed2e('0x19')](_0xed2e('0x18'),_0x4b9870,JSON[_0xed2e('0x10')](_0x1a5ed1));_0x1d69c5(_0x1a5ed1);})[_0xed2e('0x13')](function(_0x536bab){logger['error'](_0xed2e('0x18'),_0x536bab[_0xed2e('0x12')],_0x4b9870);_0x278f41(_0x4a0a0e[_0xed2e('0x11')](0x1f4,_0x536bab['message']));});});};exports['UpdateFaxQueueReport']=function(_0x23942d){var _0x166707=this;return new Promise(function(_0x4dc1af,_0x25080f){return db['FaxQueueReport'][_0xed2e('0x1a')](_0x23942d[_0xed2e('0x15')],{'raw':_0x23942d[_0xed2e('0x16')]?_0x23942d['options'][_0xed2e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23942d[_0xed2e('0x16')]?_0x23942d[_0xed2e('0x16')][_0xed2e('0x1b')]||null:null,'attributes':_0x23942d['options']?_0x23942d[_0xed2e('0x16')][_0xed2e('0x1c')]||null:null,'limit':_0x23942d['options']?_0x23942d[_0xed2e('0x16')][_0xed2e('0x1d')]||null:null})['then'](function(_0x53578b){logger[_0xed2e('0xc')](_0xed2e('0x1e'),_0x23942d);logger[_0xed2e('0x19')]('UpdateFaxQueueReport',_0x23942d,JSON[_0xed2e('0x10')](_0x53578b));_0x4dc1af(_0x53578b);})[_0xed2e('0x13')](function(_0x29b670){logger['error'](_0xed2e('0x1e'),_0x29b670[_0xed2e('0x12')],_0x23942d);_0x25080f(_0x166707['error'](0x1f4,_0x29b670[_0xed2e('0x12')]));});});}; \ No newline at end of file +var _0x0f3d=['where','attributes','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','CreateFaxQueueReport','FaxQueueReport','create','raw','stringify','UpdateFaxQueueReport','update','options'];(function(_0x14ab74,_0xb6751d){var _0x170852=function(_0x3dbf5a){while(--_0x3dbf5a){_0x14ab74['push'](_0x14ab74['shift']());}};_0x170852(++_0xb6751d);}(_0x0f3d,0x94));var _0xd0f3=function(_0x56bc44,_0x4b9e7c){_0x56bc44=_0x56bc44-0x0;var _0x592a81=_0x0f3d[_0x56bc44];return _0x592a81;};'use strict';var _=require(_0xd0f3('0x0'));var util=require('util');var moment=require(_0xd0f3('0x1'));var BPromise=require(_0xd0f3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd0f3('0x3'));var db=require(_0xd0f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0f3('0x5'))(_0xd0f3('0x6'));var config=require('../../config/environment');var jayson=require(_0xd0f3('0x7'));var client=jayson[_0xd0f3('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f2e12,_0x4caa55,_0x4d6e92){return new BPromise(function(_0x5a4f12,_0xb33c33){return client[_0xd0f3('0x9')](_0x5f2e12,_0x4d6e92)[_0xd0f3('0xa')](function(_0x59eac0){logger[_0xd0f3('0xb')](_0xd0f3('0xc'),_0x4caa55,_0xd0f3('0xd'));logger[_0xd0f3('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x4caa55,_0xd0f3('0xd'),JSON['stringify'](_0x59eac0));if(_0x59eac0['error']){if(_0x59eac0[_0xd0f3('0xf')][_0xd0f3('0x10')]===0x1f4){logger[_0xd0f3('0xf')](_0xd0f3('0xc'),_0x4caa55,_0x59eac0[_0xd0f3('0xf')][_0xd0f3('0x11')]);return _0xb33c33(_0x59eac0[_0xd0f3('0xf')]['message']);}logger[_0xd0f3('0xf')](_0xd0f3('0xc'),_0x4caa55,_0x59eac0[_0xd0f3('0xf')][_0xd0f3('0x11')]);return _0x5a4f12(_0x59eac0['error'][_0xd0f3('0x11')]);}else{logger[_0xd0f3('0xb')](_0xd0f3('0xc'),_0x4caa55,'request\x20sent');_0x5a4f12(_0x59eac0['result'][_0xd0f3('0x11')]);}})['catch'](function(_0x133616){logger[_0xd0f3('0xf')](_0xd0f3('0xc'),_0x4caa55,_0x133616);_0xb33c33(_0x133616);});});}exports[_0xd0f3('0x12')]=function(_0x9c05ad){var _0x3cad95=this;return new Promise(function(_0x4abbf9,_0x4f88e1){return db[_0xd0f3('0x13')][_0xd0f3('0x14')](_0x9c05ad['body'],{'raw':_0x9c05ad['options']?_0x9c05ad['options'][_0xd0f3('0x15')]===undefined?!![]:![]:!![]})[_0xd0f3('0xa')](function(_0x178d6d){logger[_0xd0f3('0xb')](_0xd0f3('0x12'),_0x9c05ad);logger[_0xd0f3('0xe')](_0xd0f3('0x12'),_0x9c05ad,JSON[_0xd0f3('0x16')](_0x178d6d));_0x4abbf9(_0x178d6d);})['catch'](function(_0xf99699){logger['error'](_0xd0f3('0x12'),_0xf99699[_0xd0f3('0x11')],_0x9c05ad);_0x4f88e1(_0x3cad95['error'](0x1f4,_0xf99699[_0xd0f3('0x11')]));});});};exports[_0xd0f3('0x17')]=function(_0x1b5298){var _0xb56825=this;return new Promise(function(_0x18931e,_0xfb0aed){return db[_0xd0f3('0x13')][_0xd0f3('0x18')](_0x1b5298['body'],{'raw':_0x1b5298[_0xd0f3('0x19')]?_0x1b5298[_0xd0f3('0x19')][_0xd0f3('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5298['options']?_0x1b5298[_0xd0f3('0x19')][_0xd0f3('0x1a')]||null:null,'attributes':_0x1b5298['options']?_0x1b5298[_0xd0f3('0x19')][_0xd0f3('0x1b')]||null:null,'limit':_0x1b5298[_0xd0f3('0x19')]?_0x1b5298[_0xd0f3('0x19')][_0xd0f3('0x1c')]||null:null})[_0xd0f3('0xa')](function(_0x514251){logger[_0xd0f3('0xb')](_0xd0f3('0x17'),_0x1b5298);logger[_0xd0f3('0xe')](_0xd0f3('0x17'),_0x1b5298,JSON[_0xd0f3('0x16')](_0x514251));_0x18931e(_0x514251);})['catch'](function(_0x36b514){logger[_0xd0f3('0xf')](_0xd0f3('0x17'),_0x36b514['message'],_0x1b5298);_0xfb0aed(_0xb56825[_0xd0f3('0xf')](0x1f4,_0x36b514[_0xd0f3('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 877dc6e..86d7842 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 _0x2fee=['connect-timeout','express','Router','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','put','update','exports','multer','util'];(function(_0x2d7299,_0x17a248){var _0x127632=function(_0x2b6458){while(--_0x2b6458){_0x2d7299['push'](_0x2d7299['shift']());}};_0x127632(++_0x17a248);}(_0x2fee,0x139));var _0xe2fe=function(_0x1d8b1d,_0x11d691){_0x1d8b1d=_0x1d8b1d-0x0;var _0x109ed1=_0x2fee[_0x1d8b1d];return _0x109ed1;};'use strict';var multer=require(_0xe2fe('0x0'));var util=require(_0xe2fe('0x1'));var path=require('path');var timeout=require(_0xe2fe('0x2'));var express=require(_0xe2fe('0x3'));var router=express[_0xe2fe('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe2fe('0x5'));var controller=require(_0xe2fe('0x6'));router[_0xe2fe('0x7')]('/',auth[_0xe2fe('0x8')](),controller[_0xe2fe('0x9')]);router['get'](_0xe2fe('0xa'),auth[_0xe2fe('0x8')](),controller['describe']);router[_0xe2fe('0x7')](_0xe2fe('0xb'),auth[_0xe2fe('0x8')](),controller['show']);router['post']('/',auth[_0xe2fe('0x8')](),controller['create']);router[_0xe2fe('0xc')](_0xe2fe('0xb'),auth['isAuthenticated'](),controller[_0xe2fe('0xd')]);router['delete'](_0xe2fe('0xb'),auth[_0xe2fe('0x8')](),controller['destroy']);module[_0xe2fe('0xe')]=router; \ No newline at end of file +var _0x0e55=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','update','delete','exports','util','path','connect-timeout','express','fs-extra'];(function(_0x15e3dc,_0x2d2180){var _0x5b82b8=function(_0x5d58e3){while(--_0x5d58e3){_0x15e3dc['push'](_0x15e3dc['shift']());}};_0x5b82b8(++_0x2d2180);}(_0x0e55,0x121));var _0x50e5=function(_0x575157,_0x16bd1e){_0x575157=_0x575157-0x0;var _0x9b3b5d=_0x0e55[_0x575157];return _0x9b3b5d;};'use strict';var multer=require('multer');var util=require(_0x50e5('0x0'));var path=require(_0x50e5('0x1'));var timeout=require(_0x50e5('0x2'));var express=require(_0x50e5('0x3'));var router=express['Router']();var fs_extra=require(_0x50e5('0x4'));var auth=require(_0x50e5('0x5'));var interaction=require(_0x50e5('0x6'));var config=require(_0x50e5('0x7'));var controller=require(_0x50e5('0x8'));router[_0x50e5('0x9')]('/',auth['isAuthenticated'](),controller[_0x50e5('0xa')]);router[_0x50e5('0x9')](_0x50e5('0xb'),auth['isAuthenticated'](),controller[_0x50e5('0xc')]);router[_0x50e5('0x9')](_0x50e5('0xd'),auth[_0x50e5('0xe')](),controller[_0x50e5('0xf')]);router[_0x50e5('0x10')]('/',auth[_0x50e5('0xe')](),controller[_0x50e5('0x11')]);router['put']('/:id',auth[_0x50e5('0xe')](),controller[_0x50e5('0x12')]);router[_0x50e5('0x13')](_0x50e5('0xd'),auth[_0x50e5('0xe')](),controller['destroy']);module[_0x50e5('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 863c279..c33cc7f 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 _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x181d73,_0x6fe366){var _0x15b375=function(_0x323ef7){while(--_0x323ef7){_0x181d73['push'](_0x181d73['shift']());}};_0x15b375(++_0x6fe366);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x00bb[_0x5447fd];return _0x15b28a;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x12e118,_0xc67f2a){var _0x34da7a=function(_0xb7fbd1){while(--_0xb7fbd1){_0x12e118['push'](_0x12e118['shift']());}};_0x34da7a(++_0xc67f2a);}(_0xedd9,0xfc));var _0x9edd=function(_0x2b372c,_0x1ecdfe){_0x2b372c=_0x2b372c-0x0;var _0x519cef=_0xedd9[_0x2b372c];return _0x519cef;};'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/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index ba15015..14f5302 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 _0x8790=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','includeAll','findAll','rows','catch','show','keys','include','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x2bebfa,_0x486722){var _0x26b925=function(_0xc09cd1){while(--_0xc09cd1){_0x2bebfa['push'](_0x2bebfa['shift']());}};_0x26b925(++_0x486722);}(_0x8790,0x84));var _0x0879=function(_0x185708,_0x64bda0){_0x185708=_0x185708-0x0;var _0x5d7048=_0x8790[_0x185708];return _0x5d7048;};'use strict';var emlformat=require(_0x0879('0x0'));var rimraf=require(_0x0879('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0879('0x2'));var rp=require(_0x0879('0x3'));var moment=require(_0x0879('0x4'));var BPromise=require(_0x0879('0x5'));var Mustache=require(_0x0879('0x6'));var util=require('util');var path=require(_0x0879('0x7'));var sox=require(_0x0879('0x8'));var csv=require(_0x0879('0x9'));var ejs=require(_0x0879('0xa'));var fs=require('fs');var fs_extra=require(_0x0879('0xb'));var _=require(_0x0879('0xc'));var squel=require(_0x0879('0xd'));var crypto=require('crypto');var jsforce=require(_0x0879('0xe'));var deskjs=require(_0x0879('0xf'));var toCsv=require(_0x0879('0x9'));var querystring=require(_0x0879('0x10'));var Papa=require(_0x0879('0x11'));var Redis=require(_0x0879('0x12'));var authService=require(_0x0879('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0879('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0879('0x15'))(_0x0879('0x16'));var utils=require(_0x0879('0x17'));var config=require(_0x0879('0x18'));var licenseUtil=require(_0x0879('0x19'));var db=require(_0x0879('0x1a'))['db'];function respondWithStatusCode(_0x4dd831,_0x18b97e){_0x18b97e=_0x18b97e||0xcc;return function(_0x14d60b){if(_0x14d60b){return _0x4dd831['sendStatus'](_0x18b97e);}return _0x4dd831[_0x0879('0x1b')](_0x18b97e)[_0x0879('0x1c')]();};}function respondWithResult(_0x3660ca,_0x37e6d3){_0x37e6d3=_0x37e6d3||0xc8;return function(_0x6ed5cc){if(_0x6ed5cc){return _0x3660ca[_0x0879('0x1b')](_0x37e6d3)[_0x0879('0x1d')](_0x6ed5cc);}};}function respondWithFilteredResult(_0x27a4b6,_0xe7de27){return function(_0x2b5676){if(_0x2b5676){var _0x4c2e21=typeof _0xe7de27[_0x0879('0x1e')]===_0x0879('0x1f')&&typeof _0xe7de27[_0x0879('0x20')]===_0x0879('0x1f');var _0x294e9a=_0x2b5676['count'];var _0xa166b4=_0x4c2e21?0x0:_0xe7de27['offset'];var _0x5e9ee8=_0x4c2e21?_0x2b5676[_0x0879('0x21')]:_0xe7de27[_0x0879('0x1e')]+_0xe7de27[_0x0879('0x20')];var _0x1a535c;if(_0x5e9ee8>=_0x294e9a){_0x5e9ee8=_0x294e9a;_0x1a535c=0xc8;}else{_0x1a535c=0xce;}_0x27a4b6[_0x0879('0x1b')](_0x1a535c);return _0x27a4b6[_0x0879('0x22')]('Content-Range',_0xa166b4+'-'+_0x5e9ee8+'/'+_0x294e9a)[_0x0879('0x1d')](_0x2b5676);}return null;};}function patchUpdates(_0x2406b5){return function(_0x58dbf8){try{jsonpatch[_0x0879('0x23')](_0x58dbf8,_0x2406b5,!![]);}catch(_0x412b27){return BPromise[_0x0879('0x24')](_0x412b27);}return _0x58dbf8[_0x0879('0x25')]();};}function saveUpdates(_0x52719f,_0x15349c){return function(_0x138710){if(_0x138710){return _0x138710[_0x0879('0x26')](_0x52719f)[_0x0879('0x27')](function(_0x48f84a){return _0x48f84a;});}return null;};}function removeEntity(_0x34b7fa,_0x418f53){return function(_0x8e593e){if(_0x8e593e){return _0x8e593e['destroy']()['then'](function(){_0x34b7fa[_0x0879('0x1b')](0xcc)[_0x0879('0x1c')]();});}};}function handleEntityNotFound(_0x2d9d50,_0x1fc839){return function(_0x2260cb){if(!_0x2260cb){_0x2d9d50[_0x0879('0x28')](0x194);}return _0x2260cb;};}function handleError(_0xfb9498,_0x1add27){_0x1add27=_0x1add27||0x1f4;return function(_0xcdd7a0){logger['error'](_0xcdd7a0['stack']);if(_0xcdd7a0['name']){delete _0xcdd7a0[_0x0879('0x29')];}_0xfb9498[_0x0879('0x1b')](_0x1add27)[_0x0879('0x2a')](_0xcdd7a0);};}exports['index']=function(_0x250277,_0x35e84c){var _0x1a4090={},_0x307983={},_0x3c8ff1={'count':0x0,'rows':[]};var _0x592701=_[_0x0879('0x2b')](db[_0x0879('0x2c')][_0x0879('0x2d')],function(_0x40da94){return{'name':_0x40da94[_0x0879('0x2e')],'type':_0x40da94[_0x0879('0x2f')]['key']};});_0x307983[_0x0879('0x30')]=_[_0x0879('0x2b')](_0x592701,_0x0879('0x29'));_0x307983[_0x0879('0x31')]=_['keys'](_0x250277[_0x0879('0x31')]);_0x307983[_0x0879('0x32')]=_[_0x0879('0x33')](_0x307983['model'],_0x307983['query']);_0x1a4090['attributes']=_[_0x0879('0x33')](_0x307983[_0x0879('0x30')],qs[_0x0879('0x34')](_0x250277[_0x0879('0x31')][_0x0879('0x34')]));_0x1a4090[_0x0879('0x35')]=_0x1a4090['attributes'][_0x0879('0x36')]?_0x1a4090[_0x0879('0x35')]:_0x307983['model'];if(!_0x250277['query'][_0x0879('0x37')]('nolimit')){_0x1a4090[_0x0879('0x20')]=qs[_0x0879('0x20')](_0x250277[_0x0879('0x31')][_0x0879('0x20')]);_0x1a4090['offset']=qs[_0x0879('0x1e')](_0x250277[_0x0879('0x31')][_0x0879('0x1e')]);}_0x1a4090[_0x0879('0x38')]=qs[_0x0879('0x39')](_0x250277[_0x0879('0x31')][_0x0879('0x39')]);_0x1a4090[_0x0879('0x3a')]=qs[_0x0879('0x32')](_[_0x0879('0x3b')](_0x250277[_0x0879('0x31')],_0x307983[_0x0879('0x32')]),_0x592701);if(_0x250277[_0x0879('0x31')]['filter']){_0x1a4090[_0x0879('0x3a')]=_[_0x0879('0x3c')](_0x1a4090[_0x0879('0x3a')],{'$or':_[_0x0879('0x2b')](_0x592701,function(_0x2193da){if(_0x2193da[_0x0879('0x2f')]!==_0x0879('0x3d')){var _0x15989b={};_0x15989b[_0x2193da[_0x0879('0x29')]]={'$like':'%'+_0x250277[_0x0879('0x31')]['filter']+'%'};return _0x15989b;}})});}_0x1a4090=_[_0x0879('0x3c')]({},_0x1a4090,_0x250277['options']);var _0x36c928={'where':_0x1a4090[_0x0879('0x3a')]};return db['FaxTransferReport'][_0x0879('0x21')](_0x36c928)[_0x0879('0x27')](function(_0x52854a){_0x3c8ff1['count']=_0x52854a;if(_0x250277['query'][_0x0879('0x3e')]){_0x1a4090['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x0879('0x3f')](_0x1a4090);})[_0x0879('0x27')](function(_0x30b5b2){_0x3c8ff1[_0x0879('0x40')]=_0x30b5b2;return _0x3c8ff1;})[_0x0879('0x27')](respondWithFilteredResult(_0x35e84c,_0x1a4090))[_0x0879('0x41')](handleError(_0x35e84c,null));};exports[_0x0879('0x42')]=function(_0x95f365,_0x24c7ec){var _0x450d3e={'raw':!![],'where':{'id':_0x95f365['params']['id']}},_0x4862c5={};_0x4862c5[_0x0879('0x30')]=_['keys'](db[_0x0879('0x2c')][_0x0879('0x2d')]);_0x4862c5[_0x0879('0x31')]=_[_0x0879('0x43')](_0x95f365[_0x0879('0x31')]);_0x4862c5[_0x0879('0x32')]=_[_0x0879('0x33')](_0x4862c5[_0x0879('0x30')],_0x4862c5[_0x0879('0x31')]);_0x450d3e[_0x0879('0x35')]=_[_0x0879('0x33')](_0x4862c5[_0x0879('0x30')],qs[_0x0879('0x34')](_0x95f365[_0x0879('0x31')][_0x0879('0x34')]));_0x450d3e['attributes']=_0x450d3e[_0x0879('0x35')][_0x0879('0x36')]?_0x450d3e[_0x0879('0x35')]:_0x4862c5[_0x0879('0x30')];if(_0x95f365[_0x0879('0x31')]['includeAll']){_0x450d3e[_0x0879('0x44')]=[{'all':!![]}];}_0x450d3e=_[_0x0879('0x3c')]({},_0x450d3e,_0x95f365['options']);return db['FaxTransferReport'][_0x0879('0x45')](_0x450d3e)[_0x0879('0x27')](handleEntityNotFound(_0x24c7ec,null))['then'](respondWithResult(_0x24c7ec,null))[_0x0879('0x41')](handleError(_0x24c7ec,null));};exports[_0x0879('0x46')]=function(_0x4faa97,_0x3d690d){return db[_0x0879('0x2c')]['create'](_0x4faa97['body'],{})[_0x0879('0x27')](respondWithResult(_0x3d690d,0xc9))[_0x0879('0x41')](handleError(_0x3d690d,null));};exports[_0x0879('0x26')]=function(_0x1e4b73,_0xb0d75f){if(_0x1e4b73[_0x0879('0x47')]['id']){delete _0x1e4b73[_0x0879('0x47')]['id'];}return db[_0x0879('0x2c')]['find']({'where':{'id':_0x1e4b73[_0x0879('0x48')]['id']}})[_0x0879('0x27')](handleEntityNotFound(_0xb0d75f,null))[_0x0879('0x27')](saveUpdates(_0x1e4b73[_0x0879('0x47')],null))[_0x0879('0x27')](respondWithResult(_0xb0d75f,null))['catch'](handleError(_0xb0d75f,null));};exports['destroy']=function(_0x189016,_0x45d4f5){return db[_0x0879('0x2c')][_0x0879('0x45')]({'where':{'id':_0x189016[_0x0879('0x48')]['id']}})[_0x0879('0x27')](handleEntityNotFound(_0x45d4f5,null))[_0x0879('0x27')](removeEntity(_0x45d4f5,null))[_0x0879('0x41')](handleError(_0x45d4f5,null));};exports[_0x0879('0x49')]=function(_0x2dc236,_0x4948c0){return db[_0x0879('0x2c')][_0x0879('0x49')]()['then'](respondWithResult(_0x4948c0,null))[_0x0879('0x41')](handleError(_0x4948c0,null));}; \ No newline at end of file +var _0x81b3=['then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','FaxTransferReport','includeAll','include','findAll','show','find','catch','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update'];(function(_0x4a6699,_0x115a0a){var _0x436bfc=function(_0xa3b96e){while(--_0xa3b96e){_0x4a6699['push'](_0x4a6699['shift']());}};_0x436bfc(++_0x115a0a);}(_0x81b3,0x1ad));var _0x381b=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x81b3[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x381b('0x0'));var rimraf=require(_0x381b('0x1'));var zipdir=require(_0x381b('0x2'));var jsonpatch=require(_0x381b('0x3'));var rp=require(_0x381b('0x4'));var moment=require('moment');var BPromise=require(_0x381b('0x5'));var Mustache=require(_0x381b('0x6'));var util=require('util');var path=require(_0x381b('0x7'));var sox=require(_0x381b('0x8'));var csv=require(_0x381b('0x9'));var ejs=require(_0x381b('0xa'));var fs=require('fs');var fs_extra=require(_0x381b('0xb'));var _=require('lodash');var squel=require(_0x381b('0xc'));var crypto=require(_0x381b('0xd'));var jsforce=require(_0x381b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x381b('0x9'));var querystring=require(_0x381b('0xf'));var Papa=require(_0x381b('0x10'));var Redis=require('ioredis');var authService=require(_0x381b('0x11'));var qs=require(_0x381b('0x12'));var as=require(_0x381b('0x13'));var hardwareService=require(_0x381b('0x14'));var logger=require(_0x381b('0x15'))(_0x381b('0x16'));var utils=require(_0x381b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x381b('0x18'));var db=require(_0x381b('0x19'))['db'];function respondWithStatusCode(_0x317755,_0x552e83){_0x552e83=_0x552e83||0xcc;return function(_0x20b0a0){if(_0x20b0a0){return _0x317755['sendStatus'](_0x552e83);}return _0x317755[_0x381b('0x1a')](_0x552e83)[_0x381b('0x1b')]();};}function respondWithResult(_0x3995ac,_0x8d1a85){_0x8d1a85=_0x8d1a85||0xc8;return function(_0x316399){if(_0x316399){return _0x3995ac[_0x381b('0x1a')](_0x8d1a85)['json'](_0x316399);}};}function respondWithFilteredResult(_0x2e7c2b,_0xaaa61){return function(_0x1807ea){if(_0x1807ea){var _0x4abf20=typeof _0xaaa61[_0x381b('0x1c')]===_0x381b('0x1d')&&typeof _0xaaa61[_0x381b('0x1e')]===_0x381b('0x1d');var _0x1c588f=_0x1807ea[_0x381b('0x1f')];var _0x36bf5b=_0x4abf20?0x0:_0xaaa61[_0x381b('0x1c')];var _0x28691d=_0x4abf20?_0x1807ea[_0x381b('0x1f')]:_0xaaa61[_0x381b('0x1c')]+_0xaaa61[_0x381b('0x1e')];var _0x3bbe81;if(_0x28691d>=_0x1c588f){_0x28691d=_0x1c588f;_0x3bbe81=0xc8;}else{_0x3bbe81=0xce;}_0x2e7c2b['status'](_0x3bbe81);return _0x2e7c2b[_0x381b('0x20')](_0x381b('0x21'),_0x36bf5b+'-'+_0x28691d+'/'+_0x1c588f)[_0x381b('0x22')](_0x1807ea);}return null;};}function patchUpdates(_0x390a55){return function(_0x1f6b02){try{jsonpatch[_0x381b('0x23')](_0x1f6b02,_0x390a55,!![]);}catch(_0x1a4110){return BPromise[_0x381b('0x24')](_0x1a4110);}return _0x1f6b02[_0x381b('0x25')]();};}function saveUpdates(_0x527355,_0x1b96e4){return function(_0x4f483d){if(_0x4f483d){return _0x4f483d[_0x381b('0x26')](_0x527355)[_0x381b('0x27')](function(_0x4955be){return _0x4955be;});}return null;};}function removeEntity(_0x20b649,_0x10a3cb){return function(_0x113a4f){if(_0x113a4f){return _0x113a4f[_0x381b('0x28')]()[_0x381b('0x27')](function(){_0x20b649[_0x381b('0x1a')](0xcc)[_0x381b('0x1b')]();});}};}function handleEntityNotFound(_0x481201,_0x2b7afc){return function(_0x451732){if(!_0x451732){_0x481201[_0x381b('0x29')](0x194);}return _0x451732;};}function handleError(_0x2f1d22,_0x4589e0){_0x4589e0=_0x4589e0||0x1f4;return function(_0x10a471){logger['error'](_0x10a471[_0x381b('0x2a')]);if(_0x10a471[_0x381b('0x2b')]){delete _0x10a471['name'];}_0x2f1d22[_0x381b('0x1a')](_0x4589e0)[_0x381b('0x2c')](_0x10a471);};}exports['index']=function(_0x18b4de,_0x26ca28){var _0x26fd7d={},_0x35bfde={},_0x4ca855={'count':0x0,'rows':[]};var _0x3da525=_[_0x381b('0x2d')](db['FaxTransferReport'][_0x381b('0x2e')],function(_0x2f2617){return{'name':_0x2f2617[_0x381b('0x2f')],'type':_0x2f2617[_0x381b('0x30')][_0x381b('0x31')]};});_0x35bfde['model']=_[_0x381b('0x2d')](_0x3da525,_0x381b('0x2b'));_0x35bfde[_0x381b('0x32')]=_[_0x381b('0x33')](_0x18b4de[_0x381b('0x32')]);_0x35bfde[_0x381b('0x34')]=_[_0x381b('0x35')](_0x35bfde[_0x381b('0x36')],_0x35bfde[_0x381b('0x32')]);_0x26fd7d[_0x381b('0x37')]=_[_0x381b('0x35')](_0x35bfde[_0x381b('0x36')],qs[_0x381b('0x38')](_0x18b4de[_0x381b('0x32')][_0x381b('0x38')]));_0x26fd7d[_0x381b('0x37')]=_0x26fd7d['attributes'][_0x381b('0x39')]?_0x26fd7d[_0x381b('0x37')]:_0x35bfde['model'];if(!_0x18b4de['query'][_0x381b('0x3a')]('nolimit')){_0x26fd7d[_0x381b('0x1e')]=qs['limit'](_0x18b4de[_0x381b('0x32')][_0x381b('0x1e')]);_0x26fd7d['offset']=qs[_0x381b('0x1c')](_0x18b4de[_0x381b('0x32')][_0x381b('0x1c')]);}_0x26fd7d[_0x381b('0x3b')]=qs[_0x381b('0x3c')](_0x18b4de[_0x381b('0x32')][_0x381b('0x3c')]);_0x26fd7d[_0x381b('0x3d')]=qs[_0x381b('0x34')](_[_0x381b('0x3e')](_0x18b4de['query'],_0x35bfde['filters']),_0x3da525);if(_0x18b4de[_0x381b('0x32')][_0x381b('0x3f')]){_0x26fd7d[_0x381b('0x3d')]=_['merge'](_0x26fd7d[_0x381b('0x3d')],{'$or':_[_0x381b('0x2d')](_0x3da525,function(_0x52955d){if(_0x52955d[_0x381b('0x30')]!==_0x381b('0x40')){var _0x3b7163={};_0x3b7163[_0x52955d[_0x381b('0x2b')]]={'$like':'%'+_0x18b4de[_0x381b('0x32')]['filter']+'%'};return _0x3b7163;}})});}_0x26fd7d=_[_0x381b('0x41')]({},_0x26fd7d,_0x18b4de[_0x381b('0x42')]);var _0x565930={'where':_0x26fd7d['where']};return db[_0x381b('0x43')][_0x381b('0x1f')](_0x565930)[_0x381b('0x27')](function(_0x35f092){_0x4ca855[_0x381b('0x1f')]=_0x35f092;if(_0x18b4de[_0x381b('0x32')][_0x381b('0x44')]){_0x26fd7d[_0x381b('0x45')]=[{'all':!![]}];}return db[_0x381b('0x43')][_0x381b('0x46')](_0x26fd7d);})[_0x381b('0x27')](function(_0x5e0456){_0x4ca855['rows']=_0x5e0456;return _0x4ca855;})[_0x381b('0x27')](respondWithFilteredResult(_0x26ca28,_0x26fd7d))['catch'](handleError(_0x26ca28,null));};exports[_0x381b('0x47')]=function(_0xf6103a,_0x35d6ef){var _0x46626a={'raw':!![],'where':{'id':_0xf6103a['params']['id']}},_0x25fc7d={};_0x25fc7d['model']=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x25fc7d[_0x381b('0x32')]=_[_0x381b('0x33')](_0xf6103a[_0x381b('0x32')]);_0x25fc7d[_0x381b('0x34')]=_[_0x381b('0x35')](_0x25fc7d[_0x381b('0x36')],_0x25fc7d[_0x381b('0x32')]);_0x46626a[_0x381b('0x37')]=_[_0x381b('0x35')](_0x25fc7d[_0x381b('0x36')],qs[_0x381b('0x38')](_0xf6103a['query']['fields']));_0x46626a[_0x381b('0x37')]=_0x46626a[_0x381b('0x37')]['length']?_0x46626a[_0x381b('0x37')]:_0x25fc7d['model'];if(_0xf6103a[_0x381b('0x32')][_0x381b('0x44')]){_0x46626a[_0x381b('0x45')]=[{'all':!![]}];}_0x46626a=_[_0x381b('0x41')]({},_0x46626a,_0xf6103a['options']);return db['FaxTransferReport'][_0x381b('0x48')](_0x46626a)[_0x381b('0x27')](handleEntityNotFound(_0x35d6ef,null))[_0x381b('0x27')](respondWithResult(_0x35d6ef,null))[_0x381b('0x49')](handleError(_0x35d6ef,null));};exports[_0x381b('0x4a')]=function(_0x21e3e6,_0x4bbfd1){return db[_0x381b('0x43')]['create'](_0x21e3e6['body'],{})[_0x381b('0x27')](respondWithResult(_0x4bbfd1,0xc9))[_0x381b('0x49')](handleError(_0x4bbfd1,null));};exports[_0x381b('0x26')]=function(_0x1435f1,_0x33567c){if(_0x1435f1[_0x381b('0x4b')]['id']){delete _0x1435f1['body']['id'];}return db[_0x381b('0x43')][_0x381b('0x48')]({'where':{'id':_0x1435f1['params']['id']}})[_0x381b('0x27')](handleEntityNotFound(_0x33567c,null))[_0x381b('0x27')](saveUpdates(_0x1435f1[_0x381b('0x4b')],null))['then'](respondWithResult(_0x33567c,null))[_0x381b('0x49')](handleError(_0x33567c,null));};exports[_0x381b('0x28')]=function(_0x5e9bdb,_0x5afff0){return db['FaxTransferReport'][_0x381b('0x48')]({'where':{'id':_0x5e9bdb[_0x381b('0x4c')]['id']}})[_0x381b('0x27')](handleEntityNotFound(_0x5afff0,null))[_0x381b('0x27')](removeEntity(_0x5afff0,null))[_0x381b('0x49')](handleError(_0x5afff0,null));};exports[_0x381b('0x4d')]=function(_0x3753e5,_0x18134a){return db['FaxTransferReport'][_0x381b('0x4d')]()['then'](respondWithResult(_0x18134a,null))[_0x381b('0x49')](handleError(_0x18134a,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index b54c785..5ffeb3e 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 _0xd89b=['path','rimraf','../../config/environment','exports','FaxTransferReport','report_fax_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x301373,_0x3fdaab){var _0x257692=function(_0x5657f0){while(--_0x5657f0){_0x301373['push'](_0x301373['shift']());}};_0x257692(++_0x3fdaab);}(_0xd89b,0xca));var _0xbd89=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xd89b[_0x3d42d8];return _0x27fc41;};'use strict';var _=require('lodash');var util=require(_0xbd89('0x0'));var logger=require(_0xbd89('0x1'))(_0xbd89('0x2'));var moment=require(_0xbd89('0x3'));var BPromise=require(_0xbd89('0x4'));var rp=require(_0xbd89('0x5'));var fs=require('fs');var path=require(_0xbd89('0x6'));var rimraf=require(_0xbd89('0x7'));var config=require(_0xbd89('0x8'));var attributes=require('./faxTransferReport.attributes');module[_0xbd89('0x9')]=function(_0x51dde7,_0x585c10){return _0x51dde7['define'](_0xbd89('0xa'),attributes,{'tableName':_0xbd89('0xb'),'paranoid':![],'indexes':[{'name':_0xbd89('0xc'),'fields':[_0xbd89('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf8ea=['FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define'];(function(_0x2cdb41,_0x398473){var _0x624994=function(_0x15ae00){while(--_0x15ae00){_0x2cdb41['push'](_0x2cdb41['shift']());}};_0x624994(++_0x398473);}(_0xf8ea,0x1bf));var _0xaf8e=function(_0x486acc,_0x2c8e31){_0x486acc=_0x486acc-0x0;var _0x56ea0a=_0xf8ea[_0x486acc];return _0x56ea0a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaf8e('0x0'))(_0xaf8e('0x1'));var moment=require(_0xaf8e('0x2'));var BPromise=require('bluebird');var rp=require(_0xaf8e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf8e('0x4'));var config=require(_0xaf8e('0x5'));var attributes=require(_0xaf8e('0x6'));module[_0xaf8e('0x7')]=function(_0x2cfaf8,_0xaf59ef){return _0x2cfaf8[_0xaf8e('0x8')](_0xaf8e('0x9'),attributes,{'tableName':_0xaf8e('0xa'),'paranoid':![],'indexes':[{'name':_0xaf8e('0xb'),'fields':[_0xaf8e('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 45dca8e..6e018c1 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 _0x00c3=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','code','error','FaxTransferReport,\x20%s,\x20%s','message'];(function(_0x17c07c,_0x35d4bd){var _0x4f6b34=function(_0x4b7140){while(--_0x4b7140){_0x17c07c['push'](_0x17c07c['shift']());}};_0x4f6b34(++_0x35d4bd);}(_0x00c3,0x17d));var _0x300c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x00c3[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x300c('0x0'));var util=require(_0x300c('0x1'));var moment=require(_0x300c('0x2'));var BPromise=require(_0x300c('0x3'));var rs=require(_0x300c('0x4'));var fs=require('fs');var Redis=require(_0x300c('0x5'));var db=require(_0x300c('0x6'))['db'];var utils=require(_0x300c('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x300c('0x8'));var client=jayson['client'][_0x300c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x170a0e,_0x40e0a7,_0x49ae65){return new BPromise(function(_0x7124fa,_0x4d1406){return client[_0x300c('0xa')](_0x170a0e,_0x49ae65)['then'](function(_0x335bb0){logger[_0x300c('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x40e0a7,_0x300c('0xc'));logger[_0x300c('0xd')](_0x300c('0xe'),_0x40e0a7,_0x300c('0xc'),JSON['stringify'](_0x335bb0));if(_0x335bb0['error']){if(_0x335bb0['error'][_0x300c('0xf')]===0x1f4){logger[_0x300c('0x10')](_0x300c('0x11'),_0x40e0a7,_0x335bb0[_0x300c('0x10')][_0x300c('0x12')]);return _0x4d1406(_0x335bb0['error'][_0x300c('0x12')]);}logger[_0x300c('0x10')](_0x300c('0x11'),_0x40e0a7,_0x335bb0['error'][_0x300c('0x12')]);return _0x7124fa(_0x335bb0[_0x300c('0x10')][_0x300c('0x12')]);}else{logger['info'](_0x300c('0x11'),_0x40e0a7,_0x300c('0xc'));_0x7124fa(_0x335bb0[_0x300c('0x13')]['message']);}})['catch'](function(_0x22f867){logger[_0x300c('0x10')]('FaxTransferReport,\x20%s,\x20%s',_0x40e0a7,_0x22f867);_0x4d1406(_0x22f867);});});} \ No newline at end of file +var _0x0c70=['util','moment','bluebird','randomstring','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','FaxTransferReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x0c70,0x1b8));var _0x00c7=function(_0x540041,_0x388ca0){_0x540041=_0x540041-0x0;var _0x5a4898=_0x0c70[_0x540041];return _0x5a4898;};'use strict';var _=require(_0x00c7('0x0'));var util=require(_0x00c7('0x1'));var moment=require(_0x00c7('0x2'));var BPromise=require(_0x00c7('0x3'));var rs=require(_0x00c7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x00c7('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x00c7('0x6'));var client=jayson[_0x00c7('0x7')][_0x00c7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x365d5,_0x2a29a7,_0x6c88cc){return new BPromise(function(_0x3939cb,_0xa26f05){return client[_0x00c7('0x9')](_0x365d5,_0x6c88cc)[_0x00c7('0xa')](function(_0x1c5d3a){logger[_0x00c7('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x2a29a7,_0x00c7('0xc'));logger[_0x00c7('0xd')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2a29a7,_0x00c7('0xc'),JSON[_0x00c7('0xe')](_0x1c5d3a));if(_0x1c5d3a[_0x00c7('0xf')]){if(_0x1c5d3a['error'][_0x00c7('0x10')]===0x1f4){logger[_0x00c7('0xf')](_0x00c7('0x11'),_0x2a29a7,_0x1c5d3a[_0x00c7('0xf')]['message']);return _0xa26f05(_0x1c5d3a[_0x00c7('0xf')]['message']);}logger[_0x00c7('0xf')](_0x00c7('0x11'),_0x2a29a7,_0x1c5d3a[_0x00c7('0xf')][_0x00c7('0x12')]);return _0x3939cb(_0x1c5d3a[_0x00c7('0xf')]['message']);}else{logger[_0x00c7('0xb')](_0x00c7('0x11'),_0x2a29a7,_0x00c7('0xc'));_0x3939cb(_0x1c5d3a[_0x00c7('0x13')][_0x00c7('0x12')]);}})[_0x00c7('0x14')](function(_0x61539){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2a29a7,_0x61539);_0xa26f05(_0x61539);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index cd8b10f..4039e71 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 _0xcb49=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x387ea4,_0x1d7f2a){var _0x2c47f4=function(_0x1e8bcd){while(--_0x1e8bcd){_0x387ea4['push'](_0x387ea4['shift']());}};_0x2c47f4(++_0x1d7f2a);}(_0xcb49,0x1ca));var _0x9cb4=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0xcb49[_0x421cf8];return _0x145c48;};'use strict';var multer=require(_0x9cb4('0x0'));var util=require(_0x9cb4('0x1'));var path=require(_0x9cb4('0x2'));var timeout=require(_0x9cb4('0x3'));var express=require('express');var router=express[_0x9cb4('0x4')]();var fs_extra=require(_0x9cb4('0x5'));var auth=require(_0x9cb4('0x6'));var interaction=require(_0x9cb4('0x7'));var config=require(_0x9cb4('0x8'));var controller=require(_0x9cb4('0x9'));router[_0x9cb4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9cb4('0xa')]('/describe',auth[_0x9cb4('0xb')](),controller[_0x9cb4('0xc')]);router[_0x9cb4('0xa')](_0x9cb4('0xd'),auth[_0x9cb4('0xb')](),controller[_0x9cb4('0xe')]);router[_0x9cb4('0xf')]('/',auth[_0x9cb4('0xb')](),controller[_0x9cb4('0x10')]);router[_0x9cb4('0x11')](_0x9cb4('0xd'),auth[_0x9cb4('0xb')](),controller[_0x9cb4('0x12')]);router[_0x9cb4('0x13')]('/:id',auth[_0x9cb4('0xb')](),controller[_0x9cb4('0x14')]);module[_0x9cb4('0x15')]=router; \ No newline at end of file +var _0x9e35=['../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x233992,_0x410a43){var _0x19cb73=function(_0x28bd0e){while(--_0x28bd0e){_0x233992['push'](_0x233992['shift']());}};_0x19cb73(++_0x410a43);}(_0x9e35,0x187));var _0x59e3=function(_0x4c94ef,_0x5e3d0b){_0x4c94ef=_0x4c94ef-0x0;var _0x430eaf=_0x9e35[_0x4c94ef];return _0x430eaf;};'use strict';var multer=require(_0x59e3('0x0'));var util=require(_0x59e3('0x1'));var path=require(_0x59e3('0x2'));var timeout=require(_0x59e3('0x3'));var express=require(_0x59e3('0x4'));var router=express[_0x59e3('0x5')]();var fs_extra=require(_0x59e3('0x6'));var auth=require(_0x59e3('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x59e3('0x8'));var controller=require(_0x59e3('0x9'));router[_0x59e3('0xa')]('/',auth[_0x59e3('0xb')](),controller[_0x59e3('0xc')]);router[_0x59e3('0xa')](_0x59e3('0xd'),auth[_0x59e3('0xb')](),controller[_0x59e3('0xe')]);router[_0x59e3('0xa')](_0x59e3('0xf'),auth[_0x59e3('0xb')](),controller['show']);router[_0x59e3('0x10')]('/',auth[_0x59e3('0xb')](),controller[_0x59e3('0x11')]);router[_0x59e3('0x12')](_0x59e3('0xf'),auth[_0x59e3('0xb')](),controller['update']);router[_0x59e3('0x13')](_0x59e3('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x59e3('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index c53b86a..e6065ae 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 _0x84cd=['../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2266d7,_0x3b8290){var _0x44fde9=function(_0x364b0b){while(--_0x364b0b){_0x2266d7['push'](_0x2266d7['shift']());}};_0x44fde9(++_0x3b8290);}(_0x84cd,0xb2));var _0xd84c=function(_0x3c5dd0,_0x2c1ce9){_0x3c5dd0=_0x3c5dd0-0x0;var _0x40519e=_0x84cd[_0x3c5dd0];return _0x40519e;};'use strict';var multer=require(_0xd84c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd84c('0x1'));var express=require(_0xd84c('0x2'));var router=express[_0xd84c('0x3')]();var fs_extra=require(_0xd84c('0x4'));var auth=require(_0xd84c('0x5'));var interaction=require(_0xd84c('0x6'));var config=require(_0xd84c('0x7'));var controller=require(_0xd84c('0x8'));router[_0xd84c('0x9')]('/',auth['isAuthenticated'](),controller[_0xd84c('0xa')]);router[_0xd84c('0x9')](_0xd84c('0xb'),auth[_0xd84c('0xc')](),controller[_0xd84c('0xd')]);router['get'](_0xd84c('0xe'),auth[_0xd84c('0xc')](),controller['getConfigurations']);router['get'](_0xd84c('0xf'),auth[_0xd84c('0xc')](),controller[_0xd84c('0x10')]);router[_0xd84c('0x11')]('/',auth[_0xd84c('0xc')](),controller[_0xd84c('0x12')]);router[_0xd84c('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd84c('0x13')]);router[_0xd84c('0x14')]('/:id',auth[_0xd84c('0xc')](),controller['update']);router[_0xd84c('0x15')](_0xd84c('0xb'),auth[_0xd84c('0xc')](),controller['destroy']);module[_0xd84c('0x16')]=router; \ No newline at end of file +var _0xc81e=['get','show','/:id/configurations','getConfigurations','getFields','create','post','addConfiguration','put','/:id','update','delete','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x45d640,_0x1456c3){var _0x21d588=function(_0x323e36){while(--_0x323e36){_0x45d640['push'](_0x45d640['shift']());}};_0x21d588(++_0x1456c3);}(_0xc81e,0x109));var _0xec81=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0xc81e[_0x413b4d];return _0x8b810a;};'use strict';var multer=require(_0xec81('0x0'));var util=require(_0xec81('0x1'));var path=require(_0xec81('0x2'));var timeout=require('connect-timeout');var express=require(_0xec81('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xec81('0x4'));var config=require(_0xec81('0x5'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0xec81('0x6')](),controller[_0xec81('0x7')]);router[_0xec81('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xec81('0x9')]);router[_0xec81('0x8')](_0xec81('0xa'),auth[_0xec81('0x6')](),controller[_0xec81('0xb')]);router[_0xec81('0x8')]('/:id/fields',auth[_0xec81('0x6')](),controller[_0xec81('0xc')]);router['post']('/',auth[_0xec81('0x6')](),controller[_0xec81('0xd')]);router[_0xec81('0xe')](_0xec81('0xa'),auth[_0xec81('0x6')](),controller[_0xec81('0xf')]);router[_0xec81('0x10')](_0xec81('0x11'),auth[_0xec81('0x6')](),controller[_0xec81('0x12')]);router[_0xec81('0x13')](_0xec81('0x11'),auth[_0xec81('0x6')](),controller['destroy']);module[_0xec81('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 815027d..191393c 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 _0x98b6=['STRING','ENUM','basic','integrationTab','newTab','sequelize','exports'];(function(_0x34a765,_0x165925){var _0x1d3bd9=function(_0x2e0f87){while(--_0x2e0f87){_0x34a765['push'](_0x34a765['shift']());}};_0x1d3bd9(++_0x165925);}(_0x98b6,0x83));var _0x698b=function(_0x191b4c,_0x4c6b87){_0x191b4c=_0x191b4c-0x0;var _0x492997=_0x98b6[_0x191b4c];return _0x492997;};'use strict';var Sequelize=require(_0x698b('0x0'));module[_0x698b('0x1')]={'name':{'type':Sequelize[_0x698b('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x698b('0x2')]},'authType':{'type':Sequelize[_0x698b('0x3')](_0x698b('0x4')),'defaultValue':_0x698b('0x4')},'password':{'type':Sequelize[_0x698b('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x698b('0x2')]},'token':{'type':Sequelize[_0x698b('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x698b('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x698b('0x3')](_0x698b('0x5'),_0x698b('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x93e3=['basic','integrationTab','exports','STRING','ENUM'];(function(_0x1428a7,_0x17f607){var _0xcabdf2=function(_0x2d9c05){while(--_0x2d9c05){_0x1428a7['push'](_0x1428a7['shift']());}};_0xcabdf2(++_0x17f607);}(_0x93e3,0x9d));var _0x393e=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x93e3[_0x19dd7a];return _0x3feb6a;};'use strict';var Sequelize=require('sequelize');module[_0x393e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x393e('0x1')]},'username':{'type':Sequelize[_0x393e('0x1')]},'remoteUri':{'type':Sequelize[_0x393e('0x1')]},'authType':{'type':Sequelize[_0x393e('0x2')](_0x393e('0x3')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x393e('0x1')]},'consumerKey':{'type':Sequelize[_0x393e('0x1')]},'consumerSecret':{'type':Sequelize[_0x393e('0x1')]},'token':{'type':Sequelize[_0x393e('0x1')]},'tokenSecret':{'type':Sequelize[_0x393e('0x1')]},'serverUrl':{'type':Sequelize[_0x393e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x393e('0x2')](_0x393e('0x4'),'newTab'),'defaultValue':_0x393e('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 59d3b3a..0b44f63 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 _0x5535=['rows','catch','show','keys','length','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','getSubjects','channel','Descriptions','DeskField','getFields','priority','remoteUri','username','password','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','authType','basic','headers','format','Basic\x20%s','%s:%s','toString','base64','concat','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','undefined','limit','offset','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','DeskAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','where','includeAll','include','findAll'];(function(_0xb2c246,_0x55ebaf){var _0x55a51f=function(_0x30baeb){while(--_0x30baeb){_0xb2c246['push'](_0xb2c246['shift']());}};_0x55a51f(++_0x55ebaf);}(_0x5535,0x1e5));var _0x5553=function(_0x2d815b,_0x2e7084){_0x2d815b=_0x2d815b-0x0;var _0x2d58c9=_0x5535[_0x2d815b];return _0x2d58c9;};'use strict';var emlformat=require(_0x5553('0x0'));var rimraf=require(_0x5553('0x1'));var zipdir=require(_0x5553('0x2'));var jsonpatch=require(_0x5553('0x3'));var rp=require(_0x5553('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x5553('0x5'));var sox=require(_0x5553('0x6'));var csv=require(_0x5553('0x7'));var ejs=require(_0x5553('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5553('0x9'));var squel=require(_0x5553('0xa'));var crypto=require(_0x5553('0xb'));var jsforce=require(_0x5553('0xc'));var deskjs=require(_0x5553('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5553('0xe'));var Redis=require(_0x5553('0xf'));var authService=require(_0x5553('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5553('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5553('0x12'));var utils=require('../../config/utils');var config=require(_0x5553('0x13'));var licenseUtil=require(_0x5553('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5553('0x15'));function respondWithStatusCode(_0x3a03f2,_0x1d353f){_0x1d353f=_0x1d353f||0xcc;return function(_0x1a83b5){if(_0x1a83b5){return _0x3a03f2[_0x5553('0x16')](_0x1d353f);}return _0x3a03f2['status'](_0x1d353f)[_0x5553('0x17')]();};}function respondWithResult(_0x4c1867,_0x209fbf){_0x209fbf=_0x209fbf||0xc8;return function(_0x359e7e){if(_0x359e7e){return _0x4c1867[_0x5553('0x18')](_0x209fbf)['json'](_0x359e7e);}};}function respondWithFilteredResult(_0x564f46,_0x32c4ae){return function(_0x50e65b){if(_0x50e65b){var _0x3afa9e=typeof _0x32c4ae['offset']===_0x5553('0x19')&&typeof _0x32c4ae[_0x5553('0x1a')]===_0x5553('0x19');var _0x1c12d5=_0x50e65b['count'];var _0x1e3e99=_0x3afa9e?0x0:_0x32c4ae[_0x5553('0x1b')];var _0x3894ce=_0x3afa9e?_0x50e65b['count']:_0x32c4ae['offset']+_0x32c4ae['limit'];var _0x1ae3d8;if(_0x3894ce>=_0x1c12d5){_0x3894ce=_0x1c12d5;_0x1ae3d8=0xc8;}else{_0x1ae3d8=0xce;}_0x564f46[_0x5553('0x18')](_0x1ae3d8);return _0x564f46[_0x5553('0x1c')](_0x5553('0x1d'),_0x1e3e99+'-'+_0x3894ce+'/'+_0x1c12d5)[_0x5553('0x1e')](_0x50e65b);}return null;};}function patchUpdates(_0x46c6ce){return function(_0x37622a){try{jsonpatch[_0x5553('0x1f')](_0x37622a,_0x46c6ce,!![]);}catch(_0x4f24ce){return BPromise[_0x5553('0x20')](_0x4f24ce);}return _0x37622a['save']();};}function saveUpdates(_0x3395f6,_0x40d769){return function(_0x55c599){if(_0x55c599){return _0x55c599[_0x5553('0x21')](_0x3395f6)[_0x5553('0x22')](function(_0x5013b7){return _0x5013b7;});}return null;};}function removeEntity(_0x1f6ec0,_0x57da37){return function(_0x3fe748){if(_0x3fe748){return _0x3fe748[_0x5553('0x23')]()[_0x5553('0x22')](function(){_0x1f6ec0['status'](0xcc)[_0x5553('0x17')]();});}};}function handleEntityNotFound(_0x1de355,_0x2188d6){return function(_0x45bad4){if(!_0x45bad4){_0x1de355['sendStatus'](0x194);}return _0x45bad4;};}function handleError(_0x2dd46e,_0x10fad9){_0x10fad9=_0x10fad9||0x1f4;return function(_0x22daeb){logger[_0x5553('0x24')](_0x22daeb[_0x5553('0x25')]);if(_0x22daeb[_0x5553('0x26')]){delete _0x22daeb['name'];}_0x2dd46e[_0x5553('0x18')](_0x10fad9)['send'](_0x22daeb);};}exports[_0x5553('0x27')]=function(_0x3386a6,_0x5c2912){var _0x50888d={},_0x1330d7={},_0x131297={'count':0x0,'rows':[]};var _0x53480a=_[_0x5553('0x28')](db[_0x5553('0x29')][_0x5553('0x2a')],function(_0x24fba9){return{'name':_0x24fba9[_0x5553('0x2b')],'type':_0x24fba9[_0x5553('0x2c')][_0x5553('0x2d')]};});_0x1330d7[_0x5553('0x2e')]=_[_0x5553('0x28')](_0x53480a,_0x5553('0x26'));_0x1330d7[_0x5553('0x2f')]=_['keys'](_0x3386a6[_0x5553('0x2f')]);_0x1330d7['filters']=_[_0x5553('0x30')](_0x1330d7[_0x5553('0x2e')],_0x1330d7[_0x5553('0x2f')]);_0x50888d[_0x5553('0x31')]=_[_0x5553('0x30')](_0x1330d7[_0x5553('0x2e')],qs['fields'](_0x3386a6['query'][_0x5553('0x32')]));_0x50888d[_0x5553('0x31')]=_0x50888d[_0x5553('0x31')]['length']?_0x50888d[_0x5553('0x31')]:_0x1330d7[_0x5553('0x2e')];if(!_0x3386a6[_0x5553('0x2f')][_0x5553('0x33')](_0x5553('0x34'))){_0x50888d[_0x5553('0x1a')]=qs[_0x5553('0x1a')](_0x3386a6[_0x5553('0x2f')]['limit']);_0x50888d[_0x5553('0x1b')]=qs[_0x5553('0x1b')](_0x3386a6['query'][_0x5553('0x1b')]);}_0x50888d[_0x5553('0x35')]=qs['sort'](_0x3386a6[_0x5553('0x2f')][_0x5553('0x36')]);_0x50888d['where']=qs[_0x5553('0x37')](_[_0x5553('0x38')](_0x3386a6[_0x5553('0x2f')],_0x1330d7[_0x5553('0x37')]),_0x53480a);if(_0x3386a6[_0x5553('0x2f')][_0x5553('0x39')]){_0x50888d['where']=_[_0x5553('0x3a')](_0x50888d['where'],{'$or':_[_0x5553('0x28')](_0x53480a,function(_0x4cd12c){if(_0x4cd12c[_0x5553('0x2c')]!==_0x5553('0x3b')){var _0x423ffe={};_0x423ffe[_0x4cd12c[_0x5553('0x26')]]={'$like':'%'+_0x3386a6[_0x5553('0x2f')][_0x5553('0x39')]+'%'};return _0x423ffe;}})});}_0x50888d=_[_0x5553('0x3a')]({},_0x50888d,_0x3386a6[_0x5553('0x3c')]);var _0x4abb40={'where':_0x50888d[_0x5553('0x3d')]};return db[_0x5553('0x29')]['count'](_0x4abb40)['then'](function(_0x130a95){_0x131297['count']=_0x130a95;if(_0x3386a6[_0x5553('0x2f')][_0x5553('0x3e')]){_0x50888d[_0x5553('0x3f')]=[{'all':!![]}];}return db['DeskAccount'][_0x5553('0x40')](_0x50888d);})['then'](function(_0x3b7713){_0x131297[_0x5553('0x41')]=_0x3b7713;return _0x131297;})[_0x5553('0x22')](respondWithFilteredResult(_0x5c2912,_0x50888d))[_0x5553('0x42')](handleError(_0x5c2912,null));};exports[_0x5553('0x43')]=function(_0x28c412,_0x50429a){var _0x46c116={'raw':![],'where':{'id':_0x28c412['params']['id']}},_0x3f43b2={};_0x3f43b2['model']=_['keys'](db[_0x5553('0x29')][_0x5553('0x2a')]);_0x3f43b2[_0x5553('0x2f')]=_[_0x5553('0x44')](_0x28c412[_0x5553('0x2f')]);_0x3f43b2['filters']=_['intersection'](_0x3f43b2[_0x5553('0x2e')],_0x3f43b2[_0x5553('0x2f')]);_0x46c116[_0x5553('0x31')]=_[_0x5553('0x30')](_0x3f43b2[_0x5553('0x2e')],qs['fields'](_0x28c412[_0x5553('0x2f')][_0x5553('0x32')]));_0x46c116['attributes']=_0x46c116[_0x5553('0x31')][_0x5553('0x45')]?_0x46c116[_0x5553('0x31')]:_0x3f43b2[_0x5553('0x2e')];if(_0x28c412[_0x5553('0x2f')][_0x5553('0x3e')]){_0x46c116[_0x5553('0x3f')]=[{'all':!![]}];}_0x46c116=_[_0x5553('0x3a')]({},_0x46c116,_0x28c412[_0x5553('0x3c')]);return db[_0x5553('0x29')][_0x5553('0x46')](_0x46c116)[_0x5553('0x22')](handleEntityNotFound(_0x50429a,null))['then'](respondWithResult(_0x50429a,null))[_0x5553('0x42')](handleError(_0x50429a,null));};exports[_0x5553('0x47')]=function(_0x5aebe7,_0x15ddc7){return db[_0x5553('0x29')][_0x5553('0x47')](_0x5aebe7['body'],{})[_0x5553('0x22')](respondWithResult(_0x15ddc7,0xc9))[_0x5553('0x42')](handleError(_0x15ddc7,null));};exports[_0x5553('0x21')]=function(_0x5300d5,_0x472c65){if(_0x5300d5['body']['id']){delete _0x5300d5[_0x5553('0x48')]['id'];}return db[_0x5553('0x29')][_0x5553('0x46')]({'where':{'id':_0x5300d5[_0x5553('0x49')]['id']}})['then'](handleEntityNotFound(_0x472c65,null))[_0x5553('0x22')](saveUpdates(_0x5300d5[_0x5553('0x48')],null))[_0x5553('0x22')](respondWithResult(_0x472c65,null))[_0x5553('0x42')](handleError(_0x472c65,null));};exports[_0x5553('0x23')]=function(_0x3d9ca7,_0xe32fad){return db[_0x5553('0x29')][_0x5553('0x46')]({'where':{'id':_0x3d9ca7[_0x5553('0x49')]['id']}})['then'](handleEntityNotFound(_0xe32fad,null))[_0x5553('0x22')](removeEntity(_0xe32fad,null))[_0x5553('0x42')](handleError(_0xe32fad,null));};exports[_0x5553('0x4a')]=function(_0x19c28f,_0x41efa3,_0x1f845f){var _0x1e6628={};var _0x1aa35d={};var _0x3112a5;var _0x382a41;return db[_0x5553('0x29')][_0x5553('0x4b')]({'where':{'id':_0x19c28f[_0x5553('0x49')]['id']}})[_0x5553('0x22')](handleEntityNotFound(_0x41efa3,null))['then'](function(_0x4c6599){if(_0x4c6599){_0x3112a5=_0x4c6599;_0x1aa35d[_0x5553('0x2e')]=_[_0x5553('0x44')](db['DeskConfiguration'][_0x5553('0x2a')]);_0x1aa35d['query']=_[_0x5553('0x44')](_0x19c28f[_0x5553('0x2f')]);_0x1aa35d[_0x5553('0x37')]=_[_0x5553('0x30')](_0x1aa35d[_0x5553('0x2e')],_0x1aa35d[_0x5553('0x2f')]);_0x1e6628['attributes']=_[_0x5553('0x30')](_0x1aa35d[_0x5553('0x2e')],qs[_0x5553('0x32')](_0x19c28f[_0x5553('0x2f')][_0x5553('0x32')]));_0x1e6628[_0x5553('0x31')]=_0x1e6628[_0x5553('0x31')][_0x5553('0x45')]?_0x1e6628[_0x5553('0x31')]:_0x1aa35d['model'];_0x1e6628[_0x5553('0x35')]=qs['sort'](_0x19c28f[_0x5553('0x2f')][_0x5553('0x36')]);_0x1e6628['where']=qs[_0x5553('0x37')](_['pick'](_0x19c28f['query'],_0x1aa35d[_0x5553('0x37')]));if(_0x19c28f['query'][_0x5553('0x39')]){_0x1e6628['where']=_['merge'](_0x1e6628[_0x5553('0x3d')],{'$or':_['map'](_0x1e6628[_0x5553('0x31')],function(_0xf5568){var _0x39123d={};_0x39123d[_0xf5568]={'$like':'%'+_0x19c28f[_0x5553('0x2f')][_0x5553('0x39')]+'%'};return _0x39123d;})});}_0x1e6628=_[_0x5553('0x3a')]({},_0x1e6628,_0x19c28f[_0x5553('0x3c')]);return _0x3112a5[_0x5553('0x4a')](_0x1e6628);}})[_0x5553('0x22')](function(_0x3f7f40){if(_0x3f7f40){_0x382a41=_0x3f7f40[_0x5553('0x45')];if(!_0x19c28f[_0x5553('0x2f')][_0x5553('0x33')](_0x5553('0x34'))){_0x1e6628[_0x5553('0x1a')]=qs[_0x5553('0x1a')](_0x19c28f['query']['limit']);_0x1e6628[_0x5553('0x1b')]=qs[_0x5553('0x1b')](_0x19c28f[_0x5553('0x2f')][_0x5553('0x1b')]);}return _0x3112a5['getConfigurations'](_0x1e6628);}})[_0x5553('0x22')](function(_0x1e653c){if(_0x1e653c){return _0x1e653c?{'count':_0x382a41,'rows':_0x1e653c}:null;}})[_0x5553('0x22')](respondWithResult(_0x41efa3,null))[_0x5553('0x42')](handleError(_0x41efa3,null));};exports[_0x5553('0x4c')]=function(_0x573c1b,_0x1434e8,_0x3bcaec){if(_0x573c1b[_0x5553('0x48')]['id']){delete _0x573c1b[_0x5553('0x48')]['id'];}return db[_0x5553('0x29')]['findOne']({'where':{'id':_0x573c1b[_0x5553('0x49')]['id']}})['then'](handleEntityNotFound(_0x1434e8,null))['then'](function(_0x490f32){if(_0x490f32){_0x573c1b[_0x5553('0x48')][_0x5553('0x4d')]=_0x490f32['id'];_0x573c1b['body']['Subjects']=integrations[_0x5553('0x4e')](_0x573c1b[_0x5553('0x48')][_0x5553('0x4f')],_0x573c1b['body'][_0x5553('0x2c')]);_0x573c1b['body'][_0x5553('0x50')]=integrations['getDescriptions'](_0x573c1b['body']['channel'],_0x573c1b[_0x5553('0x48')][_0x5553('0x2c')]);return db['DeskConfiguration'][_0x5553('0x47')](_0x573c1b[_0x5553('0x48')],{'include':[{'model':db[_0x5553('0x51')],'as':'Subjects'},{'model':db['DeskField'],'as':_0x5553('0x50')}]});}return null;})[_0x5553('0x22')](respondWithResult(_0x1434e8,null))[_0x5553('0x42')](handleError(_0x1434e8,null));};exports[_0x5553('0x52')]=function(_0x7ed3b,_0x169ae2,_0x4c97b2){var _0x2537a3=[{'name':_0x5553('0x53'),'label':_0x5553('0x53'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x788dc2='';return db[_0x5553('0x29')][_0x5553('0x4b')]({'where':{'id':_0x7ed3b[_0x5553('0x49')]['id']},'attributes':['id',_0x5553('0x54'),'authType',_0x5553('0x55'),_0x5553('0x56'),'consumerKey',_0x5553('0x57'),_0x5553('0x58'),_0x5553('0x59')]})['then'](handleEntityNotFound(_0x169ae2,null))[_0x5553('0x22')](function(_0x1e32da){if(_0x1e32da){_0x788dc2=_0x1e32da['remoteUri'];var _0x47ae20=_0x788dc2['slice'](-0x1);if(_0x47ae20==='/'){_0x788dc2=_0x788dc2[_0x5553('0x5a')](0x0,_0x788dc2[_0x5553('0x5b')](_0x47ae20));}var _0x53aa35={'method':_0x5553('0x5c'),'uri':util['format']('%s/custom_fields',_0x788dc2),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x1e32da[_0x5553('0x5d')]===_0x5553('0x5e')){_0x53aa35[_0x5553('0x5f')]['Authorization']=util[_0x5553('0x60')](_0x5553('0x61'),new Buffer(util[_0x5553('0x60')](_0x5553('0x62'),_0x1e32da['username'],_0x1e32da[_0x5553('0x56')]))[_0x5553('0x63')](_0x5553('0x64')));}return rp(_0x53aa35)[_0x5553('0x22')](function(_0x449c44){return _0x2537a3[_0x5553('0x65')](_['map'](_0x449c44['_embedded']['entries'],function(_0x4b58e6){return{'id':_0x4b58e6['name'],'name':_0x4b58e6[_0x5553('0x26')],'type':_0x4b58e6['type'],'active':_0x4b58e6[_0x5553('0x66')],'label':_0x4b58e6[_0x5553('0x67')],'custom':!![]};}));});}})[_0x5553('0x22')](function(_0x54c56b){return{'count':_0x54c56b['length'],'rows':_0x54c56b};})[_0x5553('0x22')](respondWithResult(_0x169ae2,null))[_0x5553('0x42')](function(_0x29065f){var _0x31e919=_0x7ed3b[_0x5553('0x2f')][_0x5553('0x68')]?0x1f4:_0x29065f[_0x5553('0x69')]||0x1f4;logger[_0x5553('0x24')](_0x5553('0x6a'),_0x5553('0x52'),_0x31e919,JSON[_0x5553('0x6b')](_0x29065f));delete _0x29065f[_0x5553('0x26')];if(_0x31e919===0x191){_0x31e919=0x190;}_0x169ae2['status'](_0x31e919)[_0x5553('0x6c')](_0x7ed3b[_0x5553('0x2f')][_0x5553('0x68')]?{'message':_0x5553('0x6d'),'statusCode':_0x29065f[_0x5553('0x69')]}:_0x29065f);});}; \ No newline at end of file +var _0x7890=['DeskField','getFields','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','headers','Authorization','Basic\x20%s','username','toString','base64','concat','active','test','statusCode','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','DeskAccount','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','catch','create','body','params','getConfigurations','findOne','keys','DeskConfiguration','order','getSubjects','channel','type','getDescriptions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7890,0x1c6));var _0x0789=function(_0x2d284,_0x4a7ffc){_0x2d284=_0x2d284-0x0;var _0x35c8f6=_0x7890[_0x2d284];return _0x35c8f6;};'use strict';var emlformat=require(_0x0789('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0789('0x1'));var jsonpatch=require(_0x0789('0x2'));var rp=require(_0x0789('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x0789('0x4'));var path=require(_0x0789('0x5'));var sox=require(_0x0789('0x6'));var csv=require(_0x0789('0x7'));var ejs=require(_0x0789('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0789('0x9'));var squel=require(_0x0789('0xa'));var crypto=require(_0x0789('0xb'));var jsforce=require(_0x0789('0xc'));var deskjs=require(_0x0789('0xd'));var toCsv=require(_0x0789('0x7'));var querystring=require(_0x0789('0xe'));var Papa=require(_0x0789('0xf'));var Redis=require('ioredis');var authService=require(_0x0789('0x10'));var qs=require(_0x0789('0x11'));var as=require(_0x0789('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0789('0x13'));var utils=require(_0x0789('0x14'));var config=require(_0x0789('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0789('0x16'))['db'];var integrations=require(_0x0789('0x17'));function respondWithStatusCode(_0x16c5c5,_0x3e77ad){_0x3e77ad=_0x3e77ad||0xcc;return function(_0xadf6d4){if(_0xadf6d4){return _0x16c5c5[_0x0789('0x18')](_0x3e77ad);}return _0x16c5c5[_0x0789('0x19')](_0x3e77ad)[_0x0789('0x1a')]();};}function respondWithResult(_0x3c3b3b,_0x117f01){_0x117f01=_0x117f01||0xc8;return function(_0x3ed559){if(_0x3ed559){return _0x3c3b3b[_0x0789('0x19')](_0x117f01)[_0x0789('0x1b')](_0x3ed559);}};}function respondWithFilteredResult(_0x1bcdf1,_0x5c271e){return function(_0x51bd0a){if(_0x51bd0a){var _0x36bc9=typeof _0x5c271e[_0x0789('0x1c')]==='undefined'&&typeof _0x5c271e[_0x0789('0x1d')]===_0x0789('0x1e');var _0x54d15a=_0x51bd0a[_0x0789('0x1f')];var _0x4d0efe=_0x36bc9?0x0:_0x5c271e['offset'];var _0x3a0dc3=_0x36bc9?_0x51bd0a[_0x0789('0x1f')]:_0x5c271e[_0x0789('0x1c')]+_0x5c271e['limit'];var _0x4d6a6a;if(_0x3a0dc3>=_0x54d15a){_0x3a0dc3=_0x54d15a;_0x4d6a6a=0xc8;}else{_0x4d6a6a=0xce;}_0x1bcdf1[_0x0789('0x19')](_0x4d6a6a);return _0x1bcdf1['set'](_0x0789('0x20'),_0x4d0efe+'-'+_0x3a0dc3+'/'+_0x54d15a)[_0x0789('0x1b')](_0x51bd0a);}return null;};}function patchUpdates(_0x35396d){return function(_0x35ee68){try{jsonpatch[_0x0789('0x21')](_0x35ee68,_0x35396d,!![]);}catch(_0x3956d5){return BPromise[_0x0789('0x22')](_0x3956d5);}return _0x35ee68[_0x0789('0x23')]();};}function saveUpdates(_0x1f5a6b,_0x3081b7){return function(_0x3d8e5d){if(_0x3d8e5d){return _0x3d8e5d[_0x0789('0x24')](_0x1f5a6b)['then'](function(_0x457320){return _0x457320;});}return null;};}function removeEntity(_0x4914c9,_0x2a8302){return function(_0x256f43){if(_0x256f43){return _0x256f43['destroy']()[_0x0789('0x25')](function(){_0x4914c9[_0x0789('0x19')](0xcc)[_0x0789('0x1a')]();});}};}function handleEntityNotFound(_0x2da3a4,_0x222153){return function(_0x2b81f5){if(!_0x2b81f5){_0x2da3a4[_0x0789('0x18')](0x194);}return _0x2b81f5;};}function handleError(_0x23d1e2,_0x590e5b){_0x590e5b=_0x590e5b||0x1f4;return function(_0x307a35){logger['error'](_0x307a35[_0x0789('0x26')]);if(_0x307a35[_0x0789('0x27')]){delete _0x307a35[_0x0789('0x27')];}_0x23d1e2[_0x0789('0x19')](_0x590e5b)[_0x0789('0x28')](_0x307a35);};}exports[_0x0789('0x29')]=function(_0x3a9ee,_0x4ae70f){var _0x513a87={},_0x246d45={},_0x407b29={'count':0x0,'rows':[]};var _0x34a1a3=_[_0x0789('0x2a')](db[_0x0789('0x2b')][_0x0789('0x2c')],function(_0x2a9d3d){return{'name':_0x2a9d3d[_0x0789('0x2d')],'type':_0x2a9d3d['type']['key']};});_0x246d45[_0x0789('0x2e')]=_[_0x0789('0x2a')](_0x34a1a3,_0x0789('0x27'));_0x246d45['query']=_['keys'](_0x3a9ee[_0x0789('0x2f')]);_0x246d45[_0x0789('0x30')]=_[_0x0789('0x31')](_0x246d45['model'],_0x246d45['query']);_0x513a87[_0x0789('0x32')]=_[_0x0789('0x31')](_0x246d45[_0x0789('0x2e')],qs[_0x0789('0x33')](_0x3a9ee[_0x0789('0x2f')][_0x0789('0x33')]));_0x513a87[_0x0789('0x32')]=_0x513a87[_0x0789('0x32')][_0x0789('0x34')]?_0x513a87[_0x0789('0x32')]:_0x246d45[_0x0789('0x2e')];if(!_0x3a9ee[_0x0789('0x2f')][_0x0789('0x35')](_0x0789('0x36'))){_0x513a87['limit']=qs[_0x0789('0x1d')](_0x3a9ee[_0x0789('0x2f')]['limit']);_0x513a87[_0x0789('0x1c')]=qs[_0x0789('0x1c')](_0x3a9ee['query'][_0x0789('0x1c')]);}_0x513a87['order']=qs[_0x0789('0x37')](_0x3a9ee[_0x0789('0x2f')]['sort']);_0x513a87[_0x0789('0x38')]=qs['filters'](_[_0x0789('0x39')](_0x3a9ee[_0x0789('0x2f')],_0x246d45[_0x0789('0x30')]),_0x34a1a3);if(_0x3a9ee[_0x0789('0x2f')][_0x0789('0x3a')]){_0x513a87[_0x0789('0x38')]=_[_0x0789('0x3b')](_0x513a87[_0x0789('0x38')],{'$or':_[_0x0789('0x2a')](_0x34a1a3,function(_0x40199b){if(_0x40199b['type']!==_0x0789('0x3c')){var _0x47cb7e={};_0x47cb7e[_0x40199b['name']]={'$like':'%'+_0x3a9ee[_0x0789('0x2f')][_0x0789('0x3a')]+'%'};return _0x47cb7e;}})});}_0x513a87=_[_0x0789('0x3b')]({},_0x513a87,_0x3a9ee[_0x0789('0x3d')]);var _0x4d1e91={'where':_0x513a87[_0x0789('0x38')]};return db[_0x0789('0x2b')][_0x0789('0x1f')](_0x4d1e91)['then'](function(_0x25963b){_0x407b29['count']=_0x25963b;if(_0x3a9ee[_0x0789('0x2f')][_0x0789('0x3e')]){_0x513a87[_0x0789('0x3f')]=[{'all':!![]}];}return db['DeskAccount'][_0x0789('0x40')](_0x513a87);})[_0x0789('0x25')](function(_0x2c55b4){_0x407b29[_0x0789('0x41')]=_0x2c55b4;return _0x407b29;})[_0x0789('0x25')](respondWithFilteredResult(_0x4ae70f,_0x513a87))['catch'](handleError(_0x4ae70f,null));};exports[_0x0789('0x42')]=function(_0x2efe9d,_0x498c8e){var _0x2022d6={'raw':![],'where':{'id':_0x2efe9d['params']['id']}},_0x2d426a={};_0x2d426a[_0x0789('0x2e')]=_['keys'](db[_0x0789('0x2b')]['rawAttributes']);_0x2d426a[_0x0789('0x2f')]=_['keys'](_0x2efe9d['query']);_0x2d426a[_0x0789('0x30')]=_[_0x0789('0x31')](_0x2d426a['model'],_0x2d426a[_0x0789('0x2f')]);_0x2022d6['attributes']=_['intersection'](_0x2d426a[_0x0789('0x2e')],qs['fields'](_0x2efe9d['query']['fields']));_0x2022d6[_0x0789('0x32')]=_0x2022d6[_0x0789('0x32')]['length']?_0x2022d6[_0x0789('0x32')]:_0x2d426a[_0x0789('0x2e')];if(_0x2efe9d['query'][_0x0789('0x3e')]){_0x2022d6['include']=[{'all':!![]}];}_0x2022d6=_[_0x0789('0x3b')]({},_0x2022d6,_0x2efe9d[_0x0789('0x3d')]);return db[_0x0789('0x2b')][_0x0789('0x43')](_0x2022d6)[_0x0789('0x25')](handleEntityNotFound(_0x498c8e,null))[_0x0789('0x25')](respondWithResult(_0x498c8e,null))[_0x0789('0x44')](handleError(_0x498c8e,null));};exports[_0x0789('0x45')]=function(_0x5e5ab3,_0xaee82b){return db[_0x0789('0x2b')][_0x0789('0x45')](_0x5e5ab3['body'],{})[_0x0789('0x25')](respondWithResult(_0xaee82b,0xc9))[_0x0789('0x44')](handleError(_0xaee82b,null));};exports[_0x0789('0x24')]=function(_0x5d5c92,_0x4f8974){if(_0x5d5c92[_0x0789('0x46')]['id']){delete _0x5d5c92['body']['id'];}return db[_0x0789('0x2b')][_0x0789('0x43')]({'where':{'id':_0x5d5c92['params']['id']}})['then'](handleEntityNotFound(_0x4f8974,null))['then'](saveUpdates(_0x5d5c92[_0x0789('0x46')],null))[_0x0789('0x25')](respondWithResult(_0x4f8974,null))[_0x0789('0x44')](handleError(_0x4f8974,null));};exports['destroy']=function(_0x360649,_0x32d2ba){return db['DeskAccount']['find']({'where':{'id':_0x360649[_0x0789('0x47')]['id']}})[_0x0789('0x25')](handleEntityNotFound(_0x32d2ba,null))[_0x0789('0x25')](removeEntity(_0x32d2ba,null))[_0x0789('0x44')](handleError(_0x32d2ba,null));};exports[_0x0789('0x48')]=function(_0x46d09d,_0x492066,_0x27be19){var _0x3ad7cd={};var _0x27046c={};var _0x8333e2;var _0xebd473;return db[_0x0789('0x2b')][_0x0789('0x49')]({'where':{'id':_0x46d09d[_0x0789('0x47')]['id']}})['then'](handleEntityNotFound(_0x492066,null))['then'](function(_0x3b8dfa){if(_0x3b8dfa){_0x8333e2=_0x3b8dfa;_0x27046c['model']=_[_0x0789('0x4a')](db[_0x0789('0x4b')][_0x0789('0x2c')]);_0x27046c['query']=_['keys'](_0x46d09d[_0x0789('0x2f')]);_0x27046c['filters']=_['intersection'](_0x27046c['model'],_0x27046c[_0x0789('0x2f')]);_0x3ad7cd[_0x0789('0x32')]=_[_0x0789('0x31')](_0x27046c['model'],qs[_0x0789('0x33')](_0x46d09d[_0x0789('0x2f')][_0x0789('0x33')]));_0x3ad7cd['attributes']=_0x3ad7cd['attributes']['length']?_0x3ad7cd[_0x0789('0x32')]:_0x27046c[_0x0789('0x2e')];_0x3ad7cd[_0x0789('0x4c')]=qs['sort'](_0x46d09d[_0x0789('0x2f')][_0x0789('0x37')]);_0x3ad7cd[_0x0789('0x38')]=qs[_0x0789('0x30')](_['pick'](_0x46d09d[_0x0789('0x2f')],_0x27046c['filters']));if(_0x46d09d['query']['filter']){_0x3ad7cd[_0x0789('0x38')]=_[_0x0789('0x3b')](_0x3ad7cd[_0x0789('0x38')],{'$or':_[_0x0789('0x2a')](_0x3ad7cd[_0x0789('0x32')],function(_0x54aad2){var _0x1f77dd={};_0x1f77dd[_0x54aad2]={'$like':'%'+_0x46d09d[_0x0789('0x2f')][_0x0789('0x3a')]+'%'};return _0x1f77dd;})});}_0x3ad7cd=_['merge']({},_0x3ad7cd,_0x46d09d[_0x0789('0x3d')]);return _0x8333e2[_0x0789('0x48')](_0x3ad7cd);}})['then'](function(_0x24ad20){if(_0x24ad20){_0xebd473=_0x24ad20[_0x0789('0x34')];if(!_0x46d09d[_0x0789('0x2f')][_0x0789('0x35')](_0x0789('0x36'))){_0x3ad7cd['limit']=qs[_0x0789('0x1d')](_0x46d09d[_0x0789('0x2f')][_0x0789('0x1d')]);_0x3ad7cd[_0x0789('0x1c')]=qs['offset'](_0x46d09d[_0x0789('0x2f')]['offset']);}return _0x8333e2['getConfigurations'](_0x3ad7cd);}})[_0x0789('0x25')](function(_0x12db2b){if(_0x12db2b){return _0x12db2b?{'count':_0xebd473,'rows':_0x12db2b}:null;}})[_0x0789('0x25')](respondWithResult(_0x492066,null))[_0x0789('0x44')](handleError(_0x492066,null));};exports['addConfiguration']=function(_0x180e95,_0x2a666e,_0x3074ee){if(_0x180e95[_0x0789('0x46')]['id']){delete _0x180e95['body']['id'];}return db[_0x0789('0x2b')][_0x0789('0x49')]({'where':{'id':_0x180e95[_0x0789('0x47')]['id']}})[_0x0789('0x25')](handleEntityNotFound(_0x2a666e,null))[_0x0789('0x25')](function(_0x3dfc41){if(_0x3dfc41){_0x180e95[_0x0789('0x46')]['AccountId']=_0x3dfc41['id'];_0x180e95[_0x0789('0x46')]['Subjects']=integrations[_0x0789('0x4d')](_0x180e95['body'][_0x0789('0x4e')],_0x180e95[_0x0789('0x46')][_0x0789('0x4f')]);_0x180e95[_0x0789('0x46')]['Descriptions']=integrations[_0x0789('0x50')](_0x180e95['body'][_0x0789('0x4e')],_0x180e95[_0x0789('0x46')][_0x0789('0x4f')]);return db[_0x0789('0x4b')][_0x0789('0x45')](_0x180e95['body'],{'include':[{'model':db[_0x0789('0x51')],'as':'Subjects'},{'model':db[_0x0789('0x51')],'as':'Descriptions'}]});}return null;})[_0x0789('0x25')](respondWithResult(_0x2a666e,null))[_0x0789('0x44')](handleError(_0x2a666e,null));};exports[_0x0789('0x52')]=function(_0x3c2ae4,_0x403cce,_0x31e972){var _0x1b8824=[{'name':'priority','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 _0xed34ff='';return db[_0x0789('0x2b')][_0x0789('0x49')]({'where':{'id':_0x3c2ae4[_0x0789('0x47')]['id']},'attributes':['id',_0x0789('0x53'),'authType','username',_0x0789('0x54'),_0x0789('0x55'),_0x0789('0x56'),_0x0789('0x57'),_0x0789('0x58')]})['then'](handleEntityNotFound(_0x403cce,null))['then'](function(_0x4bc5dd){if(_0x4bc5dd){_0xed34ff=_0x4bc5dd[_0x0789('0x53')];var _0x118e53=_0xed34ff['slice'](-0x1);if(_0x118e53==='/'){_0xed34ff=_0xed34ff[_0x0789('0x59')](0x0,_0xed34ff[_0x0789('0x5a')](_0x118e53));}var _0x12020b={'method':_0x0789('0x5b'),'uri':util[_0x0789('0x5c')](_0x0789('0x5d'),_0xed34ff),'headers':{'Content-Type':_0x0789('0x5e'),'Accept':_0x0789('0x5e')},'json':!![]};if(_0x4bc5dd[_0x0789('0x5f')]==='basic'){_0x12020b[_0x0789('0x60')][_0x0789('0x61')]=util['format'](_0x0789('0x62'),new Buffer(util[_0x0789('0x5c')]('%s:%s',_0x4bc5dd[_0x0789('0x63')],_0x4bc5dd['password']))[_0x0789('0x64')](_0x0789('0x65')));}return rp(_0x12020b)['then'](function(_0x35807d){return _0x1b8824[_0x0789('0x66')](_['map'](_0x35807d['_embedded']['entries'],function(_0x5c96c1){return{'id':_0x5c96c1['name'],'name':_0x5c96c1[_0x0789('0x27')],'type':_0x5c96c1[_0x0789('0x4f')],'active':_0x5c96c1[_0x0789('0x67')],'label':_0x5c96c1['label'],'custom':!![]};}));});}})[_0x0789('0x25')](function(_0x4aebbc){return{'count':_0x4aebbc[_0x0789('0x34')],'rows':_0x4aebbc};})[_0x0789('0x25')](respondWithResult(_0x403cce,null))['catch'](function(_0x3c3fbe){var _0x1195c6=_0x3c2ae4[_0x0789('0x2f')][_0x0789('0x68')]?0x1f4:_0x3c3fbe[_0x0789('0x69')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x0789('0x52'),_0x1195c6,JSON['stringify'](_0x3c3fbe));delete _0x3c3fbe[_0x0789('0x27')];if(_0x1195c6===0x191){_0x1195c6=0x190;}_0x403cce['status'](_0x1195c6)['send'](_0x3c2ae4[_0x0789('0x2f')][_0x0789('0x68')]?{'message':_0x0789('0x6a'),'statusCode':_0x3c3fbe[_0x0789('0x69')]}:_0x3c3fbe);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 946e720..42b31ac 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 _0xcc14=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x47a8c0,_0x4d5931){var _0x551fa1=function(_0x45ac5a){while(--_0x45ac5a){_0x47a8c0['push'](_0x47a8c0['shift']());}};_0x551fa1(++_0x4d5931);}(_0xcc14,0xaf));var _0x4cc1=function(_0x3571fb,_0x53f91b){_0x3571fb=_0x3571fb-0x0;var _0x16a941=_0xcc14[_0x3571fb];return _0x16a941;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4cc1('0x0'))('api');var moment=require(_0x4cc1('0x1'));var BPromise=require(_0x4cc1('0x2'));var rp=require(_0x4cc1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4cc1('0x4'));var attributes=require(_0x4cc1('0x5'));var integrations=require(_0x4cc1('0x6'));module[_0x4cc1('0x7')]=function(_0x3abae2,_0x25eb76){return _0x3abae2[_0x4cc1('0x8')]('DeskAccount',attributes,{'tableName':_0x4cc1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b81=['DeskAccount','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','define'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x6b81,0x135));var _0x16b8=function(_0x253201,_0x55488a){_0x253201=_0x253201-0x0;var _0x4a479a=_0x6b81[_0x253201];return _0x4a479a;};'use strict';var _=require(_0x16b8('0x0'));var util=require(_0x16b8('0x1'));var logger=require(_0x16b8('0x2'))('api');var moment=require('moment');var BPromise=require(_0x16b8('0x3'));var rp=require(_0x16b8('0x4'));var fs=require('fs');var path=require(_0x16b8('0x5'));var rimraf=require(_0x16b8('0x6'));var config=require(_0x16b8('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x16b8('0x8'));module['exports']=function(_0x361b4f,_0x57b143){return _0x361b4f[_0x16b8('0x9')](_0x16b8('0xa'),attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index a1a4f0c..3bf4585 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 _0x56da=['model','debug','stringify','find','ShowDeskAccount','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','map'];(function(_0x105da3,_0x46b913){var _0x478ce9=function(_0xa1f75f){while(--_0xa1f75f){_0x105da3['push'](_0x105da3['shift']());}};_0x478ce9(++_0x46b913);}(_0x56da,0x19d));var _0xa56d=function(_0x30a528,_0x1d04f2){_0x30a528=_0x30a528-0x0;var _0x3e029c=_0x56da[_0x30a528];return _0x3e029c;};'use strict';var _=require('lodash');var util=require(_0xa56d('0x0'));var moment=require('moment');var BPromise=require(_0xa56d('0x1'));var rs=require(_0xa56d('0x2'));var fs=require('fs');var Redis=require(_0xa56d('0x3'));var db=require(_0xa56d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa56d('0x5'))('rpc');var config=require(_0xa56d('0x6'));var jayson=require(_0xa56d('0x7'));var client=jayson['client'][_0xa56d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x30262c,_0x66582a,_0x208494){return new BPromise(function(_0x1a404f,_0x2ce2c6){return client[_0xa56d('0x9')](_0x30262c,_0x208494)[_0xa56d('0xa')](function(_0x44bc65){logger[_0xa56d('0xb')](_0xa56d('0xc'),_0x66582a,'request\x20sent');logger['debug'](_0xa56d('0xd'),_0x66582a,'request\x20sent',JSON['stringify'](_0x44bc65));if(_0x44bc65[_0xa56d('0xe')]){if(_0x44bc65[_0xa56d('0xe')][_0xa56d('0xf')]===0x1f4){logger[_0xa56d('0xe')](_0xa56d('0xc'),_0x66582a,_0x44bc65['error'][_0xa56d('0x10')]);return _0x2ce2c6(_0x44bc65[_0xa56d('0xe')][_0xa56d('0x10')]);}logger['error'](_0xa56d('0xc'),_0x66582a,_0x44bc65['error'][_0xa56d('0x10')]);return _0x1a404f(_0x44bc65[_0xa56d('0xe')][_0xa56d('0x10')]);}else{logger['info'](_0xa56d('0xc'),_0x66582a,_0xa56d('0x11'));_0x1a404f(_0x44bc65[_0xa56d('0x12')][_0xa56d('0x10')]);}})[_0xa56d('0x13')](function(_0x56a198){logger[_0xa56d('0xe')]('DeskAccount,\x20%s,\x20%s',_0x66582a,_0x56a198);_0x2ce2c6(_0x56a198);});});}exports[_0xa56d('0x14')]=function(_0x2d27d2){var _0x2814b7=this;return new Promise(function(_0x5db862,_0xacdfd7){return db[_0xa56d('0x15')][_0xa56d('0x16')]({'raw':_0x2d27d2[_0xa56d('0x17')]?_0x2d27d2['options'][_0xa56d('0x18')]===undefined?!![]:![]:!![],'where':_0x2d27d2[_0xa56d('0x17')]?_0x2d27d2['options']['where']||null:null,'attributes':_0x2d27d2[_0xa56d('0x17')]?_0x2d27d2[_0xa56d('0x17')][_0xa56d('0x19')]||null:null,'limit':_0x2d27d2[_0xa56d('0x17')]?_0x2d27d2[_0xa56d('0x17')][_0xa56d('0x1a')]||null:null,'include':_0x2d27d2[_0xa56d('0x17')]?_0x2d27d2[_0xa56d('0x17')][_0xa56d('0x1b')]?_[_0xa56d('0x1c')](_0x2d27d2['options']['include'],function(_0x47e9b8){return{'model':db[_0x47e9b8['model']],'as':_0x47e9b8['as'],'attributes':_0x47e9b8['attributes'],'include':_0x47e9b8[_0xa56d('0x1b')]?_[_0xa56d('0x1c')](_0x47e9b8[_0xa56d('0x1b')],function(_0x14933f){return{'model':db[_0x14933f[_0xa56d('0x1d')]],'as':_0x14933f['as'],'attributes':_0x14933f[_0xa56d('0x19')],'include':_0x14933f['include']?_[_0xa56d('0x1c')](_0x14933f['include'],function(_0x2a816d){return{'model':db[_0x2a816d[_0xa56d('0x1d')]],'as':_0x2a816d['as'],'attributes':_0x2a816d[_0xa56d('0x19')]};}):[]};}):[]};}):[]:[]})[_0xa56d('0xa')](function(_0x17ee73){logger['info'](_0xa56d('0x14'),_0x2d27d2);logger[_0xa56d('0x1e')](_0xa56d('0x14'),_0x2d27d2,JSON[_0xa56d('0x1f')](_0x17ee73));_0x5db862(_0x17ee73);})['catch'](function(_0xa83338){logger[_0xa56d('0xe')](_0xa56d('0x14'),_0xa83338[_0xa56d('0x10')],_0x2d27d2);_0xacdfd7(_0x2814b7[_0xa56d('0xe')](0x1f4,_0xa83338[_0xa56d('0x10')]));});});};exports['ShowDeskAccount']=function(_0x33e4a8){var _0x18fc9f=this;return new Promise(function(_0x4abee5,_0x1800a2){return db['DeskAccount'][_0xa56d('0x20')]({'raw':_0x33e4a8[_0xa56d('0x17')]?_0x33e4a8[_0xa56d('0x17')][_0xa56d('0x18')]===undefined?!![]:![]:!![],'where':_0x33e4a8['options']?_0x33e4a8[_0xa56d('0x17')]['where']||null:null,'attributes':_0x33e4a8[_0xa56d('0x17')]?_0x33e4a8[_0xa56d('0x17')]['attributes']||null:null,'include':_0x33e4a8['options']?_0x33e4a8[_0xa56d('0x17')][_0xa56d('0x1b')]?_[_0xa56d('0x1c')](_0x33e4a8[_0xa56d('0x17')][_0xa56d('0x1b')],function(_0x3f4b1c){return{'model':db[_0x3f4b1c[_0xa56d('0x1d')]],'as':_0x3f4b1c['as'],'attributes':_0x3f4b1c[_0xa56d('0x19')],'include':_0x3f4b1c[_0xa56d('0x1b')]?_['map'](_0x3f4b1c['include'],function(_0x1e9efe){return{'model':db[_0x1e9efe['model']],'as':_0x1e9efe['as'],'attributes':_0x1e9efe[_0xa56d('0x19')],'include':_0x1e9efe[_0xa56d('0x1b')]?_[_0xa56d('0x1c')](_0x1e9efe[_0xa56d('0x1b')],function(_0x3c4ff6){return{'model':db[_0x3c4ff6[_0xa56d('0x1d')]],'as':_0x3c4ff6['as'],'attributes':_0x3c4ff6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xb00aba){logger[_0xa56d('0xb')]('ShowDeskAccount',_0x33e4a8);logger[_0xa56d('0x1e')](_0xa56d('0x21'),_0x33e4a8,JSON[_0xa56d('0x1f')](_0xb00aba));_0x4abee5(_0xb00aba);})['catch'](function(_0x45980d){logger[_0xa56d('0xe')](_0xa56d('0x21'),_0x45980d[_0xa56d('0x10')],_0x33e4a8);_0x1800a2(_0x18fc9f[_0xa56d('0xe')](0x1f4,_0x45980d[_0xa56d('0x10')]));});});}; \ No newline at end of file +var _0xebb5=['limit','include','model','attributes','map','debug','ShowDeskAccount','find','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetDeskAccount','DeskAccount','options','raw','where'];(function(_0x51f182,_0x3deed0){var _0xf2a7dd=function(_0x5d2f71){while(--_0x5d2f71){_0x51f182['push'](_0x51f182['shift']());}};_0xf2a7dd(++_0x3deed0);}(_0xebb5,0x15c));var _0x5ebb=function(_0x3ee5dd,_0x278f86){_0x3ee5dd=_0x3ee5dd-0x0;var _0x40b967=_0xebb5[_0x3ee5dd];return _0x40b967;};'use strict';var _=require('lodash');var util=require(_0x5ebb('0x0'));var moment=require(_0x5ebb('0x1'));var BPromise=require(_0x5ebb('0x2'));var rs=require(_0x5ebb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5ebb('0x4'));var config=require(_0x5ebb('0x5'));var jayson=require(_0x5ebb('0x6'));var client=jayson[_0x5ebb('0x7')][_0x5ebb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x24353f,_0x16f89d,_0x3ca6ad){return new BPromise(function(_0x108ef5,_0x53e3d3){return client[_0x5ebb('0x9')](_0x24353f,_0x3ca6ad)[_0x5ebb('0xa')](function(_0x1a43a0){logger[_0x5ebb('0xb')](_0x5ebb('0xc'),_0x16f89d,'request\x20sent');logger['debug'](_0x5ebb('0xd'),_0x16f89d,'request\x20sent',JSON[_0x5ebb('0xe')](_0x1a43a0));if(_0x1a43a0[_0x5ebb('0xf')]){if(_0x1a43a0['error'][_0x5ebb('0x10')]===0x1f4){logger[_0x5ebb('0xf')](_0x5ebb('0xc'),_0x16f89d,_0x1a43a0['error'][_0x5ebb('0x11')]);return _0x53e3d3(_0x1a43a0[_0x5ebb('0xf')][_0x5ebb('0x11')]);}logger['error'](_0x5ebb('0xc'),_0x16f89d,_0x1a43a0['error']['message']);return _0x108ef5(_0x1a43a0['error']['message']);}else{logger[_0x5ebb('0xb')](_0x5ebb('0xc'),_0x16f89d,_0x5ebb('0x12'));_0x108ef5(_0x1a43a0[_0x5ebb('0x13')]['message']);}})[_0x5ebb('0x14')](function(_0x21a3e8){logger[_0x5ebb('0xf')](_0x5ebb('0xc'),_0x16f89d,_0x21a3e8);_0x53e3d3(_0x21a3e8);});});}exports[_0x5ebb('0x15')]=function(_0x32812d){var _0x17e68d=this;return new Promise(function(_0x2d448b,_0x621724){return db[_0x5ebb('0x16')]['findAll']({'raw':_0x32812d[_0x5ebb('0x17')]?_0x32812d[_0x5ebb('0x17')][_0x5ebb('0x18')]===undefined?!![]:![]:!![],'where':_0x32812d[_0x5ebb('0x17')]?_0x32812d['options'][_0x5ebb('0x19')]||null:null,'attributes':_0x32812d[_0x5ebb('0x17')]?_0x32812d[_0x5ebb('0x17')]['attributes']||null:null,'limit':_0x32812d[_0x5ebb('0x17')]?_0x32812d[_0x5ebb('0x17')][_0x5ebb('0x1a')]||null:null,'include':_0x32812d[_0x5ebb('0x17')]?_0x32812d[_0x5ebb('0x17')][_0x5ebb('0x1b')]?_['map'](_0x32812d[_0x5ebb('0x17')][_0x5ebb('0x1b')],function(_0x169b75){return{'model':db[_0x169b75[_0x5ebb('0x1c')]],'as':_0x169b75['as'],'attributes':_0x169b75[_0x5ebb('0x1d')],'include':_0x169b75['include']?_[_0x5ebb('0x1e')](_0x169b75[_0x5ebb('0x1b')],function(_0x114d9b){return{'model':db[_0x114d9b[_0x5ebb('0x1c')]],'as':_0x114d9b['as'],'attributes':_0x114d9b[_0x5ebb('0x1d')],'include':_0x114d9b[_0x5ebb('0x1b')]?_[_0x5ebb('0x1e')](_0x114d9b['include'],function(_0x301c50){return{'model':db[_0x301c50[_0x5ebb('0x1c')]],'as':_0x301c50['as'],'attributes':_0x301c50['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ebb('0xa')](function(_0x4b0cb0){logger['info']('GetDeskAccount',_0x32812d);logger[_0x5ebb('0x1f')](_0x5ebb('0x15'),_0x32812d,JSON[_0x5ebb('0xe')](_0x4b0cb0));_0x2d448b(_0x4b0cb0);})[_0x5ebb('0x14')](function(_0x1ea21e){logger[_0x5ebb('0xf')](_0x5ebb('0x15'),_0x1ea21e['message'],_0x32812d);_0x621724(_0x17e68d[_0x5ebb('0xf')](0x1f4,_0x1ea21e[_0x5ebb('0x11')]));});});};exports[_0x5ebb('0x20')]=function(_0x5a7f05){var _0x5a474c=this;return new Promise(function(_0x48e460,_0x9dcef){return db['DeskAccount'][_0x5ebb('0x21')]({'raw':_0x5a7f05['options']?_0x5a7f05[_0x5ebb('0x17')][_0x5ebb('0x18')]===undefined?!![]:![]:!![],'where':_0x5a7f05[_0x5ebb('0x17')]?_0x5a7f05[_0x5ebb('0x17')][_0x5ebb('0x19')]||null:null,'attributes':_0x5a7f05[_0x5ebb('0x17')]?_0x5a7f05[_0x5ebb('0x17')][_0x5ebb('0x1d')]||null:null,'include':_0x5a7f05[_0x5ebb('0x17')]?_0x5a7f05[_0x5ebb('0x17')][_0x5ebb('0x1b')]?_[_0x5ebb('0x1e')](_0x5a7f05[_0x5ebb('0x17')][_0x5ebb('0x1b')],function(_0x1ae69b){return{'model':db[_0x1ae69b['model']],'as':_0x1ae69b['as'],'attributes':_0x1ae69b[_0x5ebb('0x1d')],'include':_0x1ae69b['include']?_['map'](_0x1ae69b[_0x5ebb('0x1b')],function(_0x18cd95){return{'model':db[_0x18cd95['model']],'as':_0x18cd95['as'],'attributes':_0x18cd95['attributes'],'include':_0x18cd95[_0x5ebb('0x1b')]?_['map'](_0x18cd95[_0x5ebb('0x1b')],function(_0x165321){return{'model':db[_0x165321['model']],'as':_0x165321['as'],'attributes':_0x165321[_0x5ebb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5ebb('0xa')](function(_0x5465db){logger[_0x5ebb('0xb')](_0x5ebb('0x20'),_0x5a7f05);logger['debug'](_0x5ebb('0x20'),_0x5a7f05,JSON[_0x5ebb('0xe')](_0x5465db));_0x48e460(_0x5465db);})['catch'](function(_0x1c75b5){logger[_0x5ebb('0xf')](_0x5ebb('0x20'),_0x1c75b5[_0x5ebb('0x11')],_0x5a7f05);_0x9dcef(_0x5a474c[_0x5ebb('0xf')](0x1f4,_0x1c75b5[_0x5ebb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index fc3babb..f02dceb 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x115a07,_0xc16ec1){var _0x5a8ead=function(_0x439166){while(--_0x439166){_0x115a07['push'](_0x115a07['shift']());}};_0x5a8ead(++_0xc16ec1);}(_0x34e8,0x12c));var _0x834e=function(_0x3f5211,_0x34ff68){_0x3f5211=_0x3f5211-0x0;var _0x28d433=_0x34e8[_0x3f5211];return _0x28d433;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x244c19,_0x51c8f7){var _0x29c4cc=function(_0x9ce3d1){while(--_0x9ce3d1){_0x244c19['push'](_0x244c19['shift']());}};_0x29c4cc(++_0x51c8f7);}(_0x34e8,0x12c));var _0x834e=function(_0xed929c,_0x45955f){_0xed929c=_0xed929c-0x0;var _0xf3d3c0=_0x34e8[_0xed929c];return _0xf3d3c0;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 2ef1ad9..edd89ae 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 _0x298a=['sequelize','STRING'];(function(_0xef958e,_0x2e9b06){var _0x575121=function(_0x4640fa){while(--_0x4640fa){_0xef958e['push'](_0xef958e['shift']());}};_0x575121(++_0x2e9b06);}(_0x298a,0x19c));var _0xa298=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x298a[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xa298('0x0'));module['exports']={'name':{'type':Sequelize[_0xa298('0x1')]},'description':{'type':Sequelize[_0xa298('0x1')]}}; \ No newline at end of file +var _0x4c4b=['exports','STRING','sequelize'];(function(_0x40d394,_0x27f0de){var _0x4f285d=function(_0x2c6c7e){while(--_0x2c6c7e){_0x40d394['push'](_0x40d394['shift']());}};_0x4f285d(++_0x27f0de);}(_0x4c4b,0x1b8));var _0xb4c4=function(_0x24b477,_0x30393b){_0x24b477=_0x24b477-0x0;var _0x4041a6=_0x4c4b[_0x24b477];return _0x4041a6;};'use strict';var Sequelize=require(_0xb4c4('0x0'));module[_0xb4c4('0x1')]={'name':{'type':Sequelize[_0xb4c4('0x2')]},'description':{'type':Sequelize[_0xb4c4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 859b151..4f2ebd3 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 _0xfc39=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','update','then','destroy','error','name','send','index','map','DeskConfiguration','rawAttributes','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','include','catch','show','params','create','body','find','getFields','findOne','DeskField','filter','getSubjects','getDescriptions','pick','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0xfc39,0x92));var _0x9fc3=function(_0x3c4c7f,_0x370e64){_0x3c4c7f=_0x3c4c7f-0x0;var _0x54cf13=_0xfc39[_0x3c4c7f];return _0x54cf13;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fc3('0x0'));var zipdir=require(_0x9fc3('0x1'));var jsonpatch=require(_0x9fc3('0x2'));var rp=require(_0x9fc3('0x3'));var moment=require(_0x9fc3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9fc3('0x5'));var util=require(_0x9fc3('0x6'));var path=require(_0x9fc3('0x7'));var sox=require(_0x9fc3('0x8'));var csv=require('to-csv');var ejs=require(_0x9fc3('0x9'));var fs=require('fs');var fs_extra=require(_0x9fc3('0xa'));var _=require(_0x9fc3('0xb'));var squel=require(_0x9fc3('0xc'));var crypto=require(_0x9fc3('0xd'));var jsforce=require(_0x9fc3('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9fc3('0xf'));var querystring=require(_0x9fc3('0x10'));var Papa=require(_0x9fc3('0x11'));var Redis=require('ioredis');var authService=require(_0x9fc3('0x12'));var qs=require(_0x9fc3('0x13'));var as=require(_0x9fc3('0x14'));var hardwareService=require(_0x9fc3('0x15'));var logger=require(_0x9fc3('0x16'))(_0x9fc3('0x17'));var utils=require(_0x9fc3('0x18'));var config=require(_0x9fc3('0x19'));var licenseUtil=require(_0x9fc3('0x1a'));var db=require(_0x9fc3('0x1b'))['db'];function respondWithStatusCode(_0x7abced,_0xd4d0f9){_0xd4d0f9=_0xd4d0f9||0xcc;return function(_0x58abd5){if(_0x58abd5){return _0x7abced[_0x9fc3('0x1c')](_0xd4d0f9);}return _0x7abced[_0x9fc3('0x1d')](_0xd4d0f9)[_0x9fc3('0x1e')]();};}function respondWithResult(_0x4eb075,_0x22e2fa){_0x22e2fa=_0x22e2fa||0xc8;return function(_0x3227a6){if(_0x3227a6){return _0x4eb075['status'](_0x22e2fa)['json'](_0x3227a6);}};}function respondWithFilteredResult(_0x1c0d9f,_0x157b01){return function(_0x21f18e){if(_0x21f18e){var _0x41d2f3=typeof _0x157b01[_0x9fc3('0x1f')]===_0x9fc3('0x20')&&typeof _0x157b01[_0x9fc3('0x21')]===_0x9fc3('0x20');var _0x29c93c=_0x21f18e[_0x9fc3('0x22')];var _0x472f8c=_0x41d2f3?0x0:_0x157b01['offset'];var _0x5cc699=_0x41d2f3?_0x21f18e[_0x9fc3('0x22')]:_0x157b01[_0x9fc3('0x1f')]+_0x157b01['limit'];var _0xf5c5dd;if(_0x5cc699>=_0x29c93c){_0x5cc699=_0x29c93c;_0xf5c5dd=0xc8;}else{_0xf5c5dd=0xce;}_0x1c0d9f[_0x9fc3('0x1d')](_0xf5c5dd);return _0x1c0d9f[_0x9fc3('0x23')](_0x9fc3('0x24'),_0x472f8c+'-'+_0x5cc699+'/'+_0x29c93c)[_0x9fc3('0x25')](_0x21f18e);}return null;};}function patchUpdates(_0x121623){return function(_0x489304){try{jsonpatch['apply'](_0x489304,_0x121623,!![]);}catch(_0x295da0){return BPromise['reject'](_0x295da0);}return _0x489304['save']();};}function saveUpdates(_0x25ca34,_0x285fba){return function(_0x8812c){if(_0x8812c){return _0x8812c[_0x9fc3('0x26')](_0x25ca34)[_0x9fc3('0x27')](function(_0x107e79){return _0x107e79;});}return null;};}function removeEntity(_0x8b3cde,_0x816ed9){return function(_0x5f2bd3){if(_0x5f2bd3){return _0x5f2bd3[_0x9fc3('0x28')]()[_0x9fc3('0x27')](function(){_0x8b3cde[_0x9fc3('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32d5d1,_0x4f69e6){return function(_0xf15c72){if(!_0xf15c72){_0x32d5d1[_0x9fc3('0x1c')](0x194);}return _0xf15c72;};}function handleError(_0x267ab9,_0x5b3c7e){_0x5b3c7e=_0x5b3c7e||0x1f4;return function(_0x40b630){logger[_0x9fc3('0x29')](_0x40b630['stack']);if(_0x40b630[_0x9fc3('0x2a')]){delete _0x40b630[_0x9fc3('0x2a')];}_0x267ab9[_0x9fc3('0x1d')](_0x5b3c7e)[_0x9fc3('0x2b')](_0x40b630);};}exports[_0x9fc3('0x2c')]=function(_0x34aa50,_0x578f54){var _0x26d52f={},_0x4b47b9={},_0x229382={'count':0x0,'rows':[]};var _0x866f92=_[_0x9fc3('0x2d')](db[_0x9fc3('0x2e')][_0x9fc3('0x2f')],function(_0x38a181){return{'name':_0x38a181['fieldName'],'type':_0x38a181['type']['key']};});_0x4b47b9[_0x9fc3('0x30')]=_[_0x9fc3('0x2d')](_0x866f92,_0x9fc3('0x2a'));_0x4b47b9[_0x9fc3('0x31')]=_[_0x9fc3('0x32')](_0x34aa50[_0x9fc3('0x31')]);_0x4b47b9[_0x9fc3('0x33')]=_[_0x9fc3('0x34')](_0x4b47b9[_0x9fc3('0x30')],_0x4b47b9[_0x9fc3('0x31')]);_0x26d52f['attributes']=_[_0x9fc3('0x34')](_0x4b47b9[_0x9fc3('0x30')],qs['fields'](_0x34aa50['query'][_0x9fc3('0x35')]));_0x26d52f[_0x9fc3('0x36')]=_0x26d52f[_0x9fc3('0x36')][_0x9fc3('0x37')]?_0x26d52f[_0x9fc3('0x36')]:_0x4b47b9[_0x9fc3('0x30')];if(!_0x34aa50[_0x9fc3('0x31')][_0x9fc3('0x38')](_0x9fc3('0x39'))){_0x26d52f[_0x9fc3('0x21')]=qs[_0x9fc3('0x21')](_0x34aa50[_0x9fc3('0x31')]['limit']);_0x26d52f[_0x9fc3('0x1f')]=qs[_0x9fc3('0x1f')](_0x34aa50['query'][_0x9fc3('0x1f')]);}_0x26d52f[_0x9fc3('0x3a')]=qs[_0x9fc3('0x3b')](_0x34aa50[_0x9fc3('0x31')][_0x9fc3('0x3b')]);_0x26d52f[_0x9fc3('0x3c')]=qs[_0x9fc3('0x33')](_['pick'](_0x34aa50[_0x9fc3('0x31')],_0x4b47b9[_0x9fc3('0x33')]),_0x866f92);if(_0x34aa50['query']['filter']){_0x26d52f[_0x9fc3('0x3c')]=_[_0x9fc3('0x3d')](_0x26d52f[_0x9fc3('0x3c')],{'$or':_[_0x9fc3('0x2d')](_0x866f92,function(_0x39bb29){if(_0x39bb29['type']!==_0x9fc3('0x3e')){var _0x4b452e={};_0x4b452e[_0x39bb29[_0x9fc3('0x2a')]]={'$like':'%'+_0x34aa50[_0x9fc3('0x31')]['filter']+'%'};return _0x4b452e;}})});}_0x26d52f=_[_0x9fc3('0x3d')]({},_0x26d52f,_0x34aa50[_0x9fc3('0x3f')]);var _0x594496={'where':_0x26d52f[_0x9fc3('0x3c')]};return db[_0x9fc3('0x2e')][_0x9fc3('0x22')](_0x594496)[_0x9fc3('0x27')](function(_0xd33d1a){_0x229382[_0x9fc3('0x22')]=_0xd33d1a;if(_0x34aa50[_0x9fc3('0x31')][_0x9fc3('0x40')]){_0x26d52f[_0x9fc3('0x41')]=[{'all':!![]}];}return db[_0x9fc3('0x2e')]['findAll'](_0x26d52f);})[_0x9fc3('0x27')](function(_0x372647){_0x229382['rows']=_0x372647;return _0x229382;})[_0x9fc3('0x27')](respondWithFilteredResult(_0x578f54,_0x26d52f))[_0x9fc3('0x42')](handleError(_0x578f54,null));};exports[_0x9fc3('0x43')]=function(_0x324cee,_0x582ac7){var _0x39d8c3={'raw':![],'where':{'id':_0x324cee[_0x9fc3('0x44')]['id']}},_0x58e3cd={};_0x58e3cd[_0x9fc3('0x30')]=_[_0x9fc3('0x32')](db[_0x9fc3('0x2e')][_0x9fc3('0x2f')]);_0x58e3cd['query']=_['keys'](_0x324cee[_0x9fc3('0x31')]);_0x58e3cd[_0x9fc3('0x33')]=_[_0x9fc3('0x34')](_0x58e3cd[_0x9fc3('0x30')],_0x58e3cd[_0x9fc3('0x31')]);_0x39d8c3['attributes']=_[_0x9fc3('0x34')](_0x58e3cd[_0x9fc3('0x30')],qs[_0x9fc3('0x35')](_0x324cee[_0x9fc3('0x31')][_0x9fc3('0x35')]));_0x39d8c3[_0x9fc3('0x36')]=_0x39d8c3['attributes'][_0x9fc3('0x37')]?_0x39d8c3[_0x9fc3('0x36')]:_0x58e3cd['model'];if(_0x324cee[_0x9fc3('0x31')][_0x9fc3('0x40')]){_0x39d8c3[_0x9fc3('0x41')]=[{'all':!![]}];}_0x39d8c3=_['merge']({},_0x39d8c3,_0x324cee[_0x9fc3('0x3f')]);return db[_0x9fc3('0x2e')]['find'](_0x39d8c3)[_0x9fc3('0x27')](handleEntityNotFound(_0x582ac7,null))['then'](respondWithResult(_0x582ac7,null))[_0x9fc3('0x42')](handleError(_0x582ac7,null));};exports[_0x9fc3('0x45')]=function(_0x3f424f,_0x2e7bb5){return db['DeskConfiguration'][_0x9fc3('0x45')](_0x3f424f[_0x9fc3('0x46')],{})['then'](respondWithResult(_0x2e7bb5,0xc9))[_0x9fc3('0x42')](handleError(_0x2e7bb5,null));};exports[_0x9fc3('0x26')]=function(_0x135572,_0x49ee71){if(_0x135572[_0x9fc3('0x46')]['id']){delete _0x135572[_0x9fc3('0x46')]['id'];}return db[_0x9fc3('0x2e')][_0x9fc3('0x47')]({'where':{'id':_0x135572[_0x9fc3('0x44')]['id']}})[_0x9fc3('0x27')](handleEntityNotFound(_0x49ee71,null))[_0x9fc3('0x27')](saveUpdates(_0x135572[_0x9fc3('0x46')],null))[_0x9fc3('0x27')](respondWithResult(_0x49ee71,null))['catch'](handleError(_0x49ee71,null));};exports[_0x9fc3('0x28')]=function(_0x318e86,_0x1da324){return db[_0x9fc3('0x2e')]['find']({'where':{'id':_0x318e86[_0x9fc3('0x44')]['id']}})[_0x9fc3('0x27')](handleEntityNotFound(_0x1da324,null))['then'](removeEntity(_0x1da324,null))[_0x9fc3('0x42')](handleError(_0x1da324,null));};exports[_0x9fc3('0x48')]=function(_0x1b8ba1,_0x3a41b5,_0x1f061b){var _0x2023c7={};var _0x31a79e={};var _0x4f0473;var _0x4b9be0;return db[_0x9fc3('0x2e')][_0x9fc3('0x49')]({'where':{'id':_0x1b8ba1[_0x9fc3('0x44')]['id']}})['then'](handleEntityNotFound(_0x3a41b5,null))[_0x9fc3('0x27')](function(_0x16afce){if(_0x16afce){_0x4f0473=_0x16afce;_0x31a79e[_0x9fc3('0x30')]=_['keys'](db[_0x9fc3('0x4a')][_0x9fc3('0x2f')]);_0x31a79e[_0x9fc3('0x31')]=_['keys'](_0x1b8ba1[_0x9fc3('0x31')]);_0x31a79e[_0x9fc3('0x33')]=_[_0x9fc3('0x34')](_0x31a79e[_0x9fc3('0x30')],_0x31a79e[_0x9fc3('0x31')]);_0x2023c7[_0x9fc3('0x36')]=_[_0x9fc3('0x34')](_0x31a79e[_0x9fc3('0x30')],qs[_0x9fc3('0x35')](_0x1b8ba1[_0x9fc3('0x31')][_0x9fc3('0x35')]));_0x2023c7[_0x9fc3('0x36')]=_0x2023c7[_0x9fc3('0x36')][_0x9fc3('0x37')]?_0x2023c7[_0x9fc3('0x36')]:_0x31a79e['model'];_0x2023c7[_0x9fc3('0x3a')]=qs[_0x9fc3('0x3b')](_0x1b8ba1[_0x9fc3('0x31')][_0x9fc3('0x3b')]);_0x2023c7['where']=qs[_0x9fc3('0x33')](_['pick'](_0x1b8ba1[_0x9fc3('0x31')],_0x31a79e[_0x9fc3('0x33')]));if(_0x1b8ba1[_0x9fc3('0x31')]['filter']){_0x2023c7[_0x9fc3('0x3c')]=_[_0x9fc3('0x3d')](_0x2023c7['where'],{'$or':_['map'](_0x2023c7[_0x9fc3('0x36')],function(_0x21432c){var _0x2fecbf={};_0x2fecbf[_0x21432c]={'$like':'%'+_0x1b8ba1['query'][_0x9fc3('0x4b')]+'%'};return _0x2fecbf;})});}_0x2023c7=_[_0x9fc3('0x3d')]({},_0x2023c7,_0x1b8ba1[_0x9fc3('0x3f')]);return _0x4f0473[_0x9fc3('0x48')](_0x2023c7);}})[_0x9fc3('0x27')](function(_0x5d4b8d){if(_0x5d4b8d){_0x4b9be0=_0x5d4b8d[_0x9fc3('0x37')];if(!_0x1b8ba1['query']['hasOwnProperty']('nolimit')){_0x2023c7['limit']=qs[_0x9fc3('0x21')](_0x1b8ba1[_0x9fc3('0x31')][_0x9fc3('0x21')]);_0x2023c7[_0x9fc3('0x1f')]=qs[_0x9fc3('0x1f')](_0x1b8ba1[_0x9fc3('0x31')][_0x9fc3('0x1f')]);}return _0x4f0473[_0x9fc3('0x48')](_0x2023c7);}})[_0x9fc3('0x27')](function(_0x37ccdd){if(_0x37ccdd){return _0x37ccdd?{'count':_0x4b9be0,'rows':_0x37ccdd}:null;}})[_0x9fc3('0x27')](respondWithResult(_0x3a41b5,null))[_0x9fc3('0x42')](handleError(_0x3a41b5,null));};exports[_0x9fc3('0x4c')]=function(_0x36401f,_0x1cd81c,_0x1b2441){var _0x5e74cf={};var _0x17d62c={};var _0x4f69a1;var _0x3514e5;return db[_0x9fc3('0x2e')][_0x9fc3('0x49')]({'where':{'id':_0x36401f[_0x9fc3('0x44')]['id']}})[_0x9fc3('0x27')](handleEntityNotFound(_0x1cd81c,null))[_0x9fc3('0x27')](function(_0x468715){if(_0x468715){_0x4f69a1=_0x468715;_0x17d62c[_0x9fc3('0x30')]=_['keys'](db[_0x9fc3('0x4a')]['rawAttributes']);_0x17d62c[_0x9fc3('0x31')]=_['keys'](_0x36401f[_0x9fc3('0x31')]);_0x17d62c[_0x9fc3('0x33')]=_[_0x9fc3('0x34')](_0x17d62c[_0x9fc3('0x30')],_0x17d62c[_0x9fc3('0x31')]);_0x5e74cf[_0x9fc3('0x36')]=_[_0x9fc3('0x34')](_0x17d62c[_0x9fc3('0x30')],qs[_0x9fc3('0x35')](_0x36401f[_0x9fc3('0x31')][_0x9fc3('0x35')]));_0x5e74cf['attributes']=_0x5e74cf[_0x9fc3('0x36')][_0x9fc3('0x37')]?_0x5e74cf[_0x9fc3('0x36')]:_0x17d62c[_0x9fc3('0x30')];_0x5e74cf[_0x9fc3('0x3a')]=qs[_0x9fc3('0x3b')](_0x36401f[_0x9fc3('0x31')][_0x9fc3('0x3b')]);_0x5e74cf[_0x9fc3('0x3c')]=qs[_0x9fc3('0x33')](_['pick'](_0x36401f[_0x9fc3('0x31')],_0x17d62c[_0x9fc3('0x33')]));if(_0x36401f[_0x9fc3('0x31')][_0x9fc3('0x4b')]){_0x5e74cf[_0x9fc3('0x3c')]=_['merge'](_0x5e74cf['where'],{'$or':_[_0x9fc3('0x2d')](_0x5e74cf['attributes'],function(_0x133c9c){var _0x1d2e30={};_0x1d2e30[_0x133c9c]={'$like':'%'+_0x36401f[_0x9fc3('0x31')][_0x9fc3('0x4b')]+'%'};return _0x1d2e30;})});}_0x5e74cf=_[_0x9fc3('0x3d')]({},_0x5e74cf,_0x36401f[_0x9fc3('0x3f')]);return _0x4f69a1[_0x9fc3('0x4c')](_0x5e74cf);}})[_0x9fc3('0x27')](function(_0x5ad651){if(_0x5ad651){_0x3514e5=_0x5ad651[_0x9fc3('0x37')];if(!_0x36401f[_0x9fc3('0x31')][_0x9fc3('0x38')](_0x9fc3('0x39'))){_0x5e74cf['limit']=qs['limit'](_0x36401f[_0x9fc3('0x31')][_0x9fc3('0x21')]);_0x5e74cf['offset']=qs[_0x9fc3('0x1f')](_0x36401f[_0x9fc3('0x31')][_0x9fc3('0x1f')]);}return _0x4f69a1[_0x9fc3('0x4c')](_0x5e74cf);}})[_0x9fc3('0x27')](function(_0x5caac4){if(_0x5caac4){return _0x5caac4?{'count':_0x3514e5,'rows':_0x5caac4}:null;}})[_0x9fc3('0x27')](respondWithResult(_0x1cd81c,null))[_0x9fc3('0x42')](handleError(_0x1cd81c,null));};exports[_0x9fc3('0x4d')]=function(_0x252323,_0x105e9a,_0x58bb2a){var _0x54494c={};var _0x5d10b9={};var _0x4a0c99;var _0x4cab46;return db[_0x9fc3('0x2e')][_0x9fc3('0x49')]({'where':{'id':_0x252323['params']['id']}})[_0x9fc3('0x27')](handleEntityNotFound(_0x105e9a,null))[_0x9fc3('0x27')](function(_0x42bcb9){if(_0x42bcb9){_0x4a0c99=_0x42bcb9;_0x5d10b9[_0x9fc3('0x30')]=_['keys'](db[_0x9fc3('0x4a')][_0x9fc3('0x2f')]);_0x5d10b9[_0x9fc3('0x31')]=_[_0x9fc3('0x32')](_0x252323['query']);_0x5d10b9[_0x9fc3('0x33')]=_[_0x9fc3('0x34')](_0x5d10b9[_0x9fc3('0x30')],_0x5d10b9[_0x9fc3('0x31')]);_0x54494c[_0x9fc3('0x36')]=_['intersection'](_0x5d10b9[_0x9fc3('0x30')],qs['fields'](_0x252323[_0x9fc3('0x31')][_0x9fc3('0x35')]));_0x54494c['attributes']=_0x54494c[_0x9fc3('0x36')]['length']?_0x54494c[_0x9fc3('0x36')]:_0x5d10b9[_0x9fc3('0x30')];_0x54494c[_0x9fc3('0x3a')]=qs[_0x9fc3('0x3b')](_0x252323[_0x9fc3('0x31')][_0x9fc3('0x3b')]);_0x54494c[_0x9fc3('0x3c')]=qs[_0x9fc3('0x33')](_[_0x9fc3('0x4e')](_0x252323['query'],_0x5d10b9[_0x9fc3('0x33')]));if(_0x252323[_0x9fc3('0x31')][_0x9fc3('0x4b')]){_0x54494c['where']=_['merge'](_0x54494c[_0x9fc3('0x3c')],{'$or':_[_0x9fc3('0x2d')](_0x54494c['attributes'],function(_0x3cd9d0){var _0x184a1c={};_0x184a1c[_0x3cd9d0]={'$like':'%'+_0x252323['query']['filter']+'%'};return _0x184a1c;})});}_0x54494c=_[_0x9fc3('0x3d')]({},_0x54494c,_0x252323[_0x9fc3('0x3f')]);return _0x4a0c99[_0x9fc3('0x4d')](_0x54494c);}})[_0x9fc3('0x27')](function(_0x296188){if(_0x296188){_0x4cab46=_0x296188[_0x9fc3('0x37')];if(!_0x252323['query'][_0x9fc3('0x38')]('nolimit')){_0x54494c[_0x9fc3('0x21')]=qs['limit'](_0x252323['query'][_0x9fc3('0x21')]);_0x54494c[_0x9fc3('0x1f')]=qs[_0x9fc3('0x1f')](_0x252323[_0x9fc3('0x31')][_0x9fc3('0x1f')]);}return _0x4a0c99[_0x9fc3('0x4d')](_0x54494c);}})[_0x9fc3('0x27')](function(_0x95aa58){if(_0x95aa58){return _0x95aa58?{'count':_0x4cab46,'rows':_0x95aa58}:null;}})['then'](respondWithResult(_0x105e9a,null))['catch'](handleError(_0x105e9a,null));};exports[_0x9fc3('0x4f')]=function(_0x136538,_0x5e4c8b,_0x1de273){var _0x58745c={};var _0x1a8f3d={};var _0x306292;var _0x4b90aa;return db[_0x9fc3('0x2e')][_0x9fc3('0x49')]({'where':{'id':_0x136538[_0x9fc3('0x44')]['id']}})[_0x9fc3('0x27')](handleEntityNotFound(_0x5e4c8b,null))['then'](function(_0x3f1b09){if(_0x3f1b09){_0x306292=_0x3f1b09;_0x1a8f3d[_0x9fc3('0x30')]=_[_0x9fc3('0x32')](db['Tag'][_0x9fc3('0x2f')]);_0x1a8f3d[_0x9fc3('0x31')]=_[_0x9fc3('0x32')](_0x136538[_0x9fc3('0x31')]);_0x1a8f3d['filters']=_[_0x9fc3('0x34')](_0x1a8f3d[_0x9fc3('0x30')],_0x1a8f3d[_0x9fc3('0x31')]);_0x58745c[_0x9fc3('0x36')]=_[_0x9fc3('0x34')](_0x1a8f3d[_0x9fc3('0x30')],qs[_0x9fc3('0x35')](_0x136538[_0x9fc3('0x31')]['fields']));_0x58745c[_0x9fc3('0x36')]=_0x58745c['attributes'][_0x9fc3('0x37')]?_0x58745c[_0x9fc3('0x36')]:_0x1a8f3d[_0x9fc3('0x30')];_0x58745c['order']=qs[_0x9fc3('0x3b')](_0x136538[_0x9fc3('0x31')][_0x9fc3('0x3b')]);_0x58745c[_0x9fc3('0x3c')]=qs[_0x9fc3('0x33')](_['pick'](_0x136538['query'],_0x1a8f3d[_0x9fc3('0x33')]));if(_0x136538['query'][_0x9fc3('0x4b')]){_0x58745c['where']=_[_0x9fc3('0x3d')](_0x58745c[_0x9fc3('0x3c')],{'$or':_['map'](_0x58745c['attributes'],function(_0x63a009){var _0x30ab7c={};_0x30ab7c[_0x63a009]={'$like':'%'+_0x136538[_0x9fc3('0x31')]['filter']+'%'};return _0x30ab7c;})});}_0x58745c=_['merge']({},_0x58745c,_0x136538[_0x9fc3('0x3f')]);return _0x306292[_0x9fc3('0x4f')](_0x58745c);}})[_0x9fc3('0x27')](function(_0x3bf85f){if(_0x3bf85f){_0x4b90aa=_0x3bf85f[_0x9fc3('0x37')];if(!_0x136538[_0x9fc3('0x31')][_0x9fc3('0x38')](_0x9fc3('0x39'))){_0x58745c[_0x9fc3('0x21')]=qs[_0x9fc3('0x21')](_0x136538[_0x9fc3('0x31')][_0x9fc3('0x21')]);_0x58745c[_0x9fc3('0x1f')]=qs[_0x9fc3('0x1f')](_0x136538[_0x9fc3('0x31')][_0x9fc3('0x1f')]);}return _0x306292['getTags'](_0x58745c);}})[_0x9fc3('0x27')](function(_0x13bd15){if(_0x13bd15){return _0x13bd15?{'count':_0x4b90aa,'rows':_0x13bd15}:null;}})[_0x9fc3('0x27')](respondWithResult(_0x5e4c8b,null))[_0x9fc3('0x42')](handleError(_0x5e4c8b,null));};exports[_0x9fc3('0x50')]=function(_0x254799,_0x56fff0,_0x245a90){if(_0x254799['body']['id']){delete _0x254799['body']['id'];}return db[_0x9fc3('0x2e')][_0x9fc3('0x49')]({'where':{'id':_0x254799[_0x9fc3('0x44')]['id']}})['then'](handleEntityNotFound(_0x56fff0,null))[_0x9fc3('0x27')](function(_0x330e7b){if(_0x330e7b){return _0x330e7b[_0x9fc3('0x50')](_0x254799['body'][_0x9fc3('0x51')]||[]);}return null;})['then'](respondWithResult(_0x56fff0,null))[_0x9fc3('0x42')](handleError(_0x56fff0,null));}; \ No newline at end of file +var _0x1499=['query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','body','getFields','DeskField','hasOwnProperty','getSubjects','findOne','order','getDescriptions','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','index','DeskConfiguration','fieldName','type','key','model'];(function(_0x5a8832,_0x9e1cf){var _0x3b0668=function(_0x4735c1){while(--_0x4735c1){_0x5a8832['push'](_0x5a8832['shift']());}};_0x3b0668(++_0x9e1cf);}(_0x1499,0x184));var _0x9149=function(_0x1754d4,_0x54ceb6){_0x1754d4=_0x1754d4-0x0;var _0x364d7a=_0x1499[_0x1754d4];return _0x364d7a;};'use strict';var emlformat=require(_0x9149('0x0'));var rimraf=require(_0x9149('0x1'));var zipdir=require(_0x9149('0x2'));var jsonpatch=require(_0x9149('0x3'));var rp=require(_0x9149('0x4'));var moment=require(_0x9149('0x5'));var BPromise=require(_0x9149('0x6'));var Mustache=require(_0x9149('0x7'));var util=require(_0x9149('0x8'));var path=require(_0x9149('0x9'));var sox=require(_0x9149('0xa'));var csv=require(_0x9149('0xb'));var ejs=require(_0x9149('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9149('0xd'));var squel=require(_0x9149('0xe'));var crypto=require(_0x9149('0xf'));var jsforce=require(_0x9149('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9149('0x11'));var Papa=require(_0x9149('0x12'));var Redis=require(_0x9149('0x13'));var authService=require(_0x9149('0x14'));var qs=require(_0x9149('0x15'));var as=require(_0x9149('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9149('0x17'))(_0x9149('0x18'));var utils=require(_0x9149('0x19'));var config=require(_0x9149('0x1a'));var licenseUtil=require(_0x9149('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e7bc1,_0x2f907b){_0x2f907b=_0x2f907b||0xcc;return function(_0x4f9203){if(_0x4f9203){return _0x2e7bc1['sendStatus'](_0x2f907b);}return _0x2e7bc1[_0x9149('0x1c')](_0x2f907b)[_0x9149('0x1d')]();};}function respondWithResult(_0x372726,_0x2fcbf5){_0x2fcbf5=_0x2fcbf5||0xc8;return function(_0x2d8336){if(_0x2d8336){return _0x372726['status'](_0x2fcbf5)[_0x9149('0x1e')](_0x2d8336);}};}function respondWithFilteredResult(_0x5803ec,_0x311a82){return function(_0x1fb9f2){if(_0x1fb9f2){var _0x1b3838=typeof _0x311a82[_0x9149('0x1f')]===_0x9149('0x20')&&typeof _0x311a82['limit']===_0x9149('0x20');var _0x510b5e=_0x1fb9f2[_0x9149('0x21')];var _0x437a6f=_0x1b3838?0x0:_0x311a82[_0x9149('0x1f')];var _0x55247f=_0x1b3838?_0x1fb9f2[_0x9149('0x21')]:_0x311a82['offset']+_0x311a82[_0x9149('0x22')];var _0x251d64;if(_0x55247f>=_0x510b5e){_0x55247f=_0x510b5e;_0x251d64=0xc8;}else{_0x251d64=0xce;}_0x5803ec['status'](_0x251d64);return _0x5803ec[_0x9149('0x23')](_0x9149('0x24'),_0x437a6f+'-'+_0x55247f+'/'+_0x510b5e)['json'](_0x1fb9f2);}return null;};}function patchUpdates(_0x262572){return function(_0x5d78ca){try{jsonpatch[_0x9149('0x25')](_0x5d78ca,_0x262572,!![]);}catch(_0xe69705){return BPromise[_0x9149('0x26')](_0xe69705);}return _0x5d78ca[_0x9149('0x27')]();};}function saveUpdates(_0x394947,_0x1c08cb){return function(_0x4ab6c4){if(_0x4ab6c4){return _0x4ab6c4[_0x9149('0x28')](_0x394947)['then'](function(_0x2adc92){return _0x2adc92;});}return null;};}function removeEntity(_0x9b2dd1,_0x3f31a3){return function(_0x42337c){if(_0x42337c){return _0x42337c[_0x9149('0x29')]()[_0x9149('0x2a')](function(){_0x9b2dd1['status'](0xcc)[_0x9149('0x1d')]();});}};}function handleEntityNotFound(_0x2ca5eb,_0x3f7e5d){return function(_0x55b6f4){if(!_0x55b6f4){_0x2ca5eb['sendStatus'](0x194);}return _0x55b6f4;};}function handleError(_0x5eaf5f,_0x2a5d61){_0x2a5d61=_0x2a5d61||0x1f4;return function(_0x502fb8){logger[_0x9149('0x2b')](_0x502fb8['stack']);if(_0x502fb8[_0x9149('0x2c')]){delete _0x502fb8[_0x9149('0x2c')];}_0x5eaf5f[_0x9149('0x1c')](_0x2a5d61)[_0x9149('0x2d')](_0x502fb8);};}exports[_0x9149('0x2e')]=function(_0x2f22,_0x4cda2f){var _0x86ab4c={},_0x82b446={},_0x3707bb={'count':0x0,'rows':[]};var _0x5b4c2a=_['map'](db[_0x9149('0x2f')]['rawAttributes'],function(_0x470ec5){return{'name':_0x470ec5[_0x9149('0x30')],'type':_0x470ec5[_0x9149('0x31')][_0x9149('0x32')]};});_0x82b446[_0x9149('0x33')]=_['map'](_0x5b4c2a,_0x9149('0x2c'));_0x82b446[_0x9149('0x34')]=_[_0x9149('0x35')](_0x2f22[_0x9149('0x34')]);_0x82b446[_0x9149('0x36')]=_[_0x9149('0x37')](_0x82b446['model'],_0x82b446[_0x9149('0x34')]);_0x86ab4c[_0x9149('0x38')]=_[_0x9149('0x37')](_0x82b446['model'],qs[_0x9149('0x39')](_0x2f22[_0x9149('0x34')][_0x9149('0x39')]));_0x86ab4c[_0x9149('0x38')]=_0x86ab4c['attributes'][_0x9149('0x3a')]?_0x86ab4c[_0x9149('0x38')]:_0x82b446[_0x9149('0x33')];if(!_0x2f22['query']['hasOwnProperty'](_0x9149('0x3b'))){_0x86ab4c[_0x9149('0x22')]=qs[_0x9149('0x22')](_0x2f22[_0x9149('0x34')][_0x9149('0x22')]);_0x86ab4c[_0x9149('0x1f')]=qs[_0x9149('0x1f')](_0x2f22[_0x9149('0x34')]['offset']);}_0x86ab4c['order']=qs['sort'](_0x2f22[_0x9149('0x34')][_0x9149('0x3c')]);_0x86ab4c[_0x9149('0x3d')]=qs[_0x9149('0x36')](_[_0x9149('0x3e')](_0x2f22[_0x9149('0x34')],_0x82b446[_0x9149('0x36')]),_0x5b4c2a);if(_0x2f22[_0x9149('0x34')][_0x9149('0x3f')]){_0x86ab4c['where']=_[_0x9149('0x40')](_0x86ab4c[_0x9149('0x3d')],{'$or':_[_0x9149('0x41')](_0x5b4c2a,function(_0x4f44ee){if(_0x4f44ee[_0x9149('0x31')]!==_0x9149('0x42')){var _0x21f670={};_0x21f670[_0x4f44ee[_0x9149('0x2c')]]={'$like':'%'+_0x2f22[_0x9149('0x34')][_0x9149('0x3f')]+'%'};return _0x21f670;}})});}_0x86ab4c=_[_0x9149('0x40')]({},_0x86ab4c,_0x2f22[_0x9149('0x43')]);var _0xf2ad0={'where':_0x86ab4c[_0x9149('0x3d')]};return db[_0x9149('0x2f')][_0x9149('0x21')](_0xf2ad0)[_0x9149('0x2a')](function(_0x3de485){_0x3707bb['count']=_0x3de485;if(_0x2f22[_0x9149('0x34')]['includeAll']){_0x86ab4c[_0x9149('0x44')]=[{'all':!![]}];}return db[_0x9149('0x2f')][_0x9149('0x45')](_0x86ab4c);})['then'](function(_0x3e4cc5){_0x3707bb[_0x9149('0x46')]=_0x3e4cc5;return _0x3707bb;})[_0x9149('0x2a')](respondWithFilteredResult(_0x4cda2f,_0x86ab4c))[_0x9149('0x47')](handleError(_0x4cda2f,null));};exports[_0x9149('0x48')]=function(_0x47a663,_0x74f2c4){var _0x401e5b={'raw':![],'where':{'id':_0x47a663[_0x9149('0x49')]['id']}},_0x1985dc={};_0x1985dc[_0x9149('0x33')]=_['keys'](db['DeskConfiguration'][_0x9149('0x4a')]);_0x1985dc['query']=_[_0x9149('0x35')](_0x47a663[_0x9149('0x34')]);_0x1985dc[_0x9149('0x36')]=_[_0x9149('0x37')](_0x1985dc[_0x9149('0x33')],_0x1985dc[_0x9149('0x34')]);_0x401e5b[_0x9149('0x38')]=_[_0x9149('0x37')](_0x1985dc[_0x9149('0x33')],qs[_0x9149('0x39')](_0x47a663[_0x9149('0x34')][_0x9149('0x39')]));_0x401e5b[_0x9149('0x38')]=_0x401e5b[_0x9149('0x38')][_0x9149('0x3a')]?_0x401e5b[_0x9149('0x38')]:_0x1985dc[_0x9149('0x33')];if(_0x47a663[_0x9149('0x34')][_0x9149('0x4b')]){_0x401e5b[_0x9149('0x44')]=[{'all':!![]}];}_0x401e5b=_[_0x9149('0x40')]({},_0x401e5b,_0x47a663[_0x9149('0x43')]);return db[_0x9149('0x2f')][_0x9149('0x4c')](_0x401e5b)[_0x9149('0x2a')](handleEntityNotFound(_0x74f2c4,null))[_0x9149('0x2a')](respondWithResult(_0x74f2c4,null))['catch'](handleError(_0x74f2c4,null));};exports['create']=function(_0x49e03e,_0x3472bf){return db[_0x9149('0x2f')]['create'](_0x49e03e[_0x9149('0x4d')],{})[_0x9149('0x2a')](respondWithResult(_0x3472bf,0xc9))[_0x9149('0x47')](handleError(_0x3472bf,null));};exports[_0x9149('0x28')]=function(_0x1797e3,_0x2d9a2b){if(_0x1797e3['body']['id']){delete _0x1797e3[_0x9149('0x4d')]['id'];}return db['DeskConfiguration'][_0x9149('0x4c')]({'where':{'id':_0x1797e3['params']['id']}})[_0x9149('0x2a')](handleEntityNotFound(_0x2d9a2b,null))[_0x9149('0x2a')](saveUpdates(_0x1797e3[_0x9149('0x4d')],null))[_0x9149('0x2a')](respondWithResult(_0x2d9a2b,null))['catch'](handleError(_0x2d9a2b,null));};exports[_0x9149('0x29')]=function(_0x2cad30,_0x1549a8){return db[_0x9149('0x2f')]['find']({'where':{'id':_0x2cad30[_0x9149('0x49')]['id']}})['then'](handleEntityNotFound(_0x1549a8,null))[_0x9149('0x2a')](removeEntity(_0x1549a8,null))[_0x9149('0x47')](handleError(_0x1549a8,null));};exports[_0x9149('0x4e')]=function(_0x588108,_0x7f33f6,_0x3e0ce7){var _0x5b0d1a={};var _0x2e3407={};var _0x214331;var _0x109178;return db[_0x9149('0x2f')]['findOne']({'where':{'id':_0x588108['params']['id']}})[_0x9149('0x2a')](handleEntityNotFound(_0x7f33f6,null))[_0x9149('0x2a')](function(_0x179b3e){if(_0x179b3e){_0x214331=_0x179b3e;_0x2e3407[_0x9149('0x33')]=_[_0x9149('0x35')](db[_0x9149('0x4f')]['rawAttributes']);_0x2e3407[_0x9149('0x34')]=_[_0x9149('0x35')](_0x588108[_0x9149('0x34')]);_0x2e3407[_0x9149('0x36')]=_[_0x9149('0x37')](_0x2e3407[_0x9149('0x33')],_0x2e3407['query']);_0x5b0d1a[_0x9149('0x38')]=_['intersection'](_0x2e3407['model'],qs[_0x9149('0x39')](_0x588108[_0x9149('0x34')][_0x9149('0x39')]));_0x5b0d1a[_0x9149('0x38')]=_0x5b0d1a[_0x9149('0x38')][_0x9149('0x3a')]?_0x5b0d1a[_0x9149('0x38')]:_0x2e3407[_0x9149('0x33')];_0x5b0d1a['order']=qs[_0x9149('0x3c')](_0x588108[_0x9149('0x34')][_0x9149('0x3c')]);_0x5b0d1a[_0x9149('0x3d')]=qs[_0x9149('0x36')](_[_0x9149('0x3e')](_0x588108[_0x9149('0x34')],_0x2e3407[_0x9149('0x36')]));if(_0x588108[_0x9149('0x34')]['filter']){_0x5b0d1a[_0x9149('0x3d')]=_[_0x9149('0x40')](_0x5b0d1a['where'],{'$or':_[_0x9149('0x41')](_0x5b0d1a['attributes'],function(_0x35d0f7){var _0x385ee5={};_0x385ee5[_0x35d0f7]={'$like':'%'+_0x588108[_0x9149('0x34')][_0x9149('0x3f')]+'%'};return _0x385ee5;})});}_0x5b0d1a=_[_0x9149('0x40')]({},_0x5b0d1a,_0x588108['options']);return _0x214331[_0x9149('0x4e')](_0x5b0d1a);}})[_0x9149('0x2a')](function(_0x6dbe10){if(_0x6dbe10){_0x109178=_0x6dbe10[_0x9149('0x3a')];if(!_0x588108[_0x9149('0x34')][_0x9149('0x50')]('nolimit')){_0x5b0d1a[_0x9149('0x22')]=qs[_0x9149('0x22')](_0x588108[_0x9149('0x34')]['limit']);_0x5b0d1a[_0x9149('0x1f')]=qs['offset'](_0x588108[_0x9149('0x34')][_0x9149('0x1f')]);}return _0x214331['getFields'](_0x5b0d1a);}})[_0x9149('0x2a')](function(_0x15bfc9){if(_0x15bfc9){return _0x15bfc9?{'count':_0x109178,'rows':_0x15bfc9}:null;}})[_0x9149('0x2a')](respondWithResult(_0x7f33f6,null))['catch'](handleError(_0x7f33f6,null));};exports[_0x9149('0x51')]=function(_0x1134c3,_0x58034c,_0x4a8627){var _0x5d04b7={};var _0x44285a={};var _0x518a54;var _0x53ccc9;return db[_0x9149('0x2f')][_0x9149('0x52')]({'where':{'id':_0x1134c3[_0x9149('0x49')]['id']}})['then'](handleEntityNotFound(_0x58034c,null))['then'](function(_0x34272f){if(_0x34272f){_0x518a54=_0x34272f;_0x44285a[_0x9149('0x33')]=_['keys'](db[_0x9149('0x4f')]['rawAttributes']);_0x44285a['query']=_[_0x9149('0x35')](_0x1134c3[_0x9149('0x34')]);_0x44285a[_0x9149('0x36')]=_[_0x9149('0x37')](_0x44285a['model'],_0x44285a[_0x9149('0x34')]);_0x5d04b7[_0x9149('0x38')]=_['intersection'](_0x44285a[_0x9149('0x33')],qs[_0x9149('0x39')](_0x1134c3[_0x9149('0x34')][_0x9149('0x39')]));_0x5d04b7[_0x9149('0x38')]=_0x5d04b7[_0x9149('0x38')]['length']?_0x5d04b7['attributes']:_0x44285a[_0x9149('0x33')];_0x5d04b7[_0x9149('0x53')]=qs[_0x9149('0x3c')](_0x1134c3[_0x9149('0x34')][_0x9149('0x3c')]);_0x5d04b7[_0x9149('0x3d')]=qs[_0x9149('0x36')](_[_0x9149('0x3e')](_0x1134c3[_0x9149('0x34')],_0x44285a[_0x9149('0x36')]));if(_0x1134c3[_0x9149('0x34')][_0x9149('0x3f')]){_0x5d04b7[_0x9149('0x3d')]=_[_0x9149('0x40')](_0x5d04b7[_0x9149('0x3d')],{'$or':_[_0x9149('0x41')](_0x5d04b7[_0x9149('0x38')],function(_0x4b5946){var _0x1bf5d0={};_0x1bf5d0[_0x4b5946]={'$like':'%'+_0x1134c3['query'][_0x9149('0x3f')]+'%'};return _0x1bf5d0;})});}_0x5d04b7=_[_0x9149('0x40')]({},_0x5d04b7,_0x1134c3['options']);return _0x518a54['getSubjects'](_0x5d04b7);}})['then'](function(_0x50cadb){if(_0x50cadb){_0x53ccc9=_0x50cadb[_0x9149('0x3a')];if(!_0x1134c3[_0x9149('0x34')][_0x9149('0x50')](_0x9149('0x3b'))){_0x5d04b7[_0x9149('0x22')]=qs[_0x9149('0x22')](_0x1134c3[_0x9149('0x34')]['limit']);_0x5d04b7[_0x9149('0x1f')]=qs[_0x9149('0x1f')](_0x1134c3['query'][_0x9149('0x1f')]);}return _0x518a54[_0x9149('0x51')](_0x5d04b7);}})[_0x9149('0x2a')](function(_0x5e0868){if(_0x5e0868){return _0x5e0868?{'count':_0x53ccc9,'rows':_0x5e0868}:null;}})[_0x9149('0x2a')](respondWithResult(_0x58034c,null))[_0x9149('0x47')](handleError(_0x58034c,null));};exports[_0x9149('0x54')]=function(_0x3e5a8a,_0x230a5e,_0x12bb48){var _0x62d363={};var _0x462a6d={};var _0x2e0095;var _0x224be3;return db[_0x9149('0x2f')]['findOne']({'where':{'id':_0x3e5a8a[_0x9149('0x49')]['id']}})['then'](handleEntityNotFound(_0x230a5e,null))['then'](function(_0x3af5a9){if(_0x3af5a9){_0x2e0095=_0x3af5a9;_0x462a6d[_0x9149('0x33')]=_[_0x9149('0x35')](db[_0x9149('0x4f')][_0x9149('0x4a')]);_0x462a6d[_0x9149('0x34')]=_[_0x9149('0x35')](_0x3e5a8a[_0x9149('0x34')]);_0x462a6d[_0x9149('0x36')]=_[_0x9149('0x37')](_0x462a6d[_0x9149('0x33')],_0x462a6d[_0x9149('0x34')]);_0x62d363['attributes']=_[_0x9149('0x37')](_0x462a6d[_0x9149('0x33')],qs['fields'](_0x3e5a8a[_0x9149('0x34')]['fields']));_0x62d363['attributes']=_0x62d363[_0x9149('0x38')][_0x9149('0x3a')]?_0x62d363[_0x9149('0x38')]:_0x462a6d['model'];_0x62d363[_0x9149('0x53')]=qs[_0x9149('0x3c')](_0x3e5a8a[_0x9149('0x34')][_0x9149('0x3c')]);_0x62d363[_0x9149('0x3d')]=qs['filters'](_[_0x9149('0x3e')](_0x3e5a8a[_0x9149('0x34')],_0x462a6d['filters']));if(_0x3e5a8a[_0x9149('0x34')]['filter']){_0x62d363[_0x9149('0x3d')]=_[_0x9149('0x40')](_0x62d363[_0x9149('0x3d')],{'$or':_[_0x9149('0x41')](_0x62d363[_0x9149('0x38')],function(_0x4ac15c){var _0x59af77={};_0x59af77[_0x4ac15c]={'$like':'%'+_0x3e5a8a[_0x9149('0x34')][_0x9149('0x3f')]+'%'};return _0x59af77;})});}_0x62d363=_[_0x9149('0x40')]({},_0x62d363,_0x3e5a8a[_0x9149('0x43')]);return _0x2e0095['getDescriptions'](_0x62d363);}})[_0x9149('0x2a')](function(_0x23b8e9){if(_0x23b8e9){_0x224be3=_0x23b8e9['length'];if(!_0x3e5a8a[_0x9149('0x34')][_0x9149('0x50')](_0x9149('0x3b'))){_0x62d363[_0x9149('0x22')]=qs[_0x9149('0x22')](_0x3e5a8a[_0x9149('0x34')]['limit']);_0x62d363[_0x9149('0x1f')]=qs[_0x9149('0x1f')](_0x3e5a8a[_0x9149('0x34')]['offset']);}return _0x2e0095['getDescriptions'](_0x62d363);}})[_0x9149('0x2a')](function(_0x402b75){if(_0x402b75){return _0x402b75?{'count':_0x224be3,'rows':_0x402b75}:null;}})[_0x9149('0x2a')](respondWithResult(_0x230a5e,null))[_0x9149('0x47')](handleError(_0x230a5e,null));};exports[_0x9149('0x55')]=function(_0x8553de,_0x398ecc,_0x5bb20c){var _0x22766a={};var _0xb6476c={};var _0x1a45b1;var _0x488209;return db[_0x9149('0x2f')]['findOne']({'where':{'id':_0x8553de[_0x9149('0x49')]['id']}})[_0x9149('0x2a')](handleEntityNotFound(_0x398ecc,null))[_0x9149('0x2a')](function(_0x2f9074){if(_0x2f9074){_0x1a45b1=_0x2f9074;_0xb6476c[_0x9149('0x33')]=_[_0x9149('0x35')](db['Tag'][_0x9149('0x4a')]);_0xb6476c[_0x9149('0x34')]=_[_0x9149('0x35')](_0x8553de['query']);_0xb6476c[_0x9149('0x36')]=_[_0x9149('0x37')](_0xb6476c[_0x9149('0x33')],_0xb6476c[_0x9149('0x34')]);_0x22766a[_0x9149('0x38')]=_[_0x9149('0x37')](_0xb6476c['model'],qs[_0x9149('0x39')](_0x8553de[_0x9149('0x34')][_0x9149('0x39')]));_0x22766a[_0x9149('0x38')]=_0x22766a[_0x9149('0x38')][_0x9149('0x3a')]?_0x22766a[_0x9149('0x38')]:_0xb6476c[_0x9149('0x33')];_0x22766a[_0x9149('0x53')]=qs[_0x9149('0x3c')](_0x8553de[_0x9149('0x34')][_0x9149('0x3c')]);_0x22766a[_0x9149('0x3d')]=qs[_0x9149('0x36')](_['pick'](_0x8553de[_0x9149('0x34')],_0xb6476c[_0x9149('0x36')]));if(_0x8553de[_0x9149('0x34')]['filter']){_0x22766a[_0x9149('0x3d')]=_[_0x9149('0x40')](_0x22766a[_0x9149('0x3d')],{'$or':_[_0x9149('0x41')](_0x22766a['attributes'],function(_0x307770){var _0x42e5fa={};_0x42e5fa[_0x307770]={'$like':'%'+_0x8553de[_0x9149('0x34')][_0x9149('0x3f')]+'%'};return _0x42e5fa;})});}_0x22766a=_[_0x9149('0x40')]({},_0x22766a,_0x8553de[_0x9149('0x43')]);return _0x1a45b1[_0x9149('0x55')](_0x22766a);}})['then'](function(_0x4a24ce){if(_0x4a24ce){_0x488209=_0x4a24ce[_0x9149('0x3a')];if(!_0x8553de[_0x9149('0x34')][_0x9149('0x50')](_0x9149('0x3b'))){_0x22766a[_0x9149('0x22')]=qs[_0x9149('0x22')](_0x8553de[_0x9149('0x34')][_0x9149('0x22')]);_0x22766a['offset']=qs[_0x9149('0x1f')](_0x8553de['query'][_0x9149('0x1f')]);}return _0x1a45b1[_0x9149('0x55')](_0x22766a);}})[_0x9149('0x2a')](function(_0x31434c){if(_0x31434c){return _0x31434c?{'count':_0x488209,'rows':_0x31434c}:null;}})[_0x9149('0x2a')](respondWithResult(_0x398ecc,null))[_0x9149('0x47')](handleError(_0x398ecc,null));};exports[_0x9149('0x56')]=function(_0x3a93b1,_0x953c62,_0x53b551){if(_0x3a93b1[_0x9149('0x4d')]['id']){delete _0x3a93b1[_0x9149('0x4d')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x3a93b1['params']['id']}})[_0x9149('0x2a')](handleEntityNotFound(_0x953c62,null))[_0x9149('0x2a')](function(_0xc09371){if(_0xc09371){return _0xc09371[_0x9149('0x56')](_0x3a93b1[_0x9149('0x4d')][_0x9149('0x57')]||[]);}return null;})[_0x9149('0x2a')](respondWithResult(_0x953c62,null))[_0x9149('0x47')](handleError(_0x953c62,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 88f2149..ea5f7da 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 _0xb677=['exports','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x4ab87b,_0x19a420){var _0xbdecc7=function(_0x1ff2fb){while(--_0x1ff2fb){_0x4ab87b['push'](_0x4ab87b['shift']());}};_0xbdecc7(++_0x19a420);}(_0xb677,0x178));var _0x7b67=function(_0x4b1c11,_0x284284){_0x4b1c11=_0x4b1c11-0x0;var _0x42a7d2=_0xb677[_0x4b1c11];return _0x42a7d2;};'use strict';var _=require(_0x7b67('0x0'));var util=require('util');var logger=require(_0x7b67('0x1'))(_0x7b67('0x2'));var moment=require(_0x7b67('0x3'));var BPromise=require(_0x7b67('0x4'));var rp=require(_0x7b67('0x5'));var fs=require('fs');var path=require(_0x7b67('0x6'));var rimraf=require('rimraf');var config=require(_0x7b67('0x7'));var attributes=require('./intDeskConfiguration.attributes');module[_0x7b67('0x8')]=function(_0x1efd58,_0x43c4a2){return _0x1efd58[_0x7b67('0x9')](_0x7b67('0xa'),attributes,{'tableName':_0x7b67('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3bea=['DeskConfiguration','lodash','../../config/logger','bluebird','request-promise','rimraf','./intDeskConfiguration.attributes','exports','define'];(function(_0x4fd415,_0x5178cc){var _0x21da43=function(_0x27b6c0){while(--_0x27b6c0){_0x4fd415['push'](_0x4fd415['shift']());}};_0x21da43(++_0x5178cc);}(_0x3bea,0x10f));var _0xa3be=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x3bea[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xa3be('0x0'));var util=require('util');var logger=require(_0xa3be('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa3be('0x2'));var rp=require(_0xa3be('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa3be('0x4'));var config=require('../../config/environment');var attributes=require(_0xa3be('0x5'));module[_0xa3be('0x6')]=function(_0x5cbccd,_0x5677c4){return _0x5cbccd[_0xa3be('0x7')](_0xa3be('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index d5dc65f..eef0d88 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 _0x29f1=['info','request\x20sent','debug','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x29f1,0x195));var _0x129f=function(_0x206df4,_0x44ec3e){_0x206df4=_0x206df4-0x0;var _0x46ecfd=_0x29f1[_0x206df4];return _0x46ecfd;};'use strict';var _=require('lodash');var util=require(_0x129f('0x0'));var moment=require('moment');var BPromise=require(_0x129f('0x1'));var rs=require(_0x129f('0x2'));var fs=require('fs');var Redis=require(_0x129f('0x3'));var db=require(_0x129f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x129f('0x5'))(_0x129f('0x6'));var config=require(_0x129f('0x7'));var jayson=require(_0x129f('0x8'));var client=jayson[_0x129f('0x9')][_0x129f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x364841,_0x16e416,_0x27e5ee){return new BPromise(function(_0x4ceb6d,_0x4a94cf){return client[_0x129f('0xb')](_0x364841,_0x27e5ee)[_0x129f('0xc')](function(_0x3bfdf7){logger[_0x129f('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x16e416,_0x129f('0xe'));logger[_0x129f('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x16e416,_0x129f('0xe'),JSON[_0x129f('0x10')](_0x3bfdf7));if(_0x3bfdf7['error']){if(_0x3bfdf7[_0x129f('0x11')][_0x129f('0x12')]===0x1f4){logger[_0x129f('0x11')](_0x129f('0x13'),_0x16e416,_0x3bfdf7[_0x129f('0x11')][_0x129f('0x14')]);return _0x4a94cf(_0x3bfdf7['error'][_0x129f('0x14')]);}logger['error'](_0x129f('0x13'),_0x16e416,_0x3bfdf7['error'][_0x129f('0x14')]);return _0x4ceb6d(_0x3bfdf7[_0x129f('0x11')][_0x129f('0x14')]);}else{logger[_0x129f('0xd')](_0x129f('0x13'),_0x16e416,'request\x20sent');_0x4ceb6d(_0x3bfdf7[_0x129f('0x15')]['message']);}})['catch'](function(_0x5028a3){logger[_0x129f('0x11')](_0x129f('0x13'),_0x16e416,_0x5028a3);_0x4a94cf(_0x5028a3);});});} \ No newline at end of file +var _0x761c=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x761c,0x18a));var _0xc761=function(_0xb5a7e3,_0x103333){_0xb5a7e3=_0xb5a7e3-0x0;var _0x2b5520=_0x761c[_0xb5a7e3];return _0x2b5520;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var moment=require(_0xc761('0x1'));var BPromise=require(_0xc761('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc761('0x3'));var db=require(_0xc761('0x4'))['db'];var utils=require(_0xc761('0x5'));var logger=require('../../config/logger')(_0xc761('0x6'));var config=require('../../config/environment');var jayson=require(_0xc761('0x7'));var client=jayson[_0xc761('0x8')][_0xc761('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xafa0bd,_0x2f4f2e,_0x444747){return new BPromise(function(_0x46e882,_0x507772){return client[_0xc761('0xa')](_0xafa0bd,_0x444747)[_0xc761('0xb')](function(_0x175c1c){logger[_0xc761('0xc')](_0xc761('0xd'),_0x2f4f2e,_0xc761('0xe'));logger[_0xc761('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent',JSON[_0xc761('0x10')](_0x175c1c));if(_0x175c1c[_0xc761('0x11')]){if(_0x175c1c['error']['code']===0x1f4){logger[_0xc761('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x2f4f2e,_0x175c1c[_0xc761('0x11')]['message']);return _0x507772(_0x175c1c[_0xc761('0x11')]['message']);}logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);return _0x46e882(_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);}else{logger[_0xc761('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent');_0x46e882(_0x175c1c[_0xc761('0x13')][_0xc761('0x12')]);}})[_0xc761('0x14')](function(_0x597085){logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x597085);_0x507772(_0x597085);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7e81591..98e68be 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 _0x3588=['get','index','isAuthenticated','post','create','put','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller'];(function(_0x58b87b,_0x4d7895){var _0x50be6a=function(_0x4391de){while(--_0x4391de){_0x58b87b['push'](_0x58b87b['shift']());}};_0x50be6a(++_0x4d7895);}(_0x3588,0x82));var _0x8358=function(_0xb65ffb,_0x2cc0af){_0xb65ffb=_0xb65ffb-0x0;var _0x58f55c=_0x3588[_0xb65ffb];return _0x58f55c;};'use strict';var multer=require(_0x8358('0x0'));var util=require(_0x8358('0x1'));var path=require(_0x8358('0x2'));var timeout=require(_0x8358('0x3'));var express=require(_0x8358('0x4'));var router=express[_0x8358('0x5')]();var fs_extra=require(_0x8358('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8358('0x7'));var config=require(_0x8358('0x8'));var controller=require(_0x8358('0x9'));router[_0x8358('0xa')]('/',auth['isAuthenticated'](),controller[_0x8358('0xb')]);router[_0x8358('0xa')]('/:id',auth[_0x8358('0xc')](),controller['show']);router[_0x8358('0xd')]('/',auth[_0x8358('0xc')](),controller[_0x8358('0xe')]);router[_0x8358('0xf')]('/:id',auth[_0x8358('0xc')](),controller['update']);router[_0x8358('0x10')](_0x8358('0x11'),auth[_0x8358('0xc')](),controller[_0x8358('0x12')]);module[_0x8358('0x13')]=router; \ No newline at end of file +var _0x0966=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','isAuthenticated','get','/:id','post','create','update','destroy','exports','multer','util','connect-timeout'];(function(_0x38534b,_0x42fbb6){var _0x22218d=function(_0x4101b5){while(--_0x4101b5){_0x38534b['push'](_0x38534b['shift']());}};_0x22218d(++_0x42fbb6);}(_0x0966,0x9d));var _0x6096=function(_0x1a85ae,_0x5c928b){_0x1a85ae=_0x1a85ae-0x0;var _0x54a46f=_0x0966[_0x1a85ae];return _0x54a46f;};'use strict';var multer=require(_0x6096('0x0'));var util=require(_0x6096('0x1'));var path=require('path');var timeout=require(_0x6096('0x2'));var express=require('express');var router=express[_0x6096('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6096('0x4'));var interaction=require(_0x6096('0x5'));var config=require(_0x6096('0x6'));var controller=require(_0x6096('0x7'));router['get']('/',auth[_0x6096('0x8')](),controller['index']);router[_0x6096('0x9')](_0x6096('0xa'),auth[_0x6096('0x8')](),controller['show']);router[_0x6096('0xb')]('/',auth['isAuthenticated'](),controller[_0x6096('0xc')]);router['put']('/:id',auth[_0x6096('0x8')](),controller[_0x6096('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6096('0xe')]);module[_0x6096('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 c9705f0..bd445d6 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 _0xf402=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN'];(function(_0x29b694,_0x583328){var _0x354dc5=function(_0x1b0b97){while(--_0x1b0b97){_0x29b694['push'](_0x29b694['shift']());}};_0x354dc5(++_0x583328);}(_0xf402,0x1e8));var _0x2f40=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xf402[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x2f40('0x0')](_0x2f40('0x1'),'variable',_0x2f40('0x2'),_0x2f40('0x3'),_0x2f40('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2f40('0x5')]},'key':{'type':Sequelize[_0x2f40('0x5')]},'keyType':{'type':Sequelize[_0x2f40('0x0')]('string',_0x2f40('0x6'),_0x2f40('0x2'))},'keyContent':{'type':Sequelize[_0x2f40('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2f40('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xfc99=['variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','ENUM','string'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc99,0x18d));var _0x9fc9=function(_0x2c7ac7,_0x1853ea){_0x2c7ac7=_0x2c7ac7-0x0;var _0x156218=_0xfc99[_0x2c7ac7];return _0x156218;};'use strict';var Sequelize=require(_0x9fc9('0x0'));module['exports']={'type':{'type':Sequelize[_0x9fc9('0x1')](_0x9fc9('0x2'),_0x9fc9('0x3'),_0x9fc9('0x4'),_0x9fc9('0x5'),'picklist'),'defaultValue':_0x9fc9('0x2')},'content':{'type':Sequelize[_0x9fc9('0x6')]},'key':{'type':Sequelize[_0x9fc9('0x6')]},'keyType':{'type':Sequelize[_0x9fc9('0x1')](_0x9fc9('0x2'),_0x9fc9('0x3'),_0x9fc9('0x4'))},'keyContent':{'type':Sequelize[_0x9fc9('0x6')]},'idField':{'type':Sequelize[_0x9fc9('0x6')]},'nameField':{'type':Sequelize[_0x9fc9('0x6')]},'customField':{'type':Sequelize[_0x9fc9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 87d5d98..c935e77 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 _0x41d9=['filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','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','status','end','json','undefined','limit','count','offset','set','apply','reject','destroy','then','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','order','sort','pick'];(function(_0x300db2,_0x28d607){var _0x14c5b4=function(_0x5b3f99){while(--_0x5b3f99){_0x300db2['push'](_0x300db2['shift']());}};_0x14c5b4(++_0x28d607);}(_0x41d9,0x13c));var _0x941d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41d9[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x941d('0x0'));var rimraf=require(_0x941d('0x1'));var zipdir=require(_0x941d('0x2'));var jsonpatch=require(_0x941d('0x3'));var rp=require(_0x941d('0x4'));var moment=require(_0x941d('0x5'));var BPromise=require(_0x941d('0x6'));var Mustache=require('mustache');var util=require(_0x941d('0x7'));var path=require(_0x941d('0x8'));var sox=require('sox');var csv=require(_0x941d('0x9'));var ejs=require(_0x941d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x941d('0xb'));var squel=require('squel');var crypto=require(_0x941d('0xc'));var jsforce=require(_0x941d('0xd'));var deskjs=require(_0x941d('0xe'));var toCsv=require(_0x941d('0x9'));var querystring=require(_0x941d('0xf'));var Papa=require('papaparse');var Redis=require(_0x941d('0x10'));var authService=require(_0x941d('0x11'));var qs=require(_0x941d('0x12'));var as=require(_0x941d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x941d('0x14'))(_0x941d('0x15'));var utils=require(_0x941d('0x16'));var config=require(_0x941d('0x17'));var licenseUtil=require(_0x941d('0x18'));var db=require(_0x941d('0x19'))['db'];function respondWithStatusCode(_0x4d93c4,_0x192331){_0x192331=_0x192331||0xcc;return function(_0x55c5aa){if(_0x55c5aa){return _0x4d93c4['sendStatus'](_0x192331);}return _0x4d93c4[_0x941d('0x1a')](_0x192331)[_0x941d('0x1b')]();};}function respondWithResult(_0xbd3711,_0x2aa972){_0x2aa972=_0x2aa972||0xc8;return function(_0x20a6ab){if(_0x20a6ab){return _0xbd3711[_0x941d('0x1a')](_0x2aa972)[_0x941d('0x1c')](_0x20a6ab);}};}function respondWithFilteredResult(_0x45d85d,_0x369b0b){return function(_0x1f1aeb){if(_0x1f1aeb){var _0x7df80e=typeof _0x369b0b['offset']===_0x941d('0x1d')&&typeof _0x369b0b[_0x941d('0x1e')]===_0x941d('0x1d');var _0x2e5c4f=_0x1f1aeb[_0x941d('0x1f')];var _0x3ac25f=_0x7df80e?0x0:_0x369b0b[_0x941d('0x20')];var _0x2c6ce5=_0x7df80e?_0x1f1aeb[_0x941d('0x1f')]:_0x369b0b['offset']+_0x369b0b[_0x941d('0x1e')];var _0x57f5e6;if(_0x2c6ce5>=_0x2e5c4f){_0x2c6ce5=_0x2e5c4f;_0x57f5e6=0xc8;}else{_0x57f5e6=0xce;}_0x45d85d[_0x941d('0x1a')](_0x57f5e6);return _0x45d85d[_0x941d('0x21')]('Content-Range',_0x3ac25f+'-'+_0x2c6ce5+'/'+_0x2e5c4f)[_0x941d('0x1c')](_0x1f1aeb);}return null;};}function patchUpdates(_0x5ac2e6){return function(_0x526708){try{jsonpatch[_0x941d('0x22')](_0x526708,_0x5ac2e6,!![]);}catch(_0xf6636){return BPromise[_0x941d('0x23')](_0xf6636);}return _0x526708['save']();};}function saveUpdates(_0x1309af,_0x3baf0b){return function(_0xc19c76){if(_0xc19c76){return _0xc19c76['update'](_0x1309af)['then'](function(_0x520bb2){return _0x520bb2;});}return null;};}function removeEntity(_0x306557,_0x26b7b6){return function(_0xd72c49){if(_0xd72c49){return _0xd72c49[_0x941d('0x24')]()[_0x941d('0x25')](function(){_0x306557['status'](0xcc)[_0x941d('0x1b')]();});}};}function handleEntityNotFound(_0x43a443,_0x11c2c9){return function(_0x48baff){if(!_0x48baff){_0x43a443[_0x941d('0x26')](0x194);}return _0x48baff;};}function handleError(_0x1ce2fe,_0x3190d4){_0x3190d4=_0x3190d4||0x1f4;return function(_0x3a72d7){logger[_0x941d('0x27')](_0x3a72d7[_0x941d('0x28')]);if(_0x3a72d7[_0x941d('0x29')]){delete _0x3a72d7[_0x941d('0x29')];}_0x1ce2fe[_0x941d('0x1a')](_0x3190d4)[_0x941d('0x2a')](_0x3a72d7);};}exports[_0x941d('0x2b')]=function(_0x1cacc4,_0x4cf929){var _0x30615a={},_0x42050d={},_0x5908c3={'count':0x0,'rows':[]};var _0x16ce52=_[_0x941d('0x2c')](db[_0x941d('0x2d')][_0x941d('0x2e')],function(_0x46db04){return{'name':_0x46db04[_0x941d('0x2f')],'type':_0x46db04[_0x941d('0x30')]['key']};});_0x42050d['model']=_[_0x941d('0x2c')](_0x16ce52,_0x941d('0x29'));_0x42050d[_0x941d('0x31')]=_['keys'](_0x1cacc4['query']);_0x42050d[_0x941d('0x32')]=_[_0x941d('0x33')](_0x42050d[_0x941d('0x34')],_0x42050d['query']);_0x30615a[_0x941d('0x35')]=_[_0x941d('0x33')](_0x42050d[_0x941d('0x34')],qs[_0x941d('0x36')](_0x1cacc4['query'][_0x941d('0x36')]));_0x30615a[_0x941d('0x35')]=_0x30615a[_0x941d('0x35')][_0x941d('0x37')]?_0x30615a[_0x941d('0x35')]:_0x42050d[_0x941d('0x34')];if(!_0x1cacc4['query']['hasOwnProperty']('nolimit')){_0x30615a[_0x941d('0x1e')]=qs['limit'](_0x1cacc4[_0x941d('0x31')][_0x941d('0x1e')]);_0x30615a[_0x941d('0x20')]=qs[_0x941d('0x20')](_0x1cacc4[_0x941d('0x31')][_0x941d('0x20')]);}_0x30615a[_0x941d('0x38')]=qs[_0x941d('0x39')](_0x1cacc4[_0x941d('0x31')][_0x941d('0x39')]);_0x30615a['where']=qs[_0x941d('0x32')](_[_0x941d('0x3a')](_0x1cacc4[_0x941d('0x31')],_0x42050d[_0x941d('0x32')]),_0x16ce52);if(_0x1cacc4[_0x941d('0x31')][_0x941d('0x3b')]){_0x30615a[_0x941d('0x3c')]=_[_0x941d('0x3d')](_0x30615a[_0x941d('0x3c')],{'$or':_[_0x941d('0x2c')](_0x16ce52,function(_0x37b04c){if(_0x37b04c[_0x941d('0x30')]!==_0x941d('0x3e')){var _0x55fbf2={};_0x55fbf2[_0x37b04c['name']]={'$like':'%'+_0x1cacc4[_0x941d('0x31')][_0x941d('0x3b')]+'%'};return _0x55fbf2;}})});}_0x30615a=_['merge']({},_0x30615a,_0x1cacc4[_0x941d('0x3f')]);var _0x554c8b={'where':_0x30615a[_0x941d('0x3c')]};return db['DeskField'][_0x941d('0x1f')](_0x554c8b)['then'](function(_0x2a0a21){_0x5908c3[_0x941d('0x1f')]=_0x2a0a21;if(_0x1cacc4[_0x941d('0x31')][_0x941d('0x40')]){_0x30615a[_0x941d('0x41')]=[{'all':!![]}];}return db['DeskField']['findAll'](_0x30615a);})[_0x941d('0x25')](function(_0x3354ef){_0x5908c3[_0x941d('0x42')]=_0x3354ef;return _0x5908c3;})[_0x941d('0x25')](respondWithFilteredResult(_0x4cf929,_0x30615a))[_0x941d('0x43')](handleError(_0x4cf929,null));};exports[_0x941d('0x44')]=function(_0x35ac51,_0x265a08){var _0x385099={'raw':!![],'where':{'id':_0x35ac51[_0x941d('0x45')]['id']}},_0xf7ff74={};_0xf7ff74[_0x941d('0x34')]=_[_0x941d('0x46')](db['DeskField'][_0x941d('0x2e')]);_0xf7ff74['query']=_[_0x941d('0x46')](_0x35ac51['query']);_0xf7ff74['filters']=_['intersection'](_0xf7ff74['model'],_0xf7ff74[_0x941d('0x31')]);_0x385099[_0x941d('0x35')]=_['intersection'](_0xf7ff74[_0x941d('0x34')],qs[_0x941d('0x36')](_0x35ac51[_0x941d('0x31')]['fields']));_0x385099['attributes']=_0x385099[_0x941d('0x35')][_0x941d('0x37')]?_0x385099[_0x941d('0x35')]:_0xf7ff74[_0x941d('0x34')];if(_0x35ac51['query'][_0x941d('0x40')]){_0x385099['include']=[{'all':!![]}];}_0x385099=_['merge']({},_0x385099,_0x35ac51['options']);return db[_0x941d('0x2d')][_0x941d('0x47')](_0x385099)[_0x941d('0x25')](handleEntityNotFound(_0x265a08,null))[_0x941d('0x25')](respondWithResult(_0x265a08,null))['catch'](handleError(_0x265a08,null));};exports[_0x941d('0x48')]=function(_0x235f13,_0x2daf90){return db['DeskField']['create'](_0x235f13[_0x941d('0x49')],{})['then'](respondWithResult(_0x2daf90,0xc9))[_0x941d('0x43')](handleError(_0x2daf90,null));};exports[_0x941d('0x4a')]=function(_0x319d85,_0xef7ff7){if(_0x319d85[_0x941d('0x49')]['id']){delete _0x319d85[_0x941d('0x49')]['id'];}return db[_0x941d('0x2d')][_0x941d('0x47')]({'where':{'id':_0x319d85[_0x941d('0x45')]['id']}})[_0x941d('0x25')](handleEntityNotFound(_0xef7ff7,null))[_0x941d('0x25')](saveUpdates(_0x319d85[_0x941d('0x49')],null))[_0x941d('0x25')](respondWithResult(_0xef7ff7,null))[_0x941d('0x43')](handleError(_0xef7ff7,null));};exports[_0x941d('0x24')]=function(_0x2ec3cf,_0x331792){return db['DeskField'][_0x941d('0x47')]({'where':{'id':_0x2ec3cf[_0x941d('0x45')]['id']}})[_0x941d('0x25')](handleEntityNotFound(_0x331792,null))['then'](removeEntity(_0x331792,null))['catch'](handleError(_0x331792,null));}; \ No newline at end of file +var _0xc677=['order','sort','where','VIRTUAL','merge','options','DeskField','includeAll','include','catch','show','params','filters','intersection','find','create','update','body','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','end','name','send','index','map','rawAttributes','type','key','query','keys','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xc677,0x16c));var _0x7c67=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc677[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c67('0x0'));var zipdir=require(_0x7c67('0x1'));var jsonpatch=require(_0x7c67('0x2'));var rp=require(_0x7c67('0x3'));var moment=require(_0x7c67('0x4'));var BPromise=require(_0x7c67('0x5'));var Mustache=require(_0x7c67('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7c67('0x7'));var fs=require('fs');var fs_extra=require(_0x7c67('0x8'));var _=require('lodash');var squel=require(_0x7c67('0x9'));var crypto=require('crypto');var jsforce=require(_0x7c67('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7c67('0xb'));var querystring=require(_0x7c67('0xc'));var Papa=require(_0x7c67('0xd'));var Redis=require(_0x7c67('0xe'));var authService=require(_0x7c67('0xf'));var qs=require(_0x7c67('0x10'));var as=require(_0x7c67('0x11'));var hardwareService=require(_0x7c67('0x12'));var logger=require(_0x7c67('0x13'))(_0x7c67('0x14'));var utils=require(_0x7c67('0x15'));var config=require(_0x7c67('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x7c67('0x17'))['db'];function respondWithStatusCode(_0x449661,_0x26fa55){_0x26fa55=_0x26fa55||0xcc;return function(_0x52f65b){if(_0x52f65b){return _0x449661[_0x7c67('0x18')](_0x26fa55);}return _0x449661['status'](_0x26fa55)['end']();};}function respondWithResult(_0x31355e,_0x2935eb){_0x2935eb=_0x2935eb||0xc8;return function(_0x3bf387){if(_0x3bf387){return _0x31355e[_0x7c67('0x19')](_0x2935eb)[_0x7c67('0x1a')](_0x3bf387);}};}function respondWithFilteredResult(_0x3c21c9,_0xd9743c){return function(_0x3a01ad){if(_0x3a01ad){var _0x336bb3=typeof _0xd9743c[_0x7c67('0x1b')]==='undefined'&&typeof _0xd9743c[_0x7c67('0x1c')]===_0x7c67('0x1d');var _0x2a4936=_0x3a01ad[_0x7c67('0x1e')];var _0x35d227=_0x336bb3?0x0:_0xd9743c[_0x7c67('0x1b')];var _0x197de0=_0x336bb3?_0x3a01ad[_0x7c67('0x1e')]:_0xd9743c[_0x7c67('0x1b')]+_0xd9743c[_0x7c67('0x1c')];var _0x30ed2c;if(_0x197de0>=_0x2a4936){_0x197de0=_0x2a4936;_0x30ed2c=0xc8;}else{_0x30ed2c=0xce;}_0x3c21c9[_0x7c67('0x19')](_0x30ed2c);return _0x3c21c9[_0x7c67('0x1f')](_0x7c67('0x20'),_0x35d227+'-'+_0x197de0+'/'+_0x2a4936)[_0x7c67('0x1a')](_0x3a01ad);}return null;};}function patchUpdates(_0x271f4e){return function(_0x307bd0){try{jsonpatch['apply'](_0x307bd0,_0x271f4e,!![]);}catch(_0x17d523){return BPromise['reject'](_0x17d523);}return _0x307bd0[_0x7c67('0x21')]();};}function saveUpdates(_0x1a05aa,_0x2af1fd){return function(_0x3f19ce){if(_0x3f19ce){return _0x3f19ce['update'](_0x1a05aa)['then'](function(_0x35b9c8){return _0x35b9c8;});}return null;};}function removeEntity(_0x11170e,_0x42a3d3){return function(_0x5ebfaf){if(_0x5ebfaf){return _0x5ebfaf['destroy']()[_0x7c67('0x22')](function(){_0x11170e[_0x7c67('0x19')](0xcc)[_0x7c67('0x23')]();});}};}function handleEntityNotFound(_0x670d50,_0xe1863a){return function(_0xf09e83){if(!_0xf09e83){_0x670d50['sendStatus'](0x194);}return _0xf09e83;};}function handleError(_0x250848,_0x11dd8d){_0x11dd8d=_0x11dd8d||0x1f4;return function(_0x52bc2b){logger['error'](_0x52bc2b['stack']);if(_0x52bc2b['name']){delete _0x52bc2b[_0x7c67('0x24')];}_0x250848['status'](_0x11dd8d)[_0x7c67('0x25')](_0x52bc2b);};}exports[_0x7c67('0x26')]=function(_0x2d67d5,_0x42ed09){var _0x2d03ef={},_0x51b48f={},_0x20e77c={'count':0x0,'rows':[]};var _0x42926d=_[_0x7c67('0x27')](db['DeskField'][_0x7c67('0x28')],function(_0x207846){return{'name':_0x207846['fieldName'],'type':_0x207846[_0x7c67('0x29')][_0x7c67('0x2a')]};});_0x51b48f['model']=_['map'](_0x42926d,_0x7c67('0x24'));_0x51b48f[_0x7c67('0x2b')]=_[_0x7c67('0x2c')](_0x2d67d5[_0x7c67('0x2b')]);_0x51b48f['filters']=_['intersection'](_0x51b48f[_0x7c67('0x2d')],_0x51b48f[_0x7c67('0x2b')]);_0x2d03ef[_0x7c67('0x2e')]=_['intersection'](_0x51b48f[_0x7c67('0x2d')],qs[_0x7c67('0x2f')](_0x2d67d5['query'][_0x7c67('0x2f')]));_0x2d03ef[_0x7c67('0x2e')]=_0x2d03ef[_0x7c67('0x2e')]['length']?_0x2d03ef[_0x7c67('0x2e')]:_0x51b48f[_0x7c67('0x2d')];if(!_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x30')](_0x7c67('0x31'))){_0x2d03ef[_0x7c67('0x1c')]=qs[_0x7c67('0x1c')](_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x1c')]);_0x2d03ef['offset']=qs[_0x7c67('0x1b')](_0x2d67d5['query'][_0x7c67('0x1b')]);}_0x2d03ef[_0x7c67('0x32')]=qs['sort'](_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x33')]);_0x2d03ef[_0x7c67('0x34')]=qs['filters'](_['pick'](_0x2d67d5[_0x7c67('0x2b')],_0x51b48f['filters']),_0x42926d);if(_0x2d67d5[_0x7c67('0x2b')]['filter']){_0x2d03ef[_0x7c67('0x34')]=_['merge'](_0x2d03ef[_0x7c67('0x34')],{'$or':_[_0x7c67('0x27')](_0x42926d,function(_0x30543d){if(_0x30543d['type']!==_0x7c67('0x35')){var _0x378006={};_0x378006[_0x30543d['name']]={'$like':'%'+_0x2d67d5[_0x7c67('0x2b')]['filter']+'%'};return _0x378006;}})});}_0x2d03ef=_[_0x7c67('0x36')]({},_0x2d03ef,_0x2d67d5[_0x7c67('0x37')]);var _0x2f7f28={'where':_0x2d03ef['where']};return db[_0x7c67('0x38')][_0x7c67('0x1e')](_0x2f7f28)['then'](function(_0x45245b){_0x20e77c['count']=_0x45245b;if(_0x2d67d5[_0x7c67('0x2b')][_0x7c67('0x39')]){_0x2d03ef[_0x7c67('0x3a')]=[{'all':!![]}];}return db[_0x7c67('0x38')]['findAll'](_0x2d03ef);})[_0x7c67('0x22')](function(_0x36d344){_0x20e77c['rows']=_0x36d344;return _0x20e77c;})[_0x7c67('0x22')](respondWithFilteredResult(_0x42ed09,_0x2d03ef))[_0x7c67('0x3b')](handleError(_0x42ed09,null));};exports[_0x7c67('0x3c')]=function(_0x3ee63c,_0x3aaa82){var _0x2695c8={'raw':!![],'where':{'id':_0x3ee63c[_0x7c67('0x3d')]['id']}},_0x45da99={};_0x45da99[_0x7c67('0x2d')]=_[_0x7c67('0x2c')](db[_0x7c67('0x38')][_0x7c67('0x28')]);_0x45da99[_0x7c67('0x2b')]=_['keys'](_0x3ee63c[_0x7c67('0x2b')]);_0x45da99[_0x7c67('0x3e')]=_[_0x7c67('0x3f')](_0x45da99[_0x7c67('0x2d')],_0x45da99['query']);_0x2695c8[_0x7c67('0x2e')]=_[_0x7c67('0x3f')](_0x45da99['model'],qs[_0x7c67('0x2f')](_0x3ee63c[_0x7c67('0x2b')][_0x7c67('0x2f')]));_0x2695c8[_0x7c67('0x2e')]=_0x2695c8[_0x7c67('0x2e')]['length']?_0x2695c8['attributes']:_0x45da99['model'];if(_0x3ee63c[_0x7c67('0x2b')][_0x7c67('0x39')]){_0x2695c8[_0x7c67('0x3a')]=[{'all':!![]}];}_0x2695c8=_[_0x7c67('0x36')]({},_0x2695c8,_0x3ee63c['options']);return db[_0x7c67('0x38')][_0x7c67('0x40')](_0x2695c8)[_0x7c67('0x22')](handleEntityNotFound(_0x3aaa82,null))[_0x7c67('0x22')](respondWithResult(_0x3aaa82,null))['catch'](handleError(_0x3aaa82,null));};exports[_0x7c67('0x41')]=function(_0x3840b5,_0x20428e){return db[_0x7c67('0x38')][_0x7c67('0x41')](_0x3840b5['body'],{})[_0x7c67('0x22')](respondWithResult(_0x20428e,0xc9))[_0x7c67('0x3b')](handleError(_0x20428e,null));};exports[_0x7c67('0x42')]=function(_0x1e07bf,_0x26e374){if(_0x1e07bf[_0x7c67('0x43')]['id']){delete _0x1e07bf[_0x7c67('0x43')]['id'];}return db[_0x7c67('0x38')]['find']({'where':{'id':_0x1e07bf[_0x7c67('0x3d')]['id']}})[_0x7c67('0x22')](handleEntityNotFound(_0x26e374,null))[_0x7c67('0x22')](saveUpdates(_0x1e07bf['body'],null))[_0x7c67('0x22')](respondWithResult(_0x26e374,null))[_0x7c67('0x3b')](handleError(_0x26e374,null));};exports[_0x7c67('0x44')]=function(_0x1b766d,_0x156c5a){return db[_0x7c67('0x38')]['find']({'where':{'id':_0x1b766d['params']['id']}})[_0x7c67('0x22')](handleEntityNotFound(_0x156c5a,null))['then'](removeEntity(_0x156c5a,null))[_0x7c67('0x3b')](handleError(_0x156c5a,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 4525581..3c9e154 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 _0x9420=['DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','path','rimraf','./intDeskField.attributes','exports','define'];(function(_0x291145,_0x449848){var _0x186d2c=function(_0x12de55){while(--_0x12de55){_0x291145['push'](_0x291145['shift']());}};_0x186d2c(++_0x449848);}(_0x9420,0x18b));var _0x0942=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x9420[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0x0942('0x0'));var util=require(_0x0942('0x1'));var logger=require(_0x0942('0x2'))(_0x0942('0x3'));var moment=require('moment');var BPromise=require(_0x0942('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0942('0x5'));var rimraf=require(_0x0942('0x6'));var config=require('../../config/environment');var attributes=require(_0x0942('0x7'));module[_0x0942('0x8')]=function(_0x534a6e,_0x16db06){return _0x534a6e[_0x0942('0x9')](_0x0942('0xa'),attributes,{'tableName':_0x0942('0xb'),'paranoid':![],'indexes':[{'name':_0x0942('0xc'),'fields':[_0x0942('0xd'),_0x0942('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x883c=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','int_desk_fields','desk_unique_index','idField'];(function(_0x1af25d,_0x50345a){var _0x503848=function(_0x514be1){while(--_0x514be1){_0x1af25d['push'](_0x1af25d['shift']());}};_0x503848(++_0x50345a);}(_0x883c,0x1b3));var _0xc883=function(_0x4afb23,_0x40b8fb){_0x4afb23=_0x4afb23-0x0;var _0x4a833d=_0x883c[_0x4afb23];return _0x4a833d;};'use strict';var _=require(_0xc883('0x0'));var util=require(_0xc883('0x1'));var logger=require(_0xc883('0x2'))(_0xc883('0x3'));var moment=require(_0xc883('0x4'));var BPromise=require(_0xc883('0x5'));var rp=require(_0xc883('0x6'));var fs=require('fs');var path=require(_0xc883('0x7'));var rimraf=require(_0xc883('0x8'));var config=require(_0xc883('0x9'));var attributes=require('./intDeskField.attributes');module['exports']=function(_0x12dee9,_0x903998){return _0x12dee9['define']('DeskField',attributes,{'tableName':_0xc883('0xa'),'paranoid':![],'indexes':[{'name':_0xc883('0xb'),'fields':[_0xc883('0xc'),_0xc883('0xd')],'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 7f36955..cbcb466 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 _0x7081=['rpc','../../config/environment','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x6912e8,_0x378b83){var _0x53171e=function(_0x324470){while(--_0x324470){_0x6912e8['push'](_0x6912e8['shift']());}};_0x53171e(++_0x378b83);}(_0x7081,0x82));var _0x1708=function(_0x5e6c6b,_0x394668){_0x5e6c6b=_0x5e6c6b-0x0;var _0x14a242=_0x7081[_0x5e6c6b];return _0x14a242;};'use strict';var _=require(_0x1708('0x0'));var util=require(_0x1708('0x1'));var moment=require(_0x1708('0x2'));var BPromise=require(_0x1708('0x3'));var rs=require(_0x1708('0x4'));var fs=require('fs');var Redis=require(_0x1708('0x5'));var db=require(_0x1708('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1708('0x7'))(_0x1708('0x8'));var config=require(_0x1708('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1708('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x571598,_0x4571dc,_0x381f09){return new BPromise(function(_0xaa4b69,_0x3b0ff7){return client[_0x1708('0xb')](_0x571598,_0x381f09)[_0x1708('0xc')](function(_0x5a55be){logger[_0x1708('0xd')](_0x1708('0xe'),_0x4571dc,_0x1708('0xf'));logger[_0x1708('0x10')](_0x1708('0x11'),_0x4571dc,'request\x20sent',JSON[_0x1708('0x12')](_0x5a55be));if(_0x5a55be[_0x1708('0x13')]){if(_0x5a55be['error'][_0x1708('0x14')]===0x1f4){logger['error'](_0x1708('0xe'),_0x4571dc,_0x5a55be[_0x1708('0x13')][_0x1708('0x15')]);return _0x3b0ff7(_0x5a55be[_0x1708('0x13')]['message']);}logger[_0x1708('0x13')](_0x1708('0xe'),_0x4571dc,_0x5a55be[_0x1708('0x13')][_0x1708('0x15')]);return _0xaa4b69(_0x5a55be[_0x1708('0x13')]['message']);}else{logger[_0x1708('0xd')]('DeskField,\x20%s,\x20%s',_0x4571dc,_0x1708('0xf'));_0xaa4b69(_0x5a55be['result'][_0x1708('0x15')]);}})[_0x1708('0x16')](function(_0x5bbe09){logger[_0x1708('0x13')](_0x1708('0xe'),_0x4571dc,_0x5bbe09);_0x3b0ff7(_0x5bbe09);});});} \ No newline at end of file +var _0x7414=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x264545,_0x214037){var _0x114d10=function(_0x9e3461){while(--_0x9e3461){_0x264545['push'](_0x264545['shift']());}};_0x114d10(++_0x214037);}(_0x7414,0xc9));var _0x4741=function(_0x402084,_0x4e91d6){_0x402084=_0x402084-0x0;var _0x254817=_0x7414[_0x402084];return _0x254817;};'use strict';var _=require('lodash');var util=require(_0x4741('0x0'));var moment=require(_0x4741('0x1'));var BPromise=require(_0x4741('0x2'));var rs=require(_0x4741('0x3'));var fs=require('fs');var Redis=require(_0x4741('0x4'));var db=require(_0x4741('0x5'))['db'];var utils=require(_0x4741('0x6'));var logger=require(_0x4741('0x7'))(_0x4741('0x8'));var config=require('../../config/environment');var jayson=require(_0x4741('0x9'));var client=jayson[_0x4741('0xa')][_0x4741('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf0dc52,_0x3050c2,_0x507a0e){return new BPromise(function(_0x2d7d04,_0x329479){return client[_0x4741('0xc')](_0xf0dc52,_0x507a0e)[_0x4741('0xd')](function(_0x2f00fa){logger[_0x4741('0xe')](_0x4741('0xf'),_0x3050c2,_0x4741('0x10'));logger['debug'](_0x4741('0x11'),_0x3050c2,_0x4741('0x10'),JSON['stringify'](_0x2f00fa));if(_0x2f00fa[_0x4741('0x12')]){if(_0x2f00fa[_0x4741('0x12')][_0x4741('0x13')]===0x1f4){logger[_0x4741('0x12')](_0x4741('0xf'),_0x3050c2,_0x2f00fa[_0x4741('0x12')][_0x4741('0x14')]);return _0x329479(_0x2f00fa[_0x4741('0x12')]['message']);}logger[_0x4741('0x12')]('DeskField,\x20%s,\x20%s',_0x3050c2,_0x2f00fa['error'][_0x4741('0x14')]);return _0x2d7d04(_0x2f00fa['error']['message']);}else{logger[_0x4741('0xe')](_0x4741('0xf'),_0x3050c2,_0x4741('0x10'));_0x2d7d04(_0x2f00fa[_0x4741('0x15')][_0x4741('0x14')]);}})[_0x4741('0x16')](function(_0x55719f){logger['error'](_0x4741('0xf'),_0x3050c2,_0x55719f);_0x329479(_0x55719f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 9fa0766..bf4af15 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 _0x5690=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x15eb63,_0xd3f629){var _0x19fc81=function(_0x4ddaec){while(--_0x4ddaec){_0x15eb63['push'](_0x15eb63['shift']());}};_0x19fc81(++_0xd3f629);}(_0x5690,0x7b));var _0x0569=function(_0x486df7,_0x5f803a){_0x486df7=_0x486df7-0x0;var _0x3c0d43=_0x5690[_0x486df7];return _0x3c0d43;};'use strict';var multer=require('multer');var util=require(_0x0569('0x0'));var path=require(_0x0569('0x1'));var timeout=require(_0x0569('0x2'));var express=require(_0x0569('0x3'));var router=express[_0x0569('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0569('0x5'));var interaction=require(_0x0569('0x6'));var config=require('../../config/environment');var controller=require('./intDynamics365Account.controller');router[_0x0569('0x7')]('/',auth[_0x0569('0x8')](),controller[_0x0569('0x9')]);router[_0x0569('0x7')](_0x0569('0xa'),auth[_0x0569('0x8')](),controller[_0x0569('0xb')]);router[_0x0569('0x7')](_0x0569('0xc'),auth[_0x0569('0x8')](),controller[_0x0569('0xd')]);router[_0x0569('0x7')](_0x0569('0xe'),auth[_0x0569('0x8')](),controller[_0x0569('0xf')]);router[_0x0569('0x10')]('/',auth[_0x0569('0x8')](),controller['create']);router['post'](_0x0569('0xc'),auth[_0x0569('0x8')](),controller[_0x0569('0x11')]);router[_0x0569('0x12')](_0x0569('0xa'),auth[_0x0569('0x8')](),controller[_0x0569('0x13')]);router[_0x0569('0x14')](_0x0569('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x0569('0x15')]=router; \ No newline at end of file +var _0x9960=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','update'];(function(_0x5cceda,_0x36bb40){var _0x121aa4=function(_0x39e5be){while(--_0x39e5be){_0x5cceda['push'](_0x5cceda['shift']());}};_0x121aa4(++_0x36bb40);}(_0x9960,0xda));var _0x0996=function(_0x16b352,_0x272086){_0x16b352=_0x16b352-0x0;var _0x58b676=_0x9960[_0x16b352];return _0x58b676;};'use strict';var multer=require(_0x0996('0x0'));var util=require(_0x0996('0x1'));var path=require(_0x0996('0x2'));var timeout=require(_0x0996('0x3'));var express=require(_0x0996('0x4'));var router=express['Router']();var fs_extra=require(_0x0996('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0996('0x6'));var config=require(_0x0996('0x7'));var controller=require(_0x0996('0x8'));router[_0x0996('0x9')]('/',auth[_0x0996('0xa')](),controller[_0x0996('0xb')]);router[_0x0996('0x9')](_0x0996('0xc'),auth[_0x0996('0xa')](),controller[_0x0996('0xd')]);router['get'](_0x0996('0xe'),auth['isAuthenticated'](),controller[_0x0996('0xf')]);router[_0x0996('0x9')](_0x0996('0x10'),auth[_0x0996('0xa')](),controller['getFields']);router[_0x0996('0x11')]('/',auth[_0x0996('0xa')](),controller[_0x0996('0x12')]);router[_0x0996('0x11')](_0x0996('0xe'),auth['isAuthenticated'](),controller[_0x0996('0x13')]);router[_0x0996('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x0996('0x15')]);router[_0x0996('0x16')]('/:id',auth[_0x0996('0xa')](),controller['destroy']);module[_0x0996('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e48cc20..602c1eb 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 _0xa990=['BOOLEAN','sequelize','exports','STRING'];(function(_0x260206,_0x11856d){var _0x2064e3=function(_0x2a2706){while(--_0x2a2706){_0x260206['push'](_0x260206['shift']());}};_0x2064e3(++_0x11856d);}(_0xa990,0xc9));var _0x0a99=function(_0x5b89f7,_0x288117){_0x5b89f7=_0x5b89f7-0x0;var _0x28cac2=_0xa990[_0x5b89f7];return _0x28cac2;};'use strict';var Sequelize=require(_0x0a99('0x0'));module[_0x0a99('0x1')]={'name':{'type':Sequelize[_0x0a99('0x2')]},'username':{'type':Sequelize[_0x0a99('0x2')]},'password':{'type':Sequelize[_0x0a99('0x2')]},'remoteUri':{'type':Sequelize[_0x0a99('0x2')]},'tenantId':{'type':Sequelize[_0x0a99('0x2')]},'clientId':{'type':Sequelize[_0x0a99('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x0a99('0x2')]},'modernAuthentication':{'type':Sequelize[_0x0a99('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x4006=['STRING','exports'];(function(_0x518e84,_0x1f9c75){var _0x344317=function(_0x538c93){while(--_0x538c93){_0x518e84['push'](_0x518e84['shift']());}};_0x344317(++_0x1f9c75);}(_0x4006,0x1c7));var _0x6400=function(_0x17c7ba,_0x277e7e){_0x17c7ba=_0x17c7ba-0x0;var _0x2b1115=_0x4006[_0x17c7ba];return _0x2b1115;};'use strict';var Sequelize=require('sequelize');module[_0x6400('0x0')]={'name':{'type':Sequelize[_0x6400('0x1')]},'username':{'type':Sequelize[_0x6400('0x1')]},'password':{'type':Sequelize[_0x6400('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x6400('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6400('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 29db4a5..ff1b5da 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 _0x261a=['VIRTUAL','options','includeAll','include','findAll','catch','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','Dynamics365Configuration','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','ticketType','incident','Incident','PhoneCall','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolvebykpiidname','responseby','sentimentvalue','slainvokedidname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','modernAuthentication','CloudProvider','data5','data7','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','MetadataId','EntityDefinitions(','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','statusCode','test','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','UserLocalizedLabel','Value','DisplayName','Label',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption',')/Attributes(',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','undefined','limit','count','offset','set','Content-Range','json','update','destroy','then','end','sendStatus','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x2fbb09,_0x58c788){var _0x13cb69=function(_0x5231c3){while(--_0x5231c3){_0x2fbb09['push'](_0x2fbb09['shift']());}};_0x13cb69(++_0x58c788);}(_0x261a,0x14a));var _0xa261=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x261a[_0x321bb2];return _0x9c12ed;};'use strict';var rp=require(_0xa261('0x0'));var util=require(_0xa261('0x1'));var _=require(_0xa261('0x2'));var qs=require(_0xa261('0x3'));var logger=require(_0xa261('0x4'))(_0xa261('0x5'));var db=require(_0xa261('0x6'))['db'];var integrations=require(_0xa261('0x7'));function respondWithResult(_0x3610b6,_0x2ed198){_0x2ed198=_0x2ed198||0xc8;return function(_0x3f5cf0){if(_0x3f5cf0){return _0x3610b6[_0xa261('0x8')](_0x2ed198)['json'](_0x3f5cf0);}};}function respondWithFilteredResult(_0x46fb6b,_0x3b5792){return function(_0x110c9f){if(_0x110c9f){var _0x1d02e1=typeof _0x3b5792['offset']===_0xa261('0x9')&&typeof _0x3b5792[_0xa261('0xa')]===_0xa261('0x9');var _0x2dc62a=_0x110c9f[_0xa261('0xb')];var _0xf3823d=_0x1d02e1?0x0:_0x3b5792[_0xa261('0xc')];var _0x372f25=_0x1d02e1?_0x110c9f[_0xa261('0xb')]:_0x3b5792['offset']+_0x3b5792[_0xa261('0xa')];var _0x329763;if(_0x372f25>=_0x2dc62a){_0x372f25=_0x2dc62a;_0x329763=0xc8;}else{_0x329763=0xce;}_0x46fb6b[_0xa261('0x8')](_0x329763);return _0x46fb6b[_0xa261('0xd')](_0xa261('0xe'),_0xf3823d+'-'+_0x372f25+'/'+_0x2dc62a)[_0xa261('0xf')](_0x110c9f);}return null;};}function saveUpdates(_0x1e552c){return function(_0x56a10b){if(_0x56a10b){return _0x56a10b[_0xa261('0x10')](_0x1e552c)['then'](function(_0x4314e5){return _0x4314e5;});}return null;};}function removeEntity(_0x22222a){return function(_0x4929d4){if(_0x4929d4){return _0x4929d4[_0xa261('0x11')]()[_0xa261('0x12')](function(){_0x22222a[_0xa261('0x8')](0xcc)[_0xa261('0x13')]();});}};}function handleEntityNotFound(_0xad901f){return function(_0x2ffdb2){if(!_0x2ffdb2){_0xad901f[_0xa261('0x14')](0x194);}return _0x2ffdb2;};}function handleError(_0x3d8130,_0x51956f){_0x51956f=_0x51956f||0x1f4;return function(_0x13ab6e){logger[_0xa261('0x15')](_0x13ab6e[_0xa261('0x16')]);if(_0x13ab6e['name']){delete _0x13ab6e[_0xa261('0x17')];}_0x3d8130[_0xa261('0x8')](_0x51956f)[_0xa261('0x18')](_0x13ab6e);};}exports[_0xa261('0x19')]=function(_0x80c288,_0x3eaa79){var _0x5ba9ad={},_0x6e08e={},_0x24ef7b={'count':0x0,'rows':[]};var _0x27b367=_[_0xa261('0x1a')](db[_0xa261('0x1b')][_0xa261('0x1c')],function(_0x17b70e){return{'name':_0x17b70e['fieldName'],'type':_0x17b70e[_0xa261('0x1d')]['key']};});_0x6e08e['model']=_['map'](_0x27b367,_0xa261('0x17'));_0x6e08e['query']=_[_0xa261('0x1e')](_0x80c288[_0xa261('0x1f')]);_0x6e08e[_0xa261('0x20')]=_['intersection'](_0x6e08e[_0xa261('0x21')],_0x6e08e[_0xa261('0x1f')]);_0x5ba9ad[_0xa261('0x22')]=_[_0xa261('0x23')](_0x6e08e['model'],qs[_0xa261('0x24')](_0x80c288[_0xa261('0x1f')][_0xa261('0x24')]));_0x5ba9ad[_0xa261('0x22')]=_0x5ba9ad[_0xa261('0x22')][_0xa261('0x25')]?_0x5ba9ad[_0xa261('0x22')]:_0x6e08e[_0xa261('0x21')];if(!_0x80c288['query'][_0xa261('0x26')](_0xa261('0x27'))){_0x5ba9ad[_0xa261('0xa')]=qs[_0xa261('0xa')](_0x80c288[_0xa261('0x1f')]['limit']);_0x5ba9ad[_0xa261('0xc')]=qs[_0xa261('0xc')](_0x80c288[_0xa261('0x1f')]['offset']);}_0x5ba9ad[_0xa261('0x28')]=qs[_0xa261('0x29')](_0x80c288[_0xa261('0x1f')][_0xa261('0x29')]);_0x5ba9ad[_0xa261('0x2a')]=qs['filters'](_[_0xa261('0x2b')](_0x80c288[_0xa261('0x1f')],_0x6e08e[_0xa261('0x20')]),_0x27b367);if(_0x80c288['query'][_0xa261('0x2c')]){_0x5ba9ad[_0xa261('0x2a')]=_[_0xa261('0x2d')](_0x5ba9ad['where'],{'$or':_[_0xa261('0x1a')](_0x27b367,function(_0x1bb2b3){if(_0x1bb2b3[_0xa261('0x1d')]!==_0xa261('0x2e')){var _0x26d5d8={};_0x26d5d8[_0x1bb2b3[_0xa261('0x17')]]={'$like':'%'+_0x80c288[_0xa261('0x1f')][_0xa261('0x2c')]+'%'};return _0x26d5d8;}})});}_0x5ba9ad=_['merge']({},_0x5ba9ad,_0x80c288[_0xa261('0x2f')]);var _0x4ae35d={'where':_0x5ba9ad['where']};return db[_0xa261('0x1b')][_0xa261('0xb')](_0x4ae35d)[_0xa261('0x12')](function(_0x5433f8){_0x24ef7b[_0xa261('0xb')]=_0x5433f8;if(_0x80c288['query'][_0xa261('0x30')]){_0x5ba9ad[_0xa261('0x31')]=[{'all':!![]}];}return db[_0xa261('0x1b')][_0xa261('0x32')](_0x5ba9ad);})['then'](function(_0x3a2608){_0x24ef7b['rows']=_0x3a2608;return _0x24ef7b;})['then'](respondWithFilteredResult(_0x3eaa79,_0x5ba9ad))[_0xa261('0x33')](handleError(_0x3eaa79,null));};exports['show']=function(_0x111e94,_0x17fe11){var _0x1ffe8e={'raw':![],'where':{'id':_0x111e94['params']['id']}},_0x16b720={};_0x16b720[_0xa261('0x21')]=_[_0xa261('0x1e')](db[_0xa261('0x1b')][_0xa261('0x1c')]);_0x16b720[_0xa261('0x1f')]=_['keys'](_0x111e94['query']);_0x16b720[_0xa261('0x20')]=_[_0xa261('0x23')](_0x16b720[_0xa261('0x21')],_0x16b720['query']);_0x1ffe8e['attributes']=_[_0xa261('0x23')](_0x16b720[_0xa261('0x21')],qs[_0xa261('0x24')](_0x111e94['query'][_0xa261('0x24')]));_0x1ffe8e[_0xa261('0x22')]=_0x1ffe8e[_0xa261('0x22')][_0xa261('0x25')]?_0x1ffe8e['attributes']:_0x16b720[_0xa261('0x21')];if(_0x111e94[_0xa261('0x1f')]['includeAll']){_0x1ffe8e[_0xa261('0x31')]=[{'all':!![]}];}_0x1ffe8e=_[_0xa261('0x2d')]({},_0x1ffe8e,_0x111e94[_0xa261('0x2f')]);return db[_0xa261('0x1b')][_0xa261('0x34')](_0x1ffe8e)[_0xa261('0x12')](handleEntityNotFound(_0x17fe11,null))['then'](respondWithResult(_0x17fe11,null))[_0xa261('0x33')](handleError(_0x17fe11,null));};exports['create']=function(_0x44b2c1,_0xcc61ca){return db['Dynamics365Account'][_0xa261('0x35')](_0x44b2c1[_0xa261('0x36')],{})[_0xa261('0x12')](respondWithResult(_0xcc61ca,0xc9))[_0xa261('0x33')](handleError(_0xcc61ca,null));};exports[_0xa261('0x10')]=function(_0x3c31e3,_0x4c3905){if(_0x3c31e3[_0xa261('0x36')]['id']){delete _0x3c31e3[_0xa261('0x36')]['id'];}return db[_0xa261('0x1b')][_0xa261('0x34')]({'where':{'id':_0x3c31e3[_0xa261('0x37')]['id']}})[_0xa261('0x12')](handleEntityNotFound(_0x4c3905,null))[_0xa261('0x12')](saveUpdates(_0x3c31e3['body'],null))['then'](respondWithResult(_0x4c3905,null))[_0xa261('0x33')](handleError(_0x4c3905,null));};exports[_0xa261('0x11')]=function(_0x392aad,_0x4c7cac){return db[_0xa261('0x1b')][_0xa261('0x34')]({'where':{'id':_0x392aad[_0xa261('0x37')]['id']}})['then'](handleEntityNotFound(_0x4c7cac,null))[_0xa261('0x12')](removeEntity(_0x4c7cac,null))[_0xa261('0x33')](handleError(_0x4c7cac,null));};exports[_0xa261('0x38')]=function(_0x202230,_0x102803){var _0x20c3be={};var _0x2eec75={};var _0x4406ac;var _0x5d5643;return db['Dynamics365Account'][_0xa261('0x39')]({'where':{'id':_0x202230['params']['id']}})[_0xa261('0x12')](handleEntityNotFound(_0x102803,null))[_0xa261('0x12')](function(_0x513d3a){if(_0x513d3a){_0x4406ac=_0x513d3a;_0x2eec75['model']=_['keys'](db['Dynamics365Configuration'][_0xa261('0x1c')]);_0x2eec75[_0xa261('0x1f')]=_[_0xa261('0x1e')](_0x202230[_0xa261('0x1f')]);_0x2eec75[_0xa261('0x20')]=_[_0xa261('0x23')](_0x2eec75['model'],_0x2eec75['query']);_0x20c3be[_0xa261('0x22')]=_[_0xa261('0x23')](_0x2eec75[_0xa261('0x21')],qs[_0xa261('0x24')](_0x202230[_0xa261('0x1f')][_0xa261('0x24')]));_0x20c3be[_0xa261('0x22')]=_0x20c3be['attributes']['length']?_0x20c3be[_0xa261('0x22')]:_0x2eec75[_0xa261('0x21')];_0x20c3be[_0xa261('0x28')]=qs[_0xa261('0x29')](_0x202230[_0xa261('0x1f')][_0xa261('0x29')]);_0x20c3be[_0xa261('0x2a')]=qs[_0xa261('0x20')](_[_0xa261('0x2b')](_0x202230[_0xa261('0x1f')],_0x2eec75[_0xa261('0x20')]));if(_0x202230['query'][_0xa261('0x2c')]){_0x20c3be[_0xa261('0x2a')]=_['merge'](_0x20c3be[_0xa261('0x2a')],{'$or':_[_0xa261('0x1a')](_0x20c3be[_0xa261('0x22')],function(_0x57bbc1){var _0x4efaba={};_0x4efaba[_0x57bbc1]={'$like':'%'+_0x202230[_0xa261('0x1f')][_0xa261('0x2c')]+'%'};return _0x4efaba;})});}_0x20c3be=_[_0xa261('0x2d')]({},_0x20c3be,_0x202230['options']);return _0x4406ac['getConfigurations'](_0x20c3be);}})[_0xa261('0x12')](function(_0x3bdcf0){if(_0x3bdcf0){_0x5d5643=_0x3bdcf0[_0xa261('0x25')];if(!_0x202230[_0xa261('0x1f')][_0xa261('0x26')](_0xa261('0x27'))){_0x20c3be[_0xa261('0xa')]=qs[_0xa261('0xa')](_0x202230[_0xa261('0x1f')][_0xa261('0xa')]);_0x20c3be[_0xa261('0xc')]=qs['offset'](_0x202230[_0xa261('0x1f')][_0xa261('0xc')]);}return _0x4406ac['getConfigurations'](_0x20c3be);}})['then'](function(_0x1b27c5){if(_0x1b27c5){return _0x1b27c5?{'count':_0x5d5643,'rows':_0x1b27c5}:null;}})[_0xa261('0x12')](respondWithResult(_0x102803,null))[_0xa261('0x33')](handleError(_0x102803,null));};exports[_0xa261('0x3a')]=function(_0x599d7c,_0x207703){if(_0x599d7c[_0xa261('0x36')]['id']){delete _0x599d7c[_0xa261('0x36')]['id'];}return db[_0xa261('0x1b')][_0xa261('0x39')]({'where':{'id':_0x599d7c[_0xa261('0x37')]['id']}})[_0xa261('0x12')](handleEntityNotFound(_0x207703,null))[_0xa261('0x12')](function(_0x42e00a){if(_0x42e00a){_0x599d7c['body'][_0xa261('0x3b')]=_0x42e00a['id'];_0x599d7c[_0xa261('0x36')][_0xa261('0x3c')]=integrations[_0xa261('0x3d')](_0x599d7c[_0xa261('0x36')][_0xa261('0x3e')],_0x599d7c[_0xa261('0x36')][_0xa261('0x1d')]);_0x599d7c[_0xa261('0x36')][_0xa261('0x3f')]=integrations['getDescriptions'](_0x599d7c[_0xa261('0x36')][_0xa261('0x3e')],_0x599d7c[_0xa261('0x36')][_0xa261('0x1d')]);return db[_0xa261('0x40')][_0xa261('0x35')](_0x599d7c['body'],{'include':[{'model':db[_0xa261('0x41')],'as':_0xa261('0x3c')},{'model':db[_0xa261('0x41')],'as':'Descriptions'}]});}return null;})[_0xa261('0x12')](respondWithResult(_0x207703,null))[_0xa261('0x33')](handleError(_0x207703,null));};function sanitizeRemoteUri(_0xb358ba){var _0x56b54c=_0xb358ba[_0xa261('0x42')](-0x1);if(_0x56b54c==='/')return _0xb358ba[_0xa261('0x43')](0x0,_0xb358ba[_0xa261('0x44')](_0x56b54c));return _0xb358ba;}function getWebApiUrl(_0x86d6d6){return util['format'](_0xa261('0x45'),_0x86d6d6);}exports['getFields']=function(_0x5056ca,_0x39310d){var _0x2cc198=_0x5056ca['query'][_0xa261('0x46')];var _0x47281c=_0x2cc198===_0xa261('0x47')?_0xa261('0x48'):_0xa261('0x49');var _0x3adc1a='';var _0x1544c5='';var _0x2a3976='';var _0x16ec90='';var _0xbff2='';var _0x51b648='';var _0x95c3d='';var _0x5e445f='';var _0x432d33=['title',_0xa261('0x4a'),_0xa261('0x4b'),'ownerid',_0xa261('0x4c'),_0xa261('0x4d'),'phonenumber',_0xa261('0x4e'),_0xa261('0x4f'),_0xa261('0x50')];var _0x58c150=[_0xa261('0x51'),_0xa261('0x52'),'actualserviceunits','billedserviceunits',_0xa261('0x53'),'contactidyominame',_0xa261('0x54'),_0xa261('0x55'),_0xa261('0x56'),_0xa261('0x57'),_0xa261('0x58'),_0xa261('0x59'),_0xa261('0x5a'),_0xa261('0x5b'),_0xa261('0x5c'),_0xa261('0x5d'),_0xa261('0x5e'),_0xa261('0x5f'),_0xa261('0x60'),_0xa261('0x61'),_0xa261('0x62'),'entityimage_url',_0xa261('0x63'),_0xa261('0x64'),_0xa261('0x65'),'followupby',_0xa261('0x66'),_0xa261('0x67'),_0xa261('0x68'),'lastonholdtime',_0xa261('0x69'),_0xa261('0x6a'),_0xa261('0x6b'),_0xa261('0x6c'),_0xa261('0x6d'),_0xa261('0x6e'),_0xa261('0x6f'),_0xa261('0x70'),_0xa261('0x71'),_0xa261('0x72'),_0xa261('0x73'),_0xa261('0x74'),'overriddencreatedon',_0xa261('0x75'),_0xa261('0x76'),'owneridyominame','parentcaseidname',_0xa261('0x77'),_0xa261('0x78'),_0xa261('0x79'),_0xa261('0x7a'),'productserialnumber','resolveby',_0xa261('0x7b'),_0xa261('0x7c'),'responsiblecontactidname','responsiblecontactidyominame',_0xa261('0x7d'),_0xa261('0x7e'),'slaname',_0xa261('0x7f'),_0xa261('0x80'),_0xa261('0x81'),'subjectidname','ticketnumber',_0xa261('0x82'),_0xa261('0x83'),_0xa261('0x84'),_0xa261('0x85'),_0xa261('0x86')];var _0x3349e5=_0x432d33[_0xa261('0x87')](_0x58c150);return db[_0xa261('0x1b')][_0xa261('0x39')]({'where':{'id':_0x5056ca['params']['id']},'attributes':['id',_0xa261('0x88'),_0xa261('0x89'),_0xa261('0x8a'),_0xa261('0x8b'),_0xa261('0x8c'),_0xa261('0x8d'),_0xa261('0x8e')],'include':[{'model':db[_0xa261('0x8f')],'as':_0xa261('0x8f'),'attributes':['id',_0xa261('0x90'),_0xa261('0x91')]}]})['then'](handleEntityNotFound(_0x39310d,null))[_0xa261('0x12')](function(_0x1d556d){if(_0x1d556d){if(_0x1d556d[_0xa261('0x8e')]){_0x1d556d['access_token']=_0x1d556d[_0xa261('0x8f')]['data5'];_0x5e445f=sanitizeRemoteUri(_0x1d556d['CloudProvider'][_0xa261('0x91')]);_0x95c3d=getWebApiUrl(_0x5e445f);return _0x1d556d;}_0x5e445f=sanitizeRemoteUri(_0x1d556d[_0xa261('0x8a')]);_0x95c3d=getWebApiUrl(_0x5e445f);var _0x1ade3f={'method':_0xa261('0x92'),'uri':_0xa261('0x93')+_0x1d556d['tenantId']+_0xa261('0x94'),'form':{'client_id':_0x1d556d[_0xa261('0x8c')],'resource':_0x5e445f,'username':_0x1d556d[_0xa261('0x88')],'password':_0x1d556d[_0xa261('0x89')],'grant_type':_0xa261('0x89'),'client_secret':_0x1d556d[_0xa261('0x8d')]},'json':!![]};return rp(_0x1ade3f);}})[_0xa261('0x12')](function(_0x44c038){_0x51b648=_0x44c038[_0xa261('0x95')];var _0x16540d={'method':_0xa261('0x96'),'uri':encodeURI(_0x95c3d+_0xa261('0x97')+_0x47281c+'\x27'),'headers':{'Authorization':_0xa261('0x98')+_0x51b648,'If-None-Match':null,'OData-Version':_0xa261('0x99')},'json':!![]};return rp(_0x16540d);})[_0xa261('0x12')](function(_0x2164cb){var _0x563023=_0x2164cb['value'][0x0];var _0x2ed502=_0x563023[_0xa261('0x9a')];var _0x553381={'method':_0xa261('0x96'),'uri':_0x95c3d+_0xa261('0x9b')+_0x2ed502+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xa261('0x98')+_0x51b648,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x553381);})[_0xa261('0x12')](function(_0x52217a){_0x3adc1a=_0x52217a;_0x1544c5=_0x3adc1a['Attributes'];_0x1544c5=_[_0xa261('0x9c')](_0x1544c5,function(_0x4e7a67){return!_0x3349e5['includes'](_0x4e7a67[_0xa261('0x9d')]);});var _0x9746ea=[];var _0x522656=[];_0x1544c5[_0xa261('0x9e')](function(_0x105086){if(_0x105086[_0xa261('0x9f')]){var _0x1e4eea=_0x105086[_0xa261('0x9f')][_0xa261('0x43')](_0x105086[_0xa261('0x9f')][_0xa261('0x44')]('.')+0x1);if(_0x1e4eea===_0xa261('0xa0')){_0x9746ea[_0xa261('0xa1')](getSelectList(_0x95c3d,_0x2cc198,_0x522656,_0x3adc1a[_0xa261('0x9a')],_0x105086[_0xa261('0x9a')],_0x51b648));}}});return Promise[_0xa261('0xa2')](_0x9746ea);})[_0xa261('0x12')](function(_0x4fe948){_0x2a3976=_0x4fe948[0x0];var _0x46ebdb=[];var _0x393ca2=[];_0x1544c5[_0xa261('0x9e')](function(_0x5512bb){if(!_[_0xa261('0xa3')](_0x5512bb[_0xa261('0x9f')])){var _0x15d386=_0x5512bb[_0xa261('0x9f')][_0xa261('0x43')](_0x5512bb['@odata.type'][_0xa261('0x44')]('.')+0x1);if(_0x15d386==='BooleanAttributeMetadata'){_0x46ebdb[_0xa261('0xa1')](getBooleanList(_0x95c3d,_0x2cc198,_0x393ca2,_0x3adc1a[_0xa261('0x9a')],_0x5512bb[_0xa261('0x9a')],_0x51b648));}}});return Promise['all'](_0x46ebdb);})['then'](function(_0x431d2f){_0x16ec90=_0x431d2f[0x0];var _0x1c76b0=[];var _0x4878e6=[];_0x1544c5[_0xa261('0x9e')](function(_0x1e80c3){if(_0x1e80c3[_0xa261('0x9f')]){var _0x217197=_0x1e80c3[_0xa261('0x9f')]['substring'](_0x1e80c3[_0xa261('0x9f')][_0xa261('0x44')]('.')+0x1);if(_0x217197===_0xa261('0xa4')||_0x217197===_0xa261('0xa5')||_0x217197===_0xa261('0xa6')||_0x217197===_0xa261('0xa7')||_0x217197===_0xa261('0xa8')||_0x217197==='DateTimeAttributeMetadata'||_0x217197===_0xa261('0xa9')||_0x217197===_0xa261('0xaa')||_0x217197==='StateAttributeMetadata'||_0x217197===_0xa261('0xab')){_0x1c76b0['push'](getInputList(_0x95c3d,_0x2cc198,_0x217197,_0x4878e6,_0x3adc1a[_0xa261('0x9a')],_0x1e80c3['MetadataId'],_0x51b648));}}});return Promise[_0xa261('0xa2')](_0x1c76b0);})[_0xa261('0x12')](function(_0x2ca1d0){_0xbff2=_0x2ca1d0[0x0];var _0x4bc398=_0x2a3976[_0xa261('0x87')](_0x16ec90)[_0xa261('0x87')](_0xbff2);var _0x2ca071={'count':_0x4bc398[_0xa261('0x25')],'rows':_0x4bc398};return _0x2ca071;})[_0xa261('0x12')](respondWithResult(_0x39310d,null))[_0xa261('0x33')](function(_0x428fab){var _0x2149f2=_0x5056ca[_0xa261('0x1f')]['test']?0x1f4:_0x428fab[_0xa261('0xac')]||0x1f4;logger[_0xa261('0x15')](_0x428fab[_0xa261('0x16')]);delete _0x428fab[_0xa261('0x17')];if(_0x2149f2===0x191){_0x2149f2=0x190;}_0x39310d[_0xa261('0x8')](_0x2149f2)[_0xa261('0x18')](_0x5056ca[_0xa261('0x1f')][_0xa261('0xad')]?{'message':_0xa261('0xae'),'statusCode':_0x428fab[_0xa261('0xac')]}:_0x428fab);});};function getSelectList(_0x296a1a,_0x4f8b28,_0x57e233,_0x344a03,_0xabac49,_0x5dbf8b){var _0x55b6e8={'method':'GET','uri':_0x296a1a+_0xa261('0x9b')+_0x344a03+')/Attributes('+_0xabac49+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xa261('0xaf'),'headers':{'Authorization':_0xa261('0x98')+_0x5dbf8b,'If-None-Match':null,'OData-Version':_0xa261('0x99')},'json':!![]};return rp(_0x55b6e8)[_0xa261('0x12')](function(_0xac20fc){var _0x2dda13=[];var _0x53f0ee=_0xac20fc[_0xa261('0xb0')][_0xa261('0xb1')];_0x53f0ee[_0xa261('0x9e')](function(_0x534802){_0x2dda13[_0xa261('0xa1')]({'name':_0x534802['Label'][_0xa261('0xb2')]['Label'],'value':String(_0x534802[_0xa261('0xb3')])});});var _0x50f238={'id':_0x4f8b28+'_'+_0xac20fc[_0xa261('0x9d')],'name':_0xac20fc[_0xa261('0xb4')]['UserLocalizedLabel'][_0xa261('0xb5')],'custom':![],'options':_0x2dda13};_0x57e233[_0xa261('0xa1')](_0x50f238);return _0x57e233;});}function getBooleanList(_0x330ddb,_0x1cf7e5,_0x101fb9,_0x586f0e,_0xac9049,_0x647593){var _0x53630d={'method':_0xa261('0x96'),'uri':_0x330ddb+_0xa261('0x9b')+_0x586f0e+')/Attributes('+_0xac9049+_0xa261('0xb6'),'headers':{'Authorization':_0xa261('0x98')+_0x647593,'If-None-Match':null,'OData-Version':_0xa261('0x99')},'json':!![]};return rp(_0x53630d)[_0xa261('0x12')](function(_0x402c25){var _0x5020db=[];_0x5020db[_0xa261('0xa1')]({'name':_0x402c25[_0xa261('0xb0')]['TrueOption']['Label'][_0xa261('0xb2')][_0xa261('0xb5')],'value':_0xa261('0xb7')},{'name':_0x402c25[_0xa261('0xb0')][_0xa261('0xb8')]['Label'][_0xa261('0xb2')][_0xa261('0xb5')],'value':'false'});var _0x2c3118={'id':_0x1cf7e5+'_'+_0x402c25[_0xa261('0x9d')],'name':_0x402c25[_0xa261('0xb4')]['UserLocalizedLabel'][_0xa261('0xb5')],'custom':![],'options':_0x5020db};_0x101fb9[_0xa261('0xa1')](_0x2c3118);return _0x101fb9;});}function getInputList(_0x44901f,_0xf5ea1c,_0x3059a6,_0x999ebb,_0x21eb5e,_0x14e228,_0x1338aa){var _0x1fffd4={'method':'GET','uri':_0x44901f+_0xa261('0x9b')+_0x21eb5e+_0xa261('0xb9')+_0x14e228+_0xa261('0xba')+_0x3059a6+_0xa261('0xbb'),'headers':{'Authorization':_0xa261('0x98')+_0x1338aa,'If-None-Match':null,'OData-Version':_0xa261('0x99')},'json':!![]};return rp(_0x1fffd4)[_0xa261('0x12')](function(_0x25a2bf){var _0x3f2758={'id':_0xf5ea1c+'_'+_0x25a2bf[_0xa261('0x9d')],'name':_0x25a2bf['DisplayName'][_0xa261('0xb2')]?_0x25a2bf[_0xa261('0xb4')]['UserLocalizedLabel']['Label']:_0x25a2bf[_0xa261('0x9d')],'custom':![],'options':[]};_0x999ebb[_0xa261('0xa1')](_0x3f2758);return _0x999ebb;});} \ No newline at end of file +var _0xc64f=['customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','username','password','remoteUri','tenantId','clientSecret','modernAuthentication','CloudProvider','data7','access_token','data5','https://login.microsoftonline.com/','clientId','GET','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','all','isNil','BooleanAttributeMetadata','push','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','concat','test','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Bearer\x20','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel','TrueOption','true','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','Content-Range','update','then','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','count','findAll','catch','show','params','fields','include','find','create','body','destroy','getConfigurations','findOne','Dynamics365Configuration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','substring','lastIndexOf','format','getFields','ticketType','incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyname'];(function(_0x4095a2,_0x2b6e8c){var _0x1fb1a5=function(_0x52ff3c){while(--_0x52ff3c){_0x4095a2['push'](_0x4095a2['shift']());}};_0x1fb1a5(++_0x2b6e8c);}(_0xc64f,0x11e));var _0xfc64=function(_0x5607f3,_0x5e2ceb){_0x5607f3=_0x5607f3-0x0;var _0x5d5f04=_0xc64f[_0x5607f3];return _0x5d5f04;};'use strict';var rp=require('request-promise');var util=require(_0xfc64('0x0'));var _=require(_0xfc64('0x1'));var qs=require(_0xfc64('0x2'));var logger=require(_0xfc64('0x3'))(_0xfc64('0x4'));var db=require(_0xfc64('0x5'))['db'];var integrations=require(_0xfc64('0x6'));function respondWithResult(_0x51fbae,_0x3ac5a2){_0x3ac5a2=_0x3ac5a2||0xc8;return function(_0x2313dc){if(_0x2313dc){return _0x51fbae[_0xfc64('0x7')](_0x3ac5a2)[_0xfc64('0x8')](_0x2313dc);}};}function respondWithFilteredResult(_0x3589a8,_0x1675c2){return function(_0x57ab35){if(_0x57ab35){var _0xf0f96c=typeof _0x1675c2[_0xfc64('0x9')]==='undefined'&&typeof _0x1675c2['limit']===_0xfc64('0xa');var _0x475437=_0x57ab35['count'];var _0x202cac=_0xf0f96c?0x0:_0x1675c2[_0xfc64('0x9')];var _0xeab9c7=_0xf0f96c?_0x57ab35['count']:_0x1675c2[_0xfc64('0x9')]+_0x1675c2[_0xfc64('0xb')];var _0xfbc531;if(_0xeab9c7>=_0x475437){_0xeab9c7=_0x475437;_0xfbc531=0xc8;}else{_0xfbc531=0xce;}_0x3589a8[_0xfc64('0x7')](_0xfbc531);return _0x3589a8['set'](_0xfc64('0xc'),_0x202cac+'-'+_0xeab9c7+'/'+_0x475437)[_0xfc64('0x8')](_0x57ab35);}return null;};}function saveUpdates(_0x18cca7){return function(_0x46373a){if(_0x46373a){return _0x46373a[_0xfc64('0xd')](_0x18cca7)['then'](function(_0x2079be){return _0x2079be;});}return null;};}function removeEntity(_0x306fd6){return function(_0x5db626){if(_0x5db626){return _0x5db626['destroy']()[_0xfc64('0xe')](function(){_0x306fd6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e1865){return function(_0x20ccff){if(!_0x20ccff){_0x2e1865['sendStatus'](0x194);}return _0x20ccff;};}function handleError(_0x1b0f46,_0x4f992c){_0x4f992c=_0x4f992c||0x1f4;return function(_0x4df909){logger[_0xfc64('0xf')](_0x4df909[_0xfc64('0x10')]);if(_0x4df909[_0xfc64('0x11')]){delete _0x4df909[_0xfc64('0x11')];}_0x1b0f46[_0xfc64('0x7')](_0x4f992c)[_0xfc64('0x12')](_0x4df909);};}exports[_0xfc64('0x13')]=function(_0x14f825,_0x5b3f1e){var _0x2f2bbb={},_0x58ba3f={},_0x456ad5={'count':0x0,'rows':[]};var _0x132703=_[_0xfc64('0x14')](db[_0xfc64('0x15')][_0xfc64('0x16')],function(_0x33d073){return{'name':_0x33d073[_0xfc64('0x17')],'type':_0x33d073[_0xfc64('0x18')][_0xfc64('0x19')]};});_0x58ba3f[_0xfc64('0x1a')]=_[_0xfc64('0x14')](_0x132703,_0xfc64('0x11'));_0x58ba3f['query']=_[_0xfc64('0x1b')](_0x14f825[_0xfc64('0x1c')]);_0x58ba3f[_0xfc64('0x1d')]=_[_0xfc64('0x1e')](_0x58ba3f[_0xfc64('0x1a')],_0x58ba3f['query']);_0x2f2bbb['attributes']=_[_0xfc64('0x1e')](_0x58ba3f[_0xfc64('0x1a')],qs['fields'](_0x14f825[_0xfc64('0x1c')]['fields']));_0x2f2bbb['attributes']=_0x2f2bbb[_0xfc64('0x1f')][_0xfc64('0x20')]?_0x2f2bbb[_0xfc64('0x1f')]:_0x58ba3f['model'];if(!_0x14f825['query'][_0xfc64('0x21')](_0xfc64('0x22'))){_0x2f2bbb[_0xfc64('0xb')]=qs[_0xfc64('0xb')](_0x14f825[_0xfc64('0x1c')]['limit']);_0x2f2bbb[_0xfc64('0x9')]=qs[_0xfc64('0x9')](_0x14f825[_0xfc64('0x1c')][_0xfc64('0x9')]);}_0x2f2bbb[_0xfc64('0x23')]=qs[_0xfc64('0x24')](_0x14f825['query']['sort']);_0x2f2bbb[_0xfc64('0x25')]=qs['filters'](_['pick'](_0x14f825[_0xfc64('0x1c')],_0x58ba3f[_0xfc64('0x1d')]),_0x132703);if(_0x14f825[_0xfc64('0x1c')]['filter']){_0x2f2bbb['where']=_['merge'](_0x2f2bbb['where'],{'$or':_['map'](_0x132703,function(_0x5cab5e){if(_0x5cab5e[_0xfc64('0x18')]!==_0xfc64('0x26')){var _0x3449b2={};_0x3449b2[_0x5cab5e[_0xfc64('0x11')]]={'$like':'%'+_0x14f825[_0xfc64('0x1c')][_0xfc64('0x27')]+'%'};return _0x3449b2;}})});}_0x2f2bbb=_[_0xfc64('0x28')]({},_0x2f2bbb,_0x14f825[_0xfc64('0x29')]);var _0x2900c9={'where':_0x2f2bbb[_0xfc64('0x25')]};return db['Dynamics365Account'][_0xfc64('0x2a')](_0x2900c9)['then'](function(_0x40d79c){_0x456ad5[_0xfc64('0x2a')]=_0x40d79c;if(_0x14f825[_0xfc64('0x1c')]['includeAll']){_0x2f2bbb['include']=[{'all':!![]}];}return db[_0xfc64('0x15')][_0xfc64('0x2b')](_0x2f2bbb);})[_0xfc64('0xe')](function(_0x55bf25){_0x456ad5['rows']=_0x55bf25;return _0x456ad5;})[_0xfc64('0xe')](respondWithFilteredResult(_0x5b3f1e,_0x2f2bbb))[_0xfc64('0x2c')](handleError(_0x5b3f1e,null));};exports[_0xfc64('0x2d')]=function(_0x3e149d,_0x3975f6){var _0x18f989={'raw':![],'where':{'id':_0x3e149d[_0xfc64('0x2e')]['id']}},_0x56efac={};_0x56efac[_0xfc64('0x1a')]=_[_0xfc64('0x1b')](db['Dynamics365Account'][_0xfc64('0x16')]);_0x56efac['query']=_[_0xfc64('0x1b')](_0x3e149d[_0xfc64('0x1c')]);_0x56efac['filters']=_['intersection'](_0x56efac[_0xfc64('0x1a')],_0x56efac['query']);_0x18f989['attributes']=_['intersection'](_0x56efac[_0xfc64('0x1a')],qs[_0xfc64('0x2f')](_0x3e149d[_0xfc64('0x1c')][_0xfc64('0x2f')]));_0x18f989[_0xfc64('0x1f')]=_0x18f989['attributes'][_0xfc64('0x20')]?_0x18f989[_0xfc64('0x1f')]:_0x56efac['model'];if(_0x3e149d[_0xfc64('0x1c')]['includeAll']){_0x18f989[_0xfc64('0x30')]=[{'all':!![]}];}_0x18f989=_[_0xfc64('0x28')]({},_0x18f989,_0x3e149d[_0xfc64('0x29')]);return db[_0xfc64('0x15')][_0xfc64('0x31')](_0x18f989)['then'](handleEntityNotFound(_0x3975f6,null))[_0xfc64('0xe')](respondWithResult(_0x3975f6,null))[_0xfc64('0x2c')](handleError(_0x3975f6,null));};exports[_0xfc64('0x32')]=function(_0xbb4d15,_0x208ffe){return db['Dynamics365Account'][_0xfc64('0x32')](_0xbb4d15[_0xfc64('0x33')],{})[_0xfc64('0xe')](respondWithResult(_0x208ffe,0xc9))[_0xfc64('0x2c')](handleError(_0x208ffe,null));};exports[_0xfc64('0xd')]=function(_0x373377,_0x9fc9e8){if(_0x373377[_0xfc64('0x33')]['id']){delete _0x373377[_0xfc64('0x33')]['id'];}return db[_0xfc64('0x15')][_0xfc64('0x31')]({'where':{'id':_0x373377['params']['id']}})[_0xfc64('0xe')](handleEntityNotFound(_0x9fc9e8,null))['then'](saveUpdates(_0x373377[_0xfc64('0x33')],null))[_0xfc64('0xe')](respondWithResult(_0x9fc9e8,null))[_0xfc64('0x2c')](handleError(_0x9fc9e8,null));};exports[_0xfc64('0x34')]=function(_0x5cfb85,_0x5d95f4){return db[_0xfc64('0x15')]['find']({'where':{'id':_0x5cfb85['params']['id']}})['then'](handleEntityNotFound(_0x5d95f4,null))[_0xfc64('0xe')](removeEntity(_0x5d95f4,null))['catch'](handleError(_0x5d95f4,null));};exports[_0xfc64('0x35')]=function(_0x21e03a,_0x54b3ab){var _0x241433={};var _0x1e5df2={};var _0x32b0f7;var _0x5ef4ea;return db[_0xfc64('0x15')][_0xfc64('0x36')]({'where':{'id':_0x21e03a['params']['id']}})['then'](handleEntityNotFound(_0x54b3ab,null))[_0xfc64('0xe')](function(_0x517deb){if(_0x517deb){_0x32b0f7=_0x517deb;_0x1e5df2['model']=_[_0xfc64('0x1b')](db[_0xfc64('0x37')]['rawAttributes']);_0x1e5df2[_0xfc64('0x1c')]=_['keys'](_0x21e03a[_0xfc64('0x1c')]);_0x1e5df2[_0xfc64('0x1d')]=_[_0xfc64('0x1e')](_0x1e5df2[_0xfc64('0x1a')],_0x1e5df2[_0xfc64('0x1c')]);_0x241433[_0xfc64('0x1f')]=_['intersection'](_0x1e5df2[_0xfc64('0x1a')],qs[_0xfc64('0x2f')](_0x21e03a['query'][_0xfc64('0x2f')]));_0x241433[_0xfc64('0x1f')]=_0x241433[_0xfc64('0x1f')][_0xfc64('0x20')]?_0x241433[_0xfc64('0x1f')]:_0x1e5df2[_0xfc64('0x1a')];_0x241433['order']=qs[_0xfc64('0x24')](_0x21e03a[_0xfc64('0x1c')][_0xfc64('0x24')]);_0x241433['where']=qs['filters'](_['pick'](_0x21e03a[_0xfc64('0x1c')],_0x1e5df2[_0xfc64('0x1d')]));if(_0x21e03a[_0xfc64('0x1c')][_0xfc64('0x27')]){_0x241433[_0xfc64('0x25')]=_['merge'](_0x241433[_0xfc64('0x25')],{'$or':_[_0xfc64('0x14')](_0x241433[_0xfc64('0x1f')],function(_0x1327b0){var _0x4c737f={};_0x4c737f[_0x1327b0]={'$like':'%'+_0x21e03a[_0xfc64('0x1c')][_0xfc64('0x27')]+'%'};return _0x4c737f;})});}_0x241433=_[_0xfc64('0x28')]({},_0x241433,_0x21e03a['options']);return _0x32b0f7[_0xfc64('0x35')](_0x241433);}})[_0xfc64('0xe')](function(_0x10d422){if(_0x10d422){_0x5ef4ea=_0x10d422[_0xfc64('0x20')];if(!_0x21e03a[_0xfc64('0x1c')]['hasOwnProperty'](_0xfc64('0x22'))){_0x241433[_0xfc64('0xb')]=qs[_0xfc64('0xb')](_0x21e03a[_0xfc64('0x1c')]['limit']);_0x241433['offset']=qs[_0xfc64('0x9')](_0x21e03a['query']['offset']);}return _0x32b0f7[_0xfc64('0x35')](_0x241433);}})[_0xfc64('0xe')](function(_0x2079b6){if(_0x2079b6){return _0x2079b6?{'count':_0x5ef4ea,'rows':_0x2079b6}:null;}})[_0xfc64('0xe')](respondWithResult(_0x54b3ab,null))[_0xfc64('0x2c')](handleError(_0x54b3ab,null));};exports['addConfiguration']=function(_0x1c8d67,_0x47bbd6){if(_0x1c8d67[_0xfc64('0x33')]['id']){delete _0x1c8d67[_0xfc64('0x33')]['id'];}return db[_0xfc64('0x15')]['findOne']({'where':{'id':_0x1c8d67[_0xfc64('0x2e')]['id']}})[_0xfc64('0xe')](handleEntityNotFound(_0x47bbd6,null))['then'](function(_0x49c48){if(_0x49c48){_0x1c8d67[_0xfc64('0x33')][_0xfc64('0x38')]=_0x49c48['id'];_0x1c8d67[_0xfc64('0x33')][_0xfc64('0x39')]=integrations[_0xfc64('0x3a')](_0x1c8d67[_0xfc64('0x33')][_0xfc64('0x3b')],_0x1c8d67[_0xfc64('0x33')][_0xfc64('0x18')]);_0x1c8d67[_0xfc64('0x33')][_0xfc64('0x3c')]=integrations[_0xfc64('0x3d')](_0x1c8d67[_0xfc64('0x33')][_0xfc64('0x3b')],_0x1c8d67[_0xfc64('0x33')][_0xfc64('0x18')]);return db[_0xfc64('0x37')][_0xfc64('0x32')](_0x1c8d67[_0xfc64('0x33')],{'include':[{'model':db[_0xfc64('0x3e')],'as':_0xfc64('0x39')},{'model':db[_0xfc64('0x3e')],'as':_0xfc64('0x3c')}]});}return null;})[_0xfc64('0xe')](respondWithResult(_0x47bbd6,null))[_0xfc64('0x2c')](handleError(_0x47bbd6,null));};function sanitizeRemoteUri(_0xd403a9){var _0x4df6d2=_0xd403a9['slice'](-0x1);if(_0x4df6d2==='/')return _0xd403a9[_0xfc64('0x3f')](0x0,_0xd403a9[_0xfc64('0x40')](_0x4df6d2));return _0xd403a9;}function getWebApiUrl(_0x5cd30e){return util[_0xfc64('0x41')]('%s/api/data/v9.0/',_0x5cd30e);}exports[_0xfc64('0x42')]=function(_0x3cb091,_0x43a7b8){var _0x158a6d=_0x3cb091['query'][_0xfc64('0x43')];var _0x5bf1d7=_0x158a6d===_0xfc64('0x44')?'Incident':'PhoneCall';var _0x314cc4='';var _0x37fa79='';var _0x6c8370='';var _0x1685f2='';var _0x320afb='';var _0xae1189='';var _0x44d8e5='';var _0x561c11='';var _0x3f5b19=[_0xfc64('0x45'),_0xfc64('0x46'),_0xfc64('0x47'),_0xfc64('0x48'),_0xfc64('0x49'),_0xfc64('0x4a'),_0xfc64('0x4b'),_0xfc64('0x4c'),'directioncode','phonecall_activity_parties'];var _0x3469b2=[_0xfc64('0x4d'),_0xfc64('0x4e'),_0xfc64('0x4f'),_0xfc64('0x50'),_0xfc64('0x51'),'contactidyominame',_0xfc64('0x52'),_0xfc64('0x53'),_0xfc64('0x54'),_0xfc64('0x55'),_0xfc64('0x56'),_0xfc64('0x57'),_0xfc64('0x58'),_0xfc64('0x59'),'createdonbehalfbyyominame',_0xfc64('0x5a'),_0xfc64('0x5b'),_0xfc64('0x5c'),_0xfc64('0x5d'),_0xfc64('0x5e'),_0xfc64('0x5f'),_0xfc64('0x60'),_0xfc64('0x61'),'exchangerate',_0xfc64('0x62'),'followupby',_0xfc64('0x63'),_0xfc64('0x64'),_0xfc64('0x65'),_0xfc64('0x66'),'masteridname',_0xfc64('0x67'),'modifiedbyexternalpartyyominame',_0xfc64('0x68'),_0xfc64('0x69'),'modifiedon','modifiedonbehalfbyname',_0xfc64('0x6a'),_0xfc64('0x6b'),_0xfc64('0x6c'),_0xfc64('0x6d'),_0xfc64('0x6e'),_0xfc64('0x6f'),_0xfc64('0x70'),_0xfc64('0x71'),_0xfc64('0x72'),_0xfc64('0x73'),_0xfc64('0x74'),_0xfc64('0x75'),_0xfc64('0x76'),'productidname','productserialnumber','resolveby','resolvebykpiidname',_0xfc64('0x77'),_0xfc64('0x78'),_0xfc64('0x79'),_0xfc64('0x7a'),_0xfc64('0x7b'),_0xfc64('0x7c'),'socialprofileidname','statecode',_0xfc64('0x7d'),'subjectidname',_0xfc64('0x7e'),_0xfc64('0x7f'),_0xfc64('0x80'),_0xfc64('0x81'),_0xfc64('0x82'),_0xfc64('0x83')];var _0x5b224d=_0x3f5b19['concat'](_0x3469b2);return db[_0xfc64('0x15')][_0xfc64('0x36')]({'where':{'id':_0x3cb091[_0xfc64('0x2e')]['id']},'attributes':['id',_0xfc64('0x84'),_0xfc64('0x85'),_0xfc64('0x86'),_0xfc64('0x87'),'clientId',_0xfc64('0x88'),_0xfc64('0x89')],'include':[{'model':db[_0xfc64('0x8a')],'as':_0xfc64('0x8a'),'attributes':['id','data5',_0xfc64('0x8b')]}]})[_0xfc64('0xe')](handleEntityNotFound(_0x43a7b8,null))[_0xfc64('0xe')](function(_0x27cde2){if(_0x27cde2){if(_0x27cde2[_0xfc64('0x89')]){_0x27cde2[_0xfc64('0x8c')]=_0x27cde2[_0xfc64('0x8a')][_0xfc64('0x8d')];_0x561c11=sanitizeRemoteUri(_0x27cde2[_0xfc64('0x8a')][_0xfc64('0x8b')]);_0x44d8e5=getWebApiUrl(_0x561c11);return _0x27cde2;}_0x561c11=sanitizeRemoteUri(_0x27cde2[_0xfc64('0x86')]);_0x44d8e5=getWebApiUrl(_0x561c11);var _0x2cc1fb={'method':'POST','uri':_0xfc64('0x8e')+_0x27cde2[_0xfc64('0x87')]+'/oauth2/token','form':{'client_id':_0x27cde2[_0xfc64('0x8f')],'resource':_0x561c11,'username':_0x27cde2['username'],'password':_0x27cde2[_0xfc64('0x85')],'grant_type':_0xfc64('0x85'),'client_secret':_0x27cde2[_0xfc64('0x88')]},'json':!![]};return rp(_0x2cc1fb);}})[_0xfc64('0xe')](function(_0x193e03){_0xae1189=_0x193e03[_0xfc64('0x8c')];var _0xfc99d6={'method':_0xfc64('0x90'),'uri':encodeURI(_0x44d8e5+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x5bf1d7+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0xae1189,'If-None-Match':null,'OData-Version':_0xfc64('0x91')},'json':!![]};return rp(_0xfc99d6);})[_0xfc64('0xe')](function(_0xc76e1){var _0x58f659=_0xc76e1[_0xfc64('0x92')][0x0];var _0x4e5464=_0x58f659[_0xfc64('0x93')];var _0x50e2d7={'method':_0xfc64('0x90'),'uri':_0x44d8e5+_0xfc64('0x94')+_0x4e5464+_0xfc64('0x95'),'headers':{'Authorization':'Bearer\x20'+_0xae1189,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x50e2d7);})[_0xfc64('0xe')](function(_0x4b00ac){_0x314cc4=_0x4b00ac;_0x37fa79=_0x314cc4[_0xfc64('0x96')];_0x37fa79=_[_0xfc64('0x97')](_0x37fa79,function(_0x1f4f78){return!_0x5b224d['includes'](_0x1f4f78[_0xfc64('0x98')]);});var _0x315239=[];var _0x19a368=[];_0x37fa79[_0xfc64('0x99')](function(_0x5d6956){if(_0x5d6956[_0xfc64('0x9a')]){var _0x4553b6=_0x5d6956[_0xfc64('0x9a')][_0xfc64('0x3f')](_0x5d6956[_0xfc64('0x9a')]['lastIndexOf']('.')+0x1);if(_0x4553b6===_0xfc64('0x9b')){_0x315239['push'](getSelectList(_0x44d8e5,_0x158a6d,_0x19a368,_0x314cc4['MetadataId'],_0x5d6956['MetadataId'],_0xae1189));}}});return Promise[_0xfc64('0x9c')](_0x315239);})[_0xfc64('0xe')](function(_0x159757){_0x6c8370=_0x159757[0x0];var _0x479ce5=[];var _0x51b95d=[];_0x37fa79[_0xfc64('0x99')](function(_0x5dc5eb){if(!_[_0xfc64('0x9d')](_0x5dc5eb[_0xfc64('0x9a')])){var _0x152e14=_0x5dc5eb[_0xfc64('0x9a')][_0xfc64('0x3f')](_0x5dc5eb[_0xfc64('0x9a')][_0xfc64('0x40')]('.')+0x1);if(_0x152e14===_0xfc64('0x9e')){_0x479ce5[_0xfc64('0x9f')](getBooleanList(_0x44d8e5,_0x158a6d,_0x51b95d,_0x314cc4[_0xfc64('0x93')],_0x5dc5eb[_0xfc64('0x93')],_0xae1189));}}});return Promise[_0xfc64('0x9c')](_0x479ce5);})['then'](function(_0x18f2f3){_0x1685f2=_0x18f2f3[0x0];var _0x4673a9=[];var _0xc78496=[];_0x37fa79[_0xfc64('0x99')](function(_0x49a75d){if(_0x49a75d['@odata.type']){var _0x77a2d1=_0x49a75d[_0xfc64('0x9a')][_0xfc64('0x3f')](_0x49a75d['@odata.type'][_0xfc64('0x40')]('.')+0x1);if(_0x77a2d1==='StringAttributeMetadata'||_0x77a2d1===_0xfc64('0xa0')||_0x77a2d1===_0xfc64('0xa1')||_0x77a2d1===_0xfc64('0xa2')||_0x77a2d1===_0xfc64('0xa3')||_0x77a2d1===_0xfc64('0xa4')||_0x77a2d1===_0xfc64('0xa5')||_0x77a2d1===_0xfc64('0xa6')||_0x77a2d1===_0xfc64('0xa7')||_0x77a2d1===_0xfc64('0xa8')){_0x4673a9[_0xfc64('0x9f')](getInputList(_0x44d8e5,_0x158a6d,_0x77a2d1,_0xc78496,_0x314cc4[_0xfc64('0x93')],_0x49a75d['MetadataId'],_0xae1189));}}});return Promise[_0xfc64('0x9c')](_0x4673a9);})[_0xfc64('0xe')](function(_0x34668a){_0x320afb=_0x34668a[0x0];var _0x1612cb=_0x6c8370[_0xfc64('0xa9')](_0x1685f2)[_0xfc64('0xa9')](_0x320afb);var _0x46a2d1={'count':_0x1612cb[_0xfc64('0x20')],'rows':_0x1612cb};return _0x46a2d1;})[_0xfc64('0xe')](respondWithResult(_0x43a7b8,null))['catch'](function(_0x165e93){var _0x547547=_0x3cb091[_0xfc64('0x1c')][_0xfc64('0xaa')]?0x1f4:_0x165e93[_0xfc64('0xab')]||0x1f4;logger['error'](_0x165e93[_0xfc64('0x10')]);delete _0x165e93[_0xfc64('0x11')];if(_0x547547===0x191){_0x547547=0x190;}_0x43a7b8[_0xfc64('0x7')](_0x547547)['send'](_0x3cb091[_0xfc64('0x1c')][_0xfc64('0xaa')]?{'message':_0xfc64('0xac'),'statusCode':_0x165e93[_0xfc64('0xab')]}:_0x165e93);});};function getSelectList(_0x3effe3,_0x218b9f,_0x577c07,_0x13f546,_0x313ba4,_0x950c94){var _0x5acfb0={'method':_0xfc64('0x90'),'uri':_0x3effe3+'EntityDefinitions('+_0x13f546+_0xfc64('0xad')+_0x313ba4+_0xfc64('0xae')+_0xfc64('0xaf'),'headers':{'Authorization':_0xfc64('0xb0')+_0x950c94,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5acfb0)['then'](function(_0x2d0dae){var _0x387c0b=[];var _0x4b920e=_0x2d0dae[_0xfc64('0xb1')][_0xfc64('0xb2')];_0x4b920e[_0xfc64('0x99')](function(_0xadb804){_0x387c0b['push']({'name':_0xadb804[_0xfc64('0xb3')]['UserLocalizedLabel'][_0xfc64('0xb3')],'value':String(_0xadb804[_0xfc64('0xb4')])});});var _0xef945b={'id':_0x218b9f+'_'+_0x2d0dae[_0xfc64('0x98')],'name':_0x2d0dae[_0xfc64('0xb5')][_0xfc64('0xb6')][_0xfc64('0xb3')],'custom':![],'options':_0x387c0b};_0x577c07[_0xfc64('0x9f')](_0xef945b);return _0x577c07;});}function getBooleanList(_0x47e590,_0x20225b,_0x2d0da1,_0x196c68,_0x48aaf2,_0x3b6f57){var _0x52ba8f={'method':'GET','uri':_0x47e590+'EntityDefinitions('+_0x196c68+_0xfc64('0xad')+_0x48aaf2+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xfc64('0xb0')+_0x3b6f57,'If-None-Match':null,'OData-Version':_0xfc64('0x91')},'json':!![]};return rp(_0x52ba8f)[_0xfc64('0xe')](function(_0x141ead){var _0xc8c970=[];_0xc8c970[_0xfc64('0x9f')]({'name':_0x141ead[_0xfc64('0xb1')][_0xfc64('0xb7')]['Label'][_0xfc64('0xb6')][_0xfc64('0xb3')],'value':_0xfc64('0xb8')},{'name':_0x141ead[_0xfc64('0xb1')]['FalseOption'][_0xfc64('0xb3')][_0xfc64('0xb6')]['Label'],'value':_0xfc64('0xb9')});var _0x8637ca={'id':_0x20225b+'_'+_0x141ead[_0xfc64('0x98')],'name':_0x141ead[_0xfc64('0xb5')][_0xfc64('0xb6')]['Label'],'custom':![],'options':_0xc8c970};_0x2d0da1[_0xfc64('0x9f')](_0x8637ca);return _0x2d0da1;});}function getInputList(_0x391344,_0x23c707,_0x4b434a,_0x4e5b48,_0x3d4fa6,_0x17c13c,_0x188535){var _0xc690a6={'method':_0xfc64('0x90'),'uri':_0x391344+_0xfc64('0x94')+_0x3d4fa6+_0xfc64('0xad')+_0x17c13c+_0xfc64('0xba')+_0x4b434a+_0xfc64('0xbb'),'headers':{'Authorization':_0xfc64('0xb0')+_0x188535,'If-None-Match':null,'OData-Version':_0xfc64('0x91')},'json':!![]};return rp(_0xc690a6)['then'](function(_0x37d248){var _0x548431={'id':_0x23c707+'_'+_0x37d248[_0xfc64('0x98')],'name':_0x37d248[_0xfc64('0xb5')][_0xfc64('0xb6')]?_0x37d248['DisplayName'][_0xfc64('0xb6')][_0xfc64('0xb3')]:_0x37d248[_0xfc64('0x98')],'custom':![],'options':[]};_0x4e5b48[_0xfc64('0x9f')](_0x548431);return _0x4e5b48;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index a6666fe..81c405f 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./intDynamics365Account.attributes','../../components/integrations/configuration','Dynamics365Account','int_dynamics365_accounts','../../config/logger','api','moment','bluebird','path'];(function(_0x43def4,_0x49c62e){var _0x5d866b=function(_0x896e25){while(--_0x896e25){_0x43def4['push'](_0x43def4['shift']());}};_0x5d866b(++_0x49c62e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xcb91[_0x4b055c];return _0x4b62bb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));var integrations=require(_0x1cb9('0x7'));module['exports']=function(_0x226b69,_0x3f7deb){return _0x226b69['define'](_0x1cb9('0x8'),attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index c9499c5..c270cf5 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 _0x50a9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetDynamics365Account','Dynamics365Account','options','raw','limit','map','include','model','attributes','info','ShowDynamics365Account','where','lodash','util','moment'];(function(_0x48ae9d,_0x15dab5){var _0x18ca64=function(_0x5d36fa){while(--_0x5d36fa){_0x48ae9d['push'](_0x48ae9d['shift']());}};_0x18ca64(++_0x15dab5);}(_0x50a9,0x11d));var _0x950a=function(_0x73e746,_0x5311ad){_0x73e746=_0x73e746-0x0;var _0x31ce01=_0x50a9[_0x73e746];return _0x31ce01;};'use strict';var _=require(_0x950a('0x0'));var util=require(_0x950a('0x1'));var moment=require(_0x950a('0x2'));var BPromise=require(_0x950a('0x3'));var rs=require(_0x950a('0x4'));var fs=require('fs');var Redis=require(_0x950a('0x5'));var db=require(_0x950a('0x6'))['db'];var utils=require(_0x950a('0x7'));var logger=require(_0x950a('0x8'))(_0x950a('0x9'));var config=require(_0x950a('0xa'));var jayson=require(_0x950a('0xb'));var client=jayson[_0x950a('0xc')][_0x950a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xb78fa6,_0x190eb0,_0x5b2269){return new BPromise(function(_0x33b6dc,_0x21215b){return client['request'](_0xb78fa6,_0x5b2269)[_0x950a('0xe')](function(_0x53dfff){logger['info'](_0x950a('0xf'),_0x190eb0,_0x950a('0x10'));logger[_0x950a('0x11')](_0x950a('0x12'),_0x190eb0,_0x950a('0x10'),JSON[_0x950a('0x13')](_0x53dfff));if(_0x53dfff[_0x950a('0x14')]){if(_0x53dfff['error'][_0x950a('0x15')]===0x1f4){logger[_0x950a('0x14')](_0x950a('0xf'),_0x190eb0,_0x53dfff[_0x950a('0x14')][_0x950a('0x16')]);return _0x21215b(_0x53dfff['error'][_0x950a('0x16')]);}logger[_0x950a('0x14')](_0x950a('0xf'),_0x190eb0,_0x53dfff[_0x950a('0x14')][_0x950a('0x16')]);return _0x33b6dc(_0x53dfff[_0x950a('0x14')][_0x950a('0x16')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x190eb0,_0x950a('0x10'));_0x33b6dc(_0x53dfff['result'][_0x950a('0x16')]);}})[_0x950a('0x17')](function(_0x11a6cc){logger[_0x950a('0x14')](_0x950a('0xf'),_0x190eb0,_0x11a6cc);_0x21215b(_0x11a6cc);});});}exports[_0x950a('0x18')]=function(_0xfeca2b){var _0x1075d6=this;return new Promise(function(_0x12d5ad,_0x5c04b5){return db[_0x950a('0x19')]['findAll']({'raw':_0xfeca2b[_0x950a('0x1a')]?_0xfeca2b['options'][_0x950a('0x1b')]===undefined?!![]:![]:!![],'where':_0xfeca2b[_0x950a('0x1a')]?_0xfeca2b[_0x950a('0x1a')]['where']||null:null,'attributes':_0xfeca2b['options']?_0xfeca2b[_0x950a('0x1a')]['attributes']||null:null,'limit':_0xfeca2b['options']?_0xfeca2b['options'][_0x950a('0x1c')]||null:null,'include':_0xfeca2b[_0x950a('0x1a')]?_0xfeca2b[_0x950a('0x1a')]['include']?_[_0x950a('0x1d')](_0xfeca2b[_0x950a('0x1a')][_0x950a('0x1e')],function(_0x5e6393){return{'model':db[_0x5e6393['model']],'as':_0x5e6393['as'],'attributes':_0x5e6393['attributes'],'include':_0x5e6393['include']?_[_0x950a('0x1d')](_0x5e6393['include'],function(_0x16f0a2){return{'model':db[_0x16f0a2[_0x950a('0x1f')]],'as':_0x16f0a2['as'],'attributes':_0x16f0a2[_0x950a('0x20')],'include':_0x16f0a2[_0x950a('0x1e')]?_['map'](_0x16f0a2[_0x950a('0x1e')],function(_0x21a1c2){return{'model':db[_0x21a1c2[_0x950a('0x1f')]],'as':_0x21a1c2['as'],'attributes':_0x21a1c2[_0x950a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x950a('0xe')](function(_0x4e5c7e){logger[_0x950a('0x21')](_0x950a('0x18'),_0xfeca2b);logger['debug'](_0x950a('0x18'),_0xfeca2b,JSON[_0x950a('0x13')](_0x4e5c7e));_0x12d5ad(_0x4e5c7e);})['catch'](function(_0x1d29a3){logger[_0x950a('0x14')](_0x950a('0x18'),_0x1d29a3[_0x950a('0x16')],_0xfeca2b);_0x5c04b5(_0x1075d6[_0x950a('0x14')](0x1f4,_0x1d29a3[_0x950a('0x16')]));});});};exports[_0x950a('0x22')]=function(_0x39d211){var _0x373462=this;return new Promise(function(_0x1750b4,_0x5c4db1){return db['Dynamics365Account']['find']({'raw':_0x39d211[_0x950a('0x1a')]?_0x39d211[_0x950a('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x39d211[_0x950a('0x1a')]?_0x39d211[_0x950a('0x1a')][_0x950a('0x23')]||null:null,'attributes':_0x39d211[_0x950a('0x1a')]?_0x39d211['options'][_0x950a('0x20')]||null:null,'include':_0x39d211['options']?_0x39d211[_0x950a('0x1a')][_0x950a('0x1e')]?_[_0x950a('0x1d')](_0x39d211[_0x950a('0x1a')]['include'],function(_0x4b5e66){return{'model':db[_0x4b5e66[_0x950a('0x1f')]],'as':_0x4b5e66['as'],'attributes':_0x4b5e66[_0x950a('0x20')],'include':_0x4b5e66['include']?_[_0x950a('0x1d')](_0x4b5e66[_0x950a('0x1e')],function(_0x19f4a6){return{'model':db[_0x19f4a6[_0x950a('0x1f')]],'as':_0x19f4a6['as'],'attributes':_0x19f4a6[_0x950a('0x20')],'include':_0x19f4a6[_0x950a('0x1e')]?_[_0x950a('0x1d')](_0x19f4a6[_0x950a('0x1e')],function(_0x1aa12b){return{'model':db[_0x1aa12b[_0x950a('0x1f')]],'as':_0x1aa12b['as'],'attributes':_0x1aa12b[_0x950a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b559d){logger['info'](_0x950a('0x22'),_0x39d211);logger[_0x950a('0x11')](_0x950a('0x22'),_0x39d211,JSON[_0x950a('0x13')](_0x5b559d));_0x1750b4(_0x5b559d);})[_0x950a('0x17')](function(_0x5be1bc){logger['error'](_0x950a('0x22'),_0x5be1bc['message'],_0x39d211);_0x5c4db1(_0x373462[_0x950a('0x14')](0x1f4,_0x5be1bc[_0x950a('0x16')]));});});}; \ No newline at end of file +var _0x8017=['GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','map','include','model','catch','ShowDynamics365Account','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result'];(function(_0x4ed507,_0x5a4c79){var _0x285d74=function(_0x5f1084){while(--_0x5f1084){_0x4ed507['push'](_0x4ed507['shift']());}};_0x285d74(++_0x5a4c79);}(_0x8017,0x99));var _0x7801=function(_0x1bd323,_0x1c16ab){_0x1bd323=_0x1bd323-0x0;var _0x13097b=_0x8017[_0x1bd323];return _0x13097b;};'use strict';var _=require('lodash');var util=require(_0x7801('0x0'));var moment=require(_0x7801('0x1'));var BPromise=require(_0x7801('0x2'));var rs=require(_0x7801('0x3'));var fs=require('fs');var Redis=require(_0x7801('0x4'));var db=require(_0x7801('0x5'))['db'];var utils=require(_0x7801('0x6'));var logger=require('../../config/logger')(_0x7801('0x7'));var config=require(_0x7801('0x8'));var jayson=require(_0x7801('0x9'));var client=jayson[_0x7801('0xa')][_0x7801('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36552c,_0x29e707,_0x3495ae){return new BPromise(function(_0x7c32b3,_0x3654e2){return client[_0x7801('0xc')](_0x36552c,_0x3495ae)[_0x7801('0xd')](function(_0x3c57ce){logger[_0x7801('0xe')](_0x7801('0xf'),_0x29e707,_0x7801('0x10'));logger[_0x7801('0x11')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x29e707,_0x7801('0x10'),JSON[_0x7801('0x12')](_0x3c57ce));if(_0x3c57ce[_0x7801('0x13')]){if(_0x3c57ce['error']['code']===0x1f4){logger['error'](_0x7801('0xf'),_0x29e707,_0x3c57ce[_0x7801('0x13')]['message']);return _0x3654e2(_0x3c57ce[_0x7801('0x13')][_0x7801('0x14')]);}logger[_0x7801('0x13')](_0x7801('0xf'),_0x29e707,_0x3c57ce['error'][_0x7801('0x14')]);return _0x7c32b3(_0x3c57ce[_0x7801('0x13')][_0x7801('0x14')]);}else{logger[_0x7801('0xe')](_0x7801('0xf'),_0x29e707,_0x7801('0x10'));_0x7c32b3(_0x3c57ce[_0x7801('0x15')][_0x7801('0x14')]);}})['catch'](function(_0x2707a3){logger['error'](_0x7801('0xf'),_0x29e707,_0x2707a3);_0x3654e2(_0x2707a3);});});}exports[_0x7801('0x16')]=function(_0x53366a){var _0x51bf00=this;return new Promise(function(_0x13750b,_0x578799){return db[_0x7801('0x17')][_0x7801('0x18')]({'raw':_0x53366a[_0x7801('0x19')]?_0x53366a[_0x7801('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x53366a[_0x7801('0x19')]?_0x53366a[_0x7801('0x19')][_0x7801('0x1a')]||null:null,'attributes':_0x53366a['options']?_0x53366a[_0x7801('0x19')][_0x7801('0x1b')]||null:null,'limit':_0x53366a['options']?_0x53366a[_0x7801('0x19')][_0x7801('0x1c')]||null:null,'include':_0x53366a[_0x7801('0x19')]?_0x53366a[_0x7801('0x19')]['include']?_[_0x7801('0x1d')](_0x53366a[_0x7801('0x19')][_0x7801('0x1e')],function(_0x6e8b6f){return{'model':db[_0x6e8b6f['model']],'as':_0x6e8b6f['as'],'attributes':_0x6e8b6f[_0x7801('0x1b')],'include':_0x6e8b6f['include']?_[_0x7801('0x1d')](_0x6e8b6f[_0x7801('0x1e')],function(_0x11866d){return{'model':db[_0x11866d[_0x7801('0x1f')]],'as':_0x11866d['as'],'attributes':_0x11866d['attributes'],'include':_0x11866d[_0x7801('0x1e')]?_[_0x7801('0x1d')](_0x11866d['include'],function(_0x4fdf7e){return{'model':db[_0x4fdf7e[_0x7801('0x1f')]],'as':_0x4fdf7e['as'],'attributes':_0x4fdf7e[_0x7801('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7801('0xd')](function(_0x40908e){logger['info'](_0x7801('0x16'),_0x53366a);logger['debug']('GetDynamics365Account',_0x53366a,JSON[_0x7801('0x12')](_0x40908e));_0x13750b(_0x40908e);})[_0x7801('0x20')](function(_0x560e71){logger[_0x7801('0x13')](_0x7801('0x16'),_0x560e71[_0x7801('0x14')],_0x53366a);_0x578799(_0x51bf00[_0x7801('0x13')](0x1f4,_0x560e71[_0x7801('0x14')]));});});};exports[_0x7801('0x21')]=function(_0x35e156){var _0x3ab1c8=this;return new Promise(function(_0x33cb88,_0x521060){return db[_0x7801('0x17')]['find']({'raw':_0x35e156[_0x7801('0x19')]?_0x35e156[_0x7801('0x19')][_0x7801('0x22')]===undefined?!![]:![]:!![],'where':_0x35e156[_0x7801('0x19')]?_0x35e156[_0x7801('0x19')][_0x7801('0x1a')]||null:null,'attributes':_0x35e156[_0x7801('0x19')]?_0x35e156[_0x7801('0x19')]['attributes']||null:null,'include':_0x35e156[_0x7801('0x19')]?_0x35e156['options'][_0x7801('0x1e')]?_[_0x7801('0x1d')](_0x35e156[_0x7801('0x19')][_0x7801('0x1e')],function(_0x1545e5){return{'model':db[_0x1545e5[_0x7801('0x1f')]],'as':_0x1545e5['as'],'attributes':_0x1545e5[_0x7801('0x1b')],'include':_0x1545e5[_0x7801('0x1e')]?_[_0x7801('0x1d')](_0x1545e5[_0x7801('0x1e')],function(_0x13254f){return{'model':db[_0x13254f[_0x7801('0x1f')]],'as':_0x13254f['as'],'attributes':_0x13254f[_0x7801('0x1b')],'include':_0x13254f[_0x7801('0x1e')]?_['map'](_0x13254f[_0x7801('0x1e')],function(_0x4a2aa2){return{'model':db[_0x4a2aa2[_0x7801('0x1f')]],'as':_0x4a2aa2['as'],'attributes':_0x4a2aa2[_0x7801('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3f9b2d){logger[_0x7801('0xe')](_0x7801('0x21'),_0x35e156);logger[_0x7801('0x11')](_0x7801('0x21'),_0x35e156,JSON[_0x7801('0x12')](_0x3f9b2d));_0x33cb88(_0x3f9b2d);})['catch'](function(_0x2b162d){logger[_0x7801('0x13')](_0x7801('0x21'),_0x2b162d[_0x7801('0x14')],_0x35e156);_0x521060(_0x3ab1c8[_0x7801('0x13')](0x1f4,_0x2b162d['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 9f7df3f..965bc9c 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 _0xe605=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0xe605,0x92));var _0x5e60=function(_0x1362b9,_0x47ced9){_0x1362b9=_0x1362b9-0x0;var _0xe49d38=_0xe605[_0x1362b9];return _0xe49d38;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/:id',auth[_0x5e60('0xb')](),controller['show']);router['get']('/:id/fields',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['get'](_0x5e60('0x10'),auth['isAuthenticated'](),controller[_0x5e60('0x11')]);router[_0x5e60('0x12')]('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x13')](_0x5e60('0x14'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x15')]);router[_0x5e60('0x16')](_0x5e60('0x14'),auth['isAuthenticated'](),controller[_0x5e60('0x17')]);module[_0x5e60('0x18')]=router; \ No newline at end of file +var _0x761c=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','update','destroy','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x21e102,_0x49c6e4){var _0x9356bb=function(_0x2435c8){while(--_0x2435c8){_0x21e102['push'](_0x21e102['shift']());}};_0x9356bb(++_0x49c6e4);}(_0x761c,0x18a));var _0xc761=function(_0x5149b2,_0x2f1b52){_0x5149b2=_0x5149b2-0x0;var _0x6f2a85=_0x761c[_0x5149b2];return _0x6f2a85;};'use strict';var multer=require(_0xc761('0x0'));var util=require('util');var path=require(_0xc761('0x1'));var timeout=require(_0xc761('0x2'));var express=require('express');var router=express[_0xc761('0x3')]();var fs_extra=require(_0xc761('0x4'));var auth=require(_0xc761('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc761('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0xc761('0x7')]('/',auth[_0xc761('0x8')](),controller[_0xc761('0x9')]);router[_0xc761('0x7')](_0xc761('0xa'),auth[_0xc761('0x8')](),controller[_0xc761('0xb')]);router['get'](_0xc761('0xc'),auth[_0xc761('0x8')](),controller[_0xc761('0xd')]);router[_0xc761('0x7')](_0xc761('0xe'),auth[_0xc761('0x8')](),controller[_0xc761('0xf')]);router['get']('/:id/descriptions',auth[_0xc761('0x8')](),controller[_0xc761('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xc761('0x11')]);router['put'](_0xc761('0xa'),auth['isAuthenticated'](),controller[_0xc761('0x12')]);router['delete'](_0xc761('0xa'),auth[_0xc761('0x8')](),controller[_0xc761('0x13')]);module[_0xc761('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 8ef8b5e..0f959fa 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 _0x7a56=['phonecall','ENUM','contact','nothing','sequelize','exports','STRING','incident'];(function(_0x4e7ddc,_0x4a9f08){var _0x514e2a=function(_0x21437c){while(--_0x21437c){_0x4e7ddc['push'](_0x4e7ddc['shift']());}};_0x514e2a(++_0x4a9f08);}(_0x7a56,0x14c));var _0x67a5=function(_0x3583b5,_0x596c79){_0x3583b5=_0x3583b5-0x0;var _0x48b1a0=_0x7a56[_0x3583b5];return _0x48b1a0;};'use strict';var Sequelize=require(_0x67a5('0x0'));module[_0x67a5('0x1')]={'name':{'type':Sequelize[_0x67a5('0x2')]},'description':{'type':Sequelize[_0x67a5('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0x67a5('0x3'),_0x67a5('0x4')),'defaultValue':_0x67a5('0x3')},'moduleCreate':{'type':Sequelize[_0x67a5('0x5')](_0x67a5('0x6'),_0x67a5('0x7')),'defaultValue':_0x67a5('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize['STRING'],'allowNull':!![]},'openNewTab':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x271c=['BOOLEAN','sequelize','exports','STRING','ENUM','incident','contact','nothing'];(function(_0x415a31,_0x425d49){var _0x19a1bf=function(_0xdad08e){while(--_0xdad08e){_0x415a31['push'](_0x415a31['shift']());}};_0x19a1bf(++_0x425d49);}(_0x271c,0xe1));var _0xc271=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x271c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc271('0x0'));module[_0xc271('0x1')]={'name':{'type':Sequelize[_0xc271('0x2')]},'description':{'type':Sequelize[_0xc271('0x2')]},'ticketType':{'type':Sequelize[_0xc271('0x3')](_0xc271('0x4'),'phonecall'),'defaultValue':_0xc271('0x4')},'moduleCreate':{'type':Sequelize['ENUM'](_0xc271('0x5'),_0xc271('0x6')),'defaultValue':_0xc271('0x5'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xc271('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xc271('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 1049f3e..74d725d 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 _0xaa51=['order','sort','where','pick','filter','merge','VIRTUAL','Dynamics365Configuration','findAll','rows','catch','show','intersection','include','find','create','body','params','getFields','findOne','Dynamics365Field','options','getSubjects','nolimit','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty'];(function(_0x13cc02,_0xaa9e71){var _0x1229df=function(_0xd472e5){while(--_0xd472e5){_0x13cc02['push'](_0x13cc02['shift']());}};_0x1229df(++_0xaa9e71);}(_0xaa51,0x6a));var _0x1aa5=function(_0x5ec784,_0x2afc8a){_0x5ec784=_0x5ec784-0x0;var _0x1dd4b8=_0xaa51[_0x5ec784];return _0x1dd4b8;};'use strict';var emlformat=require(_0x1aa5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1aa5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1aa5('0x2'));var moment=require(_0x1aa5('0x3'));var BPromise=require(_0x1aa5('0x4'));var Mustache=require(_0x1aa5('0x5'));var util=require(_0x1aa5('0x6'));var path=require(_0x1aa5('0x7'));var sox=require('sox');var csv=require(_0x1aa5('0x8'));var ejs=require(_0x1aa5('0x9'));var fs=require('fs');var fs_extra=require(_0x1aa5('0xa'));var _=require(_0x1aa5('0xb'));var squel=require(_0x1aa5('0xc'));var crypto=require(_0x1aa5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1aa5('0xe'));var toCsv=require(_0x1aa5('0x8'));var querystring=require(_0x1aa5('0xf'));var Papa=require(_0x1aa5('0x10'));var Redis=require(_0x1aa5('0x11'));var authService=require(_0x1aa5('0x12'));var qs=require(_0x1aa5('0x13'));var as=require(_0x1aa5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1aa5('0x15'))('api');var utils=require(_0x1aa5('0x16'));var config=require(_0x1aa5('0x17'));var licenseUtil=require(_0x1aa5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5be307,_0x116bfc){_0x116bfc=_0x116bfc||0xcc;return function(_0x15da2a){if(_0x15da2a){return _0x5be307[_0x1aa5('0x19')](_0x116bfc);}return _0x5be307[_0x1aa5('0x1a')](_0x116bfc)[_0x1aa5('0x1b')]();};}function respondWithResult(_0x3f1b6b,_0x41ab50){_0x41ab50=_0x41ab50||0xc8;return function(_0x3542ef){if(_0x3542ef){return _0x3f1b6b['status'](_0x41ab50)[_0x1aa5('0x1c')](_0x3542ef);}};}function respondWithFilteredResult(_0x797695,_0x1cb1c2){return function(_0x4d437c){if(_0x4d437c){var _0x1502f8=typeof _0x1cb1c2[_0x1aa5('0x1d')]===_0x1aa5('0x1e')&&typeof _0x1cb1c2['limit']===_0x1aa5('0x1e');var _0xa0f88f=_0x4d437c[_0x1aa5('0x1f')];var _0x4f8a2b=_0x1502f8?0x0:_0x1cb1c2[_0x1aa5('0x1d')];var _0x848851=_0x1502f8?_0x4d437c[_0x1aa5('0x1f')]:_0x1cb1c2[_0x1aa5('0x1d')]+_0x1cb1c2[_0x1aa5('0x20')];var _0x4f891b;if(_0x848851>=_0xa0f88f){_0x848851=_0xa0f88f;_0x4f891b=0xc8;}else{_0x4f891b=0xce;}_0x797695['status'](_0x4f891b);return _0x797695[_0x1aa5('0x21')]('Content-Range',_0x4f8a2b+'-'+_0x848851+'/'+_0xa0f88f)[_0x1aa5('0x1c')](_0x4d437c);}return null;};}function patchUpdates(_0x40233c){return function(_0x524411){try{jsonpatch[_0x1aa5('0x22')](_0x524411,_0x40233c,!![]);}catch(_0x2e3b0e){return BPromise[_0x1aa5('0x23')](_0x2e3b0e);}return _0x524411[_0x1aa5('0x24')]();};}function saveUpdates(_0x5e7101,_0x528eed){return function(_0xb745fa){if(_0xb745fa){return _0xb745fa['update'](_0x5e7101)[_0x1aa5('0x25')](function(_0x28ac22){return _0x28ac22;});}return null;};}function removeEntity(_0x388914,_0x505cf8){return function(_0x3b1533){if(_0x3b1533){return _0x3b1533[_0x1aa5('0x26')]()['then'](function(){_0x388914[_0x1aa5('0x1a')](0xcc)[_0x1aa5('0x1b')]();});}};}function handleEntityNotFound(_0xd84c02,_0x1ea386){return function(_0xf3e239){if(!_0xf3e239){_0xd84c02['sendStatus'](0x194);}return _0xf3e239;};}function handleError(_0x170956,_0x1b65e9){_0x1b65e9=_0x1b65e9||0x1f4;return function(_0x91c35b){logger['error'](_0x91c35b[_0x1aa5('0x27')]);if(_0x91c35b['name']){delete _0x91c35b[_0x1aa5('0x28')];}_0x170956[_0x1aa5('0x1a')](_0x1b65e9)[_0x1aa5('0x29')](_0x91c35b);};}exports[_0x1aa5('0x2a')]=function(_0x2df3e0,_0x2bfbd8){var _0x3b093a={},_0x3e825e={},_0x50e163={'count':0x0,'rows':[]};var _0x35d4f5=_[_0x1aa5('0x2b')](db['Dynamics365Configuration'][_0x1aa5('0x2c')],function(_0x375ae4){return{'name':_0x375ae4[_0x1aa5('0x2d')],'type':_0x375ae4[_0x1aa5('0x2e')][_0x1aa5('0x2f')]};});_0x3e825e[_0x1aa5('0x30')]=_[_0x1aa5('0x2b')](_0x35d4f5,_0x1aa5('0x28'));_0x3e825e[_0x1aa5('0x31')]=_[_0x1aa5('0x32')](_0x2df3e0['query']);_0x3e825e[_0x1aa5('0x33')]=_['intersection'](_0x3e825e['model'],_0x3e825e['query']);_0x3b093a['attributes']=_['intersection'](_0x3e825e['model'],qs[_0x1aa5('0x34')](_0x2df3e0[_0x1aa5('0x31')][_0x1aa5('0x34')]));_0x3b093a[_0x1aa5('0x35')]=_0x3b093a[_0x1aa5('0x35')][_0x1aa5('0x36')]?_0x3b093a[_0x1aa5('0x35')]:_0x3e825e[_0x1aa5('0x30')];if(!_0x2df3e0[_0x1aa5('0x31')][_0x1aa5('0x37')]('nolimit')){_0x3b093a['limit']=qs[_0x1aa5('0x20')](_0x2df3e0[_0x1aa5('0x31')][_0x1aa5('0x20')]);_0x3b093a[_0x1aa5('0x1d')]=qs['offset'](_0x2df3e0[_0x1aa5('0x31')]['offset']);}_0x3b093a[_0x1aa5('0x38')]=qs[_0x1aa5('0x39')](_0x2df3e0[_0x1aa5('0x31')][_0x1aa5('0x39')]);_0x3b093a[_0x1aa5('0x3a')]=qs[_0x1aa5('0x33')](_[_0x1aa5('0x3b')](_0x2df3e0[_0x1aa5('0x31')],_0x3e825e[_0x1aa5('0x33')]),_0x35d4f5);if(_0x2df3e0[_0x1aa5('0x31')][_0x1aa5('0x3c')]){_0x3b093a[_0x1aa5('0x3a')]=_[_0x1aa5('0x3d')](_0x3b093a[_0x1aa5('0x3a')],{'$or':_['map'](_0x35d4f5,function(_0x4c45c7){if(_0x4c45c7[_0x1aa5('0x2e')]!==_0x1aa5('0x3e')){var _0x249907={};_0x249907[_0x4c45c7['name']]={'$like':'%'+_0x2df3e0['query'][_0x1aa5('0x3c')]+'%'};return _0x249907;}})});}_0x3b093a=_['merge']({},_0x3b093a,_0x2df3e0['options']);var _0x5e73c5={'where':_0x3b093a[_0x1aa5('0x3a')]};return db['Dynamics365Configuration'][_0x1aa5('0x1f')](_0x5e73c5)[_0x1aa5('0x25')](function(_0x106cf4){_0x50e163[_0x1aa5('0x1f')]=_0x106cf4;if(_0x2df3e0['query']['includeAll']){_0x3b093a['include']=[{'all':!![]}];}return db[_0x1aa5('0x3f')][_0x1aa5('0x40')](_0x3b093a);})['then'](function(_0x4527c8){_0x50e163[_0x1aa5('0x41')]=_0x4527c8;return _0x50e163;})[_0x1aa5('0x25')](respondWithFilteredResult(_0x2bfbd8,_0x3b093a))[_0x1aa5('0x42')](handleError(_0x2bfbd8,null));};exports[_0x1aa5('0x43')]=function(_0x53757d,_0x17b711){var _0x5a4d4b={'raw':![],'where':{'id':_0x53757d['params']['id']}},_0x3bd785={};_0x3bd785['model']=_[_0x1aa5('0x32')](db['Dynamics365Configuration'][_0x1aa5('0x2c')]);_0x3bd785['query']=_['keys'](_0x53757d[_0x1aa5('0x31')]);_0x3bd785['filters']=_[_0x1aa5('0x44')](_0x3bd785[_0x1aa5('0x30')],_0x3bd785[_0x1aa5('0x31')]);_0x5a4d4b[_0x1aa5('0x35')]=_['intersection'](_0x3bd785[_0x1aa5('0x30')],qs[_0x1aa5('0x34')](_0x53757d['query']['fields']));_0x5a4d4b[_0x1aa5('0x35')]=_0x5a4d4b[_0x1aa5('0x35')]['length']?_0x5a4d4b[_0x1aa5('0x35')]:_0x3bd785[_0x1aa5('0x30')];if(_0x53757d[_0x1aa5('0x31')]['includeAll']){_0x5a4d4b[_0x1aa5('0x45')]=[{'all':!![]}];}_0x5a4d4b=_[_0x1aa5('0x3d')]({},_0x5a4d4b,_0x53757d['options']);return db[_0x1aa5('0x3f')][_0x1aa5('0x46')](_0x5a4d4b)[_0x1aa5('0x25')](handleEntityNotFound(_0x17b711,null))[_0x1aa5('0x25')](respondWithResult(_0x17b711,null))['catch'](handleError(_0x17b711,null));};exports[_0x1aa5('0x47')]=function(_0x35b4e9,_0x2de3b7){return db[_0x1aa5('0x3f')]['create'](_0x35b4e9[_0x1aa5('0x48')],{})[_0x1aa5('0x25')](respondWithResult(_0x2de3b7,0xc9))['catch'](handleError(_0x2de3b7,null));};exports['update']=function(_0x3a136c,_0x464a3f){if(_0x3a136c['body']['id']){delete _0x3a136c[_0x1aa5('0x48')]['id'];}return db[_0x1aa5('0x3f')][_0x1aa5('0x46')]({'where':{'id':_0x3a136c[_0x1aa5('0x49')]['id']}})[_0x1aa5('0x25')](handleEntityNotFound(_0x464a3f,null))[_0x1aa5('0x25')](saveUpdates(_0x3a136c[_0x1aa5('0x48')],null))[_0x1aa5('0x25')](respondWithResult(_0x464a3f,null))[_0x1aa5('0x42')](handleError(_0x464a3f,null));};exports[_0x1aa5('0x26')]=function(_0x1be252,_0x18c86c){return db['Dynamics365Configuration'][_0x1aa5('0x46')]({'where':{'id':_0x1be252[_0x1aa5('0x49')]['id']}})['then'](handleEntityNotFound(_0x18c86c,null))[_0x1aa5('0x25')](removeEntity(_0x18c86c,null))[_0x1aa5('0x42')](handleError(_0x18c86c,null));};exports[_0x1aa5('0x4a')]=function(_0x5ef3ce,_0x37d901,_0x49da28){var _0x45e0ca={};var _0x5d3f39={};var _0x2d6736;var _0x14bd54;return db[_0x1aa5('0x3f')][_0x1aa5('0x4b')]({'where':{'id':_0x5ef3ce[_0x1aa5('0x49')]['id']}})[_0x1aa5('0x25')](handleEntityNotFound(_0x37d901,null))[_0x1aa5('0x25')](function(_0xac7d0a){if(_0xac7d0a){_0x2d6736=_0xac7d0a;_0x5d3f39[_0x1aa5('0x30')]=_['keys'](db[_0x1aa5('0x4c')][_0x1aa5('0x2c')]);_0x5d3f39[_0x1aa5('0x31')]=_[_0x1aa5('0x32')](_0x5ef3ce[_0x1aa5('0x31')]);_0x5d3f39['filters']=_[_0x1aa5('0x44')](_0x5d3f39[_0x1aa5('0x30')],_0x5d3f39['query']);_0x45e0ca[_0x1aa5('0x35')]=_[_0x1aa5('0x44')](_0x5d3f39[_0x1aa5('0x30')],qs[_0x1aa5('0x34')](_0x5ef3ce[_0x1aa5('0x31')][_0x1aa5('0x34')]));_0x45e0ca[_0x1aa5('0x35')]=_0x45e0ca[_0x1aa5('0x35')]['length']?_0x45e0ca[_0x1aa5('0x35')]:_0x5d3f39[_0x1aa5('0x30')];_0x45e0ca[_0x1aa5('0x38')]=qs[_0x1aa5('0x39')](_0x5ef3ce[_0x1aa5('0x31')][_0x1aa5('0x39')]);_0x45e0ca[_0x1aa5('0x3a')]=qs[_0x1aa5('0x33')](_[_0x1aa5('0x3b')](_0x5ef3ce['query'],_0x5d3f39[_0x1aa5('0x33')]));if(_0x5ef3ce[_0x1aa5('0x31')]['filter']){_0x45e0ca[_0x1aa5('0x3a')]=_[_0x1aa5('0x3d')](_0x45e0ca['where'],{'$or':_[_0x1aa5('0x2b')](_0x45e0ca['attributes'],function(_0xa3d6df){var _0x1ee34f={};_0x1ee34f[_0xa3d6df]={'$like':'%'+_0x5ef3ce['query'][_0x1aa5('0x3c')]+'%'};return _0x1ee34f;})});}_0x45e0ca=_[_0x1aa5('0x3d')]({},_0x45e0ca,_0x5ef3ce[_0x1aa5('0x4d')]);return _0x2d6736['getFields'](_0x45e0ca);}})[_0x1aa5('0x25')](function(_0xba32e1){if(_0xba32e1){_0x14bd54=_0xba32e1[_0x1aa5('0x36')];if(!_0x5ef3ce['query'][_0x1aa5('0x37')]('nolimit')){_0x45e0ca[_0x1aa5('0x20')]=qs[_0x1aa5('0x20')](_0x5ef3ce[_0x1aa5('0x31')][_0x1aa5('0x20')]);_0x45e0ca[_0x1aa5('0x1d')]=qs[_0x1aa5('0x1d')](_0x5ef3ce[_0x1aa5('0x31')][_0x1aa5('0x1d')]);}return _0x2d6736[_0x1aa5('0x4a')](_0x45e0ca);}})[_0x1aa5('0x25')](function(_0x47e469){if(_0x47e469){return _0x47e469?{'count':_0x14bd54,'rows':_0x47e469}:null;}})[_0x1aa5('0x25')](respondWithResult(_0x37d901,null))[_0x1aa5('0x42')](handleError(_0x37d901,null));};exports['getSubjects']=function(_0xbeddc5,_0x4d8f37,_0x591778){var _0x163e74={};var _0x130e3c={};var _0xe0e8f9;var _0x200204;return db[_0x1aa5('0x3f')][_0x1aa5('0x4b')]({'where':{'id':_0xbeddc5[_0x1aa5('0x49')]['id']}})[_0x1aa5('0x25')](handleEntityNotFound(_0x4d8f37,null))['then'](function(_0x3aca58){if(_0x3aca58){_0xe0e8f9=_0x3aca58;_0x130e3c['model']=_[_0x1aa5('0x32')](db[_0x1aa5('0x4c')][_0x1aa5('0x2c')]);_0x130e3c['query']=_[_0x1aa5('0x32')](_0xbeddc5['query']);_0x130e3c['filters']=_['intersection'](_0x130e3c[_0x1aa5('0x30')],_0x130e3c['query']);_0x163e74[_0x1aa5('0x35')]=_[_0x1aa5('0x44')](_0x130e3c[_0x1aa5('0x30')],qs[_0x1aa5('0x34')](_0xbeddc5['query'][_0x1aa5('0x34')]));_0x163e74[_0x1aa5('0x35')]=_0x163e74[_0x1aa5('0x35')][_0x1aa5('0x36')]?_0x163e74[_0x1aa5('0x35')]:_0x130e3c[_0x1aa5('0x30')];_0x163e74['order']=qs[_0x1aa5('0x39')](_0xbeddc5['query']['sort']);_0x163e74['where']=qs[_0x1aa5('0x33')](_['pick'](_0xbeddc5[_0x1aa5('0x31')],_0x130e3c['filters']));if(_0xbeddc5['query'][_0x1aa5('0x3c')]){_0x163e74[_0x1aa5('0x3a')]=_[_0x1aa5('0x3d')](_0x163e74[_0x1aa5('0x3a')],{'$or':_[_0x1aa5('0x2b')](_0x163e74[_0x1aa5('0x35')],function(_0x501d02){var _0x2f80e4={};_0x2f80e4[_0x501d02]={'$like':'%'+_0xbeddc5[_0x1aa5('0x31')][_0x1aa5('0x3c')]+'%'};return _0x2f80e4;})});}_0x163e74=_[_0x1aa5('0x3d')]({},_0x163e74,_0xbeddc5[_0x1aa5('0x4d')]);return _0xe0e8f9[_0x1aa5('0x4e')](_0x163e74);}})[_0x1aa5('0x25')](function(_0x13dbc1){if(_0x13dbc1){_0x200204=_0x13dbc1['length'];if(!_0xbeddc5[_0x1aa5('0x31')][_0x1aa5('0x37')](_0x1aa5('0x4f'))){_0x163e74[_0x1aa5('0x20')]=qs[_0x1aa5('0x20')](_0xbeddc5['query']['limit']);_0x163e74[_0x1aa5('0x1d')]=qs[_0x1aa5('0x1d')](_0xbeddc5['query'][_0x1aa5('0x1d')]);}return _0xe0e8f9['getSubjects'](_0x163e74);}})[_0x1aa5('0x25')](function(_0x2539a2){if(_0x2539a2){return _0x2539a2?{'count':_0x200204,'rows':_0x2539a2}:null;}})[_0x1aa5('0x25')](respondWithResult(_0x4d8f37,null))[_0x1aa5('0x42')](handleError(_0x4d8f37,null));};exports['getDescriptions']=function(_0xdd4f6c,_0x54768f,_0x2df274){var _0x54111a={};var _0x3fc88f={};var _0x36c554;var _0x1c7d6f;return db[_0x1aa5('0x3f')][_0x1aa5('0x4b')]({'where':{'id':_0xdd4f6c[_0x1aa5('0x49')]['id']}})[_0x1aa5('0x25')](handleEntityNotFound(_0x54768f,null))[_0x1aa5('0x25')](function(_0x5dac10){if(_0x5dac10){_0x36c554=_0x5dac10;_0x3fc88f[_0x1aa5('0x30')]=_[_0x1aa5('0x32')](db['Dynamics365Field'][_0x1aa5('0x2c')]);_0x3fc88f[_0x1aa5('0x31')]=_[_0x1aa5('0x32')](_0xdd4f6c['query']);_0x3fc88f[_0x1aa5('0x33')]=_[_0x1aa5('0x44')](_0x3fc88f['model'],_0x3fc88f[_0x1aa5('0x31')]);_0x54111a[_0x1aa5('0x35')]=_[_0x1aa5('0x44')](_0x3fc88f['model'],qs[_0x1aa5('0x34')](_0xdd4f6c['query']['fields']));_0x54111a[_0x1aa5('0x35')]=_0x54111a[_0x1aa5('0x35')][_0x1aa5('0x36')]?_0x54111a['attributes']:_0x3fc88f[_0x1aa5('0x30')];_0x54111a['order']=qs[_0x1aa5('0x39')](_0xdd4f6c[_0x1aa5('0x31')]['sort']);_0x54111a[_0x1aa5('0x3a')]=qs[_0x1aa5('0x33')](_[_0x1aa5('0x3b')](_0xdd4f6c['query'],_0x3fc88f[_0x1aa5('0x33')]));if(_0xdd4f6c[_0x1aa5('0x31')]['filter']){_0x54111a[_0x1aa5('0x3a')]=_['merge'](_0x54111a[_0x1aa5('0x3a')],{'$or':_['map'](_0x54111a[_0x1aa5('0x35')],function(_0x5d5f75){var _0x814a9c={};_0x814a9c[_0x5d5f75]={'$like':'%'+_0xdd4f6c[_0x1aa5('0x31')][_0x1aa5('0x3c')]+'%'};return _0x814a9c;})});}_0x54111a=_['merge']({},_0x54111a,_0xdd4f6c['options']);return _0x36c554[_0x1aa5('0x50')](_0x54111a);}})[_0x1aa5('0x25')](function(_0x1bb784){if(_0x1bb784){_0x1c7d6f=_0x1bb784[_0x1aa5('0x36')];if(!_0xdd4f6c['query'][_0x1aa5('0x37')](_0x1aa5('0x4f'))){_0x54111a[_0x1aa5('0x20')]=qs[_0x1aa5('0x20')](_0xdd4f6c[_0x1aa5('0x31')][_0x1aa5('0x20')]);_0x54111a[_0x1aa5('0x1d')]=qs[_0x1aa5('0x1d')](_0xdd4f6c['query']['offset']);}return _0x36c554[_0x1aa5('0x50')](_0x54111a);}})[_0x1aa5('0x25')](function(_0x55eb23){if(_0x55eb23){return _0x55eb23?{'count':_0x1c7d6f,'rows':_0x55eb23}:null;}})[_0x1aa5('0x25')](respondWithResult(_0x54768f,null))['catch'](handleError(_0x54768f,null));}; \ No newline at end of file +var _0x7669=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','Dynamics365Configuration','includeAll','include','findAll','rows','catch','show','params','length','merge','find','create','body','update','destroy','getFields','findOne','Dynamics365Field','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes'];(function(_0x317497,_0x2d6cf7){var _0x3445b0=function(_0x22fe4d){while(--_0x22fe4d){_0x317497['push'](_0x317497['shift']());}};_0x3445b0(++_0x2d6cf7);}(_0x7669,0x113));var _0x9766=function(_0x45f0c1,_0x37bd6e){_0x45f0c1=_0x45f0c1-0x0;var _0x188bba=_0x7669[_0x45f0c1];return _0x188bba;};'use strict';var emlformat=require(_0x9766('0x0'));var rimraf=require(_0x9766('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9766('0x2'));var rp=require(_0x9766('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9766('0x4'));var util=require(_0x9766('0x5'));var path=require('path');var sox=require(_0x9766('0x6'));var csv=require('to-csv');var ejs=require(_0x9766('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9766('0x8'));var squel=require(_0x9766('0x9'));var crypto=require(_0x9766('0xa'));var jsforce=require(_0x9766('0xb'));var deskjs=require(_0x9766('0xc'));var toCsv=require('to-csv');var querystring=require(_0x9766('0xd'));var Papa=require(_0x9766('0xe'));var Redis=require(_0x9766('0xf'));var authService=require(_0x9766('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9766('0x11'));var hardwareService=require(_0x9766('0x12'));var logger=require(_0x9766('0x13'))(_0x9766('0x14'));var utils=require(_0x9766('0x15'));var config=require(_0x9766('0x16'));var licenseUtil=require(_0x9766('0x17'));var db=require(_0x9766('0x18'))['db'];function respondWithStatusCode(_0xab698e,_0x58ab13){_0x58ab13=_0x58ab13||0xcc;return function(_0x167a93){if(_0x167a93){return _0xab698e[_0x9766('0x19')](_0x58ab13);}return _0xab698e['status'](_0x58ab13)[_0x9766('0x1a')]();};}function respondWithResult(_0x189329,_0x400821){_0x400821=_0x400821||0xc8;return function(_0x53dc43){if(_0x53dc43){return _0x189329[_0x9766('0x1b')](_0x400821)[_0x9766('0x1c')](_0x53dc43);}};}function respondWithFilteredResult(_0x382bf4,_0x142c17){return function(_0xa8d6ef){if(_0xa8d6ef){var _0x355299=typeof _0x142c17[_0x9766('0x1d')]===_0x9766('0x1e')&&typeof _0x142c17[_0x9766('0x1f')]===_0x9766('0x1e');var _0x2fe73e=_0xa8d6ef[_0x9766('0x20')];var _0xfbb65f=_0x355299?0x0:_0x142c17['offset'];var _0x4be6ec=_0x355299?_0xa8d6ef[_0x9766('0x20')]:_0x142c17[_0x9766('0x1d')]+_0x142c17['limit'];var _0x4e8da4;if(_0x4be6ec>=_0x2fe73e){_0x4be6ec=_0x2fe73e;_0x4e8da4=0xc8;}else{_0x4e8da4=0xce;}_0x382bf4[_0x9766('0x1b')](_0x4e8da4);return _0x382bf4[_0x9766('0x21')](_0x9766('0x22'),_0xfbb65f+'-'+_0x4be6ec+'/'+_0x2fe73e)[_0x9766('0x1c')](_0xa8d6ef);}return null;};}function patchUpdates(_0x6b5683){return function(_0x427531){try{jsonpatch[_0x9766('0x23')](_0x427531,_0x6b5683,!![]);}catch(_0x5b2f38){return BPromise[_0x9766('0x24')](_0x5b2f38);}return _0x427531[_0x9766('0x25')]();};}function saveUpdates(_0x41ed08,_0x2b484f){return function(_0x56f77a){if(_0x56f77a){return _0x56f77a['update'](_0x41ed08)[_0x9766('0x26')](function(_0x4f89dc){return _0x4f89dc;});}return null;};}function removeEntity(_0x3e68db,_0x48c99e){return function(_0xebf5ac){if(_0xebf5ac){return _0xebf5ac['destroy']()[_0x9766('0x26')](function(){_0x3e68db[_0x9766('0x1b')](0xcc)[_0x9766('0x1a')]();});}};}function handleEntityNotFound(_0x410ab6,_0x320f50){return function(_0xdc233b){if(!_0xdc233b){_0x410ab6[_0x9766('0x19')](0x194);}return _0xdc233b;};}function handleError(_0x3f50fa,_0xb903d4){_0xb903d4=_0xb903d4||0x1f4;return function(_0x4001c4){logger[_0x9766('0x27')](_0x4001c4[_0x9766('0x28')]);if(_0x4001c4[_0x9766('0x29')]){delete _0x4001c4[_0x9766('0x29')];}_0x3f50fa[_0x9766('0x1b')](_0xb903d4)['send'](_0x4001c4);};}exports[_0x9766('0x2a')]=function(_0x30a2fd,_0xb772a){var _0x36d582={},_0x59e0ce={},_0x3a42a5={'count':0x0,'rows':[]};var _0x174f8a=_[_0x9766('0x2b')](db['Dynamics365Configuration'][_0x9766('0x2c')],function(_0x261970){return{'name':_0x261970[_0x9766('0x2d')],'type':_0x261970['type'][_0x9766('0x2e')]};});_0x59e0ce[_0x9766('0x2f')]=_[_0x9766('0x2b')](_0x174f8a,_0x9766('0x29'));_0x59e0ce[_0x9766('0x30')]=_[_0x9766('0x31')](_0x30a2fd[_0x9766('0x30')]);_0x59e0ce[_0x9766('0x32')]=_[_0x9766('0x33')](_0x59e0ce[_0x9766('0x2f')],_0x59e0ce[_0x9766('0x30')]);_0x36d582[_0x9766('0x34')]=_['intersection'](_0x59e0ce[_0x9766('0x2f')],qs[_0x9766('0x35')](_0x30a2fd[_0x9766('0x30')][_0x9766('0x35')]));_0x36d582['attributes']=_0x36d582[_0x9766('0x34')]['length']?_0x36d582[_0x9766('0x34')]:_0x59e0ce[_0x9766('0x2f')];if(!_0x30a2fd[_0x9766('0x30')][_0x9766('0x36')](_0x9766('0x37'))){_0x36d582[_0x9766('0x1f')]=qs[_0x9766('0x1f')](_0x30a2fd[_0x9766('0x30')][_0x9766('0x1f')]);_0x36d582[_0x9766('0x1d')]=qs[_0x9766('0x1d')](_0x30a2fd['query'][_0x9766('0x1d')]);}_0x36d582[_0x9766('0x38')]=qs[_0x9766('0x39')](_0x30a2fd['query'][_0x9766('0x39')]);_0x36d582[_0x9766('0x3a')]=qs[_0x9766('0x32')](_[_0x9766('0x3b')](_0x30a2fd['query'],_0x59e0ce[_0x9766('0x32')]),_0x174f8a);if(_0x30a2fd[_0x9766('0x30')][_0x9766('0x3c')]){_0x36d582[_0x9766('0x3a')]=_['merge'](_0x36d582[_0x9766('0x3a')],{'$or':_[_0x9766('0x2b')](_0x174f8a,function(_0x2dca37){if(_0x2dca37['type']!=='VIRTUAL'){var _0x3ad0ed={};_0x3ad0ed[_0x2dca37[_0x9766('0x29')]]={'$like':'%'+_0x30a2fd['query']['filter']+'%'};return _0x3ad0ed;}})});}_0x36d582=_['merge']({},_0x36d582,_0x30a2fd[_0x9766('0x3d')]);var _0x5846af={'where':_0x36d582[_0x9766('0x3a')]};return db[_0x9766('0x3e')]['count'](_0x5846af)[_0x9766('0x26')](function(_0x2ef95b){_0x3a42a5[_0x9766('0x20')]=_0x2ef95b;if(_0x30a2fd[_0x9766('0x30')][_0x9766('0x3f')]){_0x36d582[_0x9766('0x40')]=[{'all':!![]}];}return db[_0x9766('0x3e')][_0x9766('0x41')](_0x36d582);})[_0x9766('0x26')](function(_0x42e3ff){_0x3a42a5[_0x9766('0x42')]=_0x42e3ff;return _0x3a42a5;})[_0x9766('0x26')](respondWithFilteredResult(_0xb772a,_0x36d582))[_0x9766('0x43')](handleError(_0xb772a,null));};exports[_0x9766('0x44')]=function(_0x31aeeb,_0x59fcf0){var _0x14321d={'raw':![],'where':{'id':_0x31aeeb[_0x9766('0x45')]['id']}},_0x202ffc={};_0x202ffc['model']=_[_0x9766('0x31')](db['Dynamics365Configuration'][_0x9766('0x2c')]);_0x202ffc['query']=_[_0x9766('0x31')](_0x31aeeb[_0x9766('0x30')]);_0x202ffc['filters']=_[_0x9766('0x33')](_0x202ffc[_0x9766('0x2f')],_0x202ffc[_0x9766('0x30')]);_0x14321d[_0x9766('0x34')]=_[_0x9766('0x33')](_0x202ffc[_0x9766('0x2f')],qs[_0x9766('0x35')](_0x31aeeb['query'][_0x9766('0x35')]));_0x14321d[_0x9766('0x34')]=_0x14321d[_0x9766('0x34')][_0x9766('0x46')]?_0x14321d['attributes']:_0x202ffc[_0x9766('0x2f')];if(_0x31aeeb['query'][_0x9766('0x3f')]){_0x14321d[_0x9766('0x40')]=[{'all':!![]}];}_0x14321d=_[_0x9766('0x47')]({},_0x14321d,_0x31aeeb['options']);return db[_0x9766('0x3e')][_0x9766('0x48')](_0x14321d)[_0x9766('0x26')](handleEntityNotFound(_0x59fcf0,null))[_0x9766('0x26')](respondWithResult(_0x59fcf0,null))[_0x9766('0x43')](handleError(_0x59fcf0,null));};exports[_0x9766('0x49')]=function(_0x41737f,_0x2cf508){return db[_0x9766('0x3e')][_0x9766('0x49')](_0x41737f[_0x9766('0x4a')],{})[_0x9766('0x26')](respondWithResult(_0x2cf508,0xc9))[_0x9766('0x43')](handleError(_0x2cf508,null));};exports[_0x9766('0x4b')]=function(_0x18e99d,_0x1361d8){if(_0x18e99d['body']['id']){delete _0x18e99d[_0x9766('0x4a')]['id'];}return db[_0x9766('0x3e')][_0x9766('0x48')]({'where':{'id':_0x18e99d[_0x9766('0x45')]['id']}})[_0x9766('0x26')](handleEntityNotFound(_0x1361d8,null))['then'](saveUpdates(_0x18e99d['body'],null))[_0x9766('0x26')](respondWithResult(_0x1361d8,null))[_0x9766('0x43')](handleError(_0x1361d8,null));};exports[_0x9766('0x4c')]=function(_0x3884e7,_0x1c0981){return db[_0x9766('0x3e')][_0x9766('0x48')]({'where':{'id':_0x3884e7[_0x9766('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c0981,null))[_0x9766('0x26')](removeEntity(_0x1c0981,null))['catch'](handleError(_0x1c0981,null));};exports[_0x9766('0x4d')]=function(_0x4e35de,_0x7a860c,_0x28040a){var _0x30fe34={};var _0x1828a8={};var _0x494791;var _0x1e1bb0;return db[_0x9766('0x3e')][_0x9766('0x4e')]({'where':{'id':_0x4e35de['params']['id']}})[_0x9766('0x26')](handleEntityNotFound(_0x7a860c,null))['then'](function(_0x26455a){if(_0x26455a){_0x494791=_0x26455a;_0x1828a8[_0x9766('0x2f')]=_['keys'](db[_0x9766('0x4f')][_0x9766('0x2c')]);_0x1828a8[_0x9766('0x30')]=_['keys'](_0x4e35de[_0x9766('0x30')]);_0x1828a8['filters']=_[_0x9766('0x33')](_0x1828a8[_0x9766('0x2f')],_0x1828a8[_0x9766('0x30')]);_0x30fe34[_0x9766('0x34')]=_[_0x9766('0x33')](_0x1828a8[_0x9766('0x2f')],qs[_0x9766('0x35')](_0x4e35de['query'][_0x9766('0x35')]));_0x30fe34[_0x9766('0x34')]=_0x30fe34[_0x9766('0x34')][_0x9766('0x46')]?_0x30fe34[_0x9766('0x34')]:_0x1828a8['model'];_0x30fe34['order']=qs[_0x9766('0x39')](_0x4e35de['query'][_0x9766('0x39')]);_0x30fe34[_0x9766('0x3a')]=qs[_0x9766('0x32')](_[_0x9766('0x3b')](_0x4e35de['query'],_0x1828a8['filters']));if(_0x4e35de['query'][_0x9766('0x3c')]){_0x30fe34[_0x9766('0x3a')]=_['merge'](_0x30fe34[_0x9766('0x3a')],{'$or':_['map'](_0x30fe34['attributes'],function(_0x2c85c1){var _0x2c1a28={};_0x2c1a28[_0x2c85c1]={'$like':'%'+_0x4e35de[_0x9766('0x30')][_0x9766('0x3c')]+'%'};return _0x2c1a28;})});}_0x30fe34=_[_0x9766('0x47')]({},_0x30fe34,_0x4e35de[_0x9766('0x3d')]);return _0x494791['getFields'](_0x30fe34);}})[_0x9766('0x26')](function(_0x1474b9){if(_0x1474b9){_0x1e1bb0=_0x1474b9[_0x9766('0x46')];if(!_0x4e35de[_0x9766('0x30')][_0x9766('0x36')](_0x9766('0x37'))){_0x30fe34['limit']=qs[_0x9766('0x1f')](_0x4e35de[_0x9766('0x30')]['limit']);_0x30fe34[_0x9766('0x1d')]=qs['offset'](_0x4e35de[_0x9766('0x30')]['offset']);}return _0x494791[_0x9766('0x4d')](_0x30fe34);}})[_0x9766('0x26')](function(_0x2042db){if(_0x2042db){return _0x2042db?{'count':_0x1e1bb0,'rows':_0x2042db}:null;}})[_0x9766('0x26')](respondWithResult(_0x7a860c,null))[_0x9766('0x43')](handleError(_0x7a860c,null));};exports[_0x9766('0x50')]=function(_0x33f866,_0x152682,_0x61eae2){var _0x523ffb={};var _0x448233={};var _0x350727;var _0x465096;return db['Dynamics365Configuration'][_0x9766('0x4e')]({'where':{'id':_0x33f866['params']['id']}})['then'](handleEntityNotFound(_0x152682,null))[_0x9766('0x26')](function(_0x2b01dc){if(_0x2b01dc){_0x350727=_0x2b01dc;_0x448233[_0x9766('0x2f')]=_[_0x9766('0x31')](db[_0x9766('0x4f')][_0x9766('0x2c')]);_0x448233[_0x9766('0x30')]=_[_0x9766('0x31')](_0x33f866[_0x9766('0x30')]);_0x448233[_0x9766('0x32')]=_[_0x9766('0x33')](_0x448233['model'],_0x448233[_0x9766('0x30')]);_0x523ffb[_0x9766('0x34')]=_[_0x9766('0x33')](_0x448233['model'],qs[_0x9766('0x35')](_0x33f866['query'][_0x9766('0x35')]));_0x523ffb[_0x9766('0x34')]=_0x523ffb['attributes']['length']?_0x523ffb[_0x9766('0x34')]:_0x448233[_0x9766('0x2f')];_0x523ffb[_0x9766('0x38')]=qs[_0x9766('0x39')](_0x33f866[_0x9766('0x30')][_0x9766('0x39')]);_0x523ffb[_0x9766('0x3a')]=qs[_0x9766('0x32')](_[_0x9766('0x3b')](_0x33f866[_0x9766('0x30')],_0x448233[_0x9766('0x32')]));if(_0x33f866[_0x9766('0x30')][_0x9766('0x3c')]){_0x523ffb['where']=_[_0x9766('0x47')](_0x523ffb[_0x9766('0x3a')],{'$or':_['map'](_0x523ffb[_0x9766('0x34')],function(_0x1bf66f){var _0x34c688={};_0x34c688[_0x1bf66f]={'$like':'%'+_0x33f866[_0x9766('0x30')][_0x9766('0x3c')]+'%'};return _0x34c688;})});}_0x523ffb=_[_0x9766('0x47')]({},_0x523ffb,_0x33f866[_0x9766('0x3d')]);return _0x350727[_0x9766('0x50')](_0x523ffb);}})[_0x9766('0x26')](function(_0x21a6f8){if(_0x21a6f8){_0x465096=_0x21a6f8[_0x9766('0x46')];if(!_0x33f866[_0x9766('0x30')][_0x9766('0x36')](_0x9766('0x37'))){_0x523ffb[_0x9766('0x1f')]=qs[_0x9766('0x1f')](_0x33f866[_0x9766('0x30')]['limit']);_0x523ffb['offset']=qs['offset'](_0x33f866[_0x9766('0x30')][_0x9766('0x1d')]);}return _0x350727[_0x9766('0x50')](_0x523ffb);}})[_0x9766('0x26')](function(_0x15d87f){if(_0x15d87f){return _0x15d87f?{'count':_0x465096,'rows':_0x15d87f}:null;}})[_0x9766('0x26')](respondWithResult(_0x152682,null))[_0x9766('0x43')](handleError(_0x152682,null));};exports[_0x9766('0x51')]=function(_0x462823,_0x5b8efa,_0x34a4b7){var _0x1dd51d={};var _0x58dfdd={};var _0x4b9d52;var _0x2a3713;return db[_0x9766('0x3e')][_0x9766('0x4e')]({'where':{'id':_0x462823['params']['id']}})[_0x9766('0x26')](handleEntityNotFound(_0x5b8efa,null))[_0x9766('0x26')](function(_0x478092){if(_0x478092){_0x4b9d52=_0x478092;_0x58dfdd[_0x9766('0x2f')]=_[_0x9766('0x31')](db[_0x9766('0x4f')][_0x9766('0x2c')]);_0x58dfdd[_0x9766('0x30')]=_['keys'](_0x462823[_0x9766('0x30')]);_0x58dfdd['filters']=_[_0x9766('0x33')](_0x58dfdd[_0x9766('0x2f')],_0x58dfdd['query']);_0x1dd51d['attributes']=_[_0x9766('0x33')](_0x58dfdd[_0x9766('0x2f')],qs['fields'](_0x462823[_0x9766('0x30')]['fields']));_0x1dd51d[_0x9766('0x34')]=_0x1dd51d[_0x9766('0x34')][_0x9766('0x46')]?_0x1dd51d[_0x9766('0x34')]:_0x58dfdd[_0x9766('0x2f')];_0x1dd51d[_0x9766('0x38')]=qs[_0x9766('0x39')](_0x462823['query'][_0x9766('0x39')]);_0x1dd51d[_0x9766('0x3a')]=qs[_0x9766('0x32')](_[_0x9766('0x3b')](_0x462823['query'],_0x58dfdd['filters']));if(_0x462823[_0x9766('0x30')][_0x9766('0x3c')]){_0x1dd51d[_0x9766('0x3a')]=_[_0x9766('0x47')](_0x1dd51d[_0x9766('0x3a')],{'$or':_['map'](_0x1dd51d['attributes'],function(_0x35cab7){var _0x4701d1={};_0x4701d1[_0x35cab7]={'$like':'%'+_0x462823[_0x9766('0x30')][_0x9766('0x3c')]+'%'};return _0x4701d1;})});}_0x1dd51d=_[_0x9766('0x47')]({},_0x1dd51d,_0x462823[_0x9766('0x3d')]);return _0x4b9d52['getDescriptions'](_0x1dd51d);}})['then'](function(_0x44205){if(_0x44205){_0x2a3713=_0x44205['length'];if(!_0x462823[_0x9766('0x30')][_0x9766('0x36')](_0x9766('0x37'))){_0x1dd51d[_0x9766('0x1f')]=qs[_0x9766('0x1f')](_0x462823['query'][_0x9766('0x1f')]);_0x1dd51d[_0x9766('0x1d')]=qs['offset'](_0x462823['query'][_0x9766('0x1d')]);}return _0x4b9d52['getDescriptions'](_0x1dd51d);}})[_0x9766('0x26')](function(_0x4a047c){if(_0x4a047c){return _0x4a047c?{'count':_0x2a3713,'rows':_0x4a047c}:null;}})['then'](respondWithResult(_0x5b8efa,null))[_0x9766('0x43')](handleError(_0x5b8efa,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 60eae6a..c9ee258 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 _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x376772,_0xdea9e0){var _0xeb060d=function(_0x22f7aa){while(--_0x22f7aa){_0x376772['push'](_0x376772['shift']());}};_0xeb060d(++_0xdea9e0);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x00bb[_0x5447fd];return _0x15b28a;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb821=['rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','../../config/logger','bluebird'];(function(_0x1e67b6,_0x14395a){var _0x18fdb2=function(_0x3be46a){while(--_0x3be46a){_0x1e67b6['push'](_0x1e67b6['shift']());}};_0x18fdb2(++_0x14395a);}(_0xb821,0xa7));var _0x1b82=function(_0x39f058,_0x1912ef){_0x39f058=_0x39f058-0x0;var _0x743df=_0xb821[_0x39f058];return _0x743df;};'use strict';var _=require('lodash');var util=require(_0x1b82('0x0'));var logger=require(_0x1b82('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1b82('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x1b82('0x3'));var config=require(_0x1b82('0x4'));var attributes=require(_0x1b82('0x5'));module[_0x1b82('0x6')]=function(_0x597ca7,_0x3e27c4){return _0x597ca7[_0x1b82('0x7')](_0x1b82('0x8'),attributes,{'tableName':_0x1b82('0x9'),'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 7c27b55..c1d74dc 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 _0xcb39=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5af5c3,_0x205f9b){var _0x5770b1=function(_0x293e50){while(--_0x293e50){_0x5af5c3['push'](_0x5af5c3['shift']());}};_0x5770b1(++_0x205f9b);}(_0xcb39,0x128));var _0x9cb3=function(_0x1b064d,_0x55b3ee){_0x1b064d=_0x1b064d-0x0;var _0x50c8fc=_0xcb39[_0x1b064d];return _0x50c8fc;};'use strict';var _=require(_0x9cb3('0x0'));var util=require(_0x9cb3('0x1'));var moment=require(_0x9cb3('0x2'));var BPromise=require(_0x9cb3('0x3'));var rs=require(_0x9cb3('0x4'));var fs=require('fs');var Redis=require(_0x9cb3('0x5'));var db=require(_0x9cb3('0x6'))['db'];var utils=require(_0x9cb3('0x7'));var logger=require('../../config/logger')(_0x9cb3('0x8'));var config=require(_0x9cb3('0x9'));var jayson=require(_0x9cb3('0xa'));var client=jayson[_0x9cb3('0xb')][_0x9cb3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1716ea,_0x2bdd53,_0xc155a4){return new BPromise(function(_0x36a93b,_0x28b2c2){return client[_0x9cb3('0xd')](_0x1716ea,_0xc155a4)[_0x9cb3('0xe')](function(_0x3c3e82){logger[_0x9cb3('0xf')](_0x9cb3('0x10'),_0x2bdd53,'request\x20sent');logger[_0x9cb3('0x11')](_0x9cb3('0x12'),_0x2bdd53,_0x9cb3('0x13'),JSON[_0x9cb3('0x14')](_0x3c3e82));if(_0x3c3e82[_0x9cb3('0x15')]){if(_0x3c3e82[_0x9cb3('0x15')]['code']===0x1f4){logger['error'](_0x9cb3('0x10'),_0x2bdd53,_0x3c3e82[_0x9cb3('0x15')][_0x9cb3('0x16')]);return _0x28b2c2(_0x3c3e82[_0x9cb3('0x15')][_0x9cb3('0x16')]);}logger[_0x9cb3('0x15')]('Dynamics365Configuration,\x20%s,\x20%s',_0x2bdd53,_0x3c3e82[_0x9cb3('0x15')]['message']);return _0x36a93b(_0x3c3e82[_0x9cb3('0x15')][_0x9cb3('0x16')]);}else{logger[_0x9cb3('0xf')](_0x9cb3('0x10'),_0x2bdd53,_0x9cb3('0x13'));_0x36a93b(_0x3c3e82[_0x9cb3('0x17')][_0x9cb3('0x16')]);}})[_0x9cb3('0x18')](function(_0x5c403a){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x2bdd53,_0x5c403a);_0x28b2c2(_0x5c403a);});});} \ No newline at end of file +var _0x7e7d=['bluebird','randomstring','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x5903ff,_0x53e86a){var _0x5d704b=function(_0x1de582){while(--_0x1de582){_0x5903ff['push'](_0x5903ff['shift']());}};_0x5d704b(++_0x53e86a);}(_0x7e7d,0x96));var _0xd7e7=function(_0x24fad4,_0x507744){_0x24fad4=_0x24fad4-0x0;var _0x296f9d=_0x7e7d[_0x24fad4];return _0x296f9d;};'use strict';var _=require(_0xd7e7('0x0'));var util=require(_0xd7e7('0x1'));var moment=require('moment');var BPromise=require(_0xd7e7('0x2'));var rs=require(_0xd7e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd7e7('0x4'))(_0xd7e7('0x5'));var config=require('../../config/environment');var jayson=require(_0xd7e7('0x6'));var client=jayson[_0xd7e7('0x7')][_0xd7e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa6835e,_0x14e485,_0xcc77a9){return new BPromise(function(_0x1e587a,_0x4e2705){return client[_0xd7e7('0x9')](_0xa6835e,_0xcc77a9)['then'](function(_0x33672d){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x14e485,_0xd7e7('0xa'));logger[_0xd7e7('0xb')](_0xd7e7('0xc'),_0x14e485,_0xd7e7('0xa'),JSON[_0xd7e7('0xd')](_0x33672d));if(_0x33672d[_0xd7e7('0xe')]){if(_0x33672d['error']['code']===0x1f4){logger[_0xd7e7('0xe')](_0xd7e7('0xf'),_0x14e485,_0x33672d[_0xd7e7('0xe')]['message']);return _0x4e2705(_0x33672d[_0xd7e7('0xe')]['message']);}logger['error'](_0xd7e7('0xf'),_0x14e485,_0x33672d[_0xd7e7('0xe')][_0xd7e7('0x10')]);return _0x1e587a(_0x33672d[_0xd7e7('0xe')][_0xd7e7('0x10')]);}else{logger['info'](_0xd7e7('0xf'),_0x14e485,'request\x20sent');_0x1e587a(_0x33672d[_0xd7e7('0x11')]['message']);}})[_0xd7e7('0x12')](function(_0x2fd66a){logger[_0xd7e7('0xe')]('Dynamics365Configuration,\x20%s,\x20%s',_0x14e485,_0x2fd66a);_0x4e2705(_0x2fd66a);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 12f5042..583529c 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 _0x245b=['connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','path'];(function(_0xded127,_0xf1222){var _0x3dfe6e=function(_0x4f59d2){while(--_0x4f59d2){_0xded127['push'](_0xded127['shift']());}};_0x3dfe6e(++_0xf1222);}(_0x245b,0x1dd));var _0xb245=function(_0xc725de,_0x33d1c3){_0xc725de=_0xc725de-0x0;var _0x57164c=_0x245b[_0xc725de];return _0x57164c;};'use strict';var multer=require(_0xb245('0x0'));var util=require(_0xb245('0x1'));var path=require(_0xb245('0x2'));var timeout=require(_0xb245('0x3'));var express=require('express');var router=express[_0xb245('0x4')]();var fs_extra=require(_0xb245('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb245('0x6'));var config=require(_0xb245('0x7'));var controller=require(_0xb245('0x8'));router[_0xb245('0x9')]('/',auth[_0xb245('0xa')](),controller[_0xb245('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb245('0xc')]);router[_0xb245('0xd')]('/',auth[_0xb245('0xa')](),controller[_0xb245('0xe')]);router[_0xb245('0xf')]('/:id',auth[_0xb245('0xa')](),controller[_0xb245('0x10')]);router['delete'](_0xb245('0x11'),auth[_0xb245('0xa')](),controller[_0xb245('0x12')]);module[_0xb245('0x13')]=router; \ No newline at end of file +var _0x125a=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','post','isAuthenticated','create','delete','destroy'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x125a,0x122));var _0xa125=function(_0x50c7d6,_0x43aaed){_0x50c7d6=_0x50c7d6-0x0;var _0x4e1b11=_0x125a[_0x50c7d6];return _0x4e1b11;};'use strict';var multer=require(_0xa125('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa125('0x1'));var express=require(_0xa125('0x2'));var router=express[_0xa125('0x3')]();var fs_extra=require(_0xa125('0x4'));var auth=require(_0xa125('0x5'));var interaction=require(_0xa125('0x6'));var config=require(_0xa125('0x7'));var controller=require('./intDynamics365Field.controller');router[_0xa125('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa125('0x8')](_0xa125('0x9'),auth['isAuthenticated'](),controller[_0xa125('0xa')]);router[_0xa125('0xb')]('/',auth[_0xa125('0xc')](),controller[_0xa125('0xd')]);router['put']('/:id',auth[_0xa125('0xc')](),controller['update']);router[_0xa125('0xe')]('/:id',auth[_0xa125('0xc')](),controller[_0xa125('0xf')]);module[_0xa125('0x10')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 0d4441a..7980d2a 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 _0x0429=['string','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist'];(function(_0x5f52d6,_0x3cfce5){var _0x850007=function(_0x57be5e){while(--_0x57be5e){_0x5f52d6['push'](_0x5f52d6['shift']());}};_0x850007(++_0x3cfce5);}(_0x0429,0x1aa));var _0x9042=function(_0x48c4e8,_0x53b0ba){_0x48c4e8=_0x48c4e8-0x0;var _0x59b655=_0x0429[_0x48c4e8];return _0x59b655;};'use strict';var Sequelize=require(_0x9042('0x0'));module[_0x9042('0x1')]={'type':{'type':Sequelize[_0x9042('0x2')]('string',_0x9042('0x3'),_0x9042('0x4'),'keyValue',_0x9042('0x5')),'defaultValue':_0x9042('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9042('0x7')]},'keyType':{'type':Sequelize[_0x9042('0x2')]('string',_0x9042('0x3'),_0x9042('0x4'))},'keyContent':{'type':Sequelize[_0x9042('0x7')]},'idField':{'type':Sequelize[_0x9042('0x7')]},'nameField':{'type':Sequelize[_0x9042('0x7')]},'customField':{'type':Sequelize[_0x9042('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9042('0x7')]}}; \ No newline at end of file +var _0xd7b3=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','string'];(function(_0x9dc67,_0x4fbf0d){var _0x1ca816=function(_0x54e2f4){while(--_0x54e2f4){_0x9dc67['push'](_0x9dc67['shift']());}};_0x1ca816(++_0x4fbf0d);}(_0xd7b3,0x1d1));var _0x3d7b=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0xd7b3[_0x28ef4e];return _0x1aa097;};'use strict';var Sequelize=require(_0x3d7b('0x0'));module[_0x3d7b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x3d7b('0x2'),_0x3d7b('0x3'),_0x3d7b('0x4'),_0x3d7b('0x5'),_0x3d7b('0x6')),'defaultValue':_0x3d7b('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x3d7b('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3d7b('0x2'),_0x3d7b('0x3'),_0x3d7b('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x3d7b('0x7')]},'nameField':{'type':Sequelize[_0x3d7b('0x7')]},'customField':{'type':Sequelize[_0x3d7b('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3d7b('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 6104046..c31c5ef 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 _0x4a04=['error','name','send','index','map','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Dynamics365Field','then','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','sendStatus'];(function(_0x3dc800,_0x10ae76){var _0x6b1d15=function(_0x10fed7){while(--_0x10fed7){_0x3dc800['push'](_0x3dc800['shift']());}};_0x6b1d15(++_0x10ae76);}(_0x4a04,0xbe));var _0x44a0=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x4a04[_0x5180c3];return _0x55c975;};'use strict';var emlformat=require(_0x44a0('0x0'));var rimraf=require(_0x44a0('0x1'));var zipdir=require(_0x44a0('0x2'));var jsonpatch=require(_0x44a0('0x3'));var rp=require(_0x44a0('0x4'));var moment=require(_0x44a0('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x44a0('0x6'));var util=require(_0x44a0('0x7'));var path=require(_0x44a0('0x8'));var sox=require(_0x44a0('0x9'));var csv=require(_0x44a0('0xa'));var ejs=require(_0x44a0('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44a0('0xc'));var squel=require(_0x44a0('0xd'));var crypto=require('crypto');var jsforce=require(_0x44a0('0xe'));var deskjs=require(_0x44a0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x44a0('0x10'));var Papa=require(_0x44a0('0x11'));var Redis=require(_0x44a0('0x12'));var authService=require(_0x44a0('0x13'));var qs=require(_0x44a0('0x14'));var as=require(_0x44a0('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x44a0('0x16'));var config=require(_0x44a0('0x17'));var licenseUtil=require(_0x44a0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4805dd,_0x4f3ff4){_0x4f3ff4=_0x4f3ff4||0xcc;return function(_0x205a9d){if(_0x205a9d){return _0x4805dd['sendStatus'](_0x4f3ff4);}return _0x4805dd[_0x44a0('0x19')](_0x4f3ff4)['end']();};}function respondWithResult(_0x2c891c,_0x113986){_0x113986=_0x113986||0xc8;return function(_0x56acfd){if(_0x56acfd){return _0x2c891c[_0x44a0('0x19')](_0x113986)['json'](_0x56acfd);}};}function respondWithFilteredResult(_0xb038d1,_0x5ca45b){return function(_0x14e62f){if(_0x14e62f){var _0x105014=typeof _0x5ca45b[_0x44a0('0x1a')]===_0x44a0('0x1b')&&typeof _0x5ca45b[_0x44a0('0x1c')]===_0x44a0('0x1b');var _0x5c0fbb=_0x14e62f[_0x44a0('0x1d')];var _0x1ae98a=_0x105014?0x0:_0x5ca45b[_0x44a0('0x1a')];var _0x1f8a83=_0x105014?_0x14e62f[_0x44a0('0x1d')]:_0x5ca45b[_0x44a0('0x1a')]+_0x5ca45b[_0x44a0('0x1c')];var _0x1df7ee;if(_0x1f8a83>=_0x5c0fbb){_0x1f8a83=_0x5c0fbb;_0x1df7ee=0xc8;}else{_0x1df7ee=0xce;}_0xb038d1[_0x44a0('0x19')](_0x1df7ee);return _0xb038d1[_0x44a0('0x1e')](_0x44a0('0x1f'),_0x1ae98a+'-'+_0x1f8a83+'/'+_0x5c0fbb)[_0x44a0('0x20')](_0x14e62f);}return null;};}function patchUpdates(_0x14dd4d){return function(_0x4e1d8d){try{jsonpatch[_0x44a0('0x21')](_0x4e1d8d,_0x14dd4d,!![]);}catch(_0x242dcc){return BPromise[_0x44a0('0x22')](_0x242dcc);}return _0x4e1d8d['save']();};}function saveUpdates(_0x18aadd,_0x30b748){return function(_0x534fa7){if(_0x534fa7){return _0x534fa7[_0x44a0('0x23')](_0x18aadd)['then'](function(_0x5ac99a){return _0x5ac99a;});}return null;};}function removeEntity(_0x56eae5,_0x5e9358){return function(_0x350b3e){if(_0x350b3e){return _0x350b3e[_0x44a0('0x24')]()['then'](function(){_0x56eae5[_0x44a0('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xafca9e,_0x293a23){return function(_0x16be06){if(!_0x16be06){_0xafca9e[_0x44a0('0x25')](0x194);}return _0x16be06;};}function handleError(_0x55fccf,_0x2cc037){_0x2cc037=_0x2cc037||0x1f4;return function(_0x3a44d6){logger[_0x44a0('0x26')](_0x3a44d6['stack']);if(_0x3a44d6[_0x44a0('0x27')]){delete _0x3a44d6[_0x44a0('0x27')];}_0x55fccf[_0x44a0('0x19')](_0x2cc037)[_0x44a0('0x28')](_0x3a44d6);};}exports[_0x44a0('0x29')]=function(_0x51e62a,_0xea9ab3){var _0x4afe22={},_0x499dcd={},_0x104408={'count':0x0,'rows':[]};var _0x190472=_[_0x44a0('0x2a')](db['Dynamics365Field']['rawAttributes'],function(_0x1590ad){return{'name':_0x1590ad[_0x44a0('0x2b')],'type':_0x1590ad['type'][_0x44a0('0x2c')]};});_0x499dcd[_0x44a0('0x2d')]=_[_0x44a0('0x2a')](_0x190472,'name');_0x499dcd[_0x44a0('0x2e')]=_[_0x44a0('0x2f')](_0x51e62a[_0x44a0('0x2e')]);_0x499dcd['filters']=_[_0x44a0('0x30')](_0x499dcd[_0x44a0('0x2d')],_0x499dcd[_0x44a0('0x2e')]);_0x4afe22['attributes']=_['intersection'](_0x499dcd[_0x44a0('0x2d')],qs[_0x44a0('0x31')](_0x51e62a[_0x44a0('0x2e')]['fields']));_0x4afe22[_0x44a0('0x32')]=_0x4afe22[_0x44a0('0x32')][_0x44a0('0x33')]?_0x4afe22[_0x44a0('0x32')]:_0x499dcd[_0x44a0('0x2d')];if(!_0x51e62a[_0x44a0('0x2e')][_0x44a0('0x34')](_0x44a0('0x35'))){_0x4afe22[_0x44a0('0x1c')]=qs[_0x44a0('0x1c')](_0x51e62a[_0x44a0('0x2e')][_0x44a0('0x1c')]);_0x4afe22['offset']=qs['offset'](_0x51e62a[_0x44a0('0x2e')][_0x44a0('0x1a')]);}_0x4afe22[_0x44a0('0x36')]=qs[_0x44a0('0x37')](_0x51e62a[_0x44a0('0x2e')]['sort']);_0x4afe22[_0x44a0('0x38')]=qs[_0x44a0('0x39')](_[_0x44a0('0x3a')](_0x51e62a[_0x44a0('0x2e')],_0x499dcd[_0x44a0('0x39')]),_0x190472);if(_0x51e62a[_0x44a0('0x2e')][_0x44a0('0x3b')]){_0x4afe22[_0x44a0('0x38')]=_[_0x44a0('0x3c')](_0x4afe22[_0x44a0('0x38')],{'$or':_[_0x44a0('0x2a')](_0x190472,function(_0xd68f70){if(_0xd68f70['type']!==_0x44a0('0x3d')){var _0x4ca100={};_0x4ca100[_0xd68f70[_0x44a0('0x27')]]={'$like':'%'+_0x51e62a['query'][_0x44a0('0x3b')]+'%'};return _0x4ca100;}})});}_0x4afe22=_['merge']({},_0x4afe22,_0x51e62a[_0x44a0('0x3e')]);var _0x5c2b3d={'where':_0x4afe22[_0x44a0('0x38')]};return db[_0x44a0('0x3f')][_0x44a0('0x1d')](_0x5c2b3d)[_0x44a0('0x40')](function(_0x382ccd){_0x104408[_0x44a0('0x1d')]=_0x382ccd;if(_0x51e62a[_0x44a0('0x2e')][_0x44a0('0x41')]){_0x4afe22[_0x44a0('0x42')]=[{'all':!![]}];}return db[_0x44a0('0x3f')][_0x44a0('0x43')](_0x4afe22);})['then'](function(_0xfc4c68){_0x104408[_0x44a0('0x44')]=_0xfc4c68;return _0x104408;})[_0x44a0('0x40')](respondWithFilteredResult(_0xea9ab3,_0x4afe22))['catch'](handleError(_0xea9ab3,null));};exports[_0x44a0('0x45')]=function(_0x1c20fa,_0xf61471){var _0x3fe2c6={'raw':!![],'where':{'id':_0x1c20fa[_0x44a0('0x46')]['id']}},_0x17c557={};_0x17c557['model']=_['keys'](db['Dynamics365Field'][_0x44a0('0x47')]);_0x17c557[_0x44a0('0x2e')]=_[_0x44a0('0x2f')](_0x1c20fa['query']);_0x17c557[_0x44a0('0x39')]=_[_0x44a0('0x30')](_0x17c557[_0x44a0('0x2d')],_0x17c557[_0x44a0('0x2e')]);_0x3fe2c6[_0x44a0('0x32')]=_[_0x44a0('0x30')](_0x17c557['model'],qs[_0x44a0('0x31')](_0x1c20fa[_0x44a0('0x2e')][_0x44a0('0x31')]));_0x3fe2c6[_0x44a0('0x32')]=_0x3fe2c6[_0x44a0('0x32')][_0x44a0('0x33')]?_0x3fe2c6[_0x44a0('0x32')]:_0x17c557[_0x44a0('0x2d')];if(_0x1c20fa['query'][_0x44a0('0x41')]){_0x3fe2c6[_0x44a0('0x42')]=[{'all':!![]}];}_0x3fe2c6=_[_0x44a0('0x3c')]({},_0x3fe2c6,_0x1c20fa[_0x44a0('0x3e')]);return db[_0x44a0('0x3f')][_0x44a0('0x48')](_0x3fe2c6)[_0x44a0('0x40')](handleEntityNotFound(_0xf61471,null))[_0x44a0('0x40')](respondWithResult(_0xf61471,null))[_0x44a0('0x49')](handleError(_0xf61471,null));};exports[_0x44a0('0x4a')]=function(_0x55d144,_0x454aad){return db[_0x44a0('0x3f')][_0x44a0('0x4a')](_0x55d144['body'],{})[_0x44a0('0x40')](respondWithResult(_0x454aad,0xc9))[_0x44a0('0x49')](handleError(_0x454aad,null));};exports[_0x44a0('0x23')]=function(_0x4fa66d,_0x5a7166){if(_0x4fa66d[_0x44a0('0x4b')]['id']){delete _0x4fa66d[_0x44a0('0x4b')]['id'];}return db['Dynamics365Field'][_0x44a0('0x48')]({'where':{'id':_0x4fa66d[_0x44a0('0x46')]['id']}})[_0x44a0('0x40')](handleEntityNotFound(_0x5a7166,null))[_0x44a0('0x40')](saveUpdates(_0x4fa66d['body'],null))[_0x44a0('0x40')](respondWithResult(_0x5a7166,null))[_0x44a0('0x49')](handleError(_0x5a7166,null));};exports[_0x44a0('0x24')]=function(_0x4d2557,_0x16546f){return db[_0x44a0('0x3f')][_0x44a0('0x48')]({'where':{'id':_0x4d2557[_0x44a0('0x46')]['id']}})[_0x44a0('0x40')](handleEntityNotFound(_0x16546f,null))[_0x44a0('0x40')](removeEntity(_0x16546f,null))[_0x44a0('0x49')](handleError(_0x16546f,null));}; \ No newline at end of file +var _0x76bc=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','then','destroy','error','name','index','Dynamics365Field','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis'];(function(_0x46f868,_0x51a8c9){var _0xec84dc=function(_0x311603){while(--_0x311603){_0x46f868['push'](_0x46f868['shift']());}};_0xec84dc(++_0x51a8c9);}(_0x76bc,0x165));var _0xc76b=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0x76bc[_0x3d34da];return _0xcf6af8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc76b('0x0'));var zipdir=require(_0xc76b('0x1'));var jsonpatch=require(_0xc76b('0x2'));var rp=require(_0xc76b('0x3'));var moment=require(_0xc76b('0x4'));var BPromise=require(_0xc76b('0x5'));var Mustache=require(_0xc76b('0x6'));var util=require('util');var path=require(_0xc76b('0x7'));var sox=require(_0xc76b('0x8'));var csv=require(_0xc76b('0x9'));var ejs=require(_0xc76b('0xa'));var fs=require('fs');var fs_extra=require(_0xc76b('0xb'));var _=require(_0xc76b('0xc'));var squel=require(_0xc76b('0xd'));var crypto=require('crypto');var jsforce=require(_0xc76b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc76b('0x9'));var querystring=require(_0xc76b('0xf'));var Papa=require(_0xc76b('0x10'));var Redis=require(_0xc76b('0x11'));var authService=require(_0xc76b('0x12'));var qs=require(_0xc76b('0x13'));var as=require(_0xc76b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc76b('0x15'));var utils=require(_0xc76b('0x16'));var config=require(_0xc76b('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc76b('0x18'))['db'];function respondWithStatusCode(_0x54f4e9,_0x36818d){_0x36818d=_0x36818d||0xcc;return function(_0x275b9c){if(_0x275b9c){return _0x54f4e9[_0xc76b('0x19')](_0x36818d);}return _0x54f4e9[_0xc76b('0x1a')](_0x36818d)[_0xc76b('0x1b')]();};}function respondWithResult(_0x23546a,_0x2758e8){_0x2758e8=_0x2758e8||0xc8;return function(_0x23d87b){if(_0x23d87b){return _0x23546a[_0xc76b('0x1a')](_0x2758e8)[_0xc76b('0x1c')](_0x23d87b);}};}function respondWithFilteredResult(_0x13d5d7,_0x183a9d){return function(_0xae5a3b){if(_0xae5a3b){var _0x408b66=typeof _0x183a9d[_0xc76b('0x1d')]===_0xc76b('0x1e')&&typeof _0x183a9d[_0xc76b('0x1f')]===_0xc76b('0x1e');var _0x46d8b5=_0xae5a3b[_0xc76b('0x20')];var _0x46d96f=_0x408b66?0x0:_0x183a9d[_0xc76b('0x1d')];var _0x3f454a=_0x408b66?_0xae5a3b[_0xc76b('0x20')]:_0x183a9d[_0xc76b('0x1d')]+_0x183a9d[_0xc76b('0x1f')];var _0x4b0a36;if(_0x3f454a>=_0x46d8b5){_0x3f454a=_0x46d8b5;_0x4b0a36=0xc8;}else{_0x4b0a36=0xce;}_0x13d5d7[_0xc76b('0x1a')](_0x4b0a36);return _0x13d5d7[_0xc76b('0x21')](_0xc76b('0x22'),_0x46d96f+'-'+_0x3f454a+'/'+_0x46d8b5)[_0xc76b('0x1c')](_0xae5a3b);}return null;};}function patchUpdates(_0x27b1c3){return function(_0x3ea2fa){try{jsonpatch[_0xc76b('0x23')](_0x3ea2fa,_0x27b1c3,!![]);}catch(_0x5cd6ef){return BPromise['reject'](_0x5cd6ef);}return _0x3ea2fa['save']();};}function saveUpdates(_0x4584dc,_0x207954){return function(_0x4b3adb){if(_0x4b3adb){return _0x4b3adb['update'](_0x4584dc)[_0xc76b('0x24')](function(_0x4d3fba){return _0x4d3fba;});}return null;};}function removeEntity(_0x12e494,_0xa64c0f){return function(_0x857579){if(_0x857579){return _0x857579[_0xc76b('0x25')]()[_0xc76b('0x24')](function(){_0x12e494['status'](0xcc)[_0xc76b('0x1b')]();});}};}function handleEntityNotFound(_0xd9feca,_0x40a8cd){return function(_0x6ecbfd){if(!_0x6ecbfd){_0xd9feca[_0xc76b('0x19')](0x194);}return _0x6ecbfd;};}function handleError(_0x18e136,_0x436f9c){_0x436f9c=_0x436f9c||0x1f4;return function(_0x1b99f2){logger[_0xc76b('0x26')](_0x1b99f2['stack']);if(_0x1b99f2[_0xc76b('0x27')]){delete _0x1b99f2['name'];}_0x18e136[_0xc76b('0x1a')](_0x436f9c)['send'](_0x1b99f2);};}exports[_0xc76b('0x28')]=function(_0x10e90c,_0x28f32a){var _0x4c6ca8={},_0x1b2f4a={},_0x48ad8a={'count':0x0,'rows':[]};var _0xa67b24=_['map'](db[_0xc76b('0x29')][_0xc76b('0x2a')],function(_0x8c0c34){return{'name':_0x8c0c34[_0xc76b('0x2b')],'type':_0x8c0c34[_0xc76b('0x2c')]['key']};});_0x1b2f4a['model']=_[_0xc76b('0x2d')](_0xa67b24,_0xc76b('0x27'));_0x1b2f4a[_0xc76b('0x2e')]=_[_0xc76b('0x2f')](_0x10e90c['query']);_0x1b2f4a[_0xc76b('0x30')]=_[_0xc76b('0x31')](_0x1b2f4a[_0xc76b('0x32')],_0x1b2f4a[_0xc76b('0x2e')]);_0x4c6ca8[_0xc76b('0x33')]=_[_0xc76b('0x31')](_0x1b2f4a[_0xc76b('0x32')],qs[_0xc76b('0x34')](_0x10e90c[_0xc76b('0x2e')]['fields']));_0x4c6ca8[_0xc76b('0x33')]=_0x4c6ca8['attributes'][_0xc76b('0x35')]?_0x4c6ca8['attributes']:_0x1b2f4a['model'];if(!_0x10e90c[_0xc76b('0x2e')][_0xc76b('0x36')](_0xc76b('0x37'))){_0x4c6ca8[_0xc76b('0x1f')]=qs[_0xc76b('0x1f')](_0x10e90c[_0xc76b('0x2e')][_0xc76b('0x1f')]);_0x4c6ca8[_0xc76b('0x1d')]=qs[_0xc76b('0x1d')](_0x10e90c[_0xc76b('0x2e')][_0xc76b('0x1d')]);}_0x4c6ca8[_0xc76b('0x38')]=qs[_0xc76b('0x39')](_0x10e90c[_0xc76b('0x2e')][_0xc76b('0x39')]);_0x4c6ca8['where']=qs[_0xc76b('0x30')](_[_0xc76b('0x3a')](_0x10e90c[_0xc76b('0x2e')],_0x1b2f4a[_0xc76b('0x30')]),_0xa67b24);if(_0x10e90c[_0xc76b('0x2e')][_0xc76b('0x3b')]){_0x4c6ca8[_0xc76b('0x3c')]=_[_0xc76b('0x3d')](_0x4c6ca8[_0xc76b('0x3c')],{'$or':_[_0xc76b('0x2d')](_0xa67b24,function(_0x3e8a4a){if(_0x3e8a4a[_0xc76b('0x2c')]!==_0xc76b('0x3e')){var _0x1dedc9={};_0x1dedc9[_0x3e8a4a[_0xc76b('0x27')]]={'$like':'%'+_0x10e90c[_0xc76b('0x2e')][_0xc76b('0x3b')]+'%'};return _0x1dedc9;}})});}_0x4c6ca8=_[_0xc76b('0x3d')]({},_0x4c6ca8,_0x10e90c[_0xc76b('0x3f')]);var _0xefd2f0={'where':_0x4c6ca8[_0xc76b('0x3c')]};return db['Dynamics365Field'][_0xc76b('0x20')](_0xefd2f0)['then'](function(_0x4dd459){_0x48ad8a[_0xc76b('0x20')]=_0x4dd459;if(_0x10e90c[_0xc76b('0x2e')][_0xc76b('0x40')]){_0x4c6ca8[_0xc76b('0x41')]=[{'all':!![]}];}return db[_0xc76b('0x29')][_0xc76b('0x42')](_0x4c6ca8);})[_0xc76b('0x24')](function(_0x51fdc2){_0x48ad8a[_0xc76b('0x43')]=_0x51fdc2;return _0x48ad8a;})[_0xc76b('0x24')](respondWithFilteredResult(_0x28f32a,_0x4c6ca8))['catch'](handleError(_0x28f32a,null));};exports[_0xc76b('0x44')]=function(_0x6030a8,_0x37c0a5){var _0x4466fe={'raw':!![],'where':{'id':_0x6030a8[_0xc76b('0x45')]['id']}},_0x5a7220={};_0x5a7220[_0xc76b('0x32')]=_[_0xc76b('0x2f')](db[_0xc76b('0x29')]['rawAttributes']);_0x5a7220[_0xc76b('0x2e')]=_['keys'](_0x6030a8['query']);_0x5a7220['filters']=_[_0xc76b('0x31')](_0x5a7220[_0xc76b('0x32')],_0x5a7220[_0xc76b('0x2e')]);_0x4466fe[_0xc76b('0x33')]=_[_0xc76b('0x31')](_0x5a7220[_0xc76b('0x32')],qs[_0xc76b('0x34')](_0x6030a8[_0xc76b('0x2e')][_0xc76b('0x34')]));_0x4466fe[_0xc76b('0x33')]=_0x4466fe[_0xc76b('0x33')][_0xc76b('0x35')]?_0x4466fe[_0xc76b('0x33')]:_0x5a7220[_0xc76b('0x32')];if(_0x6030a8[_0xc76b('0x2e')][_0xc76b('0x40')]){_0x4466fe[_0xc76b('0x41')]=[{'all':!![]}];}_0x4466fe=_['merge']({},_0x4466fe,_0x6030a8[_0xc76b('0x3f')]);return db['Dynamics365Field'][_0xc76b('0x46')](_0x4466fe)[_0xc76b('0x24')](handleEntityNotFound(_0x37c0a5,null))[_0xc76b('0x24')](respondWithResult(_0x37c0a5,null))[_0xc76b('0x47')](handleError(_0x37c0a5,null));};exports[_0xc76b('0x48')]=function(_0x118f58,_0x5e1230){return db[_0xc76b('0x29')][_0xc76b('0x48')](_0x118f58[_0xc76b('0x49')],{})['then'](respondWithResult(_0x5e1230,0xc9))[_0xc76b('0x47')](handleError(_0x5e1230,null));};exports[_0xc76b('0x4a')]=function(_0x351765,_0xfc7b04){if(_0x351765[_0xc76b('0x49')]['id']){delete _0x351765[_0xc76b('0x49')]['id'];}return db[_0xc76b('0x29')][_0xc76b('0x46')]({'where':{'id':_0x351765['params']['id']}})[_0xc76b('0x24')](handleEntityNotFound(_0xfc7b04,null))[_0xc76b('0x24')](saveUpdates(_0x351765[_0xc76b('0x49')],null))[_0xc76b('0x24')](respondWithResult(_0xfc7b04,null))['catch'](handleError(_0xfc7b04,null));};exports[_0xc76b('0x25')]=function(_0x285afa,_0x15bf40){return db['Dynamics365Field']['find']({'where':{'id':_0x285afa['params']['id']}})['then'](handleEntityNotFound(_0x15bf40,null))[_0xc76b('0x24')](removeEntity(_0x15bf40,null))['catch'](handleError(_0x15bf40,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 498efdc..1b948cc 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 _0x06e0=['util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x06e0,0xa7));var _0x006e=function(_0x2e4b84,_0x2092ce){_0x2e4b84=_0x2e4b84-0x0;var _0x38af1e=_0x06e0[_0x2e4b84];return _0x38af1e;};'use strict';var _=require(_0x006e('0x0'));var util=require(_0x006e('0x1'));var logger=require('../../config/logger')(_0x006e('0x2'));var moment=require(_0x006e('0x3'));var BPromise=require(_0x006e('0x4'));var rp=require(_0x006e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x006e('0x6'));var config=require(_0x006e('0x7'));var attributes=require('./intDynamics365Field.attributes');module[_0x006e('0x8')]=function(_0x231321,_0x158b30){return _0x231321[_0x006e('0x9')](_0x006e('0xa'),attributes,{'tableName':_0x006e('0xb'),'paranoid':![],'indexes':[{'name':_0x006e('0xc'),'fields':['idField',_0x006e('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x694c=['moment','bluebird','request-promise','../../config/environment','define','Dynamics365Field','int_dynamics365_fields','idField','lodash','../../config/logger','api'];(function(_0xf04b83,_0x399c28){var _0x3d15eb=function(_0x3b554d){while(--_0x3b554d){_0xf04b83['push'](_0xf04b83['shift']());}};_0x3d15eb(++_0x399c28);}(_0x694c,0x1ec));var _0xc694=function(_0x576b09,_0x5d51c0){_0x576b09=_0x576b09-0x0;var _0x404ad6=_0x694c[_0x576b09];return _0x404ad6;};'use strict';var _=require(_0xc694('0x0'));var util=require('util');var logger=require(_0xc694('0x1'))(_0xc694('0x2'));var moment=require(_0xc694('0x3'));var BPromise=require(_0xc694('0x4'));var rp=require(_0xc694('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc694('0x6'));var attributes=require('./intDynamics365Field.attributes');module['exports']=function(_0x32ad6a,_0x247d73){return _0x32ad6a[_0xc694('0x7')](_0xc694('0x8'),attributes,{'tableName':_0xc694('0x9'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xc694('0xa'),'FieldId'],'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 e6f11bc..29367c7 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 _0xa047=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x46e908,_0x3e3235){var _0x4115ea=function(_0x2cb512){while(--_0x2cb512){_0x46e908['push'](_0x46e908['shift']());}};_0x4115ea(++_0x3e3235);}(_0xa047,0x180));var _0x7a04=function(_0x3e32a8,_0x255953){_0x3e32a8=_0x3e32a8-0x0;var _0x2997b0=_0xa047[_0x3e32a8];return _0x2997b0;};'use strict';var _=require('lodash');var util=require(_0x7a04('0x0'));var moment=require(_0x7a04('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a04('0x2'));var fs=require('fs');var Redis=require(_0x7a04('0x3'));var db=require(_0x7a04('0x4'))['db'];var utils=require(_0x7a04('0x5'));var logger=require('../../config/logger')(_0x7a04('0x6'));var config=require(_0x7a04('0x7'));var jayson=require(_0x7a04('0x8'));var client=jayson['client'][_0x7a04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54b9ee,_0x3dc409,_0x52138b){return new BPromise(function(_0x37fa9f,_0x93c630){return client['request'](_0x54b9ee,_0x52138b)[_0x7a04('0xa')](function(_0x144fca){logger[_0x7a04('0xb')](_0x7a04('0xc'),_0x3dc409,_0x7a04('0xd'));logger[_0x7a04('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x3dc409,'request\x20sent',JSON[_0x7a04('0xf')](_0x144fca));if(_0x144fca[_0x7a04('0x10')]){if(_0x144fca[_0x7a04('0x10')][_0x7a04('0x11')]===0x1f4){logger[_0x7a04('0x10')](_0x7a04('0xc'),_0x3dc409,_0x144fca['error'][_0x7a04('0x12')]);return _0x93c630(_0x144fca['error'][_0x7a04('0x12')]);}logger[_0x7a04('0x10')](_0x7a04('0xc'),_0x3dc409,_0x144fca[_0x7a04('0x10')][_0x7a04('0x12')]);return _0x37fa9f(_0x144fca[_0x7a04('0x10')]['message']);}else{logger['info'](_0x7a04('0xc'),_0x3dc409,_0x7a04('0xd'));_0x37fa9f(_0x144fca[_0x7a04('0x13')][_0x7a04('0x12')]);}})[_0x7a04('0x14')](function(_0x2eb537){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3dc409,_0x2eb537);_0x93c630(_0x2eb537);});});} \ No newline at end of file +var _0x2ca4=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2ca4,0x146));var _0x42ca=function(_0x1ae491,_0x5b83b9){_0x1ae491=_0x1ae491-0x0;var _0x4958a5=_0x2ca4[_0x1ae491];return _0x4958a5;};'use strict';var _=require(_0x42ca('0x0'));var util=require(_0x42ca('0x1'));var moment=require(_0x42ca('0x2'));var BPromise=require(_0x42ca('0x3'));var rs=require(_0x42ca('0x4'));var fs=require('fs');var Redis=require(_0x42ca('0x5'));var db=require(_0x42ca('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x42ca('0x7'))(_0x42ca('0x8'));var config=require(_0x42ca('0x9'));var jayson=require(_0x42ca('0xa'));var client=jayson[_0x42ca('0xb')][_0x42ca('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c5266,_0xd60bc7,_0x344205){return new BPromise(function(_0x41d3c6,_0x23bed7){return client[_0x42ca('0xd')](_0x5c5266,_0x344205)[_0x42ca('0xe')](function(_0x4f1ed3){logger[_0x42ca('0xf')](_0x42ca('0x10'),_0xd60bc7,_0x42ca('0x11'));logger[_0x42ca('0x12')](_0x42ca('0x13'),_0xd60bc7,_0x42ca('0x11'),JSON['stringify'](_0x4f1ed3));if(_0x4f1ed3[_0x42ca('0x14')]){if(_0x4f1ed3[_0x42ca('0x14')][_0x42ca('0x15')]===0x1f4){logger[_0x42ca('0x14')](_0x42ca('0x10'),_0xd60bc7,_0x4f1ed3[_0x42ca('0x14')]['message']);return _0x23bed7(_0x4f1ed3[_0x42ca('0x14')][_0x42ca('0x16')]);}logger[_0x42ca('0x14')](_0x42ca('0x10'),_0xd60bc7,_0x4f1ed3[_0x42ca('0x14')][_0x42ca('0x16')]);return _0x41d3c6(_0x4f1ed3[_0x42ca('0x14')][_0x42ca('0x16')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0xd60bc7,_0x42ca('0x11'));_0x41d3c6(_0x4f1ed3[_0x42ca('0x17')]['message']);}})[_0x42ca('0x18')](function(_0x2f2d22){logger['error'](_0x42ca('0x10'),_0xd60bc7,_0x2f2d22);_0x23bed7(_0x2f2d22);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index ca5d870..dcc9ad9 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 _0x6c84=['/:id/configurations','post','addConfiguration','put','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x178dbf,_0x30b918){var _0x2229ae=function(_0x378e98){while(--_0x378e98){_0x178dbf['push'](_0x178dbf['shift']());}};_0x2229ae(++_0x30b918);}(_0x6c84,0x8c));var _0x46c8=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x6c84[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require(_0x46c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x46c8('0x1'));var express=require(_0x46c8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x46c8('0x3'));var interaction=require(_0x46c8('0x4'));var config=require(_0x46c8('0x5'));var controller=require('./intFreshdeskAccount.controller');router[_0x46c8('0x6')]('/',auth[_0x46c8('0x7')](),controller['index']);router[_0x46c8('0x6')](_0x46c8('0x8'),auth[_0x46c8('0x7')](),controller[_0x46c8('0x9')]);router[_0x46c8('0x6')](_0x46c8('0xa'),auth[_0x46c8('0x7')](),controller['getConfigurations']);router[_0x46c8('0x6')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x46c8('0xb')]('/',auth[_0x46c8('0x7')](),controller['create']);router[_0x46c8('0xb')]('/:id/configurations',auth[_0x46c8('0x7')](),controller[_0x46c8('0xc')]);router[_0x46c8('0xd')](_0x46c8('0x8'),auth[_0x46c8('0x7')](),controller['update']);router['delete'](_0x46c8('0x8'),auth[_0x46c8('0x7')](),controller['destroy']);module[_0x46c8('0xe')]=router; \ No newline at end of file +var _0xaad2=['multer','path','Router','fs-extra','../../components/interaction/service','isAuthenticated','get','/:id','show','/:id/configurations','post','create','put','update','delete','exports'];(function(_0x110f00,_0x541993){var _0x58c40e=function(_0x4e6307){while(--_0x4e6307){_0x110f00['push'](_0x110f00['shift']());}};_0x58c40e(++_0x541993);}(_0xaad2,0x70));var _0x2aad=function(_0x4551f6,_0x48151b){_0x4551f6=_0x4551f6-0x0;var _0x581dc2=_0xaad2[_0x4551f6];return _0x581dc2;};'use strict';var multer=require(_0x2aad('0x0'));var util=require('util');var path=require(_0x2aad('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2aad('0x2')]();var fs_extra=require(_0x2aad('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2aad('0x4'));var config=require('../../config/environment');var controller=require('./intFreshdeskAccount.controller');router['get']('/',auth[_0x2aad('0x5')](),controller['index']);router[_0x2aad('0x6')](_0x2aad('0x7'),auth[_0x2aad('0x5')](),controller[_0x2aad('0x8')]);router[_0x2aad('0x6')](_0x2aad('0x9'),auth[_0x2aad('0x5')](),controller['getConfigurations']);router[_0x2aad('0x6')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x2aad('0xa')]('/',auth[_0x2aad('0x5')](),controller[_0x2aad('0xb')]);router[_0x2aad('0xa')](_0x2aad('0x9'),auth[_0x2aad('0x5')](),controller['addConfiguration']);router[_0x2aad('0xc')](_0x2aad('0x7'),auth[_0x2aad('0x5')](),controller[_0x2aad('0xd')]);router[_0x2aad('0xe')](_0x2aad('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0x2aad('0xf')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 22d51d1..e48416e 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 _0x6d38=['exports','STRING','remoteUri'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x6d38,0x1ef));var _0x86d3=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x6d38[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require('sequelize');module[_0x86d3('0x0')]={'name':{'type':Sequelize[_0x86d3('0x1')]},'description':{'type':Sequelize[_0x86d3('0x1')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'apiKey':{'type':Sequelize[_0x86d3('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x86d3('0x2')},'serverUrl':{'type':Sequelize[_0x86d3('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3266=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3518ab,_0x2c52de){var _0x33eba8=function(_0x105df7){while(--_0x105df7){_0x3518ab['push'](_0x3518ab['shift']());}};_0x33eba8(++_0x2c52de);}(_0x3266,0x6a));var _0x6326=function(_0x119705,_0xba9427){_0x119705=_0x119705-0x0;var _0x2affc2=_0x3266[_0x119705];return _0x2affc2;};'use strict';var Sequelize=require(_0x6326('0x0'));module[_0x6326('0x1')]={'name':{'type':Sequelize[_0x6326('0x2')]},'description':{'type':Sequelize[_0x6326('0x2')]},'username':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x3')},'apiKey':{'type':Sequelize[_0x6326('0x2')]},'remoteUri':{'type':Sequelize[_0x6326('0x2')],'unique':_0x6326('0x4')},'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 d1c6e77..b2f746c 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 _0x1cc3=['pick','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','description','priority','group','source','remove','includes','default','custom_text','custom_dropdown','choices','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','error','stack','name','send','index','FreshdeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','nolimit','order','sort','where','filters','filter','merge','options','then','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','FreshdeskConfiguration','length'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0x1cc3,0x11b));var _0x31cc=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1cc3[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x31cc('0x0'));var rimraf=require(_0x31cc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x31cc('0x2'));var rp=require('request-promise');var moment=require(_0x31cc('0x3'));var BPromise=require(_0x31cc('0x4'));var Mustache=require(_0x31cc('0x5'));var util=require('util');var path=require(_0x31cc('0x6'));var sox=require(_0x31cc('0x7'));var csv=require(_0x31cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x31cc('0x9'));var _=require(_0x31cc('0xa'));var squel=require(_0x31cc('0xb'));var crypto=require(_0x31cc('0xc'));var jsforce=require(_0x31cc('0xd'));var deskjs=require(_0x31cc('0xe'));var toCsv=require(_0x31cc('0x8'));var querystring=require(_0x31cc('0xf'));var Papa=require(_0x31cc('0x10'));var Redis=require('ioredis');var authService=require(_0x31cc('0x11'));var qs=require(_0x31cc('0x12'));var as=require(_0x31cc('0x13'));var hardwareService=require(_0x31cc('0x14'));var logger=require(_0x31cc('0x15'))(_0x31cc('0x16'));var utils=require(_0x31cc('0x17'));var config=require(_0x31cc('0x18'));var licenseUtil=require(_0x31cc('0x19'));var db=require(_0x31cc('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x11ce41,_0x1b939e){_0x1b939e=_0x1b939e||0xcc;return function(_0x4a26dc){if(_0x4a26dc){return _0x11ce41[_0x31cc('0x1b')](_0x1b939e);}return _0x11ce41[_0x31cc('0x1c')](_0x1b939e)[_0x31cc('0x1d')]();};}function respondWithResult(_0x34b164,_0x10738a){_0x10738a=_0x10738a||0xc8;return function(_0x118bb0){if(_0x118bb0){return _0x34b164[_0x31cc('0x1c')](_0x10738a)[_0x31cc('0x1e')](_0x118bb0);}};}function respondWithFilteredResult(_0x1227ad,_0xc22d83){return function(_0x171917){if(_0x171917){var _0x5b970e=typeof _0xc22d83[_0x31cc('0x1f')]===_0x31cc('0x20')&&typeof _0xc22d83[_0x31cc('0x21')]==='undefined';var _0x2908cd=_0x171917[_0x31cc('0x22')];var _0x56f18e=_0x5b970e?0x0:_0xc22d83[_0x31cc('0x1f')];var _0x3a9a53=_0x5b970e?_0x171917[_0x31cc('0x22')]:_0xc22d83[_0x31cc('0x1f')]+_0xc22d83[_0x31cc('0x21')];var _0x4a5d34;if(_0x3a9a53>=_0x2908cd){_0x3a9a53=_0x2908cd;_0x4a5d34=0xc8;}else{_0x4a5d34=0xce;}_0x1227ad[_0x31cc('0x1c')](_0x4a5d34);return _0x1227ad[_0x31cc('0x23')](_0x31cc('0x24'),_0x56f18e+'-'+_0x3a9a53+'/'+_0x2908cd)[_0x31cc('0x1e')](_0x171917);}return null;};}function patchUpdates(_0x1e3039){return function(_0x3c0db5){try{jsonpatch[_0x31cc('0x25')](_0x3c0db5,_0x1e3039,!![]);}catch(_0x43c769){return BPromise['reject'](_0x43c769);}return _0x3c0db5[_0x31cc('0x26')]();};}function saveUpdates(_0x34dccf,_0xbe2be8){return function(_0x5c2248){if(_0x5c2248){return _0x5c2248[_0x31cc('0x27')](_0x34dccf)['then'](function(_0x408c4d){return _0x408c4d;});}return null;};}function removeEntity(_0x5c86da,_0x39dd8e){return function(_0x4ebeb7){if(_0x4ebeb7){return _0x4ebeb7[_0x31cc('0x28')]()['then'](function(){_0x5c86da[_0x31cc('0x1c')](0xcc)[_0x31cc('0x1d')]();});}};}function handleEntityNotFound(_0x482e67,_0x1c48ef){return function(_0x57862d){if(!_0x57862d){_0x482e67[_0x31cc('0x1b')](0x194);}return _0x57862d;};}function handleError(_0x4da7ee,_0x2edaff){_0x2edaff=_0x2edaff||0x1f4;return function(_0x5a51ff){logger[_0x31cc('0x29')](_0x5a51ff[_0x31cc('0x2a')]);if(_0x5a51ff[_0x31cc('0x2b')]){delete _0x5a51ff[_0x31cc('0x2b')];}_0x4da7ee[_0x31cc('0x1c')](_0x2edaff)[_0x31cc('0x2c')](_0x5a51ff);};}exports[_0x31cc('0x2d')]=function(_0x485a64,_0x56d618){var _0x1c21ea={},_0x3ea677={},_0x1c897e={'count':0x0,'rows':[]};var _0xca940f=_['map'](db[_0x31cc('0x2e')][_0x31cc('0x2f')],function(_0xd8108d){return{'name':_0xd8108d[_0x31cc('0x30')],'type':_0xd8108d[_0x31cc('0x31')][_0x31cc('0x32')]};});_0x3ea677[_0x31cc('0x33')]=_[_0x31cc('0x34')](_0xca940f,_0x31cc('0x2b'));_0x3ea677[_0x31cc('0x35')]=_[_0x31cc('0x36')](_0x485a64[_0x31cc('0x35')]);_0x3ea677['filters']=_[_0x31cc('0x37')](_0x3ea677[_0x31cc('0x33')],_0x3ea677['query']);_0x1c21ea[_0x31cc('0x38')]=_[_0x31cc('0x37')](_0x3ea677[_0x31cc('0x33')],qs['fields'](_0x485a64[_0x31cc('0x35')][_0x31cc('0x39')]));_0x1c21ea[_0x31cc('0x38')]=_0x1c21ea[_0x31cc('0x38')]['length']?_0x1c21ea[_0x31cc('0x38')]:_0x3ea677[_0x31cc('0x33')];if(!_0x485a64['query']['hasOwnProperty'](_0x31cc('0x3a'))){_0x1c21ea[_0x31cc('0x21')]=qs[_0x31cc('0x21')](_0x485a64['query']['limit']);_0x1c21ea[_0x31cc('0x1f')]=qs[_0x31cc('0x1f')](_0x485a64[_0x31cc('0x35')]['offset']);}_0x1c21ea[_0x31cc('0x3b')]=qs[_0x31cc('0x3c')](_0x485a64[_0x31cc('0x35')][_0x31cc('0x3c')]);_0x1c21ea[_0x31cc('0x3d')]=qs['filters'](_['pick'](_0x485a64[_0x31cc('0x35')],_0x3ea677[_0x31cc('0x3e')]),_0xca940f);if(_0x485a64[_0x31cc('0x35')][_0x31cc('0x3f')]){_0x1c21ea[_0x31cc('0x3d')]=_[_0x31cc('0x40')](_0x1c21ea[_0x31cc('0x3d')],{'$or':_[_0x31cc('0x34')](_0xca940f,function(_0x3e3202){if(_0x3e3202[_0x31cc('0x31')]!=='VIRTUAL'){var _0x1d3e42={};_0x1d3e42[_0x3e3202['name']]={'$like':'%'+_0x485a64['query'][_0x31cc('0x3f')]+'%'};return _0x1d3e42;}})});}_0x1c21ea=_[_0x31cc('0x40')]({},_0x1c21ea,_0x485a64[_0x31cc('0x41')]);var _0x233c00={'where':_0x1c21ea[_0x31cc('0x3d')]};return db['FreshdeskAccount']['count'](_0x233c00)[_0x31cc('0x42')](function(_0x378d35){_0x1c897e[_0x31cc('0x22')]=_0x378d35;if(_0x485a64[_0x31cc('0x35')][_0x31cc('0x43')]){_0x1c21ea[_0x31cc('0x44')]=[{'all':!![]}];}return db[_0x31cc('0x2e')][_0x31cc('0x45')](_0x1c21ea);})[_0x31cc('0x42')](function(_0x3cdcdf){_0x1c897e[_0x31cc('0x46')]=_0x3cdcdf;return _0x1c897e;})[_0x31cc('0x42')](respondWithFilteredResult(_0x56d618,_0x1c21ea))['catch'](handleError(_0x56d618,null));};exports[_0x31cc('0x47')]=function(_0x337756,_0x4ec973){var _0x2ef3c8={'raw':![],'where':{'id':_0x337756[_0x31cc('0x48')]['id']}},_0x4cd149={};_0x4cd149[_0x31cc('0x33')]=_[_0x31cc('0x36')](db[_0x31cc('0x2e')][_0x31cc('0x2f')]);_0x4cd149[_0x31cc('0x35')]=_[_0x31cc('0x36')](_0x337756[_0x31cc('0x35')]);_0x4cd149[_0x31cc('0x3e')]=_['intersection'](_0x4cd149[_0x31cc('0x33')],_0x4cd149[_0x31cc('0x35')]);_0x2ef3c8['attributes']=_[_0x31cc('0x37')](_0x4cd149[_0x31cc('0x33')],qs[_0x31cc('0x39')](_0x337756['query'][_0x31cc('0x39')]));_0x2ef3c8['attributes']=_0x2ef3c8['attributes']['length']?_0x2ef3c8[_0x31cc('0x38')]:_0x4cd149[_0x31cc('0x33')];if(_0x337756[_0x31cc('0x35')][_0x31cc('0x43')]){_0x2ef3c8[_0x31cc('0x44')]=[{'all':!![]}];}_0x2ef3c8=_[_0x31cc('0x40')]({},_0x2ef3c8,_0x337756[_0x31cc('0x41')]);return db[_0x31cc('0x2e')]['find'](_0x2ef3c8)[_0x31cc('0x42')](handleEntityNotFound(_0x4ec973,null))['then'](respondWithResult(_0x4ec973,null))[_0x31cc('0x49')](handleError(_0x4ec973,null));};exports[_0x31cc('0x4a')]=function(_0x3bf96d,_0x2e16f2){return db['FreshdeskAccount'][_0x31cc('0x4a')](_0x3bf96d[_0x31cc('0x4b')],{})[_0x31cc('0x42')](respondWithResult(_0x2e16f2,0xc9))[_0x31cc('0x49')](handleError(_0x2e16f2,null));};exports['update']=function(_0x23aff5,_0x4a6eab){if(_0x23aff5[_0x31cc('0x4b')]['id']){delete _0x23aff5[_0x31cc('0x4b')]['id'];}return db[_0x31cc('0x2e')][_0x31cc('0x4c')]({'where':{'id':_0x23aff5[_0x31cc('0x48')]['id']}})['then'](handleEntityNotFound(_0x4a6eab,null))[_0x31cc('0x42')](saveUpdates(_0x23aff5[_0x31cc('0x4b')],null))[_0x31cc('0x42')](respondWithResult(_0x4a6eab,null))[_0x31cc('0x49')](handleError(_0x4a6eab,null));};exports[_0x31cc('0x28')]=function(_0x3eb77b,_0x438a0b){return db[_0x31cc('0x2e')]['find']({'where':{'id':_0x3eb77b[_0x31cc('0x48')]['id']}})[_0x31cc('0x42')](handleEntityNotFound(_0x438a0b,null))['then'](removeEntity(_0x438a0b,null))[_0x31cc('0x49')](handleError(_0x438a0b,null));};exports[_0x31cc('0x4d')]=function(_0x2117e7,_0xd47299,_0x136b9a){var _0x5a3418={};var _0x19835b={};var _0x20cbe4;var _0x5ed0cd;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x2117e7[_0x31cc('0x48')]['id']}})['then'](handleEntityNotFound(_0xd47299,null))[_0x31cc('0x42')](function(_0x6ccb1){if(_0x6ccb1){_0x20cbe4=_0x6ccb1;_0x19835b['model']=_[_0x31cc('0x36')](db[_0x31cc('0x4e')]['rawAttributes']);_0x19835b[_0x31cc('0x35')]=_[_0x31cc('0x36')](_0x2117e7[_0x31cc('0x35')]);_0x19835b[_0x31cc('0x3e')]=_[_0x31cc('0x37')](_0x19835b[_0x31cc('0x33')],_0x19835b[_0x31cc('0x35')]);_0x5a3418[_0x31cc('0x38')]=_[_0x31cc('0x37')](_0x19835b[_0x31cc('0x33')],qs[_0x31cc('0x39')](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x39')]));_0x5a3418['attributes']=_0x5a3418[_0x31cc('0x38')][_0x31cc('0x4f')]?_0x5a3418['attributes']:_0x19835b[_0x31cc('0x33')];_0x5a3418[_0x31cc('0x3b')]=qs[_0x31cc('0x3c')](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x3c')]);_0x5a3418[_0x31cc('0x3d')]=qs[_0x31cc('0x3e')](_[_0x31cc('0x50')](_0x2117e7[_0x31cc('0x35')],_0x19835b['filters']));if(_0x2117e7[_0x31cc('0x35')][_0x31cc('0x3f')]){_0x5a3418[_0x31cc('0x3d')]=_[_0x31cc('0x40')](_0x5a3418[_0x31cc('0x3d')],{'$or':_[_0x31cc('0x34')](_0x5a3418[_0x31cc('0x38')],function(_0x36df68){var _0x14c68c={};_0x14c68c[_0x36df68]={'$like':'%'+_0x2117e7['query']['filter']+'%'};return _0x14c68c;})});}_0x5a3418=_[_0x31cc('0x40')]({},_0x5a3418,_0x2117e7[_0x31cc('0x41')]);return _0x20cbe4['getConfigurations'](_0x5a3418);}})[_0x31cc('0x42')](function(_0x265493){if(_0x265493){_0x5ed0cd=_0x265493[_0x31cc('0x4f')];if(!_0x2117e7['query'][_0x31cc('0x51')](_0x31cc('0x3a'))){_0x5a3418[_0x31cc('0x21')]=qs['limit'](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x21')]);_0x5a3418['offset']=qs['offset'](_0x2117e7[_0x31cc('0x35')][_0x31cc('0x1f')]);}return _0x20cbe4[_0x31cc('0x4d')](_0x5a3418);}})[_0x31cc('0x42')](function(_0x196f51){if(_0x196f51){return _0x196f51?{'count':_0x5ed0cd,'rows':_0x196f51}:null;}})[_0x31cc('0x42')](respondWithResult(_0xd47299,null))['catch'](handleError(_0xd47299,null));};exports[_0x31cc('0x52')]=function(_0x6114e8,_0x36a055,_0xe22a0d){if(_0x6114e8[_0x31cc('0x4b')]['id']){delete _0x6114e8[_0x31cc('0x4b')]['id'];}return db['FreshdeskAccount'][_0x31cc('0x53')]({'where':{'id':_0x6114e8[_0x31cc('0x48')]['id']}})[_0x31cc('0x42')](handleEntityNotFound(_0x36a055,null))['then'](function(_0x200a4f){if(_0x200a4f){_0x6114e8[_0x31cc('0x4b')][_0x31cc('0x54')]=_0x200a4f['id'];_0x6114e8['body'][_0x31cc('0x55')]=integrations[_0x31cc('0x56')](_0x6114e8[_0x31cc('0x4b')]['channel'],_0x6114e8[_0x31cc('0x4b')][_0x31cc('0x31')]);_0x6114e8[_0x31cc('0x4b')][_0x31cc('0x57')]=integrations[_0x31cc('0x58')](_0x6114e8['body'][_0x31cc('0x59')],_0x6114e8['body'][_0x31cc('0x31')]);return db['FreshdeskConfiguration'][_0x31cc('0x4a')](_0x6114e8[_0x31cc('0x4b')],{'include':[{'model':db[_0x31cc('0x5a')],'as':_0x31cc('0x55')},{'model':db[_0x31cc('0x5a')],'as':_0x31cc('0x57')}]});}return null;})[_0x31cc('0x42')](respondWithResult(_0x36a055,null))['catch'](handleError(_0x36a055,null));};exports['getFields']=function(_0x7b6d6f,_0x2bf513,_0x128c33){var _0x204a34='';return db[_0x31cc('0x2e')]['findOne']({'where':{'id':_0x7b6d6f[_0x31cc('0x48')]['id']},'attributes':['id',_0x31cc('0x5b'),_0x31cc('0x5c')]})[_0x31cc('0x42')](handleEntityNotFound(_0x2bf513,null))['then'](function(_0x5c0e0c){if(_0x5c0e0c){_0x204a34=_0x5c0e0c[_0x31cc('0x5b')];var _0x22acbe=_0x204a34[_0x31cc('0x5d')](-0x1);if(_0x22acbe==='/'){_0x204a34=_0x204a34[_0x31cc('0x5e')](0x0,_0x204a34[_0x31cc('0x5f')](_0x22acbe));}return rp({'method':_0x31cc('0x60'),'uri':util[_0x31cc('0x61')]('%s/%s',_0x204a34,_0x31cc('0x62')),'headers':{'Authorization':util[_0x31cc('0x61')](_0x31cc('0x63'),new Buffer(util[_0x31cc('0x61')](_0x31cc('0x64'),_0x5c0e0c['apiKey']))[_0x31cc('0x65')](_0x31cc('0x66')))},'json':!![]});}})[_0x31cc('0x42')](function(_0x22f064){if(_0x22f064){var _0x1bea57=[_0x31cc('0x67'),_0x31cc('0x68'),_0x31cc('0x69'),_0x31cc('0x6a'),_0x31cc('0x1c'),_0x31cc('0x6b'),_0x31cc('0x6c'),_0x31cc('0x6d'),'ticket_type',_0x31cc('0x6c'),'company'];_[_0x31cc('0x6e')](_0x22f064,function(_0x39b3ae){return _0x1bea57[_0x31cc('0x6f')](_0x39b3ae[_0x31cc('0x2b')])||!_0x39b3ae[_0x31cc('0x70')]&&_0x39b3ae['type']!==_0x31cc('0x71')&&_0x39b3ae[_0x31cc('0x31')]!==_0x31cc('0x72');});return{'count':_0x22f064[_0x31cc('0x4f')],'rows':_['map'](_0x22f064,function(_0xec392){return{'id':_0xec392[_0x31cc('0x2b')],'name':_0xec392['label'],'custom':!_0xec392[_0x31cc('0x70')],'options':_0xec392[_0x31cc('0x73')]?_[_0x31cc('0x34')](_0xec392[_0x31cc('0x73')],function(_0xed1228){return{'name':_['capitalize'](_0xed1228),'value':_0xed1228};}):[]};})};}})['then'](respondWithResult(_0x2bf513,null))[_0x31cc('0x49')](function(_0x5b9f3e){var _0x15f60e=_0x7b6d6f[_0x31cc('0x35')][_0x31cc('0x74')]?0x1f4:_0x5b9f3e[_0x31cc('0x75')]||0x1f4;logger[_0x31cc('0x29')](_0x31cc('0x76'),'getFields',_0x15f60e,JSON[_0x31cc('0x77')](_0x5b9f3e));delete _0x5b9f3e[_0x31cc('0x2b')];if(_0x15f60e===0x191){_0x15f60e=0x190;}_0x2bf513[_0x31cc('0x1c')](_0x15f60e)['send'](_0x7b6d6f[_0x31cc('0x35')][_0x31cc('0x74')]?{'message':_0x31cc('0x78'),'statusCode':_0x5b9f3e['statusCode']}:_0x5b9f3e);});}; \ No newline at end of file +var _0x6e6c=['Content-Range','json','reject','save','update','then','error','stack','name','send','index','map','FreshdeskAccount','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','FreshdeskConfiguration','sort','addConfiguration','AccountId','channel','Descriptions','FreshdeskField','Subjects','getFields','remoteUri','apiKey','substring','lastIndexOf','GET','%s/%s','Basic\x20%s','%s:X','toString','base64','requester','subject','agent','priority','group','source','company','remove','includes','default','custom_text','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','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'];(function(_0x39c2ad,_0x4ba3e8){var _0x5a24ea=function(_0x6051ce){while(--_0x6051ce){_0x39c2ad['push'](_0x39c2ad['shift']());}};_0x5a24ea(++_0x4ba3e8);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xc6e6('0x0'));var rimraf=require(_0xc6e6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc6e6('0x2'));var rp=require(_0xc6e6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc6e6('0x4'));var util=require('util');var path=require(_0xc6e6('0x5'));var sox=require('sox');var csv=require(_0xc6e6('0x6'));var ejs=require(_0xc6e6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc6e6('0x8'));var squel=require(_0xc6e6('0x9'));var crypto=require('crypto');var jsforce=require(_0xc6e6('0xa'));var deskjs=require(_0xc6e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0xc6e6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc6e6('0xd'));var authService=require(_0xc6e6('0xe'));var qs=require(_0xc6e6('0xf'));var as=require(_0xc6e6('0x10'));var hardwareService=require(_0xc6e6('0x11'));var logger=require(_0xc6e6('0x12'))(_0xc6e6('0x13'));var utils=require(_0xc6e6('0x14'));var config=require(_0xc6e6('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc6e6('0x16'))['db'];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['FreshdeskAccount'][_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('0x24')](handleEntityNotFound(_0x46c3df,null))[_0xc6e6('0x24')](function(_0x5a9ba5){if(_0x5a9ba5){_0x55cec5=_0x5a9ba5[_0xc6e6('0x55')];var _0x5c09b0=_0x55cec5['slice'](-0x1);if(_0x5c09b0==='/'){_0x55cec5=_0x55cec5[_0xc6e6('0x57')](0x0,_0x55cec5[_0xc6e6('0x58')](_0x5c09b0));}return rp({'method':_0xc6e6('0x59'),'uri':util['format'](_0xc6e6('0x5a'),_0x55cec5,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0xc6e6('0x5b'),new Buffer(util['format'](_0xc6e6('0x5c'),_0x5a9ba5[_0xc6e6('0x56')]))[_0xc6e6('0x5d')](_0xc6e6('0x5e')))},'json':!![]});}})['then'](function(_0x2d0d4d){if(_0x2d0d4d){var _0x9306c=[_0xc6e6('0x5f'),_0xc6e6('0x60'),_0xc6e6('0x61'),'description',_0xc6e6('0x19'),_0xc6e6('0x62'),_0xc6e6('0x63'),_0xc6e6('0x64'),'ticket_type','group',_0xc6e6('0x65')];_[_0xc6e6('0x66')](_0x2d0d4d,function(_0x42159c){return _0x9306c[_0xc6e6('0x67')](_0x42159c[_0xc6e6('0x27')])||!_0x42159c[_0xc6e6('0x68')]&&_0x42159c[_0xc6e6('0x2e')]!==_0xc6e6('0x69')&&_0x42159c[_0xc6e6('0x2e')]!=='custom_dropdown';});return{'count':_0x2d0d4d['length'],'rows':_[_0xc6e6('0x2a')](_0x2d0d4d,function(_0x5c9b92){return{'id':_0x5c9b92[_0xc6e6('0x27')],'name':_0x5c9b92[_0xc6e6('0x6a')],'custom':!_0x5c9b92[_0xc6e6('0x68')],'options':_0x5c9b92['choices']?_['map'](_0x5c9b92[_0xc6e6('0x6b')],function(_0x58b236){return{'name':_[_0xc6e6('0x6c')](_0x58b236),'value':_0x58b236};}):[]};})};}})['then'](respondWithResult(_0x46c3df,null))[_0xc6e6('0x43')](function(_0x3403b7){var _0x5d867e=_0x4c4985[_0xc6e6('0x31')][_0xc6e6('0x6d')]?0x1f4:_0x3403b7[_0xc6e6('0x6e')]||0x1f4;logger['error'](_0xc6e6('0x6f'),_0xc6e6('0x54'),_0x5d867e,JSON[_0xc6e6('0x70')](_0x3403b7));delete _0x3403b7['name'];if(_0x5d867e===0x191){_0x5d867e=0x190;}_0x46c3df[_0xc6e6('0x19')](_0x5d867e)[_0xc6e6('0x28')](_0x4c4985['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3403b7[_0xc6e6('0x6e')]}:_0x3403b7);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 7eadd44..8eabef6 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 _0x4731=['exports','FreshdeskAccount','lodash','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration'];(function(_0x4164d9,_0x1de77e){var _0x47a3d2=function(_0x5aaa6b){while(--_0x5aaa6b){_0x4164d9['push'](_0x4164d9['shift']());}};_0x47a3d2(++_0x1de77e);}(_0x4731,0xca));var _0x1473=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x4731[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x1473('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1473('0x1'));var BPromise=require(_0x1473('0x2'));var rp=require(_0x1473('0x3'));var fs=require('fs');var path=require(_0x1473('0x4'));var rimraf=require('rimraf');var config=require(_0x1473('0x5'));var attributes=require(_0x1473('0x6'));var integrations=require(_0x1473('0x7'));module[_0x1473('0x8')]=function(_0x43ab80,_0x532441){return _0x43ab80['define'](_0x1473('0x9'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf207=['../../config/environment','./intFreshdeskAccount.attributes','define','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5c6a78,_0x5c0503){var _0x236c5e=function(_0x44ef45){while(--_0x44ef45){_0x5c6a78['push'](_0x5c6a78['shift']());}};_0x236c5e(++_0x5c0503);}(_0xf207,0x17f));var _0x7f20=function(_0x3333bb,_0x1df222){_0x3333bb=_0x3333bb-0x0;var _0x273d39=_0xf207[_0x3333bb];return _0x273d39;};'use strict';var _=require(_0x7f20('0x0'));var util=require('util');var logger=require(_0x7f20('0x1'))(_0x7f20('0x2'));var moment=require('moment');var BPromise=require(_0x7f20('0x3'));var rp=require(_0x7f20('0x4'));var fs=require('fs');var path=require(_0x7f20('0x5'));var rimraf=require(_0x7f20('0x6'));var config=require(_0x7f20('0x7'));var attributes=require(_0x7f20('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5c8789,_0x10b3ca){return _0x5c8789[_0x7f20('0x9')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 0656c86..68e95ec 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 _0x070c=['../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','FreshdeskAccount','findAll','options','raw','limit','map','include','model','attributes','GetFreshdeskAccount','debug','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x36d7b1,_0x3bda0c){var _0x2f2d83=function(_0x33ec2a){while(--_0x33ec2a){_0x36d7b1['push'](_0x36d7b1['shift']());}};_0x2f2d83(++_0x3bda0c);}(_0x070c,0xfb));var _0xc070=function(_0x2df413,_0x5303ae){_0x2df413=_0x2df413-0x0;var _0x1f5133=_0x070c[_0x2df413];return _0x1f5133;};'use strict';var _=require(_0xc070('0x0'));var util=require(_0xc070('0x1'));var moment=require(_0xc070('0x2'));var BPromise=require(_0xc070('0x3'));var rs=require(_0xc070('0x4'));var fs=require('fs');var Redis=require(_0xc070('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc070('0x6'));var logger=require('../../config/logger')(_0xc070('0x7'));var config=require(_0xc070('0x8'));var jayson=require(_0xc070('0x9'));var client=jayson[_0xc070('0xa')][_0xc070('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x322c0b,_0x16fd3f,_0x331fe1){return new BPromise(function(_0x21e29,_0x21e087){return client[_0xc070('0xc')](_0x322c0b,_0x331fe1)[_0xc070('0xd')](function(_0x1c3c38){logger[_0xc070('0xe')](_0xc070('0xf'),_0x16fd3f,_0xc070('0x10'));logger['debug']('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x16fd3f,_0xc070('0x10'),JSON[_0xc070('0x11')](_0x1c3c38));if(_0x1c3c38[_0xc070('0x12')]){if(_0x1c3c38[_0xc070('0x12')][_0xc070('0x13')]===0x1f4){logger[_0xc070('0x12')](_0xc070('0xf'),_0x16fd3f,_0x1c3c38[_0xc070('0x12')][_0xc070('0x14')]);return _0x21e087(_0x1c3c38[_0xc070('0x12')]['message']);}logger[_0xc070('0x12')](_0xc070('0xf'),_0x16fd3f,_0x1c3c38[_0xc070('0x12')][_0xc070('0x14')]);return _0x21e29(_0x1c3c38[_0xc070('0x12')][_0xc070('0x14')]);}else{logger['info'](_0xc070('0xf'),_0x16fd3f,_0xc070('0x10'));_0x21e29(_0x1c3c38[_0xc070('0x15')]['message']);}})[_0xc070('0x16')](function(_0x5bf030){logger['error'](_0xc070('0xf'),_0x16fd3f,_0x5bf030);_0x21e087(_0x5bf030);});});}exports['GetFreshdeskAccount']=function(_0x4a1ce6){var _0x3883aa=this;return new Promise(function(_0xd092e5,_0x1356a3){return db[_0xc070('0x17')][_0xc070('0x18')]({'raw':_0x4a1ce6[_0xc070('0x19')]?_0x4a1ce6[_0xc070('0x19')][_0xc070('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a1ce6[_0xc070('0x19')]?_0x4a1ce6[_0xc070('0x19')]['where']||null:null,'attributes':_0x4a1ce6['options']?_0x4a1ce6[_0xc070('0x19')]['attributes']||null:null,'limit':_0x4a1ce6[_0xc070('0x19')]?_0x4a1ce6[_0xc070('0x19')][_0xc070('0x1b')]||null:null,'include':_0x4a1ce6['options']?_0x4a1ce6[_0xc070('0x19')]['include']?_[_0xc070('0x1c')](_0x4a1ce6[_0xc070('0x19')][_0xc070('0x1d')],function(_0x573c1c){return{'model':db[_0x573c1c[_0xc070('0x1e')]],'as':_0x573c1c['as'],'attributes':_0x573c1c[_0xc070('0x1f')],'include':_0x573c1c[_0xc070('0x1d')]?_[_0xc070('0x1c')](_0x573c1c[_0xc070('0x1d')],function(_0x1d875d){return{'model':db[_0x1d875d[_0xc070('0x1e')]],'as':_0x1d875d['as'],'attributes':_0x1d875d['attributes'],'include':_0x1d875d['include']?_[_0xc070('0x1c')](_0x1d875d[_0xc070('0x1d')],function(_0x3c6ca7){return{'model':db[_0x3c6ca7[_0xc070('0x1e')]],'as':_0x3c6ca7['as'],'attributes':_0x3c6ca7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x45c1a3){logger[_0xc070('0xe')](_0xc070('0x20'),_0x4a1ce6);logger[_0xc070('0x21')](_0xc070('0x20'),_0x4a1ce6,JSON[_0xc070('0x11')](_0x45c1a3));_0xd092e5(_0x45c1a3);})[_0xc070('0x16')](function(_0x4ad3cb){logger['error'](_0xc070('0x20'),_0x4ad3cb[_0xc070('0x14')],_0x4a1ce6);_0x1356a3(_0x3883aa[_0xc070('0x12')](0x1f4,_0x4ad3cb[_0xc070('0x14')]));});});};exports[_0xc070('0x22')]=function(_0x33cb66){var _0x4dbce3=this;return new Promise(function(_0x58a05c,_0x187ce4){return db[_0xc070('0x17')][_0xc070('0x23')]({'raw':_0x33cb66[_0xc070('0x19')]?_0x33cb66['options'][_0xc070('0x1a')]===undefined?!![]:![]:!![],'where':_0x33cb66[_0xc070('0x19')]?_0x33cb66[_0xc070('0x19')][_0xc070('0x24')]||null:null,'attributes':_0x33cb66[_0xc070('0x19')]?_0x33cb66[_0xc070('0x19')][_0xc070('0x1f')]||null:null,'include':_0x33cb66[_0xc070('0x19')]?_0x33cb66['options'][_0xc070('0x1d')]?_[_0xc070('0x1c')](_0x33cb66['options']['include'],function(_0x534d5b){return{'model':db[_0x534d5b[_0xc070('0x1e')]],'as':_0x534d5b['as'],'attributes':_0x534d5b['attributes'],'include':_0x534d5b[_0xc070('0x1d')]?_['map'](_0x534d5b[_0xc070('0x1d')],function(_0x11e0b5){return{'model':db[_0x11e0b5[_0xc070('0x1e')]],'as':_0x11e0b5['as'],'attributes':_0x11e0b5['attributes'],'include':_0x11e0b5['include']?_['map'](_0x11e0b5[_0xc070('0x1d')],function(_0x192ebc){return{'model':db[_0x192ebc[_0xc070('0x1e')]],'as':_0x192ebc['as'],'attributes':_0x192ebc[_0xc070('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc070('0xd')](function(_0x353560){logger[_0xc070('0xe')](_0xc070('0x22'),_0x33cb66);logger['debug'](_0xc070('0x22'),_0x33cb66,JSON[_0xc070('0x11')](_0x353560));_0x58a05c(_0x353560);})['catch'](function(_0x1ba0a2){logger[_0xc070('0x12')](_0xc070('0x22'),_0x1ba0a2[_0xc070('0x14')],_0x33cb66);_0x187ce4(_0x4dbce3[_0xc070('0x12')](0x1f4,_0x1ba0a2[_0xc070('0x14')]));});});}; \ No newline at end of file +var _0xe35a=['model','ShowFreshdeskAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','GetFreshdeskAccount','findAll','options','raw','limit','map','include','attributes','FreshdeskAccount','where'];(function(_0x1d839f,_0x43264b){var _0x1b3914=function(_0x192bbd){while(--_0x192bbd){_0x1d839f['push'](_0x1d839f['shift']());}};_0x1b3914(++_0x43264b);}(_0xe35a,0x1a6));var _0xae35=function(_0x55dee9,_0x3a5fc6){_0x55dee9=_0x55dee9-0x0;var _0x22c839=_0xe35a[_0x55dee9];return _0x22c839;};'use strict';var _=require(_0xae35('0x0'));var util=require(_0xae35('0x1'));var moment=require(_0xae35('0x2'));var BPromise=require(_0xae35('0x3'));var rs=require(_0xae35('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae35('0x5'))['db'];var utils=require(_0xae35('0x6'));var logger=require(_0xae35('0x7'))(_0xae35('0x8'));var config=require('../../config/environment');var jayson=require(_0xae35('0x9'));var client=jayson[_0xae35('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1927a4,_0x29f9b6,_0x4fc4d2){return new BPromise(function(_0x2b4a3d,_0x161f1c){return client[_0xae35('0xb')](_0x1927a4,_0x4fc4d2)[_0xae35('0xc')](function(_0x43593a){logger['info'](_0xae35('0xd'),_0x29f9b6,_0xae35('0xe'));logger[_0xae35('0xf')](_0xae35('0x10'),_0x29f9b6,_0xae35('0xe'),JSON[_0xae35('0x11')](_0x43593a));if(_0x43593a[_0xae35('0x12')]){if(_0x43593a['error'][_0xae35('0x13')]===0x1f4){logger[_0xae35('0x12')](_0xae35('0xd'),_0x29f9b6,_0x43593a[_0xae35('0x12')][_0xae35('0x14')]);return _0x161f1c(_0x43593a['error'][_0xae35('0x14')]);}logger[_0xae35('0x12')](_0xae35('0xd'),_0x29f9b6,_0x43593a['error'][_0xae35('0x14')]);return _0x2b4a3d(_0x43593a[_0xae35('0x12')][_0xae35('0x14')]);}else{logger[_0xae35('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x29f9b6,_0xae35('0xe'));_0x2b4a3d(_0x43593a['result'][_0xae35('0x14')]);}})[_0xae35('0x16')](function(_0x33b544){logger[_0xae35('0x12')](_0xae35('0xd'),_0x29f9b6,_0x33b544);_0x161f1c(_0x33b544);});});}exports[_0xae35('0x17')]=function(_0x353777){var _0x19736d=this;return new Promise(function(_0x297794,_0x5ccc4b){return db['FreshdeskAccount'][_0xae35('0x18')]({'raw':_0x353777[_0xae35('0x19')]?_0x353777[_0xae35('0x19')][_0xae35('0x1a')]===undefined?!![]:![]:!![],'where':_0x353777[_0xae35('0x19')]?_0x353777['options']['where']||null:null,'attributes':_0x353777[_0xae35('0x19')]?_0x353777[_0xae35('0x19')]['attributes']||null:null,'limit':_0x353777[_0xae35('0x19')]?_0x353777[_0xae35('0x19')][_0xae35('0x1b')]||null:null,'include':_0x353777[_0xae35('0x19')]?_0x353777[_0xae35('0x19')]['include']?_[_0xae35('0x1c')](_0x353777['options'][_0xae35('0x1d')],function(_0x13c454){return{'model':db[_0x13c454['model']],'as':_0x13c454['as'],'attributes':_0x13c454[_0xae35('0x1e')],'include':_0x13c454[_0xae35('0x1d')]?_[_0xae35('0x1c')](_0x13c454[_0xae35('0x1d')],function(_0x2485bd){return{'model':db[_0x2485bd['model']],'as':_0x2485bd['as'],'attributes':_0x2485bd[_0xae35('0x1e')],'include':_0x2485bd[_0xae35('0x1d')]?_['map'](_0x2485bd[_0xae35('0x1d')],function(_0x4dfa49){return{'model':db[_0x4dfa49['model']],'as':_0x4dfa49['as'],'attributes':_0x4dfa49[_0xae35('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23ca53){logger[_0xae35('0x15')]('GetFreshdeskAccount',_0x353777);logger[_0xae35('0xf')](_0xae35('0x17'),_0x353777,JSON[_0xae35('0x11')](_0x23ca53));_0x297794(_0x23ca53);})['catch'](function(_0x46c994){logger[_0xae35('0x12')](_0xae35('0x17'),_0x46c994[_0xae35('0x14')],_0x353777);_0x5ccc4b(_0x19736d[_0xae35('0x12')](0x1f4,_0x46c994['message']));});});};exports['ShowFreshdeskAccount']=function(_0x3aae78){var _0x591a90=this;return new Promise(function(_0x560235,_0x1e53e9){return db[_0xae35('0x1f')]['find']({'raw':_0x3aae78[_0xae35('0x19')]?_0x3aae78[_0xae35('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3aae78[_0xae35('0x19')]?_0x3aae78[_0xae35('0x19')][_0xae35('0x20')]||null:null,'attributes':_0x3aae78[_0xae35('0x19')]?_0x3aae78['options'][_0xae35('0x1e')]||null:null,'include':_0x3aae78[_0xae35('0x19')]?_0x3aae78['options'][_0xae35('0x1d')]?_[_0xae35('0x1c')](_0x3aae78['options'][_0xae35('0x1d')],function(_0x4b2ce8){return{'model':db[_0x4b2ce8['model']],'as':_0x4b2ce8['as'],'attributes':_0x4b2ce8[_0xae35('0x1e')],'include':_0x4b2ce8[_0xae35('0x1d')]?_[_0xae35('0x1c')](_0x4b2ce8[_0xae35('0x1d')],function(_0x1030ac){return{'model':db[_0x1030ac[_0xae35('0x21')]],'as':_0x1030ac['as'],'attributes':_0x1030ac[_0xae35('0x1e')],'include':_0x1030ac[_0xae35('0x1d')]?_[_0xae35('0x1c')](_0x1030ac[_0xae35('0x1d')],function(_0x3af659){return{'model':db[_0x3af659[_0xae35('0x21')]],'as':_0x3af659['as'],'attributes':_0x3af659[_0xae35('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xae35('0xc')](function(_0x9df830){logger['info'](_0xae35('0x22'),_0x3aae78);logger[_0xae35('0xf')]('ShowFreshdeskAccount',_0x3aae78,JSON[_0xae35('0x11')](_0x9df830));_0x560235(_0x9df830);})[_0xae35('0x16')](function(_0x4dcc2b){logger[_0xae35('0x12')]('ShowFreshdeskAccount',_0x4dcc2b[_0xae35('0x14')],_0x3aae78);_0x1e53e9(_0x591a90[_0xae35('0x12')](0x1f4,_0x4dcc2b[_0xae35('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index a1b1bf1..a109657 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 _0x89c0=['multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getSubjects','getDescriptions','/:id/tags','getTags','setTags','update','delete','destroy','exports'];(function(_0xa009b4,_0x4b78b0){var _0x4339ab=function(_0x327737){while(--_0x327737){_0xa009b4['push'](_0xa009b4['shift']());}};_0x4339ab(++_0x4b78b0);}(_0x89c0,0x138));var _0x089c=function(_0x35931b,_0x850d48){_0x35931b=_0x35931b-0x0;var _0x55c7c8=_0x89c0[_0x35931b];return _0x55c7c8;};'use strict';var multer=require(_0x089c('0x0'));var util=require(_0x089c('0x1'));var path=require(_0x089c('0x2'));var timeout=require(_0x089c('0x3'));var express=require(_0x089c('0x4'));var router=express['Router']();var fs_extra=require(_0x089c('0x5'));var auth=require(_0x089c('0x6'));var interaction=require(_0x089c('0x7'));var config=require(_0x089c('0x8'));var controller=require(_0x089c('0x9'));router['get']('/',auth[_0x089c('0xa')](),controller[_0x089c('0xb')]);router[_0x089c('0xc')](_0x089c('0xd'),auth[_0x089c('0xa')](),controller['show']);router[_0x089c('0xc')](_0x089c('0xe'),auth['isAuthenticated'](),controller['getFields']);router['get']('/:id/subjects',auth[_0x089c('0xa')](),controller[_0x089c('0xf')]);router[_0x089c('0xc')]('/:id/descriptions',auth[_0x089c('0xa')](),controller[_0x089c('0x10')]);router[_0x089c('0xc')](_0x089c('0x11'),auth[_0x089c('0xa')](),controller[_0x089c('0x12')]);router['post']('/',auth[_0x089c('0xa')](),controller['create']);router['post'](_0x089c('0x11'),auth[_0x089c('0xa')](),controller[_0x089c('0x13')]);router['put'](_0x089c('0xd'),auth['isAuthenticated'](),controller[_0x089c('0x14')]);router[_0x089c('0x15')](_0x089c('0xd'),auth['isAuthenticated'](),controller[_0x089c('0x16')]);module[_0x089c('0x17')]=router; \ No newline at end of file +var _0x80b3=['post','setTags','put','update','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x80b3,0x1a7));var _0x380b=function(_0x4f8337,_0x45e66f){_0x4f8337=_0x4f8337-0x0;var _0x3b31fa=_0x80b3[_0x4f8337];return _0x3b31fa;};'use strict';var multer=require(_0x380b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x380b('0x1'));var express=require(_0x380b('0x2'));var router=express[_0x380b('0x3')]();var fs_extra=require(_0x380b('0x4'));var auth=require(_0x380b('0x5'));var interaction=require(_0x380b('0x6'));var config=require('../../config/environment');var controller=require('./intFreshdeskConfiguration.controller');router[_0x380b('0x7')]('/',auth[_0x380b('0x8')](),controller['index']);router[_0x380b('0x7')](_0x380b('0x9'),auth[_0x380b('0x8')](),controller['show']);router[_0x380b('0x7')](_0x380b('0xa'),auth[_0x380b('0x8')](),controller[_0x380b('0xb')]);router[_0x380b('0x7')](_0x380b('0xc'),auth[_0x380b('0x8')](),controller[_0x380b('0xd')]);router[_0x380b('0x7')]('/:id/descriptions',auth[_0x380b('0x8')](),controller['getDescriptions']);router['get'](_0x380b('0xe'),auth[_0x380b('0x8')](),controller[_0x380b('0xf')]);router['post']('/',auth[_0x380b('0x8')](),controller[_0x380b('0x10')]);router[_0x380b('0x11')](_0x380b('0xe'),auth[_0x380b('0x8')](),controller[_0x380b('0x12')]);router[_0x380b('0x13')](_0x380b('0x9'),auth[_0x380b('0x8')](),controller[_0x380b('0x14')]);router['delete'](_0x380b('0x9'),auth[_0x380b('0x8')](),controller['destroy']);module[_0x380b('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 0e0c6d3..c7636fe 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 _0x1775=['exports','STRING'];(function(_0x7a3f97,_0x2af7ca){var _0x37e15c=function(_0x54cb1b){while(--_0x54cb1b){_0x7a3f97['push'](_0x7a3f97['shift']());}};_0x37e15c(++_0x2af7ca);}(_0x1775,0x178));var _0x5177=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x1775[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require('sequelize');module[_0x5177('0x0')]={'name':{'type':Sequelize[_0x5177('0x1')]},'description':{'type':Sequelize[_0x5177('0x1')]}}; \ No newline at end of file +var _0x906d=['STRING','sequelize','exports'];(function(_0x3e8bc8,_0x591f14){var _0x51d9c5=function(_0x22ea7f){while(--_0x22ea7f){_0x3e8bc8['push'](_0x3e8bc8['shift']());}};_0x51d9c5(++_0x591f14);}(_0x906d,0x10f));var _0xd906=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x906d[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0xd906('0x0'));module[_0xd906('0x1')]={'name':{'type':Sequelize[_0xd906('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index d1166f8..b39643c 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 _0xa355=['length','find','create','body','getFields','findOne','order','nolimit','FreshdeskField','getSubjects','getDescriptions','Tag','getTags','setTags','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','json','reject','update','destroy','then','stack','name','send','index','map','FreshdeskConfiguration','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','sort','pick','filter','merge','where','type','options','includeAll','findAll','catch','show','params','rawAttributes'];(function(_0x4bee6e,_0x1f5859){var _0x4f549b=function(_0x222f54){while(--_0x222f54){_0x4bee6e['push'](_0x4bee6e['shift']());}};_0x4f549b(++_0x1f5859);}(_0xa355,0x14a));var _0x5a35=function(_0x27b7d2,_0x56c091){_0x27b7d2=_0x27b7d2-0x0;var _0x3ef6be=_0xa355[_0x27b7d2];return _0x3ef6be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a35('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5a35('0x1'));var moment=require(_0x5a35('0x2'));var BPromise=require(_0x5a35('0x3'));var Mustache=require(_0x5a35('0x4'));var util=require('util');var path=require(_0x5a35('0x5'));var sox=require('sox');var csv=require(_0x5a35('0x6'));var ejs=require(_0x5a35('0x7'));var fs=require('fs');var fs_extra=require(_0x5a35('0x8'));var _=require(_0x5a35('0x9'));var squel=require(_0x5a35('0xa'));var crypto=require(_0x5a35('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5a35('0xc'));var toCsv=require(_0x5a35('0x6'));var querystring=require(_0x5a35('0xd'));var Papa=require(_0x5a35('0xe'));var Redis=require(_0x5a35('0xf'));var authService=require(_0x5a35('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5a35('0x11'));var hardwareService=require(_0x5a35('0x12'));var logger=require(_0x5a35('0x13'))('api');var utils=require(_0x5a35('0x14'));var config=require(_0x5a35('0x15'));var licenseUtil=require(_0x5a35('0x16'));var db=require(_0x5a35('0x17'))['db'];function respondWithStatusCode(_0x118cb9,_0x46b900){_0x46b900=_0x46b900||0xcc;return function(_0x2e0f95){if(_0x2e0f95){return _0x118cb9[_0x5a35('0x18')](_0x46b900);}return _0x118cb9[_0x5a35('0x19')](_0x46b900)['end']();};}function respondWithResult(_0x131b61,_0x37e4ea){_0x37e4ea=_0x37e4ea||0xc8;return function(_0x468c00){if(_0x468c00){return _0x131b61['status'](_0x37e4ea)['json'](_0x468c00);}};}function respondWithFilteredResult(_0x4270f6,_0x39979b){return function(_0x38b5bb){if(_0x38b5bb){var _0x3f3621=typeof _0x39979b[_0x5a35('0x1a')]===_0x5a35('0x1b')&&typeof _0x39979b['limit']===_0x5a35('0x1b');var _0xbe5eae=_0x38b5bb[_0x5a35('0x1c')];var _0x3785db=_0x3f3621?0x0:_0x39979b[_0x5a35('0x1a')];var _0xc61082=_0x3f3621?_0x38b5bb['count']:_0x39979b[_0x5a35('0x1a')]+_0x39979b[_0x5a35('0x1d')];var _0x38b7c8;if(_0xc61082>=_0xbe5eae){_0xc61082=_0xbe5eae;_0x38b7c8=0xc8;}else{_0x38b7c8=0xce;}_0x4270f6[_0x5a35('0x19')](_0x38b7c8);return _0x4270f6[_0x5a35('0x1e')]('Content-Range',_0x3785db+'-'+_0xc61082+'/'+_0xbe5eae)[_0x5a35('0x1f')](_0x38b5bb);}return null;};}function patchUpdates(_0x15d6df){return function(_0x40f3bc){try{jsonpatch['apply'](_0x40f3bc,_0x15d6df,!![]);}catch(_0x259e3f){return BPromise[_0x5a35('0x20')](_0x259e3f);}return _0x40f3bc['save']();};}function saveUpdates(_0x5c6d6f,_0x14385e){return function(_0x36b208){if(_0x36b208){return _0x36b208[_0x5a35('0x21')](_0x5c6d6f)['then'](function(_0x5ab72f){return _0x5ab72f;});}return null;};}function removeEntity(_0x404c81,_0x33d3f5){return function(_0x39bcf8){if(_0x39bcf8){return _0x39bcf8[_0x5a35('0x22')]()[_0x5a35('0x23')](function(){_0x404c81[_0x5a35('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d6578,_0x17bed6){return function(_0x37999a){if(!_0x37999a){_0x9d6578['sendStatus'](0x194);}return _0x37999a;};}function handleError(_0x45bb8f,_0x155d8e){_0x155d8e=_0x155d8e||0x1f4;return function(_0x562d8e){logger['error'](_0x562d8e[_0x5a35('0x24')]);if(_0x562d8e[_0x5a35('0x25')]){delete _0x562d8e[_0x5a35('0x25')];}_0x45bb8f[_0x5a35('0x19')](_0x155d8e)[_0x5a35('0x26')](_0x562d8e);};}exports[_0x5a35('0x27')]=function(_0x35391e,_0x1ed2c8){var _0x5acfd5={},_0x304e17={},_0x4e23fd={'count':0x0,'rows':[]};var _0x3e2c23=_[_0x5a35('0x28')](db[_0x5a35('0x29')]['rawAttributes'],function(_0x56601a){return{'name':_0x56601a[_0x5a35('0x2a')],'type':_0x56601a['type'][_0x5a35('0x2b')]};});_0x304e17[_0x5a35('0x2c')]=_[_0x5a35('0x28')](_0x3e2c23,_0x5a35('0x25'));_0x304e17['query']=_[_0x5a35('0x2d')](_0x35391e[_0x5a35('0x2e')]);_0x304e17[_0x5a35('0x2f')]=_[_0x5a35('0x30')](_0x304e17[_0x5a35('0x2c')],_0x304e17[_0x5a35('0x2e')]);_0x5acfd5[_0x5a35('0x31')]=_['intersection'](_0x304e17[_0x5a35('0x2c')],qs[_0x5a35('0x32')](_0x35391e[_0x5a35('0x2e')][_0x5a35('0x32')]));_0x5acfd5[_0x5a35('0x31')]=_0x5acfd5['attributes']['length']?_0x5acfd5['attributes']:_0x304e17[_0x5a35('0x2c')];if(!_0x35391e[_0x5a35('0x2e')][_0x5a35('0x33')]('nolimit')){_0x5acfd5[_0x5a35('0x1d')]=qs[_0x5a35('0x1d')](_0x35391e[_0x5a35('0x2e')][_0x5a35('0x1d')]);_0x5acfd5[_0x5a35('0x1a')]=qs['offset'](_0x35391e[_0x5a35('0x2e')]['offset']);}_0x5acfd5['order']=qs[_0x5a35('0x34')](_0x35391e['query'][_0x5a35('0x34')]);_0x5acfd5['where']=qs[_0x5a35('0x2f')](_[_0x5a35('0x35')](_0x35391e['query'],_0x304e17['filters']),_0x3e2c23);if(_0x35391e['query'][_0x5a35('0x36')]){_0x5acfd5['where']=_[_0x5a35('0x37')](_0x5acfd5[_0x5a35('0x38')],{'$or':_['map'](_0x3e2c23,function(_0x3e476f){if(_0x3e476f[_0x5a35('0x39')]!=='VIRTUAL'){var _0x3ed0c8={};_0x3ed0c8[_0x3e476f[_0x5a35('0x25')]]={'$like':'%'+_0x35391e[_0x5a35('0x2e')][_0x5a35('0x36')]+'%'};return _0x3ed0c8;}})});}_0x5acfd5=_[_0x5a35('0x37')]({},_0x5acfd5,_0x35391e[_0x5a35('0x3a')]);var _0x686e52={'where':_0x5acfd5[_0x5a35('0x38')]};return db[_0x5a35('0x29')][_0x5a35('0x1c')](_0x686e52)['then'](function(_0x52dd85){_0x4e23fd[_0x5a35('0x1c')]=_0x52dd85;if(_0x35391e['query'][_0x5a35('0x3b')]){_0x5acfd5['include']=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0x5a35('0x3c')](_0x5acfd5);})[_0x5a35('0x23')](function(_0x4a9d2f){_0x4e23fd['rows']=_0x4a9d2f;return _0x4e23fd;})[_0x5a35('0x23')](respondWithFilteredResult(_0x1ed2c8,_0x5acfd5))[_0x5a35('0x3d')](handleError(_0x1ed2c8,null));};exports[_0x5a35('0x3e')]=function(_0xfce023,_0x541059){var _0x4a124d={'raw':![],'where':{'id':_0xfce023[_0x5a35('0x3f')]['id']}},_0x50236f={};_0x50236f[_0x5a35('0x2c')]=_[_0x5a35('0x2d')](db[_0x5a35('0x29')][_0x5a35('0x40')]);_0x50236f[_0x5a35('0x2e')]=_[_0x5a35('0x2d')](_0xfce023[_0x5a35('0x2e')]);_0x50236f[_0x5a35('0x2f')]=_[_0x5a35('0x30')](_0x50236f['model'],_0x50236f['query']);_0x4a124d[_0x5a35('0x31')]=_[_0x5a35('0x30')](_0x50236f[_0x5a35('0x2c')],qs[_0x5a35('0x32')](_0xfce023[_0x5a35('0x2e')][_0x5a35('0x32')]));_0x4a124d['attributes']=_0x4a124d[_0x5a35('0x31')][_0x5a35('0x41')]?_0x4a124d[_0x5a35('0x31')]:_0x50236f[_0x5a35('0x2c')];if(_0xfce023['query'][_0x5a35('0x3b')]){_0x4a124d['include']=[{'all':!![]}];}_0x4a124d=_[_0x5a35('0x37')]({},_0x4a124d,_0xfce023[_0x5a35('0x3a')]);return db[_0x5a35('0x29')][_0x5a35('0x42')](_0x4a124d)[_0x5a35('0x23')](handleEntityNotFound(_0x541059,null))[_0x5a35('0x23')](respondWithResult(_0x541059,null))[_0x5a35('0x3d')](handleError(_0x541059,null));};exports['create']=function(_0xeb03b6,_0x4fb18c){return db[_0x5a35('0x29')][_0x5a35('0x43')](_0xeb03b6[_0x5a35('0x44')],{})[_0x5a35('0x23')](respondWithResult(_0x4fb18c,0xc9))[_0x5a35('0x3d')](handleError(_0x4fb18c,null));};exports[_0x5a35('0x21')]=function(_0x156453,_0x3e349d){if(_0x156453[_0x5a35('0x44')]['id']){delete _0x156453[_0x5a35('0x44')]['id'];}return db['FreshdeskConfiguration'][_0x5a35('0x42')]({'where':{'id':_0x156453[_0x5a35('0x3f')]['id']}})[_0x5a35('0x23')](handleEntityNotFound(_0x3e349d,null))[_0x5a35('0x23')](saveUpdates(_0x156453[_0x5a35('0x44')],null))['then'](respondWithResult(_0x3e349d,null))[_0x5a35('0x3d')](handleError(_0x3e349d,null));};exports[_0x5a35('0x22')]=function(_0x3a5d20,_0x2470c5){return db[_0x5a35('0x29')]['find']({'where':{'id':_0x3a5d20['params']['id']}})[_0x5a35('0x23')](handleEntityNotFound(_0x2470c5,null))[_0x5a35('0x23')](removeEntity(_0x2470c5,null))[_0x5a35('0x3d')](handleError(_0x2470c5,null));};exports[_0x5a35('0x45')]=function(_0x2b72bc,_0x259efc,_0x4b40d8){var _0x1f540b={};var _0x128489={};var _0x5126a1;var _0x234003;return db[_0x5a35('0x29')][_0x5a35('0x46')]({'where':{'id':_0x2b72bc[_0x5a35('0x3f')]['id']}})[_0x5a35('0x23')](handleEntityNotFound(_0x259efc,null))[_0x5a35('0x23')](function(_0x283a30){if(_0x283a30){_0x5126a1=_0x283a30;_0x128489[_0x5a35('0x2c')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x128489[_0x5a35('0x2e')]=_[_0x5a35('0x2d')](_0x2b72bc[_0x5a35('0x2e')]);_0x128489['filters']=_[_0x5a35('0x30')](_0x128489[_0x5a35('0x2c')],_0x128489[_0x5a35('0x2e')]);_0x1f540b[_0x5a35('0x31')]=_[_0x5a35('0x30')](_0x128489[_0x5a35('0x2c')],qs[_0x5a35('0x32')](_0x2b72bc['query']['fields']));_0x1f540b[_0x5a35('0x31')]=_0x1f540b['attributes'][_0x5a35('0x41')]?_0x1f540b[_0x5a35('0x31')]:_0x128489[_0x5a35('0x2c')];_0x1f540b[_0x5a35('0x47')]=qs['sort'](_0x2b72bc[_0x5a35('0x2e')][_0x5a35('0x34')]);_0x1f540b[_0x5a35('0x38')]=qs[_0x5a35('0x2f')](_[_0x5a35('0x35')](_0x2b72bc['query'],_0x128489['filters']));if(_0x2b72bc[_0x5a35('0x2e')]['filter']){_0x1f540b[_0x5a35('0x38')]=_[_0x5a35('0x37')](_0x1f540b[_0x5a35('0x38')],{'$or':_[_0x5a35('0x28')](_0x1f540b['attributes'],function(_0x276265){var _0x3bb9d4={};_0x3bb9d4[_0x276265]={'$like':'%'+_0x2b72bc[_0x5a35('0x2e')][_0x5a35('0x36')]+'%'};return _0x3bb9d4;})});}_0x1f540b=_[_0x5a35('0x37')]({},_0x1f540b,_0x2b72bc[_0x5a35('0x3a')]);return _0x5126a1['getFields'](_0x1f540b);}})[_0x5a35('0x23')](function(_0x4ff4d1){if(_0x4ff4d1){_0x234003=_0x4ff4d1[_0x5a35('0x41')];if(!_0x2b72bc[_0x5a35('0x2e')][_0x5a35('0x33')](_0x5a35('0x48'))){_0x1f540b['limit']=qs['limit'](_0x2b72bc['query']['limit']);_0x1f540b[_0x5a35('0x1a')]=qs[_0x5a35('0x1a')](_0x2b72bc[_0x5a35('0x2e')][_0x5a35('0x1a')]);}return _0x5126a1[_0x5a35('0x45')](_0x1f540b);}})[_0x5a35('0x23')](function(_0x480663){if(_0x480663){return _0x480663?{'count':_0x234003,'rows':_0x480663}:null;}})[_0x5a35('0x23')](respondWithResult(_0x259efc,null))[_0x5a35('0x3d')](handleError(_0x259efc,null));};exports['getSubjects']=function(_0x49c8e2,_0x51b26e,_0x14ed6b){var _0x45d1e2={};var _0x14b608={};var _0x5cce0d;var _0x33c18d;return db['FreshdeskConfiguration'][_0x5a35('0x46')]({'where':{'id':_0x49c8e2[_0x5a35('0x3f')]['id']}})[_0x5a35('0x23')](handleEntityNotFound(_0x51b26e,null))[_0x5a35('0x23')](function(_0x2bc322){if(_0x2bc322){_0x5cce0d=_0x2bc322;_0x14b608[_0x5a35('0x2c')]=_[_0x5a35('0x2d')](db[_0x5a35('0x49')][_0x5a35('0x40')]);_0x14b608['query']=_['keys'](_0x49c8e2[_0x5a35('0x2e')]);_0x14b608[_0x5a35('0x2f')]=_[_0x5a35('0x30')](_0x14b608[_0x5a35('0x2c')],_0x14b608[_0x5a35('0x2e')]);_0x45d1e2['attributes']=_[_0x5a35('0x30')](_0x14b608[_0x5a35('0x2c')],qs[_0x5a35('0x32')](_0x49c8e2['query'][_0x5a35('0x32')]));_0x45d1e2[_0x5a35('0x31')]=_0x45d1e2['attributes'][_0x5a35('0x41')]?_0x45d1e2[_0x5a35('0x31')]:_0x14b608[_0x5a35('0x2c')];_0x45d1e2[_0x5a35('0x47')]=qs[_0x5a35('0x34')](_0x49c8e2[_0x5a35('0x2e')]['sort']);_0x45d1e2[_0x5a35('0x38')]=qs[_0x5a35('0x2f')](_[_0x5a35('0x35')](_0x49c8e2[_0x5a35('0x2e')],_0x14b608[_0x5a35('0x2f')]));if(_0x49c8e2[_0x5a35('0x2e')]['filter']){_0x45d1e2[_0x5a35('0x38')]=_[_0x5a35('0x37')](_0x45d1e2[_0x5a35('0x38')],{'$or':_[_0x5a35('0x28')](_0x45d1e2[_0x5a35('0x31')],function(_0x3a40e7){var _0x554d6b={};_0x554d6b[_0x3a40e7]={'$like':'%'+_0x49c8e2[_0x5a35('0x2e')][_0x5a35('0x36')]+'%'};return _0x554d6b;})});}_0x45d1e2=_[_0x5a35('0x37')]({},_0x45d1e2,_0x49c8e2[_0x5a35('0x3a')]);return _0x5cce0d[_0x5a35('0x4a')](_0x45d1e2);}})['then'](function(_0x16385e){if(_0x16385e){_0x33c18d=_0x16385e[_0x5a35('0x41')];if(!_0x49c8e2[_0x5a35('0x2e')][_0x5a35('0x33')](_0x5a35('0x48'))){_0x45d1e2['limit']=qs[_0x5a35('0x1d')](_0x49c8e2[_0x5a35('0x2e')][_0x5a35('0x1d')]);_0x45d1e2[_0x5a35('0x1a')]=qs['offset'](_0x49c8e2['query'][_0x5a35('0x1a')]);}return _0x5cce0d[_0x5a35('0x4a')](_0x45d1e2);}})['then'](function(_0x757c70){if(_0x757c70){return _0x757c70?{'count':_0x33c18d,'rows':_0x757c70}:null;}})[_0x5a35('0x23')](respondWithResult(_0x51b26e,null))[_0x5a35('0x3d')](handleError(_0x51b26e,null));};exports[_0x5a35('0x4b')]=function(_0x56d58b,_0x403349,_0x3adf4d){var _0xdeeb0b={};var _0x46728c={};var _0x513fb1;var _0x100699;return db[_0x5a35('0x29')][_0x5a35('0x46')]({'where':{'id':_0x56d58b['params']['id']}})[_0x5a35('0x23')](handleEntityNotFound(_0x403349,null))['then'](function(_0x4d3b16){if(_0x4d3b16){_0x513fb1=_0x4d3b16;_0x46728c['model']=_['keys'](db[_0x5a35('0x49')][_0x5a35('0x40')]);_0x46728c['query']=_[_0x5a35('0x2d')](_0x56d58b[_0x5a35('0x2e')]);_0x46728c[_0x5a35('0x2f')]=_['intersection'](_0x46728c['model'],_0x46728c['query']);_0xdeeb0b[_0x5a35('0x31')]=_[_0x5a35('0x30')](_0x46728c['model'],qs[_0x5a35('0x32')](_0x56d58b[_0x5a35('0x2e')]['fields']));_0xdeeb0b[_0x5a35('0x31')]=_0xdeeb0b[_0x5a35('0x31')][_0x5a35('0x41')]?_0xdeeb0b[_0x5a35('0x31')]:_0x46728c[_0x5a35('0x2c')];_0xdeeb0b[_0x5a35('0x47')]=qs[_0x5a35('0x34')](_0x56d58b[_0x5a35('0x2e')][_0x5a35('0x34')]);_0xdeeb0b['where']=qs[_0x5a35('0x2f')](_[_0x5a35('0x35')](_0x56d58b[_0x5a35('0x2e')],_0x46728c['filters']));if(_0x56d58b[_0x5a35('0x2e')][_0x5a35('0x36')]){_0xdeeb0b[_0x5a35('0x38')]=_[_0x5a35('0x37')](_0xdeeb0b[_0x5a35('0x38')],{'$or':_['map'](_0xdeeb0b[_0x5a35('0x31')],function(_0x3316b6){var _0x507460={};_0x507460[_0x3316b6]={'$like':'%'+_0x56d58b[_0x5a35('0x2e')][_0x5a35('0x36')]+'%'};return _0x507460;})});}_0xdeeb0b=_[_0x5a35('0x37')]({},_0xdeeb0b,_0x56d58b[_0x5a35('0x3a')]);return _0x513fb1[_0x5a35('0x4b')](_0xdeeb0b);}})[_0x5a35('0x23')](function(_0x5c1a9c){if(_0x5c1a9c){_0x100699=_0x5c1a9c[_0x5a35('0x41')];if(!_0x56d58b[_0x5a35('0x2e')][_0x5a35('0x33')]('nolimit')){_0xdeeb0b[_0x5a35('0x1d')]=qs['limit'](_0x56d58b[_0x5a35('0x2e')]['limit']);_0xdeeb0b['offset']=qs[_0x5a35('0x1a')](_0x56d58b['query'][_0x5a35('0x1a')]);}return _0x513fb1['getDescriptions'](_0xdeeb0b);}})['then'](function(_0x40b4f2){if(_0x40b4f2){return _0x40b4f2?{'count':_0x100699,'rows':_0x40b4f2}:null;}})['then'](respondWithResult(_0x403349,null))[_0x5a35('0x3d')](handleError(_0x403349,null));};exports['getTags']=function(_0x26e98d,_0x53d940,_0x410eff){var _0x527a52={};var _0x296496={};var _0xccaa2a;var _0x5b4a92;return db['FreshdeskConfiguration'][_0x5a35('0x46')]({'where':{'id':_0x26e98d[_0x5a35('0x3f')]['id']}})['then'](handleEntityNotFound(_0x53d940,null))[_0x5a35('0x23')](function(_0x4549ab){if(_0x4549ab){_0xccaa2a=_0x4549ab;_0x296496[_0x5a35('0x2c')]=_[_0x5a35('0x2d')](db[_0x5a35('0x4c')][_0x5a35('0x40')]);_0x296496[_0x5a35('0x2e')]=_[_0x5a35('0x2d')](_0x26e98d['query']);_0x296496[_0x5a35('0x2f')]=_['intersection'](_0x296496[_0x5a35('0x2c')],_0x296496[_0x5a35('0x2e')]);_0x527a52[_0x5a35('0x31')]=_[_0x5a35('0x30')](_0x296496[_0x5a35('0x2c')],qs[_0x5a35('0x32')](_0x26e98d['query'][_0x5a35('0x32')]));_0x527a52[_0x5a35('0x31')]=_0x527a52['attributes'][_0x5a35('0x41')]?_0x527a52[_0x5a35('0x31')]:_0x296496[_0x5a35('0x2c')];_0x527a52[_0x5a35('0x47')]=qs[_0x5a35('0x34')](_0x26e98d[_0x5a35('0x2e')]['sort']);_0x527a52[_0x5a35('0x38')]=qs[_0x5a35('0x2f')](_['pick'](_0x26e98d['query'],_0x296496[_0x5a35('0x2f')]));if(_0x26e98d[_0x5a35('0x2e')][_0x5a35('0x36')]){_0x527a52[_0x5a35('0x38')]=_['merge'](_0x527a52['where'],{'$or':_[_0x5a35('0x28')](_0x527a52[_0x5a35('0x31')],function(_0x519f9f){var _0xe9460a={};_0xe9460a[_0x519f9f]={'$like':'%'+_0x26e98d[_0x5a35('0x2e')][_0x5a35('0x36')]+'%'};return _0xe9460a;})});}_0x527a52=_[_0x5a35('0x37')]({},_0x527a52,_0x26e98d[_0x5a35('0x3a')]);return _0xccaa2a[_0x5a35('0x4d')](_0x527a52);}})[_0x5a35('0x23')](function(_0x341e10){if(_0x341e10){_0x5b4a92=_0x341e10[_0x5a35('0x41')];if(!_0x26e98d[_0x5a35('0x2e')]['hasOwnProperty'](_0x5a35('0x48'))){_0x527a52[_0x5a35('0x1d')]=qs[_0x5a35('0x1d')](_0x26e98d['query']['limit']);_0x527a52[_0x5a35('0x1a')]=qs[_0x5a35('0x1a')](_0x26e98d[_0x5a35('0x2e')][_0x5a35('0x1a')]);}return _0xccaa2a[_0x5a35('0x4d')](_0x527a52);}})[_0x5a35('0x23')](function(_0x58f7b1){if(_0x58f7b1){return _0x58f7b1?{'count':_0x5b4a92,'rows':_0x58f7b1}:null;}})['then'](respondWithResult(_0x53d940,null))[_0x5a35('0x3d')](handleError(_0x53d940,null));};exports[_0x5a35('0x4e')]=function(_0x23f75f,_0x2ccbf7,_0x116d2f){if(_0x23f75f['body']['id']){delete _0x23f75f['body']['id'];}return db[_0x5a35('0x29')]['findOne']({'where':{'id':_0x23f75f[_0x5a35('0x3f')]['id']}})[_0x5a35('0x23')](handleEntityNotFound(_0x2ccbf7,null))[_0x5a35('0x23')](function(_0x2f8230){if(_0x2f8230){return _0x2f8230[_0x5a35('0x4e')](_0x23f75f[_0x5a35('0x44')]['ids']||[]);}return null;})[_0x5a35('0x23')](respondWithResult(_0x2ccbf7,null))[_0x5a35('0x3d')](handleError(_0x2ccbf7,null));}; \ No newline at end of file +var _0x685a=['fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','json','reject','save','update','then','end','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','getFields','FreshdeskField','filter','getSubjects','getDescriptions','findOne','Tag','getTags','setTags','ids','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs'];(function(_0x20c4e0,_0x3b60b2){var _0x3ee6b8=function(_0x454aaa){while(--_0x454aaa){_0x20c4e0['push'](_0x20c4e0['shift']());}};_0x3ee6b8(++_0x3b60b2);}(_0x685a,0x193));var _0xa685=function(_0x2cb996,_0x1144a8){_0x2cb996=_0x2cb996-0x0;var _0x5e7188=_0x685a[_0x2cb996];return _0x5e7188;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa685('0x0'));var jsonpatch=require(_0xa685('0x1'));var rp=require(_0xa685('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa685('0x3'));var util=require('util');var path=require(_0xa685('0x4'));var sox=require(_0xa685('0x5'));var csv=require('to-csv');var ejs=require(_0xa685('0x6'));var fs=require('fs');var fs_extra=require(_0xa685('0x7'));var _=require(_0xa685('0x8'));var squel=require(_0xa685('0x9'));var crypto=require('crypto');var jsforce=require(_0xa685('0xa'));var deskjs=require(_0xa685('0xb'));var toCsv=require(_0xa685('0xc'));var querystring=require(_0xa685('0xd'));var Papa=require(_0xa685('0xe'));var Redis=require(_0xa685('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa685('0x10'));var hardwareService=require(_0xa685('0x11'));var logger=require(_0xa685('0x12'))(_0xa685('0x13'));var utils=require(_0xa685('0x14'));var config=require(_0xa685('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xa685('0x16'))['db'];function respondWithStatusCode(_0x2dc0e4,_0x3826dc){_0x3826dc=_0x3826dc||0xcc;return function(_0x5310f0){if(_0x5310f0){return _0x2dc0e4[_0xa685('0x17')](_0x3826dc);}return _0x2dc0e4[_0xa685('0x18')](_0x3826dc)['end']();};}function respondWithResult(_0x5d4c2d,_0x2ddea6){_0x2ddea6=_0x2ddea6||0xc8;return function(_0x477231){if(_0x477231){return _0x5d4c2d[_0xa685('0x18')](_0x2ddea6)['json'](_0x477231);}};}function respondWithFilteredResult(_0x2842cd,_0x1812e1){return function(_0x3cfda3){if(_0x3cfda3){var _0x27184b=typeof _0x1812e1['offset']===_0xa685('0x19')&&typeof _0x1812e1[_0xa685('0x1a')]===_0xa685('0x19');var _0x4ae204=_0x3cfda3[_0xa685('0x1b')];var _0x5f545d=_0x27184b?0x0:_0x1812e1[_0xa685('0x1c')];var _0x5b5c45=_0x27184b?_0x3cfda3[_0xa685('0x1b')]:_0x1812e1['offset']+_0x1812e1[_0xa685('0x1a')];var _0x391428;if(_0x5b5c45>=_0x4ae204){_0x5b5c45=_0x4ae204;_0x391428=0xc8;}else{_0x391428=0xce;}_0x2842cd[_0xa685('0x18')](_0x391428);return _0x2842cd[_0xa685('0x1d')]('Content-Range',_0x5f545d+'-'+_0x5b5c45+'/'+_0x4ae204)[_0xa685('0x1e')](_0x3cfda3);}return null;};}function patchUpdates(_0x1364d9){return function(_0x2145f6){try{jsonpatch['apply'](_0x2145f6,_0x1364d9,!![]);}catch(_0x362b92){return BPromise[_0xa685('0x1f')](_0x362b92);}return _0x2145f6[_0xa685('0x20')]();};}function saveUpdates(_0x617766,_0x149e53){return function(_0x1ef68e){if(_0x1ef68e){return _0x1ef68e[_0xa685('0x21')](_0x617766)[_0xa685('0x22')](function(_0x23afbe){return _0x23afbe;});}return null;};}function removeEntity(_0xd5439e,_0x451ee0){return function(_0x159965){if(_0x159965){return _0x159965['destroy']()['then'](function(){_0xd5439e['status'](0xcc)[_0xa685('0x23')]();});}};}function handleEntityNotFound(_0x2a83dd,_0x1719b2){return function(_0x568dab){if(!_0x568dab){_0x2a83dd[_0xa685('0x17')](0x194);}return _0x568dab;};}function handleError(_0x2aaa1e,_0xccabbe){_0xccabbe=_0xccabbe||0x1f4;return function(_0x2ab548){logger['error'](_0x2ab548[_0xa685('0x24')]);if(_0x2ab548['name']){delete _0x2ab548[_0xa685('0x25')];}_0x2aaa1e[_0xa685('0x18')](_0xccabbe)[_0xa685('0x26')](_0x2ab548);};}exports[_0xa685('0x27')]=function(_0x368386,_0x1e1953){var _0x3dbe78={},_0x39d734={},_0x2fda8b={'count':0x0,'rows':[]};var _0x49a16b=_[_0xa685('0x28')](db[_0xa685('0x29')][_0xa685('0x2a')],function(_0x10e8ac){return{'name':_0x10e8ac['fieldName'],'type':_0x10e8ac['type'][_0xa685('0x2b')]};});_0x39d734['model']=_['map'](_0x49a16b,_0xa685('0x25'));_0x39d734[_0xa685('0x2c')]=_['keys'](_0x368386[_0xa685('0x2c')]);_0x39d734[_0xa685('0x2d')]=_[_0xa685('0x2e')](_0x39d734[_0xa685('0x2f')],_0x39d734[_0xa685('0x2c')]);_0x3dbe78['attributes']=_[_0xa685('0x2e')](_0x39d734['model'],qs[_0xa685('0x30')](_0x368386[_0xa685('0x2c')][_0xa685('0x30')]));_0x3dbe78[_0xa685('0x31')]=_0x3dbe78['attributes'][_0xa685('0x32')]?_0x3dbe78[_0xa685('0x31')]:_0x39d734[_0xa685('0x2f')];if(!_0x368386[_0xa685('0x2c')][_0xa685('0x33')](_0xa685('0x34'))){_0x3dbe78['limit']=qs['limit'](_0x368386[_0xa685('0x2c')][_0xa685('0x1a')]);_0x3dbe78[_0xa685('0x1c')]=qs[_0xa685('0x1c')](_0x368386[_0xa685('0x2c')][_0xa685('0x1c')]);}_0x3dbe78[_0xa685('0x35')]=qs[_0xa685('0x36')](_0x368386[_0xa685('0x2c')][_0xa685('0x36')]);_0x3dbe78['where']=qs[_0xa685('0x2d')](_[_0xa685('0x37')](_0x368386['query'],_0x39d734[_0xa685('0x2d')]),_0x49a16b);if(_0x368386[_0xa685('0x2c')]['filter']){_0x3dbe78[_0xa685('0x38')]=_[_0xa685('0x39')](_0x3dbe78[_0xa685('0x38')],{'$or':_[_0xa685('0x28')](_0x49a16b,function(_0x3665a1){if(_0x3665a1[_0xa685('0x3a')]!==_0xa685('0x3b')){var _0x1d2237={};_0x1d2237[_0x3665a1['name']]={'$like':'%'+_0x368386['query']['filter']+'%'};return _0x1d2237;}})});}_0x3dbe78=_['merge']({},_0x3dbe78,_0x368386[_0xa685('0x3c')]);var _0x281803={'where':_0x3dbe78[_0xa685('0x38')]};return db[_0xa685('0x29')][_0xa685('0x1b')](_0x281803)[_0xa685('0x22')](function(_0x2376fd){_0x2fda8b[_0xa685('0x1b')]=_0x2376fd;if(_0x368386[_0xa685('0x2c')][_0xa685('0x3d')]){_0x3dbe78['include']=[{'all':!![]}];}return db[_0xa685('0x29')][_0xa685('0x3e')](_0x3dbe78);})[_0xa685('0x22')](function(_0x581f48){_0x2fda8b[_0xa685('0x3f')]=_0x581f48;return _0x2fda8b;})[_0xa685('0x22')](respondWithFilteredResult(_0x1e1953,_0x3dbe78))[_0xa685('0x40')](handleError(_0x1e1953,null));};exports[_0xa685('0x41')]=function(_0x1ffd7a,_0x3925a3){var _0x246178={'raw':![],'where':{'id':_0x1ffd7a[_0xa685('0x42')]['id']}},_0x3fdc14={};_0x3fdc14[_0xa685('0x2f')]=_[_0xa685('0x43')](db[_0xa685('0x29')][_0xa685('0x2a')]);_0x3fdc14[_0xa685('0x2c')]=_[_0xa685('0x43')](_0x1ffd7a[_0xa685('0x2c')]);_0x3fdc14[_0xa685('0x2d')]=_[_0xa685('0x2e')](_0x3fdc14[_0xa685('0x2f')],_0x3fdc14[_0xa685('0x2c')]);_0x246178[_0xa685('0x31')]=_['intersection'](_0x3fdc14['model'],qs[_0xa685('0x30')](_0x1ffd7a[_0xa685('0x2c')][_0xa685('0x30')]));_0x246178[_0xa685('0x31')]=_0x246178['attributes'][_0xa685('0x32')]?_0x246178[_0xa685('0x31')]:_0x3fdc14[_0xa685('0x2f')];if(_0x1ffd7a[_0xa685('0x2c')][_0xa685('0x3d')]){_0x246178[_0xa685('0x44')]=[{'all':!![]}];}_0x246178=_[_0xa685('0x39')]({},_0x246178,_0x1ffd7a[_0xa685('0x3c')]);return db[_0xa685('0x29')][_0xa685('0x45')](_0x246178)['then'](handleEntityNotFound(_0x3925a3,null))[_0xa685('0x22')](respondWithResult(_0x3925a3,null))[_0xa685('0x40')](handleError(_0x3925a3,null));};exports[_0xa685('0x46')]=function(_0x19cb43,_0x88dd51){return db['FreshdeskConfiguration'][_0xa685('0x46')](_0x19cb43[_0xa685('0x47')],{})[_0xa685('0x22')](respondWithResult(_0x88dd51,0xc9))['catch'](handleError(_0x88dd51,null));};exports['update']=function(_0x1e151d,_0x35151a){if(_0x1e151d['body']['id']){delete _0x1e151d[_0xa685('0x47')]['id'];}return db[_0xa685('0x29')]['find']({'where':{'id':_0x1e151d[_0xa685('0x42')]['id']}})[_0xa685('0x22')](handleEntityNotFound(_0x35151a,null))[_0xa685('0x22')](saveUpdates(_0x1e151d[_0xa685('0x47')],null))[_0xa685('0x22')](respondWithResult(_0x35151a,null))[_0xa685('0x40')](handleError(_0x35151a,null));};exports['destroy']=function(_0x3c74f0,_0x134fca){return db[_0xa685('0x29')][_0xa685('0x45')]({'where':{'id':_0x3c74f0[_0xa685('0x42')]['id']}})[_0xa685('0x22')](handleEntityNotFound(_0x134fca,null))[_0xa685('0x22')](removeEntity(_0x134fca,null))[_0xa685('0x40')](handleError(_0x134fca,null));};exports[_0xa685('0x48')]=function(_0x6143d3,_0x587e28,_0x2f3015){var _0x58c5e3={};var _0x37d9b5={};var _0x3fcc8c;var _0x2a6091;return db[_0xa685('0x29')]['findOne']({'where':{'id':_0x6143d3[_0xa685('0x42')]['id']}})['then'](handleEntityNotFound(_0x587e28,null))[_0xa685('0x22')](function(_0x433f24){if(_0x433f24){_0x3fcc8c=_0x433f24;_0x37d9b5[_0xa685('0x2f')]=_['keys'](db[_0xa685('0x49')][_0xa685('0x2a')]);_0x37d9b5[_0xa685('0x2c')]=_[_0xa685('0x43')](_0x6143d3['query']);_0x37d9b5[_0xa685('0x2d')]=_[_0xa685('0x2e')](_0x37d9b5[_0xa685('0x2f')],_0x37d9b5['query']);_0x58c5e3['attributes']=_[_0xa685('0x2e')](_0x37d9b5[_0xa685('0x2f')],qs['fields'](_0x6143d3[_0xa685('0x2c')][_0xa685('0x30')]));_0x58c5e3[_0xa685('0x31')]=_0x58c5e3['attributes'][_0xa685('0x32')]?_0x58c5e3[_0xa685('0x31')]:_0x37d9b5[_0xa685('0x2f')];_0x58c5e3[_0xa685('0x35')]=qs[_0xa685('0x36')](_0x6143d3[_0xa685('0x2c')][_0xa685('0x36')]);_0x58c5e3[_0xa685('0x38')]=qs['filters'](_[_0xa685('0x37')](_0x6143d3['query'],_0x37d9b5[_0xa685('0x2d')]));if(_0x6143d3['query'][_0xa685('0x4a')]){_0x58c5e3[_0xa685('0x38')]=_[_0xa685('0x39')](_0x58c5e3[_0xa685('0x38')],{'$or':_['map'](_0x58c5e3['attributes'],function(_0x4ca083){var _0x47e111={};_0x47e111[_0x4ca083]={'$like':'%'+_0x6143d3[_0xa685('0x2c')][_0xa685('0x4a')]+'%'};return _0x47e111;})});}_0x58c5e3=_[_0xa685('0x39')]({},_0x58c5e3,_0x6143d3[_0xa685('0x3c')]);return _0x3fcc8c['getFields'](_0x58c5e3);}})[_0xa685('0x22')](function(_0x1fc52a){if(_0x1fc52a){_0x2a6091=_0x1fc52a[_0xa685('0x32')];if(!_0x6143d3[_0xa685('0x2c')][_0xa685('0x33')]('nolimit')){_0x58c5e3['limit']=qs[_0xa685('0x1a')](_0x6143d3[_0xa685('0x2c')][_0xa685('0x1a')]);_0x58c5e3[_0xa685('0x1c')]=qs[_0xa685('0x1c')](_0x6143d3[_0xa685('0x2c')]['offset']);}return _0x3fcc8c[_0xa685('0x48')](_0x58c5e3);}})[_0xa685('0x22')](function(_0x5479d2){if(_0x5479d2){return _0x5479d2?{'count':_0x2a6091,'rows':_0x5479d2}:null;}})[_0xa685('0x22')](respondWithResult(_0x587e28,null))[_0xa685('0x40')](handleError(_0x587e28,null));};exports['getSubjects']=function(_0x4ff321,_0x51f08e,_0x4cfad6){var _0x2fa2af={};var _0xe510ec={};var _0x2c35fb;var _0x123c41;return db[_0xa685('0x29')]['findOne']({'where':{'id':_0x4ff321[_0xa685('0x42')]['id']}})[_0xa685('0x22')](handleEntityNotFound(_0x51f08e,null))['then'](function(_0x2297a3){if(_0x2297a3){_0x2c35fb=_0x2297a3;_0xe510ec[_0xa685('0x2f')]=_[_0xa685('0x43')](db[_0xa685('0x49')][_0xa685('0x2a')]);_0xe510ec[_0xa685('0x2c')]=_['keys'](_0x4ff321[_0xa685('0x2c')]);_0xe510ec[_0xa685('0x2d')]=_[_0xa685('0x2e')](_0xe510ec[_0xa685('0x2f')],_0xe510ec[_0xa685('0x2c')]);_0x2fa2af[_0xa685('0x31')]=_[_0xa685('0x2e')](_0xe510ec[_0xa685('0x2f')],qs[_0xa685('0x30')](_0x4ff321[_0xa685('0x2c')][_0xa685('0x30')]));_0x2fa2af[_0xa685('0x31')]=_0x2fa2af[_0xa685('0x31')][_0xa685('0x32')]?_0x2fa2af[_0xa685('0x31')]:_0xe510ec[_0xa685('0x2f')];_0x2fa2af['order']=qs['sort'](_0x4ff321[_0xa685('0x2c')][_0xa685('0x36')]);_0x2fa2af[_0xa685('0x38')]=qs[_0xa685('0x2d')](_[_0xa685('0x37')](_0x4ff321[_0xa685('0x2c')],_0xe510ec[_0xa685('0x2d')]));if(_0x4ff321[_0xa685('0x2c')][_0xa685('0x4a')]){_0x2fa2af[_0xa685('0x38')]=_[_0xa685('0x39')](_0x2fa2af['where'],{'$or':_[_0xa685('0x28')](_0x2fa2af[_0xa685('0x31')],function(_0x348817){var _0x635434={};_0x635434[_0x348817]={'$like':'%'+_0x4ff321[_0xa685('0x2c')][_0xa685('0x4a')]+'%'};return _0x635434;})});}_0x2fa2af=_['merge']({},_0x2fa2af,_0x4ff321[_0xa685('0x3c')]);return _0x2c35fb[_0xa685('0x4b')](_0x2fa2af);}})[_0xa685('0x22')](function(_0x1aaf87){if(_0x1aaf87){_0x123c41=_0x1aaf87[_0xa685('0x32')];if(!_0x4ff321[_0xa685('0x2c')][_0xa685('0x33')](_0xa685('0x34'))){_0x2fa2af[_0xa685('0x1a')]=qs[_0xa685('0x1a')](_0x4ff321['query'][_0xa685('0x1a')]);_0x2fa2af[_0xa685('0x1c')]=qs[_0xa685('0x1c')](_0x4ff321[_0xa685('0x2c')][_0xa685('0x1c')]);}return _0x2c35fb[_0xa685('0x4b')](_0x2fa2af);}})['then'](function(_0x1793f7){if(_0x1793f7){return _0x1793f7?{'count':_0x123c41,'rows':_0x1793f7}:null;}})[_0xa685('0x22')](respondWithResult(_0x51f08e,null))['catch'](handleError(_0x51f08e,null));};exports[_0xa685('0x4c')]=function(_0x42c0e9,_0x560664,_0x2e7880){var _0x126588={};var _0x8c9cef={};var _0x5dabb7;var _0xf01c29;return db[_0xa685('0x29')][_0xa685('0x4d')]({'where':{'id':_0x42c0e9[_0xa685('0x42')]['id']}})['then'](handleEntityNotFound(_0x560664,null))[_0xa685('0x22')](function(_0x1cbd39){if(_0x1cbd39){_0x5dabb7=_0x1cbd39;_0x8c9cef['model']=_['keys'](db[_0xa685('0x49')][_0xa685('0x2a')]);_0x8c9cef[_0xa685('0x2c')]=_['keys'](_0x42c0e9[_0xa685('0x2c')]);_0x8c9cef[_0xa685('0x2d')]=_['intersection'](_0x8c9cef[_0xa685('0x2f')],_0x8c9cef[_0xa685('0x2c')]);_0x126588[_0xa685('0x31')]=_['intersection'](_0x8c9cef['model'],qs[_0xa685('0x30')](_0x42c0e9['query'][_0xa685('0x30')]));_0x126588[_0xa685('0x31')]=_0x126588[_0xa685('0x31')][_0xa685('0x32')]?_0x126588[_0xa685('0x31')]:_0x8c9cef[_0xa685('0x2f')];_0x126588[_0xa685('0x35')]=qs['sort'](_0x42c0e9[_0xa685('0x2c')][_0xa685('0x36')]);_0x126588['where']=qs[_0xa685('0x2d')](_[_0xa685('0x37')](_0x42c0e9['query'],_0x8c9cef[_0xa685('0x2d')]));if(_0x42c0e9['query']['filter']){_0x126588['where']=_[_0xa685('0x39')](_0x126588[_0xa685('0x38')],{'$or':_[_0xa685('0x28')](_0x126588[_0xa685('0x31')],function(_0x565099){var _0x1dfc81={};_0x1dfc81[_0x565099]={'$like':'%'+_0x42c0e9[_0xa685('0x2c')][_0xa685('0x4a')]+'%'};return _0x1dfc81;})});}_0x126588=_[_0xa685('0x39')]({},_0x126588,_0x42c0e9[_0xa685('0x3c')]);return _0x5dabb7[_0xa685('0x4c')](_0x126588);}})['then'](function(_0x5ab933){if(_0x5ab933){_0xf01c29=_0x5ab933['length'];if(!_0x42c0e9['query'][_0xa685('0x33')](_0xa685('0x34'))){_0x126588[_0xa685('0x1a')]=qs[_0xa685('0x1a')](_0x42c0e9[_0xa685('0x2c')][_0xa685('0x1a')]);_0x126588[_0xa685('0x1c')]=qs[_0xa685('0x1c')](_0x42c0e9[_0xa685('0x2c')][_0xa685('0x1c')]);}return _0x5dabb7['getDescriptions'](_0x126588);}})[_0xa685('0x22')](function(_0x4399f5){if(_0x4399f5){return _0x4399f5?{'count':_0xf01c29,'rows':_0x4399f5}:null;}})[_0xa685('0x22')](respondWithResult(_0x560664,null))[_0xa685('0x40')](handleError(_0x560664,null));};exports['getTags']=function(_0x13737c,_0x12ea59,_0x91e71){var _0x4002ae={};var _0x4e61b8={};var _0x439237;var _0x516b56;return db[_0xa685('0x29')][_0xa685('0x4d')]({'where':{'id':_0x13737c[_0xa685('0x42')]['id']}})[_0xa685('0x22')](handleEntityNotFound(_0x12ea59,null))['then'](function(_0x2506e6){if(_0x2506e6){_0x439237=_0x2506e6;_0x4e61b8['model']=_['keys'](db[_0xa685('0x4e')][_0xa685('0x2a')]);_0x4e61b8[_0xa685('0x2c')]=_[_0xa685('0x43')](_0x13737c[_0xa685('0x2c')]);_0x4e61b8[_0xa685('0x2d')]=_['intersection'](_0x4e61b8[_0xa685('0x2f')],_0x4e61b8[_0xa685('0x2c')]);_0x4002ae[_0xa685('0x31')]=_['intersection'](_0x4e61b8['model'],qs[_0xa685('0x30')](_0x13737c[_0xa685('0x2c')][_0xa685('0x30')]));_0x4002ae[_0xa685('0x31')]=_0x4002ae[_0xa685('0x31')][_0xa685('0x32')]?_0x4002ae['attributes']:_0x4e61b8[_0xa685('0x2f')];_0x4002ae[_0xa685('0x35')]=qs[_0xa685('0x36')](_0x13737c[_0xa685('0x2c')][_0xa685('0x36')]);_0x4002ae['where']=qs[_0xa685('0x2d')](_[_0xa685('0x37')](_0x13737c[_0xa685('0x2c')],_0x4e61b8[_0xa685('0x2d')]));if(_0x13737c[_0xa685('0x2c')][_0xa685('0x4a')]){_0x4002ae[_0xa685('0x38')]=_['merge'](_0x4002ae[_0xa685('0x38')],{'$or':_['map'](_0x4002ae[_0xa685('0x31')],function(_0x21add9){var _0x273151={};_0x273151[_0x21add9]={'$like':'%'+_0x13737c[_0xa685('0x2c')][_0xa685('0x4a')]+'%'};return _0x273151;})});}_0x4002ae=_[_0xa685('0x39')]({},_0x4002ae,_0x13737c[_0xa685('0x3c')]);return _0x439237[_0xa685('0x4f')](_0x4002ae);}})[_0xa685('0x22')](function(_0x283931){if(_0x283931){_0x516b56=_0x283931[_0xa685('0x32')];if(!_0x13737c[_0xa685('0x2c')][_0xa685('0x33')](_0xa685('0x34'))){_0x4002ae[_0xa685('0x1a')]=qs[_0xa685('0x1a')](_0x13737c[_0xa685('0x2c')][_0xa685('0x1a')]);_0x4002ae[_0xa685('0x1c')]=qs[_0xa685('0x1c')](_0x13737c[_0xa685('0x2c')][_0xa685('0x1c')]);}return _0x439237[_0xa685('0x4f')](_0x4002ae);}})['then'](function(_0x4777c4){if(_0x4777c4){return _0x4777c4?{'count':_0x516b56,'rows':_0x4777c4}:null;}})[_0xa685('0x22')](respondWithResult(_0x12ea59,null))[_0xa685('0x40')](handleError(_0x12ea59,null));};exports['setTags']=function(_0x289b4a,_0x351ce1,_0x4be8fc){if(_0x289b4a['body']['id']){delete _0x289b4a[_0xa685('0x47')]['id'];}return db[_0xa685('0x29')][_0xa685('0x4d')]({'where':{'id':_0x289b4a[_0xa685('0x42')]['id']}})[_0xa685('0x22')](handleEntityNotFound(_0x351ce1,null))['then'](function(_0xc477f3){if(_0xc477f3){return _0xc477f3[_0xa685('0x50')](_0x289b4a[_0xa685('0x47')][_0xa685('0x51')]||[]);}return null;})['then'](respondWithResult(_0x351ce1,null))[_0xa685('0x40')](handleError(_0x351ce1,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 5de796c..411d2be 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 _0x8219=['./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5b1382,_0x201a6f){var _0x2bd71a=function(_0x288548){while(--_0x288548){_0x5b1382['push'](_0x5b1382['shift']());}};_0x2bd71a(++_0x201a6f);}(_0x8219,0x164));var _0x9821=function(_0x344357,_0x484651){_0x344357=_0x344357-0x0;var _0x1aaa49=_0x8219[_0x344357];return _0x1aaa49;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9821('0x0'))(_0x9821('0x1'));var moment=require(_0x9821('0x2'));var BPromise=require('bluebird');var rp=require(_0x9821('0x3'));var fs=require('fs');var path=require(_0x9821('0x4'));var rimraf=require(_0x9821('0x5'));var config=require(_0x9821('0x6'));var attributes=require(_0x9821('0x7'));module['exports']=function(_0x3c37ab,_0x1213fe){return _0x3c37ab[_0x9821('0x8')](_0x9821('0x9'),attributes,{'tableName':_0x9821('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d97=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','path','../../config/environment','./intFreshdeskConfiguration.attributes','exports'];(function(_0x50dbaf,_0x580f67){var _0x4be454=function(_0x7346a0){while(--_0x7346a0){_0x50dbaf['push'](_0x50dbaf['shift']());}};_0x4be454(++_0x580f67);}(_0x7d97,0xff));var _0x77d9=function(_0x5b84a3,_0x38a508){_0x5b84a3=_0x5b84a3-0x0;var _0x18cf32=_0x7d97[_0x5b84a3];return _0x18cf32;};'use strict';var _=require(_0x77d9('0x0'));var util=require(_0x77d9('0x1'));var logger=require(_0x77d9('0x2'))(_0x77d9('0x3'));var moment=require(_0x77d9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x77d9('0x5'));var rimraf=require('rimraf');var config=require(_0x77d9('0x6'));var attributes=require(_0x77d9('0x7'));module[_0x77d9('0x8')]=function(_0xeb971b,_0x4d6098){return _0xeb971b['define'](_0x77d9('0x9'),attributes,{'tableName':_0x77d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 95f2e46..a47bc8a 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 _0xd5ac=['catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result'];(function(_0x9ddc7a,_0x1c5290){var _0x1d9ffe=function(_0x82f429){while(--_0x82f429){_0x9ddc7a['push'](_0x9ddc7a['shift']());}};_0x1d9ffe(++_0x1c5290);}(_0xd5ac,0x1ba));var _0xcd5a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd5ac[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xcd5a('0x0'));var util=require('util');var moment=require(_0xcd5a('0x1'));var BPromise=require(_0xcd5a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd5a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcd5a('0x4'));var logger=require(_0xcd5a('0x5'))('rpc');var config=require(_0xcd5a('0x6'));var jayson=require(_0xcd5a('0x7'));var client=jayson[_0xcd5a('0x8')][_0xcd5a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f55e4,_0x4e624b,_0x3e5c5e){return new BPromise(function(_0x133774,_0x92afc9){return client[_0xcd5a('0xa')](_0x3f55e4,_0x3e5c5e)[_0xcd5a('0xb')](function(_0x455bce){logger['info'](_0xcd5a('0xc'),_0x4e624b,'request\x20sent');logger[_0xcd5a('0xd')](_0xcd5a('0xe'),_0x4e624b,_0xcd5a('0xf'),JSON['stringify'](_0x455bce));if(_0x455bce[_0xcd5a('0x10')]){if(_0x455bce[_0xcd5a('0x10')]['code']===0x1f4){logger[_0xcd5a('0x10')](_0xcd5a('0xc'),_0x4e624b,_0x455bce[_0xcd5a('0x10')][_0xcd5a('0x11')]);return _0x92afc9(_0x455bce[_0xcd5a('0x10')][_0xcd5a('0x11')]);}logger[_0xcd5a('0x10')](_0xcd5a('0xc'),_0x4e624b,_0x455bce[_0xcd5a('0x10')][_0xcd5a('0x11')]);return _0x133774(_0x455bce[_0xcd5a('0x10')][_0xcd5a('0x11')]);}else{logger[_0xcd5a('0x12')](_0xcd5a('0xc'),_0x4e624b,'request\x20sent');_0x133774(_0x455bce[_0xcd5a('0x13')][_0xcd5a('0x11')]);}})[_0xcd5a('0x14')](function(_0x2c2465){logger[_0xcd5a('0x10')](_0xcd5a('0xc'),_0x4e624b,_0x2c2465);_0x92afc9(_0x2c2465);});});} \ No newline at end of file +var _0xedaa=['info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x597ab3,_0x264381){var _0x243015=function(_0x16f8f1){while(--_0x16f8f1){_0x597ab3['push'](_0x597ab3['shift']());}};_0x243015(++_0x264381);}(_0xedaa,0x18f));var _0xaeda=function(_0x17403a,_0x99f091){_0x17403a=_0x17403a-0x0;var _0x34f328=_0xedaa[_0x17403a];return _0x34f328;};'use strict';var _=require(_0xaeda('0x0'));var util=require(_0xaeda('0x1'));var moment=require(_0xaeda('0x2'));var BPromise=require(_0xaeda('0x3'));var rs=require(_0xaeda('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaeda('0x5'))['db'];var utils=require(_0xaeda('0x6'));var logger=require(_0xaeda('0x7'))(_0xaeda('0x8'));var config=require(_0xaeda('0x9'));var jayson=require(_0xaeda('0xa'));var client=jayson[_0xaeda('0xb')][_0xaeda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48a1e0,_0xdd13a2,_0x33f57c){return new BPromise(function(_0x2e5012,_0x184385){return client[_0xaeda('0xd')](_0x48a1e0,_0x33f57c)[_0xaeda('0xe')](function(_0x316fc9){logger[_0xaeda('0xf')](_0xaeda('0x10'),_0xdd13a2,_0xaeda('0x11'));logger[_0xaeda('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0xdd13a2,'request\x20sent',JSON[_0xaeda('0x13')](_0x316fc9));if(_0x316fc9[_0xaeda('0x14')]){if(_0x316fc9[_0xaeda('0x14')]['code']===0x1f4){logger['error'](_0xaeda('0x10'),_0xdd13a2,_0x316fc9[_0xaeda('0x14')][_0xaeda('0x15')]);return _0x184385(_0x316fc9['error'][_0xaeda('0x15')]);}logger['error'](_0xaeda('0x10'),_0xdd13a2,_0x316fc9['error']['message']);return _0x2e5012(_0x316fc9[_0xaeda('0x14')]['message']);}else{logger[_0xaeda('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xdd13a2,_0xaeda('0x11'));_0x2e5012(_0x316fc9[_0xaeda('0x16')][_0xaeda('0x15')]);}})['catch'](function(_0x510fe1){logger['error'](_0xaeda('0x10'),_0xdd13a2,_0x510fe1);_0x184385(_0x510fe1);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 41fe36a..97c2d0b 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 _0xebb9=['/:id','show','post','isAuthenticated','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller'];(function(_0xa2c031,_0x3e08f1){var _0x3d4c98=function(_0x150901){while(--_0x150901){_0xa2c031['push'](_0xa2c031['shift']());}};_0x3d4c98(++_0x3e08f1);}(_0xebb9,0x1c3));var _0x9ebb=function(_0x559fb6,_0x29408b){_0x559fb6=_0x559fb6-0x0;var _0x270b89=_0xebb9[_0x559fb6];return _0x270b89;};'use strict';var multer=require('multer');var util=require(_0x9ebb('0x0'));var path=require(_0x9ebb('0x1'));var timeout=require(_0x9ebb('0x2'));var express=require('express');var router=express[_0x9ebb('0x3')]();var fs_extra=require(_0x9ebb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9ebb('0x5'));var config=require(_0x9ebb('0x6'));var controller=require(_0x9ebb('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x9ebb('0x8'),auth['isAuthenticated'](),controller[_0x9ebb('0x9')]);router[_0x9ebb('0xa')]('/',auth[_0x9ebb('0xb')](),controller[_0x9ebb('0xc')]);router[_0x9ebb('0xd')](_0x9ebb('0x8'),auth[_0x9ebb('0xb')](),controller[_0x9ebb('0xe')]);router[_0x9ebb('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9ebb('0x10')]=router; \ No newline at end of file +var _0xe001=['multer','util','connect-timeout','express','fs-extra','../../components/auth/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x2856a0,_0x4c1227){var _0x54b2e6=function(_0x1b74f3){while(--_0x1b74f3){_0x2856a0['push'](_0x2856a0['shift']());}};_0x54b2e6(++_0x4c1227);}(_0xe001,0x1b0));var _0x1e00=function(_0x144dba,_0xb5c8e1){_0x144dba=_0x144dba-0x0;var _0x45d653=_0xe001[_0x144dba];return _0x45d653;};'use strict';var multer=require(_0x1e00('0x0'));var util=require(_0x1e00('0x1'));var path=require('path');var timeout=require(_0x1e00('0x2'));var express=require(_0x1e00('0x3'));var router=express['Router']();var fs_extra=require(_0x1e00('0x4'));var auth=require(_0x1e00('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1e00('0x6'));router[_0x1e00('0x7')]('/',auth[_0x1e00('0x8')](),controller[_0x1e00('0x9')]);router['get'](_0x1e00('0xa'),auth[_0x1e00('0x8')](),controller[_0x1e00('0xb')]);router[_0x1e00('0xc')]('/',auth[_0x1e00('0x8')](),controller[_0x1e00('0xd')]);router[_0x1e00('0xe')](_0x1e00('0xa'),auth['isAuthenticated'](),controller[_0x1e00('0xf')]);router['delete']('/:id',auth[_0x1e00('0x8')](),controller['destroy']);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 b2a355a..2bd146c 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 _0x0bf6=['customVariable','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x1dbca1,_0x346b47){var _0xee3f3d=function(_0x1e68cf){while(--_0x1e68cf){_0x1dbca1['push'](_0x1dbca1['shift']());}};_0xee3f3d(++_0x346b47);}(_0x0bf6,0x8c));var _0x60bf=function(_0x14565b,_0x19d983){_0x14565b=_0x14565b-0x0;var _0x3dacc7=_0x0bf6[_0x14565b];return _0x3dacc7;};'use strict';var Sequelize=require(_0x60bf('0x0'));module[_0x60bf('0x1')]={'type':{'type':Sequelize['ENUM'](_0x60bf('0x2'),_0x60bf('0x3'),_0x60bf('0x4'),'keyValue','picklist'),'defaultValue':_0x60bf('0x2')},'content':{'type':Sequelize[_0x60bf('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x60bf('0x6')]('string',_0x60bf('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x60bf('0x5')]},'idField':{'type':Sequelize[_0x60bf('0x5')]},'nameField':{'type':Sequelize[_0x60bf('0x5')]},'customField':{'type':Sequelize[_0x60bf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x60bf('0x5')]}}; \ No newline at end of file +var _0x8f6c=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x1d9dda,_0x34f418){var _0x1e6abd=function(_0xad04af){while(--_0xad04af){_0x1d9dda['push'](_0x1d9dda['shift']());}};_0x1e6abd(++_0x34f418);}(_0x8f6c,0x7e));var _0xc8f6=function(_0x3276aa,_0x48d9ce){_0x3276aa=_0x3276aa-0x0;var _0x270793=_0x8f6c[_0x3276aa];return _0x270793;};'use strict';var Sequelize=require(_0xc8f6('0x0'));module[_0xc8f6('0x1')]={'type':{'type':Sequelize[_0xc8f6('0x2')](_0xc8f6('0x3'),_0xc8f6('0x4'),_0xc8f6('0x5'),_0xc8f6('0x6'),_0xc8f6('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xc8f6('0x8')]},'key':{'type':Sequelize[_0xc8f6('0x8')]},'keyType':{'type':Sequelize[_0xc8f6('0x2')](_0xc8f6('0x3'),_0xc8f6('0x4'),_0xc8f6('0x5'))},'keyContent':{'type':Sequelize[_0xc8f6('0x8')]},'idField':{'type':Sequelize[_0xc8f6('0x8')]},'nameField':{'type':Sequelize[_0xc8f6('0x8')]},'customField':{'type':Sequelize[_0xc8f6('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index f63952f..52da8ed 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 _0x57f8=['query','intersection','attributes','fields','hasOwnProperty','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','model','keys'];(function(_0x202aa2,_0x584b66){var _0x4e8000=function(_0x400b30){while(--_0x400b30){_0x202aa2['push'](_0x202aa2['shift']());}};_0x4e8000(++_0x584b66);}(_0x57f8,0x198));var _0x857f=function(_0x1d006a,_0x2812b5){_0x1d006a=_0x1d006a-0x0;var _0x20a76b=_0x57f8[_0x1d006a];return _0x20a76b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];function respondWithStatusCode(_0x533631,_0x2e1eda){_0x2e1eda=_0x2e1eda||0xcc;return function(_0x2d5e26){if(_0x2d5e26){return _0x533631[_0x857f('0x1b')](_0x2e1eda);}return _0x533631[_0x857f('0x1c')](_0x2e1eda)[_0x857f('0x1d')]();};}function respondWithResult(_0x4a25ec,_0x4bc590){_0x4bc590=_0x4bc590||0xc8;return function(_0x3b09d9){if(_0x3b09d9){return _0x4a25ec['status'](_0x4bc590)[_0x857f('0x1e')](_0x3b09d9);}};}function respondWithFilteredResult(_0x4ac81f,_0x1d47bf){return function(_0x134a4f){if(_0x134a4f){var _0x5c3a69=typeof _0x1d47bf[_0x857f('0x1f')]===_0x857f('0x20')&&typeof _0x1d47bf[_0x857f('0x21')]===_0x857f('0x20');var _0x279e74=_0x134a4f[_0x857f('0x22')];var _0x1a9ef8=_0x5c3a69?0x0:_0x1d47bf[_0x857f('0x1f')];var _0x1014ca=_0x5c3a69?_0x134a4f[_0x857f('0x22')]:_0x1d47bf[_0x857f('0x1f')]+_0x1d47bf['limit'];var _0x1729d8;if(_0x1014ca>=_0x279e74){_0x1014ca=_0x279e74;_0x1729d8=0xc8;}else{_0x1729d8=0xce;}_0x4ac81f[_0x857f('0x1c')](_0x1729d8);return _0x4ac81f['set'](_0x857f('0x23'),_0x1a9ef8+'-'+_0x1014ca+'/'+_0x279e74)[_0x857f('0x1e')](_0x134a4f);}return null;};}function patchUpdates(_0x377587){return function(_0x484035){try{jsonpatch['apply'](_0x484035,_0x377587,!![]);}catch(_0x12ee77){return BPromise[_0x857f('0x24')](_0x12ee77);}return _0x484035[_0x857f('0x25')]();};}function saveUpdates(_0x4fa031,_0x118237){return function(_0x17a98e){if(_0x17a98e){return _0x17a98e[_0x857f('0x26')](_0x4fa031)['then'](function(_0x1961ea){return _0x1961ea;});}return null;};}function removeEntity(_0x14a8ce,_0x50bfb7){return function(_0x3bc543){if(_0x3bc543){return _0x3bc543[_0x857f('0x27')]()[_0x857f('0x28')](function(){_0x14a8ce[_0x857f('0x1c')](0xcc)[_0x857f('0x1d')]();});}};}function handleEntityNotFound(_0x3b23a7,_0x233a68){return function(_0x2a89ba){if(!_0x2a89ba){_0x3b23a7[_0x857f('0x1b')](0x194);}return _0x2a89ba;};}function handleError(_0xcd1ee9,_0x72f0aa){_0x72f0aa=_0x72f0aa||0x1f4;return function(_0x4782ab){logger[_0x857f('0x29')](_0x4782ab[_0x857f('0x2a')]);if(_0x4782ab['name']){delete _0x4782ab[_0x857f('0x2b')];}_0xcd1ee9[_0x857f('0x1c')](_0x72f0aa)[_0x857f('0x2c')](_0x4782ab);};}exports[_0x857f('0x2d')]=function(_0x58c2de,_0x40c306){var _0x57ceaa={},_0x1b405a={},_0x234048={'count':0x0,'rows':[]};var _0x45a37f=_[_0x857f('0x2e')](db[_0x857f('0x2f')][_0x857f('0x30')],function(_0x1c4fff){return{'name':_0x1c4fff[_0x857f('0x31')],'type':_0x1c4fff[_0x857f('0x32')][_0x857f('0x33')]};});_0x1b405a[_0x857f('0x34')]=_[_0x857f('0x2e')](_0x45a37f,_0x857f('0x2b'));_0x1b405a['query']=_[_0x857f('0x35')](_0x58c2de[_0x857f('0x36')]);_0x1b405a['filters']=_[_0x857f('0x37')](_0x1b405a[_0x857f('0x34')],_0x1b405a['query']);_0x57ceaa[_0x857f('0x38')]=_[_0x857f('0x37')](_0x1b405a['model'],qs[_0x857f('0x39')](_0x58c2de[_0x857f('0x36')][_0x857f('0x39')]));_0x57ceaa[_0x857f('0x38')]=_0x57ceaa['attributes']['length']?_0x57ceaa[_0x857f('0x38')]:_0x1b405a[_0x857f('0x34')];if(!_0x58c2de['query'][_0x857f('0x3a')]('nolimit')){_0x57ceaa[_0x857f('0x21')]=qs[_0x857f('0x21')](_0x58c2de[_0x857f('0x36')][_0x857f('0x21')]);_0x57ceaa[_0x857f('0x1f')]=qs['offset'](_0x58c2de['query'][_0x857f('0x1f')]);}_0x57ceaa['order']=qs[_0x857f('0x3b')](_0x58c2de[_0x857f('0x36')][_0x857f('0x3b')]);_0x57ceaa['where']=qs[_0x857f('0x3c')](_[_0x857f('0x3d')](_0x58c2de[_0x857f('0x36')],_0x1b405a[_0x857f('0x3c')]),_0x45a37f);if(_0x58c2de[_0x857f('0x36')][_0x857f('0x3e')]){_0x57ceaa[_0x857f('0x3f')]=_['merge'](_0x57ceaa[_0x857f('0x3f')],{'$or':_[_0x857f('0x2e')](_0x45a37f,function(_0x1f285c){if(_0x1f285c[_0x857f('0x32')]!==_0x857f('0x40')){var _0x2356fb={};_0x2356fb[_0x1f285c[_0x857f('0x2b')]]={'$like':'%'+_0x58c2de['query'][_0x857f('0x3e')]+'%'};return _0x2356fb;}})});}_0x57ceaa=_[_0x857f('0x41')]({},_0x57ceaa,_0x58c2de[_0x857f('0x42')]);var _0xc2ac41={'where':_0x57ceaa[_0x857f('0x3f')]};return db[_0x857f('0x2f')]['count'](_0xc2ac41)[_0x857f('0x28')](function(_0x354678){_0x234048[_0x857f('0x22')]=_0x354678;if(_0x58c2de[_0x857f('0x36')][_0x857f('0x43')]){_0x57ceaa[_0x857f('0x44')]=[{'all':!![]}];}return db[_0x857f('0x2f')][_0x857f('0x45')](_0x57ceaa);})['then'](function(_0x40fb37){_0x234048[_0x857f('0x46')]=_0x40fb37;return _0x234048;})[_0x857f('0x28')](respondWithFilteredResult(_0x40c306,_0x57ceaa))[_0x857f('0x47')](handleError(_0x40c306,null));};exports[_0x857f('0x48')]=function(_0x1bbf9f,_0x374b9f){var _0x42d922={'raw':!![],'where':{'id':_0x1bbf9f[_0x857f('0x49')]['id']}},_0xb4d7c2={};_0xb4d7c2[_0x857f('0x34')]=_[_0x857f('0x35')](db[_0x857f('0x2f')][_0x857f('0x30')]);_0xb4d7c2['query']=_[_0x857f('0x35')](_0x1bbf9f['query']);_0xb4d7c2[_0x857f('0x3c')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],_0xb4d7c2[_0x857f('0x36')]);_0x42d922[_0x857f('0x38')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],qs[_0x857f('0x39')](_0x1bbf9f[_0x857f('0x36')][_0x857f('0x39')]));_0x42d922[_0x857f('0x38')]=_0x42d922['attributes']['length']?_0x42d922[_0x857f('0x38')]:_0xb4d7c2['model'];if(_0x1bbf9f[_0x857f('0x36')]['includeAll']){_0x42d922[_0x857f('0x44')]=[{'all':!![]}];}_0x42d922=_[_0x857f('0x41')]({},_0x42d922,_0x1bbf9f[_0x857f('0x42')]);return db[_0x857f('0x2f')][_0x857f('0x4a')](_0x42d922)[_0x857f('0x28')](handleEntityNotFound(_0x374b9f,null))[_0x857f('0x28')](respondWithResult(_0x374b9f,null))[_0x857f('0x47')](handleError(_0x374b9f,null));};exports['create']=function(_0x42cf05,_0x3b431d){return db[_0x857f('0x2f')][_0x857f('0x4b')](_0x42cf05['body'],{})[_0x857f('0x28')](respondWithResult(_0x3b431d,0xc9))[_0x857f('0x47')](handleError(_0x3b431d,null));};exports[_0x857f('0x26')]=function(_0x736ef6,_0x67563){if(_0x736ef6['body']['id']){delete _0x736ef6[_0x857f('0x4c')]['id'];}return db[_0x857f('0x2f')]['find']({'where':{'id':_0x736ef6[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x67563,null))['then'](saveUpdates(_0x736ef6[_0x857f('0x4c')],null))['then'](respondWithResult(_0x67563,null))[_0x857f('0x47')](handleError(_0x67563,null));};exports[_0x857f('0x27')]=function(_0x446fe9,_0x2008d5){return db[_0x857f('0x2f')][_0x857f('0x4a')]({'where':{'id':_0x446fe9[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x2008d5,null))[_0x857f('0x28')](removeEntity(_0x2008d5,null))[_0x857f('0x47')](handleError(_0x2008d5,null));}; \ No newline at end of file +var _0xac4a=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','FreshdeskField','type','key','model','query','filters','intersection','attributes','fields'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0xac4a,0x13f));var _0xaac4=function(_0x35cbfc,_0x6a8fc2){_0x35cbfc=_0x35cbfc-0x0;var _0x5e51d9=_0xac4a[_0x35cbfc];return _0x5e51d9;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={},_0x16b33c={},_0xda10b6={'count':0x0,'rows':[]};var _0xb76ccc=_[_0xaac4('0x29')](db[_0xaac4('0x2a')]['rawAttributes'],function(_0xcf6c1){return{'name':_0xcf6c1['fieldName'],'type':_0xcf6c1[_0xaac4('0x2b')][_0xaac4('0x2c')]};});_0x16b33c[_0xaac4('0x2d')]=_[_0xaac4('0x29')](_0xb76ccc,'name');_0x16b33c['query']=_['keys'](_0x386c9b[_0xaac4('0x2e')]);_0x16b33c[_0xaac4('0x2f')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],_0x16b33c[_0xaac4('0x2e')]);_0x316445[_0xaac4('0x31')]=_[_0xaac4('0x30')](_0x16b33c[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x32')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x33')]?_0x316445[_0xaac4('0x31')]:_0x16b33c['model'];if(!_0x386c9b['query'][_0xaac4('0x34')](_0xaac4('0x35'))){_0x316445[_0xaac4('0x1a')]=qs['limit'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x1a')]);_0x316445[_0xaac4('0x18')]=qs[_0xaac4('0x18')](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x18')]);}_0x316445[_0xaac4('0x36')]=qs['sort'](_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x37')]);_0x316445[_0xaac4('0x38')]=qs['filters'](_[_0xaac4('0x39')](_0x386c9b['query'],_0x16b33c['filters']),_0xb76ccc);if(_0x386c9b[_0xaac4('0x2e')][_0xaac4('0x3a')]){_0x316445[_0xaac4('0x38')]=_['merge'](_0x316445['where'],{'$or':_[_0xaac4('0x29')](_0xb76ccc,function(_0x33cc4){if(_0x33cc4[_0xaac4('0x2b')]!==_0xaac4('0x3b')){var _0x2b65b1={};_0x2b65b1[_0x33cc4[_0xaac4('0x26')]]={'$like':'%'+_0x386c9b['query']['filter']+'%'};return _0x2b65b1;}})});}_0x316445=_[_0xaac4('0x3c')]({},_0x316445,_0x386c9b[_0xaac4('0x3d')]);var _0x5371b4={'where':_0x316445[_0xaac4('0x38')]};return db[_0xaac4('0x2a')][_0xaac4('0x1b')](_0x5371b4)['then'](function(_0x74a1c){_0xda10b6[_0xaac4('0x1b')]=_0x74a1c;if(_0x386c9b[_0xaac4('0x2e')]['includeAll']){_0x316445[_0xaac4('0x3e')]=[{'all':!![]}];}return db[_0xaac4('0x2a')][_0xaac4('0x3f')](_0x316445);})[_0xaac4('0x23')](function(_0x51e59d){_0xda10b6[_0xaac4('0x40')]=_0x51e59d;return _0xda10b6;})['then'](respondWithFilteredResult(_0x4d0f5f,_0x316445))['catch'](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x41')]=function(_0x31e240,_0x27df36){var _0x40c007={'raw':!![],'where':{'id':_0x31e240[_0xaac4('0x42')]['id']}},_0x43bc12={};_0x43bc12[_0xaac4('0x2d')]=_[_0xaac4('0x43')](db['FreshdeskField'][_0xaac4('0x44')]);_0x43bc12[_0xaac4('0x2e')]=_[_0xaac4('0x43')](_0x31e240[_0xaac4('0x2e')]);_0x43bc12['filters']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],_0x43bc12[_0xaac4('0x2e')]);_0x40c007['attributes']=_[_0xaac4('0x30')](_0x43bc12[_0xaac4('0x2d')],qs[_0xaac4('0x32')](_0x31e240[_0xaac4('0x2e')]['fields']));_0x40c007[_0xaac4('0x31')]=_0x40c007[_0xaac4('0x31')][_0xaac4('0x33')]?_0x40c007['attributes']:_0x43bc12[_0xaac4('0x2d')];if(_0x31e240[_0xaac4('0x2e')][_0xaac4('0x45')]){_0x40c007[_0xaac4('0x3e')]=[{'all':!![]}];}_0x40c007=_[_0xaac4('0x3c')]({},_0x40c007,_0x31e240[_0xaac4('0x3d')]);return db[_0xaac4('0x2a')][_0xaac4('0x46')](_0x40c007)[_0xaac4('0x23')](handleEntityNotFound(_0x27df36,null))['then'](respondWithResult(_0x27df36,null))[_0xaac4('0x47')](handleError(_0x27df36,null));};exports[_0xaac4('0x48')]=function(_0x27425a,_0x360420){return db[_0xaac4('0x2a')]['create'](_0x27425a['body'],{})[_0xaac4('0x23')](respondWithResult(_0x360420,0xc9))[_0xaac4('0x47')](handleError(_0x360420,null));};exports[_0xaac4('0x21')]=function(_0x16c7f4,_0x5f33ea){if(_0x16c7f4[_0xaac4('0x49')]['id']){delete _0x16c7f4['body']['id'];}return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x16c7f4['params']['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x5f33ea,null))[_0xaac4('0x23')](saveUpdates(_0x16c7f4[_0xaac4('0x49')],null))['then'](respondWithResult(_0x5f33ea,null))['catch'](handleError(_0x5f33ea,null));};exports[_0xaac4('0x22')]=function(_0x2c1751,_0x22dda7){return db[_0xaac4('0x2a')][_0xaac4('0x46')]({'where':{'id':_0x2c1751[_0xaac4('0x42')]['id']}})['then'](handleEntityNotFound(_0x22dda7,null))[_0xaac4('0x23')](removeEntity(_0x22dda7,null))[_0xaac4('0x47')](handleError(_0x22dda7,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 38d7daa..f585465 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 _0x6a72=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','FreshdeskField','int_freshdesk_fields','idField','FieldId'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0x6a72,0x118));var _0x26a7=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0x6a72[_0x576e2b];return _0x46461a;};'use strict';var _=require(_0x26a7('0x0'));var util=require(_0x26a7('0x1'));var logger=require(_0x26a7('0x2'))('api');var moment=require(_0x26a7('0x3'));var BPromise=require('bluebird');var rp=require(_0x26a7('0x4'));var fs=require('fs');var path=require(_0x26a7('0x5'));var rimraf=require(_0x26a7('0x6'));var config=require(_0x26a7('0x7'));var attributes=require(_0x26a7('0x8'));module[_0x26a7('0x9')]=function(_0x4751bb,_0x27c9b0){return _0x4751bb['define'](_0x26a7('0xa'),attributes,{'tableName':_0x26a7('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x26a7('0xc'),_0x26a7('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5136=['request-promise','path','rimraf','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird'];(function(_0x141f24,_0x3b318c){var _0x257fd2=function(_0x3e3a56){while(--_0x3e3a56){_0x141f24['push'](_0x141f24['shift']());}};_0x257fd2(++_0x3b318c);}(_0x5136,0x73));var _0x6513=function(_0x27fd43,_0x43db99){_0x27fd43=_0x27fd43-0x0;var _0xd43c29=_0x5136[_0x27fd43];return _0xd43c29;};'use strict';var _=require(_0x6513('0x0'));var util=require(_0x6513('0x1'));var logger=require(_0x6513('0x2'))('api');var moment=require(_0x6513('0x3'));var BPromise=require(_0x6513('0x4'));var rp=require(_0x6513('0x5'));var fs=require('fs');var path=require(_0x6513('0x6'));var rimraf=require(_0x6513('0x7'));var config=require('../../config/environment');var attributes=require(_0x6513('0x8'));module[_0x6513('0x9')]=function(_0x554ed4,_0x7b268c){return _0x554ed4[_0x6513('0xa')](_0x6513('0xb'),attributes,{'tableName':_0x6513('0xc'),'paranoid':![],'indexes':[{'name':_0x6513('0xd'),'fields':['idField',_0x6513('0xe')],'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 7489964..7076af0 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 _0xdf86=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','FreshdeskField,\x20%s,\x20%s','message','info'];(function(_0x4e9e02,_0x578e91){var _0xe95593=function(_0x57a076){while(--_0x57a076){_0x4e9e02['push'](_0x4e9e02['shift']());}};_0xe95593(++_0x578e91);}(_0xdf86,0x1b1));var _0x6df8=function(_0x11f5ff,_0xa0ef18){_0x11f5ff=_0x11f5ff-0x0;var _0x46eefb=_0xdf86[_0x11f5ff];return _0x46eefb;};'use strict';var _=require(_0x6df8('0x0'));var util=require(_0x6df8('0x1'));var moment=require(_0x6df8('0x2'));var BPromise=require(_0x6df8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6df8('0x4'));var db=require(_0x6df8('0x5'))['db'];var utils=require(_0x6df8('0x6'));var logger=require(_0x6df8('0x7'))(_0x6df8('0x8'));var config=require(_0x6df8('0x9'));var jayson=require(_0x6df8('0xa'));var client=jayson[_0x6df8('0xb')][_0x6df8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3442df,_0xebb4a6,_0x127f06){return new BPromise(function(_0x226c8c,_0x3aa294){return client[_0x6df8('0xd')](_0x3442df,_0x127f06)[_0x6df8('0xe')](function(_0x293b77){logger['info']('FreshdeskField,\x20%s,\x20%s',_0xebb4a6,_0x6df8('0xf'));logger[_0x6df8('0x10')](_0x6df8('0x11'),_0xebb4a6,_0x6df8('0xf'),JSON[_0x6df8('0x12')](_0x293b77));if(_0x293b77[_0x6df8('0x13')]){if(_0x293b77[_0x6df8('0x13')]['code']===0x1f4){logger['error'](_0x6df8('0x14'),_0xebb4a6,_0x293b77[_0x6df8('0x13')][_0x6df8('0x15')]);return _0x3aa294(_0x293b77[_0x6df8('0x13')][_0x6df8('0x15')]);}logger[_0x6df8('0x13')](_0x6df8('0x14'),_0xebb4a6,_0x293b77[_0x6df8('0x13')][_0x6df8('0x15')]);return _0x226c8c(_0x293b77['error'][_0x6df8('0x15')]);}else{logger[_0x6df8('0x16')]('FreshdeskField,\x20%s,\x20%s',_0xebb4a6,_0x6df8('0xf'));_0x226c8c(_0x293b77['result']['message']);}})[_0x6df8('0x17')](function(_0x11a247){logger[_0x6df8('0x13')](_0x6df8('0x14'),_0xebb4a6,_0x11a247);_0x3aa294(_0x11a247);});});} \ No newline at end of file +var _0xcccb=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','request\x20sent','code','FreshdeskField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xcccb,0x1e7));var _0xbccc=function(_0x1993e2,_0x5dd7ad){_0x1993e2=_0x1993e2-0x0;var _0x2f7e8f=_0xcccb[_0x1993e2];return _0x2f7e8f;};'use strict';var _=require(_0xbccc('0x0'));var util=require('util');var moment=require(_0xbccc('0x1'));var BPromise=require(_0xbccc('0x2'));var rs=require(_0xbccc('0x3'));var fs=require('fs');var Redis=require(_0xbccc('0x4'));var db=require(_0xbccc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbccc('0x6'));var config=require(_0xbccc('0x7'));var jayson=require(_0xbccc('0x8'));var client=jayson[_0xbccc('0x9')][_0xbccc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ca885,_0x27bbd6,_0x4384be){return new BPromise(function(_0x37f814,_0x1b28fe){return client['request'](_0x1ca885,_0x4384be)[_0xbccc('0xb')](function(_0x212ccf){logger[_0xbccc('0xc')]('FreshdeskField,\x20%s,\x20%s',_0x27bbd6,'request\x20sent');logger[_0xbccc('0xd')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x27bbd6,_0xbccc('0xe'),JSON['stringify'](_0x212ccf));if(_0x212ccf['error']){if(_0x212ccf['error'][_0xbccc('0xf')]===0x1f4){logger['error'](_0xbccc('0x10'),_0x27bbd6,_0x212ccf['error']['message']);return _0x1b28fe(_0x212ccf[_0xbccc('0x11')][_0xbccc('0x12')]);}logger[_0xbccc('0x11')](_0xbccc('0x10'),_0x27bbd6,_0x212ccf['error']['message']);return _0x37f814(_0x212ccf['error'][_0xbccc('0x12')]);}else{logger[_0xbccc('0xc')](_0xbccc('0x10'),_0x27bbd6,_0xbccc('0xe'));_0x37f814(_0x212ccf[_0xbccc('0x13')][_0xbccc('0x12')]);}})[_0xbccc('0x14')](function(_0x1a1c11){logger['error'](_0xbccc('0x10'),_0x27bbd6,_0x1a1c11);_0x1b28fe(_0x1a1c11);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index de16a86..399dab0 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 _0xcb91=['addConfiguration','update','delete','/:id','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','index','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x2d83c3,_0x564ad7){var _0x6832f3=function(_0x56c02d){while(--_0x56c02d){_0x2d83c3['push'](_0x2d83c3['shift']());}};_0x6832f3(++_0x564ad7);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x344adc,_0x183c37){_0x344adc=_0x344adc-0x0;var _0x4014b2=_0xcb91[_0x344adc];return _0x4014b2;};'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')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0xe')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xf')]);router[_0x1cb9('0xe')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller['destroy']);module[_0x1cb9('0x14')]=router; \ No newline at end of file +var _0x9348=['../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','/:id','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x237546,_0xa81b26){var _0x233e29=function(_0x728aa4){while(--_0x728aa4){_0x237546['push'](_0x237546['shift']());}};_0x233e29(++_0xa81b26);}(_0x9348,0x10d));var _0x8934=function(_0x215f9e,_0x438b14){_0x215f9e=_0x215f9e-0x0;var _0x217ce4=_0x9348[_0x215f9e];return _0x217ce4;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var fs_extra=require(_0x8934('0x5'));var auth=require(_0x8934('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8934('0x7'));var controller=require(_0x8934('0x8'));router[_0x8934('0x9')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0x9')]('/:id',auth[_0x8934('0xa')](),controller[_0x8934('0xc')]);router[_0x8934('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x8934('0xd'),auth['isAuthenticated'](),controller[_0x8934('0xe')]);router[_0x8934('0xf')]('/',auth[_0x8934('0xa')](),controller[_0x8934('0x10')]);router[_0x8934('0xf')](_0x8934('0x11'),auth[_0x8934('0xa')](),controller[_0x8934('0x12')]);router['put'](_0x8934('0x13'),auth[_0x8934('0xa')](),controller[_0x8934('0x14')]);router[_0x8934('0x15')](_0x8934('0x13'),auth[_0x8934('0xa')](),controller['destroy']);module[_0x8934('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 fd9e5af..66aca22 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 _0x0120=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1d6929,_0x8536b0){var _0x1fbc37=function(_0x9cfd1){while(--_0x9cfd1){_0x1d6929['push'](_0x1d6929['shift']());}};_0x1fbc37(++_0x8536b0);}(_0x0120,0x6f));var _0x0012=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x0120[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x0012('0x0'));module[_0x0012('0x1')]={'name':{'type':Sequelize[_0x0012('0x2')]},'description':{'type':Sequelize[_0x0012('0x2')]},'username':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x3')},'apiKey':{'type':Sequelize[_0x0012('0x2')]},'remoteUri':{'type':Sequelize[_0x0012('0x2')],'unique':_0x0012('0x4')},'serverUrl':{'type':Sequelize[_0x0012('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xffd6=['exports','STRING','username','sequelize'];(function(_0x4df90c,_0x439adb){var _0x1d3c78=function(_0x4da472){while(--_0x4da472){_0x4df90c['push'](_0x4df90c['shift']());}};_0x1d3c78(++_0x439adb);}(_0xffd6,0x97));var _0x6ffd=function(_0x52e363,_0x48062a){_0x52e363=_0x52e363-0x0;var _0x3fc2b5=_0xffd6[_0x52e363];return _0x3fc2b5;};'use strict';var Sequelize=require(_0x6ffd('0x0'));module[_0x6ffd('0x1')]={'name':{'type':Sequelize[_0x6ffd('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x6ffd('0x3')},'apiKey':{'type':Sequelize[_0x6ffd('0x2')]},'remoteUri':{'type':Sequelize[_0x6ffd('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x6ffd('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 793f2ea..f4741cd 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 _0xf18b=['where','pick','merge','VIRTUAL','options','FreshsalesAccount','includeAll','include','rows','show','params','find','catch','create','body','destroy','getConfigurations','findOne','FreshsalesConfiguration','filter','Subjects','channel','type','getDescriptions','FreshsalesField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','error','stack','name','send','index','rawAttributes','key','map','keys','query','filters','model','intersection','fields','attributes','length','nolimit','order','sort'];(function(_0x44af90,_0x512c08){var _0x450904=function(_0x230c35){while(--_0x230c35){_0x44af90['push'](_0x44af90['shift']());}};_0x450904(++_0x512c08);}(_0xf18b,0xf6));var _0xbf18=function(_0x2664f8,_0x3febbe){_0x2664f8=_0x2664f8-0x0;var _0x33cee6=_0xf18b[_0x2664f8];return _0x33cee6;};'use strict';var emlformat=require(_0xbf18('0x0'));var rimraf=require(_0xbf18('0x1'));var zipdir=require(_0xbf18('0x2'));var jsonpatch=require(_0xbf18('0x3'));var rp=require(_0xbf18('0x4'));var moment=require(_0xbf18('0x5'));var BPromise=require(_0xbf18('0x6'));var Mustache=require(_0xbf18('0x7'));var util=require('util');var path=require('path');var sox=require(_0xbf18('0x8'));var csv=require(_0xbf18('0x9'));var ejs=require(_0xbf18('0xa'));var fs=require('fs');var fs_extra=require(_0xbf18('0xb'));var _=require(_0xbf18('0xc'));var squel=require(_0xbf18('0xd'));var crypto=require(_0xbf18('0xe'));var jsforce=require(_0xbf18('0xf'));var deskjs=require(_0xbf18('0x10'));var toCsv=require(_0xbf18('0x9'));var querystring=require(_0xbf18('0x11'));var Papa=require(_0xbf18('0x12'));var Redis=require(_0xbf18('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbf18('0x14'));var as=require(_0xbf18('0x15'));var hardwareService=require(_0xbf18('0x16'));var logger=require(_0xbf18('0x17'))('api');var utils=require(_0xbf18('0x18'));var config=require(_0xbf18('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xbf18('0x1a'));function respondWithStatusCode(_0x39c381,_0x2058ff){_0x2058ff=_0x2058ff||0xcc;return function(_0x17acd4){if(_0x17acd4){return _0x39c381[_0xbf18('0x1b')](_0x2058ff);}return _0x39c381[_0xbf18('0x1c')](_0x2058ff)['end']();};}function respondWithResult(_0x14b1a2,_0x53eb2c){_0x53eb2c=_0x53eb2c||0xc8;return function(_0x4b663b){if(_0x4b663b){return _0x14b1a2[_0xbf18('0x1c')](_0x53eb2c)['json'](_0x4b663b);}};}function respondWithFilteredResult(_0x4d834c,_0x3a9988){return function(_0x2c1f8f){if(_0x2c1f8f){var _0x5d9289=typeof _0x3a9988[_0xbf18('0x1d')]===_0xbf18('0x1e')&&typeof _0x3a9988[_0xbf18('0x1f')]==='undefined';var _0x5e1c98=_0x2c1f8f[_0xbf18('0x20')];var _0x26ad38=_0x5d9289?0x0:_0x3a9988[_0xbf18('0x1d')];var _0x4af43c=_0x5d9289?_0x2c1f8f[_0xbf18('0x20')]:_0x3a9988['offset']+_0x3a9988[_0xbf18('0x1f')];var _0x4380eb;if(_0x4af43c>=_0x5e1c98){_0x4af43c=_0x5e1c98;_0x4380eb=0xc8;}else{_0x4380eb=0xce;}_0x4d834c[_0xbf18('0x1c')](_0x4380eb);return _0x4d834c[_0xbf18('0x21')](_0xbf18('0x22'),_0x26ad38+'-'+_0x4af43c+'/'+_0x5e1c98)[_0xbf18('0x23')](_0x2c1f8f);}return null;};}function patchUpdates(_0x38729c){return function(_0x476b77){try{jsonpatch[_0xbf18('0x24')](_0x476b77,_0x38729c,!![]);}catch(_0xf305ce){return BPromise[_0xbf18('0x25')](_0xf305ce);}return _0x476b77['save']();};}function saveUpdates(_0x366fef,_0x4d4a6c){return function(_0x559fd3){if(_0x559fd3){return _0x559fd3[_0xbf18('0x26')](_0x366fef)[_0xbf18('0x27')](function(_0x189e9c){return _0x189e9c;});}return null;};}function removeEntity(_0x225f98,_0x56b20e){return function(_0x5e4f72){if(_0x5e4f72){return _0x5e4f72['destroy']()['then'](function(){_0x225f98[_0xbf18('0x1c')](0xcc)[_0xbf18('0x28')]();});}};}function handleEntityNotFound(_0x414350,_0x25599b){return function(_0x1a500a){if(!_0x1a500a){_0x414350['sendStatus'](0x194);}return _0x1a500a;};}function handleError(_0x5532d2,_0x131d5d){_0x131d5d=_0x131d5d||0x1f4;return function(_0x2b0d6f){logger[_0xbf18('0x29')](_0x2b0d6f[_0xbf18('0x2a')]);if(_0x2b0d6f['name']){delete _0x2b0d6f[_0xbf18('0x2b')];}_0x5532d2[_0xbf18('0x1c')](_0x131d5d)[_0xbf18('0x2c')](_0x2b0d6f);};}exports[_0xbf18('0x2d')]=function(_0x3e73ee,_0x1184d7){var _0x56e1ac={},_0x520bbe={},_0x52bd01={'count':0x0,'rows':[]};var _0x5e0a72=_['map'](db['FreshsalesAccount'][_0xbf18('0x2e')],function(_0x182068){return{'name':_0x182068['fieldName'],'type':_0x182068['type'][_0xbf18('0x2f')]};});_0x520bbe['model']=_[_0xbf18('0x30')](_0x5e0a72,_0xbf18('0x2b'));_0x520bbe['query']=_[_0xbf18('0x31')](_0x3e73ee[_0xbf18('0x32')]);_0x520bbe[_0xbf18('0x33')]=_['intersection'](_0x520bbe[_0xbf18('0x34')],_0x520bbe[_0xbf18('0x32')]);_0x56e1ac['attributes']=_[_0xbf18('0x35')](_0x520bbe['model'],qs[_0xbf18('0x36')](_0x3e73ee[_0xbf18('0x32')][_0xbf18('0x36')]));_0x56e1ac[_0xbf18('0x37')]=_0x56e1ac[_0xbf18('0x37')][_0xbf18('0x38')]?_0x56e1ac[_0xbf18('0x37')]:_0x520bbe[_0xbf18('0x34')];if(!_0x3e73ee[_0xbf18('0x32')]['hasOwnProperty'](_0xbf18('0x39'))){_0x56e1ac[_0xbf18('0x1f')]=qs[_0xbf18('0x1f')](_0x3e73ee['query'][_0xbf18('0x1f')]);_0x56e1ac[_0xbf18('0x1d')]=qs['offset'](_0x3e73ee[_0xbf18('0x32')][_0xbf18('0x1d')]);}_0x56e1ac[_0xbf18('0x3a')]=qs[_0xbf18('0x3b')](_0x3e73ee[_0xbf18('0x32')][_0xbf18('0x3b')]);_0x56e1ac[_0xbf18('0x3c')]=qs[_0xbf18('0x33')](_[_0xbf18('0x3d')](_0x3e73ee[_0xbf18('0x32')],_0x520bbe['filters']),_0x5e0a72);if(_0x3e73ee[_0xbf18('0x32')]['filter']){_0x56e1ac[_0xbf18('0x3c')]=_[_0xbf18('0x3e')](_0x56e1ac[_0xbf18('0x3c')],{'$or':_[_0xbf18('0x30')](_0x5e0a72,function(_0x20fae5){if(_0x20fae5['type']!==_0xbf18('0x3f')){var _0x32feda={};_0x32feda[_0x20fae5['name']]={'$like':'%'+_0x3e73ee[_0xbf18('0x32')]['filter']+'%'};return _0x32feda;}})});}_0x56e1ac=_['merge']({},_0x56e1ac,_0x3e73ee[_0xbf18('0x40')]);var _0x2e7d88={'where':_0x56e1ac[_0xbf18('0x3c')]};return db[_0xbf18('0x41')][_0xbf18('0x20')](_0x2e7d88)[_0xbf18('0x27')](function(_0x2817c6){_0x52bd01[_0xbf18('0x20')]=_0x2817c6;if(_0x3e73ee['query'][_0xbf18('0x42')]){_0x56e1ac[_0xbf18('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x56e1ac);})['then'](function(_0x2baa9b){_0x52bd01[_0xbf18('0x44')]=_0x2baa9b;return _0x52bd01;})['then'](respondWithFilteredResult(_0x1184d7,_0x56e1ac))['catch'](handleError(_0x1184d7,null));};exports[_0xbf18('0x45')]=function(_0x760a8c,_0x489a58){var _0x5f3fcd={'raw':![],'where':{'id':_0x760a8c[_0xbf18('0x46')]['id']}},_0x124ad3={};_0x124ad3[_0xbf18('0x34')]=_['keys'](db['FreshsalesAccount']['rawAttributes']);_0x124ad3['query']=_['keys'](_0x760a8c[_0xbf18('0x32')]);_0x124ad3[_0xbf18('0x33')]=_[_0xbf18('0x35')](_0x124ad3['model'],_0x124ad3[_0xbf18('0x32')]);_0x5f3fcd[_0xbf18('0x37')]=_[_0xbf18('0x35')](_0x124ad3['model'],qs[_0xbf18('0x36')](_0x760a8c[_0xbf18('0x32')][_0xbf18('0x36')]));_0x5f3fcd[_0xbf18('0x37')]=_0x5f3fcd[_0xbf18('0x37')]['length']?_0x5f3fcd[_0xbf18('0x37')]:_0x124ad3[_0xbf18('0x34')];if(_0x760a8c[_0xbf18('0x32')][_0xbf18('0x42')]){_0x5f3fcd['include']=[{'all':!![]}];}_0x5f3fcd=_['merge']({},_0x5f3fcd,_0x760a8c[_0xbf18('0x40')]);return db[_0xbf18('0x41')][_0xbf18('0x47')](_0x5f3fcd)[_0xbf18('0x27')](handleEntityNotFound(_0x489a58,null))[_0xbf18('0x27')](respondWithResult(_0x489a58,null))[_0xbf18('0x48')](handleError(_0x489a58,null));};exports[_0xbf18('0x49')]=function(_0x531ed7,_0x13d3cd){return db['FreshsalesAccount'][_0xbf18('0x49')](_0x531ed7[_0xbf18('0x4a')],{})[_0xbf18('0x27')](respondWithResult(_0x13d3cd,0xc9))['catch'](handleError(_0x13d3cd,null));};exports[_0xbf18('0x26')]=function(_0x572836,_0x510cb7){if(_0x572836[_0xbf18('0x4a')]['id']){delete _0x572836[_0xbf18('0x4a')]['id'];}return db[_0xbf18('0x41')]['find']({'where':{'id':_0x572836['params']['id']}})['then'](handleEntityNotFound(_0x510cb7,null))['then'](saveUpdates(_0x572836[_0xbf18('0x4a')],null))['then'](respondWithResult(_0x510cb7,null))[_0xbf18('0x48')](handleError(_0x510cb7,null));};exports[_0xbf18('0x4b')]=function(_0x1f0ad8,_0x4c6c49){return db[_0xbf18('0x41')][_0xbf18('0x47')]({'where':{'id':_0x1f0ad8[_0xbf18('0x46')]['id']}})[_0xbf18('0x27')](handleEntityNotFound(_0x4c6c49,null))[_0xbf18('0x27')](removeEntity(_0x4c6c49,null))[_0xbf18('0x48')](handleError(_0x4c6c49,null));};exports[_0xbf18('0x4c')]=function(_0x2e3961,_0x388218,_0x5c43a6){var _0x1c7520={};var _0x3aecf8={};var _0x1b94d6;var _0xba1938;return db[_0xbf18('0x41')][_0xbf18('0x4d')]({'where':{'id':_0x2e3961[_0xbf18('0x46')]['id']}})[_0xbf18('0x27')](handleEntityNotFound(_0x388218,null))[_0xbf18('0x27')](function(_0x4ecafe){if(_0x4ecafe){_0x1b94d6=_0x4ecafe;_0x3aecf8[_0xbf18('0x34')]=_[_0xbf18('0x31')](db[_0xbf18('0x4e')]['rawAttributes']);_0x3aecf8[_0xbf18('0x32')]=_[_0xbf18('0x31')](_0x2e3961['query']);_0x3aecf8['filters']=_[_0xbf18('0x35')](_0x3aecf8['model'],_0x3aecf8['query']);_0x1c7520['attributes']=_[_0xbf18('0x35')](_0x3aecf8['model'],qs[_0xbf18('0x36')](_0x2e3961['query'][_0xbf18('0x36')]));_0x1c7520[_0xbf18('0x37')]=_0x1c7520[_0xbf18('0x37')][_0xbf18('0x38')]?_0x1c7520[_0xbf18('0x37')]:_0x3aecf8[_0xbf18('0x34')];_0x1c7520['order']=qs[_0xbf18('0x3b')](_0x2e3961[_0xbf18('0x32')][_0xbf18('0x3b')]);_0x1c7520[_0xbf18('0x3c')]=qs['filters'](_[_0xbf18('0x3d')](_0x2e3961[_0xbf18('0x32')],_0x3aecf8[_0xbf18('0x33')]));if(_0x2e3961['query'][_0xbf18('0x4f')]){_0x1c7520['where']=_['merge'](_0x1c7520[_0xbf18('0x3c')],{'$or':_[_0xbf18('0x30')](_0x1c7520[_0xbf18('0x37')],function(_0x22803a){var _0x299a7f={};_0x299a7f[_0x22803a]={'$like':'%'+_0x2e3961[_0xbf18('0x32')][_0xbf18('0x4f')]+'%'};return _0x299a7f;})});}_0x1c7520=_['merge']({},_0x1c7520,_0x2e3961[_0xbf18('0x40')]);return _0x1b94d6['getConfigurations'](_0x1c7520);}})[_0xbf18('0x27')](function(_0x5a9686){if(_0x5a9686){_0xba1938=_0x5a9686[_0xbf18('0x38')];if(!_0x2e3961['query']['hasOwnProperty'](_0xbf18('0x39'))){_0x1c7520[_0xbf18('0x1f')]=qs['limit'](_0x2e3961['query']['limit']);_0x1c7520[_0xbf18('0x1d')]=qs[_0xbf18('0x1d')](_0x2e3961[_0xbf18('0x32')]['offset']);}return _0x1b94d6[_0xbf18('0x4c')](_0x1c7520);}})['then'](function(_0x2401c4){if(_0x2401c4){return _0x2401c4?{'count':_0xba1938,'rows':_0x2401c4}:null;}})[_0xbf18('0x27')](respondWithResult(_0x388218,null))[_0xbf18('0x48')](handleError(_0x388218,null));};exports['addConfiguration']=function(_0x11df43,_0x3405bb,_0x675c35){if(_0x11df43[_0xbf18('0x4a')]['id']){delete _0x11df43[_0xbf18('0x4a')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0x11df43[_0xbf18('0x46')]['id']}})[_0xbf18('0x27')](handleEntityNotFound(_0x3405bb,null))[_0xbf18('0x27')](function(_0x440674){if(_0x440674){_0x11df43[_0xbf18('0x4a')]['AccountId']=_0x440674['id'];_0x11df43[_0xbf18('0x4a')][_0xbf18('0x50')]=integrations['getSubjects'](_0x11df43['body'][_0xbf18('0x51')],_0x11df43[_0xbf18('0x4a')][_0xbf18('0x52')]);_0x11df43[_0xbf18('0x4a')]['Descriptions']=integrations[_0xbf18('0x53')](_0x11df43['body'][_0xbf18('0x51')],_0x11df43[_0xbf18('0x4a')][_0xbf18('0x52')]);return db[_0xbf18('0x4e')][_0xbf18('0x49')](_0x11df43['body'],{'include':[{'model':db[_0xbf18('0x54')],'as':_0xbf18('0x50')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0xbf18('0x27')](respondWithResult(_0x3405bb,null))[_0xbf18('0x48')](handleError(_0x3405bb,null));};exports[_0xbf18('0x55')]=function(_0x40c345,_0x37cfb9,_0x4c1305){var _0x6a006e='';var _0x53c58b='';return db[_0xbf18('0x41')][_0xbf18('0x4d')]({'where':{'id':_0x40c345['params']['id']},'attributes':['id','username','remoteUri',_0xbf18('0x56')]})[_0xbf18('0x27')](handleEntityNotFound(_0x37cfb9,null))[_0xbf18('0x27')](function(_0x18160c){if(_0x18160c){_0x53c58b=_0x18160c['username'];_0x6a006e=_0x18160c['remoteUri'];var _0x2b766f=_0x18160c[_0xbf18('0x57')][_0xbf18('0x58')](-0x1);if(_0x2b766f==='/'){_0x6a006e=_0x6a006e[_0xbf18('0x59')](0x0,_0x6a006e[_0xbf18('0x5a')](_0x2b766f));}return rp({'method':_0xbf18('0x5b'),'uri':util[_0xbf18('0x5c')](_0xbf18('0x5d'),_0x6a006e,'/api/selector/owners'),'headers':{'Authorization':_0xbf18('0x5e')+_0x18160c['apiKey']},'json':!![]});}})[_0xbf18('0x27')](function(_0x56dc02){if(_0x56dc02){var _0x57ca22=_0x56dc02[_0xbf18('0x5f')];var _0x57933f=![];var _0x4d926a=null;for(_0x4d926a=0x0;_0x4d926a<_0x57ca22['length'];_0x4d926a++){if(_0x57ca22[_0x4d926a][_0xbf18('0x60')]===_0x53c58b){_0x57933f=!![];}}if(_0x57933f){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xbf18('0x61')});}}})[_0xbf18('0x27')](respondWithResult(_0x37cfb9,null))[_0xbf18('0x48')](function(_0x14da83){var _0x1ad320=_0x40c345[_0xbf18('0x32')][_0xbf18('0x62')]?0x1f4:_0x14da83[_0xbf18('0x63')]||0x1f4;logger[_0xbf18('0x29')](_0xbf18('0x64'),_0xbf18('0x55'),_0x1ad320,JSON['stringify'](_0x14da83));delete _0x14da83[_0xbf18('0x2b')];if(_0x1ad320===0x191){_0x1ad320=0x190;}_0x37cfb9[_0xbf18('0x1c')](_0x1ad320)[_0xbf18('0x2c')](_0x40c345[_0xbf18('0x32')][_0xbf18('0x62')]?{'message':_0xbf18('0x65'),'statusCode':_0x14da83[_0xbf18('0x63')]}:_0x14da83);});}; \ No newline at end of file +var _0x9bd0=['undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','error','stack','name','send','FreshsalesAccount','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','getConfigurations','FreshsalesConfiguration','addConfiguration','getSubjects','Descriptions','getDescriptions','channel','FreshsalesField','Subjects','getFields','findOne','username','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','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/environment','sendStatus','status','offset'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x9bd0,0x11a));var _0x09bd=function(_0x47e633,_0x3f7b15){_0x47e633=_0x47e633-0x0;var _0x36d0ff=_0x9bd0[_0x47e633];return _0x36d0ff;};'use strict';var emlformat=require(_0x09bd('0x0'));var rimraf=require(_0x09bd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x09bd('0x2'));var rp=require(_0x09bd('0x3'));var moment=require('moment');var BPromise=require(_0x09bd('0x4'));var Mustache=require(_0x09bd('0x5'));var util=require(_0x09bd('0x6'));var path=require(_0x09bd('0x7'));var sox=require(_0x09bd('0x8'));var csv=require(_0x09bd('0x9'));var ejs=require(_0x09bd('0xa'));var fs=require('fs');var fs_extra=require(_0x09bd('0xb'));var _=require(_0x09bd('0xc'));var squel=require(_0x09bd('0xd'));var crypto=require(_0x09bd('0xe'));var jsforce=require(_0x09bd('0xf'));var deskjs=require(_0x09bd('0x10'));var toCsv=require(_0x09bd('0x9'));var querystring=require('querystring');var Papa=require(_0x09bd('0x11'));var Redis=require(_0x09bd('0x12'));var authService=require(_0x09bd('0x13'));var qs=require(_0x09bd('0x14'));var as=require(_0x09bd('0x15'));var hardwareService=require(_0x09bd('0x16'));var logger=require(_0x09bd('0x17'))(_0x09bd('0x18'));var utils=require(_0x09bd('0x19'));var config=require(_0x09bd('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x41ac1c,_0x44b24d){_0x44b24d=_0x44b24d||0xcc;return function(_0xff0d59){if(_0xff0d59){return _0x41ac1c[_0x09bd('0x1b')](_0x44b24d);}return _0x41ac1c[_0x09bd('0x1c')](_0x44b24d)['end']();};}function respondWithResult(_0x5da7ad,_0x3511fc){_0x3511fc=_0x3511fc||0xc8;return function(_0x230d72){if(_0x230d72){return _0x5da7ad[_0x09bd('0x1c')](_0x3511fc)['json'](_0x230d72);}};}function respondWithFilteredResult(_0x11150c,_0x3f8f1b){return function(_0x38ffac){if(_0x38ffac){var _0x30ceb9=typeof _0x3f8f1b[_0x09bd('0x1d')]===_0x09bd('0x1e')&&typeof _0x3f8f1b[_0x09bd('0x1f')]===_0x09bd('0x1e');var _0xd1a06f=_0x38ffac[_0x09bd('0x20')];var _0x2b1897=_0x30ceb9?0x0:_0x3f8f1b[_0x09bd('0x1d')];var _0xa5e9e5=_0x30ceb9?_0x38ffac['count']:_0x3f8f1b[_0x09bd('0x1d')]+_0x3f8f1b[_0x09bd('0x1f')];var _0x4b72f0;if(_0xa5e9e5>=_0xd1a06f){_0xa5e9e5=_0xd1a06f;_0x4b72f0=0xc8;}else{_0x4b72f0=0xce;}_0x11150c['status'](_0x4b72f0);return _0x11150c[_0x09bd('0x21')](_0x09bd('0x22'),_0x2b1897+'-'+_0xa5e9e5+'/'+_0xd1a06f)[_0x09bd('0x23')](_0x38ffac);}return null;};}function patchUpdates(_0x11a058){return function(_0x38cc33){try{jsonpatch['apply'](_0x38cc33,_0x11a058,!![]);}catch(_0x142f2b){return BPromise[_0x09bd('0x24')](_0x142f2b);}return _0x38cc33[_0x09bd('0x25')]();};}function saveUpdates(_0x337b92,_0x17384b){return function(_0x1966aa){if(_0x1966aa){return _0x1966aa[_0x09bd('0x26')](_0x337b92)[_0x09bd('0x27')](function(_0x1944c7){return _0x1944c7;});}return null;};}function removeEntity(_0x40916a,_0x2f378e){return function(_0x2e5ec1){if(_0x2e5ec1){return _0x2e5ec1[_0x09bd('0x28')]()[_0x09bd('0x27')](function(){_0x40916a[_0x09bd('0x1c')](0xcc)[_0x09bd('0x29')]();});}};}function handleEntityNotFound(_0x302cee,_0x4c0f91){return function(_0x4db0f9){if(!_0x4db0f9){_0x302cee[_0x09bd('0x1b')](0x194);}return _0x4db0f9;};}function handleError(_0x12036f,_0x4b9873){_0x4b9873=_0x4b9873||0x1f4;return function(_0x26530a){logger[_0x09bd('0x2a')](_0x26530a[_0x09bd('0x2b')]);if(_0x26530a[_0x09bd('0x2c')]){delete _0x26530a[_0x09bd('0x2c')];}_0x12036f['status'](_0x4b9873)[_0x09bd('0x2d')](_0x26530a);};}exports['index']=function(_0x31d439,_0x17f50c){var _0x4f474a={},_0x274427={},_0x226323={'count':0x0,'rows':[]};var _0x6e3faa=_['map'](db[_0x09bd('0x2e')][_0x09bd('0x2f')],function(_0x2693fc){return{'name':_0x2693fc[_0x09bd('0x30')],'type':_0x2693fc[_0x09bd('0x31')][_0x09bd('0x32')]};});_0x274427[_0x09bd('0x33')]=_[_0x09bd('0x34')](_0x6e3faa,_0x09bd('0x2c'));_0x274427[_0x09bd('0x35')]=_['keys'](_0x31d439[_0x09bd('0x35')]);_0x274427[_0x09bd('0x36')]=_['intersection'](_0x274427[_0x09bd('0x33')],_0x274427['query']);_0x4f474a['attributes']=_[_0x09bd('0x37')](_0x274427[_0x09bd('0x33')],qs[_0x09bd('0x38')](_0x31d439[_0x09bd('0x35')][_0x09bd('0x38')]));_0x4f474a[_0x09bd('0x39')]=_0x4f474a[_0x09bd('0x39')]['length']?_0x4f474a[_0x09bd('0x39')]:_0x274427['model'];if(!_0x31d439[_0x09bd('0x35')][_0x09bd('0x3a')](_0x09bd('0x3b'))){_0x4f474a['limit']=qs[_0x09bd('0x1f')](_0x31d439[_0x09bd('0x35')][_0x09bd('0x1f')]);_0x4f474a[_0x09bd('0x1d')]=qs[_0x09bd('0x1d')](_0x31d439[_0x09bd('0x35')][_0x09bd('0x1d')]);}_0x4f474a['order']=qs[_0x09bd('0x3c')](_0x31d439[_0x09bd('0x35')][_0x09bd('0x3c')]);_0x4f474a['where']=qs[_0x09bd('0x36')](_[_0x09bd('0x3d')](_0x31d439[_0x09bd('0x35')],_0x274427['filters']),_0x6e3faa);if(_0x31d439[_0x09bd('0x35')][_0x09bd('0x3e')]){_0x4f474a[_0x09bd('0x3f')]=_[_0x09bd('0x40')](_0x4f474a[_0x09bd('0x3f')],{'$or':_[_0x09bd('0x34')](_0x6e3faa,function(_0x5284e7){if(_0x5284e7['type']!=='VIRTUAL'){var _0x963377={};_0x963377[_0x5284e7[_0x09bd('0x2c')]]={'$like':'%'+_0x31d439[_0x09bd('0x35')]['filter']+'%'};return _0x963377;}})});}_0x4f474a=_[_0x09bd('0x40')]({},_0x4f474a,_0x31d439[_0x09bd('0x41')]);var _0x39b323={'where':_0x4f474a[_0x09bd('0x3f')]};return db[_0x09bd('0x2e')][_0x09bd('0x20')](_0x39b323)[_0x09bd('0x27')](function(_0x320d03){_0x226323['count']=_0x320d03;if(_0x31d439[_0x09bd('0x35')][_0x09bd('0x42')]){_0x4f474a[_0x09bd('0x43')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x09bd('0x44')](_0x4f474a);})[_0x09bd('0x27')](function(_0xaaa43b){_0x226323[_0x09bd('0x45')]=_0xaaa43b;return _0x226323;})['then'](respondWithFilteredResult(_0x17f50c,_0x4f474a))[_0x09bd('0x46')](handleError(_0x17f50c,null));};exports[_0x09bd('0x47')]=function(_0x354966,_0xa598e){var _0x127d16={'raw':![],'where':{'id':_0x354966[_0x09bd('0x48')]['id']}},_0x54de53={};_0x54de53[_0x09bd('0x33')]=_[_0x09bd('0x49')](db['FreshsalesAccount']['rawAttributes']);_0x54de53[_0x09bd('0x35')]=_[_0x09bd('0x49')](_0x354966['query']);_0x54de53[_0x09bd('0x36')]=_[_0x09bd('0x37')](_0x54de53[_0x09bd('0x33')],_0x54de53[_0x09bd('0x35')]);_0x127d16[_0x09bd('0x39')]=_[_0x09bd('0x37')](_0x54de53['model'],qs[_0x09bd('0x38')](_0x354966[_0x09bd('0x35')]['fields']));_0x127d16[_0x09bd('0x39')]=_0x127d16[_0x09bd('0x39')][_0x09bd('0x4a')]?_0x127d16[_0x09bd('0x39')]:_0x54de53[_0x09bd('0x33')];if(_0x354966['query']['includeAll']){_0x127d16[_0x09bd('0x43')]=[{'all':!![]}];}_0x127d16=_['merge']({},_0x127d16,_0x354966[_0x09bd('0x41')]);return db[_0x09bd('0x2e')][_0x09bd('0x4b')](_0x127d16)['then'](handleEntityNotFound(_0xa598e,null))[_0x09bd('0x27')](respondWithResult(_0xa598e,null))[_0x09bd('0x46')](handleError(_0xa598e,null));};exports[_0x09bd('0x4c')]=function(_0x1a32e4,_0x2a127c){return db[_0x09bd('0x2e')][_0x09bd('0x4c')](_0x1a32e4['body'],{})[_0x09bd('0x27')](respondWithResult(_0x2a127c,0xc9))[_0x09bd('0x46')](handleError(_0x2a127c,null));};exports[_0x09bd('0x26')]=function(_0x5cba17,_0x4bc6b1){if(_0x5cba17[_0x09bd('0x4d')]['id']){delete _0x5cba17[_0x09bd('0x4d')]['id'];}return db['FreshsalesAccount'][_0x09bd('0x4b')]({'where':{'id':_0x5cba17[_0x09bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x4bc6b1,null))['then'](saveUpdates(_0x5cba17[_0x09bd('0x4d')],null))[_0x09bd('0x27')](respondWithResult(_0x4bc6b1,null))[_0x09bd('0x46')](handleError(_0x4bc6b1,null));};exports[_0x09bd('0x28')]=function(_0x5601cf,_0x374896){return db[_0x09bd('0x2e')][_0x09bd('0x4b')]({'where':{'id':_0x5601cf[_0x09bd('0x48')]['id']}})[_0x09bd('0x27')](handleEntityNotFound(_0x374896,null))[_0x09bd('0x27')](removeEntity(_0x374896,null))[_0x09bd('0x46')](handleError(_0x374896,null));};exports[_0x09bd('0x4e')]=function(_0x33905f,_0x10f46c,_0x306c05){var _0xc36dcf={};var _0x152c63={};var _0x290766;var _0x5dcde2;return db[_0x09bd('0x2e')]['findOne']({'where':{'id':_0x33905f[_0x09bd('0x48')]['id']}})['then'](handleEntityNotFound(_0x10f46c,null))[_0x09bd('0x27')](function(_0x2f983d){if(_0x2f983d){_0x290766=_0x2f983d;_0x152c63['model']=_[_0x09bd('0x49')](db[_0x09bd('0x4f')]['rawAttributes']);_0x152c63['query']=_[_0x09bd('0x49')](_0x33905f[_0x09bd('0x35')]);_0x152c63[_0x09bd('0x36')]=_[_0x09bd('0x37')](_0x152c63[_0x09bd('0x33')],_0x152c63[_0x09bd('0x35')]);_0xc36dcf[_0x09bd('0x39')]=_['intersection'](_0x152c63[_0x09bd('0x33')],qs[_0x09bd('0x38')](_0x33905f[_0x09bd('0x35')][_0x09bd('0x38')]));_0xc36dcf['attributes']=_0xc36dcf[_0x09bd('0x39')][_0x09bd('0x4a')]?_0xc36dcf[_0x09bd('0x39')]:_0x152c63['model'];_0xc36dcf['order']=qs[_0x09bd('0x3c')](_0x33905f[_0x09bd('0x35')][_0x09bd('0x3c')]);_0xc36dcf[_0x09bd('0x3f')]=qs['filters'](_[_0x09bd('0x3d')](_0x33905f[_0x09bd('0x35')],_0x152c63['filters']));if(_0x33905f['query'][_0x09bd('0x3e')]){_0xc36dcf[_0x09bd('0x3f')]=_[_0x09bd('0x40')](_0xc36dcf[_0x09bd('0x3f')],{'$or':_[_0x09bd('0x34')](_0xc36dcf[_0x09bd('0x39')],function(_0x173753){var _0x204227={};_0x204227[_0x173753]={'$like':'%'+_0x33905f[_0x09bd('0x35')][_0x09bd('0x3e')]+'%'};return _0x204227;})});}_0xc36dcf=_[_0x09bd('0x40')]({},_0xc36dcf,_0x33905f[_0x09bd('0x41')]);return _0x290766['getConfigurations'](_0xc36dcf);}})[_0x09bd('0x27')](function(_0x8a59f6){if(_0x8a59f6){_0x5dcde2=_0x8a59f6['length'];if(!_0x33905f[_0x09bd('0x35')][_0x09bd('0x3a')](_0x09bd('0x3b'))){_0xc36dcf[_0x09bd('0x1f')]=qs[_0x09bd('0x1f')](_0x33905f[_0x09bd('0x35')][_0x09bd('0x1f')]);_0xc36dcf[_0x09bd('0x1d')]=qs[_0x09bd('0x1d')](_0x33905f[_0x09bd('0x35')]['offset']);}return _0x290766[_0x09bd('0x4e')](_0xc36dcf);}})[_0x09bd('0x27')](function(_0x27b9fe){if(_0x27b9fe){return _0x27b9fe?{'count':_0x5dcde2,'rows':_0x27b9fe}:null;}})[_0x09bd('0x27')](respondWithResult(_0x10f46c,null))[_0x09bd('0x46')](handleError(_0x10f46c,null));};exports[_0x09bd('0x50')]=function(_0xcbddf4,_0x125f08,_0x5ac9fb){if(_0xcbddf4[_0x09bd('0x4d')]['id']){delete _0xcbddf4[_0x09bd('0x4d')]['id'];}return db[_0x09bd('0x2e')]['findOne']({'where':{'id':_0xcbddf4[_0x09bd('0x48')]['id']}})[_0x09bd('0x27')](handleEntityNotFound(_0x125f08,null))[_0x09bd('0x27')](function(_0x35514a){if(_0x35514a){_0xcbddf4['body']['AccountId']=_0x35514a['id'];_0xcbddf4[_0x09bd('0x4d')]['Subjects']=integrations[_0x09bd('0x51')](_0xcbddf4[_0x09bd('0x4d')]['channel'],_0xcbddf4[_0x09bd('0x4d')]['type']);_0xcbddf4[_0x09bd('0x4d')][_0x09bd('0x52')]=integrations[_0x09bd('0x53')](_0xcbddf4[_0x09bd('0x4d')][_0x09bd('0x54')],_0xcbddf4[_0x09bd('0x4d')][_0x09bd('0x31')]);return db[_0x09bd('0x4f')][_0x09bd('0x4c')](_0xcbddf4[_0x09bd('0x4d')],{'include':[{'model':db[_0x09bd('0x55')],'as':_0x09bd('0x56')},{'model':db[_0x09bd('0x55')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x125f08,null))[_0x09bd('0x46')](handleError(_0x125f08,null));};exports[_0x09bd('0x57')]=function(_0x59e336,_0x22635b,_0x43ff6b){var _0x4525f5='';var _0x54ac20='';return db[_0x09bd('0x2e')][_0x09bd('0x58')]({'where':{'id':_0x59e336[_0x09bd('0x48')]['id']},'attributes':['id',_0x09bd('0x59'),_0x09bd('0x5a'),_0x09bd('0x5b')]})[_0x09bd('0x27')](handleEntityNotFound(_0x22635b,null))[_0x09bd('0x27')](function(_0x1ab6b1){if(_0x1ab6b1){_0x54ac20=_0x1ab6b1[_0x09bd('0x59')];_0x4525f5=_0x1ab6b1[_0x09bd('0x5a')];var _0x33187a=_0x1ab6b1['remoteUri'][_0x09bd('0x5c')](-0x1);if(_0x33187a==='/'){_0x4525f5=_0x4525f5[_0x09bd('0x5d')](0x0,_0x4525f5[_0x09bd('0x5e')](_0x33187a));}return rp({'method':'GET','uri':util[_0x09bd('0x5f')](_0x09bd('0x60'),_0x4525f5,'/api/selector/owners'),'headers':{'Authorization':_0x09bd('0x61')+_0x1ab6b1[_0x09bd('0x5b')]},'json':!![]});}})[_0x09bd('0x27')](function(_0x42a1b1){if(_0x42a1b1){var _0x421242=_0x42a1b1[_0x09bd('0x62')];var _0x3ff460=![];var _0x51cb88=null;for(_0x51cb88=0x0;_0x51cb88<_0x421242[_0x09bd('0x4a')];_0x51cb88++){if(_0x421242[_0x51cb88]['email']===_0x54ac20){_0x3ff460=!![];}}if(_0x3ff460){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x09bd('0x63')});}}})['then'](respondWithResult(_0x22635b,null))[_0x09bd('0x46')](function(_0x43d37c){var _0x25ce9a=_0x59e336[_0x09bd('0x35')][_0x09bd('0x64')]?0x1f4:_0x43d37c[_0x09bd('0x65')]||0x1f4;logger[_0x09bd('0x2a')]('getFields,\x20%s,\x20%s,\x20%s',_0x09bd('0x57'),_0x25ce9a,JSON[_0x09bd('0x66')](_0x43d37c));delete _0x43d37c[_0x09bd('0x2c')];if(_0x25ce9a===0x191){_0x25ce9a=0x190;}_0x22635b[_0x09bd('0x1c')](_0x25ce9a)['send'](_0x59e336[_0x09bd('0x35')][_0x09bd('0x64')]?{'message':_0x09bd('0x67'),'statusCode':_0x43d37c[_0x09bd('0x65')]}:_0x43d37c);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 0d6e2a6..b87492b 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 _0xe2fe=['define','int_freshsales_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0x10f964,_0x3dabdb){var _0x5a48e2=function(_0x1d7519){while(--_0x1d7519){_0x10f964['push'](_0x10f964['shift']());}};_0x5a48e2(++_0x3dabdb);}(_0xe2fe,0x86));var _0xee2f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe2fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2e3=['int_freshsales_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports','define','FreshsalesAccount'];(function(_0x886b20,_0x272561){var _0x42c280=function(_0x4176d1){while(--_0x4176d1){_0x886b20['push'](_0x886b20['shift']());}};_0x42c280(++_0x272561);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0xf2e3[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x3f2e('0x0'));var util=require('util');var logger=require(_0x3f2e('0x1'))(_0x3f2e('0x2'));var moment=require(_0x3f2e('0x3'));var BPromise=require(_0x3f2e('0x4'));var rp=require(_0x3f2e('0x5'));var fs=require('fs');var path=require(_0x3f2e('0x6'));var rimraf=require(_0x3f2e('0x7'));var config=require(_0x3f2e('0x8'));var attributes=require(_0x3f2e('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x3f2e('0xa')]=function(_0xdd6b3e,_0x3c0864){return _0xdd6b3e[_0x3f2e('0xb')](_0x3f2e('0xc'),attributes,{'tableName':_0x3f2e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 12e4787..336ffc8 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4975=['jayson/promise','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','FreshsalesAccount','findAll','options','raw','where','attributes','include','map','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','then','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4975,0x86));var _0x5497=function(_0x2cb350,_0x3576a8){_0x2cb350=_0x2cb350-0x0;var _0x3c1b0a=_0x4975[_0x2cb350];return _0x3c1b0a;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var moment=require(_0x5497('0x1'));var BPromise=require(_0x5497('0x2'));var rs=require(_0x5497('0x3'));var fs=require('fs');var Redis=require(_0x5497('0x4'));var db=require(_0x5497('0x5'))['db'];var utils=require(_0x5497('0x6'));var logger=require(_0x5497('0x7'))(_0x5497('0x8'));var config=require(_0x5497('0x9'));var jayson=require(_0x5497('0xa'));var client=jayson['client'][_0x5497('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f563d,_0x1d0019,_0x674a2a){return new BPromise(function(_0x368e8b,_0x57f930){return client[_0x5497('0xc')](_0x4f563d,_0x674a2a)['then'](function(_0x1f63d8){logger[_0x5497('0xd')](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));logger[_0x5497('0x10')](_0x5497('0x11'),_0x1d0019,_0x5497('0xf'),JSON[_0x5497('0x12')](_0x1f63d8));if(_0x1f63d8['error']){if(_0x1f63d8['error']['code']===0x1f4){logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x57f930(_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);}logger[_0x5497('0x13')](_0x5497('0xe'),_0x1d0019,_0x1f63d8[_0x5497('0x13')][_0x5497('0x14')]);return _0x368e8b(_0x1f63d8['error'][_0x5497('0x14')]);}else{logger['info'](_0x5497('0xe'),_0x1d0019,_0x5497('0xf'));_0x368e8b(_0x1f63d8[_0x5497('0x15')][_0x5497('0x14')]);}})[_0x5497('0x16')](function(_0x4073e6){logger[_0x5497('0x13')]('FreshsalesAccount,\x20%s,\x20%s',_0x1d0019,_0x4073e6);_0x57f930(_0x4073e6);});});}exports['GetFreshsalesAccount']=function(_0x3f4d20){var _0x1bf442=this;return new Promise(function(_0x3a47fd,_0x5d9e24){return db[_0x5497('0x17')][_0x5497('0x18')]({'raw':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1b')]||null:null,'attributes':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1c')]||null:null,'limit':_0x3f4d20['options']?_0x3f4d20[_0x5497('0x19')]['limit']||null:null,'include':_0x3f4d20[_0x5497('0x19')]?_0x3f4d20[_0x5497('0x19')][_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x3f4d20[_0x5497('0x19')][_0x5497('0x1d')],function(_0x5018fa){return{'model':db[_0x5018fa['model']],'as':_0x5018fa['as'],'attributes':_0x5018fa[_0x5497('0x1c')],'include':_0x5018fa[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x5018fa[_0x5497('0x1d')],function(_0x5223b5){return{'model':db[_0x5223b5[_0x5497('0x1f')]],'as':_0x5223b5['as'],'attributes':_0x5223b5['attributes'],'include':_0x5223b5[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x5223b5[_0x5497('0x1d')],function(_0x34a1a5){return{'model':db[_0x34a1a5[_0x5497('0x1f')]],'as':_0x34a1a5['as'],'attributes':_0x34a1a5[_0x5497('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4af5f4){logger['info']('GetFreshsalesAccount',_0x3f4d20);logger['debug'](_0x5497('0x20'),_0x3f4d20,JSON['stringify'](_0x4af5f4));_0x3a47fd(_0x4af5f4);})['catch'](function(_0xc3465){logger[_0x5497('0x13')](_0x5497('0x20'),_0xc3465['message'],_0x3f4d20);_0x5d9e24(_0x1bf442['error'](0x1f4,_0xc3465['message']));});});};exports[_0x5497('0x21')]=function(_0x471e0b){var _0xf4c117=this;return new Promise(function(_0x5b8f79,_0x489f71){return db['FreshsalesAccount'][_0x5497('0x22')]({'raw':_0x471e0b['options']?_0x471e0b[_0x5497('0x19')][_0x5497('0x1a')]===undefined?!![]:![]:!![],'where':_0x471e0b[_0x5497('0x19')]?_0x471e0b['options'][_0x5497('0x1b')]||null:null,'attributes':_0x471e0b[_0x5497('0x19')]?_0x471e0b['options'][_0x5497('0x1c')]||null:null,'include':_0x471e0b[_0x5497('0x19')]?_0x471e0b[_0x5497('0x19')]['include']?_[_0x5497('0x1e')](_0x471e0b[_0x5497('0x19')][_0x5497('0x1d')],function(_0x362b96){return{'model':db[_0x362b96[_0x5497('0x1f')]],'as':_0x362b96['as'],'attributes':_0x362b96['attributes'],'include':_0x362b96[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x362b96['include'],function(_0x1ffc9b){return{'model':db[_0x1ffc9b[_0x5497('0x1f')]],'as':_0x1ffc9b['as'],'attributes':_0x1ffc9b[_0x5497('0x1c')],'include':_0x1ffc9b[_0x5497('0x1d')]?_[_0x5497('0x1e')](_0x1ffc9b[_0x5497('0x1d')],function(_0x580e86){return{'model':db[_0x580e86[_0x5497('0x1f')]],'as':_0x580e86['as'],'attributes':_0x580e86['attributes']};}):[]};}):[]};}):[]:[]})[_0x5497('0x23')](function(_0x212199){logger[_0x5497('0xd')]('ShowFreshsalesAccount',_0x471e0b);logger['debug'](_0x5497('0x21'),_0x471e0b,JSON[_0x5497('0x12')](_0x212199));_0x5b8f79(_0x212199);})[_0x5497('0x16')](function(_0x429cbf){logger[_0x5497('0x13')](_0x5497('0x21'),_0x429cbf['message'],_0x471e0b);_0x489f71(_0xf4c117[_0x5497('0x13')](0x1f4,_0x429cbf[_0x5497('0x14')]));});});}; \ No newline at end of file +var _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(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2afc4c,_0x9e22c7){_0x2afc4c=_0x2afc4c-0x0;var _0x28ab34=_0x5f2f[_0x2afc4c];return _0x28ab34;};'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 82d71e1..97d375b 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 _0x6d4d=['post','create','update','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','/:id/descriptions','getDescriptions','/:id/fields','getFields'];(function(_0x435b31,_0x52bcbd){var _0x5652c2=function(_0x51630b){while(--_0x51630b){_0x435b31['push'](_0x435b31['shift']());}};_0x5652c2(++_0x52bcbd);}(_0x6d4d,0x1a2));var _0xd6d4=function(_0x48aaca,_0x140945){_0x48aaca=_0x48aaca-0x0;var _0xac5ed9=_0x6d4d[_0x48aaca];return _0xac5ed9;};'use strict';var multer=require(_0xd6d4('0x0'));var util=require(_0xd6d4('0x1'));var path=require('path');var timeout=require(_0xd6d4('0x2'));var express=require(_0xd6d4('0x3'));var router=express['Router']();var fs_extra=require(_0xd6d4('0x4'));var auth=require(_0xd6d4('0x5'));var interaction=require(_0xd6d4('0x6'));var config=require(_0xd6d4('0x7'));var controller=require(_0xd6d4('0x8'));router[_0xd6d4('0x9')]('/',auth[_0xd6d4('0xa')](),controller[_0xd6d4('0xb')]);router[_0xd6d4('0x9')](_0xd6d4('0xc'),auth['isAuthenticated'](),controller[_0xd6d4('0xd')]);router[_0xd6d4('0x9')](_0xd6d4('0xe'),auth[_0xd6d4('0xa')](),controller['getSubjects']);router[_0xd6d4('0x9')](_0xd6d4('0xf'),auth[_0xd6d4('0xa')](),controller[_0xd6d4('0x10')]);router[_0xd6d4('0x9')](_0xd6d4('0x11'),auth[_0xd6d4('0xa')](),controller[_0xd6d4('0x12')]);router[_0xd6d4('0x13')]('/',auth[_0xd6d4('0xa')](),controller[_0xd6d4('0x14')]);router['put'](_0xd6d4('0xc'),auth[_0xd6d4('0xa')](),controller[_0xd6d4('0x15')]);router['delete'](_0xd6d4('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xd6d4('0x16')]=router; \ No newline at end of file +var _0xd5f6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/subjects','getSubjects','getDescriptions','/:id/fields','getFields','post','create','put','delete','destroy'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0xd5f6,0xcf));var _0x6d5f=function(_0x1eae48,_0x565378){_0x1eae48=_0x1eae48-0x0;var _0x15c30c=_0xd5f6[_0x1eae48];return _0x15c30c;};'use strict';var multer=require(_0x6d5f('0x0'));var util=require(_0x6d5f('0x1'));var path=require(_0x6d5f('0x2'));var timeout=require(_0x6d5f('0x3'));var express=require('express');var router=express[_0x6d5f('0x4')]();var fs_extra=require(_0x6d5f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x6d5f('0x6'));var config=require('../../config/environment');var controller=require(_0x6d5f('0x7'));router['get']('/',auth[_0x6d5f('0x8')](),controller[_0x6d5f('0x9')]);router[_0x6d5f('0xa')](_0x6d5f('0xb'),auth[_0x6d5f('0x8')](),controller[_0x6d5f('0xc')]);router[_0x6d5f('0xa')](_0x6d5f('0xd'),auth['isAuthenticated'](),controller[_0x6d5f('0xe')]);router[_0x6d5f('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x6d5f('0xf')]);router[_0x6d5f('0xa')](_0x6d5f('0x10'),auth[_0x6d5f('0x8')](),controller[_0x6d5f('0x11')]);router[_0x6d5f('0x12')]('/',auth[_0x6d5f('0x8')](),controller[_0x6d5f('0x13')]);router[_0x6d5f('0x14')](_0x6d5f('0xb'),auth[_0x6d5f('0x8')](),controller['update']);router[_0x6d5f('0x15')](_0x6d5f('0xb'),auth[_0x6d5f('0x8')](),controller[_0x6d5f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 757f2a8..b0300b5 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 _0xa4c5=['sequelize','exports','STRING'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa4c5,0x12f));var _0x5a4c=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa4c5[_0x484e36];return _0xafc85d;};'use strict';var Sequelize=require(_0x5a4c('0x0'));module[_0x5a4c('0x1')]={'name':{'type':Sequelize[_0x5a4c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xda8e=['STRING','exports'];(function(_0x2be1ab,_0x2fe1fc){var _0x4c616d=function(_0x16dfc8){while(--_0x16dfc8){_0x2be1ab['push'](_0x2be1ab['shift']());}};_0x4c616d(++_0x2fe1fc);}(_0xda8e,0xc5));var _0xeda8=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0xda8e[_0x3f5dca];return _0x5b833a;};'use strict';var Sequelize=require('sequelize');module[_0xeda8('0x0')]={'name':{'type':Sequelize[_0xeda8('0x1')]},'description':{'type':Sequelize[_0xeda8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index d196d6a..0e39ca2 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 _0xd5fc=['intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','FreshsalesConfiguration','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','update','find','getSubjects','findOne','FreshsalesField','length','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','sendStatus','error','name','index','map','type','key','model','query','keys'];(function(_0x1df3d3,_0x4a09cc){var _0x1a2b8e=function(_0x4e05a4){while(--_0x4e05a4){_0x1df3d3['push'](_0x1df3d3['shift']());}};_0x1a2b8e(++_0x4a09cc);}(_0xd5fc,0x108));var _0xcd5f=function(_0x1e64e0,_0x2833fc){_0x1e64e0=_0x1e64e0-0x0;var _0x10672d=_0xd5fc[_0x1e64e0];return _0x10672d;};'use strict';var emlformat=require(_0xcd5f('0x0'));var rimraf=require(_0xcd5f('0x1'));var zipdir=require(_0xcd5f('0x2'));var jsonpatch=require(_0xcd5f('0x3'));var rp=require('request-promise');var moment=require(_0xcd5f('0x4'));var BPromise=require(_0xcd5f('0x5'));var Mustache=require('mustache');var util=require(_0xcd5f('0x6'));var path=require(_0xcd5f('0x7'));var sox=require('sox');var csv=require(_0xcd5f('0x8'));var ejs=require(_0xcd5f('0x9'));var fs=require('fs');var fs_extra=require(_0xcd5f('0xa'));var _=require(_0xcd5f('0xb'));var squel=require(_0xcd5f('0xc'));var crypto=require(_0xcd5f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcd5f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xcd5f('0xf'));var qs=require(_0xcd5f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd5f('0x11'))('api');var utils=require(_0xcd5f('0x12'));var config=require(_0xcd5f('0x13'));var licenseUtil=require(_0xcd5f('0x14'));var db=require(_0xcd5f('0x15'))['db'];function respondWithStatusCode(_0x447006,_0x54cb33){_0x54cb33=_0x54cb33||0xcc;return function(_0x48a0e5){if(_0x48a0e5){return _0x447006['sendStatus'](_0x54cb33);}return _0x447006[_0xcd5f('0x16')](_0x54cb33)[_0xcd5f('0x17')]();};}function respondWithResult(_0x3a82ef,_0x1217c4){_0x1217c4=_0x1217c4||0xc8;return function(_0x5a99d6){if(_0x5a99d6){return _0x3a82ef['status'](_0x1217c4)[_0xcd5f('0x18')](_0x5a99d6);}};}function respondWithFilteredResult(_0xe10de,_0x53ac2f){return function(_0x7ecea8){if(_0x7ecea8){var _0x467dc6=typeof _0x53ac2f[_0xcd5f('0x19')]===_0xcd5f('0x1a')&&typeof _0x53ac2f[_0xcd5f('0x1b')]===_0xcd5f('0x1a');var _0x2db9c0=_0x7ecea8[_0xcd5f('0x1c')];var _0x4856da=_0x467dc6?0x0:_0x53ac2f[_0xcd5f('0x19')];var _0x374c62=_0x467dc6?_0x7ecea8[_0xcd5f('0x1c')]:_0x53ac2f['offset']+_0x53ac2f['limit'];var _0x5b65ea;if(_0x374c62>=_0x2db9c0){_0x374c62=_0x2db9c0;_0x5b65ea=0xc8;}else{_0x5b65ea=0xce;}_0xe10de[_0xcd5f('0x16')](_0x5b65ea);return _0xe10de['set'](_0xcd5f('0x1d'),_0x4856da+'-'+_0x374c62+'/'+_0x2db9c0)[_0xcd5f('0x18')](_0x7ecea8);}return null;};}function patchUpdates(_0x2b1f01){return function(_0x12977e){try{jsonpatch[_0xcd5f('0x1e')](_0x12977e,_0x2b1f01,!![]);}catch(_0x435be7){return BPromise[_0xcd5f('0x1f')](_0x435be7);}return _0x12977e[_0xcd5f('0x20')]();};}function saveUpdates(_0x335957,_0x4720ba){return function(_0x42796c){if(_0x42796c){return _0x42796c['update'](_0x335957)[_0xcd5f('0x21')](function(_0x2c923b){return _0x2c923b;});}return null;};}function removeEntity(_0x5a7657,_0xad634f){return function(_0x44b730){if(_0x44b730){return _0x44b730['destroy']()[_0xcd5f('0x21')](function(){_0x5a7657['status'](0xcc)[_0xcd5f('0x17')]();});}};}function handleEntityNotFound(_0xe711fc,_0x146a6c){return function(_0x5a6483){if(!_0x5a6483){_0xe711fc[_0xcd5f('0x22')](0x194);}return _0x5a6483;};}function handleError(_0x21c270,_0x5d0745){_0x5d0745=_0x5d0745||0x1f4;return function(_0x4807c2){logger[_0xcd5f('0x23')](_0x4807c2['stack']);if(_0x4807c2[_0xcd5f('0x24')]){delete _0x4807c2[_0xcd5f('0x24')];}_0x21c270[_0xcd5f('0x16')](_0x5d0745)['send'](_0x4807c2);};}exports[_0xcd5f('0x25')]=function(_0x5b852a,_0x5a3fb6){var _0x47ac82={},_0x1828ec={},_0x2ac80a={'count':0x0,'rows':[]};var _0x51e1a7=_[_0xcd5f('0x26')](db['FreshsalesConfiguration']['rawAttributes'],function(_0x22253d){return{'name':_0x22253d['fieldName'],'type':_0x22253d[_0xcd5f('0x27')][_0xcd5f('0x28')]};});_0x1828ec[_0xcd5f('0x29')]=_[_0xcd5f('0x26')](_0x51e1a7,_0xcd5f('0x24'));_0x1828ec[_0xcd5f('0x2a')]=_[_0xcd5f('0x2b')](_0x5b852a[_0xcd5f('0x2a')]);_0x1828ec['filters']=_[_0xcd5f('0x2c')](_0x1828ec[_0xcd5f('0x29')],_0x1828ec['query']);_0x47ac82[_0xcd5f('0x2d')]=_[_0xcd5f('0x2c')](_0x1828ec[_0xcd5f('0x29')],qs[_0xcd5f('0x2e')](_0x5b852a['query']['fields']));_0x47ac82[_0xcd5f('0x2d')]=_0x47ac82[_0xcd5f('0x2d')]['length']?_0x47ac82[_0xcd5f('0x2d')]:_0x1828ec['model'];if(!_0x5b852a[_0xcd5f('0x2a')][_0xcd5f('0x2f')](_0xcd5f('0x30'))){_0x47ac82[_0xcd5f('0x1b')]=qs['limit'](_0x5b852a[_0xcd5f('0x2a')][_0xcd5f('0x1b')]);_0x47ac82[_0xcd5f('0x19')]=qs[_0xcd5f('0x19')](_0x5b852a[_0xcd5f('0x2a')]['offset']);}_0x47ac82[_0xcd5f('0x31')]=qs[_0xcd5f('0x32')](_0x5b852a[_0xcd5f('0x2a')][_0xcd5f('0x32')]);_0x47ac82[_0xcd5f('0x33')]=qs[_0xcd5f('0x34')](_[_0xcd5f('0x35')](_0x5b852a[_0xcd5f('0x2a')],_0x1828ec[_0xcd5f('0x34')]),_0x51e1a7);if(_0x5b852a[_0xcd5f('0x2a')]['filter']){_0x47ac82[_0xcd5f('0x33')]=_[_0xcd5f('0x36')](_0x47ac82[_0xcd5f('0x33')],{'$or':_[_0xcd5f('0x26')](_0x51e1a7,function(_0x4e75a3){if(_0x4e75a3[_0xcd5f('0x27')]!==_0xcd5f('0x37')){var _0x175a82={};_0x175a82[_0x4e75a3[_0xcd5f('0x24')]]={'$like':'%'+_0x5b852a[_0xcd5f('0x2a')][_0xcd5f('0x38')]+'%'};return _0x175a82;}})});}_0x47ac82=_['merge']({},_0x47ac82,_0x5b852a['options']);var _0x3b3904={'where':_0x47ac82[_0xcd5f('0x33')]};return db[_0xcd5f('0x39')][_0xcd5f('0x1c')](_0x3b3904)['then'](function(_0x16e81c){_0x2ac80a['count']=_0x16e81c;if(_0x5b852a[_0xcd5f('0x2a')][_0xcd5f('0x3a')]){_0x47ac82['include']=[{'all':!![]}];}return db[_0xcd5f('0x39')][_0xcd5f('0x3b')](_0x47ac82);})[_0xcd5f('0x21')](function(_0x9d9812){_0x2ac80a[_0xcd5f('0x3c')]=_0x9d9812;return _0x2ac80a;})[_0xcd5f('0x21')](respondWithFilteredResult(_0x5a3fb6,_0x47ac82))[_0xcd5f('0x3d')](handleError(_0x5a3fb6,null));};exports[_0xcd5f('0x3e')]=function(_0xbd83f1,_0x1265fc){var _0x3b991b={'raw':![],'where':{'id':_0xbd83f1[_0xcd5f('0x3f')]['id']}},_0x1f514a={};_0x1f514a[_0xcd5f('0x29')]=_[_0xcd5f('0x2b')](db[_0xcd5f('0x39')][_0xcd5f('0x40')]);_0x1f514a[_0xcd5f('0x2a')]=_[_0xcd5f('0x2b')](_0xbd83f1['query']);_0x1f514a[_0xcd5f('0x34')]=_['intersection'](_0x1f514a[_0xcd5f('0x29')],_0x1f514a['query']);_0x3b991b['attributes']=_['intersection'](_0x1f514a[_0xcd5f('0x29')],qs[_0xcd5f('0x2e')](_0xbd83f1['query'][_0xcd5f('0x2e')]));_0x3b991b[_0xcd5f('0x2d')]=_0x3b991b[_0xcd5f('0x2d')]['length']?_0x3b991b[_0xcd5f('0x2d')]:_0x1f514a[_0xcd5f('0x29')];if(_0xbd83f1[_0xcd5f('0x2a')][_0xcd5f('0x3a')]){_0x3b991b[_0xcd5f('0x41')]=[{'all':!![]}];}_0x3b991b=_[_0xcd5f('0x36')]({},_0x3b991b,_0xbd83f1[_0xcd5f('0x42')]);return db[_0xcd5f('0x39')]['find'](_0x3b991b)['then'](handleEntityNotFound(_0x1265fc,null))['then'](respondWithResult(_0x1265fc,null))[_0xcd5f('0x3d')](handleError(_0x1265fc,null));};exports[_0xcd5f('0x43')]=function(_0x1fd3a1,_0x41cf3a){return db[_0xcd5f('0x39')][_0xcd5f('0x43')](_0x1fd3a1[_0xcd5f('0x44')],{})[_0xcd5f('0x21')](respondWithResult(_0x41cf3a,0xc9))['catch'](handleError(_0x41cf3a,null));};exports[_0xcd5f('0x45')]=function(_0x2000a9,_0x4964e4){if(_0x2000a9['body']['id']){delete _0x2000a9[_0xcd5f('0x44')]['id'];}return db[_0xcd5f('0x39')][_0xcd5f('0x46')]({'where':{'id':_0x2000a9['params']['id']}})[_0xcd5f('0x21')](handleEntityNotFound(_0x4964e4,null))[_0xcd5f('0x21')](saveUpdates(_0x2000a9[_0xcd5f('0x44')],null))[_0xcd5f('0x21')](respondWithResult(_0x4964e4,null))[_0xcd5f('0x3d')](handleError(_0x4964e4,null));};exports['destroy']=function(_0x5afbea,_0x120023){return db[_0xcd5f('0x39')][_0xcd5f('0x46')]({'where':{'id':_0x5afbea['params']['id']}})['then'](handleEntityNotFound(_0x120023,null))[_0xcd5f('0x21')](removeEntity(_0x120023,null))[_0xcd5f('0x3d')](handleError(_0x120023,null));};exports[_0xcd5f('0x47')]=function(_0x472c99,_0x3b438c,_0x4089c8){var _0x1401c4={};var _0x5f4d03={};var _0x1c7d41;var _0x56a362;return db[_0xcd5f('0x39')][_0xcd5f('0x48')]({'where':{'id':_0x472c99[_0xcd5f('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3b438c,null))[_0xcd5f('0x21')](function(_0x4bf0f0){if(_0x4bf0f0){_0x1c7d41=_0x4bf0f0;_0x5f4d03[_0xcd5f('0x29')]=_[_0xcd5f('0x2b')](db[_0xcd5f('0x49')][_0xcd5f('0x40')]);_0x5f4d03[_0xcd5f('0x2a')]=_[_0xcd5f('0x2b')](_0x472c99[_0xcd5f('0x2a')]);_0x5f4d03[_0xcd5f('0x34')]=_[_0xcd5f('0x2c')](_0x5f4d03[_0xcd5f('0x29')],_0x5f4d03[_0xcd5f('0x2a')]);_0x1401c4[_0xcd5f('0x2d')]=_['intersection'](_0x5f4d03[_0xcd5f('0x29')],qs[_0xcd5f('0x2e')](_0x472c99[_0xcd5f('0x2a')][_0xcd5f('0x2e')]));_0x1401c4[_0xcd5f('0x2d')]=_0x1401c4[_0xcd5f('0x2d')][_0xcd5f('0x4a')]?_0x1401c4[_0xcd5f('0x2d')]:_0x5f4d03[_0xcd5f('0x29')];_0x1401c4[_0xcd5f('0x31')]=qs[_0xcd5f('0x32')](_0x472c99[_0xcd5f('0x2a')][_0xcd5f('0x32')]);_0x1401c4[_0xcd5f('0x33')]=qs[_0xcd5f('0x34')](_[_0xcd5f('0x35')](_0x472c99[_0xcd5f('0x2a')],_0x5f4d03[_0xcd5f('0x34')]));if(_0x472c99[_0xcd5f('0x2a')][_0xcd5f('0x38')]){_0x1401c4['where']=_[_0xcd5f('0x36')](_0x1401c4['where'],{'$or':_[_0xcd5f('0x26')](_0x1401c4[_0xcd5f('0x2d')],function(_0xe0359f){var _0x25d941={};_0x25d941[_0xe0359f]={'$like':'%'+_0x472c99[_0xcd5f('0x2a')][_0xcd5f('0x38')]+'%'};return _0x25d941;})});}_0x1401c4=_['merge']({},_0x1401c4,_0x472c99[_0xcd5f('0x42')]);return _0x1c7d41[_0xcd5f('0x47')](_0x1401c4);}})[_0xcd5f('0x21')](function(_0x1d5d7f){if(_0x1d5d7f){_0x56a362=_0x1d5d7f['length'];if(!_0x472c99[_0xcd5f('0x2a')][_0xcd5f('0x2f')]('nolimit')){_0x1401c4['limit']=qs['limit'](_0x472c99[_0xcd5f('0x2a')][_0xcd5f('0x1b')]);_0x1401c4[_0xcd5f('0x19')]=qs['offset'](_0x472c99[_0xcd5f('0x2a')]['offset']);}return _0x1c7d41['getSubjects'](_0x1401c4);}})[_0xcd5f('0x21')](function(_0x15da49){if(_0x15da49){return _0x15da49?{'count':_0x56a362,'rows':_0x15da49}:null;}})[_0xcd5f('0x21')](respondWithResult(_0x3b438c,null))[_0xcd5f('0x3d')](handleError(_0x3b438c,null));};exports[_0xcd5f('0x4b')]=function(_0xf901e1,_0x1a8e1a,_0x13c4cb){var _0x1b5f36={};var _0xe77b9b={};var _0xc81393;var _0x3874f9;return db[_0xcd5f('0x39')][_0xcd5f('0x48')]({'where':{'id':_0xf901e1[_0xcd5f('0x3f')]['id']}})[_0xcd5f('0x21')](handleEntityNotFound(_0x1a8e1a,null))[_0xcd5f('0x21')](function(_0xd46c28){if(_0xd46c28){_0xc81393=_0xd46c28;_0xe77b9b['model']=_[_0xcd5f('0x2b')](db[_0xcd5f('0x49')][_0xcd5f('0x40')]);_0xe77b9b['query']=_[_0xcd5f('0x2b')](_0xf901e1['query']);_0xe77b9b[_0xcd5f('0x34')]=_[_0xcd5f('0x2c')](_0xe77b9b[_0xcd5f('0x29')],_0xe77b9b['query']);_0x1b5f36['attributes']=_['intersection'](_0xe77b9b[_0xcd5f('0x29')],qs[_0xcd5f('0x2e')](_0xf901e1[_0xcd5f('0x2a')]['fields']));_0x1b5f36['attributes']=_0x1b5f36[_0xcd5f('0x2d')]['length']?_0x1b5f36['attributes']:_0xe77b9b['model'];_0x1b5f36[_0xcd5f('0x31')]=qs[_0xcd5f('0x32')](_0xf901e1[_0xcd5f('0x2a')][_0xcd5f('0x32')]);_0x1b5f36[_0xcd5f('0x33')]=qs[_0xcd5f('0x34')](_[_0xcd5f('0x35')](_0xf901e1['query'],_0xe77b9b[_0xcd5f('0x34')]));if(_0xf901e1[_0xcd5f('0x2a')][_0xcd5f('0x38')]){_0x1b5f36[_0xcd5f('0x33')]=_[_0xcd5f('0x36')](_0x1b5f36[_0xcd5f('0x33')],{'$or':_[_0xcd5f('0x26')](_0x1b5f36[_0xcd5f('0x2d')],function(_0x471983){var _0x2f98c5={};_0x2f98c5[_0x471983]={'$like':'%'+_0xf901e1['query'][_0xcd5f('0x38')]+'%'};return _0x2f98c5;})});}_0x1b5f36=_['merge']({},_0x1b5f36,_0xf901e1['options']);return _0xc81393[_0xcd5f('0x4b')](_0x1b5f36);}})[_0xcd5f('0x21')](function(_0x517198){if(_0x517198){_0x3874f9=_0x517198[_0xcd5f('0x4a')];if(!_0xf901e1[_0xcd5f('0x2a')][_0xcd5f('0x2f')](_0xcd5f('0x30'))){_0x1b5f36['limit']=qs[_0xcd5f('0x1b')](_0xf901e1[_0xcd5f('0x2a')][_0xcd5f('0x1b')]);_0x1b5f36[_0xcd5f('0x19')]=qs['offset'](_0xf901e1['query'][_0xcd5f('0x19')]);}return _0xc81393[_0xcd5f('0x4b')](_0x1b5f36);}})['then'](function(_0x5693d6){if(_0x5693d6){return _0x5693d6?{'count':_0x3874f9,'rows':_0x5693d6}:null;}})[_0xcd5f('0x21')](respondWithResult(_0x1a8e1a,null))['catch'](handleError(_0x1a8e1a,null));};exports['getFields']=function(_0x23245c,_0xc02459,_0x3b7fa7){var _0x2de33c={};var _0xf05dae={};var _0x1444b4;var _0x56ca08;return db[_0xcd5f('0x39')][_0xcd5f('0x48')]({'where':{'id':_0x23245c[_0xcd5f('0x3f')]['id']}})[_0xcd5f('0x21')](handleEntityNotFound(_0xc02459,null))[_0xcd5f('0x21')](function(_0x2d0c5b){if(_0x2d0c5b){_0x1444b4=_0x2d0c5b;_0xf05dae[_0xcd5f('0x29')]=_[_0xcd5f('0x2b')](db[_0xcd5f('0x49')][_0xcd5f('0x40')]);_0xf05dae[_0xcd5f('0x2a')]=_[_0xcd5f('0x2b')](_0x23245c[_0xcd5f('0x2a')]);_0xf05dae[_0xcd5f('0x34')]=_[_0xcd5f('0x2c')](_0xf05dae['model'],_0xf05dae[_0xcd5f('0x2a')]);_0x2de33c[_0xcd5f('0x2d')]=_[_0xcd5f('0x2c')](_0xf05dae[_0xcd5f('0x29')],qs[_0xcd5f('0x2e')](_0x23245c[_0xcd5f('0x2a')]['fields']));_0x2de33c[_0xcd5f('0x2d')]=_0x2de33c['attributes'][_0xcd5f('0x4a')]?_0x2de33c[_0xcd5f('0x2d')]:_0xf05dae['model'];_0x2de33c[_0xcd5f('0x31')]=qs[_0xcd5f('0x32')](_0x23245c[_0xcd5f('0x2a')][_0xcd5f('0x32')]);_0x2de33c[_0xcd5f('0x33')]=qs[_0xcd5f('0x34')](_[_0xcd5f('0x35')](_0x23245c[_0xcd5f('0x2a')],_0xf05dae[_0xcd5f('0x34')]));if(_0x23245c['query'][_0xcd5f('0x38')]){_0x2de33c[_0xcd5f('0x33')]=_[_0xcd5f('0x36')](_0x2de33c[_0xcd5f('0x33')],{'$or':_[_0xcd5f('0x26')](_0x2de33c[_0xcd5f('0x2d')],function(_0x113d37){var _0x582f6b={};_0x582f6b[_0x113d37]={'$like':'%'+_0x23245c[_0xcd5f('0x2a')][_0xcd5f('0x38')]+'%'};return _0x582f6b;})});}_0x2de33c=_[_0xcd5f('0x36')]({},_0x2de33c,_0x23245c[_0xcd5f('0x42')]);return _0x1444b4[_0xcd5f('0x4c')](_0x2de33c);}})[_0xcd5f('0x21')](function(_0x2addb9){if(_0x2addb9){_0x56ca08=_0x2addb9[_0xcd5f('0x4a')];if(!_0x23245c['query']['hasOwnProperty'](_0xcd5f('0x30'))){_0x2de33c['limit']=qs[_0xcd5f('0x1b')](_0x23245c[_0xcd5f('0x2a')]['limit']);_0x2de33c[_0xcd5f('0x19')]=qs[_0xcd5f('0x19')](_0x23245c[_0xcd5f('0x2a')][_0xcd5f('0x19')]);}return _0x1444b4[_0xcd5f('0x4c')](_0x2de33c);}})['then'](function(_0x20c621){if(_0x20c621){return _0x20c621?{'count':_0x56ca08,'rows':_0x20c621}:null;}})[_0xcd5f('0x21')](respondWithResult(_0xc02459,null))[_0xcd5f('0x3d')](handleError(_0xc02459,null));}; \ No newline at end of file +var _0x164e=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','FreshsalesConfiguration','includeAll','include','show','rawAttributes','options','catch','create','body','find','params','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache'];(function(_0x373756,_0x123262){var _0x420ba3=function(_0x2e3a24){while(--_0x2e3a24){_0x373756['push'](_0x373756['shift']());}};_0x420ba3(++_0x123262);}(_0x164e,0x136));var _0xe164=function(_0x5afb77,_0xdad1e1){_0x5afb77=_0x5afb77-0x0;var _0x477268=_0x164e[_0x5afb77];return _0x477268;};'use strict';var emlformat=require(_0xe164('0x0'));var rimraf=require(_0xe164('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe164('0x2'));var rp=require(_0xe164('0x3'));var moment=require(_0xe164('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe164('0x5'));var util=require(_0xe164('0x6'));var path=require(_0xe164('0x7'));var sox=require(_0xe164('0x8'));var csv=require(_0xe164('0x9'));var ejs=require(_0xe164('0xa'));var fs=require('fs');var fs_extra=require(_0xe164('0xb'));var _=require(_0xe164('0xc'));var squel=require(_0xe164('0xd'));var crypto=require(_0xe164('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe164('0xf'));var toCsv=require(_0xe164('0x9'));var querystring=require('querystring');var Papa=require(_0xe164('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe164('0x11'));var as=require(_0xe164('0x12'));var hardwareService=require(_0xe164('0x13'));var logger=require('../../config/logger')(_0xe164('0x14'));var utils=require(_0xe164('0x15'));var config=require(_0xe164('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10dd67,_0xe81a29){_0xe81a29=_0xe81a29||0xcc;return function(_0x4110d6){if(_0x4110d6){return _0x10dd67[_0xe164('0x17')](_0xe81a29);}return _0x10dd67[_0xe164('0x18')](_0xe81a29)[_0xe164('0x19')]();};}function respondWithResult(_0x4dfcd3,_0x3f5ad6){_0x3f5ad6=_0x3f5ad6||0xc8;return function(_0x2a910a){if(_0x2a910a){return _0x4dfcd3['status'](_0x3f5ad6)[_0xe164('0x1a')](_0x2a910a);}};}function respondWithFilteredResult(_0x1087cb,_0x5a1014){return function(_0x47a547){if(_0x47a547){var _0x1a9bb3=typeof _0x5a1014['offset']===_0xe164('0x1b')&&typeof _0x5a1014['limit']===_0xe164('0x1b');var _0xd59489=_0x47a547[_0xe164('0x1c')];var _0x5f5db6=_0x1a9bb3?0x0:_0x5a1014[_0xe164('0x1d')];var _0x16001f=_0x1a9bb3?_0x47a547[_0xe164('0x1c')]:_0x5a1014[_0xe164('0x1d')]+_0x5a1014[_0xe164('0x1e')];var _0x2e4e2e;if(_0x16001f>=_0xd59489){_0x16001f=_0xd59489;_0x2e4e2e=0xc8;}else{_0x2e4e2e=0xce;}_0x1087cb[_0xe164('0x18')](_0x2e4e2e);return _0x1087cb[_0xe164('0x1f')](_0xe164('0x20'),_0x5f5db6+'-'+_0x16001f+'/'+_0xd59489)[_0xe164('0x1a')](_0x47a547);}return null;};}function patchUpdates(_0x185172){return function(_0x36941f){try{jsonpatch[_0xe164('0x21')](_0x36941f,_0x185172,!![]);}catch(_0x45977a){return BPromise[_0xe164('0x22')](_0x45977a);}return _0x36941f[_0xe164('0x23')]();};}function saveUpdates(_0x3e9a49,_0x14070d){return function(_0x3097fe){if(_0x3097fe){return _0x3097fe[_0xe164('0x24')](_0x3e9a49)[_0xe164('0x25')](function(_0x33bca4){return _0x33bca4;});}return null;};}function removeEntity(_0x1c9825,_0x57ca02){return function(_0x41829a){if(_0x41829a){return _0x41829a[_0xe164('0x26')]()['then'](function(){_0x1c9825[_0xe164('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d11e2,_0x4c4f1b){return function(_0x33a995){if(!_0x33a995){_0x4d11e2[_0xe164('0x17')](0x194);}return _0x33a995;};}function handleError(_0x4ccd7a,_0x1860fe){_0x1860fe=_0x1860fe||0x1f4;return function(_0x528e97){logger[_0xe164('0x27')](_0x528e97[_0xe164('0x28')]);if(_0x528e97[_0xe164('0x29')]){delete _0x528e97['name'];}_0x4ccd7a[_0xe164('0x18')](_0x1860fe)['send'](_0x528e97);};}exports[_0xe164('0x2a')]=function(_0x41614c,_0x584ff1){var _0x134a89={},_0x49fa16={},_0x58b40a={'count':0x0,'rows':[]};var _0x1a82f9=_['map'](db['FreshsalesConfiguration']['rawAttributes'],function(_0x41fe11){return{'name':_0x41fe11['fieldName'],'type':_0x41fe11[_0xe164('0x2b')][_0xe164('0x2c')]};});_0x49fa16['model']=_[_0xe164('0x2d')](_0x1a82f9,_0xe164('0x29'));_0x49fa16[_0xe164('0x2e')]=_[_0xe164('0x2f')](_0x41614c['query']);_0x49fa16[_0xe164('0x30')]=_[_0xe164('0x31')](_0x49fa16[_0xe164('0x32')],_0x49fa16[_0xe164('0x2e')]);_0x134a89[_0xe164('0x33')]=_['intersection'](_0x49fa16[_0xe164('0x32')],qs[_0xe164('0x34')](_0x41614c[_0xe164('0x2e')][_0xe164('0x34')]));_0x134a89[_0xe164('0x33')]=_0x134a89[_0xe164('0x33')][_0xe164('0x35')]?_0x134a89[_0xe164('0x33')]:_0x49fa16['model'];if(!_0x41614c[_0xe164('0x2e')][_0xe164('0x36')](_0xe164('0x37'))){_0x134a89[_0xe164('0x1e')]=qs[_0xe164('0x1e')](_0x41614c[_0xe164('0x2e')][_0xe164('0x1e')]);_0x134a89[_0xe164('0x1d')]=qs[_0xe164('0x1d')](_0x41614c[_0xe164('0x2e')][_0xe164('0x1d')]);}_0x134a89[_0xe164('0x38')]=qs[_0xe164('0x39')](_0x41614c[_0xe164('0x2e')][_0xe164('0x39')]);_0x134a89[_0xe164('0x3a')]=qs[_0xe164('0x30')](_[_0xe164('0x3b')](_0x41614c[_0xe164('0x2e')],_0x49fa16[_0xe164('0x30')]),_0x1a82f9);if(_0x41614c[_0xe164('0x2e')][_0xe164('0x3c')]){_0x134a89['where']=_[_0xe164('0x3d')](_0x134a89[_0xe164('0x3a')],{'$or':_[_0xe164('0x2d')](_0x1a82f9,function(_0x2a502c){if(_0x2a502c[_0xe164('0x2b')]!==_0xe164('0x3e')){var _0x5bd2b3={};_0x5bd2b3[_0x2a502c['name']]={'$like':'%'+_0x41614c['query'][_0xe164('0x3c')]+'%'};return _0x5bd2b3;}})});}_0x134a89=_[_0xe164('0x3d')]({},_0x134a89,_0x41614c['options']);var _0x1284f0={'where':_0x134a89[_0xe164('0x3a')]};return db[_0xe164('0x3f')][_0xe164('0x1c')](_0x1284f0)[_0xe164('0x25')](function(_0x28e776){_0x58b40a['count']=_0x28e776;if(_0x41614c[_0xe164('0x2e')][_0xe164('0x40')]){_0x134a89[_0xe164('0x41')]=[{'all':!![]}];}return db[_0xe164('0x3f')]['findAll'](_0x134a89);})[_0xe164('0x25')](function(_0x2676c0){_0x58b40a['rows']=_0x2676c0;return _0x58b40a;})[_0xe164('0x25')](respondWithFilteredResult(_0x584ff1,_0x134a89))['catch'](handleError(_0x584ff1,null));};exports[_0xe164('0x42')]=function(_0x7ed8f3,_0xf89e6){var _0x4210c3={'raw':![],'where':{'id':_0x7ed8f3['params']['id']}},_0x1d8bb7={};_0x1d8bb7[_0xe164('0x32')]=_[_0xe164('0x2f')](db[_0xe164('0x3f')][_0xe164('0x43')]);_0x1d8bb7[_0xe164('0x2e')]=_[_0xe164('0x2f')](_0x7ed8f3[_0xe164('0x2e')]);_0x1d8bb7[_0xe164('0x30')]=_[_0xe164('0x31')](_0x1d8bb7[_0xe164('0x32')],_0x1d8bb7[_0xe164('0x2e')]);_0x4210c3[_0xe164('0x33')]=_[_0xe164('0x31')](_0x1d8bb7[_0xe164('0x32')],qs[_0xe164('0x34')](_0x7ed8f3['query']['fields']));_0x4210c3[_0xe164('0x33')]=_0x4210c3[_0xe164('0x33')]['length']?_0x4210c3['attributes']:_0x1d8bb7[_0xe164('0x32')];if(_0x7ed8f3[_0xe164('0x2e')]['includeAll']){_0x4210c3[_0xe164('0x41')]=[{'all':!![]}];}_0x4210c3=_['merge']({},_0x4210c3,_0x7ed8f3[_0xe164('0x44')]);return db[_0xe164('0x3f')]['find'](_0x4210c3)[_0xe164('0x25')](handleEntityNotFound(_0xf89e6,null))[_0xe164('0x25')](respondWithResult(_0xf89e6,null))[_0xe164('0x45')](handleError(_0xf89e6,null));};exports['create']=function(_0x39b56f,_0x56f3be){return db[_0xe164('0x3f')][_0xe164('0x46')](_0x39b56f[_0xe164('0x47')],{})[_0xe164('0x25')](respondWithResult(_0x56f3be,0xc9))[_0xe164('0x45')](handleError(_0x56f3be,null));};exports['update']=function(_0x139475,_0x537577){if(_0x139475[_0xe164('0x47')]['id']){delete _0x139475['body']['id'];}return db[_0xe164('0x3f')][_0xe164('0x48')]({'where':{'id':_0x139475['params']['id']}})[_0xe164('0x25')](handleEntityNotFound(_0x537577,null))[_0xe164('0x25')](saveUpdates(_0x139475[_0xe164('0x47')],null))[_0xe164('0x25')](respondWithResult(_0x537577,null))['catch'](handleError(_0x537577,null));};exports[_0xe164('0x26')]=function(_0x53a8fd,_0x3c93c9){return db[_0xe164('0x3f')][_0xe164('0x48')]({'where':{'id':_0x53a8fd[_0xe164('0x49')]['id']}})[_0xe164('0x25')](handleEntityNotFound(_0x3c93c9,null))['then'](removeEntity(_0x3c93c9,null))[_0xe164('0x45')](handleError(_0x3c93c9,null));};exports[_0xe164('0x4a')]=function(_0x306bc8,_0x2a9b9b,_0x174e81){var _0x141173={};var _0x4b4354={};var _0x5e72aa;var _0x3f74e3;return db[_0xe164('0x3f')][_0xe164('0x4b')]({'where':{'id':_0x306bc8[_0xe164('0x49')]['id']}})[_0xe164('0x25')](handleEntityNotFound(_0x2a9b9b,null))[_0xe164('0x25')](function(_0x136380){if(_0x136380){_0x5e72aa=_0x136380;_0x4b4354[_0xe164('0x32')]=_[_0xe164('0x2f')](db[_0xe164('0x4c')][_0xe164('0x43')]);_0x4b4354[_0xe164('0x2e')]=_[_0xe164('0x2f')](_0x306bc8[_0xe164('0x2e')]);_0x4b4354[_0xe164('0x30')]=_['intersection'](_0x4b4354['model'],_0x4b4354[_0xe164('0x2e')]);_0x141173[_0xe164('0x33')]=_[_0xe164('0x31')](_0x4b4354['model'],qs['fields'](_0x306bc8['query'][_0xe164('0x34')]));_0x141173['attributes']=_0x141173['attributes'][_0xe164('0x35')]?_0x141173[_0xe164('0x33')]:_0x4b4354[_0xe164('0x32')];_0x141173[_0xe164('0x38')]=qs[_0xe164('0x39')](_0x306bc8[_0xe164('0x2e')][_0xe164('0x39')]);_0x141173['where']=qs[_0xe164('0x30')](_[_0xe164('0x3b')](_0x306bc8[_0xe164('0x2e')],_0x4b4354[_0xe164('0x30')]));if(_0x306bc8['query']['filter']){_0x141173['where']=_[_0xe164('0x3d')](_0x141173[_0xe164('0x3a')],{'$or':_['map'](_0x141173[_0xe164('0x33')],function(_0x322c2d){var _0x2f7bff={};_0x2f7bff[_0x322c2d]={'$like':'%'+_0x306bc8[_0xe164('0x2e')][_0xe164('0x3c')]+'%'};return _0x2f7bff;})});}_0x141173=_[_0xe164('0x3d')]({},_0x141173,_0x306bc8[_0xe164('0x44')]);return _0x5e72aa[_0xe164('0x4a')](_0x141173);}})[_0xe164('0x25')](function(_0x15d325){if(_0x15d325){_0x3f74e3=_0x15d325[_0xe164('0x35')];if(!_0x306bc8[_0xe164('0x2e')][_0xe164('0x36')](_0xe164('0x37'))){_0x141173[_0xe164('0x1e')]=qs[_0xe164('0x1e')](_0x306bc8[_0xe164('0x2e')][_0xe164('0x1e')]);_0x141173[_0xe164('0x1d')]=qs[_0xe164('0x1d')](_0x306bc8['query'][_0xe164('0x1d')]);}return _0x5e72aa[_0xe164('0x4a')](_0x141173);}})[_0xe164('0x25')](function(_0x319a21){if(_0x319a21){return _0x319a21?{'count':_0x3f74e3,'rows':_0x319a21}:null;}})['then'](respondWithResult(_0x2a9b9b,null))[_0xe164('0x45')](handleError(_0x2a9b9b,null));};exports[_0xe164('0x4d')]=function(_0x4fdabc,_0x5ee886,_0x1a12c7){var _0x2d111d={};var _0xc5b2bb={};var _0x4507d7;var _0x3fe243;return db[_0xe164('0x3f')][_0xe164('0x4b')]({'where':{'id':_0x4fdabc[_0xe164('0x49')]['id']}})[_0xe164('0x25')](handleEntityNotFound(_0x5ee886,null))['then'](function(_0x236254){if(_0x236254){_0x4507d7=_0x236254;_0xc5b2bb['model']=_['keys'](db[_0xe164('0x4c')]['rawAttributes']);_0xc5b2bb['query']=_[_0xe164('0x2f')](_0x4fdabc[_0xe164('0x2e')]);_0xc5b2bb[_0xe164('0x30')]=_[_0xe164('0x31')](_0xc5b2bb[_0xe164('0x32')],_0xc5b2bb[_0xe164('0x2e')]);_0x2d111d[_0xe164('0x33')]=_[_0xe164('0x31')](_0xc5b2bb[_0xe164('0x32')],qs['fields'](_0x4fdabc[_0xe164('0x2e')][_0xe164('0x34')]));_0x2d111d['attributes']=_0x2d111d['attributes'][_0xe164('0x35')]?_0x2d111d['attributes']:_0xc5b2bb[_0xe164('0x32')];_0x2d111d[_0xe164('0x38')]=qs['sort'](_0x4fdabc['query'][_0xe164('0x39')]);_0x2d111d['where']=qs[_0xe164('0x30')](_[_0xe164('0x3b')](_0x4fdabc[_0xe164('0x2e')],_0xc5b2bb[_0xe164('0x30')]));if(_0x4fdabc[_0xe164('0x2e')][_0xe164('0x3c')]){_0x2d111d['where']=_['merge'](_0x2d111d[_0xe164('0x3a')],{'$or':_[_0xe164('0x2d')](_0x2d111d[_0xe164('0x33')],function(_0x194ae3){var _0x2b08c7={};_0x2b08c7[_0x194ae3]={'$like':'%'+_0x4fdabc['query'][_0xe164('0x3c')]+'%'};return _0x2b08c7;})});}_0x2d111d=_[_0xe164('0x3d')]({},_0x2d111d,_0x4fdabc[_0xe164('0x44')]);return _0x4507d7[_0xe164('0x4d')](_0x2d111d);}})[_0xe164('0x25')](function(_0x17d359){if(_0x17d359){_0x3fe243=_0x17d359['length'];if(!_0x4fdabc[_0xe164('0x2e')][_0xe164('0x36')](_0xe164('0x37'))){_0x2d111d[_0xe164('0x1e')]=qs[_0xe164('0x1e')](_0x4fdabc['query'][_0xe164('0x1e')]);_0x2d111d[_0xe164('0x1d')]=qs['offset'](_0x4fdabc[_0xe164('0x2e')][_0xe164('0x1d')]);}return _0x4507d7['getDescriptions'](_0x2d111d);}})['then'](function(_0x3a9f0b){if(_0x3a9f0b){return _0x3a9f0b?{'count':_0x3fe243,'rows':_0x3a9f0b}:null;}})['then'](respondWithResult(_0x5ee886,null))[_0xe164('0x45')](handleError(_0x5ee886,null));};exports['getFields']=function(_0x3dd355,_0x558810,_0x5a458d){var _0x459e85={};var _0x24e3d2={};var _0x389ab9;var _0x5a344d;return db[_0xe164('0x3f')][_0xe164('0x4b')]({'where':{'id':_0x3dd355[_0xe164('0x49')]['id']}})[_0xe164('0x25')](handleEntityNotFound(_0x558810,null))['then'](function(_0x3982cc){if(_0x3982cc){_0x389ab9=_0x3982cc;_0x24e3d2['model']=_[_0xe164('0x2f')](db[_0xe164('0x4c')][_0xe164('0x43')]);_0x24e3d2[_0xe164('0x2e')]=_['keys'](_0x3dd355['query']);_0x24e3d2[_0xe164('0x30')]=_['intersection'](_0x24e3d2[_0xe164('0x32')],_0x24e3d2['query']);_0x459e85[_0xe164('0x33')]=_['intersection'](_0x24e3d2[_0xe164('0x32')],qs[_0xe164('0x34')](_0x3dd355[_0xe164('0x2e')][_0xe164('0x34')]));_0x459e85[_0xe164('0x33')]=_0x459e85['attributes']['length']?_0x459e85[_0xe164('0x33')]:_0x24e3d2[_0xe164('0x32')];_0x459e85['order']=qs[_0xe164('0x39')](_0x3dd355[_0xe164('0x2e')][_0xe164('0x39')]);_0x459e85[_0xe164('0x3a')]=qs[_0xe164('0x30')](_['pick'](_0x3dd355[_0xe164('0x2e')],_0x24e3d2[_0xe164('0x30')]));if(_0x3dd355[_0xe164('0x2e')][_0xe164('0x3c')]){_0x459e85[_0xe164('0x3a')]=_[_0xe164('0x3d')](_0x459e85[_0xe164('0x3a')],{'$or':_[_0xe164('0x2d')](_0x459e85['attributes'],function(_0x520065){var _0x5263ce={};_0x5263ce[_0x520065]={'$like':'%'+_0x3dd355[_0xe164('0x2e')][_0xe164('0x3c')]+'%'};return _0x5263ce;})});}_0x459e85=_['merge']({},_0x459e85,_0x3dd355['options']);return _0x389ab9[_0xe164('0x4e')](_0x459e85);}})[_0xe164('0x25')](function(_0x2f9134){if(_0x2f9134){_0x5a344d=_0x2f9134[_0xe164('0x35')];if(!_0x3dd355['query'][_0xe164('0x36')]('nolimit')){_0x459e85['limit']=qs[_0xe164('0x1e')](_0x3dd355[_0xe164('0x2e')]['limit']);_0x459e85['offset']=qs[_0xe164('0x1d')](_0x3dd355['query'][_0xe164('0x1d')]);}return _0x389ab9[_0xe164('0x4e')](_0x459e85);}})[_0xe164('0x25')](function(_0x594ea5){if(_0x594ea5){return _0x594ea5?{'count':_0x5a344d,'rows':_0x594ea5}:null;}})[_0xe164('0x25')](respondWithResult(_0x558810,null))['catch'](handleError(_0x558810,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index a9dcf4d..af80319 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 _0xab37=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration','int_freshsales_configurations'];(function(_0x503306,_0x356f2f){var _0x44a99d=function(_0x1a6ec4){while(--_0x1a6ec4){_0x503306['push'](_0x503306['shift']());}};_0x44a99d(++_0x356f2f);}(_0xab37,0xc3));var _0x7ab3=function(_0x59ab1,_0x580f37){_0x59ab1=_0x59ab1-0x0;var _0x3e55d4=_0xab37[_0x59ab1];return _0x3e55d4;};'use strict';var _=require(_0x7ab3('0x0'));var util=require(_0x7ab3('0x1'));var logger=require(_0x7ab3('0x2'))(_0x7ab3('0x3'));var moment=require(_0x7ab3('0x4'));var BPromise=require(_0x7ab3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ab3('0x6'));var rimraf=require(_0x7ab3('0x7'));var config=require(_0x7ab3('0x8'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x7ab3('0x9')]=function(_0x56f21f,_0x15852e){return _0x56f21f[_0x7ab3('0xa')](_0x7ab3('0xb'),attributes,{'tableName':_0x7ab3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x944b=['moment','bluebird','request-promise','path','rimraf','define','util','../../config/logger','api'];(function(_0x2facc8,_0x28502c){var _0x582bfd=function(_0x179e4f){while(--_0x179e4f){_0x2facc8['push'](_0x2facc8['shift']());}};_0x582bfd(++_0x28502c);}(_0x944b,0x1e3));var _0xb944=function(_0x98f660,_0x4ac2b4){_0x98f660=_0x98f660-0x0;var _0x4e5825=_0x944b[_0x98f660];return _0x4e5825;};'use strict';var _=require('lodash');var util=require(_0xb944('0x0'));var logger=require(_0xb944('0x1'))(_0xb944('0x2'));var moment=require(_0xb944('0x3'));var BPromise=require(_0xb944('0x4'));var rp=require(_0xb944('0x5'));var fs=require('fs');var path=require(_0xb944('0x6'));var rimraf=require(_0xb944('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesConfiguration.attributes');module['exports']=function(_0x549811,_0x2e9f08){return _0x549811[_0xb944('0x8')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 4f7f079..356a73a 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 _0xacea=['message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xacea,0x1bb));var _0xaace=function(_0x5173ea,_0x4a70a4){_0x5173ea=_0x5173ea-0x0;var _0x368e5a=_0xacea[_0x5173ea];return _0x368e5a;};'use strict';var _=require(_0xaace('0x0'));var util=require(_0xaace('0x1'));var moment=require(_0xaace('0x2'));var BPromise=require('bluebird');var rs=require(_0xaace('0x3'));var fs=require('fs');var Redis=require(_0xaace('0x4'));var db=require(_0xaace('0x5'))['db'];var utils=require(_0xaace('0x6'));var logger=require(_0xaace('0x7'))(_0xaace('0x8'));var config=require(_0xaace('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3fb538,_0x1cba94,_0x4477cc){return new BPromise(function(_0x6df1b5,_0x4f8f8e){return client[_0xaace('0xa')](_0x3fb538,_0x4477cc)[_0xaace('0xb')](function(_0x4715c4){logger['info'](_0xaace('0xc'),_0x1cba94,_0xaace('0xd'));logger[_0xaace('0xe')](_0xaace('0xf'),_0x1cba94,'request\x20sent',JSON[_0xaace('0x10')](_0x4715c4));if(_0x4715c4['error']){if(_0x4715c4[_0xaace('0x11')][_0xaace('0x12')]===0x1f4){logger[_0xaace('0x11')](_0xaace('0xc'),_0x1cba94,_0x4715c4[_0xaace('0x11')][_0xaace('0x13')]);return _0x4f8f8e(_0x4715c4[_0xaace('0x11')][_0xaace('0x13')]);}logger[_0xaace('0x11')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x1cba94,_0x4715c4['error'][_0xaace('0x13')]);return _0x6df1b5(_0x4715c4[_0xaace('0x11')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x1cba94,_0xaace('0xd'));_0x6df1b5(_0x4715c4[_0xaace('0x14')][_0xaace('0x13')]);}})[_0xaace('0x15')](function(_0x57e031){logger[_0xaace('0x11')](_0xaace('0xc'),_0x1cba94,_0x57e031);_0x4f8f8e(_0x57e031);});});} \ No newline at end of file +var _0x9e95=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x205109,_0x1945c9){var _0x273e9f=function(_0x4dcda0){while(--_0x4dcda0){_0x205109['push'](_0x205109['shift']());}};_0x273e9f(++_0x1945c9);}(_0x9e95,0x118));var _0x59e9=function(_0x23f265,_0x5d6971){_0x23f265=_0x23f265-0x0;var _0x29cdbf=_0x9e95[_0x23f265];return _0x29cdbf;};'use strict';var _=require(_0x59e9('0x0'));var util=require(_0x59e9('0x1'));var moment=require(_0x59e9('0x2'));var BPromise=require(_0x59e9('0x3'));var rs=require(_0x59e9('0x4'));var fs=require('fs');var Redis=require(_0x59e9('0x5'));var db=require(_0x59e9('0x6'))['db'];var utils=require(_0x59e9('0x7'));var logger=require(_0x59e9('0x8'))(_0x59e9('0x9'));var config=require(_0x59e9('0xa'));var jayson=require(_0x59e9('0xb'));var client=jayson[_0x59e9('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45d3b5,_0x602dbb,_0x3a2ade){return new BPromise(function(_0x1a22f7,_0x23cb57){return client[_0x59e9('0xd')](_0x45d3b5,_0x3a2ade)[_0x59e9('0xe')](function(_0x21e053){logger[_0x59e9('0xf')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x602dbb,_0x59e9('0x10'));logger[_0x59e9('0x11')](_0x59e9('0x12'),_0x602dbb,_0x59e9('0x10'),JSON[_0x59e9('0x13')](_0x21e053));if(_0x21e053[_0x59e9('0x14')]){if(_0x21e053[_0x59e9('0x14')][_0x59e9('0x15')]===0x1f4){logger[_0x59e9('0x14')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x602dbb,_0x21e053[_0x59e9('0x14')]['message']);return _0x23cb57(_0x21e053[_0x59e9('0x14')]['message']);}logger['error'](_0x59e9('0x16'),_0x602dbb,_0x21e053[_0x59e9('0x14')]['message']);return _0x1a22f7(_0x21e053[_0x59e9('0x14')][_0x59e9('0x17')]);}else{logger[_0x59e9('0xf')](_0x59e9('0x16'),_0x602dbb,_0x59e9('0x10'));_0x1a22f7(_0x21e053[_0x59e9('0x18')][_0x59e9('0x17')]);}})[_0x59e9('0x19')](function(_0x2a7afa){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x602dbb,_0x2a7afa);_0x23cb57(_0x2a7afa);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index e2624d6..d53eac8 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 _0x257e=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','post','create','put','delete','destroy','exports','util','path','express','fs-extra'];(function(_0x23e55e,_0xa39a13){var _0x1e5d66=function(_0x18605b){while(--_0x18605b){_0x23e55e['push'](_0x23e55e['shift']());}};_0x1e5d66(++_0xa39a13);}(_0x257e,0x1dc));var _0xe257=function(_0x115621,_0x341cde){_0x115621=_0x115621-0x0;var _0x5ef5ce=_0x257e[_0x115621];return _0x5ef5ce;};'use strict';var multer=require('multer');var util=require(_0xe257('0x0'));var path=require(_0xe257('0x1'));var timeout=require('connect-timeout');var express=require(_0xe257('0x2'));var router=express['Router']();var fs_extra=require(_0xe257('0x3'));var auth=require(_0xe257('0x4'));var interaction=require(_0xe257('0x5'));var config=require(_0xe257('0x6'));var controller=require('./intFreshsalesField.controller');router[_0xe257('0x7')]('/',auth[_0xe257('0x8')](),controller['index']);router[_0xe257('0x7')](_0xe257('0x9'),auth[_0xe257('0x8')](),controller['show']);router[_0xe257('0xa')]('/',auth[_0xe257('0x8')](),controller[_0xe257('0xb')]);router[_0xe257('0xc')](_0xe257('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xe257('0xd')](_0xe257('0x9'),auth['isAuthenticated'](),controller[_0xe257('0xe')]);module[_0xe257('0xf')]=router; \ No newline at end of file +var _0xa900=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show'];(function(_0x5e9ae7,_0x219221){var _0x2f8969=function(_0x45751a){while(--_0x45751a){_0x5e9ae7['push'](_0x5e9ae7['shift']());}};_0x2f8969(++_0x219221);}(_0xa900,0x101));var _0x0a90=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0xa900[_0x5b64a1];return _0x4b6f55;};'use strict';var multer=require(_0x0a90('0x0'));var util=require(_0x0a90('0x1'));var path=require(_0x0a90('0x2'));var timeout=require(_0x0a90('0x3'));var express=require(_0x0a90('0x4'));var router=express[_0x0a90('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0a90('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a90('0x7'));router[_0x0a90('0x8')]('/',auth[_0x0a90('0x9')](),controller[_0x0a90('0xa')]);router['get'](_0x0a90('0xb'),auth[_0x0a90('0x9')](),controller[_0x0a90('0xc')]);router['post']('/',auth[_0x0a90('0x9')](),controller[_0x0a90('0xd')]);router[_0x0a90('0xe')]('/:id',auth[_0x0a90('0x9')](),controller['update']);router[_0x0a90('0xf')](_0x0a90('0xb'),auth['isAuthenticated'](),controller[_0x0a90('0x10')]);module[_0x0a90('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index a86a57c..092110b 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 _0xbeb4=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x303668,_0x1ee647){var _0x57cff1=function(_0x2866e7){while(--_0x2866e7){_0x303668['push'](_0x303668['shift']());}};_0x57cff1(++_0x1ee647);}(_0xbeb4,0x73));var _0x4beb=function(_0x3149c5,_0x3fc6c3){_0x3149c5=_0x3149c5-0x0;var _0x2d599c=_0xbeb4[_0x3149c5];return _0x2d599c;};'use strict';var Sequelize=require(_0x4beb('0x0'));module[_0x4beb('0x1')]={'type':{'type':Sequelize[_0x4beb('0x2')](_0x4beb('0x3'),_0x4beb('0x4'),_0x4beb('0x5'),_0x4beb('0x6'),_0x4beb('0x7')),'defaultValue':_0x4beb('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4beb('0x8')]},'keyType':{'type':Sequelize['ENUM'](_0x4beb('0x3'),_0x4beb('0x4'),_0x4beb('0x5'))},'keyContent':{'type':Sequelize[_0x4beb('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4beb('0x8')]},'customField':{'type':Sequelize[_0x4beb('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4beb('0x8')]}}; \ No newline at end of file +var _0xf263=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x372130,_0x53e6b4){var _0x5c4c47=function(_0x16239a){while(--_0x16239a){_0x372130['push'](_0x372130['shift']());}};_0x5c4c47(++_0x53e6b4);}(_0xf263,0x1f3));var _0x3f26=function(_0x333fed,_0x3d2122){_0x333fed=_0x333fed-0x0;var _0x12cac2=_0xf263[_0x333fed];return _0x12cac2;};'use strict';var Sequelize=require(_0x3f26('0x0'));module['exports']={'type':{'type':Sequelize[_0x3f26('0x1')](_0x3f26('0x2'),_0x3f26('0x3'),_0x3f26('0x4'),_0x3f26('0x5'),'picklist'),'defaultValue':_0x3f26('0x2')},'content':{'type':Sequelize[_0x3f26('0x6')]},'key':{'type':Sequelize[_0x3f26('0x6')]},'keyType':{'type':Sequelize[_0x3f26('0x1')](_0x3f26('0x2'),_0x3f26('0x3'),_0x3f26('0x4'))},'keyContent':{'type':Sequelize[_0x3f26('0x6')]},'idField':{'type':Sequelize[_0x3f26('0x6')]},'nameField':{'type':Sequelize[_0x3f26('0x6')]},'customField':{'type':Sequelize[_0x3f26('0x7')],'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 ebbb0d5..a53d5df 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 _0x1dba=['offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','includeAll','rows','catch','params','include','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x480690,_0x33d209){var _0x75a054=function(_0x37fb5b){while(--_0x37fb5b){_0x480690['push'](_0x480690['shift']());}};_0x75a054(++_0x33d209);}(_0x1dba,0xbe));var _0xa1db=function(_0x284cc4,_0x1e1c2d){_0x284cc4=_0x284cc4-0x0;var _0x1fe42d=_0x1dba[_0x284cc4];return _0x1fe42d;};'use strict';var emlformat=require(_0xa1db('0x0'));var rimraf=require(_0xa1db('0x1'));var zipdir=require(_0xa1db('0x2'));var jsonpatch=require(_0xa1db('0x3'));var rp=require(_0xa1db('0x4'));var moment=require(_0xa1db('0x5'));var BPromise=require(_0xa1db('0x6'));var Mustache=require(_0xa1db('0x7'));var util=require(_0xa1db('0x8'));var path=require(_0xa1db('0x9'));var sox=require(_0xa1db('0xa'));var csv=require('to-csv');var ejs=require(_0xa1db('0xb'));var fs=require('fs');var fs_extra=require(_0xa1db('0xc'));var _=require('lodash');var squel=require(_0xa1db('0xd'));var crypto=require('crypto');var jsforce=require(_0xa1db('0xe'));var deskjs=require(_0xa1db('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa1db('0x10'));var Redis=require(_0xa1db('0x11'));var authService=require(_0xa1db('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xa1db('0x13'));var hardwareService=require(_0xa1db('0x14'));var logger=require(_0xa1db('0x15'))('api');var utils=require(_0xa1db('0x16'));var config=require(_0xa1db('0x17'));var licenseUtil=require(_0xa1db('0x18'));var db=require(_0xa1db('0x19'))['db'];function respondWithStatusCode(_0xb67656,_0x3dfe2d){_0x3dfe2d=_0x3dfe2d||0xcc;return function(_0x7924){if(_0x7924){return _0xb67656[_0xa1db('0x1a')](_0x3dfe2d);}return _0xb67656[_0xa1db('0x1b')](_0x3dfe2d)[_0xa1db('0x1c')]();};}function respondWithResult(_0x480d72,_0x43d5a9){_0x43d5a9=_0x43d5a9||0xc8;return function(_0x59de90){if(_0x59de90){return _0x480d72['status'](_0x43d5a9)['json'](_0x59de90);}};}function respondWithFilteredResult(_0x66c1f8,_0x231d54){return function(_0x1326e9){if(_0x1326e9){var _0x552e09=typeof _0x231d54[_0xa1db('0x1d')]===_0xa1db('0x1e')&&typeof _0x231d54['limit']===_0xa1db('0x1e');var _0x6340af=_0x1326e9[_0xa1db('0x1f')];var _0x4262d1=_0x552e09?0x0:_0x231d54[_0xa1db('0x1d')];var _0x3d6edf=_0x552e09?_0x1326e9[_0xa1db('0x1f')]:_0x231d54[_0xa1db('0x1d')]+_0x231d54[_0xa1db('0x20')];var _0xefafba;if(_0x3d6edf>=_0x6340af){_0x3d6edf=_0x6340af;_0xefafba=0xc8;}else{_0xefafba=0xce;}_0x66c1f8['status'](_0xefafba);return _0x66c1f8[_0xa1db('0x21')](_0xa1db('0x22'),_0x4262d1+'-'+_0x3d6edf+'/'+_0x6340af)[_0xa1db('0x23')](_0x1326e9);}return null;};}function patchUpdates(_0x122dfd){return function(_0x2e467e){try{jsonpatch[_0xa1db('0x24')](_0x2e467e,_0x122dfd,!![]);}catch(_0x1dab40){return BPromise[_0xa1db('0x25')](_0x1dab40);}return _0x2e467e[_0xa1db('0x26')]();};}function saveUpdates(_0xbdfb9f,_0x5ad969){return function(_0x3a815f){if(_0x3a815f){return _0x3a815f['update'](_0xbdfb9f)[_0xa1db('0x27')](function(_0x2532e3){return _0x2532e3;});}return null;};}function removeEntity(_0x1a0e78,_0x42831d){return function(_0x2a8ede){if(_0x2a8ede){return _0x2a8ede[_0xa1db('0x28')]()[_0xa1db('0x27')](function(){_0x1a0e78[_0xa1db('0x1b')](0xcc)[_0xa1db('0x1c')]();});}};}function handleEntityNotFound(_0x2c574,_0xcda38){return function(_0x1cc1bc){if(!_0x1cc1bc){_0x2c574[_0xa1db('0x1a')](0x194);}return _0x1cc1bc;};}function handleError(_0x1ea058,_0x287133){_0x287133=_0x287133||0x1f4;return function(_0x50a3fe){logger['error'](_0x50a3fe['stack']);if(_0x50a3fe['name']){delete _0x50a3fe[_0xa1db('0x29')];}_0x1ea058[_0xa1db('0x1b')](_0x287133)[_0xa1db('0x2a')](_0x50a3fe);};}exports[_0xa1db('0x2b')]=function(_0x2d91b7,_0x52f550){var _0x4dbb20={},_0x29970a={},_0x2943a9={'count':0x0,'rows':[]};var _0x46075b=_[_0xa1db('0x2c')](db[_0xa1db('0x2d')][_0xa1db('0x2e')],function(_0x19de78){return{'name':_0x19de78[_0xa1db('0x2f')],'type':_0x19de78[_0xa1db('0x30')]['key']};});_0x29970a['model']=_['map'](_0x46075b,_0xa1db('0x29'));_0x29970a[_0xa1db('0x31')]=_[_0xa1db('0x32')](_0x2d91b7[_0xa1db('0x31')]);_0x29970a[_0xa1db('0x33')]=_[_0xa1db('0x34')](_0x29970a[_0xa1db('0x35')],_0x29970a[_0xa1db('0x31')]);_0x4dbb20[_0xa1db('0x36')]=_['intersection'](_0x29970a[_0xa1db('0x35')],qs['fields'](_0x2d91b7[_0xa1db('0x31')][_0xa1db('0x37')]));_0x4dbb20[_0xa1db('0x36')]=_0x4dbb20[_0xa1db('0x36')][_0xa1db('0x38')]?_0x4dbb20[_0xa1db('0x36')]:_0x29970a[_0xa1db('0x35')];if(!_0x2d91b7['query']['hasOwnProperty'](_0xa1db('0x39'))){_0x4dbb20[_0xa1db('0x20')]=qs['limit'](_0x2d91b7[_0xa1db('0x31')][_0xa1db('0x20')]);_0x4dbb20['offset']=qs[_0xa1db('0x1d')](_0x2d91b7[_0xa1db('0x31')][_0xa1db('0x1d')]);}_0x4dbb20[_0xa1db('0x3a')]=qs['sort'](_0x2d91b7[_0xa1db('0x31')][_0xa1db('0x3b')]);_0x4dbb20['where']=qs[_0xa1db('0x33')](_[_0xa1db('0x3c')](_0x2d91b7['query'],_0x29970a[_0xa1db('0x33')]),_0x46075b);if(_0x2d91b7['query'][_0xa1db('0x3d')]){_0x4dbb20[_0xa1db('0x3e')]=_[_0xa1db('0x3f')](_0x4dbb20[_0xa1db('0x3e')],{'$or':_[_0xa1db('0x2c')](_0x46075b,function(_0x2c73be){if(_0x2c73be[_0xa1db('0x30')]!=='VIRTUAL'){var _0x38d6cd={};_0x38d6cd[_0x2c73be[_0xa1db('0x29')]]={'$like':'%'+_0x2d91b7[_0xa1db('0x31')][_0xa1db('0x3d')]+'%'};return _0x38d6cd;}})});}_0x4dbb20=_[_0xa1db('0x3f')]({},_0x4dbb20,_0x2d91b7['options']);var _0x1dbd89={'where':_0x4dbb20[_0xa1db('0x3e')]};return db['FreshsalesField']['count'](_0x1dbd89)[_0xa1db('0x27')](function(_0x3a618e){_0x2943a9[_0xa1db('0x1f')]=_0x3a618e;if(_0x2d91b7['query'][_0xa1db('0x40')]){_0x4dbb20['include']=[{'all':!![]}];}return db['FreshsalesField']['findAll'](_0x4dbb20);})[_0xa1db('0x27')](function(_0x4933c0){_0x2943a9[_0xa1db('0x41')]=_0x4933c0;return _0x2943a9;})[_0xa1db('0x27')](respondWithFilteredResult(_0x52f550,_0x4dbb20))[_0xa1db('0x42')](handleError(_0x52f550,null));};exports['show']=function(_0x54f173,_0x5a343b){var _0x53c7ad={'raw':!![],'where':{'id':_0x54f173[_0xa1db('0x43')]['id']}},_0x24903b={};_0x24903b[_0xa1db('0x35')]=_[_0xa1db('0x32')](db[_0xa1db('0x2d')][_0xa1db('0x2e')]);_0x24903b['query']=_[_0xa1db('0x32')](_0x54f173[_0xa1db('0x31')]);_0x24903b[_0xa1db('0x33')]=_[_0xa1db('0x34')](_0x24903b[_0xa1db('0x35')],_0x24903b[_0xa1db('0x31')]);_0x53c7ad[_0xa1db('0x36')]=_[_0xa1db('0x34')](_0x24903b['model'],qs[_0xa1db('0x37')](_0x54f173[_0xa1db('0x31')][_0xa1db('0x37')]));_0x53c7ad[_0xa1db('0x36')]=_0x53c7ad['attributes']['length']?_0x53c7ad[_0xa1db('0x36')]:_0x24903b[_0xa1db('0x35')];if(_0x54f173[_0xa1db('0x31')][_0xa1db('0x40')]){_0x53c7ad[_0xa1db('0x44')]=[{'all':!![]}];}_0x53c7ad=_[_0xa1db('0x3f')]({},_0x53c7ad,_0x54f173[_0xa1db('0x45')]);return db[_0xa1db('0x2d')][_0xa1db('0x46')](_0x53c7ad)['then'](handleEntityNotFound(_0x5a343b,null))[_0xa1db('0x27')](respondWithResult(_0x5a343b,null))[_0xa1db('0x42')](handleError(_0x5a343b,null));};exports['create']=function(_0x164aba,_0x516be1){return db[_0xa1db('0x2d')][_0xa1db('0x47')](_0x164aba[_0xa1db('0x48')],{})[_0xa1db('0x27')](respondWithResult(_0x516be1,0xc9))[_0xa1db('0x42')](handleError(_0x516be1,null));};exports['update']=function(_0x29f32a,_0x153206){if(_0x29f32a[_0xa1db('0x48')]['id']){delete _0x29f32a['body']['id'];}return db[_0xa1db('0x2d')]['find']({'where':{'id':_0x29f32a['params']['id']}})[_0xa1db('0x27')](handleEntityNotFound(_0x153206,null))[_0xa1db('0x27')](saveUpdates(_0x29f32a[_0xa1db('0x48')],null))[_0xa1db('0x27')](respondWithResult(_0x153206,null))[_0xa1db('0x42')](handleError(_0x153206,null));};exports[_0xa1db('0x28')]=function(_0x51c4ce,_0x500b67){return db[_0xa1db('0x2d')][_0xa1db('0x46')]({'where':{'id':_0x51c4ce[_0xa1db('0x43')]['id']}})[_0xa1db('0x27')](handleEntityNotFound(_0x500b67,null))[_0xa1db('0x27')](removeEntity(_0x500b67,null))['catch'](handleError(_0x500b67,null));}; \ No newline at end of file +var _0xea11=['papaparse','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','end','stack','name','send','index','map','FreshsalesField','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','catch','create','body','update','find','destroy','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','crypto','to-csv','querystring'];(function(_0x248085,_0x21e571){var _0x3d14a0=function(_0xde1c2f){while(--_0xde1c2f){_0x248085['push'](_0x248085['shift']());}};_0x3d14a0(++_0x21e571);}(_0xea11,0x7f));var _0x1ea1=function(_0xac3f8e,_0x43eef0){_0xac3f8e=_0xac3f8e-0x0;var _0x3902a3=_0xea11[_0xac3f8e];return _0x3902a3;};'use strict';var emlformat=require(_0x1ea1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ea1('0x1'));var jsonpatch=require(_0x1ea1('0x2'));var rp=require('request-promise');var moment=require(_0x1ea1('0x3'));var BPromise=require(_0x1ea1('0x4'));var Mustache=require(_0x1ea1('0x5'));var util=require(_0x1ea1('0x6'));var path=require(_0x1ea1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1ea1('0x8'));var fs=require('fs');var fs_extra=require(_0x1ea1('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1ea1('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1ea1('0xb'));var querystring=require(_0x1ea1('0xc'));var Papa=require(_0x1ea1('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1ea1('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1ea1('0xf'));var utils=require('../../config/utils');var config=require(_0x1ea1('0x10'));var licenseUtil=require(_0x1ea1('0x11'));var db=require(_0x1ea1('0x12'))['db'];function respondWithStatusCode(_0x44695e,_0xe6da59){_0xe6da59=_0xe6da59||0xcc;return function(_0x4ffcff){if(_0x4ffcff){return _0x44695e[_0x1ea1('0x13')](_0xe6da59);}return _0x44695e[_0x1ea1('0x14')](_0xe6da59)['end']();};}function respondWithResult(_0x3e69a9,_0x3c3ff0){_0x3c3ff0=_0x3c3ff0||0xc8;return function(_0x2afc4e){if(_0x2afc4e){return _0x3e69a9[_0x1ea1('0x14')](_0x3c3ff0)[_0x1ea1('0x15')](_0x2afc4e);}};}function respondWithFilteredResult(_0x35b44c,_0x2fc851){return function(_0xab73ae){if(_0xab73ae){var _0x2e6b42=typeof _0x2fc851['offset']==='undefined'&&typeof _0x2fc851[_0x1ea1('0x16')]===_0x1ea1('0x17');var _0x39ee7b=_0xab73ae[_0x1ea1('0x18')];var _0x478bc0=_0x2e6b42?0x0:_0x2fc851[_0x1ea1('0x19')];var _0x292f0a=_0x2e6b42?_0xab73ae[_0x1ea1('0x18')]:_0x2fc851['offset']+_0x2fc851[_0x1ea1('0x16')];var _0x2594b0;if(_0x292f0a>=_0x39ee7b){_0x292f0a=_0x39ee7b;_0x2594b0=0xc8;}else{_0x2594b0=0xce;}_0x35b44c[_0x1ea1('0x14')](_0x2594b0);return _0x35b44c[_0x1ea1('0x1a')](_0x1ea1('0x1b'),_0x478bc0+'-'+_0x292f0a+'/'+_0x39ee7b)[_0x1ea1('0x15')](_0xab73ae);}return null;};}function patchUpdates(_0x582abe){return function(_0x3c115c){try{jsonpatch[_0x1ea1('0x1c')](_0x3c115c,_0x582abe,!![]);}catch(_0x53ee51){return BPromise[_0x1ea1('0x1d')](_0x53ee51);}return _0x3c115c[_0x1ea1('0x1e')]();};}function saveUpdates(_0x1c8589,_0x207ada){return function(_0x42355a){if(_0x42355a){return _0x42355a['update'](_0x1c8589)[_0x1ea1('0x1f')](function(_0x107ff1){return _0x107ff1;});}return null;};}function removeEntity(_0x11f4ee,_0x28c896){return function(_0x2d2cd9){if(_0x2d2cd9){return _0x2d2cd9['destroy']()[_0x1ea1('0x1f')](function(){_0x11f4ee[_0x1ea1('0x14')](0xcc)[_0x1ea1('0x20')]();});}};}function handleEntityNotFound(_0x2fb872,_0x5384eb){return function(_0x2fb6a3){if(!_0x2fb6a3){_0x2fb872[_0x1ea1('0x13')](0x194);}return _0x2fb6a3;};}function handleError(_0x157b55,_0x1ea1bb){_0x1ea1bb=_0x1ea1bb||0x1f4;return function(_0x142e02){logger['error'](_0x142e02[_0x1ea1('0x21')]);if(_0x142e02[_0x1ea1('0x22')]){delete _0x142e02[_0x1ea1('0x22')];}_0x157b55[_0x1ea1('0x14')](_0x1ea1bb)[_0x1ea1('0x23')](_0x142e02);};}exports[_0x1ea1('0x24')]=function(_0x25e2b5,_0x1f8919){var _0x300041={},_0x586ba9={},_0x2d9ba1={'count':0x0,'rows':[]};var _0x506ba5=_[_0x1ea1('0x25')](db[_0x1ea1('0x26')][_0x1ea1('0x27')],function(_0x34a120){return{'name':_0x34a120[_0x1ea1('0x28')],'type':_0x34a120[_0x1ea1('0x29')]['key']};});_0x586ba9['model']=_[_0x1ea1('0x25')](_0x506ba5,_0x1ea1('0x22'));_0x586ba9[_0x1ea1('0x2a')]=_['keys'](_0x25e2b5[_0x1ea1('0x2a')]);_0x586ba9[_0x1ea1('0x2b')]=_[_0x1ea1('0x2c')](_0x586ba9[_0x1ea1('0x2d')],_0x586ba9[_0x1ea1('0x2a')]);_0x300041[_0x1ea1('0x2e')]=_[_0x1ea1('0x2c')](_0x586ba9[_0x1ea1('0x2d')],qs[_0x1ea1('0x2f')](_0x25e2b5['query'][_0x1ea1('0x2f')]));_0x300041[_0x1ea1('0x2e')]=_0x300041[_0x1ea1('0x2e')][_0x1ea1('0x30')]?_0x300041[_0x1ea1('0x2e')]:_0x586ba9[_0x1ea1('0x2d')];if(!_0x25e2b5[_0x1ea1('0x2a')]['hasOwnProperty']('nolimit')){_0x300041[_0x1ea1('0x16')]=qs['limit'](_0x25e2b5[_0x1ea1('0x2a')][_0x1ea1('0x16')]);_0x300041[_0x1ea1('0x19')]=qs[_0x1ea1('0x19')](_0x25e2b5[_0x1ea1('0x2a')][_0x1ea1('0x19')]);}_0x300041[_0x1ea1('0x31')]=qs[_0x1ea1('0x32')](_0x25e2b5[_0x1ea1('0x2a')][_0x1ea1('0x32')]);_0x300041['where']=qs[_0x1ea1('0x2b')](_[_0x1ea1('0x33')](_0x25e2b5[_0x1ea1('0x2a')],_0x586ba9[_0x1ea1('0x2b')]),_0x506ba5);if(_0x25e2b5[_0x1ea1('0x2a')][_0x1ea1('0x34')]){_0x300041['where']=_[_0x1ea1('0x35')](_0x300041[_0x1ea1('0x36')],{'$or':_[_0x1ea1('0x25')](_0x506ba5,function(_0x33ac7d){if(_0x33ac7d[_0x1ea1('0x29')]!==_0x1ea1('0x37')){var _0x124170={};_0x124170[_0x33ac7d[_0x1ea1('0x22')]]={'$like':'%'+_0x25e2b5[_0x1ea1('0x2a')]['filter']+'%'};return _0x124170;}})});}_0x300041=_[_0x1ea1('0x35')]({},_0x300041,_0x25e2b5[_0x1ea1('0x38')]);var _0x374512={'where':_0x300041[_0x1ea1('0x36')]};return db[_0x1ea1('0x26')][_0x1ea1('0x18')](_0x374512)[_0x1ea1('0x1f')](function(_0x370171){_0x2d9ba1[_0x1ea1('0x18')]=_0x370171;if(_0x25e2b5['query'][_0x1ea1('0x39')]){_0x300041['include']=[{'all':!![]}];}return db['FreshsalesField'][_0x1ea1('0x3a')](_0x300041);})['then'](function(_0x135be2){_0x2d9ba1[_0x1ea1('0x3b')]=_0x135be2;return _0x2d9ba1;})[_0x1ea1('0x1f')](respondWithFilteredResult(_0x1f8919,_0x300041))['catch'](handleError(_0x1f8919,null));};exports[_0x1ea1('0x3c')]=function(_0x1c7ba1,_0x4ad187){var _0x3123ff={'raw':!![],'where':{'id':_0x1c7ba1[_0x1ea1('0x3d')]['id']}},_0xbc30a3={};_0xbc30a3['model']=_[_0x1ea1('0x3e')](db[_0x1ea1('0x26')][_0x1ea1('0x27')]);_0xbc30a3[_0x1ea1('0x2a')]=_[_0x1ea1('0x3e')](_0x1c7ba1['query']);_0xbc30a3[_0x1ea1('0x2b')]=_[_0x1ea1('0x2c')](_0xbc30a3['model'],_0xbc30a3['query']);_0x3123ff[_0x1ea1('0x2e')]=_[_0x1ea1('0x2c')](_0xbc30a3[_0x1ea1('0x2d')],qs[_0x1ea1('0x2f')](_0x1c7ba1['query']['fields']));_0x3123ff[_0x1ea1('0x2e')]=_0x3123ff[_0x1ea1('0x2e')]['length']?_0x3123ff[_0x1ea1('0x2e')]:_0xbc30a3[_0x1ea1('0x2d')];if(_0x1c7ba1[_0x1ea1('0x2a')]['includeAll']){_0x3123ff[_0x1ea1('0x3f')]=[{'all':!![]}];}_0x3123ff=_['merge']({},_0x3123ff,_0x1c7ba1[_0x1ea1('0x38')]);return db['FreshsalesField']['find'](_0x3123ff)[_0x1ea1('0x1f')](handleEntityNotFound(_0x4ad187,null))[_0x1ea1('0x1f')](respondWithResult(_0x4ad187,null))[_0x1ea1('0x40')](handleError(_0x4ad187,null));};exports[_0x1ea1('0x41')]=function(_0x55523c,_0x3c27f0){return db[_0x1ea1('0x26')][_0x1ea1('0x41')](_0x55523c[_0x1ea1('0x42')],{})[_0x1ea1('0x1f')](respondWithResult(_0x3c27f0,0xc9))[_0x1ea1('0x40')](handleError(_0x3c27f0,null));};exports[_0x1ea1('0x43')]=function(_0x5bb147,_0x2b4b59){if(_0x5bb147[_0x1ea1('0x42')]['id']){delete _0x5bb147['body']['id'];}return db[_0x1ea1('0x26')][_0x1ea1('0x44')]({'where':{'id':_0x5bb147['params']['id']}})['then'](handleEntityNotFound(_0x2b4b59,null))['then'](saveUpdates(_0x5bb147['body'],null))['then'](respondWithResult(_0x2b4b59,null))[_0x1ea1('0x40')](handleError(_0x2b4b59,null));};exports[_0x1ea1('0x45')]=function(_0xb26ce2,_0x334395){return db['FreshsalesField'][_0x1ea1('0x44')]({'where':{'id':_0xb26ce2[_0x1ea1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x334395,null))['then'](removeEntity(_0x334395,null))['catch'](handleError(_0x334395,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index b2f1b90..84eaf4f 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 _0xa76e=['exports','FreshsalesField','int_freshsales_fields','FieldId','util','../../config/logger','bluebird','path','rimraf','../../config/environment'];(function(_0x58bd3e,_0x421432){var _0x2fc22d=function(_0x1d29a6){while(--_0x1d29a6){_0x58bd3e['push'](_0x58bd3e['shift']());}};_0x2fc22d(++_0x421432);}(_0xa76e,0xfe));var _0xea76=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xa76e[_0x1602ef];return _0x5870ee;};'use strict';var _=require('lodash');var util=require(_0xea76('0x0'));var logger=require(_0xea76('0x1'))('api');var moment=require('moment');var BPromise=require(_0xea76('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xea76('0x3'));var rimraf=require(_0xea76('0x4'));var config=require(_0xea76('0x5'));var attributes=require('./intFreshsalesField.attributes');module[_0xea76('0x6')]=function(_0x48ff4f,_0x337097){return _0x48ff4f['define'](_0xea76('0x7'),attributes,{'tableName':_0xea76('0x8'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':['idField',_0xea76('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf970=['rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5cc316,_0x36ae66){var _0x298441=function(_0x5d9e3e){while(--_0x5d9e3e){_0x5cc316['push'](_0x5cc316['shift']());}};_0x298441(++_0x36ae66);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0f97('0x0'));var util=require('util');var logger=require(_0x0f97('0x1'))(_0x0f97('0x2'));var moment=require(_0x0f97('0x3'));var BPromise=require(_0x0f97('0x4'));var rp=require(_0x0f97('0x5'));var fs=require('fs');var path=require(_0x0f97('0x6'));var rimraf=require(_0x0f97('0x7'));var config=require('../../config/environment');var attributes=require(_0x0f97('0x8'));module[_0x0f97('0x9')]=function(_0x290200,_0xac501){return _0x290200[_0x0f97('0xa')](_0x0f97('0xb'),attributes,{'tableName':_0x0f97('0xc'),'paranoid':![],'indexes':[{'name':_0x0f97('0xd'),'fields':[_0x0f97('0xe'),'FieldId'],'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 7b0fa18..a7745d4 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 _0x2bd8=['info','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x5a7658,_0x4ea113){var _0x2ca56c=function(_0x4af558){while(--_0x4af558){_0x5a7658['push'](_0x5a7658['shift']());}};_0x2ca56c(++_0x4ea113);}(_0x2bd8,0x130));var _0x82bd=function(_0x334d4d,_0x186b2e){_0x334d4d=_0x334d4d-0x0;var _0x43e889=_0x2bd8[_0x334d4d];return _0x43e889;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var moment=require(_0x82bd('0x1'));var BPromise=require(_0x82bd('0x2'));var rs=require(_0x82bd('0x3'));var fs=require('fs');var Redis=require(_0x82bd('0x4'));var db=require(_0x82bd('0x5'))['db'];var utils=require(_0x82bd('0x6'));var logger=require(_0x82bd('0x7'))('rpc');var config=require(_0x82bd('0x8'));var jayson=require(_0x82bd('0x9'));var client=jayson[_0x82bd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19dbb1,_0x77d7a9,_0x226f60){return new BPromise(function(_0x1f7463,_0x4dc3a6){return client[_0x82bd('0xb')](_0x19dbb1,_0x226f60)['then'](function(_0x4a9b2c){logger['info'](_0x82bd('0xc'),_0x77d7a9,'request\x20sent');logger['debug'](_0x82bd('0xd'),_0x77d7a9,'request\x20sent',JSON['stringify'](_0x4a9b2c));if(_0x4a9b2c[_0x82bd('0xe')]){if(_0x4a9b2c[_0x82bd('0xe')]['code']===0x1f4){logger[_0x82bd('0xe')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x4a9b2c[_0x82bd('0xe')]['message']);return _0x4dc3a6(_0x4a9b2c[_0x82bd('0xe')][_0x82bd('0xf')]);}logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x4a9b2c['error'][_0x82bd('0xf')]);return _0x1f7463(_0x4a9b2c[_0x82bd('0xe')]['message']);}else{logger[_0x82bd('0x10')]('FreshsalesField,\x20%s,\x20%s',_0x77d7a9,_0x82bd('0x11'));_0x1f7463(_0x4a9b2c[_0x82bd('0x12')][_0x82bd('0xf')]);}})[_0x82bd('0x13')](function(_0x209081){logger[_0x82bd('0xe')](_0x82bd('0xc'),_0x77d7a9,_0x209081);_0x4dc3a6(_0x209081);});});} \ No newline at end of file +var _0x1623=['../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x44a23f,_0x54e291){var _0x4599fc=function(_0x28b36d){while(--_0x28b36d){_0x44a23f['push'](_0x44a23f['shift']());}};_0x4599fc(++_0x54e291);}(_0x1623,0xab));var _0x3162=function(_0x5cab35,_0x534f74){_0x5cab35=_0x5cab35-0x0;var _0x97a2ff=_0x1623[_0x5cab35];return _0x97a2ff;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesField,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 81339c6..399bb98 100644 --- a/server/api/intSalesforceAccount/index.js +++ b/server/api/intSalesforceAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x50ff8f,_0x2b1cdd){var _0x2c979b=function(_0x4687c3){while(--_0x4687c3){_0x50ff8f['push'](_0x50ff8f['shift']());}};_0x2c979b(++_0x2b1cdd);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x401d97,_0x543e10){var _0x57e803=function(_0x1210c1){while(--_0x1210c1){_0x401d97['push'](_0x401d97['shift']());}};_0x57e803(++_0x543e10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index de3db9b..8cbd219 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 _0xb2af=['sequelize','exports','STRING','username','ENUM','integrationTab'];(function(_0x5620d0,_0x3fbcb9){var _0x573b9b=function(_0x1a25b5){while(--_0x1a25b5){_0x5620d0['push'](_0x5620d0['shift']());}};_0x573b9b(++_0x3fbcb9);}(_0xb2af,0xd2));var _0xfb2a=function(_0x2be89a,_0x3526b2){_0x2be89a=_0x2be89a-0x0;var _0x1ef434=_0xb2af[_0x2be89a];return _0x1ef434;};'use strict';var Sequelize=require(_0xfb2a('0x0'));module[_0xfb2a('0x1')]={'name':{'type':Sequelize[_0xfb2a('0x2')]},'description':{'type':Sequelize[_0xfb2a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xfb2a('0x3')},'remoteUri':{'type':Sequelize[_0xfb2a('0x2')]},'password':{'type':Sequelize[_0xfb2a('0x2')]},'clientId':{'type':Sequelize[_0xfb2a('0x2')]},'clientSecret':{'type':Sequelize[_0xfb2a('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xfb2a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfb2a('0x4')](_0xfb2a('0x5'),'newTab'),'defaultValue':_0xfb2a('0x5')}}; \ No newline at end of file +var _0x8fcd=['integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x23c549,_0x2e12c5){_0x23c549=_0x23c549-0x0;var _0x35e1b7=_0x8fcd[_0x23c549];return _0x35e1b7;};'use strict';var Sequelize=require(_0xd8fc('0x0'));module[_0xd8fc('0x1')]={'name':{'type':Sequelize[_0xd8fc('0x2')]},'description':{'type':Sequelize[_0xd8fc('0x2')]},'username':{'type':Sequelize[_0xd8fc('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd8fc('0x2')]},'clientId':{'type':Sequelize[_0xd8fc('0x2')]},'clientSecret':{'type':Sequelize[_0xd8fc('0x2')]},'securityToken':{'type':Sequelize[_0xd8fc('0x2')]},'serverUrl':{'type':Sequelize[_0xd8fc('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xd8fc('0x3')]('integrationTab','newTab'),'defaultValue':_0xd8fc('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 13ddb39..f8b645b 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 _0xe1e4=['custom','picklistValues','value','True','true','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','offset','undefined','limit','count','update','then','error','name','send','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','filters','create','body','find','params','destroy','findOne','SalesforceConfiguration','getConfigurations','AccountId','Subjects','channel','getDescriptions','SalesforceField','Descriptions','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','lastIndexOf','Connection','login','concat','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','string','int','picklist','boolean','email','remove','includes','label'];(function(_0x5daa94,_0x3b10a6){var _0xbe3862=function(_0x3b4548){while(--_0x3b4548){_0x5daa94['push'](_0x5daa94['shift']());}};_0xbe3862(++_0x3b10a6);}(_0xe1e4,0x1eb));var _0x4e1e=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xe1e4[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e1e('0x0'));var zipdir=require(_0x4e1e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4e1e('0x2'));var BPromise=require(_0x4e1e('0x3'));var Mustache=require(_0x4e1e('0x4'));var util=require('util');var path=require(_0x4e1e('0x5'));var sox=require('sox');var csv=require(_0x4e1e('0x6'));var ejs=require(_0x4e1e('0x7'));var fs=require('fs');var fs_extra=require(_0x4e1e('0x8'));var _=require(_0x4e1e('0x9'));var squel=require(_0x4e1e('0xa'));var crypto=require(_0x4e1e('0xb'));var jsforce=require(_0x4e1e('0xc'));var deskjs=require(_0x4e1e('0xd'));var toCsv=require(_0x4e1e('0x6'));var querystring=require(_0x4e1e('0xe'));var Papa=require(_0x4e1e('0xf'));var Redis=require('ioredis');var authService=require(_0x4e1e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x4e1e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e1e('0x12'))(_0x4e1e('0x13'));var utils=require(_0x4e1e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x4e1e('0x15'));var db=require(_0x4e1e('0x16'))['db'];var integrations=require(_0x4e1e('0x17'));function respondWithStatusCode(_0x671ac5,_0x2394be){_0x2394be=_0x2394be||0xcc;return function(_0x76570a){if(_0x76570a){return _0x671ac5[_0x4e1e('0x18')](_0x2394be);}return _0x671ac5['status'](_0x2394be)[_0x4e1e('0x19')]();};}function respondWithResult(_0x348b52,_0x2a51eb){_0x2a51eb=_0x2a51eb||0xc8;return function(_0x57d126){if(_0x57d126){return _0x348b52[_0x4e1e('0x1a')](_0x2a51eb)[_0x4e1e('0x1b')](_0x57d126);}};}function respondWithFilteredResult(_0x5afa01,_0x3572ed){return function(_0x55bbe4){if(_0x55bbe4){var _0xc4347=typeof _0x3572ed[_0x4e1e('0x1c')]===_0x4e1e('0x1d')&&typeof _0x3572ed[_0x4e1e('0x1e')]==='undefined';var _0x307493=_0x55bbe4[_0x4e1e('0x1f')];var _0x3af0a4=_0xc4347?0x0:_0x3572ed['offset'];var _0xa2c532=_0xc4347?_0x55bbe4['count']:_0x3572ed[_0x4e1e('0x1c')]+_0x3572ed[_0x4e1e('0x1e')];var _0x593ade;if(_0xa2c532>=_0x307493){_0xa2c532=_0x307493;_0x593ade=0xc8;}else{_0x593ade=0xce;}_0x5afa01[_0x4e1e('0x1a')](_0x593ade);return _0x5afa01['set']('Content-Range',_0x3af0a4+'-'+_0xa2c532+'/'+_0x307493)[_0x4e1e('0x1b')](_0x55bbe4);}return null;};}function patchUpdates(_0x2e83){return function(_0x3e2e13){try{jsonpatch['apply'](_0x3e2e13,_0x2e83,!![]);}catch(_0x14e801){return BPromise['reject'](_0x14e801);}return _0x3e2e13['save']();};}function saveUpdates(_0x31a8ce,_0x5e58b8){return function(_0x3b313b){if(_0x3b313b){return _0x3b313b[_0x4e1e('0x20')](_0x31a8ce)[_0x4e1e('0x21')](function(_0x4528cc){return _0x4528cc;});}return null;};}function removeEntity(_0x21553d,_0x1de122){return function(_0x14032b){if(_0x14032b){return _0x14032b['destroy']()[_0x4e1e('0x21')](function(){_0x21553d[_0x4e1e('0x1a')](0xcc)[_0x4e1e('0x19')]();});}};}function handleEntityNotFound(_0x2e4b41,_0x526057){return function(_0x482a1f){if(!_0x482a1f){_0x2e4b41[_0x4e1e('0x18')](0x194);}return _0x482a1f;};}function handleError(_0x5d3c69,_0x2ee630){_0x2ee630=_0x2ee630||0x1f4;return function(_0x1f227e){logger[_0x4e1e('0x22')](_0x1f227e['stack']);if(_0x1f227e[_0x4e1e('0x23')]){delete _0x1f227e[_0x4e1e('0x23')];}_0x5d3c69[_0x4e1e('0x1a')](_0x2ee630)[_0x4e1e('0x24')](_0x1f227e);};}exports[_0x4e1e('0x25')]=function(_0xee6fc0,_0x145f18){var _0x119240={},_0x2d9b9a={},_0x3fa04d={'count':0x0,'rows':[]};var _0x2a3551=_['map'](db[_0x4e1e('0x26')][_0x4e1e('0x27')],function(_0x581ff5){return{'name':_0x581ff5[_0x4e1e('0x28')],'type':_0x581ff5[_0x4e1e('0x29')][_0x4e1e('0x2a')]};});_0x2d9b9a[_0x4e1e('0x2b')]=_[_0x4e1e('0x2c')](_0x2a3551,'name');_0x2d9b9a['query']=_[_0x4e1e('0x2d')](_0xee6fc0[_0x4e1e('0x2e')]);_0x2d9b9a['filters']=_[_0x4e1e('0x2f')](_0x2d9b9a[_0x4e1e('0x2b')],_0x2d9b9a[_0x4e1e('0x2e')]);_0x119240[_0x4e1e('0x30')]=_['intersection'](_0x2d9b9a[_0x4e1e('0x2b')],qs[_0x4e1e('0x31')](_0xee6fc0[_0x4e1e('0x2e')][_0x4e1e('0x31')]));_0x119240['attributes']=_0x119240[_0x4e1e('0x30')][_0x4e1e('0x32')]?_0x119240['attributes']:_0x2d9b9a[_0x4e1e('0x2b')];if(!_0xee6fc0[_0x4e1e('0x2e')][_0x4e1e('0x33')](_0x4e1e('0x34'))){_0x119240[_0x4e1e('0x1e')]=qs[_0x4e1e('0x1e')](_0xee6fc0[_0x4e1e('0x2e')][_0x4e1e('0x1e')]);_0x119240['offset']=qs[_0x4e1e('0x1c')](_0xee6fc0[_0x4e1e('0x2e')]['offset']);}_0x119240[_0x4e1e('0x35')]=qs[_0x4e1e('0x36')](_0xee6fc0[_0x4e1e('0x2e')][_0x4e1e('0x36')]);_0x119240[_0x4e1e('0x37')]=qs['filters'](_[_0x4e1e('0x38')](_0xee6fc0['query'],_0x2d9b9a['filters']),_0x2a3551);if(_0xee6fc0[_0x4e1e('0x2e')][_0x4e1e('0x39')]){_0x119240[_0x4e1e('0x37')]=_[_0x4e1e('0x3a')](_0x119240['where'],{'$or':_['map'](_0x2a3551,function(_0xe1d26b){if(_0xe1d26b[_0x4e1e('0x29')]!==_0x4e1e('0x3b')){var _0x1d9cbd={};_0x1d9cbd[_0xe1d26b['name']]={'$like':'%'+_0xee6fc0[_0x4e1e('0x2e')][_0x4e1e('0x39')]+'%'};return _0x1d9cbd;}})});}_0x119240=_[_0x4e1e('0x3a')]({},_0x119240,_0xee6fc0[_0x4e1e('0x3c')]);var _0x28016e={'where':_0x119240[_0x4e1e('0x37')]};return db[_0x4e1e('0x26')][_0x4e1e('0x1f')](_0x28016e)[_0x4e1e('0x21')](function(_0x3d4fcd){_0x3fa04d[_0x4e1e('0x1f')]=_0x3d4fcd;if(_0xee6fc0['query'][_0x4e1e('0x3d')]){_0x119240[_0x4e1e('0x3e')]=[{'all':!![]}];}return db[_0x4e1e('0x26')][_0x4e1e('0x3f')](_0x119240);})[_0x4e1e('0x21')](function(_0x17fb6d){_0x3fa04d[_0x4e1e('0x40')]=_0x17fb6d;return _0x3fa04d;})['then'](respondWithFilteredResult(_0x145f18,_0x119240))[_0x4e1e('0x41')](handleError(_0x145f18,null));};exports[_0x4e1e('0x42')]=function(_0x117c7e,_0x4783ad){var _0x1d2335={'raw':![],'where':{'id':_0x117c7e['params']['id']}},_0x2591b0={};_0x2591b0[_0x4e1e('0x2b')]=_[_0x4e1e('0x2d')](db['SalesforceAccount'][_0x4e1e('0x27')]);_0x2591b0['query']=_[_0x4e1e('0x2d')](_0x117c7e[_0x4e1e('0x2e')]);_0x2591b0[_0x4e1e('0x43')]=_[_0x4e1e('0x2f')](_0x2591b0['model'],_0x2591b0[_0x4e1e('0x2e')]);_0x1d2335[_0x4e1e('0x30')]=_[_0x4e1e('0x2f')](_0x2591b0[_0x4e1e('0x2b')],qs[_0x4e1e('0x31')](_0x117c7e['query'][_0x4e1e('0x31')]));_0x1d2335[_0x4e1e('0x30')]=_0x1d2335['attributes']['length']?_0x1d2335[_0x4e1e('0x30')]:_0x2591b0['model'];if(_0x117c7e['query'][_0x4e1e('0x3d')]){_0x1d2335['include']=[{'all':!![]}];}_0x1d2335=_[_0x4e1e('0x3a')]({},_0x1d2335,_0x117c7e[_0x4e1e('0x3c')]);return db[_0x4e1e('0x26')]['find'](_0x1d2335)[_0x4e1e('0x21')](handleEntityNotFound(_0x4783ad,null))['then'](respondWithResult(_0x4783ad,null))['catch'](handleError(_0x4783ad,null));};exports[_0x4e1e('0x44')]=function(_0x310258,_0x426e98){return db['SalesforceAccount']['create'](_0x310258[_0x4e1e('0x45')],{})[_0x4e1e('0x21')](respondWithResult(_0x426e98,0xc9))[_0x4e1e('0x41')](handleError(_0x426e98,null));};exports[_0x4e1e('0x20')]=function(_0x1cd5ca,_0xae78e4){if(_0x1cd5ca[_0x4e1e('0x45')]['id']){delete _0x1cd5ca[_0x4e1e('0x45')]['id'];}return db['SalesforceAccount'][_0x4e1e('0x46')]({'where':{'id':_0x1cd5ca[_0x4e1e('0x47')]['id']}})[_0x4e1e('0x21')](handleEntityNotFound(_0xae78e4,null))[_0x4e1e('0x21')](saveUpdates(_0x1cd5ca[_0x4e1e('0x45')],null))[_0x4e1e('0x21')](respondWithResult(_0xae78e4,null))[_0x4e1e('0x41')](handleError(_0xae78e4,null));};exports[_0x4e1e('0x48')]=function(_0x1341b9,_0x2ce322){return db[_0x4e1e('0x26')][_0x4e1e('0x46')]({'where':{'id':_0x1341b9[_0x4e1e('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ce322,null))[_0x4e1e('0x21')](removeEntity(_0x2ce322,null))[_0x4e1e('0x41')](handleError(_0x2ce322,null));};exports['getConfigurations']=function(_0x36a2ce,_0x5e757d,_0x235474){var _0x43656e={};var _0x1deb26={};var _0x145b26;var _0x465523;return db[_0x4e1e('0x26')][_0x4e1e('0x49')]({'where':{'id':_0x36a2ce[_0x4e1e('0x47')]['id']}})[_0x4e1e('0x21')](handleEntityNotFound(_0x5e757d,null))[_0x4e1e('0x21')](function(_0x30a1b8){if(_0x30a1b8){_0x145b26=_0x30a1b8;_0x1deb26[_0x4e1e('0x2b')]=_[_0x4e1e('0x2d')](db[_0x4e1e('0x4a')]['rawAttributes']);_0x1deb26[_0x4e1e('0x2e')]=_[_0x4e1e('0x2d')](_0x36a2ce[_0x4e1e('0x2e')]);_0x1deb26[_0x4e1e('0x43')]=_[_0x4e1e('0x2f')](_0x1deb26[_0x4e1e('0x2b')],_0x1deb26[_0x4e1e('0x2e')]);_0x43656e[_0x4e1e('0x30')]=_[_0x4e1e('0x2f')](_0x1deb26[_0x4e1e('0x2b')],qs[_0x4e1e('0x31')](_0x36a2ce['query']['fields']));_0x43656e[_0x4e1e('0x30')]=_0x43656e[_0x4e1e('0x30')][_0x4e1e('0x32')]?_0x43656e['attributes']:_0x1deb26[_0x4e1e('0x2b')];_0x43656e['order']=qs[_0x4e1e('0x36')](_0x36a2ce[_0x4e1e('0x2e')][_0x4e1e('0x36')]);_0x43656e[_0x4e1e('0x37')]=qs[_0x4e1e('0x43')](_[_0x4e1e('0x38')](_0x36a2ce[_0x4e1e('0x2e')],_0x1deb26['filters']));if(_0x36a2ce[_0x4e1e('0x2e')][_0x4e1e('0x39')]){_0x43656e[_0x4e1e('0x37')]=_[_0x4e1e('0x3a')](_0x43656e[_0x4e1e('0x37')],{'$or':_[_0x4e1e('0x2c')](_0x43656e[_0x4e1e('0x30')],function(_0x547afa){var _0x572ba5={};_0x572ba5[_0x547afa]={'$like':'%'+_0x36a2ce[_0x4e1e('0x2e')]['filter']+'%'};return _0x572ba5;})});}_0x43656e=_['merge']({},_0x43656e,_0x36a2ce[_0x4e1e('0x3c')]);return _0x145b26[_0x4e1e('0x4b')](_0x43656e);}})[_0x4e1e('0x21')](function(_0x2f2a40){if(_0x2f2a40){_0x465523=_0x2f2a40[_0x4e1e('0x32')];if(!_0x36a2ce['query'][_0x4e1e('0x33')](_0x4e1e('0x34'))){_0x43656e[_0x4e1e('0x1e')]=qs[_0x4e1e('0x1e')](_0x36a2ce['query'][_0x4e1e('0x1e')]);_0x43656e['offset']=qs[_0x4e1e('0x1c')](_0x36a2ce['query']['offset']);}return _0x145b26[_0x4e1e('0x4b')](_0x43656e);}})[_0x4e1e('0x21')](function(_0x24e4b3){if(_0x24e4b3){return _0x24e4b3?{'count':_0x465523,'rows':_0x24e4b3}:null;}})[_0x4e1e('0x21')](respondWithResult(_0x5e757d,null))[_0x4e1e('0x41')](handleError(_0x5e757d,null));};exports['addConfiguration']=function(_0x245a0f,_0xcf1d6d,_0x4dd89e){if(_0x245a0f[_0x4e1e('0x45')]['id']){delete _0x245a0f[_0x4e1e('0x45')]['id'];}return db[_0x4e1e('0x26')][_0x4e1e('0x49')]({'where':{'id':_0x245a0f[_0x4e1e('0x47')]['id']}})['then'](handleEntityNotFound(_0xcf1d6d,null))[_0x4e1e('0x21')](function(_0x3f8499){if(_0x3f8499){_0x245a0f[_0x4e1e('0x45')][_0x4e1e('0x4c')]=_0x3f8499['id'];_0x245a0f['body'][_0x4e1e('0x4d')]=integrations['getSubjects'](_0x245a0f[_0x4e1e('0x45')][_0x4e1e('0x4e')],_0x245a0f[_0x4e1e('0x45')][_0x4e1e('0x29')]);_0x245a0f['body']['Descriptions']=integrations[_0x4e1e('0x4f')](_0x245a0f[_0x4e1e('0x45')][_0x4e1e('0x4e')],_0x245a0f[_0x4e1e('0x45')]['type']);return db['SalesforceConfiguration']['create'](_0x245a0f[_0x4e1e('0x45')],{'include':[{'model':db[_0x4e1e('0x50')],'as':_0x4e1e('0x4d')},{'model':db[_0x4e1e('0x50')],'as':_0x4e1e('0x51')}]});}return null;})['then'](respondWithResult(_0xcf1d6d,null))['catch'](handleError(_0xcf1d6d,null));};exports[_0x4e1e('0x52')]=function(_0x2a446a,_0x14fc71,_0x4e2f51){var _0x19a26c;var _0x40a142='';var _0x51183d=_0x4e1e('0x53');return db[_0x4e1e('0x26')][_0x4e1e('0x49')]({'where':{'id':_0x2a446a[_0x4e1e('0x47')]['id']},'attributes':['id',_0x4e1e('0x54'),_0x4e1e('0x55'),_0x4e1e('0x56'),_0x4e1e('0x57'),_0x4e1e('0x58'),_0x4e1e('0x59')]})[_0x4e1e('0x21')](handleEntityNotFound(_0x14fc71,null))[_0x4e1e('0x21')](function(_0x53c621){if(_0x53c621){_0x40a142=_0x53c621['remoteUri'];var _0x5900d0=_0x40a142['slice'](-0x1);if(_0x5900d0==='/'){_0x40a142=_0x40a142['substring'](0x0,_0x40a142[_0x4e1e('0x5a')](_0x5900d0));}_0x19a26c=new jsforce[(_0x4e1e('0x5b'))]({'oauth2':{'loginUrl':_0x40a142,'clientId':_0x53c621[_0x4e1e('0x55')],'clientSecret':_0x53c621[_0x4e1e('0x56')]}});return _0x19a26c[_0x4e1e('0x5c')](_0x53c621[_0x4e1e('0x57')],_0x53c621[_0x4e1e('0x58')][_0x4e1e('0x5d')](_0x53c621['securityToken']));}})[_0x4e1e('0x21')](function(_0x2f5e08){if(_0x2f5e08){if(!_['isNil'](_0x2a446a[_0x4e1e('0x2e')][_0x4e1e('0x5e')])){_0x51183d=_0x2a446a['query'][_0x4e1e('0x5e')];}return _0x19a26c[_0x4e1e('0x5f')](_0x51183d)[_0x4e1e('0x60')]();}})[_0x4e1e('0x21')](function(_0x5c55b3){var _0x4ab5a3=[_0x4e1e('0x61'),_0x4e1e('0x62'),_0x4e1e('0x63'),_0x4e1e('0x64'),'Subject','Description'];var _0xe5a83f=[_0x4e1e('0x65'),_0x4e1e('0x66'),_0x4e1e('0x67'),_0x4e1e('0x68'),_0x4e1e('0x69'),'textarea','phone'];if(_0x5c55b3){_[_0x4e1e('0x6a')](_0x5c55b3['fields'],function(_0x2c0ed9){return _0x4ab5a3[_0x4e1e('0x6b')](_0x2c0ed9[_0x4e1e('0x23')])||!_0xe5a83f['includes'](_0x2c0ed9['type']);});return{'count':_0x5c55b3[_0x4e1e('0x31')][_0x4e1e('0x32')],'rows':_[_0x4e1e('0x2c')](_0x5c55b3[_0x4e1e('0x31')],function(_0x1ac66a){return{'id':_0x1ac66a[_0x4e1e('0x23')],'name':_0x1ac66a[_0x4e1e('0x6c')],'custom':_0x1ac66a[_0x4e1e('0x6d')],'options':_0x1ac66a['picklistValues']['length']>0x0?_[_0x4e1e('0x2c')](_0x1ac66a[_0x4e1e('0x6e')],function(_0x300377){return{'name':_0x300377[_0x4e1e('0x6c')],'value':_0x300377[_0x4e1e('0x6f')]};}):_0x1ac66a[_0x4e1e('0x29')]==_0x4e1e('0x68')?[{'name':_0x4e1e('0x70'),'value':_0x4e1e('0x71')},{'name':'False','value':_0x4e1e('0x72')}]:[]};})};}})[_0x4e1e('0x21')](respondWithResult(_0x14fc71,null))['catch'](function(_0x148f01){var _0x792f53=_0x2a446a[_0x4e1e('0x2e')][_0x4e1e('0x73')]?0x1f4:_0x148f01[_0x4e1e('0x74')]||0x1f4;logger[_0x4e1e('0x22')](_0x4e1e('0x75'),_0x4e1e('0x52'),_0x792f53,JSON[_0x4e1e('0x76')](_0x148f01));delete _0x148f01[_0x4e1e('0x23')];if(_0x792f53===0x191){_0x792f53=0x190;}_0x14fc71['status'](_0x792f53)[_0x4e1e('0x24')](_0x2a446a[_0x4e1e('0x2e')]['test']?{'message':_0x4e1e('0x77'),'statusCode':_0x148f01['statusCode']}:_0x148f01);});}; \ No newline at end of file +var _0x3ca2=['offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','slice','substring','lastIndexOf','Connection','concat','isNil','ticketType','sobject','describe','OwnerId','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','phone','remove','includes','label','picklistValues','value','True','true','false','test','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','statusCode','rimraf','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end'];(function(_0x2e60be,_0x3f4e9c){var _0x52e6b5=function(_0x32a620){while(--_0x32a620){_0x2e60be['push'](_0x2e60be['shift']());}};_0x52e6b5(++_0x3f4e9c);}(_0x3ca2,0x152));var _0x23ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ca2[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x23ca('0x0'));var zipdir=require(_0x23ca('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x23ca('0x2'));var util=require(_0x23ca('0x3'));var path=require(_0x23ca('0x4'));var sox=require(_0x23ca('0x5'));var csv=require(_0x23ca('0x6'));var ejs=require(_0x23ca('0x7'));var fs=require('fs');var fs_extra=require(_0x23ca('0x8'));var _=require('lodash');var squel=require(_0x23ca('0x9'));var crypto=require(_0x23ca('0xa'));var jsforce=require(_0x23ca('0xb'));var deskjs=require(_0x23ca('0xc'));var toCsv=require(_0x23ca('0x6'));var querystring=require(_0x23ca('0xd'));var Papa=require(_0x23ca('0xe'));var Redis=require(_0x23ca('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x23ca('0x10'));var as=require(_0x23ca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x23ca('0x12'));var utils=require('../../config/utils');var config=require(_0x23ca('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x23ca('0x14'))['db'];var integrations=require(_0x23ca('0x15'));function respondWithStatusCode(_0xbf09d5,_0x33aa3b){_0x33aa3b=_0x33aa3b||0xcc;return function(_0x2a8e5f){if(_0x2a8e5f){return _0xbf09d5[_0x23ca('0x16')](_0x33aa3b);}return _0xbf09d5[_0x23ca('0x17')](_0x33aa3b)[_0x23ca('0x18')]();};}function respondWithResult(_0x32ce72,_0x390be4){_0x390be4=_0x390be4||0xc8;return function(_0x4e7335){if(_0x4e7335){return _0x32ce72[_0x23ca('0x17')](_0x390be4)['json'](_0x4e7335);}};}function respondWithFilteredResult(_0x29c3e6,_0x455d55){return function(_0x2aa69c){if(_0x2aa69c){var _0x4979ff=typeof _0x455d55[_0x23ca('0x19')]===_0x23ca('0x1a')&&typeof _0x455d55[_0x23ca('0x1b')]===_0x23ca('0x1a');var _0x23ab79=_0x2aa69c[_0x23ca('0x1c')];var _0x37e72a=_0x4979ff?0x0:_0x455d55[_0x23ca('0x19')];var _0xae7bc4=_0x4979ff?_0x2aa69c[_0x23ca('0x1c')]:_0x455d55[_0x23ca('0x19')]+_0x455d55['limit'];var _0x24726e;if(_0xae7bc4>=_0x23ab79){_0xae7bc4=_0x23ab79;_0x24726e=0xc8;}else{_0x24726e=0xce;}_0x29c3e6['status'](_0x24726e);return _0x29c3e6[_0x23ca('0x1d')](_0x23ca('0x1e'),_0x37e72a+'-'+_0xae7bc4+'/'+_0x23ab79)[_0x23ca('0x1f')](_0x2aa69c);}return null;};}function patchUpdates(_0x38e313){return function(_0x13d358){try{jsonpatch[_0x23ca('0x20')](_0x13d358,_0x38e313,!![]);}catch(_0x207215){return BPromise[_0x23ca('0x21')](_0x207215);}return _0x13d358[_0x23ca('0x22')]();};}function saveUpdates(_0x314ca0,_0x11edeb){return function(_0x27ba32){if(_0x27ba32){return _0x27ba32[_0x23ca('0x23')](_0x314ca0)['then'](function(_0x3cef1e){return _0x3cef1e;});}return null;};}function removeEntity(_0x5bdcf2,_0x4b723d){return function(_0x86747e){if(_0x86747e){return _0x86747e[_0x23ca('0x24')]()[_0x23ca('0x25')](function(){_0x5bdcf2[_0x23ca('0x17')](0xcc)[_0x23ca('0x18')]();});}};}function handleEntityNotFound(_0x548978,_0x8ae111){return function(_0x55aba9){if(!_0x55aba9){_0x548978['sendStatus'](0x194);}return _0x55aba9;};}function handleError(_0x41c09e,_0x15a98f){_0x15a98f=_0x15a98f||0x1f4;return function(_0x2e5444){logger[_0x23ca('0x26')](_0x2e5444[_0x23ca('0x27')]);if(_0x2e5444[_0x23ca('0x28')]){delete _0x2e5444[_0x23ca('0x28')];}_0x41c09e['status'](_0x15a98f)['send'](_0x2e5444);};}exports['index']=function(_0x3d4c22,_0x391161){var _0x5ba6c6={},_0x43d644={},_0x170311={'count':0x0,'rows':[]};var _0x1a57c2=_[_0x23ca('0x29')](db[_0x23ca('0x2a')][_0x23ca('0x2b')],function(_0x1ee9cd){return{'name':_0x1ee9cd[_0x23ca('0x2c')],'type':_0x1ee9cd[_0x23ca('0x2d')][_0x23ca('0x2e')]};});_0x43d644[_0x23ca('0x2f')]=_['map'](_0x1a57c2,_0x23ca('0x28'));_0x43d644[_0x23ca('0x30')]=_[_0x23ca('0x31')](_0x3d4c22[_0x23ca('0x30')]);_0x43d644['filters']=_[_0x23ca('0x32')](_0x43d644[_0x23ca('0x2f')],_0x43d644[_0x23ca('0x30')]);_0x5ba6c6[_0x23ca('0x33')]=_[_0x23ca('0x32')](_0x43d644[_0x23ca('0x2f')],qs['fields'](_0x3d4c22['query'][_0x23ca('0x34')]));_0x5ba6c6['attributes']=_0x5ba6c6[_0x23ca('0x33')][_0x23ca('0x35')]?_0x5ba6c6[_0x23ca('0x33')]:_0x43d644[_0x23ca('0x2f')];if(!_0x3d4c22[_0x23ca('0x30')][_0x23ca('0x36')]('nolimit')){_0x5ba6c6[_0x23ca('0x1b')]=qs[_0x23ca('0x1b')](_0x3d4c22['query'][_0x23ca('0x1b')]);_0x5ba6c6[_0x23ca('0x19')]=qs[_0x23ca('0x19')](_0x3d4c22[_0x23ca('0x30')]['offset']);}_0x5ba6c6[_0x23ca('0x37')]=qs[_0x23ca('0x38')](_0x3d4c22[_0x23ca('0x30')][_0x23ca('0x38')]);_0x5ba6c6[_0x23ca('0x39')]=qs[_0x23ca('0x3a')](_['pick'](_0x3d4c22[_0x23ca('0x30')],_0x43d644[_0x23ca('0x3a')]),_0x1a57c2);if(_0x3d4c22[_0x23ca('0x30')][_0x23ca('0x3b')]){_0x5ba6c6[_0x23ca('0x39')]=_[_0x23ca('0x3c')](_0x5ba6c6['where'],{'$or':_[_0x23ca('0x29')](_0x1a57c2,function(_0x590766){if(_0x590766[_0x23ca('0x2d')]!==_0x23ca('0x3d')){var _0x74873b={};_0x74873b[_0x590766[_0x23ca('0x28')]]={'$like':'%'+_0x3d4c22[_0x23ca('0x30')][_0x23ca('0x3b')]+'%'};return _0x74873b;}})});}_0x5ba6c6=_[_0x23ca('0x3c')]({},_0x5ba6c6,_0x3d4c22[_0x23ca('0x3e')]);var _0x21bd10={'where':_0x5ba6c6[_0x23ca('0x39')]};return db[_0x23ca('0x2a')][_0x23ca('0x1c')](_0x21bd10)['then'](function(_0x2b4e4b){_0x170311['count']=_0x2b4e4b;if(_0x3d4c22[_0x23ca('0x30')][_0x23ca('0x3f')]){_0x5ba6c6['include']=[{'all':!![]}];}return db[_0x23ca('0x2a')][_0x23ca('0x40')](_0x5ba6c6);})[_0x23ca('0x25')](function(_0x422eb0){_0x170311[_0x23ca('0x41')]=_0x422eb0;return _0x170311;})[_0x23ca('0x25')](respondWithFilteredResult(_0x391161,_0x5ba6c6))[_0x23ca('0x42')](handleError(_0x391161,null));};exports[_0x23ca('0x43')]=function(_0x104748,_0x4dc60e){var _0x82e9a2={'raw':![],'where':{'id':_0x104748[_0x23ca('0x44')]['id']}},_0x16b995={};_0x16b995[_0x23ca('0x2f')]=_[_0x23ca('0x31')](db[_0x23ca('0x2a')]['rawAttributes']);_0x16b995[_0x23ca('0x30')]=_[_0x23ca('0x31')](_0x104748['query']);_0x16b995['filters']=_['intersection'](_0x16b995['model'],_0x16b995['query']);_0x82e9a2[_0x23ca('0x33')]=_[_0x23ca('0x32')](_0x16b995[_0x23ca('0x2f')],qs['fields'](_0x104748[_0x23ca('0x30')][_0x23ca('0x34')]));_0x82e9a2['attributes']=_0x82e9a2[_0x23ca('0x33')]['length']?_0x82e9a2[_0x23ca('0x33')]:_0x16b995['model'];if(_0x104748[_0x23ca('0x30')][_0x23ca('0x3f')]){_0x82e9a2['include']=[{'all':!![]}];}_0x82e9a2=_[_0x23ca('0x3c')]({},_0x82e9a2,_0x104748[_0x23ca('0x3e')]);return db[_0x23ca('0x2a')][_0x23ca('0x45')](_0x82e9a2)[_0x23ca('0x25')](handleEntityNotFound(_0x4dc60e,null))['then'](respondWithResult(_0x4dc60e,null))[_0x23ca('0x42')](handleError(_0x4dc60e,null));};exports[_0x23ca('0x46')]=function(_0x2e0f0f,_0x30dcf9){return db['SalesforceAccount'][_0x23ca('0x46')](_0x2e0f0f['body'],{})['then'](respondWithResult(_0x30dcf9,0xc9))['catch'](handleError(_0x30dcf9,null));};exports[_0x23ca('0x23')]=function(_0x3de37b,_0x511ac1){if(_0x3de37b['body']['id']){delete _0x3de37b[_0x23ca('0x47')]['id'];}return db[_0x23ca('0x2a')][_0x23ca('0x45')]({'where':{'id':_0x3de37b[_0x23ca('0x44')]['id']}})[_0x23ca('0x25')](handleEntityNotFound(_0x511ac1,null))[_0x23ca('0x25')](saveUpdates(_0x3de37b['body'],null))[_0x23ca('0x25')](respondWithResult(_0x511ac1,null))['catch'](handleError(_0x511ac1,null));};exports[_0x23ca('0x24')]=function(_0x5a4708,_0x1c6f4a){return db[_0x23ca('0x2a')][_0x23ca('0x45')]({'where':{'id':_0x5a4708[_0x23ca('0x44')]['id']}})['then'](handleEntityNotFound(_0x1c6f4a,null))[_0x23ca('0x25')](removeEntity(_0x1c6f4a,null))[_0x23ca('0x42')](handleError(_0x1c6f4a,null));};exports[_0x23ca('0x48')]=function(_0x2310d6,_0x20b9d9,_0x1897d8){var _0x1046ad={};var _0x4011ea={};var _0x208bd5;var _0xfb317;return db[_0x23ca('0x2a')][_0x23ca('0x49')]({'where':{'id':_0x2310d6[_0x23ca('0x44')]['id']}})[_0x23ca('0x25')](handleEntityNotFound(_0x20b9d9,null))[_0x23ca('0x25')](function(_0x538264){if(_0x538264){_0x208bd5=_0x538264;_0x4011ea[_0x23ca('0x2f')]=_[_0x23ca('0x31')](db['SalesforceConfiguration'][_0x23ca('0x2b')]);_0x4011ea[_0x23ca('0x30')]=_[_0x23ca('0x31')](_0x2310d6['query']);_0x4011ea['filters']=_['intersection'](_0x4011ea[_0x23ca('0x2f')],_0x4011ea['query']);_0x1046ad['attributes']=_[_0x23ca('0x32')](_0x4011ea['model'],qs[_0x23ca('0x34')](_0x2310d6[_0x23ca('0x30')][_0x23ca('0x34')]));_0x1046ad[_0x23ca('0x33')]=_0x1046ad['attributes'][_0x23ca('0x35')]?_0x1046ad[_0x23ca('0x33')]:_0x4011ea['model'];_0x1046ad[_0x23ca('0x37')]=qs[_0x23ca('0x38')](_0x2310d6[_0x23ca('0x30')][_0x23ca('0x38')]);_0x1046ad[_0x23ca('0x39')]=qs[_0x23ca('0x3a')](_[_0x23ca('0x4a')](_0x2310d6[_0x23ca('0x30')],_0x4011ea[_0x23ca('0x3a')]));if(_0x2310d6[_0x23ca('0x30')][_0x23ca('0x3b')]){_0x1046ad[_0x23ca('0x39')]=_[_0x23ca('0x3c')](_0x1046ad['where'],{'$or':_[_0x23ca('0x29')](_0x1046ad[_0x23ca('0x33')],function(_0x4ead76){var _0x12a798={};_0x12a798[_0x4ead76]={'$like':'%'+_0x2310d6['query']['filter']+'%'};return _0x12a798;})});}_0x1046ad=_[_0x23ca('0x3c')]({},_0x1046ad,_0x2310d6[_0x23ca('0x3e')]);return _0x208bd5[_0x23ca('0x48')](_0x1046ad);}})[_0x23ca('0x25')](function(_0x47267f){if(_0x47267f){_0xfb317=_0x47267f['length'];if(!_0x2310d6['query'][_0x23ca('0x36')]('nolimit')){_0x1046ad[_0x23ca('0x1b')]=qs[_0x23ca('0x1b')](_0x2310d6[_0x23ca('0x30')][_0x23ca('0x1b')]);_0x1046ad[_0x23ca('0x19')]=qs['offset'](_0x2310d6[_0x23ca('0x30')][_0x23ca('0x19')]);}return _0x208bd5[_0x23ca('0x48')](_0x1046ad);}})['then'](function(_0xd27429){if(_0xd27429){return _0xd27429?{'count':_0xfb317,'rows':_0xd27429}:null;}})[_0x23ca('0x25')](respondWithResult(_0x20b9d9,null))['catch'](handleError(_0x20b9d9,null));};exports[_0x23ca('0x4b')]=function(_0x42feb2,_0x493ffb,_0x344a9a){if(_0x42feb2[_0x23ca('0x47')]['id']){delete _0x42feb2[_0x23ca('0x47')]['id'];}return db[_0x23ca('0x2a')][_0x23ca('0x49')]({'where':{'id':_0x42feb2[_0x23ca('0x44')]['id']}})[_0x23ca('0x25')](handleEntityNotFound(_0x493ffb,null))[_0x23ca('0x25')](function(_0x1ebd53){if(_0x1ebd53){_0x42feb2[_0x23ca('0x47')]['AccountId']=_0x1ebd53['id'];_0x42feb2['body'][_0x23ca('0x4c')]=integrations[_0x23ca('0x4d')](_0x42feb2[_0x23ca('0x47')][_0x23ca('0x4e')],_0x42feb2['body'][_0x23ca('0x2d')]);_0x42feb2[_0x23ca('0x47')][_0x23ca('0x4f')]=integrations[_0x23ca('0x50')](_0x42feb2[_0x23ca('0x47')][_0x23ca('0x4e')],_0x42feb2[_0x23ca('0x47')][_0x23ca('0x2d')]);return db['SalesforceConfiguration']['create'](_0x42feb2['body'],{'include':[{'model':db[_0x23ca('0x51')],'as':_0x23ca('0x4c')},{'model':db[_0x23ca('0x51')],'as':_0x23ca('0x4f')}]});}return null;})[_0x23ca('0x25')](respondWithResult(_0x493ffb,null))[_0x23ca('0x42')](handleError(_0x493ffb,null));};exports[_0x23ca('0x52')]=function(_0x573f76,_0x1c5242,_0x36d205){var _0x17fb81;var _0x53be13='';var _0x36e6a4='Task';return db[_0x23ca('0x2a')][_0x23ca('0x49')]({'where':{'id':_0x573f76['params']['id']},'attributes':['id',_0x23ca('0x53'),_0x23ca('0x54'),_0x23ca('0x55'),_0x23ca('0x56'),_0x23ca('0x57'),'securityToken']})['then'](handleEntityNotFound(_0x1c5242,null))[_0x23ca('0x25')](function(_0xa6ecc1){if(_0xa6ecc1){_0x53be13=_0xa6ecc1[_0x23ca('0x53')];var _0x153932=_0x53be13[_0x23ca('0x58')](-0x1);if(_0x153932==='/'){_0x53be13=_0x53be13[_0x23ca('0x59')](0x0,_0x53be13[_0x23ca('0x5a')](_0x153932));}_0x17fb81=new jsforce[(_0x23ca('0x5b'))]({'oauth2':{'loginUrl':_0x53be13,'clientId':_0xa6ecc1[_0x23ca('0x54')],'clientSecret':_0xa6ecc1[_0x23ca('0x55')]}});return _0x17fb81['login'](_0xa6ecc1[_0x23ca('0x56')],_0xa6ecc1[_0x23ca('0x57')][_0x23ca('0x5c')](_0xa6ecc1['securityToken']));}})['then'](function(_0x42d3e5){if(_0x42d3e5){if(!_[_0x23ca('0x5d')](_0x573f76['query'][_0x23ca('0x5e')])){_0x36e6a4=_0x573f76[_0x23ca('0x30')]['ticketType'];}return _0x17fb81[_0x23ca('0x5f')](_0x36e6a4)[_0x23ca('0x60')]();}})['then'](function(_0x3c618b){var _0x4f6a2b=[_0x23ca('0x61'),'ActivityDate','IsReminderSet',_0x23ca('0x62'),_0x23ca('0x63'),'Description'];var _0x51a7e2=[_0x23ca('0x64'),_0x23ca('0x65'),_0x23ca('0x66'),_0x23ca('0x67'),_0x23ca('0x68'),_0x23ca('0x69'),_0x23ca('0x6a')];if(_0x3c618b){_[_0x23ca('0x6b')](_0x3c618b[_0x23ca('0x34')],function(_0x232403){return _0x4f6a2b[_0x23ca('0x6c')](_0x232403[_0x23ca('0x28')])||!_0x51a7e2['includes'](_0x232403[_0x23ca('0x2d')]);});return{'count':_0x3c618b['fields']['length'],'rows':_[_0x23ca('0x29')](_0x3c618b['fields'],function(_0x21b230){return{'id':_0x21b230[_0x23ca('0x28')],'name':_0x21b230[_0x23ca('0x6d')],'custom':_0x21b230['custom'],'options':_0x21b230[_0x23ca('0x6e')][_0x23ca('0x35')]>0x0?_[_0x23ca('0x29')](_0x21b230[_0x23ca('0x6e')],function(_0x53d2a1){return{'name':_0x53d2a1[_0x23ca('0x6d')],'value':_0x53d2a1[_0x23ca('0x6f')]};}):_0x21b230[_0x23ca('0x2d')]=='boolean'?[{'name':_0x23ca('0x70'),'value':_0x23ca('0x71')},{'name':'False','value':_0x23ca('0x72')}]:[]};})};}})['then'](respondWithResult(_0x1c5242,null))[_0x23ca('0x42')](function(_0x2eff3d){var _0x2aca2e=_0x573f76[_0x23ca('0x30')][_0x23ca('0x73')]?0x1f4:_0x2eff3d['statusCode']||0x1f4;logger[_0x23ca('0x26')](_0x23ca('0x74'),'getFields',_0x2aca2e,JSON[_0x23ca('0x75')](_0x2eff3d));delete _0x2eff3d[_0x23ca('0x28')];if(_0x2aca2e===0x191){_0x2aca2e=0x190;}_0x1c5242[_0x23ca('0x17')](_0x2aca2e)[_0x23ca('0x76')](_0x573f76[_0x23ca('0x30')][_0x23ca('0x73')]?{'message':_0x23ca('0x77'),'statusCode':_0x2eff3d[_0x23ca('0x78')]}:_0x2eff3d);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 2ac2d0b..80fac35 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 _0xd810=['exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','api','moment','path','../../config/environment','../../components/integrations/configuration'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xd810,0x1dd));var _0x0d81=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xd810[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x0d81('0x0'));var util=require(_0x0d81('0x1'));var logger=require('../../config/logger')(_0x0d81('0x2'));var moment=require(_0x0d81('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0d81('0x4'));var rimraf=require('rimraf');var config=require(_0x0d81('0x5'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x0d81('0x6'));module[_0x0d81('0x7')]=function(_0xa8b39f,_0x53697e){return _0xa8b39f[_0x0d81('0x8')](_0x0d81('0x9'),attributes,{'tableName':_0x0d81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82a2=['path','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','int_salesforce_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x56a2d1,_0x18d80b){var _0x304a31=function(_0x7c9aef){while(--_0x7c9aef){_0x56a2d1['push'](_0x56a2d1['shift']());}};_0x304a31(++_0x18d80b);}(_0x82a2,0x17a));var _0x282a=function(_0x355717,_0x580e89){_0x355717=_0x355717-0x0;var _0x497c35=_0x82a2[_0x355717];return _0x497c35;};'use strict';var _=require(_0x282a('0x0'));var util=require('util');var logger=require(_0x282a('0x1'))(_0x282a('0x2'));var moment=require(_0x282a('0x3'));var BPromise=require(_0x282a('0x4'));var rp=require(_0x282a('0x5'));var fs=require('fs');var path=require(_0x282a('0x6'));var rimraf=require(_0x282a('0x7'));var config=require(_0x282a('0x8'));var attributes=require(_0x282a('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x282a('0xa')]=function(_0x4bf75f,_0x7bc1b5){return _0x4bf75f['define']('SalesforceAccount',attributes,{'tableName':_0x282a('0xb'),'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 2247efd..780439e 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 _0xbb9e=['include','model','GetSalesforceAccount','ShowSalesforceAccount','find','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','SalesforceAccount','findAll','options','where','attributes','limit','map'];(function(_0x5831ca,_0x9d67f7){var _0x29d28c=function(_0x46ceca){while(--_0x46ceca){_0x5831ca['push'](_0x5831ca['shift']());}};_0x29d28c(++_0x9d67f7);}(_0xbb9e,0xf4));var _0xebb9=function(_0xc5335a,_0x49d115){_0xc5335a=_0xc5335a-0x0;var _0x29117b=_0xbb9e[_0xc5335a];return _0x29117b;};'use strict';var _=require(_0xebb9('0x0'));var util=require('util');var moment=require(_0xebb9('0x1'));var BPromise=require(_0xebb9('0x2'));var rs=require(_0xebb9('0x3'));var fs=require('fs');var Redis=require(_0xebb9('0x4'));var db=require(_0xebb9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xebb9('0x6'))(_0xebb9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xebb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x17889c,_0x9406ae,_0x59894a){return new BPromise(function(_0x2d07a0,_0x22f457){return client[_0xebb9('0x9')](_0x17889c,_0x59894a)[_0xebb9('0xa')](function(_0x117ca6){logger[_0xebb9('0xb')](_0xebb9('0xc'),_0x9406ae,_0xebb9('0xd'));logger[_0xebb9('0xe')](_0xebb9('0xf'),_0x9406ae,'request\x20sent',JSON[_0xebb9('0x10')](_0x117ca6));if(_0x117ca6['error']){if(_0x117ca6['error'][_0xebb9('0x11')]===0x1f4){logger[_0xebb9('0x12')](_0xebb9('0xc'),_0x9406ae,_0x117ca6[_0xebb9('0x12')][_0xebb9('0x13')]);return _0x22f457(_0x117ca6[_0xebb9('0x12')][_0xebb9('0x13')]);}logger['error'](_0xebb9('0xc'),_0x9406ae,_0x117ca6[_0xebb9('0x12')]['message']);return _0x2d07a0(_0x117ca6[_0xebb9('0x12')][_0xebb9('0x13')]);}else{logger[_0xebb9('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x9406ae,'request\x20sent');_0x2d07a0(_0x117ca6[_0xebb9('0x14')][_0xebb9('0x13')]);}})['catch'](function(_0x28ede3){logger[_0xebb9('0x12')](_0xebb9('0xc'),_0x9406ae,_0x28ede3);_0x22f457(_0x28ede3);});});}exports['GetSalesforceAccount']=function(_0x1796cd){var _0x2b01ab=this;return new Promise(function(_0x49566d,_0x2794ee){return db[_0xebb9('0x15')][_0xebb9('0x16')]({'raw':_0x1796cd['options']?_0x1796cd['options']['raw']===undefined?!![]:![]:!![],'where':_0x1796cd[_0xebb9('0x17')]?_0x1796cd[_0xebb9('0x17')][_0xebb9('0x18')]||null:null,'attributes':_0x1796cd[_0xebb9('0x17')]?_0x1796cd[_0xebb9('0x17')][_0xebb9('0x19')]||null:null,'limit':_0x1796cd[_0xebb9('0x17')]?_0x1796cd[_0xebb9('0x17')][_0xebb9('0x1a')]||null:null,'include':_0x1796cd[_0xebb9('0x17')]?_0x1796cd[_0xebb9('0x17')]['include']?_[_0xebb9('0x1b')](_0x1796cd[_0xebb9('0x17')][_0xebb9('0x1c')],function(_0x34c685){return{'model':db[_0x34c685[_0xebb9('0x1d')]],'as':_0x34c685['as'],'attributes':_0x34c685[_0xebb9('0x19')],'include':_0x34c685[_0xebb9('0x1c')]?_[_0xebb9('0x1b')](_0x34c685[_0xebb9('0x1c')],function(_0x58730a){return{'model':db[_0x58730a[_0xebb9('0x1d')]],'as':_0x58730a['as'],'attributes':_0x58730a[_0xebb9('0x19')],'include':_0x58730a[_0xebb9('0x1c')]?_[_0xebb9('0x1b')](_0x58730a[_0xebb9('0x1c')],function(_0x73cdf8){return{'model':db[_0x73cdf8[_0xebb9('0x1d')]],'as':_0x73cdf8['as'],'attributes':_0x73cdf8[_0xebb9('0x19')]};}):[]};}):[]};}):[]:[]})[_0xebb9('0xa')](function(_0x2b5db3){logger[_0xebb9('0xb')](_0xebb9('0x1e'),_0x1796cd);logger['debug'](_0xebb9('0x1e'),_0x1796cd,JSON[_0xebb9('0x10')](_0x2b5db3));_0x49566d(_0x2b5db3);})['catch'](function(_0x394997){logger['error'](_0xebb9('0x1e'),_0x394997[_0xebb9('0x13')],_0x1796cd);_0x2794ee(_0x2b01ab['error'](0x1f4,_0x394997[_0xebb9('0x13')]));});});};exports[_0xebb9('0x1f')]=function(_0x1fa5fb){var _0x22722b=this;return new Promise(function(_0x1fa690,_0x2066d0){return db[_0xebb9('0x15')][_0xebb9('0x20')]({'raw':_0x1fa5fb[_0xebb9('0x17')]?_0x1fa5fb['options']['raw']===undefined?!![]:![]:!![],'where':_0x1fa5fb['options']?_0x1fa5fb['options'][_0xebb9('0x18')]||null:null,'attributes':_0x1fa5fb[_0xebb9('0x17')]?_0x1fa5fb[_0xebb9('0x17')][_0xebb9('0x19')]||null:null,'include':_0x1fa5fb[_0xebb9('0x17')]?_0x1fa5fb['options'][_0xebb9('0x1c')]?_[_0xebb9('0x1b')](_0x1fa5fb['options']['include'],function(_0x476b54){return{'model':db[_0x476b54[_0xebb9('0x1d')]],'as':_0x476b54['as'],'attributes':_0x476b54[_0xebb9('0x19')],'include':_0x476b54[_0xebb9('0x1c')]?_['map'](_0x476b54['include'],function(_0x1bcb9f){return{'model':db[_0x1bcb9f[_0xebb9('0x1d')]],'as':_0x1bcb9f['as'],'attributes':_0x1bcb9f[_0xebb9('0x19')],'include':_0x1bcb9f[_0xebb9('0x1c')]?_[_0xebb9('0x1b')](_0x1bcb9f[_0xebb9('0x1c')],function(_0x5adafa){return{'model':db[_0x5adafa[_0xebb9('0x1d')]],'as':_0x5adafa['as'],'attributes':_0x5adafa['attributes']};}):[]};}):[]};}):[]:[]})[_0xebb9('0xa')](function(_0x1c0624){logger[_0xebb9('0xb')](_0xebb9('0x1f'),_0x1fa5fb);logger[_0xebb9('0xe')]('ShowSalesforceAccount',_0x1fa5fb,JSON[_0xebb9('0x10')](_0x1c0624));_0x1fa690(_0x1c0624);})[_0xebb9('0x21')](function(_0x57c4a2){logger[_0xebb9('0x12')](_0xebb9('0x1f'),_0x57c4a2['message'],_0x1fa5fb);_0x2066d0(_0x22722b['error'](0x1f4,_0x57c4a2[_0xebb9('0x13')]));});});}; \ No newline at end of file +var _0x4bcf=['options','raw','where','limit','include','model','map','attributes','GetSalesforceAccount','ShowSalesforceAccount','find','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','SalesforceAccount'];(function(_0x4f08dd,_0x3784ec){var _0x3017ee=function(_0x7d95be){while(--_0x7d95be){_0x4f08dd['push'](_0x4f08dd['shift']());}};_0x3017ee(++_0x3784ec);}(_0x4bcf,0x177));var _0xf4bc=function(_0x1b95a1,_0x529852){_0x1b95a1=_0x1b95a1-0x0;var _0x57aef1=_0x4bcf[_0x1b95a1];return _0x57aef1;};'use strict';var _=require(_0xf4bc('0x0'));var util=require(_0xf4bc('0x1'));var moment=require('moment');var BPromise=require(_0xf4bc('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4bc('0x3'));var db=require(_0xf4bc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf4bc('0x5'));var jayson=require(_0xf4bc('0x6'));var client=jayson[_0xf4bc('0x7')][_0xf4bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f871f,_0x144b88,_0x5669c2){return new BPromise(function(_0x3e2159,_0xd1c2f0){return client[_0xf4bc('0x9')](_0x2f871f,_0x5669c2)[_0xf4bc('0xa')](function(_0x174884){logger['info'](_0xf4bc('0xb'),_0x144b88,_0xf4bc('0xc'));logger[_0xf4bc('0xd')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x144b88,_0xf4bc('0xc'),JSON[_0xf4bc('0xe')](_0x174884));if(_0x174884['error']){if(_0x174884['error'][_0xf4bc('0xf')]===0x1f4){logger[_0xf4bc('0x10')](_0xf4bc('0xb'),_0x144b88,_0x174884['error']['message']);return _0xd1c2f0(_0x174884['error'][_0xf4bc('0x11')]);}logger[_0xf4bc('0x10')](_0xf4bc('0xb'),_0x144b88,_0x174884['error']['message']);return _0x3e2159(_0x174884[_0xf4bc('0x10')]['message']);}else{logger[_0xf4bc('0x12')](_0xf4bc('0xb'),_0x144b88,_0xf4bc('0xc'));_0x3e2159(_0x174884[_0xf4bc('0x13')][_0xf4bc('0x11')]);}})['catch'](function(_0x562ed5){logger[_0xf4bc('0x10')](_0xf4bc('0xb'),_0x144b88,_0x562ed5);_0xd1c2f0(_0x562ed5);});});}exports['GetSalesforceAccount']=function(_0x7b2e6a){var _0x5a44ab=this;return new Promise(function(_0x3b8eb1,_0x339209){return db[_0xf4bc('0x14')]['findAll']({'raw':_0x7b2e6a[_0xf4bc('0x15')]?_0x7b2e6a['options'][_0xf4bc('0x16')]===undefined?!![]:![]:!![],'where':_0x7b2e6a[_0xf4bc('0x15')]?_0x7b2e6a[_0xf4bc('0x15')][_0xf4bc('0x17')]||null:null,'attributes':_0x7b2e6a['options']?_0x7b2e6a[_0xf4bc('0x15')]['attributes']||null:null,'limit':_0x7b2e6a['options']?_0x7b2e6a['options'][_0xf4bc('0x18')]||null:null,'include':_0x7b2e6a[_0xf4bc('0x15')]?_0x7b2e6a[_0xf4bc('0x15')][_0xf4bc('0x19')]?_['map'](_0x7b2e6a[_0xf4bc('0x15')][_0xf4bc('0x19')],function(_0x5c13cd){return{'model':db[_0x5c13cd[_0xf4bc('0x1a')]],'as':_0x5c13cd['as'],'attributes':_0x5c13cd['attributes'],'include':_0x5c13cd[_0xf4bc('0x19')]?_[_0xf4bc('0x1b')](_0x5c13cd['include'],function(_0x31b409){return{'model':db[_0x31b409[_0xf4bc('0x1a')]],'as':_0x31b409['as'],'attributes':_0x31b409[_0xf4bc('0x1c')],'include':_0x31b409[_0xf4bc('0x19')]?_[_0xf4bc('0x1b')](_0x31b409['include'],function(_0x22e9b2){return{'model':db[_0x22e9b2[_0xf4bc('0x1a')]],'as':_0x22e9b2['as'],'attributes':_0x22e9b2[_0xf4bc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf4bc('0xa')](function(_0x1fcd40){logger['info'](_0xf4bc('0x1d'),_0x7b2e6a);logger[_0xf4bc('0xd')]('GetSalesforceAccount',_0x7b2e6a,JSON['stringify'](_0x1fcd40));_0x3b8eb1(_0x1fcd40);})['catch'](function(_0x25eff6){logger[_0xf4bc('0x10')](_0xf4bc('0x1d'),_0x25eff6[_0xf4bc('0x11')],_0x7b2e6a);_0x339209(_0x5a44ab[_0xf4bc('0x10')](0x1f4,_0x25eff6[_0xf4bc('0x11')]));});});};exports[_0xf4bc('0x1e')]=function(_0x16c5d9){var _0x516b97=this;return new Promise(function(_0xa688c6,_0x335129){return db['SalesforceAccount'][_0xf4bc('0x1f')]({'raw':_0x16c5d9[_0xf4bc('0x15')]?_0x16c5d9[_0xf4bc('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x16c5d9[_0xf4bc('0x15')]?_0x16c5d9[_0xf4bc('0x15')][_0xf4bc('0x17')]||null:null,'attributes':_0x16c5d9[_0xf4bc('0x15')]?_0x16c5d9[_0xf4bc('0x15')][_0xf4bc('0x1c')]||null:null,'include':_0x16c5d9[_0xf4bc('0x15')]?_0x16c5d9[_0xf4bc('0x15')]['include']?_['map'](_0x16c5d9[_0xf4bc('0x15')]['include'],function(_0x295326){return{'model':db[_0x295326[_0xf4bc('0x1a')]],'as':_0x295326['as'],'attributes':_0x295326[_0xf4bc('0x1c')],'include':_0x295326[_0xf4bc('0x19')]?_[_0xf4bc('0x1b')](_0x295326[_0xf4bc('0x19')],function(_0x525ceb){return{'model':db[_0x525ceb[_0xf4bc('0x1a')]],'as':_0x525ceb['as'],'attributes':_0x525ceb[_0xf4bc('0x1c')],'include':_0x525ceb[_0xf4bc('0x19')]?_[_0xf4bc('0x1b')](_0x525ceb[_0xf4bc('0x19')],function(_0x1cc581){return{'model':db[_0x1cc581[_0xf4bc('0x1a')]],'as':_0x1cc581['as'],'attributes':_0x1cc581[_0xf4bc('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xf4bc('0xa')](function(_0x481fcd){logger[_0xf4bc('0x12')]('ShowSalesforceAccount',_0x16c5d9);logger['debug'](_0xf4bc('0x1e'),_0x16c5d9,JSON[_0xf4bc('0xe')](_0x481fcd));_0xa688c6(_0x481fcd);})[_0xf4bc('0x20')](function(_0x29e27e){logger[_0xf4bc('0x10')](_0xf4bc('0x1e'),_0x29e27e[_0xf4bc('0x11')],_0x16c5d9);_0x335129(_0x516b97['error'](0x1f4,_0x29e27e[_0xf4bc('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 77c5a22..6b16370 100644 --- a/server/api/intSalesforceConfiguration/index.js +++ b/server/api/intSalesforceConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x4caae6,_0x521b5b){var _0x507092=function(_0x411a0b){while(--_0x411a0b){_0x4caae6['push'](_0x4caae6['shift']());}};_0x507092(++_0x521b5b);}(_0x2ef3,0xba));var _0x32ef=function(_0x24b0c5,_0x2f0a9e){_0x24b0c5=_0x24b0c5-0x0;var _0x5703b8=_0x2ef3[_0x24b0c5];return _0x5703b8;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file +var _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x5f0dda,_0x534db9){var _0x587384=function(_0x513209){while(--_0x513209){_0x5f0dda['push'](_0x5f0dda['shift']());}};_0x587384(++_0x534db9);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index c361f10..0d330c7 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 _0xec49=['account_contact_lead','account','nothing','lead','sequelize','exports','STRING','ENUM','Case','Task','contact_lead','contact'];(function(_0x5c4196,_0x59a506){var _0x2001c7=function(_0x13af0a){while(--_0x13af0a){_0x5c4196['push'](_0x5c4196['shift']());}};_0x2001c7(++_0x59a506);}(_0xec49,0x190));var _0x9ec4=function(_0x43779d,_0x26d259){_0x43779d=_0x43779d-0x0;var _0x525af2=_0xec49[_0x43779d];return _0x525af2;};'use strict';var Sequelize=require(_0x9ec4('0x0'));module[_0x9ec4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9ec4('0x2')]},'ticketType':{'type':Sequelize[_0x9ec4('0x3')]('Task',_0x9ec4('0x4')),'defaultValue':_0x9ec4('0x5')},'moduleSearch':{'type':Sequelize[_0x9ec4('0x3')](_0x9ec4('0x6'),_0x9ec4('0x7'),'lead',_0x9ec4('0x8'),_0x9ec4('0x9')),'defaultValue':_0x9ec4('0x6')},'moduleCreate':{'type':Sequelize[_0x9ec4('0x3')](_0x9ec4('0xa'),_0x9ec4('0x7'),'lead',_0x9ec4('0x9')),'defaultValue':_0x9ec4('0xb')},'leadId':{'type':Sequelize[_0x9ec4('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0x9ec4('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x9ec4('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x9ec4('0x2')]}}; \ No newline at end of file +var _0x905b=['nothing','contact','account','sequelize','exports','STRING','Case','Task','ENUM','contact_lead','lead','account_contact_lead'];(function(_0x817d9b,_0x3c37e3){var _0x2752e1=function(_0x2b434e){while(--_0x2b434e){_0x817d9b['push'](_0x817d9b['shift']());}};_0x2752e1(++_0x3c37e3);}(_0x905b,0x87));var _0xb905=function(_0x440476,_0x35b041){_0x440476=_0x440476-0x0;var _0x346dff=_0x905b[_0x440476];return _0x346dff;};'use strict';var Sequelize=require(_0xb905('0x0'));module[_0xb905('0x1')]={'name':{'type':Sequelize[_0xb905('0x2')]},'description':{'type':Sequelize[_0xb905('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0xb905('0x3')),'defaultValue':_0xb905('0x4')},'moduleSearch':{'type':Sequelize[_0xb905('0x5')](_0xb905('0x6'),'contact',_0xb905('0x7'),_0xb905('0x8'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0xb905('0x9'),_0xb905('0xa'),_0xb905('0x7'),_0xb905('0xb')),'defaultValue':_0xb905('0x7')},'leadId':{'type':Sequelize[_0xb905('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xb905('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xb905('0x2')]},'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 97a82bc..72934fa 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 _0xdfbd=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','rawAttributes','includeAll','find','create','body','params','findOne','SalesforceField','getFields','nolimit','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4caa0c,_0x1ee429){var _0x37b7c9=function(_0x14f780){while(--_0x14f780){_0x4caa0c['push'](_0x4caa0c['shift']());}};_0x37b7c9(++_0x1ee429);}(_0xdfbd,0x19c));var _0xddfb=function(_0x26f722,_0xad6704){_0x26f722=_0x26f722-0x0;var _0x1de8f5=_0xdfbd[_0x26f722];return _0x1de8f5;};'use strict';var emlformat=require(_0xddfb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xddfb('0x1'));var jsonpatch=require(_0xddfb('0x2'));var rp=require(_0xddfb('0x3'));var moment=require(_0xddfb('0x4'));var BPromise=require(_0xddfb('0x5'));var Mustache=require(_0xddfb('0x6'));var util=require(_0xddfb('0x7'));var path=require(_0xddfb('0x8'));var sox=require(_0xddfb('0x9'));var csv=require(_0xddfb('0xa'));var ejs=require(_0xddfb('0xb'));var fs=require('fs');var fs_extra=require(_0xddfb('0xc'));var _=require('lodash');var squel=require(_0xddfb('0xd'));var crypto=require(_0xddfb('0xe'));var jsforce=require(_0xddfb('0xf'));var deskjs=require(_0xddfb('0x10'));var toCsv=require('to-csv');var querystring=require(_0xddfb('0x11'));var Papa=require(_0xddfb('0x12'));var Redis=require(_0xddfb('0x13'));var authService=require(_0xddfb('0x14'));var qs=require(_0xddfb('0x15'));var as=require(_0xddfb('0x16'));var hardwareService=require(_0xddfb('0x17'));var logger=require(_0xddfb('0x18'))(_0xddfb('0x19'));var utils=require(_0xddfb('0x1a'));var config=require(_0xddfb('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xddfb('0x1c'))['db'];function respondWithStatusCode(_0x2b95e6,_0x13efa9){_0x13efa9=_0x13efa9||0xcc;return function(_0x53c2fc){if(_0x53c2fc){return _0x2b95e6[_0xddfb('0x1d')](_0x13efa9);}return _0x2b95e6['status'](_0x13efa9)[_0xddfb('0x1e')]();};}function respondWithResult(_0xa6d4df,_0x5f3fb3){_0x5f3fb3=_0x5f3fb3||0xc8;return function(_0xf99c19){if(_0xf99c19){return _0xa6d4df[_0xddfb('0x1f')](_0x5f3fb3)['json'](_0xf99c19);}};}function respondWithFilteredResult(_0x5d52b5,_0xee09d4){return function(_0x1844d6){if(_0x1844d6){var _0x4fb3c2=typeof _0xee09d4[_0xddfb('0x20')]===_0xddfb('0x21')&&typeof _0xee09d4[_0xddfb('0x22')]===_0xddfb('0x21');var _0x64de1b=_0x1844d6[_0xddfb('0x23')];var _0x13c9ce=_0x4fb3c2?0x0:_0xee09d4[_0xddfb('0x20')];var _0x5639b2=_0x4fb3c2?_0x1844d6[_0xddfb('0x23')]:_0xee09d4[_0xddfb('0x20')]+_0xee09d4[_0xddfb('0x22')];var _0x2fe86c;if(_0x5639b2>=_0x64de1b){_0x5639b2=_0x64de1b;_0x2fe86c=0xc8;}else{_0x2fe86c=0xce;}_0x5d52b5[_0xddfb('0x1f')](_0x2fe86c);return _0x5d52b5[_0xddfb('0x24')](_0xddfb('0x25'),_0x13c9ce+'-'+_0x5639b2+'/'+_0x64de1b)[_0xddfb('0x26')](_0x1844d6);}return null;};}function patchUpdates(_0x3bed4f){return function(_0x4183b4){try{jsonpatch[_0xddfb('0x27')](_0x4183b4,_0x3bed4f,!![]);}catch(_0x139e9f){return BPromise[_0xddfb('0x28')](_0x139e9f);}return _0x4183b4[_0xddfb('0x29')]();};}function saveUpdates(_0x56f336,_0x542a18){return function(_0x43f5fb){if(_0x43f5fb){return _0x43f5fb[_0xddfb('0x2a')](_0x56f336)[_0xddfb('0x2b')](function(_0x572c2c){return _0x572c2c;});}return null;};}function removeEntity(_0x3e8ac9,_0x1c3c2b){return function(_0x4846e7){if(_0x4846e7){return _0x4846e7[_0xddfb('0x2c')]()[_0xddfb('0x2b')](function(){_0x3e8ac9[_0xddfb('0x1f')](0xcc)[_0xddfb('0x1e')]();});}};}function handleEntityNotFound(_0x17f04b,_0x1015be){return function(_0x57e436){if(!_0x57e436){_0x17f04b[_0xddfb('0x1d')](0x194);}return _0x57e436;};}function handleError(_0x3495df,_0xccc14e){_0xccc14e=_0xccc14e||0x1f4;return function(_0xf0dc42){logger['error'](_0xf0dc42[_0xddfb('0x2d')]);if(_0xf0dc42['name']){delete _0xf0dc42[_0xddfb('0x2e')];}_0x3495df[_0xddfb('0x1f')](_0xccc14e)[_0xddfb('0x2f')](_0xf0dc42);};}exports[_0xddfb('0x30')]=function(_0x50c835,_0x189e18){var _0x2d4c1d={},_0x3e495f={},_0x59f0b8={'count':0x0,'rows':[]};var _0x5a4a5e=_[_0xddfb('0x31')](db[_0xddfb('0x32')]['rawAttributes'],function(_0x5250a0){return{'name':_0x5250a0[_0xddfb('0x33')],'type':_0x5250a0[_0xddfb('0x34')][_0xddfb('0x35')]};});_0x3e495f[_0xddfb('0x36')]=_[_0xddfb('0x31')](_0x5a4a5e,'name');_0x3e495f[_0xddfb('0x37')]=_[_0xddfb('0x38')](_0x50c835[_0xddfb('0x37')]);_0x3e495f[_0xddfb('0x39')]=_[_0xddfb('0x3a')](_0x3e495f[_0xddfb('0x36')],_0x3e495f[_0xddfb('0x37')]);_0x2d4c1d[_0xddfb('0x3b')]=_[_0xddfb('0x3a')](_0x3e495f[_0xddfb('0x36')],qs[_0xddfb('0x3c')](_0x50c835[_0xddfb('0x37')]['fields']));_0x2d4c1d[_0xddfb('0x3b')]=_0x2d4c1d[_0xddfb('0x3b')][_0xddfb('0x3d')]?_0x2d4c1d[_0xddfb('0x3b')]:_0x3e495f[_0xddfb('0x36')];if(!_0x50c835[_0xddfb('0x37')][_0xddfb('0x3e')]('nolimit')){_0x2d4c1d[_0xddfb('0x22')]=qs[_0xddfb('0x22')](_0x50c835[_0xddfb('0x37')][_0xddfb('0x22')]);_0x2d4c1d[_0xddfb('0x20')]=qs[_0xddfb('0x20')](_0x50c835[_0xddfb('0x37')]['offset']);}_0x2d4c1d[_0xddfb('0x3f')]=qs[_0xddfb('0x40')](_0x50c835[_0xddfb('0x37')][_0xddfb('0x40')]);_0x2d4c1d[_0xddfb('0x41')]=qs['filters'](_[_0xddfb('0x42')](_0x50c835[_0xddfb('0x37')],_0x3e495f[_0xddfb('0x39')]),_0x5a4a5e);if(_0x50c835[_0xddfb('0x37')][_0xddfb('0x43')]){_0x2d4c1d[_0xddfb('0x41')]=_[_0xddfb('0x44')](_0x2d4c1d[_0xddfb('0x41')],{'$or':_[_0xddfb('0x31')](_0x5a4a5e,function(_0x30ef34){if(_0x30ef34['type']!==_0xddfb('0x45')){var _0x2216e6={};_0x2216e6[_0x30ef34[_0xddfb('0x2e')]]={'$like':'%'+_0x50c835[_0xddfb('0x37')][_0xddfb('0x43')]+'%'};return _0x2216e6;}})});}_0x2d4c1d=_[_0xddfb('0x44')]({},_0x2d4c1d,_0x50c835[_0xddfb('0x46')]);var _0x11cbb3={'where':_0x2d4c1d[_0xddfb('0x41')]};return db[_0xddfb('0x32')][_0xddfb('0x23')](_0x11cbb3)['then'](function(_0x57ae11){_0x59f0b8[_0xddfb('0x23')]=_0x57ae11;if(_0x50c835[_0xddfb('0x37')]['includeAll']){_0x2d4c1d[_0xddfb('0x47')]=[{'all':!![]}];}return db['SalesforceConfiguration']['findAll'](_0x2d4c1d);})[_0xddfb('0x2b')](function(_0x635a76){_0x59f0b8[_0xddfb('0x48')]=_0x635a76;return _0x59f0b8;})[_0xddfb('0x2b')](respondWithFilteredResult(_0x189e18,_0x2d4c1d))[_0xddfb('0x49')](handleError(_0x189e18,null));};exports[_0xddfb('0x4a')]=function(_0x5e7560,_0xfc785c){var _0x60bc75={'raw':![],'where':{'id':_0x5e7560['params']['id']}},_0x3c5ffd={};_0x3c5ffd[_0xddfb('0x36')]=_['keys'](db['SalesforceConfiguration'][_0xddfb('0x4b')]);_0x3c5ffd[_0xddfb('0x37')]=_['keys'](_0x5e7560['query']);_0x3c5ffd[_0xddfb('0x39')]=_[_0xddfb('0x3a')](_0x3c5ffd[_0xddfb('0x36')],_0x3c5ffd['query']);_0x60bc75[_0xddfb('0x3b')]=_[_0xddfb('0x3a')](_0x3c5ffd['model'],qs[_0xddfb('0x3c')](_0x5e7560[_0xddfb('0x37')]['fields']));_0x60bc75[_0xddfb('0x3b')]=_0x60bc75['attributes'][_0xddfb('0x3d')]?_0x60bc75[_0xddfb('0x3b')]:_0x3c5ffd['model'];if(_0x5e7560[_0xddfb('0x37')][_0xddfb('0x4c')]){_0x60bc75[_0xddfb('0x47')]=[{'all':!![]}];}_0x60bc75=_[_0xddfb('0x44')]({},_0x60bc75,_0x5e7560[_0xddfb('0x46')]);return db[_0xddfb('0x32')][_0xddfb('0x4d')](_0x60bc75)[_0xddfb('0x2b')](handleEntityNotFound(_0xfc785c,null))[_0xddfb('0x2b')](respondWithResult(_0xfc785c,null))[_0xddfb('0x49')](handleError(_0xfc785c,null));};exports[_0xddfb('0x4e')]=function(_0x1d0d23,_0x514847){return db[_0xddfb('0x32')][_0xddfb('0x4e')](_0x1d0d23[_0xddfb('0x4f')],{})['then'](respondWithResult(_0x514847,0xc9))[_0xddfb('0x49')](handleError(_0x514847,null));};exports[_0xddfb('0x2a')]=function(_0x31937b,_0x353984){if(_0x31937b['body']['id']){delete _0x31937b[_0xddfb('0x4f')]['id'];}return db[_0xddfb('0x32')][_0xddfb('0x4d')]({'where':{'id':_0x31937b[_0xddfb('0x50')]['id']}})[_0xddfb('0x2b')](handleEntityNotFound(_0x353984,null))[_0xddfb('0x2b')](saveUpdates(_0x31937b[_0xddfb('0x4f')],null))[_0xddfb('0x2b')](respondWithResult(_0x353984,null))[_0xddfb('0x49')](handleError(_0x353984,null));};exports['destroy']=function(_0x3a35e2,_0x45ee26){return db[_0xddfb('0x32')][_0xddfb('0x4d')]({'where':{'id':_0x3a35e2[_0xddfb('0x50')]['id']}})[_0xddfb('0x2b')](handleEntityNotFound(_0x45ee26,null))[_0xddfb('0x2b')](removeEntity(_0x45ee26,null))[_0xddfb('0x49')](handleError(_0x45ee26,null));};exports['getFields']=function(_0x19bbcf,_0x194f61,_0x570cac){var _0x248f72={};var _0x3b4d84={};var _0xee833;var _0x26ae5a;return db['SalesforceConfiguration'][_0xddfb('0x51')]({'where':{'id':_0x19bbcf[_0xddfb('0x50')]['id']}})[_0xddfb('0x2b')](handleEntityNotFound(_0x194f61,null))[_0xddfb('0x2b')](function(_0x57d91c){if(_0x57d91c){_0xee833=_0x57d91c;_0x3b4d84[_0xddfb('0x36')]=_[_0xddfb('0x38')](db[_0xddfb('0x52')][_0xddfb('0x4b')]);_0x3b4d84[_0xddfb('0x37')]=_[_0xddfb('0x38')](_0x19bbcf[_0xddfb('0x37')]);_0x3b4d84['filters']=_[_0xddfb('0x3a')](_0x3b4d84[_0xddfb('0x36')],_0x3b4d84[_0xddfb('0x37')]);_0x248f72[_0xddfb('0x3b')]=_['intersection'](_0x3b4d84[_0xddfb('0x36')],qs[_0xddfb('0x3c')](_0x19bbcf[_0xddfb('0x37')]['fields']));_0x248f72[_0xddfb('0x3b')]=_0x248f72[_0xddfb('0x3b')]['length']?_0x248f72[_0xddfb('0x3b')]:_0x3b4d84[_0xddfb('0x36')];_0x248f72['order']=qs[_0xddfb('0x40')](_0x19bbcf[_0xddfb('0x37')][_0xddfb('0x40')]);_0x248f72[_0xddfb('0x41')]=qs[_0xddfb('0x39')](_[_0xddfb('0x42')](_0x19bbcf[_0xddfb('0x37')],_0x3b4d84['filters']));if(_0x19bbcf[_0xddfb('0x37')][_0xddfb('0x43')]){_0x248f72[_0xddfb('0x41')]=_[_0xddfb('0x44')](_0x248f72['where'],{'$or':_[_0xddfb('0x31')](_0x248f72['attributes'],function(_0x51fa36){var _0x552b30={};_0x552b30[_0x51fa36]={'$like':'%'+_0x19bbcf[_0xddfb('0x37')][_0xddfb('0x43')]+'%'};return _0x552b30;})});}_0x248f72=_[_0xddfb('0x44')]({},_0x248f72,_0x19bbcf[_0xddfb('0x46')]);return _0xee833[_0xddfb('0x53')](_0x248f72);}})['then'](function(_0x46e170){if(_0x46e170){_0x26ae5a=_0x46e170[_0xddfb('0x3d')];if(!_0x19bbcf[_0xddfb('0x37')][_0xddfb('0x3e')](_0xddfb('0x54'))){_0x248f72[_0xddfb('0x22')]=qs[_0xddfb('0x22')](_0x19bbcf[_0xddfb('0x37')][_0xddfb('0x22')]);_0x248f72[_0xddfb('0x20')]=qs[_0xddfb('0x20')](_0x19bbcf[_0xddfb('0x37')]['offset']);}return _0xee833[_0xddfb('0x53')](_0x248f72);}})[_0xddfb('0x2b')](function(_0x23d351){if(_0x23d351){return _0x23d351?{'count':_0x26ae5a,'rows':_0x23d351}:null;}})[_0xddfb('0x2b')](respondWithResult(_0x194f61,null))[_0xddfb('0x49')](handleError(_0x194f61,null));};exports[_0xddfb('0x55')]=function(_0x3e63b8,_0x41b292,_0x538bb0){var _0x3b8bb5={};var _0x212e5a={};var _0x29c4ac;var _0x20c56f;return db[_0xddfb('0x32')][_0xddfb('0x51')]({'where':{'id':_0x3e63b8[_0xddfb('0x50')]['id']}})['then'](handleEntityNotFound(_0x41b292,null))[_0xddfb('0x2b')](function(_0x27e14f){if(_0x27e14f){_0x29c4ac=_0x27e14f;_0x212e5a[_0xddfb('0x36')]=_[_0xddfb('0x38')](db[_0xddfb('0x52')][_0xddfb('0x4b')]);_0x212e5a[_0xddfb('0x37')]=_[_0xddfb('0x38')](_0x3e63b8[_0xddfb('0x37')]);_0x212e5a[_0xddfb('0x39')]=_[_0xddfb('0x3a')](_0x212e5a['model'],_0x212e5a[_0xddfb('0x37')]);_0x3b8bb5[_0xddfb('0x3b')]=_[_0xddfb('0x3a')](_0x212e5a[_0xddfb('0x36')],qs[_0xddfb('0x3c')](_0x3e63b8['query'][_0xddfb('0x3c')]));_0x3b8bb5['attributes']=_0x3b8bb5['attributes'][_0xddfb('0x3d')]?_0x3b8bb5[_0xddfb('0x3b')]:_0x212e5a['model'];_0x3b8bb5['order']=qs['sort'](_0x3e63b8['query'][_0xddfb('0x40')]);_0x3b8bb5[_0xddfb('0x41')]=qs['filters'](_[_0xddfb('0x42')](_0x3e63b8[_0xddfb('0x37')],_0x212e5a[_0xddfb('0x39')]));if(_0x3e63b8[_0xddfb('0x37')]['filter']){_0x3b8bb5[_0xddfb('0x41')]=_[_0xddfb('0x44')](_0x3b8bb5[_0xddfb('0x41')],{'$or':_['map'](_0x3b8bb5[_0xddfb('0x3b')],function(_0x320ff0){var _0x723590={};_0x723590[_0x320ff0]={'$like':'%'+_0x3e63b8[_0xddfb('0x37')][_0xddfb('0x43')]+'%'};return _0x723590;})});}_0x3b8bb5=_[_0xddfb('0x44')]({},_0x3b8bb5,_0x3e63b8[_0xddfb('0x46')]);return _0x29c4ac[_0xddfb('0x55')](_0x3b8bb5);}})['then'](function(_0x26da8f){if(_0x26da8f){_0x20c56f=_0x26da8f[_0xddfb('0x3d')];if(!_0x3e63b8['query'][_0xddfb('0x3e')]('nolimit')){_0x3b8bb5[_0xddfb('0x22')]=qs[_0xddfb('0x22')](_0x3e63b8[_0xddfb('0x37')][_0xddfb('0x22')]);_0x3b8bb5[_0xddfb('0x20')]=qs[_0xddfb('0x20')](_0x3e63b8[_0xddfb('0x37')][_0xddfb('0x20')]);}return _0x29c4ac[_0xddfb('0x55')](_0x3b8bb5);}})[_0xddfb('0x2b')](function(_0x2dc1f6){if(_0x2dc1f6){return _0x2dc1f6?{'count':_0x20c56f,'rows':_0x2dc1f6}:null;}})[_0xddfb('0x2b')](respondWithResult(_0x41b292,null))['catch'](handleError(_0x41b292,null));};exports['getDescriptions']=function(_0x2860c3,_0x2a9f8f,_0x2d79a6){var _0x4c23f2={};var _0x37af40={};var _0x34fd05;var _0x363938;return db[_0xddfb('0x32')][_0xddfb('0x51')]({'where':{'id':_0x2860c3[_0xddfb('0x50')]['id']}})[_0xddfb('0x2b')](handleEntityNotFound(_0x2a9f8f,null))['then'](function(_0x5f28){if(_0x5f28){_0x34fd05=_0x5f28;_0x37af40[_0xddfb('0x36')]=_[_0xddfb('0x38')](db[_0xddfb('0x52')][_0xddfb('0x4b')]);_0x37af40[_0xddfb('0x37')]=_[_0xddfb('0x38')](_0x2860c3[_0xddfb('0x37')]);_0x37af40[_0xddfb('0x39')]=_[_0xddfb('0x3a')](_0x37af40['model'],_0x37af40[_0xddfb('0x37')]);_0x4c23f2[_0xddfb('0x3b')]=_[_0xddfb('0x3a')](_0x37af40[_0xddfb('0x36')],qs[_0xddfb('0x3c')](_0x2860c3[_0xddfb('0x37')][_0xddfb('0x3c')]));_0x4c23f2[_0xddfb('0x3b')]=_0x4c23f2[_0xddfb('0x3b')][_0xddfb('0x3d')]?_0x4c23f2['attributes']:_0x37af40[_0xddfb('0x36')];_0x4c23f2[_0xddfb('0x3f')]=qs['sort'](_0x2860c3[_0xddfb('0x37')]['sort']);_0x4c23f2[_0xddfb('0x41')]=qs[_0xddfb('0x39')](_['pick'](_0x2860c3[_0xddfb('0x37')],_0x37af40[_0xddfb('0x39')]));if(_0x2860c3[_0xddfb('0x37')][_0xddfb('0x43')]){_0x4c23f2[_0xddfb('0x41')]=_[_0xddfb('0x44')](_0x4c23f2[_0xddfb('0x41')],{'$or':_[_0xddfb('0x31')](_0x4c23f2[_0xddfb('0x3b')],function(_0xc1d4ac){var _0x377824={};_0x377824[_0xc1d4ac]={'$like':'%'+_0x2860c3[_0xddfb('0x37')][_0xddfb('0x43')]+'%'};return _0x377824;})});}_0x4c23f2=_[_0xddfb('0x44')]({},_0x4c23f2,_0x2860c3[_0xddfb('0x46')]);return _0x34fd05[_0xddfb('0x56')](_0x4c23f2);}})[_0xddfb('0x2b')](function(_0x4be7b3){if(_0x4be7b3){_0x363938=_0x4be7b3[_0xddfb('0x3d')];if(!_0x2860c3[_0xddfb('0x37')]['hasOwnProperty']('nolimit')){_0x4c23f2[_0xddfb('0x22')]=qs[_0xddfb('0x22')](_0x2860c3[_0xddfb('0x37')][_0xddfb('0x22')]);_0x4c23f2[_0xddfb('0x20')]=qs[_0xddfb('0x20')](_0x2860c3[_0xddfb('0x37')]['offset']);}return _0x34fd05[_0xddfb('0x56')](_0x4c23f2);}})[_0xddfb('0x2b')](function(_0x49bbca){if(_0x49bbca){return _0x49bbca?{'count':_0x363938,'rows':_0x49bbca}:null;}})[_0xddfb('0x2b')](respondWithResult(_0x2a9f8f,null))[_0xddfb('0x49')](handleError(_0x2a9f8f,null));}; \ No newline at end of file +var _0x090a=['sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../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','then','destroy','error','stack','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','find','create','update','body','getFields','findOne','SalesforceField','options','getSubjects','hasOwnProperty','getDescriptions','rimraf','zip-dir','moment','bluebird','mustache','path'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x090a,0xf3));var _0xa090=function(_0x1c2ffa,_0xf54977){_0x1c2ffa=_0x1c2ffa-0x0;var _0x5c05a5=_0x090a[_0x1c2ffa];return _0x5c05a5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa090('0x0'));var zipdir=require(_0xa090('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa090('0x2'));var BPromise=require(_0xa090('0x3'));var Mustache=require(_0xa090('0x4'));var util=require('util');var path=require(_0xa090('0x5'));var sox=require(_0xa090('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa090('0x7'));var _=require(_0xa090('0x8'));var squel=require(_0xa090('0x9'));var crypto=require(_0xa090('0xa'));var jsforce=require(_0xa090('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa090('0xc'));var querystring=require(_0xa090('0xd'));var Papa=require(_0xa090('0xe'));var Redis=require(_0xa090('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa090('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa090('0x11'));var logger=require(_0xa090('0x12'))(_0xa090('0x13'));var utils=require(_0xa090('0x14'));var config=require(_0xa090('0x15'));var licenseUtil=require(_0xa090('0x16'));var db=require(_0xa090('0x17'))['db'];function respondWithStatusCode(_0x3badbb,_0x583c01){_0x583c01=_0x583c01||0xcc;return function(_0x587b02){if(_0x587b02){return _0x3badbb[_0xa090('0x18')](_0x583c01);}return _0x3badbb[_0xa090('0x19')](_0x583c01)[_0xa090('0x1a')]();};}function respondWithResult(_0x35798e,_0x37ad8d){_0x37ad8d=_0x37ad8d||0xc8;return function(_0x31d268){if(_0x31d268){return _0x35798e[_0xa090('0x19')](_0x37ad8d)[_0xa090('0x1b')](_0x31d268);}};}function respondWithFilteredResult(_0xeaab9e,_0x54eb2b){return function(_0xc5fdf2){if(_0xc5fdf2){var _0x248d18=typeof _0x54eb2b[_0xa090('0x1c')]===_0xa090('0x1d')&&typeof _0x54eb2b[_0xa090('0x1e')]===_0xa090('0x1d');var _0x3ca9e8=_0xc5fdf2[_0xa090('0x1f')];var _0xb6a589=_0x248d18?0x0:_0x54eb2b[_0xa090('0x1c')];var _0x1ffb5b=_0x248d18?_0xc5fdf2[_0xa090('0x1f')]:_0x54eb2b[_0xa090('0x1c')]+_0x54eb2b['limit'];var _0x2f22ec;if(_0x1ffb5b>=_0x3ca9e8){_0x1ffb5b=_0x3ca9e8;_0x2f22ec=0xc8;}else{_0x2f22ec=0xce;}_0xeaab9e[_0xa090('0x19')](_0x2f22ec);return _0xeaab9e[_0xa090('0x20')](_0xa090('0x21'),_0xb6a589+'-'+_0x1ffb5b+'/'+_0x3ca9e8)[_0xa090('0x1b')](_0xc5fdf2);}return null;};}function patchUpdates(_0x5c883d){return function(_0x514c41){try{jsonpatch[_0xa090('0x22')](_0x514c41,_0x5c883d,!![]);}catch(_0x3cceb5){return BPromise[_0xa090('0x23')](_0x3cceb5);}return _0x514c41[_0xa090('0x24')]();};}function saveUpdates(_0x4529b2,_0x51acba){return function(_0x5bbb4e){if(_0x5bbb4e){return _0x5bbb4e['update'](_0x4529b2)[_0xa090('0x25')](function(_0x28bc77){return _0x28bc77;});}return null;};}function removeEntity(_0x3b96b3,_0x1d9c63){return function(_0x5f0278){if(_0x5f0278){return _0x5f0278[_0xa090('0x26')]()[_0xa090('0x25')](function(){_0x3b96b3[_0xa090('0x19')](0xcc)[_0xa090('0x1a')]();});}};}function handleEntityNotFound(_0x3687f4,_0x12d8f7){return function(_0x10c020){if(!_0x10c020){_0x3687f4[_0xa090('0x18')](0x194);}return _0x10c020;};}function handleError(_0x597b7a,_0x1e4680){_0x1e4680=_0x1e4680||0x1f4;return function(_0x128a5b){logger[_0xa090('0x27')](_0x128a5b[_0xa090('0x28')]);if(_0x128a5b[_0xa090('0x29')]){delete _0x128a5b['name'];}_0x597b7a[_0xa090('0x19')](_0x1e4680)[_0xa090('0x2a')](_0x128a5b);};}exports[_0xa090('0x2b')]=function(_0x58e4a6,_0xbd9c5c){var _0x567381={},_0x5255ca={},_0x552ead={'count':0x0,'rows':[]};var _0x3c659e=_[_0xa090('0x2c')](db[_0xa090('0x2d')][_0xa090('0x2e')],function(_0x4210a2){return{'name':_0x4210a2[_0xa090('0x2f')],'type':_0x4210a2[_0xa090('0x30')]['key']};});_0x5255ca['model']=_[_0xa090('0x2c')](_0x3c659e,_0xa090('0x29'));_0x5255ca[_0xa090('0x31')]=_[_0xa090('0x32')](_0x58e4a6[_0xa090('0x31')]);_0x5255ca[_0xa090('0x33')]=_['intersection'](_0x5255ca[_0xa090('0x34')],_0x5255ca[_0xa090('0x31')]);_0x567381[_0xa090('0x35')]=_[_0xa090('0x36')](_0x5255ca['model'],qs['fields'](_0x58e4a6['query'][_0xa090('0x37')]));_0x567381[_0xa090('0x35')]=_0x567381['attributes']['length']?_0x567381[_0xa090('0x35')]:_0x5255ca['model'];if(!_0x58e4a6[_0xa090('0x31')]['hasOwnProperty'](_0xa090('0x38'))){_0x567381['limit']=qs[_0xa090('0x1e')](_0x58e4a6[_0xa090('0x31')][_0xa090('0x1e')]);_0x567381[_0xa090('0x1c')]=qs['offset'](_0x58e4a6[_0xa090('0x31')][_0xa090('0x1c')]);}_0x567381[_0xa090('0x39')]=qs[_0xa090('0x3a')](_0x58e4a6['query'][_0xa090('0x3a')]);_0x567381[_0xa090('0x3b')]=qs[_0xa090('0x33')](_[_0xa090('0x3c')](_0x58e4a6[_0xa090('0x31')],_0x5255ca['filters']),_0x3c659e);if(_0x58e4a6['query'][_0xa090('0x3d')]){_0x567381[_0xa090('0x3b')]=_[_0xa090('0x3e')](_0x567381[_0xa090('0x3b')],{'$or':_[_0xa090('0x2c')](_0x3c659e,function(_0x438d8e){if(_0x438d8e[_0xa090('0x30')]!==_0xa090('0x3f')){var _0x47a587={};_0x47a587[_0x438d8e[_0xa090('0x29')]]={'$like':'%'+_0x58e4a6['query'][_0xa090('0x3d')]+'%'};return _0x47a587;}})});}_0x567381=_[_0xa090('0x3e')]({},_0x567381,_0x58e4a6['options']);var _0x3d5a93={'where':_0x567381['where']};return db[_0xa090('0x2d')][_0xa090('0x1f')](_0x3d5a93)['then'](function(_0x372944){_0x552ead[_0xa090('0x1f')]=_0x372944;if(_0x58e4a6[_0xa090('0x31')][_0xa090('0x40')]){_0x567381[_0xa090('0x41')]=[{'all':!![]}];}return db[_0xa090('0x2d')][_0xa090('0x42')](_0x567381);})['then'](function(_0x12ec14){_0x552ead[_0xa090('0x43')]=_0x12ec14;return _0x552ead;})[_0xa090('0x25')](respondWithFilteredResult(_0xbd9c5c,_0x567381))[_0xa090('0x44')](handleError(_0xbd9c5c,null));};exports[_0xa090('0x45')]=function(_0x2e923e,_0xbe9aa4){var _0x22bd8b={'raw':![],'where':{'id':_0x2e923e[_0xa090('0x46')]['id']}},_0x550e93={};_0x550e93['model']=_[_0xa090('0x32')](db[_0xa090('0x2d')]['rawAttributes']);_0x550e93[_0xa090('0x31')]=_[_0xa090('0x32')](_0x2e923e['query']);_0x550e93[_0xa090('0x33')]=_[_0xa090('0x36')](_0x550e93[_0xa090('0x34')],_0x550e93[_0xa090('0x31')]);_0x22bd8b[_0xa090('0x35')]=_['intersection'](_0x550e93[_0xa090('0x34')],qs['fields'](_0x2e923e[_0xa090('0x31')][_0xa090('0x37')]));_0x22bd8b[_0xa090('0x35')]=_0x22bd8b[_0xa090('0x35')][_0xa090('0x47')]?_0x22bd8b[_0xa090('0x35')]:_0x550e93[_0xa090('0x34')];if(_0x2e923e['query'][_0xa090('0x40')]){_0x22bd8b['include']=[{'all':!![]}];}_0x22bd8b=_[_0xa090('0x3e')]({},_0x22bd8b,_0x2e923e['options']);return db[_0xa090('0x2d')][_0xa090('0x48')](_0x22bd8b)[_0xa090('0x25')](handleEntityNotFound(_0xbe9aa4,null))[_0xa090('0x25')](respondWithResult(_0xbe9aa4,null))[_0xa090('0x44')](handleError(_0xbe9aa4,null));};exports[_0xa090('0x49')]=function(_0x1c9207,_0x48321c){return db[_0xa090('0x2d')][_0xa090('0x49')](_0x1c9207['body'],{})[_0xa090('0x25')](respondWithResult(_0x48321c,0xc9))['catch'](handleError(_0x48321c,null));};exports[_0xa090('0x4a')]=function(_0x272f49,_0x128482){if(_0x272f49[_0xa090('0x4b')]['id']){delete _0x272f49[_0xa090('0x4b')]['id'];}return db[_0xa090('0x2d')][_0xa090('0x48')]({'where':{'id':_0x272f49[_0xa090('0x46')]['id']}})['then'](handleEntityNotFound(_0x128482,null))['then'](saveUpdates(_0x272f49[_0xa090('0x4b')],null))[_0xa090('0x25')](respondWithResult(_0x128482,null))[_0xa090('0x44')](handleError(_0x128482,null));};exports['destroy']=function(_0x128d69,_0x57103b){return db[_0xa090('0x2d')][_0xa090('0x48')]({'where':{'id':_0x128d69[_0xa090('0x46')]['id']}})['then'](handleEntityNotFound(_0x57103b,null))[_0xa090('0x25')](removeEntity(_0x57103b,null))[_0xa090('0x44')](handleError(_0x57103b,null));};exports[_0xa090('0x4c')]=function(_0x5c17a5,_0x37c9e9,_0x32e7e8){var _0x15eb0b={};var _0x4b1b3a={};var _0x11dc93;var _0x40c8c1;return db[_0xa090('0x2d')][_0xa090('0x4d')]({'where':{'id':_0x5c17a5[_0xa090('0x46')]['id']}})['then'](handleEntityNotFound(_0x37c9e9,null))[_0xa090('0x25')](function(_0x4058d3){if(_0x4058d3){_0x11dc93=_0x4058d3;_0x4b1b3a['model']=_['keys'](db[_0xa090('0x4e')][_0xa090('0x2e')]);_0x4b1b3a[_0xa090('0x31')]=_['keys'](_0x5c17a5['query']);_0x4b1b3a['filters']=_[_0xa090('0x36')](_0x4b1b3a[_0xa090('0x34')],_0x4b1b3a['query']);_0x15eb0b[_0xa090('0x35')]=_[_0xa090('0x36')](_0x4b1b3a['model'],qs[_0xa090('0x37')](_0x5c17a5[_0xa090('0x31')]['fields']));_0x15eb0b[_0xa090('0x35')]=_0x15eb0b[_0xa090('0x35')][_0xa090('0x47')]?_0x15eb0b[_0xa090('0x35')]:_0x4b1b3a['model'];_0x15eb0b[_0xa090('0x39')]=qs[_0xa090('0x3a')](_0x5c17a5['query']['sort']);_0x15eb0b['where']=qs['filters'](_[_0xa090('0x3c')](_0x5c17a5[_0xa090('0x31')],_0x4b1b3a[_0xa090('0x33')]));if(_0x5c17a5[_0xa090('0x31')]['filter']){_0x15eb0b[_0xa090('0x3b')]=_[_0xa090('0x3e')](_0x15eb0b[_0xa090('0x3b')],{'$or':_[_0xa090('0x2c')](_0x15eb0b[_0xa090('0x35')],function(_0x22c889){var _0x266047={};_0x266047[_0x22c889]={'$like':'%'+_0x5c17a5[_0xa090('0x31')][_0xa090('0x3d')]+'%'};return _0x266047;})});}_0x15eb0b=_[_0xa090('0x3e')]({},_0x15eb0b,_0x5c17a5[_0xa090('0x4f')]);return _0x11dc93['getFields'](_0x15eb0b);}})['then'](function(_0x38db19){if(_0x38db19){_0x40c8c1=_0x38db19[_0xa090('0x47')];if(!_0x5c17a5[_0xa090('0x31')]['hasOwnProperty'](_0xa090('0x38'))){_0x15eb0b[_0xa090('0x1e')]=qs[_0xa090('0x1e')](_0x5c17a5[_0xa090('0x31')][_0xa090('0x1e')]);_0x15eb0b[_0xa090('0x1c')]=qs[_0xa090('0x1c')](_0x5c17a5[_0xa090('0x31')]['offset']);}return _0x11dc93[_0xa090('0x4c')](_0x15eb0b);}})[_0xa090('0x25')](function(_0x5563b5){if(_0x5563b5){return _0x5563b5?{'count':_0x40c8c1,'rows':_0x5563b5}:null;}})[_0xa090('0x25')](respondWithResult(_0x37c9e9,null))[_0xa090('0x44')](handleError(_0x37c9e9,null));};exports[_0xa090('0x50')]=function(_0x1f67bb,_0x125396,_0x355d0a){var _0x1de8d6={};var _0x4fa07f={};var _0x39eb61;var _0x99222f;return db[_0xa090('0x2d')][_0xa090('0x4d')]({'where':{'id':_0x1f67bb[_0xa090('0x46')]['id']}})[_0xa090('0x25')](handleEntityNotFound(_0x125396,null))[_0xa090('0x25')](function(_0x72f71d){if(_0x72f71d){_0x39eb61=_0x72f71d;_0x4fa07f['model']=_[_0xa090('0x32')](db[_0xa090('0x4e')]['rawAttributes']);_0x4fa07f['query']=_[_0xa090('0x32')](_0x1f67bb[_0xa090('0x31')]);_0x4fa07f[_0xa090('0x33')]=_['intersection'](_0x4fa07f[_0xa090('0x34')],_0x4fa07f['query']);_0x1de8d6[_0xa090('0x35')]=_[_0xa090('0x36')](_0x4fa07f[_0xa090('0x34')],qs[_0xa090('0x37')](_0x1f67bb['query'][_0xa090('0x37')]));_0x1de8d6[_0xa090('0x35')]=_0x1de8d6[_0xa090('0x35')][_0xa090('0x47')]?_0x1de8d6['attributes']:_0x4fa07f['model'];_0x1de8d6['order']=qs[_0xa090('0x3a')](_0x1f67bb[_0xa090('0x31')][_0xa090('0x3a')]);_0x1de8d6[_0xa090('0x3b')]=qs['filters'](_[_0xa090('0x3c')](_0x1f67bb[_0xa090('0x31')],_0x4fa07f[_0xa090('0x33')]));if(_0x1f67bb['query']['filter']){_0x1de8d6[_0xa090('0x3b')]=_[_0xa090('0x3e')](_0x1de8d6[_0xa090('0x3b')],{'$or':_[_0xa090('0x2c')](_0x1de8d6[_0xa090('0x35')],function(_0x532650){var _0x385480={};_0x385480[_0x532650]={'$like':'%'+_0x1f67bb[_0xa090('0x31')]['filter']+'%'};return _0x385480;})});}_0x1de8d6=_['merge']({},_0x1de8d6,_0x1f67bb[_0xa090('0x4f')]);return _0x39eb61[_0xa090('0x50')](_0x1de8d6);}})[_0xa090('0x25')](function(_0x3d4b9b){if(_0x3d4b9b){_0x99222f=_0x3d4b9b[_0xa090('0x47')];if(!_0x1f67bb[_0xa090('0x31')][_0xa090('0x51')](_0xa090('0x38'))){_0x1de8d6[_0xa090('0x1e')]=qs[_0xa090('0x1e')](_0x1f67bb[_0xa090('0x31')]['limit']);_0x1de8d6[_0xa090('0x1c')]=qs[_0xa090('0x1c')](_0x1f67bb[_0xa090('0x31')][_0xa090('0x1c')]);}return _0x39eb61['getSubjects'](_0x1de8d6);}})[_0xa090('0x25')](function(_0xa20a4d){if(_0xa20a4d){return _0xa20a4d?{'count':_0x99222f,'rows':_0xa20a4d}:null;}})[_0xa090('0x25')](respondWithResult(_0x125396,null))[_0xa090('0x44')](handleError(_0x125396,null));};exports['getDescriptions']=function(_0x268711,_0x1132e2,_0x18eb6a){var _0x65bfcb={};var _0x44884d={};var _0x4a4454;var _0x450672;return db[_0xa090('0x2d')][_0xa090('0x4d')]({'where':{'id':_0x268711[_0xa090('0x46')]['id']}})[_0xa090('0x25')](handleEntityNotFound(_0x1132e2,null))[_0xa090('0x25')](function(_0x44b61e){if(_0x44b61e){_0x4a4454=_0x44b61e;_0x44884d[_0xa090('0x34')]=_[_0xa090('0x32')](db[_0xa090('0x4e')][_0xa090('0x2e')]);_0x44884d[_0xa090('0x31')]=_[_0xa090('0x32')](_0x268711[_0xa090('0x31')]);_0x44884d[_0xa090('0x33')]=_[_0xa090('0x36')](_0x44884d[_0xa090('0x34')],_0x44884d[_0xa090('0x31')]);_0x65bfcb[_0xa090('0x35')]=_[_0xa090('0x36')](_0x44884d[_0xa090('0x34')],qs[_0xa090('0x37')](_0x268711['query']['fields']));_0x65bfcb[_0xa090('0x35')]=_0x65bfcb['attributes'][_0xa090('0x47')]?_0x65bfcb[_0xa090('0x35')]:_0x44884d['model'];_0x65bfcb[_0xa090('0x39')]=qs['sort'](_0x268711[_0xa090('0x31')][_0xa090('0x3a')]);_0x65bfcb[_0xa090('0x3b')]=qs[_0xa090('0x33')](_[_0xa090('0x3c')](_0x268711[_0xa090('0x31')],_0x44884d[_0xa090('0x33')]));if(_0x268711[_0xa090('0x31')][_0xa090('0x3d')]){_0x65bfcb[_0xa090('0x3b')]=_[_0xa090('0x3e')](_0x65bfcb[_0xa090('0x3b')],{'$or':_[_0xa090('0x2c')](_0x65bfcb[_0xa090('0x35')],function(_0x33414f){var _0x345444={};_0x345444[_0x33414f]={'$like':'%'+_0x268711[_0xa090('0x31')][_0xa090('0x3d')]+'%'};return _0x345444;})});}_0x65bfcb=_[_0xa090('0x3e')]({},_0x65bfcb,_0x268711[_0xa090('0x4f')]);return _0x4a4454[_0xa090('0x52')](_0x65bfcb);}})[_0xa090('0x25')](function(_0x2b224d){if(_0x2b224d){_0x450672=_0x2b224d[_0xa090('0x47')];if(!_0x268711['query'][_0xa090('0x51')](_0xa090('0x38'))){_0x65bfcb[_0xa090('0x1e')]=qs[_0xa090('0x1e')](_0x268711[_0xa090('0x31')][_0xa090('0x1e')]);_0x65bfcb['offset']=qs['offset'](_0x268711[_0xa090('0x31')][_0xa090('0x1c')]);}return _0x4a4454['getDescriptions'](_0x65bfcb);}})['then'](function(_0x1b8467){if(_0x1b8467){return _0x1b8467?{'count':_0x450672,'rows':_0x1b8467}:null;}})['then'](respondWithResult(_0x1132e2,null))[_0xa090('0x44')](handleError(_0x1132e2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index e8984ba..2a536d7 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 _0xaf0b=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SalesforceConfiguration','lodash'];(function(_0x17aa7a,_0x2be8e4){var _0x2321f8=function(_0x2324fc){while(--_0x2324fc){_0x17aa7a['push'](_0x17aa7a['shift']());}};_0x2321f8(++_0x2be8e4);}(_0xaf0b,0x133));var _0xbaf0=function(_0x2874cb,_0xfda63){_0x2874cb=_0x2874cb-0x0;var _0x12b107=_0xaf0b[_0x2874cb];return _0x12b107;};'use strict';var _=require(_0xbaf0('0x0'));var util=require(_0xbaf0('0x1'));var logger=require(_0xbaf0('0x2'))('api');var moment=require(_0xbaf0('0x3'));var BPromise=require(_0xbaf0('0x4'));var rp=require(_0xbaf0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbaf0('0x6'));var config=require(_0xbaf0('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xbaf0('0x8')]=function(_0x455bc0,_0x513c4a){return _0x455bc0[_0xbaf0('0x9')](_0xbaf0('0xa'),attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4452=['lodash','util','api','moment','request-promise','rimraf','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x141e4b,_0x465028){var _0x597e9f=function(_0x566b73){while(--_0x566b73){_0x141e4b['push'](_0x141e4b['shift']());}};_0x597e9f(++_0x465028);}(_0x4452,0x172));var _0x2445=function(_0x719487,_0x55818c){_0x719487=_0x719487-0x0;var _0x372c53=_0x4452[_0x719487];return _0x372c53;};'use strict';var _=require(_0x2445('0x0'));var util=require(_0x2445('0x1'));var logger=require('../../config/logger')(_0x2445('0x2'));var moment=require(_0x2445('0x3'));var BPromise=require('bluebird');var rp=require(_0x2445('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2445('0x5'));var config=require('../../config/environment');var attributes=require(_0x2445('0x6'));module['exports']=function(_0x243540,_0x151b41){return _0x243540[_0x2445('0x7')](_0x2445('0x8'),attributes,{'tableName':_0x2445('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 956818b..ad49bdd 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 _0x9ffc=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment'];(function(_0x3b8b00,_0x41a01b){var _0x585ce3=function(_0x341c00){while(--_0x341c00){_0x3b8b00['push'](_0x3b8b00['shift']());}};_0x585ce3(++_0x41a01b);}(_0x9ffc,0x70));var _0xc9ff=function(_0x28d225,_0x43be18){_0x28d225=_0x28d225-0x0;var _0x1f79e1=_0x9ffc[_0x28d225];return _0x1f79e1;};'use strict';var _=require(_0xc9ff('0x0'));var util=require(_0xc9ff('0x1'));var moment=require(_0xc9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9ff('0x3'));var fs=require('fs');var Redis=require(_0xc9ff('0x4'));var db=require(_0xc9ff('0x5'))['db'];var utils=require(_0xc9ff('0x6'));var logger=require('../../config/logger')(_0xc9ff('0x7'));var config=require(_0xc9ff('0x8'));var jayson=require(_0xc9ff('0x9'));var client=jayson[_0xc9ff('0xa')][_0xc9ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55331f,_0xb1a9b8,_0x502e8a){return new BPromise(function(_0x1f4767,_0x3cc4e1){return client[_0xc9ff('0xc')](_0x55331f,_0x502e8a)[_0xc9ff('0xd')](function(_0x1b0e7d){logger[_0xc9ff('0xe')](_0xc9ff('0xf'),_0xb1a9b8,_0xc9ff('0x10'));logger['debug'](_0xc9ff('0x11'),_0xb1a9b8,_0xc9ff('0x10'),JSON['stringify'](_0x1b0e7d));if(_0x1b0e7d[_0xc9ff('0x12')]){if(_0x1b0e7d[_0xc9ff('0x12')][_0xc9ff('0x13')]===0x1f4){logger[_0xc9ff('0x12')](_0xc9ff('0xf'),_0xb1a9b8,_0x1b0e7d[_0xc9ff('0x12')][_0xc9ff('0x14')]);return _0x3cc4e1(_0x1b0e7d[_0xc9ff('0x12')][_0xc9ff('0x14')]);}logger[_0xc9ff('0x12')](_0xc9ff('0xf'),_0xb1a9b8,_0x1b0e7d[_0xc9ff('0x12')][_0xc9ff('0x14')]);return _0x1f4767(_0x1b0e7d['error'][_0xc9ff('0x14')]);}else{logger[_0xc9ff('0xe')](_0xc9ff('0xf'),_0xb1a9b8,_0xc9ff('0x10'));_0x1f4767(_0x1b0e7d[_0xc9ff('0x15')][_0xc9ff('0x14')]);}})[_0xc9ff('0x16')](function(_0x4a9321){logger['error'](_0xc9ff('0xf'),_0xb1a9b8,_0x4a9321);_0x3cc4e1(_0x4a9321);});});} \ No newline at end of file +var _0x6b82=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug'];(function(_0x534912,_0x4c124e){var _0x4ba826=function(_0x270aee){while(--_0x270aee){_0x534912['push'](_0x534912['shift']());}};_0x4ba826(++_0x4c124e);}(_0x6b82,0x161));var _0x26b8=function(_0x488814,_0x3fec59){_0x488814=_0x488814-0x0;var _0x58138b=_0x6b82[_0x488814];return _0x58138b;};'use strict';var _=require(_0x26b8('0x0'));var util=require(_0x26b8('0x1'));var moment=require('moment');var BPromise=require(_0x26b8('0x2'));var rs=require(_0x26b8('0x3'));var fs=require('fs');var Redis=require(_0x26b8('0x4'));var db=require(_0x26b8('0x5'))['db'];var utils=require(_0x26b8('0x6'));var logger=require(_0x26b8('0x7'))(_0x26b8('0x8'));var config=require(_0x26b8('0x9'));var jayson=require(_0x26b8('0xa'));var client=jayson['client'][_0x26b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39a97d,_0x4dd1d4,_0x992072){return new BPromise(function(_0x56ad15,_0x21fd3a){return client[_0x26b8('0xc')](_0x39a97d,_0x992072)['then'](function(_0x41a910){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x4dd1d4,_0x26b8('0xd'));logger[_0x26b8('0xe')](_0x26b8('0xf'),_0x4dd1d4,_0x26b8('0xd'),JSON[_0x26b8('0x10')](_0x41a910));if(_0x41a910['error']){if(_0x41a910[_0x26b8('0x11')][_0x26b8('0x12')]===0x1f4){logger[_0x26b8('0x11')](_0x26b8('0x13'),_0x4dd1d4,_0x41a910[_0x26b8('0x11')][_0x26b8('0x14')]);return _0x21fd3a(_0x41a910[_0x26b8('0x11')][_0x26b8('0x14')]);}logger[_0x26b8('0x11')](_0x26b8('0x13'),_0x4dd1d4,_0x41a910[_0x26b8('0x11')][_0x26b8('0x14')]);return _0x56ad15(_0x41a910[_0x26b8('0x11')][_0x26b8('0x14')]);}else{logger[_0x26b8('0x15')](_0x26b8('0x13'),_0x4dd1d4,_0x26b8('0xd'));_0x56ad15(_0x41a910['result'][_0x26b8('0x14')]);}})[_0x26b8('0x16')](function(_0x3b5260){logger[_0x26b8('0x11')](_0x26b8('0x13'),_0x4dd1d4,_0x3b5260);_0x21fd3a(_0x3b5260);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 0956311..dfb347f 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 _0xa2e6=['index','/:id','put','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x1c8975,_0x409d8c){var _0x1fea7c=function(_0x42fb65){while(--_0x42fb65){_0x1c8975['push'](_0x1c8975['shift']());}};_0x1fea7c(++_0x409d8c);}(_0xa2e6,0x121));var _0x6a2e=function(_0x4ab289,_0x5e4065){_0x4ab289=_0x4ab289-0x0;var _0x4e9710=_0xa2e6[_0x4ab289];return _0x4e9710;};'use strict';var multer=require(_0x6a2e('0x0'));var util=require(_0x6a2e('0x1'));var path=require(_0x6a2e('0x2'));var timeout=require(_0x6a2e('0x3'));var express=require('express');var router=express[_0x6a2e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6a2e('0x5'));var interaction=require(_0x6a2e('0x6'));var config=require(_0x6a2e('0x7'));var controller=require(_0x6a2e('0x8'));router[_0x6a2e('0x9')]('/',auth[_0x6a2e('0xa')](),controller[_0x6a2e('0xb')]);router[_0x6a2e('0x9')](_0x6a2e('0xc'),auth[_0x6a2e('0xa')](),controller['show']);router['post']('/',auth[_0x6a2e('0xa')](),controller['create']);router[_0x6a2e('0xd')](_0x6a2e('0xc'),auth[_0x6a2e('0xa')](),controller['update']);router['delete'](_0x6a2e('0xc'),auth[_0x6a2e('0xa')](),controller[_0x6a2e('0xe')]);module['exports']=router; \ No newline at end of file +var _0xfff3=['Router','fs-extra','../../components/interaction/service','./intSalesforceField.controller','isAuthenticated','index','get','show','post','create','put','update','delete','/:id','destroy','util','path'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0xfff3,0x152));var _0x3fff=function(_0x416055,_0x45a9af){_0x416055=_0x416055-0x0;var _0x5d6f29=_0xfff3[_0x416055];return _0x5d6f29;};'use strict';var multer=require('multer');var util=require(_0x3fff('0x0'));var path=require(_0x3fff('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3fff('0x2')]();var fs_extra=require(_0x3fff('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x3fff('0x4'));var config=require('../../config/environment');var controller=require(_0x3fff('0x5'));router['get']('/',auth[_0x3fff('0x6')](),controller[_0x3fff('0x7')]);router[_0x3fff('0x8')]('/:id',auth[_0x3fff('0x6')](),controller[_0x3fff('0x9')]);router[_0x3fff('0xa')]('/',auth[_0x3fff('0x6')](),controller[_0x3fff('0xb')]);router[_0x3fff('0xc')]('/:id',auth[_0x3fff('0x6')](),controller[_0x3fff('0xd')]);router[_0x3fff('0xe')](_0x3fff('0xf'),auth[_0x3fff('0x6')](),controller[_0x3fff('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 152aa93..d68f293 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 _0x5251=['string','variable','keyValue','picklist','STRING','customVariable','exports','ENUM'];(function(_0x58b647,_0xe24336){var _0x233b67=function(_0x17eec7){while(--_0x17eec7){_0x58b647['push'](_0x58b647['shift']());}};_0x233b67(++_0xe24336);}(_0x5251,0x166));var _0x1525=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5251[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x1525('0x0')]={'type':{'type':Sequelize[_0x1525('0x1')](_0x1525('0x2'),_0x1525('0x3'),'customVariable',_0x1525('0x4'),_0x1525('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x1525('0x6')]},'key':{'type':Sequelize[_0x1525('0x6')]},'keyType':{'type':Sequelize[_0x1525('0x1')](_0x1525('0x2'),_0x1525('0x3'),_0x1525('0x7'))},'keyContent':{'type':Sequelize[_0x1525('0x6')]},'idField':{'type':Sequelize[_0x1525('0x6')]},'variableName':{'type':Sequelize[_0x1525('0x6')]}}; \ No newline at end of file +var _0xc59d=['variable','exports','ENUM','customVariable','picklist','string','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xc59d,0x9b));var _0xdc59=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc59d[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0xdc59('0x0')]={'type':{'type':Sequelize[_0xdc59('0x1')]('string','variable',_0xdc59('0x2'),'keyValue',_0xdc59('0x3')),'defaultValue':_0xdc59('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdc59('0x5')]},'keyType':{'type':Sequelize[_0xdc59('0x1')]('string',_0xdc59('0x6'),_0xdc59('0x2'))},'keyContent':{'type':Sequelize[_0xdc59('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xdc59('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index b7b3019..847a921 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 _0xeb29=['set','Content-Range','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','type','includeAll','include','findAll','rows','catch','show','params','keys','SalesforceField','length','options','find','body','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/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count'];(function(_0x129229,_0x504e5e){var _0x487a4a=function(_0x5a25c9){while(--_0x5a25c9){_0x129229['push'](_0x129229['shift']());}};_0x487a4a(++_0x504e5e);}(_0xeb29,0x112));var _0x9eb2=function(_0x5c4003,_0x312208){_0x5c4003=_0x5c4003-0x0;var _0x1e6238=_0xeb29[_0x5c4003];return _0x1e6238;};'use strict';var emlformat=require(_0x9eb2('0x0'));var rimraf=require(_0x9eb2('0x1'));var zipdir=require(_0x9eb2('0x2'));var jsonpatch=require(_0x9eb2('0x3'));var rp=require('request-promise');var moment=require(_0x9eb2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9eb2('0x5'));var util=require(_0x9eb2('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x9eb2('0x7'));var ejs=require(_0x9eb2('0x8'));var fs=require('fs');var fs_extra=require(_0x9eb2('0x9'));var _=require(_0x9eb2('0xa'));var squel=require(_0x9eb2('0xb'));var crypto=require(_0x9eb2('0xc'));var jsforce=require(_0x9eb2('0xd'));var deskjs=require(_0x9eb2('0xe'));var toCsv=require(_0x9eb2('0x7'));var querystring=require(_0x9eb2('0xf'));var Papa=require(_0x9eb2('0x10'));var Redis=require(_0x9eb2('0x11'));var authService=require(_0x9eb2('0x12'));var qs=require(_0x9eb2('0x13'));var as=require(_0x9eb2('0x14'));var hardwareService=require(_0x9eb2('0x15'));var logger=require(_0x9eb2('0x16'))(_0x9eb2('0x17'));var utils=require(_0x9eb2('0x18'));var config=require(_0x9eb2('0x19'));var licenseUtil=require(_0x9eb2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x488d57,_0x554ebb){_0x554ebb=_0x554ebb||0xcc;return function(_0x21194f){if(_0x21194f){return _0x488d57['sendStatus'](_0x554ebb);}return _0x488d57[_0x9eb2('0x1b')](_0x554ebb)[_0x9eb2('0x1c')]();};}function respondWithResult(_0x33a2ea,_0x429dba){_0x429dba=_0x429dba||0xc8;return function(_0x54b26b){if(_0x54b26b){return _0x33a2ea[_0x9eb2('0x1b')](_0x429dba)[_0x9eb2('0x1d')](_0x54b26b);}};}function respondWithFilteredResult(_0x387c77,_0x3ea77f){return function(_0x58d271){if(_0x58d271){var _0x3c2db5=typeof _0x3ea77f[_0x9eb2('0x1e')]===_0x9eb2('0x1f')&&typeof _0x3ea77f[_0x9eb2('0x20')]==='undefined';var _0x4c2a89=_0x58d271[_0x9eb2('0x21')];var _0x4cad36=_0x3c2db5?0x0:_0x3ea77f[_0x9eb2('0x1e')];var _0xe26647=_0x3c2db5?_0x58d271[_0x9eb2('0x21')]:_0x3ea77f[_0x9eb2('0x1e')]+_0x3ea77f['limit'];var _0x261f04;if(_0xe26647>=_0x4c2a89){_0xe26647=_0x4c2a89;_0x261f04=0xc8;}else{_0x261f04=0xce;}_0x387c77[_0x9eb2('0x1b')](_0x261f04);return _0x387c77[_0x9eb2('0x22')](_0x9eb2('0x23'),_0x4cad36+'-'+_0xe26647+'/'+_0x4c2a89)[_0x9eb2('0x1d')](_0x58d271);}return null;};}function patchUpdates(_0x250f98){return function(_0x26e9b0){try{jsonpatch[_0x9eb2('0x24')](_0x26e9b0,_0x250f98,!![]);}catch(_0x4da1f1){return BPromise[_0x9eb2('0x25')](_0x4da1f1);}return _0x26e9b0['save']();};}function saveUpdates(_0x381054,_0x1620e7){return function(_0x3933d2){if(_0x3933d2){return _0x3933d2[_0x9eb2('0x26')](_0x381054)['then'](function(_0x3bd858){return _0x3bd858;});}return null;};}function removeEntity(_0x36f318,_0x2df3f6){return function(_0x5264a7){if(_0x5264a7){return _0x5264a7[_0x9eb2('0x27')]()[_0x9eb2('0x28')](function(){_0x36f318[_0x9eb2('0x1b')](0xcc)[_0x9eb2('0x1c')]();});}};}function handleEntityNotFound(_0x3f2304,_0x272125){return function(_0x5e3e86){if(!_0x5e3e86){_0x3f2304[_0x9eb2('0x29')](0x194);}return _0x5e3e86;};}function handleError(_0x7b8051,_0x52663e){_0x52663e=_0x52663e||0x1f4;return function(_0x59aecb){logger[_0x9eb2('0x2a')](_0x59aecb[_0x9eb2('0x2b')]);if(_0x59aecb[_0x9eb2('0x2c')]){delete _0x59aecb['name'];}_0x7b8051[_0x9eb2('0x1b')](_0x52663e)[_0x9eb2('0x2d')](_0x59aecb);};}exports[_0x9eb2('0x2e')]=function(_0x3f52e0,_0x43d6e6){var _0x5e8d24={},_0x2c6158={},_0x58ef1d={'count':0x0,'rows':[]};var _0x3b2e66=_['map'](db['SalesforceField'][_0x9eb2('0x2f')],function(_0x3d4514){return{'name':_0x3d4514[_0x9eb2('0x30')],'type':_0x3d4514['type']['key']};});_0x2c6158[_0x9eb2('0x31')]=_[_0x9eb2('0x32')](_0x3b2e66,_0x9eb2('0x2c'));_0x2c6158[_0x9eb2('0x33')]=_['keys'](_0x3f52e0['query']);_0x2c6158[_0x9eb2('0x34')]=_['intersection'](_0x2c6158['model'],_0x2c6158[_0x9eb2('0x33')]);_0x5e8d24[_0x9eb2('0x35')]=_[_0x9eb2('0x36')](_0x2c6158[_0x9eb2('0x31')],qs['fields'](_0x3f52e0['query'][_0x9eb2('0x37')]));_0x5e8d24['attributes']=_0x5e8d24[_0x9eb2('0x35')]['length']?_0x5e8d24['attributes']:_0x2c6158['model'];if(!_0x3f52e0['query'][_0x9eb2('0x38')](_0x9eb2('0x39'))){_0x5e8d24[_0x9eb2('0x20')]=qs[_0x9eb2('0x20')](_0x3f52e0['query']['limit']);_0x5e8d24[_0x9eb2('0x1e')]=qs[_0x9eb2('0x1e')](_0x3f52e0['query'][_0x9eb2('0x1e')]);}_0x5e8d24[_0x9eb2('0x3a')]=qs['sort'](_0x3f52e0['query'][_0x9eb2('0x3b')]);_0x5e8d24['where']=qs[_0x9eb2('0x34')](_[_0x9eb2('0x3c')](_0x3f52e0[_0x9eb2('0x33')],_0x2c6158[_0x9eb2('0x34')]),_0x3b2e66);if(_0x3f52e0[_0x9eb2('0x33')][_0x9eb2('0x3d')]){_0x5e8d24['where']=_[_0x9eb2('0x3e')](_0x5e8d24['where'],{'$or':_[_0x9eb2('0x32')](_0x3b2e66,function(_0x1d3eb7){if(_0x1d3eb7[_0x9eb2('0x3f')]!=='VIRTUAL'){var _0x2fc78c={};_0x2fc78c[_0x1d3eb7['name']]={'$like':'%'+_0x3f52e0[_0x9eb2('0x33')]['filter']+'%'};return _0x2fc78c;}})});}_0x5e8d24=_[_0x9eb2('0x3e')]({},_0x5e8d24,_0x3f52e0['options']);var _0x59e581={'where':_0x5e8d24['where']};return db['SalesforceField'][_0x9eb2('0x21')](_0x59e581)['then'](function(_0x30fbad){_0x58ef1d[_0x9eb2('0x21')]=_0x30fbad;if(_0x3f52e0[_0x9eb2('0x33')][_0x9eb2('0x40')]){_0x5e8d24[_0x9eb2('0x41')]=[{'all':!![]}];}return db['SalesforceField'][_0x9eb2('0x42')](_0x5e8d24);})[_0x9eb2('0x28')](function(_0x2d4555){_0x58ef1d[_0x9eb2('0x43')]=_0x2d4555;return _0x58ef1d;})[_0x9eb2('0x28')](respondWithFilteredResult(_0x43d6e6,_0x5e8d24))[_0x9eb2('0x44')](handleError(_0x43d6e6,null));};exports[_0x9eb2('0x45')]=function(_0x51c392,_0x206e5e){var _0x1979d9={'raw':!![],'where':{'id':_0x51c392[_0x9eb2('0x46')]['id']}},_0x449008={};_0x449008[_0x9eb2('0x31')]=_[_0x9eb2('0x47')](db[_0x9eb2('0x48')]['rawAttributes']);_0x449008[_0x9eb2('0x33')]=_[_0x9eb2('0x47')](_0x51c392[_0x9eb2('0x33')]);_0x449008[_0x9eb2('0x34')]=_['intersection'](_0x449008[_0x9eb2('0x31')],_0x449008[_0x9eb2('0x33')]);_0x1979d9[_0x9eb2('0x35')]=_[_0x9eb2('0x36')](_0x449008[_0x9eb2('0x31')],qs[_0x9eb2('0x37')](_0x51c392[_0x9eb2('0x33')][_0x9eb2('0x37')]));_0x1979d9['attributes']=_0x1979d9[_0x9eb2('0x35')][_0x9eb2('0x49')]?_0x1979d9[_0x9eb2('0x35')]:_0x449008[_0x9eb2('0x31')];if(_0x51c392[_0x9eb2('0x33')][_0x9eb2('0x40')]){_0x1979d9[_0x9eb2('0x41')]=[{'all':!![]}];}_0x1979d9=_['merge']({},_0x1979d9,_0x51c392[_0x9eb2('0x4a')]);return db[_0x9eb2('0x48')][_0x9eb2('0x4b')](_0x1979d9)[_0x9eb2('0x28')](handleEntityNotFound(_0x206e5e,null))[_0x9eb2('0x28')](respondWithResult(_0x206e5e,null))['catch'](handleError(_0x206e5e,null));};exports['create']=function(_0x290142,_0x33c8a2){return db['SalesforceField']['create'](_0x290142[_0x9eb2('0x4c')],{})[_0x9eb2('0x28')](respondWithResult(_0x33c8a2,0xc9))[_0x9eb2('0x44')](handleError(_0x33c8a2,null));};exports[_0x9eb2('0x26')]=function(_0x2c6f32,_0x42d5b9){if(_0x2c6f32[_0x9eb2('0x4c')]['id']){delete _0x2c6f32[_0x9eb2('0x4c')]['id'];}return db[_0x9eb2('0x48')][_0x9eb2('0x4b')]({'where':{'id':_0x2c6f32[_0x9eb2('0x46')]['id']}})[_0x9eb2('0x28')](handleEntityNotFound(_0x42d5b9,null))[_0x9eb2('0x28')](saveUpdates(_0x2c6f32[_0x9eb2('0x4c')],null))[_0x9eb2('0x28')](respondWithResult(_0x42d5b9,null))[_0x9eb2('0x44')](handleError(_0x42d5b9,null));};exports[_0x9eb2('0x27')]=function(_0x525df9,_0x5d02ae){return db['SalesforceField'][_0x9eb2('0x4b')]({'where':{'id':_0x525df9[_0x9eb2('0x46')]['id']}})[_0x9eb2('0x28')](handleEntityNotFound(_0x5d02ae,null))[_0x9eb2('0x28')](removeEntity(_0x5d02ae,null))['catch'](handleError(_0x5d02ae,null));}; \ No newline at end of file +var _0x36d4=['status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','SalesforceField','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus'];(function(_0x592104,_0x52ea9f){var _0x259f67=function(_0x3a10a0){while(--_0x3a10a0){_0x592104['push'](_0x592104['shift']());}};_0x259f67(++_0x52ea9f);}(_0x36d4,0xc1));var _0x436d=function(_0x103466,_0x190bb5){_0x103466=_0x103466-0x0;var _0x416ba8=_0x36d4[_0x103466];return _0x416ba8;};'use strict';var emlformat=require(_0x436d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x436d('0x1'));var rp=require('request-promise');var moment=require(_0x436d('0x2'));var BPromise=require(_0x436d('0x3'));var Mustache=require(_0x436d('0x4'));var util=require('util');var path=require(_0x436d('0x5'));var sox=require(_0x436d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x436d('0x7'));var _=require(_0x436d('0x8'));var squel=require('squel');var crypto=require(_0x436d('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x436d('0xa'));var querystring=require(_0x436d('0xb'));var Papa=require(_0x436d('0xc'));var Redis=require(_0x436d('0xd'));var authService=require(_0x436d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x436d('0xf'));var hardwareService=require(_0x436d('0x10'));var logger=require('../../config/logger')(_0x436d('0x11'));var utils=require(_0x436d('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x18cea1,_0x5ce81f){_0x5ce81f=_0x5ce81f||0xcc;return function(_0x2b7bf1){if(_0x2b7bf1){return _0x18cea1[_0x436d('0x13')](_0x5ce81f);}return _0x18cea1[_0x436d('0x14')](_0x5ce81f)[_0x436d('0x15')]();};}function respondWithResult(_0x1a6f93,_0x5a7a60){_0x5a7a60=_0x5a7a60||0xc8;return function(_0x1511db){if(_0x1511db){return _0x1a6f93['status'](_0x5a7a60)[_0x436d('0x16')](_0x1511db);}};}function respondWithFilteredResult(_0x17e649,_0x2e7807){return function(_0x2e1f90){if(_0x2e1f90){var _0x1ae5ba=typeof _0x2e7807[_0x436d('0x17')]==='undefined'&&typeof _0x2e7807[_0x436d('0x18')]===_0x436d('0x19');var _0x5f19b0=_0x2e1f90[_0x436d('0x1a')];var _0x2c891d=_0x1ae5ba?0x0:_0x2e7807[_0x436d('0x17')];var _0x8bd18=_0x1ae5ba?_0x2e1f90[_0x436d('0x1a')]:_0x2e7807[_0x436d('0x17')]+_0x2e7807['limit'];var _0x25a754;if(_0x8bd18>=_0x5f19b0){_0x8bd18=_0x5f19b0;_0x25a754=0xc8;}else{_0x25a754=0xce;}_0x17e649[_0x436d('0x14')](_0x25a754);return _0x17e649[_0x436d('0x1b')](_0x436d('0x1c'),_0x2c891d+'-'+_0x8bd18+'/'+_0x5f19b0)['json'](_0x2e1f90);}return null;};}function patchUpdates(_0x5b4ccc){return function(_0xd530d6){try{jsonpatch[_0x436d('0x1d')](_0xd530d6,_0x5b4ccc,!![]);}catch(_0x41bc73){return BPromise[_0x436d('0x1e')](_0x41bc73);}return _0xd530d6[_0x436d('0x1f')]();};}function saveUpdates(_0x14d77f,_0x3b34d3){return function(_0x29bd0f){if(_0x29bd0f){return _0x29bd0f[_0x436d('0x20')](_0x14d77f)[_0x436d('0x21')](function(_0x30f31a){return _0x30f31a;});}return null;};}function removeEntity(_0x2dc5ed,_0x1f197c){return function(_0x205879){if(_0x205879){return _0x205879[_0x436d('0x22')]()[_0x436d('0x21')](function(){_0x2dc5ed[_0x436d('0x14')](0xcc)[_0x436d('0x15')]();});}};}function handleEntityNotFound(_0xa5eeea,_0x536eb2){return function(_0x398a70){if(!_0x398a70){_0xa5eeea[_0x436d('0x13')](0x194);}return _0x398a70;};}function handleError(_0x49811e,_0x1c90d4){_0x1c90d4=_0x1c90d4||0x1f4;return function(_0x1081e1){logger[_0x436d('0x23')](_0x1081e1['stack']);if(_0x1081e1[_0x436d('0x24')]){delete _0x1081e1['name'];}_0x49811e['status'](_0x1c90d4)[_0x436d('0x25')](_0x1081e1);};}exports[_0x436d('0x26')]=function(_0x56344b,_0x2effb5){var _0x4c407e={},_0x2eec37={},_0x5336c9={'count':0x0,'rows':[]};var _0x5cf2ac=_[_0x436d('0x27')](db[_0x436d('0x28')][_0x436d('0x29')],function(_0x3796ce){return{'name':_0x3796ce[_0x436d('0x2a')],'type':_0x3796ce[_0x436d('0x2b')][_0x436d('0x2c')]};});_0x2eec37[_0x436d('0x2d')]=_[_0x436d('0x27')](_0x5cf2ac,_0x436d('0x24'));_0x2eec37[_0x436d('0x2e')]=_['keys'](_0x56344b[_0x436d('0x2e')]);_0x2eec37[_0x436d('0x2f')]=_[_0x436d('0x30')](_0x2eec37['model'],_0x2eec37['query']);_0x4c407e[_0x436d('0x31')]=_[_0x436d('0x30')](_0x2eec37['model'],qs['fields'](_0x56344b[_0x436d('0x2e')][_0x436d('0x32')]));_0x4c407e[_0x436d('0x31')]=_0x4c407e[_0x436d('0x31')][_0x436d('0x33')]?_0x4c407e['attributes']:_0x2eec37[_0x436d('0x2d')];if(!_0x56344b[_0x436d('0x2e')]['hasOwnProperty'](_0x436d('0x34'))){_0x4c407e[_0x436d('0x18')]=qs[_0x436d('0x18')](_0x56344b[_0x436d('0x2e')][_0x436d('0x18')]);_0x4c407e[_0x436d('0x17')]=qs['offset'](_0x56344b['query'][_0x436d('0x17')]);}_0x4c407e[_0x436d('0x35')]=qs['sort'](_0x56344b[_0x436d('0x2e')][_0x436d('0x36')]);_0x4c407e[_0x436d('0x37')]=qs[_0x436d('0x2f')](_[_0x436d('0x38')](_0x56344b[_0x436d('0x2e')],_0x2eec37[_0x436d('0x2f')]),_0x5cf2ac);if(_0x56344b['query'][_0x436d('0x39')]){_0x4c407e[_0x436d('0x37')]=_['merge'](_0x4c407e[_0x436d('0x37')],{'$or':_[_0x436d('0x27')](_0x5cf2ac,function(_0x44ffb9){if(_0x44ffb9[_0x436d('0x2b')]!==_0x436d('0x3a')){var _0x436c17={};_0x436c17[_0x44ffb9[_0x436d('0x24')]]={'$like':'%'+_0x56344b['query']['filter']+'%'};return _0x436c17;}})});}_0x4c407e=_[_0x436d('0x3b')]({},_0x4c407e,_0x56344b['options']);var _0x4e3396={'where':_0x4c407e[_0x436d('0x37')]};return db[_0x436d('0x28')]['count'](_0x4e3396)[_0x436d('0x21')](function(_0x56bc4e){_0x5336c9[_0x436d('0x1a')]=_0x56bc4e;if(_0x56344b[_0x436d('0x2e')][_0x436d('0x3c')]){_0x4c407e[_0x436d('0x3d')]=[{'all':!![]}];}return db[_0x436d('0x28')][_0x436d('0x3e')](_0x4c407e);})[_0x436d('0x21')](function(_0x423607){_0x5336c9[_0x436d('0x3f')]=_0x423607;return _0x5336c9;})[_0x436d('0x21')](respondWithFilteredResult(_0x2effb5,_0x4c407e))['catch'](handleError(_0x2effb5,null));};exports['show']=function(_0x16f26b,_0x35ab2f){var _0x34418b={'raw':!![],'where':{'id':_0x16f26b[_0x436d('0x40')]['id']}},_0x72e900={};_0x72e900[_0x436d('0x2d')]=_[_0x436d('0x41')](db[_0x436d('0x28')][_0x436d('0x29')]);_0x72e900['query']=_['keys'](_0x16f26b[_0x436d('0x2e')]);_0x72e900[_0x436d('0x2f')]=_[_0x436d('0x30')](_0x72e900['model'],_0x72e900[_0x436d('0x2e')]);_0x34418b[_0x436d('0x31')]=_[_0x436d('0x30')](_0x72e900['model'],qs['fields'](_0x16f26b['query'][_0x436d('0x32')]));_0x34418b['attributes']=_0x34418b[_0x436d('0x31')][_0x436d('0x33')]?_0x34418b[_0x436d('0x31')]:_0x72e900[_0x436d('0x2d')];if(_0x16f26b[_0x436d('0x2e')][_0x436d('0x3c')]){_0x34418b[_0x436d('0x3d')]=[{'all':!![]}];}_0x34418b=_[_0x436d('0x3b')]({},_0x34418b,_0x16f26b[_0x436d('0x42')]);return db[_0x436d('0x28')][_0x436d('0x43')](_0x34418b)[_0x436d('0x21')](handleEntityNotFound(_0x35ab2f,null))[_0x436d('0x21')](respondWithResult(_0x35ab2f,null))[_0x436d('0x44')](handleError(_0x35ab2f,null));};exports[_0x436d('0x45')]=function(_0x5f29b2,_0x71f42f){return db[_0x436d('0x28')][_0x436d('0x45')](_0x5f29b2[_0x436d('0x46')],{})[_0x436d('0x21')](respondWithResult(_0x71f42f,0xc9))[_0x436d('0x44')](handleError(_0x71f42f,null));};exports[_0x436d('0x20')]=function(_0x183ab5,_0x57d16f){if(_0x183ab5['body']['id']){delete _0x183ab5['body']['id'];}return db['SalesforceField'][_0x436d('0x43')]({'where':{'id':_0x183ab5[_0x436d('0x40')]['id']}})[_0x436d('0x21')](handleEntityNotFound(_0x57d16f,null))[_0x436d('0x21')](saveUpdates(_0x183ab5[_0x436d('0x46')],null))['then'](respondWithResult(_0x57d16f,null))[_0x436d('0x44')](handleError(_0x57d16f,null));};exports[_0x436d('0x22')]=function(_0x4a0b4c,_0xa1f64a){return db['SalesforceField'][_0x436d('0x43')]({'where':{'id':_0x4a0b4c[_0x436d('0x40')]['id']}})['then'](handleEntityNotFound(_0xa1f64a,null))['then'](removeEntity(_0xa1f64a,null))[_0x436d('0x44')](handleError(_0xa1f64a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index fbf085e..7a95611 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 _0xe668=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x144ae5,_0x59b330){var _0x10daab=function(_0x385ec0){while(--_0x385ec0){_0x144ae5['push'](_0x144ae5['shift']());}};_0x10daab(++_0x59b330);}(_0xe668,0x19c));var _0x8e66=function(_0x53361f,_0x3b2cb6){_0x53361f=_0x53361f-0x0;var _0x279237=_0xe668[_0x53361f];return _0x279237;};'use strict';var _=require(_0x8e66('0x0'));var util=require(_0x8e66('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8e66('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e66('0x3'));var rimraf=require(_0x8e66('0x4'));var config=require(_0x8e66('0x5'));var attributes=require(_0x8e66('0x6'));module[_0x8e66('0x7')]=function(_0x283496,_0x29e451){return _0x283496[_0x8e66('0x8')](_0x8e66('0x9'),attributes,{'tableName':_0x8e66('0xa'),'paranoid':![],'indexes':[{'name':_0x8e66('0xb'),'fields':[_0x8e66('0xc'),_0x8e66('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc085=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash'];(function(_0x49aa7d,_0x5d46d8){var _0xdd0d26=function(_0x159df7){while(--_0x159df7){_0x49aa7d['push'](_0x49aa7d['shift']());}};_0xdd0d26(++_0x5d46d8);}(_0xc085,0x1a3));var _0x5c08=function(_0x734685,_0x321b40){_0x734685=_0x734685-0x0;var _0x59eb29=_0xc085[_0x734685];return _0x59eb29;};'use strict';var _=require(_0x5c08('0x0'));var util=require('util');var logger=require(_0x5c08('0x1'))(_0x5c08('0x2'));var moment=require(_0x5c08('0x3'));var BPromise=require(_0x5c08('0x4'));var rp=require(_0x5c08('0x5'));var fs=require('fs');var path=require(_0x5c08('0x6'));var rimraf=require(_0x5c08('0x7'));var config=require(_0x5c08('0x8'));var attributes=require(_0x5c08('0x9'));module['exports']=function(_0x3a4162,_0x4a1294){return _0x3a4162['define']('SalesforceField',attributes,{'tableName':_0x5c08('0xa'),'paranoid':![],'indexes':[{'name':_0x5c08('0xb'),'fields':[_0x5c08('0xc'),_0x5c08('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index e364b9f..0e0c3ba 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 _0x48a2=['code','SalesforceField,\x20%s,\x20%s','message','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x48a2,0x1e8));var _0x248a=function(_0x5f2d31,_0x4a7572){_0x5f2d31=_0x5f2d31-0x0;var _0x39f6e8=_0x48a2[_0x5f2d31];return _0x39f6e8;};'use strict';var _=require(_0x248a('0x0'));var util=require(_0x248a('0x1'));var moment=require('moment');var BPromise=require(_0x248a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x248a('0x3'));var db=require(_0x248a('0x4'))['db'];var utils=require(_0x248a('0x5'));var logger=require(_0x248a('0x6'))(_0x248a('0x7'));var config=require('../../config/environment');var jayson=require(_0x248a('0x8'));var client=jayson['client'][_0x248a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16db45,_0x8745dd,_0x254a99){return new BPromise(function(_0x4965d8,_0x3002fc){return client[_0x248a('0xa')](_0x16db45,_0x254a99)[_0x248a('0xb')](function(_0x2ee63f){logger[_0x248a('0xc')]('SalesforceField,\x20%s,\x20%s',_0x8745dd,'request\x20sent');logger[_0x248a('0xd')](_0x248a('0xe'),_0x8745dd,_0x248a('0xf'),JSON[_0x248a('0x10')](_0x2ee63f));if(_0x2ee63f[_0x248a('0x11')]){if(_0x2ee63f[_0x248a('0x11')][_0x248a('0x12')]===0x1f4){logger['error'](_0x248a('0x13'),_0x8745dd,_0x2ee63f[_0x248a('0x11')][_0x248a('0x14')]);return _0x3002fc(_0x2ee63f['error'][_0x248a('0x14')]);}logger['error'](_0x248a('0x13'),_0x8745dd,_0x2ee63f[_0x248a('0x11')][_0x248a('0x14')]);return _0x4965d8(_0x2ee63f['error'][_0x248a('0x14')]);}else{logger[_0x248a('0xc')](_0x248a('0x13'),_0x8745dd,'request\x20sent');_0x4965d8(_0x2ee63f['result'][_0x248a('0x14')]);}})[_0x248a('0x15')](function(_0x2aa4d1){logger[_0x248a('0x11')]('SalesforceField,\x20%s,\x20%s',_0x8745dd,_0x2aa4d1);_0x3002fc(_0x2aa4d1);});});} \ No newline at end of file +var _0x14b5=['error','message','SalesforceField,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x15059a,_0x30fbe7){var _0x2e9a84=function(_0x692840){while(--_0x692840){_0x15059a['push'](_0x15059a['shift']());}};_0x2e9a84(++_0x30fbe7);}(_0x14b5,0x15b));var _0x514b=function(_0x2017e4,_0x36b3c4){_0x2017e4=_0x2017e4-0x0;var _0x408beb=_0x14b5[_0x2017e4];return _0x408beb;};'use strict';var _=require(_0x514b('0x0'));var util=require('util');var moment=require(_0x514b('0x1'));var BPromise=require(_0x514b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x514b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x514b('0x4'));var config=require(_0x514b('0x5'));var jayson=require(_0x514b('0x6'));var client=jayson[_0x514b('0x7')][_0x514b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1839ad,_0x550acc,_0x3f17f3){return new BPromise(function(_0x351dad,_0x26aa4f){return client[_0x514b('0x9')](_0x1839ad,_0x3f17f3)['then'](function(_0x453a28){logger[_0x514b('0xa')]('SalesforceField,\x20%s,\x20%s',_0x550acc,'request\x20sent');logger[_0x514b('0xb')](_0x514b('0xc'),_0x550acc,_0x514b('0xd'),JSON['stringify'](_0x453a28));if(_0x453a28[_0x514b('0xe')]){if(_0x453a28['error']['code']===0x1f4){logger[_0x514b('0xe')]('SalesforceField,\x20%s,\x20%s',_0x550acc,_0x453a28[_0x514b('0xe')]['message']);return _0x26aa4f(_0x453a28[_0x514b('0xe')][_0x514b('0xf')]);}logger[_0x514b('0xe')](_0x514b('0x10'),_0x550acc,_0x453a28['error'][_0x514b('0xf')]);return _0x351dad(_0x453a28[_0x514b('0xe')][_0x514b('0xf')]);}else{logger[_0x514b('0xa')](_0x514b('0x10'),_0x550acc,_0x514b('0xd'));_0x351dad(_0x453a28[_0x514b('0x11')][_0x514b('0xf')]);}})[_0x514b('0x12')](function(_0x5f32b1){logger[_0x514b('0xe')](_0x514b('0x10'),_0x550acc,_0x5f32b1);_0x26aa4f(_0x5f32b1);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index d04de2b..bd07206 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 _0xcf76=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x5b0f78,_0x28cc82){var _0x3da2de=function(_0xa4e854){while(--_0xa4e854){_0x5b0f78['push'](_0x5b0f78['shift']());}};_0x3da2de(++_0x28cc82);}(_0xcf76,0x10d));var _0x6cf7=function(_0x2d20ed,_0x4ec86a){_0x2d20ed=_0x2d20ed-0x0;var _0x2a4272=_0xcf76[_0x2d20ed];return _0x2a4272;};'use strict';var multer=require(_0x6cf7('0x0'));var util=require('util');var path=require(_0x6cf7('0x1'));var timeout=require(_0x6cf7('0x2'));var express=require(_0x6cf7('0x3'));var router=express[_0x6cf7('0x4')]();var fs_extra=require(_0x6cf7('0x5'));var auth=require(_0x6cf7('0x6'));var interaction=require(_0x6cf7('0x7'));var config=require(_0x6cf7('0x8'));var controller=require(_0x6cf7('0x9'));router[_0x6cf7('0xa')]('/',auth['isAuthenticated'](),controller[_0x6cf7('0xb')]);router[_0x6cf7('0xa')](_0x6cf7('0xc'),auth['isAuthenticated'](),controller[_0x6cf7('0xd')]);router[_0x6cf7('0xa')](_0x6cf7('0xe'),auth[_0x6cf7('0xf')](),controller[_0x6cf7('0x10')]);router['get']('/:id/fields',auth[_0x6cf7('0xf')](),controller[_0x6cf7('0x11')]);router[_0x6cf7('0x12')]('/',auth[_0x6cf7('0xf')](),controller[_0x6cf7('0x13')]);router['post'](_0x6cf7('0xe'),auth[_0x6cf7('0xf')](),controller['addConfiguration']);router[_0x6cf7('0x14')](_0x6cf7('0xc'),auth[_0x6cf7('0xf')](),controller[_0x6cf7('0x15')]);router[_0x6cf7('0x16')](_0x6cf7('0xc'),auth['isAuthenticated'](),controller[_0x6cf7('0x17')]);module[_0x6cf7('0x18')]=router; \ No newline at end of file +var _0xeb1e=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','post','addConfiguration','put','update','delete'];(function(_0x3e112d,_0x2bb132){var _0x531c31=function(_0x1954bc){while(--_0x1954bc){_0x3e112d['push'](_0x3e112d['shift']());}};_0x531c31(++_0x2bb132);}(_0xeb1e,0x115));var _0xeeb1=function(_0xe0372e,_0x32ae8b){_0xe0372e=_0xe0372e-0x0;var _0x3c56ab=_0xeb1e[_0xe0372e];return _0x3c56ab;};'use strict';var multer=require(_0xeeb1('0x0'));var util=require(_0xeeb1('0x1'));var path=require(_0xeeb1('0x2'));var timeout=require(_0xeeb1('0x3'));var express=require('express');var router=express[_0xeeb1('0x4')]();var fs_extra=require(_0xeeb1('0x5'));var auth=require(_0xeeb1('0x6'));var interaction=require(_0xeeb1('0x7'));var config=require(_0xeeb1('0x8'));var controller=require(_0xeeb1('0x9'));router[_0xeeb1('0xa')]('/',auth['isAuthenticated'](),controller[_0xeeb1('0xb')]);router['get'](_0xeeb1('0xc'),auth[_0xeeb1('0xd')](),controller[_0xeeb1('0xe')]);router[_0xeeb1('0xa')](_0xeeb1('0xf'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0xeeb1('0x10'),auth[_0xeeb1('0xd')](),controller['getFields']);router['post']('/',auth[_0xeeb1('0xd')](),controller['create']);router[_0xeeb1('0x11')](_0xeeb1('0xf'),auth['isAuthenticated'](),controller[_0xeeb1('0x12')]);router[_0xeeb1('0x13')]('/:id',auth[_0xeeb1('0xd')](),controller[_0xeeb1('0x14')]);router[_0xeeb1('0x15')](_0xeeb1('0xc'),auth['isAuthenticated'](),controller[_0xeeb1('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index a22c544..b5cfcdc 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 _0xf773=['exports','STRING','username','remoteUri','sequelize'];(function(_0x317c36,_0x2a609d){var _0x5bda4e=function(_0x178630){while(--_0x178630){_0x317c36['push'](_0x317c36['shift']());}};_0x5bda4e(++_0x2a609d);}(_0xf773,0xb8));var _0x3f77=function(_0x3a28f8,_0x22ff1b){_0x3a28f8=_0x3a28f8-0x0;var _0x3c0e67=_0xf773[_0x3a28f8];return _0x3c0e67;};'use strict';var Sequelize=require(_0x3f77('0x0'));module[_0x3f77('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3f77('0x2')],'unique':_0x3f77('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3f77('0x2')]},'remoteUri':{'type':Sequelize[_0x3f77('0x2')],'unique':_0x3f77('0x4')},'serverUrl':{'type':Sequelize[_0x3f77('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xc725=['username','remoteUri','sequelize','exports','STRING'];(function(_0x54eb90,_0x41c420){var _0x2a5d32=function(_0x4c579f){while(--_0x4c579f){_0x54eb90['push'](_0x54eb90['shift']());}};_0x2a5d32(++_0x41c420);}(_0xc725,0x89));var _0x5c72=function(_0xd436c4,_0x298c0b){_0xd436c4=_0xd436c4-0x0;var _0x506952=_0xc725[_0xd436c4];return _0x506952;};'use strict';var Sequelize=require(_0x5c72('0x0'));module[_0x5c72('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c72('0x2')]},'username':{'type':Sequelize[_0x5c72('0x2')],'unique':_0x5c72('0x3')},'password':{'type':Sequelize[_0x5c72('0x2')]},'email':{'type':Sequelize[_0x5c72('0x2')]},'remoteUri':{'type':Sequelize[_0x5c72('0x2')],'unique':_0x5c72('0x4')},'serverUrl':{'type':Sequelize[_0x5c72('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 adccc8e..143aaab 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 _0x1cfb=['ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','map','ServicenowAccount','rawAttributes','fieldName','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','findOne','ServicenowConfiguration','getConfigurations','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','getFields','made_sla','hold_reason','subcategory','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','caller_id','approval_set','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','follow_up','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','severity','comments','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','upon_approval','correlation_id','location','username','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','label','push','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','all','concat','ServiceNow\x20error:\x20','test','statusCode','send','true','False','false','sys_choice?sysparm_query=name=incident^element=','forEach','inactive','value','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring'];(function(_0x2be757,_0x5af60a){var _0x2932ab=function(_0x168c9a){while(--_0x168c9a){_0x2be757['push'](_0x2be757['shift']());}};_0x2932ab(++_0x5af60a);}(_0x1cfb,0x160));var _0xb1cf=function(_0x5d4aff,_0x4d58e9){_0x5d4aff=_0x5d4aff-0x0;var _0x28ef30=_0x1cfb[_0x5d4aff];return _0x28ef30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb1cf('0x0'));var jsonpatch=require(_0xb1cf('0x1'));var rp=require(_0xb1cf('0x2'));var moment=require(_0xb1cf('0x3'));var BPromise=require(_0xb1cf('0x4'));var Mustache=require(_0xb1cf('0x5'));var util=require(_0xb1cf('0x6'));var path=require('path');var sox=require(_0xb1cf('0x7'));var csv=require(_0xb1cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb1cf('0x9'));var _=require('lodash');var squel=require(_0xb1cf('0xa'));var crypto=require('crypto');var jsforce=require(_0xb1cf('0xb'));var deskjs=require(_0xb1cf('0xc'));var toCsv=require(_0xb1cf('0x8'));var querystring=require(_0xb1cf('0xd'));var Papa=require('papaparse');var Redis=require(_0xb1cf('0xe'));var authService=require(_0xb1cf('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1cf('0x10'));var logger=require(_0xb1cf('0x11'))(_0xb1cf('0x12'));var utils=require(_0xb1cf('0x13'));var config=require(_0xb1cf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb1cf('0x15'))['db'];var integrations=require(_0xb1cf('0x16'));function respondWithStatusCode(_0x48af5d,_0x1d85e1){_0x1d85e1=_0x1d85e1||0xcc;return function(_0x12898c){if(_0x12898c){return _0x48af5d[_0xb1cf('0x17')](_0x1d85e1);}return _0x48af5d[_0xb1cf('0x18')](_0x1d85e1)[_0xb1cf('0x19')]();};}function respondWithResult(_0x2b2c94,_0x461c76){_0x461c76=_0x461c76||0xc8;return function(_0x3c7a70){if(_0x3c7a70){return _0x2b2c94[_0xb1cf('0x18')](_0x461c76)[_0xb1cf('0x1a')](_0x3c7a70);}};}function respondWithFilteredResult(_0x128e3e,_0x47aac4){return function(_0x509f2d){if(_0x509f2d){var _0x36a98e=typeof _0x47aac4['offset']===_0xb1cf('0x1b')&&typeof _0x47aac4[_0xb1cf('0x1c')]===_0xb1cf('0x1b');var _0xcffde4=_0x509f2d[_0xb1cf('0x1d')];var _0x162e05=_0x36a98e?0x0:_0x47aac4['offset'];var _0x3f92f2=_0x36a98e?_0x509f2d[_0xb1cf('0x1d')]:_0x47aac4[_0xb1cf('0x1e')]+_0x47aac4[_0xb1cf('0x1c')];var _0x2f4140;if(_0x3f92f2>=_0xcffde4){_0x3f92f2=_0xcffde4;_0x2f4140=0xc8;}else{_0x2f4140=0xce;}_0x128e3e[_0xb1cf('0x18')](_0x2f4140);return _0x128e3e[_0xb1cf('0x1f')](_0xb1cf('0x20'),_0x162e05+'-'+_0x3f92f2+'/'+_0xcffde4)[_0xb1cf('0x1a')](_0x509f2d);}return null;};}function patchUpdates(_0x43fefb){return function(_0xf95d0c){try{jsonpatch[_0xb1cf('0x21')](_0xf95d0c,_0x43fefb,!![]);}catch(_0x21b457){return BPromise['reject'](_0x21b457);}return _0xf95d0c[_0xb1cf('0x22')]();};}function saveUpdates(_0x4656b5,_0x121ddc){return function(_0x172a05){if(_0x172a05){return _0x172a05['update'](_0x4656b5)[_0xb1cf('0x23')](function(_0x100a0a){return _0x100a0a;});}return null;};}function removeEntity(_0x21aea2,_0x5d147a){return function(_0x3b1308){if(_0x3b1308){return _0x3b1308[_0xb1cf('0x24')]()['then'](function(){_0x21aea2[_0xb1cf('0x18')](0xcc)[_0xb1cf('0x19')]();});}};}function handleEntityNotFound(_0x1ecd81,_0x34fe60){return function(_0x2ce154){if(!_0x2ce154){_0x1ecd81[_0xb1cf('0x17')](0x194);}return _0x2ce154;};}function handleError(_0x2004ed,_0x239c0e){_0x239c0e=_0x239c0e||0x1f4;return function(_0x259a05){logger[_0xb1cf('0x25')](_0x259a05[_0xb1cf('0x26')]);if(_0x259a05[_0xb1cf('0x27')]){delete _0x259a05[_0xb1cf('0x27')];}_0x2004ed[_0xb1cf('0x18')](_0x239c0e)['send'](_0x259a05);};}exports['index']=function(_0x136b19,_0x166307){var _0x354dfb={},_0x1315e4={},_0x39d675={'count':0x0,'rows':[]};var _0x39cb36=_[_0xb1cf('0x28')](db[_0xb1cf('0x29')][_0xb1cf('0x2a')],function(_0x5a21a0){return{'name':_0x5a21a0[_0xb1cf('0x2b')],'type':_0x5a21a0['type'][_0xb1cf('0x2c')]};});_0x1315e4['model']=_['map'](_0x39cb36,'name');_0x1315e4['query']=_[_0xb1cf('0x2d')](_0x136b19[_0xb1cf('0x2e')]);_0x1315e4[_0xb1cf('0x2f')]=_['intersection'](_0x1315e4[_0xb1cf('0x30')],_0x1315e4[_0xb1cf('0x2e')]);_0x354dfb['attributes']=_[_0xb1cf('0x31')](_0x1315e4[_0xb1cf('0x30')],qs[_0xb1cf('0x32')](_0x136b19['query'][_0xb1cf('0x32')]));_0x354dfb[_0xb1cf('0x33')]=_0x354dfb[_0xb1cf('0x33')][_0xb1cf('0x34')]?_0x354dfb[_0xb1cf('0x33')]:_0x1315e4[_0xb1cf('0x30')];if(!_0x136b19[_0xb1cf('0x2e')][_0xb1cf('0x35')]('nolimit')){_0x354dfb[_0xb1cf('0x1c')]=qs[_0xb1cf('0x1c')](_0x136b19[_0xb1cf('0x2e')][_0xb1cf('0x1c')]);_0x354dfb[_0xb1cf('0x1e')]=qs[_0xb1cf('0x1e')](_0x136b19[_0xb1cf('0x2e')]['offset']);}_0x354dfb[_0xb1cf('0x36')]=qs[_0xb1cf('0x37')](_0x136b19['query'][_0xb1cf('0x37')]);_0x354dfb[_0xb1cf('0x38')]=qs[_0xb1cf('0x2f')](_[_0xb1cf('0x39')](_0x136b19[_0xb1cf('0x2e')],_0x1315e4[_0xb1cf('0x2f')]),_0x39cb36);if(_0x136b19['query'][_0xb1cf('0x3a')]){_0x354dfb['where']=_['merge'](_0x354dfb[_0xb1cf('0x38')],{'$or':_[_0xb1cf('0x28')](_0x39cb36,function(_0xd931c6){if(_0xd931c6[_0xb1cf('0x3b')]!=='VIRTUAL'){var _0x376c9f={};_0x376c9f[_0xd931c6[_0xb1cf('0x27')]]={'$like':'%'+_0x136b19[_0xb1cf('0x2e')][_0xb1cf('0x3a')]+'%'};return _0x376c9f;}})});}_0x354dfb=_[_0xb1cf('0x3c')]({},_0x354dfb,_0x136b19[_0xb1cf('0x3d')]);var _0x2a723d={'where':_0x354dfb[_0xb1cf('0x38')]};return db[_0xb1cf('0x29')][_0xb1cf('0x1d')](_0x2a723d)[_0xb1cf('0x23')](function(_0x10e438){_0x39d675[_0xb1cf('0x1d')]=_0x10e438;if(_0x136b19[_0xb1cf('0x2e')][_0xb1cf('0x3e')]){_0x354dfb[_0xb1cf('0x3f')]=[{'all':!![]}];}return db[_0xb1cf('0x29')][_0xb1cf('0x40')](_0x354dfb);})[_0xb1cf('0x23')](function(_0x175e93){_0x39d675[_0xb1cf('0x41')]=_0x175e93;return _0x39d675;})[_0xb1cf('0x23')](respondWithFilteredResult(_0x166307,_0x354dfb))[_0xb1cf('0x42')](handleError(_0x166307,null));};exports[_0xb1cf('0x43')]=function(_0x92a868,_0x42250b){var _0x25f513={'raw':![],'where':{'id':_0x92a868['params']['id']}},_0x5e921a={};_0x5e921a[_0xb1cf('0x30')]=_[_0xb1cf('0x2d')](db[_0xb1cf('0x29')]['rawAttributes']);_0x5e921a[_0xb1cf('0x2e')]=_[_0xb1cf('0x2d')](_0x92a868[_0xb1cf('0x2e')]);_0x5e921a[_0xb1cf('0x2f')]=_[_0xb1cf('0x31')](_0x5e921a[_0xb1cf('0x30')],_0x5e921a['query']);_0x25f513['attributes']=_[_0xb1cf('0x31')](_0x5e921a[_0xb1cf('0x30')],qs['fields'](_0x92a868[_0xb1cf('0x2e')][_0xb1cf('0x32')]));_0x25f513[_0xb1cf('0x33')]=_0x25f513[_0xb1cf('0x33')]['length']?_0x25f513[_0xb1cf('0x33')]:_0x5e921a[_0xb1cf('0x30')];if(_0x92a868[_0xb1cf('0x2e')][_0xb1cf('0x3e')]){_0x25f513['include']=[{'all':!![]}];}_0x25f513=_['merge']({},_0x25f513,_0x92a868[_0xb1cf('0x3d')]);return db[_0xb1cf('0x29')][_0xb1cf('0x44')](_0x25f513)[_0xb1cf('0x23')](handleEntityNotFound(_0x42250b,null))[_0xb1cf('0x23')](respondWithResult(_0x42250b,null))[_0xb1cf('0x42')](handleError(_0x42250b,null));};exports[_0xb1cf('0x45')]=function(_0x13e555,_0x2cf258){return db[_0xb1cf('0x29')][_0xb1cf('0x45')](_0x13e555[_0xb1cf('0x46')],{})[_0xb1cf('0x23')](respondWithResult(_0x2cf258,0xc9))[_0xb1cf('0x42')](handleError(_0x2cf258,null));};exports['update']=function(_0x3a606f,_0x4f4526){if(_0x3a606f[_0xb1cf('0x46')]['id']){delete _0x3a606f['body']['id'];}return db[_0xb1cf('0x29')][_0xb1cf('0x44')]({'where':{'id':_0x3a606f[_0xb1cf('0x47')]['id']}})[_0xb1cf('0x23')](handleEntityNotFound(_0x4f4526,null))[_0xb1cf('0x23')](saveUpdates(_0x3a606f[_0xb1cf('0x46')],null))['then'](respondWithResult(_0x4f4526,null))[_0xb1cf('0x42')](handleError(_0x4f4526,null));};exports[_0xb1cf('0x24')]=function(_0x22519c,_0x28a503){return db[_0xb1cf('0x29')][_0xb1cf('0x44')]({'where':{'id':_0x22519c[_0xb1cf('0x47')]['id']}})[_0xb1cf('0x23')](handleEntityNotFound(_0x28a503,null))[_0xb1cf('0x23')](removeEntity(_0x28a503,null))[_0xb1cf('0x42')](handleError(_0x28a503,null));};exports['getConfigurations']=function(_0x5e8a6e,_0x5ed23d,_0x589ff7){var _0x2dd54c={};var _0x56b57e={};var _0x28df2d;var _0x486fa9;return db[_0xb1cf('0x29')][_0xb1cf('0x48')]({'where':{'id':_0x5e8a6e[_0xb1cf('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ed23d,null))[_0xb1cf('0x23')](function(_0x456387){if(_0x456387){_0x28df2d=_0x456387;_0x56b57e[_0xb1cf('0x30')]=_['keys'](db[_0xb1cf('0x49')][_0xb1cf('0x2a')]);_0x56b57e[_0xb1cf('0x2e')]=_['keys'](_0x5e8a6e['query']);_0x56b57e[_0xb1cf('0x2f')]=_['intersection'](_0x56b57e[_0xb1cf('0x30')],_0x56b57e['query']);_0x2dd54c[_0xb1cf('0x33')]=_['intersection'](_0x56b57e[_0xb1cf('0x30')],qs[_0xb1cf('0x32')](_0x5e8a6e[_0xb1cf('0x2e')][_0xb1cf('0x32')]));_0x2dd54c[_0xb1cf('0x33')]=_0x2dd54c[_0xb1cf('0x33')]['length']?_0x2dd54c[_0xb1cf('0x33')]:_0x56b57e['model'];_0x2dd54c[_0xb1cf('0x36')]=qs[_0xb1cf('0x37')](_0x5e8a6e['query']['sort']);_0x2dd54c[_0xb1cf('0x38')]=qs[_0xb1cf('0x2f')](_[_0xb1cf('0x39')](_0x5e8a6e['query'],_0x56b57e[_0xb1cf('0x2f')]));if(_0x5e8a6e[_0xb1cf('0x2e')][_0xb1cf('0x3a')]){_0x2dd54c['where']=_['merge'](_0x2dd54c[_0xb1cf('0x38')],{'$or':_[_0xb1cf('0x28')](_0x2dd54c[_0xb1cf('0x33')],function(_0x4c2c4f){var _0x43228c={};_0x43228c[_0x4c2c4f]={'$like':'%'+_0x5e8a6e[_0xb1cf('0x2e')][_0xb1cf('0x3a')]+'%'};return _0x43228c;})});}_0x2dd54c=_[_0xb1cf('0x3c')]({},_0x2dd54c,_0x5e8a6e[_0xb1cf('0x3d')]);return _0x28df2d[_0xb1cf('0x4a')](_0x2dd54c);}})[_0xb1cf('0x23')](function(_0x2e503d){if(_0x2e503d){_0x486fa9=_0x2e503d[_0xb1cf('0x34')];if(!_0x5e8a6e['query']['hasOwnProperty'](_0xb1cf('0x4b'))){_0x2dd54c[_0xb1cf('0x1c')]=qs[_0xb1cf('0x1c')](_0x5e8a6e[_0xb1cf('0x2e')][_0xb1cf('0x1c')]);_0x2dd54c[_0xb1cf('0x1e')]=qs['offset'](_0x5e8a6e[_0xb1cf('0x2e')][_0xb1cf('0x1e')]);}return _0x28df2d['getConfigurations'](_0x2dd54c);}})[_0xb1cf('0x23')](function(_0x2a22e4){if(_0x2a22e4){return _0x2a22e4?{'count':_0x486fa9,'rows':_0x2a22e4}:null;}})[_0xb1cf('0x23')](respondWithResult(_0x5ed23d,null))[_0xb1cf('0x42')](handleError(_0x5ed23d,null));};exports['addConfiguration']=function(_0x34a441,_0x3b067e,_0x384ab){if(_0x34a441['body']['id']){delete _0x34a441[_0xb1cf('0x46')]['id'];}return db['ServicenowAccount'][_0xb1cf('0x48')]({'where':{'id':_0x34a441[_0xb1cf('0x47')]['id']}})[_0xb1cf('0x23')](handleEntityNotFound(_0x3b067e,null))[_0xb1cf('0x23')](function(_0x2d0cf5){if(_0x2d0cf5){_0x34a441[_0xb1cf('0x46')][_0xb1cf('0x4c')]=_0x2d0cf5['id'];_0x34a441[_0xb1cf('0x46')][_0xb1cf('0x4d')]=integrations[_0xb1cf('0x4e')](_0x34a441['body'][_0xb1cf('0x4f')],_0x34a441[_0xb1cf('0x46')]['type']);_0x34a441[_0xb1cf('0x46')][_0xb1cf('0x50')]=integrations[_0xb1cf('0x51')](_0x34a441[_0xb1cf('0x46')]['channel'],_0x34a441[_0xb1cf('0x46')][_0xb1cf('0x3b')]);return db[_0xb1cf('0x49')]['create'](_0x34a441[_0xb1cf('0x46')],{'include':[{'model':db[_0xb1cf('0x52')],'as':'Subjects'},{'model':db[_0xb1cf('0x52')],'as':_0xb1cf('0x50')}]});}return null;})[_0xb1cf('0x23')](respondWithResult(_0x3b067e,null))[_0xb1cf('0x42')](handleError(_0x3b067e,null));};exports[_0xb1cf('0x53')]=function(_0x2e0cd0,_0x52e318,_0x18fcad){var _0x1eb936=[_0xb1cf('0x54'),_0xb1cf('0x55'),'knowledge',_0xb1cf('0x56'),_0xb1cf('0x57'),_0xb1cf('0x58'),_0xb1cf('0x59'),'severity',_0xb1cf('0x5a')];var _0x1bcda3=[_0xb1cf('0x5b'),_0xb1cf('0x54'),_0xb1cf('0x5c'),_0xb1cf('0x5d'),_0xb1cf('0x5e'),'sys_updated_on',_0xb1cf('0x5f'),'hold_reason',_0xb1cf('0x60'),_0xb1cf('0x61'),_0xb1cf('0x62'),_0xb1cf('0x63'),_0xb1cf('0x64'),_0xb1cf('0x65'),_0xb1cf('0x66'),_0xb1cf('0x67'),'state','sys_created_by',_0xb1cf('0x68'),'order',_0xb1cf('0x69'),_0xb1cf('0x6a'),_0xb1cf('0x6b'),_0xb1cf('0x6c'),'impact','active',_0xb1cf('0x6d'),'business_service',_0xb1cf('0x6e'),_0xb1cf('0x6f'),_0xb1cf('0x70'),_0xb1cf('0x71'),_0xb1cf('0x72'),_0xb1cf('0x73'),_0xb1cf('0x74'),'group_list',_0xb1cf('0x75'),_0xb1cf('0x76'),'resolved_at',_0xb1cf('0x77'),_0xb1cf('0x78'),_0xb1cf('0x56'),'work_notes','short_description',_0xb1cf('0x57'),_0xb1cf('0x79'),_0xb1cf('0x7a'),_0xb1cf('0x7b'),_0xb1cf('0x7c'),_0xb1cf('0x7d'),_0xb1cf('0x7e'),_0xb1cf('0x7f'),_0xb1cf('0x80'),_0xb1cf('0x58'),_0xb1cf('0x81'),_0xb1cf('0x82'),'closed_by',_0xb1cf('0x83'),'parent_incident',_0xb1cf('0x84'),_0xb1cf('0x85'),_0xb1cf('0x86'),_0xb1cf('0x59'),_0xb1cf('0x87'),_0xb1cf('0x88'),_0xb1cf('0x89'),_0xb1cf('0x8a'),'activity_due',_0xb1cf('0x8b'),_0xb1cf('0x8c'),_0xb1cf('0x8d'),'sla_due',_0xb1cf('0x8e'),_0xb1cf('0x8f'),_0xb1cf('0x90'),_0xb1cf('0x91'),'reopen_count',_0xb1cf('0x92'),'escalation',_0xb1cf('0x93'),_0xb1cf('0x94'),_0xb1cf('0x95'),_0xb1cf('0x5a')];var _0x3db71e='';var _0x18e7bd='';var _0x125708=[];var _0x1dfc69='';var _0x3a7dd3='';var _0x5cbe7b=[];var _0x372f86='';var _0x36c617='';var _0x9e7d1c={};var _0x507c4a='';return db[_0xb1cf('0x29')]['findOne']({'where':{'id':_0x2e0cd0['params']['id']},'attributes':['id',_0xb1cf('0x96'),'password',_0xb1cf('0x97'),_0xb1cf('0x98'),_0xb1cf('0x99')]})['then'](handleEntityNotFound(_0x52e318,null))[_0xb1cf('0x23')](function(_0x10b6c0){if(_0x10b6c0){_0x507c4a=_0x10b6c0[_0xb1cf('0x98')];var _0x4cf492=_0x507c4a[_0xb1cf('0x9a')](-0x1);if(_0x4cf492==='/'){_0x507c4a=_0x507c4a[_0xb1cf('0x9b')](0x0,_0x507c4a[_0xb1cf('0x9c')](_0x4cf492));}_0x36c617=util[_0xb1cf('0x9d')](_0xb1cf('0x9e'),_0x507c4a);_0x372f86=util[_0xb1cf('0x9d')]('%s/api/now/table/',_0x507c4a);_0x9e7d1c={'user':_0x10b6c0['username'],'pass':_0x10b6c0[_0xb1cf('0x9f')]};var _0xf7da97={'method':'GET','uri':_0x36c617+_0xb1cf('0xa0'),'auth':_0x9e7d1c,'json':!![]};return rp(_0xf7da97);}})[_0xb1cf('0x23')](function(_0x16f462){if(_0x16f462[_0xb1cf('0xa1')][_0xb1cf('0x34')]>0x0){_0x3db71e=_0x16f462['result'];}console[_0xb1cf('0xa2')](_0xb1cf('0xa3'),_0x3db71e);_0x5cbe7b=[];_0x18e7bd=Object[_0xb1cf('0xa4')]([],_0x3db71e);_['remove'](_0x18e7bd,function(_0x24dea0){return!_0x1eb936['includes'](_0x24dea0[_0xb1cf('0x27')]);});_0x18e7bd['forEach'](function(_0x77c879){var _0x11e360=createFieldObject(_0x372f86,_0x9e7d1c,_0x77c879['internalType'],_0x77c879[_0xb1cf('0x27')],_0x77c879[_0xb1cf('0xa5')],![]);_0x5cbe7b[_0xb1cf('0xa6')](_0x11e360);});return Promise['all'](_0x5cbe7b);})[_0xb1cf('0x23')](function(_0x288ea4){_0x125708=_0x288ea4;_0x1dfc69=Object[_0xb1cf('0xa4')]([],_0x3db71e);console[_0xb1cf('0xa2')](_0xb1cf('0xa7'),_0x3db71e);_[_0xb1cf('0xa8')](_0x1dfc69,function(_0x3bc9ff){return _0x1bcda3['includes'](_0x3bc9ff['name']);});console[_0xb1cf('0xa2')](_0xb1cf('0xa9'),_0x1dfc69);_0x5cbe7b=[];_0x1dfc69['forEach'](function(_0x4447b8){var _0x50f74a=createFieldObject(_0x372f86,_0x9e7d1c,_0x4447b8['internalType'],_0x4447b8[_0xb1cf('0x27')],_0x4447b8[_0xb1cf('0xa5')],!![]);_0x5cbe7b[_0xb1cf('0xa6')](_0x50f74a);});return Promise[_0xb1cf('0xaa')](_0x5cbe7b);})[_0xb1cf('0x23')](function(_0xb3579b){_0x3a7dd3=_0xb3579b;var _0x5c5113=_0x125708[_0xb1cf('0xab')](_0x3a7dd3);return{'count':_0x5c5113['length'],'rows':_0x5c5113};})[_0xb1cf('0x23')](respondWithResult(_0x52e318,null))[_0xb1cf('0x42')](function(_0x33e1ef){console[_0xb1cf('0xa2')](_0xb1cf('0xac')+_0x33e1ef);var _0x3920e5=_0x2e0cd0[_0xb1cf('0x2e')][_0xb1cf('0xad')]?0x1f4:_0x33e1ef[_0xb1cf('0xae')]||0x1f4;logger[_0xb1cf('0x25')](_0x33e1ef['stack']);delete _0x33e1ef['name'];if(_0x3920e5===0x191){_0x3920e5=0x190;}_0x52e318[_0xb1cf('0x18')](_0x3920e5)[_0xb1cf('0xaf')](_0x2e0cd0['query'][_0xb1cf('0xad')]?{'message':'Wrong\x20credentials','statusCode':_0x33e1ef[_0xb1cf('0xae')]}:_0x33e1ef);});};function createFieldObject(_0x52284f,_0x350ae1,_0x646bdd,_0x28d23e,_0x40c3e5,_0x495796){return new Promise(function(_0x2944bc,_0x1361d3){var _0x7b038b={'id':_0x28d23e,'name':_0x40c3e5,'custom':_0x495796};if(_0x646bdd==='boolean'){_0x7b038b[_0xb1cf('0x3d')]=[{'name':'True','value':_0xb1cf('0xb0')},{'name':_0xb1cf('0xb1'),'value':_0xb1cf('0xb2')}];_0x2944bc(_0x7b038b);}else{var _0x19932d={'method':'GET','uri':_0x52284f+_0xb1cf('0xb3')+_0x28d23e,'auth':_0x350ae1,'json':!![]};return rp(_0x19932d)[_0xb1cf('0x23')](function(_0x277c45){var _0x5a1689=[];if(_0x277c45['result'][_0xb1cf('0x34')]>0x0){_0x277c45[_0xb1cf('0xa1')][_0xb1cf('0xb4')](function(_0x40a48f){if(_0x40a48f[_0xb1cf('0xb5')]===_0xb1cf('0xb2')){var _0x1aed1c={'name':_0x40a48f[_0xb1cf('0xa5')],'value':_0x40a48f[_0xb1cf('0xb6')]};_0x5a1689[_0xb1cf('0xa6')](_0x1aed1c);}});}_0x7b038b[_0xb1cf('0x3d')]=_0x5a1689;if(_0x7b038b['options'][_0xb1cf('0x34')]>0x0){_0x2944bc(_0x7b038b);}else{if(_0x495796==![]){_0x2944bc();}else{_0x2944bc(_0x7b038b);}}});}});} \ No newline at end of file +var _0xe202=['test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','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','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','error','stack','name','index','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','map','type','options','ServicenowAccount','includeAll','findAll','rows','catch','show','keys','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','filter','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','parent','watch_list','upon_reject','child_incidents','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','closed_at','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','time_worked','opened_at','group_list','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','description','sys_class_name','close_notes','closed_by','parent_incident','sys_id','contact_type','reopened_by','urgency','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','reopen_count','escalation','upon_approval','correlation_id','location','category','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','%s/api/now/table/','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','includes','forEach','internalType','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20'];(function(_0x4b6bee,_0x23f984){var _0x167259=function(_0x419bfc){while(--_0x419bfc){_0x4b6bee['push'](_0x4b6bee['shift']());}};_0x167259(++_0x23f984);}(_0xe202,0xc1));var _0x2e20=function(_0x4ba94e,_0x4a5240){_0x4ba94e=_0x4ba94e-0x0;var _0x476f40=_0xe202[_0x4ba94e];return _0x476f40;};'use strict';var emlformat=require(_0x2e20('0x0'));var rimraf=require(_0x2e20('0x1'));var zipdir=require(_0x2e20('0x2'));var jsonpatch=require(_0x2e20('0x3'));var rp=require(_0x2e20('0x4'));var moment=require(_0x2e20('0x5'));var BPromise=require(_0x2e20('0x6'));var Mustache=require(_0x2e20('0x7'));var util=require(_0x2e20('0x8'));var path=require(_0x2e20('0x9'));var sox=require(_0x2e20('0xa'));var csv=require(_0x2e20('0xb'));var ejs=require(_0x2e20('0xc'));var fs=require('fs');var fs_extra=require(_0x2e20('0xd'));var _=require(_0x2e20('0xe'));var squel=require('squel');var crypto=require(_0x2e20('0xf'));var jsforce=require(_0x2e20('0x10'));var deskjs=require(_0x2e20('0x11'));var toCsv=require(_0x2e20('0xb'));var querystring=require('querystring');var Papa=require(_0x2e20('0x12'));var Redis=require(_0x2e20('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2e20('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2e20('0x15'))(_0x2e20('0x16'));var utils=require(_0x2e20('0x17'));var config=require(_0x2e20('0x18'));var licenseUtil=require(_0x2e20('0x19'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x118a61,_0x389889){_0x389889=_0x389889||0xcc;return function(_0x2560d7){if(_0x2560d7){return _0x118a61[_0x2e20('0x1a')](_0x389889);}return _0x118a61[_0x2e20('0x1b')](_0x389889)[_0x2e20('0x1c')]();};}function respondWithResult(_0x253bbd,_0x5b9dc1){_0x5b9dc1=_0x5b9dc1||0xc8;return function(_0xe69647){if(_0xe69647){return _0x253bbd[_0x2e20('0x1b')](_0x5b9dc1)[_0x2e20('0x1d')](_0xe69647);}};}function respondWithFilteredResult(_0x1d8831,_0x308c27){return function(_0x19eb05){if(_0x19eb05){var _0x319b36=typeof _0x308c27[_0x2e20('0x1e')]==='undefined'&&typeof _0x308c27[_0x2e20('0x1f')]===_0x2e20('0x20');var _0x1ee1d1=_0x19eb05['count'];var _0x41bf39=_0x319b36?0x0:_0x308c27[_0x2e20('0x1e')];var _0x25b29e=_0x319b36?_0x19eb05[_0x2e20('0x21')]:_0x308c27[_0x2e20('0x1e')]+_0x308c27[_0x2e20('0x1f')];var _0x326247;if(_0x25b29e>=_0x1ee1d1){_0x25b29e=_0x1ee1d1;_0x326247=0xc8;}else{_0x326247=0xce;}_0x1d8831[_0x2e20('0x1b')](_0x326247);return _0x1d8831['set']('Content-Range',_0x41bf39+'-'+_0x25b29e+'/'+_0x1ee1d1)[_0x2e20('0x1d')](_0x19eb05);}return null;};}function patchUpdates(_0x3c6d84){return function(_0x5cc253){try{jsonpatch['apply'](_0x5cc253,_0x3c6d84,!![]);}catch(_0x409899){return BPromise[_0x2e20('0x22')](_0x409899);}return _0x5cc253[_0x2e20('0x23')]();};}function saveUpdates(_0x16c5e6,_0x1125fe){return function(_0x4a8a86){if(_0x4a8a86){return _0x4a8a86[_0x2e20('0x24')](_0x16c5e6)[_0x2e20('0x25')](function(_0x5515c3){return _0x5515c3;});}return null;};}function removeEntity(_0x281f76,_0x1b4f54){return function(_0x5891e8){if(_0x5891e8){return _0x5891e8['destroy']()[_0x2e20('0x25')](function(){_0x281f76[_0x2e20('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x201cbe,_0x476880){return function(_0x1c2384){if(!_0x1c2384){_0x201cbe['sendStatus'](0x194);}return _0x1c2384;};}function handleError(_0x2b7e26,_0x19d0ac){_0x19d0ac=_0x19d0ac||0x1f4;return function(_0x18bcd0){logger[_0x2e20('0x26')](_0x18bcd0[_0x2e20('0x27')]);if(_0x18bcd0[_0x2e20('0x28')]){delete _0x18bcd0['name'];}_0x2b7e26[_0x2e20('0x1b')](_0x19d0ac)['send'](_0x18bcd0);};}exports[_0x2e20('0x29')]=function(_0xe5492b,_0x3dbda5){var _0x4d00a8={},_0x3b06ad={},_0xc337={'count':0x0,'rows':[]};var _0x59eae7=_['map'](db['ServicenowAccount'][_0x2e20('0x2a')],function(_0x1269e){return{'name':_0x1269e[_0x2e20('0x2b')],'type':_0x1269e['type'][_0x2e20('0x2c')]};});_0x3b06ad[_0x2e20('0x2d')]=_['map'](_0x59eae7,_0x2e20('0x28'));_0x3b06ad['query']=_['keys'](_0xe5492b[_0x2e20('0x2e')]);_0x3b06ad[_0x2e20('0x2f')]=_['intersection'](_0x3b06ad[_0x2e20('0x2d')],_0x3b06ad[_0x2e20('0x2e')]);_0x4d00a8['attributes']=_[_0x2e20('0x30')](_0x3b06ad[_0x2e20('0x2d')],qs[_0x2e20('0x31')](_0xe5492b[_0x2e20('0x2e')][_0x2e20('0x31')]));_0x4d00a8[_0x2e20('0x32')]=_0x4d00a8[_0x2e20('0x32')][_0x2e20('0x33')]?_0x4d00a8[_0x2e20('0x32')]:_0x3b06ad[_0x2e20('0x2d')];if(!_0xe5492b[_0x2e20('0x2e')]['hasOwnProperty'](_0x2e20('0x34'))){_0x4d00a8[_0x2e20('0x1f')]=qs[_0x2e20('0x1f')](_0xe5492b[_0x2e20('0x2e')][_0x2e20('0x1f')]);_0x4d00a8[_0x2e20('0x1e')]=qs[_0x2e20('0x1e')](_0xe5492b[_0x2e20('0x2e')][_0x2e20('0x1e')]);}_0x4d00a8[_0x2e20('0x35')]=qs['sort'](_0xe5492b[_0x2e20('0x2e')][_0x2e20('0x36')]);_0x4d00a8['where']=qs[_0x2e20('0x2f')](_[_0x2e20('0x37')](_0xe5492b[_0x2e20('0x2e')],_0x3b06ad['filters']),_0x59eae7);if(_0xe5492b[_0x2e20('0x2e')]['filter']){_0x4d00a8[_0x2e20('0x38')]=_[_0x2e20('0x39')](_0x4d00a8[_0x2e20('0x38')],{'$or':_[_0x2e20('0x3a')](_0x59eae7,function(_0x21468d){if(_0x21468d[_0x2e20('0x3b')]!=='VIRTUAL'){var _0x1aa892={};_0x1aa892[_0x21468d[_0x2e20('0x28')]]={'$like':'%'+_0xe5492b[_0x2e20('0x2e')]['filter']+'%'};return _0x1aa892;}})});}_0x4d00a8=_[_0x2e20('0x39')]({},_0x4d00a8,_0xe5492b[_0x2e20('0x3c')]);var _0x406a48={'where':_0x4d00a8[_0x2e20('0x38')]};return db[_0x2e20('0x3d')][_0x2e20('0x21')](_0x406a48)['then'](function(_0x3a157f){_0xc337[_0x2e20('0x21')]=_0x3a157f;if(_0xe5492b[_0x2e20('0x2e')][_0x2e20('0x3e')]){_0x4d00a8['include']=[{'all':!![]}];}return db['ServicenowAccount'][_0x2e20('0x3f')](_0x4d00a8);})[_0x2e20('0x25')](function(_0x548d26){_0xc337[_0x2e20('0x40')]=_0x548d26;return _0xc337;})[_0x2e20('0x25')](respondWithFilteredResult(_0x3dbda5,_0x4d00a8))[_0x2e20('0x41')](handleError(_0x3dbda5,null));};exports[_0x2e20('0x42')]=function(_0x128631,_0x209424){var _0xfa42b1={'raw':![],'where':{'id':_0x128631['params']['id']}},_0x4bb7a7={};_0x4bb7a7['model']=_[_0x2e20('0x43')](db[_0x2e20('0x3d')][_0x2e20('0x2a')]);_0x4bb7a7[_0x2e20('0x2e')]=_[_0x2e20('0x43')](_0x128631['query']);_0x4bb7a7['filters']=_[_0x2e20('0x30')](_0x4bb7a7[_0x2e20('0x2d')],_0x4bb7a7[_0x2e20('0x2e')]);_0xfa42b1[_0x2e20('0x32')]=_['intersection'](_0x4bb7a7[_0x2e20('0x2d')],qs[_0x2e20('0x31')](_0x128631[_0x2e20('0x2e')][_0x2e20('0x31')]));_0xfa42b1[_0x2e20('0x32')]=_0xfa42b1[_0x2e20('0x32')]['length']?_0xfa42b1[_0x2e20('0x32')]:_0x4bb7a7[_0x2e20('0x2d')];if(_0x128631['query'][_0x2e20('0x3e')]){_0xfa42b1['include']=[{'all':!![]}];}_0xfa42b1=_[_0x2e20('0x39')]({},_0xfa42b1,_0x128631[_0x2e20('0x3c')]);return db[_0x2e20('0x3d')][_0x2e20('0x44')](_0xfa42b1)[_0x2e20('0x25')](handleEntityNotFound(_0x209424,null))[_0x2e20('0x25')](respondWithResult(_0x209424,null))[_0x2e20('0x41')](handleError(_0x209424,null));};exports[_0x2e20('0x45')]=function(_0xaa9c14,_0x46ee06){return db[_0x2e20('0x3d')][_0x2e20('0x45')](_0xaa9c14[_0x2e20('0x46')],{})[_0x2e20('0x25')](respondWithResult(_0x46ee06,0xc9))[_0x2e20('0x41')](handleError(_0x46ee06,null));};exports[_0x2e20('0x24')]=function(_0x1795bf,_0x33e0e6){if(_0x1795bf[_0x2e20('0x46')]['id']){delete _0x1795bf[_0x2e20('0x46')]['id'];}return db[_0x2e20('0x3d')][_0x2e20('0x44')]({'where':{'id':_0x1795bf[_0x2e20('0x47')]['id']}})[_0x2e20('0x25')](handleEntityNotFound(_0x33e0e6,null))[_0x2e20('0x25')](saveUpdates(_0x1795bf[_0x2e20('0x46')],null))[_0x2e20('0x25')](respondWithResult(_0x33e0e6,null))[_0x2e20('0x41')](handleError(_0x33e0e6,null));};exports['destroy']=function(_0x23240f,_0x271533){return db[_0x2e20('0x3d')]['find']({'where':{'id':_0x23240f[_0x2e20('0x47')]['id']}})['then'](handleEntityNotFound(_0x271533,null))['then'](removeEntity(_0x271533,null))[_0x2e20('0x41')](handleError(_0x271533,null));};exports[_0x2e20('0x48')]=function(_0x148c8e,_0x1819e8,_0x437f99){var _0x362634={};var _0x52f50f={};var _0xdf5547;var _0x26d6d9;return db[_0x2e20('0x3d')][_0x2e20('0x49')]({'where':{'id':_0x148c8e[_0x2e20('0x47')]['id']}})['then'](handleEntityNotFound(_0x1819e8,null))['then'](function(_0x3b1e7f){if(_0x3b1e7f){_0xdf5547=_0x3b1e7f;_0x52f50f[_0x2e20('0x2d')]=_['keys'](db[_0x2e20('0x4a')][_0x2e20('0x2a')]);_0x52f50f[_0x2e20('0x2e')]=_[_0x2e20('0x43')](_0x148c8e[_0x2e20('0x2e')]);_0x52f50f[_0x2e20('0x2f')]=_[_0x2e20('0x30')](_0x52f50f[_0x2e20('0x2d')],_0x52f50f[_0x2e20('0x2e')]);_0x362634[_0x2e20('0x32')]=_[_0x2e20('0x30')](_0x52f50f[_0x2e20('0x2d')],qs['fields'](_0x148c8e[_0x2e20('0x2e')][_0x2e20('0x31')]));_0x362634[_0x2e20('0x32')]=_0x362634['attributes']['length']?_0x362634[_0x2e20('0x32')]:_0x52f50f[_0x2e20('0x2d')];_0x362634[_0x2e20('0x35')]=qs[_0x2e20('0x36')](_0x148c8e[_0x2e20('0x2e')]['sort']);_0x362634[_0x2e20('0x38')]=qs[_0x2e20('0x2f')](_['pick'](_0x148c8e[_0x2e20('0x2e')],_0x52f50f[_0x2e20('0x2f')]));if(_0x148c8e[_0x2e20('0x2e')][_0x2e20('0x4b')]){_0x362634[_0x2e20('0x38')]=_[_0x2e20('0x39')](_0x362634[_0x2e20('0x38')],{'$or':_[_0x2e20('0x3a')](_0x362634[_0x2e20('0x32')],function(_0x4975d9){var _0x33f73d={};_0x33f73d[_0x4975d9]={'$like':'%'+_0x148c8e[_0x2e20('0x2e')][_0x2e20('0x4b')]+'%'};return _0x33f73d;})});}_0x362634=_[_0x2e20('0x39')]({},_0x362634,_0x148c8e['options']);return _0xdf5547[_0x2e20('0x48')](_0x362634);}})[_0x2e20('0x25')](function(_0x5d420a){if(_0x5d420a){_0x26d6d9=_0x5d420a[_0x2e20('0x33')];if(!_0x148c8e['query'][_0x2e20('0x4c')](_0x2e20('0x34'))){_0x362634[_0x2e20('0x1f')]=qs['limit'](_0x148c8e[_0x2e20('0x2e')]['limit']);_0x362634[_0x2e20('0x1e')]=qs[_0x2e20('0x1e')](_0x148c8e['query']['offset']);}return _0xdf5547[_0x2e20('0x48')](_0x362634);}})['then'](function(_0x217fda){if(_0x217fda){return _0x217fda?{'count':_0x26d6d9,'rows':_0x217fda}:null;}})[_0x2e20('0x25')](respondWithResult(_0x1819e8,null))['catch'](handleError(_0x1819e8,null));};exports[_0x2e20('0x4d')]=function(_0x26b580,_0x72e06,_0x5056a4){if(_0x26b580[_0x2e20('0x46')]['id']){delete _0x26b580[_0x2e20('0x46')]['id'];}return db[_0x2e20('0x3d')][_0x2e20('0x49')]({'where':{'id':_0x26b580['params']['id']}})[_0x2e20('0x25')](handleEntityNotFound(_0x72e06,null))[_0x2e20('0x25')](function(_0x1fe355){if(_0x1fe355){_0x26b580[_0x2e20('0x46')][_0x2e20('0x4e')]=_0x1fe355['id'];_0x26b580[_0x2e20('0x46')][_0x2e20('0x4f')]=integrations[_0x2e20('0x50')](_0x26b580[_0x2e20('0x46')][_0x2e20('0x51')],_0x26b580[_0x2e20('0x46')]['type']);_0x26b580[_0x2e20('0x46')]['Descriptions']=integrations['getDescriptions'](_0x26b580[_0x2e20('0x46')][_0x2e20('0x51')],_0x26b580['body'][_0x2e20('0x3b')]);return db[_0x2e20('0x4a')][_0x2e20('0x45')](_0x26b580['body'],{'include':[{'model':db[_0x2e20('0x52')],'as':'Subjects'},{'model':db[_0x2e20('0x52')],'as':_0x2e20('0x53')}]});}return null;})[_0x2e20('0x25')](respondWithResult(_0x72e06,null))[_0x2e20('0x41')](handleError(_0x72e06,null));};exports[_0x2e20('0x54')]=function(_0x5d348d,_0x3f15bf,_0x4f695a){var _0x4b5edc=[_0x2e20('0x55'),_0x2e20('0x56'),_0x2e20('0x57'),_0x2e20('0x58'),_0x2e20('0x59'),'notify',_0x2e20('0x5a'),_0x2e20('0x5b'),'category'];var _0x13d2d1=[_0x2e20('0x5c'),_0x2e20('0x55'),'caused_by',_0x2e20('0x5d'),_0x2e20('0x5e'),'sys_updated_on',_0x2e20('0x5f'),'hold_reason','approval_history',_0x2e20('0x60'),_0x2e20('0x61'),_0x2e20('0x62'),_0x2e20('0x63'),_0x2e20('0x64'),_0x2e20('0x65'),'sys_domain',_0x2e20('0x66'),_0x2e20('0x67'),_0x2e20('0x57'),_0x2e20('0x35'),'calendar_stc',_0x2e20('0x68'),'cmdb_ci',_0x2e20('0x69'),_0x2e20('0x6a'),_0x2e20('0x6b'),_0x2e20('0x6c'),_0x2e20('0x6d'),'priority',_0x2e20('0x6e'),'rfc',_0x2e20('0x6f'),'expected_start',_0x2e20('0x70'),'business_duration',_0x2e20('0x71'),'work_end',_0x2e20('0x72'),_0x2e20('0x73'),_0x2e20('0x74'),_0x2e20('0x75'),_0x2e20('0x58'),_0x2e20('0x76'),_0x2e20('0x77'),_0x2e20('0x59'),_0x2e20('0x78'),_0x2e20('0x79'),_0x2e20('0x7a'),'assignment_group',_0x2e20('0x7b'),'additional_assignee_list',_0x2e20('0x7c'),'calendar_duration','notify',_0x2e20('0x7d'),_0x2e20('0x7e'),_0x2e20('0x7f'),'follow_up',_0x2e20('0x80'),_0x2e20('0x81'),_0x2e20('0x82'),_0x2e20('0x83'),'incident_state',_0x2e20('0x84'),'problem_id',_0x2e20('0x85'),_0x2e20('0x86'),_0x2e20('0x87'),_0x2e20('0x88'),'severity',_0x2e20('0x89'),'sla_due',_0x2e20('0x8a'),_0x2e20('0x8b'),_0x2e20('0x8c'),'sys_mod_count',_0x2e20('0x8d'),'sys_tags',_0x2e20('0x8e'),_0x2e20('0x8f'),_0x2e20('0x90'),_0x2e20('0x91'),_0x2e20('0x92')];var _0x4e03b2='';var _0x4500e5='';var _0x413499=[];var _0x38ee56='';var _0x1097a8='';var _0x4870b5=[];var _0x374379='';var _0x25166f='';var _0x3b831c={};var _0x4cfbbd='';return db[_0x2e20('0x3d')][_0x2e20('0x49')]({'where':{'id':_0x5d348d[_0x2e20('0x47')]['id']},'attributes':['id',_0x2e20('0x93'),_0x2e20('0x94'),_0x2e20('0x95'),_0x2e20('0x96'),_0x2e20('0x97')]})[_0x2e20('0x25')](handleEntityNotFound(_0x3f15bf,null))['then'](function(_0x4f61f1){if(_0x4f61f1){_0x4cfbbd=_0x4f61f1['remoteUri'];var _0x219c62=_0x4cfbbd[_0x2e20('0x98')](-0x1);if(_0x219c62==='/'){_0x4cfbbd=_0x4cfbbd[_0x2e20('0x99')](0x0,_0x4cfbbd['lastIndexOf'](_0x219c62));}_0x25166f=util[_0x2e20('0x9a')](_0x2e20('0x9b'),_0x4cfbbd);_0x374379=util[_0x2e20('0x9a')](_0x2e20('0x9c'),_0x4cfbbd);_0x3b831c={'user':_0x4f61f1[_0x2e20('0x93')],'pass':_0x4f61f1[_0x2e20('0x94')]};var _0x2af370={'method':'GET','uri':_0x25166f+_0x2e20('0x9d'),'auth':_0x3b831c,'json':!![]};return rp(_0x2af370);}})['then'](function(_0x21dc46){if(_0x21dc46['result']['length']>0x0){_0x4e03b2=_0x21dc46[_0x2e20('0x9e')];}console['log'](_0x2e20('0x9f'),_0x4e03b2);_0x4870b5=[];_0x4500e5=Object[_0x2e20('0xa0')]([],_0x4e03b2);_[_0x2e20('0xa1')](_0x4500e5,function(_0x244454){return!_0x4b5edc[_0x2e20('0xa2')](_0x244454[_0x2e20('0x28')]);});_0x4500e5[_0x2e20('0xa3')](function(_0x5dee12){var _0x5d5166=createFieldObject(_0x374379,_0x3b831c,_0x5dee12[_0x2e20('0xa4')],_0x5dee12['name'],_0x5dee12[_0x2e20('0xa5')],![]);_0x4870b5[_0x2e20('0xa6')](_0x5d5166);});return Promise[_0x2e20('0xa7')](_0x4870b5);})[_0x2e20('0x25')](function(_0x18574a){_0x413499=_0x18574a;_0x38ee56=Object[_0x2e20('0xa0')]([],_0x4e03b2);console[_0x2e20('0xa8')](_0x2e20('0xa9'),_0x4e03b2);_[_0x2e20('0xa1')](_0x38ee56,function(_0x2bc256){return _0x13d2d1[_0x2e20('0xa2')](_0x2bc256[_0x2e20('0x28')]);});console[_0x2e20('0xa8')](_0x2e20('0xaa'),_0x38ee56);_0x4870b5=[];_0x38ee56[_0x2e20('0xa3')](function(_0x15d466){var _0x297888=createFieldObject(_0x374379,_0x3b831c,_0x15d466[_0x2e20('0xa4')],_0x15d466[_0x2e20('0x28')],_0x15d466[_0x2e20('0xa5')],!![]);_0x4870b5['push'](_0x297888);});return Promise[_0x2e20('0xa7')](_0x4870b5);})[_0x2e20('0x25')](function(_0x27167d){_0x1097a8=_0x27167d;var _0x3b724d=_0x413499[_0x2e20('0xab')](_0x1097a8);return{'count':_0x3b724d[_0x2e20('0x33')],'rows':_0x3b724d};})[_0x2e20('0x25')](respondWithResult(_0x3f15bf,null))[_0x2e20('0x41')](function(_0x3f7176){console[_0x2e20('0xa8')](_0x2e20('0xac')+_0x3f7176);var _0x506cbf=_0x5d348d['query'][_0x2e20('0xad')]?0x1f4:_0x3f7176[_0x2e20('0xae')]||0x1f4;logger['error'](_0x3f7176['stack']);delete _0x3f7176['name'];if(_0x506cbf===0x191){_0x506cbf=0x190;}_0x3f15bf[_0x2e20('0x1b')](_0x506cbf)['send'](_0x5d348d['query'][_0x2e20('0xad')]?{'message':_0x2e20('0xaf'),'statusCode':_0x3f7176['statusCode']}:_0x3f7176);});};function createFieldObject(_0x38143d,_0x260564,_0x396a44,_0x12ece5,_0x41554e,_0x42300e){return new Promise(function(_0x254b28,_0x34ebe2){var _0x16efd9={'id':_0x12ece5,'name':_0x41554e,'custom':_0x42300e};if(_0x396a44===_0x2e20('0xb0')){_0x16efd9['options']=[{'name':_0x2e20('0xb1'),'value':_0x2e20('0xb2')},{'name':_0x2e20('0xb3'),'value':_0x2e20('0xb4')}];_0x254b28(_0x16efd9);}else{var _0x4f8e89={'method':_0x2e20('0xb5'),'uri':_0x38143d+_0x2e20('0xb6')+_0x12ece5,'auth':_0x260564,'json':!![]};return rp(_0x4f8e89)[_0x2e20('0x25')](function(_0x264cc5){var _0x60ce15=[];if(_0x264cc5['result'][_0x2e20('0x33')]>0x0){_0x264cc5['result']['forEach'](function(_0x853eef){if(_0x853eef['inactive']==='false'){var _0x5aab3c={'name':_0x853eef[_0x2e20('0xa5')],'value':_0x853eef['value']};_0x60ce15[_0x2e20('0xa6')](_0x5aab3c);}});}_0x16efd9[_0x2e20('0x3c')]=_0x60ce15;if(_0x16efd9['options']['length']>0x0){_0x254b28(_0x16efd9);}else{if(_0x42300e==![]){_0x254b28();}else{_0x254b28(_0x16efd9);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index afb8715..ec3ccdf 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 _0xc4aa=['bluebird','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xc4aa[_0x1694f5];return _0x5b4321;};'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'));var integrations=require(_0xac4a('0x8'));module[_0xac4a('0x9')]=function(_0x96be2b,_0x15cd34){return _0x96be2b[_0xac4a('0xa')](_0xac4a('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf494=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','int_servicenow_accounts','lodash'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xf494,0x1c6));var _0x4f49=function(_0x587fda,_0x4a532d){_0x587fda=_0x587fda-0x0;var _0x4e3ee1=_0xf494[_0x587fda];return _0x4e3ee1;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var logger=require(_0x4f49('0x2'))('api');var moment=require(_0x4f49('0x3'));var BPromise=require(_0x4f49('0x4'));var rp=require(_0x4f49('0x5'));var fs=require('fs');var path=require(_0x4f49('0x6'));var rimraf=require(_0x4f49('0x7'));var config=require(_0x4f49('0x8'));var attributes=require(_0x4f49('0x9'));var integrations=require(_0x4f49('0xa'));module[_0x4f49('0xb')]=function(_0x413530,_0x42b0e8){return _0x413530['define']('ServicenowAccount',attributes,{'tableName':_0x4f49('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index e224c91..534276f 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 _0x59f8=['result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','debug','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message'];(function(_0x445d41,_0x127718){var _0x553de7=function(_0x5bdea4){while(--_0x5bdea4){_0x445d41['push'](_0x445d41['shift']());}};_0x553de7(++_0x127718);}(_0x59f8,0x153));var _0x859f=function(_0x4e1bef,_0x13dd72){_0x4e1bef=_0x4e1bef-0x0;var _0x18fa6f=_0x59f8[_0x4e1bef];return _0x18fa6f;};'use strict';var _=require(_0x859f('0x0'));var util=require(_0x859f('0x1'));var moment=require(_0x859f('0x2'));var BPromise=require(_0x859f('0x3'));var rs=require(_0x859f('0x4'));var fs=require('fs');var Redis=require(_0x859f('0x5'));var db=require(_0x859f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x859f('0x7'));var jayson=require(_0x859f('0x8'));var client=jayson[_0x859f('0x9')][_0x859f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c1cf4,_0xbaf8a7,_0x17b2a2){return new BPromise(function(_0x1eb365,_0xe900f7){return client[_0x859f('0xb')](_0x5c1cf4,_0x17b2a2)[_0x859f('0xc')](function(_0x5e86b7){logger[_0x859f('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0xbaf8a7,_0x859f('0xe'));logger['debug'](_0x859f('0xf'),_0xbaf8a7,'request\x20sent',JSON[_0x859f('0x10')](_0x5e86b7));if(_0x5e86b7[_0x859f('0x11')]){if(_0x5e86b7['error'][_0x859f('0x12')]===0x1f4){logger[_0x859f('0x11')](_0x859f('0x13'),_0xbaf8a7,_0x5e86b7[_0x859f('0x11')][_0x859f('0x14')]);return _0xe900f7(_0x5e86b7[_0x859f('0x11')]['message']);}logger[_0x859f('0x11')](_0x859f('0x13'),_0xbaf8a7,_0x5e86b7[_0x859f('0x11')][_0x859f('0x14')]);return _0x1eb365(_0x5e86b7[_0x859f('0x11')][_0x859f('0x14')]);}else{logger[_0x859f('0xd')](_0x859f('0x13'),_0xbaf8a7,_0x859f('0xe'));_0x1eb365(_0x5e86b7[_0x859f('0x15')][_0x859f('0x14')]);}})[_0x859f('0x16')](function(_0x24762f){logger[_0x859f('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0xbaf8a7,_0x24762f);_0xe900f7(_0x24762f);});});}exports[_0x859f('0x17')]=function(_0x14c32c){var _0x40f752=this;return new Promise(function(_0x383e9a,_0x1d6dec){return db[_0x859f('0x18')][_0x859f('0x19')]({'raw':_0x14c32c['options']?_0x14c32c[_0x859f('0x1a')][_0x859f('0x1b')]===undefined?!![]:![]:!![],'where':_0x14c32c[_0x859f('0x1a')]?_0x14c32c[_0x859f('0x1a')][_0x859f('0x1c')]||null:null,'attributes':_0x14c32c[_0x859f('0x1a')]?_0x14c32c[_0x859f('0x1a')][_0x859f('0x1d')]||null:null,'limit':_0x14c32c[_0x859f('0x1a')]?_0x14c32c[_0x859f('0x1a')]['limit']||null:null,'include':_0x14c32c[_0x859f('0x1a')]?_0x14c32c[_0x859f('0x1a')][_0x859f('0x1e')]?_[_0x859f('0x1f')](_0x14c32c['options'][_0x859f('0x1e')],function(_0xceae94){return{'model':db[_0xceae94[_0x859f('0x20')]],'as':_0xceae94['as'],'attributes':_0xceae94[_0x859f('0x1d')],'include':_0xceae94['include']?_['map'](_0xceae94[_0x859f('0x1e')],function(_0x287850){return{'model':db[_0x287850[_0x859f('0x20')]],'as':_0x287850['as'],'attributes':_0x287850[_0x859f('0x1d')],'include':_0x287850[_0x859f('0x1e')]?_[_0x859f('0x1f')](_0x287850[_0x859f('0x1e')],function(_0x3d021b){return{'model':db[_0x3d021b['model']],'as':_0x3d021b['as'],'attributes':_0x3d021b[_0x859f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x859f('0xc')](function(_0x4b0736){logger[_0x859f('0xd')](_0x859f('0x17'),_0x14c32c);logger[_0x859f('0x21')]('GetServicenowAccount',_0x14c32c,JSON[_0x859f('0x10')](_0x4b0736));_0x383e9a(_0x4b0736);})[_0x859f('0x16')](function(_0x241563){logger[_0x859f('0x11')](_0x859f('0x17'),_0x241563[_0x859f('0x14')],_0x14c32c);_0x1d6dec(_0x40f752['error'](0x1f4,_0x241563[_0x859f('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x1eadec){var _0x3b18a3=this;return new Promise(function(_0x715699,_0xd5ca3){return db['ServicenowAccount'][_0x859f('0x22')]({'raw':_0x1eadec[_0x859f('0x1a')]?_0x1eadec['options']['raw']===undefined?!![]:![]:!![],'where':_0x1eadec['options']?_0x1eadec['options'][_0x859f('0x1c')]||null:null,'attributes':_0x1eadec[_0x859f('0x1a')]?_0x1eadec[_0x859f('0x1a')][_0x859f('0x1d')]||null:null,'include':_0x1eadec[_0x859f('0x1a')]?_0x1eadec[_0x859f('0x1a')][_0x859f('0x1e')]?_[_0x859f('0x1f')](_0x1eadec['options'][_0x859f('0x1e')],function(_0x4dd5d3){return{'model':db[_0x4dd5d3[_0x859f('0x20')]],'as':_0x4dd5d3['as'],'attributes':_0x4dd5d3[_0x859f('0x1d')],'include':_0x4dd5d3[_0x859f('0x1e')]?_[_0x859f('0x1f')](_0x4dd5d3[_0x859f('0x1e')],function(_0x44550d){return{'model':db[_0x44550d[_0x859f('0x20')]],'as':_0x44550d['as'],'attributes':_0x44550d[_0x859f('0x1d')],'include':_0x44550d[_0x859f('0x1e')]?_['map'](_0x44550d[_0x859f('0x1e')],function(_0x55c1a6){return{'model':db[_0x55c1a6[_0x859f('0x20')]],'as':_0x55c1a6['as'],'attributes':_0x55c1a6[_0x859f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18f1d7){logger['info'](_0x859f('0x23'),_0x1eadec);logger[_0x859f('0x21')](_0x859f('0x23'),_0x1eadec,JSON['stringify'](_0x18f1d7));_0x715699(_0x18f1d7);})['catch'](function(_0x573f75){logger[_0x859f('0x11')](_0x859f('0x23'),_0x573f75['message'],_0x1eadec);_0xd5ca3(_0x3b18a3[_0x859f('0x11')](0x1f4,_0x573f75[_0x859f('0x14')]));});});}; \ No newline at end of file +var _0xc0fd=['../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','catch','GetServicenowAccount','ServicenowAccount','findAll','options','raw','where','attributes','limit','include','map','model','find','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x297a2f,_0x861f2){var _0x15f59f=function(_0x55a2b4){while(--_0x55a2b4){_0x297a2f['push'](_0x297a2f['shift']());}};_0x15f59f(++_0x861f2);}(_0xc0fd,0x111));var _0xdc0f=function(_0x432953,_0x1b5232){_0x432953=_0x432953-0x0;var _0x38b376=_0xc0fd[_0x432953];return _0x38b376;};'use strict';var _=require(_0xdc0f('0x0'));var util=require(_0xdc0f('0x1'));var moment=require(_0xdc0f('0x2'));var BPromise=require(_0xdc0f('0x3'));var rs=require(_0xdc0f('0x4'));var fs=require('fs');var Redis=require(_0xdc0f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc0f('0x6'));var logger=require(_0xdc0f('0x7'))(_0xdc0f('0x8'));var config=require(_0xdc0f('0x9'));var jayson=require(_0xdc0f('0xa'));var client=jayson[_0xdc0f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19fc90,_0x1ce5f9,_0x4768f0){return new BPromise(function(_0xf8f09c,_0xaadcda){return client['request'](_0x19fc90,_0x4768f0)[_0xdc0f('0xc')](function(_0x52d952){logger[_0xdc0f('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x1ce5f9,_0xdc0f('0xe'));logger[_0xdc0f('0xf')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x1ce5f9,_0xdc0f('0xe'),JSON[_0xdc0f('0x10')](_0x52d952));if(_0x52d952[_0xdc0f('0x11')]){if(_0x52d952[_0xdc0f('0x11')][_0xdc0f('0x12')]===0x1f4){logger[_0xdc0f('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1ce5f9,_0x52d952[_0xdc0f('0x11')][_0xdc0f('0x13')]);return _0xaadcda(_0x52d952[_0xdc0f('0x11')]['message']);}logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x1ce5f9,_0x52d952[_0xdc0f('0x11')][_0xdc0f('0x13')]);return _0xf8f09c(_0x52d952[_0xdc0f('0x11')][_0xdc0f('0x13')]);}else{logger['info'](_0xdc0f('0x14'),_0x1ce5f9,_0xdc0f('0xe'));_0xf8f09c(_0x52d952['result'][_0xdc0f('0x13')]);}})[_0xdc0f('0x15')](function(_0x216ae4){logger[_0xdc0f('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0x1ce5f9,_0x216ae4);_0xaadcda(_0x216ae4);});});}exports[_0xdc0f('0x16')]=function(_0x44e633){var _0x442add=this;return new Promise(function(_0x25bf33,_0x355602){return db[_0xdc0f('0x17')][_0xdc0f('0x18')]({'raw':_0x44e633[_0xdc0f('0x19')]?_0x44e633[_0xdc0f('0x19')][_0xdc0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x44e633[_0xdc0f('0x19')]?_0x44e633[_0xdc0f('0x19')][_0xdc0f('0x1b')]||null:null,'attributes':_0x44e633[_0xdc0f('0x19')]?_0x44e633[_0xdc0f('0x19')][_0xdc0f('0x1c')]||null:null,'limit':_0x44e633[_0xdc0f('0x19')]?_0x44e633[_0xdc0f('0x19')][_0xdc0f('0x1d')]||null:null,'include':_0x44e633['options']?_0x44e633['options'][_0xdc0f('0x1e')]?_['map'](_0x44e633[_0xdc0f('0x19')][_0xdc0f('0x1e')],function(_0xff7098){return{'model':db[_0xff7098['model']],'as':_0xff7098['as'],'attributes':_0xff7098[_0xdc0f('0x1c')],'include':_0xff7098[_0xdc0f('0x1e')]?_[_0xdc0f('0x1f')](_0xff7098[_0xdc0f('0x1e')],function(_0x461749){return{'model':db[_0x461749[_0xdc0f('0x20')]],'as':_0x461749['as'],'attributes':_0x461749[_0xdc0f('0x1c')],'include':_0x461749[_0xdc0f('0x1e')]?_[_0xdc0f('0x1f')](_0x461749[_0xdc0f('0x1e')],function(_0x10f028){return{'model':db[_0x10f028[_0xdc0f('0x20')]],'as':_0x10f028['as'],'attributes':_0x10f028[_0xdc0f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdc0f('0xc')](function(_0x4d6284){logger[_0xdc0f('0xd')](_0xdc0f('0x16'),_0x44e633);logger[_0xdc0f('0xf')](_0xdc0f('0x16'),_0x44e633,JSON[_0xdc0f('0x10')](_0x4d6284));_0x25bf33(_0x4d6284);})[_0xdc0f('0x15')](function(_0x3baf10){logger[_0xdc0f('0x11')](_0xdc0f('0x16'),_0x3baf10[_0xdc0f('0x13')],_0x44e633);_0x355602(_0x442add[_0xdc0f('0x11')](0x1f4,_0x3baf10[_0xdc0f('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x1bd186){var _0x498e5d=this;return new Promise(function(_0x51b5cf,_0x56083b){return db[_0xdc0f('0x17')][_0xdc0f('0x21')]({'raw':_0x1bd186[_0xdc0f('0x19')]?_0x1bd186[_0xdc0f('0x19')][_0xdc0f('0x1a')]===undefined?!![]:![]:!![],'where':_0x1bd186[_0xdc0f('0x19')]?_0x1bd186['options']['where']||null:null,'attributes':_0x1bd186[_0xdc0f('0x19')]?_0x1bd186[_0xdc0f('0x19')][_0xdc0f('0x1c')]||null:null,'include':_0x1bd186[_0xdc0f('0x19')]?_0x1bd186[_0xdc0f('0x19')][_0xdc0f('0x1e')]?_[_0xdc0f('0x1f')](_0x1bd186[_0xdc0f('0x19')][_0xdc0f('0x1e')],function(_0x523655){return{'model':db[_0x523655['model']],'as':_0x523655['as'],'attributes':_0x523655[_0xdc0f('0x1c')],'include':_0x523655[_0xdc0f('0x1e')]?_[_0xdc0f('0x1f')](_0x523655['include'],function(_0x4351e1){return{'model':db[_0x4351e1[_0xdc0f('0x20')]],'as':_0x4351e1['as'],'attributes':_0x4351e1['attributes'],'include':_0x4351e1[_0xdc0f('0x1e')]?_[_0xdc0f('0x1f')](_0x4351e1['include'],function(_0x5c9b12){return{'model':db[_0x5c9b12[_0xdc0f('0x20')]],'as':_0x5c9b12['as'],'attributes':_0x5c9b12['attributes']};}):[]};}):[]};}):[]:[]})[_0xdc0f('0xc')](function(_0xbffea6){logger[_0xdc0f('0xd')]('ShowServicenowAccount',_0x1bd186);logger[_0xdc0f('0xf')](_0xdc0f('0x22'),_0x1bd186,JSON[_0xdc0f('0x10')](_0xbffea6));_0x51b5cf(_0xbffea6);})[_0xdc0f('0x15')](function(_0x4ea098){logger['error'](_0xdc0f('0x22'),_0x4ea098['message'],_0x1bd186);_0x56083b(_0x498e5d[_0xdc0f('0x11')](0x1f4,_0x4ea098[_0xdc0f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 6ae615b..48f8758 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 _0x1cee=['getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x4d2238,_0x5eb091){var _0x575058=function(_0x3911e7){while(--_0x3911e7){_0x4d2238['push'](_0x4d2238['shift']());}};_0x575058(++_0x5eb091);}(_0x1cee,0x11d));var _0xe1ce=function(_0x276de5,_0x5183f8){_0x276de5=_0x276de5-0x0;var _0x522615=_0x1cee[_0x276de5];return _0x522615;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe1ce('0x0'));var timeout=require(_0xe1ce('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe1ce('0x2'));var auth=require(_0xe1ce('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe1ce('0x4'));var controller=require('./intServicenowConfiguration.controller');router[_0xe1ce('0x5')]('/',auth[_0xe1ce('0x6')](),controller['index']);router['get'](_0xe1ce('0x7'),auth[_0xe1ce('0x6')](),controller[_0xe1ce('0x8')]);router[_0xe1ce('0x5')]('/:id/fields',auth[_0xe1ce('0x6')](),controller[_0xe1ce('0x9')]);router[_0xe1ce('0x5')](_0xe1ce('0xa'),auth[_0xe1ce('0x6')](),controller[_0xe1ce('0xb')]);router[_0xe1ce('0x5')](_0xe1ce('0xc'),auth[_0xe1ce('0x6')](),controller[_0xe1ce('0xd')]);router[_0xe1ce('0xe')]('/',auth[_0xe1ce('0x6')](),controller[_0xe1ce('0xf')]);router[_0xe1ce('0x10')](_0xe1ce('0x7'),auth[_0xe1ce('0x6')](),controller[_0xe1ce('0x11')]);router[_0xe1ce('0x12')](_0xe1ce('0x7'),auth[_0xe1ce('0x6')](),controller[_0xe1ce('0x13')]);module[_0xe1ce('0x14')]=router; \ No newline at end of file +var _0xd393=['multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','post','put','update','exports'];(function(_0xca6092,_0x227611){var _0x5c43be=function(_0x1ce3a1){while(--_0x1ce3a1){_0xca6092['push'](_0xca6092['shift']());}};_0x5c43be(++_0x227611);}(_0xd393,0x165));var _0x3d39=function(_0x3ee615,_0xf071fd){_0x3ee615=_0x3ee615-0x0;var _0x4795ea=_0xd393[_0x3ee615];return _0x4795ea;};'use strict';var multer=require(_0x3d39('0x0'));var util=require(_0x3d39('0x1'));var path=require(_0x3d39('0x2'));var timeout=require('connect-timeout');var express=require(_0x3d39('0x3'));var router=express[_0x3d39('0x4')]();var fs_extra=require(_0x3d39('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3d39('0x6'));var config=require(_0x3d39('0x7'));var controller=require('./intServicenowConfiguration.controller');router[_0x3d39('0x8')]('/',auth['isAuthenticated'](),controller[_0x3d39('0x9')]);router[_0x3d39('0x8')](_0x3d39('0xa'),auth[_0x3d39('0xb')](),controller['show']);router[_0x3d39('0x8')](_0x3d39('0xc'),auth['isAuthenticated'](),controller[_0x3d39('0xd')]);router[_0x3d39('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x3d39('0xe')]);router[_0x3d39('0x8')](_0x3d39('0xf'),auth['isAuthenticated'](),controller[_0x3d39('0x10')]);router[_0x3d39('0x11')]('/',auth[_0x3d39('0xb')](),controller['create']);router[_0x3d39('0x12')](_0x3d39('0xa'),auth[_0x3d39('0xb')](),controller[_0x3d39('0x13')]);router['delete']('/:id',auth[_0x3d39('0xb')](),controller['destroy']);module[_0x3d39('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index bcfef11..8246675 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 _0xb7cc=['sequelize','exports','STRING'];(function(_0xb28498,_0x487ee8){var _0x3126b3=function(_0x4c6b05){while(--_0x4c6b05){_0xb28498['push'](_0xb28498['shift']());}};_0x3126b3(++_0x487ee8);}(_0xb7cc,0x96));var _0xcb7c=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xb7cc[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0xcb7c('0x0'));module[_0xcb7c('0x1')]={'name':{'type':Sequelize[_0xcb7c('0x2')]},'description':{'type':Sequelize[_0xcb7c('0x2')]}}; \ No newline at end of file +var _0x1344=['exports','STRING'];(function(_0x5aa6ae,_0x14c1e2){var _0x3d91d1=function(_0x1044eb){while(--_0x1044eb){_0x5aa6ae['push'](_0x5aa6ae['shift']());}};_0x3d91d1(++_0x14c1e2);}(_0x1344,0x1cc));var _0x4134=function(_0x226212,_0x3471a3){_0x226212=_0x226212-0x0;var _0x37e7bf=_0x1344[_0x226212];return _0x37e7bf;};'use strict';var Sequelize=require('sequelize');module[_0x4134('0x0')]={'name':{'type':Sequelize[_0x4134('0x1')]},'description':{'type':Sequelize[_0x4134('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 2651afd..7107859 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 _0xc51a=['count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','fieldName','key','model','keys','attributes','intersection','fields','query','length','nolimit','order','sort','pick','filter','merge','type','options','where','ServicenowConfiguration','includeAll','include','findAll','rows','catch','show','create','body','find','params','rawAttributes','filters','getFields','hasOwnProperty','getSubjects','findOne','ServicenowField','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x4da749,_0x33272a){var _0x59afaf=function(_0xd43a97){while(--_0xd43a97){_0x4da749['push'](_0x4da749['shift']());}};_0x59afaf(++_0x33272a);}(_0xc51a,0xd4));var _0xac51=function(_0x4398f9,_0x262b2d){_0x4398f9=_0x4398f9-0x0;var _0x3cfdb8=_0xc51a[_0x4398f9];return _0x3cfdb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac51('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xac51('0x1'));var rp=require(_0xac51('0x2'));var moment=require(_0xac51('0x3'));var BPromise=require(_0xac51('0x4'));var Mustache=require(_0xac51('0x5'));var util=require(_0xac51('0x6'));var path=require('path');var sox=require(_0xac51('0x7'));var csv=require(_0xac51('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac51('0x9'));var _=require('lodash');var squel=require(_0xac51('0xa'));var crypto=require(_0xac51('0xb'));var jsforce=require(_0xac51('0xc'));var deskjs=require(_0xac51('0xd'));var toCsv=require(_0xac51('0x8'));var querystring=require('querystring');var Papa=require(_0xac51('0xe'));var Redis=require(_0xac51('0xf'));var authService=require(_0xac51('0x10'));var qs=require(_0xac51('0x11'));var as=require(_0xac51('0x12'));var hardwareService=require(_0xac51('0x13'));var logger=require('../../config/logger')(_0xac51('0x14'));var utils=require(_0xac51('0x15'));var config=require(_0xac51('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xac51('0x17'))['db'];function respondWithStatusCode(_0x152726,_0x3b6b45){_0x3b6b45=_0x3b6b45||0xcc;return function(_0x3867a8){if(_0x3867a8){return _0x152726[_0xac51('0x18')](_0x3b6b45);}return _0x152726['status'](_0x3b6b45)[_0xac51('0x19')]();};}function respondWithResult(_0x4db081,_0x4f41e2){_0x4f41e2=_0x4f41e2||0xc8;return function(_0x2edd13){if(_0x2edd13){return _0x4db081[_0xac51('0x1a')](_0x4f41e2)[_0xac51('0x1b')](_0x2edd13);}};}function respondWithFilteredResult(_0x267735,_0x5d14d6){return function(_0x26d5c5){if(_0x26d5c5){var _0x3e86e0=typeof _0x5d14d6[_0xac51('0x1c')]===_0xac51('0x1d')&&typeof _0x5d14d6[_0xac51('0x1e')]===_0xac51('0x1d');var _0x2251da=_0x26d5c5[_0xac51('0x1f')];var _0x1c010e=_0x3e86e0?0x0:_0x5d14d6['offset'];var _0x35d1e3=_0x3e86e0?_0x26d5c5[_0xac51('0x1f')]:_0x5d14d6[_0xac51('0x1c')]+_0x5d14d6['limit'];var _0x3c1d4d;if(_0x35d1e3>=_0x2251da){_0x35d1e3=_0x2251da;_0x3c1d4d=0xc8;}else{_0x3c1d4d=0xce;}_0x267735[_0xac51('0x1a')](_0x3c1d4d);return _0x267735[_0xac51('0x20')](_0xac51('0x21'),_0x1c010e+'-'+_0x35d1e3+'/'+_0x2251da)[_0xac51('0x1b')](_0x26d5c5);}return null;};}function patchUpdates(_0x576533){return function(_0x2dc9e6){try{jsonpatch[_0xac51('0x22')](_0x2dc9e6,_0x576533,!![]);}catch(_0x4350a0){return BPromise[_0xac51('0x23')](_0x4350a0);}return _0x2dc9e6[_0xac51('0x24')]();};}function saveUpdates(_0x18c150,_0x4397e2){return function(_0x55dbb0){if(_0x55dbb0){return _0x55dbb0[_0xac51('0x25')](_0x18c150)[_0xac51('0x26')](function(_0x261026){return _0x261026;});}return null;};}function removeEntity(_0x9b0deb,_0x1a40a1){return function(_0x873794){if(_0x873794){return _0x873794['destroy']()[_0xac51('0x26')](function(){_0x9b0deb[_0xac51('0x1a')](0xcc)[_0xac51('0x19')]();});}};}function handleEntityNotFound(_0x3def50,_0x1bca06){return function(_0x432819){if(!_0x432819){_0x3def50[_0xac51('0x18')](0x194);}return _0x432819;};}function handleError(_0x25c1e7,_0x3a58b0){_0x3a58b0=_0x3a58b0||0x1f4;return function(_0x14641d){logger[_0xac51('0x27')](_0x14641d[_0xac51('0x28')]);if(_0x14641d[_0xac51('0x29')]){delete _0x14641d[_0xac51('0x29')];}_0x25c1e7[_0xac51('0x1a')](_0x3a58b0)[_0xac51('0x2a')](_0x14641d);};}exports['index']=function(_0x1ab15e,_0x3e064e){var _0x4a8f39={},_0x6cc60a={},_0x180493={'count':0x0,'rows':[]};var _0x95c383=_[_0xac51('0x2b')](db['ServicenowConfiguration']['rawAttributes'],function(_0x55a8d1){return{'name':_0x55a8d1[_0xac51('0x2c')],'type':_0x55a8d1['type'][_0xac51('0x2d')]};});_0x6cc60a[_0xac51('0x2e')]=_[_0xac51('0x2b')](_0x95c383,_0xac51('0x29'));_0x6cc60a['query']=_[_0xac51('0x2f')](_0x1ab15e['query']);_0x6cc60a['filters']=_['intersection'](_0x6cc60a['model'],_0x6cc60a['query']);_0x4a8f39[_0xac51('0x30')]=_[_0xac51('0x31')](_0x6cc60a[_0xac51('0x2e')],qs[_0xac51('0x32')](_0x1ab15e[_0xac51('0x33')][_0xac51('0x32')]));_0x4a8f39[_0xac51('0x30')]=_0x4a8f39[_0xac51('0x30')][_0xac51('0x34')]?_0x4a8f39[_0xac51('0x30')]:_0x6cc60a[_0xac51('0x2e')];if(!_0x1ab15e[_0xac51('0x33')]['hasOwnProperty'](_0xac51('0x35'))){_0x4a8f39[_0xac51('0x1e')]=qs['limit'](_0x1ab15e[_0xac51('0x33')][_0xac51('0x1e')]);_0x4a8f39['offset']=qs['offset'](_0x1ab15e[_0xac51('0x33')]['offset']);}_0x4a8f39[_0xac51('0x36')]=qs[_0xac51('0x37')](_0x1ab15e[_0xac51('0x33')][_0xac51('0x37')]);_0x4a8f39['where']=qs['filters'](_[_0xac51('0x38')](_0x1ab15e['query'],_0x6cc60a['filters']),_0x95c383);if(_0x1ab15e[_0xac51('0x33')][_0xac51('0x39')]){_0x4a8f39['where']=_[_0xac51('0x3a')](_0x4a8f39['where'],{'$or':_[_0xac51('0x2b')](_0x95c383,function(_0x1e7583){if(_0x1e7583[_0xac51('0x3b')]!=='VIRTUAL'){var _0x27b25a={};_0x27b25a[_0x1e7583[_0xac51('0x29')]]={'$like':'%'+_0x1ab15e['query'][_0xac51('0x39')]+'%'};return _0x27b25a;}})});}_0x4a8f39=_[_0xac51('0x3a')]({},_0x4a8f39,_0x1ab15e[_0xac51('0x3c')]);var _0x48cf88={'where':_0x4a8f39[_0xac51('0x3d')]};return db[_0xac51('0x3e')][_0xac51('0x1f')](_0x48cf88)[_0xac51('0x26')](function(_0x410feb){_0x180493[_0xac51('0x1f')]=_0x410feb;if(_0x1ab15e['query'][_0xac51('0x3f')]){_0x4a8f39[_0xac51('0x40')]=[{'all':!![]}];}return db[_0xac51('0x3e')][_0xac51('0x41')](_0x4a8f39);})['then'](function(_0x3d70d8){_0x180493[_0xac51('0x42')]=_0x3d70d8;return _0x180493;})['then'](respondWithFilteredResult(_0x3e064e,_0x4a8f39))[_0xac51('0x43')](handleError(_0x3e064e,null));};exports[_0xac51('0x44')]=function(_0xd2014b,_0x44a4a3){var _0x323ae6={'raw':![],'where':{'id':_0xd2014b['params']['id']}},_0x2c7310={};_0x2c7310[_0xac51('0x2e')]=_['keys'](db[_0xac51('0x3e')]['rawAttributes']);_0x2c7310[_0xac51('0x33')]=_[_0xac51('0x2f')](_0xd2014b[_0xac51('0x33')]);_0x2c7310['filters']=_[_0xac51('0x31')](_0x2c7310[_0xac51('0x2e')],_0x2c7310['query']);_0x323ae6[_0xac51('0x30')]=_['intersection'](_0x2c7310[_0xac51('0x2e')],qs[_0xac51('0x32')](_0xd2014b['query'][_0xac51('0x32')]));_0x323ae6['attributes']=_0x323ae6[_0xac51('0x30')][_0xac51('0x34')]?_0x323ae6['attributes']:_0x2c7310[_0xac51('0x2e')];if(_0xd2014b[_0xac51('0x33')][_0xac51('0x3f')]){_0x323ae6['include']=[{'all':!![]}];}_0x323ae6=_[_0xac51('0x3a')]({},_0x323ae6,_0xd2014b[_0xac51('0x3c')]);return db[_0xac51('0x3e')]['find'](_0x323ae6)[_0xac51('0x26')](handleEntityNotFound(_0x44a4a3,null))[_0xac51('0x26')](respondWithResult(_0x44a4a3,null))[_0xac51('0x43')](handleError(_0x44a4a3,null));};exports[_0xac51('0x45')]=function(_0x26c1df,_0xdc7f3){return db[_0xac51('0x3e')][_0xac51('0x45')](_0x26c1df[_0xac51('0x46')],{})[_0xac51('0x26')](respondWithResult(_0xdc7f3,0xc9))['catch'](handleError(_0xdc7f3,null));};exports[_0xac51('0x25')]=function(_0x35593d,_0x44bcb9){if(_0x35593d[_0xac51('0x46')]['id']){delete _0x35593d[_0xac51('0x46')]['id'];}return db[_0xac51('0x3e')][_0xac51('0x47')]({'where':{'id':_0x35593d[_0xac51('0x48')]['id']}})['then'](handleEntityNotFound(_0x44bcb9,null))['then'](saveUpdates(_0x35593d[_0xac51('0x46')],null))[_0xac51('0x26')](respondWithResult(_0x44bcb9,null))[_0xac51('0x43')](handleError(_0x44bcb9,null));};exports['destroy']=function(_0x2c0ee4,_0xc800e9){return db[_0xac51('0x3e')][_0xac51('0x47')]({'where':{'id':_0x2c0ee4[_0xac51('0x48')]['id']}})['then'](handleEntityNotFound(_0xc800e9,null))[_0xac51('0x26')](removeEntity(_0xc800e9,null))[_0xac51('0x43')](handleError(_0xc800e9,null));};exports['getFields']=function(_0x2ab1ac,_0x5536eb,_0x1949a1){var _0x33be65={};var _0x112d5b={};var _0x53ce3c;var _0x39c6c5;return db[_0xac51('0x3e')]['findOne']({'where':{'id':_0x2ab1ac[_0xac51('0x48')]['id']}})[_0xac51('0x26')](handleEntityNotFound(_0x5536eb,null))[_0xac51('0x26')](function(_0x493246){if(_0x493246){_0x53ce3c=_0x493246;_0x112d5b[_0xac51('0x2e')]=_[_0xac51('0x2f')](db['ServicenowField'][_0xac51('0x49')]);_0x112d5b[_0xac51('0x33')]=_[_0xac51('0x2f')](_0x2ab1ac[_0xac51('0x33')]);_0x112d5b[_0xac51('0x4a')]=_['intersection'](_0x112d5b['model'],_0x112d5b[_0xac51('0x33')]);_0x33be65['attributes']=_[_0xac51('0x31')](_0x112d5b[_0xac51('0x2e')],qs[_0xac51('0x32')](_0x2ab1ac[_0xac51('0x33')]['fields']));_0x33be65[_0xac51('0x30')]=_0x33be65[_0xac51('0x30')]['length']?_0x33be65[_0xac51('0x30')]:_0x112d5b[_0xac51('0x2e')];_0x33be65[_0xac51('0x36')]=qs['sort'](_0x2ab1ac[_0xac51('0x33')][_0xac51('0x37')]);_0x33be65[_0xac51('0x3d')]=qs[_0xac51('0x4a')](_[_0xac51('0x38')](_0x2ab1ac[_0xac51('0x33')],_0x112d5b['filters']));if(_0x2ab1ac['query']['filter']){_0x33be65[_0xac51('0x3d')]=_[_0xac51('0x3a')](_0x33be65['where'],{'$or':_[_0xac51('0x2b')](_0x33be65[_0xac51('0x30')],function(_0x16c8ca){var _0x1b4585={};_0x1b4585[_0x16c8ca]={'$like':'%'+_0x2ab1ac[_0xac51('0x33')][_0xac51('0x39')]+'%'};return _0x1b4585;})});}_0x33be65=_[_0xac51('0x3a')]({},_0x33be65,_0x2ab1ac[_0xac51('0x3c')]);return _0x53ce3c[_0xac51('0x4b')](_0x33be65);}})[_0xac51('0x26')](function(_0x5f276b){if(_0x5f276b){_0x39c6c5=_0x5f276b[_0xac51('0x34')];if(!_0x2ab1ac['query'][_0xac51('0x4c')](_0xac51('0x35'))){_0x33be65[_0xac51('0x1e')]=qs[_0xac51('0x1e')](_0x2ab1ac['query'][_0xac51('0x1e')]);_0x33be65[_0xac51('0x1c')]=qs[_0xac51('0x1c')](_0x2ab1ac[_0xac51('0x33')][_0xac51('0x1c')]);}return _0x53ce3c[_0xac51('0x4b')](_0x33be65);}})['then'](function(_0x4371da){if(_0x4371da){return _0x4371da?{'count':_0x39c6c5,'rows':_0x4371da}:null;}})[_0xac51('0x26')](respondWithResult(_0x5536eb,null))['catch'](handleError(_0x5536eb,null));};exports[_0xac51('0x4d')]=function(_0xc82f24,_0x3603de,_0xff585d){var _0x1f82e7={};var _0x50b755={};var _0x2ac787;var _0x382444;return db['ServicenowConfiguration'][_0xac51('0x4e')]({'where':{'id':_0xc82f24[_0xac51('0x48')]['id']}})['then'](handleEntityNotFound(_0x3603de,null))['then'](function(_0x3cf31e){if(_0x3cf31e){_0x2ac787=_0x3cf31e;_0x50b755[_0xac51('0x2e')]=_[_0xac51('0x2f')](db[_0xac51('0x4f')]['rawAttributes']);_0x50b755[_0xac51('0x33')]=_['keys'](_0xc82f24[_0xac51('0x33')]);_0x50b755[_0xac51('0x4a')]=_[_0xac51('0x31')](_0x50b755['model'],_0x50b755[_0xac51('0x33')]);_0x1f82e7['attributes']=_[_0xac51('0x31')](_0x50b755['model'],qs['fields'](_0xc82f24[_0xac51('0x33')][_0xac51('0x32')]));_0x1f82e7[_0xac51('0x30')]=_0x1f82e7[_0xac51('0x30')][_0xac51('0x34')]?_0x1f82e7[_0xac51('0x30')]:_0x50b755['model'];_0x1f82e7[_0xac51('0x36')]=qs[_0xac51('0x37')](_0xc82f24[_0xac51('0x33')]['sort']);_0x1f82e7[_0xac51('0x3d')]=qs[_0xac51('0x4a')](_[_0xac51('0x38')](_0xc82f24[_0xac51('0x33')],_0x50b755[_0xac51('0x4a')]));if(_0xc82f24[_0xac51('0x33')][_0xac51('0x39')]){_0x1f82e7[_0xac51('0x3d')]=_[_0xac51('0x3a')](_0x1f82e7[_0xac51('0x3d')],{'$or':_[_0xac51('0x2b')](_0x1f82e7['attributes'],function(_0x3ae4e6){var _0xbcfc47={};_0xbcfc47[_0x3ae4e6]={'$like':'%'+_0xc82f24[_0xac51('0x33')]['filter']+'%'};return _0xbcfc47;})});}_0x1f82e7=_['merge']({},_0x1f82e7,_0xc82f24[_0xac51('0x3c')]);return _0x2ac787[_0xac51('0x4d')](_0x1f82e7);}})['then'](function(_0x16353f){if(_0x16353f){_0x382444=_0x16353f['length'];if(!_0xc82f24['query'][_0xac51('0x4c')](_0xac51('0x35'))){_0x1f82e7['limit']=qs[_0xac51('0x1e')](_0xc82f24['query'][_0xac51('0x1e')]);_0x1f82e7[_0xac51('0x1c')]=qs[_0xac51('0x1c')](_0xc82f24[_0xac51('0x33')][_0xac51('0x1c')]);}return _0x2ac787[_0xac51('0x4d')](_0x1f82e7);}})['then'](function(_0x4a005f){if(_0x4a005f){return _0x4a005f?{'count':_0x382444,'rows':_0x4a005f}:null;}})[_0xac51('0x26')](respondWithResult(_0x3603de,null))['catch'](handleError(_0x3603de,null));};exports['getDescriptions']=function(_0x3bdbf8,_0x30f7e9,_0x17a879){var _0x5a9372={};var _0x101bc6={};var _0x555168;var _0x3b5a84;return db[_0xac51('0x3e')]['findOne']({'where':{'id':_0x3bdbf8['params']['id']}})['then'](handleEntityNotFound(_0x30f7e9,null))['then'](function(_0x95201d){if(_0x95201d){_0x555168=_0x95201d;_0x101bc6[_0xac51('0x2e')]=_[_0xac51('0x2f')](db[_0xac51('0x4f')]['rawAttributes']);_0x101bc6[_0xac51('0x33')]=_[_0xac51('0x2f')](_0x3bdbf8[_0xac51('0x33')]);_0x101bc6['filters']=_['intersection'](_0x101bc6[_0xac51('0x2e')],_0x101bc6[_0xac51('0x33')]);_0x5a9372[_0xac51('0x30')]=_[_0xac51('0x31')](_0x101bc6[_0xac51('0x2e')],qs[_0xac51('0x32')](_0x3bdbf8[_0xac51('0x33')]['fields']));_0x5a9372[_0xac51('0x30')]=_0x5a9372['attributes']['length']?_0x5a9372[_0xac51('0x30')]:_0x101bc6[_0xac51('0x2e')];_0x5a9372[_0xac51('0x36')]=qs['sort'](_0x3bdbf8[_0xac51('0x33')][_0xac51('0x37')]);_0x5a9372[_0xac51('0x3d')]=qs['filters'](_['pick'](_0x3bdbf8[_0xac51('0x33')],_0x101bc6[_0xac51('0x4a')]));if(_0x3bdbf8[_0xac51('0x33')]['filter']){_0x5a9372[_0xac51('0x3d')]=_[_0xac51('0x3a')](_0x5a9372[_0xac51('0x3d')],{'$or':_[_0xac51('0x2b')](_0x5a9372[_0xac51('0x30')],function(_0x327dd2){var _0x482678={};_0x482678[_0x327dd2]={'$like':'%'+_0x3bdbf8[_0xac51('0x33')][_0xac51('0x39')]+'%'};return _0x482678;})});}_0x5a9372=_['merge']({},_0x5a9372,_0x3bdbf8['options']);return _0x555168[_0xac51('0x50')](_0x5a9372);}})[_0xac51('0x26')](function(_0x4cc9d9){if(_0x4cc9d9){_0x3b5a84=_0x4cc9d9[_0xac51('0x34')];if(!_0x3bdbf8[_0xac51('0x33')][_0xac51('0x4c')](_0xac51('0x35'))){_0x5a9372[_0xac51('0x1e')]=qs[_0xac51('0x1e')](_0x3bdbf8[_0xac51('0x33')][_0xac51('0x1e')]);_0x5a9372[_0xac51('0x1c')]=qs[_0xac51('0x1c')](_0x3bdbf8[_0xac51('0x33')]['offset']);}return _0x555168['getDescriptions'](_0x5a9372);}})[_0xac51('0x26')](function(_0x294e9d){if(_0x294e9d){return _0x294e9d?{'count':_0x3b5a84,'rows':_0x294e9d}:null;}})[_0xac51('0x26')](respondWithResult(_0x30f7e9,null))[_0xac51('0x43')](handleError(_0x30f7e9,null));}; \ No newline at end of file +var _0x9f3e=['update','then','destroy','error','stack','name','map','ServicenowConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','getFields','ServicenowField','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x9f3e,0x16f));var _0xe9f3=function(_0x154f1c,_0x557cdb){_0x154f1c=_0x154f1c-0x0;var _0x1c7091=_0x9f3e[_0x154f1c];return _0x1c7091;};'use strict';var emlformat=require(_0xe9f3('0x0'));var rimraf=require(_0xe9f3('0x1'));var zipdir=require(_0xe9f3('0x2'));var jsonpatch=require(_0xe9f3('0x3'));var rp=require('request-promise');var moment=require(_0xe9f3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe9f3('0x5'));var util=require(_0xe9f3('0x6'));var path=require(_0xe9f3('0x7'));var sox=require(_0xe9f3('0x8'));var csv=require('to-csv');var ejs=require(_0xe9f3('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe9f3('0xa'));var squel=require(_0xe9f3('0xb'));var crypto=require(_0xe9f3('0xc'));var jsforce=require(_0xe9f3('0xd'));var deskjs=require(_0xe9f3('0xe'));var toCsv=require(_0xe9f3('0xf'));var querystring=require(_0xe9f3('0x10'));var Papa=require(_0xe9f3('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe9f3('0x12'));var as=require(_0xe9f3('0x13'));var hardwareService=require(_0xe9f3('0x14'));var logger=require(_0xe9f3('0x15'))(_0xe9f3('0x16'));var utils=require(_0xe9f3('0x17'));var config=require(_0xe9f3('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f3('0x19'))['db'];function respondWithStatusCode(_0x375158,_0x4d4e53){_0x4d4e53=_0x4d4e53||0xcc;return function(_0x104e5b){if(_0x104e5b){return _0x375158[_0xe9f3('0x1a')](_0x4d4e53);}return _0x375158[_0xe9f3('0x1b')](_0x4d4e53)['end']();};}function respondWithResult(_0x4649a3,_0x166196){_0x166196=_0x166196||0xc8;return function(_0x36922e){if(_0x36922e){return _0x4649a3[_0xe9f3('0x1b')](_0x166196)[_0xe9f3('0x1c')](_0x36922e);}};}function respondWithFilteredResult(_0x566461,_0x3606ac){return function(_0x32f7a4){if(_0x32f7a4){var _0x2437ef=typeof _0x3606ac[_0xe9f3('0x1d')]===_0xe9f3('0x1e')&&typeof _0x3606ac[_0xe9f3('0x1f')]===_0xe9f3('0x1e');var _0x44aabe=_0x32f7a4[_0xe9f3('0x20')];var _0x35a181=_0x2437ef?0x0:_0x3606ac['offset'];var _0x195374=_0x2437ef?_0x32f7a4['count']:_0x3606ac[_0xe9f3('0x1d')]+_0x3606ac['limit'];var _0x1d1e8a;if(_0x195374>=_0x44aabe){_0x195374=_0x44aabe;_0x1d1e8a=0xc8;}else{_0x1d1e8a=0xce;}_0x566461[_0xe9f3('0x1b')](_0x1d1e8a);return _0x566461[_0xe9f3('0x21')](_0xe9f3('0x22'),_0x35a181+'-'+_0x195374+'/'+_0x44aabe)[_0xe9f3('0x1c')](_0x32f7a4);}return null;};}function patchUpdates(_0x47fe74){return function(_0x5b517e){try{jsonpatch[_0xe9f3('0x23')](_0x5b517e,_0x47fe74,!![]);}catch(_0x468974){return BPromise[_0xe9f3('0x24')](_0x468974);}return _0x5b517e[_0xe9f3('0x25')]();};}function saveUpdates(_0x60d737,_0x15c705){return function(_0x5e17b9){if(_0x5e17b9){return _0x5e17b9[_0xe9f3('0x26')](_0x60d737)[_0xe9f3('0x27')](function(_0x188eb3){return _0x188eb3;});}return null;};}function removeEntity(_0x3c0e85,_0x3b9a9d){return function(_0x5055f1){if(_0x5055f1){return _0x5055f1[_0xe9f3('0x28')]()[_0xe9f3('0x27')](function(){_0x3c0e85[_0xe9f3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x276b63,_0x4b7c22){return function(_0x2667d3){if(!_0x2667d3){_0x276b63['sendStatus'](0x194);}return _0x2667d3;};}function handleError(_0x3cb7c2,_0x2853c1){_0x2853c1=_0x2853c1||0x1f4;return function(_0x5f3b0e){logger[_0xe9f3('0x29')](_0x5f3b0e[_0xe9f3('0x2a')]);if(_0x5f3b0e[_0xe9f3('0x2b')]){delete _0x5f3b0e[_0xe9f3('0x2b')];}_0x3cb7c2[_0xe9f3('0x1b')](_0x2853c1)['send'](_0x5f3b0e);};}exports['index']=function(_0x57e7dc,_0x2949fb){var _0x2d222f={},_0xfec403={},_0x4605a1={'count':0x0,'rows':[]};var _0x41d801=_[_0xe9f3('0x2c')](db[_0xe9f3('0x2d')][_0xe9f3('0x2e')],function(_0x4df9fb){return{'name':_0x4df9fb[_0xe9f3('0x2f')],'type':_0x4df9fb[_0xe9f3('0x30')]['key']};});_0xfec403[_0xe9f3('0x31')]=_[_0xe9f3('0x2c')](_0x41d801,_0xe9f3('0x2b'));_0xfec403[_0xe9f3('0x32')]=_[_0xe9f3('0x33')](_0x57e7dc[_0xe9f3('0x32')]);_0xfec403[_0xe9f3('0x34')]=_[_0xe9f3('0x35')](_0xfec403[_0xe9f3('0x31')],_0xfec403[_0xe9f3('0x32')]);_0x2d222f[_0xe9f3('0x36')]=_[_0xe9f3('0x35')](_0xfec403[_0xe9f3('0x31')],qs['fields'](_0x57e7dc[_0xe9f3('0x32')][_0xe9f3('0x37')]));_0x2d222f[_0xe9f3('0x36')]=_0x2d222f[_0xe9f3('0x36')][_0xe9f3('0x38')]?_0x2d222f[_0xe9f3('0x36')]:_0xfec403[_0xe9f3('0x31')];if(!_0x57e7dc[_0xe9f3('0x32')][_0xe9f3('0x39')](_0xe9f3('0x3a'))){_0x2d222f['limit']=qs[_0xe9f3('0x1f')](_0x57e7dc['query'][_0xe9f3('0x1f')]);_0x2d222f[_0xe9f3('0x1d')]=qs[_0xe9f3('0x1d')](_0x57e7dc[_0xe9f3('0x32')][_0xe9f3('0x1d')]);}_0x2d222f[_0xe9f3('0x3b')]=qs[_0xe9f3('0x3c')](_0x57e7dc[_0xe9f3('0x32')][_0xe9f3('0x3c')]);_0x2d222f['where']=qs[_0xe9f3('0x34')](_[_0xe9f3('0x3d')](_0x57e7dc[_0xe9f3('0x32')],_0xfec403[_0xe9f3('0x34')]),_0x41d801);if(_0x57e7dc[_0xe9f3('0x32')]['filter']){_0x2d222f[_0xe9f3('0x3e')]=_['merge'](_0x2d222f[_0xe9f3('0x3e')],{'$or':_[_0xe9f3('0x2c')](_0x41d801,function(_0x50c62d){if(_0x50c62d[_0xe9f3('0x30')]!==_0xe9f3('0x3f')){var _0x2bd91a={};_0x2bd91a[_0x50c62d[_0xe9f3('0x2b')]]={'$like':'%'+_0x57e7dc[_0xe9f3('0x32')][_0xe9f3('0x40')]+'%'};return _0x2bd91a;}})});}_0x2d222f=_[_0xe9f3('0x41')]({},_0x2d222f,_0x57e7dc[_0xe9f3('0x42')]);var _0x24b992={'where':_0x2d222f[_0xe9f3('0x3e')]};return db[_0xe9f3('0x2d')][_0xe9f3('0x20')](_0x24b992)[_0xe9f3('0x27')](function(_0x3ca5b2){_0x4605a1[_0xe9f3('0x20')]=_0x3ca5b2;if(_0x57e7dc[_0xe9f3('0x32')][_0xe9f3('0x43')]){_0x2d222f[_0xe9f3('0x44')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x2d222f);})['then'](function(_0xc38ac8){_0x4605a1[_0xe9f3('0x45')]=_0xc38ac8;return _0x4605a1;})['then'](respondWithFilteredResult(_0x2949fb,_0x2d222f))[_0xe9f3('0x46')](handleError(_0x2949fb,null));};exports[_0xe9f3('0x47')]=function(_0x284214,_0xaa07bf){var _0x713022={'raw':![],'where':{'id':_0x284214['params']['id']}},_0x17743d={};_0x17743d[_0xe9f3('0x31')]=_[_0xe9f3('0x33')](db[_0xe9f3('0x2d')][_0xe9f3('0x2e')]);_0x17743d[_0xe9f3('0x32')]=_[_0xe9f3('0x33')](_0x284214[_0xe9f3('0x32')]);_0x17743d[_0xe9f3('0x34')]=_['intersection'](_0x17743d[_0xe9f3('0x31')],_0x17743d['query']);_0x713022[_0xe9f3('0x36')]=_[_0xe9f3('0x35')](_0x17743d[_0xe9f3('0x31')],qs[_0xe9f3('0x37')](_0x284214[_0xe9f3('0x32')]['fields']));_0x713022[_0xe9f3('0x36')]=_0x713022[_0xe9f3('0x36')][_0xe9f3('0x38')]?_0x713022[_0xe9f3('0x36')]:_0x17743d['model'];if(_0x284214[_0xe9f3('0x32')][_0xe9f3('0x43')]){_0x713022[_0xe9f3('0x44')]=[{'all':!![]}];}_0x713022=_[_0xe9f3('0x41')]({},_0x713022,_0x284214['options']);return db[_0xe9f3('0x2d')][_0xe9f3('0x48')](_0x713022)['then'](handleEntityNotFound(_0xaa07bf,null))[_0xe9f3('0x27')](respondWithResult(_0xaa07bf,null))[_0xe9f3('0x46')](handleError(_0xaa07bf,null));};exports[_0xe9f3('0x49')]=function(_0x21f25e,_0x30ece0){return db['ServicenowConfiguration']['create'](_0x21f25e[_0xe9f3('0x4a')],{})[_0xe9f3('0x27')](respondWithResult(_0x30ece0,0xc9))[_0xe9f3('0x46')](handleError(_0x30ece0,null));};exports[_0xe9f3('0x26')]=function(_0x312f71,_0x1670c1){if(_0x312f71[_0xe9f3('0x4a')]['id']){delete _0x312f71[_0xe9f3('0x4a')]['id'];}return db[_0xe9f3('0x2d')]['find']({'where':{'id':_0x312f71[_0xe9f3('0x4b')]['id']}})[_0xe9f3('0x27')](handleEntityNotFound(_0x1670c1,null))['then'](saveUpdates(_0x312f71[_0xe9f3('0x4a')],null))['then'](respondWithResult(_0x1670c1,null))['catch'](handleError(_0x1670c1,null));};exports['destroy']=function(_0x74c88f,_0xc58e8d){return db['ServicenowConfiguration'][_0xe9f3('0x48')]({'where':{'id':_0x74c88f['params']['id']}})['then'](handleEntityNotFound(_0xc58e8d,null))[_0xe9f3('0x27')](removeEntity(_0xc58e8d,null))[_0xe9f3('0x46')](handleError(_0xc58e8d,null));};exports[_0xe9f3('0x4c')]=function(_0x3aae96,_0x5c5cdf,_0x18744a){var _0x458faf={};var _0x41671a={};var _0x17330e;var _0x9edcd8;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x3aae96[_0xe9f3('0x4b')]['id']}})[_0xe9f3('0x27')](handleEntityNotFound(_0x5c5cdf,null))[_0xe9f3('0x27')](function(_0x59eab7){if(_0x59eab7){_0x17330e=_0x59eab7;_0x41671a[_0xe9f3('0x31')]=_[_0xe9f3('0x33')](db[_0xe9f3('0x4d')]['rawAttributes']);_0x41671a['query']=_[_0xe9f3('0x33')](_0x3aae96[_0xe9f3('0x32')]);_0x41671a[_0xe9f3('0x34')]=_[_0xe9f3('0x35')](_0x41671a['model'],_0x41671a[_0xe9f3('0x32')]);_0x458faf[_0xe9f3('0x36')]=_[_0xe9f3('0x35')](_0x41671a[_0xe9f3('0x31')],qs[_0xe9f3('0x37')](_0x3aae96[_0xe9f3('0x32')]['fields']));_0x458faf[_0xe9f3('0x36')]=_0x458faf[_0xe9f3('0x36')]['length']?_0x458faf[_0xe9f3('0x36')]:_0x41671a[_0xe9f3('0x31')];_0x458faf[_0xe9f3('0x3b')]=qs[_0xe9f3('0x3c')](_0x3aae96['query'][_0xe9f3('0x3c')]);_0x458faf[_0xe9f3('0x3e')]=qs[_0xe9f3('0x34')](_['pick'](_0x3aae96[_0xe9f3('0x32')],_0x41671a[_0xe9f3('0x34')]));if(_0x3aae96[_0xe9f3('0x32')][_0xe9f3('0x40')]){_0x458faf[_0xe9f3('0x3e')]=_[_0xe9f3('0x41')](_0x458faf[_0xe9f3('0x3e')],{'$or':_[_0xe9f3('0x2c')](_0x458faf[_0xe9f3('0x36')],function(_0x13dbf9){var _0x3d3394={};_0x3d3394[_0x13dbf9]={'$like':'%'+_0x3aae96[_0xe9f3('0x32')]['filter']+'%'};return _0x3d3394;})});}_0x458faf=_[_0xe9f3('0x41')]({},_0x458faf,_0x3aae96[_0xe9f3('0x42')]);return _0x17330e['getFields'](_0x458faf);}})[_0xe9f3('0x27')](function(_0x54e85d){if(_0x54e85d){_0x9edcd8=_0x54e85d['length'];if(!_0x3aae96[_0xe9f3('0x32')][_0xe9f3('0x39')](_0xe9f3('0x3a'))){_0x458faf['limit']=qs[_0xe9f3('0x1f')](_0x3aae96[_0xe9f3('0x32')][_0xe9f3('0x1f')]);_0x458faf[_0xe9f3('0x1d')]=qs[_0xe9f3('0x1d')](_0x3aae96[_0xe9f3('0x32')][_0xe9f3('0x1d')]);}return _0x17330e[_0xe9f3('0x4c')](_0x458faf);}})[_0xe9f3('0x27')](function(_0x71ff1b){if(_0x71ff1b){return _0x71ff1b?{'count':_0x9edcd8,'rows':_0x71ff1b}:null;}})[_0xe9f3('0x27')](respondWithResult(_0x5c5cdf,null))['catch'](handleError(_0x5c5cdf,null));};exports[_0xe9f3('0x4e')]=function(_0x4277ed,_0x5b0c4c,_0x314127){var _0x392126={};var _0x4dbbbf={};var _0x33a63a;var _0x441edc;return db[_0xe9f3('0x2d')][_0xe9f3('0x4f')]({'where':{'id':_0x4277ed[_0xe9f3('0x4b')]['id']}})[_0xe9f3('0x27')](handleEntityNotFound(_0x5b0c4c,null))[_0xe9f3('0x27')](function(_0x15ad70){if(_0x15ad70){_0x33a63a=_0x15ad70;_0x4dbbbf[_0xe9f3('0x31')]=_['keys'](db['ServicenowField'][_0xe9f3('0x2e')]);_0x4dbbbf[_0xe9f3('0x32')]=_['keys'](_0x4277ed[_0xe9f3('0x32')]);_0x4dbbbf[_0xe9f3('0x34')]=_[_0xe9f3('0x35')](_0x4dbbbf[_0xe9f3('0x31')],_0x4dbbbf[_0xe9f3('0x32')]);_0x392126['attributes']=_['intersection'](_0x4dbbbf[_0xe9f3('0x31')],qs[_0xe9f3('0x37')](_0x4277ed[_0xe9f3('0x32')][_0xe9f3('0x37')]));_0x392126[_0xe9f3('0x36')]=_0x392126[_0xe9f3('0x36')][_0xe9f3('0x38')]?_0x392126[_0xe9f3('0x36')]:_0x4dbbbf[_0xe9f3('0x31')];_0x392126['order']=qs['sort'](_0x4277ed[_0xe9f3('0x32')][_0xe9f3('0x3c')]);_0x392126[_0xe9f3('0x3e')]=qs[_0xe9f3('0x34')](_['pick'](_0x4277ed[_0xe9f3('0x32')],_0x4dbbbf[_0xe9f3('0x34')]));if(_0x4277ed[_0xe9f3('0x32')][_0xe9f3('0x40')]){_0x392126[_0xe9f3('0x3e')]=_['merge'](_0x392126[_0xe9f3('0x3e')],{'$or':_['map'](_0x392126['attributes'],function(_0x3684c7){var _0xca875a={};_0xca875a[_0x3684c7]={'$like':'%'+_0x4277ed['query']['filter']+'%'};return _0xca875a;})});}_0x392126=_[_0xe9f3('0x41')]({},_0x392126,_0x4277ed[_0xe9f3('0x42')]);return _0x33a63a[_0xe9f3('0x4e')](_0x392126);}})[_0xe9f3('0x27')](function(_0x14420b){if(_0x14420b){_0x441edc=_0x14420b['length'];if(!_0x4277ed[_0xe9f3('0x32')][_0xe9f3('0x39')](_0xe9f3('0x3a'))){_0x392126[_0xe9f3('0x1f')]=qs['limit'](_0x4277ed[_0xe9f3('0x32')]['limit']);_0x392126[_0xe9f3('0x1d')]=qs[_0xe9f3('0x1d')](_0x4277ed[_0xe9f3('0x32')][_0xe9f3('0x1d')]);}return _0x33a63a[_0xe9f3('0x4e')](_0x392126);}})['then'](function(_0x22c321){if(_0x22c321){return _0x22c321?{'count':_0x441edc,'rows':_0x22c321}:null;}})['then'](respondWithResult(_0x5b0c4c,null))[_0xe9f3('0x46')](handleError(_0x5b0c4c,null));};exports[_0xe9f3('0x50')]=function(_0x41c246,_0x44d3d1,_0xd52d03){var _0x20f650={};var _0x345d5f={};var _0x518edc;var _0x17c836;return db[_0xe9f3('0x2d')]['findOne']({'where':{'id':_0x41c246[_0xe9f3('0x4b')]['id']}})[_0xe9f3('0x27')](handleEntityNotFound(_0x44d3d1,null))['then'](function(_0x4fc86a){if(_0x4fc86a){_0x518edc=_0x4fc86a;_0x345d5f[_0xe9f3('0x31')]=_[_0xe9f3('0x33')](db['ServicenowField'][_0xe9f3('0x2e')]);_0x345d5f[_0xe9f3('0x32')]=_[_0xe9f3('0x33')](_0x41c246[_0xe9f3('0x32')]);_0x345d5f['filters']=_[_0xe9f3('0x35')](_0x345d5f[_0xe9f3('0x31')],_0x345d5f[_0xe9f3('0x32')]);_0x20f650[_0xe9f3('0x36')]=_['intersection'](_0x345d5f[_0xe9f3('0x31')],qs[_0xe9f3('0x37')](_0x41c246[_0xe9f3('0x32')][_0xe9f3('0x37')]));_0x20f650[_0xe9f3('0x36')]=_0x20f650[_0xe9f3('0x36')][_0xe9f3('0x38')]?_0x20f650[_0xe9f3('0x36')]:_0x345d5f[_0xe9f3('0x31')];_0x20f650[_0xe9f3('0x3b')]=qs[_0xe9f3('0x3c')](_0x41c246[_0xe9f3('0x32')]['sort']);_0x20f650['where']=qs[_0xe9f3('0x34')](_[_0xe9f3('0x3d')](_0x41c246[_0xe9f3('0x32')],_0x345d5f['filters']));if(_0x41c246[_0xe9f3('0x32')][_0xe9f3('0x40')]){_0x20f650[_0xe9f3('0x3e')]=_[_0xe9f3('0x41')](_0x20f650[_0xe9f3('0x3e')],{'$or':_[_0xe9f3('0x2c')](_0x20f650[_0xe9f3('0x36')],function(_0x15eddc){var _0x5e435b={};_0x5e435b[_0x15eddc]={'$like':'%'+_0x41c246[_0xe9f3('0x32')][_0xe9f3('0x40')]+'%'};return _0x5e435b;})});}_0x20f650=_[_0xe9f3('0x41')]({},_0x20f650,_0x41c246['options']);return _0x518edc['getDescriptions'](_0x20f650);}})[_0xe9f3('0x27')](function(_0x1fb547){if(_0x1fb547){_0x17c836=_0x1fb547['length'];if(!_0x41c246[_0xe9f3('0x32')][_0xe9f3('0x39')](_0xe9f3('0x3a'))){_0x20f650['limit']=qs[_0xe9f3('0x1f')](_0x41c246[_0xe9f3('0x32')]['limit']);_0x20f650[_0xe9f3('0x1d')]=qs[_0xe9f3('0x1d')](_0x41c246[_0xe9f3('0x32')][_0xe9f3('0x1d')]);}return _0x518edc['getDescriptions'](_0x20f650);}})[_0xe9f3('0x27')](function(_0x3246fb){if(_0x3246fb){return _0x3246fb?{'count':_0x17c836,'rows':_0x3246fb}:null;}})[_0xe9f3('0x27')](respondWithResult(_0x44d3d1,null))['catch'](handleError(_0x44d3d1,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 395b030..30c0785 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 _0xd2bf=['lodash','moment','bluebird','path','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x5f4627,_0x28ac3f){var _0x15993e=function(_0x38c93e){while(--_0x38c93e){_0x5f4627['push'](_0x5f4627['shift']());}};_0x15993e(++_0x28ac3f);}(_0xd2bf,0x1dd));var _0xfd2b=function(_0x3b3f4f,_0x403216){_0x3b3f4f=_0x3b3f4f-0x0;var _0x174dbe=_0xd2bf[_0x3b3f4f];return _0x174dbe;};'use strict';var _=require(_0xfd2b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xfd2b('0x1'));var BPromise=require(_0xfd2b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd2b('0x3'));var rimraf=require('rimraf');var config=require(_0xfd2b('0x4'));var attributes=require(_0xfd2b('0x5'));module[_0xfd2b('0x6')]=function(_0x1abfd2,_0x443190){return _0x1abfd2['define'](_0xfd2b('0x7'),attributes,{'tableName':_0xfd2b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd48a=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','int_servicenow_configurations'];(function(_0x33ef42,_0x452e3f){var _0x5d9057=function(_0x1d1dc7){while(--_0x1d1dc7){_0x33ef42['push'](_0x33ef42['shift']());}};_0x5d9057(++_0x452e3f);}(_0xd48a,0x96));var _0xad48=function(_0x393dc7,_0x5338c8){_0x393dc7=_0x393dc7-0x0;var _0x432acb=_0xd48a[_0x393dc7];return _0x432acb;};'use strict';var _=require(_0xad48('0x0'));var util=require('util');var logger=require(_0xad48('0x1'))(_0xad48('0x2'));var moment=require(_0xad48('0x3'));var BPromise=require(_0xad48('0x4'));var rp=require(_0xad48('0x5'));var fs=require('fs');var path=require(_0xad48('0x6'));var rimraf=require('rimraf');var config=require(_0xad48('0x7'));var attributes=require(_0xad48('0x8'));module['exports']=function(_0x143780,_0x584cf0){return _0x143780['define']('ServicenowConfiguration',attributes,{'tableName':_0xad48('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index 4f94a7d..a4db921 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 _0xe5ff=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x14cc14,_0x40f9fd){var _0x3bff0d=function(_0x5693a3){while(--_0x5693a3){_0x14cc14['push'](_0x14cc14['shift']());}};_0x3bff0d(++_0x40f9fd);}(_0xe5ff,0xf7));var _0xfe5f=function(_0x2e4d53,_0x3dbbea){_0x2e4d53=_0x2e4d53-0x0;var _0x583512=_0xe5ff[_0x2e4d53];return _0x583512;};'use strict';var _=require(_0xfe5f('0x0'));var util=require(_0xfe5f('0x1'));var moment=require('moment');var BPromise=require(_0xfe5f('0x2'));var rs=require(_0xfe5f('0x3'));var fs=require('fs');var Redis=require(_0xfe5f('0x4'));var db=require(_0xfe5f('0x5'))['db'];var utils=require(_0xfe5f('0x6'));var logger=require(_0xfe5f('0x7'))(_0xfe5f('0x8'));var config=require(_0xfe5f('0x9'));var jayson=require(_0xfe5f('0xa'));var client=jayson[_0xfe5f('0xb')][_0xfe5f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x195769,_0x290fa2,_0x419b47){return new BPromise(function(_0x2f5e71,_0xb946){return client[_0xfe5f('0xd')](_0x195769,_0x419b47)[_0xfe5f('0xe')](function(_0x29f4e9){logger[_0xfe5f('0xf')](_0xfe5f('0x10'),_0x290fa2,'request\x20sent');logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x290fa2,_0xfe5f('0x11'),JSON[_0xfe5f('0x12')](_0x29f4e9));if(_0x29f4e9[_0xfe5f('0x13')]){if(_0x29f4e9[_0xfe5f('0x13')][_0xfe5f('0x14')]===0x1f4){logger[_0xfe5f('0x13')](_0xfe5f('0x10'),_0x290fa2,_0x29f4e9[_0xfe5f('0x13')][_0xfe5f('0x15')]);return _0xb946(_0x29f4e9['error']['message']);}logger[_0xfe5f('0x13')](_0xfe5f('0x10'),_0x290fa2,_0x29f4e9['error'][_0xfe5f('0x15')]);return _0x2f5e71(_0x29f4e9['error']['message']);}else{logger[_0xfe5f('0xf')](_0xfe5f('0x10'),_0x290fa2,'request\x20sent');_0x2f5e71(_0x29f4e9[_0xfe5f('0x16')]['message']);}})['catch'](function(_0x58c888){logger[_0xfe5f('0x13')](_0xfe5f('0x10'),_0x290fa2,_0x58c888);_0xb946(_0x58c888);});});} \ No newline at end of file +var _0x133b=['error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x122e9b,_0x391bf4){var _0x22c247=function(_0x1b2c65){while(--_0x1b2c65){_0x122e9b['push'](_0x122e9b['shift']());}};_0x22c247(++_0x391bf4);}(_0x133b,0x101));var _0xb133=function(_0x4f65ed,_0x2cd830){_0x4f65ed=_0x4f65ed-0x0;var _0x2d9d39=_0x133b[_0x4f65ed];return _0x2d9d39;};'use strict';var _=require(_0xb133('0x0'));var util=require(_0xb133('0x1'));var moment=require(_0xb133('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb133('0x3'));var db=require(_0xb133('0x4'))['db'];var utils=require(_0xb133('0x5'));var logger=require('../../config/logger')(_0xb133('0x6'));var config=require(_0xb133('0x7'));var jayson=require(_0xb133('0x8'));var client=jayson['client'][_0xb133('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x96cf09,_0xefc7d,_0x36ddea){return new BPromise(function(_0x7016eb,_0x5380f6){return client[_0xb133('0xa')](_0x96cf09,_0x36ddea)[_0xb133('0xb')](function(_0x428388){logger[_0xb133('0xc')]('ServicenowConfiguration,\x20%s,\x20%s',_0xefc7d,_0xb133('0xd'));logger[_0xb133('0xe')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0xefc7d,_0xb133('0xd'),JSON[_0xb133('0xf')](_0x428388));if(_0x428388[_0xb133('0x10')]){if(_0x428388[_0xb133('0x10')][_0xb133('0x11')]===0x1f4){logger['error'](_0xb133('0x12'),_0xefc7d,_0x428388[_0xb133('0x10')][_0xb133('0x13')]);return _0x5380f6(_0x428388['error'][_0xb133('0x13')]);}logger[_0xb133('0x10')](_0xb133('0x12'),_0xefc7d,_0x428388['error'][_0xb133('0x13')]);return _0x7016eb(_0x428388[_0xb133('0x10')][_0xb133('0x13')]);}else{logger[_0xb133('0xc')](_0xb133('0x12'),_0xefc7d,'request\x20sent');_0x7016eb(_0x428388[_0xb133('0x14')][_0xb133('0x13')]);}})['catch'](function(_0xbb89ae){logger[_0xb133('0x10')](_0xb133('0x12'),_0xefc7d,_0xbb89ae);_0x5380f6(_0xbb89ae);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index b3460fb..5ffe9fe 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 _0x3016=['get','/:id','show','post','put','update','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3016,0x166));var _0x6301=function(_0x50449b,_0x1dc705){_0x50449b=_0x50449b-0x0;var _0x6367d5=_0x3016[_0x50449b];return _0x6367d5;};'use strict';var multer=require(_0x6301('0x0'));var util=require(_0x6301('0x1'));var path=require(_0x6301('0x2'));var timeout=require(_0x6301('0x3'));var express=require('express');var router=express[_0x6301('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6301('0x5'));var interaction=require(_0x6301('0x6'));var config=require(_0x6301('0x7'));var controller=require(_0x6301('0x8'));router['get']('/',auth[_0x6301('0x9')](),controller['index']);router[_0x6301('0xa')](_0x6301('0xb'),auth[_0x6301('0x9')](),controller[_0x6301('0xc')]);router[_0x6301('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6301('0xe')](_0x6301('0xb'),auth[_0x6301('0x9')](),controller[_0x6301('0xf')]);router['delete'](_0x6301('0xb'),auth[_0x6301('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x23ed=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x23ed,0x1b6));var _0xd23e=function(_0x1ea6eb,_0x108e77){_0x1ea6eb=_0x1ea6eb-0x0;var _0x24f28c=_0x23ed[_0x1ea6eb];return _0x24f28c;};'use strict';var multer=require(_0xd23e('0x0'));var util=require(_0xd23e('0x1'));var path=require(_0xd23e('0x2'));var timeout=require(_0xd23e('0x3'));var express=require(_0xd23e('0x4'));var router=express[_0xd23e('0x5')]();var fs_extra=require(_0xd23e('0x6'));var auth=require(_0xd23e('0x7'));var interaction=require(_0xd23e('0x8'));var config=require(_0xd23e('0x9'));var controller=require(_0xd23e('0xa'));router['get']('/',auth[_0xd23e('0xb')](),controller[_0xd23e('0xc')]);router[_0xd23e('0xd')](_0xd23e('0xe'),auth[_0xd23e('0xb')](),controller['show']);router[_0xd23e('0xf')]('/',auth[_0xd23e('0xb')](),controller[_0xd23e('0x10')]);router[_0xd23e('0x11')](_0xd23e('0xe'),auth[_0xd23e('0xb')](),controller[_0xd23e('0x12')]);router[_0xd23e('0x13')](_0xd23e('0xe'),auth[_0xd23e('0xb')](),controller[_0xd23e('0x14')]);module[_0xd23e('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 f0a2043..95e51a5 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 _0x3a29=['STRING','variable','BOOLEAN','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x52e795,_0x585e97){var _0x5545cd=function(_0x346494){while(--_0x346494){_0x52e795['push'](_0x52e795['shift']());}};_0x5545cd(++_0x585e97);}(_0x3a29,0x11a));var _0x93a2=function(_0x353598,_0x33e234){_0x353598=_0x353598-0x0;var _0x4cf82e=_0x3a29[_0x353598];return _0x4cf82e;};'use strict';var Sequelize=require('sequelize');module[_0x93a2('0x0')]={'type':{'type':Sequelize[_0x93a2('0x1')](_0x93a2('0x2'),'variable',_0x93a2('0x3'),_0x93a2('0x4'),_0x93a2('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x93a2('0x6')]},'keyType':{'type':Sequelize[_0x93a2('0x1')](_0x93a2('0x2'),_0x93a2('0x7'),_0x93a2('0x3'))},'keyContent':{'type':Sequelize[_0x93a2('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x93a2('0x6')]},'customField':{'type':Sequelize[_0x93a2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x93a2('0x6')]}}; \ No newline at end of file +var _0xf1dd=['customVariable','keyValue','string','STRING','BOOLEAN','exports','ENUM','variable'];(function(_0x20dc06,_0x293e17){var _0x371f1c=function(_0xc356c6){while(--_0xc356c6){_0x20dc06['push'](_0x20dc06['shift']());}};_0x371f1c(++_0x293e17);}(_0xf1dd,0x105));var _0xdf1d=function(_0x4d8789,_0x3fdff1){_0x4d8789=_0x4d8789-0x0;var _0x404e41=_0xf1dd[_0x4d8789];return _0x404e41;};'use strict';var Sequelize=require('sequelize');module[_0xdf1d('0x0')]={'type':{'type':Sequelize[_0xdf1d('0x1')]('string',_0xdf1d('0x2'),_0xdf1d('0x3'),_0xdf1d('0x4'),'picklist'),'defaultValue':_0xdf1d('0x5')},'content':{'type':Sequelize[_0xdf1d('0x6')]},'key':{'type':Sequelize[_0xdf1d('0x6')]},'keyType':{'type':Sequelize[_0xdf1d('0x1')](_0xdf1d('0x5'),'variable',_0xdf1d('0x3'))},'keyContent':{'type':Sequelize[_0xdf1d('0x6')]},'idField':{'type':Sequelize[_0xdf1d('0x6')]},'nameField':{'type':Sequelize[_0xdf1d('0x6')]},'customField':{'type':Sequelize[_0xdf1d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index eda857f..0d2f12d 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 _0xfe44=['set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit'];(function(_0x4cb247,_0x454b5b){var _0xd8d402=function(_0xa36303){while(--_0xa36303){_0x4cb247['push'](_0x4cb247['shift']());}};_0xd8d402(++_0x454b5b);}(_0xfe44,0x105));var _0x4fe4=function(_0x1d8361,_0x32eef7){_0x1d8361=_0x1d8361-0x0;var _0x5adf27=_0xfe44[_0x1d8361];return _0x5adf27;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fe4('0x0'));var zipdir=require(_0x4fe4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4fe4('0x2'));var moment=require('moment');var BPromise=require(_0x4fe4('0x3'));var Mustache=require(_0x4fe4('0x4'));var util=require('util');var path=require(_0x4fe4('0x5'));var sox=require(_0x4fe4('0x6'));var csv=require('to-csv');var ejs=require(_0x4fe4('0x7'));var fs=require('fs');var fs_extra=require(_0x4fe4('0x8'));var _=require(_0x4fe4('0x9'));var squel=require(_0x4fe4('0xa'));var crypto=require(_0x4fe4('0xb'));var jsforce=require(_0x4fe4('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4fe4('0xd'));var querystring=require('querystring');var Papa=require(_0x4fe4('0xe'));var Redis=require(_0x4fe4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4fe4('0x10'));var as=require(_0x4fe4('0x11'));var hardwareService=require(_0x4fe4('0x12'));var logger=require(_0x4fe4('0x13'))('api');var utils=require(_0x4fe4('0x14'));var config=require(_0x4fe4('0x15'));var licenseUtil=require(_0x4fe4('0x16'));var db=require(_0x4fe4('0x17'))['db'];function respondWithStatusCode(_0x21082f,_0x4dd21c){_0x4dd21c=_0x4dd21c||0xcc;return function(_0x445557){if(_0x445557){return _0x21082f['sendStatus'](_0x4dd21c);}return _0x21082f[_0x4fe4('0x18')](_0x4dd21c)[_0x4fe4('0x19')]();};}function respondWithResult(_0x4c2725,_0x2bfcdc){_0x2bfcdc=_0x2bfcdc||0xc8;return function(_0x16d56d){if(_0x16d56d){return _0x4c2725[_0x4fe4('0x18')](_0x2bfcdc)[_0x4fe4('0x1a')](_0x16d56d);}};}function respondWithFilteredResult(_0xdd0f15,_0x241e64){return function(_0x3dfb01){if(_0x3dfb01){var _0x34a8b1=typeof _0x241e64['offset']===_0x4fe4('0x1b')&&typeof _0x241e64['limit']==='undefined';var _0x297066=_0x3dfb01[_0x4fe4('0x1c')];var _0x2d21a5=_0x34a8b1?0x0:_0x241e64[_0x4fe4('0x1d')];var _0x1cd7ff=_0x34a8b1?_0x3dfb01['count']:_0x241e64[_0x4fe4('0x1d')]+_0x241e64[_0x4fe4('0x1e')];var _0x5e71ae;if(_0x1cd7ff>=_0x297066){_0x1cd7ff=_0x297066;_0x5e71ae=0xc8;}else{_0x5e71ae=0xce;}_0xdd0f15[_0x4fe4('0x18')](_0x5e71ae);return _0xdd0f15[_0x4fe4('0x1f')](_0x4fe4('0x20'),_0x2d21a5+'-'+_0x1cd7ff+'/'+_0x297066)[_0x4fe4('0x1a')](_0x3dfb01);}return null;};}function patchUpdates(_0x556607){return function(_0x537c41){try{jsonpatch['apply'](_0x537c41,_0x556607,!![]);}catch(_0x17606c){return BPromise[_0x4fe4('0x21')](_0x17606c);}return _0x537c41[_0x4fe4('0x22')]();};}function saveUpdates(_0x30bafc,_0xf48ed3){return function(_0x2ca8f5){if(_0x2ca8f5){return _0x2ca8f5[_0x4fe4('0x23')](_0x30bafc)[_0x4fe4('0x24')](function(_0x274aa2){return _0x274aa2;});}return null;};}function removeEntity(_0x357afd,_0x5e0060){return function(_0x3a76ed){if(_0x3a76ed){return _0x3a76ed[_0x4fe4('0x25')]()[_0x4fe4('0x24')](function(){_0x357afd[_0x4fe4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16099a,_0x13327b){return function(_0x40e393){if(!_0x40e393){_0x16099a[_0x4fe4('0x26')](0x194);}return _0x40e393;};}function handleError(_0x50d4f0,_0x1e8b87){_0x1e8b87=_0x1e8b87||0x1f4;return function(_0x3c044c){logger[_0x4fe4('0x27')](_0x3c044c[_0x4fe4('0x28')]);if(_0x3c044c[_0x4fe4('0x29')]){delete _0x3c044c[_0x4fe4('0x29')];}_0x50d4f0[_0x4fe4('0x18')](_0x1e8b87)[_0x4fe4('0x2a')](_0x3c044c);};}exports[_0x4fe4('0x2b')]=function(_0x11210d,_0xaf30eb){var _0x37168e={},_0x503032={},_0x1de76e={'count':0x0,'rows':[]};var _0x528380=_['map'](db[_0x4fe4('0x2c')][_0x4fe4('0x2d')],function(_0x3f74db){return{'name':_0x3f74db[_0x4fe4('0x2e')],'type':_0x3f74db['type']['key']};});_0x503032[_0x4fe4('0x2f')]=_[_0x4fe4('0x30')](_0x528380,_0x4fe4('0x29'));_0x503032[_0x4fe4('0x31')]=_[_0x4fe4('0x32')](_0x11210d[_0x4fe4('0x31')]);_0x503032[_0x4fe4('0x33')]=_['intersection'](_0x503032[_0x4fe4('0x2f')],_0x503032[_0x4fe4('0x31')]);_0x37168e[_0x4fe4('0x34')]=_[_0x4fe4('0x35')](_0x503032[_0x4fe4('0x2f')],qs[_0x4fe4('0x36')](_0x11210d[_0x4fe4('0x31')][_0x4fe4('0x36')]));_0x37168e[_0x4fe4('0x34')]=_0x37168e[_0x4fe4('0x34')][_0x4fe4('0x37')]?_0x37168e[_0x4fe4('0x34')]:_0x503032[_0x4fe4('0x2f')];if(!_0x11210d[_0x4fe4('0x31')][_0x4fe4('0x38')]('nolimit')){_0x37168e[_0x4fe4('0x1e')]=qs[_0x4fe4('0x1e')](_0x11210d['query'][_0x4fe4('0x1e')]);_0x37168e[_0x4fe4('0x1d')]=qs[_0x4fe4('0x1d')](_0x11210d[_0x4fe4('0x31')][_0x4fe4('0x1d')]);}_0x37168e[_0x4fe4('0x39')]=qs[_0x4fe4('0x3a')](_0x11210d['query']['sort']);_0x37168e[_0x4fe4('0x3b')]=qs[_0x4fe4('0x33')](_['pick'](_0x11210d['query'],_0x503032[_0x4fe4('0x33')]),_0x528380);if(_0x11210d['query'][_0x4fe4('0x3c')]){_0x37168e[_0x4fe4('0x3b')]=_[_0x4fe4('0x3d')](_0x37168e[_0x4fe4('0x3b')],{'$or':_[_0x4fe4('0x30')](_0x528380,function(_0x1e3be3){if(_0x1e3be3[_0x4fe4('0x3e')]!=='VIRTUAL'){var _0x496185={};_0x496185[_0x1e3be3[_0x4fe4('0x29')]]={'$like':'%'+_0x11210d[_0x4fe4('0x31')][_0x4fe4('0x3c')]+'%'};return _0x496185;}})});}_0x37168e=_[_0x4fe4('0x3d')]({},_0x37168e,_0x11210d[_0x4fe4('0x3f')]);var _0x1ea0e5={'where':_0x37168e[_0x4fe4('0x3b')]};return db[_0x4fe4('0x2c')][_0x4fe4('0x1c')](_0x1ea0e5)[_0x4fe4('0x24')](function(_0x133488){_0x1de76e[_0x4fe4('0x1c')]=_0x133488;if(_0x11210d[_0x4fe4('0x31')][_0x4fe4('0x40')]){_0x37168e[_0x4fe4('0x41')]=[{'all':!![]}];}return db[_0x4fe4('0x2c')][_0x4fe4('0x42')](_0x37168e);})[_0x4fe4('0x24')](function(_0x3cf461){_0x1de76e[_0x4fe4('0x43')]=_0x3cf461;return _0x1de76e;})[_0x4fe4('0x24')](respondWithFilteredResult(_0xaf30eb,_0x37168e))[_0x4fe4('0x44')](handleError(_0xaf30eb,null));};exports['show']=function(_0x3c4fbc,_0x2941d1){var _0x3e63ce={'raw':!![],'where':{'id':_0x3c4fbc[_0x4fe4('0x45')]['id']}},_0x39eb0d={};_0x39eb0d[_0x4fe4('0x2f')]=_['keys'](db[_0x4fe4('0x2c')][_0x4fe4('0x2d')]);_0x39eb0d[_0x4fe4('0x31')]=_[_0x4fe4('0x32')](_0x3c4fbc[_0x4fe4('0x31')]);_0x39eb0d[_0x4fe4('0x33')]=_[_0x4fe4('0x35')](_0x39eb0d['model'],_0x39eb0d[_0x4fe4('0x31')]);_0x3e63ce[_0x4fe4('0x34')]=_[_0x4fe4('0x35')](_0x39eb0d['model'],qs[_0x4fe4('0x36')](_0x3c4fbc[_0x4fe4('0x31')][_0x4fe4('0x36')]));_0x3e63ce['attributes']=_0x3e63ce['attributes'][_0x4fe4('0x37')]?_0x3e63ce['attributes']:_0x39eb0d[_0x4fe4('0x2f')];if(_0x3c4fbc[_0x4fe4('0x31')]['includeAll']){_0x3e63ce['include']=[{'all':!![]}];}_0x3e63ce=_[_0x4fe4('0x3d')]({},_0x3e63ce,_0x3c4fbc[_0x4fe4('0x3f')]);return db['ServicenowField'][_0x4fe4('0x46')](_0x3e63ce)[_0x4fe4('0x24')](handleEntityNotFound(_0x2941d1,null))[_0x4fe4('0x24')](respondWithResult(_0x2941d1,null))[_0x4fe4('0x44')](handleError(_0x2941d1,null));};exports[_0x4fe4('0x47')]=function(_0x57fe91,_0x24e03d){return db[_0x4fe4('0x2c')][_0x4fe4('0x47')](_0x57fe91[_0x4fe4('0x48')],{})[_0x4fe4('0x24')](respondWithResult(_0x24e03d,0xc9))[_0x4fe4('0x44')](handleError(_0x24e03d,null));};exports['update']=function(_0x5ec792,_0x219ac5){if(_0x5ec792[_0x4fe4('0x48')]['id']){delete _0x5ec792[_0x4fe4('0x48')]['id'];}return db[_0x4fe4('0x2c')]['find']({'where':{'id':_0x5ec792[_0x4fe4('0x45')]['id']}})[_0x4fe4('0x24')](handleEntityNotFound(_0x219ac5,null))[_0x4fe4('0x24')](saveUpdates(_0x5ec792[_0x4fe4('0x48')],null))['then'](respondWithResult(_0x219ac5,null))['catch'](handleError(_0x219ac5,null));};exports[_0x4fe4('0x25')]=function(_0x24b0b0,_0x4e59d8){return db[_0x4fe4('0x2c')][_0x4fe4('0x46')]({'where':{'id':_0x24b0b0['params']['id']}})[_0x4fe4('0x24')](handleEntityNotFound(_0x4e59d8,null))[_0x4fe4('0x24')](removeEntity(_0x4e59d8,null))['catch'](handleError(_0x4e59d8,null));}; \ No newline at end of file +var _0x34ef=['destroy','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../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','stack','name','send','index','map','ServicenowField','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','then','includeAll','include','rows','catch','show','params','options','find','create','body'];(function(_0x4d617a,_0xf1bc41){var _0x5b04e5=function(_0x6235c0){while(--_0x6235c0){_0x4d617a['push'](_0x4d617a['shift']());}};_0x5b04e5(++_0xf1bc41);}(_0x34ef,0x1b7));var _0xf34e=function(_0x14aaa7,_0x4b6b89){_0x14aaa7=_0x14aaa7-0x0;var _0x55c8ef=_0x34ef[_0x14aaa7];return _0x55c8ef;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf34e('0x0'));var zipdir=require(_0xf34e('0x1'));var jsonpatch=require(_0xf34e('0x2'));var rp=require('request-promise');var moment=require(_0xf34e('0x3'));var BPromise=require(_0xf34e('0x4'));var Mustache=require(_0xf34e('0x5'));var util=require(_0xf34e('0x6'));var path=require(_0xf34e('0x7'));var sox=require(_0xf34e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf34e('0x9'));var _=require(_0xf34e('0xa'));var squel=require(_0xf34e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf34e('0xc'));var querystring=require(_0xf34e('0xd'));var Papa=require(_0xf34e('0xe'));var Redis=require(_0xf34e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf34e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf34e('0x11'))(_0xf34e('0x12'));var utils=require(_0xf34e('0x13'));var config=require(_0xf34e('0x14'));var licenseUtil=require(_0xf34e('0x15'));var db=require(_0xf34e('0x16'))['db'];function respondWithStatusCode(_0x4c89b3,_0x1d070d){_0x1d070d=_0x1d070d||0xcc;return function(_0x1d8ad6){if(_0x1d8ad6){return _0x4c89b3[_0xf34e('0x17')](_0x1d070d);}return _0x4c89b3[_0xf34e('0x18')](_0x1d070d)[_0xf34e('0x19')]();};}function respondWithResult(_0x30cea1,_0x461c87){_0x461c87=_0x461c87||0xc8;return function(_0x2064ae){if(_0x2064ae){return _0x30cea1[_0xf34e('0x18')](_0x461c87)[_0xf34e('0x1a')](_0x2064ae);}};}function respondWithFilteredResult(_0x3f39a3,_0x5bfff4){return function(_0x365cfe){if(_0x365cfe){var _0x1a3c96=typeof _0x5bfff4[_0xf34e('0x1b')]===_0xf34e('0x1c')&&typeof _0x5bfff4[_0xf34e('0x1d')]===_0xf34e('0x1c');var _0x26d64f=_0x365cfe[_0xf34e('0x1e')];var _0x46293f=_0x1a3c96?0x0:_0x5bfff4[_0xf34e('0x1b')];var _0x23ff53=_0x1a3c96?_0x365cfe[_0xf34e('0x1e')]:_0x5bfff4['offset']+_0x5bfff4[_0xf34e('0x1d')];var _0x439761;if(_0x23ff53>=_0x26d64f){_0x23ff53=_0x26d64f;_0x439761=0xc8;}else{_0x439761=0xce;}_0x3f39a3[_0xf34e('0x18')](_0x439761);return _0x3f39a3['set'](_0xf34e('0x1f'),_0x46293f+'-'+_0x23ff53+'/'+_0x26d64f)[_0xf34e('0x1a')](_0x365cfe);}return null;};}function patchUpdates(_0x37047a){return function(_0x4f6791){try{jsonpatch[_0xf34e('0x20')](_0x4f6791,_0x37047a,!![]);}catch(_0x4897aa){return BPromise[_0xf34e('0x21')](_0x4897aa);}return _0x4f6791[_0xf34e('0x22')]();};}function saveUpdates(_0x59390e,_0x44738a){return function(_0x59834d){if(_0x59834d){return _0x59834d[_0xf34e('0x23')](_0x59390e)['then'](function(_0xc2270f){return _0xc2270f;});}return null;};}function removeEntity(_0x254198,_0x5dd1f6){return function(_0x42e462){if(_0x42e462){return _0x42e462['destroy']()['then'](function(){_0x254198[_0xf34e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28e32a,_0x57071c){return function(_0x56b430){if(!_0x56b430){_0x28e32a[_0xf34e('0x17')](0x194);}return _0x56b430;};}function handleError(_0x578585,_0x4d3de5){_0x4d3de5=_0x4d3de5||0x1f4;return function(_0x587b36){logger['error'](_0x587b36[_0xf34e('0x24')]);if(_0x587b36[_0xf34e('0x25')]){delete _0x587b36['name'];}_0x578585['status'](_0x4d3de5)[_0xf34e('0x26')](_0x587b36);};}exports[_0xf34e('0x27')]=function(_0x3a7df7,_0x1ab4b4){var _0x432079={},_0x376f56={},_0x36fc93={'count':0x0,'rows':[]};var _0x255446=_[_0xf34e('0x28')](db[_0xf34e('0x29')][_0xf34e('0x2a')],function(_0x45ed93){return{'name':_0x45ed93['fieldName'],'type':_0x45ed93[_0xf34e('0x2b')][_0xf34e('0x2c')]};});_0x376f56[_0xf34e('0x2d')]=_['map'](_0x255446,_0xf34e('0x25'));_0x376f56['query']=_[_0xf34e('0x2e')](_0x3a7df7['query']);_0x376f56[_0xf34e('0x2f')]=_[_0xf34e('0x30')](_0x376f56[_0xf34e('0x2d')],_0x376f56[_0xf34e('0x31')]);_0x432079[_0xf34e('0x32')]=_[_0xf34e('0x30')](_0x376f56[_0xf34e('0x2d')],qs[_0xf34e('0x33')](_0x3a7df7[_0xf34e('0x31')][_0xf34e('0x33')]));_0x432079[_0xf34e('0x32')]=_0x432079[_0xf34e('0x32')][_0xf34e('0x34')]?_0x432079[_0xf34e('0x32')]:_0x376f56['model'];if(!_0x3a7df7[_0xf34e('0x31')][_0xf34e('0x35')](_0xf34e('0x36'))){_0x432079[_0xf34e('0x1d')]=qs[_0xf34e('0x1d')](_0x3a7df7['query'][_0xf34e('0x1d')]);_0x432079[_0xf34e('0x1b')]=qs[_0xf34e('0x1b')](_0x3a7df7['query'][_0xf34e('0x1b')]);}_0x432079[_0xf34e('0x37')]=qs[_0xf34e('0x38')](_0x3a7df7[_0xf34e('0x31')][_0xf34e('0x38')]);_0x432079[_0xf34e('0x39')]=qs['filters'](_[_0xf34e('0x3a')](_0x3a7df7[_0xf34e('0x31')],_0x376f56[_0xf34e('0x2f')]),_0x255446);if(_0x3a7df7[_0xf34e('0x31')][_0xf34e('0x3b')]){_0x432079['where']=_['merge'](_0x432079[_0xf34e('0x39')],{'$or':_['map'](_0x255446,function(_0x20468a){if(_0x20468a['type']!=='VIRTUAL'){var _0x515e97={};_0x515e97[_0x20468a[_0xf34e('0x25')]]={'$like':'%'+_0x3a7df7['query'][_0xf34e('0x3b')]+'%'};return _0x515e97;}})});}_0x432079=_[_0xf34e('0x3c')]({},_0x432079,_0x3a7df7['options']);var _0x4adf1c={'where':_0x432079[_0xf34e('0x39')]};return db[_0xf34e('0x29')]['count'](_0x4adf1c)[_0xf34e('0x3d')](function(_0xfae95e){_0x36fc93[_0xf34e('0x1e')]=_0xfae95e;if(_0x3a7df7[_0xf34e('0x31')][_0xf34e('0x3e')]){_0x432079[_0xf34e('0x3f')]=[{'all':!![]}];}return db[_0xf34e('0x29')]['findAll'](_0x432079);})[_0xf34e('0x3d')](function(_0x10a1fc){_0x36fc93[_0xf34e('0x40')]=_0x10a1fc;return _0x36fc93;})[_0xf34e('0x3d')](respondWithFilteredResult(_0x1ab4b4,_0x432079))[_0xf34e('0x41')](handleError(_0x1ab4b4,null));};exports[_0xf34e('0x42')]=function(_0x54c81c,_0x18dd70){var _0x3351e7={'raw':!![],'where':{'id':_0x54c81c[_0xf34e('0x43')]['id']}},_0x551648={};_0x551648[_0xf34e('0x2d')]=_[_0xf34e('0x2e')](db[_0xf34e('0x29')][_0xf34e('0x2a')]);_0x551648[_0xf34e('0x31')]=_[_0xf34e('0x2e')](_0x54c81c[_0xf34e('0x31')]);_0x551648['filters']=_['intersection'](_0x551648[_0xf34e('0x2d')],_0x551648[_0xf34e('0x31')]);_0x3351e7[_0xf34e('0x32')]=_[_0xf34e('0x30')](_0x551648[_0xf34e('0x2d')],qs[_0xf34e('0x33')](_0x54c81c[_0xf34e('0x31')][_0xf34e('0x33')]));_0x3351e7['attributes']=_0x3351e7[_0xf34e('0x32')]['length']?_0x3351e7[_0xf34e('0x32')]:_0x551648[_0xf34e('0x2d')];if(_0x54c81c[_0xf34e('0x31')]['includeAll']){_0x3351e7['include']=[{'all':!![]}];}_0x3351e7=_['merge']({},_0x3351e7,_0x54c81c[_0xf34e('0x44')]);return db[_0xf34e('0x29')][_0xf34e('0x45')](_0x3351e7)[_0xf34e('0x3d')](handleEntityNotFound(_0x18dd70,null))[_0xf34e('0x3d')](respondWithResult(_0x18dd70,null))['catch'](handleError(_0x18dd70,null));};exports[_0xf34e('0x46')]=function(_0x87e529,_0x4375d3){return db[_0xf34e('0x29')][_0xf34e('0x46')](_0x87e529[_0xf34e('0x47')],{})[_0xf34e('0x3d')](respondWithResult(_0x4375d3,0xc9))['catch'](handleError(_0x4375d3,null));};exports[_0xf34e('0x23')]=function(_0x990734,_0x82571d){if(_0x990734[_0xf34e('0x47')]['id']){delete _0x990734[_0xf34e('0x47')]['id'];}return db[_0xf34e('0x29')]['find']({'where':{'id':_0x990734[_0xf34e('0x43')]['id']}})[_0xf34e('0x3d')](handleEntityNotFound(_0x82571d,null))[_0xf34e('0x3d')](saveUpdates(_0x990734[_0xf34e('0x47')],null))['then'](respondWithResult(_0x82571d,null))[_0xf34e('0x41')](handleError(_0x82571d,null));};exports[_0xf34e('0x48')]=function(_0x461a54,_0xaf25ef){return db[_0xf34e('0x29')]['find']({'where':{'id':_0x461a54['params']['id']}})[_0xf34e('0x3d')](handleEntityNotFound(_0xaf25ef,null))[_0xf34e('0x3d')](removeEntity(_0xaf25ef,null))[_0xf34e('0x41')](handleError(_0xaf25ef,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 6f8c90a..abe347e 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 _0x188b=['lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intServicenowField.attributes','exports','define','int_servicenow_fields','servicenow_unique_index','idField','FieldId'];(function(_0x5c8c57,_0x1f4a6e){var _0x70a453=function(_0x41bbc2){while(--_0x41bbc2){_0x5c8c57['push'](_0x5c8c57['shift']());}};_0x70a453(++_0x1f4a6e);}(_0x188b,0x15e));var _0xb188=function(_0x1075a7,_0x3b3115){_0x1075a7=_0x1075a7-0x0;var _0x1e78c5=_0x188b[_0x1075a7];return _0x1e78c5;};'use strict';var _=require(_0xb188('0x0'));var util=require(_0xb188('0x1'));var logger=require(_0xb188('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb188('0x3'));var rp=require(_0xb188('0x4'));var fs=require('fs');var path=require(_0xb188('0x5'));var rimraf=require(_0xb188('0x6'));var config=require('../../config/environment');var attributes=require(_0xb188('0x7'));module[_0xb188('0x8')]=function(_0x552b1a,_0x25d9df){return _0x552b1a[_0xb188('0x9')]('ServicenowField',attributes,{'tableName':_0xb188('0xa'),'paranoid':![],'indexes':[{'name':_0xb188('0xb'),'fields':[_0xb188('0xc'),_0xb188('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcbd3=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','ServicenowField'];(function(_0xd4470d,_0x47318d){var _0x5544c5=function(_0x3486cb){while(--_0x3486cb){_0xd4470d['push'](_0xd4470d['shift']());}};_0x5544c5(++_0x47318d);}(_0xcbd3,0x86));var _0x3cbd=function(_0x5b3155,_0x573dbb){_0x5b3155=_0x5b3155-0x0;var _0x200a1a=_0xcbd3[_0x5b3155];return _0x200a1a;};'use strict';var _=require('lodash');var util=require(_0x3cbd('0x0'));var logger=require(_0x3cbd('0x1'))(_0x3cbd('0x2'));var moment=require(_0x3cbd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3cbd('0x4'));var rimraf=require(_0x3cbd('0x5'));var config=require(_0x3cbd('0x6'));var attributes=require('./intServicenowField.attributes');module[_0x3cbd('0x7')]=function(_0x28d2cd,_0x586d7a){return _0x28d2cd['define'](_0x3cbd('0x8'),attributes,{'tableName':_0x3cbd('0x9'),'paranoid':![],'indexes':[{'name':_0x3cbd('0xa'),'fields':[_0x3cbd('0xb'),_0x3cbd('0xc')],'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 f9636b5..dd47f9d 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 _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x34aaee,_0x467c53){var _0x217a0e=function(_0x2dfcd7){while(--_0x2dfcd7){_0x34aaee['push'](_0x34aaee['shift']());}};_0x217a0e(++_0x467c53);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5c6951,_0x507abb){_0x5c6951=_0x5c6951-0x0;var _0x5ee145=_0xbdb7[_0x5c6951];return _0x5ee145;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 63b3b09..66d3aae 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x1a2e0d,_0x3e18c8){var _0x42ce38=function(_0x1b34fb){while(--_0x1b34fb){_0x1a2e0d['push'](_0x1a2e0d['shift']());}};_0x42ce38(++_0x3e18c8);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x164fe9,_0x208caa){var _0x17d9cc=function(_0xdf45e4){while(--_0xdf45e4){_0x164fe9['push'](_0x164fe9['shift']());}};_0x17d9cc(++_0x208caa);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 249a3cf..b84cfc3 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(_0x5e00cc,_0x1c9414){var _0xfd4bb7=function(_0x246fcc){while(--_0x246fcc){_0x5e00cc['push'](_0x5e00cc['shift']());}};_0xfd4bb7(++_0x1c9414);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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(_0x3af43c,_0x414d69){var _0x4b370d=function(_0x1dc71f){while(--_0x1dc71f){_0x3af43c['push'](_0x3af43c['shift']());}};_0x4b370d(++_0x414d69);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 35763a5..af0b9d9 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 _0x6cd3=['zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','SugarcrmAccount','rows','catch','show','params','length','options','create','body','find','getConfigurations','findOne','order','addConfiguration','AccountId','getSubjects','channel','getDescriptions','SugarcrmField','Subjects','Descriptions','getFields','assigned_user_id','created_by','description','duration_hours','parent_id','parent_type','parent_name','direction','password','remoteUri','slice','format','%s%s','/service/v4_1/rest.php','JSON','stringify','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','includes','endsWith','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf'];(function(_0x74c1ee,_0x533e4f){var _0x43f6dc=function(_0x16a0b2){while(--_0x16a0b2){_0x74c1ee['push'](_0x74c1ee['shift']());}};_0x43f6dc(++_0x533e4f);}(_0x6cd3,0x14c));var _0x36cd=function(_0x466af7,_0x2f7551){_0x466af7=_0x466af7-0x0;var _0x348c96=_0x6cd3[_0x466af7];return _0x348c96;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x36cd('0x0'));var zipdir=require(_0x36cd('0x1'));var jsonpatch=require(_0x36cd('0x2'));var rp=require(_0x36cd('0x3'));var moment=require(_0x36cd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x36cd('0x5'));var util=require('util');var path=require(_0x36cd('0x6'));var sox=require(_0x36cd('0x7'));var csv=require(_0x36cd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x36cd('0x9'));var squel=require(_0x36cd('0xa'));var crypto=require(_0x36cd('0xb'));var jsforce=require(_0x36cd('0xc'));var deskjs=require(_0x36cd('0xd'));var toCsv=require(_0x36cd('0x8'));var querystring=require(_0x36cd('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x36cd('0xf'));var as=require(_0x36cd('0x10'));var hardwareService=require(_0x36cd('0x11'));var logger=require(_0x36cd('0x12'))('api');var utils=require(_0x36cd('0x13'));var config=require(_0x36cd('0x14'));var licenseUtil=require(_0x36cd('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4e3776,_0x1e1bb1){_0x1e1bb1=_0x1e1bb1||0xcc;return function(_0x4071d7){if(_0x4071d7){return _0x4e3776[_0x36cd('0x16')](_0x1e1bb1);}return _0x4e3776[_0x36cd('0x17')](_0x1e1bb1)[_0x36cd('0x18')]();};}function respondWithResult(_0x12f8d1,_0xdd090c){_0xdd090c=_0xdd090c||0xc8;return function(_0x3ba994){if(_0x3ba994){return _0x12f8d1[_0x36cd('0x17')](_0xdd090c)[_0x36cd('0x19')](_0x3ba994);}};}function respondWithFilteredResult(_0x3121cd,_0x58f643){return function(_0x21024f){if(_0x21024f){var _0x4f5290=typeof _0x58f643[_0x36cd('0x1a')]===_0x36cd('0x1b')&&typeof _0x58f643['limit']===_0x36cd('0x1b');var _0x125f7a=_0x21024f[_0x36cd('0x1c')];var _0x522cdb=_0x4f5290?0x0:_0x58f643[_0x36cd('0x1a')];var _0x3ade59=_0x4f5290?_0x21024f[_0x36cd('0x1c')]:_0x58f643[_0x36cd('0x1a')]+_0x58f643['limit'];var _0x3f13f1;if(_0x3ade59>=_0x125f7a){_0x3ade59=_0x125f7a;_0x3f13f1=0xc8;}else{_0x3f13f1=0xce;}_0x3121cd[_0x36cd('0x17')](_0x3f13f1);return _0x3121cd[_0x36cd('0x1d')](_0x36cd('0x1e'),_0x522cdb+'-'+_0x3ade59+'/'+_0x125f7a)['json'](_0x21024f);}return null;};}function patchUpdates(_0x46269c){return function(_0x53a682){try{jsonpatch['apply'](_0x53a682,_0x46269c,!![]);}catch(_0x2a3027){return BPromise[_0x36cd('0x1f')](_0x2a3027);}return _0x53a682[_0x36cd('0x20')]();};}function saveUpdates(_0x3a3b92,_0x167efe){return function(_0x371709){if(_0x371709){return _0x371709[_0x36cd('0x21')](_0x3a3b92)[_0x36cd('0x22')](function(_0x2d89dc){return _0x2d89dc;});}return null;};}function removeEntity(_0x592ea9,_0x10410a){return function(_0x168d17){if(_0x168d17){return _0x168d17[_0x36cd('0x23')]()[_0x36cd('0x22')](function(){_0x592ea9[_0x36cd('0x17')](0xcc)[_0x36cd('0x18')]();});}};}function handleEntityNotFound(_0x58cc06,_0x30f6f2){return function(_0x56992f){if(!_0x56992f){_0x58cc06[_0x36cd('0x16')](0x194);}return _0x56992f;};}function handleError(_0x29926c,_0xa19ac){_0xa19ac=_0xa19ac||0x1f4;return function(_0x14e560){logger[_0x36cd('0x24')](_0x14e560[_0x36cd('0x25')]);if(_0x14e560[_0x36cd('0x26')]){delete _0x14e560['name'];}_0x29926c['status'](_0xa19ac)[_0x36cd('0x27')](_0x14e560);};}exports['index']=function(_0x55de2d,_0x2aa67c){var _0x1c0166={},_0x5ec034={},_0x124a5b={'count':0x0,'rows':[]};var _0x55097b=_[_0x36cd('0x28')](db['SugarcrmAccount'][_0x36cd('0x29')],function(_0x4f3981){return{'name':_0x4f3981['fieldName'],'type':_0x4f3981[_0x36cd('0x2a')][_0x36cd('0x2b')]};});_0x5ec034[_0x36cd('0x2c')]=_[_0x36cd('0x28')](_0x55097b,_0x36cd('0x26'));_0x5ec034['query']=_[_0x36cd('0x2d')](_0x55de2d[_0x36cd('0x2e')]);_0x5ec034[_0x36cd('0x2f')]=_[_0x36cd('0x30')](_0x5ec034[_0x36cd('0x2c')],_0x5ec034[_0x36cd('0x2e')]);_0x1c0166[_0x36cd('0x31')]=_[_0x36cd('0x30')](_0x5ec034[_0x36cd('0x2c')],qs[_0x36cd('0x32')](_0x55de2d[_0x36cd('0x2e')]['fields']));_0x1c0166[_0x36cd('0x31')]=_0x1c0166[_0x36cd('0x31')]['length']?_0x1c0166['attributes']:_0x5ec034[_0x36cd('0x2c')];if(!_0x55de2d['query'][_0x36cd('0x33')](_0x36cd('0x34'))){_0x1c0166[_0x36cd('0x35')]=qs['limit'](_0x55de2d[_0x36cd('0x2e')][_0x36cd('0x35')]);_0x1c0166['offset']=qs['offset'](_0x55de2d[_0x36cd('0x2e')][_0x36cd('0x1a')]);}_0x1c0166['order']=qs[_0x36cd('0x36')](_0x55de2d[_0x36cd('0x2e')]['sort']);_0x1c0166[_0x36cd('0x37')]=qs['filters'](_[_0x36cd('0x38')](_0x55de2d[_0x36cd('0x2e')],_0x5ec034[_0x36cd('0x2f')]),_0x55097b);if(_0x55de2d[_0x36cd('0x2e')][_0x36cd('0x39')]){_0x1c0166[_0x36cd('0x37')]=_['merge'](_0x1c0166[_0x36cd('0x37')],{'$or':_[_0x36cd('0x28')](_0x55097b,function(_0x43993b){if(_0x43993b[_0x36cd('0x2a')]!=='VIRTUAL'){var _0x481d14={};_0x481d14[_0x43993b['name']]={'$like':'%'+_0x55de2d[_0x36cd('0x2e')][_0x36cd('0x39')]+'%'};return _0x481d14;}})});}_0x1c0166=_[_0x36cd('0x3a')]({},_0x1c0166,_0x55de2d['options']);var _0x1ad8ce={'where':_0x1c0166[_0x36cd('0x37')]};return db[_0x36cd('0x3b')][_0x36cd('0x1c')](_0x1ad8ce)[_0x36cd('0x22')](function(_0x223c2f){_0x124a5b['count']=_0x223c2f;if(_0x55de2d[_0x36cd('0x2e')]['includeAll']){_0x1c0166['include']=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x1c0166);})[_0x36cd('0x22')](function(_0x161fc7){_0x124a5b[_0x36cd('0x3c')]=_0x161fc7;return _0x124a5b;})['then'](respondWithFilteredResult(_0x2aa67c,_0x1c0166))[_0x36cd('0x3d')](handleError(_0x2aa67c,null));};exports[_0x36cd('0x3e')]=function(_0x18e59f,_0x237428){var _0x3bfb53={'raw':![],'where':{'id':_0x18e59f[_0x36cd('0x3f')]['id']}},_0x2f078e={};_0x2f078e[_0x36cd('0x2c')]=_[_0x36cd('0x2d')](db[_0x36cd('0x3b')][_0x36cd('0x29')]);_0x2f078e[_0x36cd('0x2e')]=_['keys'](_0x18e59f['query']);_0x2f078e[_0x36cd('0x2f')]=_['intersection'](_0x2f078e[_0x36cd('0x2c')],_0x2f078e['query']);_0x3bfb53[_0x36cd('0x31')]=_['intersection'](_0x2f078e[_0x36cd('0x2c')],qs[_0x36cd('0x32')](_0x18e59f[_0x36cd('0x2e')][_0x36cd('0x32')]));_0x3bfb53[_0x36cd('0x31')]=_0x3bfb53['attributes'][_0x36cd('0x40')]?_0x3bfb53['attributes']:_0x2f078e[_0x36cd('0x2c')];if(_0x18e59f[_0x36cd('0x2e')]['includeAll']){_0x3bfb53['include']=[{'all':!![]}];}_0x3bfb53=_[_0x36cd('0x3a')]({},_0x3bfb53,_0x18e59f[_0x36cd('0x41')]);return db[_0x36cd('0x3b')]['find'](_0x3bfb53)[_0x36cd('0x22')](handleEntityNotFound(_0x237428,null))[_0x36cd('0x22')](respondWithResult(_0x237428,null))['catch'](handleError(_0x237428,null));};exports[_0x36cd('0x42')]=function(_0x529ed3,_0x5e2d95){return db[_0x36cd('0x3b')][_0x36cd('0x42')](_0x529ed3[_0x36cd('0x43')],{})[_0x36cd('0x22')](respondWithResult(_0x5e2d95,0xc9))[_0x36cd('0x3d')](handleError(_0x5e2d95,null));};exports[_0x36cd('0x21')]=function(_0x4e9265,_0x20e9b6){if(_0x4e9265[_0x36cd('0x43')]['id']){delete _0x4e9265[_0x36cd('0x43')]['id'];}return db['SugarcrmAccount'][_0x36cd('0x44')]({'where':{'id':_0x4e9265[_0x36cd('0x3f')]['id']}})[_0x36cd('0x22')](handleEntityNotFound(_0x20e9b6,null))['then'](saveUpdates(_0x4e9265[_0x36cd('0x43')],null))[_0x36cd('0x22')](respondWithResult(_0x20e9b6,null))[_0x36cd('0x3d')](handleError(_0x20e9b6,null));};exports[_0x36cd('0x23')]=function(_0x352fab,_0x5efd3c){return db['SugarcrmAccount'][_0x36cd('0x44')]({'where':{'id':_0x352fab[_0x36cd('0x3f')]['id']}})[_0x36cd('0x22')](handleEntityNotFound(_0x5efd3c,null))[_0x36cd('0x22')](removeEntity(_0x5efd3c,null))[_0x36cd('0x3d')](handleError(_0x5efd3c,null));};exports[_0x36cd('0x45')]=function(_0xf11a15,_0x38ec4a,_0x5c8661){var _0xeb6397={};var _0x3d36fa={};var _0x25c38e;var _0x1bac3b;return db[_0x36cd('0x3b')][_0x36cd('0x46')]({'where':{'id':_0xf11a15[_0x36cd('0x3f')]['id']}})['then'](handleEntityNotFound(_0x38ec4a,null))[_0x36cd('0x22')](function(_0x49b397){if(_0x49b397){_0x25c38e=_0x49b397;_0x3d36fa[_0x36cd('0x2c')]=_[_0x36cd('0x2d')](db['SugarcrmConfiguration'][_0x36cd('0x29')]);_0x3d36fa[_0x36cd('0x2e')]=_[_0x36cd('0x2d')](_0xf11a15[_0x36cd('0x2e')]);_0x3d36fa[_0x36cd('0x2f')]=_[_0x36cd('0x30')](_0x3d36fa[_0x36cd('0x2c')],_0x3d36fa['query']);_0xeb6397[_0x36cd('0x31')]=_[_0x36cd('0x30')](_0x3d36fa['model'],qs['fields'](_0xf11a15[_0x36cd('0x2e')][_0x36cd('0x32')]));_0xeb6397[_0x36cd('0x31')]=_0xeb6397[_0x36cd('0x31')][_0x36cd('0x40')]?_0xeb6397['attributes']:_0x3d36fa[_0x36cd('0x2c')];_0xeb6397[_0x36cd('0x47')]=qs[_0x36cd('0x36')](_0xf11a15[_0x36cd('0x2e')][_0x36cd('0x36')]);_0xeb6397[_0x36cd('0x37')]=qs['filters'](_[_0x36cd('0x38')](_0xf11a15[_0x36cd('0x2e')],_0x3d36fa[_0x36cd('0x2f')]));if(_0xf11a15[_0x36cd('0x2e')][_0x36cd('0x39')]){_0xeb6397[_0x36cd('0x37')]=_['merge'](_0xeb6397[_0x36cd('0x37')],{'$or':_['map'](_0xeb6397[_0x36cd('0x31')],function(_0x577703){var _0x3dc8d9={};_0x3dc8d9[_0x577703]={'$like':'%'+_0xf11a15[_0x36cd('0x2e')][_0x36cd('0x39')]+'%'};return _0x3dc8d9;})});}_0xeb6397=_[_0x36cd('0x3a')]({},_0xeb6397,_0xf11a15['options']);return _0x25c38e[_0x36cd('0x45')](_0xeb6397);}})[_0x36cd('0x22')](function(_0x5d5459){if(_0x5d5459){_0x1bac3b=_0x5d5459[_0x36cd('0x40')];if(!_0xf11a15[_0x36cd('0x2e')][_0x36cd('0x33')]('nolimit')){_0xeb6397[_0x36cd('0x35')]=qs['limit'](_0xf11a15[_0x36cd('0x2e')][_0x36cd('0x35')]);_0xeb6397['offset']=qs[_0x36cd('0x1a')](_0xf11a15[_0x36cd('0x2e')][_0x36cd('0x1a')]);}return _0x25c38e['getConfigurations'](_0xeb6397);}})['then'](function(_0x162918){if(_0x162918){return _0x162918?{'count':_0x1bac3b,'rows':_0x162918}:null;}})[_0x36cd('0x22')](respondWithResult(_0x38ec4a,null))['catch'](handleError(_0x38ec4a,null));};exports[_0x36cd('0x48')]=function(_0x3ebe15,_0x506aca,_0x19d03a){if(_0x3ebe15[_0x36cd('0x43')]['id']){delete _0x3ebe15[_0x36cd('0x43')]['id'];}return db[_0x36cd('0x3b')][_0x36cd('0x46')]({'where':{'id':_0x3ebe15[_0x36cd('0x3f')]['id']}})['then'](handleEntityNotFound(_0x506aca,null))[_0x36cd('0x22')](function(_0x44f9b8){if(_0x44f9b8){_0x3ebe15[_0x36cd('0x43')][_0x36cd('0x49')]=_0x44f9b8['id'];_0x3ebe15[_0x36cd('0x43')]['Subjects']=integrations[_0x36cd('0x4a')](_0x3ebe15[_0x36cd('0x43')][_0x36cd('0x4b')],_0x3ebe15[_0x36cd('0x43')][_0x36cd('0x2a')]);_0x3ebe15[_0x36cd('0x43')]['Descriptions']=integrations[_0x36cd('0x4c')](_0x3ebe15[_0x36cd('0x43')][_0x36cd('0x4b')],_0x3ebe15[_0x36cd('0x43')][_0x36cd('0x2a')]);return db['SugarcrmConfiguration'][_0x36cd('0x42')](_0x3ebe15[_0x36cd('0x43')],{'include':[{'model':db[_0x36cd('0x4d')],'as':_0x36cd('0x4e')},{'model':db['SugarcrmField'],'as':_0x36cd('0x4f')}]});}return null;})[_0x36cd('0x22')](respondWithResult(_0x506aca,null))['catch'](handleError(_0x506aca,null));};exports[_0x36cd('0x50')]=function(_0x5b251b,_0x3d01fe,_0x5d2e02){var _0x9763='';var _0x5b094a=['id','name',_0x36cd('0x51'),_0x36cd('0x52'),_0x36cd('0x53'),'date_start',_0x36cd('0x54'),'duration_minutes',_0x36cd('0x55'),_0x36cd('0x56'),_0x36cd('0x57'),_0x36cd('0x58')];return db['SugarcrmAccount'][_0x36cd('0x46')]({'where':{'id':_0x5b251b[_0x36cd('0x3f')]['id']},'attributes':['id','username',_0x36cd('0x59'),_0x36cd('0x5a')]})[_0x36cd('0x22')](handleEntityNotFound(_0x3d01fe,null))[_0x36cd('0x22')](function(_0xbaf294){if(_0xbaf294){_0x9763=_0xbaf294[_0x36cd('0x5a')];var _0x545e7e=_0x9763[_0x36cd('0x5b')](-0x1);if(_0x545e7e==='/'){_0x9763=_0x9763['substring'](0x0,_0x9763['lastIndexOf'](_0x545e7e));}return rp({'method':'POST','uri':util[_0x36cd('0x5c')](_0x36cd('0x5d'),_0x9763,_0x36cd('0x5e')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x36cd('0x5f'),'rest_data':JSON[_0x36cd('0x60')]({'user_auth':{'user_name':_0xbaf294['username'],'password':_0xbaf294[_0x36cd('0x59')],'encryption':_0x36cd('0x61')},'application':_0x36cd('0x62')})}});}})[_0x36cd('0x22')](function(_0xd38af9){if(_0xd38af9&&_0xd38af9['name']!==_0x36cd('0x63')&&_0xd38af9[_0x36cd('0x26')]!==_0x36cd('0x64')){return rp({'method':_0x36cd('0x65'),'uri':util[_0x36cd('0x5c')](_0x36cd('0x5d'),_0x9763,_0x36cd('0x5e')),'json':!![],'form':{'method':_0x36cd('0x66'),'input_type':_0x36cd('0x5f'),'response_type':_0x36cd('0x5f'),'rest_data':JSON[_0x36cd('0x60')]({'session':_0xd38af9['id'],'module_name':_0x36cd('0x67')})}})[_0x36cd('0x22')](function(_0x2377cf){if(_0x2377cf){var _0x5f36f8=_[_0x36cd('0x68')](_0x2377cf['module_fields']);_['remove'](_0x5f36f8,function(_0x25d38d){return _0x5b094a[_0x36cd('0x69')](_0x25d38d['name']);});return{'count':_0x5f36f8[_0x36cd('0x40')],'rows':_['map'](_0x5f36f8,function(_0x3058f5){return{'id':_0x3058f5[_0x36cd('0x26')],'name':_0x3058f5['label'],'custom':_[_0x36cd('0x6a')](_0x3058f5[_0x36cd('0x26')],'_c')?!![]:![],'options':_0x3058f5[_0x36cd('0x41')]?_['map'](_['values'](_0x3058f5[_0x36cd('0x41')]),function(_0xa2851c){return{'name':_0xa2851c['value'],'value':_0xa2851c['name']};}):[]};})};}})['then'](respondWithResult(_0x3d01fe,null))[_0x36cd('0x3d')](function(_0x477ece){var _0x19b20c=_0x5b251b[_0x36cd('0x2e')][_0x36cd('0x6b')]?0x1f4:_0x477ece[_0x36cd('0x6c')]||0x1f4;logger[_0x36cd('0x24')](_0x36cd('0x6d'),_0x36cd('0x50'),_0x19b20c,JSON[_0x36cd('0x60')](_0x477ece));delete _0x477ece[_0x36cd('0x26')];if(_0x19b20c===0x191){_0x19b20c=0x190;}_0x3d01fe[_0x36cd('0x17')](_0x19b20c)[_0x36cd('0x27')](_0x5b251b['query']['test']?{'message':_0x36cd('0x6e'),'statusCode':_0x477ece[_0x36cd('0x6c')]}:_0x477ece);});}else{var _0x12610f=0x1f4;_0x3d01fe[_0x36cd('0x17')](_0x12610f)[_0x36cd('0x27')]({'message':_0x36cd('0x6e'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x672d=['includeAll','include','rows','show','params','length','find','catch','create','body','getConfigurations','SugarcrmConfiguration','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_minutes','parent_id','parent_type','direction','password','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','values','module_fields','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x5b69d2,_0x227711){var _0x1a3bab=function(_0x685b14){while(--_0x685b14){_0x5b69d2['push'](_0x5b69d2['shift']());}};_0x1a3bab(++_0x227711);}(_0x672d,0x121));var _0xd672=function(_0x56d9e7,_0x1096c1){_0x56d9e7=_0x56d9e7-0x0;var _0x13bfda=_0x672d[_0x56d9e7];return _0x13bfda;};'use strict';var emlformat=require(_0xd672('0x0'));var rimraf=require(_0xd672('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd672('0x2'));var rp=require(_0xd672('0x3'));var moment=require(_0xd672('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd672('0x5'));var util=require(_0xd672('0x6'));var path=require('path');var sox=require(_0xd672('0x7'));var csv=require(_0xd672('0x8'));var ejs=require(_0xd672('0x9'));var fs=require('fs');var fs_extra=require(_0xd672('0xa'));var _=require(_0xd672('0xb'));var squel=require('squel');var crypto=require(_0xd672('0xc'));var jsforce=require(_0xd672('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd672('0x8'));var querystring=require('querystring');var Papa=require(_0xd672('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd672('0xf'));var as=require(_0xd672('0x10'));var hardwareService=require(_0xd672('0x11'));var logger=require(_0xd672('0x12'))('api');var utils=require(_0xd672('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd672('0x14'));var db=require(_0xd672('0x15'))['db'];var integrations=require(_0xd672('0x16'));function respondWithStatusCode(_0x2589c6,_0x523410){_0x523410=_0x523410||0xcc;return function(_0x55d1b1){if(_0x55d1b1){return _0x2589c6[_0xd672('0x17')](_0x523410);}return _0x2589c6['status'](_0x523410)[_0xd672('0x18')]();};}function respondWithResult(_0x4a29a3,_0x495fba){_0x495fba=_0x495fba||0xc8;return function(_0xf6f231){if(_0xf6f231){return _0x4a29a3[_0xd672('0x19')](_0x495fba)['json'](_0xf6f231);}};}function respondWithFilteredResult(_0x1900ea,_0x69508){return function(_0x1765ed){if(_0x1765ed){var _0x2cef00=typeof _0x69508[_0xd672('0x1a')]==='undefined'&&typeof _0x69508[_0xd672('0x1b')]===_0xd672('0x1c');var _0x5eacc5=_0x1765ed[_0xd672('0x1d')];var _0x4a76a4=_0x2cef00?0x0:_0x69508['offset'];var _0x4f5e3e=_0x2cef00?_0x1765ed[_0xd672('0x1d')]:_0x69508['offset']+_0x69508[_0xd672('0x1b')];var _0x4e59bb;if(_0x4f5e3e>=_0x5eacc5){_0x4f5e3e=_0x5eacc5;_0x4e59bb=0xc8;}else{_0x4e59bb=0xce;}_0x1900ea['status'](_0x4e59bb);return _0x1900ea[_0xd672('0x1e')](_0xd672('0x1f'),_0x4a76a4+'-'+_0x4f5e3e+'/'+_0x5eacc5)[_0xd672('0x20')](_0x1765ed);}return null;};}function patchUpdates(_0x3e2414){return function(_0x28e872){try{jsonpatch[_0xd672('0x21')](_0x28e872,_0x3e2414,!![]);}catch(_0x1c6bac){return BPromise['reject'](_0x1c6bac);}return _0x28e872[_0xd672('0x22')]();};}function saveUpdates(_0x1b2830,_0x266c95){return function(_0x261c97){if(_0x261c97){return _0x261c97['update'](_0x1b2830)[_0xd672('0x23')](function(_0x3ba12c){return _0x3ba12c;});}return null;};}function removeEntity(_0x59117f,_0x3f281a){return function(_0x162c42){if(_0x162c42){return _0x162c42[_0xd672('0x24')]()[_0xd672('0x23')](function(){_0x59117f[_0xd672('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22816a,_0x4a961b){return function(_0x2f7c3f){if(!_0x2f7c3f){_0x22816a['sendStatus'](0x194);}return _0x2f7c3f;};}function handleError(_0x5bdcd4,_0x5c92f4){_0x5c92f4=_0x5c92f4||0x1f4;return function(_0x566a9a){logger[_0xd672('0x25')](_0x566a9a['stack']);if(_0x566a9a[_0xd672('0x26')]){delete _0x566a9a[_0xd672('0x26')];}_0x5bdcd4[_0xd672('0x19')](_0x5c92f4)[_0xd672('0x27')](_0x566a9a);};}exports[_0xd672('0x28')]=function(_0x292c57,_0x156a34){var _0x54932a={},_0x3c711d={},_0x34c820={'count':0x0,'rows':[]};var _0x25f53f=_[_0xd672('0x29')](db[_0xd672('0x2a')][_0xd672('0x2b')],function(_0x164d0e){return{'name':_0x164d0e['fieldName'],'type':_0x164d0e[_0xd672('0x2c')][_0xd672('0x2d')]};});_0x3c711d['model']=_[_0xd672('0x29')](_0x25f53f,'name');_0x3c711d['query']=_[_0xd672('0x2e')](_0x292c57[_0xd672('0x2f')]);_0x3c711d[_0xd672('0x30')]=_[_0xd672('0x31')](_0x3c711d[_0xd672('0x32')],_0x3c711d[_0xd672('0x2f')]);_0x54932a[_0xd672('0x33')]=_[_0xd672('0x31')](_0x3c711d[_0xd672('0x32')],qs[_0xd672('0x34')](_0x292c57['query'][_0xd672('0x34')]));_0x54932a['attributes']=_0x54932a['attributes']['length']?_0x54932a[_0xd672('0x33')]:_0x3c711d['model'];if(!_0x292c57[_0xd672('0x2f')][_0xd672('0x35')]('nolimit')){_0x54932a['limit']=qs[_0xd672('0x1b')](_0x292c57[_0xd672('0x2f')][_0xd672('0x1b')]);_0x54932a['offset']=qs[_0xd672('0x1a')](_0x292c57[_0xd672('0x2f')][_0xd672('0x1a')]);}_0x54932a[_0xd672('0x36')]=qs[_0xd672('0x37')](_0x292c57['query'][_0xd672('0x37')]);_0x54932a[_0xd672('0x38')]=qs[_0xd672('0x30')](_[_0xd672('0x39')](_0x292c57[_0xd672('0x2f')],_0x3c711d[_0xd672('0x30')]),_0x25f53f);if(_0x292c57['query'][_0xd672('0x3a')]){_0x54932a[_0xd672('0x38')]=_[_0xd672('0x3b')](_0x54932a[_0xd672('0x38')],{'$or':_[_0xd672('0x29')](_0x25f53f,function(_0x336309){if(_0x336309['type']!==_0xd672('0x3c')){var _0x1e2f5c={};_0x1e2f5c[_0x336309[_0xd672('0x26')]]={'$like':'%'+_0x292c57[_0xd672('0x2f')][_0xd672('0x3a')]+'%'};return _0x1e2f5c;}})});}_0x54932a=_[_0xd672('0x3b')]({},_0x54932a,_0x292c57[_0xd672('0x3d')]);var _0x17ebb8={'where':_0x54932a[_0xd672('0x38')]};return db[_0xd672('0x2a')][_0xd672('0x1d')](_0x17ebb8)[_0xd672('0x23')](function(_0x79f3ab){_0x34c820[_0xd672('0x1d')]=_0x79f3ab;if(_0x292c57[_0xd672('0x2f')][_0xd672('0x3e')]){_0x54932a[_0xd672('0x3f')]=[{'all':!![]}];}return db[_0xd672('0x2a')]['findAll'](_0x54932a);})[_0xd672('0x23')](function(_0x22e631){_0x34c820[_0xd672('0x40')]=_0x22e631;return _0x34c820;})[_0xd672('0x23')](respondWithFilteredResult(_0x156a34,_0x54932a))['catch'](handleError(_0x156a34,null));};exports[_0xd672('0x41')]=function(_0xd0c707,_0x4756bf){var _0x3004e3={'raw':![],'where':{'id':_0xd0c707[_0xd672('0x42')]['id']}},_0x583c03={};_0x583c03[_0xd672('0x32')]=_['keys'](db[_0xd672('0x2a')][_0xd672('0x2b')]);_0x583c03[_0xd672('0x2f')]=_[_0xd672('0x2e')](_0xd0c707[_0xd672('0x2f')]);_0x583c03[_0xd672('0x30')]=_[_0xd672('0x31')](_0x583c03['model'],_0x583c03['query']);_0x3004e3[_0xd672('0x33')]=_[_0xd672('0x31')](_0x583c03[_0xd672('0x32')],qs[_0xd672('0x34')](_0xd0c707[_0xd672('0x2f')][_0xd672('0x34')]));_0x3004e3['attributes']=_0x3004e3[_0xd672('0x33')][_0xd672('0x43')]?_0x3004e3[_0xd672('0x33')]:_0x583c03[_0xd672('0x32')];if(_0xd0c707[_0xd672('0x2f')][_0xd672('0x3e')]){_0x3004e3[_0xd672('0x3f')]=[{'all':!![]}];}_0x3004e3=_[_0xd672('0x3b')]({},_0x3004e3,_0xd0c707[_0xd672('0x3d')]);return db[_0xd672('0x2a')][_0xd672('0x44')](_0x3004e3)['then'](handleEntityNotFound(_0x4756bf,null))[_0xd672('0x23')](respondWithResult(_0x4756bf,null))[_0xd672('0x45')](handleError(_0x4756bf,null));};exports[_0xd672('0x46')]=function(_0x78fc0,_0x22e667){return db[_0xd672('0x2a')][_0xd672('0x46')](_0x78fc0[_0xd672('0x47')],{})['then'](respondWithResult(_0x22e667,0xc9))[_0xd672('0x45')](handleError(_0x22e667,null));};exports['update']=function(_0x17891f,_0x29edd9){if(_0x17891f[_0xd672('0x47')]['id']){delete _0x17891f[_0xd672('0x47')]['id'];}return db[_0xd672('0x2a')][_0xd672('0x44')]({'where':{'id':_0x17891f['params']['id']}})[_0xd672('0x23')](handleEntityNotFound(_0x29edd9,null))[_0xd672('0x23')](saveUpdates(_0x17891f[_0xd672('0x47')],null))['then'](respondWithResult(_0x29edd9,null))[_0xd672('0x45')](handleError(_0x29edd9,null));};exports[_0xd672('0x24')]=function(_0x106e59,_0x5383f4){return db[_0xd672('0x2a')][_0xd672('0x44')]({'where':{'id':_0x106e59[_0xd672('0x42')]['id']}})['then'](handleEntityNotFound(_0x5383f4,null))[_0xd672('0x23')](removeEntity(_0x5383f4,null))[_0xd672('0x45')](handleError(_0x5383f4,null));};exports[_0xd672('0x48')]=function(_0xcbaa3b,_0x4bd587,_0x1baccf){var _0x232a5f={};var _0x52a50a={};var _0x57b34a;var _0x27ffea;return db['SugarcrmAccount']['findOne']({'where':{'id':_0xcbaa3b[_0xd672('0x42')]['id']}})[_0xd672('0x23')](handleEntityNotFound(_0x4bd587,null))[_0xd672('0x23')](function(_0x4d052b){if(_0x4d052b){_0x57b34a=_0x4d052b;_0x52a50a[_0xd672('0x32')]=_[_0xd672('0x2e')](db[_0xd672('0x49')]['rawAttributes']);_0x52a50a[_0xd672('0x2f')]=_[_0xd672('0x2e')](_0xcbaa3b[_0xd672('0x2f')]);_0x52a50a['filters']=_[_0xd672('0x31')](_0x52a50a[_0xd672('0x32')],_0x52a50a[_0xd672('0x2f')]);_0x232a5f[_0xd672('0x33')]=_['intersection'](_0x52a50a['model'],qs[_0xd672('0x34')](_0xcbaa3b[_0xd672('0x2f')]['fields']));_0x232a5f['attributes']=_0x232a5f[_0xd672('0x33')][_0xd672('0x43')]?_0x232a5f[_0xd672('0x33')]:_0x52a50a['model'];_0x232a5f[_0xd672('0x36')]=qs[_0xd672('0x37')](_0xcbaa3b['query'][_0xd672('0x37')]);_0x232a5f[_0xd672('0x38')]=qs[_0xd672('0x30')](_[_0xd672('0x39')](_0xcbaa3b['query'],_0x52a50a[_0xd672('0x30')]));if(_0xcbaa3b[_0xd672('0x2f')]['filter']){_0x232a5f[_0xd672('0x38')]=_[_0xd672('0x3b')](_0x232a5f['where'],{'$or':_[_0xd672('0x29')](_0x232a5f[_0xd672('0x33')],function(_0x4e9db1){var _0x533722={};_0x533722[_0x4e9db1]={'$like':'%'+_0xcbaa3b['query'][_0xd672('0x3a')]+'%'};return _0x533722;})});}_0x232a5f=_[_0xd672('0x3b')]({},_0x232a5f,_0xcbaa3b['options']);return _0x57b34a[_0xd672('0x48')](_0x232a5f);}})[_0xd672('0x23')](function(_0x511b60){if(_0x511b60){_0x27ffea=_0x511b60['length'];if(!_0xcbaa3b[_0xd672('0x2f')][_0xd672('0x35')]('nolimit')){_0x232a5f[_0xd672('0x1b')]=qs[_0xd672('0x1b')](_0xcbaa3b[_0xd672('0x2f')][_0xd672('0x1b')]);_0x232a5f[_0xd672('0x1a')]=qs[_0xd672('0x1a')](_0xcbaa3b[_0xd672('0x2f')][_0xd672('0x1a')]);}return _0x57b34a[_0xd672('0x48')](_0x232a5f);}})['then'](function(_0x7ef417){if(_0x7ef417){return _0x7ef417?{'count':_0x27ffea,'rows':_0x7ef417}:null;}})['then'](respondWithResult(_0x4bd587,null))[_0xd672('0x45')](handleError(_0x4bd587,null));};exports[_0xd672('0x4a')]=function(_0x4d783a,_0x451862,_0x4870c7){if(_0x4d783a[_0xd672('0x47')]['id']){delete _0x4d783a[_0xd672('0x47')]['id'];}return db[_0xd672('0x2a')][_0xd672('0x4b')]({'where':{'id':_0x4d783a[_0xd672('0x42')]['id']}})['then'](handleEntityNotFound(_0x451862,null))[_0xd672('0x23')](function(_0x15e211){if(_0x15e211){_0x4d783a['body'][_0xd672('0x4c')]=_0x15e211['id'];_0x4d783a[_0xd672('0x47')][_0xd672('0x4d')]=integrations[_0xd672('0x4e')](_0x4d783a[_0xd672('0x47')][_0xd672('0x4f')],_0x4d783a[_0xd672('0x47')][_0xd672('0x2c')]);_0x4d783a[_0xd672('0x47')][_0xd672('0x50')]=integrations[_0xd672('0x51')](_0x4d783a[_0xd672('0x47')]['channel'],_0x4d783a[_0xd672('0x47')][_0xd672('0x2c')]);return db[_0xd672('0x49')]['create'](_0x4d783a['body'],{'include':[{'model':db['SugarcrmField'],'as':_0xd672('0x4d')},{'model':db[_0xd672('0x52')],'as':_0xd672('0x50')}]});}return null;})['then'](respondWithResult(_0x451862,null))['catch'](handleError(_0x451862,null));};exports[_0xd672('0x53')]=function(_0x42b9d6,_0x471dc5,_0x27466c){var _0x151364='';var _0x5f5621=['id',_0xd672('0x26'),_0xd672('0x54'),_0xd672('0x55'),'description',_0xd672('0x56'),'duration_hours',_0xd672('0x57'),_0xd672('0x58'),_0xd672('0x59'),'parent_name',_0xd672('0x5a')];return db['SugarcrmAccount'][_0xd672('0x4b')]({'where':{'id':_0x42b9d6[_0xd672('0x42')]['id']},'attributes':['id','username',_0xd672('0x5b'),_0xd672('0x5c')]})['then'](handleEntityNotFound(_0x471dc5,null))[_0xd672('0x23')](function(_0x38be55){if(_0x38be55){_0x151364=_0x38be55['remoteUri'];var _0x5cf991=_0x151364[_0xd672('0x5d')](-0x1);if(_0x5cf991==='/'){_0x151364=_0x151364[_0xd672('0x5e')](0x0,_0x151364['lastIndexOf'](_0x5cf991));}return rp({'method':_0xd672('0x5f'),'uri':util[_0xd672('0x60')](_0xd672('0x61'),_0x151364,_0xd672('0x62')),'json':!![],'form':{'method':_0xd672('0x63'),'input_type':_0xd672('0x64'),'response_type':_0xd672('0x64'),'rest_data':JSON[_0xd672('0x65')]({'user_auth':{'user_name':_0x38be55[_0xd672('0x66')],'password':_0x38be55[_0xd672('0x5b')],'encryption':_0xd672('0x67')},'application':_0xd672('0x68')})}});}})[_0xd672('0x23')](function(_0x594d3d){if(_0x594d3d&&_0x594d3d[_0xd672('0x26')]!==_0xd672('0x69')&&_0x594d3d[_0xd672('0x26')]!=='Password\x20Expired'){return rp({'method':_0xd672('0x5f'),'uri':util['format'](_0xd672('0x61'),_0x151364,_0xd672('0x62')),'json':!![],'form':{'method':'get_module_fields','input_type':'JSON','response_type':_0xd672('0x64'),'rest_data':JSON[_0xd672('0x65')]({'session':_0x594d3d['id'],'module_name':'Calls'})}})[_0xd672('0x23')](function(_0x5ba2b2){if(_0x5ba2b2){var _0xec7df=_[_0xd672('0x6a')](_0x5ba2b2[_0xd672('0x6b')]);_[_0xd672('0x6c')](_0xec7df,function(_0x9b0723){return _0x5f5621[_0xd672('0x6d')](_0x9b0723[_0xd672('0x26')]);});return{'count':_0xec7df[_0xd672('0x43')],'rows':_[_0xd672('0x29')](_0xec7df,function(_0x59c344){return{'id':_0x59c344[_0xd672('0x26')],'name':_0x59c344[_0xd672('0x6e')],'custom':_[_0xd672('0x6f')](_0x59c344[_0xd672('0x26')],'_c')?!![]:![],'options':_0x59c344[_0xd672('0x3d')]?_[_0xd672('0x29')](_['values'](_0x59c344['options']),function(_0x25246c){return{'name':_0x25246c[_0xd672('0x70')],'value':_0x25246c[_0xd672('0x26')]};}):[]};})};}})[_0xd672('0x23')](respondWithResult(_0x471dc5,null))['catch'](function(_0x290c9d){var _0x4b2a34=_0x42b9d6[_0xd672('0x2f')][_0xd672('0x71')]?0x1f4:_0x290c9d[_0xd672('0x72')]||0x1f4;logger[_0xd672('0x25')](_0xd672('0x73'),_0xd672('0x53'),_0x4b2a34,JSON['stringify'](_0x290c9d));delete _0x290c9d[_0xd672('0x26')];if(_0x4b2a34===0x191){_0x4b2a34=0x190;}_0x471dc5[_0xd672('0x19')](_0x4b2a34)[_0xd672('0x27')](_0x42b9d6[_0xd672('0x2f')][_0xd672('0x71')]?{'message':_0xd672('0x74'),'statusCode':_0x290c9d[_0xd672('0x72')]}:_0x290c9d);});}else{var _0xd53b06=0x1f4;_0x471dc5['status'](_0xd53b06)[_0xd672('0x27')]({'message':_0xd672('0x74'),'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 f3a2f83..8e3d01c 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 _0x1131=['SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x563469,_0x1ac523){var _0x3821e4=function(_0x2e2ab3){while(--_0x2e2ab3){_0x563469['push'](_0x563469['shift']());}};_0x3821e4(++_0x1ac523);}(_0x1131,0x1c4));var _0x1113=function(_0x2e7fb5,_0x5ad247){_0x2e7fb5=_0x2e7fb5-0x0;var _0x160e19=_0x1131[_0x2e7fb5];return _0x160e19;};'use strict';var _=require(_0x1113('0x0'));var util=require(_0x1113('0x1'));var logger=require(_0x1113('0x2'))(_0x1113('0x3'));var moment=require(_0x1113('0x4'));var BPromise=require('bluebird');var rp=require(_0x1113('0x5'));var fs=require('fs');var path=require(_0x1113('0x6'));var rimraf=require(_0x1113('0x7'));var config=require(_0x1113('0x8'));var attributes=require(_0x1113('0x9'));var integrations=require(_0x1113('0xa'));module[_0x1113('0xb')]=function(_0x1ebd98,_0x2c8a3e){return _0x1ebd98[_0x1113('0xc')](_0x1113('0xd'),attributes,{'tableName':_0x1113('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x80f7=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash'];(function(_0x4c7c4a,_0x520920){var _0x4d78ae=function(_0x3bcee0){while(--_0x3bcee0){_0x4c7c4a['push'](_0x4c7c4a['shift']());}};_0x4d78ae(++_0x520920);}(_0x80f7,0x1b9));var _0x780f=function(_0x2ed4c9,_0x243771){_0x2ed4c9=_0x2ed4c9-0x0;var _0x237f0a=_0x80f7[_0x2ed4c9];return _0x237f0a;};'use strict';var _=require(_0x780f('0x0'));var util=require(_0x780f('0x1'));var logger=require(_0x780f('0x2'))(_0x780f('0x3'));var moment=require(_0x780f('0x4'));var BPromise=require(_0x780f('0x5'));var rp=require(_0x780f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x780f('0x7'));var config=require(_0x780f('0x8'));var attributes=require(_0x780f('0x9'));var integrations=require(_0x780f('0xa'));module[_0x780f('0xb')]=function(_0x2b8f23,_0x38933d){return _0x2b8f23['define']('SugarcrmAccount',attributes,{'tableName':_0x780f('0xc'),'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 5345193..e5d6e44 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 _0xc4e6=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','SugarcrmAccount','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3059e8,_0x54975f){var _0x3c939e=function(_0x8b7f4){while(--_0x8b7f4){_0x3059e8['push'](_0x3059e8['shift']());}};_0x3c939e(++_0x54975f);}(_0xc4e6,0x195));var _0x6c4e=function(_0x3c5f8d,_0x39891f){_0x3c5f8d=_0x3c5f8d-0x0;var _0x3b7beb=_0xc4e6[_0x3c5f8d];return _0x3b7beb;};'use strict';var _=require(_0x6c4e('0x0'));var util=require(_0x6c4e('0x1'));var moment=require(_0x6c4e('0x2'));var BPromise=require(_0x6c4e('0x3'));var rs=require(_0x6c4e('0x4'));var fs=require('fs');var Redis=require(_0x6c4e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c4e('0x6'));var logger=require(_0x6c4e('0x7'))(_0x6c4e('0x8'));var config=require(_0x6c4e('0x9'));var jayson=require(_0x6c4e('0xa'));var client=jayson[_0x6c4e('0xb')][_0x6c4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53d47b,_0x867fb6,_0x530f17){return new BPromise(function(_0x1747f1,_0xaef96f){return client[_0x6c4e('0xd')](_0x53d47b,_0x530f17)[_0x6c4e('0xe')](function(_0x1d230a){logger['info'](_0x6c4e('0xf'),_0x867fb6,_0x6c4e('0x10'));logger[_0x6c4e('0x11')](_0x6c4e('0x12'),_0x867fb6,_0x6c4e('0x10'),JSON[_0x6c4e('0x13')](_0x1d230a));if(_0x1d230a['error']){if(_0x1d230a[_0x6c4e('0x14')]['code']===0x1f4){logger['error'](_0x6c4e('0xf'),_0x867fb6,_0x1d230a[_0x6c4e('0x14')][_0x6c4e('0x15')]);return _0xaef96f(_0x1d230a[_0x6c4e('0x14')][_0x6c4e('0x15')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x867fb6,_0x1d230a['error'][_0x6c4e('0x15')]);return _0x1747f1(_0x1d230a[_0x6c4e('0x14')][_0x6c4e('0x15')]);}else{logger[_0x6c4e('0x16')](_0x6c4e('0xf'),_0x867fb6,_0x6c4e('0x10'));_0x1747f1(_0x1d230a['result']['message']);}})[_0x6c4e('0x17')](function(_0x45523b){logger['error'](_0x6c4e('0xf'),_0x867fb6,_0x45523b);_0xaef96f(_0x45523b);});});}exports['GetSugarcrmAccount']=function(_0x25eba3){var _0xd21cc6=this;return new Promise(function(_0x50a70d,_0x4e445e){return db[_0x6c4e('0x18')]['findAll']({'raw':_0x25eba3[_0x6c4e('0x19')]?_0x25eba3[_0x6c4e('0x19')][_0x6c4e('0x1a')]===undefined?!![]:![]:!![],'where':_0x25eba3[_0x6c4e('0x19')]?_0x25eba3[_0x6c4e('0x19')][_0x6c4e('0x1b')]||null:null,'attributes':_0x25eba3['options']?_0x25eba3[_0x6c4e('0x19')][_0x6c4e('0x1c')]||null:null,'limit':_0x25eba3[_0x6c4e('0x19')]?_0x25eba3[_0x6c4e('0x19')]['limit']||null:null,'include':_0x25eba3[_0x6c4e('0x19')]?_0x25eba3[_0x6c4e('0x19')][_0x6c4e('0x1d')]?_[_0x6c4e('0x1e')](_0x25eba3['options']['include'],function(_0x54880b){return{'model':db[_0x54880b[_0x6c4e('0x1f')]],'as':_0x54880b['as'],'attributes':_0x54880b[_0x6c4e('0x1c')],'include':_0x54880b[_0x6c4e('0x1d')]?_[_0x6c4e('0x1e')](_0x54880b[_0x6c4e('0x1d')],function(_0x15c606){return{'model':db[_0x15c606[_0x6c4e('0x1f')]],'as':_0x15c606['as'],'attributes':_0x15c606['attributes'],'include':_0x15c606[_0x6c4e('0x1d')]?_[_0x6c4e('0x1e')](_0x15c606[_0x6c4e('0x1d')],function(_0x27e3be){return{'model':db[_0x27e3be[_0x6c4e('0x1f')]],'as':_0x27e3be['as'],'attributes':_0x27e3be[_0x6c4e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26d89a){logger['info']('GetSugarcrmAccount',_0x25eba3);logger[_0x6c4e('0x11')](_0x6c4e('0x20'),_0x25eba3,JSON[_0x6c4e('0x13')](_0x26d89a));_0x50a70d(_0x26d89a);})[_0x6c4e('0x17')](function(_0x935907){logger[_0x6c4e('0x14')](_0x6c4e('0x20'),_0x935907['message'],_0x25eba3);_0x4e445e(_0xd21cc6['error'](0x1f4,_0x935907[_0x6c4e('0x15')]));});});};exports[_0x6c4e('0x21')]=function(_0x1a2d29){var _0x4885dd=this;return new Promise(function(_0x32ca1b,_0x3acc0a){return db[_0x6c4e('0x18')][_0x6c4e('0x22')]({'raw':_0x1a2d29[_0x6c4e('0x19')]?_0x1a2d29[_0x6c4e('0x19')][_0x6c4e('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a2d29[_0x6c4e('0x19')]?_0x1a2d29['options']['where']||null:null,'attributes':_0x1a2d29[_0x6c4e('0x19')]?_0x1a2d29['options'][_0x6c4e('0x1c')]||null:null,'include':_0x1a2d29[_0x6c4e('0x19')]?_0x1a2d29['options']['include']?_['map'](_0x1a2d29[_0x6c4e('0x19')][_0x6c4e('0x1d')],function(_0x5c7766){return{'model':db[_0x5c7766['model']],'as':_0x5c7766['as'],'attributes':_0x5c7766['attributes'],'include':_0x5c7766[_0x6c4e('0x1d')]?_[_0x6c4e('0x1e')](_0x5c7766[_0x6c4e('0x1d')],function(_0x522118){return{'model':db[_0x522118[_0x6c4e('0x1f')]],'as':_0x522118['as'],'attributes':_0x522118[_0x6c4e('0x1c')],'include':_0x522118[_0x6c4e('0x1d')]?_[_0x6c4e('0x1e')](_0x522118[_0x6c4e('0x1d')],function(_0x57276d){return{'model':db[_0x57276d[_0x6c4e('0x1f')]],'as':_0x57276d['as'],'attributes':_0x57276d['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c4e('0xe')](function(_0x1b5e09){logger[_0x6c4e('0x16')](_0x6c4e('0x21'),_0x1a2d29);logger[_0x6c4e('0x11')](_0x6c4e('0x21'),_0x1a2d29,JSON[_0x6c4e('0x13')](_0x1b5e09));_0x32ca1b(_0x1b5e09);})[_0x6c4e('0x17')](function(_0x1bb3fd){logger[_0x6c4e('0x14')](_0x6c4e('0x21'),_0x1bb3fd[_0x6c4e('0x15')],_0x1a2d29);_0x3acc0a(_0x4885dd['error'](0x1f4,_0x1bb3fd['message']));});});}; \ No newline at end of file +var _0x5ed2=['result','SugarcrmAccount','options','raw','where','attributes','limit','map','include','model','GetSugarcrmAccount','catch','find','then','ShowSugarcrmAccount','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1f66c3,_0x173ac4){var _0x367f92=function(_0x10ebbd){while(--_0x10ebbd){_0x1f66c3['push'](_0x1f66c3['shift']());}};_0x367f92(++_0x173ac4);}(_0x5ed2,0x1a7));var _0x25ed=function(_0x1b1c4f,_0x32eb9c){_0x1b1c4f=_0x1b1c4f-0x0;var _0x3f02c1=_0x5ed2[_0x1b1c4f];return _0x3f02c1;};'use strict';var _=require(_0x25ed('0x0'));var util=require(_0x25ed('0x1'));var moment=require(_0x25ed('0x2'));var BPromise=require(_0x25ed('0x3'));var rs=require(_0x25ed('0x4'));var fs=require('fs');var Redis=require(_0x25ed('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x25ed('0x6'));var logger=require('../../config/logger')(_0x25ed('0x7'));var config=require(_0x25ed('0x8'));var jayson=require(_0x25ed('0x9'));var client=jayson[_0x25ed('0xa')][_0x25ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d064b,_0x3c601a,_0x25cb9f){return new BPromise(function(_0x264b72,_0x4854e4){return client[_0x25ed('0xc')](_0x4d064b,_0x25cb9f)['then'](function(_0x5592eb){logger[_0x25ed('0xd')](_0x25ed('0xe'),_0x3c601a,_0x25ed('0xf'));logger['debug'](_0x25ed('0x10'),_0x3c601a,_0x25ed('0xf'),JSON[_0x25ed('0x11')](_0x5592eb));if(_0x5592eb[_0x25ed('0x12')]){if(_0x5592eb[_0x25ed('0x12')][_0x25ed('0x13')]===0x1f4){logger['error'](_0x25ed('0xe'),_0x3c601a,_0x5592eb[_0x25ed('0x12')][_0x25ed('0x14')]);return _0x4854e4(_0x5592eb[_0x25ed('0x12')][_0x25ed('0x14')]);}logger[_0x25ed('0x12')](_0x25ed('0xe'),_0x3c601a,_0x5592eb[_0x25ed('0x12')][_0x25ed('0x14')]);return _0x264b72(_0x5592eb[_0x25ed('0x12')][_0x25ed('0x14')]);}else{logger['info'](_0x25ed('0xe'),_0x3c601a,'request\x20sent');_0x264b72(_0x5592eb[_0x25ed('0x15')]['message']);}})['catch'](function(_0x263c7a){logger[_0x25ed('0x12')](_0x25ed('0xe'),_0x3c601a,_0x263c7a);_0x4854e4(_0x263c7a);});});}exports['GetSugarcrmAccount']=function(_0x9af76c){var _0x42534e=this;return new Promise(function(_0x5e5246,_0x316779){return db[_0x25ed('0x16')]['findAll']({'raw':_0x9af76c[_0x25ed('0x17')]?_0x9af76c[_0x25ed('0x17')][_0x25ed('0x18')]===undefined?!![]:![]:!![],'where':_0x9af76c[_0x25ed('0x17')]?_0x9af76c[_0x25ed('0x17')][_0x25ed('0x19')]||null:null,'attributes':_0x9af76c['options']?_0x9af76c['options'][_0x25ed('0x1a')]||null:null,'limit':_0x9af76c[_0x25ed('0x17')]?_0x9af76c[_0x25ed('0x17')][_0x25ed('0x1b')]||null:null,'include':_0x9af76c[_0x25ed('0x17')]?_0x9af76c[_0x25ed('0x17')]['include']?_[_0x25ed('0x1c')](_0x9af76c['options'][_0x25ed('0x1d')],function(_0x12b854){return{'model':db[_0x12b854[_0x25ed('0x1e')]],'as':_0x12b854['as'],'attributes':_0x12b854[_0x25ed('0x1a')],'include':_0x12b854[_0x25ed('0x1d')]?_['map'](_0x12b854[_0x25ed('0x1d')],function(_0x3d6220){return{'model':db[_0x3d6220[_0x25ed('0x1e')]],'as':_0x3d6220['as'],'attributes':_0x3d6220[_0x25ed('0x1a')],'include':_0x3d6220[_0x25ed('0x1d')]?_['map'](_0x3d6220['include'],function(_0x5ca529){return{'model':db[_0x5ca529[_0x25ed('0x1e')]],'as':_0x5ca529['as'],'attributes':_0x5ca529[_0x25ed('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45b32a){logger[_0x25ed('0xd')]('GetSugarcrmAccount',_0x9af76c);logger['debug'](_0x25ed('0x1f'),_0x9af76c,JSON[_0x25ed('0x11')](_0x45b32a));_0x5e5246(_0x45b32a);})[_0x25ed('0x20')](function(_0x474f5e){logger[_0x25ed('0x12')](_0x25ed('0x1f'),_0x474f5e[_0x25ed('0x14')],_0x9af76c);_0x316779(_0x42534e[_0x25ed('0x12')](0x1f4,_0x474f5e[_0x25ed('0x14')]));});});};exports['ShowSugarcrmAccount']=function(_0xd9c867){var _0xaf5446=this;return new Promise(function(_0x157c2a,_0x133857){return db['SugarcrmAccount'][_0x25ed('0x21')]({'raw':_0xd9c867[_0x25ed('0x17')]?_0xd9c867[_0x25ed('0x17')][_0x25ed('0x18')]===undefined?!![]:![]:!![],'where':_0xd9c867[_0x25ed('0x17')]?_0xd9c867[_0x25ed('0x17')][_0x25ed('0x19')]||null:null,'attributes':_0xd9c867['options']?_0xd9c867[_0x25ed('0x17')]['attributes']||null:null,'include':_0xd9c867[_0x25ed('0x17')]?_0xd9c867[_0x25ed('0x17')][_0x25ed('0x1d')]?_[_0x25ed('0x1c')](_0xd9c867[_0x25ed('0x17')]['include'],function(_0x33ebca){return{'model':db[_0x33ebca[_0x25ed('0x1e')]],'as':_0x33ebca['as'],'attributes':_0x33ebca[_0x25ed('0x1a')],'include':_0x33ebca['include']?_[_0x25ed('0x1c')](_0x33ebca['include'],function(_0x5ac41d){return{'model':db[_0x5ac41d[_0x25ed('0x1e')]],'as':_0x5ac41d['as'],'attributes':_0x5ac41d['attributes'],'include':_0x5ac41d['include']?_[_0x25ed('0x1c')](_0x5ac41d[_0x25ed('0x1d')],function(_0xbb31c){return{'model':db[_0xbb31c[_0x25ed('0x1e')]],'as':_0xbb31c['as'],'attributes':_0xbb31c[_0x25ed('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x25ed('0x22')](function(_0x2442db){logger[_0x25ed('0xd')](_0x25ed('0x23'),_0xd9c867);logger[_0x25ed('0x24')](_0x25ed('0x23'),_0xd9c867,JSON[_0x25ed('0x11')](_0x2442db));_0x157c2a(_0x2442db);})[_0x25ed('0x20')](function(_0x4eaf3f){logger['error']('ShowSugarcrmAccount',_0x4eaf3f[_0x25ed('0x14')],_0xd9c867);_0x133857(_0xaf5446[_0x25ed('0x12')](0x1f4,_0x4eaf3f['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 29ba53a..8b2d38e 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 _0xf54a=['get','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','./intSugarcrmConfiguration.controller','isAuthenticated','index'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf54a,0xe9));var _0xaf54=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf54a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xaf54('0x0'));var util=require(_0xaf54('0x1'));var path=require(_0xaf54('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf54('0x3'));var router=express[_0xaf54('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xaf54('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaf54('0x6'));router['get']('/',auth[_0xaf54('0x7')](),controller[_0xaf54('0x8')]);router[_0xaf54('0x9')]('/:id',auth[_0xaf54('0x7')](),controller[_0xaf54('0xa')]);router[_0xaf54('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xaf54('0xb')]);router['get'](_0xaf54('0xc'),auth[_0xaf54('0x7')](),controller[_0xaf54('0xd')]);router[_0xaf54('0x9')](_0xaf54('0xe'),auth[_0xaf54('0x7')](),controller[_0xaf54('0xf')]);router[_0xaf54('0x10')]('/',auth['isAuthenticated'](),controller[_0xaf54('0x11')]);router['put']('/:id',auth[_0xaf54('0x7')](),controller[_0xaf54('0x12')]);router['delete'](_0xaf54('0x13'),auth[_0xaf54('0x7')](),controller[_0xaf54('0x14')]);module[_0xaf54('0x15')]=router; \ No newline at end of file +var _0xbfa8=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','/:id','update','delete','util','path'];(function(_0x46cfa6,_0x5707d1){var _0xb14cf1=function(_0x5506d7){while(--_0x5506d7){_0x46cfa6['push'](_0x46cfa6['shift']());}};_0xb14cf1(++_0x5707d1);}(_0xbfa8,0x106));var _0x8bfa=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xbfa8[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x8bfa('0x0'));var path=require(_0x8bfa('0x1'));var timeout=require(_0x8bfa('0x2'));var express=require('express');var router=express[_0x8bfa('0x3')]();var fs_extra=require(_0x8bfa('0x4'));var auth=require(_0x8bfa('0x5'));var interaction=require(_0x8bfa('0x6'));var config=require(_0x8bfa('0x7'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x8bfa('0x8')]('/',auth[_0x8bfa('0x9')](),controller[_0x8bfa('0xa')]);router[_0x8bfa('0x8')]('/:id',auth[_0x8bfa('0x9')](),controller[_0x8bfa('0xb')]);router['get'](_0x8bfa('0xc'),auth[_0x8bfa('0x9')](),controller[_0x8bfa('0xd')]);router[_0x8bfa('0x8')](_0x8bfa('0xe'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x8bfa('0x8')](_0x8bfa('0xf'),auth[_0x8bfa('0x9')](),controller[_0x8bfa('0x10')]);router[_0x8bfa('0x11')]('/',auth[_0x8bfa('0x9')](),controller[_0x8bfa('0x12')]);router['put'](_0x8bfa('0x13'),auth[_0x8bfa('0x9')](),controller[_0x8bfa('0x14')]);router[_0x8bfa('0x15')](_0x8bfa('0x13'),auth[_0x8bfa('0x9')](),controller['destroy']);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 9617393..c2902a7 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 _0x1e8e=['sequelize','STRING'];(function(_0x2b61b2,_0x33f60e){var _0x500a8f=function(_0x167bf3){while(--_0x167bf3){_0x2b61b2['push'](_0x2b61b2['shift']());}};_0x500a8f(++_0x33f60e);}(_0x1e8e,0x118));var _0xe1e8=function(_0x43510d,_0x3c2702){_0x43510d=_0x43510d-0x0;var _0x5b50ea=_0x1e8e[_0x43510d];return _0x5b50ea;};'use strict';var Sequelize=require(_0xe1e8('0x0'));module['exports']={'name':{'type':Sequelize[_0xe1e8('0x1')]},'description':{'type':Sequelize[_0xe1e8('0x1')]}}; \ No newline at end of file +var _0x8e60=['sequelize','exports','STRING'];(function(_0x5bc241,_0x1e7e19){var _0xcfddd7=function(_0x3d905a){while(--_0x3d905a){_0x5bc241['push'](_0x5bc241['shift']());}};_0xcfddd7(++_0x1e7e19);}(_0x8e60,0x18c));var _0x08e6=function(_0x4bf3f9,_0x459195){_0x4bf3f9=_0x4bf3f9-0x0;var _0x7bd6fc=_0x8e60[_0x4bf3f9];return _0x7bd6fc;};'use strict';var Sequelize=require(_0x08e6('0x0'));module[_0x08e6('0x1')]={'name':{'type':Sequelize[_0x08e6('0x2')]},'description':{'type':Sequelize[_0x08e6('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 6fd4210..6368341 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 _0xcbd8=['create','body','find','getFields','findOne','SugarcrmField','order','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','findAll','rows','show','params','length','catch'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcbd8,0x14a));var _0x8cbd=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcbd8[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8cbd('0x0'));var zipdir=require(_0x8cbd('0x1'));var jsonpatch=require(_0x8cbd('0x2'));var rp=require(_0x8cbd('0x3'));var moment=require(_0x8cbd('0x4'));var BPromise=require(_0x8cbd('0x5'));var Mustache=require(_0x8cbd('0x6'));var util=require('util');var path=require(_0x8cbd('0x7'));var sox=require(_0x8cbd('0x8'));var csv=require(_0x8cbd('0x9'));var ejs=require(_0x8cbd('0xa'));var fs=require('fs');var fs_extra=require(_0x8cbd('0xb'));var _=require(_0x8cbd('0xc'));var squel=require(_0x8cbd('0xd'));var crypto=require(_0x8cbd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x8cbd('0xf'));var toCsv=require(_0x8cbd('0x9'));var querystring=require(_0x8cbd('0x10'));var Papa=require('papaparse');var Redis=require(_0x8cbd('0x11'));var authService=require(_0x8cbd('0x12'));var qs=require(_0x8cbd('0x13'));var as=require(_0x8cbd('0x14'));var hardwareService=require(_0x8cbd('0x15'));var logger=require(_0x8cbd('0x16'))(_0x8cbd('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8cbd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e4402,_0x37b7e2){_0x37b7e2=_0x37b7e2||0xcc;return function(_0x3bfec8){if(_0x3bfec8){return _0x3e4402[_0x8cbd('0x19')](_0x37b7e2);}return _0x3e4402[_0x8cbd('0x1a')](_0x37b7e2)['end']();};}function respondWithResult(_0xd08bd6,_0xa6ada1){_0xa6ada1=_0xa6ada1||0xc8;return function(_0x3b3e6b){if(_0x3b3e6b){return _0xd08bd6['status'](_0xa6ada1)[_0x8cbd('0x1b')](_0x3b3e6b);}};}function respondWithFilteredResult(_0x4fb273,_0x4ad3c6){return function(_0x3c85c3){if(_0x3c85c3){var _0x56d253=typeof _0x4ad3c6[_0x8cbd('0x1c')]==='undefined'&&typeof _0x4ad3c6[_0x8cbd('0x1d')]==='undefined';var _0x56b3ad=_0x3c85c3[_0x8cbd('0x1e')];var _0x1c3733=_0x56d253?0x0:_0x4ad3c6[_0x8cbd('0x1c')];var _0x58d5d9=_0x56d253?_0x3c85c3[_0x8cbd('0x1e')]:_0x4ad3c6[_0x8cbd('0x1c')]+_0x4ad3c6[_0x8cbd('0x1d')];var _0x2e36b8;if(_0x58d5d9>=_0x56b3ad){_0x58d5d9=_0x56b3ad;_0x2e36b8=0xc8;}else{_0x2e36b8=0xce;}_0x4fb273[_0x8cbd('0x1a')](_0x2e36b8);return _0x4fb273[_0x8cbd('0x1f')](_0x8cbd('0x20'),_0x1c3733+'-'+_0x58d5d9+'/'+_0x56b3ad)[_0x8cbd('0x1b')](_0x3c85c3);}return null;};}function patchUpdates(_0x5c786b){return function(_0x23518b){try{jsonpatch[_0x8cbd('0x21')](_0x23518b,_0x5c786b,!![]);}catch(_0x105a2b){return BPromise[_0x8cbd('0x22')](_0x105a2b);}return _0x23518b['save']();};}function saveUpdates(_0x36a739,_0x2f400d){return function(_0x15dda6){if(_0x15dda6){return _0x15dda6[_0x8cbd('0x23')](_0x36a739)[_0x8cbd('0x24')](function(_0x184874){return _0x184874;});}return null;};}function removeEntity(_0x4776d2,_0x3fa0d8){return function(_0x4eb28c){if(_0x4eb28c){return _0x4eb28c[_0x8cbd('0x25')]()['then'](function(){_0x4776d2['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x9de530,_0x169d81){return function(_0x3d2e4e){if(!_0x3d2e4e){_0x9de530[_0x8cbd('0x19')](0x194);}return _0x3d2e4e;};}function handleError(_0x4d5f6d,_0x39358d){_0x39358d=_0x39358d||0x1f4;return function(_0x51625f){logger[_0x8cbd('0x26')](_0x51625f[_0x8cbd('0x27')]);if(_0x51625f[_0x8cbd('0x28')]){delete _0x51625f[_0x8cbd('0x28')];}_0x4d5f6d[_0x8cbd('0x1a')](_0x39358d)['send'](_0x51625f);};}exports[_0x8cbd('0x29')]=function(_0x1a3df7,_0xf43b7e){var _0x51e670={},_0x3eeb6e={},_0x9e4188={'count':0x0,'rows':[]};var _0x3155e9=_[_0x8cbd('0x2a')](db['SugarcrmConfiguration'][_0x8cbd('0x2b')],function(_0x5d9d2c){return{'name':_0x5d9d2c['fieldName'],'type':_0x5d9d2c[_0x8cbd('0x2c')][_0x8cbd('0x2d')]};});_0x3eeb6e[_0x8cbd('0x2e')]=_[_0x8cbd('0x2a')](_0x3155e9,'name');_0x3eeb6e[_0x8cbd('0x2f')]=_[_0x8cbd('0x30')](_0x1a3df7[_0x8cbd('0x2f')]);_0x3eeb6e[_0x8cbd('0x31')]=_[_0x8cbd('0x32')](_0x3eeb6e['model'],_0x3eeb6e[_0x8cbd('0x2f')]);_0x51e670['attributes']=_[_0x8cbd('0x32')](_0x3eeb6e['model'],qs['fields'](_0x1a3df7['query'][_0x8cbd('0x33')]));_0x51e670[_0x8cbd('0x34')]=_0x51e670[_0x8cbd('0x34')]['length']?_0x51e670[_0x8cbd('0x34')]:_0x3eeb6e['model'];if(!_0x1a3df7['query']['hasOwnProperty'](_0x8cbd('0x35'))){_0x51e670[_0x8cbd('0x1d')]=qs[_0x8cbd('0x1d')](_0x1a3df7[_0x8cbd('0x2f')]['limit']);_0x51e670[_0x8cbd('0x1c')]=qs[_0x8cbd('0x1c')](_0x1a3df7['query'][_0x8cbd('0x1c')]);}_0x51e670['order']=qs[_0x8cbd('0x36')](_0x1a3df7[_0x8cbd('0x2f')][_0x8cbd('0x36')]);_0x51e670['where']=qs[_0x8cbd('0x31')](_[_0x8cbd('0x37')](_0x1a3df7[_0x8cbd('0x2f')],_0x3eeb6e[_0x8cbd('0x31')]),_0x3155e9);if(_0x1a3df7[_0x8cbd('0x2f')][_0x8cbd('0x38')]){_0x51e670[_0x8cbd('0x39')]=_[_0x8cbd('0x3a')](_0x51e670['where'],{'$or':_[_0x8cbd('0x2a')](_0x3155e9,function(_0x5acbf6){if(_0x5acbf6[_0x8cbd('0x2c')]!==_0x8cbd('0x3b')){var _0x4d6f77={};_0x4d6f77[_0x5acbf6[_0x8cbd('0x28')]]={'$like':'%'+_0x1a3df7[_0x8cbd('0x2f')][_0x8cbd('0x38')]+'%'};return _0x4d6f77;}})});}_0x51e670=_[_0x8cbd('0x3a')]({},_0x51e670,_0x1a3df7[_0x8cbd('0x3c')]);var _0xe734e4={'where':_0x51e670['where']};return db[_0x8cbd('0x3d')][_0x8cbd('0x1e')](_0xe734e4)['then'](function(_0x3803b0){_0x9e4188[_0x8cbd('0x1e')]=_0x3803b0;if(_0x1a3df7['query'][_0x8cbd('0x3e')]){_0x51e670[_0x8cbd('0x3f')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x8cbd('0x40')](_0x51e670);})['then'](function(_0x2e04a3){_0x9e4188[_0x8cbd('0x41')]=_0x2e04a3;return _0x9e4188;})[_0x8cbd('0x24')](respondWithFilteredResult(_0xf43b7e,_0x51e670))['catch'](handleError(_0xf43b7e,null));};exports[_0x8cbd('0x42')]=function(_0x54686d,_0x1de13b){var _0x2d9425={'raw':![],'where':{'id':_0x54686d[_0x8cbd('0x43')]['id']}},_0x35473c={};_0x35473c[_0x8cbd('0x2e')]=_[_0x8cbd('0x30')](db[_0x8cbd('0x3d')]['rawAttributes']);_0x35473c[_0x8cbd('0x2f')]=_[_0x8cbd('0x30')](_0x54686d[_0x8cbd('0x2f')]);_0x35473c['filters']=_[_0x8cbd('0x32')](_0x35473c['model'],_0x35473c['query']);_0x2d9425[_0x8cbd('0x34')]=_['intersection'](_0x35473c[_0x8cbd('0x2e')],qs[_0x8cbd('0x33')](_0x54686d[_0x8cbd('0x2f')][_0x8cbd('0x33')]));_0x2d9425['attributes']=_0x2d9425['attributes'][_0x8cbd('0x44')]?_0x2d9425[_0x8cbd('0x34')]:_0x35473c[_0x8cbd('0x2e')];if(_0x54686d['query'][_0x8cbd('0x3e')]){_0x2d9425[_0x8cbd('0x3f')]=[{'all':!![]}];}_0x2d9425=_[_0x8cbd('0x3a')]({},_0x2d9425,_0x54686d[_0x8cbd('0x3c')]);return db[_0x8cbd('0x3d')]['find'](_0x2d9425)['then'](handleEntityNotFound(_0x1de13b,null))[_0x8cbd('0x24')](respondWithResult(_0x1de13b,null))[_0x8cbd('0x45')](handleError(_0x1de13b,null));};exports['create']=function(_0x261af5,_0x336556){return db[_0x8cbd('0x3d')][_0x8cbd('0x46')](_0x261af5[_0x8cbd('0x47')],{})[_0x8cbd('0x24')](respondWithResult(_0x336556,0xc9))['catch'](handleError(_0x336556,null));};exports[_0x8cbd('0x23')]=function(_0x3129de,_0x287f29){if(_0x3129de['body']['id']){delete _0x3129de[_0x8cbd('0x47')]['id'];}return db[_0x8cbd('0x3d')][_0x8cbd('0x48')]({'where':{'id':_0x3129de['params']['id']}})[_0x8cbd('0x24')](handleEntityNotFound(_0x287f29,null))[_0x8cbd('0x24')](saveUpdates(_0x3129de[_0x8cbd('0x47')],null))[_0x8cbd('0x24')](respondWithResult(_0x287f29,null))[_0x8cbd('0x45')](handleError(_0x287f29,null));};exports[_0x8cbd('0x25')]=function(_0x39d575,_0x26c42d){return db[_0x8cbd('0x3d')][_0x8cbd('0x48')]({'where':{'id':_0x39d575[_0x8cbd('0x43')]['id']}})['then'](handleEntityNotFound(_0x26c42d,null))[_0x8cbd('0x24')](removeEntity(_0x26c42d,null))[_0x8cbd('0x45')](handleError(_0x26c42d,null));};exports[_0x8cbd('0x49')]=function(_0x1ff873,_0x1e68ac,_0x304ed3){var _0x29b638={};var _0x5cce45={};var _0x2e1009;var _0x2c85c3;return db[_0x8cbd('0x3d')][_0x8cbd('0x4a')]({'where':{'id':_0x1ff873[_0x8cbd('0x43')]['id']}})[_0x8cbd('0x24')](handleEntityNotFound(_0x1e68ac,null))[_0x8cbd('0x24')](function(_0x57ffa4){if(_0x57ffa4){_0x2e1009=_0x57ffa4;_0x5cce45[_0x8cbd('0x2e')]=_[_0x8cbd('0x30')](db[_0x8cbd('0x4b')]['rawAttributes']);_0x5cce45[_0x8cbd('0x2f')]=_['keys'](_0x1ff873['query']);_0x5cce45[_0x8cbd('0x31')]=_['intersection'](_0x5cce45[_0x8cbd('0x2e')],_0x5cce45['query']);_0x29b638[_0x8cbd('0x34')]=_[_0x8cbd('0x32')](_0x5cce45[_0x8cbd('0x2e')],qs[_0x8cbd('0x33')](_0x1ff873[_0x8cbd('0x2f')]['fields']));_0x29b638[_0x8cbd('0x34')]=_0x29b638[_0x8cbd('0x34')][_0x8cbd('0x44')]?_0x29b638[_0x8cbd('0x34')]:_0x5cce45[_0x8cbd('0x2e')];_0x29b638[_0x8cbd('0x4c')]=qs[_0x8cbd('0x36')](_0x1ff873['query']['sort']);_0x29b638[_0x8cbd('0x39')]=qs[_0x8cbd('0x31')](_['pick'](_0x1ff873[_0x8cbd('0x2f')],_0x5cce45['filters']));if(_0x1ff873['query'][_0x8cbd('0x38')]){_0x29b638[_0x8cbd('0x39')]=_['merge'](_0x29b638[_0x8cbd('0x39')],{'$or':_[_0x8cbd('0x2a')](_0x29b638[_0x8cbd('0x34')],function(_0x3fbfa3){var _0x2c636c={};_0x2c636c[_0x3fbfa3]={'$like':'%'+_0x1ff873[_0x8cbd('0x2f')]['filter']+'%'};return _0x2c636c;})});}_0x29b638=_[_0x8cbd('0x3a')]({},_0x29b638,_0x1ff873[_0x8cbd('0x3c')]);return _0x2e1009['getFields'](_0x29b638);}})[_0x8cbd('0x24')](function(_0x3e7350){if(_0x3e7350){_0x2c85c3=_0x3e7350['length'];if(!_0x1ff873[_0x8cbd('0x2f')][_0x8cbd('0x4d')](_0x8cbd('0x35'))){_0x29b638[_0x8cbd('0x1d')]=qs[_0x8cbd('0x1d')](_0x1ff873[_0x8cbd('0x2f')][_0x8cbd('0x1d')]);_0x29b638[_0x8cbd('0x1c')]=qs[_0x8cbd('0x1c')](_0x1ff873[_0x8cbd('0x2f')][_0x8cbd('0x1c')]);}return _0x2e1009[_0x8cbd('0x49')](_0x29b638);}})[_0x8cbd('0x24')](function(_0x519389){if(_0x519389){return _0x519389?{'count':_0x2c85c3,'rows':_0x519389}:null;}})[_0x8cbd('0x24')](respondWithResult(_0x1e68ac,null))[_0x8cbd('0x45')](handleError(_0x1e68ac,null));};exports[_0x8cbd('0x4e')]=function(_0x30224e,_0x671b47,_0x3ad243){var _0x508b04={};var _0x109995={};var _0x4111d3;var _0x43359a;return db['SugarcrmConfiguration'][_0x8cbd('0x4a')]({'where':{'id':_0x30224e['params']['id']}})[_0x8cbd('0x24')](handleEntityNotFound(_0x671b47,null))['then'](function(_0x12f426){if(_0x12f426){_0x4111d3=_0x12f426;_0x109995[_0x8cbd('0x2e')]=_['keys'](db[_0x8cbd('0x4b')][_0x8cbd('0x2b')]);_0x109995[_0x8cbd('0x2f')]=_[_0x8cbd('0x30')](_0x30224e[_0x8cbd('0x2f')]);_0x109995[_0x8cbd('0x31')]=_[_0x8cbd('0x32')](_0x109995[_0x8cbd('0x2e')],_0x109995[_0x8cbd('0x2f')]);_0x508b04['attributes']=_[_0x8cbd('0x32')](_0x109995[_0x8cbd('0x2e')],qs[_0x8cbd('0x33')](_0x30224e['query'][_0x8cbd('0x33')]));_0x508b04[_0x8cbd('0x34')]=_0x508b04[_0x8cbd('0x34')][_0x8cbd('0x44')]?_0x508b04[_0x8cbd('0x34')]:_0x109995[_0x8cbd('0x2e')];_0x508b04[_0x8cbd('0x4c')]=qs['sort'](_0x30224e[_0x8cbd('0x2f')][_0x8cbd('0x36')]);_0x508b04['where']=qs[_0x8cbd('0x31')](_['pick'](_0x30224e['query'],_0x109995[_0x8cbd('0x31')]));if(_0x30224e['query'][_0x8cbd('0x38')]){_0x508b04[_0x8cbd('0x39')]=_['merge'](_0x508b04['where'],{'$or':_[_0x8cbd('0x2a')](_0x508b04[_0x8cbd('0x34')],function(_0x10425e){var _0x1af556={};_0x1af556[_0x10425e]={'$like':'%'+_0x30224e['query'][_0x8cbd('0x38')]+'%'};return _0x1af556;})});}_0x508b04=_[_0x8cbd('0x3a')]({},_0x508b04,_0x30224e[_0x8cbd('0x3c')]);return _0x4111d3[_0x8cbd('0x4e')](_0x508b04);}})[_0x8cbd('0x24')](function(_0x785997){if(_0x785997){_0x43359a=_0x785997[_0x8cbd('0x44')];if(!_0x30224e['query'][_0x8cbd('0x4d')](_0x8cbd('0x35'))){_0x508b04[_0x8cbd('0x1d')]=qs['limit'](_0x30224e[_0x8cbd('0x2f')][_0x8cbd('0x1d')]);_0x508b04[_0x8cbd('0x1c')]=qs[_0x8cbd('0x1c')](_0x30224e[_0x8cbd('0x2f')][_0x8cbd('0x1c')]);}return _0x4111d3['getSubjects'](_0x508b04);}})[_0x8cbd('0x24')](function(_0x3a4b92){if(_0x3a4b92){return _0x3a4b92?{'count':_0x43359a,'rows':_0x3a4b92}:null;}})['then'](respondWithResult(_0x671b47,null))[_0x8cbd('0x45')](handleError(_0x671b47,null));};exports[_0x8cbd('0x4f')]=function(_0x3a38ec,_0xa3e759,_0x16de08){var _0xd40286={};var _0x160207={};var _0x517788;var _0x2450df;return db['SugarcrmConfiguration'][_0x8cbd('0x4a')]({'where':{'id':_0x3a38ec['params']['id']}})['then'](handleEntityNotFound(_0xa3e759,null))[_0x8cbd('0x24')](function(_0x3a6e72){if(_0x3a6e72){_0x517788=_0x3a6e72;_0x160207[_0x8cbd('0x2e')]=_[_0x8cbd('0x30')](db['SugarcrmField'][_0x8cbd('0x2b')]);_0x160207[_0x8cbd('0x2f')]=_[_0x8cbd('0x30')](_0x3a38ec[_0x8cbd('0x2f')]);_0x160207['filters']=_['intersection'](_0x160207[_0x8cbd('0x2e')],_0x160207['query']);_0xd40286[_0x8cbd('0x34')]=_[_0x8cbd('0x32')](_0x160207[_0x8cbd('0x2e')],qs[_0x8cbd('0x33')](_0x3a38ec[_0x8cbd('0x2f')]['fields']));_0xd40286['attributes']=_0xd40286['attributes']['length']?_0xd40286[_0x8cbd('0x34')]:_0x160207[_0x8cbd('0x2e')];_0xd40286[_0x8cbd('0x4c')]=qs[_0x8cbd('0x36')](_0x3a38ec[_0x8cbd('0x2f')][_0x8cbd('0x36')]);_0xd40286[_0x8cbd('0x39')]=qs[_0x8cbd('0x31')](_['pick'](_0x3a38ec['query'],_0x160207[_0x8cbd('0x31')]));if(_0x3a38ec[_0x8cbd('0x2f')][_0x8cbd('0x38')]){_0xd40286['where']=_['merge'](_0xd40286[_0x8cbd('0x39')],{'$or':_[_0x8cbd('0x2a')](_0xd40286[_0x8cbd('0x34')],function(_0x341249){var _0x13e066={};_0x13e066[_0x341249]={'$like':'%'+_0x3a38ec[_0x8cbd('0x2f')]['filter']+'%'};return _0x13e066;})});}_0xd40286=_[_0x8cbd('0x3a')]({},_0xd40286,_0x3a38ec[_0x8cbd('0x3c')]);return _0x517788['getDescriptions'](_0xd40286);}})[_0x8cbd('0x24')](function(_0x45bd74){if(_0x45bd74){_0x2450df=_0x45bd74[_0x8cbd('0x44')];if(!_0x3a38ec[_0x8cbd('0x2f')][_0x8cbd('0x4d')](_0x8cbd('0x35'))){_0xd40286[_0x8cbd('0x1d')]=qs[_0x8cbd('0x1d')](_0x3a38ec[_0x8cbd('0x2f')]['limit']);_0xd40286['offset']=qs[_0x8cbd('0x1c')](_0x3a38ec['query'][_0x8cbd('0x1c')]);}return _0x517788[_0x8cbd('0x4f')](_0xd40286);}})[_0x8cbd('0x24')](function(_0x19fa49){if(_0x19fa49){return _0x19fa49?{'count':_0x2450df,'rows':_0x19fa49}:null;}})[_0x8cbd('0x24')](respondWithResult(_0xa3e759,null))[_0x8cbd('0x45')](handleError(_0xa3e759,null));}; \ No newline at end of file +var _0x9cb1=['SugarcrmConfiguration','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','merge','create','body','find','getFields','findOne','SugarcrmField','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','limit','count','offset','set','Content-Range','json','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index'];(function(_0x38ecb0,_0x3dee6d){var _0x37aa84=function(_0x2f9568){while(--_0x2f9568){_0x38ecb0['push'](_0x38ecb0['shift']());}};_0x37aa84(++_0x3dee6d);}(_0x9cb1,0x76));var _0x19cb=function(_0x283cbb,_0x2d8839){_0x283cbb=_0x283cbb-0x0;var _0x4755e8=_0x9cb1[_0x283cbb];return _0x4755e8;};'use strict';var emlformat=require(_0x19cb('0x0'));var rimraf=require(_0x19cb('0x1'));var zipdir=require(_0x19cb('0x2'));var jsonpatch=require(_0x19cb('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x19cb('0x4'));var Mustache=require('mustache');var util=require(_0x19cb('0x5'));var path=require(_0x19cb('0x6'));var sox=require(_0x19cb('0x7'));var csv=require(_0x19cb('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x19cb('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x19cb('0xa'));var jsforce=require(_0x19cb('0xb'));var deskjs=require(_0x19cb('0xc'));var toCsv=require('to-csv');var querystring=require(_0x19cb('0xd'));var Papa=require(_0x19cb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x19cb('0xf'));var as=require(_0x19cb('0x10'));var hardwareService=require(_0x19cb('0x11'));var logger=require(_0x19cb('0x12'))(_0x19cb('0x13'));var utils=require(_0x19cb('0x14'));var config=require(_0x19cb('0x15'));var licenseUtil=require(_0x19cb('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x151fb5,_0x1b491c){_0x1b491c=_0x1b491c||0xcc;return function(_0x7e9467){if(_0x7e9467){return _0x151fb5['sendStatus'](_0x1b491c);}return _0x151fb5[_0x19cb('0x17')](_0x1b491c)['end']();};}function respondWithResult(_0xcabb54,_0x14a6c9){_0x14a6c9=_0x14a6c9||0xc8;return function(_0x536c16){if(_0x536c16){return _0xcabb54['status'](_0x14a6c9)['json'](_0x536c16);}};}function respondWithFilteredResult(_0x38e5b8,_0x1c97bd){return function(_0x248297){if(_0x248297){var _0x39b4f4=typeof _0x1c97bd['offset']==='undefined'&&typeof _0x1c97bd[_0x19cb('0x18')]==='undefined';var _0x22de18=_0x248297[_0x19cb('0x19')];var _0x573d95=_0x39b4f4?0x0:_0x1c97bd[_0x19cb('0x1a')];var _0x3e4eb9=_0x39b4f4?_0x248297[_0x19cb('0x19')]:_0x1c97bd[_0x19cb('0x1a')]+_0x1c97bd[_0x19cb('0x18')];var _0x3d24c3;if(_0x3e4eb9>=_0x22de18){_0x3e4eb9=_0x22de18;_0x3d24c3=0xc8;}else{_0x3d24c3=0xce;}_0x38e5b8[_0x19cb('0x17')](_0x3d24c3);return _0x38e5b8[_0x19cb('0x1b')](_0x19cb('0x1c'),_0x573d95+'-'+_0x3e4eb9+'/'+_0x22de18)[_0x19cb('0x1d')](_0x248297);}return null;};}function patchUpdates(_0x2a82a7){return function(_0x434e9e){try{jsonpatch[_0x19cb('0x1e')](_0x434e9e,_0x2a82a7,!![]);}catch(_0x49aa8a){return BPromise[_0x19cb('0x1f')](_0x49aa8a);}return _0x434e9e[_0x19cb('0x20')]();};}function saveUpdates(_0x2f4779,_0xc1e9cc){return function(_0x566278){if(_0x566278){return _0x566278[_0x19cb('0x21')](_0x2f4779)['then'](function(_0x41b3fd){return _0x41b3fd;});}return null;};}function removeEntity(_0x5e3de4,_0x2b65e5){return function(_0x9210ac){if(_0x9210ac){return _0x9210ac[_0x19cb('0x22')]()[_0x19cb('0x23')](function(){_0x5e3de4[_0x19cb('0x17')](0xcc)[_0x19cb('0x24')]();});}};}function handleEntityNotFound(_0x1a6be6,_0xc286a2){return function(_0x4b3ff5){if(!_0x4b3ff5){_0x1a6be6[_0x19cb('0x25')](0x194);}return _0x4b3ff5;};}function handleError(_0x5567f6,_0x3f1bcd){_0x3f1bcd=_0x3f1bcd||0x1f4;return function(_0xba516c){logger['error'](_0xba516c[_0x19cb('0x26')]);if(_0xba516c[_0x19cb('0x27')]){delete _0xba516c[_0x19cb('0x27')];}_0x5567f6[_0x19cb('0x17')](_0x3f1bcd)[_0x19cb('0x28')](_0xba516c);};}exports[_0x19cb('0x29')]=function(_0x181d3e,_0x1fd75b){var _0x13ac34={},_0x3c49fd={},_0x46b61d={'count':0x0,'rows':[]};var _0x3c98b3=_['map'](db[_0x19cb('0x2a')][_0x19cb('0x2b')],function(_0x253090){return{'name':_0x253090[_0x19cb('0x2c')],'type':_0x253090[_0x19cb('0x2d')]['key']};});_0x3c49fd[_0x19cb('0x2e')]=_[_0x19cb('0x2f')](_0x3c98b3,_0x19cb('0x27'));_0x3c49fd[_0x19cb('0x30')]=_[_0x19cb('0x31')](_0x181d3e[_0x19cb('0x30')]);_0x3c49fd[_0x19cb('0x32')]=_[_0x19cb('0x33')](_0x3c49fd['model'],_0x3c49fd[_0x19cb('0x30')]);_0x13ac34[_0x19cb('0x34')]=_[_0x19cb('0x33')](_0x3c49fd[_0x19cb('0x2e')],qs['fields'](_0x181d3e['query'][_0x19cb('0x35')]));_0x13ac34[_0x19cb('0x34')]=_0x13ac34['attributes'][_0x19cb('0x36')]?_0x13ac34[_0x19cb('0x34')]:_0x3c49fd[_0x19cb('0x2e')];if(!_0x181d3e['query'][_0x19cb('0x37')](_0x19cb('0x38'))){_0x13ac34[_0x19cb('0x18')]=qs[_0x19cb('0x18')](_0x181d3e[_0x19cb('0x30')][_0x19cb('0x18')]);_0x13ac34[_0x19cb('0x1a')]=qs[_0x19cb('0x1a')](_0x181d3e[_0x19cb('0x30')]['offset']);}_0x13ac34['order']=qs['sort'](_0x181d3e['query'][_0x19cb('0x39')]);_0x13ac34['where']=qs[_0x19cb('0x32')](_[_0x19cb('0x3a')](_0x181d3e[_0x19cb('0x30')],_0x3c49fd[_0x19cb('0x32')]),_0x3c98b3);if(_0x181d3e[_0x19cb('0x30')][_0x19cb('0x3b')]){_0x13ac34['where']=_['merge'](_0x13ac34[_0x19cb('0x3c')],{'$or':_['map'](_0x3c98b3,function(_0x35e864){if(_0x35e864[_0x19cb('0x2d')]!==_0x19cb('0x3d')){var _0x3273e8={};_0x3273e8[_0x35e864[_0x19cb('0x27')]]={'$like':'%'+_0x181d3e['query'][_0x19cb('0x3b')]+'%'};return _0x3273e8;}})});}_0x13ac34=_['merge']({},_0x13ac34,_0x181d3e[_0x19cb('0x3e')]);var _0x41bf80={'where':_0x13ac34[_0x19cb('0x3c')]};return db[_0x19cb('0x2a')][_0x19cb('0x19')](_0x41bf80)['then'](function(_0x309706){_0x46b61d[_0x19cb('0x19')]=_0x309706;if(_0x181d3e[_0x19cb('0x30')][_0x19cb('0x3f')]){_0x13ac34[_0x19cb('0x40')]=[{'all':!![]}];}return db[_0x19cb('0x2a')][_0x19cb('0x41')](_0x13ac34);})['then'](function(_0x138f80){_0x46b61d[_0x19cb('0x42')]=_0x138f80;return _0x46b61d;})['then'](respondWithFilteredResult(_0x1fd75b,_0x13ac34))[_0x19cb('0x43')](handleError(_0x1fd75b,null));};exports[_0x19cb('0x44')]=function(_0x4d8c0e,_0x4a363){var _0x379880={'raw':![],'where':{'id':_0x4d8c0e[_0x19cb('0x45')]['id']}},_0x309819={};_0x309819['model']=_[_0x19cb('0x31')](db['SugarcrmConfiguration']['rawAttributes']);_0x309819[_0x19cb('0x30')]=_[_0x19cb('0x31')](_0x4d8c0e[_0x19cb('0x30')]);_0x309819[_0x19cb('0x32')]=_[_0x19cb('0x33')](_0x309819['model'],_0x309819['query']);_0x379880[_0x19cb('0x34')]=_[_0x19cb('0x33')](_0x309819[_0x19cb('0x2e')],qs[_0x19cb('0x35')](_0x4d8c0e[_0x19cb('0x30')][_0x19cb('0x35')]));_0x379880[_0x19cb('0x34')]=_0x379880[_0x19cb('0x34')][_0x19cb('0x36')]?_0x379880[_0x19cb('0x34')]:_0x309819[_0x19cb('0x2e')];if(_0x4d8c0e['query'][_0x19cb('0x3f')]){_0x379880[_0x19cb('0x40')]=[{'all':!![]}];}_0x379880=_[_0x19cb('0x46')]({},_0x379880,_0x4d8c0e['options']);return db[_0x19cb('0x2a')]['find'](_0x379880)[_0x19cb('0x23')](handleEntityNotFound(_0x4a363,null))[_0x19cb('0x23')](respondWithResult(_0x4a363,null))[_0x19cb('0x43')](handleError(_0x4a363,null));};exports[_0x19cb('0x47')]=function(_0x16ebc1,_0x110811){return db[_0x19cb('0x2a')][_0x19cb('0x47')](_0x16ebc1[_0x19cb('0x48')],{})[_0x19cb('0x23')](respondWithResult(_0x110811,0xc9))[_0x19cb('0x43')](handleError(_0x110811,null));};exports[_0x19cb('0x21')]=function(_0x58efd7,_0x2913a5){if(_0x58efd7[_0x19cb('0x48')]['id']){delete _0x58efd7['body']['id'];}return db[_0x19cb('0x2a')][_0x19cb('0x49')]({'where':{'id':_0x58efd7[_0x19cb('0x45')]['id']}})[_0x19cb('0x23')](handleEntityNotFound(_0x2913a5,null))['then'](saveUpdates(_0x58efd7[_0x19cb('0x48')],null))[_0x19cb('0x23')](respondWithResult(_0x2913a5,null))[_0x19cb('0x43')](handleError(_0x2913a5,null));};exports[_0x19cb('0x22')]=function(_0x4599a,_0x301ad2){return db[_0x19cb('0x2a')][_0x19cb('0x49')]({'where':{'id':_0x4599a[_0x19cb('0x45')]['id']}})['then'](handleEntityNotFound(_0x301ad2,null))['then'](removeEntity(_0x301ad2,null))[_0x19cb('0x43')](handleError(_0x301ad2,null));};exports[_0x19cb('0x4a')]=function(_0x4115cf,_0x72e9a0,_0x65057){var _0x134723={};var _0x577751={};var _0x30abb3;var _0x345fd9;return db[_0x19cb('0x2a')][_0x19cb('0x4b')]({'where':{'id':_0x4115cf[_0x19cb('0x45')]['id']}})[_0x19cb('0x23')](handleEntityNotFound(_0x72e9a0,null))[_0x19cb('0x23')](function(_0x4287d4){if(_0x4287d4){_0x30abb3=_0x4287d4;_0x577751[_0x19cb('0x2e')]=_[_0x19cb('0x31')](db[_0x19cb('0x4c')][_0x19cb('0x2b')]);_0x577751[_0x19cb('0x30')]=_[_0x19cb('0x31')](_0x4115cf[_0x19cb('0x30')]);_0x577751[_0x19cb('0x32')]=_[_0x19cb('0x33')](_0x577751[_0x19cb('0x2e')],_0x577751[_0x19cb('0x30')]);_0x134723['attributes']=_['intersection'](_0x577751[_0x19cb('0x2e')],qs[_0x19cb('0x35')](_0x4115cf['query'][_0x19cb('0x35')]));_0x134723[_0x19cb('0x34')]=_0x134723[_0x19cb('0x34')]['length']?_0x134723[_0x19cb('0x34')]:_0x577751[_0x19cb('0x2e')];_0x134723[_0x19cb('0x4d')]=qs[_0x19cb('0x39')](_0x4115cf[_0x19cb('0x30')][_0x19cb('0x39')]);_0x134723[_0x19cb('0x3c')]=qs[_0x19cb('0x32')](_[_0x19cb('0x3a')](_0x4115cf[_0x19cb('0x30')],_0x577751[_0x19cb('0x32')]));if(_0x4115cf[_0x19cb('0x30')][_0x19cb('0x3b')]){_0x134723[_0x19cb('0x3c')]=_['merge'](_0x134723[_0x19cb('0x3c')],{'$or':_[_0x19cb('0x2f')](_0x134723[_0x19cb('0x34')],function(_0x25e3b6){var _0x300831={};_0x300831[_0x25e3b6]={'$like':'%'+_0x4115cf[_0x19cb('0x30')][_0x19cb('0x3b')]+'%'};return _0x300831;})});}_0x134723=_[_0x19cb('0x46')]({},_0x134723,_0x4115cf['options']);return _0x30abb3['getFields'](_0x134723);}})[_0x19cb('0x23')](function(_0x29e837){if(_0x29e837){_0x345fd9=_0x29e837[_0x19cb('0x36')];if(!_0x4115cf[_0x19cb('0x30')][_0x19cb('0x37')](_0x19cb('0x38'))){_0x134723[_0x19cb('0x18')]=qs[_0x19cb('0x18')](_0x4115cf[_0x19cb('0x30')]['limit']);_0x134723[_0x19cb('0x1a')]=qs['offset'](_0x4115cf[_0x19cb('0x30')][_0x19cb('0x1a')]);}return _0x30abb3[_0x19cb('0x4a')](_0x134723);}})[_0x19cb('0x23')](function(_0x4f87a8){if(_0x4f87a8){return _0x4f87a8?{'count':_0x345fd9,'rows':_0x4f87a8}:null;}})[_0x19cb('0x23')](respondWithResult(_0x72e9a0,null))['catch'](handleError(_0x72e9a0,null));};exports[_0x19cb('0x4e')]=function(_0x1b0c7a,_0x38fc12,_0x3d441c){var _0x379617={};var _0x13e653={};var _0x4050c5;var _0x5971b2;return db['SugarcrmConfiguration'][_0x19cb('0x4b')]({'where':{'id':_0x1b0c7a['params']['id']}})[_0x19cb('0x23')](handleEntityNotFound(_0x38fc12,null))[_0x19cb('0x23')](function(_0x16bf9c){if(_0x16bf9c){_0x4050c5=_0x16bf9c;_0x13e653[_0x19cb('0x2e')]=_[_0x19cb('0x31')](db['SugarcrmField'][_0x19cb('0x2b')]);_0x13e653[_0x19cb('0x30')]=_[_0x19cb('0x31')](_0x1b0c7a['query']);_0x13e653[_0x19cb('0x32')]=_[_0x19cb('0x33')](_0x13e653[_0x19cb('0x2e')],_0x13e653[_0x19cb('0x30')]);_0x379617['attributes']=_[_0x19cb('0x33')](_0x13e653['model'],qs[_0x19cb('0x35')](_0x1b0c7a[_0x19cb('0x30')][_0x19cb('0x35')]));_0x379617[_0x19cb('0x34')]=_0x379617[_0x19cb('0x34')][_0x19cb('0x36')]?_0x379617[_0x19cb('0x34')]:_0x13e653['model'];_0x379617[_0x19cb('0x4d')]=qs[_0x19cb('0x39')](_0x1b0c7a[_0x19cb('0x30')][_0x19cb('0x39')]);_0x379617[_0x19cb('0x3c')]=qs[_0x19cb('0x32')](_[_0x19cb('0x3a')](_0x1b0c7a[_0x19cb('0x30')],_0x13e653[_0x19cb('0x32')]));if(_0x1b0c7a['query'][_0x19cb('0x3b')]){_0x379617[_0x19cb('0x3c')]=_['merge'](_0x379617[_0x19cb('0x3c')],{'$or':_[_0x19cb('0x2f')](_0x379617[_0x19cb('0x34')],function(_0x55061d){var _0x1c8714={};_0x1c8714[_0x55061d]={'$like':'%'+_0x1b0c7a['query'][_0x19cb('0x3b')]+'%'};return _0x1c8714;})});}_0x379617=_[_0x19cb('0x46')]({},_0x379617,_0x1b0c7a['options']);return _0x4050c5['getSubjects'](_0x379617);}})['then'](function(_0x20fdcc){if(_0x20fdcc){_0x5971b2=_0x20fdcc[_0x19cb('0x36')];if(!_0x1b0c7a[_0x19cb('0x30')][_0x19cb('0x37')](_0x19cb('0x38'))){_0x379617['limit']=qs[_0x19cb('0x18')](_0x1b0c7a[_0x19cb('0x30')]['limit']);_0x379617[_0x19cb('0x1a')]=qs['offset'](_0x1b0c7a[_0x19cb('0x30')][_0x19cb('0x1a')]);}return _0x4050c5[_0x19cb('0x4e')](_0x379617);}})['then'](function(_0x3714a4){if(_0x3714a4){return _0x3714a4?{'count':_0x5971b2,'rows':_0x3714a4}:null;}})[_0x19cb('0x23')](respondWithResult(_0x38fc12,null))['catch'](handleError(_0x38fc12,null));};exports[_0x19cb('0x4f')]=function(_0xdb12a0,_0x3e9a78,_0x1974d7){var _0x1b4a74={};var _0x4f1fa5={};var _0x213781;var _0x3dcc69;return db[_0x19cb('0x2a')][_0x19cb('0x4b')]({'where':{'id':_0xdb12a0['params']['id']}})[_0x19cb('0x23')](handleEntityNotFound(_0x3e9a78,null))[_0x19cb('0x23')](function(_0x28c562){if(_0x28c562){_0x213781=_0x28c562;_0x4f1fa5[_0x19cb('0x2e')]=_['keys'](db[_0x19cb('0x4c')]['rawAttributes']);_0x4f1fa5[_0x19cb('0x30')]=_[_0x19cb('0x31')](_0xdb12a0[_0x19cb('0x30')]);_0x4f1fa5[_0x19cb('0x32')]=_[_0x19cb('0x33')](_0x4f1fa5['model'],_0x4f1fa5[_0x19cb('0x30')]);_0x1b4a74[_0x19cb('0x34')]=_[_0x19cb('0x33')](_0x4f1fa5[_0x19cb('0x2e')],qs[_0x19cb('0x35')](_0xdb12a0[_0x19cb('0x30')][_0x19cb('0x35')]));_0x1b4a74[_0x19cb('0x34')]=_0x1b4a74['attributes']['length']?_0x1b4a74[_0x19cb('0x34')]:_0x4f1fa5[_0x19cb('0x2e')];_0x1b4a74[_0x19cb('0x4d')]=qs['sort'](_0xdb12a0[_0x19cb('0x30')]['sort']);_0x1b4a74[_0x19cb('0x3c')]=qs[_0x19cb('0x32')](_[_0x19cb('0x3a')](_0xdb12a0['query'],_0x4f1fa5['filters']));if(_0xdb12a0[_0x19cb('0x30')][_0x19cb('0x3b')]){_0x1b4a74[_0x19cb('0x3c')]=_['merge'](_0x1b4a74[_0x19cb('0x3c')],{'$or':_[_0x19cb('0x2f')](_0x1b4a74[_0x19cb('0x34')],function(_0x3b982c){var _0x2b433c={};_0x2b433c[_0x3b982c]={'$like':'%'+_0xdb12a0[_0x19cb('0x30')][_0x19cb('0x3b')]+'%'};return _0x2b433c;})});}_0x1b4a74=_['merge']({},_0x1b4a74,_0xdb12a0[_0x19cb('0x3e')]);return _0x213781['getDescriptions'](_0x1b4a74);}})[_0x19cb('0x23')](function(_0x561eeb){if(_0x561eeb){_0x3dcc69=_0x561eeb[_0x19cb('0x36')];if(!_0xdb12a0['query'][_0x19cb('0x37')]('nolimit')){_0x1b4a74[_0x19cb('0x18')]=qs[_0x19cb('0x18')](_0xdb12a0['query'][_0x19cb('0x18')]);_0x1b4a74[_0x19cb('0x1a')]=qs['offset'](_0xdb12a0[_0x19cb('0x30')][_0x19cb('0x1a')]);}return _0x213781[_0x19cb('0x4f')](_0x1b4a74);}})[_0x19cb('0x23')](function(_0x1a4b57){if(_0x1a4b57){return _0x1a4b57?{'count':_0x3dcc69,'rows':_0x1a4b57}:null;}})[_0x19cb('0x23')](respondWithResult(_0x3e9a78,null))[_0x19cb('0x43')](handleError(_0x3e9a78,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index c63be08..8b2d807 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 _0x4ba3=['./intSugarcrmConfiguration.attributes','exports','define','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x5ec6a6,_0x515274){var _0x551e77=function(_0xd246de){while(--_0xd246de){_0x5ec6a6['push'](_0x5ec6a6['shift']());}};_0x551e77(++_0x515274);}(_0x4ba3,0x100));var _0x34ba=function(_0x53c93a,_0x27c349){_0x53c93a=_0x53c93a-0x0;var _0x2ff35e=_0x4ba3[_0x53c93a];return _0x2ff35e;};'use strict';var _=require('lodash');var util=require(_0x34ba('0x0'));var logger=require(_0x34ba('0x1'))(_0x34ba('0x2'));var moment=require(_0x34ba('0x3'));var BPromise=require('bluebird');var rp=require(_0x34ba('0x4'));var fs=require('fs');var path=require(_0x34ba('0x5'));var rimraf=require(_0x34ba('0x6'));var config=require(_0x34ba('0x7'));var attributes=require(_0x34ba('0x8'));module[_0x34ba('0x9')]=function(_0x3a0368,_0x2430d2){return _0x3a0368[_0x34ba('0xa')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd8d=['lodash','util','../../config/logger','api','moment','request-promise','path','./intSugarcrmConfiguration.attributes','define'];(function(_0x52098c,_0x2166fb){var _0x4f5b1f=function(_0x314fa3){while(--_0x314fa3){_0x52098c['push'](_0x52098c['shift']());}};_0x4f5b1f(++_0x2166fb);}(_0xcd8d,0x120));var _0xdcd8=function(_0x4687df,_0x12099c){_0x4687df=_0x4687df-0x0;var _0x32eaef=_0xcd8d[_0x4687df];return _0x32eaef;};'use strict';var _=require(_0xdcd8('0x0'));var util=require(_0xdcd8('0x1'));var logger=require(_0xdcd8('0x2'))(_0xdcd8('0x3'));var moment=require(_0xdcd8('0x4'));var BPromise=require('bluebird');var rp=require(_0xdcd8('0x5'));var fs=require('fs');var path=require(_0xdcd8('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xdcd8('0x7'));module['exports']=function(_0x972698,_0x40e396){return _0x972698[_0xdcd8('0x8')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 179e265..be902fa 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 _0x0fe2=['rpc','../../config/environment','client','http','request','then','info','request\x20sent','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xb87d55,_0x578ce1){var _0x1c31c8=function(_0x2c0c64){while(--_0x2c0c64){_0xb87d55['push'](_0xb87d55['shift']());}};_0x1c31c8(++_0x578ce1);}(_0x0fe2,0x130));var _0x20fe=function(_0x54b9ca,_0x3c2c66){_0x54b9ca=_0x54b9ca-0x0;var _0x41d977=_0x0fe2[_0x54b9ca];return _0x41d977;};'use strict';var _=require(_0x20fe('0x0'));var util=require(_0x20fe('0x1'));var moment=require(_0x20fe('0x2'));var BPromise=require(_0x20fe('0x3'));var rs=require(_0x20fe('0x4'));var fs=require('fs');var Redis=require(_0x20fe('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x20fe('0x6'));var logger=require(_0x20fe('0x7'))(_0x20fe('0x8'));var config=require(_0x20fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x20fe('0xa')][_0x20fe('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x38bb2d,_0x33c91f,_0x3f7d9d){return new BPromise(function(_0x1a8c04,_0x11b8ae){return client[_0x20fe('0xc')](_0x38bb2d,_0x3f7d9d)[_0x20fe('0xd')](function(_0x581977){logger[_0x20fe('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x33c91f,_0x20fe('0xf'));logger['debug'](_0x20fe('0x10'),_0x33c91f,'request\x20sent',JSON[_0x20fe('0x11')](_0x581977));if(_0x581977[_0x20fe('0x12')]){if(_0x581977[_0x20fe('0x12')][_0x20fe('0x13')]===0x1f4){logger[_0x20fe('0x12')](_0x20fe('0x14'),_0x33c91f,_0x581977[_0x20fe('0x12')][_0x20fe('0x15')]);return _0x11b8ae(_0x581977[_0x20fe('0x12')]['message']);}logger[_0x20fe('0x12')](_0x20fe('0x14'),_0x33c91f,_0x581977[_0x20fe('0x12')][_0x20fe('0x15')]);return _0x1a8c04(_0x581977['error'][_0x20fe('0x15')]);}else{logger[_0x20fe('0xe')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x33c91f,_0x20fe('0xf'));_0x1a8c04(_0x581977[_0x20fe('0x16')]['message']);}})[_0x20fe('0x17')](function(_0x34ebd8){logger[_0x20fe('0x12')](_0x20fe('0x14'),_0x33c91f,_0x34ebd8);_0x11b8ae(_0x34ebd8);});});} \ No newline at end of file +var _0xfed9=['../../config/utils','../../config/environment','client','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xfed9,0x152));var _0x9fed=function(_0xb6a965,_0x5c5ace){_0xb6a965=_0xb6a965-0x0;var _0x51d37d=_0xfed9[_0xb6a965];return _0x51d37d;};'use strict';var _=require(_0x9fed('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9fed('0x1'));var fs=require('fs');var Redis=require(_0x9fed('0x2'));var db=require(_0x9fed('0x3'))['db'];var utils=require(_0x9fed('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9fed('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x9fed('0x6')][_0x9fed('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x128678,_0x216997,_0x2f53b8){return new BPromise(function(_0x262a1a,_0x863051){return client['request'](_0x128678,_0x2f53b8)[_0x9fed('0x8')](function(_0x2c12bb){logger[_0x9fed('0x9')](_0x9fed('0xa'),_0x216997,_0x9fed('0xb'));logger[_0x9fed('0xc')](_0x9fed('0xd'),_0x216997,_0x9fed('0xb'),JSON['stringify'](_0x2c12bb));if(_0x2c12bb[_0x9fed('0xe')]){if(_0x2c12bb[_0x9fed('0xe')][_0x9fed('0xf')]===0x1f4){logger['error'](_0x9fed('0xa'),_0x216997,_0x2c12bb[_0x9fed('0xe')][_0x9fed('0x10')]);return _0x863051(_0x2c12bb['error']['message']);}logger['error'](_0x9fed('0xa'),_0x216997,_0x2c12bb[_0x9fed('0xe')][_0x9fed('0x10')]);return _0x262a1a(_0x2c12bb['error'][_0x9fed('0x10')]);}else{logger['info'](_0x9fed('0xa'),_0x216997,'request\x20sent');_0x262a1a(_0x2c12bb[_0x9fed('0x11')][_0x9fed('0x10')]);}})[_0x9fed('0x12')](function(_0x5c9e44){logger[_0x9fed('0xe')](_0x9fed('0xa'),_0x216997,_0x5c9e44);_0x863051(_0x5c9e44);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 2f4d71e..e6d0f9b 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 _0x7d73=['get','isAuthenticated','/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x25465d,_0x182798){var _0x4f29d1=function(_0x1ca53d){while(--_0x1ca53d){_0x25465d['push'](_0x25465d['shift']());}};_0x4f29d1(++_0x182798);}(_0x7d73,0x79));var _0x37d7=function(_0x1f7201,_0x141b79){_0x1f7201=_0x1f7201-0x0;var _0x289fd2=_0x7d73[_0x1f7201];return _0x289fd2;};'use strict';var multer=require(_0x37d7('0x0'));var util=require('util');var path=require(_0x37d7('0x1'));var timeout=require(_0x37d7('0x2'));var express=require(_0x37d7('0x3'));var router=express[_0x37d7('0x4')]();var fs_extra=require(_0x37d7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x37d7('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmField.controller');router[_0x37d7('0x7')]('/',auth[_0x37d7('0x8')](),controller['index']);router[_0x37d7('0x7')](_0x37d7('0x9'),auth[_0x37d7('0x8')](),controller[_0x37d7('0xa')]);router[_0x37d7('0xb')]('/',auth[_0x37d7('0x8')](),controller[_0x37d7('0xc')]);router['put'](_0x37d7('0x9'),auth[_0x37d7('0x8')](),controller[_0x37d7('0xd')]);router['delete'](_0x37d7('0x9'),auth['isAuthenticated'](),controller[_0x37d7('0xe')]);module[_0x37d7('0xf')]=router; \ No newline at end of file +var _0x8f4e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','index','get','show','/:id','isAuthenticated','update','delete','destroy','exports','multer'];(function(_0x19bec2,_0xce0495){var _0x345c0c=function(_0x2a643a){while(--_0x2a643a){_0x19bec2['push'](_0x19bec2['shift']());}};_0x345c0c(++_0xce0495);}(_0x8f4e,0xfe));var _0xe8f4=function(_0x4d4c36,_0x1e2d05){_0x4d4c36=_0x4d4c36-0x0;var _0x47360e=_0x8f4e[_0x4d4c36];return _0x47360e;};'use strict';var multer=require(_0xe8f4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe8f4('0x1'));var express=require(_0xe8f4('0x2'));var router=express[_0xe8f4('0x3')]();var fs_extra=require(_0xe8f4('0x4'));var auth=require(_0xe8f4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe8f4('0x6'));var controller=require(_0xe8f4('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8f4('0x8')]);router[_0xe8f4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe8f4('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xe8f4('0xb'),auth[_0xe8f4('0xc')](),controller[_0xe8f4('0xd')]);router[_0xe8f4('0xe')](_0xe8f4('0xb'),auth['isAuthenticated'](),controller[_0xe8f4('0xf')]);module[_0xe8f4('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index e1b714e..9c03933 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 _0xffe0=['ENUM','string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports'];(function(_0x1f50a4,_0x466e4e){var _0x35ccfb=function(_0x1b94ec){while(--_0x1b94ec){_0x1f50a4['push'](_0x1f50a4['shift']());}};_0x35ccfb(++_0x466e4e);}(_0xffe0,0x7d));var _0x0ffe=function(_0x32c1b5,_0x1dc130){_0x32c1b5=_0x32c1b5-0x0;var _0x3cbeff=_0xffe0[_0x32c1b5];return _0x3cbeff;};'use strict';var Sequelize=require('sequelize');module[_0x0ffe('0x0')]={'type':{'type':Sequelize[_0x0ffe('0x1')](_0x0ffe('0x2'),_0x0ffe('0x3'),_0x0ffe('0x4'),_0x0ffe('0x5'),_0x0ffe('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0ffe('0x7')]},'key':{'type':Sequelize[_0x0ffe('0x7')]},'keyType':{'type':Sequelize[_0x0ffe('0x1')]('string',_0x0ffe('0x3'),_0x0ffe('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x0ffe('0x7')]},'customField':{'type':Sequelize[_0x0ffe('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0ffe('0x7')]}}; \ No newline at end of file +var _0x7897=['STRING','BOOLEAN','sequelize','string','variable','customVariable'];(function(_0x309d93,_0x157662){var _0x2dd61d=function(_0x25ff34){while(--_0x25ff34){_0x309d93['push'](_0x309d93['shift']());}};_0x2dd61d(++_0x157662);}(_0x7897,0xe0));var _0x7789=function(_0x379421,_0x20357d){_0x379421=_0x379421-0x0;var _0x2170c6=_0x7897[_0x379421];return _0x2170c6;};'use strict';var Sequelize=require(_0x7789('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x7789('0x1'),_0x7789('0x2'),_0x7789('0x3'),'keyValue','picklist'),'defaultValue':_0x7789('0x1')},'content':{'type':Sequelize[_0x7789('0x4')]},'key':{'type':Sequelize[_0x7789('0x4')]},'keyType':{'type':Sequelize['ENUM']('string',_0x7789('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x7789('0x4')]},'idField':{'type':Sequelize[_0x7789('0x4')]},'nameField':{'type':Sequelize[_0x7789('0x4')]},'customField':{'type':Sequelize[_0x7789('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 3d4215f..2dca64c 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 _0x6e35=['../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','filter','where','type','VIRTUAL','merge','includeAll','include','SugarcrmField','findAll','rows','catch','params','fields','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x508685,_0x9f94af){var _0x976a76=function(_0x1bcb05){while(--_0x1bcb05){_0x508685['push'](_0x508685['shift']());}};_0x976a76(++_0x9f94af);}(_0x6e35,0x114));var _0x56e3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x6e35[_0x4b055c];return _0x4b62bb;};'use strict';var emlformat=require(_0x56e3('0x0'));var rimraf=require(_0x56e3('0x1'));var zipdir=require(_0x56e3('0x2'));var jsonpatch=require(_0x56e3('0x3'));var rp=require(_0x56e3('0x4'));var moment=require(_0x56e3('0x5'));var BPromise=require(_0x56e3('0x6'));var Mustache=require(_0x56e3('0x7'));var util=require(_0x56e3('0x8'));var path=require(_0x56e3('0x9'));var sox=require('sox');var csv=require(_0x56e3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x56e3('0xb'));var squel=require(_0x56e3('0xc'));var crypto=require(_0x56e3('0xd'));var jsforce=require(_0x56e3('0xe'));var deskjs=require(_0x56e3('0xf'));var toCsv=require(_0x56e3('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x56e3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x56e3('0x11'));var as=require(_0x56e3('0x12'));var hardwareService=require(_0x56e3('0x13'));var logger=require(_0x56e3('0x14'))(_0x56e3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x56e3('0x16'));var db=require(_0x56e3('0x17'))['db'];function respondWithStatusCode(_0x10c2b2,_0x58be23){_0x58be23=_0x58be23||0xcc;return function(_0x16c8b1){if(_0x16c8b1){return _0x10c2b2[_0x56e3('0x18')](_0x58be23);}return _0x10c2b2[_0x56e3('0x19')](_0x58be23)[_0x56e3('0x1a')]();};}function respondWithResult(_0x287f8d,_0x5ef392){_0x5ef392=_0x5ef392||0xc8;return function(_0x59bd5d){if(_0x59bd5d){return _0x287f8d[_0x56e3('0x19')](_0x5ef392)[_0x56e3('0x1b')](_0x59bd5d);}};}function respondWithFilteredResult(_0x3eaaee,_0x3ddbf3){return function(_0x4270b7){if(_0x4270b7){var _0x178e07=typeof _0x3ddbf3[_0x56e3('0x1c')]===_0x56e3('0x1d')&&typeof _0x3ddbf3[_0x56e3('0x1e')]===_0x56e3('0x1d');var _0x17bf74=_0x4270b7[_0x56e3('0x1f')];var _0x283d7d=_0x178e07?0x0:_0x3ddbf3[_0x56e3('0x1c')];var _0x4f4e75=_0x178e07?_0x4270b7[_0x56e3('0x1f')]:_0x3ddbf3[_0x56e3('0x1c')]+_0x3ddbf3[_0x56e3('0x1e')];var _0x3de00f;if(_0x4f4e75>=_0x17bf74){_0x4f4e75=_0x17bf74;_0x3de00f=0xc8;}else{_0x3de00f=0xce;}_0x3eaaee[_0x56e3('0x19')](_0x3de00f);return _0x3eaaee[_0x56e3('0x20')](_0x56e3('0x21'),_0x283d7d+'-'+_0x4f4e75+'/'+_0x17bf74)['json'](_0x4270b7);}return null;};}function patchUpdates(_0x543e4a){return function(_0x263da8){try{jsonpatch[_0x56e3('0x22')](_0x263da8,_0x543e4a,!![]);}catch(_0x1344a8){return BPromise[_0x56e3('0x23')](_0x1344a8);}return _0x263da8[_0x56e3('0x24')]();};}function saveUpdates(_0x4cac3a,_0x1d7d15){return function(_0x3df950){if(_0x3df950){return _0x3df950[_0x56e3('0x25')](_0x4cac3a)['then'](function(_0x3b290a){return _0x3b290a;});}return null;};}function removeEntity(_0x2fb272,_0x380c2b){return function(_0x39ff47){if(_0x39ff47){return _0x39ff47['destroy']()[_0x56e3('0x26')](function(){_0x2fb272[_0x56e3('0x19')](0xcc)[_0x56e3('0x1a')]();});}};}function handleEntityNotFound(_0x36bc32,_0x144399){return function(_0xade1c3){if(!_0xade1c3){_0x36bc32[_0x56e3('0x18')](0x194);}return _0xade1c3;};}function handleError(_0x4190e8,_0xde4610){_0xde4610=_0xde4610||0x1f4;return function(_0x586f54){logger['error'](_0x586f54[_0x56e3('0x27')]);if(_0x586f54['name']){delete _0x586f54[_0x56e3('0x28')];}_0x4190e8[_0x56e3('0x19')](_0xde4610)[_0x56e3('0x29')](_0x586f54);};}exports[_0x56e3('0x2a')]=function(_0x278c55,_0x2048a2){var _0x42178e={},_0x20ae92={},_0x4564be={'count':0x0,'rows':[]};var _0x10f385=_[_0x56e3('0x2b')](db['SugarcrmField'][_0x56e3('0x2c')],function(_0x2514ef){return{'name':_0x2514ef['fieldName'],'type':_0x2514ef['type'][_0x56e3('0x2d')]};});_0x20ae92[_0x56e3('0x2e')]=_[_0x56e3('0x2b')](_0x10f385,_0x56e3('0x28'));_0x20ae92[_0x56e3('0x2f')]=_[_0x56e3('0x30')](_0x278c55[_0x56e3('0x2f')]);_0x20ae92[_0x56e3('0x31')]=_[_0x56e3('0x32')](_0x20ae92[_0x56e3('0x2e')],_0x20ae92[_0x56e3('0x2f')]);_0x42178e[_0x56e3('0x33')]=_[_0x56e3('0x32')](_0x20ae92[_0x56e3('0x2e')],qs['fields'](_0x278c55[_0x56e3('0x2f')]['fields']));_0x42178e['attributes']=_0x42178e[_0x56e3('0x33')][_0x56e3('0x34')]?_0x42178e[_0x56e3('0x33')]:_0x20ae92[_0x56e3('0x2e')];if(!_0x278c55['query']['hasOwnProperty'](_0x56e3('0x35'))){_0x42178e['limit']=qs[_0x56e3('0x1e')](_0x278c55[_0x56e3('0x2f')][_0x56e3('0x1e')]);_0x42178e[_0x56e3('0x1c')]=qs['offset'](_0x278c55[_0x56e3('0x2f')]['offset']);}_0x42178e[_0x56e3('0x36')]=qs[_0x56e3('0x37')](_0x278c55[_0x56e3('0x2f')][_0x56e3('0x37')]);_0x42178e['where']=qs[_0x56e3('0x31')](_['pick'](_0x278c55[_0x56e3('0x2f')],_0x20ae92[_0x56e3('0x31')]),_0x10f385);if(_0x278c55[_0x56e3('0x2f')][_0x56e3('0x38')]){_0x42178e['where']=_['merge'](_0x42178e[_0x56e3('0x39')],{'$or':_['map'](_0x10f385,function(_0x25881c){if(_0x25881c[_0x56e3('0x3a')]!==_0x56e3('0x3b')){var _0x57dd1b={};_0x57dd1b[_0x25881c['name']]={'$like':'%'+_0x278c55[_0x56e3('0x2f')][_0x56e3('0x38')]+'%'};return _0x57dd1b;}})});}_0x42178e=_[_0x56e3('0x3c')]({},_0x42178e,_0x278c55['options']);var _0x2a4d18={'where':_0x42178e[_0x56e3('0x39')]};return db['SugarcrmField'][_0x56e3('0x1f')](_0x2a4d18)[_0x56e3('0x26')](function(_0x4d76cb){_0x4564be[_0x56e3('0x1f')]=_0x4d76cb;if(_0x278c55['query'][_0x56e3('0x3d')]){_0x42178e[_0x56e3('0x3e')]=[{'all':!![]}];}return db[_0x56e3('0x3f')][_0x56e3('0x40')](_0x42178e);})['then'](function(_0x19de0a){_0x4564be[_0x56e3('0x41')]=_0x19de0a;return _0x4564be;})['then'](respondWithFilteredResult(_0x2048a2,_0x42178e))[_0x56e3('0x42')](handleError(_0x2048a2,null));};exports['show']=function(_0x3215bb,_0x5defd1){var _0x44b071={'raw':!![],'where':{'id':_0x3215bb[_0x56e3('0x43')]['id']}},_0x187712={};_0x187712['model']=_[_0x56e3('0x30')](db[_0x56e3('0x3f')][_0x56e3('0x2c')]);_0x187712[_0x56e3('0x2f')]=_['keys'](_0x3215bb[_0x56e3('0x2f')]);_0x187712['filters']=_[_0x56e3('0x32')](_0x187712[_0x56e3('0x2e')],_0x187712['query']);_0x44b071[_0x56e3('0x33')]=_[_0x56e3('0x32')](_0x187712['model'],qs[_0x56e3('0x44')](_0x3215bb[_0x56e3('0x2f')]['fields']));_0x44b071[_0x56e3('0x33')]=_0x44b071[_0x56e3('0x33')][_0x56e3('0x34')]?_0x44b071[_0x56e3('0x33')]:_0x187712[_0x56e3('0x2e')];if(_0x3215bb['query'][_0x56e3('0x3d')]){_0x44b071[_0x56e3('0x3e')]=[{'all':!![]}];}_0x44b071=_['merge']({},_0x44b071,_0x3215bb[_0x56e3('0x45')]);return db[_0x56e3('0x3f')][_0x56e3('0x46')](_0x44b071)['then'](handleEntityNotFound(_0x5defd1,null))[_0x56e3('0x26')](respondWithResult(_0x5defd1,null))[_0x56e3('0x42')](handleError(_0x5defd1,null));};exports[_0x56e3('0x47')]=function(_0x3a9b94,_0x371dc1){return db[_0x56e3('0x3f')][_0x56e3('0x47')](_0x3a9b94[_0x56e3('0x48')],{})[_0x56e3('0x26')](respondWithResult(_0x371dc1,0xc9))[_0x56e3('0x42')](handleError(_0x371dc1,null));};exports['update']=function(_0x541775,_0x4bdd98){if(_0x541775[_0x56e3('0x48')]['id']){delete _0x541775[_0x56e3('0x48')]['id'];}return db['SugarcrmField']['find']({'where':{'id':_0x541775[_0x56e3('0x43')]['id']}})[_0x56e3('0x26')](handleEntityNotFound(_0x4bdd98,null))['then'](saveUpdates(_0x541775[_0x56e3('0x48')],null))[_0x56e3('0x26')](respondWithResult(_0x4bdd98,null))['catch'](handleError(_0x4bdd98,null));};exports[_0x56e3('0x49')]=function(_0x45fecc,_0x3d19a0){return db[_0x56e3('0x3f')][_0x56e3('0x46')]({'where':{'id':_0x45fecc['params']['id']}})[_0x56e3('0x26')](handleEntityNotFound(_0x3d19a0,null))['then'](removeEntity(_0x3d19a0,null))[_0x56e3('0x42')](handleError(_0x3d19a0,null));}; \ No newline at end of file +var _0x9c4f=['key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type'];(function(_0x42c44a,_0x2e0ce7){var _0x322517=function(_0x5b874c){while(--_0x5b874c){_0x42c44a['push'](_0x42c44a['shift']());}};_0x322517(++_0x2e0ce7);}(_0x9c4f,0x6d));var _0xf9c4=function(_0x5e6310,_0x136d16){_0x5e6310=_0x5e6310-0x0;var _0x4900f9=_0x9c4f[_0x5e6310];return _0x4900f9;};'use strict';var emlformat=require(_0xf9c4('0x0'));var rimraf=require(_0xf9c4('0x1'));var zipdir=require(_0xf9c4('0x2'));var jsonpatch=require(_0xf9c4('0x3'));var rp=require(_0xf9c4('0x4'));var moment=require(_0xf9c4('0x5'));var BPromise=require(_0xf9c4('0x6'));var Mustache=require(_0xf9c4('0x7'));var util=require(_0xf9c4('0x8'));var path=require('path');var sox=require(_0xf9c4('0x9'));var csv=require(_0xf9c4('0xa'));var ejs=require(_0xf9c4('0xb'));var fs=require('fs');var fs_extra=require(_0xf9c4('0xc'));var _=require(_0xf9c4('0xd'));var squel=require(_0xf9c4('0xe'));var crypto=require(_0xf9c4('0xf'));var jsforce=require(_0xf9c4('0x10'));var deskjs=require(_0xf9c4('0x11'));var toCsv=require(_0xf9c4('0xa'));var querystring=require(_0xf9c4('0x12'));var Papa=require('papaparse');var Redis=require(_0xf9c4('0x13'));var authService=require(_0xf9c4('0x14'));var qs=require(_0xf9c4('0x15'));var as=require(_0xf9c4('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9c4('0x17'))(_0xf9c4('0x18'));var utils=require('../../config/utils');var config=require(_0xf9c4('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xf9c4('0x1a'))['db'];function respondWithStatusCode(_0x2c2057,_0x33e28d){_0x33e28d=_0x33e28d||0xcc;return function(_0x4389c1){if(_0x4389c1){return _0x2c2057['sendStatus'](_0x33e28d);}return _0x2c2057[_0xf9c4('0x1b')](_0x33e28d)['end']();};}function respondWithResult(_0x55655d,_0x280475){_0x280475=_0x280475||0xc8;return function(_0x55c36c){if(_0x55c36c){return _0x55655d[_0xf9c4('0x1b')](_0x280475)[_0xf9c4('0x1c')](_0x55c36c);}};}function respondWithFilteredResult(_0x25b4e4,_0x24a0f5){return function(_0x2ffc3c){if(_0x2ffc3c){var _0x30a2ac=typeof _0x24a0f5[_0xf9c4('0x1d')]===_0xf9c4('0x1e')&&typeof _0x24a0f5[_0xf9c4('0x1f')]===_0xf9c4('0x1e');var _0x4b7cc4=_0x2ffc3c[_0xf9c4('0x20')];var _0x5b6265=_0x30a2ac?0x0:_0x24a0f5[_0xf9c4('0x1d')];var _0x5de035=_0x30a2ac?_0x2ffc3c[_0xf9c4('0x20')]:_0x24a0f5[_0xf9c4('0x1d')]+_0x24a0f5[_0xf9c4('0x1f')];var _0x5785b3;if(_0x5de035>=_0x4b7cc4){_0x5de035=_0x4b7cc4;_0x5785b3=0xc8;}else{_0x5785b3=0xce;}_0x25b4e4['status'](_0x5785b3);return _0x25b4e4[_0xf9c4('0x21')](_0xf9c4('0x22'),_0x5b6265+'-'+_0x5de035+'/'+_0x4b7cc4)[_0xf9c4('0x1c')](_0x2ffc3c);}return null;};}function patchUpdates(_0x17471c){return function(_0x45d8f0){try{jsonpatch[_0xf9c4('0x23')](_0x45d8f0,_0x17471c,!![]);}catch(_0x14f832){return BPromise[_0xf9c4('0x24')](_0x14f832);}return _0x45d8f0[_0xf9c4('0x25')]();};}function saveUpdates(_0x2f5eba,_0x5ae88d){return function(_0x31dd37){if(_0x31dd37){return _0x31dd37[_0xf9c4('0x26')](_0x2f5eba)[_0xf9c4('0x27')](function(_0xa77d28){return _0xa77d28;});}return null;};}function removeEntity(_0x5a7aef,_0x3c3be7){return function(_0x102248){if(_0x102248){return _0x102248[_0xf9c4('0x28')]()[_0xf9c4('0x27')](function(){_0x5a7aef[_0xf9c4('0x1b')](0xcc)[_0xf9c4('0x29')]();});}};}function handleEntityNotFound(_0x1887a0,_0x1591b4){return function(_0x16a5f5){if(!_0x16a5f5){_0x1887a0['sendStatus'](0x194);}return _0x16a5f5;};}function handleError(_0x28fd2f,_0x194776){_0x194776=_0x194776||0x1f4;return function(_0x3f2180){logger[_0xf9c4('0x2a')](_0x3f2180[_0xf9c4('0x2b')]);if(_0x3f2180[_0xf9c4('0x2c')]){delete _0x3f2180['name'];}_0x28fd2f[_0xf9c4('0x1b')](_0x194776)[_0xf9c4('0x2d')](_0x3f2180);};}exports[_0xf9c4('0x2e')]=function(_0x37d2d3,_0x17b96a){var _0x19a7d9={},_0x6bb745={},_0x260572={'count':0x0,'rows':[]};var _0x42667b=_['map'](db[_0xf9c4('0x2f')][_0xf9c4('0x30')],function(_0x2948e3){return{'name':_0x2948e3[_0xf9c4('0x31')],'type':_0x2948e3[_0xf9c4('0x32')][_0xf9c4('0x33')]};});_0x6bb745[_0xf9c4('0x34')]=_[_0xf9c4('0x35')](_0x42667b,_0xf9c4('0x2c'));_0x6bb745[_0xf9c4('0x36')]=_['keys'](_0x37d2d3[_0xf9c4('0x36')]);_0x6bb745['filters']=_['intersection'](_0x6bb745[_0xf9c4('0x34')],_0x6bb745['query']);_0x19a7d9[_0xf9c4('0x37')]=_[_0xf9c4('0x38')](_0x6bb745['model'],qs[_0xf9c4('0x39')](_0x37d2d3[_0xf9c4('0x36')][_0xf9c4('0x39')]));_0x19a7d9['attributes']=_0x19a7d9[_0xf9c4('0x37')][_0xf9c4('0x3a')]?_0x19a7d9[_0xf9c4('0x37')]:_0x6bb745[_0xf9c4('0x34')];if(!_0x37d2d3['query'][_0xf9c4('0x3b')](_0xf9c4('0x3c'))){_0x19a7d9[_0xf9c4('0x1f')]=qs[_0xf9c4('0x1f')](_0x37d2d3[_0xf9c4('0x36')][_0xf9c4('0x1f')]);_0x19a7d9[_0xf9c4('0x1d')]=qs[_0xf9c4('0x1d')](_0x37d2d3[_0xf9c4('0x36')]['offset']);}_0x19a7d9[_0xf9c4('0x3d')]=qs[_0xf9c4('0x3e')](_0x37d2d3[_0xf9c4('0x36')][_0xf9c4('0x3e')]);_0x19a7d9[_0xf9c4('0x3f')]=qs[_0xf9c4('0x40')](_['pick'](_0x37d2d3['query'],_0x6bb745[_0xf9c4('0x40')]),_0x42667b);if(_0x37d2d3[_0xf9c4('0x36')]['filter']){_0x19a7d9[_0xf9c4('0x3f')]=_[_0xf9c4('0x41')](_0x19a7d9[_0xf9c4('0x3f')],{'$or':_[_0xf9c4('0x35')](_0x42667b,function(_0x6cf215){if(_0x6cf215[_0xf9c4('0x32')]!==_0xf9c4('0x42')){var _0x759fd2={};_0x759fd2[_0x6cf215[_0xf9c4('0x2c')]]={'$like':'%'+_0x37d2d3[_0xf9c4('0x36')][_0xf9c4('0x43')]+'%'};return _0x759fd2;}})});}_0x19a7d9=_[_0xf9c4('0x41')]({},_0x19a7d9,_0x37d2d3[_0xf9c4('0x44')]);var _0x455935={'where':_0x19a7d9[_0xf9c4('0x3f')]};return db[_0xf9c4('0x2f')][_0xf9c4('0x20')](_0x455935)[_0xf9c4('0x27')](function(_0x335773){_0x260572[_0xf9c4('0x20')]=_0x335773;if(_0x37d2d3['query'][_0xf9c4('0x45')]){_0x19a7d9[_0xf9c4('0x46')]=[{'all':!![]}];}return db['SugarcrmField'][_0xf9c4('0x47')](_0x19a7d9);})[_0xf9c4('0x27')](function(_0xbf88d5){_0x260572[_0xf9c4('0x48')]=_0xbf88d5;return _0x260572;})[_0xf9c4('0x27')](respondWithFilteredResult(_0x17b96a,_0x19a7d9))[_0xf9c4('0x49')](handleError(_0x17b96a,null));};exports[_0xf9c4('0x4a')]=function(_0x22c3a1,_0x1c1970){var _0x114d4b={'raw':!![],'where':{'id':_0x22c3a1[_0xf9c4('0x4b')]['id']}},_0x1ac99a={};_0x1ac99a[_0xf9c4('0x34')]=_[_0xf9c4('0x4c')](db[_0xf9c4('0x2f')]['rawAttributes']);_0x1ac99a[_0xf9c4('0x36')]=_[_0xf9c4('0x4c')](_0x22c3a1['query']);_0x1ac99a[_0xf9c4('0x40')]=_['intersection'](_0x1ac99a['model'],_0x1ac99a[_0xf9c4('0x36')]);_0x114d4b[_0xf9c4('0x37')]=_[_0xf9c4('0x38')](_0x1ac99a[_0xf9c4('0x34')],qs[_0xf9c4('0x39')](_0x22c3a1['query'][_0xf9c4('0x39')]));_0x114d4b[_0xf9c4('0x37')]=_0x114d4b[_0xf9c4('0x37')]['length']?_0x114d4b[_0xf9c4('0x37')]:_0x1ac99a[_0xf9c4('0x34')];if(_0x22c3a1[_0xf9c4('0x36')]['includeAll']){_0x114d4b[_0xf9c4('0x46')]=[{'all':!![]}];}_0x114d4b=_[_0xf9c4('0x41')]({},_0x114d4b,_0x22c3a1[_0xf9c4('0x44')]);return db['SugarcrmField'][_0xf9c4('0x4d')](_0x114d4b)[_0xf9c4('0x27')](handleEntityNotFound(_0x1c1970,null))[_0xf9c4('0x27')](respondWithResult(_0x1c1970,null))[_0xf9c4('0x49')](handleError(_0x1c1970,null));};exports[_0xf9c4('0x4e')]=function(_0x3fd057,_0x3c8993){return db[_0xf9c4('0x2f')][_0xf9c4('0x4e')](_0x3fd057[_0xf9c4('0x4f')],{})[_0xf9c4('0x27')](respondWithResult(_0x3c8993,0xc9))[_0xf9c4('0x49')](handleError(_0x3c8993,null));};exports[_0xf9c4('0x26')]=function(_0x525926,_0xce4bbd){if(_0x525926[_0xf9c4('0x4f')]['id']){delete _0x525926['body']['id'];}return db[_0xf9c4('0x2f')]['find']({'where':{'id':_0x525926[_0xf9c4('0x4b')]['id']}})[_0xf9c4('0x27')](handleEntityNotFound(_0xce4bbd,null))[_0xf9c4('0x27')](saveUpdates(_0x525926[_0xf9c4('0x4f')],null))[_0xf9c4('0x27')](respondWithResult(_0xce4bbd,null))['catch'](handleError(_0xce4bbd,null));};exports[_0xf9c4('0x28')]=function(_0x39c848,_0x754cae){return db[_0xf9c4('0x2f')][_0xf9c4('0x4d')]({'where':{'id':_0x39c848[_0xf9c4('0x4b')]['id']}})[_0xf9c4('0x27')](handleEntityNotFound(_0x754cae,null))['then'](removeEntity(_0x754cae,null))[_0xf9c4('0x49')](handleError(_0x754cae,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5002fde..4d4b19b 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 _0xf324=['sugarcrm_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields'];(function(_0x320cb3,_0x49c0cf){var _0x899c86=function(_0x9fc8f){while(--_0x9fc8f){_0x320cb3['push'](_0x320cb3['shift']());}};_0x899c86(++_0x49c0cf);}(_0xf324,0x16a));var _0x4f32=function(_0x334648,_0x4afcf0){_0x334648=_0x334648-0x0;var _0x2c5a13=_0xf324[_0x334648];return _0x2c5a13;};'use strict';var _=require(_0x4f32('0x0'));var util=require(_0x4f32('0x1'));var logger=require(_0x4f32('0x2'))(_0x4f32('0x3'));var moment=require(_0x4f32('0x4'));var BPromise=require(_0x4f32('0x5'));var rp=require(_0x4f32('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4f32('0x7'));var attributes=require(_0x4f32('0x8'));module[_0x4f32('0x9')]=function(_0x11ca30,_0x135ae2){return _0x11ca30[_0x4f32('0xa')](_0x4f32('0xb'),attributes,{'tableName':_0x4f32('0xc'),'paranoid':![],'indexes':[{'name':_0x4f32('0xd'),'fields':['idField',_0x4f32('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0329=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField'];(function(_0x517409,_0x1d95fd){var _0x433839=function(_0x41799f){while(--_0x41799f){_0x517409['push'](_0x517409['shift']());}};_0x433839(++_0x1d95fd);}(_0x0329,0x119));var _0x9032=function(_0x12e6e5,_0x39855b){_0x12e6e5=_0x12e6e5-0x0;var _0x4ef6ce=_0x0329[_0x12e6e5];return _0x4ef6ce;};'use strict';var _=require(_0x9032('0x0'));var util=require('util');var logger=require(_0x9032('0x1'))(_0x9032('0x2'));var moment=require(_0x9032('0x3'));var BPromise=require(_0x9032('0x4'));var rp=require(_0x9032('0x5'));var fs=require('fs');var path=require(_0x9032('0x6'));var rimraf=require('rimraf');var config=require(_0x9032('0x7'));var attributes=require('./intSugarcrmField.attributes');module[_0x9032('0x8')]=function(_0x1e4f55,_0x23fc0e){return _0x1e4f55['define'](_0x9032('0x9'),attributes,{'tableName':_0x9032('0xa'),'paranoid':![],'indexes':[{'name':_0x9032('0xb'),'fields':[_0x9032('0xc'),_0x9032('0xd')],'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 63f84ad..ee4b3cb 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 _0x2137=['info','SugarcrmField,\x20%s,\x20%s','debug','request\x20sent','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then'];(function(_0x1a8599,_0x38ac79){var _0x59f406=function(_0x57e973){while(--_0x57e973){_0x1a8599['push'](_0x1a8599['shift']());}};_0x59f406(++_0x38ac79);}(_0x2137,0x8c));var _0x7213=function(_0x332be8,_0x45c577){_0x332be8=_0x332be8-0x0;var _0x2fc5fd=_0x2137[_0x332be8];return _0x2fc5fd;};'use strict';var _=require(_0x7213('0x0'));var util=require(_0x7213('0x1'));var moment=require('moment');var BPromise=require(_0x7213('0x2'));var rs=require(_0x7213('0x3'));var fs=require('fs');var Redis=require(_0x7213('0x4'));var db=require(_0x7213('0x5'))['db'];var utils=require(_0x7213('0x6'));var logger=require(_0x7213('0x7'))('rpc');var config=require(_0x7213('0x8'));var jayson=require(_0x7213('0x9'));var client=jayson[_0x7213('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfc42de,_0x1a3265,_0x21f9eb){return new BPromise(function(_0x1f6aae,_0x323de7){return client['request'](_0xfc42de,_0x21f9eb)[_0x7213('0xb')](function(_0x48bcca){logger[_0x7213('0xc')](_0x7213('0xd'),_0x1a3265,'request\x20sent');logger[_0x7213('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1a3265,_0x7213('0xf'),JSON['stringify'](_0x48bcca));if(_0x48bcca[_0x7213('0x10')]){if(_0x48bcca['error'][_0x7213('0x11')]===0x1f4){logger[_0x7213('0x10')](_0x7213('0xd'),_0x1a3265,_0x48bcca[_0x7213('0x10')][_0x7213('0x12')]);return _0x323de7(_0x48bcca[_0x7213('0x10')][_0x7213('0x12')]);}logger[_0x7213('0x10')](_0x7213('0xd'),_0x1a3265,_0x48bcca[_0x7213('0x10')]['message']);return _0x1f6aae(_0x48bcca['error'][_0x7213('0x12')]);}else{logger[_0x7213('0xc')]('SugarcrmField,\x20%s,\x20%s',_0x1a3265,'request\x20sent');_0x1f6aae(_0x48bcca['result'][_0x7213('0x12')]);}})['catch'](function(_0x8472b1){logger['error'](_0x7213('0xd'),_0x1a3265,_0x8472b1);_0x323de7(_0x8472b1);});});} \ No newline at end of file +var _0x31b1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x523899,_0x100efd){var _0x4788f6=function(_0x1b26f4){while(--_0x1b26f4){_0x523899['push'](_0x523899['shift']());}};_0x4788f6(++_0x100efd);}(_0x31b1,0x1c9));var _0x131b=function(_0x3b84a2,_0x4af976){_0x3b84a2=_0x3b84a2-0x0;var _0x26d753=_0x31b1[_0x3b84a2];return _0x26d753;};'use strict';var _=require('lodash');var util=require(_0x131b('0x0'));var moment=require(_0x131b('0x1'));var BPromise=require(_0x131b('0x2'));var rs=require(_0x131b('0x3'));var fs=require('fs');var Redis=require(_0x131b('0x4'));var db=require(_0x131b('0x5'))['db'];var utils=require(_0x131b('0x6'));var logger=require(_0x131b('0x7'))(_0x131b('0x8'));var config=require(_0x131b('0x9'));var jayson=require(_0x131b('0xa'));var client=jayson[_0x131b('0xb')][_0x131b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b0b6b,_0x1d73cb,_0x4a82bf){return new BPromise(function(_0x19fbaf,_0x326d45){return client[_0x131b('0xd')](_0x1b0b6b,_0x4a82bf)['then'](function(_0x4b023b){logger[_0x131b('0xe')](_0x131b('0xf'),_0x1d73cb,_0x131b('0x10'));logger['debug']('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x1d73cb,_0x131b('0x10'),JSON['stringify'](_0x4b023b));if(_0x4b023b[_0x131b('0x11')]){if(_0x4b023b[_0x131b('0x11')][_0x131b('0x12')]===0x1f4){logger[_0x131b('0x11')]('SugarcrmField,\x20%s,\x20%s',_0x1d73cb,_0x4b023b[_0x131b('0x11')][_0x131b('0x13')]);return _0x326d45(_0x4b023b['error']['message']);}logger[_0x131b('0x11')](_0x131b('0xf'),_0x1d73cb,_0x4b023b[_0x131b('0x11')]['message']);return _0x19fbaf(_0x4b023b[_0x131b('0x11')][_0x131b('0x13')]);}else{logger[_0x131b('0xe')](_0x131b('0xf'),_0x1d73cb,_0x131b('0x10'));_0x19fbaf(_0x4b023b[_0x131b('0x14')]['message']);}})[_0x131b('0x15')](function(_0x1ef635){logger['error'](_0x131b('0xf'),_0x1d73cb,_0x1ef635);_0x326d45(_0x1ef635);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 5a21163..6323277 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 _0x3423=['get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5242fa,_0x3efff5){var _0x1a1376=function(_0x41d6ea){while(--_0x41d6ea){_0x5242fa['push'](_0x5242fa['shift']());}};_0x1a1376(++_0x3efff5);}(_0x3423,0x1f0));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x3342('0x0'));var util=require(_0x3342('0x1'));var path=require('path');var timeout=require(_0x3342('0x2'));var express=require(_0x3342('0x3'));var router=express[_0x3342('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3342('0x5'));var interaction=require(_0x3342('0x6'));var config=require(_0x3342('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x3342('0x8')]('/',auth[_0x3342('0x9')](),controller[_0x3342('0xa')]);router[_0x3342('0x8')](_0x3342('0xb'),auth[_0x3342('0x9')](),controller[_0x3342('0xc')]);router[_0x3342('0x8')]('/:id/configurations',auth[_0x3342('0x9')](),controller[_0x3342('0xd')]);router['get']('/:id/fields',auth[_0x3342('0x9')](),controller[_0x3342('0xe')]);router[_0x3342('0xf')]('/',auth['isAuthenticated'](),controller[_0x3342('0x10')]);router['post'](_0x3342('0x11'),auth['isAuthenticated'](),controller['addConfiguration']);router['put'](_0x3342('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x3342('0x12')](_0x3342('0xb'),auth[_0x3342('0x9')](),controller[_0x3342('0x13')]);module[_0x3342('0x14')]=router; \ No newline at end of file +var _0xcacd=['post','addConfiguration','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intVtigerAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','create'];(function(_0x2c90f8,_0x4f998b){var _0x1e2bf2=function(_0x5f1dbf){while(--_0x5f1dbf){_0x2c90f8['push'](_0x2c90f8['shift']());}};_0x1e2bf2(++_0x4f998b);}(_0xcacd,0x1bf));var _0xdcac=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcacd[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xdcac('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdcac('0x1'));var router=express[_0xdcac('0x2')]();var fs_extra=require(_0xdcac('0x3'));var auth=require(_0xdcac('0x4'));var interaction=require(_0xdcac('0x5'));var config=require('../../config/environment');var controller=require(_0xdcac('0x6'));router[_0xdcac('0x7')]('/',auth[_0xdcac('0x8')](),controller['index']);router[_0xdcac('0x7')](_0xdcac('0x9'),auth[_0xdcac('0x8')](),controller['show']);router[_0xdcac('0x7')](_0xdcac('0xa'),auth['isAuthenticated'](),controller[_0xdcac('0xb')]);router[_0xdcac('0x7')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0xdcac('0x8')](),controller[_0xdcac('0xc')]);router[_0xdcac('0xd')](_0xdcac('0xa'),auth[_0xdcac('0x8')](),controller[_0xdcac('0xe')]);router[_0xdcac('0xf')](_0xdcac('0x9'),auth['isAuthenticated'](),controller[_0xdcac('0x10')]);router[_0xdcac('0x11')](_0xdcac('0x9'),auth['isAuthenticated'](),controller[_0xdcac('0x12')]);module[_0xdcac('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index da7e373..baa937c 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 _0x208f=['HelpDesk','sequelize','exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x208f,0x131));var _0xf208=function(_0x376ed4,_0x400e4b){_0x376ed4=_0x376ed4-0x0;var _0x3bd8fa=_0x208f[_0x376ed4];return _0x3bd8fa;};'use strict';var Sequelize=require(_0xf208('0x0'));module[_0xf208('0x1')]={'name':{'type':Sequelize[_0xf208('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xf208('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf208('0x3')},'remoteUri':{'type':Sequelize[_0xf208('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf208('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xf208('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xbef2=['exports','STRING'];(function(_0x496d8f,_0x3d877d){var _0x1dd7a5=function(_0x8bdc2e){while(--_0x8bdc2e){_0x496d8f['push'](_0x496d8f['shift']());}};_0x1dd7a5(++_0x3d877d);}(_0xbef2,0xd6));var _0x2bef=function(_0x49215b,_0x246058){_0x49215b=_0x49215b-0x0;var _0x1cb78e=_0xbef2[_0x49215b];return _0x1cb78e;};'use strict';var Sequelize=require('sequelize');module[_0x2bef('0x0')]={'name':{'type':Sequelize[_0x2bef('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2bef('0x1')]},'username':{'type':Sequelize[_0x2bef('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x2bef('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x2bef('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x2bef('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x2bef('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 6626387..96178ef 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 _0xc133=['vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','catch','params','merge','options','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','log'];(function(_0x598cd0,_0x157d6f){var _0x2370e7=function(_0x3216c2){while(--_0x3216c2){_0x598cd0['push'](_0x598cd0['shift']());}};_0x2370e7(++_0x157d6f);}(_0xc133,0xec));var _0x3c13=function(_0x5673c2,_0x2f2b94){_0x5673c2=_0x5673c2-0x0;var _0x4f8d85=_0xc133[_0x5673c2];return _0x4f8d85;};'use strict';var emlformat=require(_0x3c13('0x0'));var rimraf=require(_0x3c13('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3c13('0x2'));var moment=require('moment');var BPromise=require(_0x3c13('0x3'));var Mustache=require(_0x3c13('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x3c13('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3c13('0x6'));var _=require(_0x3c13('0x7'));var squel=require(_0x3c13('0x8'));var crypto=require(_0x3c13('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3c13('0xa'));var toCsv=require(_0x3c13('0x5'));var querystring=require(_0x3c13('0xb'));var Papa=require('papaparse');var Redis=require(_0x3c13('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3c13('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x3c13('0xe'));var config=require('../../config/environment');var licenseUtil=require(_0x3c13('0xf'));var db=require(_0x3c13('0x10'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x4c286c,_0x5c816e){_0x5c816e=_0x5c816e||0xcc;return function(_0x2ebb8d){if(_0x2ebb8d){return _0x4c286c['sendStatus'](_0x5c816e);}return _0x4c286c[_0x3c13('0x11')](_0x5c816e)[_0x3c13('0x12')]();};}function respondWithResult(_0xe37be8,_0x535173){_0x535173=_0x535173||0xc8;return function(_0x50350e){if(_0x50350e){return _0xe37be8[_0x3c13('0x11')](_0x535173)[_0x3c13('0x13')](_0x50350e);}};}function respondWithFilteredResult(_0x5069b3,_0xe74281){return function(_0x3ea428){if(_0x3ea428){var _0x1d7c16=typeof _0xe74281[_0x3c13('0x14')]===_0x3c13('0x15')&&typeof _0xe74281[_0x3c13('0x16')]===_0x3c13('0x15');var _0x360c46=_0x3ea428[_0x3c13('0x17')];var _0x7a1689=_0x1d7c16?0x0:_0xe74281['offset'];var _0x6f3992=_0x1d7c16?_0x3ea428[_0x3c13('0x17')]:_0xe74281[_0x3c13('0x14')]+_0xe74281[_0x3c13('0x16')];var _0x3565c8;if(_0x6f3992>=_0x360c46){_0x6f3992=_0x360c46;_0x3565c8=0xc8;}else{_0x3565c8=0xce;}_0x5069b3[_0x3c13('0x11')](_0x3565c8);return _0x5069b3[_0x3c13('0x18')](_0x3c13('0x19'),_0x7a1689+'-'+_0x6f3992+'/'+_0x360c46)[_0x3c13('0x13')](_0x3ea428);}return null;};}function patchUpdates(_0x176d38){return function(_0x473f80){try{jsonpatch[_0x3c13('0x1a')](_0x473f80,_0x176d38,!![]);}catch(_0x2a0652){return BPromise['reject'](_0x2a0652);}return _0x473f80[_0x3c13('0x1b')]();};}function saveUpdates(_0x1b5790,_0x29b411){return function(_0x278fd6){if(_0x278fd6){return _0x278fd6[_0x3c13('0x1c')](_0x1b5790)[_0x3c13('0x1d')](function(_0x1a8736){return _0x1a8736;});}return null;};}function removeEntity(_0x44ee15,_0x3f21b5){return function(_0x286669){if(_0x286669){return _0x286669[_0x3c13('0x1e')]()[_0x3c13('0x1d')](function(){_0x44ee15['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x560edf,_0x3e2fcb){return function(_0x27a744){if(!_0x27a744){_0x560edf[_0x3c13('0x1f')](0x194);}return _0x27a744;};}function handleError(_0x1a3bf1,_0x52399a){_0x52399a=_0x52399a||0x1f4;return function(_0x253ae5){logger[_0x3c13('0x20')](_0x253ae5[_0x3c13('0x21')]);if(_0x253ae5[_0x3c13('0x22')]){delete _0x253ae5[_0x3c13('0x22')];}_0x1a3bf1[_0x3c13('0x11')](_0x52399a)[_0x3c13('0x23')](_0x253ae5);};}exports[_0x3c13('0x24')]=function(_0x494c18,_0x2b3ef6){var _0x142694={},_0x56b218={},_0x44ca44={'count':0x0,'rows':[]};var _0x276513=_[_0x3c13('0x25')](db[_0x3c13('0x26')][_0x3c13('0x27')],function(_0x39a365){return{'name':_0x39a365[_0x3c13('0x28')],'type':_0x39a365[_0x3c13('0x29')][_0x3c13('0x2a')]};});_0x56b218['model']=_['map'](_0x276513,_0x3c13('0x22'));_0x56b218[_0x3c13('0x2b')]=_[_0x3c13('0x2c')](_0x494c18[_0x3c13('0x2b')]);_0x56b218[_0x3c13('0x2d')]=_['intersection'](_0x56b218[_0x3c13('0x2e')],_0x56b218[_0x3c13('0x2b')]);_0x142694[_0x3c13('0x2f')]=_[_0x3c13('0x30')](_0x56b218[_0x3c13('0x2e')],qs[_0x3c13('0x31')](_0x494c18[_0x3c13('0x2b')][_0x3c13('0x31')]));_0x142694['attributes']=_0x142694['attributes'][_0x3c13('0x32')]?_0x142694['attributes']:_0x56b218[_0x3c13('0x2e')];if(!_0x494c18['query'][_0x3c13('0x33')](_0x3c13('0x34'))){_0x142694[_0x3c13('0x16')]=qs[_0x3c13('0x16')](_0x494c18[_0x3c13('0x2b')][_0x3c13('0x16')]);_0x142694[_0x3c13('0x14')]=qs['offset'](_0x494c18['query'][_0x3c13('0x14')]);}_0x142694[_0x3c13('0x35')]=qs[_0x3c13('0x36')](_0x494c18[_0x3c13('0x2b')][_0x3c13('0x36')]);_0x142694[_0x3c13('0x37')]=qs['filters'](_[_0x3c13('0x38')](_0x494c18[_0x3c13('0x2b')],_0x56b218[_0x3c13('0x2d')]),_0x276513);if(_0x494c18[_0x3c13('0x2b')][_0x3c13('0x39')]){_0x142694['where']=_['merge'](_0x142694[_0x3c13('0x37')],{'$or':_[_0x3c13('0x25')](_0x276513,function(_0xa04e52){if(_0xa04e52[_0x3c13('0x29')]!==_0x3c13('0x3a')){var _0x33b9f8={};_0x33b9f8[_0xa04e52[_0x3c13('0x22')]]={'$like':'%'+_0x494c18[_0x3c13('0x2b')]['filter']+'%'};return _0x33b9f8;}})});}_0x142694=_['merge']({},_0x142694,_0x494c18['options']);var _0x156a6e={'where':_0x142694[_0x3c13('0x37')]};return db[_0x3c13('0x26')][_0x3c13('0x17')](_0x156a6e)[_0x3c13('0x1d')](function(_0x443712){_0x44ca44[_0x3c13('0x17')]=_0x443712;if(_0x494c18[_0x3c13('0x2b')][_0x3c13('0x3b')]){_0x142694[_0x3c13('0x3c')]=[{'all':!![]}];}return db[_0x3c13('0x26')][_0x3c13('0x3d')](_0x142694);})[_0x3c13('0x1d')](function(_0x36d5dd){_0x44ca44[_0x3c13('0x3e')]=_0x36d5dd;return _0x44ca44;})[_0x3c13('0x1d')](respondWithFilteredResult(_0x2b3ef6,_0x142694))[_0x3c13('0x3f')](handleError(_0x2b3ef6,null));};exports['show']=function(_0x4cddbb,_0x409d22){var _0x5a295a={'raw':![],'where':{'id':_0x4cddbb[_0x3c13('0x40')]['id']}},_0x34a6c7={};_0x34a6c7['model']=_[_0x3c13('0x2c')](db[_0x3c13('0x26')][_0x3c13('0x27')]);_0x34a6c7['query']=_[_0x3c13('0x2c')](_0x4cddbb['query']);_0x34a6c7['filters']=_['intersection'](_0x34a6c7[_0x3c13('0x2e')],_0x34a6c7[_0x3c13('0x2b')]);_0x5a295a['attributes']=_[_0x3c13('0x30')](_0x34a6c7[_0x3c13('0x2e')],qs[_0x3c13('0x31')](_0x4cddbb[_0x3c13('0x2b')][_0x3c13('0x31')]));_0x5a295a['attributes']=_0x5a295a[_0x3c13('0x2f')]['length']?_0x5a295a['attributes']:_0x34a6c7[_0x3c13('0x2e')];if(_0x4cddbb[_0x3c13('0x2b')][_0x3c13('0x3b')]){_0x5a295a[_0x3c13('0x3c')]=[{'all':!![]}];}_0x5a295a=_[_0x3c13('0x41')]({},_0x5a295a,_0x4cddbb[_0x3c13('0x42')]);return db['VtigerAccount'][_0x3c13('0x43')](_0x5a295a)[_0x3c13('0x1d')](handleEntityNotFound(_0x409d22,null))[_0x3c13('0x1d')](respondWithResult(_0x409d22,null))[_0x3c13('0x3f')](handleError(_0x409d22,null));};exports['create']=function(_0x18442d,_0x35cbbd){return db[_0x3c13('0x26')][_0x3c13('0x44')](_0x18442d[_0x3c13('0x45')],{})[_0x3c13('0x1d')](respondWithResult(_0x35cbbd,0xc9))[_0x3c13('0x3f')](handleError(_0x35cbbd,null));};exports['update']=function(_0x2fb7ef,_0x1285fc){if(_0x2fb7ef[_0x3c13('0x45')]['id']){delete _0x2fb7ef[_0x3c13('0x45')]['id'];}return db[_0x3c13('0x26')][_0x3c13('0x43')]({'where':{'id':_0x2fb7ef[_0x3c13('0x40')]['id']}})[_0x3c13('0x1d')](handleEntityNotFound(_0x1285fc,null))[_0x3c13('0x1d')](saveUpdates(_0x2fb7ef[_0x3c13('0x45')],null))['then'](respondWithResult(_0x1285fc,null))[_0x3c13('0x3f')](handleError(_0x1285fc,null));};exports['destroy']=function(_0x5c8c1b,_0x30e38e){return db[_0x3c13('0x26')]['find']({'where':{'id':_0x5c8c1b['params']['id']}})['then'](handleEntityNotFound(_0x30e38e,null))[_0x3c13('0x1d')](removeEntity(_0x30e38e,null))[_0x3c13('0x3f')](handleError(_0x30e38e,null));};exports[_0x3c13('0x46')]=function(_0x9dc7ed,_0x12b4df,_0x49c5df){var _0x28d5e7={};var _0x25321a={};var _0x280962;var _0x8dc9b6;return db[_0x3c13('0x26')][_0x3c13('0x47')]({'where':{'id':_0x9dc7ed[_0x3c13('0x40')]['id']}})[_0x3c13('0x1d')](handleEntityNotFound(_0x12b4df,null))['then'](function(_0xc4e904){if(_0xc4e904){_0x280962=_0xc4e904;_0x25321a[_0x3c13('0x2e')]=_[_0x3c13('0x2c')](db['VtigerConfiguration'][_0x3c13('0x27')]);_0x25321a[_0x3c13('0x2b')]=_[_0x3c13('0x2c')](_0x9dc7ed[_0x3c13('0x2b')]);_0x25321a[_0x3c13('0x2d')]=_[_0x3c13('0x30')](_0x25321a[_0x3c13('0x2e')],_0x25321a['query']);_0x28d5e7[_0x3c13('0x2f')]=_[_0x3c13('0x30')](_0x25321a['model'],qs['fields'](_0x9dc7ed[_0x3c13('0x2b')][_0x3c13('0x31')]));_0x28d5e7[_0x3c13('0x2f')]=_0x28d5e7[_0x3c13('0x2f')][_0x3c13('0x32')]?_0x28d5e7[_0x3c13('0x2f')]:_0x25321a[_0x3c13('0x2e')];_0x28d5e7[_0x3c13('0x35')]=qs['sort'](_0x9dc7ed[_0x3c13('0x2b')][_0x3c13('0x36')]);_0x28d5e7['where']=qs[_0x3c13('0x2d')](_[_0x3c13('0x38')](_0x9dc7ed['query'],_0x25321a[_0x3c13('0x2d')]));if(_0x9dc7ed[_0x3c13('0x2b')][_0x3c13('0x39')]){_0x28d5e7['where']=_['merge'](_0x28d5e7[_0x3c13('0x37')],{'$or':_[_0x3c13('0x25')](_0x28d5e7[_0x3c13('0x2f')],function(_0x3d7c08){var _0x28fe33={};_0x28fe33[_0x3d7c08]={'$like':'%'+_0x9dc7ed['query'][_0x3c13('0x39')]+'%'};return _0x28fe33;})});}_0x28d5e7=_[_0x3c13('0x41')]({},_0x28d5e7,_0x9dc7ed[_0x3c13('0x42')]);return _0x280962[_0x3c13('0x46')](_0x28d5e7);}})['then'](function(_0x166bb0){if(_0x166bb0){_0x8dc9b6=_0x166bb0[_0x3c13('0x32')];if(!_0x9dc7ed[_0x3c13('0x2b')][_0x3c13('0x33')](_0x3c13('0x34'))){_0x28d5e7[_0x3c13('0x16')]=qs[_0x3c13('0x16')](_0x9dc7ed['query'][_0x3c13('0x16')]);_0x28d5e7[_0x3c13('0x14')]=qs[_0x3c13('0x14')](_0x9dc7ed[_0x3c13('0x2b')][_0x3c13('0x14')]);}return _0x280962[_0x3c13('0x46')](_0x28d5e7);}})['then'](function(_0x196b39){if(_0x196b39){return _0x196b39?{'count':_0x8dc9b6,'rows':_0x196b39}:null;}})[_0x3c13('0x1d')](respondWithResult(_0x12b4df,null))['catch'](handleError(_0x12b4df,null));};exports[_0x3c13('0x48')]=function(_0x3020ce,_0x599a5e,_0x5df67b){if(_0x3020ce[_0x3c13('0x45')]['id']){delete _0x3020ce[_0x3c13('0x45')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x3020ce['params']['id']}})[_0x3c13('0x1d')](handleEntityNotFound(_0x599a5e,null))[_0x3c13('0x1d')](function(_0x4d0fb8){if(_0x4d0fb8){_0x3020ce[_0x3c13('0x45')]['AccountId']=_0x4d0fb8['id'];_0x3020ce[_0x3c13('0x45')][_0x3c13('0x49')]=integrations[_0x3c13('0x4a')](_0x3020ce['body'][_0x3c13('0x4b')],_0x3020ce[_0x3c13('0x45')]['type']);_0x3020ce[_0x3c13('0x45')][_0x3c13('0x4c')]=integrations[_0x3c13('0x4d')](_0x3020ce[_0x3c13('0x45')][_0x3c13('0x4b')],_0x3020ce[_0x3c13('0x45')][_0x3c13('0x29')]);return db[_0x3c13('0x4e')][_0x3c13('0x44')](_0x3020ce[_0x3c13('0x45')],{'include':[{'model':db[_0x3c13('0x4f')],'as':'Subjects'},{'model':db[_0x3c13('0x4f')],'as':_0x3c13('0x4c')}]});}return null;})[_0x3c13('0x1d')](respondWithResult(_0x599a5e,null))['catch'](handleError(_0x599a5e,null));};var md5=require(_0x3c13('0x50'));exports[_0x3c13('0x51')]=function(_0x2cc83a,_0x3f7aa1,_0x41f656){var _0xa02b51=null;var _0x288f5e=null;var _0x2d11ce=null;var _0x3b0206=null;var _0x4bf46b='';return db[_0x3c13('0x26')]['findOne']({'where':{'id':_0x2cc83a[_0x3c13('0x40')]['id']},'attributes':['id',_0x3c13('0x22'),_0x3c13('0x52'),'description',_0x3c13('0x53'),_0x3c13('0x54'),'serverUrl',_0x3c13('0x55')]})[_0x3c13('0x1d')](handleEntityNotFound(_0x3f7aa1,null))[_0x3c13('0x1d')](function(_0x2d2683){if(_0x2d2683){_0xa02b51=_0x2d2683[_0x3c13('0x52')];_0x288f5e=_0x2d2683[_0x3c13('0x55')];_0x2d11ce=_0x2d2683[_0x3c13('0x53')];_0x4bf46b=_0x2d2683[_0x3c13('0x54')];var _0x1756f4=_0x4bf46b[_0x3c13('0x56')](-0x1);if(_0x1756f4==='/'){_0x4bf46b=_0x4bf46b[_0x3c13('0x57')](0x0,_0x4bf46b['lastIndexOf'](_0x1756f4));}_0x3b0206=util[_0x3c13('0x58')](_0x3c13('0x59'),_0x4bf46b);var _0x365894={'method':_0x3c13('0x5a'),'uri':_0x3b0206,'qs':{'operation':_0x3c13('0x5b'),'username':_0x2d2683[_0x3c13('0x52')]},'json':!![]};return rp(_0x365894);}})['then'](function(_0x3a36f1){if(_0x3a36f1[_0x3c13('0x5c')]){var _0x12098a={'method':_0x3c13('0x5d'),'uri':_0x3b0206,'form':{'operation':_0x3c13('0x5e'),'username':_0xa02b51,'accessKey':md5(_0x3a36f1[_0x3c13('0x5f')]['token']+_0x288f5e)},'json':!![]};return rp(_0x12098a);}})[_0x3c13('0x1d')](function(_0x474417){if(_0x474417['success']){var _0x4b10ef={'method':'GET','uri':_0x3b0206,'qs':{'operation':'describe','username':_0xa02b51,'sessionName':_0x474417[_0x3c13('0x5f')]['sessionName'],'elementType':_0x2d11ce},'json':!![]};return rp(_0x4b10ef);}})[_0x3c13('0x1d')](function(_0x2ea438){if(_0x2ea438[_0x3c13('0x5c')]){var _0x2886fb=[_0x3c13('0x60'),_0x3c13('0x61'),_0x3c13('0x62')];_[_0x3c13('0x63')](_0x2ea438[_0x3c13('0x5f')][_0x3c13('0x31')],function(_0x1a4935){return _0x2886fb[_0x3c13('0x64')](_0x1a4935['type'][_0x3c13('0x22')]);});_['remove'](_0x2ea438['result'][_0x3c13('0x31')],function(_0x2c90bd){return _0x2c90bd[_0x3c13('0x65')]===_0x3c13('0x66');});return{'count':_0x2ea438[_0x3c13('0x5f')][_0x3c13('0x31')][_0x3c13('0x32')],'rows':_[_0x3c13('0x25')](_0x2ea438[_0x3c13('0x5f')][_0x3c13('0x31')],function(_0xa216f6){return{'id':_0xa216f6['name'],'name':_0xa216f6[_0x3c13('0x67')],'custom':_[_0x3c13('0x68')](_0xa216f6[_0x3c13('0x22')],_0x3c13('0x69'))?!![]:![],'options':_0xa216f6[_0x3c13('0x29')][_0x3c13('0x22')]===_0x3c13('0x6a')&&_0xa216f6[_0x3c13('0x29')][_0x3c13('0x6b')][_0x3c13('0x32')]>0x0?_['map'](_0xa216f6[_0x3c13('0x29')][_0x3c13('0x6b')],function(_0xf73989){return{'name':_0xf73989[_0x3c13('0x67')],'value':_0xf73989['value']};}):[]};})};}})['then'](respondWithResult(_0x3f7aa1,null))[_0x3c13('0x3f')](function(_0x10c35a){console[_0x3c13('0x6c')](_0x3c13('0x6d')+_0x10c35a);var _0x20ae35=_0x2cc83a[_0x3c13('0x2b')][_0x3c13('0x6e')]?0x1f4:_0x10c35a[_0x3c13('0x6f')]||0x1f4;logger['error'](_0x3c13('0x70'),_0x3c13('0x51'),_0x20ae35,JSON[_0x3c13('0x71')](_0x10c35a));delete _0x10c35a[_0x3c13('0x22')];if(_0x20ae35===0x191){_0x20ae35=0x190;}_0x3f7aa1[_0x3c13('0x11')](_0x20ae35)[_0x3c13('0x23')](_0x2cc83a[_0x3c13('0x2b')][_0x3c13('0x6e')]?{'message':_0x3c13('0x72'),'statusCode':_0x10c35a[_0x3c13('0x6f')]}:_0x10c35a);});}; \ No newline at end of file +var _0x922b=['include','findAll','rows','show','params','fields','find','create','body','catch','update','findOne','rawAttributes','length','getConfigurations','nolimit','AccountId','Subjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','getFields','description','remoteUri','serverUrl','accessKey','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','username','success','POST','login','token','describe','sessionName','autogenerated','result','includes','remove','editable','label','startsWith','picklist','picklistValues','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','count','offset','json','apply','reject','save','then','error','name','send','index','VtigerAccount','fieldName','type','key','model','map','query','keys','intersection','attributes','hasOwnProperty','limit','order','sort','where','filters','pick','filter','merge','options','includeAll'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x922b,0x12a));var _0xb922=function(_0x7f605b,_0x24ba07){_0x7f605b=_0x7f605b-0x0;var _0xe2b053=_0x922b[_0x7f605b];return _0xe2b053;};'use strict';var emlformat=require(_0xb922('0x0'));var rimraf=require(_0xb922('0x1'));var zipdir=require(_0xb922('0x2'));var jsonpatch=require(_0xb922('0x3'));var rp=require(_0xb922('0x4'));var moment=require(_0xb922('0x5'));var BPromise=require(_0xb922('0x6'));var Mustache=require(_0xb922('0x7'));var util=require(_0xb922('0x8'));var path=require(_0xb922('0x9'));var sox=require('sox');var csv=require(_0xb922('0xa'));var ejs=require(_0xb922('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb922('0xc'));var squel=require(_0xb922('0xd'));var crypto=require(_0xb922('0xe'));var jsforce=require(_0xb922('0xf'));var deskjs=require(_0xb922('0x10'));var toCsv=require(_0xb922('0xa'));var querystring=require(_0xb922('0x11'));var Papa=require(_0xb922('0x12'));var Redis=require(_0xb922('0x13'));var authService=require(_0xb922('0x14'));var qs=require(_0xb922('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb922('0x16'));var logger=require(_0xb922('0x17'))(_0xb922('0x18'));var utils=require(_0xb922('0x19'));var config=require(_0xb922('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xb922('0x1b'))['db'];var integrations=require(_0xb922('0x1c'));function respondWithStatusCode(_0x123ba2,_0x2a677b){_0x2a677b=_0x2a677b||0xcc;return function(_0x660dc1){if(_0x660dc1){return _0x123ba2[_0xb922('0x1d')](_0x2a677b);}return _0x123ba2[_0xb922('0x1e')](_0x2a677b)[_0xb922('0x1f')]();};}function respondWithResult(_0x74c537,_0x253d00){_0x253d00=_0x253d00||0xc8;return function(_0xebb8b4){if(_0xebb8b4){return _0x74c537[_0xb922('0x1e')](_0x253d00)['json'](_0xebb8b4);}};}function respondWithFilteredResult(_0x57275d,_0x21d2c2){return function(_0xa9a590){if(_0xa9a590){var _0x270959=typeof _0x21d2c2['offset']===_0xb922('0x20')&&typeof _0x21d2c2['limit']===_0xb922('0x20');var _0x19c4ed=_0xa9a590[_0xb922('0x21')];var _0x5b7a85=_0x270959?0x0:_0x21d2c2[_0xb922('0x22')];var _0x1ee7f0=_0x270959?_0xa9a590[_0xb922('0x21')]:_0x21d2c2[_0xb922('0x22')]+_0x21d2c2['limit'];var _0xe2dfb4;if(_0x1ee7f0>=_0x19c4ed){_0x1ee7f0=_0x19c4ed;_0xe2dfb4=0xc8;}else{_0xe2dfb4=0xce;}_0x57275d[_0xb922('0x1e')](_0xe2dfb4);return _0x57275d['set']('Content-Range',_0x5b7a85+'-'+_0x1ee7f0+'/'+_0x19c4ed)[_0xb922('0x23')](_0xa9a590);}return null;};}function patchUpdates(_0x3b49b1){return function(_0x33b8e7){try{jsonpatch[_0xb922('0x24')](_0x33b8e7,_0x3b49b1,!![]);}catch(_0x2d2e39){return BPromise[_0xb922('0x25')](_0x2d2e39);}return _0x33b8e7[_0xb922('0x26')]();};}function saveUpdates(_0x49e126,_0x5c6a26){return function(_0x42d0b6){if(_0x42d0b6){return _0x42d0b6['update'](_0x49e126)[_0xb922('0x27')](function(_0x168a09){return _0x168a09;});}return null;};}function removeEntity(_0x200b2f,_0x3ee8e4){return function(_0x2014b8){if(_0x2014b8){return _0x2014b8['destroy']()[_0xb922('0x27')](function(){_0x200b2f[_0xb922('0x1e')](0xcc)[_0xb922('0x1f')]();});}};}function handleEntityNotFound(_0x14bcab,_0x3f7c4e){return function(_0x6b4ed1){if(!_0x6b4ed1){_0x14bcab[_0xb922('0x1d')](0x194);}return _0x6b4ed1;};}function handleError(_0x4dfe3b,_0x20be81){_0x20be81=_0x20be81||0x1f4;return function(_0x563d8c){logger[_0xb922('0x28')](_0x563d8c['stack']);if(_0x563d8c[_0xb922('0x29')]){delete _0x563d8c[_0xb922('0x29')];}_0x4dfe3b[_0xb922('0x1e')](_0x20be81)[_0xb922('0x2a')](_0x563d8c);};}exports[_0xb922('0x2b')]=function(_0x1cd7fa,_0x118ee8){var _0x4c5937={},_0x5c57ab={},_0x5b038f={'count':0x0,'rows':[]};var _0x559354=_['map'](db[_0xb922('0x2c')]['rawAttributes'],function(_0x23a2f5){return{'name':_0x23a2f5[_0xb922('0x2d')],'type':_0x23a2f5[_0xb922('0x2e')][_0xb922('0x2f')]};});_0x5c57ab[_0xb922('0x30')]=_[_0xb922('0x31')](_0x559354,_0xb922('0x29'));_0x5c57ab[_0xb922('0x32')]=_[_0xb922('0x33')](_0x1cd7fa[_0xb922('0x32')]);_0x5c57ab['filters']=_[_0xb922('0x34')](_0x5c57ab[_0xb922('0x30')],_0x5c57ab[_0xb922('0x32')]);_0x4c5937[_0xb922('0x35')]=_['intersection'](_0x5c57ab[_0xb922('0x30')],qs['fields'](_0x1cd7fa[_0xb922('0x32')]['fields']));_0x4c5937[_0xb922('0x35')]=_0x4c5937['attributes']['length']?_0x4c5937['attributes']:_0x5c57ab['model'];if(!_0x1cd7fa[_0xb922('0x32')][_0xb922('0x36')]('nolimit')){_0x4c5937[_0xb922('0x37')]=qs[_0xb922('0x37')](_0x1cd7fa['query'][_0xb922('0x37')]);_0x4c5937['offset']=qs[_0xb922('0x22')](_0x1cd7fa[_0xb922('0x32')][_0xb922('0x22')]);}_0x4c5937[_0xb922('0x38')]=qs[_0xb922('0x39')](_0x1cd7fa[_0xb922('0x32')][_0xb922('0x39')]);_0x4c5937[_0xb922('0x3a')]=qs[_0xb922('0x3b')](_[_0xb922('0x3c')](_0x1cd7fa[_0xb922('0x32')],_0x5c57ab[_0xb922('0x3b')]),_0x559354);if(_0x1cd7fa[_0xb922('0x32')][_0xb922('0x3d')]){_0x4c5937[_0xb922('0x3a')]=_[_0xb922('0x3e')](_0x4c5937[_0xb922('0x3a')],{'$or':_[_0xb922('0x31')](_0x559354,function(_0x5a6228){if(_0x5a6228['type']!=='VIRTUAL'){var _0x161f81={};_0x161f81[_0x5a6228[_0xb922('0x29')]]={'$like':'%'+_0x1cd7fa[_0xb922('0x32')]['filter']+'%'};return _0x161f81;}})});}_0x4c5937=_[_0xb922('0x3e')]({},_0x4c5937,_0x1cd7fa[_0xb922('0x3f')]);var _0x1d2908={'where':_0x4c5937['where']};return db['VtigerAccount']['count'](_0x1d2908)['then'](function(_0x261f8a){_0x5b038f[_0xb922('0x21')]=_0x261f8a;if(_0x1cd7fa[_0xb922('0x32')][_0xb922('0x40')]){_0x4c5937[_0xb922('0x41')]=[{'all':!![]}];}return db['VtigerAccount'][_0xb922('0x42')](_0x4c5937);})[_0xb922('0x27')](function(_0x40d75f){_0x5b038f[_0xb922('0x43')]=_0x40d75f;return _0x5b038f;})[_0xb922('0x27')](respondWithFilteredResult(_0x118ee8,_0x4c5937))['catch'](handleError(_0x118ee8,null));};exports[_0xb922('0x44')]=function(_0x5977c3,_0x33e38f){var _0x2b1fca={'raw':![],'where':{'id':_0x5977c3[_0xb922('0x45')]['id']}},_0x284251={};_0x284251['model']=_[_0xb922('0x33')](db[_0xb922('0x2c')]['rawAttributes']);_0x284251[_0xb922('0x32')]=_[_0xb922('0x33')](_0x5977c3['query']);_0x284251[_0xb922('0x3b')]=_[_0xb922('0x34')](_0x284251[_0xb922('0x30')],_0x284251[_0xb922('0x32')]);_0x2b1fca[_0xb922('0x35')]=_[_0xb922('0x34')](_0x284251[_0xb922('0x30')],qs[_0xb922('0x46')](_0x5977c3[_0xb922('0x32')]['fields']));_0x2b1fca[_0xb922('0x35')]=_0x2b1fca['attributes']['length']?_0x2b1fca[_0xb922('0x35')]:_0x284251[_0xb922('0x30')];if(_0x5977c3[_0xb922('0x32')][_0xb922('0x40')]){_0x2b1fca[_0xb922('0x41')]=[{'all':!![]}];}_0x2b1fca=_[_0xb922('0x3e')]({},_0x2b1fca,_0x5977c3[_0xb922('0x3f')]);return db[_0xb922('0x2c')][_0xb922('0x47')](_0x2b1fca)['then'](handleEntityNotFound(_0x33e38f,null))[_0xb922('0x27')](respondWithResult(_0x33e38f,null))['catch'](handleError(_0x33e38f,null));};exports[_0xb922('0x48')]=function(_0x5512d5,_0x44a406){return db[_0xb922('0x2c')][_0xb922('0x48')](_0x5512d5[_0xb922('0x49')],{})[_0xb922('0x27')](respondWithResult(_0x44a406,0xc9))[_0xb922('0x4a')](handleError(_0x44a406,null));};exports[_0xb922('0x4b')]=function(_0x32d4eb,_0x20d009){if(_0x32d4eb[_0xb922('0x49')]['id']){delete _0x32d4eb[_0xb922('0x49')]['id'];}return db[_0xb922('0x2c')][_0xb922('0x47')]({'where':{'id':_0x32d4eb[_0xb922('0x45')]['id']}})[_0xb922('0x27')](handleEntityNotFound(_0x20d009,null))[_0xb922('0x27')](saveUpdates(_0x32d4eb['body'],null))[_0xb922('0x27')](respondWithResult(_0x20d009,null))['catch'](handleError(_0x20d009,null));};exports['destroy']=function(_0x2938cc,_0x1cce3c){return db[_0xb922('0x2c')][_0xb922('0x47')]({'where':{'id':_0x2938cc[_0xb922('0x45')]['id']}})[_0xb922('0x27')](handleEntityNotFound(_0x1cce3c,null))[_0xb922('0x27')](removeEntity(_0x1cce3c,null))[_0xb922('0x4a')](handleError(_0x1cce3c,null));};exports['getConfigurations']=function(_0x38bcff,_0x3b5828,_0x5331bf){var _0xefe5ff={};var _0x19d671={};var _0x5ac12a;var _0xbd6345;return db[_0xb922('0x2c')][_0xb922('0x4c')]({'where':{'id':_0x38bcff['params']['id']}})[_0xb922('0x27')](handleEntityNotFound(_0x3b5828,null))[_0xb922('0x27')](function(_0x30713e){if(_0x30713e){_0x5ac12a=_0x30713e;_0x19d671[_0xb922('0x30')]=_[_0xb922('0x33')](db['VtigerConfiguration'][_0xb922('0x4d')]);_0x19d671[_0xb922('0x32')]=_[_0xb922('0x33')](_0x38bcff[_0xb922('0x32')]);_0x19d671[_0xb922('0x3b')]=_[_0xb922('0x34')](_0x19d671['model'],_0x19d671[_0xb922('0x32')]);_0xefe5ff['attributes']=_[_0xb922('0x34')](_0x19d671[_0xb922('0x30')],qs['fields'](_0x38bcff['query']['fields']));_0xefe5ff[_0xb922('0x35')]=_0xefe5ff[_0xb922('0x35')][_0xb922('0x4e')]?_0xefe5ff['attributes']:_0x19d671[_0xb922('0x30')];_0xefe5ff[_0xb922('0x38')]=qs[_0xb922('0x39')](_0x38bcff['query'][_0xb922('0x39')]);_0xefe5ff[_0xb922('0x3a')]=qs[_0xb922('0x3b')](_[_0xb922('0x3c')](_0x38bcff['query'],_0x19d671[_0xb922('0x3b')]));if(_0x38bcff['query'][_0xb922('0x3d')]){_0xefe5ff['where']=_['merge'](_0xefe5ff['where'],{'$or':_[_0xb922('0x31')](_0xefe5ff[_0xb922('0x35')],function(_0x3f57f4){var _0x36ae5f={};_0x36ae5f[_0x3f57f4]={'$like':'%'+_0x38bcff['query'][_0xb922('0x3d')]+'%'};return _0x36ae5f;})});}_0xefe5ff=_[_0xb922('0x3e')]({},_0xefe5ff,_0x38bcff[_0xb922('0x3f')]);return _0x5ac12a[_0xb922('0x4f')](_0xefe5ff);}})[_0xb922('0x27')](function(_0x2aeb1b){if(_0x2aeb1b){_0xbd6345=_0x2aeb1b[_0xb922('0x4e')];if(!_0x38bcff['query'][_0xb922('0x36')](_0xb922('0x50'))){_0xefe5ff[_0xb922('0x37')]=qs[_0xb922('0x37')](_0x38bcff['query']['limit']);_0xefe5ff[_0xb922('0x22')]=qs[_0xb922('0x22')](_0x38bcff[_0xb922('0x32')][_0xb922('0x22')]);}return _0x5ac12a[_0xb922('0x4f')](_0xefe5ff);}})[_0xb922('0x27')](function(_0x535692){if(_0x535692){return _0x535692?{'count':_0xbd6345,'rows':_0x535692}:null;}})[_0xb922('0x27')](respondWithResult(_0x3b5828,null))['catch'](handleError(_0x3b5828,null));};exports['addConfiguration']=function(_0x80795f,_0x44f1d8,_0x2088cf){if(_0x80795f[_0xb922('0x49')]['id']){delete _0x80795f[_0xb922('0x49')]['id'];}return db[_0xb922('0x2c')]['findOne']({'where':{'id':_0x80795f[_0xb922('0x45')]['id']}})[_0xb922('0x27')](handleEntityNotFound(_0x44f1d8,null))[_0xb922('0x27')](function(_0x1467e0){if(_0x1467e0){_0x80795f[_0xb922('0x49')][_0xb922('0x51')]=_0x1467e0['id'];_0x80795f[_0xb922('0x49')][_0xb922('0x52')]=integrations['getSubjects'](_0x80795f['body'][_0xb922('0x53')],_0x80795f[_0xb922('0x49')][_0xb922('0x2e')]);_0x80795f[_0xb922('0x49')][_0xb922('0x54')]=integrations[_0xb922('0x55')](_0x80795f['body']['channel'],_0x80795f['body'][_0xb922('0x2e')]);return db[_0xb922('0x56')][_0xb922('0x48')](_0x80795f[_0xb922('0x49')],{'include':[{'model':db[_0xb922('0x57')],'as':_0xb922('0x52')},{'model':db['VtigerField'],'as':_0xb922('0x54')}]});}return null;})[_0xb922('0x27')](respondWithResult(_0x44f1d8,null))[_0xb922('0x4a')](handleError(_0x44f1d8,null));};var md5=require('md5');exports[_0xb922('0x58')]=function(_0x5a976b,_0x31fd3c,_0x3da5e0){var _0x83b799=null;var _0x2ef419=null;var _0x9c082b=null;var _0x423ab6=null;var _0x54199a='';return db[_0xb922('0x2c')][_0xb922('0x4c')]({'where':{'id':_0x5a976b[_0xb922('0x45')]['id']},'attributes':['id','name','username',_0xb922('0x59'),'moduleName',_0xb922('0x5a'),_0xb922('0x5b'),_0xb922('0x5c')]})[_0xb922('0x27')](handleEntityNotFound(_0x31fd3c,null))[_0xb922('0x27')](function(_0x4f6fde){if(_0x4f6fde){_0x83b799=_0x4f6fde['username'];_0x2ef419=_0x4f6fde[_0xb922('0x5c')];_0x9c082b=_0x4f6fde['moduleName'];_0x54199a=_0x4f6fde[_0xb922('0x5a')];var _0x2eaa94=_0x54199a['slice'](-0x1);if(_0x2eaa94==='/'){_0x54199a=_0x54199a[_0xb922('0x5d')](0x0,_0x54199a[_0xb922('0x5e')](_0x2eaa94));}_0x423ab6=util['format'](_0xb922('0x5f'),_0x54199a);var _0xd9b56d={'method':_0xb922('0x60'),'uri':_0x423ab6,'qs':{'operation':_0xb922('0x61'),'username':_0x4f6fde[_0xb922('0x62')]},'json':!![]};return rp(_0xd9b56d);}})['then'](function(_0x4946cd){if(_0x4946cd[_0xb922('0x63')]){var _0x1f6f1e={'method':_0xb922('0x64'),'uri':_0x423ab6,'form':{'operation':_0xb922('0x65'),'username':_0x83b799,'accessKey':md5(_0x4946cd['result'][_0xb922('0x66')]+_0x2ef419)},'json':!![]};return rp(_0x1f6f1e);}})[_0xb922('0x27')](function(_0x3d04b0){if(_0x3d04b0[_0xb922('0x63')]){var _0x3ab339={'method':_0xb922('0x60'),'uri':_0x423ab6,'qs':{'operation':_0xb922('0x67'),'username':_0x83b799,'sessionName':_0x3d04b0['result'][_0xb922('0x68')],'elementType':_0x9c082b},'json':!![]};return rp(_0x3ab339);}})[_0xb922('0x27')](function(_0x355b38){if(_0x355b38[_0xb922('0x63')]){var _0x53a10c=[_0xb922('0x69'),'reference','owner'];_['remove'](_0x355b38[_0xb922('0x6a')][_0xb922('0x46')],function(_0x5cbe01){return _0x53a10c[_0xb922('0x6b')](_0x5cbe01['type']['name']);});_[_0xb922('0x6c')](_0x355b38['result'][_0xb922('0x46')],function(_0x1ca89e){return _0x1ca89e[_0xb922('0x6d')]==='false';});return{'count':_0x355b38[_0xb922('0x6a')][_0xb922('0x46')][_0xb922('0x4e')],'rows':_['map'](_0x355b38[_0xb922('0x6a')][_0xb922('0x46')],function(_0x11dc8c){return{'id':_0x11dc8c[_0xb922('0x29')],'name':_0x11dc8c[_0xb922('0x6e')],'custom':_[_0xb922('0x6f')](_0x11dc8c[_0xb922('0x29')],'cf_')?!![]:![],'options':_0x11dc8c['type'][_0xb922('0x29')]===_0xb922('0x70')&&_0x11dc8c['type'][_0xb922('0x71')][_0xb922('0x4e')]>0x0?_[_0xb922('0x31')](_0x11dc8c['type']['picklistValues'],function(_0x3ab885){return{'name':_0x3ab885[_0xb922('0x6e')],'value':_0x3ab885['value']};}):[]};})};}})['then'](respondWithResult(_0x31fd3c,null))[_0xb922('0x4a')](function(_0x419c46){console[_0xb922('0x72')](_0xb922('0x73')+_0x419c46);var _0x11df36=_0x5a976b['query'][_0xb922('0x74')]?0x1f4:_0x419c46[_0xb922('0x75')]||0x1f4;logger['error'](_0xb922('0x76'),'getFields',_0x11df36,JSON[_0xb922('0x77')](_0x419c46));delete _0x419c46[_0xb922('0x29')];if(_0x11df36===0x191){_0x11df36=0x190;}_0x31fd3c['status'](_0x11df36)[_0xb922('0x2a')](_0x5a976b[_0xb922('0x32')][_0xb922('0x74')]?{'message':_0xb922('0x78'),'statusCode':_0x419c46[_0xb922('0x75')]}:_0x419c46);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 842880e..fc3372f 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 _0xe2e1=['int_vtiger_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','VtigerAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2e1,0xa9));var _0x1e2e=function(_0x43cd28,_0x5f42ee){_0x43cd28=_0x43cd28-0x0;var _0x23d607=_0xe2e1[_0x43cd28];return _0x23d607;};'use strict';var _=require(_0x1e2e('0x0'));var util=require(_0x1e2e('0x1'));var logger=require(_0x1e2e('0x2'))(_0x1e2e('0x3'));var moment=require(_0x1e2e('0x4'));var BPromise=require(_0x1e2e('0x5'));var rp=require(_0x1e2e('0x6'));var fs=require('fs');var path=require(_0x1e2e('0x7'));var rimraf=require('rimraf');var config=require(_0x1e2e('0x8'));var attributes=require(_0x1e2e('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x2ab934,_0x28cd99){return _0x2ab934['define'](_0x1e2e('0xa'),attributes,{'tableName':_0x1e2e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0094=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xa070d2,_0x1aa4bf){var _0x222f7b=function(_0x42b5be){while(--_0x42b5be){_0xa070d2['push'](_0xa070d2['shift']());}};_0x222f7b(++_0x1aa4bf);}(_0x0094,0x161));var _0x4009=function(_0x386c25,_0x47649f){_0x386c25=_0x386c25-0x0;var _0x2922a1=_0x0094[_0x386c25];return _0x2922a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4009('0x0'))(_0x4009('0x1'));var moment=require(_0x4009('0x2'));var BPromise=require(_0x4009('0x3'));var rp=require(_0x4009('0x4'));var fs=require('fs');var path=require(_0x4009('0x5'));var rimraf=require(_0x4009('0x6'));var config=require(_0x4009('0x7'));var attributes=require(_0x4009('0x8'));var integrations=require(_0x4009('0x9'));module[_0x4009('0xa')]=function(_0x8d733c,_0x595f90){return _0x8d733c['define'](_0x4009('0xb'),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 8253773..691c94f 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 _0xb9be=['VtigerAccount','findAll','options','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','debug','stringify','error','code','request\x20sent','result','message','catch','GetVtigerAccount'];(function(_0x4f6107,_0x421208){var _0x3df6f7=function(_0x2a4970){while(--_0x2a4970){_0x4f6107['push'](_0x4f6107['shift']());}};_0x3df6f7(++_0x421208);}(_0xb9be,0xc5));var _0xeb9b=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0xb9be[_0x1b5aea];return _0x51cae9;};'use strict';var _=require(_0xeb9b('0x0'));var util=require(_0xeb9b('0x1'));var moment=require(_0xeb9b('0x2'));var BPromise=require(_0xeb9b('0x3'));var rs=require(_0xeb9b('0x4'));var fs=require('fs');var Redis=require(_0xeb9b('0x5'));var db=require(_0xeb9b('0x6'))['db'];var utils=require(_0xeb9b('0x7'));var logger=require(_0xeb9b('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xeb9b('0x9'));var client=jayson[_0xeb9b('0xa')][_0xeb9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49a8b9,_0x1ee7e0,_0x58ca1d){return new BPromise(function(_0x210eeb,_0x28dc5f){return client[_0xeb9b('0xc')](_0x49a8b9,_0x58ca1d)[_0xeb9b('0xd')](function(_0x418204){logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,'request\x20sent');logger[_0xeb9b('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1ee7e0,'request\x20sent',JSON[_0xeb9b('0x11')](_0x418204));if(_0x418204[_0xeb9b('0x12')]){if(_0x418204['error'][_0xeb9b('0x13')]===0x1f4){logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x28dc5f(_0x418204['error']['message']);}logger[_0xeb9b('0x12')](_0xeb9b('0xf'),_0x1ee7e0,_0x418204[_0xeb9b('0x12')]['message']);return _0x210eeb(_0x418204['error']['message']);}else{logger[_0xeb9b('0xe')](_0xeb9b('0xf'),_0x1ee7e0,_0xeb9b('0x14'));_0x210eeb(_0x418204[_0xeb9b('0x15')][_0xeb9b('0x16')]);}})[_0xeb9b('0x17')](function(_0x239ccf){logger['error'](_0xeb9b('0xf'),_0x1ee7e0,_0x239ccf);_0x28dc5f(_0x239ccf);});});}exports[_0xeb9b('0x18')]=function(_0x21aca6){var _0x3a11e3=this;return new Promise(function(_0x3cbe3e,_0x1a140c){return db[_0xeb9b('0x19')][_0xeb9b('0x1a')]({'raw':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6['options']['where']||null:null,'attributes':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')]['attributes']||null:null,'limit':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1c')]||null:null,'include':_0x21aca6[_0xeb9b('0x1b')]?_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x21aca6[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x46df93){return{'model':db[_0x46df93[_0xeb9b('0x1f')]],'as':_0x46df93['as'],'attributes':_0x46df93[_0xeb9b('0x20')],'include':_0x46df93[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x46df93[_0xeb9b('0x1d')],function(_0x434461){return{'model':db[_0x434461['model']],'as':_0x434461['as'],'attributes':_0x434461[_0xeb9b('0x20')],'include':_0x434461['include']?_[_0xeb9b('0x1e')](_0x434461['include'],function(_0x347ec1){return{'model':db[_0x347ec1[_0xeb9b('0x1f')]],'as':_0x347ec1['as'],'attributes':_0x347ec1[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeb9b('0xd')](function(_0x52f6c1){logger[_0xeb9b('0xe')](_0xeb9b('0x18'),_0x21aca6);logger['debug'](_0xeb9b('0x18'),_0x21aca6,JSON[_0xeb9b('0x11')](_0x52f6c1));_0x3cbe3e(_0x52f6c1);})['catch'](function(_0x2a4b51){logger[_0xeb9b('0x12')](_0xeb9b('0x18'),_0x2a4b51['message'],_0x21aca6);_0x1a140c(_0x3a11e3[_0xeb9b('0x12')](0x1f4,_0x2a4b51['message']));});});};exports[_0xeb9b('0x21')]=function(_0x4c1331){var _0x411467=this;return new Promise(function(_0x54c659,_0x27578d){return db['VtigerAccount'][_0xeb9b('0x22')]({'raw':_0x4c1331['options']?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x23')]===undefined?!![]:![]:!![],'where':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x24')]||null:null,'attributes':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x20')]||null:null,'include':_0x4c1331[_0xeb9b('0x1b')]?_0x4c1331[_0xeb9b('0x1b')]['include']?_[_0xeb9b('0x1e')](_0x4c1331[_0xeb9b('0x1b')][_0xeb9b('0x1d')],function(_0x21ecfd){return{'model':db[_0x21ecfd[_0xeb9b('0x1f')]],'as':_0x21ecfd['as'],'attributes':_0x21ecfd[_0xeb9b('0x20')],'include':_0x21ecfd[_0xeb9b('0x1d')]?_['map'](_0x21ecfd[_0xeb9b('0x1d')],function(_0x2f3179){return{'model':db[_0x2f3179[_0xeb9b('0x1f')]],'as':_0x2f3179['as'],'attributes':_0x2f3179['attributes'],'include':_0x2f3179[_0xeb9b('0x1d')]?_[_0xeb9b('0x1e')](_0x2f3179[_0xeb9b('0x1d')],function(_0xab9ad5){return{'model':db[_0xab9ad5[_0xeb9b('0x1f')]],'as':_0xab9ad5['as'],'attributes':_0xab9ad5[_0xeb9b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24d235){logger[_0xeb9b('0xe')]('ShowVtigerAccount',_0x4c1331);logger[_0xeb9b('0x10')](_0xeb9b('0x21'),_0x4c1331,JSON[_0xeb9b('0x11')](_0x24d235));_0x54c659(_0x24d235);})[_0xeb9b('0x17')](function(_0x37c678){logger[_0xeb9b('0x12')](_0xeb9b('0x21'),_0x37c678['message'],_0x4c1331);_0x27578d(_0x411467[_0xeb9b('0x12')](0x1f4,_0x37c678[_0xeb9b('0x16')]));});});}; \ No newline at end of file +var _0x57f8=['request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVtigerAccount','VtigerAccount','options','where','attributes','include','model','map','debug','ShowVtigerAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xb09d7b,_0xb35901){var _0x4b525a=function(_0x4b73a0){while(--_0x4b73a0){_0xb09d7b['push'](_0xb09d7b['shift']());}};_0x4b525a(++_0xb35901);}(_0x57f8,0x198));var _0x857f=function(_0x1c67a2,_0x599648){_0x1c67a2=_0x1c67a2-0x0;var _0x4fbd8e=_0x57f8[_0x1c67a2];return _0x4fbd8e;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('VtigerAccount,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});}exports[_0x857f('0x17')]=function(_0x1a9ef8){var _0x429e23=this;return new Promise(function(_0x1014ca,_0x38a242){return db[_0x857f('0x18')]['findAll']({'raw':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')][_0x857f('0x1a')]||null:null,'attributes':_0x1a9ef8['options']?_0x1a9ef8['options'][_0x857f('0x1b')]||null:null,'limit':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')]['limit']||null:null,'include':_0x1a9ef8[_0x857f('0x19')]?_0x1a9ef8[_0x857f('0x19')][_0x857f('0x1c')]?_['map'](_0x1a9ef8[_0x857f('0x19')][_0x857f('0x1c')],function(_0x50bfb7){return{'model':db[_0x50bfb7[_0x857f('0x1d')]],'as':_0x50bfb7['as'],'attributes':_0x50bfb7[_0x857f('0x1b')],'include':_0x50bfb7[_0x857f('0x1c')]?_[_0x857f('0x1e')](_0x50bfb7[_0x857f('0x1c')],function(_0x3b23a7){return{'model':db[_0x3b23a7[_0x857f('0x1d')]],'as':_0x3b23a7['as'],'attributes':_0x3b23a7[_0x857f('0x1b')],'include':_0x3b23a7[_0x857f('0x1c')]?_[_0x857f('0x1e')](_0x3b23a7[_0x857f('0x1c')],function(_0x4782ab){return{'model':db[_0x4782ab[_0x857f('0x1d')]],'as':_0x4782ab['as'],'attributes':_0x4782ab[_0x857f('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17e415){logger[_0x857f('0xe')](_0x857f('0x17'),_0x1a9ef8);logger[_0x857f('0x1f')]('GetVtigerAccount',_0x1a9ef8,JSON[_0x857f('0x12')](_0x17e415));_0x1014ca(_0x17e415);})['catch'](function(_0x1b405a){logger[_0x857f('0x13')](_0x857f('0x17'),_0x1b405a[_0x857f('0x15')],_0x1a9ef8);_0x38a242(_0x429e23[_0x857f('0x13')](0x1f4,_0x1b405a[_0x857f('0x15')]));});});};exports[_0x857f('0x20')]=function(_0xe79241){var _0x17e7b6=this;return new Promise(function(_0x41f832,_0x24adc2){return db[_0x857f('0x18')][_0x857f('0x21')]({'raw':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x22')]===undefined?!![]:![]:!![],'where':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x1a')]||null:null,'attributes':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x1b')]||null:null,'include':_0xe79241['options']?_0xe79241[_0x857f('0x19')][_0x857f('0x1c')]?_[_0x857f('0x1e')](_0xe79241[_0x857f('0x19')]['include'],function(_0x596b2f){return{'model':db[_0x596b2f[_0x857f('0x1d')]],'as':_0x596b2f['as'],'attributes':_0x596b2f[_0x857f('0x1b')],'include':_0x596b2f['include']?_[_0x857f('0x1e')](_0x596b2f['include'],function(_0x1ff000){return{'model':db[_0x1ff000[_0x857f('0x1d')]],'as':_0x1ff000['as'],'attributes':_0x1ff000[_0x857f('0x1b')],'include':_0x1ff000[_0x857f('0x1c')]?_[_0x857f('0x1e')](_0x1ff000['include'],function(_0x47cfed){return{'model':db[_0x47cfed[_0x857f('0x1d')]],'as':_0x47cfed['as'],'attributes':_0x47cfed['attributes']};}):[]};}):[]};}):[]:[]})[_0x857f('0xd')](function(_0x227602){logger[_0x857f('0xe')]('ShowVtigerAccount',_0xe79241);logger[_0x857f('0x1f')](_0x857f('0x20'),_0xe79241,JSON[_0x857f('0x12')](_0x227602));_0x41f832(_0x227602);})[_0x857f('0x16')](function(_0x36e6bd){logger[_0x857f('0x13')](_0x857f('0x20'),_0x36e6bd['message'],_0xe79241);_0x24adc2(_0x17e7b6[_0x857f('0x13')](0x1f4,_0x36e6bd[_0x857f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 7c8d0f9..0770927 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 _0x9943=['../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','destroy','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x9943,0x1df));var _0x3994=function(_0x467ef6,_0x932cef){_0x467ef6=_0x467ef6-0x0;var _0x3e4aa2=_0x9943[_0x467ef6];return _0x3e4aa2;};'use strict';var multer=require(_0x3994('0x0'));var util=require(_0x3994('0x1'));var path=require('path');var timeout=require(_0x3994('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3994('0x3'));var auth=require(_0x3994('0x4'));var interaction=require(_0x3994('0x5'));var config=require(_0x3994('0x6'));var controller=require(_0x3994('0x7'));router[_0x3994('0x8')]('/',auth[_0x3994('0x9')](),controller[_0x3994('0xa')]);router[_0x3994('0x8')](_0x3994('0xb'),auth[_0x3994('0x9')](),controller[_0x3994('0xc')]);router['get'](_0x3994('0xd'),auth[_0x3994('0x9')](),controller[_0x3994('0xe')]);router[_0x3994('0x8')](_0x3994('0xf'),auth[_0x3994('0x9')](),controller['getSubjects']);router['get'](_0x3994('0x10'),auth[_0x3994('0x9')](),controller[_0x3994('0x11')]);router[_0x3994('0x12')]('/',auth[_0x3994('0x9')](),controller[_0x3994('0x13')]);router['put'](_0x3994('0xb'),auth[_0x3994('0x9')](),controller[_0x3994('0x14')]);router['delete'](_0x3994('0xb'),auth[_0x3994('0x9')](),controller[_0x3994('0x15')]);module['exports']=router; \ No newline at end of file +var _0xc9ca=['../../components/auth/service','../../components/interaction/service','./intVtigerConfiguration.controller','isAuthenticated','index','get','/:id/fields','getFields','getSubjects','getDescriptions','post','put','/:id','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0xc9ca,0x8d));var _0xac9c=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0xc9ca[_0x3e0763];return _0x351ca2;};'use strict';var multer=require(_0xac9c('0x0'));var util=require(_0xac9c('0x1'));var path=require(_0xac9c('0x2'));var timeout=require(_0xac9c('0x3'));var express=require('express');var router=express[_0xac9c('0x4')]();var fs_extra=require(_0xac9c('0x5'));var auth=require(_0xac9c('0x6'));var interaction=require(_0xac9c('0x7'));var config=require('../../config/environment');var controller=require(_0xac9c('0x8'));router['get']('/',auth[_0xac9c('0x9')](),controller[_0xac9c('0xa')]);router['get']('/:id',auth[_0xac9c('0x9')](),controller['show']);router[_0xac9c('0xb')](_0xac9c('0xc'),auth[_0xac9c('0x9')](),controller[_0xac9c('0xd')]);router[_0xac9c('0xb')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xac9c('0xe')]);router[_0xac9c('0xb')]('/:id/descriptions',auth[_0xac9c('0x9')](),controller[_0xac9c('0xf')]);router[_0xac9c('0x10')]('/',auth[_0xac9c('0x9')](),controller['create']);router[_0xac9c('0x11')](_0xac9c('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xac9c('0x13')](_0xac9c('0x12'),auth[_0xac9c('0x9')](),controller[_0xac9c('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index fad8a65..35824a4 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 _0x1391=['sequelize','exports','STRING'];(function(_0x4ea625,_0x39c872){var _0x50abdb=function(_0x1e8809){while(--_0x1e8809){_0x4ea625['push'](_0x4ea625['shift']());}};_0x50abdb(++_0x39c872);}(_0x1391,0x78));var _0x1139=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x1391[_0x2763f2];return _0x3ef471;};'use strict';var Sequelize=require(_0x1139('0x0'));module[_0x1139('0x1')]={'name':{'type':Sequelize[_0x1139('0x2')]},'description':{'type':Sequelize[_0x1139('0x2')]}}; \ No newline at end of file +var _0x5d4b=['STRING','sequelize'];(function(_0x12a669,_0x2bdfd1){var _0x3327d2=function(_0x28de3e){while(--_0x28de3e){_0x12a669['push'](_0x12a669['shift']());}};_0x3327d2(++_0x2bdfd1);}(_0x5d4b,0x69));var _0xb5d4=function(_0x2d9beb,_0x3f7c5a){_0x2d9beb=_0x2d9beb-0x0;var _0x487500=_0x5d4b[_0x2d9beb];return _0x487500;};'use strict';var Sequelize=require(_0xb5d4('0x0'));module['exports']={'name':{'type':Sequelize[_0xb5d4('0x1')]},'description':{'type':Sequelize[_0xb5d4('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 80ca2d3..3608f13 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 _0xf3f9=['mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','filters','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','VtigerConfiguration','keys','options','find','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2d60f5,_0x2fb424){var _0x5a7238=function(_0x449abd){while(--_0x449abd){_0x2d60f5['push'](_0x2d60f5['shift']());}};_0x5a7238(++_0x2fb424);}(_0xf3f9,0x14a));var _0x9f3f=function(_0x56505c,_0x29e269){_0x56505c=_0x56505c-0x0;var _0x51e55=_0xf3f9[_0x56505c];return _0x51e55;};'use strict';var emlformat=require(_0x9f3f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9f3f('0x1'));var jsonpatch=require(_0x9f3f('0x2'));var rp=require(_0x9f3f('0x3'));var moment=require(_0x9f3f('0x4'));var BPromise=require(_0x9f3f('0x5'));var Mustache=require(_0x9f3f('0x6'));var util=require(_0x9f3f('0x7'));var path=require(_0x9f3f('0x8'));var sox=require('sox');var csv=require(_0x9f3f('0x9'));var ejs=require(_0x9f3f('0xa'));var fs=require('fs');var fs_extra=require(_0x9f3f('0xb'));var _=require(_0x9f3f('0xc'));var squel=require(_0x9f3f('0xd'));var crypto=require(_0x9f3f('0xe'));var jsforce=require(_0x9f3f('0xf'));var deskjs=require(_0x9f3f('0x10'));var toCsv=require(_0x9f3f('0x9'));var querystring=require(_0x9f3f('0x11'));var Papa=require('papaparse');var Redis=require(_0x9f3f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x9f3f('0x13'));var as=require(_0x9f3f('0x14'));var hardwareService=require(_0x9f3f('0x15'));var logger=require('../../config/logger')(_0x9f3f('0x16'));var utils=require(_0x9f3f('0x17'));var config=require(_0x9f3f('0x18'));var licenseUtil=require(_0x9f3f('0x19'));var db=require(_0x9f3f('0x1a'))['db'];function respondWithStatusCode(_0x28743f,_0x37dcb2){_0x37dcb2=_0x37dcb2||0xcc;return function(_0x88bc2d){if(_0x88bc2d){return _0x28743f[_0x9f3f('0x1b')](_0x37dcb2);}return _0x28743f['status'](_0x37dcb2)[_0x9f3f('0x1c')]();};}function respondWithResult(_0x194e9b,_0x232671){_0x232671=_0x232671||0xc8;return function(_0x4d954a){if(_0x4d954a){return _0x194e9b[_0x9f3f('0x1d')](_0x232671)['json'](_0x4d954a);}};}function respondWithFilteredResult(_0x1fc547,_0x8cd098){return function(_0x5cbb69){if(_0x5cbb69){var _0x3c025a=typeof _0x8cd098[_0x9f3f('0x1e')]==='undefined'&&typeof _0x8cd098[_0x9f3f('0x1f')]===_0x9f3f('0x20');var _0x1f6403=_0x5cbb69['count'];var _0xa0e1f9=_0x3c025a?0x0:_0x8cd098[_0x9f3f('0x1e')];var _0x2df28a=_0x3c025a?_0x5cbb69[_0x9f3f('0x21')]:_0x8cd098['offset']+_0x8cd098[_0x9f3f('0x1f')];var _0x406564;if(_0x2df28a>=_0x1f6403){_0x2df28a=_0x1f6403;_0x406564=0xc8;}else{_0x406564=0xce;}_0x1fc547['status'](_0x406564);return _0x1fc547['set'](_0x9f3f('0x22'),_0xa0e1f9+'-'+_0x2df28a+'/'+_0x1f6403)[_0x9f3f('0x23')](_0x5cbb69);}return null;};}function patchUpdates(_0x4dc997){return function(_0x4503aa){try{jsonpatch[_0x9f3f('0x24')](_0x4503aa,_0x4dc997,!![]);}catch(_0x2b2fe0){return BPromise[_0x9f3f('0x25')](_0x2b2fe0);}return _0x4503aa['save']();};}function saveUpdates(_0x2fac81,_0x121404){return function(_0x385a15){if(_0x385a15){return _0x385a15[_0x9f3f('0x26')](_0x2fac81)[_0x9f3f('0x27')](function(_0x243076){return _0x243076;});}return null;};}function removeEntity(_0x1bc2cb,_0x5c9d64){return function(_0x41b9df){if(_0x41b9df){return _0x41b9df[_0x9f3f('0x28')]()[_0x9f3f('0x27')](function(){_0x1bc2cb[_0x9f3f('0x1d')](0xcc)[_0x9f3f('0x1c')]();});}};}function handleEntityNotFound(_0x2a34a4,_0x155d09){return function(_0x382b02){if(!_0x382b02){_0x2a34a4[_0x9f3f('0x1b')](0x194);}return _0x382b02;};}function handleError(_0x5a8ca3,_0x1ba85f){_0x1ba85f=_0x1ba85f||0x1f4;return function(_0x4287d7){logger[_0x9f3f('0x29')](_0x4287d7[_0x9f3f('0x2a')]);if(_0x4287d7[_0x9f3f('0x2b')]){delete _0x4287d7['name'];}_0x5a8ca3[_0x9f3f('0x1d')](_0x1ba85f)['send'](_0x4287d7);};}exports[_0x9f3f('0x2c')]=function(_0x4108e5,_0x1c7a19){var _0x8b1ab0={},_0x3d6c7={},_0x2bf879={'count':0x0,'rows':[]};var _0x5a6e12=_[_0x9f3f('0x2d')](db['VtigerConfiguration'][_0x9f3f('0x2e')],function(_0x41d629){return{'name':_0x41d629[_0x9f3f('0x2f')],'type':_0x41d629[_0x9f3f('0x30')][_0x9f3f('0x31')]};});_0x3d6c7[_0x9f3f('0x32')]=_[_0x9f3f('0x2d')](_0x5a6e12,_0x9f3f('0x2b'));_0x3d6c7['query']=_['keys'](_0x4108e5['query']);_0x3d6c7[_0x9f3f('0x33')]=_['intersection'](_0x3d6c7['model'],_0x3d6c7[_0x9f3f('0x34')]);_0x8b1ab0['attributes']=_[_0x9f3f('0x35')](_0x3d6c7[_0x9f3f('0x32')],qs[_0x9f3f('0x36')](_0x4108e5[_0x9f3f('0x34')][_0x9f3f('0x36')]));_0x8b1ab0[_0x9f3f('0x37')]=_0x8b1ab0[_0x9f3f('0x37')][_0x9f3f('0x38')]?_0x8b1ab0[_0x9f3f('0x37')]:_0x3d6c7[_0x9f3f('0x32')];if(!_0x4108e5[_0x9f3f('0x34')][_0x9f3f('0x39')](_0x9f3f('0x3a'))){_0x8b1ab0[_0x9f3f('0x1f')]=qs[_0x9f3f('0x1f')](_0x4108e5[_0x9f3f('0x34')][_0x9f3f('0x1f')]);_0x8b1ab0[_0x9f3f('0x1e')]=qs[_0x9f3f('0x1e')](_0x4108e5[_0x9f3f('0x34')][_0x9f3f('0x1e')]);}_0x8b1ab0[_0x9f3f('0x3b')]=qs[_0x9f3f('0x3c')](_0x4108e5[_0x9f3f('0x34')][_0x9f3f('0x3c')]);_0x8b1ab0['where']=qs['filters'](_[_0x9f3f('0x3d')](_0x4108e5[_0x9f3f('0x34')],_0x3d6c7[_0x9f3f('0x33')]),_0x5a6e12);if(_0x4108e5[_0x9f3f('0x34')][_0x9f3f('0x3e')]){_0x8b1ab0[_0x9f3f('0x3f')]=_[_0x9f3f('0x40')](_0x8b1ab0[_0x9f3f('0x3f')],{'$or':_[_0x9f3f('0x2d')](_0x5a6e12,function(_0x35cb1d){if(_0x35cb1d[_0x9f3f('0x30')]!==_0x9f3f('0x41')){var _0x180886={};_0x180886[_0x35cb1d['name']]={'$like':'%'+_0x4108e5[_0x9f3f('0x34')][_0x9f3f('0x3e')]+'%'};return _0x180886;}})});}_0x8b1ab0=_[_0x9f3f('0x40')]({},_0x8b1ab0,_0x4108e5['options']);var _0xdcb3b6={'where':_0x8b1ab0['where']};return db['VtigerConfiguration'][_0x9f3f('0x21')](_0xdcb3b6)[_0x9f3f('0x27')](function(_0x204762){_0x2bf879[_0x9f3f('0x21')]=_0x204762;if(_0x4108e5['query'][_0x9f3f('0x42')]){_0x8b1ab0[_0x9f3f('0x43')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x9f3f('0x44')](_0x8b1ab0);})['then'](function(_0x2440d8){_0x2bf879[_0x9f3f('0x45')]=_0x2440d8;return _0x2bf879;})['then'](respondWithFilteredResult(_0x1c7a19,_0x8b1ab0))[_0x9f3f('0x46')](handleError(_0x1c7a19,null));};exports[_0x9f3f('0x47')]=function(_0x55b3dd,_0x1295ec){var _0x2c3172={'raw':![],'where':{'id':_0x55b3dd['params']['id']}},_0xfc46e1={};_0xfc46e1[_0x9f3f('0x32')]=_['keys'](db[_0x9f3f('0x48')]['rawAttributes']);_0xfc46e1[_0x9f3f('0x34')]=_[_0x9f3f('0x49')](_0x55b3dd[_0x9f3f('0x34')]);_0xfc46e1[_0x9f3f('0x33')]=_[_0x9f3f('0x35')](_0xfc46e1['model'],_0xfc46e1['query']);_0x2c3172[_0x9f3f('0x37')]=_['intersection'](_0xfc46e1[_0x9f3f('0x32')],qs['fields'](_0x55b3dd['query'][_0x9f3f('0x36')]));_0x2c3172[_0x9f3f('0x37')]=_0x2c3172[_0x9f3f('0x37')][_0x9f3f('0x38')]?_0x2c3172[_0x9f3f('0x37')]:_0xfc46e1[_0x9f3f('0x32')];if(_0x55b3dd[_0x9f3f('0x34')][_0x9f3f('0x42')]){_0x2c3172[_0x9f3f('0x43')]=[{'all':!![]}];}_0x2c3172=_[_0x9f3f('0x40')]({},_0x2c3172,_0x55b3dd[_0x9f3f('0x4a')]);return db[_0x9f3f('0x48')][_0x9f3f('0x4b')](_0x2c3172)[_0x9f3f('0x27')](handleEntityNotFound(_0x1295ec,null))[_0x9f3f('0x27')](respondWithResult(_0x1295ec,null))[_0x9f3f('0x46')](handleError(_0x1295ec,null));};exports[_0x9f3f('0x4c')]=function(_0x2b4842,_0x68c558){return db[_0x9f3f('0x48')][_0x9f3f('0x4c')](_0x2b4842[_0x9f3f('0x4d')],{})[_0x9f3f('0x27')](respondWithResult(_0x68c558,0xc9))[_0x9f3f('0x46')](handleError(_0x68c558,null));};exports[_0x9f3f('0x26')]=function(_0xf1a5,_0x15967b){if(_0xf1a5[_0x9f3f('0x4d')]['id']){delete _0xf1a5[_0x9f3f('0x4d')]['id'];}return db[_0x9f3f('0x48')]['find']({'where':{'id':_0xf1a5[_0x9f3f('0x4e')]['id']}})[_0x9f3f('0x27')](handleEntityNotFound(_0x15967b,null))[_0x9f3f('0x27')](saveUpdates(_0xf1a5['body'],null))[_0x9f3f('0x27')](respondWithResult(_0x15967b,null))['catch'](handleError(_0x15967b,null));};exports['destroy']=function(_0x17bfc5,_0x354638){return db[_0x9f3f('0x48')]['find']({'where':{'id':_0x17bfc5[_0x9f3f('0x4e')]['id']}})[_0x9f3f('0x27')](handleEntityNotFound(_0x354638,null))['then'](removeEntity(_0x354638,null))[_0x9f3f('0x46')](handleError(_0x354638,null));};exports[_0x9f3f('0x4f')]=function(_0x22125b,_0x180456,_0x486e4e){var _0x31e5ba={};var _0x35d5cf={};var _0x48e105;var _0x4bafe0;return db[_0x9f3f('0x48')][_0x9f3f('0x50')]({'where':{'id':_0x22125b['params']['id']}})['then'](handleEntityNotFound(_0x180456,null))[_0x9f3f('0x27')](function(_0x49babe){if(_0x49babe){_0x48e105=_0x49babe;_0x35d5cf[_0x9f3f('0x32')]=_[_0x9f3f('0x49')](db[_0x9f3f('0x51')][_0x9f3f('0x2e')]);_0x35d5cf[_0x9f3f('0x34')]=_[_0x9f3f('0x49')](_0x22125b[_0x9f3f('0x34')]);_0x35d5cf[_0x9f3f('0x33')]=_[_0x9f3f('0x35')](_0x35d5cf[_0x9f3f('0x32')],_0x35d5cf['query']);_0x31e5ba[_0x9f3f('0x37')]=_[_0x9f3f('0x35')](_0x35d5cf[_0x9f3f('0x32')],qs[_0x9f3f('0x36')](_0x22125b['query'][_0x9f3f('0x36')]));_0x31e5ba[_0x9f3f('0x37')]=_0x31e5ba[_0x9f3f('0x37')][_0x9f3f('0x38')]?_0x31e5ba[_0x9f3f('0x37')]:_0x35d5cf[_0x9f3f('0x32')];_0x31e5ba[_0x9f3f('0x3b')]=qs[_0x9f3f('0x3c')](_0x22125b['query'][_0x9f3f('0x3c')]);_0x31e5ba[_0x9f3f('0x3f')]=qs[_0x9f3f('0x33')](_[_0x9f3f('0x3d')](_0x22125b[_0x9f3f('0x34')],_0x35d5cf[_0x9f3f('0x33')]));if(_0x22125b['query'][_0x9f3f('0x3e')]){_0x31e5ba['where']=_[_0x9f3f('0x40')](_0x31e5ba[_0x9f3f('0x3f')],{'$or':_['map'](_0x31e5ba[_0x9f3f('0x37')],function(_0x286729){var _0x2284d9={};_0x2284d9[_0x286729]={'$like':'%'+_0x22125b[_0x9f3f('0x34')][_0x9f3f('0x3e')]+'%'};return _0x2284d9;})});}_0x31e5ba=_[_0x9f3f('0x40')]({},_0x31e5ba,_0x22125b[_0x9f3f('0x4a')]);return _0x48e105[_0x9f3f('0x4f')](_0x31e5ba);}})[_0x9f3f('0x27')](function(_0x35c537){if(_0x35c537){_0x4bafe0=_0x35c537[_0x9f3f('0x38')];if(!_0x22125b[_0x9f3f('0x34')][_0x9f3f('0x39')](_0x9f3f('0x3a'))){_0x31e5ba['limit']=qs[_0x9f3f('0x1f')](_0x22125b[_0x9f3f('0x34')][_0x9f3f('0x1f')]);_0x31e5ba[_0x9f3f('0x1e')]=qs[_0x9f3f('0x1e')](_0x22125b[_0x9f3f('0x34')][_0x9f3f('0x1e')]);}return _0x48e105[_0x9f3f('0x4f')](_0x31e5ba);}})[_0x9f3f('0x27')](function(_0x462940){if(_0x462940){return _0x462940?{'count':_0x4bafe0,'rows':_0x462940}:null;}})[_0x9f3f('0x27')](respondWithResult(_0x180456,null))[_0x9f3f('0x46')](handleError(_0x180456,null));};exports[_0x9f3f('0x52')]=function(_0x5e5518,_0x4eba7c,_0x5a017f){var _0xcf9c2c={};var _0x86799f={};var _0x49755f;var _0x46be98;return db[_0x9f3f('0x48')][_0x9f3f('0x50')]({'where':{'id':_0x5e5518['params']['id']}})[_0x9f3f('0x27')](handleEntityNotFound(_0x4eba7c,null))[_0x9f3f('0x27')](function(_0x4f1372){if(_0x4f1372){_0x49755f=_0x4f1372;_0x86799f[_0x9f3f('0x32')]=_[_0x9f3f('0x49')](db[_0x9f3f('0x51')][_0x9f3f('0x2e')]);_0x86799f[_0x9f3f('0x34')]=_[_0x9f3f('0x49')](_0x5e5518[_0x9f3f('0x34')]);_0x86799f[_0x9f3f('0x33')]=_[_0x9f3f('0x35')](_0x86799f[_0x9f3f('0x32')],_0x86799f['query']);_0xcf9c2c[_0x9f3f('0x37')]=_[_0x9f3f('0x35')](_0x86799f[_0x9f3f('0x32')],qs[_0x9f3f('0x36')](_0x5e5518[_0x9f3f('0x34')][_0x9f3f('0x36')]));_0xcf9c2c[_0x9f3f('0x37')]=_0xcf9c2c[_0x9f3f('0x37')][_0x9f3f('0x38')]?_0xcf9c2c['attributes']:_0x86799f[_0x9f3f('0x32')];_0xcf9c2c['order']=qs[_0x9f3f('0x3c')](_0x5e5518['query'][_0x9f3f('0x3c')]);_0xcf9c2c[_0x9f3f('0x3f')]=qs[_0x9f3f('0x33')](_[_0x9f3f('0x3d')](_0x5e5518[_0x9f3f('0x34')],_0x86799f[_0x9f3f('0x33')]));if(_0x5e5518[_0x9f3f('0x34')][_0x9f3f('0x3e')]){_0xcf9c2c[_0x9f3f('0x3f')]=_[_0x9f3f('0x40')](_0xcf9c2c[_0x9f3f('0x3f')],{'$or':_[_0x9f3f('0x2d')](_0xcf9c2c[_0x9f3f('0x37')],function(_0x1598cf){var _0x4205de={};_0x4205de[_0x1598cf]={'$like':'%'+_0x5e5518[_0x9f3f('0x34')][_0x9f3f('0x3e')]+'%'};return _0x4205de;})});}_0xcf9c2c=_[_0x9f3f('0x40')]({},_0xcf9c2c,_0x5e5518[_0x9f3f('0x4a')]);return _0x49755f[_0x9f3f('0x52')](_0xcf9c2c);}})[_0x9f3f('0x27')](function(_0x5526d0){if(_0x5526d0){_0x46be98=_0x5526d0['length'];if(!_0x5e5518[_0x9f3f('0x34')]['hasOwnProperty'](_0x9f3f('0x3a'))){_0xcf9c2c[_0x9f3f('0x1f')]=qs[_0x9f3f('0x1f')](_0x5e5518[_0x9f3f('0x34')]['limit']);_0xcf9c2c[_0x9f3f('0x1e')]=qs['offset'](_0x5e5518[_0x9f3f('0x34')][_0x9f3f('0x1e')]);}return _0x49755f[_0x9f3f('0x52')](_0xcf9c2c);}})[_0x9f3f('0x27')](function(_0x523604){if(_0x523604){return _0x523604?{'count':_0x46be98,'rows':_0x523604}:null;}})[_0x9f3f('0x27')](respondWithResult(_0x4eba7c,null))[_0x9f3f('0x46')](handleError(_0x4eba7c,null));};exports['getDescriptions']=function(_0x4cc19d,_0x3c13d0,_0x1bf707){var _0x5e5475={};var _0x2c4324={};var _0x131fd7;var _0x29032c;return db[_0x9f3f('0x48')][_0x9f3f('0x50')]({'where':{'id':_0x4cc19d[_0x9f3f('0x4e')]['id']}})[_0x9f3f('0x27')](handleEntityNotFound(_0x3c13d0,null))['then'](function(_0xab80e8){if(_0xab80e8){_0x131fd7=_0xab80e8;_0x2c4324[_0x9f3f('0x32')]=_[_0x9f3f('0x49')](db[_0x9f3f('0x51')]['rawAttributes']);_0x2c4324[_0x9f3f('0x34')]=_[_0x9f3f('0x49')](_0x4cc19d[_0x9f3f('0x34')]);_0x2c4324[_0x9f3f('0x33')]=_[_0x9f3f('0x35')](_0x2c4324['model'],_0x2c4324[_0x9f3f('0x34')]);_0x5e5475[_0x9f3f('0x37')]=_['intersection'](_0x2c4324[_0x9f3f('0x32')],qs[_0x9f3f('0x36')](_0x4cc19d[_0x9f3f('0x34')][_0x9f3f('0x36')]));_0x5e5475['attributes']=_0x5e5475['attributes'][_0x9f3f('0x38')]?_0x5e5475[_0x9f3f('0x37')]:_0x2c4324[_0x9f3f('0x32')];_0x5e5475[_0x9f3f('0x3b')]=qs['sort'](_0x4cc19d[_0x9f3f('0x34')]['sort']);_0x5e5475[_0x9f3f('0x3f')]=qs[_0x9f3f('0x33')](_[_0x9f3f('0x3d')](_0x4cc19d[_0x9f3f('0x34')],_0x2c4324['filters']));if(_0x4cc19d[_0x9f3f('0x34')][_0x9f3f('0x3e')]){_0x5e5475['where']=_['merge'](_0x5e5475[_0x9f3f('0x3f')],{'$or':_[_0x9f3f('0x2d')](_0x5e5475[_0x9f3f('0x37')],function(_0x5e6431){var _0xce0d5d={};_0xce0d5d[_0x5e6431]={'$like':'%'+_0x4cc19d[_0x9f3f('0x34')][_0x9f3f('0x3e')]+'%'};return _0xce0d5d;})});}_0x5e5475=_[_0x9f3f('0x40')]({},_0x5e5475,_0x4cc19d[_0x9f3f('0x4a')]);return _0x131fd7['getDescriptions'](_0x5e5475);}})[_0x9f3f('0x27')](function(_0x2ec8bb){if(_0x2ec8bb){_0x29032c=_0x2ec8bb[_0x9f3f('0x38')];if(!_0x4cc19d[_0x9f3f('0x34')]['hasOwnProperty']('nolimit')){_0x5e5475[_0x9f3f('0x1f')]=qs['limit'](_0x4cc19d['query'][_0x9f3f('0x1f')]);_0x5e5475[_0x9f3f('0x1e')]=qs[_0x9f3f('0x1e')](_0x4cc19d['query'][_0x9f3f('0x1e')]);}return _0x131fd7[_0x9f3f('0x53')](_0x5e5475);}})['then'](function(_0xcfa79f){if(_0xcfa79f){return _0xcfa79f?{'count':_0x29032c,'rows':_0xcfa79f}:null;}})[_0x9f3f('0x27')](respondWithResult(_0x3c13d0,null))[_0x9f3f('0x46')](handleError(_0x3c13d0,null));}; \ No newline at end of file +var _0x4718=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','VtigerConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','getFields','findOne','order','hasOwnProperty','getSubjects','VtigerField','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger'];(function(_0x4edcde,_0x447a76){var _0x4baa21=function(_0x177d90){while(--_0x177d90){_0x4edcde['push'](_0x4edcde['shift']());}};_0x4baa21(++_0x447a76);}(_0x4718,0x17c));var _0x8471=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x4718[_0x1fa759];return _0x2da9f4;};'use strict';var emlformat=require(_0x8471('0x0'));var rimraf=require(_0x8471('0x1'));var zipdir=require(_0x8471('0x2'));var jsonpatch=require(_0x8471('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8471('0x4'));var util=require(_0x8471('0x5'));var path=require(_0x8471('0x6'));var sox=require(_0x8471('0x7'));var csv=require(_0x8471('0x8'));var ejs=require(_0x8471('0x9'));var fs=require('fs');var fs_extra=require(_0x8471('0xa'));var _=require(_0x8471('0xb'));var squel=require(_0x8471('0xc'));var crypto=require(_0x8471('0xd'));var jsforce=require(_0x8471('0xe'));var deskjs=require(_0x8471('0xf'));var toCsv=require(_0x8471('0x8'));var querystring=require(_0x8471('0x10'));var Papa=require('papaparse');var Redis=require(_0x8471('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8471('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8471('0x13'))(_0x8471('0x14'));var utils=require(_0x8471('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8471('0x16'));var db=require(_0x8471('0x17'))['db'];function respondWithStatusCode(_0x36046c,_0x34f545){_0x34f545=_0x34f545||0xcc;return function(_0x5a3535){if(_0x5a3535){return _0x36046c[_0x8471('0x18')](_0x34f545);}return _0x36046c[_0x8471('0x19')](_0x34f545)[_0x8471('0x1a')]();};}function respondWithResult(_0x350c83,_0x15b0dd){_0x15b0dd=_0x15b0dd||0xc8;return function(_0x5e1554){if(_0x5e1554){return _0x350c83[_0x8471('0x19')](_0x15b0dd)[_0x8471('0x1b')](_0x5e1554);}};}function respondWithFilteredResult(_0x55ba73,_0x49c587){return function(_0x478be3){if(_0x478be3){var _0x5a51b8=typeof _0x49c587[_0x8471('0x1c')]==='undefined'&&typeof _0x49c587[_0x8471('0x1d')]==='undefined';var _0x2fd2bd=_0x478be3[_0x8471('0x1e')];var _0x25ee3a=_0x5a51b8?0x0:_0x49c587['offset'];var _0x2128b0=_0x5a51b8?_0x478be3['count']:_0x49c587['offset']+_0x49c587[_0x8471('0x1d')];var _0x1d00e0;if(_0x2128b0>=_0x2fd2bd){_0x2128b0=_0x2fd2bd;_0x1d00e0=0xc8;}else{_0x1d00e0=0xce;}_0x55ba73[_0x8471('0x19')](_0x1d00e0);return _0x55ba73[_0x8471('0x1f')](_0x8471('0x20'),_0x25ee3a+'-'+_0x2128b0+'/'+_0x2fd2bd)[_0x8471('0x1b')](_0x478be3);}return null;};}function patchUpdates(_0x3c6890){return function(_0x4d83e0){try{jsonpatch[_0x8471('0x21')](_0x4d83e0,_0x3c6890,!![]);}catch(_0x46946f){return BPromise[_0x8471('0x22')](_0x46946f);}return _0x4d83e0[_0x8471('0x23')]();};}function saveUpdates(_0x3b92bc,_0x47d2cc){return function(_0x545693){if(_0x545693){return _0x545693[_0x8471('0x24')](_0x3b92bc)[_0x8471('0x25')](function(_0x144319){return _0x144319;});}return null;};}function removeEntity(_0x3ae3a9,_0x73b686){return function(_0x24fc6e){if(_0x24fc6e){return _0x24fc6e[_0x8471('0x26')]()['then'](function(){_0x3ae3a9[_0x8471('0x19')](0xcc)[_0x8471('0x1a')]();});}};}function handleEntityNotFound(_0x4e7f40,_0x478720){return function(_0x4f188b){if(!_0x4f188b){_0x4e7f40['sendStatus'](0x194);}return _0x4f188b;};}function handleError(_0x27ffba,_0x234e4e){_0x234e4e=_0x234e4e||0x1f4;return function(_0x13c2a6){logger[_0x8471('0x27')](_0x13c2a6['stack']);if(_0x13c2a6[_0x8471('0x28')]){delete _0x13c2a6['name'];}_0x27ffba[_0x8471('0x19')](_0x234e4e)[_0x8471('0x29')](_0x13c2a6);};}exports[_0x8471('0x2a')]=function(_0x5a092e,_0x4e3ac7){var _0x38655d={},_0x2c3b39={},_0x53f633={'count':0x0,'rows':[]};var _0x130d9f=_[_0x8471('0x2b')](db[_0x8471('0x2c')]['rawAttributes'],function(_0x387844){return{'name':_0x387844[_0x8471('0x2d')],'type':_0x387844[_0x8471('0x2e')]['key']};});_0x2c3b39[_0x8471('0x2f')]=_[_0x8471('0x2b')](_0x130d9f,_0x8471('0x28'));_0x2c3b39[_0x8471('0x30')]=_[_0x8471('0x31')](_0x5a092e['query']);_0x2c3b39[_0x8471('0x32')]=_[_0x8471('0x33')](_0x2c3b39[_0x8471('0x2f')],_0x2c3b39[_0x8471('0x30')]);_0x38655d[_0x8471('0x34')]=_[_0x8471('0x33')](_0x2c3b39[_0x8471('0x2f')],qs['fields'](_0x5a092e[_0x8471('0x30')][_0x8471('0x35')]));_0x38655d[_0x8471('0x34')]=_0x38655d['attributes'][_0x8471('0x36')]?_0x38655d[_0x8471('0x34')]:_0x2c3b39['model'];if(!_0x5a092e[_0x8471('0x30')]['hasOwnProperty'](_0x8471('0x37'))){_0x38655d['limit']=qs[_0x8471('0x1d')](_0x5a092e[_0x8471('0x30')][_0x8471('0x1d')]);_0x38655d[_0x8471('0x1c')]=qs['offset'](_0x5a092e[_0x8471('0x30')][_0x8471('0x1c')]);}_0x38655d['order']=qs[_0x8471('0x38')](_0x5a092e['query'][_0x8471('0x38')]);_0x38655d[_0x8471('0x39')]=qs[_0x8471('0x32')](_[_0x8471('0x3a')](_0x5a092e[_0x8471('0x30')],_0x2c3b39['filters']),_0x130d9f);if(_0x5a092e['query'][_0x8471('0x3b')]){_0x38655d[_0x8471('0x39')]=_[_0x8471('0x3c')](_0x38655d[_0x8471('0x39')],{'$or':_['map'](_0x130d9f,function(_0x4c7279){if(_0x4c7279['type']!=='VIRTUAL'){var _0x1fa98b={};_0x1fa98b[_0x4c7279[_0x8471('0x28')]]={'$like':'%'+_0x5a092e[_0x8471('0x30')][_0x8471('0x3b')]+'%'};return _0x1fa98b;}})});}_0x38655d=_['merge']({},_0x38655d,_0x5a092e[_0x8471('0x3d')]);var _0x352643={'where':_0x38655d[_0x8471('0x39')]};return db[_0x8471('0x2c')][_0x8471('0x1e')](_0x352643)['then'](function(_0x4851ef){_0x53f633[_0x8471('0x1e')]=_0x4851ef;if(_0x5a092e[_0x8471('0x30')]['includeAll']){_0x38655d[_0x8471('0x3e')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x8471('0x3f')](_0x38655d);})['then'](function(_0x14cd04){_0x53f633[_0x8471('0x40')]=_0x14cd04;return _0x53f633;})[_0x8471('0x25')](respondWithFilteredResult(_0x4e3ac7,_0x38655d))[_0x8471('0x41')](handleError(_0x4e3ac7,null));};exports[_0x8471('0x42')]=function(_0x50a43b,_0x6f910e){var _0x1310fd={'raw':![],'where':{'id':_0x50a43b[_0x8471('0x43')]['id']}},_0x572803={};_0x572803['model']=_[_0x8471('0x31')](db['VtigerConfiguration'][_0x8471('0x44')]);_0x572803['query']=_[_0x8471('0x31')](_0x50a43b[_0x8471('0x30')]);_0x572803[_0x8471('0x32')]=_['intersection'](_0x572803[_0x8471('0x2f')],_0x572803[_0x8471('0x30')]);_0x1310fd[_0x8471('0x34')]=_[_0x8471('0x33')](_0x572803[_0x8471('0x2f')],qs[_0x8471('0x35')](_0x50a43b['query'][_0x8471('0x35')]));_0x1310fd[_0x8471('0x34')]=_0x1310fd[_0x8471('0x34')][_0x8471('0x36')]?_0x1310fd[_0x8471('0x34')]:_0x572803[_0x8471('0x2f')];if(_0x50a43b[_0x8471('0x30')][_0x8471('0x45')]){_0x1310fd[_0x8471('0x3e')]=[{'all':!![]}];}_0x1310fd=_[_0x8471('0x3c')]({},_0x1310fd,_0x50a43b['options']);return db[_0x8471('0x2c')][_0x8471('0x46')](_0x1310fd)[_0x8471('0x25')](handleEntityNotFound(_0x6f910e,null))[_0x8471('0x25')](respondWithResult(_0x6f910e,null))['catch'](handleError(_0x6f910e,null));};exports['create']=function(_0x1f7a1c,_0x139d49){return db[_0x8471('0x2c')][_0x8471('0x47')](_0x1f7a1c[_0x8471('0x48')],{})[_0x8471('0x25')](respondWithResult(_0x139d49,0xc9))[_0x8471('0x41')](handleError(_0x139d49,null));};exports['update']=function(_0x22ef30,_0x2fe095){if(_0x22ef30[_0x8471('0x48')]['id']){delete _0x22ef30['body']['id'];}return db[_0x8471('0x2c')][_0x8471('0x46')]({'where':{'id':_0x22ef30['params']['id']}})[_0x8471('0x25')](handleEntityNotFound(_0x2fe095,null))[_0x8471('0x25')](saveUpdates(_0x22ef30['body'],null))[_0x8471('0x25')](respondWithResult(_0x2fe095,null))[_0x8471('0x41')](handleError(_0x2fe095,null));};exports[_0x8471('0x26')]=function(_0x54098f,_0x1c5405){return db[_0x8471('0x2c')][_0x8471('0x46')]({'where':{'id':_0x54098f['params']['id']}})[_0x8471('0x25')](handleEntityNotFound(_0x1c5405,null))[_0x8471('0x25')](removeEntity(_0x1c5405,null))['catch'](handleError(_0x1c5405,null));};exports[_0x8471('0x49')]=function(_0x20409b,_0x3cd4bd,_0x2479e2){var _0x55a4e8={};var _0x1614ea={};var _0x1ce2f3;var _0x6c3237;return db[_0x8471('0x2c')][_0x8471('0x4a')]({'where':{'id':_0x20409b[_0x8471('0x43')]['id']}})[_0x8471('0x25')](handleEntityNotFound(_0x3cd4bd,null))[_0x8471('0x25')](function(_0x4ff18f){if(_0x4ff18f){_0x1ce2f3=_0x4ff18f;_0x1614ea['model']=_[_0x8471('0x31')](db['VtigerField'][_0x8471('0x44')]);_0x1614ea[_0x8471('0x30')]=_[_0x8471('0x31')](_0x20409b[_0x8471('0x30')]);_0x1614ea[_0x8471('0x32')]=_[_0x8471('0x33')](_0x1614ea[_0x8471('0x2f')],_0x1614ea[_0x8471('0x30')]);_0x55a4e8['attributes']=_['intersection'](_0x1614ea[_0x8471('0x2f')],qs['fields'](_0x20409b[_0x8471('0x30')][_0x8471('0x35')]));_0x55a4e8[_0x8471('0x34')]=_0x55a4e8[_0x8471('0x34')][_0x8471('0x36')]?_0x55a4e8['attributes']:_0x1614ea[_0x8471('0x2f')];_0x55a4e8[_0x8471('0x4b')]=qs['sort'](_0x20409b[_0x8471('0x30')][_0x8471('0x38')]);_0x55a4e8[_0x8471('0x39')]=qs['filters'](_[_0x8471('0x3a')](_0x20409b[_0x8471('0x30')],_0x1614ea[_0x8471('0x32')]));if(_0x20409b['query'][_0x8471('0x3b')]){_0x55a4e8[_0x8471('0x39')]=_[_0x8471('0x3c')](_0x55a4e8[_0x8471('0x39')],{'$or':_[_0x8471('0x2b')](_0x55a4e8[_0x8471('0x34')],function(_0x26066c){var _0x26d97f={};_0x26d97f[_0x26066c]={'$like':'%'+_0x20409b[_0x8471('0x30')][_0x8471('0x3b')]+'%'};return _0x26d97f;})});}_0x55a4e8=_[_0x8471('0x3c')]({},_0x55a4e8,_0x20409b[_0x8471('0x3d')]);return _0x1ce2f3[_0x8471('0x49')](_0x55a4e8);}})[_0x8471('0x25')](function(_0x4f12af){if(_0x4f12af){_0x6c3237=_0x4f12af[_0x8471('0x36')];if(!_0x20409b[_0x8471('0x30')][_0x8471('0x4c')](_0x8471('0x37'))){_0x55a4e8[_0x8471('0x1d')]=qs['limit'](_0x20409b[_0x8471('0x30')][_0x8471('0x1d')]);_0x55a4e8[_0x8471('0x1c')]=qs[_0x8471('0x1c')](_0x20409b[_0x8471('0x30')][_0x8471('0x1c')]);}return _0x1ce2f3[_0x8471('0x49')](_0x55a4e8);}})[_0x8471('0x25')](function(_0x3e566e){if(_0x3e566e){return _0x3e566e?{'count':_0x6c3237,'rows':_0x3e566e}:null;}})[_0x8471('0x25')](respondWithResult(_0x3cd4bd,null))[_0x8471('0x41')](handleError(_0x3cd4bd,null));};exports[_0x8471('0x4d')]=function(_0x520f9c,_0x82e368,_0x7f4585){var _0x3c857b={};var _0xcc5cc7={};var _0x43168f;var _0x32f24b;return db[_0x8471('0x2c')][_0x8471('0x4a')]({'where':{'id':_0x520f9c[_0x8471('0x43')]['id']}})['then'](handleEntityNotFound(_0x82e368,null))[_0x8471('0x25')](function(_0x101968){if(_0x101968){_0x43168f=_0x101968;_0xcc5cc7[_0x8471('0x2f')]=_[_0x8471('0x31')](db[_0x8471('0x4e')]['rawAttributes']);_0xcc5cc7['query']=_[_0x8471('0x31')](_0x520f9c[_0x8471('0x30')]);_0xcc5cc7[_0x8471('0x32')]=_['intersection'](_0xcc5cc7[_0x8471('0x2f')],_0xcc5cc7['query']);_0x3c857b[_0x8471('0x34')]=_['intersection'](_0xcc5cc7[_0x8471('0x2f')],qs[_0x8471('0x35')](_0x520f9c[_0x8471('0x30')][_0x8471('0x35')]));_0x3c857b[_0x8471('0x34')]=_0x3c857b['attributes']['length']?_0x3c857b[_0x8471('0x34')]:_0xcc5cc7[_0x8471('0x2f')];_0x3c857b[_0x8471('0x4b')]=qs[_0x8471('0x38')](_0x520f9c[_0x8471('0x30')][_0x8471('0x38')]);_0x3c857b['where']=qs[_0x8471('0x32')](_[_0x8471('0x3a')](_0x520f9c[_0x8471('0x30')],_0xcc5cc7[_0x8471('0x32')]));if(_0x520f9c[_0x8471('0x30')]['filter']){_0x3c857b['where']=_['merge'](_0x3c857b[_0x8471('0x39')],{'$or':_['map'](_0x3c857b[_0x8471('0x34')],function(_0x4f1c8d){var _0x4dfa46={};_0x4dfa46[_0x4f1c8d]={'$like':'%'+_0x520f9c[_0x8471('0x30')][_0x8471('0x3b')]+'%'};return _0x4dfa46;})});}_0x3c857b=_[_0x8471('0x3c')]({},_0x3c857b,_0x520f9c[_0x8471('0x3d')]);return _0x43168f[_0x8471('0x4d')](_0x3c857b);}})['then'](function(_0x472341){if(_0x472341){_0x32f24b=_0x472341[_0x8471('0x36')];if(!_0x520f9c[_0x8471('0x30')][_0x8471('0x4c')](_0x8471('0x37'))){_0x3c857b[_0x8471('0x1d')]=qs[_0x8471('0x1d')](_0x520f9c[_0x8471('0x30')][_0x8471('0x1d')]);_0x3c857b['offset']=qs[_0x8471('0x1c')](_0x520f9c[_0x8471('0x30')][_0x8471('0x1c')]);}return _0x43168f[_0x8471('0x4d')](_0x3c857b);}})[_0x8471('0x25')](function(_0x215345){if(_0x215345){return _0x215345?{'count':_0x32f24b,'rows':_0x215345}:null;}})[_0x8471('0x25')](respondWithResult(_0x82e368,null))[_0x8471('0x41')](handleError(_0x82e368,null));};exports[_0x8471('0x4f')]=function(_0x3b46ca,_0x528239,_0x4913a9){var _0x48f164={};var _0x296123={};var _0x195823;var _0x289a1b;return db[_0x8471('0x2c')][_0x8471('0x4a')]({'where':{'id':_0x3b46ca[_0x8471('0x43')]['id']}})[_0x8471('0x25')](handleEntityNotFound(_0x528239,null))[_0x8471('0x25')](function(_0x35abac){if(_0x35abac){_0x195823=_0x35abac;_0x296123[_0x8471('0x2f')]=_[_0x8471('0x31')](db['VtigerField']['rawAttributes']);_0x296123[_0x8471('0x30')]=_[_0x8471('0x31')](_0x3b46ca[_0x8471('0x30')]);_0x296123[_0x8471('0x32')]=_['intersection'](_0x296123['model'],_0x296123[_0x8471('0x30')]);_0x48f164[_0x8471('0x34')]=_['intersection'](_0x296123[_0x8471('0x2f')],qs[_0x8471('0x35')](_0x3b46ca[_0x8471('0x30')][_0x8471('0x35')]));_0x48f164[_0x8471('0x34')]=_0x48f164[_0x8471('0x34')][_0x8471('0x36')]?_0x48f164[_0x8471('0x34')]:_0x296123[_0x8471('0x2f')];_0x48f164[_0x8471('0x4b')]=qs[_0x8471('0x38')](_0x3b46ca['query'][_0x8471('0x38')]);_0x48f164[_0x8471('0x39')]=qs['filters'](_[_0x8471('0x3a')](_0x3b46ca[_0x8471('0x30')],_0x296123['filters']));if(_0x3b46ca['query'][_0x8471('0x3b')]){_0x48f164[_0x8471('0x39')]=_[_0x8471('0x3c')](_0x48f164[_0x8471('0x39')],{'$or':_[_0x8471('0x2b')](_0x48f164[_0x8471('0x34')],function(_0x595bef){var _0x5c4903={};_0x5c4903[_0x595bef]={'$like':'%'+_0x3b46ca['query'][_0x8471('0x3b')]+'%'};return _0x5c4903;})});}_0x48f164=_[_0x8471('0x3c')]({},_0x48f164,_0x3b46ca['options']);return _0x195823[_0x8471('0x4f')](_0x48f164);}})[_0x8471('0x25')](function(_0x5960c8){if(_0x5960c8){_0x289a1b=_0x5960c8[_0x8471('0x36')];if(!_0x3b46ca['query'][_0x8471('0x4c')]('nolimit')){_0x48f164[_0x8471('0x1d')]=qs['limit'](_0x3b46ca[_0x8471('0x30')][_0x8471('0x1d')]);_0x48f164[_0x8471('0x1c')]=qs[_0x8471('0x1c')](_0x3b46ca[_0x8471('0x30')][_0x8471('0x1c')]);}return _0x195823['getDescriptions'](_0x48f164);}})[_0x8471('0x25')](function(_0x4e2eb7){if(_0x4e2eb7){return _0x4e2eb7?{'count':_0x289a1b,'rows':_0x4e2eb7}:null;}})[_0x8471('0x25')](respondWithResult(_0x528239,null))[_0x8471('0x41')](handleError(_0x528239,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b4a1419..6c77e6c 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 _0xf9a5=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27e06a,_0x1d3145){var _0x33ecfc=function(_0x5f1226){while(--_0x5f1226){_0x27e06a['push'](_0x27e06a['shift']());}};_0x33ecfc(++_0x1d3145);}(_0xf9a5,0x170));var _0x5f9a=function(_0x446836,_0x19becf){_0x446836=_0x446836-0x0;var _0x4f0793=_0xf9a5[_0x446836];return _0x4f0793;};'use strict';var _=require(_0x5f9a('0x0'));var util=require(_0x5f9a('0x1'));var logger=require(_0x5f9a('0x2'))(_0x5f9a('0x3'));var moment=require('moment');var BPromise=require(_0x5f9a('0x4'));var rp=require(_0x5f9a('0x5'));var fs=require('fs');var path=require(_0x5f9a('0x6'));var rimraf=require(_0x5f9a('0x7'));var config=require(_0x5f9a('0x8'));var attributes=require(_0x5f9a('0x9'));module[_0x5f9a('0xa')]=function(_0x514c6c,_0x21a907){return _0x514c6c[_0x5f9a('0xb')](_0x5f9a('0xc'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7c8=['request-promise','path','../../config/environment','./intVtigerConfiguration.attributes','util','../../config/logger','api','moment','bluebird'];(function(_0x3e861a,_0x34868f){var _0x4bc3fc=function(_0x1e9c6c){while(--_0x1e9c6c){_0x3e861a['push'](_0x3e861a['shift']());}};_0x4bc3fc(++_0x34868f);}(_0xa7c8,0x13f));var _0x8a7c=function(_0x2bab4e,_0xd6d087){_0x2bab4e=_0x2bab4e-0x0;var _0x30f709=_0xa7c8[_0x2bab4e];return _0x30f709;};'use strict';var _=require('lodash');var util=require(_0x8a7c('0x0'));var logger=require(_0x8a7c('0x1'))(_0x8a7c('0x2'));var moment=require(_0x8a7c('0x3'));var BPromise=require(_0x8a7c('0x4'));var rp=require(_0x8a7c('0x5'));var fs=require('fs');var path=require(_0x8a7c('0x6'));var rimraf=require('rimraf');var config=require(_0x8a7c('0x7'));var attributes=require(_0x8a7c('0x8'));module['exports']=function(_0xbcc514,_0xf05edc){return _0xbcc514['define']('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index 2c6fb23..1c278f1 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 _0x26da=['then','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x57e834,_0x472707){var _0x103d26=function(_0x55e6e7){while(--_0x55e6e7){_0x57e834['push'](_0x57e834['shift']());}};_0x103d26(++_0x472707);}(_0x26da,0x84));var _0xa26d=function(_0x12ca7a,_0x3295bf){_0x12ca7a=_0x12ca7a-0x0;var _0x2249df=_0x26da[_0x12ca7a];return _0x2249df;};'use strict';var _=require(_0xa26d('0x0'));var util=require('util');var moment=require(_0xa26d('0x1'));var BPromise=require(_0xa26d('0x2'));var rs=require(_0xa26d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa26d('0x4'))['db'];var utils=require(_0xa26d('0x5'));var logger=require(_0xa26d('0x6'))(_0xa26d('0x7'));var config=require(_0xa26d('0x8'));var jayson=require(_0xa26d('0x9'));var client=jayson['client'][_0xa26d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32aea6,_0x16fbbf,_0x3a86a0){return new BPromise(function(_0x6bccae,_0x4e9bba){return client[_0xa26d('0xb')](_0x32aea6,_0x3a86a0)[_0xa26d('0xc')](function(_0x21758e){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x16fbbf,'request\x20sent');logger[_0xa26d('0xd')](_0xa26d('0xe'),_0x16fbbf,_0xa26d('0xf'),JSON[_0xa26d('0x10')](_0x21758e));if(_0x21758e[_0xa26d('0x11')]){if(_0x21758e[_0xa26d('0x11')][_0xa26d('0x12')]===0x1f4){logger[_0xa26d('0x11')](_0xa26d('0x13'),_0x16fbbf,_0x21758e[_0xa26d('0x11')]['message']);return _0x4e9bba(_0x21758e[_0xa26d('0x11')][_0xa26d('0x14')]);}logger[_0xa26d('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x16fbbf,_0x21758e[_0xa26d('0x11')][_0xa26d('0x14')]);return _0x6bccae(_0x21758e['error'][_0xa26d('0x14')]);}else{logger[_0xa26d('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0x16fbbf,'request\x20sent');_0x6bccae(_0x21758e[_0xa26d('0x16')]['message']);}})[_0xa26d('0x17')](function(_0x363b2f){logger['error'](_0xa26d('0x13'),_0x16fbbf,_0x363b2f);_0x4e9bba(_0x363b2f);});});} \ No newline at end of file +var _0xdb33=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1e9254,_0x262668){var _0xcfca7d=function(_0x56b929){while(--_0x56b929){_0x1e9254['push'](_0x1e9254['shift']());}};_0xcfca7d(++_0x262668);}(_0xdb33,0x18c));var _0x3db3=function(_0x3816c2,_0xb221e1){_0x3816c2=_0x3816c2-0x0;var _0x144669=_0xdb33[_0x3816c2];return _0x144669;};'use strict';var _=require(_0x3db3('0x0'));var util=require(_0x3db3('0x1'));var moment=require(_0x3db3('0x2'));var BPromise=require(_0x3db3('0x3'));var rs=require(_0x3db3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3db3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db3('0x6'))(_0x3db3('0x7'));var config=require(_0x3db3('0x8'));var jayson=require(_0x3db3('0x9'));var client=jayson[_0x3db3('0xa')][_0x3db3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10108b,_0x52e866,_0x5263ee){return new BPromise(function(_0x217c97,_0x2b091f){return client[_0x3db3('0xc')](_0x10108b,_0x5263ee)[_0x3db3('0xd')](function(_0x24bdc8){logger[_0x3db3('0xe')](_0x3db3('0xf'),_0x52e866,_0x3db3('0x10'));logger[_0x3db3('0x11')](_0x3db3('0x12'),_0x52e866,'request\x20sent',JSON[_0x3db3('0x13')](_0x24bdc8));if(_0x24bdc8['error']){if(_0x24bdc8[_0x3db3('0x14')][_0x3db3('0x15')]===0x1f4){logger[_0x3db3('0x14')](_0x3db3('0xf'),_0x52e866,_0x24bdc8['error']['message']);return _0x2b091f(_0x24bdc8[_0x3db3('0x14')]['message']);}logger['error'](_0x3db3('0xf'),_0x52e866,_0x24bdc8[_0x3db3('0x14')][_0x3db3('0x16')]);return _0x217c97(_0x24bdc8[_0x3db3('0x14')][_0x3db3('0x16')]);}else{logger[_0x3db3('0xe')](_0x3db3('0xf'),_0x52e866,_0x3db3('0x10'));_0x217c97(_0x24bdc8[_0x3db3('0x17')][_0x3db3('0x16')]);}})[_0x3db3('0x18')](function(_0x469a04){logger['error'](_0x3db3('0xf'),_0x52e866,_0x469a04);_0x2b091f(_0x469a04);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index af9e7ac..52a55e5 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 _0x23f2=['destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x266703,_0x120c3b){var _0x37d275=function(_0x5a300b){while(--_0x5a300b){_0x266703['push'](_0x266703['shift']());}};_0x37d275(++_0x120c3b);}(_0x23f2,0x95));var _0x223f=function(_0x31178d,_0xe48e60){_0x31178d=_0x31178d-0x0;var _0x3d8fce=_0x23f2[_0x31178d];return _0x3d8fce;};'use strict';var multer=require(_0x223f('0x0'));var util=require(_0x223f('0x1'));var path=require(_0x223f('0x2'));var timeout=require('connect-timeout');var express=require(_0x223f('0x3'));var router=express['Router']();var fs_extra=require(_0x223f('0x4'));var auth=require(_0x223f('0x5'));var interaction=require(_0x223f('0x6'));var config=require(_0x223f('0x7'));var controller=require(_0x223f('0x8'));router[_0x223f('0x9')]('/',auth[_0x223f('0xa')](),controller[_0x223f('0xb')]);router[_0x223f('0x9')](_0x223f('0xc'),auth[_0x223f('0xa')](),controller[_0x223f('0xd')]);router[_0x223f('0xe')]('/',auth['isAuthenticated'](),controller[_0x223f('0xf')]);router[_0x223f('0x10')](_0x223f('0xc'),auth[_0x223f('0xa')](),controller[_0x223f('0x11')]);router[_0x223f('0x12')]('/:id',auth[_0x223f('0xa')](),controller[_0x223f('0x13')]);module[_0x223f('0x14')]=router; \ No newline at end of file +var _0x4a3a=['delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update'];(function(_0xf6a12,_0x58264d){var _0x24d263=function(_0x194046){while(--_0x194046){_0xf6a12['push'](_0xf6a12['shift']());}};_0x24d263(++_0x58264d);}(_0x4a3a,0xb7));var _0xa4a3=function(_0xc92e7b,_0x3e6956){_0xc92e7b=_0xc92e7b-0x0;var _0x4273e0=_0x4a3a[_0xc92e7b];return _0x4273e0;};'use strict';var multer=require(_0xa4a3('0x0'));var util=require(_0xa4a3('0x1'));var path=require(_0xa4a3('0x2'));var timeout=require(_0xa4a3('0x3'));var express=require(_0xa4a3('0x4'));var router=express['Router']();var fs_extra=require(_0xa4a3('0x5'));var auth=require(_0xa4a3('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa4a3('0x7'));router[_0xa4a3('0x8')]('/',auth['isAuthenticated'](),controller[_0xa4a3('0x9')]);router[_0xa4a3('0x8')](_0xa4a3('0xa'),auth[_0xa4a3('0xb')](),controller[_0xa4a3('0xc')]);router[_0xa4a3('0xd')]('/',auth[_0xa4a3('0xb')](),controller[_0xa4a3('0xe')]);router[_0xa4a3('0xf')]('/:id',auth[_0xa4a3('0xb')](),controller[_0xa4a3('0x10')]);router[_0xa4a3('0x11')](_0xa4a3('0xa'),auth['isAuthenticated'](),controller[_0xa4a3('0x12')]);module[_0xa4a3('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 cd02c09..6ed383d 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 _0x39c3=['picklist','STRING','ENUM','BOOLEAN','sequelize','exports','string','customVariable'];(function(_0x901043,_0x560885){var _0x4d1889=function(_0xf8396b){while(--_0xf8396b){_0x901043['push'](_0x901043['shift']());}};_0x4d1889(++_0x560885);}(_0x39c3,0x18c));var _0x339c=function(_0x504df1,_0x289598){_0x504df1=_0x504df1-0x0;var _0x1063b5=_0x39c3[_0x504df1];return _0x1063b5;};'use strict';var Sequelize=require(_0x339c('0x0'));module[_0x339c('0x1')]={'type':{'type':Sequelize['ENUM'](_0x339c('0x2'),'variable',_0x339c('0x3'),'keyValue',_0x339c('0x4')),'defaultValue':_0x339c('0x2')},'content':{'type':Sequelize[_0x339c('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x339c('0x6')]('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x339c('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x339c('0x5')]},'customField':{'type':Sequelize[_0x339c('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x339c('0x5')]}}; \ No newline at end of file +var _0x6a23=['ENUM','string','variable','picklist','STRING','customVariable','BOOLEAN','sequelize','exports'];(function(_0x1b944d,_0x14ac0f){var _0x1caddc=function(_0x3290b3){while(--_0x3290b3){_0x1b944d['push'](_0x1b944d['shift']());}};_0x1caddc(++_0x14ac0f);}(_0x6a23,0x8e));var _0x36a2=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x6a23[_0x4e4519];return _0x340044;};'use strict';var Sequelize=require(_0x36a2('0x0'));module[_0x36a2('0x1')]={'type':{'type':Sequelize[_0x36a2('0x2')](_0x36a2('0x3'),_0x36a2('0x4'),'customVariable','keyValue',_0x36a2('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x36a2('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x36a2('0x2')](_0x36a2('0x3'),_0x36a2('0x4'),_0x36a2('0x7'))},'keyContent':{'type':Sequelize[_0x36a2('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x36a2('0x6')]},'customField':{'type':Sequelize[_0x36a2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x36a2('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 82aa052..f657818 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 _0x0ee7=['fields','length','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x0ee7,0xe3));var _0x70ee=function(_0x237fea,_0x4fef91){_0x237fea=_0x237fea-0x0;var _0x1b21c2=_0x0ee7[_0x237fea];return _0x1b21c2;};'use strict';var emlformat=require(_0x70ee('0x0'));var rimraf=require(_0x70ee('0x1'));var zipdir=require(_0x70ee('0x2'));var jsonpatch=require(_0x70ee('0x3'));var rp=require(_0x70ee('0x4'));var moment=require(_0x70ee('0x5'));var BPromise=require(_0x70ee('0x6'));var Mustache=require('mustache');var util=require(_0x70ee('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x70ee('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x70ee('0x9'));var _=require(_0x70ee('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x70ee('0xb'));var deskjs=require(_0x70ee('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x70ee('0xd'));var Redis=require(_0x70ee('0xe'));var authService=require(_0x70ee('0xf'));var qs=require(_0x70ee('0x10'));var as=require(_0x70ee('0x11'));var hardwareService=require(_0x70ee('0x12'));var logger=require('../../config/logger')(_0x70ee('0x13'));var utils=require(_0x70ee('0x14'));var config=require(_0x70ee('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x164519,_0x99a863){_0x99a863=_0x99a863||0xcc;return function(_0x2c8517){if(_0x2c8517){return _0x164519[_0x70ee('0x16')](_0x99a863);}return _0x164519[_0x70ee('0x17')](_0x99a863)[_0x70ee('0x18')]();};}function respondWithResult(_0x3b61dd,_0x275131){_0x275131=_0x275131||0xc8;return function(_0x4206d4){if(_0x4206d4){return _0x3b61dd[_0x70ee('0x17')](_0x275131)[_0x70ee('0x19')](_0x4206d4);}};}function respondWithFilteredResult(_0x3a51d9,_0x213c36){return function(_0x2dc0b3){if(_0x2dc0b3){var _0x19bc61=typeof _0x213c36['offset']==='undefined'&&typeof _0x213c36['limit']==='undefined';var _0x34fd4f=_0x2dc0b3[_0x70ee('0x1a')];var _0x280058=_0x19bc61?0x0:_0x213c36[_0x70ee('0x1b')];var _0x3cc41f=_0x19bc61?_0x2dc0b3[_0x70ee('0x1a')]:_0x213c36[_0x70ee('0x1b')]+_0x213c36[_0x70ee('0x1c')];var _0xc8a1ad;if(_0x3cc41f>=_0x34fd4f){_0x3cc41f=_0x34fd4f;_0xc8a1ad=0xc8;}else{_0xc8a1ad=0xce;}_0x3a51d9['status'](_0xc8a1ad);return _0x3a51d9[_0x70ee('0x1d')](_0x70ee('0x1e'),_0x280058+'-'+_0x3cc41f+'/'+_0x34fd4f)[_0x70ee('0x19')](_0x2dc0b3);}return null;};}function patchUpdates(_0x5b5ec5){return function(_0x3ac248){try{jsonpatch[_0x70ee('0x1f')](_0x3ac248,_0x5b5ec5,!![]);}catch(_0x3ca9c0){return BPromise['reject'](_0x3ca9c0);}return _0x3ac248['save']();};}function saveUpdates(_0x2d4bdd,_0x565dff){return function(_0x575c9f){if(_0x575c9f){return _0x575c9f[_0x70ee('0x20')](_0x2d4bdd)[_0x70ee('0x21')](function(_0x340f7b){return _0x340f7b;});}return null;};}function removeEntity(_0x3e9588,_0x407087){return function(_0xc1c6d2){if(_0xc1c6d2){return _0xc1c6d2['destroy']()['then'](function(){_0x3e9588[_0x70ee('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d57a4,_0x55e6f5){return function(_0xf1c6ce){if(!_0xf1c6ce){_0x2d57a4[_0x70ee('0x16')](0x194);}return _0xf1c6ce;};}function handleError(_0x19e3e9,_0x2e4523){_0x2e4523=_0x2e4523||0x1f4;return function(_0x1a21cf){logger[_0x70ee('0x22')](_0x1a21cf['stack']);if(_0x1a21cf[_0x70ee('0x23')]){delete _0x1a21cf['name'];}_0x19e3e9[_0x70ee('0x17')](_0x2e4523)[_0x70ee('0x24')](_0x1a21cf);};}exports[_0x70ee('0x25')]=function(_0x4784ba,_0x3564d5){var _0x3d54a2={},_0x483cfe={},_0x4561dd={'count':0x0,'rows':[]};var _0x492f88=_[_0x70ee('0x26')](db[_0x70ee('0x27')][_0x70ee('0x28')],function(_0x117446){return{'name':_0x117446[_0x70ee('0x29')],'type':_0x117446[_0x70ee('0x2a')]['key']};});_0x483cfe[_0x70ee('0x2b')]=_[_0x70ee('0x26')](_0x492f88,_0x70ee('0x23'));_0x483cfe[_0x70ee('0x2c')]=_[_0x70ee('0x2d')](_0x4784ba[_0x70ee('0x2c')]);_0x483cfe[_0x70ee('0x2e')]=_['intersection'](_0x483cfe[_0x70ee('0x2b')],_0x483cfe[_0x70ee('0x2c')]);_0x3d54a2[_0x70ee('0x2f')]=_[_0x70ee('0x30')](_0x483cfe[_0x70ee('0x2b')],qs[_0x70ee('0x31')](_0x4784ba[_0x70ee('0x2c')][_0x70ee('0x31')]));_0x3d54a2['attributes']=_0x3d54a2[_0x70ee('0x2f')][_0x70ee('0x32')]?_0x3d54a2[_0x70ee('0x2f')]:_0x483cfe[_0x70ee('0x2b')];if(!_0x4784ba[_0x70ee('0x2c')]['hasOwnProperty']('nolimit')){_0x3d54a2[_0x70ee('0x1c')]=qs[_0x70ee('0x1c')](_0x4784ba[_0x70ee('0x2c')][_0x70ee('0x1c')]);_0x3d54a2['offset']=qs[_0x70ee('0x1b')](_0x4784ba[_0x70ee('0x2c')][_0x70ee('0x1b')]);}_0x3d54a2['order']=qs[_0x70ee('0x33')](_0x4784ba[_0x70ee('0x2c')][_0x70ee('0x33')]);_0x3d54a2['where']=qs[_0x70ee('0x2e')](_[_0x70ee('0x34')](_0x4784ba[_0x70ee('0x2c')],_0x483cfe[_0x70ee('0x2e')]),_0x492f88);if(_0x4784ba[_0x70ee('0x2c')][_0x70ee('0x35')]){_0x3d54a2[_0x70ee('0x36')]=_[_0x70ee('0x37')](_0x3d54a2[_0x70ee('0x36')],{'$or':_[_0x70ee('0x26')](_0x492f88,function(_0x500f95){if(_0x500f95[_0x70ee('0x2a')]!==_0x70ee('0x38')){var _0x237abe={};_0x237abe[_0x500f95[_0x70ee('0x23')]]={'$like':'%'+_0x4784ba['query']['filter']+'%'};return _0x237abe;}})});}_0x3d54a2=_[_0x70ee('0x37')]({},_0x3d54a2,_0x4784ba[_0x70ee('0x39')]);var _0xb585ff={'where':_0x3d54a2[_0x70ee('0x36')]};return db[_0x70ee('0x27')][_0x70ee('0x1a')](_0xb585ff)[_0x70ee('0x21')](function(_0x5430f3){_0x4561dd[_0x70ee('0x1a')]=_0x5430f3;if(_0x4784ba['query'][_0x70ee('0x3a')]){_0x3d54a2['include']=[{'all':!![]}];}return db['VtigerField'][_0x70ee('0x3b')](_0x3d54a2);})['then'](function(_0x2615bf){_0x4561dd[_0x70ee('0x3c')]=_0x2615bf;return _0x4561dd;})[_0x70ee('0x21')](respondWithFilteredResult(_0x3564d5,_0x3d54a2))[_0x70ee('0x3d')](handleError(_0x3564d5,null));};exports[_0x70ee('0x3e')]=function(_0x5007c6,_0x167fc8){var _0x2b341a={'raw':!![],'where':{'id':_0x5007c6[_0x70ee('0x3f')]['id']}},_0x8b1487={};_0x8b1487[_0x70ee('0x2b')]=_[_0x70ee('0x2d')](db[_0x70ee('0x27')][_0x70ee('0x28')]);_0x8b1487[_0x70ee('0x2c')]=_[_0x70ee('0x2d')](_0x5007c6[_0x70ee('0x2c')]);_0x8b1487[_0x70ee('0x2e')]=_[_0x70ee('0x30')](_0x8b1487[_0x70ee('0x2b')],_0x8b1487[_0x70ee('0x2c')]);_0x2b341a[_0x70ee('0x2f')]=_[_0x70ee('0x30')](_0x8b1487[_0x70ee('0x2b')],qs[_0x70ee('0x31')](_0x5007c6[_0x70ee('0x2c')][_0x70ee('0x31')]));_0x2b341a[_0x70ee('0x2f')]=_0x2b341a[_0x70ee('0x2f')][_0x70ee('0x32')]?_0x2b341a[_0x70ee('0x2f')]:_0x8b1487['model'];if(_0x5007c6['query'][_0x70ee('0x3a')]){_0x2b341a[_0x70ee('0x40')]=[{'all':!![]}];}_0x2b341a=_['merge']({},_0x2b341a,_0x5007c6[_0x70ee('0x39')]);return db[_0x70ee('0x27')][_0x70ee('0x41')](_0x2b341a)[_0x70ee('0x21')](handleEntityNotFound(_0x167fc8,null))['then'](respondWithResult(_0x167fc8,null))[_0x70ee('0x3d')](handleError(_0x167fc8,null));};exports[_0x70ee('0x42')]=function(_0x2c5c6d,_0x1c1584){return db[_0x70ee('0x27')][_0x70ee('0x42')](_0x2c5c6d['body'],{})['then'](respondWithResult(_0x1c1584,0xc9))[_0x70ee('0x3d')](handleError(_0x1c1584,null));};exports['update']=function(_0x4b7328,_0x193f9f){if(_0x4b7328[_0x70ee('0x43')]['id']){delete _0x4b7328['body']['id'];}return db[_0x70ee('0x27')][_0x70ee('0x41')]({'where':{'id':_0x4b7328[_0x70ee('0x3f')]['id']}})['then'](handleEntityNotFound(_0x193f9f,null))[_0x70ee('0x21')](saveUpdates(_0x4b7328['body'],null))['then'](respondWithResult(_0x193f9f,null))[_0x70ee('0x3d')](handleError(_0x193f9f,null));};exports[_0x70ee('0x44')]=function(_0x176535,_0xba6250){return db['VtigerField'][_0x70ee('0x41')]({'where':{'id':_0x176535['params']['id']}})['then'](handleEntityNotFound(_0xba6250,null))[_0x70ee('0x21')](removeEntity(_0xba6250,null))[_0x70ee('0x3d')](handleError(_0xba6250,null));}; \ No newline at end of file +var _0x0ea2=['rows','show','params','options','find','catch','create','body','update','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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/license/util','../../mysqldb','status','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','index','map','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','filter','includeAll','include','findAll'];(function(_0x2fd515,_0x3ab670){var _0x370cca=function(_0x319d59){while(--_0x319d59){_0x2fd515['push'](_0x2fd515['shift']());}};_0x370cca(++_0x3ab670);}(_0x0ea2,0x18b));var _0x20ea=function(_0x2978e1,_0x26b3f5){_0x2978e1=_0x2978e1-0x0;var _0xca0ea8=_0x0ea2[_0x2978e1];return _0xca0ea8;};'use strict';var emlformat=require(_0x20ea('0x0'));var rimraf=require(_0x20ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x20ea('0x2'));var rp=require(_0x20ea('0x3'));var moment=require(_0x20ea('0x4'));var BPromise=require(_0x20ea('0x5'));var Mustache=require(_0x20ea('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x20ea('0x7'));var ejs=require(_0x20ea('0x8'));var fs=require('fs');var fs_extra=require(_0x20ea('0x9'));var _=require(_0x20ea('0xa'));var squel=require(_0x20ea('0xb'));var crypto=require(_0x20ea('0xc'));var jsforce=require(_0x20ea('0xd'));var deskjs=require(_0x20ea('0xe'));var toCsv=require(_0x20ea('0x7'));var querystring=require(_0x20ea('0xf'));var Papa=require(_0x20ea('0x10'));var Redis=require(_0x20ea('0x11'));var authService=require(_0x20ea('0x12'));var qs=require(_0x20ea('0x13'));var as=require(_0x20ea('0x14'));var hardwareService=require(_0x20ea('0x15'));var logger=require(_0x20ea('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x20ea('0x17'));var db=require(_0x20ea('0x18'))['db'];function respondWithStatusCode(_0x38446e,_0x5001e1){_0x5001e1=_0x5001e1||0xcc;return function(_0x497f33){if(_0x497f33){return _0x38446e['sendStatus'](_0x5001e1);}return _0x38446e[_0x20ea('0x19')](_0x5001e1)['end']();};}function respondWithResult(_0xca80ff,_0x1acab3){_0x1acab3=_0x1acab3||0xc8;return function(_0x3a573e){if(_0x3a573e){return _0xca80ff[_0x20ea('0x19')](_0x1acab3)['json'](_0x3a573e);}};}function respondWithFilteredResult(_0x431be1,_0xbb2801){return function(_0x133077){if(_0x133077){var _0x11d84b=typeof _0xbb2801['offset']===_0x20ea('0x1a')&&typeof _0xbb2801[_0x20ea('0x1b')]===_0x20ea('0x1a');var _0x2f84f6=_0x133077[_0x20ea('0x1c')];var _0x1f4daa=_0x11d84b?0x0:_0xbb2801['offset'];var _0x1579fc=_0x11d84b?_0x133077[_0x20ea('0x1c')]:_0xbb2801['offset']+_0xbb2801['limit'];var _0x2bf7a0;if(_0x1579fc>=_0x2f84f6){_0x1579fc=_0x2f84f6;_0x2bf7a0=0xc8;}else{_0x2bf7a0=0xce;}_0x431be1[_0x20ea('0x19')](_0x2bf7a0);return _0x431be1[_0x20ea('0x1d')](_0x20ea('0x1e'),_0x1f4daa+'-'+_0x1579fc+'/'+_0x2f84f6)[_0x20ea('0x1f')](_0x133077);}return null;};}function patchUpdates(_0x235e3b){return function(_0x10c06a){try{jsonpatch[_0x20ea('0x20')](_0x10c06a,_0x235e3b,!![]);}catch(_0x5f3ce7){return BPromise[_0x20ea('0x21')](_0x5f3ce7);}return _0x10c06a[_0x20ea('0x22')]();};}function saveUpdates(_0x2649cd,_0x39f15a){return function(_0x1fb68a){if(_0x1fb68a){return _0x1fb68a['update'](_0x2649cd)[_0x20ea('0x23')](function(_0x185c5a){return _0x185c5a;});}return null;};}function removeEntity(_0x54f049,_0x1761ec){return function(_0x1334b3){if(_0x1334b3){return _0x1334b3['destroy']()[_0x20ea('0x23')](function(){_0x54f049[_0x20ea('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20a97e,_0x1b93d3){return function(_0x52941a){if(!_0x52941a){_0x20a97e[_0x20ea('0x24')](0x194);}return _0x52941a;};}function handleError(_0x5e1728,_0x2e319c){_0x2e319c=_0x2e319c||0x1f4;return function(_0x1008a7){logger[_0x20ea('0x25')](_0x1008a7[_0x20ea('0x26')]);if(_0x1008a7['name']){delete _0x1008a7[_0x20ea('0x27')];}_0x5e1728[_0x20ea('0x19')](_0x2e319c)['send'](_0x1008a7);};}exports[_0x20ea('0x28')]=function(_0x2a7100,_0xcca3e5){var _0x9687f1={},_0x288d0d={},_0x51ad97={'count':0x0,'rows':[]};var _0x35feb8=_[_0x20ea('0x29')](db[_0x20ea('0x2a')][_0x20ea('0x2b')],function(_0x3bee3f){return{'name':_0x3bee3f[_0x20ea('0x2c')],'type':_0x3bee3f[_0x20ea('0x2d')][_0x20ea('0x2e')]};});_0x288d0d['model']=_[_0x20ea('0x29')](_0x35feb8,'name');_0x288d0d[_0x20ea('0x2f')]=_[_0x20ea('0x30')](_0x2a7100[_0x20ea('0x2f')]);_0x288d0d[_0x20ea('0x31')]=_[_0x20ea('0x32')](_0x288d0d[_0x20ea('0x33')],_0x288d0d[_0x20ea('0x2f')]);_0x9687f1[_0x20ea('0x34')]=_['intersection'](_0x288d0d[_0x20ea('0x33')],qs[_0x20ea('0x35')](_0x2a7100[_0x20ea('0x2f')][_0x20ea('0x35')]));_0x9687f1[_0x20ea('0x34')]=_0x9687f1[_0x20ea('0x34')][_0x20ea('0x36')]?_0x9687f1[_0x20ea('0x34')]:_0x288d0d['model'];if(!_0x2a7100[_0x20ea('0x2f')][_0x20ea('0x37')](_0x20ea('0x38'))){_0x9687f1[_0x20ea('0x1b')]=qs[_0x20ea('0x1b')](_0x2a7100[_0x20ea('0x2f')][_0x20ea('0x1b')]);_0x9687f1[_0x20ea('0x39')]=qs[_0x20ea('0x39')](_0x2a7100[_0x20ea('0x2f')][_0x20ea('0x39')]);}_0x9687f1[_0x20ea('0x3a')]=qs['sort'](_0x2a7100[_0x20ea('0x2f')][_0x20ea('0x3b')]);_0x9687f1[_0x20ea('0x3c')]=qs[_0x20ea('0x31')](_[_0x20ea('0x3d')](_0x2a7100[_0x20ea('0x2f')],_0x288d0d[_0x20ea('0x31')]),_0x35feb8);if(_0x2a7100['query']['filter']){_0x9687f1[_0x20ea('0x3c')]=_[_0x20ea('0x3e')](_0x9687f1[_0x20ea('0x3c')],{'$or':_[_0x20ea('0x29')](_0x35feb8,function(_0x470bab){if(_0x470bab[_0x20ea('0x2d')]!=='VIRTUAL'){var _0x1cbcd4={};_0x1cbcd4[_0x470bab[_0x20ea('0x27')]]={'$like':'%'+_0x2a7100[_0x20ea('0x2f')][_0x20ea('0x3f')]+'%'};return _0x1cbcd4;}})});}_0x9687f1=_[_0x20ea('0x3e')]({},_0x9687f1,_0x2a7100['options']);var _0x5e9814={'where':_0x9687f1[_0x20ea('0x3c')]};return db[_0x20ea('0x2a')][_0x20ea('0x1c')](_0x5e9814)['then'](function(_0x2327ce){_0x51ad97['count']=_0x2327ce;if(_0x2a7100[_0x20ea('0x2f')][_0x20ea('0x40')]){_0x9687f1[_0x20ea('0x41')]=[{'all':!![]}];}return db['VtigerField'][_0x20ea('0x42')](_0x9687f1);})[_0x20ea('0x23')](function(_0xd7214a){_0x51ad97[_0x20ea('0x43')]=_0xd7214a;return _0x51ad97;})[_0x20ea('0x23')](respondWithFilteredResult(_0xcca3e5,_0x9687f1))['catch'](handleError(_0xcca3e5,null));};exports[_0x20ea('0x44')]=function(_0xe64aaf,_0xf55439){var _0x533189={'raw':!![],'where':{'id':_0xe64aaf[_0x20ea('0x45')]['id']}},_0x1ed9a1={};_0x1ed9a1[_0x20ea('0x33')]=_['keys'](db[_0x20ea('0x2a')][_0x20ea('0x2b')]);_0x1ed9a1[_0x20ea('0x2f')]=_[_0x20ea('0x30')](_0xe64aaf[_0x20ea('0x2f')]);_0x1ed9a1['filters']=_[_0x20ea('0x32')](_0x1ed9a1[_0x20ea('0x33')],_0x1ed9a1[_0x20ea('0x2f')]);_0x533189[_0x20ea('0x34')]=_[_0x20ea('0x32')](_0x1ed9a1[_0x20ea('0x33')],qs[_0x20ea('0x35')](_0xe64aaf[_0x20ea('0x2f')][_0x20ea('0x35')]));_0x533189[_0x20ea('0x34')]=_0x533189[_0x20ea('0x34')]['length']?_0x533189[_0x20ea('0x34')]:_0x1ed9a1[_0x20ea('0x33')];if(_0xe64aaf[_0x20ea('0x2f')]['includeAll']){_0x533189['include']=[{'all':!![]}];}_0x533189=_[_0x20ea('0x3e')]({},_0x533189,_0xe64aaf[_0x20ea('0x46')]);return db['VtigerField'][_0x20ea('0x47')](_0x533189)[_0x20ea('0x23')](handleEntityNotFound(_0xf55439,null))[_0x20ea('0x23')](respondWithResult(_0xf55439,null))[_0x20ea('0x48')](handleError(_0xf55439,null));};exports[_0x20ea('0x49')]=function(_0x32c430,_0x305723){return db[_0x20ea('0x2a')]['create'](_0x32c430[_0x20ea('0x4a')],{})['then'](respondWithResult(_0x305723,0xc9))[_0x20ea('0x48')](handleError(_0x305723,null));};exports[_0x20ea('0x4b')]=function(_0x37dc8f,_0x32e663){if(_0x37dc8f[_0x20ea('0x4a')]['id']){delete _0x37dc8f[_0x20ea('0x4a')]['id'];}return db[_0x20ea('0x2a')]['find']({'where':{'id':_0x37dc8f['params']['id']}})['then'](handleEntityNotFound(_0x32e663,null))[_0x20ea('0x23')](saveUpdates(_0x37dc8f[_0x20ea('0x4a')],null))['then'](respondWithResult(_0x32e663,null))[_0x20ea('0x48')](handleError(_0x32e663,null));};exports[_0x20ea('0x4c')]=function(_0x48bd32,_0x3d3659){return db['VtigerField'][_0x20ea('0x47')]({'where':{'id':_0x48bd32[_0x20ea('0x45')]['id']}})[_0x20ea('0x23')](handleEntityNotFound(_0x3d3659,null))['then'](removeEntity(_0x3d3659,null))['catch'](handleError(_0x3d3659,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 759602e..6abbc02 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 _0x34ee=['path','../../config/environment','./intVtigerField.attributes','int_vtiger_fields','vtiger_unique_index','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x6ec521,_0x36fb07){var _0x40fa3c=function(_0x3cd1b2){while(--_0x3cd1b2){_0x6ec521['push'](_0x6ec521['shift']());}};_0x40fa3c(++_0x36fb07);}(_0x34ee,0x94));var _0xe34e=function(_0x49ee70,_0x115b1e){_0x49ee70=_0x49ee70-0x0;var _0x3a7254=_0x34ee[_0x49ee70];return _0x3a7254;};'use strict';var _=require(_0xe34e('0x0'));var util=require(_0xe34e('0x1'));var logger=require(_0xe34e('0x2'))(_0xe34e('0x3'));var moment=require(_0xe34e('0x4'));var BPromise=require(_0xe34e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe34e('0x6'));var rimraf=require('rimraf');var config=require(_0xe34e('0x7'));var attributes=require(_0xe34e('0x8'));module['exports']=function(_0x562614,_0x303f9d){return _0x562614['define']('VtigerField',attributes,{'tableName':_0xe34e('0x9'),'paranoid':![],'indexes':[{'name':_0xe34e('0xa'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x83db=['bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerField.attributes','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','moment'];(function(_0x5c7643,_0x135b30){var _0x1e2513=function(_0xcc3a38){while(--_0xcc3a38){_0x5c7643['push'](_0x5c7643['shift']());}};_0x1e2513(++_0x135b30);}(_0x83db,0x143));var _0xb83d=function(_0x4cf5f5,_0x218a3f){_0x4cf5f5=_0x4cf5f5-0x0;var _0x2d36a7=_0x83db[_0x4cf5f5];return _0x2d36a7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb83d('0x0'));var BPromise=require(_0xb83d('0x1'));var rp=require(_0xb83d('0x2'));var fs=require('fs');var path=require(_0xb83d('0x3'));var rimraf=require(_0xb83d('0x4'));var config=require(_0xb83d('0x5'));var attributes=require(_0xb83d('0x6'));module['exports']=function(_0x751822,_0x3db760){return _0x751822[_0xb83d('0x7')](_0xb83d('0x8'),attributes,{'tableName':_0xb83d('0x9'),'paranoid':![],'indexes':[{'name':_0xb83d('0xa'),'fields':[_0xb83d('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 631a740..56d23e0 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 _0xf53b=['bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','VtigerField,\x20%s,\x20%s','message','catch','lodash','util','moment'];(function(_0x9077a4,_0x41748c){var _0x204bdc=function(_0x1c611e){while(--_0x1c611e){_0x9077a4['push'](_0x9077a4['shift']());}};_0x204bdc(++_0x41748c);}(_0xf53b,0x1b6));var _0xbf53=function(_0x54f728,_0x3dae23){_0x54f728=_0x54f728-0x0;var _0x2fbd7f=_0xf53b[_0x54f728];return _0x2fbd7f;};'use strict';var _=require(_0xbf53('0x0'));var util=require(_0xbf53('0x1'));var moment=require(_0xbf53('0x2'));var BPromise=require(_0xbf53('0x3'));var rs=require(_0xbf53('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf53('0x5'))(_0xbf53('0x6'));var config=require(_0xbf53('0x7'));var jayson=require(_0xbf53('0x8'));var client=jayson[_0xbf53('0x9')][_0xbf53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56cffd,_0x3392d7,_0x46a8fb){return new BPromise(function(_0x5447e5,_0xf52d8c){return client[_0xbf53('0xb')](_0x56cffd,_0x46a8fb)['then'](function(_0x418c5a){logger[_0xbf53('0xc')]('VtigerField,\x20%s,\x20%s',_0x3392d7,_0xbf53('0xd'));logger[_0xbf53('0xe')](_0xbf53('0xf'),_0x3392d7,_0xbf53('0xd'),JSON[_0xbf53('0x10')](_0x418c5a));if(_0x418c5a[_0xbf53('0x11')]){if(_0x418c5a['error']['code']===0x1f4){logger[_0xbf53('0x11')](_0xbf53('0x12'),_0x3392d7,_0x418c5a[_0xbf53('0x11')]['message']);return _0xf52d8c(_0x418c5a[_0xbf53('0x11')][_0xbf53('0x13')]);}logger[_0xbf53('0x11')](_0xbf53('0x12'),_0x3392d7,_0x418c5a['error'][_0xbf53('0x13')]);return _0x5447e5(_0x418c5a['error'][_0xbf53('0x13')]);}else{logger[_0xbf53('0xc')]('VtigerField,\x20%s,\x20%s',_0x3392d7,'request\x20sent');_0x5447e5(_0x418c5a['result'][_0xbf53('0x13')]);}})[_0xbf53('0x14')](function(_0x295854){logger[_0xbf53('0x11')](_0xbf53('0x12'),_0x3392d7,_0x295854);_0xf52d8c(_0x295854);});});} \ No newline at end of file +var _0xfc52=['http','request','then','info','request\x20sent','debug','stringify','error','code','VtigerField,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x42e172,_0x252160){var _0x36f809=function(_0x2ac92a){while(--_0x2ac92a){_0x42e172['push'](_0x42e172['shift']());}};_0x36f809(++_0x252160);}(_0xfc52,0xc9));var _0x2fc5=function(_0x1780ec,_0x3af2fa){_0x1780ec=_0x1780ec-0x0;var _0x5c5663=_0xfc52[_0x1780ec];return _0x5c5663;};'use strict';var _=require(_0x2fc5('0x0'));var util=require(_0x2fc5('0x1'));var moment=require('moment');var BPromise=require(_0x2fc5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2fc5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fc5('0x4'));var logger=require(_0x2fc5('0x5'))('rpc');var config=require(_0x2fc5('0x6'));var jayson=require(_0x2fc5('0x7'));var client=jayson[_0x2fc5('0x8')][_0x2fc5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed08e,_0x36efc5,_0x5d395c){return new BPromise(function(_0x4dfbfe,_0x25a42a){return client[_0x2fc5('0xa')](_0x1ed08e,_0x5d395c)[_0x2fc5('0xb')](function(_0x53afcf){logger[_0x2fc5('0xc')]('VtigerField,\x20%s,\x20%s',_0x36efc5,_0x2fc5('0xd'));logger[_0x2fc5('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x36efc5,_0x2fc5('0xd'),JSON[_0x2fc5('0xf')](_0x53afcf));if(_0x53afcf['error']){if(_0x53afcf[_0x2fc5('0x10')][_0x2fc5('0x11')]===0x1f4){logger['error'](_0x2fc5('0x12'),_0x36efc5,_0x53afcf['error'][_0x2fc5('0x13')]);return _0x25a42a(_0x53afcf['error']['message']);}logger[_0x2fc5('0x10')](_0x2fc5('0x12'),_0x36efc5,_0x53afcf[_0x2fc5('0x10')]['message']);return _0x4dfbfe(_0x53afcf[_0x2fc5('0x10')][_0x2fc5('0x13')]);}else{logger[_0x2fc5('0xc')](_0x2fc5('0x12'),_0x36efc5,_0x2fc5('0xd'));_0x4dfbfe(_0x53afcf[_0x2fc5('0x14')][_0x2fc5('0x13')]);}})['catch'](function(_0x45eca6){logger[_0x2fc5('0x10')](_0x2fc5('0x12'),_0x36efc5,_0x45eca6);_0x25a42a(_0x45eca6);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 817ecb1..ffac5c1 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 _0xfa69=['/:id/fields','getFields','post','addConfiguration','update','exports','util','connect-timeout','express','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations'];(function(_0x1afefc,_0x13b2ed){var _0x3212cf=function(_0x3cf6cc){while(--_0x3cf6cc){_0x1afefc['push'](_0x1afefc['shift']());}};_0x3212cf(++_0x13b2ed);}(_0xfa69,0xb1));var _0x9fa6=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xfa69[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require('multer');var util=require(_0x9fa6('0x0'));var path=require('path');var timeout=require(_0x9fa6('0x1'));var express=require(_0x9fa6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9fa6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x9fa6('0x4'));var controller=require(_0x9fa6('0x5'));router[_0x9fa6('0x6')]('/',auth['isAuthenticated'](),controller[_0x9fa6('0x7')]);router['get'](_0x9fa6('0x8'),auth[_0x9fa6('0x9')](),controller[_0x9fa6('0xa')]);router[_0x9fa6('0x6')](_0x9fa6('0xb'),auth['isAuthenticated'](),controller[_0x9fa6('0xc')]);router[_0x9fa6('0x6')](_0x9fa6('0xd'),auth['isAuthenticated'](),controller[_0x9fa6('0xe')]);router[_0x9fa6('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9fa6('0xf')](_0x9fa6('0xb'),auth[_0x9fa6('0x9')](),controller[_0x9fa6('0x10')]);router['put'](_0x9fa6('0x8'),auth[_0x9fa6('0x9')](),controller[_0x9fa6('0x11')]);router['delete'](_0x9fa6('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x9fa6('0x12')]=router; \ No newline at end of file +var _0x874d=['../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','show','getConfigurations','getFields','post','create','/:id','update','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3f8f37,_0x5493b9){var _0x29bb50=function(_0x188b53){while(--_0x188b53){_0x3f8f37['push'](_0x3f8f37['shift']());}};_0x29bb50(++_0x5493b9);}(_0x874d,0x1e8));var _0xd874=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x874d[_0x3b380d];return _0x54502b;};'use strict';var multer=require('multer');var util=require(_0xd874('0x0'));var path=require(_0xd874('0x1'));var timeout=require(_0xd874('0x2'));var express=require('express');var router=express[_0xd874('0x3')]();var fs_extra=require(_0xd874('0x4'));var auth=require(_0xd874('0x5'));var interaction=require(_0xd874('0x6'));var config=require('../../config/environment');var controller=require(_0xd874('0x7'));router[_0xd874('0x8')]('/',auth[_0xd874('0x9')](),controller[_0xd874('0xa')]);router[_0xd874('0x8')]('/:id',auth[_0xd874('0x9')](),controller[_0xd874('0xb')]);router[_0xd874('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xd874('0xc')]);router[_0xd874('0x8')]('/:id/fields',auth[_0xd874('0x9')](),controller[_0xd874('0xd')]);router[_0xd874('0xe')]('/',auth['isAuthenticated'](),controller[_0xd874('0xf')]);router['post']('/:id/configurations',auth[_0xd874('0x9')](),controller['addConfiguration']);router['put'](_0xd874('0x10'),auth[_0xd874('0x9')](),controller[_0xd874('0x11')]);router[_0xd874('0x12')](_0xd874('0x10'),auth[_0xd874('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 51214f8..c4d9e75 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 _0x2272=['sequelize','exports','STRING','password','token','ENUM','integrationTab','newTab'];(function(_0x5222c8,_0x8d4252){var _0x5cc151=function(_0x3876e2){while(--_0x3876e2){_0x5222c8['push'](_0x5222c8['shift']());}};_0x5cc151(++_0x8d4252);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x2227('0x0'));module[_0x2227('0x1')]={'name':{'type':Sequelize[_0x2227('0x2')]},'description':{'type':Sequelize[_0x2227('0x2')]},'username':{'type':Sequelize[_0x2227('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x2227('0x2')]},'token':{'type':Sequelize[_0x2227('0x2')]},'remoteUri':{'type':Sequelize[_0x2227('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize['ENUM'](_0x2227('0x3'),_0x2227('0x4')),'defaultValue':_0x2227('0x3')},'serverUrl':{'type':Sequelize[_0x2227('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2227('0x5')](_0x2227('0x6'),_0x2227('0x7')),'defaultValue':_0x2227('0x6')}}; \ No newline at end of file +var _0xeda7=['remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports','STRING','username'];(function(_0x104e21,_0x2ea86f){var _0x605b37=function(_0x580fce){while(--_0x580fce){_0x104e21['push'](_0x104e21['shift']());}};_0x605b37(++_0x2ea86f);}(_0xeda7,0x196));var _0x7eda=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0xeda7[_0x1694f5];return _0x5b4321;};'use strict';var Sequelize=require(_0x7eda('0x0'));module[_0x7eda('0x1')]={'name':{'type':Sequelize[_0x7eda('0x2')]},'description':{'type':Sequelize[_0x7eda('0x2')]},'username':{'type':Sequelize[_0x7eda('0x2')],'unique':_0x7eda('0x3')},'password':{'type':Sequelize[_0x7eda('0x2')]},'token':{'type':Sequelize[_0x7eda('0x2')]},'remoteUri':{'type':Sequelize[_0x7eda('0x2')],'unique':_0x7eda('0x4')},'authType':{'type':Sequelize[_0x7eda('0x5')](_0x7eda('0x6'),_0x7eda('0x7')),'defaultValue':_0x7eda('0x6')},'serverUrl':{'type':Sequelize[_0x7eda('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x7eda('0x5')](_0x7eda('0x8'),_0x7eda('0x9')),'defaultValue':_0x7eda('0x8')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index 5fe18c6..4146fd5 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 _0x58a4=['model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZendeskAccount','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskConfiguration','ZendeskField','getFields','password','token','remoteUri','slice','substring','lastIndexOf','format','authType','headers','Basic\x20%s','%s:%s','username','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','assignee','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','map','type'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x58a4,0xbf));var _0x458a=function(_0xee1455,_0x24b625){_0xee1455=_0xee1455-0x0;var _0x395717=_0x58a4[_0xee1455];return _0x395717;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];var integrations=require(_0x458a('0x1a'));function respondWithStatusCode(_0x2a4934,_0x2e788b){_0x2e788b=_0x2e788b||0xcc;return function(_0x5bd09e){if(_0x5bd09e){return _0x2a4934['sendStatus'](_0x2e788b);}return _0x2a4934[_0x458a('0x1b')](_0x2e788b)['end']();};}function respondWithResult(_0x2c7528,_0x44f683){_0x44f683=_0x44f683||0xc8;return function(_0x10133b){if(_0x10133b){return _0x2c7528[_0x458a('0x1b')](_0x44f683)[_0x458a('0x1c')](_0x10133b);}};}function respondWithFilteredResult(_0x29acee,_0x507b0f){return function(_0x4b26be){if(_0x4b26be){var _0x5c7993=typeof _0x507b0f[_0x458a('0x1d')]===_0x458a('0x1e')&&typeof _0x507b0f[_0x458a('0x1f')]==='undefined';var _0x310569=_0x4b26be[_0x458a('0x20')];var _0x18504d=_0x5c7993?0x0:_0x507b0f[_0x458a('0x1d')];var _0xa91473=_0x5c7993?_0x4b26be['count']:_0x507b0f['offset']+_0x507b0f[_0x458a('0x1f')];var _0x4d07a7;if(_0xa91473>=_0x310569){_0xa91473=_0x310569;_0x4d07a7=0xc8;}else{_0x4d07a7=0xce;}_0x29acee[_0x458a('0x1b')](_0x4d07a7);return _0x29acee[_0x458a('0x21')]('Content-Range',_0x18504d+'-'+_0xa91473+'/'+_0x310569)[_0x458a('0x1c')](_0x4b26be);}return null;};}function patchUpdates(_0x55a588){return function(_0x200213){try{jsonpatch[_0x458a('0x22')](_0x200213,_0x55a588,!![]);}catch(_0x59f44c){return BPromise[_0x458a('0x23')](_0x59f44c);}return _0x200213[_0x458a('0x24')]();};}function saveUpdates(_0x5a2bcb,_0xa6b8ff){return function(_0x5ad95a){if(_0x5ad95a){return _0x5ad95a[_0x458a('0x25')](_0x5a2bcb)['then'](function(_0x4080fc){return _0x4080fc;});}return null;};}function removeEntity(_0x5dfc6c,_0x36b08e){return function(_0x911eaf){if(_0x911eaf){return _0x911eaf[_0x458a('0x26')]()[_0x458a('0x27')](function(){_0x5dfc6c[_0x458a('0x1b')](0xcc)[_0x458a('0x28')]();});}};}function handleEntityNotFound(_0x340375,_0x3012c7){return function(_0x1f2d0){if(!_0x1f2d0){_0x340375[_0x458a('0x29')](0x194);}return _0x1f2d0;};}function handleError(_0x52efed,_0x327fcb){_0x327fcb=_0x327fcb||0x1f4;return function(_0x21ec38){logger['error'](_0x21ec38[_0x458a('0x2a')]);if(_0x21ec38[_0x458a('0x2b')]){delete _0x21ec38['name'];}_0x52efed['status'](_0x327fcb)[_0x458a('0x2c')](_0x21ec38);};}exports['index']=function(_0x33c5d8,_0x29f9b5){var _0x223f73={},_0x4a49e4={},_0xa6fdf={'count':0x0,'rows':[]};var _0x2531f7=_[_0x458a('0x2d')](db['ZendeskAccount']['rawAttributes'],function(_0x18c890){return{'name':_0x18c890['fieldName'],'type':_0x18c890[_0x458a('0x2e')]['key']};});_0x4a49e4[_0x458a('0x2f')]=_[_0x458a('0x2d')](_0x2531f7,'name');_0x4a49e4[_0x458a('0x30')]=_[_0x458a('0x31')](_0x33c5d8[_0x458a('0x30')]);_0x4a49e4['filters']=_[_0x458a('0x32')](_0x4a49e4[_0x458a('0x2f')],_0x4a49e4[_0x458a('0x30')]);_0x223f73[_0x458a('0x33')]=_[_0x458a('0x32')](_0x4a49e4['model'],qs[_0x458a('0x34')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x34')]));_0x223f73[_0x458a('0x33')]=_0x223f73[_0x458a('0x33')][_0x458a('0x35')]?_0x223f73['attributes']:_0x4a49e4[_0x458a('0x2f')];if(!_0x33c5d8[_0x458a('0x30')][_0x458a('0x36')](_0x458a('0x37'))){_0x223f73[_0x458a('0x1f')]=qs[_0x458a('0x1f')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x1f')]);_0x223f73[_0x458a('0x1d')]=qs['offset'](_0x33c5d8[_0x458a('0x30')][_0x458a('0x1d')]);}_0x223f73[_0x458a('0x38')]=qs[_0x458a('0x39')](_0x33c5d8[_0x458a('0x30')][_0x458a('0x39')]);_0x223f73[_0x458a('0x3a')]=qs[_0x458a('0x3b')](_[_0x458a('0x3c')](_0x33c5d8[_0x458a('0x30')],_0x4a49e4[_0x458a('0x3b')]),_0x2531f7);if(_0x33c5d8[_0x458a('0x30')][_0x458a('0x3d')]){_0x223f73[_0x458a('0x3a')]=_[_0x458a('0x3e')](_0x223f73['where'],{'$or':_[_0x458a('0x2d')](_0x2531f7,function(_0x397a41){if(_0x397a41[_0x458a('0x2e')]!==_0x458a('0x3f')){var _0x3c5840={};_0x3c5840[_0x397a41[_0x458a('0x2b')]]={'$like':'%'+_0x33c5d8[_0x458a('0x30')][_0x458a('0x3d')]+'%'};return _0x3c5840;}})});}_0x223f73=_[_0x458a('0x3e')]({},_0x223f73,_0x33c5d8[_0x458a('0x40')]);var _0x20cf10={'where':_0x223f73['where']};return db[_0x458a('0x41')][_0x458a('0x20')](_0x20cf10)['then'](function(_0x430bda){_0xa6fdf[_0x458a('0x20')]=_0x430bda;if(_0x33c5d8[_0x458a('0x30')]['includeAll']){_0x223f73[_0x458a('0x42')]=[{'all':!![]}];}return db[_0x458a('0x41')][_0x458a('0x43')](_0x223f73);})[_0x458a('0x27')](function(_0xbcd632){_0xa6fdf[_0x458a('0x44')]=_0xbcd632;return _0xa6fdf;})[_0x458a('0x27')](respondWithFilteredResult(_0x29f9b5,_0x223f73))[_0x458a('0x45')](handleError(_0x29f9b5,null));};exports['show']=function(_0x296385,_0x145e3c){var _0x2b9030={'raw':![],'where':{'id':_0x296385[_0x458a('0x46')]['id']}},_0x5180ae={};_0x5180ae[_0x458a('0x2f')]=_['keys'](db[_0x458a('0x41')][_0x458a('0x47')]);_0x5180ae[_0x458a('0x30')]=_[_0x458a('0x31')](_0x296385[_0x458a('0x30')]);_0x5180ae['filters']=_['intersection'](_0x5180ae[_0x458a('0x2f')],_0x5180ae[_0x458a('0x30')]);_0x2b9030[_0x458a('0x33')]=_[_0x458a('0x32')](_0x5180ae['model'],qs[_0x458a('0x34')](_0x296385[_0x458a('0x30')]['fields']));_0x2b9030[_0x458a('0x33')]=_0x2b9030['attributes'][_0x458a('0x35')]?_0x2b9030[_0x458a('0x33')]:_0x5180ae[_0x458a('0x2f')];if(_0x296385['query'][_0x458a('0x48')]){_0x2b9030[_0x458a('0x42')]=[{'all':!![]}];}_0x2b9030=_[_0x458a('0x3e')]({},_0x2b9030,_0x296385['options']);return db['ZendeskAccount'][_0x458a('0x49')](_0x2b9030)[_0x458a('0x27')](handleEntityNotFound(_0x145e3c,null))[_0x458a('0x27')](respondWithResult(_0x145e3c,null))['catch'](handleError(_0x145e3c,null));};exports['create']=function(_0x3a7005,_0xf362b5){return db[_0x458a('0x41')][_0x458a('0x4a')](_0x3a7005[_0x458a('0x4b')],{})[_0x458a('0x27')](respondWithResult(_0xf362b5,0xc9))[_0x458a('0x45')](handleError(_0xf362b5,null));};exports[_0x458a('0x25')]=function(_0xb22232,_0x213f86){if(_0xb22232[_0x458a('0x4b')]['id']){delete _0xb22232[_0x458a('0x4b')]['id'];}return db[_0x458a('0x41')][_0x458a('0x49')]({'where':{'id':_0xb22232[_0x458a('0x46')]['id']}})[_0x458a('0x27')](handleEntityNotFound(_0x213f86,null))['then'](saveUpdates(_0xb22232[_0x458a('0x4b')],null))[_0x458a('0x27')](respondWithResult(_0x213f86,null))[_0x458a('0x45')](handleError(_0x213f86,null));};exports[_0x458a('0x26')]=function(_0x44670a,_0x5630cf){return db['ZendeskAccount']['find']({'where':{'id':_0x44670a[_0x458a('0x46')]['id']}})['then'](handleEntityNotFound(_0x5630cf,null))[_0x458a('0x27')](removeEntity(_0x5630cf,null))[_0x458a('0x45')](handleError(_0x5630cf,null));};exports[_0x458a('0x4c')]=function(_0x649553,_0xfa6e65,_0x5f0151){var _0x48f68e={};var _0x3d7616={};var _0x2d8b77;var _0x2587a1;return db[_0x458a('0x41')][_0x458a('0x4d')]({'where':{'id':_0x649553['params']['id']}})[_0x458a('0x27')](handleEntityNotFound(_0xfa6e65,null))['then'](function(_0xa51e28){if(_0xa51e28){_0x2d8b77=_0xa51e28;_0x3d7616['model']=_[_0x458a('0x31')](db['ZendeskConfiguration']['rawAttributes']);_0x3d7616['query']=_[_0x458a('0x31')](_0x649553[_0x458a('0x30')]);_0x3d7616['filters']=_[_0x458a('0x32')](_0x3d7616[_0x458a('0x2f')],_0x3d7616[_0x458a('0x30')]);_0x48f68e['attributes']=_[_0x458a('0x32')](_0x3d7616[_0x458a('0x2f')],qs[_0x458a('0x34')](_0x649553[_0x458a('0x30')][_0x458a('0x34')]));_0x48f68e[_0x458a('0x33')]=_0x48f68e['attributes'][_0x458a('0x35')]?_0x48f68e[_0x458a('0x33')]:_0x3d7616[_0x458a('0x2f')];_0x48f68e[_0x458a('0x38')]=qs[_0x458a('0x39')](_0x649553[_0x458a('0x30')][_0x458a('0x39')]);_0x48f68e[_0x458a('0x3a')]=qs['filters'](_[_0x458a('0x3c')](_0x649553['query'],_0x3d7616[_0x458a('0x3b')]));if(_0x649553[_0x458a('0x30')][_0x458a('0x3d')]){_0x48f68e[_0x458a('0x3a')]=_['merge'](_0x48f68e['where'],{'$or':_[_0x458a('0x2d')](_0x48f68e[_0x458a('0x33')],function(_0x2b9aac){var _0x156a22={};_0x156a22[_0x2b9aac]={'$like':'%'+_0x649553[_0x458a('0x30')][_0x458a('0x3d')]+'%'};return _0x156a22;})});}_0x48f68e=_['merge']({},_0x48f68e,_0x649553[_0x458a('0x40')]);return _0x2d8b77[_0x458a('0x4c')](_0x48f68e);}})['then'](function(_0x18d83a){if(_0x18d83a){_0x2587a1=_0x18d83a['length'];if(!_0x649553[_0x458a('0x30')][_0x458a('0x36')](_0x458a('0x37'))){_0x48f68e[_0x458a('0x1f')]=qs[_0x458a('0x1f')](_0x649553[_0x458a('0x30')][_0x458a('0x1f')]);_0x48f68e[_0x458a('0x1d')]=qs['offset'](_0x649553[_0x458a('0x30')][_0x458a('0x1d')]);}return _0x2d8b77['getConfigurations'](_0x48f68e);}})[_0x458a('0x27')](function(_0x3da617){if(_0x3da617){return _0x3da617?{'count':_0x2587a1,'rows':_0x3da617}:null;}})['then'](respondWithResult(_0xfa6e65,null))[_0x458a('0x45')](handleError(_0xfa6e65,null));};exports[_0x458a('0x4e')]=function(_0x47cbcf,_0x17b611,_0x180df0){if(_0x47cbcf['body']['id']){delete _0x47cbcf[_0x458a('0x4b')]['id'];}return db[_0x458a('0x41')][_0x458a('0x4d')]({'where':{'id':_0x47cbcf[_0x458a('0x46')]['id']}})[_0x458a('0x27')](handleEntityNotFound(_0x17b611,null))[_0x458a('0x27')](function(_0x4199a7){if(_0x4199a7){_0x47cbcf[_0x458a('0x4b')]['AccountId']=_0x4199a7['id'];_0x47cbcf[_0x458a('0x4b')][_0x458a('0x4f')]=integrations[_0x458a('0x50')](_0x47cbcf[_0x458a('0x4b')][_0x458a('0x51')],_0x47cbcf[_0x458a('0x4b')][_0x458a('0x2e')]);_0x47cbcf[_0x458a('0x4b')][_0x458a('0x52')]=integrations[_0x458a('0x53')](_0x47cbcf['body'][_0x458a('0x51')],_0x47cbcf['body'][_0x458a('0x2e')]);return db[_0x458a('0x54')][_0x458a('0x4a')](_0x47cbcf[_0x458a('0x4b')],{'include':[{'model':db[_0x458a('0x55')],'as':_0x458a('0x4f')},{'model':db[_0x458a('0x55')],'as':_0x458a('0x52')}]});}return null;})[_0x458a('0x27')](respondWithResult(_0x17b611,null))[_0x458a('0x45')](handleError(_0x17b611,null));};exports[_0x458a('0x56')]=function(_0x448cbc,_0x11bbba,_0x435884){var _0x3948aa='';return db[_0x458a('0x41')]['findOne']({'where':{'id':_0x448cbc[_0x458a('0x46')]['id']},'attributes':['id','username',_0x458a('0x57'),_0x458a('0x58'),'authType',_0x458a('0x59')]})[_0x458a('0x27')](handleEntityNotFound(_0x11bbba,null))[_0x458a('0x27')](function(_0x494710){if(_0x494710){_0x3948aa=_0x494710[_0x458a('0x59')];var _0xed002=_0x3948aa[_0x458a('0x5a')](-0x1);if(_0xed002==='/'){_0x3948aa=_0x3948aa[_0x458a('0x5b')](0x0,_0x3948aa[_0x458a('0x5c')](_0xed002));}var _0x42f213={'method':'GET','uri':util[_0x458a('0x5d')]('%s/%s',_0x3948aa,'ticket_fields'),'json':!![]};switch(_0x494710[_0x458a('0x5e')]){case _0x458a('0x57'):_0x42f213[_0x458a('0x5f')]={'Authorization':util[_0x458a('0x5d')](_0x458a('0x60'),new Buffer(util[_0x458a('0x5d')](_0x458a('0x61'),_0x494710[_0x458a('0x62')],_0x494710[_0x458a('0x57')]))[_0x458a('0x63')](_0x458a('0x64')))};break;case _0x458a('0x58'):_0x42f213[_0x458a('0x5f')]={'Authorization':util[_0x458a('0x5d')]('Basic\x20%s',new Buffer(util['format']('%s/token:%s',_0x494710[_0x458a('0x62')],_0x494710['token']))[_0x458a('0x63')](_0x458a('0x64')))};break;default:throw new db[(_0x458a('0x65'))][(_0x458a('0x66'))](_0x458a('0x67'));}return rp(_0x42f213);}})[_0x458a('0x27')](function(_0x46df7c){if(_0x46df7c){var _0x49f3ee=[_0x458a('0x68'),_0x458a('0x69'),'group',_0x458a('0x6a')];_['remove'](_0x46df7c[_0x458a('0x6b')],function(_0x58d29d){return _0x49f3ee[_0x458a('0x6c')](_0x58d29d[_0x458a('0x2e')]);});return{'count':_0x46df7c[_0x458a('0x6b')][_0x458a('0x35')],'rows':_['map'](_0x46df7c[_0x458a('0x6b')],function(_0x14b95e){return{'id':_0x14b95e['id'],'name':_0x14b95e[_0x458a('0x6d')]>0x7?_0x14b95e[_0x458a('0x6e')]:_0x14b95e[_0x458a('0x2e')],'custom':_0x14b95e[_0x458a('0x6d')]>0x7?!![]:![],'options':_0x14b95e[_0x458a('0x6f')]?_0x14b95e[_0x458a('0x6f')]:_0x14b95e['custom_field_options']?_0x14b95e[_0x458a('0x70')]:[]};})};}})[_0x458a('0x27')](respondWithResult(_0x11bbba,null))[_0x458a('0x45')](function(_0x4212af){var _0x591dbb=_0x448cbc[_0x458a('0x30')][_0x458a('0x71')]?0x1f4:_0x4212af['statusCode']||0x1f4;logger[_0x458a('0x72')](_0x458a('0x73'),_0x458a('0x56'),_0x591dbb,JSON[_0x458a('0x74')](_0x4212af));delete _0x4212af[_0x458a('0x2b')];if(_0x591dbb===0x191){_0x591dbb=0x190;}_0x11bbba['status'](_0x591dbb)[_0x458a('0x2c')](_0x448cbc[_0x458a('0x30')][_0x458a('0x71')]?{'message':_0x458a('0x75'),'statusCode':_0x4212af[_0x458a('0x76')]}:_0x4212af);});}; \ No newline at end of file +var _0xa5fa=['send','ZendeskAccount','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','map','type','VIRTUAL','options','include','findAll','catch','show','params','keys','rawAttributes','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZendeskField','Subjects','Descriptions','getFields','username','password','token','remoteUri','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','stack','name'];(function(_0x28a962,_0x21927e){var _0x5e4417=function(_0x3f90a4){while(--_0x3f90a4){_0x28a962['push'](_0x28a962['shift']());}};_0x5e4417(++_0x21927e);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x490f59,_0x51681d){_0x490f59=_0x490f59-0x0;var _0x5e4394=_0xa5fa[_0x490f59];return _0x5e4394;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xaa5f('0x0'));var zipdir=require(_0xaa5f('0x1'));var jsonpatch=require(_0xaa5f('0x2'));var rp=require(_0xaa5f('0x3'));var moment=require('moment');var BPromise=require(_0xaa5f('0x4'));var Mustache=require(_0xaa5f('0x5'));var util=require('util');var path=require(_0xaa5f('0x6'));var sox=require(_0xaa5f('0x7'));var csv=require(_0xaa5f('0x8'));var ejs=require(_0xaa5f('0x9'));var fs=require('fs');var fs_extra=require(_0xaa5f('0xa'));var _=require(_0xaa5f('0xb'));var squel=require(_0xaa5f('0xc'));var crypto=require(_0xaa5f('0xd'));var jsforce=require(_0xaa5f('0xe'));var deskjs=require(_0xaa5f('0xf'));var toCsv=require(_0xaa5f('0x8'));var querystring=require('querystring');var Papa=require(_0xaa5f('0x10'));var Redis=require(_0xaa5f('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaa5f('0x13'));var utils=require('../../config/utils');var config=require(_0xaa5f('0x14'));var licenseUtil=require(_0xaa5f('0x15'));var db=require(_0xaa5f('0x16'))['db'];var integrations=require(_0xaa5f('0x17'));function respondWithStatusCode(_0x252ae0,_0x48d1d3){_0x48d1d3=_0x48d1d3||0xcc;return function(_0xbd4e10){if(_0xbd4e10){return _0x252ae0['sendStatus'](_0x48d1d3);}return _0x252ae0[_0xaa5f('0x18')](_0x48d1d3)[_0xaa5f('0x19')]();};}function respondWithResult(_0x31eabc,_0x19aa27){_0x19aa27=_0x19aa27||0xc8;return function(_0x2e1ca5){if(_0x2e1ca5){return _0x31eabc['status'](_0x19aa27)['json'](_0x2e1ca5);}};}function respondWithFilteredResult(_0x1f37fb,_0x291042){return function(_0xb0bfb6){if(_0xb0bfb6){var _0x4265ab=typeof _0x291042[_0xaa5f('0x1a')]===_0xaa5f('0x1b')&&typeof _0x291042[_0xaa5f('0x1c')]===_0xaa5f('0x1b');var _0x202ea8=_0xb0bfb6[_0xaa5f('0x1d')];var _0x22175f=_0x4265ab?0x0:_0x291042[_0xaa5f('0x1a')];var _0x4f4cd5=_0x4265ab?_0xb0bfb6[_0xaa5f('0x1d')]:_0x291042[_0xaa5f('0x1a')]+_0x291042[_0xaa5f('0x1c')];var _0x358d2e;if(_0x4f4cd5>=_0x202ea8){_0x4f4cd5=_0x202ea8;_0x358d2e=0xc8;}else{_0x358d2e=0xce;}_0x1f37fb[_0xaa5f('0x18')](_0x358d2e);return _0x1f37fb[_0xaa5f('0x1e')](_0xaa5f('0x1f'),_0x22175f+'-'+_0x4f4cd5+'/'+_0x202ea8)[_0xaa5f('0x20')](_0xb0bfb6);}return null;};}function patchUpdates(_0x2d8fc3){return function(_0xe3d7d){try{jsonpatch[_0xaa5f('0x21')](_0xe3d7d,_0x2d8fc3,!![]);}catch(_0x10f287){return BPromise[_0xaa5f('0x22')](_0x10f287);}return _0xe3d7d['save']();};}function saveUpdates(_0x1e917d,_0x57082c){return function(_0x2e04e6){if(_0x2e04e6){return _0x2e04e6[_0xaa5f('0x23')](_0x1e917d)['then'](function(_0x1baa2e){return _0x1baa2e;});}return null;};}function removeEntity(_0x1032ce,_0x5b9f0b){return function(_0xf6a8c3){if(_0xf6a8c3){return _0xf6a8c3[_0xaa5f('0x24')]()[_0xaa5f('0x25')](function(){_0x1032ce[_0xaa5f('0x18')](0xcc)[_0xaa5f('0x19')]();});}};}function handleEntityNotFound(_0xacbded,_0x3d7bca){return function(_0x2fba7d){if(!_0x2fba7d){_0xacbded['sendStatus'](0x194);}return _0x2fba7d;};}function handleError(_0x2445a6,_0x3a66e8){_0x3a66e8=_0x3a66e8||0x1f4;return function(_0x1ed8eb){logger['error'](_0x1ed8eb[_0xaa5f('0x26')]);if(_0x1ed8eb[_0xaa5f('0x27')]){delete _0x1ed8eb[_0xaa5f('0x27')];}_0x2445a6['status'](_0x3a66e8)[_0xaa5f('0x28')](_0x1ed8eb);};}exports['index']=function(_0x5990d2,_0x27d1a4){var _0x50998f={},_0x1bffec={},_0x4e0ec9={'count':0x0,'rows':[]};var _0x4c5dc0=_['map'](db[_0xaa5f('0x29')]['rawAttributes'],function(_0x310828){return{'name':_0x310828[_0xaa5f('0x2a')],'type':_0x310828['type']['key']};});_0x1bffec[_0xaa5f('0x2b')]=_['map'](_0x4c5dc0,_0xaa5f('0x27'));_0x1bffec[_0xaa5f('0x2c')]=_['keys'](_0x5990d2[_0xaa5f('0x2c')]);_0x1bffec[_0xaa5f('0x2d')]=_[_0xaa5f('0x2e')](_0x1bffec['model'],_0x1bffec[_0xaa5f('0x2c')]);_0x50998f[_0xaa5f('0x2f')]=_['intersection'](_0x1bffec['model'],qs['fields'](_0x5990d2['query'][_0xaa5f('0x30')]));_0x50998f[_0xaa5f('0x2f')]=_0x50998f[_0xaa5f('0x2f')][_0xaa5f('0x31')]?_0x50998f[_0xaa5f('0x2f')]:_0x1bffec[_0xaa5f('0x2b')];if(!_0x5990d2[_0xaa5f('0x2c')]['hasOwnProperty'](_0xaa5f('0x32'))){_0x50998f[_0xaa5f('0x1c')]=qs[_0xaa5f('0x1c')](_0x5990d2[_0xaa5f('0x2c')][_0xaa5f('0x1c')]);_0x50998f[_0xaa5f('0x1a')]=qs['offset'](_0x5990d2[_0xaa5f('0x2c')][_0xaa5f('0x1a')]);}_0x50998f[_0xaa5f('0x33')]=qs[_0xaa5f('0x34')](_0x5990d2[_0xaa5f('0x2c')]['sort']);_0x50998f['where']=qs[_0xaa5f('0x2d')](_[_0xaa5f('0x35')](_0x5990d2[_0xaa5f('0x2c')],_0x1bffec[_0xaa5f('0x2d')]),_0x4c5dc0);if(_0x5990d2['query'][_0xaa5f('0x36')]){_0x50998f[_0xaa5f('0x37')]=_[_0xaa5f('0x38')](_0x50998f[_0xaa5f('0x37')],{'$or':_[_0xaa5f('0x39')](_0x4c5dc0,function(_0x1869c2){if(_0x1869c2[_0xaa5f('0x3a')]!==_0xaa5f('0x3b')){var _0xc6deec={};_0xc6deec[_0x1869c2[_0xaa5f('0x27')]]={'$like':'%'+_0x5990d2[_0xaa5f('0x2c')]['filter']+'%'};return _0xc6deec;}})});}_0x50998f=_[_0xaa5f('0x38')]({},_0x50998f,_0x5990d2[_0xaa5f('0x3c')]);var _0xcd9c30={'where':_0x50998f[_0xaa5f('0x37')]};return db[_0xaa5f('0x29')][_0xaa5f('0x1d')](_0xcd9c30)[_0xaa5f('0x25')](function(_0xa490d9){_0x4e0ec9[_0xaa5f('0x1d')]=_0xa490d9;if(_0x5990d2[_0xaa5f('0x2c')]['includeAll']){_0x50998f[_0xaa5f('0x3d')]=[{'all':!![]}];}return db['ZendeskAccount'][_0xaa5f('0x3e')](_0x50998f);})[_0xaa5f('0x25')](function(_0x17bb4d){_0x4e0ec9['rows']=_0x17bb4d;return _0x4e0ec9;})[_0xaa5f('0x25')](respondWithFilteredResult(_0x27d1a4,_0x50998f))[_0xaa5f('0x3f')](handleError(_0x27d1a4,null));};exports[_0xaa5f('0x40')]=function(_0x528b08,_0x12a8e4){var _0x179be8={'raw':![],'where':{'id':_0x528b08[_0xaa5f('0x41')]['id']}},_0x1ac9b6={};_0x1ac9b6['model']=_[_0xaa5f('0x42')](db[_0xaa5f('0x29')][_0xaa5f('0x43')]);_0x1ac9b6[_0xaa5f('0x2c')]=_[_0xaa5f('0x42')](_0x528b08[_0xaa5f('0x2c')]);_0x1ac9b6[_0xaa5f('0x2d')]=_[_0xaa5f('0x2e')](_0x1ac9b6['model'],_0x1ac9b6[_0xaa5f('0x2c')]);_0x179be8['attributes']=_[_0xaa5f('0x2e')](_0x1ac9b6['model'],qs[_0xaa5f('0x30')](_0x528b08[_0xaa5f('0x2c')]['fields']));_0x179be8[_0xaa5f('0x2f')]=_0x179be8[_0xaa5f('0x2f')][_0xaa5f('0x31')]?_0x179be8['attributes']:_0x1ac9b6['model'];if(_0x528b08['query'][_0xaa5f('0x44')]){_0x179be8['include']=[{'all':!![]}];}_0x179be8=_[_0xaa5f('0x38')]({},_0x179be8,_0x528b08[_0xaa5f('0x3c')]);return db[_0xaa5f('0x29')][_0xaa5f('0x45')](_0x179be8)['then'](handleEntityNotFound(_0x12a8e4,null))[_0xaa5f('0x25')](respondWithResult(_0x12a8e4,null))[_0xaa5f('0x3f')](handleError(_0x12a8e4,null));};exports[_0xaa5f('0x46')]=function(_0x231ad1,_0x27ea4b){return db[_0xaa5f('0x29')][_0xaa5f('0x46')](_0x231ad1[_0xaa5f('0x47')],{})[_0xaa5f('0x25')](respondWithResult(_0x27ea4b,0xc9))[_0xaa5f('0x3f')](handleError(_0x27ea4b,null));};exports[_0xaa5f('0x23')]=function(_0x2de737,_0x2be44d){if(_0x2de737[_0xaa5f('0x47')]['id']){delete _0x2de737[_0xaa5f('0x47')]['id'];}return db[_0xaa5f('0x29')]['find']({'where':{'id':_0x2de737[_0xaa5f('0x41')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x2be44d,null))[_0xaa5f('0x25')](saveUpdates(_0x2de737[_0xaa5f('0x47')],null))[_0xaa5f('0x25')](respondWithResult(_0x2be44d,null))[_0xaa5f('0x3f')](handleError(_0x2be44d,null));};exports[_0xaa5f('0x24')]=function(_0x4aa556,_0xf5a6b6){return db[_0xaa5f('0x29')][_0xaa5f('0x45')]({'where':{'id':_0x4aa556[_0xaa5f('0x41')]['id']}})['then'](handleEntityNotFound(_0xf5a6b6,null))[_0xaa5f('0x25')](removeEntity(_0xf5a6b6,null))[_0xaa5f('0x3f')](handleError(_0xf5a6b6,null));};exports[_0xaa5f('0x48')]=function(_0x575803,_0x5bbdce,_0x506dce){var _0x56cdd6={};var _0x585559={};var _0x509c61;var _0x1f47a0;return db[_0xaa5f('0x29')][_0xaa5f('0x49')]({'where':{'id':_0x575803[_0xaa5f('0x41')]['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x5bbdce,null))[_0xaa5f('0x25')](function(_0x48c473){if(_0x48c473){_0x509c61=_0x48c473;_0x585559['model']=_[_0xaa5f('0x42')](db[_0xaa5f('0x4a')]['rawAttributes']);_0x585559[_0xaa5f('0x2c')]=_[_0xaa5f('0x42')](_0x575803[_0xaa5f('0x2c')]);_0x585559[_0xaa5f('0x2d')]=_[_0xaa5f('0x2e')](_0x585559[_0xaa5f('0x2b')],_0x585559[_0xaa5f('0x2c')]);_0x56cdd6['attributes']=_['intersection'](_0x585559[_0xaa5f('0x2b')],qs[_0xaa5f('0x30')](_0x575803['query']['fields']));_0x56cdd6['attributes']=_0x56cdd6[_0xaa5f('0x2f')]['length']?_0x56cdd6[_0xaa5f('0x2f')]:_0x585559['model'];_0x56cdd6['order']=qs[_0xaa5f('0x34')](_0x575803[_0xaa5f('0x2c')][_0xaa5f('0x34')]);_0x56cdd6['where']=qs[_0xaa5f('0x2d')](_[_0xaa5f('0x35')](_0x575803[_0xaa5f('0x2c')],_0x585559['filters']));if(_0x575803[_0xaa5f('0x2c')][_0xaa5f('0x36')]){_0x56cdd6['where']=_[_0xaa5f('0x38')](_0x56cdd6[_0xaa5f('0x37')],{'$or':_[_0xaa5f('0x39')](_0x56cdd6[_0xaa5f('0x2f')],function(_0x334282){var _0x178d90={};_0x178d90[_0x334282]={'$like':'%'+_0x575803[_0xaa5f('0x2c')][_0xaa5f('0x36')]+'%'};return _0x178d90;})});}_0x56cdd6=_[_0xaa5f('0x38')]({},_0x56cdd6,_0x575803['options']);return _0x509c61[_0xaa5f('0x48')](_0x56cdd6);}})[_0xaa5f('0x25')](function(_0x1d02af){if(_0x1d02af){_0x1f47a0=_0x1d02af[_0xaa5f('0x31')];if(!_0x575803[_0xaa5f('0x2c')][_0xaa5f('0x4b')](_0xaa5f('0x32'))){_0x56cdd6[_0xaa5f('0x1c')]=qs['limit'](_0x575803[_0xaa5f('0x2c')]['limit']);_0x56cdd6[_0xaa5f('0x1a')]=qs[_0xaa5f('0x1a')](_0x575803[_0xaa5f('0x2c')][_0xaa5f('0x1a')]);}return _0x509c61['getConfigurations'](_0x56cdd6);}})[_0xaa5f('0x25')](function(_0x1bc0e7){if(_0x1bc0e7){return _0x1bc0e7?{'count':_0x1f47a0,'rows':_0x1bc0e7}:null;}})[_0xaa5f('0x25')](respondWithResult(_0x5bbdce,null))['catch'](handleError(_0x5bbdce,null));};exports[_0xaa5f('0x4c')]=function(_0x524f42,_0x42ea3b,_0x5e7a74){if(_0x524f42[_0xaa5f('0x47')]['id']){delete _0x524f42[_0xaa5f('0x47')]['id'];}return db[_0xaa5f('0x29')][_0xaa5f('0x49')]({'where':{'id':_0x524f42['params']['id']}})[_0xaa5f('0x25')](handleEntityNotFound(_0x42ea3b,null))[_0xaa5f('0x25')](function(_0x47a160){if(_0x47a160){_0x524f42['body'][_0xaa5f('0x4d')]=_0x47a160['id'];_0x524f42[_0xaa5f('0x47')]['Subjects']=integrations[_0xaa5f('0x4e')](_0x524f42[_0xaa5f('0x47')][_0xaa5f('0x4f')],_0x524f42['body'][_0xaa5f('0x3a')]);_0x524f42[_0xaa5f('0x47')]['Descriptions']=integrations[_0xaa5f('0x50')](_0x524f42[_0xaa5f('0x47')][_0xaa5f('0x4f')],_0x524f42['body'][_0xaa5f('0x3a')]);return db[_0xaa5f('0x4a')]['create'](_0x524f42[_0xaa5f('0x47')],{'include':[{'model':db[_0xaa5f('0x51')],'as':_0xaa5f('0x52')},{'model':db[_0xaa5f('0x51')],'as':_0xaa5f('0x53')}]});}return null;})['then'](respondWithResult(_0x42ea3b,null))[_0xaa5f('0x3f')](handleError(_0x42ea3b,null));};exports[_0xaa5f('0x54')]=function(_0x464ac7,_0x216399,_0x2a1049){var _0x508fe7='';return db[_0xaa5f('0x29')]['findOne']({'where':{'id':_0x464ac7[_0xaa5f('0x41')]['id']},'attributes':['id',_0xaa5f('0x55'),_0xaa5f('0x56'),_0xaa5f('0x57'),'authType',_0xaa5f('0x58')]})[_0xaa5f('0x25')](handleEntityNotFound(_0x216399,null))[_0xaa5f('0x25')](function(_0x424b43){if(_0x424b43){_0x508fe7=_0x424b43[_0xaa5f('0x58')];var _0x201b8b=_0x508fe7['slice'](-0x1);if(_0x201b8b==='/'){_0x508fe7=_0x508fe7['substring'](0x0,_0x508fe7[_0xaa5f('0x59')](_0x201b8b));}var _0x300350={'method':_0xaa5f('0x5a'),'uri':util[_0xaa5f('0x5b')](_0xaa5f('0x5c'),_0x508fe7,'ticket_fields'),'json':!![]};switch(_0x424b43['authType']){case _0xaa5f('0x56'):_0x300350[_0xaa5f('0x5d')]={'Authorization':util['format'](_0xaa5f('0x5e'),new Buffer(util['format'](_0xaa5f('0x5f'),_0x424b43[_0xaa5f('0x55')],_0x424b43['password']))[_0xaa5f('0x60')](_0xaa5f('0x61')))};break;case _0xaa5f('0x57'):_0x300350[_0xaa5f('0x5d')]={'Authorization':util[_0xaa5f('0x5b')](_0xaa5f('0x5e'),new Buffer(util[_0xaa5f('0x5b')]('%s/token:%s',_0x424b43[_0xaa5f('0x55')],_0x424b43[_0xaa5f('0x57')]))[_0xaa5f('0x60')]('base64'))};break;default:throw new db[(_0xaa5f('0x62'))][(_0xaa5f('0x63'))](_0xaa5f('0x64'));}return rp(_0x300350);}})[_0xaa5f('0x25')](function(_0x281004){if(_0x281004){var _0x5d4cab=[_0xaa5f('0x65'),_0xaa5f('0x66'),_0xaa5f('0x67'),_0xaa5f('0x68')];_[_0xaa5f('0x69')](_0x281004[_0xaa5f('0x6a')],function(_0x155eb4){return _0x5d4cab[_0xaa5f('0x6b')](_0x155eb4[_0xaa5f('0x3a')]);});return{'count':_0x281004[_0xaa5f('0x6a')]['length'],'rows':_['map'](_0x281004[_0xaa5f('0x6a')],function(_0xa7ecc9){return{'id':_0xa7ecc9['id'],'name':_0xa7ecc9[_0xaa5f('0x6c')]>0x7?_0xa7ecc9[_0xaa5f('0x6d')]:_0xa7ecc9[_0xaa5f('0x3a')],'custom':_0xa7ecc9[_0xaa5f('0x6c')]>0x7?!![]:![],'options':_0xa7ecc9[_0xaa5f('0x6e')]?_0xa7ecc9[_0xaa5f('0x6e')]:_0xa7ecc9['custom_field_options']?_0xa7ecc9[_0xaa5f('0x6f')]:[]};})};}})[_0xaa5f('0x25')](respondWithResult(_0x216399,null))[_0xaa5f('0x3f')](function(_0x5f2484){var _0x55a3f9=_0x464ac7[_0xaa5f('0x2c')][_0xaa5f('0x70')]?0x1f4:_0x5f2484[_0xaa5f('0x71')]||0x1f4;logger[_0xaa5f('0x72')](_0xaa5f('0x73'),_0xaa5f('0x54'),_0x55a3f9,JSON[_0xaa5f('0x74')](_0x5f2484));delete _0x5f2484[_0xaa5f('0x27')];if(_0x55a3f9===0x191){_0x55a3f9=0x190;}_0x216399[_0xaa5f('0x18')](_0x55a3f9)[_0xaa5f('0x28')](_0x464ac7['query'][_0xaa5f('0x70')]?{'message':_0xaa5f('0x75'),'statusCode':_0x5f2484[_0xaa5f('0x71')]}:_0x5f2484);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 66460f2..43f0022 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 _0xf7df=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','lodash','../../config/logger','api'];(function(_0x594802,_0x572fbc){var _0x4901d9=function(_0x36cb90){while(--_0x36cb90){_0x594802['push'](_0x594802['shift']());}};_0x4901d9(++_0x572fbc);}(_0xf7df,0xda));var _0xff7d=function(_0x504803,_0x4e1615){_0x504803=_0x504803-0x0;var _0xd7f311=_0xf7df[_0x504803];return _0xd7f311;};'use strict';var _=require(_0xff7d('0x0'));var util=require('util');var logger=require(_0xff7d('0x1'))(_0xff7d('0x2'));var moment=require(_0xff7d('0x3'));var BPromise=require(_0xff7d('0x4'));var rp=require(_0xff7d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xff7d('0x6'));var config=require(_0xff7d('0x7'));var attributes=require(_0xff7d('0x8'));var integrations=require(_0xff7d('0x9'));module[_0xff7d('0xa')]=function(_0x164ad9,_0x426bc5){return _0x164ad9[_0xff7d('0xb')](_0xff7d('0xc'),attributes,{'tableName':'int_zendesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf96f=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskAccount.attributes','exports','int_zendesk_accounts','lodash','util'];(function(_0x9bfc6c,_0x159ef2){var _0x1f8376=function(_0x475856){while(--_0x475856){_0x9bfc6c['push'](_0x9bfc6c['shift']());}};_0x1f8376(++_0x159ef2);}(_0xf96f,0xbe));var _0xff96=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xf96f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xff96('0x0'));var util=require(_0xff96('0x1'));var logger=require(_0xff96('0x2'))(_0xff96('0x3'));var moment=require('moment');var BPromise=require(_0xff96('0x4'));var rp=require(_0xff96('0x5'));var fs=require('fs');var path=require(_0xff96('0x6'));var rimraf=require(_0xff96('0x7'));var config=require(_0xff96('0x8'));var attributes=require(_0xff96('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xff96('0xa')]=function(_0x3e9be2,_0x45ad9a){return _0x3e9be2['define']('ZendeskAccount',attributes,{'tableName':_0xff96('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 a85efc8..bfc61b6 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 _0x7191=['options','limit','include','map','model','attributes','GetZendeskAccount','stringify','catch','ShowZendeskAccount','find','raw','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','ZendeskAccount,\x20%s,\x20%s','message','info','ZendeskAccount','findAll'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x7191,0x160));var _0x1719=function(_0x3826b0,_0xd15ad5){_0x3826b0=_0x3826b0-0x0;var _0x1b6da8=_0x7191[_0x3826b0];return _0x1b6da8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1719('0x0'));var BPromise=require(_0x1719('0x1'));var rs=require(_0x1719('0x2'));var fs=require('fs');var Redis=require(_0x1719('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1719('0x4'))(_0x1719('0x5'));var config=require(_0x1719('0x6'));var jayson=require(_0x1719('0x7'));var client=jayson[_0x1719('0x8')][_0x1719('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b5257,_0x241578,_0x23fae9){return new BPromise(function(_0x3dc196,_0x5d2bed){return client[_0x1719('0xa')](_0x3b5257,_0x23fae9)[_0x1719('0xb')](function(_0x2b6b4e){logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x241578,_0x1719('0xc'));logger[_0x1719('0xd')](_0x1719('0xe'),_0x241578,_0x1719('0xc'),JSON['stringify'](_0x2b6b4e));if(_0x2b6b4e[_0x1719('0xf')]){if(_0x2b6b4e[_0x1719('0xf')][_0x1719('0x10')]===0x1f4){logger['error'](_0x1719('0x11'),_0x241578,_0x2b6b4e[_0x1719('0xf')][_0x1719('0x12')]);return _0x5d2bed(_0x2b6b4e[_0x1719('0xf')][_0x1719('0x12')]);}logger[_0x1719('0xf')](_0x1719('0x11'),_0x241578,_0x2b6b4e[_0x1719('0xf')]['message']);return _0x3dc196(_0x2b6b4e[_0x1719('0xf')][_0x1719('0x12')]);}else{logger[_0x1719('0x13')](_0x1719('0x11'),_0x241578,'request\x20sent');_0x3dc196(_0x2b6b4e['result'][_0x1719('0x12')]);}})['catch'](function(_0x12286b){logger[_0x1719('0xf')](_0x1719('0x11'),_0x241578,_0x12286b);_0x5d2bed(_0x12286b);});});}exports['GetZendeskAccount']=function(_0x57f42f){var _0x8b4adc=this;return new Promise(function(_0x32e2a1,_0x1791c5){return db[_0x1719('0x14')][_0x1719('0x15')]({'raw':_0x57f42f[_0x1719('0x16')]?_0x57f42f[_0x1719('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x57f42f['options']?_0x57f42f[_0x1719('0x16')]['where']||null:null,'attributes':_0x57f42f[_0x1719('0x16')]?_0x57f42f['options']['attributes']||null:null,'limit':_0x57f42f[_0x1719('0x16')]?_0x57f42f['options'][_0x1719('0x17')]||null:null,'include':_0x57f42f[_0x1719('0x16')]?_0x57f42f['options'][_0x1719('0x18')]?_[_0x1719('0x19')](_0x57f42f[_0x1719('0x16')][_0x1719('0x18')],function(_0x85d80b){return{'model':db[_0x85d80b[_0x1719('0x1a')]],'as':_0x85d80b['as'],'attributes':_0x85d80b['attributes'],'include':_0x85d80b[_0x1719('0x18')]?_[_0x1719('0x19')](_0x85d80b[_0x1719('0x18')],function(_0x5b3ca0){return{'model':db[_0x5b3ca0['model']],'as':_0x5b3ca0['as'],'attributes':_0x5b3ca0[_0x1719('0x1b')],'include':_0x5b3ca0[_0x1719('0x18')]?_[_0x1719('0x19')](_0x5b3ca0[_0x1719('0x18')],function(_0x1f5cf1){return{'model':db[_0x1f5cf1['model']],'as':_0x1f5cf1['as'],'attributes':_0x1f5cf1[_0x1719('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1719('0xb')](function(_0x1989ab){logger['info'](_0x1719('0x1c'),_0x57f42f);logger[_0x1719('0xd')]('GetZendeskAccount',_0x57f42f,JSON[_0x1719('0x1d')](_0x1989ab));_0x32e2a1(_0x1989ab);})[_0x1719('0x1e')](function(_0x513d0b){logger[_0x1719('0xf')](_0x1719('0x1c'),_0x513d0b['message'],_0x57f42f);_0x1791c5(_0x8b4adc['error'](0x1f4,_0x513d0b[_0x1719('0x12')]));});});};exports[_0x1719('0x1f')]=function(_0x779492){var _0x5ddd06=this;return new Promise(function(_0x428b60,_0x20df6b){return db['ZendeskAccount'][_0x1719('0x20')]({'raw':_0x779492['options']?_0x779492['options'][_0x1719('0x21')]===undefined?!![]:![]:!![],'where':_0x779492[_0x1719('0x16')]?_0x779492['options']['where']||null:null,'attributes':_0x779492['options']?_0x779492[_0x1719('0x16')][_0x1719('0x1b')]||null:null,'include':_0x779492['options']?_0x779492[_0x1719('0x16')][_0x1719('0x18')]?_[_0x1719('0x19')](_0x779492[_0x1719('0x16')]['include'],function(_0x558dc8){return{'model':db[_0x558dc8[_0x1719('0x1a')]],'as':_0x558dc8['as'],'attributes':_0x558dc8['attributes'],'include':_0x558dc8[_0x1719('0x18')]?_['map'](_0x558dc8[_0x1719('0x18')],function(_0xcae4c2){return{'model':db[_0xcae4c2[_0x1719('0x1a')]],'as':_0xcae4c2['as'],'attributes':_0xcae4c2['attributes'],'include':_0xcae4c2[_0x1719('0x18')]?_[_0x1719('0x19')](_0xcae4c2[_0x1719('0x18')],function(_0x5aa8be){return{'model':db[_0x5aa8be[_0x1719('0x1a')]],'as':_0x5aa8be['as'],'attributes':_0x5aa8be[_0x1719('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1719('0xb')](function(_0xbf511e){logger[_0x1719('0x13')]('ShowZendeskAccount',_0x779492);logger[_0x1719('0xd')](_0x1719('0x1f'),_0x779492,JSON[_0x1719('0x1d')](_0xbf511e));_0x428b60(_0xbf511e);})[_0x1719('0x1e')](function(_0x9a9c66){logger['error']('ShowZendeskAccount',_0x9a9c66[_0x1719('0x12')],_0x779492);_0x20df6b(_0x5ddd06['error'](0x1f4,_0x9a9c66['message']));});});}; \ No newline at end of file +var _0xd7b0=['debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','ZendeskAccount','options','raw','where','attributes','limit','include','model','map','ShowZendeskAccount','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent'];(function(_0x305b20,_0x5e57e9){var _0x26d64a=function(_0x2e17f0){while(--_0x2e17f0){_0x305b20['push'](_0x305b20['shift']());}};_0x26d64a(++_0x5e57e9);}(_0xd7b0,0x12c));var _0x0d7b=function(_0x388b24,_0x4c7529){_0x388b24=_0x388b24-0x0;var _0x585b85=_0xd7b0[_0x388b24];return _0x585b85;};'use strict';var _=require(_0x0d7b('0x0'));var util=require('util');var moment=require(_0x0d7b('0x1'));var BPromise=require(_0x0d7b('0x2'));var rs=require(_0x0d7b('0x3'));var fs=require('fs');var Redis=require(_0x0d7b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d7b('0x5'));var logger=require(_0x0d7b('0x6'))(_0x0d7b('0x7'));var config=require(_0x0d7b('0x8'));var jayson=require(_0x0d7b('0x9'));var client=jayson['client'][_0x0d7b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x362e41,_0x30a486,_0x23cb2c){return new BPromise(function(_0xe3d8f8,_0x5ae58){return client[_0x0d7b('0xb')](_0x362e41,_0x23cb2c)[_0x0d7b('0xc')](function(_0x549bf1){logger[_0x0d7b('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x30a486,_0x0d7b('0xe'));logger[_0x0d7b('0xf')](_0x0d7b('0x10'),_0x30a486,_0x0d7b('0xe'),JSON[_0x0d7b('0x11')](_0x549bf1));if(_0x549bf1['error']){if(_0x549bf1[_0x0d7b('0x12')][_0x0d7b('0x13')]===0x1f4){logger['error'](_0x0d7b('0x14'),_0x30a486,_0x549bf1[_0x0d7b('0x12')]['message']);return _0x5ae58(_0x549bf1[_0x0d7b('0x12')][_0x0d7b('0x15')]);}logger[_0x0d7b('0x12')]('ZendeskAccount,\x20%s,\x20%s',_0x30a486,_0x549bf1[_0x0d7b('0x12')][_0x0d7b('0x15')]);return _0xe3d8f8(_0x549bf1[_0x0d7b('0x12')]['message']);}else{logger[_0x0d7b('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x30a486,'request\x20sent');_0xe3d8f8(_0x549bf1[_0x0d7b('0x16')][_0x0d7b('0x15')]);}})[_0x0d7b('0x17')](function(_0x4871bf){logger[_0x0d7b('0x12')](_0x0d7b('0x14'),_0x30a486,_0x4871bf);_0x5ae58(_0x4871bf);});});}exports[_0x0d7b('0x18')]=function(_0x28c59e){var _0x74e58e=this;return new Promise(function(_0x248b42,_0x251a18){return db[_0x0d7b('0x19')]['findAll']({'raw':_0x28c59e[_0x0d7b('0x1a')]?_0x28c59e['options'][_0x0d7b('0x1b')]===undefined?!![]:![]:!![],'where':_0x28c59e['options']?_0x28c59e[_0x0d7b('0x1a')][_0x0d7b('0x1c')]||null:null,'attributes':_0x28c59e[_0x0d7b('0x1a')]?_0x28c59e[_0x0d7b('0x1a')][_0x0d7b('0x1d')]||null:null,'limit':_0x28c59e[_0x0d7b('0x1a')]?_0x28c59e[_0x0d7b('0x1a')][_0x0d7b('0x1e')]||null:null,'include':_0x28c59e['options']?_0x28c59e[_0x0d7b('0x1a')][_0x0d7b('0x1f')]?_['map'](_0x28c59e['options']['include'],function(_0x4bc2bd){return{'model':db[_0x4bc2bd[_0x0d7b('0x20')]],'as':_0x4bc2bd['as'],'attributes':_0x4bc2bd[_0x0d7b('0x1d')],'include':_0x4bc2bd[_0x0d7b('0x1f')]?_[_0x0d7b('0x21')](_0x4bc2bd[_0x0d7b('0x1f')],function(_0x4aae29){return{'model':db[_0x4aae29[_0x0d7b('0x20')]],'as':_0x4aae29['as'],'attributes':_0x4aae29[_0x0d7b('0x1d')],'include':_0x4aae29[_0x0d7b('0x1f')]?_['map'](_0x4aae29[_0x0d7b('0x1f')],function(_0x3d73bc){return{'model':db[_0x3d73bc['model']],'as':_0x3d73bc['as'],'attributes':_0x3d73bc['attributes']};}):[]};}):[]};}):[]:[]})[_0x0d7b('0xc')](function(_0x196987){logger[_0x0d7b('0xd')](_0x0d7b('0x18'),_0x28c59e);logger[_0x0d7b('0xf')]('GetZendeskAccount',_0x28c59e,JSON[_0x0d7b('0x11')](_0x196987));_0x248b42(_0x196987);})[_0x0d7b('0x17')](function(_0x3230e9){logger[_0x0d7b('0x12')](_0x0d7b('0x18'),_0x3230e9[_0x0d7b('0x15')],_0x28c59e);_0x251a18(_0x74e58e['error'](0x1f4,_0x3230e9[_0x0d7b('0x15')]));});});};exports[_0x0d7b('0x22')]=function(_0x244e3d){var _0x4f3105=this;return new Promise(function(_0x2b859c,_0x170fcc){return db[_0x0d7b('0x19')]['find']({'raw':_0x244e3d['options']?_0x244e3d[_0x0d7b('0x1a')][_0x0d7b('0x1b')]===undefined?!![]:![]:!![],'where':_0x244e3d[_0x0d7b('0x1a')]?_0x244e3d['options'][_0x0d7b('0x1c')]||null:null,'attributes':_0x244e3d[_0x0d7b('0x1a')]?_0x244e3d['options'][_0x0d7b('0x1d')]||null:null,'include':_0x244e3d[_0x0d7b('0x1a')]?_0x244e3d[_0x0d7b('0x1a')][_0x0d7b('0x1f')]?_['map'](_0x244e3d[_0x0d7b('0x1a')]['include'],function(_0x4d41b9){return{'model':db[_0x4d41b9[_0x0d7b('0x20')]],'as':_0x4d41b9['as'],'attributes':_0x4d41b9[_0x0d7b('0x1d')],'include':_0x4d41b9[_0x0d7b('0x1f')]?_['map'](_0x4d41b9[_0x0d7b('0x1f')],function(_0x25474f){return{'model':db[_0x25474f[_0x0d7b('0x20')]],'as':_0x25474f['as'],'attributes':_0x25474f[_0x0d7b('0x1d')],'include':_0x25474f['include']?_[_0x0d7b('0x21')](_0x25474f[_0x0d7b('0x1f')],function(_0x2c7b3a){return{'model':db[_0x2c7b3a[_0x0d7b('0x20')]],'as':_0x2c7b3a['as'],'attributes':_0x2c7b3a[_0x0d7b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3882ef){logger['info'](_0x0d7b('0x22'),_0x244e3d);logger[_0x0d7b('0xf')](_0x0d7b('0x22'),_0x244e3d,JSON[_0x0d7b('0x11')](_0x3882ef));_0x2b859c(_0x3882ef);})[_0x0d7b('0x17')](function(_0x238ad7){logger['error'](_0x0d7b('0x22'),_0x238ad7[_0x0d7b('0x15')],_0x244e3d);_0x170fcc(_0x4f3105[_0x0d7b('0x12')](0x1f4,_0x238ad7['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 7c1f2c4..8585cd4 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 _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x48326a,_0x8cfa0c){var _0x466709=function(_0x5ab1b7){while(--_0x5ab1b7){_0x48326a['push'](_0x48326a['shift']());}};_0x466709(++_0x8cfa0c);}(_0xb688,0xcf));var _0x8b68=function(_0x582aef,_0xc273e3){_0x582aef=_0x582aef-0x0;var _0x45eb5d=_0xb688[_0x582aef];return _0x45eb5d;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file +var _0xbdb7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller','index','get','show','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getTags','/:id/tags','update','delete','/:id'];(function(_0x51b661,_0x566ef8){var _0x5d1971=function(_0x5cc6b8){while(--_0x5cc6b8){_0x51b661['push'](_0x51b661['shift']());}};_0x5d1971(++_0x566ef8);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x527a01,_0x99a1af){_0x527a01=_0x527a01-0x0;var _0x39d696=_0xbdb7[_0x527a01];return _0x39d696;};'use strict';var multer=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var path=require(_0x7bdb('0x2'));var timeout=require(_0x7bdb('0x3'));var express=require(_0x7bdb('0x4'));var router=express[_0x7bdb('0x5')]();var fs_extra=require(_0x7bdb('0x6'));var auth=require(_0x7bdb('0x7'));var interaction=require(_0x7bdb('0x8'));var config=require('../../config/environment');var controller=require(_0x7bdb('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x7bdb('0xa')]);router[_0x7bdb('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x7bdb('0xc')]);router[_0x7bdb('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x7bdb('0xd')]);router[_0x7bdb('0xb')](_0x7bdb('0xe'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x10')]);router[_0x7bdb('0xb')](_0x7bdb('0x11'),auth[_0x7bdb('0xf')](),controller['getDescriptions']);router['get']('/:id/tags',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x12')]);router['post']('/',auth[_0x7bdb('0xf')](),controller['create']);router['post'](_0x7bdb('0x13'),auth[_0x7bdb('0xf')](),controller['setTags']);router['put']('/:id',auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x14')]);router[_0x7bdb('0x15')](_0x7bdb('0x16'),auth[_0x7bdb('0xf')](),controller[_0x7bdb('0x17')]);module[_0x7bdb('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 871aec5..537bcb7 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 _0x4b89=['STRING','sequelize','exports'];(function(_0x3e2e82,_0x369bbe){var _0xba15aa=function(_0x4ac6d4){while(--_0x4ac6d4){_0x3e2e82['push'](_0x3e2e82['shift']());}};_0xba15aa(++_0x369bbe);}(_0x4b89,0x181));var _0x94b8=function(_0x197115,_0x14d69a){_0x197115=_0x197115-0x0;var _0x19d830=_0x4b89[_0x197115];return _0x19d830;};'use strict';var Sequelize=require(_0x94b8('0x0'));module[_0x94b8('0x1')]={'name':{'type':Sequelize[_0x94b8('0x2')]},'description':{'type':Sequelize[_0x94b8('0x2')]}}; \ No newline at end of file +var _0x94ae=['sequelize','STRING'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x94ae,0xae));var _0xe94a=function(_0x60b2ca,_0x244b4c){_0x60b2ca=_0x60b2ca-0x0;var _0x34ff01=_0x94ae[_0x60b2ca];return _0x34ff01;};'use strict';var Sequelize=require(_0xe94a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe94a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index d9a0636..b900f0d 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 _0xe796=['includeAll','include','rows','catch','show','params','find','create','body','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','status','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options'];(function(_0x437c63,_0x51edaf){var _0x1c5858=function(_0x472873){while(--_0x472873){_0x437c63['push'](_0x437c63['shift']());}};_0x1c5858(++_0x51edaf);}(_0xe796,0x1b6));var _0x6e79=function(_0x18d2f3,_0x5317c8){_0x18d2f3=_0x18d2f3-0x0;var _0x2ff0d2=_0xe796[_0x18d2f3];return _0x2ff0d2;};'use strict';var emlformat=require(_0x6e79('0x0'));var rimraf=require(_0x6e79('0x1'));var zipdir=require(_0x6e79('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6e79('0x3'));var moment=require(_0x6e79('0x4'));var BPromise=require(_0x6e79('0x5'));var Mustache=require(_0x6e79('0x6'));var util=require(_0x6e79('0x7'));var path=require(_0x6e79('0x8'));var sox=require(_0x6e79('0x9'));var csv=require('to-csv');var ejs=require(_0x6e79('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6e79('0xb'));var crypto=require(_0x6e79('0xc'));var jsforce=require(_0x6e79('0xd'));var deskjs=require(_0x6e79('0xe'));var toCsv=require(_0x6e79('0xf'));var querystring=require(_0x6e79('0x10'));var Papa=require(_0x6e79('0x11'));var Redis=require('ioredis');var authService=require(_0x6e79('0x12'));var qs=require(_0x6e79('0x13'));var as=require(_0x6e79('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6e79('0x15'))(_0x6e79('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42b077,_0x568619){_0x568619=_0x568619||0xcc;return function(_0x3966eb){if(_0x3966eb){return _0x42b077[_0x6e79('0x17')](_0x568619);}return _0x42b077[_0x6e79('0x18')](_0x568619)['end']();};}function respondWithResult(_0x565dd0,_0x10d1d4){_0x10d1d4=_0x10d1d4||0xc8;return function(_0x3969a0){if(_0x3969a0){return _0x565dd0['status'](_0x10d1d4)[_0x6e79('0x19')](_0x3969a0);}};}function respondWithFilteredResult(_0x564e0b,_0xe85a3f){return function(_0x177ce2){if(_0x177ce2){var _0x4679cc=typeof _0xe85a3f['offset']===_0x6e79('0x1a')&&typeof _0xe85a3f[_0x6e79('0x1b')]===_0x6e79('0x1a');var _0x2e5522=_0x177ce2[_0x6e79('0x1c')];var _0x5e15b3=_0x4679cc?0x0:_0xe85a3f['offset'];var _0x438fe0=_0x4679cc?_0x177ce2[_0x6e79('0x1c')]:_0xe85a3f['offset']+_0xe85a3f['limit'];var _0x5c08ac;if(_0x438fe0>=_0x2e5522){_0x438fe0=_0x2e5522;_0x5c08ac=0xc8;}else{_0x5c08ac=0xce;}_0x564e0b[_0x6e79('0x18')](_0x5c08ac);return _0x564e0b['set'](_0x6e79('0x1d'),_0x5e15b3+'-'+_0x438fe0+'/'+_0x2e5522)[_0x6e79('0x19')](_0x177ce2);}return null;};}function patchUpdates(_0xdec429){return function(_0x1148ca){try{jsonpatch[_0x6e79('0x1e')](_0x1148ca,_0xdec429,!![]);}catch(_0x4fe7d6){return BPromise[_0x6e79('0x1f')](_0x4fe7d6);}return _0x1148ca[_0x6e79('0x20')]();};}function saveUpdates(_0x264029,_0x31c395){return function(_0x3bc462){if(_0x3bc462){return _0x3bc462[_0x6e79('0x21')](_0x264029)[_0x6e79('0x22')](function(_0x3e1560){return _0x3e1560;});}return null;};}function removeEntity(_0x54159b,_0x1d90e6){return function(_0x2ea063){if(_0x2ea063){return _0x2ea063[_0x6e79('0x23')]()[_0x6e79('0x22')](function(){_0x54159b[_0x6e79('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x544420,_0x2b1901){return function(_0x5ea353){if(!_0x5ea353){_0x544420['sendStatus'](0x194);}return _0x5ea353;};}function handleError(_0x603385,_0x398ff8){_0x398ff8=_0x398ff8||0x1f4;return function(_0x2bc504){logger[_0x6e79('0x24')](_0x2bc504[_0x6e79('0x25')]);if(_0x2bc504[_0x6e79('0x26')]){delete _0x2bc504['name'];}_0x603385[_0x6e79('0x18')](_0x398ff8)[_0x6e79('0x27')](_0x2bc504);};}exports[_0x6e79('0x28')]=function(_0x373ed6,_0x5053fd){var _0x1020ac={},_0x3919d3={},_0x43baef={'count':0x0,'rows':[]};var _0x18e20e=_[_0x6e79('0x29')](db[_0x6e79('0x2a')][_0x6e79('0x2b')],function(_0x39f422){return{'name':_0x39f422[_0x6e79('0x2c')],'type':_0x39f422['type'][_0x6e79('0x2d')]};});_0x3919d3[_0x6e79('0x2e')]=_['map'](_0x18e20e,_0x6e79('0x26'));_0x3919d3['query']=_[_0x6e79('0x2f')](_0x373ed6['query']);_0x3919d3[_0x6e79('0x30')]=_[_0x6e79('0x31')](_0x3919d3[_0x6e79('0x2e')],_0x3919d3[_0x6e79('0x32')]);_0x1020ac['attributes']=_[_0x6e79('0x31')](_0x3919d3[_0x6e79('0x2e')],qs[_0x6e79('0x33')](_0x373ed6[_0x6e79('0x32')][_0x6e79('0x33')]));_0x1020ac[_0x6e79('0x34')]=_0x1020ac[_0x6e79('0x34')][_0x6e79('0x35')]?_0x1020ac[_0x6e79('0x34')]:_0x3919d3[_0x6e79('0x2e')];if(!_0x373ed6[_0x6e79('0x32')][_0x6e79('0x36')](_0x6e79('0x37'))){_0x1020ac['limit']=qs[_0x6e79('0x1b')](_0x373ed6[_0x6e79('0x32')][_0x6e79('0x1b')]);_0x1020ac[_0x6e79('0x38')]=qs[_0x6e79('0x38')](_0x373ed6[_0x6e79('0x32')][_0x6e79('0x38')]);}_0x1020ac[_0x6e79('0x39')]=qs[_0x6e79('0x3a')](_0x373ed6[_0x6e79('0x32')][_0x6e79('0x3a')]);_0x1020ac[_0x6e79('0x3b')]=qs[_0x6e79('0x30')](_[_0x6e79('0x3c')](_0x373ed6[_0x6e79('0x32')],_0x3919d3[_0x6e79('0x30')]),_0x18e20e);if(_0x373ed6[_0x6e79('0x32')][_0x6e79('0x3d')]){_0x1020ac[_0x6e79('0x3b')]=_[_0x6e79('0x3e')](_0x1020ac[_0x6e79('0x3b')],{'$or':_[_0x6e79('0x29')](_0x18e20e,function(_0x4cb0e4){if(_0x4cb0e4[_0x6e79('0x3f')]!==_0x6e79('0x40')){var _0x142162={};_0x142162[_0x4cb0e4[_0x6e79('0x26')]]={'$like':'%'+_0x373ed6[_0x6e79('0x32')][_0x6e79('0x3d')]+'%'};return _0x142162;}})});}_0x1020ac=_[_0x6e79('0x3e')]({},_0x1020ac,_0x373ed6[_0x6e79('0x41')]);var _0x372c66={'where':_0x1020ac[_0x6e79('0x3b')]};return db['ZendeskConfiguration']['count'](_0x372c66)['then'](function(_0x1d4a7d){_0x43baef['count']=_0x1d4a7d;if(_0x373ed6[_0x6e79('0x32')][_0x6e79('0x42')]){_0x1020ac[_0x6e79('0x43')]=[{'all':!![]}];}return db[_0x6e79('0x2a')]['findAll'](_0x1020ac);})[_0x6e79('0x22')](function(_0x9a3c60){_0x43baef[_0x6e79('0x44')]=_0x9a3c60;return _0x43baef;})[_0x6e79('0x22')](respondWithFilteredResult(_0x5053fd,_0x1020ac))[_0x6e79('0x45')](handleError(_0x5053fd,null));};exports[_0x6e79('0x46')]=function(_0xaf58a8,_0x1e33ff){var _0x2a0b20={'raw':![],'where':{'id':_0xaf58a8[_0x6e79('0x47')]['id']}},_0x3c230b={};_0x3c230b[_0x6e79('0x2e')]=_['keys'](db[_0x6e79('0x2a')]['rawAttributes']);_0x3c230b[_0x6e79('0x32')]=_[_0x6e79('0x2f')](_0xaf58a8['query']);_0x3c230b[_0x6e79('0x30')]=_['intersection'](_0x3c230b['model'],_0x3c230b[_0x6e79('0x32')]);_0x2a0b20[_0x6e79('0x34')]=_[_0x6e79('0x31')](_0x3c230b[_0x6e79('0x2e')],qs[_0x6e79('0x33')](_0xaf58a8[_0x6e79('0x32')][_0x6e79('0x33')]));_0x2a0b20[_0x6e79('0x34')]=_0x2a0b20[_0x6e79('0x34')][_0x6e79('0x35')]?_0x2a0b20['attributes']:_0x3c230b[_0x6e79('0x2e')];if(_0xaf58a8[_0x6e79('0x32')][_0x6e79('0x42')]){_0x2a0b20['include']=[{'all':!![]}];}_0x2a0b20=_[_0x6e79('0x3e')]({},_0x2a0b20,_0xaf58a8['options']);return db[_0x6e79('0x2a')][_0x6e79('0x48')](_0x2a0b20)[_0x6e79('0x22')](handleEntityNotFound(_0x1e33ff,null))['then'](respondWithResult(_0x1e33ff,null))[_0x6e79('0x45')](handleError(_0x1e33ff,null));};exports['create']=function(_0x309fe0,_0x4600de){return db[_0x6e79('0x2a')][_0x6e79('0x49')](_0x309fe0['body'],{})[_0x6e79('0x22')](respondWithResult(_0x4600de,0xc9))[_0x6e79('0x45')](handleError(_0x4600de,null));};exports[_0x6e79('0x21')]=function(_0x5ecf0a,_0x5e698d){if(_0x5ecf0a['body']['id']){delete _0x5ecf0a[_0x6e79('0x4a')]['id'];}return db['ZendeskConfiguration'][_0x6e79('0x48')]({'where':{'id':_0x5ecf0a[_0x6e79('0x47')]['id']}})[_0x6e79('0x22')](handleEntityNotFound(_0x5e698d,null))[_0x6e79('0x22')](saveUpdates(_0x5ecf0a[_0x6e79('0x4a')],null))[_0x6e79('0x22')](respondWithResult(_0x5e698d,null))[_0x6e79('0x45')](handleError(_0x5e698d,null));};exports['destroy']=function(_0x5d6173,_0x53969e){return db[_0x6e79('0x2a')][_0x6e79('0x48')]({'where':{'id':_0x5d6173[_0x6e79('0x47')]['id']}})[_0x6e79('0x22')](handleEntityNotFound(_0x53969e,null))['then'](removeEntity(_0x53969e,null))[_0x6e79('0x45')](handleError(_0x53969e,null));};exports[_0x6e79('0x4b')]=function(_0x17ed88,_0xc422aa,_0x9e7f9a){var _0x510427={};var _0x505938={};var _0x2c9a39;var _0x2d0f4f;return db[_0x6e79('0x2a')][_0x6e79('0x4c')]({'where':{'id':_0x17ed88[_0x6e79('0x47')]['id']}})[_0x6e79('0x22')](handleEntityNotFound(_0xc422aa,null))['then'](function(_0x138619){if(_0x138619){_0x2c9a39=_0x138619;_0x505938['model']=_[_0x6e79('0x2f')](db[_0x6e79('0x4d')][_0x6e79('0x2b')]);_0x505938[_0x6e79('0x32')]=_[_0x6e79('0x2f')](_0x17ed88[_0x6e79('0x32')]);_0x505938[_0x6e79('0x30')]=_[_0x6e79('0x31')](_0x505938[_0x6e79('0x2e')],_0x505938['query']);_0x510427['attributes']=_['intersection'](_0x505938['model'],qs[_0x6e79('0x33')](_0x17ed88[_0x6e79('0x32')][_0x6e79('0x33')]));_0x510427[_0x6e79('0x34')]=_0x510427[_0x6e79('0x34')][_0x6e79('0x35')]?_0x510427[_0x6e79('0x34')]:_0x505938[_0x6e79('0x2e')];_0x510427[_0x6e79('0x39')]=qs[_0x6e79('0x3a')](_0x17ed88[_0x6e79('0x32')][_0x6e79('0x3a')]);_0x510427[_0x6e79('0x3b')]=qs[_0x6e79('0x30')](_[_0x6e79('0x3c')](_0x17ed88['query'],_0x505938['filters']));if(_0x17ed88[_0x6e79('0x32')][_0x6e79('0x3d')]){_0x510427[_0x6e79('0x3b')]=_['merge'](_0x510427['where'],{'$or':_[_0x6e79('0x29')](_0x510427[_0x6e79('0x34')],function(_0x3c509d){var _0x1a9ee3={};_0x1a9ee3[_0x3c509d]={'$like':'%'+_0x17ed88[_0x6e79('0x32')]['filter']+'%'};return _0x1a9ee3;})});}_0x510427=_[_0x6e79('0x3e')]({},_0x510427,_0x17ed88[_0x6e79('0x41')]);return _0x2c9a39[_0x6e79('0x4b')](_0x510427);}})[_0x6e79('0x22')](function(_0x2e982e){if(_0x2e982e){_0x2d0f4f=_0x2e982e[_0x6e79('0x35')];if(!_0x17ed88['query'][_0x6e79('0x36')](_0x6e79('0x37'))){_0x510427['limit']=qs['limit'](_0x17ed88[_0x6e79('0x32')][_0x6e79('0x1b')]);_0x510427[_0x6e79('0x38')]=qs['offset'](_0x17ed88[_0x6e79('0x32')][_0x6e79('0x38')]);}return _0x2c9a39[_0x6e79('0x4b')](_0x510427);}})['then'](function(_0x127a67){if(_0x127a67){return _0x127a67?{'count':_0x2d0f4f,'rows':_0x127a67}:null;}})['then'](respondWithResult(_0xc422aa,null))[_0x6e79('0x45')](handleError(_0xc422aa,null));};exports[_0x6e79('0x4e')]=function(_0x51a142,_0xe5ccdb,_0x41edfb){var _0x6075eb={};var _0x2adad2={};var _0x278480;var _0x4f5692;return db[_0x6e79('0x2a')][_0x6e79('0x4c')]({'where':{'id':_0x51a142['params']['id']}})[_0x6e79('0x22')](handleEntityNotFound(_0xe5ccdb,null))[_0x6e79('0x22')](function(_0x2ac575){if(_0x2ac575){_0x278480=_0x2ac575;_0x2adad2[_0x6e79('0x2e')]=_[_0x6e79('0x2f')](db[_0x6e79('0x4d')][_0x6e79('0x2b')]);_0x2adad2[_0x6e79('0x32')]=_['keys'](_0x51a142[_0x6e79('0x32')]);_0x2adad2[_0x6e79('0x30')]=_[_0x6e79('0x31')](_0x2adad2[_0x6e79('0x2e')],_0x2adad2[_0x6e79('0x32')]);_0x6075eb[_0x6e79('0x34')]=_[_0x6e79('0x31')](_0x2adad2[_0x6e79('0x2e')],qs[_0x6e79('0x33')](_0x51a142[_0x6e79('0x32')][_0x6e79('0x33')]));_0x6075eb[_0x6e79('0x34')]=_0x6075eb['attributes'][_0x6e79('0x35')]?_0x6075eb[_0x6e79('0x34')]:_0x2adad2['model'];_0x6075eb['order']=qs[_0x6e79('0x3a')](_0x51a142[_0x6e79('0x32')][_0x6e79('0x3a')]);_0x6075eb[_0x6e79('0x3b')]=qs['filters'](_[_0x6e79('0x3c')](_0x51a142[_0x6e79('0x32')],_0x2adad2[_0x6e79('0x30')]));if(_0x51a142['query']['filter']){_0x6075eb[_0x6e79('0x3b')]=_[_0x6e79('0x3e')](_0x6075eb[_0x6e79('0x3b')],{'$or':_[_0x6e79('0x29')](_0x6075eb[_0x6e79('0x34')],function(_0x1c8688){var _0x363aa7={};_0x363aa7[_0x1c8688]={'$like':'%'+_0x51a142[_0x6e79('0x32')][_0x6e79('0x3d')]+'%'};return _0x363aa7;})});}_0x6075eb=_[_0x6e79('0x3e')]({},_0x6075eb,_0x51a142[_0x6e79('0x41')]);return _0x278480[_0x6e79('0x4e')](_0x6075eb);}})['then'](function(_0x3613de){if(_0x3613de){_0x4f5692=_0x3613de[_0x6e79('0x35')];if(!_0x51a142[_0x6e79('0x32')][_0x6e79('0x36')](_0x6e79('0x37'))){_0x6075eb[_0x6e79('0x1b')]=qs[_0x6e79('0x1b')](_0x51a142[_0x6e79('0x32')][_0x6e79('0x1b')]);_0x6075eb[_0x6e79('0x38')]=qs['offset'](_0x51a142[_0x6e79('0x32')][_0x6e79('0x38')]);}return _0x278480[_0x6e79('0x4e')](_0x6075eb);}})['then'](function(_0x30917a){if(_0x30917a){return _0x30917a?{'count':_0x4f5692,'rows':_0x30917a}:null;}})[_0x6e79('0x22')](respondWithResult(_0xe5ccdb,null))['catch'](handleError(_0xe5ccdb,null));};exports[_0x6e79('0x4f')]=function(_0x1eb7ff,_0x5c68ec,_0x3d36e7){var _0x3b4927={};var _0x3b55fe={};var _0x4fac1e;var _0x26cf28;return db[_0x6e79('0x2a')][_0x6e79('0x4c')]({'where':{'id':_0x1eb7ff[_0x6e79('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c68ec,null))['then'](function(_0x279501){if(_0x279501){_0x4fac1e=_0x279501;_0x3b55fe[_0x6e79('0x2e')]=_[_0x6e79('0x2f')](db[_0x6e79('0x4d')][_0x6e79('0x2b')]);_0x3b55fe[_0x6e79('0x32')]=_[_0x6e79('0x2f')](_0x1eb7ff['query']);_0x3b55fe[_0x6e79('0x30')]=_[_0x6e79('0x31')](_0x3b55fe['model'],_0x3b55fe[_0x6e79('0x32')]);_0x3b4927[_0x6e79('0x34')]=_['intersection'](_0x3b55fe[_0x6e79('0x2e')],qs[_0x6e79('0x33')](_0x1eb7ff['query'][_0x6e79('0x33')]));_0x3b4927[_0x6e79('0x34')]=_0x3b4927[_0x6e79('0x34')][_0x6e79('0x35')]?_0x3b4927[_0x6e79('0x34')]:_0x3b55fe[_0x6e79('0x2e')];_0x3b4927[_0x6e79('0x39')]=qs[_0x6e79('0x3a')](_0x1eb7ff[_0x6e79('0x32')][_0x6e79('0x3a')]);_0x3b4927['where']=qs[_0x6e79('0x30')](_[_0x6e79('0x3c')](_0x1eb7ff[_0x6e79('0x32')],_0x3b55fe[_0x6e79('0x30')]));if(_0x1eb7ff[_0x6e79('0x32')]['filter']){_0x3b4927[_0x6e79('0x3b')]=_[_0x6e79('0x3e')](_0x3b4927['where'],{'$or':_[_0x6e79('0x29')](_0x3b4927[_0x6e79('0x34')],function(_0x179e05){var _0x572a48={};_0x572a48[_0x179e05]={'$like':'%'+_0x1eb7ff[_0x6e79('0x32')][_0x6e79('0x3d')]+'%'};return _0x572a48;})});}_0x3b4927=_[_0x6e79('0x3e')]({},_0x3b4927,_0x1eb7ff['options']);return _0x4fac1e[_0x6e79('0x4f')](_0x3b4927);}})['then'](function(_0x4de48d){if(_0x4de48d){_0x26cf28=_0x4de48d[_0x6e79('0x35')];if(!_0x1eb7ff[_0x6e79('0x32')][_0x6e79('0x36')](_0x6e79('0x37'))){_0x3b4927['limit']=qs[_0x6e79('0x1b')](_0x1eb7ff[_0x6e79('0x32')][_0x6e79('0x1b')]);_0x3b4927[_0x6e79('0x38')]=qs[_0x6e79('0x38')](_0x1eb7ff['query'][_0x6e79('0x38')]);}return _0x4fac1e[_0x6e79('0x4f')](_0x3b4927);}})[_0x6e79('0x22')](function(_0x1b1957){if(_0x1b1957){return _0x1b1957?{'count':_0x26cf28,'rows':_0x1b1957}:null;}})[_0x6e79('0x22')](respondWithResult(_0x5c68ec,null))[_0x6e79('0x45')](handleError(_0x5c68ec,null));};exports[_0x6e79('0x50')]=function(_0x2af65b,_0xec8596,_0x425443){var _0x1aaf44={};var _0x5b99e6={};var _0x290316;var _0x15abd7;return db[_0x6e79('0x2a')][_0x6e79('0x4c')]({'where':{'id':_0x2af65b[_0x6e79('0x47')]['id']}})[_0x6e79('0x22')](handleEntityNotFound(_0xec8596,null))[_0x6e79('0x22')](function(_0x433025){if(_0x433025){_0x290316=_0x433025;_0x5b99e6[_0x6e79('0x2e')]=_[_0x6e79('0x2f')](db[_0x6e79('0x51')]['rawAttributes']);_0x5b99e6['query']=_['keys'](_0x2af65b[_0x6e79('0x32')]);_0x5b99e6[_0x6e79('0x30')]=_['intersection'](_0x5b99e6[_0x6e79('0x2e')],_0x5b99e6[_0x6e79('0x32')]);_0x1aaf44[_0x6e79('0x34')]=_[_0x6e79('0x31')](_0x5b99e6[_0x6e79('0x2e')],qs['fields'](_0x2af65b[_0x6e79('0x32')][_0x6e79('0x33')]));_0x1aaf44['attributes']=_0x1aaf44[_0x6e79('0x34')][_0x6e79('0x35')]?_0x1aaf44[_0x6e79('0x34')]:_0x5b99e6['model'];_0x1aaf44[_0x6e79('0x39')]=qs['sort'](_0x2af65b[_0x6e79('0x32')]['sort']);_0x1aaf44['where']=qs[_0x6e79('0x30')](_['pick'](_0x2af65b[_0x6e79('0x32')],_0x5b99e6[_0x6e79('0x30')]));if(_0x2af65b[_0x6e79('0x32')][_0x6e79('0x3d')]){_0x1aaf44[_0x6e79('0x3b')]=_[_0x6e79('0x3e')](_0x1aaf44[_0x6e79('0x3b')],{'$or':_[_0x6e79('0x29')](_0x1aaf44[_0x6e79('0x34')],function(_0xff031){var _0x310639={};_0x310639[_0xff031]={'$like':'%'+_0x2af65b[_0x6e79('0x32')][_0x6e79('0x3d')]+'%'};return _0x310639;})});}_0x1aaf44=_[_0x6e79('0x3e')]({},_0x1aaf44,_0x2af65b[_0x6e79('0x41')]);return _0x290316['getTags'](_0x1aaf44);}})[_0x6e79('0x22')](function(_0xa330d2){if(_0xa330d2){_0x15abd7=_0xa330d2['length'];if(!_0x2af65b['query']['hasOwnProperty'](_0x6e79('0x37'))){_0x1aaf44[_0x6e79('0x1b')]=qs[_0x6e79('0x1b')](_0x2af65b[_0x6e79('0x32')][_0x6e79('0x1b')]);_0x1aaf44[_0x6e79('0x38')]=qs[_0x6e79('0x38')](_0x2af65b[_0x6e79('0x32')][_0x6e79('0x38')]);}return _0x290316['getTags'](_0x1aaf44);}})[_0x6e79('0x22')](function(_0x32977c){if(_0x32977c){return _0x32977c?{'count':_0x15abd7,'rows':_0x32977c}:null;}})[_0x6e79('0x22')](respondWithResult(_0xec8596,null))[_0x6e79('0x45')](handleError(_0xec8596,null));};exports[_0x6e79('0x52')]=function(_0x3656b4,_0x1257d6,_0x344889){if(_0x3656b4['body']['id']){delete _0x3656b4[_0x6e79('0x4a')]['id'];}return db[_0x6e79('0x2a')][_0x6e79('0x4c')]({'where':{'id':_0x3656b4[_0x6e79('0x47')]['id']}})[_0x6e79('0x22')](handleEntityNotFound(_0x1257d6,null))['then'](function(_0x4b2021){if(_0x4b2021){return _0x4b2021['setTags'](_0x3656b4['body'][_0x6e79('0x53')]||[]);}return null;})['then'](respondWithResult(_0x1257d6,null))[_0x6e79('0x45')](handleError(_0x1257d6,null));}; \ No newline at end of file +var _0x549c=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','rows','rawAttributes','options','catch','create','body','find','params','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','ZendeskConfiguration','type','key'];(function(_0x2ff2e4,_0x73bbc8){var _0xad9e12=function(_0x5f5930){while(--_0x5f5930){_0x2ff2e4['push'](_0x2ff2e4['shift']());}};_0xad9e12(++_0x73bbc8);}(_0x549c,0x120));var _0xc549=function(_0x56a7ef,_0x2e44fa){_0x56a7ef=_0x56a7ef-0x0;var _0x5f36d5=_0x549c[_0x56a7ef];return _0x5f36d5;};'use strict';var emlformat=require(_0xc549('0x0'));var rimraf=require(_0xc549('0x1'));var zipdir=require(_0xc549('0x2'));var jsonpatch=require(_0xc549('0x3'));var rp=require(_0xc549('0x4'));var moment=require(_0xc549('0x5'));var BPromise=require(_0xc549('0x6'));var Mustache=require('mustache');var util=require(_0xc549('0x7'));var path=require(_0xc549('0x8'));var sox=require(_0xc549('0x9'));var csv=require('to-csv');var ejs=require(_0xc549('0xa'));var fs=require('fs');var fs_extra=require(_0xc549('0xb'));var _=require(_0xc549('0xc'));var squel=require(_0xc549('0xd'));var crypto=require(_0xc549('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc549('0xf'));var toCsv=require(_0xc549('0x10'));var querystring=require(_0xc549('0x11'));var Papa=require(_0xc549('0x12'));var Redis=require(_0xc549('0x13'));var authService=require(_0xc549('0x14'));var qs=require(_0xc549('0x15'));var as=require(_0xc549('0x16'));var hardwareService=require(_0xc549('0x17'));var logger=require('../../config/logger')('api');var utils=require(_0xc549('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc549('0x19'));var db=require(_0xc549('0x1a'))['db'];function respondWithStatusCode(_0x215f7d,_0x57dc7c){_0x57dc7c=_0x57dc7c||0xcc;return function(_0x14b1a6){if(_0x14b1a6){return _0x215f7d[_0xc549('0x1b')](_0x57dc7c);}return _0x215f7d[_0xc549('0x1c')](_0x57dc7c)[_0xc549('0x1d')]();};}function respondWithResult(_0x234f3a,_0x412cc1){_0x412cc1=_0x412cc1||0xc8;return function(_0x3c8f52){if(_0x3c8f52){return _0x234f3a[_0xc549('0x1c')](_0x412cc1)['json'](_0x3c8f52);}};}function respondWithFilteredResult(_0x19cac9,_0x152b40){return function(_0x17bc2b){if(_0x17bc2b){var _0x3c344c=typeof _0x152b40[_0xc549('0x1e')]==='undefined'&&typeof _0x152b40['limit']==='undefined';var _0x597638=_0x17bc2b[_0xc549('0x1f')];var _0xdff776=_0x3c344c?0x0:_0x152b40[_0xc549('0x1e')];var _0x1be438=_0x3c344c?_0x17bc2b[_0xc549('0x1f')]:_0x152b40[_0xc549('0x1e')]+_0x152b40[_0xc549('0x20')];var _0x5ed28d;if(_0x1be438>=_0x597638){_0x1be438=_0x597638;_0x5ed28d=0xc8;}else{_0x5ed28d=0xce;}_0x19cac9[_0xc549('0x1c')](_0x5ed28d);return _0x19cac9['set'](_0xc549('0x21'),_0xdff776+'-'+_0x1be438+'/'+_0x597638)['json'](_0x17bc2b);}return null;};}function patchUpdates(_0xce419a){return function(_0x20f8b9){try{jsonpatch[_0xc549('0x22')](_0x20f8b9,_0xce419a,!![]);}catch(_0x5440f5){return BPromise['reject'](_0x5440f5);}return _0x20f8b9[_0xc549('0x23')]();};}function saveUpdates(_0x1e53ce,_0x2d30fe){return function(_0x18f874){if(_0x18f874){return _0x18f874[_0xc549('0x24')](_0x1e53ce)[_0xc549('0x25')](function(_0x199ace){return _0x199ace;});}return null;};}function removeEntity(_0x418964,_0x14adc0){return function(_0x1aa67f){if(_0x1aa67f){return _0x1aa67f[_0xc549('0x26')]()[_0xc549('0x25')](function(){_0x418964[_0xc549('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xfe1e65,_0x217d5f){return function(_0x5e58cb){if(!_0x5e58cb){_0xfe1e65['sendStatus'](0x194);}return _0x5e58cb;};}function handleError(_0xc350ab,_0x22254a){_0x22254a=_0x22254a||0x1f4;return function(_0x5e07e7){logger[_0xc549('0x27')](_0x5e07e7[_0xc549('0x28')]);if(_0x5e07e7[_0xc549('0x29')]){delete _0x5e07e7[_0xc549('0x29')];}_0xc350ab[_0xc549('0x1c')](_0x22254a)[_0xc549('0x2a')](_0x5e07e7);};}exports[_0xc549('0x2b')]=function(_0x43e1cb,_0x37732a){var _0x528ab2={},_0x409646={},_0x532887={'count':0x0,'rows':[]};var _0x1fe539=_[_0xc549('0x2c')](db[_0xc549('0x2d')]['rawAttributes'],function(_0x106b48){return{'name':_0x106b48['fieldName'],'type':_0x106b48[_0xc549('0x2e')][_0xc549('0x2f')]};});_0x409646[_0xc549('0x30')]=_['map'](_0x1fe539,_0xc549('0x29'));_0x409646[_0xc549('0x31')]=_[_0xc549('0x32')](_0x43e1cb[_0xc549('0x31')]);_0x409646[_0xc549('0x33')]=_[_0xc549('0x34')](_0x409646[_0xc549('0x30')],_0x409646[_0xc549('0x31')]);_0x528ab2[_0xc549('0x35')]=_[_0xc549('0x34')](_0x409646[_0xc549('0x30')],qs[_0xc549('0x36')](_0x43e1cb[_0xc549('0x31')]['fields']));_0x528ab2[_0xc549('0x35')]=_0x528ab2[_0xc549('0x35')][_0xc549('0x37')]?_0x528ab2[_0xc549('0x35')]:_0x409646[_0xc549('0x30')];if(!_0x43e1cb[_0xc549('0x31')][_0xc549('0x38')](_0xc549('0x39'))){_0x528ab2[_0xc549('0x20')]=qs[_0xc549('0x20')](_0x43e1cb[_0xc549('0x31')][_0xc549('0x20')]);_0x528ab2['offset']=qs[_0xc549('0x1e')](_0x43e1cb[_0xc549('0x31')]['offset']);}_0x528ab2[_0xc549('0x3a')]=qs[_0xc549('0x3b')](_0x43e1cb[_0xc549('0x31')]['sort']);_0x528ab2[_0xc549('0x3c')]=qs[_0xc549('0x33')](_[_0xc549('0x3d')](_0x43e1cb[_0xc549('0x31')],_0x409646[_0xc549('0x33')]),_0x1fe539);if(_0x43e1cb[_0xc549('0x31')]['filter']){_0x528ab2[_0xc549('0x3c')]=_['merge'](_0x528ab2['where'],{'$or':_[_0xc549('0x2c')](_0x1fe539,function(_0x2a53a2){if(_0x2a53a2[_0xc549('0x2e')]!==_0xc549('0x3e')){var _0x1db2ac={};_0x1db2ac[_0x2a53a2[_0xc549('0x29')]]={'$like':'%'+_0x43e1cb[_0xc549('0x31')][_0xc549('0x3f')]+'%'};return _0x1db2ac;}})});}_0x528ab2=_[_0xc549('0x40')]({},_0x528ab2,_0x43e1cb['options']);var _0x516a61={'where':_0x528ab2[_0xc549('0x3c')]};return db['ZendeskConfiguration'][_0xc549('0x1f')](_0x516a61)['then'](function(_0x5ca689){_0x532887[_0xc549('0x1f')]=_0x5ca689;if(_0x43e1cb[_0xc549('0x31')][_0xc549('0x41')]){_0x528ab2[_0xc549('0x42')]=[{'all':!![]}];}return db[_0xc549('0x2d')]['findAll'](_0x528ab2);})[_0xc549('0x25')](function(_0x332be5){_0x532887[_0xc549('0x43')]=_0x332be5;return _0x532887;})[_0xc549('0x25')](respondWithFilteredResult(_0x37732a,_0x528ab2))['catch'](handleError(_0x37732a,null));};exports['show']=function(_0x2379f2,_0x421b39){var _0x5854f7={'raw':![],'where':{'id':_0x2379f2['params']['id']}},_0x176185={};_0x176185[_0xc549('0x30')]=_[_0xc549('0x32')](db[_0xc549('0x2d')][_0xc549('0x44')]);_0x176185[_0xc549('0x31')]=_[_0xc549('0x32')](_0x2379f2['query']);_0x176185['filters']=_[_0xc549('0x34')](_0x176185['model'],_0x176185[_0xc549('0x31')]);_0x5854f7[_0xc549('0x35')]=_[_0xc549('0x34')](_0x176185[_0xc549('0x30')],qs[_0xc549('0x36')](_0x2379f2['query'][_0xc549('0x36')]));_0x5854f7['attributes']=_0x5854f7[_0xc549('0x35')][_0xc549('0x37')]?_0x5854f7['attributes']:_0x176185[_0xc549('0x30')];if(_0x2379f2[_0xc549('0x31')][_0xc549('0x41')]){_0x5854f7[_0xc549('0x42')]=[{'all':!![]}];}_0x5854f7=_[_0xc549('0x40')]({},_0x5854f7,_0x2379f2[_0xc549('0x45')]);return db[_0xc549('0x2d')]['find'](_0x5854f7)[_0xc549('0x25')](handleEntityNotFound(_0x421b39,null))[_0xc549('0x25')](respondWithResult(_0x421b39,null))[_0xc549('0x46')](handleError(_0x421b39,null));};exports['create']=function(_0x44df12,_0x3e9061){return db[_0xc549('0x2d')][_0xc549('0x47')](_0x44df12[_0xc549('0x48')],{})[_0xc549('0x25')](respondWithResult(_0x3e9061,0xc9))['catch'](handleError(_0x3e9061,null));};exports[_0xc549('0x24')]=function(_0x268604,_0x467021){if(_0x268604[_0xc549('0x48')]['id']){delete _0x268604[_0xc549('0x48')]['id'];}return db['ZendeskConfiguration'][_0xc549('0x49')]({'where':{'id':_0x268604[_0xc549('0x4a')]['id']}})[_0xc549('0x25')](handleEntityNotFound(_0x467021,null))['then'](saveUpdates(_0x268604[_0xc549('0x48')],null))['then'](respondWithResult(_0x467021,null))[_0xc549('0x46')](handleError(_0x467021,null));};exports[_0xc549('0x26')]=function(_0x559219,_0x514e9b){return db[_0xc549('0x2d')][_0xc549('0x49')]({'where':{'id':_0x559219[_0xc549('0x4a')]['id']}})[_0xc549('0x25')](handleEntityNotFound(_0x514e9b,null))['then'](removeEntity(_0x514e9b,null))[_0xc549('0x46')](handleError(_0x514e9b,null));};exports[_0xc549('0x4b')]=function(_0x3e137a,_0x48e925,_0x14de03){var _0x4fae3d={};var _0x1ec6d7={};var _0x4db57c;var _0x1e8761;return db[_0xc549('0x2d')][_0xc549('0x4c')]({'where':{'id':_0x3e137a['params']['id']}})[_0xc549('0x25')](handleEntityNotFound(_0x48e925,null))[_0xc549('0x25')](function(_0x2daa5e){if(_0x2daa5e){_0x4db57c=_0x2daa5e;_0x1ec6d7['model']=_['keys'](db[_0xc549('0x4d')][_0xc549('0x44')]);_0x1ec6d7['query']=_['keys'](_0x3e137a[_0xc549('0x31')]);_0x1ec6d7[_0xc549('0x33')]=_[_0xc549('0x34')](_0x1ec6d7[_0xc549('0x30')],_0x1ec6d7['query']);_0x4fae3d[_0xc549('0x35')]=_[_0xc549('0x34')](_0x1ec6d7[_0xc549('0x30')],qs[_0xc549('0x36')](_0x3e137a[_0xc549('0x31')][_0xc549('0x36')]));_0x4fae3d[_0xc549('0x35')]=_0x4fae3d['attributes'][_0xc549('0x37')]?_0x4fae3d['attributes']:_0x1ec6d7[_0xc549('0x30')];_0x4fae3d['order']=qs[_0xc549('0x3b')](_0x3e137a[_0xc549('0x31')][_0xc549('0x3b')]);_0x4fae3d[_0xc549('0x3c')]=qs[_0xc549('0x33')](_[_0xc549('0x3d')](_0x3e137a[_0xc549('0x31')],_0x1ec6d7[_0xc549('0x33')]));if(_0x3e137a[_0xc549('0x31')]['filter']){_0x4fae3d['where']=_[_0xc549('0x40')](_0x4fae3d[_0xc549('0x3c')],{'$or':_['map'](_0x4fae3d[_0xc549('0x35')],function(_0x5e01d8){var _0x3be817={};_0x3be817[_0x5e01d8]={'$like':'%'+_0x3e137a['query'][_0xc549('0x3f')]+'%'};return _0x3be817;})});}_0x4fae3d=_[_0xc549('0x40')]({},_0x4fae3d,_0x3e137a[_0xc549('0x45')]);return _0x4db57c[_0xc549('0x4b')](_0x4fae3d);}})['then'](function(_0x5e3709){if(_0x5e3709){_0x1e8761=_0x5e3709[_0xc549('0x37')];if(!_0x3e137a[_0xc549('0x31')][_0xc549('0x38')]('nolimit')){_0x4fae3d[_0xc549('0x20')]=qs[_0xc549('0x20')](_0x3e137a[_0xc549('0x31')]['limit']);_0x4fae3d[_0xc549('0x1e')]=qs[_0xc549('0x1e')](_0x3e137a[_0xc549('0x31')][_0xc549('0x1e')]);}return _0x4db57c['getFields'](_0x4fae3d);}})[_0xc549('0x25')](function(_0x4042df){if(_0x4042df){return _0x4042df?{'count':_0x1e8761,'rows':_0x4042df}:null;}})[_0xc549('0x25')](respondWithResult(_0x48e925,null))[_0xc549('0x46')](handleError(_0x48e925,null));};exports[_0xc549('0x4e')]=function(_0x605c07,_0x1b6d95,_0x10955a){var _0x51aa22={};var _0x537f72={};var _0x45ca82;var _0x45108f;return db[_0xc549('0x2d')][_0xc549('0x4c')]({'where':{'id':_0x605c07['params']['id']}})['then'](handleEntityNotFound(_0x1b6d95,null))[_0xc549('0x25')](function(_0x5c11d7){if(_0x5c11d7){_0x45ca82=_0x5c11d7;_0x537f72[_0xc549('0x30')]=_[_0xc549('0x32')](db[_0xc549('0x4d')]['rawAttributes']);_0x537f72[_0xc549('0x31')]=_['keys'](_0x605c07['query']);_0x537f72['filters']=_[_0xc549('0x34')](_0x537f72['model'],_0x537f72[_0xc549('0x31')]);_0x51aa22[_0xc549('0x35')]=_[_0xc549('0x34')](_0x537f72['model'],qs[_0xc549('0x36')](_0x605c07['query'][_0xc549('0x36')]));_0x51aa22['attributes']=_0x51aa22[_0xc549('0x35')]['length']?_0x51aa22[_0xc549('0x35')]:_0x537f72[_0xc549('0x30')];_0x51aa22[_0xc549('0x3a')]=qs['sort'](_0x605c07[_0xc549('0x31')][_0xc549('0x3b')]);_0x51aa22[_0xc549('0x3c')]=qs[_0xc549('0x33')](_[_0xc549('0x3d')](_0x605c07[_0xc549('0x31')],_0x537f72['filters']));if(_0x605c07['query'][_0xc549('0x3f')]){_0x51aa22['where']=_[_0xc549('0x40')](_0x51aa22['where'],{'$or':_[_0xc549('0x2c')](_0x51aa22[_0xc549('0x35')],function(_0x429d4d){var _0x3c9fd2={};_0x3c9fd2[_0x429d4d]={'$like':'%'+_0x605c07[_0xc549('0x31')][_0xc549('0x3f')]+'%'};return _0x3c9fd2;})});}_0x51aa22=_[_0xc549('0x40')]({},_0x51aa22,_0x605c07[_0xc549('0x45')]);return _0x45ca82[_0xc549('0x4e')](_0x51aa22);}})[_0xc549('0x25')](function(_0x2cda7f){if(_0x2cda7f){_0x45108f=_0x2cda7f[_0xc549('0x37')];if(!_0x605c07['query'][_0xc549('0x38')](_0xc549('0x39'))){_0x51aa22[_0xc549('0x20')]=qs[_0xc549('0x20')](_0x605c07[_0xc549('0x31')][_0xc549('0x20')]);_0x51aa22[_0xc549('0x1e')]=qs['offset'](_0x605c07[_0xc549('0x31')]['offset']);}return _0x45ca82[_0xc549('0x4e')](_0x51aa22);}})['then'](function(_0x5bc121){if(_0x5bc121){return _0x5bc121?{'count':_0x45108f,'rows':_0x5bc121}:null;}})['then'](respondWithResult(_0x1b6d95,null))['catch'](handleError(_0x1b6d95,null));};exports['getDescriptions']=function(_0x2ae888,_0x5e7627,_0x150722){var _0x21f194={};var _0x4d98a8={};var _0x234484;var _0x752090;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2ae888[_0xc549('0x4a')]['id']}})[_0xc549('0x25')](handleEntityNotFound(_0x5e7627,null))[_0xc549('0x25')](function(_0x4c427d){if(_0x4c427d){_0x234484=_0x4c427d;_0x4d98a8[_0xc549('0x30')]=_[_0xc549('0x32')](db['ZendeskField']['rawAttributes']);_0x4d98a8['query']=_[_0xc549('0x32')](_0x2ae888[_0xc549('0x31')]);_0x4d98a8[_0xc549('0x33')]=_[_0xc549('0x34')](_0x4d98a8[_0xc549('0x30')],_0x4d98a8[_0xc549('0x31')]);_0x21f194[_0xc549('0x35')]=_[_0xc549('0x34')](_0x4d98a8[_0xc549('0x30')],qs['fields'](_0x2ae888['query'][_0xc549('0x36')]));_0x21f194['attributes']=_0x21f194[_0xc549('0x35')][_0xc549('0x37')]?_0x21f194['attributes']:_0x4d98a8['model'];_0x21f194['order']=qs[_0xc549('0x3b')](_0x2ae888[_0xc549('0x31')][_0xc549('0x3b')]);_0x21f194[_0xc549('0x3c')]=qs['filters'](_[_0xc549('0x3d')](_0x2ae888[_0xc549('0x31')],_0x4d98a8[_0xc549('0x33')]));if(_0x2ae888[_0xc549('0x31')][_0xc549('0x3f')]){_0x21f194[_0xc549('0x3c')]=_[_0xc549('0x40')](_0x21f194[_0xc549('0x3c')],{'$or':_['map'](_0x21f194[_0xc549('0x35')],function(_0x282659){var _0x11c35d={};_0x11c35d[_0x282659]={'$like':'%'+_0x2ae888['query'][_0xc549('0x3f')]+'%'};return _0x11c35d;})});}_0x21f194=_[_0xc549('0x40')]({},_0x21f194,_0x2ae888['options']);return _0x234484[_0xc549('0x4f')](_0x21f194);}})[_0xc549('0x25')](function(_0x18da4c){if(_0x18da4c){_0x752090=_0x18da4c['length'];if(!_0x2ae888[_0xc549('0x31')][_0xc549('0x38')](_0xc549('0x39'))){_0x21f194[_0xc549('0x20')]=qs[_0xc549('0x20')](_0x2ae888[_0xc549('0x31')][_0xc549('0x20')]);_0x21f194[_0xc549('0x1e')]=qs[_0xc549('0x1e')](_0x2ae888[_0xc549('0x31')][_0xc549('0x1e')]);}return _0x234484['getDescriptions'](_0x21f194);}})[_0xc549('0x25')](function(_0x2536a9){if(_0x2536a9){return _0x2536a9?{'count':_0x752090,'rows':_0x2536a9}:null;}})[_0xc549('0x25')](respondWithResult(_0x5e7627,null))[_0xc549('0x46')](handleError(_0x5e7627,null));};exports[_0xc549('0x50')]=function(_0x3f58b6,_0x4ab27d,_0x58af76){var _0x45d27f={};var _0x3dd4d9={};var _0x15ca50;var _0x1e0697;return db[_0xc549('0x2d')][_0xc549('0x4c')]({'where':{'id':_0x3f58b6[_0xc549('0x4a')]['id']}})[_0xc549('0x25')](handleEntityNotFound(_0x4ab27d,null))['then'](function(_0x1fca3c){if(_0x1fca3c){_0x15ca50=_0x1fca3c;_0x3dd4d9[_0xc549('0x30')]=_['keys'](db[_0xc549('0x51')][_0xc549('0x44')]);_0x3dd4d9[_0xc549('0x31')]=_[_0xc549('0x32')](_0x3f58b6[_0xc549('0x31')]);_0x3dd4d9[_0xc549('0x33')]=_[_0xc549('0x34')](_0x3dd4d9[_0xc549('0x30')],_0x3dd4d9[_0xc549('0x31')]);_0x45d27f[_0xc549('0x35')]=_[_0xc549('0x34')](_0x3dd4d9['model'],qs[_0xc549('0x36')](_0x3f58b6[_0xc549('0x31')][_0xc549('0x36')]));_0x45d27f['attributes']=_0x45d27f[_0xc549('0x35')][_0xc549('0x37')]?_0x45d27f['attributes']:_0x3dd4d9[_0xc549('0x30')];_0x45d27f[_0xc549('0x3a')]=qs['sort'](_0x3f58b6[_0xc549('0x31')][_0xc549('0x3b')]);_0x45d27f['where']=qs[_0xc549('0x33')](_[_0xc549('0x3d')](_0x3f58b6[_0xc549('0x31')],_0x3dd4d9[_0xc549('0x33')]));if(_0x3f58b6[_0xc549('0x31')]['filter']){_0x45d27f[_0xc549('0x3c')]=_[_0xc549('0x40')](_0x45d27f[_0xc549('0x3c')],{'$or':_['map'](_0x45d27f[_0xc549('0x35')],function(_0x1fcbf8){var _0x1bea41={};_0x1bea41[_0x1fcbf8]={'$like':'%'+_0x3f58b6[_0xc549('0x31')][_0xc549('0x3f')]+'%'};return _0x1bea41;})});}_0x45d27f=_[_0xc549('0x40')]({},_0x45d27f,_0x3f58b6[_0xc549('0x45')]);return _0x15ca50['getTags'](_0x45d27f);}})[_0xc549('0x25')](function(_0x193314){if(_0x193314){_0x1e0697=_0x193314[_0xc549('0x37')];if(!_0x3f58b6[_0xc549('0x31')]['hasOwnProperty'](_0xc549('0x39'))){_0x45d27f['limit']=qs[_0xc549('0x20')](_0x3f58b6['query'][_0xc549('0x20')]);_0x45d27f[_0xc549('0x1e')]=qs['offset'](_0x3f58b6[_0xc549('0x31')][_0xc549('0x1e')]);}return _0x15ca50[_0xc549('0x50')](_0x45d27f);}})[_0xc549('0x25')](function(_0x37f04d){if(_0x37f04d){return _0x37f04d?{'count':_0x1e0697,'rows':_0x37f04d}:null;}})[_0xc549('0x25')](respondWithResult(_0x4ab27d,null))['catch'](handleError(_0x4ab27d,null));};exports[_0xc549('0x52')]=function(_0x3d7b75,_0x1817a5,_0x39c28d){if(_0x3d7b75['body']['id']){delete _0x3d7b75[_0xc549('0x48')]['id'];}return db[_0xc549('0x2d')][_0xc549('0x4c')]({'where':{'id':_0x3d7b75[_0xc549('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1817a5,null))['then'](function(_0x305092){if(_0x305092){return _0x305092[_0xc549('0x52')](_0x3d7b75[_0xc549('0x48')][_0xc549('0x53')]||[]);}return null;})[_0xc549('0x25')](respondWithResult(_0x1817a5,null))[_0xc549('0x46')](handleError(_0x1817a5,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 0c881ef..b7071d5 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 _0x065e=['moment','bluebird','request-promise','../../config/environment','./intZendeskConfiguration.attributes','define','int_zendesk_configurations','lodash'];(function(_0x531a21,_0x84dac8){var _0x4cfa76=function(_0x43e1a9){while(--_0x43e1a9){_0x531a21['push'](_0x531a21['shift']());}};_0x4cfa76(++_0x84dac8);}(_0x065e,0x1a7));var _0xe065=function(_0x668717,_0x3beaf0){_0x668717=_0x668717-0x0;var _0x1b8400=_0x065e[_0x668717];return _0x1b8400;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe065('0x1'));var BPromise=require(_0xe065('0x2'));var rp=require(_0xe065('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe065('0x4'));var attributes=require(_0xe065('0x5'));module['exports']=function(_0x10b45f,_0x1e7e69){return _0x10b45f[_0xe065('0x6')]('ZendeskConfiguration',attributes,{'tableName':_0xe065('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5423=['request-promise','path','rimraf','../../config/environment','exports','define','ZendeskConfiguration','lodash','util','api','moment'];(function(_0x1b2816,_0x57cde7){var _0x5e2cee=function(_0x47f234){while(--_0x47f234){_0x1b2816['push'](_0x1b2816['shift']());}};_0x5e2cee(++_0x57cde7);}(_0x5423,0xe3));var _0x3542=function(_0x11088e,_0x5a5df3){_0x11088e=_0x11088e-0x0;var _0x3d8f41=_0x5423[_0x11088e];return _0x3d8f41;};'use strict';var _=require(_0x3542('0x0'));var util=require(_0x3542('0x1'));var logger=require('../../config/logger')(_0x3542('0x2'));var moment=require(_0x3542('0x3'));var BPromise=require('bluebird');var rp=require(_0x3542('0x4'));var fs=require('fs');var path=require(_0x3542('0x5'));var rimraf=require(_0x3542('0x6'));var config=require(_0x3542('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x3542('0x8')]=function(_0x2d2ae9,_0x15ee3b){return _0x2d2ae9[_0x3542('0x9')](_0x3542('0xa'),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 4f3a845..7fa463d 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 _0xabce=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','lodash','randomstring'];(function(_0x5c8143,_0x358865){var _0x1f66a0=function(_0x438ca9){while(--_0x438ca9){_0x5c8143['push'](_0x5c8143['shift']());}};_0x1f66a0(++_0x358865);}(_0xabce,0x1e4));var _0xeabc=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0xabce[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0xeabc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xeabc('0x1'));var fs=require('fs');var Redis=require(_0xeabc('0x2'));var db=require(_0xeabc('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeabc('0x4'));var config=require(_0xeabc('0x5'));var jayson=require(_0xeabc('0x6'));var client=jayson[_0xeabc('0x7')][_0xeabc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ae345,_0x24ec00,_0x74c4d){return new BPromise(function(_0x1481c7,_0xdfb5a7){return client['request'](_0x1ae345,_0x74c4d)[_0xeabc('0x9')](function(_0x550139){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x24ec00,_0xeabc('0xc'));logger[_0xeabc('0xd')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x24ec00,_0xeabc('0xc'),JSON[_0xeabc('0xe')](_0x550139));if(_0x550139[_0xeabc('0xf')]){if(_0x550139[_0xeabc('0xf')]['code']===0x1f4){logger[_0xeabc('0xf')](_0xeabc('0xb'),_0x24ec00,_0x550139[_0xeabc('0xf')]['message']);return _0xdfb5a7(_0x550139[_0xeabc('0xf')][_0xeabc('0x10')]);}logger[_0xeabc('0xf')](_0xeabc('0xb'),_0x24ec00,_0x550139[_0xeabc('0xf')][_0xeabc('0x10')]);return _0x1481c7(_0x550139[_0xeabc('0xf')][_0xeabc('0x10')]);}else{logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x24ec00,'request\x20sent');_0x1481c7(_0x550139[_0xeabc('0x11')]['message']);}})['catch'](function(_0x1e1212){logger['error'](_0xeabc('0xb'),_0x24ec00,_0x1e1212);_0xdfb5a7(_0x1e1212);});});} \ No newline at end of file +var _0x7199=['ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2fa2aa,_0x18205f){var _0x3fb7db=function(_0x1fe65f){while(--_0x1fe65f){_0x2fa2aa['push'](_0x2fa2aa['shift']());}};_0x3fb7db(++_0x18205f);}(_0x7199,0xef));var _0x9719=function(_0x47b0cd,_0x159049){_0x47b0cd=_0x47b0cd-0x0;var _0x20fcd5=_0x7199[_0x47b0cd];return _0x20fcd5;};'use strict';var _=require('lodash');var util=require(_0x9719('0x0'));var moment=require(_0x9719('0x1'));var BPromise=require(_0x9719('0x2'));var rs=require(_0x9719('0x3'));var fs=require('fs');var Redis=require(_0x9719('0x4'));var db=require(_0x9719('0x5'))['db'];var utils=require(_0x9719('0x6'));var logger=require('../../config/logger')(_0x9719('0x7'));var config=require(_0x9719('0x8'));var jayson=require(_0x9719('0x9'));var client=jayson[_0x9719('0xa')][_0x9719('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19fc40,_0x5f4c5c,_0x375e5d){return new BPromise(function(_0x1418a2,_0x3326e1){return client[_0x9719('0xc')](_0x19fc40,_0x375e5d)[_0x9719('0xd')](function(_0x4b1871){logger['info'](_0x9719('0xe'),_0x5f4c5c,_0x9719('0xf'));logger[_0x9719('0x10')](_0x9719('0x11'),_0x5f4c5c,_0x9719('0xf'),JSON['stringify'](_0x4b1871));if(_0x4b1871[_0x9719('0x12')]){if(_0x4b1871[_0x9719('0x12')][_0x9719('0x13')]===0x1f4){logger[_0x9719('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5f4c5c,_0x4b1871[_0x9719('0x12')][_0x9719('0x14')]);return _0x3326e1(_0x4b1871[_0x9719('0x12')]['message']);}logger[_0x9719('0x12')](_0x9719('0xe'),_0x5f4c5c,_0x4b1871[_0x9719('0x12')][_0x9719('0x14')]);return _0x1418a2(_0x4b1871[_0x9719('0x12')]['message']);}else{logger['info'](_0x9719('0xe'),_0x5f4c5c,'request\x20sent');_0x1418a2(_0x4b1871[_0x9719('0x15')][_0x9719('0x14')]);}})[_0x9719('0x16')](function(_0x3c725e){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5f4c5c,_0x3c725e);_0x3326e1(_0x3c725e);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index dc849bc..6363963 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 _0xbe36=['multer','util','path','connect-timeout','express','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','create','put','delete','destroy','exports'];(function(_0x277d61,_0xab8c96){var _0x34f6e1=function(_0x2d19b7){while(--_0x2d19b7){_0x277d61['push'](_0x277d61['shift']());}};_0x34f6e1(++_0xab8c96);}(_0xbe36,0x1b0));var _0x6be3=function(_0x5f099a,_0x26a7be){_0x5f099a=_0x5f099a-0x0;var _0x1024ab=_0xbe36[_0x5f099a];return _0x1024ab;};'use strict';var multer=require(_0x6be3('0x0'));var util=require(_0x6be3('0x1'));var path=require(_0x6be3('0x2'));var timeout=require(_0x6be3('0x3'));var express=require(_0x6be3('0x4'));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(_0x6be3('0x5'));router[_0x6be3('0x6')]('/',auth['isAuthenticated'](),controller[_0x6be3('0x7')]);router[_0x6be3('0x6')](_0x6be3('0x8'),auth[_0x6be3('0x9')](),controller[_0x6be3('0xa')]);router['post']('/',auth[_0x6be3('0x9')](),controller[_0x6be3('0xb')]);router[_0x6be3('0xc')](_0x6be3('0x8'),auth[_0x6be3('0x9')](),controller['update']);router[_0x6be3('0xd')](_0x6be3('0x8'),auth[_0x6be3('0x9')](),controller[_0x6be3('0xe')]);module[_0x6be3('0xf')]=router; \ No newline at end of file +var _0x89e6=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','post','create','put','/:id','isAuthenticated','update','delete','exports','util','path'];(function(_0x953b7b,_0x5b5dd9){var _0x33d067=function(_0x341851){while(--_0x341851){_0x953b7b['push'](_0x953b7b['shift']());}};_0x33d067(++_0x5b5dd9);}(_0x89e6,0x1a0));var _0x689e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89e6[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x689e('0x0'));var path=require(_0x689e('0x1'));var timeout=require('connect-timeout');var express=require(_0x689e('0x2'));var router=express[_0x689e('0x3')]();var fs_extra=require(_0x689e('0x4'));var auth=require(_0x689e('0x5'));var interaction=require(_0x689e('0x6'));var config=require(_0x689e('0x7'));var controller=require(_0x689e('0x8'));router[_0x689e('0x9')]('/',auth['isAuthenticated'](),controller[_0x689e('0xa')]);router[_0x689e('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x689e('0xb')]('/',auth['isAuthenticated'](),controller[_0x689e('0xc')]);router[_0x689e('0xd')](_0x689e('0xe'),auth[_0x689e('0xf')](),controller[_0x689e('0x10')]);router[_0x689e('0x11')](_0x689e('0xe'),auth[_0x689e('0xf')](),controller['destroy']);module[_0x689e('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 0925144..67025a8 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 _0xc5f1=['keyValue','STRING','ENUM','customVariable','string','variable'];(function(_0x16ed65,_0xd77e99){var _0x390114=function(_0x53c4e9){while(--_0x53c4e9){_0x16ed65['push'](_0x16ed65['shift']());}};_0x390114(++_0xd77e99);}(_0xc5f1,0xfa));var _0x1c5f=function(_0x533081,_0x528872){_0x533081=_0x533081-0x0;var _0x2244c6=_0xc5f1[_0x533081];return _0x2244c6;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x1c5f('0x0'),_0x1c5f('0x1'),'customVariable',_0x1c5f('0x2'),'picklist'),'defaultValue':_0x1c5f('0x0')},'content':{'type':Sequelize[_0x1c5f('0x3')]},'key':{'type':Sequelize[_0x1c5f('0x3')]},'keyType':{'type':Sequelize[_0x1c5f('0x4')](_0x1c5f('0x0'),'variable',_0x1c5f('0x5'))},'keyContent':{'type':Sequelize[_0x1c5f('0x3')]},'idField':{'type':Sequelize[_0x1c5f('0x3')]},'nameField':{'type':Sequelize[_0x1c5f('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1c5f('0x3')]}}; \ No newline at end of file +var _0x70af=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x70af,0x150));var _0xf70a=function(_0x314810,_0x5d0e31){_0x314810=_0x314810-0x0;var _0xec232d=_0x70af[_0x314810];return _0xec232d;};'use strict';var Sequelize=require(_0xf70a('0x0'));module[_0xf70a('0x1')]={'type':{'type':Sequelize[_0xf70a('0x2')](_0xf70a('0x3'),_0xf70a('0x4'),_0xf70a('0x5'),_0xf70a('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xf70a('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf70a('0x2')](_0xf70a('0x3'),'variable',_0xf70a('0x5'))},'keyContent':{'type':Sequelize[_0xf70a('0x7')]},'idField':{'type':Sequelize[_0xf70a('0x7')]},'nameField':{'type':Sequelize[_0xf70a('0x7')]},'customField':{'type':Sequelize[_0xf70a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 163b3b3..0963413 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 _0xcafb=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','destroy','then','error','stack','name','map','ZendeskField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','type','includeAll','include','findAll','rows','catch','params','keys','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2c603c,_0x6db19){var _0x5652da=function(_0xb65356){while(--_0xb65356){_0x2c603c['push'](_0x2c603c['shift']());}};_0x5652da(++_0x6db19);}(_0xcafb,0x16c));var _0xbcaf=function(_0x5e17f1,_0x37357a){_0x5e17f1=_0x5e17f1-0x0;var _0x362a63=_0xcafb[_0x5e17f1];return _0x362a63;};'use strict';var emlformat=require(_0xbcaf('0x0'));var rimraf=require(_0xbcaf('0x1'));var zipdir=require(_0xbcaf('0x2'));var jsonpatch=require(_0xbcaf('0x3'));var rp=require(_0xbcaf('0x4'));var moment=require(_0xbcaf('0x5'));var BPromise=require(_0xbcaf('0x6'));var Mustache=require(_0xbcaf('0x7'));var util=require(_0xbcaf('0x8'));var path=require(_0xbcaf('0x9'));var sox=require(_0xbcaf('0xa'));var csv=require(_0xbcaf('0xb'));var ejs=require(_0xbcaf('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xbcaf('0xd'));var crypto=require(_0xbcaf('0xe'));var jsforce=require(_0xbcaf('0xf'));var deskjs=require(_0xbcaf('0x10'));var toCsv=require(_0xbcaf('0xb'));var querystring=require(_0xbcaf('0x11'));var Papa=require(_0xbcaf('0x12'));var Redis=require(_0xbcaf('0x13'));var authService=require(_0xbcaf('0x14'));var qs=require(_0xbcaf('0x15'));var as=require(_0xbcaf('0x16'));var hardwareService=require(_0xbcaf('0x17'));var logger=require(_0xbcaf('0x18'))('api');var utils=require(_0xbcaf('0x19'));var config=require(_0xbcaf('0x1a'));var licenseUtil=require(_0xbcaf('0x1b'));var db=require(_0xbcaf('0x1c'))['db'];function respondWithStatusCode(_0x9b05e4,_0x3442f0){_0x3442f0=_0x3442f0||0xcc;return function(_0x35438d){if(_0x35438d){return _0x9b05e4[_0xbcaf('0x1d')](_0x3442f0);}return _0x9b05e4[_0xbcaf('0x1e')](_0x3442f0)[_0xbcaf('0x1f')]();};}function respondWithResult(_0x5dd83c,_0x14503a){_0x14503a=_0x14503a||0xc8;return function(_0x2df318){if(_0x2df318){return _0x5dd83c[_0xbcaf('0x1e')](_0x14503a)[_0xbcaf('0x20')](_0x2df318);}};}function respondWithFilteredResult(_0x1e60d9,_0x3a8ee8){return function(_0x564cb5){if(_0x564cb5){var _0x1202ff=typeof _0x3a8ee8['offset']==='undefined'&&typeof _0x3a8ee8[_0xbcaf('0x21')]===_0xbcaf('0x22');var _0x2c295e=_0x564cb5[_0xbcaf('0x23')];var _0x2c1a50=_0x1202ff?0x0:_0x3a8ee8[_0xbcaf('0x24')];var _0x246af0=_0x1202ff?_0x564cb5[_0xbcaf('0x23')]:_0x3a8ee8[_0xbcaf('0x24')]+_0x3a8ee8[_0xbcaf('0x21')];var _0x2487a9;if(_0x246af0>=_0x2c295e){_0x246af0=_0x2c295e;_0x2487a9=0xc8;}else{_0x2487a9=0xce;}_0x1e60d9[_0xbcaf('0x1e')](_0x2487a9);return _0x1e60d9['set'](_0xbcaf('0x25'),_0x2c1a50+'-'+_0x246af0+'/'+_0x2c295e)[_0xbcaf('0x20')](_0x564cb5);}return null;};}function patchUpdates(_0x8a9008){return function(_0x5256ce){try{jsonpatch[_0xbcaf('0x26')](_0x5256ce,_0x8a9008,!![]);}catch(_0x2c4310){return BPromise['reject'](_0x2c4310);}return _0x5256ce[_0xbcaf('0x27')]();};}function saveUpdates(_0x99039d,_0x5448c1){return function(_0x2c3ffd){if(_0x2c3ffd){return _0x2c3ffd[_0xbcaf('0x28')](_0x99039d)['then'](function(_0x27d2e1){return _0x27d2e1;});}return null;};}function removeEntity(_0x4ec4f1,_0x1c6cbf){return function(_0x4b550f){if(_0x4b550f){return _0x4b550f[_0xbcaf('0x29')]()[_0xbcaf('0x2a')](function(){_0x4ec4f1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x56cd60,_0x5c784c){return function(_0x3229b0){if(!_0x3229b0){_0x56cd60['sendStatus'](0x194);}return _0x3229b0;};}function handleError(_0x20fdcc,_0x13f72b){_0x13f72b=_0x13f72b||0x1f4;return function(_0x5bd0ce){logger[_0xbcaf('0x2b')](_0x5bd0ce[_0xbcaf('0x2c')]);if(_0x5bd0ce[_0xbcaf('0x2d')]){delete _0x5bd0ce[_0xbcaf('0x2d')];}_0x20fdcc[_0xbcaf('0x1e')](_0x13f72b)['send'](_0x5bd0ce);};}exports['index']=function(_0x8b04e6,_0x5a1801){var _0x27fdb6={},_0x361ec2={},_0x4b80d2={'count':0x0,'rows':[]};var _0x363c9f=_[_0xbcaf('0x2e')](db[_0xbcaf('0x2f')][_0xbcaf('0x30')],function(_0x1e014c){return{'name':_0x1e014c[_0xbcaf('0x31')],'type':_0x1e014c['type'][_0xbcaf('0x32')]};});_0x361ec2[_0xbcaf('0x33')]=_[_0xbcaf('0x2e')](_0x363c9f,_0xbcaf('0x2d'));_0x361ec2[_0xbcaf('0x34')]=_['keys'](_0x8b04e6[_0xbcaf('0x34')]);_0x361ec2[_0xbcaf('0x35')]=_[_0xbcaf('0x36')](_0x361ec2[_0xbcaf('0x33')],_0x361ec2[_0xbcaf('0x34')]);_0x27fdb6[_0xbcaf('0x37')]=_[_0xbcaf('0x36')](_0x361ec2[_0xbcaf('0x33')],qs[_0xbcaf('0x38')](_0x8b04e6[_0xbcaf('0x34')][_0xbcaf('0x38')]));_0x27fdb6[_0xbcaf('0x37')]=_0x27fdb6[_0xbcaf('0x37')]['length']?_0x27fdb6[_0xbcaf('0x37')]:_0x361ec2[_0xbcaf('0x33')];if(!_0x8b04e6['query']['hasOwnProperty'](_0xbcaf('0x39'))){_0x27fdb6['limit']=qs[_0xbcaf('0x21')](_0x8b04e6['query'][_0xbcaf('0x21')]);_0x27fdb6[_0xbcaf('0x24')]=qs[_0xbcaf('0x24')](_0x8b04e6[_0xbcaf('0x34')]['offset']);}_0x27fdb6[_0xbcaf('0x3a')]=qs[_0xbcaf('0x3b')](_0x8b04e6[_0xbcaf('0x34')][_0xbcaf('0x3b')]);_0x27fdb6['where']=qs[_0xbcaf('0x35')](_[_0xbcaf('0x3c')](_0x8b04e6[_0xbcaf('0x34')],_0x361ec2['filters']),_0x363c9f);if(_0x8b04e6['query'][_0xbcaf('0x3d')]){_0x27fdb6[_0xbcaf('0x3e')]=_[_0xbcaf('0x3f')](_0x27fdb6[_0xbcaf('0x3e')],{'$or':_['map'](_0x363c9f,function(_0x45f03a){if(_0x45f03a[_0xbcaf('0x40')]!=='VIRTUAL'){var _0x13d82d={};_0x13d82d[_0x45f03a[_0xbcaf('0x2d')]]={'$like':'%'+_0x8b04e6['query'][_0xbcaf('0x3d')]+'%'};return _0x13d82d;}})});}_0x27fdb6=_[_0xbcaf('0x3f')]({},_0x27fdb6,_0x8b04e6['options']);var _0x86d9f1={'where':_0x27fdb6[_0xbcaf('0x3e')]};return db[_0xbcaf('0x2f')][_0xbcaf('0x23')](_0x86d9f1)[_0xbcaf('0x2a')](function(_0x34434a){_0x4b80d2[_0xbcaf('0x23')]=_0x34434a;if(_0x8b04e6[_0xbcaf('0x34')][_0xbcaf('0x41')]){_0x27fdb6[_0xbcaf('0x42')]=[{'all':!![]}];}return db[_0xbcaf('0x2f')][_0xbcaf('0x43')](_0x27fdb6);})[_0xbcaf('0x2a')](function(_0x16ab7c){_0x4b80d2[_0xbcaf('0x44')]=_0x16ab7c;return _0x4b80d2;})[_0xbcaf('0x2a')](respondWithFilteredResult(_0x5a1801,_0x27fdb6))[_0xbcaf('0x45')](handleError(_0x5a1801,null));};exports['show']=function(_0x5499cb,_0x40dbc8){var _0x14cc93={'raw':!![],'where':{'id':_0x5499cb[_0xbcaf('0x46')]['id']}},_0x323582={};_0x323582[_0xbcaf('0x33')]=_[_0xbcaf('0x47')](db[_0xbcaf('0x2f')][_0xbcaf('0x30')]);_0x323582['query']=_[_0xbcaf('0x47')](_0x5499cb[_0xbcaf('0x34')]);_0x323582[_0xbcaf('0x35')]=_['intersection'](_0x323582['model'],_0x323582[_0xbcaf('0x34')]);_0x14cc93[_0xbcaf('0x37')]=_['intersection'](_0x323582[_0xbcaf('0x33')],qs['fields'](_0x5499cb['query'][_0xbcaf('0x38')]));_0x14cc93['attributes']=_0x14cc93[_0xbcaf('0x37')][_0xbcaf('0x48')]?_0x14cc93[_0xbcaf('0x37')]:_0x323582[_0xbcaf('0x33')];if(_0x5499cb[_0xbcaf('0x34')]['includeAll']){_0x14cc93[_0xbcaf('0x42')]=[{'all':!![]}];}_0x14cc93=_[_0xbcaf('0x3f')]({},_0x14cc93,_0x5499cb[_0xbcaf('0x49')]);return db[_0xbcaf('0x2f')][_0xbcaf('0x4a')](_0x14cc93)[_0xbcaf('0x2a')](handleEntityNotFound(_0x40dbc8,null))[_0xbcaf('0x2a')](respondWithResult(_0x40dbc8,null))[_0xbcaf('0x45')](handleError(_0x40dbc8,null));};exports['create']=function(_0x1f9987,_0x2def07){return db[_0xbcaf('0x2f')][_0xbcaf('0x4b')](_0x1f9987[_0xbcaf('0x4c')],{})[_0xbcaf('0x2a')](respondWithResult(_0x2def07,0xc9))[_0xbcaf('0x45')](handleError(_0x2def07,null));};exports[_0xbcaf('0x28')]=function(_0x337ea5,_0x26b9a1){if(_0x337ea5[_0xbcaf('0x4c')]['id']){delete _0x337ea5[_0xbcaf('0x4c')]['id'];}return db[_0xbcaf('0x2f')][_0xbcaf('0x4a')]({'where':{'id':_0x337ea5['params']['id']}})['then'](handleEntityNotFound(_0x26b9a1,null))[_0xbcaf('0x2a')](saveUpdates(_0x337ea5[_0xbcaf('0x4c')],null))[_0xbcaf('0x2a')](respondWithResult(_0x26b9a1,null))[_0xbcaf('0x45')](handleError(_0x26b9a1,null));};exports['destroy']=function(_0x3b9418,_0x185b03){return db[_0xbcaf('0x2f')][_0xbcaf('0x4a')]({'where':{'id':_0x3b9418['params']['id']}})[_0xbcaf('0x2a')](handleEntityNotFound(_0x185b03,null))[_0xbcaf('0x2a')](removeEntity(_0x185b03,null))[_0xbcaf('0x45')](handleError(_0x185b03,null));}; \ No newline at end of file +var _0x155d=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','error','stack','name','ZendeskField','fieldName','key','map','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x516c37,_0x4d27d3){var _0x418b48=function(_0x260e0e){while(--_0x260e0e){_0x516c37['push'](_0x516c37['shift']());}};_0x418b48(++_0x4d27d3);}(_0x155d,0x89));var _0xd155=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x155d[_0x2d61b2];return _0x12df89;};'use strict';var emlformat=require(_0xd155('0x0'));var rimraf=require(_0xd155('0x1'));var zipdir=require(_0xd155('0x2'));var jsonpatch=require(_0xd155('0x3'));var rp=require('request-promise');var moment=require(_0xd155('0x4'));var BPromise=require(_0xd155('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xd155('0x6'));var ejs=require(_0xd155('0x7'));var fs=require('fs');var fs_extra=require(_0xd155('0x8'));var _=require(_0xd155('0x9'));var squel=require(_0xd155('0xa'));var crypto=require(_0xd155('0xb'));var jsforce=require(_0xd155('0xc'));var deskjs=require(_0xd155('0xd'));var toCsv=require(_0xd155('0x6'));var querystring=require(_0xd155('0xe'));var Papa=require('papaparse');var Redis=require(_0xd155('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd155('0x10'));var as=require(_0xd155('0x11'));var hardwareService=require(_0xd155('0x12'));var logger=require(_0xd155('0x13'))(_0xd155('0x14'));var utils=require(_0xd155('0x15'));var config=require(_0xd155('0x16'));var licenseUtil=require(_0xd155('0x17'));var db=require(_0xd155('0x18'))['db'];function respondWithStatusCode(_0x7bd657,_0x181b44){_0x181b44=_0x181b44||0xcc;return function(_0x69bf8b){if(_0x69bf8b){return _0x7bd657['sendStatus'](_0x181b44);}return _0x7bd657[_0xd155('0x19')](_0x181b44)[_0xd155('0x1a')]();};}function respondWithResult(_0x5582d2,_0x58e502){_0x58e502=_0x58e502||0xc8;return function(_0x464f3b){if(_0x464f3b){return _0x5582d2['status'](_0x58e502)['json'](_0x464f3b);}};}function respondWithFilteredResult(_0xb37166,_0x3195e8){return function(_0x41dc3d){if(_0x41dc3d){var _0x39d2e6=typeof _0x3195e8[_0xd155('0x1b')]===_0xd155('0x1c')&&typeof _0x3195e8[_0xd155('0x1d')]===_0xd155('0x1c');var _0x118dec=_0x41dc3d['count'];var _0x40d271=_0x39d2e6?0x0:_0x3195e8['offset'];var _0x52457c=_0x39d2e6?_0x41dc3d[_0xd155('0x1e')]:_0x3195e8[_0xd155('0x1b')]+_0x3195e8[_0xd155('0x1d')];var _0x5a6bf0;if(_0x52457c>=_0x118dec){_0x52457c=_0x118dec;_0x5a6bf0=0xc8;}else{_0x5a6bf0=0xce;}_0xb37166[_0xd155('0x19')](_0x5a6bf0);return _0xb37166[_0xd155('0x1f')](_0xd155('0x20'),_0x40d271+'-'+_0x52457c+'/'+_0x118dec)[_0xd155('0x21')](_0x41dc3d);}return null;};}function patchUpdates(_0x2169ca){return function(_0xf0bf21){try{jsonpatch[_0xd155('0x22')](_0xf0bf21,_0x2169ca,!![]);}catch(_0x8a873a){return BPromise['reject'](_0x8a873a);}return _0xf0bf21[_0xd155('0x23')]();};}function saveUpdates(_0x46f5a7,_0x13a521){return function(_0xe3ac77){if(_0xe3ac77){return _0xe3ac77[_0xd155('0x24')](_0x46f5a7)[_0xd155('0x25')](function(_0x4c16a8){return _0x4c16a8;});}return null;};}function removeEntity(_0x2bda29,_0x498c91){return function(_0x2456d3){if(_0x2456d3){return _0x2456d3[_0xd155('0x26')]()[_0xd155('0x25')](function(){_0x2bda29[_0xd155('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48cbbc,_0xa1a362){return function(_0xd32d53){if(!_0xd32d53){_0x48cbbc[_0xd155('0x27')](0x194);}return _0xd32d53;};}function handleError(_0x3fa6f3,_0x5d82f0){_0x5d82f0=_0x5d82f0||0x1f4;return function(_0x11dfb2){logger[_0xd155('0x28')](_0x11dfb2[_0xd155('0x29')]);if(_0x11dfb2[_0xd155('0x2a')]){delete _0x11dfb2[_0xd155('0x2a')];}_0x3fa6f3[_0xd155('0x19')](_0x5d82f0)['send'](_0x11dfb2);};}exports['index']=function(_0x1ec49f,_0x3453e8){var _0xfef7e8={},_0x3cdff9={},_0x49f513={'count':0x0,'rows':[]};var _0x2ec9e6=_['map'](db[_0xd155('0x2b')]['rawAttributes'],function(_0x462d63){return{'name':_0x462d63[_0xd155('0x2c')],'type':_0x462d63['type'][_0xd155('0x2d')]};});_0x3cdff9['model']=_[_0xd155('0x2e')](_0x2ec9e6,_0xd155('0x2a'));_0x3cdff9[_0xd155('0x2f')]=_[_0xd155('0x30')](_0x1ec49f['query']);_0x3cdff9[_0xd155('0x31')]=_['intersection'](_0x3cdff9[_0xd155('0x32')],_0x3cdff9['query']);_0xfef7e8['attributes']=_[_0xd155('0x33')](_0x3cdff9['model'],qs[_0xd155('0x34')](_0x1ec49f['query'][_0xd155('0x34')]));_0xfef7e8[_0xd155('0x35')]=_0xfef7e8[_0xd155('0x35')][_0xd155('0x36')]?_0xfef7e8['attributes']:_0x3cdff9[_0xd155('0x32')];if(!_0x1ec49f[_0xd155('0x2f')][_0xd155('0x37')](_0xd155('0x38'))){_0xfef7e8[_0xd155('0x1d')]=qs[_0xd155('0x1d')](_0x1ec49f[_0xd155('0x2f')][_0xd155('0x1d')]);_0xfef7e8[_0xd155('0x1b')]=qs[_0xd155('0x1b')](_0x1ec49f[_0xd155('0x2f')][_0xd155('0x1b')]);}_0xfef7e8['order']=qs[_0xd155('0x39')](_0x1ec49f[_0xd155('0x2f')][_0xd155('0x39')]);_0xfef7e8['where']=qs[_0xd155('0x31')](_[_0xd155('0x3a')](_0x1ec49f[_0xd155('0x2f')],_0x3cdff9['filters']),_0x2ec9e6);if(_0x1ec49f[_0xd155('0x2f')][_0xd155('0x3b')]){_0xfef7e8[_0xd155('0x3c')]=_['merge'](_0xfef7e8[_0xd155('0x3c')],{'$or':_[_0xd155('0x2e')](_0x2ec9e6,function(_0x18c5c9){if(_0x18c5c9[_0xd155('0x3d')]!==_0xd155('0x3e')){var _0x2d4fc8={};_0x2d4fc8[_0x18c5c9[_0xd155('0x2a')]]={'$like':'%'+_0x1ec49f['query'][_0xd155('0x3b')]+'%'};return _0x2d4fc8;}})});}_0xfef7e8=_[_0xd155('0x3f')]({},_0xfef7e8,_0x1ec49f[_0xd155('0x40')]);var _0x44ddb3={'where':_0xfef7e8['where']};return db[_0xd155('0x2b')][_0xd155('0x1e')](_0x44ddb3)[_0xd155('0x25')](function(_0x497cbd){_0x49f513['count']=_0x497cbd;if(_0x1ec49f[_0xd155('0x2f')]['includeAll']){_0xfef7e8[_0xd155('0x41')]=[{'all':!![]}];}return db[_0xd155('0x2b')][_0xd155('0x42')](_0xfef7e8);})[_0xd155('0x25')](function(_0x21c42a){_0x49f513[_0xd155('0x43')]=_0x21c42a;return _0x49f513;})[_0xd155('0x25')](respondWithFilteredResult(_0x3453e8,_0xfef7e8))[_0xd155('0x44')](handleError(_0x3453e8,null));};exports[_0xd155('0x45')]=function(_0x11b8da,_0xfcd860){var _0x520f24={'raw':!![],'where':{'id':_0x11b8da[_0xd155('0x46')]['id']}},_0x2ff16e={};_0x2ff16e[_0xd155('0x32')]=_[_0xd155('0x30')](db[_0xd155('0x2b')][_0xd155('0x47')]);_0x2ff16e[_0xd155('0x2f')]=_[_0xd155('0x30')](_0x11b8da[_0xd155('0x2f')]);_0x2ff16e[_0xd155('0x31')]=_[_0xd155('0x33')](_0x2ff16e['model'],_0x2ff16e['query']);_0x520f24['attributes']=_['intersection'](_0x2ff16e[_0xd155('0x32')],qs[_0xd155('0x34')](_0x11b8da['query'][_0xd155('0x34')]));_0x520f24[_0xd155('0x35')]=_0x520f24[_0xd155('0x35')]['length']?_0x520f24[_0xd155('0x35')]:_0x2ff16e[_0xd155('0x32')];if(_0x11b8da['query'][_0xd155('0x48')]){_0x520f24[_0xd155('0x41')]=[{'all':!![]}];}_0x520f24=_[_0xd155('0x3f')]({},_0x520f24,_0x11b8da[_0xd155('0x40')]);return db[_0xd155('0x2b')][_0xd155('0x49')](_0x520f24)[_0xd155('0x25')](handleEntityNotFound(_0xfcd860,null))[_0xd155('0x25')](respondWithResult(_0xfcd860,null))[_0xd155('0x44')](handleError(_0xfcd860,null));};exports['create']=function(_0x12a457,_0x3e60bb){return db[_0xd155('0x2b')][_0xd155('0x4a')](_0x12a457[_0xd155('0x4b')],{})['then'](respondWithResult(_0x3e60bb,0xc9))[_0xd155('0x44')](handleError(_0x3e60bb,null));};exports[_0xd155('0x24')]=function(_0x160d0b,_0x17a708){if(_0x160d0b[_0xd155('0x4b')]['id']){delete _0x160d0b[_0xd155('0x4b')]['id'];}return db['ZendeskField'][_0xd155('0x49')]({'where':{'id':_0x160d0b['params']['id']}})[_0xd155('0x25')](handleEntityNotFound(_0x17a708,null))[_0xd155('0x25')](saveUpdates(_0x160d0b[_0xd155('0x4b')],null))[_0xd155('0x25')](respondWithResult(_0x17a708,null))[_0xd155('0x44')](handleError(_0x17a708,null));};exports[_0xd155('0x26')]=function(_0x532799,_0x565800){return db[_0xd155('0x2b')][_0xd155('0x49')]({'where':{'id':_0x532799['params']['id']}})[_0xd155('0x25')](handleEntityNotFound(_0x565800,null))['then'](removeEntity(_0x565800,null))['catch'](handleError(_0x565800,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index a78b635..eddbcbd 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 _0xffab=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','lodash'];(function(_0x1876b2,_0x5d0225){var _0x9fb1e0=function(_0x29b099){while(--_0x29b099){_0x1876b2['push'](_0x1876b2['shift']());}};_0x9fb1e0(++_0x5d0225);}(_0xffab,0x158));var _0xbffa=function(_0x174202,_0x5c5292){_0x174202=_0x174202-0x0;var _0x4daa4a=_0xffab[_0x174202];return _0x4daa4a;};'use strict';var _=require(_0xbffa('0x0'));var util=require(_0xbffa('0x1'));var logger=require(_0xbffa('0x2'))(_0xbffa('0x3'));var moment=require(_0xbffa('0x4'));var BPromise=require(_0xbffa('0x5'));var rp=require(_0xbffa('0x6'));var fs=require('fs');var path=require(_0xbffa('0x7'));var rimraf=require(_0xbffa('0x8'));var config=require(_0xbffa('0x9'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x26c5c8,_0x575f23){return _0x26c5c8[_0xbffa('0xa')](_0xbffa('0xb'),attributes,{'tableName':_0xbffa('0xc'),'paranoid':![],'indexes':[{'name':_0xbffa('0xd'),'fields':[_0xbffa('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5c3c=['bluebird','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','FieldId','lodash','../../config/logger','api','moment'];(function(_0x20294f,_0x4848ee){var _0x2e6673=function(_0x28baae){while(--_0x28baae){_0x20294f['push'](_0x20294f['shift']());}};_0x2e6673(++_0x4848ee);}(_0x5c3c,0x128));var _0xc5c3=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0x5c3c[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0xc5c3('0x0'));var util=require('util');var logger=require(_0xc5c3('0x1'))(_0xc5c3('0x2'));var moment=require(_0xc5c3('0x3'));var BPromise=require(_0xc5c3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc5c3('0x5'));var config=require(_0xc5c3('0x6'));var attributes=require(_0xc5c3('0x7'));module[_0xc5c3('0x8')]=function(_0xa58286,_0xa20964){return _0xa58286['define'](_0xc5c3('0x9'),attributes,{'tableName':_0xc5c3('0xa'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':['idField',_0xc5c3('0xb')],'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 9463689..9edb5b4 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 _0x757a=['error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','debug','request\x20sent'];(function(_0x3ec11d,_0x31cd63){var _0x2b2e03=function(_0x3abc75){while(--_0x3abc75){_0x3ec11d['push'](_0x3ec11d['shift']());}};_0x2b2e03(++_0x31cd63);}(_0x757a,0x146));var _0xa757=function(_0x1174b3,_0xf1fe20){_0x1174b3=_0x1174b3-0x0;var _0x3d6de7=_0x757a[_0x1174b3];return _0x3d6de7;};'use strict';var _=require(_0xa757('0x0'));var util=require(_0xa757('0x1'));var moment=require('moment');var BPromise=require(_0xa757('0x2'));var rs=require(_0xa757('0x3'));var fs=require('fs');var Redis=require(_0xa757('0x4'));var db=require(_0xa757('0x5'))['db'];var utils=require(_0xa757('0x6'));var logger=require(_0xa757('0x7'))(_0xa757('0x8'));var config=require('../../config/environment');var jayson=require(_0xa757('0x9'));var client=jayson[_0xa757('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14f196,_0x24f4f1,_0x2155ad){return new BPromise(function(_0x5c6dde,_0x3ca967){return client['request'](_0x14f196,_0x2155ad)[_0xa757('0xb')](function(_0x5d6c25){logger['info']('ZendeskField,\x20%s,\x20%s',_0x24f4f1,'request\x20sent');logger[_0xa757('0xc')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x24f4f1,_0xa757('0xd'),JSON['stringify'](_0x5d6c25));if(_0x5d6c25['error']){if(_0x5d6c25[_0xa757('0xe')][_0xa757('0xf')]===0x1f4){logger[_0xa757('0xe')](_0xa757('0x10'),_0x24f4f1,_0x5d6c25[_0xa757('0xe')][_0xa757('0x11')]);return _0x3ca967(_0x5d6c25[_0xa757('0xe')][_0xa757('0x11')]);}logger[_0xa757('0xe')](_0xa757('0x10'),_0x24f4f1,_0x5d6c25[_0xa757('0xe')][_0xa757('0x11')]);return _0x5c6dde(_0x5d6c25[_0xa757('0xe')][_0xa757('0x11')]);}else{logger['info']('ZendeskField,\x20%s,\x20%s',_0x24f4f1,_0xa757('0xd'));_0x5c6dde(_0x5d6c25[_0xa757('0x12')][_0xa757('0x11')]);}})[_0xa757('0x13')](function(_0x3d7572){logger[_0xa757('0xe')](_0xa757('0x10'),_0x24f4f1,_0x3d7572);_0x3ca967(_0x3d7572);});});} \ No newline at end of file +var _0xe5c3=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','request\x20sent','error','code','ZendeskField,\x20%s,\x20%s','message'];(function(_0xde770b,_0x4c4183){var _0x4703bc=function(_0x2078b2){while(--_0x2078b2){_0xde770b['push'](_0xde770b['shift']());}};_0x4703bc(++_0x4c4183);}(_0xe5c3,0x11a));var _0x3e5c=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xe5c3[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x3e5c('0x0'));var util=require('util');var moment=require(_0x3e5c('0x1'));var BPromise=require('bluebird');var rs=require(_0x3e5c('0x2'));var fs=require('fs');var Redis=require(_0x3e5c('0x3'));var db=require(_0x3e5c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e5c('0x5'))(_0x3e5c('0x6'));var config=require(_0x3e5c('0x7'));var jayson=require(_0x3e5c('0x8'));var client=jayson[_0x3e5c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c19ec,_0x40a677,_0x1fce42){return new BPromise(function(_0x5e7d8a,_0x53d5a7){return client[_0x3e5c('0xa')](_0x4c19ec,_0x1fce42)['then'](function(_0x499c31){logger[_0x3e5c('0xb')]('ZendeskField,\x20%s,\x20%s',_0x40a677,'request\x20sent');logger[_0x3e5c('0xc')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x40a677,_0x3e5c('0xd'),JSON['stringify'](_0x499c31));if(_0x499c31['error']){if(_0x499c31[_0x3e5c('0xe')][_0x3e5c('0xf')]===0x1f4){logger[_0x3e5c('0xe')](_0x3e5c('0x10'),_0x40a677,_0x499c31[_0x3e5c('0xe')]['message']);return _0x53d5a7(_0x499c31[_0x3e5c('0xe')][_0x3e5c('0x11')]);}logger[_0x3e5c('0xe')](_0x3e5c('0x10'),_0x40a677,_0x499c31['error'][_0x3e5c('0x11')]);return _0x5e7d8a(_0x499c31[_0x3e5c('0xe')][_0x3e5c('0x11')]);}else{logger[_0x3e5c('0xb')](_0x3e5c('0x10'),_0x40a677,_0x3e5c('0xd'));_0x5e7d8a(_0x499c31[_0x3e5c('0x12')][_0x3e5c('0x11')]);}})[_0x3e5c('0x13')](function(_0x361098){logger[_0x3e5c('0xe')]('ZendeskField,\x20%s,\x20%s',_0x40a677,_0x361098);_0x53d5a7(_0x361098);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index c65deec..3680c72 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 _0x9fb0=['post','addConfiguration','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x178907,_0x2c845f){var _0x310294=function(_0x2591c0){while(--_0x2591c0){_0x178907['push'](_0x178907['shift']());}};_0x310294(++_0x2c845f);}(_0x9fb0,0x160));var _0x09fb=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x9fb0[_0x365e54];return _0x13317a;};'use strict';var multer=require('multer');var util=require(_0x09fb('0x0'));var path=require('path');var timeout=require(_0x09fb('0x1'));var express=require(_0x09fb('0x2'));var router=express[_0x09fb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x09fb('0x4'));var interaction=require(_0x09fb('0x5'));var config=require(_0x09fb('0x6'));var controller=require(_0x09fb('0x7'));router[_0x09fb('0x8')]('/',auth[_0x09fb('0x9')](),controller[_0x09fb('0xa')]);router[_0x09fb('0x8')](_0x09fb('0xb'),auth['isAuthenticated'](),controller[_0x09fb('0xc')]);router[_0x09fb('0x8')](_0x09fb('0xd'),auth[_0x09fb('0x9')](),controller[_0x09fb('0xe')]);router[_0x09fb('0x8')](_0x09fb('0xf'),auth[_0x09fb('0x9')](),controller['getFields']);router[_0x09fb('0x10')]('/',auth[_0x09fb('0x9')](),controller['create']);router[_0x09fb('0x10')](_0x09fb('0xd'),auth[_0x09fb('0x9')](),controller[_0x09fb('0x11')]);router[_0x09fb('0x12')](_0x09fb('0xb'),auth[_0x09fb('0x9')](),controller[_0x09fb('0x13')]);router[_0x09fb('0x14')](_0x09fb('0xb'),auth[_0x09fb('0x9')](),controller[_0x09fb('0x15')]);module[_0x09fb('0x16')]=router; \ No newline at end of file +var _0x350f=['post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x386316,_0x43226f){var _0x47e11a=function(_0x4d6c6f){while(--_0x4d6c6f){_0x386316['push'](_0x386316['shift']());}};_0x47e11a(++_0x43226f);}(_0x350f,0x69));var _0xf350=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0x350f[_0x37cc52];return _0x2b4a90;};'use strict';var multer=require(_0xf350('0x0'));var util=require(_0xf350('0x1'));var path=require(_0xf350('0x2'));var timeout=require(_0xf350('0x3'));var express=require(_0xf350('0x4'));var router=express[_0xf350('0x5')]();var fs_extra=require(_0xf350('0x6'));var auth=require(_0xf350('0x7'));var interaction=require(_0xf350('0x8'));var config=require(_0xf350('0x9'));var controller=require(_0xf350('0xa'));router[_0xf350('0xb')]('/',auth[_0xf350('0xc')](),controller[_0xf350('0xd')]);router[_0xf350('0xb')](_0xf350('0xe'),auth[_0xf350('0xc')](),controller[_0xf350('0xf')]);router[_0xf350('0xb')](_0xf350('0x10'),auth['isAuthenticated'](),controller[_0xf350('0x11')]);router[_0xf350('0xb')](_0xf350('0x12'),auth[_0xf350('0xc')](),controller[_0xf350('0x13')]);router[_0xf350('0x14')]('/',auth[_0xf350('0xc')](),controller['create']);router[_0xf350('0x14')](_0xf350('0x10'),auth[_0xf350('0xc')](),controller['addConfiguration']);router['put']('/:id',auth[_0xf350('0xc')](),controller[_0xf350('0x15')]);router[_0xf350('0x16')](_0xf350('0xe'),auth[_0xf350('0xc')](),controller[_0xf350('0x17')]);module[_0xf350('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 4d6a4c7..3c71c9b 100644 --- a/server/api/intZohoAccount/intZohoAccount.attributes.js +++ b/server/api/intZohoAccount/intZohoAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd64b=['STRING','sequelize'];(function(_0x155d93,_0x3672fa){var _0x2aa155=function(_0x3ee3cf){while(--_0x3ee3cf){_0x155d93['push'](_0x155d93['shift']());}};_0x2aa155(++_0x3672fa);}(_0xd64b,0xc1));var _0xbd64=function(_0x44af2d,_0x4a676f){_0x44af2d=_0x44af2d-0x0;var _0x45edb5=_0xd64b[_0x44af2d];return _0x45edb5;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x22fb=['STRING'];(function(_0x501d4b,_0xf0fb8e){var _0x5d7db0=function(_0x215479){while(--_0x215479){_0x501d4b['push'](_0x501d4b['shift']());}};_0x5d7db0(++_0xf0fb8e);}(_0x22fb,0x192));var _0xb22f=function(_0x1bf742,_0x21dde5){_0x1bf742=_0x1bf742-0x0;var _0x40a358=_0x22fb[_0x1bf742];return _0x40a358;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb22f('0x0')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xb22f('0x0')]},'zone':{'type':Sequelize[_0xb22f('0x0')]},'clientId':{'type':Sequelize[_0xb22f('0x0')]},'clientSecret':{'type':Sequelize[_0xb22f('0x0')]},'serverUrl':{'type':Sequelize[_0xb22f('0x0')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb22f('0x0')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index ccc79f2..626ce3a 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 _0xd741=['zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Type','remove','includes','api_name','system_mandatory','display_label','picklist','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','sendStatus','error','name','send','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','merge','where','type','filter','includeAll','include','catch','show','params','keys','options','create','body','update','find','findOne','ZohoConfiguration','sort','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','channel','ZohoField','Subjects'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd741,0x1a3));var _0x1d74=function(_0x40ac81,_0x4e81e9){_0x40ac81=_0x40ac81-0x0;var _0x1fafb7=_0xd741[_0x40ac81];return _0x1fafb7;};'use strict';var emlformat=require(_0x1d74('0x0'));var rimraf=require(_0x1d74('0x1'));var zipdir=require(_0x1d74('0x2'));var jsonpatch=require(_0x1d74('0x3'));var rp=require(_0x1d74('0x4'));var moment=require(_0x1d74('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1d74('0x6'));var path=require(_0x1d74('0x7'));var sox=require(_0x1d74('0x8'));var csv=require(_0x1d74('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1d74('0xa'));var _=require(_0x1d74('0xb'));var squel=require('squel');var crypto=require(_0x1d74('0xc'));var jsforce=require(_0x1d74('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x1d74('0x9'));var querystring=require(_0x1d74('0xe'));var Papa=require(_0x1d74('0xf'));var Redis=require(_0x1d74('0x10'));var authService=require(_0x1d74('0x11'));var qs=require(_0x1d74('0x12'));var as=require(_0x1d74('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1d74('0x14'))(_0x1d74('0x15'));var utils=require(_0x1d74('0x16'));var config=require(_0x1d74('0x17'));var licenseUtil=require(_0x1d74('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x1d74('0x19'));function respondWithStatusCode(_0x5e598d,_0x1d5551){_0x1d5551=_0x1d5551||0xcc;return function(_0x4e79de){if(_0x4e79de){return _0x5e598d['sendStatus'](_0x1d5551);}return _0x5e598d[_0x1d74('0x1a')](_0x1d5551)[_0x1d74('0x1b')]();};}function respondWithResult(_0x11d337,_0x519fa9){_0x519fa9=_0x519fa9||0xc8;return function(_0x852e51){if(_0x852e51){return _0x11d337['status'](_0x519fa9)[_0x1d74('0x1c')](_0x852e51);}};}function respondWithFilteredResult(_0x3209b7,_0x3e86f3){return function(_0x5e2d1f){if(_0x5e2d1f){var _0xdb5bb9=typeof _0x3e86f3[_0x1d74('0x1d')]===_0x1d74('0x1e')&&typeof _0x3e86f3[_0x1d74('0x1f')]===_0x1d74('0x1e');var _0x311f0a=_0x5e2d1f['count'];var _0x54545b=_0xdb5bb9?0x0:_0x3e86f3[_0x1d74('0x1d')];var _0x2c09c3=_0xdb5bb9?_0x5e2d1f[_0x1d74('0x20')]:_0x3e86f3['offset']+_0x3e86f3[_0x1d74('0x1f')];var _0x13ea8e;if(_0x2c09c3>=_0x311f0a){_0x2c09c3=_0x311f0a;_0x13ea8e=0xc8;}else{_0x13ea8e=0xce;}_0x3209b7[_0x1d74('0x1a')](_0x13ea8e);return _0x3209b7[_0x1d74('0x21')](_0x1d74('0x22'),_0x54545b+'-'+_0x2c09c3+'/'+_0x311f0a)[_0x1d74('0x1c')](_0x5e2d1f);}return null;};}function patchUpdates(_0x2c54d7){return function(_0x1a84dd){try{jsonpatch[_0x1d74('0x23')](_0x1a84dd,_0x2c54d7,!![]);}catch(_0x3a9879){return BPromise[_0x1d74('0x24')](_0x3a9879);}return _0x1a84dd[_0x1d74('0x25')]();};}function saveUpdates(_0x43b6af,_0x559a8f){return function(_0x587a04){if(_0x587a04){return _0x587a04['update'](_0x43b6af)['then'](function(_0x941677){return _0x941677;});}return null;};}function removeEntity(_0x416cc5,_0x21e206){return function(_0x1fecdd){if(_0x1fecdd){return _0x1fecdd[_0x1d74('0x26')]()[_0x1d74('0x27')](function(){_0x416cc5[_0x1d74('0x1a')](0xcc)[_0x1d74('0x1b')]();});}};}function handleEntityNotFound(_0xf9d774,_0x137eb9){return function(_0x2e6260){if(!_0x2e6260){_0xf9d774[_0x1d74('0x28')](0x194);}return _0x2e6260;};}function handleError(_0x4da846,_0x2729ef){_0x2729ef=_0x2729ef||0x1f4;return function(_0x29fd01){logger[_0x1d74('0x29')](_0x29fd01['stack']);if(_0x29fd01[_0x1d74('0x2a')]){delete _0x29fd01[_0x1d74('0x2a')];}_0x4da846[_0x1d74('0x1a')](_0x2729ef)[_0x1d74('0x2b')](_0x29fd01);};}exports[_0x1d74('0x2c')]=function(_0x272802,_0x3a29d0){var _0x38ce0c={},_0x253023={},_0x3c9f20={'count':0x0,'rows':[]};var _0x1f1359=_[_0x1d74('0x2d')](db[_0x1d74('0x2e')][_0x1d74('0x2f')],function(_0x1914ed){return{'name':_0x1914ed[_0x1d74('0x30')],'type':_0x1914ed['type'][_0x1d74('0x31')]};});_0x253023[_0x1d74('0x32')]=_[_0x1d74('0x2d')](_0x1f1359,'name');_0x253023[_0x1d74('0x33')]=_['keys'](_0x272802[_0x1d74('0x33')]);_0x253023[_0x1d74('0x34')]=_[_0x1d74('0x35')](_0x253023[_0x1d74('0x32')],_0x253023[_0x1d74('0x33')]);_0x38ce0c[_0x1d74('0x36')]=_[_0x1d74('0x35')](_0x253023[_0x1d74('0x32')],qs[_0x1d74('0x37')](_0x272802[_0x1d74('0x33')][_0x1d74('0x37')]));_0x38ce0c[_0x1d74('0x36')]=_0x38ce0c[_0x1d74('0x36')][_0x1d74('0x38')]?_0x38ce0c[_0x1d74('0x36')]:_0x253023[_0x1d74('0x32')];if(!_0x272802['query']['hasOwnProperty'](_0x1d74('0x39'))){_0x38ce0c['limit']=qs[_0x1d74('0x1f')](_0x272802[_0x1d74('0x33')][_0x1d74('0x1f')]);_0x38ce0c['offset']=qs[_0x1d74('0x1d')](_0x272802[_0x1d74('0x33')][_0x1d74('0x1d')]);}_0x38ce0c[_0x1d74('0x3a')]=qs['sort'](_0x272802['query']['sort']);_0x38ce0c['where']=qs['filters'](_['pick'](_0x272802[_0x1d74('0x33')],_0x253023['filters']),_0x1f1359);if(_0x272802['query']['filter']){_0x38ce0c['where']=_[_0x1d74('0x3b')](_0x38ce0c[_0x1d74('0x3c')],{'$or':_['map'](_0x1f1359,function(_0x2e6953){if(_0x2e6953[_0x1d74('0x3d')]!=='VIRTUAL'){var _0x25bb43={};_0x25bb43[_0x2e6953[_0x1d74('0x2a')]]={'$like':'%'+_0x272802[_0x1d74('0x33')][_0x1d74('0x3e')]+'%'};return _0x25bb43;}})});}_0x38ce0c=_[_0x1d74('0x3b')]({},_0x38ce0c,_0x272802['options']);var _0x4187b6={'where':_0x38ce0c[_0x1d74('0x3c')]};return db[_0x1d74('0x2e')][_0x1d74('0x20')](_0x4187b6)[_0x1d74('0x27')](function(_0x3e09c3){_0x3c9f20[_0x1d74('0x20')]=_0x3e09c3;if(_0x272802[_0x1d74('0x33')][_0x1d74('0x3f')]){_0x38ce0c[_0x1d74('0x40')]=[{'all':!![]}];}return db[_0x1d74('0x2e')]['findAll'](_0x38ce0c);})[_0x1d74('0x27')](function(_0x44f98d){_0x3c9f20['rows']=_0x44f98d;return _0x3c9f20;})[_0x1d74('0x27')](respondWithFilteredResult(_0x3a29d0,_0x38ce0c))[_0x1d74('0x41')](handleError(_0x3a29d0,null));};exports[_0x1d74('0x42')]=function(_0x5238f1,_0x195a1e){var _0x47912c={'raw':![],'where':{'id':_0x5238f1[_0x1d74('0x43')]['id']}},_0x31f295={};_0x31f295[_0x1d74('0x32')]=_[_0x1d74('0x44')](db['ZohoAccount']['rawAttributes']);_0x31f295[_0x1d74('0x33')]=_[_0x1d74('0x44')](_0x5238f1['query']);_0x31f295[_0x1d74('0x34')]=_[_0x1d74('0x35')](_0x31f295['model'],_0x31f295['query']);_0x47912c[_0x1d74('0x36')]=_[_0x1d74('0x35')](_0x31f295[_0x1d74('0x32')],qs[_0x1d74('0x37')](_0x5238f1[_0x1d74('0x33')][_0x1d74('0x37')]));_0x47912c[_0x1d74('0x36')]=_0x47912c[_0x1d74('0x36')]['length']?_0x47912c[_0x1d74('0x36')]:_0x31f295['model'];if(_0x5238f1[_0x1d74('0x33')][_0x1d74('0x3f')]){_0x47912c['include']=[{'all':!![]}];}_0x47912c=_[_0x1d74('0x3b')]({},_0x47912c,_0x5238f1[_0x1d74('0x45')]);return db['ZohoAccount']['find'](_0x47912c)['then'](handleEntityNotFound(_0x195a1e,null))[_0x1d74('0x27')](respondWithResult(_0x195a1e,null))[_0x1d74('0x41')](handleError(_0x195a1e,null));};exports[_0x1d74('0x46')]=function(_0x5e5430,_0x2cfc64){return db[_0x1d74('0x2e')][_0x1d74('0x46')](_0x5e5430[_0x1d74('0x47')],{})[_0x1d74('0x27')](respondWithResult(_0x2cfc64,0xc9))[_0x1d74('0x41')](handleError(_0x2cfc64,null));};exports[_0x1d74('0x48')]=function(_0x174e8b,_0x4edcd3){if(_0x174e8b[_0x1d74('0x47')]['id']){delete _0x174e8b['body']['id'];}return db[_0x1d74('0x2e')]['find']({'where':{'id':_0x174e8b['params']['id']}})['then'](handleEntityNotFound(_0x4edcd3,null))[_0x1d74('0x27')](saveUpdates(_0x174e8b[_0x1d74('0x47')],null))[_0x1d74('0x27')](respondWithResult(_0x4edcd3,null))[_0x1d74('0x41')](handleError(_0x4edcd3,null));};exports[_0x1d74('0x26')]=function(_0x1cf881,_0x250645){return db['ZohoAccount'][_0x1d74('0x49')]({'where':{'id':_0x1cf881['params']['id']}})['then'](handleEntityNotFound(_0x250645,null))['then'](removeEntity(_0x250645,null))[_0x1d74('0x41')](handleError(_0x250645,null));};exports['getConfigurations']=function(_0x3de90c,_0x56791b,_0x264a56){var _0x4cf0b9={};var _0x3612f6={};var _0x3a6c6a;var _0x2e0e44;return db[_0x1d74('0x2e')][_0x1d74('0x4a')]({'where':{'id':_0x3de90c[_0x1d74('0x43')]['id']}})[_0x1d74('0x27')](handleEntityNotFound(_0x56791b,null))['then'](function(_0x5a3dfe){if(_0x5a3dfe){_0x3a6c6a=_0x5a3dfe;_0x3612f6[_0x1d74('0x32')]=_[_0x1d74('0x44')](db[_0x1d74('0x4b')]['rawAttributes']);_0x3612f6[_0x1d74('0x33')]=_[_0x1d74('0x44')](_0x3de90c['query']);_0x3612f6[_0x1d74('0x34')]=_[_0x1d74('0x35')](_0x3612f6[_0x1d74('0x32')],_0x3612f6[_0x1d74('0x33')]);_0x4cf0b9[_0x1d74('0x36')]=_['intersection'](_0x3612f6['model'],qs[_0x1d74('0x37')](_0x3de90c['query'][_0x1d74('0x37')]));_0x4cf0b9[_0x1d74('0x36')]=_0x4cf0b9[_0x1d74('0x36')][_0x1d74('0x38')]?_0x4cf0b9[_0x1d74('0x36')]:_0x3612f6['model'];_0x4cf0b9[_0x1d74('0x3a')]=qs['sort'](_0x3de90c[_0x1d74('0x33')][_0x1d74('0x4c')]);_0x4cf0b9[_0x1d74('0x3c')]=qs[_0x1d74('0x34')](_['pick'](_0x3de90c[_0x1d74('0x33')],_0x3612f6[_0x1d74('0x34')]));if(_0x3de90c[_0x1d74('0x33')][_0x1d74('0x3e')]){_0x4cf0b9[_0x1d74('0x3c')]=_['merge'](_0x4cf0b9[_0x1d74('0x3c')],{'$or':_[_0x1d74('0x2d')](_0x4cf0b9[_0x1d74('0x36')],function(_0x43d929){var _0x3745ff={};_0x3745ff[_0x43d929]={'$like':'%'+_0x3de90c[_0x1d74('0x33')][_0x1d74('0x3e')]+'%'};return _0x3745ff;})});}_0x4cf0b9=_[_0x1d74('0x3b')]({},_0x4cf0b9,_0x3de90c['options']);return _0x3a6c6a['getConfigurations'](_0x4cf0b9);}})[_0x1d74('0x27')](function(_0x3b1f2c){if(_0x3b1f2c){_0x2e0e44=_0x3b1f2c[_0x1d74('0x38')];if(!_0x3de90c[_0x1d74('0x33')]['hasOwnProperty'](_0x1d74('0x39'))){_0x4cf0b9['limit']=qs[_0x1d74('0x1f')](_0x3de90c[_0x1d74('0x33')][_0x1d74('0x1f')]);_0x4cf0b9[_0x1d74('0x1d')]=qs[_0x1d74('0x1d')](_0x3de90c[_0x1d74('0x33')][_0x1d74('0x1d')]);}return _0x3a6c6a[_0x1d74('0x4d')](_0x4cf0b9);}})[_0x1d74('0x27')](function(_0x36f00e){if(_0x36f00e){return _0x36f00e?{'count':_0x2e0e44,'rows':_0x36f00e}:null;}})[_0x1d74('0x27')](respondWithResult(_0x56791b,null))['catch'](handleError(_0x56791b,null));};exports[_0x1d74('0x4e')]=function(_0x4c662f,_0x26db46,_0x57da2a){if(_0x4c662f[_0x1d74('0x47')]['id']){delete _0x4c662f['body']['id'];}return db['ZohoAccount'][_0x1d74('0x4a')]({'where':{'id':_0x4c662f[_0x1d74('0x43')]['id']}})['then'](handleEntityNotFound(_0x26db46,null))['then'](function(_0x51141e){if(_0x51141e){_0x4c662f[_0x1d74('0x47')][_0x1d74('0x4f')]=_0x51141e['id'];_0x4c662f[_0x1d74('0x47')]['Subjects']=integrations[_0x1d74('0x50')](_0x4c662f[_0x1d74('0x47')]['channel'],_0x4c662f[_0x1d74('0x47')][_0x1d74('0x3d')]);_0x4c662f[_0x1d74('0x47')][_0x1d74('0x51')]=integrations['getDescriptions'](_0x4c662f['body'][_0x1d74('0x52')],_0x4c662f['body'][_0x1d74('0x3d')]);return db[_0x1d74('0x4b')][_0x1d74('0x46')](_0x4c662f[_0x1d74('0x47')],{'include':[{'model':db[_0x1d74('0x53')],'as':_0x1d74('0x54')},{'model':db[_0x1d74('0x53')],'as':_0x1d74('0x51')}]});}return null;})['then'](respondWithResult(_0x26db46,null))[_0x1d74('0x41')](handleError(_0x26db46,null));};function getAccessToken(_0x49e22d){return new Promise(function(_0x44c2cb,_0x21dafe){var _0x333a61;switch(_0x49e22d[_0x1d74('0x55')]){case'US':_0x333a61=_0x1d74('0x56');break;case'AU':_0x333a61='https://accounts.zoho.com.au';break;case'EU':_0x333a61=_0x1d74('0x57');break;case'IN':_0x333a61=_0x1d74('0x58');break;case'CN':_0x333a61=_0x1d74('0x59');break;default:_0x333a61='https://accounts.zoho.eu';break;}var _0xcb1aa={'method':'POST','uri':_0x333a61+_0x1d74('0x5a'),'qs':{'refresh_token':_0x49e22d[_0x1d74('0x5b')],'client_id':_0x49e22d[_0x1d74('0x5c')],'client_secret':_0x49e22d[_0x1d74('0x5d')],'grant_type':_0x1d74('0x5e')},'json':!![]};return rp(_0xcb1aa)[_0x1d74('0x27')](function(_0x208e42){if(_0x208e42[_0x1d74('0x5f')]){_0x44c2cb(_0x208e42[_0x1d74('0x5f')]);}else{_0x21dafe('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x1d74('0x41')](function(_0x597b10){_0x21dafe(_0x597b10);});});}exports[_0x1d74('0x60')]=function(_0xf24889,_0x108f3b,_0x120b61){var _0x2be5f7,_0x26b562,_0x2279ec,_0xbaa518,_0x1bf1c7;return db[_0x1d74('0x2e')]['findOne']({'where':{'id':_0xf24889['params']['id']},'attributes':['id',_0x1d74('0x61'),_0x1d74('0x55'),_0x1d74('0x5c'),'clientSecret',_0x1d74('0x62'),'code',_0x1d74('0x5b')]})[_0x1d74('0x27')](handleEntityNotFound(_0x108f3b,null))[_0x1d74('0x27')](function(_0x5cf72f){_0x1bf1c7=_0x5cf72f;_0x2be5f7=_0x1bf1c7[_0x1d74('0x61')];_0x26b562=_0x2be5f7===_0x1d74('0x63')?'eu':_0x1d74('0x64');_0x2279ec=_0x1bf1c7[_0x1d74('0x62')];var _0x436d42=_0x2279ec['slice'](-0x1);if(_0x436d42==='/'||_0x436d42==='\x5c'||_0x436d42===':'){_0x2279ec=_0x2279ec[_0x1d74('0x65')](0x0,_0x2279ec[_0x1d74('0x66')](_0x436d42));}if(!_0x1bf1c7['refreshToken']){throw new Error(_0x1d74('0x67'));}return getAccessToken(_0x1bf1c7);})[_0x1d74('0x27')](function(_0xa31a09){if(_0xa31a09){return rp({'method':_0x1d74('0x68'),'uri':util['format'](_0x1d74('0x69'),_0x26b562),'qs':{'module':_0x1d74('0x6a')},'headers':{'Authorization':_0x1d74('0x6b')+_0xa31a09},'json':!![]});}})['then'](function(_0x53d192){if(_0x53d192){if(_0x53d192[_0x1d74('0x6c')]&&_0x53d192['response'][_0x1d74('0x29')]){throw new Error(_0x53d192[_0x1d74('0x6c')][_0x1d74('0x29')][_0x1d74('0x6d')]);}var _0xca585f=[];var _0x5c4690=[];var _0x4a60a0=[_0x1d74('0x6e'),_0x1d74('0x6f'),_0x1d74('0x70'),_0x1d74('0x71'),_0x1d74('0x72'),'Call_Result','Call_Start_Time',_0x1d74('0x73')];_0x5c4690=_[_0x1d74('0x74')](_0x53d192['fields'],function(_0x1ac0ce){return _0x4a60a0[_0x1d74('0x75')](_0x1ac0ce[_0x1d74('0x76')]);});for(var _0x3b4f15=0x0;_0x3b4f15<_0x5c4690[_0x1d74('0x38')];_0x3b4f15++){if(_0x5c4690[_0x3b4f15][_0x1d74('0x77')]===![]){_0xca585f['push']({'id':_0x5c4690[_0x3b4f15]['id'],'name':_0x5c4690[_0x3b4f15][_0x1d74('0x78')],'custom':_0x5c4690[_0x3b4f15]['custom_field'],'options':_0x5c4690[_0x3b4f15]['data_type']===_0x1d74('0x79')&&_0x5c4690[_0x3b4f15]['pick_list_values'][_0x1d74('0x38')]>-0x1?_[_0x1d74('0x2d')](_0x5c4690[_0x3b4f15]['pick_list_values'],function(_0x42699b){return{'name':_0x42699b,'value':_0x42699b};}):[]});}}return{'count':_0xca585f[_0x1d74('0x38')],'rows':_0xca585f};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x108f3b,null))[_0x1d74('0x41')](function(_0x4aa884){var _0x2a72e6=_0xf24889[_0x1d74('0x33')][_0x1d74('0x7a')]?0x1f4:_0x4aa884[_0x1d74('0x7b')]||0x1f4;logger['error'](_0x1d74('0x7c'),'getFields',_0x2a72e6,JSON['stringify'](_0x4aa884));delete _0x4aa884[_0x1d74('0x2a')];if(_0x2a72e6===0x191){_0x2a72e6=0x190;}_0x108f3b['status'](_0x2a72e6)[_0x1d74('0x2b')](_0xf24889['query'][_0x1d74('0x7a')]?{'message':_0x1d74('0x7d'),'statusCode':_0x4aa884[_0x1d74('0x7b')]}:_0x4aa884);});}; \ No newline at end of file +var _0x751e=['index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','name','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','length','create','body','find','getConfigurations','ZohoConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','zoho.eu','com','slice','substring','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','error','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','push','display_label','data_type','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','count','json','reject','save','then','destroy','stack'];(function(_0x314a45,_0x4de035){var _0x3fee4b=function(_0x54397d){while(--_0x54397d){_0x314a45['push'](_0x314a45['shift']());}};_0x3fee4b(++_0x4de035);}(_0x751e,0x1ce));var _0xe751=function(_0xa205ef,_0x5a64cf){_0xa205ef=_0xa205ef-0x0;var _0x59d23d=_0x751e[_0xa205ef];return _0x59d23d;};'use strict';var emlformat=require(_0xe751('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe751('0x1'));var jsonpatch=require(_0xe751('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe751('0x3'));var Mustache=require(_0xe751('0x4'));var util=require('util');var path=require('path');var sox=require(_0xe751('0x5'));var csv=require(_0xe751('0x6'));var ejs=require(_0xe751('0x7'));var fs=require('fs');var fs_extra=require(_0xe751('0x8'));var _=require('lodash');var squel=require(_0xe751('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe751('0x6'));var querystring=require(_0xe751('0xa'));var Papa=require(_0xe751('0xb'));var Redis=require(_0xe751('0xc'));var authService=require(_0xe751('0xd'));var qs=require(_0xe751('0xe'));var as=require(_0xe751('0xf'));var hardwareService=require(_0xe751('0x10'));var logger=require(_0xe751('0x11'))(_0xe751('0x12'));var utils=require(_0xe751('0x13'));var config=require(_0xe751('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xe751('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x122d01,_0x1b888d){_0x1b888d=_0x1b888d||0xcc;return function(_0x3bf8bf){if(_0x3bf8bf){return _0x122d01['sendStatus'](_0x1b888d);}return _0x122d01[_0xe751('0x16')](_0x1b888d)[_0xe751('0x17')]();};}function respondWithResult(_0x1888fa,_0x1e948b){_0x1e948b=_0x1e948b||0xc8;return function(_0x13c9d2){if(_0x13c9d2){return _0x1888fa[_0xe751('0x16')](_0x1e948b)['json'](_0x13c9d2);}};}function respondWithFilteredResult(_0x102e82,_0x2fb218){return function(_0x1b1130){if(_0x1b1130){var _0x28ad7d=typeof _0x2fb218['offset']===_0xe751('0x18')&&typeof _0x2fb218[_0xe751('0x19')]===_0xe751('0x18');var _0x2fe1ef=_0x1b1130['count'];var _0xbcc03=_0x28ad7d?0x0:_0x2fb218[_0xe751('0x1a')];var _0x25904f=_0x28ad7d?_0x1b1130[_0xe751('0x1b')]:_0x2fb218[_0xe751('0x1a')]+_0x2fb218[_0xe751('0x19')];var _0x404084;if(_0x25904f>=_0x2fe1ef){_0x25904f=_0x2fe1ef;_0x404084=0xc8;}else{_0x404084=0xce;}_0x102e82['status'](_0x404084);return _0x102e82['set']('Content-Range',_0xbcc03+'-'+_0x25904f+'/'+_0x2fe1ef)[_0xe751('0x1c')](_0x1b1130);}return null;};}function patchUpdates(_0x3d8283){return function(_0x31e76a){try{jsonpatch['apply'](_0x31e76a,_0x3d8283,!![]);}catch(_0x160bc6){return BPromise[_0xe751('0x1d')](_0x160bc6);}return _0x31e76a[_0xe751('0x1e')]();};}function saveUpdates(_0x2e68c0,_0x22810e){return function(_0xd2fb4c){if(_0xd2fb4c){return _0xd2fb4c['update'](_0x2e68c0)[_0xe751('0x1f')](function(_0x43cf12){return _0x43cf12;});}return null;};}function removeEntity(_0x3e8cf3,_0x5cc7f5){return function(_0x5537aa){if(_0x5537aa){return _0x5537aa[_0xe751('0x20')]()[_0xe751('0x1f')](function(){_0x3e8cf3[_0xe751('0x16')](0xcc)[_0xe751('0x17')]();});}};}function handleEntityNotFound(_0x24ef31,_0x4dfdca){return function(_0x5de5d0){if(!_0x5de5d0){_0x24ef31['sendStatus'](0x194);}return _0x5de5d0;};}function handleError(_0x46754e,_0x17fc9f){_0x17fc9f=_0x17fc9f||0x1f4;return function(_0x23a1aa){logger['error'](_0x23a1aa[_0xe751('0x21')]);if(_0x23a1aa['name']){delete _0x23a1aa['name'];}_0x46754e[_0xe751('0x16')](_0x17fc9f)['send'](_0x23a1aa);};}exports[_0xe751('0x22')]=function(_0x5a542e,_0x5e756f){var _0x5b3be4={},_0x47b4a1={},_0x318a92={'count':0x0,'rows':[]};var _0x135bbb=_['map'](db[_0xe751('0x23')][_0xe751('0x24')],function(_0x178b77){return{'name':_0x178b77[_0xe751('0x25')],'type':_0x178b77[_0xe751('0x26')][_0xe751('0x27')]};});_0x47b4a1[_0xe751('0x28')]=_[_0xe751('0x29')](_0x135bbb,_0xe751('0x2a'));_0x47b4a1[_0xe751('0x2b')]=_[_0xe751('0x2c')](_0x5a542e['query']);_0x47b4a1['filters']=_[_0xe751('0x2d')](_0x47b4a1['model'],_0x47b4a1[_0xe751('0x2b')]);_0x5b3be4[_0xe751('0x2e')]=_[_0xe751('0x2d')](_0x47b4a1[_0xe751('0x28')],qs[_0xe751('0x2f')](_0x5a542e[_0xe751('0x2b')][_0xe751('0x2f')]));_0x5b3be4['attributes']=_0x5b3be4[_0xe751('0x2e')]['length']?_0x5b3be4[_0xe751('0x2e')]:_0x47b4a1[_0xe751('0x28')];if(!_0x5a542e[_0xe751('0x2b')][_0xe751('0x30')](_0xe751('0x31'))){_0x5b3be4[_0xe751('0x19')]=qs['limit'](_0x5a542e[_0xe751('0x2b')][_0xe751('0x19')]);_0x5b3be4['offset']=qs[_0xe751('0x1a')](_0x5a542e[_0xe751('0x2b')][_0xe751('0x1a')]);}_0x5b3be4[_0xe751('0x32')]=qs[_0xe751('0x33')](_0x5a542e[_0xe751('0x2b')][_0xe751('0x33')]);_0x5b3be4[_0xe751('0x34')]=qs['filters'](_['pick'](_0x5a542e[_0xe751('0x2b')],_0x47b4a1[_0xe751('0x35')]),_0x135bbb);if(_0x5a542e[_0xe751('0x2b')][_0xe751('0x36')]){_0x5b3be4['where']=_['merge'](_0x5b3be4[_0xe751('0x34')],{'$or':_[_0xe751('0x29')](_0x135bbb,function(_0x2d9243){if(_0x2d9243[_0xe751('0x26')]!==_0xe751('0x37')){var _0x3e8a08={};_0x3e8a08[_0x2d9243[_0xe751('0x2a')]]={'$like':'%'+_0x5a542e[_0xe751('0x2b')]['filter']+'%'};return _0x3e8a08;}})});}_0x5b3be4=_[_0xe751('0x38')]({},_0x5b3be4,_0x5a542e[_0xe751('0x39')]);var _0x11f65b={'where':_0x5b3be4[_0xe751('0x34')]};return db['ZohoAccount']['count'](_0x11f65b)[_0xe751('0x1f')](function(_0x546cd0){_0x318a92[_0xe751('0x1b')]=_0x546cd0;if(_0x5a542e[_0xe751('0x2b')][_0xe751('0x3a')]){_0x5b3be4[_0xe751('0x3b')]=[{'all':!![]}];}return db['ZohoAccount'][_0xe751('0x3c')](_0x5b3be4);})[_0xe751('0x1f')](function(_0x32ee75){_0x318a92[_0xe751('0x3d')]=_0x32ee75;return _0x318a92;})[_0xe751('0x1f')](respondWithFilteredResult(_0x5e756f,_0x5b3be4))[_0xe751('0x3e')](handleError(_0x5e756f,null));};exports['show']=function(_0x3dd44c,_0x4f0a2b){var _0x402e26={'raw':![],'where':{'id':_0x3dd44c[_0xe751('0x3f')]['id']}},_0x47b394={};_0x47b394['model']=_[_0xe751('0x2c')](db[_0xe751('0x23')][_0xe751('0x24')]);_0x47b394[_0xe751('0x2b')]=_['keys'](_0x3dd44c['query']);_0x47b394[_0xe751('0x35')]=_[_0xe751('0x2d')](_0x47b394['model'],_0x47b394[_0xe751('0x2b')]);_0x402e26[_0xe751('0x2e')]=_['intersection'](_0x47b394[_0xe751('0x28')],qs[_0xe751('0x2f')](_0x3dd44c[_0xe751('0x2b')][_0xe751('0x2f')]));_0x402e26[_0xe751('0x2e')]=_0x402e26[_0xe751('0x2e')][_0xe751('0x40')]?_0x402e26['attributes']:_0x47b394[_0xe751('0x28')];if(_0x3dd44c[_0xe751('0x2b')][_0xe751('0x3a')]){_0x402e26[_0xe751('0x3b')]=[{'all':!![]}];}_0x402e26=_['merge']({},_0x402e26,_0x3dd44c[_0xe751('0x39')]);return db[_0xe751('0x23')]['find'](_0x402e26)['then'](handleEntityNotFound(_0x4f0a2b,null))['then'](respondWithResult(_0x4f0a2b,null))[_0xe751('0x3e')](handleError(_0x4f0a2b,null));};exports[_0xe751('0x41')]=function(_0x410f0d,_0x2062da){return db[_0xe751('0x23')][_0xe751('0x41')](_0x410f0d[_0xe751('0x42')],{})['then'](respondWithResult(_0x2062da,0xc9))[_0xe751('0x3e')](handleError(_0x2062da,null));};exports['update']=function(_0xe8b891,_0xeb6953){if(_0xe8b891[_0xe751('0x42')]['id']){delete _0xe8b891[_0xe751('0x42')]['id'];}return db[_0xe751('0x23')][_0xe751('0x43')]({'where':{'id':_0xe8b891[_0xe751('0x3f')]['id']}})[_0xe751('0x1f')](handleEntityNotFound(_0xeb6953,null))[_0xe751('0x1f')](saveUpdates(_0xe8b891[_0xe751('0x42')],null))[_0xe751('0x1f')](respondWithResult(_0xeb6953,null))[_0xe751('0x3e')](handleError(_0xeb6953,null));};exports[_0xe751('0x20')]=function(_0x19bc5a,_0x6415c8){return db[_0xe751('0x23')][_0xe751('0x43')]({'where':{'id':_0x19bc5a['params']['id']}})[_0xe751('0x1f')](handleEntityNotFound(_0x6415c8,null))[_0xe751('0x1f')](removeEntity(_0x6415c8,null))[_0xe751('0x3e')](handleError(_0x6415c8,null));};exports[_0xe751('0x44')]=function(_0x421cf9,_0x4c1b5c,_0x2dd75b){var _0x304272={};var _0x158322={};var _0x119519;var _0x170f31;return db[_0xe751('0x23')]['findOne']({'where':{'id':_0x421cf9[_0xe751('0x3f')]['id']}})[_0xe751('0x1f')](handleEntityNotFound(_0x4c1b5c,null))[_0xe751('0x1f')](function(_0x58e5cb){if(_0x58e5cb){_0x119519=_0x58e5cb;_0x158322[_0xe751('0x28')]=_[_0xe751('0x2c')](db[_0xe751('0x45')]['rawAttributes']);_0x158322[_0xe751('0x2b')]=_[_0xe751('0x2c')](_0x421cf9[_0xe751('0x2b')]);_0x158322[_0xe751('0x35')]=_[_0xe751('0x2d')](_0x158322[_0xe751('0x28')],_0x158322[_0xe751('0x2b')]);_0x304272[_0xe751('0x2e')]=_[_0xe751('0x2d')](_0x158322[_0xe751('0x28')],qs[_0xe751('0x2f')](_0x421cf9[_0xe751('0x2b')]['fields']));_0x304272['attributes']=_0x304272[_0xe751('0x2e')][_0xe751('0x40')]?_0x304272[_0xe751('0x2e')]:_0x158322['model'];_0x304272[_0xe751('0x32')]=qs[_0xe751('0x33')](_0x421cf9[_0xe751('0x2b')]['sort']);_0x304272[_0xe751('0x34')]=qs['filters'](_['pick'](_0x421cf9['query'],_0x158322[_0xe751('0x35')]));if(_0x421cf9[_0xe751('0x2b')][_0xe751('0x36')]){_0x304272[_0xe751('0x34')]=_['merge'](_0x304272['where'],{'$or':_['map'](_0x304272[_0xe751('0x2e')],function(_0x281029){var _0x5686aa={};_0x5686aa[_0x281029]={'$like':'%'+_0x421cf9[_0xe751('0x2b')][_0xe751('0x36')]+'%'};return _0x5686aa;})});}_0x304272=_[_0xe751('0x38')]({},_0x304272,_0x421cf9[_0xe751('0x39')]);return _0x119519[_0xe751('0x44')](_0x304272);}})[_0xe751('0x1f')](function(_0x3ca65f){if(_0x3ca65f){_0x170f31=_0x3ca65f[_0xe751('0x40')];if(!_0x421cf9[_0xe751('0x2b')][_0xe751('0x30')](_0xe751('0x31'))){_0x304272[_0xe751('0x19')]=qs[_0xe751('0x19')](_0x421cf9['query']['limit']);_0x304272[_0xe751('0x1a')]=qs[_0xe751('0x1a')](_0x421cf9[_0xe751('0x2b')][_0xe751('0x1a')]);}return _0x119519[_0xe751('0x44')](_0x304272);}})[_0xe751('0x1f')](function(_0x16fc96){if(_0x16fc96){return _0x16fc96?{'count':_0x170f31,'rows':_0x16fc96}:null;}})['then'](respondWithResult(_0x4c1b5c,null))[_0xe751('0x3e')](handleError(_0x4c1b5c,null));};exports['addConfiguration']=function(_0x27aa23,_0x22feef,_0x5aa597){if(_0x27aa23[_0xe751('0x42')]['id']){delete _0x27aa23[_0xe751('0x42')]['id'];}return db['ZohoAccount'][_0xe751('0x46')]({'where':{'id':_0x27aa23[_0xe751('0x3f')]['id']}})[_0xe751('0x1f')](handleEntityNotFound(_0x22feef,null))[_0xe751('0x1f')](function(_0x300f54){if(_0x300f54){_0x27aa23[_0xe751('0x42')][_0xe751('0x47')]=_0x300f54['id'];_0x27aa23['body'][_0xe751('0x48')]=integrations[_0xe751('0x49')](_0x27aa23[_0xe751('0x42')][_0xe751('0x4a')],_0x27aa23['body'][_0xe751('0x26')]);_0x27aa23[_0xe751('0x42')][_0xe751('0x4b')]=integrations['getDescriptions'](_0x27aa23[_0xe751('0x42')][_0xe751('0x4a')],_0x27aa23[_0xe751('0x42')]['type']);return db[_0xe751('0x45')][_0xe751('0x41')](_0x27aa23[_0xe751('0x42')],{'include':[{'model':db[_0xe751('0x4c')],'as':_0xe751('0x48')},{'model':db[_0xe751('0x4c')],'as':_0xe751('0x4b')}]});}return null;})[_0xe751('0x1f')](respondWithResult(_0x22feef,null))[_0xe751('0x3e')](handleError(_0x22feef,null));};function getAccessToken(_0x4b5afe){return new Promise(function(_0x595c54,_0x5dd450){var _0x31243f;switch(_0x4b5afe[_0xe751('0x4d')]){case'US':_0x31243f='https://accounts.zoho.com';break;case'AU':_0x31243f=_0xe751('0x4e');break;case'EU':_0x31243f=_0xe751('0x4f');break;case'IN':_0x31243f=_0xe751('0x50');break;case'CN':_0x31243f=_0xe751('0x51');break;default:_0x31243f=_0xe751('0x4f');break;}var _0x10bcc0={'method':_0xe751('0x52'),'uri':_0x31243f+'/oauth/v2/token','qs':{'refresh_token':_0x4b5afe[_0xe751('0x53')],'client_id':_0x4b5afe[_0xe751('0x54')],'client_secret':_0x4b5afe[_0xe751('0x55')],'grant_type':_0xe751('0x56')},'json':!![]};return rp(_0x10bcc0)[_0xe751('0x1f')](function(_0xb497c2){if(_0xb497c2[_0xe751('0x57')]){_0x595c54(_0xb497c2[_0xe751('0x57')]);}else{_0x5dd450(_0xe751('0x58'));}})['catch'](function(_0x548779){_0x5dd450(_0x548779);});});}exports[_0xe751('0x59')]=function(_0x303994,_0x4273be,_0x52fc86){var _0x1562ae,_0x206b3b,_0x59770f,_0x2f9925,_0x3c2b31;return db['ZohoAccount'][_0xe751('0x46')]({'where':{'id':_0x303994['params']['id']},'attributes':['id',_0xe751('0x5a'),_0xe751('0x4d'),_0xe751('0x54'),_0xe751('0x55'),_0xe751('0x5b'),'code',_0xe751('0x53')]})[_0xe751('0x1f')](handleEntityNotFound(_0x4273be,null))[_0xe751('0x1f')](function(_0x2e592f){_0x3c2b31=_0x2e592f;_0x1562ae=_0x3c2b31[_0xe751('0x5a')];_0x206b3b=_0x1562ae===_0xe751('0x5c')?'eu':_0xe751('0x5d');_0x59770f=_0x3c2b31[_0xe751('0x5b')];var _0x36e303=_0x59770f[_0xe751('0x5e')](-0x1);if(_0x36e303==='/'||_0x36e303==='\x5c'||_0x36e303===':'){_0x59770f=_0x59770f[_0xe751('0x5f')](0x0,_0x59770f['lastIndexOf'](_0x36e303));}if(!_0x3c2b31[_0xe751('0x53')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x3c2b31);})[_0xe751('0x1f')](function(_0x4564ba){if(_0x4564ba){return rp({'method':_0xe751('0x60'),'uri':util[_0xe751('0x61')](_0xe751('0x62'),_0x206b3b),'qs':{'module':_0xe751('0x63')},'headers':{'Authorization':_0xe751('0x64')+_0x4564ba},'json':!![]});}})[_0xe751('0x1f')](function(_0x49d5d9){if(_0x49d5d9){if(_0x49d5d9[_0xe751('0x65')]&&_0x49d5d9[_0xe751('0x65')][_0xe751('0x66')]){throw new Error(_0x49d5d9[_0xe751('0x65')]['error'][_0xe751('0x67')]);}var _0x3d2262=[];var _0x2d2f21=[];var _0x2cd506=[_0xe751('0x68'),_0xe751('0x69'),_0xe751('0x6a'),_0xe751('0x6b'),_0xe751('0x6c'),_0xe751('0x6d'),_0xe751('0x6e'),'Call_Type'];_0x2d2f21=_[_0xe751('0x6f')](_0x49d5d9[_0xe751('0x2f')],function(_0x3e1a1e){return _0x2cd506[_0xe751('0x70')](_0x3e1a1e[_0xe751('0x71')]);});for(var _0x3cc34e=0x0;_0x3cc34e<_0x2d2f21[_0xe751('0x40')];_0x3cc34e++){if(_0x2d2f21[_0x3cc34e]['system_mandatory']===![]){_0x3d2262[_0xe751('0x72')]({'id':_0x2d2f21[_0x3cc34e]['id'],'name':_0x2d2f21[_0x3cc34e][_0xe751('0x73')],'custom':_0x2d2f21[_0x3cc34e]['custom_field'],'options':_0x2d2f21[_0x3cc34e][_0xe751('0x74')]==='picklist'&&_0x2d2f21[_0x3cc34e][_0xe751('0x75')][_0xe751('0x40')]>-0x1?_['map'](_0x2d2f21[_0x3cc34e][_0xe751('0x75')],function(_0xdc968b){return{'name':_0xdc968b,'value':_0xdc968b};}):[]});}}return{'count':_0x3d2262['length'],'rows':_0x3d2262};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4273be,null))[_0xe751('0x3e')](function(_0x59eafb){var _0x5383db=_0x303994[_0xe751('0x2b')][_0xe751('0x76')]?0x1f4:_0x59eafb[_0xe751('0x77')]||0x1f4;logger['error'](_0xe751('0x78'),_0xe751('0x59'),_0x5383db,JSON[_0xe751('0x79')](_0x59eafb));delete _0x59eafb[_0xe751('0x2a')];if(_0x5383db===0x191){_0x5383db=0x190;}_0x4273be[_0xe751('0x16')](_0x5383db)[_0xe751('0x7a')](_0x303994['query'][_0xe751('0x76')]?{'message':_0xe751('0x7b'),'statusCode':_0x59eafb['statusCode']}:_0x59eafb);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 92f6f3e..f2eb02c 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 _0xcb29=['exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientId','clientSecret','code','host','substring','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','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','lastIndexOf','https://accounts.zoho.com.au','authorization_code','info','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration'];(function(_0x3f2b28,_0x8b6e93){var _0x207cc3=function(_0x5430da){while(--_0x5430da){_0x3f2b28['push'](_0x3f2b28['shift']());}};_0x207cc3(++_0x8b6e93);}(_0xcb29,0x14e));var _0x9cb2=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0xcb29[_0x3305de];return _0x3b5a84;};'use strict';var _=require(_0x9cb2('0x0'));var util=require(_0x9cb2('0x1'));var logger=require(_0x9cb2('0x2'))(_0x9cb2('0x3'));var moment=require(_0x9cb2('0x4'));var BPromise=require('bluebird');var rp=require(_0x9cb2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9cb2('0x6'));var config=require(_0x9cb2('0x7'));var attributes=require(_0x9cb2('0x8'));var integrations=require(_0x9cb2('0x9'));module[_0x9cb2('0xa')]=function(_0x1b0088,_0x138303){return _0x1b0088[_0x9cb2('0xb')](_0x9cb2('0xc'),attributes,{'tableName':_0x9cb2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x321f84,_0x4e3ec5,_0x5e6240){if(_0x321f84['changed'](_0x9cb2('0xe'))||_0x321f84[_0x9cb2('0xf')](_0x9cb2('0x10'))||_0x321f84[_0x9cb2('0xf')](_0x9cb2('0x11'))||_0x321f84['changed'](_0x9cb2('0x12'))||_0x321f84[_0x9cb2('0xf')](_0x9cb2('0x13'))||_0x321f84['changed'](_0x9cb2('0x14'))){var _0x252663,_0x11fd47;_0x252663=_0x321f84[_0x9cb2('0x10')];var _0x50c32c=_0x252663['slice'](-0x1);if(_0x50c32c==='/'||_0x50c32c==='\x5c'||_0x50c32c===':'){_0x252663=_0x252663[_0x9cb2('0x15')](0x0,_0x252663['lastIndexOf'](_0x50c32c));}switch(_0x321f84[_0x9cb2('0xe')]){case'US':_0x11fd47=_0x9cb2('0x16');break;case'AU':_0x11fd47='https://accounts.zoho.com.au';break;case'IN':_0x11fd47='https://accounts.zoho.in';break;case'CN':_0x11fd47=_0x9cb2('0x17');break;default:_0x11fd47=_0x9cb2('0x18');break;}var _0xa4b3a={'method':_0x9cb2('0x19'),'uri':_0x11fd47+_0x9cb2('0x1a'),'form':{'grant_type':'authorization_code','client_id':_0x321f84[_0x9cb2('0x11')],'client_secret':_0x321f84[_0x9cb2('0x12')],'redirect_uri':_0x321f84[_0x9cb2('0x10')],'code':_0x321f84['code']},'headers':{'Content-Type':_0x9cb2('0x1b')}};return rp(_0xa4b3a)[_0x9cb2('0x1c')](function(_0x88b1d2){var _0x80479e=JSON[_0x9cb2('0x1d')](_0x88b1d2);if(_0x80479e[_0x9cb2('0x1e')]){_0x321f84[_0x9cb2('0x1f')]=_0x80479e[_0x9cb2('0x1e')];logger['info'](util[_0x9cb2('0x20')](_0x9cb2('0x21'),_0x321f84[_0x9cb2('0x22')],_0x321f84['id']));}else{logger[_0x9cb2('0x23')](util[_0x9cb2('0x20')](_0x9cb2('0x24'),_0x321f84['name'],_0x321f84['id']),util[_0x9cb2('0x25')](_0x80479e,{'showHidden':![],'depth':null}));}return _0x5e6240(null,_0x4e3ec5);})[_0x9cb2('0x26')](function(_0x430b7d){logger[_0x9cb2('0x23')](util[_0x9cb2('0x20')](_0x9cb2('0x24'),_0x321f84[_0x9cb2('0x22')],_0x321f84['id']),util[_0x9cb2('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x5e6240(_0x430b7d);});}else{return _0x5e6240(null,_0x4e3ec5);}},'beforeUpdate':function(_0x29920a,_0x5536d2,_0x2ebebf){if(_0x29920a['changed'](_0x9cb2('0xe'))||_0x29920a[_0x9cb2('0xf')]('serverUrl')||_0x29920a[_0x9cb2('0xf')](_0x9cb2('0x11'))||_0x29920a['changed'](_0x9cb2('0x12'))||_0x29920a['changed']('code')||_0x29920a['changed'](_0x9cb2('0x14'))){var _0xf4cca0,_0x5ce20c;_0xf4cca0=_0x29920a[_0x9cb2('0x10')];var _0x5a71d9=_0xf4cca0['slice'](-0x1);if(_0x5a71d9==='/'||_0x5a71d9==='\x5c'||_0x5a71d9===':'){_0xf4cca0=_0xf4cca0[_0x9cb2('0x15')](0x0,_0xf4cca0[_0x9cb2('0x27')](_0x5a71d9));}switch(_0x29920a[_0x9cb2('0xe')]){case'US':_0x5ce20c=_0x9cb2('0x16');break;case'AU':_0x5ce20c=_0x9cb2('0x28');break;case'IN':_0x5ce20c='https://accounts.zoho.in';break;case'CN':_0x5ce20c=_0x9cb2('0x17');break;default:_0x5ce20c=_0x9cb2('0x18');break;}var _0x5bde9d={'method':'POST','uri':_0x5ce20c+'/oauth/v2/token','form':{'grant_type':_0x9cb2('0x29'),'client_id':_0x29920a[_0x9cb2('0x11')],'client_secret':_0x29920a[_0x9cb2('0x12')],'redirect_uri':_0x29920a['serverUrl'],'code':_0x29920a[_0x9cb2('0x13')]},'headers':{'Content-Type':_0x9cb2('0x1b')}};return rp(_0x5bde9d)[_0x9cb2('0x1c')](function(_0x125d58){var _0x3e6691=JSON[_0x9cb2('0x1d')](_0x125d58);if(_0x3e6691['refresh_token']){_0x29920a[_0x9cb2('0x1f')]=_0x3e6691['refresh_token'];logger[_0x9cb2('0x2a')](util[_0x9cb2('0x20')](_0x9cb2('0x21'),_0x29920a[_0x9cb2('0x22')],_0x29920a['id']));}else{logger[_0x9cb2('0x23')](util[_0x9cb2('0x20')](_0x9cb2('0x24'),_0x29920a[_0x9cb2('0x22')],_0x29920a['id']),util[_0x9cb2('0x25')](_0x3e6691,{'showHidden':![],'depth':null}));}return _0x2ebebf(null,_0x5536d2);})[_0x9cb2('0x26')](function(_0x161f64){logger['error'](util['format'](_0x9cb2('0x24'),_0x29920a[_0x9cb2('0x22')],_0x29920a['id']),util[_0x9cb2('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x2ebebf(_0x161f64);});}else{return _0x2ebebf(null,_0x5536d2);}}}});}; \ No newline at end of file +var _0x7c74=['ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','info','format','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define'];(function(_0x4e63e4,_0x53420e){var _0x562c39=function(_0x3e9327){while(--_0x3e9327){_0x4e63e4['push'](_0x4e63e4['shift']());}};_0x562c39(++_0x53420e);}(_0x7c74,0x79));var _0x47c7=function(_0x14b767,_0x577e84){_0x14b767=_0x14b767-0x0;var _0x22267a=_0x7c74[_0x14b767];return _0x22267a;};'use strict';var _=require(_0x47c7('0x0'));var util=require(_0x47c7('0x1'));var logger=require(_0x47c7('0x2'))(_0x47c7('0x3'));var moment=require(_0x47c7('0x4'));var BPromise=require(_0x47c7('0x5'));var rp=require(_0x47c7('0x6'));var fs=require('fs');var path=require(_0x47c7('0x7'));var rimraf=require(_0x47c7('0x8'));var config=require(_0x47c7('0x9'));var attributes=require(_0x47c7('0xa'));var integrations=require(_0x47c7('0xb'));module[_0x47c7('0xc')]=function(_0x2b3d08,_0x1a9dc6){return _0x2b3d08[_0x47c7('0xd')](_0x47c7('0xe'),attributes,{'tableName':_0x47c7('0xf'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0xe16072,_0x2c6053,_0x45a8e3){if(_0xe16072['changed']('zone')||_0xe16072[_0x47c7('0x10')](_0x47c7('0x11'))||_0xe16072[_0x47c7('0x10')](_0x47c7('0x12'))||_0xe16072[_0x47c7('0x10')](_0x47c7('0x13'))||_0xe16072[_0x47c7('0x10')]('code')||_0xe16072[_0x47c7('0x10')](_0x47c7('0x14'))){var _0x45db70,_0x13e225;_0x45db70=_0xe16072[_0x47c7('0x11')];var _0xd722f4=_0x45db70['slice'](-0x1);if(_0xd722f4==='/'||_0xd722f4==='\x5c'||_0xd722f4===':'){_0x45db70=_0x45db70[_0x47c7('0x15')](0x0,_0x45db70[_0x47c7('0x16')](_0xd722f4));}switch(_0xe16072[_0x47c7('0x17')]){case'US':_0x13e225=_0x47c7('0x18');break;case'AU':_0x13e225=_0x47c7('0x19');break;case'IN':_0x13e225=_0x47c7('0x1a');break;case'CN':_0x13e225=_0x47c7('0x1b');break;default:_0x13e225=_0x47c7('0x1c');break;}var _0x52e2cd={'method':_0x47c7('0x1d'),'uri':_0x13e225+_0x47c7('0x1e'),'form':{'grant_type':_0x47c7('0x1f'),'client_id':_0xe16072[_0x47c7('0x12')],'client_secret':_0xe16072[_0x47c7('0x13')],'redirect_uri':_0xe16072[_0x47c7('0x11')],'code':_0xe16072[_0x47c7('0x20')]},'headers':{'Content-Type':_0x47c7('0x21')}};return rp(_0x52e2cd)[_0x47c7('0x22')](function(_0x526978){var _0x5dc9a0=JSON[_0x47c7('0x23')](_0x526978);if(_0x5dc9a0['refresh_token']){_0xe16072[_0x47c7('0x24')]=_0x5dc9a0[_0x47c7('0x25')];logger[_0x47c7('0x26')](util[_0x47c7('0x27')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0xe16072['name'],_0xe16072['id']));}else{logger[_0x47c7('0x28')](util['format'](_0x47c7('0x29'),_0xe16072[_0x47c7('0x2a')],_0xe16072['id']),util[_0x47c7('0x2b')](_0x5dc9a0,{'showHidden':![],'depth':null}));}return _0x45a8e3(null,_0x2c6053);})[_0x47c7('0x2c')](function(_0x9504ad){logger['error'](util[_0x47c7('0x27')](_0x47c7('0x29'),_0xe16072[_0x47c7('0x2a')],_0xe16072['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x45a8e3(_0x9504ad);});}else{return _0x45a8e3(null,_0x2c6053);}},'beforeUpdate':function(_0x5c40e3,_0x181662,_0x45e01b){if(_0x5c40e3['changed'](_0x47c7('0x17'))||_0x5c40e3[_0x47c7('0x10')](_0x47c7('0x11'))||_0x5c40e3[_0x47c7('0x10')]('clientId')||_0x5c40e3[_0x47c7('0x10')](_0x47c7('0x13'))||_0x5c40e3[_0x47c7('0x10')](_0x47c7('0x20'))||_0x5c40e3[_0x47c7('0x10')]('host')){var _0xfc138b,_0x527714;_0xfc138b=_0x5c40e3[_0x47c7('0x11')];var _0x233413=_0xfc138b['slice'](-0x1);if(_0x233413==='/'||_0x233413==='\x5c'||_0x233413===':'){_0xfc138b=_0xfc138b[_0x47c7('0x15')](0x0,_0xfc138b[_0x47c7('0x16')](_0x233413));}switch(_0x5c40e3[_0x47c7('0x17')]){case'US':_0x527714=_0x47c7('0x18');break;case'AU':_0x527714=_0x47c7('0x19');break;case'IN':_0x527714=_0x47c7('0x1a');break;case'CN':_0x527714=_0x47c7('0x1b');break;default:_0x527714=_0x47c7('0x1c');break;}var _0xfe4386={'method':'POST','uri':_0x527714+_0x47c7('0x1e'),'form':{'grant_type':'authorization_code','client_id':_0x5c40e3[_0x47c7('0x12')],'client_secret':_0x5c40e3[_0x47c7('0x13')],'redirect_uri':_0x5c40e3['serverUrl'],'code':_0x5c40e3[_0x47c7('0x20')]},'headers':{'Content-Type':_0x47c7('0x21')}};return rp(_0xfe4386)[_0x47c7('0x22')](function(_0x4411db){var _0x11637b=JSON[_0x47c7('0x23')](_0x4411db);if(_0x11637b[_0x47c7('0x25')]){_0x5c40e3[_0x47c7('0x24')]=_0x11637b['refresh_token'];logger[_0x47c7('0x26')](util[_0x47c7('0x27')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c40e3[_0x47c7('0x2a')],_0x5c40e3['id']));}else{logger[_0x47c7('0x28')](util[_0x47c7('0x27')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c40e3['name'],_0x5c40e3['id']),util[_0x47c7('0x2b')](_0x11637b,{'showHidden':![],'depth':null}));}return _0x45e01b(null,_0x181662);})['catch'](function(_0x124dbf){logger['error'](util[_0x47c7('0x27')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5c40e3['name'],_0x5c40e3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x45e01b(_0x124dbf);});}else{return _0x45e01b(null,_0x181662);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 6794bbc..939c46b 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 _0xd4ad=['client','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','include','map','model','attributes','debug','stringify','ShowZohoAccount','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x4d77ed,_0x2f69c4){var _0x2cc2ec=function(_0x26256b){while(--_0x26256b){_0x4d77ed['push'](_0x4d77ed['shift']());}};_0x2cc2ec(++_0x2f69c4);}(_0xd4ad,0x158));var _0xdd4a=function(_0x4a8f91,_0x462fa6){_0x4a8f91=_0x4a8f91-0x0;var _0x445b73=_0xd4ad[_0x4a8f91];return _0x445b73;};'use strict';var _=require(_0xdd4a('0x0'));var util=require(_0xdd4a('0x1'));var moment=require(_0xdd4a('0x2'));var BPromise=require(_0xdd4a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdd4a('0x4'));var db=require(_0xdd4a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd4a('0x6'));var config=require(_0xdd4a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdd4a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd243eb,_0xb14ae6,_0x5586dd){return new BPromise(function(_0x2dc5e1,_0x59d142){return client[_0xdd4a('0x9')](_0xd243eb,_0x5586dd)[_0xdd4a('0xa')](function(_0x42fa33){logger[_0xdd4a('0xb')](_0xdd4a('0xc'),_0xb14ae6,_0xdd4a('0xd'));logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0xb14ae6,_0xdd4a('0xd'),JSON['stringify'](_0x42fa33));if(_0x42fa33[_0xdd4a('0xe')]){if(_0x42fa33[_0xdd4a('0xe')]['code']===0x1f4){logger[_0xdd4a('0xe')](_0xdd4a('0xc'),_0xb14ae6,_0x42fa33['error'][_0xdd4a('0xf')]);return _0x59d142(_0x42fa33['error'][_0xdd4a('0xf')]);}logger['error'](_0xdd4a('0xc'),_0xb14ae6,_0x42fa33['error']['message']);return _0x2dc5e1(_0x42fa33[_0xdd4a('0xe')]['message']);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0xb14ae6,_0xdd4a('0xd'));_0x2dc5e1(_0x42fa33[_0xdd4a('0x10')][_0xdd4a('0xf')]);}})[_0xdd4a('0x11')](function(_0x37d755){logger[_0xdd4a('0xe')](_0xdd4a('0xc'),_0xb14ae6,_0x37d755);_0x59d142(_0x37d755);});});}exports[_0xdd4a('0x12')]=function(_0x4ffe09){var _0x3c3fdd=this;return new Promise(function(_0x9ef89d,_0x495750){return db[_0xdd4a('0x13')][_0xdd4a('0x14')]({'raw':_0x4ffe09['options']?_0x4ffe09[_0xdd4a('0x15')][_0xdd4a('0x16')]===undefined?!![]:![]:!![],'where':_0x4ffe09[_0xdd4a('0x15')]?_0x4ffe09[_0xdd4a('0x15')][_0xdd4a('0x17')]||null:null,'attributes':_0x4ffe09[_0xdd4a('0x15')]?_0x4ffe09[_0xdd4a('0x15')]['attributes']||null:null,'limit':_0x4ffe09['options']?_0x4ffe09['options']['limit']||null:null,'include':_0x4ffe09[_0xdd4a('0x15')]?_0x4ffe09[_0xdd4a('0x15')][_0xdd4a('0x18')]?_[_0xdd4a('0x19')](_0x4ffe09[_0xdd4a('0x15')]['include'],function(_0x166fc6){return{'model':db[_0x166fc6[_0xdd4a('0x1a')]],'as':_0x166fc6['as'],'attributes':_0x166fc6[_0xdd4a('0x1b')],'include':_0x166fc6[_0xdd4a('0x18')]?_['map'](_0x166fc6['include'],function(_0x5301ee){return{'model':db[_0x5301ee['model']],'as':_0x5301ee['as'],'attributes':_0x5301ee[_0xdd4a('0x1b')],'include':_0x5301ee['include']?_['map'](_0x5301ee[_0xdd4a('0x18')],function(_0x160ac1){return{'model':db[_0x160ac1[_0xdd4a('0x1a')]],'as':_0x160ac1['as'],'attributes':_0x160ac1[_0xdd4a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xdd4a('0xa')](function(_0x28e499){logger['info'](_0xdd4a('0x12'),_0x4ffe09);logger[_0xdd4a('0x1c')]('GetZohoAccount',_0x4ffe09,JSON[_0xdd4a('0x1d')](_0x28e499));_0x9ef89d(_0x28e499);})['catch'](function(_0x5f1a9e){logger[_0xdd4a('0xe')](_0xdd4a('0x12'),_0x5f1a9e[_0xdd4a('0xf')],_0x4ffe09);_0x495750(_0x3c3fdd['error'](0x1f4,_0x5f1a9e[_0xdd4a('0xf')]));});});};exports[_0xdd4a('0x1e')]=function(_0x292d67){var _0x4d02fd=this;return new Promise(function(_0x2b6d01,_0x4f9ef0){return db[_0xdd4a('0x13')][_0xdd4a('0x1f')]({'raw':_0x292d67[_0xdd4a('0x15')]?_0x292d67['options'][_0xdd4a('0x16')]===undefined?!![]:![]:!![],'where':_0x292d67[_0xdd4a('0x15')]?_0x292d67['options'][_0xdd4a('0x17')]||null:null,'attributes':_0x292d67[_0xdd4a('0x15')]?_0x292d67['options'][_0xdd4a('0x1b')]||null:null,'include':_0x292d67['options']?_0x292d67[_0xdd4a('0x15')][_0xdd4a('0x18')]?_[_0xdd4a('0x19')](_0x292d67[_0xdd4a('0x15')][_0xdd4a('0x18')],function(_0x53c183){return{'model':db[_0x53c183[_0xdd4a('0x1a')]],'as':_0x53c183['as'],'attributes':_0x53c183[_0xdd4a('0x1b')],'include':_0x53c183[_0xdd4a('0x18')]?_[_0xdd4a('0x19')](_0x53c183[_0xdd4a('0x18')],function(_0x5ecde8){return{'model':db[_0x5ecde8['model']],'as':_0x5ecde8['as'],'attributes':_0x5ecde8[_0xdd4a('0x1b')],'include':_0x5ecde8[_0xdd4a('0x18')]?_['map'](_0x5ecde8[_0xdd4a('0x18')],function(_0x4e9391){return{'model':db[_0x4e9391[_0xdd4a('0x1a')]],'as':_0x4e9391['as'],'attributes':_0x4e9391[_0xdd4a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x101ee6){logger[_0xdd4a('0xb')]('ShowZohoAccount',_0x292d67);logger[_0xdd4a('0x1c')]('ShowZohoAccount',_0x292d67,JSON['stringify'](_0x101ee6));_0x2b6d01(_0x101ee6);})[_0xdd4a('0x11')](function(_0x26cb9e){logger[_0xdd4a('0xe')](_0xdd4a('0x1e'),_0x26cb9e[_0xdd4a('0xf')],_0x292d67);_0x4f9ef0(_0x4d02fd[_0xdd4a('0xe')](0x1f4,_0x26cb9e[_0xdd4a('0xf')]));});});}; \ No newline at end of file +var _0xe558=['debug','ShowZohoAccount','ZohoAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ZohoAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','findAll','options','raw','where','limit','include','map','attributes','model','GetZohoAccount'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xe558,0x70));var _0x8e55=function(_0x10c673,_0x4a60c9){_0x10c673=_0x10c673-0x0;var _0x4f1b71=_0xe558[_0x10c673];return _0x4f1b71;};'use strict';var _=require(_0x8e55('0x0'));var util=require(_0x8e55('0x1'));var moment=require(_0x8e55('0x2'));var BPromise=require(_0x8e55('0x3'));var rs=require(_0x8e55('0x4'));var fs=require('fs');var Redis=require(_0x8e55('0x5'));var db=require(_0x8e55('0x6'))['db'];var utils=require(_0x8e55('0x7'));var logger=require(_0x8e55('0x8'))('rpc');var config=require(_0x8e55('0x9'));var jayson=require(_0x8e55('0xa'));var client=jayson[_0x8e55('0xb')][_0x8e55('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3cef42,_0x13c5db,_0x493307){return new BPromise(function(_0xe27f09,_0x429679){return client['request'](_0x3cef42,_0x493307)[_0x8e55('0xd')](function(_0x578110){logger['info'](_0x8e55('0xe'),_0x13c5db,'request\x20sent');logger['debug']('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x13c5db,_0x8e55('0xf'),JSON[_0x8e55('0x10')](_0x578110));if(_0x578110[_0x8e55('0x11')]){if(_0x578110[_0x8e55('0x11')]['code']===0x1f4){logger[_0x8e55('0x11')]('ZohoAccount,\x20%s,\x20%s',_0x13c5db,_0x578110['error']['message']);return _0x429679(_0x578110[_0x8e55('0x11')]['message']);}logger[_0x8e55('0x11')](_0x8e55('0xe'),_0x13c5db,_0x578110[_0x8e55('0x11')][_0x8e55('0x12')]);return _0xe27f09(_0x578110[_0x8e55('0x11')][_0x8e55('0x12')]);}else{logger[_0x8e55('0x13')](_0x8e55('0xe'),_0x13c5db,_0x8e55('0xf'));_0xe27f09(_0x578110[_0x8e55('0x14')][_0x8e55('0x12')]);}})[_0x8e55('0x15')](function(_0x202bc4){logger[_0x8e55('0x11')](_0x8e55('0xe'),_0x13c5db,_0x202bc4);_0x429679(_0x202bc4);});});}exports['GetZohoAccount']=function(_0xda8f1a){var _0x1e5d1f=this;return new Promise(function(_0x2d69e8,_0x3381c7){return db['ZohoAccount'][_0x8e55('0x16')]({'raw':_0xda8f1a[_0x8e55('0x17')]?_0xda8f1a[_0x8e55('0x17')][_0x8e55('0x18')]===undefined?!![]:![]:!![],'where':_0xda8f1a[_0x8e55('0x17')]?_0xda8f1a[_0x8e55('0x17')][_0x8e55('0x19')]||null:null,'attributes':_0xda8f1a[_0x8e55('0x17')]?_0xda8f1a['options']['attributes']||null:null,'limit':_0xda8f1a[_0x8e55('0x17')]?_0xda8f1a[_0x8e55('0x17')][_0x8e55('0x1a')]||null:null,'include':_0xda8f1a['options']?_0xda8f1a[_0x8e55('0x17')][_0x8e55('0x1b')]?_[_0x8e55('0x1c')](_0xda8f1a[_0x8e55('0x17')][_0x8e55('0x1b')],function(_0x25a8f3){return{'model':db[_0x25a8f3['model']],'as':_0x25a8f3['as'],'attributes':_0x25a8f3[_0x8e55('0x1d')],'include':_0x25a8f3[_0x8e55('0x1b')]?_['map'](_0x25a8f3[_0x8e55('0x1b')],function(_0x3f6fd8){return{'model':db[_0x3f6fd8[_0x8e55('0x1e')]],'as':_0x3f6fd8['as'],'attributes':_0x3f6fd8[_0x8e55('0x1d')],'include':_0x3f6fd8[_0x8e55('0x1b')]?_[_0x8e55('0x1c')](_0x3f6fd8[_0x8e55('0x1b')],function(_0x3b5d0f){return{'model':db[_0x3b5d0f[_0x8e55('0x1e')]],'as':_0x3b5d0f['as'],'attributes':_0x3b5d0f[_0x8e55('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8e55('0xd')](function(_0x5393e6){logger[_0x8e55('0x13')](_0x8e55('0x1f'),_0xda8f1a);logger[_0x8e55('0x20')](_0x8e55('0x1f'),_0xda8f1a,JSON['stringify'](_0x5393e6));_0x2d69e8(_0x5393e6);})[_0x8e55('0x15')](function(_0x4b96c9){logger[_0x8e55('0x11')](_0x8e55('0x1f'),_0x4b96c9['message'],_0xda8f1a);_0x3381c7(_0x1e5d1f[_0x8e55('0x11')](0x1f4,_0x4b96c9[_0x8e55('0x12')]));});});};exports[_0x8e55('0x21')]=function(_0x52b0d8){var _0x3a8c4d=this;return new Promise(function(_0x1228b3,_0x259d91){return db[_0x8e55('0x22')][_0x8e55('0x23')]({'raw':_0x52b0d8[_0x8e55('0x17')]?_0x52b0d8[_0x8e55('0x17')][_0x8e55('0x18')]===undefined?!![]:![]:!![],'where':_0x52b0d8['options']?_0x52b0d8['options']['where']||null:null,'attributes':_0x52b0d8[_0x8e55('0x17')]?_0x52b0d8[_0x8e55('0x17')][_0x8e55('0x1d')]||null:null,'include':_0x52b0d8['options']?_0x52b0d8[_0x8e55('0x17')]['include']?_['map'](_0x52b0d8[_0x8e55('0x17')][_0x8e55('0x1b')],function(_0x519a3f){return{'model':db[_0x519a3f[_0x8e55('0x1e')]],'as':_0x519a3f['as'],'attributes':_0x519a3f[_0x8e55('0x1d')],'include':_0x519a3f[_0x8e55('0x1b')]?_[_0x8e55('0x1c')](_0x519a3f[_0x8e55('0x1b')],function(_0x5f11f0){return{'model':db[_0x5f11f0[_0x8e55('0x1e')]],'as':_0x5f11f0['as'],'attributes':_0x5f11f0[_0x8e55('0x1d')],'include':_0x5f11f0[_0x8e55('0x1b')]?_[_0x8e55('0x1c')](_0x5f11f0['include'],function(_0x11c458){return{'model':db[_0x11c458[_0x8e55('0x1e')]],'as':_0x11c458['as'],'attributes':_0x11c458[_0x8e55('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17e3dc){logger[_0x8e55('0x13')](_0x8e55('0x21'),_0x52b0d8);logger[_0x8e55('0x20')](_0x8e55('0x21'),_0x52b0d8,JSON[_0x8e55('0x10')](_0x17e3dc));_0x1228b3(_0x17e3dc);})['catch'](function(_0x40f69d){logger[_0x8e55('0x11')](_0x8e55('0x21'),_0x40f69d[_0x8e55('0x12')],_0x52b0d8);_0x259d91(_0x3a8c4d[_0x8e55('0x11')](0x1f4,_0x40f69d[_0x8e55('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 1db6d0e..96c2cbf 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 _0xabca=['getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0xabca,0xfb));var _0xaabc=function(_0x3dc470,_0x24fec6){_0x3dc470=_0x3dc470-0x0;var _0x536a80=_0xabca[_0x3dc470];return _0x536a80;};'use strict';var multer=require(_0xaabc('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaabc('0x1'));var express=require(_0xaabc('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaabc('0x3'));var config=require(_0xaabc('0x4'));var controller=require(_0xaabc('0x5'));router[_0xaabc('0x6')]('/',auth[_0xaabc('0x7')](),controller['index']);router[_0xaabc('0x6')](_0xaabc('0x8'),auth[_0xaabc('0x7')](),controller[_0xaabc('0x9')]);router[_0xaabc('0x6')](_0xaabc('0xa'),auth[_0xaabc('0x7')](),controller[_0xaabc('0xb')]);router[_0xaabc('0x6')](_0xaabc('0xc'),auth[_0xaabc('0x7')](),controller[_0xaabc('0xd')]);router[_0xaabc('0x6')](_0xaabc('0xe'),auth['isAuthenticated'](),controller[_0xaabc('0xf')]);router[_0xaabc('0x10')]('/',auth[_0xaabc('0x7')](),controller[_0xaabc('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xaabc('0x12')]);router[_0xaabc('0x13')](_0xaabc('0x8'),auth[_0xaabc('0x7')](),controller[_0xaabc('0x14')]);module[_0xaabc('0x15')]=router; \ No newline at end of file +var _0xe22b=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','show','getFields','/:id/subjects','/:id/descriptions','create','put','update'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0xe22b,0xfe));var _0xbe22=function(_0x170b30,_0x9d842e){_0x170b30=_0x170b30-0x0;var _0x10a1dd=_0xe22b[_0x170b30];return _0x10a1dd;};'use strict';var multer=require(_0xbe22('0x0'));var util=require(_0xbe22('0x1'));var path=require(_0xbe22('0x2'));var timeout=require(_0xbe22('0x3'));var express=require('express');var router=express[_0xbe22('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xbe22('0x5'));var interaction=require(_0xbe22('0x6'));var config=require(_0xbe22('0x7'));var controller=require(_0xbe22('0x8'));router[_0xbe22('0x9')]('/',auth[_0xbe22('0xa')](),controller['index']);router[_0xbe22('0x9')](_0xbe22('0xb'),auth[_0xbe22('0xa')](),controller[_0xbe22('0xc')]);router[_0xbe22('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xbe22('0xd')]);router['get'](_0xbe22('0xe'),auth[_0xbe22('0xa')](),controller['getSubjects']);router['get'](_0xbe22('0xf'),auth[_0xbe22('0xa')](),controller['getDescriptions']);router['post']('/',auth[_0xbe22('0xa')](),controller[_0xbe22('0x10')]);router[_0xbe22('0x11')]('/:id',auth[_0xbe22('0xa')](),controller[_0xbe22('0x12')]);router['delete'](_0xbe22('0xb'),auth[_0xbe22('0xa')](),controller[_0xbe22('0x13')]);module[_0xbe22('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 4f11100..28d669a 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 _0x7b72=['contact_lead','sequelize','exports','STRING','lead','contact','nothing','ENUM'];(function(_0x547be7,_0x85232c){var _0x41a769=function(_0x3333ee){while(--_0x3333ee){_0x547be7['push'](_0x547be7['shift']());}};_0x41a769(++_0x85232c);}(_0x7b72,0xb9));var _0x27b7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b72[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x27b7('0x0'));module[_0x27b7('0x1')]={'name':{'type':Sequelize[_0x27b7('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x27b7('0x3'),_0x27b7('0x4'),_0x27b7('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x27b7('0x6')]('contact_lead',_0x27b7('0x4'),_0x27b7('0x3')),'defaultValue':_0x27b7('0x7')},'description':{'type':Sequelize[_0x27b7('0x2')]}}; \ No newline at end of file +var _0x4b0b=['contact','sequelize','exports','STRING','ENUM','lead','contact_lead'];(function(_0x3d9c1b,_0x18c512){var _0x12b4e3=function(_0x3a87a3){while(--_0x3a87a3){_0x3d9c1b['push'](_0x3d9c1b['shift']());}};_0x12b4e3(++_0x18c512);}(_0x4b0b,0x94));var _0xb4b0=function(_0x194810,_0x1417f8){_0x194810=_0x194810-0x0;var _0x58324a=_0x4b0b[_0x194810];return _0x58324a;};'use strict';var Sequelize=require(_0xb4b0('0x0'));module[_0xb4b0('0x1')]={'name':{'type':Sequelize[_0xb4b0('0x2')]},'moduleCreate':{'type':Sequelize[_0xb4b0('0x3')](_0xb4b0('0x4'),'contact','nothing'),'defaultValue':_0xb4b0('0x4')},'moduleSearch':{'type':Sequelize[_0xb4b0('0x3')](_0xb4b0('0x5'),_0xb4b0('0x6'),_0xb4b0('0x4')),'defaultValue':_0xb4b0('0x5')},'description':{'type':Sequelize[_0xb4b0('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index d29cb11..f8702d8 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 _0x5e88=['squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','Content-Range','apply','save','then','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','catch','show','params','intersection','fields','include','options','create','body','update','find','getFields','ZohoField','getSubjects','getDescriptions','findOne','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs'];(function(_0x3989fd,_0xe5fc6c){var _0x316fd2=function(_0x2d8684){while(--_0x2d8684){_0x3989fd['push'](_0x3989fd['shift']());}};_0x316fd2(++_0xe5fc6c);}(_0x5e88,0xd7));var _0x85e8=function(_0x404f07,_0x594ed1){_0x404f07=_0x404f07-0x0;var _0x524b34=_0x5e88[_0x404f07];return _0x524b34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x85e8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x85e8('0x1'));var rp=require(_0x85e8('0x2'));var moment=require(_0x85e8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x85e8('0x4'));var util=require(_0x85e8('0x5'));var path=require(_0x85e8('0x6'));var sox=require(_0x85e8('0x7'));var csv=require(_0x85e8('0x8'));var ejs=require(_0x85e8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x85e8('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x85e8('0xb'));var toCsv=require(_0x85e8('0x8'));var querystring=require(_0x85e8('0xc'));var Papa=require(_0x85e8('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x85e8('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x85e8('0xf'));var logger=require(_0x85e8('0x10'))(_0x85e8('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x85e8('0x12'));var db=require(_0x85e8('0x13'))['db'];function respondWithStatusCode(_0x4e4b69,_0x456def){_0x456def=_0x456def||0xcc;return function(_0x10e5e3){if(_0x10e5e3){return _0x4e4b69[_0x85e8('0x14')](_0x456def);}return _0x4e4b69['status'](_0x456def)[_0x85e8('0x15')]();};}function respondWithResult(_0xafb43,_0x3c7f1c){_0x3c7f1c=_0x3c7f1c||0xc8;return function(_0x4b6726){if(_0x4b6726){return _0xafb43['status'](_0x3c7f1c)[_0x85e8('0x16')](_0x4b6726);}};}function respondWithFilteredResult(_0x292545,_0x3427dd){return function(_0x504f78){if(_0x504f78){var _0x1bad6a=typeof _0x3427dd['offset']===_0x85e8('0x17')&&typeof _0x3427dd[_0x85e8('0x18')]===_0x85e8('0x17');var _0x32dade=_0x504f78[_0x85e8('0x19')];var _0x42f843=_0x1bad6a?0x0:_0x3427dd[_0x85e8('0x1a')];var _0x1342eb=_0x1bad6a?_0x504f78[_0x85e8('0x19')]:_0x3427dd['offset']+_0x3427dd['limit'];var _0x31c793;if(_0x1342eb>=_0x32dade){_0x1342eb=_0x32dade;_0x31c793=0xc8;}else{_0x31c793=0xce;}_0x292545[_0x85e8('0x1b')](_0x31c793);return _0x292545['set'](_0x85e8('0x1c'),_0x42f843+'-'+_0x1342eb+'/'+_0x32dade)[_0x85e8('0x16')](_0x504f78);}return null;};}function patchUpdates(_0x241165){return function(_0x3e9f48){try{jsonpatch[_0x85e8('0x1d')](_0x3e9f48,_0x241165,!![]);}catch(_0x3303e2){return BPromise['reject'](_0x3303e2);}return _0x3e9f48[_0x85e8('0x1e')]();};}function saveUpdates(_0x2f98ba,_0x1688a4){return function(_0x21abd9){if(_0x21abd9){return _0x21abd9['update'](_0x2f98ba)[_0x85e8('0x1f')](function(_0x4ce2ea){return _0x4ce2ea;});}return null;};}function removeEntity(_0x2bbef8,_0x1d6119){return function(_0x992bd5){if(_0x992bd5){return _0x992bd5['destroy']()['then'](function(){_0x2bbef8[_0x85e8('0x1b')](0xcc)[_0x85e8('0x15')]();});}};}function handleEntityNotFound(_0x2e1487,_0x31d47b){return function(_0x523eb3){if(!_0x523eb3){_0x2e1487[_0x85e8('0x14')](0x194);}return _0x523eb3;};}function handleError(_0x4df6c1,_0x1907f){_0x1907f=_0x1907f||0x1f4;return function(_0x24075b){logger[_0x85e8('0x20')](_0x24075b[_0x85e8('0x21')]);if(_0x24075b[_0x85e8('0x22')]){delete _0x24075b['name'];}_0x4df6c1[_0x85e8('0x1b')](_0x1907f)[_0x85e8('0x23')](_0x24075b);};}exports[_0x85e8('0x24')]=function(_0xa71dfe,_0x76ea39){var _0x23b4c6={},_0x520270={},_0x90960c={'count':0x0,'rows':[]};var _0x514be8=_[_0x85e8('0x25')](db[_0x85e8('0x26')][_0x85e8('0x27')],function(_0x2b296f){return{'name':_0x2b296f[_0x85e8('0x28')],'type':_0x2b296f[_0x85e8('0x29')][_0x85e8('0x2a')]};});_0x520270[_0x85e8('0x2b')]=_[_0x85e8('0x25')](_0x514be8,'name');_0x520270['query']=_[_0x85e8('0x2c')](_0xa71dfe[_0x85e8('0x2d')]);_0x520270[_0x85e8('0x2e')]=_['intersection'](_0x520270[_0x85e8('0x2b')],_0x520270[_0x85e8('0x2d')]);_0x23b4c6[_0x85e8('0x2f')]=_['intersection'](_0x520270[_0x85e8('0x2b')],qs['fields'](_0xa71dfe[_0x85e8('0x2d')]['fields']));_0x23b4c6['attributes']=_0x23b4c6[_0x85e8('0x2f')][_0x85e8('0x30')]?_0x23b4c6[_0x85e8('0x2f')]:_0x520270[_0x85e8('0x2b')];if(!_0xa71dfe['query'][_0x85e8('0x31')](_0x85e8('0x32'))){_0x23b4c6[_0x85e8('0x18')]=qs[_0x85e8('0x18')](_0xa71dfe[_0x85e8('0x2d')][_0x85e8('0x18')]);_0x23b4c6[_0x85e8('0x1a')]=qs[_0x85e8('0x1a')](_0xa71dfe[_0x85e8('0x2d')][_0x85e8('0x1a')]);}_0x23b4c6[_0x85e8('0x33')]=qs[_0x85e8('0x34')](_0xa71dfe[_0x85e8('0x2d')]['sort']);_0x23b4c6[_0x85e8('0x35')]=qs[_0x85e8('0x2e')](_[_0x85e8('0x36')](_0xa71dfe[_0x85e8('0x2d')],_0x520270[_0x85e8('0x2e')]),_0x514be8);if(_0xa71dfe[_0x85e8('0x2d')][_0x85e8('0x37')]){_0x23b4c6[_0x85e8('0x35')]=_[_0x85e8('0x38')](_0x23b4c6[_0x85e8('0x35')],{'$or':_[_0x85e8('0x25')](_0x514be8,function(_0x37d233){if(_0x37d233['type']!==_0x85e8('0x39')){var _0x160a3d={};_0x160a3d[_0x37d233[_0x85e8('0x22')]]={'$like':'%'+_0xa71dfe[_0x85e8('0x2d')][_0x85e8('0x37')]+'%'};return _0x160a3d;}})});}_0x23b4c6=_[_0x85e8('0x38')]({},_0x23b4c6,_0xa71dfe['options']);var _0x4f3be9={'where':_0x23b4c6[_0x85e8('0x35')]};return db[_0x85e8('0x26')][_0x85e8('0x19')](_0x4f3be9)['then'](function(_0x38e9e0){_0x90960c['count']=_0x38e9e0;if(_0xa71dfe[_0x85e8('0x2d')][_0x85e8('0x3a')]){_0x23b4c6['include']=[{'all':!![]}];}return db[_0x85e8('0x26')]['findAll'](_0x23b4c6);})['then'](function(_0x5a09eb){_0x90960c['rows']=_0x5a09eb;return _0x90960c;})['then'](respondWithFilteredResult(_0x76ea39,_0x23b4c6))[_0x85e8('0x3b')](handleError(_0x76ea39,null));};exports[_0x85e8('0x3c')]=function(_0x4ca9ea,_0xdacd0f){var _0x22c797={'raw':![],'where':{'id':_0x4ca9ea[_0x85e8('0x3d')]['id']}},_0x2dee06={};_0x2dee06[_0x85e8('0x2b')]=_[_0x85e8('0x2c')](db[_0x85e8('0x26')][_0x85e8('0x27')]);_0x2dee06[_0x85e8('0x2d')]=_[_0x85e8('0x2c')](_0x4ca9ea[_0x85e8('0x2d')]);_0x2dee06['filters']=_[_0x85e8('0x3e')](_0x2dee06[_0x85e8('0x2b')],_0x2dee06[_0x85e8('0x2d')]);_0x22c797['attributes']=_['intersection'](_0x2dee06[_0x85e8('0x2b')],qs[_0x85e8('0x3f')](_0x4ca9ea[_0x85e8('0x2d')]['fields']));_0x22c797[_0x85e8('0x2f')]=_0x22c797[_0x85e8('0x2f')][_0x85e8('0x30')]?_0x22c797[_0x85e8('0x2f')]:_0x2dee06[_0x85e8('0x2b')];if(_0x4ca9ea[_0x85e8('0x2d')][_0x85e8('0x3a')]){_0x22c797[_0x85e8('0x40')]=[{'all':!![]}];}_0x22c797=_[_0x85e8('0x38')]({},_0x22c797,_0x4ca9ea[_0x85e8('0x41')]);return db['ZohoConfiguration']['find'](_0x22c797)[_0x85e8('0x1f')](handleEntityNotFound(_0xdacd0f,null))[_0x85e8('0x1f')](respondWithResult(_0xdacd0f,null))[_0x85e8('0x3b')](handleError(_0xdacd0f,null));};exports['create']=function(_0x492f88,_0x4bad74){return db['ZohoConfiguration'][_0x85e8('0x42')](_0x492f88[_0x85e8('0x43')],{})[_0x85e8('0x1f')](respondWithResult(_0x4bad74,0xc9))[_0x85e8('0x3b')](handleError(_0x4bad74,null));};exports[_0x85e8('0x44')]=function(_0x101dd1,_0x49fb16){if(_0x101dd1[_0x85e8('0x43')]['id']){delete _0x101dd1[_0x85e8('0x43')]['id'];}return db['ZohoConfiguration'][_0x85e8('0x45')]({'where':{'id':_0x101dd1[_0x85e8('0x3d')]['id']}})[_0x85e8('0x1f')](handleEntityNotFound(_0x49fb16,null))['then'](saveUpdates(_0x101dd1[_0x85e8('0x43')],null))[_0x85e8('0x1f')](respondWithResult(_0x49fb16,null))[_0x85e8('0x3b')](handleError(_0x49fb16,null));};exports['destroy']=function(_0x2326a8,_0x51df90){return db[_0x85e8('0x26')][_0x85e8('0x45')]({'where':{'id':_0x2326a8[_0x85e8('0x3d')]['id']}})[_0x85e8('0x1f')](handleEntityNotFound(_0x51df90,null))[_0x85e8('0x1f')](removeEntity(_0x51df90,null))['catch'](handleError(_0x51df90,null));};exports[_0x85e8('0x46')]=function(_0x2bb3a8,_0x195f8a,_0x5d647b){var _0x295fa2={};var _0x3f12f9={};var _0x5546ca;var _0xf4ce9;return db[_0x85e8('0x26')]['findOne']({'where':{'id':_0x2bb3a8[_0x85e8('0x3d')]['id']}})['then'](handleEntityNotFound(_0x195f8a,null))[_0x85e8('0x1f')](function(_0x1fd55f){if(_0x1fd55f){_0x5546ca=_0x1fd55f;_0x3f12f9[_0x85e8('0x2b')]=_[_0x85e8('0x2c')](db[_0x85e8('0x47')][_0x85e8('0x27')]);_0x3f12f9[_0x85e8('0x2d')]=_[_0x85e8('0x2c')](_0x2bb3a8[_0x85e8('0x2d')]);_0x3f12f9[_0x85e8('0x2e')]=_[_0x85e8('0x3e')](_0x3f12f9[_0x85e8('0x2b')],_0x3f12f9['query']);_0x295fa2[_0x85e8('0x2f')]=_[_0x85e8('0x3e')](_0x3f12f9[_0x85e8('0x2b')],qs['fields'](_0x2bb3a8[_0x85e8('0x2d')]['fields']));_0x295fa2[_0x85e8('0x2f')]=_0x295fa2[_0x85e8('0x2f')][_0x85e8('0x30')]?_0x295fa2[_0x85e8('0x2f')]:_0x3f12f9['model'];_0x295fa2[_0x85e8('0x33')]=qs[_0x85e8('0x34')](_0x2bb3a8[_0x85e8('0x2d')][_0x85e8('0x34')]);_0x295fa2['where']=qs[_0x85e8('0x2e')](_[_0x85e8('0x36')](_0x2bb3a8[_0x85e8('0x2d')],_0x3f12f9['filters']));if(_0x2bb3a8['query']['filter']){_0x295fa2[_0x85e8('0x35')]=_[_0x85e8('0x38')](_0x295fa2[_0x85e8('0x35')],{'$or':_['map'](_0x295fa2[_0x85e8('0x2f')],function(_0xd76d23){var _0x10f847={};_0x10f847[_0xd76d23]={'$like':'%'+_0x2bb3a8[_0x85e8('0x2d')][_0x85e8('0x37')]+'%'};return _0x10f847;})});}_0x295fa2=_[_0x85e8('0x38')]({},_0x295fa2,_0x2bb3a8[_0x85e8('0x41')]);return _0x5546ca['getFields'](_0x295fa2);}})['then'](function(_0x225ed0){if(_0x225ed0){_0xf4ce9=_0x225ed0[_0x85e8('0x30')];if(!_0x2bb3a8[_0x85e8('0x2d')][_0x85e8('0x31')](_0x85e8('0x32'))){_0x295fa2[_0x85e8('0x18')]=qs['limit'](_0x2bb3a8[_0x85e8('0x2d')]['limit']);_0x295fa2[_0x85e8('0x1a')]=qs[_0x85e8('0x1a')](_0x2bb3a8[_0x85e8('0x2d')][_0x85e8('0x1a')]);}return _0x5546ca['getFields'](_0x295fa2);}})[_0x85e8('0x1f')](function(_0x3bed90){if(_0x3bed90){return _0x3bed90?{'count':_0xf4ce9,'rows':_0x3bed90}:null;}})['then'](respondWithResult(_0x195f8a,null))[_0x85e8('0x3b')](handleError(_0x195f8a,null));};exports[_0x85e8('0x48')]=function(_0x5b69d2,_0x14cd39,_0x424273){var _0xf1654b={};var _0x528b13={};var _0x2c8c7e;var _0x3ca0f8;return db[_0x85e8('0x26')]['findOne']({'where':{'id':_0x5b69d2[_0x85e8('0x3d')]['id']}})[_0x85e8('0x1f')](handleEntityNotFound(_0x14cd39,null))[_0x85e8('0x1f')](function(_0x44e25d){if(_0x44e25d){_0x2c8c7e=_0x44e25d;_0x528b13[_0x85e8('0x2b')]=_[_0x85e8('0x2c')](db[_0x85e8('0x47')]['rawAttributes']);_0x528b13[_0x85e8('0x2d')]=_[_0x85e8('0x2c')](_0x5b69d2[_0x85e8('0x2d')]);_0x528b13[_0x85e8('0x2e')]=_[_0x85e8('0x3e')](_0x528b13[_0x85e8('0x2b')],_0x528b13[_0x85e8('0x2d')]);_0xf1654b[_0x85e8('0x2f')]=_['intersection'](_0x528b13[_0x85e8('0x2b')],qs[_0x85e8('0x3f')](_0x5b69d2[_0x85e8('0x2d')]['fields']));_0xf1654b[_0x85e8('0x2f')]=_0xf1654b['attributes'][_0x85e8('0x30')]?_0xf1654b['attributes']:_0x528b13[_0x85e8('0x2b')];_0xf1654b[_0x85e8('0x33')]=qs[_0x85e8('0x34')](_0x5b69d2[_0x85e8('0x2d')][_0x85e8('0x34')]);_0xf1654b[_0x85e8('0x35')]=qs[_0x85e8('0x2e')](_[_0x85e8('0x36')](_0x5b69d2[_0x85e8('0x2d')],_0x528b13[_0x85e8('0x2e')]));if(_0x5b69d2['query'][_0x85e8('0x37')]){_0xf1654b[_0x85e8('0x35')]=_['merge'](_0xf1654b['where'],{'$or':_[_0x85e8('0x25')](_0xf1654b[_0x85e8('0x2f')],function(_0x1f8c24){var _0x120c56={};_0x120c56[_0x1f8c24]={'$like':'%'+_0x5b69d2[_0x85e8('0x2d')][_0x85e8('0x37')]+'%'};return _0x120c56;})});}_0xf1654b=_[_0x85e8('0x38')]({},_0xf1654b,_0x5b69d2[_0x85e8('0x41')]);return _0x2c8c7e[_0x85e8('0x48')](_0xf1654b);}})[_0x85e8('0x1f')](function(_0x37215b){if(_0x37215b){_0x3ca0f8=_0x37215b[_0x85e8('0x30')];if(!_0x5b69d2['query'][_0x85e8('0x31')](_0x85e8('0x32'))){_0xf1654b[_0x85e8('0x18')]=qs[_0x85e8('0x18')](_0x5b69d2[_0x85e8('0x2d')][_0x85e8('0x18')]);_0xf1654b[_0x85e8('0x1a')]=qs[_0x85e8('0x1a')](_0x5b69d2[_0x85e8('0x2d')]['offset']);}return _0x2c8c7e[_0x85e8('0x48')](_0xf1654b);}})[_0x85e8('0x1f')](function(_0x10b7bf){if(_0x10b7bf){return _0x10b7bf?{'count':_0x3ca0f8,'rows':_0x10b7bf}:null;}})[_0x85e8('0x1f')](respondWithResult(_0x14cd39,null))[_0x85e8('0x3b')](handleError(_0x14cd39,null));};exports[_0x85e8('0x49')]=function(_0x5d4c78,_0x3e621f,_0x1a23a1){var _0x21cf08={};var _0x5415c6={};var _0x3a9aad;var _0x193011;return db['ZohoConfiguration'][_0x85e8('0x4a')]({'where':{'id':_0x5d4c78[_0x85e8('0x3d')]['id']}})[_0x85e8('0x1f')](handleEntityNotFound(_0x3e621f,null))['then'](function(_0x40dcc1){if(_0x40dcc1){_0x3a9aad=_0x40dcc1;_0x5415c6[_0x85e8('0x2b')]=_[_0x85e8('0x2c')](db[_0x85e8('0x47')]['rawAttributes']);_0x5415c6[_0x85e8('0x2d')]=_[_0x85e8('0x2c')](_0x5d4c78[_0x85e8('0x2d')]);_0x5415c6[_0x85e8('0x2e')]=_[_0x85e8('0x3e')](_0x5415c6['model'],_0x5415c6[_0x85e8('0x2d')]);_0x21cf08[_0x85e8('0x2f')]=_['intersection'](_0x5415c6['model'],qs[_0x85e8('0x3f')](_0x5d4c78[_0x85e8('0x2d')][_0x85e8('0x3f')]));_0x21cf08[_0x85e8('0x2f')]=_0x21cf08[_0x85e8('0x2f')][_0x85e8('0x30')]?_0x21cf08[_0x85e8('0x2f')]:_0x5415c6['model'];_0x21cf08[_0x85e8('0x33')]=qs[_0x85e8('0x34')](_0x5d4c78[_0x85e8('0x2d')]['sort']);_0x21cf08['where']=qs[_0x85e8('0x2e')](_[_0x85e8('0x36')](_0x5d4c78[_0x85e8('0x2d')],_0x5415c6[_0x85e8('0x2e')]));if(_0x5d4c78[_0x85e8('0x2d')][_0x85e8('0x37')]){_0x21cf08[_0x85e8('0x35')]=_[_0x85e8('0x38')](_0x21cf08[_0x85e8('0x35')],{'$or':_[_0x85e8('0x25')](_0x21cf08[_0x85e8('0x2f')],function(_0x5e0170){var _0x514cad={};_0x514cad[_0x5e0170]={'$like':'%'+_0x5d4c78[_0x85e8('0x2d')][_0x85e8('0x37')]+'%'};return _0x514cad;})});}_0x21cf08=_['merge']({},_0x21cf08,_0x5d4c78[_0x85e8('0x41')]);return _0x3a9aad[_0x85e8('0x49')](_0x21cf08);}})[_0x85e8('0x1f')](function(_0x199166){if(_0x199166){_0x193011=_0x199166['length'];if(!_0x5d4c78[_0x85e8('0x2d')][_0x85e8('0x31')](_0x85e8('0x32'))){_0x21cf08[_0x85e8('0x18')]=qs[_0x85e8('0x18')](_0x5d4c78[_0x85e8('0x2d')]['limit']);_0x21cf08[_0x85e8('0x1a')]=qs[_0x85e8('0x1a')](_0x5d4c78['query']['offset']);}return _0x3a9aad[_0x85e8('0x49')](_0x21cf08);}})[_0x85e8('0x1f')](function(_0x2dffdf){if(_0x2dffdf){return _0x2dffdf?{'count':_0x193011,'rows':_0x2dffdf}:null;}})['then'](respondWithResult(_0x3e621f,null))['catch'](handleError(_0x3e621f,null));}; \ No newline at end of file +var _0x0041=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','find','findOne','getFields','getSubjects','ZohoField','getDescriptions','nolimit','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','index','map','ZohoConfiguration','fieldName','type','key'];(function(_0x47a12a,_0x70f591){var _0x30cd40=function(_0x46b68f){while(--_0x46b68f){_0x47a12a['push'](_0x47a12a['shift']());}};_0x30cd40(++_0x70f591);}(_0x0041,0x16e));var _0x1004=function(_0x239460,_0x316686){_0x239460=_0x239460-0x0;var _0x4ca7e5=_0x0041[_0x239460];return _0x4ca7e5;};'use strict';var emlformat=require(_0x1004('0x0'));var rimraf=require(_0x1004('0x1'));var zipdir=require(_0x1004('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1004('0x3'));var moment=require('moment');var BPromise=require(_0x1004('0x4'));var Mustache=require(_0x1004('0x5'));var util=require(_0x1004('0x6'));var path=require(_0x1004('0x7'));var sox=require(_0x1004('0x8'));var csv=require('to-csv');var ejs=require(_0x1004('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1004('0xa'));var crypto=require(_0x1004('0xb'));var jsforce=require(_0x1004('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x1004('0xd'));var querystring=require(_0x1004('0xe'));var Papa=require('papaparse');var Redis=require(_0x1004('0xf'));var authService=require(_0x1004('0x10'));var qs=require(_0x1004('0x11'));var as=require(_0x1004('0x12'));var hardwareService=require(_0x1004('0x13'));var logger=require(_0x1004('0x14'))(_0x1004('0x15'));var utils=require(_0x1004('0x16'));var config=require(_0x1004('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x1004('0x18'))['db'];function respondWithStatusCode(_0x58bbb1,_0x54846d){_0x54846d=_0x54846d||0xcc;return function(_0xdf6643){if(_0xdf6643){return _0x58bbb1['sendStatus'](_0x54846d);}return _0x58bbb1[_0x1004('0x19')](_0x54846d)[_0x1004('0x1a')]();};}function respondWithResult(_0x23ae06,_0x237881){_0x237881=_0x237881||0xc8;return function(_0x2d9aee){if(_0x2d9aee){return _0x23ae06[_0x1004('0x19')](_0x237881)[_0x1004('0x1b')](_0x2d9aee);}};}function respondWithFilteredResult(_0x4d3e83,_0x24778a){return function(_0x1960ae){if(_0x1960ae){var _0x26b4c7=typeof _0x24778a[_0x1004('0x1c')]===_0x1004('0x1d')&&typeof _0x24778a[_0x1004('0x1e')]==='undefined';var _0x1f07c5=_0x1960ae[_0x1004('0x1f')];var _0x25ac1b=_0x26b4c7?0x0:_0x24778a[_0x1004('0x1c')];var _0x5c16d1=_0x26b4c7?_0x1960ae[_0x1004('0x1f')]:_0x24778a[_0x1004('0x1c')]+_0x24778a[_0x1004('0x1e')];var _0x6786e3;if(_0x5c16d1>=_0x1f07c5){_0x5c16d1=_0x1f07c5;_0x6786e3=0xc8;}else{_0x6786e3=0xce;}_0x4d3e83['status'](_0x6786e3);return _0x4d3e83[_0x1004('0x20')](_0x1004('0x21'),_0x25ac1b+'-'+_0x5c16d1+'/'+_0x1f07c5)[_0x1004('0x1b')](_0x1960ae);}return null;};}function patchUpdates(_0x27b5b0){return function(_0x325209){try{jsonpatch[_0x1004('0x22')](_0x325209,_0x27b5b0,!![]);}catch(_0x3b4ee5){return BPromise[_0x1004('0x23')](_0x3b4ee5);}return _0x325209[_0x1004('0x24')]();};}function saveUpdates(_0x39ad89,_0x325ce8){return function(_0x38c633){if(_0x38c633){return _0x38c633[_0x1004('0x25')](_0x39ad89)['then'](function(_0x151559){return _0x151559;});}return null;};}function removeEntity(_0x47c8b7,_0x1f0701){return function(_0x14b33c){if(_0x14b33c){return _0x14b33c['destroy']()[_0x1004('0x26')](function(){_0x47c8b7[_0x1004('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x506460,_0x5c075b){return function(_0x55f3e8){if(!_0x55f3e8){_0x506460[_0x1004('0x27')](0x194);}return _0x55f3e8;};}function handleError(_0x4b525a,_0x540238){_0x540238=_0x540238||0x1f4;return function(_0x204db8){logger[_0x1004('0x28')](_0x204db8[_0x1004('0x29')]);if(_0x204db8[_0x1004('0x2a')]){delete _0x204db8[_0x1004('0x2a')];}_0x4b525a['status'](_0x540238)['send'](_0x204db8);};}exports[_0x1004('0x2b')]=function(_0x44708c,_0x1a71d2){var _0x59664d={},_0x3635cd={},_0x39d992={'count':0x0,'rows':[]};var _0x3548f4=_[_0x1004('0x2c')](db[_0x1004('0x2d')]['rawAttributes'],function(_0x28ed14){return{'name':_0x28ed14[_0x1004('0x2e')],'type':_0x28ed14[_0x1004('0x2f')][_0x1004('0x30')]};});_0x3635cd[_0x1004('0x31')]=_[_0x1004('0x2c')](_0x3548f4,_0x1004('0x2a'));_0x3635cd[_0x1004('0x32')]=_[_0x1004('0x33')](_0x44708c[_0x1004('0x32')]);_0x3635cd[_0x1004('0x34')]=_['intersection'](_0x3635cd[_0x1004('0x31')],_0x3635cd[_0x1004('0x32')]);_0x59664d[_0x1004('0x35')]=_[_0x1004('0x36')](_0x3635cd[_0x1004('0x31')],qs[_0x1004('0x37')](_0x44708c['query'][_0x1004('0x37')]));_0x59664d[_0x1004('0x35')]=_0x59664d[_0x1004('0x35')][_0x1004('0x38')]?_0x59664d[_0x1004('0x35')]:_0x3635cd[_0x1004('0x31')];if(!_0x44708c['query'][_0x1004('0x39')]('nolimit')){_0x59664d[_0x1004('0x1e')]=qs[_0x1004('0x1e')](_0x44708c[_0x1004('0x32')][_0x1004('0x1e')]);_0x59664d[_0x1004('0x1c')]=qs[_0x1004('0x1c')](_0x44708c['query']['offset']);}_0x59664d[_0x1004('0x3a')]=qs[_0x1004('0x3b')](_0x44708c[_0x1004('0x32')][_0x1004('0x3b')]);_0x59664d['where']=qs[_0x1004('0x34')](_[_0x1004('0x3c')](_0x44708c['query'],_0x3635cd['filters']),_0x3548f4);if(_0x44708c[_0x1004('0x32')][_0x1004('0x3d')]){_0x59664d[_0x1004('0x3e')]=_[_0x1004('0x3f')](_0x59664d[_0x1004('0x3e')],{'$or':_[_0x1004('0x2c')](_0x3548f4,function(_0x3a2d68){if(_0x3a2d68[_0x1004('0x2f')]!==_0x1004('0x40')){var _0x1c2d3e={};_0x1c2d3e[_0x3a2d68['name']]={'$like':'%'+_0x44708c[_0x1004('0x32')][_0x1004('0x3d')]+'%'};return _0x1c2d3e;}})});}_0x59664d=_[_0x1004('0x3f')]({},_0x59664d,_0x44708c[_0x1004('0x41')]);var _0x546380={'where':_0x59664d[_0x1004('0x3e')]};return db[_0x1004('0x2d')][_0x1004('0x1f')](_0x546380)[_0x1004('0x26')](function(_0x126c8d){_0x39d992[_0x1004('0x1f')]=_0x126c8d;if(_0x44708c[_0x1004('0x32')][_0x1004('0x42')]){_0x59664d[_0x1004('0x43')]=[{'all':!![]}];}return db[_0x1004('0x2d')][_0x1004('0x44')](_0x59664d);})[_0x1004('0x26')](function(_0x5a5044){_0x39d992[_0x1004('0x45')]=_0x5a5044;return _0x39d992;})[_0x1004('0x26')](respondWithFilteredResult(_0x1a71d2,_0x59664d))['catch'](handleError(_0x1a71d2,null));};exports[_0x1004('0x46')]=function(_0x50950f,_0x323061){var _0x369bfe={'raw':![],'where':{'id':_0x50950f[_0x1004('0x47')]['id']}},_0x520bc2={};_0x520bc2[_0x1004('0x31')]=_['keys'](db[_0x1004('0x2d')][_0x1004('0x48')]);_0x520bc2[_0x1004('0x32')]=_[_0x1004('0x33')](_0x50950f[_0x1004('0x32')]);_0x520bc2[_0x1004('0x34')]=_[_0x1004('0x36')](_0x520bc2[_0x1004('0x31')],_0x520bc2[_0x1004('0x32')]);_0x369bfe[_0x1004('0x35')]=_[_0x1004('0x36')](_0x520bc2['model'],qs[_0x1004('0x37')](_0x50950f[_0x1004('0x32')]['fields']));_0x369bfe[_0x1004('0x35')]=_0x369bfe[_0x1004('0x35')][_0x1004('0x38')]?_0x369bfe[_0x1004('0x35')]:_0x520bc2[_0x1004('0x31')];if(_0x50950f[_0x1004('0x32')][_0x1004('0x42')]){_0x369bfe[_0x1004('0x43')]=[{'all':!![]}];}_0x369bfe=_[_0x1004('0x3f')]({},_0x369bfe,_0x50950f[_0x1004('0x41')]);return db[_0x1004('0x2d')]['find'](_0x369bfe)['then'](handleEntityNotFound(_0x323061,null))[_0x1004('0x26')](respondWithResult(_0x323061,null))[_0x1004('0x49')](handleError(_0x323061,null));};exports[_0x1004('0x4a')]=function(_0x405bc3,_0x1cdbaa){return db[_0x1004('0x2d')]['create'](_0x405bc3[_0x1004('0x4b')],{})[_0x1004('0x26')](respondWithResult(_0x1cdbaa,0xc9))[_0x1004('0x49')](handleError(_0x1cdbaa,null));};exports['update']=function(_0x2d8ea7,_0x53d666){if(_0x2d8ea7[_0x1004('0x4b')]['id']){delete _0x2d8ea7['body']['id'];}return db[_0x1004('0x2d')]['find']({'where':{'id':_0x2d8ea7[_0x1004('0x47')]['id']}})[_0x1004('0x26')](handleEntityNotFound(_0x53d666,null))[_0x1004('0x26')](saveUpdates(_0x2d8ea7[_0x1004('0x4b')],null))[_0x1004('0x26')](respondWithResult(_0x53d666,null))[_0x1004('0x49')](handleError(_0x53d666,null));};exports['destroy']=function(_0x16245c,_0x277327){return db[_0x1004('0x2d')][_0x1004('0x4c')]({'where':{'id':_0x16245c[_0x1004('0x47')]['id']}})['then'](handleEntityNotFound(_0x277327,null))[_0x1004('0x26')](removeEntity(_0x277327,null))[_0x1004('0x49')](handleError(_0x277327,null));};exports['getFields']=function(_0x3786df,_0x1d70d7,_0x49bb2d){var _0x138b15={};var _0x4e86a4={};var _0x484922;var _0x41dc6b;return db['ZohoConfiguration'][_0x1004('0x4d')]({'where':{'id':_0x3786df[_0x1004('0x47')]['id']}})['then'](handleEntityNotFound(_0x1d70d7,null))[_0x1004('0x26')](function(_0x5d6bb1){if(_0x5d6bb1){_0x484922=_0x5d6bb1;_0x4e86a4['model']=_['keys'](db['ZohoField'][_0x1004('0x48')]);_0x4e86a4['query']=_[_0x1004('0x33')](_0x3786df[_0x1004('0x32')]);_0x4e86a4[_0x1004('0x34')]=_[_0x1004('0x36')](_0x4e86a4[_0x1004('0x31')],_0x4e86a4[_0x1004('0x32')]);_0x138b15[_0x1004('0x35')]=_['intersection'](_0x4e86a4['model'],qs[_0x1004('0x37')](_0x3786df[_0x1004('0x32')]['fields']));_0x138b15[_0x1004('0x35')]=_0x138b15[_0x1004('0x35')]['length']?_0x138b15[_0x1004('0x35')]:_0x4e86a4[_0x1004('0x31')];_0x138b15[_0x1004('0x3a')]=qs[_0x1004('0x3b')](_0x3786df['query'][_0x1004('0x3b')]);_0x138b15[_0x1004('0x3e')]=qs[_0x1004('0x34')](_[_0x1004('0x3c')](_0x3786df[_0x1004('0x32')],_0x4e86a4[_0x1004('0x34')]));if(_0x3786df['query'][_0x1004('0x3d')]){_0x138b15['where']=_['merge'](_0x138b15[_0x1004('0x3e')],{'$or':_[_0x1004('0x2c')](_0x138b15[_0x1004('0x35')],function(_0x219c8a){var _0x1a3580={};_0x1a3580[_0x219c8a]={'$like':'%'+_0x3786df['query']['filter']+'%'};return _0x1a3580;})});}_0x138b15=_['merge']({},_0x138b15,_0x3786df[_0x1004('0x41')]);return _0x484922[_0x1004('0x4e')](_0x138b15);}})[_0x1004('0x26')](function(_0xd25eaf){if(_0xd25eaf){_0x41dc6b=_0xd25eaf[_0x1004('0x38')];if(!_0x3786df[_0x1004('0x32')][_0x1004('0x39')]('nolimit')){_0x138b15[_0x1004('0x1e')]=qs[_0x1004('0x1e')](_0x3786df['query'][_0x1004('0x1e')]);_0x138b15[_0x1004('0x1c')]=qs['offset'](_0x3786df['query'][_0x1004('0x1c')]);}return _0x484922[_0x1004('0x4e')](_0x138b15);}})[_0x1004('0x26')](function(_0x513a48){if(_0x513a48){return _0x513a48?{'count':_0x41dc6b,'rows':_0x513a48}:null;}})['then'](respondWithResult(_0x1d70d7,null))[_0x1004('0x49')](handleError(_0x1d70d7,null));};exports[_0x1004('0x4f')]=function(_0x12ee36,_0x52e814,_0x3cb88c){var _0xf5b427={};var _0x1b5b37={};var _0x503b76;var _0x48dc02;return db[_0x1004('0x2d')][_0x1004('0x4d')]({'where':{'id':_0x12ee36['params']['id']}})[_0x1004('0x26')](handleEntityNotFound(_0x52e814,null))[_0x1004('0x26')](function(_0x143a4f){if(_0x143a4f){_0x503b76=_0x143a4f;_0x1b5b37['model']=_['keys'](db[_0x1004('0x50')]['rawAttributes']);_0x1b5b37[_0x1004('0x32')]=_[_0x1004('0x33')](_0x12ee36[_0x1004('0x32')]);_0x1b5b37['filters']=_[_0x1004('0x36')](_0x1b5b37[_0x1004('0x31')],_0x1b5b37['query']);_0xf5b427['attributes']=_[_0x1004('0x36')](_0x1b5b37['model'],qs[_0x1004('0x37')](_0x12ee36['query']['fields']));_0xf5b427[_0x1004('0x35')]=_0xf5b427[_0x1004('0x35')][_0x1004('0x38')]?_0xf5b427[_0x1004('0x35')]:_0x1b5b37[_0x1004('0x31')];_0xf5b427[_0x1004('0x3a')]=qs['sort'](_0x12ee36[_0x1004('0x32')][_0x1004('0x3b')]);_0xf5b427[_0x1004('0x3e')]=qs['filters'](_[_0x1004('0x3c')](_0x12ee36[_0x1004('0x32')],_0x1b5b37[_0x1004('0x34')]));if(_0x12ee36[_0x1004('0x32')][_0x1004('0x3d')]){_0xf5b427[_0x1004('0x3e')]=_['merge'](_0xf5b427[_0x1004('0x3e')],{'$or':_[_0x1004('0x2c')](_0xf5b427['attributes'],function(_0xc80aa3){var _0x4c7267={};_0x4c7267[_0xc80aa3]={'$like':'%'+_0x12ee36[_0x1004('0x32')][_0x1004('0x3d')]+'%'};return _0x4c7267;})});}_0xf5b427=_[_0x1004('0x3f')]({},_0xf5b427,_0x12ee36[_0x1004('0x41')]);return _0x503b76['getSubjects'](_0xf5b427);}})[_0x1004('0x26')](function(_0x5ab736){if(_0x5ab736){_0x48dc02=_0x5ab736['length'];if(!_0x12ee36[_0x1004('0x32')]['hasOwnProperty']('nolimit')){_0xf5b427['limit']=qs['limit'](_0x12ee36[_0x1004('0x32')][_0x1004('0x1e')]);_0xf5b427[_0x1004('0x1c')]=qs[_0x1004('0x1c')](_0x12ee36[_0x1004('0x32')][_0x1004('0x1c')]);}return _0x503b76[_0x1004('0x4f')](_0xf5b427);}})[_0x1004('0x26')](function(_0x52430a){if(_0x52430a){return _0x52430a?{'count':_0x48dc02,'rows':_0x52430a}:null;}})[_0x1004('0x26')](respondWithResult(_0x52e814,null))['catch'](handleError(_0x52e814,null));};exports[_0x1004('0x51')]=function(_0x850f0d,_0x1570f5,_0x319d45){var _0x431009={};var _0x52418d={};var _0x3a96c7;var _0xa2d3c5;return db[_0x1004('0x2d')][_0x1004('0x4d')]({'where':{'id':_0x850f0d['params']['id']}})[_0x1004('0x26')](handleEntityNotFound(_0x1570f5,null))['then'](function(_0xb37232){if(_0xb37232){_0x3a96c7=_0xb37232;_0x52418d[_0x1004('0x31')]=_[_0x1004('0x33')](db['ZohoField'][_0x1004('0x48')]);_0x52418d[_0x1004('0x32')]=_['keys'](_0x850f0d[_0x1004('0x32')]);_0x52418d[_0x1004('0x34')]=_[_0x1004('0x36')](_0x52418d[_0x1004('0x31')],_0x52418d[_0x1004('0x32')]);_0x431009['attributes']=_[_0x1004('0x36')](_0x52418d[_0x1004('0x31')],qs[_0x1004('0x37')](_0x850f0d[_0x1004('0x32')][_0x1004('0x37')]));_0x431009[_0x1004('0x35')]=_0x431009[_0x1004('0x35')][_0x1004('0x38')]?_0x431009[_0x1004('0x35')]:_0x52418d[_0x1004('0x31')];_0x431009[_0x1004('0x3a')]=qs[_0x1004('0x3b')](_0x850f0d['query'][_0x1004('0x3b')]);_0x431009[_0x1004('0x3e')]=qs[_0x1004('0x34')](_[_0x1004('0x3c')](_0x850f0d['query'],_0x52418d[_0x1004('0x34')]));if(_0x850f0d['query'][_0x1004('0x3d')]){_0x431009['where']=_[_0x1004('0x3f')](_0x431009[_0x1004('0x3e')],{'$or':_['map'](_0x431009[_0x1004('0x35')],function(_0x4f823f){var _0x65c96a={};_0x65c96a[_0x4f823f]={'$like':'%'+_0x850f0d[_0x1004('0x32')]['filter']+'%'};return _0x65c96a;})});}_0x431009=_[_0x1004('0x3f')]({},_0x431009,_0x850f0d[_0x1004('0x41')]);return _0x3a96c7['getDescriptions'](_0x431009);}})[_0x1004('0x26')](function(_0x15ba20){if(_0x15ba20){_0xa2d3c5=_0x15ba20[_0x1004('0x38')];if(!_0x850f0d[_0x1004('0x32')][_0x1004('0x39')](_0x1004('0x52'))){_0x431009['limit']=qs['limit'](_0x850f0d[_0x1004('0x32')][_0x1004('0x1e')]);_0x431009[_0x1004('0x1c')]=qs[_0x1004('0x1c')](_0x850f0d[_0x1004('0x32')][_0x1004('0x1c')]);}return _0x3a96c7['getDescriptions'](_0x431009);}})[_0x1004('0x26')](function(_0x3ed1ff){if(_0x3ed1ff){return _0x3ed1ff?{'count':_0xa2d3c5,'rows':_0x3ed1ff}:null;}})['then'](respondWithResult(_0x1570f5,null))[_0x1004('0x49')](handleError(_0x1570f5,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 39c1cda..e2d44c4 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 _0x53b3=['request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xce8499,_0x45702a){var _0x3a2037=function(_0x4c1222){while(--_0x4c1222){_0xce8499['push'](_0xce8499['shift']());}};_0x3a2037(++_0x45702a);}(_0x53b3,0x6a));var _0x353b=function(_0x4cde9e,_0x57150a){_0x4cde9e=_0x4cde9e-0x0;var _0x38df0c=_0x53b3[_0x4cde9e];return _0x38df0c;};'use strict';var _=require(_0x353b('0x0'));var util=require(_0x353b('0x1'));var logger=require(_0x353b('0x2'))(_0x353b('0x3'));var moment=require(_0x353b('0x4'));var BPromise=require(_0x353b('0x5'));var rp=require(_0x353b('0x6'));var fs=require('fs');var path=require(_0x353b('0x7'));var rimraf=require('rimraf');var config=require(_0x353b('0x8'));var attributes=require(_0x353b('0x9'));module[_0x353b('0xa')]=function(_0x2230fc,_0x502f7f){return _0x2230fc[_0x353b('0xb')](_0x353b('0xc'),attributes,{'tableName':_0x353b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb37f=['int_zoho_configurations','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','ZohoConfiguration'];(function(_0x4f66f8,_0x25a921){var _0x43006e=function(_0x69dce5){while(--_0x69dce5){_0x4f66f8['push'](_0x4f66f8['shift']());}};_0x43006e(++_0x25a921);}(_0xb37f,0x6f));var _0xfb37=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0xb37f[_0x25e7cb];return _0x375d92;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfb37('0x0'))('api');var moment=require(_0xfb37('0x1'));var BPromise=require(_0xfb37('0x2'));var rp=require(_0xfb37('0x3'));var fs=require('fs');var path=require(_0xfb37('0x4'));var rimraf=require('rimraf');var config=require(_0xfb37('0x5'));var attributes=require(_0xfb37('0x6'));module[_0xfb37('0x7')]=function(_0x1bf1f7,_0x1f1c2e){return _0x1bf1f7['define'](_0xfb37('0x8'),attributes,{'tableName':_0xfb37('0x9'),'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 110d2ca..661d278 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 _0x7c2e=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ZohoConfiguration,\x20%s,\x20%s','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x7c2e,0x16d));var _0xe7c2=function(_0x444dc3,_0x1c0002){_0x444dc3=_0x444dc3-0x0;var _0x326a24=_0x7c2e[_0x444dc3];return _0x326a24;};'use strict';var _=require('lodash');var util=require(_0xe7c2('0x0'));var moment=require(_0xe7c2('0x1'));var BPromise=require(_0xe7c2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe7c2('0x3'));var db=require(_0xe7c2('0x4'))['db'];var utils=require(_0xe7c2('0x5'));var logger=require(_0xe7c2('0x6'))(_0xe7c2('0x7'));var config=require('../../config/environment');var jayson=require(_0xe7c2('0x8'));var client=jayson[_0xe7c2('0x9')][_0xe7c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d1043,_0x4d0744,_0xf595b8){return new BPromise(function(_0x656cfc,_0x50e8e1){return client[_0xe7c2('0xb')](_0x4d1043,_0xf595b8)[_0xe7c2('0xc')](function(_0x48a1d2){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x4d0744,'request\x20sent');logger[_0xe7c2('0xd')](_0xe7c2('0xe'),_0x4d0744,_0xe7c2('0xf'),JSON[_0xe7c2('0x10')](_0x48a1d2));if(_0x48a1d2['error']){if(_0x48a1d2[_0xe7c2('0x11')]['code']===0x1f4){logger[_0xe7c2('0x11')](_0xe7c2('0x12'),_0x4d0744,_0x48a1d2[_0xe7c2('0x11')]['message']);return _0x50e8e1(_0x48a1d2[_0xe7c2('0x11')][_0xe7c2('0x13')]);}logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x4d0744,_0x48a1d2[_0xe7c2('0x11')][_0xe7c2('0x13')]);return _0x656cfc(_0x48a1d2[_0xe7c2('0x11')][_0xe7c2('0x13')]);}else{logger['info'](_0xe7c2('0x12'),_0x4d0744,'request\x20sent');_0x656cfc(_0x48a1d2['result'][_0xe7c2('0x13')]);}})[_0xe7c2('0x14')](function(_0xca4fc9){logger[_0xe7c2('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x4d0744,_0xca4fc9);_0x50e8e1(_0xca4fc9);});});} \ No newline at end of file +var _0xf4a6=['request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x73e4cf,_0x2a8375){var _0x1e1bf8=function(_0xca0967){while(--_0xca0967){_0x73e4cf['push'](_0x73e4cf['shift']());}};_0x1e1bf8(++_0x2a8375);}(_0xf4a6,0x7a));var _0x6f4a=function(_0x531f9f,_0x2e5609){_0x531f9f=_0x531f9f-0x0;var _0x37fbce=_0xf4a6[_0x531f9f];return _0x37fbce;};'use strict';var _=require(_0x6f4a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6f4a('0x1'));var fs=require('fs');var Redis=require(_0x6f4a('0x2'));var db=require(_0x6f4a('0x3'))['db'];var utils=require(_0x6f4a('0x4'));var logger=require(_0x6f4a('0x5'))(_0x6f4a('0x6'));var config=require(_0x6f4a('0x7'));var jayson=require(_0x6f4a('0x8'));var client=jayson['client'][_0x6f4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e982b,_0x188d19,_0x3a7d81){return new BPromise(function(_0x2bb0c6,_0x354081){return client[_0x6f4a('0xa')](_0x4e982b,_0x3a7d81)[_0x6f4a('0xb')](function(_0x31698d){logger[_0x6f4a('0xc')](_0x6f4a('0xd'),_0x188d19,_0x6f4a('0xe'));logger[_0x6f4a('0xf')](_0x6f4a('0x10'),_0x188d19,'request\x20sent',JSON[_0x6f4a('0x11')](_0x31698d));if(_0x31698d['error']){if(_0x31698d[_0x6f4a('0x12')][_0x6f4a('0x13')]===0x1f4){logger[_0x6f4a('0x12')](_0x6f4a('0xd'),_0x188d19,_0x31698d[_0x6f4a('0x12')][_0x6f4a('0x14')]);return _0x354081(_0x31698d[_0x6f4a('0x12')][_0x6f4a('0x14')]);}logger['error'](_0x6f4a('0xd'),_0x188d19,_0x31698d[_0x6f4a('0x12')][_0x6f4a('0x14')]);return _0x2bb0c6(_0x31698d[_0x6f4a('0x12')][_0x6f4a('0x14')]);}else{logger[_0x6f4a('0xc')](_0x6f4a('0xd'),_0x188d19,_0x6f4a('0xe'));_0x2bb0c6(_0x31698d[_0x6f4a('0x15')][_0x6f4a('0x14')]);}})['catch'](function(_0x1352eb){logger[_0x6f4a('0x12')](_0x6f4a('0xd'),_0x188d19,_0x1352eb);_0x354081(_0x1352eb);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 1da9506..dc6fae9 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 _0xd13e=['../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x505e6b,_0x1a71fe){var _0x3cfed4=function(_0x278073){while(--_0x278073){_0x505e6b['push'](_0x505e6b['shift']());}};_0x3cfed4(++_0x1a71fe);}(_0xd13e,0x115));var _0xed13=function(_0x438f93,_0x3378ce){_0x438f93=_0x438f93-0x0;var _0x141aee=_0xd13e[_0x438f93];return _0x141aee;};'use strict';var multer=require('multer');var util=require(_0xed13('0x0'));var path=require(_0xed13('0x1'));var timeout=require(_0xed13('0x2'));var express=require(_0xed13('0x3'));var router=express[_0xed13('0x4')]();var fs_extra=require(_0xed13('0x5'));var auth=require(_0xed13('0x6'));var interaction=require(_0xed13('0x7'));var config=require(_0xed13('0x8'));var controller=require(_0xed13('0x9'));router[_0xed13('0xa')]('/',auth['isAuthenticated'](),controller[_0xed13('0xb')]);router['get'](_0xed13('0xc'),auth[_0xed13('0xd')](),controller['show']);router['post']('/',auth[_0xed13('0xd')](),controller[_0xed13('0xe')]);router[_0xed13('0xf')]('/:id',auth[_0xed13('0xd')](),controller[_0xed13('0x10')]);router[_0xed13('0x11')](_0xed13('0xc'),auth['isAuthenticated'](),controller[_0xed13('0x12')]);module['exports']=router; \ No newline at end of file +var _0xdc3d=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','post','update','delete','destroy','exports','multer'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xdc3d,0x7d));var _0xddc3=function(_0x457eed,_0xabbbb6){_0x457eed=_0x457eed-0x0;var _0x22af7f=_0xdc3d[_0x457eed];return _0x22af7f;};'use strict';var multer=require(_0xddc3('0x0'));var util=require(_0xddc3('0x1'));var path=require('path');var timeout=require(_0xddc3('0x2'));var express=require(_0xddc3('0x3'));var router=express[_0xddc3('0x4')]();var fs_extra=require(_0xddc3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xddc3('0x6'));var config=require(_0xddc3('0x7'));var controller=require(_0xddc3('0x8'));router[_0xddc3('0x9')]('/',auth[_0xddc3('0xa')](),controller[_0xddc3('0xb')]);router[_0xddc3('0x9')](_0xddc3('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xddc3('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xddc3('0xc'),auth[_0xddc3('0xa')](),controller[_0xddc3('0xe')]);router[_0xddc3('0xf')](_0xddc3('0xc'),auth[_0xddc3('0xa')](),controller[_0xddc3('0x10')]);module[_0xddc3('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 4402ac5..a3d3af6 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 _0x0684=['string','customVariable','keyValue','STRING','ENUM','variable','BOOLEAN','sequelize','exports'];(function(_0x339180,_0x260b09){var _0x5bca60=function(_0x399c42){while(--_0x399c42){_0x339180['push'](_0x339180['shift']());}};_0x5bca60(++_0x260b09);}(_0x0684,0x178));var _0x4068=function(_0x1cb23f,_0x27fc29){_0x1cb23f=_0x1cb23f-0x0;var _0x5dafd4=_0x0684[_0x1cb23f];return _0x5dafd4;};'use strict';var Sequelize=require(_0x4068('0x0'));module[_0x4068('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4068('0x2'),'variable',_0x4068('0x3'),_0x4068('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x4068('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x4068('0x6')](_0x4068('0x2'),_0x4068('0x7'),_0x4068('0x3'))},'keyContent':{'type':Sequelize[_0x4068('0x5')]},'idField':{'type':Sequelize[_0x4068('0x5')]},'nameField':{'type':Sequelize[_0x4068('0x5')]},'customField':{'type':Sequelize[_0x4068('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4068('0x5')]}}; \ No newline at end of file +var _0x8e2a=['string','variable','keyValue','picklist','STRING','BOOLEAN','sequelize'];(function(_0x56186d,_0x5257fd){var _0x5e03d7=function(_0x2e6206){while(--_0x2e6206){_0x56186d['push'](_0x56186d['shift']());}};_0x5e03d7(++_0x5257fd);}(_0x8e2a,0x1f0));var _0xa8e2=function(_0x29e398,_0x134e25){_0x29e398=_0x29e398-0x0;var _0x521b8a=_0x8e2a[_0x29e398];return _0x521b8a;};'use strict';var Sequelize=require(_0xa8e2('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xa8e2('0x1'),_0xa8e2('0x2'),'customVariable',_0xa8e2('0x3'),_0xa8e2('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xa8e2('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xa8e2('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xa8e2('0x5')]},'idField':{'type':Sequelize[_0xa8e2('0x5')]},'nameField':{'type':Sequelize[_0xa8e2('0x5')]},'customField':{'type':Sequelize[_0xa8e2('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index ee67a8c..b18b6b2 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 _0xae77=['undefined','limit','count','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','ZohoField','fieldName','type','key','model','map','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','options','includeAll','include','findAll','params','keys','rawAttributes','fields','find','catch','create','update','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset'];(function(_0x39872b,_0x343e6b){var _0x55fa18=function(_0x217c7f){while(--_0x217c7f){_0x39872b['push'](_0x39872b['shift']());}};_0x55fa18(++_0x343e6b);}(_0xae77,0x15d));var _0x7ae7=function(_0x28fb14,_0xd76e33){_0x28fb14=_0x28fb14-0x0;var _0x91268d=_0xae77[_0x28fb14];return _0x91268d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7ae7('0x0'));var zipdir=require(_0x7ae7('0x1'));var jsonpatch=require(_0x7ae7('0x2'));var rp=require(_0x7ae7('0x3'));var moment=require('moment');var BPromise=require(_0x7ae7('0x4'));var Mustache=require(_0x7ae7('0x5'));var util=require(_0x7ae7('0x6'));var path=require(_0x7ae7('0x7'));var sox=require(_0x7ae7('0x8'));var csv=require(_0x7ae7('0x9'));var ejs=require(_0x7ae7('0xa'));var fs=require('fs');var fs_extra=require(_0x7ae7('0xb'));var _=require(_0x7ae7('0xc'));var squel=require('squel');var crypto=require(_0x7ae7('0xd'));var jsforce=require(_0x7ae7('0xe'));var deskjs=require(_0x7ae7('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7ae7('0x10'));var Papa=require(_0x7ae7('0x11'));var Redis=require('ioredis');var authService=require(_0x7ae7('0x12'));var qs=require(_0x7ae7('0x13'));var as=require(_0x7ae7('0x14'));var hardwareService=require(_0x7ae7('0x15'));var logger=require(_0x7ae7('0x16'))('api');var utils=require(_0x7ae7('0x17'));var config=require(_0x7ae7('0x18'));var licenseUtil=require(_0x7ae7('0x19'));var db=require(_0x7ae7('0x1a'))['db'];function respondWithStatusCode(_0x1514e6,_0x5defcc){_0x5defcc=_0x5defcc||0xcc;return function(_0x417c55){if(_0x417c55){return _0x1514e6[_0x7ae7('0x1b')](_0x5defcc);}return _0x1514e6['status'](_0x5defcc)[_0x7ae7('0x1c')]();};}function respondWithResult(_0x15db3a,_0x3814eb){_0x3814eb=_0x3814eb||0xc8;return function(_0x52a184){if(_0x52a184){return _0x15db3a['status'](_0x3814eb)[_0x7ae7('0x1d')](_0x52a184);}};}function respondWithFilteredResult(_0x51bd38,_0x47f2e1){return function(_0xeb1faf){if(_0xeb1faf){var _0x4c1585=typeof _0x47f2e1[_0x7ae7('0x1e')]===_0x7ae7('0x1f')&&typeof _0x47f2e1[_0x7ae7('0x20')]===_0x7ae7('0x1f');var _0x3c5330=_0xeb1faf[_0x7ae7('0x21')];var _0x1f4b88=_0x4c1585?0x0:_0x47f2e1[_0x7ae7('0x1e')];var _0x54e2db=_0x4c1585?_0xeb1faf[_0x7ae7('0x21')]:_0x47f2e1[_0x7ae7('0x1e')]+_0x47f2e1[_0x7ae7('0x20')];var _0xf53e9;if(_0x54e2db>=_0x3c5330){_0x54e2db=_0x3c5330;_0xf53e9=0xc8;}else{_0xf53e9=0xce;}_0x51bd38[_0x7ae7('0x22')](_0xf53e9);return _0x51bd38[_0x7ae7('0x23')](_0x7ae7('0x24'),_0x1f4b88+'-'+_0x54e2db+'/'+_0x3c5330)[_0x7ae7('0x1d')](_0xeb1faf);}return null;};}function patchUpdates(_0x1052b2){return function(_0xfea13a){try{jsonpatch[_0x7ae7('0x25')](_0xfea13a,_0x1052b2,!![]);}catch(_0x29d00b){return BPromise[_0x7ae7('0x26')](_0x29d00b);}return _0xfea13a[_0x7ae7('0x27')]();};}function saveUpdates(_0x26846d,_0x526092){return function(_0x13a5fd){if(_0x13a5fd){return _0x13a5fd['update'](_0x26846d)[_0x7ae7('0x28')](function(_0x3461f9){return _0x3461f9;});}return null;};}function removeEntity(_0x3ed9b6,_0x35a22e){return function(_0x385f56){if(_0x385f56){return _0x385f56[_0x7ae7('0x29')]()['then'](function(){_0x3ed9b6[_0x7ae7('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x179fca,_0x4c08f5){return function(_0x54aee0){if(!_0x54aee0){_0x179fca[_0x7ae7('0x1b')](0x194);}return _0x54aee0;};}function handleError(_0x14f5d4,_0x26b268){_0x26b268=_0x26b268||0x1f4;return function(_0xc83e06){logger[_0x7ae7('0x2a')](_0xc83e06[_0x7ae7('0x2b')]);if(_0xc83e06[_0x7ae7('0x2c')]){delete _0xc83e06[_0x7ae7('0x2c')];}_0x14f5d4[_0x7ae7('0x22')](_0x26b268)[_0x7ae7('0x2d')](_0xc83e06);};}exports['index']=function(_0x262112,_0x271f7c){var _0xa0760d={},_0xbbef32={},_0x5909ca={'count':0x0,'rows':[]};var _0x306de5=_['map'](db[_0x7ae7('0x2e')]['rawAttributes'],function(_0x47c041){return{'name':_0x47c041[_0x7ae7('0x2f')],'type':_0x47c041[_0x7ae7('0x30')][_0x7ae7('0x31')]};});_0xbbef32[_0x7ae7('0x32')]=_[_0x7ae7('0x33')](_0x306de5,_0x7ae7('0x2c'));_0xbbef32[_0x7ae7('0x34')]=_['keys'](_0x262112[_0x7ae7('0x34')]);_0xbbef32[_0x7ae7('0x35')]=_[_0x7ae7('0x36')](_0xbbef32[_0x7ae7('0x32')],_0xbbef32[_0x7ae7('0x34')]);_0xa0760d['attributes']=_['intersection'](_0xbbef32[_0x7ae7('0x32')],qs['fields'](_0x262112[_0x7ae7('0x34')]['fields']));_0xa0760d[_0x7ae7('0x37')]=_0xa0760d[_0x7ae7('0x37')]['length']?_0xa0760d[_0x7ae7('0x37')]:_0xbbef32[_0x7ae7('0x32')];if(!_0x262112[_0x7ae7('0x34')][_0x7ae7('0x38')](_0x7ae7('0x39'))){_0xa0760d[_0x7ae7('0x20')]=qs['limit'](_0x262112[_0x7ae7('0x34')]['limit']);_0xa0760d[_0x7ae7('0x1e')]=qs[_0x7ae7('0x1e')](_0x262112[_0x7ae7('0x34')][_0x7ae7('0x1e')]);}_0xa0760d[_0x7ae7('0x3a')]=qs[_0x7ae7('0x3b')](_0x262112[_0x7ae7('0x34')]['sort']);_0xa0760d['where']=qs[_0x7ae7('0x35')](_['pick'](_0x262112[_0x7ae7('0x34')],_0xbbef32[_0x7ae7('0x35')]),_0x306de5);if(_0x262112[_0x7ae7('0x34')][_0x7ae7('0x3c')]){_0xa0760d[_0x7ae7('0x3d')]=_['merge'](_0xa0760d[_0x7ae7('0x3d')],{'$or':_[_0x7ae7('0x33')](_0x306de5,function(_0x3effa8){if(_0x3effa8[_0x7ae7('0x30')]!==_0x7ae7('0x3e')){var _0x17b131={};_0x17b131[_0x3effa8[_0x7ae7('0x2c')]]={'$like':'%'+_0x262112[_0x7ae7('0x34')][_0x7ae7('0x3c')]+'%'};return _0x17b131;}})});}_0xa0760d=_['merge']({},_0xa0760d,_0x262112[_0x7ae7('0x3f')]);var _0x47b058={'where':_0xa0760d[_0x7ae7('0x3d')]};return db['ZohoField'][_0x7ae7('0x21')](_0x47b058)['then'](function(_0x404b87){_0x5909ca[_0x7ae7('0x21')]=_0x404b87;if(_0x262112[_0x7ae7('0x34')][_0x7ae7('0x40')]){_0xa0760d[_0x7ae7('0x41')]=[{'all':!![]}];}return db[_0x7ae7('0x2e')][_0x7ae7('0x42')](_0xa0760d);})[_0x7ae7('0x28')](function(_0x1a03aa){_0x5909ca['rows']=_0x1a03aa;return _0x5909ca;})[_0x7ae7('0x28')](respondWithFilteredResult(_0x271f7c,_0xa0760d))['catch'](handleError(_0x271f7c,null));};exports['show']=function(_0x27cd84,_0x105370){var _0x300a53={'raw':!![],'where':{'id':_0x27cd84[_0x7ae7('0x43')]['id']}},_0x24d013={};_0x24d013[_0x7ae7('0x32')]=_[_0x7ae7('0x44')](db[_0x7ae7('0x2e')][_0x7ae7('0x45')]);_0x24d013['query']=_[_0x7ae7('0x44')](_0x27cd84[_0x7ae7('0x34')]);_0x24d013[_0x7ae7('0x35')]=_['intersection'](_0x24d013[_0x7ae7('0x32')],_0x24d013['query']);_0x300a53[_0x7ae7('0x37')]=_['intersection'](_0x24d013[_0x7ae7('0x32')],qs['fields'](_0x27cd84['query'][_0x7ae7('0x46')]));_0x300a53['attributes']=_0x300a53[_0x7ae7('0x37')]['length']?_0x300a53['attributes']:_0x24d013['model'];if(_0x27cd84[_0x7ae7('0x34')][_0x7ae7('0x40')]){_0x300a53[_0x7ae7('0x41')]=[{'all':!![]}];}_0x300a53=_['merge']({},_0x300a53,_0x27cd84[_0x7ae7('0x3f')]);return db['ZohoField'][_0x7ae7('0x47')](_0x300a53)[_0x7ae7('0x28')](handleEntityNotFound(_0x105370,null))[_0x7ae7('0x28')](respondWithResult(_0x105370,null))[_0x7ae7('0x48')](handleError(_0x105370,null));};exports['create']=function(_0xea1a01,_0x16fcca){return db[_0x7ae7('0x2e')][_0x7ae7('0x49')](_0xea1a01['body'],{})['then'](respondWithResult(_0x16fcca,0xc9))[_0x7ae7('0x48')](handleError(_0x16fcca,null));};exports[_0x7ae7('0x4a')]=function(_0x22be0b,_0x5046f6){if(_0x22be0b[_0x7ae7('0x4b')]['id']){delete _0x22be0b['body']['id'];}return db[_0x7ae7('0x2e')][_0x7ae7('0x47')]({'where':{'id':_0x22be0b['params']['id']}})['then'](handleEntityNotFound(_0x5046f6,null))['then'](saveUpdates(_0x22be0b['body'],null))[_0x7ae7('0x28')](respondWithResult(_0x5046f6,null))[_0x7ae7('0x48')](handleError(_0x5046f6,null));};exports['destroy']=function(_0x4f8efb,_0x217ce2){return db[_0x7ae7('0x2e')][_0x7ae7('0x47')]({'where':{'id':_0x4f8efb[_0x7ae7('0x43')]['id']}})['then'](handleEntityNotFound(_0x217ce2,null))['then'](removeEntity(_0x217ce2,null))[_0x7ae7('0x48')](handleError(_0x217ce2,null));}; \ No newline at end of file +var _0xc738=['show','params','keys','intersection','merge','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','index','ZohoField','rawAttributes','fieldName','key','model','map','query','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','options','include','rows'];(function(_0x42e616,_0x33d424){var _0x5ba1c5=function(_0x29d451){while(--_0x29d451){_0x42e616['push'](_0x42e616['shift']());}};_0x5ba1c5(++_0x33d424);}(_0xc738,0x135));var _0x8c73=function(_0x6eb833,_0x2bb5e5){_0x6eb833=_0x6eb833-0x0;var _0xdfc38c=_0xc738[_0x6eb833];return _0xdfc38c;};'use strict';var emlformat=require(_0x8c73('0x0'));var rimraf=require(_0x8c73('0x1'));var zipdir=require(_0x8c73('0x2'));var jsonpatch=require(_0x8c73('0x3'));var rp=require(_0x8c73('0x4'));var moment=require(_0x8c73('0x5'));var BPromise=require(_0x8c73('0x6'));var Mustache=require('mustache');var util=require(_0x8c73('0x7'));var path=require('path');var sox=require(_0x8c73('0x8'));var csv=require(_0x8c73('0x9'));var ejs=require(_0x8c73('0xa'));var fs=require('fs');var fs_extra=require(_0x8c73('0xb'));var _=require('lodash');var squel=require(_0x8c73('0xc'));var crypto=require(_0x8c73('0xd'));var jsforce=require(_0x8c73('0xe'));var deskjs=require(_0x8c73('0xf'));var toCsv=require(_0x8c73('0x9'));var querystring=require(_0x8c73('0x10'));var Papa=require('papaparse');var Redis=require(_0x8c73('0x11'));var authService=require(_0x8c73('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8c73('0x13'));var hardwareService=require(_0x8c73('0x14'));var logger=require('../../config/logger')(_0x8c73('0x15'));var utils=require(_0x8c73('0x16'));var config=require(_0x8c73('0x17'));var licenseUtil=require(_0x8c73('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b08c9,_0x11a2b6){_0x11a2b6=_0x11a2b6||0xcc;return function(_0x2bf6ed){if(_0x2bf6ed){return _0x5b08c9[_0x8c73('0x19')](_0x11a2b6);}return _0x5b08c9[_0x8c73('0x1a')](_0x11a2b6)[_0x8c73('0x1b')]();};}function respondWithResult(_0x410e7c,_0x1186c0){_0x1186c0=_0x1186c0||0xc8;return function(_0x3884ca){if(_0x3884ca){return _0x410e7c[_0x8c73('0x1a')](_0x1186c0)[_0x8c73('0x1c')](_0x3884ca);}};}function respondWithFilteredResult(_0xddad0b,_0x5dffcc){return function(_0x5dfd8f){if(_0x5dfd8f){var _0x145d3c=typeof _0x5dffcc[_0x8c73('0x1d')]===_0x8c73('0x1e')&&typeof _0x5dffcc[_0x8c73('0x1f')]==='undefined';var _0x510e06=_0x5dfd8f[_0x8c73('0x20')];var _0x580f0a=_0x145d3c?0x0:_0x5dffcc['offset'];var _0x31ad6c=_0x145d3c?_0x5dfd8f[_0x8c73('0x20')]:_0x5dffcc[_0x8c73('0x1d')]+_0x5dffcc[_0x8c73('0x1f')];var _0xf98a63;if(_0x31ad6c>=_0x510e06){_0x31ad6c=_0x510e06;_0xf98a63=0xc8;}else{_0xf98a63=0xce;}_0xddad0b[_0x8c73('0x1a')](_0xf98a63);return _0xddad0b[_0x8c73('0x21')]('Content-Range',_0x580f0a+'-'+_0x31ad6c+'/'+_0x510e06)['json'](_0x5dfd8f);}return null;};}function patchUpdates(_0x4a7916){return function(_0x4ac5cd){try{jsonpatch[_0x8c73('0x22')](_0x4ac5cd,_0x4a7916,!![]);}catch(_0x47acb9){return BPromise[_0x8c73('0x23')](_0x47acb9);}return _0x4ac5cd[_0x8c73('0x24')]();};}function saveUpdates(_0x45323b,_0x18fcc7){return function(_0x3e7cd6){if(_0x3e7cd6){return _0x3e7cd6[_0x8c73('0x25')](_0x45323b)[_0x8c73('0x26')](function(_0x80664e){return _0x80664e;});}return null;};}function removeEntity(_0xe7d78d,_0xfb9015){return function(_0x13605e){if(_0x13605e){return _0x13605e[_0x8c73('0x27')]()[_0x8c73('0x26')](function(){_0xe7d78d[_0x8c73('0x1a')](0xcc)[_0x8c73('0x1b')]();});}};}function handleEntityNotFound(_0x2dba8c,_0x27281c){return function(_0x1e8958){if(!_0x1e8958){_0x2dba8c[_0x8c73('0x19')](0x194);}return _0x1e8958;};}function handleError(_0x1b4364,_0x66b031){_0x66b031=_0x66b031||0x1f4;return function(_0x1ffc0a){logger[_0x8c73('0x28')](_0x1ffc0a[_0x8c73('0x29')]);if(_0x1ffc0a[_0x8c73('0x2a')]){delete _0x1ffc0a['name'];}_0x1b4364[_0x8c73('0x1a')](_0x66b031)['send'](_0x1ffc0a);};}exports[_0x8c73('0x2b')]=function(_0x419be0,_0x1c38aa){var _0x501663={},_0x550ce8={},_0x3562b1={'count':0x0,'rows':[]};var _0x2e6730=_['map'](db[_0x8c73('0x2c')][_0x8c73('0x2d')],function(_0x472e67){return{'name':_0x472e67[_0x8c73('0x2e')],'type':_0x472e67['type'][_0x8c73('0x2f')]};});_0x550ce8[_0x8c73('0x30')]=_[_0x8c73('0x31')](_0x2e6730,'name');_0x550ce8[_0x8c73('0x32')]=_['keys'](_0x419be0[_0x8c73('0x32')]);_0x550ce8[_0x8c73('0x33')]=_['intersection'](_0x550ce8[_0x8c73('0x30')],_0x550ce8[_0x8c73('0x32')]);_0x501663['attributes']=_['intersection'](_0x550ce8[_0x8c73('0x30')],qs['fields'](_0x419be0[_0x8c73('0x32')][_0x8c73('0x34')]));_0x501663['attributes']=_0x501663[_0x8c73('0x35')][_0x8c73('0x36')]?_0x501663[_0x8c73('0x35')]:_0x550ce8[_0x8c73('0x30')];if(!_0x419be0[_0x8c73('0x32')][_0x8c73('0x37')]('nolimit')){_0x501663[_0x8c73('0x1f')]=qs[_0x8c73('0x1f')](_0x419be0[_0x8c73('0x32')][_0x8c73('0x1f')]);_0x501663[_0x8c73('0x1d')]=qs[_0x8c73('0x1d')](_0x419be0[_0x8c73('0x32')][_0x8c73('0x1d')]);}_0x501663[_0x8c73('0x38')]=qs[_0x8c73('0x39')](_0x419be0['query'][_0x8c73('0x39')]);_0x501663[_0x8c73('0x3a')]=qs[_0x8c73('0x33')](_[_0x8c73('0x3b')](_0x419be0[_0x8c73('0x32')],_0x550ce8[_0x8c73('0x33')]),_0x2e6730);if(_0x419be0[_0x8c73('0x32')][_0x8c73('0x3c')]){_0x501663['where']=_['merge'](_0x501663[_0x8c73('0x3a')],{'$or':_['map'](_0x2e6730,function(_0x171637){if(_0x171637[_0x8c73('0x3d')]!==_0x8c73('0x3e')){var _0x88e6b2={};_0x88e6b2[_0x171637[_0x8c73('0x2a')]]={'$like':'%'+_0x419be0[_0x8c73('0x32')][_0x8c73('0x3c')]+'%'};return _0x88e6b2;}})});}_0x501663=_['merge']({},_0x501663,_0x419be0[_0x8c73('0x3f')]);var _0xc47c47={'where':_0x501663[_0x8c73('0x3a')]};return db[_0x8c73('0x2c')][_0x8c73('0x20')](_0xc47c47)['then'](function(_0x7ef94f){_0x3562b1[_0x8c73('0x20')]=_0x7ef94f;if(_0x419be0[_0x8c73('0x32')]['includeAll']){_0x501663[_0x8c73('0x40')]=[{'all':!![]}];}return db[_0x8c73('0x2c')]['findAll'](_0x501663);})[_0x8c73('0x26')](function(_0x4c1a84){_0x3562b1[_0x8c73('0x41')]=_0x4c1a84;return _0x3562b1;})[_0x8c73('0x26')](respondWithFilteredResult(_0x1c38aa,_0x501663))['catch'](handleError(_0x1c38aa,null));};exports[_0x8c73('0x42')]=function(_0x5ec7a9,_0x55cf81){var _0x1ba3d7={'raw':!![],'where':{'id':_0x5ec7a9[_0x8c73('0x43')]['id']}},_0x7b0887={};_0x7b0887[_0x8c73('0x30')]=_['keys'](db[_0x8c73('0x2c')][_0x8c73('0x2d')]);_0x7b0887[_0x8c73('0x32')]=_[_0x8c73('0x44')](_0x5ec7a9[_0x8c73('0x32')]);_0x7b0887['filters']=_[_0x8c73('0x45')](_0x7b0887[_0x8c73('0x30')],_0x7b0887['query']);_0x1ba3d7[_0x8c73('0x35')]=_[_0x8c73('0x45')](_0x7b0887[_0x8c73('0x30')],qs[_0x8c73('0x34')](_0x5ec7a9[_0x8c73('0x32')]['fields']));_0x1ba3d7[_0x8c73('0x35')]=_0x1ba3d7[_0x8c73('0x35')][_0x8c73('0x36')]?_0x1ba3d7[_0x8c73('0x35')]:_0x7b0887[_0x8c73('0x30')];if(_0x5ec7a9[_0x8c73('0x32')]['includeAll']){_0x1ba3d7[_0x8c73('0x40')]=[{'all':!![]}];}_0x1ba3d7=_[_0x8c73('0x46')]({},_0x1ba3d7,_0x5ec7a9[_0x8c73('0x3f')]);return db['ZohoField'][_0x8c73('0x47')](_0x1ba3d7)['then'](handleEntityNotFound(_0x55cf81,null))[_0x8c73('0x26')](respondWithResult(_0x55cf81,null))[_0x8c73('0x48')](handleError(_0x55cf81,null));};exports['create']=function(_0x1ada46,_0x347c8d){return db[_0x8c73('0x2c')][_0x8c73('0x49')](_0x1ada46[_0x8c73('0x4a')],{})[_0x8c73('0x26')](respondWithResult(_0x347c8d,0xc9))[_0x8c73('0x48')](handleError(_0x347c8d,null));};exports['update']=function(_0x24721d,_0x48cf57){if(_0x24721d[_0x8c73('0x4a')]['id']){delete _0x24721d['body']['id'];}return db['ZohoField'][_0x8c73('0x47')]({'where':{'id':_0x24721d['params']['id']}})[_0x8c73('0x26')](handleEntityNotFound(_0x48cf57,null))[_0x8c73('0x26')](saveUpdates(_0x24721d['body'],null))[_0x8c73('0x26')](respondWithResult(_0x48cf57,null))[_0x8c73('0x48')](handleError(_0x48cf57,null));};exports[_0x8c73('0x27')]=function(_0x1c06e5,_0x5c2fae){return db[_0x8c73('0x2c')][_0x8c73('0x47')]({'where':{'id':_0x1c06e5[_0x8c73('0x43')]['id']}})[_0x8c73('0x26')](handleEntityNotFound(_0x5c2fae,null))[_0x8c73('0x26')](removeEntity(_0x5c2fae,null))['catch'](handleError(_0x5c2fae,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 4ec0a29..a88d296 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 _0x9582=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','FieldId','lodash'];(function(_0x507c91,_0x11b92){var _0x25acee=function(_0x113101){while(--_0x113101){_0x507c91['push'](_0x507c91['shift']());}};_0x25acee(++_0x11b92);}(_0x9582,0x95));var _0x2958=function(_0x32ed1b,_0x2b76e2){_0x32ed1b=_0x32ed1b-0x0;var _0x1b328d=_0x9582[_0x32ed1b];return _0x1b328d;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var logger=require(_0x2958('0x2'))(_0x2958('0x3'));var moment=require(_0x2958('0x4'));var BPromise=require(_0x2958('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2958('0x6'));var rimraf=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var attributes=require(_0x2958('0x9'));module[_0x2958('0xa')]=function(_0xbde128,_0x88ffaa){return _0xbde128[_0x2958('0xb')](_0x2958('0xc'),attributes,{'tableName':_0x2958('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':['idField',_0x2958('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8e3f=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8e3f[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./intZohoField.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('ZohoField',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[{'name':_0xf8e3('0xb'),'fields':[_0xf8e3('0xc'),_0xf8e3('0xd')],'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 16322df..a9fbefb 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 _0xa3a2=['ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','info'];(function(_0x46f2d9,_0x17db11){var _0xc77d8a=function(_0x2e0503){while(--_0x2e0503){_0x46f2d9['push'](_0x46f2d9['shift']());}};_0xc77d8a(++_0x17db11);}(_0xa3a2,0x143));var _0x2a3a=function(_0x54e4ec,_0x183144){_0x54e4ec=_0x54e4ec-0x0;var _0x44ef91=_0xa3a2[_0x54e4ec];return _0x44ef91;};'use strict';var _=require(_0x2a3a('0x0'));var util=require(_0x2a3a('0x1'));var moment=require(_0x2a3a('0x2'));var BPromise=require(_0x2a3a('0x3'));var rs=require(_0x2a3a('0x4'));var fs=require('fs');var Redis=require(_0x2a3a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a3a('0x6'));var logger=require(_0x2a3a('0x7'))(_0x2a3a('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2a3a('0x9')][_0x2a3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2da34e,_0x4dca8a,_0x44dc4b){return new BPromise(function(_0x47cfaa,_0x129da1){return client[_0x2a3a('0xb')](_0x2da34e,_0x44dc4b)['then'](function(_0x4de923){logger[_0x2a3a('0xc')](_0x2a3a('0xd'),_0x4dca8a,'request\x20sent');logger[_0x2a3a('0xe')](_0x2a3a('0xf'),_0x4dca8a,_0x2a3a('0x10'),JSON['stringify'](_0x4de923));if(_0x4de923['error']){if(_0x4de923[_0x2a3a('0x11')][_0x2a3a('0x12')]===0x1f4){logger['error'](_0x2a3a('0xd'),_0x4dca8a,_0x4de923['error']['message']);return _0x129da1(_0x4de923[_0x2a3a('0x11')][_0x2a3a('0x13')]);}logger[_0x2a3a('0x11')]('ZohoField,\x20%s,\x20%s',_0x4dca8a,_0x4de923[_0x2a3a('0x11')][_0x2a3a('0x13')]);return _0x47cfaa(_0x4de923[_0x2a3a('0x11')][_0x2a3a('0x13')]);}else{logger[_0x2a3a('0xc')](_0x2a3a('0xd'),_0x4dca8a,_0x2a3a('0x10'));_0x47cfaa(_0x4de923['result']['message']);}})[_0x2a3a('0x14')](function(_0x4d38fd){logger['error']('ZohoField,\x20%s,\x20%s',_0x4dca8a,_0x4d38fd);_0x129da1(_0x4d38fd);});});} \ No newline at end of file +var _0x34cd=['error','code','message','ZohoField,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','stringify'];(function(_0x420687,_0x2a6c25){var _0x190813=function(_0x55f062){while(--_0x55f062){_0x420687['push'](_0x420687['shift']());}};_0x190813(++_0x2a6c25);}(_0x34cd,0x156));var _0xd34c=function(_0x849ff7,_0x5d9f47){_0x849ff7=_0x849ff7-0x0;var _0x254e48=_0x34cd[_0x849ff7];return _0x254e48;};'use strict';var _=require(_0xd34c('0x0'));var util=require(_0xd34c('0x1'));var moment=require(_0xd34c('0x2'));var BPromise=require(_0xd34c('0x3'));var rs=require(_0xd34c('0x4'));var fs=require('fs');var Redis=require(_0xd34c('0x5'));var db=require(_0xd34c('0x6'))['db'];var utils=require(_0xd34c('0x7'));var logger=require('../../config/logger')(_0xd34c('0x8'));var config=require(_0xd34c('0x9'));var jayson=require(_0xd34c('0xa'));var client=jayson[_0xd34c('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b86a9,_0x3a6fe7,_0x3b69ef){return new BPromise(function(_0x285d55,_0x13a7df){return client[_0xd34c('0xc')](_0x2b86a9,_0x3b69ef)[_0xd34c('0xd')](function(_0x51fd29){logger[_0xd34c('0xe')]('ZohoField,\x20%s,\x20%s',_0x3a6fe7,_0xd34c('0xf'));logger[_0xd34c('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x3a6fe7,_0xd34c('0xf'),JSON[_0xd34c('0x11')](_0x51fd29));if(_0x51fd29[_0xd34c('0x12')]){if(_0x51fd29[_0xd34c('0x12')][_0xd34c('0x13')]===0x1f4){logger['error']('ZohoField,\x20%s,\x20%s',_0x3a6fe7,_0x51fd29['error']['message']);return _0x13a7df(_0x51fd29[_0xd34c('0x12')][_0xd34c('0x14')]);}logger[_0xd34c('0x12')](_0xd34c('0x15'),_0x3a6fe7,_0x51fd29[_0xd34c('0x12')][_0xd34c('0x14')]);return _0x285d55(_0x51fd29['error'][_0xd34c('0x14')]);}else{logger[_0xd34c('0xe')](_0xd34c('0x15'),_0x3a6fe7,'request\x20sent');_0x285d55(_0x51fd29[_0xd34c('0x16')][_0xd34c('0x14')]);}})[_0xd34c('0x17')](function(_0x16c082){logger['error'](_0xd34c('0x15'),_0x3a6fe7,_0x16c082);_0x13a7df(_0x16c082);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 1ea993b..6038dc8 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1c0028,_0x1ffe06){var _0x4c3b77=function(_0x389b78){while(--_0x389b78){_0x1c0028['push'](_0x1c0028['shift']());}};_0x4c3b77(++_0x1ffe06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2ae5ce,_0x481760){var _0x3ccd3c=function(_0x3b870c){while(--_0x3b870c){_0x2ae5ce['push'](_0x2ae5ce['shift']());}};_0x3ccd3c(++_0x481760);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index de97764..efd2fb5 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 _0xf031=['INTEGER','BOOLEAN','STRING','unique_name_and_version','app.js'];(function(_0x571d85,_0xda439c){var _0x3c2e07=function(_0x2d2144){while(--_0x2d2144){_0x571d85['push'](_0x571d85['shift']());}};_0x3c2e07(++_0xda439c);}(_0xf031,0xfc));var _0x1f03=function(_0x4413c4,_0x5c1375){_0x4413c4=_0x4413c4-0x0;var _0x9a716e=_0xf031[_0x4413c4];return _0x9a716e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1f03('0x0')],'allowNull':![],'unique':_0x1f03('0x1')},'version':{'type':Sequelize[_0x1f03('0x0')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize['STRING'],'defaultValue':_0x1f03('0x2')},'filename':{'type':Sequelize[_0x1f03('0x0')]},'path':{'type':Sequelize[_0x1f03('0x0')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x1f03('0x3')]},'active':{'type':Sequelize[_0x1f03('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x1f03('0x0')]},'logo':{'type':Sequelize[_0x1f03('0x0')]},'state':{'type':Sequelize[_0x1f03('0x0')],'unique':'state'},'description':{'type':Sequelize[_0x1f03('0x0')]},'title':{'type':Sequelize[_0x1f03('0x0')]},'remoteUri':{'type':Sequelize[_0x1f03('0x0')]},'link':{'type':Sequelize[_0x1f03('0x0')],'defaultValue':'#'}}; \ No newline at end of file +var _0xe032=['state','sequelize','exports','STRING','unique_name_and_version','BOOLEAN'];(function(_0x2689cd,_0x574890){var _0x171ffe=function(_0x3e057a){while(--_0x3e057a){_0x2689cd['push'](_0x2689cd['shift']());}};_0x171ffe(++_0x574890);}(_0xe032,0x175));var _0x2e03=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0xe032[_0x4ed32d];return _0xf624df;};'use strict';var Sequelize=require(_0x2e03('0x0'));module[_0x2e03('0x1')]={'name':{'type':Sequelize[_0x2e03('0x2')],'allowNull':![],'unique':_0x2e03('0x3')},'version':{'type':Sequelize[_0x2e03('0x2')],'allowNull':![],'unique':_0x2e03('0x3')},'main':{'type':Sequelize[_0x2e03('0x2')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x2e03('0x2')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x2e03('0x2')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize[_0x2e03('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x2e03('0x2')]},'logo':{'type':Sequelize[_0x2e03('0x2')]},'state':{'type':Sequelize[_0x2e03('0x2')],'unique':_0x2e03('0x5')},'description':{'type':Sequelize[_0x2e03('0x2')]},'title':{'type':Sequelize[_0x2e03('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 4b337c7..b2a8b38 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 _0xacf4=['VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','Integration','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type'];(function(_0x38505f,_0x574af1){var _0x355470=function(_0x45e601){while(--_0x45e601){_0x38505f['push'](_0x38505f['shift']());}};_0x355470(++_0x574af1);}(_0xacf4,0xe7));var _0x4acf=function(_0x54459c,_0x204068){_0x54459c=_0x54459c-0x0;var _0x6b4797=_0xacf4[_0x54459c];return _0x6b4797;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['Integration'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['Integration']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));}; \ No newline at end of file +var _0x2a07=['name','send','index','map','Integration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2a07,0x74));var _0x72a0=function(_0x155506,_0x202f81){_0x155506=_0x155506-0x0;var _0x14b973=_0x2a07[_0x155506];return _0x14b973;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['Integration'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['create'](_0x3a669d['body'],{})[_0x72a0('0x28')](respondWithResult(_0x304400,0xc9))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0x3cab6a,_0x35a6ad){if(_0x3cab6a[_0x72a0('0x4c')]['id']){delete _0x3cab6a[_0x72a0('0x4c')]['id'];}return db[_0x72a0('0x2e')][_0x72a0('0x4d')]({'where':{'id':_0x3cab6a[_0x72a0('0x48')]['id']}})['then'](handleEntityNotFound(_0x35a6ad,null))[_0x72a0('0x28')](saveUpdates(_0x3cab6a[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x35a6ad,null))[_0x72a0('0x46')](handleError(_0x35a6ad,null));};exports[_0x72a0('0x4e')]=function(_0x5c1570,_0x143410){return db['Integration']['find']({'where':{'id':_0x5c1570[_0x72a0('0x48')]['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x143410,null))[_0x72a0('0x28')](removeEntity(_0x143410,null))[_0x72a0('0x46')](handleError(_0x143410,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 58f4dc8..c4dc47c 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 _0x56a7=['./integration.attributes','exports','define','Integration','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x56a7,0xe8));var _0x756a=function(_0x5534ce,_0x26ef5e){_0x5534ce=_0x5534ce-0x0;var _0x33042b=_0x56a7[_0x5534ce];return _0x33042b;};'use strict';var _=require('lodash');var util=require(_0x756a('0x0'));var logger=require(_0x756a('0x1'))(_0x756a('0x2'));var moment=require(_0x756a('0x3'));var BPromise=require(_0x756a('0x4'));var rp=require(_0x756a('0x5'));var fs=require('fs');var path=require(_0x756a('0x6'));var rimraf=require('rimraf');var config=require(_0x756a('0x7'));var attributes=require(_0x756a('0x8'));module[_0x756a('0x9')]=function(_0x49157a,_0x6af17d){return _0x49157a[_0x756a('0xa')](_0x756a('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757f=['path','../../config/environment','exports','define','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x757f,0xc8));var _0xf757=function(_0xe59443,_0x1c7fbc){_0xe59443=_0xe59443-0x0;var _0x155142=_0x757f[_0xe59443];return _0x155142;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xf757('0x0'));var moment=require(_0xf757('0x1'));var BPromise=require(_0xf757('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf757('0x3'));var rimraf=require('rimraf');var config=require(_0xf757('0x4'));var attributes=require('./integration.attributes');module[_0xf757('0x5')]=function(_0x10394d,_0x2f3015){return _0x10394d[_0xf757('0x6')]('Integration',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 b18bd1d..f9754f7 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 _0x9f0e=['../../config/environment','jayson/promise','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc'];(function(_0x169591,_0x94ab12){var _0x2cb673=function(_0x9e41fb){while(--_0x9e41fb){_0x169591['push'](_0x169591['shift']());}};_0x2cb673(++_0x94ab12);}(_0x9f0e,0x116));var _0xe9f0=function(_0x5eda40,_0x3eec49){_0x5eda40=_0x5eda40-0x0;var _0x360907=_0x9f0e[_0x5eda40];return _0x360907;};'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')]('Integration,\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);});});} \ No newline at end of file +var _0x1967=['then','info','Integration,\x20%s,\x20%s','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x1967,0x173));var _0x7196=function(_0x6f868a,_0x36f373){_0x6f868a=_0x6f868a-0x0;var _0xd702d7=_0x1967[_0x6f868a];return _0xd702d7;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index f4d99c6..16a8f13 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['get','isAuthenticated','index','describe','/:id','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller'];(function(_0x232fb5,_0x2438c5){var _0x4a10a5=function(_0x276eb6){while(--_0x276eb6){_0x232fb5['push'](_0x232fb5['shift']());}};_0x4a10a5(++_0x2438c5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x315b61,_0x4bb11e){_0x315b61=_0x315b61-0x0;var _0x3521e8=_0x0b0e[_0x315b61];return _0x3521e8;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0xe')]('/',auth[_0xe0b0('0xa')](),controller['create']);router[_0xe0b0('0xf')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')](_0xe0b0('0xd'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);module[_0xe0b0('0x13')]=router; \ No newline at end of file +var _0x7a54=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','post','put','update','delete','/:id'];(function(_0x1efc8d,_0x171bbf){var _0x36c6de=function(_0x4b9428){while(--_0x4b9428){_0x1efc8d['push'](_0x1efc8d['shift']());}};_0x36c6de(++_0x171bbf);}(_0x7a54,0x106));var _0x47a5=function(_0x164091,_0x41dd7c){_0x164091=_0x164091-0x0;var _0x39074c=_0x7a54[_0x164091];return _0x39074c;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['describe']);router[_0x47a5('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x47a5('0xd')]('/',auth[_0x47a5('0xc')](),controller['create']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')](_0x47a5('0x11'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x12')]);module[_0x47a5('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 dc138aa..e814e92 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 _0xd51d=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','RECEIVED','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd51d,0x10c));var _0xdd51=function(_0x139cc4,_0x2780bd){_0x139cc4=_0x139cc4-0x0;var _0xf6477c=_0xd51d[_0x139cc4];return _0xf6477c;};'use strict';var Sequelize=require(_0xdd51('0x0'));module[_0xdd51('0x1')]={'integration':{'type':Sequelize[_0xdd51('0x2')]},'eventChannel':{'type':Sequelize[_0xdd51('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xdd51('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xdd51('0x2')]},'calleridnum':{'type':Sequelize[_0xdd51('0x2')]},'calleridname':{'type':Sequelize[_0xdd51('0x2')]},'queue':{'type':Sequelize[_0xdd51('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xdd51('0x2')]},'agentcalledAt':{'type':Sequelize[_0xdd51('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xdd51('0x3')]},'agentcomplete':{'type':Sequelize[_0xdd51('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xdd51('0x4')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xdd51('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xdd51('0x3')]},'reason':{'type':Sequelize[_0xdd51('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xdd51('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xdd51('0x4')]},'agentdump':{'type':Sequelize[_0xdd51('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xdd51('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xdd51('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xdd51('0x2')]},'connectedlinename':{'type':Sequelize[_0xdd51('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xdd51('0x2')]},'context':{'type':Sequelize[_0xdd51('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xdd51('0x2')]},'destchannel':{'type':Sequelize[_0xdd51('0x2')]},'destchannelstate':{'type':Sequelize[_0xdd51('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xdd51('0x2')]},'destcalleridnum':{'type':Sequelize[_0xdd51('0x2')]},'destcalleridname':{'type':Sequelize[_0xdd51('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xdd51('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xdd51('0x2')]},'destlanguage':{'type':Sequelize[_0xdd51('0x2')]},'destaccountcode':{'type':Sequelize[_0xdd51('0x2')]},'destcontext':{'type':Sequelize[_0xdd51('0x2')]},'destexten':{'type':Sequelize[_0xdd51('0x2')]},'destpriority':{'type':Sequelize[_0xdd51('0x2')]},'destuniqueid':{'type':Sequelize[_0xdd51('0x2')]},'messageId':{'type':Sequelize[_0xdd51('0x2')]},'inReplyTo':{'type':Sequelize[_0xdd51('0x2')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xdd51('0x2')]},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xdd51('0x2')]},'attachment':{'type':Sequelize[_0xdd51('0x6')]},'html':{'type':Sequelize[_0xdd51('0x6')]},'text':{'type':Sequelize[_0xdd51('0x6')]},'status':{'type':Sequelize[_0xdd51('0x7')]('SENT',_0xdd51('0x8'),_0xdd51('0x9'),'FAILED')},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0xdd51('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5295=['SENDING','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x3c3d3c,_0x47147d){var _0x524ac5=function(_0x3460e9){while(--_0x3460e9){_0x3c3d3c['push'](_0x3c3d3c['shift']());}};_0x524ac5(++_0x47147d);}(_0x5295,0x70));var _0x5529=function(_0x432b16,_0x366e49){_0x432b16=_0x432b16-0x0;var _0x27c918=_0x5295[_0x432b16];return _0x27c918;};'use strict';var Sequelize=require('sequelize');module[_0x5529('0x0')]={'integration':{'type':Sequelize[_0x5529('0x1')]},'eventChannel':{'type':Sequelize[_0x5529('0x1')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x5529('0x1')]},'integrationId':{'type':Sequelize[_0x5529('0x2')]},'contacts':{'type':Sequelize[_0x5529('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x5529('0x1')]},'queue':{'type':Sequelize[_0x5529('0x1')]},'interface':{'type':Sequelize[_0x5529('0x1')]},'membername':{'type':Sequelize[_0x5529('0x1')]},'agentcalledAt':{'type':Sequelize[_0x5529('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5529('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5529('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x5529('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5529('0x2')]},'reason':{'type':Sequelize[_0x5529('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x5529('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5529('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x5529('0x1')]},'channelstate':{'type':Sequelize[_0x5529('0x2')]},'channelstatedesc':{'type':Sequelize[_0x5529('0x1')]},'connectedlinenum':{'type':Sequelize[_0x5529('0x1')]},'connectedlinename':{'type':Sequelize[_0x5529('0x1')]},'language':{'type':Sequelize[_0x5529('0x1')]},'accountcode':{'type':Sequelize[_0x5529('0x1')]},'context':{'type':Sequelize[_0x5529('0x1')]},'exten':{'type':Sequelize[_0x5529('0x1')]},'priority':{'type':Sequelize[_0x5529('0x1')]},'destchannel':{'type':Sequelize[_0x5529('0x1')]},'destchannelstate':{'type':Sequelize[_0x5529('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x5529('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x5529('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5529('0x1')]},'destlanguage':{'type':Sequelize[_0x5529('0x1')]},'destaccountcode':{'type':Sequelize[_0x5529('0x1')]},'destcontext':{'type':Sequelize[_0x5529('0x1')]},'destexten':{'type':Sequelize[_0x5529('0x1')]},'destpriority':{'type':Sequelize[_0x5529('0x1')]},'destuniqueid':{'type':Sequelize[_0x5529('0x1')]},'messageId':{'type':Sequelize[_0x5529('0x1')]},'inReplyTo':{'type':Sequelize[_0x5529('0x1')]},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0x5529('0x1')]},'to':{'type':Sequelize[_0x5529('0x1')]},'cc':{'type':Sequelize[_0x5529('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize[_0x5529('0x5')]},'text':{'type':Sequelize[_0x5529('0x5')]},'status':{'type':Sequelize[_0x5529('0x6')](_0x5529('0x7'),_0x5529('0x8'),'RECEIVED',_0x5529('0x9'))},'url':{'type':Sequelize[_0x5529('0x1')]},'app':{'type':Sequelize[_0x5529('0x1')]},'appdata':{'type':Sequelize[_0x5529('0x1')]},'projectId':{'type':Sequelize[_0x5529('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 2df9b65..8f0e2aa 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 _0x946c=['attributes','nolimit','sort','filter','merge','VIRTUAL','where','findAll','rows','catch','show','params','intersection','length','includeAll','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','filters','fields'];(function(_0x48bd20,_0x1c0fe1){var _0x47ea42=function(_0x266c7d){while(--_0x266c7d){_0x48bd20['push'](_0x48bd20['shift']());}};_0x47ea42(++_0x1c0fe1);}(_0x946c,0xb0));var _0xc946=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0x946c[_0x411add];return _0x238242;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc946('0x0'));var zipdir=require(_0xc946('0x1'));var jsonpatch=require(_0xc946('0x2'));var rp=require('request-promise');var moment=require(_0xc946('0x3'));var BPromise=require(_0xc946('0x4'));var Mustache=require(_0xc946('0x5'));var util=require(_0xc946('0x6'));var path=require(_0xc946('0x7'));var sox=require(_0xc946('0x8'));var csv=require(_0xc946('0x9'));var ejs=require(_0xc946('0xa'));var fs=require('fs');var fs_extra=require(_0xc946('0xb'));var _=require(_0xc946('0xc'));var squel=require(_0xc946('0xd'));var crypto=require(_0xc946('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc946('0xf'));var toCsv=require(_0xc946('0x9'));var querystring=require(_0xc946('0x10'));var Papa=require(_0xc946('0x11'));var Redis=require(_0xc946('0x12'));var authService=require(_0xc946('0x13'));var qs=require(_0xc946('0x14'));var as=require(_0xc946('0x15'));var hardwareService=require(_0xc946('0x16'));var logger=require(_0xc946('0x17'))(_0xc946('0x18'));var utils=require('../../config/utils');var config=require(_0xc946('0x19'));var licenseUtil=require(_0xc946('0x1a'));var db=require(_0xc946('0x1b'))['db'];function respondWithStatusCode(_0x2d8ed7,_0x4bf16f){_0x4bf16f=_0x4bf16f||0xcc;return function(_0x2b7245){if(_0x2b7245){return _0x2d8ed7[_0xc946('0x1c')](_0x4bf16f);}return _0x2d8ed7[_0xc946('0x1d')](_0x4bf16f)[_0xc946('0x1e')]();};}function respondWithResult(_0x32a808,_0x155879){_0x155879=_0x155879||0xc8;return function(_0x121bf9){if(_0x121bf9){return _0x32a808['status'](_0x155879)[_0xc946('0x1f')](_0x121bf9);}};}function respondWithFilteredResult(_0x1037eb,_0x2bd4a7){return function(_0x3c65a6){if(_0x3c65a6){var _0x4c4ecb=typeof _0x2bd4a7[_0xc946('0x20')]==='undefined'&&typeof _0x2bd4a7[_0xc946('0x21')]===_0xc946('0x22');var _0x3f9047=_0x3c65a6[_0xc946('0x23')];var _0x1fd9c8=_0x4c4ecb?0x0:_0x2bd4a7[_0xc946('0x20')];var _0x484777=_0x4c4ecb?_0x3c65a6['count']:_0x2bd4a7[_0xc946('0x20')]+_0x2bd4a7[_0xc946('0x21')];var _0x1fd918;if(_0x484777>=_0x3f9047){_0x484777=_0x3f9047;_0x1fd918=0xc8;}else{_0x1fd918=0xce;}_0x1037eb['status'](_0x1fd918);return _0x1037eb[_0xc946('0x24')](_0xc946('0x25'),_0x1fd9c8+'-'+_0x484777+'/'+_0x3f9047)[_0xc946('0x1f')](_0x3c65a6);}return null;};}function patchUpdates(_0x5afabd){return function(_0x289ca1){try{jsonpatch[_0xc946('0x26')](_0x289ca1,_0x5afabd,!![]);}catch(_0x4603f7){return BPromise[_0xc946('0x27')](_0x4603f7);}return _0x289ca1[_0xc946('0x28')]();};}function saveUpdates(_0x700f9b,_0xda0c){return function(_0x2057c4){if(_0x2057c4){return _0x2057c4[_0xc946('0x29')](_0x700f9b)[_0xc946('0x2a')](function(_0x5075a0){return _0x5075a0;});}return null;};}function removeEntity(_0x82ee66,_0x1f7239){return function(_0x126abd){if(_0x126abd){return _0x126abd[_0xc946('0x2b')]()['then'](function(){_0x82ee66[_0xc946('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d8d93,_0x1aa851){return function(_0x840093){if(!_0x840093){_0x1d8d93[_0xc946('0x1c')](0x194);}return _0x840093;};}function handleError(_0x2eff8c,_0x1e9276){_0x1e9276=_0x1e9276||0x1f4;return function(_0x32c6d4){logger[_0xc946('0x2c')](_0x32c6d4['stack']);if(_0x32c6d4['name']){delete _0x32c6d4[_0xc946('0x2d')];}_0x2eff8c[_0xc946('0x1d')](_0x1e9276)[_0xc946('0x2e')](_0x32c6d4);};}exports[_0xc946('0x2f')]=function(_0x3c2b2c,_0x5e757d){var _0x55f263={},_0x5df06e={},_0x4a8934={'count':0x0,'rows':[]};var _0x80dfe3=_[_0xc946('0x30')](db[_0xc946('0x31')][_0xc946('0x32')],function(_0x26fb02){return{'name':_0x26fb02[_0xc946('0x33')],'type':_0x26fb02[_0xc946('0x34')]['key']};});_0x5df06e[_0xc946('0x35')]=_[_0xc946('0x30')](_0x80dfe3,_0xc946('0x2d'));_0x5df06e[_0xc946('0x36')]=_[_0xc946('0x37')](_0x3c2b2c[_0xc946('0x36')]);_0x5df06e[_0xc946('0x38')]=_['intersection'](_0x5df06e[_0xc946('0x35')],_0x5df06e[_0xc946('0x36')]);_0x55f263['attributes']=_['intersection'](_0x5df06e[_0xc946('0x35')],qs[_0xc946('0x39')](_0x3c2b2c[_0xc946('0x36')][_0xc946('0x39')]));_0x55f263[_0xc946('0x3a')]=_0x55f263[_0xc946('0x3a')]['length']?_0x55f263[_0xc946('0x3a')]:_0x5df06e[_0xc946('0x35')];if(!_0x3c2b2c[_0xc946('0x36')]['hasOwnProperty'](_0xc946('0x3b'))){_0x55f263[_0xc946('0x21')]=qs[_0xc946('0x21')](_0x3c2b2c['query'][_0xc946('0x21')]);_0x55f263[_0xc946('0x20')]=qs[_0xc946('0x20')](_0x3c2b2c[_0xc946('0x36')]['offset']);}_0x55f263['order']=qs[_0xc946('0x3c')](_0x3c2b2c['query'][_0xc946('0x3c')]);_0x55f263['where']=qs['filters'](_['pick'](_0x3c2b2c['query'],_0x5df06e[_0xc946('0x38')]),_0x80dfe3);if(_0x3c2b2c['query'][_0xc946('0x3d')]){_0x55f263['where']=_[_0xc946('0x3e')](_0x55f263['where'],{'$or':_['map'](_0x80dfe3,function(_0x45e62e){if(_0x45e62e[_0xc946('0x34')]!==_0xc946('0x3f')){var _0x25c444={};_0x25c444[_0x45e62e[_0xc946('0x2d')]]={'$like':'%'+_0x3c2b2c['query'][_0xc946('0x3d')]+'%'};return _0x25c444;}})});}_0x55f263=_['merge']({},_0x55f263,_0x3c2b2c['options']);var _0x2a3b03={'where':_0x55f263[_0xc946('0x40')]};return db['IntegrationReport'][_0xc946('0x23')](_0x2a3b03)['then'](function(_0x418e96){_0x4a8934['count']=_0x418e96;if(_0x3c2b2c['query']['includeAll']){_0x55f263['include']=[{'all':!![]}];}return db[_0xc946('0x31')][_0xc946('0x41')](_0x55f263);})[_0xc946('0x2a')](function(_0x459907){_0x4a8934[_0xc946('0x42')]=_0x459907;return _0x4a8934;})[_0xc946('0x2a')](respondWithFilteredResult(_0x5e757d,_0x55f263))[_0xc946('0x43')](handleError(_0x5e757d,null));};exports[_0xc946('0x44')]=function(_0x929ec9,_0x5b1f30){var _0x53d519={'raw':![],'where':{'id':_0x929ec9[_0xc946('0x45')]['id']}},_0x3d55b9={};_0x3d55b9[_0xc946('0x35')]=_[_0xc946('0x37')](db['IntegrationReport']['rawAttributes']);_0x3d55b9[_0xc946('0x36')]=_[_0xc946('0x37')](_0x929ec9[_0xc946('0x36')]);_0x3d55b9[_0xc946('0x38')]=_[_0xc946('0x46')](_0x3d55b9['model'],_0x3d55b9[_0xc946('0x36')]);_0x53d519['attributes']=_[_0xc946('0x46')](_0x3d55b9[_0xc946('0x35')],qs[_0xc946('0x39')](_0x929ec9[_0xc946('0x36')][_0xc946('0x39')]));_0x53d519['attributes']=_0x53d519[_0xc946('0x3a')][_0xc946('0x47')]?_0x53d519[_0xc946('0x3a')]:_0x3d55b9['model'];if(_0x929ec9[_0xc946('0x36')][_0xc946('0x48')]){_0x53d519[_0xc946('0x49')]=[{'all':!![]}];}_0x53d519=_[_0xc946('0x3e')]({},_0x53d519,_0x929ec9['options']);return db['IntegrationReport'][_0xc946('0x4a')](_0x53d519)[_0xc946('0x2a')](handleEntityNotFound(_0x5b1f30,null))['then'](respondWithResult(_0x5b1f30,null))[_0xc946('0x43')](handleError(_0x5b1f30,null));};exports['create']=function(_0x10c42c,_0x16bb84){return db[_0xc946('0x31')][_0xc946('0x4b')](_0x10c42c[_0xc946('0x4c')],{})[_0xc946('0x2a')](respondWithResult(_0x16bb84,0xc9))[_0xc946('0x43')](handleError(_0x16bb84,null));};exports[_0xc946('0x29')]=function(_0x550d19,_0x42edad){if(_0x550d19[_0xc946('0x4c')]['id']){delete _0x550d19['body']['id'];}return db['IntegrationReport']['find']({'where':{'id':_0x550d19[_0xc946('0x45')]['id']}})[_0xc946('0x2a')](handleEntityNotFound(_0x42edad,null))[_0xc946('0x2a')](saveUpdates(_0x550d19[_0xc946('0x4c')],null))[_0xc946('0x2a')](respondWithResult(_0x42edad,null))[_0xc946('0x43')](handleError(_0x42edad,null));};exports['destroy']=function(_0x1a3707,_0x5b45cb){return db['IntegrationReport'][_0xc946('0x4a')]({'where':{'id':_0x1a3707[_0xc946('0x45')]['id']}})['then'](handleEntityNotFound(_0x5b45cb,null))[_0xc946('0x2a')](removeEntity(_0x5b45cb,null))[_0xc946('0x43')](handleError(_0x5b45cb,null));};exports[_0xc946('0x4d')]=function(_0x4ca2ae,_0x359a89){return db[_0xc946('0x31')]['describe']()[_0xc946('0x2a')](respondWithResult(_0x359a89,null))['catch'](handleError(_0x359a89,null));}; \ No newline at end of file +var _0x8464=['stack','name','index','IntegrationReport','rawAttributes','type','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','include','findAll','rows','catch','params','length','find','create','body','describe','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','reject','update','destroy','end'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x8464,0x1cc));var _0x4846=function(_0x126264,_0x47e262){_0x126264=_0x126264-0x0;var _0x5e1b30=_0x8464[_0x126264];return _0x5e1b30;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4846('0x0'));var jsonpatch=require(_0x4846('0x1'));var rp=require('request-promise');var moment=require(_0x4846('0x2'));var BPromise=require(_0x4846('0x3'));var Mustache=require(_0x4846('0x4'));var util=require('util');var path=require(_0x4846('0x5'));var sox=require(_0x4846('0x6'));var csv=require(_0x4846('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4846('0x8'));var _=require(_0x4846('0x9'));var squel=require(_0x4846('0xa'));var crypto=require(_0x4846('0xb'));var jsforce=require(_0x4846('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4846('0x7'));var querystring=require('querystring');var Papa=require(_0x4846('0xd'));var Redis=require(_0x4846('0xe'));var authService=require(_0x4846('0xf'));var qs=require(_0x4846('0x10'));var as=require(_0x4846('0x11'));var hardwareService=require(_0x4846('0x12'));var logger=require('../../config/logger')(_0x4846('0x13'));var utils=require(_0x4846('0x14'));var config=require(_0x4846('0x15'));var licenseUtil=require(_0x4846('0x16'));var db=require(_0x4846('0x17'))['db'];function respondWithStatusCode(_0x265d18,_0x603e4d){_0x603e4d=_0x603e4d||0xcc;return function(_0x20d3e2){if(_0x20d3e2){return _0x265d18[_0x4846('0x18')](_0x603e4d);}return _0x265d18[_0x4846('0x19')](_0x603e4d)['end']();};}function respondWithResult(_0x3517b0,_0x5ab37c){_0x5ab37c=_0x5ab37c||0xc8;return function(_0x2556f7){if(_0x2556f7){return _0x3517b0[_0x4846('0x19')](_0x5ab37c)[_0x4846('0x1a')](_0x2556f7);}};}function respondWithFilteredResult(_0x2cd2d0,_0x7484f1){return function(_0x1dec4b){if(_0x1dec4b){var _0x494175=typeof _0x7484f1[_0x4846('0x1b')]==='undefined'&&typeof _0x7484f1[_0x4846('0x1c')]==='undefined';var _0x4074c7=_0x1dec4b[_0x4846('0x1d')];var _0x419f23=_0x494175?0x0:_0x7484f1['offset'];var _0x30052b=_0x494175?_0x1dec4b[_0x4846('0x1d')]:_0x7484f1['offset']+_0x7484f1['limit'];var _0x2a7b33;if(_0x30052b>=_0x4074c7){_0x30052b=_0x4074c7;_0x2a7b33=0xc8;}else{_0x2a7b33=0xce;}_0x2cd2d0[_0x4846('0x19')](_0x2a7b33);return _0x2cd2d0[_0x4846('0x1e')](_0x4846('0x1f'),_0x419f23+'-'+_0x30052b+'/'+_0x4074c7)[_0x4846('0x1a')](_0x1dec4b);}return null;};}function patchUpdates(_0x3f6bd1){return function(_0x4df4cc){try{jsonpatch[_0x4846('0x20')](_0x4df4cc,_0x3f6bd1,!![]);}catch(_0x229a0d){return BPromise[_0x4846('0x21')](_0x229a0d);}return _0x4df4cc['save']();};}function saveUpdates(_0x1b0a23,_0x4ab355){return function(_0x2b456e){if(_0x2b456e){return _0x2b456e[_0x4846('0x22')](_0x1b0a23)['then'](function(_0x3a19de){return _0x3a19de;});}return null;};}function removeEntity(_0x427198,_0x2905ea){return function(_0x23c919){if(_0x23c919){return _0x23c919[_0x4846('0x23')]()['then'](function(){_0x427198[_0x4846('0x19')](0xcc)[_0x4846('0x24')]();});}};}function handleEntityNotFound(_0x1ea37f,_0x20cae6){return function(_0x4e06dd){if(!_0x4e06dd){_0x1ea37f['sendStatus'](0x194);}return _0x4e06dd;};}function handleError(_0x15189a,_0x2bc0c0){_0x2bc0c0=_0x2bc0c0||0x1f4;return function(_0x5dd1da){logger['error'](_0x5dd1da[_0x4846('0x25')]);if(_0x5dd1da[_0x4846('0x26')]){delete _0x5dd1da[_0x4846('0x26')];}_0x15189a[_0x4846('0x19')](_0x2bc0c0)['send'](_0x5dd1da);};}exports[_0x4846('0x27')]=function(_0xf1241a,_0x23b389){var _0x21ea9e={},_0x345253={},_0x2e21b5={'count':0x0,'rows':[]};var _0x1c7e2f=_['map'](db[_0x4846('0x28')][_0x4846('0x29')],function(_0x304112){return{'name':_0x304112['fieldName'],'type':_0x304112[_0x4846('0x2a')]['key']};});_0x345253[_0x4846('0x2b')]=_[_0x4846('0x2c')](_0x1c7e2f,_0x4846('0x26'));_0x345253[_0x4846('0x2d')]=_[_0x4846('0x2e')](_0xf1241a[_0x4846('0x2d')]);_0x345253[_0x4846('0x2f')]=_[_0x4846('0x30')](_0x345253['model'],_0x345253[_0x4846('0x2d')]);_0x21ea9e[_0x4846('0x31')]=_[_0x4846('0x30')](_0x345253['model'],qs[_0x4846('0x32')](_0xf1241a[_0x4846('0x2d')][_0x4846('0x32')]));_0x21ea9e[_0x4846('0x31')]=_0x21ea9e[_0x4846('0x31')]['length']?_0x21ea9e[_0x4846('0x31')]:_0x345253[_0x4846('0x2b')];if(!_0xf1241a['query']['hasOwnProperty'](_0x4846('0x33'))){_0x21ea9e[_0x4846('0x1c')]=qs[_0x4846('0x1c')](_0xf1241a[_0x4846('0x2d')][_0x4846('0x1c')]);_0x21ea9e[_0x4846('0x1b')]=qs[_0x4846('0x1b')](_0xf1241a[_0x4846('0x2d')][_0x4846('0x1b')]);}_0x21ea9e[_0x4846('0x34')]=qs[_0x4846('0x35')](_0xf1241a[_0x4846('0x2d')][_0x4846('0x35')]);_0x21ea9e['where']=qs[_0x4846('0x2f')](_[_0x4846('0x36')](_0xf1241a['query'],_0x345253[_0x4846('0x2f')]),_0x1c7e2f);if(_0xf1241a[_0x4846('0x2d')][_0x4846('0x37')]){_0x21ea9e[_0x4846('0x38')]=_['merge'](_0x21ea9e['where'],{'$or':_['map'](_0x1c7e2f,function(_0x4952e2){if(_0x4952e2['type']!==_0x4846('0x39')){var _0x3518ec={};_0x3518ec[_0x4952e2[_0x4846('0x26')]]={'$like':'%'+_0xf1241a[_0x4846('0x2d')][_0x4846('0x37')]+'%'};return _0x3518ec;}})});}_0x21ea9e=_[_0x4846('0x3a')]({},_0x21ea9e,_0xf1241a[_0x4846('0x3b')]);var _0x1efd85={'where':_0x21ea9e['where']};return db[_0x4846('0x28')][_0x4846('0x1d')](_0x1efd85)[_0x4846('0x3c')](function(_0x1b1f3f){_0x2e21b5[_0x4846('0x1d')]=_0x1b1f3f;if(_0xf1241a[_0x4846('0x2d')]['includeAll']){_0x21ea9e[_0x4846('0x3d')]=[{'all':!![]}];}return db[_0x4846('0x28')][_0x4846('0x3e')](_0x21ea9e);})['then'](function(_0x4b52b4){_0x2e21b5[_0x4846('0x3f')]=_0x4b52b4;return _0x2e21b5;})[_0x4846('0x3c')](respondWithFilteredResult(_0x23b389,_0x21ea9e))[_0x4846('0x40')](handleError(_0x23b389,null));};exports['show']=function(_0x4e263f,_0x1f112b){var _0xa8b009={'raw':![],'where':{'id':_0x4e263f[_0x4846('0x41')]['id']}},_0x2fbc0c={};_0x2fbc0c[_0x4846('0x2b')]=_[_0x4846('0x2e')](db[_0x4846('0x28')][_0x4846('0x29')]);_0x2fbc0c[_0x4846('0x2d')]=_[_0x4846('0x2e')](_0x4e263f['query']);_0x2fbc0c['filters']=_[_0x4846('0x30')](_0x2fbc0c[_0x4846('0x2b')],_0x2fbc0c[_0x4846('0x2d')]);_0xa8b009[_0x4846('0x31')]=_[_0x4846('0x30')](_0x2fbc0c['model'],qs[_0x4846('0x32')](_0x4e263f['query'][_0x4846('0x32')]));_0xa8b009['attributes']=_0xa8b009[_0x4846('0x31')][_0x4846('0x42')]?_0xa8b009[_0x4846('0x31')]:_0x2fbc0c['model'];if(_0x4e263f[_0x4846('0x2d')]['includeAll']){_0xa8b009['include']=[{'all':!![]}];}_0xa8b009=_[_0x4846('0x3a')]({},_0xa8b009,_0x4e263f[_0x4846('0x3b')]);return db['IntegrationReport'][_0x4846('0x43')](_0xa8b009)[_0x4846('0x3c')](handleEntityNotFound(_0x1f112b,null))['then'](respondWithResult(_0x1f112b,null))[_0x4846('0x40')](handleError(_0x1f112b,null));};exports[_0x4846('0x44')]=function(_0x3818ed,_0x73bee4){return db[_0x4846('0x28')][_0x4846('0x44')](_0x3818ed[_0x4846('0x45')],{})[_0x4846('0x3c')](respondWithResult(_0x73bee4,0xc9))[_0x4846('0x40')](handleError(_0x73bee4,null));};exports[_0x4846('0x22')]=function(_0x493f6f,_0x5c2f7e){if(_0x493f6f[_0x4846('0x45')]['id']){delete _0x493f6f[_0x4846('0x45')]['id'];}return db[_0x4846('0x28')][_0x4846('0x43')]({'where':{'id':_0x493f6f[_0x4846('0x41')]['id']}})[_0x4846('0x3c')](handleEntityNotFound(_0x5c2f7e,null))['then'](saveUpdates(_0x493f6f[_0x4846('0x45')],null))[_0x4846('0x3c')](respondWithResult(_0x5c2f7e,null))[_0x4846('0x40')](handleError(_0x5c2f7e,null));};exports[_0x4846('0x23')]=function(_0x4ae675,_0x57d9c4){return db[_0x4846('0x28')][_0x4846('0x43')]({'where':{'id':_0x4ae675['params']['id']}})['then'](handleEntityNotFound(_0x57d9c4,null))[_0x4846('0x3c')](removeEntity(_0x57d9c4,null))[_0x4846('0x40')](handleError(_0x57d9c4,null));};exports[_0x4846('0x46')]=function(_0x40aa82,_0x32fe42){return db[_0x4846('0x28')][_0x4846('0x46')]()[_0x4846('0x3c')](respondWithResult(_0x32fe42,null))[_0x4846('0x40')](handleError(_0x32fe42,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a93ba78..4d7c206 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 _0xafe1=['IntegrationReport','report_integration','util','api','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','define'];(function(_0x12bd1e,_0x17a330){var _0x5caaeb=function(_0x172ae2){while(--_0x172ae2){_0x12bd1e['push'](_0x12bd1e['shift']());}};_0x5caaeb(++_0x17a330);}(_0xafe1,0x86));var _0x1afe=function(_0x36bf46,_0x3d8db9){_0x36bf46=_0x36bf46-0x0;var _0x1d0a72=_0xafe1[_0x36bf46];return _0x1d0a72;};'use strict';var _=require('lodash');var util=require(_0x1afe('0x0'));var logger=require('../../config/logger')(_0x1afe('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1afe('0x2'));var fs=require('fs');var path=require(_0x1afe('0x3'));var rimraf=require(_0x1afe('0x4'));var config=require(_0x1afe('0x5'));var attributes=require(_0x1afe('0x6'));module[_0x1afe('0x7')]=function(_0x39eff2,_0x1a9cd5){return _0x39eff2[_0x1afe('0x8')](_0x1afe('0x9'),attributes,{'tableName':_0x1afe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4989=['./integrationReport.attributes','define','IntegrationReport','report_integration','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x403f5f,_0x283f67){var _0x15b1cd=function(_0x238cab){while(--_0x238cab){_0x403f5f['push'](_0x403f5f['shift']());}};_0x15b1cd(++_0x283f67);}(_0x4989,0xdc));var _0x9498=function(_0x3bd497,_0x37d7a8){_0x3bd497=_0x3bd497-0x0;var _0x32f967=_0x4989[_0x3bd497];return _0x32f967;};'use strict';var _=require('lodash');var util=require(_0x9498('0x0'));var logger=require(_0x9498('0x1'))(_0x9498('0x2'));var moment=require(_0x9498('0x3'));var BPromise=require(_0x9498('0x4'));var rp=require(_0x9498('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9498('0x6'));var config=require(_0x9498('0x7'));var attributes=require(_0x9498('0x8'));module['exports']=function(_0x40e742,_0x2eed17){return _0x40e742[_0x9498('0x9')](_0x9498('0xa'),attributes,{'tableName':_0x9498('0xb'),'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 a0eee86..62b54a8 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 _0xc6ac=['http','request','then','info','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4072b2,_0x2431d6){var _0x3af996=function(_0xfbd95e){while(--_0xfbd95e){_0x4072b2['push'](_0x4072b2['shift']());}};_0x3af996(++_0x2431d6);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x1373c1,_0x27a334){_0x1373c1=_0x1373c1-0x0;var _0x631f32=_0xc6ac[_0x1373c1];return _0x631f32;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('IntegrationReport,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x1fa0cf,_0x2b21f8){var _0x379a98=function(_0x150f19){while(--_0x150f19){_0x1fa0cf['push'](_0x1fa0cf['shift']());}};_0x379a98(++_0x2b21f8);}(_0x4819,0xcd));var _0x9481=function(_0x34dd23,_0x50ce42){_0x34dd23=_0x34dd23-0x0;var _0x18a648=_0x4819[_0x34dd23];return _0x18a648;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 11d2515..2e21801 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 _0xf698=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','create','addInterval','/:id/sub_intervals/create_many','addIntervals','update','destroy','multer','util','connect-timeout','express','fs-extra'];(function(_0x292ff6,_0x21729f){var _0x3d5bbf=function(_0x6f9320){while(--_0x6f9320){_0x292ff6['push'](_0x292ff6['shift']());}};_0x3d5bbf(++_0x21729f);}(_0xf698,0x1de));var _0x8f69=function(_0x37b3e5,_0x33b516){_0x37b3e5=_0x37b3e5-0x0;var _0x207f20=_0xf698[_0x37b3e5];return _0x207f20;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var fs_extra=require(_0x8f69('0x4'));var auth=require(_0x8f69('0x5'));var interaction=require(_0x8f69('0x6'));var config=require(_0x8f69('0x7'));var controller=require('./interval.controller');router[_0x8f69('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f69('0x9'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xb')]);router[_0x8f69('0x8')](_0x8f69('0xc'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xd')]);router[_0x8f69('0xe')]('/',auth[_0x8f69('0xa')](),controller[_0x8f69('0xf')]);router[_0x8f69('0xe')](_0x8f69('0xc'),auth['isAuthenticated'](),controller[_0x8f69('0x10')]);router['post'](_0x8f69('0x11'),auth['isAuthenticated'](),controller[_0x8f69('0x12')]);router['put'](_0x8f69('0x9'),auth[_0x8f69('0xa')](),controller[_0x8f69('0x13')]);router['delete']('/:id',auth[_0x8f69('0xa')](),controller[_0x8f69('0x14')]);module['exports']=router; \ No newline at end of file +var _0xb3a7=['Router','fs-extra','../../components/auth/service','get','isAuthenticated','/:id','show','/:id/sub_intervals','getIntervals','create','post','/:id/sub_intervals/create_many','addIntervals','put','delete','destroy','multer','path','express'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0xb3a7,0x1c5));var _0x7b3a=function(_0x121c30,_0x31b3c0){_0x121c30=_0x121c30-0x0;var _0x32697c=_0xb3a7[_0x121c30];return _0x32697c;};'use strict';var multer=require(_0x7b3a('0x0'));var util=require('util');var path=require(_0x7b3a('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b3a('0x2'));var router=express[_0x7b3a('0x3')]();var fs_extra=require(_0x7b3a('0x4'));var auth=require(_0x7b3a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x7b3a('0x6')]('/',auth[_0x7b3a('0x7')](),controller['index']);router[_0x7b3a('0x6')](_0x7b3a('0x8'),auth[_0x7b3a('0x7')](),controller[_0x7b3a('0x9')]);router[_0x7b3a('0x6')](_0x7b3a('0xa'),auth['isAuthenticated'](),controller[_0x7b3a('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7b3a('0xc')]);router[_0x7b3a('0xd')](_0x7b3a('0xa'),auth[_0x7b3a('0x7')](),controller['addInterval']);router['post'](_0x7b3a('0xe'),auth[_0x7b3a('0x7')](),controller[_0x7b3a('0xf')]);router[_0x7b3a('0x10')](_0x7b3a('0x8'),auth[_0x7b3a('0x7')](),controller['update']);router[_0x7b3a('0x11')](_0x7b3a('0x8'),auth['isAuthenticated'](),controller[_0x7b3a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 1fd2536..2ba33d5 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 _0xe2b4=['STRING','sequelize'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe2b4,0x153));var _0x4e2b=function(_0x3e3669,_0x4e34ed){_0x3e3669=_0x3e3669-0x0;var _0x108da1=_0xe2b4[_0x3e3669];return _0x108da1;};'use strict';var Sequelize=require(_0x4e2b('0x0'));module['exports']={'name':{'type':Sequelize[_0x4e2b('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4e2b('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xd2c5=['STRING','sequelize','exports'];(function(_0x1b052e,_0x1d4f7c){var _0x2ca569=function(_0x863547){while(--_0x863547){_0x1b052e['push'](_0x1b052e['shift']());}};_0x2ca569(++_0x1d4f7c);}(_0xd2c5,0x166));var _0x5d2c=function(_0x3341ce,_0x12d928){_0x3341ce=_0x3341ce-0x0;var _0x320f2d=_0xd2c5[_0x3341ce];return _0x320f2d;};'use strict';var Sequelize=require(_0x5d2c('0x0'));module[_0x5d2c('0x1')]={'name':{'type':Sequelize[_0x5d2c('0x2')]},'description':{'type':Sequelize[_0x5d2c('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index 54dc088..cbec3a9 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 _0xfb51=['../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Intervals','UserProfileResource','stack','name','send','index','map','Interval','fieldName','type','model','query','keys','intersection','attributes','fields','length','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','filters','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','IntervalId','getIntervals','findOne','rawAttributes','pick','hasOwnProperty','nolimit','addIntervals','sequelize','bulkCreate','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0xd99802,_0x2e8258){var _0x4130e6=function(_0x319851){while(--_0x319851){_0xd99802['push'](_0xd99802['shift']());}};_0x4130e6(++_0x2e8258);}(_0xfb51,0x1c1));var _0x1fb5=function(_0x1da8f5,_0xc052c4){_0x1da8f5=_0x1da8f5-0x0;var _0x2973a4=_0xfb51[_0x1da8f5];return _0x2973a4;};'use strict';var emlformat=require(_0x1fb5('0x0'));var rimraf=require(_0x1fb5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1fb5('0x2'));var rp=require(_0x1fb5('0x3'));var moment=require(_0x1fb5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1fb5('0x5'));var util=require(_0x1fb5('0x6'));var path=require(_0x1fb5('0x7'));var sox=require(_0x1fb5('0x8'));var csv=require(_0x1fb5('0x9'));var ejs=require(_0x1fb5('0xa'));var fs=require('fs');var fs_extra=require(_0x1fb5('0xb'));var _=require(_0x1fb5('0xc'));var squel=require(_0x1fb5('0xd'));var crypto=require(_0x1fb5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1fb5('0xf'));var toCsv=require(_0x1fb5('0x9'));var querystring=require(_0x1fb5('0x10'));var Papa=require(_0x1fb5('0x11'));var Redis=require('ioredis');var authService=require(_0x1fb5('0x12'));var qs=require(_0x1fb5('0x13'));var as=require(_0x1fb5('0x14'));var hardwareService=require(_0x1fb5('0x15'));var logger=require(_0x1fb5('0x16'))(_0x1fb5('0x17'));var utils=require('../../config/utils');var config=require(_0x1fb5('0x18'));var licenseUtil=require(_0x1fb5('0x19'));var db=require(_0x1fb5('0x1a'))['db'];var extensions=require(_0x1fb5('0x1b'));function respondWithStatusCode(_0x1bce85,_0x9eedf5){_0x9eedf5=_0x9eedf5||0xcc;return function(_0x57358a){if(_0x57358a){return _0x1bce85[_0x1fb5('0x1c')](_0x9eedf5);}return _0x1bce85['status'](_0x9eedf5)[_0x1fb5('0x1d')]();};}function respondWithResult(_0x2d5cbd,_0x12f73c){_0x12f73c=_0x12f73c||0xc8;return function(_0x4cff07){if(_0x4cff07){return _0x2d5cbd[_0x1fb5('0x1e')](_0x12f73c)[_0x1fb5('0x1f')](_0x4cff07);}};}function respondWithFilteredResult(_0x1ec1d7,_0x21563d){return function(_0x405854){if(_0x405854){var _0x57afd8=typeof _0x21563d[_0x1fb5('0x20')]==='undefined'&&typeof _0x21563d[_0x1fb5('0x21')]===_0x1fb5('0x22');var _0xf3caba=_0x405854['count'];var _0x50e92e=_0x57afd8?0x0:_0x21563d['offset'];var _0x7a4c81=_0x57afd8?_0x405854[_0x1fb5('0x23')]:_0x21563d[_0x1fb5('0x20')]+_0x21563d[_0x1fb5('0x21')];var _0x12c399;if(_0x7a4c81>=_0xf3caba){_0x7a4c81=_0xf3caba;_0x12c399=0xc8;}else{_0x12c399=0xce;}_0x1ec1d7[_0x1fb5('0x1e')](_0x12c399);return _0x1ec1d7[_0x1fb5('0x24')](_0x1fb5('0x25'),_0x50e92e+'-'+_0x7a4c81+'/'+_0xf3caba)['json'](_0x405854);}return null;};}function patchUpdates(_0x82d23b){return function(_0x1d2c37){try{jsonpatch[_0x1fb5('0x26')](_0x1d2c37,_0x82d23b,!![]);}catch(_0x3b6ea8){return BPromise[_0x1fb5('0x27')](_0x3b6ea8);}return _0x1d2c37[_0x1fb5('0x28')]();};}function saveUpdates(_0x2f840a,_0x430000){return function(_0x4b2a8a){if(_0x4b2a8a){return _0x4b2a8a['update'](_0x2f840a)[_0x1fb5('0x29')](function(_0x5e1839){return _0x5e1839;});}return null;};}function removeEntity(_0x597170,_0x131132){return function(_0x12354b){if(_0x12354b){return _0x12354b[_0x1fb5('0x2a')]()[_0x1fb5('0x29')](function(){var _0x367ac3=_0x12354b['get']({'plain':!![]});var _0x39bdaf=_0x1fb5('0x2b');return db[_0x1fb5('0x2c')]['destroy']({'where':{'type':_0x39bdaf,'resourceId':_0x367ac3['id']}})['then'](function(){return _0x12354b;});})['then'](function(){_0x597170['status'](0xcc)[_0x1fb5('0x1d')]();});}};}function handleEntityNotFound(_0x130527,_0x24158a){return function(_0x7279f1){if(!_0x7279f1){_0x130527['sendStatus'](0x194);}return _0x7279f1;};}function handleError(_0x56dd0b,_0x3032f9){_0x3032f9=_0x3032f9||0x1f4;return function(_0x5bb020){logger['error'](_0x5bb020[_0x1fb5('0x2d')]);if(_0x5bb020['name']){delete _0x5bb020[_0x1fb5('0x2e')];}_0x56dd0b[_0x1fb5('0x1e')](_0x3032f9)[_0x1fb5('0x2f')](_0x5bb020);};}exports[_0x1fb5('0x30')]=function(_0xa954e5,_0x35b73a){var _0x505572={},_0x30be29={},_0x409591={'count':0x0,'rows':[]};var _0x1f83a7=_[_0x1fb5('0x31')](db[_0x1fb5('0x32')]['rawAttributes'],function(_0x1e22b3){return{'name':_0x1e22b3[_0x1fb5('0x33')],'type':_0x1e22b3[_0x1fb5('0x34')]['key']};});_0x30be29[_0x1fb5('0x35')]=_[_0x1fb5('0x31')](_0x1f83a7,_0x1fb5('0x2e'));_0x30be29[_0x1fb5('0x36')]=_[_0x1fb5('0x37')](_0xa954e5[_0x1fb5('0x36')]);_0x30be29['filters']=_[_0x1fb5('0x38')](_0x30be29['model'],_0x30be29['query']);_0x505572[_0x1fb5('0x39')]=_[_0x1fb5('0x38')](_0x30be29[_0x1fb5('0x35')],qs[_0x1fb5('0x3a')](_0xa954e5[_0x1fb5('0x36')][_0x1fb5('0x3a')]));_0x505572[_0x1fb5('0x39')]=_0x505572[_0x1fb5('0x39')][_0x1fb5('0x3b')]?_0x505572['attributes']:_0x30be29[_0x1fb5('0x35')];if(!_0xa954e5[_0x1fb5('0x36')]['hasOwnProperty']('nolimit')){_0x505572['limit']=qs[_0x1fb5('0x21')](_0xa954e5[_0x1fb5('0x36')][_0x1fb5('0x21')]);_0x505572[_0x1fb5('0x20')]=qs['offset'](_0xa954e5[_0x1fb5('0x36')]['offset']);}_0x505572[_0x1fb5('0x3c')]=qs['sort'](_0xa954e5[_0x1fb5('0x36')][_0x1fb5('0x3d')]);_0x505572[_0x1fb5('0x3e')]=qs['filters'](_['pick'](_0xa954e5['query'],_0x30be29['filters']),_0x1f83a7);if(_0xa954e5[_0x1fb5('0x36')][_0x1fb5('0x3f')]){_0x505572[_0x1fb5('0x3e')]=_['merge'](_0x505572[_0x1fb5('0x3e')],{'$or':_['map'](_0x1f83a7,function(_0x9f9ca){if(_0x9f9ca[_0x1fb5('0x34')]!==_0x1fb5('0x40')){var _0x40fa37={};_0x40fa37[_0x9f9ca[_0x1fb5('0x2e')]]={'$like':'%'+_0xa954e5[_0x1fb5('0x36')][_0x1fb5('0x3f')]+'%'};return _0x40fa37;}})});}_0x505572=_[_0x1fb5('0x41')]({},_0x505572,_0xa954e5[_0x1fb5('0x42')]);var _0x459100={'where':_0x505572[_0x1fb5('0x3e')]};return db['Interval'][_0x1fb5('0x23')](_0x459100)[_0x1fb5('0x29')](function(_0x1a89ae){_0x409591[_0x1fb5('0x23')]=_0x1a89ae;if(_0xa954e5[_0x1fb5('0x36')][_0x1fb5('0x43')]){_0x505572[_0x1fb5('0x44')]=[{'all':!![]}];}return db[_0x1fb5('0x32')][_0x1fb5('0x45')](_0x505572);})[_0x1fb5('0x29')](function(_0x2952c4){_0x409591[_0x1fb5('0x46')]=_0x2952c4;return _0x409591;})[_0x1fb5('0x29')](respondWithFilteredResult(_0x35b73a,_0x505572))['catch'](handleError(_0x35b73a,null));};exports[_0x1fb5('0x47')]=function(_0x191db3,_0x5ba9f4){var _0x335956={'raw':!![],'where':{'id':_0x191db3[_0x1fb5('0x48')]['id']}},_0x458a5d={};_0x458a5d[_0x1fb5('0x35')]=_[_0x1fb5('0x37')](db[_0x1fb5('0x32')]['rawAttributes']);_0x458a5d[_0x1fb5('0x36')]=_['keys'](_0x191db3[_0x1fb5('0x36')]);_0x458a5d[_0x1fb5('0x49')]=_[_0x1fb5('0x38')](_0x458a5d[_0x1fb5('0x35')],_0x458a5d['query']);_0x335956['attributes']=_[_0x1fb5('0x38')](_0x458a5d[_0x1fb5('0x35')],qs['fields'](_0x191db3[_0x1fb5('0x36')][_0x1fb5('0x3a')]));_0x335956['attributes']=_0x335956[_0x1fb5('0x39')][_0x1fb5('0x3b')]?_0x335956[_0x1fb5('0x39')]:_0x458a5d[_0x1fb5('0x35')];if(_0x191db3[_0x1fb5('0x36')]['includeAll']){_0x335956[_0x1fb5('0x44')]=[{'all':!![]}];}_0x335956=_['merge']({},_0x335956,_0x191db3['options']);return db[_0x1fb5('0x32')][_0x1fb5('0x4a')](_0x335956)[_0x1fb5('0x29')](handleEntityNotFound(_0x5ba9f4,null))[_0x1fb5('0x29')](respondWithResult(_0x5ba9f4,null))['catch'](handleError(_0x5ba9f4,null));};exports['create']=function(_0x38a06c,_0x42354c){return db[_0x1fb5('0x32')][_0x1fb5('0x4b')](_0x38a06c[_0x1fb5('0x4c')],{})[_0x1fb5('0x29')](function(_0x5120a8){var _0x525798=_0x38a06c['user'][_0x1fb5('0x4d')]({'plain':!![]});if(!_0x525798)throw new Error(_0x1fb5('0x4e'));if(_0x525798[_0x1fb5('0x4f')]===_0x1fb5('0x50')){var _0x520827=_0x5120a8[_0x1fb5('0x4d')]({'plain':!![]});var _0x547849=_0x1fb5('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x547849,'userProfileId':_0x525798['userProfileId']},'raw':!![]})['then'](function(_0x2fa9ee){if(_0x2fa9ee&&_0x2fa9ee['autoAssociation']===0x0){return db[_0x1fb5('0x2c')][_0x1fb5('0x4b')]({'name':_0x520827['name'],'resourceId':_0x520827['id'],'type':_0x2fa9ee['name'],'sectionId':_0x2fa9ee['id']},{})['then'](function(){return _0x5120a8;});}else{return _0x5120a8;}})[_0x1fb5('0x51')](function(_0x38e9d7){logger[_0x1fb5('0x52')](_0x1fb5('0x53'),_0x38e9d7);throw _0x38e9d7;});}return _0x5120a8;})[_0x1fb5('0x29')](respondWithResult(_0x42354c,0xc9))[_0x1fb5('0x51')](handleError(_0x42354c,null));};exports[_0x1fb5('0x54')]=function(_0x4ea27d,_0x3c2c13){if(_0x4ea27d[_0x1fb5('0x4c')]['id']){delete _0x4ea27d[_0x1fb5('0x4c')]['id'];}return db[_0x1fb5('0x32')]['find']({'where':{'id':_0x4ea27d[_0x1fb5('0x48')]['id']}})[_0x1fb5('0x29')](handleEntityNotFound(_0x3c2c13,null))[_0x1fb5('0x29')](saveUpdates(_0x4ea27d[_0x1fb5('0x4c')],null))['then'](respondWithResult(_0x3c2c13,null))[_0x1fb5('0x51')](handleError(_0x3c2c13,null));};exports['destroy']=function(_0x254b96,_0x40062c){return db[_0x1fb5('0x32')]['find']({'where':{'id':_0x254b96[_0x1fb5('0x48')]['id']}})[_0x1fb5('0x29')](handleEntityNotFound(_0x40062c,null))[_0x1fb5('0x29')](removeEntity(_0x40062c,null))['catch'](handleError(_0x40062c,null));};exports['addInterval']=function(_0x272fb6,_0x33a6d4,_0x50b244){if(_0x272fb6[_0x1fb5('0x4c')]['id']){delete _0x272fb6[_0x1fb5('0x4c')]['id'];}return db[_0x1fb5('0x32')][_0x1fb5('0x4a')]({'where':{'id':_0x272fb6['params']['id']}})[_0x1fb5('0x29')](handleEntityNotFound(_0x33a6d4,null))[_0x1fb5('0x29')](function(_0x3aa433){if(_0x3aa433){_0x272fb6['body'][_0x1fb5('0x55')]=_0x3aa433['id'];return db[_0x1fb5('0x32')][_0x1fb5('0x4b')](_0x272fb6[_0x1fb5('0x4c')]);}})[_0x1fb5('0x29')](respondWithResult(_0x33a6d4,null))['catch'](handleError(_0x33a6d4,null));};exports[_0x1fb5('0x56')]=function(_0x683c0f,_0x138be7,_0x2fce3e){var _0x4b68ec={};var _0x144ed3={};var _0x97eb51;var _0x39934d;return db[_0x1fb5('0x32')][_0x1fb5('0x57')]({'where':{'id':_0x683c0f['params']['id']}})[_0x1fb5('0x29')](handleEntityNotFound(_0x138be7,null))[_0x1fb5('0x29')](function(_0x4aa581){if(_0x4aa581){_0x97eb51=_0x4aa581;_0x144ed3['model']=_[_0x1fb5('0x37')](db[_0x1fb5('0x32')][_0x1fb5('0x58')]);_0x144ed3[_0x1fb5('0x36')]=_[_0x1fb5('0x37')](_0x683c0f[_0x1fb5('0x36')]);_0x144ed3['filters']=_['intersection'](_0x144ed3[_0x1fb5('0x35')],_0x144ed3[_0x1fb5('0x36')]);_0x4b68ec[_0x1fb5('0x39')]=_[_0x1fb5('0x38')](_0x144ed3[_0x1fb5('0x35')],qs['fields'](_0x683c0f[_0x1fb5('0x36')]['fields']));_0x4b68ec['attributes']=_0x4b68ec[_0x1fb5('0x39')][_0x1fb5('0x3b')]?_0x4b68ec[_0x1fb5('0x39')]:_0x144ed3[_0x1fb5('0x35')];_0x4b68ec[_0x1fb5('0x3c')]=qs[_0x1fb5('0x3d')](_0x683c0f['query'][_0x1fb5('0x3d')]);_0x4b68ec['where']=qs[_0x1fb5('0x49')](_[_0x1fb5('0x59')](_0x683c0f[_0x1fb5('0x36')],_0x144ed3[_0x1fb5('0x49')]));if(_0x683c0f['query'][_0x1fb5('0x3f')]){_0x4b68ec['where']=_[_0x1fb5('0x41')](_0x4b68ec['where'],{'$or':_['map'](_0x4b68ec[_0x1fb5('0x39')],function(_0x3cd194){var _0x568dc0={};_0x568dc0[_0x3cd194]={'$like':'%'+_0x683c0f['query']['filter']+'%'};return _0x568dc0;})});}_0x4b68ec=_[_0x1fb5('0x41')]({},_0x4b68ec,_0x683c0f[_0x1fb5('0x42')]);return _0x97eb51['getIntervals'](_0x4b68ec);}})[_0x1fb5('0x29')](function(_0x15c6d8){if(_0x15c6d8){_0x39934d=_0x15c6d8[_0x1fb5('0x3b')];if(!_0x683c0f[_0x1fb5('0x36')][_0x1fb5('0x5a')](_0x1fb5('0x5b'))){_0x4b68ec[_0x1fb5('0x21')]=qs[_0x1fb5('0x21')](_0x683c0f[_0x1fb5('0x36')][_0x1fb5('0x21')]);_0x4b68ec[_0x1fb5('0x20')]=qs[_0x1fb5('0x20')](_0x683c0f[_0x1fb5('0x36')]['offset']);}return _0x97eb51[_0x1fb5('0x56')](_0x4b68ec);}})['then'](function(_0x9d38e0){if(_0x9d38e0){return _0x9d38e0?{'count':_0x39934d,'rows':_0x9d38e0}:null;}})[_0x1fb5('0x29')](respondWithResult(_0x138be7,null))['catch'](handleError(_0x138be7,null));};exports[_0x1fb5('0x5c')]=function(_0x5e79a0,_0x273c57,_0x38b36a){return db[_0x1fb5('0x32')][_0x1fb5('0x57')]({'where':{'id':_0x5e79a0['params']['id']}})[_0x1fb5('0x29')](handleEntityNotFound(_0x273c57,null))[_0x1fb5('0x29')](function(_0x40b73e){if(_0x40b73e){return db[_0x1fb5('0x5d')]['transaction'](function(_0x4c398a){return db[_0x1fb5('0x32')]['destroy']({'where':{'IntervalId':_0x5e79a0[_0x1fb5('0x48')]['id']},'transaction':_0x4c398a})['then'](function(_0x3825d6){var _0x5ca3ef=_[_0x1fb5('0x31')](_0x5e79a0[_0x1fb5('0x4c')],function(_0x279082){delete _0x279082['id'];_0x279082['IntervalId']=_0x5e79a0[_0x1fb5('0x48')]['id'];return _0x279082;});return db[_0x1fb5('0x32')][_0x1fb5('0x5e')](_0x5ca3ef,{'transaction':_0x4c398a});});})[_0x1fb5('0x29')](function(){return db[_0x1fb5('0x32')][_0x1fb5('0x45')]({'where':{'IntervalId':_0x5e79a0[_0x1fb5('0x48')]['id']}});});}})[_0x1fb5('0x29')](respondWithResult(_0x273c57,null))['catch'](handleError(_0x273c57,null));}; \ No newline at end of file +var _0x22af=['count','set','Content-Range','reject','update','then','destroy','get','UserProfileResource','name','send','index','Interval','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','params','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Intervals','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','getIntervals','addIntervals','findOne','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit'];(function(_0x3c7c5a,_0x49abf6){var _0xbd9192=function(_0x39a46c){while(--_0x39a46c){_0x3c7c5a['push'](_0x3c7c5a['shift']());}};_0xbd9192(++_0x49abf6);}(_0x22af,0x14d));var _0xf22a=function(_0x38782c,_0x5c9fef){_0x38782c=_0x38782c-0x0;var _0x3708bf=_0x22af[_0x38782c];return _0x3708bf;};'use strict';var emlformat=require(_0xf22a('0x0'));var rimraf=require(_0xf22a('0x1'));var zipdir=require(_0xf22a('0x2'));var jsonpatch=require(_0xf22a('0x3'));var rp=require('request-promise');var moment=require(_0xf22a('0x4'));var BPromise=require(_0xf22a('0x5'));var Mustache=require(_0xf22a('0x6'));var util=require(_0xf22a('0x7'));var path=require(_0xf22a('0x8'));var sox=require(_0xf22a('0x9'));var csv=require('to-csv');var ejs=require(_0xf22a('0xa'));var fs=require('fs');var fs_extra=require(_0xf22a('0xb'));var _=require(_0xf22a('0xc'));var squel=require(_0xf22a('0xd'));var crypto=require('crypto');var jsforce=require(_0xf22a('0xe'));var deskjs=require(_0xf22a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf22a('0x10'));var Papa=require(_0xf22a('0x11'));var Redis=require(_0xf22a('0x12'));var authService=require(_0xf22a('0x13'));var qs=require(_0xf22a('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf22a('0x15'));var logger=require(_0xf22a('0x16'))(_0xf22a('0x17'));var utils=require(_0xf22a('0x18'));var config=require(_0xf22a('0x19'));var licenseUtil=require(_0xf22a('0x1a'));var db=require(_0xf22a('0x1b'))['db'];var extensions=require(_0xf22a('0x1c'));function respondWithStatusCode(_0x3fcba6,_0x1c2e47){_0x1c2e47=_0x1c2e47||0xcc;return function(_0x1df00e){if(_0x1df00e){return _0x3fcba6[_0xf22a('0x1d')](_0x1c2e47);}return _0x3fcba6['status'](_0x1c2e47)[_0xf22a('0x1e')]();};}function respondWithResult(_0x8f2d9b,_0x2bd75e){_0x2bd75e=_0x2bd75e||0xc8;return function(_0x2db83d){if(_0x2db83d){return _0x8f2d9b[_0xf22a('0x1f')](_0x2bd75e)[_0xf22a('0x20')](_0x2db83d);}};}function respondWithFilteredResult(_0x211ff4,_0x28a67e){return function(_0x150834){if(_0x150834){var _0x554002=typeof _0x28a67e[_0xf22a('0x21')]==='undefined'&&typeof _0x28a67e[_0xf22a('0x22')]==='undefined';var _0x453196=_0x150834[_0xf22a('0x23')];var _0x31253c=_0x554002?0x0:_0x28a67e[_0xf22a('0x21')];var _0xe2da93=_0x554002?_0x150834[_0xf22a('0x23')]:_0x28a67e[_0xf22a('0x21')]+_0x28a67e[_0xf22a('0x22')];var _0x2ee974;if(_0xe2da93>=_0x453196){_0xe2da93=_0x453196;_0x2ee974=0xc8;}else{_0x2ee974=0xce;}_0x211ff4[_0xf22a('0x1f')](_0x2ee974);return _0x211ff4[_0xf22a('0x24')](_0xf22a('0x25'),_0x31253c+'-'+_0xe2da93+'/'+_0x453196)[_0xf22a('0x20')](_0x150834);}return null;};}function patchUpdates(_0x46bf50){return function(_0x1d15c5){try{jsonpatch['apply'](_0x1d15c5,_0x46bf50,!![]);}catch(_0x3bf90c){return BPromise[_0xf22a('0x26')](_0x3bf90c);}return _0x1d15c5['save']();};}function saveUpdates(_0x44d726,_0x5e7f08){return function(_0x3bdbc2){if(_0x3bdbc2){return _0x3bdbc2[_0xf22a('0x27')](_0x44d726)[_0xf22a('0x28')](function(_0xb341f4){return _0xb341f4;});}return null;};}function removeEntity(_0x47c546,_0x246f85){return function(_0x5a61d4){if(_0x5a61d4){return _0x5a61d4[_0xf22a('0x29')]()[_0xf22a('0x28')](function(){var _0x2d8f4a=_0x5a61d4[_0xf22a('0x2a')]({'plain':!![]});var _0x42a5d8='Intervals';return db[_0xf22a('0x2b')]['destroy']({'where':{'type':_0x42a5d8,'resourceId':_0x2d8f4a['id']}})[_0xf22a('0x28')](function(){return _0x5a61d4;});})[_0xf22a('0x28')](function(){_0x47c546[_0xf22a('0x1f')](0xcc)[_0xf22a('0x1e')]();});}};}function handleEntityNotFound(_0x44a1e1,_0x28d2ef){return function(_0x191b9c){if(!_0x191b9c){_0x44a1e1[_0xf22a('0x1d')](0x194);}return _0x191b9c;};}function handleError(_0x254e3f,_0x589e4d){_0x589e4d=_0x589e4d||0x1f4;return function(_0x2a47be){logger['error'](_0x2a47be['stack']);if(_0x2a47be['name']){delete _0x2a47be[_0xf22a('0x2c')];}_0x254e3f[_0xf22a('0x1f')](_0x589e4d)[_0xf22a('0x2d')](_0x2a47be);};}exports[_0xf22a('0x2e')]=function(_0x2eae93,_0x5e92e9){var _0x89acc1={},_0x387703={},_0x3bb78c={'count':0x0,'rows':[]};var _0x20e73a=_['map'](db[_0xf22a('0x2f')]['rawAttributes'],function(_0x51a0fe){return{'name':_0x51a0fe[_0xf22a('0x30')],'type':_0x51a0fe[_0xf22a('0x31')][_0xf22a('0x32')]};});_0x387703[_0xf22a('0x33')]=_[_0xf22a('0x34')](_0x20e73a,_0xf22a('0x2c'));_0x387703['query']=_[_0xf22a('0x35')](_0x2eae93[_0xf22a('0x36')]);_0x387703[_0xf22a('0x37')]=_[_0xf22a('0x38')](_0x387703[_0xf22a('0x33')],_0x387703[_0xf22a('0x36')]);_0x89acc1[_0xf22a('0x39')]=_[_0xf22a('0x38')](_0x387703[_0xf22a('0x33')],qs[_0xf22a('0x3a')](_0x2eae93[_0xf22a('0x36')]['fields']));_0x89acc1[_0xf22a('0x39')]=_0x89acc1['attributes']['length']?_0x89acc1[_0xf22a('0x39')]:_0x387703[_0xf22a('0x33')];if(!_0x2eae93[_0xf22a('0x36')][_0xf22a('0x3b')](_0xf22a('0x3c'))){_0x89acc1[_0xf22a('0x22')]=qs[_0xf22a('0x22')](_0x2eae93[_0xf22a('0x36')][_0xf22a('0x22')]);_0x89acc1[_0xf22a('0x21')]=qs[_0xf22a('0x21')](_0x2eae93[_0xf22a('0x36')]['offset']);}_0x89acc1['order']=qs[_0xf22a('0x3d')](_0x2eae93[_0xf22a('0x36')][_0xf22a('0x3d')]);_0x89acc1[_0xf22a('0x3e')]=qs[_0xf22a('0x37')](_[_0xf22a('0x3f')](_0x2eae93[_0xf22a('0x36')],_0x387703['filters']),_0x20e73a);if(_0x2eae93['query'][_0xf22a('0x40')]){_0x89acc1[_0xf22a('0x3e')]=_[_0xf22a('0x41')](_0x89acc1[_0xf22a('0x3e')],{'$or':_[_0xf22a('0x34')](_0x20e73a,function(_0x4e5045){if(_0x4e5045['type']!==_0xf22a('0x42')){var _0x2bc998={};_0x2bc998[_0x4e5045['name']]={'$like':'%'+_0x2eae93[_0xf22a('0x36')][_0xf22a('0x40')]+'%'};return _0x2bc998;}})});}_0x89acc1=_[_0xf22a('0x41')]({},_0x89acc1,_0x2eae93['options']);var _0x476f75={'where':_0x89acc1[_0xf22a('0x3e')]};return db[_0xf22a('0x2f')]['count'](_0x476f75)[_0xf22a('0x28')](function(_0x23d0b3){_0x3bb78c['count']=_0x23d0b3;if(_0x2eae93['query'][_0xf22a('0x43')]){_0x89acc1[_0xf22a('0x44')]=[{'all':!![]}];}return db[_0xf22a('0x2f')][_0xf22a('0x45')](_0x89acc1);})['then'](function(_0x426175){_0x3bb78c[_0xf22a('0x46')]=_0x426175;return _0x3bb78c;})[_0xf22a('0x28')](respondWithFilteredResult(_0x5e92e9,_0x89acc1))['catch'](handleError(_0x5e92e9,null));};exports['show']=function(_0x1a21f5,_0x378013){var _0x43864d={'raw':!![],'where':{'id':_0x1a21f5[_0xf22a('0x47')]['id']}},_0x23e447={};_0x23e447[_0xf22a('0x33')]=_[_0xf22a('0x35')](db[_0xf22a('0x2f')]['rawAttributes']);_0x23e447[_0xf22a('0x36')]=_[_0xf22a('0x35')](_0x1a21f5[_0xf22a('0x36')]);_0x23e447[_0xf22a('0x37')]=_[_0xf22a('0x38')](_0x23e447[_0xf22a('0x33')],_0x23e447[_0xf22a('0x36')]);_0x43864d[_0xf22a('0x39')]=_['intersection'](_0x23e447[_0xf22a('0x33')],qs[_0xf22a('0x3a')](_0x1a21f5['query']['fields']));_0x43864d[_0xf22a('0x39')]=_0x43864d[_0xf22a('0x39')]['length']?_0x43864d['attributes']:_0x23e447[_0xf22a('0x33')];if(_0x1a21f5[_0xf22a('0x36')][_0xf22a('0x43')]){_0x43864d['include']=[{'all':!![]}];}_0x43864d=_[_0xf22a('0x41')]({},_0x43864d,_0x1a21f5[_0xf22a('0x48')]);return db[_0xf22a('0x2f')][_0xf22a('0x49')](_0x43864d)[_0xf22a('0x28')](handleEntityNotFound(_0x378013,null))['then'](respondWithResult(_0x378013,null))[_0xf22a('0x4a')](handleError(_0x378013,null));};exports[_0xf22a('0x4b')]=function(_0x12186b,_0x283b61){return db['Interval']['create'](_0x12186b['body'],{})['then'](function(_0x4e66d8){var _0x220ac6=_0x12186b[_0xf22a('0x4c')][_0xf22a('0x2a')]({'plain':!![]});if(!_0x220ac6)throw new Error(_0xf22a('0x4d'));if(_0x220ac6['role']==='user'){var _0x52f05f=_0x4e66d8[_0xf22a('0x2a')]({'plain':!![]});var _0x1a6894=_0xf22a('0x4e');return db[_0xf22a('0x4f')]['find']({'where':{'name':_0x1a6894,'userProfileId':_0x220ac6['userProfileId']},'raw':!![]})[_0xf22a('0x28')](function(_0x15d014){if(_0x15d014&&_0x15d014[_0xf22a('0x50')]===0x0){return db[_0xf22a('0x2b')][_0xf22a('0x4b')]({'name':_0x52f05f[_0xf22a('0x2c')],'resourceId':_0x52f05f['id'],'type':_0x15d014[_0xf22a('0x2c')],'sectionId':_0x15d014['id']},{})[_0xf22a('0x28')](function(){return _0x4e66d8;});}else{return _0x4e66d8;}})['catch'](function(_0x7e9f05){logger[_0xf22a('0x51')](_0xf22a('0x52'),_0x7e9f05);throw _0x7e9f05;});}return _0x4e66d8;})[_0xf22a('0x28')](respondWithResult(_0x283b61,0xc9))['catch'](handleError(_0x283b61,null));};exports[_0xf22a('0x27')]=function(_0xbcad39,_0x31bfca){if(_0xbcad39[_0xf22a('0x53')]['id']){delete _0xbcad39[_0xf22a('0x53')]['id'];}return db[_0xf22a('0x2f')][_0xf22a('0x49')]({'where':{'id':_0xbcad39['params']['id']}})[_0xf22a('0x28')](handleEntityNotFound(_0x31bfca,null))[_0xf22a('0x28')](saveUpdates(_0xbcad39['body'],null))[_0xf22a('0x28')](respondWithResult(_0x31bfca,null))['catch'](handleError(_0x31bfca,null));};exports[_0xf22a('0x29')]=function(_0x2cca9f,_0x4bff33){return db[_0xf22a('0x2f')][_0xf22a('0x49')]({'where':{'id':_0x2cca9f[_0xf22a('0x47')]['id']}})[_0xf22a('0x28')](handleEntityNotFound(_0x4bff33,null))[_0xf22a('0x28')](removeEntity(_0x4bff33,null))[_0xf22a('0x4a')](handleError(_0x4bff33,null));};exports[_0xf22a('0x54')]=function(_0x30b5d1,_0x3ffee7,_0x593e0d){if(_0x30b5d1['body']['id']){delete _0x30b5d1[_0xf22a('0x53')]['id'];}return db[_0xf22a('0x2f')][_0xf22a('0x49')]({'where':{'id':_0x30b5d1[_0xf22a('0x47')]['id']}})['then'](handleEntityNotFound(_0x3ffee7,null))['then'](function(_0x356230){if(_0x356230){_0x30b5d1[_0xf22a('0x53')]['IntervalId']=_0x356230['id'];return db[_0xf22a('0x2f')][_0xf22a('0x4b')](_0x30b5d1['body']);}})[_0xf22a('0x28')](respondWithResult(_0x3ffee7,null))[_0xf22a('0x4a')](handleError(_0x3ffee7,null));};exports[_0xf22a('0x55')]=function(_0x4cdab9,_0xaa1c4d,_0x453155){var _0x2620fe={};var _0x55f306={};var _0x33b9a9;var _0x44fab0;return db[_0xf22a('0x2f')]['findOne']({'where':{'id':_0x4cdab9[_0xf22a('0x47')]['id']}})[_0xf22a('0x28')](handleEntityNotFound(_0xaa1c4d,null))[_0xf22a('0x28')](function(_0x4c8687){if(_0x4c8687){_0x33b9a9=_0x4c8687;_0x55f306[_0xf22a('0x33')]=_[_0xf22a('0x35')](db[_0xf22a('0x2f')]['rawAttributes']);_0x55f306[_0xf22a('0x36')]=_[_0xf22a('0x35')](_0x4cdab9[_0xf22a('0x36')]);_0x55f306[_0xf22a('0x37')]=_[_0xf22a('0x38')](_0x55f306[_0xf22a('0x33')],_0x55f306[_0xf22a('0x36')]);_0x2620fe[_0xf22a('0x39')]=_[_0xf22a('0x38')](_0x55f306['model'],qs['fields'](_0x4cdab9[_0xf22a('0x36')][_0xf22a('0x3a')]));_0x2620fe[_0xf22a('0x39')]=_0x2620fe[_0xf22a('0x39')]['length']?_0x2620fe[_0xf22a('0x39')]:_0x55f306[_0xf22a('0x33')];_0x2620fe['order']=qs['sort'](_0x4cdab9[_0xf22a('0x36')][_0xf22a('0x3d')]);_0x2620fe[_0xf22a('0x3e')]=qs[_0xf22a('0x37')](_[_0xf22a('0x3f')](_0x4cdab9[_0xf22a('0x36')],_0x55f306['filters']));if(_0x4cdab9['query'][_0xf22a('0x40')]){_0x2620fe[_0xf22a('0x3e')]=_[_0xf22a('0x41')](_0x2620fe['where'],{'$or':_[_0xf22a('0x34')](_0x2620fe[_0xf22a('0x39')],function(_0x3ff51c){var _0x3eeea9={};_0x3eeea9[_0x3ff51c]={'$like':'%'+_0x4cdab9[_0xf22a('0x36')][_0xf22a('0x40')]+'%'};return _0x3eeea9;})});}_0x2620fe=_['merge']({},_0x2620fe,_0x4cdab9[_0xf22a('0x48')]);return _0x33b9a9[_0xf22a('0x55')](_0x2620fe);}})[_0xf22a('0x28')](function(_0xefc646){if(_0xefc646){_0x44fab0=_0xefc646['length'];if(!_0x4cdab9[_0xf22a('0x36')][_0xf22a('0x3b')](_0xf22a('0x3c'))){_0x2620fe[_0xf22a('0x22')]=qs[_0xf22a('0x22')](_0x4cdab9['query'][_0xf22a('0x22')]);_0x2620fe[_0xf22a('0x21')]=qs[_0xf22a('0x21')](_0x4cdab9[_0xf22a('0x36')][_0xf22a('0x21')]);}return _0x33b9a9[_0xf22a('0x55')](_0x2620fe);}})['then'](function(_0x110cf1){if(_0x110cf1){return _0x110cf1?{'count':_0x44fab0,'rows':_0x110cf1}:null;}})[_0xf22a('0x28')](respondWithResult(_0xaa1c4d,null))['catch'](handleError(_0xaa1c4d,null));};exports[_0xf22a('0x56')]=function(_0x2a36ca,_0x4d7573,_0x778435){return db['Interval'][_0xf22a('0x57')]({'where':{'id':_0x2a36ca['params']['id']}})['then'](handleEntityNotFound(_0x4d7573,null))['then'](function(_0x4355c1){if(_0x4355c1){return db[_0xf22a('0x58')][_0xf22a('0x59')](function(_0x24a684){return db[_0xf22a('0x2f')][_0xf22a('0x29')]({'where':{'IntervalId':_0x2a36ca[_0xf22a('0x47')]['id']},'transaction':_0x24a684})[_0xf22a('0x28')](function(_0x367e6b){var _0x2d3201=_[_0xf22a('0x34')](_0x2a36ca['body'],function(_0xd55774){delete _0xd55774['id'];_0xd55774[_0xf22a('0x5a')]=_0x2a36ca[_0xf22a('0x47')]['id'];return _0xd55774;});return db['Interval'][_0xf22a('0x5b')](_0x2d3201,{'transaction':_0x24a684});});})['then'](function(){return db[_0xf22a('0x2f')][_0xf22a('0x45')]({'where':{'IntervalId':_0x2a36ca[_0xf22a('0x47')]['id']}});});}})[_0xf22a('0x28')](respondWithResult(_0x4d7573,null))[_0xf22a('0x4a')](handleError(_0x4d7573,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 933b38f..c73bb40 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 _0x0064=['tools_intervals','rewrite','interval','getIntervals','then','all','ifTime','reduce','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','iftime','define','Interval'];(function(_0x4e46f6,_0x519848){var _0x117b87=function(_0x18b7dd){while(--_0x18b7dd){_0x4e46f6['push'](_0x4e46f6['shift']());}};_0x117b87(++_0x519848);}(_0x0064,0x1ac));var _0x4006=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0064[_0x3dd15e];return _0x231fd0;};'use strict';var attributes=require(_0x4006('0x0'));var extensions=require(_0x4006('0x1'));var iftime=require(_0x4006('0x2'))[_0x4006('0x3')];module['exports']=function(_0x50461e){return _0x50461e[_0x4006('0x4')](_0x4006('0x5'),attributes,{'tableName':_0x4006('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x488df4){extensions['rewrite'](_0x50461e,_0x488df4);},'afterBulkCreate':function(_0x456a13,_0x40b6ee,_0x5d0b53){_0x5d0b53();extensions['rewrite'](_0x50461e,_0x456a13[0x0]);},'afterUpdate':function(_0x4e23ac){extensions[_0x4006('0x7')](_0x50461e,_0x4e23ac);},'afterDestroy':function(_0x37d01d){extensions[_0x4006('0x7')](_0x50461e,_0x37d01d);}},'instanceMethods':{'ifTime':function(_0x479534=undefined,_0x17a7b9=new Date()){if(typeof this[_0x4006('0x8')]==='string'){return iftime(this[_0x4006('0x8')],_0x479534,_0x17a7b9);}else{return this[_0x4006('0x9')]()[_0x4006('0xa')](function(_0x859277){return Promise[_0x4006('0xb')](_0x859277['map'](function(_0x402cb6){return _0x402cb6[_0x4006('0xc')](_0x479534,_0x17a7b9);}));})[_0x4006('0xa')](function(_0x318766){return _0x318766[_0x4006('0xd')](function(_0x5987cf,_0x5214a7){return _0x5987cf||_0x5214a7;},![]);});}}}});}; \ No newline at end of file +var _0xd545=['./interval.attributes','../../utils/iftime','define','tools_intervals','rewrite','interval','string','getIntervals','map','then'];(function(_0x38488c,_0x4bb115){var _0xecbfa0=function(_0x19b4cc){while(--_0x19b4cc){_0x38488c['push'](_0x38488c['shift']());}};_0xecbfa0(++_0x4bb115);}(_0xd545,0x1f4));var _0x5d54=function(_0x25794d,_0x85b5d1){_0x25794d=_0x25794d-0x0;var _0x4dea00=_0xd545[_0x25794d];return _0x4dea00;};'use strict';var attributes=require(_0x5d54('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0x5d54('0x1'))['iftime'];module['exports']=function(_0xe9f69b){return _0xe9f69b[_0x5d54('0x2')]('Interval',attributes,{'tableName':_0x5d54('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2590a8){extensions[_0x5d54('0x4')](_0xe9f69b,_0x2590a8);},'afterBulkCreate':function(_0x496dfd,_0x517ff2,_0x8960a1){_0x8960a1();extensions['rewrite'](_0xe9f69b,_0x496dfd[0x0]);},'afterUpdate':function(_0x1d20c1){extensions[_0x5d54('0x4')](_0xe9f69b,_0x1d20c1);},'afterDestroy':function(_0x4b5309){extensions[_0x5d54('0x4')](_0xe9f69b,_0x4b5309);}},'instanceMethods':{'ifTime':function(_0x4ba466=undefined,_0x452711=new Date()){if(typeof this[_0x5d54('0x5')]===_0x5d54('0x6')){return iftime(this[_0x5d54('0x5')],_0x4ba466,_0x452711);}else{return this[_0x5d54('0x7')]()['then'](function(_0x39e4ee){return Promise['all'](_0x39e4ee[_0x5d54('0x8')](function(_0x273490){return _0x273490['ifTime'](_0x4ba466,_0x452711);}));})[_0x5d54('0x9')](function(_0x5a8424){return _0x5a8424['reduce'](function(_0x2f8d28,_0x3b947b){return _0x2f8d28||_0x3b947b;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 188d814..c955a7d 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 _0xb5eb=['then','info','debug','catch','error','message','ShowInterval','find','stringify','all','ifTime','format','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','name','IntervalIftime','intervalIds','intervals','string','length','isArray','reduce','lodash','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval','options','raw','limit','include','map','model','attributes'];(function(_0x3e1d3c,_0x20de06){var _0x5804b1=function(_0x4f5f30){while(--_0x4f5f30){_0x3e1d3c['push'](_0x3e1d3c['shift']());}};_0x5804b1(++_0x20de06);}(_0xb5eb,0x1df));var _0xbb5e=function(_0x3f2d8e,_0x41ae5d){_0x3f2d8e=_0x3f2d8e-0x0;var _0x53809b=_0xb5eb[_0x3f2d8e];return _0x53809b;};'use strict';var _=require(_0xbb5e('0x0'));var util=require('util');var db=require(_0xbb5e('0x1'))['db'];var iftime=require(_0xbb5e('0x2'))[_0xbb5e('0x3')];var logger=require(_0xbb5e('0x4'))(_0xbb5e('0x5'));exports[_0xbb5e('0x6')]=function(_0x204e9a){var _0x5a92db=this;return new Promise(function(_0x3db503,_0x3e7759){return db[_0xbb5e('0x7')]['findAll']({'raw':_0x204e9a[_0xbb5e('0x8')]?_0x204e9a[_0xbb5e('0x8')][_0xbb5e('0x9')]===undefined?!![]:![]:!![],'where':_0x204e9a[_0xbb5e('0x8')]?_0x204e9a['options']['where']||null:null,'attributes':_0x204e9a[_0xbb5e('0x8')]?_0x204e9a[_0xbb5e('0x8')]['attributes']||null:null,'limit':_0x204e9a[_0xbb5e('0x8')]?_0x204e9a[_0xbb5e('0x8')][_0xbb5e('0xa')]||null:null,'include':_0x204e9a[_0xbb5e('0x8')]?_0x204e9a[_0xbb5e('0x8')][_0xbb5e('0xb')]?_[_0xbb5e('0xc')](_0x204e9a[_0xbb5e('0x8')][_0xbb5e('0xb')],function(_0x16d3df){return{'model':db[_0x16d3df[_0xbb5e('0xd')]],'as':_0x16d3df['as'],'attributes':_0x16d3df[_0xbb5e('0xe')],'include':_0x16d3df[_0xbb5e('0xb')]?_['map'](_0x16d3df[_0xbb5e('0xb')],function(_0x3a6c13){return{'model':db[_0x3a6c13['model']],'as':_0x3a6c13['as'],'attributes':_0x3a6c13[_0xbb5e('0xe')],'include':_0x3a6c13[_0xbb5e('0xb')]?_[_0xbb5e('0xc')](_0x3a6c13[_0xbb5e('0xb')],function(_0x4bb26c){return{'model':db[_0x4bb26c[_0xbb5e('0xd')]],'as':_0x4bb26c['as'],'attributes':_0x4bb26c[_0xbb5e('0xe')]};}):[]};}):[]};}):[]:[]})[_0xbb5e('0xf')](function(_0x1428df){logger[_0xbb5e('0x10')](_0xbb5e('0x6'),_0x204e9a);logger[_0xbb5e('0x11')]('GetInterval',_0x204e9a,JSON['stringify'](_0x1428df));_0x3db503(_0x1428df);})[_0xbb5e('0x12')](function(_0x115ebb){logger[_0xbb5e('0x13')](_0xbb5e('0x6'),_0x115ebb[_0xbb5e('0x14')],_0x204e9a);_0x3e7759(_0x5a92db['error'](0x1f4,_0x115ebb[_0xbb5e('0x14')]));});});};exports[_0xbb5e('0x15')]=function(_0x45d5bd){var _0x50b8c9=this;return new Promise(function(_0x107d47,_0x29e57f){return db[_0xbb5e('0x7')][_0xbb5e('0x16')]({'raw':_0x45d5bd[_0xbb5e('0x8')]?_0x45d5bd[_0xbb5e('0x8')][_0xbb5e('0x9')]===undefined?!![]:![]:!![],'where':_0x45d5bd['options']?_0x45d5bd[_0xbb5e('0x8')]['where']||null:null,'attributes':_0x45d5bd[_0xbb5e('0x8')]?_0x45d5bd[_0xbb5e('0x8')][_0xbb5e('0xe')]||null:null,'include':_0x45d5bd[_0xbb5e('0x8')]?_0x45d5bd[_0xbb5e('0x8')][_0xbb5e('0xb')]?_[_0xbb5e('0xc')](_0x45d5bd[_0xbb5e('0x8')]['include'],function(_0x1f988c){return{'model':db[_0x1f988c[_0xbb5e('0xd')]],'as':_0x1f988c['as'],'attributes':_0x1f988c[_0xbb5e('0xe')],'include':_0x1f988c[_0xbb5e('0xb')]?_[_0xbb5e('0xc')](_0x1f988c[_0xbb5e('0xb')],function(_0x39b4dc){return{'model':db[_0x39b4dc[_0xbb5e('0xd')]],'as':_0x39b4dc['as'],'attributes':_0x39b4dc[_0xbb5e('0xe')],'include':_0x39b4dc['include']?_['map'](_0x39b4dc[_0xbb5e('0xb')],function(_0x6c017b){return{'model':db[_0x6c017b[_0xbb5e('0xd')]],'as':_0x6c017b['as'],'attributes':_0x6c017b[_0xbb5e('0xe')]};}):[]};}):[]};}):[]:[]})[_0xbb5e('0xf')](function(_0x26472f){logger[_0xbb5e('0x10')](_0xbb5e('0x15'),_0x45d5bd);logger[_0xbb5e('0x11')](_0xbb5e('0x15'),_0x45d5bd,JSON[_0xbb5e('0x17')](_0x26472f));_0x107d47(_0x26472f);})[_0xbb5e('0x12')](function(_0x1b873d){logger[_0xbb5e('0x13')]('ShowInterval',_0x1b873d[_0xbb5e('0x14')],_0x45d5bd);_0x29e57f(_0x50b8c9[_0xbb5e('0x13')](0x1f4,_0x1b873d['message']));});});};function checkArrayOfIntervals(_0x120b06,_0x3cbd17){var _0x5b1eb3=[];return db['Interval']['findAll']({'where':{'id':_0x120b06}})[_0xbb5e('0xf')](function(_0x56bfca){_0x5b1eb3=_0x56bfca;return Promise[_0xbb5e('0x18')](_0x5b1eb3[_0xbb5e('0xc')](function(_0x1c430a){return _0x1c430a[_0xbb5e('0x19')](_0x3cbd17);}));})[_0xbb5e('0xf')](function(_0x679411){var _0x2ed27a=_0x679411['reduce'](function(_0x5b0edb,_0x1fc97c){return _0x5b0edb||_0x1fc97c;},![]);logger[_0xbb5e('0x10')](util[_0xbb5e('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x5b1eb3[_0xbb5e('0xc')](function(_0x24ad67){return _0x24ad67['name'];})[_0xbb5e('0x1b')](',\x20'),_0x5b1eb3['map'](function(_0x2b7c55){return _0x2b7c55['id'];})[_0xbb5e('0x1b')](',\x20')));return _0x2ed27a;});}function checkSingleInterval(_0x5d86ea,_0x6a948a){return db['Interval'][_0xbb5e('0x1c')](_0x5d86ea)[_0xbb5e('0xf')](function(_0x50af31){if(_0x50af31){logger[_0xbb5e('0x10')](util['format'](_0xbb5e('0x1d'),_0x50af31[_0xbb5e('0x1e')],_0x50af31['id']));return _0x50af31[_0xbb5e('0x19')](_0x6a948a);}});}exports[_0xbb5e('0x1f')]=function(_0x547e78){var _0x1d080f=_0x547e78[_0xbb5e('0x20')];var _0x40376b=Array['isArray'](_0x547e78[_0xbb5e('0x21')])?_0x547e78[_0xbb5e('0x21')]:typeof _0x547e78[_0xbb5e('0x21')]===_0xbb5e('0x22')?[_0x547e78[_0xbb5e('0x21')]]:[];var _0x28f83f=_0x547e78['timezone']||undefined;var _0x29e726=![];if(_0x40376b[_0xbb5e('0x23')]){logger[_0xbb5e('0x10')](util['format']('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x40376b['join'](';\x20')));}if(_0x28f83f){logger[_0xbb5e('0x10')](util[_0xbb5e('0x1a')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x28f83f));}logger['debug']('Iftime',_0x29e726);logger['silly']('IntervalIftime',_0x547e78);return Promise['resolve']()['then'](function(){if(Array[_0xbb5e('0x24')](_0x1d080f)){return checkArrayOfIntervals(_0x1d080f,_0x28f83f);}else if(_0x1d080f){return checkSingleInterval(_0x1d080f,_0x28f83f);}})[_0xbb5e('0xf')](function(_0x4f4e4f){var _0x378a1b=_0x40376b[_0xbb5e('0x25')](function(_0x612bf5,_0x121197){return _0x612bf5||iftime(_0x121197,_0x28f83f);},![]);_0x29e726=_0x4f4e4f||_0x378a1b;return _0x29e726;})[_0xbb5e('0x12')](function(_0x312a2e){logger[_0xbb5e('0x13')](_0xbb5e('0x1f'),_0x547e78,_0x312a2e);throw this[_0xbb5e('0x13')](0x1f4,_0x312a2e[_0xbb5e('0x14')]);});}; \ No newline at end of file +var _0x03b8=['reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','join','name','IntervalIftime','intervalIds','isArray','intervals','string','timezone','length','IntervalIftime:\x20timezone\x20=\x20%s','debug','resolve','lodash','util','../../mysqldb','iftime','rpc','GetInterval','Interval','findAll','options','where','limit','include','map','model','attributes','then','info','stringify','catch','message','error','ShowInterval','find','raw','ifTime'];(function(_0x4ec328,_0x31e00c){var _0x565272=function(_0x8839a8){while(--_0x8839a8){_0x4ec328['push'](_0x4ec328['shift']());}};_0x565272(++_0x31e00c);}(_0x03b8,0x1ef));var _0x803b=function(_0x464bec,_0x5302b0){_0x464bec=_0x464bec-0x0;var _0x5d36f3=_0x03b8[_0x464bec];return _0x5d36f3;};'use strict';var _=require(_0x803b('0x0'));var util=require(_0x803b('0x1'));var db=require(_0x803b('0x2'))['db'];var iftime=require('../../utils/iftime')[_0x803b('0x3')];var logger=require('../../config/logger')(_0x803b('0x4'));exports[_0x803b('0x5')]=function(_0x2e382e){var _0x37c80b=this;return new Promise(function(_0x13f3e0,_0x336ea9){return db[_0x803b('0x6')][_0x803b('0x7')]({'raw':_0x2e382e[_0x803b('0x8')]?_0x2e382e['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e382e[_0x803b('0x8')]?_0x2e382e[_0x803b('0x8')][_0x803b('0x9')]||null:null,'attributes':_0x2e382e[_0x803b('0x8')]?_0x2e382e[_0x803b('0x8')]['attributes']||null:null,'limit':_0x2e382e[_0x803b('0x8')]?_0x2e382e[_0x803b('0x8')][_0x803b('0xa')]||null:null,'include':_0x2e382e[_0x803b('0x8')]?_0x2e382e[_0x803b('0x8')][_0x803b('0xb')]?_[_0x803b('0xc')](_0x2e382e[_0x803b('0x8')]['include'],function(_0xbdddf7){return{'model':db[_0xbdddf7[_0x803b('0xd')]],'as':_0xbdddf7['as'],'attributes':_0xbdddf7[_0x803b('0xe')],'include':_0xbdddf7[_0x803b('0xb')]?_['map'](_0xbdddf7['include'],function(_0x21483c){return{'model':db[_0x21483c[_0x803b('0xd')]],'as':_0x21483c['as'],'attributes':_0x21483c[_0x803b('0xe')],'include':_0x21483c[_0x803b('0xb')]?_[_0x803b('0xc')](_0x21483c[_0x803b('0xb')],function(_0x41a157){return{'model':db[_0x41a157[_0x803b('0xd')]],'as':_0x41a157['as'],'attributes':_0x41a157['attributes']};}):[]};}):[]};}):[]:[]})[_0x803b('0xf')](function(_0x561606){logger[_0x803b('0x10')](_0x803b('0x5'),_0x2e382e);logger['debug'](_0x803b('0x5'),_0x2e382e,JSON[_0x803b('0x11')](_0x561606));_0x13f3e0(_0x561606);})[_0x803b('0x12')](function(_0x5e8c90){logger['error'](_0x803b('0x5'),_0x5e8c90[_0x803b('0x13')],_0x2e382e);_0x336ea9(_0x37c80b[_0x803b('0x14')](0x1f4,_0x5e8c90['message']));});});};exports[_0x803b('0x15')]=function(_0x1e1296){var _0x349e80=this;return new Promise(function(_0x22c92a,_0x4f0569){return db[_0x803b('0x6')][_0x803b('0x16')]({'raw':_0x1e1296[_0x803b('0x8')]?_0x1e1296[_0x803b('0x8')][_0x803b('0x17')]===undefined?!![]:![]:!![],'where':_0x1e1296[_0x803b('0x8')]?_0x1e1296[_0x803b('0x8')][_0x803b('0x9')]||null:null,'attributes':_0x1e1296[_0x803b('0x8')]?_0x1e1296[_0x803b('0x8')][_0x803b('0xe')]||null:null,'include':_0x1e1296[_0x803b('0x8')]?_0x1e1296['options'][_0x803b('0xb')]?_[_0x803b('0xc')](_0x1e1296['options'][_0x803b('0xb')],function(_0x22894a){return{'model':db[_0x22894a['model']],'as':_0x22894a['as'],'attributes':_0x22894a[_0x803b('0xe')],'include':_0x22894a['include']?_[_0x803b('0xc')](_0x22894a[_0x803b('0xb')],function(_0x329511){return{'model':db[_0x329511[_0x803b('0xd')]],'as':_0x329511['as'],'attributes':_0x329511[_0x803b('0xe')],'include':_0x329511['include']?_['map'](_0x329511[_0x803b('0xb')],function(_0x436196){return{'model':db[_0x436196[_0x803b('0xd')]],'as':_0x436196['as'],'attributes':_0x436196['attributes']};}):[]};}):[]};}):[]:[]})[_0x803b('0xf')](function(_0x2f9f62){logger[_0x803b('0x10')]('ShowInterval',_0x1e1296);logger['debug']('ShowInterval',_0x1e1296,JSON[_0x803b('0x11')](_0x2f9f62));_0x22c92a(_0x2f9f62);})[_0x803b('0x12')](function(_0x706ee6){logger[_0x803b('0x14')](_0x803b('0x15'),_0x706ee6[_0x803b('0x13')],_0x1e1296);_0x4f0569(_0x349e80[_0x803b('0x14')](0x1f4,_0x706ee6[_0x803b('0x13')]));});});};function checkArrayOfIntervals(_0x3d4ef2,_0x35fa5f){var _0x221422=[];return db[_0x803b('0x6')][_0x803b('0x7')]({'where':{'id':_0x3d4ef2}})[_0x803b('0xf')](function(_0x1fbabb){_0x221422=_0x1fbabb;return Promise['all'](_0x221422[_0x803b('0xc')](function(_0x4c865a){return _0x4c865a[_0x803b('0x18')](_0x35fa5f);}));})['then'](function(_0x14e3a2){var _0x426d6a=_0x14e3a2[_0x803b('0x19')](function(_0x13362c,_0x4a8c14){return _0x13362c||_0x4a8c14;},![]);logger[_0x803b('0x10')](util[_0x803b('0x1a')](_0x803b('0x1b'),_0x221422[_0x803b('0xc')](function(_0x2a5736){return _0x2a5736['name'];})[_0x803b('0x1c')](',\x20'),_0x221422[_0x803b('0xc')](function(_0x2ffdc2){return _0x2ffdc2['id'];})[_0x803b('0x1c')](',\x20')));return _0x426d6a;});}function checkSingleInterval(_0x5a6cae,_0x128c51){return db[_0x803b('0x6')]['findById'](_0x5a6cae)['then'](function(_0x11679b){if(_0x11679b){logger[_0x803b('0x10')](util[_0x803b('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x11679b[_0x803b('0x1d')],_0x11679b['id']));return _0x11679b[_0x803b('0x18')](_0x128c51);}});}exports[_0x803b('0x1e')]=function(_0x2d79bf){var _0x53280f=_0x2d79bf[_0x803b('0x1f')];var _0x520588=Array[_0x803b('0x20')](_0x2d79bf[_0x803b('0x21')])?_0x2d79bf[_0x803b('0x21')]:typeof _0x2d79bf[_0x803b('0x21')]===_0x803b('0x22')?[_0x2d79bf[_0x803b('0x21')]]:[];var _0x4a1a7a=_0x2d79bf[_0x803b('0x23')]||undefined;var _0x58ac7c=![];if(_0x520588[_0x803b('0x24')]){logger[_0x803b('0x10')](util[_0x803b('0x1a')]('IntervalIftime:\x20interval\x20strings\x20=\x20%s',_0x520588['join'](';\x20')));}if(_0x4a1a7a){logger[_0x803b('0x10')](util[_0x803b('0x1a')](_0x803b('0x25'),_0x4a1a7a));}logger[_0x803b('0x26')]('Iftime',_0x58ac7c);logger['silly'](_0x803b('0x1e'),_0x2d79bf);return Promise[_0x803b('0x27')]()[_0x803b('0xf')](function(){if(Array[_0x803b('0x20')](_0x53280f)){return checkArrayOfIntervals(_0x53280f,_0x4a1a7a);}else if(_0x53280f){return checkSingleInterval(_0x53280f,_0x4a1a7a);}})[_0x803b('0xf')](function(_0x3b28ff){var _0xe64c15=_0x520588[_0x803b('0x19')](function(_0x11ba7c,_0x234ed9){return _0x11ba7c||iftime(_0x234ed9,_0x4a1a7a);},![]);_0x58ac7c=_0x3b28ff||_0xe64c15;return _0x58ac7c;})[_0x803b('0x12')](function(_0x378759){logger[_0x803b('0x14')](_0x803b('0x1e'),_0x2d79bf,_0x378759);throw this[_0x803b('0x14')](0x1f4,_0x378759['message']);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index e7b3a2d..06d6428 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x474c64,_0x2ee167){var _0x2c583d=function(_0x2ee200){while(--_0x2ee200){_0x474c64['push'](_0x474c64['shift']());}};_0x2c583d(++_0x2ee167);}(_0xadb5,0xad));var _0x5adb=function(_0x675899,_0x1da6d7){_0x675899=_0x675899-0x0;var _0x259c94=_0xadb5[_0x675899];return _0x259c94;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0x2ef3=['./jira.controller','post','isAuthenticated','exports','express','Router','../../components/auth/service'];(function(_0x5ef0ae,_0x5a4316){var _0x19a792=function(_0x4a896c){while(--_0x4a896c){_0x5ef0ae['push'](_0x5ef0ae['shift']());}};_0x19a792(++_0x5a4316);}(_0x2ef3,0xba));var _0x32ef=function(_0x3820ee,_0x5ab0d4){_0x3820ee=_0x3820ee-0x0;var _0x33f612=_0x2ef3[_0x3820ee];return _0x33f612;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['send']);module[_0x32ef('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 60741d5..d354588 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 _0xb5de=['fields','customfield_11501','newToken','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','data','statusCode','json','error','status','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','end','openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','api','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','customfield_11500','email'];(function(_0x538ae7,_0x2defb1){var _0x70f194=function(_0x417bcc){while(--_0x417bcc){_0x538ae7['push'](_0x538ae7['shift']());}};_0x70f194(++_0x2defb1);}(_0xb5de,0x15b));var _0xeb5d=function(_0x384f03,_0x1a45db){_0x384f03=_0x384f03-0x0;var _0x13d2e7=_0xb5de[_0x384f03];return _0x13d2e7;};'use strict';var BPromise=require(_0xeb5d('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xeb5d('0x1'));var USERNAME=_0xeb5d('0x2');var PASSWORD=_0xeb5d('0x3');function openIssue(_0x56785f,_0x5c9aff){var _0x28bcf6={'fields':{'project':{'key':_0x56785f['key']||_0xeb5d('0x4')},'summary':(_0x56785f[_0xeb5d('0x5')]||_0xeb5d('0x6'))+_0xeb5d('0x7')+_0x56785f['ip'],'description':_0x56785f[_0xeb5d('0x8')]||JSON[_0xeb5d('0x9')](_0x56785f),'issuetype':{'name':_0x56785f[_0xeb5d('0xa')]||'Bug'}}};_0x28bcf6['fields'][_0xeb5d('0xb')]=_0x56785f[_0xeb5d('0xc')];_0x28bcf6[_0xeb5d('0xd')][_0xeb5d('0xe')]=_0x56785f['oldToken'];_0x28bcf6[_0xeb5d('0xd')]['customfield_11502']=_0x56785f[_0xeb5d('0xf')];_0x28bcf6[_0xeb5d('0xd')]['customfield_11503']=_0x56785f[_0xeb5d('0x10')];_0x28bcf6[_0xeb5d('0xd')][_0xeb5d('0x11')]=_0x56785f[_0xeb5d('0x12')];_0x28bcf6[_0xeb5d('0xd')][_0xeb5d('0x13')]=_0x56785f['ip'];var _0x4708fe={'host':_0xeb5d('0x14'),'port':0x1bb,'path':_0xeb5d('0x15'),'method':_0xeb5d('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xeb5d('0x17'),'Authorization':_0xeb5d('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xeb5d('0x19')](_0xeb5d('0x1a'))}};var _0x2dab68=JSON['stringify'](_0x28bcf6);var _0x2c54aa=https[_0xeb5d('0x1b')](_0x4708fe,function(_0x2fa458){_0x2fa458[_0xeb5d('0x1c')]('utf8');var _0x1251d0='';_0x2fa458['on'](_0xeb5d('0x1d'),function(_0xef68f1){_0x1251d0+=_0xef68f1;});_0x2fa458['on']('end',function(){if(_0x5c9aff){return _0x5c9aff['status'](_0x2fa458[_0xeb5d('0x1e')])[_0xeb5d('0x1f')](JSON['parse'](_0x1251d0));}});});_0x2c54aa['on'](_0xeb5d('0x20'),function(_0xdfa62a){if(_0x5c9aff){return _0x5c9aff[_0xeb5d('0x21')](0x1f4)[_0xeb5d('0x1f')]({'errors':[{'message':_0xeb5d('0x22'),'type':_0xeb5d('0x23')}]});}});_0x2c54aa['write'](_0x2dab68);_0x2c54aa[_0xeb5d('0x24')]();}exports[_0xeb5d('0x25')]=openIssue;exports[_0xeb5d('0x26')]=function(_0x4d2f3f,_0x334932){_0x4d2f3f['body']['ip']=_0x4d2f3f[_0xeb5d('0x27')][_0xeb5d('0x28')]||_0x4d2f3f[_0xeb5d('0x29')][_0xeb5d('0x2a')]||_0x4d2f3f[_0xeb5d('0x2b')][_0xeb5d('0x2a')]||_0x4d2f3f[_0xeb5d('0x29')][_0xeb5d('0x2b')][_0xeb5d('0x2a')];return openIssue(_0x4d2f3f[_0xeb5d('0x2c')],_0x334932);}; \ No newline at end of file +var _0x5bab=['key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','x-forwarded-for','connection','socket','remoteAddress','api','3eAmWpBVP0'];(function(_0x6fae04,_0x33078d){var _0x546f87=function(_0xf771a0){while(--_0xf771a0){_0x6fae04['push'](_0x6fae04['shift']());}};_0x546f87(++_0x33078d);}(_0x5bab,0x139));var _0xb5ba=function(_0x319d8b,_0xb0cb14){_0x319d8b=_0x319d8b-0x0;var _0xfc4897=_0x5bab[_0x319d8b];return _0xfc4897;};'use strict';var BPromise=require('bluebird');var https=require('https');var logger=require('../../config/logger')(_0xb5ba('0x0'));var USERNAME='support';var PASSWORD=_0xb5ba('0x1');function openIssue(_0x3568d0,_0x1d5217){var _0x4e8547={'fields':{'project':{'key':_0x3568d0[_0xb5ba('0x2')]||_0xb5ba('0x3')},'summary':(_0x3568d0[_0xb5ba('0x4')]||_0xb5ba('0x5'))+_0xb5ba('0x6')+_0x3568d0['ip'],'description':_0x3568d0[_0xb5ba('0x7')]||JSON[_0xb5ba('0x8')](_0x3568d0),'issuetype':{'name':_0x3568d0[_0xb5ba('0x9')]||_0xb5ba('0xa')}}};_0x4e8547[_0xb5ba('0xb')][_0xb5ba('0xc')]=_0x3568d0['email'];_0x4e8547[_0xb5ba('0xb')][_0xb5ba('0xd')]=_0x3568d0[_0xb5ba('0xe')];_0x4e8547[_0xb5ba('0xb')]['customfield_11502']=_0x3568d0[_0xb5ba('0xf')];_0x4e8547['fields'][_0xb5ba('0x10')]=_0x3568d0[_0xb5ba('0x11')];_0x4e8547[_0xb5ba('0xb')][_0xb5ba('0x12')]=_0x3568d0[_0xb5ba('0x13')];_0x4e8547[_0xb5ba('0xb')]['customfield_10102']=_0x3568d0['ip'];var _0x46dae7={'host':_0xb5ba('0x14'),'port':0x1bb,'path':_0xb5ba('0x15'),'method':_0xb5ba('0x16'),'timeout':0x4e20,'headers':{'Content-Type':_0xb5ba('0x17'),'Authorization':_0xb5ba('0x18')+new Buffer(USERNAME+':'+PASSWORD)[_0xb5ba('0x19')](_0xb5ba('0x1a'))}};var _0x24a0c2=JSON[_0xb5ba('0x8')](_0x4e8547);var _0x1f9a87=https[_0xb5ba('0x1b')](_0x46dae7,function(_0x158663){_0x158663['setEncoding']('utf8');var _0x1903de='';_0x158663['on']('data',function(_0x1b898c){_0x1903de+=_0x1b898c;});_0x158663['on'](_0xb5ba('0x1c'),function(){if(_0x1d5217){return _0x1d5217[_0xb5ba('0x1d')](_0x158663[_0xb5ba('0x1e')])[_0xb5ba('0x1f')](JSON[_0xb5ba('0x20')](_0x1903de));}});});_0x1f9a87['on'](_0xb5ba('0x21'),function(_0x5bdbfa){if(_0x1d5217){return _0x1d5217['status'](0x1f4)['json']({'errors':[{'message':_0xb5ba('0x22'),'type':_0xb5ba('0x23')}]});}});_0x1f9a87[_0xb5ba('0x24')](_0x24a0c2);_0x1f9a87['end']();}exports[_0xb5ba('0x25')]=openIssue;exports[_0xb5ba('0x26')]=function(_0x42f5f1,_0x1cb3c6){_0x42f5f1[_0xb5ba('0x27')]['ip']=_0x42f5f1[_0xb5ba('0x28')][_0xb5ba('0x29')]||_0x42f5f1[_0xb5ba('0x2a')]['remoteAddress']||_0x42f5f1[_0xb5ba('0x2b')]['remoteAddress']||_0x42f5f1['connection']['socket'][_0xb5ba('0x2c')];return openIssue(_0x42f5f1[_0xb5ba('0x27')],_0x1cb3c6);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index d74ca00..2ffc5ac 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 _0x9c44=['update','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./jscriptyAnswerReport.controller','isAuthenticated','index','get','/describe','/:id','show','create','put'];(function(_0xed5f9c,_0x5a25cd){var _0x3a1c43=function(_0x251202){while(--_0x251202){_0xed5f9c['push'](_0xed5f9c['shift']());}};_0x3a1c43(++_0x5a25cd);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'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'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0xf')]);router['delete']('/:id',auth[_0x49c4('0x7')](),controller[_0x49c4('0x10')]);module['exports']=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','destroy','exports'];(function(_0x58d217,_0x5acb1a){var _0x2774ac=function(_0x128afa){while(--_0x128afa){_0x58d217['push'](_0x58d217['shift']());}};_0x2774ac(++_0x5acb1a);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ef951,_0xae273a){_0x3ef951=_0x3ef951-0x0;var _0x2e8659=_0xedd9[_0x3ef951];return _0x2e8659;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9edd('0x10')]);router[_0x9edd('0x11')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router['delete'](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x13')]);module[_0x9edd('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 7cf1a34..64a559e 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(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x7a54,0x106));var _0x47a5=function(_0x19c4ce,_0x5b530b){_0x19c4ce=_0x19c4ce-0x0;var _0x132dad=_0x7a54[_0x19c4ce];return _0x132dad;};'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(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x7a54,0x106));var _0x47a5=function(_0x1caf45,_0x2de2e5){_0x1caf45=_0x1caf45-0x0;var _0x1e3ce1=_0x7a54[_0x1caf45];return _0x1e3ce1;};'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 3502fd4..7075a12 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 _0x3e9d=['fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','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','end','status','json','offset','limit','count','set','reject','update','error','name','index','map','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','then','includeAll','JscriptyAnswerReport','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','destroy','describe','eml-format','rimraf'];(function(_0xa920f8,_0x24a53a){var _0x512490=function(_0xfcc5c9){while(--_0xfcc5c9){_0xa920f8['push'](_0xa920f8['shift']());}};_0x512490(++_0x24a53a);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x32e955,_0x16ddf7){_0x32e955=_0x32e955-0x0;var _0x5af0b2=_0x3e9d[_0x32e955];return _0x5af0b2;};'use strict';var emlformat=require(_0xd3e9('0x0'));var rimraf=require(_0xd3e9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd3e9('0x2'));var rp=require(_0xd3e9('0x3'));var moment=require(_0xd3e9('0x4'));var BPromise=require(_0xd3e9('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd3e9('0x6'));var sox=require(_0xd3e9('0x7'));var csv=require(_0xd3e9('0x8'));var ejs=require(_0xd3e9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd3e9('0xa'));var crypto=require(_0xd3e9('0xb'));var jsforce=require(_0xd3e9('0xc'));var deskjs=require(_0xd3e9('0xd'));var toCsv=require(_0xd3e9('0x8'));var querystring=require(_0xd3e9('0xe'));var Papa=require(_0xd3e9('0xf'));var Redis=require('ioredis');var authService=require(_0xd3e9('0x10'));var qs=require(_0xd3e9('0x11'));var as=require(_0xd3e9('0x12'));var hardwareService=require(_0xd3e9('0x13'));var logger=require(_0xd3e9('0x14'))(_0xd3e9('0x15'));var utils=require(_0xd3e9('0x16'));var config=require(_0xd3e9('0x17'));var licenseUtil=require(_0xd3e9('0x18'));var db=require(_0xd3e9('0x19'))['db'];function respondWithStatusCode(_0x511c02,_0x19fcdc){_0x19fcdc=_0x19fcdc||0xcc;return function(_0x49ad73){if(_0x49ad73){return _0x511c02['sendStatus'](_0x19fcdc);}return _0x511c02['status'](_0x19fcdc)[_0xd3e9('0x1a')]();};}function respondWithResult(_0xdfc235,_0x315422){_0x315422=_0x315422||0xc8;return function(_0x7d59fd){if(_0x7d59fd){return _0xdfc235[_0xd3e9('0x1b')](_0x315422)[_0xd3e9('0x1c')](_0x7d59fd);}};}function respondWithFilteredResult(_0x1100f9,_0x460b95){return function(_0x435731){if(_0x435731){var _0x544800=typeof _0x460b95[_0xd3e9('0x1d')]==='undefined'&&typeof _0x460b95[_0xd3e9('0x1e')]==='undefined';var _0x5e4614=_0x435731[_0xd3e9('0x1f')];var _0x59c58d=_0x544800?0x0:_0x460b95['offset'];var _0xcc095f=_0x544800?_0x435731[_0xd3e9('0x1f')]:_0x460b95['offset']+_0x460b95[_0xd3e9('0x1e')];var _0x23e81d;if(_0xcc095f>=_0x5e4614){_0xcc095f=_0x5e4614;_0x23e81d=0xc8;}else{_0x23e81d=0xce;}_0x1100f9['status'](_0x23e81d);return _0x1100f9[_0xd3e9('0x20')]('Content-Range',_0x59c58d+'-'+_0xcc095f+'/'+_0x5e4614)[_0xd3e9('0x1c')](_0x435731);}return null;};}function patchUpdates(_0x1bd1bf){return function(_0x393da6){try{jsonpatch['apply'](_0x393da6,_0x1bd1bf,!![]);}catch(_0x4dea7d){return BPromise[_0xd3e9('0x21')](_0x4dea7d);}return _0x393da6['save']();};}function saveUpdates(_0x3a292e,_0x4d3ff9){return function(_0x8426d9){if(_0x8426d9){return _0x8426d9[_0xd3e9('0x22')](_0x3a292e)['then'](function(_0x1b8ab4){return _0x1b8ab4;});}return null;};}function removeEntity(_0x23b148,_0x3b40de){return function(_0x5484af){if(_0x5484af){return _0x5484af['destroy']()['then'](function(){_0x23b148[_0xd3e9('0x1b')](0xcc)[_0xd3e9('0x1a')]();});}};}function handleEntityNotFound(_0x20aebc,_0x1c715a){return function(_0x5ebb7b){if(!_0x5ebb7b){_0x20aebc['sendStatus'](0x194);}return _0x5ebb7b;};}function handleError(_0x4f0e44,_0x182ec7){_0x182ec7=_0x182ec7||0x1f4;return function(_0x4057a5){logger[_0xd3e9('0x23')](_0x4057a5['stack']);if(_0x4057a5[_0xd3e9('0x24')]){delete _0x4057a5[_0xd3e9('0x24')];}_0x4f0e44[_0xd3e9('0x1b')](_0x182ec7)['send'](_0x4057a5);};}exports[_0xd3e9('0x25')]=function(_0x7576bd,_0x405568){var _0x12ee4d={},_0x4550a6={},_0x3f164c={'count':0x0,'rows':[]};var _0x452f9c=_[_0xd3e9('0x26')](db['JscriptyAnswerReport']['rawAttributes'],function(_0x4ad840){return{'name':_0x4ad840[_0xd3e9('0x27')],'type':_0x4ad840[_0xd3e9('0x28')][_0xd3e9('0x29')]};});_0x4550a6['model']=_[_0xd3e9('0x26')](_0x452f9c,'name');_0x4550a6[_0xd3e9('0x2a')]=_['keys'](_0x7576bd[_0xd3e9('0x2a')]);_0x4550a6[_0xd3e9('0x2b')]=_[_0xd3e9('0x2c')](_0x4550a6[_0xd3e9('0x2d')],_0x4550a6[_0xd3e9('0x2a')]);_0x12ee4d['attributes']=_[_0xd3e9('0x2c')](_0x4550a6['model'],qs[_0xd3e9('0x2e')](_0x7576bd[_0xd3e9('0x2a')]['fields']));_0x12ee4d[_0xd3e9('0x2f')]=_0x12ee4d[_0xd3e9('0x2f')][_0xd3e9('0x30')]?_0x12ee4d['attributes']:_0x4550a6[_0xd3e9('0x2d')];if(!_0x7576bd[_0xd3e9('0x2a')][_0xd3e9('0x31')](_0xd3e9('0x32'))){_0x12ee4d[_0xd3e9('0x1e')]=qs['limit'](_0x7576bd[_0xd3e9('0x2a')][_0xd3e9('0x1e')]);_0x12ee4d[_0xd3e9('0x1d')]=qs[_0xd3e9('0x1d')](_0x7576bd[_0xd3e9('0x2a')][_0xd3e9('0x1d')]);}_0x12ee4d[_0xd3e9('0x33')]=qs[_0xd3e9('0x34')](_0x7576bd['query'][_0xd3e9('0x34')]);_0x12ee4d[_0xd3e9('0x35')]=qs[_0xd3e9('0x2b')](_['pick'](_0x7576bd[_0xd3e9('0x2a')],_0x4550a6[_0xd3e9('0x2b')]),_0x452f9c);if(_0x7576bd[_0xd3e9('0x2a')][_0xd3e9('0x36')]){_0x12ee4d[_0xd3e9('0x35')]=_[_0xd3e9('0x37')](_0x12ee4d[_0xd3e9('0x35')],{'$or':_['map'](_0x452f9c,function(_0x5061f9){if(_0x5061f9[_0xd3e9('0x28')]!==_0xd3e9('0x38')){var _0x130547={};_0x130547[_0x5061f9[_0xd3e9('0x24')]]={'$like':'%'+_0x7576bd[_0xd3e9('0x2a')][_0xd3e9('0x36')]+'%'};return _0x130547;}})});}_0x12ee4d=_['merge']({},_0x12ee4d,_0x7576bd[_0xd3e9('0x39')]);var _0x3de77d={'where':_0x12ee4d[_0xd3e9('0x35')]};return db['JscriptyAnswerReport'][_0xd3e9('0x1f')](_0x3de77d)[_0xd3e9('0x3a')](function(_0x1d555c){_0x3f164c[_0xd3e9('0x1f')]=_0x1d555c;if(_0x7576bd['query'][_0xd3e9('0x3b')]){_0x12ee4d['include']=[{'all':!![]}];}return db[_0xd3e9('0x3c')][_0xd3e9('0x3d')](_0x12ee4d);})[_0xd3e9('0x3a')](function(_0x11ad4d){_0x3f164c[_0xd3e9('0x3e')]=_0x11ad4d;return _0x3f164c;})[_0xd3e9('0x3a')](respondWithFilteredResult(_0x405568,_0x12ee4d))[_0xd3e9('0x3f')](handleError(_0x405568,null));};exports[_0xd3e9('0x40')]=function(_0x1cc20c,_0x16f825){var _0xffd158={'raw':!![],'where':{'id':_0x1cc20c[_0xd3e9('0x41')]['id']}},_0x22710e={};_0x22710e[_0xd3e9('0x2d')]=_[_0xd3e9('0x42')](db[_0xd3e9('0x3c')][_0xd3e9('0x43')]);_0x22710e[_0xd3e9('0x2a')]=_[_0xd3e9('0x42')](_0x1cc20c[_0xd3e9('0x2a')]);_0x22710e[_0xd3e9('0x2b')]=_[_0xd3e9('0x2c')](_0x22710e[_0xd3e9('0x2d')],_0x22710e[_0xd3e9('0x2a')]);_0xffd158[_0xd3e9('0x2f')]=_[_0xd3e9('0x2c')](_0x22710e[_0xd3e9('0x2d')],qs['fields'](_0x1cc20c[_0xd3e9('0x2a')][_0xd3e9('0x2e')]));_0xffd158[_0xd3e9('0x2f')]=_0xffd158[_0xd3e9('0x2f')][_0xd3e9('0x30')]?_0xffd158[_0xd3e9('0x2f')]:_0x22710e['model'];if(_0x1cc20c[_0xd3e9('0x2a')]['includeAll']){_0xffd158[_0xd3e9('0x44')]=[{'all':!![]}];}_0xffd158=_[_0xd3e9('0x37')]({},_0xffd158,_0x1cc20c['options']);return db[_0xd3e9('0x3c')][_0xd3e9('0x45')](_0xffd158)[_0xd3e9('0x3a')](handleEntityNotFound(_0x16f825,null))[_0xd3e9('0x3a')](respondWithResult(_0x16f825,null))[_0xd3e9('0x3f')](handleError(_0x16f825,null));};exports[_0xd3e9('0x46')]=function(_0x12b858,_0x515328){return db[_0xd3e9('0x3c')]['create'](_0x12b858[_0xd3e9('0x47')],{})[_0xd3e9('0x3a')](respondWithResult(_0x515328,0xc9))['catch'](handleError(_0x515328,null));};exports[_0xd3e9('0x22')]=function(_0x446d20,_0x2b8c75){if(_0x446d20['body']['id']){delete _0x446d20['body']['id'];}return db[_0xd3e9('0x3c')][_0xd3e9('0x45')]({'where':{'id':_0x446d20['params']['id']}})[_0xd3e9('0x3a')](handleEntityNotFound(_0x2b8c75,null))[_0xd3e9('0x3a')](saveUpdates(_0x446d20['body'],null))[_0xd3e9('0x3a')](respondWithResult(_0x2b8c75,null))['catch'](handleError(_0x2b8c75,null));};exports[_0xd3e9('0x48')]=function(_0x2ec185,_0x545184){return db[_0xd3e9('0x3c')]['find']({'where':{'id':_0x2ec185['params']['id']}})[_0xd3e9('0x3a')](handleEntityNotFound(_0x545184,null))[_0xd3e9('0x3a')](removeEntity(_0x545184,null))[_0xd3e9('0x3f')](handleError(_0x545184,null));};exports[_0xd3e9('0x49')]=function(_0x2adc3d,_0x8aea07){return db[_0xd3e9('0x3c')][_0xd3e9('0x49')]()[_0xd3e9('0x3a')](respondWithResult(_0x8aea07,null))[_0xd3e9('0x3f')](handleError(_0x8aea07,null));}; \ No newline at end of file +var _0x0960=['offset','set','Content-Range','apply','reject','save','then','destroy','name','send','index','map','JscriptyAnswerReport','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type','VIRTUAL','filter','includeAll','include','rows','params','keys','rawAttributes','options','create','body','update','find','catch','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count'];(function(_0x3fdd66,_0x1d905c){var _0x2dc3cc=function(_0x574afa){while(--_0x574afa){_0x3fdd66['push'](_0x3fdd66['shift']());}};_0x2dc3cc(++_0x1d905c);}(_0x0960,0xc2));var _0x0096=function(_0x427028,_0x10483b){_0x427028=_0x427028-0x0;var _0x1b6d69=_0x0960[_0x427028];return _0x1b6d69;};'use strict';var emlformat=require(_0x0096('0x0'));var rimraf=require(_0x0096('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0096('0x2'));var rp=require(_0x0096('0x3'));var moment=require(_0x0096('0x4'));var BPromise=require(_0x0096('0x5'));var Mustache=require(_0x0096('0x6'));var util=require(_0x0096('0x7'));var path=require(_0x0096('0x8'));var sox=require(_0x0096('0x9'));var csv=require(_0x0096('0xa'));var ejs=require(_0x0096('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0096('0xc'));var squel=require('squel');var crypto=require(_0x0096('0xd'));var jsforce=require(_0x0096('0xe'));var deskjs=require(_0x0096('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0096('0x10'));var Papa=require(_0x0096('0x11'));var Redis=require(_0x0096('0x12'));var authService=require(_0x0096('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0096('0x14'));var hardwareService=require(_0x0096('0x15'));var logger=require('../../config/logger')(_0x0096('0x16'));var utils=require('../../config/utils');var config=require(_0x0096('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0096('0x18'))['db'];function respondWithStatusCode(_0x25011c,_0x55678a){_0x55678a=_0x55678a||0xcc;return function(_0x2be406){if(_0x2be406){return _0x25011c[_0x0096('0x19')](_0x55678a);}return _0x25011c['status'](_0x55678a)['end']();};}function respondWithResult(_0x753d99,_0x39b6f6){_0x39b6f6=_0x39b6f6||0xc8;return function(_0x407361){if(_0x407361){return _0x753d99[_0x0096('0x1a')](_0x39b6f6)[_0x0096('0x1b')](_0x407361);}};}function respondWithFilteredResult(_0x5c901f,_0x590c96){return function(_0x19db10){if(_0x19db10){var _0x50c804=typeof _0x590c96['offset']===_0x0096('0x1c')&&typeof _0x590c96[_0x0096('0x1d')]==='undefined';var _0x7afa5f=_0x19db10[_0x0096('0x1e')];var _0x5468e2=_0x50c804?0x0:_0x590c96[_0x0096('0x1f')];var _0x27462a=_0x50c804?_0x19db10[_0x0096('0x1e')]:_0x590c96[_0x0096('0x1f')]+_0x590c96[_0x0096('0x1d')];var _0x507463;if(_0x27462a>=_0x7afa5f){_0x27462a=_0x7afa5f;_0x507463=0xc8;}else{_0x507463=0xce;}_0x5c901f[_0x0096('0x1a')](_0x507463);return _0x5c901f[_0x0096('0x20')](_0x0096('0x21'),_0x5468e2+'-'+_0x27462a+'/'+_0x7afa5f)['json'](_0x19db10);}return null;};}function patchUpdates(_0x1f5aad){return function(_0xef7a81){try{jsonpatch[_0x0096('0x22')](_0xef7a81,_0x1f5aad,!![]);}catch(_0x4e6338){return BPromise[_0x0096('0x23')](_0x4e6338);}return _0xef7a81[_0x0096('0x24')]();};}function saveUpdates(_0x4ac6f0,_0x263951){return function(_0x29b2c2){if(_0x29b2c2){return _0x29b2c2['update'](_0x4ac6f0)[_0x0096('0x25')](function(_0xfb20d0){return _0xfb20d0;});}return null;};}function removeEntity(_0x1a8e0e,_0x5ee101){return function(_0x224748){if(_0x224748){return _0x224748[_0x0096('0x26')]()[_0x0096('0x25')](function(){_0x1a8e0e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x569a7e,_0x2ea1df){return function(_0x1a6df7){if(!_0x1a6df7){_0x569a7e['sendStatus'](0x194);}return _0x1a6df7;};}function handleError(_0x47abff,_0x230d46){_0x230d46=_0x230d46||0x1f4;return function(_0x3eac07){logger['error'](_0x3eac07['stack']);if(_0x3eac07[_0x0096('0x27')]){delete _0x3eac07[_0x0096('0x27')];}_0x47abff['status'](_0x230d46)[_0x0096('0x28')](_0x3eac07);};}exports[_0x0096('0x29')]=function(_0x204002,_0x205b79){var _0x102346={},_0x48e20f={},_0x511806={'count':0x0,'rows':[]};var _0x3b842b=_[_0x0096('0x2a')](db[_0x0096('0x2b')]['rawAttributes'],function(_0x593074){return{'name':_0x593074[_0x0096('0x2c')],'type':_0x593074['type'][_0x0096('0x2d')]};});_0x48e20f[_0x0096('0x2e')]=_[_0x0096('0x2a')](_0x3b842b,_0x0096('0x27'));_0x48e20f['query']=_['keys'](_0x204002[_0x0096('0x2f')]);_0x48e20f['filters']=_[_0x0096('0x30')](_0x48e20f[_0x0096('0x2e')],_0x48e20f[_0x0096('0x2f')]);_0x102346[_0x0096('0x31')]=_[_0x0096('0x30')](_0x48e20f[_0x0096('0x2e')],qs[_0x0096('0x32')](_0x204002[_0x0096('0x2f')][_0x0096('0x32')]));_0x102346[_0x0096('0x31')]=_0x102346[_0x0096('0x31')][_0x0096('0x33')]?_0x102346['attributes']:_0x48e20f[_0x0096('0x2e')];if(!_0x204002[_0x0096('0x2f')][_0x0096('0x34')](_0x0096('0x35'))){_0x102346[_0x0096('0x1d')]=qs[_0x0096('0x1d')](_0x204002[_0x0096('0x2f')]['limit']);_0x102346[_0x0096('0x1f')]=qs[_0x0096('0x1f')](_0x204002[_0x0096('0x2f')][_0x0096('0x1f')]);}_0x102346[_0x0096('0x36')]=qs[_0x0096('0x37')](_0x204002[_0x0096('0x2f')][_0x0096('0x37')]);_0x102346[_0x0096('0x38')]=qs[_0x0096('0x39')](_[_0x0096('0x3a')](_0x204002[_0x0096('0x2f')],_0x48e20f['filters']),_0x3b842b);if(_0x204002[_0x0096('0x2f')]['filter']){_0x102346[_0x0096('0x38')]=_['merge'](_0x102346['where'],{'$or':_[_0x0096('0x2a')](_0x3b842b,function(_0x179496){if(_0x179496[_0x0096('0x3b')]!==_0x0096('0x3c')){var _0x157a61={};_0x157a61[_0x179496['name']]={'$like':'%'+_0x204002[_0x0096('0x2f')][_0x0096('0x3d')]+'%'};return _0x157a61;}})});}_0x102346=_['merge']({},_0x102346,_0x204002['options']);var _0x505ede={'where':_0x102346[_0x0096('0x38')]};return db[_0x0096('0x2b')][_0x0096('0x1e')](_0x505ede)[_0x0096('0x25')](function(_0x5722b6){_0x511806[_0x0096('0x1e')]=_0x5722b6;if(_0x204002[_0x0096('0x2f')][_0x0096('0x3e')]){_0x102346[_0x0096('0x3f')]=[{'all':!![]}];}return db[_0x0096('0x2b')]['findAll'](_0x102346);})[_0x0096('0x25')](function(_0x2dccba){_0x511806[_0x0096('0x40')]=_0x2dccba;return _0x511806;})[_0x0096('0x25')](respondWithFilteredResult(_0x205b79,_0x102346))['catch'](handleError(_0x205b79,null));};exports['show']=function(_0x4b4ab7,_0x12d010){var _0x543e14={'raw':!![],'where':{'id':_0x4b4ab7[_0x0096('0x41')]['id']}},_0x31f7c0={};_0x31f7c0[_0x0096('0x2e')]=_[_0x0096('0x42')](db['JscriptyAnswerReport'][_0x0096('0x43')]);_0x31f7c0[_0x0096('0x2f')]=_[_0x0096('0x42')](_0x4b4ab7[_0x0096('0x2f')]);_0x31f7c0[_0x0096('0x39')]=_[_0x0096('0x30')](_0x31f7c0['model'],_0x31f7c0[_0x0096('0x2f')]);_0x543e14['attributes']=_[_0x0096('0x30')](_0x31f7c0[_0x0096('0x2e')],qs[_0x0096('0x32')](_0x4b4ab7['query'][_0x0096('0x32')]));_0x543e14[_0x0096('0x31')]=_0x543e14[_0x0096('0x31')]['length']?_0x543e14[_0x0096('0x31')]:_0x31f7c0[_0x0096('0x2e')];if(_0x4b4ab7['query'][_0x0096('0x3e')]){_0x543e14[_0x0096('0x3f')]=[{'all':!![]}];}_0x543e14=_['merge']({},_0x543e14,_0x4b4ab7[_0x0096('0x44')]);return db[_0x0096('0x2b')]['find'](_0x543e14)[_0x0096('0x25')](handleEntityNotFound(_0x12d010,null))[_0x0096('0x25')](respondWithResult(_0x12d010,null))['catch'](handleError(_0x12d010,null));};exports['create']=function(_0x34cc4d,_0x18baac){return db['JscriptyAnswerReport'][_0x0096('0x45')](_0x34cc4d[_0x0096('0x46')],{})['then'](respondWithResult(_0x18baac,0xc9))['catch'](handleError(_0x18baac,null));};exports[_0x0096('0x47')]=function(_0x392ca0,_0x29993c){if(_0x392ca0[_0x0096('0x46')]['id']){delete _0x392ca0[_0x0096('0x46')]['id'];}return db[_0x0096('0x2b')][_0x0096('0x48')]({'where':{'id':_0x392ca0[_0x0096('0x41')]['id']}})[_0x0096('0x25')](handleEntityNotFound(_0x29993c,null))[_0x0096('0x25')](saveUpdates(_0x392ca0['body'],null))['then'](respondWithResult(_0x29993c,null))[_0x0096('0x49')](handleError(_0x29993c,null));};exports[_0x0096('0x26')]=function(_0x2f5f2f,_0x7fc578){return db[_0x0096('0x2b')]['find']({'where':{'id':_0x2f5f2f[_0x0096('0x41')]['id']}})[_0x0096('0x25')](handleEntityNotFound(_0x7fc578,null))[_0x0096('0x25')](removeEntity(_0x7fc578,null))[_0x0096('0x49')](handleError(_0x7fc578,null));};exports['describe']=function(_0x56a7c8,_0x425f60){return db[_0x0096('0x2b')][_0x0096('0x4a')]()[_0x0096('0x25')](respondWithResult(_0x425f60,null))[_0x0096('0x49')](handleError(_0x425f60,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index c458233..c0a7222 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 _0x647b=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','moment','path','./jscriptyAnswerReport.attributes'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x647b,0x1f3));var _0xb647=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x647b[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xb647('0x0'));var logger=require(_0xb647('0x1'))('api');var moment=require(_0xb647('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb647('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb647('0x4'));module[_0xb647('0x5')]=function(_0x2be51f,_0x48d903){return _0x2be51f[_0xb647('0x6')](_0xb647('0x7'),attributes,{'tableName':_0xb647('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1370=['./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x18f69a,_0x217962){var _0x4057fd=function(_0x2d650d){while(--_0x2d650d){_0x18f69a['push'](_0x18f69a['shift']());}};_0x4057fd(++_0x217962);}(_0x1370,0xfb));var _0x0137=function(_0x34f0fb,_0x3323b2){_0x34f0fb=_0x34f0fb-0x0;var _0x9b7b2b=_0x1370[_0x34f0fb];return _0x9b7b2b;};'use strict';var _=require(_0x0137('0x0'));var util=require(_0x0137('0x1'));var logger=require(_0x0137('0x2'))(_0x0137('0x3'));var moment=require(_0x0137('0x4'));var BPromise=require(_0x0137('0x5'));var rp=require(_0x0137('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0137('0x7'));var config=require(_0x0137('0x8'));var attributes=require(_0x0137('0x9'));module[_0x0137('0xa')]=function(_0x116103,_0x542cad){return _0x116103[_0x0137('0xb')](_0x0137('0xc'),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 7c56954..987d61d 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 _0x7760=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x176fb5,_0x5a8231){var _0x2b4752=function(_0x1127a2){while(--_0x1127a2){_0x176fb5['push'](_0x176fb5['shift']());}};_0x2b4752(++_0x5a8231);}(_0x7760,0x1e2));var _0x0776=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x7760[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0x0776('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0776('0x1'));var rs=require(_0x0776('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0776('0x3'))['db'];var utils=require(_0x0776('0x4'));var logger=require(_0x0776('0x5'))(_0x0776('0x6'));var config=require(_0x0776('0x7'));var jayson=require(_0x0776('0x8'));var client=jayson[_0x0776('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a66a1,_0x5d0a00,_0x2fabeb){return new BPromise(function(_0x17e873,_0x5b10e4){return client[_0x0776('0xa')](_0x1a66a1,_0x2fabeb)['then'](function(_0x3b301e){logger[_0x0776('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5d0a00,_0x0776('0xc'));logger['debug'](_0x0776('0xd'),_0x5d0a00,_0x0776('0xc'),JSON[_0x0776('0xe')](_0x3b301e));if(_0x3b301e[_0x0776('0xf')]){if(_0x3b301e[_0x0776('0xf')][_0x0776('0x10')]===0x1f4){logger[_0x0776('0xf')](_0x0776('0x11'),_0x5d0a00,_0x3b301e[_0x0776('0xf')][_0x0776('0x12')]);return _0x5b10e4(_0x3b301e[_0x0776('0xf')]['message']);}logger[_0x0776('0xf')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5d0a00,_0x3b301e[_0x0776('0xf')]['message']);return _0x17e873(_0x3b301e['error'][_0x0776('0x12')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x5d0a00,_0x0776('0xc'));_0x17e873(_0x3b301e[_0x0776('0x13')][_0x0776('0x12')]);}})[_0x0776('0x14')](function(_0x1dfaae){logger[_0x0776('0xf')](_0x0776('0x11'),_0x5d0a00,_0x1dfaae);_0x5b10e4(_0x1dfaae);});});} \ No newline at end of file +var _0xeb5d=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x598a1c,_0x4e8629){var _0x416507=function(_0x2ab598){while(--_0x2ab598){_0x598a1c['push'](_0x598a1c['shift']());}};_0x416507(++_0x4e8629);}(_0xeb5d,0xef));var _0xdeb5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xeb5d[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xdeb5('0x0'));var util=require(_0xdeb5('0x1'));var moment=require(_0xdeb5('0x2'));var BPromise=require(_0xdeb5('0x3'));var rs=require(_0xdeb5('0x4'));var fs=require('fs');var Redis=require(_0xdeb5('0x5'));var db=require(_0xdeb5('0x6'))['db'];var utils=require(_0xdeb5('0x7'));var logger=require(_0xdeb5('0x8'))(_0xdeb5('0x9'));var config=require(_0xdeb5('0xa'));var jayson=require(_0xdeb5('0xb'));var client=jayson[_0xdeb5('0xc')][_0xdeb5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x38b20a,_0x367eca,_0x5db987){return new BPromise(function(_0x26ec0c,_0x6301da){return client[_0xdeb5('0xe')](_0x38b20a,_0x5db987)['then'](function(_0x2c9ac6){logger[_0xdeb5('0xf')](_0xdeb5('0x10'),_0x367eca,_0xdeb5('0x11'));logger[_0xdeb5('0x12')](_0xdeb5('0x13'),_0x367eca,_0xdeb5('0x11'),JSON['stringify'](_0x2c9ac6));if(_0x2c9ac6[_0xdeb5('0x14')]){if(_0x2c9ac6[_0xdeb5('0x14')][_0xdeb5('0x15')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x367eca,_0x2c9ac6[_0xdeb5('0x14')][_0xdeb5('0x16')]);return _0x6301da(_0x2c9ac6[_0xdeb5('0x14')]['message']);}logger[_0xdeb5('0x14')](_0xdeb5('0x10'),_0x367eca,_0x2c9ac6[_0xdeb5('0x14')][_0xdeb5('0x16')]);return _0x26ec0c(_0x2c9ac6[_0xdeb5('0x14')][_0xdeb5('0x16')]);}else{logger['info'](_0xdeb5('0x10'),_0x367eca,'request\x20sent');_0x26ec0c(_0x2c9ac6['result'][_0xdeb5('0x16')]);}})[_0xdeb5('0x17')](function(_0x4174d5){logger[_0xdeb5('0x14')](_0xdeb5('0x10'),_0x367eca,_0x4174d5);_0x6301da(_0x4174d5);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 474675c..21d3cfe 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 _0x2c24=['getAnswers','/:id/summary','30s','post','create','/:id/clone','clone','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','getSessions'];(function(_0x51d6f1,_0x530a33){var _0x10ce14=function(_0x3bf655){while(--_0x3bf655){_0x51d6f1['push'](_0x51d6f1['shift']());}};_0x10ce14(++_0x530a33);}(_0x2c24,0xf9));var _0x42c2=function(_0x3d353b,_0x2ccb27){_0x3d353b=_0x3d353b-0x0;var _0x3a6b25=_0x2c24[_0x3d353b];return _0x3a6b25;};'use strict';var multer=require(_0x42c2('0x0'));var util=require(_0x42c2('0x1'));var path=require(_0x42c2('0x2'));var timeout=require('connect-timeout');var express=require(_0x42c2('0x3'));var router=express[_0x42c2('0x4')]();var fs_extra=require(_0x42c2('0x5'));var auth=require(_0x42c2('0x6'));var interaction=require(_0x42c2('0x7'));var config=require(_0x42c2('0x8'));var controller=require(_0x42c2('0x9'));router[_0x42c2('0xa')]('/',auth['isAuthenticated'](),controller[_0x42c2('0xb')]);router[_0x42c2('0xa')](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller['show']);router[_0x42c2('0xa')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x42c2('0xe')]);router[_0x42c2('0xa')]('/:id/answers',auth[_0x42c2('0xd')](),controller[_0x42c2('0xf')]);router[_0x42c2('0xa')](_0x42c2('0x10'),auth[_0x42c2('0xd')](),timeout(_0x42c2('0x11')),controller['getSummary']);router[_0x42c2('0x12')]('/',auth[_0x42c2('0xd')](),controller[_0x42c2('0x13')]);router[_0x42c2('0x12')](_0x42c2('0x14'),auth['isAuthenticated'](),controller[_0x42c2('0x15')]);router['put'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller['update']);router['delete'](_0x42c2('0xc'),auth[_0x42c2('0xd')](),controller[_0x42c2('0x16')]);module[_0x42c2('0x17')]=router; \ No newline at end of file +var _0x3c86=['/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','clone','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','show','getSessions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3c86,0x11c));var _0x63c8=function(_0x1cba47,_0x37b9ea){_0x1cba47=_0x1cba47-0x0;var _0x26d7af=_0x3c86[_0x1cba47];return _0x26d7af;};'use strict';var multer=require(_0x63c8('0x0'));var util=require(_0x63c8('0x1'));var path=require(_0x63c8('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x63c8('0x3')]();var fs_extra=require(_0x63c8('0x4'));var auth=require(_0x63c8('0x5'));var interaction=require(_0x63c8('0x6'));var config=require(_0x63c8('0x7'));var controller=require(_0x63c8('0x8'));router['get']('/',auth[_0x63c8('0x9')](),controller['index']);router[_0x63c8('0xa')]('/:id',auth[_0x63c8('0x9')](),controller[_0x63c8('0xb')]);router[_0x63c8('0xa')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x63c8('0xc')]);router[_0x63c8('0xa')](_0x63c8('0xd'),auth['isAuthenticated'](),controller[_0x63c8('0xe')]);router[_0x63c8('0xa')](_0x63c8('0xf'),auth['isAuthenticated'](),timeout(_0x63c8('0x10')),controller[_0x63c8('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x63c8('0x12')]);router[_0x63c8('0x13')](_0x63c8('0x14'),auth['isAuthenticated'](),controller[_0x63c8('0x15')]);router[_0x63c8('0x16')](_0x63c8('0x17'),auth[_0x63c8('0x9')](),controller[_0x63c8('0x18')]);router[_0x63c8('0x19')](_0x63c8('0x17'),auth[_0x63c8('0x9')](),controller['destroy']);module[_0x63c8('0x1a')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index 650b61a..fae1660 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 _0x3230=['lodash','util','STRING','TEXT','long','isObjectLike','formData','stringify','setDataValue','format','getDataValue','name','BOOLEAN','sequelize'];(function(_0x4f12e2,_0x3eef60){var _0xab994e=function(_0x2b1554){while(--_0x2b1554){_0x4f12e2['push'](_0x4f12e2['shift']());}};_0xab994e(++_0x3eef60);}(_0x3230,0x187));var _0x0323=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x3230[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x0323('0x0'));var _=require(_0x0323('0x1'));var util=require(_0x0323('0x2'));module['exports']={'name':{'type':Sequelize[_0x0323('0x3')],'unique':'name'},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0323('0x4')](_0x0323('0x5')),'set':function(_0x2b8c7b){if(_[_0x0323('0x6')](_0x2b8c7b)){this['setDataValue'](_0x0323('0x7'),JSON[_0x0323('0x8')](_0x2b8c7b));}else if(_['isString'](_0x2b8c7b)){this[_0x0323('0x9')]('formData',_0x2b8c7b);}else{this[_0x0323('0x9')](_0x0323('0x7'),util[_0x0323('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x0323('0xb')](_0x0323('0xc'))||'',this[_0x0323('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0323('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0x8dc6=['util','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','formData','getDataValue','description','BOOLEAN','sequelize','lodash'];(function(_0x54a5db,_0x4ed287){var _0x47a5fc=function(_0xc059b0){while(--_0xc059b0){_0x54a5db['push'](_0x54a5db['shift']());}};_0x47a5fc(++_0x4ed287);}(_0x8dc6,0x98));var _0x68dc=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8dc6[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x68dc('0x0'));var _=require(_0x68dc('0x1'));var util=require(_0x68dc('0x2'));module['exports']={'name':{'type':Sequelize[_0x68dc('0x3')],'unique':_0x68dc('0x4')},'description':{'type':Sequelize[_0x68dc('0x3')]},'formData':{'type':Sequelize[_0x68dc('0x5')](_0x68dc('0x6')),'set':function(_0x40d67e){if(_[_0x68dc('0x7')](_0x40d67e)){this[_0x68dc('0x8')]('formData',JSON[_0x68dc('0x9')](_0x40d67e));}else if(_['isString'](_0x40d67e)){this['setDataValue'](_0x68dc('0xa'),_0x40d67e);}else{this['setDataValue'](_0x68dc('0xa'),util['format']('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x68dc('0xb')](_0x68dc('0x4'))||'',this['getDataValue'](_0x68dc('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x68dc('0xd')],'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 cdb89da..5c5ea0b 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 _0x18f3=['show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','body','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getSessions','findOne','JscriptySessionReport','order','sort','ProjectId','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','questionId','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','destroy','then','get','Projects','UserProfileResource','error','name','send','index','map','JscriptyProject','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','VIRTUAL','filter','merge','options','include','findAll','catch'];(function(_0x44c37d,_0x19119f){var _0x29e087=function(_0x327fca){while(--_0x327fca){_0x44c37d['push'](_0x44c37d['shift']());}};_0x29e087(++_0x19119f);}(_0x18f3,0x19f));var _0x318f=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x18f3[_0x4d8ed9];return _0x1e2140;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x318f('0x0'));var zipdir=require(_0x318f('0x1'));var jsonpatch=require(_0x318f('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x318f('0x3'));var Mustache=require('mustache');var util=require(_0x318f('0x4'));var path=require(_0x318f('0x5'));var sox=require(_0x318f('0x6'));var csv=require(_0x318f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x318f('0x8'));var _=require(_0x318f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x318f('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x318f('0x7'));var querystring=require(_0x318f('0xb'));var Papa=require(_0x318f('0xc'));var Redis=require(_0x318f('0xd'));var authService=require(_0x318f('0xe'));var qs=require(_0x318f('0xf'));var as=require(_0x318f('0x10'));var hardwareService=require(_0x318f('0x11'));var logger=require(_0x318f('0x12'))(_0x318f('0x13'));var utils=require(_0x318f('0x14'));var config=require(_0x318f('0x15'));var licenseUtil=require(_0x318f('0x16'));var db=require(_0x318f('0x17'))['db'];function respondWithStatusCode(_0x20b5c0,_0x4f740a){_0x4f740a=_0x4f740a||0xcc;return function(_0x531876){if(_0x531876){return _0x20b5c0[_0x318f('0x18')](_0x4f740a);}return _0x20b5c0[_0x318f('0x19')](_0x4f740a)[_0x318f('0x1a')]();};}function respondWithResult(_0x419cc4,_0x25d749){_0x25d749=_0x25d749||0xc8;return function(_0x3dc225){if(_0x3dc225){return _0x419cc4[_0x318f('0x19')](_0x25d749)['json'](_0x3dc225);}};}function respondWithFilteredResult(_0x210758,_0x4dbaf4){return function(_0x47cfdb){if(_0x47cfdb){var _0x2651ec=typeof _0x4dbaf4[_0x318f('0x1b')]==='undefined'&&typeof _0x4dbaf4['limit']===_0x318f('0x1c');var _0x56b0ed=_0x47cfdb[_0x318f('0x1d')];var _0x1b67e4=_0x2651ec?0x0:_0x4dbaf4[_0x318f('0x1b')];var _0x386b33=_0x2651ec?_0x47cfdb[_0x318f('0x1d')]:_0x4dbaf4['offset']+_0x4dbaf4[_0x318f('0x1e')];var _0x1e4ca5;if(_0x386b33>=_0x56b0ed){_0x386b33=_0x56b0ed;_0x1e4ca5=0xc8;}else{_0x1e4ca5=0xce;}_0x210758[_0x318f('0x19')](_0x1e4ca5);return _0x210758[_0x318f('0x1f')](_0x318f('0x20'),_0x1b67e4+'-'+_0x386b33+'/'+_0x56b0ed)[_0x318f('0x21')](_0x47cfdb);}return null;};}function patchUpdates(_0x27dcd1){return function(_0x2b0b06){try{jsonpatch[_0x318f('0x22')](_0x2b0b06,_0x27dcd1,!![]);}catch(_0x5b09a5){return BPromise['reject'](_0x5b09a5);}return _0x2b0b06[_0x318f('0x23')]();};}function saveUpdates(_0x21f42b,_0x39e131){return function(_0x5617f4){if(_0x5617f4){return _0x5617f4[_0x318f('0x24')](_0x21f42b)['then'](function(_0x414236){return _0x414236;});}return null;};}function removeEntity(_0x5237b6,_0x47087a){return function(_0x3c9aaa){if(_0x3c9aaa){return _0x3c9aaa[_0x318f('0x25')]()[_0x318f('0x26')](function(){var _0x1df501=_0x3c9aaa[_0x318f('0x27')]({'plain':!![]});var _0x1a86fb=_0x318f('0x28');return db[_0x318f('0x29')][_0x318f('0x25')]({'where':{'type':_0x1a86fb,'resourceId':_0x1df501['id']}})[_0x318f('0x26')](function(){return _0x3c9aaa;});})[_0x318f('0x26')](function(){_0x5237b6[_0x318f('0x19')](0xcc)[_0x318f('0x1a')]();});}};}function handleEntityNotFound(_0xf2374f,_0x236766){return function(_0x2cab68){if(!_0x2cab68){_0xf2374f[_0x318f('0x18')](0x194);}return _0x2cab68;};}function handleError(_0x2f326b,_0x3e82aa){_0x3e82aa=_0x3e82aa||0x1f4;return function(_0x1628de){logger[_0x318f('0x2a')](_0x1628de['stack']);if(_0x1628de[_0x318f('0x2b')]){delete _0x1628de['name'];}_0x2f326b[_0x318f('0x19')](_0x3e82aa)[_0x318f('0x2c')](_0x1628de);};}exports[_0x318f('0x2d')]=function(_0x3fe614,_0x17fcf1){var _0x1547f4={},_0x44cb65={},_0x253e2e={'count':0x0,'rows':[]};var _0x3a2103=_[_0x318f('0x2e')](db[_0x318f('0x2f')][_0x318f('0x30')],function(_0x396a00){return{'name':_0x396a00['fieldName'],'type':_0x396a00[_0x318f('0x31')]['key']};});_0x44cb65[_0x318f('0x32')]=_['map'](_0x3a2103,_0x318f('0x2b'));_0x44cb65[_0x318f('0x33')]=_[_0x318f('0x34')](_0x3fe614['query']);_0x44cb65[_0x318f('0x35')]=_[_0x318f('0x36')](_0x44cb65[_0x318f('0x32')],_0x44cb65['query']);_0x1547f4[_0x318f('0x37')]=_['intersection'](_0x44cb65[_0x318f('0x32')],qs[_0x318f('0x38')](_0x3fe614['query']['fields']));_0x1547f4[_0x318f('0x37')]=_0x1547f4['attributes'][_0x318f('0x39')]?_0x1547f4[_0x318f('0x37')]:_0x44cb65[_0x318f('0x32')];if(!_0x3fe614[_0x318f('0x33')][_0x318f('0x3a')](_0x318f('0x3b'))){_0x1547f4[_0x318f('0x1e')]=qs[_0x318f('0x1e')](_0x3fe614[_0x318f('0x33')][_0x318f('0x1e')]);_0x1547f4[_0x318f('0x1b')]=qs[_0x318f('0x1b')](_0x3fe614[_0x318f('0x33')]['offset']);}_0x1547f4['order']=qs['sort'](_0x3fe614[_0x318f('0x33')]['sort']);_0x1547f4[_0x318f('0x3c')]=qs['filters'](_[_0x318f('0x3d')](_0x3fe614['query'],_0x44cb65[_0x318f('0x35')]),_0x3a2103);if(_0x3fe614['query']['filter']){_0x1547f4[_0x318f('0x3c')]=_['merge'](_0x1547f4[_0x318f('0x3c')],{'$or':_['map'](_0x3a2103,function(_0x6e4d61){if(_0x6e4d61[_0x318f('0x31')]!==_0x318f('0x3e')){var _0x42987d={};_0x42987d[_0x6e4d61['name']]={'$like':'%'+_0x3fe614[_0x318f('0x33')][_0x318f('0x3f')]+'%'};return _0x42987d;}})});}_0x1547f4=_[_0x318f('0x40')]({},_0x1547f4,_0x3fe614[_0x318f('0x41')]);var _0x99fdfe={'where':_0x1547f4[_0x318f('0x3c')]};return db[_0x318f('0x2f')][_0x318f('0x1d')](_0x99fdfe)[_0x318f('0x26')](function(_0x370929){_0x253e2e[_0x318f('0x1d')]=_0x370929;if(_0x3fe614[_0x318f('0x33')]['includeAll']){_0x1547f4[_0x318f('0x42')]=[{'all':!![]}];}return db[_0x318f('0x2f')][_0x318f('0x43')](_0x1547f4);})[_0x318f('0x26')](function(_0x6a4876){_0x253e2e['rows']=_0x6a4876;return _0x253e2e;})['then'](respondWithFilteredResult(_0x17fcf1,_0x1547f4))[_0x318f('0x44')](handleError(_0x17fcf1,null));};exports[_0x318f('0x45')]=function(_0xc17409,_0x47fcbc){var _0x221d80={'raw':![],'where':{'id':_0xc17409[_0x318f('0x46')]['id']}},_0x41c1fe={};_0x41c1fe['model']=_['keys'](db[_0x318f('0x2f')][_0x318f('0x30')]);_0x41c1fe[_0x318f('0x33')]=_[_0x318f('0x34')](_0xc17409[_0x318f('0x33')]);_0x41c1fe[_0x318f('0x35')]=_[_0x318f('0x36')](_0x41c1fe[_0x318f('0x32')],_0x41c1fe[_0x318f('0x33')]);_0x221d80[_0x318f('0x37')]=_['intersection'](_0x41c1fe[_0x318f('0x32')],qs[_0x318f('0x38')](_0xc17409[_0x318f('0x33')][_0x318f('0x38')]));_0x221d80[_0x318f('0x37')]=_0x221d80[_0x318f('0x37')]['length']?_0x221d80[_0x318f('0x37')]:_0x41c1fe[_0x318f('0x32')];if(_0xc17409[_0x318f('0x33')][_0x318f('0x47')]){_0x221d80[_0x318f('0x42')]=[{'all':!![]}];}_0x221d80=_['merge']({},_0x221d80,_0xc17409[_0x318f('0x41')]);return db[_0x318f('0x2f')][_0x318f('0x48')](_0x221d80)['then'](handleEntityNotFound(_0x47fcbc,null))['then'](respondWithResult(_0x47fcbc,null))['catch'](handleError(_0x47fcbc,null));};exports[_0x318f('0x49')]=function(_0x5c4d3e,_0x572fb1){return db[_0x318f('0x2f')][_0x318f('0x49')](_0x5c4d3e['body'],{})[_0x318f('0x26')](function(_0x24308e){var _0x597c5a=_0x5c4d3e[_0x318f('0x4a')][_0x318f('0x27')]({'plain':!![]});if(!_0x597c5a)throw new Error(_0x318f('0x4b'));if(_0x597c5a[_0x318f('0x4c')]===_0x318f('0x4a')){var _0x2cee3b=_0x24308e['get']({'plain':!![]});var _0x51df05='Projects';return db[_0x318f('0x4d')][_0x318f('0x48')]({'where':{'name':_0x51df05,'userProfileId':_0x597c5a[_0x318f('0x4e')]},'raw':!![]})['then'](function(_0x42b443){if(_0x42b443&&_0x42b443[_0x318f('0x4f')]===0x0){return db[_0x318f('0x29')]['create']({'name':_0x2cee3b['name'],'resourceId':_0x2cee3b['id'],'type':_0x42b443[_0x318f('0x2b')],'sectionId':_0x42b443['id']},{})[_0x318f('0x26')](function(){return _0x24308e;});}else{return _0x24308e;}})[_0x318f('0x44')](function(_0x391475){logger[_0x318f('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x391475);throw _0x391475;});}return _0x24308e;})[_0x318f('0x26')](respondWithResult(_0x572fb1,0xc9))[_0x318f('0x44')](handleError(_0x572fb1,null));};exports[_0x318f('0x50')]=function(_0x3891fd,_0x45220b){var _0x571cc6={'where':{'id':_0x3891fd[_0x318f('0x46')]['id']}},_0x5a59de={};_0x5a59de[_0x318f('0x32')]=_[_0x318f('0x34')](db[_0x318f('0x2f')][_0x318f('0x30')]);_0x571cc6[_0x318f('0x37')]=_[_0x318f('0x36')](_0x5a59de[_0x318f('0x32')],qs[_0x318f('0x38')](_0x3891fd[_0x318f('0x33')][_0x318f('0x38')]));_0x571cc6['attributes']=_0x571cc6['attributes']['length']?_0x571cc6[_0x318f('0x37')]:_0x5a59de[_0x318f('0x32')];if(_0x3891fd[_0x318f('0x33')][_0x318f('0x47')]){_0x571cc6[_0x318f('0x42')]=[{'all':!![]}];}_0x571cc6=_['merge']({},_0x571cc6,_0x3891fd[_0x318f('0x41')]);return db['JscriptyProject'][_0x318f('0x48')](_0x571cc6)[_0x318f('0x26')](handleEntityNotFound(_0x45220b,null))[_0x318f('0x26')](function(_0x80227f){if(_0x80227f){var _0x273c93=_0x80227f[_0x318f('0x27')]({'plain':!![]});_0x273c93=qs[_0x318f('0x51')](_0x273c93,['id',_0x318f('0x52'),'updatedAt']);_0x3891fd[_0x318f('0x53')]=_[_0x318f('0x51')](_0x3891fd['body'],['id','createdAt',_0x318f('0x54')]);return db['JscriptyProject'][_0x318f('0x49')](_[_0x318f('0x40')](_0x273c93,_0x3891fd[_0x318f('0x53')]),{'include':_0x3891fd[_0x318f('0x33')][_0x318f('0x47')]?[{'all':!![]}]:undefined})[_0x318f('0x26')](function(_0x1bd580){var _0xd85d28=_0x3891fd['user'][_0x318f('0x27')]({'plain':!![]});if(!_0xd85d28)throw new Error(_0x318f('0x4b'));if(_0xd85d28[_0x318f('0x4c')]===_0x318f('0x4a')){var _0x5cf084=_0x1bd580[_0x318f('0x27')]({'plain':!![]});var _0x32a08d=_0x318f('0x28');return db['UserProfileSection'][_0x318f('0x48')]({'where':{'name':_0x32a08d,'userProfileId':_0xd85d28[_0x318f('0x4e')]},'raw':!![]})[_0x318f('0x26')](function(_0x46b28f){if(_0x46b28f&&_0x46b28f[_0x318f('0x4f')]===0x0){return db[_0x318f('0x29')][_0x318f('0x49')]({'name':_0x5cf084[_0x318f('0x2b')],'resourceId':_0x5cf084['id'],'type':_0x46b28f[_0x318f('0x2b')],'sectionId':_0x46b28f['id']},{})[_0x318f('0x26')](function(){return _0x1bd580;});}else{return _0x1bd580;}})[_0x318f('0x44')](function(_0x57ecab){logger[_0x318f('0x2a')](_0x318f('0x55'),_0x57ecab);throw _0x57ecab;});}return _0x1bd580;});}})[_0x318f('0x26')](respondWithResult(_0x45220b,0xc9))['catch'](handleError(_0x45220b,null));};exports[_0x318f('0x24')]=function(_0xb20b2b,_0x3301f9){if(_0xb20b2b[_0x318f('0x53')]['id']){delete _0xb20b2b[_0x318f('0x53')]['id'];}return db[_0x318f('0x2f')][_0x318f('0x48')]({'where':{'id':_0xb20b2b['params']['id']}})[_0x318f('0x26')](handleEntityNotFound(_0x3301f9,null))[_0x318f('0x26')](saveUpdates(_0xb20b2b['body'],null))[_0x318f('0x26')](respondWithResult(_0x3301f9,null))[_0x318f('0x44')](handleError(_0x3301f9,null));};exports[_0x318f('0x25')]=function(_0x597360,_0x33ccb4){return db[_0x318f('0x2f')]['find']({'where':{'id':_0x597360['params']['id']}})[_0x318f('0x26')](handleEntityNotFound(_0x33ccb4,null))[_0x318f('0x26')](removeEntity(_0x33ccb4,null))[_0x318f('0x44')](handleError(_0x33ccb4,null));};exports[_0x318f('0x56')]=function(_0x52d322,_0x2ab13a,_0x51e547){var _0x46a434={'raw':!![],'where':{}};var _0xc2147a={};var _0x3c8be0={'count':0x0,'rows':[]};return db[_0x318f('0x2f')][_0x318f('0x57')]({'where':{'id':_0x52d322[_0x318f('0x46')]['id']}})[_0x318f('0x26')](handleEntityNotFound(_0x2ab13a,null))['then'](function(_0x481686){if(_0x481686){_0xc2147a[_0x318f('0x32')]=_[_0x318f('0x34')](db[_0x318f('0x58')][_0x318f('0x30')]);_0xc2147a[_0x318f('0x33')]=_[_0x318f('0x34')](_0x52d322[_0x318f('0x33')]);_0xc2147a['filters']=_[_0x318f('0x36')](_0xc2147a['model'],_0xc2147a[_0x318f('0x33')]);_0x46a434[_0x318f('0x37')]=_[_0x318f('0x36')](_0xc2147a[_0x318f('0x32')],qs[_0x318f('0x38')](_0x52d322[_0x318f('0x33')][_0x318f('0x38')]));_0x46a434[_0x318f('0x37')]=_0x46a434[_0x318f('0x37')]['length']?_0x46a434[_0x318f('0x37')]:_0xc2147a[_0x318f('0x32')];if(!_0x52d322[_0x318f('0x33')][_0x318f('0x3a')](_0x318f('0x3b'))){_0x46a434[_0x318f('0x1e')]=qs[_0x318f('0x1e')](_0x52d322[_0x318f('0x33')][_0x318f('0x1e')]);_0x46a434['offset']=qs[_0x318f('0x1b')](_0x52d322[_0x318f('0x33')][_0x318f('0x1b')]);}_0x46a434[_0x318f('0x59')]=qs['sort'](_0x52d322[_0x318f('0x33')][_0x318f('0x5a')]);_0x46a434[_0x318f('0x3c')]=qs[_0x318f('0x35')](_['pick'](_0x52d322[_0x318f('0x33')],_0xc2147a[_0x318f('0x35')]));_0x46a434[_0x318f('0x3c')][_0x318f('0x5b')]=_0x481686['id'];if(_0x52d322[_0x318f('0x33')][_0x318f('0x3f')]){_0x46a434['where']=_[_0x318f('0x40')](_0x46a434[_0x318f('0x3c')],{'$or':_[_0x318f('0x2e')](_0x46a434[_0x318f('0x37')],function(_0xf35b84){var _0x2d012a={};_0x2d012a[_0xf35b84]={'$like':'%'+_0x52d322[_0x318f('0x33')][_0x318f('0x3f')]+'%'};return _0x2d012a;})});}_0x46a434=_[_0x318f('0x40')]({},_0x46a434,_0x52d322[_0x318f('0x41')]);return db[_0x318f('0x58')]['count']({'where':_0x46a434['where']})[_0x318f('0x26')](function(_0x1de118){_0x3c8be0[_0x318f('0x1d')]=_0x1de118;if(_0x52d322[_0x318f('0x33')]['includeAll']){_0x46a434['include']=[{'all':!![]}];}return db[_0x318f('0x58')][_0x318f('0x43')](_0x46a434);})[_0x318f('0x26')](function(_0x3b14cf){_0x3c8be0[_0x318f('0x5c')]=_0x3b14cf;return _0x3c8be0;});}})[_0x318f('0x26')](respondWithFilteredResult(_0x2ab13a,_0x46a434))[_0x318f('0x44')](handleError(_0x2ab13a,null));};exports[_0x318f('0x5d')]=function(_0x17126f,_0x2e9826,_0x1aecad){var _0x3fcc05={'raw':!![],'where':{}};var _0x1a34b4={};var _0x46f36f={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x318f('0x57')]({'where':{'id':_0x17126f[_0x318f('0x46')]['id']}})[_0x318f('0x26')](handleEntityNotFound(_0x2e9826,null))[_0x318f('0x26')](function(_0x170197){if(_0x170197){_0x1a34b4[_0x318f('0x32')]=_['keys'](db['JscriptyAnswerReport'][_0x318f('0x30')]);_0x1a34b4[_0x318f('0x33')]=_['keys'](_0x17126f[_0x318f('0x33')]);_0x1a34b4['filters']=_['intersection'](_0x1a34b4[_0x318f('0x32')],_0x1a34b4[_0x318f('0x33')]);_0x3fcc05['attributes']=_[_0x318f('0x36')](_0x1a34b4[_0x318f('0x32')],qs['fields'](_0x17126f[_0x318f('0x33')]['fields']));_0x3fcc05[_0x318f('0x37')]=_0x3fcc05['attributes'][_0x318f('0x39')]?_0x3fcc05[_0x318f('0x37')]:_0x1a34b4[_0x318f('0x32')];if(!_0x17126f[_0x318f('0x33')][_0x318f('0x3a')](_0x318f('0x3b'))){_0x3fcc05[_0x318f('0x1e')]=qs[_0x318f('0x1e')](_0x17126f['query'][_0x318f('0x1e')]);_0x3fcc05[_0x318f('0x1b')]=qs['offset'](_0x17126f[_0x318f('0x33')]['offset']);}_0x3fcc05[_0x318f('0x59')]=qs['sort'](_0x17126f[_0x318f('0x33')]['sort']);_0x3fcc05[_0x318f('0x3c')]=qs[_0x318f('0x35')](_[_0x318f('0x3d')](_0x17126f[_0x318f('0x33')],_0x1a34b4[_0x318f('0x35')]));_0x3fcc05[_0x318f('0x3c')]['ProjectId']=_0x170197['id'];if(_0x17126f[_0x318f('0x33')][_0x318f('0x3f')]){_0x3fcc05['where']=_['merge'](_0x3fcc05[_0x318f('0x3c')],{'$or':_[_0x318f('0x2e')](_0x3fcc05['attributes'],function(_0xec11d3){var _0xd91147={};_0xd91147[_0xec11d3]={'$like':'%'+_0x17126f[_0x318f('0x33')][_0x318f('0x3f')]+'%'};return _0xd91147;})});}_0x3fcc05=_[_0x318f('0x40')]({},_0x3fcc05,_0x17126f[_0x318f('0x41')]);return db['JscriptyAnswerReport']['count']({'where':_0x3fcc05[_0x318f('0x3c')]})[_0x318f('0x26')](function(_0x370e27){_0x46f36f[_0x318f('0x1d')]=_0x370e27;if(_0x17126f[_0x318f('0x33')][_0x318f('0x47')]){_0x3fcc05[_0x318f('0x42')]=[{'all':!![]}];}return db[_0x318f('0x5e')][_0x318f('0x43')](_0x3fcc05);})['then'](function(_0x4851c2){_0x46f36f[_0x318f('0x5c')]=_0x4851c2;return _0x46f36f;});}})[_0x318f('0x26')](respondWithFilteredResult(_0x2e9826,_0x3fcc05))['catch'](handleError(_0x2e9826,null));};function char(_0x5cc871){return _0x318f('0x5f')===typeof _0x5cc871?String[_0x318f('0x60')]['apply'](null,arguments):_0x5cc871;}function needsEncapsulation(_0x35f950){return!!_0x35f950&&(_0x35f950[_0x318f('0x61')]()['indexOf'](char(0xd))>=0x0||_0x35f950['toString']()[_0x318f('0x62')](char(0xa))>=0x0||_0x35f950[_0x318f('0x61')]()[_0x318f('0x62')](char(0x2c))>=0x0||_0x35f950[_0x318f('0x61')]()[_0x318f('0x62')](char(0x22))>=0x0);}function encapsulate(_0x3a2fe6){var _0xd2f51c=char(0x22),_0x3f4df9='\x5c'+char(0x22),_0x4817fb=_0x3a2fe6['toString']()['replace'](new RegExp(_0xd2f51c,'g'),_0x3f4df9);return _0xd2f51c+_0x4817fb+_0xd2f51c;}exports[_0x318f('0x63')]=function(_0x4da86a,_0x2e0ad2,_0x2f78be){var _0x10b0f8,_0x23b682;var _0x5cea0c={'where':{'ProjectId':_0x4da86a[_0x318f('0x46')]['id']}};if(_0x4da86a[_0x318f('0x33')][_0x318f('0x64')]){_0x5cea0c[_0x318f('0x3c')]['starttime']=JSON[_0x318f('0x65')](_0x4da86a[_0x318f('0x33')]['startTime']);}return db['JscriptySessionReport']['findAll'](_0x5cea0c)[_0x318f('0x26')](handleEntityNotFound(_0x2e0ad2,null))[_0x318f('0x26')](function(_0xf52f44){if(_0xf52f44){_0x10b0f8=_0xf52f44;return db[_0x318f('0x66')][_0x318f('0x43')]({'where':{'SessionId':{'$in':_[_0x318f('0x2e')](_0x10b0f8,'id')},'ProjectId':_0x4da86a[_0x318f('0x46')]['id']},'order':_0x318f('0x67')});}})[_0x318f('0x26')](handleEntityNotFound(_0x2e0ad2,null))['then'](function(_0xce35d0){if(_0xce35d0){_0x23b682=_0xce35d0;var _0xd288f6={};for(var _0x39d758=0x0,_0xba276f=_0x23b682[_0x318f('0x39')];_0x39d758<_0xba276f;_0x39d758++){if(!_0xd288f6[_0x318f('0x3a')](_0x23b682[_0x39d758]['questionId'])){_0xd288f6[_0x23b682[_0x39d758]['questionId']]=needsEncapsulation(_0x23b682[_0x39d758][_0x318f('0x68')])?encapsulate(_0x23b682[_0x39d758][_0x318f('0x68')]):_0x23b682[_0x39d758][_0x318f('0x68')];}}var _0x282854=[],_0xa31af={};for(var _0x928196=0x0,_0x3604d4=_0x10b0f8[_0x318f('0x39')];_0x928196<_0x3604d4;_0x928196++){_0xa31af={'ProjectId':_0x4da86a['params']['id'],'SessionId':_0x10b0f8[_0x928196]['id'],'StartTime':moment(_0x10b0f8[_0x928196][_0x318f('0x69')])[_0x318f('0x6a')](_0x318f('0x6b'))};for(var _0x1b212b=0x0,_0x5e5172=_0x23b682[_0x318f('0x39')];_0x1b212b<_0x5e5172;_0x1b212b++){if(_0x23b682[_0x1b212b][_0x318f('0x6c')]==_0x10b0f8[_0x928196]['id']&&_0xd288f6[_0x318f('0x3a')](_0x23b682[_0x1b212b]['questionId'])){_0xa31af[_0xd288f6[_0x23b682[_0x1b212b][_0x318f('0x6d')]]]=_0x23b682[_0x1b212b][_0x318f('0x6e')];}}for(var _0x3894dc in _0xd288f6){if(!_0xa31af[_0x318f('0x3a')](_0xd288f6[_0x3894dc])){_0xa31af[_0xd288f6[_0x3894dc]]=null;}}_0x282854[_0x318f('0x6f')](_0xa31af);}return _0x282854;}})[_0x318f('0x26')](function(_0x4b949e){if(!_[_0x318f('0x70')](_0x4b949e)){var _0x3c935d=toCsv(_0x4b949e);var _0x1534f0=Date[_0x318f('0x71')]();fs[_0x318f('0x72')](util[_0x318f('0x6a')](_0x318f('0x73'),_0x4da86a[_0x318f('0x46')]['id'],_0x1534f0),_0x3c935d);_0x2e0ad2[_0x318f('0x74')](_0x318f('0x75'),'attachment;\x20filename='+util[_0x318f('0x6a')](_0x318f('0x76'),_0x4da86a[_0x318f('0x46')]['id'],_0x1534f0));_0x2e0ad2['setHeader'](_0x318f('0x77'),_0x318f('0x78'));return _0x2e0ad2['download'](util['format'](_0x318f('0x73'),_0x4da86a[_0x318f('0x46')]['id'],_0x1534f0));}else{return _0x2e0ad2[_0x318f('0x18')](0xcc);}})['catch'](handleError(_0x2e0ad2,null));}; \ No newline at end of file +var _0x7d25=['fromCharCode','toString','indexOf','replace','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId','answer','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','download','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','Projects','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','includeAll','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','updatedAt','body','getSessions','JscriptySessionReport','nolimit','order','ProjectId','findAll','getAnswers','findOne','JscriptyAnswerReport','number'];(function(_0x4abf9f,_0x5edac3){var _0x513755=function(_0x1e675f){while(--_0x1e675f){_0x4abf9f['push'](_0x4abf9f['shift']());}};_0x513755(++_0x5edac3);}(_0x7d25,0x8a));var _0x57d2=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x7d25[_0x178e48];return _0x440d7e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57d2('0x0'));var zipdir=require(_0x57d2('0x1'));var jsonpatch=require(_0x57d2('0x2'));var rp=require(_0x57d2('0x3'));var moment=require(_0x57d2('0x4'));var BPromise=require(_0x57d2('0x5'));var Mustache=require(_0x57d2('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x57d2('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57d2('0x8'));var squel=require(_0x57d2('0x9'));var crypto=require(_0x57d2('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x57d2('0xb'));var querystring=require('querystring');var Papa=require(_0x57d2('0xc'));var Redis=require(_0x57d2('0xd'));var authService=require(_0x57d2('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x57d2('0xf'));var hardwareService=require(_0x57d2('0x10'));var logger=require(_0x57d2('0x11'))(_0x57d2('0x12'));var utils=require(_0x57d2('0x13'));var config=require(_0x57d2('0x14'));var licenseUtil=require(_0x57d2('0x15'));var db=require(_0x57d2('0x16'))['db'];function respondWithStatusCode(_0x43d7fb,_0x32c33a){_0x32c33a=_0x32c33a||0xcc;return function(_0x28428b){if(_0x28428b){return _0x43d7fb[_0x57d2('0x17')](_0x32c33a);}return _0x43d7fb[_0x57d2('0x18')](_0x32c33a)[_0x57d2('0x19')]();};}function respondWithResult(_0x1ba57e,_0x4086f3){_0x4086f3=_0x4086f3||0xc8;return function(_0x5382d9){if(_0x5382d9){return _0x1ba57e['status'](_0x4086f3)[_0x57d2('0x1a')](_0x5382d9);}};}function respondWithFilteredResult(_0x148ef3,_0x4ec4b1){return function(_0x8cf637){if(_0x8cf637){var _0x319489=typeof _0x4ec4b1['offset']===_0x57d2('0x1b')&&typeof _0x4ec4b1['limit']===_0x57d2('0x1b');var _0x4b4fe0=_0x8cf637[_0x57d2('0x1c')];var _0x7d4cf1=_0x319489?0x0:_0x4ec4b1[_0x57d2('0x1d')];var _0x4a94e3=_0x319489?_0x8cf637['count']:_0x4ec4b1[_0x57d2('0x1d')]+_0x4ec4b1[_0x57d2('0x1e')];var _0x2662cd;if(_0x4a94e3>=_0x4b4fe0){_0x4a94e3=_0x4b4fe0;_0x2662cd=0xc8;}else{_0x2662cd=0xce;}_0x148ef3[_0x57d2('0x18')](_0x2662cd);return _0x148ef3['set'](_0x57d2('0x1f'),_0x7d4cf1+'-'+_0x4a94e3+'/'+_0x4b4fe0)[_0x57d2('0x1a')](_0x8cf637);}return null;};}function patchUpdates(_0x55191e){return function(_0x5f3fd5){try{jsonpatch[_0x57d2('0x20')](_0x5f3fd5,_0x55191e,!![]);}catch(_0x326d49){return BPromise[_0x57d2('0x21')](_0x326d49);}return _0x5f3fd5[_0x57d2('0x22')]();};}function saveUpdates(_0x386196,_0x803c25){return function(_0x32c7c8){if(_0x32c7c8){return _0x32c7c8[_0x57d2('0x23')](_0x386196)[_0x57d2('0x24')](function(_0x26718e){return _0x26718e;});}return null;};}function removeEntity(_0x46a4d1,_0x456fe1){return function(_0x12ff19){if(_0x12ff19){return _0x12ff19[_0x57d2('0x25')]()['then'](function(){var _0x424ddc=_0x12ff19[_0x57d2('0x26')]({'plain':!![]});var _0x3c7de8=_0x57d2('0x27');return db[_0x57d2('0x28')]['destroy']({'where':{'type':_0x3c7de8,'resourceId':_0x424ddc['id']}})[_0x57d2('0x24')](function(){return _0x12ff19;});})[_0x57d2('0x24')](function(){_0x46a4d1[_0x57d2('0x18')](0xcc)[_0x57d2('0x19')]();});}};}function handleEntityNotFound(_0x18d500,_0x4b3d8e){return function(_0x9bdb11){if(!_0x9bdb11){_0x18d500['sendStatus'](0x194);}return _0x9bdb11;};}function handleError(_0x1ae5ff,_0x15f1ba){_0x15f1ba=_0x15f1ba||0x1f4;return function(_0x277426){logger[_0x57d2('0x29')](_0x277426[_0x57d2('0x2a')]);if(_0x277426[_0x57d2('0x2b')]){delete _0x277426[_0x57d2('0x2b')];}_0x1ae5ff[_0x57d2('0x18')](_0x15f1ba)[_0x57d2('0x2c')](_0x277426);};}exports[_0x57d2('0x2d')]=function(_0x574589,_0x4e9178){var _0x3da926={},_0x26e052={},_0x3e017c={'count':0x0,'rows':[]};var _0x484597=_[_0x57d2('0x2e')](db[_0x57d2('0x2f')][_0x57d2('0x30')],function(_0x290c2d){return{'name':_0x290c2d[_0x57d2('0x31')],'type':_0x290c2d[_0x57d2('0x32')][_0x57d2('0x33')]};});_0x26e052[_0x57d2('0x34')]=_[_0x57d2('0x2e')](_0x484597,'name');_0x26e052[_0x57d2('0x35')]=_[_0x57d2('0x36')](_0x574589['query']);_0x26e052[_0x57d2('0x37')]=_[_0x57d2('0x38')](_0x26e052['model'],_0x26e052[_0x57d2('0x35')]);_0x3da926[_0x57d2('0x39')]=_[_0x57d2('0x38')](_0x26e052[_0x57d2('0x34')],qs[_0x57d2('0x3a')](_0x574589['query']['fields']));_0x3da926['attributes']=_0x3da926['attributes'][_0x57d2('0x3b')]?_0x3da926[_0x57d2('0x39')]:_0x26e052[_0x57d2('0x34')];if(!_0x574589[_0x57d2('0x35')][_0x57d2('0x3c')]('nolimit')){_0x3da926[_0x57d2('0x1e')]=qs['limit'](_0x574589[_0x57d2('0x35')][_0x57d2('0x1e')]);_0x3da926[_0x57d2('0x1d')]=qs['offset'](_0x574589[_0x57d2('0x35')][_0x57d2('0x1d')]);}_0x3da926['order']=qs[_0x57d2('0x3d')](_0x574589[_0x57d2('0x35')][_0x57d2('0x3d')]);_0x3da926[_0x57d2('0x3e')]=qs[_0x57d2('0x37')](_[_0x57d2('0x3f')](_0x574589['query'],_0x26e052[_0x57d2('0x37')]),_0x484597);if(_0x574589['query'][_0x57d2('0x40')]){_0x3da926[_0x57d2('0x3e')]=_[_0x57d2('0x41')](_0x3da926[_0x57d2('0x3e')],{'$or':_[_0x57d2('0x2e')](_0x484597,function(_0x512dbf){if(_0x512dbf[_0x57d2('0x32')]!==_0x57d2('0x42')){var _0x4f6955={};_0x4f6955[_0x512dbf[_0x57d2('0x2b')]]={'$like':'%'+_0x574589[_0x57d2('0x35')][_0x57d2('0x40')]+'%'};return _0x4f6955;}})});}_0x3da926=_['merge']({},_0x3da926,_0x574589[_0x57d2('0x43')]);var _0x2fe0cd={'where':_0x3da926[_0x57d2('0x3e')]};return db[_0x57d2('0x2f')]['count'](_0x2fe0cd)['then'](function(_0x11a2ec){_0x3e017c[_0x57d2('0x1c')]=_0x11a2ec;if(_0x574589[_0x57d2('0x35')]['includeAll']){_0x3da926['include']=[{'all':!![]}];}return db[_0x57d2('0x2f')]['findAll'](_0x3da926);})[_0x57d2('0x24')](function(_0x1bb8ad){_0x3e017c[_0x57d2('0x44')]=_0x1bb8ad;return _0x3e017c;})[_0x57d2('0x24')](respondWithFilteredResult(_0x4e9178,_0x3da926))[_0x57d2('0x45')](handleError(_0x4e9178,null));};exports['show']=function(_0x13216b,_0x1c069a){var _0x53ab43={'raw':![],'where':{'id':_0x13216b['params']['id']}},_0x775f8c={};_0x775f8c[_0x57d2('0x34')]=_[_0x57d2('0x36')](db[_0x57d2('0x2f')][_0x57d2('0x30')]);_0x775f8c['query']=_['keys'](_0x13216b[_0x57d2('0x35')]);_0x775f8c['filters']=_['intersection'](_0x775f8c[_0x57d2('0x34')],_0x775f8c['query']);_0x53ab43['attributes']=_[_0x57d2('0x38')](_0x775f8c['model'],qs[_0x57d2('0x3a')](_0x13216b['query'][_0x57d2('0x3a')]));_0x53ab43['attributes']=_0x53ab43['attributes'][_0x57d2('0x3b')]?_0x53ab43[_0x57d2('0x39')]:_0x775f8c[_0x57d2('0x34')];if(_0x13216b[_0x57d2('0x35')][_0x57d2('0x46')]){_0x53ab43[_0x57d2('0x47')]=[{'all':!![]}];}_0x53ab43=_['merge']({},_0x53ab43,_0x13216b[_0x57d2('0x43')]);return db[_0x57d2('0x2f')][_0x57d2('0x48')](_0x53ab43)[_0x57d2('0x24')](handleEntityNotFound(_0x1c069a,null))[_0x57d2('0x24')](respondWithResult(_0x1c069a,null))[_0x57d2('0x45')](handleError(_0x1c069a,null));};exports[_0x57d2('0x49')]=function(_0x406375,_0x51f172){return db[_0x57d2('0x2f')][_0x57d2('0x49')](_0x406375['body'],{})[_0x57d2('0x24')](function(_0x5b06f7){var _0x59a6eb=_0x406375[_0x57d2('0x4a')][_0x57d2('0x26')]({'plain':!![]});if(!_0x59a6eb)throw new Error(_0x57d2('0x4b'));if(_0x59a6eb[_0x57d2('0x4c')]==='user'){var _0x265d24=_0x5b06f7[_0x57d2('0x26')]({'plain':!![]});var _0x51b535='Projects';return db[_0x57d2('0x4d')][_0x57d2('0x48')]({'where':{'name':_0x51b535,'userProfileId':_0x59a6eb[_0x57d2('0x4e')]},'raw':!![]})[_0x57d2('0x24')](function(_0x3092c8){if(_0x3092c8&&_0x3092c8[_0x57d2('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x265d24['name'],'resourceId':_0x265d24['id'],'type':_0x3092c8[_0x57d2('0x2b')],'sectionId':_0x3092c8['id']},{})['then'](function(){return _0x5b06f7;});}else{return _0x5b06f7;}})[_0x57d2('0x45')](function(_0x2ef710){logger['error'](_0x57d2('0x50'),_0x2ef710);throw _0x2ef710;});}return _0x5b06f7;})[_0x57d2('0x24')](respondWithResult(_0x51f172,0xc9))[_0x57d2('0x45')](handleError(_0x51f172,null));};exports['clone']=function(_0x10d4e5,_0x224b7d){var _0x25e121={'where':{'id':_0x10d4e5[_0x57d2('0x51')]['id']}},_0x1d8329={};_0x1d8329[_0x57d2('0x34')]=_[_0x57d2('0x36')](db[_0x57d2('0x2f')][_0x57d2('0x30')]);_0x25e121['attributes']=_[_0x57d2('0x38')](_0x1d8329[_0x57d2('0x34')],qs[_0x57d2('0x3a')](_0x10d4e5['query'][_0x57d2('0x3a')]));_0x25e121[_0x57d2('0x39')]=_0x25e121[_0x57d2('0x39')]['length']?_0x25e121['attributes']:_0x1d8329['model'];if(_0x10d4e5[_0x57d2('0x35')]['includeAll']){_0x25e121[_0x57d2('0x47')]=[{'all':!![]}];}_0x25e121=_['merge']({},_0x25e121,_0x10d4e5[_0x57d2('0x43')]);return db['JscriptyProject'][_0x57d2('0x48')](_0x25e121)[_0x57d2('0x24')](handleEntityNotFound(_0x224b7d,null))[_0x57d2('0x24')](function(_0x54640d){if(_0x54640d){var _0x5985e4=_0x54640d[_0x57d2('0x26')]({'plain':!![]});_0x5985e4=qs[_0x57d2('0x52')](_0x5985e4,['id',_0x57d2('0x53'),_0x57d2('0x54')]);_0x10d4e5[_0x57d2('0x55')]=_[_0x57d2('0x52')](_0x10d4e5['body'],['id','createdAt',_0x57d2('0x54')]);return db[_0x57d2('0x2f')][_0x57d2('0x49')](_[_0x57d2('0x41')](_0x5985e4,_0x10d4e5['body']),{'include':_0x10d4e5['query'][_0x57d2('0x46')]?[{'all':!![]}]:undefined})[_0x57d2('0x24')](function(_0x4f6b8a){var _0xad397=_0x10d4e5[_0x57d2('0x4a')][_0x57d2('0x26')]({'plain':!![]});if(!_0xad397)throw new Error(_0x57d2('0x4b'));if(_0xad397['role']==='user'){var _0x55f669=_0x4f6b8a['get']({'plain':!![]});var _0x434cb7=_0x57d2('0x27');return db[_0x57d2('0x4d')][_0x57d2('0x48')]({'where':{'name':_0x434cb7,'userProfileId':_0xad397[_0x57d2('0x4e')]},'raw':!![]})[_0x57d2('0x24')](function(_0x2737ab){if(_0x2737ab&&_0x2737ab['autoAssociation']===0x0){return db[_0x57d2('0x28')]['create']({'name':_0x55f669[_0x57d2('0x2b')],'resourceId':_0x55f669['id'],'type':_0x2737ab['name'],'sectionId':_0x2737ab['id']},{})[_0x57d2('0x24')](function(){return _0x4f6b8a;});}else{return _0x4f6b8a;}})[_0x57d2('0x45')](function(_0x453e6c){logger[_0x57d2('0x29')](_0x57d2('0x50'),_0x453e6c);throw _0x453e6c;});}return _0x4f6b8a;});}})[_0x57d2('0x24')](respondWithResult(_0x224b7d,0xc9))['catch'](handleError(_0x224b7d,null));};exports[_0x57d2('0x23')]=function(_0x24d3bf,_0x27b27a){if(_0x24d3bf[_0x57d2('0x55')]['id']){delete _0x24d3bf[_0x57d2('0x55')]['id'];}return db[_0x57d2('0x2f')][_0x57d2('0x48')]({'where':{'id':_0x24d3bf[_0x57d2('0x51')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x27b27a,null))['then'](saveUpdates(_0x24d3bf[_0x57d2('0x55')],null))['then'](respondWithResult(_0x27b27a,null))['catch'](handleError(_0x27b27a,null));};exports['destroy']=function(_0x270de8,_0x4b92e1){return db[_0x57d2('0x2f')][_0x57d2('0x48')]({'where':{'id':_0x270de8['params']['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x4b92e1,null))[_0x57d2('0x24')](removeEntity(_0x4b92e1,null))[_0x57d2('0x45')](handleError(_0x4b92e1,null));};exports[_0x57d2('0x56')]=function(_0x5eb7a3,_0x3afeb9,_0xfa63ab){var _0x53a4b0={'raw':!![],'where':{}};var _0x4cfae2={};var _0x28c7ff={'count':0x0,'rows':[]};return db[_0x57d2('0x2f')]['findOne']({'where':{'id':_0x5eb7a3[_0x57d2('0x51')]['id']}})[_0x57d2('0x24')](handleEntityNotFound(_0x3afeb9,null))[_0x57d2('0x24')](function(_0x858d6e){if(_0x858d6e){_0x4cfae2[_0x57d2('0x34')]=_[_0x57d2('0x36')](db[_0x57d2('0x57')][_0x57d2('0x30')]);_0x4cfae2[_0x57d2('0x35')]=_[_0x57d2('0x36')](_0x5eb7a3[_0x57d2('0x35')]);_0x4cfae2[_0x57d2('0x37')]=_[_0x57d2('0x38')](_0x4cfae2['model'],_0x4cfae2[_0x57d2('0x35')]);_0x53a4b0[_0x57d2('0x39')]=_[_0x57d2('0x38')](_0x4cfae2[_0x57d2('0x34')],qs[_0x57d2('0x3a')](_0x5eb7a3[_0x57d2('0x35')][_0x57d2('0x3a')]));_0x53a4b0[_0x57d2('0x39')]=_0x53a4b0[_0x57d2('0x39')][_0x57d2('0x3b')]?_0x53a4b0[_0x57d2('0x39')]:_0x4cfae2[_0x57d2('0x34')];if(!_0x5eb7a3[_0x57d2('0x35')][_0x57d2('0x3c')](_0x57d2('0x58'))){_0x53a4b0[_0x57d2('0x1e')]=qs['limit'](_0x5eb7a3[_0x57d2('0x35')][_0x57d2('0x1e')]);_0x53a4b0['offset']=qs[_0x57d2('0x1d')](_0x5eb7a3[_0x57d2('0x35')][_0x57d2('0x1d')]);}_0x53a4b0[_0x57d2('0x59')]=qs['sort'](_0x5eb7a3[_0x57d2('0x35')]['sort']);_0x53a4b0['where']=qs[_0x57d2('0x37')](_['pick'](_0x5eb7a3[_0x57d2('0x35')],_0x4cfae2[_0x57d2('0x37')]));_0x53a4b0[_0x57d2('0x3e')][_0x57d2('0x5a')]=_0x858d6e['id'];if(_0x5eb7a3['query'][_0x57d2('0x40')]){_0x53a4b0[_0x57d2('0x3e')]=_[_0x57d2('0x41')](_0x53a4b0[_0x57d2('0x3e')],{'$or':_[_0x57d2('0x2e')](_0x53a4b0[_0x57d2('0x39')],function(_0xc26657){var _0x41ca89={};_0x41ca89[_0xc26657]={'$like':'%'+_0x5eb7a3[_0x57d2('0x35')][_0x57d2('0x40')]+'%'};return _0x41ca89;})});}_0x53a4b0=_['merge']({},_0x53a4b0,_0x5eb7a3[_0x57d2('0x43')]);return db[_0x57d2('0x57')][_0x57d2('0x1c')]({'where':_0x53a4b0[_0x57d2('0x3e')]})[_0x57d2('0x24')](function(_0x1375fa){_0x28c7ff[_0x57d2('0x1c')]=_0x1375fa;if(_0x5eb7a3[_0x57d2('0x35')][_0x57d2('0x46')]){_0x53a4b0[_0x57d2('0x47')]=[{'all':!![]}];}return db[_0x57d2('0x57')][_0x57d2('0x5b')](_0x53a4b0);})['then'](function(_0x5aa569){_0x28c7ff[_0x57d2('0x44')]=_0x5aa569;return _0x28c7ff;});}})[_0x57d2('0x24')](respondWithFilteredResult(_0x3afeb9,_0x53a4b0))[_0x57d2('0x45')](handleError(_0x3afeb9,null));};exports[_0x57d2('0x5c')]=function(_0xe60b2e,_0x58040b,_0x54673d){var _0x3e9c36={'raw':!![],'where':{}};var _0x14b5e1={};var _0x20529b={'count':0x0,'rows':[]};return db[_0x57d2('0x2f')][_0x57d2('0x5d')]({'where':{'id':_0xe60b2e[_0x57d2('0x51')]['id']}})['then'](handleEntityNotFound(_0x58040b,null))[_0x57d2('0x24')](function(_0x2f5625){if(_0x2f5625){_0x14b5e1['model']=_['keys'](db['JscriptyAnswerReport']['rawAttributes']);_0x14b5e1[_0x57d2('0x35')]=_['keys'](_0xe60b2e[_0x57d2('0x35')]);_0x14b5e1['filters']=_[_0x57d2('0x38')](_0x14b5e1[_0x57d2('0x34')],_0x14b5e1[_0x57d2('0x35')]);_0x3e9c36[_0x57d2('0x39')]=_[_0x57d2('0x38')](_0x14b5e1['model'],qs[_0x57d2('0x3a')](_0xe60b2e[_0x57d2('0x35')][_0x57d2('0x3a')]));_0x3e9c36['attributes']=_0x3e9c36[_0x57d2('0x39')][_0x57d2('0x3b')]?_0x3e9c36[_0x57d2('0x39')]:_0x14b5e1[_0x57d2('0x34')];if(!_0xe60b2e[_0x57d2('0x35')][_0x57d2('0x3c')](_0x57d2('0x58'))){_0x3e9c36['limit']=qs['limit'](_0xe60b2e['query'][_0x57d2('0x1e')]);_0x3e9c36[_0x57d2('0x1d')]=qs[_0x57d2('0x1d')](_0xe60b2e['query'][_0x57d2('0x1d')]);}_0x3e9c36[_0x57d2('0x59')]=qs[_0x57d2('0x3d')](_0xe60b2e[_0x57d2('0x35')][_0x57d2('0x3d')]);_0x3e9c36[_0x57d2('0x3e')]=qs[_0x57d2('0x37')](_[_0x57d2('0x3f')](_0xe60b2e['query'],_0x14b5e1[_0x57d2('0x37')]));_0x3e9c36[_0x57d2('0x3e')][_0x57d2('0x5a')]=_0x2f5625['id'];if(_0xe60b2e[_0x57d2('0x35')]['filter']){_0x3e9c36['where']=_[_0x57d2('0x41')](_0x3e9c36['where'],{'$or':_[_0x57d2('0x2e')](_0x3e9c36['attributes'],function(_0x3a35d7){var _0x12fb54={};_0x12fb54[_0x3a35d7]={'$like':'%'+_0xe60b2e[_0x57d2('0x35')]['filter']+'%'};return _0x12fb54;})});}_0x3e9c36=_[_0x57d2('0x41')]({},_0x3e9c36,_0xe60b2e['options']);return db[_0x57d2('0x5e')][_0x57d2('0x1c')]({'where':_0x3e9c36[_0x57d2('0x3e')]})[_0x57d2('0x24')](function(_0x3c6aba){_0x20529b[_0x57d2('0x1c')]=_0x3c6aba;if(_0xe60b2e[_0x57d2('0x35')][_0x57d2('0x46')]){_0x3e9c36[_0x57d2('0x47')]=[{'all':!![]}];}return db[_0x57d2('0x5e')][_0x57d2('0x5b')](_0x3e9c36);})[_0x57d2('0x24')](function(_0x27e55b){_0x20529b[_0x57d2('0x44')]=_0x27e55b;return _0x20529b;});}})[_0x57d2('0x24')](respondWithFilteredResult(_0x58040b,_0x3e9c36))['catch'](handleError(_0x58040b,null));};function char(_0x3a7d89){return _0x57d2('0x5f')===typeof _0x3a7d89?String[_0x57d2('0x60')][_0x57d2('0x20')](null,arguments):_0x3a7d89;}function needsEncapsulation(_0x4d83cf){return!!_0x4d83cf&&(_0x4d83cf[_0x57d2('0x61')]()[_0x57d2('0x62')](char(0xd))>=0x0||_0x4d83cf[_0x57d2('0x61')]()['indexOf'](char(0xa))>=0x0||_0x4d83cf[_0x57d2('0x61')]()[_0x57d2('0x62')](char(0x2c))>=0x0||_0x4d83cf[_0x57d2('0x61')]()[_0x57d2('0x62')](char(0x22))>=0x0);}function encapsulate(_0x44d126){var _0xad3ca9=char(0x22),_0xb76480='\x5c'+char(0x22),_0x1ba236=_0x44d126[_0x57d2('0x61')]()[_0x57d2('0x63')](new RegExp(_0xad3ca9,'g'),_0xb76480);return _0xad3ca9+_0x1ba236+_0xad3ca9;}exports['getSummary']=function(_0x4ca002,_0x63db36,_0x3dc4ae){var _0x26ce9f,_0x19bc4b;var _0x4a4d97={'where':{'ProjectId':_0x4ca002[_0x57d2('0x51')]['id']}};if(_0x4ca002[_0x57d2('0x35')][_0x57d2('0x64')]){_0x4a4d97[_0x57d2('0x3e')][_0x57d2('0x65')]=JSON['parse'](_0x4ca002['query']['startTime']);}return db['JscriptySessionReport']['findAll'](_0x4a4d97)[_0x57d2('0x24')](handleEntityNotFound(_0x63db36,null))['then'](function(_0xd6ec3d){if(_0xd6ec3d){_0x26ce9f=_0xd6ec3d;return db[_0x57d2('0x66')]['findAll']({'where':{'SessionId':{'$in':_[_0x57d2('0x2e')](_0x26ce9f,'id')},'ProjectId':_0x4ca002['params']['id']},'order':_0x57d2('0x67')});}})[_0x57d2('0x24')](handleEntityNotFound(_0x63db36,null))[_0x57d2('0x24')](function(_0x1ea605){if(_0x1ea605){_0x19bc4b=_0x1ea605;var _0x52163e={};for(var _0x30ae34=0x0,_0x4aff18=_0x19bc4b['length'];_0x30ae34<_0x4aff18;_0x30ae34++){if(!_0x52163e[_0x57d2('0x3c')](_0x19bc4b[_0x30ae34][_0x57d2('0x68')])){_0x52163e[_0x19bc4b[_0x30ae34][_0x57d2('0x68')]]=needsEncapsulation(_0x19bc4b[_0x30ae34][_0x57d2('0x69')])?encapsulate(_0x19bc4b[_0x30ae34][_0x57d2('0x69')]):_0x19bc4b[_0x30ae34]['question'];}}var _0x4b7687=[],_0x1d1164={};for(var _0x42ce47=0x0,_0x2d1e7b=_0x26ce9f[_0x57d2('0x3b')];_0x42ce47<_0x2d1e7b;_0x42ce47++){_0x1d1164={'ProjectId':_0x4ca002[_0x57d2('0x51')]['id'],'SessionId':_0x26ce9f[_0x42ce47]['id'],'StartTime':moment(_0x26ce9f[_0x42ce47][_0x57d2('0x65')])[_0x57d2('0x6a')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x4fc95c=0x0,_0x305a6f=_0x19bc4b['length'];_0x4fc95c<_0x305a6f;_0x4fc95c++){if(_0x19bc4b[_0x4fc95c][_0x57d2('0x6b')]==_0x26ce9f[_0x42ce47]['id']&&_0x52163e[_0x57d2('0x3c')](_0x19bc4b[_0x4fc95c][_0x57d2('0x68')])){_0x1d1164[_0x52163e[_0x19bc4b[_0x4fc95c][_0x57d2('0x68')]]]=_0x19bc4b[_0x4fc95c][_0x57d2('0x6c')];}}for(var _0x5ebb32 in _0x52163e){if(!_0x1d1164[_0x57d2('0x3c')](_0x52163e[_0x5ebb32])){_0x1d1164[_0x52163e[_0x5ebb32]]=null;}}_0x4b7687['push'](_0x1d1164);}return _0x4b7687;}})[_0x57d2('0x24')](function(_0x888a75){if(!_[_0x57d2('0x6d')](_0x888a75)){var _0xfeaefd=toCsv(_0x888a75);var _0x41883f=Date[_0x57d2('0x6e')]();fs[_0x57d2('0x6f')](util[_0x57d2('0x6a')](_0x57d2('0x70'),_0x4ca002[_0x57d2('0x51')]['id'],_0x41883f),_0xfeaefd);_0x63db36[_0x57d2('0x71')]('Content-disposition','attachment;\x20filename='+util['format'](_0x57d2('0x72'),_0x4ca002[_0x57d2('0x51')]['id'],_0x41883f));_0x63db36[_0x57d2('0x71')](_0x57d2('0x73'),'text/csv');return _0x63db36[_0x57d2('0x74')](util[_0x57d2('0x6a')](_0x57d2('0x70'),_0x4ca002[_0x57d2('0x51')]['id'],_0x41883f));}else{return _0x63db36['sendStatus'](0xcc);}})[_0x57d2('0x45')](handleError(_0x63db36,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index f425307..a25dca9 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 _0xa22a=['jscripty_projects','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject'];(function(_0x4ab5ed,_0x557d37){var _0x2e00b5=function(_0x46c9a4){while(--_0x46c9a4){_0x4ab5ed['push'](_0x4ab5ed['shift']());}};_0x2e00b5(++_0x557d37);}(_0xa22a,0x153));var _0xaa22=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa22a[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xaa22('0x0'));var util=require(_0xaa22('0x1'));var logger=require(_0xaa22('0x2'))(_0xaa22('0x3'));var moment=require(_0xaa22('0x4'));var BPromise=require('bluebird');var rp=require(_0xaa22('0x5'));var fs=require('fs');var path=require(_0xaa22('0x6'));var rimraf=require(_0xaa22('0x7'));var config=require(_0xaa22('0x8'));var attributes=require(_0xaa22('0x9'));module[_0xaa22('0xa')]=function(_0x586717,_0x379cd4){return _0x586717['define'](_0xaa22('0xb'),attributes,{'tableName':_0xaa22('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf611=['path','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','util','../../config/logger','api'];(function(_0x4c0690,_0x4ae8fa){var _0x319270=function(_0x48a5b0){while(--_0x48a5b0){_0x4c0690['push'](_0x4c0690['shift']());}};_0x319270(++_0x4ae8fa);}(_0xf611,0x7b));var _0x1f61=function(_0x388914,_0x3c63f9){_0x388914=_0x388914-0x0;var _0x1f9111=_0xf611[_0x388914];return _0x1f9111;};'use strict';var _=require('lodash');var util=require(_0x1f61('0x0'));var logger=require(_0x1f61('0x1'))(_0x1f61('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f61('0x3'));var rimraf=require('rimraf');var config=require(_0x1f61('0x4'));var attributes=require(_0x1f61('0x5'));module['exports']=function(_0x4faa5b,_0x290165){return _0x4faa5b[_0x1f61('0x6')](_0x1f61('0x7'),attributes,{'tableName':_0x1f61('0x8'),'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 dce700d..ddaf710 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 _0xac4a=['JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xac4a,0x13f));var _0xaac4=function(_0x17a154,_0x3b86a0){_0x17a154=_0x17a154-0x0;var _0x4dbb97=_0xac4a[_0x17a154];return _0x4dbb97;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0x0713=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x348a2e,_0x55e645){var _0x165d97=function(_0x21cebe){while(--_0x21cebe){_0x348a2e['push'](_0x348a2e['shift']());}};_0x165d97(++_0x55e645);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('JscriptyProject,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 74030a6..4b49e62 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 _0x01a6=['../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','delete','destroy','exports','multer','util','path','fs-extra','../../components/interaction/service'];(function(_0x58a3c2,_0x1dfa94){var _0x167e4d=function(_0x12c1e8){while(--_0x12c1e8){_0x58a3c2['push'](_0x58a3c2['shift']());}};_0x167e4d(++_0x1dfa94);}(_0x01a6,0xd3));var _0x601a=function(_0x2e4708,_0x5a80cc){_0x2e4708=_0x2e4708-0x0;var _0xf9359=_0x01a6[_0x2e4708];return _0xf9359;};'use strict';var multer=require(_0x601a('0x0'));var util=require(_0x601a('0x1'));var path=require(_0x601a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x601a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x601a('0x4'));var config=require(_0x601a('0x5'));var controller=require(_0x601a('0x6'));router[_0x601a('0x7')]('/',auth[_0x601a('0x8')](),controller[_0x601a('0x9')]);router[_0x601a('0x7')](_0x601a('0xa'),auth[_0x601a('0x8')](),controller[_0x601a('0xb')]);router['get'](_0x601a('0xc'),auth[_0x601a('0x8')](),controller[_0x601a('0xd')]);router[_0x601a('0xe')]('/',auth[_0x601a('0x8')](),controller['create']);router['put'](_0x601a('0xc'),auth[_0x601a('0x8')](),controller['update']);router[_0x601a('0xf')](_0x601a('0xc'),auth[_0x601a('0x8')](),controller[_0x601a('0x10')]);module[_0x601a('0x11')]=router; \ No newline at end of file +var _0xe859=['/:id','show','post','put','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xe859,0xaf));var _0x9e85=function(_0x525790,_0x1064af){_0x525790=_0x525790-0x0;var _0x3e82db=_0xe859[_0x525790];return _0x3e82db;};'use strict';var multer=require('multer');var util=require(_0x9e85('0x0'));var path=require(_0x9e85('0x1'));var timeout=require(_0x9e85('0x2'));var express=require(_0x9e85('0x3'));var router=express['Router']();var fs_extra=require(_0x9e85('0x4'));var auth=require(_0x9e85('0x5'));var interaction=require(_0x9e85('0x6'));var config=require(_0x9e85('0x7'));var controller=require(_0x9e85('0x8'));router[_0x9e85('0x9')]('/',auth[_0x9e85('0xa')](),controller[_0x9e85('0xb')]);router[_0x9e85('0x9')](_0x9e85('0xc'),auth['isAuthenticated'](),controller[_0x9e85('0xd')]);router['get'](_0x9e85('0xe'),auth[_0x9e85('0xa')](),controller[_0x9e85('0xf')]);router[_0x9e85('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9e85('0x11')]('/:id',auth[_0x9e85('0xa')](),controller['update']);router[_0x9e85('0x12')]('/:id',auth[_0x9e85('0xa')](),controller[_0x9e85('0x13')]);module[_0x9e85('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 799c29d..1ffe32e 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(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x7a54,0x106));var _0x47a5=function(_0x275752,_0x27c516){_0x275752=_0x275752-0x0;var _0x5391e7=_0x7a54[_0x275752];return _0x5391e7;};'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(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x5a0db7,_0x5dd0d6){_0x5a0db7=_0x5a0db7-0x0;var _0x3ab2f4=_0x7a54[_0x5a0db7];return _0x3ab2f4;};'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 7086905..8d34fb1 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 _0xe38e=['sendStatus','end','status','json','offset','undefined','count','limit','apply','reject','update','then','destroy','error','stack','name','map','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','JscriptyQuestionReport','includeAll','include','findAll','rows','show','keys','rawAttributes','length','find','catch','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x127a30,_0x4cc470){var _0xa8f8a7=function(_0x3932a3){while(--_0x3932a3){_0x127a30['push'](_0x127a30['shift']());}};_0xa8f8a7(++_0x4cc470);}(_0xe38e,0x1b3));var _0xee38=function(_0x1a1494,_0xa2b7c0){_0x1a1494=_0x1a1494-0x0;var _0x48d314=_0xe38e[_0x1a1494];return _0x48d314;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xee38('0x0'));var zipdir=require(_0xee38('0x1'));var jsonpatch=require(_0xee38('0x2'));var rp=require(_0xee38('0x3'));var moment=require(_0xee38('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xee38('0x5'));var util=require(_0xee38('0x6'));var path=require('path');var sox=require(_0xee38('0x7'));var csv=require(_0xee38('0x8'));var ejs=require(_0xee38('0x9'));var fs=require('fs');var fs_extra=require(_0xee38('0xa'));var _=require(_0xee38('0xb'));var squel=require(_0xee38('0xc'));var crypto=require(_0xee38('0xd'));var jsforce=require(_0xee38('0xe'));var deskjs=require(_0xee38('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xee38('0x10'));var Redis=require(_0xee38('0x11'));var authService=require(_0xee38('0x12'));var qs=require(_0xee38('0x13'));var as=require(_0xee38('0x14'));var hardwareService=require(_0xee38('0x15'));var logger=require('../../config/logger')(_0xee38('0x16'));var utils=require(_0xee38('0x17'));var config=require(_0xee38('0x18'));var licenseUtil=require(_0xee38('0x19'));var db=require(_0xee38('0x1a'))['db'];function respondWithStatusCode(_0x451cf8,_0x3ce017){_0x3ce017=_0x3ce017||0xcc;return function(_0x336964){if(_0x336964){return _0x451cf8[_0xee38('0x1b')](_0x3ce017);}return _0x451cf8['status'](_0x3ce017)[_0xee38('0x1c')]();};}function respondWithResult(_0x486a68,_0xae24c7){_0xae24c7=_0xae24c7||0xc8;return function(_0x16b55a){if(_0x16b55a){return _0x486a68[_0xee38('0x1d')](_0xae24c7)[_0xee38('0x1e')](_0x16b55a);}};}function respondWithFilteredResult(_0x1231a1,_0x129333){return function(_0x34a559){if(_0x34a559){var _0x257d23=typeof _0x129333[_0xee38('0x1f')]===_0xee38('0x20')&&typeof _0x129333['limit']==='undefined';var _0x14aa95=_0x34a559[_0xee38('0x21')];var _0x33448b=_0x257d23?0x0:_0x129333[_0xee38('0x1f')];var _0x3f76cc=_0x257d23?_0x34a559[_0xee38('0x21')]:_0x129333[_0xee38('0x1f')]+_0x129333[_0xee38('0x22')];var _0x24a38b;if(_0x3f76cc>=_0x14aa95){_0x3f76cc=_0x14aa95;_0x24a38b=0xc8;}else{_0x24a38b=0xce;}_0x1231a1[_0xee38('0x1d')](_0x24a38b);return _0x1231a1['set']('Content-Range',_0x33448b+'-'+_0x3f76cc+'/'+_0x14aa95)[_0xee38('0x1e')](_0x34a559);}return null;};}function patchUpdates(_0x4f54c7){return function(_0x580761){try{jsonpatch[_0xee38('0x23')](_0x580761,_0x4f54c7,!![]);}catch(_0xac1ca7){return BPromise[_0xee38('0x24')](_0xac1ca7);}return _0x580761['save']();};}function saveUpdates(_0x31d261,_0x4f6f96){return function(_0x43fb34){if(_0x43fb34){return _0x43fb34[_0xee38('0x25')](_0x31d261)[_0xee38('0x26')](function(_0x5d4fb2){return _0x5d4fb2;});}return null;};}function removeEntity(_0x452b15,_0xdd392a){return function(_0xe04453){if(_0xe04453){return _0xe04453[_0xee38('0x27')]()[_0xee38('0x26')](function(){_0x452b15[_0xee38('0x1d')](0xcc)[_0xee38('0x1c')]();});}};}function handleEntityNotFound(_0x2e6121,_0x56b633){return function(_0x5ef1fd){if(!_0x5ef1fd){_0x2e6121[_0xee38('0x1b')](0x194);}return _0x5ef1fd;};}function handleError(_0x30540e,_0x53ff32){_0x53ff32=_0x53ff32||0x1f4;return function(_0x16b755){logger[_0xee38('0x28')](_0x16b755[_0xee38('0x29')]);if(_0x16b755[_0xee38('0x2a')]){delete _0x16b755[_0xee38('0x2a')];}_0x30540e['status'](_0x53ff32)['send'](_0x16b755);};}exports['index']=function(_0x119690,_0x5c839a){var _0x5d5865={},_0x5105fe={},_0x533498={'count':0x0,'rows':[]};var _0x56085d=_[_0xee38('0x2b')](db['JscriptyQuestionReport']['rawAttributes'],function(_0x5129d2){return{'name':_0x5129d2['fieldName'],'type':_0x5129d2['type'][_0xee38('0x2c')]};});_0x5105fe['model']=_[_0xee38('0x2b')](_0x56085d,_0xee38('0x2a'));_0x5105fe[_0xee38('0x2d')]=_['keys'](_0x119690[_0xee38('0x2d')]);_0x5105fe['filters']=_[_0xee38('0x2e')](_0x5105fe[_0xee38('0x2f')],_0x5105fe['query']);_0x5d5865[_0xee38('0x30')]=_[_0xee38('0x2e')](_0x5105fe[_0xee38('0x2f')],qs[_0xee38('0x31')](_0x119690['query'][_0xee38('0x31')]));_0x5d5865[_0xee38('0x30')]=_0x5d5865[_0xee38('0x30')]['length']?_0x5d5865[_0xee38('0x30')]:_0x5105fe[_0xee38('0x2f')];if(!_0x119690[_0xee38('0x2d')][_0xee38('0x32')](_0xee38('0x33'))){_0x5d5865[_0xee38('0x22')]=qs[_0xee38('0x22')](_0x119690[_0xee38('0x2d')][_0xee38('0x22')]);_0x5d5865[_0xee38('0x1f')]=qs[_0xee38('0x1f')](_0x119690[_0xee38('0x2d')][_0xee38('0x1f')]);}_0x5d5865[_0xee38('0x34')]=qs['sort'](_0x119690['query'][_0xee38('0x35')]);_0x5d5865[_0xee38('0x36')]=qs[_0xee38('0x37')](_[_0xee38('0x38')](_0x119690[_0xee38('0x2d')],_0x5105fe[_0xee38('0x37')]),_0x56085d);if(_0x119690[_0xee38('0x2d')]['filter']){_0x5d5865[_0xee38('0x36')]=_[_0xee38('0x39')](_0x5d5865[_0xee38('0x36')],{'$or':_[_0xee38('0x2b')](_0x56085d,function(_0x323e33){if(_0x323e33[_0xee38('0x3a')]!==_0xee38('0x3b')){var _0x33efd5={};_0x33efd5[_0x323e33['name']]={'$like':'%'+_0x119690[_0xee38('0x2d')][_0xee38('0x3c')]+'%'};return _0x33efd5;}})});}_0x5d5865=_[_0xee38('0x39')]({},_0x5d5865,_0x119690[_0xee38('0x3d')]);var _0x592694={'where':_0x5d5865['where']};return db[_0xee38('0x3e')]['count'](_0x592694)[_0xee38('0x26')](function(_0x35e4f9){_0x533498[_0xee38('0x21')]=_0x35e4f9;if(_0x119690[_0xee38('0x2d')][_0xee38('0x3f')]){_0x5d5865[_0xee38('0x40')]=[{'all':!![]}];}return db[_0xee38('0x3e')][_0xee38('0x41')](_0x5d5865);})[_0xee38('0x26')](function(_0x1a511a){_0x533498[_0xee38('0x42')]=_0x1a511a;return _0x533498;})[_0xee38('0x26')](respondWithFilteredResult(_0x5c839a,_0x5d5865))['catch'](handleError(_0x5c839a,null));};exports[_0xee38('0x43')]=function(_0x5c34ed,_0x235c3c){var _0x138394={'raw':!![],'where':{'id':_0x5c34ed['params']['id']}},_0x455c28={};_0x455c28[_0xee38('0x2f')]=_[_0xee38('0x44')](db[_0xee38('0x3e')][_0xee38('0x45')]);_0x455c28['query']=_[_0xee38('0x44')](_0x5c34ed[_0xee38('0x2d')]);_0x455c28[_0xee38('0x37')]=_[_0xee38('0x2e')](_0x455c28['model'],_0x455c28[_0xee38('0x2d')]);_0x138394['attributes']=_['intersection'](_0x455c28[_0xee38('0x2f')],qs[_0xee38('0x31')](_0x5c34ed[_0xee38('0x2d')][_0xee38('0x31')]));_0x138394['attributes']=_0x138394['attributes'][_0xee38('0x46')]?_0x138394[_0xee38('0x30')]:_0x455c28[_0xee38('0x2f')];if(_0x5c34ed[_0xee38('0x2d')][_0xee38('0x3f')]){_0x138394[_0xee38('0x40')]=[{'all':!![]}];}_0x138394=_[_0xee38('0x39')]({},_0x138394,_0x5c34ed[_0xee38('0x3d')]);return db[_0xee38('0x3e')][_0xee38('0x47')](_0x138394)[_0xee38('0x26')](handleEntityNotFound(_0x235c3c,null))[_0xee38('0x26')](respondWithResult(_0x235c3c,null))[_0xee38('0x48')](handleError(_0x235c3c,null));};exports[_0xee38('0x49')]=function(_0x9f09d3,_0x2fd743){return db[_0xee38('0x3e')][_0xee38('0x49')](_0x9f09d3[_0xee38('0x4a')],{})['then'](respondWithResult(_0x2fd743,0xc9))[_0xee38('0x48')](handleError(_0x2fd743,null));};exports[_0xee38('0x25')]=function(_0x9a1b96,_0x320e53){if(_0x9a1b96[_0xee38('0x4a')]['id']){delete _0x9a1b96[_0xee38('0x4a')]['id'];}return db[_0xee38('0x3e')][_0xee38('0x47')]({'where':{'id':_0x9a1b96[_0xee38('0x4b')]['id']}})['then'](handleEntityNotFound(_0x320e53,null))[_0xee38('0x26')](saveUpdates(_0x9a1b96[_0xee38('0x4a')],null))[_0xee38('0x26')](respondWithResult(_0x320e53,null))[_0xee38('0x48')](handleError(_0x320e53,null));};exports[_0xee38('0x27')]=function(_0x333e79,_0x22f35d){return db[_0xee38('0x3e')]['find']({'where':{'id':_0x333e79['params']['id']}})[_0xee38('0x26')](handleEntityNotFound(_0x22f35d,null))[_0xee38('0x26')](removeEntity(_0x22f35d,null))[_0xee38('0x48')](handleError(_0x22f35d,null));};exports[_0xee38('0x4c')]=function(_0x24d654,_0x26828e){return db[_0xee38('0x3e')][_0xee38('0x4c')]()[_0xee38('0x26')](respondWithResult(_0x26828e,null))['catch'](handleError(_0x26828e,null));}; \ No newline at end of file +var _0x8b63=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','then','sendStatus','stack','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','JscriptyQuestionReport','include','findAll','rows','show','params','includeAll','find','catch','create','body','describe','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','jsforce','papaparse'];(function(_0x1ae99a,_0x2550c4){var _0x56d9f2=function(_0x3babb5){while(--_0x3babb5){_0x1ae99a['push'](_0x1ae99a['shift']());}};_0x56d9f2(++_0x2550c4);}(_0x8b63,0x1a1));var _0x38b6=function(_0x20c373,_0x2d855e){_0x20c373=_0x20c373-0x0;var _0x417478=_0x8b63[_0x20c373];return _0x417478;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x38b6('0x0'));var rp=require(_0x38b6('0x1'));var moment=require(_0x38b6('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x38b6('0x3'));var path=require(_0x38b6('0x4'));var sox=require('sox');var csv=require(_0x38b6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38b6('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x38b6('0x7'));var deskjs=require('desk.js');var toCsv=require(_0x38b6('0x5'));var querystring=require('querystring');var Papa=require(_0x38b6('0x8'));var Redis=require(_0x38b6('0x9'));var authService=require(_0x38b6('0xa'));var qs=require(_0x38b6('0xb'));var as=require(_0x38b6('0xc'));var hardwareService=require(_0x38b6('0xd'));var logger=require(_0x38b6('0xe'))(_0x38b6('0xf'));var utils=require(_0x38b6('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x38b6('0x11'));var db=require(_0x38b6('0x12'))['db'];function respondWithStatusCode(_0x3ea0e2,_0x43a0e8){_0x43a0e8=_0x43a0e8||0xcc;return function(_0x6f3808){if(_0x6f3808){return _0x3ea0e2['sendStatus'](_0x43a0e8);}return _0x3ea0e2[_0x38b6('0x13')](_0x43a0e8)[_0x38b6('0x14')]();};}function respondWithResult(_0x30d1f8,_0x236fd8){_0x236fd8=_0x236fd8||0xc8;return function(_0x13cd54){if(_0x13cd54){return _0x30d1f8['status'](_0x236fd8)[_0x38b6('0x15')](_0x13cd54);}};}function respondWithFilteredResult(_0x55e7fc,_0x30ff92){return function(_0x346110){if(_0x346110){var _0x11a878=typeof _0x30ff92['offset']===_0x38b6('0x16')&&typeof _0x30ff92[_0x38b6('0x17')]===_0x38b6('0x16');var _0x5bc8bc=_0x346110[_0x38b6('0x18')];var _0x269ff3=_0x11a878?0x0:_0x30ff92[_0x38b6('0x19')];var _0x52c507=_0x11a878?_0x346110['count']:_0x30ff92[_0x38b6('0x19')]+_0x30ff92[_0x38b6('0x17')];var _0x1fd61b;if(_0x52c507>=_0x5bc8bc){_0x52c507=_0x5bc8bc;_0x1fd61b=0xc8;}else{_0x1fd61b=0xce;}_0x55e7fc[_0x38b6('0x13')](_0x1fd61b);return _0x55e7fc[_0x38b6('0x1a')](_0x38b6('0x1b'),_0x269ff3+'-'+_0x52c507+'/'+_0x5bc8bc)[_0x38b6('0x15')](_0x346110);}return null;};}function patchUpdates(_0x3ed194){return function(_0x354408){try{jsonpatch[_0x38b6('0x1c')](_0x354408,_0x3ed194,!![]);}catch(_0x2d4ec8){return BPromise['reject'](_0x2d4ec8);}return _0x354408[_0x38b6('0x1d')]();};}function saveUpdates(_0x453bcc,_0x2acb49){return function(_0x3dc0c8){if(_0x3dc0c8){return _0x3dc0c8[_0x38b6('0x1e')](_0x453bcc)['then'](function(_0x173259){return _0x173259;});}return null;};}function removeEntity(_0x149b41,_0x118da4){return function(_0x20b44d){if(_0x20b44d){return _0x20b44d[_0x38b6('0x1f')]()[_0x38b6('0x20')](function(){_0x149b41[_0x38b6('0x13')](0xcc)[_0x38b6('0x14')]();});}};}function handleEntityNotFound(_0x4e447b,_0x4405f7){return function(_0xe86d48){if(!_0xe86d48){_0x4e447b[_0x38b6('0x21')](0x194);}return _0xe86d48;};}function handleError(_0x329d4f,_0x4c9edd){_0x4c9edd=_0x4c9edd||0x1f4;return function(_0x2250ae){logger['error'](_0x2250ae[_0x38b6('0x22')]);if(_0x2250ae[_0x38b6('0x23')]){delete _0x2250ae['name'];}_0x329d4f[_0x38b6('0x13')](_0x4c9edd)['send'](_0x2250ae);};}exports[_0x38b6('0x24')]=function(_0xd9ab6a,_0x11ff32){var _0x32a35e={},_0x471c4f={},_0x375d12={'count':0x0,'rows':[]};var _0x57cece=_[_0x38b6('0x25')](db['JscriptyQuestionReport'][_0x38b6('0x26')],function(_0x202d54){return{'name':_0x202d54[_0x38b6('0x27')],'type':_0x202d54['type'][_0x38b6('0x28')]};});_0x471c4f[_0x38b6('0x29')]=_[_0x38b6('0x25')](_0x57cece,_0x38b6('0x23'));_0x471c4f['query']=_[_0x38b6('0x2a')](_0xd9ab6a[_0x38b6('0x2b')]);_0x471c4f[_0x38b6('0x2c')]=_[_0x38b6('0x2d')](_0x471c4f[_0x38b6('0x29')],_0x471c4f['query']);_0x32a35e['attributes']=_[_0x38b6('0x2d')](_0x471c4f[_0x38b6('0x29')],qs[_0x38b6('0x2e')](_0xd9ab6a[_0x38b6('0x2b')][_0x38b6('0x2e')]));_0x32a35e['attributes']=_0x32a35e[_0x38b6('0x2f')][_0x38b6('0x30')]?_0x32a35e[_0x38b6('0x2f')]:_0x471c4f[_0x38b6('0x29')];if(!_0xd9ab6a[_0x38b6('0x2b')][_0x38b6('0x31')](_0x38b6('0x32'))){_0x32a35e[_0x38b6('0x17')]=qs[_0x38b6('0x17')](_0xd9ab6a[_0x38b6('0x2b')][_0x38b6('0x17')]);_0x32a35e[_0x38b6('0x19')]=qs[_0x38b6('0x19')](_0xd9ab6a[_0x38b6('0x2b')][_0x38b6('0x19')]);}_0x32a35e['order']=qs[_0x38b6('0x33')](_0xd9ab6a[_0x38b6('0x2b')][_0x38b6('0x33')]);_0x32a35e[_0x38b6('0x34')]=qs[_0x38b6('0x2c')](_[_0x38b6('0x35')](_0xd9ab6a[_0x38b6('0x2b')],_0x471c4f['filters']),_0x57cece);if(_0xd9ab6a[_0x38b6('0x2b')][_0x38b6('0x36')]){_0x32a35e[_0x38b6('0x34')]=_['merge'](_0x32a35e[_0x38b6('0x34')],{'$or':_['map'](_0x57cece,function(_0x1e4a28){if(_0x1e4a28[_0x38b6('0x37')]!==_0x38b6('0x38')){var _0x3dcca3={};_0x3dcca3[_0x1e4a28[_0x38b6('0x23')]]={'$like':'%'+_0xd9ab6a['query'][_0x38b6('0x36')]+'%'};return _0x3dcca3;}})});}_0x32a35e=_[_0x38b6('0x39')]({},_0x32a35e,_0xd9ab6a[_0x38b6('0x3a')]);var _0x12836f={'where':_0x32a35e['where']};return db[_0x38b6('0x3b')][_0x38b6('0x18')](_0x12836f)[_0x38b6('0x20')](function(_0x550f20){_0x375d12[_0x38b6('0x18')]=_0x550f20;if(_0xd9ab6a[_0x38b6('0x2b')]['includeAll']){_0x32a35e[_0x38b6('0x3c')]=[{'all':!![]}];}return db[_0x38b6('0x3b')][_0x38b6('0x3d')](_0x32a35e);})[_0x38b6('0x20')](function(_0x1d48da){_0x375d12[_0x38b6('0x3e')]=_0x1d48da;return _0x375d12;})[_0x38b6('0x20')](respondWithFilteredResult(_0x11ff32,_0x32a35e))['catch'](handleError(_0x11ff32,null));};exports[_0x38b6('0x3f')]=function(_0xe2d5bb,_0x50503e){var _0xefd021={'raw':!![],'where':{'id':_0xe2d5bb[_0x38b6('0x40')]['id']}},_0x5ebfe1={};_0x5ebfe1[_0x38b6('0x29')]=_[_0x38b6('0x2a')](db[_0x38b6('0x3b')][_0x38b6('0x26')]);_0x5ebfe1[_0x38b6('0x2b')]=_[_0x38b6('0x2a')](_0xe2d5bb[_0x38b6('0x2b')]);_0x5ebfe1[_0x38b6('0x2c')]=_[_0x38b6('0x2d')](_0x5ebfe1[_0x38b6('0x29')],_0x5ebfe1[_0x38b6('0x2b')]);_0xefd021[_0x38b6('0x2f')]=_[_0x38b6('0x2d')](_0x5ebfe1[_0x38b6('0x29')],qs[_0x38b6('0x2e')](_0xe2d5bb[_0x38b6('0x2b')][_0x38b6('0x2e')]));_0xefd021[_0x38b6('0x2f')]=_0xefd021['attributes'][_0x38b6('0x30')]?_0xefd021[_0x38b6('0x2f')]:_0x5ebfe1['model'];if(_0xe2d5bb[_0x38b6('0x2b')][_0x38b6('0x41')]){_0xefd021['include']=[{'all':!![]}];}_0xefd021=_[_0x38b6('0x39')]({},_0xefd021,_0xe2d5bb[_0x38b6('0x3a')]);return db[_0x38b6('0x3b')][_0x38b6('0x42')](_0xefd021)[_0x38b6('0x20')](handleEntityNotFound(_0x50503e,null))[_0x38b6('0x20')](respondWithResult(_0x50503e,null))[_0x38b6('0x43')](handleError(_0x50503e,null));};exports[_0x38b6('0x44')]=function(_0x1f9357,_0x12e2be){return db[_0x38b6('0x3b')][_0x38b6('0x44')](_0x1f9357[_0x38b6('0x45')],{})[_0x38b6('0x20')](respondWithResult(_0x12e2be,0xc9))[_0x38b6('0x43')](handleError(_0x12e2be,null));};exports[_0x38b6('0x1e')]=function(_0x43b0c7,_0x43a510){if(_0x43b0c7[_0x38b6('0x45')]['id']){delete _0x43b0c7[_0x38b6('0x45')]['id'];}return db[_0x38b6('0x3b')]['find']({'where':{'id':_0x43b0c7['params']['id']}})['then'](handleEntityNotFound(_0x43a510,null))[_0x38b6('0x20')](saveUpdates(_0x43b0c7[_0x38b6('0x45')],null))['then'](respondWithResult(_0x43a510,null))[_0x38b6('0x43')](handleError(_0x43a510,null));};exports[_0x38b6('0x1f')]=function(_0x250606,_0x44b640){return db[_0x38b6('0x3b')]['find']({'where':{'id':_0x250606[_0x38b6('0x40')]['id']}})['then'](handleEntityNotFound(_0x44b640,null))[_0x38b6('0x20')](removeEntity(_0x44b640,null))[_0x38b6('0x43')](handleError(_0x44b640,null));};exports[_0x38b6('0x46')]=function(_0x1c6aaf,_0xf6ebc3){return db[_0x38b6('0x3b')][_0x38b6('0x46')]()['then'](respondWithResult(_0xf6ebc3,null))[_0x38b6('0x43')](handleError(_0xf6ebc3,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 47677b2..b2c8233 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 _0xa62d=['report_jscripty_questions','lodash','util','bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','JscriptyQuestionReport'];(function(_0x13a82f,_0x334dac){var _0x40979d=function(_0x34ae83){while(--_0x34ae83){_0x13a82f['push'](_0x13a82f['shift']());}};_0x40979d(++_0x334dac);}(_0xa62d,0x7f));var _0xda62=function(_0x4ea501,_0x1ab152){_0x4ea501=_0x4ea501-0x0;var _0x489f20=_0xa62d[_0x4ea501];return _0x489f20;};'use strict';var _=require(_0xda62('0x0'));var util=require(_0xda62('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xda62('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda62('0x3'));var rimraf=require(_0xda62('0x4'));var config=require(_0xda62('0x5'));var attributes=require(_0xda62('0x6'));module['exports']=function(_0x5e226e,_0x3881f2){return _0x5e226e['define'](_0xda62('0x7'),attributes,{'tableName':_0xda62('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x61fa=['JscriptyQuestionReport','lodash','api','moment','bluebird','request-promise','../../config/environment','./jscriptyQuestionReport.attributes','define'];(function(_0xcfcbaa,_0x369d95){var _0x157ed0=function(_0x3a0b62){while(--_0x3a0b62){_0xcfcbaa['push'](_0xcfcbaa['shift']());}};_0x157ed0(++_0x369d95);}(_0x61fa,0x1b1));var _0xa61f=function(_0x4f6c26,_0x5c2c54){_0x4f6c26=_0x4f6c26-0x0;var _0x4809a0=_0x61fa[_0x4f6c26];return _0x4809a0;};'use strict';var _=require(_0xa61f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa61f('0x1'));var moment=require(_0xa61f('0x2'));var BPromise=require(_0xa61f('0x3'));var rp=require(_0xa61f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa61f('0x5'));var attributes=require(_0xa61f('0x6'));module['exports']=function(_0x41033b,_0x6f2e89){return _0x41033b[_0xa61f('0x7')](_0xa61f('0x8'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 2117457..23ee50a 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 _0x9e02=['error','code','message','result','catch','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1e78be,_0x347be8){var _0x7b772=function(_0x31a96d){while(--_0x31a96d){_0x1e78be['push'](_0x1e78be['shift']());}};_0x7b772(++_0x347be8);}(_0x9e02,0x113));var _0x29e0=function(_0x47d1dc,_0x1073e7){_0x47d1dc=_0x47d1dc-0x0;var _0x58f535=_0x9e02[_0x47d1dc];return _0x58f535;};'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(_0x29e0('0x0'))['db'];var utils=require(_0x29e0('0x1'));var logger=require(_0x29e0('0x2'))('rpc');var config=require('../../config/environment');var jayson=require(_0x29e0('0x3'));var client=jayson[_0x29e0('0x4')][_0x29e0('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x5adecd,_0x43b44f,_0x11cf72){return new BPromise(function(_0x4170a5,_0xb94460){return client[_0x29e0('0x6')](_0x5adecd,_0x11cf72)[_0x29e0('0x7')](function(_0x491708){logger[_0x29e0('0x8')](_0x29e0('0x9'),_0x43b44f,_0x29e0('0xa'));logger['debug'](_0x29e0('0xb'),_0x43b44f,_0x29e0('0xa'),JSON[_0x29e0('0xc')](_0x491708));if(_0x491708[_0x29e0('0xd')]){if(_0x491708[_0x29e0('0xd')][_0x29e0('0xe')]===0x1f4){logger[_0x29e0('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x43b44f,_0x491708['error'][_0x29e0('0xf')]);return _0xb94460(_0x491708[_0x29e0('0xd')][_0x29e0('0xf')]);}logger[_0x29e0('0xd')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x43b44f,_0x491708['error']['message']);return _0x4170a5(_0x491708['error'][_0x29e0('0xf')]);}else{logger['info'](_0x29e0('0x9'),_0x43b44f,_0x29e0('0xa'));_0x4170a5(_0x491708[_0x29e0('0x10')]['message']);}})[_0x29e0('0x11')](function(_0x57626a){logger[_0x29e0('0xd')](_0x29e0('0x9'),_0x43b44f,_0x57626a);_0xb94460(_0x57626a);});});} \ No newline at end of file +var _0x4754=['../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5f50d4,_0x3d876a){var _0x2a13b0=function(_0xf7c3af){while(--_0xf7c3af){_0x5f50d4['push'](_0x5f50d4['shift']());}};_0x2a13b0(++_0x3d876a);}(_0x4754,0x1d7));var _0x4475=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4754[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4475('0x0'));var util=require(_0x4475('0x1'));var moment=require(_0x4475('0x2'));var BPromise=require(_0x4475('0x3'));var rs=require(_0x4475('0x4'));var fs=require('fs');var Redis=require(_0x4475('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4475('0x6'));var logger=require(_0x4475('0x7'))(_0x4475('0x8'));var config=require(_0x4475('0x9'));var jayson=require(_0x4475('0xa'));var client=jayson[_0x4475('0xb')][_0x4475('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x298726,_0x12c798,_0x33d8e5){return new BPromise(function(_0x52aa2d,_0x31e2b8){return client[_0x4475('0xd')](_0x298726,_0x33d8e5)[_0x4475('0xe')](function(_0x536712){logger[_0x4475('0xf')](_0x4475('0x10'),_0x12c798,_0x4475('0x11'));logger[_0x4475('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x12c798,'request\x20sent',JSON[_0x4475('0x13')](_0x536712));if(_0x536712[_0x4475('0x14')]){if(_0x536712[_0x4475('0x14')]['code']===0x1f4){logger[_0x4475('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x12c798,_0x536712[_0x4475('0x14')][_0x4475('0x15')]);return _0x31e2b8(_0x536712[_0x4475('0x14')]['message']);}logger[_0x4475('0x14')](_0x4475('0x10'),_0x12c798,_0x536712[_0x4475('0x14')][_0x4475('0x15')]);return _0x52aa2d(_0x536712['error'][_0x4475('0x15')]);}else{logger[_0x4475('0xf')](_0x4475('0x10'),_0x12c798,_0x4475('0x11'));_0x52aa2d(_0x536712[_0x4475('0x16')][_0x4475('0x15')]);}})[_0x4475('0x17')](function(_0x431767){logger[_0x4475('0x14')](_0x4475('0x10'),_0x12c798,_0x431767);_0x31e2b8(_0x431767);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 11995be..7e755b5 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 _0xd860=['delete','destroy','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','post','put','/:id','update'];(function(_0xa3bf8e,_0x35ab83){var _0x598375=function(_0x471e8d){while(--_0x471e8d){_0xa3bf8e['push'](_0xa3bf8e['shift']());}};_0x598375(++_0x35ab83);}(_0xd860,0x18f));var _0x0d86=function(_0x3e0592,_0x121c84){_0x3e0592=_0x3e0592-0x0;var _0x1135d3=_0xd860[_0x3e0592];return _0x1135d3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0d86('0x0'));var timeout=require(_0x0d86('0x1'));var express=require(_0x0d86('0x2'));var router=express[_0x0d86('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0d86('0x4'));var config=require(_0x0d86('0x5'));var controller=require('./jscriptySessionReport.controller');router[_0x0d86('0x6')]('/',auth[_0x0d86('0x7')](),controller[_0x0d86('0x8')]);router[_0x0d86('0x6')]('/describe',auth[_0x0d86('0x7')](),controller[_0x0d86('0x9')]);router['get']('/:id',auth[_0x0d86('0x7')](),controller[_0x0d86('0xa')]);router[_0x0d86('0x6')]('/:id/questions',auth[_0x0d86('0x7')](),controller['getQuestions']);router[_0x0d86('0xb')]('/',auth[_0x0d86('0x7')](),controller['create']);router[_0x0d86('0xc')](_0x0d86('0xd'),auth[_0x0d86('0x7')](),controller[_0x0d86('0xe')]);router[_0x0d86('0xf')](_0x0d86('0xd'),auth[_0x0d86('0x7')](),controller[_0x0d86('0x10')]);module[_0x0d86('0x11')]=router; \ No newline at end of file +var _0x0b43=['/:id/questions','post','create','put','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show'];(function(_0x3b8be2,_0x541473){var _0x2824fe=function(_0x197129){while(--_0x197129){_0x3b8be2['push'](_0x3b8be2['shift']());}};_0x2824fe(++_0x541473);}(_0x0b43,0x94));var _0x30b4=function(_0x299861,_0x86225f){_0x299861=_0x299861-0x0;var _0x12cdb3=_0x0b43[_0x299861];return _0x12cdb3;};'use strict';var multer=require(_0x30b4('0x0'));var util=require(_0x30b4('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x30b4('0x2'));var router=express[_0x30b4('0x3')]();var fs_extra=require(_0x30b4('0x4'));var auth=require(_0x30b4('0x5'));var interaction=require(_0x30b4('0x6'));var config=require('../../config/environment');var controller=require('./jscriptySessionReport.controller');router[_0x30b4('0x7')]('/',auth['isAuthenticated'](),controller[_0x30b4('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x30b4('0x7')](_0x30b4('0x9'),auth[_0x30b4('0xa')](),controller[_0x30b4('0xb')]);router[_0x30b4('0x7')](_0x30b4('0xc'),auth[_0x30b4('0xa')](),controller['getQuestions']);router[_0x30b4('0xd')]('/',auth[_0x30b4('0xa')](),controller[_0x30b4('0xe')]);router[_0x30b4('0xf')](_0x30b4('0x9'),auth[_0x30b4('0xa')](),controller[_0x30b4('0x10')]);router[_0x30b4('0x11')](_0x30b4('0x9'),auth[_0x30b4('0xa')](),controller[_0x30b4('0x12')]);module[_0x30b4('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 f5e61a3..d3fd2de 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 _0x09c2=['moment','exports','DATE','starttime','endtime','format','STRING','BOOLEAN'];(function(_0x2e497d,_0x1fc27d){var _0x4eb92a=function(_0xfb6112){while(--_0xfb6112){_0x2e497d['push'](_0x2e497d['shift']());}};_0x4eb92a(++_0x1fc27d);}(_0x09c2,0x100));var _0x209c=function(_0x3ef90f,_0x46f414){_0x3ef90f=_0x3ef90f-0x0;var _0x278fab=_0x09c2[_0x3ef90f];return _0x278fab;};'use strict';var moment=require(_0x209c('0x0'));var Sequelize=require('sequelize');module[_0x209c('0x1')]={'starttime':{'type':Sequelize[_0x209c('0x2')],'set':function(_0x1e5a8c){this['setDataValue'](_0x209c('0x3'),_0x1e5a8c);this['setDataValue'](_0x209c('0x4'),moment()[_0x209c('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x209c('0x2')]},'membername':{'type':Sequelize[_0x209c('0x6')]},'projectname':{'type':Sequelize[_0x209c('0x6')]},'queue':{'type':Sequelize[_0x209c('0x6')]},'uniqueid':{'type':Sequelize[_0x209c('0x6')]},'calleridname':{'type':Sequelize[_0x209c('0x6')]},'calleridnum':{'type':Sequelize[_0x209c('0x6')]},'completed':{'type':Sequelize[_0x209c('0x7')],'defaultValue':![]}}; \ No newline at end of file +var _0x0d24=['setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','exports','DATE'];(function(_0x4a2707,_0x56a7aa){var _0x2eb468=function(_0x5ef08d){while(--_0x5ef08d){_0x4a2707['push'](_0x4a2707['shift']());}};_0x2eb468(++_0x56a7aa);}(_0x0d24,0xeb));var _0x40d2=function(_0x4a8142,_0x482a01){_0x4a8142=_0x4a8142-0x0;var _0x548ee5=_0x0d24[_0x4a8142];return _0x548ee5;};'use strict';var moment=require(_0x40d2('0x0'));var Sequelize=require('sequelize');module[_0x40d2('0x1')]={'starttime':{'type':Sequelize[_0x40d2('0x2')],'set':function(_0x495591){this[_0x40d2('0x3')]('starttime',_0x495591);this['setDataValue'](_0x40d2('0x4'),moment()['format'](_0x40d2('0x5')));}},'endtime':{'type':Sequelize[_0x40d2('0x2')]},'membername':{'type':Sequelize[_0x40d2('0x6')]},'projectname':{'type':Sequelize[_0x40d2('0x6')]},'queue':{'type':Sequelize[_0x40d2('0x6')]},'uniqueid':{'type':Sequelize[_0x40d2('0x6')]},'calleridname':{'type':Sequelize[_0x40d2('0x6')]},'calleridnum':{'type':Sequelize[_0x40d2('0x6')]},'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 519e764..4f098cb 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 _0xf5be=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','key','model','map','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','rows','catch','show','params','includeAll','create','body','find','describe','findOne','SessionId','JscriptyQuestionReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x3b6588,_0x380e34){var _0x282f33=function(_0xd5d175){while(--_0xd5d175){_0x3b6588['push'](_0x3b6588['shift']());}};_0x282f33(++_0x380e34);}(_0xf5be,0x130));var _0xef5b=function(_0x54fc46,_0x1af6ce){_0x54fc46=_0x54fc46-0x0;var _0x576892=_0xf5be[_0x54fc46];return _0x576892;};'use strict';var emlformat=require(_0xef5b('0x0'));var rimraf=require(_0xef5b('0x1'));var zipdir=require(_0xef5b('0x2'));var jsonpatch=require(_0xef5b('0x3'));var rp=require(_0xef5b('0x4'));var moment=require(_0xef5b('0x5'));var BPromise=require(_0xef5b('0x6'));var Mustache=require('mustache');var util=require(_0xef5b('0x7'));var path=require('path');var sox=require(_0xef5b('0x8'));var csv=require(_0xef5b('0x9'));var ejs=require(_0xef5b('0xa'));var fs=require('fs');var fs_extra=require(_0xef5b('0xb'));var _=require(_0xef5b('0xc'));var squel=require('squel');var crypto=require(_0xef5b('0xd'));var jsforce=require(_0xef5b('0xe'));var deskjs=require(_0xef5b('0xf'));var toCsv=require(_0xef5b('0x9'));var querystring=require(_0xef5b('0x10'));var Papa=require(_0xef5b('0x11'));var Redis=require(_0xef5b('0x12'));var authService=require(_0xef5b('0x13'));var qs=require(_0xef5b('0x14'));var as=require(_0xef5b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xef5b('0x16'))('api');var utils=require(_0xef5b('0x17'));var config=require(_0xef5b('0x18'));var licenseUtil=require(_0xef5b('0x19'));var db=require(_0xef5b('0x1a'))['db'];function respondWithStatusCode(_0x2ec8dc,_0x4655b2){_0x4655b2=_0x4655b2||0xcc;return function(_0x540813){if(_0x540813){return _0x2ec8dc[_0xef5b('0x1b')](_0x4655b2);}return _0x2ec8dc[_0xef5b('0x1c')](_0x4655b2)[_0xef5b('0x1d')]();};}function respondWithResult(_0x10d00c,_0x1d2a6b){_0x1d2a6b=_0x1d2a6b||0xc8;return function(_0x577e3e){if(_0x577e3e){return _0x10d00c[_0xef5b('0x1c')](_0x1d2a6b)[_0xef5b('0x1e')](_0x577e3e);}};}function respondWithFilteredResult(_0x1f316d,_0x4b4cec){return function(_0x1dfb58){if(_0x1dfb58){var _0x37f8e0=typeof _0x4b4cec[_0xef5b('0x1f')]===_0xef5b('0x20')&&typeof _0x4b4cec[_0xef5b('0x21')]===_0xef5b('0x20');var _0x197459=_0x1dfb58[_0xef5b('0x22')];var _0xc435dc=_0x37f8e0?0x0:_0x4b4cec[_0xef5b('0x1f')];var _0x129958=_0x37f8e0?_0x1dfb58[_0xef5b('0x22')]:_0x4b4cec[_0xef5b('0x1f')]+_0x4b4cec['limit'];var _0x2dbe5f;if(_0x129958>=_0x197459){_0x129958=_0x197459;_0x2dbe5f=0xc8;}else{_0x2dbe5f=0xce;}_0x1f316d[_0xef5b('0x1c')](_0x2dbe5f);return _0x1f316d[_0xef5b('0x23')](_0xef5b('0x24'),_0xc435dc+'-'+_0x129958+'/'+_0x197459)['json'](_0x1dfb58);}return null;};}function patchUpdates(_0x6b4193){return function(_0xa967e3){try{jsonpatch[_0xef5b('0x25')](_0xa967e3,_0x6b4193,!![]);}catch(_0x26f02f){return BPromise[_0xef5b('0x26')](_0x26f02f);}return _0xa967e3[_0xef5b('0x27')]();};}function saveUpdates(_0x30c70c,_0x1af0a9){return function(_0x463ffc){if(_0x463ffc){return _0x463ffc[_0xef5b('0x28')](_0x30c70c)[_0xef5b('0x29')](function(_0x1bed15){return _0x1bed15;});}return null;};}function removeEntity(_0x3158d3,_0x39bbf2){return function(_0x28ce20){if(_0x28ce20){return _0x28ce20[_0xef5b('0x2a')]()[_0xef5b('0x29')](function(){_0x3158d3[_0xef5b('0x1c')](0xcc)[_0xef5b('0x1d')]();});}};}function handleEntityNotFound(_0x16d764,_0x2e7fe8){return function(_0x11f950){if(!_0x11f950){_0x16d764[_0xef5b('0x1b')](0x194);}return _0x11f950;};}function handleError(_0x40fe01,_0x27dff2){_0x27dff2=_0x27dff2||0x1f4;return function(_0x332233){logger[_0xef5b('0x2b')](_0x332233[_0xef5b('0x2c')]);if(_0x332233[_0xef5b('0x2d')]){delete _0x332233['name'];}_0x40fe01[_0xef5b('0x1c')](_0x27dff2)[_0xef5b('0x2e')](_0x332233);};}exports[_0xef5b('0x2f')]=function(_0x427b9f,_0x3f5d99){var _0x3a8068={},_0x1365c5={},_0xce49af={'count':0x0,'rows':[]};var _0x15e0fe=_['map'](db[_0xef5b('0x30')][_0xef5b('0x31')],function(_0x309982){return{'name':_0x309982[_0xef5b('0x32')],'type':_0x309982['type'][_0xef5b('0x33')]};});_0x1365c5[_0xef5b('0x34')]=_[_0xef5b('0x35')](_0x15e0fe,_0xef5b('0x2d'));_0x1365c5['query']=_[_0xef5b('0x36')](_0x427b9f['query']);_0x1365c5[_0xef5b('0x37')]=_['intersection'](_0x1365c5['model'],_0x1365c5[_0xef5b('0x38')]);_0x3a8068[_0xef5b('0x39')]=_[_0xef5b('0x3a')](_0x1365c5[_0xef5b('0x34')],qs[_0xef5b('0x3b')](_0x427b9f[_0xef5b('0x38')][_0xef5b('0x3b')]));_0x3a8068['attributes']=_0x3a8068[_0xef5b('0x39')][_0xef5b('0x3c')]?_0x3a8068[_0xef5b('0x39')]:_0x1365c5[_0xef5b('0x34')];if(!_0x427b9f[_0xef5b('0x38')][_0xef5b('0x3d')](_0xef5b('0x3e'))){_0x3a8068['limit']=qs[_0xef5b('0x21')](_0x427b9f[_0xef5b('0x38')][_0xef5b('0x21')]);_0x3a8068[_0xef5b('0x1f')]=qs['offset'](_0x427b9f['query'][_0xef5b('0x1f')]);}_0x3a8068[_0xef5b('0x3f')]=qs[_0xef5b('0x40')](_0x427b9f['query']['sort']);_0x3a8068[_0xef5b('0x41')]=qs[_0xef5b('0x37')](_[_0xef5b('0x42')](_0x427b9f['query'],_0x1365c5['filters']),_0x15e0fe);if(_0x427b9f[_0xef5b('0x38')][_0xef5b('0x43')]){_0x3a8068[_0xef5b('0x41')]=_[_0xef5b('0x44')](_0x3a8068['where'],{'$or':_[_0xef5b('0x35')](_0x15e0fe,function(_0x12b6ab){if(_0x12b6ab[_0xef5b('0x45')]!==_0xef5b('0x46')){var _0x736b11={};_0x736b11[_0x12b6ab['name']]={'$like':'%'+_0x427b9f['query'][_0xef5b('0x43')]+'%'};return _0x736b11;}})});}_0x3a8068=_[_0xef5b('0x44')]({},_0x3a8068,_0x427b9f[_0xef5b('0x47')]);var _0xfce2c8={'where':_0x3a8068['where']};return db['JscriptySessionReport']['count'](_0xfce2c8)[_0xef5b('0x29')](function(_0x5d6582){_0xce49af[_0xef5b('0x22')]=_0x5d6582;if(_0x427b9f[_0xef5b('0x38')]['includeAll']){_0x3a8068[_0xef5b('0x48')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x3a8068);})[_0xef5b('0x29')](function(_0xe4d658){_0xce49af[_0xef5b('0x49')]=_0xe4d658;return _0xce49af;})['then'](respondWithFilteredResult(_0x3f5d99,_0x3a8068))[_0xef5b('0x4a')](handleError(_0x3f5d99,null));};exports[_0xef5b('0x4b')]=function(_0x2fba00,_0x2a66c4){var _0x5edc88={'raw':!![],'where':{'id':_0x2fba00[_0xef5b('0x4c')]['id']}},_0x289ed3={};_0x289ed3[_0xef5b('0x34')]=_[_0xef5b('0x36')](db[_0xef5b('0x30')][_0xef5b('0x31')]);_0x289ed3[_0xef5b('0x38')]=_[_0xef5b('0x36')](_0x2fba00[_0xef5b('0x38')]);_0x289ed3[_0xef5b('0x37')]=_[_0xef5b('0x3a')](_0x289ed3[_0xef5b('0x34')],_0x289ed3[_0xef5b('0x38')]);_0x5edc88[_0xef5b('0x39')]=_['intersection'](_0x289ed3['model'],qs[_0xef5b('0x3b')](_0x2fba00['query'][_0xef5b('0x3b')]));_0x5edc88['attributes']=_0x5edc88['attributes']['length']?_0x5edc88['attributes']:_0x289ed3[_0xef5b('0x34')];if(_0x2fba00['query'][_0xef5b('0x4d')]){_0x5edc88[_0xef5b('0x48')]=[{'all':!![]}];}_0x5edc88=_[_0xef5b('0x44')]({},_0x5edc88,_0x2fba00[_0xef5b('0x47')]);return db['JscriptySessionReport']['find'](_0x5edc88)[_0xef5b('0x29')](handleEntityNotFound(_0x2a66c4,null))['then'](respondWithResult(_0x2a66c4,null))[_0xef5b('0x4a')](handleError(_0x2a66c4,null));};exports[_0xef5b('0x4e')]=function(_0x16c04b,_0x11877d){return db['JscriptySessionReport'][_0xef5b('0x4e')](_0x16c04b[_0xef5b('0x4f')],{})[_0xef5b('0x29')](respondWithResult(_0x11877d,0xc9))[_0xef5b('0x4a')](handleError(_0x11877d,null));};exports['update']=function(_0x1c7133,_0x25d380){if(_0x1c7133['body']['id']){delete _0x1c7133['body']['id'];}return db['JscriptySessionReport'][_0xef5b('0x50')]({'where':{'id':_0x1c7133[_0xef5b('0x4c')]['id']}})[_0xef5b('0x29')](handleEntityNotFound(_0x25d380,null))['then'](saveUpdates(_0x1c7133[_0xef5b('0x4f')],null))[_0xef5b('0x29')](respondWithResult(_0x25d380,null))['catch'](handleError(_0x25d380,null));};exports['destroy']=function(_0x123cb8,_0x4498b1){return db[_0xef5b('0x30')][_0xef5b('0x50')]({'where':{'id':_0x123cb8[_0xef5b('0x4c')]['id']}})[_0xef5b('0x29')](handleEntityNotFound(_0x4498b1,null))[_0xef5b('0x29')](removeEntity(_0x4498b1,null))[_0xef5b('0x4a')](handleError(_0x4498b1,null));};exports[_0xef5b('0x51')]=function(_0x5897df,_0x3f6cd7){return db[_0xef5b('0x30')][_0xef5b('0x51')]()[_0xef5b('0x29')](respondWithResult(_0x3f6cd7,null))[_0xef5b('0x4a')](handleError(_0x3f6cd7,null));};exports['getQuestions']=function(_0x4a2a74,_0x526e19,_0x49faed){var _0x414344={'raw':!![],'where':{}};var _0x5ac59d={};var _0x601962={'count':0x0,'rows':[]};return db[_0xef5b('0x30')][_0xef5b('0x52')]({'where':{'id':_0x4a2a74[_0xef5b('0x4c')]['id']}})[_0xef5b('0x29')](handleEntityNotFound(_0x526e19,null))[_0xef5b('0x29')](function(_0x53bd47){if(_0x53bd47){_0x5ac59d[_0xef5b('0x34')]=_['keys'](db['JscriptyQuestionReport'][_0xef5b('0x31')]);_0x5ac59d[_0xef5b('0x38')]=_['keys'](_0x4a2a74[_0xef5b('0x38')]);_0x5ac59d[_0xef5b('0x37')]=_['intersection'](_0x5ac59d[_0xef5b('0x34')],_0x5ac59d[_0xef5b('0x38')]);_0x414344[_0xef5b('0x39')]=_[_0xef5b('0x3a')](_0x5ac59d[_0xef5b('0x34')],qs[_0xef5b('0x3b')](_0x4a2a74[_0xef5b('0x38')][_0xef5b('0x3b')]));_0x414344[_0xef5b('0x39')]=_0x414344[_0xef5b('0x39')][_0xef5b('0x3c')]?_0x414344['attributes']:_0x5ac59d[_0xef5b('0x34')];if(!_0x4a2a74[_0xef5b('0x38')][_0xef5b('0x3d')](_0xef5b('0x3e'))){_0x414344[_0xef5b('0x21')]=qs[_0xef5b('0x21')](_0x4a2a74[_0xef5b('0x38')][_0xef5b('0x21')]);_0x414344[_0xef5b('0x1f')]=qs[_0xef5b('0x1f')](_0x4a2a74[_0xef5b('0x38')][_0xef5b('0x1f')]);}_0x414344[_0xef5b('0x3f')]=qs[_0xef5b('0x40')](_0x4a2a74[_0xef5b('0x38')][_0xef5b('0x40')]);_0x414344[_0xef5b('0x41')]=qs['filters'](_['pick'](_0x4a2a74[_0xef5b('0x38')],_0x5ac59d[_0xef5b('0x37')]));_0x414344[_0xef5b('0x41')][_0xef5b('0x53')]=_0x53bd47['id'];if(_0x4a2a74[_0xef5b('0x38')][_0xef5b('0x43')]){_0x414344[_0xef5b('0x41')]=_[_0xef5b('0x44')](_0x414344[_0xef5b('0x41')],{'$or':_[_0xef5b('0x35')](_0x414344['attributes'],function(_0x1730d2){var _0x4540aa={};_0x4540aa[_0x1730d2]={'$like':'%'+_0x4a2a74['query']['filter']+'%'};return _0x4540aa;})});}_0x414344=_[_0xef5b('0x44')]({},_0x414344,_0x4a2a74[_0xef5b('0x47')]);return db['JscriptyQuestionReport'][_0xef5b('0x22')]({'where':_0x414344[_0xef5b('0x41')]})[_0xef5b('0x29')](function(_0x168e4f){_0x601962['count']=_0x168e4f;if(_0x4a2a74[_0xef5b('0x38')][_0xef5b('0x4d')]){_0x414344[_0xef5b('0x48')]=[{'all':!![]}];}return db[_0xef5b('0x54')]['findAll'](_0x414344);})[_0xef5b('0x29')](function(_0x1f9237){_0x601962['rows']=_0x1f9237;return _0x601962;});}})[_0xef5b('0x29')](respondWithFilteredResult(_0x526e19,_0x414344))[_0xef5b('0x4a')](handleError(_0x526e19,null));}; \ No newline at end of file +var _0x2f03=['describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','JscriptySessionReport','findAll','rows','show','params','keys','rawAttributes','create','body','catch','find'];(function(_0x57849c,_0x3ec50f){var _0x3c6dbb=function(_0x47eb72){while(--_0x47eb72){_0x57849c['push'](_0x57849c['shift']());}};_0x3c6dbb(++_0x3ec50f);}(_0x2f03,0x107));var _0x32f0=function(_0x315e51,_0xe12b3c){_0x315e51=_0x315e51-0x0;var _0x307619=_0x2f03[_0x315e51];return _0x307619;};'use strict';var emlformat=require(_0x32f0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x32f0('0x1'));var jsonpatch=require(_0x32f0('0x2'));var rp=require(_0x32f0('0x3'));var moment=require(_0x32f0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x32f0('0x5'));var path=require(_0x32f0('0x6'));var sox=require('sox');var csv=require(_0x32f0('0x7'));var ejs=require(_0x32f0('0x8'));var fs=require('fs');var fs_extra=require(_0x32f0('0x9'));var _=require(_0x32f0('0xa'));var squel=require(_0x32f0('0xb'));var crypto=require(_0x32f0('0xc'));var jsforce=require(_0x32f0('0xd'));var deskjs=require(_0x32f0('0xe'));var toCsv=require(_0x32f0('0x7'));var querystring=require(_0x32f0('0xf'));var Papa=require(_0x32f0('0x10'));var Redis=require(_0x32f0('0x11'));var authService=require(_0x32f0('0x12'));var qs=require(_0x32f0('0x13'));var as=require(_0x32f0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x32f0('0x15'))(_0x32f0('0x16'));var utils=require(_0x32f0('0x17'));var config=require(_0x32f0('0x18'));var licenseUtil=require(_0x32f0('0x19'));var db=require(_0x32f0('0x1a'))['db'];function respondWithStatusCode(_0xc93257,_0xe40ce1){_0xe40ce1=_0xe40ce1||0xcc;return function(_0x2b80f3){if(_0x2b80f3){return _0xc93257[_0x32f0('0x1b')](_0xe40ce1);}return _0xc93257[_0x32f0('0x1c')](_0xe40ce1)[_0x32f0('0x1d')]();};}function respondWithResult(_0x31179f,_0x1e6c75){_0x1e6c75=_0x1e6c75||0xc8;return function(_0x1faef3){if(_0x1faef3){return _0x31179f[_0x32f0('0x1c')](_0x1e6c75)[_0x32f0('0x1e')](_0x1faef3);}};}function respondWithFilteredResult(_0x1c8ba5,_0xfbfeeb){return function(_0x1a878f){if(_0x1a878f){var _0x5a9841=typeof _0xfbfeeb['offset']===_0x32f0('0x1f')&&typeof _0xfbfeeb[_0x32f0('0x20')]==='undefined';var _0x361d2c=_0x1a878f['count'];var _0x537720=_0x5a9841?0x0:_0xfbfeeb[_0x32f0('0x21')];var _0x3d3d85=_0x5a9841?_0x1a878f[_0x32f0('0x22')]:_0xfbfeeb[_0x32f0('0x21')]+_0xfbfeeb[_0x32f0('0x20')];var _0x4968ba;if(_0x3d3d85>=_0x361d2c){_0x3d3d85=_0x361d2c;_0x4968ba=0xc8;}else{_0x4968ba=0xce;}_0x1c8ba5['status'](_0x4968ba);return _0x1c8ba5[_0x32f0('0x23')](_0x32f0('0x24'),_0x537720+'-'+_0x3d3d85+'/'+_0x361d2c)[_0x32f0('0x1e')](_0x1a878f);}return null;};}function patchUpdates(_0x1915a0){return function(_0x29ae6e){try{jsonpatch[_0x32f0('0x25')](_0x29ae6e,_0x1915a0,!![]);}catch(_0x3da102){return BPromise[_0x32f0('0x26')](_0x3da102);}return _0x29ae6e[_0x32f0('0x27')]();};}function saveUpdates(_0x5310,_0xfb5a93){return function(_0x329139){if(_0x329139){return _0x329139[_0x32f0('0x28')](_0x5310)[_0x32f0('0x29')](function(_0x238cb1){return _0x238cb1;});}return null;};}function removeEntity(_0x4ac32a,_0x204fbc){return function(_0xb467b9){if(_0xb467b9){return _0xb467b9[_0x32f0('0x2a')]()['then'](function(){_0x4ac32a[_0x32f0('0x1c')](0xcc)[_0x32f0('0x1d')]();});}};}function handleEntityNotFound(_0x2a5c6b,_0x249a6e){return function(_0x2706ae){if(!_0x2706ae){_0x2a5c6b[_0x32f0('0x1b')](0x194);}return _0x2706ae;};}function handleError(_0x34d8cd,_0xbcf879){_0xbcf879=_0xbcf879||0x1f4;return function(_0x50a2da){logger[_0x32f0('0x2b')](_0x50a2da[_0x32f0('0x2c')]);if(_0x50a2da['name']){delete _0x50a2da[_0x32f0('0x2d')];}_0x34d8cd['status'](_0xbcf879)[_0x32f0('0x2e')](_0x50a2da);};}exports[_0x32f0('0x2f')]=function(_0x352a08,_0x11718a){var _0x2cf535={},_0x335430={},_0x315523={'count':0x0,'rows':[]};var _0x7f50e0=_[_0x32f0('0x30')](db['JscriptySessionReport']['rawAttributes'],function(_0x285249){return{'name':_0x285249[_0x32f0('0x31')],'type':_0x285249[_0x32f0('0x32')][_0x32f0('0x33')]};});_0x335430['model']=_[_0x32f0('0x30')](_0x7f50e0,'name');_0x335430[_0x32f0('0x34')]=_['keys'](_0x352a08[_0x32f0('0x34')]);_0x335430[_0x32f0('0x35')]=_[_0x32f0('0x36')](_0x335430[_0x32f0('0x37')],_0x335430['query']);_0x2cf535[_0x32f0('0x38')]=_['intersection'](_0x335430[_0x32f0('0x37')],qs['fields'](_0x352a08['query'][_0x32f0('0x39')]));_0x2cf535['attributes']=_0x2cf535[_0x32f0('0x38')][_0x32f0('0x3a')]?_0x2cf535[_0x32f0('0x38')]:_0x335430['model'];if(!_0x352a08[_0x32f0('0x34')][_0x32f0('0x3b')]('nolimit')){_0x2cf535['limit']=qs['limit'](_0x352a08[_0x32f0('0x34')]['limit']);_0x2cf535['offset']=qs[_0x32f0('0x21')](_0x352a08[_0x32f0('0x34')]['offset']);}_0x2cf535[_0x32f0('0x3c')]=qs[_0x32f0('0x3d')](_0x352a08[_0x32f0('0x34')][_0x32f0('0x3d')]);_0x2cf535[_0x32f0('0x3e')]=qs['filters'](_[_0x32f0('0x3f')](_0x352a08['query'],_0x335430[_0x32f0('0x35')]),_0x7f50e0);if(_0x352a08['query'][_0x32f0('0x40')]){_0x2cf535[_0x32f0('0x3e')]=_[_0x32f0('0x41')](_0x2cf535[_0x32f0('0x3e')],{'$or':_[_0x32f0('0x30')](_0x7f50e0,function(_0x597d3d){if(_0x597d3d['type']!==_0x32f0('0x42')){var _0x23d046={};_0x23d046[_0x597d3d[_0x32f0('0x2d')]]={'$like':'%'+_0x352a08['query']['filter']+'%'};return _0x23d046;}})});}_0x2cf535=_['merge']({},_0x2cf535,_0x352a08[_0x32f0('0x43')]);var _0x3a0782={'where':_0x2cf535[_0x32f0('0x3e')]};return db['JscriptySessionReport']['count'](_0x3a0782)['then'](function(_0x5422f4){_0x315523[_0x32f0('0x22')]=_0x5422f4;if(_0x352a08[_0x32f0('0x34')][_0x32f0('0x44')]){_0x2cf535[_0x32f0('0x45')]=[{'all':!![]}];}return db[_0x32f0('0x46')][_0x32f0('0x47')](_0x2cf535);})[_0x32f0('0x29')](function(_0x11058d){_0x315523[_0x32f0('0x48')]=_0x11058d;return _0x315523;})[_0x32f0('0x29')](respondWithFilteredResult(_0x11718a,_0x2cf535))['catch'](handleError(_0x11718a,null));};exports[_0x32f0('0x49')]=function(_0x28a78e,_0x285b19){var _0x10aa57={'raw':!![],'where':{'id':_0x28a78e[_0x32f0('0x4a')]['id']}},_0x306b1c={};_0x306b1c['model']=_[_0x32f0('0x4b')](db[_0x32f0('0x46')][_0x32f0('0x4c')]);_0x306b1c[_0x32f0('0x34')]=_['keys'](_0x28a78e['query']);_0x306b1c[_0x32f0('0x35')]=_[_0x32f0('0x36')](_0x306b1c['model'],_0x306b1c[_0x32f0('0x34')]);_0x10aa57['attributes']=_[_0x32f0('0x36')](_0x306b1c[_0x32f0('0x37')],qs[_0x32f0('0x39')](_0x28a78e[_0x32f0('0x34')][_0x32f0('0x39')]));_0x10aa57[_0x32f0('0x38')]=_0x10aa57['attributes'][_0x32f0('0x3a')]?_0x10aa57[_0x32f0('0x38')]:_0x306b1c[_0x32f0('0x37')];if(_0x28a78e[_0x32f0('0x34')][_0x32f0('0x44')]){_0x10aa57['include']=[{'all':!![]}];}_0x10aa57=_['merge']({},_0x10aa57,_0x28a78e['options']);return db[_0x32f0('0x46')]['find'](_0x10aa57)[_0x32f0('0x29')](handleEntityNotFound(_0x285b19,null))[_0x32f0('0x29')](respondWithResult(_0x285b19,null))['catch'](handleError(_0x285b19,null));};exports['create']=function(_0xb07041,_0x21a834){return db[_0x32f0('0x46')][_0x32f0('0x4d')](_0xb07041[_0x32f0('0x4e')],{})[_0x32f0('0x29')](respondWithResult(_0x21a834,0xc9))[_0x32f0('0x4f')](handleError(_0x21a834,null));};exports[_0x32f0('0x28')]=function(_0x3a7cd2,_0x927f0d){if(_0x3a7cd2[_0x32f0('0x4e')]['id']){delete _0x3a7cd2['body']['id'];}return db[_0x32f0('0x46')][_0x32f0('0x50')]({'where':{'id':_0x3a7cd2[_0x32f0('0x4a')]['id']}})[_0x32f0('0x29')](handleEntityNotFound(_0x927f0d,null))[_0x32f0('0x29')](saveUpdates(_0x3a7cd2[_0x32f0('0x4e')],null))[_0x32f0('0x29')](respondWithResult(_0x927f0d,null))[_0x32f0('0x4f')](handleError(_0x927f0d,null));};exports['destroy']=function(_0x50b533,_0x23f74a){return db[_0x32f0('0x46')][_0x32f0('0x50')]({'where':{'id':_0x50b533[_0x32f0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x23f74a,null))[_0x32f0('0x29')](removeEntity(_0x23f74a,null))[_0x32f0('0x4f')](handleError(_0x23f74a,null));};exports[_0x32f0('0x51')]=function(_0x12a38f,_0x13c19a){return db[_0x32f0('0x46')]['describe']()[_0x32f0('0x29')](respondWithResult(_0x13c19a,null))[_0x32f0('0x4f')](handleError(_0x13c19a,null));};exports[_0x32f0('0x52')]=function(_0x26fe2a,_0x48c632,_0x10a155){var _0x587c31={'raw':!![],'where':{}};var _0x4685ce={};var _0x37371e={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0x32f0('0x53')]({'where':{'id':_0x26fe2a[_0x32f0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x48c632,null))['then'](function(_0x3113f1){if(_0x3113f1){_0x4685ce[_0x32f0('0x37')]=_[_0x32f0('0x4b')](db['JscriptyQuestionReport'][_0x32f0('0x4c')]);_0x4685ce[_0x32f0('0x34')]=_[_0x32f0('0x4b')](_0x26fe2a[_0x32f0('0x34')]);_0x4685ce[_0x32f0('0x35')]=_['intersection'](_0x4685ce[_0x32f0('0x37')],_0x4685ce[_0x32f0('0x34')]);_0x587c31['attributes']=_[_0x32f0('0x36')](_0x4685ce[_0x32f0('0x37')],qs[_0x32f0('0x39')](_0x26fe2a[_0x32f0('0x34')][_0x32f0('0x39')]));_0x587c31[_0x32f0('0x38')]=_0x587c31['attributes'][_0x32f0('0x3a')]?_0x587c31[_0x32f0('0x38')]:_0x4685ce['model'];if(!_0x26fe2a['query'][_0x32f0('0x3b')]('nolimit')){_0x587c31['limit']=qs['limit'](_0x26fe2a['query'][_0x32f0('0x20')]);_0x587c31[_0x32f0('0x21')]=qs[_0x32f0('0x21')](_0x26fe2a['query'][_0x32f0('0x21')]);}_0x587c31['order']=qs[_0x32f0('0x3d')](_0x26fe2a[_0x32f0('0x34')]['sort']);_0x587c31['where']=qs[_0x32f0('0x35')](_[_0x32f0('0x3f')](_0x26fe2a['query'],_0x4685ce['filters']));_0x587c31[_0x32f0('0x3e')][_0x32f0('0x54')]=_0x3113f1['id'];if(_0x26fe2a[_0x32f0('0x34')][_0x32f0('0x40')]){_0x587c31[_0x32f0('0x3e')]=_[_0x32f0('0x41')](_0x587c31[_0x32f0('0x3e')],{'$or':_['map'](_0x587c31[_0x32f0('0x38')],function(_0x2f8044){var _0x806c8b={};_0x806c8b[_0x2f8044]={'$like':'%'+_0x26fe2a[_0x32f0('0x34')]['filter']+'%'};return _0x806c8b;})});}_0x587c31=_[_0x32f0('0x41')]({},_0x587c31,_0x26fe2a[_0x32f0('0x43')]);return db['JscriptyQuestionReport'][_0x32f0('0x22')]({'where':_0x587c31[_0x32f0('0x3e')]})[_0x32f0('0x29')](function(_0x46985d){_0x37371e[_0x32f0('0x22')]=_0x46985d;if(_0x26fe2a[_0x32f0('0x34')][_0x32f0('0x44')]){_0x587c31[_0x32f0('0x45')]=[{'all':!![]}];}return db[_0x32f0('0x55')]['findAll'](_0x587c31);})[_0x32f0('0x29')](function(_0x14ea16){_0x37371e[_0x32f0('0x48')]=_0x14ea16;return _0x37371e;});}})[_0x32f0('0x29')](respondWithFilteredResult(_0x48c632,_0x587c31))[_0x32f0('0x4f')](handleError(_0x48c632,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 1edb9a4..487e9c9 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 _0x885a=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x885a,0x180));var _0xa885=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x885a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa885('0x0'));var logger=require(_0xa885('0x1'))(_0xa885('0x2'));var moment=require(_0xa885('0x3'));var BPromise=require('bluebird');var rp=require(_0xa885('0x4'));var fs=require('fs');var path=require(_0xa885('0x5'));var rimraf=require(_0xa885('0x6'));var config=require(_0xa885('0x7'));var attributes=require(_0xa885('0x8'));module[_0xa885('0x9')]=function(_0x5dfd7e,_0x7ac6bd){return _0x5dfd7e[_0xa885('0xa')](_0xa885('0xb'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2675=['lodash','moment','bluebird','path','rimraf','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0x2675,0x75));var _0x5267=function(_0x3ccc14,_0x49f4aa){_0x3ccc14=_0x3ccc14-0x0;var _0x28bd9c=_0x2675[_0x3ccc14];return _0x28bd9c;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x5267('0x1'));var BPromise=require(_0x5267('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5267('0x3'));var rimraf=require(_0x5267('0x4'));var config=require('../../config/environment');var attributes=require(_0x5267('0x5'));module[_0x5267('0x6')]=function(_0x4bd042,_0x10f92c){return _0x4bd042[_0x5267('0x7')](_0x5267('0x8'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 3615647..ba679f1 100644 --- a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js +++ b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x5c2ae1,_0x1e4c0f){var _0x67f9ea=function(_0x2a2cae){while(--_0x2a2cae){_0x5c2ae1['push'](_0x5c2ae1['shift']());}};_0x67f9ea(++_0x1e4c0f);}(_0xdb28,0x106));var _0x8db2=function(_0x1cefe1,_0x287985){_0x1cefe1=_0x1cefe1-0x0;var _0x1d3d49=_0xdb28[_0x1cefe1];return _0x1d3d49;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file +var _0x6d11=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x5cc8d7,_0x2b82e3){var _0x4e1ac3=function(_0x3feb3f){while(--_0x3feb3f){_0x5cc8d7['push'](_0x5cc8d7['shift']());}};_0x4e1ac3(++_0x2b82e3);}(_0x6d11,0xbf));var _0x16d1=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x6d11[_0x50e40b];return _0x2608b7;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index f569ba4..194bf88 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 _0x3092=['get','index','/:id','isAuthenticated','update','/download_log_file','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller'];(function(_0x1d34d8,_0x1c1051){var _0x338b57=function(_0x398efe){while(--_0x398efe){_0x1d34d8['push'](_0x1d34d8['shift']());}};_0x338b57(++_0x1c1051);}(_0x3092,0x165));var _0x2309=function(_0x479160,_0x3ab560){_0x479160=_0x479160-0x0;var _0x47ac6d=_0x3092[_0x479160];return _0x47ac6d;};'use strict';var multer=require('multer');var util=require(_0x2309('0x0'));var path=require('path');var timeout=require(_0x2309('0x1'));var express=require('express');var router=express[_0x2309('0x2')]();var fs_extra=require(_0x2309('0x3'));var auth=require(_0x2309('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2309('0x5'));var controller=require(_0x2309('0x6'));router[_0x2309('0x7')]('/',controller[_0x2309('0x8')]);router['put'](_0x2309('0x9'),auth[_0x2309('0xa')](),controller[_0x2309('0xb')]);router[_0x2309('0x7')](_0x2309('0xc'),auth['isAuthenticated'](),controller['downloadLogFile']);module[_0x2309('0xd')]=router; \ No newline at end of file +var _0xde2e=['downloadLogFile','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','update','get'];(function(_0x21f7cf,_0x3a574b){var _0xf03e2e=function(_0x25e860){while(--_0x25e860){_0x21f7cf['push'](_0x21f7cf['shift']());}};_0xf03e2e(++_0x3a574b);}(_0xde2e,0x92));var _0xede2=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xde2e[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xede2('0x0'));var util=require(_0xede2('0x1'));var path=require(_0xede2('0x2'));var timeout=require(_0xede2('0x3'));var express=require(_0xede2('0x4'));var router=express[_0xede2('0x5')]();var fs_extra=require(_0xede2('0x6'));var auth=require(_0xede2('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xede2('0x8'));var controller=require(_0xede2('0x9'));router['get']('/',controller[_0xede2('0xa')]);router[_0xede2('0xb')](_0xede2('0xc'),auth[_0xede2('0xd')](),controller[_0xede2('0xe')]);router[_0xede2('0xf')]('/download_log_file',auth[_0xede2('0xd')](),controller[_0xede2('0x10')]);module[_0xede2('0x11')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 40aca30..39d5982 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 _0x9e37=['sequelize','STRING','INTEGER'];(function(_0x895aef,_0x58f6d3){var _0x37c6ee=function(_0x41f046){while(--_0x41f046){_0x895aef['push'](_0x895aef['shift']());}};_0x37c6ee(++_0x58f6d3);}(_0x9e37,0x1ef));var _0x79e3=function(_0x48999d,_0x1e02cb){_0x48999d=_0x48999d-0x0;var _0x1ad0d1=_0x9e37[_0x48999d];return _0x1ad0d1;};'use strict';var Sequelize=require(_0x79e3('0x0'));module['exports']={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x79e3('0x1')]},'data2':{'type':Sequelize[_0x79e3('0x1')]},'chatLicenseExceeded':{'type':Sequelize[_0x79e3('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a90=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x5dfc2a,_0x1a953f){var _0x3f1a71=function(_0x15916){while(--_0x15916){_0x5dfc2a['push'](_0x5dfc2a['shift']());}};_0x3f1a71(++_0x1a953f);}(_0x0a90,0x155));var _0x00a9=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0a90[_0x31a371];return _0x2a5bd6;};'use strict';var Sequelize=require(_0x00a9('0x0'));module[_0x00a9('0x1')]={'license':{'type':Sequelize[_0x00a9('0x2')]},'data1':{'type':Sequelize[_0x00a9('0x3')]},'data2':{'type':Sequelize[_0x00a9('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x00a9('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 7f88ce9..dfc58b3 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 _0x3cfc=['attachment;\x20filename=','set','text/plain','download','eml-format','request-promise','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','limit','count','status','Content-Range','json','reject','save','update','destroy','then','error','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','getLicense','catch','body','find','params','get','checkLicense','demo','downloadLogFile','license-info.log','join','/var','Content-disposition'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x3cfc,0x8e));var _0xc3cf=function(_0x51ed91,_0x499566){_0x51ed91=_0x51ed91-0x0;var _0x40f483=_0x3cfc[_0x51ed91];return _0x40f483;};'use strict';var emlformat=require(_0xc3cf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc3cf('0x1'));var moment=require('moment');var BPromise=require(_0xc3cf('0x2'));var Mustache=require('mustache');var util=require(_0xc3cf('0x3'));var path=require(_0xc3cf('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc3cf('0x5'));var fs=require('fs');var fs_extra=require(_0xc3cf('0x6'));var _=require(_0xc3cf('0x7'));var squel=require('squel');var crypto=require(_0xc3cf('0x8'));var jsforce=require(_0xc3cf('0x9'));var deskjs=require(_0xc3cf('0xa'));var toCsv=require(_0xc3cf('0xb'));var querystring=require(_0xc3cf('0xc'));var Papa=require(_0xc3cf('0xd'));var Redis=require(_0xc3cf('0xe'));var authService=require(_0xc3cf('0xf'));var qs=require(_0xc3cf('0x10'));var as=require(_0xc3cf('0x11'));var hardwareService=require(_0xc3cf('0x12'));var logger=require('../../config/logger')(_0xc3cf('0x13'));var utils=require('../../config/utils');var config=require(_0xc3cf('0x14'));var licenseUtil=require(_0xc3cf('0x15'));var db=require(_0xc3cf('0x16'))['db'];function respondWithStatusCode(_0x1b76b5,_0x5b59df){_0x5b59df=_0x5b59df||0xcc;return function(_0x2f6d98){if(_0x2f6d98){return _0x1b76b5['sendStatus'](_0x5b59df);}return _0x1b76b5['status'](_0x5b59df)[_0xc3cf('0x17')]();};}function respondWithResult(_0x472edb,_0x22f34c){_0x22f34c=_0x22f34c||0xc8;return function(_0x1a2161){if(_0x1a2161){return _0x472edb['status'](_0x22f34c)['json'](_0x1a2161);}};}function respondWithFilteredResult(_0x3a158,_0x59c826){return function(_0x5224ca){if(_0x5224ca){var _0x33a3fd=typeof _0x59c826[_0xc3cf('0x18')]===_0xc3cf('0x19')&&typeof _0x59c826[_0xc3cf('0x1a')]===_0xc3cf('0x19');var _0x16379d=_0x5224ca['count'];var _0xe3490d=_0x33a3fd?0x0:_0x59c826['offset'];var _0x7cc7ae=_0x33a3fd?_0x5224ca[_0xc3cf('0x1b')]:_0x59c826['offset']+_0x59c826[_0xc3cf('0x1a')];var _0x232385;if(_0x7cc7ae>=_0x16379d){_0x7cc7ae=_0x16379d;_0x232385=0xc8;}else{_0x232385=0xce;}_0x3a158[_0xc3cf('0x1c')](_0x232385);return _0x3a158['set'](_0xc3cf('0x1d'),_0xe3490d+'-'+_0x7cc7ae+'/'+_0x16379d)[_0xc3cf('0x1e')](_0x5224ca);}return null;};}function patchUpdates(_0x17ece2){return function(_0x1121bd){try{jsonpatch['apply'](_0x1121bd,_0x17ece2,!![]);}catch(_0x15db32){return BPromise[_0xc3cf('0x1f')](_0x15db32);}return _0x1121bd[_0xc3cf('0x20')]();};}function saveUpdates(_0x4db75d,_0x70014a){return function(_0x23e1d6){if(_0x23e1d6){return _0x23e1d6[_0xc3cf('0x21')](_0x4db75d)['then'](function(_0x6fd15c){return _0x6fd15c;});}return null;};}function removeEntity(_0x341534,_0x45ed3e){return function(_0x24ac92){if(_0x24ac92){return _0x24ac92[_0xc3cf('0x22')]()[_0xc3cf('0x23')](function(){_0x341534[_0xc3cf('0x1c')](0xcc)[_0xc3cf('0x17')]();});}};}function handleEntityNotFound(_0x14fbb7,_0x3786e0){return function(_0x3efc12){if(!_0x3efc12){_0x14fbb7['sendStatus'](0x194);}return _0x3efc12;};}function handleError(_0x35a0e6,_0x499c3a){_0x499c3a=_0x499c3a||0x1f4;return function(_0x4f9f2c){logger[_0xc3cf('0x24')](_0x4f9f2c['stack']);if(_0x4f9f2c[_0xc3cf('0x25')]){delete _0x4f9f2c[_0xc3cf('0x25')];}_0x35a0e6[_0xc3cf('0x1c')](_0x499c3a)[_0xc3cf('0x26')](_0x4f9f2c);};}var utilLicense=require(_0xc3cf('0x15'));exports[_0xc3cf('0x27')]=function(_0x15df35,_0x511bee){var _0x41d5b3={'raw':!![],'where':{'id':0x1}},_0x1b9dab={};_0x1b9dab[_0xc3cf('0x28')]=_[_0xc3cf('0x29')](db[_0xc3cf('0x2a')][_0xc3cf('0x2b')]);_0x1b9dab[_0xc3cf('0x2c')]=_[_0xc3cf('0x29')](_0x15df35[_0xc3cf('0x2c')]);_0x1b9dab[_0xc3cf('0x2d')]=_[_0xc3cf('0x2e')](_0x1b9dab[_0xc3cf('0x28')],_0x1b9dab['query']);_0x41d5b3['attributes']=_[_0xc3cf('0x2e')](_0x1b9dab['model'],qs[_0xc3cf('0x2f')](_0x15df35['query'][_0xc3cf('0x2f')]));_0x41d5b3['attributes']=_0x41d5b3[_0xc3cf('0x30')][_0xc3cf('0x31')]?_0x41d5b3[_0xc3cf('0x30')]:_0x1b9dab['model'];_0x41d5b3=_[_0xc3cf('0x32')]({},_0x41d5b3,_0x15df35[_0xc3cf('0x33')]);return utilLicense[_0xc3cf('0x34')](_0x41d5b3)[_0xc3cf('0x23')](respondWithResult(_0x511bee,null))[_0xc3cf('0x35')](handleError(_0x511bee,null));};exports[_0xc3cf('0x21')]=function(_0x1d61c1,_0x5bd6fc){if(_0x1d61c1[_0xc3cf('0x36')]['id']){delete _0x1d61c1[_0xc3cf('0x36')]['id'];}return db['License'][_0xc3cf('0x37')]({'where':{'id':_0x1d61c1[_0xc3cf('0x38')]['id']}})[_0xc3cf('0x23')](handleEntityNotFound(_0x5bd6fc,null))[_0xc3cf('0x23')](function(_0x231482){var _0x3e4f4b=_0x231482[_0xc3cf('0x39')]({'plain':!![]});return utilLicense[_0xc3cf('0x3a')](_0x3e4f4b,_0x1d61c1[_0xc3cf('0x36')]['key']);})[_0xc3cf('0x23')](function(_0x4bc369){if(!_0x4bc369[_0xc3cf('0x3b')]){return saveUpdates(_0x1d61c1[_0xc3cf('0x36')],null);}return _0x4bc369;})[_0xc3cf('0x23')](respondWithResult(_0x5bd6fc,null))[_0xc3cf('0x35')](handleError(_0x5bd6fc,null));};exports[_0xc3cf('0x3c')]=function(_0x441ac,_0x51bfa8){var _0x312f7a=_0xc3cf('0x3d');var _0x1b2298=path[_0xc3cf('0x3e')](_0xc3cf('0x3f'),'log','xcally',_0x312f7a);_0x51bfa8['setHeader'](_0xc3cf('0x40'),_0xc3cf('0x41')+_0x312f7a);_0x51bfa8[_0xc3cf('0x42')]('Content-Type',_0xc3cf('0x43'));_0x51bfa8[_0xc3cf('0x44')](_0x1b2298);}; \ No newline at end of file +var _0x6e16=['send','index','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','getLicense','catch','update','body','License','find','params','get','checkLicense','key','demo','downloadLogFile','license-info.log','join','/var','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','download','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','save','then','sendStatus','error','stack','name'];(function(_0x4e6455,_0x4b45dd){var _0x51a571=function(_0x2b3aaa){while(--_0x2b3aaa){_0x4e6455['push'](_0x4e6455['shift']());}};_0x51a571(++_0x4b45dd);}(_0x6e16,0x17b));var _0x66e1=function(_0x41b9b4,_0x5ed884){_0x41b9b4=_0x41b9b4-0x0;var _0x236296=_0x6e16[_0x41b9b4];return _0x236296;};'use strict';var emlformat=require(_0x66e1('0x0'));var rimraf=require(_0x66e1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66e1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x66e1('0x3'));var Mustache=require(_0x66e1('0x4'));var util=require(_0x66e1('0x5'));var path=require(_0x66e1('0x6'));var sox=require('sox');var csv=require(_0x66e1('0x7'));var ejs=require(_0x66e1('0x8'));var fs=require('fs');var fs_extra=require(_0x66e1('0x9'));var _=require('lodash');var squel=require(_0x66e1('0xa'));var crypto=require(_0x66e1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x66e1('0xc'));var toCsv=require(_0x66e1('0x7'));var querystring=require(_0x66e1('0xd'));var Papa=require('papaparse');var Redis=require(_0x66e1('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x66e1('0xf'));var hardwareService=require(_0x66e1('0x10'));var logger=require(_0x66e1('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x66e1('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9f11,_0x542609){_0x542609=_0x542609||0xcc;return function(_0xac05aa){if(_0xac05aa){return _0x2c9f11['sendStatus'](_0x542609);}return _0x2c9f11[_0x66e1('0x13')](_0x542609)[_0x66e1('0x14')]();};}function respondWithResult(_0x2a4d70,_0x55f397){_0x55f397=_0x55f397||0xc8;return function(_0x5931cb){if(_0x5931cb){return _0x2a4d70['status'](_0x55f397)[_0x66e1('0x15')](_0x5931cb);}};}function respondWithFilteredResult(_0x5e1c6c,_0x1783cb){return function(_0x58bd37){if(_0x58bd37){var _0x891770=typeof _0x1783cb['offset']===_0x66e1('0x16')&&typeof _0x1783cb['limit']===_0x66e1('0x16');var _0x4e0cfb=_0x58bd37['count'];var _0x10f474=_0x891770?0x0:_0x1783cb[_0x66e1('0x17')];var _0x451c7d=_0x891770?_0x58bd37[_0x66e1('0x18')]:_0x1783cb[_0x66e1('0x17')]+_0x1783cb[_0x66e1('0x19')];var _0x1ab726;if(_0x451c7d>=_0x4e0cfb){_0x451c7d=_0x4e0cfb;_0x1ab726=0xc8;}else{_0x1ab726=0xce;}_0x5e1c6c['status'](_0x1ab726);return _0x5e1c6c[_0x66e1('0x1a')](_0x66e1('0x1b'),_0x10f474+'-'+_0x451c7d+'/'+_0x4e0cfb)[_0x66e1('0x15')](_0x58bd37);}return null;};}function patchUpdates(_0xb9b0f7){return function(_0x135a51){try{jsonpatch[_0x66e1('0x1c')](_0x135a51,_0xb9b0f7,!![]);}catch(_0x43bcd9){return BPromise['reject'](_0x43bcd9);}return _0x135a51[_0x66e1('0x1d')]();};}function saveUpdates(_0x433413,_0x55c25e){return function(_0x59528e){if(_0x59528e){return _0x59528e['update'](_0x433413)[_0x66e1('0x1e')](function(_0x47d116){return _0x47d116;});}return null;};}function removeEntity(_0x4aa15f,_0x552997){return function(_0x2e6609){if(_0x2e6609){return _0x2e6609['destroy']()['then'](function(){_0x4aa15f[_0x66e1('0x13')](0xcc)[_0x66e1('0x14')]();});}};}function handleEntityNotFound(_0x3eed1b,_0x2efec4){return function(_0xf427d8){if(!_0xf427d8){_0x3eed1b[_0x66e1('0x1f')](0x194);}return _0xf427d8;};}function handleError(_0x2e8e1e,_0x358402){_0x358402=_0x358402||0x1f4;return function(_0x14b142){logger[_0x66e1('0x20')](_0x14b142[_0x66e1('0x21')]);if(_0x14b142['name']){delete _0x14b142[_0x66e1('0x22')];}_0x2e8e1e[_0x66e1('0x13')](_0x358402)[_0x66e1('0x23')](_0x14b142);};}var utilLicense=require(_0x66e1('0x12'));exports[_0x66e1('0x24')]=function(_0x5977ad,_0x386af0){var _0x2c3a77={'raw':!![],'where':{'id':0x1}},_0x5a3287={};_0x5a3287[_0x66e1('0x25')]=_[_0x66e1('0x26')](db['License'][_0x66e1('0x27')]);_0x5a3287[_0x66e1('0x28')]=_['keys'](_0x5977ad[_0x66e1('0x28')]);_0x5a3287[_0x66e1('0x29')]=_[_0x66e1('0x2a')](_0x5a3287['model'],_0x5a3287[_0x66e1('0x28')]);_0x2c3a77['attributes']=_[_0x66e1('0x2a')](_0x5a3287[_0x66e1('0x25')],qs[_0x66e1('0x2b')](_0x5977ad['query'][_0x66e1('0x2b')]));_0x2c3a77[_0x66e1('0x2c')]=_0x2c3a77[_0x66e1('0x2c')][_0x66e1('0x2d')]?_0x2c3a77['attributes']:_0x5a3287[_0x66e1('0x25')];_0x2c3a77=_[_0x66e1('0x2e')]({},_0x2c3a77,_0x5977ad[_0x66e1('0x2f')]);return utilLicense[_0x66e1('0x30')](_0x2c3a77)[_0x66e1('0x1e')](respondWithResult(_0x386af0,null))[_0x66e1('0x31')](handleError(_0x386af0,null));};exports[_0x66e1('0x32')]=function(_0x1a38ed,_0x5903df){if(_0x1a38ed[_0x66e1('0x33')]['id']){delete _0x1a38ed[_0x66e1('0x33')]['id'];}return db[_0x66e1('0x34')][_0x66e1('0x35')]({'where':{'id':_0x1a38ed[_0x66e1('0x36')]['id']}})[_0x66e1('0x1e')](handleEntityNotFound(_0x5903df,null))['then'](function(_0x2e19c7){var _0x2e77d0=_0x2e19c7[_0x66e1('0x37')]({'plain':!![]});return utilLicense[_0x66e1('0x38')](_0x2e77d0,_0x1a38ed['body'][_0x66e1('0x39')]);})[_0x66e1('0x1e')](function(_0x1c9fb4){if(!_0x1c9fb4[_0x66e1('0x3a')]){return saveUpdates(_0x1a38ed['body'],null);}return _0x1c9fb4;})[_0x66e1('0x1e')](respondWithResult(_0x5903df,null))[_0x66e1('0x31')](handleError(_0x5903df,null));};exports[_0x66e1('0x3b')]=function(_0x1984f8,_0x7461bc){var _0x5b2194=_0x66e1('0x3c');var _0x28eba3=path[_0x66e1('0x3d')](_0x66e1('0x3e'),'log',_0x66e1('0x3f'),_0x5b2194);_0x7461bc[_0x66e1('0x40')]('Content-disposition',_0x66e1('0x41')+_0x5b2194);_0x7461bc['set'](_0x66e1('0x42'),_0x66e1('0x43'));_0x7461bc[_0x66e1('0x44')](_0x28eba3);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 13ef0b5..e817306 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 _0x4226=['bluebird','request-promise','path','../../config/environment','./license.attributes','define','License','license','util','../../config/logger','moment'];(function(_0x3f3f40,_0x4e745f){var _0x32c366=function(_0x343f6a){while(--_0x343f6a){_0x3f3f40['push'](_0x3f3f40['shift']());}};_0x32c366(++_0x4e745f);}(_0x4226,0x17e));var _0x6422=function(_0x4c51e5,_0x28b301){_0x4c51e5=_0x4c51e5-0x0;var _0x2fca49=_0x4226[_0x4c51e5];return _0x2fca49;};'use strict';var _=require('lodash');var util=require(_0x6422('0x0'));var logger=require(_0x6422('0x1'))('api');var moment=require(_0x6422('0x2'));var BPromise=require(_0x6422('0x3'));var rp=require(_0x6422('0x4'));var fs=require('fs');var path=require(_0x6422('0x5'));var rimraf=require('rimraf');var config=require(_0x6422('0x6'));var attributes=require(_0x6422('0x7'));module['exports']=function(_0x25c138,_0x1ccf26){return _0x25c138[_0x6422('0x8')](_0x6422('0x9'),attributes,{'tableName':_0x6422('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e57=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','License','lodash','util'];(function(_0xaf0fe9,_0x3aaca0){var _0x598cb2=function(_0x4fb298){while(--_0x4fb298){_0xaf0fe9['push'](_0xaf0fe9['shift']());}};_0x598cb2(++_0x3aaca0);}(_0x2e57,0xc4));var _0x72e5=function(_0x31dbc6,_0x4d32de){_0x31dbc6=_0x31dbc6-0x0;var _0x3b27b6=_0x2e57[_0x31dbc6];return _0x3b27b6;};'use strict';var _=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var logger=require('../../config/logger')(_0x72e5('0x2'));var moment=require('moment');var BPromise=require(_0x72e5('0x3'));var rp=require(_0x72e5('0x4'));var fs=require('fs');var path=require(_0x72e5('0x5'));var rimraf=require(_0x72e5('0x6'));var config=require(_0x72e5('0x7'));var attributes=require('./license.attributes');module[_0x72e5('0x8')]=function(_0x3fd181,_0x19e2ae){return _0x3fd181[_0x72e5('0x9')](_0x72e5('0xa'),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 cf9e9c0..43e71af 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 _0x8b02=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','License,\x20%s,\x20%s','debug','request\x20sent','error','code','message','info','result','catch','lodash'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x8b02,0x18e));var _0x28b0=function(_0x30a891,_0x56a17e){_0x30a891=_0x30a891-0x0;var _0x2fa019=_0x8b02[_0x30a891];return _0x2fa019;};'use strict';var _=require(_0x28b0('0x0'));var util=require(_0x28b0('0x1'));var moment=require(_0x28b0('0x2'));var BPromise=require(_0x28b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x28b0('0x4'));var logger=require(_0x28b0('0x5'))(_0x28b0('0x6'));var config=require(_0x28b0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x28b0('0x8')][_0x28b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37bfc7,_0x35dc4c,_0x4b4102){return new BPromise(function(_0x49b95f,_0x35b44f){return client[_0x28b0('0xa')](_0x37bfc7,_0x4b4102)[_0x28b0('0xb')](function(_0x34ceee){logger['info'](_0x28b0('0xc'),_0x35dc4c,'request\x20sent');logger[_0x28b0('0xd')]('License,\x20%s,\x20%s,\x20%s',_0x35dc4c,_0x28b0('0xe'),JSON['stringify'](_0x34ceee));if(_0x34ceee[_0x28b0('0xf')]){if(_0x34ceee[_0x28b0('0xf')][_0x28b0('0x10')]===0x1f4){logger[_0x28b0('0xf')](_0x28b0('0xc'),_0x35dc4c,_0x34ceee[_0x28b0('0xf')][_0x28b0('0x11')]);return _0x35b44f(_0x34ceee[_0x28b0('0xf')]['message']);}logger['error'](_0x28b0('0xc'),_0x35dc4c,_0x34ceee[_0x28b0('0xf')][_0x28b0('0x11')]);return _0x49b95f(_0x34ceee[_0x28b0('0xf')][_0x28b0('0x11')]);}else{logger[_0x28b0('0x12')](_0x28b0('0xc'),_0x35dc4c,'request\x20sent');_0x49b95f(_0x34ceee[_0x28b0('0x13')]['message']);}})[_0x28b0('0x14')](function(_0x127f12){logger['error']('License,\x20%s,\x20%s',_0x35dc4c,_0x127f12);_0x35b44f(_0x127f12);});});} \ No newline at end of file +var _0x031f=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','moment'];(function(_0x31e374,_0x20340c){var _0x16a0a5=function(_0x36e902){while(--_0x36e902){_0x31e374['push'](_0x31e374['shift']());}};_0x16a0a5(++_0x20340c);}(_0x031f,0x7d));var _0xf031=function(_0x20f4c7,_0x45a832){_0x20f4c7=_0x20f4c7-0x0;var _0x1a1640=_0x031f[_0x20f4c7];return _0x1a1640;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf031('0x0'));var BPromise=require('bluebird');var rs=require(_0xf031('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf031('0x2'))['db'];var utils=require(_0xf031('0x3'));var logger=require(_0xf031('0x4'))('rpc');var config=require(_0xf031('0x5'));var jayson=require(_0xf031('0x6'));var client=jayson[_0xf031('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5be6cf,_0x23cf3b,_0x5918d7){return new BPromise(function(_0xf3fab4,_0x332792){return client[_0xf031('0x8')](_0x5be6cf,_0x5918d7)[_0xf031('0x9')](function(_0x34011d){logger[_0xf031('0xa')](_0xf031('0xb'),_0x23cf3b,_0xf031('0xc'));logger[_0xf031('0xd')](_0xf031('0xe'),_0x23cf3b,_0xf031('0xc'),JSON['stringify'](_0x34011d));if(_0x34011d['error']){if(_0x34011d[_0xf031('0xf')][_0xf031('0x10')]===0x1f4){logger[_0xf031('0xf')](_0xf031('0xb'),_0x23cf3b,_0x34011d[_0xf031('0xf')][_0xf031('0x11')]);return _0x332792(_0x34011d[_0xf031('0xf')][_0xf031('0x11')]);}logger['error'](_0xf031('0xb'),_0x23cf3b,_0x34011d[_0xf031('0xf')][_0xf031('0x11')]);return _0xf3fab4(_0x34011d[_0xf031('0xf')][_0xf031('0x11')]);}else{logger['info'](_0xf031('0xb'),_0x23cf3b,_0xf031('0xc'));_0xf3fab4(_0x34011d['result'][_0xf031('0x11')]);}})['catch'](function(_0x5310ab){logger[_0xf031('0xf')](_0xf031('0xb'),_0x23cf3b,_0x5310ab);_0x332792(_0x5310ab);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 6cf8de9..e308520 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 _0x1bf2=['addAgents','put','update','delete','removeDispositions','/:id/in_servers','removeImap','destroy','removeAgents','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','/:id/users','post','addAnswer','create','addImap','addSmtp','addInteraction','addApplications','send'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x1bf2,0x18c));var _0x21bf=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x1bf2[_0x5447fd];return _0x15b28a;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x21bf('0x0'));var express=require(_0x21bf('0x1'));var router=express[_0x21bf('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x21bf('0x3'));var interaction=require(_0x21bf('0x4'));var config=require(_0x21bf('0x5'));var controller=require(_0x21bf('0x6'));router[_0x21bf('0x7')]('/',auth[_0x21bf('0x8')](),controller[_0x21bf('0x9')]);router[_0x21bf('0x7')](_0x21bf('0xa'),auth[_0x21bf('0x8')](),controller[_0x21bf('0xb')]);router[_0x21bf('0x7')](_0x21bf('0xc'),auth[_0x21bf('0x8')](),controller['show']);router[_0x21bf('0x7')](_0x21bf('0xd'),auth[_0x21bf('0x8')](),controller[_0x21bf('0xe')]);router[_0x21bf('0x7')](_0x21bf('0xf'),auth['isAuthenticated'](),controller[_0x21bf('0x10')]);router['get']('/:id/in_servers',auth[_0x21bf('0x8')](),controller['getImap']);router[_0x21bf('0x7')](_0x21bf('0x11'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x12')]);router['get'](_0x21bf('0x13'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x14')]);router['get'](_0x21bf('0x15'),auth['isAuthenticated'](),controller['getApplications']);router[_0x21bf('0x7')](_0x21bf('0x16'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x17')]);router[_0x21bf('0x7')](_0x21bf('0x18'),auth[_0x21bf('0x8')](),controller['verifySmtp']);router['get'](_0x21bf('0x19'),auth[_0x21bf('0x8')](),controller['getAgents']);router['post'](_0x21bf('0xd'),auth[_0x21bf('0x8')](),controller['addDisposition']);router[_0x21bf('0x1a')](_0x21bf('0xf'),auth['isAuthenticated'](),controller[_0x21bf('0x1b')]);router['post']('/',auth[_0x21bf('0x8')](),controller[_0x21bf('0x1c')]);router[_0x21bf('0x1a')]('/:id/in_servers',auth[_0x21bf('0x8')](),controller[_0x21bf('0x1d')]);router['post'](_0x21bf('0x11'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x1e')]);router[_0x21bf('0x1a')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x21bf('0x1f')]);router[_0x21bf('0x1a')]('/:id/applications',auth[_0x21bf('0x8')](),controller[_0x21bf('0x20')]);router[_0x21bf('0x1a')]('/:id/send',auth[_0x21bf('0x8')](),controller[_0x21bf('0x21')]);router[_0x21bf('0x1a')](_0x21bf('0x19'),auth['isAuthenticated'](),controller[_0x21bf('0x22')]);router[_0x21bf('0x23')](_0x21bf('0xc'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x24')]);router[_0x21bf('0x25')](_0x21bf('0xd'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x26')]);router['delete']('/:id/canned_answers',auth[_0x21bf('0x8')](),controller['removeAnswers']);router['delete'](_0x21bf('0x27'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x28')]);router[_0x21bf('0x25')]('/:id/out_servers',auth[_0x21bf('0x8')](),controller['removeSmtp']);router['delete'](_0x21bf('0xc'),auth[_0x21bf('0x8')](),controller[_0x21bf('0x29')]);router[_0x21bf('0x25')](_0x21bf('0x19'),auth['isAuthenticated'](),controller[_0x21bf('0x2a')]);module['exports']=router; \ No newline at end of file +var _0x05ec=['removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','/:id/users','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','addAnswer','create','addImap','addSmtp','addInteraction','/:id/send','send','put','update','delete'];(function(_0x14eb73,_0x33d2a1){var _0x686a1c=function(_0xb8dbaf){while(--_0xb8dbaf){_0x14eb73['push'](_0x14eb73['shift']());}};_0x686a1c(++_0x33d2a1);}(_0x05ec,0x19f));var _0xc05e=function(_0x236ce6,_0x26024a){_0x236ce6=_0x236ce6-0x0;var _0x3bc82d=_0x05ec[_0x236ce6];return _0x3bc82d;};'use strict';var multer=require(_0xc05e('0x0'));var util=require(_0xc05e('0x1'));var path=require(_0xc05e('0x2'));var timeout=require(_0xc05e('0x3'));var express=require(_0xc05e('0x4'));var router=express[_0xc05e('0x5')]();var fs_extra=require(_0xc05e('0x6'));var auth=require(_0xc05e('0x7'));var interaction=require(_0xc05e('0x8'));var config=require(_0xc05e('0x9'));var controller=require(_0xc05e('0xa'));router[_0xc05e('0xb')]('/',auth[_0xc05e('0xc')](),controller['index']);router[_0xc05e('0xb')](_0xc05e('0xd'),auth[_0xc05e('0xc')](),controller['describe']);router[_0xc05e('0xb')](_0xc05e('0xe'),auth[_0xc05e('0xc')](),controller[_0xc05e('0xf')]);router['get'](_0xc05e('0x10'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x11')]);router[_0xc05e('0xb')](_0xc05e('0x12'),auth['isAuthenticated'](),controller[_0xc05e('0x13')]);router['get'](_0xc05e('0x14'),auth['isAuthenticated'](),controller[_0xc05e('0x15')]);router['get'](_0xc05e('0x16'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x17')]);router[_0xc05e('0xb')](_0xc05e('0x18'),auth[_0xc05e('0xc')](),controller['getInteractions']);router['get'](_0xc05e('0x19'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x1a')]);router[_0xc05e('0xb')](_0xc05e('0x1b'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x1c')]);router[_0xc05e('0xb')](_0xc05e('0x1d'),auth['isAuthenticated'](),controller[_0xc05e('0x1e')]);router[_0xc05e('0xb')]('/:id/users',auth[_0xc05e('0xc')](),controller[_0xc05e('0x1f')]);router[_0xc05e('0x20')](_0xc05e('0x10'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x21')]);router[_0xc05e('0x20')](_0xc05e('0x12'),auth['isAuthenticated'](),controller[_0xc05e('0x22')]);router[_0xc05e('0x20')]('/',auth['isAuthenticated'](),controller[_0xc05e('0x23')]);router[_0xc05e('0x20')]('/:id/in_servers',auth[_0xc05e('0xc')](),controller[_0xc05e('0x24')]);router[_0xc05e('0x20')](_0xc05e('0x16'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x25')]);router[_0xc05e('0x20')](_0xc05e('0x18'),auth['isAuthenticated'](),controller[_0xc05e('0x26')]);router['post'](_0xc05e('0x19'),auth[_0xc05e('0xc')](),controller['addApplications']);router['post'](_0xc05e('0x27'),auth['isAuthenticated'](),controller[_0xc05e('0x28')]);router[_0xc05e('0x20')]('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xc05e('0x29')](_0xc05e('0xe'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x2a')]);router[_0xc05e('0x2b')]('/:id/dispositions',auth[_0xc05e('0xc')](),controller[_0xc05e('0x2c')]);router[_0xc05e('0x2b')]('/:id/canned_answers',auth[_0xc05e('0xc')](),controller[_0xc05e('0x2d')]);router[_0xc05e('0x2b')](_0xc05e('0x14'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x2e')]);router[_0xc05e('0x2b')]('/:id/out_servers',auth[_0xc05e('0xc')](),controller[_0xc05e('0x2f')]);router[_0xc05e('0x2b')](_0xc05e('0xe'),auth[_0xc05e('0xc')](),controller[_0xc05e('0x30')]);router[_0xc05e('0x2b')](_0xc05e('0x31'),auth[_0xc05e('0xc')](),controller['removeAgents']);module[_0xc05e('0x32')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 02c4af1..3949790 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 _0xb996=['yahoo','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','ENUM','gmail','hotmail'];(function(_0x316af7,_0x72e80c){var _0x286d96=function(_0x1c1d7b){while(--_0x1c1d7b){_0x316af7['push'](_0x316af7['shift']());}};_0x286d96(++_0x72e80c);}(_0xb996,0x10e));var _0x6b99=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0xb996[_0xd1d19a];return _0x52a79d;};'use strict';var Sequelize=require(_0x6b99('0x0'));module[_0x6b99('0x1')]={'description':{'type':Sequelize[_0x6b99('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x6b99('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x6b99('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x6b99('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x6b99('0x4')]},'markAsUnread':{'type':Sequelize[_0x6b99('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b99('0x5')},'fontSize':{'type':Sequelize[_0x6b99('0x6')](0x2)[_0x6b99('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x6b99('0x4')],'defaultValue':function(){return _0x6b99('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b99('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6b99('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b99('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b99('0x6')],'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[_0x6b99('0x3')],'defaultValue':![],'comment':_0x6b99('0x9'),'set':function(_0x24c45a){if(!_0x24c45a)this['setDataValue'](_0x6b99('0xa'),null);this[_0x6b99('0xb')]('mandatoryDisposition',_0x24c45a);}},'provider':{'type':Sequelize[_0x6b99('0xc')](_0x6b99('0xd'),_0x6b99('0xe'),_0x6b99('0xf'),'outlook365'),'defaultValue':null,'get':function(){var _0x4fe353=this[_0x6b99('0x10')](_0x6b99('0x11'));return _0x4fe353||_0x6b99('0x12');},'set':function(_0x242f4b){if(_0x242f4b===_0x6b99('0x12')){_0x242f4b=null;}return this[_0x6b99('0xb')]('provider',_0x242f4b);}}}; \ No newline at end of file +var _0xdfd2=['yahoo','outlook365','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','gmail','hotmail'];(function(_0x12e967,_0x149823){var _0x352aa7=function(_0x328bf9){while(--_0x328bf9){_0x12e967['push'](_0x12e967['shift']());}};_0x352aa7(++_0x149823);}(_0xdfd2,0x1a6));var _0x2dfd=function(_0xa2e08b,_0x536496){_0xa2e08b=_0xa2e08b-0x0;var _0xcad732=_0xdfd2[_0xa2e08b];return _0xcad732;};'use strict';var Sequelize=require(_0x2dfd('0x0'));module[_0x2dfd('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x2dfd('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x2dfd('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2dfd('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x2dfd('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x2dfd('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2dfd('0x2')],'allowNull':![],'defaultValue':_0x2dfd('0x5')},'fontSize':{'type':Sequelize[_0x2dfd('0x6')](0x2)[_0x2dfd('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0x2dfd('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2dfd('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2dfd('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2dfd('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2dfd('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2dfd('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x2dfd('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x2dfd('0x3')],'defaultValue':![],'comment':_0x2dfd('0x9'),'set':function(_0x53d08c){if(!_0x53d08c)this['setDataValue'](_0x2dfd('0xa'),null);this[_0x2dfd('0xb')](_0x2dfd('0xc'),_0x53d08c);}},'provider':{'type':Sequelize['ENUM'](_0x2dfd('0xd'),_0x2dfd('0xe'),_0x2dfd('0xf'),_0x2dfd('0x10')),'defaultValue':null,'get':function(){var _0x230249=this['getDataValue'](_0x2dfd('0x11'));return _0x230249||_0x2dfd('0x12');},'set':function(_0x1052af){if(_0x1052af===_0x2dfd('0x12')){_0x1052af=null;}return this[_0x2dfd('0xb')]('provider',_0x1052af);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 4a92531..b874a46 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 _0x92ce=['role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','color','tag','addApplications','sequelize','Transaction','MailApplication','bulkCreate','findAndCountAll','finally','send','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','email','attachments','join','server/files/attachments','getSmtpOptions','SendMail','sendMail','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','jayson/promise','request','then','info','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','MailAccount,\x20%s,\x20%s','message','catch','end','status','json','offset','undefined','limit','count','update','destroy','get','UserProfileResource','sendStatus','stack','name','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','Unknown\x20email\x20service\x20provider','smtp.gmail.com','smtp.office365.com','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','body','provider','custom','find','describe','addDisposition','MailAccountId','Disposition','create','findOne','order','sort','addAnswer','getAnswers','CannedAnswer','removeAnswers','ids','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x2068dd,_0x428a7c){var _0x10f8b7=function(_0x209b82){while(--_0x209b82){_0x2068dd['push'](_0x2068dd['shift']());}};_0x10f8b7(++_0x428a7c);}(_0x92ce,0x1af));var _0xe92c=function(_0x195d8c,_0x49f420){_0x195d8c=_0x195d8c-0x0;var _0x3a9867=_0x92ce[_0x195d8c];return _0x3a9867;};'use strict';var moment=require(_0xe92c('0x0'));var BPromise=require(_0xe92c('0x1'));var util=require('util');var path=require(_0xe92c('0x2'));var _=require(_0xe92c('0x3'));var juice=require(_0xe92c('0x4'));var Redis=require(_0xe92c('0x5'));var qs=require(_0xe92c('0x6'));var logger=require(_0xe92c('0x7'))(_0xe92c('0x8'));var config=require(_0xe92c('0x9'));var db=require('../../mysqldb')['db'];config[_0xe92c('0xa')]=_[_0xe92c('0xb')](config[_0xe92c('0xa')],{'host':_0xe92c('0xc'),'port':0x18eb});var socket=require(_0xe92c('0xd'))(new Redis(config[_0xe92c('0xa')]));require('./mailAccount.socket')['register'](socket);var jayson=require(_0xe92c('0xe'));var client=jayson['client']['http']({'port':0x232b});function respondWithRpcPromise(_0x184ecf,_0x457053,_0x4d602c,_0x4c21db){return new BPromise(function(_0x2cdc52,_0x573377){var _0x4baea5=_0x4c21db||client;return _0x4baea5[_0xe92c('0xf')](_0x184ecf,_0x4d602c)[_0xe92c('0x10')](function(_0x59504a){logger[_0xe92c('0x11')]('MailAccount,\x20%s,\x20%s',_0x457053,_0xe92c('0x12'));logger['debug'](_0xe92c('0x13'),_0x457053,_0xe92c('0x12'),JSON['stringify'](_0x59504a));if(_0x59504a[_0xe92c('0x14')]){if(_0x59504a[_0xe92c('0x14')]['code']===0x1f4){logger['error'](_0xe92c('0x15'),_0x457053,_0x59504a['error'][_0xe92c('0x16')]);return _0x573377(_0x59504a['error']['message']);}logger[_0xe92c('0x14')](_0xe92c('0x15'),_0x457053,_0x59504a['error'][_0xe92c('0x16')]);return _0x2cdc52(_0x59504a[_0xe92c('0x14')][_0xe92c('0x16')]);}else{logger[_0xe92c('0x11')](_0xe92c('0x15'),_0x457053,_0xe92c('0x12'));_0x2cdc52(_0x59504a['result'][_0xe92c('0x16')]);}})[_0xe92c('0x17')](function(_0x516322){logger[_0xe92c('0x14')]('MailAccount,\x20%s,\x20%s',_0x457053,_0x516322);_0x573377(_0x516322);});});}function respondWithStatusCode(_0x36a21d,_0x4e726b){_0x4e726b=_0x4e726b||0xcc;return function(_0x35776a){if(_0x35776a){return _0x36a21d['sendStatus'](_0x4e726b);}return _0x36a21d['status'](_0x4e726b)[_0xe92c('0x18')]();};}function respondWithResult(_0x1d4dbd,_0x279ea9){_0x279ea9=_0x279ea9||0xc8;return function(_0xff9ec){if(_0xff9ec){return _0x1d4dbd[_0xe92c('0x19')](_0x279ea9)[_0xe92c('0x1a')](_0xff9ec);}};}function respondWithFilteredResult(_0x5ea432,_0x2467ea){return function(_0xb25d2f){if(_0xb25d2f){var _0x4e989b=typeof _0x2467ea[_0xe92c('0x1b')]===_0xe92c('0x1c')&&typeof _0x2467ea[_0xe92c('0x1d')]===_0xe92c('0x1c');var _0x5134f2=_0xb25d2f[_0xe92c('0x1e')];var _0x17a35b=_0x4e989b?0x0:_0x2467ea[_0xe92c('0x1b')];var _0xdf7a94=_0x4e989b?_0xb25d2f['count']:_0x2467ea[_0xe92c('0x1b')]+_0x2467ea[_0xe92c('0x1d')];var _0x3201f0;if(_0xdf7a94>=_0x5134f2){_0xdf7a94=_0x5134f2;_0x3201f0=0xc8;}else{_0x3201f0=0xce;}_0x5ea432['status'](_0x3201f0);return _0x5ea432['set']('Content-Range',_0x17a35b+'-'+_0xdf7a94+'/'+_0x5134f2)[_0xe92c('0x1a')](_0xb25d2f);}return null;};}function saveUpdates(_0x4cb8ac){return function(_0x3daa0f){if(_0x3daa0f){return _0x3daa0f[_0xe92c('0x1f')](_0x4cb8ac)[_0xe92c('0x10')](function(_0x147aab){return _0x147aab;});}return null;};}function removeEntity(_0xc0df88){return function(_0x5b4aea){if(_0x5b4aea){return _0x5b4aea[_0xe92c('0x20')]()[_0xe92c('0x10')](function(){var _0x217109=_0x5b4aea[_0xe92c('0x21')]({'plain':!![]});var _0x5607ae='MailAccounts';return db[_0xe92c('0x22')]['destroy']({'where':{'type':_0x5607ae,'resourceId':_0x217109['id']}})[_0xe92c('0x10')](function(){return _0x5b4aea;});})['then'](function(){_0xc0df88[_0xe92c('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453402){return function(_0x51166f){if(!_0x51166f){_0x453402[_0xe92c('0x23')](0x194);}return _0x51166f;};}function handleError(_0x33a7f8,_0x170fd3){_0x170fd3=_0x170fd3||0x1f4;return function(_0x1c4ff0){logger[_0xe92c('0x14')](_0x1c4ff0[_0xe92c('0x24')]);if(_0x1c4ff0[_0xe92c('0x25')]){delete _0x1c4ff0[_0xe92c('0x25')];}_0x33a7f8[_0xe92c('0x19')](_0x170fd3)['send'](_0x1c4ff0);};}function getImapHost(_0x1b859d){switch(_0x1b859d){case _0xe92c('0x26'):return _0xe92c('0x27');case _0xe92c('0x28'):return _0xe92c('0x29');case _0xe92c('0x2a'):return _0xe92c('0x2b');case _0xe92c('0x2c'):return'outlook.office365.com';}throw new Error(_0xe92c('0x2d'),_0x1b859d);}function getSmtpHost(_0x468764){switch(_0x468764){case _0xe92c('0x26'):return _0xe92c('0x2e');case'yahoo':return'smtp.mail.yahoo.com';case _0xe92c('0x2a'):return'smtp-mail.outlook.com';case _0xe92c('0x2c'):return _0xe92c('0x2f');}throw new Error(_0xe92c('0x2d'),_0x468764);}function getAuthenticationOptions(_0x2cda86,_0x48382e){var _0x325eb3={};var _0x5352d9={};if(_0x2cda86){_0x325eb3[_0xe92c('0x30')]=_0x5352d9[_0xe92c('0x30')]=_0x48382e[_0xe92c('0x31')];_0x325eb3[_0xe92c('0x32')]=_0x5352d9[_0xe92c('0x33')]=_0x48382e['password'];if(_0x48382e['modernAuthentication']){_0x325eb3['modernAuthentication']=_0x5352d9[_0xe92c('0x34')]=!![];_0x325eb3[_0xe92c('0x35')]=_0x5352d9['CloudProviderId']=_0x48382e[_0xe92c('0x35')];_0x325eb3[_0xe92c('0x32')]=_0x5352d9[_0xe92c('0x33')]=null;}else{_0x325eb3[_0xe92c('0x35')]=_0x5352d9['CloudProviderId']=null;}_0x325eb3[_0xe92c('0x36')]=getImapHost(_0x2cda86);_0x325eb3[_0xe92c('0x37')]=0x3e1;_0x5352d9[_0xe92c('0x36')]=getSmtpHost(_0x2cda86);_0x5352d9[_0xe92c('0x37')]=0x24b;_0x5352d9[_0xe92c('0x38')]=![];_0x325eb3[_0xe92c('0x39')]=_0x5352d9[_0xe92c('0x39')]=null;}else{if(_0x48382e[_0xe92c('0x3a')]){_0x325eb3[_0xe92c('0x30')]=_0x5352d9[_0xe92c('0x30')]=_0x48382e[_0xe92c('0x31')];_0x325eb3[_0xe92c('0x32')]=_0x5352d9[_0xe92c('0x33')]=_0x48382e['password'];}else{_0x325eb3[_0xe92c('0x3a')]=_0x5352d9[_0xe92c('0x3a')]=![];_0x325eb3[_0xe92c('0x30')]=_0x5352d9[_0xe92c('0x30')]=null;_0x325eb3['password']=_0x5352d9['pass']=null;}_0x325eb3[_0xe92c('0x36')]=_0x48382e[_0xe92c('0x3b')][_0xe92c('0x36')];_0x325eb3[_0xe92c('0x37')]=_0x48382e[_0xe92c('0x3b')][_0xe92c('0x37')];_0x5352d9[_0xe92c('0x36')]=_0x48382e[_0xe92c('0x3c')]['host'];_0x5352d9[_0xe92c('0x37')]=_0x48382e[_0xe92c('0x3c')][_0xe92c('0x37')];}return{'Imap':_0x325eb3,'Smtp':_0x5352d9};}exports['index']=function(_0x163f15,_0x1ac294){var _0x2ff28e={'include':[{'model':db[_0xe92c('0x3d')],'as':'Imap'},{'model':db[_0xe92c('0x3e')],'as':_0xe92c('0x3c')},{'model':db[_0xe92c('0x3f')],'as':_0xe92c('0x40')}]},_0x4999d0={},_0x41e146={'count':0x0,'rows':[]};var _0x1736e0=_[_0xe92c('0x41')](db[_0xe92c('0x42')][_0xe92c('0x43')],function(_0x30e48a){return{'name':_0x30e48a[_0xe92c('0x44')],'type':_0x30e48a[_0xe92c('0x45')][_0xe92c('0x46')]};});_0x4999d0[_0xe92c('0x47')]=_[_0xe92c('0x41')](_0x1736e0,'name');_0x4999d0[_0xe92c('0x48')]=_[_0xe92c('0x49')](_0x163f15[_0xe92c('0x48')]);_0x4999d0[_0xe92c('0x4a')]=_[_0xe92c('0x4b')](_0x4999d0['model'],_0x4999d0[_0xe92c('0x48')]);_0x2ff28e[_0xe92c('0x4c')]=_['intersection'](_0x4999d0['model'],qs[_0xe92c('0x4d')](_0x163f15[_0xe92c('0x48')][_0xe92c('0x4d')]));_0x2ff28e[_0xe92c('0x4c')]=_0x2ff28e[_0xe92c('0x4c')][_0xe92c('0x4e')]?_0x2ff28e[_0xe92c('0x4c')]:_0x4999d0['model'];if(!_0x163f15[_0xe92c('0x48')][_0xe92c('0x4f')](_0xe92c('0x50'))){_0x2ff28e['limit']=qs[_0xe92c('0x1d')](_0x163f15[_0xe92c('0x48')]['limit']);_0x2ff28e[_0xe92c('0x1b')]=qs['offset'](_0x163f15['query'][_0xe92c('0x1b')]);}_0x2ff28e['order']=qs['sort'](_0x163f15[_0xe92c('0x48')]['sort']);_0x2ff28e[_0xe92c('0x51')]=qs[_0xe92c('0x4a')](_[_0xe92c('0x52')](_0x163f15[_0xe92c('0x48')],_0x4999d0[_0xe92c('0x4a')]),_0x1736e0);if(_0x163f15[_0xe92c('0x48')][_0xe92c('0x53')]){_0x2ff28e[_0xe92c('0x51')]=_[_0xe92c('0x54')](_0x2ff28e[_0xe92c('0x51')],{'$or':_[_0xe92c('0x41')](_0x1736e0,function(_0x7f0a2a){if(_0x7f0a2a['type']!==_0xe92c('0x55')){var _0x1c43b0={};_0x1c43b0[_0x7f0a2a[_0xe92c('0x25')]]={'$like':'%'+_0x163f15['query'][_0xe92c('0x53')]+'%'};return _0x1c43b0;}})});}_0x2ff28e=_[_0xe92c('0x54')]({},_0x2ff28e,_0x163f15['options']);var _0x29ff72={'where':_0x2ff28e[_0xe92c('0x51')]};return db['MailAccount']['count'](_0x29ff72)[_0xe92c('0x10')](function(_0x36f75d){_0x41e146['count']=_0x36f75d;if(_0x163f15[_0xe92c('0x48')][_0xe92c('0x56')]){_0x2ff28e[_0xe92c('0x57')]=[{'all':!![]}];}return db[_0xe92c('0x42')][_0xe92c('0x58')](_0x2ff28e);})['then'](function(_0x492a94){_0x41e146[_0xe92c('0x59')]=_0x492a94;return _0x41e146;})['then'](respondWithFilteredResult(_0x1ac294,_0x2ff28e))[_0xe92c('0x17')](handleError(_0x1ac294,null));};exports[_0xe92c('0x5a')]=function(_0x33b1c6,_0x33eaa0){var _0x584819={'raw':![],'where':{'id':_0x33b1c6[_0xe92c('0x5b')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xe92c('0x3b')},{'model':db[_0xe92c('0x3e')],'as':'Smtp'},{'model':db['Pause'],'as':_0xe92c('0x40')}]},_0x643ed9={};_0x643ed9['model']=_[_0xe92c('0x49')](db['MailAccount'][_0xe92c('0x43')]);_0x643ed9[_0xe92c('0x48')]=_['keys'](_0x33b1c6[_0xe92c('0x48')]);_0x643ed9['filters']=_[_0xe92c('0x4b')](_0x643ed9[_0xe92c('0x47')],_0x643ed9[_0xe92c('0x48')]);_0x584819[_0xe92c('0x4c')]=_[_0xe92c('0x4b')](_0x643ed9[_0xe92c('0x47')],qs['fields'](_0x33b1c6[_0xe92c('0x48')][_0xe92c('0x4d')]));_0x584819[_0xe92c('0x4c')]=_0x584819[_0xe92c('0x4c')][_0xe92c('0x4e')]?_0x584819['attributes']:_0x643ed9[_0xe92c('0x47')];if(_0x33b1c6[_0xe92c('0x48')][_0xe92c('0x56')]){_0x584819[_0xe92c('0x57')]=[{'all':!![]}];}_0x584819=_[_0xe92c('0x54')]({},_0x584819,_0x33b1c6[_0xe92c('0x5c')]);return db[_0xe92c('0x42')]['find'](_0x584819)[_0xe92c('0x10')](handleEntityNotFound(_0x33eaa0,null))['then'](respondWithResult(_0x33eaa0,null))[_0xe92c('0x17')](handleError(_0x33eaa0,null));};exports['update']=function(_0x49ae83,_0x45b69a){if(_0x49ae83[_0xe92c('0x5d')]['id']){delete _0x49ae83['body']['id'];}var _0x414f85=_0x49ae83['body'][_0xe92c('0x5e')]===_0xe92c('0x5f')?null:_0x49ae83[_0xe92c('0x5d')]['provider'];var _0x4ca207=_0x49ae83[_0xe92c('0x5d')]['Imap']||{};var _0x2ee8ce=_0x49ae83[_0xe92c('0x5d')]['Smtp']||{};if(_0x414f85){_0x4ca207[_0xe92c('0x36')]=getImapHost(_0x414f85);_0x4ca207['port']=0x3e1;_0x2ee8ce[_0xe92c('0x36')]=getSmtpHost(_0x414f85);_0x2ee8ce[_0xe92c('0x37')]=0x24b;_0x2ee8ce[_0xe92c('0x38')]=![];}if(_0x2ee8ce[_0xe92c('0x34')]){_0x2ee8ce[_0xe92c('0x38')]=![];}else{_0x2ee8ce[_0xe92c('0x35')]=null;}if(!_0x4ca207[_0xe92c('0x34')])_0x4ca207['CloudProviderId']=null;_0x49ae83[_0xe92c('0x5d')]['Imap']=_0x4ca207;_0x49ae83[_0xe92c('0x5d')][_0xe92c('0x3c')]=_0x2ee8ce;return db[_0xe92c('0x42')][_0xe92c('0x60')]({'where':{'id':_0x49ae83[_0xe92c('0x5b')]['id']},'include':[{'model':db[_0xe92c('0x3d')],'as':_0xe92c('0x3b')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0xe92c('0x40')}]})[_0xe92c('0x10')](handleEntityNotFound(_0x45b69a,null))[_0xe92c('0x10')](function(_0x20cb40){if(!_0x20cb40)throw new Error('Mail\x20Account\x20not\x20found');if(_0x20cb40['service'])delete _0x49ae83[_0xe92c('0x5d')][_0xe92c('0x3b')];return _0x20cb40;})['then'](saveUpdates(_0x49ae83[_0xe92c('0x5d')],null))['then'](function(_0x2fe19c){if(!_0x49ae83['body'][_0xe92c('0x3b')])return _0x2fe19c;return db[_0xe92c('0x3d')][_0xe92c('0x1f')](_0x49ae83['body'][_0xe92c('0x3b')],{'where':{'MailAccountId':_0x2fe19c['id']}})[_0xe92c('0x10')](function(){return _0x2fe19c;});})[_0xe92c('0x10')](function(_0xbad1c7){if(!_0x49ae83[_0xe92c('0x5d')][_0xe92c('0x3c')])return _0xbad1c7;return db[_0xe92c('0x3e')][_0xe92c('0x1f')](_0x49ae83[_0xe92c('0x5d')][_0xe92c('0x3c')],{'where':{'MailAccountId':_0xbad1c7['id']}})[_0xe92c('0x10')](function(){return _0xbad1c7;});})[_0xe92c('0x10')](respondWithResult(_0x45b69a,null))[_0xe92c('0x17')](handleError(_0x45b69a,null));};exports[_0xe92c('0x61')]=function(_0x20c66c,_0x5af542){return db[_0xe92c('0x42')][_0xe92c('0x61')]()[_0xe92c('0x10')](respondWithResult(_0x5af542,null))['catch'](handleError(_0x5af542,null));};exports[_0xe92c('0x62')]=function(_0x1f760d,_0x2be66e){if(_0x1f760d[_0xe92c('0x5d')]['id']){delete _0x1f760d[_0xe92c('0x5d')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x1f760d[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x2be66e,null))[_0xe92c('0x10')](function(_0xa43d39){if(_0xa43d39){_0x1f760d[_0xe92c('0x5d')][_0xe92c('0x63')]=_0xa43d39['id'];return db[_0xe92c('0x64')][_0xe92c('0x65')](_0x1f760d[_0xe92c('0x5d')]);}})[_0xe92c('0x10')](respondWithResult(_0x2be66e,null))[_0xe92c('0x17')](handleError(_0x2be66e,null));};exports['getDispositions']=function(_0x3ae334,_0x18fb53){var _0x3a0f7d={'raw':![],'where':{}};var _0x40e839={};var _0x40490c={'count':0x0,'rows':[]};return db[_0xe92c('0x42')][_0xe92c('0x66')]({'where':{'id':_0x3ae334[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x18fb53,null))['then'](function(_0x391fae){if(_0x391fae){_0x40e839['model']=_[_0xe92c('0x49')](db[_0xe92c('0x64')][_0xe92c('0x43')]);_0x40e839['query']=_[_0xe92c('0x49')](_0x3ae334[_0xe92c('0x48')]);_0x40e839[_0xe92c('0x4a')]=_[_0xe92c('0x4b')](_0x40e839['model'],_0x40e839[_0xe92c('0x48')]);_0x3a0f7d[_0xe92c('0x4c')]=_['intersection'](_0x40e839[_0xe92c('0x47')],qs['fields'](_0x3ae334[_0xe92c('0x48')][_0xe92c('0x4d')]));_0x3a0f7d['attributes']=_0x3a0f7d[_0xe92c('0x4c')][_0xe92c('0x4e')]?_0x3a0f7d[_0xe92c('0x4c')]:_0x40e839[_0xe92c('0x47')];if(!_0x3ae334[_0xe92c('0x48')][_0xe92c('0x4f')](_0xe92c('0x50'))){_0x3a0f7d[_0xe92c('0x1d')]=qs['limit'](_0x3ae334[_0xe92c('0x48')][_0xe92c('0x1d')]);_0x3a0f7d[_0xe92c('0x1b')]=qs[_0xe92c('0x1b')](_0x3ae334[_0xe92c('0x48')]['offset']);}_0x3a0f7d[_0xe92c('0x67')]=qs[_0xe92c('0x68')](_0x3ae334[_0xe92c('0x48')][_0xe92c('0x68')]);_0x3a0f7d[_0xe92c('0x51')]=qs[_0xe92c('0x4a')](_[_0xe92c('0x52')](_0x3ae334[_0xe92c('0x48')],_0x40e839[_0xe92c('0x4a')]));_0x3a0f7d[_0xe92c('0x51')][_0xe92c('0x63')]=_0x391fae['id'];if(_0x3ae334[_0xe92c('0x48')][_0xe92c('0x53')]){_0x3a0f7d[_0xe92c('0x51')]=_[_0xe92c('0x54')](_0x3a0f7d[_0xe92c('0x51')],{'$or':_[_0xe92c('0x41')](_0x3a0f7d[_0xe92c('0x4c')],function(_0x58af34){var _0x1090dc={};_0x1090dc[_0x58af34]={'$like':'%'+_0x3ae334[_0xe92c('0x48')][_0xe92c('0x53')]+'%'};return _0x1090dc;})});}_0x3a0f7d=_[_0xe92c('0x54')]({},_0x3a0f7d,_0x3ae334[_0xe92c('0x5c')]);return db[_0xe92c('0x64')][_0xe92c('0x1e')]({'where':_0x3a0f7d[_0xe92c('0x51')]})[_0xe92c('0x10')](function(_0x3e3d37){_0x40490c[_0xe92c('0x1e')]=_0x3e3d37;if(_0x3ae334[_0xe92c('0x48')][_0xe92c('0x56')]){_0x3a0f7d['include']=[{'all':!![]}];}return db[_0xe92c('0x64')]['findAll'](_0x3a0f7d);})[_0xe92c('0x10')](function(_0x568819){_0x40490c[_0xe92c('0x59')]=_0x568819;return _0x40490c;});}})['then'](respondWithFilteredResult(_0x18fb53,_0x3a0f7d))[_0xe92c('0x17')](handleError(_0x18fb53,null));};exports['removeDispositions']=function(_0x21478b,_0x39a358){return db['MailAccount'][_0xe92c('0x60')]({'where':{'id':_0x21478b[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x39a358,null))[_0xe92c('0x10')](function(_0x3396dd){if(_0x3396dd){return _0x3396dd['removeDispositions'](_0x21478b[_0xe92c('0x48')]['ids']);}})[_0xe92c('0x10')](respondWithStatusCode(_0x39a358,null))[_0xe92c('0x17')](handleError(_0x39a358,null));};exports[_0xe92c('0x69')]=function(_0x2f7804,_0x4eb676){if(_0x2f7804[_0xe92c('0x5d')]['id']){delete _0x2f7804[_0xe92c('0x5d')]['id'];}return db[_0xe92c('0x42')][_0xe92c('0x60')]({'where':{'id':_0x2f7804['params']['id']}})['then'](handleEntityNotFound(_0x4eb676,null))[_0xe92c('0x10')](function(_0x3d2aba){if(_0x3d2aba){_0x2f7804[_0xe92c('0x5d')][_0xe92c('0x63')]=_0x3d2aba['id'];return db['CannedAnswer'][_0xe92c('0x65')](_0x2f7804['body']);}})[_0xe92c('0x10')](respondWithResult(_0x4eb676,null))['catch'](handleError(_0x4eb676,null));};exports[_0xe92c('0x6a')]=function(_0x356b95,_0x44cbc9){var _0x3da280={'raw':![],'where':{}};var _0x12dd3a={};var _0x535c5d={'count':0x0,'rows':[]};return db[_0xe92c('0x42')][_0xe92c('0x66')]({'where':{'id':_0x356b95[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x44cbc9,null))[_0xe92c('0x10')](function(_0x407317){if(_0x407317){_0x12dd3a[_0xe92c('0x47')]=_[_0xe92c('0x49')](db[_0xe92c('0x6b')][_0xe92c('0x43')]);_0x12dd3a[_0xe92c('0x48')]=_[_0xe92c('0x49')](_0x356b95[_0xe92c('0x48')]);_0x12dd3a[_0xe92c('0x4a')]=_['intersection'](_0x12dd3a[_0xe92c('0x47')],_0x12dd3a[_0xe92c('0x48')]);_0x3da280[_0xe92c('0x4c')]=_[_0xe92c('0x4b')](_0x12dd3a[_0xe92c('0x47')],qs[_0xe92c('0x4d')](_0x356b95[_0xe92c('0x48')][_0xe92c('0x4d')]));_0x3da280[_0xe92c('0x4c')]=_0x3da280['attributes'][_0xe92c('0x4e')]?_0x3da280[_0xe92c('0x4c')]:_0x12dd3a['model'];if(!_0x356b95[_0xe92c('0x48')][_0xe92c('0x4f')]('nolimit')){_0x3da280['limit']=qs['limit'](_0x356b95[_0xe92c('0x48')][_0xe92c('0x1d')]);_0x3da280['offset']=qs[_0xe92c('0x1b')](_0x356b95[_0xe92c('0x48')][_0xe92c('0x1b')]);}_0x3da280['order']=qs[_0xe92c('0x68')](_0x356b95[_0xe92c('0x48')]['sort']);_0x3da280[_0xe92c('0x51')]=qs['filters'](_[_0xe92c('0x52')](_0x356b95['query'],_0x12dd3a[_0xe92c('0x4a')]));_0x3da280[_0xe92c('0x51')]['MailAccountId']=_0x407317['id'];if(_0x356b95['query'][_0xe92c('0x53')]){_0x3da280['where']=_['merge'](_0x3da280[_0xe92c('0x51')],{'$or':_[_0xe92c('0x41')](_0x3da280[_0xe92c('0x4c')],function(_0x33af60){var _0x4d6a7b={};_0x4d6a7b[_0x33af60]={'$like':'%'+_0x356b95[_0xe92c('0x48')][_0xe92c('0x53')]+'%'};return _0x4d6a7b;})});}_0x3da280=_['merge']({},_0x3da280,_0x356b95[_0xe92c('0x5c')]);return db['CannedAnswer'][_0xe92c('0x1e')]({'where':_0x3da280[_0xe92c('0x51')]})[_0xe92c('0x10')](function(_0x494829){_0x535c5d[_0xe92c('0x1e')]=_0x494829;if(_0x356b95[_0xe92c('0x48')][_0xe92c('0x56')]){_0x3da280[_0xe92c('0x57')]=[{'all':!![]}];}return db[_0xe92c('0x6b')][_0xe92c('0x58')](_0x3da280);})[_0xe92c('0x10')](function(_0x188fa9){_0x535c5d['rows']=_0x188fa9;return _0x535c5d;});}})['then'](respondWithFilteredResult(_0x44cbc9,_0x3da280))['catch'](handleError(_0x44cbc9,null));};exports[_0xe92c('0x6c')]=function(_0x11ab66,_0x446002){return db[_0xe92c('0x42')]['find']({'where':{'id':_0x11ab66['params']['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x446002,null))[_0xe92c('0x10')](function(_0x537d8c){if(_0x537d8c){return _0x537d8c[_0xe92c('0x6c')](_0x11ab66[_0xe92c('0x48')][_0xe92c('0x6d')]);}})[_0xe92c('0x10')](respondWithStatusCode(_0x446002,null))['catch'](handleError(_0x446002,null));};exports['create']=function(_0x15cbc0,_0x1bdf2b){var _0x2b5b99={'name':_0x15cbc0['body'][_0xe92c('0x25')],'key':_0x15cbc0[_0xe92c('0x5d')]['key'],'provider':_0x15cbc0[_0xe92c('0x5d')][_0xe92c('0x5e')]===_0xe92c('0x5f')?null:_0x15cbc0[_0xe92c('0x5d')][_0xe92c('0x5e')],'email':_0x15cbc0[_0xe92c('0x5d')]['email'],'ListId':_0x15cbc0[_0xe92c('0x5d')][_0xe92c('0x6e')],'active':!_[_0xe92c('0x6f')](_0x15cbc0['body'][_0xe92c('0x70')])?_0x15cbc0[_0xe92c('0x5d')][_0xe92c('0x70')]:!![],'description':_0x15cbc0['body'][_0xe92c('0x71')]||null};var _0x94ce88=getAuthenticationOptions(_0x2b5b99[_0xe92c('0x5e')],_0x15cbc0[_0xe92c('0x5d')]);_0x2b5b99[_0xe92c('0x3b')]=_0x94ce88[_0xe92c('0x3b')];_0x2b5b99[_0xe92c('0x3c')]=_0x94ce88[_0xe92c('0x3c')];return db[_0xe92c('0x42')][_0xe92c('0x65')](_0x2b5b99,{'include':[{'model':db[_0xe92c('0x3e')],'as':_0xe92c('0x3c')},{'model':db[_0xe92c('0x3d')],'as':'Imap'}]})[_0xe92c('0x10')](function(_0x4ceeac){var _0x199066=_0x15cbc0[_0xe92c('0x30')][_0xe92c('0x21')]({'plain':!![]});if(!_0x199066)throw new Error(_0xe92c('0x72'));if(_0x199066[_0xe92c('0x73')]==='user'){var _0x34d3f9=_0x4ceeac[_0xe92c('0x21')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':'MailAccounts','userProfileId':_0x199066[_0xe92c('0x74')]},'raw':!![]})['then'](function(_0x19474d){if(_0x19474d&&_0x19474d[_0xe92c('0x75')]===0x0){return db[_0xe92c('0x22')]['create']({'name':_0x34d3f9[_0xe92c('0x25')],'resourceId':_0x34d3f9['id'],'type':_0x19474d[_0xe92c('0x25')],'sectionId':_0x19474d['id']},{})['then'](function(){return _0x4ceeac;});}else{return _0x4ceeac;}})[_0xe92c('0x17')](function(_0x144ff8){logger[_0xe92c('0x14')](_0xe92c('0x76'),_0x144ff8);throw _0x144ff8;});}return _0x4ceeac;})[_0xe92c('0x10')](respondWithResult(_0x1bdf2b,0xc9))[_0xe92c('0x17')](handleError(_0x1bdf2b,null));};exports['getImap']=function(_0x484184,_0x8c9073){return db[_0xe92c('0x42')][_0xe92c('0x66')]({'where':{'id':_0x484184['params']['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x8c9073,null))['then'](function(_0x1b0715){if(_0x1b0715){return _0x1b0715[_0xe92c('0x77')]();}return null;})['then'](respondWithResult(_0x8c9073,null))[_0xe92c('0x17')](handleError(_0x8c9073,null));};exports['addImap']=function(_0xfa6110,_0x23e804){if(_0xfa6110[_0xe92c('0x5d')]['id']){delete _0xfa6110[_0xe92c('0x5d')]['id'];}return db[_0xe92c('0x42')][_0xe92c('0x60')]({'where':{'id':_0xfa6110[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x23e804,null))['then'](function(_0x32e90e){if(_0x32e90e){_0xfa6110[_0xe92c('0x5d')][_0xe92c('0x63')]=_0x32e90e['id'];return db['MailServerIn'][_0xe92c('0x65')](_0xfa6110[_0xe92c('0x5d')]);}})[_0xe92c('0x10')](respondWithResult(_0x23e804,null))[_0xe92c('0x17')](handleError(_0x23e804,null));};exports[_0xe92c('0x78')]=function(_0x5e2f9c,_0x3f7187){return db['MailAccount'][_0xe92c('0x66')]({'where':{'id':_0x5e2f9c[_0xe92c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x3f7187,null))['then'](function(_0x553bb8){if(_0x553bb8){return _0x553bb8[_0xe92c('0x79')](null);}return null;})['then'](respondWithStatusCode(_0x3f7187,null))[_0xe92c('0x17')](handleError(_0x3f7187,null));};exports[_0xe92c('0x7a')]=function(_0x567f5e,_0x4380ea){return db['MailAccount']['findOne']({'where':{'id':_0x567f5e[_0xe92c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4380ea,null))['then'](function(_0xedbcb){if(_0xedbcb){return _0xedbcb[_0xe92c('0x7a')]();}return null;})['then'](respondWithResult(_0x4380ea,null))[_0xe92c('0x17')](handleError(_0x4380ea,null));};exports[_0xe92c('0x7b')]=function(_0x70a6b2,_0xdb94be){if(_0x70a6b2[_0xe92c('0x5d')]['id']){delete _0x70a6b2[_0xe92c('0x5d')]['id'];}return db['MailAccount'][_0xe92c('0x60')]({'where':{'id':_0x70a6b2[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0xdb94be,null))[_0xe92c('0x10')](function(_0x17a130){if(_0x17a130){_0x70a6b2[_0xe92c('0x5d')][_0xe92c('0x63')]=_0x17a130['id'];return db[_0xe92c('0x3e')][_0xe92c('0x65')](_0x70a6b2[_0xe92c('0x5d')]);}})['then'](respondWithResult(_0xdb94be,null))[_0xe92c('0x17')](handleError(_0xdb94be,null));};exports[_0xe92c('0x7c')]=function(_0xc36a30,_0x5db35d){return db[_0xe92c('0x42')][_0xe92c('0x66')]({'where':{'id':_0xc36a30[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x5db35d,null))['then'](function(_0xe343ae){if(_0xe343ae){return _0xe343ae['setSmtp'](null);}return null;})['then'](respondWithStatusCode(_0x5db35d,null))[_0xe92c('0x17')](handleError(_0x5db35d,null));};exports['addInteraction']=function(_0x191df9,_0x56e29e){return db[_0xe92c('0x7d')][_0xe92c('0x60')]({'where':{'id':_0x191df9['params']['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x56e29e,null))[_0xe92c('0x10')](function(_0x36985d){if(_0x36985d){return _0x36985d['addInteraction'](_0x191df9['body'][_0xe92c('0x6d')],_[_0xe92c('0x7e')](_0x191df9[_0xe92c('0x5d')],[_0xe92c('0x6d'),'id'])||{});}})[_0xe92c('0x10')](respondWithResult(_0x56e29e,null))['catch'](handleError(_0x56e29e,null));};exports[_0xe92c('0x7f')]=function(_0x1d72c2,_0x26c9c){var _0x36221f={'raw':![],'where':{}};var _0x5a0a18={};var _0x15295c={'count':0x0,'rows':[]};return db[_0xe92c('0x42')]['findOne']({'where':{'id':_0x1d72c2[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x26c9c,null))[_0xe92c('0x10')](function(_0x5aa543){if(_0x5aa543){_0x5a0a18['model']=_[_0xe92c('0x49')](db[_0xe92c('0x7d')]['rawAttributes']);_0x5a0a18[_0xe92c('0x48')]=_[_0xe92c('0x49')](_0x1d72c2['query']);_0x5a0a18[_0xe92c('0x4a')]=_[_0xe92c('0x4b')](_0x5a0a18[_0xe92c('0x47')],_0x5a0a18['query']);_0x36221f[_0xe92c('0x4c')]=_['intersection'](_0x5a0a18['model'],qs[_0xe92c('0x4d')](_0x1d72c2['query'][_0xe92c('0x4d')]));_0x36221f[_0xe92c('0x4c')]=_0x36221f[_0xe92c('0x4c')][_0xe92c('0x4e')]?_0x36221f[_0xe92c('0x4c')]:_0x5a0a18[_0xe92c('0x47')];if(!_0x1d72c2[_0xe92c('0x48')][_0xe92c('0x4f')](_0xe92c('0x50'))){_0x36221f['limit']=qs[_0xe92c('0x1d')](_0x1d72c2[_0xe92c('0x48')][_0xe92c('0x1d')]);_0x36221f[_0xe92c('0x1b')]=qs['offset'](_0x1d72c2[_0xe92c('0x48')]['offset']);}_0x36221f[_0xe92c('0x67')]=qs[_0xe92c('0x68')](_0x1d72c2[_0xe92c('0x48')][_0xe92c('0x68')]);_0x36221f['where']=qs['filters'](_[_0xe92c('0x52')](_0x1d72c2[_0xe92c('0x48')],_0x5a0a18[_0xe92c('0x4a')]));_0x36221f[_0xe92c('0x51')][_0xe92c('0x63')]=_0x5aa543['id'];if(_0x1d72c2[_0xe92c('0x48')][_0xe92c('0x53')]){_0x36221f[_0xe92c('0x51')]=_[_0xe92c('0x54')](_0x36221f[_0xe92c('0x51')],{'$or':_['map'](_0x36221f['attributes'],function(_0x27f587){var _0x5c2854={};_0x5c2854[_0x27f587]={'$like':'%'+_0x1d72c2['query'][_0xe92c('0x53')]+'%'};return _0x5c2854;})});}_0x36221f=_[_0xe92c('0x54')]({},_0x36221f,_0x1d72c2[_0xe92c('0x5c')]);return db[_0xe92c('0x7d')]['count']({'where':_0x36221f[_0xe92c('0x51')]})['then'](function(_0x451330){_0x15295c['count']=_0x451330;if(_0x1d72c2[_0xe92c('0x48')]['includeAll']){_0x36221f[_0xe92c('0x57')]=[{'model':db[_0xe92c('0x80')],'as':_0xe92c('0x81'),'required':![]},{'model':db[_0xe92c('0x82')],'as':_0xe92c('0x83'),'attributes':[_0xe92c('0x25'),_0xe92c('0x84'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xe92c('0x25'),_0xe92c('0x85')],'where':_0x1d72c2[_0xe92c('0x48')]['tag']?{'id':_0x1d72c2['query'][_0xe92c('0x86')]}:undefined,'required':_0x1d72c2[_0xe92c('0x48')][_0xe92c('0x86')]?!![]:![]}];}return db['MailInteraction'][_0xe92c('0x58')](_0x36221f);})[_0xe92c('0x10')](function(_0x343393){_0x15295c[_0xe92c('0x59')]=_0x343393;return _0x15295c;});}})[_0xe92c('0x10')](respondWithFilteredResult(_0x26c9c,_0x36221f))[_0xe92c('0x17')](handleError(_0x26c9c,null));};exports[_0xe92c('0x87')]=function addApplications(_0x403561,_0x4fa2c1){var _0x2b4f50=_0x403561['params']['id'];var _0x2d3973=_0x403561[_0xe92c('0x5d')];var _0x5edd9c=0xc8;var _0x5461de=null;return db[_0xe92c('0x88')]['transaction']({'isolationLevel':db[_0xe92c('0x88')][_0xe92c('0x89')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x108e76){return db[_0xe92c('0x42')][_0xe92c('0x66')]({'where':{'id':_0x2b4f50},'transaction':_0x108e76})[_0xe92c('0x10')](function(_0xd2e036){if(_0xd2e036){return db['MailApplication']['destroy']({'where':{'MailAccountId':_0x2b4f50},'transaction':_0x108e76})[_0xe92c('0x10')](function(){var _0x4cb9bb=_[_0xe92c('0x41')](_0x2d3973,function(_0x44bcd7){_0x44bcd7[_0xe92c('0x63')]=_0x2b4f50;return _0x44bcd7;});return db[_0xe92c('0x8a')][_0xe92c('0x8b')](_0x4cb9bb,{'transaction':_0x108e76});});}else{_0x5edd9c=0x194;_0x5461de=[];}});})[_0xe92c('0x10')](function(){if(_0x5edd9c!==0x194){return db[_0xe92c('0x8a')][_0xe92c('0x8c')]({'where':{'MailAccountId':_0x2b4f50},'order':'priority'})[_0xe92c('0x10')](function(_0x220766){_0x5461de=_0x220766;});}})[_0xe92c('0x17')](function(_0x5a879b){_0x5edd9c=0x1f4;logger['error'](_0x5a879b['stack']);if(_0x5a879b[_0xe92c('0x25')]){delete _0x5a879b[_0xe92c('0x25')];}_0x5461de=_0x5a879b;})[_0xe92c('0x8d')](function(){if(_0x5461de===null){_0x4fa2c1['sendStatus'](_0x5edd9c);}else{if(_0x5edd9c===0x1f4){_0x4fa2c1[_0xe92c('0x19')](_0x5edd9c)[_0xe92c('0x8e')](_0x5461de);}else{_0x4fa2c1[_0xe92c('0x19')](_0x5edd9c)[_0xe92c('0x1a')](_0x5461de);}}});};exports[_0xe92c('0x8f')]=function(_0x5978bf,_0x4ccbfe){var _0x543302={};var _0x5b3223={};var _0x1a48f4;var _0x2bc60f;return db['MailAccount'][_0xe92c('0x66')]({'where':{'id':_0x5978bf[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x4ccbfe,null))[_0xe92c('0x10')](function(_0x5c498a){if(_0x5c498a){_0x1a48f4=_0x5c498a;_0x5b3223['model']=_[_0xe92c('0x49')](db['MailApplication']['rawAttributes']);_0x5b3223['query']=_[_0xe92c('0x49')](_0x5978bf[_0xe92c('0x48')]);_0x5b3223[_0xe92c('0x4a')]=_[_0xe92c('0x4b')](_0x5b3223[_0xe92c('0x47')],_0x5b3223[_0xe92c('0x48')]);_0x543302['attributes']=_[_0xe92c('0x4b')](_0x5b3223['model'],qs[_0xe92c('0x4d')](_0x5978bf[_0xe92c('0x48')][_0xe92c('0x4d')]));_0x543302[_0xe92c('0x4c')]=_0x543302[_0xe92c('0x4c')][_0xe92c('0x4e')]?_0x543302[_0xe92c('0x4c')]:_0x5b3223[_0xe92c('0x47')];_0x543302[_0xe92c('0x67')]=qs['sort'](_0x5978bf['query']['sort']);_0x543302[_0xe92c('0x51')]=qs[_0xe92c('0x4a')](_['pick'](_0x5978bf['query'],_0x5b3223[_0xe92c('0x4a')]));if(_0x5978bf['query']['filter']){_0x543302[_0xe92c('0x51')]=_[_0xe92c('0x54')](_0x543302[_0xe92c('0x51')],{'$or':_[_0xe92c('0x41')](_0x543302[_0xe92c('0x4c')],function(_0x442c0c){var _0x5d151b={};_0x5d151b[_0x442c0c]={'$like':'%'+_0x5978bf[_0xe92c('0x48')][_0xe92c('0x53')]+'%'};return _0x5d151b;})});}_0x543302=_[_0xe92c('0x54')]({},_0x543302,_0x5978bf[_0xe92c('0x5c')]);return _0x1a48f4['getApplications'](_0x543302);}})['then'](function(_0x56962b){if(_0x56962b){_0x2bc60f=_0x56962b[_0xe92c('0x4e')];if(!_0x5978bf['query'][_0xe92c('0x4f')](_0xe92c('0x50'))){_0x543302[_0xe92c('0x1d')]=qs[_0xe92c('0x1d')](_0x5978bf[_0xe92c('0x48')][_0xe92c('0x1d')]);_0x543302[_0xe92c('0x1b')]=qs['offset'](_0x5978bf[_0xe92c('0x48')][_0xe92c('0x1b')]);}return _0x1a48f4['getApplications'](_0x543302);}})[_0xe92c('0x10')](function(_0x8f5492){if(_0x8f5492){return _0x8f5492?{'count':_0x2bc60f,'rows':_0x8f5492}:null;}})[_0xe92c('0x10')](respondWithResult(_0x4ccbfe,null))['catch'](handleError(_0x4ccbfe,null));};exports[_0xe92c('0x90')]=function(_0x5b02fb,_0x44c6d2){var _0x4d9174={'raw':!![],'where':{}};var _0xa19bcd={};var _0xdd3ec8={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5b02fb[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x44c6d2,null))[_0xe92c('0x10')](function(_0x4bffca){if(_0x4bffca){_0xa19bcd[_0xe92c('0x47')]=_[_0xe92c('0x49')](db[_0xe92c('0x91')][_0xe92c('0x43')]);_0xa19bcd[_0xe92c('0x48')]=_[_0xe92c('0x49')](_0x5b02fb[_0xe92c('0x48')]);_0xa19bcd[_0xe92c('0x4a')]=_[_0xe92c('0x4b')](_0xa19bcd[_0xe92c('0x47')],_0xa19bcd['query']);_0x4d9174[_0xe92c('0x4c')]=_['intersection'](_0xa19bcd[_0xe92c('0x47')],qs['fields'](_0x5b02fb[_0xe92c('0x48')][_0xe92c('0x4d')]));_0x4d9174[_0xe92c('0x4c')]=_0x4d9174[_0xe92c('0x4c')][_0xe92c('0x4e')]?_0x4d9174['attributes']:_0xa19bcd[_0xe92c('0x47')];if(!_0x5b02fb[_0xe92c('0x48')]['hasOwnProperty'](_0xe92c('0x50'))){_0x4d9174[_0xe92c('0x1d')]=qs[_0xe92c('0x1d')](_0x5b02fb['query']['limit']);_0x4d9174[_0xe92c('0x1b')]=qs['offset'](_0x5b02fb[_0xe92c('0x48')][_0xe92c('0x1b')]);}_0x4d9174['order']=qs[_0xe92c('0x68')](_0x5b02fb[_0xe92c('0x48')][_0xe92c('0x68')]);_0x4d9174[_0xe92c('0x51')]=qs[_0xe92c('0x4a')](_['pick'](_0x5b02fb[_0xe92c('0x48')],_0xa19bcd['filters']));_0x4d9174[_0xe92c('0x51')][_0xe92c('0x63')]=_0x4bffca['id'];if(_0x5b02fb[_0xe92c('0x48')][_0xe92c('0x53')]){_0x4d9174['where']=_['merge'](_0x4d9174[_0xe92c('0x51')],{'$or':_[_0xe92c('0x41')](_0x4d9174[_0xe92c('0x4c')],function(_0x4ff9c8){var _0x39bab5={};_0x39bab5[_0x4ff9c8]={'$like':'%'+_0x5b02fb[_0xe92c('0x48')]['filter']+'%'};return _0x39bab5;})});}if(_0x5b02fb[_0xe92c('0x48')][_0xe92c('0x92')]){var _0x5ee056=_0x5b02fb[_0xe92c('0x48')]['$gte'][_0xe92c('0x93')](',');var _0x4eb801={};_0x4eb801[_0x5ee056[0x0]]={'$gte':moment(_0x5ee056[0x1])[_0xe92c('0x94')](_0xe92c('0x95'))};_0x4d9174[_0xe92c('0x51')]=_[_0xe92c('0x54')](_0x4d9174[_0xe92c('0x51')],_0x4eb801);}_0x4d9174=_['merge']({},_0x4d9174,_0x5b02fb[_0xe92c('0x5c')]);return db[_0xe92c('0x91')][_0xe92c('0x1e')]({'where':_0x4d9174[_0xe92c('0x51')]})[_0xe92c('0x10')](function(_0x3cc9ac){_0xdd3ec8[_0xe92c('0x1e')]=_0x3cc9ac;if(_0x5b02fb[_0xe92c('0x48')][_0xe92c('0x56')]){_0x4d9174[_0xe92c('0x57')]=[{'all':!![]}];}return db[_0xe92c('0x91')][_0xe92c('0x58')](_0x4d9174);})['then'](function(_0x3f7c8c){if(_0x5b02fb[_0xe92c('0x48')]['inlineCss']==='true'){for(var _0x46088b=0x0;_0x46088b<_0x3f7c8c[_0xe92c('0x4e')];_0x46088b++){_0x3f7c8c[_0x46088b][_0xe92c('0x5d')]=juice(_0x3f7c8c[_0x46088b][_0xe92c('0x5d')]);}}_0xdd3ec8[_0xe92c('0x59')]=_0x3f7c8c;return _0xdd3ec8;});}})[_0xe92c('0x10')](respondWithFilteredResult(_0x44c6d2,_0x4d9174))[_0xe92c('0x17')](handleError(_0x44c6d2,null));};exports[_0xe92c('0x8e')]=function(_0x22f42a,_0x50595c){var _0x58f879,_0x4c09bf={},_0x4a6ff4;if(_0x22f42a[_0xe92c('0x5d')]['to']){_0x4a6ff4=_0x22f42a['body']['to'][_0xe92c('0x93')](',')[0x0];}return db['MailAccount'][_0xe92c('0x60')]({'where':{'id':_0x22f42a[_0xe92c('0x5b')]['id']},'include':[{'model':db[_0xe92c('0x96')],'as':_0xe92c('0x97'),'include':[{'model':db[_0xe92c('0x80')],'as':'Contacts','where':{'email':_0x4a6ff4},'limit':0x1,'order':[[_0xe92c('0x98'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0xe92c('0x3c'),'raw':!![],'include':[{'model':db[_0xe92c('0x99')],'as':_0xe92c('0x99'),'raw':!![]}]}]})[_0xe92c('0x10')](handleEntityNotFound(_0x50595c,null))[_0xe92c('0x10')](function(_0x8d13db){if(!_0x8d13db)return;_0x58f879=_0x8d13db;if(!_0x8d13db[_0xe92c('0x3c')])throw new Error(_0xe92c('0x9a'));if(_['isNil'](_0x22f42a[_0xe92c('0x5d')][_0xe92c('0x9b')])){_0x22f42a[_0xe92c('0x5d')][_0xe92c('0x9b')]=util[_0xe92c('0x94')](_0xe92c('0x9c'),_0x8d13db[_0xe92c('0x25')],_0x8d13db[_0xe92c('0x9d')]||_0x8d13db['Smtp'][_0xe92c('0x30')]);}if(_0x22f42a[_0xe92c('0x5d')][_0xe92c('0x9e')]&&_0x22f42a[_0xe92c('0x5d')]['attachments'][_0xe92c('0x4e')]){for(var _0x34678c=0x0;_0x34678c<_0x22f42a['body'][_0xe92c('0x9e')][_0xe92c('0x4e')];_0x34678c+=0x1){_0x22f42a[_0xe92c('0x5d')]['attachments'][_0x34678c]={'filename':_0x22f42a[_0xe92c('0x5d')]['attachments'][_0x34678c]['name'],'path':path[_0xe92c('0x9f')](config['root'],_0xe92c('0xa0'),_0x22f42a[_0xe92c('0x5d')][_0xe92c('0x9e')][_0x34678c]['basename'])};}}var _0x4918d4=_0x8d13db[_0xe92c('0xa1')]();return respondWithRpcPromise(_0xe92c('0xa2'),_0xe92c('0xa3'),{'account':_0x4918d4,'message':_0x22f42a[_0xe92c('0x5d')]});})[_0xe92c('0x10')](function(_0x10d513){if(!_0x10d513)return;_0x4c09bf=_0x10d513;if(!_0x58f879[_0xe92c('0x97')])throw new Error('List\x20not\x20found');if(_0x58f879[_0xe92c('0x97')]['Contacts'][_0xe92c('0x4e')])return _0x58f879[_0xe92c('0x97')]['Contacts'][0x0];return db['CmContact'][_0xe92c('0x65')](_['defaults'](_0x22f42a[_0xe92c('0x5d')],{'firstName':_0x22f42a[_0xe92c('0x5d')]['to'],'email':_0x22f42a['body']['to'],'phone':_0x22f42a[_0xe92c('0x5d')]['to'],'ListId':_0x58f879[_0xe92c('0x6e')]}));})[_0xe92c('0x10')](function(_0x387ed8){if(!_0x387ed8)return;var _0x3401a2={'UserId':_0x22f42a[_0xe92c('0x30')]['id'],'ContactId':_0x387ed8['id'],'MailAccountId':_0x58f879['id'],'inReplyTo':_0x4c09bf[_0xe92c('0xa4')],'to':_0x22f42a['body']['from'],'cc':_0x22f42a[_0xe92c('0x5d')]['cc'],'subject':_0x22f42a['body'][_0xe92c('0xa5')],'attach':_0x22f42a[_0xe92c('0x5d')][_0xe92c('0xa6')],'firstMsgDirection':'out','lastMsgAt':moment()[_0xe92c('0x94')](_0xe92c('0x95')),'lastMsgDirection':_0xe92c('0xa7'),'Messages':[_[_0xe92c('0x54')](_0x22f42a['body'],{'messageId':_0x4c09bf[_0xe92c('0xa4')],'sentAt':moment()[_0xe92c('0x94')](_0xe92c('0x95')),'read':!![],'MailAccountId':_0x58f879['id'],'UserId':_0x22f42a[_0xe92c('0x30')]['id'],'ContactId':_0x387ed8['id']})]};if(_0x22f42a[_0xe92c('0x5d')][_0xe92c('0xa8')]){_0x3401a2=_['merge'](_0x3401a2,_0x22f42a['body'][_0xe92c('0xa8')]);}return db['MailInteraction'][_0xe92c('0x65')](_0x3401a2,{'include':[{'model':db[_0xe92c('0x91')],'as':_0xe92c('0xa9')}]});})[_0xe92c('0x10')](respondWithResult(_0x50595c,null))[_0xe92c('0x17')](handleError(_0x50595c,null));};exports[_0xe92c('0xaa')]=function(_0x4c791a,_0x46ee5c){return db[_0xe92c('0x42')][_0xe92c('0x60')]({'where':{'id':_0x4c791a[_0xe92c('0x5b')]['id']},'include':[{'model':db[_0xe92c('0x3e')],'as':_0xe92c('0x3c'),'raw':!![],'include':[{'model':db[_0xe92c('0x99')],'as':_0xe92c('0x99'),'raw':!![]}]}]})[_0xe92c('0x10')](handleEntityNotFound(_0x46ee5c,null))[_0xe92c('0x10')](function(_0x2064ec){if(!_0x2064ec[_0xe92c('0x3c')])return;var _0x4332bb=_0x2064ec[_0xe92c('0xa1')]();return respondWithRpcPromise(_0xe92c('0xab'),'verifySmtp',{'account':_0x4332bb});})[_0xe92c('0x10')](respondWithResult(_0x46ee5c,null))['catch'](handleError(_0x46ee5c,null));};exports[_0xe92c('0x20')]=function(_0x524771,_0x3f7735){return db[_0xe92c('0x42')][_0xe92c('0x60')]({'where':{'id':_0x524771[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x3f7735,null))[_0xe92c('0x10')](function(_0x209aef){if(_0x209aef&&_0x209aef[_0xe92c('0x39')]){throw new db[(_0xe92c('0xac'))][(_0xe92c('0xad'))](_0xe92c('0xae'));}return _0x209aef;})[_0xe92c('0x10')](removeEntity(_0x3f7735,null))['catch'](handleError(_0x3f7735,null));};exports[_0xe92c('0xaf')]=function(_0x30afbf,_0x247aa6){return db['MailAccount']['find']({'where':{'id':_0x30afbf[_0xe92c('0x5b')]['id']}})[_0xe92c('0x10')](handleEntityNotFound(_0x247aa6,null))[_0xe92c('0x10')](function(_0x4d7f0e){if(_0x4d7f0e){return _0x4d7f0e[_0xe92c('0xaf')](_0x30afbf[_0xe92c('0x5d')][_0xe92c('0x6d')],_[_0xe92c('0x7e')](_0x30afbf['body'],[_0xe92c('0x6d'),'id'])||{})[_0xe92c('0xb0')](function(_0x15dc82){for(var _0x41d747=0x0;_0x41d747<_0x30afbf['body'][_0xe92c('0x6d')][_0xe92c('0x4e')];_0x41d747+=0x1){socket[_0xe92c('0xb1')]('userMailAccount:save',{'UserId':Number(_0x30afbf[_0xe92c('0x5d')][_0xe92c('0x6d')][_0x41d747]),'MailAccountId':Number(_0x30afbf['params']['id'])});}return _0x15dc82;});}})[_0xe92c('0x10')](respondWithResult(_0x247aa6,null))[_0xe92c('0x17')](handleError(_0x247aa6,null));};exports['removeAgents']=function(_0x201c9f,_0x563aa1){return db[_0xe92c('0x42')][_0xe92c('0x60')]({'where':{'id':_0x201c9f[_0xe92c('0x5b')]['id']}})['then'](handleEntityNotFound(_0x563aa1,null))['then'](function(_0x471152){if(_0x471152){return _0x471152[_0xe92c('0xb2')](_0x201c9f[_0xe92c('0x48')][_0xe92c('0x6d')])[_0xe92c('0x10')](function(){if(_[_0xe92c('0xb3')](_0x201c9f[_0xe92c('0x48')][_0xe92c('0x6d')])){for(var _0x1ee96f=0x0;_0x1ee96f<_0x201c9f[_0xe92c('0x48')]['ids'][_0xe92c('0x4e')];_0x1ee96f+=0x1){socket[_0xe92c('0xb1')]('userMailAccount:remove',{'UserId':Number(_0x201c9f[_0xe92c('0x48')]['ids'][_0x1ee96f]),'MailAccountId':Number(_0x201c9f[_0xe92c('0x5b')]['id'])});}}else{socket[_0xe92c('0xb1')](_0xe92c('0xb4'),{'UserId':Number(_0x201c9f[_0xe92c('0x48')][_0xe92c('0x6d')]),'MailAccountId':Number(_0x201c9f[_0xe92c('0x5b')]['id'])});}});}})[_0xe92c('0x10')](respondWithStatusCode(_0x563aa1,null))[_0xe92c('0x17')](handleError(_0x563aa1,null));};exports[_0xe92c('0xb5')]=function(_0x11b885,_0x3f8a06){var _0x1fa83f={};var _0x25a269={};var _0x3e90a7;var _0x387ef1;return db[_0xe92c('0x42')][_0xe92c('0x66')]({'where':{'id':_0x11b885['params']['id']}})['then'](handleEntityNotFound(_0x3f8a06,null))['then'](function(_0x35c1a1){if(_0x35c1a1){_0x3e90a7=_0x35c1a1;_0x25a269[_0xe92c('0x47')]=_[_0xe92c('0x49')](db[_0xe92c('0x82')]['rawAttributes']);_0x25a269[_0xe92c('0x48')]=_['keys'](_0x11b885[_0xe92c('0x48')]);_0x25a269[_0xe92c('0x4a')]=_[_0xe92c('0x4b')](_0x25a269['model'],_0x25a269['query']);_0x1fa83f[_0xe92c('0x4c')]=_[_0xe92c('0x4b')](_0x25a269[_0xe92c('0x47')],qs['fields'](_0x11b885[_0xe92c('0x48')]['fields']));_0x1fa83f[_0xe92c('0x4c')]=_0x1fa83f['attributes'][_0xe92c('0x4e')]?_0x1fa83f[_0xe92c('0x4c')]:_0x25a269[_0xe92c('0x47')];_0x1fa83f['order']=qs[_0xe92c('0x68')](_0x11b885[_0xe92c('0x48')]['sort']);_0x1fa83f[_0xe92c('0x51')]=qs['filters'](_[_0xe92c('0x52')](_0x11b885[_0xe92c('0x48')],_0x25a269[_0xe92c('0x4a')]));if(_0x11b885[_0xe92c('0x48')][_0xe92c('0x53')]){_0x1fa83f['where']=_[_0xe92c('0x54')](_0x1fa83f[_0xe92c('0x51')],{'$or':_[_0xe92c('0x41')](_0x1fa83f[_0xe92c('0x4c')],function(_0x344690){var _0x58cae2={};_0x58cae2[_0x344690]={'$like':'%'+_0x11b885['query'][_0xe92c('0x53')]+'%'};return _0x58cae2;})});}_0x1fa83f=_[_0xe92c('0x54')]({},_0x1fa83f,_0x11b885[_0xe92c('0x5c')]);return _0x3e90a7[_0xe92c('0xb5')](_0x1fa83f);}})[_0xe92c('0x10')](function(_0x2f5c8d){if(_0x2f5c8d){_0x387ef1=_0x2f5c8d[_0xe92c('0x4e')];if(!_0x11b885[_0xe92c('0x48')]['hasOwnProperty']('nolimit')){_0x1fa83f[_0xe92c('0x1d')]=qs[_0xe92c('0x1d')](_0x11b885[_0xe92c('0x48')][_0xe92c('0x1d')]);_0x1fa83f[_0xe92c('0x1b')]=qs['offset'](_0x11b885[_0xe92c('0x48')]['offset']);}return _0x3e90a7['getAgents'](_0x1fa83f);}})[_0xe92c('0x10')](function(_0x433874){if(_0x433874){return _0x433874?{'count':_0x387ef1,'rows':_0x433874}:null;}})[_0xe92c('0x10')](respondWithResult(_0x3f8a06,null))[_0xe92c('0x17')](handleError(_0x3f8a06,null));}; \ No newline at end of file +var _0xe2c9=['server/files/attachments','basename','getSmtpOptions','sendMail','List\x20not\x20found','defaults','subject','attach','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','bluebird','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','then','destroy','MailAccounts','UserProfileResource','stack','name','send','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','gmail','smtp.gmail.com','smtp.mail.yahoo.com','smtp-mail.outlook.com','smtp.office365.com','Unknown\x20email\x20service\x20provider','user','username','password','pass','modernAuthentication','CloudProviderId','host','port','secure','service','authentication','Imap','Smtp','MailServerIn','map','MailAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','MailServerOut','Pause','mandatoryDispositionPause','keys','options','find','update','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','removeDispositions','ids','getAnswers','CannedAnswer','removeAnswers','key','email','ListId','isNil','active','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','CmContact','Contact','User','Owner','fullname','Tag','Tags','color','tag','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','true','split','List','Contacts','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2c9,0x1a3));var _0x9e2c=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0xe2c9[_0x2b5eae];return _0x5f3ac9;};'use strict';var moment=require('moment');var BPromise=require(_0x9e2c('0x0'));var util=require('util');var path=require(_0x9e2c('0x1'));var _=require(_0x9e2c('0x2'));var juice=require(_0x9e2c('0x3'));var Redis=require(_0x9e2c('0x4'));var qs=require(_0x9e2c('0x5'));var logger=require(_0x9e2c('0x6'))('api');var config=require(_0x9e2c('0x7'));var db=require(_0x9e2c('0x8'))['db'];config[_0x9e2c('0x9')]=_['defaults'](config[_0x9e2c('0x9')],{'host':_0x9e2c('0xa'),'port':0x18eb});var socket=require(_0x9e2c('0xb'))(new Redis(config[_0x9e2c('0x9')]));require(_0x9e2c('0xc'))[_0x9e2c('0xd')](socket);var jayson=require(_0x9e2c('0xe'));var client=jayson[_0x9e2c('0xf')][_0x9e2c('0x10')]({'port':0x232b});function respondWithRpcPromise(_0x7f23d1,_0x5b8943,_0x36a396,_0x51d77f){return new BPromise(function(_0x568dce,_0x244575){var _0x11524b=_0x51d77f||client;return _0x11524b[_0x9e2c('0x11')](_0x7f23d1,_0x36a396)['then'](function(_0x3a4b7b){logger[_0x9e2c('0x12')](_0x9e2c('0x13'),_0x5b8943,_0x9e2c('0x14'));logger[_0x9e2c('0x15')](_0x9e2c('0x16'),_0x5b8943,'request\x20sent',JSON['stringify'](_0x3a4b7b));if(_0x3a4b7b[_0x9e2c('0x17')]){if(_0x3a4b7b[_0x9e2c('0x17')][_0x9e2c('0x18')]===0x1f4){logger[_0x9e2c('0x17')](_0x9e2c('0x13'),_0x5b8943,_0x3a4b7b['error'][_0x9e2c('0x19')]);return _0x244575(_0x3a4b7b[_0x9e2c('0x17')]['message']);}logger[_0x9e2c('0x17')]('MailAccount,\x20%s,\x20%s',_0x5b8943,_0x3a4b7b[_0x9e2c('0x17')][_0x9e2c('0x19')]);return _0x568dce(_0x3a4b7b[_0x9e2c('0x17')][_0x9e2c('0x19')]);}else{logger[_0x9e2c('0x12')]('MailAccount,\x20%s,\x20%s',_0x5b8943,_0x9e2c('0x14'));_0x568dce(_0x3a4b7b[_0x9e2c('0x1a')][_0x9e2c('0x19')]);}})[_0x9e2c('0x1b')](function(_0x3cbdcc){logger[_0x9e2c('0x17')]('MailAccount,\x20%s,\x20%s',_0x5b8943,_0x3cbdcc);_0x244575(_0x3cbdcc);});});}function respondWithStatusCode(_0x358bb8,_0x57b9fa){_0x57b9fa=_0x57b9fa||0xcc;return function(_0x344635){if(_0x344635){return _0x358bb8[_0x9e2c('0x1c')](_0x57b9fa);}return _0x358bb8[_0x9e2c('0x1d')](_0x57b9fa)[_0x9e2c('0x1e')]();};}function respondWithResult(_0x2eca7b,_0x5a011e){_0x5a011e=_0x5a011e||0xc8;return function(_0x23d2b2){if(_0x23d2b2){return _0x2eca7b[_0x9e2c('0x1d')](_0x5a011e)[_0x9e2c('0x1f')](_0x23d2b2);}};}function respondWithFilteredResult(_0x3ea0f1,_0x4e13cb){return function(_0x982422){if(_0x982422){var _0x2f33d0=typeof _0x4e13cb[_0x9e2c('0x20')]===_0x9e2c('0x21')&&typeof _0x4e13cb[_0x9e2c('0x22')]==='undefined';var _0x358cd9=_0x982422[_0x9e2c('0x23')];var _0x12dcae=_0x2f33d0?0x0:_0x4e13cb[_0x9e2c('0x20')];var _0x2c09e2=_0x2f33d0?_0x982422[_0x9e2c('0x23')]:_0x4e13cb[_0x9e2c('0x20')]+_0x4e13cb[_0x9e2c('0x22')];var _0xc8b199;if(_0x2c09e2>=_0x358cd9){_0x2c09e2=_0x358cd9;_0xc8b199=0xc8;}else{_0xc8b199=0xce;}_0x3ea0f1[_0x9e2c('0x1d')](_0xc8b199);return _0x3ea0f1[_0x9e2c('0x24')]('Content-Range',_0x12dcae+'-'+_0x2c09e2+'/'+_0x358cd9)[_0x9e2c('0x1f')](_0x982422);}return null;};}function saveUpdates(_0x3c140d){return function(_0x333e3f){if(_0x333e3f){return _0x333e3f['update'](_0x3c140d)[_0x9e2c('0x25')](function(_0x445e2a){return _0x445e2a;});}return null;};}function removeEntity(_0x55988c){return function(_0x5d83ec){if(_0x5d83ec){return _0x5d83ec[_0x9e2c('0x26')]()['then'](function(){var _0x1ac363=_0x5d83ec['get']({'plain':!![]});var _0x1bcd89=_0x9e2c('0x27');return db[_0x9e2c('0x28')][_0x9e2c('0x26')]({'where':{'type':_0x1bcd89,'resourceId':_0x1ac363['id']}})[_0x9e2c('0x25')](function(){return _0x5d83ec;});})[_0x9e2c('0x25')](function(){_0x55988c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e8fa){return function(_0xc69ff0){if(!_0xc69ff0){_0x45e8fa[_0x9e2c('0x1c')](0x194);}return _0xc69ff0;};}function handleError(_0x37306c,_0x5072f4){_0x5072f4=_0x5072f4||0x1f4;return function(_0x4af464){logger['error'](_0x4af464[_0x9e2c('0x29')]);if(_0x4af464['name']){delete _0x4af464[_0x9e2c('0x2a')];}_0x37306c['status'](_0x5072f4)[_0x9e2c('0x2b')](_0x4af464);};}function getImapHost(_0x57304c){switch(_0x57304c){case'gmail':return _0x9e2c('0x2c');case _0x9e2c('0x2d'):return _0x9e2c('0x2e');case _0x9e2c('0x2f'):return _0x9e2c('0x30');case _0x9e2c('0x31'):return'outlook.office365.com';}throw new Error('Unknown\x20email\x20service\x20provider',_0x57304c);}function getSmtpHost(_0x1f286e){switch(_0x1f286e){case _0x9e2c('0x32'):return _0x9e2c('0x33');case'yahoo':return _0x9e2c('0x34');case _0x9e2c('0x2f'):return _0x9e2c('0x35');case'outlook365':return _0x9e2c('0x36');}throw new Error(_0x9e2c('0x37'),_0x1f286e);}function getAuthenticationOptions(_0xd9aca6,_0x3e059b){var _0x180d4c={};var _0x2c5d41={};if(_0xd9aca6){_0x180d4c[_0x9e2c('0x38')]=_0x2c5d41[_0x9e2c('0x38')]=_0x3e059b[_0x9e2c('0x39')];_0x180d4c[_0x9e2c('0x3a')]=_0x2c5d41[_0x9e2c('0x3b')]=_0x3e059b['password'];if(_0x3e059b[_0x9e2c('0x3c')]){_0x180d4c[_0x9e2c('0x3c')]=_0x2c5d41[_0x9e2c('0x3c')]=!![];_0x180d4c[_0x9e2c('0x3d')]=_0x2c5d41[_0x9e2c('0x3d')]=_0x3e059b[_0x9e2c('0x3d')];_0x180d4c[_0x9e2c('0x3a')]=_0x2c5d41[_0x9e2c('0x3b')]=null;}else{_0x180d4c[_0x9e2c('0x3d')]=_0x2c5d41[_0x9e2c('0x3d')]=null;}_0x180d4c[_0x9e2c('0x3e')]=getImapHost(_0xd9aca6);_0x180d4c[_0x9e2c('0x3f')]=0x3e1;_0x2c5d41[_0x9e2c('0x3e')]=getSmtpHost(_0xd9aca6);_0x2c5d41[_0x9e2c('0x3f')]=0x24b;_0x2c5d41[_0x9e2c('0x40')]=![];_0x180d4c[_0x9e2c('0x41')]=_0x2c5d41[_0x9e2c('0x41')]=null;}else{if(_0x3e059b['authentication']){_0x180d4c['user']=_0x2c5d41[_0x9e2c('0x38')]=_0x3e059b[_0x9e2c('0x39')];_0x180d4c[_0x9e2c('0x3a')]=_0x2c5d41[_0x9e2c('0x3b')]=_0x3e059b[_0x9e2c('0x3a')];}else{_0x180d4c[_0x9e2c('0x42')]=_0x2c5d41[_0x9e2c('0x42')]=![];_0x180d4c[_0x9e2c('0x38')]=_0x2c5d41[_0x9e2c('0x38')]=null;_0x180d4c['password']=_0x2c5d41[_0x9e2c('0x3b')]=null;}_0x180d4c[_0x9e2c('0x3e')]=_0x3e059b[_0x9e2c('0x43')]['host'];_0x180d4c[_0x9e2c('0x3f')]=_0x3e059b[_0x9e2c('0x43')][_0x9e2c('0x3f')];_0x2c5d41[_0x9e2c('0x3e')]=_0x3e059b[_0x9e2c('0x44')][_0x9e2c('0x3e')];_0x2c5d41[_0x9e2c('0x3f')]=_0x3e059b[_0x9e2c('0x44')][_0x9e2c('0x3f')];}return{'Imap':_0x180d4c,'Smtp':_0x2c5d41};}exports['index']=function(_0x2edd54,_0x52c16c){var _0x513a15={'include':[{'model':db[_0x9e2c('0x45')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x9e2c('0x44')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x126a2b={},_0x3237c6={'count':0x0,'rows':[]};var _0xa30633=_[_0x9e2c('0x46')](db[_0x9e2c('0x47')][_0x9e2c('0x48')],function(_0x577d3d){return{'name':_0x577d3d[_0x9e2c('0x49')],'type':_0x577d3d[_0x9e2c('0x4a')]['key']};});_0x126a2b[_0x9e2c('0x4b')]=_[_0x9e2c('0x46')](_0xa30633,_0x9e2c('0x2a'));_0x126a2b[_0x9e2c('0x4c')]=_['keys'](_0x2edd54[_0x9e2c('0x4c')]);_0x126a2b[_0x9e2c('0x4d')]=_[_0x9e2c('0x4e')](_0x126a2b[_0x9e2c('0x4b')],_0x126a2b['query']);_0x513a15[_0x9e2c('0x4f')]=_[_0x9e2c('0x4e')](_0x126a2b['model'],qs[_0x9e2c('0x50')](_0x2edd54[_0x9e2c('0x4c')][_0x9e2c('0x50')]));_0x513a15[_0x9e2c('0x4f')]=_0x513a15[_0x9e2c('0x4f')][_0x9e2c('0x51')]?_0x513a15[_0x9e2c('0x4f')]:_0x126a2b[_0x9e2c('0x4b')];if(!_0x2edd54['query'][_0x9e2c('0x52')](_0x9e2c('0x53'))){_0x513a15['limit']=qs[_0x9e2c('0x22')](_0x2edd54[_0x9e2c('0x4c')][_0x9e2c('0x22')]);_0x513a15[_0x9e2c('0x20')]=qs[_0x9e2c('0x20')](_0x2edd54[_0x9e2c('0x4c')][_0x9e2c('0x20')]);}_0x513a15[_0x9e2c('0x54')]=qs[_0x9e2c('0x55')](_0x2edd54[_0x9e2c('0x4c')][_0x9e2c('0x55')]);_0x513a15[_0x9e2c('0x56')]=qs['filters'](_[_0x9e2c('0x57')](_0x2edd54['query'],_0x126a2b[_0x9e2c('0x4d')]),_0xa30633);if(_0x2edd54['query']['filter']){_0x513a15[_0x9e2c('0x56')]=_[_0x9e2c('0x58')](_0x513a15[_0x9e2c('0x56')],{'$or':_[_0x9e2c('0x46')](_0xa30633,function(_0x5f09b4){if(_0x5f09b4[_0x9e2c('0x4a')]!==_0x9e2c('0x59')){var _0x55c9e7={};_0x55c9e7[_0x5f09b4[_0x9e2c('0x2a')]]={'$like':'%'+_0x2edd54[_0x9e2c('0x4c')][_0x9e2c('0x5a')]+'%'};return _0x55c9e7;}})});}_0x513a15=_['merge']({},_0x513a15,_0x2edd54['options']);var _0x42cb2a={'where':_0x513a15[_0x9e2c('0x56')]};return db[_0x9e2c('0x47')][_0x9e2c('0x23')](_0x42cb2a)[_0x9e2c('0x25')](function(_0x296cf1){_0x3237c6[_0x9e2c('0x23')]=_0x296cf1;if(_0x2edd54[_0x9e2c('0x4c')][_0x9e2c('0x5b')]){_0x513a15[_0x9e2c('0x5c')]=[{'all':!![]}];}return db[_0x9e2c('0x47')][_0x9e2c('0x5d')](_0x513a15);})[_0x9e2c('0x25')](function(_0x40e24c){_0x3237c6[_0x9e2c('0x5e')]=_0x40e24c;return _0x3237c6;})[_0x9e2c('0x25')](respondWithFilteredResult(_0x52c16c,_0x513a15))[_0x9e2c('0x1b')](handleError(_0x52c16c,null));};exports[_0x9e2c('0x5f')]=function(_0x421f6a,_0x570fb5){var _0x843b27={'raw':![],'where':{'id':_0x421f6a[_0x9e2c('0x60')]['id']},'include':[{'model':db[_0x9e2c('0x45')],'as':_0x9e2c('0x43')},{'model':db[_0x9e2c('0x61')],'as':_0x9e2c('0x44')},{'model':db[_0x9e2c('0x62')],'as':_0x9e2c('0x63')}]},_0x1892f7={};_0x1892f7[_0x9e2c('0x4b')]=_['keys'](db[_0x9e2c('0x47')]['rawAttributes']);_0x1892f7[_0x9e2c('0x4c')]=_[_0x9e2c('0x64')](_0x421f6a['query']);_0x1892f7['filters']=_[_0x9e2c('0x4e')](_0x1892f7[_0x9e2c('0x4b')],_0x1892f7[_0x9e2c('0x4c')]);_0x843b27[_0x9e2c('0x4f')]=_[_0x9e2c('0x4e')](_0x1892f7[_0x9e2c('0x4b')],qs[_0x9e2c('0x50')](_0x421f6a[_0x9e2c('0x4c')][_0x9e2c('0x50')]));_0x843b27[_0x9e2c('0x4f')]=_0x843b27[_0x9e2c('0x4f')]['length']?_0x843b27[_0x9e2c('0x4f')]:_0x1892f7[_0x9e2c('0x4b')];if(_0x421f6a[_0x9e2c('0x4c')][_0x9e2c('0x5b')]){_0x843b27[_0x9e2c('0x5c')]=[{'all':!![]}];}_0x843b27=_[_0x9e2c('0x58')]({},_0x843b27,_0x421f6a[_0x9e2c('0x65')]);return db[_0x9e2c('0x47')][_0x9e2c('0x66')](_0x843b27)[_0x9e2c('0x25')](handleEntityNotFound(_0x570fb5,null))['then'](respondWithResult(_0x570fb5,null))[_0x9e2c('0x1b')](handleError(_0x570fb5,null));};exports[_0x9e2c('0x67')]=function(_0x4a1537,_0x54ed5c){if(_0x4a1537['body']['id']){delete _0x4a1537[_0x9e2c('0x68')]['id'];}var _0x5e10c6=_0x4a1537['body'][_0x9e2c('0x69')]===_0x9e2c('0x6a')?null:_0x4a1537[_0x9e2c('0x68')]['provider'];var _0x562634=_0x4a1537['body'][_0x9e2c('0x43')]||{};var _0x52e35d=_0x4a1537[_0x9e2c('0x68')][_0x9e2c('0x44')]||{};if(_0x5e10c6){_0x562634[_0x9e2c('0x3e')]=getImapHost(_0x5e10c6);_0x562634[_0x9e2c('0x3f')]=0x3e1;_0x52e35d[_0x9e2c('0x3e')]=getSmtpHost(_0x5e10c6);_0x52e35d[_0x9e2c('0x3f')]=0x24b;_0x52e35d[_0x9e2c('0x40')]=![];}if(_0x52e35d['modernAuthentication']){_0x52e35d[_0x9e2c('0x40')]=![];}else{_0x52e35d[_0x9e2c('0x3d')]=null;}if(!_0x562634['modernAuthentication'])_0x562634[_0x9e2c('0x3d')]=null;_0x4a1537[_0x9e2c('0x68')][_0x9e2c('0x43')]=_0x562634;_0x4a1537[_0x9e2c('0x68')]['Smtp']=_0x52e35d;return db[_0x9e2c('0x47')][_0x9e2c('0x66')]({'where':{'id':_0x4a1537['params']['id']},'include':[{'model':db[_0x9e2c('0x45')],'as':_0x9e2c('0x43')},{'model':db[_0x9e2c('0x61')],'as':_0x9e2c('0x44')},{'model':db[_0x9e2c('0x62')],'as':_0x9e2c('0x63')}]})[_0x9e2c('0x25')](handleEntityNotFound(_0x54ed5c,null))[_0x9e2c('0x25')](function(_0x2ff2f1){if(!_0x2ff2f1)throw new Error(_0x9e2c('0x6b'));if(_0x2ff2f1[_0x9e2c('0x41')])delete _0x4a1537[_0x9e2c('0x68')][_0x9e2c('0x43')];return _0x2ff2f1;})['then'](saveUpdates(_0x4a1537[_0x9e2c('0x68')],null))[_0x9e2c('0x25')](function(_0x5f3b2c){if(!_0x4a1537['body'][_0x9e2c('0x43')])return _0x5f3b2c;return db[_0x9e2c('0x45')][_0x9e2c('0x67')](_0x4a1537['body'][_0x9e2c('0x43')],{'where':{'MailAccountId':_0x5f3b2c['id']}})[_0x9e2c('0x25')](function(){return _0x5f3b2c;});})['then'](function(_0x2a8321){if(!_0x4a1537['body']['Smtp'])return _0x2a8321;return db[_0x9e2c('0x61')][_0x9e2c('0x67')](_0x4a1537[_0x9e2c('0x68')]['Smtp'],{'where':{'MailAccountId':_0x2a8321['id']}})[_0x9e2c('0x25')](function(){return _0x2a8321;});})[_0x9e2c('0x25')](respondWithResult(_0x54ed5c,null))[_0x9e2c('0x1b')](handleError(_0x54ed5c,null));};exports['describe']=function(_0x2eaa1b,_0x4e47b3){return db['MailAccount'][_0x9e2c('0x6c')]()[_0x9e2c('0x25')](respondWithResult(_0x4e47b3,null))['catch'](handleError(_0x4e47b3,null));};exports[_0x9e2c('0x6d')]=function(_0x4b0289,_0x348c46){if(_0x4b0289['body']['id']){delete _0x4b0289[_0x9e2c('0x68')]['id'];}return db[_0x9e2c('0x47')][_0x9e2c('0x66')]({'where':{'id':_0x4b0289[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x348c46,null))[_0x9e2c('0x25')](function(_0x527290){if(_0x527290){_0x4b0289['body'][_0x9e2c('0x6e')]=_0x527290['id'];return db[_0x9e2c('0x6f')][_0x9e2c('0x70')](_0x4b0289['body']);}})[_0x9e2c('0x25')](respondWithResult(_0x348c46,null))[_0x9e2c('0x1b')](handleError(_0x348c46,null));};exports[_0x9e2c('0x71')]=function(_0x2aed4e,_0xbe18ff){var _0x15d088={'raw':![],'where':{}};var _0x515d18={};var _0x169b28={'count':0x0,'rows':[]};return db[_0x9e2c('0x47')][_0x9e2c('0x72')]({'where':{'id':_0x2aed4e[_0x9e2c('0x60')]['id']}})['then'](handleEntityNotFound(_0xbe18ff,null))[_0x9e2c('0x25')](function(_0x1ea9dc){if(_0x1ea9dc){_0x515d18['model']=_[_0x9e2c('0x64')](db['Disposition']['rawAttributes']);_0x515d18[_0x9e2c('0x4c')]=_[_0x9e2c('0x64')](_0x2aed4e['query']);_0x515d18[_0x9e2c('0x4d')]=_[_0x9e2c('0x4e')](_0x515d18['model'],_0x515d18[_0x9e2c('0x4c')]);_0x15d088[_0x9e2c('0x4f')]=_[_0x9e2c('0x4e')](_0x515d18[_0x9e2c('0x4b')],qs[_0x9e2c('0x50')](_0x2aed4e[_0x9e2c('0x4c')][_0x9e2c('0x50')]));_0x15d088[_0x9e2c('0x4f')]=_0x15d088['attributes'][_0x9e2c('0x51')]?_0x15d088[_0x9e2c('0x4f')]:_0x515d18[_0x9e2c('0x4b')];if(!_0x2aed4e[_0x9e2c('0x4c')][_0x9e2c('0x52')](_0x9e2c('0x53'))){_0x15d088[_0x9e2c('0x22')]=qs[_0x9e2c('0x22')](_0x2aed4e[_0x9e2c('0x4c')][_0x9e2c('0x22')]);_0x15d088[_0x9e2c('0x20')]=qs[_0x9e2c('0x20')](_0x2aed4e[_0x9e2c('0x4c')][_0x9e2c('0x20')]);}_0x15d088['order']=qs[_0x9e2c('0x55')](_0x2aed4e[_0x9e2c('0x4c')][_0x9e2c('0x55')]);_0x15d088[_0x9e2c('0x56')]=qs['filters'](_[_0x9e2c('0x57')](_0x2aed4e[_0x9e2c('0x4c')],_0x515d18[_0x9e2c('0x4d')]));_0x15d088[_0x9e2c('0x56')]['MailAccountId']=_0x1ea9dc['id'];if(_0x2aed4e['query'][_0x9e2c('0x5a')]){_0x15d088[_0x9e2c('0x56')]=_[_0x9e2c('0x58')](_0x15d088[_0x9e2c('0x56')],{'$or':_[_0x9e2c('0x46')](_0x15d088['attributes'],function(_0x258fa3){var _0x515d64={};_0x515d64[_0x258fa3]={'$like':'%'+_0x2aed4e[_0x9e2c('0x4c')][_0x9e2c('0x5a')]+'%'};return _0x515d64;})});}_0x15d088=_[_0x9e2c('0x58')]({},_0x15d088,_0x2aed4e['options']);return db[_0x9e2c('0x6f')][_0x9e2c('0x23')]({'where':_0x15d088['where']})[_0x9e2c('0x25')](function(_0x271c29){_0x169b28['count']=_0x271c29;if(_0x2aed4e['query']['includeAll']){_0x15d088['include']=[{'all':!![]}];}return db[_0x9e2c('0x6f')][_0x9e2c('0x5d')](_0x15d088);})[_0x9e2c('0x25')](function(_0x1384f8){_0x169b28['rows']=_0x1384f8;return _0x169b28;});}})[_0x9e2c('0x25')](respondWithFilteredResult(_0xbe18ff,_0x15d088))[_0x9e2c('0x1b')](handleError(_0xbe18ff,null));};exports[_0x9e2c('0x73')]=function(_0x55007c,_0x418e83){return db[_0x9e2c('0x47')][_0x9e2c('0x66')]({'where':{'id':_0x55007c[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x418e83,null))[_0x9e2c('0x25')](function(_0x312f09){if(_0x312f09){return _0x312f09[_0x9e2c('0x73')](_0x55007c[_0x9e2c('0x4c')][_0x9e2c('0x74')]);}})['then'](respondWithStatusCode(_0x418e83,null))[_0x9e2c('0x1b')](handleError(_0x418e83,null));};exports['addAnswer']=function(_0x14b5cd,_0x158104){if(_0x14b5cd[_0x9e2c('0x68')]['id']){delete _0x14b5cd['body']['id'];}return db[_0x9e2c('0x47')][_0x9e2c('0x66')]({'where':{'id':_0x14b5cd[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x158104,null))[_0x9e2c('0x25')](function(_0xfbb223){if(_0xfbb223){_0x14b5cd[_0x9e2c('0x68')][_0x9e2c('0x6e')]=_0xfbb223['id'];return db['CannedAnswer'][_0x9e2c('0x70')](_0x14b5cd[_0x9e2c('0x68')]);}})['then'](respondWithResult(_0x158104,null))['catch'](handleError(_0x158104,null));};exports[_0x9e2c('0x75')]=function(_0x118767,_0x559c5d){var _0x54e045={'raw':![],'where':{}};var _0x4fe3c3={};var _0xb9278f={'count':0x0,'rows':[]};return db['MailAccount'][_0x9e2c('0x72')]({'where':{'id':_0x118767['params']['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x559c5d,null))[_0x9e2c('0x25')](function(_0x21f33d){if(_0x21f33d){_0x4fe3c3['model']=_['keys'](db[_0x9e2c('0x76')][_0x9e2c('0x48')]);_0x4fe3c3[_0x9e2c('0x4c')]=_[_0x9e2c('0x64')](_0x118767['query']);_0x4fe3c3[_0x9e2c('0x4d')]=_['intersection'](_0x4fe3c3[_0x9e2c('0x4b')],_0x4fe3c3[_0x9e2c('0x4c')]);_0x54e045[_0x9e2c('0x4f')]=_[_0x9e2c('0x4e')](_0x4fe3c3[_0x9e2c('0x4b')],qs['fields'](_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x50')]));_0x54e045[_0x9e2c('0x4f')]=_0x54e045[_0x9e2c('0x4f')][_0x9e2c('0x51')]?_0x54e045['attributes']:_0x4fe3c3[_0x9e2c('0x4b')];if(!_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x52')]('nolimit')){_0x54e045[_0x9e2c('0x22')]=qs[_0x9e2c('0x22')](_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x22')]);_0x54e045[_0x9e2c('0x20')]=qs[_0x9e2c('0x20')](_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x20')]);}_0x54e045[_0x9e2c('0x54')]=qs['sort'](_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x55')]);_0x54e045[_0x9e2c('0x56')]=qs[_0x9e2c('0x4d')](_[_0x9e2c('0x57')](_0x118767[_0x9e2c('0x4c')],_0x4fe3c3[_0x9e2c('0x4d')]));_0x54e045[_0x9e2c('0x56')][_0x9e2c('0x6e')]=_0x21f33d['id'];if(_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x5a')]){_0x54e045['where']=_[_0x9e2c('0x58')](_0x54e045[_0x9e2c('0x56')],{'$or':_[_0x9e2c('0x46')](_0x54e045[_0x9e2c('0x4f')],function(_0x29c940){var _0x121d60={};_0x121d60[_0x29c940]={'$like':'%'+_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x5a')]+'%'};return _0x121d60;})});}_0x54e045=_[_0x9e2c('0x58')]({},_0x54e045,_0x118767['options']);return db[_0x9e2c('0x76')]['count']({'where':_0x54e045[_0x9e2c('0x56')]})[_0x9e2c('0x25')](function(_0x2cfc1a){_0xb9278f[_0x9e2c('0x23')]=_0x2cfc1a;if(_0x118767[_0x9e2c('0x4c')][_0x9e2c('0x5b')]){_0x54e045[_0x9e2c('0x5c')]=[{'all':!![]}];}return db[_0x9e2c('0x76')][_0x9e2c('0x5d')](_0x54e045);})[_0x9e2c('0x25')](function(_0x5761e9){_0xb9278f[_0x9e2c('0x5e')]=_0x5761e9;return _0xb9278f;});}})[_0x9e2c('0x25')](respondWithFilteredResult(_0x559c5d,_0x54e045))[_0x9e2c('0x1b')](handleError(_0x559c5d,null));};exports[_0x9e2c('0x77')]=function(_0x5da56a,_0x49c98e){return db[_0x9e2c('0x47')]['find']({'where':{'id':_0x5da56a['params']['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x49c98e,null))[_0x9e2c('0x25')](function(_0x1aa043){if(_0x1aa043){return _0x1aa043[_0x9e2c('0x77')](_0x5da56a['query'][_0x9e2c('0x74')]);}})[_0x9e2c('0x25')](respondWithStatusCode(_0x49c98e,null))[_0x9e2c('0x1b')](handleError(_0x49c98e,null));};exports['create']=function(_0x2d37cc,_0x1ee3f8){var _0x1e5d25={'name':_0x2d37cc[_0x9e2c('0x68')]['name'],'key':_0x2d37cc[_0x9e2c('0x68')][_0x9e2c('0x78')],'provider':_0x2d37cc[_0x9e2c('0x68')][_0x9e2c('0x69')]==='custom'?null:_0x2d37cc[_0x9e2c('0x68')][_0x9e2c('0x69')],'email':_0x2d37cc['body'][_0x9e2c('0x79')],'ListId':_0x2d37cc['body'][_0x9e2c('0x7a')],'active':!_[_0x9e2c('0x7b')](_0x2d37cc['body'][_0x9e2c('0x7c')])?_0x2d37cc['body']['active']:!![],'description':_0x2d37cc[_0x9e2c('0x68')]['description']||null};var _0x5d761e=getAuthenticationOptions(_0x1e5d25[_0x9e2c('0x69')],_0x2d37cc[_0x9e2c('0x68')]);_0x1e5d25[_0x9e2c('0x43')]=_0x5d761e[_0x9e2c('0x43')];_0x1e5d25[_0x9e2c('0x44')]=_0x5d761e['Smtp'];return db[_0x9e2c('0x47')][_0x9e2c('0x70')](_0x1e5d25,{'include':[{'model':db[_0x9e2c('0x61')],'as':_0x9e2c('0x44')},{'model':db[_0x9e2c('0x45')],'as':_0x9e2c('0x43')}]})[_0x9e2c('0x25')](function(_0x761338){var _0x4061a8=_0x2d37cc[_0x9e2c('0x38')][_0x9e2c('0x7d')]({'plain':!![]});if(!_0x4061a8)throw new Error(_0x9e2c('0x7e'));if(_0x4061a8[_0x9e2c('0x7f')]===_0x9e2c('0x38')){var _0x1f92d8=_0x761338['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x9e2c('0x27'),'userProfileId':_0x4061a8['userProfileId']},'raw':!![]})[_0x9e2c('0x25')](function(_0x4d82be){if(_0x4d82be&&_0x4d82be[_0x9e2c('0x80')]===0x0){return db['UserProfileResource']['create']({'name':_0x1f92d8[_0x9e2c('0x2a')],'resourceId':_0x1f92d8['id'],'type':_0x4d82be[_0x9e2c('0x2a')],'sectionId':_0x4d82be['id']},{})[_0x9e2c('0x25')](function(){return _0x761338;});}else{return _0x761338;}})[_0x9e2c('0x1b')](function(_0x1691e1){logger[_0x9e2c('0x17')](_0x9e2c('0x81'),_0x1691e1);throw _0x1691e1;});}return _0x761338;})[_0x9e2c('0x25')](respondWithResult(_0x1ee3f8,0xc9))[_0x9e2c('0x1b')](handleError(_0x1ee3f8,null));};exports[_0x9e2c('0x82')]=function(_0xda986b,_0x2d9756){return db[_0x9e2c('0x47')]['findOne']({'where':{'id':_0xda986b['params']['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x2d9756,null))['then'](function(_0x45ad7e){if(_0x45ad7e){return _0x45ad7e['getImap']();}return null;})[_0x9e2c('0x25')](respondWithResult(_0x2d9756,null))[_0x9e2c('0x1b')](handleError(_0x2d9756,null));};exports[_0x9e2c('0x83')]=function(_0x1fa08b,_0x5b7c73){if(_0x1fa08b[_0x9e2c('0x68')]['id']){delete _0x1fa08b['body']['id'];}return db['MailAccount'][_0x9e2c('0x66')]({'where':{'id':_0x1fa08b[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x5b7c73,null))[_0x9e2c('0x25')](function(_0x5dec45){if(_0x5dec45){_0x1fa08b['body'][_0x9e2c('0x6e')]=_0x5dec45['id'];return db[_0x9e2c('0x45')][_0x9e2c('0x70')](_0x1fa08b[_0x9e2c('0x68')]);}})[_0x9e2c('0x25')](respondWithResult(_0x5b7c73,null))[_0x9e2c('0x1b')](handleError(_0x5b7c73,null));};exports[_0x9e2c('0x84')]=function(_0x3295f8,_0x3abac9){return db[_0x9e2c('0x47')][_0x9e2c('0x72')]({'where':{'id':_0x3295f8[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x3abac9,null))[_0x9e2c('0x25')](function(_0x58c079){if(_0x58c079){return _0x58c079[_0x9e2c('0x85')](null);}return null;})['then'](respondWithStatusCode(_0x3abac9,null))['catch'](handleError(_0x3abac9,null));};exports['getSmtp']=function(_0x185409,_0x15dd6a){return db[_0x9e2c('0x47')][_0x9e2c('0x72')]({'where':{'id':_0x185409[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x15dd6a,null))[_0x9e2c('0x25')](function(_0x2a80ef){if(_0x2a80ef){return _0x2a80ef[_0x9e2c('0x86')]();}return null;})[_0x9e2c('0x25')](respondWithResult(_0x15dd6a,null))[_0x9e2c('0x1b')](handleError(_0x15dd6a,null));};exports[_0x9e2c('0x87')]=function(_0x476018,_0x279fe5){if(_0x476018['body']['id']){delete _0x476018[_0x9e2c('0x68')]['id'];}return db[_0x9e2c('0x47')]['find']({'where':{'id':_0x476018[_0x9e2c('0x60')]['id']}})['then'](handleEntityNotFound(_0x279fe5,null))[_0x9e2c('0x25')](function(_0x336e0b){if(_0x336e0b){_0x476018[_0x9e2c('0x68')][_0x9e2c('0x6e')]=_0x336e0b['id'];return db[_0x9e2c('0x61')][_0x9e2c('0x70')](_0x476018[_0x9e2c('0x68')]);}})[_0x9e2c('0x25')](respondWithResult(_0x279fe5,null))['catch'](handleError(_0x279fe5,null));};exports[_0x9e2c('0x88')]=function(_0x53630a,_0xf6d5f4){return db[_0x9e2c('0x47')][_0x9e2c('0x72')]({'where':{'id':_0x53630a[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0xf6d5f4,null))['then'](function(_0xf1928e){if(_0xf1928e){return _0xf1928e[_0x9e2c('0x89')](null);}return null;})[_0x9e2c('0x25')](respondWithStatusCode(_0xf6d5f4,null))['catch'](handleError(_0xf6d5f4,null));};exports[_0x9e2c('0x8a')]=function(_0xa1db34,_0x4a6bca){return db[_0x9e2c('0x8b')][_0x9e2c('0x66')]({'where':{'id':_0xa1db34['params']['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x4a6bca,null))[_0x9e2c('0x25')](function(_0x29c327){if(_0x29c327){return _0x29c327[_0x9e2c('0x8a')](_0xa1db34[_0x9e2c('0x68')][_0x9e2c('0x74')],_['omit'](_0xa1db34[_0x9e2c('0x68')],[_0x9e2c('0x74'),'id'])||{});}})[_0x9e2c('0x25')](respondWithResult(_0x4a6bca,null))[_0x9e2c('0x1b')](handleError(_0x4a6bca,null));};exports['getInteractions']=function(_0xb23b3f,_0x282007){var _0x42e5a8={'raw':![],'where':{}};var _0x266ff9={};var _0x4d6168={'count':0x0,'rows':[]};return db['MailAccount'][_0x9e2c('0x72')]({'where':{'id':_0xb23b3f[_0x9e2c('0x60')]['id']}})['then'](handleEntityNotFound(_0x282007,null))[_0x9e2c('0x25')](function(_0x5c04fe){if(_0x5c04fe){_0x266ff9[_0x9e2c('0x4b')]=_['keys'](db[_0x9e2c('0x8b')][_0x9e2c('0x48')]);_0x266ff9[_0x9e2c('0x4c')]=_['keys'](_0xb23b3f[_0x9e2c('0x4c')]);_0x266ff9[_0x9e2c('0x4d')]=_[_0x9e2c('0x4e')](_0x266ff9[_0x9e2c('0x4b')],_0x266ff9[_0x9e2c('0x4c')]);_0x42e5a8['attributes']=_[_0x9e2c('0x4e')](_0x266ff9[_0x9e2c('0x4b')],qs[_0x9e2c('0x50')](_0xb23b3f[_0x9e2c('0x4c')]['fields']));_0x42e5a8[_0x9e2c('0x4f')]=_0x42e5a8['attributes'][_0x9e2c('0x51')]?_0x42e5a8[_0x9e2c('0x4f')]:_0x266ff9[_0x9e2c('0x4b')];if(!_0xb23b3f[_0x9e2c('0x4c')]['hasOwnProperty'](_0x9e2c('0x53'))){_0x42e5a8[_0x9e2c('0x22')]=qs['limit'](_0xb23b3f[_0x9e2c('0x4c')][_0x9e2c('0x22')]);_0x42e5a8[_0x9e2c('0x20')]=qs[_0x9e2c('0x20')](_0xb23b3f[_0x9e2c('0x4c')][_0x9e2c('0x20')]);}_0x42e5a8['order']=qs[_0x9e2c('0x55')](_0xb23b3f[_0x9e2c('0x4c')][_0x9e2c('0x55')]);_0x42e5a8[_0x9e2c('0x56')]=qs['filters'](_[_0x9e2c('0x57')](_0xb23b3f['query'],_0x266ff9['filters']));_0x42e5a8[_0x9e2c('0x56')][_0x9e2c('0x6e')]=_0x5c04fe['id'];if(_0xb23b3f['query']['filter']){_0x42e5a8[_0x9e2c('0x56')]=_[_0x9e2c('0x58')](_0x42e5a8[_0x9e2c('0x56')],{'$or':_[_0x9e2c('0x46')](_0x42e5a8[_0x9e2c('0x4f')],function(_0x41ab43){var _0x488917={};_0x488917[_0x41ab43]={'$like':'%'+_0xb23b3f['query'][_0x9e2c('0x5a')]+'%'};return _0x488917;})});}_0x42e5a8=_['merge']({},_0x42e5a8,_0xb23b3f[_0x9e2c('0x65')]);return db['MailInteraction']['count']({'where':_0x42e5a8['where']})[_0x9e2c('0x25')](function(_0x4d0489){_0x4d6168[_0x9e2c('0x23')]=_0x4d0489;if(_0xb23b3f[_0x9e2c('0x4c')]['includeAll']){_0x42e5a8[_0x9e2c('0x5c')]=[{'model':db[_0x9e2c('0x8c')],'as':_0x9e2c('0x8d'),'required':![]},{'model':db[_0x9e2c('0x8e')],'as':_0x9e2c('0x8f'),'attributes':[_0x9e2c('0x2a'),_0x9e2c('0x90'),'internal'],'required':![]},{'model':db[_0x9e2c('0x91')],'as':_0x9e2c('0x92'),'attributes':['id',_0x9e2c('0x2a'),_0x9e2c('0x93')],'where':_0xb23b3f[_0x9e2c('0x4c')][_0x9e2c('0x94')]?{'id':_0xb23b3f[_0x9e2c('0x4c')]['tag']}:undefined,'required':_0xb23b3f[_0x9e2c('0x4c')][_0x9e2c('0x94')]?!![]:![]}];}return db[_0x9e2c('0x8b')][_0x9e2c('0x5d')](_0x42e5a8);})['then'](function(_0x425f1d){_0x4d6168['rows']=_0x425f1d;return _0x4d6168;});}})[_0x9e2c('0x25')](respondWithFilteredResult(_0x282007,_0x42e5a8))[_0x9e2c('0x1b')](handleError(_0x282007,null));};exports[_0x9e2c('0x95')]=function addApplications(_0x3bd498,_0x4909da){var _0x2f9c6d=_0x3bd498['params']['id'];var _0x12786f=_0x3bd498[_0x9e2c('0x68')];var _0x48bf81=0xc8;var _0x4ef4c8=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize'][_0x9e2c('0x96')][_0x9e2c('0x97')][_0x9e2c('0x98')]},function(_0x5ce61b){return db[_0x9e2c('0x47')]['findOne']({'where':{'id':_0x2f9c6d},'transaction':_0x5ce61b})['then'](function(_0x5d203a){if(_0x5d203a){return db[_0x9e2c('0x99')][_0x9e2c('0x26')]({'where':{'MailAccountId':_0x2f9c6d},'transaction':_0x5ce61b})['then'](function(){var _0x2ac164=_[_0x9e2c('0x46')](_0x12786f,function(_0x43595e){_0x43595e[_0x9e2c('0x6e')]=_0x2f9c6d;return _0x43595e;});return db['MailApplication'][_0x9e2c('0x9a')](_0x2ac164,{'transaction':_0x5ce61b});});}else{_0x48bf81=0x194;_0x4ef4c8=[];}});})[_0x9e2c('0x25')](function(){if(_0x48bf81!==0x194){return db[_0x9e2c('0x99')][_0x9e2c('0x9b')]({'where':{'MailAccountId':_0x2f9c6d},'order':_0x9e2c('0x9c')})['then'](function(_0x4a0329){_0x4ef4c8=_0x4a0329;});}})[_0x9e2c('0x1b')](function(_0x34737d){_0x48bf81=0x1f4;logger[_0x9e2c('0x17')](_0x34737d[_0x9e2c('0x29')]);if(_0x34737d['name']){delete _0x34737d[_0x9e2c('0x2a')];}_0x4ef4c8=_0x34737d;})[_0x9e2c('0x9d')](function(){if(_0x4ef4c8===null){_0x4909da['sendStatus'](_0x48bf81);}else{if(_0x48bf81===0x1f4){_0x4909da[_0x9e2c('0x1d')](_0x48bf81)['send'](_0x4ef4c8);}else{_0x4909da['status'](_0x48bf81)[_0x9e2c('0x1f')](_0x4ef4c8);}}});};exports[_0x9e2c('0x9e')]=function(_0x4e23dc,_0x4a80e7){var _0x47ff48={};var _0x41ced0={};var _0x548450;var _0x10b7de;return db[_0x9e2c('0x47')]['findOne']({'where':{'id':_0x4e23dc[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x4a80e7,null))['then'](function(_0x335100){if(_0x335100){_0x548450=_0x335100;_0x41ced0['model']=_['keys'](db[_0x9e2c('0x99')][_0x9e2c('0x48')]);_0x41ced0[_0x9e2c('0x4c')]=_[_0x9e2c('0x64')](_0x4e23dc[_0x9e2c('0x4c')]);_0x41ced0[_0x9e2c('0x4d')]=_['intersection'](_0x41ced0['model'],_0x41ced0[_0x9e2c('0x4c')]);_0x47ff48['attributes']=_[_0x9e2c('0x4e')](_0x41ced0[_0x9e2c('0x4b')],qs[_0x9e2c('0x50')](_0x4e23dc['query'][_0x9e2c('0x50')]));_0x47ff48[_0x9e2c('0x4f')]=_0x47ff48[_0x9e2c('0x4f')][_0x9e2c('0x51')]?_0x47ff48['attributes']:_0x41ced0[_0x9e2c('0x4b')];_0x47ff48[_0x9e2c('0x54')]=qs[_0x9e2c('0x55')](_0x4e23dc[_0x9e2c('0x4c')]['sort']);_0x47ff48[_0x9e2c('0x56')]=qs[_0x9e2c('0x4d')](_['pick'](_0x4e23dc[_0x9e2c('0x4c')],_0x41ced0['filters']));if(_0x4e23dc['query']['filter']){_0x47ff48['where']=_[_0x9e2c('0x58')](_0x47ff48[_0x9e2c('0x56')],{'$or':_[_0x9e2c('0x46')](_0x47ff48[_0x9e2c('0x4f')],function(_0xa99b7){var _0x244808={};_0x244808[_0xa99b7]={'$like':'%'+_0x4e23dc['query']['filter']+'%'};return _0x244808;})});}_0x47ff48=_[_0x9e2c('0x58')]({},_0x47ff48,_0x4e23dc[_0x9e2c('0x65')]);return _0x548450[_0x9e2c('0x9e')](_0x47ff48);}})[_0x9e2c('0x25')](function(_0x347107){if(_0x347107){_0x10b7de=_0x347107[_0x9e2c('0x51')];if(!_0x4e23dc[_0x9e2c('0x4c')][_0x9e2c('0x52')]('nolimit')){_0x47ff48['limit']=qs[_0x9e2c('0x22')](_0x4e23dc[_0x9e2c('0x4c')][_0x9e2c('0x22')]);_0x47ff48[_0x9e2c('0x20')]=qs[_0x9e2c('0x20')](_0x4e23dc[_0x9e2c('0x4c')]['offset']);}return _0x548450['getApplications'](_0x47ff48);}})[_0x9e2c('0x25')](function(_0x15d68c){if(_0x15d68c){return _0x15d68c?{'count':_0x10b7de,'rows':_0x15d68c}:null;}})['then'](respondWithResult(_0x4a80e7,null))[_0x9e2c('0x1b')](handleError(_0x4a80e7,null));};exports['getMessages']=function(_0x348a0d,_0x5e2229){var _0x24fa0e={'raw':!![],'where':{}};var _0x1a4a20={};var _0x554d45={'count':0x0,'rows':[]};return db[_0x9e2c('0x47')][_0x9e2c('0x72')]({'where':{'id':_0x348a0d[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x5e2229,null))[_0x9e2c('0x25')](function(_0x145386){if(_0x145386){_0x1a4a20['model']=_[_0x9e2c('0x64')](db[_0x9e2c('0x9f')][_0x9e2c('0x48')]);_0x1a4a20['query']=_[_0x9e2c('0x64')](_0x348a0d[_0x9e2c('0x4c')]);_0x1a4a20['filters']=_['intersection'](_0x1a4a20['model'],_0x1a4a20[_0x9e2c('0x4c')]);_0x24fa0e['attributes']=_[_0x9e2c('0x4e')](_0x1a4a20[_0x9e2c('0x4b')],qs[_0x9e2c('0x50')](_0x348a0d[_0x9e2c('0x4c')][_0x9e2c('0x50')]));_0x24fa0e[_0x9e2c('0x4f')]=_0x24fa0e[_0x9e2c('0x4f')][_0x9e2c('0x51')]?_0x24fa0e[_0x9e2c('0x4f')]:_0x1a4a20[_0x9e2c('0x4b')];if(!_0x348a0d[_0x9e2c('0x4c')][_0x9e2c('0x52')](_0x9e2c('0x53'))){_0x24fa0e[_0x9e2c('0x22')]=qs[_0x9e2c('0x22')](_0x348a0d[_0x9e2c('0x4c')]['limit']);_0x24fa0e[_0x9e2c('0x20')]=qs[_0x9e2c('0x20')](_0x348a0d['query'][_0x9e2c('0x20')]);}_0x24fa0e[_0x9e2c('0x54')]=qs['sort'](_0x348a0d[_0x9e2c('0x4c')]['sort']);_0x24fa0e[_0x9e2c('0x56')]=qs[_0x9e2c('0x4d')](_[_0x9e2c('0x57')](_0x348a0d[_0x9e2c('0x4c')],_0x1a4a20[_0x9e2c('0x4d')]));_0x24fa0e[_0x9e2c('0x56')][_0x9e2c('0x6e')]=_0x145386['id'];if(_0x348a0d[_0x9e2c('0x4c')][_0x9e2c('0x5a')]){_0x24fa0e['where']=_[_0x9e2c('0x58')](_0x24fa0e[_0x9e2c('0x56')],{'$or':_[_0x9e2c('0x46')](_0x24fa0e[_0x9e2c('0x4f')],function(_0x85e77){var _0x3ed490={};_0x3ed490[_0x85e77]={'$like':'%'+_0x348a0d[_0x9e2c('0x4c')][_0x9e2c('0x5a')]+'%'};return _0x3ed490;})});}if(_0x348a0d['query'][_0x9e2c('0xa0')]){var _0x3453f3=_0x348a0d[_0x9e2c('0x4c')][_0x9e2c('0xa0')]['split'](',');var _0x1c937e={};_0x1c937e[_0x3453f3[0x0]]={'$gte':moment(_0x3453f3[0x1])[_0x9e2c('0xa1')](_0x9e2c('0xa2'))};_0x24fa0e[_0x9e2c('0x56')]=_[_0x9e2c('0x58')](_0x24fa0e['where'],_0x1c937e);}_0x24fa0e=_[_0x9e2c('0x58')]({},_0x24fa0e,_0x348a0d[_0x9e2c('0x65')]);return db[_0x9e2c('0x9f')][_0x9e2c('0x23')]({'where':_0x24fa0e[_0x9e2c('0x56')]})[_0x9e2c('0x25')](function(_0xbdb375){_0x554d45[_0x9e2c('0x23')]=_0xbdb375;if(_0x348a0d[_0x9e2c('0x4c')][_0x9e2c('0x5b')]){_0x24fa0e[_0x9e2c('0x5c')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x24fa0e);})[_0x9e2c('0x25')](function(_0x54100b){if(_0x348a0d[_0x9e2c('0x4c')]['inlineCss']===_0x9e2c('0xa3')){for(var _0x12d924=0x0;_0x12d924<_0x54100b[_0x9e2c('0x51')];_0x12d924++){_0x54100b[_0x12d924][_0x9e2c('0x68')]=juice(_0x54100b[_0x12d924]['body']);}}_0x554d45[_0x9e2c('0x5e')]=_0x54100b;return _0x554d45;});}})[_0x9e2c('0x25')](respondWithFilteredResult(_0x5e2229,_0x24fa0e))['catch'](handleError(_0x5e2229,null));};exports[_0x9e2c('0x2b')]=function(_0x336c0f,_0x325606){var _0xb68be1,_0x40f2ac={},_0x53c933;if(_0x336c0f[_0x9e2c('0x68')]['to']){_0x53c933=_0x336c0f[_0x9e2c('0x68')]['to'][_0x9e2c('0xa4')](',')[0x0];}return db[_0x9e2c('0x47')][_0x9e2c('0x66')]({'where':{'id':_0x336c0f[_0x9e2c('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x9e2c('0xa5'),'include':[{'model':db[_0x9e2c('0x8c')],'as':_0x9e2c('0xa6'),'where':{'email':_0x53c933},'limit':0x1,'order':[[_0x9e2c('0xa7'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x9e2c('0x44'),'raw':!![],'include':[{'model':db[_0x9e2c('0xa8')],'as':_0x9e2c('0xa8'),'raw':!![]}]}]})[_0x9e2c('0x25')](handleEntityNotFound(_0x325606,null))[_0x9e2c('0x25')](function(_0xd01645){if(!_0xd01645)return;_0xb68be1=_0xd01645;if(!_0xd01645[_0x9e2c('0x44')])throw new Error(_0x9e2c('0xa9'));if(_['isNil'](_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xaa')])){_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xaa')]=util[_0x9e2c('0xa1')](_0x9e2c('0xab'),_0xd01645[_0x9e2c('0x2a')],_0xd01645[_0x9e2c('0x79')]||_0xd01645['Smtp']['user']);}if(_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xac')]&&_0x336c0f['body'][_0x9e2c('0xac')][_0x9e2c('0x51')]){for(var _0x31dc35=0x0;_0x31dc35<_0x336c0f[_0x9e2c('0x68')]['attachments'][_0x9e2c('0x51')];_0x31dc35+=0x1){_0x336c0f['body']['attachments'][_0x31dc35]={'filename':_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xac')][_0x31dc35][_0x9e2c('0x2a')],'path':path[_0x9e2c('0xad')](config[_0x9e2c('0xae')],_0x9e2c('0xaf'),_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xac')][_0x31dc35][_0x9e2c('0xb0')])};}}var _0x3f56fd=_0xd01645[_0x9e2c('0xb1')]();return respondWithRpcPromise('SendMail',_0x9e2c('0xb2'),{'account':_0x3f56fd,'message':_0x336c0f['body']});})['then'](function(_0x2dd956){if(!_0x2dd956)return;_0x40f2ac=_0x2dd956;if(!_0xb68be1[_0x9e2c('0xa5')])throw new Error(_0x9e2c('0xb3'));if(_0xb68be1[_0x9e2c('0xa5')][_0x9e2c('0xa6')]['length'])return _0xb68be1[_0x9e2c('0xa5')][_0x9e2c('0xa6')][0x0];return db['CmContact'][_0x9e2c('0x70')](_[_0x9e2c('0xb4')](_0x336c0f[_0x9e2c('0x68')],{'firstName':_0x336c0f[_0x9e2c('0x68')]['to'],'email':_0x336c0f[_0x9e2c('0x68')]['to'],'phone':_0x336c0f[_0x9e2c('0x68')]['to'],'ListId':_0xb68be1[_0x9e2c('0x7a')]}));})[_0x9e2c('0x25')](function(_0x19d3a8){if(!_0x19d3a8)return;var _0x3d8236={'UserId':_0x336c0f[_0x9e2c('0x38')]['id'],'ContactId':_0x19d3a8['id'],'MailAccountId':_0xb68be1['id'],'inReplyTo':_0x40f2ac['messageId'],'to':_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xaa')],'cc':_0x336c0f[_0x9e2c('0x68')]['cc'],'subject':_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xb5')],'attach':_0x336c0f[_0x9e2c('0x68')][_0x9e2c('0xb6')],'firstMsgDirection':_0x9e2c('0xb7'),'lastMsgAt':moment()[_0x9e2c('0xa1')](_0x9e2c('0xa2')),'lastMsgDirection':_0x9e2c('0xb7'),'Messages':[_[_0x9e2c('0x58')](_0x336c0f[_0x9e2c('0x68')],{'messageId':_0x40f2ac[_0x9e2c('0xb8')],'sentAt':moment()[_0x9e2c('0xa1')](_0x9e2c('0xa2')),'read':!![],'MailAccountId':_0xb68be1['id'],'UserId':_0x336c0f['user']['id'],'ContactId':_0x19d3a8['id']})]};if(_0x336c0f[_0x9e2c('0x68')]['Interaction']){_0x3d8236=_[_0x9e2c('0x58')](_0x3d8236,_0x336c0f['body'][_0x9e2c('0xb9')]);}return db[_0x9e2c('0x8b')][_0x9e2c('0x70')](_0x3d8236,{'include':[{'model':db[_0x9e2c('0x9f')],'as':_0x9e2c('0xba')}]});})[_0x9e2c('0x25')](respondWithResult(_0x325606,null))[_0x9e2c('0x1b')](handleError(_0x325606,null));};exports[_0x9e2c('0xbb')]=function(_0x29cb76,_0x1f1690){return db[_0x9e2c('0x47')][_0x9e2c('0x66')]({'where':{'id':_0x29cb76['params']['id']},'include':[{'model':db[_0x9e2c('0x61')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x9e2c('0xa8'),'raw':!![]}]}]})[_0x9e2c('0x25')](handleEntityNotFound(_0x1f1690,null))[_0x9e2c('0x25')](function(_0x31e86b){if(!_0x31e86b['Smtp'])return;var _0x160c89=_0x31e86b[_0x9e2c('0xb1')]();return respondWithRpcPromise(_0x9e2c('0xbc'),_0x9e2c('0xbb'),{'account':_0x160c89});})[_0x9e2c('0x25')](respondWithResult(_0x1f1690,null))[_0x9e2c('0x1b')](handleError(_0x1f1690,null));};exports[_0x9e2c('0x26')]=function(_0x5142d9,_0x30b5a){return db[_0x9e2c('0x47')][_0x9e2c('0x66')]({'where':{'id':_0x5142d9[_0x9e2c('0x60')]['id']}})['then'](handleEntityNotFound(_0x30b5a,null))[_0x9e2c('0x25')](function(_0x541bad){if(_0x541bad&&_0x541bad['service']){throw new db[(_0x9e2c('0xbd'))]['ValidationError'](_0x9e2c('0xbe'));}return _0x541bad;})[_0x9e2c('0x25')](removeEntity(_0x30b5a,null))[_0x9e2c('0x1b')](handleError(_0x30b5a,null));};exports['addAgents']=function(_0x8b833c,_0x8df98f){return db['MailAccount'][_0x9e2c('0x66')]({'where':{'id':_0x8b833c['params']['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x8df98f,null))[_0x9e2c('0x25')](function(_0x3d54b4){if(_0x3d54b4){return _0x3d54b4[_0x9e2c('0xbf')](_0x8b833c[_0x9e2c('0x68')][_0x9e2c('0x74')],_['omit'](_0x8b833c[_0x9e2c('0x68')],[_0x9e2c('0x74'),'id'])||{})['spread'](function(_0x534756){for(var _0x383269=0x0;_0x383269<_0x8b833c[_0x9e2c('0x68')][_0x9e2c('0x74')]['length'];_0x383269+=0x1){socket[_0x9e2c('0xc0')](_0x9e2c('0xc1'),{'UserId':Number(_0x8b833c['body']['ids'][_0x383269]),'MailAccountId':Number(_0x8b833c[_0x9e2c('0x60')]['id'])});}return _0x534756;});}})[_0x9e2c('0x25')](respondWithResult(_0x8df98f,null))[_0x9e2c('0x1b')](handleError(_0x8df98f,null));};exports[_0x9e2c('0xc2')]=function(_0x352f9d,_0x2cb149){return db[_0x9e2c('0x47')]['find']({'where':{'id':_0x352f9d[_0x9e2c('0x60')]['id']}})['then'](handleEntityNotFound(_0x2cb149,null))[_0x9e2c('0x25')](function(_0x196edb){if(_0x196edb){return _0x196edb[_0x9e2c('0xc2')](_0x352f9d[_0x9e2c('0x4c')][_0x9e2c('0x74')])['then'](function(){if(_[_0x9e2c('0xc3')](_0x352f9d['query']['ids'])){for(var _0x275445=0x0;_0x275445<_0x352f9d[_0x9e2c('0x4c')][_0x9e2c('0x74')]['length'];_0x275445+=0x1){socket['emit'](_0x9e2c('0xc4'),{'UserId':Number(_0x352f9d[_0x9e2c('0x4c')][_0x9e2c('0x74')][_0x275445]),'MailAccountId':Number(_0x352f9d[_0x9e2c('0x60')]['id'])});}}else{socket['emit'](_0x9e2c('0xc4'),{'UserId':Number(_0x352f9d[_0x9e2c('0x4c')]['ids']),'MailAccountId':Number(_0x352f9d[_0x9e2c('0x60')]['id'])});}});}})[_0x9e2c('0x25')](respondWithStatusCode(_0x2cb149,null))[_0x9e2c('0x1b')](handleError(_0x2cb149,null));};exports[_0x9e2c('0xc5')]=function(_0x2bbcaa,_0x334c4e){var _0x30f1e5={};var _0x5d24e6={};var _0x1eae86;var _0x5145cd;return db[_0x9e2c('0x47')][_0x9e2c('0x72')]({'where':{'id':_0x2bbcaa[_0x9e2c('0x60')]['id']}})[_0x9e2c('0x25')](handleEntityNotFound(_0x334c4e,null))['then'](function(_0x115b82){if(_0x115b82){_0x1eae86=_0x115b82;_0x5d24e6[_0x9e2c('0x4b')]=_[_0x9e2c('0x64')](db[_0x9e2c('0x8e')]['rawAttributes']);_0x5d24e6[_0x9e2c('0x4c')]=_[_0x9e2c('0x64')](_0x2bbcaa[_0x9e2c('0x4c')]);_0x5d24e6[_0x9e2c('0x4d')]=_[_0x9e2c('0x4e')](_0x5d24e6[_0x9e2c('0x4b')],_0x5d24e6[_0x9e2c('0x4c')]);_0x30f1e5[_0x9e2c('0x4f')]=_[_0x9e2c('0x4e')](_0x5d24e6[_0x9e2c('0x4b')],qs[_0x9e2c('0x50')](_0x2bbcaa[_0x9e2c('0x4c')]['fields']));_0x30f1e5['attributes']=_0x30f1e5[_0x9e2c('0x4f')][_0x9e2c('0x51')]?_0x30f1e5[_0x9e2c('0x4f')]:_0x5d24e6['model'];_0x30f1e5[_0x9e2c('0x54')]=qs[_0x9e2c('0x55')](_0x2bbcaa['query'][_0x9e2c('0x55')]);_0x30f1e5[_0x9e2c('0x56')]=qs[_0x9e2c('0x4d')](_[_0x9e2c('0x57')](_0x2bbcaa[_0x9e2c('0x4c')],_0x5d24e6[_0x9e2c('0x4d')]));if(_0x2bbcaa[_0x9e2c('0x4c')]['filter']){_0x30f1e5[_0x9e2c('0x56')]=_[_0x9e2c('0x58')](_0x30f1e5[_0x9e2c('0x56')],{'$or':_[_0x9e2c('0x46')](_0x30f1e5[_0x9e2c('0x4f')],function(_0x157ea4){var _0x3ec554={};_0x3ec554[_0x157ea4]={'$like':'%'+_0x2bbcaa[_0x9e2c('0x4c')][_0x9e2c('0x5a')]+'%'};return _0x3ec554;})});}_0x30f1e5=_[_0x9e2c('0x58')]({},_0x30f1e5,_0x2bbcaa[_0x9e2c('0x65')]);return _0x1eae86[_0x9e2c('0xc5')](_0x30f1e5);}})[_0x9e2c('0x25')](function(_0x1cb919){if(_0x1cb919){_0x5145cd=_0x1cb919[_0x9e2c('0x51')];if(!_0x2bbcaa['query'][_0x9e2c('0x52')](_0x9e2c('0x53'))){_0x30f1e5[_0x9e2c('0x22')]=qs['limit'](_0x2bbcaa[_0x9e2c('0x4c')][_0x9e2c('0x22')]);_0x30f1e5['offset']=qs[_0x9e2c('0x20')](_0x2bbcaa[_0x9e2c('0x4c')][_0x9e2c('0x20')]);}return _0x1eae86[_0x9e2c('0xc5')](_0x30f1e5);}})[_0x9e2c('0x25')](function(_0x1aff4b){if(_0x1aff4b){return _0x1aff4b?{'count':_0x5145cd,'rows':_0x1aff4b}:null;}})[_0x9e2c('0x25')](respondWithResult(_0x334c4e,null))[_0x9e2c('0x1b')](handleError(_0x334c4e,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 3e1a65e..edd37bf 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 _0xe451=['exports','MailAccount','remove','emit','hasOwnProperty'];(function(_0x2a8ac3,_0x50dbd2){var _0x2495fa=function(_0x17f3ee){while(--_0x17f3ee){_0x2a8ac3['push'](_0x2a8ac3['shift']());}};_0x2495fa(++_0x50dbd2);}(_0xe451,0xec));var _0x1e45=function(_0x3cb9f4,_0x24f3bc){_0x3cb9f4=_0x3cb9f4-0x0;var _0x17e6dd=_0xe451[_0x3cb9f4];return _0x17e6dd;};'use strict';var EventEmitter=require('events');var MailAccount=require('../../mysqldb')['db'][_0x1e45('0x0')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1e45('0x1')};function emitEvent(_0x363caa){return function(_0x1f9061,_0x197c03,_0x5cc973){MailAccountEvents[_0x1e45('0x2')](_0x363caa+':'+_0x1f9061['id'],_0x1f9061);MailAccountEvents[_0x1e45('0x2')](_0x363caa,_0x1f9061);_0x5cc973(null);};}for(var e in events){if(events[_0x1e45('0x3')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x1e45('0x4')]=MailAccountEvents; \ No newline at end of file +var _0xdbcd=['save','update','remove','hasOwnProperty','events','../../mysqldb'];(function(_0x1a3918,_0x7117a2){var _0x295746=function(_0x4af873){while(--_0x4af873){_0x1a3918['push'](_0x1a3918['shift']());}};_0x295746(++_0x7117a2);}(_0xdbcd,0x1ba));var _0xddbc=function(_0x30aeb5,_0x300c2f){_0x30aeb5=_0x30aeb5-0x0;var _0x3b3e8c=_0xdbcd[_0x30aeb5];return _0x3b3e8c;};'use strict';var EventEmitter=require(_0xddbc('0x0'));var MailAccount=require(_0xddbc('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xddbc('0x2'),'afterUpdate':_0xddbc('0x3'),'afterDestroy':_0xddbc('0x4')};function emitEvent(_0x59c52a){return function(_0x1ce7da,_0x11a04e,_0x4816af){MailAccountEvents['emit'](_0x59c52a+':'+_0x1ce7da['id'],_0x1ce7da);MailAccountEvents['emit'](_0x59c52a,_0x1ce7da);_0x4816af(null);};}for(var e in events){if(events[_0xddbc('0x5')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 7411c03..f4f1bca 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 _0x5f07=['OAuth2','user','CloudProvider','data5','pass','exports','define','MailAccount','mail_accounts','custom','provider','host','Smtp','port','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth'];(function(_0x1290ed,_0x3c5699){var _0x3f13e6=function(_0x233a3e){while(--_0x233a3e){_0x1290ed['push'](_0x1290ed['shift']());}};_0x3f13e6(++_0x3c5699);}(_0x5f07,0x1e0));var _0x75f0=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x5f07[_0xa6cc5c];return _0x44803d;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x75f0('0x0')]=function(_0x54ce64){return _0x54ce64[_0x75f0('0x1')](_0x75f0('0x2'),attributes,{'tableName':_0x75f0('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x371adc=this;var _0x1fcead={'id':_0x371adc['id'],'tls':{'rejectUnauthorized':![]}};if(_0x371adc['provider']!==_0x75f0('0x4')){_0x1fcead['service']=_0x371adc[_0x75f0('0x5')];}else{_0x1fcead[_0x75f0('0x6')]=_0x371adc[_0x75f0('0x7')][_0x75f0('0x6')];_0x1fcead['port']=_0x371adc[_0x75f0('0x7')][_0x75f0('0x8')];_0x1fcead['secure']=_0x371adc[_0x75f0('0x7')][_0x75f0('0x9')];}if(_0x371adc['Smtp'][_0x75f0('0xa')]){if(_0x371adc[_0x75f0('0x7')][_0x75f0('0xb')]){if(!_0x371adc['Smtp']['CloudProvider'])throw new Error(_0x75f0('0xc'));_0x1fcead[_0x75f0('0xd')]={'type':_0x75f0('0xe'),'user':_0x371adc[_0x75f0('0x7')][_0x75f0('0xf')],'accessToken':_0x371adc[_0x75f0('0x7')][_0x75f0('0x10')][_0x75f0('0x11')]};}else{_0x1fcead['auth']={'user':_0x371adc[_0x75f0('0x7')]['user'],'pass':_0x371adc[_0x75f0('0x7')][_0x75f0('0x12')]};}}return _0x1fcead;}}});}; \ No newline at end of file +var _0x9bd5=['custom','host','Smtp','port','secure','authentication','modernAuthentication','CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','user','data5','auth','pass','exports','define','mail_accounts','provider'];(function(_0x4a82e3,_0x5ef734){var _0x666c92=function(_0x51a923){while(--_0x51a923){_0x4a82e3['push'](_0x4a82e3['shift']());}};_0x666c92(++_0x5ef734);}(_0x9bd5,0x1c7));var _0x59bd=function(_0x3fd754,_0xe0122d){_0x3fd754=_0x3fd754-0x0;var _0x348e4c=_0x9bd5[_0x3fd754];return _0x348e4c;};'use strict';var attributes=require('./mailAccount.attributes');module[_0x59bd('0x0')]=function(_0x5aed7e){return _0x5aed7e[_0x59bd('0x1')]('MailAccount',attributes,{'tableName':_0x59bd('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x28afbe=this;var _0x50fb27={'id':_0x28afbe['id'],'tls':{'rejectUnauthorized':![]}};if(_0x28afbe[_0x59bd('0x3')]!==_0x59bd('0x4')){_0x50fb27['service']=_0x28afbe[_0x59bd('0x3')];}else{_0x50fb27[_0x59bd('0x5')]=_0x28afbe[_0x59bd('0x6')][_0x59bd('0x5')];_0x50fb27[_0x59bd('0x7')]=_0x28afbe[_0x59bd('0x6')][_0x59bd('0x7')];_0x50fb27['secure']=_0x28afbe[_0x59bd('0x6')][_0x59bd('0x8')];}if(_0x28afbe[_0x59bd('0x6')][_0x59bd('0x9')]){if(_0x28afbe[_0x59bd('0x6')][_0x59bd('0xa')]){if(!_0x28afbe[_0x59bd('0x6')][_0x59bd('0xb')])throw new Error(_0x59bd('0xc'));_0x50fb27['auth']={'type':'OAuth2','user':_0x28afbe['Smtp'][_0x59bd('0xd')],'accessToken':_0x28afbe[_0x59bd('0x6')][_0x59bd('0xb')][_0x59bd('0xe')]};}else{_0x50fb27[_0x59bd('0xf')]={'user':_0x28afbe[_0x59bd('0x6')]['user'],'pass':_0x28afbe[_0x59bd('0x6')][_0x59bd('0x10')]};}}return _0x50fb27;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 57d3839..c14cb6e 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 _0x2caf=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowMailAccount','find','smtp','smtpOptions','getSmtpOptions','NotifyMailAccount','body','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','MailApplication','Applications','MailServerOut','CloudProvider','get','applications','list','orderBy','asc','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Contact\x20not\x20found','update','format','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','ChatOfflineMessageId','Attachment','UserId','User','agent','name','waitForTheAssignedAgent','queueId','MailQueue','unshift','queue','Start','startRouting'];(function(_0x2493a7,_0x3599fc){var _0x125572=function(_0x464df6){while(--_0x464df6){_0x2493a7['push'](_0x2493a7['shift']());}};_0x125572(++_0x3599fc);}(_0x2caf,0x6a));var _0xf2ca=function(_0x3e1525,_0x5eddb6){_0x3e1525=_0x3e1525-0x0;var _0x11a7ac=_0x2caf[_0x3e1525];return _0x11a7ac;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2ca('0x0'));var Redis=require('ioredis');var db=require(_0xf2ca('0x1'))['db'];var logger=require(_0xf2ca('0x2'))(_0xf2ca('0x3'));var config=require(_0xf2ca('0x4'));var jayson=require(_0xf2ca('0x5'));var client=jayson[_0xf2ca('0x6')][_0xf2ca('0x7')]({'port':0x232c});config['redis']=_[_0xf2ca('0x8')](config[_0xf2ca('0x9')],{'host':_0xf2ca('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf2ca('0xb'))[_0xf2ca('0xc')](socket);function respondWithRpcPromise(_0x1177f0,_0x1cf4a0,_0x1c1afd){return new BPromise(function(_0x5be288,_0x1ecd50){return client[_0xf2ca('0xd')](_0x1177f0,_0x1c1afd)[_0xf2ca('0xe')](function(_0x4063e9){logger[_0xf2ca('0xf')](_0xf2ca('0x10'),_0x1cf4a0,'request\x20sent');logger[_0xf2ca('0x11')](_0xf2ca('0x12'),_0x1cf4a0,'request\x20sent',JSON[_0xf2ca('0x13')](_0x4063e9));if(_0x4063e9[_0xf2ca('0x14')]){if(_0x4063e9['error']['code']===0x1f4){logger[_0xf2ca('0x14')]('MailAccount,\x20%s,\x20%s',_0x1cf4a0,_0x4063e9[_0xf2ca('0x14')][_0xf2ca('0x15')]);return _0x1ecd50(_0x4063e9[_0xf2ca('0x14')][_0xf2ca('0x15')]);}logger[_0xf2ca('0x14')](_0xf2ca('0x10'),_0x1cf4a0,_0x4063e9[_0xf2ca('0x14')]['message']);return _0x5be288(_0x4063e9[_0xf2ca('0x14')]['message']);}else{logger[_0xf2ca('0xf')]('MailAccount,\x20%s,\x20%s',_0x1cf4a0,_0xf2ca('0x16'));_0x5be288(_0x4063e9[_0xf2ca('0x17')]['message']);}})[_0xf2ca('0x18')](function(_0x160230){logger[_0xf2ca('0x14')](_0xf2ca('0x10'),_0x1cf4a0,_0x160230);_0x1ecd50(_0x160230);});});}exports[_0xf2ca('0x19')]=function(_0x1ca233){var _0x17eafa=this;return new Promise(function(_0x1548a4,_0x1718e6){return db[_0xf2ca('0x1a')][_0xf2ca('0x1b')]({'raw':_0x1ca233['options']?_0x1ca233[_0xf2ca('0x1c')][_0xf2ca('0x1d')]===undefined?!![]:![]:!![],'where':_0x1ca233[_0xf2ca('0x1c')]?_0x1ca233[_0xf2ca('0x1c')][_0xf2ca('0x1e')]||null:null,'attributes':_0x1ca233[_0xf2ca('0x1c')]?_0x1ca233[_0xf2ca('0x1c')][_0xf2ca('0x1f')]||null:null,'limit':_0x1ca233['options']?_0x1ca233[_0xf2ca('0x1c')][_0xf2ca('0x20')]||null:null,'include':_0x1ca233['options']?_0x1ca233[_0xf2ca('0x1c')][_0xf2ca('0x21')]?_[_0xf2ca('0x22')](_0x1ca233['options']['include'],function(_0xbfcb0b){return{'model':db[_0xbfcb0b[_0xf2ca('0x23')]],'as':_0xbfcb0b['as'],'attributes':_0xbfcb0b[_0xf2ca('0x1f')],'include':_0xbfcb0b[_0xf2ca('0x21')]?_[_0xf2ca('0x22')](_0xbfcb0b[_0xf2ca('0x21')],function(_0x339e10){return{'model':db[_0x339e10[_0xf2ca('0x23')]],'as':_0x339e10['as'],'attributes':_0x339e10['attributes'],'include':_0x339e10[_0xf2ca('0x21')]?_[_0xf2ca('0x22')](_0x339e10[_0xf2ca('0x21')],function(_0x1b36e0){return{'model':db[_0x1b36e0[_0xf2ca('0x23')]],'as':_0x1b36e0['as'],'attributes':_0x1b36e0[_0xf2ca('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf2ca('0xe')](function(_0xb0ae21){logger[_0xf2ca('0xf')](_0xf2ca('0x19'),_0x1ca233);logger[_0xf2ca('0x11')](_0xf2ca('0x19'),_0x1ca233,JSON[_0xf2ca('0x13')](_0xb0ae21));_0x1548a4(_0xb0ae21);})[_0xf2ca('0x18')](function(_0x2b0649){logger[_0xf2ca('0x14')](_0xf2ca('0x19'),_0x2b0649[_0xf2ca('0x15')],_0x1ca233);_0x1718e6(_0x17eafa[_0xf2ca('0x14')](0x1f4,_0x2b0649['message']));});});};exports[_0xf2ca('0x24')]=function(_0x1e817f){var _0x1c5310=this;return new Promise(function(_0x25066b,_0xb75964){return db[_0xf2ca('0x1a')][_0xf2ca('0x25')]({'raw':_0x1e817f[_0xf2ca('0x1c')]?_0x1e817f[_0xf2ca('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x1e817f[_0xf2ca('0x1c')]?_0x1e817f[_0xf2ca('0x1c')][_0xf2ca('0x1e')]||null:null,'attributes':_0x1e817f['options']?_0x1e817f[_0xf2ca('0x1c')]['attributes']||null:null,'include':_0x1e817f[_0xf2ca('0x1c')]?_0x1e817f[_0xf2ca('0x1c')][_0xf2ca('0x21')]?_[_0xf2ca('0x22')](_0x1e817f[_0xf2ca('0x1c')]['include'],function(_0x521b94){return{'model':db[_0x521b94[_0xf2ca('0x23')]],'as':_0x521b94['as'],'attributes':_0x521b94['attributes'],'include':_0x521b94[_0xf2ca('0x21')]?_[_0xf2ca('0x22')](_0x521b94[_0xf2ca('0x21')],function(_0x3152eb){return{'model':db[_0x3152eb[_0xf2ca('0x23')]],'as':_0x3152eb['as'],'attributes':_0x3152eb[_0xf2ca('0x1f')],'include':_0x3152eb[_0xf2ca('0x21')]?_[_0xf2ca('0x22')](_0x3152eb[_0xf2ca('0x21')],function(_0x1ad216){return{'model':db[_0x1ad216[_0xf2ca('0x23')]],'as':_0x1ad216['as'],'attributes':_0x1ad216[_0xf2ca('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf2ca('0xe')](function(_0x3c8d63){if(_0x1e817f[_0xf2ca('0x1c')][_0xf2ca('0x26')]===!![])_0x3c8d63['setDataValue'](_0xf2ca('0x27'),_0x3c8d63[_0xf2ca('0x28')]());logger[_0xf2ca('0xf')](_0xf2ca('0x24'),_0x1e817f);logger['debug'](_0xf2ca('0x24'),_0x1e817f,JSON['stringify'](_0x3c8d63));_0x25066b(_0x3c8d63);})[_0xf2ca('0x18')](function(_0x33680b){logger[_0xf2ca('0x14')](_0xf2ca('0x24'),_0x33680b[_0xf2ca('0x15')],_0x1e817f);_0xb75964(_0x1c5310['error'](0x1f4,_0x33680b[_0xf2ca('0x15')]));});});};exports[_0xf2ca('0x29')]=function(_0x4f39de){var _0x36740d=this;return new Promise(function(_0x29ebce,_0x3f014f){var _0x5396ef={'body':_0x4f39de[_0xf2ca('0x2a')],'channel':'mail'};var _0x128419=_[_0xf2ca('0x2b')](_[_0xf2ca('0x2c')](db[_0xf2ca('0x2d')][_0xf2ca('0x2e')]),[_0xf2ca('0x2f'),_0xf2ca('0x30'),_0xf2ca('0x31'),_0xf2ca('0x32')]);var _0x128535=![];if(_0x4f39de[_0xf2ca('0x2a')]['id']){delete _0x4f39de[_0xf2ca('0x2a')]['id'];}if(_[_0xf2ca('0x33')](_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x34')])){return _0x3f014f(_0x36740d['error'](0x1f4,_0xf2ca('0x35')));}if(_[_0xf2ca('0x33')](_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x2a')])||_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x2a')]===''){return _0x3f014f(_0x36740d[_0xf2ca('0x14')](0x1f4,_0xf2ca('0x36')));}if(_[_0xf2ca('0x33')](_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x37')])){return _0x3f014f(_0x36740d[_0xf2ca('0x14')](0x1f4,_0xf2ca('0x38')+_0x128419));}if(!_['includes'](_0x128419,_0x4f39de['body'][_0xf2ca('0x37')])){return _0x3f014f(_0x36740d[_0xf2ca('0x14')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x128419));}var _0x102c3c={};_0x102c3c[_0x4f39de['body'][_0xf2ca('0x37')]]=_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x34')];return db['MailAccount'][_0xf2ca('0x25')]({'where':{'id':_0x4f39de[_0xf2ca('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xf2ca('0x3a'),'include':[{'model':db[_0xf2ca('0x2d')],'as':_0xf2ca('0x3b'),'where':_0x102c3c,'limit':0x1,'order':[[_0xf2ca('0x30'),'DESC']]}]},{'model':db[_0xf2ca('0x3c')],'as':_0xf2ca('0x3d')},{'model':db[_0xf2ca('0x3e')],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0xf2ca('0x3f')}]}]})[_0xf2ca('0xe')](function(_0x1a65c6){if(_0x1a65c6&&_0x1a65c6[_0xf2ca('0x3a')]){var _0x3f31de=_0x1a65c6[_0xf2ca('0x40')]({'plain':!![]});_0x5396ef['account']=_['omit'](_0x3f31de,[_0xf2ca('0x3d'),_0xf2ca('0x3a')]);_0x5396ef['account'][_0xf2ca('0x27')]=_0x1a65c6['getSmtpOptions']();_0x5396ef[_0xf2ca('0x41')]=_0x3f31de['Applications'];_0x5396ef[_0xf2ca('0x42')]=_0x3f31de['List'];_0x5396ef['applications']=_[_0xf2ca('0x43')](_0x5396ef[_0xf2ca('0x41')],['priority'],[_0xf2ca('0x44')]);if(_0x5396ef[_0xf2ca('0x39')]&&_0x5396ef[_0xf2ca('0x39')][_0xf2ca('0x45')]){_0x5396ef[_0xf2ca('0x41')][_0xf2ca('0x46')]({'id':0x0,'priority':_0x5396ef['applications'][_0xf2ca('0x47')]+0x1,'app':_0xf2ca('0x48'),'appdata':'autoclose','interval':_0xf2ca('0x49')});}if(_0x5396ef[_0xf2ca('0x39')][_0xf2ca('0x3d')]){delete _0x5396ef[_0xf2ca('0x39')][_0xf2ca('0x3d')];}if(_0x5396ef['account']['List']){delete _0x5396ef['account'][_0xf2ca('0x3a')];}if(_0x3f31de[_0xf2ca('0x3a')][_0xf2ca('0x3b')][_0xf2ca('0x47')]){return _0x3f31de['List'][_0xf2ca('0x3b')][0x0];}var _0x4683fe=_[_0xf2ca('0x8')](_0x4f39de[_0xf2ca('0x2a')],{'firstName':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x34')],'ListId':_0x3f31de[_0xf2ca('0x32')]});_0x4683fe[_0x4f39de['body'][_0xf2ca('0x37')]]=_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x34')];return db['CmContact'][_0xf2ca('0x4a')](_0x4683fe);}else{throw new Error(_0xf2ca('0x4b'));}})['then'](function(_0x3d71e2){_0x5396ef[_0xf2ca('0x4c')]=_0x3d71e2;if(_0x3d71e2){if(!_0x4f39de[_0xf2ca('0x2a')]['message'][_0xf2ca('0x4d')]){_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x4d')]=rs['generate']()+'\x20'+_0x4f39de['body'][_0xf2ca('0x15')][_0xf2ca('0x34')];}var _0x1fba4d={'ContactId':_0x3d71e2['id'],'MailAccountId':_0x4f39de[_0xf2ca('0x39')]['id'],'inReplyTo':_0x4f39de['body'][_0xf2ca('0x15')]['messageId'],'to':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x34')],'cc':_0x4f39de[_0xf2ca('0x2a')]['message']['cc'],'subject':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x4e')],'attach':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x4f')],'lastMsgAt':moment()['format'](_0xf2ca('0x50')),'lastMsgDirection':'in'};return db[_0xf2ca('0x51')][_0xf2ca('0x25')]({'where':{'closed':![],'MailAccountId':_0x4f39de[_0xf2ca('0x39')]['id']},'include':[{'model':db[_0xf2ca('0x52')],'as':'Messages','attributes':[_0xf2ca('0x4d')],'where':{'messageId':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')]['inReplyTo']}}]})[_0xf2ca('0xe')](function(_0x152f0c){if(_0x152f0c){return[_0x152f0c,![]];}return db[_0xf2ca('0x51')][_0xf2ca('0x4a')](_0x1fba4d)[_0xf2ca('0xe')](function(_0x219854){return[_0x219854,!![]];});});}else{throw new Error(_0xf2ca('0x53'));}})['spread'](function(_0x5b1554,_0x4baca3){if(_0x5b1554){_0x128535=_0x4baca3;if(!_0x4baca3){return _0x5b1554[_0xf2ca('0x54')]({'inReplyTo':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x4d')],'to':_0x4f39de[_0xf2ca('0x2a')]['message']['from'],'cc':_0x4f39de[_0xf2ca('0x2a')]['message']['cc'],'subject':_0x4f39de[_0xf2ca('0x2a')]['message']['subject'],'attach':_0x5b1554['attach']?_0x5b1554[_0xf2ca('0x4f')]:_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x4f')],'substatus':null,'substatusAt':moment()[_0xf2ca('0x55')](_0xf2ca('0x50')),'lastMsgAt':moment()[_0xf2ca('0x55')](_0xf2ca('0x50')),'lastMsgDirection':'in'});}else{return _0x5b1554;}}})['then'](function(_0x1be4cb){_0x5396ef[_0xf2ca('0x56')]=_0x1be4cb[_0xf2ca('0x40')]({'plain':!![]});_0x5396ef[_0xf2ca('0x56')]['created']=_0x128535;return db[_0xf2ca('0x52')][_0xf2ca('0x4a')]({'body':_0x4f39de['body'][_0xf2ca('0x2a')],'MailAccountId':_0x4f39de['account']['id'],'MailInteractionId':_0x1be4cb['id'],'direction':'in','ContactId':_0x5396ef[_0xf2ca('0x4c')]['id'],'messageId':_0x4f39de['body'][_0xf2ca('0x15')][_0xf2ca('0x4d')],'from':_0x4f39de[_0xf2ca('0x2a')]['message'][_0xf2ca('0x34')],'to':_0x4f39de['body']['message']['to'],'cc':_0x4f39de['body'][_0xf2ca('0x15')]['cc'],'subject':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x4e')],'attach':_0x4f39de['body'][_0xf2ca('0x15')][_0xf2ca('0x4f')],'Attachments':_0x4f39de['body'][_0xf2ca('0x15')][_0xf2ca('0x57')],'originTo':_0x4f39de['body'][_0xf2ca('0x15')][_0xf2ca('0x58')],'originCc':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x59')],'bcc':_0x4f39de[_0xf2ca('0x2a')]['message'][_0xf2ca('0x5a')],'ChatWebsiteId':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x5b')]||null,'originChannel':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x5c')]||'Email','ChatOfflineMessageId':_0x4f39de[_0xf2ca('0x2a')][_0xf2ca('0x15')][_0xf2ca('0x5d')]||null},{'include':[{'model':db[_0xf2ca('0x5e')],'as':'Attachments'}]});})['then'](function(_0x30d500){_0x5396ef['message']=_0x30d500;if(!_0x5396ef['interaction'][_0xf2ca('0x5f')]){return;}return db[_0xf2ca('0x60')][_0xf2ca('0x25')]({'attributes':['id','name'],'where':{'id':_0x5396ef[_0xf2ca('0x56')][_0xf2ca('0x5f')]}});})[_0xf2ca('0xe')](function(_0x294d6f){if(_0x294d6f){_0x5396ef[_0xf2ca('0x41')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf2ca('0x61'),'appdata':_0x294d6f[_0xf2ca('0x62')]+','+(_0x5396ef['account'][_0xf2ca('0x63')]||0xa),'interval':_0xf2ca('0x49')});}if(!_0x5396ef[_0xf2ca('0x56')][_0xf2ca('0x64')]){return;}return db[_0xf2ca('0x65')][_0xf2ca('0x25')]({'attributes':['id',_0xf2ca('0x62')],'where':{'id':_0x5396ef[_0xf2ca('0x56')][_0xf2ca('0x64')]}});})['then'](function(_0x4453ba){if(_0x4453ba){_0x5396ef[_0xf2ca('0x41')][_0xf2ca('0x66')]({'id':0x0,'priority':0x1,'app':_0xf2ca('0x67'),'appdata':_0x4453ba[_0xf2ca('0x62')]+','+(_0x5396ef[_0xf2ca('0x39')]['waitForTheAssignedQueue']||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf2ca('0x68'),_0xf2ca('0x69'),_0x5396ef);})[_0xf2ca('0xe')](function(_0xda8883){_0x29ebce(_0xda8883);})[_0xf2ca('0x18')](function(_0x6c8186){_0x3f014f(_0x36740d[_0xf2ca('0x14')](0x1f4,_0x6c8186[_0xf2ca('0x15')]));});});}; \ No newline at end of file +var _0xae24=['NotifyMailAccount','difference','keys','CmContact','createdAt','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','Contacts','MailApplication','Applications','MailServerOut','Smtp','CloudProvider','List','omit','applications','list','orderBy','asc','push','length','close','autoclose','*,*,*,*','List\x20not\x20found','contact','messageId','generate','subject','format','MailInteraction','MailMessage','Messages','create','Contact\x20not\x20found','spread','update','attach','YYYY-MM-DD\x20HH:mm:ss','get','attachments','originTo','bcc','ChatWebsiteId','originChannel','Email','Attachment','Attachments','interaction','UserId','name','agent','waitForTheAssignedAgent','MailQueue','queueId','unshift','queue','waitForTheAssignedQueue','Start','startRouting','lodash','bluebird','ioredis','../../mysqldb','../../config/environment','client','http','redis','defaults','localhost','./mailAccount.socket','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','MailAccount','findAll','options','attributes','include','map','model','GetMailAccount','ShowMailAccount','find','raw','where','setDataValue','smtpOptions','getSmtpOptions'];(function(_0x46b81c,_0x1e984d){var _0x968725=function(_0xdf8671){while(--_0xdf8671){_0x46b81c['push'](_0x46b81c['shift']());}};_0x968725(++_0x1e984d);}(_0xae24,0x182));var _0x4ae2=function(_0x2689f2,_0x3b5ac8){_0x2689f2=_0x2689f2-0x0;var _0x18c3ce=_0xae24[_0x2689f2];return _0x18c3ce;};'use strict';var _=require(_0x4ae2('0x0'));var moment=require('moment');var BPromise=require(_0x4ae2('0x1'));var rs=require('randomstring');var Redis=require(_0x4ae2('0x2'));var db=require(_0x4ae2('0x3'))['db'];var logger=require('../../config/logger')('rpc');var config=require(_0x4ae2('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x4ae2('0x5')][_0x4ae2('0x6')]({'port':0x232c});config[_0x4ae2('0x7')]=_[_0x4ae2('0x8')](config[_0x4ae2('0x7')],{'host':_0x4ae2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x4ae2('0xa'))['register'](socket);function respondWithRpcPromise(_0x564ef9,_0xb5587a,_0xb01e8e){return new BPromise(function(_0x5c32b7,_0x3b3acc){return client[_0x4ae2('0xb')](_0x564ef9,_0xb01e8e)[_0x4ae2('0xc')](function(_0xb70265){logger['info'](_0x4ae2('0xd'),_0xb5587a,_0x4ae2('0xe'));logger[_0x4ae2('0xf')]('MailAccount,\x20%s,\x20%s,\x20%s',_0xb5587a,_0x4ae2('0xe'),JSON[_0x4ae2('0x10')](_0xb70265));if(_0xb70265[_0x4ae2('0x11')]){if(_0xb70265[_0x4ae2('0x11')][_0x4ae2('0x12')]===0x1f4){logger[_0x4ae2('0x11')](_0x4ae2('0xd'),_0xb5587a,_0xb70265[_0x4ae2('0x11')][_0x4ae2('0x13')]);return _0x3b3acc(_0xb70265['error']['message']);}logger['error'](_0x4ae2('0xd'),_0xb5587a,_0xb70265[_0x4ae2('0x11')]['message']);return _0x5c32b7(_0xb70265[_0x4ae2('0x11')][_0x4ae2('0x13')]);}else{logger[_0x4ae2('0x14')](_0x4ae2('0xd'),_0xb5587a,_0x4ae2('0xe'));_0x5c32b7(_0xb70265[_0x4ae2('0x15')][_0x4ae2('0x13')]);}})[_0x4ae2('0x16')](function(_0x41b672){logger[_0x4ae2('0x11')]('MailAccount,\x20%s,\x20%s',_0xb5587a,_0x41b672);_0x3b3acc(_0x41b672);});});}exports['GetMailAccount']=function(_0x44a2d3){var _0x2d910c=this;return new Promise(function(_0x51e20c,_0x45c1bf){return db[_0x4ae2('0x17')][_0x4ae2('0x18')]({'raw':_0x44a2d3[_0x4ae2('0x19')]?_0x44a2d3[_0x4ae2('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44a2d3[_0x4ae2('0x19')]?_0x44a2d3['options']['where']||null:null,'attributes':_0x44a2d3[_0x4ae2('0x19')]?_0x44a2d3[_0x4ae2('0x19')][_0x4ae2('0x1a')]||null:null,'limit':_0x44a2d3[_0x4ae2('0x19')]?_0x44a2d3[_0x4ae2('0x19')]['limit']||null:null,'include':_0x44a2d3[_0x4ae2('0x19')]?_0x44a2d3['options'][_0x4ae2('0x1b')]?_[_0x4ae2('0x1c')](_0x44a2d3[_0x4ae2('0x19')]['include'],function(_0x43f112){return{'model':db[_0x43f112[_0x4ae2('0x1d')]],'as':_0x43f112['as'],'attributes':_0x43f112[_0x4ae2('0x1a')],'include':_0x43f112[_0x4ae2('0x1b')]?_[_0x4ae2('0x1c')](_0x43f112[_0x4ae2('0x1b')],function(_0x5b2e65){return{'model':db[_0x5b2e65['model']],'as':_0x5b2e65['as'],'attributes':_0x5b2e65[_0x4ae2('0x1a')],'include':_0x5b2e65[_0x4ae2('0x1b')]?_[_0x4ae2('0x1c')](_0x5b2e65[_0x4ae2('0x1b')],function(_0x3a9b96){return{'model':db[_0x3a9b96[_0x4ae2('0x1d')]],'as':_0x3a9b96['as'],'attributes':_0x3a9b96['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e2666){logger['info']('GetMailAccount',_0x44a2d3);logger['debug'](_0x4ae2('0x1e'),_0x44a2d3,JSON[_0x4ae2('0x10')](_0x3e2666));_0x51e20c(_0x3e2666);})['catch'](function(_0x883fd5){logger[_0x4ae2('0x11')](_0x4ae2('0x1e'),_0x883fd5[_0x4ae2('0x13')],_0x44a2d3);_0x45c1bf(_0x2d910c[_0x4ae2('0x11')](0x1f4,_0x883fd5[_0x4ae2('0x13')]));});});};exports[_0x4ae2('0x1f')]=function(_0x269603){var _0x2904f1=this;return new Promise(function(_0x3542df,_0x386687){return db[_0x4ae2('0x17')][_0x4ae2('0x20')]({'raw':_0x269603[_0x4ae2('0x19')]?_0x269603[_0x4ae2('0x19')][_0x4ae2('0x21')]===undefined?!![]:![]:!![],'where':_0x269603[_0x4ae2('0x19')]?_0x269603['options'][_0x4ae2('0x22')]||null:null,'attributes':_0x269603['options']?_0x269603[_0x4ae2('0x19')][_0x4ae2('0x1a')]||null:null,'include':_0x269603['options']?_0x269603[_0x4ae2('0x19')][_0x4ae2('0x1b')]?_[_0x4ae2('0x1c')](_0x269603[_0x4ae2('0x19')]['include'],function(_0x349c84){return{'model':db[_0x349c84[_0x4ae2('0x1d')]],'as':_0x349c84['as'],'attributes':_0x349c84[_0x4ae2('0x1a')],'include':_0x349c84[_0x4ae2('0x1b')]?_[_0x4ae2('0x1c')](_0x349c84[_0x4ae2('0x1b')],function(_0x32e3ec){return{'model':db[_0x32e3ec[_0x4ae2('0x1d')]],'as':_0x32e3ec['as'],'attributes':_0x32e3ec[_0x4ae2('0x1a')],'include':_0x32e3ec['include']?_[_0x4ae2('0x1c')](_0x32e3ec['include'],function(_0xe34b4c){return{'model':db[_0xe34b4c[_0x4ae2('0x1d')]],'as':_0xe34b4c['as'],'attributes':_0xe34b4c[_0x4ae2('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x4ae2('0xc')](function(_0x771c14){if(_0x269603[_0x4ae2('0x19')]['smtp']===!![])_0x771c14[_0x4ae2('0x23')](_0x4ae2('0x24'),_0x771c14[_0x4ae2('0x25')]());logger[_0x4ae2('0x14')]('ShowMailAccount',_0x269603);logger[_0x4ae2('0xf')](_0x4ae2('0x1f'),_0x269603,JSON[_0x4ae2('0x10')](_0x771c14));_0x3542df(_0x771c14);})[_0x4ae2('0x16')](function(_0x232243){logger[_0x4ae2('0x11')](_0x4ae2('0x1f'),_0x232243[_0x4ae2('0x13')],_0x269603);_0x386687(_0x2904f1[_0x4ae2('0x11')](0x1f4,_0x232243[_0x4ae2('0x13')]));});});};exports[_0x4ae2('0x26')]=function(_0x57801a){var _0x2c3676=this;return new Promise(function(_0x3f0b3f,_0x23f120){var _0x1473e6={'body':_0x57801a['body'],'channel':'mail'};var _0xd46eed=_[_0x4ae2('0x27')](_[_0x4ae2('0x28')](db[_0x4ae2('0x29')]['rawAttributes']),[_0x4ae2('0x2a'),_0x4ae2('0x2b'),'CompanyId',_0x4ae2('0x2c')]);var _0x2a85eb=![];if(_0x57801a[_0x4ae2('0x2d')]['id']){delete _0x57801a['body']['id'];}if(_[_0x4ae2('0x2e')](_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x2f')])){return _0x23f120(_0x2c3676[_0x4ae2('0x11')](0x1f4,_0x4ae2('0x30')));}if(_[_0x4ae2('0x2e')](_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x2d')])||_0x57801a['body'][_0x4ae2('0x2d')]===''){return _0x23f120(_0x2c3676[_0x4ae2('0x11')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x4ae2('0x2e')](_0x57801a[_0x4ae2('0x2d')]['mapKey'])){return _0x23f120(_0x2c3676[_0x4ae2('0x11')](0x1f4,_0x4ae2('0x31')+_0xd46eed));}if(!_['includes'](_0xd46eed,_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x32')])){return _0x23f120(_0x2c3676[_0x4ae2('0x11')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xd46eed));}var _0x4fc82f={};_0x4fc82f[_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x32')]]=_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x2f')];return db['MailAccount'][_0x4ae2('0x20')]({'where':{'id':_0x57801a[_0x4ae2('0x33')]['id']},'include':[{'model':db[_0x4ae2('0x34')],'as':'List','include':[{'model':db[_0x4ae2('0x29')],'as':_0x4ae2('0x35'),'where':_0x4fc82f,'limit':0x1,'order':[[_0x4ae2('0x2b'),'DESC']]}]},{'model':db[_0x4ae2('0x36')],'as':_0x4ae2('0x37')},{'model':db[_0x4ae2('0x38')],'as':_0x4ae2('0x39'),'include':[{'model':db[_0x4ae2('0x3a')],'as':_0x4ae2('0x3a')}]}]})[_0x4ae2('0xc')](function(_0x2fe532){if(_0x2fe532&&_0x2fe532[_0x4ae2('0x3b')]){var _0xf6d12a=_0x2fe532['get']({'plain':!![]});_0x1473e6[_0x4ae2('0x33')]=_[_0x4ae2('0x3c')](_0xf6d12a,[_0x4ae2('0x37'),_0x4ae2('0x3b')]);_0x1473e6[_0x4ae2('0x33')][_0x4ae2('0x24')]=_0x2fe532[_0x4ae2('0x25')]();_0x1473e6[_0x4ae2('0x3d')]=_0xf6d12a['Applications'];_0x1473e6[_0x4ae2('0x3e')]=_0xf6d12a[_0x4ae2('0x3b')];_0x1473e6['applications']=_[_0x4ae2('0x3f')](_0x1473e6[_0x4ae2('0x3d')],['priority'],[_0x4ae2('0x40')]);if(_0x1473e6['account']&&_0x1473e6[_0x4ae2('0x33')]['autoclose']){_0x1473e6[_0x4ae2('0x3d')][_0x4ae2('0x41')]({'id':0x0,'priority':_0x1473e6[_0x4ae2('0x3d')][_0x4ae2('0x42')]+0x1,'app':_0x4ae2('0x43'),'appdata':_0x4ae2('0x44'),'interval':_0x4ae2('0x45')});}if(_0x1473e6[_0x4ae2('0x33')][_0x4ae2('0x37')]){delete _0x1473e6['account'][_0x4ae2('0x37')];}if(_0x1473e6[_0x4ae2('0x33')][_0x4ae2('0x3b')]){delete _0x1473e6[_0x4ae2('0x33')]['List'];}if(_0xf6d12a[_0x4ae2('0x3b')][_0x4ae2('0x35')][_0x4ae2('0x42')]){return _0xf6d12a['List']['Contacts'][0x0];}var _0x70ece4=_[_0x4ae2('0x8')](_0x57801a[_0x4ae2('0x2d')],{'firstName':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x2f')],'ListId':_0xf6d12a[_0x4ae2('0x2c')]});_0x70ece4[_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x32')]]=_0x57801a[_0x4ae2('0x2d')]['from'];return db[_0x4ae2('0x29')]['create'](_0x70ece4);}else{throw new Error(_0x4ae2('0x46'));}})[_0x4ae2('0xc')](function(_0x28e7a8){_0x1473e6[_0x4ae2('0x47')]=_0x28e7a8;if(_0x28e7a8){if(!_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')][_0x4ae2('0x48')]){_0x57801a[_0x4ae2('0x2d')]['message']['messageId']=rs[_0x4ae2('0x49')]()+'\x20'+_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')]['from'];}var _0x5872ca={'ContactId':_0x28e7a8['id'],'MailAccountId':_0x57801a[_0x4ae2('0x33')]['id'],'inReplyTo':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')][_0x4ae2('0x48')],'to':_0x57801a[_0x4ae2('0x2d')]['message']['from'],'cc':_0x57801a['body'][_0x4ae2('0x13')]['cc'],'subject':_0x57801a['body']['message'][_0x4ae2('0x4a')],'attach':_0x57801a['body'][_0x4ae2('0x13')]['attach'],'lastMsgAt':moment()[_0x4ae2('0x4b')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db[_0x4ae2('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0x57801a[_0x4ae2('0x33')]['id']},'include':[{'model':db[_0x4ae2('0x4d')],'as':_0x4ae2('0x4e'),'attributes':[_0x4ae2('0x48')],'where':{'messageId':_0x57801a[_0x4ae2('0x2d')]['message']['inReplyTo']}}]})[_0x4ae2('0xc')](function(_0x256d2f){if(_0x256d2f){return[_0x256d2f,![]];}return db['MailInteraction'][_0x4ae2('0x4f')](_0x5872ca)[_0x4ae2('0xc')](function(_0x517800){return[_0x517800,!![]];});});}else{throw new Error(_0x4ae2('0x50'));}})[_0x4ae2('0x51')](function(_0x49c58c,_0x56b88d){if(_0x49c58c){_0x2a85eb=_0x56b88d;if(!_0x56b88d){return _0x49c58c[_0x4ae2('0x52')]({'inReplyTo':_0x57801a[_0x4ae2('0x2d')]['message'][_0x4ae2('0x48')],'to':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')][_0x4ae2('0x2f')],'cc':_0x57801a['body'][_0x4ae2('0x13')]['cc'],'subject':_0x57801a[_0x4ae2('0x2d')]['message'][_0x4ae2('0x4a')],'attach':_0x49c58c[_0x4ae2('0x53')]?_0x49c58c[_0x4ae2('0x53')]:_0x57801a['body']['message'][_0x4ae2('0x53')],'substatus':null,'substatusAt':moment()['format'](_0x4ae2('0x54')),'lastMsgAt':moment()['format'](_0x4ae2('0x54')),'lastMsgDirection':'in'});}else{return _0x49c58c;}}})['then'](function(_0x2758c0){_0x1473e6['interaction']=_0x2758c0[_0x4ae2('0x55')]({'plain':!![]});_0x1473e6['interaction']['created']=_0x2a85eb;return db[_0x4ae2('0x4d')][_0x4ae2('0x4f')]({'body':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x2d')],'MailAccountId':_0x57801a[_0x4ae2('0x33')]['id'],'MailInteractionId':_0x2758c0['id'],'direction':'in','ContactId':_0x1473e6[_0x4ae2('0x47')]['id'],'messageId':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')][_0x4ae2('0x48')],'from':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')][_0x4ae2('0x2f')],'to':_0x57801a['body'][_0x4ae2('0x13')]['to'],'cc':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')]['cc'],'subject':_0x57801a[_0x4ae2('0x2d')]['message'][_0x4ae2('0x4a')],'attach':_0x57801a['body'][_0x4ae2('0x13')][_0x4ae2('0x53')],'Attachments':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')][_0x4ae2('0x56')],'originTo':_0x57801a[_0x4ae2('0x2d')]['message'][_0x4ae2('0x57')],'originCc':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')]['originCc'],'bcc':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')][_0x4ae2('0x58')],'ChatWebsiteId':_0x57801a['body'][_0x4ae2('0x13')][_0x4ae2('0x59')]||null,'originChannel':_0x57801a[_0x4ae2('0x2d')]['message'][_0x4ae2('0x5a')]||_0x4ae2('0x5b'),'ChatOfflineMessageId':_0x57801a[_0x4ae2('0x2d')][_0x4ae2('0x13')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x4ae2('0x5c')],'as':_0x4ae2('0x5d')}]});})[_0x4ae2('0xc')](function(_0x98272b){_0x1473e6[_0x4ae2('0x13')]=_0x98272b;if(!_0x1473e6[_0x4ae2('0x5e')][_0x4ae2('0x5f')]){return;}return db['User']['find']({'attributes':['id',_0x4ae2('0x60')],'where':{'id':_0x1473e6[_0x4ae2('0x5e')][_0x4ae2('0x5f')]}});})[_0x4ae2('0xc')](function(_0x222e62){if(_0x222e62){_0x1473e6[_0x4ae2('0x3d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x4ae2('0x61'),'appdata':_0x222e62[_0x4ae2('0x60')]+','+(_0x1473e6[_0x4ae2('0x33')][_0x4ae2('0x62')]||0xa),'interval':_0x4ae2('0x45')});}if(!_0x1473e6[_0x4ae2('0x5e')]['queueId']){return;}return db[_0x4ae2('0x63')][_0x4ae2('0x20')]({'attributes':['id',_0x4ae2('0x60')],'where':{'id':_0x1473e6[_0x4ae2('0x5e')][_0x4ae2('0x64')]}});})[_0x4ae2('0xc')](function(_0x5efbe9){if(_0x5efbe9){_0x1473e6['applications'][_0x4ae2('0x65')]({'id':0x0,'priority':0x1,'app':_0x4ae2('0x66'),'appdata':_0x5efbe9['name']+','+(_0x1473e6[_0x4ae2('0x33')][_0x4ae2('0x67')]||0x12c),'interval':_0x4ae2('0x45')});}return respondWithRpcPromise(_0x4ae2('0x68'),_0x4ae2('0x69'),_0x1473e6);})[_0x4ae2('0xc')](function(_0xc4748b){_0x3f0b3f(_0xc4748b);})['catch'](function(_0xde9c0b){_0x23f120(_0x2c3676[_0x4ae2('0x11')](0x1f4,_0xde9c0b[_0x4ae2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 5552ebd..4c203f0 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 _0xf4c9=['./mailAccount.events','save','remove','emit','removeListener','mailAccount:'];(function(_0x4227f7,_0x5e2633){var _0x4d394e=function(_0x1d7676){while(--_0x1d7676){_0x4227f7['push'](_0x4227f7['shift']());}};_0x4d394e(++_0x5e2633);}(_0xf4c9,0x1aa));var _0x9f4c=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xf4c9[_0x5f3f88];return _0xd08119;};'use strict';var MailAccountEvents=require(_0x9f4c('0x0'));var events=[_0x9f4c('0x1'),_0x9f4c('0x2'),'update'];function createListener(_0x244bf8,_0x4f495b){return function(_0x80560e){_0x4f495b[_0x9f4c('0x3')](_0x244bf8,_0x80560e);};}function removeListener(_0xc227b9,_0x54ad85){return function(){MailAccountEvents[_0x9f4c('0x4')](_0xc227b9,_0x54ad85);};}exports['register']=function(_0x42cd40){for(var _0x48dc53=0x0,_0x5cf322=events['length'];_0x48dc53<_0x5cf322;_0x48dc53++){var _0x12aeb7=events[_0x48dc53];var _0x398b30=createListener(_0x9f4c('0x5')+_0x12aeb7,_0x42cd40);MailAccountEvents['on'](_0x12aeb7,_0x398b30);}}; \ No newline at end of file +var _0xc911=['register','length','mailAccount:','./mailAccount.events','removeListener'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0xc911,0x1c0));var _0x1c91=function(_0x3acc1b,_0x59da12){_0x3acc1b=_0x3acc1b-0x0;var _0x5e9885=_0xc911[_0x3acc1b];return _0x5e9885;};'use strict';var MailAccountEvents=require(_0x1c91('0x0'));var events=['save','remove','update'];function createListener(_0x236efb,_0x3b4503){return function(_0xd3425){_0x3b4503['emit'](_0x236efb,_0xd3425);};}function removeListener(_0x1cad53,_0x2fe3af){return function(){MailAccountEvents[_0x1c91('0x1')](_0x1cad53,_0x2fe3af);};}exports[_0x1c91('0x2')]=function(_0x5261cc){for(var _0x14d26f=0x0,_0x4e82da=events[_0x1c91('0x3')];_0x14d26f<_0x4e82da;_0x14d26f++){var _0x38a86e=events[_0x14d26f];var _0x436080=createListener(_0x1c91('0x4')+_0x38a86e,_0x5261cc);MailAccountEvents['on'](_0x38a86e,_0x436080);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index daa10aa..f0bc776 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 _0x4443=['update','/:id','isAuthenticated','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','show','put'];(function(_0xc8b522,_0x52ed45){var _0x2de89e=function(_0x10fd02){while(--_0x10fd02){_0xc8b522['push'](_0xc8b522['shift']());}};_0x2de89e(++_0x52ed45);}(_0x4443,0x145));var _0x3444=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4443[_0x46698a];return _0x356db0;};'use strict';var multer=require('multer');var util=require(_0x3444('0x0'));var path=require(_0x3444('0x1'));var timeout=require(_0x3444('0x2'));var express=require(_0x3444('0x3'));var router=express[_0x3444('0x4')]();var fs_extra=require(_0x3444('0x5'));var auth=require(_0x3444('0x6'));var interaction=require(_0x3444('0x7'));var config=require('../../config/environment');var controller=require(_0x3444('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x3444('0x9')]);router[_0x3444('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x3444('0xb')]);router['delete'](_0x3444('0xc'),auth[_0x3444('0xd')](),controller[_0x3444('0xe')]);module[_0x3444('0xf')]=router; \ No newline at end of file +var _0xcd7b=['update','delete','/:id','isAuthenticated','exports','multer','util','path','express','fs-extra','../../components/auth/service','get','show'];(function(_0x2d4fee,_0xc38b94){var _0x265b33=function(_0x315350){while(--_0x315350){_0x2d4fee['push'](_0x2d4fee['shift']());}};_0x265b33(++_0xc38b94);}(_0xcd7b,0x1bf));var _0xbcd7=function(_0x4b6129,_0x46e37a){_0x4b6129=_0x4b6129-0x0;var _0x1f1d28=_0xcd7b[_0x4b6129];return _0x1f1d28;};'use strict';var multer=require(_0xbcd7('0x0'));var util=require(_0xbcd7('0x1'));var path=require(_0xbcd7('0x2'));var timeout=require('connect-timeout');var express=require(_0xbcd7('0x3'));var router=express['Router']();var fs_extra=require(_0xbcd7('0x4'));var auth=require(_0xbcd7('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailApplication.controller');router[_0xbcd7('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xbcd7('0x7')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xbcd7('0x8')]);router[_0xbcd7('0x9')](_0xbcd7('0xa'),auth[_0xbcd7('0xb')](),controller['destroy']);module[_0xbcd7('0xc')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6d8fcf1..b4a8f05 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 _0x14d1=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x239d2a,_0x3b739c){var _0x44de0d=function(_0x5b2dac){while(--_0x5b2dac){_0x239d2a['push'](_0x239d2a['shift']());}};_0x44de0d(++_0x3b739c);}(_0x14d1,0x17b));var _0x114d=function(_0xc6282a,_0x2f1096){_0xc6282a=_0xc6282a-0x0;var _0x138e7f=_0x14d1[_0xc6282a];return _0x138e7f;};'use strict';var Sequelize=require(_0x114d('0x0'));module[_0x114d('0x1')]={'priority':{'type':Sequelize[_0x114d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x114d('0x3')],'allowNull':![],'defaultValue':_0x114d('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x114d('0x3')]},'interval':{'type':Sequelize[_0x114d('0x3')],'defaultValue':_0x114d('0x5')}}; \ No newline at end of file +var _0x866a=['exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x866a,0x156));var _0xa866=function(_0x333fed,_0x3d2122){_0x333fed=_0x333fed-0x0;var _0x12cac2=_0x866a[_0x333fed];return _0x12cac2;};'use strict';var Sequelize=require('sequelize');module[_0xa866('0x0')]={'priority':{'type':Sequelize[_0xa866('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa866('0x2')],'allowNull':![],'defaultValue':_0xa866('0x3')},'appdata':{'type':Sequelize[_0xa866('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xa866('0x2')],'defaultValue':_0xa866('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a35908e..88b032c 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 _0x54ef=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','show','params','model','rawAttributes','query','keys','filters','intersection','attributes','fields','length','merge','options','MailApplication','find','body','catch','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'];(function(_0x47ad8d,_0x5d8a17){var _0x1364b2=function(_0x44f113){while(--_0x44f113){_0x47ad8d['push'](_0x47ad8d['shift']());}};_0x1364b2(++_0x5d8a17);}(_0x54ef,0x112));var _0xf54e=function(_0x405139,_0x5889bd){_0x405139=_0x405139-0x0;var _0x1dcfde=_0x54ef[_0x405139];return _0x1dcfde;};'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'];function respondWithStatusCode(_0x4b0ee1,_0x4bd828){_0x4bd828=_0x4bd828||0xcc;return function(_0x15a9d4){if(_0x15a9d4){return _0x4b0ee1[_0xf54e('0x19')](_0x4bd828);}return _0x4b0ee1[_0xf54e('0x1a')](_0x4bd828)[_0xf54e('0x1b')]();};}function respondWithResult(_0x5644aa,_0x331732){_0x331732=_0x331732||0xc8;return function(_0x1bbeaa){if(_0x1bbeaa){return _0x5644aa[_0xf54e('0x1a')](_0x331732)[_0xf54e('0x1c')](_0x1bbeaa);}};}function respondWithFilteredResult(_0x56828e,_0x2366ee){return function(_0x389abc){if(_0x389abc){var _0x3eb415=typeof _0x2366ee['offset']==='undefined'&&typeof _0x2366ee[_0xf54e('0x1d')]===_0xf54e('0x1e');var _0x1c02e7=_0x389abc[_0xf54e('0x1f')];var _0x15cc48=_0x3eb415?0x0:_0x2366ee[_0xf54e('0x20')];var _0x2e27b6=_0x3eb415?_0x389abc[_0xf54e('0x1f')]:_0x2366ee[_0xf54e('0x20')]+_0x2366ee[_0xf54e('0x1d')];var _0x226c96;if(_0x2e27b6>=_0x1c02e7){_0x2e27b6=_0x1c02e7;_0x226c96=0xc8;}else{_0x226c96=0xce;}_0x56828e['status'](_0x226c96);return _0x56828e['set'](_0xf54e('0x21'),_0x15cc48+'-'+_0x2e27b6+'/'+_0x1c02e7)['json'](_0x389abc);}return null;};}function patchUpdates(_0x3e1556){return function(_0x1bfe99){try{jsonpatch[_0xf54e('0x22')](_0x1bfe99,_0x3e1556,!![]);}catch(_0x9903fc){return BPromise[_0xf54e('0x23')](_0x9903fc);}return _0x1bfe99[_0xf54e('0x24')]();};}function saveUpdates(_0x388aa0,_0x11985e){return function(_0x3c0169){if(_0x3c0169){return _0x3c0169[_0xf54e('0x25')](_0x388aa0)[_0xf54e('0x26')](function(_0x5b83df){return _0x5b83df;});}return null;};}function removeEntity(_0x6f6d29,_0x54f914){return function(_0x264a8f){if(_0x264a8f){return _0x264a8f[_0xf54e('0x27')]()[_0xf54e('0x26')](function(){_0x6f6d29[_0xf54e('0x1a')](0xcc)[_0xf54e('0x1b')]();});}};}function handleEntityNotFound(_0x160160,_0x1e08d1){return function(_0x43488d){if(!_0x43488d){_0x160160[_0xf54e('0x19')](0x194);}return _0x43488d;};}function handleError(_0x33457f,_0xf6cdd7){_0xf6cdd7=_0xf6cdd7||0x1f4;return function(_0x39c0ae){logger[_0xf54e('0x28')](_0x39c0ae['stack']);if(_0x39c0ae[_0xf54e('0x29')]){delete _0x39c0ae['name'];}_0x33457f[_0xf54e('0x1a')](_0xf6cdd7)['send'](_0x39c0ae);};}exports[_0xf54e('0x2a')]=function(_0x269f47,_0x21ba00){var _0xa13cd0={'raw':!![],'where':{'id':_0x269f47[_0xf54e('0x2b')]['id']}},_0x25b643={};_0x25b643[_0xf54e('0x2c')]=_['keys'](db['MailApplication'][_0xf54e('0x2d')]);_0x25b643[_0xf54e('0x2e')]=_[_0xf54e('0x2f')](_0x269f47[_0xf54e('0x2e')]);_0x25b643[_0xf54e('0x30')]=_[_0xf54e('0x31')](_0x25b643[_0xf54e('0x2c')],_0x25b643[_0xf54e('0x2e')]);_0xa13cd0[_0xf54e('0x32')]=_[_0xf54e('0x31')](_0x25b643['model'],qs['fields'](_0x269f47[_0xf54e('0x2e')][_0xf54e('0x33')]));_0xa13cd0['attributes']=_0xa13cd0[_0xf54e('0x32')][_0xf54e('0x34')]?_0xa13cd0[_0xf54e('0x32')]:_0x25b643[_0xf54e('0x2c')];if(_0x269f47['query']['includeAll']){_0xa13cd0['include']=[{'all':!![]}];}_0xa13cd0=_[_0xf54e('0x35')]({},_0xa13cd0,_0x269f47[_0xf54e('0x36')]);return db[_0xf54e('0x37')][_0xf54e('0x38')](_0xa13cd0)[_0xf54e('0x26')](handleEntityNotFound(_0x21ba00,null))[_0xf54e('0x26')](respondWithResult(_0x21ba00,null))['catch'](handleError(_0x21ba00,null));};exports['update']=function(_0x530cee,_0xc04e04){if(_0x530cee[_0xf54e('0x39')]['id']){delete _0x530cee['body']['id'];}return db['MailApplication'][_0xf54e('0x38')]({'where':{'id':_0x530cee[_0xf54e('0x2b')]['id']}})[_0xf54e('0x26')](handleEntityNotFound(_0xc04e04,null))['then'](saveUpdates(_0x530cee[_0xf54e('0x39')],null))[_0xf54e('0x26')](respondWithResult(_0xc04e04,null))['catch'](handleError(_0xc04e04,null));};exports[_0xf54e('0x27')]=function(_0x6e5bdf,_0x5af03){return db[_0xf54e('0x37')][_0xf54e('0x38')]({'where':{'id':_0x6e5bdf[_0xf54e('0x2b')]['id']}})['then'](handleEntityNotFound(_0x5af03,null))['then'](removeEntity(_0x5af03,null))[_0xf54e('0x3a')](handleError(_0x5af03,null));}; \ No newline at end of file +var _0x0713=['catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','MailApplication','rawAttributes','query','keys','filters','intersection','model','fields','attributes','length','includeAll','include','merge','options','find','body'];(function(_0x189c70,_0xd1c0bd){var _0x553b4e=function(_0x4def4d){while(--_0x4def4d){_0x189c70['push'](_0x189c70['shift']());}};_0x553b4e(++_0xd1c0bd);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3071('0x0'));var jsonpatch=require(_0x3071('0x1'));var rp=require(_0x3071('0x2'));var moment=require(_0x3071('0x3'));var BPromise=require(_0x3071('0x4'));var Mustache=require('mustache');var util=require(_0x3071('0x5'));var path=require(_0x3071('0x6'));var sox=require(_0x3071('0x7'));var csv=require(_0x3071('0x8'));var ejs=require(_0x3071('0x9'));var fs=require('fs');var fs_extra=require(_0x3071('0xa'));var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x8'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var licenseUtil=require(_0x3071('0x19'));var db=require(_0x3071('0x1a'))['db'];function respondWithStatusCode(_0x4a8cc7,_0x5330a8){_0x5330a8=_0x5330a8||0xcc;return function(_0x1826ca){if(_0x1826ca){return _0x4a8cc7['sendStatus'](_0x5330a8);}return _0x4a8cc7[_0x3071('0x1b')](_0x5330a8)[_0x3071('0x1c')]();};}function respondWithResult(_0x5d4883,_0x104e73){_0x104e73=_0x104e73||0xc8;return function(_0x4e1219){if(_0x4e1219){return _0x5d4883[_0x3071('0x1b')](_0x104e73)[_0x3071('0x1d')](_0x4e1219);}};}function respondWithFilteredResult(_0x1271d0,_0x1f14e1){return function(_0x1caa5d){if(_0x1caa5d){var _0x2a6a4b=typeof _0x1f14e1[_0x3071('0x1e')]===_0x3071('0x1f')&&typeof _0x1f14e1[_0x3071('0x20')]===_0x3071('0x1f');var _0x5f3c22=_0x1caa5d[_0x3071('0x21')];var _0x17dbda=_0x2a6a4b?0x0:_0x1f14e1[_0x3071('0x1e')];var _0x108a83=_0x2a6a4b?_0x1caa5d[_0x3071('0x21')]:_0x1f14e1[_0x3071('0x1e')]+_0x1f14e1[_0x3071('0x20')];var _0x26f113;if(_0x108a83>=_0x5f3c22){_0x108a83=_0x5f3c22;_0x26f113=0xc8;}else{_0x26f113=0xce;}_0x1271d0['status'](_0x26f113);return _0x1271d0[_0x3071('0x22')](_0x3071('0x23'),_0x17dbda+'-'+_0x108a83+'/'+_0x5f3c22)[_0x3071('0x1d')](_0x1caa5d);}return null;};}function patchUpdates(_0x56c267){return function(_0xb8f4e3){try{jsonpatch['apply'](_0xb8f4e3,_0x56c267,!![]);}catch(_0x833074){return BPromise[_0x3071('0x24')](_0x833074);}return _0xb8f4e3[_0x3071('0x25')]();};}function saveUpdates(_0x457b57,_0x33090c){return function(_0x34c50e){if(_0x34c50e){return _0x34c50e[_0x3071('0x26')](_0x457b57)[_0x3071('0x27')](function(_0x542646){return _0x542646;});}return null;};}function removeEntity(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(_0xb05b1d){return _0xb05b1d[_0x3071('0x28')]()[_0x3071('0x27')](function(){_0x481a51[_0x3071('0x1b')](0xcc)[_0x3071('0x1c')]();});}};}function handleEntityNotFound(_0x7a4cb4,_0x1fe727){return function(_0x1de5fb){if(!_0x1de5fb){_0x7a4cb4['sendStatus'](0x194);}return _0x1de5fb;};}function handleError(_0x2e5f93,_0x3f1e6e){_0x3f1e6e=_0x3f1e6e||0x1f4;return function(_0x177138){logger['error'](_0x177138[_0x3071('0x29')]);if(_0x177138[_0x3071('0x2a')]){delete _0x177138[_0x3071('0x2a')];}_0x2e5f93[_0x3071('0x1b')](_0x3f1e6e)[_0x3071('0x2b')](_0x177138);};}exports[_0x3071('0x2c')]=function(_0x177b5f,_0x3921a1){var _0x32f1b4={'raw':!![],'where':{'id':_0x177b5f[_0x3071('0x2d')]['id']}},_0x292205={};_0x292205['model']=_['keys'](db[_0x3071('0x2e')][_0x3071('0x2f')]);_0x292205[_0x3071('0x30')]=_[_0x3071('0x31')](_0x177b5f[_0x3071('0x30')]);_0x292205[_0x3071('0x32')]=_[_0x3071('0x33')](_0x292205[_0x3071('0x34')],_0x292205['query']);_0x32f1b4['attributes']=_['intersection'](_0x292205[_0x3071('0x34')],qs[_0x3071('0x35')](_0x177b5f['query'][_0x3071('0x35')]));_0x32f1b4[_0x3071('0x36')]=_0x32f1b4[_0x3071('0x36')][_0x3071('0x37')]?_0x32f1b4['attributes']:_0x292205[_0x3071('0x34')];if(_0x177b5f[_0x3071('0x30')][_0x3071('0x38')]){_0x32f1b4[_0x3071('0x39')]=[{'all':!![]}];}_0x32f1b4=_[_0x3071('0x3a')]({},_0x32f1b4,_0x177b5f[_0x3071('0x3b')]);return db[_0x3071('0x2e')][_0x3071('0x3c')](_0x32f1b4)['then'](handleEntityNotFound(_0x3921a1,null))[_0x3071('0x27')](respondWithResult(_0x3921a1,null))['catch'](handleError(_0x3921a1,null));};exports['update']=function(_0x1a1a64,_0xa3a7ae){if(_0x1a1a64['body']['id']){delete _0x1a1a64[_0x3071('0x3d')]['id'];}return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x1a1a64[_0x3071('0x2d')]['id']}})[_0x3071('0x27')](handleEntityNotFound(_0xa3a7ae,null))[_0x3071('0x27')](saveUpdates(_0x1a1a64['body'],null))[_0x3071('0x27')](respondWithResult(_0xa3a7ae,null))[_0x3071('0x3e')](handleError(_0xa3a7ae,null));};exports['destroy']=function(_0x44ad05,_0x5b1392){return db[_0x3071('0x2e')][_0x3071('0x3c')]({'where':{'id':_0x44ad05['params']['id']}})['then'](handleEntityNotFound(_0x5b1392,null))[_0x3071('0x27')](removeEntity(_0x5b1392,null))[_0x3071('0x3e')](handleError(_0x5b1392,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 96bb620..ba07dd3 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 _0xc391=['utf8mb4','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications'];(function(_0x2cb6c0,_0x59cd4d){var _0x34bc5=function(_0x29f87e){while(--_0x29f87e){_0x2cb6c0['push'](_0x2cb6c0['shift']());}};_0x34bc5(++_0x59cd4d);}(_0xc391,0xb7));var _0x1c39=function(_0x290337,_0x4f021b){_0x290337=_0x290337-0x0;var _0x5e336e=_0xc391[_0x290337];return _0x5e336e;};'use strict';var _=require(_0x1c39('0x0'));var util=require(_0x1c39('0x1'));var logger=require(_0x1c39('0x2'))(_0x1c39('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1c39('0x4'));var fs=require('fs');var path=require(_0x1c39('0x5'));var rimraf=require(_0x1c39('0x6'));var config=require(_0x1c39('0x7'));var attributes=require(_0x1c39('0x8'));module[_0x1c39('0x9')]=function(_0x103535,_0x24f1de){return _0x103535[_0x1c39('0xa')](_0x1c39('0xb'),attributes,{'tableName':_0x1c39('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1c39('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1e3a=['api','moment','request-promise','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','../../config/logger'];(function(_0x2bb79f,_0x538a00){var _0x1526a7=function(_0x3b710e){while(--_0x3b710e){_0x2bb79f['push'](_0x2bb79f['shift']());}};_0x1526a7(++_0x538a00);}(_0x1e3a,0x83));var _0xa1e3=function(_0x438912,_0x3f7f74){_0x438912=_0x438912-0x0;var _0x18112f=_0x1e3a[_0x438912];return _0x18112f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa1e3('0x0'))(_0xa1e3('0x1'));var moment=require(_0xa1e3('0x2'));var BPromise=require('bluebird');var rp=require(_0xa1e3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa1e3('0x4'));module[_0xa1e3('0x5')]=function(_0x3cc721,_0x1717de){return _0x3cc721[_0xa1e3('0x6')](_0xa1e3('0x7'),attributes,{'tableName':_0xa1e3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa1e3('0x9'),'collate':_0xa1e3('0xa')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 7b4d229..92511ae 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 _0xa5ea=['../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','MailApplication,\x20%s,\x20%s','message','info','catch','MailApplication','update','body','options','raw','where','attributes','limit','UpdateMailApplication','debug','moment','bluebird','randomstring','../../mysqldb'];(function(_0x89c256,_0x5481ad){var _0x3512e8=function(_0x4ac437){while(--_0x4ac437){_0x89c256['push'](_0x89c256['shift']());}};_0x3512e8(++_0x5481ad);}(_0xa5ea,0x1e9));var _0xaa5e=function(_0x5a8b4c,_0xfe7517){_0x5a8b4c=_0x5a8b4c-0x0;var _0xdbeaf3=_0xa5ea[_0x5a8b4c];return _0xdbeaf3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaa5e('0x0'));var BPromise=require(_0xaa5e('0x1'));var rs=require(_0xaa5e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaa5e('0x3'))['db'];var utils=require(_0xaa5e('0x4'));var logger=require(_0xaa5e('0x5'))(_0xaa5e('0x6'));var config=require(_0xaa5e('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xaa5e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x465809,_0x2305fd,_0xeb267f){return new BPromise(function(_0x1cf2ee,_0x1d8c19){return client[_0xaa5e('0x9')](_0x465809,_0xeb267f)[_0xaa5e('0xa')](function(_0x1cc285){logger['info']('MailApplication,\x20%s,\x20%s',_0x2305fd,_0xaa5e('0xb'));logger['debug'](_0xaa5e('0xc'),_0x2305fd,_0xaa5e('0xb'),JSON[_0xaa5e('0xd')](_0x1cc285));if(_0x1cc285[_0xaa5e('0xe')]){if(_0x1cc285['error']['code']===0x1f4){logger[_0xaa5e('0xe')](_0xaa5e('0xf'),_0x2305fd,_0x1cc285[_0xaa5e('0xe')][_0xaa5e('0x10')]);return _0x1d8c19(_0x1cc285[_0xaa5e('0xe')][_0xaa5e('0x10')]);}logger['error'](_0xaa5e('0xf'),_0x2305fd,_0x1cc285[_0xaa5e('0xe')][_0xaa5e('0x10')]);return _0x1cf2ee(_0x1cc285[_0xaa5e('0xe')][_0xaa5e('0x10')]);}else{logger[_0xaa5e('0x11')](_0xaa5e('0xf'),_0x2305fd,_0xaa5e('0xb'));_0x1cf2ee(_0x1cc285['result'][_0xaa5e('0x10')]);}})[_0xaa5e('0x12')](function(_0x5a1792){logger[_0xaa5e('0xe')](_0xaa5e('0xf'),_0x2305fd,_0x5a1792);_0x1d8c19(_0x5a1792);});});}exports['UpdateMailApplication']=function(_0x28e87c){var _0x9ee627=this;return new Promise(function(_0x3203f1,_0x3fa3eb){return db[_0xaa5e('0x13')][_0xaa5e('0x14')](_0x28e87c[_0xaa5e('0x15')],{'raw':_0x28e87c[_0xaa5e('0x16')]?_0x28e87c['options'][_0xaa5e('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28e87c['options']?_0x28e87c[_0xaa5e('0x16')][_0xaa5e('0x18')]||null:null,'attributes':_0x28e87c[_0xaa5e('0x16')]?_0x28e87c[_0xaa5e('0x16')][_0xaa5e('0x19')]||null:null,'limit':_0x28e87c[_0xaa5e('0x16')]?_0x28e87c[_0xaa5e('0x16')][_0xaa5e('0x1a')]||null:null})[_0xaa5e('0xa')](function(_0x5a1007){logger[_0xaa5e('0x11')](_0xaa5e('0x1b'),_0x28e87c);logger[_0xaa5e('0x1c')](_0xaa5e('0x1b'),_0x28e87c,JSON[_0xaa5e('0xd')](_0x5a1007));_0x3203f1(_0x5a1007);})[_0xaa5e('0x12')](function(_0x51b30c){logger['error'](_0xaa5e('0x1b'),_0x51b30c[_0xaa5e('0x10')],_0x28e87c);_0x3fa3eb(_0x9ee627[_0xaa5e('0xe')](0x1f4,_0x51b30c[_0xaa5e('0x10')]));});});}; \ No newline at end of file +var _0xc513=['UpdateMailApplication','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','MailApplication','update','options','raw','where','attributes','then'];(function(_0x15c51a,_0x15941f){var _0x304bf6=function(_0x359447){while(--_0x359447){_0x15c51a['push'](_0x15c51a['shift']());}};_0x304bf6(++_0x15941f);}(_0xc513,0x8e));var _0x3c51=function(_0x313ba0,_0xcbdd6f){_0x313ba0=_0x313ba0-0x0;var _0x591d00=_0xc513[_0x313ba0];return _0x591d00;};'use strict';var _=require(_0x3c51('0x0'));var util=require(_0x3c51('0x1'));var moment=require(_0x3c51('0x2'));var BPromise=require('bluebird');var rs=require(_0x3c51('0x3'));var fs=require('fs');var Redis=require(_0x3c51('0x4'));var db=require(_0x3c51('0x5'))['db'];var utils=require(_0x3c51('0x6'));var logger=require(_0x3c51('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3c51('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fc346,_0x20d5f6,_0x2611a6){return new BPromise(function(_0x4769d0,_0x52adef){return client['request'](_0x3fc346,_0x2611a6)['then'](function(_0xe5a1dc){logger[_0x3c51('0x9')](_0x3c51('0xa'),_0x20d5f6,_0x3c51('0xb'));logger[_0x3c51('0xc')](_0x3c51('0xd'),_0x20d5f6,_0x3c51('0xb'),JSON[_0x3c51('0xe')](_0xe5a1dc));if(_0xe5a1dc[_0x3c51('0xf')]){if(_0xe5a1dc[_0x3c51('0xf')][_0x3c51('0x10')]===0x1f4){logger['error']('MailApplication,\x20%s,\x20%s',_0x20d5f6,_0xe5a1dc[_0x3c51('0xf')][_0x3c51('0x11')]);return _0x52adef(_0xe5a1dc[_0x3c51('0xf')][_0x3c51('0x11')]);}logger[_0x3c51('0xf')]('MailApplication,\x20%s,\x20%s',_0x20d5f6,_0xe5a1dc[_0x3c51('0xf')][_0x3c51('0x11')]);return _0x4769d0(_0xe5a1dc[_0x3c51('0xf')][_0x3c51('0x11')]);}else{logger[_0x3c51('0x9')](_0x3c51('0xa'),_0x20d5f6,_0x3c51('0xb'));_0x4769d0(_0xe5a1dc[_0x3c51('0x12')][_0x3c51('0x11')]);}})['catch'](function(_0x1dec29){logger[_0x3c51('0xf')]('MailApplication,\x20%s,\x20%s',_0x20d5f6,_0x1dec29);_0x52adef(_0x1dec29);});});}exports['UpdateMailApplication']=function(_0x2378af){var _0x1a7d92=this;return new Promise(function(_0x32b43c,_0x89a948){return db[_0x3c51('0x13')][_0x3c51('0x14')](_0x2378af['body'],{'raw':_0x2378af['options']?_0x2378af[_0x3c51('0x15')][_0x3c51('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2378af[_0x3c51('0x15')]?_0x2378af[_0x3c51('0x15')][_0x3c51('0x17')]||null:null,'attributes':_0x2378af[_0x3c51('0x15')]?_0x2378af[_0x3c51('0x15')][_0x3c51('0x18')]||null:null,'limit':_0x2378af[_0x3c51('0x15')]?_0x2378af[_0x3c51('0x15')]['limit']||null:null})[_0x3c51('0x19')](function(_0xbe7d6e){logger[_0x3c51('0x9')](_0x3c51('0x1a'),_0x2378af);logger[_0x3c51('0xc')](_0x3c51('0x1a'),_0x2378af,JSON[_0x3c51('0xe')](_0xbe7d6e));_0x32b43c(_0xbe7d6e);})[_0x3c51('0x1b')](function(_0x34ca66){logger[_0x3c51('0xf')]('UpdateMailApplication',_0x34ca66[_0x3c51('0x11')],_0x2378af);_0x89a948(_0x1a7d92[_0x3c51('0xf')](0x1f4,_0x34ca66[_0x3c51('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 60b03ba..f60a8cc 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 _0xe4c5=['addTags','mailinteraction:update','update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','/describe','describe','get','/:id','/:id/messages','/:id/download','post','create','addMessage','tracked','mail','mailinteraction:addtags'];(function(_0x398005,_0x150dad){var _0x316b61=function(_0x43e58c){while(--_0x43e58c){_0x398005['push'](_0x398005['shift']());}};_0x316b61(++_0x150dad);}(_0xe4c5,0xbe));var _0x5e4c=function(_0x4ac2f8,_0x4d7f07){_0x4ac2f8=_0x4ac2f8-0x0;var _0x1f67e7=_0xe4c5[_0x4ac2f8];return _0x1f67e7;};'use strict';var express=require('express');var router=express[_0x5e4c('0x0')]();var auth=require(_0x5e4c('0x1'));var interaction=require(_0x5e4c('0x2'));var controller=require(_0x5e4c('0x3'));router['get']('/',auth[_0x5e4c('0x4')](),controller[_0x5e4c('0x5')]);router['get'](_0x5e4c('0x6'),auth[_0x5e4c('0x4')](),controller[_0x5e4c('0x7')]);router[_0x5e4c('0x8')](_0x5e4c('0x9'),auth[_0x5e4c('0x4')](),controller['show']);router[_0x5e4c('0x8')](_0x5e4c('0xa'),auth[_0x5e4c('0x4')](),controller['getMessages']);router[_0x5e4c('0x8')](_0x5e4c('0xb'),auth['isAuthenticated'](),controller['download']);router[_0x5e4c('0xc')]('/',auth[_0x5e4c('0x4')](),controller[_0x5e4c('0xd')]);router[_0x5e4c('0xc')](_0x5e4c('0xa'),auth[_0x5e4c('0x4')](),controller[_0x5e4c('0xe')]);router[_0x5e4c('0xc')]('/:id/tags',auth[_0x5e4c('0x4')](),interaction[_0x5e4c('0xf')](_0x5e4c('0x10'),_0x5e4c('0x11')),controller[_0x5e4c('0x12')]);router['put'](_0x5e4c('0x9'),auth[_0x5e4c('0x4')](),interaction['tracked'](_0x5e4c('0x10'),_0x5e4c('0x13')),controller[_0x5e4c('0x14')]);router[_0x5e4c('0x15')](_0x5e4c('0x9'),auth[_0x5e4c('0x4')](),interaction[_0x5e4c('0xf')]('mail',_0x5e4c('0x16')),controller[_0x5e4c('0x17')]);router[_0x5e4c('0x15')](_0x5e4c('0x18'),auth[_0x5e4c('0x4')](),controller[_0x5e4c('0x19')]);module['exports']=router; \ No newline at end of file +var _0x2390=['create','post','/:id/messages','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','delete','destroy','removeTags','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/download'];(function(_0x5669c7,_0x387508){var _0x1c09d9=function(_0x424e96){while(--_0x424e96){_0x5669c7['push'](_0x5669c7['shift']());}};_0x1c09d9(++_0x387508);}(_0x2390,0x146));var _0x0239=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x2390[_0x376b45];return _0x2341b3;};'use strict';var express=require(_0x0239('0x0'));var router=express['Router']();var auth=require(_0x0239('0x1'));var interaction=require(_0x0239('0x2'));var controller=require(_0x0239('0x3'));router[_0x0239('0x4')]('/',auth[_0x0239('0x5')](),controller['index']);router['get'](_0x0239('0x6'),auth[_0x0239('0x5')](),controller[_0x0239('0x7')]);router[_0x0239('0x4')](_0x0239('0x8'),auth[_0x0239('0x5')](),controller['show']);router[_0x0239('0x4')]('/:id/messages',auth[_0x0239('0x5')](),controller['getMessages']);router[_0x0239('0x4')](_0x0239('0x9'),auth[_0x0239('0x5')](),controller['download']);router['post']('/',auth[_0x0239('0x5')](),controller[_0x0239('0xa')]);router[_0x0239('0xb')](_0x0239('0xc'),auth[_0x0239('0x5')](),controller[_0x0239('0xd')]);router[_0x0239('0xb')](_0x0239('0xe'),auth['isAuthenticated'](),interaction[_0x0239('0xf')](_0x0239('0x10'),_0x0239('0x11')),controller[_0x0239('0x12')]);router[_0x0239('0x13')](_0x0239('0x8'),auth[_0x0239('0x5')](),interaction[_0x0239('0xf')](_0x0239('0x10'),'mailinteraction:update'),controller[_0x0239('0x14')]);router[_0x0239('0x15')]('/:id',auth[_0x0239('0x5')](),interaction['tracked'](_0x0239('0x10'),'mailinteraction:destroy'),controller[_0x0239('0x16')]);router[_0x0239('0x15')](_0x0239('0xe'),auth[_0x0239('0x5')](),controller[_0x0239('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index f9a414c..ea18ecb 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 _0xcc0b=['long','ENUM','out','DATE','INTEGER','sequelize','iconv','exports','BOOLEAN','STRING','TEXT'];(function(_0x29ab1b,_0x441b44){var _0xe92b9=function(_0x17f386){while(--_0x17f386){_0x29ab1b['push'](_0x29ab1b['shift']());}};_0xe92b9(++_0x441b44);}(_0xcc0b,0x1d3));var _0xbcc0=function(_0x5515a7,_0x2c4af1){_0x5515a7=_0x5515a7-0x0;var _0x43f4bf=_0xcc0b[_0x5515a7];return _0x43f4bf;};'use strict';var Sequelize=require(_0xbcc0('0x0'));var iconv=require(_0xbcc0('0x1'));module[_0xbcc0('0x2')]={'closed':{'type':Sequelize[_0xbcc0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xbcc0('0x4')]},'thirdDisposition':{'type':Sequelize[_0xbcc0('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xbcc0('0x4')](0x1fe)},'to':{'type':Sequelize[_0xbcc0('0x4')]},'cc':{'type':Sequelize[_0xbcc0('0x5')](_0xbcc0('0x6'))},'subject':{'type':Sequelize[_0xbcc0('0x5')]()},'attach':{'type':Sequelize[_0xbcc0('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xbcc0('0x7')]('in',_0xbcc0('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbcc0('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xbcc0('0x7')]('in',_0xbcc0('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbcc0('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbcc0('0xa')]}}; \ No newline at end of file +var _0xc536=['STRING','TEXT','long','ENUM','out','INTEGER','sequelize','iconv','exports','BOOLEAN','DATE'];(function(_0x102da0,_0x539e28){var _0x41361c=function(_0x460e1d){while(--_0x460e1d){_0x102da0['push'](_0x102da0['shift']());}};_0x41361c(++_0x539e28);}(_0xc536,0x1b3));var _0x6c53=function(_0x19d4c4,_0x2bb4e0){_0x19d4c4=_0x19d4c4-0x0;var _0x43d651=_0xc536[_0x19d4c4];return _0x43d651;};'use strict';var Sequelize=require(_0x6c53('0x0'));var iconv=require(_0x6c53('0x1'));module[_0x6c53('0x2')]={'closed':{'type':Sequelize[_0x6c53('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6c53('0x4')]},'disposition':{'type':Sequelize[_0x6c53('0x5')]},'secondDisposition':{'type':Sequelize[_0x6c53('0x5')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x6c53('0x5')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x6c53('0x6')](_0x6c53('0x7'))},'subject':{'type':Sequelize[_0x6c53('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x6c53('0x4')]},'substatus':{'type':Sequelize[_0x6c53('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x6c53('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x6c53('0x8')]('in',_0x6c53('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x6c53('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x6c53('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize[_0x6c53('0xa')]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 2c4ba03..521a93d 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 _0xdf67=['bcc','createdAt','Messages','get','mkdirSync','each','missing.recipient@your.company.com','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','basename','existsSync','readFileSync','writeFileSync','rimraf','zip-dir','moment','bluebird','lodash','juice','ioredis','../../components/interaction/service','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','findAll','mail','query','user','catch','show','params','MailInteraction','filters','model','intersection','fields','length','attributes','includeAll','include','merge','find','create','body','MailMessage','addMessage','ids','omit','getMessages','findOne','keys','hasOwnProperty','nolimit','order','sort','where','MailInteractionId','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','options','true','setTags','spread','Tag','color','emit','mailInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','push','Attachment','Attachments','from'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xdf67,0xf0));var _0x7df6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdf67[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7df6('0x0'));var zipdir=require(_0x7df6('0x1'));var moment=require(_0x7df6('0x2'));var BPromise=require(_0x7df6('0x3'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x7df6('0x4'));var juice=require(_0x7df6('0x5'));var Redis=require(_0x7df6('0x6'));var interaction=require(_0x7df6('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x7df6('0x8'))('api');var config=require(_0x7df6('0x9'));var db=require(_0x7df6('0xa'))['db'];var htmlEntities=require('html-entities');config['redis']=_['defaults'](config[_0x7df6('0xb')],{'host':_0x7df6('0xc'),'port':0x18eb});var socket=require(_0x7df6('0xd'))(new Redis(config[_0x7df6('0xb')]));require(_0x7df6('0xe'))[_0x7df6('0xf')](socket);function respondWithStatusCode(_0x446b47,_0x36d263){_0x36d263=_0x36d263||0xcc;return function(_0x3a6bcf){if(_0x3a6bcf){return _0x446b47[_0x7df6('0x10')](_0x36d263);}return _0x446b47[_0x7df6('0x11')](_0x36d263)[_0x7df6('0x12')]();};}function respondWithResult(_0x423eb9,_0x5d28de){_0x5d28de=_0x5d28de||0xc8;return function(_0x11e347){if(_0x11e347){return _0x423eb9[_0x7df6('0x11')](_0x5d28de)[_0x7df6('0x13')](_0x11e347);}};}function respondWithFilteredResult(_0x4edd0d,_0x4f0180){return function(_0x218467){if(_0x218467){var _0x26b7a1=typeof _0x4f0180['offset']===_0x7df6('0x14')&&typeof _0x4f0180[_0x7df6('0x15')]===_0x7df6('0x14');var _0x2ec75a=_0x218467['count'];var _0x531785=_0x26b7a1?0x0:_0x4f0180['offset'];var _0x418335=_0x26b7a1?_0x218467[_0x7df6('0x16')]:_0x4f0180[_0x7df6('0x17')]+_0x4f0180[_0x7df6('0x15')];var _0x451e6c;if(_0x418335>=_0x2ec75a){_0x418335=_0x2ec75a;_0x451e6c=0xc8;}else{_0x451e6c=0xce;}_0x4edd0d[_0x7df6('0x11')](_0x451e6c);return _0x4edd0d[_0x7df6('0x18')](_0x7df6('0x19'),_0x531785+'-'+_0x418335+'/'+_0x2ec75a)[_0x7df6('0x13')](_0x218467);}return null;};}function saveUpdates(_0x474a48){return function(_0x303d77){if(_0x303d77){return _0x303d77[_0x7df6('0x1a')](_0x474a48)[_0x7df6('0x1b')](function(_0x2ea971){return _0x2ea971;});}return null;};}function removeEntity(_0x50b318){return function(_0xc7e4f3){if(_0xc7e4f3){return _0xc7e4f3[_0x7df6('0x1c')]()[_0x7df6('0x1b')](function(){_0x50b318[_0x7df6('0x11')](0xcc)[_0x7df6('0x12')]();});}};}function handleEntityNotFound(_0x382657){return function(_0x17d1a8){if(!_0x17d1a8){_0x382657[_0x7df6('0x10')](0x194);}return _0x17d1a8;};}function handleError(_0x3b5ee3,_0x17af00){_0x17af00=_0x17af00||0x1f4;return function(_0x48983c){logger[_0x7df6('0x1d')](_0x48983c[_0x7df6('0x1e')]);if(_0x48983c[_0x7df6('0x1f')]){delete _0x48983c[_0x7df6('0x1f')];}_0x3b5ee3[_0x7df6('0x11')](_0x17af00)[_0x7df6('0x20')](_0x48983c);};}exports[_0x7df6('0x21')]=function(_0xd49c07,_0x1e623b){var _0x47e8f3={};var _0x31f44c=_[_0x7df6('0x22')](db['MailInteraction'][_0x7df6('0x23')],function(_0x5eafd6){return{'name':_0x5eafd6[_0x7df6('0x24')],'type':_0x5eafd6[_0x7df6('0x25')][_0x7df6('0x26')]};});_0x47e8f3=qs['getOptions'](_0x31f44c,_0xd49c07);return interaction[_0x7df6('0x27')](_0x7df6('0x28'),_0xd49c07[_0x7df6('0x29')],_0xd49c07[_0x7df6('0x2a')],_0x47e8f3,_0x31f44c)[_0x7df6('0x1b')](respondWithFilteredResult(_0x1e623b,_0x47e8f3))[_0x7df6('0x2b')](handleError(_0x1e623b,null));};exports[_0x7df6('0x2c')]=function(_0xd8b91c,_0x33345a){var _0x45bb6f={'raw':![],'where':{'id':_0xd8b91c[_0x7df6('0x2d')]['id']}},_0x1d5f52={};_0x1d5f52['model']=_['keys'](db[_0x7df6('0x2e')]['rawAttributes']);_0x1d5f52['query']=_['keys'](_0xd8b91c[_0x7df6('0x29')]);_0x1d5f52[_0x7df6('0x2f')]=_['intersection'](_0x1d5f52[_0x7df6('0x30')],_0x1d5f52[_0x7df6('0x29')]);_0x45bb6f['attributes']=_[_0x7df6('0x31')](_0x1d5f52[_0x7df6('0x30')],qs[_0x7df6('0x32')](_0xd8b91c[_0x7df6('0x29')][_0x7df6('0x32')]));_0x45bb6f['attributes']=_0x45bb6f['attributes'][_0x7df6('0x33')]?_0x45bb6f[_0x7df6('0x34')]:_0x1d5f52[_0x7df6('0x30')];if(_0xd8b91c[_0x7df6('0x29')][_0x7df6('0x35')]){_0x45bb6f[_0x7df6('0x36')]=[{'all':!![]}];}_0x45bb6f=_[_0x7df6('0x37')]({},_0x45bb6f,_0xd8b91c['options']);return db[_0x7df6('0x2e')][_0x7df6('0x38')](_0x45bb6f)[_0x7df6('0x1b')](handleEntityNotFound(_0x33345a,null))[_0x7df6('0x1b')](respondWithResult(_0x33345a,null))[_0x7df6('0x2b')](handleError(_0x33345a,null));};exports[_0x7df6('0x39')]=function(_0x4f8236,_0xeb6fae){return db[_0x7df6('0x2e')][_0x7df6('0x39')](_0x4f8236[_0x7df6('0x3a')],{})[_0x7df6('0x1b')](respondWithResult(_0xeb6fae,0xc9))[_0x7df6('0x2b')](handleError(_0xeb6fae,null));};exports[_0x7df6('0x1a')]=function(_0x50252c,_0x217b41){if(_0x50252c[_0x7df6('0x3a')]['id']){delete _0x50252c['body']['id'];}return db['MailInteraction'][_0x7df6('0x38')]({'where':{'id':_0x50252c[_0x7df6('0x2d')]['id']}})[_0x7df6('0x1b')](handleEntityNotFound(_0x217b41,null))[_0x7df6('0x1b')](saveUpdates(_0x50252c[_0x7df6('0x3a')],null))[_0x7df6('0x1b')](respondWithResult(_0x217b41,null))[_0x7df6('0x2b')](handleError(_0x217b41,null));};exports[_0x7df6('0x1c')]=function(_0x5183be,_0x4ed19a){return db[_0x7df6('0x2e')][_0x7df6('0x38')]({'where':{'id':_0x5183be[_0x7df6('0x2d')]['id']}})[_0x7df6('0x1b')](handleEntityNotFound(_0x4ed19a,null))[_0x7df6('0x1b')](removeEntity(_0x4ed19a,null))[_0x7df6('0x2b')](handleError(_0x4ed19a,null));};exports['describe']=function(_0x2f8914,_0x18be42){return db[_0x7df6('0x2e')]['describe']()['then'](respondWithResult(_0x18be42,null))[_0x7df6('0x2b')](handleError(_0x18be42,null));};exports['addMessage']=function(_0x4e524d,_0x241107){return db[_0x7df6('0x3b')][_0x7df6('0x38')]({'where':{'id':_0x4e524d[_0x7df6('0x2d')]['id']}})[_0x7df6('0x1b')](handleEntityNotFound(_0x241107,null))['then'](function(_0xfc53e2){if(_0xfc53e2){return _0xfc53e2[_0x7df6('0x3c')](_0x4e524d[_0x7df6('0x3a')][_0x7df6('0x3d')],_[_0x7df6('0x3e')](_0x4e524d[_0x7df6('0x3a')],[_0x7df6('0x3d'),'id'])||{});}})[_0x7df6('0x1b')](respondWithResult(_0x241107,null))[_0x7df6('0x2b')](handleError(_0x241107,null));};exports[_0x7df6('0x3f')]=function(_0x319dbd,_0x607649){var _0x2d725c={'raw':![],'where':{}};var _0x9b130f={};var _0x48ba14={'count':0x0,'rows':[]};return db[_0x7df6('0x2e')][_0x7df6('0x40')]({'where':{'id':_0x319dbd[_0x7df6('0x2d')]['id']}})['then'](handleEntityNotFound(_0x607649,null))[_0x7df6('0x1b')](function(_0x49b4f9){if(_0x49b4f9){_0x9b130f[_0x7df6('0x30')]=_[_0x7df6('0x41')](db[_0x7df6('0x3b')]['rawAttributes']);_0x9b130f[_0x7df6('0x29')]=_[_0x7df6('0x41')](_0x319dbd[_0x7df6('0x29')]);_0x9b130f[_0x7df6('0x2f')]=_[_0x7df6('0x31')](_0x9b130f['model'],_0x9b130f[_0x7df6('0x29')]);_0x2d725c[_0x7df6('0x34')]=_[_0x7df6('0x31')](_0x9b130f[_0x7df6('0x30')],qs[_0x7df6('0x32')](_0x319dbd['query'][_0x7df6('0x32')]));_0x2d725c[_0x7df6('0x34')]=_0x2d725c['attributes'][_0x7df6('0x33')]?_0x2d725c['attributes']:_0x9b130f['model'];if(!_0x319dbd['query'][_0x7df6('0x42')](_0x7df6('0x43'))){_0x2d725c['limit']=qs[_0x7df6('0x15')](_0x319dbd[_0x7df6('0x29')][_0x7df6('0x15')]);_0x2d725c['offset']=qs[_0x7df6('0x17')](_0x319dbd[_0x7df6('0x29')][_0x7df6('0x17')]);}_0x2d725c[_0x7df6('0x44')]=qs[_0x7df6('0x45')](_0x319dbd[_0x7df6('0x29')]['sort']);_0x2d725c[_0x7df6('0x46')]=qs['filters'](_['pick'](_0x319dbd['query'],_0x9b130f[_0x7df6('0x2f')]));_0x2d725c[_0x7df6('0x46')][_0x7df6('0x47')]=_0x49b4f9['id'];if(_0x319dbd[_0x7df6('0x29')]['filter']){_0x2d725c[_0x7df6('0x46')]=_['merge'](_0x2d725c[_0x7df6('0x46')],{'$or':_[_0x7df6('0x22')](_0x2d725c[_0x7df6('0x34')],function(_0xc87838){var _0x18c324={};_0x18c324[_0xc87838]={'$like':'%'+_0x319dbd[_0x7df6('0x29')][_0x7df6('0x48')]+'%'};return _0x18c324;})});}if(_0x319dbd[_0x7df6('0x29')]['$gte']){var _0x3f3aa7=_0x319dbd['query'][_0x7df6('0x49')][_0x7df6('0x4a')](',');var _0x270dc6={};_0x270dc6[_0x3f3aa7[0x0]]={'$gte':moment(_0x3f3aa7[0x1])[_0x7df6('0x4b')](_0x7df6('0x4c'))};_0x2d725c[_0x7df6('0x46')]=_['merge'](_0x2d725c['where'],_0x270dc6);}_0x2d725c=_['merge']({},_0x2d725c,_0x319dbd[_0x7df6('0x4d')]);return db[_0x7df6('0x3b')][_0x7df6('0x16')]({'where':_0x2d725c[_0x7df6('0x46')]})['then'](function(_0x56975e){_0x48ba14[_0x7df6('0x16')]=_0x56975e;if(_0x319dbd[_0x7df6('0x29')]['includeAll']){_0x2d725c[_0x7df6('0x36')]=[{'all':!![]}];}return db[_0x7df6('0x3b')][_0x7df6('0x27')](_0x2d725c);})[_0x7df6('0x1b')](function(_0x57aa6f){if(_0x319dbd[_0x7df6('0x29')]['inlineCss']===_0x7df6('0x4e')){for(var _0x5b472d=0x0;_0x5b472d<_0x57aa6f[_0x7df6('0x33')];_0x5b472d++){_0x57aa6f[_0x5b472d][_0x7df6('0x3a')]=juice(_0x57aa6f[_0x5b472d]['body']);}}_0x48ba14['rows']=_0x57aa6f;return _0x48ba14;});}})['then'](respondWithFilteredResult(_0x607649,_0x2d725c))[_0x7df6('0x2b')](handleError(_0x607649,null));};exports['addTags']=function(_0x1eac6f,_0x2a82dc){return db[_0x7df6('0x2e')][_0x7df6('0x38')]({'where':{'id':_0x1eac6f['params']['id']}})[_0x7df6('0x1b')](handleEntityNotFound(_0x2a82dc,null))[_0x7df6('0x1b')](function(_0x574dfb){if(_0x574dfb){return _0x574dfb[_0x7df6('0x4f')](_0x1eac6f[_0x7df6('0x3a')]['ids'],_[_0x7df6('0x3e')](_0x1eac6f[_0x7df6('0x3a')],[_0x7df6('0x3d'),'id'])||{})[_0x7df6('0x50')](function(){return db[_0x7df6('0x51')][_0x7df6('0x27')]({'attributes':['id','name',_0x7df6('0x52')],'where':{'id':_0x1eac6f[_0x7df6('0x3a')][_0x7df6('0x3d')]}});})[_0x7df6('0x1b')](function(_0xbb6400){socket[_0x7df6('0x53')](_0x7df6('0x54'),{'id':Number(_0x1eac6f[_0x7df6('0x2d')]['id']),'tags':_0xbb6400||[]});return{'id':Number(_0x1eac6f[_0x7df6('0x2d')]['id']),'tags':_0xbb6400||[]};});}})[_0x7df6('0x1b')](respondWithResult(_0x2a82dc,null))[_0x7df6('0x2b')](handleError(_0x2a82dc,null));};exports['removeTags']=function(_0x37c481,_0x61d1d){return db['MailInteraction'][_0x7df6('0x38')]({'where':{'id':_0x37c481[_0x7df6('0x2d')]['id']}})['then'](handleEntityNotFound(_0x61d1d,null))[_0x7df6('0x1b')](function(_0x4b6412){if(_0x4b6412){return _0x4b6412[_0x7df6('0x55')](_0x37c481[_0x7df6('0x29')][_0x7df6('0x3d')]);}})[_0x7df6('0x1b')](respondWithStatusCode(_0x61d1d,null))[_0x7df6('0x2b')](handleError(_0x61d1d,null));};exports[_0x7df6('0x56')]=function(_0x20fc16,_0x489e89){var _0x324c82=moment()[_0x7df6('0x57')]()[_0x7df6('0x58')]();var _0x45a5e7=path[_0x7df6('0x59')](config[_0x7df6('0x5a')],_0x7df6('0x5b'),_0x7df6('0x5c'),_0x7df6('0x5d'));var _0x2b27b4=path[_0x7df6('0x59')](config[_0x7df6('0x5a')],_0x7df6('0x5b'),_0x7df6('0x5c'),_0x7df6('0x5e'));var _0x510cfc=path['join'](_0x45a5e7,_0x324c82);var _0x429ebf=util['format']('transcript-%d-%s.zip',_0x20fc16[_0x7df6('0x2d')]['id'],_0x324c82);var _0x55da8f=path['join'](_0x45a5e7,_0x429ebf);var _0x5f4642=[];if(_0x20fc16['query']['attachments']){_0x5f4642[_0x7df6('0x5f')]({'model':db[_0x7df6('0x60')],'as':_0x7df6('0x61'),'raw':!![]});}var _0x386d58=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x7df6('0x3a'),_0x7df6('0x62'),'to','cc',_0x7df6('0x63'),'subject',_0x7df6('0x64')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x5f4642}];return db[_0x7df6('0x2e')][_0x7df6('0x38')]({'where':{'id':_0x20fc16['params']['id']},'include':_0x386d58})[_0x7df6('0x1b')](handleEntityNotFound(_0x489e89,null))[_0x7df6('0x1b')](function(_0x4df485){if(_0x4df485&&_0x4df485[_0x7df6('0x65')]){var _0x5800d7=_0x4df485[_0x7df6('0x66')]({'plain':!![]});fs[_0x7df6('0x67')](_0x510cfc);return BPromise[_0x7df6('0x68')](_0x5800d7[_0x7df6('0x65')],function(_0x5d1668,_0x5c8035){var _0x21b2bd={'from':_0x5d1668[_0x7df6('0x62')],'to':_0x5d1668['to']||_0x7df6('0x69'),'subject':_0x5d1668[_0x7df6('0x6a')],'html':htmlEntities['decode'](_0x5d1668[_0x7df6('0x3a')]),'headers':{'Date':moment(_0x5d1668[_0x7df6('0x64')])[_0x7df6('0x4b')](_0x7df6('0x6b'))},'attachments':[]};if(_0x5d1668['cc']){_0x21b2bd[_0x7df6('0x6c')]['Cc']=_0x5d1668['cc'];}if(_0x5d1668[_0x7df6('0x63')]){_0x21b2bd['headers']['Bcc']=_0x5d1668[_0x7df6('0x63')];}return new BPromise(function(_0x48c830,_0x4db085){if(_0x5d1668[_0x7df6('0x61')]){for(var _0x49dc66=0x0;_0x49dc66<_0x5d1668[_0x7df6('0x61')][_0x7df6('0x33')];_0x49dc66++){var _0x5dfc01=_0x5d1668[_0x7df6('0x61')][_0x49dc66];var _0xe4a1c5=path[_0x7df6('0x59')](_0x2b27b4,_0x5dfc01[_0x7df6('0x6d')]);if(fs[_0x7df6('0x6e')](_0xe4a1c5)){_0x21b2bd['attachments'][_0x7df6('0x5f')]({'name':_0x5dfc01[_0x7df6('0x1f')],'contentType':_0x5dfc01[_0x7df6('0x25')],'data':fs[_0x7df6('0x6f')](_0xe4a1c5)});}}}emlformat['build'](_0x21b2bd,function(_0x263f15,_0x18d0f3){if(_0x263f15)return _0x4db085(_0x263f15);fs[_0x7df6('0x70')](path[_0x7df6('0x59')](_0x510cfc,util[_0x7df6('0x4b')]('message%d.eml',_0x5c8035)),_0x18d0f3);return _0x48c830(_0x18d0f3);});});})[_0x7df6('0x1b')](function(){return new BPromise(function(_0xcf32d7,_0x7ef86f){zipdir(_0x510cfc,{'saveTo':_0x55da8f},function(_0x4787e6,_0x36a6d0){if(_0x4787e6)return _0x7ef86f(_0x4787e6);return _0xcf32d7(_0x36a6d0);});})[_0x7df6('0x1b')](function(){return new BPromise(function(_0x442475,_0x4253d3){rimraf(_0x510cfc,function(_0x56c9b5){if(_0x56c9b5)_0x4253d3(_0x56c9b5);return _0x442475();});});})['then'](function(){return _0x489e89['download'](_0x55da8f,_0x429ebf,function(_0x38ad64){if(!_0x38ad64)fs['unlinkSync'](_0x55da8f);});});});}else{return _0x489e89['sendStatus'](0xc8);}})[_0x7df6('0x2b')](handleError(_0x489e89,null));}; \ No newline at end of file +var _0x7ff3=['unix','join','root','server','tmp','files','attachments','push','Attachment','from','bcc','subject','Messages','get','mkdirSync','each','missing.recipient@your.company.com','createdAt','headers','Bcc','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','eml-format','moment','util','path','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','limit','undefined','offset','set','Content-Range','json','update','destroy','error','stack','name','send','index','map','MailInteraction','fieldName','type','getOptions','findAll','query','then','catch','show','params','model','keys','rawAttributes','intersection','fields','attributes','length','includeAll','options','create','body','find','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','order','sort','where','filters','pick','merge','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','count','include','inlineCss','true','rows','addTags','setTags','emit','mailInteractionTags:save','removeTags','download'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ff3,0x175));var _0x37ff=function(_0x4ffa64,_0x271035){_0x4ffa64=_0x4ffa64-0x0;var _0x5da001=_0x7ff3[_0x4ffa64];return _0x5da001;};'use strict';var emlformat=require(_0x37ff('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var moment=require(_0x37ff('0x1'));var BPromise=require('bluebird');var util=require(_0x37ff('0x2'));var path=require(_0x37ff('0x3'));var fs=require('fs');var _=require(_0x37ff('0x4'));var juice=require(_0x37ff('0x5'));var Redis=require(_0x37ff('0x6'));var interaction=require('../../components/interaction/service');var qs=require(_0x37ff('0x7'));var logger=require(_0x37ff('0x8'))(_0x37ff('0x9'));var config=require(_0x37ff('0xa'));var db=require(_0x37ff('0xb'))['db'];var htmlEntities=require(_0x37ff('0xc'));config[_0x37ff('0xd')]=_[_0x37ff('0xe')](config[_0x37ff('0xd')],{'host':_0x37ff('0xf'),'port':0x18eb});var socket=require(_0x37ff('0x10'))(new Redis(config[_0x37ff('0xd')]));require(_0x37ff('0x11'))[_0x37ff('0x12')](socket);function respondWithStatusCode(_0x5d519d,_0x19d020){_0x19d020=_0x19d020||0xcc;return function(_0x165a18){if(_0x165a18){return _0x5d519d[_0x37ff('0x13')](_0x19d020);}return _0x5d519d[_0x37ff('0x14')](_0x19d020)[_0x37ff('0x15')]();};}function respondWithResult(_0xb660d0,_0x47acf2){_0x47acf2=_0x47acf2||0xc8;return function(_0xc5b52d){if(_0xc5b52d){return _0xb660d0[_0x37ff('0x14')](_0x47acf2)['json'](_0xc5b52d);}};}function respondWithFilteredResult(_0x3ab278,_0xd77fba){return function(_0x2d312c){if(_0x2d312c){var _0x2612b3=typeof _0xd77fba['offset']==='undefined'&&typeof _0xd77fba[_0x37ff('0x16')]===_0x37ff('0x17');var _0x5a12a8=_0x2d312c['count'];var _0x329711=_0x2612b3?0x0:_0xd77fba[_0x37ff('0x18')];var _0x2e7fbd=_0x2612b3?_0x2d312c['count']:_0xd77fba['offset']+_0xd77fba['limit'];var _0x596b48;if(_0x2e7fbd>=_0x5a12a8){_0x2e7fbd=_0x5a12a8;_0x596b48=0xc8;}else{_0x596b48=0xce;}_0x3ab278[_0x37ff('0x14')](_0x596b48);return _0x3ab278[_0x37ff('0x19')](_0x37ff('0x1a'),_0x329711+'-'+_0x2e7fbd+'/'+_0x5a12a8)[_0x37ff('0x1b')](_0x2d312c);}return null;};}function saveUpdates(_0x492b15){return function(_0x38d32a){if(_0x38d32a){return _0x38d32a[_0x37ff('0x1c')](_0x492b15)['then'](function(_0x498d99){return _0x498d99;});}return null;};}function removeEntity(_0x2c74a0){return function(_0x3f177f){if(_0x3f177f){return _0x3f177f[_0x37ff('0x1d')]()['then'](function(){_0x2c74a0[_0x37ff('0x14')](0xcc)[_0x37ff('0x15')]();});}};}function handleEntityNotFound(_0x4fe5e9){return function(_0x298417){if(!_0x298417){_0x4fe5e9[_0x37ff('0x13')](0x194);}return _0x298417;};}function handleError(_0x294b44,_0x2be2d1){_0x2be2d1=_0x2be2d1||0x1f4;return function(_0x462829){logger[_0x37ff('0x1e')](_0x462829[_0x37ff('0x1f')]);if(_0x462829[_0x37ff('0x20')]){delete _0x462829[_0x37ff('0x20')];}_0x294b44[_0x37ff('0x14')](_0x2be2d1)[_0x37ff('0x21')](_0x462829);};}exports[_0x37ff('0x22')]=function(_0x1d46da,_0x41ee1e){var _0x1bee5f={};var _0x180c88=_[_0x37ff('0x23')](db[_0x37ff('0x24')]['rawAttributes'],function(_0x4a0c38){return{'name':_0x4a0c38[_0x37ff('0x25')],'type':_0x4a0c38[_0x37ff('0x26')]['key']};});_0x1bee5f=qs[_0x37ff('0x27')](_0x180c88,_0x1d46da);return interaction[_0x37ff('0x28')]('mail',_0x1d46da[_0x37ff('0x29')],_0x1d46da['user'],_0x1bee5f,_0x180c88)[_0x37ff('0x2a')](respondWithFilteredResult(_0x41ee1e,_0x1bee5f))[_0x37ff('0x2b')](handleError(_0x41ee1e,null));};exports[_0x37ff('0x2c')]=function(_0x1cb15d,_0x1c5da2){var _0x59d35d={'raw':![],'where':{'id':_0x1cb15d[_0x37ff('0x2d')]['id']}},_0x19c605={};_0x19c605[_0x37ff('0x2e')]=_[_0x37ff('0x2f')](db[_0x37ff('0x24')][_0x37ff('0x30')]);_0x19c605[_0x37ff('0x29')]=_[_0x37ff('0x2f')](_0x1cb15d[_0x37ff('0x29')]);_0x19c605['filters']=_[_0x37ff('0x31')](_0x19c605[_0x37ff('0x2e')],_0x19c605['query']);_0x59d35d['attributes']=_['intersection'](_0x19c605[_0x37ff('0x2e')],qs[_0x37ff('0x32')](_0x1cb15d[_0x37ff('0x29')]['fields']));_0x59d35d[_0x37ff('0x33')]=_0x59d35d['attributes'][_0x37ff('0x34')]?_0x59d35d[_0x37ff('0x33')]:_0x19c605[_0x37ff('0x2e')];if(_0x1cb15d['query'][_0x37ff('0x35')]){_0x59d35d['include']=[{'all':!![]}];}_0x59d35d=_['merge']({},_0x59d35d,_0x1cb15d[_0x37ff('0x36')]);return db['MailInteraction']['find'](_0x59d35d)[_0x37ff('0x2a')](handleEntityNotFound(_0x1c5da2,null))[_0x37ff('0x2a')](respondWithResult(_0x1c5da2,null))[_0x37ff('0x2b')](handleError(_0x1c5da2,null));};exports[_0x37ff('0x37')]=function(_0x2018dd,_0x453e58){return db[_0x37ff('0x24')]['create'](_0x2018dd['body'],{})[_0x37ff('0x2a')](respondWithResult(_0x453e58,0xc9))[_0x37ff('0x2b')](handleError(_0x453e58,null));};exports[_0x37ff('0x1c')]=function(_0x529597,_0x5865ca){if(_0x529597[_0x37ff('0x38')]['id']){delete _0x529597['body']['id'];}return db[_0x37ff('0x24')]['find']({'where':{'id':_0x529597[_0x37ff('0x2d')]['id']}})[_0x37ff('0x2a')](handleEntityNotFound(_0x5865ca,null))[_0x37ff('0x2a')](saveUpdates(_0x529597[_0x37ff('0x38')],null))[_0x37ff('0x2a')](respondWithResult(_0x5865ca,null))['catch'](handleError(_0x5865ca,null));};exports[_0x37ff('0x1d')]=function(_0x454601,_0x3091ff){return db['MailInteraction'][_0x37ff('0x39')]({'where':{'id':_0x454601['params']['id']}})[_0x37ff('0x2a')](handleEntityNotFound(_0x3091ff,null))[_0x37ff('0x2a')](removeEntity(_0x3091ff,null))[_0x37ff('0x2b')](handleError(_0x3091ff,null));};exports['describe']=function(_0x82d8d0,_0x2aed18){return db['MailInteraction'][_0x37ff('0x3a')]()['then'](respondWithResult(_0x2aed18,null))[_0x37ff('0x2b')](handleError(_0x2aed18,null));};exports[_0x37ff('0x3b')]=function(_0x154363,_0x571f83){return db[_0x37ff('0x3c')]['find']({'where':{'id':_0x154363[_0x37ff('0x2d')]['id']}})[_0x37ff('0x2a')](handleEntityNotFound(_0x571f83,null))[_0x37ff('0x2a')](function(_0x3cbec1){if(_0x3cbec1){return _0x3cbec1[_0x37ff('0x3b')](_0x154363['body'][_0x37ff('0x3d')],_[_0x37ff('0x3e')](_0x154363[_0x37ff('0x38')],[_0x37ff('0x3d'),'id'])||{});}})[_0x37ff('0x2a')](respondWithResult(_0x571f83,null))['catch'](handleError(_0x571f83,null));};exports['getMessages']=function(_0x63adde,_0x4ba22a){var _0x22b839={'raw':![],'where':{}};var _0x1f055a={};var _0x2b7100={'count':0x0,'rows':[]};return db[_0x37ff('0x24')][_0x37ff('0x3f')]({'where':{'id':_0x63adde[_0x37ff('0x2d')]['id']}})[_0x37ff('0x2a')](handleEntityNotFound(_0x4ba22a,null))[_0x37ff('0x2a')](function(_0x1c0a92){if(_0x1c0a92){_0x1f055a[_0x37ff('0x2e')]=_[_0x37ff('0x2f')](db[_0x37ff('0x3c')][_0x37ff('0x30')]);_0x1f055a[_0x37ff('0x29')]=_[_0x37ff('0x2f')](_0x63adde[_0x37ff('0x29')]);_0x1f055a['filters']=_[_0x37ff('0x31')](_0x1f055a[_0x37ff('0x2e')],_0x1f055a[_0x37ff('0x29')]);_0x22b839['attributes']=_[_0x37ff('0x31')](_0x1f055a[_0x37ff('0x2e')],qs[_0x37ff('0x32')](_0x63adde[_0x37ff('0x29')][_0x37ff('0x32')]));_0x22b839[_0x37ff('0x33')]=_0x22b839[_0x37ff('0x33')]['length']?_0x22b839[_0x37ff('0x33')]:_0x1f055a[_0x37ff('0x2e')];if(!_0x63adde[_0x37ff('0x29')][_0x37ff('0x40')]('nolimit')){_0x22b839['limit']=qs[_0x37ff('0x16')](_0x63adde[_0x37ff('0x29')][_0x37ff('0x16')]);_0x22b839[_0x37ff('0x18')]=qs[_0x37ff('0x18')](_0x63adde[_0x37ff('0x29')][_0x37ff('0x18')]);}_0x22b839[_0x37ff('0x41')]=qs['sort'](_0x63adde[_0x37ff('0x29')][_0x37ff('0x42')]);_0x22b839[_0x37ff('0x43')]=qs[_0x37ff('0x44')](_[_0x37ff('0x45')](_0x63adde[_0x37ff('0x29')],_0x1f055a[_0x37ff('0x44')]));_0x22b839[_0x37ff('0x43')]['MailInteractionId']=_0x1c0a92['id'];if(_0x63adde['query']['filter']){_0x22b839[_0x37ff('0x43')]=_[_0x37ff('0x46')](_0x22b839['where'],{'$or':_[_0x37ff('0x23')](_0x22b839[_0x37ff('0x33')],function(_0x2fd701){var _0x430414={};_0x430414[_0x2fd701]={'$like':'%'+_0x63adde[_0x37ff('0x29')][_0x37ff('0x47')]+'%'};return _0x430414;})});}if(_0x63adde[_0x37ff('0x29')][_0x37ff('0x48')]){var _0x223602=_0x63adde[_0x37ff('0x29')][_0x37ff('0x48')][_0x37ff('0x49')](',');var _0x3d8004={};_0x3d8004[_0x223602[0x0]]={'$gte':moment(_0x223602[0x1])[_0x37ff('0x4a')](_0x37ff('0x4b'))};_0x22b839[_0x37ff('0x43')]=_[_0x37ff('0x46')](_0x22b839[_0x37ff('0x43')],_0x3d8004);}_0x22b839=_['merge']({},_0x22b839,_0x63adde[_0x37ff('0x36')]);return db[_0x37ff('0x3c')][_0x37ff('0x4c')]({'where':_0x22b839[_0x37ff('0x43')]})[_0x37ff('0x2a')](function(_0x4a60c5){_0x2b7100[_0x37ff('0x4c')]=_0x4a60c5;if(_0x63adde[_0x37ff('0x29')][_0x37ff('0x35')]){_0x22b839[_0x37ff('0x4d')]=[{'all':!![]}];}return db[_0x37ff('0x3c')][_0x37ff('0x28')](_0x22b839);})[_0x37ff('0x2a')](function(_0x491a86){if(_0x63adde[_0x37ff('0x29')][_0x37ff('0x4e')]===_0x37ff('0x4f')){for(var _0x1176be=0x0;_0x1176be<_0x491a86[_0x37ff('0x34')];_0x1176be++){_0x491a86[_0x1176be]['body']=juice(_0x491a86[_0x1176be][_0x37ff('0x38')]);}}_0x2b7100[_0x37ff('0x50')]=_0x491a86;return _0x2b7100;});}})[_0x37ff('0x2a')](respondWithFilteredResult(_0x4ba22a,_0x22b839))[_0x37ff('0x2b')](handleError(_0x4ba22a,null));};exports[_0x37ff('0x51')]=function(_0x50fc50,_0x5844a0){return db[_0x37ff('0x24')][_0x37ff('0x39')]({'where':{'id':_0x50fc50[_0x37ff('0x2d')]['id']}})[_0x37ff('0x2a')](handleEntityNotFound(_0x5844a0,null))[_0x37ff('0x2a')](function(_0xcb2f97){if(_0xcb2f97){return _0xcb2f97[_0x37ff('0x52')](_0x50fc50[_0x37ff('0x38')][_0x37ff('0x3d')],_[_0x37ff('0x3e')](_0x50fc50[_0x37ff('0x38')],[_0x37ff('0x3d'),'id'])||{})['spread'](function(){return db['Tag'][_0x37ff('0x28')]({'attributes':['id',_0x37ff('0x20'),'color'],'where':{'id':_0x50fc50[_0x37ff('0x38')][_0x37ff('0x3d')]}});})[_0x37ff('0x2a')](function(_0x20a657){socket[_0x37ff('0x53')](_0x37ff('0x54'),{'id':Number(_0x50fc50[_0x37ff('0x2d')]['id']),'tags':_0x20a657||[]});return{'id':Number(_0x50fc50['params']['id']),'tags':_0x20a657||[]};});}})[_0x37ff('0x2a')](respondWithResult(_0x5844a0,null))[_0x37ff('0x2b')](handleError(_0x5844a0,null));};exports['removeTags']=function(_0x41ef97,_0x362a78){return db[_0x37ff('0x24')][_0x37ff('0x39')]({'where':{'id':_0x41ef97[_0x37ff('0x2d')]['id']}})[_0x37ff('0x2a')](handleEntityNotFound(_0x362a78,null))[_0x37ff('0x2a')](function(_0x5d8d67){if(_0x5d8d67){return _0x5d8d67[_0x37ff('0x55')](_0x41ef97[_0x37ff('0x29')][_0x37ff('0x3d')]);}})[_0x37ff('0x2a')](respondWithStatusCode(_0x362a78,null))['catch'](handleError(_0x362a78,null));};exports[_0x37ff('0x56')]=function(_0x46938c,_0x4429a9){var _0x38c575=moment()[_0x37ff('0x57')]()['toString']();var _0x1c328a=path[_0x37ff('0x58')](config[_0x37ff('0x59')],_0x37ff('0x5a'),'files',_0x37ff('0x5b'));var _0x19c5c4=path[_0x37ff('0x58')](config['root'],_0x37ff('0x5a'),_0x37ff('0x5c'),_0x37ff('0x5d'));var _0x3cbb32=path['join'](_0x1c328a,_0x38c575);var _0x5b3cfd=util[_0x37ff('0x4a')]('transcript-%d-%s.zip',_0x46938c[_0x37ff('0x2d')]['id'],_0x38c575);var _0x68af45=path[_0x37ff('0x58')](_0x1c328a,_0x5b3cfd);var _0x55be0d=[];if(_0x46938c[_0x37ff('0x29')][_0x37ff('0x5d')]){_0x55be0d[_0x37ff('0x5e')]({'model':db[_0x37ff('0x5f')],'as':'Attachments','raw':!![]});}var _0x349e8c=[{'model':db['MailMessage'],'as':'Messages','attributes':['id',_0x37ff('0x38'),_0x37ff('0x60'),'to','cc',_0x37ff('0x61'),_0x37ff('0x62'),'createdAt'],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x55be0d}];return db[_0x37ff('0x24')][_0x37ff('0x39')]({'where':{'id':_0x46938c[_0x37ff('0x2d')]['id']},'include':_0x349e8c})[_0x37ff('0x2a')](handleEntityNotFound(_0x4429a9,null))[_0x37ff('0x2a')](function(_0x5518d0){if(_0x5518d0&&_0x5518d0[_0x37ff('0x63')]){var _0x44d233=_0x5518d0[_0x37ff('0x64')]({'plain':!![]});fs[_0x37ff('0x65')](_0x3cbb32);return BPromise[_0x37ff('0x66')](_0x44d233[_0x37ff('0x63')],function(_0x510b41,_0x2a4f4a){var _0x3e2bc4={'from':_0x510b41[_0x37ff('0x60')],'to':_0x510b41['to']||_0x37ff('0x67'),'subject':_0x510b41[_0x37ff('0x62')],'html':htmlEntities['decode'](_0x510b41['body']),'headers':{'Date':moment(_0x510b41[_0x37ff('0x68')])[_0x37ff('0x4a')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x510b41['cc']){_0x3e2bc4['headers']['Cc']=_0x510b41['cc'];}if(_0x510b41[_0x37ff('0x61')]){_0x3e2bc4[_0x37ff('0x69')][_0x37ff('0x6a')]=_0x510b41[_0x37ff('0x61')];}return new BPromise(function(_0x109585,_0x22f7d1){if(_0x510b41[_0x37ff('0x6b')]){for(var _0x338157=0x0;_0x338157<_0x510b41[_0x37ff('0x6b')]['length'];_0x338157++){var _0x90d79e=_0x510b41['Attachments'][_0x338157];var _0x3cb8a0=path[_0x37ff('0x58')](_0x19c5c4,_0x90d79e[_0x37ff('0x6c')]);if(fs[_0x37ff('0x6d')](_0x3cb8a0)){_0x3e2bc4[_0x37ff('0x5d')]['push']({'name':_0x90d79e[_0x37ff('0x20')],'contentType':_0x90d79e[_0x37ff('0x26')],'data':fs[_0x37ff('0x6e')](_0x3cb8a0)});}}}emlformat[_0x37ff('0x6f')](_0x3e2bc4,function(_0x274285,_0x4cf9e0){if(_0x274285)return _0x22f7d1(_0x274285);fs[_0x37ff('0x70')](path[_0x37ff('0x58')](_0x3cbb32,util[_0x37ff('0x4a')](_0x37ff('0x71'),_0x2a4f4a)),_0x4cf9e0);return _0x109585(_0x4cf9e0);});});})[_0x37ff('0x2a')](function(){return new BPromise(function(_0x2744a8,_0xed4f9c){zipdir(_0x3cbb32,{'saveTo':_0x68af45},function(_0x501b9d,_0x59fd){if(_0x501b9d)return _0xed4f9c(_0x501b9d);return _0x2744a8(_0x59fd);});})['then'](function(){return new BPromise(function(_0x1272e8,_0x358e46){rimraf(_0x3cbb32,function(_0x10a6c1){if(_0x10a6c1)_0x358e46(_0x10a6c1);return _0x1272e8();});});})[_0x37ff('0x2a')](function(){return _0x4429a9[_0x37ff('0x56')](_0x68af45,_0x5b3cfd,function(_0x4c4360){if(!_0x4c4360)fs[_0x37ff('0x72')](_0x68af45);});});});}else{return _0x4429a9[_0x37ff('0x13')](0xc8);}})['catch'](handleError(_0x4429a9,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a3d4226..0cdf82b 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 _0x2046=['hook','exports','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','emit','catch'];(function(_0x205e5a,_0x5c19fb){var _0x10da58=function(_0x1ba35d){while(--_0x1ba35d){_0x205e5a['push'](_0x205e5a['shift']());}};_0x10da58(++_0x5c19fb);}(_0x2046,0x1c4));var _0x6204=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2046[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db']['MailInteraction'];var MailMessage=require('../../mysqldb')['db'][_0x6204('0x0')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6204('0x1')](0x0);var events={'afterCreate':_0x6204('0x2'),'afterUpdate':_0x6204('0x3'),'afterDestroy':_0x6204('0x4')};function emitEvent(_0x461977){return function(_0x26ca03,_0x8df4c4,_0x363766){_0x26ca03[_0x6204('0x5')]({'attributes':['id'],'raw':!![]})[_0x6204('0x6')](function(_0x448b27){_0x26ca03[_0x6204('0x7')](_0x6204('0x8'),_0x448b27[_0x6204('0x9')](function(_0x347ac6){return{'id':_0x347ac6['id']};}));return MailMessage[_0x6204('0xa')]({'where':{'MailInteractionId':_0x26ca03['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6204('0x6')](function(_0x8ccaf1){_0x26ca03[_0x6204('0x7')]('unreadMessages',_0x8ccaf1['length']);MailInteractionEvents[_0x6204('0xb')](_0x461977+':'+_0x26ca03['id'],_0x26ca03);MailInteractionEvents['emit'](_0x461977,_0x26ca03);_0x363766(null);})[_0x6204('0xc')](_0x363766(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x6204('0xd')](e,emitEvent(event));}}module[_0x6204('0xe')]=MailInteractionEvents; \ No newline at end of file +var _0x343f=['unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','MailInteraction','MailMessage','setMaxListeners','save','then','setDataValue','Users','map','findAll'];(function(_0x256005,_0x1b3837){var _0x464d07=function(_0x1f604c){while(--_0x1f604c){_0x256005['push'](_0x256005['shift']());}};_0x464d07(++_0x1b3837);}(_0x343f,0xb6));var _0xf343=function(_0x1e7d44,_0x157c80){_0x1e7d44=_0x1e7d44-0x0;var _0x1943f5=_0x343f[_0x1e7d44];return _0x1943f5;};'use strict';var EventEmitter=require(_0xf343('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0xf343('0x1')];var MailMessage=require('../../mysqldb')['db'][_0xf343('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf343('0x3')](0x0);var events={'afterCreate':_0xf343('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x32f10b){return function(_0x153a85,_0x48dd3f,_0x893cf1){_0x153a85['getUsers']({'attributes':['id'],'raw':!![]})[_0xf343('0x5')](function(_0x3c09ba){_0x153a85[_0xf343('0x6')](_0xf343('0x7'),_0x3c09ba[_0xf343('0x8')](function(_0x5348e4){return{'id':_0x5348e4['id']};}));return MailMessage[_0xf343('0x9')]({'where':{'MailInteractionId':_0x153a85['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf343('0x5')](function(_0x3eccce){_0x153a85['setDataValue'](_0xf343('0xa'),_0x3eccce['length']);MailInteractionEvents[_0xf343('0xb')](_0x32f10b+':'+_0x153a85['id'],_0x153a85);MailInteractionEvents[_0xf343('0xb')](_0x32f10b,_0x153a85);_0x893cf1(null);})[_0xf343('0xc')](_0x893cf1(null));};}for(var e in events){if(events[_0xf343('0xd')](e)){var event=events[e];MailInteraction[_0xf343('0xe')](e,emitEvent(event));}}module[_0xf343('0xf')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 14bcd57..3b91b93 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 _0x8700=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatus','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8700,0x72));var _0x0870=function(_0x4a7e91,_0x27491f){_0x4a7e91=_0x4a7e91-0x0;var _0x4ddd39=_0x8700[_0x4a7e91];return _0x4ddd39;};'use strict';var _=require(_0x0870('0x0'));var util=require(_0x0870('0x1'));var logger=require(_0x0870('0x2'))(_0x0870('0x3'));var moment=require(_0x0870('0x4'));var BPromise=require(_0x0870('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0870('0x6'));var rimraf=require(_0x0870('0x7'));var config=require(_0x0870('0x8'));var attributes=require(_0x0870('0x9'));module[_0x0870('0xa')]=function(_0x2b99a8,_0x56f08a){return _0x2b99a8[_0x0870('0xb')](_0x0870('0xc'),attributes,{'tableName':_0x0870('0xd'),'paranoid':![],'indexes':[{'name':_0x0870('0xe'),'fields':['subject','to'],'type':_0x0870('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x54cfb6,_0x46ca06,_0x41ba8c){if(_0x54cfb6['substatus']){_0x54cfb6[_0x0870('0x10')]=moment()['format'](_0x0870('0x11'));}if(_0x54cfb6[_0x0870('0x12')]){_0x54cfb6[_0x0870('0x13')]=moment()[_0x0870('0x14')](_0x0870('0x11'));}_0x41ba8c(null,_0x46ca06);},'beforeUpdate':function(_0x1635c4,_0x399f7b,_0x36e8a3){if(_0x1635c4[_0x0870('0x15')](_0x0870('0x16'))){_0x1635c4[_0x0870('0x10')]=_0x1635c4[_0x0870('0x16')]?moment()[_0x0870('0x14')](_0x0870('0x11')):null;}if(_0x1635c4[_0x0870('0x15')](_0x0870('0x12'))){_0x1635c4[_0x0870('0x13')]=moment()[_0x0870('0x14')](_0x0870('0x11'));_0x1635c4[_0x0870('0x16')]=null;_0x1635c4[_0x0870('0x10')]=null;}_0x36e8a3(null,_0x1635c4);},'afterUpdate':function(_0x105c76,_0x2e9b70,_0x42bc2d){var _0x4caee4=_0x2b99a8['models'];var _0x213881=_0x105c76['get']({'plain':!![]});if(_0x213881['closed']){return _0x4caee4[_0x0870('0x17')][_0x0870('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x213881['id']}})[_0x0870('0x19')](function(){_0x42bc2d();})[_0x0870('0x1a')](function(_0x26aee9){_0x42bc2d(_0x26aee9);});}else{_0x42bc2d();}}},'charset':_0x0870('0x1b'),'collate':_0x0870('0x1c')});}; \ No newline at end of file +var _0x07ad=['substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','fti_mail_interactions','subject'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x07ad,0x84));var _0xd07a=function(_0x279a96,_0x28d0e8){_0x279a96=_0x279a96-0x0;var _0x967f87=_0x07ad[_0x279a96];return _0x967f87;};'use strict';var _=require(_0xd07a('0x0'));var util=require(_0xd07a('0x1'));var logger=require(_0xd07a('0x2'))('api');var moment=require(_0xd07a('0x3'));var BPromise=require(_0xd07a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd07a('0x5'));var rimraf=require(_0xd07a('0x6'));var config=require(_0xd07a('0x7'));var attributes=require(_0xd07a('0x8'));module[_0xd07a('0x9')]=function(_0x4eb6d1,_0x983a7c){return _0x4eb6d1['define']('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xd07a('0xa'),'fields':[_0xd07a('0xb'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x474af9,_0x351ebc,_0x1cc5e6){if(_0x474af9[_0xd07a('0xc')]){_0x474af9[_0xd07a('0xd')]=moment()['format'](_0xd07a('0xe'));}if(_0x474af9[_0xd07a('0xf')]){_0x474af9['closedAt']=moment()[_0xd07a('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1cc5e6(null,_0x351ebc);},'beforeUpdate':function(_0x4ba9ed,_0x37c7cd,_0xfca823){if(_0x4ba9ed[_0xd07a('0x11')]('substatus')){_0x4ba9ed[_0xd07a('0xd')]=_0x4ba9ed['substatus']?moment()['format'](_0xd07a('0xe')):null;}if(_0x4ba9ed[_0xd07a('0x11')](_0xd07a('0xf'))){_0x4ba9ed['closedAt']=moment()[_0xd07a('0x10')](_0xd07a('0xe'));_0x4ba9ed[_0xd07a('0xc')]=null;_0x4ba9ed[_0xd07a('0xd')]=null;}_0xfca823(null,_0x4ba9ed);},'afterUpdate':function(_0xae4143,_0x455e15,_0x4beb0b){var _0x15d715=_0x4eb6d1[_0xd07a('0x12')];var _0x42ebbe=_0xae4143['get']({'plain':!![]});if(_0x42ebbe[_0xd07a('0xf')]){return _0x15d715[_0xd07a('0x13')][_0xd07a('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x42ebbe['id']}})['then'](function(){_0x4beb0b();})[_0xd07a('0x15')](function(_0x5d6d62){_0x4beb0b(_0x5d6d62);});}else{_0x4beb0b();}}},'charset':_0xd07a('0x16'),'collate':_0xd07a('0x17')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index e5a005c..b196ced 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 _0x13f6=['util','bluebird','randomstring','../../config/utils','../../config/logger','client','http','redis','socket.io-emitter','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','where','attributes','then','debug','find','addTags','body','ids','omit','spread','AddTags'];(function(_0x19359e,_0xa54a9f){var _0x35371a=function(_0x294510){while(--_0x294510){_0x19359e['push'](_0x19359e['shift']());}};_0x35371a(++_0xa54a9f);}(_0x13f6,0xaf));var _0x613f=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0x13f6[_0x2055a7];return _0x42a14d;};'use strict';var _=require('lodash');var util=require(_0x613f('0x0'));var moment=require('moment');var BPromise=require(_0x613f('0x1'));var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x613f('0x3'));var logger=require(_0x613f('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x613f('0x5')][_0x613f('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x613f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x613f('0x8'))(new Redis(config[_0x613f('0x7')]));require('./mailInteraction.socket')[_0x613f('0x9')](socket);function respondWithRpcPromise(_0x3395b1,_0x21dc4,_0x186a64){return new BPromise(function(_0x32f260,_0x115352){return client['request'](_0x3395b1,_0x186a64)['then'](function(_0x4070c2){logger[_0x613f('0xa')](_0x613f('0xb'),_0x21dc4,_0x613f('0xc'));logger['debug'](_0x613f('0xd'),_0x21dc4,_0x613f('0xc'),JSON[_0x613f('0xe')](_0x4070c2));if(_0x4070c2[_0x613f('0xf')]){if(_0x4070c2[_0x613f('0xf')][_0x613f('0x10')]===0x1f4){logger[_0x613f('0xf')]('MailInteraction,\x20%s,\x20%s',_0x21dc4,_0x4070c2[_0x613f('0xf')]['message']);return _0x115352(_0x4070c2[_0x613f('0xf')][_0x613f('0x11')]);}logger[_0x613f('0xf')](_0x613f('0xb'),_0x21dc4,_0x4070c2[_0x613f('0xf')]['message']);return _0x32f260(_0x4070c2[_0x613f('0xf')][_0x613f('0x11')]);}else{logger['info'](_0x613f('0xb'),_0x21dc4,_0x613f('0xc'));_0x32f260(_0x4070c2[_0x613f('0x12')][_0x613f('0x11')]);}})[_0x613f('0x13')](function(_0x124417){logger['error'](_0x613f('0xb'),_0x21dc4,_0x124417);_0x115352(_0x124417);});});}exports[_0x613f('0x14')]=function(_0x11dc42){var _0x5462b3=this;return new Promise(function(_0x141c7d,_0x6b4b79){return db[_0x613f('0x15')][_0x613f('0x16')](_0x11dc42['body'],{'raw':_0x11dc42['options']?_0x11dc42[_0x613f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11dc42[_0x613f('0x17')]?_0x11dc42['options'][_0x613f('0x18')]||null:null,'attributes':_0x11dc42[_0x613f('0x17')]?_0x11dc42[_0x613f('0x17')][_0x613f('0x19')]||null:null,'limit':_0x11dc42[_0x613f('0x17')]?_0x11dc42[_0x613f('0x17')]['limit']||null:null})[_0x613f('0x1a')](function(_0x38363c){logger[_0x613f('0xa')](_0x613f('0x14'),_0x11dc42);logger[_0x613f('0x1b')](_0x613f('0x14'),_0x11dc42,JSON[_0x613f('0xe')](_0x38363c));_0x141c7d(_0x38363c);})[_0x613f('0x13')](function(_0x5e4ed2){logger[_0x613f('0xf')](_0x613f('0x14'),_0x5e4ed2[_0x613f('0x11')],_0x11dc42);_0x6b4b79(_0x5462b3[_0x613f('0xf')](0x1f4,_0x5e4ed2['message']));});});};exports['AddTagsToMailInteraction']=function(_0x1e5619){return new Promise(function(_0x2902a6,_0x29d575){return db[_0x613f('0x15')][_0x613f('0x1c')]({'where':_0x1e5619['options']?_0x1e5619[_0x613f('0x17')]['where']||null:null})[_0x613f('0x1a')](function(_0x656273){if(_0x656273){return _0x656273[_0x613f('0x1d')](_0x1e5619[_0x613f('0x1e')][_0x613f('0x1f')],_[_0x613f('0x20')](_0x1e5619[_0x613f('0x1e')],[_0x613f('0x1f'),'id'])||{});}})[_0x613f('0x21')](function(_0x19f015){logger[_0x613f('0xa')]('AddTags',_0x1e5619);logger[_0x613f('0x1b')](_0x613f('0x22'),_0x1e5619,JSON[_0x613f('0xe')](_0x19f015));_0x2902a6(_0x19f015);})[_0x613f('0x13')](function(_0x207451){logger['error'](_0x613f('0x22'),_0x207451[_0x613f('0x11')],_0x1e5619);_0x29d575(_this[_0x613f('0xf')](0x1f4,_0x207451[_0x613f('0x11')]));});});}; \ No newline at end of file +var _0x139e=['attributes','limit','AddTagsToMailInteraction','MailInteraction','find','addTags','omit','ids','spread','AddTags','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','UpdateMailInteraction','update','body','options','raw','where'];(function(_0x270420,_0x1225ba){var _0x52d8d2=function(_0x9bd645){while(--_0x9bd645){_0x270420['push'](_0x270420['shift']());}};_0x52d8d2(++_0x1225ba);}(_0x139e,0xe7));var _0xe139=function(_0x5064b8,_0x4554b1){_0x5064b8=_0x5064b8-0x0;var _0x211914=_0x139e[_0x5064b8];return _0x211914;};'use strict';var _=require(_0xe139('0x0'));var util=require('util');var moment=require(_0xe139('0x1'));var BPromise=require(_0xe139('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe139('0x3'));var db=require(_0xe139('0x4'))['db'];var utils=require(_0xe139('0x5'));var logger=require(_0xe139('0x6'))('rpc');var config=require(_0xe139('0x7'));var jayson=require(_0xe139('0x8'));var client=jayson[_0xe139('0x9')][_0xe139('0xa')]({'port':0x232a});config[_0xe139('0xb')]=_[_0xe139('0xc')](config[_0xe139('0xb')],{'host':_0xe139('0xd'),'port':0x18eb});var socket=require(_0xe139('0xe'))(new Redis(config[_0xe139('0xb')]));require(_0xe139('0xf'))[_0xe139('0x10')](socket);function respondWithRpcPromise(_0x3e0974,_0x14288e,_0x2dd8c0){return new BPromise(function(_0x12997a,_0xa95bb8){return client[_0xe139('0x11')](_0x3e0974,_0x2dd8c0)[_0xe139('0x12')](function(_0x578dac){logger[_0xe139('0x13')](_0xe139('0x14'),_0x14288e,_0xe139('0x15'));logger[_0xe139('0x16')](_0xe139('0x17'),_0x14288e,_0xe139('0x15'),JSON[_0xe139('0x18')](_0x578dac));if(_0x578dac[_0xe139('0x19')]){if(_0x578dac[_0xe139('0x19')]['code']===0x1f4){logger[_0xe139('0x19')]('MailInteraction,\x20%s,\x20%s',_0x14288e,_0x578dac[_0xe139('0x19')]['message']);return _0xa95bb8(_0x578dac[_0xe139('0x19')][_0xe139('0x1a')]);}logger[_0xe139('0x19')]('MailInteraction,\x20%s,\x20%s',_0x14288e,_0x578dac[_0xe139('0x19')][_0xe139('0x1a')]);return _0x12997a(_0x578dac[_0xe139('0x19')][_0xe139('0x1a')]);}else{logger[_0xe139('0x13')](_0xe139('0x14'),_0x14288e,_0xe139('0x15'));_0x12997a(_0x578dac['result'][_0xe139('0x1a')]);}})['catch'](function(_0x12ebaa){logger[_0xe139('0x19')]('MailInteraction,\x20%s,\x20%s',_0x14288e,_0x12ebaa);_0xa95bb8(_0x12ebaa);});});}exports[_0xe139('0x1b')]=function(_0x44ea2f){var _0x508290=this;return new Promise(function(_0x2f9bec,_0x5882ba){return db['MailInteraction'][_0xe139('0x1c')](_0x44ea2f[_0xe139('0x1d')],{'raw':_0x44ea2f[_0xe139('0x1e')]?_0x44ea2f[_0xe139('0x1e')][_0xe139('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44ea2f[_0xe139('0x1e')]?_0x44ea2f[_0xe139('0x1e')][_0xe139('0x20')]||null:null,'attributes':_0x44ea2f[_0xe139('0x1e')]?_0x44ea2f['options'][_0xe139('0x21')]||null:null,'limit':_0x44ea2f[_0xe139('0x1e')]?_0x44ea2f[_0xe139('0x1e')][_0xe139('0x22')]||null:null})[_0xe139('0x12')](function(_0x48c0c9){logger[_0xe139('0x13')](_0xe139('0x1b'),_0x44ea2f);logger[_0xe139('0x16')](_0xe139('0x1b'),_0x44ea2f,JSON[_0xe139('0x18')](_0x48c0c9));_0x2f9bec(_0x48c0c9);})['catch'](function(_0x3f036b){logger[_0xe139('0x19')](_0xe139('0x1b'),_0x3f036b[_0xe139('0x1a')],_0x44ea2f);_0x5882ba(_0x508290['error'](0x1f4,_0x3f036b[_0xe139('0x1a')]));});});};exports[_0xe139('0x23')]=function(_0x10b8bb){return new Promise(function(_0x22e8ee,_0x269b54){return db[_0xe139('0x24')][_0xe139('0x25')]({'where':_0x10b8bb['options']?_0x10b8bb[_0xe139('0x1e')]['where']||null:null})[_0xe139('0x12')](function(_0x387d4b){if(_0x387d4b){return _0x387d4b[_0xe139('0x26')](_0x10b8bb['body']['ids'],_[_0xe139('0x27')](_0x10b8bb[_0xe139('0x1d')],[_0xe139('0x28'),'id'])||{});}})[_0xe139('0x29')](function(_0x3edf12){logger['info']('AddTags',_0x10b8bb);logger[_0xe139('0x16')](_0xe139('0x2a'),_0x10b8bb,JSON[_0xe139('0x18')](_0x3edf12));_0x22e8ee(_0x3edf12);})[_0xe139('0x2b')](function(_0x2327fa){logger[_0xe139('0x19')]('AddTags',_0x2327fa[_0xe139('0x1a')],_0x10b8bb);_0x269b54(_this[_0xe139('0x19')](0x1f4,_0x2327fa[_0xe139('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 2d4ca38..104b819 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 _0x7c3d=['removeListener','register','length','mailInteraction:','./mailInteraction.events','update'];(function(_0x4f4c2a,_0x5f5a28){var _0xd15be6=function(_0x1bc725){while(--_0x1bc725){_0x4f4c2a['push'](_0x4f4c2a['shift']());}};_0xd15be6(++_0x5f5a28);}(_0x7c3d,0x166));var _0xd7c3=function(_0x1416ff,_0x49f1e1){_0x1416ff=_0x1416ff-0x0;var _0x4e28e0=_0x7c3d[_0x1416ff];return _0x4e28e0;};'use strict';var MailInteractionEvents=require(_0xd7c3('0x0'));var events=['save','remove',_0xd7c3('0x1')];function createListener(_0x3d3641,_0x49ade9){return function(_0x1ebf2b){_0x49ade9['emit'](_0x3d3641,_0x1ebf2b);};}function removeListener(_0x1d9347,_0x195573){return function(){MailInteractionEvents[_0xd7c3('0x2')](_0x1d9347,_0x195573);};}exports[_0xd7c3('0x3')]=function(_0x5ecb7d){for(var _0x2b426e=0x0,_0x4e5f54=events[_0xd7c3('0x4')];_0x2b426e<_0x4e5f54;_0x2b426e++){var _0x31db52=events[_0x2b426e];var _0x498030=createListener(_0xd7c3('0x5')+_0x31db52,_0x5ecb7d);MailInteractionEvents['on'](_0x31db52,_0x498030);}}; \ No newline at end of file +var _0x5460=['register','length','./mailInteraction.events','save','remove','update','removeListener'];(function(_0x2be6de,_0x1f2f8e){var _0x430210=function(_0x4a5ead){while(--_0x4a5ead){_0x2be6de['push'](_0x2be6de['shift']());}};_0x430210(++_0x1f2f8e);}(_0x5460,0x9c));var _0x0546=function(_0x229d27,_0x250f34){_0x229d27=_0x229d27-0x0;var _0x5b02a=_0x5460[_0x229d27];return _0x5b02a;};'use strict';var MailInteractionEvents=require(_0x0546('0x0'));var events=[_0x0546('0x1'),_0x0546('0x2'),_0x0546('0x3')];function createListener(_0x3569d1,_0x2cd206){return function(_0x77f5c5){_0x2cd206['emit'](_0x3569d1,_0x77f5c5);};}function removeListener(_0x54cd97,_0x279526){return function(){MailInteractionEvents[_0x0546('0x4')](_0x54cd97,_0x279526);};}exports[_0x0546('0x5')]=function(_0x28457a){for(var _0x509c5f=0x0,_0x1249d6=events[_0x0546('0x6')];_0x509c5f<_0x1249d6;_0x509c5f++){var _0x7c2dbb=events[_0x509c5f];var _0x364a1b=createListener('mailInteraction:'+_0x7c2dbb,_0x28457a);MailInteractionEvents['on'](_0x7c2dbb,_0x364a1b);}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/index.js b/server/api/mailInteractionHasTag/index.js index 1d16bd0..cb94fb8 100644 --- a/server/api/mailInteractionHasTag/index.js +++ b/server/api/mailInteractionHasTag/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a5a=['/describe','describe','exports','Router','../../components/auth/service','./mailInteractionHasTag.controller','get'];(function(_0x349077,_0x2eafb1){var _0x277000=function(_0x26de51){while(--_0x26de51){_0x349077['push'](_0x349077['shift']());}};_0x277000(++_0x2eafb1);}(_0x5a5a,0x1d1));var _0xa5a5=function(_0x5101f5,_0x16463e){_0x5101f5=_0x5101f5-0x0;var _0x56bf84=_0x5a5a[_0x5101f5];return _0x56bf84;};'use strict';var express=require('express');var router=express[_0xa5a5('0x0')]();var auth=require(_0xa5a5('0x1'));var controller=require(_0xa5a5('0x2'));router[_0xa5a5('0x3')](_0xa5a5('0x4'),auth['isAuthenticated'](),controller[_0xa5a5('0x5')]);module[_0xa5a5('0x6')]=router; \ No newline at end of file +var _0xfc46=['express','../../components/auth/service','./mailInteractionHasTag.controller','get','isAuthenticated','describe','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfc46,0x9a));var _0x6fc4=function(_0x17c483,_0xc69535){_0x17c483=_0x17c483-0x0;var _0x112bdb=_0xfc46[_0x17c483];return _0x112bdb;};'use strict';var express=require(_0x6fc4('0x0'));var router=express['Router']();var auth=require(_0x6fc4('0x1'));var controller=require(_0x6fc4('0x2'));router[_0x6fc4('0x3')]('/describe',auth[_0x6fc4('0x4')](),controller[_0x6fc4('0x5')]);module[_0x6fc4('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js index 5f96d1a..c4f4030 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x566f82,_0xa4df99){var _0x4fc8ec=function(_0x5c2e3a){while(--_0x5c2e3a){_0x566f82['push'](_0x566f82['shift']());}};_0x4fc8ec(++_0xa4df99);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file +var _0xa9e0=['catch','../../config/logger','api','../../mysqldb','json','error','name','status','describe','then'];(function(_0x4ca19c,_0x3dabe7){var _0x38209f=function(_0x2f4700){while(--_0x2f4700){_0x4ca19c['push'](_0x4ca19c['shift']());}};_0x38209f(++_0x3dabe7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var logger=require(_0x0a9e('0x0'))(_0x0a9e('0x1'));var db=require(_0x0a9e('0x2'))['db'];function respondWithResult(_0x5dd881,_0x550fbc){_0x550fbc=_0x550fbc||0xc8;return function(_0x18d5c9){if(_0x18d5c9){return _0x5dd881['status'](_0x550fbc)[_0x0a9e('0x3')](_0x18d5c9);}};}function handleError(_0x432180,_0x2ab90b){_0x2ab90b=_0x2ab90b||0x1f4;return function(_0x991246){logger[_0x0a9e('0x4')](_0x991246['stack']);if(_0x991246[_0x0a9e('0x5')]){delete _0x991246[_0x0a9e('0x5')];}_0x432180[_0x0a9e('0x6')](_0x2ab90b)['send'](_0x991246);};}exports['describe']=function(_0xe42b77,_0x56465b){return db['MailInteractionHasTag'][_0x0a9e('0x7')]()[_0x0a9e('0x8')](respondWithResult(_0x56465b,null))[_0x0a9e('0x9')](handleError(_0x56465b,null));}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.js index 19363be..7b6c8d9 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd48f=['INTEGER'];(function(_0xf7bf02,_0x13da13){var _0x4f263f=function(_0x3b5603){while(--_0x3b5603){_0xf7bf02['push'](_0xf7bf02['shift']());}};_0x4f263f(++_0x13da13);}(_0xd48f,0x1e4));var _0xfd48=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0xd48f[_0x3070dc];return _0x431489;};'use strict';var Sequelize=require('sequelize');module['exports']={'MailInteractionId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'TagId':{'type':Sequelize[_0xfd48('0x0')],'defaultValue':null}}; \ No newline at end of file +var _0x4000=['sequelize','exports','INTEGER'];(function(_0x2d3dc,_0x548c4b){var _0x632bb0=function(_0x3fc2c5){while(--_0x3fc2c5){_0x2d3dc['push'](_0x2d3dc['shift']());}};_0x632bb0(++_0x548c4b);}(_0x4000,0xdb));var _0x0400=function(_0x59042f,_0x3dcc3c){_0x59042f=_0x59042f-0x0;var _0x11b2b7=_0x4000[_0x59042f];return _0x11b2b7;};'use strict';var Sequelize=require(_0x0400('0x0'));module[_0x0400('0x1')]={'MailInteractionId':{'type':Sequelize[_0x0400('0x2')],'primaryKey':!![]},'TagId':{'type':Sequelize[_0x0400('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js index 4023f35..40578ab 100644 --- a/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js +++ b/server/api/mailInteractionHasTag/mailInteractionHasTag.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd17c=['./mailInteractionHasTag','exports','define'];(function(_0x48eb09,_0x579b4a){var _0x30c77e=function(_0x4b6607){while(--_0x4b6607){_0x48eb09['push'](_0x48eb09['shift']());}};_0x30c77e(++_0x579b4a);}(_0xd17c,0x1da));var _0xcd17=function(_0x4c15ad,_0x3fa605){_0x4c15ad=_0x4c15ad-0x0;var _0x22377d=_0xd17c[_0x4c15ad];return _0x22377d;};'use strict';var attributes=require(_0xcd17('0x0'));module[_0xcd17('0x1')]=function(_0x4496d3){return _0x4496d3[_0xcd17('0x2')]('MailInteractionHasTag',attributes,{'tableName':'mail_interaction_has_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x77d9=['mail_interaction_has_tags','define','MailInteractionHasTag'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x77d9,0x94));var _0x977d=function(_0x1f184a,_0x19ff0c){_0x1f184a=_0x1f184a-0x0;var _0x5780b1=_0x77d9[_0x1f184a];return _0x5780b1;};'use strict';var attributes=require('./mailInteractionHasTag');module['exports']=function(_0x3f82e5){return _0x3f82e5[_0x977d('0x0')](_0x977d('0x1'),attributes,{'tableName':_0x977d('0x2'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 0af5519..80484ff 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 _0x2f90=['show','/:id/download','download','post','tracked','mailmessage:create','create','put','/:id/accept','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x440353,_0x3b794b){var _0x405786=function(_0x23ecfc){while(--_0x23ecfc){_0x440353['push'](_0x440353['shift']());}};_0x405786(++_0x3b794b);}(_0x2f90,0x1e9));var _0x02f9=function(_0x2843de,_0x54412b){_0x2843de=_0x2843de-0x0;var _0x5b6319=_0x2f90[_0x2843de];return _0x5b6319;};'use strict';var multer=require('multer');var util=require(_0x02f9('0x0'));var path=require(_0x02f9('0x1'));var timeout=require(_0x02f9('0x2'));var express=require(_0x02f9('0x3'));var router=express[_0x02f9('0x4')]();var fs_extra=require(_0x02f9('0x5'));var auth=require(_0x02f9('0x6'));var interaction=require(_0x02f9('0x7'));var config=require(_0x02f9('0x8'));var controller=require('./mailMessage.controller');router[_0x02f9('0x9')]('/',auth[_0x02f9('0xa')](),controller[_0x02f9('0xb')]);router['get'](_0x02f9('0xc'),auth['isAuthenticated'](),controller[_0x02f9('0xd')]);router[_0x02f9('0x9')](_0x02f9('0xe'),auth[_0x02f9('0xa')](),controller[_0x02f9('0xf')]);router[_0x02f9('0x9')](_0x02f9('0x10'),auth[_0x02f9('0xa')](),controller[_0x02f9('0x11')]);router[_0x02f9('0x12')]('/',auth[_0x02f9('0xa')](),interaction[_0x02f9('0x13')]('mail',_0x02f9('0x14')),controller[_0x02f9('0x15')]);router['put'](_0x02f9('0xe'),auth[_0x02f9('0xa')](),controller['update']);router[_0x02f9('0x16')](_0x02f9('0x17'),auth[_0x02f9('0xa')](),controller[_0x02f9('0x18')]);router['put'](_0x02f9('0x19'),auth[_0x02f9('0xa')](),controller['reject']);router[_0x02f9('0x1a')](_0x02f9('0xe'),auth[_0x02f9('0xa')](),controller['destroy']);module[_0x02f9('0x1b')]=router; \ No newline at end of file +var _0xbd20=['accept','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','index','describe','/:id','isAuthenticated','show','download','post','tracked','mailmessage:create','put','/:id/accept'];(function(_0x50cfc3,_0x526cc6){var _0x5c11ef=function(_0xeaf96a){while(--_0xeaf96a){_0x50cfc3['push'](_0x50cfc3['shift']());}};_0x5c11ef(++_0x526cc6);}(_0xbd20,0x14a));var _0x0bd2=function(_0x5af89d,_0xa40ecd){_0x5af89d=_0x5af89d-0x0;var _0x44e390=_0xbd20[_0x5af89d];return _0x44e390;};'use strict';var multer=require(_0x0bd2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0bd2('0x1'));var express=require(_0x0bd2('0x2'));var router=express[_0x0bd2('0x3')]();var fs_extra=require(_0x0bd2('0x4'));var auth=require(_0x0bd2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0bd2('0x6'));var controller=require(_0x0bd2('0x7'));router[_0x0bd2('0x8')]('/',auth['isAuthenticated'](),controller[_0x0bd2('0x9')]);router[_0x0bd2('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x0bd2('0xa')]);router[_0x0bd2('0x8')](_0x0bd2('0xb'),auth[_0x0bd2('0xc')](),controller[_0x0bd2('0xd')]);router['get']('/:id/download',auth[_0x0bd2('0xc')](),controller[_0x0bd2('0xe')]);router[_0x0bd2('0xf')]('/',auth[_0x0bd2('0xc')](),interaction[_0x0bd2('0x10')]('mail',_0x0bd2('0x11')),controller['create']);router[_0x0bd2('0x12')](_0x0bd2('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0bd2('0x12')](_0x0bd2('0x13'),auth[_0x0bd2('0xc')](),controller[_0x0bd2('0x14')]);router[_0x0bd2('0x12')]('/:id/reject',auth['isAuthenticated'](),controller[_0x0bd2('0x15')]);router[_0x0bd2('0x16')]('/:id',auth[_0x0bd2('0xc')](),controller[_0x0bd2('0x17')]);module[_0x0bd2('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 08a4b13..33fe306 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 _0x8028=['medium','BOOLEAN','ENUM','out','STRING','DATE','Chat','Email','sequelize','lodash','TEXT','long'];(function(_0x59f0dc,_0x1e2497){var _0x5b5445=function(_0x57ca91){while(--_0x57ca91){_0x59f0dc['push'](_0x59f0dc['shift']());}};_0x5b5445(++_0x1e2497);}(_0x8028,0x68));var _0x8802=function(_0x1d818c,_0x253b66){_0x1d818c=_0x1d818c-0x0;var _0x399259=_0x8028[_0x1d818c];return _0x399259;};'use strict';var Sequelize=require(_0x8802('0x0'));var _=require(_0x8802('0x1'));module['exports']={'body':{'type':Sequelize[_0x8802('0x2')](_0x8802('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x8802('0x2')](_0x8802('0x4'))},'read':{'type':Sequelize[_0x8802('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8802('0x6')]('in',_0x8802('0x7')),'defaultValue':_0x8802('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0x8802('0x8')](0x1fe)},'from':{'type':Sequelize[_0x8802('0x8')]},'to':{'type':Sequelize[_0x8802('0x2')](_0x8802('0x3'))},'cc':{'type':Sequelize[_0x8802('0x2')](_0x8802('0x3'))},'bcc':{'type':Sequelize[_0x8802('0x2')](_0x8802('0x3'))},'subject':{'type':Sequelize[_0x8802('0x2')]},'sentAt':{'type':Sequelize[_0x8802('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x8802('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x8802('0x3'))},'originCc':{'type':Sequelize[_0x8802('0x2')](_0x8802('0x3'))},'originChannel':{'type':Sequelize[_0x8802('0x6')]('Email',_0x8802('0xa')),'defaultValue':_0x8802('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0x51cf=['exports','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Chat','Email','sequelize','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51cf,0x16a));var _0xf51c=function(_0x3a8443,_0xb2db1f){_0x3a8443=_0x3a8443-0x0;var _0x32e51e=_0x51cf[_0x3a8443];return _0x32e51e;};'use strict';var Sequelize=require(_0xf51c('0x0'));var _=require(_0xf51c('0x1'));module[_0xf51c('0x2')]={'body':{'type':Sequelize[_0xf51c('0x3')](_0xf51c('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xf51c('0x5'))},'read':{'type':Sequelize[_0xf51c('0x6')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf51c('0x7')),'defaultValue':_0xf51c('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf51c('0x8')](0x1fe)},'from':{'type':Sequelize[_0xf51c('0x8')]},'to':{'type':Sequelize[_0xf51c('0x3')](_0xf51c('0x4'))},'cc':{'type':Sequelize[_0xf51c('0x3')](_0xf51c('0x4'))},'bcc':{'type':Sequelize[_0xf51c('0x3')]('long')},'subject':{'type':Sequelize[_0xf51c('0x3')]},'sentAt':{'type':Sequelize[_0xf51c('0x9')]},'attach':{'type':Sequelize[_0xf51c('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf51c('0x9')]},'originTo':{'type':Sequelize[_0xf51c('0x3')](_0xf51c('0x4'))},'originCc':{'type':Sequelize[_0xf51c('0x3')]('long')},'originChannel':{'type':Sequelize[_0xf51c('0xb')]('Email',_0xf51c('0xc')),'defaultValue':_0xf51c('0xd'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 57077c8..f8bf4dc 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 _0xf7bd=['attributes','intersection','length','order','sort','pick','where','VIRTUAL','filter','merge','options','then','includeAll','include','findAll','rows','show','fields','find','update','body','params','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','CloudProvider','getSmtpOptions','attachments','root','basename','List','defaults','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','fullname','manual','interface','SIP/%s','channel','event','accept','fromString','EventManager','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','email','internal','motionChannel','toString','join','server','files','tmp','message-%s.eml','from','bcc','subject','Attachment','Attachments','decode','createdAt','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','type','readFileSync','build','writeFileSync','download','unlinkSync','moment','bluebird','util','path','ioredis','html-to-text','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','limit','undefined','count','offset','set','destroy','end','stack','send','index','map','MailMessage','rawAttributes','fieldName','name','keys','query','filters','model'];(function(_0x6e76f,_0x18dcfd){var _0x5f15ea=function(_0x897169){while(--_0x897169){_0x6e76f['push'](_0x6e76f['shift']());}};_0x5f15ea(++_0x18dcfd);}(_0xf7bd,0x1b8));var _0xdf7b=function(_0x22789a,_0x4a1c8c){_0x22789a=_0x22789a-0x0;var _0xede88=_0xf7bd[_0x22789a];return _0xede88;};'use strict';var emlformat=require('eml-format');var moment=require(_0xdf7b('0x0'));var BPromise=require(_0xdf7b('0x1'));var util=require(_0xdf7b('0x2'));var path=require(_0xdf7b('0x3'));var fs=require('fs');var _=require('lodash');var Redis=require(_0xdf7b('0x4'));var htmlToText=require(_0xdf7b('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xdf7b('0x6'))(_0xdf7b('0x7'));var interaction_log=require(_0xdf7b('0x6'))('mail-interactions');var config=require(_0xdf7b('0x8'));var db=require(_0xdf7b('0x9'))['db'];config[_0xdf7b('0xa')]=_['defaults'](config[_0xdf7b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf7b('0xb'))(new Redis(config[_0xdf7b('0xa')]));var htmlEntities=require('html-entities');require(_0xdf7b('0xc'))[_0xdf7b('0xd')](socket);var jayson=require(_0xdf7b('0xe'));var client=jayson[_0xdf7b('0xf')][_0xdf7b('0x10')]({'port':0x232c});var client9003=jayson[_0xdf7b('0xf')][_0xdf7b('0x10')]({'port':0x232b});var client9002=jayson[_0xdf7b('0xf')][_0xdf7b('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x2a07db,_0x1c92e9,_0x100673,_0x51c6d2){return new BPromise(function(_0x5dc154,_0x3a0c7d){var _0x21919a=_0x51c6d2||client;return _0x21919a[_0xdf7b('0x11')](_0x2a07db,_0x100673)['then'](function(_0xb61f5b){logger[_0xdf7b('0x12')](_0xdf7b('0x13'),_0x1c92e9,_0xdf7b('0x14'));logger['debug'](_0xdf7b('0x15'),_0x1c92e9,_0xdf7b('0x14'),JSON[_0xdf7b('0x16')](_0xb61f5b));if(_0xb61f5b[_0xdf7b('0x17')]){if(_0xb61f5b[_0xdf7b('0x17')][_0xdf7b('0x18')]===0x1f4){logger[_0xdf7b('0x17')](_0xdf7b('0x13'),_0x1c92e9,_0xb61f5b[_0xdf7b('0x17')][_0xdf7b('0x19')]);return _0x3a0c7d(_0xb61f5b[_0xdf7b('0x17')]['message']);}logger[_0xdf7b('0x17')](_0xdf7b('0x13'),_0x1c92e9,_0xb61f5b[_0xdf7b('0x17')][_0xdf7b('0x19')]);return _0x5dc154(_0xb61f5b['error'][_0xdf7b('0x19')]);}else{logger[_0xdf7b('0x12')](_0xdf7b('0x13'),_0x1c92e9,_0xdf7b('0x14'));_0x5dc154(_0xb61f5b[_0xdf7b('0x1a')][_0xdf7b('0x19')]);}})[_0xdf7b('0x1b')](function(_0x503989){logger['error'](_0xdf7b('0x13'),_0x1c92e9,_0x503989);_0x3a0c7d(_0x503989);});});}function respondWithResult(_0xcb9fe,_0x35139c){_0x35139c=_0x35139c||0xc8;return function(_0x5e678f){if(_0x5e678f){return _0xcb9fe[_0xdf7b('0x1c')](_0x35139c)[_0xdf7b('0x1d')](_0x5e678f);}};}function respondWithFilteredResult(_0x5137ee,_0x127a33){return function(_0x39d1c3){if(_0x39d1c3){var _0x4b6de5=typeof _0x127a33['offset']==='undefined'&&typeof _0x127a33[_0xdf7b('0x1e')]===_0xdf7b('0x1f');var _0x2af2c4=_0x39d1c3[_0xdf7b('0x20')];var _0x26e510=_0x4b6de5?0x0:_0x127a33[_0xdf7b('0x21')];var _0x162122=_0x4b6de5?_0x39d1c3[_0xdf7b('0x20')]:_0x127a33[_0xdf7b('0x21')]+_0x127a33[_0xdf7b('0x1e')];var _0x13ab06;if(_0x162122>=_0x2af2c4){_0x162122=_0x2af2c4;_0x13ab06=0xc8;}else{_0x13ab06=0xce;}_0x5137ee[_0xdf7b('0x1c')](_0x13ab06);return _0x5137ee[_0xdf7b('0x22')]('Content-Range',_0x26e510+'-'+_0x162122+'/'+_0x2af2c4)[_0xdf7b('0x1d')](_0x39d1c3);}return null;};}function saveUpdates(_0x2745d7){return function(_0x4e0b50){if(_0x4e0b50){return _0x4e0b50['update'](_0x2745d7)['then'](function(_0x6f1ad8){return _0x6f1ad8;});}return null;};}function removeEntity(_0x2af796){return function(_0x575604){if(_0x575604){return _0x575604[_0xdf7b('0x23')]()['then'](function(){_0x2af796[_0xdf7b('0x1c')](0xcc)[_0xdf7b('0x24')]();});}};}function handleEntityNotFound(_0xfeef4a){return function(_0x5efd18){if(!_0x5efd18){_0xfeef4a['sendStatus'](0x194);}return _0x5efd18;};}function handleError(_0xa7d4af,_0x8249bc){_0x8249bc=_0x8249bc||0x1f4;return function(_0x427245){logger[_0xdf7b('0x17')](_0x427245[_0xdf7b('0x25')]);if(_0x427245['name']){delete _0x427245['name'];}_0xa7d4af[_0xdf7b('0x1c')](_0x8249bc)[_0xdf7b('0x26')](_0x427245);};}exports[_0xdf7b('0x27')]=function(_0x4d4082,_0x553eb0){var _0x2486fa={},_0x155812={},_0x19130b={'count':0x0,'rows':[]};var _0x16166b=_[_0xdf7b('0x28')](db[_0xdf7b('0x29')][_0xdf7b('0x2a')],function(_0x3c14e9){return{'name':_0x3c14e9[_0xdf7b('0x2b')],'type':_0x3c14e9['type']['key']};});_0x155812['model']=_[_0xdf7b('0x28')](_0x16166b,_0xdf7b('0x2c'));_0x155812['query']=_[_0xdf7b('0x2d')](_0x4d4082[_0xdf7b('0x2e')]);_0x155812[_0xdf7b('0x2f')]=_['intersection'](_0x155812[_0xdf7b('0x30')],_0x155812[_0xdf7b('0x2e')]);_0x2486fa[_0xdf7b('0x31')]=_[_0xdf7b('0x32')](_0x155812['model'],qs['fields'](_0x4d4082['query']['fields']));_0x2486fa[_0xdf7b('0x31')]=_0x2486fa['attributes'][_0xdf7b('0x33')]?_0x2486fa[_0xdf7b('0x31')]:_0x155812[_0xdf7b('0x30')];if(!_0x4d4082['query']['hasOwnProperty']('nolimit')){_0x2486fa[_0xdf7b('0x1e')]=qs[_0xdf7b('0x1e')](_0x4d4082[_0xdf7b('0x2e')][_0xdf7b('0x1e')]);_0x2486fa[_0xdf7b('0x21')]=qs['offset'](_0x4d4082[_0xdf7b('0x2e')][_0xdf7b('0x21')]);}_0x2486fa[_0xdf7b('0x34')]=qs[_0xdf7b('0x35')](_0x4d4082[_0xdf7b('0x2e')][_0xdf7b('0x35')]);_0x2486fa['where']=qs[_0xdf7b('0x2f')](_[_0xdf7b('0x36')](_0x4d4082[_0xdf7b('0x2e')],_0x155812['filters']),_0x16166b);if(_0x4d4082['query']['filter']){_0x2486fa[_0xdf7b('0x37')]=_['merge'](_0x2486fa[_0xdf7b('0x37')],{'$or':_[_0xdf7b('0x28')](_0x16166b,function(_0xbdc9c){if(_0xbdc9c['type']!==_0xdf7b('0x38')){var _0x2f242c={};_0x2f242c[_0xbdc9c[_0xdf7b('0x2c')]]={'$like':'%'+_0x4d4082['query'][_0xdf7b('0x39')]+'%'};return _0x2f242c;}})});}_0x2486fa=_[_0xdf7b('0x3a')]({},_0x2486fa,_0x4d4082[_0xdf7b('0x3b')]);var _0x4ae66d={'where':_0x2486fa[_0xdf7b('0x37')]};return db[_0xdf7b('0x29')][_0xdf7b('0x20')](_0x4ae66d)[_0xdf7b('0x3c')](function(_0x29ff7c){_0x19130b[_0xdf7b('0x20')]=_0x29ff7c;if(_0x4d4082[_0xdf7b('0x2e')][_0xdf7b('0x3d')]){_0x2486fa[_0xdf7b('0x3e')]=[{'all':!![]}];}return db[_0xdf7b('0x29')][_0xdf7b('0x3f')](_0x2486fa);})[_0xdf7b('0x3c')](function(_0x49e92c){_0x19130b[_0xdf7b('0x40')]=_0x49e92c;return _0x19130b;})[_0xdf7b('0x3c')](respondWithFilteredResult(_0x553eb0,_0x2486fa))['catch'](handleError(_0x553eb0,null));};exports[_0xdf7b('0x41')]=function(_0x182fc8,_0x488b46){var _0x4aeb87={'raw':!![],'where':{'id':_0x182fc8['params']['id']}},_0x4eeeba={};_0x4eeeba['model']=_[_0xdf7b('0x2d')](db[_0xdf7b('0x29')][_0xdf7b('0x2a')]);_0x4eeeba['query']=_[_0xdf7b('0x2d')](_0x182fc8[_0xdf7b('0x2e')]);_0x4eeeba['filters']=_[_0xdf7b('0x32')](_0x4eeeba[_0xdf7b('0x30')],_0x4eeeba[_0xdf7b('0x2e')]);_0x4aeb87['attributes']=_['intersection'](_0x4eeeba['model'],qs['fields'](_0x182fc8[_0xdf7b('0x2e')][_0xdf7b('0x42')]));_0x4aeb87[_0xdf7b('0x31')]=_0x4aeb87[_0xdf7b('0x31')][_0xdf7b('0x33')]?_0x4aeb87[_0xdf7b('0x31')]:_0x4eeeba[_0xdf7b('0x30')];if(_0x182fc8['query']['includeAll']){_0x4aeb87[_0xdf7b('0x3e')]=[{'all':!![]}];}_0x4aeb87=_['merge']({},_0x4aeb87,_0x182fc8[_0xdf7b('0x3b')]);return db[_0xdf7b('0x29')][_0xdf7b('0x43')](_0x4aeb87)['then'](handleEntityNotFound(_0x488b46,null))['then'](respondWithResult(_0x488b46,null))[_0xdf7b('0x1b')](handleError(_0x488b46,null));};exports[_0xdf7b('0x44')]=function(_0x2f800b,_0x202bb9){if(_0x2f800b[_0xdf7b('0x45')]['id']){delete _0x2f800b['body']['id'];}return db[_0xdf7b('0x29')]['find']({'where':{'id':_0x2f800b[_0xdf7b('0x46')]['id']}})[_0xdf7b('0x3c')](handleEntityNotFound(_0x202bb9,null))['then'](saveUpdates(_0x2f800b['body'],null))['then'](respondWithResult(_0x202bb9,null))[_0xdf7b('0x1b')](handleError(_0x202bb9,null));};exports[_0xdf7b('0x23')]=function(_0x3c2c28,_0x4cada7){return db[_0xdf7b('0x29')][_0xdf7b('0x43')]({'where':{'id':_0x3c2c28[_0xdf7b('0x46')]['id']}})[_0xdf7b('0x3c')](handleEntityNotFound(_0x4cada7,null))[_0xdf7b('0x3c')](removeEntity(_0x4cada7,null))['catch'](handleError(_0x4cada7,null));};exports[_0xdf7b('0x47')]=function(_0x2b592e,_0x45776e){return db['MailMessage']['describe']()[_0xdf7b('0x3c')](respondWithResult(_0x45776e,null))[_0xdf7b('0x1b')](handleError(_0x45776e,null));};exports[_0xdf7b('0x48')]=function(_0x31c9f3,_0x3c3ce7){return db[_0xdf7b('0x29')]['create'](_0x31c9f3[_0xdf7b('0x45')])[_0xdf7b('0x3c')](function(_0x3a8356){if(_0x3a8356){if(_0x3a8356[_0xdf7b('0x49')]===_0xdf7b('0x4a')&&!_0x3a8356[_0xdf7b('0x4b')]){var _0x49b17d,_0x2651d4,_0x210106;if(_0x31c9f3[_0xdf7b('0x45')]['to']){_0x2651d4=_0x31c9f3[_0xdf7b('0x45')]['to'][_0xdf7b('0x4c')](',')[0x0];}return db[_0xdf7b('0x4d')][_0xdf7b('0x4e')]({'where':{'id':_0x3a8356[_0xdf7b('0x4f')]},'include':[{'model':db[_0xdf7b('0x50')],'as':'List','include':[{'model':db[_0xdf7b('0x51')],'as':_0xdf7b('0x52'),'where':{'email':_0x2651d4},'limit':0x1,'order':[[_0xdf7b('0x53'),_0xdf7b('0x54')]]}]},{'model':db['MailServerOut'],'as':_0xdf7b('0x55'),'raw':!![],'include':[{'model':db[_0xdf7b('0x56')],'as':_0xdf7b('0x56'),'raw':!![]}]}]})[_0xdf7b('0x3c')](function(_0x1be239){_0x49b17d=_0x1be239;if(!_0x49b17d||!_0x49b17d['Smtp'])return;var _0x534c2d=_0x49b17d[_0xdf7b('0x57')]();if(_0x31c9f3[_0xdf7b('0x45')]['attachments']&&_0x31c9f3['body'][_0xdf7b('0x58')][_0xdf7b('0x33')]){for(var _0x5a510f=0x0;_0x5a510f<_0x31c9f3[_0xdf7b('0x45')]['attachments'][_0xdf7b('0x33')];_0x5a510f+=0x1){_0x31c9f3[_0xdf7b('0x45')][_0xdf7b('0x58')][_0x5a510f]={'filename':_0x31c9f3['body'][_0xdf7b('0x58')][_0x5a510f][_0xdf7b('0x2c')],'path':path['join'](config[_0xdf7b('0x59')],'server/files/attachments',_0x31c9f3['body'][_0xdf7b('0x58')][_0x5a510f][_0xdf7b('0x5a')])};}}_0x210106={'account':_0x534c2d,'message':_0x31c9f3[_0xdf7b('0x45')]};return;})[_0xdf7b('0x3c')](function(){if(_0x49b17d[_0xdf7b('0x5b')]){if(_0x49b17d['List'][_0xdf7b('0x52')]['length']){return _0x49b17d['List'][_0xdf7b('0x52')][0x0];}else{return db[_0xdf7b('0x51')]['create'](_[_0xdf7b('0x5c')](_0x31c9f3[_0xdf7b('0x45')],{'firstName':_0x31c9f3[_0xdf7b('0x45')]['to'],'email':_0x31c9f3[_0xdf7b('0x45')]['to'],'phone':_0x31c9f3['body']['to'],'ListId':_0x49b17d[_0xdf7b('0x5d')]}));}}else{throw new Error(_0xdf7b('0x5e'));}})['then'](function(){if(_0x210106){return respondWithRpcPromise(_0xdf7b('0x5f'),_0xdf7b('0x60'),_0x210106,client9003)[_0xdf7b('0x3c')](function(_0x3f6cef){return _0x3a8356['update']({'read':!![],'messageId':_0x3f6cef[_0xdf7b('0x61')],'sentAt':moment()[_0xdf7b('0x62')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0xdf7b('0x1b')](function(_0x1ebd92){logger['error']('%s',JSON[_0xdf7b('0x16')](_0x1ebd92));return _0x3a8356;});}return _0x3a8356;});}return _0x3a8356;}})['then'](respondWithResult(_0x3c3ce7,0xc9))[_0xdf7b('0x1b')](handleError(_0x3c3ce7,null));};exports['accept']=function(_0x3d40d5,_0x5ef8ed){var _0x488b90={'agent':{},'channel':'mail'};if(_0x3d40d5[_0xdf7b('0x45')]['id']){delete _0x3d40d5[_0xdf7b('0x45')]['id'];}_0x3d40d5[_0xdf7b('0x45')][_0xdf7b('0x63')]=!![];_0x3d40d5[_0xdf7b('0x45')][_0xdf7b('0x64')]=moment()['format'](_0xdf7b('0x65'));_0x3d40d5[_0xdf7b('0x45')][_0xdf7b('0x66')]=_0x3d40d5[_0xdf7b('0x45')]['UserId']||_0x3d40d5['user']['id'];_0x488b90[_0xdf7b('0x67')]['id']=_0x3d40d5['body'][_0xdf7b('0x66')];return db['MailMessage'][_0xdf7b('0x43')]({'where':{'id':_0x3d40d5[_0xdf7b('0x46')]['id'],'UserId':null}})[_0xdf7b('0x3c')](handleEntityNotFound(_0x5ef8ed,null))[_0xdf7b('0x3c')](saveUpdates(_0x3d40d5[_0xdf7b('0x45')],null))[_0xdf7b('0x3c')](function(_0xe5f6fb){if(_0xe5f6fb){_0x488b90[_0xdf7b('0x19')]=_0xe5f6fb[_0xdf7b('0x68')]({'plain':!![]});return db[_0xdf7b('0x69')][_0xdf7b('0x43')]({'where':{'id':_0xe5f6fb[_0xdf7b('0x6a')]}});}return null;})[_0xdf7b('0x3c')](handleEntityNotFound(_0x5ef8ed,null))['then'](function(_0x91d8f9){if(_0x91d8f9){return _0x91d8f9[_0xdf7b('0x44')]({'UserId':_0x3d40d5['body'][_0xdf7b('0x66')],'read1stAt':_[_0xdf7b('0x6b')](_0x91d8f9[_0xdf7b('0x6c')])?moment()[_0xdf7b('0x62')](_0xdf7b('0x65')):undefined});}return null;})['then'](function(_0x398310){if(_0x398310){_0x488b90[_0xdf7b('0x6d')]=_0x398310['get']({'plain':!![]});interaction_log['info'](_0xdf7b('0x6e'),_0x3d40d5[_0xdf7b('0x6f')]['id'],_0x3d40d5[_0xdf7b('0x6f')][_0xdf7b('0x2c')],_0x3d40d5[_0xdf7b('0x6f')]['role'],_0x488b90['interaction']['id'],_0x3d40d5['body']?JSON['stringify'](_0x3d40d5['body']):_0xdf7b('0x70'));return respondWithRpcPromise(_0xdf7b('0x71'),_0xdf7b('0x72'),_0x488b90);}return null;})['then'](function(_0x6a99f9){var _0xa31196=_0xdf7b('0x73')+_0x6a99f9[_0xdf7b('0x19')][_0xdf7b('0x74')];return db[_0xdf7b('0x75')][_0xdf7b('0x2e')](_0xa31196,{'type':db[_0xdf7b('0x76')]['QueryTypes'][_0xdf7b('0x77')],'raw':!![]})[_0xdf7b('0x3c')](function(_0x1ae495){return _0x1ae495;});})[_0xdf7b('0x3c')](function(_0x13ef16){if(_0x13ef16){_0x488b90[_0xdf7b('0x19')][_0xdf7b('0x78')]=_0x13ef16[0x0];if(!_0x3d40d5[_0xdf7b('0x45')][_0xdf7b('0x66')])return;return db[_0xdf7b('0x79')][_0xdf7b('0x43')]({'where':{'id':_0x3d40d5[_0xdf7b('0x45')][_0xdf7b('0x66')],'role':'agent'},'attributes':['id','name',_0xdf7b('0x7a'),'email','internal'],'raw':!![]});}return null;})[_0xdf7b('0x3c')](function(_0x20a99a){if(!_0x20a99a)return null;_0x488b90[_0xdf7b('0x19')][_0xdf7b('0x67')]=_0x20a99a;return _0x488b90;})[_0xdf7b('0x3c')](function(_0x1b356f){if(_0x1b356f){if(_0x3d40d5['body'][_0xdf7b('0x7b')]){_0x488b90[_0xdf7b('0x19')][_0xdf7b('0x7c')]=util[_0xdf7b('0x62')](_0xdf7b('0x7d'),_0x3d40d5[_0xdf7b('0x6f')][_0xdf7b('0x2c')]);_0x488b90[_0xdf7b('0x19')][_0xdf7b('0x7e')]=_0x488b90[_0xdf7b('0x7e')];_0x488b90['message']['motionChannel']=_0x488b90['channel'];_0x488b90[_0xdf7b('0x19')][_0xdf7b('0x7f')]=_0xdf7b('0x80');_0x488b90[_0xdf7b('0x19')][_0xdf7b('0x45')]=htmlToText[_0xdf7b('0x81')](_0x488b90[_0xdf7b('0x19')][_0xdf7b('0x45')]);return respondWithRpcPromise(_0xdf7b('0x82'),_0xdf7b('0x82'),{'event':'acceptmessage','message':_0x488b90[_0xdf7b('0x19')]},client9002)[_0xdf7b('0x3c')](function(){return _0x488b90;});}return _0x488b90;}return null;})[_0xdf7b('0x3c')](respondWithResult(_0x5ef8ed,null))[_0xdf7b('0x1b')](handleError(_0x5ef8ed,null));};exports[_0xdf7b('0x83')]=function(_0x19a8ce,_0x23c0a6){var _0x64aa52={'agent':{},'channel':_0xdf7b('0x84')};if(_0x19a8ce[_0xdf7b('0x45')]['id']){delete _0x19a8ce[_0xdf7b('0x45')]['id'];}_0x19a8ce[_0xdf7b('0x45')]['UserId']=_0x19a8ce[_0xdf7b('0x45')][_0xdf7b('0x66')]||_0x19a8ce['user']['id'];_0x64aa52[_0xdf7b('0x67')]['id']=_0x19a8ce[_0xdf7b('0x45')][_0xdf7b('0x66')];return db[_0xdf7b('0x29')][_0xdf7b('0x43')]({'where':{'id':_0x19a8ce[_0xdf7b('0x46')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x23c0a6,null))[_0xdf7b('0x3c')](function(_0xec8574){if(_0xec8574){_0x64aa52[_0xdf7b('0x19')]=_0xec8574[_0xdf7b('0x68')]({'plain':!![]});return db[_0xdf7b('0x69')][_0xdf7b('0x43')]({'where':{'id':_0xec8574['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x23c0a6,null))['then'](function(_0x3f5c8e){if(_0x3f5c8e){_0x64aa52[_0xdf7b('0x6d')]=_0x3f5c8e['get']({'plain':!![]});interaction_log['info'](_0xdf7b('0x85'),_0x19a8ce[_0xdf7b('0x6f')]['id'],_0x19a8ce[_0xdf7b('0x6f')][_0xdf7b('0x2c')],_0x19a8ce['user'][_0xdf7b('0x86')],_0x64aa52[_0xdf7b('0x6d')]['id'],_0x19a8ce['body']?JSON['stringify'](_0x19a8ce['body']):_0xdf7b('0x70'));return respondWithRpcPromise(_0xdf7b('0x87'),'rejectMessage',_0x64aa52);}return null;})[_0xdf7b('0x3c')](function(_0x488fc2){var _0x11366e=_0xdf7b('0x73')+_0x488fc2[_0xdf7b('0x19')]['ContactId'];return db[_0xdf7b('0x75')][_0xdf7b('0x2e')](_0x11366e,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x7f79d9){return _0x7f79d9;});})[_0xdf7b('0x3c')](function(_0x543d7b){if(_0x543d7b){_0x64aa52[_0xdf7b('0x19')][_0xdf7b('0x78')]=_0x543d7b[0x0];if(!_0x19a8ce['body']['UserId'])return;return db[_0xdf7b('0x79')][_0xdf7b('0x43')]({'where':{'id':_0x19a8ce['body'][_0xdf7b('0x66')],'role':'agent'},'attributes':['id',_0xdf7b('0x2c'),_0xdf7b('0x7a'),_0xdf7b('0x88'),_0xdf7b('0x89')],'raw':!![]});}return null;})['then'](function(_0x1fb222){if(!_0x1fb222)return null;_0x64aa52['message'][_0xdf7b('0x67')]=_0x1fb222;return _0x64aa52;})[_0xdf7b('0x3c')](function(_0x22d0cb){if(_0x22d0cb){_0x22d0cb[_0xdf7b('0x19')][_0xdf7b('0x7c')]=util['format'](_0xdf7b('0x7d'),_0x19a8ce[_0xdf7b('0x6f')][_0xdf7b('0x2c')]);_0x22d0cb[_0xdf7b('0x19')][_0xdf7b('0x7e')]=_0x64aa52[_0xdf7b('0x7e')];_0x22d0cb[_0xdf7b('0x19')][_0xdf7b('0x8a')]=_0x64aa52['channel'];_0x22d0cb['message'][_0xdf7b('0x7f')]=_0xdf7b('0x83');_0x22d0cb['message'][_0xdf7b('0x45')]=htmlToText[_0xdf7b('0x81')](_0x64aa52[_0xdf7b('0x19')][_0xdf7b('0x45')]);respondWithRpcPromise(_0xdf7b('0x82'),_0xdf7b('0x82'),{'event':'rejectmessage','message':_0x22d0cb['message']},client9002);return _0x64aa52;}return null;})[_0xdf7b('0x3c')](respondWithResult(_0x23c0a6,null))['catch'](handleError(_0x23c0a6,null));};exports['download']=function(_0x4daf26,_0x3bcd87){var _0x235dbd=moment()['unix']()[_0xdf7b('0x8b')]();var _0x55878f=path[_0xdf7b('0x8c')](config[_0xdf7b('0x59')],_0xdf7b('0x8d'),_0xdf7b('0x8e'),_0xdf7b('0x8f'));var _0x5e1b15=path[_0xdf7b('0x8c')](config[_0xdf7b('0x59')],_0xdf7b('0x8d'),_0xdf7b('0x8e'),'attachments');var _0x179ebb=util[_0xdf7b('0x62')](_0xdf7b('0x90'),_0x235dbd);return db[_0xdf7b('0x29')][_0xdf7b('0x43')]({'where':{'id':_0x4daf26[_0xdf7b('0x46')]['id']},'attributes':['id',_0xdf7b('0x45'),_0xdf7b('0x91'),'to','cc',_0xdf7b('0x92'),_0xdf7b('0x93'),'createdAt'],'include':_0x4daf26[_0xdf7b('0x2e')][_0xdf7b('0x58')]?[{'model':db[_0xdf7b('0x94')],'as':_0xdf7b('0x95')}]:undefined})[_0xdf7b('0x3c')](handleEntityNotFound(_0x3bcd87,null))['then'](function(_0x1bc745){if(_0x1bc745){var _0x58bc85=_0x1bc745;var _0x167f0b={'from':_0x58bc85['from'],'to':_0x58bc85['to'],'subject':_0x58bc85['subject'],'html':htmlEntities[_0xdf7b('0x96')](_0x58bc85[_0xdf7b('0x45')]),'headers':{'Date':moment(_0x58bc85[_0xdf7b('0x97')])['format'](_0xdf7b('0x98'))},'attachments':[]};if(_0x1bc745['cc']){_0x167f0b[_0xdf7b('0x99')]['Cc']=_0x1bc745['cc'];}if(_0x1bc745[_0xdf7b('0x92')]){_0x167f0b[_0xdf7b('0x99')][_0xdf7b('0x9a')]=_0x1bc745[_0xdf7b('0x92')];}return new BPromise(function(_0x54f06b,_0x4ce9df){if(_0x1bc745[_0xdf7b('0x95')]){for(var _0x33daf9=0x0;_0x33daf9<_0x1bc745[_0xdf7b('0x95')][_0xdf7b('0x33')];_0x33daf9++){var _0x24fa92=_0x1bc745[_0xdf7b('0x95')][_0x33daf9];var _0x16b284=path[_0xdf7b('0x8c')](_0x5e1b15,_0x24fa92['basename']);if(fs[_0xdf7b('0x9b')](_0x16b284)){_0x167f0b[_0xdf7b('0x58')][_0xdf7b('0x9c')]({'name':_0x24fa92[_0xdf7b('0x2c')],'contentType':_0x24fa92[_0xdf7b('0x9d')],'data':fs[_0xdf7b('0x9e')](_0x16b284)});}}}emlformat[_0xdf7b('0x9f')](_0x167f0b,function(_0x5afbfb,_0x58b97e){if(_0x5afbfb)return _0x4ce9df(_0x5afbfb);fs[_0xdf7b('0xa0')](path[_0xdf7b('0x8c')](_0x55878f,_0x179ebb),_0x58b97e);return _0x54f06b(_0x58b97e);});});}})['then'](function(_0x288b8b){if(_0x288b8b){return _0x3bcd87[_0xdf7b('0xa1')](path[_0xdf7b('0x8c')](_0x55878f,_0x179ebb),_0x179ebb,function(_0x464738){if(!_0x464738)fs[_0xdf7b('0xa2')](path[_0xdf7b('0x8c')](_0x55878f,_0x179ebb));});}})[_0xdf7b('0x1b')](handleError(_0x3bcd87,null));}; \ No newline at end of file +var _0x4d22=['query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','includeAll','include','show','params','options','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','CmList','List','CmContact','DESC','Smtp','CloudProvider','attachments','root','Contacts','ListId','List\x20not\x20found','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','UserId','user','agent','get','MailInteraction','MailInteractionId','[MAILMESSAGE: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','SELECT','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','fromString','EventManager','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','QueryTypes','contact','reject','rejectmessage','download','unix','join','server','files','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','readFileSync','build','unlinkSync','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','redis','defaults','localhost','socket.io-emitter','html-entities','./mailMessage.socket','jayson/promise','http','client','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','json','undefined','limit','count','offset','set','Content-Range','destroy','end','sendStatus','stack','name','index','map','MailMessage','rawAttributes','fieldName','type','key','model','keys'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4d22,0xfc));var _0x24d2=function(_0x15f51c,_0x32bd75){_0x15f51c=_0x15f51c-0x0;var _0x34149e=_0x4d22[_0x15f51c];return _0x34149e;};'use strict';var emlformat=require('eml-format');var moment=require('moment');var BPromise=require('bluebird');var util=require('util');var path=require(_0x24d2('0x0'));var fs=require('fs');var _=require(_0x24d2('0x1'));var Redis=require(_0x24d2('0x2'));var htmlToText=require(_0x24d2('0x3'));var qs=require(_0x24d2('0x4'));var logger=require(_0x24d2('0x5'))(_0x24d2('0x6'));var interaction_log=require(_0x24d2('0x5'))(_0x24d2('0x7'));var config=require(_0x24d2('0x8'));var db=require('../../mysqldb')['db'];config[_0x24d2('0x9')]=_[_0x24d2('0xa')](config[_0x24d2('0x9')],{'host':_0x24d2('0xb'),'port':0x18eb});var socket=require(_0x24d2('0xc'))(new Redis(config['redis']));var htmlEntities=require(_0x24d2('0xd'));require(_0x24d2('0xe'))['register'](socket);var jayson=require(_0x24d2('0xf'));var client=jayson['client'][_0x24d2('0x10')]({'port':0x232c});var client9003=jayson[_0x24d2('0x11')][_0x24d2('0x10')]({'port':0x232b});var client9002=jayson['client'][_0x24d2('0x10')]({'port':0x232a});function respondWithRpcPromise(_0x13ef6c,_0x308732,_0x594399,_0xd212c2){return new BPromise(function(_0x1ef752,_0x13adc4){var _0x4c3098=_0xd212c2||client;return _0x4c3098[_0x24d2('0x12')](_0x13ef6c,_0x594399)[_0x24d2('0x13')](function(_0x1a297a){logger[_0x24d2('0x14')](_0x24d2('0x15'),_0x308732,_0x24d2('0x16'));logger['debug'](_0x24d2('0x17'),_0x308732,_0x24d2('0x16'),JSON['stringify'](_0x1a297a));if(_0x1a297a['error']){if(_0x1a297a[_0x24d2('0x18')][_0x24d2('0x19')]===0x1f4){logger[_0x24d2('0x18')](_0x24d2('0x15'),_0x308732,_0x1a297a['error']['message']);return _0x13adc4(_0x1a297a[_0x24d2('0x18')][_0x24d2('0x1a')]);}logger[_0x24d2('0x18')]('MailMessage,\x20%s,\x20%s',_0x308732,_0x1a297a[_0x24d2('0x18')][_0x24d2('0x1a')]);return _0x1ef752(_0x1a297a[_0x24d2('0x18')][_0x24d2('0x1a')]);}else{logger[_0x24d2('0x14')](_0x24d2('0x15'),_0x308732,'request\x20sent');_0x1ef752(_0x1a297a['result'][_0x24d2('0x1a')]);}})[_0x24d2('0x1b')](function(_0x39f668){logger[_0x24d2('0x18')](_0x24d2('0x15'),_0x308732,_0x39f668);_0x13adc4(_0x39f668);});});}function respondWithResult(_0x517405,_0x4e892f){_0x4e892f=_0x4e892f||0xc8;return function(_0x61b5eb){if(_0x61b5eb){return _0x517405[_0x24d2('0x1c')](_0x4e892f)[_0x24d2('0x1d')](_0x61b5eb);}};}function respondWithFilteredResult(_0x48ed9d,_0x56dbd5){return function(_0x4540f6){if(_0x4540f6){var _0x38736a=typeof _0x56dbd5['offset']===_0x24d2('0x1e')&&typeof _0x56dbd5[_0x24d2('0x1f')]===_0x24d2('0x1e');var _0x2ed40e=_0x4540f6[_0x24d2('0x20')];var _0x12bbd5=_0x38736a?0x0:_0x56dbd5[_0x24d2('0x21')];var _0x5554f3=_0x38736a?_0x4540f6['count']:_0x56dbd5[_0x24d2('0x21')]+_0x56dbd5['limit'];var _0x1dd96b;if(_0x5554f3>=_0x2ed40e){_0x5554f3=_0x2ed40e;_0x1dd96b=0xc8;}else{_0x1dd96b=0xce;}_0x48ed9d['status'](_0x1dd96b);return _0x48ed9d[_0x24d2('0x22')](_0x24d2('0x23'),_0x12bbd5+'-'+_0x5554f3+'/'+_0x2ed40e)[_0x24d2('0x1d')](_0x4540f6);}return null;};}function saveUpdates(_0x1f222b){return function(_0x54eade){if(_0x54eade){return _0x54eade['update'](_0x1f222b)[_0x24d2('0x13')](function(_0x344362){return _0x344362;});}return null;};}function removeEntity(_0x399551){return function(_0xcf153d){if(_0xcf153d){return _0xcf153d[_0x24d2('0x24')]()[_0x24d2('0x13')](function(){_0x399551['status'](0xcc)[_0x24d2('0x25')]();});}};}function handleEntityNotFound(_0x313b3a){return function(_0x89308e){if(!_0x89308e){_0x313b3a[_0x24d2('0x26')](0x194);}return _0x89308e;};}function handleError(_0x392cce,_0x295837){_0x295837=_0x295837||0x1f4;return function(_0x1f07a5){logger[_0x24d2('0x18')](_0x1f07a5[_0x24d2('0x27')]);if(_0x1f07a5[_0x24d2('0x28')]){delete _0x1f07a5[_0x24d2('0x28')];}_0x392cce[_0x24d2('0x1c')](_0x295837)['send'](_0x1f07a5);};}exports[_0x24d2('0x29')]=function(_0xe9370e,_0x44a463){var _0x436a6d={},_0x3bf33a={},_0x47e770={'count':0x0,'rows':[]};var _0x122d7f=_[_0x24d2('0x2a')](db[_0x24d2('0x2b')][_0x24d2('0x2c')],function(_0x154ba9){return{'name':_0x154ba9[_0x24d2('0x2d')],'type':_0x154ba9[_0x24d2('0x2e')][_0x24d2('0x2f')]};});_0x3bf33a[_0x24d2('0x30')]=_[_0x24d2('0x2a')](_0x122d7f,_0x24d2('0x28'));_0x3bf33a['query']=_[_0x24d2('0x31')](_0xe9370e[_0x24d2('0x32')]);_0x3bf33a[_0x24d2('0x33')]=_[_0x24d2('0x34')](_0x3bf33a[_0x24d2('0x30')],_0x3bf33a['query']);_0x436a6d[_0x24d2('0x35')]=_['intersection'](_0x3bf33a[_0x24d2('0x30')],qs[_0x24d2('0x36')](_0xe9370e['query'][_0x24d2('0x36')]));_0x436a6d[_0x24d2('0x35')]=_0x436a6d[_0x24d2('0x35')][_0x24d2('0x37')]?_0x436a6d['attributes']:_0x3bf33a['model'];if(!_0xe9370e[_0x24d2('0x32')]['hasOwnProperty'](_0x24d2('0x38'))){_0x436a6d[_0x24d2('0x1f')]=qs[_0x24d2('0x1f')](_0xe9370e['query']['limit']);_0x436a6d['offset']=qs['offset'](_0xe9370e[_0x24d2('0x32')][_0x24d2('0x21')]);}_0x436a6d['order']=qs['sort'](_0xe9370e[_0x24d2('0x32')][_0x24d2('0x39')]);_0x436a6d[_0x24d2('0x3a')]=qs['filters'](_[_0x24d2('0x3b')](_0xe9370e[_0x24d2('0x32')],_0x3bf33a[_0x24d2('0x33')]),_0x122d7f);if(_0xe9370e[_0x24d2('0x32')][_0x24d2('0x3c')]){_0x436a6d[_0x24d2('0x3a')]=_[_0x24d2('0x3d')](_0x436a6d[_0x24d2('0x3a')],{'$or':_[_0x24d2('0x2a')](_0x122d7f,function(_0x21e5c7){if(_0x21e5c7['type']!=='VIRTUAL'){var _0x40740d={};_0x40740d[_0x21e5c7[_0x24d2('0x28')]]={'$like':'%'+_0xe9370e['query'][_0x24d2('0x3c')]+'%'};return _0x40740d;}})});}_0x436a6d=_[_0x24d2('0x3d')]({},_0x436a6d,_0xe9370e['options']);var _0x43de3b={'where':_0x436a6d[_0x24d2('0x3a')]};return db[_0x24d2('0x2b')][_0x24d2('0x20')](_0x43de3b)[_0x24d2('0x13')](function(_0x5997fe){_0x47e770[_0x24d2('0x20')]=_0x5997fe;if(_0xe9370e[_0x24d2('0x32')][_0x24d2('0x3e')]){_0x436a6d[_0x24d2('0x3f')]=[{'all':!![]}];}return db[_0x24d2('0x2b')]['findAll'](_0x436a6d);})['then'](function(_0x3d2d90){_0x47e770['rows']=_0x3d2d90;return _0x47e770;})[_0x24d2('0x13')](respondWithFilteredResult(_0x44a463,_0x436a6d))[_0x24d2('0x1b')](handleError(_0x44a463,null));};exports[_0x24d2('0x40')]=function(_0x27f3d1,_0x12653a){var _0x2e673f={'raw':!![],'where':{'id':_0x27f3d1[_0x24d2('0x41')]['id']}},_0x2535fb={};_0x2535fb[_0x24d2('0x30')]=_['keys'](db[_0x24d2('0x2b')][_0x24d2('0x2c')]);_0x2535fb[_0x24d2('0x32')]=_[_0x24d2('0x31')](_0x27f3d1['query']);_0x2535fb['filters']=_[_0x24d2('0x34')](_0x2535fb[_0x24d2('0x30')],_0x2535fb[_0x24d2('0x32')]);_0x2e673f[_0x24d2('0x35')]=_[_0x24d2('0x34')](_0x2535fb[_0x24d2('0x30')],qs[_0x24d2('0x36')](_0x27f3d1['query'][_0x24d2('0x36')]));_0x2e673f[_0x24d2('0x35')]=_0x2e673f[_0x24d2('0x35')][_0x24d2('0x37')]?_0x2e673f['attributes']:_0x2535fb[_0x24d2('0x30')];if(_0x27f3d1['query']['includeAll']){_0x2e673f['include']=[{'all':!![]}];}_0x2e673f=_[_0x24d2('0x3d')]({},_0x2e673f,_0x27f3d1[_0x24d2('0x42')]);return db[_0x24d2('0x2b')][_0x24d2('0x43')](_0x2e673f)[_0x24d2('0x13')](handleEntityNotFound(_0x12653a,null))[_0x24d2('0x13')](respondWithResult(_0x12653a,null))['catch'](handleError(_0x12653a,null));};exports[_0x24d2('0x44')]=function(_0x3574c4,_0x2540ae){if(_0x3574c4[_0x24d2('0x45')]['id']){delete _0x3574c4[_0x24d2('0x45')]['id'];}return db[_0x24d2('0x2b')][_0x24d2('0x43')]({'where':{'id':_0x3574c4[_0x24d2('0x41')]['id']}})[_0x24d2('0x13')](handleEntityNotFound(_0x2540ae,null))[_0x24d2('0x13')](saveUpdates(_0x3574c4['body'],null))[_0x24d2('0x13')](respondWithResult(_0x2540ae,null))[_0x24d2('0x1b')](handleError(_0x2540ae,null));};exports[_0x24d2('0x24')]=function(_0x567a83,_0x7e8b6f){return db[_0x24d2('0x2b')][_0x24d2('0x43')]({'where':{'id':_0x567a83[_0x24d2('0x41')]['id']}})[_0x24d2('0x13')](handleEntityNotFound(_0x7e8b6f,null))[_0x24d2('0x13')](removeEntity(_0x7e8b6f,null))[_0x24d2('0x1b')](handleError(_0x7e8b6f,null));};exports['describe']=function(_0x59acca,_0x309964){return db[_0x24d2('0x2b')][_0x24d2('0x46')]()[_0x24d2('0x13')](respondWithResult(_0x309964,null))[_0x24d2('0x1b')](handleError(_0x309964,null));};exports[_0x24d2('0x47')]=function(_0x2e8b0e,_0x5e58b9){return db[_0x24d2('0x2b')]['create'](_0x2e8b0e['body'])[_0x24d2('0x13')](function(_0x178a74){if(_0x178a74){if(_0x178a74[_0x24d2('0x48')]===_0x24d2('0x49')&&!_0x178a74[_0x24d2('0x4a')]){var _0x3ee26f,_0x2eb40c,_0xeaf02b;if(_0x2e8b0e[_0x24d2('0x45')]['to']){_0x2eb40c=_0x2e8b0e[_0x24d2('0x45')]['to'][_0x24d2('0x4b')](',')[0x0];}return db[_0x24d2('0x4c')][_0x24d2('0x4d')]({'where':{'id':_0x178a74['MailAccountId']},'include':[{'model':db[_0x24d2('0x4e')],'as':_0x24d2('0x4f'),'include':[{'model':db[_0x24d2('0x50')],'as':'Contacts','where':{'email':_0x2eb40c},'limit':0x1,'order':[['updatedAt',_0x24d2('0x51')]]}]},{'model':db['MailServerOut'],'as':_0x24d2('0x52'),'raw':!![],'include':[{'model':db[_0x24d2('0x53')],'as':_0x24d2('0x53'),'raw':!![]}]}]})[_0x24d2('0x13')](function(_0x1bbad1){_0x3ee26f=_0x1bbad1;if(!_0x3ee26f||!_0x3ee26f[_0x24d2('0x52')])return;var _0x41664f=_0x3ee26f['getSmtpOptions']();if(_0x2e8b0e[_0x24d2('0x45')][_0x24d2('0x54')]&&_0x2e8b0e[_0x24d2('0x45')][_0x24d2('0x54')][_0x24d2('0x37')]){for(var _0x4781ca=0x0;_0x4781ca<_0x2e8b0e[_0x24d2('0x45')][_0x24d2('0x54')][_0x24d2('0x37')];_0x4781ca+=0x1){_0x2e8b0e['body'][_0x24d2('0x54')][_0x4781ca]={'filename':_0x2e8b0e[_0x24d2('0x45')][_0x24d2('0x54')][_0x4781ca][_0x24d2('0x28')],'path':path['join'](config[_0x24d2('0x55')],'server/files/attachments',_0x2e8b0e['body'][_0x24d2('0x54')][_0x4781ca]['basename'])};}}_0xeaf02b={'account':_0x41664f,'message':_0x2e8b0e[_0x24d2('0x45')]};return;})['then'](function(){if(_0x3ee26f[_0x24d2('0x4f')]){if(_0x3ee26f['List'][_0x24d2('0x56')][_0x24d2('0x37')]){return _0x3ee26f[_0x24d2('0x4f')]['Contacts'][0x0];}else{return db[_0x24d2('0x50')]['create'](_[_0x24d2('0xa')](_0x2e8b0e[_0x24d2('0x45')],{'firstName':_0x2e8b0e[_0x24d2('0x45')]['to'],'email':_0x2e8b0e[_0x24d2('0x45')]['to'],'phone':_0x2e8b0e[_0x24d2('0x45')]['to'],'ListId':_0x3ee26f[_0x24d2('0x57')]}));}}else{throw new Error(_0x24d2('0x58'));}})['then'](function(){if(_0xeaf02b){return respondWithRpcPromise(_0x24d2('0x59'),'sendMail',_0xeaf02b,client9003)[_0x24d2('0x13')](function(_0x544acb){return _0x178a74[_0x24d2('0x44')]({'read':!![],'messageId':_0x544acb[_0x24d2('0x5a')],'sentAt':moment()[_0x24d2('0x5b')](_0x24d2('0x5c'))});})[_0x24d2('0x1b')](function(_0x5e2742){logger['error']('%s',JSON['stringify'](_0x5e2742));return _0x178a74;});}return _0x178a74;});}return _0x178a74;}})[_0x24d2('0x13')](respondWithResult(_0x5e58b9,0xc9))[_0x24d2('0x1b')](handleError(_0x5e58b9,null));};exports[_0x24d2('0x5d')]=function(_0x51d716,_0x2b44cb){var _0xb6d40a={'agent':{},'channel':_0x24d2('0x5e')};if(_0x51d716[_0x24d2('0x45')]['id']){delete _0x51d716['body']['id'];}_0x51d716[_0x24d2('0x45')][_0x24d2('0x5f')]=!![];_0x51d716['body']['readAt']=moment()[_0x24d2('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x51d716['body'][_0x24d2('0x60')]=_0x51d716[_0x24d2('0x45')][_0x24d2('0x60')]||_0x51d716[_0x24d2('0x61')]['id'];_0xb6d40a[_0x24d2('0x62')]['id']=_0x51d716[_0x24d2('0x45')][_0x24d2('0x60')];return db[_0x24d2('0x2b')][_0x24d2('0x43')]({'where':{'id':_0x51d716[_0x24d2('0x41')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2b44cb,null))[_0x24d2('0x13')](saveUpdates(_0x51d716[_0x24d2('0x45')],null))[_0x24d2('0x13')](function(_0x53afa9){if(_0x53afa9){_0xb6d40a[_0x24d2('0x1a')]=_0x53afa9[_0x24d2('0x63')]({'plain':!![]});return db[_0x24d2('0x64')][_0x24d2('0x43')]({'where':{'id':_0x53afa9[_0x24d2('0x65')]}});}return null;})[_0x24d2('0x13')](handleEntityNotFound(_0x2b44cb,null))[_0x24d2('0x13')](function(_0x5c5b83){if(_0x5c5b83){return _0x5c5b83[_0x24d2('0x44')]({'UserId':_0x51d716[_0x24d2('0x45')][_0x24d2('0x60')],'read1stAt':_['isNil'](_0x5c5b83['read1stAt'])?moment()[_0x24d2('0x5b')](_0x24d2('0x5c')):undefined});}return null;})[_0x24d2('0x13')](function(_0x1474b0){if(_0x1474b0){_0xb6d40a['interaction']=_0x1474b0[_0x24d2('0x63')]({'plain':!![]});interaction_log['info'](_0x24d2('0x66'),_0x51d716[_0x24d2('0x61')]['id'],_0x51d716[_0x24d2('0x61')][_0x24d2('0x28')],_0x51d716[_0x24d2('0x61')][_0x24d2('0x67')],_0xb6d40a[_0x24d2('0x68')]['id'],_0x51d716[_0x24d2('0x45')]?JSON[_0x24d2('0x69')](_0x51d716['body']):_0x24d2('0x6a'));return respondWithRpcPromise(_0x24d2('0x6b'),_0x24d2('0x6c'),_0xb6d40a);}return null;})[_0x24d2('0x13')](function(_0x5954f8){var _0x3b1280=_0x24d2('0x6d')+_0x5954f8[_0x24d2('0x1a')][_0x24d2('0x6e')];return db[_0x24d2('0x6f')]['query'](_0x3b1280,{'type':db[_0x24d2('0x70')]['QueryTypes'][_0x24d2('0x71')],'raw':!![]})[_0x24d2('0x13')](function(_0x992737){return _0x992737;});})[_0x24d2('0x13')](function(_0x427d80){if(_0x427d80){_0xb6d40a[_0x24d2('0x1a')]['contact']=_0x427d80[0x0];if(!_0x51d716[_0x24d2('0x45')][_0x24d2('0x60')])return;return db[_0x24d2('0x72')]['find']({'where':{'id':_0x51d716[_0x24d2('0x45')][_0x24d2('0x60')],'role':_0x24d2('0x62')},'attributes':['id',_0x24d2('0x28'),_0x24d2('0x73'),_0x24d2('0x74'),_0x24d2('0x75')],'raw':!![]});}return null;})[_0x24d2('0x13')](function(_0x9f1254){if(!_0x9f1254)return null;_0xb6d40a[_0x24d2('0x1a')][_0x24d2('0x62')]=_0x9f1254;return _0xb6d40a;})[_0x24d2('0x13')](function(_0x351c24){if(_0x351c24){if(_0x51d716['body'][_0x24d2('0x76')]){_0xb6d40a[_0x24d2('0x1a')]['interface']=util[_0x24d2('0x5b')](_0x24d2('0x77'),_0x51d716[_0x24d2('0x61')][_0x24d2('0x28')]);_0xb6d40a[_0x24d2('0x1a')][_0x24d2('0x78')]=_0xb6d40a[_0x24d2('0x78')];_0xb6d40a[_0x24d2('0x1a')][_0x24d2('0x79')]=_0xb6d40a[_0x24d2('0x78')];_0xb6d40a[_0x24d2('0x1a')][_0x24d2('0x7a')]=_0x24d2('0x5d');_0xb6d40a[_0x24d2('0x1a')][_0x24d2('0x45')]=htmlToText[_0x24d2('0x7b')](_0xb6d40a[_0x24d2('0x1a')][_0x24d2('0x45')]);return respondWithRpcPromise(_0x24d2('0x7c'),_0x24d2('0x7c'),{'event':'acceptmessage','message':_0xb6d40a[_0x24d2('0x1a')]},client9002)['then'](function(){return _0xb6d40a;});}return _0xb6d40a;}return null;})[_0x24d2('0x13')](respondWithResult(_0x2b44cb,null))[_0x24d2('0x1b')](handleError(_0x2b44cb,null));};exports['reject']=function(_0x6c7cf4,_0x1bec6a){var _0x1c9007={'agent':{},'channel':_0x24d2('0x5e')};if(_0x6c7cf4[_0x24d2('0x45')]['id']){delete _0x6c7cf4['body']['id'];}_0x6c7cf4[_0x24d2('0x45')][_0x24d2('0x60')]=_0x6c7cf4[_0x24d2('0x45')]['UserId']||_0x6c7cf4[_0x24d2('0x61')]['id'];_0x1c9007[_0x24d2('0x62')]['id']=_0x6c7cf4[_0x24d2('0x45')][_0x24d2('0x60')];return db[_0x24d2('0x2b')]['find']({'where':{'id':_0x6c7cf4[_0x24d2('0x41')]['id'],'UserId':null}})[_0x24d2('0x13')](handleEntityNotFound(_0x1bec6a,null))['then'](function(_0x48aaa3){if(_0x48aaa3){_0x1c9007[_0x24d2('0x1a')]=_0x48aaa3[_0x24d2('0x63')]({'plain':!![]});return db['MailInteraction'][_0x24d2('0x43')]({'where':{'id':_0x48aaa3[_0x24d2('0x65')]}});}return null;})[_0x24d2('0x13')](handleEntityNotFound(_0x1bec6a,null))[_0x24d2('0x13')](function(_0x531cba){if(_0x531cba){_0x1c9007[_0x24d2('0x68')]=_0x531cba[_0x24d2('0x63')]({'plain':!![]});interaction_log[_0x24d2('0x14')](_0x24d2('0x7d'),_0x6c7cf4[_0x24d2('0x61')]['id'],_0x6c7cf4[_0x24d2('0x61')][_0x24d2('0x28')],_0x6c7cf4[_0x24d2('0x61')][_0x24d2('0x67')],_0x1c9007[_0x24d2('0x68')]['id'],_0x6c7cf4[_0x24d2('0x45')]?JSON['stringify'](_0x6c7cf4[_0x24d2('0x45')]):_0x24d2('0x6a'));return respondWithRpcPromise('RejectMessage',_0x24d2('0x7e'),_0x1c9007);}return null;})[_0x24d2('0x13')](function(_0x31bf15){var _0x2a230e=_0x24d2('0x6d')+_0x31bf15[_0x24d2('0x1a')][_0x24d2('0x6e')];return db[_0x24d2('0x6f')][_0x24d2('0x32')](_0x2a230e,{'type':db[_0x24d2('0x70')][_0x24d2('0x7f')][_0x24d2('0x71')],'raw':!![]})[_0x24d2('0x13')](function(_0x131f54){return _0x131f54;});})['then'](function(_0x340042){if(_0x340042){_0x1c9007[_0x24d2('0x1a')][_0x24d2('0x80')]=_0x340042[0x0];if(!_0x6c7cf4['body'][_0x24d2('0x60')])return;return db[_0x24d2('0x72')][_0x24d2('0x43')]({'where':{'id':_0x6c7cf4[_0x24d2('0x45')][_0x24d2('0x60')],'role':_0x24d2('0x62')},'attributes':['id',_0x24d2('0x28'),_0x24d2('0x73'),_0x24d2('0x74'),_0x24d2('0x75')],'raw':!![]});}return null;})[_0x24d2('0x13')](function(_0x4063e8){if(!_0x4063e8)return null;_0x1c9007[_0x24d2('0x1a')][_0x24d2('0x62')]=_0x4063e8;return _0x1c9007;})[_0x24d2('0x13')](function(_0x2cfeda){if(_0x2cfeda){_0x2cfeda['message']['interface']=util[_0x24d2('0x5b')](_0x24d2('0x77'),_0x6c7cf4['user'][_0x24d2('0x28')]);_0x2cfeda[_0x24d2('0x1a')][_0x24d2('0x78')]=_0x1c9007[_0x24d2('0x78')];_0x2cfeda[_0x24d2('0x1a')][_0x24d2('0x79')]=_0x1c9007[_0x24d2('0x78')];_0x2cfeda[_0x24d2('0x1a')][_0x24d2('0x7a')]=_0x24d2('0x81');_0x2cfeda[_0x24d2('0x1a')][_0x24d2('0x45')]=htmlToText[_0x24d2('0x7b')](_0x1c9007[_0x24d2('0x1a')][_0x24d2('0x45')]);respondWithRpcPromise(_0x24d2('0x7c'),_0x24d2('0x7c'),{'event':_0x24d2('0x82'),'message':_0x2cfeda[_0x24d2('0x1a')]},client9002);return _0x1c9007;}return null;})['then'](respondWithResult(_0x1bec6a,null))[_0x24d2('0x1b')](handleError(_0x1bec6a,null));};exports[_0x24d2('0x83')]=function(_0x5532f9,_0x5712ff){var _0x271073=moment()[_0x24d2('0x84')]()['toString']();var _0x4fd6b8=path[_0x24d2('0x85')](config['root'],_0x24d2('0x86'),'files','tmp');var _0x5d0f32=path[_0x24d2('0x85')](config[_0x24d2('0x55')],'server',_0x24d2('0x87'),_0x24d2('0x54'));var _0x3ae685=util[_0x24d2('0x5b')]('message-%s.eml',_0x271073);return db[_0x24d2('0x2b')][_0x24d2('0x43')]({'where':{'id':_0x5532f9[_0x24d2('0x41')]['id']},'attributes':['id',_0x24d2('0x45'),_0x24d2('0x88'),'to','cc','bcc',_0x24d2('0x89'),_0x24d2('0x8a')],'include':_0x5532f9[_0x24d2('0x32')]['attachments']?[{'model':db[_0x24d2('0x8b')],'as':_0x24d2('0x8c')}]:undefined})[_0x24d2('0x13')](handleEntityNotFound(_0x5712ff,null))['then'](function(_0x145a12){if(_0x145a12){var _0xa791bc=_0x145a12;var _0x55bd03={'from':_0xa791bc[_0x24d2('0x88')],'to':_0xa791bc['to'],'subject':_0xa791bc[_0x24d2('0x89')],'html':htmlEntities[_0x24d2('0x8d')](_0xa791bc[_0x24d2('0x45')]),'headers':{'Date':moment(_0xa791bc[_0x24d2('0x8a')])['format'](_0x24d2('0x8e'))},'attachments':[]};if(_0x145a12['cc']){_0x55bd03[_0x24d2('0x8f')]['Cc']=_0x145a12['cc'];}if(_0x145a12[_0x24d2('0x90')]){_0x55bd03[_0x24d2('0x8f')][_0x24d2('0x91')]=_0x145a12[_0x24d2('0x90')];}return new BPromise(function(_0x3cafbb,_0x1c1947){if(_0x145a12[_0x24d2('0x8c')]){for(var _0x1cf149=0x0;_0x1cf149<_0x145a12[_0x24d2('0x8c')]['length'];_0x1cf149++){var _0x3a2f46=_0x145a12[_0x24d2('0x8c')][_0x1cf149];var _0x1f6bd0=path[_0x24d2('0x85')](_0x5d0f32,_0x3a2f46['basename']);if(fs[_0x24d2('0x92')](_0x1f6bd0)){_0x55bd03[_0x24d2('0x54')][_0x24d2('0x93')]({'name':_0x3a2f46[_0x24d2('0x28')],'contentType':_0x3a2f46[_0x24d2('0x2e')],'data':fs[_0x24d2('0x94')](_0x1f6bd0)});}}}emlformat[_0x24d2('0x95')](_0x55bd03,function(_0x26c5d8,_0x33eedc){if(_0x26c5d8)return _0x1c1947(_0x26c5d8);fs['writeFileSync'](path[_0x24d2('0x85')](_0x4fd6b8,_0x3ae685),_0x33eedc);return _0x3cafbb(_0x33eedc);});});}})[_0x24d2('0x13')](function(_0x5474c9){if(_0x5474c9){return _0x5712ff['download'](path['join'](_0x4fd6b8,_0x3ae685),_0x3ae685,function(_0x2e4d3f){if(!_0x2e4d3f)fs[_0x24d2('0x96')](path[_0x24d2('0x85')](_0x4fd6b8,_0x3ae685));});}})[_0x24d2('0x1b')](handleError(_0x5712ff,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index e529356..13c156e 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 _0xddce=['remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update'];(function(_0x243f67,_0x27f3be){var _0x1d4b6f=function(_0x5e5fc7){while(--_0x5e5fc7){_0x243f67['push'](_0x243f67['shift']());}};_0x1d4b6f(++_0x27f3be);}(_0xddce,0x1bc));var _0xeddc=function(_0x261676,_0x22e3c7){_0x261676=_0x261676-0x0;var _0x4762b5=_0xddce[_0x261676];return _0x4762b5;};'use strict';var EventEmitter=require(_0xeddc('0x0'));var MailMessage=require(_0xeddc('0x1'))['db'][_0xeddc('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xeddc('0x3')](0x0);var events={'afterCreate':_0xeddc('0x4'),'afterUpdate':_0xeddc('0x5'),'afterDestroy':_0xeddc('0x6')};function emitEvent(_0x308452){return function(_0xc199d4,_0x4e45fc,_0x3da9b9){MailMessageEvents[_0xeddc('0x7')](_0x308452+':'+_0xc199d4['id'],_0xc199d4);MailMessageEvents[_0xeddc('0x7')](_0x308452,_0xc199d4);_0x3da9b9(null);};}for(var e in events){if(events[_0xeddc('0x8')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0xeddc('0x9')]=MailMessageEvents; \ No newline at end of file +var _0x26df=['remove','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save'];(function(_0x1bf735,_0x242b6e){var _0x4237d2=function(_0x30f42f){while(--_0x30f42f){_0x1bf735['push'](_0x1bf735['shift']());}};_0x4237d2(++_0x242b6e);}(_0x26df,0x143));var _0xf26d=function(_0x267c52,_0x3c0df3){_0x267c52=_0x267c52-0x0;var _0x46c47b=_0x26df[_0x267c52];return _0x46c47b;};'use strict';var EventEmitter=require(_0xf26d('0x0'));var MailMessage=require(_0xf26d('0x1'))['db'][_0xf26d('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0xf26d('0x3')](0x0);var events={'afterCreate':_0xf26d('0x4'),'afterUpdate':'update','afterDestroy':_0xf26d('0x5')};function emitEvent(_0x3aabb1){return function(_0x4ca828,_0x4d89fd,_0x4beede){MailMessageEvents['emit'](_0x3aabb1+':'+_0x4ca828['id'],_0x4ca828);MailMessageEvents['emit'](_0x3aabb1,_0x4ca828);_0x4beede(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0xf26d('0x6')](e,emitEvent(event));}}module[_0xf26d('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 8e23bfd..8d66d43 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 _0x4903=['then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','rimraf','./mailMessage.attributes','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','subject','fromString','models','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','MailInteractionId'];(function(_0x5a7618,_0x3f44c2){var _0x12dc65=function(_0x3cc4cd){while(--_0x3cc4cd){_0x5a7618['push'](_0x5a7618['shift']());}};_0x12dc65(++_0x3f44c2);}(_0x4903,0xcc));var _0x3490=function(_0x5a7c5a,_0x3f18ca){_0x5a7c5a=_0x5a7c5a-0x0;var _0x4eb1aa=_0x4903[_0x5a7c5a];return _0x4eb1aa;};'use strict';var _=require(_0x3490('0x0'));var util=require(_0x3490('0x1'));var logger=require(_0x3490('0x2'))(_0x3490('0x3'));var moment=require(_0x3490('0x4'));var BPromise=require('bluebird');var rp=require(_0x3490('0x5'));var htmlToText=require(_0x3490('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3490('0x7'));var config=require('../../config/environment');var attributes=require(_0x3490('0x8'));module[_0x3490('0x9')]=function(_0x56413b,_0x4e3414){return _0x56413b[_0x3490('0xa')](_0x3490('0xb'),attributes,{'tableName':_0x3490('0xc'),'paranoid':![],'indexes':[{'name':_0x3490('0xd'),'fields':['messageId']},{'name':_0x3490('0xe'),'fields':['plainBody',_0x3490('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x342b63,_0x18449a,_0x17035d){if(_0x342b63['body']){_0x342b63['plainBody']=htmlToText[_0x3490('0x10')](_0x342b63['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x17035d(null,_0x18449a);},'afterCreate':function(_0x3edea3,_0xf67a26,_0x9bce3c){var _0x2e9451=_0x56413b[_0x3490('0x11')];var _0x20255b=_0x3edea3[_0x3490('0x12')]({'plain':!![]});if(_0x20255b[_0x3490('0x13')][_0x3490('0x14')]()==='in'||_0x20255b[_0x3490('0x13')][_0x3490('0x14')]()===_0x3490('0x15')&&!_0x20255b[_0x3490('0x16')]&&!_[_0x3490('0x17')](_0x20255b[_0x3490('0x18')])){_0x2e9451[_0x3490('0x19')]['findOne']({'where':{'id':_0x20255b[_0x3490('0x1a')]}})[_0x3490('0x1b')](function(_0x8f80fd){if(_0x8f80fd){_0x8f80fd[_0x3490('0x1c')]({'lastMsgAt':_0x20255b['createdAt'],'lastMsgDirection':_0x20255b[_0x3490('0x13')][_0x3490('0x14')]()});}})[_0x3490('0x1d')](function(_0xbb5c9f){console[_0x3490('0x1e')](_0xbb5c9f);});}_0x9bce3c();}},'charset':_0x3490('0x1f'),'collate':_0x3490('0x20')});}; \ No newline at end of file +var _0x2d75=['exports','define','MailMessage','messageId','fti_mail_messages','plainBody','subject','body','get','direction','toLowerCase','out','isNil','findOne','MailInteractionId','then','update','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2d75,0xc3));var _0x52d7=function(_0x18f6ee,_0x241f93){_0x18f6ee=_0x18f6ee-0x0;var _0x42ac3f=_0x2d75[_0x18f6ee];return _0x42ac3f;};'use strict';var _=require('lodash');var util=require(_0x52d7('0x0'));var logger=require(_0x52d7('0x1'))(_0x52d7('0x2'));var moment=require(_0x52d7('0x3'));var BPromise=require(_0x52d7('0x4'));var rp=require(_0x52d7('0x5'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require('path');var rimraf=require(_0x52d7('0x6'));var config=require(_0x52d7('0x7'));var attributes=require('./mailMessage.attributes');module[_0x52d7('0x8')]=function(_0x55e7b2,_0x193060){return _0x55e7b2[_0x52d7('0x9')](_0x52d7('0xa'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x52d7('0xb'),'fields':['messageId']},{'name':_0x52d7('0xc'),'fields':[_0x52d7('0xd'),_0x52d7('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x13f277,_0x4c4c90,_0x5ea4af){if(_0x13f277[_0x52d7('0xf')]){_0x13f277[_0x52d7('0xd')]=htmlToText['fromString'](_0x13f277[_0x52d7('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5ea4af(null,_0x4c4c90);},'afterCreate':function(_0x1fa47c,_0xf23ea9,_0x5a2241){var _0x5902f7=_0x55e7b2['models'];var _0x1d4848=_0x1fa47c[_0x52d7('0x10')]({'plain':!![]});if(_0x1d4848[_0x52d7('0x11')][_0x52d7('0x12')]()==='in'||_0x1d4848[_0x52d7('0x11')]['toLowerCase']()===_0x52d7('0x13')&&!_0x1d4848['secret']&&!_[_0x52d7('0x14')](_0x1d4848['UserId'])){_0x5902f7['MailInteraction'][_0x52d7('0x15')]({'where':{'id':_0x1d4848[_0x52d7('0x16')]}})[_0x52d7('0x17')](function(_0x44853c){if(_0x44853c){_0x44853c[_0x52d7('0x18')]({'lastMsgAt':_0x1d4848[_0x52d7('0x19')],'lastMsgDirection':_0x1d4848[_0x52d7('0x11')][_0x52d7('0x12')]()});}})[_0x52d7('0x1a')](function(_0x4a2d77){console['error'](_0x4a2d77);});}_0x5a2241();}},'charset':_0x52d7('0x1b'),'collate':_0x52d7('0x1c')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 1a890a5..3d445c5 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 _0x5c3c=['../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateMailMessage','MailMessage','create','options','raw','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5d4a21,_0x3c715d){var _0x4336a4=function(_0x920a50){while(--_0x920a50){_0x5d4a21['push'](_0x5d4a21['shift']());}};_0x4336a4(++_0x3c715d);}(_0x5c3c,0x132));var _0xc5c3=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x5c3c[_0x4243a3];return _0x1b2a33;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xc5c3('0xd'),'port':0x18eb});var socket=require(_0xc5c3('0xe'))(new Redis(config['redis']));require(_0xc5c3('0xf'))[_0xc5c3('0x10')](socket);function respondWithRpcPromise(_0x52f3eb,_0x14140f,_0x2a1d19){return new BPromise(function(_0x4e329f,_0x1f2e34){return client[_0xc5c3('0x11')](_0x52f3eb,_0x2a1d19)[_0xc5c3('0x12')](function(_0x59fb60){logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,'request\x20sent');logger[_0xc5c3('0x15')](_0xc5c3('0x16'),_0x14140f,_0xc5c3('0x17'),JSON['stringify'](_0x59fb60));if(_0x59fb60[_0xc5c3('0x18')]){if(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x19')]===0x1f4){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x1f2e34(_0x59fb60[_0xc5c3('0x18')][_0xc5c3('0x1a')]);}logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x59fb60['error']['message']);return _0x4e329f(_0x59fb60[_0xc5c3('0x18')]['message']);}else{logger[_0xc5c3('0x13')](_0xc5c3('0x14'),_0x14140f,_0xc5c3('0x17'));_0x4e329f(_0x59fb60[_0xc5c3('0x1b')][_0xc5c3('0x1a')]);}})['catch'](function(_0x364f42){logger[_0xc5c3('0x18')](_0xc5c3('0x14'),_0x14140f,_0x364f42);_0x1f2e34(_0x364f42);});});}exports[_0xc5c3('0x1c')]=function(_0x4e570f){var _0x25ef16=this;return new Promise(function(_0x41578a,_0x3cc612){return db[_0xc5c3('0x1d')][_0xc5c3('0x1e')](_0x4e570f['body'],{'raw':_0x4e570f[_0xc5c3('0x1f')]?_0x4e570f[_0xc5c3('0x1f')][_0xc5c3('0x20')]===undefined?!![]:![]:!![]})[_0xc5c3('0x12')](function(_0x1c5793){logger[_0xc5c3('0x13')](_0xc5c3('0x1c'),_0x4e570f);logger['debug']('CreateMailMessage',_0x4e570f,JSON[_0xc5c3('0x21')](_0x1c5793));_0x41578a(_0x1c5793);})[_0xc5c3('0x22')](function(_0x53ab72){logger['error'](_0xc5c3('0x1c'),_0x53ab72[_0xc5c3('0x1a')],_0x4e570f);_0x3cc612(_0x25ef16[_0xc5c3('0x18')](0x1f4,_0x53ab72['message']));});});}; \ No newline at end of file +var _0x0972=['message','catch','CreateMailMessage','MailMessage','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailMessage.socket','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x351be4,_0x2d1332){var _0x192da5=function(_0x3e0e25){while(--_0x3e0e25){_0x351be4['push'](_0x351be4['shift']());}};_0x192da5(++_0x2d1332);}(_0x0972,0x64));var _0x2097=function(_0x20257c,_0x392ba9){_0x20257c=_0x20257c-0x0;var _0x2db5a6=_0x0972[_0x20257c];return _0x2db5a6;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var moment=require('moment');var BPromise=require(_0x2097('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2097('0x2'));var db=require(_0x2097('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x2097('0x4'))(_0x2097('0x5'));var config=require(_0x2097('0x6'));var jayson=require(_0x2097('0x7'));var client=jayson[_0x2097('0x8')][_0x2097('0x9')]({'port':0x232a});config[_0x2097('0xa')]=_['defaults'](config[_0x2097('0xa')],{'host':_0x2097('0xb'),'port':0x18eb});var socket=require(_0x2097('0xc'))(new Redis(config[_0x2097('0xa')]));require(_0x2097('0xd'))['register'](socket);function respondWithRpcPromise(_0x2e0024,_0x3b8b76,_0x131f06){return new BPromise(function(_0x430754,_0x7baeb3){return client[_0x2097('0xe')](_0x2e0024,_0x131f06)[_0x2097('0xf')](function(_0x1d1166){logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));logger[_0x2097('0x13')](_0x2097('0x14'),_0x3b8b76,_0x2097('0x12'),JSON[_0x2097('0x15')](_0x1d1166));if(_0x1d1166[_0x2097('0x16')]){if(_0x1d1166[_0x2097('0x16')][_0x2097('0x17')]===0x1f4){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x1d1166['error'][_0x2097('0x18')]);return _0x7baeb3(_0x1d1166[_0x2097('0x16')]['message']);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3b8b76,_0x1d1166[_0x2097('0x16')]['message']);return _0x430754(_0x1d1166[_0x2097('0x16')][_0x2097('0x18')]);}else{logger[_0x2097('0x10')](_0x2097('0x11'),_0x3b8b76,_0x2097('0x12'));_0x430754(_0x1d1166['result'][_0x2097('0x18')]);}})[_0x2097('0x19')](function(_0x451584){logger[_0x2097('0x16')](_0x2097('0x11'),_0x3b8b76,_0x451584);_0x7baeb3(_0x451584);});});}exports[_0x2097('0x1a')]=function(_0x253f5d){var _0x46b5e0=this;return new Promise(function(_0x5d8b9e,_0x4d957e){return db[_0x2097('0x1b')]['create'](_0x253f5d[_0x2097('0x1c')],{'raw':_0x253f5d[_0x2097('0x1d')]?_0x253f5d['options'][_0x2097('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x2e17c8){logger[_0x2097('0x10')](_0x2097('0x1a'),_0x253f5d);logger[_0x2097('0x13')](_0x2097('0x1a'),_0x253f5d,JSON[_0x2097('0x15')](_0x2e17c8));_0x5d8b9e(_0x2e17c8);})['catch'](function(_0xae5f9){logger['error'](_0x2097('0x1a'),_0xae5f9[_0x2097('0x18')],_0x253f5d);_0x4d957e(_0x46b5e0[_0x2097('0x16')](0x1f4,_0xae5f9[_0x2097('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f986eaa..b63a990 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 _0xb0b9=['length','./mailMessage.events','update','emit','removeListener','register'];(function(_0x373e3a,_0xf07368){var _0x1f55d7=function(_0x5d8a09){while(--_0x5d8a09){_0x373e3a['push'](_0x373e3a['shift']());}};_0x1f55d7(++_0xf07368);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x1a561e,_0x32ebc9){_0x1a561e=_0x1a561e-0x0;var _0x19ba28=_0xb0b9[_0x1a561e];return _0x19ba28;};'use strict';var MailMessageEvents=require(_0x9b0b('0x0'));var events=['save','remove',_0x9b0b('0x1')];function createListener(_0x24fa0c,_0x27a2dc){return function(_0x76cbb2){_0x27a2dc[_0x9b0b('0x2')](_0x24fa0c,_0x76cbb2);};}function removeListener(_0xeb15c0,_0x311e29){return function(){MailMessageEvents[_0x9b0b('0x3')](_0xeb15c0,_0x311e29);};}exports[_0x9b0b('0x4')]=function(_0x24d4a9){for(var _0x2c3d97=0x0,_0x157d81=events[_0x9b0b('0x5')];_0x2c3d97<_0x157d81;_0x2c3d97++){var _0x1feca7=events[_0x2c3d97];var _0x4894ae=createListener('mailMessage:'+_0x1feca7,_0x24d4a9);MailMessageEvents['on'](_0x1feca7,_0x4894ae);}}; \ No newline at end of file +var _0x4beb=['remove','update','emit','register','./mailMessage.events'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4beb,0x17b));var _0xb4be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4beb[_0x3dd15e];return _0x231fd0;};'use strict';var MailMessageEvents=require(_0xb4be('0x0'));var events=['save',_0xb4be('0x1'),_0xb4be('0x2')];function createListener(_0x2e384b,_0x2ce379){return function(_0x1bd77b){_0x2ce379[_0xb4be('0x3')](_0x2e384b,_0x1bd77b);};}function removeListener(_0x551157,_0x45e478){return function(){MailMessageEvents['removeListener'](_0x551157,_0x45e478);};}exports[_0xb4be('0x4')]=function(_0x317703){for(var _0x225f26=0x0,_0x4312b7=events['length'];_0x225f26<_0x4312b7;_0x225f26++){var _0x288716=events[_0x225f26];var _0x3217dd=createListener('mailMessage:'+_0x288716,_0x317703);MailMessageEvents['on'](_0x288716,_0x3217dd);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index dc4ae0b..6ee1945 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 _0xe1bb=['connect-timeout','express','fs-extra','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','put','update','/:id','destroy','delete','removeTeams','exports','multer','util','path'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0xe1bb,0x1b7));var _0xbe1b=function(_0x4baf8c,_0x42328e){_0x4baf8c=_0x4baf8c-0x0;var _0x76322f=_0xe1bb[_0x4baf8c];return _0x76322f;};'use strict';var multer=require(_0xbe1b('0x0'));var util=require(_0xbe1b('0x1'));var path=require(_0xbe1b('0x2'));var timeout=require(_0xbe1b('0x3'));var express=require(_0xbe1b('0x4'));var router=express['Router']();var fs_extra=require(_0xbe1b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbe1b('0x6'));var controller=require(_0xbe1b('0x7'));router[_0xbe1b('0x8')]('/',auth[_0xbe1b('0x9')](),controller[_0xbe1b('0xa')]);router[_0xbe1b('0x8')]('/describe',auth[_0xbe1b('0x9')](),controller['describe']);router[_0xbe1b('0x8')]('/:id',auth[_0xbe1b('0x9')](),controller['show']);router[_0xbe1b('0x8')](_0xbe1b('0xb'),auth['isAuthenticated'](),controller['getMembers']);router[_0xbe1b('0x8')](_0xbe1b('0xc'),auth['isAuthenticated'](),controller[_0xbe1b('0xd')]);router[_0xbe1b('0x8')](_0xbe1b('0xe'),auth['isAuthenticated'](),controller[_0xbe1b('0xf')]);router[_0xbe1b('0x10')]('/',auth['isAuthenticated'](),controller[_0xbe1b('0x11')]);router[_0xbe1b('0x10')](_0xbe1b('0xc'),auth[_0xbe1b('0x9')](),controller['addTeams']);router[_0xbe1b('0x10')](_0xbe1b('0xe'),auth[_0xbe1b('0x9')](),controller[_0xbe1b('0x12')]);router[_0xbe1b('0x13')]('/:id',auth[_0xbe1b('0x9')](),controller[_0xbe1b('0x14')]);router['delete'](_0xbe1b('0x15'),auth[_0xbe1b('0x9')](),controller[_0xbe1b('0x16')]);router[_0xbe1b('0x17')](_0xbe1b('0xc'),auth[_0xbe1b('0x9')](),controller[_0xbe1b('0x18')]);router['delete'](_0xbe1b('0xe'),auth[_0xbe1b('0x9')](),controller['removeAgents']);module[_0xbe1b('0x19')]=router; \ No newline at end of file +var _0xa584=['/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','/describe','describe'];(function(_0x241404,_0x59c73d){var _0x542ade=function(_0x536fd8){while(--_0x536fd8){_0x241404['push'](_0x241404['shift']());}};_0x542ade(++_0x59c73d);}(_0xa584,0x109));var _0x4a58=function(_0x28e5e4,_0x2c022c){_0x28e5e4=_0x28e5e4-0x0;var _0x29d092=_0xa584[_0x28e5e4];return _0x29d092;};'use strict';var multer=require(_0x4a58('0x0'));var util=require(_0x4a58('0x1'));var path=require(_0x4a58('0x2'));var timeout=require(_0x4a58('0x3'));var express=require(_0x4a58('0x4'));var router=express[_0x4a58('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4a58('0x6'));var interaction=require(_0x4a58('0x7'));var config=require(_0x4a58('0x8'));var controller=require(_0x4a58('0x9'));router[_0x4a58('0xa')]('/',auth[_0x4a58('0xb')](),controller['index']);router['get'](_0x4a58('0xc'),auth['isAuthenticated'](),controller[_0x4a58('0xd')]);router[_0x4a58('0xa')](_0x4a58('0xe'),auth[_0x4a58('0xb')](),controller[_0x4a58('0xf')]);router['get'](_0x4a58('0x10'),auth[_0x4a58('0xb')](),controller['getMembers']);router['get'](_0x4a58('0x11'),auth[_0x4a58('0xb')](),controller[_0x4a58('0x12')]);router[_0x4a58('0xa')](_0x4a58('0x13'),auth[_0x4a58('0xb')](),controller[_0x4a58('0x14')]);router[_0x4a58('0x15')]('/',auth['isAuthenticated'](),controller[_0x4a58('0x16')]);router['post'](_0x4a58('0x11'),auth[_0x4a58('0xb')](),controller[_0x4a58('0x17')]);router[_0x4a58('0x15')](_0x4a58('0x13'),auth[_0x4a58('0xb')](),controller[_0x4a58('0x18')]);router[_0x4a58('0x19')](_0x4a58('0xe'),auth[_0x4a58('0xb')](),controller['update']);router['delete'](_0x4a58('0xe'),auth[_0x4a58('0xb')](),controller[_0x4a58('0x1a')]);router[_0x4a58('0x1b')]('/:id/teams',auth[_0x4a58('0xb')](),controller[_0x4a58('0x1c')]);router[_0x4a58('0x1b')](_0x4a58('0x13'),auth[_0x4a58('0xb')](),controller[_0x4a58('0x1d')]);module[_0x4a58('0x1e')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 0e07d7a..83b4799 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 _0x0dad=['sequelize','exports','STRING','INTEGER','beepall','roundrobin'];(function(_0x5d6031,_0x20dec1){var _0x5a7486=function(_0x4a7e89){while(--_0x4a7e89){_0x5d6031['push'](_0x5d6031['shift']());}};_0x5a7486(++_0x20dec1);}(_0x0dad,0x114));var _0xd0da=function(_0x453e2b,_0x4f1258){_0x453e2b=_0x453e2b-0x0;var _0x50f306=_0x0dad[_0x453e2b];return _0x50f306;};'use strict';var Sequelize=require(_0xd0da('0x0'));module[_0xd0da('0x1')]={'name':{'type':Sequelize[_0xd0da('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd0da('0x2')]},'timeout':{'type':Sequelize[_0xd0da('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xd0da('0x4'),_0xd0da('0x5'))}}; \ No newline at end of file +var _0x5c5b=['STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x44ab97,_0x329dcf){var _0x226980=function(_0x3863fd){while(--_0x3863fd){_0x44ab97['push'](_0x44ab97['shift']());}};_0x226980(++_0x329dcf);}(_0x5c5b,0x167));var _0xb5c5=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x5c5b[_0x1d2bbb];return _0x38082b;};'use strict';var Sequelize=require(_0xb5c5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb5c5('0x1')]},'timeout':{'type':Sequelize[_0xb5c5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb5c5('0x3')](_0xb5c5('0x4'),_0xb5c5('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d23c09f..212fa27 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 _0xdc44=['catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','order','pick','filter','merge','UserId','agent','mailPause','updatedAt','createdAt','SIP','Team','sort','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','all','union','compact','value','isEmpty','removeAgents','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','bluebird','lodash','squel','ioredis','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','MailQueues','UserProfileResource','error','name','send','index','map','MailQueue','rawAttributes','fieldName','getOptions','where','include','query','findAll','rows','params','keys','filters','intersection','attributes','fields','length','model','options','find'];(function(_0x1be6db,_0xbe091a){var _0x375ee2=function(_0xaaa59c){while(--_0xaaa59c){_0x1be6db['push'](_0x1be6db['shift']());}};_0x375ee2(++_0xbe091a);}(_0xdc44,0x195));var _0x4dc4=function(_0xdc1475,_0x57e348){_0xdc1475=_0xdc1475-0x0;var _0x4f1be2=_0xdc44[_0xdc1475];return _0x4f1be2;};'use strict';var BPromise=require(_0x4dc4('0x0'));var util=require('util');var _=require(_0x4dc4('0x1'));var squel=require(_0x4dc4('0x2'));var Redis=require(_0x4dc4('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4dc4('0x4')]=_[_0x4dc4('0x5')](config[_0x4dc4('0x4')],{'host':_0x4dc4('0x6'),'port':0x18eb});var socket=require(_0x4dc4('0x7'))(new Redis(config[_0x4dc4('0x4')]));require('./mailQueue.socket')[_0x4dc4('0x8')](socket);function respondWithStatusCode(_0x54b73a,_0x5f323a){_0x5f323a=_0x5f323a||0xcc;return function(_0x39563a){if(_0x39563a){return _0x54b73a[_0x4dc4('0x9')](_0x5f323a);}return _0x54b73a[_0x4dc4('0xa')](_0x5f323a)['end']();};}function respondWithResult(_0x2035c9,_0x413624){_0x413624=_0x413624||0xc8;return function(_0x28c7f5){if(_0x28c7f5){return _0x2035c9[_0x4dc4('0xa')](_0x413624)[_0x4dc4('0xb')](_0x28c7f5);}};}function respondWithFilteredResult(_0x4592b3,_0x31fd74){return function(_0x444870){if(_0x444870){var _0x4b7a81=typeof _0x31fd74['offset']===_0x4dc4('0xc')&&typeof _0x31fd74['limit']==='undefined';var _0x44afaf=_0x444870[_0x4dc4('0xd')];var _0x44ec20=_0x4b7a81?0x0:_0x31fd74[_0x4dc4('0xe')];var _0xb9d7ce=_0x4b7a81?_0x444870[_0x4dc4('0xd')]:_0x31fd74[_0x4dc4('0xe')]+_0x31fd74[_0x4dc4('0xf')];var _0x8e48ae;if(_0xb9d7ce>=_0x44afaf){_0xb9d7ce=_0x44afaf;_0x8e48ae=0xc8;}else{_0x8e48ae=0xce;}_0x4592b3['status'](_0x8e48ae);return _0x4592b3[_0x4dc4('0x10')](_0x4dc4('0x11'),_0x44ec20+'-'+_0xb9d7ce+'/'+_0x44afaf)[_0x4dc4('0xb')](_0x444870);}return null;};}function saveUpdates(_0x5654ae){return function(_0x1d6838){if(_0x1d6838){return _0x1d6838[_0x4dc4('0x12')](_0x5654ae)[_0x4dc4('0x13')](function(_0xbe8405){return _0xbe8405;});}return null;};}function removeEntity(_0x2e98a7){return function(_0x47e06f){if(_0x47e06f){return _0x47e06f[_0x4dc4('0x14')]()[_0x4dc4('0x13')](function(){var _0x13b560=_0x47e06f['get']({'plain':!![]});var _0x537356=_0x4dc4('0x15');return db[_0x4dc4('0x16')][_0x4dc4('0x14')]({'where':{'type':_0x537356,'resourceId':_0x13b560['id']}})[_0x4dc4('0x13')](function(){return _0x47e06f;});})[_0x4dc4('0x13')](function(){_0x2e98a7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x668a24){return function(_0x1759e8){if(!_0x1759e8){_0x668a24[_0x4dc4('0x9')](0x194);}return _0x1759e8;};}function handleError(_0x3cc52f,_0x197e29){_0x197e29=_0x197e29||0x1f4;return function(_0x5bc193){logger[_0x4dc4('0x17')](_0x5bc193['stack']);if(_0x5bc193[_0x4dc4('0x18')]){delete _0x5bc193['name'];}_0x3cc52f[_0x4dc4('0xa')](_0x197e29)[_0x4dc4('0x19')](_0x5bc193);};}exports[_0x4dc4('0x1a')]=function(_0x3c816f,_0x148fd0){var _0x33f931={};var _0x182108={'count':0x0,'rows':[]};var _0x4410c0=_[_0x4dc4('0x1b')](db[_0x4dc4('0x1c')][_0x4dc4('0x1d')],function(_0x302945){return{'name':_0x302945[_0x4dc4('0x1e')],'type':_0x302945['type']['key']};});_0x33f931=qs[_0x4dc4('0x1f')](_0x4410c0,_0x3c816f);var _0x1786e4={'where':_0x33f931[_0x4dc4('0x20')]};return db['MailQueue'][_0x4dc4('0xd')](_0x1786e4)[_0x4dc4('0x13')](function(_0x3dc600){_0x182108[_0x4dc4('0xd')]=_0x3dc600;_0x33f931[_0x4dc4('0x21')]=qs['include'](_0x3c816f[_0x4dc4('0x22')]);return db['MailQueue'][_0x4dc4('0x23')](_0x33f931);})[_0x4dc4('0x13')](function(_0x30643e){_0x182108[_0x4dc4('0x24')]=_0x30643e;return _0x182108;})[_0x4dc4('0x13')](respondWithFilteredResult(_0x148fd0,_0x33f931))['catch'](handleError(_0x148fd0,null));};exports['show']=function(_0x3f2fc1,_0x15dbf2){var _0x469379={'raw':!![],'where':{'id':_0x3f2fc1[_0x4dc4('0x25')]['id']}},_0x268fce={};_0x268fce['model']=_[_0x4dc4('0x26')](db[_0x4dc4('0x1c')][_0x4dc4('0x1d')]);_0x268fce[_0x4dc4('0x22')]=_['keys'](_0x3f2fc1[_0x4dc4('0x22')]);_0x268fce[_0x4dc4('0x27')]=_[_0x4dc4('0x28')](_0x268fce['model'],_0x268fce[_0x4dc4('0x22')]);_0x469379[_0x4dc4('0x29')]=_['intersection'](_0x268fce['model'],qs[_0x4dc4('0x2a')](_0x3f2fc1[_0x4dc4('0x22')]['fields']));_0x469379[_0x4dc4('0x29')]=_0x469379['attributes'][_0x4dc4('0x2b')]?_0x469379['attributes']:_0x268fce[_0x4dc4('0x2c')];if(_0x3f2fc1[_0x4dc4('0x22')]['includeAll']){_0x469379[_0x4dc4('0x21')]=[{'all':!![]}];}_0x469379=_['merge']({},_0x469379,_0x3f2fc1[_0x4dc4('0x2d')]);return db[_0x4dc4('0x1c')][_0x4dc4('0x2e')](_0x469379)[_0x4dc4('0x13')](handleEntityNotFound(_0x15dbf2,null))[_0x4dc4('0x13')](respondWithResult(_0x15dbf2,null))[_0x4dc4('0x2f')](handleError(_0x15dbf2,null));};exports[_0x4dc4('0x30')]=function(_0x2ea747,_0x2c1432){return db[_0x4dc4('0x1c')]['create'](_0x2ea747[_0x4dc4('0x31')],{})[_0x4dc4('0x13')](function(_0x41384b){var _0x233cfa=_0x2ea747['user'][_0x4dc4('0x32')]({'plain':!![]});if(!_0x233cfa)throw new Error(_0x4dc4('0x33'));if(_0x233cfa['role']===_0x4dc4('0x34')){var _0x58b5db=_0x41384b[_0x4dc4('0x32')]({'plain':!![]});var _0xff8a6=_0x4dc4('0x15');return db[_0x4dc4('0x35')]['find']({'where':{'name':_0xff8a6,'userProfileId':_0x233cfa[_0x4dc4('0x36')]},'raw':!![]})[_0x4dc4('0x13')](function(_0x290e7c){if(_0x290e7c&&_0x290e7c['autoAssociation']===0x0){return db[_0x4dc4('0x16')]['create']({'name':_0x58b5db['name'],'resourceId':_0x58b5db['id'],'type':_0x290e7c[_0x4dc4('0x18')],'sectionId':_0x290e7c['id']},{})[_0x4dc4('0x13')](function(){return _0x41384b;});}else{return _0x41384b;}})[_0x4dc4('0x2f')](function(_0x4262be){logger['error'](_0x4dc4('0x37'),_0x4262be);throw _0x4262be;});}return _0x41384b;})[_0x4dc4('0x13')](respondWithResult(_0x2c1432,0xc9))[_0x4dc4('0x2f')](handleError(_0x2c1432,null));};exports[_0x4dc4('0x12')]=function(_0x2c1aae,_0x1c0141){if(_0x2c1aae[_0x4dc4('0x31')]['id']){delete _0x2c1aae[_0x4dc4('0x31')]['id'];}return db[_0x4dc4('0x1c')][_0x4dc4('0x2e')]({'where':{'id':_0x2c1aae['params']['id']}})[_0x4dc4('0x13')](handleEntityNotFound(_0x1c0141,null))[_0x4dc4('0x13')](saveUpdates(_0x2c1aae[_0x4dc4('0x31')],null))[_0x4dc4('0x13')](respondWithResult(_0x1c0141,null))[_0x4dc4('0x2f')](handleError(_0x1c0141,null));};exports['destroy']=function(_0x132f01,_0x51c987){return db[_0x4dc4('0x1c')][_0x4dc4('0x2e')]({'where':{'id':_0x132f01[_0x4dc4('0x25')]['id']}})[_0x4dc4('0x13')](handleEntityNotFound(_0x51c987,null))[_0x4dc4('0x13')](removeEntity(_0x51c987,null))[_0x4dc4('0x2f')](handleError(_0x51c987,null));};exports[_0x4dc4('0x38')]=function(_0x2f4d16,_0x1ccb40){return db[_0x4dc4('0x1c')][_0x4dc4('0x38')]()['then'](respondWithResult(_0x1ccb40,null))[_0x4dc4('0x2f')](handleError(_0x1ccb40,null));};exports[_0x4dc4('0x39')]=function(_0x124595,_0x5ae3af){var _0xe04778={'raw':!![],'where':{}},_0x50de82={},_0xfb0d9a;return db[_0x4dc4('0x1c')][_0x4dc4('0x3a')]({'where':{'id':_0x124595[_0x4dc4('0x25')]['id']}})[_0x4dc4('0x13')](handleEntityNotFound(_0x5ae3af,null))[_0x4dc4('0x13')](function(_0x481d66){if(_0x481d66){_0xfb0d9a=_0x481d66[_0x4dc4('0x32')]({'plain':!![]});_0x50de82[_0x4dc4('0x2c')]=_[_0x4dc4('0x26')](db[_0x4dc4('0x3b')][_0x4dc4('0x1d')]);_0x50de82['query']=_[_0x4dc4('0x26')](_0x124595['query']);_0x50de82['filters']=_[_0x4dc4('0x28')](_0x50de82[_0x4dc4('0x2c')],_0x50de82[_0x4dc4('0x22')]);_0xe04778[_0x4dc4('0x29')]=_[_0x4dc4('0x28')](_0x50de82['model'],qs[_0x4dc4('0x2a')](_0x124595[_0x4dc4('0x22')]['fields']));_0xe04778[_0x4dc4('0x29')]=_0xe04778['attributes'][_0x4dc4('0x2b')]?_0xe04778[_0x4dc4('0x29')]:_0x50de82[_0x4dc4('0x2c')];if(!_0x124595[_0x4dc4('0x22')][_0x4dc4('0x3c')]('nolimit')){_0xe04778[_0x4dc4('0xf')]=qs['limit'](_0x124595['query'][_0x4dc4('0xf')]);_0xe04778[_0x4dc4('0xe')]=qs[_0x4dc4('0xe')](_0x124595[_0x4dc4('0x22')][_0x4dc4('0xe')]);}_0xe04778[_0x4dc4('0x3d')]=qs['sort'](_0x124595['query']['sort']);_0xe04778['where']=qs[_0x4dc4('0x27')](_[_0x4dc4('0x3e')](_0x124595[_0x4dc4('0x22')],_0x50de82[_0x4dc4('0x27')]));_0xe04778[_0x4dc4('0x20')]['MailQueueId']=_0x481d66['id'];if(_0x124595[_0x4dc4('0x22')]['filter']){_0xe04778[_0x4dc4('0x20')]=_['merge'](_0xe04778[_0x4dc4('0x20')],{'$or':_['map'](_0xe04778[_0x4dc4('0x29')],function(_0x22d7fb){var _0x2a3e1b={};_0x2a3e1b[_0x22d7fb]={'$like':'%'+_0x124595[_0x4dc4('0x22')][_0x4dc4('0x3f')]+'%'};return _0x2a3e1b;})});}_0xe04778=_[_0x4dc4('0x40')]({},_0xe04778,_0x124595[_0x4dc4('0x2d')]);return db['UserMailQueue'][_0x4dc4('0x23')](_0xe04778);}})[_0x4dc4('0x13')](function(_0xe2f1cc){if(_0xe2f1cc){return db['User']['findAndCountAll']({'where':{'id':_[_0x4dc4('0x1b')](_0xe2f1cc,_0x4dc4('0x41')),'role':_0x4dc4('0x42')},'attributes':['id','name',_0x4dc4('0x43'),_0x4dc4('0x44'),_0x4dc4('0x45')]});}})[_0x4dc4('0x13')](function(_0x2b7dab){if(_0x2b7dab){return{'count':_0x2b7dab['count'],'rows':_[_0x4dc4('0x1b')](_0x2b7dab[_0x4dc4('0x24')],function(_0x22573e){return{'membername':_0x22573e['name'],'UserId':_0x22573e['id'],'queue_name':_0xfb0d9a[_0x4dc4('0x18')],'MailQueueId':_0xfb0d9a['id'],'interface':util['format']('%s/%s',_0x4dc4('0x46'),_0x22573e[_0x4dc4('0x18')]),'penalty':0x0,'paused':_0x22573e[_0x4dc4('0x43')],'createdAt':_0x22573e[_0x4dc4('0x45')],'updatedAt':_0x22573e[_0x4dc4('0x44')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4dc4('0x13')](respondWithFilteredResult(_0x5ae3af,_0xe04778))['catch'](handleError(_0x5ae3af,null));};exports['getTeams']=function(_0x30800a,_0x23aae3){var _0x4630a5={};var _0x5e6ca0={};var _0x316d1b;var _0x3a07db;return db[_0x4dc4('0x1c')][_0x4dc4('0x3a')]({'where':{'id':_0x30800a[_0x4dc4('0x25')]['id']}})[_0x4dc4('0x13')](handleEntityNotFound(_0x23aae3,null))[_0x4dc4('0x13')](function(_0x3af6a9){if(_0x3af6a9){_0x316d1b=_0x3af6a9;_0x5e6ca0[_0x4dc4('0x2c')]=_[_0x4dc4('0x26')](db[_0x4dc4('0x47')][_0x4dc4('0x1d')]);_0x5e6ca0[_0x4dc4('0x22')]=_[_0x4dc4('0x26')](_0x30800a[_0x4dc4('0x22')]);_0x5e6ca0[_0x4dc4('0x27')]=_[_0x4dc4('0x28')](_0x5e6ca0[_0x4dc4('0x2c')],_0x5e6ca0['query']);_0x4630a5[_0x4dc4('0x29')]=_['intersection'](_0x5e6ca0['model'],qs[_0x4dc4('0x2a')](_0x30800a[_0x4dc4('0x22')][_0x4dc4('0x2a')]));_0x4630a5['attributes']=_0x4630a5[_0x4dc4('0x29')][_0x4dc4('0x2b')]?_0x4630a5[_0x4dc4('0x29')]:_0x5e6ca0[_0x4dc4('0x2c')];_0x4630a5[_0x4dc4('0x3d')]=qs['sort'](_0x30800a[_0x4dc4('0x22')][_0x4dc4('0x48')]);_0x4630a5[_0x4dc4('0x20')]=qs[_0x4dc4('0x27')](_[_0x4dc4('0x3e')](_0x30800a[_0x4dc4('0x22')],_0x5e6ca0['filters']));if(_0x30800a['query'][_0x4dc4('0x3f')]){_0x4630a5[_0x4dc4('0x20')]=_['merge'](_0x4630a5['where'],{'$or':_['map'](_0x4630a5[_0x4dc4('0x29')],function(_0x2d93c4){var _0x235bf0={};_0x235bf0[_0x2d93c4]={'$like':'%'+_0x30800a[_0x4dc4('0x22')][_0x4dc4('0x3f')]+'%'};return _0x235bf0;})});}_0x4630a5=_[_0x4dc4('0x40')]({},_0x4630a5,_0x30800a['options']);return _0x316d1b['getTeams'](_0x4630a5);}})['then'](function(_0x53c8ff){if(_0x53c8ff){_0x3a07db=_0x53c8ff[_0x4dc4('0x2b')];if(!_0x30800a['query'][_0x4dc4('0x3c')]('nolimit')){_0x4630a5[_0x4dc4('0xf')]=qs[_0x4dc4('0xf')](_0x30800a[_0x4dc4('0x22')]['limit']);_0x4630a5[_0x4dc4('0xe')]=qs[_0x4dc4('0xe')](_0x30800a[_0x4dc4('0x22')][_0x4dc4('0xe')]);}return _0x316d1b['getTeams'](_0x4630a5);}})[_0x4dc4('0x13')](function(_0x685201){if(_0x685201){return _0x685201?{'count':_0x3a07db,'rows':_0x685201}:null;}})['then'](respondWithResult(_0x23aae3,null))['catch'](handleError(_0x23aae3,null));};exports[_0x4dc4('0x49')]=function(_0xb03726,_0x27f773){var _0x3dd3fb=_0xb03726['body'][_0x4dc4('0x4a')];return db[_0x4dc4('0x47')][_0x4dc4('0x23')]({'where':{'id':_0x3dd3fb},'attributes':['id'],'include':[{'model':db[_0x4dc4('0x4b')],'as':_0x4dc4('0x4c'),'attributes':['id','name',_0x4dc4('0x4d'),'voicePause',_0x4dc4('0x4e')],'raw':!![]}]})[_0x4dc4('0x13')](function(_0x2ff2b6){if(_0x2ff2b6){var _0x1db888=_[_0x4dc4('0x4f')](_0x2ff2b6,function(_0x57efaf){var _0x58552d=_0x57efaf[_0x4dc4('0x32')]({'plain':!![]});return _0x58552d['Agents'];});return db[_0x4dc4('0x1c')][_0x4dc4('0x2e')]({'where':{'id':_0xb03726[_0x4dc4('0x25')]['id']}})[_0x4dc4('0x13')](function(_0x59e6e5){return db[_0x4dc4('0x50')][_0x4dc4('0x51')](function(_0x50ba43){return _0x59e6e5[_0x4dc4('0x49')](_0x3dd3fb,{'transaction':_0x50ba43})[_0x4dc4('0x13')](function(){return BPromise['each'](_0x1db888,function(_0x49ec91){return db[_0x4dc4('0x3b')][_0x4dc4('0x52')]({'where':{'UserId':_0x49ec91['id'],'MailQueueId':_0xb03726['params']['id']},'transaction':_0x50ba43});});})[_0x4dc4('0x13')](function(){_0x1db888[_0x4dc4('0x53')](function(_0x4a847a){socket['emit'](_0x4dc4('0x54'),{'UserId':_0x4a847a['id'],'MailQueueId':_0x59e6e5['id']});});});});});}})['then'](respondWithStatusCode(_0x27f773,null))['catch'](handleError(_0x27f773,null));};exports[_0x4dc4('0x55')]=function(_0x518d0a,_0x90b5cf){return db[_0x4dc4('0x47')][_0x4dc4('0x23')]({'where':{'id':_0x518d0a[_0x4dc4('0x22')][_0x4dc4('0x4a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x4dc4('0x4c'),'attributes':['id'],'raw':!![]}]})[_0x4dc4('0x13')](handleEntityNotFound(_0x90b5cf,null))[_0x4dc4('0x13')](function(_0x573a75){var _0x36365a=_[_0x4dc4('0x1b')](_0x573a75,'id');var _0x304dc8=[];var _0x5ae927=[];var _0x1db3ae=squel[_0x4dc4('0x56')]();_0x1db3ae[_0x4dc4('0x57')](_0x4dc4('0x58'))[_0x4dc4('0x59')](_0x4dc4('0x5a'),'tq')[_0x4dc4('0x5b')](_0x4dc4('0x5c'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x4dc4('0x20')](_0x4dc4('0x5d'),_0x518d0a['params']['id']);for(var _0x225c2c=0x0;_0x225c2c<_0x573a75['length'];_0x225c2c+=0x1){let _0x3f68a7=_0x573a75[_0x225c2c];for(var _0x460440=0x0;_0x460440<_0x3f68a7['Agents']['length'];_0x460440+=0x1){let _0xd59b35=_0x3f68a7['Agents'][_0x460440];var _0x43b421=_0x1db3ae[_0x4dc4('0x5e')]();_0x43b421['where'](_0x4dc4('0x5f'),_0xd59b35['id']);_0x5ae927['push'](db[_0x4dc4('0x50')][_0x4dc4('0x22')](_0x43b421[_0x4dc4('0x60')](),{'type':db[_0x4dc4('0x50')][_0x4dc4('0x61')][_0x4dc4('0x62')]})[_0x4dc4('0x13')](function(_0x202976){if(_0x202976[_0x4dc4('0x2b')]===0x1){return _0xd59b35['id'];}else{var _0xd227c3=_[_0x4dc4('0x63')](_['map'](_0x202976,'TeamId'),function(_0xe10cce){return _['includes'](_0x36365a,_0xe10cce);});if(_0xd227c3){return _0xd59b35['id'];}}}));}}return BPromise[_0x4dc4('0x64')](_0x5ae927)[_0x4dc4('0x13')](function(_0x15b24b){_0x304dc8=_(_0x304dc8)[_0x4dc4('0x65')](_0x15b24b)[_0x4dc4('0x66')]()[_0x4dc4('0x67')]();return db['MailQueue'][_0x4dc4('0x2e')]({'where':{'id':_0x518d0a['params']['id']}})[_0x4dc4('0x13')](function(_0x404ff8){return db[_0x4dc4('0x50')]['transaction'](function(_0x55f20d){return _0x404ff8['removeTeams'](_0x518d0a[_0x4dc4('0x22')][_0x4dc4('0x4a')],{'transaction':_0x55f20d})[_0x4dc4('0x13')](function(){if(!_[_0x4dc4('0x68')](_0x304dc8)){return _0x404ff8[_0x4dc4('0x69')](_0x304dc8,{'transaction':_0x55f20d});}})['then'](function(){_0x304dc8[_0x4dc4('0x53')](function(_0x52154c){socket[_0x4dc4('0x6a')](_0x4dc4('0x6b'),{'UserId':_0x52154c,'MailQueueId':_0x404ff8['id']});});});});});});})[_0x4dc4('0x13')](respondWithStatusCode(_0x90b5cf,null))['catch'](handleError(_0x90b5cf,null));};exports['addAgents']=function(_0x6663db,_0x403e38){return db[_0x4dc4('0x1c')][_0x4dc4('0x2e')]({'where':{'id':_0x6663db[_0x4dc4('0x25')]['id']}})['then'](handleEntityNotFound(_0x403e38,null))['then'](function(_0xf0c5ee){if(_0xf0c5ee){return _0xf0c5ee[_0x4dc4('0x6c')](_0x6663db[_0x4dc4('0x31')][_0x4dc4('0x4a')],_[_0x4dc4('0x6d')](_0x6663db[_0x4dc4('0x31')],[_0x4dc4('0x4a'),'id'])||{})[_0x4dc4('0x6e')](function(_0x1a9b32){for(var _0x484dab=0x0;_0x484dab<_0x6663db[_0x4dc4('0x31')]['ids'][_0x4dc4('0x2b')];_0x484dab+=0x1){socket[_0x4dc4('0x6a')](_0x4dc4('0x54'),{'UserId':Number(_0x6663db[_0x4dc4('0x31')][_0x4dc4('0x4a')][_0x484dab]),'MailQueueId':Number(_0x6663db[_0x4dc4('0x25')]['id'])});}return _0x1a9b32;});}})[_0x4dc4('0x13')](respondWithResult(_0x403e38,null))['catch'](handleError(_0x403e38,null));};exports[_0x4dc4('0x69')]=function(_0x3caf3d,_0x4711d6){return db[_0x4dc4('0x1c')][_0x4dc4('0x2e')]({'where':{'id':_0x3caf3d[_0x4dc4('0x25')]['id']}})[_0x4dc4('0x13')](handleEntityNotFound(_0x4711d6,null))[_0x4dc4('0x13')](function(_0x6fd66b){if(_0x6fd66b){return _0x6fd66b[_0x4dc4('0x69')](_0x3caf3d[_0x4dc4('0x22')]['ids'])[_0x4dc4('0x13')](function(){if(_[_0x4dc4('0x6f')](_0x3caf3d[_0x4dc4('0x22')][_0x4dc4('0x4a')])){for(var _0x42e041=0x0;_0x42e041<_0x3caf3d[_0x4dc4('0x22')][_0x4dc4('0x4a')]['length'];_0x42e041+=0x1){socket[_0x4dc4('0x6a')](_0x4dc4('0x6b'),{'UserId':Number(_0x3caf3d[_0x4dc4('0x22')]['ids'][_0x42e041]),'MailQueueId':Number(_0x3caf3d['params']['id'])});}}else{socket[_0x4dc4('0x6a')](_0x4dc4('0x6b'),{'UserId':Number(_0x3caf3d[_0x4dc4('0x22')][_0x4dc4('0x4a')]),'MailQueueId':Number(_0x3caf3d['params']['id'])});}});}})[_0x4dc4('0x13')](respondWithStatusCode(_0x4711d6,null))[_0x4dc4('0x2f')](handleError(_0x4711d6,null));};exports[_0x4dc4('0x70')]=function(_0x550be9,_0x2adb88){var _0x2f82d3={};var _0x62632d={};var _0x2f631c;var _0x56bc1d;return db[_0x4dc4('0x1c')]['findOne']({'where':{'id':_0x550be9[_0x4dc4('0x25')]['id']}})['then'](handleEntityNotFound(_0x2adb88,null))[_0x4dc4('0x13')](function(_0x11af53){if(_0x11af53){_0x2f631c=_0x11af53;_0x62632d[_0x4dc4('0x2c')]=_[_0x4dc4('0x26')](db[_0x4dc4('0x4b')][_0x4dc4('0x1d')]);_0x62632d[_0x4dc4('0x22')]=_['keys'](_0x550be9['query']);_0x62632d[_0x4dc4('0x27')]=_[_0x4dc4('0x28')](_0x62632d[_0x4dc4('0x2c')],_0x62632d[_0x4dc4('0x22')]);_0x2f82d3['attributes']=_['intersection'](_0x62632d['model'],qs['fields'](_0x550be9['query'][_0x4dc4('0x2a')]));_0x2f82d3[_0x4dc4('0x29')]=_0x2f82d3['attributes'][_0x4dc4('0x2b')]?_0x2f82d3[_0x4dc4('0x29')]:_0x62632d[_0x4dc4('0x2c')];_0x2f82d3[_0x4dc4('0x3d')]=qs['sort'](_0x550be9[_0x4dc4('0x22')][_0x4dc4('0x48')]);_0x2f82d3[_0x4dc4('0x20')]=qs[_0x4dc4('0x27')](_[_0x4dc4('0x3e')](_0x550be9['query'],_0x62632d[_0x4dc4('0x27')]));if(_0x550be9[_0x4dc4('0x22')]['filter']){_0x2f82d3[_0x4dc4('0x20')]=_[_0x4dc4('0x40')](_0x2f82d3[_0x4dc4('0x20')],{'$or':_['map'](_0x2f82d3[_0x4dc4('0x29')],function(_0x583e45){var _0x51085f={};_0x51085f[_0x583e45]={'$like':'%'+_0x550be9['query']['filter']+'%'};return _0x51085f;})});}_0x2f82d3=_['merge']({},_0x2f82d3,_0x550be9[_0x4dc4('0x2d')]);return _0x2f631c['getAgents'](_0x2f82d3);}})[_0x4dc4('0x13')](function(_0x2e54e7){if(_0x2e54e7){_0x56bc1d=_0x2e54e7['length'];if(!_0x550be9[_0x4dc4('0x22')][_0x4dc4('0x3c')]('nolimit')){_0x2f82d3[_0x4dc4('0xf')]=qs[_0x4dc4('0xf')](_0x550be9[_0x4dc4('0x22')][_0x4dc4('0xf')]);_0x2f82d3[_0x4dc4('0xe')]=qs[_0x4dc4('0xe')](_0x550be9['query'][_0x4dc4('0xe')]);}return _0x2f631c[_0x4dc4('0x70')](_0x2f82d3);}})[_0x4dc4('0x13')](function(_0x4ad7ad){if(_0x4ad7ad){return _0x4ad7ad?{'count':_0x56bc1d,'rows':_0x4ad7ad}:null;}})['then'](respondWithResult(_0x2adb88,null))[_0x4dc4('0x2f')](handleError(_0x2adb88,null));}; \ No newline at end of file +var _0x9dbb=['./mailQueue.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','update','then','destroy','MailQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where','MailQueue','include','query','findAll','rows','show','model','keys','filters','intersection','attributes','length','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','describe','getMembers','findOne','UserMailQueue','fields','hasOwnProperty','order','sort','pick','MailQueueId','filter','options','User','UserId','agent','mailPause','updatedAt','createdAt','format','SIP','getTeams','Team','nolimit','addTeams','ids','online','voicePause','flatMap','Agents','each','forEach','emit','userMailQueue:save','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','every','TeamId','includes','all','union','compact','value','transaction','removeTeams','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','bluebird','lodash','squel','ioredis','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter'];(function(_0x5caf7e,_0x52e1bc){var _0x5c3435=function(_0xb77e11){while(--_0xb77e11){_0x5caf7e['push'](_0x5caf7e['shift']());}};_0x5c3435(++_0x52e1bc);}(_0x9dbb,0x1e3));var _0xb9db=function(_0x21aa5b,_0x2c808f){_0x21aa5b=_0x21aa5b-0x0;var _0x2ca4c8=_0x9dbb[_0x21aa5b];return _0x2ca4c8;};'use strict';var BPromise=require(_0xb9db('0x0'));var util=require('util');var _=require(_0xb9db('0x1'));var squel=require(_0xb9db('0x2'));var Redis=require(_0xb9db('0x3'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0xb9db('0x4'));var db=require(_0xb9db('0x5'))['db'];config['redis']=_['defaults'](config[_0xb9db('0x6')],{'host':_0xb9db('0x7'),'port':0x18eb});var socket=require(_0xb9db('0x8'))(new Redis(config[_0xb9db('0x6')]));require(_0xb9db('0x9'))['register'](socket);function respondWithStatusCode(_0x5800a3,_0x158121){_0x158121=_0x158121||0xcc;return function(_0x34b848){if(_0x34b848){return _0x5800a3[_0xb9db('0xa')](_0x158121);}return _0x5800a3['status'](_0x158121)[_0xb9db('0xb')]();};}function respondWithResult(_0x11d49d,_0x513969){_0x513969=_0x513969||0xc8;return function(_0x584e8c){if(_0x584e8c){return _0x11d49d[_0xb9db('0xc')](_0x513969)[_0xb9db('0xd')](_0x584e8c);}};}function respondWithFilteredResult(_0x1efab5,_0x153f64){return function(_0x3064f8){if(_0x3064f8){var _0x1fa5cb=typeof _0x153f64[_0xb9db('0xe')]===_0xb9db('0xf')&&typeof _0x153f64[_0xb9db('0x10')]===_0xb9db('0xf');var _0x3ecb12=_0x3064f8[_0xb9db('0x11')];var _0x562040=_0x1fa5cb?0x0:_0x153f64['offset'];var _0x3d4005=_0x1fa5cb?_0x3064f8[_0xb9db('0x11')]:_0x153f64[_0xb9db('0xe')]+_0x153f64['limit'];var _0x33e235;if(_0x3d4005>=_0x3ecb12){_0x3d4005=_0x3ecb12;_0x33e235=0xc8;}else{_0x33e235=0xce;}_0x1efab5[_0xb9db('0xc')](_0x33e235);return _0x1efab5[_0xb9db('0x12')]('Content-Range',_0x562040+'-'+_0x3d4005+'/'+_0x3ecb12)[_0xb9db('0xd')](_0x3064f8);}return null;};}function saveUpdates(_0x466168){return function(_0x36f794){if(_0x36f794){return _0x36f794[_0xb9db('0x13')](_0x466168)[_0xb9db('0x14')](function(_0x244d13){return _0x244d13;});}return null;};}function removeEntity(_0x4af9a5){return function(_0x5d20df){if(_0x5d20df){return _0x5d20df[_0xb9db('0x15')]()[_0xb9db('0x14')](function(){var _0x2980a7=_0x5d20df['get']({'plain':!![]});var _0x59296a=_0xb9db('0x16');return db[_0xb9db('0x17')][_0xb9db('0x15')]({'where':{'type':_0x59296a,'resourceId':_0x2980a7['id']}})[_0xb9db('0x14')](function(){return _0x5d20df;});})['then'](function(){_0x4af9a5[_0xb9db('0xc')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4bdd34){return function(_0x2aefe0){if(!_0x2aefe0){_0x4bdd34[_0xb9db('0xa')](0x194);}return _0x2aefe0;};}function handleError(_0x5cb2f0,_0x441a02){_0x441a02=_0x441a02||0x1f4;return function(_0x9209b6){logger[_0xb9db('0x18')](_0x9209b6[_0xb9db('0x19')]);if(_0x9209b6['name']){delete _0x9209b6[_0xb9db('0x1a')];}_0x5cb2f0['status'](_0x441a02)[_0xb9db('0x1b')](_0x9209b6);};}exports[_0xb9db('0x1c')]=function(_0x21006a,_0x7920b2){var _0x58771a={};var _0x548e58={'count':0x0,'rows':[]};var _0x3eb245=_[_0xb9db('0x1d')](db['MailQueue'][_0xb9db('0x1e')],function(_0x469fee){return{'name':_0x469fee[_0xb9db('0x1f')],'type':_0x469fee[_0xb9db('0x20')][_0xb9db('0x21')]};});_0x58771a=qs[_0xb9db('0x22')](_0x3eb245,_0x21006a);var _0x1678a6={'where':_0x58771a[_0xb9db('0x23')]};return db[_0xb9db('0x24')]['count'](_0x1678a6)[_0xb9db('0x14')](function(_0x415f87){_0x548e58[_0xb9db('0x11')]=_0x415f87;_0x58771a[_0xb9db('0x25')]=qs[_0xb9db('0x25')](_0x21006a[_0xb9db('0x26')]);return db[_0xb9db('0x24')][_0xb9db('0x27')](_0x58771a);})[_0xb9db('0x14')](function(_0x239753){_0x548e58[_0xb9db('0x28')]=_0x239753;return _0x548e58;})[_0xb9db('0x14')](respondWithFilteredResult(_0x7920b2,_0x58771a))['catch'](handleError(_0x7920b2,null));};exports[_0xb9db('0x29')]=function(_0x429ee6,_0x190f78){var _0x4db41a={'raw':!![],'where':{'id':_0x429ee6['params']['id']}},_0x2274c2={};_0x2274c2[_0xb9db('0x2a')]=_['keys'](db[_0xb9db('0x24')][_0xb9db('0x1e')]);_0x2274c2[_0xb9db('0x26')]=_[_0xb9db('0x2b')](_0x429ee6['query']);_0x2274c2[_0xb9db('0x2c')]=_[_0xb9db('0x2d')](_0x2274c2[_0xb9db('0x2a')],_0x2274c2['query']);_0x4db41a[_0xb9db('0x2e')]=_[_0xb9db('0x2d')](_0x2274c2[_0xb9db('0x2a')],qs['fields'](_0x429ee6['query']['fields']));_0x4db41a[_0xb9db('0x2e')]=_0x4db41a[_0xb9db('0x2e')][_0xb9db('0x2f')]?_0x4db41a[_0xb9db('0x2e')]:_0x2274c2[_0xb9db('0x2a')];if(_0x429ee6['query']['includeAll']){_0x4db41a[_0xb9db('0x25')]=[{'all':!![]}];}_0x4db41a=_[_0xb9db('0x30')]({},_0x4db41a,_0x429ee6['options']);return db[_0xb9db('0x24')][_0xb9db('0x31')](_0x4db41a)[_0xb9db('0x14')](handleEntityNotFound(_0x190f78,null))['then'](respondWithResult(_0x190f78,null))['catch'](handleError(_0x190f78,null));};exports[_0xb9db('0x32')]=function(_0x9bb84b,_0x514efa){return db[_0xb9db('0x24')][_0xb9db('0x32')](_0x9bb84b[_0xb9db('0x33')],{})[_0xb9db('0x14')](function(_0x1d9e9f){var _0x1dd4aa=_0x9bb84b[_0xb9db('0x34')][_0xb9db('0x35')]({'plain':!![]});if(!_0x1dd4aa)throw new Error(_0xb9db('0x36'));if(_0x1dd4aa['role']==='user'){var _0x1855f7=_0x1d9e9f[_0xb9db('0x35')]({'plain':!![]});var _0x11747d=_0xb9db('0x16');return db['UserProfileSection'][_0xb9db('0x31')]({'where':{'name':_0x11747d,'userProfileId':_0x1dd4aa['userProfileId']},'raw':!![]})[_0xb9db('0x14')](function(_0x13be05){if(_0x13be05&&_0x13be05[_0xb9db('0x37')]===0x0){return db[_0xb9db('0x17')][_0xb9db('0x32')]({'name':_0x1855f7['name'],'resourceId':_0x1855f7['id'],'type':_0x13be05[_0xb9db('0x1a')],'sectionId':_0x13be05['id']},{})[_0xb9db('0x14')](function(){return _0x1d9e9f;});}else{return _0x1d9e9f;}})['catch'](function(_0x9bd358){logger['error'](_0xb9db('0x38'),_0x9bd358);throw _0x9bd358;});}return _0x1d9e9f;})[_0xb9db('0x14')](respondWithResult(_0x514efa,0xc9))[_0xb9db('0x39')](handleError(_0x514efa,null));};exports['update']=function(_0x197335,_0x44b317){if(_0x197335['body']['id']){delete _0x197335[_0xb9db('0x33')]['id'];}return db[_0xb9db('0x24')][_0xb9db('0x31')]({'where':{'id':_0x197335[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](handleEntityNotFound(_0x44b317,null))['then'](saveUpdates(_0x197335[_0xb9db('0x33')],null))[_0xb9db('0x14')](respondWithResult(_0x44b317,null))[_0xb9db('0x39')](handleError(_0x44b317,null));};exports[_0xb9db('0x15')]=function(_0x1a3253,_0x316c06){return db[_0xb9db('0x24')]['find']({'where':{'id':_0x1a3253[_0xb9db('0x3a')]['id']}})['then'](handleEntityNotFound(_0x316c06,null))[_0xb9db('0x14')](removeEntity(_0x316c06,null))['catch'](handleError(_0x316c06,null));};exports[_0xb9db('0x3b')]=function(_0x2f6b72,_0x584909){return db[_0xb9db('0x24')][_0xb9db('0x3b')]()['then'](respondWithResult(_0x584909,null))['catch'](handleError(_0x584909,null));};exports[_0xb9db('0x3c')]=function(_0x30d62b,_0x162a66){var _0x17e0f4={'raw':!![],'where':{}},_0x29f85d={},_0x27d110;return db[_0xb9db('0x24')][_0xb9db('0x3d')]({'where':{'id':_0x30d62b[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](handleEntityNotFound(_0x162a66,null))['then'](function(_0x3d6e63){if(_0x3d6e63){_0x27d110=_0x3d6e63['get']({'plain':!![]});_0x29f85d[_0xb9db('0x2a')]=_[_0xb9db('0x2b')](db[_0xb9db('0x3e')]['rawAttributes']);_0x29f85d[_0xb9db('0x26')]=_[_0xb9db('0x2b')](_0x30d62b['query']);_0x29f85d[_0xb9db('0x2c')]=_['intersection'](_0x29f85d[_0xb9db('0x2a')],_0x29f85d['query']);_0x17e0f4[_0xb9db('0x2e')]=_[_0xb9db('0x2d')](_0x29f85d[_0xb9db('0x2a')],qs[_0xb9db('0x3f')](_0x30d62b[_0xb9db('0x26')][_0xb9db('0x3f')]));_0x17e0f4[_0xb9db('0x2e')]=_0x17e0f4[_0xb9db('0x2e')][_0xb9db('0x2f')]?_0x17e0f4[_0xb9db('0x2e')]:_0x29f85d[_0xb9db('0x2a')];if(!_0x30d62b[_0xb9db('0x26')][_0xb9db('0x40')]('nolimit')){_0x17e0f4[_0xb9db('0x10')]=qs[_0xb9db('0x10')](_0x30d62b[_0xb9db('0x26')][_0xb9db('0x10')]);_0x17e0f4['offset']=qs[_0xb9db('0xe')](_0x30d62b[_0xb9db('0x26')]['offset']);}_0x17e0f4[_0xb9db('0x41')]=qs[_0xb9db('0x42')](_0x30d62b[_0xb9db('0x26')][_0xb9db('0x42')]);_0x17e0f4[_0xb9db('0x23')]=qs[_0xb9db('0x2c')](_[_0xb9db('0x43')](_0x30d62b['query'],_0x29f85d['filters']));_0x17e0f4[_0xb9db('0x23')][_0xb9db('0x44')]=_0x3d6e63['id'];if(_0x30d62b[_0xb9db('0x26')][_0xb9db('0x45')]){_0x17e0f4[_0xb9db('0x23')]=_[_0xb9db('0x30')](_0x17e0f4['where'],{'$or':_[_0xb9db('0x1d')](_0x17e0f4[_0xb9db('0x2e')],function(_0x2d0d80){var _0x4d6a12={};_0x4d6a12[_0x2d0d80]={'$like':'%'+_0x30d62b[_0xb9db('0x26')][_0xb9db('0x45')]+'%'};return _0x4d6a12;})});}_0x17e0f4=_[_0xb9db('0x30')]({},_0x17e0f4,_0x30d62b[_0xb9db('0x46')]);return db[_0xb9db('0x3e')]['findAll'](_0x17e0f4);}})[_0xb9db('0x14')](function(_0x3ea9bb){if(_0x3ea9bb){return db[_0xb9db('0x47')]['findAndCountAll']({'where':{'id':_[_0xb9db('0x1d')](_0x3ea9bb,_0xb9db('0x48')),'role':_0xb9db('0x49')},'attributes':['id',_0xb9db('0x1a'),_0xb9db('0x4a'),_0xb9db('0x4b'),_0xb9db('0x4c')]});}})['then'](function(_0x41054f){if(_0x41054f){return{'count':_0x41054f[_0xb9db('0x11')],'rows':_[_0xb9db('0x1d')](_0x41054f['rows'],function(_0x50e989){return{'membername':_0x50e989['name'],'UserId':_0x50e989['id'],'queue_name':_0x27d110[_0xb9db('0x1a')],'MailQueueId':_0x27d110['id'],'interface':util[_0xb9db('0x4d')]('%s/%s',_0xb9db('0x4e'),_0x50e989['name']),'penalty':0x0,'paused':_0x50e989[_0xb9db('0x4a')],'createdAt':_0x50e989['createdAt'],'updatedAt':_0x50e989['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xb9db('0x14')](respondWithFilteredResult(_0x162a66,_0x17e0f4))[_0xb9db('0x39')](handleError(_0x162a66,null));};exports[_0xb9db('0x4f')]=function(_0xeb4c6,_0xc6f952){var _0x33a676={};var _0x26b7f0={};var _0x237882;var _0x14f235;return db['MailQueue'][_0xb9db('0x3d')]({'where':{'id':_0xeb4c6[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](handleEntityNotFound(_0xc6f952,null))[_0xb9db('0x14')](function(_0x4e6fd2){if(_0x4e6fd2){_0x237882=_0x4e6fd2;_0x26b7f0[_0xb9db('0x2a')]=_[_0xb9db('0x2b')](db[_0xb9db('0x50')][_0xb9db('0x1e')]);_0x26b7f0['query']=_['keys'](_0xeb4c6[_0xb9db('0x26')]);_0x26b7f0['filters']=_[_0xb9db('0x2d')](_0x26b7f0['model'],_0x26b7f0['query']);_0x33a676[_0xb9db('0x2e')]=_[_0xb9db('0x2d')](_0x26b7f0[_0xb9db('0x2a')],qs[_0xb9db('0x3f')](_0xeb4c6['query']['fields']));_0x33a676[_0xb9db('0x2e')]=_0x33a676[_0xb9db('0x2e')][_0xb9db('0x2f')]?_0x33a676[_0xb9db('0x2e')]:_0x26b7f0['model'];_0x33a676[_0xb9db('0x41')]=qs['sort'](_0xeb4c6[_0xb9db('0x26')][_0xb9db('0x42')]);_0x33a676[_0xb9db('0x23')]=qs['filters'](_[_0xb9db('0x43')](_0xeb4c6['query'],_0x26b7f0['filters']));if(_0xeb4c6[_0xb9db('0x26')]['filter']){_0x33a676['where']=_[_0xb9db('0x30')](_0x33a676[_0xb9db('0x23')],{'$or':_[_0xb9db('0x1d')](_0x33a676[_0xb9db('0x2e')],function(_0x48337e){var _0x27e666={};_0x27e666[_0x48337e]={'$like':'%'+_0xeb4c6['query'][_0xb9db('0x45')]+'%'};return _0x27e666;})});}_0x33a676=_[_0xb9db('0x30')]({},_0x33a676,_0xeb4c6[_0xb9db('0x46')]);return _0x237882[_0xb9db('0x4f')](_0x33a676);}})[_0xb9db('0x14')](function(_0x26a560){if(_0x26a560){_0x14f235=_0x26a560[_0xb9db('0x2f')];if(!_0xeb4c6[_0xb9db('0x26')][_0xb9db('0x40')](_0xb9db('0x51'))){_0x33a676[_0xb9db('0x10')]=qs[_0xb9db('0x10')](_0xeb4c6[_0xb9db('0x26')][_0xb9db('0x10')]);_0x33a676[_0xb9db('0xe')]=qs[_0xb9db('0xe')](_0xeb4c6[_0xb9db('0x26')]['offset']);}return _0x237882[_0xb9db('0x4f')](_0x33a676);}})['then'](function(_0x48518a){if(_0x48518a){return _0x48518a?{'count':_0x14f235,'rows':_0x48518a}:null;}})['then'](respondWithResult(_0xc6f952,null))['catch'](handleError(_0xc6f952,null));};exports[_0xb9db('0x52')]=function(_0x290eb7,_0x587f95){var _0x709a72=_0x290eb7[_0xb9db('0x33')][_0xb9db('0x53')];return db['Team'][_0xb9db('0x27')]({'where':{'id':_0x709a72},'attributes':['id'],'include':[{'model':db[_0xb9db('0x47')],'as':'Agents','attributes':['id',_0xb9db('0x1a'),_0xb9db('0x54'),_0xb9db('0x55'),'interface'],'raw':!![]}]})[_0xb9db('0x14')](function(_0x25638b){if(_0x25638b){var _0x193f15=_[_0xb9db('0x56')](_0x25638b,function(_0x5dbfb6){var _0x2d963d=_0x5dbfb6[_0xb9db('0x35')]({'plain':!![]});return _0x2d963d[_0xb9db('0x57')];});return db[_0xb9db('0x24')][_0xb9db('0x31')]({'where':{'id':_0x290eb7[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](function(_0x4c6dcc){return db['sequelize']['transaction'](function(_0x3efb76){return _0x4c6dcc[_0xb9db('0x52')](_0x709a72,{'transaction':_0x3efb76})['then'](function(){return BPromise[_0xb9db('0x58')](_0x193f15,function(_0x31b4c4){return db[_0xb9db('0x3e')]['findOrCreate']({'where':{'UserId':_0x31b4c4['id'],'MailQueueId':_0x290eb7[_0xb9db('0x3a')]['id']},'transaction':_0x3efb76});});})[_0xb9db('0x14')](function(){_0x193f15[_0xb9db('0x59')](function(_0xe52984){socket[_0xb9db('0x5a')](_0xb9db('0x5b'),{'UserId':_0xe52984['id'],'MailQueueId':_0x4c6dcc['id']});});});});});}})['then'](respondWithStatusCode(_0x587f95,null))[_0xb9db('0x39')](handleError(_0x587f95,null));};exports['removeTeams']=function(_0x43fd63,_0x4d64e0){return db[_0xb9db('0x50')][_0xb9db('0x27')]({'where':{'id':_0x43fd63['query'][_0xb9db('0x53')]},'attributes':['id'],'include':[{'model':db[_0xb9db('0x47')],'as':_0xb9db('0x57'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4d64e0,null))[_0xb9db('0x14')](function(_0x5df674){var _0x5f2c99=_[_0xb9db('0x1d')](_0x5df674,'id');var _0x8ed7cd=[];var _0x63aa41=[];var _0x1f1d02=squel[_0xb9db('0x5c')]();_0x1f1d02[_0xb9db('0x5d')](_0xb9db('0x5e'))[_0xb9db('0x5f')](_0xb9db('0x60'),'tq')[_0xb9db('0x61')](_0xb9db('0x62'),'ut',_0xb9db('0x63'))[_0xb9db('0x23')](_0xb9db('0x64'),_0x43fd63[_0xb9db('0x3a')]['id']);for(var _0x5f5b05=0x0;_0x5f5b05<_0x5df674[_0xb9db('0x2f')];_0x5f5b05+=0x1){let _0x8f88e9=_0x5df674[_0x5f5b05];for(var _0x24e3a9=0x0;_0x24e3a9<_0x8f88e9[_0xb9db('0x57')][_0xb9db('0x2f')];_0x24e3a9+=0x1){let _0x59200d=_0x8f88e9[_0xb9db('0x57')][_0x24e3a9];var _0x45be84=_0x1f1d02[_0xb9db('0x65')]();_0x45be84[_0xb9db('0x23')](_0xb9db('0x66'),_0x59200d['id']);_0x63aa41[_0xb9db('0x67')](db[_0xb9db('0x68')][_0xb9db('0x26')](_0x45be84[_0xb9db('0x69')](),{'type':db[_0xb9db('0x68')][_0xb9db('0x6a')]['SELECT']})['then'](function(_0x200274){if(_0x200274[_0xb9db('0x2f')]===0x1){return _0x59200d['id'];}else{var _0x152971=_[_0xb9db('0x6b')](_[_0xb9db('0x1d')](_0x200274,_0xb9db('0x6c')),function(_0x65db49){return _[_0xb9db('0x6d')](_0x5f2c99,_0x65db49);});if(_0x152971){return _0x59200d['id'];}}}));}}return BPromise[_0xb9db('0x6e')](_0x63aa41)[_0xb9db('0x14')](function(_0x6225ff){_0x8ed7cd=_(_0x8ed7cd)[_0xb9db('0x6f')](_0x6225ff)[_0xb9db('0x70')]()[_0xb9db('0x71')]();return db['MailQueue']['find']({'where':{'id':_0x43fd63[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](function(_0x1e6838){return db[_0xb9db('0x68')][_0xb9db('0x72')](function(_0x29bd3c){return _0x1e6838[_0xb9db('0x73')](_0x43fd63[_0xb9db('0x26')][_0xb9db('0x53')],{'transaction':_0x29bd3c})[_0xb9db('0x14')](function(){if(!_[_0xb9db('0x74')](_0x8ed7cd)){return _0x1e6838[_0xb9db('0x75')](_0x8ed7cd,{'transaction':_0x29bd3c});}})[_0xb9db('0x14')](function(){_0x8ed7cd[_0xb9db('0x59')](function(_0x51cf68){socket[_0xb9db('0x5a')](_0xb9db('0x76'),{'UserId':_0x51cf68,'MailQueueId':_0x1e6838['id']});});});});});});})[_0xb9db('0x14')](respondWithStatusCode(_0x4d64e0,null))[_0xb9db('0x39')](handleError(_0x4d64e0,null));};exports[_0xb9db('0x77')]=function(_0x1359e2,_0x27bc69){return db['MailQueue'][_0xb9db('0x31')]({'where':{'id':_0x1359e2[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](handleEntityNotFound(_0x27bc69,null))[_0xb9db('0x14')](function(_0x53b640){if(_0x53b640){return _0x53b640[_0xb9db('0x77')](_0x1359e2[_0xb9db('0x33')][_0xb9db('0x53')],_[_0xb9db('0x78')](_0x1359e2[_0xb9db('0x33')],[_0xb9db('0x53'),'id'])||{})[_0xb9db('0x79')](function(_0x134318){for(var _0x518045=0x0;_0x518045<_0x1359e2[_0xb9db('0x33')]['ids']['length'];_0x518045+=0x1){socket['emit'](_0xb9db('0x5b'),{'UserId':Number(_0x1359e2[_0xb9db('0x33')][_0xb9db('0x53')][_0x518045]),'MailQueueId':Number(_0x1359e2[_0xb9db('0x3a')]['id'])});}return _0x134318;});}})[_0xb9db('0x14')](respondWithResult(_0x27bc69,null))[_0xb9db('0x39')](handleError(_0x27bc69,null));};exports[_0xb9db('0x75')]=function(_0x510f1c,_0x4b179a){return db[_0xb9db('0x24')][_0xb9db('0x31')]({'where':{'id':_0x510f1c[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](handleEntityNotFound(_0x4b179a,null))[_0xb9db('0x14')](function(_0x4b072f){if(_0x4b072f){return _0x4b072f['removeAgents'](_0x510f1c[_0xb9db('0x26')][_0xb9db('0x53')])['then'](function(){if(_['isArray'](_0x510f1c[_0xb9db('0x26')]['ids'])){for(var _0x12f412=0x0;_0x12f412<_0x510f1c[_0xb9db('0x26')][_0xb9db('0x53')][_0xb9db('0x2f')];_0x12f412+=0x1){socket[_0xb9db('0x5a')](_0xb9db('0x76'),{'UserId':Number(_0x510f1c[_0xb9db('0x26')][_0xb9db('0x53')][_0x12f412]),'MailQueueId':Number(_0x510f1c[_0xb9db('0x3a')]['id'])});}}else{socket['emit'](_0xb9db('0x76'),{'UserId':Number(_0x510f1c[_0xb9db('0x26')][_0xb9db('0x53')]),'MailQueueId':Number(_0x510f1c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4b179a,null))['catch'](handleError(_0x4b179a,null));};exports[_0xb9db('0x7a')]=function(_0x1b9f41,_0x5882bb){var _0x3b12dd={};var _0x5de8d1={};var _0x29ad30;var _0x545d44;return db[_0xb9db('0x24')]['findOne']({'where':{'id':_0x1b9f41[_0xb9db('0x3a')]['id']}})[_0xb9db('0x14')](handleEntityNotFound(_0x5882bb,null))['then'](function(_0x9a26db){if(_0x9a26db){_0x29ad30=_0x9a26db;_0x5de8d1[_0xb9db('0x2a')]=_[_0xb9db('0x2b')](db[_0xb9db('0x47')][_0xb9db('0x1e')]);_0x5de8d1['query']=_[_0xb9db('0x2b')](_0x1b9f41[_0xb9db('0x26')]);_0x5de8d1['filters']=_[_0xb9db('0x2d')](_0x5de8d1[_0xb9db('0x2a')],_0x5de8d1[_0xb9db('0x26')]);_0x3b12dd[_0xb9db('0x2e')]=_[_0xb9db('0x2d')](_0x5de8d1[_0xb9db('0x2a')],qs[_0xb9db('0x3f')](_0x1b9f41[_0xb9db('0x26')]['fields']));_0x3b12dd[_0xb9db('0x2e')]=_0x3b12dd[_0xb9db('0x2e')]['length']?_0x3b12dd['attributes']:_0x5de8d1[_0xb9db('0x2a')];_0x3b12dd[_0xb9db('0x41')]=qs[_0xb9db('0x42')](_0x1b9f41[_0xb9db('0x26')]['sort']);_0x3b12dd[_0xb9db('0x23')]=qs['filters'](_[_0xb9db('0x43')](_0x1b9f41[_0xb9db('0x26')],_0x5de8d1['filters']));if(_0x1b9f41[_0xb9db('0x26')][_0xb9db('0x45')]){_0x3b12dd[_0xb9db('0x23')]=_[_0xb9db('0x30')](_0x3b12dd[_0xb9db('0x23')],{'$or':_[_0xb9db('0x1d')](_0x3b12dd['attributes'],function(_0x129e2f){var _0x2bce3c={};_0x2bce3c[_0x129e2f]={'$like':'%'+_0x1b9f41[_0xb9db('0x26')]['filter']+'%'};return _0x2bce3c;})});}_0x3b12dd=_['merge']({},_0x3b12dd,_0x1b9f41['options']);return _0x29ad30[_0xb9db('0x7a')](_0x3b12dd);}})[_0xb9db('0x14')](function(_0xa59637){if(_0xa59637){_0x545d44=_0xa59637['length'];if(!_0x1b9f41[_0xb9db('0x26')][_0xb9db('0x40')](_0xb9db('0x51'))){_0x3b12dd['limit']=qs[_0xb9db('0x10')](_0x1b9f41['query'][_0xb9db('0x10')]);_0x3b12dd[_0xb9db('0xe')]=qs[_0xb9db('0xe')](_0x1b9f41[_0xb9db('0x26')][_0xb9db('0xe')]);}return _0x29ad30[_0xb9db('0x7a')](_0x3b12dd);}})[_0xb9db('0x14')](function(_0x34787c){if(_0x34787c){return _0x34787c?{'count':_0x545d44,'rows':_0x34787c}:null;}})[_0xb9db('0x14')](respondWithResult(_0x5882bb,null))['catch'](handleError(_0x5882bb,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 8a43543..d8b8bfe 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 _0x516f=['save','update','emit','hasOwnProperty','exports','events','../../mysqldb','MailQueue','setMaxListeners'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x516f,0x10a));var _0xf516=function(_0xc56a3f,_0x2189a4){_0xc56a3f=_0xc56a3f-0x0;var _0x23a1ec=_0x516f[_0xc56a3f];return _0x23a1ec;};'use strict';var EventEmitter=require(_0xf516('0x0'));var MailQueue=require(_0xf516('0x1'))['db'][_0xf516('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xf516('0x3')](0x0);var events={'afterCreate':_0xf516('0x4'),'afterUpdate':_0xf516('0x5'),'afterDestroy':'remove'};function emitEvent(_0x479dfc){return function(_0x3fd7c1,_0x130b28,_0x5b70bd){MailQueueEvents['emit'](_0x479dfc+':'+_0x3fd7c1['id'],_0x3fd7c1);MailQueueEvents[_0xf516('0x6')](_0x479dfc,_0x3fd7c1);_0x5b70bd(null);};}for(var e in events){if(events[_0xf516('0x7')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xf516('0x8')]=MailQueueEvents; \ No newline at end of file +var _0xa7d5=['emit','MailQueue','setMaxListeners','save','update','remove'];(function(_0x1bc635,_0x4a1b08){var _0x1179e0=function(_0x48b2ed){while(--_0x48b2ed){_0x1bc635['push'](_0x1bc635['shift']());}};_0x1179e0(++_0x4a1b08);}(_0xa7d5,0x151));var _0x5a7d=function(_0x412bb3,_0x3c906b){_0x412bb3=_0x412bb3-0x0;var _0x339cf9=_0xa7d5[_0x412bb3];return _0x339cf9;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db'][_0x5a7d('0x0')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x5a7d('0x1')](0x0);var events={'afterCreate':_0x5a7d('0x2'),'afterUpdate':_0x5a7d('0x3'),'afterDestroy':_0x5a7d('0x4')};function emitEvent(_0xc59dd){return function(_0xf983cc,_0x3ac3ab,_0x49c834){MailQueueEvents[_0x5a7d('0x5')](_0xc59dd+':'+_0xf983cc['id'],_0xf983cc);MailQueueEvents[_0x5a7d('0x5')](_0xc59dd,_0xf983cc);_0x49c834(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index c6f7af7..0d45985 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 _0x4902=['exports','define','MailQueue','mail_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x520c01,_0xc9782e){var _0x1cea4a=function(_0x4f6dc1){while(--_0x4f6dc1){_0x520c01['push'](_0x520c01['shift']());}};_0x1cea4a(++_0xc9782e);}(_0x4902,0x86));var _0x2490=function(_0x1892a3,_0x5e5d83){_0x1892a3=_0x1892a3-0x0;var _0x551b4e=_0x4902[_0x1892a3];return _0x551b4e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2490('0x0'))(_0x2490('0x1'));var moment=require(_0x2490('0x2'));var BPromise=require(_0x2490('0x3'));var rp=require(_0x2490('0x4'));var fs=require('fs');var path=require(_0x2490('0x5'));var rimraf=require(_0x2490('0x6'));var config=require(_0x2490('0x7'));var attributes=require(_0x2490('0x8'));module[_0x2490('0x9')]=function(_0x244e94,_0x104fac){return _0x244e94[_0x2490('0xa')](_0x2490('0xb'),attributes,{'tableName':_0x2490('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7018=['request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','moment','bluebird'];(function(_0x37b66d,_0x58c084){var _0x3eb80b=function(_0x3e1331){while(--_0x3e1331){_0x37b66d['push'](_0x37b66d['shift']());}};_0x3eb80b(++_0x58c084);}(_0x7018,0x134));var _0x8701=function(_0x4c80d,_0x5a03cc){_0x4c80d=_0x4c80d-0x0;var _0x3e9b9b=_0x7018[_0x4c80d];return _0x3e9b9b;};'use strict';var _=require(_0x8701('0x0'));var util=require(_0x8701('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8701('0x2'));var BPromise=require(_0x8701('0x3'));var rp=require(_0x8701('0x4'));var fs=require('fs');var path=require(_0x8701('0x5'));var rimraf=require(_0x8701('0x6'));var config=require(_0x8701('0x7'));var attributes=require(_0x8701('0x8'));module[_0x8701('0x9')]=function(_0xf5f91d,_0x946b2b){return _0xf5f91d[_0x8701('0xa')](_0x8701('0xb'),attributes,{'tableName':_0x8701('0xc'),'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 aad8780..ffe0314 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 _0xe868=['model','map','GetMailQueue','MailQueue','ShowMailQueue','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll','options','raw','where','attributes','include'];(function(_0x2a01e9,_0x3bbde5){var _0x52d471=function(_0x410cb3){while(--_0x410cb3){_0x2a01e9['push'](_0x2a01e9['shift']());}};_0x52d471(++_0x3bbde5);}(_0xe868,0x75));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8e86('0x0'));var util=require(_0x8e86('0x1'));var moment=require(_0x8e86('0x2'));var BPromise=require(_0x8e86('0x3'));var rs=require(_0x8e86('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8e86('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8e86('0x6'));var config=require(_0x8e86('0x7'));var jayson=require(_0x8e86('0x8'));var client=jayson[_0x8e86('0x9')][_0x8e86('0xa')]({'port':0x232a});config[_0x8e86('0xb')]=_['defaults'](config[_0x8e86('0xb')],{'host':_0x8e86('0xc'),'port':0x18eb});var socket=require(_0x8e86('0xd'))(new Redis(config[_0x8e86('0xb')]));require(_0x8e86('0xe'))['register'](socket);function respondWithRpcPromise(_0x4133c4,_0x783be4,_0x210968){return new BPromise(function(_0x286a8a,_0x362196){return client['request'](_0x4133c4,_0x210968)[_0x8e86('0xf')](function(_0x44dec9){logger[_0x8e86('0x10')](_0x8e86('0x11'),_0x783be4,_0x8e86('0x12'));logger[_0x8e86('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x783be4,_0x8e86('0x12'),JSON[_0x8e86('0x14')](_0x44dec9));if(_0x44dec9[_0x8e86('0x15')]){if(_0x44dec9[_0x8e86('0x15')][_0x8e86('0x16')]===0x1f4){logger[_0x8e86('0x15')]('MailQueue,\x20%s,\x20%s',_0x783be4,_0x44dec9[_0x8e86('0x15')][_0x8e86('0x17')]);return _0x362196(_0x44dec9[_0x8e86('0x15')][_0x8e86('0x17')]);}logger[_0x8e86('0x15')](_0x8e86('0x11'),_0x783be4,_0x44dec9[_0x8e86('0x15')][_0x8e86('0x17')]);return _0x286a8a(_0x44dec9[_0x8e86('0x15')][_0x8e86('0x17')]);}else{logger[_0x8e86('0x10')](_0x8e86('0x11'),_0x783be4,_0x8e86('0x12'));_0x286a8a(_0x44dec9[_0x8e86('0x18')]['message']);}})['catch'](function(_0x534d6e){logger[_0x8e86('0x15')]('MailQueue,\x20%s,\x20%s',_0x783be4,_0x534d6e);_0x362196(_0x534d6e);});});}exports['GetMailQueue']=function(_0x3811d7){var _0x3fadb4=this;return new Promise(function(_0x1ea2cb,_0x1795f6){return db['MailQueue'][_0x8e86('0x19')]({'raw':_0x3811d7[_0x8e86('0x1a')]?_0x3811d7[_0x8e86('0x1a')][_0x8e86('0x1b')]===undefined?!![]:![]:!![],'where':_0x3811d7[_0x8e86('0x1a')]?_0x3811d7[_0x8e86('0x1a')][_0x8e86('0x1c')]||null:null,'attributes':_0x3811d7[_0x8e86('0x1a')]?_0x3811d7['options'][_0x8e86('0x1d')]||null:null,'limit':_0x3811d7['options']?_0x3811d7['options']['limit']||null:null,'include':_0x3811d7[_0x8e86('0x1a')]?_0x3811d7[_0x8e86('0x1a')][_0x8e86('0x1e')]?_['map'](_0x3811d7['options'][_0x8e86('0x1e')],function(_0xd717ab){return{'model':db[_0xd717ab[_0x8e86('0x1f')]],'as':_0xd717ab['as'],'attributes':_0xd717ab[_0x8e86('0x1d')],'include':_0xd717ab[_0x8e86('0x1e')]?_[_0x8e86('0x20')](_0xd717ab[_0x8e86('0x1e')],function(_0x2554ad){return{'model':db[_0x2554ad[_0x8e86('0x1f')]],'as':_0x2554ad['as'],'attributes':_0x2554ad[_0x8e86('0x1d')],'include':_0x2554ad[_0x8e86('0x1e')]?_[_0x8e86('0x20')](_0x2554ad[_0x8e86('0x1e')],function(_0xec0b57){return{'model':db[_0xec0b57['model']],'as':_0xec0b57['as'],'attributes':_0xec0b57[_0x8e86('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x8e86('0xf')](function(_0x131357){logger[_0x8e86('0x10')](_0x8e86('0x21'),_0x3811d7);logger[_0x8e86('0x13')](_0x8e86('0x21'),_0x3811d7,JSON[_0x8e86('0x14')](_0x131357));_0x1ea2cb(_0x131357);})['catch'](function(_0x131030){logger[_0x8e86('0x15')](_0x8e86('0x21'),_0x131030[_0x8e86('0x17')],_0x3811d7);_0x1795f6(_0x3fadb4[_0x8e86('0x15')](0x1f4,_0x131030[_0x8e86('0x17')]));});});};exports['ShowMailQueue']=function(_0x515d09){var _0x58d215=this;return new Promise(function(_0x4139f3,_0x5d698f){return db[_0x8e86('0x22')]['find']({'raw':_0x515d09[_0x8e86('0x1a')]?_0x515d09[_0x8e86('0x1a')][_0x8e86('0x1b')]===undefined?!![]:![]:!![],'where':_0x515d09['options']?_0x515d09[_0x8e86('0x1a')][_0x8e86('0x1c')]||null:null,'attributes':_0x515d09['options']?_0x515d09[_0x8e86('0x1a')][_0x8e86('0x1d')]||null:null,'include':_0x515d09[_0x8e86('0x1a')]?_0x515d09[_0x8e86('0x1a')][_0x8e86('0x1e')]?_[_0x8e86('0x20')](_0x515d09['options'][_0x8e86('0x1e')],function(_0x199364){return{'model':db[_0x199364['model']],'as':_0x199364['as'],'attributes':_0x199364['attributes'],'include':_0x199364[_0x8e86('0x1e')]?_[_0x8e86('0x20')](_0x199364[_0x8e86('0x1e')],function(_0x3e20ec){return{'model':db[_0x3e20ec['model']],'as':_0x3e20ec['as'],'attributes':_0x3e20ec['attributes'],'include':_0x3e20ec['include']?_[_0x8e86('0x20')](_0x3e20ec['include'],function(_0x353e9d){return{'model':db[_0x353e9d[_0x8e86('0x1f')]],'as':_0x353e9d['as'],'attributes':_0x353e9d[_0x8e86('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x528627){logger[_0x8e86('0x10')]('ShowMailQueue',_0x515d09);logger[_0x8e86('0x13')](_0x8e86('0x23'),_0x515d09,JSON[_0x8e86('0x14')](_0x528627));_0x4139f3(_0x528627);})[_0x8e86('0x24')](function(_0xd0a9eb){logger[_0x8e86('0x15')]('ShowMailQueue',_0xd0a9eb[_0x8e86('0x17')],_0x515d09);_0x5d698f(_0x58d215[_0x8e86('0x15')](0x1f4,_0xd0a9eb[_0x8e86('0x17')]));});});}; \ No newline at end of file +var _0x692e=['client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowMailQueue','find','util','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4cacfb,_0x380269){var _0x1a684e=function(_0x49a470){while(--_0x49a470){_0x4cacfb['push'](_0x4cacfb['shift']());}};_0x1a684e(++_0x380269);}(_0x692e,0x6c));var _0xe692=function(_0x32e034,_0x71502){_0x32e034=_0x32e034-0x0;var _0x105f5b=_0x692e[_0x32e034];return _0x105f5b;};'use strict';var _=require('lodash');var util=require(_0xe692('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe692('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0xe692('0x2'));var logger=require('../../config/logger')(_0xe692('0x3'));var config=require(_0xe692('0x4'));var jayson=require(_0xe692('0x5'));var client=jayson[_0xe692('0x6')][_0xe692('0x7')]({'port':0x232a});config[_0xe692('0x8')]=_['defaults'](config[_0xe692('0x8')],{'host':_0xe692('0x9'),'port':0x18eb});var socket=require(_0xe692('0xa'))(new Redis(config[_0xe692('0x8')]));require(_0xe692('0xb'))[_0xe692('0xc')](socket);function respondWithRpcPromise(_0x2fd4b1,_0x4a0a26,_0x54a1a0){return new BPromise(function(_0x4abe9f,_0x1a17ed){return client[_0xe692('0xd')](_0x2fd4b1,_0x54a1a0)[_0xe692('0xe')](function(_0x3f7d2a){logger[_0xe692('0xf')](_0xe692('0x10'),_0x4a0a26,'request\x20sent');logger['debug'](_0xe692('0x11'),_0x4a0a26,_0xe692('0x12'),JSON[_0xe692('0x13')](_0x3f7d2a));if(_0x3f7d2a['error']){if(_0x3f7d2a[_0xe692('0x14')][_0xe692('0x15')]===0x1f4){logger['error'](_0xe692('0x10'),_0x4a0a26,_0x3f7d2a[_0xe692('0x14')][_0xe692('0x16')]);return _0x1a17ed(_0x3f7d2a[_0xe692('0x14')][_0xe692('0x16')]);}logger[_0xe692('0x14')](_0xe692('0x10'),_0x4a0a26,_0x3f7d2a[_0xe692('0x14')][_0xe692('0x16')]);return _0x4abe9f(_0x3f7d2a[_0xe692('0x14')][_0xe692('0x16')]);}else{logger[_0xe692('0xf')](_0xe692('0x10'),_0x4a0a26,_0xe692('0x12'));_0x4abe9f(_0x3f7d2a['result'][_0xe692('0x16')]);}})[_0xe692('0x17')](function(_0x58ed26){logger[_0xe692('0x14')](_0xe692('0x10'),_0x4a0a26,_0x58ed26);_0x1a17ed(_0x58ed26);});});}exports[_0xe692('0x18')]=function(_0xad3ebb){var _0x373409=this;return new Promise(function(_0x19a94b,_0x1b35af){return db[_0xe692('0x19')][_0xe692('0x1a')]({'raw':_0xad3ebb[_0xe692('0x1b')]?_0xad3ebb[_0xe692('0x1b')][_0xe692('0x1c')]===undefined?!![]:![]:!![],'where':_0xad3ebb[_0xe692('0x1b')]?_0xad3ebb['options'][_0xe692('0x1d')]||null:null,'attributes':_0xad3ebb[_0xe692('0x1b')]?_0xad3ebb[_0xe692('0x1b')][_0xe692('0x1e')]||null:null,'limit':_0xad3ebb[_0xe692('0x1b')]?_0xad3ebb['options'][_0xe692('0x1f')]||null:null,'include':_0xad3ebb[_0xe692('0x1b')]?_0xad3ebb[_0xe692('0x1b')]['include']?_[_0xe692('0x20')](_0xad3ebb[_0xe692('0x1b')][_0xe692('0x21')],function(_0x8bca85){return{'model':db[_0x8bca85[_0xe692('0x22')]],'as':_0x8bca85['as'],'attributes':_0x8bca85[_0xe692('0x1e')],'include':_0x8bca85[_0xe692('0x21')]?_['map'](_0x8bca85[_0xe692('0x21')],function(_0xc1232){return{'model':db[_0xc1232[_0xe692('0x22')]],'as':_0xc1232['as'],'attributes':_0xc1232['attributes'],'include':_0xc1232['include']?_[_0xe692('0x20')](_0xc1232[_0xe692('0x21')],function(_0x28da73){return{'model':db[_0x28da73[_0xe692('0x22')]],'as':_0x28da73['as'],'attributes':_0x28da73['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c4a8a){logger[_0xe692('0xf')](_0xe692('0x18'),_0xad3ebb);logger[_0xe692('0x23')](_0xe692('0x18'),_0xad3ebb,JSON[_0xe692('0x13')](_0x4c4a8a));_0x19a94b(_0x4c4a8a);})[_0xe692('0x17')](function(_0x4123f7){logger[_0xe692('0x14')](_0xe692('0x18'),_0x4123f7['message'],_0xad3ebb);_0x1b35af(_0x373409['error'](0x1f4,_0x4123f7[_0xe692('0x16')]));});});};exports[_0xe692('0x24')]=function(_0x52467b){var _0x2f5b79=this;return new Promise(function(_0x252d1e,_0x11f91a){return db['MailQueue'][_0xe692('0x25')]({'raw':_0x52467b[_0xe692('0x1b')]?_0x52467b[_0xe692('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x52467b[_0xe692('0x1b')]?_0x52467b[_0xe692('0x1b')][_0xe692('0x1d')]||null:null,'attributes':_0x52467b[_0xe692('0x1b')]?_0x52467b[_0xe692('0x1b')]['attributes']||null:null,'include':_0x52467b['options']?_0x52467b[_0xe692('0x1b')]['include']?_['map'](_0x52467b[_0xe692('0x1b')][_0xe692('0x21')],function(_0xc51ebd){return{'model':db[_0xc51ebd[_0xe692('0x22')]],'as':_0xc51ebd['as'],'attributes':_0xc51ebd[_0xe692('0x1e')],'include':_0xc51ebd[_0xe692('0x21')]?_[_0xe692('0x20')](_0xc51ebd[_0xe692('0x21')],function(_0x39a950){return{'model':db[_0x39a950[_0xe692('0x22')]],'as':_0x39a950['as'],'attributes':_0x39a950[_0xe692('0x1e')],'include':_0x39a950['include']?_['map'](_0x39a950[_0xe692('0x21')],function(_0x54d86c){return{'model':db[_0x54d86c['model']],'as':_0x54d86c['as'],'attributes':_0x54d86c[_0xe692('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x219ca7){logger[_0xe692('0xf')](_0xe692('0x24'),_0x52467b);logger[_0xe692('0x23')](_0xe692('0x24'),_0x52467b,JSON['stringify'](_0x219ca7));_0x252d1e(_0x219ca7);})[_0xe692('0x17')](function(_0x47b2f0){logger[_0xe692('0x14')](_0xe692('0x24'),_0x47b2f0[_0xe692('0x16')],_0x52467b);_0x11f91a(_0x2f5b79['error'](0x1f4,_0x47b2f0[_0xe692('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index ac8ca4f..2450eb0 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 _0x4f15=['./mailQueue.events','remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0x32e74e,_0x32edb8){var _0x1c5a58=function(_0xf04e88){while(--_0xf04e88){_0x32e74e['push'](_0x32e74e['shift']());}};_0x1c5a58(++_0x32edb8);}(_0x4f15,0x130));var _0x54f1=function(_0x50db80,_0x561efb){_0x50db80=_0x50db80-0x0;var _0x369e49=_0x4f15[_0x50db80];return _0x369e49;};'use strict';var MailQueueEvents=require(_0x54f1('0x0'));var events=['save',_0x54f1('0x1'),_0x54f1('0x2')];function createListener(_0x47af1e,_0x35bc29){return function(_0x183daf){_0x35bc29[_0x54f1('0x3')](_0x47af1e,_0x183daf);};}function removeListener(_0x4f596c,_0x2a9794){return function(){MailQueueEvents[_0x54f1('0x4')](_0x4f596c,_0x2a9794);};}exports[_0x54f1('0x5')]=function(_0x1ff1ac){for(var _0x2fd7de=0x0,_0x14709e=events[_0x54f1('0x6')];_0x2fd7de<_0x14709e;_0x2fd7de++){var _0x24180a=events[_0x2fd7de];var _0x4de2ab=createListener(_0x54f1('0x7')+_0x24180a,_0x1ff1ac);MailQueueEvents['on'](_0x24180a,_0x4de2ab);}}; \ No newline at end of file +var _0xa509=['update','emit','removeListener','./mailQueue.events','save','remove'];(function(_0x21b20c,_0xee87ec){var _0x445a6b=function(_0x519f73){while(--_0x519f73){_0x21b20c['push'](_0x21b20c['shift']());}};_0x445a6b(++_0xee87ec);}(_0xa509,0x12f));var _0x9a50=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa509[_0x20a584];return _0x4b41a8;};'use strict';var MailQueueEvents=require(_0x9a50('0x0'));var events=[_0x9a50('0x1'),_0x9a50('0x2'),_0x9a50('0x3')];function createListener(_0x5f1b6c,_0x5f5e9a){return function(_0x4ceeed){_0x5f5e9a[_0x9a50('0x4')](_0x5f1b6c,_0x4ceeed);};}function removeListener(_0x2b428a,_0x3a8bc3){return function(){MailQueueEvents[_0x9a50('0x5')](_0x2b428a,_0x3a8bc3);};}exports['register']=function(_0x23fba6){for(var _0x5a7a94=0x0,_0x3f6789=events['length'];_0x5a7a94<_0x3f6789;_0x5a7a94++){var _0x5cf0b9=events[_0x5a7a94];var _0x5e83e8=createListener('mailQueue:'+_0x5cf0b9,_0x23fba6);MailQueueEvents['on'](_0x5cf0b9,_0x5e83e8);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5d54c5e..e764220 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 _0x77fa=['fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','show','post','put','/:id','update','delete','destroy','exports','multer','path','Router'];(function(_0x404440,_0x33766e){var _0x8d95d6=function(_0x30c068){while(--_0x30c068){_0x404440['push'](_0x404440['shift']());}};_0x8d95d6(++_0x33766e);}(_0x77fa,0x151));var _0xa77f=function(_0x3cbeb9,_0xdf3ca){_0x3cbeb9=_0x3cbeb9-0x0;var _0x50a607=_0x77fa[_0x3cbeb9];return _0x50a607;};'use strict';var multer=require(_0xa77f('0x0'));var util=require('util');var path=require(_0xa77f('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa77f('0x2')]();var fs_extra=require(_0xa77f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa77f('0x4'));var config=require(_0xa77f('0x5'));var controller=require(_0xa77f('0x6'));router[_0xa77f('0x7')]('/',auth[_0xa77f('0x8')](),controller[_0xa77f('0x9')]);router[_0xa77f('0x7')](_0xa77f('0xa'),auth[_0xa77f('0x8')](),controller[_0xa77f('0xb')]);router[_0xa77f('0x7')]('/:id',auth[_0xa77f('0x8')](),controller[_0xa77f('0xc')]);router[_0xa77f('0xd')]('/',auth[_0xa77f('0x8')](),controller['create']);router[_0xa77f('0xe')](_0xa77f('0xf'),auth[_0xa77f('0x8')](),controller[_0xa77f('0x10')]);router[_0xa77f('0x11')]('/:id',auth[_0xa77f('0x8')](),controller[_0xa77f('0x12')]);module[_0xa77f('0x13')]=router; \ No newline at end of file +var _0x4cf7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','delete','destroy','util'];(function(_0x4c17a8,_0x9b080d){var _0x4159bf=function(_0x46349b){while(--_0x46349b){_0x4c17a8['push'](_0x4c17a8['shift']());}};_0x4159bf(++_0x9b080d);}(_0x4cf7,0x117));var _0x74cf=function(_0x2dacfd,_0x1cb6bc){_0x2dacfd=_0x2dacfd-0x0;var _0x30a2ef=_0x4cf7[_0x2dacfd];return _0x30a2ef;};'use strict';var multer=require('multer');var util=require(_0x74cf('0x0'));var path=require(_0x74cf('0x1'));var timeout=require(_0x74cf('0x2'));var express=require(_0x74cf('0x3'));var router=express[_0x74cf('0x4')]();var fs_extra=require(_0x74cf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x74cf('0x6'));var config=require(_0x74cf('0x7'));var controller=require(_0x74cf('0x8'));router['get']('/',auth[_0x74cf('0x9')](),controller['index']);router[_0x74cf('0xa')](_0x74cf('0xb'),auth['isAuthenticated'](),controller[_0x74cf('0xc')]);router['get'](_0x74cf('0xd'),auth[_0x74cf('0x9')](),controller[_0x74cf('0xe')]);router[_0x74cf('0xf')]('/',auth[_0x74cf('0x9')](),controller[_0x74cf('0x10')]);router[_0x74cf('0x11')](_0x74cf('0xd'),auth[_0x74cf('0x9')](),controller['update']);router[_0x74cf('0x12')](_0x74cf('0xd'),auth[_0x74cf('0x9')](),controller[_0x74cf('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 909a9fb..caa2486 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 _0xac5d=['DATE','moment','sequelize','exports','STRING'];(function(_0x331dd8,_0x15e211){var _0x56408f=function(_0x576ffd){while(--_0x576ffd){_0x331dd8['push'](_0x331dd8['shift']());}};_0x56408f(++_0x15e211);}(_0xac5d,0x83));var _0xdac5=function(_0x76a7ae,_0x490d47){_0x76a7ae=_0x76a7ae-0x0;var _0x12eeb4=_0xac5d[_0x76a7ae];return _0x12eeb4;};'use strict';var moment=require(_0xdac5('0x0'));var Sequelize=require(_0xdac5('0x1'));module[_0xdac5('0x2')]={'uniqueid':{'type':Sequelize[_0xdac5('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdac5('0x3')]},'joinAt':{'type':Sequelize[_0xdac5('0x4')]},'leaveAt':{'type':Sequelize[_0xdac5('0x4')]},'acceptAt':{'type':Sequelize[_0xdac5('0x4')]},'exitAt':{'type':Sequelize[_0xdac5('0x4')]},'reason':{'type':Sequelize[_0xdac5('0x3')]}}; \ No newline at end of file +var _0x5137=['moment','sequelize','exports','STRING','DATE'];(function(_0x424501,_0x42096d){var _0xb719af=function(_0x37adcf){while(--_0x37adcf){_0x424501['push'](_0x424501['shift']());}};_0xb719af(++_0x42096d);}(_0x5137,0x1e5));var _0x7513=function(_0x587783,_0x6296e6){_0x587783=_0x587783-0x0;var _0x1cca44=_0x5137[_0x587783];return _0x1cca44;};'use strict';var moment=require(_0x7513('0x0'));var Sequelize=require(_0x7513('0x1'));module[_0x7513('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x7513('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7513('0x4')]},'acceptAt':{'type':Sequelize[_0x7513('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x7513('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index b40c40c..0ca181d 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 _0x5fdc=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x5fdc,0x127));var _0xc5fd=function(_0x223a60,_0x6eac1f){_0x223a60=_0x223a60-0x0;var _0x5be7b2=_0x5fdc[_0x223a60];return _0x5be7b2;};'use strict';var emlformat=require(_0xc5fd('0x0'));var rimraf=require(_0xc5fd('0x1'));var zipdir=require(_0xc5fd('0x2'));var jsonpatch=require(_0xc5fd('0x3'));var rp=require(_0xc5fd('0x4'));var moment=require(_0xc5fd('0x5'));var BPromise=require(_0xc5fd('0x6'));var Mustache=require(_0xc5fd('0x7'));var util=require(_0xc5fd('0x8'));var path=require(_0xc5fd('0x9'));var sox=require(_0xc5fd('0xa'));var csv=require(_0xc5fd('0xb'));var ejs=require(_0xc5fd('0xc'));var fs=require('fs');var fs_extra=require(_0xc5fd('0xd'));var _=require(_0xc5fd('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc5fd('0xf'));var toCsv=require(_0xc5fd('0xb'));var querystring=require(_0xc5fd('0x10'));var Papa=require(_0xc5fd('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc5fd('0x12'));var as=require(_0xc5fd('0x13'));var hardwareService=require(_0xc5fd('0x14'));var logger=require(_0xc5fd('0x15'))(_0xc5fd('0x16'));var utils=require(_0xc5fd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc5fd('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x558939,_0x1b1b2b){_0x1b1b2b=_0x1b1b2b||0xcc;return function(_0x1bc6d1){if(_0x1bc6d1){return _0x558939[_0xc5fd('0x19')](_0x1b1b2b);}return _0x558939[_0xc5fd('0x1a')](_0x1b1b2b)[_0xc5fd('0x1b')]();};}function respondWithResult(_0x40b0f8,_0x27447e){_0x27447e=_0x27447e||0xc8;return function(_0xa7a954){if(_0xa7a954){return _0x40b0f8['status'](_0x27447e)[_0xc5fd('0x1c')](_0xa7a954);}};}function respondWithFilteredResult(_0x103c3d,_0x2221da){return function(_0x3404e0){if(_0x3404e0){var _0x4d3636=typeof _0x2221da['offset']==='undefined'&&typeof _0x2221da['limit']==='undefined';var _0x35a9d0=_0x3404e0[_0xc5fd('0x1d')];var _0x27f611=_0x4d3636?0x0:_0x2221da[_0xc5fd('0x1e')];var _0x2ee392=_0x4d3636?_0x3404e0[_0xc5fd('0x1d')]:_0x2221da[_0xc5fd('0x1e')]+_0x2221da['limit'];var _0xb7bab1;if(_0x2ee392>=_0x35a9d0){_0x2ee392=_0x35a9d0;_0xb7bab1=0xc8;}else{_0xb7bab1=0xce;}_0x103c3d[_0xc5fd('0x1a')](_0xb7bab1);return _0x103c3d[_0xc5fd('0x1f')](_0xc5fd('0x20'),_0x27f611+'-'+_0x2ee392+'/'+_0x35a9d0)[_0xc5fd('0x1c')](_0x3404e0);}return null;};}function patchUpdates(_0x48024e){return function(_0x3966a2){try{jsonpatch[_0xc5fd('0x21')](_0x3966a2,_0x48024e,!![]);}catch(_0x18048e){return BPromise[_0xc5fd('0x22')](_0x18048e);}return _0x3966a2['save']();};}function saveUpdates(_0x4c85d5,_0x13cc42){return function(_0x2ab935){if(_0x2ab935){return _0x2ab935[_0xc5fd('0x23')](_0x4c85d5)[_0xc5fd('0x24')](function(_0x334401){return _0x334401;});}return null;};}function removeEntity(_0x311952,_0x56d473){return function(_0x1a3f21){if(_0x1a3f21){return _0x1a3f21[_0xc5fd('0x25')]()[_0xc5fd('0x24')](function(){_0x311952[_0xc5fd('0x1a')](0xcc)[_0xc5fd('0x1b')]();});}};}function handleEntityNotFound(_0x4020af,_0x475b91){return function(_0x527018){if(!_0x527018){_0x4020af[_0xc5fd('0x19')](0x194);}return _0x527018;};}function handleError(_0x48cd1d,_0x2ee700){_0x2ee700=_0x2ee700||0x1f4;return function(_0x231368){logger[_0xc5fd('0x26')](_0x231368[_0xc5fd('0x27')]);if(_0x231368['name']){delete _0x231368[_0xc5fd('0x28')];}_0x48cd1d[_0xc5fd('0x1a')](_0x2ee700)[_0xc5fd('0x29')](_0x231368);};}exports[_0xc5fd('0x2a')]=function(_0x19df33,_0x209975){var _0x541c12={},_0x412ef7={},_0x5d4f70={'count':0x0,'rows':[]};var _0x4859f7=_[_0xc5fd('0x2b')](db[_0xc5fd('0x2c')][_0xc5fd('0x2d')],function(_0x38db1d){return{'name':_0x38db1d[_0xc5fd('0x2e')],'type':_0x38db1d[_0xc5fd('0x2f')][_0xc5fd('0x30')]};});_0x412ef7[_0xc5fd('0x31')]=_['map'](_0x4859f7,_0xc5fd('0x28'));_0x412ef7[_0xc5fd('0x32')]=_[_0xc5fd('0x33')](_0x19df33[_0xc5fd('0x32')]);_0x412ef7[_0xc5fd('0x34')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],_0x412ef7[_0xc5fd('0x32')]);_0x541c12[_0xc5fd('0x36')]=_[_0xc5fd('0x35')](_0x412ef7[_0xc5fd('0x31')],qs[_0xc5fd('0x37')](_0x19df33['query'][_0xc5fd('0x37')]));_0x541c12[_0xc5fd('0x36')]=_0x541c12[_0xc5fd('0x36')][_0xc5fd('0x38')]?_0x541c12[_0xc5fd('0x36')]:_0x412ef7[_0xc5fd('0x31')];if(!_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x39')](_0xc5fd('0x3a'))){_0x541c12['limit']=qs[_0xc5fd('0x3b')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3b')]);_0x541c12[_0xc5fd('0x1e')]=qs[_0xc5fd('0x1e')](_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x1e')]);}_0x541c12['order']=qs[_0xc5fd('0x3c')](_0x19df33[_0xc5fd('0x32')]['sort']);_0x541c12[_0xc5fd('0x3d')]=qs['filters'](_[_0xc5fd('0x3e')](_0x19df33[_0xc5fd('0x32')],_0x412ef7[_0xc5fd('0x34')]),_0x4859f7);if(_0x19df33['query'][_0xc5fd('0x3f')]){_0x541c12[_0xc5fd('0x3d')]=_['merge'](_0x541c12[_0xc5fd('0x3d')],{'$or':_[_0xc5fd('0x2b')](_0x4859f7,function(_0x31b457){if(_0x31b457[_0xc5fd('0x2f')]!==_0xc5fd('0x40')){var _0x33f669={};_0x33f669[_0x31b457['name']]={'$like':'%'+_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x3f')]+'%'};return _0x33f669;}})});}_0x541c12=_[_0xc5fd('0x41')]({},_0x541c12,_0x19df33[_0xc5fd('0x42')]);var _0x5d3fce={'where':_0x541c12['where']};return db['MailQueueReport'][_0xc5fd('0x1d')](_0x5d3fce)[_0xc5fd('0x24')](function(_0x2dd4ca){_0x5d4f70[_0xc5fd('0x1d')]=_0x2dd4ca;if(_0x19df33[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x541c12[_0xc5fd('0x44')]=[{'all':!![]}];}return db[_0xc5fd('0x2c')][_0xc5fd('0x45')](_0x541c12);})['then'](function(_0x5a2199){_0x5d4f70[_0xc5fd('0x46')]=_0x5a2199;return _0x5d4f70;})['then'](respondWithFilteredResult(_0x209975,_0x541c12))[_0xc5fd('0x47')](handleError(_0x209975,null));};exports[_0xc5fd('0x48')]=function(_0x2259e4,_0x57fd81){var _0x6ebcbf={'raw':!![],'where':{'id':_0x2259e4['params']['id']}},_0x350753={};_0x350753[_0xc5fd('0x31')]=_[_0xc5fd('0x33')](db['MailQueueReport'][_0xc5fd('0x2d')]);_0x350753['query']=_[_0xc5fd('0x33')](_0x2259e4[_0xc5fd('0x32')]);_0x350753['filters']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],_0x350753[_0xc5fd('0x32')]);_0x6ebcbf['attributes']=_[_0xc5fd('0x35')](_0x350753[_0xc5fd('0x31')],qs['fields'](_0x2259e4['query'][_0xc5fd('0x37')]));_0x6ebcbf['attributes']=_0x6ebcbf['attributes']['length']?_0x6ebcbf[_0xc5fd('0x36')]:_0x350753[_0xc5fd('0x31')];if(_0x2259e4[_0xc5fd('0x32')][_0xc5fd('0x43')]){_0x6ebcbf[_0xc5fd('0x44')]=[{'all':!![]}];}_0x6ebcbf=_[_0xc5fd('0x41')]({},_0x6ebcbf,_0x2259e4['options']);return db['MailQueueReport']['find'](_0x6ebcbf)[_0xc5fd('0x24')](handleEntityNotFound(_0x57fd81,null))[_0xc5fd('0x24')](respondWithResult(_0x57fd81,null))[_0xc5fd('0x47')](handleError(_0x57fd81,null));};exports['create']=function(_0x1a2200,_0x51641b){return db[_0xc5fd('0x2c')][_0xc5fd('0x49')](_0x1a2200[_0xc5fd('0x4a')],{})[_0xc5fd('0x24')](respondWithResult(_0x51641b,0xc9))[_0xc5fd('0x47')](handleError(_0x51641b,null));};exports[_0xc5fd('0x23')]=function(_0x54d86c,_0x6b2f77){if(_0x54d86c[_0xc5fd('0x4a')]['id']){delete _0x54d86c['body']['id'];}return db['MailQueueReport'][_0xc5fd('0x4b')]({'where':{'id':_0x54d86c['params']['id']}})['then'](handleEntityNotFound(_0x6b2f77,null))[_0xc5fd('0x24')](saveUpdates(_0x54d86c[_0xc5fd('0x4a')],null))['then'](respondWithResult(_0x6b2f77,null))[_0xc5fd('0x47')](handleError(_0x6b2f77,null));};exports[_0xc5fd('0x25')]=function(_0x5c49e7,_0x21d418){return db[_0xc5fd('0x2c')][_0xc5fd('0x4b')]({'where':{'id':_0x5c49e7[_0xc5fd('0x4c')]['id']}})[_0xc5fd('0x24')](handleEntityNotFound(_0x21d418,null))[_0xc5fd('0x24')](removeEntity(_0x21d418,null))[_0xc5fd('0x47')](handleError(_0x21d418,null));};exports[_0xc5fd('0x4d')]=function(_0x4217f7,_0x32721e){return db[_0xc5fd('0x2c')]['describe']()[_0xc5fd('0x24')](respondWithResult(_0x32721e,null))[_0xc5fd('0x47')](handleError(_0x32721e,null));}; \ No newline at end of file +var _0x6d11=['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','apply','reject','then','destroy','stack','name','send','index','map','MailQueueReport','rawAttributes','key','model','query','keys','filters','intersection','attributes','length','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','show','params','fields','catch','create','body','find','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6d11,0xbf));var _0x16d1=function(_0x4f067e,_0x406536){_0x4f067e=_0x4f067e-0x0;var _0x3930d1=_0x6d11[_0x4f067e];return _0x3930d1;};'use strict';var emlformat=require(_0x16d1('0x0'));var rimraf=require(_0x16d1('0x1'));var zipdir=require(_0x16d1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x16d1('0x3'));var moment=require('moment');var BPromise=require(_0x16d1('0x4'));var Mustache=require(_0x16d1('0x5'));var util=require('util');var path=require('path');var sox=require(_0x16d1('0x6'));var csv=require(_0x16d1('0x7'));var ejs=require(_0x16d1('0x8'));var fs=require('fs');var fs_extra=require(_0x16d1('0x9'));var _=require(_0x16d1('0xa'));var squel=require(_0x16d1('0xb'));var crypto=require(_0x16d1('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x16d1('0xd'));var Papa=require(_0x16d1('0xe'));var Redis=require(_0x16d1('0xf'));var authService=require(_0x16d1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x16d1('0x11'));var hardwareService=require(_0x16d1('0x12'));var logger=require(_0x16d1('0x13'))(_0x16d1('0x14'));var utils=require(_0x16d1('0x15'));var config=require(_0x16d1('0x16'));var licenseUtil=require(_0x16d1('0x17'));var db=require(_0x16d1('0x18'))['db'];function respondWithStatusCode(_0x4de260,_0x32fa68){_0x32fa68=_0x32fa68||0xcc;return function(_0x2e71fa){if(_0x2e71fa){return _0x4de260[_0x16d1('0x19')](_0x32fa68);}return _0x4de260[_0x16d1('0x1a')](_0x32fa68)[_0x16d1('0x1b')]();};}function respondWithResult(_0x5a1429,_0xc034b7){_0xc034b7=_0xc034b7||0xc8;return function(_0x1b71d3){if(_0x1b71d3){return _0x5a1429[_0x16d1('0x1a')](_0xc034b7)[_0x16d1('0x1c')](_0x1b71d3);}};}function respondWithFilteredResult(_0x29ebba,_0x173e16){return function(_0x2d7e8a){if(_0x2d7e8a){var _0x4ee46c=typeof _0x173e16[_0x16d1('0x1d')]===_0x16d1('0x1e')&&typeof _0x173e16['limit']==='undefined';var _0x1a9ec8=_0x2d7e8a['count'];var _0x46a25e=_0x4ee46c?0x0:_0x173e16['offset'];var _0x1da1b8=_0x4ee46c?_0x2d7e8a['count']:_0x173e16[_0x16d1('0x1d')]+_0x173e16[_0x16d1('0x1f')];var _0x48cd70;if(_0x1da1b8>=_0x1a9ec8){_0x1da1b8=_0x1a9ec8;_0x48cd70=0xc8;}else{_0x48cd70=0xce;}_0x29ebba['status'](_0x48cd70);return _0x29ebba['set']('Content-Range',_0x46a25e+'-'+_0x1da1b8+'/'+_0x1a9ec8)[_0x16d1('0x1c')](_0x2d7e8a);}return null;};}function patchUpdates(_0x55a0e0){return function(_0x34b88f){try{jsonpatch[_0x16d1('0x20')](_0x34b88f,_0x55a0e0,!![]);}catch(_0x1f6add){return BPromise[_0x16d1('0x21')](_0x1f6add);}return _0x34b88f['save']();};}function saveUpdates(_0x2c7825,_0x58a03b){return function(_0x2a897d){if(_0x2a897d){return _0x2a897d['update'](_0x2c7825)[_0x16d1('0x22')](function(_0x8c7266){return _0x8c7266;});}return null;};}function removeEntity(_0x17e038,_0x47cad4){return function(_0x215c23){if(_0x215c23){return _0x215c23[_0x16d1('0x23')]()[_0x16d1('0x22')](function(){_0x17e038[_0x16d1('0x1a')](0xcc)[_0x16d1('0x1b')]();});}};}function handleEntityNotFound(_0x335c24,_0x4b2b5c){return function(_0x15203b){if(!_0x15203b){_0x335c24[_0x16d1('0x19')](0x194);}return _0x15203b;};}function handleError(_0x262f89,_0x346b69){_0x346b69=_0x346b69||0x1f4;return function(_0x2b8403){logger['error'](_0x2b8403[_0x16d1('0x24')]);if(_0x2b8403[_0x16d1('0x25')]){delete _0x2b8403[_0x16d1('0x25')];}_0x262f89['status'](_0x346b69)[_0x16d1('0x26')](_0x2b8403);};}exports[_0x16d1('0x27')]=function(_0x364bf7,_0x22e5b3){var _0x6396fc={},_0x462e5b={},_0x1dd574={'count':0x0,'rows':[]};var _0x562908=_[_0x16d1('0x28')](db[_0x16d1('0x29')][_0x16d1('0x2a')],function(_0x30cd8f){return{'name':_0x30cd8f['fieldName'],'type':_0x30cd8f['type'][_0x16d1('0x2b')]};});_0x462e5b[_0x16d1('0x2c')]=_[_0x16d1('0x28')](_0x562908,_0x16d1('0x25'));_0x462e5b[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x364bf7[_0x16d1('0x2d')]);_0x462e5b[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],_0x462e5b[_0x16d1('0x2d')]);_0x6396fc[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x462e5b[_0x16d1('0x2c')],qs['fields'](_0x364bf7[_0x16d1('0x2d')]['fields']));_0x6396fc[_0x16d1('0x31')]=_0x6396fc[_0x16d1('0x31')][_0x16d1('0x32')]?_0x6396fc[_0x16d1('0x31')]:_0x462e5b[_0x16d1('0x2c')];if(!_0x364bf7[_0x16d1('0x2d')]['hasOwnProperty']('nolimit')){_0x6396fc['limit']=qs[_0x16d1('0x1f')](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1f')]);_0x6396fc[_0x16d1('0x1d')]=qs['offset'](_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x1d')]);}_0x6396fc['order']=qs['sort'](_0x364bf7['query'][_0x16d1('0x33')]);_0x6396fc[_0x16d1('0x34')]=qs[_0x16d1('0x2f')](_['pick'](_0x364bf7[_0x16d1('0x2d')],_0x462e5b[_0x16d1('0x2f')]),_0x562908);if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]){_0x6396fc[_0x16d1('0x34')]=_[_0x16d1('0x36')](_0x6396fc[_0x16d1('0x34')],{'$or':_['map'](_0x562908,function(_0x50267b){if(_0x50267b['type']!==_0x16d1('0x37')){var _0x2306d3={};_0x2306d3[_0x50267b[_0x16d1('0x25')]]={'$like':'%'+_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x35')]+'%'};return _0x2306d3;}})});}_0x6396fc=_[_0x16d1('0x36')]({},_0x6396fc,_0x364bf7[_0x16d1('0x38')]);var _0x369b1c={'where':_0x6396fc['where']};return db[_0x16d1('0x29')]['count'](_0x369b1c)['then'](function(_0x352c5b){_0x1dd574[_0x16d1('0x39')]=_0x352c5b;if(_0x364bf7[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x6396fc[_0x16d1('0x3b')]=[{'all':!![]}];}return db[_0x16d1('0x29')]['findAll'](_0x6396fc);})[_0x16d1('0x22')](function(_0x525212){_0x1dd574['rows']=_0x525212;return _0x1dd574;})['then'](respondWithFilteredResult(_0x22e5b3,_0x6396fc))['catch'](handleError(_0x22e5b3,null));};exports[_0x16d1('0x3c')]=function(_0x168e14,_0x24038b){var _0x1eb761={'raw':!![],'where':{'id':_0x168e14[_0x16d1('0x3d')]['id']}},_0x53de06={};_0x53de06['model']=_[_0x16d1('0x2e')](db[_0x16d1('0x29')][_0x16d1('0x2a')]);_0x53de06[_0x16d1('0x2d')]=_[_0x16d1('0x2e')](_0x168e14[_0x16d1('0x2d')]);_0x53de06[_0x16d1('0x2f')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],_0x53de06[_0x16d1('0x2d')]);_0x1eb761[_0x16d1('0x31')]=_[_0x16d1('0x30')](_0x53de06[_0x16d1('0x2c')],qs[_0x16d1('0x3e')](_0x168e14[_0x16d1('0x2d')]['fields']));_0x1eb761['attributes']=_0x1eb761[_0x16d1('0x31')][_0x16d1('0x32')]?_0x1eb761[_0x16d1('0x31')]:_0x53de06[_0x16d1('0x2c')];if(_0x168e14[_0x16d1('0x2d')][_0x16d1('0x3a')]){_0x1eb761['include']=[{'all':!![]}];}_0x1eb761=_[_0x16d1('0x36')]({},_0x1eb761,_0x168e14[_0x16d1('0x38')]);return db[_0x16d1('0x29')]['find'](_0x1eb761)['then'](handleEntityNotFound(_0x24038b,null))[_0x16d1('0x22')](respondWithResult(_0x24038b,null))[_0x16d1('0x3f')](handleError(_0x24038b,null));};exports['create']=function(_0x1cc137,_0x583151){return db[_0x16d1('0x29')][_0x16d1('0x40')](_0x1cc137[_0x16d1('0x41')],{})[_0x16d1('0x22')](respondWithResult(_0x583151,0xc9))['catch'](handleError(_0x583151,null));};exports['update']=function(_0x1d92cd,_0x8bb0c1){if(_0x1d92cd['body']['id']){delete _0x1d92cd[_0x16d1('0x41')]['id'];}return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x1d92cd[_0x16d1('0x3d')]['id']}})[_0x16d1('0x22')](handleEntityNotFound(_0x8bb0c1,null))['then'](saveUpdates(_0x1d92cd[_0x16d1('0x41')],null))['then'](respondWithResult(_0x8bb0c1,null))[_0x16d1('0x3f')](handleError(_0x8bb0c1,null));};exports[_0x16d1('0x23')]=function(_0x5d384c,_0x413acd){return db[_0x16d1('0x29')][_0x16d1('0x42')]({'where':{'id':_0x5d384c[_0x16d1('0x3d')]['id']}})['then'](handleEntityNotFound(_0x413acd,null))['then'](removeEntity(_0x413acd,null))['catch'](handleError(_0x413acd,null));};exports[_0x16d1('0x43')]=function(_0xbf100f,_0x39fd41){return db[_0x16d1('0x29')]['describe']()[_0x16d1('0x22')](respondWithResult(_0x39fd41,null))[_0x16d1('0x3f')](handleError(_0x39fd41,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 785411e..fda4e4b 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 _0xeb8e=['MailQueueReport','report_mail_queue','uniqueid','lodash','bluebird','path','rimraf','../../config/environment','exports','define'];(function(_0x908418,_0x2ef8d7){var _0x225095=function(_0x452a4d){while(--_0x452a4d){_0x908418['push'](_0x908418['shift']());}};_0x225095(++_0x2ef8d7);}(_0xeb8e,0xfd));var _0xeeb8=function(_0x3ed136,_0x446d57){_0x3ed136=_0x3ed136-0x0;var _0x1fcca1=_0xeb8e[_0x3ed136];return _0x1fcca1;};'use strict';var _=require(_0xeeb8('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xeeb8('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeeb8('0x2'));var rimraf=require(_0xeeb8('0x3'));var config=require(_0xeeb8('0x4'));var attributes=require('./mailQueueReport.attributes');module[_0xeeb8('0x5')]=function(_0x281d78,_0x4d9738){return _0x281d78[_0xeeb8('0x6')](_0xeeb8('0x7'),attributes,{'tableName':_0xeeb8('0x8'),'paranoid':![],'indexes':[{'name':_0xeeb8('0x9'),'fields':[_0xeeb8('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x61f1=['lodash','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','MailQueueReport','uniqueid'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x61f1,0xf3));var _0x161f=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x61f1[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x161f('0x0'));var util=require('util');var logger=require(_0x161f('0x1'))('api');var moment=require(_0x161f('0x2'));var BPromise=require(_0x161f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x161f('0x4'));var config=require(_0x161f('0x5'));var attributes=require('./mailQueueReport.attributes');module[_0x161f('0x6')]=function(_0x4ba71f,_0x153f80){return _0x4ba71f['define'](_0x161f('0x7'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x161f('0x8'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 6103a9f..4e9bdea 100644 --- a/server/api/mailQueueReport/mailQueueReport.rpc.js +++ b/server/api/mailQueueReport/mailQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['UpdateMailQueueReport','MailQueueReport','update','raw','where','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','CreateMailQueueReport','create','body','options'];(function(_0x27c7b7,_0x3ac29c){var _0x22e7d5=function(_0x1a5494){while(--_0x1a5494){_0x27c7b7['push'](_0x27c7b7['shift']());}};_0x22e7d5(++_0x3ac29c);}(_0xdb28,0x106));var _0x8db2=function(_0x2a79ee,_0x535cc3){_0x2a79ee=_0x2a79ee-0x0;var _0x14970e=_0xdb28[_0x2a79ee];return _0x14970e;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}exports[_0x8db2('0x16')]=function(_0x3fddc2){var _0x2efd06=this;return new Promise(function(_0x46ce14,_0x51d60d){return db['MailQueueReport'][_0x8db2('0x17')](_0x3fddc2[_0x8db2('0x18')],{'raw':_0x3fddc2[_0x8db2('0x19')]?_0x3fddc2[_0x8db2('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x8db2('0xc')](function(_0x36a9ff){logger[_0x8db2('0x14')](_0x8db2('0x16'),_0x3fddc2);logger[_0x8db2('0xf')]('CreateMailQueueReport',_0x3fddc2,JSON[_0x8db2('0x10')](_0x36a9ff));_0x46ce14(_0x36a9ff);})[_0x8db2('0x15')](function(_0x18f69c){logger[_0x8db2('0x11')](_0x8db2('0x16'),_0x18f69c[_0x8db2('0x13')],_0x3fddc2);_0x51d60d(_0x2efd06[_0x8db2('0x11')](0x1f4,_0x18f69c['message']));});});};exports[_0x8db2('0x1a')]=function(_0x4f6516){var _0x5725f0=this;return new Promise(function(_0x52a9ca,_0x4d923c){return db[_0x8db2('0x1b')][_0x8db2('0x1c')](_0x4f6516[_0x8db2('0x18')],{'raw':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f6516['options']?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1e')]||null:null,'attributes':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')]['attributes']||null:null,'limit':_0x4f6516[_0x8db2('0x19')]?_0x4f6516[_0x8db2('0x19')][_0x8db2('0x1f')]||null:null})[_0x8db2('0xc')](function(_0xbe5ece){logger[_0x8db2('0x14')](_0x8db2('0x1a'),_0x4f6516);logger[_0x8db2('0xf')](_0x8db2('0x1a'),_0x4f6516,JSON['stringify'](_0xbe5ece));_0x52a9ca(_0xbe5ece);})[_0x8db2('0x15')](function(_0x50b28d){logger['error'](_0x8db2('0x1a'),_0x50b28d[_0x8db2('0x13')],_0x4f6516);_0x4d923c(_0x5725f0[_0x8db2('0x11')](0x1f4,_0x50b28d['message']));});});}; \ No newline at end of file +var _0x2ef3=['options','raw','UpdateMailQueueReport','where','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailQueueReport,\x20%s,\x20%s','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateMailQueueReport','MailQueueReport','body'];(function(_0x5950e7,_0x43a5bb){var _0x47494d=function(_0x275377){while(--_0x275377){_0x5950e7['push'](_0x5950e7['shift']());}};_0x47494d(++_0x43a5bb);}(_0x2ef3,0xba));var _0x32ef=function(_0x2849b9,_0x263367){_0x2849b9=_0x2849b9-0x0;var _0x526164=_0x2ef3[_0x2849b9];return _0x526164;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}exports[_0x32ef('0x15')]=function(_0x1a9476){var _0x286bfb=this;return new Promise(function(_0x57863c,_0xbe37f6){return db[_0x32ef('0x16')]['create'](_0x1a9476[_0x32ef('0x17')],{'raw':_0x1a9476[_0x32ef('0x18')]?_0x1a9476[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![]})[_0x32ef('0xb')](function(_0x3aec05){logger['info'](_0x32ef('0x15'),_0x1a9476);logger['debug'](_0x32ef('0x15'),_0x1a9476,JSON[_0x32ef('0x10')](_0x3aec05));_0x57863c(_0x3aec05);})['catch'](function(_0x1af371){logger[_0x32ef('0x11')](_0x32ef('0x15'),_0x1af371['message'],_0x1a9476);_0xbe37f6(_0x286bfb['error'](0x1f4,_0x1af371[_0x32ef('0x13')]));});});};exports[_0x32ef('0x1a')]=function(_0x225feb){var _0x478bef=this;return new Promise(function(_0x59585f,_0x19ea6){return db['MailQueueReport']['update'](_0x225feb[_0x32ef('0x17')],{'raw':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1b')]||null:null,'attributes':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')][_0x32ef('0x1c')]||null:null,'limit':_0x225feb[_0x32ef('0x18')]?_0x225feb[_0x32ef('0x18')]['limit']||null:null})[_0x32ef('0xb')](function(_0x2f5d06){logger['info'](_0x32ef('0x1a'),_0x225feb);logger[_0x32ef('0x1d')](_0x32ef('0x1a'),_0x225feb,JSON[_0x32ef('0x10')](_0x2f5d06));_0x59585f(_0x2f5d06);})['catch'](function(_0x10e38c){logger[_0x32ef('0x11')](_0x32ef('0x1a'),_0x10e38c[_0x32ef('0x13')],_0x225feb);_0x19ea6(_0x478bef[_0x32ef('0x11')](0x1f4,_0x10e38c[_0x32ef('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index a7109e0..b003011 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x10346c,_0x183ce6){var _0x262bd4=function(_0x49ac96){while(--_0x49ac96){_0x10346c['push'](_0x10346c['shift']());}};_0x262bd4(++_0x183ce6);}(_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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2d440e,_0x32b440){var _0x38030d=function(_0x1af1a0){while(--_0x1af1a0){_0x2d440e['push'](_0x2d440e['shift']());}};_0x38030d(++_0x32b440);}(_0xe706,0xa3));var _0x6e70=function(_0x50da6f,_0xfeb8d1){_0x50da6f=_0x50da6f-0x0;var _0xaff1c5=_0xe706[_0x50da6f];return _0xaff1c5;};'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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 3a62744..be7a83f 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 _0x31da=['STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x299ee9,_0x3106fa){var _0x3125e8=function(_0xc10908){while(--_0xc10908){_0x299ee9['push'](_0x299ee9['shift']());}};_0x3125e8(++_0x3106fa);}(_0x31da,0xc2));var _0xa31d=function(_0xa5f840,_0x188587){_0xa5f840=_0xa5f840-0x0;var _0x4cb50e=_0x31da[_0xa5f840];return _0x4cb50e;};'use strict';var Sequelize=require(_0xa31d('0x0'));module['exports']={'description':{'type':Sequelize[_0xa31d('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xa31d('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xa31d('0x1')]},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xa31d('0x3')]},'tls':{'type':Sequelize[_0xa31d('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xa31d('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xa31d('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xa31d('0x1')]},'modernAuthentication':{'type':Sequelize[_0xa31d('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3e49=['STRING','BOOLEAN','INTEGER','sequelize','exports'];(function(_0x46f6d7,_0x8abc26){var _0x20b442=function(_0x37f331){while(--_0x37f331){_0x46f6d7['push'](_0x46f6d7['shift']());}};_0x20b442(++_0x8abc26);}(_0x3e49,0x1b1));var _0x93e4=function(_0x1c2206,_0x500ca9){_0x1c2206=_0x1c2206-0x0;var _0x3d2c57=_0x3e49[_0x1c2206];return _0x3d2c57;};'use strict';var Sequelize=require(_0x93e4('0x0'));module[_0x93e4('0x1')]={'description':{'type':Sequelize[_0x93e4('0x2')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x93e4('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x93e4('0x2')]},'password':{'type':Sequelize[_0x93e4('0x2')]},'port':{'type':Sequelize[_0x93e4('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x93e4('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x93e4('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0x93e4('0x2')]},'modernAuthentication':{'type':Sequelize[_0x93e4('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ec98000..d49e9d6 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 _0x2a30=['mail_servers_in','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment'];(function(_0x5dab57,_0x21da3b){var _0x22614d=function(_0x250669){while(--_0x250669){_0x5dab57['push'](_0x5dab57['shift']());}};_0x22614d(++_0x21da3b);}(_0x2a30,0x79));var _0x02a3=function(_0xc95fe8,_0x524e18){_0xc95fe8=_0xc95fe8-0x0;var _0x242759=_0x2a30[_0xc95fe8];return _0x242759;};'use strict';var _=require(_0x02a3('0x0'));var util=require(_0x02a3('0x1'));var logger=require(_0x02a3('0x2'))('api');var moment=require(_0x02a3('0x3'));var BPromise=require(_0x02a3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x02a3('0x5'));var rimraf=require('rimraf');var config=require(_0x02a3('0x6'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x3fa5f2,_0x94539d){return _0x3fa5f2['define']('MailServerIn',attributes,{'tableName':_0x02a3('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x753e=['../../config/environment','./mailServerIn.attributes','define','mail_servers_in','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x40f9a0,_0x3458cc){var _0x3e3144=function(_0x1f8fce){while(--_0x1f8fce){_0x40f9a0['push'](_0x40f9a0['shift']());}};_0x3e3144(++_0x3458cc);}(_0x753e,0x122));var _0xe753=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x753e[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xe753('0x0'));var util=require(_0xe753('0x1'));var logger=require(_0xe753('0x2'))(_0xe753('0x3'));var moment=require(_0xe753('0x4'));var BPromise=require(_0xe753('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe753('0x6'));var rimraf=require('rimraf');var config=require(_0xe753('0x7'));var attributes=require(_0xe753('0x8'));module['exports']=function(_0xc13f77,_0x499357){return _0xc13f77[_0xe753('0x9')]('MailServerIn',attributes,{'tableName':_0xe753('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index a07802b..8211b5b 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 _0x652b=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','limit','include','map','model','lodash'];(function(_0x46e315,_0x995d51){var _0x1c8918=function(_0x4db819){while(--_0x4db819){_0x46e315['push'](_0x46e315['shift']());}};_0x1c8918(++_0x995d51);}(_0x652b,0xd8));var _0xb652=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x652b[_0xf0bc07];return _0x1c50c2;};'use strict';var _=require(_0xb652('0x0'));var util=require('util');var moment=require(_0xb652('0x1'));var BPromise=require(_0xb652('0x2'));var rs=require(_0xb652('0x3'));var fs=require('fs');var Redis=require(_0xb652('0x4'));var db=require(_0xb652('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb652('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb652('0x7')][_0xb652('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x47da9d,_0x1a9b58,_0x162e97){return new BPromise(function(_0xc036c,_0x424092){return client[_0xb652('0x9')](_0x47da9d,_0x162e97)[_0xb652('0xa')](function(_0x1b3703){logger[_0xb652('0xb')](_0xb652('0xc'),_0x1a9b58,_0xb652('0xd'));logger[_0xb652('0xe')](_0xb652('0xf'),_0x1a9b58,_0xb652('0xd'),JSON[_0xb652('0x10')](_0x1b3703));if(_0x1b3703[_0xb652('0x11')]){if(_0x1b3703[_0xb652('0x11')][_0xb652('0x12')]===0x1f4){logger['error'](_0xb652('0xc'),_0x1a9b58,_0x1b3703[_0xb652('0x11')][_0xb652('0x13')]);return _0x424092(_0x1b3703['error'][_0xb652('0x13')]);}logger[_0xb652('0x11')](_0xb652('0xc'),_0x1a9b58,_0x1b3703[_0xb652('0x11')][_0xb652('0x13')]);return _0xc036c(_0x1b3703[_0xb652('0x11')][_0xb652('0x13')]);}else{logger[_0xb652('0xb')](_0xb652('0xc'),_0x1a9b58,_0xb652('0xd'));_0xc036c(_0x1b3703['result']['message']);}})[_0xb652('0x14')](function(_0x16bd30){logger[_0xb652('0x11')](_0xb652('0xc'),_0x1a9b58,_0x16bd30);_0x424092(_0x16bd30);});});}exports[_0xb652('0x15')]=function(_0x2f04ee){var _0x5487f2=this;return new Promise(function(_0x46baea,_0x349b63){return db[_0xb652('0x16')][_0xb652('0x17')]({'raw':_0x2f04ee[_0xb652('0x18')]?_0x2f04ee[_0xb652('0x18')][_0xb652('0x19')]===undefined?!![]:![]:!![],'where':_0x2f04ee[_0xb652('0x18')]?_0x2f04ee[_0xb652('0x18')]['where']||null:null,'attributes':_0x2f04ee['options']?_0x2f04ee[_0xb652('0x18')][_0xb652('0x1a')]||null:null,'limit':_0x2f04ee[_0xb652('0x18')]?_0x2f04ee[_0xb652('0x18')][_0xb652('0x1b')]||null:null,'include':_0x2f04ee[_0xb652('0x18')]?_0x2f04ee['options'][_0xb652('0x1c')]?_[_0xb652('0x1d')](_0x2f04ee[_0xb652('0x18')][_0xb652('0x1c')],function(_0x2d440a){return{'model':db[_0x2d440a[_0xb652('0x1e')]],'as':_0x2d440a['as'],'attributes':_0x2d440a[_0xb652('0x1a')],'include':_0x2d440a[_0xb652('0x1c')]?_[_0xb652('0x1d')](_0x2d440a[_0xb652('0x1c')],function(_0x719f13){return{'model':db[_0x719f13[_0xb652('0x1e')]],'as':_0x719f13['as'],'attributes':_0x719f13[_0xb652('0x1a')],'include':_0x719f13['include']?_[_0xb652('0x1d')](_0x719f13['include'],function(_0x9ca854){return{'model':db[_0x9ca854[_0xb652('0x1e')]],'as':_0x9ca854['as'],'attributes':_0x9ca854[_0xb652('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb652('0xa')](function(_0x59ac7c){logger[_0xb652('0xb')]('GetMailServerIn',_0x2f04ee);logger['debug'](_0xb652('0x15'),_0x2f04ee,JSON[_0xb652('0x10')](_0x59ac7c));_0x46baea(_0x59ac7c);})[_0xb652('0x14')](function(_0x48e13e){logger[_0xb652('0x11')]('GetMailServerIn',_0x48e13e['message'],_0x2f04ee);_0x349b63(_0x5487f2[_0xb652('0x11')](0x1f4,_0x48e13e[_0xb652('0x13')]));});});}; \ No newline at end of file +var _0x923f=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetMailServerIn','MailServerIn','options','raw','where','limit','include','map','attributes','model','lodash'];(function(_0x30eccd,_0x23aa4f){var _0x28cc46=function(_0xead786){while(--_0xead786){_0x30eccd['push'](_0x30eccd['shift']());}};_0x28cc46(++_0x23aa4f);}(_0x923f,0x7b));var _0xf923=function(_0x34353,_0x55ab02){_0x34353=_0x34353-0x0;var _0x4124db=_0x923f[_0x34353];return _0x4124db;};'use strict';var _=require(_0xf923('0x0'));var util=require(_0xf923('0x1'));var moment=require(_0xf923('0x2'));var BPromise=require(_0xf923('0x3'));var rs=require(_0xf923('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf923('0x5'))['db'];var utils=require(_0xf923('0x6'));var logger=require(_0xf923('0x7'))('rpc');var config=require(_0xf923('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf923('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30f2b7,_0x42738b,_0x19501c){return new BPromise(function(_0x3db5ab,_0x2cfc53){return client[_0xf923('0xa')](_0x30f2b7,_0x19501c)['then'](function(_0x3ab9b){logger['info'](_0xf923('0xb'),_0x42738b,'request\x20sent');logger[_0xf923('0xc')](_0xf923('0xd'),_0x42738b,_0xf923('0xe'),JSON[_0xf923('0xf')](_0x3ab9b));if(_0x3ab9b[_0xf923('0x10')]){if(_0x3ab9b['error'][_0xf923('0x11')]===0x1f4){logger[_0xf923('0x10')]('MailServerIn,\x20%s,\x20%s',_0x42738b,_0x3ab9b[_0xf923('0x10')]['message']);return _0x2cfc53(_0x3ab9b[_0xf923('0x10')]['message']);}logger[_0xf923('0x10')](_0xf923('0xb'),_0x42738b,_0x3ab9b[_0xf923('0x10')][_0xf923('0x12')]);return _0x3db5ab(_0x3ab9b[_0xf923('0x10')][_0xf923('0x12')]);}else{logger['info'](_0xf923('0xb'),_0x42738b,_0xf923('0xe'));_0x3db5ab(_0x3ab9b[_0xf923('0x13')][_0xf923('0x12')]);}})[_0xf923('0x14')](function(_0x259cc9){logger[_0xf923('0x10')](_0xf923('0xb'),_0x42738b,_0x259cc9);_0x2cfc53(_0x259cc9);});});}exports[_0xf923('0x15')]=function(_0x27068f){var _0xc66907=this;return new Promise(function(_0x4a457e,_0x5aacf3){return db[_0xf923('0x16')]['findAll']({'raw':_0x27068f[_0xf923('0x17')]?_0x27068f[_0xf923('0x17')][_0xf923('0x18')]===undefined?!![]:![]:!![],'where':_0x27068f[_0xf923('0x17')]?_0x27068f['options'][_0xf923('0x19')]||null:null,'attributes':_0x27068f[_0xf923('0x17')]?_0x27068f[_0xf923('0x17')]['attributes']||null:null,'limit':_0x27068f['options']?_0x27068f['options'][_0xf923('0x1a')]||null:null,'include':_0x27068f[_0xf923('0x17')]?_0x27068f['options'][_0xf923('0x1b')]?_[_0xf923('0x1c')](_0x27068f[_0xf923('0x17')][_0xf923('0x1b')],function(_0x27789f){return{'model':db[_0x27789f['model']],'as':_0x27789f['as'],'attributes':_0x27789f[_0xf923('0x1d')],'include':_0x27789f[_0xf923('0x1b')]?_[_0xf923('0x1c')](_0x27789f[_0xf923('0x1b')],function(_0x6843fa){return{'model':db[_0x6843fa[_0xf923('0x1e')]],'as':_0x6843fa['as'],'attributes':_0x6843fa['attributes'],'include':_0x6843fa[_0xf923('0x1b')]?_['map'](_0x6843fa['include'],function(_0x578c51){return{'model':db[_0x578c51[_0xf923('0x1e')]],'as':_0x578c51['as'],'attributes':_0x578c51[_0xf923('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5f4fa1){logger['info'](_0xf923('0x15'),_0x27068f);logger['debug'](_0xf923('0x15'),_0x27068f,JSON[_0xf923('0xf')](_0x5f4fa1));_0x4a457e(_0x5f4fa1);})['catch'](function(_0x299568){logger[_0xf923('0x10')](_0xf923('0x15'),_0x299568[_0xf923('0x12')],_0x27068f);_0x5aacf3(_0xc66907[_0xf923('0x10')](0x1f4,_0x299568['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index d166bd4..8965abe 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x7a54,0x106));var _0x47a5=function(_0x809019,_0x2565ae){_0x809019=_0x809019-0x0;var _0x371665=_0x7a54[_0x809019];return _0x371665;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 2310008..5eab911 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 _0x6b20=['exports','STRING','INTEGER','BOOLEAN','sequelize'];(function(_0xecdd17,_0x1f6b3a){var _0x30458c=function(_0xcc7938){while(--_0xcc7938){_0xecdd17['push'](_0xecdd17['shift']());}};_0x30458c(++_0x1f6b3a);}(_0x6b20,0xd1));var _0x06b2=function(_0x108b65,_0x4f4248){_0x108b65=_0x108b65-0x0;var _0x11afc1=_0x6b20[_0x108b65];return _0x11afc1;};'use strict';var Sequelize=require(_0x06b2('0x0'));module[_0x06b2('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x06b2('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x06b2('0x2')]},'port':{'type':Sequelize[_0x06b2('0x3')]},'secure':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x06b2('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x6324=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3d5db9,_0x2dbe0a){var _0x3c114c=function(_0x3e0239){while(--_0x3e0239){_0x3d5db9['push'](_0x3d5db9['shift']());}};_0x3c114c(++_0x2dbe0a);}(_0x6324,0x142));var _0x4632=function(_0x3c95a3,_0x1159f1){_0x3c95a3=_0x3c95a3-0x0;var _0x57b25b=_0x6324[_0x3c95a3];return _0x57b25b;};'use strict';var Sequelize=require(_0x4632('0x0'));module[_0x4632('0x1')]={'description':{'type':Sequelize[_0x4632('0x2')]},'host':{'type':Sequelize[_0x4632('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x4632('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4632('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x4632('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index ff8879c..66637a4 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 _0x7e0c=['params','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','include','findAll','then','catch','show','find','create','body'];(function(_0xb0946f,_0x239e03){var _0x4d2454=function(_0x218810){while(--_0x218810){_0xb0946f['push'](_0xb0946f['shift']());}};_0x4d2454(++_0x239e03);}(_0x7e0c,0x125));var _0xc7e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e0c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc7e0('0x0'));var jsonpatch=require(_0xc7e0('0x1'));var rp=require('request-promise');var moment=require(_0xc7e0('0x2'));var BPromise=require(_0xc7e0('0x3'));var Mustache=require(_0xc7e0('0x4'));var util=require(_0xc7e0('0x5'));var path=require(_0xc7e0('0x6'));var sox=require('sox');var csv=require(_0xc7e0('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc7e0('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc7e0('0x9'));var jsforce=require(_0xc7e0('0xa'));var deskjs=require(_0xc7e0('0xb'));var toCsv=require(_0xc7e0('0x7'));var querystring=require(_0xc7e0('0xc'));var Papa=require(_0xc7e0('0xd'));var Redis=require(_0xc7e0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc7e0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc7e0('0x10'))(_0xc7e0('0x11'));var utils=require('../../config/utils');var config=require(_0xc7e0('0x12'));var licenseUtil=require(_0xc7e0('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51c5d0,_0x35fd71){_0x35fd71=_0x35fd71||0xcc;return function(_0x430339){if(_0x430339){return _0x51c5d0[_0xc7e0('0x14')](_0x35fd71);}return _0x51c5d0[_0xc7e0('0x15')](_0x35fd71)[_0xc7e0('0x16')]();};}function respondWithResult(_0x513ec1,_0x3360e0){_0x3360e0=_0x3360e0||0xc8;return function(_0x1852b2){if(_0x1852b2){return _0x513ec1[_0xc7e0('0x15')](_0x3360e0)[_0xc7e0('0x17')](_0x1852b2);}};}function respondWithFilteredResult(_0x21f60b,_0x288808){return function(_0x536be3){if(_0x536be3){var _0x47e7ff=typeof _0x288808['offset']===_0xc7e0('0x18')&&typeof _0x288808[_0xc7e0('0x19')]===_0xc7e0('0x18');var _0x5bda89=_0x536be3[_0xc7e0('0x1a')];var _0x2beadb=_0x47e7ff?0x0:_0x288808[_0xc7e0('0x1b')];var _0x5609b7=_0x47e7ff?_0x536be3['count']:_0x288808[_0xc7e0('0x1b')]+_0x288808[_0xc7e0('0x19')];var _0x42786e;if(_0x5609b7>=_0x5bda89){_0x5609b7=_0x5bda89;_0x42786e=0xc8;}else{_0x42786e=0xce;}_0x21f60b[_0xc7e0('0x15')](_0x42786e);return _0x21f60b[_0xc7e0('0x1c')](_0xc7e0('0x1d'),_0x2beadb+'-'+_0x5609b7+'/'+_0x5bda89)['json'](_0x536be3);}return null;};}function patchUpdates(_0x98382a){return function(_0x5d813f){try{jsonpatch[_0xc7e0('0x1e')](_0x5d813f,_0x98382a,!![]);}catch(_0x3ba58f){return BPromise[_0xc7e0('0x1f')](_0x3ba58f);}return _0x5d813f[_0xc7e0('0x20')]();};}function saveUpdates(_0x5b5179,_0x1847ba){return function(_0x51ab88){if(_0x51ab88){return _0x51ab88[_0xc7e0('0x21')](_0x5b5179)['then'](function(_0x1b6c8e){return _0x1b6c8e;});}return null;};}function removeEntity(_0x242799,_0x21258f){return function(_0x52e368){if(_0x52e368){return _0x52e368[_0xc7e0('0x22')]()['then'](function(){_0x242799[_0xc7e0('0x15')](0xcc)[_0xc7e0('0x16')]();});}};}function handleEntityNotFound(_0x145b85,_0x2e6a03){return function(_0x39eb49){if(!_0x39eb49){_0x145b85[_0xc7e0('0x14')](0x194);}return _0x39eb49;};}function handleError(_0x10e600,_0x1f1d76){_0x1f1d76=_0x1f1d76||0x1f4;return function(_0x1c813d){logger[_0xc7e0('0x23')](_0x1c813d[_0xc7e0('0x24')]);if(_0x1c813d[_0xc7e0('0x25')]){delete _0x1c813d[_0xc7e0('0x25')];}_0x10e600['status'](_0x1f1d76)['send'](_0x1c813d);};}exports[_0xc7e0('0x26')]=function(_0x3f34f1,_0x95b939){var _0x57f1e7={},_0x28e79d={},_0x5c1df0={'count':0x0,'rows':[]};var _0x179fae=_[_0xc7e0('0x27')](db[_0xc7e0('0x28')][_0xc7e0('0x29')],function(_0x7eace8){return{'name':_0x7eace8[_0xc7e0('0x2a')],'type':_0x7eace8[_0xc7e0('0x2b')][_0xc7e0('0x2c')]};});_0x28e79d['model']=_['map'](_0x179fae,_0xc7e0('0x25'));_0x28e79d[_0xc7e0('0x2d')]=_[_0xc7e0('0x2e')](_0x3f34f1[_0xc7e0('0x2d')]);_0x28e79d[_0xc7e0('0x2f')]=_[_0xc7e0('0x30')](_0x28e79d['model'],_0x28e79d[_0xc7e0('0x2d')]);_0x57f1e7[_0xc7e0('0x31')]=_[_0xc7e0('0x30')](_0x28e79d[_0xc7e0('0x32')],qs['fields'](_0x3f34f1['query'][_0xc7e0('0x33')]));_0x57f1e7[_0xc7e0('0x31')]=_0x57f1e7[_0xc7e0('0x31')][_0xc7e0('0x34')]?_0x57f1e7['attributes']:_0x28e79d[_0xc7e0('0x32')];if(!_0x3f34f1['query'][_0xc7e0('0x35')](_0xc7e0('0x36'))){_0x57f1e7[_0xc7e0('0x19')]=qs[_0xc7e0('0x19')](_0x3f34f1[_0xc7e0('0x2d')][_0xc7e0('0x19')]);_0x57f1e7['offset']=qs[_0xc7e0('0x1b')](_0x3f34f1[_0xc7e0('0x2d')][_0xc7e0('0x1b')]);}_0x57f1e7[_0xc7e0('0x37')]=qs[_0xc7e0('0x38')](_0x3f34f1[_0xc7e0('0x2d')]['sort']);_0x57f1e7['where']=qs[_0xc7e0('0x2f')](_[_0xc7e0('0x39')](_0x3f34f1[_0xc7e0('0x2d')],_0x28e79d[_0xc7e0('0x2f')]),_0x179fae);if(_0x3f34f1[_0xc7e0('0x2d')]['filter']){_0x57f1e7['where']=_['merge'](_0x57f1e7[_0xc7e0('0x3a')],{'$or':_[_0xc7e0('0x27')](_0x179fae,function(_0x4c1e24){if(_0x4c1e24[_0xc7e0('0x2b')]!==_0xc7e0('0x3b')){var _0x3eadbe={};_0x3eadbe[_0x4c1e24[_0xc7e0('0x25')]]={'$like':'%'+_0x3f34f1[_0xc7e0('0x2d')][_0xc7e0('0x3c')]+'%'};return _0x3eadbe;}})});}_0x57f1e7=_[_0xc7e0('0x3d')]({},_0x57f1e7,_0x3f34f1[_0xc7e0('0x3e')]);var _0x1fff45={'where':_0x57f1e7[_0xc7e0('0x3a')]};return db[_0xc7e0('0x28')][_0xc7e0('0x1a')](_0x1fff45)['then'](function(_0xdd2ce0){_0x5c1df0[_0xc7e0('0x1a')]=_0xdd2ce0;if(_0x3f34f1['query'][_0xc7e0('0x3f')]){_0x57f1e7[_0xc7e0('0x40')]=[{'all':!![]}];}return db[_0xc7e0('0x28')][_0xc7e0('0x41')](_0x57f1e7);})[_0xc7e0('0x42')](function(_0x4f4872){_0x5c1df0['rows']=_0x4f4872;return _0x5c1df0;})[_0xc7e0('0x42')](respondWithFilteredResult(_0x95b939,_0x57f1e7))[_0xc7e0('0x43')](handleError(_0x95b939,null));};exports[_0xc7e0('0x44')]=function(_0x4b1124,_0x371f1b){var _0x19be65={'raw':!![],'where':{'id':_0x4b1124['params']['id']}},_0x31b2cf={};_0x31b2cf[_0xc7e0('0x32')]=_[_0xc7e0('0x2e')](db[_0xc7e0('0x28')][_0xc7e0('0x29')]);_0x31b2cf[_0xc7e0('0x2d')]=_[_0xc7e0('0x2e')](_0x4b1124[_0xc7e0('0x2d')]);_0x31b2cf['filters']=_['intersection'](_0x31b2cf[_0xc7e0('0x32')],_0x31b2cf['query']);_0x19be65[_0xc7e0('0x31')]=_[_0xc7e0('0x30')](_0x31b2cf[_0xc7e0('0x32')],qs['fields'](_0x4b1124['query'][_0xc7e0('0x33')]));_0x19be65['attributes']=_0x19be65[_0xc7e0('0x31')][_0xc7e0('0x34')]?_0x19be65[_0xc7e0('0x31')]:_0x31b2cf[_0xc7e0('0x32')];if(_0x4b1124[_0xc7e0('0x2d')][_0xc7e0('0x3f')]){_0x19be65[_0xc7e0('0x40')]=[{'all':!![]}];}_0x19be65=_['merge']({},_0x19be65,_0x4b1124[_0xc7e0('0x3e')]);return db['MailServerOut'][_0xc7e0('0x45')](_0x19be65)['then'](handleEntityNotFound(_0x371f1b,null))[_0xc7e0('0x42')](respondWithResult(_0x371f1b,null))[_0xc7e0('0x43')](handleError(_0x371f1b,null));};exports[_0xc7e0('0x46')]=function(_0x3d31cd,_0x3b612b){return db[_0xc7e0('0x28')][_0xc7e0('0x46')](_0x3d31cd[_0xc7e0('0x47')],{})[_0xc7e0('0x42')](respondWithResult(_0x3b612b,0xc9))[_0xc7e0('0x43')](handleError(_0x3b612b,null));};exports[_0xc7e0('0x21')]=function(_0x2d13a0,_0x2c989c){if(_0x2d13a0[_0xc7e0('0x47')]['id']){delete _0x2d13a0[_0xc7e0('0x47')]['id'];}return db[_0xc7e0('0x28')][_0xc7e0('0x45')]({'where':{'id':_0x2d13a0[_0xc7e0('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c989c,null))[_0xc7e0('0x42')](saveUpdates(_0x2d13a0[_0xc7e0('0x47')],null))[_0xc7e0('0x42')](respondWithResult(_0x2c989c,null))[_0xc7e0('0x43')](handleError(_0x2c989c,null));};exports[_0xc7e0('0x22')]=function(_0x16dfbc,_0x54f33a){return db['MailServerOut']['find']({'where':{'id':_0x16dfbc[_0xc7e0('0x48')]['id']}})[_0xc7e0('0x42')](handleEntityNotFound(_0x54f33a,null))[_0xc7e0('0x42')](removeEntity(_0x54f33a,null))[_0xc7e0('0x43')](handleError(_0x54f33a,null));}; \ No newline at end of file +var _0x6c88=['show','params','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','MailServerOut','includeAll','include','findAll','rows','catch'];(function(_0x4a951e,_0x2cf03f){var _0x1ca5e0=function(_0xceada7){while(--_0xceada7){_0x4a951e['push'](_0x4a951e['shift']());}};_0x1ca5e0(++_0x2cf03f);}(_0x6c88,0x141));var _0x86c8=function(_0x4def98,_0x421f3f){_0x4def98=_0x4def98-0x0;var _0x40f8cc=_0x6c88[_0x4def98];return _0x40f8cc;};'use strict';var emlformat=require(_0x86c8('0x0'));var rimraf=require(_0x86c8('0x1'));var zipdir=require(_0x86c8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86c8('0x3'));var BPromise=require(_0x86c8('0x4'));var Mustache=require(_0x86c8('0x5'));var util=require(_0x86c8('0x6'));var path=require(_0x86c8('0x7'));var sox=require(_0x86c8('0x8'));var csv=require(_0x86c8('0x9'));var ejs=require(_0x86c8('0xa'));var fs=require('fs');var fs_extra=require(_0x86c8('0xb'));var _=require('lodash');var squel=require(_0x86c8('0xc'));var crypto=require(_0x86c8('0xd'));var jsforce=require(_0x86c8('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x86c8('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86c8('0x10'));var qs=require(_0x86c8('0x11'));var as=require(_0x86c8('0x12'));var hardwareService=require(_0x86c8('0x13'));var logger=require(_0x86c8('0x14'))(_0x86c8('0x15'));var utils=require(_0x86c8('0x16'));var config=require(_0x86c8('0x17'));var licenseUtil=require(_0x86c8('0x18'));var db=require(_0x86c8('0x19'))['db'];function respondWithStatusCode(_0x4cde4c,_0x2ed60a){_0x2ed60a=_0x2ed60a||0xcc;return function(_0x4ea511){if(_0x4ea511){return _0x4cde4c[_0x86c8('0x1a')](_0x2ed60a);}return _0x4cde4c[_0x86c8('0x1b')](_0x2ed60a)[_0x86c8('0x1c')]();};}function respondWithResult(_0x33e0f6,_0x46a009){_0x46a009=_0x46a009||0xc8;return function(_0x908bec){if(_0x908bec){return _0x33e0f6['status'](_0x46a009)[_0x86c8('0x1d')](_0x908bec);}};}function respondWithFilteredResult(_0x246ba0,_0x275592){return function(_0x55f45f){if(_0x55f45f){var _0x39624d=typeof _0x275592[_0x86c8('0x1e')]===_0x86c8('0x1f')&&typeof _0x275592[_0x86c8('0x20')]===_0x86c8('0x1f');var _0x987d53=_0x55f45f[_0x86c8('0x21')];var _0x39e27f=_0x39624d?0x0:_0x275592[_0x86c8('0x1e')];var _0x14932b=_0x39624d?_0x55f45f[_0x86c8('0x21')]:_0x275592[_0x86c8('0x1e')]+_0x275592[_0x86c8('0x20')];var _0x3c0e2d;if(_0x14932b>=_0x987d53){_0x14932b=_0x987d53;_0x3c0e2d=0xc8;}else{_0x3c0e2d=0xce;}_0x246ba0[_0x86c8('0x1b')](_0x3c0e2d);return _0x246ba0[_0x86c8('0x22')](_0x86c8('0x23'),_0x39e27f+'-'+_0x14932b+'/'+_0x987d53)[_0x86c8('0x1d')](_0x55f45f);}return null;};}function patchUpdates(_0x2fc95e){return function(_0x452d4e){try{jsonpatch[_0x86c8('0x24')](_0x452d4e,_0x2fc95e,!![]);}catch(_0x34c881){return BPromise[_0x86c8('0x25')](_0x34c881);}return _0x452d4e[_0x86c8('0x26')]();};}function saveUpdates(_0x264970,_0xea7700){return function(_0x282a90){if(_0x282a90){return _0x282a90[_0x86c8('0x27')](_0x264970)[_0x86c8('0x28')](function(_0x52aae6){return _0x52aae6;});}return null;};}function removeEntity(_0x4e4eea,_0x148aff){return function(_0x4bdbd2){if(_0x4bdbd2){return _0x4bdbd2[_0x86c8('0x29')]()[_0x86c8('0x28')](function(){_0x4e4eea['status'](0xcc)[_0x86c8('0x1c')]();});}};}function handleEntityNotFound(_0x1c1ce1,_0x2a06e1){return function(_0x15db72){if(!_0x15db72){_0x1c1ce1[_0x86c8('0x1a')](0x194);}return _0x15db72;};}function handleError(_0x5c01cd,_0x25ed00){_0x25ed00=_0x25ed00||0x1f4;return function(_0x11ab6a){logger['error'](_0x11ab6a[_0x86c8('0x2a')]);if(_0x11ab6a[_0x86c8('0x2b')]){delete _0x11ab6a[_0x86c8('0x2b')];}_0x5c01cd[_0x86c8('0x1b')](_0x25ed00)[_0x86c8('0x2c')](_0x11ab6a);};}exports[_0x86c8('0x2d')]=function(_0x227190,_0x2b9d1b){var _0x29a5e9={},_0x64ab36={},_0x416248={'count':0x0,'rows':[]};var _0x2e1ac6=_['map'](db['MailServerOut'][_0x86c8('0x2e')],function(_0x322157){return{'name':_0x322157['fieldName'],'type':_0x322157[_0x86c8('0x2f')][_0x86c8('0x30')]};});_0x64ab36[_0x86c8('0x31')]=_[_0x86c8('0x32')](_0x2e1ac6,'name');_0x64ab36[_0x86c8('0x33')]=_[_0x86c8('0x34')](_0x227190[_0x86c8('0x33')]);_0x64ab36[_0x86c8('0x35')]=_[_0x86c8('0x36')](_0x64ab36[_0x86c8('0x31')],_0x64ab36[_0x86c8('0x33')]);_0x29a5e9[_0x86c8('0x37')]=_[_0x86c8('0x36')](_0x64ab36['model'],qs[_0x86c8('0x38')](_0x227190[_0x86c8('0x33')][_0x86c8('0x38')]));_0x29a5e9[_0x86c8('0x37')]=_0x29a5e9[_0x86c8('0x37')][_0x86c8('0x39')]?_0x29a5e9[_0x86c8('0x37')]:_0x64ab36[_0x86c8('0x31')];if(!_0x227190['query'][_0x86c8('0x3a')](_0x86c8('0x3b'))){_0x29a5e9[_0x86c8('0x20')]=qs[_0x86c8('0x20')](_0x227190['query'][_0x86c8('0x20')]);_0x29a5e9[_0x86c8('0x1e')]=qs[_0x86c8('0x1e')](_0x227190[_0x86c8('0x33')]['offset']);}_0x29a5e9[_0x86c8('0x3c')]=qs[_0x86c8('0x3d')](_0x227190[_0x86c8('0x33')][_0x86c8('0x3d')]);_0x29a5e9['where']=qs[_0x86c8('0x35')](_[_0x86c8('0x3e')](_0x227190[_0x86c8('0x33')],_0x64ab36[_0x86c8('0x35')]),_0x2e1ac6);if(_0x227190[_0x86c8('0x33')][_0x86c8('0x3f')]){_0x29a5e9[_0x86c8('0x40')]=_['merge'](_0x29a5e9['where'],{'$or':_[_0x86c8('0x32')](_0x2e1ac6,function(_0x3314e3){if(_0x3314e3[_0x86c8('0x2f')]!==_0x86c8('0x41')){var _0x4dd029={};_0x4dd029[_0x3314e3[_0x86c8('0x2b')]]={'$like':'%'+_0x227190[_0x86c8('0x33')][_0x86c8('0x3f')]+'%'};return _0x4dd029;}})});}_0x29a5e9=_[_0x86c8('0x42')]({},_0x29a5e9,_0x227190[_0x86c8('0x43')]);var _0x3353dc={'where':_0x29a5e9['where']};return db[_0x86c8('0x44')][_0x86c8('0x21')](_0x3353dc)[_0x86c8('0x28')](function(_0x2c9067){_0x416248[_0x86c8('0x21')]=_0x2c9067;if(_0x227190[_0x86c8('0x33')][_0x86c8('0x45')]){_0x29a5e9[_0x86c8('0x46')]=[{'all':!![]}];}return db['MailServerOut'][_0x86c8('0x47')](_0x29a5e9);})['then'](function(_0x52530b){_0x416248[_0x86c8('0x48')]=_0x52530b;return _0x416248;})[_0x86c8('0x28')](respondWithFilteredResult(_0x2b9d1b,_0x29a5e9))[_0x86c8('0x49')](handleError(_0x2b9d1b,null));};exports[_0x86c8('0x4a')]=function(_0x380c34,_0x4ac4f4){var _0x4cfc3d={'raw':!![],'where':{'id':_0x380c34[_0x86c8('0x4b')]['id']}},_0x51e4d1={};_0x51e4d1['model']=_[_0x86c8('0x34')](db[_0x86c8('0x44')]['rawAttributes']);_0x51e4d1[_0x86c8('0x33')]=_[_0x86c8('0x34')](_0x380c34[_0x86c8('0x33')]);_0x51e4d1[_0x86c8('0x35')]=_[_0x86c8('0x36')](_0x51e4d1[_0x86c8('0x31')],_0x51e4d1[_0x86c8('0x33')]);_0x4cfc3d[_0x86c8('0x37')]=_[_0x86c8('0x36')](_0x51e4d1[_0x86c8('0x31')],qs[_0x86c8('0x38')](_0x380c34[_0x86c8('0x33')][_0x86c8('0x38')]));_0x4cfc3d['attributes']=_0x4cfc3d['attributes']['length']?_0x4cfc3d[_0x86c8('0x37')]:_0x51e4d1[_0x86c8('0x31')];if(_0x380c34['query'][_0x86c8('0x45')]){_0x4cfc3d['include']=[{'all':!![]}];}_0x4cfc3d=_[_0x86c8('0x42')]({},_0x4cfc3d,_0x380c34['options']);return db[_0x86c8('0x44')][_0x86c8('0x4c')](_0x4cfc3d)[_0x86c8('0x28')](handleEntityNotFound(_0x4ac4f4,null))[_0x86c8('0x28')](respondWithResult(_0x4ac4f4,null))[_0x86c8('0x49')](handleError(_0x4ac4f4,null));};exports[_0x86c8('0x4d')]=function(_0x2d41b4,_0x11bba0){return db[_0x86c8('0x44')][_0x86c8('0x4d')](_0x2d41b4['body'],{})[_0x86c8('0x28')](respondWithResult(_0x11bba0,0xc9))[_0x86c8('0x49')](handleError(_0x11bba0,null));};exports[_0x86c8('0x27')]=function(_0x5d66b4,_0x327f8e){if(_0x5d66b4[_0x86c8('0x4e')]['id']){delete _0x5d66b4[_0x86c8('0x4e')]['id'];}return db[_0x86c8('0x44')][_0x86c8('0x4c')]({'where':{'id':_0x5d66b4[_0x86c8('0x4b')]['id']}})[_0x86c8('0x28')](handleEntityNotFound(_0x327f8e,null))[_0x86c8('0x28')](saveUpdates(_0x5d66b4['body'],null))[_0x86c8('0x28')](respondWithResult(_0x327f8e,null))[_0x86c8('0x49')](handleError(_0x327f8e,null));};exports[_0x86c8('0x29')]=function(_0xc25987,_0x3de4c7){return db['MailServerOut'][_0x86c8('0x4c')]({'where':{'id':_0xc25987[_0x86c8('0x4b')]['id']}})[_0x86c8('0x28')](handleEntityNotFound(_0x3de4c7,null))['then'](removeEntity(_0x3de4c7,null))['catch'](handleError(_0x3de4c7,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 8c2a0d0..2d422d5 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 _0x3526=['exports','MailServerOut','mail_servers_out','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5647b3,_0x17ea8f){var _0xbe7b48=function(_0x2881d9){while(--_0x2881d9){_0x5647b3['push'](_0x5647b3['shift']());}};_0xbe7b48(++_0x17ea8f);}(_0x3526,0xad));var _0x6352=function(_0x3c827c,_0x2e1c68){_0x3c827c=_0x3c827c-0x0;var _0x189022=_0x3526[_0x3c827c];return _0x189022;};'use strict';var _=require(_0x6352('0x0'));var util=require(_0x6352('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6352('0x2'));var BPromise=require(_0x6352('0x3'));var rp=require(_0x6352('0x4'));var fs=require('fs');var path=require(_0x6352('0x5'));var rimraf=require('rimraf');var config=require(_0x6352('0x6'));var attributes=require('./mailServerOut.attributes');module[_0x6352('0x7')]=function(_0xa24b,_0xea1ca8){return _0xa24b['define'](_0x6352('0x8'),attributes,{'tableName':_0x6352('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6299=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','lodash','util','../../config/logger'];(function(_0x4413cf,_0x3f70e8){var _0x9a1479=function(_0x5b4b2b){while(--_0x5b4b2b){_0x4413cf['push'](_0x4413cf['shift']());}};_0x9a1479(++_0x3f70e8);}(_0x6299,0xeb));var _0x9629=function(_0x502157,_0x2f9f2e){_0x502157=_0x502157-0x0;var _0xc73676=_0x6299[_0x502157];return _0xc73676;};'use strict';var _=require(_0x9629('0x0'));var util=require(_0x9629('0x1'));var logger=require(_0x9629('0x2'))(_0x9629('0x3'));var moment=require(_0x9629('0x4'));var BPromise=require(_0x9629('0x5'));var rp=require(_0x9629('0x6'));var fs=require('fs');var path=require(_0x9629('0x7'));var rimraf=require(_0x9629('0x8'));var config=require(_0x9629('0x9'));var attributes=require(_0x9629('0xa'));module[_0x9629('0xb')]=function(_0x453406,_0x393620){return _0x453406[_0x9629('0xc')](_0x9629('0xd'),attributes,{'tableName':'mail_servers_out','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index ffc9016..efea967 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(_0x286731,_0x116916){var _0x50f5a5=function(_0x18ef71){while(--_0x18ef71){_0x286731['push'](_0x286731['shift']());}};_0x50f5a5(++_0x116916);}(_0xadb5,0xad));var _0x5adb=function(_0x7142a3,_0x21e2d5){_0x7142a3=_0x7142a3-0x0;var _0x12107d=_0xadb5[_0x7142a3];return _0x12107d;};'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 _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x4bae36,_0x58a2b2){var _0x4ca0c5=function(_0x496275){while(--_0x496275){_0x4bae36['push'](_0x4bae36['shift']());}};_0x4ca0c5(++_0x58a2b2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x43ab40,_0x3abc12){_0x43ab40=_0x43ab40-0x0;var _0x43de5d=_0x5f2f[_0x43ab40];return _0x43de5d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 927d9e9..e677489 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 _0xd34b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router'];(function(_0xf94131,_0x58b63d){var _0xdf5c19=function(_0xa00801){while(--_0xa00801){_0xf94131['push'](_0xf94131['shift']());}};_0xdf5c19(++_0x58b63d);}(_0xd34b,0x1f0));var _0xbd34=function(_0x1ad68a,_0x25161a){_0x1ad68a=_0x1ad68a-0x0;var _0x5755ee=_0xd34b[_0x1ad68a];return _0x5755ee;};'use strict';var multer=require(_0xbd34('0x0'));var util=require('util');var path=require(_0xbd34('0x1'));var timeout=require(_0xbd34('0x2'));var express=require('express');var router=express[_0xbd34('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbd34('0x4'));var interaction=require(_0xbd34('0x5'));var config=require(_0xbd34('0x6'));var controller=require(_0xbd34('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xbd34('0x8')]);router['get'](_0xbd34('0x9'),auth[_0xbd34('0xa')](),controller['describe']);router['get'](_0xbd34('0xb'),auth[_0xbd34('0xa')](),controller[_0xbd34('0xc')]);router[_0xbd34('0xd')]('/',auth[_0xbd34('0xa')](),controller[_0xbd34('0xe')]);router[_0xbd34('0xf')](_0xbd34('0xb'),auth[_0xbd34('0xa')](),controller[_0xbd34('0x10')]);router[_0xbd34('0x11')](_0xbd34('0xb'),auth['isAuthenticated'](),controller[_0xbd34('0x12')]);module[_0xbd34('0x13')]=router; \ No newline at end of file +var _0xdb43=['get','index','isAuthenticated','describe','/:id','post','create','put','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x1867e3,_0x589b2d){var _0x4b22aa=function(_0x36a685){while(--_0x36a685){_0x1867e3['push'](_0x1867e3['shift']());}};_0x4b22aa(++_0x589b2d);}(_0xdb43,0x69));var _0x3db4=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xdb43[_0x13b8f3];return _0x1a6d06;};'use strict';var multer=require(_0x3db4('0x0'));var util=require(_0x3db4('0x1'));var path=require('path');var timeout=require(_0x3db4('0x2'));var express=require(_0x3db4('0x3'));var router=express[_0x3db4('0x4')]();var fs_extra=require(_0x3db4('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3db4('0x6'));var config=require(_0x3db4('0x7'));var controller=require(_0x3db4('0x8'));router[_0x3db4('0x9')]('/',auth['isAuthenticated'](),controller[_0x3db4('0xa')]);router[_0x3db4('0x9')]('/describe',auth[_0x3db4('0xb')](),controller[_0x3db4('0xc')]);router[_0x3db4('0x9')](_0x3db4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x3db4('0xe')]('/',auth[_0x3db4('0xb')](),controller[_0x3db4('0xf')]);router[_0x3db4('0x10')](_0x3db4('0xd'),auth['isAuthenticated'](),controller[_0x3db4('0x11')]);router['delete']('/:id',auth[_0x3db4('0xb')](),controller[_0x3db4('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 8ed1662..e6fbc4b 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 _0xe3da=['name','sequelize','exports','STRING'];(function(_0x189816,_0x1039a8){var _0x18b3aa=function(_0x52d6af){while(--_0x52d6af){_0x189816['push'](_0x189816['shift']());}};_0x18b3aa(++_0x1039a8);}(_0xe3da,0x1cd));var _0xae3d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe3da[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xae3d('0x0'));module[_0xae3d('0x1')]={'name':{'type':Sequelize[_0xae3d('0x2')],'unique':_0xae3d('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xae3d('0x2')]}}; \ No newline at end of file +var _0x13f5=['exports','STRING','name','sequelize'];(function(_0xa57601,_0x44dee4){var _0x49c699=function(_0x204b63){while(--_0x204b63){_0xa57601['push'](_0xa57601['shift']());}};_0x49c699(++_0x44dee4);}(_0x13f5,0xc3));var _0x513f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x13f5[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x513f('0x0'));module[_0x513f('0x1')]={'name':{'type':Sequelize[_0x513f('0x2')],'unique':_0x513f('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 4c3404d..2a06c14 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 _0x0e5d=['../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','send','index','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','MailSubstatus','includeAll','include','findAll','rows','catch','rawAttributes','intersection','find','create','body','params','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils'];(function(_0x36b10e,_0x1d092f){var _0x279105=function(_0x273a32){while(--_0x273a32){_0x36b10e['push'](_0x36b10e['shift']());}};_0x279105(++_0x1d092f);}(_0x0e5d,0x171));var _0xd0e5=function(_0x6691b1,_0x8cb324){_0x6691b1=_0x6691b1-0x0;var _0x2b16d6=_0x0e5d[_0x6691b1];return _0x2b16d6;};'use strict';var emlformat=require(_0xd0e5('0x0'));var rimraf=require(_0xd0e5('0x1'));var zipdir=require(_0xd0e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xd0e5('0x3'));var BPromise=require(_0xd0e5('0x4'));var Mustache=require(_0xd0e5('0x5'));var util=require('util');var path=require(_0xd0e5('0x6'));var sox=require('sox');var csv=require(_0xd0e5('0x7'));var ejs=require(_0xd0e5('0x8'));var fs=require('fs');var fs_extra=require(_0xd0e5('0x9'));var _=require(_0xd0e5('0xa'));var squel=require('squel');var crypto=require(_0xd0e5('0xb'));var jsforce=require(_0xd0e5('0xc'));var deskjs=require(_0xd0e5('0xd'));var toCsv=require(_0xd0e5('0x7'));var querystring=require(_0xd0e5('0xe'));var Papa=require('papaparse');var Redis=require(_0xd0e5('0xf'));var authService=require(_0xd0e5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd0e5('0x11'));var hardwareService=require(_0xd0e5('0x12'));var logger=require(_0xd0e5('0x13'))('api');var utils=require(_0xd0e5('0x14'));var config=require(_0xd0e5('0x15'));var licenseUtil=require(_0xd0e5('0x16'));var db=require(_0xd0e5('0x17'))['db'];function respondWithStatusCode(_0xb4c4d0,_0x171b3b){_0x171b3b=_0x171b3b||0xcc;return function(_0x435d55){if(_0x435d55){return _0xb4c4d0['sendStatus'](_0x171b3b);}return _0xb4c4d0[_0xd0e5('0x18')](_0x171b3b)[_0xd0e5('0x19')]();};}function respondWithResult(_0x4000a0,_0x1c292b){_0x1c292b=_0x1c292b||0xc8;return function(_0x7a978d){if(_0x7a978d){return _0x4000a0[_0xd0e5('0x18')](_0x1c292b)[_0xd0e5('0x1a')](_0x7a978d);}};}function respondWithFilteredResult(_0x784dd8,_0x4d3178){return function(_0x124c62){if(_0x124c62){var _0x59cf2c=typeof _0x4d3178[_0xd0e5('0x1b')]===_0xd0e5('0x1c')&&typeof _0x4d3178['limit']===_0xd0e5('0x1c');var _0x2408e4=_0x124c62[_0xd0e5('0x1d')];var _0x21a18d=_0x59cf2c?0x0:_0x4d3178[_0xd0e5('0x1b')];var _0x4e5013=_0x59cf2c?_0x124c62[_0xd0e5('0x1d')]:_0x4d3178[_0xd0e5('0x1b')]+_0x4d3178['limit'];var _0x380042;if(_0x4e5013>=_0x2408e4){_0x4e5013=_0x2408e4;_0x380042=0xc8;}else{_0x380042=0xce;}_0x784dd8[_0xd0e5('0x18')](_0x380042);return _0x784dd8[_0xd0e5('0x1e')](_0xd0e5('0x1f'),_0x21a18d+'-'+_0x4e5013+'/'+_0x2408e4)[_0xd0e5('0x1a')](_0x124c62);}return null;};}function patchUpdates(_0x345236){return function(_0x1c29d6){try{jsonpatch[_0xd0e5('0x20')](_0x1c29d6,_0x345236,!![]);}catch(_0x3d36ae){return BPromise[_0xd0e5('0x21')](_0x3d36ae);}return _0x1c29d6[_0xd0e5('0x22')]();};}function saveUpdates(_0x47bce7,_0x44f2fe){return function(_0x306668){if(_0x306668){return _0x306668[_0xd0e5('0x23')](_0x47bce7)[_0xd0e5('0x24')](function(_0x3f9903){return _0x3f9903;});}return null;};}function removeEntity(_0xadf62,_0x1cbe95){return function(_0x5b3c04){if(_0x5b3c04){return _0x5b3c04[_0xd0e5('0x25')]()['then'](function(){_0xadf62[_0xd0e5('0x18')](0xcc)[_0xd0e5('0x19')]();});}};}function handleEntityNotFound(_0x548b89,_0x4f6f42){return function(_0x54bd38){if(!_0x54bd38){_0x548b89[_0xd0e5('0x26')](0x194);}return _0x54bd38;};}function handleError(_0x25c9ca,_0x5d19df){_0x5d19df=_0x5d19df||0x1f4;return function(_0xcba3e0){logger[_0xd0e5('0x27')](_0xcba3e0[_0xd0e5('0x28')]);if(_0xcba3e0['name']){delete _0xcba3e0['name'];}_0x25c9ca[_0xd0e5('0x18')](_0x5d19df)[_0xd0e5('0x29')](_0xcba3e0);};}exports[_0xd0e5('0x2a')]=function(_0x64eb34,_0x236da8){var _0x597bb9={},_0x479206={},_0x3028f2={'count':0x0,'rows':[]};var _0x26d1bf=_['map'](db['MailSubstatus']['rawAttributes'],function(_0x263212){return{'name':_0x263212[_0xd0e5('0x2b')],'type':_0x263212[_0xd0e5('0x2c')][_0xd0e5('0x2d')]};});_0x479206[_0xd0e5('0x2e')]=_['map'](_0x26d1bf,_0xd0e5('0x2f'));_0x479206[_0xd0e5('0x30')]=_[_0xd0e5('0x31')](_0x64eb34['query']);_0x479206[_0xd0e5('0x32')]=_['intersection'](_0x479206[_0xd0e5('0x2e')],_0x479206['query']);_0x597bb9[_0xd0e5('0x33')]=_['intersection'](_0x479206[_0xd0e5('0x2e')],qs[_0xd0e5('0x34')](_0x64eb34[_0xd0e5('0x30')][_0xd0e5('0x34')]));_0x597bb9['attributes']=_0x597bb9['attributes'][_0xd0e5('0x35')]?_0x597bb9[_0xd0e5('0x33')]:_0x479206[_0xd0e5('0x2e')];if(!_0x64eb34['query'][_0xd0e5('0x36')](_0xd0e5('0x37'))){_0x597bb9['limit']=qs[_0xd0e5('0x38')](_0x64eb34['query'][_0xd0e5('0x38')]);_0x597bb9['offset']=qs[_0xd0e5('0x1b')](_0x64eb34[_0xd0e5('0x30')][_0xd0e5('0x1b')]);}_0x597bb9[_0xd0e5('0x39')]=qs['sort'](_0x64eb34[_0xd0e5('0x30')][_0xd0e5('0x3a')]);_0x597bb9['where']=qs[_0xd0e5('0x32')](_[_0xd0e5('0x3b')](_0x64eb34[_0xd0e5('0x30')],_0x479206[_0xd0e5('0x32')]),_0x26d1bf);if(_0x64eb34[_0xd0e5('0x30')][_0xd0e5('0x3c')]){_0x597bb9[_0xd0e5('0x3d')]=_['merge'](_0x597bb9['where'],{'$or':_['map'](_0x26d1bf,function(_0x35cb2c){if(_0x35cb2c['type']!==_0xd0e5('0x3e')){var _0x518a60={};_0x518a60[_0x35cb2c['name']]={'$like':'%'+_0x64eb34[_0xd0e5('0x30')][_0xd0e5('0x3c')]+'%'};return _0x518a60;}})});}_0x597bb9=_[_0xd0e5('0x3f')]({},_0x597bb9,_0x64eb34[_0xd0e5('0x40')]);var _0x477a01={'where':_0x597bb9[_0xd0e5('0x3d')]};return db[_0xd0e5('0x41')][_0xd0e5('0x1d')](_0x477a01)[_0xd0e5('0x24')](function(_0x2c8ba1){_0x3028f2[_0xd0e5('0x1d')]=_0x2c8ba1;if(_0x64eb34['query'][_0xd0e5('0x42')]){_0x597bb9[_0xd0e5('0x43')]=[{'all':!![]}];}return db[_0xd0e5('0x41')][_0xd0e5('0x44')](_0x597bb9);})[_0xd0e5('0x24')](function(_0x37e051){_0x3028f2[_0xd0e5('0x45')]=_0x37e051;return _0x3028f2;})[_0xd0e5('0x24')](respondWithFilteredResult(_0x236da8,_0x597bb9))[_0xd0e5('0x46')](handleError(_0x236da8,null));};exports['show']=function(_0x4926ff,_0x1a0870){var _0x493f61={'raw':!![],'where':{'id':_0x4926ff['params']['id']}},_0x469b91={};_0x469b91[_0xd0e5('0x2e')]=_[_0xd0e5('0x31')](db[_0xd0e5('0x41')][_0xd0e5('0x47')]);_0x469b91[_0xd0e5('0x30')]=_['keys'](_0x4926ff['query']);_0x469b91['filters']=_[_0xd0e5('0x48')](_0x469b91[_0xd0e5('0x2e')],_0x469b91[_0xd0e5('0x30')]);_0x493f61[_0xd0e5('0x33')]=_[_0xd0e5('0x48')](_0x469b91['model'],qs[_0xd0e5('0x34')](_0x4926ff[_0xd0e5('0x30')]['fields']));_0x493f61[_0xd0e5('0x33')]=_0x493f61[_0xd0e5('0x33')][_0xd0e5('0x35')]?_0x493f61['attributes']:_0x469b91[_0xd0e5('0x2e')];if(_0x4926ff[_0xd0e5('0x30')][_0xd0e5('0x42')]){_0x493f61[_0xd0e5('0x43')]=[{'all':!![]}];}_0x493f61=_[_0xd0e5('0x3f')]({},_0x493f61,_0x4926ff[_0xd0e5('0x40')]);return db[_0xd0e5('0x41')][_0xd0e5('0x49')](_0x493f61)['then'](handleEntityNotFound(_0x1a0870,null))[_0xd0e5('0x24')](respondWithResult(_0x1a0870,null))[_0xd0e5('0x46')](handleError(_0x1a0870,null));};exports[_0xd0e5('0x4a')]=function(_0x2a990e,_0x273978){return db[_0xd0e5('0x41')][_0xd0e5('0x4a')](_0x2a990e[_0xd0e5('0x4b')],{})[_0xd0e5('0x24')](respondWithResult(_0x273978,0xc9))[_0xd0e5('0x46')](handleError(_0x273978,null));};exports[_0xd0e5('0x23')]=function(_0x318c93,_0x340c84){if(_0x318c93[_0xd0e5('0x4b')]['id']){delete _0x318c93['body']['id'];}return db[_0xd0e5('0x41')]['find']({'where':{'id':_0x318c93[_0xd0e5('0x4c')]['id']}})[_0xd0e5('0x24')](handleEntityNotFound(_0x340c84,null))[_0xd0e5('0x24')](saveUpdates(_0x318c93[_0xd0e5('0x4b')],null))[_0xd0e5('0x24')](respondWithResult(_0x340c84,null))['catch'](handleError(_0x340c84,null));};exports[_0xd0e5('0x25')]=function(_0xd93ae7,_0x236c8f){return db[_0xd0e5('0x41')][_0xd0e5('0x49')]({'where':{'id':_0xd93ae7[_0xd0e5('0x4c')]['id']}})[_0xd0e5('0x24')](handleEntityNotFound(_0x236c8f,null))[_0xd0e5('0x24')](removeEntity(_0x236c8f,null))[_0xd0e5('0x46')](handleError(_0x236c8f,null));};exports[_0xd0e5('0x4d')]=function(_0x2d70c7,_0x422ac2){return db['MailSubstatus']['describe']()[_0xd0e5('0x24')](respondWithResult(_0x422ac2,null))[_0xd0e5('0x46')](handleError(_0x422ac2,null));}; \ No newline at end of file +var _0xcdca=['map','rawAttributes','fieldName','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','MailSubstatus','find','create','body','describe','eml-format','fast-json-patch','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','update','then','destroy','stack','name'];(function(_0x2f9d9c,_0x42bcc9){var _0x2be03d=function(_0x597ea1){while(--_0x597ea1){_0x2f9d9c['push'](_0x2f9d9c['shift']());}};_0x2be03d(++_0x42bcc9);}(_0xcdca,0x1cc));var _0xacdc=function(_0x20e11b,_0x328bbd){_0x20e11b=_0x20e11b-0x0;var _0x46ead7=_0xcdca[_0x20e11b];return _0x46ead7;};'use strict';var emlformat=require(_0xacdc('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xacdc('0x1'));var rp=require('request-promise');var moment=require(_0xacdc('0x2'));var BPromise=require(_0xacdc('0x3'));var Mustache=require(_0xacdc('0x4'));var util=require(_0xacdc('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xacdc('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xacdc('0x7'));var squel=require(_0xacdc('0x8'));var crypto=require(_0xacdc('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xacdc('0xa'));var toCsv=require(_0xacdc('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xacdc('0xb'));var authService=require(_0xacdc('0xc'));var qs=require(_0xacdc('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xacdc('0xe'));var logger=require(_0xacdc('0xf'))(_0xacdc('0x10'));var utils=require('../../config/utils');var config=require(_0xacdc('0x11'));var licenseUtil=require(_0xacdc('0x12'));var db=require(_0xacdc('0x13'))['db'];function respondWithStatusCode(_0x44d56b,_0x26a380){_0x26a380=_0x26a380||0xcc;return function(_0x419c46){if(_0x419c46){return _0x44d56b[_0xacdc('0x14')](_0x26a380);}return _0x44d56b[_0xacdc('0x15')](_0x26a380)[_0xacdc('0x16')]();};}function respondWithResult(_0x23731c,_0x39407d){_0x39407d=_0x39407d||0xc8;return function(_0x3b2a50){if(_0x3b2a50){return _0x23731c[_0xacdc('0x15')](_0x39407d)['json'](_0x3b2a50);}};}function respondWithFilteredResult(_0x108061,_0x1956b8){return function(_0x1a714f){if(_0x1a714f){var _0x5f0aa5=typeof _0x1956b8[_0xacdc('0x17')]===_0xacdc('0x18')&&typeof _0x1956b8['limit']===_0xacdc('0x18');var _0x25d4ed=_0x1a714f[_0xacdc('0x19')];var _0x1622a3=_0x5f0aa5?0x0:_0x1956b8[_0xacdc('0x17')];var _0x14cce5=_0x5f0aa5?_0x1a714f[_0xacdc('0x19')]:_0x1956b8['offset']+_0x1956b8[_0xacdc('0x1a')];var _0x251a42;if(_0x14cce5>=_0x25d4ed){_0x14cce5=_0x25d4ed;_0x251a42=0xc8;}else{_0x251a42=0xce;}_0x108061[_0xacdc('0x15')](_0x251a42);return _0x108061[_0xacdc('0x1b')](_0xacdc('0x1c'),_0x1622a3+'-'+_0x14cce5+'/'+_0x25d4ed)[_0xacdc('0x1d')](_0x1a714f);}return null;};}function patchUpdates(_0x5b2d92){return function(_0x4fa29a){try{jsonpatch[_0xacdc('0x1e')](_0x4fa29a,_0x5b2d92,!![]);}catch(_0x269551){return BPromise[_0xacdc('0x1f')](_0x269551);}return _0x4fa29a['save']();};}function saveUpdates(_0x39a370,_0x3bae17){return function(_0x2cc2d8){if(_0x2cc2d8){return _0x2cc2d8[_0xacdc('0x20')](_0x39a370)[_0xacdc('0x21')](function(_0x2232d2){return _0x2232d2;});}return null;};}function removeEntity(_0x26f7bf,_0xeef8f9){return function(_0x1f4891){if(_0x1f4891){return _0x1f4891[_0xacdc('0x22')]()[_0xacdc('0x21')](function(){_0x26f7bf[_0xacdc('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dc6cd,_0x1f5013){return function(_0x5d2109){if(!_0x5d2109){_0x2dc6cd[_0xacdc('0x14')](0x194);}return _0x5d2109;};}function handleError(_0x33ac9e,_0x880669){_0x880669=_0x880669||0x1f4;return function(_0xdfea1){logger['error'](_0xdfea1[_0xacdc('0x23')]);if(_0xdfea1[_0xacdc('0x24')]){delete _0xdfea1['name'];}_0x33ac9e[_0xacdc('0x15')](_0x880669)['send'](_0xdfea1);};}exports['index']=function(_0x1a33d8,_0x528b55){var _0x5118cf={},_0x4c471a={},_0x229b3c={'count':0x0,'rows':[]};var _0x4b738d=_[_0xacdc('0x25')](db['MailSubstatus'][_0xacdc('0x26')],function(_0x3b14bc){return{'name':_0x3b14bc[_0xacdc('0x27')],'type':_0x3b14bc['type']['key']};});_0x4c471a[_0xacdc('0x28')]=_[_0xacdc('0x25')](_0x4b738d,_0xacdc('0x24'));_0x4c471a[_0xacdc('0x29')]=_[_0xacdc('0x2a')](_0x1a33d8[_0xacdc('0x29')]);_0x4c471a['filters']=_['intersection'](_0x4c471a['model'],_0x4c471a[_0xacdc('0x29')]);_0x5118cf[_0xacdc('0x2b')]=_[_0xacdc('0x2c')](_0x4c471a[_0xacdc('0x28')],qs[_0xacdc('0x2d')](_0x1a33d8[_0xacdc('0x29')][_0xacdc('0x2d')]));_0x5118cf[_0xacdc('0x2b')]=_0x5118cf['attributes'][_0xacdc('0x2e')]?_0x5118cf[_0xacdc('0x2b')]:_0x4c471a['model'];if(!_0x1a33d8[_0xacdc('0x29')][_0xacdc('0x2f')](_0xacdc('0x30'))){_0x5118cf['limit']=qs[_0xacdc('0x1a')](_0x1a33d8[_0xacdc('0x29')][_0xacdc('0x1a')]);_0x5118cf[_0xacdc('0x17')]=qs[_0xacdc('0x17')](_0x1a33d8[_0xacdc('0x29')]['offset']);}_0x5118cf[_0xacdc('0x31')]=qs['sort'](_0x1a33d8['query'][_0xacdc('0x32')]);_0x5118cf['where']=qs[_0xacdc('0x33')](_[_0xacdc('0x34')](_0x1a33d8[_0xacdc('0x29')],_0x4c471a[_0xacdc('0x33')]),_0x4b738d);if(_0x1a33d8[_0xacdc('0x29')][_0xacdc('0x35')]){_0x5118cf[_0xacdc('0x36')]=_[_0xacdc('0x37')](_0x5118cf[_0xacdc('0x36')],{'$or':_['map'](_0x4b738d,function(_0x1304ef){if(_0x1304ef[_0xacdc('0x38')]!==_0xacdc('0x39')){var _0xbe998a={};_0xbe998a[_0x1304ef[_0xacdc('0x24')]]={'$like':'%'+_0x1a33d8['query']['filter']+'%'};return _0xbe998a;}})});}_0x5118cf=_['merge']({},_0x5118cf,_0x1a33d8[_0xacdc('0x3a')]);var _0x477842={'where':_0x5118cf[_0xacdc('0x36')]};return db['MailSubstatus'][_0xacdc('0x19')](_0x477842)[_0xacdc('0x21')](function(_0x107927){_0x229b3c[_0xacdc('0x19')]=_0x107927;if(_0x1a33d8['query'][_0xacdc('0x3b')]){_0x5118cf[_0xacdc('0x3c')]=[{'all':!![]}];}return db['MailSubstatus'][_0xacdc('0x3d')](_0x5118cf);})[_0xacdc('0x21')](function(_0x23b5f5){_0x229b3c[_0xacdc('0x3e')]=_0x23b5f5;return _0x229b3c;})['then'](respondWithFilteredResult(_0x528b55,_0x5118cf))[_0xacdc('0x3f')](handleError(_0x528b55,null));};exports[_0xacdc('0x40')]=function(_0x46aa9c,_0x10deab){var _0xa3e5ec={'raw':!![],'where':{'id':_0x46aa9c[_0xacdc('0x41')]['id']}},_0xf733b2={};_0xf733b2['model']=_[_0xacdc('0x2a')](db[_0xacdc('0x42')]['rawAttributes']);_0xf733b2[_0xacdc('0x29')]=_['keys'](_0x46aa9c[_0xacdc('0x29')]);_0xf733b2[_0xacdc('0x33')]=_[_0xacdc('0x2c')](_0xf733b2[_0xacdc('0x28')],_0xf733b2[_0xacdc('0x29')]);_0xa3e5ec[_0xacdc('0x2b')]=_['intersection'](_0xf733b2[_0xacdc('0x28')],qs[_0xacdc('0x2d')](_0x46aa9c[_0xacdc('0x29')][_0xacdc('0x2d')]));_0xa3e5ec[_0xacdc('0x2b')]=_0xa3e5ec[_0xacdc('0x2b')]['length']?_0xa3e5ec[_0xacdc('0x2b')]:_0xf733b2['model'];if(_0x46aa9c['query']['includeAll']){_0xa3e5ec[_0xacdc('0x3c')]=[{'all':!![]}];}_0xa3e5ec=_[_0xacdc('0x37')]({},_0xa3e5ec,_0x46aa9c[_0xacdc('0x3a')]);return db[_0xacdc('0x42')][_0xacdc('0x43')](_0xa3e5ec)[_0xacdc('0x21')](handleEntityNotFound(_0x10deab,null))[_0xacdc('0x21')](respondWithResult(_0x10deab,null))[_0xacdc('0x3f')](handleError(_0x10deab,null));};exports['create']=function(_0x2a9c40,_0x31396e){return db[_0xacdc('0x42')][_0xacdc('0x44')](_0x2a9c40[_0xacdc('0x45')],{})[_0xacdc('0x21')](respondWithResult(_0x31396e,0xc9))[_0xacdc('0x3f')](handleError(_0x31396e,null));};exports['update']=function(_0x4f90f1,_0x2503ad){if(_0x4f90f1['body']['id']){delete _0x4f90f1['body']['id'];}return db[_0xacdc('0x42')][_0xacdc('0x43')]({'where':{'id':_0x4f90f1[_0xacdc('0x41')]['id']}})['then'](handleEntityNotFound(_0x2503ad,null))[_0xacdc('0x21')](saveUpdates(_0x4f90f1[_0xacdc('0x45')],null))['then'](respondWithResult(_0x2503ad,null))[_0xacdc('0x3f')](handleError(_0x2503ad,null));};exports[_0xacdc('0x22')]=function(_0x32f6be,_0x44b132){return db[_0xacdc('0x42')][_0xacdc('0x43')]({'where':{'id':_0x32f6be['params']['id']}})[_0xacdc('0x21')](handleEntityNotFound(_0x44b132,null))['then'](removeEntity(_0x44b132,null))[_0xacdc('0x3f')](handleError(_0x44b132,null));};exports[_0xacdc('0x46')]=function(_0x17cc1f,_0x4277b5){return db[_0xacdc('0x42')][_0xacdc('0x46')]()[_0xacdc('0x21')](respondWithResult(_0x4277b5,null))[_0xacdc('0x3f')](handleError(_0x4277b5,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index bede419..8c55561 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 _0x1899=['hook','../../mysqldb','MailSubstatus','update','emit','hasOwnProperty'];(function(_0x14c28a,_0x446b7d){var _0x102c01=function(_0x56c35c){while(--_0x56c35c){_0x14c28a['push'](_0x14c28a['shift']());}};_0x102c01(++_0x446b7d);}(_0x1899,0x15d));var _0x9189=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x1899[_0x2070da];return _0x4f9fe1;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x9189('0x0'))['db'][_0x9189('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x9189('0x2')};function emitEvent(_0x33f777){return function(_0x3825e5,_0x58c684,_0x3b943a){MailSubstatusEvents[_0x9189('0x3')](_0x33f777+':'+_0x3825e5['id'],_0x3825e5);MailSubstatusEvents[_0x9189('0x3')](_0x33f777,_0x3825e5);_0x3b943a(null);};}for(var e in events){if(events[_0x9189('0x4')](e)){var event=events[e];MailSubstatus[_0x9189('0x5')](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0xf617=['hook','exports','../../mysqldb','MailSubstatus','emit','hasOwnProperty'];(function(_0x6d76e8,_0x3a5b96){var _0x10a933=function(_0xcca43b){while(--_0xcca43b){_0x6d76e8['push'](_0x6d76e8['shift']());}};_0x10a933(++_0x3a5b96);}(_0xf617,0xf8));var _0x7f61=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf617[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailSubstatus=require(_0x7f61('0x0'))['db'][_0x7f61('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x471a94){return function(_0x560d7f,_0x292eca,_0x20f1ba){MailSubstatusEvents[_0x7f61('0x2')](_0x471a94+':'+_0x560d7f['id'],_0x560d7f);MailSubstatusEvents[_0x7f61('0x2')](_0x471a94,_0x560d7f);_0x20f1ba(null);};}for(var e in events){if(events[_0x7f61('0x3')](e)){var event=events[e];MailSubstatus[_0x7f61('0x4')](e,emitEvent(event));}}module[_0x7f61('0x5')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 7d893fa..2c05bd1 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 _0xb353=['models','define','update','name','_previousDataValues','then','catch','./mailSubstatus.attributes','exports'];(function(_0x172aed,_0x511c98){var _0x1d7b6f=function(_0x2a0316){while(--_0x2a0316){_0x172aed['push'](_0x172aed['shift']());}};_0x1d7b6f(++_0x511c98);}(_0xb353,0xc4));var _0x3b35=function(_0x11afa8,_0x2fe7ab){_0x11afa8=_0x11afa8-0x0;var _0x26e259=_0xb353[_0x11afa8];return _0x26e259;};'use strict';var attributes=require(_0x3b35('0x0'));module[_0x3b35('0x1')]=function(_0x448eb5){var _0x4bac22=_0x448eb5[_0x3b35('0x2')];return _0x448eb5[_0x3b35('0x3')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x146827,_0x3ea235,_0x40d775){return _0x4bac22['Condition'][_0x3b35('0x4')]({'value':_0x146827[_0x3b35('0x5')]},{'where':{'field':'mailSubstatus','value':_0x146827[_0x3b35('0x6')][_0x3b35('0x5')]}})[_0x3b35('0x7')](function(){_0x40d775();})[_0x3b35('0x8')](function(_0x45c3d8){_0x40d775(_0x45c3d8);});}}});}; \ No newline at end of file +var _0xa5c5=['Condition','update','name','_previousDataValues','then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses'];(function(_0x28f299,_0xbfcfd7){var _0x33ca7e=function(_0x3c0be7){while(--_0x3c0be7){_0x28f299['push'](_0x28f299['shift']());}};_0x33ca7e(++_0xbfcfd7);}(_0xa5c5,0xba));var _0x5a5c=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xa5c5[_0x432682];return _0x463d05;};'use strict';var attributes=require(_0x5a5c('0x0'));module[_0x5a5c('0x1')]=function(_0x374a75){var _0x5bc368=_0x374a75[_0x5a5c('0x2')];return _0x374a75[_0x5a5c('0x3')](_0x5a5c('0x4'),attributes,{'tableName':_0x5a5c('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0xdfd17d,_0x54e820,_0x3986ff){return _0x5bc368[_0x5a5c('0x6')][_0x5a5c('0x7')]({'value':_0xdfd17d[_0x5a5c('0x8')]},{'where':{'field':'mailSubstatus','value':_0xdfd17d[_0x5a5c('0x9')][_0x5a5c('0x8')]}})[_0x5a5c('0xa')](function(){_0x3986ff();})[_0x5a5c('0xb')](function(_0x5b061b){_0x3986ff(_0x5b061b);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 77f8492..965f757 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 _0x7821=['bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','moment'];(function(_0x55daf2,_0x1b48de){var _0x1c8500=function(_0x4686b5){while(--_0x4686b5){_0x55daf2['push'](_0x55daf2['shift']());}};_0x1c8500(++_0x1b48de);}(_0x7821,0xba));var _0x1782=function(_0x2f54b6,_0x3cc6cb){_0x2f54b6=_0x2f54b6-0x0;var _0x169f21=_0x7821[_0x2f54b6];return _0x169f21;};'use strict';var _=require(_0x1782('0x0'));var util=require(_0x1782('0x1'));var moment=require(_0x1782('0x2'));var BPromise=require(_0x1782('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1782('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1782('0x5'));var logger=require(_0x1782('0x6'))(_0x1782('0x7'));var config=require(_0x1782('0x8'));var jayson=require(_0x1782('0x9'));var client=jayson[_0x1782('0xa')][_0x1782('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x454275,_0x27ba1e,_0x58f404){return new BPromise(function(_0x17bacf,_0x2ffce3){return client['request'](_0x454275,_0x58f404)['then'](function(_0x1b9f0b){logger[_0x1782('0xc')](_0x1782('0xd'),_0x27ba1e,_0x1782('0xe'));logger[_0x1782('0xf')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x27ba1e,_0x1782('0xe'),JSON[_0x1782('0x10')](_0x1b9f0b));if(_0x1b9f0b[_0x1782('0x11')]){if(_0x1b9f0b['error']['code']===0x1f4){logger[_0x1782('0x11')](_0x1782('0xd'),_0x27ba1e,_0x1b9f0b['error'][_0x1782('0x12')]);return _0x2ffce3(_0x1b9f0b[_0x1782('0x11')][_0x1782('0x12')]);}logger[_0x1782('0x11')](_0x1782('0xd'),_0x27ba1e,_0x1b9f0b[_0x1782('0x11')][_0x1782('0x12')]);return _0x17bacf(_0x1b9f0b[_0x1782('0x11')][_0x1782('0x12')]);}else{logger['info'](_0x1782('0xd'),_0x27ba1e,_0x1782('0xe'));_0x17bacf(_0x1b9f0b[_0x1782('0x13')][_0x1782('0x12')]);}})[_0x1782('0x14')](function(_0x5b5ffa){logger['error'](_0x1782('0xd'),_0x27ba1e,_0x5b5ffa);_0x2ffce3(_0x5b5ffa);});});} \ No newline at end of file +var _0x896d=['message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x18a772,_0x1a4d3f){var _0xbaac04=function(_0x467aa6){while(--_0x467aa6){_0x18a772['push'](_0x18a772['shift']());}};_0xbaac04(++_0x1a4d3f);}(_0x896d,0xfe));var _0xd896=function(_0x34b01e,_0x24b49f){_0x34b01e=_0x34b01e-0x0;var _0x5d596c=_0x896d[_0x34b01e];return _0x5d596c;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd896('0x0'));var rs=require(_0xd896('0x1'));var fs=require('fs');var Redis=require(_0xd896('0x2'));var db=require(_0xd896('0x3'))['db'];var utils=require(_0xd896('0x4'));var logger=require(_0xd896('0x5'))('rpc');var config=require(_0xd896('0x6'));var jayson=require(_0xd896('0x7'));var client=jayson[_0xd896('0x8')][_0xd896('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49dbdf,_0x1d7510,_0x3555b4){return new BPromise(function(_0x36741a,_0xcae1bc){return client[_0xd896('0xa')](_0x49dbdf,_0x3555b4)[_0xd896('0xb')](function(_0x40729b){logger[_0xd896('0xc')](_0xd896('0xd'),_0x1d7510,_0xd896('0xe'));logger[_0xd896('0xf')](_0xd896('0x10'),_0x1d7510,_0xd896('0xe'),JSON[_0xd896('0x11')](_0x40729b));if(_0x40729b['error']){if(_0x40729b[_0xd896('0x12')]['code']===0x1f4){logger[_0xd896('0x12')](_0xd896('0xd'),_0x1d7510,_0x40729b[_0xd896('0x12')][_0xd896('0x13')]);return _0xcae1bc(_0x40729b[_0xd896('0x12')][_0xd896('0x13')]);}logger[_0xd896('0x12')](_0xd896('0xd'),_0x1d7510,_0x40729b[_0xd896('0x12')][_0xd896('0x13')]);return _0x36741a(_0x40729b[_0xd896('0x12')]['message']);}else{logger[_0xd896('0xc')](_0xd896('0xd'),_0x1d7510,_0xd896('0xe'));_0x36741a(_0x40729b['result']['message']);}})[_0xd896('0x14')](function(_0x24e7a5){logger[_0xd896('0x12')](_0xd896('0xd'),_0x1d7510,_0x24e7a5);_0xcae1bc(_0x24e7a5);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index e77f9b9..f8d18f7 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 _0xa852=['../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x1624f5,_0xa2f147){var _0x23b431=function(_0x5393d4){while(--_0x5393d4){_0x1624f5['push'](_0x1624f5['shift']());}};_0x23b431(++_0xa2f147);}(_0xa852,0xd1));var _0x2a85=function(_0x18ada7,_0x5d5c2b){_0x18ada7=_0x18ada7-0x0;var _0x514111=_0xa852[_0x18ada7];return _0x514111;};'use strict';var multer=require(_0x2a85('0x0'));var util=require(_0x2a85('0x1'));var path=require(_0x2a85('0x2'));var timeout=require(_0x2a85('0x3'));var express=require(_0x2a85('0x4'));var router=express[_0x2a85('0x5')]();var fs_extra=require(_0x2a85('0x6'));var auth=require(_0x2a85('0x7'));var interaction=require(_0x2a85('0x8'));var config=require(_0x2a85('0x9'));var controller=require(_0x2a85('0xa'));router[_0x2a85('0xb')]('/',auth[_0x2a85('0xc')](),controller[_0x2a85('0xd')]);router[_0x2a85('0xb')](_0x2a85('0xe'),auth[_0x2a85('0xc')](),controller[_0x2a85('0xf')]);router[_0x2a85('0xb')](_0x2a85('0x10'),auth[_0x2a85('0xc')](),controller['show']);router[_0x2a85('0x11')]('/',auth[_0x2a85('0xc')](),controller[_0x2a85('0x12')]);router[_0x2a85('0x13')](_0x2a85('0x10'),auth['isAuthenticated'](),controller[_0x2a85('0x14')]);router[_0x2a85('0x15')]('/:id',auth[_0x2a85('0xc')](),controller[_0x2a85('0x16')]);module[_0x2a85('0x17')]=router; \ No newline at end of file +var _0xed3f=['delete','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','isAuthenticated','index','get','/:id','post','create','put','update'];(function(_0x59bd3b,_0x53eff9){var _0x586c53=function(_0xee0b0b){while(--_0xee0b0b){_0x59bd3b['push'](_0x59bd3b['shift']());}};_0x586c53(++_0x53eff9);}(_0xed3f,0x122));var _0xfed3=function(_0x16aaef,_0x410651){_0x16aaef=_0x16aaef-0x0;var _0x1c82ef=_0xed3f[_0x16aaef];return _0x1c82ef;};'use strict';var multer=require(_0xfed3('0x0'));var util=require(_0xfed3('0x1'));var path=require(_0xfed3('0x2'));var timeout=require('connect-timeout');var express=require(_0xfed3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xfed3('0x4'));var interaction=require(_0xfed3('0x5'));var config=require(_0xfed3('0x6'));var controller=require(_0xfed3('0x7'));router['get']('/',auth[_0xfed3('0x8')](),controller[_0xfed3('0x9')]);router[_0xfed3('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0xfed3('0xa')](_0xfed3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xfed3('0xc')]('/',auth['isAuthenticated'](),controller[_0xfed3('0xd')]);router[_0xfed3('0xe')](_0xfed3('0xb'),auth['isAuthenticated'](),controller[_0xfed3('0xf')]);router[_0xfed3('0x10')]('/:id',auth[_0xfed3('0x8')](),controller['destroy']);module[_0xfed3('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index a355a7c..cc20e5c 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 _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x3043f1,_0x1f7bec){var _0x116acc=function(_0x3e8815){while(--_0x3e8815){_0x3043f1['push'](_0x3043f1['shift']());}};_0x116acc(++_0x1f7bec);}(_0xaa88,0x137));var _0x8aa8=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xaa88[_0x50aa2e];return _0x5e07f0;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file +var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x4dd1b3,_0x4ec057){var _0x3495af=function(_0x1db9da){while(--_0x1db9da){_0x4dd1b3['push'](_0x4dd1b3['shift']());}};_0x3495af(++_0x4ec057);}(_0x4b84,0x1cc));var _0x44b8=function(_0x378b4,_0x5ca7fa){_0x378b4=_0x378b4-0x0;var _0x11d07b=_0x4b84[_0x378b4];return _0x11d07b;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 578bf48..631203f 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 _0xce25=['fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','show','params','rawAttributes','includeAll','catch','create','body','destroy','describe','rimraf','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','MailTransferReport','type','model','query','keys','filters','intersection','attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xce25,0x17a));var _0x5ce2=function(_0x1027c4,_0x1c6b10){_0x1027c4=_0x1027c4-0x0;var _0x8f2c8f=_0xce25[_0x1027c4];return _0x8f2c8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ce2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ce2('0x1'));var BPromise=require(_0x5ce2('0x2'));var Mustache=require(_0x5ce2('0x3'));var util=require('util');var path=require('path');var sox=require(_0x5ce2('0x4'));var csv=require(_0x5ce2('0x5'));var ejs=require(_0x5ce2('0x6'));var fs=require('fs');var fs_extra=require(_0x5ce2('0x7'));var _=require(_0x5ce2('0x8'));var squel=require(_0x5ce2('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5ce2('0xa'));var toCsv=require(_0x5ce2('0x5'));var querystring=require(_0x5ce2('0xb'));var Papa=require(_0x5ce2('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ce2('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5ce2('0xe'));var logger=require('../../config/logger')(_0x5ce2('0xf'));var utils=require(_0x5ce2('0x10'));var config=require(_0x5ce2('0x11'));var licenseUtil=require(_0x5ce2('0x12'));var db=require(_0x5ce2('0x13'))['db'];function respondWithStatusCode(_0x12ab93,_0x37ca07){_0x37ca07=_0x37ca07||0xcc;return function(_0x8fe3c3){if(_0x8fe3c3){return _0x12ab93[_0x5ce2('0x14')](_0x37ca07);}return _0x12ab93[_0x5ce2('0x15')](_0x37ca07)[_0x5ce2('0x16')]();};}function respondWithResult(_0x46d0f9,_0x20e462){_0x20e462=_0x20e462||0xc8;return function(_0x244c5a){if(_0x244c5a){return _0x46d0f9[_0x5ce2('0x15')](_0x20e462)[_0x5ce2('0x17')](_0x244c5a);}};}function respondWithFilteredResult(_0x5bf45c,_0x36f5fc){return function(_0x44273e){if(_0x44273e){var _0x21a0a0=typeof _0x36f5fc[_0x5ce2('0x18')]===_0x5ce2('0x19')&&typeof _0x36f5fc[_0x5ce2('0x1a')]===_0x5ce2('0x19');var _0x4ebf88=_0x44273e[_0x5ce2('0x1b')];var _0x5a1234=_0x21a0a0?0x0:_0x36f5fc['offset'];var _0x2567a9=_0x21a0a0?_0x44273e[_0x5ce2('0x1b')]:_0x36f5fc[_0x5ce2('0x18')]+_0x36f5fc['limit'];var _0x5957d9;if(_0x2567a9>=_0x4ebf88){_0x2567a9=_0x4ebf88;_0x5957d9=0xc8;}else{_0x5957d9=0xce;}_0x5bf45c[_0x5ce2('0x15')](_0x5957d9);return _0x5bf45c[_0x5ce2('0x1c')](_0x5ce2('0x1d'),_0x5a1234+'-'+_0x2567a9+'/'+_0x4ebf88)['json'](_0x44273e);}return null;};}function patchUpdates(_0x5d3c4c){return function(_0x7ae4ea){try{jsonpatch[_0x5ce2('0x1e')](_0x7ae4ea,_0x5d3c4c,!![]);}catch(_0x4d3a59){return BPromise[_0x5ce2('0x1f')](_0x4d3a59);}return _0x7ae4ea[_0x5ce2('0x20')]();};}function saveUpdates(_0x2d7bda,_0x572b3a){return function(_0x4f001d){if(_0x4f001d){return _0x4f001d[_0x5ce2('0x21')](_0x2d7bda)[_0x5ce2('0x22')](function(_0x26231f){return _0x26231f;});}return null;};}function removeEntity(_0xa39e2,_0x1ccea1){return function(_0x1366d3){if(_0x1366d3){return _0x1366d3['destroy']()[_0x5ce2('0x22')](function(){_0xa39e2['status'](0xcc)[_0x5ce2('0x16')]();});}};}function handleEntityNotFound(_0x11257b,_0x5835bf){return function(_0x2b4b40){if(!_0x2b4b40){_0x11257b[_0x5ce2('0x14')](0x194);}return _0x2b4b40;};}function handleError(_0x253d42,_0x27fbaa){_0x27fbaa=_0x27fbaa||0x1f4;return function(_0x35ea28){logger['error'](_0x35ea28[_0x5ce2('0x23')]);if(_0x35ea28[_0x5ce2('0x24')]){delete _0x35ea28['name'];}_0x253d42[_0x5ce2('0x15')](_0x27fbaa)[_0x5ce2('0x25')](_0x35ea28);};}exports[_0x5ce2('0x26')]=function(_0xe09c74,_0x4676ce){var _0x5ccce6={},_0x5e2936={},_0x108489={'count':0x0,'rows':[]};var _0x23a72d=_[_0x5ce2('0x27')](db[_0x5ce2('0x28')]['rawAttributes'],function(_0x3c8a3b){return{'name':_0x3c8a3b['fieldName'],'type':_0x3c8a3b[_0x5ce2('0x29')]['key']};});_0x5e2936[_0x5ce2('0x2a')]=_[_0x5ce2('0x27')](_0x23a72d,'name');_0x5e2936[_0x5ce2('0x2b')]=_[_0x5ce2('0x2c')](_0xe09c74['query']);_0x5e2936[_0x5ce2('0x2d')]=_[_0x5ce2('0x2e')](_0x5e2936[_0x5ce2('0x2a')],_0x5e2936[_0x5ce2('0x2b')]);_0x5ccce6[_0x5ce2('0x2f')]=_[_0x5ce2('0x2e')](_0x5e2936[_0x5ce2('0x2a')],qs['fields'](_0xe09c74[_0x5ce2('0x2b')][_0x5ce2('0x30')]));_0x5ccce6[_0x5ce2('0x2f')]=_0x5ccce6['attributes'][_0x5ce2('0x31')]?_0x5ccce6[_0x5ce2('0x2f')]:_0x5e2936[_0x5ce2('0x2a')];if(!_0xe09c74['query'][_0x5ce2('0x32')](_0x5ce2('0x33'))){_0x5ccce6['limit']=qs[_0x5ce2('0x1a')](_0xe09c74[_0x5ce2('0x2b')][_0x5ce2('0x1a')]);_0x5ccce6[_0x5ce2('0x18')]=qs[_0x5ce2('0x18')](_0xe09c74[_0x5ce2('0x2b')][_0x5ce2('0x18')]);}_0x5ccce6[_0x5ce2('0x34')]=qs[_0x5ce2('0x35')](_0xe09c74[_0x5ce2('0x2b')][_0x5ce2('0x35')]);_0x5ccce6['where']=qs[_0x5ce2('0x2d')](_[_0x5ce2('0x36')](_0xe09c74[_0x5ce2('0x2b')],_0x5e2936[_0x5ce2('0x2d')]),_0x23a72d);if(_0xe09c74[_0x5ce2('0x2b')][_0x5ce2('0x37')]){_0x5ccce6['where']=_[_0x5ce2('0x38')](_0x5ccce6[_0x5ce2('0x39')],{'$or':_[_0x5ce2('0x27')](_0x23a72d,function(_0x2fdd3d){if(_0x2fdd3d[_0x5ce2('0x29')]!==_0x5ce2('0x3a')){var _0x2cce97={};_0x2cce97[_0x2fdd3d[_0x5ce2('0x24')]]={'$like':'%'+_0xe09c74[_0x5ce2('0x2b')][_0x5ce2('0x37')]+'%'};return _0x2cce97;}})});}_0x5ccce6=_[_0x5ce2('0x38')]({},_0x5ccce6,_0xe09c74[_0x5ce2('0x3b')]);var _0xa30082={'where':_0x5ccce6[_0x5ce2('0x39')]};return db[_0x5ce2('0x28')][_0x5ce2('0x1b')](_0xa30082)['then'](function(_0x5eb898){_0x108489[_0x5ce2('0x1b')]=_0x5eb898;if(_0xe09c74[_0x5ce2('0x2b')]['includeAll']){_0x5ccce6[_0x5ce2('0x3c')]=[{'all':!![]}];}return db[_0x5ce2('0x28')][_0x5ce2('0x3d')](_0x5ccce6);})[_0x5ce2('0x22')](function(_0x16f5fe){_0x108489['rows']=_0x16f5fe;return _0x108489;})[_0x5ce2('0x22')](respondWithFilteredResult(_0x4676ce,_0x5ccce6))['catch'](handleError(_0x4676ce,null));};exports[_0x5ce2('0x3e')]=function(_0x41f945,_0x43e4cd){var _0xec46d3={'raw':!![],'where':{'id':_0x41f945[_0x5ce2('0x3f')]['id']}},_0x1324bb={};_0x1324bb['model']=_['keys'](db[_0x5ce2('0x28')][_0x5ce2('0x40')]);_0x1324bb[_0x5ce2('0x2b')]=_[_0x5ce2('0x2c')](_0x41f945[_0x5ce2('0x2b')]);_0x1324bb[_0x5ce2('0x2d')]=_['intersection'](_0x1324bb[_0x5ce2('0x2a')],_0x1324bb[_0x5ce2('0x2b')]);_0xec46d3[_0x5ce2('0x2f')]=_[_0x5ce2('0x2e')](_0x1324bb[_0x5ce2('0x2a')],qs[_0x5ce2('0x30')](_0x41f945['query'][_0x5ce2('0x30')]));_0xec46d3[_0x5ce2('0x2f')]=_0xec46d3[_0x5ce2('0x2f')]['length']?_0xec46d3['attributes']:_0x1324bb['model'];if(_0x41f945['query'][_0x5ce2('0x41')]){_0xec46d3[_0x5ce2('0x3c')]=[{'all':!![]}];}_0xec46d3=_[_0x5ce2('0x38')]({},_0xec46d3,_0x41f945[_0x5ce2('0x3b')]);return db[_0x5ce2('0x28')]['find'](_0xec46d3)[_0x5ce2('0x22')](handleEntityNotFound(_0x43e4cd,null))[_0x5ce2('0x22')](respondWithResult(_0x43e4cd,null))[_0x5ce2('0x42')](handleError(_0x43e4cd,null));};exports[_0x5ce2('0x43')]=function(_0x49fe94,_0x3975bf){return db['MailTransferReport'][_0x5ce2('0x43')](_0x49fe94[_0x5ce2('0x44')],{})['then'](respondWithResult(_0x3975bf,0xc9))[_0x5ce2('0x42')](handleError(_0x3975bf,null));};exports['update']=function(_0x1a5fdc,_0x1fd7a1){if(_0x1a5fdc[_0x5ce2('0x44')]['id']){delete _0x1a5fdc['body']['id'];}return db['MailTransferReport']['find']({'where':{'id':_0x1a5fdc[_0x5ce2('0x3f')]['id']}})[_0x5ce2('0x22')](handleEntityNotFound(_0x1fd7a1,null))[_0x5ce2('0x22')](saveUpdates(_0x1a5fdc[_0x5ce2('0x44')],null))[_0x5ce2('0x22')](respondWithResult(_0x1fd7a1,null))[_0x5ce2('0x42')](handleError(_0x1fd7a1,null));};exports[_0x5ce2('0x45')]=function(_0x16cb40,_0x5df657){return db[_0x5ce2('0x28')]['find']({'where':{'id':_0x16cb40[_0x5ce2('0x3f')]['id']}})[_0x5ce2('0x22')](handleEntityNotFound(_0x5df657,null))[_0x5ce2('0x22')](removeEntity(_0x5df657,null))[_0x5ce2('0x42')](handleError(_0x5df657,null));};exports[_0x5ce2('0x46')]=function(_0x3c1a70,_0x584ab4){return db[_0x5ce2('0x28')][_0x5ce2('0x46')]()[_0x5ce2('0x22')](respondWithResult(_0x584ab4,null))[_0x5ce2('0x42')](handleError(_0x584ab4,null));}; \ No newline at end of file +var _0x1f1e=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','error','name','send','index','MailTransferReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','catch','show','keys','length','create','body','find','params','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x1ed8cb,_0x2f0e7b){var _0x2dbcf5=function(_0x1e194c){while(--_0x1e194c){_0x1ed8cb['push'](_0x1ed8cb['shift']());}};_0x2dbcf5(++_0x2f0e7b);}(_0x1f1e,0x11a));var _0xe1f1=function(_0x28ab92,_0x51f71c){_0x28ab92=_0x28ab92-0x0;var _0x5171f6=_0x1f1e[_0x28ab92];return _0x5171f6;};'use strict';var emlformat=require(_0xe1f1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe1f1('0x1'));var rp=require(_0xe1f1('0x2'));var moment=require(_0xe1f1('0x3'));var BPromise=require(_0xe1f1('0x4'));var Mustache=require(_0xe1f1('0x5'));var util=require(_0xe1f1('0x6'));var path=require(_0xe1f1('0x7'));var sox=require(_0xe1f1('0x8'));var csv=require(_0xe1f1('0x9'));var ejs=require(_0xe1f1('0xa'));var fs=require('fs');var fs_extra=require(_0xe1f1('0xb'));var _=require(_0xe1f1('0xc'));var squel=require(_0xe1f1('0xd'));var crypto=require('crypto');var jsforce=require(_0xe1f1('0xe'));var deskjs=require(_0xe1f1('0xf'));var toCsv=require(_0xe1f1('0x9'));var querystring=require(_0xe1f1('0x10'));var Papa=require('papaparse');var Redis=require(_0xe1f1('0x11'));var authService=require(_0xe1f1('0x12'));var qs=require(_0xe1f1('0x13'));var as=require(_0xe1f1('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe1f1('0x15'))(_0xe1f1('0x16'));var utils=require('../../config/utils');var config=require(_0xe1f1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe1f1('0x18'))['db'];function respondWithStatusCode(_0x45d886,_0x4699aa){_0x4699aa=_0x4699aa||0xcc;return function(_0x2b0d43){if(_0x2b0d43){return _0x45d886['sendStatus'](_0x4699aa);}return _0x45d886['status'](_0x4699aa)[_0xe1f1('0x19')]();};}function respondWithResult(_0x3c4cce,_0x572177){_0x572177=_0x572177||0xc8;return function(_0x26f56f){if(_0x26f56f){return _0x3c4cce[_0xe1f1('0x1a')](_0x572177)[_0xe1f1('0x1b')](_0x26f56f);}};}function respondWithFilteredResult(_0x4a6879,_0x1de93a){return function(_0xd1b753){if(_0xd1b753){var _0x4215a0=typeof _0x1de93a['offset']===_0xe1f1('0x1c')&&typeof _0x1de93a[_0xe1f1('0x1d')]==='undefined';var _0x356b7f=_0xd1b753[_0xe1f1('0x1e')];var _0x3f14f1=_0x4215a0?0x0:_0x1de93a[_0xe1f1('0x1f')];var _0x3d05dc=_0x4215a0?_0xd1b753[_0xe1f1('0x1e')]:_0x1de93a[_0xe1f1('0x1f')]+_0x1de93a['limit'];var _0x2de768;if(_0x3d05dc>=_0x356b7f){_0x3d05dc=_0x356b7f;_0x2de768=0xc8;}else{_0x2de768=0xce;}_0x4a6879['status'](_0x2de768);return _0x4a6879['set'](_0xe1f1('0x20'),_0x3f14f1+'-'+_0x3d05dc+'/'+_0x356b7f)[_0xe1f1('0x1b')](_0xd1b753);}return null;};}function patchUpdates(_0x533744){return function(_0x5e25e6){try{jsonpatch[_0xe1f1('0x21')](_0x5e25e6,_0x533744,!![]);}catch(_0x1fdec7){return BPromise[_0xe1f1('0x22')](_0x1fdec7);}return _0x5e25e6['save']();};}function saveUpdates(_0xe8c798,_0x589424){return function(_0xc9787d){if(_0xc9787d){return _0xc9787d[_0xe1f1('0x23')](_0xe8c798)[_0xe1f1('0x24')](function(_0x1471b0){return _0x1471b0;});}return null;};}function removeEntity(_0xc05a7e,_0x407e05){return function(_0x594635){if(_0x594635){return _0x594635[_0xe1f1('0x25')]()[_0xe1f1('0x24')](function(){_0xc05a7e[_0xe1f1('0x1a')](0xcc)[_0xe1f1('0x19')]();});}};}function handleEntityNotFound(_0x24b68f,_0x33a2b7){return function(_0x43875f){if(!_0x43875f){_0x24b68f['sendStatus'](0x194);}return _0x43875f;};}function handleError(_0x4477a9,_0x287861){_0x287861=_0x287861||0x1f4;return function(_0x3db23b){logger[_0xe1f1('0x26')](_0x3db23b['stack']);if(_0x3db23b[_0xe1f1('0x27')]){delete _0x3db23b[_0xe1f1('0x27')];}_0x4477a9[_0xe1f1('0x1a')](_0x287861)[_0xe1f1('0x28')](_0x3db23b);};}exports[_0xe1f1('0x29')]=function(_0x2c8ade,_0x90268b){var _0x128b30={},_0x179e12={},_0xd74956={'count':0x0,'rows':[]};var _0x73565c=_['map'](db[_0xe1f1('0x2a')][_0xe1f1('0x2b')],function(_0x4541ed){return{'name':_0x4541ed[_0xe1f1('0x2c')],'type':_0x4541ed[_0xe1f1('0x2d')][_0xe1f1('0x2e')]};});_0x179e12[_0xe1f1('0x2f')]=_[_0xe1f1('0x30')](_0x73565c,_0xe1f1('0x27'));_0x179e12[_0xe1f1('0x31')]=_['keys'](_0x2c8ade[_0xe1f1('0x31')]);_0x179e12[_0xe1f1('0x32')]=_[_0xe1f1('0x33')](_0x179e12[_0xe1f1('0x2f')],_0x179e12[_0xe1f1('0x31')]);_0x128b30[_0xe1f1('0x34')]=_[_0xe1f1('0x33')](_0x179e12[_0xe1f1('0x2f')],qs['fields'](_0x2c8ade[_0xe1f1('0x31')][_0xe1f1('0x35')]));_0x128b30['attributes']=_0x128b30[_0xe1f1('0x34')]['length']?_0x128b30[_0xe1f1('0x34')]:_0x179e12[_0xe1f1('0x2f')];if(!_0x2c8ade[_0xe1f1('0x31')][_0xe1f1('0x36')](_0xe1f1('0x37'))){_0x128b30[_0xe1f1('0x1d')]=qs['limit'](_0x2c8ade[_0xe1f1('0x31')][_0xe1f1('0x1d')]);_0x128b30['offset']=qs['offset'](_0x2c8ade[_0xe1f1('0x31')]['offset']);}_0x128b30[_0xe1f1('0x38')]=qs['sort'](_0x2c8ade[_0xe1f1('0x31')][_0xe1f1('0x39')]);_0x128b30[_0xe1f1('0x3a')]=qs[_0xe1f1('0x32')](_['pick'](_0x2c8ade[_0xe1f1('0x31')],_0x179e12[_0xe1f1('0x32')]),_0x73565c);if(_0x2c8ade['query']['filter']){_0x128b30[_0xe1f1('0x3a')]=_[_0xe1f1('0x3b')](_0x128b30[_0xe1f1('0x3a')],{'$or':_[_0xe1f1('0x30')](_0x73565c,function(_0x120610){if(_0x120610[_0xe1f1('0x2d')]!==_0xe1f1('0x3c')){var _0x339386={};_0x339386[_0x120610[_0xe1f1('0x27')]]={'$like':'%'+_0x2c8ade[_0xe1f1('0x31')][_0xe1f1('0x3d')]+'%'};return _0x339386;}})});}_0x128b30=_[_0xe1f1('0x3b')]({},_0x128b30,_0x2c8ade[_0xe1f1('0x3e')]);var _0x3d2958={'where':_0x128b30[_0xe1f1('0x3a')]};return db[_0xe1f1('0x2a')][_0xe1f1('0x1e')](_0x3d2958)[_0xe1f1('0x24')](function(_0x4b9371){_0xd74956[_0xe1f1('0x1e')]=_0x4b9371;if(_0x2c8ade[_0xe1f1('0x31')][_0xe1f1('0x3f')]){_0x128b30[_0xe1f1('0x40')]=[{'all':!![]}];}return db[_0xe1f1('0x2a')]['findAll'](_0x128b30);})['then'](function(_0x5b46d4){_0xd74956['rows']=_0x5b46d4;return _0xd74956;})['then'](respondWithFilteredResult(_0x90268b,_0x128b30))[_0xe1f1('0x41')](handleError(_0x90268b,null));};exports[_0xe1f1('0x42')]=function(_0x4b59cb,_0x5ed202){var _0x2e1b86={'raw':!![],'where':{'id':_0x4b59cb['params']['id']}},_0x1e3939={};_0x1e3939['model']=_[_0xe1f1('0x43')](db['MailTransferReport'][_0xe1f1('0x2b')]);_0x1e3939[_0xe1f1('0x31')]=_['keys'](_0x4b59cb[_0xe1f1('0x31')]);_0x1e3939['filters']=_[_0xe1f1('0x33')](_0x1e3939[_0xe1f1('0x2f')],_0x1e3939[_0xe1f1('0x31')]);_0x2e1b86['attributes']=_[_0xe1f1('0x33')](_0x1e3939['model'],qs[_0xe1f1('0x35')](_0x4b59cb['query'][_0xe1f1('0x35')]));_0x2e1b86[_0xe1f1('0x34')]=_0x2e1b86[_0xe1f1('0x34')][_0xe1f1('0x44')]?_0x2e1b86['attributes']:_0x1e3939[_0xe1f1('0x2f')];if(_0x4b59cb['query'][_0xe1f1('0x3f')]){_0x2e1b86[_0xe1f1('0x40')]=[{'all':!![]}];}_0x2e1b86=_[_0xe1f1('0x3b')]({},_0x2e1b86,_0x4b59cb[_0xe1f1('0x3e')]);return db['MailTransferReport']['find'](_0x2e1b86)['then'](handleEntityNotFound(_0x5ed202,null))['then'](respondWithResult(_0x5ed202,null))[_0xe1f1('0x41')](handleError(_0x5ed202,null));};exports[_0xe1f1('0x45')]=function(_0x2d0601,_0x7de102){return db[_0xe1f1('0x2a')]['create'](_0x2d0601['body'],{})[_0xe1f1('0x24')](respondWithResult(_0x7de102,0xc9))[_0xe1f1('0x41')](handleError(_0x7de102,null));};exports['update']=function(_0x17f2b0,_0x2d6a4d){if(_0x17f2b0[_0xe1f1('0x46')]['id']){delete _0x17f2b0[_0xe1f1('0x46')]['id'];}return db['MailTransferReport'][_0xe1f1('0x47')]({'where':{'id':_0x17f2b0[_0xe1f1('0x48')]['id']}})[_0xe1f1('0x24')](handleEntityNotFound(_0x2d6a4d,null))[_0xe1f1('0x24')](saveUpdates(_0x17f2b0[_0xe1f1('0x46')],null))[_0xe1f1('0x24')](respondWithResult(_0x2d6a4d,null))[_0xe1f1('0x41')](handleError(_0x2d6a4d,null));};exports[_0xe1f1('0x25')]=function(_0x47d2f6,_0x15b493){return db[_0xe1f1('0x2a')][_0xe1f1('0x47')]({'where':{'id':_0x47d2f6[_0xe1f1('0x48')]['id']}})[_0xe1f1('0x24')](handleEntityNotFound(_0x15b493,null))[_0xe1f1('0x24')](removeEntity(_0x15b493,null))['catch'](handleError(_0x15b493,null));};exports[_0xe1f1('0x49')]=function(_0x5d927f,_0x3eacf9){return db['MailTransferReport'][_0xe1f1('0x49')]()[_0xe1f1('0x24')](respondWithResult(_0x3eacf9,null))[_0xe1f1('0x41')](handleError(_0x3eacf9,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 5b4fc54..5078281 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 _0x394e=['bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment'];(function(_0x3a72e4,_0x556adf){var _0xbf6a40=function(_0x1241b2){while(--_0x1241b2){_0x3a72e4['push'](_0x3a72e4['shift']());}};_0xbf6a40(++_0x556adf);}(_0x394e,0x88));var _0xe394=function(_0x5189d6,_0x557268){_0x5189d6=_0x5189d6-0x0;var _0xb04855=_0x394e[_0x5189d6];return _0xb04855;};'use strict';var _=require(_0xe394('0x0'));var util=require(_0xe394('0x1'));var logger=require('../../config/logger')(_0xe394('0x2'));var moment=require(_0xe394('0x3'));var BPromise=require(_0xe394('0x4'));var rp=require(_0xe394('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe394('0x6'));var config=require(_0xe394('0x7'));var attributes=require(_0xe394('0x8'));module[_0xe394('0x9')]=function(_0x2a4db6,_0x272c30){return _0x2a4db6[_0xe394('0xa')](_0xe394('0xb'),attributes,{'tableName':_0xe394('0xc'),'paranoid':![],'indexes':[{'name':_0xe394('0xd'),'fields':[_0xe394('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc0d=['rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','bluebird','request-promise','path'];(function(_0x10c921,_0xda4317){var _0x3295e6=function(_0x33b623){while(--_0x33b623){_0x10c921['push'](_0x10c921['shift']());}};_0x3295e6(++_0xda4317);}(_0xdc0d,0x1db));var _0xddc0=function(_0x44bfac,_0x207cce){_0x44bfac=_0x44bfac-0x0;var _0x2463e4=_0xdc0d[_0x44bfac];return _0x2463e4;};'use strict';var _=require(_0xddc0('0x0'));var util=require(_0xddc0('0x1'));var logger=require('../../config/logger')(_0xddc0('0x2'));var moment=require('moment');var BPromise=require(_0xddc0('0x3'));var rp=require(_0xddc0('0x4'));var fs=require('fs');var path=require(_0xddc0('0x5'));var rimraf=require(_0xddc0('0x6'));var config=require(_0xddc0('0x7'));var attributes=require(_0xddc0('0x8'));module[_0xddc0('0x9')]=function(_0x39a8da,_0x20f5a9){return _0x39a8da['define'](_0xddc0('0xa'),attributes,{'tableName':_0xddc0('0xb'),'paranoid':![],'indexes':[{'name':_0xddc0('0xc'),'fields':[_0xddc0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 7aaaafe..c02d899 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 _0x5f18=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','randomstring','ioredis'];(function(_0x136a74,_0x580717){var _0x380919=function(_0x380c02){while(--_0x380c02){_0x136a74['push'](_0x136a74['shift']());}};_0x380919(++_0x580717);}(_0x5f18,0x101));var _0x85f1=function(_0x54ba73,_0x4efdb1){_0x54ba73=_0x54ba73-0x0;var _0x3b05bc=_0x5f18[_0x54ba73];return _0x3b05bc;};'use strict';var _=require('lodash');var util=require(_0x85f1('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x85f1('0x1'));var fs=require('fs');var Redis=require(_0x85f1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x85f1('0x3'));var logger=require(_0x85f1('0x4'))('rpc');var config=require(_0x85f1('0x5'));var jayson=require(_0x85f1('0x6'));var client=jayson[_0x85f1('0x7')][_0x85f1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25b881,_0x47401c,_0x1dc468){return new BPromise(function(_0x32d59e,_0x58b7a8){return client[_0x85f1('0x9')](_0x25b881,_0x1dc468)['then'](function(_0x25dfc8){logger[_0x85f1('0xa')](_0x85f1('0xb'),_0x47401c,'request\x20sent');logger[_0x85f1('0xc')](_0x85f1('0xd'),_0x47401c,_0x85f1('0xe'),JSON['stringify'](_0x25dfc8));if(_0x25dfc8[_0x85f1('0xf')]){if(_0x25dfc8[_0x85f1('0xf')][_0x85f1('0x10')]===0x1f4){logger[_0x85f1('0xf')](_0x85f1('0xb'),_0x47401c,_0x25dfc8[_0x85f1('0xf')][_0x85f1('0x11')]);return _0x58b7a8(_0x25dfc8[_0x85f1('0xf')]['message']);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x47401c,_0x25dfc8['error'][_0x85f1('0x11')]);return _0x32d59e(_0x25dfc8[_0x85f1('0xf')][_0x85f1('0x11')]);}else{logger[_0x85f1('0xa')](_0x85f1('0xb'),_0x47401c,_0x85f1('0xe'));_0x32d59e(_0x25dfc8[_0x85f1('0x12')][_0x85f1('0x11')]);}})[_0x85f1('0x13')](function(_0x13eb1e){logger[_0x85f1('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x47401c,_0x13eb1e);_0x58b7a8(_0x13eb1e);});});} \ No newline at end of file +var _0x918f=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http'];(function(_0x4503df,_0xfec122){var _0x3f1b2b=function(_0x32b1de){while(--_0x32b1de){_0x4503df['push'](_0x4503df['shift']());}};_0x3f1b2b(++_0xfec122);}(_0x918f,0x9e));var _0xf918=function(_0xef4ef0,_0x3c72f9){_0xef4ef0=_0xef4ef0-0x0;var _0x39b60b=_0x918f[_0xef4ef0];return _0x39b60b;};'use strict';var _=require(_0xf918('0x0'));var util=require(_0xf918('0x1'));var moment=require(_0xf918('0x2'));var BPromise=require(_0xf918('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf918('0x4'))['db'];var utils=require(_0xf918('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xf918('0x6'));var jayson=require(_0xf918('0x7'));var client=jayson[_0xf918('0x8')][_0xf918('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dfd08,_0x13e929,_0x5bca11){return new BPromise(function(_0x181e7f,_0x4f18e4){return client[_0xf918('0xa')](_0x2dfd08,_0x5bca11)[_0xf918('0xb')](function(_0x2a0856){logger[_0xf918('0xc')](_0xf918('0xd'),_0x13e929,_0xf918('0xe'));logger[_0xf918('0xf')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x13e929,_0xf918('0xe'),JSON[_0xf918('0x10')](_0x2a0856));if(_0x2a0856['error']){if(_0x2a0856[_0xf918('0x11')][_0xf918('0x12')]===0x1f4){logger[_0xf918('0x11')](_0xf918('0xd'),_0x13e929,_0x2a0856[_0xf918('0x11')]['message']);return _0x4f18e4(_0x2a0856[_0xf918('0x11')][_0xf918('0x13')]);}logger[_0xf918('0x11')](_0xf918('0xd'),_0x13e929,_0x2a0856['error'][_0xf918('0x13')]);return _0x181e7f(_0x2a0856[_0xf918('0x11')][_0xf918('0x13')]);}else{logger[_0xf918('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x13e929,'request\x20sent');_0x181e7f(_0x2a0856['result'][_0xf918('0x13')]);}})[_0xf918('0x14')](function(_0x2e83cd){logger[_0xf918('0x11')](_0xf918('0xd'),_0x13e929,_0x2e83cd);_0x4f18e4(_0x2e83cd);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 014ac30..1f356bb 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 _0xdd6b=['./memberReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2b55b5,_0x78505e){var _0x103d28=function(_0x5095a2){while(--_0x5095a2){_0x2b55b5['push'](_0x2b55b5['shift']());}};_0x103d28(++_0x78505e);}(_0xdd6b,0x10a));var _0xbdd6=function(_0x1aa19a,_0xbfcc3f){_0x1aa19a=_0x1aa19a-0x0;var _0xd5115b=_0xdd6b[_0x1aa19a];return _0xd5115b;};'use strict';var multer=require(_0xbdd6('0x0'));var util=require(_0xbdd6('0x1'));var path=require(_0xbdd6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbdd6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbdd6('0x4'));var interaction=require(_0xbdd6('0x5'));var config=require('../../config/environment');var controller=require(_0xbdd6('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xbdd6('0x7')]('/describe',auth[_0xbdd6('0x8')](),controller[_0xbdd6('0x9')]);router[_0xbdd6('0x7')](_0xbdd6('0xa'),auth[_0xbdd6('0x8')](),controller['show']);router[_0xbdd6('0xb')]('/',auth[_0xbdd6('0x8')](),controller[_0xbdd6('0xc')]);router[_0xbdd6('0xd')]('/:id',auth[_0xbdd6('0x8')](),controller[_0xbdd6('0xe')]);router[_0xbdd6('0xf')]('/:id',auth[_0xbdd6('0x8')](),controller['destroy']);module[_0xbdd6('0x10')]=router; \ No newline at end of file +var _0x9420=['fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','index','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy','multer','util','path','connect-timeout','Router'];(function(_0x10f3cc,_0x44b3bf){var _0x464ba1=function(_0x182f63){while(--_0x182f63){_0x10f3cc['push'](_0x10f3cc['shift']());}};_0x464ba1(++_0x44b3bf);}(_0x9420,0x164));var _0x0942=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x9420[_0x34021d];return _0x16597b;};'use strict';var multer=require(_0x0942('0x0'));var util=require(_0x0942('0x1'));var path=require(_0x0942('0x2'));var timeout=require(_0x0942('0x3'));var express=require('express');var router=express[_0x0942('0x4')]();var fs_extra=require(_0x0942('0x5'));var auth=require(_0x0942('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0942('0x7'));var controller=require(_0x0942('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0942('0x9')]);router[_0x0942('0xa')]('/describe',auth[_0x0942('0xb')](),controller[_0x0942('0xc')]);router[_0x0942('0xa')](_0x0942('0xd'),auth[_0x0942('0xb')](),controller['show']);router[_0x0942('0xe')]('/',auth[_0x0942('0xb')](),controller[_0x0942('0xf')]);router[_0x0942('0x10')](_0x0942('0xd'),auth[_0x0942('0xb')](),controller['update']);router[_0x0942('0x11')](_0x0942('0xd'),auth[_0x0942('0xb')](),controller[_0x0942('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index e39a437..59b3ff3 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 _0x94e6=['STRING','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[queue]','INTEGER','sequelize','moment','exports'];(function(_0x1bf418,_0x3b7cf1){var _0x5b2d03=function(_0x37dc62){while(--_0x37dc62){_0x1bf418['push'](_0x1bf418['shift']());}};_0x5b2d03(++_0x3b7cf1);}(_0x94e6,0x1a6));var _0x694e=function(_0x12a575,_0x3c68ef){_0x12a575=_0x12a575-0x0;var _0x210d3a=_0x94e6[_0x12a575];return _0x210d3a;};'use strict';var Sequelize=require(_0x694e('0x0'));var moment=require(_0x694e('0x1'));module[_0x694e('0x2')]={'channel':{'type':Sequelize[_0x694e('0x3')]},'membername':{'type':Sequelize[_0x694e('0x3')]},'interface':{'type':Sequelize[_0x694e('0x3')]},'type':{'type':Sequelize[_0x694e('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x694e('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x694e('0x5')]},'exitAt':{'type':Sequelize[_0x694e('0x5')],'set':function(_0xf15f1e){var _0x5b7ce4=moment(_0xf15f1e);var _0x154e75=moment(this[_0x694e('0x6')](_0x694e('0x7')));var _0x9fbdc1=_0x5b7ce4[_0x694e('0x8')](_0x154e75,_0x694e('0x9'));this[_0x694e('0xa')]('exitAt',_0xf15f1e);this[_0x694e('0xa')](_0x694e('0xb'),_0x9fbdc1>=0x0?_0x9fbdc1:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x694e('0xc')},'data2':{'type':Sequelize[_0x694e('0x3')],'comment':_0x694e('0xd')},'data3':{'type':Sequelize[_0x694e('0x3')],'comment':_0x694e('0xe')},'data4':{'type':Sequelize[_0x694e('0x3')],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x694e('0x3')],'comment':_0x694e('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x694e('0x10')]},'uniqueid':{'type':Sequelize[_0x694e('0x3')]}}; \ No newline at end of file +var _0x7515=['INTEGER','DATE','getDataValue','enterAt','seconds','setDataValue','exitAt','talk:[start]','talk:[dial\x20string]','talk:[queue]','moment','STRING'];(function(_0x7a84f2,_0x1e1e67){var _0x2822f0=function(_0x5eac00){while(--_0x5eac00){_0x7a84f2['push'](_0x7a84f2['shift']());}};_0x2822f0(++_0x1e1e67);}(_0x7515,0x82));var _0x5751=function(_0x30e9b5,_0x337678){_0x30e9b5=_0x30e9b5-0x0;var _0x3682e6=_0x7515[_0x30e9b5];return _0x3682e6;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5751('0x0'));module['exports']={'channel':{'type':Sequelize[_0x5751('0x1')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x5751('0x1')]},'type':{'type':Sequelize[_0x5751('0x1')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x5751('0x2')]},'enterAt':{'type':Sequelize[_0x5751('0x3')]},'exitAt':{'type':Sequelize[_0x5751('0x3')],'set':function(_0x118b33){var _0x4d9476=moment(_0x118b33);var _0x158b1d=moment(this[_0x5751('0x4')](_0x5751('0x5')));var _0x37e673=_0x4d9476['diff'](_0x158b1d,_0x5751('0x6'));this[_0x5751('0x7')](_0x5751('0x8'),_0x118b33);this['setDataValue']('duration',_0x37e673>=0x0?_0x37e673:null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x5751('0x1')],'comment':_0x5751('0x9')},'data3':{'type':Sequelize[_0x5751('0x1')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x5751('0x1')],'comment':_0x5751('0xa')},'data5':{'type':Sequelize[_0x5751('0x1')],'comment':_0x5751('0xb')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x5751('0x2')]},'uniqueid':{'type':Sequelize[_0x5751('0x1')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index d8adbf8..8bdb555 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 _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0xa4040,_0x32119b){var _0x405c12=function(_0x4fb46a){while(--_0x4fb46a){_0xa4040['push'](_0xa4040['shift']());}};_0x405c12(++_0x32119b);}(_0x3e74,0x175));var _0x43e7=function(_0x39de1e,_0x4569a4){_0x39de1e=_0x39de1e-0x0;var _0x33878f=_0x3e74[_0x39de1e];return _0x33878f;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file +var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0xedd9,0xfc));var _0x9edd=function(_0x251de2,_0x2b092f){_0x251de2=_0x251de2-0x0;var _0x13108f=_0xedd9[_0x251de2];return _0x13108f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 3a7127f..778f647 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 _0x2fe5=['api','moment','bluebird','request-promise','rimraf','./memberReport.attributes','exports','define','MemberReport','report_member','membername','lodash','util','../../config/logger'];(function(_0x4e5ad4,_0x3e8d29){var _0x598ea8=function(_0x42ca34){while(--_0x42ca34){_0x4e5ad4['push'](_0x4e5ad4['shift']());}};_0x598ea8(++_0x3e8d29);}(_0x2fe5,0x1bd));var _0x52fe=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2fe5[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var logger=require(_0x52fe('0x2'))(_0x52fe('0x3'));var moment=require(_0x52fe('0x4'));var BPromise=require(_0x52fe('0x5'));var rp=require(_0x52fe('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52fe('0x7'));var config=require('../../config/environment');var attributes=require(_0x52fe('0x8'));module[_0x52fe('0x9')]=function(_0x33efcb,_0x1c0186){return _0x33efcb[_0x52fe('0xa')](_0x52fe('0xb'),attributes,{'tableName':_0x52fe('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x52fe('0xd'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb012=['moment','bluebird','request-promise','path','rimraf','exports','define','MemberReport','membername_interface','membername','interface','lodash','util','../../config/logger','api'];(function(_0x32b307,_0x4485f8){var _0x5ead1c=function(_0x139461){while(--_0x139461){_0x32b307['push'](_0x32b307['shift']());}};_0x5ead1c(++_0x4485f8);}(_0xb012,0x92));var _0x2b01=function(_0xa9f4f7,_0x3d207a){_0xa9f4f7=_0xa9f4f7-0x0;var _0x3d0859=_0xb012[_0xa9f4f7];return _0x3d0859;};'use strict';var _=require(_0x2b01('0x0'));var util=require(_0x2b01('0x1'));var logger=require(_0x2b01('0x2'))(_0x2b01('0x3'));var moment=require(_0x2b01('0x4'));var BPromise=require(_0x2b01('0x5'));var rp=require(_0x2b01('0x6'));var fs=require('fs');var path=require(_0x2b01('0x7'));var rimraf=require(_0x2b01('0x8'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x2b01('0x9')]=function(_0x377d01,_0x18810e){return _0x377d01[_0x2b01('0xa')](_0x2b01('0xb'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x2b01('0xc'),'fields':[_0x2b01('0xd'),_0x2b01('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 4ca4917..60fc8e9 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 _0x5549=['CreateMemberReport','create','body','raw','then','UpdateMemberReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','map','model','include','stringify','catch'];(function(_0x36dc6a,_0x15d976){var _0x1ab4b2=function(_0x402516){while(--_0x402516){_0x36dc6a['push'](_0x36dc6a['shift']());}};_0x1ab4b2(++_0x15d976);}(_0x5549,0x1f4));var _0x9554=function(_0xba9047,_0x39552e){_0xba9047=_0xba9047-0x0;var _0x5ad957=_0x5549[_0xba9047];return _0x5ad957;};'use strict';var _=require(_0x9554('0x0'));var util=require(_0x9554('0x1'));var moment=require(_0x9554('0x2'));var BPromise=require(_0x9554('0x3'));var rs=require(_0x9554('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9554('0x5'))['db'];var utils=require(_0x9554('0x6'));var logger=require(_0x9554('0x7'))(_0x9554('0x8'));var config=require(_0x9554('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9554('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x456914,_0x2062a7,_0xac6b80){return new BPromise(function(_0x5afdf7,_0xa1b876){return client['request'](_0x456914,_0xac6b80)['then'](function(_0x29e84a){logger['info'](_0x9554('0xb'),_0x2062a7,_0x9554('0xc'));logger[_0x9554('0xd')](_0x9554('0xe'),_0x2062a7,_0x9554('0xc'),JSON['stringify'](_0x29e84a));if(_0x29e84a['error']){if(_0x29e84a[_0x9554('0xf')][_0x9554('0x10')]===0x1f4){logger[_0x9554('0xf')]('MemberReport,\x20%s,\x20%s',_0x2062a7,_0x29e84a[_0x9554('0xf')][_0x9554('0x11')]);return _0xa1b876(_0x29e84a[_0x9554('0xf')]['message']);}logger[_0x9554('0xf')](_0x9554('0xb'),_0x2062a7,_0x29e84a['error'][_0x9554('0x11')]);return _0x5afdf7(_0x29e84a[_0x9554('0xf')][_0x9554('0x11')]);}else{logger[_0x9554('0x12')]('MemberReport,\x20%s,\x20%s',_0x2062a7,_0x9554('0xc'));_0x5afdf7(_0x29e84a[_0x9554('0x13')][_0x9554('0x11')]);}})['catch'](function(_0x3163d5){logger['error'](_0x9554('0xb'),_0x2062a7,_0x3163d5);_0xa1b876(_0x3163d5);});});}exports[_0x9554('0x14')]=function(_0x5de328){var _0x29bbb0=this;return new Promise(function(_0x107584,_0x7525ef){return db[_0x9554('0x15')][_0x9554('0x16')]({'raw':_0x5de328[_0x9554('0x17')]?_0x5de328[_0x9554('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5de328[_0x9554('0x17')]?_0x5de328[_0x9554('0x17')][_0x9554('0x18')]||null:null,'attributes':_0x5de328[_0x9554('0x17')]?_0x5de328[_0x9554('0x17')][_0x9554('0x19')]||null:null,'limit':_0x5de328[_0x9554('0x17')]?_0x5de328[_0x9554('0x17')][_0x9554('0x1a')]||null:null,'include':_0x5de328['options']?_0x5de328[_0x9554('0x17')]['include']?_[_0x9554('0x1b')](_0x5de328[_0x9554('0x17')]['include'],function(_0x48576d){return{'model':db[_0x48576d[_0x9554('0x1c')]],'as':_0x48576d['as'],'attributes':_0x48576d[_0x9554('0x19')],'include':_0x48576d[_0x9554('0x1d')]?_[_0x9554('0x1b')](_0x48576d[_0x9554('0x1d')],function(_0x4356b9){return{'model':db[_0x4356b9[_0x9554('0x1c')]],'as':_0x4356b9['as'],'attributes':_0x4356b9[_0x9554('0x19')],'include':_0x4356b9[_0x9554('0x1d')]?_[_0x9554('0x1b')](_0x4356b9['include'],function(_0x13310b){return{'model':db[_0x13310b[_0x9554('0x1c')]],'as':_0x13310b['as'],'attributes':_0x13310b[_0x9554('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5abb7c){logger['info']('GetMemberReport',_0x5de328);logger[_0x9554('0xd')]('GetMemberReport',_0x5de328,JSON[_0x9554('0x1e')](_0x5abb7c));_0x107584(_0x5abb7c);})[_0x9554('0x1f')](function(_0x31a99c){logger[_0x9554('0xf')]('GetMemberReport',_0x31a99c[_0x9554('0x11')],_0x5de328);_0x7525ef(_0x29bbb0[_0x9554('0xf')](0x1f4,_0x31a99c[_0x9554('0x11')]));});});};exports[_0x9554('0x20')]=function(_0x3237ef){var _0x2d82f4=this;return new Promise(function(_0x4d9c2e,_0x497e0e){return db[_0x9554('0x15')][_0x9554('0x21')](_0x3237ef[_0x9554('0x22')],{'raw':_0x3237ef[_0x9554('0x17')]?_0x3237ef[_0x9554('0x17')][_0x9554('0x23')]===undefined?!![]:![]:!![]})[_0x9554('0x24')](function(_0x1bb110){logger['info'](_0x9554('0x20'),_0x3237ef);logger[_0x9554('0xd')](_0x9554('0x20'),_0x3237ef,JSON['stringify'](_0x1bb110));_0x4d9c2e(_0x1bb110);})[_0x9554('0x1f')](function(_0x25ef6d){logger['error'](_0x9554('0x20'),_0x25ef6d[_0x9554('0x11')],_0x3237ef);_0x497e0e(_0x2d82f4['error'](0x1f4,_0x25ef6d[_0x9554('0x11')]));});});};exports['UpdateMemberReport']=function(_0x42a803){var _0x2fd874=this;return new Promise(function(_0x555fbd,_0x1c75f9){return db['MemberReport']['update'](_0x42a803['body'],{'raw':_0x42a803['options']?_0x42a803[_0x9554('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x42a803[_0x9554('0x17')]?_0x42a803[_0x9554('0x17')][_0x9554('0x18')]||null:null,'attributes':_0x42a803[_0x9554('0x17')]?_0x42a803['options']['attributes']||null:null,'limit':_0x42a803['options']?_0x42a803['options'][_0x9554('0x1a')]||null:null})[_0x9554('0x24')](function(_0x20b8c5){logger[_0x9554('0x12')]('UpdateMemberReport',_0x42a803);logger[_0x9554('0xd')](_0x9554('0x25'),_0x42a803,JSON[_0x9554('0x1e')](_0x20b8c5));_0x555fbd(_0x20b8c5);})[_0x9554('0x1f')](function(_0x2254a1){logger[_0x9554('0xf')]('UpdateMemberReport',_0x2254a1['message'],_0x42a803);_0x1c75f9(_0x2fd874[_0x9554('0xf')](0x1f4,_0x2254a1[_0x9554('0x11')]));});});}; \ No newline at end of file +var _0x282a=['findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','create','body','UpdateMemberReport','update','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport'];(function(_0xfff1d6,_0x212dd5){var _0x3fbc33=function(_0x34cc94){while(--_0x34cc94){_0xfff1d6['push'](_0xfff1d6['shift']());}};_0x3fbc33(++_0x212dd5);}(_0x282a,0xa2));var _0xa282=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x282a[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0xa282('0x0'));var moment=require(_0xa282('0x1'));var BPromise=require(_0xa282('0x2'));var rs=require(_0xa282('0x3'));var fs=require('fs');var Redis=require(_0xa282('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa282('0x5'));var logger=require(_0xa282('0x6'))('rpc');var config=require(_0xa282('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa282('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a2c3d,_0x1e6765,_0x1d1e7a){return new BPromise(function(_0x5e41ef,_0x4ff77f){return client['request'](_0x1a2c3d,_0x1d1e7a)[_0xa282('0x9')](function(_0x3f704c){logger[_0xa282('0xa')](_0xa282('0xb'),_0x1e6765,_0xa282('0xc'));logger[_0xa282('0xd')](_0xa282('0xe'),_0x1e6765,_0xa282('0xc'),JSON[_0xa282('0xf')](_0x3f704c));if(_0x3f704c[_0xa282('0x10')]){if(_0x3f704c[_0xa282('0x10')][_0xa282('0x11')]===0x1f4){logger[_0xa282('0x10')](_0xa282('0xb'),_0x1e6765,_0x3f704c[_0xa282('0x10')][_0xa282('0x12')]);return _0x4ff77f(_0x3f704c[_0xa282('0x10')][_0xa282('0x12')]);}logger['error'](_0xa282('0xb'),_0x1e6765,_0x3f704c[_0xa282('0x10')][_0xa282('0x12')]);return _0x5e41ef(_0x3f704c[_0xa282('0x10')][_0xa282('0x12')]);}else{logger['info']('MemberReport,\x20%s,\x20%s',_0x1e6765,_0xa282('0xc'));_0x5e41ef(_0x3f704c[_0xa282('0x13')][_0xa282('0x12')]);}})[_0xa282('0x14')](function(_0x1b4c2d){logger['error']('MemberReport,\x20%s,\x20%s',_0x1e6765,_0x1b4c2d);_0x4ff77f(_0x1b4c2d);});});}exports[_0xa282('0x15')]=function(_0x19aef2){var _0x2d951c=this;return new Promise(function(_0x3280b7,_0x101897){return db[_0xa282('0x16')][_0xa282('0x17')]({'raw':_0x19aef2[_0xa282('0x18')]?_0x19aef2[_0xa282('0x18')][_0xa282('0x19')]===undefined?!![]:![]:!![],'where':_0x19aef2['options']?_0x19aef2[_0xa282('0x18')][_0xa282('0x1a')]||null:null,'attributes':_0x19aef2['options']?_0x19aef2[_0xa282('0x18')][_0xa282('0x1b')]||null:null,'limit':_0x19aef2[_0xa282('0x18')]?_0x19aef2[_0xa282('0x18')][_0xa282('0x1c')]||null:null,'include':_0x19aef2[_0xa282('0x18')]?_0x19aef2[_0xa282('0x18')][_0xa282('0x1d')]?_[_0xa282('0x1e')](_0x19aef2[_0xa282('0x18')][_0xa282('0x1d')],function(_0x400cf4){return{'model':db[_0x400cf4[_0xa282('0x1f')]],'as':_0x400cf4['as'],'attributes':_0x400cf4[_0xa282('0x1b')],'include':_0x400cf4['include']?_['map'](_0x400cf4[_0xa282('0x1d')],function(_0x3c616f){return{'model':db[_0x3c616f[_0xa282('0x1f')]],'as':_0x3c616f['as'],'attributes':_0x3c616f[_0xa282('0x1b')],'include':_0x3c616f[_0xa282('0x1d')]?_[_0xa282('0x1e')](_0x3c616f[_0xa282('0x1d')],function(_0x472e60){return{'model':db[_0x472e60['model']],'as':_0x472e60['as'],'attributes':_0x472e60[_0xa282('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13938e){logger[_0xa282('0xa')](_0xa282('0x15'),_0x19aef2);logger['debug']('GetMemberReport',_0x19aef2,JSON['stringify'](_0x13938e));_0x3280b7(_0x13938e);})[_0xa282('0x14')](function(_0x514879){logger[_0xa282('0x10')](_0xa282('0x15'),_0x514879['message'],_0x19aef2);_0x101897(_0x2d951c[_0xa282('0x10')](0x1f4,_0x514879[_0xa282('0x12')]));});});};exports[_0xa282('0x20')]=function(_0x143f02){var _0x2541c6=this;return new Promise(function(_0x43deb3,_0x97c148){return db['MemberReport'][_0xa282('0x21')](_0x143f02[_0xa282('0x22')],{'raw':_0x143f02[_0xa282('0x18')]?_0x143f02[_0xa282('0x18')][_0xa282('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x53da84){logger['info']('CreateMemberReport',_0x143f02);logger[_0xa282('0xd')](_0xa282('0x20'),_0x143f02,JSON['stringify'](_0x53da84));_0x43deb3(_0x53da84);})[_0xa282('0x14')](function(_0x411b99){logger[_0xa282('0x10')](_0xa282('0x20'),_0x411b99['message'],_0x143f02);_0x97c148(_0x2541c6[_0xa282('0x10')](0x1f4,_0x411b99[_0xa282('0x12')]));});});};exports[_0xa282('0x23')]=function(_0xb55258){var _0x57cde3=this;return new Promise(function(_0x12afb9,_0x56b991){return db[_0xa282('0x16')][_0xa282('0x24')](_0xb55258[_0xa282('0x22')],{'raw':_0xb55258[_0xa282('0x18')]?_0xb55258[_0xa282('0x18')][_0xa282('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb55258[_0xa282('0x18')]?_0xb55258[_0xa282('0x18')][_0xa282('0x1a')]||null:null,'attributes':_0xb55258[_0xa282('0x18')]?_0xb55258[_0xa282('0x18')]['attributes']||null:null,'limit':_0xb55258[_0xa282('0x18')]?_0xb55258[_0xa282('0x18')][_0xa282('0x1c')]||null:null})[_0xa282('0x9')](function(_0x156362){logger['info'](_0xa282('0x23'),_0xb55258);logger[_0xa282('0xd')](_0xa282('0x23'),_0xb55258,JSON[_0xa282('0xf')](_0x156362));_0x12afb9(_0x156362);})[_0xa282('0x14')](function(_0x3900ea){logger[_0xa282('0x10')](_0xa282('0x23'),_0x3900ea['message'],_0xb55258);_0x56b991(_0x57cde3[_0xa282('0x10')](0x1f4,_0x3900ea[_0xa282('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index fb3922c..9dbbabb 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 _0xb6c9=['../../components/auth/service','./migration.controller','get','index','exports','multer','connect-timeout','Router','fs-extra'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb6c9,0x152));var _0x9b6c=function(_0x5467f1,_0x4ca013){_0x5467f1=_0x5467f1-0x0;var _0x1c1041=_0xb6c9[_0x5467f1];return _0x1c1041;};'use strict';var multer=require(_0x9b6c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b6c('0x1'));var express=require('express');var router=express[_0x9b6c('0x2')]();var fs_extra=require(_0x9b6c('0x3'));var auth=require(_0x9b6c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9b6c('0x5'));router[_0x9b6c('0x6')]('/',controller[_0x9b6c('0x7')]);module[_0x9b6c('0x8')]=router; \ No newline at end of file +var _0xf350=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x137b03,_0x1696cb){var _0xff0289=function(_0x36da97){while(--_0x36da97){_0x137b03['push'](_0x137b03['shift']());}};_0xff0289(++_0x1696cb);}(_0xf350,0x105));var _0x0f35=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf350[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0f35('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0f35('0x1'));var express=require(_0x0f35('0x2'));var router=express[_0x0f35('0x3')]();var fs_extra=require(_0x0f35('0x4'));var auth=require(_0x0f35('0x5'));var interaction=require(_0x0f35('0x6'));var config=require(_0x0f35('0x7'));var controller=require('./migration.controller');router['get']('/',controller['index']);module[_0x0f35('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index ba10752..f9b54a9 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 _0x6919=['version','exports','STRING'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x6919,0x17e));var _0x9691=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0x6919[_0x4d7379];return _0x46d7cf;};'use strict';var Sequelize=require('sequelize');module[_0x9691('0x0')]={'version':{'type':Sequelize[_0x9691('0x1')],'unique':_0x9691('0x2')}}; \ No newline at end of file +var _0x52f4=['exports'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x52f4,0x64));var _0x452f=function(_0x5a0467,_0x1e69b4){_0x5a0467=_0x5a0467-0x0;var _0x1c3318=_0x52f4[_0x5a0467];return _0x1c3318;};'use strict';var Sequelize=require('sequelize');module[_0x452f('0x0')]={'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 32aa200..5ac2a26 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 _0xb607=['Migration','rawAttributes','fieldName','type','query','filters','attributes','intersection','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch','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/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','stack','name','index','map'];(function(_0x135a0a,_0x55425f){var _0x2d17cb=function(_0x342417){while(--_0x342417){_0x135a0a['push'](_0x135a0a['shift']());}};_0x2d17cb(++_0x55425f);}(_0xb607,0x1bc));var _0x7b60=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xb607[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0x7b60('0x0'));var rimraf=require(_0x7b60('0x1'));var zipdir=require(_0x7b60('0x2'));var jsonpatch=require(_0x7b60('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7b60('0x4'));var util=require(_0x7b60('0x5'));var path=require(_0x7b60('0x6'));var sox=require(_0x7b60('0x7'));var csv=require(_0x7b60('0x8'));var ejs=require(_0x7b60('0x9'));var fs=require('fs');var fs_extra=require(_0x7b60('0xa'));var _=require(_0x7b60('0xb'));var squel=require(_0x7b60('0xc'));var crypto=require(_0x7b60('0xd'));var jsforce=require(_0x7b60('0xe'));var deskjs=require(_0x7b60('0xf'));var toCsv=require(_0x7b60('0x8'));var querystring=require(_0x7b60('0x10'));var Papa=require(_0x7b60('0x11'));var Redis=require(_0x7b60('0x12'));var authService=require(_0x7b60('0x13'));var qs=require(_0x7b60('0x14'));var as=require(_0x7b60('0x15'));var hardwareService=require(_0x7b60('0x16'));var logger=require(_0x7b60('0x17'))(_0x7b60('0x18'));var utils=require(_0x7b60('0x19'));var config=require(_0x7b60('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x7b60('0x1b'))['db'];function respondWithStatusCode(_0x120155,_0x521b2c){_0x521b2c=_0x521b2c||0xcc;return function(_0x49e5f7){if(_0x49e5f7){return _0x120155[_0x7b60('0x1c')](_0x521b2c);}return _0x120155[_0x7b60('0x1d')](_0x521b2c)[_0x7b60('0x1e')]();};}function respondWithResult(_0xeb2d97,_0x3438bc){_0x3438bc=_0x3438bc||0xc8;return function(_0x3c4159){if(_0x3c4159){return _0xeb2d97['status'](_0x3438bc)['json'](_0x3c4159);}};}function respondWithFilteredResult(_0x1e2952,_0x55d78d){return function(_0x221265){if(_0x221265){var _0x1b8718=typeof _0x55d78d[_0x7b60('0x1f')]===_0x7b60('0x20')&&typeof _0x55d78d[_0x7b60('0x21')]==='undefined';var _0x2e624a=_0x221265['count'];var _0x51bd4c=_0x1b8718?0x0:_0x55d78d[_0x7b60('0x1f')];var _0x24bf53=_0x1b8718?_0x221265[_0x7b60('0x22')]:_0x55d78d['offset']+_0x55d78d[_0x7b60('0x21')];var _0x31b737;if(_0x24bf53>=_0x2e624a){_0x24bf53=_0x2e624a;_0x31b737=0xc8;}else{_0x31b737=0xce;}_0x1e2952['status'](_0x31b737);return _0x1e2952[_0x7b60('0x23')]('Content-Range',_0x51bd4c+'-'+_0x24bf53+'/'+_0x2e624a)[_0x7b60('0x24')](_0x221265);}return null;};}function patchUpdates(_0x1b6f67){return function(_0x37a6da){try{jsonpatch[_0x7b60('0x25')](_0x37a6da,_0x1b6f67,!![]);}catch(_0x5f644a){return BPromise['reject'](_0x5f644a);}return _0x37a6da[_0x7b60('0x26')]();};}function saveUpdates(_0x59e948,_0x4a54d5){return function(_0x40d12d){if(_0x40d12d){return _0x40d12d[_0x7b60('0x27')](_0x59e948)['then'](function(_0x37cf44){return _0x37cf44;});}return null;};}function removeEntity(_0x4247ba,_0x101a4e){return function(_0x3a59e5){if(_0x3a59e5){return _0x3a59e5[_0x7b60('0x28')]()[_0x7b60('0x29')](function(){_0x4247ba[_0x7b60('0x1d')](0xcc)[_0x7b60('0x1e')]();});}};}function handleEntityNotFound(_0x340101,_0x43d883){return function(_0x24bdfb){if(!_0x24bdfb){_0x340101[_0x7b60('0x1c')](0x194);}return _0x24bdfb;};}function handleError(_0x4e3248,_0x53e239){_0x53e239=_0x53e239||0x1f4;return function(_0x4cc7e4){logger['error'](_0x4cc7e4[_0x7b60('0x2a')]);if(_0x4cc7e4[_0x7b60('0x2b')]){delete _0x4cc7e4[_0x7b60('0x2b')];}_0x4e3248[_0x7b60('0x1d')](_0x53e239)['send'](_0x4cc7e4);};}exports[_0x7b60('0x2c')]=function(_0x15b5fd,_0x41a822){var _0xd4e21c={},_0x2a8f9f={},_0x499f22={'count':0x0,'rows':[]};var _0x3fba6b=_[_0x7b60('0x2d')](db[_0x7b60('0x2e')][_0x7b60('0x2f')],function(_0x1c9bec){return{'name':_0x1c9bec[_0x7b60('0x30')],'type':_0x1c9bec[_0x7b60('0x31')]['key']};});_0x2a8f9f['model']=_['map'](_0x3fba6b,_0x7b60('0x2b'));_0x2a8f9f[_0x7b60('0x32')]=_['keys'](_0x15b5fd[_0x7b60('0x32')]);_0x2a8f9f[_0x7b60('0x33')]=_['intersection'](_0x2a8f9f['model'],_0x2a8f9f['query']);_0xd4e21c[_0x7b60('0x34')]=_[_0x7b60('0x35')](_0x2a8f9f[_0x7b60('0x36')],qs[_0x7b60('0x37')](_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x37')]));_0xd4e21c[_0x7b60('0x34')]=_0xd4e21c[_0x7b60('0x34')]['length']?_0xd4e21c[_0x7b60('0x34')]:_0x2a8f9f[_0x7b60('0x36')];if(!_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x38')](_0x7b60('0x39'))){_0xd4e21c[_0x7b60('0x21')]=qs[_0x7b60('0x21')](_0x15b5fd['query']['limit']);_0xd4e21c[_0x7b60('0x1f')]=qs[_0x7b60('0x1f')](_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x1f')]);}_0xd4e21c[_0x7b60('0x3a')]=qs[_0x7b60('0x3b')](_0x15b5fd['query']['sort']);_0xd4e21c[_0x7b60('0x3c')]=qs[_0x7b60('0x33')](_[_0x7b60('0x3d')](_0x15b5fd[_0x7b60('0x32')],_0x2a8f9f[_0x7b60('0x33')]),_0x3fba6b);if(_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x3e')]){_0xd4e21c[_0x7b60('0x3c')]=_[_0x7b60('0x3f')](_0xd4e21c[_0x7b60('0x3c')],{'$or':_['map'](_0x3fba6b,function(_0x364bbc){if(_0x364bbc['type']!==_0x7b60('0x40')){var _0x2cbb0b={};_0x2cbb0b[_0x364bbc[_0x7b60('0x2b')]]={'$like':'%'+_0x15b5fd['query'][_0x7b60('0x3e')]+'%'};return _0x2cbb0b;}})});}_0xd4e21c=_[_0x7b60('0x3f')]({},_0xd4e21c,_0x15b5fd['options']);var _0x4a8fe1={'where':_0xd4e21c[_0x7b60('0x3c')]};return db[_0x7b60('0x2e')]['count'](_0x4a8fe1)[_0x7b60('0x29')](function(_0x4f0080){_0x499f22['count']=_0x4f0080;if(_0x15b5fd[_0x7b60('0x32')][_0x7b60('0x41')]){_0xd4e21c[_0x7b60('0x42')]=[{'all':!![]}];}return db[_0x7b60('0x2e')][_0x7b60('0x43')](_0xd4e21c);})[_0x7b60('0x29')](function(_0x4525d3){_0x499f22[_0x7b60('0x44')]=_0x4525d3;return _0x499f22;})[_0x7b60('0x29')](respondWithFilteredResult(_0x41a822,_0xd4e21c))[_0x7b60('0x45')](handleError(_0x41a822,null));}; \ No newline at end of file +var _0x4f96=['name','includeAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','count','limit','set','Content-Range','json','apply','reject','save','update','then','stack','send','index','Migration','rawAttributes','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type'];(function(_0x2a4786,_0x53df36){var _0x2508d1=function(_0x4d77cb){while(--_0x4d77cb){_0x2a4786['push'](_0x2a4786['shift']());}};_0x2508d1(++_0x53df36);}(_0x4f96,0xb9));var _0x64f9=function(_0x3b0575,_0x57dcff){_0x3b0575=_0x3b0575-0x0;var _0x3e3bea=_0x4f96[_0x3b0575];return _0x3e3bea;};'use strict';var emlformat=require(_0x64f9('0x0'));var rimraf=require(_0x64f9('0x1'));var zipdir=require(_0x64f9('0x2'));var jsonpatch=require(_0x64f9('0x3'));var rp=require(_0x64f9('0x4'));var moment=require(_0x64f9('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x64f9('0x6'));var util=require('util');var path=require('path');var sox=require(_0x64f9('0x7'));var csv=require('to-csv');var ejs=require(_0x64f9('0x8'));var fs=require('fs');var fs_extra=require(_0x64f9('0x9'));var _=require(_0x64f9('0xa'));var squel=require(_0x64f9('0xb'));var crypto=require(_0x64f9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x64f9('0xd'));var toCsv=require('to-csv');var querystring=require(_0x64f9('0xe'));var Papa=require(_0x64f9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x64f9('0x10'));var as=require(_0x64f9('0x11'));var hardwareService=require(_0x64f9('0x12'));var logger=require(_0x64f9('0x13'))(_0x64f9('0x14'));var utils=require('../../config/utils');var config=require(_0x64f9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x64f9('0x16'))['db'];function respondWithStatusCode(_0x4491bb,_0x4b5ecd){_0x4b5ecd=_0x4b5ecd||0xcc;return function(_0x2db632){if(_0x2db632){return _0x4491bb[_0x64f9('0x17')](_0x4b5ecd);}return _0x4491bb[_0x64f9('0x18')](_0x4b5ecd)[_0x64f9('0x19')]();};}function respondWithResult(_0x33da78,_0x4b52b3){_0x4b52b3=_0x4b52b3||0xc8;return function(_0x14febc){if(_0x14febc){return _0x33da78['status'](_0x4b52b3)['json'](_0x14febc);}};}function respondWithFilteredResult(_0x3f69a5,_0x2109cb){return function(_0x5c2a12){if(_0x5c2a12){var _0xd9aa4b=typeof _0x2109cb[_0x64f9('0x1a')]==='undefined'&&typeof _0x2109cb['limit']==='undefined';var _0x534c2c=_0x5c2a12[_0x64f9('0x1b')];var _0x28553e=_0xd9aa4b?0x0:_0x2109cb[_0x64f9('0x1a')];var _0x238672=_0xd9aa4b?_0x5c2a12['count']:_0x2109cb['offset']+_0x2109cb[_0x64f9('0x1c')];var _0x482a6d;if(_0x238672>=_0x534c2c){_0x238672=_0x534c2c;_0x482a6d=0xc8;}else{_0x482a6d=0xce;}_0x3f69a5[_0x64f9('0x18')](_0x482a6d);return _0x3f69a5[_0x64f9('0x1d')](_0x64f9('0x1e'),_0x28553e+'-'+_0x238672+'/'+_0x534c2c)[_0x64f9('0x1f')](_0x5c2a12);}return null;};}function patchUpdates(_0x1bdda9){return function(_0x89eb57){try{jsonpatch[_0x64f9('0x20')](_0x89eb57,_0x1bdda9,!![]);}catch(_0x40b9b7){return BPromise[_0x64f9('0x21')](_0x40b9b7);}return _0x89eb57[_0x64f9('0x22')]();};}function saveUpdates(_0x253a94,_0x327e59){return function(_0x55ca87){if(_0x55ca87){return _0x55ca87[_0x64f9('0x23')](_0x253a94)[_0x64f9('0x24')](function(_0x714f93){return _0x714f93;});}return null;};}function removeEntity(_0x4a1796,_0x5ce72e){return function(_0x51544b){if(_0x51544b){return _0x51544b['destroy']()[_0x64f9('0x24')](function(){_0x4a1796[_0x64f9('0x18')](0xcc)[_0x64f9('0x19')]();});}};}function handleEntityNotFound(_0x1f8e45,_0x25c7aa){return function(_0x1ac533){if(!_0x1ac533){_0x1f8e45['sendStatus'](0x194);}return _0x1ac533;};}function handleError(_0x4ba839,_0x32f550){_0x32f550=_0x32f550||0x1f4;return function(_0x4e4639){logger['error'](_0x4e4639[_0x64f9('0x25')]);if(_0x4e4639['name']){delete _0x4e4639['name'];}_0x4ba839[_0x64f9('0x18')](_0x32f550)[_0x64f9('0x26')](_0x4e4639);};}exports[_0x64f9('0x27')]=function(_0x2d9c3e,_0xc6977){var _0x5a2518={},_0x10cd04={},_0x276a2a={'count':0x0,'rows':[]};var _0x45075b=_['map'](db[_0x64f9('0x28')][_0x64f9('0x29')],function(_0x276714){return{'name':_0x276714['fieldName'],'type':_0x276714['type']['key']};});_0x10cd04[_0x64f9('0x2a')]=_[_0x64f9('0x2b')](_0x45075b,'name');_0x10cd04[_0x64f9('0x2c')]=_[_0x64f9('0x2d')](_0x2d9c3e[_0x64f9('0x2c')]);_0x10cd04[_0x64f9('0x2e')]=_[_0x64f9('0x2f')](_0x10cd04[_0x64f9('0x2a')],_0x10cd04[_0x64f9('0x2c')]);_0x5a2518[_0x64f9('0x30')]=_[_0x64f9('0x2f')](_0x10cd04[_0x64f9('0x2a')],qs['fields'](_0x2d9c3e[_0x64f9('0x2c')][_0x64f9('0x31')]));_0x5a2518[_0x64f9('0x30')]=_0x5a2518[_0x64f9('0x30')][_0x64f9('0x32')]?_0x5a2518['attributes']:_0x10cd04[_0x64f9('0x2a')];if(!_0x2d9c3e[_0x64f9('0x2c')]['hasOwnProperty'](_0x64f9('0x33'))){_0x5a2518['limit']=qs['limit'](_0x2d9c3e[_0x64f9('0x2c')][_0x64f9('0x1c')]);_0x5a2518[_0x64f9('0x1a')]=qs[_0x64f9('0x1a')](_0x2d9c3e[_0x64f9('0x2c')][_0x64f9('0x1a')]);}_0x5a2518[_0x64f9('0x34')]=qs[_0x64f9('0x35')](_0x2d9c3e['query'][_0x64f9('0x35')]);_0x5a2518[_0x64f9('0x36')]=qs[_0x64f9('0x2e')](_[_0x64f9('0x37')](_0x2d9c3e[_0x64f9('0x2c')],_0x10cd04[_0x64f9('0x2e')]),_0x45075b);if(_0x2d9c3e[_0x64f9('0x2c')][_0x64f9('0x38')]){_0x5a2518[_0x64f9('0x36')]=_[_0x64f9('0x39')](_0x5a2518['where'],{'$or':_[_0x64f9('0x2b')](_0x45075b,function(_0x188243){if(_0x188243[_0x64f9('0x3a')]!=='VIRTUAL'){var _0x4e61d3={};_0x4e61d3[_0x188243[_0x64f9('0x3b')]]={'$like':'%'+_0x2d9c3e[_0x64f9('0x2c')][_0x64f9('0x38')]+'%'};return _0x4e61d3;}})});}_0x5a2518=_[_0x64f9('0x39')]({},_0x5a2518,_0x2d9c3e['options']);var _0x311e61={'where':_0x5a2518[_0x64f9('0x36')]};return db[_0x64f9('0x28')][_0x64f9('0x1b')](_0x311e61)[_0x64f9('0x24')](function(_0x40b2cc){_0x276a2a[_0x64f9('0x1b')]=_0x40b2cc;if(_0x2d9c3e['query'][_0x64f9('0x3c')]){_0x5a2518['include']=[{'all':!![]}];}return db[_0x64f9('0x28')]['findAll'](_0x5a2518);})[_0x64f9('0x24')](function(_0x3a20d8){_0x276a2a['rows']=_0x3a20d8;return _0x276a2a;})[_0x64f9('0x24')](respondWithFilteredResult(_0xc6977,_0x5a2518))['catch'](handleError(_0xc6977,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7e96380..ba70d15 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 _0x860a=['define','Migration','migrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports'];(function(_0x19c64f,_0x2ae7d2){var _0x47bac7=function(_0x5a3fad){while(--_0x5a3fad){_0x19c64f['push'](_0x19c64f['shift']());}};_0x47bac7(++_0x2ae7d2);}(_0x860a,0x9f));var _0xa860=function(_0x4e16fa,_0x19f96b){_0x4e16fa=_0x4e16fa-0x0;var _0x33588a=_0x860a[_0x4e16fa];return _0x33588a;};'use strict';var _=require(_0xa860('0x0'));var util=require(_0xa860('0x1'));var logger=require(_0xa860('0x2'))(_0xa860('0x3'));var moment=require(_0xa860('0x4'));var BPromise=require(_0xa860('0x5'));var rp=require(_0xa860('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa860('0x7'));var attributes=require('./migration.attributes');module[_0xa860('0x8')]=function(_0x15b580,_0x40f2b5){return _0x15b580[_0xa860('0x9')](_0xa860('0xa'),attributes,{'tableName':_0xa860('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde16=['request-promise','path','rimraf','../../config/environment','./migration.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird'];(function(_0x2696b6,_0x1caa51){var _0x414ca2=function(_0x293d50){while(--_0x293d50){_0x2696b6['push'](_0x2696b6['shift']());}};_0x414ca2(++_0x1caa51);}(_0xde16,0x13f));var _0x6de1=function(_0x17da69,_0x205f98){_0x17da69=_0x17da69-0x0;var _0x420fde=_0xde16[_0x17da69];return _0x420fde;};'use strict';var _=require(_0x6de1('0x0'));var util=require('util');var logger=require(_0x6de1('0x1'))(_0x6de1('0x2'));var moment=require(_0x6de1('0x3'));var BPromise=require(_0x6de1('0x4'));var rp=require(_0x6de1('0x5'));var fs=require('fs');var path=require(_0x6de1('0x6'));var rimraf=require(_0x6de1('0x7'));var config=require(_0x6de1('0x8'));var attributes=require(_0x6de1('0x9'));module[_0x6de1('0xa')]=function(_0x3e1bfe,_0x121798){return _0x3e1bfe[_0x6de1('0xb')]('Migration',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 d4fc209..dc6b807 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 _0x49e9=['stringify','error','code','Migration,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s'];(function(_0x210166,_0x15d6da){var _0xbbb231=function(_0x5b9e0e){while(--_0x5b9e0e){_0x210166['push'](_0x210166['shift']());}};_0xbbb231(++_0x15d6da);}(_0x49e9,0x10f));var _0x949e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x49e9[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x949e('0x0'));var util=require(_0x949e('0x1'));var moment=require('moment');var BPromise=require(_0x949e('0x2'));var rs=require(_0x949e('0x3'));var fs=require('fs');var Redis=require(_0x949e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x949e('0x5'))('rpc');var config=require(_0x949e('0x6'));var jayson=require(_0x949e('0x7'));var client=jayson[_0x949e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17f649,_0x16c669,_0xfc4f8a){return new BPromise(function(_0x34ee57,_0x40d442){return client[_0x949e('0x9')](_0x17f649,_0xfc4f8a)[_0x949e('0xa')](function(_0x56e31d){logger[_0x949e('0xb')]('Migration,\x20%s,\x20%s',_0x16c669,_0x949e('0xc'));logger[_0x949e('0xd')](_0x949e('0xe'),_0x16c669,'request\x20sent',JSON[_0x949e('0xf')](_0x56e31d));if(_0x56e31d[_0x949e('0x10')]){if(_0x56e31d[_0x949e('0x10')][_0x949e('0x11')]===0x1f4){logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x40d442(_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);}logger[_0x949e('0x10')](_0x949e('0x12'),_0x16c669,_0x56e31d[_0x949e('0x10')][_0x949e('0x13')]);return _0x34ee57(_0x56e31d[_0x949e('0x10')]['message']);}else{logger[_0x949e('0xb')](_0x949e('0x12'),_0x16c669,_0x949e('0xc'));_0x34ee57(_0x56e31d[_0x949e('0x14')]['message']);}})[_0x949e('0x15')](function(_0x441b80){logger['error'](_0x949e('0x12'),_0x16c669,_0x441b80);_0x40d442(_0x441b80);});});} \ No newline at end of file +var _0x9063=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Migration,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x9063,0x1a2));var _0x3906=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0x9063[_0x3c4737];return _0x2bb926;};'use strict';var _=require(_0x3906('0x0'));var util=require(_0x3906('0x1'));var moment=require(_0x3906('0x2'));var BPromise=require(_0x3906('0x3'));var rs=require(_0x3906('0x4'));var fs=require('fs');var Redis=require(_0x3906('0x5'));var db=require(_0x3906('0x6'))['db'];var utils=require(_0x3906('0x7'));var logger=require('../../config/logger')(_0x3906('0x8'));var config=require(_0x3906('0x9'));var jayson=require(_0x3906('0xa'));var client=jayson[_0x3906('0xb')][_0x3906('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x522b71,_0x54637d,_0x4a8864){return new BPromise(function(_0x331b42,_0x14f37c){return client[_0x3906('0xd')](_0x522b71,_0x4a8864)['then'](function(_0x45f3bf){logger[_0x3906('0xe')]('Migration,\x20%s,\x20%s',_0x54637d,_0x3906('0xf'));logger[_0x3906('0x10')](_0x3906('0x11'),_0x54637d,'request\x20sent',JSON[_0x3906('0x12')](_0x45f3bf));if(_0x45f3bf[_0x3906('0x13')]){if(_0x45f3bf['error'][_0x3906('0x14')]===0x1f4){logger['error']('Migration,\x20%s,\x20%s',_0x54637d,_0x45f3bf[_0x3906('0x13')][_0x3906('0x15')]);return _0x14f37c(_0x45f3bf['error']['message']);}logger[_0x3906('0x13')](_0x3906('0x16'),_0x54637d,_0x45f3bf['error']['message']);return _0x331b42(_0x45f3bf[_0x3906('0x13')][_0x3906('0x15')]);}else{logger[_0x3906('0xe')](_0x3906('0x16'),_0x54637d,_0x3906('0xf'));_0x331b42(_0x45f3bf[_0x3906('0x17')][_0x3906('0x15')]);}})[_0x3906('0x18')](function(_0x3f8515){logger[_0x3906('0x13')]('Migration,\x20%s,\x20%s',_0x54637d,_0x3f8515);_0x14f37c(_0x3f8515);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index fac93c4..27cade2 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 _0xfaf2=['show','post','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','/:id','isAuthenticated'];(function(_0x1df99b,_0x4597f3){var _0x539f2d=function(_0x5ac87f){while(--_0x5ac87f){_0x1df99b['push'](_0x1df99b['shift']());}};_0x539f2d(++_0x4597f3);}(_0xfaf2,0x169));var _0x2faf=function(_0xb5e8ce,_0x34e046){_0xb5e8ce=_0xb5e8ce-0x0;var _0x4095f1=_0xfaf2[_0xb5e8ce];return _0x4095f1;};'use strict';var multer=require(_0x2faf('0x0'));var util=require(_0x2faf('0x1'));var path=require(_0x2faf('0x2'));var timeout=require(_0x2faf('0x3'));var express=require(_0x2faf('0x4'));var router=express['Router']();var fs_extra=require(_0x2faf('0x5'));var auth=require(_0x2faf('0x6'));var interaction=require(_0x2faf('0x7'));var config=require(_0x2faf('0x8'));var controller=require(_0x2faf('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x2faf('0xa')](_0x2faf('0xb'),auth[_0x2faf('0xc')](),controller[_0x2faf('0xd')]);router[_0x2faf('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2faf('0xf')](_0x2faf('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2faf('0x10')](_0x2faf('0xb'),auth[_0x2faf('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc247=['util','path','express','Router','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','post','put','update','destroy','exports','multer'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc247,0xfe));var _0x7c24=function(_0x3747ae,_0x408e61){_0x3747ae=_0x3747ae-0x0;var _0x339035=_0xc247[_0x3747ae];return _0x339035;};'use strict';var multer=require(_0x7c24('0x0'));var util=require(_0x7c24('0x1'));var path=require(_0x7c24('0x2'));var timeout=require('connect-timeout');var express=require(_0x7c24('0x3'));var router=express[_0x7c24('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7c24('0x5'));var config=require(_0x7c24('0x6'));var controller=require(_0x7c24('0x7'));router[_0x7c24('0x8')]('/',auth[_0x7c24('0x9')](),controller[_0x7c24('0xa')]);router[_0x7c24('0x8')](_0x7c24('0xb'),auth[_0x7c24('0x9')](),controller['show']);router[_0x7c24('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7c24('0xd')](_0x7c24('0xb'),auth[_0x7c24('0x9')](),controller[_0x7c24('0xe')]);router['delete'](_0x7c24('0xb'),auth['isAuthenticated'](),controller[_0x7c24('0xf')]);module[_0x7c24('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 13bfa21..98a15f0 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 _0xe6eb=['ENUM','externip','stun','turn','STRING','sequelize'];(function(_0x55c9ea,_0xf80189){var _0x59d18e=function(_0x55ec90){while(--_0x55ec90){_0x55c9ea['push'](_0x55c9ea['shift']());}};_0x59d18e(++_0xf80189);}(_0xe6eb,0x65));var _0xbe6e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xe6eb[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xbe6e('0x0'));module['exports']={'type':{'type':Sequelize[_0xbe6e('0x1')]('localnet',_0xbe6e('0x2'),_0xbe6e('0x3'),_0xbe6e('0x4'))},'value':{'type':Sequelize[_0xbe6e('0x5')]},'username':{'type':Sequelize[_0xbe6e('0x5')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0361=['ENUM','localnet','stun','STRING','exports'];(function(_0x53c807,_0x4b25c8){var _0x588b2c=function(_0x33919b){while(--_0x33919b){_0x53c807['push'](_0x53c807['shift']());}};_0x588b2c(++_0x4b25c8);}(_0x0361,0x11c));var _0x1036=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0361[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x1036('0x0')]={'type':{'type':Sequelize[_0x1036('0x1')](_0x1036('0x2'),'externip',_0x1036('0x3'),'turn')},'value':{'type':Sequelize[_0x1036('0x4')]},'username':{'type':Sequelize[_0x1036('0x4')]},'password':{'type':Sequelize[_0x1036('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index ed7f879..3ec51fc 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 _0x6e45=['message','request\x20sent','result','status','json','offset','undefined','limit','count','Content-Range','update','destroy','end','stack','name','index','map','Network','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','catch','show','params','options','find','create','body','toUpperCase','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','readFileSync','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','STUN','server/files/templates/network.ejs','chan_sip.so','TURN','path','ejs','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','then','info','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','Network,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6e45,0x139));var _0x56e4=function(_0x371b24,_0x1bb40f){_0x371b24=_0x371b24-0x0;var _0x23a7e7=_0x6e45[_0x371b24];return _0x23a7e7;};'use strict';var util=require('util');var path=require(_0x56e4('0x0'));var ejs=require(_0x56e4('0x1'));var fs=require('fs');var _=require('lodash');var qs=require(_0x56e4('0x2'));var logger=require('../../config/logger')(_0x56e4('0x3'));var config=require(_0x56e4('0x4'));var db=require(_0x56e4('0x5'))['db'];var jayson=require(_0x56e4('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x397499,_0x44e044,_0x158188,_0x368e7e){return new Promise(function(_0x5dc661,_0x37b03b){var _0x1b12f=_0x368e7e||client;return _0x1b12f['request'](_0x397499,_0x158188)[_0x56e4('0x7')](function(_0x4fba03){logger[_0x56e4('0x8')]('Network,\x20%s,\x20%s',_0x44e044,'request\x20sent');logger[_0x56e4('0x9')](_0x56e4('0xa'),_0x44e044,'request\x20sent',JSON[_0x56e4('0xb')](_0x4fba03));if(_0x4fba03[_0x56e4('0xc')]){if(_0x4fba03[_0x56e4('0xc')][_0x56e4('0xd')]===0x1f4){logger[_0x56e4('0xc')](_0x56e4('0xe'),_0x44e044,_0x4fba03[_0x56e4('0xc')][_0x56e4('0xf')]);return _0x37b03b(_0x4fba03[_0x56e4('0xc')][_0x56e4('0xf')]);}logger['error']('Network,\x20%s,\x20%s',_0x44e044,_0x4fba03[_0x56e4('0xc')][_0x56e4('0xf')]);return _0x5dc661(_0x4fba03[_0x56e4('0xc')][_0x56e4('0xf')]);}else{logger[_0x56e4('0x8')](_0x56e4('0xe'),_0x44e044,_0x56e4('0x10'));_0x5dc661(_0x4fba03[_0x56e4('0x11')][_0x56e4('0xf')]);}})['catch'](function(_0x1cdbc8){logger[_0x56e4('0xc')](_0x56e4('0xe'),_0x44e044,_0x1cdbc8);_0x37b03b(_0x1cdbc8);});});}function respondWithResult(_0x381e74,_0x547579){_0x547579=_0x547579||0xc8;return function(_0x3e30db){if(_0x3e30db){return _0x381e74[_0x56e4('0x12')](_0x547579)[_0x56e4('0x13')](_0x3e30db);}};}function respondWithFilteredResult(_0x5e808e,_0x491dbb){return function(_0x4f1475){if(_0x4f1475){var _0x2dca09=typeof _0x491dbb[_0x56e4('0x14')]===_0x56e4('0x15')&&typeof _0x491dbb[_0x56e4('0x16')]===_0x56e4('0x15');var _0x42824a=_0x4f1475['count'];var _0x2c805d=_0x2dca09?0x0:_0x491dbb['offset'];var _0x38d7c5=_0x2dca09?_0x4f1475[_0x56e4('0x17')]:_0x491dbb[_0x56e4('0x14')]+_0x491dbb[_0x56e4('0x16')];var _0x420cd7;if(_0x38d7c5>=_0x42824a){_0x38d7c5=_0x42824a;_0x420cd7=0xc8;}else{_0x420cd7=0xce;}_0x5e808e[_0x56e4('0x12')](_0x420cd7);return _0x5e808e['set'](_0x56e4('0x18'),_0x2c805d+'-'+_0x38d7c5+'/'+_0x42824a)['json'](_0x4f1475);}return null;};}function saveUpdates(_0x226a2){return function(_0x32d180){if(_0x32d180){return _0x32d180[_0x56e4('0x19')](_0x226a2)[_0x56e4('0x7')](function(_0x494a29){return _0x494a29;});}return null;};}function removeEntity(_0x4a1fb7){return function(_0x1de8e1){if(_0x1de8e1){return _0x1de8e1[_0x56e4('0x1a')]()[_0x56e4('0x7')](function(){_0x4a1fb7[_0x56e4('0x12')](0xcc)[_0x56e4('0x1b')]();});}};}function handleEntityNotFound(_0x5236b3){return function(_0x9a30bf){if(!_0x9a30bf){_0x5236b3['sendStatus'](0x194);}return _0x9a30bf;};}function handleError(_0x29abbf,_0x7860c9){_0x7860c9=_0x7860c9||0x1f4;return function(_0x41bea7){logger[_0x56e4('0xc')](_0x41bea7[_0x56e4('0x1c')]);if(_0x41bea7[_0x56e4('0x1d')]){delete _0x41bea7['name'];}_0x29abbf[_0x56e4('0x12')](_0x7860c9)['send'](_0x41bea7);};}exports[_0x56e4('0x1e')]=function(_0x26916c,_0x5ae22b){var _0x11c0cc={},_0x549030={},_0x5e3b6a={'count':0x0,'rows':[]};var _0x37a9b5=_[_0x56e4('0x1f')](db[_0x56e4('0x20')][_0x56e4('0x21')],function(_0x5eaf8e){return{'name':_0x5eaf8e[_0x56e4('0x22')],'type':_0x5eaf8e[_0x56e4('0x23')][_0x56e4('0x24')]};});_0x549030[_0x56e4('0x25')]=_['map'](_0x37a9b5,'name');_0x549030['query']=_[_0x56e4('0x26')](_0x26916c[_0x56e4('0x27')]);_0x549030[_0x56e4('0x28')]=_[_0x56e4('0x29')](_0x549030[_0x56e4('0x25')],_0x549030[_0x56e4('0x27')]);_0x11c0cc[_0x56e4('0x2a')]=_[_0x56e4('0x29')](_0x549030[_0x56e4('0x25')],qs[_0x56e4('0x2b')](_0x26916c['query']['fields']));_0x11c0cc['attributes']=_0x11c0cc[_0x56e4('0x2a')][_0x56e4('0x2c')]?_0x11c0cc[_0x56e4('0x2a')]:_0x549030[_0x56e4('0x25')];if(!_0x26916c['query']['hasOwnProperty'](_0x56e4('0x2d'))){_0x11c0cc[_0x56e4('0x16')]=qs['limit'](_0x26916c[_0x56e4('0x27')]['limit']);_0x11c0cc[_0x56e4('0x14')]=qs[_0x56e4('0x14')](_0x26916c[_0x56e4('0x27')][_0x56e4('0x14')]);}_0x11c0cc['order']=qs[_0x56e4('0x2e')](_0x26916c[_0x56e4('0x27')][_0x56e4('0x2e')]);_0x11c0cc[_0x56e4('0x2f')]=qs[_0x56e4('0x28')](_[_0x56e4('0x30')](_0x26916c[_0x56e4('0x27')],_0x549030['filters']),_0x37a9b5);if(_0x26916c['query']['filter']){_0x11c0cc['where']=_[_0x56e4('0x31')](_0x11c0cc[_0x56e4('0x2f')],{'$or':_[_0x56e4('0x1f')](_0x37a9b5,function(_0x4c17f7){if(_0x4c17f7['type']!==_0x56e4('0x32')){var _0xcb64a={};_0xcb64a[_0x4c17f7[_0x56e4('0x1d')]]={'$like':'%'+_0x26916c['query'][_0x56e4('0x33')]+'%'};return _0xcb64a;}})});}_0x11c0cc=_[_0x56e4('0x31')]({},_0x11c0cc,_0x26916c['options']);var _0x4ba070={'where':_0x11c0cc[_0x56e4('0x2f')]};return db[_0x56e4('0x20')][_0x56e4('0x17')](_0x4ba070)[_0x56e4('0x7')](function(_0x5da415){_0x5e3b6a[_0x56e4('0x17')]=_0x5da415;if(_0x26916c[_0x56e4('0x27')][_0x56e4('0x34')]){_0x11c0cc[_0x56e4('0x35')]=[{'all':!![]}];}return db[_0x56e4('0x20')][_0x56e4('0x36')](_0x11c0cc);})['then'](function(_0x5b606c){_0x5e3b6a['rows']=_0x5b606c;return _0x5e3b6a;})[_0x56e4('0x7')](respondWithFilteredResult(_0x5ae22b,_0x11c0cc))[_0x56e4('0x37')](handleError(_0x5ae22b,null));};exports[_0x56e4('0x38')]=function(_0x5ddee5,_0x47810b){var _0x1b5d2f={'raw':!![],'where':{'id':_0x5ddee5[_0x56e4('0x39')]['id']}},_0x59126d={};_0x59126d[_0x56e4('0x25')]=_['keys'](db[_0x56e4('0x20')][_0x56e4('0x21')]);_0x59126d[_0x56e4('0x27')]=_['keys'](_0x5ddee5['query']);_0x59126d['filters']=_[_0x56e4('0x29')](_0x59126d['model'],_0x59126d['query']);_0x1b5d2f[_0x56e4('0x2a')]=_['intersection'](_0x59126d[_0x56e4('0x25')],qs[_0x56e4('0x2b')](_0x5ddee5[_0x56e4('0x27')][_0x56e4('0x2b')]));_0x1b5d2f[_0x56e4('0x2a')]=_0x1b5d2f['attributes'][_0x56e4('0x2c')]?_0x1b5d2f[_0x56e4('0x2a')]:_0x59126d[_0x56e4('0x25')];if(_0x5ddee5['query'][_0x56e4('0x34')]){_0x1b5d2f[_0x56e4('0x35')]=[{'all':!![]}];}_0x1b5d2f=_[_0x56e4('0x31')]({},_0x1b5d2f,_0x5ddee5[_0x56e4('0x3a')]);return db['Network'][_0x56e4('0x3b')](_0x1b5d2f)['then'](handleEntityNotFound(_0x47810b,null))[_0x56e4('0x7')](respondWithResult(_0x47810b,null))[_0x56e4('0x37')](handleError(_0x47810b,null));};exports['create']=function(_0x339da6,_0x34401f){var _0x57f0f9;return db[_0x56e4('0x20')][_0x56e4('0x3c')](_0x339da6['body'],{'raw':!![]})['then'](function(_0xa06c3b){_0x57f0f9=_0xa06c3b;return db['Network']['findAll']({'where':{'type':_0x339da6[_0x56e4('0x3d')]['type']},'raw':!![]});})[_0x56e4('0x7')](function(_0x5b9bff){if(_0x57f0f9[_0x56e4('0x23')][_0x56e4('0x3e')]()=='STUN'){var _0x46e2a5=fs['readFileSync'](path[_0x56e4('0x3f')](config['root'],_0x56e4('0x40')),_0x56e4('0x41'));var _0x49e992=ejs[_0x56e4('0x42')](_0x46e2a5,{'networks':_0x5b9bff||[]});fs[_0x56e4('0x43')](_0x56e4('0x44'),_0x49e992);return respondWithRpcPromise(_0x56e4('0x45'),_0x56e4('0x3c'),{'module':_0x56e4('0x46')});}else if(_0x57f0f9[_0x56e4('0x23')][_0x56e4('0x3e')]()=='TURN'){var _0xaf6bc7=fs[_0x56e4('0x47')](path[_0x56e4('0x3f')](config[_0x56e4('0x48')],_0x56e4('0x49')),_0x56e4('0x41'));var _0x3e4a4c=ejs[_0x56e4('0x42')](_0xaf6bc7,{'networks':_0x5b9bff||[]});fs[_0x56e4('0x43')](_0x56e4('0x4a'),_0x3e4a4c);return respondWithRpcPromise(_0x56e4('0x45'),_0x56e4('0x3c'),{'module':'res_stun_monitor.so'});}else{var _0x40ee11=fs[_0x56e4('0x47')](path[_0x56e4('0x3f')](config[_0x56e4('0x48')],'server/files/templates/network.ejs'),'utf8');var _0x367ec0=ejs[_0x56e4('0x42')](_0x40ee11,{'networks':_0x5b9bff||[]});fs[_0x56e4('0x43')](util[_0x56e4('0x4b')](_0x56e4('0x4c'),_0x339da6[_0x56e4('0x3d')][_0x56e4('0x23')][_0x56e4('0x4d')]()),_0x367ec0);return respondWithRpcPromise(_0x56e4('0x45'),_0x56e4('0x3c'),{'module':'chan_sip.so'});}})[_0x56e4('0x7')](function(){return _0x57f0f9;})[_0x56e4('0x7')](respondWithResult(_0x34401f,0xc9))['catch'](handleError(_0x34401f,null));};exports[_0x56e4('0x19')]=function(_0x2cf3a4,_0x2ab9ed){var _0x316825;return db[_0x56e4('0x20')][_0x56e4('0x3b')]({'where':{'id':_0x2cf3a4[_0x56e4('0x39')]['id']}})[_0x56e4('0x7')](handleEntityNotFound(_0x2ab9ed,null))['then'](saveUpdates(_0x2cf3a4[_0x56e4('0x3d')],null))[_0x56e4('0x7')](function(_0x3e82d2){if(_0x3e82d2){_0x316825=_0x3e82d2;return db[_0x56e4('0x20')][_0x56e4('0x36')]({'where':{'type':_0x316825[_0x56e4('0x23')]},'raw':!![]});}return null;})[_0x56e4('0x7')](function(_0x5b53c2){if(_0x316825[_0x56e4('0x23')][_0x56e4('0x3e')]()==_0x56e4('0x4e')){var _0x3b108d=fs[_0x56e4('0x47')](path[_0x56e4('0x3f')](config['root'],_0x56e4('0x40')),'utf8');var _0x7cb141=ejs['render'](_0x3b108d,{'networks':_0x5b53c2||[]});fs[_0x56e4('0x43')]('/etc/asterisk/stun_xcally.conf',_0x7cb141);return respondWithRpcPromise('Reload',_0x56e4('0x19'),{'module':_0x56e4('0x46')});}else if(_0x316825['type']['toUpperCase']()=='TURN'){var _0x4efd33=fs[_0x56e4('0x47')](path[_0x56e4('0x3f')](config[_0x56e4('0x48')],_0x56e4('0x49')),_0x56e4('0x41'));var _0x5845bd=ejs['render'](_0x4efd33,{'networks':_0x5b53c2||[]});fs[_0x56e4('0x43')](_0x56e4('0x4a'),_0x5845bd);return respondWithRpcPromise('Reload',_0x56e4('0x19'),{'module':_0x56e4('0x46')});}else{var _0x25a27c=fs['readFileSync'](path[_0x56e4('0x3f')](config[_0x56e4('0x48')],_0x56e4('0x4f')),_0x56e4('0x41'));var _0x2b6d2a=ejs['render'](_0x25a27c,{'networks':_0x5b53c2||[]});fs[_0x56e4('0x43')](util['format'](_0x56e4('0x4c'),_0x2cf3a4[_0x56e4('0x3d')][_0x56e4('0x23')][_0x56e4('0x4d')]()),_0x2b6d2a);return respondWithRpcPromise(_0x56e4('0x45'),_0x56e4('0x19'),{'module':_0x56e4('0x50')});}})[_0x56e4('0x7')](function(_0x44c701){if(_0x44c701){return _0x316825;}return null;})[_0x56e4('0x7')](respondWithResult(_0x2ab9ed,null))[_0x56e4('0x37')](handleError(_0x2ab9ed,null));};exports[_0x56e4('0x1a')]=function(_0xbde14a,_0x507dfe){var _0x5dfceb;return db['Network']['find']({'where':{'id':_0xbde14a[_0x56e4('0x39')]['id']}})['then'](function(_0x32363d){_0x5dfceb=_0x32363d;return _0x32363d;})[_0x56e4('0x7')](handleEntityNotFound(_0x507dfe,null))[_0x56e4('0x7')](removeEntity(_0x507dfe,null))['then'](function(){if(_0x5dfceb){return db[_0x56e4('0x20')][_0x56e4('0x36')]({'where':{'type':_0x5dfceb['type']},'raw':!![]});}})['then'](function(_0x28f623){if(_0x5dfceb[_0x56e4('0x23')][_0x56e4('0x3e')]()==_0x56e4('0x4e')){var _0x5b8279=fs['readFileSync'](path[_0x56e4('0x3f')](config[_0x56e4('0x48')],_0x56e4('0x40')),_0x56e4('0x41'));var _0x13a08b=ejs[_0x56e4('0x42')](_0x5b8279,{'networks':_0x28f623||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x13a08b);return respondWithRpcPromise(_0x56e4('0x45'),_0x56e4('0x1a'),{'module':'res_stun_monitor.so'});}else if(_0x5dfceb[_0x56e4('0x23')][_0x56e4('0x3e')]()==_0x56e4('0x51')){var _0x4b0249=fs['readFileSync'](path['join'](config[_0x56e4('0x48')],_0x56e4('0x49')),_0x56e4('0x41'));var _0x2ed31e=ejs[_0x56e4('0x42')](_0x4b0249,{'networks':_0x28f623||[]});fs[_0x56e4('0x43')](_0x56e4('0x4a'),_0x2ed31e);return respondWithRpcPromise(_0x56e4('0x45'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x1883ee=fs[_0x56e4('0x47')](path['join'](config[_0x56e4('0x48')],'server/files/templates/network.ejs'),_0x56e4('0x41'));var _0xbf8b21=ejs[_0x56e4('0x42')](_0x1883ee,{'networks':_0x28f623||[]});fs[_0x56e4('0x43')](util[_0x56e4('0x4b')](_0x56e4('0x4c'),_0x5dfceb[_0x56e4('0x23')]['toLowerCase']()),_0xbf8b21);return respondWithRpcPromise(_0x56e4('0x45'),_0x56e4('0x1a'),{'module':'chan_sip.so'});}})[_0x56e4('0x37')](handleError(_0x507dfe,null));}; \ No newline at end of file +var _0xe36b=['key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','options','includeAll','include','findAll','rows','show','params','Network','keys','merge','find','create','body','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','render','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','util','path','ejs','lodash','../../config/logger','api','../../config/environment','jayson/promise','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','json','undefined','limit','offset','count','set','Content-Range','update','destroy','name','index','map','rawAttributes','fieldName','type'];(function(_0x4156c4,_0x2df8b5){var _0xc48952=function(_0x36ae1b){while(--_0x36ae1b){_0x4156c4['push'](_0x4156c4['shift']());}};_0xc48952(++_0x2df8b5);}(_0xe36b,0x17b));var _0xbe36=function(_0x2ae7a2,_0x46ed3d){_0x2ae7a2=_0x2ae7a2-0x0;var _0x5693b6=_0xe36b[_0x2ae7a2];return _0x5693b6;};'use strict';var util=require(_0xbe36('0x0'));var path=require(_0xbe36('0x1'));var ejs=require(_0xbe36('0x2'));var fs=require('fs');var _=require(_0xbe36('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xbe36('0x4'))(_0xbe36('0x5'));var config=require(_0xbe36('0x6'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbe36('0x7'));var client=jayson['client'][_0xbe36('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4da183,_0x31427a,_0x5eb53f,_0x5d3a13){return new Promise(function(_0x30b2e7,_0x445496){var _0x32b71b=_0x5d3a13||client;return _0x32b71b['request'](_0x4da183,_0x5eb53f)[_0xbe36('0x9')](function(_0xf36405){logger[_0xbe36('0xa')](_0xbe36('0xb'),_0x31427a,_0xbe36('0xc'));logger[_0xbe36('0xd')](_0xbe36('0xe'),_0x31427a,_0xbe36('0xc'),JSON['stringify'](_0xf36405));if(_0xf36405[_0xbe36('0xf')]){if(_0xf36405[_0xbe36('0xf')][_0xbe36('0x10')]===0x1f4){logger['error'](_0xbe36('0xb'),_0x31427a,_0xf36405[_0xbe36('0xf')]['message']);return _0x445496(_0xf36405[_0xbe36('0xf')][_0xbe36('0x11')]);}logger[_0xbe36('0xf')]('Network,\x20%s,\x20%s',_0x31427a,_0xf36405[_0xbe36('0xf')][_0xbe36('0x11')]);return _0x30b2e7(_0xf36405['error'][_0xbe36('0x11')]);}else{logger[_0xbe36('0xa')](_0xbe36('0xb'),_0x31427a,_0xbe36('0xc'));_0x30b2e7(_0xf36405[_0xbe36('0x12')][_0xbe36('0x11')]);}})[_0xbe36('0x13')](function(_0x2201bd){logger['error']('Network,\x20%s,\x20%s',_0x31427a,_0x2201bd);_0x445496(_0x2201bd);});});}function respondWithResult(_0x6ad5bb,_0x22456d){_0x22456d=_0x22456d||0xc8;return function(_0x2dd0c1){if(_0x2dd0c1){return _0x6ad5bb[_0xbe36('0x14')](_0x22456d)[_0xbe36('0x15')](_0x2dd0c1);}};}function respondWithFilteredResult(_0x39370d,_0x34c5d3){return function(_0x34b1c2){if(_0x34b1c2){var _0x223ca5=typeof _0x34c5d3['offset']===_0xbe36('0x16')&&typeof _0x34c5d3[_0xbe36('0x17')]===_0xbe36('0x16');var _0x1c93fb=_0x34b1c2['count'];var _0x8325fa=_0x223ca5?0x0:_0x34c5d3[_0xbe36('0x18')];var _0xd9e2f1=_0x223ca5?_0x34b1c2[_0xbe36('0x19')]:_0x34c5d3[_0xbe36('0x18')]+_0x34c5d3[_0xbe36('0x17')];var _0x323c18;if(_0xd9e2f1>=_0x1c93fb){_0xd9e2f1=_0x1c93fb;_0x323c18=0xc8;}else{_0x323c18=0xce;}_0x39370d[_0xbe36('0x14')](_0x323c18);return _0x39370d[_0xbe36('0x1a')](_0xbe36('0x1b'),_0x8325fa+'-'+_0xd9e2f1+'/'+_0x1c93fb)[_0xbe36('0x15')](_0x34b1c2);}return null;};}function saveUpdates(_0x2a3792){return function(_0x38887c){if(_0x38887c){return _0x38887c[_0xbe36('0x1c')](_0x2a3792)[_0xbe36('0x9')](function(_0x5840b1){return _0x5840b1;});}return null;};}function removeEntity(_0x698330){return function(_0x928a45){if(_0x928a45){return _0x928a45[_0xbe36('0x1d')]()[_0xbe36('0x9')](function(){_0x698330[_0xbe36('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1fdce5){return function(_0x53446b){if(!_0x53446b){_0x1fdce5['sendStatus'](0x194);}return _0x53446b;};}function handleError(_0xa2cee6,_0x1c6d2d){_0x1c6d2d=_0x1c6d2d||0x1f4;return function(_0x547b75){logger[_0xbe36('0xf')](_0x547b75['stack']);if(_0x547b75[_0xbe36('0x1e')]){delete _0x547b75['name'];}_0xa2cee6[_0xbe36('0x14')](_0x1c6d2d)['send'](_0x547b75);};}exports[_0xbe36('0x1f')]=function(_0x47e314,_0x47b50b){var _0x2e356a={},_0x128a48={},_0x14f582={'count':0x0,'rows':[]};var _0x36c02d=_[_0xbe36('0x20')](db['Network'][_0xbe36('0x21')],function(_0x4bcbaa){return{'name':_0x4bcbaa[_0xbe36('0x22')],'type':_0x4bcbaa[_0xbe36('0x23')][_0xbe36('0x24')]};});_0x128a48[_0xbe36('0x25')]=_['map'](_0x36c02d,_0xbe36('0x1e'));_0x128a48[_0xbe36('0x26')]=_['keys'](_0x47e314['query']);_0x128a48[_0xbe36('0x27')]=_[_0xbe36('0x28')](_0x128a48[_0xbe36('0x25')],_0x128a48[_0xbe36('0x26')]);_0x2e356a[_0xbe36('0x29')]=_['intersection'](_0x128a48[_0xbe36('0x25')],qs[_0xbe36('0x2a')](_0x47e314[_0xbe36('0x26')]['fields']));_0x2e356a['attributes']=_0x2e356a[_0xbe36('0x29')][_0xbe36('0x2b')]?_0x2e356a[_0xbe36('0x29')]:_0x128a48[_0xbe36('0x25')];if(!_0x47e314['query']['hasOwnProperty'](_0xbe36('0x2c'))){_0x2e356a['limit']=qs[_0xbe36('0x17')](_0x47e314[_0xbe36('0x26')][_0xbe36('0x17')]);_0x2e356a[_0xbe36('0x18')]=qs[_0xbe36('0x18')](_0x47e314[_0xbe36('0x26')][_0xbe36('0x18')]);}_0x2e356a[_0xbe36('0x2d')]=qs[_0xbe36('0x2e')](_0x47e314[_0xbe36('0x26')]['sort']);_0x2e356a[_0xbe36('0x2f')]=qs[_0xbe36('0x27')](_['pick'](_0x47e314[_0xbe36('0x26')],_0x128a48['filters']),_0x36c02d);if(_0x47e314[_0xbe36('0x26')][_0xbe36('0x30')]){_0x2e356a[_0xbe36('0x2f')]=_['merge'](_0x2e356a[_0xbe36('0x2f')],{'$or':_['map'](_0x36c02d,function(_0x3808af){if(_0x3808af[_0xbe36('0x23')]!==_0xbe36('0x31')){var _0x40a8ec={};_0x40a8ec[_0x3808af[_0xbe36('0x1e')]]={'$like':'%'+_0x47e314[_0xbe36('0x26')][_0xbe36('0x30')]+'%'};return _0x40a8ec;}})});}_0x2e356a=_['merge']({},_0x2e356a,_0x47e314[_0xbe36('0x32')]);var _0x31513b={'where':_0x2e356a[_0xbe36('0x2f')]};return db['Network'][_0xbe36('0x19')](_0x31513b)[_0xbe36('0x9')](function(_0x2b3e96){_0x14f582[_0xbe36('0x19')]=_0x2b3e96;if(_0x47e314[_0xbe36('0x26')][_0xbe36('0x33')]){_0x2e356a[_0xbe36('0x34')]=[{'all':!![]}];}return db['Network'][_0xbe36('0x35')](_0x2e356a);})[_0xbe36('0x9')](function(_0x5a48f2){_0x14f582[_0xbe36('0x36')]=_0x5a48f2;return _0x14f582;})[_0xbe36('0x9')](respondWithFilteredResult(_0x47b50b,_0x2e356a))[_0xbe36('0x13')](handleError(_0x47b50b,null));};exports[_0xbe36('0x37')]=function(_0x529ec7,_0x42b072){var _0x1285cf={'raw':!![],'where':{'id':_0x529ec7[_0xbe36('0x38')]['id']}},_0x233598={};_0x233598[_0xbe36('0x25')]=_['keys'](db[_0xbe36('0x39')][_0xbe36('0x21')]);_0x233598[_0xbe36('0x26')]=_[_0xbe36('0x3a')](_0x529ec7[_0xbe36('0x26')]);_0x233598[_0xbe36('0x27')]=_[_0xbe36('0x28')](_0x233598[_0xbe36('0x25')],_0x233598[_0xbe36('0x26')]);_0x1285cf['attributes']=_[_0xbe36('0x28')](_0x233598[_0xbe36('0x25')],qs[_0xbe36('0x2a')](_0x529ec7[_0xbe36('0x26')][_0xbe36('0x2a')]));_0x1285cf[_0xbe36('0x29')]=_0x1285cf['attributes'][_0xbe36('0x2b')]?_0x1285cf[_0xbe36('0x29')]:_0x233598[_0xbe36('0x25')];if(_0x529ec7[_0xbe36('0x26')][_0xbe36('0x33')]){_0x1285cf['include']=[{'all':!![]}];}_0x1285cf=_[_0xbe36('0x3b')]({},_0x1285cf,_0x529ec7['options']);return db[_0xbe36('0x39')][_0xbe36('0x3c')](_0x1285cf)[_0xbe36('0x9')](handleEntityNotFound(_0x42b072,null))[_0xbe36('0x9')](respondWithResult(_0x42b072,null))[_0xbe36('0x13')](handleError(_0x42b072,null));};exports[_0xbe36('0x3d')]=function(_0x473271,_0x136f26){var _0x525e7b;return db[_0xbe36('0x39')][_0xbe36('0x3d')](_0x473271[_0xbe36('0x3e')],{'raw':!![]})[_0xbe36('0x9')](function(_0x1f837d){_0x525e7b=_0x1f837d;return db[_0xbe36('0x39')][_0xbe36('0x35')]({'where':{'type':_0x473271[_0xbe36('0x3e')][_0xbe36('0x23')]},'raw':!![]});})[_0xbe36('0x9')](function(_0x4180b2){if(_0x525e7b[_0xbe36('0x23')][_0xbe36('0x3f')]()==_0xbe36('0x40')){var _0x4ed313=fs[_0xbe36('0x41')](path[_0xbe36('0x42')](config[_0xbe36('0x43')],_0xbe36('0x44')),_0xbe36('0x45'));var _0x5b794e=ejs['render'](_0x4ed313,{'networks':_0x4180b2||[]});fs[_0xbe36('0x46')](_0xbe36('0x47'),_0x5b794e);return respondWithRpcPromise(_0xbe36('0x48'),_0xbe36('0x3d'),{'module':'res_stun_monitor.so'});}else if(_0x525e7b[_0xbe36('0x23')][_0xbe36('0x3f')]()==_0xbe36('0x49')){var _0x2c77f0=fs[_0xbe36('0x41')](path[_0xbe36('0x42')](config[_0xbe36('0x43')],_0xbe36('0x4a')),_0xbe36('0x45'));var _0x4c23f5=ejs[_0xbe36('0x4b')](_0x2c77f0,{'networks':_0x4180b2||[]});fs[_0xbe36('0x46')](_0xbe36('0x4c'),_0x4c23f5);return respondWithRpcPromise('Reload',_0xbe36('0x3d'),{'module':_0xbe36('0x4d')});}else{var _0x11fcd5=fs['readFileSync'](path[_0xbe36('0x42')](config[_0xbe36('0x43')],_0xbe36('0x4e')),_0xbe36('0x45'));var _0x150d48=ejs[_0xbe36('0x4b')](_0x11fcd5,{'networks':_0x4180b2||[]});fs['writeFileSync'](util[_0xbe36('0x4f')](_0xbe36('0x50'),_0x473271[_0xbe36('0x3e')][_0xbe36('0x23')][_0xbe36('0x51')]()),_0x150d48);return respondWithRpcPromise(_0xbe36('0x48'),_0xbe36('0x3d'),{'module':_0xbe36('0x52')});}})[_0xbe36('0x9')](function(){return _0x525e7b;})[_0xbe36('0x9')](respondWithResult(_0x136f26,0xc9))[_0xbe36('0x13')](handleError(_0x136f26,null));};exports[_0xbe36('0x1c')]=function(_0x1391bf,_0x4da0c1){var _0x23c3d4;return db[_0xbe36('0x39')][_0xbe36('0x3c')]({'where':{'id':_0x1391bf[_0xbe36('0x38')]['id']}})[_0xbe36('0x9')](handleEntityNotFound(_0x4da0c1,null))[_0xbe36('0x9')](saveUpdates(_0x1391bf[_0xbe36('0x3e')],null))[_0xbe36('0x9')](function(_0x3ab9dc){if(_0x3ab9dc){_0x23c3d4=_0x3ab9dc;return db[_0xbe36('0x39')][_0xbe36('0x35')]({'where':{'type':_0x23c3d4['type']},'raw':!![]});}return null;})[_0xbe36('0x9')](function(_0x58178a){if(_0x23c3d4[_0xbe36('0x23')][_0xbe36('0x3f')]()==_0xbe36('0x40')){var _0x2368d9=fs['readFileSync'](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0xbe36('0x45'));var _0x1d7f41=ejs[_0xbe36('0x4b')](_0x2368d9,{'networks':_0x58178a||[]});fs[_0xbe36('0x46')](_0xbe36('0x47'),_0x1d7f41);return respondWithRpcPromise(_0xbe36('0x48'),_0xbe36('0x1c'),{'module':_0xbe36('0x4d')});}else if(_0x23c3d4['type']['toUpperCase']()==_0xbe36('0x49')){var _0x58f4a9=fs[_0xbe36('0x41')](path[_0xbe36('0x42')](config[_0xbe36('0x43')],_0xbe36('0x4a')),_0xbe36('0x45'));var _0x549524=ejs['render'](_0x58f4a9,{'networks':_0x58178a||[]});fs[_0xbe36('0x46')](_0xbe36('0x4c'),_0x549524);return respondWithRpcPromise(_0xbe36('0x48'),_0xbe36('0x1c'),{'module':_0xbe36('0x4d')});}else{var _0x543f1c=fs[_0xbe36('0x41')](path[_0xbe36('0x42')](config[_0xbe36('0x43')],_0xbe36('0x4e')),_0xbe36('0x45'));var _0x145e98=ejs[_0xbe36('0x4b')](_0x543f1c,{'networks':_0x58178a||[]});fs['writeFileSync'](util[_0xbe36('0x4f')](_0xbe36('0x50'),_0x1391bf[_0xbe36('0x3e')][_0xbe36('0x23')][_0xbe36('0x51')]()),_0x145e98);return respondWithRpcPromise(_0xbe36('0x48'),'update',{'module':_0xbe36('0x52')});}})[_0xbe36('0x9')](function(_0x1701de){if(_0x1701de){return _0x23c3d4;}return null;})[_0xbe36('0x9')](respondWithResult(_0x4da0c1,null))[_0xbe36('0x13')](handleError(_0x4da0c1,null));};exports['destroy']=function(_0x505011,_0x1f1889){var _0x3b0fe5;return db[_0xbe36('0x39')]['find']({'where':{'id':_0x505011[_0xbe36('0x38')]['id']}})[_0xbe36('0x9')](function(_0x5aa550){_0x3b0fe5=_0x5aa550;return _0x5aa550;})['then'](handleEntityNotFound(_0x1f1889,null))[_0xbe36('0x9')](removeEntity(_0x1f1889,null))['then'](function(){if(_0x3b0fe5){return db[_0xbe36('0x39')][_0xbe36('0x35')]({'where':{'type':_0x3b0fe5[_0xbe36('0x23')]},'raw':!![]});}})[_0xbe36('0x9')](function(_0x1d3683){if(_0x3b0fe5['type'][_0xbe36('0x3f')]()==_0xbe36('0x40')){var _0x41d983=fs[_0xbe36('0x41')](path['join'](config['root'],_0xbe36('0x44')),_0xbe36('0x45'));var _0x2fef57=ejs[_0xbe36('0x4b')](_0x41d983,{'networks':_0x1d3683||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2fef57);return respondWithRpcPromise(_0xbe36('0x48'),'destroy',{'module':'res_stun_monitor.so'});}else if(_0x3b0fe5[_0xbe36('0x23')][_0xbe36('0x3f')]()==_0xbe36('0x49')){var _0x32484a=fs['readFileSync'](path['join'](config[_0xbe36('0x43')],_0xbe36('0x4a')),'utf8');var _0x42de95=ejs[_0xbe36('0x4b')](_0x32484a,{'networks':_0x1d3683||[]});fs[_0xbe36('0x46')](_0xbe36('0x4c'),_0x42de95);return respondWithRpcPromise(_0xbe36('0x48'),_0xbe36('0x1d'),{'module':_0xbe36('0x4d')});}else{var _0x2c1711=fs[_0xbe36('0x41')](path[_0xbe36('0x42')](config[_0xbe36('0x43')],_0xbe36('0x4e')),'utf8');var _0x60f58e=ejs['render'](_0x2c1711,{'networks':_0x1d3683||[]});fs[_0xbe36('0x46')](util[_0xbe36('0x4f')](_0xbe36('0x50'),_0x3b0fe5[_0xbe36('0x23')][_0xbe36('0x51')]()),_0x60f58e);return respondWithRpcPromise(_0xbe36('0x48'),'destroy',{'module':_0xbe36('0x52')});}})[_0xbe36('0x13')](handleError(_0x1f1889,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 2343ea3..3545c2f 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 _0xe812=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Network','network','util','../../config/logger'];(function(_0x14a862,_0x2b559d){var _0x245eb5=function(_0x6e014c){while(--_0x6e014c){_0x14a862['push'](_0x14a862['shift']());}};_0x245eb5(++_0x2b559d);}(_0xe812,0x1f2));var _0x2e81=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe812[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x2e81('0x0'));var logger=require(_0x2e81('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2e81('0x2'));var rp=require(_0x2e81('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e81('0x4'));var config=require(_0x2e81('0x5'));var attributes=require('./network.attributes');module[_0x2e81('0x6')]=function(_0x251244,_0x4f6864){return _0x251244[_0x2e81('0x7')](_0x2e81('0x8'),attributes,{'tableName':_0x2e81('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xca66=['api','moment','bluebird','path','../../config/environment','exports','define','Network','network','lodash'];(function(_0x4bc452,_0x4afdd6){var _0x307aca=function(_0x56db6b){while(--_0x56db6b){_0x4bc452['push'](_0x4bc452['shift']());}};_0x307aca(++_0x4afdd6);}(_0xca66,0x8b));var _0x6ca6=function(_0x453436,_0x57717f){_0x453436=_0x453436-0x0;var _0x26b6e3=_0xca66[_0x453436];return _0x26b6e3;};'use strict';var _=require(_0x6ca6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x6ca6('0x1'));var moment=require(_0x6ca6('0x2'));var BPromise=require(_0x6ca6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ca6('0x4'));var rimraf=require('rimraf');var config=require(_0x6ca6('0x5'));var attributes=require('./network.attributes');module[_0x6ca6('0x6')]=function(_0x27d8c6,_0x34836f){return _0x27d8c6[_0x6ca6('0x7')](_0x6ca6('0x8'),attributes,{'tableName':_0x6ca6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 79df7bd..081fc26 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2003d1,_0x3bb435){var _0x3835ae=function(_0x5b8cbf){while(--_0x5b8cbf){_0x2003d1['push'](_0x2003d1['shift']());}};_0x3835ae(++_0x3bb435);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file +var _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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x24967f,_0x563a43){_0x24967f=_0x24967f-0x0;var _0x2d638b=_0x7a54[_0x24967f];return _0x2d638b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 23a3085..ce5ab37 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 _0x4e2e=['getAgents','create','post','addDisposition','addAnswer','/:id/notify','/:id/applications','addApplications','addAgents','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users'];(function(_0x257642,_0x270a80){var _0x3d813b=function(_0x2a1c8a){while(--_0x2a1c8a){_0x257642['push'](_0x257642['shift']());}};_0x3d813b(++_0x270a80);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x2439f3,_0x58130e){_0x2439f3=_0x2439f3-0x0;var _0x21eb31=_0x4e2e[_0x2439f3];return _0x21eb31;};'use strict';var multer=require('multer');var util=require(_0xe4e2('0x0'));var path=require(_0xe4e2('0x1'));var timeout=require(_0xe4e2('0x2'));var express=require(_0xe4e2('0x3'));var router=express[_0xe4e2('0x4')]();var fs_extra=require(_0xe4e2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe4e2('0x6'));var config=require(_0xe4e2('0x7'));var controller=require(_0xe4e2('0x8'));router[_0xe4e2('0x9')]('/',auth['isAuthenticated'](),controller[_0xe4e2('0xa')]);router[_0xe4e2('0x9')](_0xe4e2('0xb'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0xd')]);router[_0xe4e2('0x9')](_0xe4e2('0xe'),auth[_0xe4e2('0xc')](),controller['show']);router[_0xe4e2('0x9')](_0xe4e2('0xf'),auth[_0xe4e2('0xc')](),controller['getDispositions']);router[_0xe4e2('0x9')](_0xe4e2('0x10'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x11')]);router[_0xe4e2('0x9')]('/:id/applications',auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x12')]);router[_0xe4e2('0x9')](_0xe4e2('0x13'),auth['isAuthenticated'](),controller[_0xe4e2('0x14')]);router[_0xe4e2('0x9')](_0xe4e2('0x15'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0xe4e2('0x17')]);router[_0xe4e2('0x18')](_0xe4e2('0xf'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x19')]);router['post'](_0xe4e2('0x10'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x1a')]);router['post'](_0xe4e2('0x1b'),controller['notify']);router[_0xe4e2('0x18')](_0xe4e2('0x1c'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x1d')]);router[_0xe4e2('0x18')](_0xe4e2('0x15'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x1e')]);router[_0xe4e2('0x18')](_0xe4e2('0x1f'),auth['isAuthenticated'](),controller[_0xe4e2('0x20')]);router[_0xe4e2('0x21')](_0xe4e2('0xe'),auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x22')]);router[_0xe4e2('0x23')](_0xe4e2('0xe'),auth['isAuthenticated'](),controller[_0xe4e2('0x24')]);router[_0xe4e2('0x23')](_0xe4e2('0xf'),auth['isAuthenticated'](),controller[_0xe4e2('0x25')]);router[_0xe4e2('0x23')]('/:id/canned_answers',auth[_0xe4e2('0xc')](),controller[_0xe4e2('0x26')]);router[_0xe4e2('0x23')](_0xe4e2('0x15'),auth[_0xe4e2('0xc')](),controller['removeAgents']);module[_0xe4e2('0x27')]=router; \ No newline at end of file +var _0x4bd3=['connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','/:id/dispositions','addDisposition','post','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','put','update','delete','removeDispositions','removeAnswers','exports','multer','path'];(function(_0x3059aa,_0x400a77){var _0x4cca35=function(_0x44eac8){while(--_0x44eac8){_0x3059aa['push'](_0x3059aa['shift']());}};_0x4cca35(++_0x400a77);}(_0x4bd3,0x174));var _0x34bd=function(_0x444a75,_0x37960d){_0x444a75=_0x444a75-0x0;var _0x24d071=_0x4bd3[_0x444a75];return _0x24d071;};'use strict';var multer=require(_0x34bd('0x0'));var util=require('util');var path=require(_0x34bd('0x1'));var timeout=require(_0x34bd('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x34bd('0x3'));var interaction=require(_0x34bd('0x4'));var config=require(_0x34bd('0x5'));var controller=require('./openchannelAccount.controller');router[_0x34bd('0x6')]('/',auth[_0x34bd('0x7')](),controller['index']);router[_0x34bd('0x6')](_0x34bd('0x8'),auth['isAuthenticated'](),controller[_0x34bd('0x9')]);router[_0x34bd('0x6')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0xb')]);router[_0x34bd('0x6')]('/:id/dispositions',auth[_0x34bd('0x7')](),controller[_0x34bd('0xc')]);router[_0x34bd('0x6')](_0x34bd('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x34bd('0x6')]('/:id/applications',auth['isAuthenticated'](),controller[_0x34bd('0xe')]);router[_0x34bd('0x6')](_0x34bd('0xf'),auth[_0x34bd('0x7')](),controller[_0x34bd('0x10')]);router[_0x34bd('0x6')](_0x34bd('0x11'),auth[_0x34bd('0x7')](),controller[_0x34bd('0x12')]);router['post']('/',auth[_0x34bd('0x7')](),controller['create']);router['post'](_0x34bd('0x13'),auth[_0x34bd('0x7')](),controller[_0x34bd('0x14')]);router[_0x34bd('0x15')](_0x34bd('0xd'),auth[_0x34bd('0x7')](),controller[_0x34bd('0x16')]);router[_0x34bd('0x15')](_0x34bd('0x17'),controller[_0x34bd('0x18')]);router[_0x34bd('0x15')]('/:id/applications',auth[_0x34bd('0x7')](),controller[_0x34bd('0x19')]);router[_0x34bd('0x15')](_0x34bd('0x11'),auth[_0x34bd('0x7')](),controller[_0x34bd('0x1a')]);router[_0x34bd('0x15')](_0x34bd('0x1b'),auth[_0x34bd('0x7')](),controller['send']);router[_0x34bd('0x1c')](_0x34bd('0xa'),auth[_0x34bd('0x7')](),controller[_0x34bd('0x1d')]);router[_0x34bd('0x1e')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x34bd('0x13'),auth['isAuthenticated'](),controller[_0x34bd('0x1f')]);router[_0x34bd('0x1e')](_0x34bd('0xd'),auth['isAuthenticated'](),controller[_0x34bd('0x20')]);router[_0x34bd('0x1e')](_0x34bd('0x11'),auth[_0x34bd('0x7')](),controller['removeAgents']);module[_0x34bd('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 0c98cf0..acc6e84 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 _0xa9d3=['mandatoryDispositionPauseId','sequelize','exports','STRING','name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xa9d3,0x1d5));var _0x3a9d=function(_0x271781,_0x112f74){_0x271781=_0x271781-0x0;var _0xb8ecc8=_0xa9d3[_0x271781];return _0xb8ecc8;};'use strict';var Sequelize=require(_0x3a9d('0x0'));var rs=require('randomstring');module[_0x3a9d('0x1')]={'name':{'type':Sequelize[_0x3a9d('0x2')],'unique':_0x3a9d('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3a9d('0x2')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0x3a9d('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3a9d('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3a9d('0x4')],'defaultValue':function(){return _0x3a9d('0x5');}},'notificationSound':{'type':Sequelize[_0x3a9d('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3a9d('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3a9d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3a9d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x3a9d('0x2')]},'queueTransfer':{'type':Sequelize[_0x3a9d('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3a9d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3a9d('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3a9d('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x3a9d('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3a9d('0x9'),'set':function(_0x2a6d24){if(!_0x2a6d24)this[_0x3a9d('0xa')](_0x3a9d('0xb'),null);this[_0x3a9d('0xa')]('mandatoryDisposition',_0x2a6d24);}}}; \ No newline at end of file +var _0xb442=['STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','name'];(function(_0x26acf6,_0x14316){var _0x28fc93=function(_0x151eb6){while(--_0x151eb6){_0x26acf6['push'](_0x26acf6['shift']());}};_0x28fc93(++_0x14316);}(_0xb442,0x1e8));var _0x2b44=function(_0x24079b,_0x473683){_0x24079b=_0x24079b-0x0;var _0x40276d=_0xb442[_0x24079b];return _0x40276d;};'use strict';var Sequelize=require(_0x2b44('0x0'));var rs=require(_0x2b44('0x1'));module[_0x2b44('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0x2b44('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x2b44('0x4')]},'token':{'type':Sequelize[_0x2b44('0x4')],'defaultValue':function(){return rs[_0x2b44('0x5')]();}},'replyUri':{'type':Sequelize[_0x2b44('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x2b44('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x2b44('0x6');}},'notificationSound':{'type':Sequelize[_0x2b44('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2b44('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2b44('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2b44('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x2b44('0x4')]},'queueTransfer':{'type':Sequelize[_0x2b44('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2b44('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2b44('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2b44('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2b44('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x2b44('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x2b44('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5b1108){if(!_0x5b1108)this[_0x2b44('0xa')]('mandatoryDispositionPauseId',null);this[_0x2b44('0xa')](_0x2b44('0xb'),_0x5b1108);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index cc9ffb7..b82ba65 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 _0xd8a5=['end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','OpenchannelAccounts','UserProfileResource','destroy','stack','send','index','map','OpenchannelAccount','rawAttributes','fieldName','type','model','name','keys','query','filters','intersection','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','findAll','catch','show','params','fields','length','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','mandatoryDispositionPause','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','findOne','pick','rows','removeDispositions','addAnswer','CannedAnswer','include','removeAnswers','ids','openchannel','CmContact','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','account','applications','Applications','list','orderBy','priority','asc','contact','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','firstName','lastName','messageId','interaction','created','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','OpenchannelQueue','queueId','Start','EventManager','notify','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','sendStatus','getApplications','getInteractions','Contact','Owner','fullname','Tag','Tags','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5b47e6,_0x3f23e8){var _0x258713=function(_0x389af7){while(--_0x389af7){_0x5b47e6['push'](_0x5b47e6['shift']());}};_0x258713(++_0x3f23e8);}(_0xd8a5,0x160));var _0x5d8a=function(_0x2279a8,_0x1dbf77){_0x2279a8=_0x2279a8-0x0;var _0x1d1cfe=_0xd8a5[_0x2279a8];return _0x1d1cfe;};'use strict';var emlformat=require(_0x5d8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d8a('0x1'));var jsonpatch=require(_0x5d8a('0x2'));var rp=require('request-promise');var moment=require(_0x5d8a('0x3'));var BPromise=require(_0x5d8a('0x4'));var Mustache=require(_0x5d8a('0x5'));var util=require(_0x5d8a('0x6'));var path=require(_0x5d8a('0x7'));var sox=require(_0x5d8a('0x8'));var csv=require(_0x5d8a('0x9'));var ejs=require(_0x5d8a('0xa'));var fs=require('fs');var fs_extra=require(_0x5d8a('0xb'));var _=require(_0x5d8a('0xc'));var squel=require(_0x5d8a('0xd'));var crypto=require(_0x5d8a('0xe'));var jsforce=require(_0x5d8a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5d8a('0x9'));var querystring=require(_0x5d8a('0x10'));var Papa=require(_0x5d8a('0x11'));var Redis=require(_0x5d8a('0x12'));var authService=require(_0x5d8a('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5d8a('0x14'));var hardwareService=require(_0x5d8a('0x15'));var logger=require(_0x5d8a('0x16'))(_0x5d8a('0x17'));var utils=require('../../config/utils');var config=require(_0x5d8a('0x18'));var licenseUtil=require(_0x5d8a('0x19'));var db=require('../../mysqldb')['db'];config[_0x5d8a('0x1a')]=_[_0x5d8a('0x1b')](config[_0x5d8a('0x1a')],{'host':_0x5d8a('0x1c'),'port':0x18eb});var socket=require(_0x5d8a('0x1d'))(new Redis(config[_0x5d8a('0x1a')]));require(_0x5d8a('0x1e'))[_0x5d8a('0x1f')](socket);var jayson=require(_0x5d8a('0x20'));var client=jayson[_0x5d8a('0x21')][_0x5d8a('0x22')]({'port':0x232c});var client9002=jayson[_0x5d8a('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d45e7,_0x39a1b8,_0x1567e0,_0x596ab7){return new BPromise(function(_0x3d3505,_0x119d08){var _0x341262=_0x596ab7||client;return _0x341262[_0x5d8a('0x23')](_0x4d45e7,_0x1567e0)['then'](function(_0x16ff4e){logger['info'](_0x5d8a('0x24'),_0x39a1b8,_0x5d8a('0x25'));logger[_0x5d8a('0x26')](_0x5d8a('0x27'),_0x39a1b8,_0x5d8a('0x25'),JSON[_0x5d8a('0x28')](_0x16ff4e));if(_0x16ff4e[_0x5d8a('0x29')]){if(_0x16ff4e['error'][_0x5d8a('0x2a')]===0x1f4){logger[_0x5d8a('0x29')](_0x5d8a('0x24'),_0x39a1b8,_0x16ff4e[_0x5d8a('0x29')]['message']);return _0x119d08(_0x16ff4e[_0x5d8a('0x29')][_0x5d8a('0x2b')]);}logger[_0x5d8a('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x39a1b8,_0x16ff4e[_0x5d8a('0x29')][_0x5d8a('0x2b')]);return _0x3d3505(_0x16ff4e[_0x5d8a('0x29')][_0x5d8a('0x2b')]);}else{logger['info'](_0x5d8a('0x24'),_0x39a1b8,_0x5d8a('0x25'));_0x3d3505(_0x16ff4e['result'][_0x5d8a('0x2b')]);}})['catch'](function(_0x194b9e){logger[_0x5d8a('0x29')](_0x5d8a('0x24'),_0x39a1b8,_0x194b9e);_0x119d08(_0x194b9e);});});}function respondWithStatusCode(_0x564636,_0x3ce436){_0x3ce436=_0x3ce436||0xcc;return function(_0x397b33){if(_0x397b33){return _0x564636['sendStatus'](_0x3ce436);}return _0x564636['status'](_0x3ce436)[_0x5d8a('0x2c')]();};}function respondWithResult(_0x189617,_0x20fae2){_0x20fae2=_0x20fae2||0xc8;return function(_0x50660e){if(_0x50660e){return _0x189617[_0x5d8a('0x2d')](_0x20fae2)[_0x5d8a('0x2e')](_0x50660e);}};}function respondWithFilteredResult(_0x4e4c43,_0x1a4a47){return function(_0x31589e){if(_0x31589e){var _0x1be0ce=typeof _0x1a4a47[_0x5d8a('0x2f')]===_0x5d8a('0x30')&&typeof _0x1a4a47['limit']===_0x5d8a('0x30');var _0x13c112=_0x31589e[_0x5d8a('0x31')];var _0x1b1d4b=_0x1be0ce?0x0:_0x1a4a47[_0x5d8a('0x2f')];var _0x1e6ab5=_0x1be0ce?_0x31589e[_0x5d8a('0x31')]:_0x1a4a47[_0x5d8a('0x2f')]+_0x1a4a47['limit'];var _0x1b06cf;if(_0x1e6ab5>=_0x13c112){_0x1e6ab5=_0x13c112;_0x1b06cf=0xc8;}else{_0x1b06cf=0xce;}_0x4e4c43[_0x5d8a('0x2d')](_0x1b06cf);return _0x4e4c43[_0x5d8a('0x32')](_0x5d8a('0x33'),_0x1b1d4b+'-'+_0x1e6ab5+'/'+_0x13c112)[_0x5d8a('0x2e')](_0x31589e);}return null;};}function patchUpdates(_0x2c0761){return function(_0x143e5d){try{jsonpatch[_0x5d8a('0x34')](_0x143e5d,_0x2c0761,!![]);}catch(_0x310709){return BPromise[_0x5d8a('0x35')](_0x310709);}return _0x143e5d[_0x5d8a('0x36')]();};}function saveUpdates(_0x190ff1,_0x566af4){return function(_0x2cf742){if(_0x2cf742){return _0x2cf742[_0x5d8a('0x37')](_0x190ff1)[_0x5d8a('0x38')](function(_0x527ce2){return _0x527ce2;});}return null;};}function removeEntity(_0x3d6b9c,_0x592743){return function(_0x104138){if(_0x104138){return _0x104138['destroy']()['then'](function(){var _0x440c35=_0x104138['get']({'plain':!![]});var _0x558742=_0x5d8a('0x39');return db[_0x5d8a('0x3a')][_0x5d8a('0x3b')]({'where':{'type':_0x558742,'resourceId':_0x440c35['id']}})[_0x5d8a('0x38')](function(){return _0x104138;});})[_0x5d8a('0x38')](function(){_0x3d6b9c[_0x5d8a('0x2d')](0xcc)[_0x5d8a('0x2c')]();});}};}function handleEntityNotFound(_0x18854b,_0x259b6b){return function(_0x5cb9b4){if(!_0x5cb9b4){_0x18854b['sendStatus'](0x194);}return _0x5cb9b4;};}function handleError(_0x5a171e,_0x32ce25){_0x32ce25=_0x32ce25||0x1f4;return function(_0x1d1c7a){logger[_0x5d8a('0x29')](_0x1d1c7a[_0x5d8a('0x3c')]);if(_0x1d1c7a['name']){delete _0x1d1c7a['name'];}_0x5a171e[_0x5d8a('0x2d')](_0x32ce25)[_0x5d8a('0x3d')](_0x1d1c7a);};}exports[_0x5d8a('0x3e')]=function(_0x2a5293,_0x31771e){var _0x259095={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x320263={},_0x4d9383={'count':0x0,'rows':[]};var _0x46ad3a=_[_0x5d8a('0x3f')](db[_0x5d8a('0x40')][_0x5d8a('0x41')],function(_0x3285a0){return{'name':_0x3285a0[_0x5d8a('0x42')],'type':_0x3285a0[_0x5d8a('0x43')]['key']};});_0x320263[_0x5d8a('0x44')]=_[_0x5d8a('0x3f')](_0x46ad3a,_0x5d8a('0x45'));_0x320263['query']=_[_0x5d8a('0x46')](_0x2a5293[_0x5d8a('0x47')]);_0x320263[_0x5d8a('0x48')]=_[_0x5d8a('0x49')](_0x320263['model'],_0x320263['query']);_0x259095[_0x5d8a('0x4a')]=_[_0x5d8a('0x49')](_0x320263[_0x5d8a('0x44')],qs['fields'](_0x2a5293[_0x5d8a('0x47')]['fields']));_0x259095[_0x5d8a('0x4a')]=_0x259095[_0x5d8a('0x4a')]['length']?_0x259095['attributes']:_0x320263[_0x5d8a('0x44')];if(!_0x2a5293[_0x5d8a('0x47')][_0x5d8a('0x4b')](_0x5d8a('0x4c'))){_0x259095[_0x5d8a('0x4d')]=qs[_0x5d8a('0x4d')](_0x2a5293[_0x5d8a('0x47')][_0x5d8a('0x4d')]);_0x259095[_0x5d8a('0x2f')]=qs[_0x5d8a('0x2f')](_0x2a5293[_0x5d8a('0x47')]['offset']);}_0x259095[_0x5d8a('0x4e')]=qs[_0x5d8a('0x4f')](_0x2a5293[_0x5d8a('0x47')][_0x5d8a('0x4f')]);_0x259095[_0x5d8a('0x50')]=qs[_0x5d8a('0x48')](_['pick'](_0x2a5293['query'],_0x320263[_0x5d8a('0x48')]),_0x46ad3a);if(_0x2a5293[_0x5d8a('0x47')][_0x5d8a('0x51')]){_0x259095[_0x5d8a('0x50')]=_[_0x5d8a('0x52')](_0x259095[_0x5d8a('0x50')],{'$or':_[_0x5d8a('0x3f')](_0x46ad3a,function(_0x362a90){if(_0x362a90['type']!==_0x5d8a('0x53')){var _0x57744f={};_0x57744f[_0x362a90['name']]={'$like':'%'+_0x2a5293[_0x5d8a('0x47')]['filter']+'%'};return _0x57744f;}})});}_0x259095=_[_0x5d8a('0x52')]({},_0x259095,_0x2a5293[_0x5d8a('0x54')]);var _0xcc48d9={'where':_0x259095[_0x5d8a('0x50')]};return db['OpenchannelAccount']['count'](_0xcc48d9)[_0x5d8a('0x38')](function(_0x2e71b1){_0x4d9383['count']=_0x2e71b1;if(_0x2a5293[_0x5d8a('0x47')]['includeAll']){_0x259095['include']=[{'all':!![]}];}return db[_0x5d8a('0x40')][_0x5d8a('0x55')](_0x259095);})[_0x5d8a('0x38')](function(_0x38b1fe){_0x4d9383['rows']=_0x38b1fe;return _0x4d9383;})[_0x5d8a('0x38')](respondWithFilteredResult(_0x31771e,_0x259095))[_0x5d8a('0x56')](handleError(_0x31771e,null));};exports[_0x5d8a('0x57')]=function(_0x3543c2,_0x49aa96){var _0x419bd3={'raw':![],'where':{'id':_0x3543c2[_0x5d8a('0x58')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x3ba08f={};_0x3ba08f[_0x5d8a('0x44')]=_['keys'](db['OpenchannelAccount'][_0x5d8a('0x41')]);_0x3ba08f[_0x5d8a('0x47')]=_['keys'](_0x3543c2['query']);_0x3ba08f[_0x5d8a('0x48')]=_['intersection'](_0x3ba08f[_0x5d8a('0x44')],_0x3ba08f['query']);_0x419bd3[_0x5d8a('0x4a')]=_[_0x5d8a('0x49')](_0x3ba08f[_0x5d8a('0x44')],qs[_0x5d8a('0x59')](_0x3543c2[_0x5d8a('0x47')][_0x5d8a('0x59')]));_0x419bd3[_0x5d8a('0x4a')]=_0x419bd3['attributes'][_0x5d8a('0x5a')]?_0x419bd3[_0x5d8a('0x4a')]:_0x3ba08f[_0x5d8a('0x44')];if(_0x3543c2[_0x5d8a('0x47')][_0x5d8a('0x5b')]){_0x419bd3['include']=[{'all':!![]}];}_0x419bd3=_[_0x5d8a('0x52')]({},_0x419bd3,_0x3543c2['options']);return db[_0x5d8a('0x40')]['find'](_0x419bd3)[_0x5d8a('0x38')](handleEntityNotFound(_0x49aa96,null))['then'](respondWithResult(_0x49aa96,null))[_0x5d8a('0x56')](handleError(_0x49aa96,null));};exports[_0x5d8a('0x5c')]=function(_0x38bed5,_0x36ce36){return db[_0x5d8a('0x40')][_0x5d8a('0x5c')](_0x38bed5[_0x5d8a('0x5d')],{})[_0x5d8a('0x38')](function(_0x1895d2){var _0x34adda=_0x38bed5[_0x5d8a('0x5e')][_0x5d8a('0x5f')]({'plain':!![]});if(!_0x34adda)throw new Error(_0x5d8a('0x60'));if(_0x34adda[_0x5d8a('0x61')]===_0x5d8a('0x5e')){var _0x5b7928=_0x1895d2[_0x5d8a('0x5f')]({'plain':!![]});var _0x644160=_0x5d8a('0x39');return db[_0x5d8a('0x62')][_0x5d8a('0x63')]({'where':{'name':_0x644160,'userProfileId':_0x34adda[_0x5d8a('0x64')]},'raw':!![]})[_0x5d8a('0x38')](function(_0x5accc6){if(_0x5accc6&&_0x5accc6['autoAssociation']===0x0){return db[_0x5d8a('0x3a')][_0x5d8a('0x5c')]({'name':_0x5b7928[_0x5d8a('0x45')],'resourceId':_0x5b7928['id'],'type':_0x5accc6['name'],'sectionId':_0x5accc6['id']},{})[_0x5d8a('0x38')](function(){return _0x1895d2;});}else{return _0x1895d2;}})[_0x5d8a('0x56')](function(_0x3a3a35){logger[_0x5d8a('0x29')](_0x5d8a('0x65'),_0x3a3a35);throw _0x3a3a35;});}return _0x1895d2;})['then'](respondWithResult(_0x36ce36,0xc9))[_0x5d8a('0x56')](handleError(_0x36ce36,null));};exports['update']=function(_0x4bea17,_0x40114b){if(_0x4bea17[_0x5d8a('0x5d')]['id']){delete _0x4bea17[_0x5d8a('0x5d')]['id'];}return db[_0x5d8a('0x40')][_0x5d8a('0x63')]({'where':{'id':_0x4bea17['params']['id']},'include':[{'model':db[_0x5d8a('0x66')],'as':_0x5d8a('0x67')}]})['then'](handleEntityNotFound(_0x40114b,null))[_0x5d8a('0x38')](saveUpdates(_0x4bea17['body'],null))['then'](respondWithResult(_0x40114b,null))['catch'](handleError(_0x40114b,null));};exports[_0x5d8a('0x3b')]=function(_0x5b5763,_0x142da8){return db[_0x5d8a('0x40')][_0x5d8a('0x63')]({'where':{'id':_0x5b5763[_0x5d8a('0x58')]['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x142da8,null))['then'](removeEntity(_0x142da8,null))[_0x5d8a('0x56')](handleError(_0x142da8,null));};exports[_0x5d8a('0x68')]=function(_0x1dce70,_0x1e9218){return db['OpenchannelAccount'][_0x5d8a('0x68')]()[_0x5d8a('0x38')](respondWithResult(_0x1e9218,null))[_0x5d8a('0x56')](handleError(_0x1e9218,null));};exports[_0x5d8a('0x69')]=function(_0x1f29f0,_0x3fd478,_0x1e4b50){if(_0x1f29f0['body']['id']){delete _0x1f29f0[_0x5d8a('0x5d')]['id'];}return db[_0x5d8a('0x40')]['find']({'where':{'id':_0x1f29f0['params']['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x3fd478,null))[_0x5d8a('0x38')](function(_0x30cde0){if(_0x30cde0){_0x1f29f0[_0x5d8a('0x5d')][_0x5d8a('0x6a')]=_0x30cde0['id'];return db[_0x5d8a('0x6b')][_0x5d8a('0x5c')](_0x1f29f0[_0x5d8a('0x5d')]);}})[_0x5d8a('0x38')](respondWithResult(_0x3fd478,null))[_0x5d8a('0x56')](handleError(_0x3fd478,null));};exports[_0x5d8a('0x6c')]=function(_0x4520f0,_0x11baf5,_0x5d7a25){var _0x39fe7a={'raw':![],'where':{}};var _0x2e02ea={};var _0x1845e4={'count':0x0,'rows':[]};return db[_0x5d8a('0x40')][_0x5d8a('0x6d')]({'where':{'id':_0x4520f0['params']['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x11baf5,null))[_0x5d8a('0x38')](function(_0x3fe28c){if(_0x3fe28c){_0x2e02ea['model']=_[_0x5d8a('0x46')](db[_0x5d8a('0x6b')][_0x5d8a('0x41')]);_0x2e02ea[_0x5d8a('0x47')]=_[_0x5d8a('0x46')](_0x4520f0[_0x5d8a('0x47')]);_0x2e02ea[_0x5d8a('0x48')]=_['intersection'](_0x2e02ea[_0x5d8a('0x44')],_0x2e02ea[_0x5d8a('0x47')]);_0x39fe7a[_0x5d8a('0x4a')]=_['intersection'](_0x2e02ea[_0x5d8a('0x44')],qs[_0x5d8a('0x59')](_0x4520f0[_0x5d8a('0x47')][_0x5d8a('0x59')]));_0x39fe7a[_0x5d8a('0x4a')]=_0x39fe7a['attributes'][_0x5d8a('0x5a')]?_0x39fe7a[_0x5d8a('0x4a')]:_0x2e02ea[_0x5d8a('0x44')];if(!_0x4520f0[_0x5d8a('0x47')][_0x5d8a('0x4b')](_0x5d8a('0x4c'))){_0x39fe7a['limit']=qs[_0x5d8a('0x4d')](_0x4520f0['query'][_0x5d8a('0x4d')]);_0x39fe7a[_0x5d8a('0x2f')]=qs['offset'](_0x4520f0[_0x5d8a('0x47')][_0x5d8a('0x2f')]);}_0x39fe7a['order']=qs['sort'](_0x4520f0[_0x5d8a('0x47')][_0x5d8a('0x4f')]);_0x39fe7a['where']=qs[_0x5d8a('0x48')](_[_0x5d8a('0x6e')](_0x4520f0[_0x5d8a('0x47')],_0x2e02ea[_0x5d8a('0x48')]));_0x39fe7a['where']['OpenchannelAccountId']=_0x3fe28c['id'];if(_0x4520f0[_0x5d8a('0x47')][_0x5d8a('0x51')]){_0x39fe7a[_0x5d8a('0x50')]=_[_0x5d8a('0x52')](_0x39fe7a[_0x5d8a('0x50')],{'$or':_[_0x5d8a('0x3f')](_0x39fe7a[_0x5d8a('0x4a')],function(_0x2c58d5){var _0xccf434={};_0xccf434[_0x2c58d5]={'$like':'%'+_0x4520f0[_0x5d8a('0x47')][_0x5d8a('0x51')]+'%'};return _0xccf434;})});}_0x39fe7a=_[_0x5d8a('0x52')]({},_0x39fe7a,_0x4520f0[_0x5d8a('0x54')]);return db['Disposition'][_0x5d8a('0x31')]({'where':_0x39fe7a[_0x5d8a('0x50')]})[_0x5d8a('0x38')](function(_0x27c913){_0x1845e4[_0x5d8a('0x31')]=_0x27c913;if(_0x4520f0['query'][_0x5d8a('0x5b')]){_0x39fe7a['include']=[{'all':!![]}];}return db[_0x5d8a('0x6b')][_0x5d8a('0x55')](_0x39fe7a);})['then'](function(_0x4f69fe){_0x1845e4[_0x5d8a('0x6f')]=_0x4f69fe;return _0x1845e4;});}})[_0x5d8a('0x38')](respondWithFilteredResult(_0x11baf5,_0x39fe7a))['catch'](handleError(_0x11baf5,null));};exports['removeDispositions']=function(_0x3e4a8d,_0x5cdcc6,_0x4ba1f2){return db[_0x5d8a('0x40')]['find']({'where':{'id':_0x3e4a8d[_0x5d8a('0x58')]['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x5cdcc6,null))[_0x5d8a('0x38')](function(_0x48826c){if(_0x48826c){return _0x48826c[_0x5d8a('0x70')](_0x3e4a8d[_0x5d8a('0x47')]['ids']);}})['then'](respondWithStatusCode(_0x5cdcc6,null))[_0x5d8a('0x56')](handleError(_0x5cdcc6,null));};exports[_0x5d8a('0x71')]=function(_0x11e1ce,_0x3dffb0,_0x3d4e49){if(_0x11e1ce['body']['id']){delete _0x11e1ce[_0x5d8a('0x5d')]['id'];}return db[_0x5d8a('0x40')][_0x5d8a('0x63')]({'where':{'id':_0x11e1ce[_0x5d8a('0x58')]['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x3dffb0,null))['then'](function(_0x2a5df9){if(_0x2a5df9){_0x11e1ce[_0x5d8a('0x5d')][_0x5d8a('0x6a')]=_0x2a5df9['id'];return db[_0x5d8a('0x72')][_0x5d8a('0x5c')](_0x11e1ce['body']);}})[_0x5d8a('0x38')](respondWithResult(_0x3dffb0,null))[_0x5d8a('0x56')](handleError(_0x3dffb0,null));};exports['getAnswers']=function(_0x5e89bc,_0x564bf2,_0x36d65c){var _0x192e61={'raw':![],'where':{}};var _0x456a7d={};var _0x1eb8c8={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x5d8a('0x6d')]({'where':{'id':_0x5e89bc[_0x5d8a('0x58')]['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x564bf2,null))['then'](function(_0x37cb95){if(_0x37cb95){_0x456a7d[_0x5d8a('0x44')]=_['keys'](db[_0x5d8a('0x72')][_0x5d8a('0x41')]);_0x456a7d[_0x5d8a('0x47')]=_[_0x5d8a('0x46')](_0x5e89bc[_0x5d8a('0x47')]);_0x456a7d['filters']=_['intersection'](_0x456a7d[_0x5d8a('0x44')],_0x456a7d[_0x5d8a('0x47')]);_0x192e61[_0x5d8a('0x4a')]=_[_0x5d8a('0x49')](_0x456a7d[_0x5d8a('0x44')],qs['fields'](_0x5e89bc[_0x5d8a('0x47')][_0x5d8a('0x59')]));_0x192e61[_0x5d8a('0x4a')]=_0x192e61[_0x5d8a('0x4a')][_0x5d8a('0x5a')]?_0x192e61['attributes']:_0x456a7d[_0x5d8a('0x44')];if(!_0x5e89bc[_0x5d8a('0x47')][_0x5d8a('0x4b')]('nolimit')){_0x192e61[_0x5d8a('0x4d')]=qs[_0x5d8a('0x4d')](_0x5e89bc[_0x5d8a('0x47')][_0x5d8a('0x4d')]);_0x192e61[_0x5d8a('0x2f')]=qs[_0x5d8a('0x2f')](_0x5e89bc[_0x5d8a('0x47')][_0x5d8a('0x2f')]);}_0x192e61['order']=qs[_0x5d8a('0x4f')](_0x5e89bc[_0x5d8a('0x47')][_0x5d8a('0x4f')]);_0x192e61[_0x5d8a('0x50')]=qs['filters'](_['pick'](_0x5e89bc[_0x5d8a('0x47')],_0x456a7d['filters']));_0x192e61['where'][_0x5d8a('0x6a')]=_0x37cb95['id'];if(_0x5e89bc['query'][_0x5d8a('0x51')]){_0x192e61[_0x5d8a('0x50')]=_[_0x5d8a('0x52')](_0x192e61[_0x5d8a('0x50')],{'$or':_['map'](_0x192e61['attributes'],function(_0x21ac82){var _0xa5b3e1={};_0xa5b3e1[_0x21ac82]={'$like':'%'+_0x5e89bc[_0x5d8a('0x47')]['filter']+'%'};return _0xa5b3e1;})});}_0x192e61=_[_0x5d8a('0x52')]({},_0x192e61,_0x5e89bc[_0x5d8a('0x54')]);return db['CannedAnswer'][_0x5d8a('0x31')]({'where':_0x192e61[_0x5d8a('0x50')]})[_0x5d8a('0x38')](function(_0x535cc6){_0x1eb8c8[_0x5d8a('0x31')]=_0x535cc6;if(_0x5e89bc['query']['includeAll']){_0x192e61[_0x5d8a('0x73')]=[{'all':!![]}];}return db[_0x5d8a('0x72')][_0x5d8a('0x55')](_0x192e61);})[_0x5d8a('0x38')](function(_0x44ee97){_0x1eb8c8[_0x5d8a('0x6f')]=_0x44ee97;return _0x1eb8c8;});}})[_0x5d8a('0x38')](respondWithFilteredResult(_0x564bf2,_0x192e61))[_0x5d8a('0x56')](handleError(_0x564bf2,null));};exports[_0x5d8a('0x74')]=function(_0x28077c,_0x40fcc8,_0x38d49d){return db['OpenchannelAccount'][_0x5d8a('0x63')]({'where':{'id':_0x28077c[_0x5d8a('0x58')]['id']}})['then'](handleEntityNotFound(_0x40fcc8,null))['then'](function(_0x48b421){if(_0x48b421){return _0x48b421['removeAnswers'](_0x28077c[_0x5d8a('0x47')][_0x5d8a('0x75')]);}})[_0x5d8a('0x38')](respondWithStatusCode(_0x40fcc8,null))['catch'](handleError(_0x40fcc8,null));};exports['notify']=function(_0x182d49,_0xe0964f,_0x157a3d){var _0x1cfdd8={'body':_0x182d49['body'],'channel':_0x5d8a('0x76')};var _0x433495=[];var _0x4addbd=[];var _0x13ef6c={};var _0x474e95=![];return db[_0x5d8a('0x77')][_0x5d8a('0x68')]()[_0x5d8a('0x38')](function(_0x5cec4f){if(!_0x5cec4f){throw new db[(_0x5d8a('0x78'))]['ValidationError'](_0x5d8a('0x79'));}_0x433495=_['difference'](_[_0x5d8a('0x46')](_0x5cec4f),[_0x5d8a('0x7a'),_0x5d8a('0x7b')]);_0x4addbd=_['difference'](_['keys'](_0x5cec4f),[_0x5d8a('0x7a'),_0x5d8a('0x7b'),_0x5d8a('0x7c'),_0x5d8a('0x7d')]);if(_0x182d49[_0x5d8a('0x5d')]['id']){delete _0x182d49[_0x5d8a('0x5d')]['id'];}if(_[_0x5d8a('0x7e')](_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x7f')])){throw new db[(_0x5d8a('0x78'))][(_0x5d8a('0x80'))]('from\x20is\x20mandatory');}if(_[_0x5d8a('0x7e')](_0x182d49[_0x5d8a('0x5d')]['body'])||_0x182d49['body'][_0x5d8a('0x5d')]===''){throw new db['Sequelize']['ValidationError'](_0x5d8a('0x81'));}if(_[_0x5d8a('0x7e')](_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x82')])){throw new db['Sequelize'][(_0x5d8a('0x80'))](_0x5d8a('0x83')+_0x4addbd);}if(!_[_0x5d8a('0x84')](_0x4addbd,_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x82')])){throw new db[(_0x5d8a('0x78'))][(_0x5d8a('0x80'))](_0x5d8a('0x85')+_0x4addbd);}_0x13ef6c[_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x82')]]=_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x7f')];})[_0x5d8a('0x38')](function(){return db[_0x5d8a('0x40')][_0x5d8a('0x63')]({'where':{'id':_0x182d49[_0x5d8a('0x58')]['id']},'include':[{'model':db[_0x5d8a('0x86')],'as':_0x5d8a('0x87'),'include':[{'model':db[_0x5d8a('0x77')],'as':_0x5d8a('0x88'),'where':_0x13ef6c,'limit':0x1,'order':[[_0x5d8a('0x7b'),_0x5d8a('0x89')]]}]},{'model':db[_0x5d8a('0x8a')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0xe0964f,null))[_0x5d8a('0x38')](function(_0x7dfc7){if(_0x7dfc7&&_0x7dfc7[_0x5d8a('0x87')]){_0x1cfdd8[_0x5d8a('0x8b')]=_0x7dfc7;_0x1cfdd8[_0x5d8a('0x8c')]=_0x7dfc7[_0x5d8a('0x8d')];_0x1cfdd8[_0x5d8a('0x8e')]=_0x7dfc7[_0x5d8a('0x87')];_0x1cfdd8['applications']=_[_0x5d8a('0x8f')](_0x1cfdd8[_0x5d8a('0x8c')],[_0x5d8a('0x90')],[_0x5d8a('0x91')]);if(_0x1cfdd8[_0x5d8a('0x8b')][_0x5d8a('0x8d')]){delete _0x1cfdd8[_0x5d8a('0x8b')][_0x5d8a('0x8d')];}if(_0x1cfdd8[_0x5d8a('0x8b')][_0x5d8a('0x87')]&&_0x1cfdd8[_0x5d8a('0x8b')][_0x5d8a('0x87')][_0x5d8a('0x88')][_0x5d8a('0x5a')]){return _0x1cfdd8[_0x5d8a('0x8b')]['List'][_0x5d8a('0x88')][0x0];}var _0x47abc7=_[_0x5d8a('0x1b')](_0x182d49[_0x5d8a('0x5d')],{'firstName':_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x7f')],'ListId':_0x7dfc7['ListId']});_0x47abc7[_0x182d49['body'][_0x5d8a('0x82')]]=_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x7f')];return db[_0x5d8a('0x77')][_0x5d8a('0x5c')](_0x47abc7,{'fields':_0x433495,'raw':!![]});}})[_0x5d8a('0x38')](handleEntityNotFound(_0xe0964f,null))[_0x5d8a('0x38')](function(_0x38f7af){_0x1cfdd8[_0x5d8a('0x92')]=_0x38f7af;if(_0x38f7af){var _0x2e2bd2={'ContactId':_0x38f7af['id'],'OpenchannelAccountId':_0x182d49[_0x5d8a('0x58')]['id'],'from':(_0x38f7af['firstName']||'')+'\x20'+(_0x38f7af['lastName']||'')};var _0x271165={'OpenchannelAccountId':_0x182d49[_0x5d8a('0x58')]['id'],'closed':![]};if(_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x93')]){_0x271165['threadId']=_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x93')];return db[_0x5d8a('0x94')][_0x5d8a('0x63')]({'where':_0x271165})[_0x5d8a('0x38')](function(_0x2d5cf0){if(_0x2d5cf0){return[_0x2d5cf0,![]];}_0x2e2bd2[_0x5d8a('0x93')]=_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x93')];_0x2e2bd2[_0x5d8a('0x95')]=_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x95')];return db['OpenchannelInteraction']['create'](_0x2e2bd2)[_0x5d8a('0x38')](function(_0x51bf33){return[_0x51bf33,!![]];});});}else{_0x271165[_0x5d8a('0x93')]=null;}_0x271165[_0x5d8a('0x96')]=_0x38f7af['id'];return db['OpenchannelInteraction'][_0x5d8a('0x63')]({'where':_0x271165})[_0x5d8a('0x38')](function(_0x187481){if(_0x187481){return[_0x187481,![]];}return db[_0x5d8a('0x94')][_0x5d8a('0x5c')](_0x2e2bd2)[_0x5d8a('0x38')](function(_0x233224){return[_0x233224,!![]];});});}})[_0x5d8a('0x97')](function(_0x3be325,_0x483623){if(_0x3be325){_0x474e95=_0x483623;if(!_0x483623){var _0x4559d5={'from':(_0x1cfdd8['contact'][_0x5d8a('0x98')]||'')+'\x20'+(_0x1cfdd8['contact'][_0x5d8a('0x99')]||'')};if(_0x182d49[_0x5d8a('0x5d')]['threadId']&&_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x9a')]&&_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x93')]!=_0x182d49['body']['messageId']){_0x4559d5['threadId']=_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0x9a')];}return _0x3be325['update'](_0x4559d5);}else{return _0x3be325;}}})[_0x5d8a('0x38')](function(_0x4d016d){_0x1cfdd8['interaction']=_0x4d016d[_0x5d8a('0x5f')]({'plain':!![]});_0x1cfdd8[_0x5d8a('0x9b')][_0x5d8a('0x9c')]=_0x474e95;if(_0x1cfdd8['interaction']['created']){if(_0x1cfdd8[_0x5d8a('0x8b')]['autoclose']){_0x1cfdd8[_0x5d8a('0x8c')][_0x5d8a('0x9d')]({'id':0x0,'priority':_0x1cfdd8[_0x5d8a('0x8c')][_0x5d8a('0x5a')]+0x1,'app':_0x5d8a('0x9e'),'appdata':_0x5d8a('0x9f'),'interval':_0x5d8a('0xa0')});}}return db[_0x5d8a('0xa1')][_0x5d8a('0x5c')]({'body':_0x182d49[_0x5d8a('0x5d')]['body'],'OpenchannelAccountId':_0x182d49[_0x5d8a('0x58')]['id'],'OpenchannelInteractionId':_0x4d016d['id'],'direction':'in','ContactId':_0x1cfdd8['contact']['id'],'AttachmentId':_0x182d49[_0x5d8a('0x5d')][_0x5d8a('0xa2')]});})[_0x5d8a('0x38')](function(_0x181b13){_0x1cfdd8[_0x5d8a('0x2b')]=_0x181b13;if(!_0x1cfdd8['interaction'][_0x5d8a('0xa3')])return;return db[_0x5d8a('0xa4')]['find']({'attributes':['id',_0x5d8a('0x45')],'where':{'id':_0x1cfdd8[_0x5d8a('0x9b')][_0x5d8a('0xa3')]}});})['then'](function(_0x453aed){if(_0x453aed){_0x1cfdd8[_0x5d8a('0x8c')][_0x5d8a('0xa5')]({'id':0x0,'priority':0x0,'app':_0x5d8a('0xa6'),'appdata':_0x453aed[_0x5d8a('0x45')]+','+(_0x1cfdd8[_0x5d8a('0x8b')][_0x5d8a('0xa7')]||0xa),'interval':_0x5d8a('0xa0')});}if(!_0x1cfdd8[_0x5d8a('0x9b')]['queueId'])return;return db[_0x5d8a('0xa8')][_0x5d8a('0x63')]({'attributes':['id',_0x5d8a('0x45')],'where':{'id':_0x1cfdd8[_0x5d8a('0x9b')][_0x5d8a('0xa9')]}});})[_0x5d8a('0x38')](function(_0xf81ecb){if(_0xf81ecb){_0x1cfdd8[_0x5d8a('0x8c')][_0x5d8a('0xa5')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0xf81ecb['name']+','+(_0x1cfdd8['account']['waitForTheAssignedQueue']||0x12c),'interval':_0x5d8a('0xa0')});}return respondWithRpcPromise(_0x5d8a('0xaa'),'startRouting',_0x1cfdd8);})[_0x5d8a('0x38')](function(_0x599ae2){respondWithRpcPromise('EventManager',_0x5d8a('0xab'),{'event':_0x5d8a('0xac'),'message':_0x599ae2},client9002);return _0x599ae2;})['then'](respondWithResult(_0xe0964f,null))['catch'](handleError(_0xe0964f,null));};exports[_0x5d8a('0xad')]=function(_0x2b33d1,_0x4f194d){var _0x400e94=_0x2b33d1['params']['id'];var _0x2b44b0=_0x2b33d1['body'];var _0x2e9511=0xc8;var _0x1a0907=null;return db[_0x5d8a('0xae')]['transaction']({'isolationLevel':db[_0x5d8a('0xae')][_0x5d8a('0xaf')][_0x5d8a('0xb0')]['READ_COMMITTED']},function(_0x51d097){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x400e94},'transaction':_0x51d097})[_0x5d8a('0x38')](function(_0xd28c76){if(_0xd28c76){return db[_0x5d8a('0x8a')]['destroy']({'where':{'OpenchannelAccountId':_0x400e94},'transaction':_0x51d097})[_0x5d8a('0x38')](function(){var _0x3f4595=_[_0x5d8a('0x3f')](_0x2b44b0,function(_0x4a3d8d){_0x4a3d8d[_0x5d8a('0x6a')]=_0x400e94;return _0x4a3d8d;});return db[_0x5d8a('0x8a')][_0x5d8a('0xb1')](_0x3f4595,{'transaction':_0x51d097});});}else{_0x2e9511=0x194;_0x1a0907=[];}});})['then'](function(){if(_0x2e9511!==0x194){return db[_0x5d8a('0x8a')][_0x5d8a('0xb2')]({'where':{'OpenchannelAccountId':_0x400e94},'order':_0x5d8a('0x90')})[_0x5d8a('0x38')](function(_0x2ec8dc){_0x1a0907=_0x2ec8dc;});}})['catch'](function(_0x2c1211){_0x2e9511=0x1f4;logger[_0x5d8a('0x29')](_0x2c1211[_0x5d8a('0x3c')]);if(_0x2c1211[_0x5d8a('0x45')]){delete _0x2c1211['name'];}_0x1a0907=_0x2c1211;})['finally'](function(){if(_0x1a0907===null){_0x4f194d[_0x5d8a('0xb3')](_0x2e9511);}else{if(_0x2e9511===0x1f4){_0x4f194d[_0x5d8a('0x2d')](_0x2e9511)['send'](_0x1a0907);}else{_0x4f194d[_0x5d8a('0x2d')](_0x2e9511)[_0x5d8a('0x2e')](_0x1a0907);}}});};exports[_0x5d8a('0xb4')]=function(_0x3733db,_0x539950,_0x417ce4){var _0x317206={};var _0x348abc={};var _0x189cbb;var _0x208245;return db[_0x5d8a('0x40')][_0x5d8a('0x6d')]({'where':{'id':_0x3733db[_0x5d8a('0x58')]['id']}})['then'](handleEntityNotFound(_0x539950,null))['then'](function(_0x332b24){if(_0x332b24){_0x189cbb=_0x332b24;_0x348abc[_0x5d8a('0x44')]=_[_0x5d8a('0x46')](db['OpenchannelApplication'][_0x5d8a('0x41')]);_0x348abc[_0x5d8a('0x47')]=_[_0x5d8a('0x46')](_0x3733db['query']);_0x348abc[_0x5d8a('0x48')]=_[_0x5d8a('0x49')](_0x348abc['model'],_0x348abc[_0x5d8a('0x47')]);_0x317206[_0x5d8a('0x4a')]=_[_0x5d8a('0x49')](_0x348abc[_0x5d8a('0x44')],qs[_0x5d8a('0x59')](_0x3733db[_0x5d8a('0x47')][_0x5d8a('0x59')]));_0x317206['attributes']=_0x317206[_0x5d8a('0x4a')][_0x5d8a('0x5a')]?_0x317206[_0x5d8a('0x4a')]:_0x348abc['model'];_0x317206[_0x5d8a('0x4e')]=qs[_0x5d8a('0x4f')](_0x3733db[_0x5d8a('0x47')][_0x5d8a('0x4f')]);_0x317206[_0x5d8a('0x50')]=qs['filters'](_['pick'](_0x3733db[_0x5d8a('0x47')],_0x348abc[_0x5d8a('0x48')]));if(_0x3733db['query'][_0x5d8a('0x51')]){_0x317206[_0x5d8a('0x50')]=_[_0x5d8a('0x52')](_0x317206[_0x5d8a('0x50')],{'$or':_[_0x5d8a('0x3f')](_0x317206['attributes'],function(_0xfd69d7){var _0x4307a3={};_0x4307a3[_0xfd69d7]={'$like':'%'+_0x3733db[_0x5d8a('0x47')][_0x5d8a('0x51')]+'%'};return _0x4307a3;})});}_0x317206=_[_0x5d8a('0x52')]({},_0x317206,_0x3733db[_0x5d8a('0x54')]);return _0x189cbb['getApplications'](_0x317206);}})[_0x5d8a('0x38')](function(_0x1489c2){if(_0x1489c2){_0x208245=_0x1489c2[_0x5d8a('0x5a')];if(!_0x3733db[_0x5d8a('0x47')]['hasOwnProperty'](_0x5d8a('0x4c'))){_0x317206[_0x5d8a('0x4d')]=qs['limit'](_0x3733db[_0x5d8a('0x47')]['limit']);_0x317206[_0x5d8a('0x2f')]=qs[_0x5d8a('0x2f')](_0x3733db[_0x5d8a('0x47')]['offset']);}return _0x189cbb[_0x5d8a('0xb4')](_0x317206);}})[_0x5d8a('0x38')](function(_0x37a775){if(_0x37a775){return _0x37a775?{'count':_0x208245,'rows':_0x37a775}:null;}})[_0x5d8a('0x38')](respondWithResult(_0x539950,null))[_0x5d8a('0x56')](handleError(_0x539950,null));};exports[_0x5d8a('0xb5')]=function(_0x24c04e,_0x256408,_0x1d75aa){var _0x14b6c1={'raw':![],'where':{}};var _0x9d4d4={};var _0x1b88f7={'count':0x0,'rows':[]};return db['OpenchannelAccount']['findOne']({'where':{'id':_0x24c04e[_0x5d8a('0x58')]['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x256408,null))[_0x5d8a('0x38')](function(_0x520710){if(_0x520710){_0x9d4d4[_0x5d8a('0x44')]=_['keys'](db['OpenchannelInteraction'][_0x5d8a('0x41')]);_0x9d4d4[_0x5d8a('0x47')]=_[_0x5d8a('0x46')](_0x24c04e[_0x5d8a('0x47')]);_0x9d4d4[_0x5d8a('0x48')]=_[_0x5d8a('0x49')](_0x9d4d4[_0x5d8a('0x44')],_0x9d4d4[_0x5d8a('0x47')]);_0x14b6c1[_0x5d8a('0x4a')]=_[_0x5d8a('0x49')](_0x9d4d4[_0x5d8a('0x44')],qs['fields'](_0x24c04e[_0x5d8a('0x47')][_0x5d8a('0x59')]));_0x14b6c1[_0x5d8a('0x4a')]=_0x14b6c1[_0x5d8a('0x4a')][_0x5d8a('0x5a')]?_0x14b6c1[_0x5d8a('0x4a')]:_0x9d4d4[_0x5d8a('0x44')];if(!_0x24c04e[_0x5d8a('0x47')][_0x5d8a('0x4b')](_0x5d8a('0x4c'))){_0x14b6c1[_0x5d8a('0x4d')]=qs[_0x5d8a('0x4d')](_0x24c04e['query'][_0x5d8a('0x4d')]);_0x14b6c1[_0x5d8a('0x2f')]=qs[_0x5d8a('0x2f')](_0x24c04e['query'][_0x5d8a('0x2f')]);}_0x14b6c1[_0x5d8a('0x4e')]=qs[_0x5d8a('0x4f')](_0x24c04e[_0x5d8a('0x47')][_0x5d8a('0x4f')]);_0x14b6c1[_0x5d8a('0x50')]=qs['filters'](_[_0x5d8a('0x6e')](_0x24c04e[_0x5d8a('0x47')],_0x9d4d4[_0x5d8a('0x48')]));_0x14b6c1[_0x5d8a('0x50')][_0x5d8a('0x6a')]=_0x520710['id'];if(_0x24c04e[_0x5d8a('0x47')][_0x5d8a('0x51')]){_0x14b6c1[_0x5d8a('0x50')]=_[_0x5d8a('0x52')](_0x14b6c1['where'],{'$or':_[_0x5d8a('0x3f')](_0x14b6c1['attributes'],function(_0x547ee1){var _0x170bfe={};_0x170bfe[_0x547ee1]={'$like':'%'+_0x24c04e[_0x5d8a('0x47')][_0x5d8a('0x51')]+'%'};return _0x170bfe;})});}_0x14b6c1=_[_0x5d8a('0x52')]({},_0x14b6c1,_0x24c04e[_0x5d8a('0x54')]);return db[_0x5d8a('0x94')]['count']({'where':_0x14b6c1['where']})[_0x5d8a('0x38')](function(_0xb14378){_0x1b88f7[_0x5d8a('0x31')]=_0xb14378;if(_0x24c04e[_0x5d8a('0x47')]['includeAll']){_0x14b6c1[_0x5d8a('0x73')]=[{'model':db['CmContact'],'as':_0x5d8a('0xb6'),'required':![]},{'model':db[_0x5d8a('0xa4')],'as':_0x5d8a('0xb7'),'attributes':[_0x5d8a('0x45'),_0x5d8a('0xb8'),'internal'],'required':![]},{'model':db[_0x5d8a('0xb9')],'as':_0x5d8a('0xba'),'attributes':['id',_0x5d8a('0x45'),'color'],'where':_0x24c04e['query'][_0x5d8a('0xbb')]?{'id':_0x24c04e['query'][_0x5d8a('0xbb')]}:undefined,'required':_0x24c04e['query'][_0x5d8a('0xbb')]?!![]:![]}];}return db[_0x5d8a('0x94')][_0x5d8a('0x55')](_0x14b6c1);})[_0x5d8a('0x38')](function(_0x530f0e){_0x1b88f7[_0x5d8a('0x6f')]=_0x530f0e;return _0x1b88f7;});}})[_0x5d8a('0x38')](respondWithFilteredResult(_0x256408,_0x14b6c1))[_0x5d8a('0x56')](handleError(_0x256408,null));};exports[_0x5d8a('0xbc')]=function(_0x5b3a4b,_0x8968ee,_0x2e1706){return db['OpenchannelAccount']['find']({'where':{'id':_0x5b3a4b[_0x5d8a('0x58')]['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x8968ee,null))['then'](function(_0x34d1eb){if(_0x34d1eb){return _0x34d1eb[_0x5d8a('0xbc')](_0x5b3a4b['body'][_0x5d8a('0x75')],_['omit'](_0x5b3a4b['body'],[_0x5d8a('0x75'),'id'])||{})[_0x5d8a('0x97')](function(_0x23bae8){for(var _0x591af8=0x0;_0x591af8<_0x5b3a4b[_0x5d8a('0x5d')][_0x5d8a('0x75')][_0x5d8a('0x5a')];_0x591af8+=0x1){socket[_0x5d8a('0xbd')](_0x5d8a('0xbe'),{'UserId':Number(_0x5b3a4b[_0x5d8a('0x5d')][_0x5d8a('0x75')][_0x591af8]),'OpenchannelAccountId':Number(_0x5b3a4b[_0x5d8a('0x58')]['id'])});}return _0x23bae8;});}})[_0x5d8a('0x38')](respondWithResult(_0x8968ee,null))[_0x5d8a('0x56')](handleError(_0x8968ee,null));};exports[_0x5d8a('0xbf')]=function(_0x1d713f,_0x40819a,_0x21dc5b){return db[_0x5d8a('0x40')][_0x5d8a('0x63')]({'where':{'id':_0x1d713f[_0x5d8a('0x58')]['id']}})['then'](handleEntityNotFound(_0x40819a,null))['then'](function(_0x3a68b6){if(_0x3a68b6){return _0x3a68b6[_0x5d8a('0xbf')](_0x1d713f[_0x5d8a('0x47')][_0x5d8a('0x75')])['then'](function(){if(_[_0x5d8a('0xc0')](_0x1d713f[_0x5d8a('0x47')]['ids'])){for(var _0x29b7a3=0x0;_0x29b7a3<_0x1d713f[_0x5d8a('0x47')][_0x5d8a('0x75')][_0x5d8a('0x5a')];_0x29b7a3+=0x1){socket[_0x5d8a('0xbd')]('userOpenchannelAccount:remove',{'UserId':Number(_0x1d713f[_0x5d8a('0x47')]['ids'][_0x29b7a3]),'OpenchannelAccountId':Number(_0x1d713f[_0x5d8a('0x58')]['id'])});}}else{socket[_0x5d8a('0xbd')](_0x5d8a('0xc1'),{'UserId':Number(_0x1d713f[_0x5d8a('0x47')][_0x5d8a('0x75')]),'OpenchannelAccountId':Number(_0x1d713f['params']['id'])});}});}})[_0x5d8a('0x38')](respondWithStatusCode(_0x40819a,null))[_0x5d8a('0x56')](handleError(_0x40819a,null));};exports['getAgents']=function(_0x2c36c6,_0x4485c6,_0x1f5160){var _0x13d7df={};var _0x5063b9={};var _0x409307;var _0x3ae0b0;return db['OpenchannelAccount'][_0x5d8a('0x6d')]({'where':{'id':_0x2c36c6['params']['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x4485c6,null))[_0x5d8a('0x38')](function(_0x2ee87e){if(_0x2ee87e){_0x409307=_0x2ee87e;_0x5063b9[_0x5d8a('0x44')]=_[_0x5d8a('0x46')](db[_0x5d8a('0xa4')][_0x5d8a('0x41')]);_0x5063b9[_0x5d8a('0x47')]=_[_0x5d8a('0x46')](_0x2c36c6['query']);_0x5063b9['filters']=_['intersection'](_0x5063b9[_0x5d8a('0x44')],_0x5063b9['query']);_0x13d7df[_0x5d8a('0x4a')]=_['intersection'](_0x5063b9[_0x5d8a('0x44')],qs[_0x5d8a('0x59')](_0x2c36c6['query'][_0x5d8a('0x59')]));_0x13d7df['attributes']=_0x13d7df[_0x5d8a('0x4a')][_0x5d8a('0x5a')]?_0x13d7df[_0x5d8a('0x4a')]:_0x5063b9[_0x5d8a('0x44')];_0x13d7df[_0x5d8a('0x4e')]=qs[_0x5d8a('0x4f')](_0x2c36c6[_0x5d8a('0x47')][_0x5d8a('0x4f')]);_0x13d7df[_0x5d8a('0x50')]=qs[_0x5d8a('0x48')](_[_0x5d8a('0x6e')](_0x2c36c6[_0x5d8a('0x47')],_0x5063b9[_0x5d8a('0x48')]));if(_0x2c36c6['query']['filter']){_0x13d7df[_0x5d8a('0x50')]=_[_0x5d8a('0x52')](_0x13d7df[_0x5d8a('0x50')],{'$or':_[_0x5d8a('0x3f')](_0x13d7df[_0x5d8a('0x4a')],function(_0x39e868){var _0x59d541={};_0x59d541[_0x39e868]={'$like':'%'+_0x2c36c6[_0x5d8a('0x47')]['filter']+'%'};return _0x59d541;})});}_0x13d7df=_[_0x5d8a('0x52')]({},_0x13d7df,_0x2c36c6['options']);return _0x409307[_0x5d8a('0xc2')](_0x13d7df);}})[_0x5d8a('0x38')](function(_0x552e37){if(_0x552e37){_0x3ae0b0=_0x552e37[_0x5d8a('0x5a')];if(!_0x2c36c6[_0x5d8a('0x47')]['hasOwnProperty'](_0x5d8a('0x4c'))){_0x13d7df[_0x5d8a('0x4d')]=qs[_0x5d8a('0x4d')](_0x2c36c6[_0x5d8a('0x47')][_0x5d8a('0x4d')]);_0x13d7df[_0x5d8a('0x2f')]=qs[_0x5d8a('0x2f')](_0x2c36c6[_0x5d8a('0x47')][_0x5d8a('0x2f')]);}return _0x409307[_0x5d8a('0xc2')](_0x13d7df);}})[_0x5d8a('0x38')](function(_0x2e7f52){if(_0x2e7f52){return _0x2e7f52?{'count':_0x3ae0b0,'rows':_0x2e7f52}:null;}})[_0x5d8a('0x38')](respondWithResult(_0x4485c6,null))['catch'](handleError(_0x4485c6,null));};exports['send']=function(_0x4446c9,_0x2a0110,_0x4b540e){var _0x3f2be4,_0x27662b,_0x3a5f87;if(_['isNil'](_0x4446c9[_0x5d8a('0x5d')][_0x5d8a('0x5d')])||_0x4446c9[_0x5d8a('0x5d')][_0x5d8a('0x5d')]===''){throw new db[(_0x5d8a('0x78'))][(_0x5d8a('0x80'))](_0x5d8a('0x81'));}if(_[_0x5d8a('0x7e')](_0x4446c9['body']['to'])){}_0x3f2be4=_0x4446c9[_0x5d8a('0x5d')]['to'];return db[_0x5d8a('0x40')][_0x5d8a('0x6d')]({'where':{'id':_0x4446c9[_0x5d8a('0x58')]['id']}})[_0x5d8a('0x38')](handleEntityNotFound(_0x2a0110,null))['then'](function(_0x1fe143){if(_0x1fe143){return db['OpenchannelAccount'][_0x5d8a('0x63')]({'where':{'id':_0x1fe143['id']},'include':[{'model':db[_0x5d8a('0x86')],'as':'List','include':[{'model':db[_0x5d8a('0x77')],'as':_0x5d8a('0x88'),'where':{[_0x1fe143['mapKey']]:_0x3f2be4},'limit':0x1,'order':[[_0x5d8a('0x7b'),_0x5d8a('0x89')]]}]}]})['then'](handleEntityNotFound(_0x2a0110,null))['then'](function(_0x5af544){if(_0x5af544&&_0x5af544[_0x5d8a('0x87')]){_0x27662b=_0x5af544[_0x5d8a('0x5f')]({'plain':!![]});if(_0x27662b['List']&&_0x27662b['List'][_0x5d8a('0x88')][_0x5d8a('0x5a')]){return _0x27662b['List'][_0x5d8a('0x88')][0x0];}return db['CmContact'][_0x5d8a('0x5c')](_[_0x5d8a('0x1b')](_0x4446c9[_0x5d8a('0x5d')],{'firstName':_0x3f2be4,[_0x5af544[_0x5d8a('0x82')]]:_0x3f2be4,'phone':_0x3f2be4,'ListId':_0x27662b[_0x5d8a('0x7d')]}));}})[_0x5d8a('0x38')](handleEntityNotFound(_0x2a0110,null))[_0x5d8a('0x38')](function(_0x3d032b){if(_0x3d032b){_0x3a5f87=_0x3d032b;return db[_0x5d8a('0x94')][_0x5d8a('0x63')]({'where':{'ContactId':_0x3a5f87['id'],'closed':![],'OpenchannelAccountId':_0x27662b['id']}})[_0x5d8a('0x38')](function(_0x3599b2){if(_0x3599b2){return[_0x3599b2,![]];}return db[_0x5d8a('0x94')][_0x5d8a('0x5c')]({'UserId':_0x4446c9[_0x5d8a('0x5e')]['id'],'ContactId':_0x3a5f87['id'],'OpenchannelAccountId':_0x27662b['id'],'lastMsgDirection':_0x5d8a('0xc3'),'firstMsgDirection':_0x5d8a('0xc3'),'Messages':[_[_0x5d8a('0x52')](_0x4446c9[_0x5d8a('0x5d')],{'read':![],'body':_0x4446c9[_0x5d8a('0x5d')][_0x5d8a('0x5d')],'OpenchannelAccountId':_0x27662b['id'],'UserId':_0x4446c9[_0x5d8a('0x5e')]['id'],'ContactId':_0x3a5f87['id']})]},{'include':[{'model':db[_0x5d8a('0xa1')],'as':_0x5d8a('0xc4')}]})[_0x5d8a('0x38')](function(_0x44f865){return[_0x44f865,!![]];});});}})[_0x5d8a('0x97')](function(_0x387079,_0x810d04){if(_0x810d04){return _0x387079;}return db[_0x5d8a('0xa1')]['create'](_['merge'](_0x4446c9[_0x5d8a('0x5d')],{'read':![],'body':_0x4446c9['body']['body'],'OpenchannelAccountId':_0x27662b['id'],'OpenchannelInteractionId':_0x387079['id'],'UserId':_0x4446c9['user']['id'],'ContactId':_0x3a5f87['id']}))[_0x5d8a('0x38')](function(_0x3f70f2){_0x387079[_0x5d8a('0xc5')]['Messages']=[];_0x387079[_0x5d8a('0xc5')]['Messages'][_0x5d8a('0x9d')](_0x3f70f2[_0x5d8a('0xc5')]);return _0x387079;});});}})['then'](respondWithResult(_0x2a0110,null))[_0x5d8a('0x56')](handleError(_0x2a0110,null));}; \ No newline at end of file +var _0x323e=['omit','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','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','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','OpenchannelAccount','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','mandatoryDispositionPause','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','CannedAnswer','map','removeAnswers','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','Sequelize','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','applications','List','orderBy','priority','asc','account','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','unmanaged','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','OpenchannelQueue','waitForTheAssignedQueue','EventManager','addApplications','sequelize','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','getInteractions','fullname','internal','Tag','tag','addAgents'];(function(_0x2588ad,_0x4ad81b){var _0x262404=function(_0x1eeb62){while(--_0x1eeb62){_0x2588ad['push'](_0x2588ad['shift']());}};_0x262404(++_0x4ad81b);}(_0x323e,0x188));var _0xe323=function(_0x522df5,_0x3364ae){_0x522df5=_0x522df5-0x0;var _0x3fffd4=_0x323e[_0x522df5];return _0x3fffd4;};'use strict';var emlformat=require(_0xe323('0x0'));var rimraf=require(_0xe323('0x1'));var zipdir=require(_0xe323('0x2'));var jsonpatch=require(_0xe323('0x3'));var rp=require(_0xe323('0x4'));var moment=require(_0xe323('0x5'));var BPromise=require(_0xe323('0x6'));var Mustache=require(_0xe323('0x7'));var util=require(_0xe323('0x8'));var path=require(_0xe323('0x9'));var sox=require(_0xe323('0xa'));var csv=require(_0xe323('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe323('0xc'));var _=require('lodash');var squel=require(_0xe323('0xd'));var crypto=require(_0xe323('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe323('0xf'));var toCsv=require(_0xe323('0xb'));var querystring=require(_0xe323('0x10'));var Papa=require(_0xe323('0x11'));var Redis=require(_0xe323('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe323('0x13'));var as=require(_0xe323('0x14'));var hardwareService=require(_0xe323('0x15'));var logger=require(_0xe323('0x16'))(_0xe323('0x17'));var utils=require(_0xe323('0x18'));var config=require(_0xe323('0x19'));var licenseUtil=require(_0xe323('0x1a'));var db=require(_0xe323('0x1b'))['db'];config[_0xe323('0x1c')]=_[_0xe323('0x1d')](config['redis'],{'host':_0xe323('0x1e'),'port':0x18eb});var socket=require(_0xe323('0x1f'))(new Redis(config[_0xe323('0x1c')]));require(_0xe323('0x20'))[_0xe323('0x21')](socket);var jayson=require(_0xe323('0x22'));var client=jayson['client'][_0xe323('0x23')]({'port':0x232c});var client9002=jayson['client'][_0xe323('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x2ba55b,_0x12aab8,_0x19e749,_0x1bc115){return new BPromise(function(_0x25c213,_0x18d377){var _0xf55ce1=_0x1bc115||client;return _0xf55ce1['request'](_0x2ba55b,_0x19e749)['then'](function(_0x53dc09){logger[_0xe323('0x24')](_0xe323('0x25'),_0x12aab8,_0xe323('0x26'));logger[_0xe323('0x27')](_0xe323('0x28'),_0x12aab8,_0xe323('0x26'),JSON[_0xe323('0x29')](_0x53dc09));if(_0x53dc09['error']){if(_0x53dc09[_0xe323('0x2a')][_0xe323('0x2b')]===0x1f4){logger[_0xe323('0x2a')](_0xe323('0x25'),_0x12aab8,_0x53dc09['error'][_0xe323('0x2c')]);return _0x18d377(_0x53dc09['error'][_0xe323('0x2c')]);}logger[_0xe323('0x2a')](_0xe323('0x25'),_0x12aab8,_0x53dc09[_0xe323('0x2a')][_0xe323('0x2c')]);return _0x25c213(_0x53dc09[_0xe323('0x2a')][_0xe323('0x2c')]);}else{logger[_0xe323('0x24')](_0xe323('0x25'),_0x12aab8,_0xe323('0x26'));_0x25c213(_0x53dc09['result'][_0xe323('0x2c')]);}})[_0xe323('0x2d')](function(_0x473be5){logger[_0xe323('0x2a')](_0xe323('0x25'),_0x12aab8,_0x473be5);_0x18d377(_0x473be5);});});}function respondWithStatusCode(_0x43bf49,_0x17970e){_0x17970e=_0x17970e||0xcc;return function(_0x2019ab){if(_0x2019ab){return _0x43bf49[_0xe323('0x2e')](_0x17970e);}return _0x43bf49[_0xe323('0x2f')](_0x17970e)['end']();};}function respondWithResult(_0x592bf0,_0x153363){_0x153363=_0x153363||0xc8;return function(_0x49e6d1){if(_0x49e6d1){return _0x592bf0[_0xe323('0x2f')](_0x153363)['json'](_0x49e6d1);}};}function respondWithFilteredResult(_0x3b1333,_0x37f6f1){return function(_0x1610fd){if(_0x1610fd){var _0x2f1a6b=typeof _0x37f6f1[_0xe323('0x30')]===_0xe323('0x31')&&typeof _0x37f6f1['limit']===_0xe323('0x31');var _0x2da913=_0x1610fd[_0xe323('0x32')];var _0x3db860=_0x2f1a6b?0x0:_0x37f6f1[_0xe323('0x30')];var _0x3a0193=_0x2f1a6b?_0x1610fd[_0xe323('0x32')]:_0x37f6f1[_0xe323('0x30')]+_0x37f6f1[_0xe323('0x33')];var _0x372eaf;if(_0x3a0193>=_0x2da913){_0x3a0193=_0x2da913;_0x372eaf=0xc8;}else{_0x372eaf=0xce;}_0x3b1333[_0xe323('0x2f')](_0x372eaf);return _0x3b1333['set'](_0xe323('0x34'),_0x3db860+'-'+_0x3a0193+'/'+_0x2da913)[_0xe323('0x35')](_0x1610fd);}return null;};}function patchUpdates(_0x20c0f1){return function(_0x54d926){try{jsonpatch[_0xe323('0x36')](_0x54d926,_0x20c0f1,!![]);}catch(_0x138308){return BPromise[_0xe323('0x37')](_0x138308);}return _0x54d926['save']();};}function saveUpdates(_0x586511,_0x408a13){return function(_0x185db8){if(_0x185db8){return _0x185db8[_0xe323('0x38')](_0x586511)[_0xe323('0x39')](function(_0x2263b0){return _0x2263b0;});}return null;};}function removeEntity(_0x1b557b,_0x80f3bb){return function(_0x5ca1a1){if(_0x5ca1a1){return _0x5ca1a1[_0xe323('0x3a')]()[_0xe323('0x39')](function(){var _0x3eda9f=_0x5ca1a1[_0xe323('0x3b')]({'plain':!![]});var _0x893d92=_0xe323('0x3c');return db['UserProfileResource'][_0xe323('0x3a')]({'where':{'type':_0x893d92,'resourceId':_0x3eda9f['id']}})[_0xe323('0x39')](function(){return _0x5ca1a1;});})[_0xe323('0x39')](function(){_0x1b557b[_0xe323('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2caf27,_0x3c7e5c){return function(_0x5ddf48){if(!_0x5ddf48){_0x2caf27[_0xe323('0x2e')](0x194);}return _0x5ddf48;};}function handleError(_0x235075,_0x4a610b){_0x4a610b=_0x4a610b||0x1f4;return function(_0x595f13){logger[_0xe323('0x2a')](_0x595f13[_0xe323('0x3d')]);if(_0x595f13[_0xe323('0x3e')]){delete _0x595f13[_0xe323('0x3e')];}_0x235075[_0xe323('0x2f')](_0x4a610b)[_0xe323('0x3f')](_0x595f13);};}exports[_0xe323('0x40')]=function(_0x5a580f,_0x20825d){var _0x1aa22e={'include':[{'model':db[_0xe323('0x41')],'as':'mandatoryDispositionPause'}]},_0x17e2b5={},_0x42c7ef={'count':0x0,'rows':[]};var _0x56917b=_['map'](db[_0xe323('0x42')]['rawAttributes'],function(_0x3380d3){return{'name':_0x3380d3[_0xe323('0x43')],'type':_0x3380d3[_0xe323('0x44')]['key']};});_0x17e2b5[_0xe323('0x45')]=_['map'](_0x56917b,_0xe323('0x3e'));_0x17e2b5[_0xe323('0x46')]=_[_0xe323('0x47')](_0x5a580f[_0xe323('0x46')]);_0x17e2b5['filters']=_[_0xe323('0x48')](_0x17e2b5[_0xe323('0x45')],_0x17e2b5[_0xe323('0x46')]);_0x1aa22e[_0xe323('0x49')]=_[_0xe323('0x48')](_0x17e2b5['model'],qs[_0xe323('0x4a')](_0x5a580f[_0xe323('0x46')][_0xe323('0x4a')]));_0x1aa22e['attributes']=_0x1aa22e['attributes'][_0xe323('0x4b')]?_0x1aa22e['attributes']:_0x17e2b5[_0xe323('0x45')];if(!_0x5a580f[_0xe323('0x46')][_0xe323('0x4c')](_0xe323('0x4d'))){_0x1aa22e[_0xe323('0x33')]=qs[_0xe323('0x33')](_0x5a580f[_0xe323('0x46')]['limit']);_0x1aa22e[_0xe323('0x30')]=qs[_0xe323('0x30')](_0x5a580f[_0xe323('0x46')][_0xe323('0x30')]);}_0x1aa22e[_0xe323('0x4e')]=qs[_0xe323('0x4f')](_0x5a580f[_0xe323('0x46')]['sort']);_0x1aa22e[_0xe323('0x50')]=qs[_0xe323('0x51')](_[_0xe323('0x52')](_0x5a580f[_0xe323('0x46')],_0x17e2b5[_0xe323('0x51')]),_0x56917b);if(_0x5a580f[_0xe323('0x46')][_0xe323('0x53')]){_0x1aa22e[_0xe323('0x50')]=_[_0xe323('0x54')](_0x1aa22e[_0xe323('0x50')],{'$or':_['map'](_0x56917b,function(_0x2fd6c6){if(_0x2fd6c6[_0xe323('0x44')]!==_0xe323('0x55')){var _0x6097b3={};_0x6097b3[_0x2fd6c6['name']]={'$like':'%'+_0x5a580f[_0xe323('0x46')][_0xe323('0x53')]+'%'};return _0x6097b3;}})});}_0x1aa22e=_['merge']({},_0x1aa22e,_0x5a580f[_0xe323('0x56')]);var _0x176701={'where':_0x1aa22e[_0xe323('0x50')]};return db['OpenchannelAccount'][_0xe323('0x32')](_0x176701)['then'](function(_0x38dfdd){_0x42c7ef[_0xe323('0x32')]=_0x38dfdd;if(_0x5a580f['query'][_0xe323('0x57')]){_0x1aa22e[_0xe323('0x58')]=[{'all':!![]}];}return db[_0xe323('0x42')][_0xe323('0x59')](_0x1aa22e);})[_0xe323('0x39')](function(_0x3d0049){_0x42c7ef['rows']=_0x3d0049;return _0x42c7ef;})['then'](respondWithFilteredResult(_0x20825d,_0x1aa22e))[_0xe323('0x2d')](handleError(_0x20825d,null));};exports[_0xe323('0x5a')]=function(_0x264f65,_0x59a087){var _0xbe19e8={'raw':![],'where':{'id':_0x264f65[_0xe323('0x5b')]['id']},'include':[{'model':db[_0xe323('0x41')],'as':_0xe323('0x5c')}]},_0xccf771={};_0xccf771[_0xe323('0x45')]=_['keys'](db[_0xe323('0x42')][_0xe323('0x5d')]);_0xccf771[_0xe323('0x46')]=_['keys'](_0x264f65[_0xe323('0x46')]);_0xccf771[_0xe323('0x51')]=_['intersection'](_0xccf771[_0xe323('0x45')],_0xccf771[_0xe323('0x46')]);_0xbe19e8[_0xe323('0x49')]=_[_0xe323('0x48')](_0xccf771['model'],qs[_0xe323('0x4a')](_0x264f65[_0xe323('0x46')][_0xe323('0x4a')]));_0xbe19e8[_0xe323('0x49')]=_0xbe19e8[_0xe323('0x49')][_0xe323('0x4b')]?_0xbe19e8[_0xe323('0x49')]:_0xccf771[_0xe323('0x45')];if(_0x264f65[_0xe323('0x46')]['includeAll']){_0xbe19e8[_0xe323('0x58')]=[{'all':!![]}];}_0xbe19e8=_[_0xe323('0x54')]({},_0xbe19e8,_0x264f65[_0xe323('0x56')]);return db[_0xe323('0x42')][_0xe323('0x5e')](_0xbe19e8)['then'](handleEntityNotFound(_0x59a087,null))[_0xe323('0x39')](respondWithResult(_0x59a087,null))['catch'](handleError(_0x59a087,null));};exports['create']=function(_0x2d0804,_0xee62d1){return db['OpenchannelAccount'][_0xe323('0x5f')](_0x2d0804['body'],{})[_0xe323('0x39')](function(_0x30efe5){var _0x27a2a2=_0x2d0804[_0xe323('0x60')][_0xe323('0x3b')]({'plain':!![]});if(!_0x27a2a2)throw new Error(_0xe323('0x61'));if(_0x27a2a2[_0xe323('0x62')]===_0xe323('0x60')){var _0x3aa671=_0x30efe5['get']({'plain':!![]});var _0x2409e9='OpenchannelAccounts';return db[_0xe323('0x63')]['find']({'where':{'name':_0x2409e9,'userProfileId':_0x27a2a2[_0xe323('0x64')]},'raw':!![]})[_0xe323('0x39')](function(_0x162706){if(_0x162706&&_0x162706[_0xe323('0x65')]===0x0){return db[_0xe323('0x66')][_0xe323('0x5f')]({'name':_0x3aa671[_0xe323('0x3e')],'resourceId':_0x3aa671['id'],'type':_0x162706['name'],'sectionId':_0x162706['id']},{})[_0xe323('0x39')](function(){return _0x30efe5;});}else{return _0x30efe5;}})[_0xe323('0x2d')](function(_0x5628dc){logger[_0xe323('0x2a')](_0xe323('0x67'),_0x5628dc);throw _0x5628dc;});}return _0x30efe5;})[_0xe323('0x39')](respondWithResult(_0xee62d1,0xc9))[_0xe323('0x2d')](handleError(_0xee62d1,null));};exports['update']=function(_0x6f1f54,_0x4ba275){if(_0x6f1f54[_0xe323('0x68')]['id']){delete _0x6f1f54[_0xe323('0x68')]['id'];}return db[_0xe323('0x42')]['find']({'where':{'id':_0x6f1f54[_0xe323('0x5b')]['id']},'include':[{'model':db[_0xe323('0x41')],'as':_0xe323('0x5c')}]})[_0xe323('0x39')](handleEntityNotFound(_0x4ba275,null))[_0xe323('0x39')](saveUpdates(_0x6f1f54['body'],null))['then'](respondWithResult(_0x4ba275,null))[_0xe323('0x2d')](handleError(_0x4ba275,null));};exports[_0xe323('0x3a')]=function(_0x508fee,_0x56ccd1){return db[_0xe323('0x42')]['find']({'where':{'id':_0x508fee['params']['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x56ccd1,null))[_0xe323('0x39')](removeEntity(_0x56ccd1,null))[_0xe323('0x2d')](handleError(_0x56ccd1,null));};exports[_0xe323('0x69')]=function(_0x3ef51b,_0x255be4){return db[_0xe323('0x42')]['describe']()[_0xe323('0x39')](respondWithResult(_0x255be4,null))['catch'](handleError(_0x255be4,null));};exports['addDisposition']=function(_0x2778e7,_0x45e62f,_0x40e28b){if(_0x2778e7[_0xe323('0x68')]['id']){delete _0x2778e7[_0xe323('0x68')]['id'];}return db[_0xe323('0x42')][_0xe323('0x5e')]({'where':{'id':_0x2778e7[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x45e62f,null))[_0xe323('0x39')](function(_0x45222e){if(_0x45222e){_0x2778e7[_0xe323('0x68')][_0xe323('0x6a')]=_0x45222e['id'];return db[_0xe323('0x6b')]['create'](_0x2778e7['body']);}})[_0xe323('0x39')](respondWithResult(_0x45e62f,null))[_0xe323('0x2d')](handleError(_0x45e62f,null));};exports[_0xe323('0x6c')]=function(_0x47c5aa,_0xd0e7de,_0x3f845f){var _0x2e2711={'raw':![],'where':{}};var _0x10f329={};var _0x29d99d={'count':0x0,'rows':[]};return db[_0xe323('0x42')][_0xe323('0x6d')]({'where':{'id':_0x47c5aa[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0xd0e7de,null))[_0xe323('0x39')](function(_0x3cdf53){if(_0x3cdf53){_0x10f329['model']=_[_0xe323('0x47')](db['Disposition']['rawAttributes']);_0x10f329[_0xe323('0x46')]=_[_0xe323('0x47')](_0x47c5aa[_0xe323('0x46')]);_0x10f329['filters']=_[_0xe323('0x48')](_0x10f329[_0xe323('0x45')],_0x10f329[_0xe323('0x46')]);_0x2e2711[_0xe323('0x49')]=_[_0xe323('0x48')](_0x10f329[_0xe323('0x45')],qs[_0xe323('0x4a')](_0x47c5aa[_0xe323('0x46')]['fields']));_0x2e2711[_0xe323('0x49')]=_0x2e2711[_0xe323('0x49')][_0xe323('0x4b')]?_0x2e2711['attributes']:_0x10f329['model'];if(!_0x47c5aa[_0xe323('0x46')]['hasOwnProperty'](_0xe323('0x4d'))){_0x2e2711[_0xe323('0x33')]=qs[_0xe323('0x33')](_0x47c5aa[_0xe323('0x46')][_0xe323('0x33')]);_0x2e2711['offset']=qs[_0xe323('0x30')](_0x47c5aa[_0xe323('0x46')]['offset']);}_0x2e2711[_0xe323('0x4e')]=qs['sort'](_0x47c5aa[_0xe323('0x46')][_0xe323('0x4f')]);_0x2e2711[_0xe323('0x50')]=qs[_0xe323('0x51')](_[_0xe323('0x52')](_0x47c5aa[_0xe323('0x46')],_0x10f329[_0xe323('0x51')]));_0x2e2711[_0xe323('0x50')][_0xe323('0x6a')]=_0x3cdf53['id'];if(_0x47c5aa['query'][_0xe323('0x53')]){_0x2e2711[_0xe323('0x50')]=_[_0xe323('0x54')](_0x2e2711[_0xe323('0x50')],{'$or':_['map'](_0x2e2711[_0xe323('0x49')],function(_0xf36b44){var _0x3b768c={};_0x3b768c[_0xf36b44]={'$like':'%'+_0x47c5aa['query']['filter']+'%'};return _0x3b768c;})});}_0x2e2711=_[_0xe323('0x54')]({},_0x2e2711,_0x47c5aa[_0xe323('0x56')]);return db['Disposition'][_0xe323('0x32')]({'where':_0x2e2711[_0xe323('0x50')]})['then'](function(_0x2da5e9){_0x29d99d[_0xe323('0x32')]=_0x2da5e9;if(_0x47c5aa[_0xe323('0x46')]['includeAll']){_0x2e2711[_0xe323('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xe323('0x59')](_0x2e2711);})['then'](function(_0x577962){_0x29d99d[_0xe323('0x6e')]=_0x577962;return _0x29d99d;});}})[_0xe323('0x39')](respondWithFilteredResult(_0xd0e7de,_0x2e2711))['catch'](handleError(_0xd0e7de,null));};exports[_0xe323('0x6f')]=function(_0x3eeae3,_0x37d0aa,_0xb3aa96){return db[_0xe323('0x42')][_0xe323('0x5e')]({'where':{'id':_0x3eeae3[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x37d0aa,null))[_0xe323('0x39')](function(_0x533f01){if(_0x533f01){return _0x533f01[_0xe323('0x6f')](_0x3eeae3['query'][_0xe323('0x70')]);}})['then'](respondWithStatusCode(_0x37d0aa,null))[_0xe323('0x2d')](handleError(_0x37d0aa,null));};exports['addAnswer']=function(_0x3a099d,_0x254d72,_0x5b1ac2){if(_0x3a099d[_0xe323('0x68')]['id']){delete _0x3a099d['body']['id'];}return db['OpenchannelAccount'][_0xe323('0x5e')]({'where':{'id':_0x3a099d[_0xe323('0x5b')]['id']}})['then'](handleEntityNotFound(_0x254d72,null))['then'](function(_0x394c5f){if(_0x394c5f){_0x3a099d[_0xe323('0x68')]['OpenchannelAccountId']=_0x394c5f['id'];return db['CannedAnswer'][_0xe323('0x5f')](_0x3a099d[_0xe323('0x68')]);}})['then'](respondWithResult(_0x254d72,null))[_0xe323('0x2d')](handleError(_0x254d72,null));};exports['getAnswers']=function(_0x425b97,_0x565a6,_0x3d78f4){var _0x2e49bb={'raw':![],'where':{}};var _0x224fe7={};var _0x5d97c3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xe323('0x6d')]({'where':{'id':_0x425b97[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x565a6,null))['then'](function(_0x443011){if(_0x443011){_0x224fe7[_0xe323('0x45')]=_[_0xe323('0x47')](db[_0xe323('0x71')][_0xe323('0x5d')]);_0x224fe7[_0xe323('0x46')]=_[_0xe323('0x47')](_0x425b97['query']);_0x224fe7[_0xe323('0x51')]=_[_0xe323('0x48')](_0x224fe7[_0xe323('0x45')],_0x224fe7[_0xe323('0x46')]);_0x2e49bb[_0xe323('0x49')]=_[_0xe323('0x48')](_0x224fe7[_0xe323('0x45')],qs[_0xe323('0x4a')](_0x425b97[_0xe323('0x46')][_0xe323('0x4a')]));_0x2e49bb[_0xe323('0x49')]=_0x2e49bb[_0xe323('0x49')][_0xe323('0x4b')]?_0x2e49bb[_0xe323('0x49')]:_0x224fe7[_0xe323('0x45')];if(!_0x425b97[_0xe323('0x46')]['hasOwnProperty'](_0xe323('0x4d'))){_0x2e49bb[_0xe323('0x33')]=qs[_0xe323('0x33')](_0x425b97[_0xe323('0x46')]['limit']);_0x2e49bb[_0xe323('0x30')]=qs[_0xe323('0x30')](_0x425b97['query']['offset']);}_0x2e49bb[_0xe323('0x4e')]=qs[_0xe323('0x4f')](_0x425b97[_0xe323('0x46')][_0xe323('0x4f')]);_0x2e49bb['where']=qs[_0xe323('0x51')](_[_0xe323('0x52')](_0x425b97[_0xe323('0x46')],_0x224fe7[_0xe323('0x51')]));_0x2e49bb[_0xe323('0x50')]['OpenchannelAccountId']=_0x443011['id'];if(_0x425b97['query'][_0xe323('0x53')]){_0x2e49bb[_0xe323('0x50')]=_[_0xe323('0x54')](_0x2e49bb[_0xe323('0x50')],{'$or':_[_0xe323('0x72')](_0x2e49bb[_0xe323('0x49')],function(_0x41c138){var _0x5bf751={};_0x5bf751[_0x41c138]={'$like':'%'+_0x425b97[_0xe323('0x46')][_0xe323('0x53')]+'%'};return _0x5bf751;})});}_0x2e49bb=_[_0xe323('0x54')]({},_0x2e49bb,_0x425b97[_0xe323('0x56')]);return db[_0xe323('0x71')][_0xe323('0x32')]({'where':_0x2e49bb[_0xe323('0x50')]})[_0xe323('0x39')](function(_0x482117){_0x5d97c3[_0xe323('0x32')]=_0x482117;if(_0x425b97[_0xe323('0x46')]['includeAll']){_0x2e49bb[_0xe323('0x58')]=[{'all':!![]}];}return db[_0xe323('0x71')][_0xe323('0x59')](_0x2e49bb);})[_0xe323('0x39')](function(_0x2947d6){_0x5d97c3['rows']=_0x2947d6;return _0x5d97c3;});}})[_0xe323('0x39')](respondWithFilteredResult(_0x565a6,_0x2e49bb))['catch'](handleError(_0x565a6,null));};exports[_0xe323('0x73')]=function(_0x1e4203,_0x1424ac,_0x24bbd0){return db['OpenchannelAccount']['find']({'where':{'id':_0x1e4203[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x1424ac,null))[_0xe323('0x39')](function(_0x41efc1){if(_0x41efc1){return _0x41efc1[_0xe323('0x73')](_0x1e4203['query'][_0xe323('0x70')]);}})['then'](respondWithStatusCode(_0x1424ac,null))[_0xe323('0x2d')](handleError(_0x1424ac,null));};exports[_0xe323('0x74')]=function(_0x3229e9,_0x5c6c4c,_0x3fd893){var _0xdde0e3={'body':_0x3229e9[_0xe323('0x68')],'channel':_0xe323('0x75')};var _0x34beb6=[];var _0x52e19f=[];var _0x5bfbd2={};var _0x45cb48=![];return db[_0xe323('0x76')][_0xe323('0x69')]()[_0xe323('0x39')](function(_0x176d8f){if(!_0x176d8f){throw new db['Sequelize'][(_0xe323('0x77'))](_0xe323('0x78'));}_0x34beb6=_[_0xe323('0x79')](_[_0xe323('0x47')](_0x176d8f),[_0xe323('0x7a'),'updatedAt']);_0x52e19f=_['difference'](_[_0xe323('0x47')](_0x176d8f),[_0xe323('0x7a'),'updatedAt',_0xe323('0x7b'),_0xe323('0x7c')]);if(_0x3229e9[_0xe323('0x68')]['id']){delete _0x3229e9[_0xe323('0x68')]['id'];}if(_[_0xe323('0x7d')](_0x3229e9[_0xe323('0x68')]['from'])){throw new db['Sequelize'][(_0xe323('0x77'))](_0xe323('0x7e'));}if(_[_0xe323('0x7d')](_0x3229e9[_0xe323('0x68')][_0xe323('0x68')])||_0x3229e9[_0xe323('0x68')][_0xe323('0x68')]===''){throw new db['Sequelize'][(_0xe323('0x77'))](_0xe323('0x7f'));}if(_[_0xe323('0x7d')](_0x3229e9[_0xe323('0x68')]['mapKey'])){throw new db[(_0xe323('0x80'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x52e19f);}if(!_[_0xe323('0x81')](_0x52e19f,_0x3229e9[_0xe323('0x68')][_0xe323('0x82')])){throw new db['Sequelize'][(_0xe323('0x77'))](_0xe323('0x83')+_0x52e19f);}_0x5bfbd2[_0x3229e9['body'][_0xe323('0x82')]]=_0x3229e9[_0xe323('0x68')][_0xe323('0x84')];})[_0xe323('0x39')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x3229e9['params']['id']},'include':[{'model':db[_0xe323('0x85')],'as':'List','include':[{'model':db['CmContact'],'as':_0xe323('0x86'),'where':_0x5bfbd2,'limit':0x1,'order':[[_0xe323('0x87'),_0xe323('0x88')]]}]},{'model':db[_0xe323('0x89')],'as':_0xe323('0x8a')}]});})[_0xe323('0x39')](handleEntityNotFound(_0x5c6c4c,null))['then'](function(_0x54f51c){if(_0x54f51c&&_0x54f51c['List']){_0xdde0e3['account']=_0x54f51c;_0xdde0e3[_0xe323('0x8b')]=_0x54f51c[_0xe323('0x8a')];_0xdde0e3['list']=_0x54f51c[_0xe323('0x8c')];_0xdde0e3['applications']=_[_0xe323('0x8d')](_0xdde0e3[_0xe323('0x8b')],[_0xe323('0x8e')],[_0xe323('0x8f')]);if(_0xdde0e3[_0xe323('0x90')][_0xe323('0x8a')]){delete _0xdde0e3[_0xe323('0x90')][_0xe323('0x8a')];}if(_0xdde0e3[_0xe323('0x90')]['List']&&_0xdde0e3[_0xe323('0x90')]['List'][_0xe323('0x86')]['length']){return _0xdde0e3[_0xe323('0x90')][_0xe323('0x8c')][_0xe323('0x86')][0x0];}var _0x4423ce=_[_0xe323('0x1d')](_0x3229e9[_0xe323('0x68')],{'firstName':_0x3229e9[_0xe323('0x68')][_0xe323('0x84')],'ListId':_0x54f51c[_0xe323('0x7c')]});_0x4423ce[_0x3229e9[_0xe323('0x68')][_0xe323('0x82')]]=_0x3229e9['body']['from'];return db[_0xe323('0x76')][_0xe323('0x5f')](_0x4423ce,{'fields':_0x34beb6,'raw':!![]});}})[_0xe323('0x39')](handleEntityNotFound(_0x5c6c4c,null))['then'](function(_0x3a1eb2){_0xdde0e3['contact']=_0x3a1eb2;if(_0x3a1eb2){var _0x36d1a8={'ContactId':_0x3a1eb2['id'],'OpenchannelAccountId':_0x3229e9['params']['id'],'from':(_0x3a1eb2[_0xe323('0x91')]||'')+'\x20'+(_0x3a1eb2[_0xe323('0x92')]||'')};var _0x8ebc70={'OpenchannelAccountId':_0x3229e9[_0xe323('0x5b')]['id'],'closed':![]};if(_0x3229e9[_0xe323('0x68')][_0xe323('0x93')]){_0x8ebc70['threadId']=_0x3229e9[_0xe323('0x68')]['threadId'];return db['OpenchannelInteraction'][_0xe323('0x5e')]({'where':_0x8ebc70})['then'](function(_0x50dcb5){if(_0x50dcb5){return[_0x50dcb5,![]];}_0x36d1a8[_0xe323('0x93')]=_0x3229e9[_0xe323('0x68')][_0xe323('0x93')];_0x36d1a8[_0xe323('0x94')]=_0x3229e9[_0xe323('0x68')]['externalUrl'];return db[_0xe323('0x95')][_0xe323('0x5f')](_0x36d1a8)[_0xe323('0x39')](function(_0x3c3a02){return[_0x3c3a02,!![]];});});}else{_0x8ebc70[_0xe323('0x93')]=null;}_0x8ebc70[_0xe323('0x96')]=_0x3a1eb2['id'];return db['OpenchannelInteraction'][_0xe323('0x5e')]({'where':_0x8ebc70})['then'](function(_0x28e5d7){if(_0x28e5d7){return[_0x28e5d7,![]];}return db[_0xe323('0x95')][_0xe323('0x5f')](_0x36d1a8)['then'](function(_0x252442){return[_0x252442,!![]];});});}})[_0xe323('0x97')](function(_0x458510,_0x6c62aa){if(_0x458510){_0x45cb48=_0x6c62aa;if(!_0x6c62aa){var _0x30a869={'from':(_0xdde0e3[_0xe323('0x98')][_0xe323('0x91')]||'')+'\x20'+(_0xdde0e3[_0xe323('0x98')][_0xe323('0x92')]||'')};if(_0x3229e9['body'][_0xe323('0x93')]&&_0x3229e9[_0xe323('0x68')][_0xe323('0x99')]&&_0x3229e9[_0xe323('0x68')][_0xe323('0x93')]!=_0x3229e9[_0xe323('0x68')][_0xe323('0x99')]){_0x30a869[_0xe323('0x93')]=_0x3229e9['body'][_0xe323('0x99')];}return _0x458510[_0xe323('0x38')](_0x30a869);}else{return _0x458510;}}})['then'](function(_0x480757){_0xdde0e3['interaction']=_0x480757[_0xe323('0x3b')]({'plain':!![]});_0xdde0e3[_0xe323('0x9a')][_0xe323('0x9b')]=_0x45cb48;if(_0xdde0e3['interaction'][_0xe323('0x9b')]){if(_0xdde0e3[_0xe323('0x90')][_0xe323('0x9c')]){_0xdde0e3[_0xe323('0x8b')][_0xe323('0x9d')]({'id':0x0,'priority':_0xdde0e3[_0xe323('0x8b')]['length']+0x1,'app':'close','appdata':_0xe323('0x9e'),'interval':_0xe323('0x9f')});}}return db['OpenchannelMessage'][_0xe323('0x5f')]({'body':_0x3229e9[_0xe323('0x68')][_0xe323('0x68')],'OpenchannelAccountId':_0x3229e9['params']['id'],'OpenchannelInteractionId':_0x480757['id'],'direction':'in','ContactId':_0xdde0e3[_0xe323('0x98')]['id'],'AttachmentId':_0x3229e9[_0xe323('0x68')]['AttachmentId']});})[_0xe323('0x39')](function(_0x129de0){_0xdde0e3[_0xe323('0x2c')]=_0x129de0;if(!_0xdde0e3['interaction'][_0xe323('0xa0')])return;return db[_0xe323('0xa1')]['find']({'attributes':['id',_0xe323('0x3e')],'where':{'id':_0xdde0e3[_0xe323('0x9a')]['UserId']}});})['then'](function(_0x2386d9){if(_0x2386d9){_0xdde0e3[_0xe323('0x8b')][_0xe323('0xa2')]({'id':0x0,'priority':0x0,'app':_0xe323('0xa3'),'appdata':_0x2386d9[_0xe323('0x3e')]+','+(_0xdde0e3[_0xe323('0x90')][_0xe323('0xa4')]||0xa),'interval':_0xe323('0x9f')});}if(!_0xdde0e3['interaction'][_0xe323('0xa5')])return;return db[_0xe323('0xa6')][_0xe323('0x5e')]({'attributes':['id',_0xe323('0x3e')],'where':{'id':_0xdde0e3[_0xe323('0x9a')]['queueId']}});})[_0xe323('0x39')](function(_0x19f88){if(_0x19f88){_0xdde0e3['applications'][_0xe323('0xa2')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x19f88['name']+','+(_0xdde0e3['account'][_0xe323('0xa7')]||0x12c),'interval':_0xe323('0x9f')});}return respondWithRpcPromise('Start','startRouting',_0xdde0e3);})['then'](function(_0x24dd8d){respondWithRpcPromise(_0xe323('0xa8'),'EventManager',{'event':_0xe323('0x74'),'message':_0x24dd8d},client9002);return _0x24dd8d;})[_0xe323('0x39')](respondWithResult(_0x5c6c4c,null))[_0xe323('0x2d')](handleError(_0x5c6c4c,null));};exports[_0xe323('0xa9')]=function(_0x556af2,_0x3bcfc7){var _0xa510b7=_0x556af2['params']['id'];var _0x5afae7=_0x556af2['body'];var _0x5606e0=0xc8;var _0x13f018=null;return db['sequelize']['transaction']({'isolationLevel':db[_0xe323('0xaa')][_0xe323('0xab')][_0xe323('0xac')]['READ_COMMITTED']},function(_0x461960){return db['OpenchannelAccount'][_0xe323('0x6d')]({'where':{'id':_0xa510b7},'transaction':_0x461960})[_0xe323('0x39')](function(_0x21684b){if(_0x21684b){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0xa510b7},'transaction':_0x461960})[_0xe323('0x39')](function(){var _0x59173e=_['map'](_0x5afae7,function(_0x587267){_0x587267[_0xe323('0x6a')]=_0xa510b7;return _0x587267;});return db[_0xe323('0x89')][_0xe323('0xad')](_0x59173e,{'transaction':_0x461960});});}else{_0x5606e0=0x194;_0x13f018=[];}});})[_0xe323('0x39')](function(){if(_0x5606e0!==0x194){return db[_0xe323('0x89')][_0xe323('0xae')]({'where':{'OpenchannelAccountId':_0xa510b7},'order':_0xe323('0x8e')})[_0xe323('0x39')](function(_0x4b23cf){_0x13f018=_0x4b23cf;});}})[_0xe323('0x2d')](function(_0xe834c4){_0x5606e0=0x1f4;logger[_0xe323('0x2a')](_0xe834c4[_0xe323('0x3d')]);if(_0xe834c4['name']){delete _0xe834c4[_0xe323('0x3e')];}_0x13f018=_0xe834c4;})['finally'](function(){if(_0x13f018===null){_0x3bcfc7[_0xe323('0x2e')](_0x5606e0);}else{if(_0x5606e0===0x1f4){_0x3bcfc7[_0xe323('0x2f')](_0x5606e0)[_0xe323('0x3f')](_0x13f018);}else{_0x3bcfc7[_0xe323('0x2f')](_0x5606e0)[_0xe323('0x35')](_0x13f018);}}});};exports['getApplications']=function(_0x5e95c0,_0x32f4ce,_0x12f5d3){var _0x24a5e2={};var _0x1c717a={};var _0xe1ca2;var _0x2dd9d5;return db[_0xe323('0x42')][_0xe323('0x6d')]({'where':{'id':_0x5e95c0['params']['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x32f4ce,null))[_0xe323('0x39')](function(_0x2e25fe){if(_0x2e25fe){_0xe1ca2=_0x2e25fe;_0x1c717a[_0xe323('0x45')]=_[_0xe323('0x47')](db['OpenchannelApplication'][_0xe323('0x5d')]);_0x1c717a['query']=_[_0xe323('0x47')](_0x5e95c0['query']);_0x1c717a[_0xe323('0x51')]=_[_0xe323('0x48')](_0x1c717a[_0xe323('0x45')],_0x1c717a['query']);_0x24a5e2[_0xe323('0x49')]=_[_0xe323('0x48')](_0x1c717a[_0xe323('0x45')],qs[_0xe323('0x4a')](_0x5e95c0[_0xe323('0x46')][_0xe323('0x4a')]));_0x24a5e2['attributes']=_0x24a5e2[_0xe323('0x49')][_0xe323('0x4b')]?_0x24a5e2[_0xe323('0x49')]:_0x1c717a['model'];_0x24a5e2[_0xe323('0x4e')]=qs['sort'](_0x5e95c0['query'][_0xe323('0x4f')]);_0x24a5e2[_0xe323('0x50')]=qs[_0xe323('0x51')](_[_0xe323('0x52')](_0x5e95c0['query'],_0x1c717a[_0xe323('0x51')]));if(_0x5e95c0[_0xe323('0x46')][_0xe323('0x53')]){_0x24a5e2[_0xe323('0x50')]=_[_0xe323('0x54')](_0x24a5e2[_0xe323('0x50')],{'$or':_[_0xe323('0x72')](_0x24a5e2['attributes'],function(_0x5a3275){var _0x4b6b8d={};_0x4b6b8d[_0x5a3275]={'$like':'%'+_0x5e95c0[_0xe323('0x46')]['filter']+'%'};return _0x4b6b8d;})});}_0x24a5e2=_[_0xe323('0x54')]({},_0x24a5e2,_0x5e95c0[_0xe323('0x56')]);return _0xe1ca2['getApplications'](_0x24a5e2);}})[_0xe323('0x39')](function(_0x1deae5){if(_0x1deae5){_0x2dd9d5=_0x1deae5['length'];if(!_0x5e95c0[_0xe323('0x46')][_0xe323('0x4c')]('nolimit')){_0x24a5e2[_0xe323('0x33')]=qs[_0xe323('0x33')](_0x5e95c0[_0xe323('0x46')][_0xe323('0x33')]);_0x24a5e2[_0xe323('0x30')]=qs[_0xe323('0x30')](_0x5e95c0[_0xe323('0x46')][_0xe323('0x30')]);}return _0xe1ca2['getApplications'](_0x24a5e2);}})['then'](function(_0x301df9){if(_0x301df9){return _0x301df9?{'count':_0x2dd9d5,'rows':_0x301df9}:null;}})[_0xe323('0x39')](respondWithResult(_0x32f4ce,null))['catch'](handleError(_0x32f4ce,null));};exports[_0xe323('0xaf')]=function(_0x147cec,_0x22ec86,_0x467827){var _0x41a110={'raw':![],'where':{}};var _0x4636cc={};var _0x1b56d7={'count':0x0,'rows':[]};return db[_0xe323('0x42')][_0xe323('0x6d')]({'where':{'id':_0x147cec[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x22ec86,null))['then'](function(_0x5a1730){if(_0x5a1730){_0x4636cc[_0xe323('0x45')]=_[_0xe323('0x47')](db['OpenchannelInteraction']['rawAttributes']);_0x4636cc[_0xe323('0x46')]=_['keys'](_0x147cec[_0xe323('0x46')]);_0x4636cc[_0xe323('0x51')]=_['intersection'](_0x4636cc['model'],_0x4636cc[_0xe323('0x46')]);_0x41a110[_0xe323('0x49')]=_[_0xe323('0x48')](_0x4636cc[_0xe323('0x45')],qs[_0xe323('0x4a')](_0x147cec[_0xe323('0x46')][_0xe323('0x4a')]));_0x41a110[_0xe323('0x49')]=_0x41a110[_0xe323('0x49')][_0xe323('0x4b')]?_0x41a110[_0xe323('0x49')]:_0x4636cc['model'];if(!_0x147cec[_0xe323('0x46')][_0xe323('0x4c')]('nolimit')){_0x41a110[_0xe323('0x33')]=qs['limit'](_0x147cec[_0xe323('0x46')][_0xe323('0x33')]);_0x41a110[_0xe323('0x30')]=qs[_0xe323('0x30')](_0x147cec[_0xe323('0x46')][_0xe323('0x30')]);}_0x41a110[_0xe323('0x4e')]=qs[_0xe323('0x4f')](_0x147cec['query'][_0xe323('0x4f')]);_0x41a110[_0xe323('0x50')]=qs[_0xe323('0x51')](_[_0xe323('0x52')](_0x147cec[_0xe323('0x46')],_0x4636cc[_0xe323('0x51')]));_0x41a110[_0xe323('0x50')]['OpenchannelAccountId']=_0x5a1730['id'];if(_0x147cec[_0xe323('0x46')][_0xe323('0x53')]){_0x41a110[_0xe323('0x50')]=_[_0xe323('0x54')](_0x41a110[_0xe323('0x50')],{'$or':_[_0xe323('0x72')](_0x41a110['attributes'],function(_0x30faca){var _0x5ab2eb={};_0x5ab2eb[_0x30faca]={'$like':'%'+_0x147cec['query'][_0xe323('0x53')]+'%'};return _0x5ab2eb;})});}_0x41a110=_['merge']({},_0x41a110,_0x147cec[_0xe323('0x56')]);return db[_0xe323('0x95')]['count']({'where':_0x41a110[_0xe323('0x50')]})[_0xe323('0x39')](function(_0x2c6a20){_0x1b56d7[_0xe323('0x32')]=_0x2c6a20;if(_0x147cec[_0xe323('0x46')][_0xe323('0x57')]){_0x41a110[_0xe323('0x58')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xe323('0xa1')],'as':'Owner','attributes':[_0xe323('0x3e'),_0xe323('0xb0'),_0xe323('0xb1')],'required':![]},{'model':db[_0xe323('0xb2')],'as':'Tags','attributes':['id',_0xe323('0x3e'),'color'],'where':_0x147cec[_0xe323('0x46')][_0xe323('0xb3')]?{'id':_0x147cec[_0xe323('0x46')][_0xe323('0xb3')]}:undefined,'required':_0x147cec[_0xe323('0x46')][_0xe323('0xb3')]?!![]:![]}];}return db[_0xe323('0x95')][_0xe323('0x59')](_0x41a110);})['then'](function(_0x3ce01c){_0x1b56d7[_0xe323('0x6e')]=_0x3ce01c;return _0x1b56d7;});}})[_0xe323('0x39')](respondWithFilteredResult(_0x22ec86,_0x41a110))[_0xe323('0x2d')](handleError(_0x22ec86,null));};exports['addAgents']=function(_0x4c3e32,_0x4b2374,_0x4f7c0d){return db[_0xe323('0x42')]['find']({'where':{'id':_0x4c3e32[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x4b2374,null))[_0xe323('0x39')](function(_0x5068e9){if(_0x5068e9){return _0x5068e9[_0xe323('0xb4')](_0x4c3e32[_0xe323('0x68')][_0xe323('0x70')],_[_0xe323('0xb5')](_0x4c3e32[_0xe323('0x68')],[_0xe323('0x70'),'id'])||{})[_0xe323('0x97')](function(_0x35afdf){for(var _0x572fd2=0x0;_0x572fd2<_0x4c3e32[_0xe323('0x68')][_0xe323('0x70')][_0xe323('0x4b')];_0x572fd2+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':Number(_0x4c3e32['body'][_0xe323('0x70')][_0x572fd2]),'OpenchannelAccountId':Number(_0x4c3e32['params']['id'])});}return _0x35afdf;});}})[_0xe323('0x39')](respondWithResult(_0x4b2374,null))['catch'](handleError(_0x4b2374,null));};exports[_0xe323('0xb6')]=function(_0x435c3c,_0x25970b,_0x5478a0){return db[_0xe323('0x42')][_0xe323('0x5e')]({'where':{'id':_0x435c3c['params']['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x25970b,null))[_0xe323('0x39')](function(_0x5ae090){if(_0x5ae090){return _0x5ae090[_0xe323('0xb6')](_0x435c3c[_0xe323('0x46')]['ids'])[_0xe323('0x39')](function(){if(_[_0xe323('0xb7')](_0x435c3c[_0xe323('0x46')][_0xe323('0x70')])){for(var _0x25581b=0x0;_0x25581b<_0x435c3c[_0xe323('0x46')][_0xe323('0x70')][_0xe323('0x4b')];_0x25581b+=0x1){socket[_0xe323('0xb8')](_0xe323('0xb9'),{'UserId':Number(_0x435c3c[_0xe323('0x46')][_0xe323('0x70')][_0x25581b]),'OpenchannelAccountId':Number(_0x435c3c[_0xe323('0x5b')]['id'])});}}else{socket[_0xe323('0xb8')](_0xe323('0xb9'),{'UserId':Number(_0x435c3c[_0xe323('0x46')][_0xe323('0x70')]),'OpenchannelAccountId':Number(_0x435c3c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x25970b,null))[_0xe323('0x2d')](handleError(_0x25970b,null));};exports[_0xe323('0xba')]=function(_0x3e8ac4,_0x4d9f59,_0x7fc410){var _0x5e9d6d={};var _0x225377={};var _0x11afba;var _0x5e0be4;return db[_0xe323('0x42')][_0xe323('0x6d')]({'where':{'id':_0x3e8ac4[_0xe323('0x5b')]['id']}})[_0xe323('0x39')](handleEntityNotFound(_0x4d9f59,null))[_0xe323('0x39')](function(_0x394d1f){if(_0x394d1f){_0x11afba=_0x394d1f;_0x225377['model']=_['keys'](db['User'][_0xe323('0x5d')]);_0x225377[_0xe323('0x46')]=_[_0xe323('0x47')](_0x3e8ac4['query']);_0x225377['filters']=_['intersection'](_0x225377[_0xe323('0x45')],_0x225377['query']);_0x5e9d6d[_0xe323('0x49')]=_[_0xe323('0x48')](_0x225377['model'],qs[_0xe323('0x4a')](_0x3e8ac4[_0xe323('0x46')]['fields']));_0x5e9d6d[_0xe323('0x49')]=_0x5e9d6d[_0xe323('0x49')][_0xe323('0x4b')]?_0x5e9d6d[_0xe323('0x49')]:_0x225377[_0xe323('0x45')];_0x5e9d6d[_0xe323('0x4e')]=qs[_0xe323('0x4f')](_0x3e8ac4[_0xe323('0x46')]['sort']);_0x5e9d6d[_0xe323('0x50')]=qs['filters'](_[_0xe323('0x52')](_0x3e8ac4[_0xe323('0x46')],_0x225377[_0xe323('0x51')]));if(_0x3e8ac4[_0xe323('0x46')][_0xe323('0x53')]){_0x5e9d6d[_0xe323('0x50')]=_[_0xe323('0x54')](_0x5e9d6d['where'],{'$or':_[_0xe323('0x72')](_0x5e9d6d['attributes'],function(_0x2948c8){var _0x3a4a0a={};_0x3a4a0a[_0x2948c8]={'$like':'%'+_0x3e8ac4[_0xe323('0x46')][_0xe323('0x53')]+'%'};return _0x3a4a0a;})});}_0x5e9d6d=_[_0xe323('0x54')]({},_0x5e9d6d,_0x3e8ac4['options']);return _0x11afba[_0xe323('0xba')](_0x5e9d6d);}})['then'](function(_0x3697ae){if(_0x3697ae){_0x5e0be4=_0x3697ae['length'];if(!_0x3e8ac4['query'][_0xe323('0x4c')](_0xe323('0x4d'))){_0x5e9d6d[_0xe323('0x33')]=qs[_0xe323('0x33')](_0x3e8ac4[_0xe323('0x46')]['limit']);_0x5e9d6d[_0xe323('0x30')]=qs[_0xe323('0x30')](_0x3e8ac4['query']['offset']);}return _0x11afba[_0xe323('0xba')](_0x5e9d6d);}})[_0xe323('0x39')](function(_0x444da5){if(_0x444da5){return _0x444da5?{'count':_0x5e0be4,'rows':_0x444da5}:null;}})[_0xe323('0x39')](respondWithResult(_0x4d9f59,null))[_0xe323('0x2d')](handleError(_0x4d9f59,null));};exports[_0xe323('0x3f')]=function(_0xdfeba5,_0x5910e6,_0x35cad8){var _0x194912,_0x733a96,_0xc8f6da;if(_[_0xe323('0x7d')](_0xdfeba5['body'][_0xe323('0x68')])||_0xdfeba5[_0xe323('0x68')]['body']===''){throw new db[(_0xe323('0x80'))][(_0xe323('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0xdfeba5['body']['to'])){}_0x194912=_0xdfeba5[_0xe323('0x68')]['to'];return db[_0xe323('0x42')][_0xe323('0x6d')]({'where':{'id':_0xdfeba5[_0xe323('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5910e6,null))[_0xe323('0x39')](function(_0x559fb9){if(_0x559fb9){return db[_0xe323('0x42')][_0xe323('0x5e')]({'where':{'id':_0x559fb9['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0xe323('0x76')],'as':_0xe323('0x86'),'where':{[_0x559fb9['mapKey']]:_0x194912},'limit':0x1,'order':[[_0xe323('0x87'),_0xe323('0x88')]]}]}]})['then'](handleEntityNotFound(_0x5910e6,null))[_0xe323('0x39')](function(_0x15fa2c){if(_0x15fa2c&&_0x15fa2c[_0xe323('0x8c')]){_0x733a96=_0x15fa2c['get']({'plain':!![]});if(_0x733a96[_0xe323('0x8c')]&&_0x733a96[_0xe323('0x8c')][_0xe323('0x86')][_0xe323('0x4b')]){return _0x733a96[_0xe323('0x8c')][_0xe323('0x86')][0x0];}return db[_0xe323('0x76')][_0xe323('0x5f')](_[_0xe323('0x1d')](_0xdfeba5[_0xe323('0x68')],{'firstName':_0x194912,[_0x15fa2c[_0xe323('0x82')]]:_0x194912,'phone':_0x194912,'ListId':_0x733a96[_0xe323('0x7c')]}));}})[_0xe323('0x39')](handleEntityNotFound(_0x5910e6,null))['then'](function(_0x299556){if(_0x299556){_0xc8f6da=_0x299556;return db[_0xe323('0x95')]['find']({'where':{'ContactId':_0xc8f6da['id'],'closed':![],'OpenchannelAccountId':_0x733a96['id']}})[_0xe323('0x39')](function(_0xb2aa3a){if(_0xb2aa3a){return[_0xb2aa3a,![]];}return db['OpenchannelInteraction'][_0xe323('0x5f')]({'UserId':_0xdfeba5[_0xe323('0x60')]['id'],'ContactId':_0xc8f6da['id'],'OpenchannelAccountId':_0x733a96['id'],'lastMsgDirection':'out','firstMsgDirection':_0xe323('0xbb'),'Messages':[_[_0xe323('0x54')](_0xdfeba5[_0xe323('0x68')],{'read':![],'body':_0xdfeba5['body'][_0xe323('0x68')],'OpenchannelAccountId':_0x733a96['id'],'UserId':_0xdfeba5[_0xe323('0x60')]['id'],'ContactId':_0xc8f6da['id']})]},{'include':[{'model':db[_0xe323('0xbc')],'as':'Messages'}]})[_0xe323('0x39')](function(_0x4fefb9){return[_0x4fefb9,!![]];});});}})[_0xe323('0x97')](function(_0x1e0cdb,_0x5ce809){if(_0x5ce809){return _0x1e0cdb;}return db['OpenchannelMessage'][_0xe323('0x5f')](_[_0xe323('0x54')](_0xdfeba5[_0xe323('0x68')],{'read':![],'body':_0xdfeba5[_0xe323('0x68')][_0xe323('0x68')],'OpenchannelAccountId':_0x733a96['id'],'OpenchannelInteractionId':_0x1e0cdb['id'],'UserId':_0xdfeba5[_0xe323('0x60')]['id'],'ContactId':_0xc8f6da['id']}))[_0xe323('0x39')](function(_0x5e2bbd){_0x1e0cdb['dataValues'][_0xe323('0xbd')]=[];_0x1e0cdb[_0xe323('0xbe')]['Messages']['push'](_0x5e2bbd[_0xe323('0xbe')]);return _0x1e0cdb;});});}})[_0xe323('0x39')](respondWithResult(_0x5910e6,null))[_0xe323('0x2d')](handleError(_0x5910e6,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 3ee7c2b..0ae2c99 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 _0x99e9=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports'];(function(_0x405493,_0x1b4da3){var _0x474f56=function(_0x3680d7){while(--_0x3680d7){_0x405493['push'](_0x405493['shift']());}};_0x474f56(++_0x1b4da3);}(_0x99e9,0xb4));var _0x999e=function(_0x512e72,_0x49ffe1){_0x512e72=_0x512e72-0x0;var _0x143086=_0x99e9[_0x512e72];return _0x143086;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x999e('0x0'))['db'][_0x999e('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x999e('0x2')](0x0);var events={'afterCreate':_0x999e('0x3'),'afterUpdate':'update','afterDestroy':_0x999e('0x4')};function emitEvent(_0x2f803e){return function(_0x3aac27,_0x4e2112,_0x296411){OpenchannelAccountEvents['emit'](_0x2f803e+':'+_0x3aac27['id'],_0x3aac27);OpenchannelAccountEvents[_0x999e('0x5')](_0x2f803e,_0x3aac27);_0x296411(null);};}for(var e in events){if(events[_0x999e('0x6')](e)){var event=events[e];OpenchannelAccount[_0x999e('0x7')](e,emitEvent(event));}}module[_0x999e('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x54ef=['remove','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update'];(function(_0x57b336,_0x5aa2fa){var _0x57213a=function(_0x27d10d){while(--_0x27d10d){_0x57b336['push'](_0x57b336['shift']());}};_0x57213a(++_0x5aa2fa);}(_0x54ef,0x112));var _0xf54e=function(_0x14bbc4,_0x3ebbc6){_0x14bbc4=_0x14bbc4-0x0;var _0x427a50=_0x54ef[_0x14bbc4];return _0x427a50;};'use strict';var EventEmitter=require(_0xf54e('0x0'));var OpenchannelAccount=require(_0xf54e('0x1'))['db'][_0xf54e('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf54e('0x3'),'afterUpdate':_0xf54e('0x4'),'afterDestroy':_0xf54e('0x5')};function emitEvent(_0x42b9b2){return function(_0x8b6bb6,_0x431e36,_0x12d43f){OpenchannelAccountEvents['emit'](_0x42b9b2+':'+_0x8b6bb6['id'],_0x8b6bb6);OpenchannelAccountEvents['emit'](_0x42b9b2,_0x8b6bb6);_0x12d43f(null);};}for(var e in events){if(events[_0xf54e('0x6')](e)){var event=events[e];OpenchannelAccount[_0xf54e('0x7')](e,emitEvent(event));}}module[_0xf54e('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 1e33338..9c8cd59 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(_0x38e6a5,_0x4dbec7){var _0x4e9745=function(_0x452b60){while(--_0x452b60){_0x38e6a5['push'](_0x38e6a5['shift']());}};_0x4e9745(++_0x4dbec7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x27b8f1,_0x2c02a2){var _0x2f7c80=function(_0x15d1fb){while(--_0x15d1fb){_0x27b8f1['push'](_0x27b8f1['shift']());}};_0x2f7c80(++_0x2c02a2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 ff2f91b..ab3ea72 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 _0x4af8=['request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','defaults','redis','./openchannelAccount.socket'];(function(_0x7fb67d,_0x165ff3){var _0x1a6725=function(_0x32bd91){while(--_0x32bd91){_0x7fb67d['push'](_0x7fb67d['shift']());}};_0x1a6725(++_0x165ff3);}(_0x4af8,0x1ad));var _0x84af=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0x4af8[_0x1ddedd];return _0xa3e1ac;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x84af('0x0'));var fs=require('fs');var Redis=require(_0x84af('0x1'));var db=require(_0x84af('0x2'))['db'];var utils=require(_0x84af('0x3'));var logger=require('../../config/logger')(_0x84af('0x4'));var config=require(_0x84af('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x84af('0x6')][_0x84af('0x7')]({'port':0x232a});config['redis']=_[_0x84af('0x8')](config[_0x84af('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x84af('0x9')]));require(_0x84af('0xa'))['register'](socket);function respondWithRpcPromise(_0xc9f91b,_0x535556,_0x1623f6){return new BPromise(function(_0x21e634,_0x34aa9e){return client[_0x84af('0xb')](_0xc9f91b,_0x1623f6)['then'](function(_0x31f283){logger['info'](_0x84af('0xc'),_0x535556,_0x84af('0xd'));logger['debug'](_0x84af('0xe'),_0x535556,_0x84af('0xd'),JSON[_0x84af('0xf')](_0x31f283));if(_0x31f283[_0x84af('0x10')]){if(_0x31f283['error'][_0x84af('0x11')]===0x1f4){logger['error'](_0x84af('0xc'),_0x535556,_0x31f283[_0x84af('0x10')]['message']);return _0x34aa9e(_0x31f283[_0x84af('0x10')][_0x84af('0x12')]);}logger['error'](_0x84af('0xc'),_0x535556,_0x31f283['error'][_0x84af('0x12')]);return _0x21e634(_0x31f283[_0x84af('0x10')]['message']);}else{logger['info'](_0x84af('0xc'),_0x535556,_0x84af('0xd'));_0x21e634(_0x31f283[_0x84af('0x13')]['message']);}})['catch'](function(_0x187195){logger[_0x84af('0x10')](_0x84af('0xc'),_0x535556,_0x187195);_0x34aa9e(_0x187195);});});} \ No newline at end of file +var _0xae60=['client','http','redis','defaults','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','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x3ccd6d,_0x5a84a1){var _0x1905ec=function(_0x4e283e){while(--_0x4e283e){_0x3ccd6d['push'](_0x3ccd6d['shift']());}};_0x1905ec(++_0x5a84a1);}(_0xae60,0x1c7));var _0x0ae6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xae60[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});config[_0x0ae6('0xb')]=_[_0x0ae6('0xc')](config[_0x0ae6('0xb')],{'host':_0x0ae6('0xd'),'port':0x18eb});var socket=require(_0x0ae6('0xe'))(new Redis(config['redis']));require(_0x0ae6('0xf'))[_0x0ae6('0x10')](socket);function respondWithRpcPromise(_0x3a8b0e,_0x39787a,_0x4c2698){return new BPromise(function(_0x24e211,_0x1def8c){return client[_0x0ae6('0x11')](_0x3a8b0e,_0x4c2698)[_0x0ae6('0x12')](function(_0x3ae7fa){logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));logger[_0x0ae6('0x16')](_0x0ae6('0x17'),_0x39787a,_0x0ae6('0x15'),JSON[_0x0ae6('0x18')](_0x3ae7fa));if(_0x3ae7fa[_0x0ae6('0x19')]){if(_0x3ae7fa[_0x0ae6('0x19')]['code']===0x1f4){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x1def8c(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);return _0x24e211(_0x3ae7fa[_0x0ae6('0x19')][_0x0ae6('0x1a')]);}else{logger[_0x0ae6('0x13')](_0x0ae6('0x14'),_0x39787a,_0x0ae6('0x15'));_0x24e211(_0x3ae7fa[_0x0ae6('0x1b')][_0x0ae6('0x1a')]);}})[_0x0ae6('0x1c')](function(_0x2ca2a3){logger[_0x0ae6('0x19')](_0x0ae6('0x14'),_0x39787a,_0x2ca2a3);_0x1def8c(_0x2ca2a3);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c5cee8e..8baaca7 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 _0xbb95=['openchannelAccount:','./openchannelAccount.events','save','emit','register','length'];(function(_0x30b699,_0x514bc8){var _0x1e4c65=function(_0x35f977){while(--_0x35f977){_0x30b699['push'](_0x30b699['shift']());}};_0x1e4c65(++_0x514bc8);}(_0xbb95,0x7f));var _0x5bb9=function(_0x5a550c,_0x4b1bc0){_0x5a550c=_0x5a550c-0x0;var _0x5f2417=_0xbb95[_0x5a550c];return _0x5f2417;};'use strict';var OpenchannelAccountEvents=require(_0x5bb9('0x0'));var events=[_0x5bb9('0x1'),'remove','update'];function createListener(_0x15492a,_0x2a9386){return function(_0x535716){_0x2a9386[_0x5bb9('0x2')](_0x15492a,_0x535716);};}function removeListener(_0x572ef3,_0x4ef42d){return function(){OpenchannelAccountEvents['removeListener'](_0x572ef3,_0x4ef42d);};}exports[_0x5bb9('0x3')]=function(_0x2b72aa){for(var _0x49b590=0x0,_0x180e69=events[_0x5bb9('0x4')];_0x49b590<_0x180e69;_0x49b590++){var _0x39f347=events[_0x49b590];var _0x5e8b1c=createListener(_0x5bb9('0x5')+_0x39f347,_0x2b72aa);OpenchannelAccountEvents['on'](_0x39f347,_0x5e8b1c);}}; \ No newline at end of file +var _0xb492=['remove','update','emit','removeListener','length','openchannelAccount:','save'];(function(_0x2123a2,_0x3a2254){var _0x5bde85=function(_0x34469d){while(--_0x34469d){_0x2123a2['push'](_0x2123a2['shift']());}};_0x5bde85(++_0x3a2254);}(_0xb492,0x172));var _0x2b49=function(_0x416ba0,_0x2f291f){_0x416ba0=_0x416ba0-0x0;var _0x31381f=_0xb492[_0x416ba0];return _0x31381f;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x2b49('0x0'),_0x2b49('0x1'),_0x2b49('0x2')];function createListener(_0x1f3b35,_0x51fad7){return function(_0x522210){_0x51fad7[_0x2b49('0x3')](_0x1f3b35,_0x522210);};}function removeListener(_0x340296,_0x317a1d){return function(){OpenchannelAccountEvents[_0x2b49('0x4')](_0x340296,_0x317a1d);};}exports['register']=function(_0x53508a){for(var _0x346359=0x0,_0x363d21=events[_0x2b49('0x5')];_0x346359<_0x363d21;_0x346359++){var _0x2b745f=events[_0x346359];var _0x1b06c2=createListener(_0x2b49('0x6')+_0x2b745f,_0x53508a);OpenchannelAccountEvents['on'](_0x2b745f,_0x1b06c2);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 44f576c..abc0999 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 _0x1e11=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','./openchannelApplication.controller','get','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x12080a,_0x1ce3bc){var _0x5381d6=function(_0x50bcd2){while(--_0x50bcd2){_0x12080a['push'](_0x12080a['shift']());}};_0x5381d6(++_0x1ce3bc);}(_0x1e11,0x1ed));var _0x11e1=function(_0xfa7b6,_0x3e4e59){_0xfa7b6=_0xfa7b6-0x0;var _0x43cd5e=_0x1e11[_0xfa7b6];return _0x43cd5e;};'use strict';var multer=require(_0x11e1('0x0'));var util=require(_0x11e1('0x1'));var path=require(_0x11e1('0x2'));var timeout=require(_0x11e1('0x3'));var express=require(_0x11e1('0x4'));var router=express[_0x11e1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x11e1('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x11e1('0x7'));router[_0x11e1('0x8')]('/',auth[_0x11e1('0x9')](),controller['index']);router['get'](_0x11e1('0xa'),auth[_0x11e1('0x9')](),controller[_0x11e1('0xb')]);router['post']('/',auth[_0x11e1('0x9')](),controller[_0x11e1('0xc')]);router[_0x11e1('0xd')](_0x11e1('0xa'),auth[_0x11e1('0x9')](),controller[_0x11e1('0xe')]);router[_0x11e1('0xf')](_0x11e1('0xa'),auth['isAuthenticated'](),controller[_0x11e1('0x10')]);module['exports']=router; \ No newline at end of file +var _0x01ab=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0x01ab,0x13e));var _0xb01a=function(_0x4e8401,_0x51b328){_0x4e8401=_0x4e8401-0x0;var _0x17269f=_0x01ab[_0x4e8401];return _0x17269f;};'use strict';var multer=require(_0xb01a('0x0'));var util=require(_0xb01a('0x1'));var path=require(_0xb01a('0x2'));var timeout=require('connect-timeout');var express=require(_0xb01a('0x3'));var router=express[_0xb01a('0x4')]();var fs_extra=require(_0xb01a('0x5'));var auth=require(_0xb01a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb01a('0x7'));var controller=require(_0xb01a('0x8'));router[_0xb01a('0x9')]('/',auth[_0xb01a('0xa')](),controller[_0xb01a('0xb')]);router[_0xb01a('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xb01a('0xc')]);router[_0xb01a('0xd')]('/',auth[_0xb01a('0xa')](),controller[_0xb01a('0xe')]);router[_0xb01a('0xf')](_0xb01a('0x10'),auth[_0xb01a('0xa')](),controller[_0xb01a('0x11')]);router[_0xb01a('0x12')]('/:id',auth[_0xb01a('0xa')](),controller[_0xb01a('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 2cbfe6d..dea2dac 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 _0xcbdc=['INTEGER','STRING','TEXT','sequelize','exports'];(function(_0x573573,_0x2a520a){var _0x58b406=function(_0x351449){while(--_0x351449){_0x573573['push'](_0x573573['shift']());}};_0x58b406(++_0x2a520a);}(_0xcbdc,0xb7));var _0xccbd=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xcbdc[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0xccbd('0x0'));module[_0xccbd('0x1')]={'priority':{'type':Sequelize[_0xccbd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xccbd('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xccbd('0x4')]()},'description':{'type':Sequelize[_0xccbd('0x3')]},'interval':{'type':Sequelize[_0xccbd('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4414=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x25a19a,_0x536079){var _0x9d8a38=function(_0x55a45c){while(--_0x55a45c){_0x25a19a['push'](_0x25a19a['shift']());}};_0x9d8a38(++_0x536079);}(_0x4414,0x15f));var _0x4441=function(_0x4a9d73,_0x404b5f){_0x4a9d73=_0x4a9d73-0x0;var _0x2544c1=_0x4414[_0x4a9d73];return _0x2544c1;};'use strict';var Sequelize=require(_0x4441('0x0'));module[_0x4441('0x1')]={'priority':{'type':Sequelize[_0x4441('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4441('0x3')],'allowNull':![],'defaultValue':_0x4441('0x4')},'appdata':{'type':Sequelize[_0x4441('0x5')]()},'description':{'type':Sequelize[_0x4441('0x3')]},'interval':{'type':Sequelize[_0x4441('0x3')],'defaultValue':_0x4441('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index fa1b7f9..dd643ea 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 _0xe292=['type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','set','apply','reject','save','update','then','destroy','stack','name','index','map','OpenchannelApplication','rawAttributes','fieldName'];(function(_0x503790,_0x525c78){var _0x388092=function(_0x2ab2b8){while(--_0x2ab2b8){_0x503790['push'](_0x503790['shift']());}};_0x388092(++_0x525c78);}(_0xe292,0x102));var _0x2e29=function(_0x1db914,_0x47242b){_0x1db914=_0x1db914-0x0;var _0x397288=_0xe292[_0x1db914];return _0x397288;};'use strict';var emlformat=require(_0x2e29('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2e29('0x1'));var rp=require(_0x2e29('0x2'));var moment=require(_0x2e29('0x3'));var BPromise=require(_0x2e29('0x4'));var Mustache=require(_0x2e29('0x5'));var util=require('util');var path=require(_0x2e29('0x6'));var sox=require(_0x2e29('0x7'));var csv=require('to-csv');var ejs=require(_0x2e29('0x8'));var fs=require('fs');var fs_extra=require(_0x2e29('0x9'));var _=require(_0x2e29('0xa'));var squel=require(_0x2e29('0xb'));var crypto=require(_0x2e29('0xc'));var jsforce=require(_0x2e29('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2e29('0xe'));var querystring=require('querystring');var Papa=require(_0x2e29('0xf'));var Redis=require(_0x2e29('0x10'));var authService=require(_0x2e29('0x11'));var qs=require(_0x2e29('0x12'));var as=require(_0x2e29('0x13'));var hardwareService=require(_0x2e29('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2e29('0x15'));var config=require(_0x2e29('0x16'));var licenseUtil=require(_0x2e29('0x17'));var db=require(_0x2e29('0x18'))['db'];function respondWithStatusCode(_0xab5d07,_0x173e27){_0x173e27=_0x173e27||0xcc;return function(_0x43db3b){if(_0x43db3b){return _0xab5d07[_0x2e29('0x19')](_0x173e27);}return _0xab5d07[_0x2e29('0x1a')](_0x173e27)[_0x2e29('0x1b')]();};}function respondWithResult(_0x14ac22,_0xdc9d2a){_0xdc9d2a=_0xdc9d2a||0xc8;return function(_0x21667b){if(_0x21667b){return _0x14ac22[_0x2e29('0x1a')](_0xdc9d2a)['json'](_0x21667b);}};}function respondWithFilteredResult(_0x4da8e3,_0xf4ff83){return function(_0x4bbb66){if(_0x4bbb66){var _0x423def=typeof _0xf4ff83['offset']===_0x2e29('0x1c')&&typeof _0xf4ff83[_0x2e29('0x1d')]==='undefined';var _0x2371d7=_0x4bbb66['count'];var _0x5c5ef6=_0x423def?0x0:_0xf4ff83[_0x2e29('0x1e')];var _0xd55317=_0x423def?_0x4bbb66[_0x2e29('0x1f')]:_0xf4ff83[_0x2e29('0x1e')]+_0xf4ff83[_0x2e29('0x1d')];var _0x49c647;if(_0xd55317>=_0x2371d7){_0xd55317=_0x2371d7;_0x49c647=0xc8;}else{_0x49c647=0xce;}_0x4da8e3['status'](_0x49c647);return _0x4da8e3[_0x2e29('0x20')]('Content-Range',_0x5c5ef6+'-'+_0xd55317+'/'+_0x2371d7)['json'](_0x4bbb66);}return null;};}function patchUpdates(_0x57dd57){return function(_0x51e133){try{jsonpatch[_0x2e29('0x21')](_0x51e133,_0x57dd57,!![]);}catch(_0x285c59){return BPromise[_0x2e29('0x22')](_0x285c59);}return _0x51e133[_0x2e29('0x23')]();};}function saveUpdates(_0x559706,_0x29b068){return function(_0x4dc06e){if(_0x4dc06e){return _0x4dc06e[_0x2e29('0x24')](_0x559706)[_0x2e29('0x25')](function(_0x2f30df){return _0x2f30df;});}return null;};}function removeEntity(_0x2310db,_0x2830ba){return function(_0x321723){if(_0x321723){return _0x321723[_0x2e29('0x26')]()['then'](function(){_0x2310db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f0119,_0x13182a){return function(_0x549a29){if(!_0x549a29){_0x1f0119[_0x2e29('0x19')](0x194);}return _0x549a29;};}function handleError(_0x14e384,_0x2043c3){_0x2043c3=_0x2043c3||0x1f4;return function(_0x3c1b47){logger['error'](_0x3c1b47[_0x2e29('0x27')]);if(_0x3c1b47[_0x2e29('0x28')]){delete _0x3c1b47[_0x2e29('0x28')];}_0x14e384[_0x2e29('0x1a')](_0x2043c3)['send'](_0x3c1b47);};}exports[_0x2e29('0x29')]=function(_0x5dd056,_0x4242d1){var _0x410eca={},_0x3a0302={},_0xb74d4={'count':0x0,'rows':[]};var _0x3eb258=_[_0x2e29('0x2a')](db[_0x2e29('0x2b')][_0x2e29('0x2c')],function(_0x2a4957){return{'name':_0x2a4957[_0x2e29('0x2d')],'type':_0x2a4957[_0x2e29('0x2e')][_0x2e29('0x2f')]};});_0x3a0302['model']=_[_0x2e29('0x2a')](_0x3eb258,'name');_0x3a0302[_0x2e29('0x30')]=_['keys'](_0x5dd056[_0x2e29('0x30')]);_0x3a0302['filters']=_[_0x2e29('0x31')](_0x3a0302['model'],_0x3a0302[_0x2e29('0x30')]);_0x410eca['attributes']=_[_0x2e29('0x31')](_0x3a0302[_0x2e29('0x32')],qs[_0x2e29('0x33')](_0x5dd056['query'][_0x2e29('0x33')]));_0x410eca[_0x2e29('0x34')]=_0x410eca[_0x2e29('0x34')][_0x2e29('0x35')]?_0x410eca[_0x2e29('0x34')]:_0x3a0302[_0x2e29('0x32')];if(!_0x5dd056[_0x2e29('0x30')][_0x2e29('0x36')](_0x2e29('0x37'))){_0x410eca[_0x2e29('0x1d')]=qs[_0x2e29('0x1d')](_0x5dd056[_0x2e29('0x30')]['limit']);_0x410eca[_0x2e29('0x1e')]=qs['offset'](_0x5dd056[_0x2e29('0x30')]['offset']);}_0x410eca[_0x2e29('0x38')]=qs['sort'](_0x5dd056['query'][_0x2e29('0x39')]);_0x410eca[_0x2e29('0x3a')]=qs[_0x2e29('0x3b')](_[_0x2e29('0x3c')](_0x5dd056[_0x2e29('0x30')],_0x3a0302['filters']),_0x3eb258);if(_0x5dd056[_0x2e29('0x30')][_0x2e29('0x3d')]){_0x410eca[_0x2e29('0x3a')]=_[_0x2e29('0x3e')](_0x410eca[_0x2e29('0x3a')],{'$or':_[_0x2e29('0x2a')](_0x3eb258,function(_0x255952){if(_0x255952[_0x2e29('0x2e')]!==_0x2e29('0x3f')){var _0x3c8cd0={};_0x3c8cd0[_0x255952[_0x2e29('0x28')]]={'$like':'%'+_0x5dd056[_0x2e29('0x30')][_0x2e29('0x3d')]+'%'};return _0x3c8cd0;}})});}_0x410eca=_[_0x2e29('0x3e')]({},_0x410eca,_0x5dd056[_0x2e29('0x40')]);var _0x515aa9={'where':_0x410eca['where']};return db[_0x2e29('0x2b')]['count'](_0x515aa9)[_0x2e29('0x25')](function(_0x1e3217){_0xb74d4[_0x2e29('0x1f')]=_0x1e3217;if(_0x5dd056[_0x2e29('0x30')][_0x2e29('0x41')]){_0x410eca[_0x2e29('0x42')]=[{'all':!![]}];}return db[_0x2e29('0x2b')][_0x2e29('0x43')](_0x410eca);})[_0x2e29('0x25')](function(_0x23a708){_0xb74d4[_0x2e29('0x44')]=_0x23a708;return _0xb74d4;})[_0x2e29('0x25')](respondWithFilteredResult(_0x4242d1,_0x410eca))[_0x2e29('0x45')](handleError(_0x4242d1,null));};exports[_0x2e29('0x46')]=function(_0x309a0f,_0x2060ee){var _0x5b5164={'raw':!![],'where':{'id':_0x309a0f[_0x2e29('0x47')]['id']}},_0x3a57e9={};_0x3a57e9[_0x2e29('0x32')]=_[_0x2e29('0x48')](db[_0x2e29('0x2b')][_0x2e29('0x2c')]);_0x3a57e9[_0x2e29('0x30')]=_['keys'](_0x309a0f[_0x2e29('0x30')]);_0x3a57e9['filters']=_[_0x2e29('0x31')](_0x3a57e9['model'],_0x3a57e9['query']);_0x5b5164['attributes']=_[_0x2e29('0x31')](_0x3a57e9[_0x2e29('0x32')],qs[_0x2e29('0x33')](_0x309a0f['query'][_0x2e29('0x33')]));_0x5b5164[_0x2e29('0x34')]=_0x5b5164[_0x2e29('0x34')][_0x2e29('0x35')]?_0x5b5164[_0x2e29('0x34')]:_0x3a57e9['model'];if(_0x309a0f['query'][_0x2e29('0x41')]){_0x5b5164[_0x2e29('0x42')]=[{'all':!![]}];}_0x5b5164=_[_0x2e29('0x3e')]({},_0x5b5164,_0x309a0f[_0x2e29('0x40')]);return db[_0x2e29('0x2b')][_0x2e29('0x49')](_0x5b5164)[_0x2e29('0x25')](handleEntityNotFound(_0x2060ee,null))[_0x2e29('0x25')](respondWithResult(_0x2060ee,null))[_0x2e29('0x45')](handleError(_0x2060ee,null));};exports['create']=function(_0x348b80,_0x569f06){return db[_0x2e29('0x2b')][_0x2e29('0x4a')](_0x348b80['body'],{})[_0x2e29('0x25')](respondWithResult(_0x569f06,0xc9))[_0x2e29('0x45')](handleError(_0x569f06,null));};exports[_0x2e29('0x24')]=function(_0x413652,_0x1e1ec4){if(_0x413652['body']['id']){delete _0x413652[_0x2e29('0x4b')]['id'];}return db[_0x2e29('0x2b')]['find']({'where':{'id':_0x413652['params']['id']}})[_0x2e29('0x25')](handleEntityNotFound(_0x1e1ec4,null))[_0x2e29('0x25')](saveUpdates(_0x413652['body'],null))['then'](respondWithResult(_0x1e1ec4,null))[_0x2e29('0x45')](handleError(_0x1e1ec4,null));};exports[_0x2e29('0x26')]=function(_0x26fe83,_0xc1980f){return db[_0x2e29('0x2b')][_0x2e29('0x49')]({'where':{'id':_0x26fe83[_0x2e29('0x47')]['id']}})[_0x2e29('0x25')](handleEntityNotFound(_0xc1980f,null))['then'](removeEntity(_0xc1980f,null))['catch'](handleError(_0xc1980f,null));}; \ No newline at end of file +var _0xeccc=['path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','OpenchannelApplication','includeAll','include','findAll','rows','catch','show','find','create','body','params','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xa9eac1,_0x39a4f7){var _0x282f35=function(_0x30dbd4){while(--_0x30dbd4){_0xa9eac1['push'](_0xa9eac1['shift']());}};_0x282f35(++_0x39a4f7);}(_0xeccc,0x90));var _0xcecc=function(_0x4fedd4,_0x1dbf05){_0x4fedd4=_0x4fedd4-0x0;var _0x5dce0d=_0xeccc[_0x4fedd4];return _0x5dce0d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xcecc('0x0'));var jsonpatch=require(_0xcecc('0x1'));var rp=require(_0xcecc('0x2'));var moment=require(_0xcecc('0x3'));var BPromise=require(_0xcecc('0x4'));var Mustache=require(_0xcecc('0x5'));var util=require('util');var path=require(_0xcecc('0x6'));var sox=require(_0xcecc('0x7'));var csv=require(_0xcecc('0x8'));var ejs=require(_0xcecc('0x9'));var fs=require('fs');var fs_extra=require(_0xcecc('0xa'));var _=require('lodash');var squel=require(_0xcecc('0xb'));var crypto=require('crypto');var jsforce=require(_0xcecc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xcecc('0x8'));var querystring=require(_0xcecc('0xd'));var Papa=require(_0xcecc('0xe'));var Redis=require(_0xcecc('0xf'));var authService=require(_0xcecc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcecc('0x11'));var hardwareService=require(_0xcecc('0x12'));var logger=require(_0xcecc('0x13'))(_0xcecc('0x14'));var utils=require(_0xcecc('0x15'));var config=require(_0xcecc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xcecc('0x17'))['db'];function respondWithStatusCode(_0x5308ee,_0x35829c){_0x35829c=_0x35829c||0xcc;return function(_0x30d77e){if(_0x30d77e){return _0x5308ee[_0xcecc('0x18')](_0x35829c);}return _0x5308ee[_0xcecc('0x19')](_0x35829c)[_0xcecc('0x1a')]();};}function respondWithResult(_0x2dcfa5,_0x2b03f8){_0x2b03f8=_0x2b03f8||0xc8;return function(_0x3e4198){if(_0x3e4198){return _0x2dcfa5[_0xcecc('0x19')](_0x2b03f8)['json'](_0x3e4198);}};}function respondWithFilteredResult(_0x2f2130,_0x1f501e){return function(_0x3f5c5a){if(_0x3f5c5a){var _0x536d5c=typeof _0x1f501e[_0xcecc('0x1b')]==='undefined'&&typeof _0x1f501e[_0xcecc('0x1c')]===_0xcecc('0x1d');var _0x21003f=_0x3f5c5a[_0xcecc('0x1e')];var _0x30a991=_0x536d5c?0x0:_0x1f501e[_0xcecc('0x1b')];var _0x59e92b=_0x536d5c?_0x3f5c5a[_0xcecc('0x1e')]:_0x1f501e[_0xcecc('0x1b')]+_0x1f501e[_0xcecc('0x1c')];var _0x5cf21c;if(_0x59e92b>=_0x21003f){_0x59e92b=_0x21003f;_0x5cf21c=0xc8;}else{_0x5cf21c=0xce;}_0x2f2130[_0xcecc('0x19')](_0x5cf21c);return _0x2f2130['set'](_0xcecc('0x1f'),_0x30a991+'-'+_0x59e92b+'/'+_0x21003f)['json'](_0x3f5c5a);}return null;};}function patchUpdates(_0x169838){return function(_0x354814){try{jsonpatch[_0xcecc('0x20')](_0x354814,_0x169838,!![]);}catch(_0x4299d6){return BPromise['reject'](_0x4299d6);}return _0x354814[_0xcecc('0x21')]();};}function saveUpdates(_0x3375f2,_0x3c58ad){return function(_0x585ffa){if(_0x585ffa){return _0x585ffa[_0xcecc('0x22')](_0x3375f2)[_0xcecc('0x23')](function(_0x2ecfc5){return _0x2ecfc5;});}return null;};}function removeEntity(_0x156372,_0x452697){return function(_0x20e427){if(_0x20e427){return _0x20e427[_0xcecc('0x24')]()[_0xcecc('0x23')](function(){_0x156372[_0xcecc('0x19')](0xcc)[_0xcecc('0x1a')]();});}};}function handleEntityNotFound(_0x5a6090,_0x571708){return function(_0x277384){if(!_0x277384){_0x5a6090[_0xcecc('0x18')](0x194);}return _0x277384;};}function handleError(_0x5aeed3,_0x3a287b){_0x3a287b=_0x3a287b||0x1f4;return function(_0x53b7c4){logger[_0xcecc('0x25')](_0x53b7c4[_0xcecc('0x26')]);if(_0x53b7c4['name']){delete _0x53b7c4[_0xcecc('0x27')];}_0x5aeed3['status'](_0x3a287b)[_0xcecc('0x28')](_0x53b7c4);};}exports[_0xcecc('0x29')]=function(_0x74a24b,_0x22b324){var _0x18fac4={},_0x343a7d={},_0x46ef6c={'count':0x0,'rows':[]};var _0x417777=_[_0xcecc('0x2a')](db['OpenchannelApplication'][_0xcecc('0x2b')],function(_0x312fd7){return{'name':_0x312fd7[_0xcecc('0x2c')],'type':_0x312fd7[_0xcecc('0x2d')][_0xcecc('0x2e')]};});_0x343a7d[_0xcecc('0x2f')]=_[_0xcecc('0x2a')](_0x417777,_0xcecc('0x27'));_0x343a7d['query']=_[_0xcecc('0x30')](_0x74a24b['query']);_0x343a7d['filters']=_[_0xcecc('0x31')](_0x343a7d['model'],_0x343a7d[_0xcecc('0x32')]);_0x18fac4[_0xcecc('0x33')]=_['intersection'](_0x343a7d[_0xcecc('0x2f')],qs[_0xcecc('0x34')](_0x74a24b[_0xcecc('0x32')][_0xcecc('0x34')]));_0x18fac4[_0xcecc('0x33')]=_0x18fac4[_0xcecc('0x33')]['length']?_0x18fac4[_0xcecc('0x33')]:_0x343a7d['model'];if(!_0x74a24b[_0xcecc('0x32')][_0xcecc('0x35')](_0xcecc('0x36'))){_0x18fac4[_0xcecc('0x1c')]=qs[_0xcecc('0x1c')](_0x74a24b[_0xcecc('0x32')][_0xcecc('0x1c')]);_0x18fac4[_0xcecc('0x1b')]=qs[_0xcecc('0x1b')](_0x74a24b['query']['offset']);}_0x18fac4[_0xcecc('0x37')]=qs[_0xcecc('0x38')](_0x74a24b[_0xcecc('0x32')]['sort']);_0x18fac4['where']=qs['filters'](_[_0xcecc('0x39')](_0x74a24b[_0xcecc('0x32')],_0x343a7d[_0xcecc('0x3a')]),_0x417777);if(_0x74a24b[_0xcecc('0x32')]['filter']){_0x18fac4[_0xcecc('0x3b')]=_[_0xcecc('0x3c')](_0x18fac4[_0xcecc('0x3b')],{'$or':_['map'](_0x417777,function(_0x5228f9){if(_0x5228f9[_0xcecc('0x2d')]!==_0xcecc('0x3d')){var _0x228a8f={};_0x228a8f[_0x5228f9['name']]={'$like':'%'+_0x74a24b[_0xcecc('0x32')][_0xcecc('0x3e')]+'%'};return _0x228a8f;}})});}_0x18fac4=_[_0xcecc('0x3c')]({},_0x18fac4,_0x74a24b[_0xcecc('0x3f')]);var _0x14e814={'where':_0x18fac4['where']};return db[_0xcecc('0x40')]['count'](_0x14e814)[_0xcecc('0x23')](function(_0x36e5ad){_0x46ef6c[_0xcecc('0x1e')]=_0x36e5ad;if(_0x74a24b['query'][_0xcecc('0x41')]){_0x18fac4[_0xcecc('0x42')]=[{'all':!![]}];}return db[_0xcecc('0x40')][_0xcecc('0x43')](_0x18fac4);})[_0xcecc('0x23')](function(_0x9fd8bc){_0x46ef6c[_0xcecc('0x44')]=_0x9fd8bc;return _0x46ef6c;})[_0xcecc('0x23')](respondWithFilteredResult(_0x22b324,_0x18fac4))[_0xcecc('0x45')](handleError(_0x22b324,null));};exports[_0xcecc('0x46')]=function(_0x27f0c2,_0x5e823e){var _0x4c5556={'raw':!![],'where':{'id':_0x27f0c2['params']['id']}},_0x1e5b22={};_0x1e5b22[_0xcecc('0x2f')]=_['keys'](db[_0xcecc('0x40')][_0xcecc('0x2b')]);_0x1e5b22[_0xcecc('0x32')]=_[_0xcecc('0x30')](_0x27f0c2[_0xcecc('0x32')]);_0x1e5b22[_0xcecc('0x3a')]=_[_0xcecc('0x31')](_0x1e5b22[_0xcecc('0x2f')],_0x1e5b22[_0xcecc('0x32')]);_0x4c5556[_0xcecc('0x33')]=_[_0xcecc('0x31')](_0x1e5b22[_0xcecc('0x2f')],qs[_0xcecc('0x34')](_0x27f0c2[_0xcecc('0x32')][_0xcecc('0x34')]));_0x4c5556[_0xcecc('0x33')]=_0x4c5556[_0xcecc('0x33')]['length']?_0x4c5556['attributes']:_0x1e5b22[_0xcecc('0x2f')];if(_0x27f0c2[_0xcecc('0x32')][_0xcecc('0x41')]){_0x4c5556['include']=[{'all':!![]}];}_0x4c5556=_['merge']({},_0x4c5556,_0x27f0c2['options']);return db[_0xcecc('0x40')][_0xcecc('0x47')](_0x4c5556)[_0xcecc('0x23')](handleEntityNotFound(_0x5e823e,null))[_0xcecc('0x23')](respondWithResult(_0x5e823e,null))[_0xcecc('0x45')](handleError(_0x5e823e,null));};exports['create']=function(_0x1de544,_0x246cb9){return db['OpenchannelApplication'][_0xcecc('0x48')](_0x1de544['body'],{})[_0xcecc('0x23')](respondWithResult(_0x246cb9,0xc9))[_0xcecc('0x45')](handleError(_0x246cb9,null));};exports[_0xcecc('0x22')]=function(_0x4ec4ce,_0x528bd6){if(_0x4ec4ce['body']['id']){delete _0x4ec4ce[_0xcecc('0x49')]['id'];}return db[_0xcecc('0x40')][_0xcecc('0x47')]({'where':{'id':_0x4ec4ce['params']['id']}})[_0xcecc('0x23')](handleEntityNotFound(_0x528bd6,null))['then'](saveUpdates(_0x4ec4ce[_0xcecc('0x49')],null))[_0xcecc('0x23')](respondWithResult(_0x528bd6,null))[_0xcecc('0x45')](handleError(_0x528bd6,null));};exports[_0xcecc('0x24')]=function(_0x4a9da2,_0x4fcf4f){return db[_0xcecc('0x40')][_0xcecc('0x47')]({'where':{'id':_0x4a9da2[_0xcecc('0x4a')]['id']}})[_0xcecc('0x23')](handleEntityNotFound(_0x4fcf4f,null))[_0xcecc('0x23')](removeEntity(_0x4fcf4f,null))[_0xcecc('0x45')](handleError(_0x4fcf4f,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index e9d6470..fa6e669 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 _0x44b7=['OpenchannelApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise','path','./openchannelApplication.attributes','exports','define'];(function(_0x4f51f7,_0x4dd746){var _0x119508=function(_0x4669be){while(--_0x4669be){_0x4f51f7['push'](_0x4f51f7['shift']());}};_0x119508(++_0x4dd746);}(_0x44b7,0x1b3));var _0x744b=function(_0x4dd6e8,_0x11eabf){_0x4dd6e8=_0x4dd6e8-0x0;var _0x4b0597=_0x44b7[_0x4dd6e8];return _0x4b0597;};'use strict';var _=require('lodash');var util=require(_0x744b('0x0'));var logger=require(_0x744b('0x1'))(_0x744b('0x2'));var moment=require(_0x744b('0x3'));var BPromise=require('bluebird');var rp=require(_0x744b('0x4'));var fs=require('fs');var path=require(_0x744b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x744b('0x6'));module[_0x744b('0x7')]=function(_0x2de45c,_0x568aa7){return _0x2de45c[_0x744b('0x8')](_0x744b('0x9'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x744b('0xa'),'collate':_0x744b('0xb')});}; \ No newline at end of file +var _0x8739=['exports','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','./openchannelApplication.attributes'];(function(_0x25806f,_0x16dbdd){var _0x163f12=function(_0x3d1990){while(--_0x3d1990){_0x25806f['push'](_0x25806f['shift']());}};_0x163f12(++_0x16dbdd);}(_0x8739,0xe8));var _0x9873=function(_0xec8e4e,_0x54840c){_0xec8e4e=_0xec8e4e-0x0;var _0x4525fa=_0x8739[_0xec8e4e];return _0x4525fa;};'use strict';var _=require(_0x9873('0x0'));var util=require(_0x9873('0x1'));var logger=require('../../config/logger')(_0x9873('0x2'));var moment=require(_0x9873('0x3'));var BPromise=require(_0x9873('0x4'));var rp=require(_0x9873('0x5'));var fs=require('fs');var path=require(_0x9873('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9873('0x7'));module[_0x9873('0x8')]=function(_0x436e2c,_0x482868){return _0x436e2c['define'](_0x9873('0x9'),attributes,{'tableName':_0x9873('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9873('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 80e71ec..05689d3 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 _0xbfe4=['request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','limit','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x4353cd,_0x45e37e){var _0xa3479e=function(_0x546ae3){while(--_0x546ae3){_0x4353cd['push'](_0x4353cd['shift']());}};_0xa3479e(++_0x45e37e);}(_0xbfe4,0xbd));var _0x4bfe=function(_0x5ba77d,_0x37ea92){_0x5ba77d=_0x5ba77d-0x0;var _0x18bc74=_0xbfe4[_0x5ba77d];return _0x18bc74;};'use strict';var _=require(_0x4bfe('0x0'));var util=require(_0x4bfe('0x1'));var moment=require(_0x4bfe('0x2'));var BPromise=require('bluebird');var rs=require(_0x4bfe('0x3'));var fs=require('fs');var Redis=require(_0x4bfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4bfe('0x5'));var logger=require(_0x4bfe('0x6'))('rpc');var config=require(_0x4bfe('0x7'));var jayson=require(_0x4bfe('0x8'));var client=jayson['client'][_0x4bfe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46728f,_0x273ff9,_0x25e56a){return new BPromise(function(_0x5c21c0,_0x44e873){return client[_0x4bfe('0xa')](_0x46728f,_0x25e56a)[_0x4bfe('0xb')](function(_0x1f1734){logger[_0x4bfe('0xc')](_0x4bfe('0xd'),_0x273ff9,_0x4bfe('0xe'));logger[_0x4bfe('0xf')](_0x4bfe('0x10'),_0x273ff9,_0x4bfe('0xe'),JSON[_0x4bfe('0x11')](_0x1f1734));if(_0x1f1734[_0x4bfe('0x12')]){if(_0x1f1734[_0x4bfe('0x12')][_0x4bfe('0x13')]===0x1f4){logger[_0x4bfe('0x12')](_0x4bfe('0xd'),_0x273ff9,_0x1f1734[_0x4bfe('0x12')]['message']);return _0x44e873(_0x1f1734[_0x4bfe('0x12')][_0x4bfe('0x14')]);}logger[_0x4bfe('0x12')](_0x4bfe('0xd'),_0x273ff9,_0x1f1734['error'][_0x4bfe('0x14')]);return _0x5c21c0(_0x1f1734['error'][_0x4bfe('0x14')]);}else{logger[_0x4bfe('0xc')](_0x4bfe('0xd'),_0x273ff9,'request\x20sent');_0x5c21c0(_0x1f1734['result'][_0x4bfe('0x14')]);}})[_0x4bfe('0x15')](function(_0x232ab7){logger[_0x4bfe('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x273ff9,_0x232ab7);_0x44e873(_0x232ab7);});});}exports[_0x4bfe('0x16')]=function(_0x45178e){var _0x394736=this;return new Promise(function(_0x4864b3,_0x107c16){return db[_0x4bfe('0x17')][_0x4bfe('0x18')](_0x45178e['body'],{'raw':_0x45178e['options']?_0x45178e[_0x4bfe('0x19')][_0x4bfe('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45178e[_0x4bfe('0x19')]?_0x45178e[_0x4bfe('0x19')][_0x4bfe('0x1b')]||null:null,'attributes':_0x45178e[_0x4bfe('0x19')]?_0x45178e[_0x4bfe('0x19')]['attributes']||null:null,'limit':_0x45178e['options']?_0x45178e[_0x4bfe('0x19')][_0x4bfe('0x1c')]||null:null})['then'](function(_0x151b6d){logger['info']('UpdateOpenchannelApplication',_0x45178e);logger['debug'](_0x4bfe('0x16'),_0x45178e,JSON[_0x4bfe('0x11')](_0x151b6d));_0x4864b3(_0x151b6d);})[_0x4bfe('0x15')](function(_0x39aa96){logger[_0x4bfe('0x12')]('UpdateOpenchannelApplication',_0x39aa96[_0x4bfe('0x14')],_0x45178e);_0x107c16(_0x394736[_0x4bfe('0x12')](0x1f4,_0x39aa96['message']));});});}; \ No newline at end of file +var _0x4cae=['attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4cae,0xa7));var _0xe4ca=function(_0x887f79,_0x1f4395){_0x887f79=_0x887f79-0x0;var _0x2ba5e8=_0x4cae[_0x887f79];return _0x2ba5e8;};'use strict';var _=require(_0xe4ca('0x0'));var util=require('util');var moment=require(_0xe4ca('0x1'));var BPromise=require(_0xe4ca('0x2'));var rs=require(_0xe4ca('0x3'));var fs=require('fs');var Redis=require(_0xe4ca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4ca('0x5'));var logger=require(_0xe4ca('0x6'))(_0xe4ca('0x7'));var config=require(_0xe4ca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe4ca('0x9')][_0xe4ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xae7532,_0xbf6d8,_0x5aa00f){return new BPromise(function(_0x1e7466,_0xcfa025){return client[_0xe4ca('0xb')](_0xae7532,_0x5aa00f)[_0xe4ca('0xc')](function(_0x59cf7c){logger[_0xe4ca('0xd')](_0xe4ca('0xe'),_0xbf6d8,_0xe4ca('0xf'));logger[_0xe4ca('0x10')](_0xe4ca('0x11'),_0xbf6d8,'request\x20sent',JSON[_0xe4ca('0x12')](_0x59cf7c));if(_0x59cf7c[_0xe4ca('0x13')]){if(_0x59cf7c[_0xe4ca('0x13')][_0xe4ca('0x14')]===0x1f4){logger[_0xe4ca('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0xbf6d8,_0x59cf7c[_0xe4ca('0x13')][_0xe4ca('0x15')]);return _0xcfa025(_0x59cf7c[_0xe4ca('0x13')][_0xe4ca('0x15')]);}logger[_0xe4ca('0x13')](_0xe4ca('0xe'),_0xbf6d8,_0x59cf7c[_0xe4ca('0x13')]['message']);return _0x1e7466(_0x59cf7c[_0xe4ca('0x13')]['message']);}else{logger[_0xe4ca('0xd')](_0xe4ca('0xe'),_0xbf6d8,'request\x20sent');_0x1e7466(_0x59cf7c[_0xe4ca('0x16')][_0xe4ca('0x15')]);}})[_0xe4ca('0x17')](function(_0x218087){logger[_0xe4ca('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0xbf6d8,_0x218087);_0xcfa025(_0x218087);});});}exports[_0xe4ca('0x18')]=function(_0x1e2245){var _0x1753c4=this;return new Promise(function(_0x2a59a1,_0x4e3708){return db[_0xe4ca('0x19')][_0xe4ca('0x1a')](_0x1e2245[_0xe4ca('0x1b')],{'raw':_0x1e2245[_0xe4ca('0x1c')]?_0x1e2245[_0xe4ca('0x1c')][_0xe4ca('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e2245['options']?_0x1e2245[_0xe4ca('0x1c')][_0xe4ca('0x1e')]||null:null,'attributes':_0x1e2245[_0xe4ca('0x1c')]?_0x1e2245[_0xe4ca('0x1c')][_0xe4ca('0x1f')]||null:null,'limit':_0x1e2245[_0xe4ca('0x1c')]?_0x1e2245[_0xe4ca('0x1c')][_0xe4ca('0x20')]||null:null})[_0xe4ca('0xc')](function(_0x543111){logger[_0xe4ca('0xd')](_0xe4ca('0x18'),_0x1e2245);logger[_0xe4ca('0x10')](_0xe4ca('0x18'),_0x1e2245,JSON[_0xe4ca('0x12')](_0x543111));_0x2a59a1(_0x543111);})[_0xe4ca('0x17')](function(_0xeacc72){logger[_0xe4ca('0x13')](_0xe4ca('0x18'),_0xeacc72[_0xe4ca('0x15')],_0x1e2245);_0x4e3708(_0x1753c4[_0xe4ca('0x13')](0x1f4,_0xeacc72[_0xe4ca('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index b26b8f9..46b8aec 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 _0x891a=['openchannelinteraction:destroy','/:id/tags','removeTags','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','/:id','openchannelinteraction:update','delete'];(function(_0x1845ce,_0x1602db){var _0x1bd104=function(_0x2ecd0c){while(--_0x2ecd0c){_0x1845ce['push'](_0x1845ce['shift']());}};_0x1bd104(++_0x1602db);}(_0x891a,0x177));var _0xa891=function(_0x1ee6f1,_0x136849){_0x1ee6f1=_0x1ee6f1-0x0;var _0x202002=_0x891a[_0x1ee6f1];return _0x202002;};'use strict';var multer=require(_0xa891('0x0'));var util=require(_0xa891('0x1'));var path=require('path');var timeout=require(_0xa891('0x2'));var express=require(_0xa891('0x3'));var router=express[_0xa891('0x4')]();var fs_extra=require(_0xa891('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa891('0x6'));var config=require(_0xa891('0x7'));var controller=require('./openchannelInteraction.controller');router[_0xa891('0x8')]('/',auth[_0xa891('0x9')](),controller['index']);router['get'](_0xa891('0xa'),auth[_0xa891('0x9')](),controller[_0xa891('0xb')]);router[_0xa891('0x8')]('/:id',auth[_0xa891('0x9')](),controller[_0xa891('0xc')]);router[_0xa891('0x8')](_0xa891('0xd'),auth[_0xa891('0x9')](),controller[_0xa891('0xe')]);router[_0xa891('0x8')](_0xa891('0xf'),auth[_0xa891('0x9')](),controller[_0xa891('0x10')]);router[_0xa891('0x11')]('/',auth[_0xa891('0x9')](),controller[_0xa891('0x12')]);router[_0xa891('0x11')](_0xa891('0xd'),auth[_0xa891('0x9')](),controller[_0xa891('0x13')]);router[_0xa891('0x11')]('/:id/tags',auth[_0xa891('0x9')](),interaction[_0xa891('0x14')](_0xa891('0x15'),_0xa891('0x16')),controller[_0xa891('0x17')]);router[_0xa891('0x18')](_0xa891('0x19'),auth['isAuthenticated'](),interaction[_0xa891('0x14')](_0xa891('0x15'),_0xa891('0x1a')),controller['update']);router[_0xa891('0x1b')]('/:id',auth[_0xa891('0x9')](),interaction[_0xa891('0x14')](_0xa891('0x15'),_0xa891('0x1c')),controller['destroy']);router[_0xa891('0x1b')](_0xa891('0x1d'),auth[_0xa891('0x9')](),controller[_0xa891('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x08b6=['/:id/tags','tracked','openchannel','addTags','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','/describe','describe','/:id','show','/:id/messages','isAuthenticated','getMessages','/:id/download','download','post','create','addMessage'];(function(_0x3e8082,_0x481707){var _0x58794=function(_0x25fb94){while(--_0x25fb94){_0x3e8082['push'](_0x3e8082['shift']());}};_0x58794(++_0x481707);}(_0x08b6,0x182));var _0x608b=function(_0x4cee20,_0x38ac24){_0x4cee20=_0x4cee20-0x0;var _0x9d9646=_0x08b6[_0x4cee20];return _0x9d9646;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x608b('0x0'));var timeout=require(_0x608b('0x1'));var express=require(_0x608b('0x2'));var router=express[_0x608b('0x3')]();var fs_extra=require(_0x608b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x608b('0x5'));var config=require(_0x608b('0x6'));var controller=require('./openchannelInteraction.controller');router[_0x608b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x608b('0x7')](_0x608b('0x8'),auth['isAuthenticated'](),controller[_0x608b('0x9')]);router['get'](_0x608b('0xa'),auth['isAuthenticated'](),controller[_0x608b('0xb')]);router[_0x608b('0x7')](_0x608b('0xc'),auth[_0x608b('0xd')](),controller[_0x608b('0xe')]);router[_0x608b('0x7')](_0x608b('0xf'),auth[_0x608b('0xd')](),controller[_0x608b('0x10')]);router[_0x608b('0x11')]('/',auth[_0x608b('0xd')](),controller[_0x608b('0x12')]);router['post'](_0x608b('0xc'),auth[_0x608b('0xd')](),controller[_0x608b('0x13')]);router[_0x608b('0x11')](_0x608b('0x14'),auth['isAuthenticated'](),interaction[_0x608b('0x15')](_0x608b('0x16'),'openchannelinteraction:addtags'),controller[_0x608b('0x17')]);router['put'](_0x608b('0xa'),auth['isAuthenticated'](),interaction[_0x608b('0x15')](_0x608b('0x16'),_0x608b('0x18')),controller[_0x608b('0x19')]);router[_0x608b('0x1a')](_0x608b('0xa'),auth[_0x608b('0xd')](),interaction[_0x608b('0x15')]('openchannel',_0x608b('0x1b')),controller['destroy']);router[_0x608b('0x1a')](_0x608b('0x14'),auth[_0x608b('0xd')](),controller[_0x608b('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 a1e1688..59a72f4 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 _0xc2af=['sequelize','BOOLEAN','STRING','DATE','out','INTEGER'];(function(_0x457add,_0x16e13d){var _0x23b479=function(_0x37a9c0){while(--_0x37a9c0){_0x457add['push'](_0x457add['shift']());}};_0x23b479(++_0x16e13d);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x19e753,_0x564224){_0x19e753=_0x19e753-0x0;var _0xe2da27=_0xc2af[_0x19e753];return _0xe2da27;};'use strict';var Sequelize=require(_0xfc2a('0x0'));module['exports']={'closed':{'type':Sequelize[_0xfc2a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xfc2a('0x2')]},'secondDisposition':{'type':Sequelize[_0xfc2a('0x2')]},'thirdDisposition':{'type':Sequelize[_0xfc2a('0x2')]},'note':{'type':Sequelize[_0xfc2a('0x2')]},'read1stAt':{'type':Sequelize[_0xfc2a('0x3')]},'threadId':{'type':Sequelize[_0xfc2a('0x2')]},'externalUrl':{'type':Sequelize[_0xfc2a('0x2')]},'lastMsgAt':{'type':Sequelize[_0xfc2a('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0xfc2a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xfc2a('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize[_0xfc2a('0x1')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xfc2a('0x5')]}}; \ No newline at end of file +var _0x6ea9=['DATE','STRING','ENUM','INTEGER','sequelize','exports','BOOLEAN'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x6ea9,0x89));var _0x96ea=function(_0x50556a,_0x2f7043){_0x50556a=_0x50556a-0x0;var _0x5a0c2d=_0x6ea9[_0x50556a];return _0x5a0c2d;};'use strict';var Sequelize=require(_0x96ea('0x0'));module[_0x96ea('0x1')]={'closed':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x96ea('0x3')]},'disposition':{'type':Sequelize[_0x96ea('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x96ea('0x4')]},'note':{'type':Sequelize[_0x96ea('0x4')]},'read1stAt':{'type':Sequelize[_0x96ea('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x96ea('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x96ea('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0x96ea('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x96ea('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0x96ea('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x96ea('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index dd493e7..20f2a0a 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 _0x9e71=['pick','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','setTags','ids','spread','color','emit','removeTags','unix','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','attachments','Messages','createdAt','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','toString','closedAt','threadId','map','Attachment','basename','existsSync','createReadStream','pipe','createWriteStream','direction','out','System','lastName','value','renderFile','views','downloadInteraction.ejs','.pdf','download','unlinkSync','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../mysqldb','redis','./openchannelInteraction.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','update','then','destroy','error','stack','name','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','openchannel','query','user','show','from','params','model','keys','filters','intersection','attributes','fields','length','include','merge','find','catch','create','body','describe','OpenchannelMessage','omit','getMessages','hasOwnProperty','nolimit','order','sort'];(function(_0x33012d,_0x31b6d9){var _0x3f87b7=function(_0x30cb6d){while(--_0x30cb6d){_0x33012d['push'](_0x33012d['shift']());}};_0x3f87b7(++_0x31b6d9);}(_0x9e71,0x1bf));var _0x19e7=function(_0x3ff21f,_0x4032c3){_0x3ff21f=_0x3ff21f-0x0;var _0x23be73=_0x9e71[_0x3ff21f];return _0x23be73;};'use strict';var rimraf=require(_0x19e7('0x0'));var zipdir=require(_0x19e7('0x1'));var moment=require(_0x19e7('0x2'));var util=require(_0x19e7('0x3'));var path=require(_0x19e7('0x4'));var ejs=require(_0x19e7('0x5'));var fs=require('fs');var _=require(_0x19e7('0x6'));var Redis=require(_0x19e7('0x7'));var interaction=require(_0x19e7('0x8'));var qs=require(_0x19e7('0x9'));var pdf=require(_0x19e7('0xa'));var logger=require('../../config/logger')('api');var config=require('../../config/environment');var db=require(_0x19e7('0xb'))['db'];config[_0x19e7('0xc')]=_['defaults'](config[_0x19e7('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x19e7('0xc')]));require(_0x19e7('0xd'))[_0x19e7('0xe')](socket);function respondWithStatusCode(_0x37d3cf,_0x292ddb){_0x292ddb=_0x292ddb||0xcc;return function(_0x3d36b0){if(_0x3d36b0){return _0x37d3cf[_0x19e7('0xf')](_0x292ddb);}return _0x37d3cf[_0x19e7('0x10')](_0x292ddb)[_0x19e7('0x11')]();};}function respondWithResult(_0x3eb8fa,_0x55ce53){_0x55ce53=_0x55ce53||0xc8;return function(_0x589346){if(_0x589346){return _0x3eb8fa[_0x19e7('0x10')](_0x55ce53)['json'](_0x589346);}};}function respondWithFilteredResult(_0x208259,_0x13c09f){return function(_0x1a9b43){if(_0x1a9b43){var _0x35f48d=typeof _0x13c09f[_0x19e7('0x12')]===_0x19e7('0x13')&&typeof _0x13c09f['limit']===_0x19e7('0x13');var _0x16c4b1=_0x1a9b43[_0x19e7('0x14')];var _0x4934de=_0x35f48d?0x0:_0x13c09f[_0x19e7('0x12')];var _0x5f09d1=_0x35f48d?_0x1a9b43[_0x19e7('0x14')]:_0x13c09f[_0x19e7('0x12')]+_0x13c09f[_0x19e7('0x15')];var _0x3ab230;if(_0x5f09d1>=_0x16c4b1){_0x5f09d1=_0x16c4b1;_0x3ab230=0xc8;}else{_0x3ab230=0xce;}_0x208259['status'](_0x3ab230);return _0x208259[_0x19e7('0x16')](_0x19e7('0x17'),_0x4934de+'-'+_0x5f09d1+'/'+_0x16c4b1)[_0x19e7('0x18')](_0x1a9b43);}return null;};}function saveUpdates(_0x1d1360){return function(_0x1fe41c){if(_0x1fe41c){return _0x1fe41c[_0x19e7('0x19')](_0x1d1360)[_0x19e7('0x1a')](function(_0x10f7bf){return _0x10f7bf;});}return null;};}function removeEntity(_0x1ea3fc){return function(_0x37e377){if(_0x37e377){return _0x37e377[_0x19e7('0x1b')]()[_0x19e7('0x1a')](function(){_0x1ea3fc[_0x19e7('0x10')](0xcc)[_0x19e7('0x11')]();});}};}function handleEntityNotFound(_0x575b66){return function(_0x70b32c){if(!_0x70b32c){_0x575b66[_0x19e7('0xf')](0x194);}return _0x70b32c;};}function handleError(_0x3cc00f,_0x29e600){_0x29e600=_0x29e600||0x1f4;return function(_0x4cdb25){logger[_0x19e7('0x1c')](_0x4cdb25[_0x19e7('0x1d')]);if(_0x4cdb25[_0x19e7('0x1e')]){delete _0x4cdb25[_0x19e7('0x1e')];}_0x3cc00f[_0x19e7('0x10')](_0x29e600)['send'](_0x4cdb25);};}exports[_0x19e7('0x1f')]=function(_0x7b75ae,_0x15506e){var _0x1233ee={};var _0x4a042d=_['map'](db[_0x19e7('0x20')][_0x19e7('0x21')],function(_0x496d34){return{'name':_0x496d34[_0x19e7('0x22')],'type':_0x496d34[_0x19e7('0x23')][_0x19e7('0x24')]};});_0x1233ee=qs[_0x19e7('0x25')](_0x4a042d,_0x7b75ae);return interaction['findAll'](_0x19e7('0x26'),_0x7b75ae[_0x19e7('0x27')],_0x7b75ae[_0x19e7('0x28')],_0x1233ee,_0x4a042d)[_0x19e7('0x1a')](respondWithFilteredResult(_0x15506e,_0x1233ee))['catch'](handleError(_0x15506e,null));};exports[_0x19e7('0x29')]=function(_0x50752d,_0x5c1676){var _0x2eecfd={};if(_0x50752d[_0x19e7('0x27')]['type']&&_0x50752d[_0x19e7('0x27')]['type']===_0x19e7('0x2a')){_0x2eecfd[_0x19e7('0x2a')]=_0x50752d[_0x19e7('0x2b')]['id'];}else{_0x2eecfd['id']=_0x50752d['params']['id'];}var _0x2061c6={'raw':![],'where':_0x2eecfd},_0x42598f={};_0x42598f[_0x19e7('0x2c')]=_['keys'](db[_0x19e7('0x20')]['rawAttributes']);_0x42598f[_0x19e7('0x27')]=_[_0x19e7('0x2d')](_0x50752d[_0x19e7('0x27')]);_0x42598f[_0x19e7('0x2e')]=_[_0x19e7('0x2f')](_0x42598f[_0x19e7('0x2c')],_0x42598f[_0x19e7('0x27')]);_0x2061c6[_0x19e7('0x30')]=_['intersection'](_0x42598f[_0x19e7('0x2c')],qs[_0x19e7('0x31')](_0x50752d[_0x19e7('0x27')][_0x19e7('0x31')]));_0x2061c6['attributes']=_0x2061c6[_0x19e7('0x30')][_0x19e7('0x32')]?_0x2061c6[_0x19e7('0x30')]:_0x42598f[_0x19e7('0x2c')];if(_0x50752d[_0x19e7('0x27')]['includeAll']){_0x2061c6[_0x19e7('0x33')]=[{'all':!![]}];}_0x2061c6=_[_0x19e7('0x34')]({},_0x2061c6,_0x50752d['options']);return db[_0x19e7('0x20')][_0x19e7('0x35')](_0x2061c6)[_0x19e7('0x1a')](handleEntityNotFound(_0x5c1676,null))['then'](respondWithResult(_0x5c1676,null))[_0x19e7('0x36')](handleError(_0x5c1676,null));};exports[_0x19e7('0x37')]=function(_0x401731,_0x162474){return db[_0x19e7('0x20')][_0x19e7('0x37')](_0x401731[_0x19e7('0x38')],{})[_0x19e7('0x1a')](respondWithResult(_0x162474,0xc9))[_0x19e7('0x36')](handleError(_0x162474,null));};exports[_0x19e7('0x19')]=function(_0x59b0c0,_0x56b7eb){if(_0x59b0c0[_0x19e7('0x38')]['id']){delete _0x59b0c0[_0x19e7('0x38')]['id'];}return db[_0x19e7('0x20')][_0x19e7('0x35')]({'where':{'id':_0x59b0c0[_0x19e7('0x2b')]['id']}})[_0x19e7('0x1a')](handleEntityNotFound(_0x56b7eb,null))[_0x19e7('0x1a')](saveUpdates(_0x59b0c0[_0x19e7('0x38')],null))['then'](respondWithResult(_0x56b7eb,null))['catch'](handleError(_0x56b7eb,null));};exports[_0x19e7('0x1b')]=function(_0x2f0010,_0x45cf38){return db[_0x19e7('0x20')][_0x19e7('0x35')]({'where':{'id':_0x2f0010[_0x19e7('0x2b')]['id']}})[_0x19e7('0x1a')](handleEntityNotFound(_0x45cf38,null))['then'](removeEntity(_0x45cf38,null))[_0x19e7('0x36')](handleError(_0x45cf38,null));};exports['describe']=function(_0x13ee2c,_0x1a8882){return db[_0x19e7('0x20')][_0x19e7('0x39')]()[_0x19e7('0x1a')](respondWithResult(_0x1a8882,null))[_0x19e7('0x36')](handleError(_0x1a8882,null));};exports['addMessage']=function(_0x2c75ba,_0x1c118c){return db[_0x19e7('0x3a')]['find']({'where':{'id':_0x2c75ba[_0x19e7('0x2b')]['id']}})[_0x19e7('0x1a')](handleEntityNotFound(_0x1c118c,null))[_0x19e7('0x1a')](function(_0x430f86){if(_0x430f86){return _0x430f86['addMessage'](_0x2c75ba[_0x19e7('0x38')]['ids'],_[_0x19e7('0x3b')](_0x2c75ba[_0x19e7('0x38')],['ids','id'])||{});}})['then'](respondWithResult(_0x1c118c,null))[_0x19e7('0x36')](handleError(_0x1c118c,null));};exports[_0x19e7('0x3c')]=function(_0x5f0688,_0x15ec01){var _0x4d1131={'raw':![],'where':{}};var _0x4132b5={};var _0x1e0fcd={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x5f0688[_0x19e7('0x2b')]['id']}})[_0x19e7('0x1a')](handleEntityNotFound(_0x15ec01,null))[_0x19e7('0x1a')](function(_0x55aede){if(_0x55aede){_0x4132b5['model']=_[_0x19e7('0x2d')](db[_0x19e7('0x3a')][_0x19e7('0x21')]);_0x4132b5[_0x19e7('0x27')]=_[_0x19e7('0x2d')](_0x5f0688[_0x19e7('0x27')]);_0x4132b5[_0x19e7('0x2e')]=_[_0x19e7('0x2f')](_0x4132b5['model'],_0x4132b5[_0x19e7('0x27')]);_0x4d1131[_0x19e7('0x30')]=_[_0x19e7('0x2f')](_0x4132b5[_0x19e7('0x2c')],qs[_0x19e7('0x31')](_0x5f0688[_0x19e7('0x27')]['fields']));_0x4d1131[_0x19e7('0x30')]=_0x4d1131[_0x19e7('0x30')]['length']?_0x4d1131[_0x19e7('0x30')]:_0x4132b5[_0x19e7('0x2c')];if(!_0x5f0688['query'][_0x19e7('0x3d')](_0x19e7('0x3e'))){_0x4d1131[_0x19e7('0x15')]=qs[_0x19e7('0x15')](_0x5f0688['query'][_0x19e7('0x15')]);_0x4d1131[_0x19e7('0x12')]=qs[_0x19e7('0x12')](_0x5f0688[_0x19e7('0x27')][_0x19e7('0x12')]);}_0x4d1131[_0x19e7('0x3f')]=qs[_0x19e7('0x40')](_0x5f0688['query'][_0x19e7('0x40')]);_0x4d1131['where']=qs[_0x19e7('0x2e')](_[_0x19e7('0x41')](_0x5f0688['query'],_0x4132b5[_0x19e7('0x2e')]));_0x4d1131[_0x19e7('0x42')]['OpenchannelInteractionId']=_0x55aede['id'];if(_0x5f0688[_0x19e7('0x27')]['filter']){_0x4d1131[_0x19e7('0x42')]=_[_0x19e7('0x34')](_0x4d1131[_0x19e7('0x42')],{'$or':_['map'](_0x4d1131[_0x19e7('0x30')],function(_0x3808ca){var _0x5f25b5={};_0x5f25b5[_0x3808ca]={'$like':'%'+_0x5f0688['query'][_0x19e7('0x43')]+'%'};return _0x5f25b5;})});}if(_0x5f0688[_0x19e7('0x27')][_0x19e7('0x44')]){var _0x3e782b=_0x5f0688[_0x19e7('0x27')][_0x19e7('0x44')][_0x19e7('0x45')](',');var _0x307a70={};_0x307a70[_0x3e782b[0x0]]={'$gte':moment(_0x3e782b[0x1])[_0x19e7('0x46')](_0x19e7('0x47'))};_0x4d1131[_0x19e7('0x42')]=_[_0x19e7('0x34')](_0x4d1131[_0x19e7('0x42')],_0x307a70);}_0x4d1131=_[_0x19e7('0x34')]({},_0x4d1131,_0x5f0688['options']);return db[_0x19e7('0x3a')][_0x19e7('0x14')]({'where':_0x4d1131[_0x19e7('0x42')]})[_0x19e7('0x1a')](function(_0x4f4e1d){_0x1e0fcd['count']=_0x4f4e1d;if(_0x5f0688[_0x19e7('0x27')][_0x19e7('0x48')]){_0x4d1131[_0x19e7('0x33')]=[{'all':!![]}];}return db[_0x19e7('0x3a')][_0x19e7('0x49')](_0x4d1131);})[_0x19e7('0x1a')](function(_0x25d36b){_0x1e0fcd[_0x19e7('0x4a')]=_0x25d36b;return _0x1e0fcd;});}})['then'](respondWithFilteredResult(_0x15ec01,_0x4d1131))[_0x19e7('0x36')](handleError(_0x15ec01,null));};exports[_0x19e7('0x4b')]=function(_0x375201,_0xcf9a66){return db[_0x19e7('0x20')][_0x19e7('0x35')]({'where':{'id':_0x375201[_0x19e7('0x2b')]['id']}})[_0x19e7('0x1a')](handleEntityNotFound(_0xcf9a66,null))['then'](function(_0x46ac11){if(_0x46ac11){return _0x46ac11[_0x19e7('0x4c')](_0x375201[_0x19e7('0x38')][_0x19e7('0x4d')],_[_0x19e7('0x3b')](_0x375201['body'],[_0x19e7('0x4d'),'id'])||{})[_0x19e7('0x4e')](function(){return db['Tag'][_0x19e7('0x49')]({'attributes':['id',_0x19e7('0x1e'),_0x19e7('0x4f')],'where':{'id':_0x375201[_0x19e7('0x38')][_0x19e7('0x4d')]}});})[_0x19e7('0x1a')](function(_0x1a6c26){socket[_0x19e7('0x50')]('openchannelInteractionTags:save',{'id':Number(_0x375201[_0x19e7('0x2b')]['id']),'tags':_0x1a6c26||[]});return{'id':Number(_0x375201[_0x19e7('0x2b')]['id']),'tags':_0x1a6c26||[]};});}})[_0x19e7('0x1a')](respondWithResult(_0xcf9a66,null))['catch'](handleError(_0xcf9a66,null));};exports[_0x19e7('0x51')]=function(_0x279e84,_0x338b4a){return db[_0x19e7('0x20')][_0x19e7('0x35')]({'where':{'id':_0x279e84[_0x19e7('0x2b')]['id']}})[_0x19e7('0x1a')](handleEntityNotFound(_0x338b4a,null))[_0x19e7('0x1a')](function(_0x3db789){if(_0x3db789){return _0x3db789[_0x19e7('0x51')](_0x279e84['query'][_0x19e7('0x4d')]);}})[_0x19e7('0x1a')](respondWithStatusCode(_0x338b4a,null))[_0x19e7('0x36')](handleError(_0x338b4a,null));};exports['download']=function(_0x4e0493,_0x5b7dbb){var _0x392a54=moment()[_0x19e7('0x52')]()['toString']();var _0x5ddba6=path['join'](config[_0x19e7('0x53')],_0x19e7('0x54'),_0x19e7('0x55'),_0x19e7('0x56'));var _0x8b4097=path['join'](config[_0x19e7('0x53')],_0x19e7('0x54'),_0x19e7('0x55'),'attachments');var _0x98c757=path[_0x19e7('0x57')](_0x5ddba6,_0x392a54);var _0x252780=util[_0x19e7('0x46')](_0x19e7('0x58'),_0x4e0493['params']['id'],_0x392a54);var _0x5e9d62=path[_0x19e7('0x57')](_0x5ddba6,_0x252780);var _0x34cd65=[];_0x34cd65[_0x19e7('0x59')]({'model':db[_0x19e7('0x5a')],'as':_0x19e7('0x5a'),'attributes':['id',_0x19e7('0x5b')],'raw':!![]});_0x34cd65[_0x19e7('0x59')]({'model':db[_0x19e7('0x5c')],'as':_0x19e7('0x5d'),'attributes':['id',_0x19e7('0x5e'),'lastName'],'raw':!![]});if(_0x4e0493['query'][_0x19e7('0x5f')]){_0x34cd65['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x4236fe=[{'model':db[_0x19e7('0x3a')],'as':_0x19e7('0x60'),'attributes':['id',_0x19e7('0x38'),_0x19e7('0x61'),'direction',_0x19e7('0x62'),_0x19e7('0x63')],'include':_0x34cd65}];_0x4236fe[_0x19e7('0x59')]({'model':db[_0x19e7('0x64')],'as':_0x19e7('0x65'),'attributes':['id','name']});_0x4236fe['push']({'model':db[_0x19e7('0x5a')],'as':_0x19e7('0x66'),'attributes':['id',_0x19e7('0x5b')]});return db['OpenchannelInteraction'][_0x19e7('0x35')]({'where':{'id':_0x4e0493[_0x19e7('0x2b')]['id']},'include':_0x4236fe})['then'](handleEntityNotFound(_0x5b7dbb,null))['then'](function(_0x32775c){if(_0x32775c){var _0x1e44ad=_0x32775c[_0x19e7('0x67')]({'plain':!![]});fs[_0x19e7('0x68')](_0x98c757);var _0x470637={'channel':_0x19e7('0x69'),'account':_0x1e44ad['Account']['name'],'agent':_0x1e44ad[_0x19e7('0x66')]?_0x1e44ad[_0x19e7('0x66')][_0x19e7('0x5b')]:_0x19e7('0x6a'),'createdAt':moment(_0x1e44ad[_0x19e7('0x61')])['format'](_0x19e7('0x47'))[_0x19e7('0x6b')](),'closedAt':_0x1e44ad['closed']?moment(_0x1e44ad[_0x19e7('0x6c')])['format'](_0x19e7('0x47'))['toString']():'','disposition':_0x1e44ad['disposition'],'visibility':_0x1e44ad[_0x19e7('0x6d')]?'Public':'Private','messages':_(_0x1e44ad['Messages'])[_0x19e7('0x43')]({'secret':![]})[_0x19e7('0x6e')](function(_0x3e5f8b){if(_0x3e5f8b[_0x19e7('0x6f')]){var _0x1ba032=path[_0x19e7('0x57')](_0x8b4097,_0x3e5f8b['Attachment'][_0x19e7('0x70')]);if(fs[_0x19e7('0x71')](_0x1ba032)){fs[_0x19e7('0x72')](_0x1ba032)[_0x19e7('0x73')](fs[_0x19e7('0x74')](path[_0x19e7('0x57')](_0x98c757,_0x3e5f8b['Attachment'][_0x19e7('0x70')])));}}return{'date':moment(_0x3e5f8b[_0x19e7('0x61')])[_0x19e7('0x46')](_0x19e7('0x47'))['toString'](),'sender':_0x3e5f8b[_0x19e7('0x75')]===_0x19e7('0x76')?_0x3e5f8b[_0x19e7('0x5a')]?_0x3e5f8b[_0x19e7('0x5a')][_0x19e7('0x5b')]:_0x19e7('0x77'):_0x3e5f8b[_0x19e7('0x5d')][_0x19e7('0x5e')]+(_0x3e5f8b['Contact'][_0x19e7('0x78')]?'\x20'+_0x3e5f8b['Contact'][_0x19e7('0x78')]:''),'body':_0x3e5f8b[_0x19e7('0x6f')]?_0x3e5f8b[_0x19e7('0x6f')][_0x19e7('0x70')]:_0x3e5f8b[_0x19e7('0x38')],'direction':_0x3e5f8b[_0x19e7('0x75')]===_0x19e7('0x76')?'A':'C','secret':_0x3e5f8b['secret'],'read':_0x3e5f8b['read'],'attachment':_0x3e5f8b['Attachment']};})[_0x19e7('0x79')]()};return ejs[_0x19e7('0x7a')](path[_0x19e7('0x57')](config[_0x19e7('0x53')],_0x19e7('0x54'),_0x19e7('0x7b'),_0x19e7('0x7c')),{'interaction':_0x470637})[_0x19e7('0x1a')](function(_0x22f493){var _0x13ff9a=path['join'](_0x98c757,'transcript-'+_0x1e44ad['id']+'-'+_0x392a54+_0x19e7('0x7d'));var _0x4d404c={'path':_0x13ff9a,'channel':_0x19e7('0x69'),'interactionId':_0x1e44ad['id']};return pdf['createPdfFromHTML'](_0x22f493,_0x4d404c);})[_0x19e7('0x1a')](function(){return new Promise(function(_0x177a86,_0xba63d6){zipdir(_0x98c757,{'saveTo':_0x5e9d62},function(_0x397e0d,_0x4164bf){if(_0x397e0d)return _0xba63d6(_0x397e0d);return _0x177a86(_0x4164bf);});})[_0x19e7('0x1a')](function(){return new Promise(function(_0x51c1f5,_0x4a72fd){rimraf(_0x98c757,function(_0x4bab3d){if(_0x4bab3d)_0x4a72fd(_0x4bab3d);return _0x51c1f5();});});})['then'](function(){return _0x5b7dbb[_0x19e7('0x7e')](_0x5e9d62,_0x252780,function(_0x4e6fc6){if(_0x4e6fc6){logger[_0x19e7('0x1c')]('Unable\x20to\x20delete\x20zip\x20file',_0x4e6fc6);}else{fs[_0x19e7('0x7f')](_0x5e9d62);}});});});}else{return _0x5b7dbb[_0x19e7('0xf')](0xc8);}})[_0x19e7('0x36')](handleError(_0x5b7dbb,null));}; \ No newline at end of file +var _0x4c7f=['then','destroy','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','user','catch','show','from','params','model','keys','intersection','attributes','fields','include','merge','options','find','create','body','describe','addMessage','ids','getMessages','findOne','OpenchannelMessage','filters','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','omit','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','attachments','format','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','Public','basename','createReadStream','createWriteStream','out','System','value','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','rimraf','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update'];(function(_0x23f6fb,_0x123c9f){var _0x18b3ba=function(_0x36b934){while(--_0x36b934){_0x23f6fb['push'](_0x23f6fb['shift']());}};_0x18b3ba(++_0x123c9f);}(_0x4c7f,0x1e5));var _0xf4c7=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0x4c7f[_0x2283dc];return _0x16db90;};'use strict';var rimraf=require(_0xf4c7('0x0'));var zipdir=require(_0xf4c7('0x1'));var moment=require(_0xf4c7('0x2'));var util=require(_0xf4c7('0x3'));var path=require(_0xf4c7('0x4'));var ejs=require(_0xf4c7('0x5'));var fs=require('fs');var _=require(_0xf4c7('0x6'));var Redis=require(_0xf4c7('0x7'));var interaction=require(_0xf4c7('0x8'));var qs=require(_0xf4c7('0x9'));var pdf=require(_0xf4c7('0xa'));var logger=require('../../config/logger')(_0xf4c7('0xb'));var config=require(_0xf4c7('0xc'));var db=require('../../mysqldb')['db'];config[_0xf4c7('0xd')]=_[_0xf4c7('0xe')](config[_0xf4c7('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf4c7('0xf'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0xf4c7('0x10')](socket);function respondWithStatusCode(_0x5c394e,_0x4bfc72){_0x4bfc72=_0x4bfc72||0xcc;return function(_0x5b13d6){if(_0x5b13d6){return _0x5c394e[_0xf4c7('0x11')](_0x4bfc72);}return _0x5c394e[_0xf4c7('0x12')](_0x4bfc72)['end']();};}function respondWithResult(_0x50f460,_0x54c97f){_0x54c97f=_0x54c97f||0xc8;return function(_0x12298d){if(_0x12298d){return _0x50f460[_0xf4c7('0x12')](_0x54c97f)[_0xf4c7('0x13')](_0x12298d);}};}function respondWithFilteredResult(_0x3e8b96,_0x37daad){return function(_0x163c59){if(_0x163c59){var _0x2399f5=typeof _0x37daad[_0xf4c7('0x14')]===_0xf4c7('0x15')&&typeof _0x37daad[_0xf4c7('0x16')]==='undefined';var _0x316fc5=_0x163c59['count'];var _0x1003cf=_0x2399f5?0x0:_0x37daad[_0xf4c7('0x14')];var _0xcf5c11=_0x2399f5?_0x163c59[_0xf4c7('0x17')]:_0x37daad[_0xf4c7('0x14')]+_0x37daad[_0xf4c7('0x16')];var _0x122e34;if(_0xcf5c11>=_0x316fc5){_0xcf5c11=_0x316fc5;_0x122e34=0xc8;}else{_0x122e34=0xce;}_0x3e8b96['status'](_0x122e34);return _0x3e8b96[_0xf4c7('0x18')](_0xf4c7('0x19'),_0x1003cf+'-'+_0xcf5c11+'/'+_0x316fc5)[_0xf4c7('0x13')](_0x163c59);}return null;};}function saveUpdates(_0x5d6aa6){return function(_0x562c24){if(_0x562c24){return _0x562c24[_0xf4c7('0x1a')](_0x5d6aa6)[_0xf4c7('0x1b')](function(_0x3cb5a4){return _0x3cb5a4;});}return null;};}function removeEntity(_0x9d23f2){return function(_0x22277e){if(_0x22277e){return _0x22277e[_0xf4c7('0x1c')]()[_0xf4c7('0x1b')](function(){_0x9d23f2[_0xf4c7('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x557964){return function(_0x1c28f3){if(!_0x1c28f3){_0x557964[_0xf4c7('0x11')](0x194);}return _0x1c28f3;};}function handleError(_0x1266e5,_0x154782){_0x154782=_0x154782||0x1f4;return function(_0x3aad68){logger[_0xf4c7('0x1d')](_0x3aad68[_0xf4c7('0x1e')]);if(_0x3aad68[_0xf4c7('0x1f')]){delete _0x3aad68[_0xf4c7('0x1f')];}_0x1266e5[_0xf4c7('0x12')](_0x154782)[_0xf4c7('0x20')](_0x3aad68);};}exports[_0xf4c7('0x21')]=function(_0x39ea25,_0x577bd4){var _0x10a8e3={};var _0x44ff1f=_[_0xf4c7('0x22')](db[_0xf4c7('0x23')][_0xf4c7('0x24')],function(_0x267e64){return{'name':_0x267e64[_0xf4c7('0x25')],'type':_0x267e64[_0xf4c7('0x26')][_0xf4c7('0x27')]};});_0x10a8e3=qs[_0xf4c7('0x28')](_0x44ff1f,_0x39ea25);return interaction[_0xf4c7('0x29')](_0xf4c7('0x2a'),_0x39ea25[_0xf4c7('0x2b')],_0x39ea25[_0xf4c7('0x2c')],_0x10a8e3,_0x44ff1f)[_0xf4c7('0x1b')](respondWithFilteredResult(_0x577bd4,_0x10a8e3))[_0xf4c7('0x2d')](handleError(_0x577bd4,null));};exports[_0xf4c7('0x2e')]=function(_0xf2f2a4,_0x5ad1be){var _0x15fe8e={};if(_0xf2f2a4[_0xf4c7('0x2b')][_0xf4c7('0x26')]&&_0xf2f2a4[_0xf4c7('0x2b')][_0xf4c7('0x26')]==='from'){_0x15fe8e[_0xf4c7('0x2f')]=_0xf2f2a4[_0xf4c7('0x30')]['id'];}else{_0x15fe8e['id']=_0xf2f2a4[_0xf4c7('0x30')]['id'];}var _0x4a11db={'raw':![],'where':_0x15fe8e},_0x29b70b={};_0x29b70b[_0xf4c7('0x31')]=_['keys'](db[_0xf4c7('0x23')][_0xf4c7('0x24')]);_0x29b70b[_0xf4c7('0x2b')]=_[_0xf4c7('0x32')](_0xf2f2a4[_0xf4c7('0x2b')]);_0x29b70b['filters']=_[_0xf4c7('0x33')](_0x29b70b[_0xf4c7('0x31')],_0x29b70b[_0xf4c7('0x2b')]);_0x4a11db[_0xf4c7('0x34')]=_['intersection'](_0x29b70b['model'],qs[_0xf4c7('0x35')](_0xf2f2a4[_0xf4c7('0x2b')][_0xf4c7('0x35')]));_0x4a11db['attributes']=_0x4a11db[_0xf4c7('0x34')]['length']?_0x4a11db['attributes']:_0x29b70b[_0xf4c7('0x31')];if(_0xf2f2a4[_0xf4c7('0x2b')]['includeAll']){_0x4a11db[_0xf4c7('0x36')]=[{'all':!![]}];}_0x4a11db=_[_0xf4c7('0x37')]({},_0x4a11db,_0xf2f2a4[_0xf4c7('0x38')]);return db[_0xf4c7('0x23')][_0xf4c7('0x39')](_0x4a11db)[_0xf4c7('0x1b')](handleEntityNotFound(_0x5ad1be,null))[_0xf4c7('0x1b')](respondWithResult(_0x5ad1be,null))['catch'](handleError(_0x5ad1be,null));};exports[_0xf4c7('0x3a')]=function(_0x1cf324,_0x616160){return db[_0xf4c7('0x23')]['create'](_0x1cf324[_0xf4c7('0x3b')],{})['then'](respondWithResult(_0x616160,0xc9))['catch'](handleError(_0x616160,null));};exports[_0xf4c7('0x1a')]=function(_0x316d63,_0x1dda42){if(_0x316d63['body']['id']){delete _0x316d63[_0xf4c7('0x3b')]['id'];}return db[_0xf4c7('0x23')][_0xf4c7('0x39')]({'where':{'id':_0x316d63['params']['id']}})[_0xf4c7('0x1b')](handleEntityNotFound(_0x1dda42,null))[_0xf4c7('0x1b')](saveUpdates(_0x316d63[_0xf4c7('0x3b')],null))[_0xf4c7('0x1b')](respondWithResult(_0x1dda42,null))[_0xf4c7('0x2d')](handleError(_0x1dda42,null));};exports[_0xf4c7('0x1c')]=function(_0x663167,_0x3a922b){return db['OpenchannelInteraction']['find']({'where':{'id':_0x663167[_0xf4c7('0x30')]['id']}})[_0xf4c7('0x1b')](handleEntityNotFound(_0x3a922b,null))[_0xf4c7('0x1b')](removeEntity(_0x3a922b,null))[_0xf4c7('0x2d')](handleError(_0x3a922b,null));};exports['describe']=function(_0x4b292e,_0x3f7abf){return db[_0xf4c7('0x23')][_0xf4c7('0x3c')]()[_0xf4c7('0x1b')](respondWithResult(_0x3f7abf,null))['catch'](handleError(_0x3f7abf,null));};exports[_0xf4c7('0x3d')]=function(_0x118296,_0x5eeab2){return db['OpenchannelMessage'][_0xf4c7('0x39')]({'where':{'id':_0x118296['params']['id']}})[_0xf4c7('0x1b')](handleEntityNotFound(_0x5eeab2,null))[_0xf4c7('0x1b')](function(_0x5a8dfa){if(_0x5a8dfa){return _0x5a8dfa[_0xf4c7('0x3d')](_0x118296[_0xf4c7('0x3b')][_0xf4c7('0x3e')],_['omit'](_0x118296['body'],[_0xf4c7('0x3e'),'id'])||{});}})['then'](respondWithResult(_0x5eeab2,null))[_0xf4c7('0x2d')](handleError(_0x5eeab2,null));};exports[_0xf4c7('0x3f')]=function(_0x42e555,_0x54d43c){var _0xafc75b={'raw':![],'where':{}};var _0x1c3fd2={};var _0x35a785={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xf4c7('0x40')]({'where':{'id':_0x42e555['params']['id']}})[_0xf4c7('0x1b')](handleEntityNotFound(_0x54d43c,null))[_0xf4c7('0x1b')](function(_0x6603bc){if(_0x6603bc){_0x1c3fd2[_0xf4c7('0x31')]=_[_0xf4c7('0x32')](db[_0xf4c7('0x41')]['rawAttributes']);_0x1c3fd2['query']=_[_0xf4c7('0x32')](_0x42e555[_0xf4c7('0x2b')]);_0x1c3fd2[_0xf4c7('0x42')]=_[_0xf4c7('0x33')](_0x1c3fd2[_0xf4c7('0x31')],_0x1c3fd2[_0xf4c7('0x2b')]);_0xafc75b[_0xf4c7('0x34')]=_[_0xf4c7('0x33')](_0x1c3fd2['model'],qs[_0xf4c7('0x35')](_0x42e555[_0xf4c7('0x2b')][_0xf4c7('0x35')]));_0xafc75b[_0xf4c7('0x34')]=_0xafc75b['attributes']['length']?_0xafc75b[_0xf4c7('0x34')]:_0x1c3fd2[_0xf4c7('0x31')];if(!_0x42e555[_0xf4c7('0x2b')][_0xf4c7('0x43')](_0xf4c7('0x44'))){_0xafc75b['limit']=qs[_0xf4c7('0x16')](_0x42e555[_0xf4c7('0x2b')]['limit']);_0xafc75b['offset']=qs[_0xf4c7('0x14')](_0x42e555[_0xf4c7('0x2b')]['offset']);}_0xafc75b['order']=qs[_0xf4c7('0x45')](_0x42e555['query'][_0xf4c7('0x45')]);_0xafc75b[_0xf4c7('0x46')]=qs['filters'](_[_0xf4c7('0x47')](_0x42e555[_0xf4c7('0x2b')],_0x1c3fd2[_0xf4c7('0x42')]));_0xafc75b[_0xf4c7('0x46')][_0xf4c7('0x48')]=_0x6603bc['id'];if(_0x42e555[_0xf4c7('0x2b')]['filter']){_0xafc75b[_0xf4c7('0x46')]=_[_0xf4c7('0x37')](_0xafc75b['where'],{'$or':_['map'](_0xafc75b[_0xf4c7('0x34')],function(_0x3b6c19){var _0x27da02={};_0x27da02[_0x3b6c19]={'$like':'%'+_0x42e555[_0xf4c7('0x2b')][_0xf4c7('0x49')]+'%'};return _0x27da02;})});}if(_0x42e555[_0xf4c7('0x2b')][_0xf4c7('0x4a')]){var _0x5616c2=_0x42e555[_0xf4c7('0x2b')][_0xf4c7('0x4a')][_0xf4c7('0x4b')](',');var _0x3fdd45={};_0x3fdd45[_0x5616c2[0x0]]={'$gte':moment(_0x5616c2[0x1])['format'](_0xf4c7('0x4c'))};_0xafc75b[_0xf4c7('0x46')]=_[_0xf4c7('0x37')](_0xafc75b[_0xf4c7('0x46')],_0x3fdd45);}_0xafc75b=_[_0xf4c7('0x37')]({},_0xafc75b,_0x42e555[_0xf4c7('0x38')]);return db['OpenchannelMessage'][_0xf4c7('0x17')]({'where':_0xafc75b[_0xf4c7('0x46')]})[_0xf4c7('0x1b')](function(_0x576222){_0x35a785[_0xf4c7('0x17')]=_0x576222;if(_0x42e555[_0xf4c7('0x2b')][_0xf4c7('0x4d')]){_0xafc75b['include']=[{'all':!![]}];}return db[_0xf4c7('0x41')][_0xf4c7('0x29')](_0xafc75b);})[_0xf4c7('0x1b')](function(_0x5434e3){_0x35a785['rows']=_0x5434e3;return _0x35a785;});}})[_0xf4c7('0x1b')](respondWithFilteredResult(_0x54d43c,_0xafc75b))[_0xf4c7('0x2d')](handleError(_0x54d43c,null));};exports[_0xf4c7('0x4e')]=function(_0x5308f5,_0x301d64){return db[_0xf4c7('0x23')][_0xf4c7('0x39')]({'where':{'id':_0x5308f5[_0xf4c7('0x30')]['id']}})[_0xf4c7('0x1b')](handleEntityNotFound(_0x301d64,null))[_0xf4c7('0x1b')](function(_0x463a16){if(_0x463a16){return _0x463a16[_0xf4c7('0x4f')](_0x5308f5['body'][_0xf4c7('0x3e')],_[_0xf4c7('0x50')](_0x5308f5['body'],[_0xf4c7('0x3e'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0xf4c7('0x1f'),_0xf4c7('0x51')],'where':{'id':_0x5308f5[_0xf4c7('0x3b')][_0xf4c7('0x3e')]}});})[_0xf4c7('0x1b')](function(_0x40a06a){socket[_0xf4c7('0x52')](_0xf4c7('0x53'),{'id':Number(_0x5308f5['params']['id']),'tags':_0x40a06a||[]});return{'id':Number(_0x5308f5[_0xf4c7('0x30')]['id']),'tags':_0x40a06a||[]};});}})[_0xf4c7('0x1b')](respondWithResult(_0x301d64,null))['catch'](handleError(_0x301d64,null));};exports['removeTags']=function(_0x2ad558,_0x502e40){return db['OpenchannelInteraction'][_0xf4c7('0x39')]({'where':{'id':_0x2ad558[_0xf4c7('0x30')]['id']}})['then'](handleEntityNotFound(_0x502e40,null))[_0xf4c7('0x1b')](function(_0x131fd8){if(_0x131fd8){return _0x131fd8[_0xf4c7('0x54')](_0x2ad558[_0xf4c7('0x2b')][_0xf4c7('0x3e')]);}})[_0xf4c7('0x1b')](respondWithStatusCode(_0x502e40,null))[_0xf4c7('0x2d')](handleError(_0x502e40,null));};exports[_0xf4c7('0x55')]=function(_0x322bbd,_0x4c6e35){var _0x3418c6=moment()[_0xf4c7('0x56')]()[_0xf4c7('0x57')]();var _0x44f6d8=path[_0xf4c7('0x58')](config[_0xf4c7('0x59')],_0xf4c7('0x5a'),_0xf4c7('0x5b'),'tmp');var _0x50bf8d=path[_0xf4c7('0x58')](config[_0xf4c7('0x59')],_0xf4c7('0x5a'),_0xf4c7('0x5b'),_0xf4c7('0x5c'));var _0x2eba3b=path[_0xf4c7('0x58')](_0x44f6d8,_0x3418c6);var _0x53cc21=util[_0xf4c7('0x5d')]('transcript-%d-%s.zip',_0x322bbd[_0xf4c7('0x30')]['id'],_0x3418c6);var _0x2ddaca=path[_0xf4c7('0x58')](_0x44f6d8,_0x53cc21);var _0x2991ba=[];_0x2991ba[_0xf4c7('0x5e')]({'model':db[_0xf4c7('0x5f')],'as':'User','attributes':['id',_0xf4c7('0x60')],'raw':!![]});_0x2991ba[_0xf4c7('0x5e')]({'model':db[_0xf4c7('0x61')],'as':_0xf4c7('0x62'),'attributes':['id',_0xf4c7('0x63'),_0xf4c7('0x64')],'raw':!![]});if(_0x322bbd[_0xf4c7('0x2b')][_0xf4c7('0x5c')]){_0x2991ba[_0xf4c7('0x5e')]({'model':db[_0xf4c7('0x65')],'as':'Attachment','raw':!![]});}var _0x473c25=[{'model':db['OpenchannelMessage'],'as':_0xf4c7('0x66'),'attributes':['id','body',_0xf4c7('0x67'),_0xf4c7('0x68'),_0xf4c7('0x69'),_0xf4c7('0x6a')],'include':_0x2991ba}];_0x473c25[_0xf4c7('0x5e')]({'model':db[_0xf4c7('0x6b')],'as':_0xf4c7('0x6c'),'attributes':['id','name']});_0x473c25[_0xf4c7('0x5e')]({'model':db[_0xf4c7('0x5f')],'as':_0xf4c7('0x6d'),'attributes':['id',_0xf4c7('0x60')]});return db[_0xf4c7('0x23')][_0xf4c7('0x39')]({'where':{'id':_0x322bbd[_0xf4c7('0x30')]['id']},'include':_0x473c25})[_0xf4c7('0x1b')](handleEntityNotFound(_0x4c6e35,null))[_0xf4c7('0x1b')](function(_0x1093aa){if(_0x1093aa){var _0xf8baad=_0x1093aa[_0xf4c7('0x6e')]({'plain':!![]});fs[_0xf4c7('0x6f')](_0x2eba3b);var _0x36e700={'channel':_0xf4c7('0x70'),'account':_0xf8baad[_0xf4c7('0x6c')][_0xf4c7('0x1f')],'agent':_0xf8baad['Owner']?_0xf8baad['Owner']['fullname']:_0xf4c7('0x71'),'createdAt':moment(_0xf8baad['createdAt'])[_0xf4c7('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')[_0xf4c7('0x57')](),'closedAt':_0xf8baad[_0xf4c7('0x72')]?moment(_0xf8baad[_0xf4c7('0x73')])[_0xf4c7('0x5d')](_0xf4c7('0x4c'))[_0xf4c7('0x57')]():'','disposition':_0xf8baad['disposition'],'visibility':_0xf8baad['threadId']?_0xf4c7('0x74'):'Private','messages':_(_0xf8baad[_0xf4c7('0x66')])[_0xf4c7('0x49')]({'secret':![]})[_0xf4c7('0x22')](function(_0xe561f1){if(_0xe561f1[_0xf4c7('0x65')]){var _0xeb30eb=path[_0xf4c7('0x58')](_0x50bf8d,_0xe561f1[_0xf4c7('0x65')][_0xf4c7('0x75')]);if(fs['existsSync'](_0xeb30eb)){fs[_0xf4c7('0x76')](_0xeb30eb)['pipe'](fs[_0xf4c7('0x77')](path[_0xf4c7('0x58')](_0x2eba3b,_0xe561f1['Attachment'][_0xf4c7('0x75')])));}}return{'date':moment(_0xe561f1[_0xf4c7('0x67')])[_0xf4c7('0x5d')](_0xf4c7('0x4c'))['toString'](),'sender':_0xe561f1[_0xf4c7('0x68')]===_0xf4c7('0x78')?_0xe561f1[_0xf4c7('0x5f')]?_0xe561f1[_0xf4c7('0x5f')][_0xf4c7('0x60')]:_0xf4c7('0x79'):_0xe561f1['Contact'][_0xf4c7('0x63')]+(_0xe561f1[_0xf4c7('0x62')][_0xf4c7('0x64')]?'\x20'+_0xe561f1[_0xf4c7('0x62')][_0xf4c7('0x64')]:''),'body':_0xe561f1[_0xf4c7('0x65')]?_0xe561f1[_0xf4c7('0x65')][_0xf4c7('0x75')]:_0xe561f1[_0xf4c7('0x3b')],'direction':_0xe561f1[_0xf4c7('0x68')]===_0xf4c7('0x78')?'A':'C','secret':_0xe561f1['secret'],'read':_0xe561f1[_0xf4c7('0x6a')],'attachment':_0xe561f1['Attachment']};})[_0xf4c7('0x7a')]()};return ejs[_0xf4c7('0x7b')](path[_0xf4c7('0x58')](config[_0xf4c7('0x59')],_0xf4c7('0x5a'),'views',_0xf4c7('0x7c')),{'interaction':_0x36e700})['then'](function(_0x19d86f){var _0x26d01b=path['join'](_0x2eba3b,_0xf4c7('0x7d')+_0xf8baad['id']+'-'+_0x3418c6+_0xf4c7('0x7e'));var _0x548491={'path':_0x26d01b,'channel':'Openchannel','interactionId':_0xf8baad['id']};return pdf[_0xf4c7('0x7f')](_0x19d86f,_0x548491);})['then'](function(){return new Promise(function(_0x539386,_0x4c9480){zipdir(_0x2eba3b,{'saveTo':_0x2ddaca},function(_0x522772,_0x54b3f8){if(_0x522772)return _0x4c9480(_0x522772);return _0x539386(_0x54b3f8);});})[_0xf4c7('0x1b')](function(){return new Promise(function(_0x1cf2ae,_0x440fd3){rimraf(_0x2eba3b,function(_0x561057){if(_0x561057)_0x440fd3(_0x561057);return _0x1cf2ae();});});})['then'](function(){return _0x4c6e35[_0xf4c7('0x55')](_0x2ddaca,_0x53cc21,function(_0x57399a){if(_0x57399a){logger[_0xf4c7('0x1d')]('Unable\x20to\x20delete\x20zip\x20file',_0x57399a);}else{fs['unlinkSync'](_0x2ddaca);}});});});}else{return _0x4c6e35[_0xf4c7('0x11')](0xc8);}})[_0xf4c7('0x2d')](handleError(_0x4c6e35,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 2773f46..f52bbeb 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 _0xc281=['setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','then'];(function(_0x427082,_0x5661c6){var _0x1a3ad9=function(_0x354bec){while(--_0x354bec){_0x427082['push'](_0x427082['shift']());}};_0x1a3ad9(++_0x5661c6);}(_0xc281,0x1b2));var _0x1c28=function(_0x315add,_0x5e9ace){_0x315add=_0x315add-0x0;var _0x40956b=_0xc281[_0x315add];return _0x40956b;};'use strict';var EventEmitter=require(_0x1c28('0x0'));var OpenchannelInteraction=require(_0x1c28('0x1'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db'][_0x1c28('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x1c28('0x3')](0x0);var events={'afterCreate':_0x1c28('0x4'),'afterUpdate':_0x1c28('0x5'),'afterDestroy':_0x1c28('0x6')};function emitEvent(_0x5cbf9e){return function(_0x4cc2be,_0x2152d7,_0x540152){_0x4cc2be['getUsers']({'attributes':['id'],'raw':!![]})[_0x1c28('0x7')](function(_0x32d2a6){_0x4cc2be[_0x1c28('0x8')]('Users',_0x32d2a6[_0x1c28('0x9')](function(_0x5ef4fa){return{'id':_0x5ef4fa['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x4cc2be['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1c28('0x7')](function(_0x39f206){_0x4cc2be[_0x1c28('0x8')](_0x1c28('0xa'),_0x39f206[_0x1c28('0xb')]);OpenchannelInteractionEvents[_0x1c28('0xc')](_0x5cbf9e+':'+_0x4cc2be['id'],_0x4cc2be);OpenchannelInteractionEvents[_0x1c28('0xc')](_0x5cbf9e,_0x4cc2be);_0x540152(null);})[_0x1c28('0xd')](_0x540152(null));};}for(var e in events){if(events[_0x1c28('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x1c28('0xf')](e,emitEvent(event));}}module[_0x1c28('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x4d79=['unreadMessages','length','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','Users','map','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4d79,0x16a));var _0x94d7=function(_0x360739,_0x2ec1b2){_0x360739=_0x360739-0x0;var _0x3e23a1=_0x4d79[_0x360739];return _0x3e23a1;};'use strict';var EventEmitter=require(_0x94d7('0x0'));var OpenchannelInteraction=require(_0x94d7('0x1'))['db'][_0x94d7('0x2')];var OpenchannelMessage=require(_0x94d7('0x1'))['db'][_0x94d7('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x94d7('0x4')](0x0);var events={'afterCreate':_0x94d7('0x5'),'afterUpdate':_0x94d7('0x6'),'afterDestroy':_0x94d7('0x7')};function emitEvent(_0x190f9a){return function(_0x53c9a0,_0x361310,_0x26da2d){_0x53c9a0[_0x94d7('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3d0afa){_0x53c9a0['setDataValue'](_0x94d7('0x9'),_0x3d0afa[_0x94d7('0xa')](function(_0x1d90f1){return{'id':_0x1d90f1['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x53c9a0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x94d7('0xb')](function(_0x39c685){_0x53c9a0['setDataValue'](_0x94d7('0xc'),_0x39c685[_0x94d7('0xd')]);OpenchannelInteractionEvents['emit'](_0x190f9a+':'+_0x53c9a0['id'],_0x53c9a0);OpenchannelInteractionEvents['emit'](_0x190f9a,_0x53c9a0);_0x26da2d(null);})['catch'](_0x26da2d(null));};}for(var e in events){if(events[_0x94d7('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x94d7('0xf')](e,emitEvent(event));}}module[_0x94d7('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 6baa49d..aee2e02 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 _0x649e=['utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x649e,0x15c));var _0xe649=function(_0x321751,_0xc6ffae){_0x321751=_0x321751-0x0;var _0x2bf647=_0x649e[_0x321751];return _0x2bf647;};'use strict';var _=require(_0xe649('0x0'));var util=require(_0xe649('0x1'));var logger=require('../../config/logger')(_0xe649('0x2'));var moment=require(_0xe649('0x3'));var BPromise=require(_0xe649('0x4'));var rp=require(_0xe649('0x5'));var fs=require('fs');var path=require(_0xe649('0x6'));var rimraf=require('rimraf');var config=require(_0xe649('0x7'));var attributes=require(_0xe649('0x8'));module[_0xe649('0x9')]=function(_0x1797dc,_0x285651){return _0x1797dc[_0xe649('0xa')](_0xe649('0xb'),attributes,{'tableName':_0xe649('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe649('0xd'),'collate':_0xe649('0xe'),'hooks':{'beforeUpdate':function(_0x1da5b6,_0x1c4ea9,_0x1e183c){if(_0x1da5b6[_0xe649('0xf')](_0xe649('0x10'))){_0x1da5b6[_0xe649('0x11')]=moment()[_0xe649('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1e183c(null,_0x1da5b6);}}});}; \ No newline at end of file +var _0x072c=['openchannel_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','path','rimraf','exports','define','OpenchannelInteraction'];(function(_0x387af5,_0x51f550){var _0x339b6e=function(_0x126909){while(--_0x126909){_0x387af5['push'](_0x387af5['shift']());}};_0x339b6e(++_0x51f550);}(_0x072c,0x18b));var _0xc072=function(_0x159da9,_0x2fbb02){_0x159da9=_0x159da9-0x0;var _0x2204ca=_0x072c[_0x159da9];return _0x2204ca;};'use strict';var _=require(_0xc072('0x0'));var util=require(_0xc072('0x1'));var logger=require(_0xc072('0x2'))(_0xc072('0x3'));var moment=require(_0xc072('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc072('0x5'));var rimraf=require(_0xc072('0x6'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xc072('0x7')]=function(_0xe0fe1d,_0x1d385e){return _0xe0fe1d[_0xc072('0x8')](_0xc072('0x9'),attributes,{'tableName':_0xc072('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x997d8e,_0x526eeb,_0x1b1855){if(_0x997d8e[_0xc072('0xb')](_0xc072('0xc'))){_0x997d8e['closedAt']=moment()[_0xc072('0xd')](_0xc072('0xe'));}_0x1b1855(null,_0x997d8e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 1da671a..6bc621f 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 _0xe00e=['socket.io-emitter','./openchannelInteraction.socket','register','request','then','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','options','raw','where','attributes','debug','AddTagsToOpenchannelInteraction','body','ids','omit','spread','AddTags','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe00e,0x1c9));var _0xee00=function(_0x10b1d6,_0x5a6af5){_0x10b1d6=_0x10b1d6-0x0;var _0x4c4e1d=_0xe00e[_0x10b1d6];return _0x4c4e1d;};'use strict';var _=require('lodash');var util=require(_0xee00('0x0'));var moment=require(_0xee00('0x1'));var BPromise=require('bluebird');var rs=require(_0xee00('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee00('0x3'))['db'];var utils=require(_0xee00('0x4'));var logger=require('../../config/logger')(_0xee00('0x5'));var config=require(_0xee00('0x6'));var jayson=require(_0xee00('0x7'));var client=jayson['client'][_0xee00('0x8')]({'port':0x232a});config[_0xee00('0x9')]=_[_0xee00('0xa')](config[_0xee00('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xee00('0xb'))(new Redis(config[_0xee00('0x9')]));require(_0xee00('0xc'))[_0xee00('0xd')](socket);function respondWithRpcPromise(_0xc37baf,_0x3d6a58,_0x4b39ff){return new BPromise(function(_0x3602cb,_0x3516b7){return client[_0xee00('0xe')](_0xc37baf,_0x4b39ff)[_0xee00('0xf')](function(_0x31f284){logger['info'](_0xee00('0x10'),_0x3d6a58,_0xee00('0x11'));logger['debug'](_0xee00('0x12'),_0x3d6a58,'request\x20sent',JSON[_0xee00('0x13')](_0x31f284));if(_0x31f284['error']){if(_0x31f284['error'][_0xee00('0x14')]===0x1f4){logger[_0xee00('0x15')](_0xee00('0x10'),_0x3d6a58,_0x31f284['error'][_0xee00('0x16')]);return _0x3516b7(_0x31f284[_0xee00('0x15')][_0xee00('0x16')]);}logger[_0xee00('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3d6a58,_0x31f284[_0xee00('0x15')]['message']);return _0x3602cb(_0x31f284[_0xee00('0x15')][_0xee00('0x16')]);}else{logger[_0xee00('0x17')](_0xee00('0x10'),_0x3d6a58,_0xee00('0x11'));_0x3602cb(_0x31f284[_0xee00('0x18')][_0xee00('0x16')]);}})[_0xee00('0x19')](function(_0x122fb0){logger[_0xee00('0x15')](_0xee00('0x10'),_0x3d6a58,_0x122fb0);_0x3516b7(_0x122fb0);});});}exports[_0xee00('0x1a')]=function(_0x2743d4){var _0x3d5e67=this;return new Promise(function(_0x4f6c42,_0x1bf5a1){return db[_0xee00('0x1b')]['update'](_0x2743d4['body'],{'raw':_0x2743d4[_0xee00('0x1c')]?_0x2743d4['options'][_0xee00('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2743d4[_0xee00('0x1c')]?_0x2743d4[_0xee00('0x1c')][_0xee00('0x1e')]||null:null,'attributes':_0x2743d4[_0xee00('0x1c')]?_0x2743d4[_0xee00('0x1c')][_0xee00('0x1f')]||null:null,'limit':_0x2743d4['options']?_0x2743d4[_0xee00('0x1c')]['limit']||null:null})['then'](function(_0x4ff28c){logger[_0xee00('0x17')](_0xee00('0x1a'),_0x2743d4);logger[_0xee00('0x20')](_0xee00('0x1a'),_0x2743d4,JSON['stringify'](_0x4ff28c));_0x4f6c42(_0x4ff28c);})[_0xee00('0x19')](function(_0x50b9a1){logger[_0xee00('0x15')](_0xee00('0x1a'),_0x50b9a1['message'],_0x2743d4);_0x1bf5a1(_0x3d5e67['error'](0x1f4,_0x50b9a1[_0xee00('0x16')]));});});};exports[_0xee00('0x21')]=function(_0x1d1530){return new Promise(function(_0x2bc096,_0x328403){return db[_0xee00('0x1b')]['find']({'where':_0x1d1530[_0xee00('0x1c')]?_0x1d1530['options'][_0xee00('0x1e')]||null:null})[_0xee00('0xf')](function(_0x46d3a6){if(_0x46d3a6){return _0x46d3a6['addTags'](_0x1d1530[_0xee00('0x22')][_0xee00('0x23')],_[_0xee00('0x24')](_0x1d1530[_0xee00('0x22')],[_0xee00('0x23'),'id'])||{});}})[_0xee00('0x25')](function(_0x3049c0){logger['info']('AddTags',_0x1d1530);logger[_0xee00('0x20')](_0xee00('0x26'),_0x1d1530,JSON['stringify'](_0x3049c0));_0x2bc096(_0x3049c0);})[_0xee00('0x19')](function(_0xbae8b5){logger[_0xee00('0x15')](_0xee00('0x26'),_0xbae8b5[_0xee00('0x16')],_0x1d1530);_0x328403(_this[_0xee00('0x15')](0x1f4,_0xbae8b5['message']));});});}; \ No newline at end of file +var _0x28df=['attributes','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','request','then','info','request\x20sent','debug','stringify','code','error','OpenchannelInteraction,\x20%s,\x20%s','message','result','catch','UpdateOpenchannelInteraction','body','options','raw','where'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x28df,0x170));var _0xf28d=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x28df[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf28d('0x0'));var util=require(_0xf28d('0x1'));var moment=require(_0xf28d('0x2'));var BPromise=require(_0xf28d('0x3'));var rs=require(_0xf28d('0x4'));var fs=require('fs');var Redis=require(_0xf28d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf28d('0x6'));var logger=require(_0xf28d('0x7'))(_0xf28d('0x8'));var config=require(_0xf28d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf28d('0xa')][_0xf28d('0xb')]({'port':0x232a});config[_0xf28d('0xc')]=_['defaults'](config[_0xf28d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xf28d('0xd'))(new Redis(config[_0xf28d('0xc')]));require(_0xf28d('0xe'))['register'](socket);function respondWithRpcPromise(_0x34e616,_0x2de8ff,_0x313fe1){return new BPromise(function(_0x1aaf0b,_0x38100f){return client[_0xf28d('0xf')](_0x34e616,_0x313fe1)[_0xf28d('0x10')](function(_0x1d353a){logger[_0xf28d('0x11')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2de8ff,_0xf28d('0x12'));logger[_0xf28d('0x13')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x2de8ff,_0xf28d('0x12'),JSON[_0xf28d('0x14')](_0x1d353a));if(_0x1d353a['error']){if(_0x1d353a['error'][_0xf28d('0x15')]===0x1f4){logger[_0xf28d('0x16')](_0xf28d('0x17'),_0x2de8ff,_0x1d353a[_0xf28d('0x16')]['message']);return _0x38100f(_0x1d353a[_0xf28d('0x16')][_0xf28d('0x18')]);}logger[_0xf28d('0x16')](_0xf28d('0x17'),_0x2de8ff,_0x1d353a[_0xf28d('0x16')]['message']);return _0x1aaf0b(_0x1d353a[_0xf28d('0x16')][_0xf28d('0x18')]);}else{logger[_0xf28d('0x11')](_0xf28d('0x17'),_0x2de8ff,_0xf28d('0x12'));_0x1aaf0b(_0x1d353a[_0xf28d('0x19')][_0xf28d('0x18')]);}})[_0xf28d('0x1a')](function(_0x360cf3){logger[_0xf28d('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x2de8ff,_0x360cf3);_0x38100f(_0x360cf3);});});}exports[_0xf28d('0x1b')]=function(_0x51adfe){var _0x4e5611=this;return new Promise(function(_0x565154,_0x4ed3de){return db['OpenchannelInteraction']['update'](_0x51adfe[_0xf28d('0x1c')],{'raw':_0x51adfe[_0xf28d('0x1d')]?_0x51adfe[_0xf28d('0x1d')][_0xf28d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51adfe[_0xf28d('0x1d')]?_0x51adfe[_0xf28d('0x1d')][_0xf28d('0x1f')]||null:null,'attributes':_0x51adfe['options']?_0x51adfe['options'][_0xf28d('0x20')]||null:null,'limit':_0x51adfe[_0xf28d('0x1d')]?_0x51adfe[_0xf28d('0x1d')]['limit']||null:null})[_0xf28d('0x10')](function(_0x1442ac){logger[_0xf28d('0x11')](_0xf28d('0x1b'),_0x51adfe);logger[_0xf28d('0x13')]('UpdateOpenchannelInteraction',_0x51adfe,JSON[_0xf28d('0x14')](_0x1442ac));_0x565154(_0x1442ac);})[_0xf28d('0x1a')](function(_0x2bf303){logger[_0xf28d('0x16')](_0xf28d('0x1b'),_0x2bf303[_0xf28d('0x18')],_0x51adfe);_0x4ed3de(_0x4e5611[_0xf28d('0x16')](0x1f4,_0x2bf303[_0xf28d('0x18')]));});});};exports[_0xf28d('0x21')]=function(_0x43c2d0){return new Promise(function(_0x5381c5,_0x1ad598){return db[_0xf28d('0x22')]['find']({'where':_0x43c2d0[_0xf28d('0x1d')]?_0x43c2d0['options'][_0xf28d('0x1f')]||null:null})[_0xf28d('0x10')](function(_0x4132d8){if(_0x4132d8){return _0x4132d8[_0xf28d('0x23')](_0x43c2d0[_0xf28d('0x1c')][_0xf28d('0x24')],_[_0xf28d('0x25')](_0x43c2d0[_0xf28d('0x1c')],[_0xf28d('0x24'),'id'])||{});}})[_0xf28d('0x26')](function(_0x54c8d0){logger['info'](_0xf28d('0x27'),_0x43c2d0);logger['debug'](_0xf28d('0x27'),_0x43c2d0,JSON[_0xf28d('0x14')](_0x54c8d0));_0x5381c5(_0x54c8d0);})[_0xf28d('0x1a')](function(_0x38ac13){logger[_0xf28d('0x16')]('AddTags',_0x38ac13['message'],_0x43c2d0);_0x1ad598(_this[_0xf28d('0x16')](0x1f4,_0x38ac13[_0xf28d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 5b94acb..6ac4c5a 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 _0x3c96=['emit','removeListener','register','length','./openchannelInteraction.events','save','remove','update'];(function(_0x541a6c,_0x2e4bf9){var _0x3d559d=function(_0x3efa5e){while(--_0x3efa5e){_0x541a6c['push'](_0x541a6c['shift']());}};_0x3d559d(++_0x2e4bf9);}(_0x3c96,0x11c));var _0x63c9=function(_0x4cab75,_0x3a45f1){_0x4cab75=_0x4cab75-0x0;var _0x785a37=_0x3c96[_0x4cab75];return _0x785a37;};'use strict';var OpenchannelInteractionEvents=require(_0x63c9('0x0'));var events=[_0x63c9('0x1'),_0x63c9('0x2'),_0x63c9('0x3')];function createListener(_0x3c073a,_0x1fabb4){return function(_0x4ff6a9){_0x1fabb4[_0x63c9('0x4')](_0x3c073a,_0x4ff6a9);};}function removeListener(_0x142146,_0x591ede){return function(){OpenchannelInteractionEvents[_0x63c9('0x5')](_0x142146,_0x591ede);};}exports[_0x63c9('0x6')]=function(_0x547ea2){for(var _0x295ee3=0x0,_0xb0f272=events[_0x63c9('0x7')];_0x295ee3<_0xb0f272;_0x295ee3++){var _0x25973f=events[_0x295ee3];var _0x58b312=createListener('openchannelInteraction:'+_0x25973f,_0x547ea2);OpenchannelInteractionEvents['on'](_0x25973f,_0x58b312);}}; \ No newline at end of file +var _0x4782=['openchannelInteraction:','./openchannelInteraction.events','remove','update','emit','removeListener','register'];(function(_0x19a51d,_0x496181){var _0x153ac5=function(_0x703fdd){while(--_0x703fdd){_0x19a51d['push'](_0x19a51d['shift']());}};_0x153ac5(++_0x496181);}(_0x4782,0x8d));var _0x2478=function(_0x3ccf96,_0x5e0892){_0x3ccf96=_0x3ccf96-0x0;var _0x10dec4=_0x4782[_0x3ccf96];return _0x10dec4;};'use strict';var OpenchannelInteractionEvents=require(_0x2478('0x0'));var events=['save',_0x2478('0x1'),_0x2478('0x2')];function createListener(_0x37ccbe,_0x1590a6){return function(_0x3eb20d){_0x1590a6[_0x2478('0x3')](_0x37ccbe,_0x3eb20d);};}function removeListener(_0x19281e,_0x3575e9){return function(){OpenchannelInteractionEvents[_0x2478('0x4')](_0x19281e,_0x3575e9);};}exports[_0x2478('0x5')]=function(_0x5507e4){for(var _0x11e99b=0x0,_0x2ba369=events['length'];_0x11e99b<_0x2ba369;_0x11e99b++){var _0x2c9990=events[_0x11e99b];var _0x42ce28=createListener(_0x2478('0x6')+_0x2c9990,_0x5507e4);OpenchannelInteractionEvents['on'](_0x2c9990,_0x42ce28);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 3200028..c62facf 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','openchannel','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports'];(function(_0x3bb078,_0x4a9a05){var _0x2ea5b0=function(_0x4e5b7c){while(--_0x4e5b7c){_0x3bb078['push'](_0x3bb078['shift']());}};_0x2ea5b0(++_0x4a9a05);}(_0xedd9,0xfc));var _0x9edd=function(_0x4e7ed8,_0x4bea3b){_0x4e7ed8=_0x4e7ed8-0x0;var _0x1159eb=_0xedd9[_0x4e7ed8];return _0x1159eb;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['show']);router[_0x9edd('0xf')]('/',auth['isAuthenticated'](),interaction[_0x9edd('0x10')](_0x9edd('0x11'),'openchannelmessage:create'),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/:id',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')](_0x9edd('0x15'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x16')]);router[_0x9edd('0x13')](_0x9edd('0x17'),auth['isAuthenticated'](),controller[_0x9edd('0x18')]);router[_0x9edd('0x19')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x1a')]);module[_0x9edd('0x1b')]=router; \ No newline at end of file +var _0xe706=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','create','update','put','/:id/accept','accept','/:id/reject','exports','multer','util','path','express','Router'];(function(_0x52ebca,_0x318d26){var _0x54ff1=function(_0xe1ca3a){while(--_0xe1ca3a){_0x52ebca['push'](_0x52ebca['shift']());}};_0x54ff1(++_0x318d26);}(_0xe706,0xa3));var _0x6e70=function(_0x67098f,_0x55e2d0){_0x67098f=_0x67098f-0x0;var _0x4cf120=_0xe706[_0x67098f];return _0x4cf120;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),interaction[_0x6e70('0x12')](_0x6e70('0x13'),_0x6e70('0x14')),controller[_0x6e70('0x15')]);router['put']('/:id',auth[_0x6e70('0xb')](),controller[_0x6e70('0x16')]);router[_0x6e70('0x17')](_0x6e70('0x18'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x19')]);router[_0x6e70('0x17')](_0x6e70('0x1a'),auth['isAuthenticated'](),controller['reject']);router['delete'](_0x6e70('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e70('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index f6c43cb..4134a8c 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 _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x2cf34f,_0x113909){var _0xe590ce=function(_0x36fe65){while(--_0x36fe65){_0x2cf34f['push'](_0x2cf34f['shift']());}};_0xe590ce(++_0x113909);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x204e54,_0x1962fa){_0x204e54=_0x204e54-0x0;var _0x346242=_0xe2ab[_0x204e54];return _0x346242;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x39c4=['exports','BOOLEAN','out','DATE','STRING','TEXT'];(function(_0x9a5d51,_0x53a75f){var _0xaf46af=function(_0x11a006){while(--_0x11a006){_0x9a5d51['push'](_0x9a5d51['shift']());}};_0xaf46af(++_0x53a75f);}(_0x39c4,0x174));var _0x439c=function(_0x4942cf,_0x30f99b){_0x4942cf=_0x4942cf-0x0;var _0x1ca6c7=_0x39c4[_0x4942cf];return _0x1ca6c7;};'use strict';var Sequelize=require('sequelize');module[_0x439c('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'secret':{'type':Sequelize[_0x439c('0x1')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x439c('0x2'),'allowNull':![]},'readAt':{'type':Sequelize[_0x439c('0x3')]},'providerName':{'type':Sequelize[_0x439c('0x4')]},'providerResponse':{'type':Sequelize[_0x439c('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 54f3b21..b9576b4 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 _0xb658=['limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','options','include','findAll','rows','show','params','keys','includeAll','find','create','body','openchannel-interactions','openchannel','read','readAt','format','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','get','info','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','User','fullname','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./openchannelMessage.socket','jayson/promise','client','http','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','end','status','json','offset','undefined'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0xb658,0x15a));var _0x8b65=function(_0x53d8a8,_0xc82a07){_0x53d8a8=_0x53d8a8-0x0;var _0x5f1c1b=_0xb658[_0x53d8a8];return _0x5f1c1b;};'use strict';var emlformat=require(_0x8b65('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8b65('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8b65('0x2'));var moment=require(_0x8b65('0x3'));var BPromise=require(_0x8b65('0x4'));var Mustache=require(_0x8b65('0x5'));var util=require(_0x8b65('0x6'));var path=require(_0x8b65('0x7'));var sox=require('sox');var csv=require(_0x8b65('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b65('0x9'));var _=require('lodash');var squel=require(_0x8b65('0xa'));var crypto=require(_0x8b65('0xb'));var jsforce=require(_0x8b65('0xc'));var deskjs=require(_0x8b65('0xd'));var toCsv=require(_0x8b65('0x8'));var querystring=require(_0x8b65('0xe'));var Papa=require(_0x8b65('0xf'));var Redis=require(_0x8b65('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b65('0x11'));var logger=require('../../config/logger')(_0x8b65('0x12'));var utils=require(_0x8b65('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8b65('0x14'));var db=require(_0x8b65('0x15'))['db'];config[_0x8b65('0x16')]=_['defaults'](config[_0x8b65('0x16')],{'host':_0x8b65('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b65('0x16')]));require(_0x8b65('0x18'))['register'](socket);var jayson=require(_0x8b65('0x19'));var client=jayson[_0x8b65('0x1a')]['http']({'port':0x232c});var client9002=jayson['client'][_0x8b65('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x37aab8,_0x5e369a,_0x4e17a4,_0x449f01){return new BPromise(function(_0x5a6275,_0x3b43d9){var _0x7631bc=_0x449f01||client;return _0x7631bc[_0x8b65('0x1c')](_0x37aab8,_0x4e17a4)[_0x8b65('0x1d')](function(_0x15227){logger['info'](_0x8b65('0x1e'),_0x5e369a,'request\x20sent');logger[_0x8b65('0x1f')](_0x8b65('0x20'),_0x5e369a,_0x8b65('0x21'),JSON['stringify'](_0x15227));if(_0x15227[_0x8b65('0x22')]){if(_0x15227[_0x8b65('0x22')][_0x8b65('0x23')]===0x1f4){logger[_0x8b65('0x22')](_0x8b65('0x1e'),_0x5e369a,_0x15227[_0x8b65('0x22')][_0x8b65('0x24')]);return _0x3b43d9(_0x15227['error']['message']);}logger[_0x8b65('0x22')](_0x8b65('0x1e'),_0x5e369a,_0x15227[_0x8b65('0x22')][_0x8b65('0x24')]);return _0x5a6275(_0x15227[_0x8b65('0x22')][_0x8b65('0x24')]);}else{logger['info'](_0x8b65('0x1e'),_0x5e369a,_0x8b65('0x21'));_0x5a6275(_0x15227[_0x8b65('0x25')][_0x8b65('0x24')]);}})[_0x8b65('0x26')](function(_0x47b4ca){logger[_0x8b65('0x22')](_0x8b65('0x1e'),_0x5e369a,_0x47b4ca);_0x3b43d9(_0x47b4ca);});});}function respondWithStatusCode(_0x2bf0fa,_0x58ce99){_0x58ce99=_0x58ce99||0xcc;return function(_0x3c1046){if(_0x3c1046){return _0x2bf0fa['sendStatus'](_0x58ce99);}return _0x2bf0fa['status'](_0x58ce99)[_0x8b65('0x27')]();};}function respondWithResult(_0x3fba2f,_0x194bf8){_0x194bf8=_0x194bf8||0xc8;return function(_0x3fdb8e){if(_0x3fdb8e){return _0x3fba2f[_0x8b65('0x28')](_0x194bf8)[_0x8b65('0x29')](_0x3fdb8e);}};}function respondWithFilteredResult(_0xa8809b,_0x4035df){return function(_0x52caa9){if(_0x52caa9){var _0xbeef8c=typeof _0x4035df[_0x8b65('0x2a')]===_0x8b65('0x2b')&&typeof _0x4035df[_0x8b65('0x2c')]===_0x8b65('0x2b');var _0x58e34a=_0x52caa9[_0x8b65('0x2d')];var _0x1fe749=_0xbeef8c?0x0:_0x4035df[_0x8b65('0x2a')];var _0x1c6977=_0xbeef8c?_0x52caa9['count']:_0x4035df[_0x8b65('0x2a')]+_0x4035df[_0x8b65('0x2c')];var _0x118203;if(_0x1c6977>=_0x58e34a){_0x1c6977=_0x58e34a;_0x118203=0xc8;}else{_0x118203=0xce;}_0xa8809b[_0x8b65('0x28')](_0x118203);return _0xa8809b[_0x8b65('0x2e')](_0x8b65('0x2f'),_0x1fe749+'-'+_0x1c6977+'/'+_0x58e34a)[_0x8b65('0x29')](_0x52caa9);}return null;};}function patchUpdates(_0x58ae3f){return function(_0x12228a){try{jsonpatch[_0x8b65('0x30')](_0x12228a,_0x58ae3f,!![]);}catch(_0x4bcb3b){return BPromise[_0x8b65('0x31')](_0x4bcb3b);}return _0x12228a[_0x8b65('0x32')]();};}function saveUpdates(_0x187114,_0x190814){return function(_0x2aa1ee){if(_0x2aa1ee){return _0x2aa1ee[_0x8b65('0x33')](_0x187114)[_0x8b65('0x1d')](function(_0x326307){return _0x326307;});}return null;};}function removeEntity(_0xa85add,_0x5efd04){return function(_0x2a509f){if(_0x2a509f){return _0x2a509f[_0x8b65('0x34')]()[_0x8b65('0x1d')](function(){_0xa85add[_0x8b65('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57dfe2,_0x490cc1){return function(_0x31df27){if(!_0x31df27){_0x57dfe2[_0x8b65('0x35')](0x194);}return _0x31df27;};}function handleError(_0x334213,_0x2d7719){_0x2d7719=_0x2d7719||0x1f4;return function(_0x37587e){logger[_0x8b65('0x22')](_0x37587e[_0x8b65('0x36')]);if(_0x37587e[_0x8b65('0x37')]){delete _0x37587e[_0x8b65('0x37')];}_0x334213['status'](_0x2d7719)['send'](_0x37587e);};}exports[_0x8b65('0x38')]=function(_0x42989b,_0x5da1d2){var _0x4951b2={},_0x3e300f={},_0x260228={'count':0x0,'rows':[]};var _0x5ba2d2=_[_0x8b65('0x39')](db[_0x8b65('0x3a')][_0x8b65('0x3b')],function(_0x2dc15d){return{'name':_0x2dc15d[_0x8b65('0x3c')],'type':_0x2dc15d[_0x8b65('0x3d')][_0x8b65('0x3e')]};});_0x3e300f[_0x8b65('0x3f')]=_['map'](_0x5ba2d2,_0x8b65('0x37'));_0x3e300f[_0x8b65('0x40')]=_['keys'](_0x42989b['query']);_0x3e300f[_0x8b65('0x41')]=_[_0x8b65('0x42')](_0x3e300f[_0x8b65('0x3f')],_0x3e300f[_0x8b65('0x40')]);_0x4951b2[_0x8b65('0x43')]=_[_0x8b65('0x42')](_0x3e300f['model'],qs[_0x8b65('0x44')](_0x42989b['query'][_0x8b65('0x44')]));_0x4951b2[_0x8b65('0x43')]=_0x4951b2[_0x8b65('0x43')][_0x8b65('0x45')]?_0x4951b2['attributes']:_0x3e300f['model'];if(!_0x42989b[_0x8b65('0x40')][_0x8b65('0x46')]('nolimit')){_0x4951b2[_0x8b65('0x2c')]=qs[_0x8b65('0x2c')](_0x42989b[_0x8b65('0x40')][_0x8b65('0x2c')]);_0x4951b2[_0x8b65('0x2a')]=qs[_0x8b65('0x2a')](_0x42989b[_0x8b65('0x40')][_0x8b65('0x2a')]);}_0x4951b2['order']=qs['sort'](_0x42989b[_0x8b65('0x40')][_0x8b65('0x47')]);_0x4951b2[_0x8b65('0x48')]=qs['filters'](_[_0x8b65('0x49')](_0x42989b['query'],_0x3e300f[_0x8b65('0x41')]),_0x5ba2d2);if(_0x42989b[_0x8b65('0x40')]['filter']){_0x4951b2[_0x8b65('0x48')]=_[_0x8b65('0x4a')](_0x4951b2[_0x8b65('0x48')],{'$or':_[_0x8b65('0x39')](_0x5ba2d2,function(_0x4bc30b){if(_0x4bc30b[_0x8b65('0x3d')]!=='VIRTUAL'){var _0xe782d7={};_0xe782d7[_0x4bc30b[_0x8b65('0x37')]]={'$like':'%'+_0x42989b[_0x8b65('0x40')][_0x8b65('0x4b')]+'%'};return _0xe782d7;}})});}_0x4951b2=_[_0x8b65('0x4a')]({},_0x4951b2,_0x42989b[_0x8b65('0x4c')]);var _0x4d9220={'where':_0x4951b2[_0x8b65('0x48')]};return db['OpenchannelMessage'][_0x8b65('0x2d')](_0x4d9220)['then'](function(_0x144789){_0x260228['count']=_0x144789;if(_0x42989b['query']['includeAll']){_0x4951b2[_0x8b65('0x4d')]=[{'all':!![]}];}return db[_0x8b65('0x3a')][_0x8b65('0x4e')](_0x4951b2);})[_0x8b65('0x1d')](function(_0x8429b0){_0x260228[_0x8b65('0x4f')]=_0x8429b0;return _0x260228;})[_0x8b65('0x1d')](respondWithFilteredResult(_0x5da1d2,_0x4951b2))[_0x8b65('0x26')](handleError(_0x5da1d2,null));};exports[_0x8b65('0x50')]=function(_0x562e08,_0x229480){var _0x19797f={'raw':!![],'where':{'id':_0x562e08[_0x8b65('0x51')]['id']}},_0x550636={};_0x550636['model']=_[_0x8b65('0x52')](db[_0x8b65('0x3a')]['rawAttributes']);_0x550636['query']=_[_0x8b65('0x52')](_0x562e08['query']);_0x550636[_0x8b65('0x41')]=_['intersection'](_0x550636[_0x8b65('0x3f')],_0x550636[_0x8b65('0x40')]);_0x19797f['attributes']=_[_0x8b65('0x42')](_0x550636[_0x8b65('0x3f')],qs[_0x8b65('0x44')](_0x562e08[_0x8b65('0x40')][_0x8b65('0x44')]));_0x19797f['attributes']=_0x19797f['attributes'][_0x8b65('0x45')]?_0x19797f[_0x8b65('0x43')]:_0x550636[_0x8b65('0x3f')];if(_0x562e08[_0x8b65('0x40')][_0x8b65('0x53')]){_0x19797f[_0x8b65('0x4d')]=[{'all':!![]}];}_0x19797f=_['merge']({},_0x19797f,_0x562e08['options']);return db[_0x8b65('0x3a')][_0x8b65('0x54')](_0x19797f)[_0x8b65('0x1d')](handleEntityNotFound(_0x229480,null))['then'](respondWithResult(_0x229480,null))['catch'](handleError(_0x229480,null));};exports[_0x8b65('0x55')]=function(_0xebbde1,_0x1da030){return db[_0x8b65('0x3a')][_0x8b65('0x55')](_0xebbde1[_0x8b65('0x56')],{})[_0x8b65('0x1d')](respondWithResult(_0x1da030,0xc9))[_0x8b65('0x26')](handleError(_0x1da030,null));};exports[_0x8b65('0x33')]=function(_0x501c93,_0x563f97){if(_0x501c93[_0x8b65('0x56')]['id']){delete _0x501c93['body']['id'];}return db[_0x8b65('0x3a')][_0x8b65('0x54')]({'where':{'id':_0x501c93[_0x8b65('0x51')]['id']}})[_0x8b65('0x1d')](handleEntityNotFound(_0x563f97,null))['then'](saveUpdates(_0x501c93['body'],null))[_0x8b65('0x1d')](respondWithResult(_0x563f97,null))[_0x8b65('0x26')](handleError(_0x563f97,null));};exports[_0x8b65('0x34')]=function(_0x56e46b,_0x3f3c96){return db['OpenchannelMessage'][_0x8b65('0x54')]({'where':{'id':_0x56e46b[_0x8b65('0x51')]['id']}})[_0x8b65('0x1d')](handleEntityNotFound(_0x3f3c96,null))[_0x8b65('0x1d')](removeEntity(_0x3f3c96,null))[_0x8b65('0x26')](handleError(_0x3f3c96,null));};exports['describe']=function(_0x1ce76c,_0x5c8428){return db[_0x8b65('0x3a')]['describe']()[_0x8b65('0x1d')](respondWithResult(_0x5c8428,null))[_0x8b65('0x26')](handleError(_0x5c8428,null));};var interaction_log=require('../../config/logger')(_0x8b65('0x57'));exports['accept']=function(_0x16ef7c,_0x3306be,_0xf66b24){var _0x4761ed={'agent':{},'channel':_0x8b65('0x58')};if(_0x16ef7c[_0x8b65('0x56')]['id']){delete _0x16ef7c[_0x8b65('0x56')]['id'];}_0x16ef7c[_0x8b65('0x56')][_0x8b65('0x59')]=!![];_0x16ef7c[_0x8b65('0x56')][_0x8b65('0x5a')]=moment()[_0x8b65('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x16ef7c[_0x8b65('0x56')]['UserId']=_0x16ef7c[_0x8b65('0x56')][_0x8b65('0x5c')]||_0x16ef7c[_0x8b65('0x5d')]['id'];_0x4761ed[_0x8b65('0x5e')]['id']=_0x16ef7c[_0x8b65('0x56')][_0x8b65('0x5c')];return db[_0x8b65('0x3a')][_0x8b65('0x54')]({'where':{'id':_0x16ef7c[_0x8b65('0x51')]['id'],'UserId':null}})[_0x8b65('0x1d')](handleEntityNotFound(_0x3306be,null))[_0x8b65('0x1d')](saveUpdates(_0x16ef7c[_0x8b65('0x56')],null))[_0x8b65('0x1d')](function(_0x43f08c){if(_0x43f08c){_0x4761ed[_0x8b65('0x24')]=_0x43f08c['get']({'plain':!![]});return db[_0x8b65('0x5f')][_0x8b65('0x54')]({'where':{'id':_0x43f08c[_0x8b65('0x60')]}});}return null;})[_0x8b65('0x1d')](handleEntityNotFound(_0x3306be,null))['then'](function(_0xaf73a){if(_0xaf73a){return _0xaf73a[_0x8b65('0x33')]({'UserId':_0x16ef7c['body']['UserId'],'read1stAt':_[_0x8b65('0x61')](_0xaf73a[_0x8b65('0x62')])?moment()['format'](_0x8b65('0x63')):undefined});}return null;})[_0x8b65('0x1d')](function(_0x2b3f0d){if(_0x2b3f0d){_0x4761ed['interaction']=_0x2b3f0d[_0x8b65('0x64')]({'plain':!![]});interaction_log[_0x8b65('0x65')](_0x8b65('0x66'),_0x16ef7c['user']['id'],_0x16ef7c[_0x8b65('0x5d')][_0x8b65('0x37')],_0x16ef7c[_0x8b65('0x5d')][_0x8b65('0x67')],_0x4761ed[_0x8b65('0x68')]['id'],_0x16ef7c[_0x8b65('0x56')]?JSON['stringify'](_0x16ef7c[_0x8b65('0x56')]):_0x8b65('0x69'));return respondWithRpcPromise(_0x8b65('0x6a'),_0x8b65('0x6b'),_0x4761ed);}return null;})['then'](function(_0x1b7939){var _0x507cb3=_0x8b65('0x6c')+_0x1b7939[_0x8b65('0x24')][_0x8b65('0x6d')];return db['sequelize'][_0x8b65('0x40')](_0x507cb3,{'type':db[_0x8b65('0x6e')][_0x8b65('0x6f')][_0x8b65('0x70')],'raw':!![]})[_0x8b65('0x1d')](function(_0x29779f){return _0x29779f;});})[_0x8b65('0x1d')](function(_0x24679c){if(_0x24679c){_0x4761ed[_0x8b65('0x24')][_0x8b65('0x71')]=_0x24679c[0x0];if(!_0x16ef7c['body'][_0x8b65('0x5c')])return;return db['User'][_0x8b65('0x54')]({'where':{'id':_0x16ef7c['body'][_0x8b65('0x5c')],'role':_0x8b65('0x5e')},'attributes':['id',_0x8b65('0x37'),'fullname',_0x8b65('0x72'),_0x8b65('0x73')],'raw':!![]});}return null;})[_0x8b65('0x1d')](function(_0x217148){if(!_0x217148)return null;_0x4761ed[_0x8b65('0x24')][_0x8b65('0x5e')]=_0x217148;return _0x4761ed;})['then'](function(_0x597c67){if(_0x597c67){if(_0x16ef7c[_0x8b65('0x56')][_0x8b65('0x74')]){_0x4761ed[_0x8b65('0x24')][_0x8b65('0x75')]=util['format'](_0x8b65('0x76'),_0x16ef7c[_0x8b65('0x5d')]['name']);_0x4761ed[_0x8b65('0x24')][_0x8b65('0x77')]=_0x4761ed['channel'];_0x4761ed['message'][_0x8b65('0x78')]=_0x4761ed[_0x8b65('0x77')];_0x4761ed[_0x8b65('0x24')][_0x8b65('0x79')]=_0x8b65('0x7a');return respondWithRpcPromise(_0x8b65('0x7b'),'EventManager',{'event':_0x8b65('0x7c'),'message':_0x4761ed['message']},client9002)['then'](function(){return _0x4761ed;});}return _0x4761ed;}return null;})[_0x8b65('0x1d')](respondWithResult(_0x3306be,null))[_0x8b65('0x26')](handleError(_0x3306be,null));};var interaction_log=require('../../config/logger')(_0x8b65('0x57'));exports[_0x8b65('0x31')]=function(_0x2f4dc5,_0x433980,_0x3e81b1){var _0xbff27d={'agent':{},'channel':_0x8b65('0x58')};if(_0x2f4dc5['body']['id']){delete _0x2f4dc5[_0x8b65('0x56')]['id'];}_0x2f4dc5['body'][_0x8b65('0x5c')]=_0x2f4dc5[_0x8b65('0x56')]['UserId']||_0x2f4dc5[_0x8b65('0x5d')]['id'];_0xbff27d['agent']['id']=_0x2f4dc5[_0x8b65('0x56')][_0x8b65('0x5c')];return db[_0x8b65('0x3a')][_0x8b65('0x54')]({'where':{'id':_0x2f4dc5[_0x8b65('0x51')]['id'],'UserId':null}})[_0x8b65('0x1d')](handleEntityNotFound(_0x433980,null))[_0x8b65('0x1d')](function(_0x4c6845){if(_0x4c6845){_0xbff27d[_0x8b65('0x24')]=_0x4c6845[_0x8b65('0x64')]({'plain':!![]});return db[_0x8b65('0x5f')]['find']({'where':{'id':_0x4c6845['OpenchannelInteractionId']}});}return null;})[_0x8b65('0x1d')](handleEntityNotFound(_0x433980,null))['then'](function(_0x50a79b){if(_0x50a79b){_0xbff27d[_0x8b65('0x68')]=_0x50a79b[_0x8b65('0x64')]({'plain':!![]});interaction_log[_0x8b65('0x65')](_0x8b65('0x7d'),_0x2f4dc5[_0x8b65('0x5d')]['id'],_0x2f4dc5['user'][_0x8b65('0x37')],_0x2f4dc5[_0x8b65('0x5d')][_0x8b65('0x67')],_0xbff27d[_0x8b65('0x68')]['id'],_0x2f4dc5['body']?JSON['stringify'](_0x2f4dc5[_0x8b65('0x56')]):_0x8b65('0x69'));return respondWithRpcPromise(_0x8b65('0x7e'),_0x8b65('0x7f'),_0xbff27d);}return null;})[_0x8b65('0x1d')](function(_0x47aff9){var _0x17ea30=_0x8b65('0x6c')+_0x47aff9[_0x8b65('0x24')][_0x8b65('0x6d')];return db['sequelize']['query'](_0x17ea30,{'type':db[_0x8b65('0x6e')][_0x8b65('0x6f')][_0x8b65('0x70')],'raw':!![]})[_0x8b65('0x1d')](function(_0x5ef849){return _0x5ef849;});})[_0x8b65('0x1d')](function(_0x553e3b){if(_0x553e3b){_0xbff27d[_0x8b65('0x24')][_0x8b65('0x71')]=_0x553e3b[0x0];if(!_0x2f4dc5[_0x8b65('0x56')][_0x8b65('0x5c')])return;return db[_0x8b65('0x80')][_0x8b65('0x54')]({'where':{'id':_0x2f4dc5[_0x8b65('0x56')][_0x8b65('0x5c')],'role':_0x8b65('0x5e')},'attributes':['id',_0x8b65('0x37'),_0x8b65('0x81'),_0x8b65('0x72'),_0x8b65('0x73')],'raw':!![]});}return null;})[_0x8b65('0x1d')](function(_0x46550f){if(!_0x46550f)return null;_0xbff27d['message']['agent']=_0x46550f;return _0xbff27d;})[_0x8b65('0x1d')](function(_0x378163){if(_0x378163){_0x378163[_0x8b65('0x24')][_0x8b65('0x75')]=util[_0x8b65('0x5b')]('SIP/%s',_0x2f4dc5[_0x8b65('0x5d')][_0x8b65('0x37')]);_0x378163[_0x8b65('0x24')][_0x8b65('0x77')]=_0xbff27d[_0x8b65('0x77')];_0x378163[_0x8b65('0x24')][_0x8b65('0x78')]=_0xbff27d[_0x8b65('0x77')];_0x378163['message'][_0x8b65('0x79')]=_0x8b65('0x31');respondWithRpcPromise('EventManager',_0x8b65('0x7b'),{'event':'rejectmessage','message':_0x378163['message']},client9002);return _0xbff27d;}return null;})[_0x8b65('0x1d')](respondWithResult(_0x433980,null))['catch'](handleError(_0x433980,null));}; \ No newline at end of file +var _0x6a56=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','map','type','include','findAll','rows','show','params','keys','includeAll','options','find','create','update','body','describe','accept','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','email','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','openchannel-interactions','reject','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','fullname','interface','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x41b31d,_0x29197e){var _0x26567f=function(_0x2bb2e7){while(--_0x2bb2e7){_0x41b31d['push'](_0x41b31d['shift']());}};_0x26567f(++_0x29197e);}(_0x6a56,0x182));var _0x66a5=function(_0x578275,_0xe7ae46){_0x578275=_0x578275-0x0;var _0xf78041=_0x6a56[_0x578275];return _0xf78041;};'use strict';var emlformat=require(_0x66a5('0x0'));var rimraf=require(_0x66a5('0x1'));var zipdir=require(_0x66a5('0x2'));var jsonpatch=require(_0x66a5('0x3'));var rp=require(_0x66a5('0x4'));var moment=require(_0x66a5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x66a5('0x6'));var util=require(_0x66a5('0x7'));var path=require('path');var sox=require(_0x66a5('0x8'));var csv=require(_0x66a5('0x9'));var ejs=require(_0x66a5('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x66a5('0xb'));var squel=require(_0x66a5('0xc'));var crypto=require(_0x66a5('0xd'));var jsforce=require(_0x66a5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x66a5('0xf'));var Redis=require(_0x66a5('0x10'));var authService=require(_0x66a5('0x11'));var qs=require(_0x66a5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x66a5('0x13'))(_0x66a5('0x14'));var utils=require(_0x66a5('0x15'));var config=require(_0x66a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x66a5('0x17'))['db'];config['redis']=_['defaults'](config[_0x66a5('0x18')],{'host':_0x66a5('0x19'),'port':0x18eb});var socket=require(_0x66a5('0x1a'))(new Redis(config['redis']));require('./openchannelMessage.socket')[_0x66a5('0x1b')](socket);var jayson=require(_0x66a5('0x1c'));var client=jayson[_0x66a5('0x1d')][_0x66a5('0x1e')]({'port':0x232c});var client9002=jayson[_0x66a5('0x1d')][_0x66a5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x25b46f,_0x38655d,_0x102bfd,_0x2c3b43){return new BPromise(function(_0x58af7e,_0x348a3f){var _0x426043=_0x2c3b43||client;return _0x426043[_0x66a5('0x1f')](_0x25b46f,_0x102bfd)[_0x66a5('0x20')](function(_0x4cf3bb){logger[_0x66a5('0x21')](_0x66a5('0x22'),_0x38655d,'request\x20sent');logger[_0x66a5('0x23')](_0x66a5('0x24'),_0x38655d,_0x66a5('0x25'),JSON[_0x66a5('0x26')](_0x4cf3bb));if(_0x4cf3bb['error']){if(_0x4cf3bb[_0x66a5('0x27')][_0x66a5('0x28')]===0x1f4){logger[_0x66a5('0x27')](_0x66a5('0x22'),_0x38655d,_0x4cf3bb[_0x66a5('0x27')][_0x66a5('0x29')]);return _0x348a3f(_0x4cf3bb[_0x66a5('0x27')][_0x66a5('0x29')]);}logger['error'](_0x66a5('0x22'),_0x38655d,_0x4cf3bb[_0x66a5('0x27')][_0x66a5('0x29')]);return _0x58af7e(_0x4cf3bb[_0x66a5('0x27')][_0x66a5('0x29')]);}else{logger[_0x66a5('0x21')](_0x66a5('0x22'),_0x38655d,_0x66a5('0x25'));_0x58af7e(_0x4cf3bb[_0x66a5('0x2a')][_0x66a5('0x29')]);}})[_0x66a5('0x2b')](function(_0x11dbd7){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x38655d,_0x11dbd7);_0x348a3f(_0x11dbd7);});});}function respondWithStatusCode(_0x16d1cd,_0x3c5cb2){_0x3c5cb2=_0x3c5cb2||0xcc;return function(_0xbbb32f){if(_0xbbb32f){return _0x16d1cd[_0x66a5('0x2c')](_0x3c5cb2);}return _0x16d1cd[_0x66a5('0x2d')](_0x3c5cb2)[_0x66a5('0x2e')]();};}function respondWithResult(_0x5d3832,_0x22ccaa){_0x22ccaa=_0x22ccaa||0xc8;return function(_0x536a78){if(_0x536a78){return _0x5d3832['status'](_0x22ccaa)['json'](_0x536a78);}};}function respondWithFilteredResult(_0x4a9b74,_0x1a8e09){return function(_0x157640){if(_0x157640){var _0x118561=typeof _0x1a8e09[_0x66a5('0x2f')]===_0x66a5('0x30')&&typeof _0x1a8e09[_0x66a5('0x31')]===_0x66a5('0x30');var _0x560c0e=_0x157640[_0x66a5('0x32')];var _0x1157db=_0x118561?0x0:_0x1a8e09[_0x66a5('0x2f')];var _0x14c157=_0x118561?_0x157640[_0x66a5('0x32')]:_0x1a8e09[_0x66a5('0x2f')]+_0x1a8e09[_0x66a5('0x31')];var _0x244f28;if(_0x14c157>=_0x560c0e){_0x14c157=_0x560c0e;_0x244f28=0xc8;}else{_0x244f28=0xce;}_0x4a9b74[_0x66a5('0x2d')](_0x244f28);return _0x4a9b74[_0x66a5('0x33')](_0x66a5('0x34'),_0x1157db+'-'+_0x14c157+'/'+_0x560c0e)['json'](_0x157640);}return null;};}function patchUpdates(_0x448268){return function(_0x158ad9){try{jsonpatch[_0x66a5('0x35')](_0x158ad9,_0x448268,!![]);}catch(_0x431d95){return BPromise['reject'](_0x431d95);}return _0x158ad9[_0x66a5('0x36')]();};}function saveUpdates(_0x4d18ad,_0xf0ae40){return function(_0xf83cfd){if(_0xf83cfd){return _0xf83cfd['update'](_0x4d18ad)[_0x66a5('0x20')](function(_0x492d69){return _0x492d69;});}return null;};}function removeEntity(_0x232c2e,_0x2f1749){return function(_0x3f787b){if(_0x3f787b){return _0x3f787b[_0x66a5('0x37')]()[_0x66a5('0x20')](function(){_0x232c2e[_0x66a5('0x2d')](0xcc)[_0x66a5('0x2e')]();});}};}function handleEntityNotFound(_0x123c01,_0x1ca7e6){return function(_0xe49792){if(!_0xe49792){_0x123c01[_0x66a5('0x2c')](0x194);}return _0xe49792;};}function handleError(_0x430cc7,_0x54c538){_0x54c538=_0x54c538||0x1f4;return function(_0x1af158){logger['error'](_0x1af158[_0x66a5('0x38')]);if(_0x1af158[_0x66a5('0x39')]){delete _0x1af158[_0x66a5('0x39')];}_0x430cc7[_0x66a5('0x2d')](_0x54c538)[_0x66a5('0x3a')](_0x1af158);};}exports[_0x66a5('0x3b')]=function(_0x379547,_0x1cf341){var _0x104369={},_0x9d32e2={},_0xc43d1b={'count':0x0,'rows':[]};var _0x22750a=_['map'](db[_0x66a5('0x3c')][_0x66a5('0x3d')],function(_0x43b8ba){return{'name':_0x43b8ba[_0x66a5('0x3e')],'type':_0x43b8ba['type'][_0x66a5('0x3f')]};});_0x9d32e2[_0x66a5('0x40')]=_['map'](_0x22750a,_0x66a5('0x39'));_0x9d32e2[_0x66a5('0x41')]=_['keys'](_0x379547[_0x66a5('0x41')]);_0x9d32e2[_0x66a5('0x42')]=_[_0x66a5('0x43')](_0x9d32e2[_0x66a5('0x40')],_0x9d32e2['query']);_0x104369[_0x66a5('0x44')]=_[_0x66a5('0x43')](_0x9d32e2[_0x66a5('0x40')],qs[_0x66a5('0x45')](_0x379547[_0x66a5('0x41')][_0x66a5('0x45')]));_0x104369['attributes']=_0x104369['attributes']['length']?_0x104369[_0x66a5('0x44')]:_0x9d32e2['model'];if(!_0x379547['query'][_0x66a5('0x46')](_0x66a5('0x47'))){_0x104369[_0x66a5('0x31')]=qs[_0x66a5('0x31')](_0x379547[_0x66a5('0x41')][_0x66a5('0x31')]);_0x104369[_0x66a5('0x2f')]=qs[_0x66a5('0x2f')](_0x379547['query'][_0x66a5('0x2f')]);}_0x104369['order']=qs[_0x66a5('0x48')](_0x379547[_0x66a5('0x41')][_0x66a5('0x48')]);_0x104369[_0x66a5('0x49')]=qs[_0x66a5('0x42')](_['pick'](_0x379547[_0x66a5('0x41')],_0x9d32e2[_0x66a5('0x42')]),_0x22750a);if(_0x379547[_0x66a5('0x41')][_0x66a5('0x4a')]){_0x104369[_0x66a5('0x49')]=_[_0x66a5('0x4b')](_0x104369[_0x66a5('0x49')],{'$or':_[_0x66a5('0x4c')](_0x22750a,function(_0x4425be){if(_0x4425be[_0x66a5('0x4d')]!=='VIRTUAL'){var _0x537d01={};_0x537d01[_0x4425be['name']]={'$like':'%'+_0x379547[_0x66a5('0x41')][_0x66a5('0x4a')]+'%'};return _0x537d01;}})});}_0x104369=_[_0x66a5('0x4b')]({},_0x104369,_0x379547['options']);var _0x565be5={'where':_0x104369[_0x66a5('0x49')]};return db[_0x66a5('0x3c')][_0x66a5('0x32')](_0x565be5)['then'](function(_0x5b613a){_0xc43d1b[_0x66a5('0x32')]=_0x5b613a;if(_0x379547[_0x66a5('0x41')]['includeAll']){_0x104369[_0x66a5('0x4e')]=[{'all':!![]}];}return db[_0x66a5('0x3c')][_0x66a5('0x4f')](_0x104369);})['then'](function(_0x34894a){_0xc43d1b[_0x66a5('0x50')]=_0x34894a;return _0xc43d1b;})[_0x66a5('0x20')](respondWithFilteredResult(_0x1cf341,_0x104369))[_0x66a5('0x2b')](handleError(_0x1cf341,null));};exports[_0x66a5('0x51')]=function(_0xdb0e82,_0x1cdcdf){var _0x3aca49={'raw':!![],'where':{'id':_0xdb0e82[_0x66a5('0x52')]['id']}},_0x254ffc={};_0x254ffc[_0x66a5('0x40')]=_['keys'](db[_0x66a5('0x3c')][_0x66a5('0x3d')]);_0x254ffc[_0x66a5('0x41')]=_[_0x66a5('0x53')](_0xdb0e82['query']);_0x254ffc['filters']=_[_0x66a5('0x43')](_0x254ffc['model'],_0x254ffc['query']);_0x3aca49[_0x66a5('0x44')]=_['intersection'](_0x254ffc[_0x66a5('0x40')],qs[_0x66a5('0x45')](_0xdb0e82[_0x66a5('0x41')][_0x66a5('0x45')]));_0x3aca49[_0x66a5('0x44')]=_0x3aca49[_0x66a5('0x44')]['length']?_0x3aca49[_0x66a5('0x44')]:_0x254ffc[_0x66a5('0x40')];if(_0xdb0e82[_0x66a5('0x41')][_0x66a5('0x54')]){_0x3aca49[_0x66a5('0x4e')]=[{'all':!![]}];}_0x3aca49=_[_0x66a5('0x4b')]({},_0x3aca49,_0xdb0e82[_0x66a5('0x55')]);return db[_0x66a5('0x3c')][_0x66a5('0x56')](_0x3aca49)[_0x66a5('0x20')](handleEntityNotFound(_0x1cdcdf,null))[_0x66a5('0x20')](respondWithResult(_0x1cdcdf,null))[_0x66a5('0x2b')](handleError(_0x1cdcdf,null));};exports['create']=function(_0x31bb27,_0x4a3764){return db[_0x66a5('0x3c')][_0x66a5('0x57')](_0x31bb27['body'],{})['then'](respondWithResult(_0x4a3764,0xc9))[_0x66a5('0x2b')](handleError(_0x4a3764,null));};exports[_0x66a5('0x58')]=function(_0x25dc89,_0x156388){if(_0x25dc89['body']['id']){delete _0x25dc89[_0x66a5('0x59')]['id'];}return db['OpenchannelMessage'][_0x66a5('0x56')]({'where':{'id':_0x25dc89[_0x66a5('0x52')]['id']}})[_0x66a5('0x20')](handleEntityNotFound(_0x156388,null))['then'](saveUpdates(_0x25dc89[_0x66a5('0x59')],null))[_0x66a5('0x20')](respondWithResult(_0x156388,null))[_0x66a5('0x2b')](handleError(_0x156388,null));};exports['destroy']=function(_0x4f17e6,_0x25e8c1){return db[_0x66a5('0x3c')][_0x66a5('0x56')]({'where':{'id':_0x4f17e6[_0x66a5('0x52')]['id']}})[_0x66a5('0x20')](handleEntityNotFound(_0x25e8c1,null))[_0x66a5('0x20')](removeEntity(_0x25e8c1,null))[_0x66a5('0x2b')](handleError(_0x25e8c1,null));};exports[_0x66a5('0x5a')]=function(_0x3a95fb,_0x390312){return db[_0x66a5('0x3c')][_0x66a5('0x5a')]()['then'](respondWithResult(_0x390312,null))['catch'](handleError(_0x390312,null));};var interaction_log=require(_0x66a5('0x13'))('openchannel-interactions');exports[_0x66a5('0x5b')]=function(_0x454a0d,_0x11018e,_0x111f9e){var _0x3eabf3={'agent':{},'channel':'openchannel'};if(_0x454a0d[_0x66a5('0x59')]['id']){delete _0x454a0d[_0x66a5('0x59')]['id'];}_0x454a0d['body'][_0x66a5('0x5c')]=!![];_0x454a0d[_0x66a5('0x59')]['readAt']=moment()[_0x66a5('0x5d')](_0x66a5('0x5e'));_0x454a0d[_0x66a5('0x59')]['UserId']=_0x454a0d[_0x66a5('0x59')][_0x66a5('0x5f')]||_0x454a0d[_0x66a5('0x60')]['id'];_0x3eabf3[_0x66a5('0x61')]['id']=_0x454a0d[_0x66a5('0x59')][_0x66a5('0x5f')];return db['OpenchannelMessage'][_0x66a5('0x56')]({'where':{'id':_0x454a0d[_0x66a5('0x52')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x11018e,null))[_0x66a5('0x20')](saveUpdates(_0x454a0d[_0x66a5('0x59')],null))[_0x66a5('0x20')](function(_0x5cc0da){if(_0x5cc0da){_0x3eabf3['message']=_0x5cc0da[_0x66a5('0x62')]({'plain':!![]});return db[_0x66a5('0x63')][_0x66a5('0x56')]({'where':{'id':_0x5cc0da[_0x66a5('0x64')]}});}return null;})[_0x66a5('0x20')](handleEntityNotFound(_0x11018e,null))[_0x66a5('0x20')](function(_0x77af63){if(_0x77af63){return _0x77af63['update']({'UserId':_0x454a0d[_0x66a5('0x59')][_0x66a5('0x5f')],'read1stAt':_[_0x66a5('0x65')](_0x77af63[_0x66a5('0x66')])?moment()[_0x66a5('0x5d')](_0x66a5('0x5e')):undefined});}return null;})[_0x66a5('0x20')](function(_0x595fce){if(_0x595fce){_0x3eabf3[_0x66a5('0x67')]=_0x595fce[_0x66a5('0x62')]({'plain':!![]});interaction_log[_0x66a5('0x21')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x454a0d[_0x66a5('0x60')]['id'],_0x454a0d[_0x66a5('0x60')]['name'],_0x454a0d[_0x66a5('0x60')][_0x66a5('0x68')],_0x3eabf3['interaction']['id'],_0x454a0d['body']?JSON['stringify'](_0x454a0d[_0x66a5('0x59')]):_0x66a5('0x69'));return respondWithRpcPromise(_0x66a5('0x6a'),'acceptMessage',_0x3eabf3);}return null;})[_0x66a5('0x20')](function(_0x4f55fa){var _0x379ae6=_0x66a5('0x6b')+_0x4f55fa[_0x66a5('0x29')][_0x66a5('0x6c')];return db[_0x66a5('0x6d')][_0x66a5('0x41')](_0x379ae6,{'type':db[_0x66a5('0x6e')]['QueryTypes'][_0x66a5('0x6f')],'raw':!![]})[_0x66a5('0x20')](function(_0x2c1e80){return _0x2c1e80;});})[_0x66a5('0x20')](function(_0x49969c){if(_0x49969c){_0x3eabf3[_0x66a5('0x29')][_0x66a5('0x70')]=_0x49969c[0x0];if(!_0x454a0d[_0x66a5('0x59')][_0x66a5('0x5f')])return;return db[_0x66a5('0x71')]['find']({'where':{'id':_0x454a0d['body'][_0x66a5('0x5f')],'role':'agent'},'attributes':['id',_0x66a5('0x39'),'fullname',_0x66a5('0x72'),'internal'],'raw':!![]});}return null;})[_0x66a5('0x20')](function(_0x11b6b5){if(!_0x11b6b5)return null;_0x3eabf3[_0x66a5('0x29')][_0x66a5('0x61')]=_0x11b6b5;return _0x3eabf3;})['then'](function(_0x3530aa){if(_0x3530aa){if(_0x454a0d['body'][_0x66a5('0x73')]){_0x3eabf3[_0x66a5('0x29')]['interface']=util[_0x66a5('0x5d')](_0x66a5('0x74'),_0x454a0d[_0x66a5('0x60')]['name']);_0x3eabf3[_0x66a5('0x29')]['channel']=_0x3eabf3[_0x66a5('0x75')];_0x3eabf3[_0x66a5('0x29')][_0x66a5('0x76')]=_0x3eabf3['channel'];_0x3eabf3[_0x66a5('0x29')]['event']='accept';return respondWithRpcPromise(_0x66a5('0x77'),_0x66a5('0x77'),{'event':_0x66a5('0x78'),'message':_0x3eabf3[_0x66a5('0x29')]},client9002)['then'](function(){return _0x3eabf3;});}return _0x3eabf3;}return null;})['then'](respondWithResult(_0x11018e,null))['catch'](handleError(_0x11018e,null));};var interaction_log=require(_0x66a5('0x13'))(_0x66a5('0x79'));exports[_0x66a5('0x7a')]=function(_0x1911d2,_0x5ef452,_0x4465ed){var _0xc33758={'agent':{},'channel':_0x66a5('0x7b')};if(_0x1911d2[_0x66a5('0x59')]['id']){delete _0x1911d2['body']['id'];}_0x1911d2[_0x66a5('0x59')][_0x66a5('0x5f')]=_0x1911d2['body'][_0x66a5('0x5f')]||_0x1911d2[_0x66a5('0x60')]['id'];_0xc33758[_0x66a5('0x61')]['id']=_0x1911d2['body']['UserId'];return db[_0x66a5('0x3c')][_0x66a5('0x56')]({'where':{'id':_0x1911d2[_0x66a5('0x52')]['id'],'UserId':null}})[_0x66a5('0x20')](handleEntityNotFound(_0x5ef452,null))[_0x66a5('0x20')](function(_0x2c1546){if(_0x2c1546){_0xc33758['message']=_0x2c1546[_0x66a5('0x62')]({'plain':!![]});return db[_0x66a5('0x63')][_0x66a5('0x56')]({'where':{'id':_0x2c1546[_0x66a5('0x64')]}});}return null;})[_0x66a5('0x20')](handleEntityNotFound(_0x5ef452,null))[_0x66a5('0x20')](function(_0x8f7254){if(_0x8f7254){_0xc33758[_0x66a5('0x67')]=_0x8f7254[_0x66a5('0x62')]({'plain':!![]});interaction_log[_0x66a5('0x21')](_0x66a5('0x7c'),_0x1911d2['user']['id'],_0x1911d2[_0x66a5('0x60')][_0x66a5('0x39')],_0x1911d2['user'][_0x66a5('0x68')],_0xc33758[_0x66a5('0x67')]['id'],_0x1911d2[_0x66a5('0x59')]?JSON[_0x66a5('0x26')](_0x1911d2[_0x66a5('0x59')]):_0x66a5('0x69'));return respondWithRpcPromise(_0x66a5('0x7d'),_0x66a5('0x7e'),_0xc33758);}return null;})[_0x66a5('0x20')](function(_0x5d775b){var _0x39a6fa='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d775b[_0x66a5('0x29')][_0x66a5('0x6c')];return db[_0x66a5('0x6d')]['query'](_0x39a6fa,{'type':db[_0x66a5('0x6e')]['QueryTypes'][_0x66a5('0x6f')],'raw':!![]})[_0x66a5('0x20')](function(_0x44c720){return _0x44c720;});})[_0x66a5('0x20')](function(_0x5b555d){if(_0x5b555d){_0xc33758[_0x66a5('0x29')][_0x66a5('0x70')]=_0x5b555d[0x0];if(!_0x1911d2[_0x66a5('0x59')][_0x66a5('0x5f')])return;return db[_0x66a5('0x71')][_0x66a5('0x56')]({'where':{'id':_0x1911d2[_0x66a5('0x59')][_0x66a5('0x5f')],'role':'agent'},'attributes':['id','name',_0x66a5('0x7f'),'email','internal'],'raw':!![]});}return null;})[_0x66a5('0x20')](function(_0x9978d5){if(!_0x9978d5)return null;_0xc33758[_0x66a5('0x29')][_0x66a5('0x61')]=_0x9978d5;return _0xc33758;})['then'](function(_0x2b2a8d){if(_0x2b2a8d){_0x2b2a8d[_0x66a5('0x29')][_0x66a5('0x80')]=util[_0x66a5('0x5d')](_0x66a5('0x74'),_0x1911d2['user'][_0x66a5('0x39')]);_0x2b2a8d[_0x66a5('0x29')][_0x66a5('0x75')]=_0xc33758[_0x66a5('0x75')];_0x2b2a8d['message'][_0x66a5('0x76')]=_0xc33758[_0x66a5('0x75')];_0x2b2a8d[_0x66a5('0x29')][_0x66a5('0x81')]=_0x66a5('0x7a');respondWithRpcPromise(_0x66a5('0x77'),_0x66a5('0x77'),{'event':_0x66a5('0x82'),'message':_0x2b2a8d['message']},client9002);return _0xc33758;}return null;})[_0x66a5('0x20')](respondWithResult(_0x5ef452,null))[_0x66a5('0x2b')](handleError(_0x5ef452,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index fa01844..9a4232c 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 _0x6cfd=['save','update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners'];(function(_0x49db5c,_0x2b4f98){var _0x5bed3f=function(_0x3b2916){while(--_0x3b2916){_0x49db5c['push'](_0x49db5c['shift']());}};_0x5bed3f(++_0x2b4f98);}(_0x6cfd,0xbb));var _0xd6cf=function(_0x4f4f31,_0x5cadd0){_0x4f4f31=_0x4f4f31-0x0;var _0x5ba659=_0x6cfd[_0x4f4f31];return _0x5ba659;};'use strict';var EventEmitter=require(_0xd6cf('0x0'));var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xd6cf('0x1')](0x0);var events={'afterCreate':_0xd6cf('0x2'),'afterUpdate':_0xd6cf('0x3'),'afterDestroy':_0xd6cf('0x4')};function emitEvent(_0x3c0022){return function(_0x384b50,_0x13221e,_0x3883bb){OpenchannelMessageEvents[_0xd6cf('0x5')](_0x3c0022+':'+_0x384b50['id'],_0x384b50);OpenchannelMessageEvents['emit'](_0x3c0022,_0x384b50);_0x3883bb(null);};}for(var e in events){if(events[_0xd6cf('0x6')](e)){var event=events[e];OpenchannelMessage[_0xd6cf('0x7')](e,emitEvent(event));}}module[_0xd6cf('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x8cb2=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','OpenchannelMessage'];(function(_0x1304c6,_0x6bb485){var _0x2e6654=function(_0x2b623c){while(--_0x2b623c){_0x1304c6['push'](_0x1304c6['shift']());}};_0x2e6654(++_0x6bb485);}(_0x8cb2,0x1a5));var _0x28cb=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x8cb2[_0x167cc1];return _0x10bc4b;};'use strict';var EventEmitter=require(_0x28cb('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x28cb('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x28cb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x28cb('0x3'),'afterDestroy':_0x28cb('0x4')};function emitEvent(_0x369dca){return function(_0x510f96,_0x588118,_0x2f7b30){OpenchannelMessageEvents[_0x28cb('0x5')](_0x369dca+':'+_0x510f96['id'],_0x510f96);OpenchannelMessageEvents[_0x28cb('0x5')](_0x369dca,_0x510f96);_0x2f7b30(null);};}for(var e in events){if(events[_0x28cb('0x6')](e)){var event=events[e];OpenchannelMessage[_0x28cb('0x7')](e,emitEvent(event));}}module[_0x28cb('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 01008c2..91b33e3 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 _0xe024=['toLowerCase','out','isNil','UserId','OpenchannelInteractionId','then','update','createdAt','secret','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','get','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','omit','POST','method','threadId','Interaction','catch','inspect','api','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','fti_openchannel_messages','body','models','direction'];(function(_0x3a2118,_0x31fc3c){var _0x1d181d=function(_0x26a734){while(--_0x26a734){_0x3a2118['push'](_0x3a2118['shift']());}};_0x1d181d(++_0x31fc3c);}(_0xe024,0x1a3));var _0x4e02=function(_0x186222,_0x3bdfb0){_0x186222=_0x186222-0x0;var _0x226a38=_0xe024[_0x186222];return _0x226a38;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4e02('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4e02('0x1'));var rimraf=require(_0x4e02('0x2'));var config=require(_0x4e02('0x3'));var attributes=require(_0x4e02('0x4'));module[_0x4e02('0x5')]=function(_0x49dba6,_0x3d8210){return _0x49dba6[_0x4e02('0x6')]('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0x4e02('0x7'),'fields':[_0x4e02('0x8')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4afc91,_0x4d10f9,_0x318a39){var _0x4ae999=_0x49dba6[_0x4e02('0x9')];var _0x2d55e1=_0x4afc91['get']({'plain':!![]});if(_0x2d55e1[_0x4e02('0xa')][_0x4e02('0xb')]()==='in'||_0x2d55e1[_0x4e02('0xa')][_0x4e02('0xb')]()===_0x4e02('0xc')&&!_0x2d55e1['secret']&&!_[_0x4e02('0xd')](_0x2d55e1[_0x4e02('0xe')])){_0x4ae999['OpenchannelInteraction']['findOne']({'where':{'id':_0x2d55e1[_0x4e02('0xf')]}})[_0x4e02('0x10')](function(_0x284fc6){if(_0x284fc6){_0x284fc6[_0x4e02('0x11')]({'lastMsgAt':_0x2d55e1[_0x4e02('0x12')],'lastMsgDirection':_0x2d55e1[_0x4e02('0xa')][_0x4e02('0xb')]()});}})['catch'](function(_0x2ec7d4){console['error'](_0x2ec7d4);});}if(_0x2d55e1[_0x4e02('0xa')]===_0x4e02('0xc')&&!_0x2d55e1[_0x4e02('0x13')]){var _0x5f3420;_0x4ae999[_0x4e02('0x14')][_0x4e02('0x15')]()[_0x4e02('0x10')](function(_0x4c6edc){return _0x4ae999['OpenchannelAccount'][_0x4e02('0x16')]({'where':{'id':_0x2d55e1[_0x4e02('0x17')]},'include':[{'model':_0x4ae999[_0x4e02('0x18')],'as':_0x4e02('0x19'),'where':{'id':_0x2d55e1['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x4ae999[_0x4e02('0x14')],'as':_0x4e02('0x1a'),'attributes':_[_0x4e02('0x1b')](_0x4c6edc)}]}]});})[_0x4e02('0x10')](function(_0x47de7b){_0x5f3420=_0x47de7b[_0x4e02('0x1c')]({'plain':!![]});if(_0x5f3420&&_0x5f3420[_0x4e02('0x1d')]){logger[_0x4e02('0x1e')](_0x4e02('0x1f'),_0x4e02('0x20'),util[_0x4e02('0x21')](_0x4e02('0x22'),_0x2d55e1['id'],_0x5f3420[_0x4e02('0x1d')]));if(_0x5f3420[_0x4e02('0x19')]&&_0x5f3420[_0x4e02('0x19')][_0x4e02('0x23')]){_0x2d55e1['Interaction']=_[_0x4e02('0x24')](_0x5f3420[_0x4e02('0x19')][0x0],_0x4e02('0x1a'));_0x2d55e1['Contact']=_0x5f3420[_0x4e02('0x19')][0x0][_0x4e02('0x1a')];}var _0x4d10f9={'method':_0x4e02('0x25'),'uri':encodeURI(_0x5f3420[_0x4e02('0x1d')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4d10f9[_0x4e02('0x26')]){case'GET':_0x4d10f9['qs']=_0x2d55e1;break;case _0x4e02('0x25'):_0x4d10f9[_0x4e02('0x8')]=_0x2d55e1;break;}return rp(_0x4d10f9)[_0x4e02('0x10')](function(_0x590d44){logger[_0x4e02('0x1e')](_0x4e02('0x1f'),_0x4e02('0x20'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x2d55e1['id'],_0x5f3420[_0x4e02('0x1d')]));if(_0x590d44[_0x4e02('0x8')][_0x4e02('0x27')]&&_0x590d44[_0x4e02('0x8')][_0x4e02('0x27')]!=_0x2d55e1[_0x4e02('0x28')]['threadId']){return _0x4ae999[_0x4e02('0x18')][_0x4e02('0x11')]({'threadId':_0x590d44[_0x4e02('0x8')][_0x4e02('0x27')]},{'where':{'id':_0x2d55e1[_0x4e02('0x28')]['id']}});}else{return;}})[_0x4e02('0x10')](function(){return _0x4afc91[_0x4e02('0x11')]({'read':!![]});})[_0x4e02('0x29')](function(_0x8c781){logger['error'](_0x4e02('0x1f'),_0x4e02('0x20'),util[_0x4e02('0x2a')](_0x8c781,{'showHidden':![],'depth':null}));_0x318a39();});}else{_0x318a39();}})['finally'](function(){_0x318a39();});}else{_0x318a39();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x2753=['replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','Interaction','omit','POST','method','GET','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','update','createdAt','catch','error','CmContact','describe','then','OpenchannelAccount','OpenchannelAccountId','OpenchannelInteractionId','Contact'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2753,0xe4));var _0x3275=function(_0x524d5e,_0x269f75){_0x524d5e=_0x524d5e-0x0;var _0x3a1eca=_0x2753[_0x524d5e];return _0x3a1eca;};'use strict';var _=require(_0x3275('0x0'));var util=require(_0x3275('0x1'));var logger=require(_0x3275('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3275('0x3'));var rp=require(_0x3275('0x4'));var fs=require('fs');var path=require(_0x3275('0x5'));var rimraf=require(_0x3275('0x6'));var config=require(_0x3275('0x7'));var attributes=require(_0x3275('0x8'));module[_0x3275('0x9')]=function(_0x385ba4,_0x35b38c){return _0x385ba4[_0x3275('0xa')](_0x3275('0xb'),attributes,{'tableName':_0x3275('0xc'),'paranoid':![],'indexes':[{'name':_0x3275('0xd'),'fields':[_0x3275('0xe')],'type':_0x3275('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x56b8ac,_0x295752,_0x4e381b){var _0x21844b=_0x385ba4[_0x3275('0x10')];var _0x294f58=_0x56b8ac[_0x3275('0x11')]({'plain':!![]});if(_0x294f58['direction'][_0x3275('0x12')]()==='in'||_0x294f58[_0x3275('0x13')][_0x3275('0x12')]()===_0x3275('0x14')&&!_0x294f58[_0x3275('0x15')]&&!_[_0x3275('0x16')](_0x294f58[_0x3275('0x17')])){_0x21844b[_0x3275('0x18')][_0x3275('0x19')]({'where':{'id':_0x294f58['OpenchannelInteractionId']}})['then'](function(_0x566768){if(_0x566768){_0x566768[_0x3275('0x1a')]({'lastMsgAt':_0x294f58[_0x3275('0x1b')],'lastMsgDirection':_0x294f58[_0x3275('0x13')]['toLowerCase']()});}})[_0x3275('0x1c')](function(_0x19aeb6){console[_0x3275('0x1d')](_0x19aeb6);});}if(_0x294f58['direction']===_0x3275('0x14')&&!_0x294f58[_0x3275('0x15')]){var _0x2dff6f;_0x21844b[_0x3275('0x1e')][_0x3275('0x1f')]()[_0x3275('0x20')](function(_0x3927e0){return _0x21844b[_0x3275('0x21')]['find']({'where':{'id':_0x294f58[_0x3275('0x22')]},'include':[{'model':_0x21844b['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x294f58[_0x3275('0x23')]},'limit':0x1,'include':[{'model':_0x21844b[_0x3275('0x1e')],'as':_0x3275('0x24'),'attributes':_['keys'](_0x3927e0)}]}]});})[_0x3275('0x20')](function(_0x562ad4){_0x2dff6f=_0x562ad4[_0x3275('0x11')]({'plain':!![]});if(_0x2dff6f&&_0x2dff6f[_0x3275('0x25')]){logger[_0x3275('0x26')](_0x3275('0x27'),_0x3275('0x28'),util['format'](_0x3275('0x29'),_0x294f58['id'],_0x2dff6f['replyUri']));if(_0x2dff6f[_0x3275('0x2a')]&&_0x2dff6f[_0x3275('0x2a')]['length']){_0x294f58[_0x3275('0x2b')]=_[_0x3275('0x2c')](_0x2dff6f['Interactions'][0x0],_0x3275('0x24'));_0x294f58[_0x3275('0x24')]=_0x2dff6f['Interactions'][0x0][_0x3275('0x24')];}var _0x295752={'method':_0x3275('0x2d'),'uri':encodeURI(_0x2dff6f[_0x3275('0x25')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x295752[_0x3275('0x2e')]){case _0x3275('0x2f'):_0x295752['qs']=_0x294f58;break;case _0x3275('0x2d'):_0x295752['body']=_0x294f58;break;}return rp(_0x295752)['then'](function(_0x3109ed){logger['info'](_0x3275('0x27'),_0x3275('0x28'),util['format']('Message\x20%d\x20forwarded\x20to\x20%s',_0x294f58['id'],_0x2dff6f[_0x3275('0x25')]));if(_0x3109ed['body'][_0x3275('0x30')]&&_0x3109ed[_0x3275('0xe')]['threadId']!=_0x294f58['Interaction'][_0x3275('0x30')]){return _0x21844b[_0x3275('0x18')]['update']({'threadId':_0x3109ed[_0x3275('0xe')][_0x3275('0x30')]},{'where':{'id':_0x294f58['Interaction']['id']}});}else{return;}})[_0x3275('0x20')](function(){return _0x56b8ac[_0x3275('0x1a')]({'read':!![]});})['catch'](function(_0x1557ac){logger[_0x3275('0x1d')](_0x3275('0x27'),_0x3275('0x28'),util[_0x3275('0x31')](_0x1557ac,{'showHidden':![],'depth':null}));_0x4e381b();});}else{_0x4e381b();}})[_0x3275('0x32')](function(){_0x4e381b();});}else{_0x4e381b();}}},'charset':_0x3275('0x33'),'collate':_0x3275('0x34')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index a2186c9..8fa5452 100644 --- a/server/api/openchannelMessage/openchannelMessage.rpc.js +++ b/server/api/openchannelMessage/openchannelMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x45f6d3,_0x5a085){var _0x4f55f2=function(_0x381bff){while(--_0x381bff){_0x45f6d3['push'](_0x45f6d3['shift']());}};_0x4f55f2(++_0x5a085);}(_0xadb5,0xad));var _0x5adb=function(_0x4150f5,_0x25d3f3){_0x4150f5=_0x4150f5-0x0;var _0x260669=_0xadb5[_0x4150f5];return _0x260669;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file +var _0x5f2f=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelMessage','create','options','raw','CreateOpenchannelMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c3309,_0x1d5971){var _0x2626c4=function(_0x2b9bbf){while(--_0x2b9bbf){_0x1c3309['push'](_0x1c3309['shift']());}};_0x2626c4(++_0x1d5971);}(_0x5f2f,0x73));var _0xf5f2=function(_0x528330,_0x3d47ac){_0x528330=_0x528330-0x0;var _0x1cbb2c=_0x5f2f[_0x528330];return _0x1cbb2c;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});config[_0xf5f2('0xc')]=_[_0xf5f2('0xd')](config['redis'],{'host':_0xf5f2('0xe'),'port':0x18eb});var socket=require(_0xf5f2('0xf'))(new Redis(config[_0xf5f2('0xc')]));require('./openchannelMessage.socket')[_0xf5f2('0x10')](socket);function respondWithRpcPromise(_0x15dd7c,_0x218ae3,_0x4e0e6b){return new BPromise(function(_0x977a59,_0x4ebbbe){return client['request'](_0x15dd7c,_0x4e0e6b)[_0xf5f2('0x11')](function(_0x151aba){logger['info'](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));logger[_0xf5f2('0x14')](_0xf5f2('0x15'),_0x218ae3,_0xf5f2('0x13'),JSON[_0xf5f2('0x16')](_0x151aba));if(_0x151aba['error']){if(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x18')]===0x1f4){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')]['message']);return _0x4ebbbe(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);return _0x977a59(_0x151aba[_0xf5f2('0x17')][_0xf5f2('0x19')]);}else{logger[_0xf5f2('0x1a')](_0xf5f2('0x12'),_0x218ae3,_0xf5f2('0x13'));_0x977a59(_0x151aba[_0xf5f2('0x1b')][_0xf5f2('0x19')]);}})[_0xf5f2('0x1c')](function(_0x3cf5ea){logger[_0xf5f2('0x17')](_0xf5f2('0x12'),_0x218ae3,_0x3cf5ea);_0x4ebbbe(_0x3cf5ea);});});}exports['CreateOpenchannelMessage']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')](_0x34706d['body'],{'raw':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![]})[_0xf5f2('0x11')](function(_0x36f1cb){logger['info'](_0xf5f2('0x21'),_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x21'),_0x34706d,JSON[_0xf5f2('0x16')](_0x36f1cb));_0x49dac2(_0x36f1cb);})[_0xf5f2('0x1c')](function(_0x5bdf4a){logger['error'](_0xf5f2('0x21'),_0x5bdf4a[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e[_0xf5f2('0x17')](0x1f4,_0x5bdf4a[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 5ac4dc8..35ca6da 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 _0x2d72=['update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events','save','remove'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x2d72,0xa8));var _0x22d7=function(_0x230f1e,_0x4f9302){_0x230f1e=_0x230f1e-0x0;var _0x31ed05=_0x2d72[_0x230f1e];return _0x31ed05;};'use strict';var OpenchannelMessageEvents=require(_0x22d7('0x0'));var events=[_0x22d7('0x1'),_0x22d7('0x2'),_0x22d7('0x3')];function createListener(_0x2e0ccf,_0x1af034){return function(_0x3ea23c){_0x1af034[_0x22d7('0x4')](_0x2e0ccf,_0x3ea23c);};}function removeListener(_0x35cf66,_0xfd6d11){return function(){OpenchannelMessageEvents[_0x22d7('0x5')](_0x35cf66,_0xfd6d11);};}exports[_0x22d7('0x6')]=function(_0x208b5b){for(var _0x100426=0x0,_0x52a3e3=events[_0x22d7('0x7')];_0x100426<_0x52a3e3;_0x100426++){var _0x3791d6=events[_0x100426];var _0x492ca8=createListener(_0x22d7('0x8')+_0x3791d6,_0x208b5b);OpenchannelMessageEvents['on'](_0x3791d6,_0x492ca8);}}; \ No newline at end of file +var _0xffde=['remove','update','emit','removeListener','register','length','openchannelMessage:','save'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xffde,0x9f));var _0xeffd=function(_0x130de7,_0x1d6e80){_0x130de7=_0x130de7-0x0;var _0x4bc1d4=_0xffde[_0x130de7];return _0x4bc1d4;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xeffd('0x0'),_0xeffd('0x1'),_0xeffd('0x2')];function createListener(_0xf55bb2,_0xd1aa96){return function(_0x2f83e0){_0xd1aa96[_0xeffd('0x3')](_0xf55bb2,_0x2f83e0);};}function removeListener(_0x2c23ce,_0x49ded4){return function(){OpenchannelMessageEvents[_0xeffd('0x4')](_0x2c23ce,_0x49ded4);};}exports[_0xeffd('0x5')]=function(_0x24216c){for(var _0x111b43=0x0,_0x3544c3=events[_0xeffd('0x6')];_0x111b43<_0x3544c3;_0x111b43++){var _0x4c0086=events[_0x111b43];var _0x5a25ba=createListener(_0xeffd('0x7')+_0x4c0086,_0x24216c);OpenchannelMessageEvents['on'](_0x4c0086,_0x5a25ba);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index fa1fa50..8715921 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 _0xb0c7=['addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','path','connect-timeout','../../components/auth/service','get','isAuthenticated','index','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb0c7,0x64));var _0x7b0c=function(_0x270dba,_0x1817d2){_0x270dba=_0x270dba-0x0;var _0x36b83b=_0xb0c7[_0x270dba];return _0x36b83b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7b0c('0x0'));var timeout=require(_0x7b0c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7b0c('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router[_0x7b0c('0x3')]('/',auth[_0x7b0c('0x4')](),controller[_0x7b0c('0x5')]);router[_0x7b0c('0x3')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7b0c('0x3')](_0x7b0c('0x6'),auth['isAuthenticated'](),controller['show']);router[_0x7b0c('0x3')](_0x7b0c('0x7'),auth[_0x7b0c('0x4')](),controller[_0x7b0c('0x8')]);router[_0x7b0c('0x3')](_0x7b0c('0x9'),auth[_0x7b0c('0x4')](),controller[_0x7b0c('0xa')]);router['get'](_0x7b0c('0xb'),auth['isAuthenticated'](),controller[_0x7b0c('0xc')]);router[_0x7b0c('0xd')]('/',auth[_0x7b0c('0x4')](),controller[_0x7b0c('0xe')]);router['post'](_0x7b0c('0x9'),auth['isAuthenticated'](),controller[_0x7b0c('0xf')]);router['post'](_0x7b0c('0xb'),auth[_0x7b0c('0x4')](),controller[_0x7b0c('0x10')]);router['put'](_0x7b0c('0x6'),auth['isAuthenticated'](),controller[_0x7b0c('0x11')]);router[_0x7b0c('0x12')]('/:id',auth[_0x7b0c('0x4')](),controller[_0x7b0c('0x13')]);router['delete'](_0x7b0c('0x9'),auth[_0x7b0c('0x4')](),controller[_0x7b0c('0x14')]);router['delete'](_0x7b0c('0xb'),auth[_0x7b0c('0x4')](),controller[_0x7b0c('0x15')]);module[_0x7b0c('0x16')]=router; \ No newline at end of file +var _0x2ba9=['../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','/:id/users','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','connect-timeout','express','fs-extra'];(function(_0x2b17a0,_0x51e228){var _0x55904b=function(_0x4422f3){while(--_0x4422f3){_0x2b17a0['push'](_0x2b17a0['shift']());}};_0x55904b(++_0x51e228);}(_0x2ba9,0xdb));var _0x92ba=function(_0xa3368f,_0x18cd13){_0xa3368f=_0xa3368f-0x0;var _0x90c54e=_0x2ba9[_0xa3368f];return _0x90c54e;};'use strict';var multer=require(_0x92ba('0x0'));var util=require(_0x92ba('0x1'));var path=require('path');var timeout=require(_0x92ba('0x2'));var express=require(_0x92ba('0x3'));var router=express['Router']();var fs_extra=require(_0x92ba('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x92ba('0x5'));var config=require(_0x92ba('0x6'));var controller=require(_0x92ba('0x7'));router[_0x92ba('0x8')]('/',auth[_0x92ba('0x9')](),controller[_0x92ba('0xa')]);router[_0x92ba('0x8')](_0x92ba('0xb'),auth['isAuthenticated'](),controller[_0x92ba('0xc')]);router[_0x92ba('0x8')](_0x92ba('0xd'),auth[_0x92ba('0x9')](),controller['show']);router[_0x92ba('0x8')](_0x92ba('0xe'),auth[_0x92ba('0x9')](),controller[_0x92ba('0xf')]);router['get'](_0x92ba('0x10'),auth[_0x92ba('0x9')](),controller[_0x92ba('0x11')]);router[_0x92ba('0x8')]('/:id/users',auth[_0x92ba('0x9')](),controller[_0x92ba('0x12')]);router[_0x92ba('0x13')]('/',auth[_0x92ba('0x9')](),controller[_0x92ba('0x14')]);router[_0x92ba('0x13')](_0x92ba('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x92ba('0x13')](_0x92ba('0x15'),auth[_0x92ba('0x9')](),controller[_0x92ba('0x16')]);router[_0x92ba('0x17')](_0x92ba('0xd'),auth[_0x92ba('0x9')](),controller[_0x92ba('0x18')]);router['delete'](_0x92ba('0xd'),auth[_0x92ba('0x9')](),controller['destroy']);router[_0x92ba('0x19')](_0x92ba('0x10'),auth[_0x92ba('0x9')](),controller[_0x92ba('0x1a')]);router[_0x92ba('0x19')](_0x92ba('0x15'),auth[_0x92ba('0x9')](),controller[_0x92ba('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 4c84262..a38a17a 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 _0x8ff5=['beepall','roundrobin','exports','STRING','name','INTEGER','rrmemory'];(function(_0x17248a,_0x253247){var _0x3c186a=function(_0x12f0cf){while(--_0x12f0cf){_0x17248a['push'](_0x17248a['shift']());}};_0x3c186a(++_0x253247);}(_0x8ff5,0x6b));var _0x58ff=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x8ff5[_0x5d6456];return _0x4d66c1;};'use strict';var Sequelize=require('sequelize');module[_0x58ff('0x0')]={'name':{'type':Sequelize[_0x58ff('0x1')],'unique':_0x58ff('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x58ff('0x1')]},'timeout':{'type':Sequelize[_0x58ff('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x58ff('0x4'),_0x58ff('0x5'),_0x58ff('0x6'))}}; \ No newline at end of file +var _0xaf9e=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xe1441d,_0x36fb8e){var _0x2ef242=function(_0x52bf2d){while(--_0x52bf2d){_0xe1441d['push'](_0xe1441d['shift']());}};_0x2ef242(++_0x36fb8e);}(_0xaf9e,0x1e9));var _0xeaf9=function(_0x3f1e64,_0x2cc75f){_0x3f1e64=_0x3f1e64-0x0;var _0x1fbeac=_0xaf9e[_0x3f1e64];return _0x1fbeac;};'use strict';var Sequelize=require(_0xeaf9('0x0'));module[_0xeaf9('0x1')]={'name':{'type':Sequelize[_0xeaf9('0x2')],'unique':_0xeaf9('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xeaf9('0x2')]},'timeout':{'type':Sequelize[_0xeaf9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xeaf9('0x5')](_0xeaf9('0x6'),_0xeaf9('0x7'),_0xeaf9('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index aabd064..3c60214 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 _0x077a=['isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','util','lodash','../../components/parsers/qs','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','then','destroy','get','OpenchannelQueues','UserProfileResource','error','name','send','index','map','OpenchannelQueue','rawAttributes','fieldName','type','getOptions','where','include','findAll','rows','catch','show','params','keys','query','filters','intersection','model','attributes','fields','merge','options','find','create','body','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','length','hasOwnProperty','nolimit','sort','pick','OpenchannelQueueId','filter','UserOpenchannelQueue','User','findAndCountAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','Team','order','getTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','addTeams','each','findOrCreate','userOpenchannelQueue:save','removeTeams','select','field','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','transaction'];(function(_0x4cdce4,_0x52f9e9){var _0x457021=function(_0x4a9629){while(--_0x4a9629){_0x4cdce4['push'](_0x4cdce4['shift']());}};_0x457021(++_0x52f9e9);}(_0x077a,0x83));var _0xa077=function(_0x3eae8d,_0x331b35){_0x3eae8d=_0x3eae8d-0x0;var _0x360920=_0x077a[_0x3eae8d];return _0x360920;};'use strict';var BPromise=require('bluebird');var util=require(_0xa077('0x0'));var _=require(_0xa077('0x1'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0xa077('0x2'));var logger=require('../../config/logger')(_0xa077('0x3'));var config=require('../../config/environment');var db=require(_0xa077('0x4'))['db'];config['redis']=_[_0xa077('0x5')](config[_0xa077('0x6')],{'host':_0xa077('0x7'),'port':0x18eb});var socket=require(_0xa077('0x8'))(new Redis(config[_0xa077('0x6')]));require(_0xa077('0x9'))[_0xa077('0xa')](socket);function respondWithStatusCode(_0x318ecb,_0x23c744){_0x23c744=_0x23c744||0xcc;return function(_0x1b29fd){if(_0x1b29fd){return _0x318ecb[_0xa077('0xb')](_0x23c744);}return _0x318ecb['status'](_0x23c744)[_0xa077('0xc')]();};}function respondWithResult(_0x540504,_0x43e6e7){_0x43e6e7=_0x43e6e7||0xc8;return function(_0x38a857){if(_0x38a857){return _0x540504[_0xa077('0xd')](_0x43e6e7)[_0xa077('0xe')](_0x38a857);}};}function respondWithFilteredResult(_0x20cef7,_0x28ee90){return function(_0x2922cf){if(_0x2922cf){var _0x3bbadb=typeof _0x28ee90[_0xa077('0xf')]===_0xa077('0x10')&&typeof _0x28ee90[_0xa077('0x11')]==='undefined';var _0x6cfebe=_0x2922cf[_0xa077('0x12')];var _0x226551=_0x3bbadb?0x0:_0x28ee90[_0xa077('0xf')];var _0x41cd4a=_0x3bbadb?_0x2922cf[_0xa077('0x12')]:_0x28ee90['offset']+_0x28ee90[_0xa077('0x11')];var _0x2e99bf;if(_0x41cd4a>=_0x6cfebe){_0x41cd4a=_0x6cfebe;_0x2e99bf=0xc8;}else{_0x2e99bf=0xce;}_0x20cef7['status'](_0x2e99bf);return _0x20cef7[_0xa077('0x13')]('Content-Range',_0x226551+'-'+_0x41cd4a+'/'+_0x6cfebe)[_0xa077('0xe')](_0x2922cf);}return null;};}function saveUpdates(_0x3bb089){return function(_0x1291fb){if(_0x1291fb){return _0x1291fb['update'](_0x3bb089)[_0xa077('0x14')](function(_0x2ae79a){return _0x2ae79a;});}return null;};}function removeEntity(_0x80086){return function(_0x459214){if(_0x459214){return _0x459214[_0xa077('0x15')]()[_0xa077('0x14')](function(){var _0x35460c=_0x459214[_0xa077('0x16')]({'plain':!![]});var _0x26dd60=_0xa077('0x17');return db[_0xa077('0x18')][_0xa077('0x15')]({'where':{'type':_0x26dd60,'resourceId':_0x35460c['id']}})['then'](function(){return _0x459214;});})[_0xa077('0x14')](function(){_0x80086[_0xa077('0xd')](0xcc)[_0xa077('0xc')]();});}};}function handleEntityNotFound(_0x30279d){return function(_0x46530c){if(!_0x46530c){_0x30279d[_0xa077('0xb')](0x194);}return _0x46530c;};}function handleError(_0x356c56,_0x1d6b39){_0x1d6b39=_0x1d6b39||0x1f4;return function(_0x12e8f6){logger[_0xa077('0x19')](_0x12e8f6['stack']);if(_0x12e8f6[_0xa077('0x1a')]){delete _0x12e8f6[_0xa077('0x1a')];}_0x356c56[_0xa077('0xd')](_0x1d6b39)[_0xa077('0x1b')](_0x12e8f6);};}exports[_0xa077('0x1c')]=function(_0x2e0dcd,_0x213812){var _0x37db94={};var _0x3856bb={'count':0x0,'rows':[]};var _0x53ff29=_[_0xa077('0x1d')](db[_0xa077('0x1e')][_0xa077('0x1f')],function(_0x3313ee){return{'name':_0x3313ee[_0xa077('0x20')],'type':_0x3313ee[_0xa077('0x21')]['key']};});_0x37db94=qs[_0xa077('0x22')](_0x53ff29,_0x2e0dcd);var _0x2e328f={'where':_0x37db94[_0xa077('0x23')]};return db[_0xa077('0x1e')][_0xa077('0x12')](_0x2e328f)[_0xa077('0x14')](function(_0x8d0c8b){_0x3856bb[_0xa077('0x12')]=_0x8d0c8b;_0x37db94[_0xa077('0x24')]=qs[_0xa077('0x24')](_0x2e0dcd['query']);return db[_0xa077('0x1e')][_0xa077('0x25')](_0x37db94);})[_0xa077('0x14')](function(_0x9788bb){_0x3856bb[_0xa077('0x26')]=_0x9788bb;return _0x3856bb;})[_0xa077('0x14')](respondWithFilteredResult(_0x213812,_0x37db94))[_0xa077('0x27')](handleError(_0x213812,null));};exports[_0xa077('0x28')]=function(_0x477b54,_0x4d473f){var _0x5df446={'raw':!![],'where':{'id':_0x477b54[_0xa077('0x29')]['id']}},_0x55dff7={};_0x55dff7['model']=_[_0xa077('0x2a')](db[_0xa077('0x1e')][_0xa077('0x1f')]);_0x55dff7[_0xa077('0x2b')]=_['keys'](_0x477b54[_0xa077('0x2b')]);_0x55dff7[_0xa077('0x2c')]=_[_0xa077('0x2d')](_0x55dff7[_0xa077('0x2e')],_0x55dff7[_0xa077('0x2b')]);_0x5df446[_0xa077('0x2f')]=_[_0xa077('0x2d')](_0x55dff7['model'],qs['fields'](_0x477b54[_0xa077('0x2b')][_0xa077('0x30')]));_0x5df446[_0xa077('0x2f')]=_0x5df446[_0xa077('0x2f')]['length']?_0x5df446['attributes']:_0x55dff7[_0xa077('0x2e')];if(_0x477b54['query']['includeAll']){_0x5df446['include']=[{'all':!![]}];}_0x5df446=_[_0xa077('0x31')]({},_0x5df446,_0x477b54[_0xa077('0x32')]);return db[_0xa077('0x1e')][_0xa077('0x33')](_0x5df446)['then'](handleEntityNotFound(_0x4d473f,null))[_0xa077('0x14')](respondWithResult(_0x4d473f,null))['catch'](handleError(_0x4d473f,null));};exports[_0xa077('0x34')]=function(_0x3ad8eb,_0x10eb2e){return db[_0xa077('0x1e')]['create'](_0x3ad8eb[_0xa077('0x35')],{})[_0xa077('0x14')](function(_0xd7ff96){var _0x2217b1=_0x3ad8eb['user'][_0xa077('0x16')]({'plain':!![]});if(!_0x2217b1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2217b1[_0xa077('0x36')]===_0xa077('0x37')){var _0xbe8cc1=_0xd7ff96[_0xa077('0x16')]({'plain':!![]});var _0x222a0c='OpenchannelQueues';return db['UserProfileSection'][_0xa077('0x33')]({'where':{'name':_0x222a0c,'userProfileId':_0x2217b1[_0xa077('0x38')]},'raw':!![]})[_0xa077('0x14')](function(_0xbfce3e){if(_0xbfce3e&&_0xbfce3e[_0xa077('0x39')]===0x0){return db[_0xa077('0x18')][_0xa077('0x34')]({'name':_0xbe8cc1[_0xa077('0x1a')],'resourceId':_0xbe8cc1['id'],'type':_0xbfce3e[_0xa077('0x1a')],'sectionId':_0xbfce3e['id']},{})[_0xa077('0x14')](function(){return _0xd7ff96;});}else{return _0xd7ff96;}})[_0xa077('0x27')](function(_0x1367de){logger[_0xa077('0x19')](_0xa077('0x3a'),_0x1367de);throw _0x1367de;});}return _0xd7ff96;})[_0xa077('0x14')](respondWithResult(_0x10eb2e,0xc9))[_0xa077('0x27')](handleError(_0x10eb2e,null));};exports[_0xa077('0x3b')]=function(_0x221019,_0x2a6ea6){if(_0x221019[_0xa077('0x35')]['id']){delete _0x221019[_0xa077('0x35')]['id'];}return db[_0xa077('0x1e')]['find']({'where':{'id':_0x221019[_0xa077('0x29')]['id']}})[_0xa077('0x14')](handleEntityNotFound(_0x2a6ea6,null))[_0xa077('0x14')](saveUpdates(_0x221019[_0xa077('0x35')],null))[_0xa077('0x14')](respondWithResult(_0x2a6ea6,null))['catch'](handleError(_0x2a6ea6,null));};exports[_0xa077('0x15')]=function(_0x295fa0,_0x5019a9){return db[_0xa077('0x1e')]['find']({'where':{'id':_0x295fa0[_0xa077('0x29')]['id']}})[_0xa077('0x14')](handleEntityNotFound(_0x5019a9,null))[_0xa077('0x14')](removeEntity(_0x5019a9,null))[_0xa077('0x27')](handleError(_0x5019a9,null));};exports[_0xa077('0x3c')]=function(_0x4c27bf,_0x3f82a1){return db[_0xa077('0x1e')][_0xa077('0x3c')]()[_0xa077('0x14')](respondWithResult(_0x3f82a1,null))[_0xa077('0x27')](handleError(_0x3f82a1,null));};exports[_0xa077('0x3d')]=function(_0x89b810,_0x28066f){var _0x5f0ffd={'raw':!![],'where':{}},_0x3bea38={},_0x3cfa76;return db[_0xa077('0x1e')][_0xa077('0x3e')]({'where':{'id':_0x89b810['params']['id']}})[_0xa077('0x14')](handleEntityNotFound(_0x28066f,null))['then'](function(_0x2e1e92){if(_0x2e1e92){_0x3cfa76=_0x2e1e92[_0xa077('0x16')]({'plain':!![]});_0x3bea38['model']=_['keys'](db['UserOpenchannelQueue'][_0xa077('0x1f')]);_0x3bea38[_0xa077('0x2b')]=_['keys'](_0x89b810[_0xa077('0x2b')]);_0x3bea38[_0xa077('0x2c')]=_['intersection'](_0x3bea38[_0xa077('0x2e')],_0x3bea38[_0xa077('0x2b')]);_0x5f0ffd[_0xa077('0x2f')]=_[_0xa077('0x2d')](_0x3bea38[_0xa077('0x2e')],qs[_0xa077('0x30')](_0x89b810['query']['fields']));_0x5f0ffd[_0xa077('0x2f')]=_0x5f0ffd[_0xa077('0x2f')][_0xa077('0x3f')]?_0x5f0ffd['attributes']:_0x3bea38[_0xa077('0x2e')];if(!_0x89b810[_0xa077('0x2b')][_0xa077('0x40')](_0xa077('0x41'))){_0x5f0ffd[_0xa077('0x11')]=qs['limit'](_0x89b810[_0xa077('0x2b')][_0xa077('0x11')]);_0x5f0ffd[_0xa077('0xf')]=qs['offset'](_0x89b810[_0xa077('0x2b')][_0xa077('0xf')]);}_0x5f0ffd['order']=qs['sort'](_0x89b810['query'][_0xa077('0x42')]);_0x5f0ffd['where']=qs['filters'](_[_0xa077('0x43')](_0x89b810[_0xa077('0x2b')],_0x3bea38[_0xa077('0x2c')]));_0x5f0ffd[_0xa077('0x23')][_0xa077('0x44')]=_0x2e1e92['id'];if(_0x89b810['query'][_0xa077('0x45')]){_0x5f0ffd[_0xa077('0x23')]=_[_0xa077('0x31')](_0x5f0ffd[_0xa077('0x23')],{'$or':_[_0xa077('0x1d')](_0x5f0ffd[_0xa077('0x2f')],function(_0x56fae9){var _0x3147f2={};_0x3147f2[_0x56fae9]={'$like':'%'+_0x89b810['query']['filter']+'%'};return _0x3147f2;})});}_0x5f0ffd=_[_0xa077('0x31')]({},_0x5f0ffd,_0x89b810['options']);return db[_0xa077('0x46')][_0xa077('0x25')](_0x5f0ffd);}})['then'](function(_0x534dd7){if(_0x534dd7){return db[_0xa077('0x47')][_0xa077('0x48')]({'where':{'id':_[_0xa077('0x1d')](_0x534dd7,_0xa077('0x49')),'role':'agent'},'attributes':['id',_0xa077('0x1a'),_0xa077('0x4a'),'updatedAt',_0xa077('0x4b')]});}})[_0xa077('0x14')](function(_0x21a06a){if(_0x21a06a){return{'count':_0x21a06a[_0xa077('0x12')],'rows':_['map'](_0x21a06a[_0xa077('0x26')],function(_0x2d4389){return{'membername':_0x2d4389[_0xa077('0x1a')],'UserId':_0x2d4389['id'],'queue_name':_0x3cfa76[_0xa077('0x1a')],'OpenchannelQueueId':_0x3cfa76['id'],'interface':util[_0xa077('0x4c')](_0xa077('0x4d'),_0xa077('0x4e'),_0x2d4389[_0xa077('0x1a')]),'penalty':0x0,'paused':_0x2d4389['openchannelPause'],'createdAt':_0x2d4389[_0xa077('0x4b')],'updatedAt':_0x2d4389['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xa077('0x14')](respondWithFilteredResult(_0x28066f,_0x5f0ffd))[_0xa077('0x27')](handleError(_0x28066f,null));};exports['getTeams']=function(_0x3beb1c,_0x30a7d8){var _0x55daee={};var _0x5600a5={};var _0x16abb5;var _0x471d39;return db[_0xa077('0x1e')]['findOne']({'where':{'id':_0x3beb1c[_0xa077('0x29')]['id']}})[_0xa077('0x14')](handleEntityNotFound(_0x30a7d8,null))['then'](function(_0x24d5d7){if(_0x24d5d7){_0x16abb5=_0x24d5d7;_0x5600a5[_0xa077('0x2e')]=_[_0xa077('0x2a')](db[_0xa077('0x4f')][_0xa077('0x1f')]);_0x5600a5['query']=_[_0xa077('0x2a')](_0x3beb1c[_0xa077('0x2b')]);_0x5600a5[_0xa077('0x2c')]=_[_0xa077('0x2d')](_0x5600a5['model'],_0x5600a5[_0xa077('0x2b')]);_0x55daee[_0xa077('0x2f')]=_[_0xa077('0x2d')](_0x5600a5[_0xa077('0x2e')],qs['fields'](_0x3beb1c['query'][_0xa077('0x30')]));_0x55daee[_0xa077('0x2f')]=_0x55daee[_0xa077('0x2f')][_0xa077('0x3f')]?_0x55daee['attributes']:_0x5600a5[_0xa077('0x2e')];_0x55daee[_0xa077('0x50')]=qs[_0xa077('0x42')](_0x3beb1c[_0xa077('0x2b')][_0xa077('0x42')]);_0x55daee[_0xa077('0x23')]=qs[_0xa077('0x2c')](_[_0xa077('0x43')](_0x3beb1c[_0xa077('0x2b')],_0x5600a5[_0xa077('0x2c')]));if(_0x3beb1c[_0xa077('0x2b')]['filter']){_0x55daee[_0xa077('0x23')]=_[_0xa077('0x31')](_0x55daee[_0xa077('0x23')],{'$or':_[_0xa077('0x1d')](_0x55daee[_0xa077('0x2f')],function(_0x146ad7){var _0x32d05a={};_0x32d05a[_0x146ad7]={'$like':'%'+_0x3beb1c[_0xa077('0x2b')][_0xa077('0x45')]+'%'};return _0x32d05a;})});}_0x55daee=_[_0xa077('0x31')]({},_0x55daee,_0x3beb1c['options']);return _0x16abb5[_0xa077('0x51')](_0x55daee);}})[_0xa077('0x14')](function(_0x2df753){if(_0x2df753){_0x471d39=_0x2df753[_0xa077('0x3f')];if(!_0x3beb1c[_0xa077('0x2b')]['hasOwnProperty'](_0xa077('0x41'))){_0x55daee[_0xa077('0x11')]=qs[_0xa077('0x11')](_0x3beb1c[_0xa077('0x2b')][_0xa077('0x11')]);_0x55daee[_0xa077('0xf')]=qs[_0xa077('0xf')](_0x3beb1c[_0xa077('0x2b')][_0xa077('0xf')]);}return _0x16abb5[_0xa077('0x51')](_0x55daee);}})[_0xa077('0x14')](function(_0x5a30d5){if(_0x5a30d5){return _0x5a30d5?{'count':_0x471d39,'rows':_0x5a30d5}:null;}})['then'](respondWithResult(_0x30a7d8,null))[_0xa077('0x27')](handleError(_0x30a7d8,null));};exports['addTeams']=function(_0x129be9,_0x599a1e){var _0x3a048a=_0x129be9[_0xa077('0x35')][_0xa077('0x52')];return db[_0xa077('0x4f')][_0xa077('0x25')]({'where':{'id':_0x3a048a},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa077('0x1a'),_0xa077('0x53'),_0xa077('0x54'),_0xa077('0x55')],'raw':!![]}]})[_0xa077('0x14')](function(_0x1138b8){if(_0x1138b8){var _0x31e1d4=_[_0xa077('0x56')](_0x1138b8,function(_0x469a3b){var _0x17a4a9=_0x469a3b[_0xa077('0x16')]({'plain':!![]});return _0x17a4a9[_0xa077('0x57')];});return db[_0xa077('0x1e')]['find']({'where':{'id':_0x129be9[_0xa077('0x29')]['id']}})[_0xa077('0x14')](function(_0x217f03){return db[_0xa077('0x58')]['transaction'](function(_0x38bfaf){return _0x217f03[_0xa077('0x59')](_0x3a048a,{'transaction':_0x38bfaf})[_0xa077('0x14')](function(){return BPromise[_0xa077('0x5a')](_0x31e1d4,function(_0x2ca22e){return db[_0xa077('0x46')][_0xa077('0x5b')]({'where':{'UserId':_0x2ca22e['id'],'OpenchannelQueueId':_0x129be9[_0xa077('0x29')]['id']},'transaction':_0x38bfaf});});})[_0xa077('0x14')](function(){_0x31e1d4['forEach'](function(_0xfba8dd){socket['emit'](_0xa077('0x5c'),{'UserId':_0xfba8dd['id'],'OpenchannelQueueId':_0x217f03['id']});});});});});}})[_0xa077('0x14')](respondWithStatusCode(_0x599a1e,null))[_0xa077('0x27')](handleError(_0x599a1e,null));};exports[_0xa077('0x5d')]=function(_0x23c283,_0x585995){return db[_0xa077('0x4f')][_0xa077('0x25')]({'where':{'id':_0x23c283[_0xa077('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa077('0x47')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x585995,null))[_0xa077('0x14')](function(_0x2e9ef0){var _0x363184=_[_0xa077('0x1d')](_0x2e9ef0,'id');var _0x123b36=[];var _0x5b111b=[];var _0x408519=squel[_0xa077('0x5e')]();_0x408519[_0xa077('0x5f')]('tq.TeamId')['from'](_0xa077('0x60'),'tq')[_0xa077('0x61')](_0xa077('0x62'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0xa077('0x63'),_0x23c283[_0xa077('0x29')]['id']);for(var _0x1cf648=0x0;_0x1cf648<_0x2e9ef0[_0xa077('0x3f')];_0x1cf648+=0x1){let _0x42af28=_0x2e9ef0[_0x1cf648];for(var _0x56e8f7=0x0;_0x56e8f7<_0x42af28['Agents'][_0xa077('0x3f')];_0x56e8f7+=0x1){let _0x2419d7=_0x42af28[_0xa077('0x57')][_0x56e8f7];var _0xaead5b=_0x408519[_0xa077('0x64')]();_0xaead5b['where'](_0xa077('0x65'),_0x2419d7['id']);_0x5b111b[_0xa077('0x66')](db['sequelize']['query'](_0xaead5b['toString'](),{'type':db[_0xa077('0x58')][_0xa077('0x67')][_0xa077('0x68')]})[_0xa077('0x14')](function(_0x3f8260){if(_0x3f8260[_0xa077('0x3f')]===0x1){return _0x2419d7['id'];}else{var _0x378487=_['every'](_['map'](_0x3f8260,_0xa077('0x69')),function(_0x3cf8ed){return _[_0xa077('0x6a')](_0x363184,_0x3cf8ed);});if(_0x378487){return _0x2419d7['id'];}}}));}}return BPromise[_0xa077('0x6b')](_0x5b111b)['then'](function(_0x1d5e76){_0x123b36=_(_0x123b36)[_0xa077('0x6c')](_0x1d5e76)[_0xa077('0x6d')]()['value']();return db[_0xa077('0x1e')][_0xa077('0x33')]({'where':{'id':_0x23c283[_0xa077('0x29')]['id']}})[_0xa077('0x14')](function(_0x37826d){return db[_0xa077('0x58')][_0xa077('0x6e')](function(_0x6b71f){return _0x37826d['removeTeams'](_0x23c283['query'][_0xa077('0x52')],{'transaction':_0x6b71f})[_0xa077('0x14')](function(){if(!_[_0xa077('0x6f')](_0x123b36)){return _0x37826d[_0xa077('0x70')](_0x123b36,{'transaction':_0x6b71f});}})[_0xa077('0x14')](function(){_0x123b36[_0xa077('0x71')](function(_0x1bb4d4){socket['emit'](_0xa077('0x72'),{'UserId':_0x1bb4d4,'OpenchannelQueueId':_0x37826d['id']});});});});});});})[_0xa077('0x14')](respondWithStatusCode(_0x585995,null))[_0xa077('0x27')](handleError(_0x585995,null));};exports['addAgents']=function(_0x23a2f4,_0x37c133){return db[_0xa077('0x1e')]['find']({'where':{'id':_0x23a2f4[_0xa077('0x29')]['id']}})[_0xa077('0x14')](handleEntityNotFound(_0x37c133,null))[_0xa077('0x14')](function(_0x479e5a){if(_0x479e5a){return _0x479e5a[_0xa077('0x73')](_0x23a2f4[_0xa077('0x35')][_0xa077('0x52')],_[_0xa077('0x74')](_0x23a2f4[_0xa077('0x35')],[_0xa077('0x52'),'id'])||{})[_0xa077('0x75')](function(_0x23d5e2){for(var _0x1a0098=0x0;_0x1a0098<_0x23a2f4['body'][_0xa077('0x52')][_0xa077('0x3f')];_0x1a0098+=0x1){socket[_0xa077('0x76')](_0xa077('0x5c'),{'UserId':Number(_0x23a2f4['body'][_0xa077('0x52')][_0x1a0098]),'OpenchannelQueueId':Number(_0x23a2f4[_0xa077('0x29')]['id'])});}return _0x23d5e2;});}})['then'](respondWithResult(_0x37c133,null))[_0xa077('0x27')](handleError(_0x37c133,null));};exports[_0xa077('0x70')]=function(_0x2deefe,_0x4b1dd2){return db['OpenchannelQueue'][_0xa077('0x33')]({'where':{'id':_0x2deefe['params']['id']}})[_0xa077('0x14')](handleEntityNotFound(_0x4b1dd2,null))[_0xa077('0x14')](function(_0x3f708b){if(_0x3f708b){return _0x3f708b[_0xa077('0x70')](_0x2deefe[_0xa077('0x2b')][_0xa077('0x52')])[_0xa077('0x14')](function(){if(_[_0xa077('0x77')](_0x2deefe['query'][_0xa077('0x52')])){for(var _0x5b21e7=0x0;_0x5b21e7<_0x2deefe['query'][_0xa077('0x52')][_0xa077('0x3f')];_0x5b21e7+=0x1){socket[_0xa077('0x76')](_0xa077('0x72'),{'UserId':Number(_0x2deefe['query'][_0xa077('0x52')][_0x5b21e7]),'OpenchannelQueueId':Number(_0x2deefe[_0xa077('0x29')]['id'])});}}else{socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x2deefe[_0xa077('0x2b')][_0xa077('0x52')]),'OpenchannelQueueId':Number(_0x2deefe[_0xa077('0x29')]['id'])});}});}})[_0xa077('0x14')](respondWithStatusCode(_0x4b1dd2,null))[_0xa077('0x27')](handleError(_0x4b1dd2,null));};exports[_0xa077('0x78')]=function(_0x3988e6,_0x387bc8){var _0x3e9ff2={};var _0xe02914={};var _0x50d07a;var _0x192713;return db[_0xa077('0x1e')]['findOne']({'where':{'id':_0x3988e6[_0xa077('0x29')]['id']}})['then'](handleEntityNotFound(_0x387bc8,null))[_0xa077('0x14')](function(_0x31eccf){if(_0x31eccf){_0x50d07a=_0x31eccf;_0xe02914[_0xa077('0x2e')]=_['keys'](db[_0xa077('0x47')][_0xa077('0x1f')]);_0xe02914['query']=_[_0xa077('0x2a')](_0x3988e6['query']);_0xe02914[_0xa077('0x2c')]=_[_0xa077('0x2d')](_0xe02914[_0xa077('0x2e')],_0xe02914[_0xa077('0x2b')]);_0x3e9ff2[_0xa077('0x2f')]=_[_0xa077('0x2d')](_0xe02914['model'],qs[_0xa077('0x30')](_0x3988e6[_0xa077('0x2b')][_0xa077('0x30')]));_0x3e9ff2['attributes']=_0x3e9ff2[_0xa077('0x2f')][_0xa077('0x3f')]?_0x3e9ff2[_0xa077('0x2f')]:_0xe02914[_0xa077('0x2e')];_0x3e9ff2[_0xa077('0x50')]=qs['sort'](_0x3988e6[_0xa077('0x2b')][_0xa077('0x42')]);_0x3e9ff2[_0xa077('0x23')]=qs[_0xa077('0x2c')](_[_0xa077('0x43')](_0x3988e6[_0xa077('0x2b')],_0xe02914[_0xa077('0x2c')]));if(_0x3988e6['query'][_0xa077('0x45')]){_0x3e9ff2[_0xa077('0x23')]=_['merge'](_0x3e9ff2[_0xa077('0x23')],{'$or':_[_0xa077('0x1d')](_0x3e9ff2[_0xa077('0x2f')],function(_0x1a8815){var _0x2ec008={};_0x2ec008[_0x1a8815]={'$like':'%'+_0x3988e6[_0xa077('0x2b')][_0xa077('0x45')]+'%'};return _0x2ec008;})});}_0x3e9ff2=_[_0xa077('0x31')]({},_0x3e9ff2,_0x3988e6[_0xa077('0x32')]);return _0x50d07a[_0xa077('0x78')](_0x3e9ff2);}})[_0xa077('0x14')](function(_0x54cc3b){if(_0x54cc3b){_0x192713=_0x54cc3b['length'];if(!_0x3988e6[_0xa077('0x2b')][_0xa077('0x40')](_0xa077('0x41'))){_0x3e9ff2[_0xa077('0x11')]=qs[_0xa077('0x11')](_0x3988e6[_0xa077('0x2b')][_0xa077('0x11')]);_0x3e9ff2[_0xa077('0xf')]=qs[_0xa077('0xf')](_0x3988e6['query'][_0xa077('0xf')]);}return _0x50d07a['getAgents'](_0x3e9ff2);}})[_0xa077('0x14')](function(_0x12ee73){if(_0x12ee73){return _0x12ee73?{'count':_0x192713,'rows':_0x12ee73}:null;}})[_0xa077('0x14')](respondWithResult(_0x387bc8,null))[_0xa077('0x27')](handleError(_0x387bc8,null));}; \ No newline at end of file +var _0x501b=['../../config/environment','localhost','socket.io-emitter','redis','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','update','then','destroy','get','error','stack','name','send','type','key','where','OpenchannelQueue','include','query','findAll','rows','catch','show','params','model','keys','intersection','attributes','fields','includeAll','merge','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','rawAttributes','filters','length','nolimit','order','sort','pick','filter','map','UserOpenchannelQueue','findAndCountAll','UserId','agent','openchannelPause','createdAt','format','%s/%s','updatedAt','findOne','Team','getTeams','hasOwnProperty','addTeams','User','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','compact','isEmpty','removeAgents','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','options','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger'];(function(_0x347541,_0x137cf){var _0x5c0e38=function(_0x32a276){while(--_0x32a276){_0x347541['push'](_0x347541['shift']());}};_0x5c0e38(++_0x137cf);}(_0x501b,0x1dd));var _0xb501=function(_0x17d2f7,_0x356e72){_0x17d2f7=_0x17d2f7-0x0;var _0x125bf9=_0x501b[_0x17d2f7];return _0x125bf9;};'use strict';var BPromise=require(_0xb501('0x0'));var util=require(_0xb501('0x1'));var _=require(_0xb501('0x2'));var squel=require(_0xb501('0x3'));var Redis=require(_0xb501('0x4'));var qs=require(_0xb501('0x5'));var logger=require(_0xb501('0x6'))('api');var config=require(_0xb501('0x7'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb501('0x8'),'port':0x18eb});var socket=require(_0xb501('0x9'))(new Redis(config[_0xb501('0xa')]));require(_0xb501('0xb'))[_0xb501('0xc')](socket);function respondWithStatusCode(_0x5954fe,_0x5b9d69){_0x5b9d69=_0x5b9d69||0xcc;return function(_0x568703){if(_0x568703){return _0x5954fe[_0xb501('0xd')](_0x5b9d69);}return _0x5954fe[_0xb501('0xe')](_0x5b9d69)[_0xb501('0xf')]();};}function respondWithResult(_0x58e64d,_0x5a9fa9){_0x5a9fa9=_0x5a9fa9||0xc8;return function(_0x1bf419){if(_0x1bf419){return _0x58e64d[_0xb501('0xe')](_0x5a9fa9)[_0xb501('0x10')](_0x1bf419);}};}function respondWithFilteredResult(_0x2d7192,_0x4cbb8){return function(_0x289ed3){if(_0x289ed3){var _0x52eb00=typeof _0x4cbb8[_0xb501('0x11')]==='undefined'&&typeof _0x4cbb8[_0xb501('0x12')]==='undefined';var _0x3a514b=_0x289ed3[_0xb501('0x13')];var _0x5d3913=_0x52eb00?0x0:_0x4cbb8[_0xb501('0x11')];var _0x3e75d1=_0x52eb00?_0x289ed3[_0xb501('0x13')]:_0x4cbb8[_0xb501('0x11')]+_0x4cbb8['limit'];var _0x31632d;if(_0x3e75d1>=_0x3a514b){_0x3e75d1=_0x3a514b;_0x31632d=0xc8;}else{_0x31632d=0xce;}_0x2d7192[_0xb501('0xe')](_0x31632d);return _0x2d7192[_0xb501('0x14')](_0xb501('0x15'),_0x5d3913+'-'+_0x3e75d1+'/'+_0x3a514b)['json'](_0x289ed3);}return null;};}function saveUpdates(_0x31b005){return function(_0x46d2e0){if(_0x46d2e0){return _0x46d2e0[_0xb501('0x16')](_0x31b005)[_0xb501('0x17')](function(_0x3cca51){return _0x3cca51;});}return null;};}function removeEntity(_0xd4816c){return function(_0x16af99){if(_0x16af99){return _0x16af99[_0xb501('0x18')]()[_0xb501('0x17')](function(){var _0xaa85cf=_0x16af99[_0xb501('0x19')]({'plain':!![]});var _0x19983d='OpenchannelQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x19983d,'resourceId':_0xaa85cf['id']}})[_0xb501('0x17')](function(){return _0x16af99;});})[_0xb501('0x17')](function(){_0xd4816c[_0xb501('0xe')](0xcc)[_0xb501('0xf')]();});}};}function handleEntityNotFound(_0x560de4){return function(_0x2eafc1){if(!_0x2eafc1){_0x560de4[_0xb501('0xd')](0x194);}return _0x2eafc1;};}function handleError(_0x2f0e99,_0x1c16d0){_0x1c16d0=_0x1c16d0||0x1f4;return function(_0x54d22f){logger[_0xb501('0x1a')](_0x54d22f[_0xb501('0x1b')]);if(_0x54d22f[_0xb501('0x1c')]){delete _0x54d22f[_0xb501('0x1c')];}_0x2f0e99[_0xb501('0xe')](_0x1c16d0)[_0xb501('0x1d')](_0x54d22f);};}exports['index']=function(_0xaa4cae,_0x44abbd){var _0x576c05={};var _0x4db493={'count':0x0,'rows':[]};var _0xf49b3f=_['map'](db['OpenchannelQueue']['rawAttributes'],function(_0x526432){return{'name':_0x526432['fieldName'],'type':_0x526432[_0xb501('0x1e')][_0xb501('0x1f')]};});_0x576c05=qs['getOptions'](_0xf49b3f,_0xaa4cae);var _0x20e877={'where':_0x576c05[_0xb501('0x20')]};return db[_0xb501('0x21')][_0xb501('0x13')](_0x20e877)[_0xb501('0x17')](function(_0x13726e){_0x4db493[_0xb501('0x13')]=_0x13726e;_0x576c05[_0xb501('0x22')]=qs[_0xb501('0x22')](_0xaa4cae[_0xb501('0x23')]);return db[_0xb501('0x21')][_0xb501('0x24')](_0x576c05);})['then'](function(_0x4c2fe2){_0x4db493[_0xb501('0x25')]=_0x4c2fe2;return _0x4db493;})[_0xb501('0x17')](respondWithFilteredResult(_0x44abbd,_0x576c05))[_0xb501('0x26')](handleError(_0x44abbd,null));};exports[_0xb501('0x27')]=function(_0x588147,_0x83dd1e){var _0x23649a={'raw':!![],'where':{'id':_0x588147[_0xb501('0x28')]['id']}},_0x201b1d={};_0x201b1d[_0xb501('0x29')]=_[_0xb501('0x2a')](db[_0xb501('0x21')]['rawAttributes']);_0x201b1d[_0xb501('0x23')]=_[_0xb501('0x2a')](_0x588147['query']);_0x201b1d['filters']=_[_0xb501('0x2b')](_0x201b1d[_0xb501('0x29')],_0x201b1d[_0xb501('0x23')]);_0x23649a[_0xb501('0x2c')]=_[_0xb501('0x2b')](_0x201b1d[_0xb501('0x29')],qs['fields'](_0x588147[_0xb501('0x23')][_0xb501('0x2d')]));_0x23649a[_0xb501('0x2c')]=_0x23649a['attributes']['length']?_0x23649a[_0xb501('0x2c')]:_0x201b1d[_0xb501('0x29')];if(_0x588147[_0xb501('0x23')][_0xb501('0x2e')]){_0x23649a['include']=[{'all':!![]}];}_0x23649a=_[_0xb501('0x2f')]({},_0x23649a,_0x588147['options']);return db[_0xb501('0x21')]['find'](_0x23649a)[_0xb501('0x17')](handleEntityNotFound(_0x83dd1e,null))['then'](respondWithResult(_0x83dd1e,null))['catch'](handleError(_0x83dd1e,null));};exports['create']=function(_0x443791,_0x56fb4e){return db['OpenchannelQueue']['create'](_0x443791[_0xb501('0x30')],{})[_0xb501('0x17')](function(_0x2b8cda){var _0x3707bc=_0x443791[_0xb501('0x31')][_0xb501('0x19')]({'plain':!![]});if(!_0x3707bc)throw new Error(_0xb501('0x32'));if(_0x3707bc[_0xb501('0x33')]===_0xb501('0x31')){var _0x29e02c=_0x2b8cda[_0xb501('0x19')]({'plain':!![]});var _0x4f4e8f=_0xb501('0x34');return db[_0xb501('0x35')][_0xb501('0x36')]({'where':{'name':_0x4f4e8f,'userProfileId':_0x3707bc[_0xb501('0x37')]},'raw':!![]})['then'](function(_0x247a07){if(_0x247a07&&_0x247a07['autoAssociation']===0x0){return db[_0xb501('0x38')]['create']({'name':_0x29e02c[_0xb501('0x1c')],'resourceId':_0x29e02c['id'],'type':_0x247a07[_0xb501('0x1c')],'sectionId':_0x247a07['id']},{})['then'](function(){return _0x2b8cda;});}else{return _0x2b8cda;}})[_0xb501('0x26')](function(_0x206681){logger['error'](_0xb501('0x39'),_0x206681);throw _0x206681;});}return _0x2b8cda;})['then'](respondWithResult(_0x56fb4e,0xc9))[_0xb501('0x26')](handleError(_0x56fb4e,null));};exports['update']=function(_0x424f6c,_0x2de663){if(_0x424f6c['body']['id']){delete _0x424f6c['body']['id'];}return db['OpenchannelQueue'][_0xb501('0x36')]({'where':{'id':_0x424f6c[_0xb501('0x28')]['id']}})[_0xb501('0x17')](handleEntityNotFound(_0x2de663,null))['then'](saveUpdates(_0x424f6c['body'],null))['then'](respondWithResult(_0x2de663,null))['catch'](handleError(_0x2de663,null));};exports['destroy']=function(_0x2b222f,_0x386c91){return db[_0xb501('0x21')][_0xb501('0x36')]({'where':{'id':_0x2b222f[_0xb501('0x28')]['id']}})[_0xb501('0x17')](handleEntityNotFound(_0x386c91,null))['then'](removeEntity(_0x386c91,null))[_0xb501('0x26')](handleError(_0x386c91,null));};exports[_0xb501('0x3a')]=function(_0x53e96c,_0x470bde){return db['OpenchannelQueue'][_0xb501('0x3a')]()[_0xb501('0x17')](respondWithResult(_0x470bde,null))[_0xb501('0x26')](handleError(_0x470bde,null));};exports[_0xb501('0x3b')]=function(_0x3b61e8,_0x59ee95){var _0x65703c={'raw':!![],'where':{}},_0x20a8e5={},_0x12517c;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x3b61e8[_0xb501('0x28')]['id']}})[_0xb501('0x17')](handleEntityNotFound(_0x59ee95,null))[_0xb501('0x17')](function(_0x37456a){if(_0x37456a){_0x12517c=_0x37456a[_0xb501('0x19')]({'plain':!![]});_0x20a8e5[_0xb501('0x29')]=_[_0xb501('0x2a')](db['UserOpenchannelQueue'][_0xb501('0x3c')]);_0x20a8e5[_0xb501('0x23')]=_[_0xb501('0x2a')](_0x3b61e8['query']);_0x20a8e5[_0xb501('0x3d')]=_[_0xb501('0x2b')](_0x20a8e5[_0xb501('0x29')],_0x20a8e5[_0xb501('0x23')]);_0x65703c[_0xb501('0x2c')]=_[_0xb501('0x2b')](_0x20a8e5['model'],qs[_0xb501('0x2d')](_0x3b61e8['query'][_0xb501('0x2d')]));_0x65703c[_0xb501('0x2c')]=_0x65703c[_0xb501('0x2c')][_0xb501('0x3e')]?_0x65703c[_0xb501('0x2c')]:_0x20a8e5[_0xb501('0x29')];if(!_0x3b61e8[_0xb501('0x23')]['hasOwnProperty'](_0xb501('0x3f'))){_0x65703c[_0xb501('0x12')]=qs[_0xb501('0x12')](_0x3b61e8[_0xb501('0x23')][_0xb501('0x12')]);_0x65703c['offset']=qs[_0xb501('0x11')](_0x3b61e8[_0xb501('0x23')][_0xb501('0x11')]);}_0x65703c[_0xb501('0x40')]=qs[_0xb501('0x41')](_0x3b61e8[_0xb501('0x23')][_0xb501('0x41')]);_0x65703c['where']=qs[_0xb501('0x3d')](_[_0xb501('0x42')](_0x3b61e8[_0xb501('0x23')],_0x20a8e5['filters']));_0x65703c[_0xb501('0x20')]['OpenchannelQueueId']=_0x37456a['id'];if(_0x3b61e8[_0xb501('0x23')][_0xb501('0x43')]){_0x65703c['where']=_[_0xb501('0x2f')](_0x65703c['where'],{'$or':_[_0xb501('0x44')](_0x65703c[_0xb501('0x2c')],function(_0x5a48ee){var _0x21a33f={};_0x21a33f[_0x5a48ee]={'$like':'%'+_0x3b61e8['query'][_0xb501('0x43')]+'%'};return _0x21a33f;})});}_0x65703c=_[_0xb501('0x2f')]({},_0x65703c,_0x3b61e8['options']);return db[_0xb501('0x45')][_0xb501('0x24')](_0x65703c);}})[_0xb501('0x17')](function(_0x3f0ad0){if(_0x3f0ad0){return db['User'][_0xb501('0x46')]({'where':{'id':_[_0xb501('0x44')](_0x3f0ad0,_0xb501('0x47')),'role':_0xb501('0x48')},'attributes':['id','name',_0xb501('0x49'),'updatedAt',_0xb501('0x4a')]});}})['then'](function(_0x32bff7){if(_0x32bff7){return{'count':_0x32bff7[_0xb501('0x13')],'rows':_[_0xb501('0x44')](_0x32bff7['rows'],function(_0x14a7b8){return{'membername':_0x14a7b8[_0xb501('0x1c')],'UserId':_0x14a7b8['id'],'queue_name':_0x12517c['name'],'OpenchannelQueueId':_0x12517c['id'],'interface':util[_0xb501('0x4b')](_0xb501('0x4c'),'SIP',_0x14a7b8[_0xb501('0x1c')]),'penalty':0x0,'paused':_0x14a7b8[_0xb501('0x49')],'createdAt':_0x14a7b8[_0xb501('0x4a')],'updatedAt':_0x14a7b8[_0xb501('0x4d')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb501('0x17')](respondWithFilteredResult(_0x59ee95,_0x65703c))['catch'](handleError(_0x59ee95,null));};exports['getTeams']=function(_0x346e62,_0x4a5295){var _0x517f2e={};var _0x39be2e={};var _0x24c132;var _0x556b29;return db[_0xb501('0x21')][_0xb501('0x4e')]({'where':{'id':_0x346e62[_0xb501('0x28')]['id']}})['then'](handleEntityNotFound(_0x4a5295,null))[_0xb501('0x17')](function(_0x5537ec){if(_0x5537ec){_0x24c132=_0x5537ec;_0x39be2e['model']=_[_0xb501('0x2a')](db[_0xb501('0x4f')]['rawAttributes']);_0x39be2e['query']=_[_0xb501('0x2a')](_0x346e62[_0xb501('0x23')]);_0x39be2e[_0xb501('0x3d')]=_[_0xb501('0x2b')](_0x39be2e[_0xb501('0x29')],_0x39be2e[_0xb501('0x23')]);_0x517f2e[_0xb501('0x2c')]=_[_0xb501('0x2b')](_0x39be2e[_0xb501('0x29')],qs[_0xb501('0x2d')](_0x346e62[_0xb501('0x23')][_0xb501('0x2d')]));_0x517f2e[_0xb501('0x2c')]=_0x517f2e[_0xb501('0x2c')][_0xb501('0x3e')]?_0x517f2e[_0xb501('0x2c')]:_0x39be2e[_0xb501('0x29')];_0x517f2e[_0xb501('0x40')]=qs[_0xb501('0x41')](_0x346e62[_0xb501('0x23')][_0xb501('0x41')]);_0x517f2e['where']=qs['filters'](_[_0xb501('0x42')](_0x346e62[_0xb501('0x23')],_0x39be2e[_0xb501('0x3d')]));if(_0x346e62[_0xb501('0x23')][_0xb501('0x43')]){_0x517f2e[_0xb501('0x20')]=_[_0xb501('0x2f')](_0x517f2e[_0xb501('0x20')],{'$or':_[_0xb501('0x44')](_0x517f2e['attributes'],function(_0x4366e2){var _0x19a72d={};_0x19a72d[_0x4366e2]={'$like':'%'+_0x346e62[_0xb501('0x23')][_0xb501('0x43')]+'%'};return _0x19a72d;})});}_0x517f2e=_[_0xb501('0x2f')]({},_0x517f2e,_0x346e62['options']);return _0x24c132[_0xb501('0x50')](_0x517f2e);}})[_0xb501('0x17')](function(_0x27ca35){if(_0x27ca35){_0x556b29=_0x27ca35[_0xb501('0x3e')];if(!_0x346e62[_0xb501('0x23')][_0xb501('0x51')](_0xb501('0x3f'))){_0x517f2e[_0xb501('0x12')]=qs[_0xb501('0x12')](_0x346e62['query'][_0xb501('0x12')]);_0x517f2e[_0xb501('0x11')]=qs['offset'](_0x346e62[_0xb501('0x23')][_0xb501('0x11')]);}return _0x24c132[_0xb501('0x50')](_0x517f2e);}})[_0xb501('0x17')](function(_0x5a3e87){if(_0x5a3e87){return _0x5a3e87?{'count':_0x556b29,'rows':_0x5a3e87}:null;}})[_0xb501('0x17')](respondWithResult(_0x4a5295,null))[_0xb501('0x26')](handleError(_0x4a5295,null));};exports[_0xb501('0x52')]=function(_0x5d3bd4,_0x241f7c){var _0x2cd941=_0x5d3bd4[_0xb501('0x30')]['ids'];return db[_0xb501('0x4f')][_0xb501('0x24')]({'where':{'id':_0x2cd941},'attributes':['id'],'include':[{'model':db[_0xb501('0x53')],'as':'Agents','attributes':['id',_0xb501('0x1c'),_0xb501('0x54'),_0xb501('0x55'),_0xb501('0x56')],'raw':!![]}]})[_0xb501('0x17')](function(_0x44822d){if(_0x44822d){var _0x1e8822=_[_0xb501('0x57')](_0x44822d,function(_0x427ab1){var _0x372860=_0x427ab1[_0xb501('0x19')]({'plain':!![]});return _0x372860[_0xb501('0x58')];});return db['OpenchannelQueue'][_0xb501('0x36')]({'where':{'id':_0x5d3bd4[_0xb501('0x28')]['id']}})[_0xb501('0x17')](function(_0x525852){return db[_0xb501('0x59')][_0xb501('0x5a')](function(_0x4f6b0d){return _0x525852['addTeams'](_0x2cd941,{'transaction':_0x4f6b0d})['then'](function(){return BPromise[_0xb501('0x5b')](_0x1e8822,function(_0x20b402){return db[_0xb501('0x45')]['findOrCreate']({'where':{'UserId':_0x20b402['id'],'OpenchannelQueueId':_0x5d3bd4[_0xb501('0x28')]['id']},'transaction':_0x4f6b0d});});})[_0xb501('0x17')](function(){_0x1e8822[_0xb501('0x5c')](function(_0x427c7a){socket[_0xb501('0x5d')](_0xb501('0x5e'),{'UserId':_0x427c7a['id'],'OpenchannelQueueId':_0x525852['id']});});});});});}})['then'](respondWithStatusCode(_0x241f7c,null))['catch'](handleError(_0x241f7c,null));};exports[_0xb501('0x5f')]=function(_0x32ea8a,_0x8773c7){return db[_0xb501('0x4f')][_0xb501('0x24')]({'where':{'id':_0x32ea8a[_0xb501('0x23')][_0xb501('0x60')]},'attributes':['id'],'include':[{'model':db[_0xb501('0x53')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x8773c7,null))[_0xb501('0x17')](function(_0x4cb667){var _0x3f4fe8=_[_0xb501('0x44')](_0x4cb667,'id');var _0x4b14f3=[];var _0x265ed5=[];var _0x307650=squel['select']();_0x307650[_0xb501('0x61')]('tq.TeamId')[_0xb501('0x62')]('team_has_openchannel_queues','tq')[_0xb501('0x63')](_0xb501('0x64'),'ut',_0xb501('0x65'))[_0xb501('0x20')](_0xb501('0x66'),_0x32ea8a[_0xb501('0x28')]['id']);for(var _0x3f7694=0x0;_0x3f7694<_0x4cb667[_0xb501('0x3e')];_0x3f7694+=0x1){let _0x132894=_0x4cb667[_0x3f7694];for(var _0xa84e6a=0x0;_0xa84e6a<_0x132894['Agents']['length'];_0xa84e6a+=0x1){let _0xecfa16=_0x132894[_0xb501('0x58')][_0xa84e6a];var _0x1110d0=_0x307650['clone']();_0x1110d0[_0xb501('0x20')](_0xb501('0x67'),_0xecfa16['id']);_0x265ed5[_0xb501('0x68')](db['sequelize'][_0xb501('0x23')](_0x1110d0[_0xb501('0x69')](),{'type':db[_0xb501('0x59')]['QueryTypes'][_0xb501('0x6a')]})[_0xb501('0x17')](function(_0x2b7182){if(_0x2b7182['length']===0x1){return _0xecfa16['id'];}else{var _0x58d240=_[_0xb501('0x6b')](_[_0xb501('0x44')](_0x2b7182,_0xb501('0x6c')),function(_0x311af3){return _[_0xb501('0x6d')](_0x3f4fe8,_0x311af3);});if(_0x58d240){return _0xecfa16['id'];}}}));}}return BPromise[_0xb501('0x6e')](_0x265ed5)['then'](function(_0x39c81c){_0x4b14f3=_(_0x4b14f3)['union'](_0x39c81c)[_0xb501('0x6f')]()['value']();return db[_0xb501('0x21')]['find']({'where':{'id':_0x32ea8a['params']['id']}})[_0xb501('0x17')](function(_0x497be6){return db[_0xb501('0x59')][_0xb501('0x5a')](function(_0xb8fc2){return _0x497be6[_0xb501('0x5f')](_0x32ea8a[_0xb501('0x23')][_0xb501('0x60')],{'transaction':_0xb8fc2})[_0xb501('0x17')](function(){if(!_[_0xb501('0x70')](_0x4b14f3)){return _0x497be6[_0xb501('0x71')](_0x4b14f3,{'transaction':_0xb8fc2});}})[_0xb501('0x17')](function(){_0x4b14f3['forEach'](function(_0x2dd44b){socket[_0xb501('0x5d')]('userOpenchannelQueue:remove',{'UserId':_0x2dd44b,'OpenchannelQueueId':_0x497be6['id']});});});});});});})[_0xb501('0x17')](respondWithStatusCode(_0x8773c7,null))[_0xb501('0x26')](handleError(_0x8773c7,null));};exports['addAgents']=function(_0x590622,_0x1ea814){return db[_0xb501('0x21')][_0xb501('0x36')]({'where':{'id':_0x590622[_0xb501('0x28')]['id']}})[_0xb501('0x17')](handleEntityNotFound(_0x1ea814,null))[_0xb501('0x17')](function(_0x2df026){if(_0x2df026){return _0x2df026[_0xb501('0x72')](_0x590622['body']['ids'],_[_0xb501('0x73')](_0x590622[_0xb501('0x30')],[_0xb501('0x60'),'id'])||{})[_0xb501('0x74')](function(_0x14227f){for(var _0x46c0ca=0x0;_0x46c0ca<_0x590622[_0xb501('0x30')][_0xb501('0x60')][_0xb501('0x3e')];_0x46c0ca+=0x1){socket[_0xb501('0x5d')](_0xb501('0x5e'),{'UserId':Number(_0x590622[_0xb501('0x30')][_0xb501('0x60')][_0x46c0ca]),'OpenchannelQueueId':Number(_0x590622[_0xb501('0x28')]['id'])});}return _0x14227f;});}})[_0xb501('0x17')](respondWithResult(_0x1ea814,null))[_0xb501('0x26')](handleError(_0x1ea814,null));};exports[_0xb501('0x71')]=function(_0x4e6f95,_0x273a06){return db[_0xb501('0x21')][_0xb501('0x36')]({'where':{'id':_0x4e6f95[_0xb501('0x28')]['id']}})['then'](handleEntityNotFound(_0x273a06,null))[_0xb501('0x17')](function(_0x2a2875){if(_0x2a2875){return _0x2a2875[_0xb501('0x71')](_0x4e6f95[_0xb501('0x23')][_0xb501('0x60')])[_0xb501('0x17')](function(){if(_[_0xb501('0x75')](_0x4e6f95[_0xb501('0x23')]['ids'])){for(var _0xbbba94=0x0;_0xbbba94<_0x4e6f95[_0xb501('0x23')][_0xb501('0x60')][_0xb501('0x3e')];_0xbbba94+=0x1){socket[_0xb501('0x5d')](_0xb501('0x76'),{'UserId':Number(_0x4e6f95[_0xb501('0x23')][_0xb501('0x60')][_0xbbba94]),'OpenchannelQueueId':Number(_0x4e6f95[_0xb501('0x28')]['id'])});}}else{socket[_0xb501('0x5d')](_0xb501('0x76'),{'UserId':Number(_0x4e6f95[_0xb501('0x23')][_0xb501('0x60')]),'OpenchannelQueueId':Number(_0x4e6f95['params']['id'])});}});}})[_0xb501('0x17')](respondWithStatusCode(_0x273a06,null))[_0xb501('0x26')](handleError(_0x273a06,null));};exports[_0xb501('0x77')]=function(_0x50e51b,_0x164388){var _0x5e95a1={};var _0x5e3509={};var _0x482fc5;var _0x3269b0;return db[_0xb501('0x21')][_0xb501('0x4e')]({'where':{'id':_0x50e51b[_0xb501('0x28')]['id']}})[_0xb501('0x17')](handleEntityNotFound(_0x164388,null))[_0xb501('0x17')](function(_0x340d29){if(_0x340d29){_0x482fc5=_0x340d29;_0x5e3509[_0xb501('0x29')]=_['keys'](db['User']['rawAttributes']);_0x5e3509[_0xb501('0x23')]=_['keys'](_0x50e51b[_0xb501('0x23')]);_0x5e3509[_0xb501('0x3d')]=_['intersection'](_0x5e3509[_0xb501('0x29')],_0x5e3509['query']);_0x5e95a1[_0xb501('0x2c')]=_['intersection'](_0x5e3509[_0xb501('0x29')],qs[_0xb501('0x2d')](_0x50e51b[_0xb501('0x23')]['fields']));_0x5e95a1[_0xb501('0x2c')]=_0x5e95a1['attributes'][_0xb501('0x3e')]?_0x5e95a1[_0xb501('0x2c')]:_0x5e3509['model'];_0x5e95a1['order']=qs['sort'](_0x50e51b['query'][_0xb501('0x41')]);_0x5e95a1[_0xb501('0x20')]=qs[_0xb501('0x3d')](_[_0xb501('0x42')](_0x50e51b['query'],_0x5e3509[_0xb501('0x3d')]));if(_0x50e51b[_0xb501('0x23')][_0xb501('0x43')]){_0x5e95a1[_0xb501('0x20')]=_[_0xb501('0x2f')](_0x5e95a1[_0xb501('0x20')],{'$or':_[_0xb501('0x44')](_0x5e95a1[_0xb501('0x2c')],function(_0x2ffd3f){var _0x4b0287={};_0x4b0287[_0x2ffd3f]={'$like':'%'+_0x50e51b[_0xb501('0x23')][_0xb501('0x43')]+'%'};return _0x4b0287;})});}_0x5e95a1=_['merge']({},_0x5e95a1,_0x50e51b[_0xb501('0x78')]);return _0x482fc5[_0xb501('0x77')](_0x5e95a1);}})[_0xb501('0x17')](function(_0x3e6c13){if(_0x3e6c13){_0x3269b0=_0x3e6c13[_0xb501('0x3e')];if(!_0x50e51b[_0xb501('0x23')][_0xb501('0x51')](_0xb501('0x3f'))){_0x5e95a1[_0xb501('0x12')]=qs['limit'](_0x50e51b['query'][_0xb501('0x12')]);_0x5e95a1[_0xb501('0x11')]=qs[_0xb501('0x11')](_0x50e51b[_0xb501('0x23')]['offset']);}return _0x482fc5[_0xb501('0x77')](_0x5e95a1);}})[_0xb501('0x17')](function(_0x332f7f){if(_0x332f7f){return _0x332f7f?{'count':_0x3269b0,'rows':_0x332f7f}:null;}})[_0xb501('0x17')](respondWithResult(_0x164388,null))['catch'](handleError(_0x164388,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 19e0461..99e5414 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 _0x55ea=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x55ea,0x1df));var _0xa55e=function(_0x365c91,_0xc944b4){_0x365c91=_0x365c91-0x0;var _0x4231ab=_0x55ea[_0x365c91];return _0x4231ab;};'use strict';var EventEmitter=require(_0xa55e('0x0'));var OpenchannelQueue=require(_0xa55e('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xa55e('0x2')](0x0);var events={'afterCreate':_0xa55e('0x3'),'afterUpdate':_0xa55e('0x4'),'afterDestroy':'remove'};function emitEvent(_0x51d30b){return function(_0x2cc477,_0x5f19ee,_0x4a7544){OpenchannelQueueEvents[_0xa55e('0x5')](_0x51d30b+':'+_0x2cc477['id'],_0x2cc477);OpenchannelQueueEvents['emit'](_0x51d30b,_0x2cc477);_0x4a7544(null);};}for(var e in events){if(events[_0xa55e('0x6')](e)){var event=events[e];OpenchannelQueue[_0xa55e('0x7')](e,emitEvent(event));}}module[_0xa55e('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x91fd=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x250858,_0x4381dc){var _0x4ba9f8=function(_0x163a37){while(--_0x163a37){_0x250858['push'](_0x250858['shift']());}};_0x4ba9f8(++_0x4381dc);}(_0x91fd,0x16d));var _0xd91f=function(_0x4ff186,_0x21e242){_0x4ff186=_0x4ff186-0x0;var _0x1aeade=_0x91fd[_0x4ff186];return _0x1aeade;};'use strict';var EventEmitter=require(_0xd91f('0x0'));var OpenchannelQueue=require(_0xd91f('0x1'))['db'][_0xd91f('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd91f('0x3'),'afterUpdate':'update','afterDestroy':_0xd91f('0x4')};function emitEvent(_0x305091){return function(_0x33e9ab,_0x15b9ff,_0x11b1b7){OpenchannelQueueEvents[_0xd91f('0x5')](_0x305091+':'+_0x33e9ab['id'],_0x33e9ab);OpenchannelQueueEvents['emit'](_0x305091,_0x33e9ab);_0x11b1b7(null);};}for(var e in events){if(events[_0xd91f('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xd91f('0x7')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 1f0f517..18e2d99 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 _0xdff3=['util','moment','bluebird','path','rimraf','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0xdff3,0x90));var _0x3dff=function(_0x3cec36,_0x34a66d){_0x3cec36=_0x3cec36-0x0;var _0x199d65=_0xdff3[_0x3cec36];return _0x199d65;};'use strict';var _=require('lodash');var util=require(_0x3dff('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3dff('0x1'));var BPromise=require(_0x3dff('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3dff('0x3'));var rimraf=require(_0x3dff('0x4'));var config=require('../../config/environment');var attributes=require(_0x3dff('0x5'));module[_0x3dff('0x6')]=function(_0x2192c6,_0x4917c2){return _0x2192c6[_0x3dff('0x7')]('OpenchannelQueue',attributes,{'tableName':_0x3dff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x148f=['lodash','util','../../config/logger','request-promise','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x148f,0xbb));var _0xf148=function(_0x531b7f,_0x589660){_0x531b7f=_0x531b7f-0x0;var _0x52ecf8=_0x148f[_0x531b7f];return _0x52ecf8;};'use strict';var _=require(_0xf148('0x0'));var util=require(_0xf148('0x1'));var logger=require(_0xf148('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf148('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf148('0x4'));var config=require(_0xf148('0x5'));var attributes=require(_0xf148('0x6'));module[_0xf148('0x7')]=function(_0x5a1f94,_0x3e01cb){return _0x5a1f94[_0xf148('0x8')](_0xf148('0x9'),attributes,{'tableName':_0xf148('0xa'),'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 1c49bb9..17285e7 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 _0x5f94=['map','model','then','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','options','raw','attributes','limit','include'];(function(_0xf7ad0,_0x4558db){var _0x73ec5c=function(_0x1003f9){while(--_0x1003f9){_0xf7ad0['push'](_0xf7ad0['shift']());}};_0x73ec5c(++_0x4558db);}(_0x5f94,0x18d));var _0x45f9=function(_0x3c1398,_0x37ca74){_0x3c1398=_0x3c1398-0x0;var _0x49d30b=_0x5f94[_0x3c1398];return _0x49d30b;};'use strict';var _=require(_0x45f9('0x0'));var util=require('util');var moment=require(_0x45f9('0x1'));var BPromise=require(_0x45f9('0x2'));var rs=require(_0x45f9('0x3'));var fs=require('fs');var Redis=require(_0x45f9('0x4'));var db=require(_0x45f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x45f9('0x6'))(_0x45f9('0x7'));var config=require(_0x45f9('0x8'));var jayson=require(_0x45f9('0x9'));var client=jayson[_0x45f9('0xa')][_0x45f9('0xb')]({'port':0x232a});config[_0x45f9('0xc')]=_[_0x45f9('0xd')](config[_0x45f9('0xc')],{'host':_0x45f9('0xe'),'port':0x18eb});var socket=require(_0x45f9('0xf'))(new Redis(config[_0x45f9('0xc')]));require(_0x45f9('0x10'))['register'](socket);function respondWithRpcPromise(_0x4d7c6d,_0x530713,_0x41c622){return new BPromise(function(_0x3d527a,_0xcae866){return client[_0x45f9('0x11')](_0x4d7c6d,_0x41c622)['then'](function(_0x205cb0){logger[_0x45f9('0x12')](_0x45f9('0x13'),_0x530713,'request\x20sent');logger[_0x45f9('0x14')](_0x45f9('0x15'),_0x530713,'request\x20sent',JSON['stringify'](_0x205cb0));if(_0x205cb0[_0x45f9('0x16')]){if(_0x205cb0[_0x45f9('0x16')][_0x45f9('0x17')]===0x1f4){logger[_0x45f9('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x530713,_0x205cb0[_0x45f9('0x16')][_0x45f9('0x18')]);return _0xcae866(_0x205cb0['error'][_0x45f9('0x18')]);}logger[_0x45f9('0x16')](_0x45f9('0x13'),_0x530713,_0x205cb0[_0x45f9('0x16')][_0x45f9('0x18')]);return _0x3d527a(_0x205cb0['error'][_0x45f9('0x18')]);}else{logger[_0x45f9('0x12')]('OpenchannelQueue,\x20%s,\x20%s',_0x530713,_0x45f9('0x19'));_0x3d527a(_0x205cb0['result'][_0x45f9('0x18')]);}})[_0x45f9('0x1a')](function(_0x3acdfe){logger[_0x45f9('0x16')](_0x45f9('0x13'),_0x530713,_0x3acdfe);_0xcae866(_0x3acdfe);});});}exports['GetOpenchannelQueue']=function(_0x150d51){var _0x4078d5=this;return new Promise(function(_0x5cf42d,_0x2a5a7f){return db['OpenchannelQueue']['findAll']({'raw':_0x150d51[_0x45f9('0x1b')]?_0x150d51[_0x45f9('0x1b')][_0x45f9('0x1c')]===undefined?!![]:![]:!![],'where':_0x150d51[_0x45f9('0x1b')]?_0x150d51['options']['where']||null:null,'attributes':_0x150d51[_0x45f9('0x1b')]?_0x150d51[_0x45f9('0x1b')][_0x45f9('0x1d')]||null:null,'limit':_0x150d51[_0x45f9('0x1b')]?_0x150d51[_0x45f9('0x1b')][_0x45f9('0x1e')]||null:null,'include':_0x150d51['options']?_0x150d51[_0x45f9('0x1b')][_0x45f9('0x1f')]?_[_0x45f9('0x20')](_0x150d51[_0x45f9('0x1b')][_0x45f9('0x1f')],function(_0x494e78){return{'model':db[_0x494e78[_0x45f9('0x21')]],'as':_0x494e78['as'],'attributes':_0x494e78[_0x45f9('0x1d')],'include':_0x494e78[_0x45f9('0x1f')]?_[_0x45f9('0x20')](_0x494e78[_0x45f9('0x1f')],function(_0x37740d){return{'model':db[_0x37740d[_0x45f9('0x21')]],'as':_0x37740d['as'],'attributes':_0x37740d['attributes'],'include':_0x37740d[_0x45f9('0x1f')]?_[_0x45f9('0x20')](_0x37740d[_0x45f9('0x1f')],function(_0x5002d1){return{'model':db[_0x5002d1[_0x45f9('0x21')]],'as':_0x5002d1['as'],'attributes':_0x5002d1[_0x45f9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x45f9('0x22')](function(_0x2f56c8){logger['info']('GetOpenchannelQueue',_0x150d51);logger['debug'](_0x45f9('0x23'),_0x150d51,JSON[_0x45f9('0x24')](_0x2f56c8));_0x5cf42d(_0x2f56c8);})[_0x45f9('0x1a')](function(_0x154a3d){logger[_0x45f9('0x16')]('GetOpenchannelQueue',_0x154a3d[_0x45f9('0x18')],_0x150d51);_0x2a5a7f(_0x4078d5[_0x45f9('0x16')](0x1f4,_0x154a3d[_0x45f9('0x18')]));});});};exports[_0x45f9('0x25')]=function(_0x505d7a){var _0x38e22d=this;return new Promise(function(_0x22182,_0x96f7df){return db['OpenchannelQueue'][_0x45f9('0x26')]({'raw':_0x505d7a[_0x45f9('0x1b')]?_0x505d7a[_0x45f9('0x1b')][_0x45f9('0x1c')]===undefined?!![]:![]:!![],'where':_0x505d7a[_0x45f9('0x1b')]?_0x505d7a['options']['where']||null:null,'attributes':_0x505d7a['options']?_0x505d7a['options'][_0x45f9('0x1d')]||null:null,'include':_0x505d7a[_0x45f9('0x1b')]?_0x505d7a[_0x45f9('0x1b')][_0x45f9('0x1f')]?_['map'](_0x505d7a[_0x45f9('0x1b')][_0x45f9('0x1f')],function(_0x5483d0){return{'model':db[_0x5483d0[_0x45f9('0x21')]],'as':_0x5483d0['as'],'attributes':_0x5483d0[_0x45f9('0x1d')],'include':_0x5483d0[_0x45f9('0x1f')]?_[_0x45f9('0x20')](_0x5483d0[_0x45f9('0x1f')],function(_0x4a14c7){return{'model':db[_0x4a14c7[_0x45f9('0x21')]],'as':_0x4a14c7['as'],'attributes':_0x4a14c7[_0x45f9('0x1d')],'include':_0x4a14c7[_0x45f9('0x1f')]?_[_0x45f9('0x20')](_0x4a14c7['include'],function(_0x457eca){return{'model':db[_0x457eca[_0x45f9('0x21')]],'as':_0x457eca['as'],'attributes':_0x457eca[_0x45f9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x45f9('0x22')](function(_0x20364a){logger['info']('ShowOpenchannelQueue',_0x505d7a);logger['debug'](_0x45f9('0x25'),_0x505d7a,JSON[_0x45f9('0x24')](_0x20364a));_0x22182(_0x20364a);})[_0x45f9('0x1a')](function(_0x187df4){logger[_0x45f9('0x16')](_0x45f9('0x25'),_0x187df4[_0x45f9('0x18')],_0x505d7a);_0x96f7df(_0x38e22d[_0x45f9('0x16')](0x1f4,_0x187df4['message']));});});}; \ No newline at end of file +var _0x0a1f=['stringify','error','code','message','info','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','include','model','map','then','ShowOpenchannelQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','./openchannelQueue.socket','register','request','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x395a03,_0x362943){var _0x8de6f=function(_0x56ae29){while(--_0x56ae29){_0x395a03['push'](_0x395a03['shift']());}};_0x8de6f(++_0x362943);}(_0x0a1f,0x184));var _0xf0a1=function(_0x5896d8,_0x1ac7a4){_0x5896d8=_0x5896d8-0x0;var _0x524d15=_0x0a1f[_0x5896d8];return _0x524d15;};'use strict';var _=require(_0xf0a1('0x0'));var util=require(_0xf0a1('0x1'));var moment=require(_0xf0a1('0x2'));var BPromise=require(_0xf0a1('0x3'));var rs=require(_0xf0a1('0x4'));var fs=require('fs');var Redis=require(_0xf0a1('0x5'));var db=require(_0xf0a1('0x6'))['db'];var utils=require(_0xf0a1('0x7'));var logger=require(_0xf0a1('0x8'))(_0xf0a1('0x9'));var config=require(_0xf0a1('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf0a1('0xb')][_0xf0a1('0xc')]({'port':0x232a});config['redis']=_[_0xf0a1('0xd')](config['redis'],{'host':_0xf0a1('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf0a1('0xf'))[_0xf0a1('0x10')](socket);function respondWithRpcPromise(_0x13aa64,_0x567ce3,_0x407a6b){return new BPromise(function(_0x2ea328,_0x1c1292){return client[_0xf0a1('0x11')](_0x13aa64,_0x407a6b)['then'](function(_0x30923a){logger['info'](_0xf0a1('0x12'),_0x567ce3,_0xf0a1('0x13'));logger[_0xf0a1('0x14')](_0xf0a1('0x15'),_0x567ce3,'request\x20sent',JSON[_0xf0a1('0x16')](_0x30923a));if(_0x30923a['error']){if(_0x30923a[_0xf0a1('0x17')][_0xf0a1('0x18')]===0x1f4){logger[_0xf0a1('0x17')](_0xf0a1('0x12'),_0x567ce3,_0x30923a[_0xf0a1('0x17')][_0xf0a1('0x19')]);return _0x1c1292(_0x30923a[_0xf0a1('0x17')][_0xf0a1('0x19')]);}logger[_0xf0a1('0x17')](_0xf0a1('0x12'),_0x567ce3,_0x30923a[_0xf0a1('0x17')][_0xf0a1('0x19')]);return _0x2ea328(_0x30923a[_0xf0a1('0x17')][_0xf0a1('0x19')]);}else{logger[_0xf0a1('0x1a')]('OpenchannelQueue,\x20%s,\x20%s',_0x567ce3,'request\x20sent');_0x2ea328(_0x30923a[_0xf0a1('0x1b')][_0xf0a1('0x19')]);}})[_0xf0a1('0x1c')](function(_0x53dfd2){logger[_0xf0a1('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x567ce3,_0x53dfd2);_0x1c1292(_0x53dfd2);});});}exports[_0xf0a1('0x1d')]=function(_0x5c3692){var _0x4e155e=this;return new Promise(function(_0x4c32a3,_0x466a95){return db[_0xf0a1('0x1e')][_0xf0a1('0x1f')]({'raw':_0x5c3692[_0xf0a1('0x20')]?_0x5c3692['options'][_0xf0a1('0x21')]===undefined?!![]:![]:!![],'where':_0x5c3692['options']?_0x5c3692[_0xf0a1('0x20')]['where']||null:null,'attributes':_0x5c3692['options']?_0x5c3692['options'][_0xf0a1('0x22')]||null:null,'limit':_0x5c3692[_0xf0a1('0x20')]?_0x5c3692[_0xf0a1('0x20')]['limit']||null:null,'include':_0x5c3692['options']?_0x5c3692['options'][_0xf0a1('0x23')]?_['map'](_0x5c3692[_0xf0a1('0x20')]['include'],function(_0x521d85){return{'model':db[_0x521d85[_0xf0a1('0x24')]],'as':_0x521d85['as'],'attributes':_0x521d85[_0xf0a1('0x22')],'include':_0x521d85[_0xf0a1('0x23')]?_[_0xf0a1('0x25')](_0x521d85['include'],function(_0x38f1d7){return{'model':db[_0x38f1d7[_0xf0a1('0x24')]],'as':_0x38f1d7['as'],'attributes':_0x38f1d7[_0xf0a1('0x22')],'include':_0x38f1d7[_0xf0a1('0x23')]?_[_0xf0a1('0x25')](_0x38f1d7['include'],function(_0x13fd2a){return{'model':db[_0x13fd2a['model']],'as':_0x13fd2a['as'],'attributes':_0x13fd2a[_0xf0a1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf0a1('0x26')](function(_0x2558c4){logger[_0xf0a1('0x1a')](_0xf0a1('0x1d'),_0x5c3692);logger['debug'](_0xf0a1('0x1d'),_0x5c3692,JSON[_0xf0a1('0x16')](_0x2558c4));_0x4c32a3(_0x2558c4);})[_0xf0a1('0x1c')](function(_0x2d257f){logger[_0xf0a1('0x17')]('GetOpenchannelQueue',_0x2d257f[_0xf0a1('0x19')],_0x5c3692);_0x466a95(_0x4e155e['error'](0x1f4,_0x2d257f[_0xf0a1('0x19')]));});});};exports[_0xf0a1('0x27')]=function(_0x3cd654){var _0xce1fbd=this;return new Promise(function(_0x24053c,_0x55b2ec){return db[_0xf0a1('0x1e')][_0xf0a1('0x28')]({'raw':_0x3cd654[_0xf0a1('0x20')]?_0x3cd654['options'][_0xf0a1('0x21')]===undefined?!![]:![]:!![],'where':_0x3cd654[_0xf0a1('0x20')]?_0x3cd654[_0xf0a1('0x20')]['where']||null:null,'attributes':_0x3cd654[_0xf0a1('0x20')]?_0x3cd654[_0xf0a1('0x20')][_0xf0a1('0x22')]||null:null,'include':_0x3cd654[_0xf0a1('0x20')]?_0x3cd654[_0xf0a1('0x20')][_0xf0a1('0x23')]?_[_0xf0a1('0x25')](_0x3cd654[_0xf0a1('0x20')]['include'],function(_0x5e2535){return{'model':db[_0x5e2535[_0xf0a1('0x24')]],'as':_0x5e2535['as'],'attributes':_0x5e2535['attributes'],'include':_0x5e2535[_0xf0a1('0x23')]?_[_0xf0a1('0x25')](_0x5e2535[_0xf0a1('0x23')],function(_0x697a8){return{'model':db[_0x697a8[_0xf0a1('0x24')]],'as':_0x697a8['as'],'attributes':_0x697a8[_0xf0a1('0x22')],'include':_0x697a8['include']?_[_0xf0a1('0x25')](_0x697a8[_0xf0a1('0x23')],function(_0x17b047){return{'model':db[_0x17b047[_0xf0a1('0x24')]],'as':_0x17b047['as'],'attributes':_0x17b047[_0xf0a1('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf0a1('0x26')](function(_0x4b4bfb){logger['info'](_0xf0a1('0x27'),_0x3cd654);logger['debug'](_0xf0a1('0x27'),_0x3cd654,JSON['stringify'](_0x4b4bfb));_0x24053c(_0x4b4bfb);})[_0xf0a1('0x1c')](function(_0x22bccf){logger[_0xf0a1('0x17')](_0xf0a1('0x27'),_0x22bccf['message'],_0x3cd654);_0x55b2ec(_0xce1fbd[_0xf0a1('0x17')](0x1f4,_0x22bccf[_0xf0a1('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 4a2f2f7..934b9d5 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 _0x873a=['removeListener','length','openchannelQueue:','./openchannelQueue.events','save','remove','emit'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x873a,0xb9));var _0xa873=function(_0x11d91b,_0x21488b){_0x11d91b=_0x11d91b-0x0;var _0x48825e=_0x873a[_0x11d91b];return _0x48825e;};'use strict';var OpenchannelQueueEvents=require(_0xa873('0x0'));var events=[_0xa873('0x1'),_0xa873('0x2'),'update'];function createListener(_0x8ea544,_0xf813f5){return function(_0xa2a624){_0xf813f5[_0xa873('0x3')](_0x8ea544,_0xa2a624);};}function removeListener(_0xee86a0,_0x26f310){return function(){OpenchannelQueueEvents[_0xa873('0x4')](_0xee86a0,_0x26f310);};}exports['register']=function(_0xdcba16){for(var _0x1c0a5e=0x0,_0x24dfed=events[_0xa873('0x5')];_0x1c0a5e<_0x24dfed;_0x1c0a5e++){var _0x487878=events[_0x1c0a5e];var _0x450cd2=createListener(_0xa873('0x6')+_0x487878,_0xdcba16);OpenchannelQueueEvents['on'](_0x487878,_0x450cd2);}}; \ No newline at end of file +var _0x56e3=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save','update','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x56e3,0x1d4));var _0x356e=function(_0x55fa3d,_0x104c3b){_0x55fa3d=_0x55fa3d-0x0;var _0x51e971=_0x56e3[_0x55fa3d];return _0x51e971;};'use strict';var OpenchannelQueueEvents=require(_0x356e('0x0'));var events=[_0x356e('0x1'),'remove',_0x356e('0x2')];function createListener(_0x2953ac,_0x4ba21e){return function(_0x14f929){_0x4ba21e[_0x356e('0x3')](_0x2953ac,_0x14f929);};}function removeListener(_0x3cb053,_0x2a489f){return function(){OpenchannelQueueEvents[_0x356e('0x4')](_0x3cb053,_0x2a489f);};}exports[_0x356e('0x5')]=function(_0x139b8e){for(var _0x369148=0x0,_0xaccb72=events[_0x356e('0x6')];_0x369148<_0xaccb72;_0x369148++){var _0x4bca9c=events[_0x369148];var _0x5e33a4=createListener(_0x356e('0x7')+_0x4bca9c,_0x139b8e);OpenchannelQueueEvents['on'](_0x4bca9c,_0x5e33a4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 0a2b407..5629a37 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 _0xadf4=['/:id','post','create','put','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','./openchannelQueueReport.controller','get','isAuthenticated','index','describe'];(function(_0x20c6a7,_0x33b011){var _0x20438f=function(_0x1978f4){while(--_0x1978f4){_0x20c6a7['push'](_0x20c6a7['shift']());}};_0x20438f(++_0x33b011);}(_0xadf4,0x106));var _0x4adf=function(_0x5dee2a,_0x47d02a){_0x5dee2a=_0x5dee2a-0x0;var _0x31e98e=_0xadf4[_0x5dee2a];return _0x31e98e;};'use strict';var multer=require('multer');var util=require(_0x4adf('0x0'));var path=require(_0x4adf('0x1'));var timeout=require(_0x4adf('0x2'));var express=require(_0x4adf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4adf('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4adf('0x5'));router[_0x4adf('0x6')]('/',auth[_0x4adf('0x7')](),controller[_0x4adf('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x4adf('0x9')]);router['get'](_0x4adf('0xa'),auth[_0x4adf('0x7')](),controller['show']);router[_0x4adf('0xb')]('/',auth['isAuthenticated'](),controller[_0x4adf('0xc')]);router[_0x4adf('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4adf('0xe')](_0x4adf('0xa'),auth[_0x4adf('0x7')](),controller[_0x4adf('0xf')]);module['exports']=router; \ No newline at end of file +var _0x5007=['show','post','create','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x5007,0x1be));var _0x7500=function(_0x3336ea,_0x4d2ce4){_0x3336ea=_0x3336ea-0x0;var _0x3676d=_0x5007[_0x3336ea];return _0x3676d;};'use strict';var multer=require(_0x7500('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7500('0x1'));var express=require(_0x7500('0x2'));var router=express[_0x7500('0x3')]();var fs_extra=require(_0x7500('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7500('0x5'));var config=require(_0x7500('0x6'));var controller=require(_0x7500('0x7'));router[_0x7500('0x8')]('/',auth['isAuthenticated'](),controller[_0x7500('0x9')]);router[_0x7500('0x8')](_0x7500('0xa'),auth[_0x7500('0xb')](),controller[_0x7500('0xc')]);router[_0x7500('0x8')](_0x7500('0xd'),auth[_0x7500('0xb')](),controller[_0x7500('0xe')]);router[_0x7500('0xf')]('/',auth[_0x7500('0xb')](),controller[_0x7500('0x10')]);router['put']('/:id',auth[_0x7500('0xb')](),controller['update']);router[_0x7500('0x11')](_0x7500('0xd'),auth[_0x7500('0xb')](),controller[_0x7500('0x12')]);module[_0x7500('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 0ebba52..750a234 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 _0x7499=['STRING','DATE','moment','sequelize'];(function(_0xc3398d,_0x301371){var _0x2abb0f=function(_0x2fcacd){while(--_0x2fcacd){_0xc3398d['push'](_0xc3398d['shift']());}};_0x2abb0f(++_0x301371);}(_0x7499,0x162));var _0x9749=function(_0x1fb4a0,_0x48a602){_0x1fb4a0=_0x1fb4a0-0x0;var _0x1094e7=_0x7499[_0x1fb4a0];return _0x1094e7;};'use strict';var moment=require(_0x9749('0x0'));var Sequelize=require(_0x9749('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x9749('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9749('0x2')]},'joinAt':{'type':Sequelize[_0x9749('0x3')]},'leaveAt':{'type':Sequelize[_0x9749('0x3')]},'acceptAt':{'type':Sequelize[_0x9749('0x3')]},'exitAt':{'type':Sequelize[_0x9749('0x3')]},'reason':{'type':Sequelize[_0x9749('0x2')]}}; \ No newline at end of file +var _0xa573=['exports','STRING','DATE','moment','sequelize'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa573,0x12f));var _0x3a57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa573[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x3a57('0x0'));var Sequelize=require(_0x3a57('0x1'));module[_0x3a57('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x3a57('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x3a57('0x4')]},'acceptAt':{'type':Sequelize[_0x3a57('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x3a57('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 2459257..d30e381 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 _0x56d1=['offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','error','stack','name','map','OpenchannelQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x39bd3f,_0x45b058){var _0x5ce625=function(_0x127975){while(--_0x127975){_0x39bd3f['push'](_0x39bd3f['shift']());}};_0x5ce625(++_0x45b058);}(_0x56d1,0x114));var _0x156d=function(_0x332998,_0x2d99c7){_0x332998=_0x332998-0x0;var _0x460be7=_0x56d1[_0x332998];return _0x460be7;};'use strict';var emlformat=require(_0x156d('0x0'));var rimraf=require(_0x156d('0x1'));var zipdir=require(_0x156d('0x2'));var jsonpatch=require(_0x156d('0x3'));var rp=require(_0x156d('0x4'));var moment=require('moment');var BPromise=require(_0x156d('0x5'));var Mustache=require(_0x156d('0x6'));var util=require(_0x156d('0x7'));var path=require(_0x156d('0x8'));var sox=require(_0x156d('0x9'));var csv=require(_0x156d('0xa'));var ejs=require(_0x156d('0xb'));var fs=require('fs');var fs_extra=require(_0x156d('0xc'));var _=require(_0x156d('0xd'));var squel=require(_0x156d('0xe'));var crypto=require(_0x156d('0xf'));var jsforce=require(_0x156d('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x156d('0x11'));var Papa=require(_0x156d('0x12'));var Redis=require(_0x156d('0x13'));var authService=require(_0x156d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x156d('0x15'));var hardwareService=require(_0x156d('0x16'));var logger=require(_0x156d('0x17'))(_0x156d('0x18'));var utils=require(_0x156d('0x19'));var config=require(_0x156d('0x1a'));var licenseUtil=require(_0x156d('0x1b'));var db=require(_0x156d('0x1c'))['db'];function respondWithStatusCode(_0xfb6e0e,_0x935f3){_0x935f3=_0x935f3||0xcc;return function(_0x101e63){if(_0x101e63){return _0xfb6e0e[_0x156d('0x1d')](_0x935f3);}return _0xfb6e0e['status'](_0x935f3)[_0x156d('0x1e')]();};}function respondWithResult(_0x4b20ed,_0x3430ab){_0x3430ab=_0x3430ab||0xc8;return function(_0xee79ed){if(_0xee79ed){return _0x4b20ed[_0x156d('0x1f')](_0x3430ab)['json'](_0xee79ed);}};}function respondWithFilteredResult(_0x35c0bd,_0x5b9442){return function(_0xc817e){if(_0xc817e){var _0x333bfb=typeof _0x5b9442[_0x156d('0x20')]===_0x156d('0x21')&&typeof _0x5b9442[_0x156d('0x22')]===_0x156d('0x21');var _0x47ff71=_0xc817e[_0x156d('0x23')];var _0x251b29=_0x333bfb?0x0:_0x5b9442[_0x156d('0x20')];var _0x45db37=_0x333bfb?_0xc817e[_0x156d('0x23')]:_0x5b9442[_0x156d('0x20')]+_0x5b9442[_0x156d('0x22')];var _0x5f19ac;if(_0x45db37>=_0x47ff71){_0x45db37=_0x47ff71;_0x5f19ac=0xc8;}else{_0x5f19ac=0xce;}_0x35c0bd['status'](_0x5f19ac);return _0x35c0bd['set'](_0x156d('0x24'),_0x251b29+'-'+_0x45db37+'/'+_0x47ff71)[_0x156d('0x25')](_0xc817e);}return null;};}function patchUpdates(_0x573a07){return function(_0x5f39ed){try{jsonpatch[_0x156d('0x26')](_0x5f39ed,_0x573a07,!![]);}catch(_0x212439){return BPromise['reject'](_0x212439);}return _0x5f39ed[_0x156d('0x27')]();};}function saveUpdates(_0x4bcd6c,_0x1f19b9){return function(_0x2bea63){if(_0x2bea63){return _0x2bea63['update'](_0x4bcd6c)[_0x156d('0x28')](function(_0x21b8db){return _0x21b8db;});}return null;};}function removeEntity(_0x20df28,_0x25a387){return function(_0x20873f){if(_0x20873f){return _0x20873f[_0x156d('0x29')]()['then'](function(){_0x20df28[_0x156d('0x1f')](0xcc)[_0x156d('0x1e')]();});}};}function handleEntityNotFound(_0x1574de,_0x1fc423){return function(_0x323eb5){if(!_0x323eb5){_0x1574de[_0x156d('0x1d')](0x194);}return _0x323eb5;};}function handleError(_0x2df54d,_0x16e8fd){_0x16e8fd=_0x16e8fd||0x1f4;return function(_0x2aa968){logger[_0x156d('0x2a')](_0x2aa968[_0x156d('0x2b')]);if(_0x2aa968['name']){delete _0x2aa968[_0x156d('0x2c')];}_0x2df54d[_0x156d('0x1f')](_0x16e8fd)['send'](_0x2aa968);};}exports['index']=function(_0x3a02b5,_0x15198a){var _0x40aeec={},_0x5f51cd={},_0x22323a={'count':0x0,'rows':[]};var _0x3a62ce=_[_0x156d('0x2d')](db[_0x156d('0x2e')]['rawAttributes'],function(_0x4e4ccd){return{'name':_0x4e4ccd[_0x156d('0x2f')],'type':_0x4e4ccd[_0x156d('0x30')][_0x156d('0x31')]};});_0x5f51cd[_0x156d('0x32')]=_[_0x156d('0x2d')](_0x3a62ce,'name');_0x5f51cd[_0x156d('0x33')]=_[_0x156d('0x34')](_0x3a02b5['query']);_0x5f51cd[_0x156d('0x35')]=_[_0x156d('0x36')](_0x5f51cd[_0x156d('0x32')],_0x5f51cd[_0x156d('0x33')]);_0x40aeec[_0x156d('0x37')]=_[_0x156d('0x36')](_0x5f51cd['model'],qs['fields'](_0x3a02b5[_0x156d('0x33')][_0x156d('0x38')]));_0x40aeec[_0x156d('0x37')]=_0x40aeec[_0x156d('0x37')]['length']?_0x40aeec[_0x156d('0x37')]:_0x5f51cd[_0x156d('0x32')];if(!_0x3a02b5[_0x156d('0x33')][_0x156d('0x39')]('nolimit')){_0x40aeec[_0x156d('0x22')]=qs[_0x156d('0x22')](_0x3a02b5['query'][_0x156d('0x22')]);_0x40aeec[_0x156d('0x20')]=qs[_0x156d('0x20')](_0x3a02b5['query'][_0x156d('0x20')]);}_0x40aeec[_0x156d('0x3a')]=qs[_0x156d('0x3b')](_0x3a02b5['query'][_0x156d('0x3b')]);_0x40aeec[_0x156d('0x3c')]=qs[_0x156d('0x35')](_[_0x156d('0x3d')](_0x3a02b5[_0x156d('0x33')],_0x5f51cd[_0x156d('0x35')]),_0x3a62ce);if(_0x3a02b5[_0x156d('0x33')][_0x156d('0x3e')]){_0x40aeec[_0x156d('0x3c')]=_[_0x156d('0x3f')](_0x40aeec['where'],{'$or':_[_0x156d('0x2d')](_0x3a62ce,function(_0x591007){if(_0x591007['type']!==_0x156d('0x40')){var _0x5a037a={};_0x5a037a[_0x591007[_0x156d('0x2c')]]={'$like':'%'+_0x3a02b5[_0x156d('0x33')][_0x156d('0x3e')]+'%'};return _0x5a037a;}})});}_0x40aeec=_[_0x156d('0x3f')]({},_0x40aeec,_0x3a02b5[_0x156d('0x41')]);var _0x42b42a={'where':_0x40aeec[_0x156d('0x3c')]};return db[_0x156d('0x2e')]['count'](_0x42b42a)[_0x156d('0x28')](function(_0x3beb58){_0x22323a[_0x156d('0x23')]=_0x3beb58;if(_0x3a02b5['query'][_0x156d('0x42')]){_0x40aeec['include']=[{'all':!![]}];}return db[_0x156d('0x2e')][_0x156d('0x43')](_0x40aeec);})[_0x156d('0x28')](function(_0x21fab6){_0x22323a[_0x156d('0x44')]=_0x21fab6;return _0x22323a;})[_0x156d('0x28')](respondWithFilteredResult(_0x15198a,_0x40aeec))[_0x156d('0x45')](handleError(_0x15198a,null));};exports['show']=function(_0x1c2a67,_0x174a91){var _0x13fba1={'raw':!![],'where':{'id':_0x1c2a67[_0x156d('0x46')]['id']}},_0x133adc={};_0x133adc['model']=_[_0x156d('0x34')](db[_0x156d('0x2e')]['rawAttributes']);_0x133adc['query']=_[_0x156d('0x34')](_0x1c2a67[_0x156d('0x33')]);_0x133adc[_0x156d('0x35')]=_[_0x156d('0x36')](_0x133adc[_0x156d('0x32')],_0x133adc[_0x156d('0x33')]);_0x13fba1[_0x156d('0x37')]=_[_0x156d('0x36')](_0x133adc['model'],qs[_0x156d('0x38')](_0x1c2a67[_0x156d('0x33')][_0x156d('0x38')]));_0x13fba1['attributes']=_0x13fba1[_0x156d('0x37')]['length']?_0x13fba1['attributes']:_0x133adc[_0x156d('0x32')];if(_0x1c2a67[_0x156d('0x33')]['includeAll']){_0x13fba1[_0x156d('0x47')]=[{'all':!![]}];}_0x13fba1=_['merge']({},_0x13fba1,_0x1c2a67[_0x156d('0x41')]);return db[_0x156d('0x2e')][_0x156d('0x48')](_0x13fba1)[_0x156d('0x28')](handleEntityNotFound(_0x174a91,null))[_0x156d('0x28')](respondWithResult(_0x174a91,null))[_0x156d('0x45')](handleError(_0x174a91,null));};exports[_0x156d('0x49')]=function(_0x5b4202,_0x1159a5){return db[_0x156d('0x2e')]['create'](_0x5b4202[_0x156d('0x4a')],{})[_0x156d('0x28')](respondWithResult(_0x1159a5,0xc9))[_0x156d('0x45')](handleError(_0x1159a5,null));};exports[_0x156d('0x4b')]=function(_0x51ac98,_0x7aa9c4){if(_0x51ac98[_0x156d('0x4a')]['id']){delete _0x51ac98['body']['id'];}return db[_0x156d('0x2e')]['find']({'where':{'id':_0x51ac98[_0x156d('0x46')]['id']}})[_0x156d('0x28')](handleEntityNotFound(_0x7aa9c4,null))[_0x156d('0x28')](saveUpdates(_0x51ac98['body'],null))[_0x156d('0x28')](respondWithResult(_0x7aa9c4,null))[_0x156d('0x45')](handleError(_0x7aa9c4,null));};exports[_0x156d('0x29')]=function(_0x12859f,_0xca5721){return db[_0x156d('0x2e')][_0x156d('0x48')]({'where':{'id':_0x12859f[_0x156d('0x46')]['id']}})['then'](handleEntityNotFound(_0xca5721,null))[_0x156d('0x28')](removeEntity(_0xca5721,null))[_0x156d('0x45')](handleError(_0xca5721,null));};exports['describe']=function(_0x357341,_0xde2187){return db[_0x156d('0x2e')][_0x156d('0x4c')]()['then'](respondWithResult(_0xde2187,null))[_0x156d('0x45')](handleError(_0xde2187,null));}; \ No newline at end of file +var _0x74d3=['fieldName','type','query','filters','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelQueueReport'];(function(_0x331e83,_0x1f978b){var _0x4296dc=function(_0x3755ec){while(--_0x3755ec){_0x331e83['push'](_0x331e83['shift']());}};_0x4296dc(++_0x1f978b);}(_0x74d3,0x155));var _0x374d=function(_0x11f373,_0x200696){_0x11f373=_0x11f373-0x0;var _0xec7711=_0x74d3[_0x11f373];return _0xec7711;};'use strict';var emlformat=require(_0x374d('0x0'));var rimraf=require(_0x374d('0x1'));var zipdir=require(_0x374d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x374d('0x3'));var moment=require('moment');var BPromise=require(_0x374d('0x4'));var Mustache=require('mustache');var util=require(_0x374d('0x5'));var path=require(_0x374d('0x6'));var sox=require(_0x374d('0x7'));var csv=require(_0x374d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x374d('0x9'));var _=require(_0x374d('0xa'));var squel=require(_0x374d('0xb'));var crypto=require(_0x374d('0xc'));var jsforce=require(_0x374d('0xd'));var deskjs=require(_0x374d('0xe'));var toCsv=require(_0x374d('0x8'));var querystring=require('querystring');var Papa=require(_0x374d('0xf'));var Redis=require(_0x374d('0x10'));var authService=require(_0x374d('0x11'));var qs=require(_0x374d('0x12'));var as=require(_0x374d('0x13'));var hardwareService=require(_0x374d('0x14'));var logger=require(_0x374d('0x15'))(_0x374d('0x16'));var utils=require(_0x374d('0x17'));var config=require(_0x374d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x374d('0x19'))['db'];function respondWithStatusCode(_0x390aeb,_0x42dcaa){_0x42dcaa=_0x42dcaa||0xcc;return function(_0x251fe6){if(_0x251fe6){return _0x390aeb[_0x374d('0x1a')](_0x42dcaa);}return _0x390aeb[_0x374d('0x1b')](_0x42dcaa)[_0x374d('0x1c')]();};}function respondWithResult(_0x1bd410,_0x2505f0){_0x2505f0=_0x2505f0||0xc8;return function(_0x1967bb){if(_0x1967bb){return _0x1bd410[_0x374d('0x1b')](_0x2505f0)[_0x374d('0x1d')](_0x1967bb);}};}function respondWithFilteredResult(_0x471d35,_0x2f8e4b){return function(_0x33ba75){if(_0x33ba75){var _0xb534dd=typeof _0x2f8e4b[_0x374d('0x1e')]==='undefined'&&typeof _0x2f8e4b[_0x374d('0x1f')]===_0x374d('0x20');var _0x4dd3f1=_0x33ba75[_0x374d('0x21')];var _0x2128ec=_0xb534dd?0x0:_0x2f8e4b['offset'];var _0x2c55b3=_0xb534dd?_0x33ba75[_0x374d('0x21')]:_0x2f8e4b[_0x374d('0x1e')]+_0x2f8e4b['limit'];var _0x1b1659;if(_0x2c55b3>=_0x4dd3f1){_0x2c55b3=_0x4dd3f1;_0x1b1659=0xc8;}else{_0x1b1659=0xce;}_0x471d35['status'](_0x1b1659);return _0x471d35[_0x374d('0x22')](_0x374d('0x23'),_0x2128ec+'-'+_0x2c55b3+'/'+_0x4dd3f1)[_0x374d('0x1d')](_0x33ba75);}return null;};}function patchUpdates(_0xbe257b){return function(_0x1ab40a){try{jsonpatch[_0x374d('0x24')](_0x1ab40a,_0xbe257b,!![]);}catch(_0x2350c4){return BPromise[_0x374d('0x25')](_0x2350c4);}return _0x1ab40a[_0x374d('0x26')]();};}function saveUpdates(_0x18b7e,_0x597598){return function(_0x3a4517){if(_0x3a4517){return _0x3a4517[_0x374d('0x27')](_0x18b7e)[_0x374d('0x28')](function(_0x2b32d1){return _0x2b32d1;});}return null;};}function removeEntity(_0x2616ac,_0x18e369){return function(_0x4d27d9){if(_0x4d27d9){return _0x4d27d9[_0x374d('0x29')]()[_0x374d('0x28')](function(){_0x2616ac[_0x374d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d5312,_0x1224fe){return function(_0x30290b){if(!_0x30290b){_0x2d5312['sendStatus'](0x194);}return _0x30290b;};}function handleError(_0x2281e2,_0x2404a6){_0x2404a6=_0x2404a6||0x1f4;return function(_0x145c55){logger[_0x374d('0x2a')](_0x145c55[_0x374d('0x2b')]);if(_0x145c55['name']){delete _0x145c55[_0x374d('0x2c')];}_0x2281e2[_0x374d('0x1b')](_0x2404a6)[_0x374d('0x2d')](_0x145c55);};}exports[_0x374d('0x2e')]=function(_0x6420a2,_0x59d90e){var _0x89fb1f={},_0x2879b8={},_0x17247f={'count':0x0,'rows':[]};var _0x322d85=_[_0x374d('0x2f')](db[_0x374d('0x30')]['rawAttributes'],function(_0x4a98bc){return{'name':_0x4a98bc[_0x374d('0x31')],'type':_0x4a98bc[_0x374d('0x32')]['key']};});_0x2879b8['model']=_[_0x374d('0x2f')](_0x322d85,_0x374d('0x2c'));_0x2879b8[_0x374d('0x33')]=_['keys'](_0x6420a2[_0x374d('0x33')]);_0x2879b8[_0x374d('0x34')]=_[_0x374d('0x35')](_0x2879b8['model'],_0x2879b8[_0x374d('0x33')]);_0x89fb1f['attributes']=_[_0x374d('0x35')](_0x2879b8['model'],qs[_0x374d('0x36')](_0x6420a2['query'][_0x374d('0x36')]));_0x89fb1f[_0x374d('0x37')]=_0x89fb1f[_0x374d('0x37')][_0x374d('0x38')]?_0x89fb1f[_0x374d('0x37')]:_0x2879b8[_0x374d('0x39')];if(!_0x6420a2[_0x374d('0x33')][_0x374d('0x3a')](_0x374d('0x3b'))){_0x89fb1f[_0x374d('0x1f')]=qs['limit'](_0x6420a2['query'][_0x374d('0x1f')]);_0x89fb1f[_0x374d('0x1e')]=qs[_0x374d('0x1e')](_0x6420a2[_0x374d('0x33')]['offset']);}_0x89fb1f['order']=qs['sort'](_0x6420a2[_0x374d('0x33')][_0x374d('0x3c')]);_0x89fb1f[_0x374d('0x3d')]=qs[_0x374d('0x34')](_['pick'](_0x6420a2['query'],_0x2879b8[_0x374d('0x34')]),_0x322d85);if(_0x6420a2['query']['filter']){_0x89fb1f[_0x374d('0x3d')]=_[_0x374d('0x3e')](_0x89fb1f['where'],{'$or':_[_0x374d('0x2f')](_0x322d85,function(_0xb9f2e8){if(_0xb9f2e8[_0x374d('0x32')]!==_0x374d('0x3f')){var _0x53e8ab={};_0x53e8ab[_0xb9f2e8[_0x374d('0x2c')]]={'$like':'%'+_0x6420a2['query'][_0x374d('0x40')]+'%'};return _0x53e8ab;}})});}_0x89fb1f=_['merge']({},_0x89fb1f,_0x6420a2[_0x374d('0x41')]);var _0x34614b={'where':_0x89fb1f['where']};return db[_0x374d('0x30')]['count'](_0x34614b)[_0x374d('0x28')](function(_0x136b35){_0x17247f[_0x374d('0x21')]=_0x136b35;if(_0x6420a2[_0x374d('0x33')][_0x374d('0x42')]){_0x89fb1f[_0x374d('0x43')]=[{'all':!![]}];}return db[_0x374d('0x30')][_0x374d('0x44')](_0x89fb1f);})[_0x374d('0x28')](function(_0x4a5d78){_0x17247f['rows']=_0x4a5d78;return _0x17247f;})[_0x374d('0x28')](respondWithFilteredResult(_0x59d90e,_0x89fb1f))['catch'](handleError(_0x59d90e,null));};exports[_0x374d('0x45')]=function(_0x8b68e3,_0x5384f0){var _0x578170={'raw':!![],'where':{'id':_0x8b68e3[_0x374d('0x46')]['id']}},_0x5ecf71={};_0x5ecf71[_0x374d('0x39')]=_[_0x374d('0x47')](db[_0x374d('0x30')][_0x374d('0x48')]);_0x5ecf71[_0x374d('0x33')]=_['keys'](_0x8b68e3['query']);_0x5ecf71[_0x374d('0x34')]=_[_0x374d('0x35')](_0x5ecf71[_0x374d('0x39')],_0x5ecf71[_0x374d('0x33')]);_0x578170[_0x374d('0x37')]=_['intersection'](_0x5ecf71['model'],qs[_0x374d('0x36')](_0x8b68e3[_0x374d('0x33')]['fields']));_0x578170[_0x374d('0x37')]=_0x578170[_0x374d('0x37')][_0x374d('0x38')]?_0x578170['attributes']:_0x5ecf71[_0x374d('0x39')];if(_0x8b68e3[_0x374d('0x33')][_0x374d('0x42')]){_0x578170['include']=[{'all':!![]}];}_0x578170=_[_0x374d('0x3e')]({},_0x578170,_0x8b68e3['options']);return db[_0x374d('0x30')][_0x374d('0x49')](_0x578170)[_0x374d('0x28')](handleEntityNotFound(_0x5384f0,null))[_0x374d('0x28')](respondWithResult(_0x5384f0,null))[_0x374d('0x4a')](handleError(_0x5384f0,null));};exports['create']=function(_0x5a6d07,_0x58eb94){return db[_0x374d('0x30')][_0x374d('0x4b')](_0x5a6d07[_0x374d('0x4c')],{})[_0x374d('0x28')](respondWithResult(_0x58eb94,0xc9))[_0x374d('0x4a')](handleError(_0x58eb94,null));};exports[_0x374d('0x27')]=function(_0x3a5f9b,_0x27d02c){if(_0x3a5f9b[_0x374d('0x4c')]['id']){delete _0x3a5f9b[_0x374d('0x4c')]['id'];}return db[_0x374d('0x30')]['find']({'where':{'id':_0x3a5f9b[_0x374d('0x46')]['id']}})[_0x374d('0x28')](handleEntityNotFound(_0x27d02c,null))[_0x374d('0x28')](saveUpdates(_0x3a5f9b[_0x374d('0x4c')],null))['then'](respondWithResult(_0x27d02c,null))[_0x374d('0x4a')](handleError(_0x27d02c,null));};exports[_0x374d('0x29')]=function(_0x1d71c8,_0x561fe6){return db['OpenchannelQueueReport'][_0x374d('0x49')]({'where':{'id':_0x1d71c8[_0x374d('0x46')]['id']}})[_0x374d('0x28')](handleEntityNotFound(_0x561fe6,null))[_0x374d('0x28')](removeEntity(_0x561fe6,null))[_0x374d('0x4a')](handleError(_0x561fe6,null));};exports[_0x374d('0x4d')]=function(_0x4a6967,_0x2daea2){return db[_0x374d('0x30')][_0x374d('0x4d')]()[_0x374d('0x28')](respondWithResult(_0x2daea2,null))['catch'](handleError(_0x2daea2,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index f51f3f9..c69536a 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 _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x9a636,_0x2d8812){var _0x5c0067=function(_0x410392){while(--_0x410392){_0x9a636['push'](_0x9a636['shift']());}};_0x5c0067(++_0x2d8812);}(_0xe14b,0x93));var _0xbe14=function(_0x334ce6,_0x3a80d4){_0x334ce6=_0x334ce6-0x0;var _0x433c74=_0xe14b[_0x334ce6];return _0x433c74;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ef3=['define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./openchannelQueueReport.attributes','exports'];(function(_0x2b6430,_0x584d96){var _0x48fed1=function(_0x499ee5){while(--_0x499ee5){_0x2b6430['push'](_0x2b6430['shift']());}};_0x48fed1(++_0x584d96);}(_0x2ef3,0xba));var _0x32ef=function(_0x50224d,_0xc08d8e){_0x50224d=_0x50224d-0x0;var _0x561cda=_0x2ef3[_0x50224d];return _0x561cda;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var logger=require(_0x32ef('0x2'))(_0x32ef('0x3'));var moment=require(_0x32ef('0x4'));var BPromise=require(_0x32ef('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x32ef('0x6'));var rimraf=require(_0x32ef('0x7'));var config=require('../../config/environment');var attributes=require(_0x32ef('0x8'));module[_0x32ef('0x9')]=function(_0x4c8104,_0x5dfa09){return _0x4c8104[_0x32ef('0xa')](_0x32ef('0xb'),attributes,{'tableName':_0x32ef('0xc'),'paranoid':![],'indexes':[{'name':_0x32ef('0xd'),'fields':[_0x32ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 6eaa8d1..232459e 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 _0x2b65=['jayson/promise','client','http','then','info','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','stringify','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xcfed91,_0x29b51b){var _0x42e245=function(_0x1a131c){while(--_0x1a131c){_0xcfed91['push'](_0xcfed91['shift']());}};_0x42e245(++_0x29b51b);}(_0x2b65,0x131));var _0x52b6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x2b65[_0x164eca];return _0x2ce562;};'use strict';var _=require(_0x52b6('0x0'));var util=require(_0x52b6('0x1'));var moment=require(_0x52b6('0x2'));var BPromise=require(_0x52b6('0x3'));var rs=require(_0x52b6('0x4'));var fs=require('fs');var Redis=require(_0x52b6('0x5'));var db=require(_0x52b6('0x6'))['db'];var utils=require(_0x52b6('0x7'));var logger=require('../../config/logger')(_0x52b6('0x8'));var config=require(_0x52b6('0x9'));var jayson=require(_0x52b6('0xa'));var client=jayson[_0x52b6('0xb')][_0x52b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d451f,_0x70579,_0x1af78f){return new BPromise(function(_0x432726,_0x27c5b9){return client['request'](_0x2d451f,_0x1af78f)[_0x52b6('0xd')](function(_0x1c2cb5){logger[_0x52b6('0xe')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x52b6('0xf'));logger[_0x52b6('0x10')](_0x52b6('0x11'),_0x70579,_0x52b6('0xf'),JSON['stringify'](_0x1c2cb5));if(_0x1c2cb5[_0x52b6('0x12')]){if(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x13')]===0x1f4){logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')]['message']);return _0x27c5b9(_0x1c2cb5[_0x52b6('0x12')]['message']);}logger['error'](_0x52b6('0x14'),_0x70579,_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);return _0x432726(_0x1c2cb5[_0x52b6('0x12')][_0x52b6('0x15')]);}else{logger[_0x52b6('0xe')](_0x52b6('0x14'),_0x70579,_0x52b6('0xf'));_0x432726(_0x1c2cb5[_0x52b6('0x16')][_0x52b6('0x15')]);}})[_0x52b6('0x17')](function(_0x307594){logger[_0x52b6('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x70579,_0x307594);_0x27c5b9(_0x307594);});});}exports[_0x52b6('0x18')]=function(_0x2fa3ed){var _0x9bab0a=this;return new Promise(function(_0x47d203,_0x36d376){return db[_0x52b6('0x19')]['create'](_0x2fa3ed['body'],{'raw':_0x2fa3ed[_0x52b6('0x1a')]?_0x2fa3ed['options'][_0x52b6('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2e472f){logger[_0x52b6('0xe')](_0x52b6('0x18'),_0x2fa3ed);logger[_0x52b6('0x10')]('CreateOpenchannelQueueReport',_0x2fa3ed,JSON[_0x52b6('0x1c')](_0x2e472f));_0x47d203(_0x2e472f);})[_0x52b6('0x17')](function(_0x1246db){logger[_0x52b6('0x12')](_0x52b6('0x18'),_0x1246db[_0x52b6('0x15')],_0x2fa3ed);_0x36d376(_0x9bab0a[_0x52b6('0x12')](0x1f4,_0x1246db[_0x52b6('0x15')]));});});};exports[_0x52b6('0x1d')]=function(_0x55aa4c){var _0x2a97c0=this;return new Promise(function(_0x2ff6f4,_0x3a2fb0){return db[_0x52b6('0x19')][_0x52b6('0x1e')](_0x55aa4c[_0x52b6('0x1f')],{'raw':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x20')]||null:null,'attributes':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c[_0x52b6('0x1a')][_0x52b6('0x21')]||null:null,'limit':_0x55aa4c[_0x52b6('0x1a')]?_0x55aa4c['options'][_0x52b6('0x22')]||null:null})[_0x52b6('0xd')](function(_0x1716b6){logger[_0x52b6('0xe')](_0x52b6('0x1d'),_0x55aa4c);logger[_0x52b6('0x10')](_0x52b6('0x1d'),_0x55aa4c,JSON['stringify'](_0x1716b6));_0x2ff6f4(_0x1716b6);})[_0x52b6('0x17')](function(_0x42ac9b){logger['error'](_0x52b6('0x1d'),_0x42ac9b[_0x52b6('0x15')],_0x55aa4c);_0x3a2fb0(_0x2a97c0[_0x52b6('0x12')](0x1f4,_0x42ac9b[_0x52b6('0x15')]));});});}; \ No newline at end of file +var _0xea28=['request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','debug','UpdateOpenchannelQueueReport','update','raw','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s'];(function(_0x750888,_0x22fd3f){var _0x30b506=function(_0x223ae4){while(--_0x223ae4){_0x750888['push'](_0x750888['shift']());}};_0x30b506(++_0x22fd3f);}(_0xea28,0x13a));var _0x8ea2=function(_0x1ea61d,_0x5142c1){_0x1ea61d=_0x1ea61d-0x0;var _0x3f0817=_0xea28[_0x1ea61d];return _0x3f0817;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x435d78,_0xb7f278,_0x39b1fa){return new BPromise(function(_0x28b5b8,_0x929304){return client[_0x8ea2('0xc')](_0x435d78,_0x39b1fa)[_0x8ea2('0xd')](function(_0x3de4a1){logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));logger['debug']('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0xb7f278,_0x8ea2('0x10'),JSON[_0x8ea2('0x11')](_0x3de4a1));if(_0x3de4a1[_0x8ea2('0x12')]){if(_0x3de4a1['error'][_0x8ea2('0x13')]===0x1f4){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x929304(_0x3de4a1['error'][_0x8ea2('0x14')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xb7f278,_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);return _0x28b5b8(_0x3de4a1[_0x8ea2('0x12')][_0x8ea2('0x14')]);}else{logger[_0x8ea2('0xe')](_0x8ea2('0xf'),_0xb7f278,_0x8ea2('0x10'));_0x28b5b8(_0x3de4a1[_0x8ea2('0x15')][_0x8ea2('0x14')]);}})[_0x8ea2('0x16')](function(_0x2dfa7c){logger[_0x8ea2('0x12')](_0x8ea2('0xf'),_0xb7f278,_0x2dfa7c);_0x929304(_0x2dfa7c);});});}exports[_0x8ea2('0x17')]=function(_0x1b64cf){var _0x174ef2=this;return new Promise(function(_0x467045,_0x2a0329){return db[_0x8ea2('0x18')][_0x8ea2('0x19')](_0x1b64cf[_0x8ea2('0x1a')],{'raw':_0x1b64cf[_0x8ea2('0x1b')]?_0x1b64cf['options']['raw']===undefined?!![]:![]:!![]})[_0x8ea2('0xd')](function(_0x248c18){logger[_0x8ea2('0xe')]('CreateOpenchannelQueueReport',_0x1b64cf);logger[_0x8ea2('0x1c')](_0x8ea2('0x17'),_0x1b64cf,JSON['stringify'](_0x248c18));_0x467045(_0x248c18);})[_0x8ea2('0x16')](function(_0x283f00){logger[_0x8ea2('0x12')](_0x8ea2('0x17'),_0x283f00[_0x8ea2('0x14')],_0x1b64cf);_0x2a0329(_0x174ef2[_0x8ea2('0x12')](0x1f4,_0x283f00[_0x8ea2('0x14')]));});});};exports[_0x8ea2('0x1d')]=function(_0x18ec34){var _0x4d5030=this;return new Promise(function(_0x433bc5,_0x4f48bd){return db[_0x8ea2('0x18')][_0x8ea2('0x1e')](_0x18ec34[_0x8ea2('0x1a')],{'raw':_0x18ec34['options']?_0x18ec34['options'][_0x8ea2('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ec34['options']?_0x18ec34[_0x8ea2('0x1b')]['where']||null:null,'attributes':_0x18ec34[_0x8ea2('0x1b')]?_0x18ec34[_0x8ea2('0x1b')][_0x8ea2('0x20')]||null:null,'limit':_0x18ec34[_0x8ea2('0x1b')]?_0x18ec34['options']['limit']||null:null})[_0x8ea2('0xd')](function(_0x4da5b3){logger[_0x8ea2('0xe')](_0x8ea2('0x1d'),_0x18ec34);logger[_0x8ea2('0x1c')](_0x8ea2('0x1d'),_0x18ec34,JSON[_0x8ea2('0x11')](_0x4da5b3));_0x433bc5(_0x4da5b3);})[_0x8ea2('0x16')](function(_0x32e225){logger[_0x8ea2('0x12')](_0x8ea2('0x1d'),_0x32e225[_0x8ea2('0x14')],_0x18ec34);_0x4f48bd(_0x4d5030['error'](0x1f4,_0x32e225['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index f6e49d4..7454388 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 _0x45b7=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','index','/describe','isAuthenticated','describe','show','post','create','put','/:id','update','destroy','exports','multer','util'];(function(_0x587193,_0x473a0d){var _0x596a48=function(_0xa7b61a){while(--_0xa7b61a){_0x587193['push'](_0x587193['shift']());}};_0x596a48(++_0x473a0d);}(_0x45b7,0x11e));var _0x745b=function(_0x35c1db,_0xd75c15){_0x35c1db=_0x35c1db-0x0;var _0x4173ff=_0x45b7[_0x35c1db];return _0x4173ff;};'use strict';var multer=require(_0x745b('0x0'));var util=require(_0x745b('0x1'));var path=require(_0x745b('0x2'));var timeout=require(_0x745b('0x3'));var express=require(_0x745b('0x4'));var router=express[_0x745b('0x5')]();var fs_extra=require(_0x745b('0x6'));var auth=require(_0x745b('0x7'));var interaction=require(_0x745b('0x8'));var config=require(_0x745b('0x9'));var controller=require(_0x745b('0xa'));router[_0x745b('0xb')]('/',auth['isAuthenticated'](),controller[_0x745b('0xc')]);router[_0x745b('0xb')](_0x745b('0xd'),auth[_0x745b('0xe')](),controller[_0x745b('0xf')]);router[_0x745b('0xb')]('/:id',auth[_0x745b('0xe')](),controller[_0x745b('0x10')]);router[_0x745b('0x11')]('/',auth[_0x745b('0xe')](),controller[_0x745b('0x12')]);router[_0x745b('0x13')](_0x745b('0x14'),auth[_0x745b('0xe')](),controller[_0x745b('0x15')]);router['delete'](_0x745b('0x14'),auth[_0x745b('0xe')](),controller[_0x745b('0x16')]);module[_0x745b('0x17')]=router; \ No newline at end of file +var _0x9fea=['isAuthenticated','describe','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelTransferReport.controller','get'];(function(_0x3eace6,_0x2569e5){var _0x528ceb=function(_0x5cf0b6){while(--_0x5cf0b6){_0x3eace6['push'](_0x3eace6['shift']());}};_0x528ceb(++_0x2569e5);}(_0x9fea,0x197));var _0xa9fe=function(_0x4420e4,_0x2c1efc){_0x4420e4=_0x4420e4-0x0;var _0x1ab5eb=_0x9fea[_0x4420e4];return _0x1ab5eb;};'use strict';var multer=require(_0xa9fe('0x0'));var util=require(_0xa9fe('0x1'));var path=require(_0xa9fe('0x2'));var timeout=require(_0xa9fe('0x3'));var express=require(_0xa9fe('0x4'));var router=express[_0xa9fe('0x5')]();var fs_extra=require(_0xa9fe('0x6'));var auth=require(_0xa9fe('0x7'));var interaction=require(_0xa9fe('0x8'));var config=require('../../config/environment');var controller=require(_0xa9fe('0x9'));router[_0xa9fe('0xa')]('/',auth[_0xa9fe('0xb')](),controller['index']);router[_0xa9fe('0xa')]('/describe',auth[_0xa9fe('0xb')](),controller[_0xa9fe('0xc')]);router['get']('/:id',auth[_0xa9fe('0xb')](),controller['show']);router[_0xa9fe('0xd')]('/',auth[_0xa9fe('0xb')](),controller[_0xa9fe('0xe')]);router['put'](_0xa9fe('0xf'),auth[_0xa9fe('0xb')](),controller[_0xa9fe('0x10')]);router[_0xa9fe('0x11')](_0xa9fe('0xf'),auth[_0xa9fe('0xb')](),controller[_0xa9fe('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 74ff74d..efbe2c5 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x4b4154,_0x38a122){var _0x340ed7=function(_0x1250b9){while(--_0x1250b9){_0x4b4154['push'](_0x4b4154['shift']());}};_0x340ed7(++_0x38a122);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x8ba6ac,_0xe23fc9){var _0x23d1bc=function(_0x3bfb33){while(--_0x3bfb33){_0x8ba6ac['push'](_0x8ba6ac['shift']());}};_0x23d1bc(++_0xe23fc9);}(_0xedd9,0xfc));var _0x9edd=function(_0x3a4e84,_0x4eea00){_0x3a4e84=_0x3a4e84-0x0;var _0x56cc8b=_0xedd9[_0x3a4e84];return _0x56cc8b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d9102ba..db68320 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 _0xd5f9=['fieldName','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','rawAttributes','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','OpenchannelTransferReport'];(function(_0x3f5522,_0x28e324){var _0x4731f1=function(_0xfe154){while(--_0xfe154){_0x3f5522['push'](_0x3f5522['shift']());}};_0x4731f1(++_0x28e324);}(_0xd5f9,0x6a));var _0x9d5f=function(_0x98ee7c,_0x499bff){_0x98ee7c=_0x98ee7c-0x0;var _0xe4d709=_0xd5f9[_0x98ee7c];return _0xe4d709;};'use strict';var emlformat=require(_0x9d5f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9d5f('0x1'));var jsonpatch=require(_0x9d5f('0x2'));var rp=require(_0x9d5f('0x3'));var moment=require('moment');var BPromise=require(_0x9d5f('0x4'));var Mustache=require('mustache');var util=require(_0x9d5f('0x5'));var path=require('path');var sox=require(_0x9d5f('0x6'));var csv=require(_0x9d5f('0x7'));var ejs=require(_0x9d5f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9d5f('0x9'));var squel=require(_0x9d5f('0xa'));var crypto=require(_0x9d5f('0xb'));var jsforce=require(_0x9d5f('0xc'));var deskjs=require(_0x9d5f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9d5f('0xe'));var Papa=require(_0x9d5f('0xf'));var Redis=require('ioredis');var authService=require(_0x9d5f('0x10'));var qs=require(_0x9d5f('0x11'));var as=require(_0x9d5f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9d5f('0x13'))(_0x9d5f('0x14'));var utils=require(_0x9d5f('0x15'));var config=require(_0x9d5f('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d5f('0x17'))['db'];function respondWithStatusCode(_0x514d04,_0x334de2){_0x334de2=_0x334de2||0xcc;return function(_0x8b758e){if(_0x8b758e){return _0x514d04[_0x9d5f('0x18')](_0x334de2);}return _0x514d04[_0x9d5f('0x19')](_0x334de2)[_0x9d5f('0x1a')]();};}function respondWithResult(_0x3c71b2,_0x2fc121){_0x2fc121=_0x2fc121||0xc8;return function(_0x4c9037){if(_0x4c9037){return _0x3c71b2[_0x9d5f('0x19')](_0x2fc121)[_0x9d5f('0x1b')](_0x4c9037);}};}function respondWithFilteredResult(_0x35bec3,_0x2234a8){return function(_0x87a93d){if(_0x87a93d){var _0x19ba8c=typeof _0x2234a8[_0x9d5f('0x1c')]===_0x9d5f('0x1d')&&typeof _0x2234a8[_0x9d5f('0x1e')]===_0x9d5f('0x1d');var _0x408cd6=_0x87a93d[_0x9d5f('0x1f')];var _0x4b9865=_0x19ba8c?0x0:_0x2234a8[_0x9d5f('0x1c')];var _0xf7f0f0=_0x19ba8c?_0x87a93d[_0x9d5f('0x1f')]:_0x2234a8[_0x9d5f('0x1c')]+_0x2234a8['limit'];var _0x20e1ed;if(_0xf7f0f0>=_0x408cd6){_0xf7f0f0=_0x408cd6;_0x20e1ed=0xc8;}else{_0x20e1ed=0xce;}_0x35bec3[_0x9d5f('0x19')](_0x20e1ed);return _0x35bec3['set'](_0x9d5f('0x20'),_0x4b9865+'-'+_0xf7f0f0+'/'+_0x408cd6)[_0x9d5f('0x1b')](_0x87a93d);}return null;};}function patchUpdates(_0x46639f){return function(_0x51051c){try{jsonpatch[_0x9d5f('0x21')](_0x51051c,_0x46639f,!![]);}catch(_0x3a8373){return BPromise[_0x9d5f('0x22')](_0x3a8373);}return _0x51051c[_0x9d5f('0x23')]();};}function saveUpdates(_0x5a32ab,_0x55c0a3){return function(_0x56a769){if(_0x56a769){return _0x56a769[_0x9d5f('0x24')](_0x5a32ab)[_0x9d5f('0x25')](function(_0x5cae7b){return _0x5cae7b;});}return null;};}function removeEntity(_0x408fdd,_0x3f0ad8){return function(_0x5ccdf4){if(_0x5ccdf4){return _0x5ccdf4[_0x9d5f('0x26')]()['then'](function(){_0x408fdd['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23aed1,_0xe082db){return function(_0x544b33){if(!_0x544b33){_0x23aed1[_0x9d5f('0x18')](0x194);}return _0x544b33;};}function handleError(_0x491604,_0x4df47c){_0x4df47c=_0x4df47c||0x1f4;return function(_0x2e8f5b){logger[_0x9d5f('0x27')](_0x2e8f5b[_0x9d5f('0x28')]);if(_0x2e8f5b[_0x9d5f('0x29')]){delete _0x2e8f5b[_0x9d5f('0x29')];}_0x491604[_0x9d5f('0x19')](_0x4df47c)[_0x9d5f('0x2a')](_0x2e8f5b);};}exports[_0x9d5f('0x2b')]=function(_0x883da9,_0x388473){var _0x537905={},_0x360abe={},_0x15ce80={'count':0x0,'rows':[]};var _0x386ae3=_[_0x9d5f('0x2c')](db[_0x9d5f('0x2d')]['rawAttributes'],function(_0x1a32d6){return{'name':_0x1a32d6[_0x9d5f('0x2e')],'type':_0x1a32d6[_0x9d5f('0x2f')][_0x9d5f('0x30')]};});_0x360abe['model']=_[_0x9d5f('0x2c')](_0x386ae3,_0x9d5f('0x29'));_0x360abe[_0x9d5f('0x31')]=_[_0x9d5f('0x32')](_0x883da9[_0x9d5f('0x31')]);_0x360abe['filters']=_[_0x9d5f('0x33')](_0x360abe[_0x9d5f('0x34')],_0x360abe[_0x9d5f('0x31')]);_0x537905['attributes']=_['intersection'](_0x360abe[_0x9d5f('0x34')],qs['fields'](_0x883da9[_0x9d5f('0x31')][_0x9d5f('0x35')]));_0x537905[_0x9d5f('0x36')]=_0x537905[_0x9d5f('0x36')][_0x9d5f('0x37')]?_0x537905[_0x9d5f('0x36')]:_0x360abe[_0x9d5f('0x34')];if(!_0x883da9[_0x9d5f('0x31')]['hasOwnProperty'](_0x9d5f('0x38'))){_0x537905[_0x9d5f('0x1e')]=qs[_0x9d5f('0x1e')](_0x883da9['query']['limit']);_0x537905['offset']=qs[_0x9d5f('0x1c')](_0x883da9[_0x9d5f('0x31')]['offset']);}_0x537905['order']=qs[_0x9d5f('0x39')](_0x883da9[_0x9d5f('0x31')]['sort']);_0x537905[_0x9d5f('0x3a')]=qs[_0x9d5f('0x3b')](_[_0x9d5f('0x3c')](_0x883da9['query'],_0x360abe['filters']),_0x386ae3);if(_0x883da9[_0x9d5f('0x31')][_0x9d5f('0x3d')]){_0x537905[_0x9d5f('0x3a')]=_[_0x9d5f('0x3e')](_0x537905['where'],{'$or':_['map'](_0x386ae3,function(_0x2ddc0d){if(_0x2ddc0d[_0x9d5f('0x2f')]!==_0x9d5f('0x3f')){var _0x3ab646={};_0x3ab646[_0x2ddc0d[_0x9d5f('0x29')]]={'$like':'%'+_0x883da9[_0x9d5f('0x31')][_0x9d5f('0x3d')]+'%'};return _0x3ab646;}})});}_0x537905=_[_0x9d5f('0x3e')]({},_0x537905,_0x883da9[_0x9d5f('0x40')]);var _0x453ac2={'where':_0x537905[_0x9d5f('0x3a')]};return db['OpenchannelTransferReport']['count'](_0x453ac2)[_0x9d5f('0x25')](function(_0x494fd1){_0x15ce80[_0x9d5f('0x1f')]=_0x494fd1;if(_0x883da9[_0x9d5f('0x31')][_0x9d5f('0x41')]){_0x537905[_0x9d5f('0x42')]=[{'all':!![]}];}return db[_0x9d5f('0x2d')][_0x9d5f('0x43')](_0x537905);})[_0x9d5f('0x25')](function(_0x11d0df){_0x15ce80[_0x9d5f('0x44')]=_0x11d0df;return _0x15ce80;})[_0x9d5f('0x25')](respondWithFilteredResult(_0x388473,_0x537905))[_0x9d5f('0x45')](handleError(_0x388473,null));};exports['show']=function(_0xb0def8,_0x2f68f7){var _0x360e02={'raw':!![],'where':{'id':_0xb0def8['params']['id']}},_0x1f9a56={};_0x1f9a56[_0x9d5f('0x34')]=_[_0x9d5f('0x32')](db[_0x9d5f('0x2d')][_0x9d5f('0x46')]);_0x1f9a56['query']=_[_0x9d5f('0x32')](_0xb0def8['query']);_0x1f9a56[_0x9d5f('0x3b')]=_[_0x9d5f('0x33')](_0x1f9a56[_0x9d5f('0x34')],_0x1f9a56[_0x9d5f('0x31')]);_0x360e02[_0x9d5f('0x36')]=_[_0x9d5f('0x33')](_0x1f9a56['model'],qs[_0x9d5f('0x35')](_0xb0def8[_0x9d5f('0x31')][_0x9d5f('0x35')]));_0x360e02[_0x9d5f('0x36')]=_0x360e02['attributes'][_0x9d5f('0x37')]?_0x360e02['attributes']:_0x1f9a56[_0x9d5f('0x34')];if(_0xb0def8[_0x9d5f('0x31')]['includeAll']){_0x360e02[_0x9d5f('0x42')]=[{'all':!![]}];}_0x360e02=_[_0x9d5f('0x3e')]({},_0x360e02,_0xb0def8['options']);return db[_0x9d5f('0x2d')]['find'](_0x360e02)['then'](handleEntityNotFound(_0x2f68f7,null))[_0x9d5f('0x25')](respondWithResult(_0x2f68f7,null))[_0x9d5f('0x45')](handleError(_0x2f68f7,null));};exports[_0x9d5f('0x47')]=function(_0x469759,_0x5a1d88){return db[_0x9d5f('0x2d')][_0x9d5f('0x47')](_0x469759[_0x9d5f('0x48')],{})[_0x9d5f('0x25')](respondWithResult(_0x5a1d88,0xc9))[_0x9d5f('0x45')](handleError(_0x5a1d88,null));};exports[_0x9d5f('0x24')]=function(_0x4d48e3,_0x2794ac){if(_0x4d48e3[_0x9d5f('0x48')]['id']){delete _0x4d48e3[_0x9d5f('0x48')]['id'];}return db['OpenchannelTransferReport'][_0x9d5f('0x49')]({'where':{'id':_0x4d48e3[_0x9d5f('0x4a')]['id']}})[_0x9d5f('0x25')](handleEntityNotFound(_0x2794ac,null))['then'](saveUpdates(_0x4d48e3[_0x9d5f('0x48')],null))['then'](respondWithResult(_0x2794ac,null))[_0x9d5f('0x45')](handleError(_0x2794ac,null));};exports[_0x9d5f('0x26')]=function(_0x316d38,_0x6f3e98){return db[_0x9d5f('0x2d')][_0x9d5f('0x49')]({'where':{'id':_0x316d38[_0x9d5f('0x4a')]['id']}})[_0x9d5f('0x25')](handleEntityNotFound(_0x6f3e98,null))[_0x9d5f('0x25')](removeEntity(_0x6f3e98,null))[_0x9d5f('0x45')](handleError(_0x6f3e98,null));};exports[_0x9d5f('0x4b')]=function(_0x56aa61,_0x18fa66){return db[_0x9d5f('0x2d')][_0x9d5f('0x4b')]()['then'](respondWithResult(_0x18fa66,null))[_0x9d5f('0x45')](handleError(_0x18fa66,null));}; \ No newline at end of file +var _0x1580=['limit','set','Content-Range','apply','update','then','name','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','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','json','offset','count'];(function(_0x4b321d,_0x270770){var _0x16b3ef=function(_0x3b5aa1){while(--_0x3b5aa1){_0x4b321d['push'](_0x4b321d['shift']());}};_0x16b3ef(++_0x270770);}(_0x1580,0x6f));var _0x0158=function(_0x49c5ab,_0xdd7c55){_0x49c5ab=_0x49c5ab-0x0;var _0x48126c=_0x1580[_0x49c5ab];return _0x48126c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0158('0x0'));var zipdir=require(_0x0158('0x1'));var jsonpatch=require(_0x0158('0x2'));var rp=require(_0x0158('0x3'));var moment=require(_0x0158('0x4'));var BPromise=require(_0x0158('0x5'));var Mustache=require(_0x0158('0x6'));var util=require('util');var path=require(_0x0158('0x7'));var sox=require(_0x0158('0x8'));var csv=require(_0x0158('0x9'));var ejs=require(_0x0158('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0158('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0158('0x9'));var querystring=require(_0x0158('0xc'));var Papa=require('papaparse');var Redis=require(_0x0158('0xd'));var authService=require(_0x0158('0xe'));var qs=require(_0x0158('0xf'));var as=require(_0x0158('0x10'));var hardwareService=require(_0x0158('0x11'));var logger=require(_0x0158('0x12'))(_0x0158('0x13'));var utils=require(_0x0158('0x14'));var config=require(_0x0158('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x0158('0x16'))['db'];function respondWithStatusCode(_0x230f06,_0x4e31dd){_0x4e31dd=_0x4e31dd||0xcc;return function(_0x4dd5e0){if(_0x4dd5e0){return _0x230f06[_0x0158('0x17')](_0x4e31dd);}return _0x230f06['status'](_0x4e31dd)[_0x0158('0x18')]();};}function respondWithResult(_0x792769,_0x475750){_0x475750=_0x475750||0xc8;return function(_0x581e97){if(_0x581e97){return _0x792769[_0x0158('0x19')](_0x475750)[_0x0158('0x1a')](_0x581e97);}};}function respondWithFilteredResult(_0x4d894a,_0x33c638){return function(_0x4c0be0){if(_0x4c0be0){var _0x496db7=typeof _0x33c638[_0x0158('0x1b')]==='undefined'&&typeof _0x33c638['limit']==='undefined';var _0x2c4403=_0x4c0be0[_0x0158('0x1c')];var _0x432b9d=_0x496db7?0x0:_0x33c638[_0x0158('0x1b')];var _0x369477=_0x496db7?_0x4c0be0[_0x0158('0x1c')]:_0x33c638[_0x0158('0x1b')]+_0x33c638[_0x0158('0x1d')];var _0x11eb7c;if(_0x369477>=_0x2c4403){_0x369477=_0x2c4403;_0x11eb7c=0xc8;}else{_0x11eb7c=0xce;}_0x4d894a['status'](_0x11eb7c);return _0x4d894a[_0x0158('0x1e')](_0x0158('0x1f'),_0x432b9d+'-'+_0x369477+'/'+_0x2c4403)['json'](_0x4c0be0);}return null;};}function patchUpdates(_0x59931f){return function(_0x4c3ea3){try{jsonpatch[_0x0158('0x20')](_0x4c3ea3,_0x59931f,!![]);}catch(_0x30049c){return BPromise['reject'](_0x30049c);}return _0x4c3ea3['save']();};}function saveUpdates(_0x51b093,_0x54d033){return function(_0x8ad6b8){if(_0x8ad6b8){return _0x8ad6b8[_0x0158('0x21')](_0x51b093)[_0x0158('0x22')](function(_0x50a69b){return _0x50a69b;});}return null;};}function removeEntity(_0x5ce000,_0x2f811c){return function(_0x362774){if(_0x362774){return _0x362774['destroy']()[_0x0158('0x22')](function(){_0x5ce000[_0x0158('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a546,_0x3fb1c0){return function(_0x5e33c4){if(!_0x5e33c4){_0x23a546[_0x0158('0x17')](0x194);}return _0x5e33c4;};}function handleError(_0x5df752,_0x465975){_0x465975=_0x465975||0x1f4;return function(_0x3c4bdf){logger['error'](_0x3c4bdf['stack']);if(_0x3c4bdf[_0x0158('0x23')]){delete _0x3c4bdf[_0x0158('0x23')];}_0x5df752['status'](_0x465975)['send'](_0x3c4bdf);};}exports['index']=function(_0x57a9b5,_0x25a461){var _0x1d3ba0={},_0x3c619a={},_0x54686d={'count':0x0,'rows':[]};var _0x45d163=_[_0x0158('0x24')](db[_0x0158('0x25')][_0x0158('0x26')],function(_0x56cbfa){return{'name':_0x56cbfa[_0x0158('0x27')],'type':_0x56cbfa[_0x0158('0x28')][_0x0158('0x29')]};});_0x3c619a['model']=_[_0x0158('0x24')](_0x45d163,_0x0158('0x23'));_0x3c619a[_0x0158('0x2a')]=_[_0x0158('0x2b')](_0x57a9b5[_0x0158('0x2a')]);_0x3c619a[_0x0158('0x2c')]=_[_0x0158('0x2d')](_0x3c619a['model'],_0x3c619a[_0x0158('0x2a')]);_0x1d3ba0[_0x0158('0x2e')]=_[_0x0158('0x2d')](_0x3c619a[_0x0158('0x2f')],qs[_0x0158('0x30')](_0x57a9b5[_0x0158('0x2a')][_0x0158('0x30')]));_0x1d3ba0['attributes']=_0x1d3ba0[_0x0158('0x2e')][_0x0158('0x31')]?_0x1d3ba0[_0x0158('0x2e')]:_0x3c619a[_0x0158('0x2f')];if(!_0x57a9b5['query'][_0x0158('0x32')]('nolimit')){_0x1d3ba0[_0x0158('0x1d')]=qs[_0x0158('0x1d')](_0x57a9b5[_0x0158('0x2a')][_0x0158('0x1d')]);_0x1d3ba0[_0x0158('0x1b')]=qs['offset'](_0x57a9b5[_0x0158('0x2a')][_0x0158('0x1b')]);}_0x1d3ba0[_0x0158('0x33')]=qs[_0x0158('0x34')](_0x57a9b5['query'][_0x0158('0x34')]);_0x1d3ba0[_0x0158('0x35')]=qs[_0x0158('0x2c')](_[_0x0158('0x36')](_0x57a9b5['query'],_0x3c619a[_0x0158('0x2c')]),_0x45d163);if(_0x57a9b5['query'][_0x0158('0x37')]){_0x1d3ba0['where']=_[_0x0158('0x38')](_0x1d3ba0['where'],{'$or':_[_0x0158('0x24')](_0x45d163,function(_0x347846){if(_0x347846[_0x0158('0x28')]!==_0x0158('0x39')){var _0x1d209d={};_0x1d209d[_0x347846[_0x0158('0x23')]]={'$like':'%'+_0x57a9b5['query'][_0x0158('0x37')]+'%'};return _0x1d209d;}})});}_0x1d3ba0=_[_0x0158('0x38')]({},_0x1d3ba0,_0x57a9b5[_0x0158('0x3a')]);var _0xeac3a5={'where':_0x1d3ba0[_0x0158('0x35')]};return db['OpenchannelTransferReport']['count'](_0xeac3a5)['then'](function(_0x23ccdb){_0x54686d[_0x0158('0x1c')]=_0x23ccdb;if(_0x57a9b5['query'][_0x0158('0x3b')]){_0x1d3ba0[_0x0158('0x3c')]=[{'all':!![]}];}return db[_0x0158('0x25')][_0x0158('0x3d')](_0x1d3ba0);})['then'](function(_0x11c4f6){_0x54686d[_0x0158('0x3e')]=_0x11c4f6;return _0x54686d;})['then'](respondWithFilteredResult(_0x25a461,_0x1d3ba0))[_0x0158('0x3f')](handleError(_0x25a461,null));};exports[_0x0158('0x40')]=function(_0x48c0fe,_0x11d163){var _0x1d27c2={'raw':!![],'where':{'id':_0x48c0fe[_0x0158('0x41')]['id']}},_0x550436={};_0x550436[_0x0158('0x2f')]=_[_0x0158('0x2b')](db[_0x0158('0x25')]['rawAttributes']);_0x550436[_0x0158('0x2a')]=_[_0x0158('0x2b')](_0x48c0fe[_0x0158('0x2a')]);_0x550436[_0x0158('0x2c')]=_[_0x0158('0x2d')](_0x550436[_0x0158('0x2f')],_0x550436['query']);_0x1d27c2['attributes']=_['intersection'](_0x550436[_0x0158('0x2f')],qs[_0x0158('0x30')](_0x48c0fe[_0x0158('0x2a')][_0x0158('0x30')]));_0x1d27c2['attributes']=_0x1d27c2['attributes']['length']?_0x1d27c2[_0x0158('0x2e')]:_0x550436['model'];if(_0x48c0fe[_0x0158('0x2a')][_0x0158('0x3b')]){_0x1d27c2[_0x0158('0x3c')]=[{'all':!![]}];}_0x1d27c2=_[_0x0158('0x38')]({},_0x1d27c2,_0x48c0fe['options']);return db[_0x0158('0x25')]['find'](_0x1d27c2)[_0x0158('0x22')](handleEntityNotFound(_0x11d163,null))[_0x0158('0x22')](respondWithResult(_0x11d163,null))[_0x0158('0x3f')](handleError(_0x11d163,null));};exports[_0x0158('0x42')]=function(_0x2f7c02,_0xb244b9){return db[_0x0158('0x25')][_0x0158('0x42')](_0x2f7c02['body'],{})['then'](respondWithResult(_0xb244b9,0xc9))[_0x0158('0x3f')](handleError(_0xb244b9,null));};exports['update']=function(_0x27f82d,_0x51f3cc){if(_0x27f82d[_0x0158('0x43')]['id']){delete _0x27f82d[_0x0158('0x43')]['id'];}return db[_0x0158('0x25')]['find']({'where':{'id':_0x27f82d[_0x0158('0x41')]['id']}})['then'](handleEntityNotFound(_0x51f3cc,null))['then'](saveUpdates(_0x27f82d[_0x0158('0x43')],null))['then'](respondWithResult(_0x51f3cc,null))['catch'](handleError(_0x51f3cc,null));};exports[_0x0158('0x44')]=function(_0x3b839a,_0x3829f3){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x3b839a[_0x0158('0x41')]['id']}})['then'](handleEntityNotFound(_0x3829f3,null))[_0x0158('0x22')](removeEntity(_0x3829f3,null))[_0x0158('0x3f')](handleError(_0x3829f3,null));};exports['describe']=function(_0x43fd2f,_0x4fcfd2){return db[_0x0158('0x25')][_0x0158('0x45')]()['then'](respondWithResult(_0x4fcfd2,null))[_0x0158('0x3f')](handleError(_0x4fcfd2,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 3eac454..316476a 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 _0x6543=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','../../config/logger'];(function(_0x56a4b5,_0x427c97){var _0x339f11=function(_0x4b65a1){while(--_0x4b65a1){_0x56a4b5['push'](_0x56a4b5['shift']());}};_0x339f11(++_0x427c97);}(_0x6543,0xa2));var _0x3654=function(_0x2d7248,_0x357e77){_0x2d7248=_0x2d7248-0x0;var _0x4e8de1=_0x6543[_0x2d7248];return _0x4e8de1;};'use strict';var _=require(_0x3654('0x0'));var util=require(_0x3654('0x1'));var logger=require(_0x3654('0x2'))('api');var moment=require(_0x3654('0x3'));var BPromise=require(_0x3654('0x4'));var rp=require(_0x3654('0x5'));var fs=require('fs');var path=require(_0x3654('0x6'));var rimraf=require(_0x3654('0x7'));var config=require(_0x3654('0x8'));var attributes=require(_0x3654('0x9'));module[_0x3654('0xa')]=function(_0x2ba969,_0x456a58){return _0x2ba969[_0x3654('0xb')](_0x3654('0xc'),attributes,{'tableName':_0x3654('0xd'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3654('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0e2b=['bluebird','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','moment'];(function(_0x593564,_0x43583f){var _0x211a89=function(_0x40afd6){while(--_0x40afd6){_0x593564['push'](_0x593564['shift']());}};_0x211a89(++_0x43583f);}(_0x0e2b,0x17d));var _0xb0e2=function(_0x486541,_0xdb9374){_0x486541=_0x486541-0x0;var _0xd92757=_0x0e2b[_0x486541];return _0xd92757;};'use strict';var _=require(_0xb0e2('0x0'));var util=require(_0xb0e2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb0e2('0x2'));var BPromise=require(_0xb0e2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb0e2('0x4'));var rimraf=require(_0xb0e2('0x5'));var config=require(_0xb0e2('0x6'));var attributes=require(_0xb0e2('0x7'));module[_0xb0e2('0x8')]=function(_0x169339,_0x1dee48){return _0x169339['define'](_0xb0e2('0x9'),attributes,{'tableName':_0xb0e2('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xb0e2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 03c7ead..4344c7e 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 _0x4ce6=['http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client'];(function(_0x3d46c5,_0x5c6ed6){var _0x3381d6=function(_0x348bc){while(--_0x348bc){_0x3d46c5['push'](_0x3d46c5['shift']());}};_0x3381d6(++_0x5c6ed6);}(_0x4ce6,0x108));var _0x64ce=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x4ce6[_0x553a87];return _0x12d1e6;};'use strict';var _=require(_0x64ce('0x0'));var util=require('util');var moment=require(_0x64ce('0x1'));var BPromise=require(_0x64ce('0x2'));var rs=require(_0x64ce('0x3'));var fs=require('fs');var Redis=require(_0x64ce('0x4'));var db=require(_0x64ce('0x5'))['db'];var utils=require(_0x64ce('0x6'));var logger=require('../../config/logger')(_0x64ce('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x64ce('0x8')][_0x64ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b8f2d,_0x538b74,_0x3c279f){return new BPromise(function(_0x134230,_0x1b253e){return client[_0x64ce('0xa')](_0x5b8f2d,_0x3c279f)[_0x64ce('0xb')](function(_0x135482){logger[_0x64ce('0xc')](_0x64ce('0xd'),_0x538b74,_0x64ce('0xe'));logger['debug'](_0x64ce('0xf'),_0x538b74,_0x64ce('0xe'),JSON[_0x64ce('0x10')](_0x135482));if(_0x135482[_0x64ce('0x11')]){if(_0x135482[_0x64ce('0x11')][_0x64ce('0x12')]===0x1f4){logger[_0x64ce('0x11')](_0x64ce('0xd'),_0x538b74,_0x135482['error'][_0x64ce('0x13')]);return _0x1b253e(_0x135482['error']['message']);}logger[_0x64ce('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x538b74,_0x135482[_0x64ce('0x11')][_0x64ce('0x13')]);return _0x134230(_0x135482[_0x64ce('0x11')][_0x64ce('0x13')]);}else{logger[_0x64ce('0xc')](_0x64ce('0xd'),_0x538b74,_0x64ce('0xe'));_0x134230(_0x135482[_0x64ce('0x14')][_0x64ce('0x13')]);}})['catch'](function(_0x4b49be){logger['error'](_0x64ce('0xd'),_0x538b74,_0x4b49be);_0x1b253e(_0x4b49be);});});} \ No newline at end of file +var _0xf9d5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','error','OpenchannelTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x124752,_0x5a697b){var _0x4b476b=function(_0x42b2b6){while(--_0x42b2b6){_0x124752['push'](_0x124752['shift']());}};_0x4b476b(++_0x5a697b);}(_0xf9d5,0x122));var _0x5f9d=function(_0x18f441,_0x5dc25f){_0x18f441=_0x18f441-0x0;var _0x3fdba7=_0xf9d5[_0x18f441];return _0x3fdba7;};'use strict';var _=require('lodash');var util=require(_0x5f9d('0x0'));var moment=require(_0x5f9d('0x1'));var BPromise=require('bluebird');var rs=require(_0x5f9d('0x2'));var fs=require('fs');var Redis=require(_0x5f9d('0x3'));var db=require(_0x5f9d('0x4'))['db'];var utils=require(_0x5f9d('0x5'));var logger=require(_0x5f9d('0x6'))(_0x5f9d('0x7'));var config=require(_0x5f9d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5f9d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24999e,_0x38fb6b,_0x4fb9f7){return new BPromise(function(_0x3420b2,_0x23e865){return client[_0x5f9d('0xa')](_0x24999e,_0x4fb9f7)[_0x5f9d('0xb')](function(_0xcc3772){logger[_0x5f9d('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x38fb6b,_0x5f9d('0xd'));logger[_0x5f9d('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x38fb6b,'request\x20sent',JSON[_0x5f9d('0xf')](_0xcc3772));if(_0xcc3772[_0x5f9d('0x10')]){if(_0xcc3772[_0x5f9d('0x10')]['code']===0x1f4){logger[_0x5f9d('0x10')](_0x5f9d('0x11'),_0x38fb6b,_0xcc3772[_0x5f9d('0x10')][_0x5f9d('0x12')]);return _0x23e865(_0xcc3772['error'][_0x5f9d('0x12')]);}logger[_0x5f9d('0x10')](_0x5f9d('0x11'),_0x38fb6b,_0xcc3772['error'][_0x5f9d('0x12')]);return _0x3420b2(_0xcc3772[_0x5f9d('0x10')]['message']);}else{logger['info'](_0x5f9d('0x11'),_0x38fb6b,_0x5f9d('0xd'));_0x3420b2(_0xcc3772[_0x5f9d('0x13')][_0x5f9d('0x12')]);}})[_0x5f9d('0x14')](function(_0x47f480){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x38fb6b,_0x47f480);_0x23e865(_0x47f480);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index a94b7fd..c2922f5 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 _0x07bb=['/:id','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','post','create','put','update'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x07bb,0xc9));var _0xb07b=function(_0xd381ae,_0x191ad8){_0xd381ae=_0xd381ae-0x0;var _0x172bd3=_0x07bb[_0xd381ae];return _0x172bd3;};'use strict';var multer=require(_0xb07b('0x0'));var util=require('util');var path=require(_0xb07b('0x1'));var timeout=require(_0xb07b('0x2'));var express=require(_0xb07b('0x3'));var router=express['Router']();var fs_extra=require(_0xb07b('0x4'));var auth=require(_0xb07b('0x5'));var interaction=require(_0xb07b('0x6'));var config=require(_0xb07b('0x7'));var controller=require('./pause.controller');router[_0xb07b('0x8')]('/',auth[_0xb07b('0x9')](),controller[_0xb07b('0xa')]);router[_0xb07b('0x8')]('/:id',auth[_0xb07b('0x9')](),controller['show']);router[_0xb07b('0xb')]('/',auth[_0xb07b('0x9')](),controller[_0xb07b('0xc')]);router[_0xb07b('0xd')]('/:id',auth[_0xb07b('0x9')](),controller[_0xb07b('0xe')]);router['delete'](_0xb07b('0xf'),auth[_0xb07b('0x9')](),controller[_0xb07b('0x10')]);module[_0xb07b('0x11')]=router; \ No newline at end of file +var _0x0aab=['exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./pause.controller','isAuthenticated','index','show','create','put','/:id','update','delete','destroy'];(function(_0x5b6919,_0x37d7e2){var _0x41fac6=function(_0xfc0464){while(--_0xfc0464){_0x5b6919['push'](_0x5b6919['shift']());}};_0x41fac6(++_0x37d7e2);}(_0x0aab,0x169));var _0xb0aa=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0x0aab[_0x725a4c];return _0x37b2cc;};'use strict';var multer=require(_0xb0aa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb0aa('0x1'));var express=require(_0xb0aa('0x2'));var router=express[_0xb0aa('0x3')]();var fs_extra=require(_0xb0aa('0x4'));var auth=require(_0xb0aa('0x5'));var interaction=require(_0xb0aa('0x6'));var config=require('../../config/environment');var controller=require(_0xb0aa('0x7'));router['get']('/',auth[_0xb0aa('0x8')](),controller[_0xb0aa('0x9')]);router['get']('/:id',auth[_0xb0aa('0x8')](),controller[_0xb0aa('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb0aa('0xb')]);router[_0xb0aa('0xc')](_0xb0aa('0xd'),auth[_0xb0aa('0x8')](),controller[_0xb0aa('0xe')]);router[_0xb0aa('0xf')](_0xb0aa('0xd'),auth[_0xb0aa('0x8')](),controller[_0xb0aa('0x10')]);module[_0xb0aa('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 66da264..0fda151 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 _0x9d75=['STRING','sequelize'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x9d75,0x1d1));var _0x59d7=function(_0x5d282e,_0x39dead){_0x5d282e=_0x5d282e-0x0;var _0x237f0e=_0x9d75[_0x5d282e];return _0x237f0e;};'use strict';var Sequelize=require(_0x59d7('0x0'));module['exports']={'name':{'type':Sequelize[_0x59d7('0x1')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x59d7('0x1')]}}; \ No newline at end of file +var _0x9eb1=['sequelize','STRING','name'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x9eb1,0x18f));var _0x19eb=function(_0x518d6a,_0x5a0164){_0x518d6a=_0x518d6a-0x0;var _0x58446b=_0x9eb1[_0x518d6a];return _0x58446b;};'use strict';var Sequelize=require(_0x19eb('0x0'));module['exports']={'name':{'type':Sequelize[_0x19eb('0x1')],'unique':_0x19eb('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x19eb('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index b2f0470..0b16d2d 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 _0x80d9=['UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','reject','update','destroy','then','get','Pauses','UserProfileResource','sendStatus','name','send','index','map','Pause','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','fields','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x80d9,0x19a));var _0x980d=function(_0x210052,_0xfb8028){_0x210052=_0x210052-0x0;var _0x2e1076=_0x80d9[_0x210052];return _0x2e1076;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x980d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x980d('0x1'));var rp=require(_0x980d('0x2'));var moment=require('moment');var BPromise=require(_0x980d('0x3'));var Mustache=require(_0x980d('0x4'));var util=require(_0x980d('0x5'));var path=require(_0x980d('0x6'));var sox=require('sox');var csv=require(_0x980d('0x7'));var ejs=require(_0x980d('0x8'));var fs=require('fs');var fs_extra=require(_0x980d('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x980d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x980d('0x7'));var querystring=require(_0x980d('0xb'));var Papa=require(_0x980d('0xc'));var Redis=require('ioredis');var authService=require(_0x980d('0xd'));var qs=require(_0x980d('0xe'));var as=require(_0x980d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x980d('0x10'))(_0x980d('0x11'));var utils=require(_0x980d('0x12'));var config=require(_0x980d('0x13'));var licenseUtil=require(_0x980d('0x14'));var db=require(_0x980d('0x15'))['db'];function respondWithStatusCode(_0x113419,_0x20aa5c){_0x20aa5c=_0x20aa5c||0xcc;return function(_0x166249){if(_0x166249){return _0x113419['sendStatus'](_0x20aa5c);}return _0x113419[_0x980d('0x16')](_0x20aa5c)[_0x980d('0x17')]();};}function respondWithResult(_0x578d58,_0x4c6c98){_0x4c6c98=_0x4c6c98||0xc8;return function(_0x38fe2b){if(_0x38fe2b){return _0x578d58['status'](_0x4c6c98)[_0x980d('0x18')](_0x38fe2b);}};}function respondWithFilteredResult(_0x1f8dea,_0x1dca3b){return function(_0x2d8954){if(_0x2d8954){var _0x132e8d=typeof _0x1dca3b[_0x980d('0x19')]===_0x980d('0x1a')&&typeof _0x1dca3b['limit']===_0x980d('0x1a');var _0x47228c=_0x2d8954['count'];var _0x21dada=_0x132e8d?0x0:_0x1dca3b[_0x980d('0x19')];var _0x40da82=_0x132e8d?_0x2d8954[_0x980d('0x1b')]:_0x1dca3b['offset']+_0x1dca3b[_0x980d('0x1c')];var _0x14bcfe;if(_0x40da82>=_0x47228c){_0x40da82=_0x47228c;_0x14bcfe=0xc8;}else{_0x14bcfe=0xce;}_0x1f8dea[_0x980d('0x16')](_0x14bcfe);return _0x1f8dea[_0x980d('0x1d')]('Content-Range',_0x21dada+'-'+_0x40da82+'/'+_0x47228c)['json'](_0x2d8954);}return null;};}function patchUpdates(_0x19bf60){return function(_0x40180a){try{jsonpatch['apply'](_0x40180a,_0x19bf60,!![]);}catch(_0x592822){return BPromise[_0x980d('0x1e')](_0x592822);}return _0x40180a['save']();};}function saveUpdates(_0x11eff9,_0x1951f7){return function(_0x3c71fc){if(_0x3c71fc){return _0x3c71fc[_0x980d('0x1f')](_0x11eff9)['then'](function(_0x3918be){return _0x3918be;});}return null;};}function removeEntity(_0x1aad13,_0xf4b05e){return function(_0x4a030c){if(_0x4a030c){return _0x4a030c[_0x980d('0x20')]()[_0x980d('0x21')](function(){var _0x459e65=_0x4a030c[_0x980d('0x22')]({'plain':!![]});var _0x2b3c1c=_0x980d('0x23');return db[_0x980d('0x24')][_0x980d('0x20')]({'where':{'type':_0x2b3c1c,'resourceId':_0x459e65['id']}})['then'](function(){return _0x4a030c;});})['then'](function(){_0x1aad13[_0x980d('0x16')](0xcc)[_0x980d('0x17')]();});}};}function handleEntityNotFound(_0x50eef3,_0x4699f0){return function(_0x1de1fb){if(!_0x1de1fb){_0x50eef3[_0x980d('0x25')](0x194);}return _0x1de1fb;};}function handleError(_0x3bb47c,_0x586534){_0x586534=_0x586534||0x1f4;return function(_0x43b714){logger['error'](_0x43b714['stack']);if(_0x43b714[_0x980d('0x26')]){delete _0x43b714[_0x980d('0x26')];}_0x3bb47c[_0x980d('0x16')](_0x586534)[_0x980d('0x27')](_0x43b714);};}exports[_0x980d('0x28')]=function(_0x17e150,_0x484850){var _0x1cdeca={},_0x15941b={},_0x4c6978={'count':0x0,'rows':[]};var _0x5ec7fe=_[_0x980d('0x29')](db[_0x980d('0x2a')][_0x980d('0x2b')],function(_0x292141){return{'name':_0x292141[_0x980d('0x2c')],'type':_0x292141[_0x980d('0x2d')][_0x980d('0x2e')]};});_0x15941b['model']=_[_0x980d('0x29')](_0x5ec7fe,'name');_0x15941b[_0x980d('0x2f')]=_[_0x980d('0x30')](_0x17e150[_0x980d('0x2f')]);_0x15941b[_0x980d('0x31')]=_[_0x980d('0x32')](_0x15941b['model'],_0x15941b[_0x980d('0x2f')]);_0x1cdeca[_0x980d('0x33')]=_[_0x980d('0x32')](_0x15941b[_0x980d('0x34')],qs['fields'](_0x17e150['query']['fields']));_0x1cdeca[_0x980d('0x33')]=_0x1cdeca[_0x980d('0x33')][_0x980d('0x35')]?_0x1cdeca['attributes']:_0x15941b[_0x980d('0x34')];if(!_0x17e150[_0x980d('0x2f')][_0x980d('0x36')](_0x980d('0x37'))){_0x1cdeca['limit']=qs['limit'](_0x17e150[_0x980d('0x2f')][_0x980d('0x1c')]);_0x1cdeca[_0x980d('0x19')]=qs[_0x980d('0x19')](_0x17e150[_0x980d('0x2f')]['offset']);}_0x1cdeca['order']=qs[_0x980d('0x38')](_0x17e150['query'][_0x980d('0x38')]);_0x1cdeca[_0x980d('0x39')]=qs[_0x980d('0x31')](_['pick'](_0x17e150[_0x980d('0x2f')],_0x15941b['filters']),_0x5ec7fe);if(_0x17e150['query'][_0x980d('0x3a')]){_0x1cdeca[_0x980d('0x39')]=_[_0x980d('0x3b')](_0x1cdeca[_0x980d('0x39')],{'$or':_['map'](_0x5ec7fe,function(_0x3557e0){if(_0x3557e0[_0x980d('0x2d')]!==_0x980d('0x3c')){var _0x1db3a6={};_0x1db3a6[_0x3557e0[_0x980d('0x26')]]={'$like':'%'+_0x17e150[_0x980d('0x2f')]['filter']+'%'};return _0x1db3a6;}})});}_0x1cdeca=_[_0x980d('0x3b')]({},_0x1cdeca,_0x17e150[_0x980d('0x3d')]);var _0x1745e3={'where':_0x1cdeca[_0x980d('0x39')]};return db['Pause']['count'](_0x1745e3)[_0x980d('0x21')](function(_0x3e19f6){_0x4c6978[_0x980d('0x1b')]=_0x3e19f6;if(_0x17e150['query']['includeAll']){_0x1cdeca['include']=[{'all':!![]}];}return db[_0x980d('0x2a')][_0x980d('0x3e')](_0x1cdeca);})[_0x980d('0x21')](function(_0x461844){_0x4c6978[_0x980d('0x3f')]=_0x461844;return _0x4c6978;})['then'](respondWithFilteredResult(_0x484850,_0x1cdeca))[_0x980d('0x40')](handleError(_0x484850,null));};exports[_0x980d('0x41')]=function(_0x3d097e,_0x1574c5){var _0x251190={'raw':!![],'where':{'id':_0x3d097e[_0x980d('0x42')]['id']}},_0x4488ee={};_0x4488ee[_0x980d('0x34')]=_[_0x980d('0x30')](db[_0x980d('0x2a')][_0x980d('0x2b')]);_0x4488ee[_0x980d('0x2f')]=_[_0x980d('0x30')](_0x3d097e[_0x980d('0x2f')]);_0x4488ee[_0x980d('0x31')]=_[_0x980d('0x32')](_0x4488ee[_0x980d('0x34')],_0x4488ee['query']);_0x251190[_0x980d('0x33')]=_[_0x980d('0x32')](_0x4488ee['model'],qs['fields'](_0x3d097e[_0x980d('0x2f')][_0x980d('0x43')]));_0x251190['attributes']=_0x251190['attributes'][_0x980d('0x35')]?_0x251190[_0x980d('0x33')]:_0x4488ee[_0x980d('0x34')];if(_0x3d097e['query'][_0x980d('0x44')]){_0x251190[_0x980d('0x45')]=[{'all':!![]}];}_0x251190=_[_0x980d('0x3b')]({},_0x251190,_0x3d097e['options']);return db[_0x980d('0x2a')][_0x980d('0x46')](_0x251190)['then'](handleEntityNotFound(_0x1574c5,null))['then'](respondWithResult(_0x1574c5,null))[_0x980d('0x40')](handleError(_0x1574c5,null));};exports['create']=function(_0x393ce9,_0x3b9048){return db['Pause'][_0x980d('0x47')](_0x393ce9[_0x980d('0x48')],{})[_0x980d('0x21')](function(_0x12d43e){var _0x55a819=_0x393ce9[_0x980d('0x49')][_0x980d('0x22')]({'plain':!![]});if(!_0x55a819)throw new Error(_0x980d('0x4a'));if(_0x55a819[_0x980d('0x4b')]==='user'){var _0x1c47d5=_0x12d43e[_0x980d('0x22')]({'plain':!![]});var _0x1b3485=_0x980d('0x23');return db[_0x980d('0x4c')]['find']({'where':{'name':_0x1b3485,'userProfileId':_0x55a819[_0x980d('0x4d')]},'raw':!![]})[_0x980d('0x21')](function(_0x10d662){if(_0x10d662&&_0x10d662[_0x980d('0x4e')]===0x0){return db[_0x980d('0x24')][_0x980d('0x47')]({'name':_0x1c47d5[_0x980d('0x26')],'resourceId':_0x1c47d5['id'],'type':_0x10d662[_0x980d('0x26')],'sectionId':_0x10d662['id']},{})['then'](function(){return _0x12d43e;});}else{return _0x12d43e;}})[_0x980d('0x40')](function(_0xe5988e){logger[_0x980d('0x4f')](_0x980d('0x50'),_0xe5988e);throw _0xe5988e;});}return _0x12d43e;})[_0x980d('0x21')](respondWithResult(_0x3b9048,0xc9))['catch'](handleError(_0x3b9048,null));};exports[_0x980d('0x1f')]=function(_0x520b35,_0x33b6ee){if(_0x520b35[_0x980d('0x48')]['id']){delete _0x520b35[_0x980d('0x48')]['id'];}return db['Pause'][_0x980d('0x46')]({'where':{'id':_0x520b35['params']['id']}})[_0x980d('0x21')](handleEntityNotFound(_0x33b6ee,null))[_0x980d('0x21')](saveUpdates(_0x520b35[_0x980d('0x48')],null))[_0x980d('0x21')](respondWithResult(_0x33b6ee,null))[_0x980d('0x40')](handleError(_0x33b6ee,null));};exports['destroy']=function(_0xed62e9,_0x20de07){return db['Pause'][_0x980d('0x46')]({'where':{'id':_0xed62e9[_0x980d('0x42')]['id']}})['then'](handleEntityNotFound(_0x20de07,null))['then'](removeEntity(_0x20de07,null))[_0x980d('0x40')](handleError(_0x20de07,null));}; \ No newline at end of file +var _0x5b4a=['name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','Pause','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','Pauses','UserProfileResource','sendStatus','stack'];(function(_0x18475f,_0xcaaafe){var _0xb6bcf0=function(_0x33869c){while(--_0x33869c){_0x18475f['push'](_0x18475f['shift']());}};_0xb6bcf0(++_0xcaaafe);}(_0x5b4a,0xcf));var _0xa5b4=function(_0x55dcaa,_0x55f333){_0x55dcaa=_0x55dcaa-0x0;var _0x5aea42=_0x5b4a[_0x55dcaa];return _0x5aea42;};'use strict';var emlformat=require(_0xa5b4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa5b4('0x1'));var jsonpatch=require(_0xa5b4('0x2'));var rp=require(_0xa5b4('0x3'));var moment=require(_0xa5b4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5b4('0x5'));var util=require(_0xa5b4('0x6'));var path=require(_0xa5b4('0x7'));var sox=require(_0xa5b4('0x8'));var csv=require('to-csv');var ejs=require(_0xa5b4('0x9'));var fs=require('fs');var fs_extra=require(_0xa5b4('0xa'));var _=require(_0xa5b4('0xb'));var squel=require(_0xa5b4('0xc'));var crypto=require(_0xa5b4('0xd'));var jsforce=require(_0xa5b4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa5b4('0xf'));var querystring=require(_0xa5b4('0x10'));var Papa=require(_0xa5b4('0x11'));var Redis=require('ioredis');var authService=require(_0xa5b4('0x12'));var qs=require(_0xa5b4('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa5b4('0x14'))(_0xa5b4('0x15'));var utils=require(_0xa5b4('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa5b4('0x17'))['db'];function respondWithStatusCode(_0xab10af,_0x4f659c){_0x4f659c=_0x4f659c||0xcc;return function(_0x2c5e6b){if(_0x2c5e6b){return _0xab10af['sendStatus'](_0x4f659c);}return _0xab10af[_0xa5b4('0x18')](_0x4f659c)[_0xa5b4('0x19')]();};}function respondWithResult(_0x461a76,_0x5a5dda){_0x5a5dda=_0x5a5dda||0xc8;return function(_0x57972f){if(_0x57972f){return _0x461a76[_0xa5b4('0x18')](_0x5a5dda)[_0xa5b4('0x1a')](_0x57972f);}};}function respondWithFilteredResult(_0x3328d3,_0x141e26){return function(_0x5ef9a2){if(_0x5ef9a2){var _0x3bddb2=typeof _0x141e26[_0xa5b4('0x1b')]===_0xa5b4('0x1c')&&typeof _0x141e26[_0xa5b4('0x1d')]===_0xa5b4('0x1c');var _0x22cb1f=_0x5ef9a2[_0xa5b4('0x1e')];var _0x2cfbc0=_0x3bddb2?0x0:_0x141e26[_0xa5b4('0x1b')];var _0x358422=_0x3bddb2?_0x5ef9a2[_0xa5b4('0x1e')]:_0x141e26['offset']+_0x141e26[_0xa5b4('0x1d')];var _0x9b6b01;if(_0x358422>=_0x22cb1f){_0x358422=_0x22cb1f;_0x9b6b01=0xc8;}else{_0x9b6b01=0xce;}_0x3328d3[_0xa5b4('0x18')](_0x9b6b01);return _0x3328d3[_0xa5b4('0x1f')](_0xa5b4('0x20'),_0x2cfbc0+'-'+_0x358422+'/'+_0x22cb1f)[_0xa5b4('0x1a')](_0x5ef9a2);}return null;};}function patchUpdates(_0x4e6eff){return function(_0x5a59f1){try{jsonpatch['apply'](_0x5a59f1,_0x4e6eff,!![]);}catch(_0x27b1ad){return BPromise[_0xa5b4('0x21')](_0x27b1ad);}return _0x5a59f1[_0xa5b4('0x22')]();};}function saveUpdates(_0x103490,_0x226793){return function(_0xcc41cc){if(_0xcc41cc){return _0xcc41cc[_0xa5b4('0x23')](_0x103490)['then'](function(_0x2da107){return _0x2da107;});}return null;};}function removeEntity(_0x1300a8,_0x1daa3b){return function(_0x42d6ae){if(_0x42d6ae){return _0x42d6ae[_0xa5b4('0x24')]()[_0xa5b4('0x25')](function(){var _0x2d07b6=_0x42d6ae['get']({'plain':!![]});var _0x503b7b=_0xa5b4('0x26');return db[_0xa5b4('0x27')][_0xa5b4('0x24')]({'where':{'type':_0x503b7b,'resourceId':_0x2d07b6['id']}})[_0xa5b4('0x25')](function(){return _0x42d6ae;});})['then'](function(){_0x1300a8[_0xa5b4('0x18')](0xcc)[_0xa5b4('0x19')]();});}};}function handleEntityNotFound(_0xbb5ebc,_0x5ac39a){return function(_0x2d5cc5){if(!_0x2d5cc5){_0xbb5ebc[_0xa5b4('0x28')](0x194);}return _0x2d5cc5;};}function handleError(_0x40382f,_0x59ea24){_0x59ea24=_0x59ea24||0x1f4;return function(_0x1cf826){logger['error'](_0x1cf826[_0xa5b4('0x29')]);if(_0x1cf826[_0xa5b4('0x2a')]){delete _0x1cf826[_0xa5b4('0x2a')];}_0x40382f[_0xa5b4('0x18')](_0x59ea24)[_0xa5b4('0x2b')](_0x1cf826);};}exports[_0xa5b4('0x2c')]=function(_0x1646b7,_0x4c4f0b){var _0x542cde={},_0x2b6b84={},_0x598ba3={'count':0x0,'rows':[]};var _0x42ba11=_[_0xa5b4('0x2d')](db['Pause'][_0xa5b4('0x2e')],function(_0x66ded2){return{'name':_0x66ded2[_0xa5b4('0x2f')],'type':_0x66ded2[_0xa5b4('0x30')][_0xa5b4('0x31')]};});_0x2b6b84[_0xa5b4('0x32')]=_[_0xa5b4('0x2d')](_0x42ba11,_0xa5b4('0x2a'));_0x2b6b84[_0xa5b4('0x33')]=_[_0xa5b4('0x34')](_0x1646b7[_0xa5b4('0x33')]);_0x2b6b84[_0xa5b4('0x35')]=_[_0xa5b4('0x36')](_0x2b6b84[_0xa5b4('0x32')],_0x2b6b84['query']);_0x542cde['attributes']=_[_0xa5b4('0x36')](_0x2b6b84[_0xa5b4('0x32')],qs[_0xa5b4('0x37')](_0x1646b7['query']['fields']));_0x542cde[_0xa5b4('0x38')]=_0x542cde[_0xa5b4('0x38')][_0xa5b4('0x39')]?_0x542cde[_0xa5b4('0x38')]:_0x2b6b84[_0xa5b4('0x32')];if(!_0x1646b7[_0xa5b4('0x33')][_0xa5b4('0x3a')](_0xa5b4('0x3b'))){_0x542cde[_0xa5b4('0x1d')]=qs['limit'](_0x1646b7[_0xa5b4('0x33')]['limit']);_0x542cde[_0xa5b4('0x1b')]=qs[_0xa5b4('0x1b')](_0x1646b7[_0xa5b4('0x33')][_0xa5b4('0x1b')]);}_0x542cde[_0xa5b4('0x3c')]=qs[_0xa5b4('0x3d')](_0x1646b7[_0xa5b4('0x33')][_0xa5b4('0x3d')]);_0x542cde[_0xa5b4('0x3e')]=qs[_0xa5b4('0x35')](_['pick'](_0x1646b7[_0xa5b4('0x33')],_0x2b6b84[_0xa5b4('0x35')]),_0x42ba11);if(_0x1646b7['query'][_0xa5b4('0x3f')]){_0x542cde[_0xa5b4('0x3e')]=_[_0xa5b4('0x40')](_0x542cde[_0xa5b4('0x3e')],{'$or':_[_0xa5b4('0x2d')](_0x42ba11,function(_0x314e0f){if(_0x314e0f[_0xa5b4('0x30')]!=='VIRTUAL'){var _0xf498cc={};_0xf498cc[_0x314e0f['name']]={'$like':'%'+_0x1646b7[_0xa5b4('0x33')]['filter']+'%'};return _0xf498cc;}})});}_0x542cde=_[_0xa5b4('0x40')]({},_0x542cde,_0x1646b7[_0xa5b4('0x41')]);var _0x498d6c={'where':_0x542cde['where']};return db['Pause'][_0xa5b4('0x1e')](_0x498d6c)[_0xa5b4('0x25')](function(_0x2ab682){_0x598ba3[_0xa5b4('0x1e')]=_0x2ab682;if(_0x1646b7[_0xa5b4('0x33')]['includeAll']){_0x542cde[_0xa5b4('0x42')]=[{'all':!![]}];}return db[_0xa5b4('0x43')][_0xa5b4('0x44')](_0x542cde);})[_0xa5b4('0x25')](function(_0x55e87f){_0x598ba3['rows']=_0x55e87f;return _0x598ba3;})[_0xa5b4('0x25')](respondWithFilteredResult(_0x4c4f0b,_0x542cde))[_0xa5b4('0x45')](handleError(_0x4c4f0b,null));};exports[_0xa5b4('0x46')]=function(_0x1a7ca2,_0x3e51b3){var _0x20bc28={'raw':!![],'where':{'id':_0x1a7ca2[_0xa5b4('0x47')]['id']}},_0x5044fa={};_0x5044fa[_0xa5b4('0x32')]=_[_0xa5b4('0x34')](db[_0xa5b4('0x43')][_0xa5b4('0x2e')]);_0x5044fa[_0xa5b4('0x33')]=_[_0xa5b4('0x34')](_0x1a7ca2['query']);_0x5044fa[_0xa5b4('0x35')]=_['intersection'](_0x5044fa[_0xa5b4('0x32')],_0x5044fa[_0xa5b4('0x33')]);_0x20bc28[_0xa5b4('0x38')]=_[_0xa5b4('0x36')](_0x5044fa[_0xa5b4('0x32')],qs[_0xa5b4('0x37')](_0x1a7ca2['query'][_0xa5b4('0x37')]));_0x20bc28['attributes']=_0x20bc28['attributes']['length']?_0x20bc28[_0xa5b4('0x38')]:_0x5044fa[_0xa5b4('0x32')];if(_0x1a7ca2[_0xa5b4('0x33')]['includeAll']){_0x20bc28[_0xa5b4('0x42')]=[{'all':!![]}];}_0x20bc28=_['merge']({},_0x20bc28,_0x1a7ca2[_0xa5b4('0x41')]);return db[_0xa5b4('0x43')][_0xa5b4('0x48')](_0x20bc28)[_0xa5b4('0x25')](handleEntityNotFound(_0x3e51b3,null))[_0xa5b4('0x25')](respondWithResult(_0x3e51b3,null))[_0xa5b4('0x45')](handleError(_0x3e51b3,null));};exports['create']=function(_0x305752,_0xa0fdfc){return db[_0xa5b4('0x43')][_0xa5b4('0x49')](_0x305752[_0xa5b4('0x4a')],{})['then'](function(_0x4807ad){var _0x4787c5=_0x305752[_0xa5b4('0x4b')]['get']({'plain':!![]});if(!_0x4787c5)throw new Error(_0xa5b4('0x4c'));if(_0x4787c5[_0xa5b4('0x4d')]===_0xa5b4('0x4b')){var _0x530804=_0x4807ad[_0xa5b4('0x4e')]({'plain':!![]});var _0xa01a6='Pauses';return db[_0xa5b4('0x4f')][_0xa5b4('0x48')]({'where':{'name':_0xa01a6,'userProfileId':_0x4787c5[_0xa5b4('0x50')]},'raw':!![]})[_0xa5b4('0x25')](function(_0x56c943){if(_0x56c943&&_0x56c943[_0xa5b4('0x51')]===0x0){return db[_0xa5b4('0x27')][_0xa5b4('0x49')]({'name':_0x530804[_0xa5b4('0x2a')],'resourceId':_0x530804['id'],'type':_0x56c943[_0xa5b4('0x2a')],'sectionId':_0x56c943['id']},{})[_0xa5b4('0x25')](function(){return _0x4807ad;});}else{return _0x4807ad;}})[_0xa5b4('0x45')](function(_0x3f1474){logger['error'](_0xa5b4('0x52'),_0x3f1474);throw _0x3f1474;});}return _0x4807ad;})[_0xa5b4('0x25')](respondWithResult(_0xa0fdfc,0xc9))[_0xa5b4('0x45')](handleError(_0xa0fdfc,null));};exports[_0xa5b4('0x23')]=function(_0x1b567c,_0x581017){if(_0x1b567c[_0xa5b4('0x4a')]['id']){delete _0x1b567c['body']['id'];}return db['Pause'][_0xa5b4('0x48')]({'where':{'id':_0x1b567c[_0xa5b4('0x47')]['id']}})[_0xa5b4('0x25')](handleEntityNotFound(_0x581017,null))[_0xa5b4('0x25')](saveUpdates(_0x1b567c[_0xa5b4('0x4a')],null))[_0xa5b4('0x25')](respondWithResult(_0x581017,null))[_0xa5b4('0x45')](handleError(_0x581017,null));};exports[_0xa5b4('0x24')]=function(_0x392860,_0x5dcf3f){return db[_0xa5b4('0x43')][_0xa5b4('0x48')]({'where':{'id':_0x392860[_0xa5b4('0x47')]['id']}})[_0xa5b4('0x25')](handleEntityNotFound(_0x5dcf3f,null))[_0xa5b4('0x25')](removeEntity(_0x5dcf3f,null))[_0xa5b4('0x45')](handleError(_0x5dcf3f,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 20393d4..6e4c734 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 _0x7fbe=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x2515a3,_0x356de5){_0x2515a3=_0x2515a3-0x0;var _0xe8bbb=_0x7fbe[_0x2515a3];return _0xe8bbb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7fb('0x0'))(_0xe7fb('0x1'));var moment=require(_0xe7fb('0x2'));var BPromise=require(_0xe7fb('0x3'));var rp=require(_0xe7fb('0x4'));var fs=require('fs');var path=require(_0xe7fb('0x5'));var rimraf=require(_0xe7fb('0x6'));var config=require(_0xe7fb('0x7'));var attributes=require(_0xe7fb('0x8'));module[_0xe7fb('0x9')]=function(_0x290172,_0x12d1b0){return _0x290172[_0xe7fb('0xa')](_0xe7fb('0xb'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1cb9=['./pause.attributes','exports','define','Pause','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x53a07a,_0x3fd512){var _0x357f7a=function(_0x412876){while(--_0x412876){_0x53a07a['push'](_0x53a07a['shift']());}};_0x357f7a(++_0x3fd512);}(_0x1cb9,0x14e));var _0x91cb=function(_0x41a1ef,_0x3c4f9a){_0x41a1ef=_0x41a1ef-0x0;var _0x35815c=_0x1cb9[_0x41a1ef];return _0x35815c;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var logger=require(_0x91cb('0x1'))(_0x91cb('0x2'));var moment=require(_0x91cb('0x3'));var BPromise=require(_0x91cb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x91cb('0x5'));var rimraf=require(_0x91cb('0x6'));var config=require('../../config/environment');var attributes=require(_0x91cb('0x7'));module[_0x91cb('0x8')]=function(_0x186dc3,_0x28543e){return _0x186dc3[_0x91cb('0x9')](_0x91cb('0xa'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 18cf3ac..231207a 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(_0x2f8674,_0x5e9db6){var _0x424297=function(_0x5de99b){while(--_0x5de99b){_0x2f8674['push'](_0x2f8674['shift']());}};_0x424297(++_0x5e9db6);}(_0x7a54,0x106));var _0x47a5=function(_0x6a21c7,_0x2ea78a){_0x6a21c7=_0x6a21c7-0x0;var _0x450f69=_0x7a54[_0x6a21c7];return _0x450f69;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4fc59e,_0xfaa2b8){var _0x16e306=function(_0x5477c7){while(--_0x5477c7){_0x4fc59e['push'](_0x4fc59e['shift']());}};_0x16e306(++_0xfaa2b8);}(_0x7a54,0x106));var _0x47a5=function(_0x1c228e,_0x1721b7){_0x1c228e=_0x1c228e-0x0;var _0x2fe587=_0x7a54[_0x1c228e];return _0x2fe587;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Pause,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 8f5e9ff..6f19eb6 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 _0x4b84=['exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/webhook','get','show','/:id/download','download','diskStorage','join','root','originalname','replace','format','basename','now','extname','upload','webhookPost','/:id','isAuthenticated','delete'];(function(_0x3b3295,_0x5d28d9){var _0x28f5e6=function(_0x4403ec){while(--_0x4403ec){_0x3b3295['push'](_0x3b3295['shift']());}};_0x28f5e6(++_0x5d28d9);}(_0x4b84,0x1cc));var _0x44b8=function(_0x420f2a,_0x2cc58d){_0x420f2a=_0x420f2a-0x0;var _0x28f802=_0x4b84[_0x420f2a];return _0x28f802;};'use strict';var multer=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x44b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x44b8('0x3'));var interaction=require(_0x44b8('0x4'));var config=require(_0x44b8('0x5'));var controller=require('./plugin.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x44b8('0x6')]);router['get'](_0x44b8('0x7'),controller['webhookGet']);router[_0x44b8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x44b8('0x9')]);router[_0x44b8('0x8')](_0x44b8('0xa'),auth['isAuthenticated'](),controller[_0x44b8('0xb')]);var upload=multer({'storage':multer[_0x44b8('0xc')]({'destination':function(_0x4315f6,_0x9b6048,_0x24dd10){_0x24dd10(null,path[_0x44b8('0xd')](config[_0x44b8('0xe')],'server/files/plugins'));},'filename':function(_0x147529,_0x4301a6,_0x4bcc43){_0x4301a6[_0x44b8('0xf')]=_0x4301a6['originalname'][_0x44b8('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4bcc43(null,util[_0x44b8('0x11')]('%s-%s%s',path[_0x44b8('0x12')](_0x4301a6['originalname'],path['extname'](_0x4301a6[_0x44b8('0xf')])),Date[_0x44b8('0x13')](),path[_0x44b8('0x14')](_0x4301a6[_0x44b8('0xf')])));}})});router['post']('/',upload['single']('file'),controller[_0x44b8('0x15')]);router['post'](_0x44b8('0x7'),controller[_0x44b8('0x16')]);router['put'](_0x44b8('0x17'),auth[_0x44b8('0x18')](),controller['update']);router[_0x44b8('0x19')](_0x44b8('0x17'),auth['isAuthenticated'](),controller[_0x44b8('0x19')]);module[_0x44b8('0x1a')]=router; \ No newline at end of file +var _0x68fc=['webhookPost','put','update','delete','exports','multer','util','path','Router','../../components/auth/service','./plugin.controller','get','isAuthenticated','index','webhookGet','/:id','show','/:id/download','download','diskStorage','join','root','server/files/plugins','originalname','replace','%s-%s%s','basename','extname','now','post','upload','/webhook'];(function(_0x22c965,_0x3bc990){var _0x47284e=function(_0x477f20){while(--_0x477f20){_0x22c965['push'](_0x22c965['shift']());}};_0x47284e(++_0x3bc990);}(_0x68fc,0xa5));var _0xc68f=function(_0x4ddb0b,_0x239b05){_0x4ddb0b=_0x4ddb0b-0x0;var _0x5168ec=_0x68fc[_0x4ddb0b];return _0x5168ec;};'use strict';var multer=require(_0xc68f('0x0'));var util=require(_0xc68f('0x1'));var path=require(_0xc68f('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc68f('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc68f('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc68f('0x5'));router[_0xc68f('0x6')]('/',auth[_0xc68f('0x7')](),controller[_0xc68f('0x8')]);router['get']('/webhook',controller[_0xc68f('0x9')]);router[_0xc68f('0x6')](_0xc68f('0xa'),auth[_0xc68f('0x7')](),controller[_0xc68f('0xb')]);router[_0xc68f('0x6')](_0xc68f('0xc'),auth[_0xc68f('0x7')](),controller[_0xc68f('0xd')]);var upload=multer({'storage':multer[_0xc68f('0xe')]({'destination':function(_0x5777f9,_0x3b1a43,_0x29f1fe){_0x29f1fe(null,path[_0xc68f('0xf')](config[_0xc68f('0x10')],_0xc68f('0x11')));},'filename':function(_0x2a0a52,_0x3ccebe,_0x41aeb8){_0x3ccebe[_0xc68f('0x12')]=_0x3ccebe[_0xc68f('0x12')][_0xc68f('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x41aeb8(null,util['format'](_0xc68f('0x14'),path[_0xc68f('0x15')](_0x3ccebe[_0xc68f('0x12')],path[_0xc68f('0x16')](_0x3ccebe[_0xc68f('0x12')])),Date[_0xc68f('0x17')](),path[_0xc68f('0x16')](_0x3ccebe[_0xc68f('0x12')])));}})});router[_0xc68f('0x18')]('/',upload['single']('file'),controller[_0xc68f('0x19')]);router[_0xc68f('0x18')](_0xc68f('0x1a'),controller[_0xc68f('0x1b')]);router[_0xc68f('0x1c')](_0xc68f('0xa'),auth['isAuthenticated'](),controller[_0xc68f('0x1d')]);router[_0xc68f('0x1e')](_0xc68f('0xa'),auth[_0xc68f('0x7')](),controller[_0xc68f('0x1e')]);module[_0xc68f('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 a59aa43..81d9800 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 _0x06f2=['exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x5302a3,_0x584e65){var _0x4c229c=function(_0x347d2c){while(--_0x347d2c){_0x5302a3['push'](_0x5302a3['shift']());}};_0x4c229c(++_0x584e65);}(_0x06f2,0x1a4));var _0x206f=function(_0x2a6d8c,_0x20c7ea){_0x2a6d8c=_0x2a6d8c-0x0;var _0x4a1340=_0x06f2[_0x2a6d8c];return _0x4a1340;};'use strict';var Sequelize=require('sequelize');module[_0x206f('0x0')]={'name':{'type':Sequelize[_0x206f('0x1')]},'type':{'type':Sequelize[_0x206f('0x2')](_0x206f('0x3'),_0x206f('0x4'))},'description':{'type':Sequelize[_0x206f('0x5')]},'version':{'type':Sequelize[_0x206f('0x5')]},'path':{'type':Sequelize[_0x206f('0x1')],'comment':_0x206f('0x6')},'active':{'type':Sequelize[_0x206f('0x7')],'defaultValue':0x0,'comment':_0x206f('0x8')},'sidebar':{'type':Sequelize[_0x206f('0x2')](_0x206f('0x9'),'agentOnly','always',_0x206f('0xa')),'defaultValue':'always','comment':_0x206f('0xb')},'icon':{'type':Sequelize[_0x206f('0x1')]},'adminUrl':{'type':Sequelize[_0x206f('0x1')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x206f('0x1')]},'scriptPath':{'type':Sequelize[_0x206f('0x1')]}}; \ No newline at end of file +var _0xb4f9=['exports','ENUM','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x288449,_0x223038){var _0x2bd5e3=function(_0x4006ed){while(--_0x4006ed){_0x288449['push'](_0x288449['shift']());}};_0x2bd5e3(++_0x223038);}(_0xb4f9,0x14f));var _0x9b4f=function(_0x4ba2d2,_0x9f2ef){_0x4ba2d2=_0x4ba2d2-0x0;var _0x179cc9=_0xb4f9[_0x4ba2d2];return _0x179cc9;};'use strict';var Sequelize=require(_0x9b4f('0x0'));module[_0x9b4f('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x9b4f('0x2')](_0x9b4f('0x3'),'script')},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x9b4f('0x4')]},'path':{'type':Sequelize[_0x9b4f('0x5')],'comment':_0x9b4f('0x6')},'active':{'type':Sequelize[_0x9b4f('0x7')],'defaultValue':0x0,'comment':_0x9b4f('0x8')},'sidebar':{'type':Sequelize[_0x9b4f('0x2')](_0x9b4f('0x9'),_0x9b4f('0xa'),'always',_0x9b4f('0xb')),'defaultValue':_0x9b4f('0xc'),'comment':_0x9b4f('0xd')},'icon':{'type':Sequelize[_0x9b4f('0x5')]},'adminUrl':{'type':Sequelize[_0x9b4f('0x5')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x9b4f('0x5')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 0370cdd..4ba6565 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 _0x047f=['filters','merge','VIRTUAL','filter','options','includeAll','include','Plugin','catch','show','params','length','find','root','format','%s.zip','basename','createWriteStream','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','join','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Temporary\x20file\x20removed','upload','file','filename','extname','server/files/plugins','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','readdirSync','Invalid\x20plugin\x20structure','lstatSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','body','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','set','endsWith','statusCode','webhookPost','resolve','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','extract-zip','rimraf','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./plugin.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','get','Plugins','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xee1d9d,_0x54c128){var _0x11b785=function(_0x3190e3){while(--_0x3190e3){_0xee1d9d['push'](_0xee1d9d['shift']());}};_0x11b785(++_0x54c128);}(_0x047f,0x1cc));var _0xf047=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x047f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf047('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf047('0x1'));var jsonpatch=require(_0xf047('0x2'));var rp=require(_0xf047('0x3'));var moment=require(_0xf047('0x4'));var BPromise=require(_0xf047('0x5'));var Mustache=require(_0xf047('0x6'));var util=require(_0xf047('0x7'));var path=require(_0xf047('0x8'));var sox=require(_0xf047('0x9'));var csv=require(_0xf047('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf047('0xb'));var squel=require(_0xf047('0xc'));var crypto=require(_0xf047('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf047('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf047('0xf'));var extract=require(_0xf047('0x10'));var rimraf=require(_0xf047('0x11'));var archiver=require(_0xf047('0x12'));var Redis=require(_0xf047('0x13'));var authService=require(_0xf047('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xf047('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf047('0x16'))(_0xf047('0x17'));var utils=require(_0xf047('0x18'));var config=require(_0xf047('0x19'));var licenseUtil=require(_0xf047('0x1a'));var db=require(_0xf047('0x1b'))['db'];config[_0xf047('0x1c')]=_['defaults'](config[_0xf047('0x1c')],{'host':_0xf047('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf047('0x1c')]));require(_0xf047('0x1e'))[_0xf047('0x1f')](socket);function respondWithStatusCode(_0x3008d5,_0x2e5091){_0x2e5091=_0x2e5091||0xcc;return function(_0x23a204){if(_0x23a204){return _0x3008d5[_0xf047('0x20')](_0x2e5091);}return _0x3008d5[_0xf047('0x21')](_0x2e5091)[_0xf047('0x22')]();};}function respondWithResult(_0x2870b4,_0x22e8b7){_0x22e8b7=_0x22e8b7||0xc8;return function(_0x7d5d70){if(_0x7d5d70){return _0x2870b4['status'](_0x22e8b7)['json'](_0x7d5d70);}};}function respondWithFilteredResult(_0x12169c,_0x4c1c96){return function(_0x4e998f){if(_0x4e998f){var _0x3029c7=typeof _0x4c1c96[_0xf047('0x23')]===_0xf047('0x24')&&typeof _0x4c1c96['limit']===_0xf047('0x24');var _0x37b462=_0x4e998f[_0xf047('0x25')];var _0x34d8f6=_0x3029c7?0x0:_0x4c1c96['offset'];var _0x1907ab=_0x3029c7?_0x4e998f[_0xf047('0x25')]:_0x4c1c96[_0xf047('0x23')]+_0x4c1c96[_0xf047('0x26')];var _0x3fcf23;if(_0x1907ab>=_0x37b462){_0x1907ab=_0x37b462;_0x3fcf23=0xc8;}else{_0x3fcf23=0xce;}_0x12169c['status'](_0x3fcf23);return _0x12169c['set'](_0xf047('0x27'),_0x34d8f6+'-'+_0x1907ab+'/'+_0x37b462)[_0xf047('0x28')](_0x4e998f);}return null;};}function patchUpdates(_0x18c90c){return function(_0x1c64e8){try{jsonpatch[_0xf047('0x29')](_0x1c64e8,_0x18c90c,!![]);}catch(_0x17e535){return BPromise[_0xf047('0x2a')](_0x17e535);}return _0x1c64e8[_0xf047('0x2b')]();};}function saveUpdates(_0x4fcbe5,_0x413b84){return function(_0x51d8ad){if(_0x51d8ad){return _0x51d8ad[_0xf047('0x2c')](_0x4fcbe5)[_0xf047('0x2d')](function(_0x27ec60){return _0x27ec60;});}return null;};}function removeEntity(_0x1e632a,_0x138557){return function(_0x9807fe){if(_0x9807fe){return _0x9807fe['destroy']()[_0xf047('0x2d')](function(){var _0x3beb39=_0x9807fe[_0xf047('0x2e')]({'plain':!![]});var _0x53bea5=_0xf047('0x2f');return db['UserProfileResource'][_0xf047('0x30')]({'where':{'type':_0x53bea5,'resourceId':_0x3beb39['id']}})[_0xf047('0x2d')](function(){return _0x9807fe;});})[_0xf047('0x2d')](function(){_0x1e632a[_0xf047('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51dd96,_0x1077bf){return function(_0x4ee18c){if(!_0x4ee18c){_0x51dd96[_0xf047('0x20')](0x194);}return _0x4ee18c;};}function handleError(_0x3c8711,_0x3b7ef9){_0x3b7ef9=_0x3b7ef9||0x1f4;return function(_0x23f117){logger[_0xf047('0x31')](_0x23f117[_0xf047('0x32')]);if(_0x23f117[_0xf047('0x33')]){delete _0x23f117['name'];}_0x3c8711[_0xf047('0x21')](_0x3b7ef9)[_0xf047('0x34')](_0x23f117);};}exports[_0xf047('0x35')]=function(_0x50d129,_0x2384ec){var _0x17b9f2={},_0x5c5845={},_0x45fcac={'count':0x0,'rows':[]};var _0x4499e1=_[_0xf047('0x36')](db['Plugin'][_0xf047('0x37')],function(_0x476379){return{'name':_0x476379[_0xf047('0x38')],'type':_0x476379[_0xf047('0x39')][_0xf047('0x3a')]};});_0x5c5845[_0xf047('0x3b')]=_['map'](_0x4499e1,'name');_0x5c5845[_0xf047('0x3c')]=_[_0xf047('0x3d')](_0x50d129[_0xf047('0x3c')]);_0x5c5845['filters']=_[_0xf047('0x3e')](_0x5c5845[_0xf047('0x3b')],_0x5c5845[_0xf047('0x3c')]);_0x17b9f2[_0xf047('0x3f')]=_['intersection'](_0x5c5845[_0xf047('0x3b')],qs[_0xf047('0x40')](_0x50d129['query'][_0xf047('0x40')]));_0x17b9f2[_0xf047('0x3f')]=_0x17b9f2[_0xf047('0x3f')]['length']?_0x17b9f2[_0xf047('0x3f')]:_0x5c5845[_0xf047('0x3b')];if(!_0x50d129['query'][_0xf047('0x41')](_0xf047('0x42'))){_0x17b9f2[_0xf047('0x26')]=qs[_0xf047('0x26')](_0x50d129[_0xf047('0x3c')]['limit']);_0x17b9f2[_0xf047('0x23')]=qs[_0xf047('0x23')](_0x50d129[_0xf047('0x3c')]['offset']);}_0x17b9f2[_0xf047('0x43')]=qs['sort'](_0x50d129[_0xf047('0x3c')][_0xf047('0x44')]);_0x17b9f2[_0xf047('0x45')]=qs['filters'](_[_0xf047('0x46')](_0x50d129[_0xf047('0x3c')],_0x5c5845[_0xf047('0x47')]),_0x4499e1);if(_0x50d129['query']['filter']){_0x17b9f2['where']=_[_0xf047('0x48')](_0x17b9f2[_0xf047('0x45')],{'$or':_[_0xf047('0x36')](_0x4499e1,function(_0x1506b4){if(_0x1506b4[_0xf047('0x39')]!==_0xf047('0x49')){var _0x31b6d8={};_0x31b6d8[_0x1506b4[_0xf047('0x33')]]={'$like':'%'+_0x50d129[_0xf047('0x3c')][_0xf047('0x4a')]+'%'};return _0x31b6d8;}})});}_0x17b9f2=_[_0xf047('0x48')]({},_0x17b9f2,_0x50d129[_0xf047('0x4b')]);var _0x51dd6a={'where':_0x17b9f2[_0xf047('0x45')]};return db['Plugin'][_0xf047('0x25')](_0x51dd6a)['then'](function(_0x38cdea){_0x45fcac[_0xf047('0x25')]=_0x38cdea;if(_0x50d129[_0xf047('0x3c')][_0xf047('0x4c')]){_0x17b9f2[_0xf047('0x4d')]=[{'all':!![]}];}return db[_0xf047('0x4e')]['findAll'](_0x17b9f2);})[_0xf047('0x2d')](function(_0x346067){_0x45fcac['rows']=_0x346067;return _0x45fcac;})[_0xf047('0x2d')](respondWithFilteredResult(_0x2384ec,_0x17b9f2))[_0xf047('0x4f')](handleError(_0x2384ec,null));};exports[_0xf047('0x50')]=function(_0x58b2a1,_0x420125){var _0x1edb84={'raw':!![],'where':{'id':_0x58b2a1[_0xf047('0x51')]['id']}},_0x3f420b={};_0x3f420b[_0xf047('0x3b')]=_['keys'](db[_0xf047('0x4e')][_0xf047('0x37')]);_0x3f420b['query']=_[_0xf047('0x3d')](_0x58b2a1[_0xf047('0x3c')]);_0x3f420b[_0xf047('0x47')]=_[_0xf047('0x3e')](_0x3f420b['model'],_0x3f420b[_0xf047('0x3c')]);_0x1edb84[_0xf047('0x3f')]=_[_0xf047('0x3e')](_0x3f420b[_0xf047('0x3b')],qs[_0xf047('0x40')](_0x58b2a1[_0xf047('0x3c')][_0xf047('0x40')]));_0x1edb84['attributes']=_0x1edb84[_0xf047('0x3f')][_0xf047('0x52')]?_0x1edb84[_0xf047('0x3f')]:_0x3f420b[_0xf047('0x3b')];if(_0x58b2a1[_0xf047('0x3c')][_0xf047('0x4c')]){_0x1edb84[_0xf047('0x4d')]=[{'all':!![]}];}_0x1edb84=_['merge']({},_0x1edb84,_0x58b2a1[_0xf047('0x4b')]);return db[_0xf047('0x4e')][_0xf047('0x53')](_0x1edb84)[_0xf047('0x2d')](handleEntityNotFound(_0x420125,null))[_0xf047('0x2d')](respondWithResult(_0x420125,null))['catch'](handleError(_0x420125,null));};exports['download']=function(_0x407655,_0x21bb54,_0x485cc1){return db[_0xf047('0x4e')]['find']({'where':{'id':_0x407655[_0xf047('0x51')]['id']},'attributes':[_0xf047('0x33'),_0xf047('0x8')],'raw':!![]})['then'](handleEntityNotFound(_0x21bb54,null))[_0xf047('0x2d')](function(_0x2f7b34){if(_0x2f7b34){var _0x487f66=path['join'](config[_0xf047('0x54')],'server/files/plugins',util[_0xf047('0x55')](_0xf047('0x56'),path[_0xf047('0x57')](_0x2f7b34[_0xf047('0x8')])));var _0x568507=fs[_0xf047('0x58')](_0x487f66);var _0x1729f5=archiver('zip',{'zlib':{'level':0x9}});_0x1729f5['on'](_0xf047('0x59'),function(_0x13d7eb){if(_0x13d7eb[_0xf047('0x5a')]===_0xf047('0x5b')){logger['error'](_0x13d7eb);}else{throw new db[(_0xf047('0x5c'))][(_0xf047('0x5d'))](_0xf047('0x5e'));}});_0x1729f5['on'](_0xf047('0x31'),function(_0x495394){throw new db[(_0xf047('0x5c'))][(_0xf047('0x5d'))](_0xf047('0x5e'));});_0x1729f5['pipe'](_0x568507);_0x1729f5[_0xf047('0x5f')](_0xf047('0x60'),{'cwd':path['join'](config[_0xf047('0x54')],'server/files/plugins',path[_0xf047('0x61')](_0x2f7b34[_0xf047('0x8')])),'ignore':[path[_0xf047('0x62')](path['basename'](_0x2f7b34[_0xf047('0x8')]),'node_modules/**/*'),path[_0xf047('0x62')](path['basename'](_0x2f7b34[_0xf047('0x8')]),_0xf047('0x63'))],'nodir':!![]})[_0xf047('0x64')]();_0x568507['on'](_0xf047('0x65'),function(){if(!fs[_0xf047('0x66')](_0x487f66)){throw new db[(_0xf047('0x5c'))][(_0xf047('0x5d'))](_0xf047('0x67'));}return _0x21bb54[_0xf047('0x68')](_0x487f66,util[_0xf047('0x55')](_0xf047('0x56'),path['basename'](_0x2f7b34['path'])),function(_0x2c8aed){if(_0x2c8aed){throw new db['Sequelize'][(_0xf047('0x5d'))](_0xf047('0x69'));}fs[_0xf047('0x6a')](_0x487f66);logger[_0xf047('0x6b')]('Download\x20completed');logger['info'](_0xf047('0x6c'));});});}return null;})[_0xf047('0x4f')](handleError(_0x21bb54,null));};exports[_0xf047('0x6d')]=function(_0x4e110b,_0x473fbb,_0x4d2d91){var _0x548b4a=path['basename'](_0x4e110b[_0xf047('0x6e')][_0xf047('0x6f')],path[_0xf047('0x70')](_0x4e110b[_0xf047('0x6e')][_0xf047('0x6f')]));var _0x335dad=path[_0xf047('0x62')](config[_0xf047('0x54')],'server/files/plugins',_0x4e110b['file'][_0xf047('0x6f')]);var _0x4a6e4f=path[_0xf047('0x62')](config[_0xf047('0x54')],_0xf047('0x71'),_0x548b4a);logger[_0xf047('0x6b')](_0xf047('0x72'),_0x335dad);logger['info'](_0xf047('0x73'),_0x4a6e4f);try{fs['chmodSync'](_0x335dad,parseInt('0777',0x8));extract(_0x335dad,{'dir':_0x4a6e4f},function(_0x218a51){if(_0x218a51){logger[_0xf047('0x31')](_0x218a51);handleError(_0x218a51,!![]);};var _0x83c1a8=fs[_0xf047('0x74')](_0x4a6e4f);if(_0x83c1a8['length']>0x1){removeReferences(_0x335dad,_0x4a6e4f);logger['error'](_0xf047('0x75'));return _0x4d2d91(new Error('Invalid\x20plugin\x20structure'));}var _0xd1bec8=fs[_0xf047('0x76')](path['join'](_0x4a6e4f,_0x83c1a8[0x0]));if(_0xd1bec8['isFile']()){removeReferences(_0x335dad,_0x4a6e4f);logger[_0xf047('0x31')](_0xf047('0x75'));return _0x4d2d91(new Error(_0xf047('0x75')));}if(_0xd1bec8['isDirectory']()){var _0x16dd66=fs[_0xf047('0x74')](path[_0xf047('0x62')](_0x4a6e4f,_0x83c1a8[0x0]));if(_0x16dd66[_0xf047('0x52')]===0x0){removeReferences(_0x335dad,_0x4a6e4f);logger[_0xf047('0x31')](_0xf047('0x75'));return _0x4d2d91(new Error(_0xf047('0x75')));}var _0x3ce3b2=_0x16dd66[_0xf047('0x77')](function(_0x6d8ac){return _0x6d8ac===_0xf047('0x78');});if(!_0x3ce3b2){return _0x4d2d91(new Error(_0xf047('0x79')));}var _0x3b43e7=fs[_0xf047('0x7a')](path[_0xf047('0x62')](_0x4a6e4f,_0x83c1a8[0x0],_0xf047('0x78')));var _0x3ea3c8=JSON['parse'](_0x3b43e7);if(_0xf047('0x24')==typeof _0x3ea3c8[_0xf047('0x33')]){return _0x4d2d91(new Error(_0xf047('0x7b')));}if(_0xf047('0x24')==typeof _0x3ea3c8[_0xf047('0x39')]){return _0x4d2d91(new Error(_0xf047('0x7c')));}if('undefined'==typeof _0x3ea3c8['version']){return _0x4d2d91(new Error(_0xf047('0x7d')));}if(_0xf047('0x24')==typeof _0x3ea3c8['parameters']){return _0x4d2d91(new Error(_0xf047('0x7e')));}if(_0x3ea3c8[_0xf047('0x39')]===_0xf047('0x7f')){if('undefined'==typeof _0x3ea3c8[_0xf047('0x80')][_0xf047('0x81')]){return _0x4d2d91(new Error(_0xf047('0x82')));}if(_0xf047('0x24')==typeof _0x3ea3c8[_0xf047('0x80')][_0xf047('0x81')]['admin']&&_0xf047('0x24')==typeof _0x3ea3c8[_0xf047('0x80')][_0xf047('0x81')][_0xf047('0x83')]){return _0x4d2d91(new Error(_0xf047('0x84')));}}else if(_0x3ea3c8['type']==='script'){if('undefined'==typeof _0x3ea3c8['parameters']['scriptName']){return _0x4d2d91(new Error(_0xf047('0x85')));}if('undefined'==typeof _0x3ea3c8[_0xf047('0x80')][_0xf047('0x86')]){return _0x4d2d91(new Error(_0xf047('0x87')));}}else{return _0x4d2d91(new Error(_0xf047('0x88')));}var _0x5065d5=_0x3ea3c8[_0xf047('0x33')];var _0x148f76=_0x3ea3c8[_0xf047('0x89')];var _0x477c86=_0x3ea3c8['type'];var _0x2c8475=_0x3ea3c8['sidebar']?_0x3ea3c8[_0xf047('0x8a')]:_0xf047('0x8b');var _0x44af07=_0x3ea3c8['icon']?_0x3ea3c8[_0xf047('0x8c')]:_0xf047('0x8d');var _0x2b5025='';var _0xb2952b='';var _0x45c5ea='';var _0x30967d='';var _0x415f67=_0x3ea3c8[_0xf047('0x8e')];if(_0x477c86==='html'){if(_0xf047('0x24')!=typeof _0x3ea3c8[_0xf047('0x80')][_0xf047('0x81')][_0xf047('0x8f')]){var _0x1ea5d5=_0x3ea3c8['parameters'][_0xf047('0x81')][_0xf047('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xf047('0x90')](_0x1ea5d5)){_0x2b5025=path[_0xf047('0x62')](_0xf047('0x91'),_0x548b4a,_0x83c1a8[0x0],_0x1ea5d5);}else{_0x2b5025=_0x1ea5d5;}}else{logger[_0xf047('0x6b')](_0xf047('0x92'));}if(_0xf047('0x24')!=typeof _0x3ea3c8['parameters']['views'][_0xf047('0x83')]){var _0x3b9dd1=_0x3ea3c8['parameters'][_0xf047('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf047('0x90')](_0x3b9dd1)){_0xb2952b=path[_0xf047('0x62')](_0xf047('0x91'),_0x548b4a,_0x83c1a8[0x0],_0x3b9dd1);}else{_0xb2952b=_0x3b9dd1;}}else{logger['info'](_0xf047('0x93'));}}else if(_0x477c86===_0xf047('0x94')){_0x45c5ea=_0x3ea3c8[_0xf047('0x80')][_0xf047('0x95')];_0x30967d=_0x3ea3c8[_0xf047('0x80')][_0xf047('0x86')];if(_0xf047('0x24')!=typeof _0x3ea3c8['parameters'][_0xf047('0x81')]){if(_0xf047('0x24')!=typeof _0x3ea3c8[_0xf047('0x80')]['views']['admin']){var _0x1ea5d5=_0x3ea3c8[_0xf047('0x80')]['views'][_0xf047('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0xf047('0x90')](_0x1ea5d5)){_0x2b5025=path['join']('plugins',_0x548b4a,_0x83c1a8[0x0],_0x1ea5d5);}else{_0x2b5025=_0x1ea5d5;}}if(_0xf047('0x24')!=typeof _0x3ea3c8[_0xf047('0x80')]['views']['agent']){var _0x3b9dd1=_0x3ea3c8[_0xf047('0x80')][_0xf047('0x81')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xf047('0x90')](_0x3b9dd1)){_0xb2952b=path[_0xf047('0x62')](_0xf047('0x91'),_0x548b4a,_0x83c1a8[0x0],_0x3b9dd1);}else{_0xb2952b=_0x3b9dd1;}}}}var _0x22481e={'name':_0x5065d5,'description':_0x148f76,'path':path['join'](_0x548b4a,_0x83c1a8[0x0]),'type':_0x477c86,'sidebar':_0x2c8475,'icon':_0x44af07,'adminUrl':_0x2b5025,'agentUrl':_0xb2952b,'scriptName':_0x45c5ea,'scriptPath':_0x30967d,'version':_0x415f67};removeReferences(_0x335dad,null);return db['Plugin'][_0xf047('0x96')](_0x22481e)[_0xf047('0x2d')](function(_0x1ecd7f){var _0x1c95e1={'role':_0x4e110b[_0xf047('0x97')][_0xf047('0x98')],'userProfileId':_0x4e110b[_0xf047('0x97')]['userProfileId']};if(!_0x1c95e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1c95e1[_0xf047('0x98')]===_0xf047('0x99')){var _0x2a3ae0=_0x1ecd7f[_0xf047('0x2e')]({'plain':!![]});return db[_0xf047('0x9a')]['find']({'where':{'name':_0xf047('0x2f'),'userProfileId':_0x1c95e1[_0xf047('0x9b')]},'raw':!![]})['then'](function(_0x1fbb5b){if(_0x1fbb5b&&_0x1fbb5b[_0xf047('0x9c')]===0x0){return db[_0xf047('0x9d')][_0xf047('0x96')]({'name':_0x2a3ae0[_0xf047('0x33')],'resourceId':_0x2a3ae0['id'],'type':_0x1fbb5b[_0xf047('0x33')],'sectionId':_0x1fbb5b['id']},{})[_0xf047('0x2d')](function(){return _0x1ecd7f;});}else{return _0x1ecd7f;}})[_0xf047('0x4f')](function(_0x166c11){logger[_0xf047('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x166c11);throw _0x166c11;});}return _0x1ecd7f;})['then'](respondWithResult(_0x473fbb,null))[_0xf047('0x4f')](handleError(_0x473fbb,null));}});}catch(_0x521de1){_0x473fbb[_0xf047('0x21')](0x1f4)['send'](_0x521de1);}};function removeReferences(_0x339d87,_0x3e0b89){try{if(_0x339d87){fs[_0xf047('0x6a')](_0x339d87);logger[_0xf047('0x6b')](_0xf047('0x9e'));}if(_0x3e0b89){rimraf(_0x3e0b89,function(){});logger['info'](_0xf047('0x9f'));}}catch(_0x4ec6c8){logger[_0xf047('0x31')](_0x4ec6c8);}}exports[_0xf047('0x2c')]=function(_0x373696,_0xe1f20,_0x268932){return db[_0xf047('0x4e')]['find']({'where':{'id':_0x373696['params']['id']}})[_0xf047('0x2d')](handleEntityNotFound(_0xe1f20,null))[_0xf047('0x2d')](saveUpdates(_0x373696['body'],null))[_0xf047('0x2d')](respondWithResult(_0xe1f20,null))[_0xf047('0x4f')](handleError(_0xe1f20,null));};exports[_0xf047('0xa0')]=function(_0x5df31e,_0x4a543e,_0x552e74){return db[_0xf047('0x4e')][_0xf047('0x53')]({'where':{'id':_0x5df31e[_0xf047('0x51')]['id']}})['then'](function(_0x1fed36){if(_0x1fed36){return _0x1fed36[_0xf047('0x30')]();}})[_0xf047('0x2d')](function(_0x30ad87){rimraf(path['join'](config[_0xf047('0x54')],_0xf047('0x71'),path[_0xf047('0x61')](_0x30ad87['path'])),function(){});return _0x30ad87;})[_0xf047('0x2d')](handleEntityNotFound(_0x4a543e,null))[_0xf047('0x2d')](respondWithStatusCode(_0x4a543e,null))['catch'](handleError(_0x4a543e,null));};exports['webhookGet']=function(_0x2e272f,_0x3bc789,_0x1b3a9b){return BPromise['resolve']()[_0xf047('0x2d')](function(){if(!_0x2e272f[_0xf047('0x3c')][_0xf047('0x8')]){throw new Error(_0xf047('0xa1'));}if(!_0x2e272f['query'][_0xf047('0xa2')]){throw new Error(_0xf047('0xa3'));}var _0x2e0d32=_0x2e272f[_0xf047('0x3c')][_0xf047('0xa4')]?_0x2e272f[_0xf047('0x3c')][_0xf047('0xa4')]+':'+_0x2e272f[_0xf047('0x3c')][_0xf047('0xa2')]:_0xf047('0xa5')+_0x2e272f[_0xf047('0x3c')][_0xf047('0xa2')];var _0x36d417=_0x2e272f[_0xf047('0x3c')][_0xf047('0x28')]?_0x2e272f['query'][_0xf047('0x28')]:!![];var _0x8eb569=_0x2e272f[_0xf047('0x3c')]['encoding']?_0x2e272f[_0xf047('0x3c')][_0xf047('0xa6')]:null;var _0x136f49={'method':_0x2e272f[_0xf047('0xa7')],'uri':util[_0xf047('0x55')](_0xf047('0xa8'),_0x2e0d32,_0x2e272f[_0xf047('0x3c')]['path']),'json':_0x36d417,'resolveWithFullResponse':!![],'encoding':_0x8eb569,'qs':_0x2e272f[_0xf047('0x3c')]};if(_0x2e272f[_0xf047('0xa9')]){_0x136f49[_0xf047('0xa9')]=_0x2e272f['headers'];if(_0x136f49[_0xf047('0xa9')][_0xf047('0xaa')]){delete _0x136f49[_0xf047('0xa9')][_0xf047('0xaa')];}}if(_0x136f49[_0xf047('0xa9')][_0xf047('0xab')]){delete _0x136f49[_0xf047('0xa9')][_0xf047('0xab')];}return rp(_0x136f49);})['then'](function(_0x50b1e8){if(_0x50b1e8){_0x3bc789[_0xf047('0xac')](_0x50b1e8[_0xf047('0xa9')]);logger[_0xf047('0x6b')](_0x50b1e8[_0xf047('0x97')]);if(_[_0xf047('0xad')](_0x2e272f[_0xf047('0x3c')][_0xf047('0x8')],_0xf047('0x68'))&&_0x50b1e8[_0xf047('0xae')]==0x1f4){return _0x3bc789['sendStatus'](_0x50b1e8[_0xf047('0xae')]);}else{return _0x3bc789[_0xf047('0x21')](_0x50b1e8[_0xf047('0xae')])[_0xf047('0x34')](_0x50b1e8[_0xf047('0x97')]);}}else{return _0x3bc789[_0xf047('0x20')](0xc8);}})[_0xf047('0x4f')](handleError(_0x3bc789,null));};exports[_0xf047('0xaf')]=function(_0x52a142,_0x3840b0,_0x423d33){return BPromise[_0xf047('0xb0')]()[_0xf047('0x2d')](function(){if(!_0x52a142['query'][_0xf047('0x8')]){throw new Error(_0xf047('0xa1'));}if(!_0x52a142[_0xf047('0x3c')][_0xf047('0xa2')]){throw new Error(_0xf047('0xa3'));}var _0x66f26e=_0x52a142['query'][_0xf047('0xa4')]?_0x52a142['query'][_0xf047('0xa4')]+':'+_0x52a142[_0xf047('0x3c')][_0xf047('0xa2')]:_0xf047('0xa5')+_0x52a142['query']['port'];var _0x575b73=_0x52a142[_0xf047('0x3c')][_0xf047('0x28')]?_0x52a142[_0xf047('0x3c')][_0xf047('0x28')]:!![];var _0x31665e=_0x52a142['query'][_0xf047('0xa6')]?_0x52a142[_0xf047('0x3c')]['encoding']:null;var _0x27f338={'method':_0x52a142[_0xf047('0xa7')],'uri':util[_0xf047('0x55')](_0xf047('0xa8'),_0x66f26e,_0x52a142[_0xf047('0x3c')][_0xf047('0x8')]),'json':_0x575b73,'resolveWithFullResponse':!![],'encoding':_0x31665e,'body':_0x52a142[_0xf047('0x97')]};if(_0x52a142['headers']){_0x27f338[_0xf047('0xa9')]=_0x52a142['headers'];if(_0x27f338[_0xf047('0xa9')][_0xf047('0xaa')]){delete _0x27f338['headers'][_0xf047('0xaa')];}}if(_0x27f338[_0xf047('0xa9')][_0xf047('0xab')]){delete _0x27f338[_0xf047('0xa9')][_0xf047('0xab')];}return rp(_0x27f338);})[_0xf047('0x2d')](function(_0x1ac1c3){if(_0x1ac1c3){_0x3840b0[_0xf047('0xac')](_0x1ac1c3['headers']);logger[_0xf047('0x6b')](_0x1ac1c3[_0xf047('0x97')]);return _0x3840b0[_0xf047('0x21')](_0x1ac1c3[_0xf047('0xae')])['send'](_0x1ac1c3['body']);}else{return _0x3840b0[_0xf047('0x20')](0xc8);}})[_0xf047('0x4f')](handleError(_0x3840b0,null));}; \ No newline at end of file +var _0x2fd2=['test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','body','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','statusCode','sendStatus','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','%s%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','rimraf','archiver','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./plugin.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','reject','then','destroy','get','Plugins','name','send','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','Plugin','includeAll','include','findAll','catch','show','params','keys','find','download','join','root','server/files/plugins','format','basename','createWriteStream','zip','code','ENOENT','error','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','%s.zip','info','Download\x20completed','Temporary\x20file\x20removed','upload','filename','file','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','readFileSync','parse','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','version','html'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x2fd2,0xc1));var _0x22fd=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x2fd2[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x22fd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22fd('0x1'));var jsonpatch=require(_0x22fd('0x2'));var rp=require(_0x22fd('0x3'));var moment=require(_0x22fd('0x4'));var BPromise=require(_0x22fd('0x5'));var Mustache=require(_0x22fd('0x6'));var util=require('util');var path=require(_0x22fd('0x7'));var sox=require(_0x22fd('0x8'));var csv=require('to-csv');var ejs=require(_0x22fd('0x9'));var fs=require('fs');var fs_extra=require(_0x22fd('0xa'));var _=require(_0x22fd('0xb'));var squel=require(_0x22fd('0xc'));var crypto=require('crypto');var jsforce=require(_0x22fd('0xd'));var deskjs=require(_0x22fd('0xe'));var toCsv=require('to-csv');var querystring=require(_0x22fd('0xf'));var Papa=require(_0x22fd('0x10'));var extract=require('extract-zip');var rimraf=require(_0x22fd('0x11'));var archiver=require(_0x22fd('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x22fd('0x13'));var as=require(_0x22fd('0x14'));var hardwareService=require(_0x22fd('0x15'));var logger=require(_0x22fd('0x16'))(_0x22fd('0x17'));var utils=require(_0x22fd('0x18'));var config=require(_0x22fd('0x19'));var licenseUtil=require(_0x22fd('0x1a'));var db=require('../../mysqldb')['db'];config[_0x22fd('0x1b')]=_[_0x22fd('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x22fd('0x1d'))(new Redis(config[_0x22fd('0x1b')]));require(_0x22fd('0x1e'))[_0x22fd('0x1f')](socket);function respondWithStatusCode(_0x1be223,_0x5dca0e){_0x5dca0e=_0x5dca0e||0xcc;return function(_0x59771e){if(_0x59771e){return _0x1be223['sendStatus'](_0x5dca0e);}return _0x1be223[_0x22fd('0x20')](_0x5dca0e)['end']();};}function respondWithResult(_0x4df3c5,_0x182fdc){_0x182fdc=_0x182fdc||0xc8;return function(_0x5bd130){if(_0x5bd130){return _0x4df3c5[_0x22fd('0x20')](_0x182fdc)[_0x22fd('0x21')](_0x5bd130);}};}function respondWithFilteredResult(_0x28480c,_0x3f3532){return function(_0x473deb){if(_0x473deb){var _0x170a84=typeof _0x3f3532['offset']==='undefined'&&typeof _0x3f3532[_0x22fd('0x22')]===_0x22fd('0x23');var _0x1a3111=_0x473deb[_0x22fd('0x24')];var _0x58d3d3=_0x170a84?0x0:_0x3f3532['offset'];var _0x41af92=_0x170a84?_0x473deb['count']:_0x3f3532[_0x22fd('0x25')]+_0x3f3532[_0x22fd('0x22')];var _0x83f000;if(_0x41af92>=_0x1a3111){_0x41af92=_0x1a3111;_0x83f000=0xc8;}else{_0x83f000=0xce;}_0x28480c[_0x22fd('0x20')](_0x83f000);return _0x28480c[_0x22fd('0x26')](_0x22fd('0x27'),_0x58d3d3+'-'+_0x41af92+'/'+_0x1a3111)[_0x22fd('0x21')](_0x473deb);}return null;};}function patchUpdates(_0x1f4de6){return function(_0x270bfa){try{jsonpatch['apply'](_0x270bfa,_0x1f4de6,!![]);}catch(_0x37dc30){return BPromise[_0x22fd('0x28')](_0x37dc30);}return _0x270bfa['save']();};}function saveUpdates(_0x36eef1,_0x57d451){return function(_0x39c041){if(_0x39c041){return _0x39c041['update'](_0x36eef1)[_0x22fd('0x29')](function(_0x55078f){return _0x55078f;});}return null;};}function removeEntity(_0x1bc47e,_0x3e6d83){return function(_0xd4dd8b){if(_0xd4dd8b){return _0xd4dd8b[_0x22fd('0x2a')]()[_0x22fd('0x29')](function(){var _0x8f6c7c=_0xd4dd8b[_0x22fd('0x2b')]({'plain':!![]});var _0x5e7afb=_0x22fd('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x5e7afb,'resourceId':_0x8f6c7c['id']}})[_0x22fd('0x29')](function(){return _0xd4dd8b;});})[_0x22fd('0x29')](function(){_0x1bc47e[_0x22fd('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bdc91,_0x36b1b){return function(_0x558f49){if(!_0x558f49){_0x1bdc91['sendStatus'](0x194);}return _0x558f49;};}function handleError(_0x1186fe,_0x31cc14){_0x31cc14=_0x31cc14||0x1f4;return function(_0x8f83aa){logger['error'](_0x8f83aa['stack']);if(_0x8f83aa['name']){delete _0x8f83aa[_0x22fd('0x2d')];}_0x1186fe['status'](_0x31cc14)[_0x22fd('0x2e')](_0x8f83aa);};}exports[_0x22fd('0x2f')]=function(_0x3ac8ad,_0x36c27a){var _0x3c0404={},_0x5d2f5a={},_0xdd1999={'count':0x0,'rows':[]};var _0xdf48b5=_[_0x22fd('0x30')](db['Plugin'][_0x22fd('0x31')],function(_0x2b1f9c){return{'name':_0x2b1f9c['fieldName'],'type':_0x2b1f9c[_0x22fd('0x32')][_0x22fd('0x33')]};});_0x5d2f5a['model']=_[_0x22fd('0x30')](_0xdf48b5,_0x22fd('0x2d'));_0x5d2f5a[_0x22fd('0x34')]=_['keys'](_0x3ac8ad['query']);_0x5d2f5a[_0x22fd('0x35')]=_[_0x22fd('0x36')](_0x5d2f5a[_0x22fd('0x37')],_0x5d2f5a[_0x22fd('0x34')]);_0x3c0404[_0x22fd('0x38')]=_[_0x22fd('0x36')](_0x5d2f5a[_0x22fd('0x37')],qs[_0x22fd('0x39')](_0x3ac8ad[_0x22fd('0x34')][_0x22fd('0x39')]));_0x3c0404['attributes']=_0x3c0404[_0x22fd('0x38')][_0x22fd('0x3a')]?_0x3c0404[_0x22fd('0x38')]:_0x5d2f5a['model'];if(!_0x3ac8ad[_0x22fd('0x34')][_0x22fd('0x3b')](_0x22fd('0x3c'))){_0x3c0404['limit']=qs[_0x22fd('0x22')](_0x3ac8ad['query'][_0x22fd('0x22')]);_0x3c0404[_0x22fd('0x25')]=qs[_0x22fd('0x25')](_0x3ac8ad['query']['offset']);}_0x3c0404['order']=qs[_0x22fd('0x3d')](_0x3ac8ad[_0x22fd('0x34')]['sort']);_0x3c0404[_0x22fd('0x3e')]=qs[_0x22fd('0x35')](_[_0x22fd('0x3f')](_0x3ac8ad[_0x22fd('0x34')],_0x5d2f5a[_0x22fd('0x35')]),_0xdf48b5);if(_0x3ac8ad[_0x22fd('0x34')]['filter']){_0x3c0404[_0x22fd('0x3e')]=_[_0x22fd('0x40')](_0x3c0404[_0x22fd('0x3e')],{'$or':_[_0x22fd('0x30')](_0xdf48b5,function(_0x16e521){if(_0x16e521['type']!==_0x22fd('0x41')){var _0x3f0639={};_0x3f0639[_0x16e521[_0x22fd('0x2d')]]={'$like':'%'+_0x3ac8ad['query'][_0x22fd('0x42')]+'%'};return _0x3f0639;}})});}_0x3c0404=_[_0x22fd('0x40')]({},_0x3c0404,_0x3ac8ad[_0x22fd('0x43')]);var _0x1e1ec6={'where':_0x3c0404['where']};return db[_0x22fd('0x44')][_0x22fd('0x24')](_0x1e1ec6)['then'](function(_0x481e6f){_0xdd1999[_0x22fd('0x24')]=_0x481e6f;if(_0x3ac8ad[_0x22fd('0x34')][_0x22fd('0x45')]){_0x3c0404[_0x22fd('0x46')]=[{'all':!![]}];}return db[_0x22fd('0x44')][_0x22fd('0x47')](_0x3c0404);})[_0x22fd('0x29')](function(_0x2b3cc6){_0xdd1999['rows']=_0x2b3cc6;return _0xdd1999;})['then'](respondWithFilteredResult(_0x36c27a,_0x3c0404))[_0x22fd('0x48')](handleError(_0x36c27a,null));};exports[_0x22fd('0x49')]=function(_0xe8d52,_0xb9b81a){var _0x8742e7={'raw':!![],'where':{'id':_0xe8d52[_0x22fd('0x4a')]['id']}},_0x17f7c3={};_0x17f7c3[_0x22fd('0x37')]=_[_0x22fd('0x4b')](db[_0x22fd('0x44')]['rawAttributes']);_0x17f7c3[_0x22fd('0x34')]=_['keys'](_0xe8d52[_0x22fd('0x34')]);_0x17f7c3['filters']=_[_0x22fd('0x36')](_0x17f7c3[_0x22fd('0x37')],_0x17f7c3[_0x22fd('0x34')]);_0x8742e7['attributes']=_[_0x22fd('0x36')](_0x17f7c3[_0x22fd('0x37')],qs['fields'](_0xe8d52[_0x22fd('0x34')][_0x22fd('0x39')]));_0x8742e7[_0x22fd('0x38')]=_0x8742e7['attributes'][_0x22fd('0x3a')]?_0x8742e7['attributes']:_0x17f7c3[_0x22fd('0x37')];if(_0xe8d52[_0x22fd('0x34')]['includeAll']){_0x8742e7[_0x22fd('0x46')]=[{'all':!![]}];}_0x8742e7=_[_0x22fd('0x40')]({},_0x8742e7,_0xe8d52[_0x22fd('0x43')]);return db['Plugin'][_0x22fd('0x4c')](_0x8742e7)[_0x22fd('0x29')](handleEntityNotFound(_0xb9b81a,null))['then'](respondWithResult(_0xb9b81a,null))[_0x22fd('0x48')](handleError(_0xb9b81a,null));};exports[_0x22fd('0x4d')]=function(_0x42477f,_0x35e5e2,_0x50d7a1){return db[_0x22fd('0x44')][_0x22fd('0x4c')]({'where':{'id':_0x42477f[_0x22fd('0x4a')]['id']},'attributes':[_0x22fd('0x2d'),_0x22fd('0x7')],'raw':!![]})[_0x22fd('0x29')](handleEntityNotFound(_0x35e5e2,null))[_0x22fd('0x29')](function(_0x454062){if(_0x454062){var _0x33854d=path[_0x22fd('0x4e')](config[_0x22fd('0x4f')],_0x22fd('0x50'),util[_0x22fd('0x51')]('%s.zip',path[_0x22fd('0x52')](_0x454062['path'])));var _0x5861cf=fs[_0x22fd('0x53')](_0x33854d);var _0x4926d3=archiver(_0x22fd('0x54'),{'zlib':{'level':0x9}});_0x4926d3['on']('warning',function(_0x3120f6){if(_0x3120f6[_0x22fd('0x55')]===_0x22fd('0x56')){logger[_0x22fd('0x57')](_0x3120f6);}else{throw new db[(_0x22fd('0x58'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4926d3['on']('error',function(_0x8b4b64){throw new db[(_0x22fd('0x58'))][(_0x22fd('0x59'))](_0x22fd('0x5a'));});_0x4926d3[_0x22fd('0x5b')](_0x5861cf);_0x4926d3['glob']('**/*',{'cwd':path[_0x22fd('0x4e')](config[_0x22fd('0x4f')],'server/files/plugins',path[_0x22fd('0x5c')](_0x454062[_0x22fd('0x7')])),'ignore':[path[_0x22fd('0x4e')](path[_0x22fd('0x52')](_0x454062[_0x22fd('0x7')]),_0x22fd('0x5d')),path[_0x22fd('0x4e')](path[_0x22fd('0x52')](_0x454062[_0x22fd('0x7')]),_0x22fd('0x5e'))],'nodir':!![]})[_0x22fd('0x5f')]();_0x5861cf['on'](_0x22fd('0x60'),function(){if(!fs[_0x22fd('0x61')](_0x33854d)){throw new db[(_0x22fd('0x58'))][(_0x22fd('0x59'))]('Plugin\x20not\x20found');}return _0x35e5e2[_0x22fd('0x4d')](_0x33854d,util['format'](_0x22fd('0x62'),path[_0x22fd('0x52')](_0x454062[_0x22fd('0x7')])),function(_0x412cbc){if(_0x412cbc){throw new db[(_0x22fd('0x58'))]['Error']('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x33854d);logger[_0x22fd('0x63')](_0x22fd('0x64'));logger[_0x22fd('0x63')](_0x22fd('0x65'));});});}return null;})['catch'](handleError(_0x35e5e2,null));};exports[_0x22fd('0x66')]=function(_0x1e2673,_0xe5b287,_0x1b06e0){var _0x477282=path[_0x22fd('0x52')](_0x1e2673['file'][_0x22fd('0x67')],path['extname'](_0x1e2673['file'][_0x22fd('0x67')]));var _0x242664=path[_0x22fd('0x4e')](config['root'],_0x22fd('0x50'),_0x1e2673[_0x22fd('0x68')]['filename']);var _0xe5e82e=path['join'](config['root'],_0x22fd('0x50'),_0x477282);logger[_0x22fd('0x63')]('Plugin\x20upload\x20filepath:\x20%s',_0x242664);logger[_0x22fd('0x63')]('Plugin\x20upload\x20destination:\x20%s',_0xe5e82e);try{fs[_0x22fd('0x69')](_0x242664,parseInt(_0x22fd('0x6a'),0x8));extract(_0x242664,{'dir':_0xe5e82e},function(_0x2dc5db){if(_0x2dc5db){logger['error'](_0x2dc5db);handleError(_0x2dc5db,!![]);};var _0x39ff7c=fs[_0x22fd('0x6b')](_0xe5e82e);if(_0x39ff7c[_0x22fd('0x3a')]>0x1){removeReferences(_0x242664,_0xe5e82e);logger[_0x22fd('0x57')]('Invalid\x20plugin\x20structure');return _0x1b06e0(new Error(_0x22fd('0x6c')));}var _0x16708b=fs[_0x22fd('0x6d')](path[_0x22fd('0x4e')](_0xe5e82e,_0x39ff7c[0x0]));if(_0x16708b['isFile']()){removeReferences(_0x242664,_0xe5e82e);logger[_0x22fd('0x57')](_0x22fd('0x6c'));return _0x1b06e0(new Error(_0x22fd('0x6c')));}if(_0x16708b[_0x22fd('0x6e')]()){var _0x29b4c9=fs['readdirSync'](path[_0x22fd('0x4e')](_0xe5e82e,_0x39ff7c[0x0]));if(_0x29b4c9['length']===0x0){removeReferences(_0x242664,_0xe5e82e);logger[_0x22fd('0x57')](_0x22fd('0x6c'));return _0x1b06e0(new Error(_0x22fd('0x6c')));}var _0x107b7c=_0x29b4c9['some'](function(_0x4fb662){return _0x4fb662===_0x22fd('0x6f');});if(!_0x107b7c){return _0x1b06e0(new Error('Plugin\x20manifest\x20missing'));}var _0x5b2551=fs[_0x22fd('0x70')](path[_0x22fd('0x4e')](_0xe5e82e,_0x39ff7c[0x0],'manifest.json'));var _0x1f03dd=JSON[_0x22fd('0x71')](_0x5b2551);if(_0x22fd('0x23')==typeof _0x1f03dd[_0x22fd('0x2d')]){return _0x1b06e0(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x1f03dd['type']){return _0x1b06e0(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x22fd('0x23')==typeof _0x1f03dd['version']){return _0x1b06e0(new Error(_0x22fd('0x72')));}if(_0x22fd('0x23')==typeof _0x1f03dd[_0x22fd('0x73')]){return _0x1b06e0(new Error(_0x22fd('0x74')));}if(_0x1f03dd[_0x22fd('0x32')]==='html'){if('undefined'==typeof _0x1f03dd['parameters']['views']){return _0x1b06e0(new Error(_0x22fd('0x75')));}if(_0x22fd('0x23')==typeof _0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')][_0x22fd('0x77')]&&'undefined'==typeof _0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')][_0x22fd('0x78')]){return _0x1b06e0(new Error(_0x22fd('0x79')));}}else if(_0x1f03dd[_0x22fd('0x32')]===_0x22fd('0x7a')){if(_0x22fd('0x23')==typeof _0x1f03dd[_0x22fd('0x73')][_0x22fd('0x7b')]){return _0x1b06e0(new Error(_0x22fd('0x7c')));}if(_0x22fd('0x23')==typeof _0x1f03dd['parameters'][_0x22fd('0x7d')]){return _0x1b06e0(new Error(_0x22fd('0x7e')));}}else{return _0x1b06e0(new Error(_0x22fd('0x7f')));}var _0x443c18=_0x1f03dd['name'];var _0x25538f=_0x1f03dd[_0x22fd('0x80')];var _0x48f07a=_0x1f03dd[_0x22fd('0x32')];var _0x21fa3a=_0x1f03dd[_0x22fd('0x81')]?_0x1f03dd[_0x22fd('0x81')]:_0x22fd('0x82');var _0x578a13=_0x1f03dd[_0x22fd('0x83')]?_0x1f03dd[_0x22fd('0x83')]:_0x22fd('0x84');var _0x11f140='';var _0x3e1100='';var _0x2f7516='';var _0x1ff7d4='';var _0x4ae7d1=_0x1f03dd[_0x22fd('0x85')];if(_0x48f07a===_0x22fd('0x86')){if(_0x22fd('0x23')!=typeof _0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')][_0x22fd('0x77')]){var _0x1197c9=_0x1f03dd['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x22fd('0x87')](_0x1197c9)){_0x11f140=path['join'](_0x22fd('0x88'),_0x477282,_0x39ff7c[0x0],_0x1197c9);}else{_0x11f140=_0x1197c9;}}else{logger['info'](_0x22fd('0x89'));}if(_0x22fd('0x23')!=typeof _0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')][_0x22fd('0x78')]){var _0xc38eaa=_0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')]['agent'];if(!/^(f|ht)tps?:\/\//i['test'](_0xc38eaa)){_0x3e1100=path['join'](_0x22fd('0x88'),_0x477282,_0x39ff7c[0x0],_0xc38eaa);}else{_0x3e1100=_0xc38eaa;}}else{logger[_0x22fd('0x63')](_0x22fd('0x8a'));}}else if(_0x48f07a===_0x22fd('0x7a')){_0x2f7516=_0x1f03dd[_0x22fd('0x73')][_0x22fd('0x7b')];_0x1ff7d4=_0x1f03dd[_0x22fd('0x73')][_0x22fd('0x7d')];if(_0x22fd('0x23')!=typeof _0x1f03dd['parameters'][_0x22fd('0x76')]){if(_0x22fd('0x23')!=typeof _0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')]['admin']){var _0x1197c9=_0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')][_0x22fd('0x77')];if(!/^(f|ht)tps?:\/\//i[_0x22fd('0x87')](_0x1197c9)){_0x11f140=path['join'](_0x22fd('0x88'),_0x477282,_0x39ff7c[0x0],_0x1197c9);}else{_0x11f140=_0x1197c9;}}if(_0x22fd('0x23')!=typeof _0x1f03dd['parameters'][_0x22fd('0x76')][_0x22fd('0x78')]){var _0xc38eaa=_0x1f03dd[_0x22fd('0x73')][_0x22fd('0x76')][_0x22fd('0x78')];if(!/^(f|ht)tps?:\/\//i[_0x22fd('0x87')](_0xc38eaa)){_0x3e1100=path['join'](_0x22fd('0x88'),_0x477282,_0x39ff7c[0x0],_0xc38eaa);}else{_0x3e1100=_0xc38eaa;}}}}var _0xda36a7={'name':_0x443c18,'description':_0x25538f,'path':path['join'](_0x477282,_0x39ff7c[0x0]),'type':_0x48f07a,'sidebar':_0x21fa3a,'icon':_0x578a13,'adminUrl':_0x11f140,'agentUrl':_0x3e1100,'scriptName':_0x2f7516,'scriptPath':_0x1ff7d4,'version':_0x4ae7d1};removeReferences(_0x242664,null);return db[_0x22fd('0x44')][_0x22fd('0x8b')](_0xda36a7)['then'](function(_0x4f23fb){var _0x5a2569={'role':_0x1e2673['body']['role'],'userProfileId':_0x1e2673['body'][_0x22fd('0x8c')]};if(!_0x5a2569)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a2569['role']===_0x22fd('0x8d')){var _0x3d76d6=_0x4f23fb['get']({'plain':!![]});return db[_0x22fd('0x8e')][_0x22fd('0x4c')]({'where':{'name':_0x22fd('0x2c'),'userProfileId':_0x5a2569[_0x22fd('0x8c')]},'raw':!![]})[_0x22fd('0x29')](function(_0x74532b){if(_0x74532b&&_0x74532b[_0x22fd('0x8f')]===0x0){return db['UserProfileResource'][_0x22fd('0x8b')]({'name':_0x3d76d6[_0x22fd('0x2d')],'resourceId':_0x3d76d6['id'],'type':_0x74532b['name'],'sectionId':_0x74532b['id']},{})['then'](function(){return _0x4f23fb;});}else{return _0x4f23fb;}})[_0x22fd('0x48')](function(_0x31b966){logger[_0x22fd('0x57')](_0x22fd('0x90'),_0x31b966);throw _0x31b966;});}return _0x4f23fb;})[_0x22fd('0x29')](respondWithResult(_0xe5b287,null))[_0x22fd('0x48')](handleError(_0xe5b287,null));}});}catch(_0x556dba){_0xe5b287['status'](0x1f4)['send'](_0x556dba);}};function removeReferences(_0x5e5c58,_0x11ce08){try{if(_0x5e5c58){fs['unlinkSync'](_0x5e5c58);logger[_0x22fd('0x63')](_0x22fd('0x91'));}if(_0x11ce08){rimraf(_0x11ce08,function(){});logger['info'](_0x22fd('0x92'));}}catch(_0x337f2a){logger[_0x22fd('0x57')](_0x337f2a);}}exports[_0x22fd('0x93')]=function(_0x348f37,_0x122b16,_0x3bc19f){return db[_0x22fd('0x44')]['find']({'where':{'id':_0x348f37[_0x22fd('0x4a')]['id']}})['then'](handleEntityNotFound(_0x122b16,null))[_0x22fd('0x29')](saveUpdates(_0x348f37[_0x22fd('0x94')],null))[_0x22fd('0x29')](respondWithResult(_0x122b16,null))[_0x22fd('0x48')](handleError(_0x122b16,null));};exports['delete']=function(_0xf6f4da,_0x1971dc,_0x391383){return db['Plugin']['find']({'where':{'id':_0xf6f4da[_0x22fd('0x4a')]['id']}})[_0x22fd('0x29')](function(_0x281728){if(_0x281728){return _0x281728[_0x22fd('0x2a')]();}})[_0x22fd('0x29')](function(_0x324678){rimraf(path[_0x22fd('0x4e')](config[_0x22fd('0x4f')],_0x22fd('0x50'),path[_0x22fd('0x5c')](_0x324678[_0x22fd('0x7')])),function(){});return _0x324678;})[_0x22fd('0x29')](handleEntityNotFound(_0x1971dc,null))[_0x22fd('0x29')](respondWithStatusCode(_0x1971dc,null))[_0x22fd('0x48')](handleError(_0x1971dc,null));};exports['webhookGet']=function(_0xf97fc1,_0x233cd6,_0x286270){return BPromise[_0x22fd('0x95')]()[_0x22fd('0x29')](function(){if(!_0xf97fc1['query'][_0x22fd('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x96')]){throw new Error(_0x22fd('0x97'));}var _0x481573=_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x98')]?_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x98')]+':'+_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x96')]:_0x22fd('0x99')+_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x96')];var _0x494a89=_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x21')]?_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x21')]:!![];var _0x29a0ec=_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x9a')]?_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x9a')]:null;var _0x31ffb7={'method':_0xf97fc1[_0x22fd('0x9b')],'uri':util[_0x22fd('0x51')]('%s%s',_0x481573,_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x7')]),'json':_0x494a89,'resolveWithFullResponse':!![],'encoding':_0x29a0ec,'qs':_0xf97fc1[_0x22fd('0x34')]};if(_0xf97fc1['headers']){_0x31ffb7[_0x22fd('0x9c')]=_0xf97fc1['headers'];if(_0x31ffb7[_0x22fd('0x9c')][_0x22fd('0x9d')]){delete _0x31ffb7[_0x22fd('0x9c')][_0x22fd('0x9d')];}}if(_0x31ffb7[_0x22fd('0x9c')][_0x22fd('0x9e')]){delete _0x31ffb7[_0x22fd('0x9c')][_0x22fd('0x9e')];}return rp(_0x31ffb7);})[_0x22fd('0x29')](function(_0x353add){if(_0x353add){_0x233cd6[_0x22fd('0x26')](_0x353add[_0x22fd('0x9c')]);logger[_0x22fd('0x63')](_0x353add[_0x22fd('0x94')]);if(_['endsWith'](_0xf97fc1[_0x22fd('0x34')][_0x22fd('0x7')],_0x22fd('0x4d'))&&_0x353add[_0x22fd('0x9f')]==0x1f4){return _0x233cd6['sendStatus'](_0x353add[_0x22fd('0x9f')]);}else{return _0x233cd6['status'](_0x353add[_0x22fd('0x9f')])[_0x22fd('0x2e')](_0x353add[_0x22fd('0x94')]);}}else{return _0x233cd6[_0x22fd('0xa0')](0xc8);}})[_0x22fd('0x48')](handleError(_0x233cd6,null));};exports[_0x22fd('0xa1')]=function(_0x4104a9,_0x23ce51,_0x221dae){return BPromise[_0x22fd('0x95')]()[_0x22fd('0x29')](function(){if(!_0x4104a9[_0x22fd('0x34')]['path']){throw new Error(_0x22fd('0xa2'));}if(!_0x4104a9['query'][_0x22fd('0x96')]){throw new Error(_0x22fd('0x97'));}var _0x49680d=_0x4104a9[_0x22fd('0x34')][_0x22fd('0x98')]?_0x4104a9['query'][_0x22fd('0x98')]+':'+_0x4104a9[_0x22fd('0x34')][_0x22fd('0x96')]:_0x22fd('0x99')+_0x4104a9['query'][_0x22fd('0x96')];var _0x46a5ae=_0x4104a9['query'][_0x22fd('0x21')]?_0x4104a9[_0x22fd('0x34')][_0x22fd('0x21')]:!![];var _0x546372=_0x4104a9[_0x22fd('0x34')][_0x22fd('0x9a')]?_0x4104a9[_0x22fd('0x34')][_0x22fd('0x9a')]:null;var _0x15d83a={'method':_0x4104a9['method'],'uri':util[_0x22fd('0x51')](_0x22fd('0xa3'),_0x49680d,_0x4104a9[_0x22fd('0x34')][_0x22fd('0x7')]),'json':_0x46a5ae,'resolveWithFullResponse':!![],'encoding':_0x546372,'body':_0x4104a9[_0x22fd('0x94')]};if(_0x4104a9[_0x22fd('0x9c')]){_0x15d83a['headers']=_0x4104a9['headers'];if(_0x15d83a[_0x22fd('0x9c')][_0x22fd('0x9d')]){delete _0x15d83a['headers'][_0x22fd('0x9d')];}}if(_0x15d83a[_0x22fd('0x9c')][_0x22fd('0x9e')]){delete _0x15d83a['headers'][_0x22fd('0x9e')];}return rp(_0x15d83a);})[_0x22fd('0x29')](function(_0x1b8700){if(_0x1b8700){_0x23ce51[_0x22fd('0x26')](_0x1b8700['headers']);logger[_0x22fd('0x63')](_0x1b8700[_0x22fd('0x94')]);return _0x23ce51['status'](_0x1b8700['statusCode'])[_0x22fd('0x2e')](_0x1b8700[_0x22fd('0x94')]);}else{return _0x23ce51['sendStatus'](0xc8);}})[_0x22fd('0x48')](handleError(_0x23ce51,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index bc23632..61fe29b 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 _0x15b2=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x245ac5,_0x4215f1){var _0x437858=function(_0x3f121b){while(--_0x3f121b){_0x245ac5['push'](_0x245ac5['shift']());}};_0x437858(++_0x4215f1);}(_0x15b2,0x145));var _0x215b=function(_0x592df4,_0x4e719b){_0x592df4=_0x592df4-0x0;var _0x3b4fe4=_0x15b2[_0x592df4];return _0x3b4fe4;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x215b('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x215b('0x1')](0x0);var events={'afterCreate':_0x215b('0x2'),'afterUpdate':'update','afterDestroy':_0x215b('0x3')};function emitEvent(_0xe78f2d){return function(_0x62c5ce,_0x506d00,_0x56ada9){PluginEvents[_0x215b('0x4')](_0xe78f2d+':'+_0x62c5ce['id'],_0x62c5ce);PluginEvents['emit'](_0xe78f2d,_0x62c5ce);_0x56ada9(null);};}for(var e in events){if(events[_0x215b('0x5')](e)){var event=events[e];Plugin[_0x215b('0x6')](e,emitEvent(event));}}module[_0x215b('0x7')]=PluginEvents; \ No newline at end of file +var _0xce22=['events','../../mysqldb','Plugin','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0xa7de0e,_0x22ae8d){var _0x508b97=function(_0x1e9f2d){while(--_0x1e9f2d){_0xa7de0e['push'](_0xa7de0e['shift']());}};_0x508b97(++_0x22ae8d);}(_0xce22,0xea));var _0x2ce2=function(_0xcc61ed,_0xaa2193){_0xcc61ed=_0xcc61ed-0x0;var _0x4eee8=_0xce22[_0xcc61ed];return _0x4eee8;};'use strict';var EventEmitter=require(_0x2ce2('0x0'));var Plugin=require(_0x2ce2('0x1'))['db'][_0x2ce2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x2ce2('0x3')](0x0);var events={'afterCreate':_0x2ce2('0x4'),'afterUpdate':'update','afterDestroy':_0x2ce2('0x5')};function emitEvent(_0x5bc506){return function(_0x26b273,_0x1801be,_0x470a06){PluginEvents[_0x2ce2('0x6')](_0x5bc506+':'+_0x26b273['id'],_0x26b273);PluginEvents[_0x2ce2('0x6')](_0x5bc506,_0x26b273);_0x470a06(null);};}for(var e in events){if(events[_0x2ce2('0x7')](e)){var event=events[e];Plugin[_0x2ce2('0x8')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index a1f2a1c..4c48007 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 _0xb096=['./plugin.attributes','exports','Plugin','plugins','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2446ed,_0x5ea4c8){var _0x32ee83=function(_0x3565ba){while(--_0x3565ba){_0x2446ed['push'](_0x2446ed['shift']());}};_0x32ee83(++_0x5ea4c8);}(_0xb096,0x156));var _0x6b09=function(_0x30823d,_0x5c26fb){_0x30823d=_0x30823d-0x0;var _0x3e0d8e=_0xb096[_0x30823d];return _0x3e0d8e;};'use strict';var _=require(_0x6b09('0x0'));var util=require(_0x6b09('0x1'));var logger=require(_0x6b09('0x2'))('api');var moment=require(_0x6b09('0x3'));var BPromise=require(_0x6b09('0x4'));var rp=require(_0x6b09('0x5'));var fs=require('fs');var path=require(_0x6b09('0x6'));var rimraf=require(_0x6b09('0x7'));var config=require(_0x6b09('0x8'));var attributes=require(_0x6b09('0x9'));module[_0x6b09('0xa')]=function(_0x4a701e,_0x50eb57){return _0x4a701e['define'](_0x6b09('0xb'),attributes,{'tableName':_0x6b09('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09f8=['util','api','moment','path','rimraf','./plugin.attributes','exports','define','Plugin','plugins','lodash'];(function(_0xa3400,_0x3a980a){var _0x33dba2=function(_0x5e988b){while(--_0x5e988b){_0xa3400['push'](_0xa3400['shift']());}};_0x33dba2(++_0x3a980a);}(_0x09f8,0x8e));var _0x809f=function(_0x4e7c78,_0x14a6e7){_0x4e7c78=_0x4e7c78-0x0;var _0x353032=_0x09f8[_0x4e7c78];return _0x353032;};'use strict';var _=require(_0x809f('0x0'));var util=require(_0x809f('0x1'));var logger=require('../../config/logger')(_0x809f('0x2'));var moment=require(_0x809f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x809f('0x4'));var rimraf=require(_0x809f('0x5'));var config=require('../../config/environment');var attributes=require(_0x809f('0x6'));module[_0x809f('0x7')]=function(_0x2c7dcc,_0x3f62f4){return _0x2c7dcc[_0x809f('0x8')](_0x809f('0x9'),attributes,{'tableName':_0x809f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index f88f6b9..82812f8 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 _0xc17f=['socket.io-emitter','./plugin.socket','request','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreatePlugin','Plugin','create','body','options','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults'];(function(_0x24f211,_0x257213){var _0xbbe686=function(_0x3db6c7){while(--_0x3db6c7){_0x24f211['push'](_0x24f211['shift']());}};_0xbbe686(++_0x257213);}(_0xc17f,0xae));var _0xfc17=function(_0x841dd6,_0x32cb31){_0x841dd6=_0x841dd6-0x0;var _0x3dcdbf=_0xc17f[_0x841dd6];return _0x3dcdbf;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require(_0xfc17('0x2'));var BPromise=require('bluebird');var rs=require(_0xfc17('0x3'));var fs=require('fs');var Redis=require(_0xfc17('0x4'));var db=require(_0xfc17('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfc17('0x6'));var config=require('../../config/environment');var jayson=require(_0xfc17('0x7'));var client=jayson[_0xfc17('0x8')][_0xfc17('0x9')]({'port':0x232a});config[_0xfc17('0xa')]=_[_0xfc17('0xb')](config[_0xfc17('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfc17('0xc'))(new Redis(config[_0xfc17('0xa')]));require(_0xfc17('0xd'))['register'](socket);function respondWithRpcPromise(_0xa2f23b,_0x40e7a9,_0xff3362){return new BPromise(function(_0x4c9d1c,_0x58313a){return client[_0xfc17('0xe')](_0xa2f23b,_0xff3362)[_0xfc17('0xf')](function(_0x16732b){logger[_0xfc17('0x10')](_0xfc17('0x11'),_0x40e7a9,_0xfc17('0x12'));logger[_0xfc17('0x13')](_0xfc17('0x14'),_0x40e7a9,'request\x20sent',JSON[_0xfc17('0x15')](_0x16732b));if(_0x16732b['error']){if(_0x16732b[_0xfc17('0x16')][_0xfc17('0x17')]===0x1f4){logger['error'](_0xfc17('0x11'),_0x40e7a9,_0x16732b[_0xfc17('0x16')][_0xfc17('0x18')]);return _0x58313a(_0x16732b[_0xfc17('0x16')][_0xfc17('0x18')]);}logger[_0xfc17('0x16')](_0xfc17('0x11'),_0x40e7a9,_0x16732b[_0xfc17('0x16')][_0xfc17('0x18')]);return _0x4c9d1c(_0x16732b[_0xfc17('0x16')][_0xfc17('0x18')]);}else{logger[_0xfc17('0x10')]('Plugin,\x20%s,\x20%s',_0x40e7a9,'request\x20sent');_0x4c9d1c(_0x16732b['result'][_0xfc17('0x18')]);}})[_0xfc17('0x19')](function(_0x44cd00){logger['error'](_0xfc17('0x11'),_0x40e7a9,_0x44cd00);_0x58313a(_0x44cd00);});});}exports[_0xfc17('0x1a')]=function(_0x3d856e){var _0x22d453=this;return new Promise(function(_0x181371,_0x224bb5){return db[_0xfc17('0x1b')][_0xfc17('0x1c')](_0x3d856e[_0xfc17('0x1d')],{'raw':_0x3d856e[_0xfc17('0x1e')]?_0x3d856e[_0xfc17('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xfc17('0xf')](function(_0x34d5f6){logger[_0xfc17('0x10')](_0xfc17('0x1a'),_0x3d856e);logger[_0xfc17('0x13')](_0xfc17('0x1a'),_0x3d856e,JSON['stringify'](_0x34d5f6));_0x181371(_0x34d5f6);})[_0xfc17('0x19')](function(_0x488282){logger['error'](_0xfc17('0x1a'),_0x488282[_0xfc17('0x18')],_0x3d856e);_0x224bb5(_0x22d453[_0xfc17('0x16')](0x1f4,_0x488282['message']));});});}; \ No newline at end of file +var _0x4e5a=['then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','Plugin','create','body','raw','CreatePlugin','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','register'];(function(_0x2d7b1d,_0x599a25){var _0x51d73f=function(_0x2477dc){while(--_0x2477dc){_0x2d7b1d['push'](_0x2d7b1d['shift']());}};_0x51d73f(++_0x599a25);}(_0x4e5a,0x143));var _0xa4e5=function(_0x3c357e,_0x4c3edf){_0x3c357e=_0x3c357e-0x0;var _0x5cec9c=_0x4e5a[_0x3c357e];return _0x5cec9c;};'use strict';var _=require(_0xa4e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa4e5('0x1'));var rs=require(_0xa4e5('0x2'));var fs=require('fs');var Redis=require(_0xa4e5('0x3'));var db=require(_0xa4e5('0x4'))['db'];var utils=require(_0xa4e5('0x5'));var logger=require(_0xa4e5('0x6'))(_0xa4e5('0x7'));var config=require(_0xa4e5('0x8'));var jayson=require(_0xa4e5('0x9'));var client=jayson[_0xa4e5('0xa')][_0xa4e5('0xb')]({'port':0x232a});config[_0xa4e5('0xc')]=_[_0xa4e5('0xd')](config[_0xa4e5('0xc')],{'host':_0xa4e5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4e5('0xc')]));require(_0xa4e5('0xf'))[_0xa4e5('0x10')](socket);function respondWithRpcPromise(_0x203879,_0x22313c,_0x343c05){return new BPromise(function(_0x57ab1d,_0x4f54fa){return client['request'](_0x203879,_0x343c05)[_0xa4e5('0x11')](function(_0x1c51fc){logger[_0xa4e5('0x12')](_0xa4e5('0x13'),_0x22313c,_0xa4e5('0x14'));logger[_0xa4e5('0x15')](_0xa4e5('0x16'),_0x22313c,'request\x20sent',JSON[_0xa4e5('0x17')](_0x1c51fc));if(_0x1c51fc['error']){if(_0x1c51fc['error'][_0xa4e5('0x18')]===0x1f4){logger[_0xa4e5('0x19')](_0xa4e5('0x13'),_0x22313c,_0x1c51fc[_0xa4e5('0x19')]['message']);return _0x4f54fa(_0x1c51fc[_0xa4e5('0x19')][_0xa4e5('0x1a')]);}logger['error'](_0xa4e5('0x13'),_0x22313c,_0x1c51fc[_0xa4e5('0x19')][_0xa4e5('0x1a')]);return _0x57ab1d(_0x1c51fc['error']['message']);}else{logger[_0xa4e5('0x12')](_0xa4e5('0x13'),_0x22313c,_0xa4e5('0x14'));_0x57ab1d(_0x1c51fc[_0xa4e5('0x1b')][_0xa4e5('0x1a')]);}})['catch'](function(_0x4f4d45){logger['error'](_0xa4e5('0x13'),_0x22313c,_0x4f4d45);_0x4f54fa(_0x4f4d45);});});}exports['CreatePlugin']=function(_0x3200d0){var _0x3e1d63=this;return new Promise(function(_0x574b9f,_0x56a06c){return db[_0xa4e5('0x1c')][_0xa4e5('0x1d')](_0x3200d0[_0xa4e5('0x1e')],{'raw':_0x3200d0['options']?_0x3200d0['options'][_0xa4e5('0x1f')]===undefined?!![]:![]:!![]})[_0xa4e5('0x11')](function(_0x41029b){logger[_0xa4e5('0x12')]('CreatePlugin',_0x3200d0);logger[_0xa4e5('0x15')](_0xa4e5('0x20'),_0x3200d0,JSON['stringify'](_0x41029b));_0x574b9f(_0x41029b);})[_0xa4e5('0x21')](function(_0x1c753e){logger['error']('CreatePlugin',_0x1c753e[_0xa4e5('0x1a')],_0x3200d0);_0x56a06c(_0x3e1d63['error'](0x1f4,_0x1c753e[_0xa4e5('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 39e4371..aa155bc 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 _0x4548=['update','emit','removeListener','register','plugin:','save','remove'];(function(_0x251da5,_0x379c24){var _0x167c16=function(_0x526c31){while(--_0x526c31){_0x251da5['push'](_0x251da5['shift']());}};_0x167c16(++_0x379c24);}(_0x4548,0xbb));var _0x8454=function(_0x2d5415,_0x589fe3){_0x2d5415=_0x2d5415-0x0;var _0x5df791=_0x4548[_0x2d5415];return _0x5df791;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x8454('0x0'),_0x8454('0x1'),_0x8454('0x2')];function createListener(_0x48de64,_0x2a502f){return function(_0x304680){_0x2a502f[_0x8454('0x3')](_0x48de64,_0x304680);};}function removeListener(_0x43a132,_0x1208d8){return function(){PluginEvents[_0x8454('0x4')](_0x43a132,_0x1208d8);};}exports[_0x8454('0x5')]=function(_0x55a08e){for(var _0x26fa30=0x0,_0x17b009=events['length'];_0x26fa30<_0x17b009;_0x26fa30++){var _0x19b7da=events[_0x26fa30];var _0x1f009d=createListener(_0x8454('0x6')+_0x19b7da,_0x55a08e);PluginEvents['on'](_0x19b7da,_0x1f009d);}}; \ No newline at end of file +var _0x003e=['update','emit','removeListener','register','length','plugin:','./plugin.events','save','remove'];(function(_0x22a699,_0x45b671){var _0x5951b0=function(_0x12eea8){while(--_0x12eea8){_0x22a699['push'](_0x22a699['shift']());}};_0x5951b0(++_0x45b671);}(_0x003e,0x1a4));var _0xe003=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x003e[_0xa148b7];return _0x51efd3;};'use strict';var PluginEvents=require(_0xe003('0x0'));var events=[_0xe003('0x1'),_0xe003('0x2'),_0xe003('0x3')];function createListener(_0x2a5383,_0x42b3dc){return function(_0x1c53b8){_0x42b3dc[_0xe003('0x4')](_0x2a5383,_0x1c53b8);};}function removeListener(_0x375291,_0x48ec90){return function(){PluginEvents[_0xe003('0x5')](_0x375291,_0x48ec90);};}exports[_0xe003('0x6')]=function(_0x3fc774){for(var _0x2e8fb3=0x0,_0x374ecd=events[_0xe003('0x7')];_0x2e8fb3<_0x374ecd;_0x2e8fb3++){var _0x51fd9e=events[_0x2e8fb3];var _0x21bd0e=createListener(_0xe003('0x8')+_0x51fd9e,_0x3fc774);PluginEvents['on'](_0x51fd9e,_0x21bd0e);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 013b00e..849e504 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(_0xfd84c2,_0x768198){var _0x1c278e=function(_0x6ed466){while(--_0x6ed466){_0xfd84c2['push'](_0xfd84c2['shift']());}};_0x1c278e(++_0x768198);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x2c5fab,_0x2e035a){var _0x17f7de=function(_0x3686a5){while(--_0x3686a5){_0x2c5fab['push'](_0x2c5fab['shift']());}};_0x17f7de(++_0x2e035a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 80a4f0e..bf23681 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 _0x2dae=['stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dirname','start','dump','update','restart','stop','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','sendStatus','status','json','error'];(function(_0x17b39c,_0x4d030b){var _0x171c0e=function(_0x599145){while(--_0x599145){_0x17b39c['push'](_0x17b39c['shift']());}};_0x171c0e(++_0x4d030b);}(_0x2dae,0xc3));var _0xe2da=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x2dae[_0x52f1e6];return _0x21f104;};'use strict';var _=require(_0xe2da('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xe2da('0x1'))(_0xe2da('0x2'));var path=require(_0xe2da('0x3'));var exec=require(_0xe2da('0x4'))[_0xe2da('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x25b9f2,_0x439b5d){return function(_0x77e45e){if(!_0x77e45e){_0x25b9f2[_0xe2da('0x6')](0x194);;}return _0x77e45e;};}function respondWithResult(_0x523c60,_0x3e3e25){_0x3e3e25=_0x3e3e25||0xc8;return function(_0x89c70b){if(_0x89c70b){return _0x523c60[_0xe2da('0x7')](_0x3e3e25)[_0xe2da('0x8')](_0x89c70b);}return null;};}function handleError(_0x238da3,_0x1c71ea){_0x1c71ea=_0x1c71ea||0x1f4;return function(_0x29960a){logger[_0xe2da('0x9')](_0x29960a[_0xe2da('0xa')]);if(_0x29960a['name']){delete _0x29960a[_0xe2da('0xb')];}_0x238da3[_0xe2da('0x7')](_0x1c71ea)[_0xe2da('0xc')](_0x29960a);};}function execChildProcess(){return new BPromise(function(_0x17086c,_0x3c1309){exec(_0xe2da('0xd'),function(_0x1a29b9,_0x173244,_0x5aab71){logger[_0xe2da('0xe')](_0x173244);logger['info'](_0x5aab71);if(_0x1a29b9){logger[_0xe2da('0x9')](_0x1a29b9);return _0x3c1309(_0x1a29b9);}return _0x17086c(_0x173244);});});}exports[_0xe2da('0xf')]=function(_0x37064e,_0x411b9f){return pm2[_0xe2da('0x10')]()[_0xe2da('0x11')](function(_0x295a86){if(_0x295a86){var _0x48584b=_[_0xe2da('0x12')](_0x295a86,function(_0x5e1702){return _0x5e1702['name']===_0xe2da('0x13')||_0x5e1702[_0xe2da('0xb')]===_0xe2da('0x14');});return{'rows':_0x48584b,'count':_0x48584b['length']};}return null;})[_0xe2da('0x11')](respondWithResult(_0x411b9f,null))[_0xe2da('0x15')](handleError(_0x411b9f,null));};exports[_0xe2da('0x16')]=function(_0x33568f,_0x4e1623){return pm2[_0xe2da('0x17')](_0x33568f[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x4e1623,null))[_0xe2da('0x11')](handleEntityNotFound(_0x4e1623,null))[_0xe2da('0x15')](handleError(_0x4e1623,null));};exports['create']=function(_0x56eeb1,_0x2e16b2){if(_0x56eeb1['body'][_0xe2da('0xb')]&&_0x56eeb1[_0xe2da('0x19')][_0xe2da('0x1a')]){var _0x203d36=path[_0xe2da('0x1b')](__dirname,_0xe2da('0x1c'),_0x56eeb1['body'][_0xe2da('0x1a')]);var _0x53cc4e=process[_0xe2da('0x1d')]();process[_0xe2da('0x1e')](path[_0xe2da('0x1f')](_0x203d36));return execChildProcess()[_0xe2da('0x11')](function(_0x30dea4){process[_0xe2da('0x1e')](_0x53cc4e);return pm2[_0xe2da('0x20')]({'name':_0x56eeb1[_0xe2da('0x19')]['name'],'script':_0x203d36});})[_0xe2da('0x11')](function(_0x357bff){pm2[_0xe2da('0x21')]();return _0x357bff[0x0];})[_0xe2da('0x11')](respondWithResult(_0x2e16b2,0xc9))[_0xe2da('0x15')](handleError(_0x2e16b2,null));}else{return _0x2e16b2[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0xe2da('0x22')]=function(_0x3e23d7,_0x1dc228){if(_0x3e23d7[_0xe2da('0x19')]['id']){delete _0x3e23d7[_0xe2da('0x19')]['id'];}var _0x2b6c9e={'online':_0xe2da('0x23'),'stopped':_0xe2da('0x24')};if(_0x2b6c9e['hasOwnProperty'](_0x3e23d7['body']['status'])){return pm2[_0x2b6c9e[_0x3e23d7[_0xe2da('0x19')][_0xe2da('0x7')]]](_0x3e23d7[_0xe2da('0x18')]['id'])[_0xe2da('0x11')](respondWithResult(_0x1dc228,0xc8))['catch'](handleError(_0x1dc228,null));}else{return _0x1dc228['status'](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x25')});}};exports[_0xe2da('0x26')]=function(_0x39f983,_0x7ab5ee){if(_0x39f983[_0xe2da('0x19')]['id']){delete _0x39f983[_0xe2da('0x19')]['id'];}if(_0x39f983[_0xe2da('0x18')]['id']){return pm2[_0xe2da('0x27')](_0x39f983['params']['id'])['then'](function(_0x672767){pm2[_0xe2da('0x21')]();return _0x672767[0x0];})[_0xe2da('0x11')](respondWithResult(_0x7ab5ee,null))[_0xe2da('0x15')](handleError(_0x7ab5ee,null));}else{return _0x7ab5ee[_0xe2da('0x7')](0x1f4)[_0xe2da('0xc')]({'message':_0xe2da('0x28')});}}; \ No newline at end of file +var _0xb688=['error','stack','name','send','info','index','then','reject','motion2','catch','show','describe','params','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','update','stop','Unknown\x20status','destroy','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','status','json'];(function(_0x18b5e8,_0x51e875){var _0x25baed=function(_0x3fcdf9){while(--_0x3fcdf9){_0x18b5e8['push'](_0x18b5e8['shift']());}};_0x25baed(++_0x51e875);}(_0xb688,0xcf));var _0x8b68=function(_0x56e614,_0x257613){_0x56e614=_0x56e614-0x0;var _0x1417d4=_0xb688[_0x56e614];return _0x1417d4;};'use strict';var _=require('lodash');var pm2=require(_0x8b68('0x0'));var logger=require(_0x8b68('0x1'))(_0x8b68('0x2'));var path=require(_0x8b68('0x3'));var exec=require(_0x8b68('0x4'))[_0x8b68('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x41030e,_0x27925d){return function(_0x30f33d){if(!_0x30f33d){_0x41030e[_0x8b68('0x6')](0x194);;}return _0x30f33d;};}function respondWithResult(_0x583d16,_0x34314e){_0x34314e=_0x34314e||0xc8;return function(_0x57ee56){if(_0x57ee56){return _0x583d16[_0x8b68('0x7')](_0x34314e)[_0x8b68('0x8')](_0x57ee56);}return null;};}function handleError(_0x130892,_0xa5571b){_0xa5571b=_0xa5571b||0x1f4;return function(_0x132617){logger[_0x8b68('0x9')](_0x132617[_0x8b68('0xa')]);if(_0x132617[_0x8b68('0xb')]){delete _0x132617[_0x8b68('0xb')];}_0x130892[_0x8b68('0x7')](_0xa5571b)[_0x8b68('0xc')](_0x132617);};}function execChildProcess(){return new BPromise(function(_0x317d01,_0x2a852a){exec('npm\x20install',function(_0x2c0f3b,_0x4426d1,_0x5e76c){logger[_0x8b68('0xd')](_0x4426d1);logger[_0x8b68('0xd')](_0x5e76c);if(_0x2c0f3b){logger[_0x8b68('0x9')](_0x2c0f3b);return _0x2a852a(_0x2c0f3b);}return _0x317d01(_0x4426d1);});});}exports[_0x8b68('0xe')]=function(_0x137c8e,_0x2686c7){return pm2['list']()[_0x8b68('0xf')](function(_0x509033){if(_0x509033){var _0x5e3c66=_[_0x8b68('0x10')](_0x509033,function(_0x1554d6){return _0x1554d6[_0x8b68('0xb')]==='express'||_0x1554d6['name']===_0x8b68('0x11');});return{'rows':_0x5e3c66,'count':_0x5e3c66['length']};}return null;})[_0x8b68('0xf')](respondWithResult(_0x2686c7,null))[_0x8b68('0x12')](handleError(_0x2686c7,null));};exports[_0x8b68('0x13')]=function(_0x10c9c6,_0x491695){return pm2[_0x8b68('0x14')](_0x10c9c6[_0x8b68('0x15')]['id'])['then'](respondWithResult(_0x491695,null))[_0x8b68('0xf')](handleEntityNotFound(_0x491695,null))[_0x8b68('0x12')](handleError(_0x491695,null));};exports[_0x8b68('0x16')]=function(_0x17f321,_0x38b7a7){if(_0x17f321['body'][_0x8b68('0xb')]&&_0x17f321[_0x8b68('0x17')][_0x8b68('0x18')]){var _0x1a9788=path[_0x8b68('0x19')](__dirname,_0x8b68('0x1a'),_0x17f321['body']['script']);var _0x23edc1=process['cwd']();process[_0x8b68('0x1b')](path[_0x8b68('0x1c')](_0x1a9788));return execChildProcess()[_0x8b68('0xf')](function(_0x21ecca){process[_0x8b68('0x1b')](_0x23edc1);return pm2[_0x8b68('0x1d')]({'name':_0x17f321['body'][_0x8b68('0xb')],'script':_0x1a9788});})[_0x8b68('0xf')](function(_0x4ca77d){pm2[_0x8b68('0x1e')]();return _0x4ca77d[0x0];})[_0x8b68('0xf')](respondWithResult(_0x38b7a7,0xc9))[_0x8b68('0x12')](handleError(_0x38b7a7,null));}else{return _0x38b7a7['status'](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8b68('0x1f')]=function(_0x448e43,_0x2ba2a3){if(_0x448e43['body']['id']){delete _0x448e43[_0x8b68('0x17')]['id'];}var _0x53aaa2={'online':'restart','stopped':_0x8b68('0x20')};if(_0x53aaa2['hasOwnProperty'](_0x448e43[_0x8b68('0x17')][_0x8b68('0x7')])){return pm2[_0x53aaa2[_0x448e43['body']['status']]](_0x448e43[_0x8b68('0x15')]['id'])[_0x8b68('0xf')](respondWithResult(_0x2ba2a3,0xc8))[_0x8b68('0x12')](handleError(_0x2ba2a3,null));}else{return _0x2ba2a3[_0x8b68('0x7')](0x1f4)[_0x8b68('0xc')]({'message':_0x8b68('0x21')});}};exports[_0x8b68('0x22')]=function(_0x5b7ed1,_0x3b6d1b){if(_0x5b7ed1['body']['id']){delete _0x5b7ed1[_0x8b68('0x17')]['id'];}if(_0x5b7ed1[_0x8b68('0x15')]['id']){return pm2['delete'](_0x5b7ed1[_0x8b68('0x15')]['id'])[_0x8b68('0xf')](function(_0x26fe0e){pm2['dump']();return _0x26fe0e[0x0];})['then'](respondWithResult(_0x3b6d1b,null))[_0x8b68('0x12')](handleError(_0x3b6d1b,null));}else{return _0x3b6d1b[_0x8b68('0x7')](0x1f4)[_0x8b68('0xc')]({'message':_0x8b68('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 52a7fb7..fa99fd3 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 _0xc525=['isAuthenticated','getAgents','/queues','getQueues','exports','express','Router','../../components/auth/service','./realtime.controller','get','/agents'];(function(_0x14c6eb,_0x43bb9f){var _0x5cae87=function(_0x93607f){while(--_0x93607f){_0x14c6eb['push'](_0x14c6eb['shift']());}};_0x5cae87(++_0x43bb9f);}(_0xc525,0x123));var _0x5c52=function(_0x10e42a,_0x35002b){_0x10e42a=_0x10e42a-0x0;var _0x54ff4e=_0xc525[_0x10e42a];return _0x54ff4e;};'use strict';var express=require(_0x5c52('0x0'));var router=express[_0x5c52('0x1')]();var auth=require(_0x5c52('0x2'));var controller=require(_0x5c52('0x3'));router[_0x5c52('0x4')](_0x5c52('0x5'),auth[_0x5c52('0x6')](),controller[_0x5c52('0x7')]);router['get'](_0x5c52('0x8'),auth[_0x5c52('0x6')](),controller[_0x5c52('0x9')]);module[_0x5c52('0xa')]=router; \ No newline at end of file +var _0xe0b7=['isAuthenticated','getAgents','/queues','getQueues','express','Router','../../components/auth/service','get','/agents'];(function(_0xbeb808,_0x881ddf){var _0x5d6909=function(_0x37d652){while(--_0x37d652){_0xbeb808['push'](_0xbeb808['shift']());}};_0x5d6909(++_0x881ddf);}(_0xe0b7,0x82));var _0x7e0b=function(_0x2fe403,_0x5a4ee4){_0x2fe403=_0x2fe403-0x0;var _0x97a134=_0xe0b7[_0x2fe403];return _0x97a134;};'use strict';var express=require(_0x7e0b('0x0'));var router=express[_0x7e0b('0x1')]();var auth=require(_0x7e0b('0x2'));var controller=require('./realtime.controller');router[_0x7e0b('0x3')](_0x7e0b('0x4'),auth[_0x7e0b('0x5')](),controller[_0x7e0b('0x6')]);router[_0x7e0b('0x3')](_0x7e0b('0x7'),auth[_0x7e0b('0x5')](),controller[_0x7e0b('0x8')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index 18361be..17c4bad 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 _0x1f26=['UserProfile','getResources','findAndCountAll','map','find','filterAgentAttributes','getAgentStatus','includes','voice','voiceStatus','talking','sortAgentsByStatus','getRealtimeAgentsQueryFields','pick','getQueues','startCase','rawAttributes','dialActive','userProfileId','outbound','Queues','name','assign','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','APIBadRequestError','../../errors/api','handleError','undefined','limit','offset','count','status','Content-Range','query','globalQueueFilter','pauseTypeFilter','pause','*pause','resolve','then','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','channel','toLowerCase','sort','globalStatus','validateSortParameter','getUpdatedSortOptions','fields','join','order','getAgentIdsByQueues','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','User','fieldName','type','key','role','agent','getOptions','sequelize','literal','FIELD(id,','forEach','push','Pause','where','merge','user','Agents','online'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f26,0x10b));var _0x61f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f26[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x61f2('0x0'));var util=require(_0x61f2('0x1'));var rta=require(_0x61f2('0x2'));var rtq=require(_0x61f2('0x3'));var qs=require(_0x61f2('0x4'));var utils=require(_0x61f2('0x5'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require('../../errors/api')[_0x61f2('0x6')];var APIHandleError=require(_0x61f2('0x7'))[_0x61f2('0x8')];function respondWithFilteredResult(_0x4653b5,_0x4f6552){return function(_0x52268a){if(_0x52268a){var _0x3ed85c=typeof _0x4f6552['offset']===_0x61f2('0x9')&&typeof _0x4f6552[_0x61f2('0xa')]===_0x61f2('0x9');var _0x4e47fb=_0x52268a['count'];var _0x4bf963=_0x3ed85c?0x0:_0x4f6552[_0x61f2('0xb')];var _0x536914=_0x3ed85c?_0x52268a[_0x61f2('0xc')]:_0x4f6552[_0x61f2('0xb')]+_0x4f6552['limit'];var _0x481793;if(_0x536914>=_0x4e47fb){_0x536914=_0x4e47fb;_0x481793=0xc8;}else{_0x481793=0xce;}_0x4653b5[_0x61f2('0xd')](_0x481793);return _0x4653b5['set'](_0x61f2('0xe'),_0x4bf963+'-'+_0x536914+'/'+_0x4e47fb)['json'](_0x52268a);}return null;};}exports['getAgents']=function(_0x55b43e,_0x43636e){var _0x579d40={'count':0x0,'rows':[]};var _0x551905={};var _0x27c446;var _0x4bc5ad=utils['getChannels']();var _0x2dd3a5;var _0x4a6165;var _0x553ed0=_0x55b43e[_0x61f2('0xf')][_0x61f2('0x10')];var _0x2f1d53=_0x55b43e[_0x61f2('0xf')]['globalStatusFilter'];var _0x47d4e4=_0x55b43e['query'][_0x61f2('0x11')];var _0x91041c=_0x2f1d53===_0x61f2('0x12')||_0x2f1d53===_0x61f2('0x13')?!![]:![];var _0x29f459=[];var _0x1b8504;var _0x3c09e2;Promise[_0x61f2('0x14')]()[_0x61f2('0x15')](function(){if(_0x55b43e['query']['channel']){if(!utils[_0x61f2('0x16')](_0x55b43e[_0x61f2('0xf')]['channel'])){throw new APIBadRequestError(util[_0x61f2('0x17')](_0x61f2('0x18'),_0x55b43e['query'][_0x61f2('0x19')]));}_0x27c446=_0x55b43e['query'][_0x61f2('0x19')][_0x61f2('0x1a')]();}if(!_0x55b43e['query'][_0x61f2('0x1b')]||!_0x55b43e['query'][_0x61f2('0x1b')]['includes'](_0x61f2('0x1c'))){_0x55b43e[_0x61f2('0xf')][_0x61f2('0x1b')]=rta[_0x61f2('0x1d')](_0x55b43e[_0x61f2('0xf')][_0x61f2('0x1b')]);return;}var _0x1d8569=rta[_0x61f2('0x1e')](_0x55b43e[_0x61f2('0xf')]['sort']);_0x55b43e[_0x61f2('0xf')][_0x61f2('0x1b')]=_0x1d8569[_0x61f2('0x1f')][_0x61f2('0x20')](',');_0x1b8504=_0x1d8569[_0x61f2('0x21')];})[_0x61f2('0x15')](function(){if(!_0x553ed0){return[];}return rta[_0x61f2('0x22')](_0x553ed0,_0x27c446);})[_0x61f2('0x15')](function(_0x29d4cf){_0x29f459=_0x29d4cf;return rta[_0x61f2('0x23')]();})[_0x61f2('0x15')](function(_0x431502){_0x4a6165=_0x431502[_0x61f2('0x24')];if((!_0x2f1d53||_0x91041c)&&!_0x1b8504){return _0x29f459;}if(_0x1b8504&&!_0x2f1d53){return rta[_0x61f2('0x25')](_0x4a6165,_0x29f459,_0x1b8504);}else{return rta[_0x61f2('0x26')](_0x4a6165,_0x29f459,_0x2f1d53);}})[_0x61f2('0x15')](function(_0xb0666a){_0x29f459=_0xb0666a;var _0x1ad718=![];if(_0x29f459['length']===0x0){if(_0x553ed0||_0x2f1d53){_0x1ad718=!![];}if(_0x91041c){_0x1ad718=![];}}if(_0x1ad718){return _0x579d40;}var _0x389d46=_['map'](db[_0x61f2('0x27')]['rawAttributes'],function(_0x4fb854){return{'name':_0x4fb854[_0x61f2('0x28')],'type':_0x4fb854[_0x61f2('0x29')][_0x61f2('0x2a')]};});_0x55b43e[_0x61f2('0xf')][_0x61f2('0x2b')]=_0x61f2('0x2c');_0x551905=qs[_0x61f2('0x2d')](_0x389d46,_0x55b43e);_0x551905['raw']=!![];var _0x260e09=[];if(_0x29f459['length']>0x0){_0x260e09['push']({'id':{'$in':_0x29f459}});if(_0x1b8504&&!_0x2f1d53){_0x3c09e2=[db[_0x61f2('0x2e')][_0x61f2('0x2f')](_0x61f2('0x30')+_0x29f459+')')];_0x551905[_0x61f2('0x21')]=_0x3c09e2;}}if(_0x91041c){_0x4bc5ad[_0x61f2('0x31')](function(_0x2ff376){var _0x439149=!![];if(_0x2f1d53===_0x61f2('0x13')&&_0x27c446!==_0x2ff376){_0x439149=![];}_0x260e09[_0x61f2('0x32')]({[_0x2ff376+_0x61f2('0x33')]:_0x439149});});if(_0x47d4e4){_0x260e09['push']({'pauseType':_0x47d4e4});}}else if(_0x2f1d53){_0x4bc5ad['forEach'](function(_0x455bda){_0x260e09['push']({[_0x455bda+_0x61f2('0x33')]:![]});});}_0x551905[_0x61f2('0x34')]=_[_0x61f2('0x35')](_0x551905[_0x61f2('0x34')],{'$and':_0x260e09});if(_0x55b43e[_0x61f2('0x36')][_0x61f2('0x2b')]===_0x61f2('0x36')){var _0x24f6ff={'params':{'id':_0x55b43e[_0x61f2('0x36')]['userProfileId']},'query':{'section':_0x61f2('0x37'),'role':_0x61f2('0x2c'),'raw':!![],'ids':_0x29f459,'customSorting':_0x3c09e2}};if(_0x55b43e[_0x61f2('0xf')]['online']){_0x24f6ff[_0x61f2('0xf')][_0x61f2('0x38')]=!![];}if(_0x91041c){_0x24f6ff[_0x61f2('0xf')]['extraQueryConditions']=_0x260e09;}_0x24f6ff[_0x61f2('0xf')]=Object['assign'](_0x24f6ff[_0x61f2('0xf')],_0x55b43e['query']);return db[_0x61f2('0x39')][_0x61f2('0x3a')](_0x24f6ff);}return db['User'][_0x61f2('0x3b')](_0x551905);})[_0x61f2('0x15')](function(_0x4fe667){_0x579d40[_0x61f2('0xc')]=_0x4fe667['count'];_0x2dd3a5=_0x4fe667[_0x61f2('0x24')];return _0x2dd3a5[_0x61f2('0x3c')](function(_0x4e55df){var _0x3c981c=_[_0x61f2('0x3d')](_0x4a6165,['id',_0x4e55df['id']]);if(_0x3c981c){var _0x1ce81b=rta[_0x61f2('0x3e')](_0x3c981c);_[_0x61f2('0x35')](_0x4e55df,_0x1ce81b);}_0x4e55df[_0x61f2('0x1c')]=rta[_0x61f2('0x3f')](_0x4e55df);if(_0x4e55df[_0x61f2('0x1c')][_0x61f2('0x40')](_0x61f2('0x12'))){_0x4bc5ad[_0x61f2('0x31')](function(_0xfb182d){if(_0x4e55df[_0xfb182d+_0x61f2('0x33')]){if(_0xfb182d===_0x61f2('0x41')){if(_0x4e55df[_0x61f2('0x42')]!==_0x61f2('0x43')){_0x4e55df[_0x61f2('0x42')]='pause';}}else{_0x4e55df[_0xfb182d+'Status']=_0x61f2('0x12');}}});}return _0x4e55df;});})[_0x61f2('0x15')](function(_0x2aa70d){if(!_0x1b8504||_0x3c09e2){return _0x2aa70d;}return rta[_0x61f2('0x44')](_0x2aa70d,_0x1b8504);})[_0x61f2('0x15')](function(_0x3080b7){var _0x754508=rta[_0x61f2('0x45')]();_0x579d40[_0x61f2('0x24')]=_0x3080b7['map'](function(_0x393abd){return _[_0x61f2('0x46')](_0x393abd,_0x754508);});return _0x579d40;})['then'](respondWithFilteredResult(_0x43636e,_0x551905))['catch'](APIHandleError(_0x43636e));};exports[_0x61f2('0x47')]=function(_0x42113a,_0x306661){var _0x187590={'count':0x0,'rows':[]};var _0x5c90fb={};var _0xc951a3;var _0x14d168;var _0x176bf1;Promise['resolve']()[_0x61f2('0x15')](function(){if(_0x42113a[_0x61f2('0xf')][_0x61f2('0x19')]){if(!utils[_0x61f2('0x16')](_0x42113a[_0x61f2('0xf')][_0x61f2('0x19')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0x42113a['query'][_0x61f2('0x19')]));}_0xc951a3=_0x42113a[_0x61f2('0xf')]['channel'][_0x61f2('0x1a')]();}var _0xa59c9e=_[_0x61f2('0x48')](_0xc951a3)+'Queue';var _0x2e2785=_[_0x61f2('0x3c')](db[_0xa59c9e][_0x61f2('0x49')],function(_0x20263b){return{'name':_0x20263b[_0x61f2('0x28')],'type':_0x20263b['type']['key']};});if(!_0x42113a[_0x61f2('0xf')][_0x61f2('0x1f')]){var _0x1187fe=['id','name'];if(_0xc951a3===_0x61f2('0x41')){_0x1187fe[_0x61f2('0x32')](_0x61f2('0x29'));if(_0x42113a[_0x61f2('0xf')]['type']==='outbound'){_0x1187fe[_0x61f2('0x32')]([_0x61f2('0x4a'),'dialMethod']);}}_0x42113a[_0x61f2('0xf')][_0x61f2('0x1f')]=_0x1187fe['join'](',');}_0x5c90fb=qs[_0x61f2('0x2d')](_0x2e2785,_0x42113a);if(_0x42113a[_0x61f2('0x36')][_0x61f2('0x2b')]===_0x61f2('0x36')){var _0x1e17ad={'params':{'id':_0x42113a[_0x61f2('0x36')][_0x61f2('0x4b')]},'query':{'section':_0xc951a3==='voice'&&_0x42113a['query'][_0x61f2('0x29')]===_0x61f2('0x4c')?'QueueCampaigns':_[_0x61f2('0x48')](_0xc951a3)+_0x61f2('0x4d'),'type':_0x42113a[_0x61f2('0xf')][_0x61f2('0x29')],'nolimit':!![],'sort':_0x61f2('0x4e'),'filter':_0x42113a[_0x61f2('0xf')]['filter']}};_0x1e17ad[_0x61f2('0xf')]=Object[_0x61f2('0x4f')](_0x1e17ad[_0x61f2('0xf')],_0x42113a[_0x61f2('0xf')]);delete _0x1e17ad[_0x61f2('0xf')]['id'];return db[_0x61f2('0x39')]['getResources'](_0x1e17ad);}return db[_0xa59c9e][_0x61f2('0x3b')](_0x5c90fb);})['then'](function(_0x3a34a8){_0x187590[_0x61f2('0xc')]=_0x3a34a8[_0x61f2('0xc')];_0x14d168=_0x3a34a8[_0x61f2('0x24')];return rtq['getRealtimeQueues'](_0x42113a,_0xc951a3);})['then'](function(_0x1080df){_0x176bf1=_0x1080df[_0x61f2('0x24')];return rtq[_0x61f2('0x50')](_0x14d168,_0x176bf1,_0xc951a3,_0x42113a['query']['type']);})[_0x61f2('0x15')](function(_0x103340){_0x187590[_0x61f2('0x24')]=_0x103340;return _0x187590;})[_0x61f2('0x15')](respondWithFilteredResult(_0x306661,_0x5c90fb))['catch'](APIHandleError(_0x306661));}; \ No newline at end of file +var _0x050d=['limit','count','status','set','Content-Range','json','getAgents','getChannels','query','globalStatusFilter','pause','*pause','resolve','then','isValidChannel','channel','format','includes','globalStatus','getUpdatedSortOptions','sort','fields','order','getAgentIdsByQueues','getRealtimeAgents','rows','getAgentIdsByStatus','User','fieldName','type','role','agent','raw','length','push','sequelize','literal','FIELD(id,','forEach','Pause','where','user','userProfileId','Agents','online','extraQueryConditions','UserProfile','getResources','map','filterAgentAttributes','merge','getAgentStatus','voice','voiceStatus','talking','Status','sortAgentsByStatus','getRealtimeAgentsQueryFields','catch','getQueues','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','Queue','rawAttributes','key','outbound','dialActive','dialMethod','join','getOptions','QueueCampaigns','startCase','Queues','name','filter','assign','findAndCountAll','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','../../errors/api','offset','undefined'];(function(_0x2fde21,_0x5998d4){var _0x3f726d=function(_0x367c22){while(--_0x367c22){_0x2fde21['push'](_0x2fde21['shift']());}};_0x3f726d(++_0x5998d4);}(_0x050d,0x156));var _0xd050=function(_0x48fa01,_0x261143){_0x48fa01=_0x48fa01-0x0;var _0x8c57f0=_0x050d[_0x48fa01];return _0x8c57f0;};'use strict';var _=require(_0xd050('0x0'));var util=require(_0xd050('0x1'));var rta=require(_0xd050('0x2'));var rtq=require(_0xd050('0x3'));var qs=require(_0xd050('0x4'));var utils=require(_0xd050('0x5'));var db=require(_0xd050('0x6'))['db'];var APIBadRequestError=require(_0xd050('0x7'))['APIBadRequestError'];var APIHandleError=require(_0xd050('0x7'))['handleError'];function respondWithFilteredResult(_0x5404b8,_0x2cfafc){return function(_0x28f3c6){if(_0x28f3c6){var _0x264d9b=typeof _0x2cfafc[_0xd050('0x8')]===_0xd050('0x9')&&typeof _0x2cfafc[_0xd050('0xa')]===_0xd050('0x9');var _0x510d32=_0x28f3c6['count'];var _0x1b7d7f=_0x264d9b?0x0:_0x2cfafc['offset'];var _0x457099=_0x264d9b?_0x28f3c6[_0xd050('0xb')]:_0x2cfafc[_0xd050('0x8')]+_0x2cfafc['limit'];var _0x363bf3;if(_0x457099>=_0x510d32){_0x457099=_0x510d32;_0x363bf3=0xc8;}else{_0x363bf3=0xce;}_0x5404b8[_0xd050('0xc')](_0x363bf3);return _0x5404b8[_0xd050('0xd')](_0xd050('0xe'),_0x1b7d7f+'-'+_0x457099+'/'+_0x510d32)[_0xd050('0xf')](_0x28f3c6);}return null;};}exports[_0xd050('0x10')]=function(_0x41a53e,_0x322b09){var _0x41f1aa={'count':0x0,'rows':[]};var _0x27cf1c={};var _0x32269d;var _0xef858c=utils[_0xd050('0x11')]();var _0x21d9e7;var _0x59ee5e;var _0x65f9bc=_0x41a53e['query']['globalQueueFilter'];var _0x37a766=_0x41a53e[_0xd050('0x12')][_0xd050('0x13')];var _0x22d90a=_0x41a53e[_0xd050('0x12')]['pauseTypeFilter'];var _0x1d4686=_0x37a766===_0xd050('0x14')||_0x37a766===_0xd050('0x15')?!![]:![];var _0x357f69=[];var _0x35fd37;var _0x1f4bbf;Promise[_0xd050('0x16')]()[_0xd050('0x17')](function(){if(_0x41a53e[_0xd050('0x12')]['channel']){if(!utils[_0xd050('0x18')](_0x41a53e[_0xd050('0x12')][_0xd050('0x19')])){throw new APIBadRequestError(util[_0xd050('0x1a')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x41a53e['query']['channel']));}_0x32269d=_0x41a53e[_0xd050('0x12')]['channel']['toLowerCase']();}if(!_0x41a53e['query']['sort']||!_0x41a53e[_0xd050('0x12')]['sort'][_0xd050('0x1b')](_0xd050('0x1c'))){_0x41a53e['query']['sort']=rta['validateSortParameter'](_0x41a53e[_0xd050('0x12')]['sort']);return;}var _0x4eaec3=rta[_0xd050('0x1d')](_0x41a53e[_0xd050('0x12')][_0xd050('0x1e')]);_0x41a53e['query'][_0xd050('0x1e')]=_0x4eaec3[_0xd050('0x1f')]['join'](',');_0x35fd37=_0x4eaec3[_0xd050('0x20')];})[_0xd050('0x17')](function(){if(!_0x65f9bc){return[];}return rta[_0xd050('0x21')](_0x65f9bc,_0x32269d);})[_0xd050('0x17')](function(_0x401774){_0x357f69=_0x401774;return rta[_0xd050('0x22')]();})[_0xd050('0x17')](function(_0x3ad22f){_0x59ee5e=_0x3ad22f[_0xd050('0x23')];if((!_0x37a766||_0x1d4686)&&!_0x35fd37){return _0x357f69;}if(_0x35fd37&&!_0x37a766){return rta['getSortedAgentsIdsByStatus'](_0x59ee5e,_0x357f69,_0x35fd37);}else{return rta[_0xd050('0x24')](_0x59ee5e,_0x357f69,_0x37a766);}})['then'](function(_0x30f5ea){_0x357f69=_0x30f5ea;var _0x1e8771=![];if(_0x357f69['length']===0x0){if(_0x65f9bc||_0x37a766){_0x1e8771=!![];}if(_0x1d4686){_0x1e8771=![];}}if(_0x1e8771){return _0x41f1aa;}var _0x13516a=_['map'](db[_0xd050('0x25')]['rawAttributes'],function(_0x23b0d1){return{'name':_0x23b0d1[_0xd050('0x26')],'type':_0x23b0d1[_0xd050('0x27')]['key']};});_0x41a53e[_0xd050('0x12')][_0xd050('0x28')]=_0xd050('0x29');_0x27cf1c=qs['getOptions'](_0x13516a,_0x41a53e);_0x27cf1c[_0xd050('0x2a')]=!![];var _0x1b2126=[];if(_0x357f69[_0xd050('0x2b')]>0x0){_0x1b2126[_0xd050('0x2c')]({'id':{'$in':_0x357f69}});if(_0x35fd37&&!_0x37a766){_0x1f4bbf=[db[_0xd050('0x2d')][_0xd050('0x2e')](_0xd050('0x2f')+_0x357f69+')')];_0x27cf1c[_0xd050('0x20')]=_0x1f4bbf;}}if(_0x1d4686){_0xef858c[_0xd050('0x30')](function(_0x2e12a7){var _0x370f7f=!![];if(_0x37a766===_0xd050('0x15')&&_0x32269d!==_0x2e12a7){_0x370f7f=![];}_0x1b2126[_0xd050('0x2c')]({[_0x2e12a7+_0xd050('0x31')]:_0x370f7f});});if(_0x22d90a){_0x1b2126['push']({'pauseType':_0x22d90a});}}else if(_0x37a766){_0xef858c[_0xd050('0x30')](function(_0x35077e){_0x1b2126['push']({[_0x35077e+_0xd050('0x31')]:![]});});}_0x27cf1c[_0xd050('0x32')]=_['merge'](_0x27cf1c['where'],{'$and':_0x1b2126});if(_0x41a53e['user'][_0xd050('0x28')]===_0xd050('0x33')){var _0x691b12={'params':{'id':_0x41a53e['user'][_0xd050('0x34')]},'query':{'section':_0xd050('0x35'),'role':'agent','raw':!![],'ids':_0x357f69,'customSorting':_0x1f4bbf}};if(_0x41a53e[_0xd050('0x12')][_0xd050('0x36')]){_0x691b12['query'][_0xd050('0x36')]=!![];}if(_0x1d4686){_0x691b12[_0xd050('0x12')][_0xd050('0x37')]=_0x1b2126;}_0x691b12[_0xd050('0x12')]=Object['assign'](_0x691b12[_0xd050('0x12')],_0x41a53e[_0xd050('0x12')]);return db[_0xd050('0x38')][_0xd050('0x39')](_0x691b12);}return db['User']['findAndCountAll'](_0x27cf1c);})['then'](function(_0x2fc349){_0x41f1aa[_0xd050('0xb')]=_0x2fc349[_0xd050('0xb')];_0x21d9e7=_0x2fc349[_0xd050('0x23')];return _0x21d9e7[_0xd050('0x3a')](function(_0x16d0b2){var _0x43d187=_['find'](_0x59ee5e,['id',_0x16d0b2['id']]);if(_0x43d187){var _0x47e2b7=rta[_0xd050('0x3b')](_0x43d187);_[_0xd050('0x3c')](_0x16d0b2,_0x47e2b7);}_0x16d0b2['globalStatus']=rta[_0xd050('0x3d')](_0x16d0b2);if(_0x16d0b2[_0xd050('0x1c')][_0xd050('0x1b')](_0xd050('0x14'))){_0xef858c[_0xd050('0x30')](function(_0x2bd8ab){if(_0x16d0b2[_0x2bd8ab+'Pause']){if(_0x2bd8ab===_0xd050('0x3e')){if(_0x16d0b2[_0xd050('0x3f')]!==_0xd050('0x40')){_0x16d0b2[_0xd050('0x3f')]=_0xd050('0x14');}}else{_0x16d0b2[_0x2bd8ab+_0xd050('0x41')]=_0xd050('0x14');}}});}return _0x16d0b2;});})[_0xd050('0x17')](function(_0x446b68){if(!_0x35fd37||_0x1f4bbf){return _0x446b68;}return rta[_0xd050('0x42')](_0x446b68,_0x35fd37);})[_0xd050('0x17')](function(_0x12ada0){var _0x5e6f90=rta[_0xd050('0x43')]();_0x41f1aa[_0xd050('0x23')]=_0x12ada0['map'](function(_0x4976d5){return _['pick'](_0x4976d5,_0x5e6f90);});return _0x41f1aa;})[_0xd050('0x17')](respondWithFilteredResult(_0x322b09,_0x27cf1c))[_0xd050('0x44')](APIHandleError(_0x322b09));};exports[_0xd050('0x45')]=function(_0x521dd5,_0xdc2411){var _0x2708e6={'count':0x0,'rows':[]};var _0x466d1b={};var _0x3b34ff;var _0x2ef17d;var _0x39b8d3;Promise['resolve']()[_0xd050('0x17')](function(){if(_0x521dd5[_0xd050('0x12')]['channel']){if(!utils['isValidChannel'](_0x521dd5[_0xd050('0x12')][_0xd050('0x19')])){throw new APIBadRequestError(util[_0xd050('0x1a')](_0xd050('0x46'),_0x521dd5[_0xd050('0x12')][_0xd050('0x19')]));}_0x3b34ff=_0x521dd5[_0xd050('0x12')][_0xd050('0x19')][_0xd050('0x47')]();}var _0x3779da=_['startCase'](_0x3b34ff)+_0xd050('0x48');var _0x47a351=_[_0xd050('0x3a')](db[_0x3779da][_0xd050('0x49')],function(_0x538420){return{'name':_0x538420[_0xd050('0x26')],'type':_0x538420[_0xd050('0x27')][_0xd050('0x4a')]};});if(!_0x521dd5[_0xd050('0x12')][_0xd050('0x1f')]){var _0x1619f6=['id','name'];if(_0x3b34ff===_0xd050('0x3e')){_0x1619f6['push']('type');if(_0x521dd5['query'][_0xd050('0x27')]===_0xd050('0x4b')){_0x1619f6['push']([_0xd050('0x4c'),_0xd050('0x4d')]);}}_0x521dd5[_0xd050('0x12')][_0xd050('0x1f')]=_0x1619f6[_0xd050('0x4e')](',');}_0x466d1b=qs[_0xd050('0x4f')](_0x47a351,_0x521dd5);if(_0x521dd5[_0xd050('0x33')]['role']===_0xd050('0x33')){var _0x1ed299={'params':{'id':_0x521dd5['user'][_0xd050('0x34')]},'query':{'section':_0x3b34ff===_0xd050('0x3e')&&_0x521dd5[_0xd050('0x12')][_0xd050('0x27')]===_0xd050('0x4b')?_0xd050('0x50'):_[_0xd050('0x51')](_0x3b34ff)+_0xd050('0x52'),'type':_0x521dd5['query'][_0xd050('0x27')],'nolimit':!![],'sort':_0xd050('0x53'),'filter':_0x521dd5[_0xd050('0x12')][_0xd050('0x54')]}};_0x1ed299[_0xd050('0x12')]=Object[_0xd050('0x55')](_0x1ed299[_0xd050('0x12')],_0x521dd5[_0xd050('0x12')]);delete _0x1ed299[_0xd050('0x12')]['id'];return db[_0xd050('0x38')]['getResources'](_0x1ed299);}return db[_0x3779da][_0xd050('0x56')](_0x466d1b);})[_0xd050('0x17')](function(_0x581107){_0x2708e6[_0xd050('0xb')]=_0x581107[_0xd050('0xb')];_0x2ef17d=_0x581107[_0xd050('0x23')];return rtq['getRealtimeQueues'](_0x521dd5,_0x3b34ff);})[_0xd050('0x17')](function(_0x3860ff){_0x39b8d3=_0x3860ff['rows'];return rtq[_0xd050('0x57')](_0x2ef17d,_0x39b8d3,_0x3b34ff,_0x521dd5[_0xd050('0x12')][_0xd050('0x27')]);})['then'](function(_0x17b2ec){_0x2708e6['rows']=_0x17b2ec;return _0x2708e6;})['then'](respondWithFilteredResult(_0xdc2411,_0x466d1b))[_0xd050('0x44')](APIHandleError(_0xdc2411));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 260d50c..9d644e1 100644 --- a/server/api/reportAgentPreview/index.js +++ b/server/api/reportAgentPreview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x45512e,_0xd04758){var _0x32755e=function(_0x538986){while(--_0x538986){_0x45512e['push'](_0x45512e['shift']());}};_0x32755e(++_0xd04758);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1d29de,_0x521099){var _0x3df404=function(_0x2d54a3){while(--_0x2d54a3){_0x1d29de['push'](_0x1d29de['shift']());}};_0x3df404(++_0x521099);}(_0x70e0,0x17b));var _0x070e=function(_0x2879f5,_0x2d0617){_0x2879f5=_0x2879f5-0x0;var _0x4b4ea7=_0x70e0[_0x2879f5];return _0x4b4ea7;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 639b2be..5cd500c 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 _0x0170=['sequelize','exports','STRING','DATE','INTEGER'];(function(_0x5883c7,_0x3cabe6){var _0x3db4cd=function(_0x247144){while(--_0x247144){_0x5883c7['push'](_0x5883c7['shift']());}};_0x3db4cd(++_0x3cabe6);}(_0x0170,0x1d6));var _0x0017=function(_0xfccf7c,_0x48276c){_0xfccf7c=_0xfccf7c-0x0;var _0x74f10e=_0x0170[_0xfccf7c];return _0x74f10e;};'use strict';var Sequelize=require(_0x0017('0x0'));module[_0x0017('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x0017('0x2')]},'scheduledat':{'type':Sequelize[_0x0017('0x3')]},'uniqueid':{'type':Sequelize[_0x0017('0x2')]},'starttime':{'type':Sequelize[_0x0017('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0017('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x0017('0x2')]},'campaigntype':{'type':Sequelize[_0x0017('0x2')]},'membername':{'type':Sequelize[_0x0017('0x2')]}}; \ No newline at end of file +var _0x2706=['INTEGER','STRING','DATE','exports'];(function(_0x125ff8,_0x41925f){var _0x2d9ef=function(_0x4ef34c){while(--_0x4ef34c){_0x125ff8['push'](_0x125ff8['shift']());}};_0x2d9ef(++_0x41925f);}(_0x2706,0x107));var _0x6270=function(_0x2c2456,_0x572fab){_0x2c2456=_0x2c2456-0x0;var _0x1d8bd4=_0x2706[_0x2c2456];return _0x1d8bd4;};'use strict';var Sequelize=require('sequelize');module[_0x6270('0x0')]={'state':{'type':Sequelize[_0x6270('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6270('0x2')]},'scheduledat':{'type':Sequelize[_0x6270('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x6270('0x3')]},'responsetime':{'type':Sequelize[_0x6270('0x3')]},'ringtime':{'type':Sequelize[_0x6270('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6270('0x2')]},'campaigntype':{'type':Sequelize[_0x6270('0x2')]},'membername':{'type':Sequelize[_0x6270('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 8fc5a53..1f87661 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 _0xc274=['bluebird','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','report_agent_preview','lodash','util','../../config/logger','api','moment'];(function(_0x19c160,_0x25797f){var _0x5444ee=function(_0x1659a5){while(--_0x1659a5){_0x19c160['push'](_0x19c160['shift']());}};_0x5444ee(++_0x25797f);}(_0xc274,0x127));var _0x4c27=function(_0x43ec83,_0x15c436){_0x43ec83=_0x43ec83-0x0;var _0x3ae207=_0xc274[_0x43ec83];return _0x3ae207;};'use strict';var _=require(_0x4c27('0x0'));var util=require(_0x4c27('0x1'));var logger=require(_0x4c27('0x2'))(_0x4c27('0x3'));var moment=require(_0x4c27('0x4'));var BPromise=require(_0x4c27('0x5'));var rp=require(_0x4c27('0x6'));var fs=require('fs');var path=require(_0x4c27('0x7'));var rimraf=require(_0x4c27('0x8'));var config=require(_0x4c27('0x9'));var attributes=require(_0x4c27('0xa'));module['exports']=function(_0x183a10,_0x40c7e8){return _0x183a10['define']('ReportAgentPreview',attributes,{'tableName':_0x4c27('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc13a=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ReportAgentPreview','lodash','util'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0xc13a,0x132));var _0xac13=function(_0x1a2665,_0x3a493b){_0x1a2665=_0x1a2665-0x0;var _0x18c4f0=_0xc13a[_0x1a2665];return _0x18c4f0;};'use strict';var _=require(_0xac13('0x0'));var util=require(_0xac13('0x1'));var logger=require(_0xac13('0x2'))(_0xac13('0x3'));var moment=require(_0xac13('0x4'));var BPromise=require(_0xac13('0x5'));var rp=require(_0xac13('0x6'));var fs=require('fs');var path=require(_0xac13('0x7'));var rimraf=require(_0xac13('0x8'));var config=require(_0xac13('0x9'));var attributes=require('./reportAgentPreview.attributes');module['exports']=function(_0x125c66,_0x163093){return _0x125c66['define'](_0xac13('0xa'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 8fcf3e5..f5b2828 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 _0x4e74=['then','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','options','raw'];(function(_0x347181,_0x40d499){var _0x2c6ef1=function(_0x2f0f0f){while(--_0x2f0f0f){_0x347181['push'](_0x347181['shift']());}};_0x2c6ef1(++_0x40d499);}(_0x4e74,0x16e));var _0x44e7=function(_0x12aaee,_0x5bf50c){_0x12aaee=_0x12aaee-0x0;var _0x37c350=_0x4e74[_0x12aaee];return _0x37c350;};'use strict';var _=require(_0x44e7('0x0'));var util=require(_0x44e7('0x1'));var moment=require('moment');var BPromise=require(_0x44e7('0x2'));var rs=require(_0x44e7('0x3'));var fs=require('fs');var Redis=require(_0x44e7('0x4'));var db=require(_0x44e7('0x5'))['db'];var utils=require(_0x44e7('0x6'));var logger=require('../../config/logger')(_0x44e7('0x7'));var config=require(_0x44e7('0x8'));var jayson=require(_0x44e7('0x9'));var client=jayson[_0x44e7('0xa')][_0x44e7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x46a16e,_0x40e387,_0x3c0924){return new BPromise(function(_0x167745,_0x2db2f3){return client[_0x44e7('0xc')](_0x46a16e,_0x3c0924)['then'](function(_0x4a5281){logger['info'](_0x44e7('0xd'),_0x40e387,_0x44e7('0xe'));logger[_0x44e7('0xf')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x40e387,'request\x20sent',JSON[_0x44e7('0x10')](_0x4a5281));if(_0x4a5281[_0x44e7('0x11')]){if(_0x4a5281['error'][_0x44e7('0x12')]===0x1f4){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x40e387,_0x4a5281[_0x44e7('0x11')][_0x44e7('0x13')]);return _0x2db2f3(_0x4a5281[_0x44e7('0x11')][_0x44e7('0x13')]);}logger[_0x44e7('0x11')](_0x44e7('0xd'),_0x40e387,_0x4a5281[_0x44e7('0x11')][_0x44e7('0x13')]);return _0x167745(_0x4a5281['error'][_0x44e7('0x13')]);}else{logger[_0x44e7('0x14')](_0x44e7('0xd'),_0x40e387,_0x44e7('0xe'));_0x167745(_0x4a5281[_0x44e7('0x15')][_0x44e7('0x13')]);}})['catch'](function(_0x5a4025){logger['error'](_0x44e7('0xd'),_0x40e387,_0x5a4025);_0x2db2f3(_0x5a4025);});});}exports[_0x44e7('0x16')]=function(_0xc49f75){var _0x515c6e=this;return new Promise(function(_0x5eaed1,_0x8e8d59){return db[_0x44e7('0x17')]['create'](_0xc49f75['body'],{'raw':_0xc49f75[_0x44e7('0x18')]?_0xc49f75[_0x44e7('0x18')][_0x44e7('0x19')]===undefined?!![]:![]:!![]})[_0x44e7('0x1a')](function(_0x4afce2){logger[_0x44e7('0x14')](_0x44e7('0x16'),_0xc49f75);logger['debug'](_0x44e7('0x16'),_0xc49f75,JSON[_0x44e7('0x10')](_0x4afce2));_0x5eaed1(_0x4afce2);})[_0x44e7('0x1b')](function(_0x10c064){logger[_0x44e7('0x11')](_0x44e7('0x16'),_0x10c064[_0x44e7('0x13')],_0xc49f75);_0x8e8d59(_0x515c6e['error'](0x1f4,_0x10c064[_0x44e7('0x13')]));});});}; \ No newline at end of file +var _0xba52=['then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ReportAgentPreview','body','options','raw','CreateReportAgentPreview','debug','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0xba52,0xf1));var _0x2ba5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xba52[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x2ba5('0x0'));var util=require(_0x2ba5('0x1'));var moment=require(_0x2ba5('0x2'));var BPromise=require(_0x2ba5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ba5('0x4'));var db=require(_0x2ba5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2ba5('0x6'))(_0x2ba5('0x7'));var config=require('../../config/environment');var jayson=require(_0x2ba5('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbe6b85,_0x5b9e1a,_0x4c604d){return new BPromise(function(_0x154f17,_0x2d4297){return client['request'](_0xbe6b85,_0x4c604d)[_0x2ba5('0x9')](function(_0x286d7b){logger[_0x2ba5('0xa')](_0x2ba5('0xb'),_0x5b9e1a,_0x2ba5('0xc'));logger['debug'](_0x2ba5('0xd'),_0x5b9e1a,'request\x20sent',JSON[_0x2ba5('0xe')](_0x286d7b));if(_0x286d7b[_0x2ba5('0xf')]){if(_0x286d7b[_0x2ba5('0xf')][_0x2ba5('0x10')]===0x1f4){logger[_0x2ba5('0xf')](_0x2ba5('0xb'),_0x5b9e1a,_0x286d7b[_0x2ba5('0xf')][_0x2ba5('0x11')]);return _0x2d4297(_0x286d7b[_0x2ba5('0xf')]['message']);}logger['error'](_0x2ba5('0xb'),_0x5b9e1a,_0x286d7b['error']['message']);return _0x154f17(_0x286d7b['error']['message']);}else{logger[_0x2ba5('0xa')]('ReportAgentPreview,\x20%s,\x20%s',_0x5b9e1a,_0x2ba5('0xc'));_0x154f17(_0x286d7b['result'][_0x2ba5('0x11')]);}})['catch'](function(_0x205a89){logger[_0x2ba5('0xf')](_0x2ba5('0xb'),_0x5b9e1a,_0x205a89);_0x2d4297(_0x205a89);});});}exports['CreateReportAgentPreview']=function(_0x581adc){var _0x43ad03=this;return new Promise(function(_0x40864f,_0x4681a9){return db[_0x2ba5('0x12')]['create'](_0x581adc[_0x2ba5('0x13')],{'raw':_0x581adc[_0x2ba5('0x14')]?_0x581adc['options'][_0x2ba5('0x15')]===undefined?!![]:![]:!![]})[_0x2ba5('0x9')](function(_0xe7d5fa){logger[_0x2ba5('0xa')](_0x2ba5('0x16'),_0x581adc);logger[_0x2ba5('0x17')](_0x2ba5('0x16'),_0x581adc,JSON['stringify'](_0xe7d5fa));_0x40864f(_0xe7d5fa);})[_0x2ba5('0x18')](function(_0x29de4e){logger[_0x2ba5('0xf')](_0x2ba5('0x16'),_0x29de4e['message'],_0x581adc);_0x4681a9(_0x43ad03['error'](0x1f4,_0x29de4e[_0x2ba5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 1919d76..c6ba32c 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 _0xd479=['/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','showWhatsappQueues','/agents/:id/notify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','mailQueues','mailAccounts','/openchannel/queues','/sms/queues','smsQueues','/whatsapp/queues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','/telephones','telephones','/trunks','trunks','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions'];(function(_0x341157,_0x31346f){var _0x5de891=function(_0x342f1b){while(--_0x342f1b){_0x341157['push'](_0x341157['shift']());}};_0x5de891(++_0x31346f);}(_0xd479,0x10f));var _0x9d47=function(_0x5d4a24,_0x56b7d5){_0x5d4a24=_0x5d4a24-0x0;var _0xb9a289=_0xd479[_0x5d4a24];return _0xb9a289;};'use strict';var multer=require(_0x9d47('0x0'));var util=require(_0x9d47('0x1'));var path=require('path');var express=require(_0x9d47('0x2'));var router=express[_0x9d47('0x3')]();var auth=require(_0x9d47('0x4'));var controller=require(_0x9d47('0x5'));router[_0x9d47('0x6')](_0x9d47('0x7'),auth[_0x9d47('0x8')](),controller['voiceChannels']);router[_0x9d47('0x6')](_0x9d47('0x9'),auth[_0x9d47('0x8')](),controller['voiceChannelMixMonitor']);router['get'](_0x9d47('0xa'),auth[_0x9d47('0x8')](),controller[_0x9d47('0xb')]);router[_0x9d47('0x6')](_0x9d47('0xc'),auth[_0x9d47('0x8')](),controller[_0x9d47('0xd')]);router['get']('/chat/queues',auth[_0x9d47('0x8')](),controller[_0x9d47('0xe')]);router[_0x9d47('0x6')]('/mail/queues',auth['isAuthenticated'](),controller[_0x9d47('0xf')]);router[_0x9d47('0x6')]('/mail/accounts',auth[_0x9d47('0x8')](),controller[_0x9d47('0x10')]);router[_0x9d47('0x6')](_0x9d47('0x11'),auth[_0x9d47('0x8')](),controller['openchannelQueues']);router[_0x9d47('0x6')](_0x9d47('0x12'),auth['isAuthenticated'](),controller[_0x9d47('0x13')]);router[_0x9d47('0x6')](_0x9d47('0x14'),auth['isAuthenticated'](),controller['whatsappQueues']);router[_0x9d47('0x6')](_0x9d47('0x15'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x16')]);router['get'](_0x9d47('0x17'),auth['isAuthenticated'](),controller[_0x9d47('0x18')]);router['get'](_0x9d47('0x19'),auth[_0x9d47('0x8')](),controller['voiceQueuesChannels']);router[_0x9d47('0x6')](_0x9d47('0x1a'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x1b')]);router[_0x9d47('0x6')](_0x9d47('0x1c'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x1d')]);router['get'](_0x9d47('0x1e'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x1f')]);router['get'](_0x9d47('0x20'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x21')]);router[_0x9d47('0x22')](_0x9d47('0x20'),auth[_0x9d47('0x8')](),controller['updateVoiceQueue']);router[_0x9d47('0x6')]('/outbound',auth[_0x9d47('0x8')](),controller['outbound']);router[_0x9d47('0x6')](_0x9d47('0x23'),auth['isAuthenticated'](),controller[_0x9d47('0x24')]);router[_0x9d47('0x6')](_0x9d47('0x25'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x26')]);router[_0x9d47('0x22')](_0x9d47('0x27'),auth[_0x9d47('0x8')](),controller['agentCapacity']);router['get'](_0x9d47('0x28'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x29')]);router['get'](_0x9d47('0x2a'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x2b')]);router[_0x9d47('0x6')]('/campaigns',auth[_0x9d47('0x8')](),controller[_0x9d47('0x2c')]);router['get'](_0x9d47('0x2d'),auth['isAuthenticated'](),controller['faxAccounts']);router[_0x9d47('0x6')](_0x9d47('0x2e'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x2f')]);router[_0x9d47('0x6')](_0x9d47('0x30'),auth['isAuthenticated'](),controller[_0x9d47('0x31')]);router[_0x9d47('0x6')]('/openchannel/queues/waitinginteractions',auth[_0x9d47('0x8')](),controller[_0x9d47('0x32')]);router['get'](_0x9d47('0x33'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x34')]);router['get'](_0x9d47('0x35'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x36')]);router[_0x9d47('0x6')](_0x9d47('0x37'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x38')]);router[_0x9d47('0x6')](_0x9d47('0x39'),auth['isAuthenticated'](),controller[_0x9d47('0x3a')]);router[_0x9d47('0x3b')](_0x9d47('0x3c'),auth[_0x9d47('0x8')](),controller['queueNotify']('mail'));router['get'](_0x9d47('0x3d'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x3e')]);router[_0x9d47('0x3b')](_0x9d47('0x3f'),auth['isAuthenticated'](),controller[_0x9d47('0x40')](_0x9d47('0x41')));router['get'](_0x9d47('0x42'),auth['isAuthenticated'](),controller[_0x9d47('0x43')]);router[_0x9d47('0x3b')](_0x9d47('0x44'),auth[_0x9d47('0x8')](),controller['queueNotify'](_0x9d47('0x45')));router['get'](_0x9d47('0x46'),auth[_0x9d47('0x8')](),controller[_0x9d47('0x47')]);router[_0x9d47('0x3b')](_0x9d47('0x48'),auth[_0x9d47('0x8')](),controller['queueNotify']('openchannel'));router['get'](_0x9d47('0x49'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router['post']('/sms/queues/:id/notify',auth[_0x9d47('0x8')](),controller[_0x9d47('0x40')](_0x9d47('0x4a')));router[_0x9d47('0x3b')](_0x9d47('0x4b'),auth['isAuthenticated'](),controller['queueNotify']('whatsapp'));router[_0x9d47('0x6')](_0x9d47('0x4c'),auth['isAuthenticated'](),controller[_0x9d47('0x4d')]);router[_0x9d47('0x6')]('/whatsapp/queues/:id',auth[_0x9d47('0x8')](),controller[_0x9d47('0x4e')]);router[_0x9d47('0x3b')](_0x9d47('0x4f'),auth[_0x9d47('0x8')](),controller['agentNotify']);module[_0x9d47('0x50')]=router; \ No newline at end of file +var _0x7551=['/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','exports','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','voiceChannels','/voice/channels/:uniqueid/mixmonitor','isAuthenticated','voiceChannelMixMonitor','/chat/queues','/mail/queues','mailQueues','/mail/accounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','/outbound/channels','/agents','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues'];(function(_0x324fe8,_0x1ccb46){var _0x4a1cd9=function(_0x506af2){while(--_0x506af2){_0x324fe8['push'](_0x324fe8['shift']());}};_0x4a1cd9(++_0x1ccb46);}(_0x7551,0x1a3));var _0x1755=function(_0xf7c016,_0x18ed88){_0xf7c016=_0xf7c016-0x0;var _0x18e7ea=_0x7551[_0xf7c016];return _0x18e7ea;};'use strict';var multer=require(_0x1755('0x0'));var util=require(_0x1755('0x1'));var path=require(_0x1755('0x2'));var express=require(_0x1755('0x3'));var router=express[_0x1755('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0x1755('0x5'));router[_0x1755('0x6')](_0x1755('0x7'),auth['isAuthenticated'](),controller[_0x1755('0x8')]);router[_0x1755('0x6')](_0x1755('0x9'),auth[_0x1755('0xa')](),controller[_0x1755('0xb')]);router['get']('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x1755('0xa')](),controller['voiceChannelStopMixMonitor']);router['get']('/voice/queues',auth[_0x1755('0xa')](),controller['voiceQueues']);router['get'](_0x1755('0xc'),auth['isAuthenticated'](),controller['chatQueues']);router[_0x1755('0x6')](_0x1755('0xd'),auth[_0x1755('0xa')](),controller[_0x1755('0xe')]);router['get'](_0x1755('0xf'),auth[_0x1755('0xa')](),controller['mailAccounts']);router[_0x1755('0x6')]('/openchannel/queues',auth['isAuthenticated'](),controller[_0x1755('0x10')]);router['get'](_0x1755('0x11'),auth[_0x1755('0xa')](),controller[_0x1755('0x12')]);router[_0x1755('0x6')](_0x1755('0x13'),auth['isAuthenticated'](),controller[_0x1755('0x14')]);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0x1755('0x15')]);router[_0x1755('0x6')]('/voice/queues/preview/:id',auth[_0x1755('0xa')](),controller[_0x1755('0x16')]);router[_0x1755('0x6')](_0x1755('0x17'),auth['isAuthenticated'](),controller[_0x1755('0x18')]);router['get']('/voice/queues/channels/:uniqueid',auth[_0x1755('0xa')](),controller[_0x1755('0x19')]);router[_0x1755('0x6')](_0x1755('0x1a'),auth[_0x1755('0xa')](),controller['voiceQueuesChannelHangup']);router[_0x1755('0x6')](_0x1755('0x1b'),auth[_0x1755('0xa')](),controller[_0x1755('0x1c')]);router['get'](_0x1755('0x1d'),auth[_0x1755('0xa')](),controller[_0x1755('0x1e')]);router['put'](_0x1755('0x1d'),auth[_0x1755('0xa')](),controller[_0x1755('0x1f')]);router['get'](_0x1755('0x20'),auth['isAuthenticated'](),controller[_0x1755('0x21')]);router[_0x1755('0x6')](_0x1755('0x22'),auth[_0x1755('0xa')](),controller['outboundChannels']);router[_0x1755('0x6')](_0x1755('0x23'),auth[_0x1755('0xa')](),controller['agents']);router['put']('/agents/:id/capacity',auth[_0x1755('0xa')](),controller[_0x1755('0x24')]);router[_0x1755('0x6')](_0x1755('0x25'),auth[_0x1755('0xa')](),controller[_0x1755('0x26')]);router[_0x1755('0x6')](_0x1755('0x27'),auth[_0x1755('0xa')](),controller[_0x1755('0x28')]);router[_0x1755('0x6')](_0x1755('0x29'),auth['isAuthenticated'](),controller[_0x1755('0x2a')]);router[_0x1755('0x6')](_0x1755('0x2b'),auth['isAuthenticated'](),controller[_0x1755('0x2c')]);router[_0x1755('0x6')](_0x1755('0x2d'),auth[_0x1755('0xa')](),controller[_0x1755('0x2e')]);router['get']('/mail/queues/waitinginteractions',auth[_0x1755('0xa')](),controller[_0x1755('0x2f')]);router[_0x1755('0x6')](_0x1755('0x30'),auth['isAuthenticated'](),controller[_0x1755('0x31')]);router[_0x1755('0x6')](_0x1755('0x32'),auth[_0x1755('0xa')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x1755('0x6')](_0x1755('0x33'),auth[_0x1755('0xa')](),controller[_0x1755('0x34')]);router[_0x1755('0x6')](_0x1755('0x35'),auth[_0x1755('0xa')](),controller[_0x1755('0x36')]);router[_0x1755('0x6')]('/fax/queues/waitinginteractions',auth[_0x1755('0xa')](),controller['faxQueuesWaitingInteractions']);router[_0x1755('0x37')](_0x1755('0x38'),auth[_0x1755('0xa')](),controller[_0x1755('0x39')](_0x1755('0x3a')));router['get'](_0x1755('0x3b'),auth[_0x1755('0xa')](),controller[_0x1755('0x3c')]);router[_0x1755('0x37')](_0x1755('0x3d'),auth['isAuthenticated'](),controller[_0x1755('0x39')](_0x1755('0x3e')));router[_0x1755('0x6')](_0x1755('0x3f'),auth[_0x1755('0xa')](),controller[_0x1755('0x40')]);router[_0x1755('0x37')](_0x1755('0x41'),auth[_0x1755('0xa')](),controller[_0x1755('0x39')]('fax'));router[_0x1755('0x6')](_0x1755('0x42'),auth['isAuthenticated'](),controller[_0x1755('0x43')]);router[_0x1755('0x37')](_0x1755('0x44'),auth[_0x1755('0xa')](),controller['queueNotify'](_0x1755('0x45')));router[_0x1755('0x6')](_0x1755('0x46'),auth[_0x1755('0xa')](),controller[_0x1755('0x47')]);router['post'](_0x1755('0x48'),auth[_0x1755('0xa')](),controller[_0x1755('0x39')](_0x1755('0x49')));router[_0x1755('0x37')](_0x1755('0x4a'),auth[_0x1755('0xa')](),controller['queueNotify'](_0x1755('0x4b')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller['showSmsQueues']);router[_0x1755('0x6')](_0x1755('0x4c'),auth[_0x1755('0xa')](),controller[_0x1755('0x4d')]);router[_0x1755('0x37')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x1755('0x4e')]);module[_0x1755('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index c2e77b2..6836493 100644 --- a/server/api/rpc/rpc.controller.js +++ b/server/api/rpc/rpc.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x122f6a,_0x42dccf){var _0x439ff3=function(_0x321be1){while(--_0x321be1){_0x122f6a['push'](_0x122f6a['shift']());}};_0x439ff3(++_0x42dccf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file +var _0xbaf0=['MailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','Agent\x20not\x20found','InteractionId','agentTransferTimeout','moment','lodash','util','../../mysqldb','../../config/logger','api','client','http','request','then','error','code','message','result','status','sendStatus','stack','name','isNil','rows','voiceChannels','VoiceChannels','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','updateVoiceQueue','UpdateVoiceQueue','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','FaxQueues','faxAccounts','FaxAccounts','mailQueuesWaitingInteractions'];(function(_0x19f6c2,_0x27ba35){var _0x457d2d=function(_0x330ca6){while(--_0x330ca6){_0x19f6c2['push'](_0x19f6c2['shift']());}};_0x457d2d(++_0x27ba35);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var BPromise=require('bluebird');var moment=require(_0x0baf('0x0'));var _=require(_0x0baf('0x1'));var util=require(_0x0baf('0x2'));var db=require(_0x0baf('0x3'))['db'];var logger=require(_0x0baf('0x4'))(_0x0baf('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232a});var mailClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232b});var routingClient=jayson[_0x0baf('0x6')][_0x0baf('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){var _0x5f20aa=_0x1d0a0d?_0x1d0a0d:amiClient;return _0x5f20aa[_0x0baf('0x8')](_0x1a10b1,_0x2dcaac)[_0x0baf('0x9')](function(_0x465528){if(_0x465528[_0x0baf('0xa')]){if(_0x465528[_0x0baf('0xa')][_0x0baf('0xb')]===0x1f4){return _0x11b947(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}return _0x5f5030(_0x465528[_0x0baf('0xa')][_0x0baf('0xc')]);}else{_0x5f5030(_0x465528[_0x0baf('0xd')]);}})['catch'](function(_0x5a53e2){_0x11b947(_0x5a53e2);});});}function respondWithResult(_0x465dd7,_0xe4378c){_0xe4378c=_0xe4378c||0xc8;return function(_0x5db689){if(_0x5db689){return _0x465dd7[_0x0baf('0xe')](_0xe4378c)['json'](_0x5db689);}return _0x465dd7[_0x0baf('0xf')](0x194);};}function handleError(_0x49e44b,_0x1c76a8){_0x1c76a8=_0x1c76a8||0x1f4;return function(_0x1f50c3){logger[_0x0baf('0xa')](_0x1f50c3[_0x0baf('0x10')]);if(_0x1f50c3[_0x0baf('0x11')]){delete _0x1f50c3[_0x0baf('0x11')];}_0x49e44b['status'](_0x1c76a8)['send'](_0x1f50c3);};}function findById(_0x2312c7){return function(_0x38395b){if(!_[_0x0baf('0x12')](_0x2312c7)&&!_[_0x0baf('0x12')](_0x38395b)&&!_[_0x0baf('0x12')](_0x38395b[_0x0baf('0x13')])){return _['find'](_0x38395b[_0x0baf('0x13')],function(_0xfbecec){return _0xfbecec['id']==_0x2312c7;});}return null;};}exports[_0x0baf('0x14')]=function(_0x3e9cb4,_0x47070d){return respondWithRpcPromise(_0x0baf('0x15'),_0x3e9cb4['query'])['then'](respondWithResult(_0x47070d,null))[_0x0baf('0x16')](handleError(_0x47070d,null));};exports[_0x0baf('0x17')]=function(_0x32e839,_0x1848e8){return respondWithRpcPromise(_0x0baf('0x18'),_[_0x0baf('0x19')](_0x32e839[_0x0baf('0x1a')],_0x32e839[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1848e8,null))[_0x0baf('0x16')](handleError(_0x1848e8,null));};exports['voiceChannelStopMixMonitor']=function(_0x334bd6,_0x482522){return respondWithRpcPromise(_0x0baf('0x1c'),_['merge'](_0x334bd6['query'],_0x334bd6[_0x0baf('0x1b')]))['then'](respondWithResult(_0x482522,null))['catch'](handleError(_0x482522,null));};exports[_0x0baf('0x1d')]=function(_0x27b59c,_0x34e264){return respondWithRpcPromise(_0x0baf('0x1e'),_0x27b59c[_0x0baf('0x1a')])['then'](respondWithResult(_0x34e264,null))[_0x0baf('0x16')](handleError(_0x34e264,null));};exports[_0x0baf('0x1f')]=function(_0x1ca35a,_0x366e71){return respondWithRpcPromise(_0x0baf('0x1e'),_0x1ca35a[_0x0baf('0x1a')])[_0x0baf('0x9')](findById(_0x1ca35a['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x366e71,null))[_0x0baf('0x16')](handleError(_0x366e71,null));};exports[_0x0baf('0x20')]=function(_0x265915,_0x55c715){return respondWithRpcPromise(_0x0baf('0x21'),_[_0x0baf('0x19')](_0x265915['body'],_0x265915[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x55c715,null))[_0x0baf('0x16')](handleError(_0x55c715,null));};exports[_0x0baf('0x22')]=function(_0xd14f0f,_0x366924){return respondWithRpcPromise(_0x0baf('0x23'),_['merge'](_0xd14f0f[_0x0baf('0x1a')],_0xd14f0f[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x366924,null))[_0x0baf('0x16')](handleError(_0x366924,null));};exports[_0x0baf('0x24')]=function(_0x275ea1,_0x2fc983){return respondWithRpcPromise(_0x0baf('0x25'),_0x275ea1[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x2fc983,null))[_0x0baf('0x16')](handleError(_0x2fc983,null));};exports[_0x0baf('0x26')]=function(_0x45294a,_0x3a3353){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0baf('0x19')](_0x45294a['query'],_0x45294a[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x3a3353,null))[_0x0baf('0x16')](handleError(_0x3a3353,null));};exports[_0x0baf('0x27')]=function(_0x5300a5,_0x1a2b03){return respondWithRpcPromise(_0x0baf('0x28'),_['merge'](_0x5300a5[_0x0baf('0x1a')],_0x5300a5[_0x0baf('0x1b')]))[_0x0baf('0x9')](respondWithResult(_0x1a2b03,null))[_0x0baf('0x16')](handleError(_0x1a2b03,null));};exports[_0x0baf('0x29')]=function(_0x1b0991,_0xe03d82){return respondWithRpcPromise(_0x0baf('0x2a'),_['merge'](_0x1b0991[_0x0baf('0x1a')],_0x1b0991[_0x0baf('0x1b')]))['then'](respondWithResult(_0xe03d82,null))[_0x0baf('0x16')](handleError(_0xe03d82,null));};exports['outbound']=function(_0x5c545f,_0x11bc49){return respondWithRpcPromise(_0x0baf('0x2b'),_0x5c545f['query'])['then'](respondWithResult(_0x11bc49,null))[_0x0baf('0x16')](handleError(_0x11bc49,null));};exports[_0x0baf('0x2c')]=function(_0x3412bc,_0xb2d9ab){return respondWithRpcPromise(_0x0baf('0x2d'),_0x3412bc[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0xb2d9ab,null))[_0x0baf('0x16')](handleError(_0xb2d9ab,null));};exports[_0x0baf('0x2e')]=function(_0x36c6d2,_0x200864){var _0x148540;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2[_0x0baf('0x1a')])['then'](function(_0x3573ce){_0x148540=_0x3573ce;return respondWithRpcPromise(_0x0baf('0x2f'),_0x36c6d2['query'],routingClient);})[_0x0baf('0x9')](function(_0x324369){return _[_0x0baf('0x19')]({},_0x324369,_0x148540);})[_0x0baf('0x9')](respondWithResult(_0x200864,null))[_0x0baf('0x16')](handleError(_0x200864,null));};exports[_0x0baf('0x30')]=function(_0x57b581,_0x23ad34){if(_0x57b581[_0x0baf('0x31')]&&_0x57b581['body'][_0x0baf('0x32')]&&_0x57b581[_0x0baf('0x33')]&&_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]){for(var _0x504031 in _0x57b581[_0x0baf('0x31')][_0x0baf('0x32')]){if(_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x0baf('0x34')](_0x504031)){db[_0x0baf('0x35')][_0x0baf('0x36')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':_0x0baf('0x37'),'exitAt':null,'uniqueid':_0x57b581['body'][_0x0baf('0x32')][_0x504031]&&_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')]?{'$notIn':_0x57b581[_0x0baf('0x31')]['interaction'][_0x504031]}:{'$ne':null}}})[_0x0baf('0x9')](function(_0x310240){var _0x27c3ee=moment()[_0x0baf('0x39')](_0x0baf('0x3a'));for(var _0x54ed41=0x0,_0x2a0924=_0x310240[_0x0baf('0x38')];_0x54ed41<_0x2a0924;_0x54ed41+=0x1){_0x310240[_0x54ed41][_0x0baf('0x3b')]({'exitAt':_0x27c3ee});}});for(var _0x1522b0=0x0;_0x1522b0<_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x0baf('0x38')];_0x1522b0+=0x1){db['MemberReport'][_0x0baf('0x3c')]({'where':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'type':'INTERACTION','uniqueid':_0x57b581[_0x0baf('0x31')][_0x0baf('0x32')][_0x504031][_0x1522b0],'exitAt':null},'defaults':{'channel':_0x504031,'membername':_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')],'interface':_[_0x0baf('0x12')](_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')])?util['format'](_0x0baf('0x3e'),_0x57b581[_0x0baf('0x33')][_0x0baf('0x11')]):_0x57b581[_0x0baf('0x33')][_0x0baf('0x3d')],'type':_0x0baf('0x37'),'enterAt':moment()[_0x0baf('0x39')](_0x0baf('0x3a')),'role':_0x0baf('0x3f'),'internal':_0x57b581[_0x0baf('0x33')][_0x0baf('0x40')],'uniqueid':_0x57b581['body']['interaction'][_0x504031][_0x1522b0]}});}}}}return respondWithRpcPromise(_0x0baf('0x41'),{'id':_0x57b581[_0x0baf('0x1b')]['id'],'capacity':_0x57b581[_0x0baf('0x31')][_0x0baf('0x42')]},routingClient)[_0x0baf('0x9')](respondWithResult(_0x23ad34,null))[_0x0baf('0x16')](handleError(_0x23ad34,null));};exports[_0x0baf('0x43')]=function(_0x4b492c,_0x3fe534){return respondWithRpcPromise(_0x0baf('0x44'),_0x4b492c[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x3fe534,null))[_0x0baf('0x16')](handleError(_0x3fe534,null));};exports[_0x0baf('0x45')]=function(_0x5e1849,_0x3eebe5){return respondWithRpcPromise('Trunks',_0x5e1849[_0x0baf('0x1a')])['then'](respondWithResult(_0x3eebe5,null))[_0x0baf('0x16')](handleError(_0x3eebe5,null));};exports['campaigns']=function(_0x35b1a5,_0x4c035b){return respondWithRpcPromise(_0x0baf('0x46'),_0x35b1a5[_0x0baf('0x1a')])[_0x0baf('0x9')](respondWithResult(_0x4c035b,null))[_0x0baf('0x16')](handleError(_0x4c035b,null));};exports[_0x0baf('0x47')]=function(_0x576475,_0x21f179){return respondWithRpcPromise(_0x0baf('0x48'),_0x576475[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21f179,null))[_0x0baf('0x16')](handleError(_0x21f179,null));};exports[_0x0baf('0x49')]=function(_0x480834,_0x402f4d){return respondWithRpcPromise(_0x0baf('0x48'),_0x480834[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x480834[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x402f4d,null))[_0x0baf('0x16')](handleError(_0x402f4d,null));};exports['mailQueues']=function(_0x48e855,_0x23f6ea){return respondWithRpcPromise(_0x0baf('0x4a'),_0x48e855[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x23f6ea,null))[_0x0baf('0x16')](handleError(_0x23f6ea,null));};exports[_0x0baf('0x4b')]=function(_0xaa4293,_0x14a667){return respondWithRpcPromise(_0x0baf('0x4a'),_0xaa4293['query'],routingClient)[_0x0baf('0x9')](findById(_0xaa4293[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x14a667,null))[_0x0baf('0x16')](handleError(_0x14a667,null));};exports[_0x0baf('0x4c')]=function(_0xebfc0c,_0x26f5c9){return respondWithRpcPromise('MailAccounts',_0xebfc0c[_0x0baf('0x1a')],mailClient)[_0x0baf('0x9')](respondWithResult(_0x26f5c9,null))[_0x0baf('0x16')](handleError(_0x26f5c9,null));};exports[_0x0baf('0x4d')]=function(_0x1c7d88,_0x1a6d22){return respondWithRpcPromise(_0x0baf('0x4e'),_0x1c7d88[_0x0baf('0x1a')],routingClient)['then'](respondWithResult(_0x1a6d22,null))[_0x0baf('0x16')](handleError(_0x1a6d22,null));};exports['showOpenchannelQueues']=function(_0x3c00e7,_0x5f2fbe){return respondWithRpcPromise('OpenchannelQueues',_0x3c00e7[_0x0baf('0x1a')],routingClient)['then'](findById(_0x3c00e7[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0x5f2fbe,null))['catch'](handleError(_0x5f2fbe,null));};exports[_0x0baf('0x4f')]=function(_0xfb6708,_0x156572){return respondWithRpcPromise('SmsQueues',_0xfb6708['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x156572,null))[_0x0baf('0x16')](handleError(_0x156572,null));};exports[_0x0baf('0x50')]=function(_0x7f49e,_0x784e1a){return respondWithRpcPromise('SmsQueues',_0x7f49e[_0x0baf('0x1a')],routingClient)['then'](findById(_0x7f49e['params']['id']))['then'](respondWithResult(_0x784e1a,null))[_0x0baf('0x16')](handleError(_0x784e1a,null));};exports['whatsappQueues']=function(_0x4946d4,_0x11a81e){return respondWithRpcPromise(_0x0baf('0x51'),_0x4946d4[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x11a81e,null))[_0x0baf('0x16')](handleError(_0x11a81e,null));};exports[_0x0baf('0x52')]=function(_0x4c05d6,_0xec3b32){return respondWithRpcPromise(_0x0baf('0x51'),_0x4c05d6[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](findById(_0x4c05d6[_0x0baf('0x1b')]['id']))[_0x0baf('0x9')](respondWithResult(_0xec3b32,null))['catch'](handleError(_0xec3b32,null));};exports[_0x0baf('0x53')]=function(_0x468363,_0x29fd46){return respondWithRpcPromise('FaxQueues',_0x468363[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x29fd46,null))[_0x0baf('0x16')](handleError(_0x29fd46,null));};exports[_0x0baf('0x54')]=function(_0x125906,_0x27a959){return respondWithRpcPromise(_0x0baf('0x55'),_0x125906['query'],routingClient)['then'](findById(_0x125906['params']['id']))[_0x0baf('0x9')](respondWithResult(_0x27a959,null))[_0x0baf('0x16')](handleError(_0x27a959,null));};exports[_0x0baf('0x56')]=function(_0x12b9b5,_0x3e65d4){return respondWithRpcPromise(_0x0baf('0x57'),_0x12b9b5['query'])['then'](respondWithResult(_0x3e65d4,null))[_0x0baf('0x16')](handleError(_0x3e65d4,null));};exports['chatQueuesWaitingInteractions']=function(_0x22cd07,_0x3e9b79){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x22cd07[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x3e9b79,null))[_0x0baf('0x16')](handleError(_0x3e9b79,null));};exports[_0x0baf('0x58')]=function(_0x115ff5,_0x33a5af){return respondWithRpcPromise(_0x0baf('0x59'),_0x115ff5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x33a5af,null))['catch'](handleError(_0x33a5af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x58a079,_0x493784){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x58a079[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x493784,null))[_0x0baf('0x16')](handleError(_0x493784,null));};exports[_0x0baf('0x5a')]=function(_0x5093f5,_0x1be7f2){return respondWithRpcPromise(_0x0baf('0x5b'),_0x5093f5['query'],routingClient)['then'](function(_0x43aecd){if(_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')]!==undefined){var _0x442e5f=_(_0x43aecd[_0x0baf('0x13')])[_0x0baf('0x5d')]([_0x5093f5[_0x0baf('0x1a')][_0x0baf('0x5c')],_0x5093f5['params']['id']])[_0x0baf('0x5e')](_0x0baf('0x5f'))['uniq']()[_0x0baf('0x60')]();return _0x43aecd[_0x0baf('0x13')]['filter'](function(_0x97d385){return _0x442e5f[_0x0baf('0x61')](_0x97d385[_0x0baf('0x5f')])>-0x1;});}else{return _0x43aecd[_0x0baf('0x13')][_0x0baf('0x5d')](function(_0x4fc5af){return _0x4fc5af['queue_id']===parseInt(_0x5093f5[_0x0baf('0x1b')]['id']);});}})[_0x0baf('0x9')](respondWithResult(_0x1be7f2,null))['catch'](handleError(_0x1be7f2,null));};exports[_0x0baf('0x62')]=function(_0x59dad5,_0x21ad25){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x59dad5[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x21ad25,null))[_0x0baf('0x16')](handleError(_0x21ad25,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x3c2bc1,_0x5008c5){return respondWithRpcPromise(_0x0baf('0x63'),_0x3c2bc1[_0x0baf('0x1a')],routingClient)[_0x0baf('0x9')](respondWithResult(_0x5008c5,null))[_0x0baf('0x16')](handleError(_0x5008c5,null));};exports[_0x0baf('0x64')]=function(_0x52e845,_0x866e6e){return respondWithRpcPromise(_0x0baf('0x65'),_0x52e845['query'],routingClient)[_0x0baf('0x9')](respondWithResult(_0x866e6e,null))[_0x0baf('0x16')](handleError(_0x866e6e,null));};exports[_0x0baf('0x66')]=function(_0x379c54){return function(_0x1cbbcc,_0x250df2){var _0xa4fd1b,_0x1cda78;var _0x44ef57=_[_0x0baf('0x67')](_0x379c54);var _0x3b7abf=_0x379c54===_0x0baf('0x68')?'Website':'Account';return db[_0x44ef57+_0x0baf('0x69')][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1cbbcc[_0x0baf('0x1b')]['id']}})['then'](function(_0x507783){if(_[_0x0baf('0x12')](_0x507783)){throw new Error(_0x44ef57+_0x0baf('0x6b'));}_0xa4fd1b=_0x507783;return db[_0x44ef57+_0x0baf('0x6c')][_0x0baf('0x6a')]({'where':{'id':_0x1cbbcc[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x44ef57+_0x0baf('0x6e')],'as':_0x0baf('0x6e')},{'model':db[_0x44ef57+_0x3b7abf],'as':_0x0baf('0x6f')}]});})['then'](function(_0x1590a5){if(_[_0x0baf('0x12')](_0x1590a5)){throw new Error(_0x44ef57+_0x0baf('0x70'));}_0x1cda78=_0x1590a5;return _0x1590a5[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x5d26e6={'uniqueid':_0x379c54+'.'+_0x1cda78['id']+'.'+_0x1cda78['Interaction']['id'],'FromUserId':_0x1cbbcc[_0x0baf('0x33')]['id'],'type':_0x0baf('0x72')};_0x5d26e6[_0x44ef57+'MessageId']=_0x1cda78['id'];_0x5d26e6[_0x44ef57+'InteractionId']=_0x1cda78[_0x0baf('0x6e')]['id'];_0x5d26e6[_0x0baf('0x73')+_0x44ef57+_0x3b7abf+'Id']=_0x1cda78['Account']['id'];_0x5d26e6['To'+_0x44ef57+_0x0baf('0x74')]=_0xa4fd1b['id'];return db[_0x44ef57+_0x0baf('0x75')][_0x0baf('0x76')](_0x5d26e6);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x379c54,'interaction':_0x1cda78[_0x0baf('0x6e')],'message':_0x1cda78,'account':_0x1cda78[_0x0baf('0x6f')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0baf('0x72'),'appdata':_0xa4fd1b[_0x0baf('0x11')]+','+(_0x1cda78[_0x0baf('0x6f')][_0x0baf('0x78')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})['then'](respondWithResult(_0x250df2,null))[_0x0baf('0x16')](handleError(_0x250df2,null));};};exports[_0x0baf('0x7a')]=function(_0x1e1adb,_0x3bd15b){var _0x3c37b4,_0x195303;if(_['isNil'](_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x7b')])){throw new Error(_0x0baf('0x7c'));}var _0x457ae8=_0x1e1adb[_0x0baf('0x31')]['channel'];var _0x3761b5=_[_0x0baf('0x67')](_0x457ae8);var _0x2eae1b=_0x457ae8===_0x0baf('0x68')?_0x0baf('0x7d'):'Account';return db['User'][_0x0baf('0x6a')]({'raw':!![],'where':{'id':_0x1e1adb['params']['id'],'role':_0x0baf('0x3f')}})['then'](function(_0x32d8b6){if(_[_0x0baf('0x12')](_0x32d8b6)){throw new Error(_0x0baf('0x7e'));}_0x3c37b4=_0x32d8b6;return db[_0x3761b5+_0x0baf('0x6c')]['findOne']({'where':{'id':_0x1e1adb[_0x0baf('0x31')][_0x0baf('0x6d')]},'include':[{'model':db[_0x3761b5+_0x0baf('0x6e')],'as':'Interaction'},{'model':db[_0x3761b5+_0x2eae1b],'as':'Account'}]});})['then'](function(_0x4d4884){if(_[_0x0baf('0x12')](_0x4d4884)){throw new Error(_0x3761b5+_0x0baf('0x70'));}_0x195303=_0x4d4884;return _0x4d4884[_0x0baf('0x71')]({'read':0x0,'readAt':null,'UserId':null});})[_0x0baf('0x9')](function(){var _0x597830={'uniqueid':_0x457ae8+'.'+_0x195303['id']+'.'+_0x195303[_0x0baf('0x6e')]['id'],'FromUserId':_0x1e1adb[_0x0baf('0x33')]['id'],'type':_0x0baf('0x3f'),'ToUserId':_0x3c37b4['id']};_0x597830[_0x3761b5+'MessageId']=_0x195303['id'];_0x597830[_0x3761b5+_0x0baf('0x7f')]=_0x195303[_0x0baf('0x6e')]['id'];_0x597830['From'+_0x3761b5+_0x2eae1b+'Id']=_0x195303[_0x0baf('0x6f')]['id'];return db[_0x3761b5+'TransferReport'][_0x0baf('0x76')](_0x597830);})[_0x0baf('0x9')](function(){return respondWithRpcPromise(_0x0baf('0x77'),{'channel':_0x457ae8,'interaction':_0x195303[_0x0baf('0x6e')],'message':_0x195303,'account':_0x195303['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x3c37b4[_0x0baf('0x11')]+','+(_0x195303['Account'][_0x0baf('0x80')]||0x12c),'interval':_0x0baf('0x79')}],'transfer':!![]},routingClient);})[_0x0baf('0x9')](respondWithResult(_0x3bd15b,null))[_0x0baf('0x16')](handleError(_0x3bd15b,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index d0f23c8..d0d1cb5 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 _0x7c30=['Router','fs-extra','../../components/interaction/service','../../config/environment','./schedule.controller','get','index','/:id','show','/:id/run','run','post','isAuthenticated','delete','destroy','util','connect-timeout','express'];(function(_0x30ed34,_0xe0fa1c){var _0x26bdee=function(_0x249e33){while(--_0x249e33){_0x30ed34['push'](_0x30ed34['shift']());}};_0x26bdee(++_0xe0fa1c);}(_0x7c30,0x10b));var _0x07c3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7c30[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x07c3('0x0'));var path=require('path');var timeout=require(_0x07c3('0x1'));var express=require(_0x07c3('0x2'));var router=express[_0x07c3('0x3')]();var fs_extra=require(_0x07c3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x07c3('0x5'));var config=require(_0x07c3('0x6'));var controller=require(_0x07c3('0x7'));router[_0x07c3('0x8')]('/',auth['isAuthenticated'](),controller[_0x07c3('0x9')]);router['get'](_0x07c3('0xa'),auth['isAuthenticated'](),controller[_0x07c3('0xb')]);router['get'](_0x07c3('0xc'),auth['isAuthenticated'](),controller[_0x07c3('0xd')]);router[_0x07c3('0xe')]('/',auth[_0x07c3('0xf')](),controller['create']);router['put'](_0x07c3('0xa'),auth[_0x07c3('0xf')](),controller['update']);router[_0x07c3('0x10')](_0x07c3('0xa'),auth[_0x07c3('0xf')](),controller[_0x07c3('0x11')]);module['exports']=router; \ No newline at end of file +var _0x6a43=['../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','run','post','create','update','multer','path','express','fs-extra','../../components/auth/service'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x6a43,0x1bd));var _0x36a4=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x6a43[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x36a4('0x0'));var util=require('util');var path=require(_0x36a4('0x1'));var timeout=require('connect-timeout');var express=require(_0x36a4('0x2'));var router=express['Router']();var fs_extra=require(_0x36a4('0x3'));var auth=require(_0x36a4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x36a4('0x5'));var controller=require(_0x36a4('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x36a4('0x7')](_0x36a4('0x8'),auth[_0x36a4('0x9')](),controller[_0x36a4('0xa')]);router[_0x36a4('0x7')]('/:id/run',auth[_0x36a4('0x9')](),controller[_0x36a4('0xb')]);router[_0x36a4('0xc')]('/',auth[_0x36a4('0x9')](),controller[_0x36a4('0xd')]);router['put'](_0x36a4('0x8'),auth[_0x36a4('0x9')](),controller[_0x36a4('0xe')]);router['delete'](_0x36a4('0x8'),auth[_0x36a4('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 2d12d7a..2c94ade 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 _0x601d=['csv','default','custom','BOOLEAN','TEXT','sequelize','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','months','days','minutes','pdf'];(function(_0x5ecf35,_0x44909d){var _0x554764=function(_0x280530){while(--_0x280530){_0x5ecf35['push'](_0x5ecf35['shift']());}};_0x554764(++_0x44909d);}(_0x601d,0xd5));var _0xd601=function(_0x4808d5,_0x5a4d53){_0x4808d5=_0x4808d5-0x0;var _0x448d93=_0x601d[_0x4808d5];return _0x448d93;};'use strict';var Sequelize=require(_0xd601('0x0'));module['exports']={'name':{'type':Sequelize[_0xd601('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xd601('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xd601('0x1')],'allowNull':![],'defaultValue':_0xd601('0x2')},'startAt':{'type':Sequelize[_0xd601('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd601('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd601('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd601('0x5')](_0xd601('0x6'),'quarters',_0xd601('0x7'),'weeks',_0xd601('0x8'),'hours',_0xd601('0x9')),'allowNull':![],'defaultValue':_0xd601('0x8')},'output':{'type':Sequelize['ENUM']('csv',_0xd601('0xa'),'xlsx'),'allowNull':![],'defaultValue':_0xd601('0xb')},'type':{'type':Sequelize[_0xd601('0x5')]('custom',_0xd601('0xc')),'allowNull':![],'defaultValue':_0xd601('0xd')},'sendMail':{'type':Sequelize[_0xd601('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0xd601('0x1')]},'cc':{'type':Sequelize[_0xd601('0xf')]},'bcc':{'type':Sequelize[_0xd601('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x6a68=['ENUM','csv','custom','default','BOOLEAN','TEXT','exports','STRING','DATE','INTEGER','quarters','months','weeks','days','hours','minutes'];(function(_0x2c39f6,_0x5e519f){var _0x2f0d99=function(_0x2d10b8){while(--_0x2d10b8){_0x2c39f6['push'](_0x2c39f6['shift']());}};_0x2f0d99(++_0x5e519f);}(_0x6a68,0x156));var _0x86a6=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6a68[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x86a6('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x86a6('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x86a6('0x2')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x86a6('0x3')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x86a6('0x4'),_0x86a6('0x5'),_0x86a6('0x6'),_0x86a6('0x7'),_0x86a6('0x8'),_0x86a6('0x9')),'allowNull':![],'defaultValue':_0x86a6('0x7')},'output':{'type':Sequelize[_0x86a6('0xa')](_0x86a6('0xb'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x86a6('0xa')](_0x86a6('0xc'),_0x86a6('0xd')),'allowNull':![],'defaultValue':_0x86a6('0xc')},'sendMail':{'type':Sequelize[_0x86a6('0xe')],'defaultValue':![]},'email':{'type':Sequelize[_0x86a6('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0x86a6('0xf')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 56717ef..a39b455 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 _0x0af1=['autoAssociation','create','params','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','end','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x3a2a05,_0x7228ff){var _0x431c0e=function(_0x2a84cd){while(--_0x2a84cd){_0x3a2a05['push'](_0x3a2a05['shift']());}};_0x431c0e(++_0x7228ff);}(_0x0af1,0x1a4));var _0x10af=function(_0x3b98d9,_0x3ae722){_0x3b98d9=_0x3b98d9-0x0;var _0x50c882=_0x0af1[_0x3b98d9];return _0x50c882;};'use strict';var emlformat=require(_0x10af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x10af('0x1'));var jsonpatch=require(_0x10af('0x2'));var rp=require(_0x10af('0x3'));var moment=require('moment');var BPromise=require(_0x10af('0x4'));var Mustache=require(_0x10af('0x5'));var util=require('util');var path=require(_0x10af('0x6'));var sox=require(_0x10af('0x7'));var csv=require('to-csv');var ejs=require(_0x10af('0x8'));var fs=require('fs');var fs_extra=require(_0x10af('0x9'));var _=require('lodash');var squel=require(_0x10af('0xa'));var crypto=require(_0x10af('0xb'));var jsforce=require(_0x10af('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x10af('0xd'));var querystring=require(_0x10af('0xe'));var Papa=require(_0x10af('0xf'));var Redis=require(_0x10af('0x10'));var authService=require(_0x10af('0x11'));var qs=require(_0x10af('0x12'));var as=require(_0x10af('0x13'));var hardwareService=require(_0x10af('0x14'));var logger=require(_0x10af('0x15'))(_0x10af('0x16'));var utils=require('../../config/utils');var config=require(_0x10af('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x10af('0x18'))['db'];function respondWithStatusCode(_0x1d92f6,_0x152282){_0x152282=_0x152282||0xcc;return function(_0x4ac4e9){if(_0x4ac4e9){return _0x1d92f6['sendStatus'](_0x152282);}return _0x1d92f6[_0x10af('0x19')](_0x152282)['end']();};}function respondWithResult(_0x1193af,_0x28ca94){_0x28ca94=_0x28ca94||0xc8;return function(_0x3b7f70){if(_0x3b7f70){return _0x1193af['status'](_0x28ca94)[_0x10af('0x1a')](_0x3b7f70);}};}function respondWithFilteredResult(_0x322aee,_0x180b12){return function(_0x56c90e){if(_0x56c90e){var _0x14a48f=typeof _0x180b12[_0x10af('0x1b')]===_0x10af('0x1c')&&typeof _0x180b12[_0x10af('0x1d')]===_0x10af('0x1c');var _0x42bf20=_0x56c90e[_0x10af('0x1e')];var _0x20c4a0=_0x14a48f?0x0:_0x180b12[_0x10af('0x1b')];var _0xaa3a8d=_0x14a48f?_0x56c90e[_0x10af('0x1e')]:_0x180b12[_0x10af('0x1b')]+_0x180b12['limit'];var _0x12a3c9;if(_0xaa3a8d>=_0x42bf20){_0xaa3a8d=_0x42bf20;_0x12a3c9=0xc8;}else{_0x12a3c9=0xce;}_0x322aee[_0x10af('0x19')](_0x12a3c9);return _0x322aee['set']('Content-Range',_0x20c4a0+'-'+_0xaa3a8d+'/'+_0x42bf20)[_0x10af('0x1a')](_0x56c90e);}return null;};}function patchUpdates(_0x5840dc){return function(_0x151275){try{jsonpatch[_0x10af('0x1f')](_0x151275,_0x5840dc,!![]);}catch(_0x124f5f){return BPromise['reject'](_0x124f5f);}return _0x151275[_0x10af('0x20')]();};}function saveUpdates(_0xf17317,_0x5cce9d){return function(_0x4f27ca){if(_0x4f27ca){return _0x4f27ca[_0x10af('0x21')](_0xf17317)[_0x10af('0x22')](function(_0x21ba23){return _0x21ba23;});}return null;};}function removeEntity(_0x5bc3db,_0x54b9f6){return function(_0x45ca1b){if(_0x45ca1b){return _0x45ca1b[_0x10af('0x23')]()[_0x10af('0x22')](function(){var _0x19293e=_0x45ca1b[_0x10af('0x24')]({'plain':!![]});var _0x58c3a2=_0x10af('0x25');return db[_0x10af('0x26')]['destroy']({'where':{'type':_0x58c3a2,'resourceId':_0x19293e['id']}})[_0x10af('0x22')](function(){return _0x45ca1b;});})[_0x10af('0x22')](function(){_0x5bc3db[_0x10af('0x19')](0xcc)[_0x10af('0x27')]();});}};}function handleEntityNotFound(_0x4e410e,_0x13bbda){return function(_0x3b111b){if(!_0x3b111b){_0x4e410e[_0x10af('0x28')](0x194);}return _0x3b111b;};}function handleError(_0x7cd0ed,_0x2757b0){_0x2757b0=_0x2757b0||0x1f4;return function(_0x297086){logger[_0x10af('0x29')](_0x297086[_0x10af('0x2a')]);if(_0x297086[_0x10af('0x2b')]){delete _0x297086['name'];}_0x7cd0ed['status'](_0x2757b0)[_0x10af('0x2c')](_0x297086);};}exports[_0x10af('0x2d')]=function(_0x13cd7a,_0x3e39d6){var _0x434566={},_0x1fa18c={},_0xf4c3b0={'count':0x0,'rows':[]};var _0x4ec75a=_[_0x10af('0x2e')](db[_0x10af('0x2f')][_0x10af('0x30')],function(_0x20b3d6){return{'name':_0x20b3d6[_0x10af('0x31')],'type':_0x20b3d6[_0x10af('0x32')]['key']};});_0x1fa18c[_0x10af('0x33')]=_[_0x10af('0x2e')](_0x4ec75a,_0x10af('0x2b'));_0x1fa18c[_0x10af('0x34')]=_[_0x10af('0x35')](_0x13cd7a[_0x10af('0x34')]);_0x1fa18c[_0x10af('0x36')]=_[_0x10af('0x37')](_0x1fa18c[_0x10af('0x33')],_0x1fa18c[_0x10af('0x34')]);_0x434566[_0x10af('0x38')]=_[_0x10af('0x37')](_0x1fa18c[_0x10af('0x33')],qs[_0x10af('0x39')](_0x13cd7a[_0x10af('0x34')][_0x10af('0x39')]));_0x434566['attributes']=_0x434566[_0x10af('0x38')][_0x10af('0x3a')]?_0x434566[_0x10af('0x38')]:_0x1fa18c[_0x10af('0x33')];if(!_0x13cd7a['query'][_0x10af('0x3b')](_0x10af('0x3c'))){_0x434566[_0x10af('0x1d')]=qs[_0x10af('0x1d')](_0x13cd7a[_0x10af('0x34')][_0x10af('0x1d')]);_0x434566['offset']=qs[_0x10af('0x1b')](_0x13cd7a['query']['offset']);}_0x434566['order']=qs[_0x10af('0x3d')](_0x13cd7a[_0x10af('0x34')]['sort']);_0x434566[_0x10af('0x3e')]=qs[_0x10af('0x36')](_['pick'](_0x13cd7a[_0x10af('0x34')],_0x1fa18c[_0x10af('0x36')]),_0x4ec75a);if(_0x13cd7a[_0x10af('0x34')][_0x10af('0x3f')]){_0x434566[_0x10af('0x3e')]=_[_0x10af('0x40')](_0x434566[_0x10af('0x3e')],{'$or':_[_0x10af('0x2e')](_0x4ec75a,function(_0x1ceb7c){if(_0x1ceb7c[_0x10af('0x32')]!=='VIRTUAL'){var _0x3a93a6={};_0x3a93a6[_0x1ceb7c[_0x10af('0x2b')]]={'$like':'%'+_0x13cd7a[_0x10af('0x34')][_0x10af('0x3f')]+'%'};return _0x3a93a6;}})});}_0x434566=_[_0x10af('0x40')]({},_0x434566,_0x13cd7a[_0x10af('0x41')]);var _0xaeaa12={'where':_0x434566['where']};return db['Schedule'][_0x10af('0x1e')](_0xaeaa12)['then'](function(_0x46fcec){_0xf4c3b0[_0x10af('0x1e')]=_0x46fcec;if(_0x13cd7a['query'][_0x10af('0x42')]){_0x434566[_0x10af('0x43')]=[{'all':!![]}];}return db['Schedule'][_0x10af('0x44')](_0x434566);})[_0x10af('0x22')](function(_0x42c5f1){_0xf4c3b0['rows']=_0x42c5f1;return _0xf4c3b0;})[_0x10af('0x22')](respondWithFilteredResult(_0x3e39d6,_0x434566))[_0x10af('0x45')](handleError(_0x3e39d6,null));};exports[_0x10af('0x46')]=function(_0x1de9b2,_0x27fc0d){var _0x5b47fe={'raw':![],'where':{'id':_0x1de9b2['params']['id']}},_0x3d7abb={};_0x3d7abb[_0x10af('0x33')]=_[_0x10af('0x35')](db[_0x10af('0x2f')][_0x10af('0x30')]);_0x3d7abb[_0x10af('0x34')]=_['keys'](_0x1de9b2[_0x10af('0x34')]);_0x3d7abb[_0x10af('0x36')]=_[_0x10af('0x37')](_0x3d7abb[_0x10af('0x33')],_0x3d7abb['query']);_0x5b47fe[_0x10af('0x38')]=_[_0x10af('0x37')](_0x3d7abb['model'],qs[_0x10af('0x39')](_0x1de9b2[_0x10af('0x34')][_0x10af('0x39')]));_0x5b47fe[_0x10af('0x38')]=_0x5b47fe[_0x10af('0x38')][_0x10af('0x3a')]?_0x5b47fe[_0x10af('0x38')]:_0x3d7abb['model'];if(_0x1de9b2[_0x10af('0x34')]['includeAll']){_0x5b47fe[_0x10af('0x43')]=[{'all':!![]}];}_0x5b47fe=_[_0x10af('0x40')]({},_0x5b47fe,_0x1de9b2[_0x10af('0x41')]);return db[_0x10af('0x2f')][_0x10af('0x47')](_0x5b47fe)['then'](handleEntityNotFound(_0x27fc0d,null))['then'](respondWithResult(_0x27fc0d,null))['catch'](handleError(_0x27fc0d,null));};exports['create']=function(_0x313ee6,_0x33d76e){return db[_0x10af('0x2f')]['create'](_0x313ee6[_0x10af('0x48')],{})[_0x10af('0x22')](function(_0x5cb9dd){var _0x248a50=_0x313ee6[_0x10af('0x49')][_0x10af('0x24')]({'plain':!![]});if(!_0x248a50)throw new Error(_0x10af('0x4a'));if(_0x248a50[_0x10af('0x4b')]===_0x10af('0x49')){var _0x4c442b=_0x5cb9dd[_0x10af('0x24')]({'plain':!![]});var _0x119325=_0x10af('0x25');return db[_0x10af('0x4c')]['find']({'where':{'name':_0x119325,'userProfileId':_0x248a50[_0x10af('0x4d')]},'raw':!![]})[_0x10af('0x22')](function(_0x50689a){if(_0x50689a&&_0x50689a[_0x10af('0x4e')]===0x0){return db[_0x10af('0x26')][_0x10af('0x4f')]({'name':_0x4c442b[_0x10af('0x2b')],'resourceId':_0x4c442b['id'],'type':_0x50689a[_0x10af('0x2b')],'sectionId':_0x50689a['id']},{})[_0x10af('0x22')](function(){return _0x5cb9dd;});}else{return _0x5cb9dd;}})[_0x10af('0x45')](function(_0x4b50d2){logger[_0x10af('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4b50d2);throw _0x4b50d2;});}return _0x5cb9dd;})[_0x10af('0x22')](respondWithResult(_0x33d76e,0xc9))[_0x10af('0x45')](handleError(_0x33d76e,null));};exports[_0x10af('0x21')]=function(_0x4e91de,_0x56312c){if(_0x4e91de[_0x10af('0x48')]['id']){delete _0x4e91de['body']['id'];}return db[_0x10af('0x2f')]['find']({'where':{'id':_0x4e91de[_0x10af('0x50')]['id']}})['then'](handleEntityNotFound(_0x56312c,null))[_0x10af('0x22')](saveUpdates(_0x4e91de[_0x10af('0x48')],null))['then'](respondWithResult(_0x56312c,null))['catch'](handleError(_0x56312c,null));};exports[_0x10af('0x23')]=function(_0x12f114,_0x59e779){return db['Schedule']['find']({'where':{'id':_0x12f114[_0x10af('0x50')]['id']}})[_0x10af('0x22')](handleEntityNotFound(_0x59e779,null))['then'](removeEntity(_0x59e779,null))['catch'](handleError(_0x59e779,null));};exports[_0x10af('0x51')]=function(_0x3ed369,_0x2c1ec9,_0x2a203b){var _0x59a198=require(_0x10af('0x52'));return db[_0x10af('0x2f')][_0x10af('0x47')]({'where':{'id':_0x3ed369[_0x10af('0x50')]['id']},'raw':!![]})[_0x10af('0x22')](handleEntityNotFound(_0x2c1ec9,null))[_0x10af('0x22')](function(){_0x59a198[_0x10af('0x51')](_0x3ed369[_0x10af('0x50')]['id']);})[_0x10af('0x22')](respondWithStatusCode(_0x2c1ec9,null))[_0x10af('0x45')](handleError(_0x2c1ec9,null));}; \ No newline at end of file +var _0xb27f=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','send','index','map','Schedule','fieldName','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','params','rawAttributes','intersection','includeAll','options','find','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xb27f,0x1ec));var _0xfb27=function(_0x55f207,_0x57a5b1){_0x55f207=_0x55f207-0x0;var _0x1d80fe=_0xb27f[_0x55f207];return _0x1d80fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfb27('0x0'));var jsonpatch=require(_0xfb27('0x1'));var rp=require(_0xfb27('0x2'));var moment=require('moment');var BPromise=require(_0xfb27('0x3'));var Mustache=require(_0xfb27('0x4'));var util=require(_0xfb27('0x5'));var path=require(_0xfb27('0x6'));var sox=require(_0xfb27('0x7'));var csv=require(_0xfb27('0x8'));var ejs=require(_0xfb27('0x9'));var fs=require('fs');var fs_extra=require(_0xfb27('0xa'));var _=require(_0xfb27('0xb'));var squel=require(_0xfb27('0xc'));var crypto=require(_0xfb27('0xd'));var jsforce=require(_0xfb27('0xe'));var deskjs=require(_0xfb27('0xf'));var toCsv=require(_0xfb27('0x8'));var querystring=require('querystring');var Papa=require(_0xfb27('0x10'));var Redis=require(_0xfb27('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfb27('0x12'));var as=require(_0xfb27('0x13'));var hardwareService=require(_0xfb27('0x14'));var logger=require('../../config/logger')(_0xfb27('0x15'));var utils=require(_0xfb27('0x16'));var config=require(_0xfb27('0x17'));var licenseUtil=require(_0xfb27('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253da3,_0x1fb951){_0x1fb951=_0x1fb951||0xcc;return function(_0x2f32fa){if(_0x2f32fa){return _0x253da3[_0xfb27('0x19')](_0x1fb951);}return _0x253da3[_0xfb27('0x1a')](_0x1fb951)['end']();};}function respondWithResult(_0x151471,_0x2a6d5d){_0x2a6d5d=_0x2a6d5d||0xc8;return function(_0x1946cf){if(_0x1946cf){return _0x151471[_0xfb27('0x1a')](_0x2a6d5d)[_0xfb27('0x1b')](_0x1946cf);}};}function respondWithFilteredResult(_0x4a6414,_0x401a9b){return function(_0x439b56){if(_0x439b56){var _0x13a45b=typeof _0x401a9b[_0xfb27('0x1c')]==='undefined'&&typeof _0x401a9b[_0xfb27('0x1d')]===_0xfb27('0x1e');var _0x1f94b1=_0x439b56[_0xfb27('0x1f')];var _0x534005=_0x13a45b?0x0:_0x401a9b[_0xfb27('0x1c')];var _0x410bac=_0x13a45b?_0x439b56[_0xfb27('0x1f')]:_0x401a9b[_0xfb27('0x1c')]+_0x401a9b['limit'];var _0x3e3555;if(_0x410bac>=_0x1f94b1){_0x410bac=_0x1f94b1;_0x3e3555=0xc8;}else{_0x3e3555=0xce;}_0x4a6414['status'](_0x3e3555);return _0x4a6414[_0xfb27('0x20')](_0xfb27('0x21'),_0x534005+'-'+_0x410bac+'/'+_0x1f94b1)['json'](_0x439b56);}return null;};}function patchUpdates(_0x4ddcd4){return function(_0x248e82){try{jsonpatch[_0xfb27('0x22')](_0x248e82,_0x4ddcd4,!![]);}catch(_0x3e203f){return BPromise['reject'](_0x3e203f);}return _0x248e82[_0xfb27('0x23')]();};}function saveUpdates(_0x496db5,_0x226449){return function(_0x24dc9d){if(_0x24dc9d){return _0x24dc9d[_0xfb27('0x24')](_0x496db5)[_0xfb27('0x25')](function(_0x367d54){return _0x367d54;});}return null;};}function removeEntity(_0x358c45,_0xf9116a){return function(_0x22a407){if(_0x22a407){return _0x22a407[_0xfb27('0x26')]()[_0xfb27('0x25')](function(){var _0xa6c386=_0x22a407[_0xfb27('0x27')]({'plain':!![]});var _0x360a91=_0xfb27('0x28');return db[_0xfb27('0x29')][_0xfb27('0x26')]({'where':{'type':_0x360a91,'resourceId':_0xa6c386['id']}})['then'](function(){return _0x22a407;});})[_0xfb27('0x25')](function(){_0x358c45[_0xfb27('0x1a')](0xcc)[_0xfb27('0x2a')]();});}};}function handleEntityNotFound(_0x692816,_0x19fa87){return function(_0x184cb7){if(!_0x184cb7){_0x692816[_0xfb27('0x19')](0x194);}return _0x184cb7;};}function handleError(_0x8d66dd,_0x57bfe2){_0x57bfe2=_0x57bfe2||0x1f4;return function(_0x7f59fa){logger[_0xfb27('0x2b')](_0x7f59fa[_0xfb27('0x2c')]);if(_0x7f59fa[_0xfb27('0x2d')]){delete _0x7f59fa[_0xfb27('0x2d')];}_0x8d66dd[_0xfb27('0x1a')](_0x57bfe2)[_0xfb27('0x2e')](_0x7f59fa);};}exports[_0xfb27('0x2f')]=function(_0x292d20,_0x439397){var _0x2ca607={},_0x413066={},_0x18ffe6={'count':0x0,'rows':[]};var _0x10d7c2=_[_0xfb27('0x30')](db[_0xfb27('0x31')]['rawAttributes'],function(_0x1b9231){return{'name':_0x1b9231[_0xfb27('0x32')],'type':_0x1b9231[_0xfb27('0x33')][_0xfb27('0x34')]};});_0x413066[_0xfb27('0x35')]=_[_0xfb27('0x30')](_0x10d7c2,_0xfb27('0x2d'));_0x413066[_0xfb27('0x36')]=_[_0xfb27('0x37')](_0x292d20[_0xfb27('0x36')]);_0x413066[_0xfb27('0x38')]=_['intersection'](_0x413066[_0xfb27('0x35')],_0x413066['query']);_0x2ca607[_0xfb27('0x39')]=_['intersection'](_0x413066[_0xfb27('0x35')],qs[_0xfb27('0x3a')](_0x292d20[_0xfb27('0x36')][_0xfb27('0x3a')]));_0x2ca607[_0xfb27('0x39')]=_0x2ca607[_0xfb27('0x39')][_0xfb27('0x3b')]?_0x2ca607['attributes']:_0x413066['model'];if(!_0x292d20['query']['hasOwnProperty'](_0xfb27('0x3c'))){_0x2ca607[_0xfb27('0x1d')]=qs['limit'](_0x292d20[_0xfb27('0x36')][_0xfb27('0x1d')]);_0x2ca607['offset']=qs['offset'](_0x292d20[_0xfb27('0x36')]['offset']);}_0x2ca607[_0xfb27('0x3d')]=qs['sort'](_0x292d20[_0xfb27('0x36')]['sort']);_0x2ca607[_0xfb27('0x3e')]=qs['filters'](_[_0xfb27('0x3f')](_0x292d20[_0xfb27('0x36')],_0x413066[_0xfb27('0x38')]),_0x10d7c2);if(_0x292d20[_0xfb27('0x36')][_0xfb27('0x40')]){_0x2ca607[_0xfb27('0x3e')]=_[_0xfb27('0x41')](_0x2ca607[_0xfb27('0x3e')],{'$or':_[_0xfb27('0x30')](_0x10d7c2,function(_0x4f35a3){if(_0x4f35a3[_0xfb27('0x33')]!==_0xfb27('0x42')){var _0x21bd27={};_0x21bd27[_0x4f35a3[_0xfb27('0x2d')]]={'$like':'%'+_0x292d20[_0xfb27('0x36')][_0xfb27('0x40')]+'%'};return _0x21bd27;}})});}_0x2ca607=_[_0xfb27('0x41')]({},_0x2ca607,_0x292d20['options']);var _0x4dad5a={'where':_0x2ca607[_0xfb27('0x3e')]};return db[_0xfb27('0x31')]['count'](_0x4dad5a)['then'](function(_0x46a462){_0x18ffe6[_0xfb27('0x1f')]=_0x46a462;if(_0x292d20[_0xfb27('0x36')]['includeAll']){_0x2ca607[_0xfb27('0x43')]=[{'all':!![]}];}return db['Schedule'][_0xfb27('0x44')](_0x2ca607);})[_0xfb27('0x25')](function(_0x41c1f1){_0x18ffe6[_0xfb27('0x45')]=_0x41c1f1;return _0x18ffe6;})[_0xfb27('0x25')](respondWithFilteredResult(_0x439397,_0x2ca607))[_0xfb27('0x46')](handleError(_0x439397,null));};exports['show']=function(_0x38c11e,_0x16291d){var _0x3c9d03={'raw':![],'where':{'id':_0x38c11e[_0xfb27('0x47')]['id']}},_0x30f2a2={};_0x30f2a2[_0xfb27('0x35')]=_['keys'](db[_0xfb27('0x31')][_0xfb27('0x48')]);_0x30f2a2['query']=_[_0xfb27('0x37')](_0x38c11e[_0xfb27('0x36')]);_0x30f2a2[_0xfb27('0x38')]=_[_0xfb27('0x49')](_0x30f2a2[_0xfb27('0x35')],_0x30f2a2[_0xfb27('0x36')]);_0x3c9d03['attributes']=_['intersection'](_0x30f2a2[_0xfb27('0x35')],qs[_0xfb27('0x3a')](_0x38c11e[_0xfb27('0x36')][_0xfb27('0x3a')]));_0x3c9d03[_0xfb27('0x39')]=_0x3c9d03[_0xfb27('0x39')][_0xfb27('0x3b')]?_0x3c9d03[_0xfb27('0x39')]:_0x30f2a2[_0xfb27('0x35')];if(_0x38c11e[_0xfb27('0x36')][_0xfb27('0x4a')]){_0x3c9d03[_0xfb27('0x43')]=[{'all':!![]}];}_0x3c9d03=_[_0xfb27('0x41')]({},_0x3c9d03,_0x38c11e[_0xfb27('0x4b')]);return db[_0xfb27('0x31')][_0xfb27('0x4c')](_0x3c9d03)[_0xfb27('0x25')](handleEntityNotFound(_0x16291d,null))[_0xfb27('0x25')](respondWithResult(_0x16291d,null))['catch'](handleError(_0x16291d,null));};exports[_0xfb27('0x4d')]=function(_0x35fe94,_0x14d485){return db['Schedule'][_0xfb27('0x4d')](_0x35fe94[_0xfb27('0x4e')],{})[_0xfb27('0x25')](function(_0x2b0b6f){var _0x54fbe8=_0x35fe94[_0xfb27('0x4f')][_0xfb27('0x27')]({'plain':!![]});if(!_0x54fbe8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54fbe8['role']===_0xfb27('0x4f')){var _0x37965d=_0x2b0b6f['get']({'plain':!![]});var _0x2b6825='Scheduler';return db['UserProfileSection'][_0xfb27('0x4c')]({'where':{'name':_0x2b6825,'userProfileId':_0x54fbe8[_0xfb27('0x50')]},'raw':!![]})[_0xfb27('0x25')](function(_0x163fbb){if(_0x163fbb&&_0x163fbb[_0xfb27('0x51')]===0x0){return db[_0xfb27('0x29')]['create']({'name':_0x37965d[_0xfb27('0x2d')],'resourceId':_0x37965d['id'],'type':_0x163fbb['name'],'sectionId':_0x163fbb['id']},{})[_0xfb27('0x25')](function(){return _0x2b0b6f;});}else{return _0x2b0b6f;}})[_0xfb27('0x46')](function(_0x2f4d95){logger[_0xfb27('0x2b')](_0xfb27('0x52'),_0x2f4d95);throw _0x2f4d95;});}return _0x2b0b6f;})[_0xfb27('0x25')](respondWithResult(_0x14d485,0xc9))[_0xfb27('0x46')](handleError(_0x14d485,null));};exports[_0xfb27('0x24')]=function(_0x8012ff,_0x34ee3c){if(_0x8012ff[_0xfb27('0x4e')]['id']){delete _0x8012ff[_0xfb27('0x4e')]['id'];}return db[_0xfb27('0x31')]['find']({'where':{'id':_0x8012ff[_0xfb27('0x47')]['id']}})[_0xfb27('0x25')](handleEntityNotFound(_0x34ee3c,null))[_0xfb27('0x25')](saveUpdates(_0x8012ff[_0xfb27('0x4e')],null))['then'](respondWithResult(_0x34ee3c,null))[_0xfb27('0x46')](handleError(_0x34ee3c,null));};exports[_0xfb27('0x26')]=function(_0x1528ea,_0x5c7aa3){return db['Schedule']['find']({'where':{'id':_0x1528ea['params']['id']}})[_0xfb27('0x25')](handleEntityNotFound(_0x5c7aa3,null))['then'](removeEntity(_0x5c7aa3,null))[_0xfb27('0x46')](handleError(_0x5c7aa3,null));};exports[_0xfb27('0x53')]=function(_0x380959,_0x37e65d,_0x525208){var _0x177d9e=require('../../config/schedule');return db[_0xfb27('0x31')][_0xfb27('0x4c')]({'where':{'id':_0x380959[_0xfb27('0x47')]['id']},'raw':!![]})[_0xfb27('0x25')](handleEntityNotFound(_0x37e65d,null))['then'](function(){_0x177d9e[_0xfb27('0x53')](_0x380959['params']['id']);})[_0xfb27('0x25')](respondWithStatusCode(_0x37e65d,null))['catch'](handleError(_0x37e65d,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index b577ca0..7e53d19 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 _0x7591=['path','rimraf','exports','define','Schedule','api','bluebird','request-promise'];(function(_0x5275b8,_0x51e5dd){var _0x568a9b=function(_0x583a71){while(--_0x583a71){_0x5275b8['push'](_0x5275b8['shift']());}};_0x568a9b(++_0x51e5dd);}(_0x7591,0x12d));var _0x1759=function(_0x349e13,_0x114587){_0x349e13=_0x349e13-0x0;var _0x2427f4=_0x7591[_0x349e13];return _0x2427f4;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1759('0x0'));var moment=require('moment');var BPromise=require(_0x1759('0x1'));var rp=require(_0x1759('0x2'));var fs=require('fs');var path=require(_0x1759('0x3'));var rimraf=require(_0x1759('0x4'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x1759('0x5')]=function(_0x572a90,_0x130584){return _0x572a90[_0x1759('0x6')](_0x1759('0x7'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6551=['./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x2c8127,_0x4b3643){var _0x39d461=function(_0x401614){while(--_0x401614){_0x2c8127['push'](_0x2c8127['shift']());}};_0x39d461(++_0x4b3643);}(_0x6551,0xe2));var _0x1655=function(_0x554927,_0x20afee){_0x554927=_0x554927-0x0;var _0x8bc8c8=_0x6551[_0x554927];return _0x8bc8c8;};'use strict';var _=require(_0x1655('0x0'));var util=require(_0x1655('0x1'));var logger=require(_0x1655('0x2'))(_0x1655('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1655('0x4'));var fs=require('fs');var path=require(_0x1655('0x5'));var rimraf=require(_0x1655('0x6'));var config=require(_0x1655('0x7'));var attributes=require(_0x1655('0x8'));module[_0x1655('0x9')]=function(_0x1f1237,_0x377769){return _0x1f1237[_0x1655('0xa')](_0x1655('0xb'),attributes,{'tableName':_0x1655('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 8d101ea..5af8bed 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 _0x5dec=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring'];(function(_0x45e168,_0x5663fc){var _0x3aea37=function(_0x136a2e){while(--_0x136a2e){_0x45e168['push'](_0x45e168['shift']());}};_0x3aea37(++_0x5663fc);}(_0x5dec,0x1b4));var _0xc5de=function(_0x915426,_0x1a0a05){_0x915426=_0x915426-0x0;var _0x1ab376=_0x5dec[_0x915426];return _0x1ab376;};'use strict';var _=require(_0xc5de('0x0'));var util=require(_0xc5de('0x1'));var moment=require('moment');var BPromise=require(_0xc5de('0x2'));var rs=require(_0xc5de('0x3'));var fs=require('fs');var Redis=require(_0xc5de('0x4'));var db=require(_0xc5de('0x5'))['db'];var utils=require(_0xc5de('0x6'));var logger=require(_0xc5de('0x7'))(_0xc5de('0x8'));var config=require(_0xc5de('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc5de('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xafedb8,_0x5d43bb,_0x17d6a3){return new BPromise(function(_0x449ae7,_0x435cc3){return client['request'](_0xafedb8,_0x17d6a3)['then'](function(_0x552066){logger[_0xc5de('0xb')](_0xc5de('0xc'),_0x5d43bb,_0xc5de('0xd'));logger[_0xc5de('0xe')](_0xc5de('0xf'),_0x5d43bb,'request\x20sent',JSON['stringify'](_0x552066));if(_0x552066[_0xc5de('0x10')]){if(_0x552066[_0xc5de('0x10')][_0xc5de('0x11')]===0x1f4){logger[_0xc5de('0x10')](_0xc5de('0xc'),_0x5d43bb,_0x552066[_0xc5de('0x10')][_0xc5de('0x12')]);return _0x435cc3(_0x552066[_0xc5de('0x10')][_0xc5de('0x12')]);}logger['error'](_0xc5de('0xc'),_0x5d43bb,_0x552066[_0xc5de('0x10')]['message']);return _0x449ae7(_0x552066[_0xc5de('0x10')]['message']);}else{logger[_0xc5de('0xb')]('Schedule,\x20%s,\x20%s',_0x5d43bb,_0xc5de('0xd'));_0x449ae7(_0x552066['result'][_0xc5de('0x12')]);}})[_0xc5de('0x13')](function(_0x2e57ed){logger[_0xc5de('0x10')](_0xc5de('0xc'),_0x5d43bb,_0x2e57ed);_0x435cc3(_0x2e57ed);});});} \ No newline at end of file +var _0x1202=['debug','stringify','error','code','message','result','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent'];(function(_0x596d89,_0x3f9156){var _0x571fd5=function(_0x1404ca){while(--_0x1404ca){_0x596d89['push'](_0x596d89['shift']());}};_0x571fd5(++_0x3f9156);}(_0x1202,0x15d));var _0x2120=function(_0x1bc519,_0x349b35){_0x1bc519=_0x1bc519-0x0;var _0x296b2f=_0x1202[_0x1bc519];return _0x296b2f;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x2120('0x0'));var rs=require(_0x2120('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2120('0x2'))['db'];var utils=require(_0x2120('0x3'));var logger=require(_0x2120('0x4'))(_0x2120('0x5'));var config=require('../../config/environment');var jayson=require(_0x2120('0x6'));var client=jayson[_0x2120('0x7')][_0x2120('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19b930,_0x27d944,_0x155913){return new BPromise(function(_0x1da807,_0x1618f3){return client['request'](_0x19b930,_0x155913)['then'](function(_0x2dfb92){logger[_0x2120('0x9')](_0x2120('0xa'),_0x27d944,_0x2120('0xb'));logger[_0x2120('0xc')]('Schedule,\x20%s,\x20%s,\x20%s',_0x27d944,_0x2120('0xb'),JSON[_0x2120('0xd')](_0x2dfb92));if(_0x2dfb92[_0x2120('0xe')]){if(_0x2dfb92['error'][_0x2120('0xf')]===0x1f4){logger['error'](_0x2120('0xa'),_0x27d944,_0x2dfb92[_0x2120('0xe')][_0x2120('0x10')]);return _0x1618f3(_0x2dfb92[_0x2120('0xe')]['message']);}logger['error'](_0x2120('0xa'),_0x27d944,_0x2dfb92['error'][_0x2120('0x10')]);return _0x1da807(_0x2dfb92[_0x2120('0xe')][_0x2120('0x10')]);}else{logger[_0x2120('0x9')](_0x2120('0xa'),_0x27d944,_0x2120('0xb'));_0x1da807(_0x2dfb92[_0x2120('0x11')][_0x2120('0x10')]);}})[_0x2120('0x12')](function(_0xd3d448){logger[_0x2120('0xe')](_0x2120('0xa'),_0x27d944,_0xd3d448);_0x1618f3(_0xd3d448);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index de40a3a..d1a6b76 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 _0x30b6=['put','/:id','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','show','/:id/download','create'];(function(_0x55af15,_0x112ffc){var _0x2adb04=function(_0x56dc61){while(--_0x56dc61){_0x55af15['push'](_0x55af15['shift']());}};_0x2adb04(++_0x112ffc);}(_0x30b6,0x78));var _0x630b=function(_0x3a1131,_0x1f4c0e){_0x3a1131=_0x3a1131-0x0;var _0x1bf96e=_0x30b6[_0x3a1131];return _0x1bf96e;};'use strict';var multer=require(_0x630b('0x0'));var util=require('util');var path=require(_0x630b('0x1'));var timeout=require(_0x630b('0x2'));var express=require(_0x630b('0x3'));var router=express[_0x630b('0x4')]();var fs_extra=require(_0x630b('0x5'));var auth=require(_0x630b('0x6'));var interaction=require(_0x630b('0x7'));var config=require(_0x630b('0x8'));var controller=require(_0x630b('0x9'));router[_0x630b('0xa')]('/',auth['isAuthenticated'](),controller[_0x630b('0xb')]);router[_0x630b('0xa')](_0x630b('0xc'),auth[_0x630b('0xd')](),controller[_0x630b('0xe')]);router[_0x630b('0xa')]('/:id',auth[_0x630b('0xd')](),controller[_0x630b('0xf')]);router[_0x630b('0xa')](_0x630b('0x10'),auth[_0x630b('0xd')](),controller['download']);router['post']('/',auth[_0x630b('0xd')](),controller[_0x630b('0x11')]);router[_0x630b('0x12')](_0x630b('0x13'),auth[_0x630b('0xd')](),controller[_0x630b('0x14')]);router[_0x630b('0x15')](_0x630b('0x13'),auth[_0x630b('0xd')](),controller[_0x630b('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe605=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','show','/:id/download','download','put','/:id','delete','destroy','exports','multer'];(function(_0x47d6dc,_0xc036cc){var _0x1a1c93=function(_0x18ec96){while(--_0x18ec96){_0x47d6dc['push'](_0x47d6dc['shift']());}};_0x1a1c93(++_0xc036cc);}(_0xe605,0x92));var _0x5e60=function(_0x35f339,_0x1a1f5a){_0x35f339=_0x35f339-0x0;var _0x4955db=_0xe605[_0x35f339];return _0x4955db;};'use strict';var multer=require(_0x5e60('0x0'));var util=require(_0x5e60('0x1'));var path=require('path');var timeout=require(_0x5e60('0x2'));var express=require(_0x5e60('0x3'));var router=express[_0x5e60('0x4')]();var fs_extra=require(_0x5e60('0x5'));var auth=require(_0x5e60('0x6'));var interaction=require(_0x5e60('0x7'));var config=require(_0x5e60('0x8'));var controller=require(_0x5e60('0x9'));router[_0x5e60('0xa')]('/',auth[_0x5e60('0xb')](),controller[_0x5e60('0xc')]);router[_0x5e60('0xa')]('/describe',auth[_0x5e60('0xb')](),controller['describe']);router['get']('/:id',auth[_0x5e60('0xb')](),controller[_0x5e60('0xd')]);router[_0x5e60('0xa')](_0x5e60('0xe'),auth[_0x5e60('0xb')](),controller[_0x5e60('0xf')]);router['post']('/',auth[_0x5e60('0xb')](),controller['create']);router[_0x5e60('0x10')](_0x5e60('0x11'),auth[_0x5e60('0xb')](),controller['update']);router[_0x5e60('0x12')](_0x5e60('0x11'),auth[_0x5e60('0xb')](),controller[_0x5e60('0x13')]);module[_0x5e60('0x14')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 6223d86..1142337 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 _0x4137=['startedAt','MM-DD-YYYY\x20HH:mm','toString','DATE','createdAt','format','sequelize','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','INTEGER','setDataValue','subtract','closedAt','duration'];(function(_0x404957,_0x5192a4){var _0x4e0365=function(_0x4f6cd7){while(--_0x4f6cd7){_0x404957['push'](_0x404957['shift']());}};_0x4e0365(++_0x5192a4);}(_0x4137,0xf8));var _0x7413=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4137[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x7413('0x0'));var moment=require(_0x7413('0x1'));var path=require(_0x7413('0x2'));var config=require(_0x7413('0x3'));module[_0x7413('0x4')]={'format':{'type':Sequelize[_0x7413('0x5')],'get':function(){return this[_0x7413('0x6')](_0x7413('0x7'))?path[_0x7413('0x8')](this[_0x7413('0x6')](_0x7413('0x7'))):undefined;}},'interactionid':{'type':Sequelize[_0x7413('0x9')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x7413('0x9')],'set':function(_0x188d89){var _0x5b39ac=_0x188d89[_0x7413('0xa')](/\\/g,'/');this['setDataValue'](_0x7413('0x7'),_0x5b39ac);}},'rating':{'type':Sequelize[_0x7413('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x422bf5){this[_0x7413('0xc')]('startedAt',moment()[_0x7413('0xd')](_0x422bf5,'ms'));this[_0x7413('0xc')](_0x7413('0xe'),moment());this[_0x7413('0xc')](_0x7413('0xf'),_0x422bf5);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7413('0x6')](_0x7413('0x10')))['format'](_0x7413('0x11'))[_0x7413('0x12')]();}},'closedAt':{'type':Sequelize[_0x7413('0x13')],'get':function(){return moment(this['getDataValue']('closedAt'))['format'](_0x7413('0x11'))[_0x7413('0x12')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7413('0x6')](_0x7413('0x14')))['format'](_0x7413('0x11'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x7413('0x6')]('updatedAt'))[_0x7413('0x15')]('MM-DD-YYYY\x20HH:mm')[_0x7413('0x12')]();}}}; \ No newline at end of file +var _0xf5b6=['format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE'];(function(_0x40ad6a,_0x5da3bf){var _0x313997=function(_0x1e7624){while(--_0x1e7624){_0x40ad6a['push'](_0x40ad6a['shift']());}};_0x313997(++_0x5da3bf);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x3fa0f8,_0x50ec7b){_0x3fa0f8=_0x3fa0f8-0x0;var _0x5e7ee1=_0xf5b6[_0x3fa0f8];return _0x5e7ee1;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0x6f5b('0x0'));var config=require(_0x6f5b('0x1'));module[_0x6f5b('0x2')]={'format':{'type':Sequelize[_0x6f5b('0x3')],'get':function(){return this['getDataValue'](_0x6f5b('0x4'))?path[_0x6f5b('0x5')](this[_0x6f5b('0x6')](_0x6f5b('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x6f5b('0x7')],'set':function(_0x5cf395){var _0x58899e=_0x5cf395['replace'](/\\/g,'/');this[_0x6f5b('0x8')]('value',_0x58899e);}},'rating':{'type':Sequelize[_0x6f5b('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6f5b('0x9')],'set':function(_0x17692b){this['setDataValue'](_0x6f5b('0xa'),moment()['subtract'](_0x17692b,'ms'));this[_0x6f5b('0x8')](_0x6f5b('0xb'),moment());this[_0x6f5b('0x8')](_0x6f5b('0xc'),_0x17692b);}},'startedAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this['getDataValue'](_0x6f5b('0xa')))[_0x6f5b('0xe')](_0x6f5b('0xf'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6f5b('0x6')](_0x6f5b('0xb')))[_0x6f5b('0xe')](_0x6f5b('0xf'))[_0x6f5b('0x10')]();}},'createdAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this[_0x6f5b('0x6')]('createdAt'))[_0x6f5b('0xe')](_0x6f5b('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this[_0x6f5b('0x6')](_0x6f5b('0x11')))[_0x6f5b('0xe')](_0x6f5b('0xf'))[_0x6f5b('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index fed6154..fea58dc 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 _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','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','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x456c0e,_0x36d4d4){var _0x1efd58=function(_0x5d5edc){while(--_0x5d5edc){_0x456c0e['push'](_0x456c0e['shift']());}};_0x1efd58(++_0x36d4d4);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));}; \ No newline at end of file +var _0x0e85=['duration','createdAt','closedAt','params','describe','download','uniqueid','join','root','value','existsSync','secrets','recording','server/files/screen_recordings','filename','extname','unlink','message','Not\x20found','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','key','model','format','query','filters','intersection','attributes','length','nolimit','sort','filter','where','merge','type','options','include','findAll','rows','catch','keys','fields','find','create','body'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0x0e85,0x7c));var _0x50e8=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x0e85[_0x2c7618];return _0x5ce3f0;};'use strict';var emlformat=require(_0x50e8('0x0'));var rimraf=require(_0x50e8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x50e8('0x2'));var rp=require(_0x50e8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x50e8('0x4'));var path=require('path');var sox=require(_0x50e8('0x5'));var csv=require(_0x50e8('0x6'));var ejs=require(_0x50e8('0x7'));var fs=require('fs');var fs_extra=require(_0x50e8('0x8'));var _=require('lodash');var squel=require(_0x50e8('0x9'));var crypto=require(_0x50e8('0xa'));var jsforce=require(_0x50e8('0xb'));var deskjs=require(_0x50e8('0xc'));var toCsv=require(_0x50e8('0x6'));var querystring=require(_0x50e8('0xd'));var Papa=require('papaparse');var Redis=require(_0x50e8('0xe'));var authService=require(_0x50e8('0xf'));var qs=require(_0x50e8('0x10'));var as=require(_0x50e8('0x11'));var hardwareService=require(_0x50e8('0x12'));var logger=require(_0x50e8('0x13'))(_0x50e8('0x14'));var utils=require(_0x50e8('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x50e8('0x16'))['db'];function respondWithStatusCode(_0x24d381,_0x508377){_0x508377=_0x508377||0xcc;return function(_0x49e02f){if(_0x49e02f){return _0x24d381[_0x50e8('0x17')](_0x508377);}return _0x24d381[_0x50e8('0x18')](_0x508377)[_0x50e8('0x19')]();};}function respondWithResult(_0x473aa7,_0x54efd3){_0x54efd3=_0x54efd3||0xc8;return function(_0x18596f){if(_0x18596f){return _0x473aa7[_0x50e8('0x18')](_0x54efd3)[_0x50e8('0x1a')](_0x18596f);}};}function respondWithFilteredResult(_0x5c3baa,_0x5524a3){return function(_0x30a872){if(_0x30a872){var _0xf02b48=typeof _0x5524a3[_0x50e8('0x1b')]===_0x50e8('0x1c')&&typeof _0x5524a3[_0x50e8('0x1d')]===_0x50e8('0x1c');var _0x5642bf=_0x30a872['count'];var _0x441f25=_0xf02b48?0x0:_0x5524a3[_0x50e8('0x1b')];var _0x40d060=_0xf02b48?_0x30a872[_0x50e8('0x1e')]:_0x5524a3[_0x50e8('0x1b')]+_0x5524a3[_0x50e8('0x1d')];var _0x1a451d;if(_0x40d060>=_0x5642bf){_0x40d060=_0x5642bf;_0x1a451d=0xc8;}else{_0x1a451d=0xce;}_0x5c3baa['status'](_0x1a451d);return _0x5c3baa[_0x50e8('0x1f')]('Content-Range',_0x441f25+'-'+_0x40d060+'/'+_0x5642bf)[_0x50e8('0x1a')](_0x30a872);}return null;};}function patchUpdates(_0xe04a5c){return function(_0xd263d){try{jsonpatch[_0x50e8('0x20')](_0xd263d,_0xe04a5c,!![]);}catch(_0x46af8e){return BPromise['reject'](_0x46af8e);}return _0xd263d[_0x50e8('0x21')]();};}function saveUpdates(_0x1e4e0d,_0x58110d){return function(_0x31d23c){if(_0x31d23c){return _0x31d23c[_0x50e8('0x22')](_0x1e4e0d)['then'](function(_0x1ce7fc){return _0x1ce7fc;});}return null;};}function removeEntity(_0xe7e56c,_0x4f56b7){return function(_0x47a3d8){if(_0x47a3d8){return _0x47a3d8['destroy']()[_0x50e8('0x23')](function(){_0xe7e56c[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();});}};}function handleEntityNotFound(_0x371a1f,_0xc2f832){return function(_0x13b6e9){if(!_0x13b6e9){_0x371a1f['sendStatus'](0x194);}return _0x13b6e9;};}function handleError(_0x3a6442,_0x396611){_0x396611=_0x396611||0x1f4;return function(_0x4b3a09){logger[_0x50e8('0x24')](_0x4b3a09[_0x50e8('0x25')]);if(_0x4b3a09[_0x50e8('0x26')]){delete _0x4b3a09[_0x50e8('0x26')];}_0x3a6442['status'](_0x396611)[_0x50e8('0x27')](_0x4b3a09);};}exports['index']=function(_0x30fedf,_0x39c0c6){var _0x42bbef={},_0x4f0b88={},_0x1041b9={'count':0x0,'rows':[]};var _0x126c99=_[_0x50e8('0x28')](db[_0x50e8('0x29')][_0x50e8('0x2a')],function(_0x18aa31){return{'name':_0x18aa31[_0x50e8('0x2b')],'type':_0x18aa31['type'][_0x50e8('0x2c')]};});_0x4f0b88[_0x50e8('0x2d')]=_['differenceBy'](_['map'](_0x126c99,_0x50e8('0x26')),[_0x50e8('0x2e')]);_0x4f0b88[_0x50e8('0x2f')]=_['keys'](_0x30fedf['query']);_0x4f0b88[_0x50e8('0x30')]=_[_0x50e8('0x31')](_0x4f0b88['model'],_0x4f0b88[_0x50e8('0x2f')]);_0x42bbef[_0x50e8('0x32')]=_[_0x50e8('0x31')](_0x4f0b88[_0x50e8('0x2d')],qs['fields'](_0x30fedf[_0x50e8('0x2f')]['fields']));_0x42bbef[_0x50e8('0x32')]=_0x42bbef[_0x50e8('0x32')][_0x50e8('0x33')]?_0x42bbef['attributes']:_0x4f0b88[_0x50e8('0x2d')];if(!_0x30fedf[_0x50e8('0x2f')]['hasOwnProperty'](_0x50e8('0x34'))){_0x42bbef[_0x50e8('0x1d')]=qs[_0x50e8('0x1d')](_0x30fedf[_0x50e8('0x2f')]['limit']);_0x42bbef[_0x50e8('0x1b')]=qs[_0x50e8('0x1b')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x1b')]);}_0x42bbef['order']=qs[_0x50e8('0x35')](_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x35')]);_0x42bbef['where']=qs['filters'](_['pick'](_0x30fedf[_0x50e8('0x2f')],_0x4f0b88[_0x50e8('0x30')]),_0x126c99);if(_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]){_0x42bbef[_0x50e8('0x37')]=_[_0x50e8('0x38')](_0x42bbef[_0x50e8('0x37')],{'$or':_[_0x50e8('0x28')](_0x126c99,function(_0x35f802){if(_0x35f802[_0x50e8('0x39')]!=='VIRTUAL'){var _0x3371a4={};_0x3371a4[_0x35f802[_0x50e8('0x26')]]={'$like':'%'+_0x30fedf[_0x50e8('0x2f')][_0x50e8('0x36')]+'%'};return _0x3371a4;}})});}_0x42bbef=_['merge']({},_0x42bbef,_0x30fedf[_0x50e8('0x3a')]);var _0x944e46={'where':_0x42bbef[_0x50e8('0x37')]};return db[_0x50e8('0x29')][_0x50e8('0x1e')](_0x944e46)['then'](function(_0x53b198){_0x1041b9[_0x50e8('0x1e')]=_0x53b198;if(_0x30fedf[_0x50e8('0x2f')]['includeAll']){_0x42bbef[_0x50e8('0x3b')]=[{'all':!![]}];}return db[_0x50e8('0x29')][_0x50e8('0x3c')](_0x42bbef);})[_0x50e8('0x23')](function(_0x251e1c){_0x1041b9[_0x50e8('0x3d')]=_0x251e1c;return _0x1041b9;})[_0x50e8('0x23')](respondWithFilteredResult(_0x39c0c6,_0x42bbef))[_0x50e8('0x3e')](handleError(_0x39c0c6,null));};exports['show']=function(_0x3d26bd,_0x44e0ca){var _0x3ea251={'raw':![],'where':{'id':_0x3d26bd['params']['id']}},_0x2adae0={};_0x2adae0[_0x50e8('0x2d')]=_[_0x50e8('0x3f')](db[_0x50e8('0x29')][_0x50e8('0x2a')]);_0x2adae0['query']=_[_0x50e8('0x3f')](_0x3d26bd['query']);_0x2adae0['filters']=_['intersection'](_0x2adae0[_0x50e8('0x2d')],_0x2adae0[_0x50e8('0x2f')]);_0x3ea251['attributes']=_[_0x50e8('0x31')](_0x2adae0[_0x50e8('0x2d')],qs[_0x50e8('0x40')](_0x3d26bd[_0x50e8('0x2f')][_0x50e8('0x40')]));_0x3ea251[_0x50e8('0x32')]=_0x3ea251['attributes'][_0x50e8('0x33')]?_0x3ea251['attributes']:_0x2adae0[_0x50e8('0x2d')];if(_0x3d26bd[_0x50e8('0x2f')]['includeAll']){_0x3ea251[_0x50e8('0x3b')]=[{'all':!![]}];}_0x3ea251=_['merge']({},_0x3ea251,_0x3d26bd[_0x50e8('0x3a')]);return db[_0x50e8('0x29')][_0x50e8('0x41')](_0x3ea251)[_0x50e8('0x23')](handleEntityNotFound(_0x44e0ca,null))[_0x50e8('0x23')](respondWithResult(_0x44e0ca,null))[_0x50e8('0x3e')](handleError(_0x44e0ca,null));};exports[_0x50e8('0x42')]=function(_0x3e52b3,_0x141bd4){return db[_0x50e8('0x29')][_0x50e8('0x42')](_0x3e52b3['body'],{})[_0x50e8('0x23')](respondWithResult(_0x141bd4,0xc9))[_0x50e8('0x3e')](handleError(_0x141bd4,null));};exports['update']=function(_0x3692ba,_0x58f14e){if(_0x3692ba[_0x50e8('0x43')]['id']){delete _0x3692ba['body']['id'];}delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x44')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x45')];delete _0x3692ba[_0x50e8('0x43')][_0x50e8('0x46')];delete _0x3692ba[_0x50e8('0x43')]['value'];return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x3692ba[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](handleEntityNotFound(_0x58f14e,null))[_0x50e8('0x23')](saveUpdates(_0x3692ba[_0x50e8('0x43')],null))['then'](respondWithResult(_0x58f14e,null))[_0x50e8('0x3e')](handleError(_0x58f14e,null));};exports[_0x50e8('0x48')]=function(_0xff2e24,_0x27c80a){return db['ScreenRecording'][_0x50e8('0x48')]()[_0x50e8('0x23')](respondWithResult(_0x27c80a,null))[_0x50e8('0x3e')](handleError(_0x27c80a,null));};exports[_0x50e8('0x49')]=function(_0x207f06,_0x1372e3,_0x320b00){var _0x5f5220=require('../../components/encryptor');var _0x55083e=![];var _0x2b54ad={};if(_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]&&_0x207f06[_0x50e8('0x2f')][_0x50e8('0x39')]===_0x50e8('0x4a')){_0x2b54ad['uniqueid']=_0x207f06[_0x50e8('0x47')]['id'];}else{_0x2b54ad['id']=_0x207f06[_0x50e8('0x47')]['id'];}return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':_0x2b54ad,'attributes':['id','value'],'raw':!![]})[_0x50e8('0x23')](handleEntityNotFound(_0x1372e3,null))[_0x50e8('0x23')](function(_0x373b41){if(_0x373b41){var _0x1cc5ba=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],'server/files/screen_recordings',_0x373b41[_0x50e8('0x4d')]);var _0x5d0d54=util['format']('%s.cypher',_0x1cc5ba);if(fs[_0x50e8('0x4e')](_0x5d0d54)){_0x55083e=!![];return _0x5f5220['decryptFile'](_0x5d0d54,_0x1cc5ba,config[_0x50e8('0x4f')][_0x50e8('0x50')])[_0x50e8('0x23')](function(){return _0x373b41;});}return _0x373b41;}})[_0x50e8('0x23')](function(_0x279cf4){if(_0x279cf4){var _0x12224d=path[_0x50e8('0x4b')](config['root'],_0x50e8('0x51'),_0x279cf4[_0x50e8('0x4d')]);if(!fs[_0x50e8('0x4e')](_0x12224d)){throw new db['Sequelize']['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x279cf4[_0x50e8('0x52')]){return _0x1372e3[_0x50e8('0x49')](_0x12224d,_0x279cf4[_0x50e8('0x52')]+path[_0x50e8('0x53')](_0x12224d),function(){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}else{return _0x1372e3[_0x50e8('0x49')](_0x12224d,function(_0x583d6a){if(_0x55083e){fs[_0x50e8('0x54')](_0x12224d);}});}}})['catch'](function(_0x255b48){if(_0x255b48[_0x50e8('0x55')]==='ScreenRecording\x20not\x20found'){_0x1372e3['status'](0x194)['send'](_0x50e8('0x56'));}else{return handleError(_0x1372e3,null);}});};exports[_0x50e8('0x57')]=function(_0x5d1fc8,_0x351047){return db[_0x50e8('0x29')][_0x50e8('0x41')]({'where':{'id':_0x5d1fc8[_0x50e8('0x47')]['id']}})[_0x50e8('0x23')](function(_0x47b428){if(_[_0x50e8('0x58')](_0x47b428)){throw new ReferenceError(_0x50e8('0x59'));}return _0x47b428;})[_0x50e8('0x23')](function(_0x4b80ac){var _0x583e58=path[_0x50e8('0x4b')](config[_0x50e8('0x4c')],_0x50e8('0x51'),_0x4b80ac[_0x50e8('0x4d')]);logger[_0x50e8('0x5a')](_0x50e8('0x5b'),_0x583e58);if(!_['isNil'](_0x4b80ac['value'])&&fs[_0x50e8('0x4e')](_0x583e58)){logger['info'](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs['unlinkSync'](_0x583e58);}_0x583e58=_0x583e58+_0x50e8('0x5e');if(!_['isNil'](_0x4b80ac['value'])&&fs['existsSync'](_0x583e58)){logger[_0x50e8('0x5a')](_0x50e8('0x5c')+_0x583e58+_0x50e8('0x5d'));fs[_0x50e8('0x5f')](_0x583e58);}return _0x4b80ac;})['then'](function(_0x480362){if(!_0x480362)throw new InternalError();return _0x480362[_0x50e8('0x57')]();})[_0x50e8('0x23')](function(){_0x351047[_0x50e8('0x18')](0xcc)[_0x50e8('0x19')]();})[_0x50e8('0x3e')](handleError(_0x351047,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 054b464..0948a5f 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 _0x0359=['../../config/logger','api','moment','request-promise','../../config/environment','./screenRecording.attributes','exports','define','interactionid','lodash','util'];(function(_0x207c32,_0x2a179f){var _0x24ad34=function(_0x25a883){while(--_0x25a883){_0x207c32['push'](_0x207c32['shift']());}};_0x24ad34(++_0x2a179f);}(_0x0359,0xae));var _0x9035=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0359[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x9035('0x0'));var util=require(_0x9035('0x1'));var logger=require(_0x9035('0x2'))(_0x9035('0x3'));var moment=require(_0x9035('0x4'));var BPromise=require('bluebird');var rp=require(_0x9035('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9035('0x6'));var attributes=require(_0x9035('0x7'));module[_0x9035('0x8')]=function(_0x3a80c1,_0x32c6a5){return _0x3a80c1[_0x9035('0x9')]('ScreenRecording',attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x9035('0xa'),'fields':[_0x9035('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd297=['interactionid','lodash','api','bluebird','request-promise','rimraf','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings'];(function(_0x4e908a,_0x319580){var _0xaaa676=function(_0x4e1632){while(--_0x4e1632){_0x4e908a['push'](_0x4e908a['shift']());}};_0xaaa676(++_0x319580);}(_0xd297,0x90));var _0x7d29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd297[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7d29('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x7d29('0x1'));var moment=require('moment');var BPromise=require(_0x7d29('0x2'));var rp=require(_0x7d29('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d29('0x4'));var config=require('../../config/environment');var attributes=require(_0x7d29('0x5'));module[_0x7d29('0x6')]=function(_0x479e6c,_0x440b64){return _0x479e6c[_0x7d29('0x7')](_0x7d29('0x8'),attributes,{'tableName':_0x7d29('0x9'),'paranoid':![],'indexes':[{'name':_0x7d29('0xa'),'fields':[_0x7d29('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 fe0a864..a87d6ad 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 _0x06cb=['client','request','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x06cb,0x185));var _0xb06c=function(_0x53fa57,_0x290fc4){_0x53fa57=_0x53fa57-0x0;var _0x290f20=_0x06cb[_0x53fa57];return _0x290f20;};'use strict';var _=require(_0xb06c('0x0'));var util=require(_0xb06c('0x1'));var moment=require(_0xb06c('0x2'));var BPromise=require(_0xb06c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb06c('0x4'))['db'];var utils=require(_0xb06c('0x5'));var logger=require(_0xb06c('0x6'))(_0xb06c('0x7'));var config=require(_0xb06c('0x8'));var jayson=require(_0xb06c('0x9'));var client=jayson[_0xb06c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc244,_0x1eaf6c,_0x2e53b3){return new BPromise(function(_0x4c11e9,_0x61afc9){return client[_0xb06c('0xb')](_0x4dc244,_0x2e53b3)[_0xb06c('0xc')](function(_0x399693){logger['info'](_0xb06c('0xd'),_0x1eaf6c,_0xb06c('0xe'));logger['debug'](_0xb06c('0xf'),_0x1eaf6c,_0xb06c('0xe'),JSON[_0xb06c('0x10')](_0x399693));if(_0x399693[_0xb06c('0x11')]){if(_0x399693[_0xb06c('0x11')][_0xb06c('0x12')]===0x1f4){logger[_0xb06c('0x11')](_0xb06c('0xd'),_0x1eaf6c,_0x399693[_0xb06c('0x11')][_0xb06c('0x13')]);return _0x61afc9(_0x399693[_0xb06c('0x11')][_0xb06c('0x13')]);}logger['error'](_0xb06c('0xd'),_0x1eaf6c,_0x399693[_0xb06c('0x11')][_0xb06c('0x13')]);return _0x4c11e9(_0x399693[_0xb06c('0x11')]['message']);}else{logger['info'](_0xb06c('0xd'),_0x1eaf6c,_0xb06c('0xe'));_0x4c11e9(_0x399693['result'][_0xb06c('0x13')]);}})[_0xb06c('0x14')](function(_0x312b75){logger['error'](_0xb06c('0xd'),_0x1eaf6c,_0x312b75);_0x61afc9(_0x312b75);});});} \ No newline at end of file +var _0x1bd9=['message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','then','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','code','error'];(function(_0x24721a,_0x1ac53c){var _0x6a9880=function(_0x558dc8){while(--_0x558dc8){_0x24721a['push'](_0x24721a['shift']());}};_0x6a9880(++_0x1ac53c);}(_0x1bd9,0x133));var _0x91bd=function(_0xadfd73,_0xdfda04){_0xadfd73=_0xadfd73-0x0;var _0x2bbab6=_0x1bd9[_0xadfd73];return _0x2bbab6;};'use strict';var _=require(_0x91bd('0x0'));var util=require(_0x91bd('0x1'));var moment=require(_0x91bd('0x2'));var BPromise=require(_0x91bd('0x3'));var rs=require(_0x91bd('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x91bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x91bd('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x91bd('0x7'));var client=jayson[_0x91bd('0x8')][_0x91bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x19c05a,_0x371b68,_0xb461d1){return new BPromise(function(_0x434e40,_0x53f7f3){return client['request'](_0x19c05a,_0xb461d1)[_0x91bd('0xa')](function(_0x3da3c9){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x371b68,_0x91bd('0xb'));logger['debug'](_0x91bd('0xc'),_0x371b68,_0x91bd('0xb'),JSON[_0x91bd('0xd')](_0x3da3c9));if(_0x3da3c9['error']){if(_0x3da3c9['error'][_0x91bd('0xe')]===0x1f4){logger[_0x91bd('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x371b68,_0x3da3c9[_0x91bd('0xf')][_0x91bd('0x10')]);return _0x53f7f3(_0x3da3c9[_0x91bd('0xf')][_0x91bd('0x10')]);}logger[_0x91bd('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x371b68,_0x3da3c9['error'][_0x91bd('0x10')]);return _0x434e40(_0x3da3c9[_0x91bd('0xf')][_0x91bd('0x10')]);}else{logger[_0x91bd('0x11')]('ScreenRecording,\x20%s,\x20%s',_0x371b68,_0x91bd('0xb'));_0x434e40(_0x3da3c9['result']['message']);}})[_0x91bd('0x12')](function(_0x1c6a7f){logger[_0x91bd('0xf')]('ScreenRecording,\x20%s,\x20%s',_0x371b68,_0x1c6a7f);_0x53f7f3(_0x1c6a7f);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 3c18758..fdc2ef2 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 _0xf6f8=['/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','addLogo','format','logologin','file','favicon','addFavicon','put','/:id','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','/now','getDate','/:id/logo','getLogo'];(function(_0x46d9a1,_0x136802){var _0x17c284=function(_0x4c6820){while(--_0x4c6820){_0x46d9a1['push'](_0x46d9a1['shift']());}};_0x17c284(++_0x136802);}(_0xf6f8,0x69));var _0x8f6f=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xf6f8[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require(_0x8f6f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8f6f('0x1'));var express=require(_0x8f6f('0x2'));var router=express[_0x8f6f('0x3')]();var fs_extra=require(_0x8f6f('0x4'));var auth=require(_0x8f6f('0x5'));var interaction=require(_0x8f6f('0x6'));var config=require(_0x8f6f('0x7'));var controller=require(_0x8f6f('0x8'));router[_0x8f6f('0x9')]('/',auth[_0x8f6f('0xa')](),controller['index']);router[_0x8f6f('0x9')](_0x8f6f('0xb'),controller[_0x8f6f('0xc')]);router[_0x8f6f('0x9')]('/:id',controller['show']);router['get'](_0x8f6f('0xd'),controller[_0x8f6f('0xe')]);router[_0x8f6f('0x9')](_0x8f6f('0xf'),controller[_0x8f6f('0x10')]);router[_0x8f6f('0x9')](_0x8f6f('0x11'),controller[_0x8f6f('0x12')]);router[_0x8f6f('0x9')](_0x8f6f('0x13'),controller[_0x8f6f('0x14')]);router[_0x8f6f('0x9')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x8f6f('0x15')]({'destination':function(_0x4f35e9,_0x2995ef,_0x26e9be){_0x26e9be(null,path[_0x8f6f('0x16')](config[_0x8f6f('0x17')],_0x8f6f('0x18')));},'filename':function(_0x2b913e,_0x32db9e,_0x5638e1){_0x5638e1(null,util['format'](_0x8f6f('0x19'),_0x8f6f('0x1a'),path[_0x8f6f('0x1b')](_0x32db9e[_0x8f6f('0x1c')])));}})});router[_0x8f6f('0x1d')]('/:id/logo',upload[_0x8f6f('0x1e')]('file'),controller[_0x8f6f('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x577335,_0x376494,_0x226ad9){_0x226ad9(null,path['join'](config['root'],_0x8f6f('0x18')));},'filename':function(_0x1fe715,_0x1ec654,_0x12ce35){_0x12ce35(null,util[_0x8f6f('0x20')](_0x8f6f('0x19'),_0x8f6f('0x21'),path[_0x8f6f('0x1b')](_0x1ec654[_0x8f6f('0x1c')])));}})});router['post'](_0x8f6f('0xf'),upload[_0x8f6f('0x1e')](_0x8f6f('0x22')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x8f6f('0x15')]({'destination':function(_0x1fee00,_0x2a675f,_0x256a0c){_0x256a0c(null,path[_0x8f6f('0x16')](config[_0x8f6f('0x17')],'server/files/images/logos/'));},'filename':function(_0x8cb3a0,_0x2caff6,_0xeba771){_0xeba771(null,util[_0x8f6f('0x20')](_0x8f6f('0x19'),'preferred',path['extname'](_0x2caff6[_0x8f6f('0x1c')])));}})});router[_0x8f6f('0x1d')]('/:id/preferred',upload[_0x8f6f('0x1e')]('file'),controller['addPreferred']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x479306,_0x3bf322,_0x5350c5){_0x5350c5(null,path[_0x8f6f('0x16')](config[_0x8f6f('0x17')],_0x8f6f('0x18')));},'filename':function(_0x355bbd,_0x135483,_0xef2492){_0xef2492(null,util[_0x8f6f('0x20')]('%s%s',_0x8f6f('0x23'),path[_0x8f6f('0x1b')](_0x135483[_0x8f6f('0x1c')])));}})});router[_0x8f6f('0x1d')]('/:id/favicon',upload['single']('file'),controller[_0x8f6f('0x24')]);router[_0x8f6f('0x25')](_0x8f6f('0x26'),auth[_0x8f6f('0xa')](),controller['update']);module[_0x8f6f('0x27')]=router; \ No newline at end of file +var _0x808a=['server/files/images/logos/','format','%s%s','extname','/:id/logo','single','file','addLogo','logologin','originalname','post','addLogoLogin','addPreferred','favicon','addFavicon','put','/:id','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','getDate','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x808a,0x121));var _0xa808=function(_0x123831,_0x8fe1d6){_0x123831=_0x123831-0x0;var _0x47455b=_0x808a[_0x123831];return _0x47455b;};'use strict';var multer=require('multer');var util=require(_0xa808('0x0'));var path=require(_0xa808('0x1'));var timeout=require(_0xa808('0x2'));var express=require(_0xa808('0x3'));var router=express[_0xa808('0x4')]();var fs_extra=require(_0xa808('0x5'));var auth=require(_0xa808('0x6'));var interaction=require(_0xa808('0x7'));var config=require(_0xa808('0x8'));var controller=require(_0xa808('0x9'));router[_0xa808('0xa')]('/',auth[_0xa808('0xb')](),controller[_0xa808('0xc')]);router[_0xa808('0xa')]('/now',controller[_0xa808('0xd')]);router[_0xa808('0xa')]('/:id',controller[_0xa808('0xe')]);router[_0xa808('0xa')]('/:id/logo',controller[_0xa808('0xf')]);router[_0xa808('0xa')](_0xa808('0x10'),controller[_0xa808('0x11')]);router[_0xa808('0xa')](_0xa808('0x12'),controller[_0xa808('0x13')]);router[_0xa808('0xa')](_0xa808('0x14'),controller['getPreferred']);router[_0xa808('0xa')](_0xa808('0x15'),controller[_0xa808('0x16')]);var upload=multer({'storage':multer[_0xa808('0x17')]({'destination':function(_0x2104e2,_0x37ccde,_0x270ec3){_0x270ec3(null,path[_0xa808('0x18')](config[_0xa808('0x19')],_0xa808('0x1a')));},'filename':function(_0x4d15d8,_0x4267dc,_0x2f629f){_0x2f629f(null,util[_0xa808('0x1b')](_0xa808('0x1c'),'logo',path[_0xa808('0x1d')](_0x4267dc['originalname'])));}})});router['post'](_0xa808('0x1e'),upload[_0xa808('0x1f')](_0xa808('0x20')),controller[_0xa808('0x21')]);var upload=multer({'storage':multer[_0xa808('0x17')]({'destination':function(_0x2dea01,_0xeac81c,_0x310227){_0x310227(null,path[_0xa808('0x18')](config[_0xa808('0x19')],_0xa808('0x1a')));},'filename':function(_0x325794,_0x5cca2d,_0xbaab32){_0xbaab32(null,util['format'](_0xa808('0x1c'),_0xa808('0x22'),path[_0xa808('0x1d')](_0x5cca2d[_0xa808('0x23')])));}})});router[_0xa808('0x24')](_0xa808('0x10'),upload['single'](_0xa808('0x20')),controller[_0xa808('0x25')]);var upload=multer({'storage':multer[_0xa808('0x17')]({'destination':function(_0x115aa6,_0x5f1584,_0x1146a1){_0x1146a1(null,path['join'](config[_0xa808('0x19')],_0xa808('0x1a')));},'filename':function(_0x4821ad,_0x5926d1,_0x289ecd){_0x289ecd(null,util[_0xa808('0x1b')](_0xa808('0x1c'),'preferred',path[_0xa808('0x1d')](_0x5926d1[_0xa808('0x23')])));}})});router[_0xa808('0x24')](_0xa808('0x14'),upload[_0xa808('0x1f')](_0xa808('0x20')),controller[_0xa808('0x26')]);var upload=multer({'storage':multer[_0xa808('0x17')]({'destination':function(_0x5ce0b6,_0x55df1d,_0x2268a9){_0x2268a9(null,path['join'](config[_0xa808('0x19')],'server/files/images/logos/'));},'filename':function(_0x450d05,_0x52f4a6,_0x3a8752){_0x3a8752(null,util[_0xa808('0x1b')](_0xa808('0x1c'),_0xa808('0x27'),path[_0xa808('0x1d')](_0x52f4a6[_0xa808('0x23')])));}})});router[_0xa808('0x24')](_0xa808('0x15'),upload[_0xa808('0x1f')](_0xa808('0x20')),controller[_0xa808('0x28')]);router[_0xa808('0x29')](_0xa808('0x2a'),auth[_0xa808('0xb')](),controller[_0xa808('0x2b')]);module[_0xa808('0x2c')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 3edfa60..7480665 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 _0xa126=['/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa126,0x1e5));var _0x6a12=function(_0x13eb46,_0x66d3ab){_0x13eb46=_0x13eb46-0x0;var _0x38c51a=_0xa126[_0x13eb46];return _0x38c51a;};'use strict';var Sequelize=require(_0x6a12('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x6a12('0x1')](0xb),'unique':_0x6a12('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x6a12('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x6a12('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x6a12('0x4')],'defaultValue':_0x6a12('0x5')},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x6a12('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x6a12('0x4')]},'turnaddr':{'type':Sequelize[_0x6a12('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0x6a12('0x4')]},'pageTitle':{'type':Sequelize[_0x6a12('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x6a12('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x6a12('0x4')],'defaultValue':_0x6a12('0x7')},'enableEmailPreview':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x6a12('0x4')],'defaultValue':_0x6a12('0x8')},'chatTimeout':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x6a12('0x4')]},'defaultPreferred':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x6a12('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x6a12('0x4')]},'defaultFavicon':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x6a12('0x1')]},'transcribeRegion':{'type':Sequelize[_0x6a12('0x4')]},'sentiment':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x6a12('0x1')]},'sentimentRegion':{'type':Sequelize[_0x6a12('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x6a12('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x6a12('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x6a12('0x1')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x6a12('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x6a12('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize['INTEGER'],'defaultValue':0x14},'filterFullName':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0204=['UNSIGNED','sequelize','INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0x0204,0x91));var _0x4020=function(_0x57d884,_0x1f1027){_0x57d884=_0x57d884-0x0;var _0x13ee7e=_0x0204[_0x57d884];return _0x13ee7e;};'use strict';var Sequelize=require(_0x4020('0x0'));module['exports']={'min_internal':{'type':Sequelize[_0x4020('0x1')](0xb),'unique':_0x4020('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x4020('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x4020('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x4020('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0x4020('0x4')]},'defaultLogo':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x4020('0x4')]},'defaultLoginLogo':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x4020('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x4020('0x4')]},'turnaddr':{'type':Sequelize[_0x4020('0x4')]},'turnusername':{'type':Sequelize[_0x4020('0x4')]},'turnpassword':{'type':Sequelize[_0x4020('0x4')]},'pageTitle':{'type':Sequelize[_0x4020('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x4020('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x4020('0x6')},'enableEmailPreview':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4020('0x4')],'defaultValue':_0x4020('0x7')},'chatTimeout':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x4020('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x5},'blockDuration':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x4020('0x4')]},'defaultFavicon':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x4020('0x4')]},'sentiment':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x4020('0x1')]},'sentimentRegion':{'type':Sequelize[_0x4020('0x4')]},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize['STRING']},'googleSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x4020('0x1')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x4020('0x1')](0x2)[_0x4020('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x4020('0x1')](0x2)[_0x4020('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x4020('0x5')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x4020('0x1')],'defaultValue':0x14},'filterFullName':{'type':Sequelize[_0x4020('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index b426087..67b16fa 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 _0x6f7f=['default','custom','default_logo.svg','ValidationError','\x20not\x20found','download','getLogoLogin','defaultFavicon','default_loginLogo.svg','upperFirst','Sequelize','gdpr','securePassword','server/files/images/logos','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','destroy','stack','name','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','options','include','findAll','rows','catch','show','params','keys','includeAll','find','body','addLogo','file','filename','addLogoLogin','loginLogo','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','root','toLower','join'];(function(_0x4c5d3f,_0x3db106){var _0x4ff519=function(_0x4dc499){while(--_0x4dc499){_0x4c5d3f['push'](_0x4c5d3f['shift']());}};_0x4ff519(++_0x3db106);}(_0x6f7f,0x177));var _0xf6f7=function(_0x482d18,_0x52096e){_0x482d18=_0x482d18-0x0;var _0x3808af=_0x6f7f[_0x482d18];return _0x3808af;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6f7('0x0'));var zipdir=require(_0xf6f7('0x1'));var jsonpatch=require(_0xf6f7('0x2'));var rp=require(_0xf6f7('0x3'));var moment=require(_0xf6f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf6f7('0x5'));var util=require('util');var path=require(_0xf6f7('0x6'));var sox=require(_0xf6f7('0x7'));var csv=require(_0xf6f7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6f7('0x9'));var _=require('lodash');var squel=require(_0xf6f7('0xa'));var crypto=require(_0xf6f7('0xb'));var jsforce=require(_0xf6f7('0xc'));var deskjs=require(_0xf6f7('0xd'));var toCsv=require(_0xf6f7('0x8'));var querystring=require(_0xf6f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xf6f7('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf6f7('0x10'));var logger=require(_0xf6f7('0x11'))(_0xf6f7('0x12'));var utils=require(_0xf6f7('0x13'));var config=require(_0xf6f7('0x14'));var licenseUtil=require(_0xf6f7('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xf6f7('0x16')][_0xf6f7('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x6c7e0b,_0x4fe21e,_0x5f2aee,_0x568242){return new BPromise(function(_0xc4fe52,_0x4f8d9b){var _0x87ae1a=_0x568242||client;return _0x87ae1a['request'](_0x6c7e0b,_0x5f2aee)[_0xf6f7('0x18')](function(_0x2ca201){logger[_0xf6f7('0x19')](_0xf6f7('0x1a'),_0x4fe21e,_0xf6f7('0x1b'));logger['debug'](_0xf6f7('0x1c'),_0x4fe21e,_0xf6f7('0x1b'),JSON['stringify'](_0x2ca201));if(_0x2ca201[_0xf6f7('0x1d')]){if(_0x2ca201[_0xf6f7('0x1d')][_0xf6f7('0x1e')]===0x1f4){logger[_0xf6f7('0x1d')]('Setting,\x20%s,\x20%s',_0x4fe21e,_0x2ca201[_0xf6f7('0x1d')][_0xf6f7('0x1f')]);return _0x4f8d9b(_0x2ca201['error'][_0xf6f7('0x1f')]);}logger[_0xf6f7('0x1d')](_0xf6f7('0x1a'),_0x4fe21e,_0x2ca201[_0xf6f7('0x1d')][_0xf6f7('0x1f')]);return _0xc4fe52(_0x2ca201[_0xf6f7('0x1d')][_0xf6f7('0x1f')]);}else{logger['info'](_0xf6f7('0x1a'),_0x4fe21e,'request\x20sent');_0xc4fe52(_0x2ca201['result'][_0xf6f7('0x1f')]);}})['catch'](function(_0x42df64){logger[_0xf6f7('0x1d')]('Setting,\x20%s,\x20%s',_0x4fe21e,_0x42df64);_0x4f8d9b(_0x42df64);});});}function respondWithStatusCode(_0x3ce38d,_0x5ec44f){_0x5ec44f=_0x5ec44f||0xcc;return function(_0x4c349d){if(_0x4c349d){return _0x3ce38d[_0xf6f7('0x20')](_0x5ec44f);}return _0x3ce38d[_0xf6f7('0x21')](_0x5ec44f)[_0xf6f7('0x22')]();};}function respondWithResult(_0x25e62f,_0xa903ff){_0xa903ff=_0xa903ff||0xc8;return function(_0x5d3370){if(_0x5d3370){return _0x25e62f['status'](_0xa903ff)[_0xf6f7('0x23')](_0x5d3370);}};}function respondWithFilteredResult(_0x2620a4,_0x277023){return function(_0x1de269){if(_0x1de269){var _0x329c39=typeof _0x277023[_0xf6f7('0x24')]==='undefined'&&typeof _0x277023[_0xf6f7('0x25')]===_0xf6f7('0x26');var _0x3a6f6a=_0x1de269[_0xf6f7('0x27')];var _0x35a384=_0x329c39?0x0:_0x277023[_0xf6f7('0x24')];var _0x3be42f=_0x329c39?_0x1de269['count']:_0x277023['offset']+_0x277023['limit'];var _0x3bd11b;if(_0x3be42f>=_0x3a6f6a){_0x3be42f=_0x3a6f6a;_0x3bd11b=0xc8;}else{_0x3bd11b=0xce;}_0x2620a4['status'](_0x3bd11b);return _0x2620a4[_0xf6f7('0x28')](_0xf6f7('0x29'),_0x35a384+'-'+_0x3be42f+'/'+_0x3a6f6a)['json'](_0x1de269);}return null;};}function patchUpdates(_0x50ef5b){return function(_0x3b85db){try{jsonpatch[_0xf6f7('0x2a')](_0x3b85db,_0x50ef5b,!![]);}catch(_0x3da512){return BPromise['reject'](_0x3da512);}return _0x3b85db[_0xf6f7('0x2b')]();};}function saveUpdates(_0x505b20,_0x34b223){return function(_0x2b0faf){if(_0x2b0faf){return _0x2b0faf[_0xf6f7('0x2c')](_0x505b20)[_0xf6f7('0x18')](function(_0xfc3e82){return _0xfc3e82;});}return null;};}function removeEntity(_0x15b01c,_0x14fb82){return function(_0x257af4){if(_0x257af4){return _0x257af4[_0xf6f7('0x2d')]()[_0xf6f7('0x18')](function(){_0x15b01c[_0xf6f7('0x21')](0xcc)[_0xf6f7('0x22')]();});}};}function handleEntityNotFound(_0x5883e3,_0x3fbdb6){return function(_0x55e336){if(!_0x55e336){_0x5883e3[_0xf6f7('0x20')](0x194);}return _0x55e336;};}function handleError(_0x4704d5,_0x2b5f41){_0x2b5f41=_0x2b5f41||0x1f4;return function(_0x16404d){logger[_0xf6f7('0x1d')](_0x16404d[_0xf6f7('0x2e')]);if(_0x16404d[_0xf6f7('0x2f')]){delete _0x16404d[_0xf6f7('0x2f')];}_0x4704d5[_0xf6f7('0x21')](_0x2b5f41)['send'](_0x16404d);};}exports['index']=function(_0x2ec167,_0x1640b8){var _0x1788c4={},_0x342309={},_0x1c629e={'count':0x0,'rows':[]};var _0x41975f=_[_0xf6f7('0x30')](db[_0xf6f7('0x31')][_0xf6f7('0x32')],function(_0x27be8a){return{'name':_0x27be8a[_0xf6f7('0x33')],'type':_0x27be8a[_0xf6f7('0x34')][_0xf6f7('0x35')]};});_0x342309[_0xf6f7('0x36')]=_[_0xf6f7('0x30')](_0x41975f,_0xf6f7('0x2f'));_0x342309['query']=_['keys'](_0x2ec167[_0xf6f7('0x37')]);_0x342309[_0xf6f7('0x38')]=_[_0xf6f7('0x39')](_0x342309[_0xf6f7('0x36')],_0x342309[_0xf6f7('0x37')]);_0x1788c4[_0xf6f7('0x3a')]=_['intersection'](_0x342309[_0xf6f7('0x36')],qs[_0xf6f7('0x3b')](_0x2ec167[_0xf6f7('0x37')][_0xf6f7('0x3b')]));_0x1788c4['attributes']=_0x1788c4['attributes'][_0xf6f7('0x3c')]?_0x1788c4['attributes']:_0x342309['model'];if(!_0x2ec167[_0xf6f7('0x37')][_0xf6f7('0x3d')](_0xf6f7('0x3e'))){_0x1788c4['limit']=qs[_0xf6f7('0x25')](_0x2ec167[_0xf6f7('0x37')][_0xf6f7('0x25')]);_0x1788c4[_0xf6f7('0x24')]=qs['offset'](_0x2ec167[_0xf6f7('0x37')][_0xf6f7('0x24')]);}_0x1788c4['order']=qs['sort'](_0x2ec167[_0xf6f7('0x37')]['sort']);_0x1788c4[_0xf6f7('0x3f')]=qs['filters'](_['pick'](_0x2ec167['query'],_0x342309[_0xf6f7('0x38')]),_0x41975f);if(_0x2ec167[_0xf6f7('0x37')][_0xf6f7('0x40')]){_0x1788c4[_0xf6f7('0x3f')]=_['merge'](_0x1788c4[_0xf6f7('0x3f')],{'$or':_['map'](_0x41975f,function(_0x8fc836){if(_0x8fc836['type']!=='VIRTUAL'){var _0x2f20d7={};_0x2f20d7[_0x8fc836[_0xf6f7('0x2f')]]={'$like':'%'+_0x2ec167[_0xf6f7('0x37')]['filter']+'%'};return _0x2f20d7;}})});}_0x1788c4=_[_0xf6f7('0x41')]({},_0x1788c4,_0x2ec167[_0xf6f7('0x42')]);var _0x4fd4e1={'where':_0x1788c4['where']};return db[_0xf6f7('0x31')]['count'](_0x4fd4e1)[_0xf6f7('0x18')](function(_0x5618cf){_0x1c629e['count']=_0x5618cf;if(_0x2ec167[_0xf6f7('0x37')]['includeAll']){_0x1788c4[_0xf6f7('0x43')]=[{'all':!![]}];}return db['Setting'][_0xf6f7('0x44')](_0x1788c4);})['then'](function(_0x4afd83){_0x1c629e[_0xf6f7('0x45')]=_0x4afd83;return _0x1c629e;})[_0xf6f7('0x18')](respondWithFilteredResult(_0x1640b8,_0x1788c4))[_0xf6f7('0x46')](handleError(_0x1640b8,null));};exports[_0xf6f7('0x47')]=function(_0x2ccc0c,_0x2b1cdf){var _0x1d944a={'raw':![],'where':{'id':_0x2ccc0c[_0xf6f7('0x48')]['id']}},_0xa5a85={};_0xa5a85[_0xf6f7('0x36')]=_[_0xf6f7('0x49')](db[_0xf6f7('0x31')]['rawAttributes']);_0xa5a85[_0xf6f7('0x37')]=_['keys'](_0x2ccc0c[_0xf6f7('0x37')]);_0xa5a85[_0xf6f7('0x38')]=_[_0xf6f7('0x39')](_0xa5a85['model'],_0xa5a85[_0xf6f7('0x37')]);_0x1d944a[_0xf6f7('0x3a')]=_[_0xf6f7('0x39')](_0xa5a85[_0xf6f7('0x36')],qs[_0xf6f7('0x3b')](_0x2ccc0c['query'][_0xf6f7('0x3b')]));_0x1d944a['attributes']=_0x1d944a[_0xf6f7('0x3a')][_0xf6f7('0x3c')]?_0x1d944a[_0xf6f7('0x3a')]:_0xa5a85['model'];if(_0x2ccc0c['query'][_0xf6f7('0x4a')]){_0x1d944a[_0xf6f7('0x43')]=[{'all':!![]}];}_0x1d944a=_[_0xf6f7('0x41')]({},_0x1d944a,_0x2ccc0c['options']);return db[_0xf6f7('0x31')][_0xf6f7('0x4b')](_0x1d944a)[_0xf6f7('0x18')](handleEntityNotFound(_0x2b1cdf,null))[_0xf6f7('0x18')](respondWithResult(_0x2b1cdf,null))[_0xf6f7('0x46')](handleError(_0x2b1cdf,null));};exports[_0xf6f7('0x2c')]=function(_0x491fc2,_0xd2adc7){if(_0x491fc2[_0xf6f7('0x4c')]['id']){delete _0x491fc2['body']['id'];}return db['Setting'][_0xf6f7('0x4b')]({'where':{'id':_0x491fc2[_0xf6f7('0x48')]['id']}})['then'](handleEntityNotFound(_0xd2adc7,null))[_0xf6f7('0x18')](saveUpdates(_0x491fc2['body'],null))[_0xf6f7('0x18')](respondWithResult(_0xd2adc7,null))[_0xf6f7('0x46')](handleError(_0xd2adc7,null));};exports[_0xf6f7('0x4d')]=function(_0xe674ca,_0x12ed5a,_0x1fe376){if(_0xe674ca[_0xf6f7('0x4e')]&&_0xe674ca[_0xf6f7('0x4e')]['filename']){_0xe674ca['body']['logo']=_0xe674ca[_0xf6f7('0x4e')][_0xf6f7('0x4f')];}return db[_0xf6f7('0x31')][_0xf6f7('0x4b')]({'where':{'id':_0xe674ca['params']['id']}})[_0xf6f7('0x18')](handleEntityNotFound(_0x12ed5a,null))['then'](saveUpdates(_0xe674ca[_0xf6f7('0x4c')],null))[_0xf6f7('0x18')](respondWithResult(_0x12ed5a,null))[_0xf6f7('0x46')](handleError(_0x12ed5a,null));};exports[_0xf6f7('0x50')]=function(_0x48b3d2,_0x1e43c4,_0x2dbddd){if(_0x48b3d2[_0xf6f7('0x4e')]&&_0x48b3d2[_0xf6f7('0x4e')][_0xf6f7('0x4f')]){_0x48b3d2[_0xf6f7('0x4c')][_0xf6f7('0x51')]=_0x48b3d2['file']['filename'];}return db['Setting'][_0xf6f7('0x4b')]({'where':{'id':_0x48b3d2[_0xf6f7('0x48')]['id']}})[_0xf6f7('0x18')](handleEntityNotFound(_0x1e43c4,null))[_0xf6f7('0x18')](saveUpdates(_0x48b3d2[_0xf6f7('0x4c')],null))[_0xf6f7('0x18')](respondWithResult(_0x1e43c4,null))[_0xf6f7('0x46')](handleError(_0x1e43c4,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x2a8a87,_0x2cfbf2,_0x590a81){var _0x100e14='server/files/images/logos';var _0x5ebf15={'custom':![]};return utilLicense[_0xf6f7('0x52')]()[_0xf6f7('0x18')](function(_0xcc7bec){if(_0xcc7bec){_0x5ebf15=_0xcc7bec;}return db[_0xf6f7('0x31')][_0xf6f7('0x4b')]({'where':{'id':_0x2a8a87[_0xf6f7('0x48')]['id']},'attributes':[_0xf6f7('0x53'),_0xf6f7('0x51'),_0xf6f7('0x54'),_0xf6f7('0x55'),_0xf6f7('0x56'),_0xf6f7('0x57'),_0xf6f7('0x58'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x2cfbf2,null))[_0xf6f7('0x18')](function(_0x5f125d){if(_0x5f125d){var _0x250912=_0x5f125d[_0xf6f7('0x53')]&&fs[_0xf6f7('0x59')](path['join'](config[_0xf6f7('0x5a')],_0x100e14,_[_0xf6f7('0x5b')](_0x5f125d[_0xf6f7('0x53')])))?path[_0xf6f7('0x5c')](config['root'],_0x100e14,_[_0xf6f7('0x5b')](_0x5f125d[_0xf6f7('0x53')])):path['join'](config['root'],_0x100e14,_[_0xf6f7('0x5b')]('default_logo.svg'));var _0x5c525d=_0xf6f7('0x5d')+_['upperFirst'](_0xf6f7('0x53'));if(_0x5f125d[_0x5c525d]||!_0x5ebf15[_0xf6f7('0x5e')]){_0x250912=path[_0xf6f7('0x5c')](config['root'],_0x100e14,_[_0xf6f7('0x5b')](_0xf6f7('0x5f')));}if(!fs[_0xf6f7('0x59')](_0x250912)){throw new db['Sequelize'][(_0xf6f7('0x60'))](_['upperFirst'](_0xf6f7('0x53'))+_0xf6f7('0x61'));}return _0x2cfbf2[_0xf6f7('0x62')](_0x250912);}})[_0xf6f7('0x46')](handleError(_0x2cfbf2,null));};var utilLicense=require(_0xf6f7('0x15'));exports[_0xf6f7('0x63')]=function(_0x4a20dd,_0x4cae3d,_0xda22d2){var _0x29fb2b='server/files/images/logos';var _0x538245={'custom':![]};return utilLicense[_0xf6f7('0x52')]()[_0xf6f7('0x18')](function(_0x1814d2){if(_0x1814d2){_0x538245=_0x1814d2;}return db[_0xf6f7('0x31')][_0xf6f7('0x4b')]({'where':{'id':_0x4a20dd[_0xf6f7('0x48')]['id']},'attributes':['logo',_0xf6f7('0x51'),_0xf6f7('0x54'),_0xf6f7('0x55'),_0xf6f7('0x56'),_0xf6f7('0x57'),'defaultPreferred',_0xf6f7('0x64')],'raw':!![]});})[_0xf6f7('0x18')](handleEntityNotFound(_0x4cae3d,null))['then'](function(_0x27621a){if(_0x27621a){var _0x1eb0fc=_0x27621a[_0xf6f7('0x51')]&&fs[_0xf6f7('0x59')](path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x29fb2b,_[_0xf6f7('0x5b')](_0x27621a['loginLogo'])))?path[_0xf6f7('0x5c')](config['root'],_0x29fb2b,_['toLower'](_0x27621a[_0xf6f7('0x51')])):path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x29fb2b,_['toLower'](_0xf6f7('0x65')));var _0x2770da=_0xf6f7('0x5d')+_[_0xf6f7('0x66')](_0xf6f7('0x51'));if(_0x27621a[_0x2770da]||!_0x538245[_0xf6f7('0x5e')]){_0x1eb0fc=path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x29fb2b,_[_0xf6f7('0x5b')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x1eb0fc)){throw new db[(_0xf6f7('0x67'))][(_0xf6f7('0x60'))](_[_0xf6f7('0x66')]('loginLogo')+_0xf6f7('0x61'));}return _0x4cae3d[_0xf6f7('0x62')](_0x1eb0fc);}})[_0xf6f7('0x46')](handleError(_0x4cae3d,null));};exports[_0xf6f7('0x68')]=function(_0x1998c6,_0x108d2b){return db[_0xf6f7('0x31')][_0xf6f7('0x4b')]({'where':{'id':_0x1998c6['params']['id']},'attributes':[_0xf6f7('0x69')]})[_0xf6f7('0x18')](respondWithResult(_0x108d2b,null))['catch'](handleError(_0x108d2b,null));};exports['addPreferred']=function(_0x3a9cdd,_0x5bd8f7,_0x5f3f1b){if(_0x3a9cdd['file']&&_0x3a9cdd[_0xf6f7('0x4e')][_0xf6f7('0x4f')]){_0x3a9cdd[_0xf6f7('0x4c')][_0xf6f7('0x54')]=_0x3a9cdd[_0xf6f7('0x4e')][_0xf6f7('0x4f')];}return db[_0xf6f7('0x31')][_0xf6f7('0x4b')]({'where':{'id':_0x3a9cdd[_0xf6f7('0x48')]['id']}})[_0xf6f7('0x18')](handleEntityNotFound(_0x5bd8f7,null))[_0xf6f7('0x18')](saveUpdates(_0x3a9cdd[_0xf6f7('0x4c')],null))['then'](respondWithResult(_0x5bd8f7,null))[_0xf6f7('0x46')](handleError(_0x5bd8f7,null));};var utilLicense=require(_0xf6f7('0x15'));exports['getPreferred']=function(_0x39f210,_0x14a319,_0xb6ab59){var _0x5f4bc9=_0xf6f7('0x6a');var _0x1871b8={'custom':![]};return utilLicense['getLicense']()[_0xf6f7('0x18')](function(_0xc5045){if(_0xc5045){_0x1871b8=_0xc5045;}return db[_0xf6f7('0x31')][_0xf6f7('0x4b')]({'where':{'id':_0x39f210[_0xf6f7('0x48')]['id']},'attributes':[_0xf6f7('0x53'),_0xf6f7('0x51'),'preferred',_0xf6f7('0x55'),_0xf6f7('0x56'),'defaultLoginLogo',_0xf6f7('0x58'),_0xf6f7('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x14a319,null))[_0xf6f7('0x18')](function(_0x54f9a6){if(_0x54f9a6){var _0x4931d6=_0x54f9a6['preferred']&&fs[_0xf6f7('0x59')](path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x5f4bc9,_['toLower'](_0x54f9a6[_0xf6f7('0x54')])))?path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x5f4bc9,_[_0xf6f7('0x5b')](_0x54f9a6[_0xf6f7('0x54')])):path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x5f4bc9,_[_0xf6f7('0x5b')](_0xf6f7('0x6b')));var _0x89aea6=_0xf6f7('0x5d')+_[_0xf6f7('0x66')](_0xf6f7('0x54'));if(_0x54f9a6[_0x89aea6]||!_0x1871b8['custom']||!_0x1871b8[_0xf6f7('0x54')]){_0x4931d6=path['join'](config[_0xf6f7('0x5a')],_0x5f4bc9,_['toLower']('default_preferred.png'));}if(!fs['existsSync'](_0x4931d6)){throw new db[(_0xf6f7('0x67'))][(_0xf6f7('0x60'))](_[_0xf6f7('0x66')](_0xf6f7('0x54'))+_0xf6f7('0x61'));}return _0x14a319['download'](_0x4931d6);}})[_0xf6f7('0x46')](handleError(_0x14a319,null));};exports[_0xf6f7('0x6c')]=function(_0x4ec6dd,_0x267a6a,_0x2f9ba8){if(_0x4ec6dd['file']&&_0x4ec6dd[_0xf6f7('0x4e')][_0xf6f7('0x4f')]){_0x4ec6dd[_0xf6f7('0x4c')][_0xf6f7('0x55')]=_0x4ec6dd[_0xf6f7('0x4e')][_0xf6f7('0x4f')];}return db[_0xf6f7('0x31')][_0xf6f7('0x4b')]({'where':{'id':_0x4ec6dd[_0xf6f7('0x48')]['id']}})[_0xf6f7('0x18')](handleEntityNotFound(_0x267a6a,null))[_0xf6f7('0x18')](saveUpdates(_0x4ec6dd[_0xf6f7('0x4c')],null))['then'](respondWithResult(_0x267a6a,null))[_0xf6f7('0x46')](handleError(_0x267a6a,null));};var utilLicense=require(_0xf6f7('0x15'));exports[_0xf6f7('0x6d')]=function(_0x301eb3,_0x54cf62,_0x461790){var _0x4d0386=_0xf6f7('0x6a');var _0x2bc534={'custom':![]};return utilLicense[_0xf6f7('0x52')]()[_0xf6f7('0x18')](function(_0x240083){if(_0x240083){_0x2bc534=_0x240083;}return db['Setting'][_0xf6f7('0x4b')]({'where':{'id':_0x301eb3[_0xf6f7('0x48')]['id']},'attributes':['logo',_0xf6f7('0x51'),'preferred','favicon',_0xf6f7('0x56'),_0xf6f7('0x57'),_0xf6f7('0x58'),'defaultFavicon'],'raw':!![]});})[_0xf6f7('0x18')](handleEntityNotFound(_0x54cf62,null))['then'](function(_0x2df55a){if(_0x2df55a){var _0x294b6c=_0x2df55a[_0xf6f7('0x55')]&&fs['existsSync'](path[_0xf6f7('0x5c')](config['root'],_0x4d0386,_[_0xf6f7('0x5b')](_0x2df55a[_0xf6f7('0x55')])))?path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x4d0386,_[_0xf6f7('0x5b')](_0x2df55a[_0xf6f7('0x55')])):path['join'](config[_0xf6f7('0x5a')],_0x4d0386,_['toLower'](_0xf6f7('0x6e')));var _0x58f889=_0xf6f7('0x5d')+_['upperFirst'](_0xf6f7('0x55'));if(_0x2df55a[_0x58f889]||!_0x2bc534[_0xf6f7('0x5e')]){_0x294b6c=path[_0xf6f7('0x5c')](config[_0xf6f7('0x5a')],_0x4d0386,_[_0xf6f7('0x5b')](_0xf6f7('0x6e')));}if(!fs[_0xf6f7('0x59')](_0x294b6c)){throw new db[(_0xf6f7('0x67'))][(_0xf6f7('0x60'))](_['upperFirst'](_0xf6f7('0x55'))+_0xf6f7('0x61'));}return _0x54cf62[_0xf6f7('0x62')](_0x294b6c);}})['catch'](handleError(_0x54cf62,null));};exports[_0xf6f7('0x6f')]=function(_0x3eff25,_0x169a92){var _0x37a821={'offset':moment()[_0xf6f7('0x70')]()};_0x37a821[_0xf6f7('0x71')]=moment()['utcOffset'](_0x37a821[_0xf6f7('0x24')])[_0xf6f7('0x72')](_0xf6f7('0x73'));return _0x169a92[_0xf6f7('0x21')](0xc8)[_0xf6f7('0x74')](_0x37a821);}; \ No newline at end of file +var _0x8d57=['defaultLogo','defaultFavicon','upperFirst','gdpr','securePassword','addPreferred','getPreferred','server/files/images/logos','getLicense','preferred','default_preferred.png','addFavicon','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','json','apply','reject','save','update','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','show','params','keys','includeAll','find','body','file','filename','addLogoLogin','logo','loginLogo','favicon','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','download','getLogoLogin'];(function(_0x3ca5ab,_0x101c2a){var _0x13afb8=function(_0x4b64de){while(--_0x4b64de){_0x3ca5ab['push'](_0x3ca5ab['shift']());}};_0x13afb8(++_0x101c2a);}(_0x8d57,0xfe));var _0x78d5=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x8d57[_0x31cb5f];return _0x586042;};'use strict';var emlformat=require(_0x78d5('0x0'));var rimraf=require(_0x78d5('0x1'));var zipdir=require(_0x78d5('0x2'));var jsonpatch=require(_0x78d5('0x3'));var rp=require(_0x78d5('0x4'));var moment=require(_0x78d5('0x5'));var BPromise=require(_0x78d5('0x6'));var Mustache=require(_0x78d5('0x7'));var util=require(_0x78d5('0x8'));var path=require(_0x78d5('0x9'));var sox=require(_0x78d5('0xa'));var csv=require('to-csv');var ejs=require(_0x78d5('0xb'));var fs=require('fs');var fs_extra=require(_0x78d5('0xc'));var _=require(_0x78d5('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x78d5('0xe'));var deskjs=require(_0x78d5('0xf'));var toCsv=require(_0x78d5('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x78d5('0x11'));var authService=require(_0x78d5('0x12'));var qs=require(_0x78d5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x78d5('0x14'));var logger=require(_0x78d5('0x15'))(_0x78d5('0x16'));var utils=require('../../config/utils');var config=require(_0x78d5('0x17'));var licenseUtil=require(_0x78d5('0x18'));var db=require(_0x78d5('0x19'))['db'];var jayson=require(_0x78d5('0x1a'));var client=jayson[_0x78d5('0x1b')][_0x78d5('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3870a4,_0x26203a,_0x4ce12c,_0x1f0501){return new BPromise(function(_0x100881,_0xc605f2){var _0x235b9b=_0x1f0501||client;return _0x235b9b[_0x78d5('0x1d')](_0x3870a4,_0x4ce12c)[_0x78d5('0x1e')](function(_0x2256c9){logger[_0x78d5('0x1f')](_0x78d5('0x20'),_0x26203a,'request\x20sent');logger[_0x78d5('0x21')]('Setting,\x20%s,\x20%s,\x20%s',_0x26203a,_0x78d5('0x22'),JSON[_0x78d5('0x23')](_0x2256c9));if(_0x2256c9[_0x78d5('0x24')]){if(_0x2256c9[_0x78d5('0x24')][_0x78d5('0x25')]===0x1f4){logger[_0x78d5('0x24')](_0x78d5('0x20'),_0x26203a,_0x2256c9['error'][_0x78d5('0x26')]);return _0xc605f2(_0x2256c9[_0x78d5('0x24')][_0x78d5('0x26')]);}logger[_0x78d5('0x24')]('Setting,\x20%s,\x20%s',_0x26203a,_0x2256c9[_0x78d5('0x24')][_0x78d5('0x26')]);return _0x100881(_0x2256c9[_0x78d5('0x24')][_0x78d5('0x26')]);}else{logger[_0x78d5('0x1f')](_0x78d5('0x20'),_0x26203a,_0x78d5('0x22'));_0x100881(_0x2256c9['result'][_0x78d5('0x26')]);}})[_0x78d5('0x27')](function(_0x47aa2d){logger[_0x78d5('0x24')](_0x78d5('0x20'),_0x26203a,_0x47aa2d);_0xc605f2(_0x47aa2d);});});}function respondWithStatusCode(_0x299af6,_0x3c57a8){_0x3c57a8=_0x3c57a8||0xcc;return function(_0x29355d){if(_0x29355d){return _0x299af6[_0x78d5('0x28')](_0x3c57a8);}return _0x299af6[_0x78d5('0x29')](_0x3c57a8)[_0x78d5('0x2a')]();};}function respondWithResult(_0xe21692,_0x4e4389){_0x4e4389=_0x4e4389||0xc8;return function(_0x535778){if(_0x535778){return _0xe21692[_0x78d5('0x29')](_0x4e4389)['json'](_0x535778);}};}function respondWithFilteredResult(_0x2f3f4b,_0x1ea291){return function(_0x185c4a){if(_0x185c4a){var _0x35a0d9=typeof _0x1ea291[_0x78d5('0x2b')]===_0x78d5('0x2c')&&typeof _0x1ea291[_0x78d5('0x2d')]===_0x78d5('0x2c');var _0xc06146=_0x185c4a[_0x78d5('0x2e')];var _0x27df38=_0x35a0d9?0x0:_0x1ea291[_0x78d5('0x2b')];var _0x24b4ef=_0x35a0d9?_0x185c4a[_0x78d5('0x2e')]:_0x1ea291['offset']+_0x1ea291[_0x78d5('0x2d')];var _0x46cd34;if(_0x24b4ef>=_0xc06146){_0x24b4ef=_0xc06146;_0x46cd34=0xc8;}else{_0x46cd34=0xce;}_0x2f3f4b[_0x78d5('0x29')](_0x46cd34);return _0x2f3f4b['set']('Content-Range',_0x27df38+'-'+_0x24b4ef+'/'+_0xc06146)[_0x78d5('0x2f')](_0x185c4a);}return null;};}function patchUpdates(_0x137e2f){return function(_0x13c7c2){try{jsonpatch[_0x78d5('0x30')](_0x13c7c2,_0x137e2f,!![]);}catch(_0x5263aa){return BPromise[_0x78d5('0x31')](_0x5263aa);}return _0x13c7c2[_0x78d5('0x32')]();};}function saveUpdates(_0x22988e,_0x3997d8){return function(_0x50c08c){if(_0x50c08c){return _0x50c08c[_0x78d5('0x33')](_0x22988e)[_0x78d5('0x1e')](function(_0x42f481){return _0x42f481;});}return null;};}function removeEntity(_0xc6373e,_0x1a8776){return function(_0x25166e){if(_0x25166e){return _0x25166e['destroy']()['then'](function(){_0xc6373e[_0x78d5('0x29')](0xcc)[_0x78d5('0x2a')]();});}};}function handleEntityNotFound(_0x523bd8,_0x3749ea){return function(_0x5baef1){if(!_0x5baef1){_0x523bd8[_0x78d5('0x28')](0x194);}return _0x5baef1;};}function handleError(_0x15934f,_0x39b6c6){_0x39b6c6=_0x39b6c6||0x1f4;return function(_0x436997){logger['error'](_0x436997[_0x78d5('0x34')]);if(_0x436997[_0x78d5('0x35')]){delete _0x436997[_0x78d5('0x35')];}_0x15934f['status'](_0x39b6c6)[_0x78d5('0x36')](_0x436997);};}exports['index']=function(_0x3d6a60,_0x43135c){var _0x16b81f={},_0x571f32={},_0x30a4ad={'count':0x0,'rows':[]};var _0x448aaa=_[_0x78d5('0x37')](db[_0x78d5('0x38')][_0x78d5('0x39')],function(_0x2cfe1f){return{'name':_0x2cfe1f[_0x78d5('0x3a')],'type':_0x2cfe1f[_0x78d5('0x3b')][_0x78d5('0x3c')]};});_0x571f32[_0x78d5('0x3d')]=_[_0x78d5('0x37')](_0x448aaa,_0x78d5('0x35'));_0x571f32[_0x78d5('0x3e')]=_['keys'](_0x3d6a60[_0x78d5('0x3e')]);_0x571f32['filters']=_[_0x78d5('0x3f')](_0x571f32[_0x78d5('0x3d')],_0x571f32[_0x78d5('0x3e')]);_0x16b81f['attributes']=_[_0x78d5('0x3f')](_0x571f32[_0x78d5('0x3d')],qs[_0x78d5('0x40')](_0x3d6a60[_0x78d5('0x3e')][_0x78d5('0x40')]));_0x16b81f[_0x78d5('0x41')]=_0x16b81f[_0x78d5('0x41')]['length']?_0x16b81f[_0x78d5('0x41')]:_0x571f32['model'];if(!_0x3d6a60[_0x78d5('0x3e')][_0x78d5('0x42')](_0x78d5('0x43'))){_0x16b81f[_0x78d5('0x2d')]=qs['limit'](_0x3d6a60['query']['limit']);_0x16b81f[_0x78d5('0x2b')]=qs[_0x78d5('0x2b')](_0x3d6a60[_0x78d5('0x3e')][_0x78d5('0x2b')]);}_0x16b81f[_0x78d5('0x44')]=qs['sort'](_0x3d6a60['query']['sort']);_0x16b81f[_0x78d5('0x45')]=qs[_0x78d5('0x46')](_[_0x78d5('0x47')](_0x3d6a60['query'],_0x571f32[_0x78d5('0x46')]),_0x448aaa);if(_0x3d6a60['query'][_0x78d5('0x48')]){_0x16b81f[_0x78d5('0x45')]=_['merge'](_0x16b81f[_0x78d5('0x45')],{'$or':_[_0x78d5('0x37')](_0x448aaa,function(_0x5931a2){if(_0x5931a2['type']!==_0x78d5('0x49')){var _0xbacb5f={};_0xbacb5f[_0x5931a2[_0x78d5('0x35')]]={'$like':'%'+_0x3d6a60[_0x78d5('0x3e')]['filter']+'%'};return _0xbacb5f;}})});}_0x16b81f=_[_0x78d5('0x4a')]({},_0x16b81f,_0x3d6a60[_0x78d5('0x4b')]);var _0x23762a={'where':_0x16b81f[_0x78d5('0x45')]};return db[_0x78d5('0x38')][_0x78d5('0x2e')](_0x23762a)[_0x78d5('0x1e')](function(_0x1adfe6){_0x30a4ad[_0x78d5('0x2e')]=_0x1adfe6;if(_0x3d6a60[_0x78d5('0x3e')]['includeAll']){_0x16b81f[_0x78d5('0x4c')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x16b81f);})[_0x78d5('0x1e')](function(_0x238961){_0x30a4ad[_0x78d5('0x4d')]=_0x238961;return _0x30a4ad;})[_0x78d5('0x1e')](respondWithFilteredResult(_0x43135c,_0x16b81f))['catch'](handleError(_0x43135c,null));};exports[_0x78d5('0x4e')]=function(_0xb037b8,_0x1a8194){var _0x5c1e21={'raw':![],'where':{'id':_0xb037b8[_0x78d5('0x4f')]['id']}},_0x16d214={};_0x16d214[_0x78d5('0x3d')]=_[_0x78d5('0x50')](db['Setting'][_0x78d5('0x39')]);_0x16d214['query']=_[_0x78d5('0x50')](_0xb037b8['query']);_0x16d214[_0x78d5('0x46')]=_[_0x78d5('0x3f')](_0x16d214[_0x78d5('0x3d')],_0x16d214[_0x78d5('0x3e')]);_0x5c1e21[_0x78d5('0x41')]=_[_0x78d5('0x3f')](_0x16d214[_0x78d5('0x3d')],qs[_0x78d5('0x40')](_0xb037b8['query'][_0x78d5('0x40')]));_0x5c1e21[_0x78d5('0x41')]=_0x5c1e21[_0x78d5('0x41')]['length']?_0x5c1e21[_0x78d5('0x41')]:_0x16d214[_0x78d5('0x3d')];if(_0xb037b8[_0x78d5('0x3e')][_0x78d5('0x51')]){_0x5c1e21[_0x78d5('0x4c')]=[{'all':!![]}];}_0x5c1e21=_['merge']({},_0x5c1e21,_0xb037b8[_0x78d5('0x4b')]);return db[_0x78d5('0x38')][_0x78d5('0x52')](_0x5c1e21)['then'](handleEntityNotFound(_0x1a8194,null))[_0x78d5('0x1e')](respondWithResult(_0x1a8194,null))[_0x78d5('0x27')](handleError(_0x1a8194,null));};exports[_0x78d5('0x33')]=function(_0x576bb5,_0x4041fd){if(_0x576bb5[_0x78d5('0x53')]['id']){delete _0x576bb5[_0x78d5('0x53')]['id'];}return db[_0x78d5('0x38')][_0x78d5('0x52')]({'where':{'id':_0x576bb5[_0x78d5('0x4f')]['id']}})[_0x78d5('0x1e')](handleEntityNotFound(_0x4041fd,null))[_0x78d5('0x1e')](saveUpdates(_0x576bb5[_0x78d5('0x53')],null))[_0x78d5('0x1e')](respondWithResult(_0x4041fd,null))[_0x78d5('0x27')](handleError(_0x4041fd,null));};exports['addLogo']=function(_0x550245,_0x506240,_0x517526){if(_0x550245[_0x78d5('0x54')]&&_0x550245['file'][_0x78d5('0x55')]){_0x550245[_0x78d5('0x53')]['logo']=_0x550245[_0x78d5('0x54')][_0x78d5('0x55')];}return db['Setting'][_0x78d5('0x52')]({'where':{'id':_0x550245[_0x78d5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x506240,null))[_0x78d5('0x1e')](saveUpdates(_0x550245[_0x78d5('0x53')],null))[_0x78d5('0x1e')](respondWithResult(_0x506240,null))[_0x78d5('0x27')](handleError(_0x506240,null));};exports[_0x78d5('0x56')]=function(_0x327d60,_0x24217d,_0x111ae4){if(_0x327d60[_0x78d5('0x54')]&&_0x327d60[_0x78d5('0x54')]['filename']){_0x327d60[_0x78d5('0x53')]['loginLogo']=_0x327d60[_0x78d5('0x54')][_0x78d5('0x55')];}return db[_0x78d5('0x38')][_0x78d5('0x52')]({'where':{'id':_0x327d60[_0x78d5('0x4f')]['id']}})[_0x78d5('0x1e')](handleEntityNotFound(_0x24217d,null))[_0x78d5('0x1e')](saveUpdates(_0x327d60['body'],null))[_0x78d5('0x1e')](respondWithResult(_0x24217d,null))[_0x78d5('0x27')](handleError(_0x24217d,null));};var utilLicense=require(_0x78d5('0x18'));exports['getLogo']=function(_0x5b892d,_0x33c556,_0x3330d3){var _0x2946ee='server/files/images/logos';var _0xea0561={'custom':![]};return utilLicense['getLicense']()[_0x78d5('0x1e')](function(_0x1f3b01){if(_0x1f3b01){_0xea0561=_0x1f3b01;}return db[_0x78d5('0x38')][_0x78d5('0x52')]({'where':{'id':_0x5b892d[_0x78d5('0x4f')]['id']},'attributes':[_0x78d5('0x57'),_0x78d5('0x58'),'preferred',_0x78d5('0x59'),'defaultLogo',_0x78d5('0x5a'),_0x78d5('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x78d5('0x1e')](handleEntityNotFound(_0x33c556,null))[_0x78d5('0x1e')](function(_0x19953c){if(_0x19953c){var _0x356aad=_0x19953c[_0x78d5('0x57')]&&fs[_0x78d5('0x5c')](path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x2946ee,_[_0x78d5('0x5f')](_0x19953c['logo'])))?path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x2946ee,_[_0x78d5('0x5f')](_0x19953c['logo'])):path[_0x78d5('0x5d')](config['root'],_0x2946ee,_[_0x78d5('0x5f')](_0x78d5('0x60')));var _0x389a6d=_0x78d5('0x61')+_['upperFirst'](_0x78d5('0x57'));if(_0x19953c[_0x389a6d]||!_0xea0561[_0x78d5('0x62')]){_0x356aad=path['join'](config[_0x78d5('0x5e')],_0x2946ee,_[_0x78d5('0x5f')](_0x78d5('0x60')));}if(!fs['existsSync'](_0x356aad)){throw new db[(_0x78d5('0x63'))][(_0x78d5('0x64'))](_['upperFirst'](_0x78d5('0x57'))+'\x20not\x20found');}return _0x33c556[_0x78d5('0x65')](_0x356aad);}})[_0x78d5('0x27')](handleError(_0x33c556,null));};var utilLicense=require('../../config/license/util');exports[_0x78d5('0x66')]=function(_0x315e0c,_0x3c0528,_0x94db21){var _0x183afe='server/files/images/logos';var _0x49546f={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xba5dc3){if(_0xba5dc3){_0x49546f=_0xba5dc3;}return db[_0x78d5('0x38')][_0x78d5('0x52')]({'where':{'id':_0x315e0c['params']['id']},'attributes':[_0x78d5('0x57'),_0x78d5('0x58'),'preferred',_0x78d5('0x59'),_0x78d5('0x67'),_0x78d5('0x5a'),_0x78d5('0x5b'),_0x78d5('0x68')],'raw':!![]});})[_0x78d5('0x1e')](handleEntityNotFound(_0x3c0528,null))[_0x78d5('0x1e')](function(_0x2aa03d){if(_0x2aa03d){var _0x1a22c2=_0x2aa03d[_0x78d5('0x58')]&&fs[_0x78d5('0x5c')](path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x183afe,_[_0x78d5('0x5f')](_0x2aa03d['loginLogo'])))?path[_0x78d5('0x5d')](config['root'],_0x183afe,_[_0x78d5('0x5f')](_0x2aa03d['loginLogo'])):path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x183afe,_[_0x78d5('0x5f')]('default_loginLogo.svg'));var _0x51b225=_0x78d5('0x61')+_[_0x78d5('0x69')](_0x78d5('0x58'));if(_0x2aa03d[_0x51b225]||!_0x49546f[_0x78d5('0x62')]){_0x1a22c2=path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x183afe,_['toLower']('default_loginLogo.svg'));}if(!fs[_0x78d5('0x5c')](_0x1a22c2)){throw new db[(_0x78d5('0x63'))][(_0x78d5('0x64'))](_[_0x78d5('0x69')](_0x78d5('0x58'))+'\x20not\x20found');}return _0x3c0528[_0x78d5('0x65')](_0x1a22c2);}})['catch'](handleError(_0x3c0528,null));};exports[_0x78d5('0x6a')]=function(_0x292017,_0x52a1a0){return db[_0x78d5('0x38')][_0x78d5('0x52')]({'where':{'id':_0x292017[_0x78d5('0x4f')]['id']},'attributes':[_0x78d5('0x6b')]})[_0x78d5('0x1e')](respondWithResult(_0x52a1a0,null))[_0x78d5('0x27')](handleError(_0x52a1a0,null));};exports[_0x78d5('0x6c')]=function(_0x2229b7,_0x2a7f93,_0x170ebb){if(_0x2229b7[_0x78d5('0x54')]&&_0x2229b7[_0x78d5('0x54')][_0x78d5('0x55')]){_0x2229b7[_0x78d5('0x53')]['preferred']=_0x2229b7[_0x78d5('0x54')]['filename'];}return db[_0x78d5('0x38')][_0x78d5('0x52')]({'where':{'id':_0x2229b7[_0x78d5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2a7f93,null))[_0x78d5('0x1e')](saveUpdates(_0x2229b7['body'],null))[_0x78d5('0x1e')](respondWithResult(_0x2a7f93,null))['catch'](handleError(_0x2a7f93,null));};var utilLicense=require(_0x78d5('0x18'));exports[_0x78d5('0x6d')]=function(_0x42e40f,_0x1709c2,_0x3ea1b4){var _0x12d422=_0x78d5('0x6e');var _0x4a0891={'custom':![]};return utilLicense[_0x78d5('0x6f')]()[_0x78d5('0x1e')](function(_0x126fd3){if(_0x126fd3){_0x4a0891=_0x126fd3;}return db['Setting'][_0x78d5('0x52')]({'where':{'id':_0x42e40f[_0x78d5('0x4f')]['id']},'attributes':[_0x78d5('0x57'),_0x78d5('0x58'),'preferred','favicon',_0x78d5('0x67'),_0x78d5('0x5a'),_0x78d5('0x5b'),_0x78d5('0x68')],'raw':!![]});})[_0x78d5('0x1e')](handleEntityNotFound(_0x1709c2,null))[_0x78d5('0x1e')](function(_0x106855){if(_0x106855){var _0x50a6ef=_0x106855[_0x78d5('0x70')]&&fs[_0x78d5('0x5c')](path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x12d422,_[_0x78d5('0x5f')](_0x106855[_0x78d5('0x70')])))?path[_0x78d5('0x5d')](config['root'],_0x12d422,_[_0x78d5('0x5f')](_0x106855[_0x78d5('0x70')])):path['join'](config['root'],_0x12d422,_[_0x78d5('0x5f')]('default_preferred.png'));var _0x117212='default'+_['upperFirst']('preferred');if(_0x106855[_0x117212]||!_0x4a0891[_0x78d5('0x62')]||!_0x4a0891[_0x78d5('0x70')]){_0x50a6ef=path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x12d422,_[_0x78d5('0x5f')](_0x78d5('0x71')));}if(!fs[_0x78d5('0x5c')](_0x50a6ef)){throw new db[(_0x78d5('0x63'))][(_0x78d5('0x64'))](_[_0x78d5('0x69')](_0x78d5('0x70'))+'\x20not\x20found');}return _0x1709c2['download'](_0x50a6ef);}})[_0x78d5('0x27')](handleError(_0x1709c2,null));};exports[_0x78d5('0x72')]=function(_0x506f29,_0x4bf511,_0x514296){if(_0x506f29['file']&&_0x506f29['file'][_0x78d5('0x55')]){_0x506f29[_0x78d5('0x53')]['favicon']=_0x506f29[_0x78d5('0x54')]['filename'];}return db[_0x78d5('0x38')][_0x78d5('0x52')]({'where':{'id':_0x506f29['params']['id']}})[_0x78d5('0x1e')](handleEntityNotFound(_0x4bf511,null))[_0x78d5('0x1e')](saveUpdates(_0x506f29['body'],null))['then'](respondWithResult(_0x4bf511,null))['catch'](handleError(_0x4bf511,null));};var utilLicense=require(_0x78d5('0x18'));exports['getFavicon']=function(_0x27059e,_0x3816f6,_0x5694db){var _0x30249b=_0x78d5('0x6e');var _0x3cbf86={'custom':![]};return utilLicense[_0x78d5('0x6f')]()[_0x78d5('0x1e')](function(_0x24bc14){if(_0x24bc14){_0x3cbf86=_0x24bc14;}return db['Setting']['find']({'where':{'id':_0x27059e['params']['id']},'attributes':[_0x78d5('0x57'),'loginLogo',_0x78d5('0x70'),_0x78d5('0x59'),_0x78d5('0x67'),'defaultLoginLogo',_0x78d5('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x78d5('0x1e')](handleEntityNotFound(_0x3816f6,null))[_0x78d5('0x1e')](function(_0x424f8c){if(_0x424f8c){var _0x4e182f=_0x424f8c[_0x78d5('0x59')]&&fs[_0x78d5('0x5c')](path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x30249b,_[_0x78d5('0x5f')](_0x424f8c['favicon'])))?path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x30249b,_[_0x78d5('0x5f')](_0x424f8c[_0x78d5('0x59')])):path[_0x78d5('0x5d')](config[_0x78d5('0x5e')],_0x30249b,_['toLower']('default_favicon.ico'));var _0x3ff077=_0x78d5('0x61')+_[_0x78d5('0x69')]('favicon');if(_0x424f8c[_0x3ff077]||!_0x3cbf86[_0x78d5('0x62')]){_0x4e182f=path[_0x78d5('0x5d')](config['root'],_0x30249b,_[_0x78d5('0x5f')]('default_favicon.ico'));}if(!fs[_0x78d5('0x5c')](_0x4e182f)){throw new db[(_0x78d5('0x63'))][(_0x78d5('0x64'))](_[_0x78d5('0x69')](_0x78d5('0x59'))+'\x20not\x20found');}return _0x3816f6[_0x78d5('0x65')](_0x4e182f);}})['catch'](handleError(_0x3816f6,null));};exports['getDate']=function(_0x52aab3,_0x1c7ff2){var _0x58a006={'offset':moment()[_0x78d5('0x73')]()};_0x58a006[_0x78d5('0x74')]=moment()[_0x78d5('0x73')](_0x58a006[_0x78d5('0x2b')])[_0x78d5('0x75')](_0x78d5('0x76'));return _0x1c7ff2['status'](0xc8)[_0x78d5('0x36')](_0x58a006);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index aa7b4ec..2ad4216 100644 --- a/server/api/setting/setting.model.js +++ b/server/api/setting/setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x3c504b,_0x437693){var _0x2e5354=function(_0x456709){while(--_0x456709){_0x3c504b['push'](_0x3c504b['shift']());}};_0x2e5354(++_0x437693);}(_0x008c,0x188));var _0xc008=function(_0x5b64a1,_0x2ec810){_0x5b64a1=_0x5b64a1-0x0;var _0x4b6f55=_0x008c[_0x5b64a1];return _0x4b6f55;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xedd9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes','exports','Setting','util'];(function(_0x6b4adf,_0x178e4f){var _0x1c1f37=function(_0x587a34){while(--_0x587a34){_0x6b4adf['push'](_0x6b4adf['shift']());}};_0x1c1f37(++_0x178e4f);}(_0xedd9,0xfc));var _0x9edd=function(_0x5a3dff,_0x20b8f5){_0x5a3dff=_0x5a3dff-0x0;var _0x48b1cf=_0xedd9[_0x5a3dff];return _0x48b1cf;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var logger=require(_0x9edd('0x1'))(_0x9edd('0x2'));var moment=require(_0x9edd('0x3'));var BPromise=require(_0x9edd('0x4'));var rp=require(_0x9edd('0x5'));var fs=require('fs');var path=require(_0x9edd('0x6'));var rimraf=require(_0x9edd('0x7'));var config=require('../../config/environment');var attributes=require(_0x9edd('0x8'));module[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return _0x268f9e['define'](_0x9edd('0xa'),attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index e2f403f..83cd803 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 _0x28be=['request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','ShowSetting','Setting','raw','options','where','attributes','include','map','model','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x28be,0xdb));var _0xe28b=function(_0x33d77f,_0x57a0cc){_0x33d77f=_0x33d77f-0x0;var _0x24132a=_0x28be[_0x33d77f];return _0x24132a;};'use strict';var _=require(_0xe28b('0x0'));var util=require('util');var moment=require(_0xe28b('0x1'));var BPromise=require('bluebird');var rs=require(_0xe28b('0x2'));var fs=require('fs');var Redis=require(_0xe28b('0x3'));var db=require(_0xe28b('0x4'))['db'];var utils=require(_0xe28b('0x5'));var logger=require(_0xe28b('0x6'))(_0xe28b('0x7'));var config=require(_0xe28b('0x8'));var jayson=require(_0xe28b('0x9'));var client=jayson[_0xe28b('0xa')][_0xe28b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c217d,_0x69e484,_0xc49d76){return new BPromise(function(_0x34975d,_0x1f169b){return client[_0xe28b('0xc')](_0x1c217d,_0xc49d76)[_0xe28b('0xd')](function(_0x4e36ba){logger['info'](_0xe28b('0xe'),_0x69e484,_0xe28b('0xf'));logger[_0xe28b('0x10')](_0xe28b('0x11'),_0x69e484,_0xe28b('0xf'),JSON[_0xe28b('0x12')](_0x4e36ba));if(_0x4e36ba[_0xe28b('0x13')]){if(_0x4e36ba[_0xe28b('0x13')][_0xe28b('0x14')]===0x1f4){logger[_0xe28b('0x13')]('Setting,\x20%s,\x20%s',_0x69e484,_0x4e36ba[_0xe28b('0x13')][_0xe28b('0x15')]);return _0x1f169b(_0x4e36ba[_0xe28b('0x13')]['message']);}logger[_0xe28b('0x13')](_0xe28b('0xe'),_0x69e484,_0x4e36ba['error'][_0xe28b('0x15')]);return _0x34975d(_0x4e36ba[_0xe28b('0x13')][_0xe28b('0x15')]);}else{logger[_0xe28b('0x16')](_0xe28b('0xe'),_0x69e484,'request\x20sent');_0x34975d(_0x4e36ba['result']['message']);}})['catch'](function(_0x36e5e1){logger[_0xe28b('0x13')]('Setting,\x20%s,\x20%s',_0x69e484,_0x36e5e1);_0x1f169b(_0x36e5e1);});});}exports[_0xe28b('0x17')]=function(_0x4f7715){var _0x32ead0=this;return new Promise(function(_0x31dda8,_0xbbd6fa){return db[_0xe28b('0x18')]['find']({'raw':_0x4f7715['options']?_0x4f7715['options'][_0xe28b('0x19')]===undefined?!![]:![]:!![],'where':_0x4f7715[_0xe28b('0x1a')]?_0x4f7715[_0xe28b('0x1a')][_0xe28b('0x1b')]||null:null,'attributes':_0x4f7715[_0xe28b('0x1a')]?_0x4f7715[_0xe28b('0x1a')][_0xe28b('0x1c')]||null:null,'include':_0x4f7715['options']?_0x4f7715[_0xe28b('0x1a')][_0xe28b('0x1d')]?_[_0xe28b('0x1e')](_0x4f7715[_0xe28b('0x1a')][_0xe28b('0x1d')],function(_0x44e8af){return{'model':db[_0x44e8af['model']],'as':_0x44e8af['as'],'attributes':_0x44e8af[_0xe28b('0x1c')],'include':_0x44e8af['include']?_[_0xe28b('0x1e')](_0x44e8af['include'],function(_0x52c876){return{'model':db[_0x52c876[_0xe28b('0x1f')]],'as':_0x52c876['as'],'attributes':_0x52c876[_0xe28b('0x1c')],'include':_0x52c876[_0xe28b('0x1d')]?_[_0xe28b('0x1e')](_0x52c876[_0xe28b('0x1d')],function(_0x261fb){return{'model':db[_0x261fb[_0xe28b('0x1f')]],'as':_0x261fb['as'],'attributes':_0x261fb[_0xe28b('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cc095){logger[_0xe28b('0x16')]('ShowSetting',_0x4f7715);logger[_0xe28b('0x10')](_0xe28b('0x17'),_0x4f7715,JSON[_0xe28b('0x12')](_0x3cc095));_0x31dda8(_0x3cc095);})[_0xe28b('0x20')](function(_0xc01c76){logger[_0xe28b('0x13')](_0xe28b('0x17'),_0xc01c76[_0xe28b('0x15')],_0x4f7715);_0xbbd6fa(_0x32ead0[_0xe28b('0x13')](0x1f4,_0xc01c76[_0xe28b('0x15')]));});});}; \ No newline at end of file +var _0x1711=['model','include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','map'];(function(_0x57bf80,_0x50034b){var _0x3aed5=function(_0x12bd9a){while(--_0x12bd9a){_0x57bf80['push'](_0x57bf80['shift']());}};_0x3aed5(++_0x50034b);}(_0x1711,0x12b));var _0x1171=function(_0x4b44d3,_0x1a46c0){_0x4b44d3=_0x4b44d3-0x0;var _0x3609b3=_0x1711[_0x4b44d3];return _0x3609b3;};'use strict';var _=require(_0x1171('0x0'));var util=require(_0x1171('0x1'));var moment=require(_0x1171('0x2'));var BPromise=require(_0x1171('0x3'));var rs=require(_0x1171('0x4'));var fs=require('fs');var Redis=require(_0x1171('0x5'));var db=require(_0x1171('0x6'))['db'];var utils=require(_0x1171('0x7'));var logger=require(_0x1171('0x8'))('rpc');var config=require(_0x1171('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1171('0xa')][_0x1171('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x119032,_0x52cea0,_0x7d442a){return new BPromise(function(_0x4625e0,_0x4aab8e){return client['request'](_0x119032,_0x7d442a)[_0x1171('0xc')](function(_0x1d0553){logger[_0x1171('0xd')](_0x1171('0xe'),_0x52cea0,_0x1171('0xf'));logger[_0x1171('0x10')]('Setting,\x20%s,\x20%s,\x20%s',_0x52cea0,'request\x20sent',JSON[_0x1171('0x11')](_0x1d0553));if(_0x1d0553[_0x1171('0x12')]){if(_0x1d0553[_0x1171('0x12')][_0x1171('0x13')]===0x1f4){logger[_0x1171('0x12')]('Setting,\x20%s,\x20%s',_0x52cea0,_0x1d0553[_0x1171('0x12')][_0x1171('0x14')]);return _0x4aab8e(_0x1d0553[_0x1171('0x12')][_0x1171('0x14')]);}logger[_0x1171('0x12')](_0x1171('0xe'),_0x52cea0,_0x1d0553[_0x1171('0x12')][_0x1171('0x14')]);return _0x4625e0(_0x1d0553[_0x1171('0x12')][_0x1171('0x14')]);}else{logger[_0x1171('0xd')](_0x1171('0xe'),_0x52cea0,'request\x20sent');_0x4625e0(_0x1d0553[_0x1171('0x15')][_0x1171('0x14')]);}})[_0x1171('0x16')](function(_0x3bbd7e){logger['error'](_0x1171('0xe'),_0x52cea0,_0x3bbd7e);_0x4aab8e(_0x3bbd7e);});});}exports[_0x1171('0x17')]=function(_0x2fadf6){var _0xfb07a=this;return new Promise(function(_0x4484b1,_0x34e239){return db[_0x1171('0x18')][_0x1171('0x19')]({'raw':_0x2fadf6[_0x1171('0x1a')]?_0x2fadf6[_0x1171('0x1a')][_0x1171('0x1b')]===undefined?!![]:![]:!![],'where':_0x2fadf6['options']?_0x2fadf6[_0x1171('0x1a')][_0x1171('0x1c')]||null:null,'attributes':_0x2fadf6[_0x1171('0x1a')]?_0x2fadf6['options'][_0x1171('0x1d')]||null:null,'include':_0x2fadf6[_0x1171('0x1a')]?_0x2fadf6[_0x1171('0x1a')]['include']?_[_0x1171('0x1e')](_0x2fadf6[_0x1171('0x1a')]['include'],function(_0x4cfb7a){return{'model':db[_0x4cfb7a[_0x1171('0x1f')]],'as':_0x4cfb7a['as'],'attributes':_0x4cfb7a[_0x1171('0x1d')],'include':_0x4cfb7a['include']?_[_0x1171('0x1e')](_0x4cfb7a['include'],function(_0x4c0618){return{'model':db[_0x4c0618[_0x1171('0x1f')]],'as':_0x4c0618['as'],'attributes':_0x4c0618[_0x1171('0x1d')],'include':_0x4c0618[_0x1171('0x20')]?_[_0x1171('0x1e')](_0x4c0618[_0x1171('0x20')],function(_0x15627e){return{'model':db[_0x15627e[_0x1171('0x1f')]],'as':_0x15627e['as'],'attributes':_0x15627e[_0x1171('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1171('0xc')](function(_0xee03c2){logger[_0x1171('0xd')](_0x1171('0x17'),_0x2fadf6);logger[_0x1171('0x10')](_0x1171('0x17'),_0x2fadf6,JSON['stringify'](_0xee03c2));_0x4484b1(_0xee03c2);})['catch'](function(_0x3c6c70){logger[_0x1171('0x12')](_0x1171('0x17'),_0x3c6c70[_0x1171('0x14')],_0x2fadf6);_0x34e239(_0xfb07a[_0x1171('0x12')](0x1f4,_0x3c6c70[_0x1171('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index f2025b6..44a9d45 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 _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1d0fa7,_0x1ad70f){var _0x5b2d91=function(_0x4ff922){while(--_0x4ff922){_0x1d0fa7['push'](_0x1d0fa7['shift']());}};_0x5b2d91(++_0x1ad70f);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file +var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x1e1dea,_0x16fe92){var _0x360ed7=function(_0x3fd6d5){while(--_0x3fd6d5){_0x1e1dea['push'](_0x1e1dea['shift']());}};_0x360ed7(++_0x16fe92);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 1304510..12aee34 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 _0xbaca=['setDataValue','sequelize','randomstring','exports','STRING','name','generate','connectel','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x5c72ee,_0x5a8bf8){var _0x231876=function(_0x955276){while(--_0x955276){_0x5c72ee['push'](_0x5c72ee['shift']());}};_0x231876(++_0x5a8bf8);}(_0xbaca,0x7f));var _0xabac=function(_0x49c68e,_0x1c1673){_0x49c68e=_0x49c68e-0x0;var _0x33032b=_0xbaca[_0x49c68e];return _0x33032b;};'use strict';var Sequelize=require(_0xabac('0x0'));var rs=require(_0xabac('0x1'));module[_0xabac('0x2')]={'name':{'type':Sequelize[_0xabac('0x3')],'unique':_0xabac('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xabac('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xabac('0x5')]();}},'phone':{'type':Sequelize[_0xabac('0x3')]},'type':{'type':Sequelize['ENUM']('twilio','skebby',_0xabac('0x6'),_0xabac('0x7'),_0xabac('0x8'),_0xabac('0x9'),_0xabac('0xa'),_0xabac('0xb'),_0xabac('0xc'),_0xabac('0xd'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xabac('0x3')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xabac('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0xabac('0x3')]},'password':{'type':Sequelize[_0xabac('0x3')]},'apiKey':{'type':Sequelize[_0xabac('0x3')]},'applicationId':{'type':Sequelize[_0xabac('0x3')]},'accountId':{'type':Sequelize[_0xabac('0x3')]},'senderString':{'type':Sequelize[_0xabac('0x3')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0xabac('0x3')]},'notificationTemplate':{'type':Sequelize[_0xabac('0xf')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xabac('0x10')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xabac('0x10')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xabac('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xabac('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xabac('0x10')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xabac('0x11')],'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[_0xabac('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xabac('0x12')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xabac('0x13'),'set':function(_0x24a83c){if(!_0x24a83c)this[_0xabac('0x14')]('mandatoryDispositionPauseId',null);this[_0xabac('0x14')]('mandatoryDisposition',_0x24a83c);}}}; \ No newline at end of file +var _0x5649=['generate','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name'];(function(_0x3a70e0,_0x3df982){var _0x5ad262=function(_0x43cd67){while(--_0x43cd67){_0x3a70e0['push'](_0x3a70e0['shift']());}};_0x5ad262(++_0x3df982);}(_0x5649,0xcc));var _0x9564=function(_0x564b7f,_0x162734){_0x564b7f=_0x564b7f-0x0;var _0x194ae6=_0x5649[_0x564b7f];return _0x194ae6;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x9564('0x0')]={'name':{'type':Sequelize[_0x9564('0x1')],'unique':_0x9564('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x9564('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x9564('0x1')],'defaultValue':function(){return rs[_0x9564('0x3')]();}},'phone':{'type':Sequelize[_0x9564('0x1')]},'type':{'type':Sequelize[_0x9564('0x4')](_0x9564('0x5'),_0x9564('0x6'),_0x9564('0x7'),_0x9564('0x8'),_0x9564('0x9'),_0x9564('0xa'),'bandwidth',_0x9564('0xb'),_0x9564('0xc'),_0x9564('0xd'))},'accountSid':{'type':Sequelize[_0x9564('0x1')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x9564('0x1')]},'smsMethod':{'type':Sequelize[_0x9564('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x9564('0x1')]},'password':{'type':Sequelize[_0x9564('0x1')]},'apiKey':{'type':Sequelize[_0x9564('0x1')]},'applicationId':{'type':Sequelize[_0x9564('0x1')]},'accountId':{'type':Sequelize[_0x9564('0x1')]},'senderString':{'type':Sequelize[_0x9564('0x1')]},'deliveryReport':{'type':Sequelize[_0x9564('0xe')],'defaultValue':![]},'description':{'type':Sequelize[_0x9564('0x1')]},'notificationTemplate':{'type':Sequelize[_0x9564('0xf')],'defaultValue':function(){return _0x9564('0x10');}},'notificationSound':{'type':Sequelize[_0x9564('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9564('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9564('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9564('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9564('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x9564('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9564('0x11')],'comment':_0x9564('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x9564('0xe')],'defaultValue':![],'comment':_0x9564('0x13'),'set':function(_0x215801){if(!_0x215801)this[_0x9564('0x14')](_0x9564('0x15'),null);this[_0x9564('0x14')](_0x9564('0x16'),_0x215801);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index fe74e8a..ff1bfd5 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 _0x913a=['undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','send','index','Pause','map','SmsAccount','type','key','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','mandatoryDispositionPause','rawAttributes','options','find','create','body','role','user','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','hasOwnProperty','removeDispositions','CannedAnswer','getAnswers','removeAnswers','ids','sms','Applications','account','orderBy','priority','asc','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','messageId','skebby','sender','text','clicksend','plivo','Text','MessageUUID','csc','originatingAddress','clickatell','replyMessageId','bandwidth','intelepeer','refid','isNil','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','list','omit','contact','SmsInteraction','spread','interaction','created','autoclose','applications','close','*,*,*,*','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','SmsApplication','bulkCreate','findAndCountAll','finally','getApplications','Contact','Owner','fullname','Tags','color','tag','CmList','List','out','dataValues','Messages','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','connectel','requestid','statusInt','message_id','status_code','infobip','results','groupName','DELIVERED','redif','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','sendStatus','status','json','offset'];(function(_0x1a8fc6,_0xe885d4){var _0x12acd6=function(_0x437f7d){while(--_0x437f7d){_0x1a8fc6['push'](_0x1a8fc6['shift']());}};_0x12acd6(++_0xe885d4);}(_0x913a,0x19c));var _0xa913=function(_0x1b14a1,_0x26e73e){_0x1b14a1=_0x1b14a1-0x0;var _0x33943d=_0x913a[_0x1b14a1];return _0x33943d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa913('0x0'));var zipdir=require(_0xa913('0x1'));var jsonpatch=require(_0xa913('0x2'));var rp=require(_0xa913('0x3'));var moment=require(_0xa913('0x4'));var BPromise=require(_0xa913('0x5'));var Mustache=require(_0xa913('0x6'));var util=require(_0xa913('0x7'));var path=require(_0xa913('0x8'));var sox=require(_0xa913('0x9'));var csv=require(_0xa913('0xa'));var ejs=require(_0xa913('0xb'));var fs=require('fs');var fs_extra=require(_0xa913('0xc'));var _=require(_0xa913('0xd'));var squel=require(_0xa913('0xe'));var crypto=require(_0xa913('0xf'));var jsforce=require(_0xa913('0x10'));var deskjs=require(_0xa913('0x11'));var toCsv=require('to-csv');var querystring=require(_0xa913('0x12'));var Papa=require(_0xa913('0x13'));var Redis=require(_0xa913('0x14'));var authService=require(_0xa913('0x15'));var qs=require(_0xa913('0x16'));var as=require(_0xa913('0x17'));var hardwareService=require(_0xa913('0x18'));var logger=require(_0xa913('0x19'))('api');var utils=require(_0xa913('0x1a'));var config=require(_0xa913('0x1b'));var licenseUtil=require(_0xa913('0x1c'));var db=require(_0xa913('0x1d'))['db'];config[_0xa913('0x1e')]=_[_0xa913('0x1f')](config[_0xa913('0x1e')],{'host':'localhost','port':0x18eb});var socket=require(_0xa913('0x20'))(new Redis(config[_0xa913('0x1e')]));require(_0xa913('0x21'))[_0xa913('0x22')](socket);var jayson=require(_0xa913('0x23'));var client=jayson[_0xa913('0x24')][_0xa913('0x25')]({'port':0x232c});function respondWithRpcPromise(_0x28b889,_0x30757b,_0x149a25,_0x879d1b){return new BPromise(function(_0x347e6d,_0x4c3410){var _0x5957a5=_0x879d1b||client;return _0x5957a5['request'](_0x28b889,_0x149a25)[_0xa913('0x26')](function(_0x2a383d){logger['info'](_0xa913('0x27'),_0x30757b,_0xa913('0x28'));logger[_0xa913('0x29')](_0xa913('0x2a'),_0x30757b,'request\x20sent',JSON['stringify'](_0x2a383d));if(_0x2a383d['error']){if(_0x2a383d[_0xa913('0x2b')][_0xa913('0x2c')]===0x1f4){logger['error'](_0xa913('0x27'),_0x30757b,_0x2a383d[_0xa913('0x2b')][_0xa913('0x2d')]);return _0x4c3410(_0x2a383d[_0xa913('0x2b')][_0xa913('0x2d')]);}logger[_0xa913('0x2b')](_0xa913('0x27'),_0x30757b,_0x2a383d[_0xa913('0x2b')][_0xa913('0x2d')]);return _0x347e6d(_0x2a383d[_0xa913('0x2b')][_0xa913('0x2d')]);}else{logger[_0xa913('0x2e')](_0xa913('0x27'),_0x30757b,_0xa913('0x28'));_0x347e6d(_0x2a383d['result'][_0xa913('0x2d')]);}})[_0xa913('0x2f')](function(_0xce48af){logger[_0xa913('0x2b')](_0xa913('0x27'),_0x30757b,_0xce48af);_0x4c3410(_0xce48af);});});}function respondWithStatusCode(_0x5a0cf3,_0x47eca6){_0x47eca6=_0x47eca6||0xcc;return function(_0x41093c){if(_0x41093c){return _0x5a0cf3[_0xa913('0x30')](_0x47eca6);}return _0x5a0cf3[_0xa913('0x31')](_0x47eca6)['end']();};}function respondWithResult(_0x5fd55a,_0x47b4d0){_0x47b4d0=_0x47b4d0||0xc8;return function(_0x2d1377){if(_0x2d1377){return _0x5fd55a['status'](_0x47b4d0)[_0xa913('0x32')](_0x2d1377);}};}function respondWithFilteredResult(_0x5451ef,_0x11290b){return function(_0x3d3d02){if(_0x3d3d02){var _0x93b2ee=typeof _0x11290b[_0xa913('0x33')]===_0xa913('0x34')&&typeof _0x11290b[_0xa913('0x35')]===_0xa913('0x34');var _0x219665=_0x3d3d02[_0xa913('0x36')];var _0x24029c=_0x93b2ee?0x0:_0x11290b[_0xa913('0x33')];var _0xbf34d2=_0x93b2ee?_0x3d3d02[_0xa913('0x36')]:_0x11290b[_0xa913('0x33')]+_0x11290b['limit'];var _0x3d4662;if(_0xbf34d2>=_0x219665){_0xbf34d2=_0x219665;_0x3d4662=0xc8;}else{_0x3d4662=0xce;}_0x5451ef['status'](_0x3d4662);return _0x5451ef[_0xa913('0x37')](_0xa913('0x38'),_0x24029c+'-'+_0xbf34d2+'/'+_0x219665)[_0xa913('0x32')](_0x3d3d02);}return null;};}function patchUpdates(_0x3b2fe2){return function(_0x438be4){try{jsonpatch[_0xa913('0x39')](_0x438be4,_0x3b2fe2,!![]);}catch(_0x1ec67d){return BPromise[_0xa913('0x3a')](_0x1ec67d);}return _0x438be4['save']();};}function saveUpdates(_0x509a86,_0x3ed015){return function(_0x53f2e5){if(_0x53f2e5){return _0x53f2e5[_0xa913('0x3b')](_0x509a86)['then'](function(_0x32e1b4){return _0x32e1b4;});}return null;};}function removeEntity(_0x336ff9,_0x42591d){return function(_0x485738){if(_0x485738){return _0x485738[_0xa913('0x3c')]()[_0xa913('0x26')](function(){var _0x34ffc6=_0x485738[_0xa913('0x3d')]({'plain':!![]});var _0x5c6be0=_0xa913('0x3e');return db[_0xa913('0x3f')][_0xa913('0x3c')]({'where':{'type':_0x5c6be0,'resourceId':_0x34ffc6['id']}})[_0xa913('0x26')](function(){return _0x485738;});})[_0xa913('0x26')](function(){_0x336ff9['status'](0xcc)[_0xa913('0x40')]();});}};}function handleEntityNotFound(_0x12c251,_0x3e7ea9){return function(_0x48c179){if(!_0x48c179){_0x12c251[_0xa913('0x30')](0x194);}return _0x48c179;};}function handleError(_0x4b32f4,_0x135660){_0x135660=_0x135660||0x1f4;return function(_0x3de18d){logger['error'](_0x3de18d[_0xa913('0x41')]);if(_0x3de18d[_0xa913('0x42')]){delete _0x3de18d['name'];}_0x4b32f4[_0xa913('0x31')](_0x135660)[_0xa913('0x43')](_0x3de18d);};}exports[_0xa913('0x44')]=function(_0x2e1d83,_0x2bff89){var _0x27779d={'include':[{'model':db[_0xa913('0x45')],'as':'mandatoryDispositionPause'}]},_0x47875f={},_0x4fd4c2={'count':0x0,'rows':[]};var _0x170222=_[_0xa913('0x46')](db[_0xa913('0x47')]['rawAttributes'],function(_0x2b0cec){return{'name':_0x2b0cec['fieldName'],'type':_0x2b0cec[_0xa913('0x48')][_0xa913('0x49')]};});_0x47875f['model']=_[_0xa913('0x46')](_0x170222,_0xa913('0x42'));_0x47875f[_0xa913('0x4a')]=_[_0xa913('0x4b')](_0x2e1d83['query']);_0x47875f['filters']=_[_0xa913('0x4c')](_0x47875f['model'],_0x47875f[_0xa913('0x4a')]);_0x27779d['attributes']=_[_0xa913('0x4c')](_0x47875f[_0xa913('0x4d')],qs[_0xa913('0x4e')](_0x2e1d83[_0xa913('0x4a')][_0xa913('0x4e')]));_0x27779d[_0xa913('0x4f')]=_0x27779d['attributes'][_0xa913('0x50')]?_0x27779d[_0xa913('0x4f')]:_0x47875f[_0xa913('0x4d')];if(!_0x2e1d83[_0xa913('0x4a')]['hasOwnProperty'](_0xa913('0x51'))){_0x27779d[_0xa913('0x35')]=qs[_0xa913('0x35')](_0x2e1d83[_0xa913('0x4a')][_0xa913('0x35')]);_0x27779d[_0xa913('0x33')]=qs[_0xa913('0x33')](_0x2e1d83[_0xa913('0x4a')][_0xa913('0x33')]);}_0x27779d[_0xa913('0x52')]=qs['sort'](_0x2e1d83[_0xa913('0x4a')][_0xa913('0x53')]);_0x27779d[_0xa913('0x54')]=qs[_0xa913('0x55')](_[_0xa913('0x56')](_0x2e1d83[_0xa913('0x4a')],_0x47875f[_0xa913('0x55')]),_0x170222);if(_0x2e1d83[_0xa913('0x4a')]['filter']){_0x27779d[_0xa913('0x54')]=_[_0xa913('0x57')](_0x27779d[_0xa913('0x54')],{'$or':_['map'](_0x170222,function(_0x20fbeb){if(_0x20fbeb[_0xa913('0x48')]!==_0xa913('0x58')){var _0x27fdbe={};_0x27fdbe[_0x20fbeb[_0xa913('0x42')]]={'$like':'%'+_0x2e1d83[_0xa913('0x4a')][_0xa913('0x59')]+'%'};return _0x27fdbe;}})});}_0x27779d=_['merge']({},_0x27779d,_0x2e1d83['options']);var _0x4b7b61={'where':_0x27779d[_0xa913('0x54')]};return db[_0xa913('0x47')][_0xa913('0x36')](_0x4b7b61)['then'](function(_0x2f6607){_0x4fd4c2[_0xa913('0x36')]=_0x2f6607;if(_0x2e1d83['query'][_0xa913('0x5a')]){_0x27779d[_0xa913('0x5b')]=[{'all':!![]}];}return db[_0xa913('0x47')][_0xa913('0x5c')](_0x27779d);})['then'](function(_0x173a38){_0x4fd4c2[_0xa913('0x5d')]=_0x173a38;return _0x4fd4c2;})[_0xa913('0x26')](respondWithFilteredResult(_0x2bff89,_0x27779d))[_0xa913('0x2f')](handleError(_0x2bff89,null));};exports[_0xa913('0x5e')]=function(_0x295c40,_0x5726cb){var _0x2b5455={'raw':![],'where':{'id':_0x295c40[_0xa913('0x5f')]['id']},'include':[{'model':db[_0xa913('0x45')],'as':_0xa913('0x60')}]},_0x2580e5={};_0x2580e5[_0xa913('0x4d')]=_[_0xa913('0x4b')](db['SmsAccount'][_0xa913('0x61')]);_0x2580e5[_0xa913('0x4a')]=_[_0xa913('0x4b')](_0x295c40[_0xa913('0x4a')]);_0x2580e5[_0xa913('0x55')]=_[_0xa913('0x4c')](_0x2580e5[_0xa913('0x4d')],_0x2580e5[_0xa913('0x4a')]);_0x2b5455[_0xa913('0x4f')]=_[_0xa913('0x4c')](_0x2580e5[_0xa913('0x4d')],qs[_0xa913('0x4e')](_0x295c40[_0xa913('0x4a')]['fields']));_0x2b5455[_0xa913('0x4f')]=_0x2b5455['attributes'][_0xa913('0x50')]?_0x2b5455[_0xa913('0x4f')]:_0x2580e5['model'];if(_0x295c40[_0xa913('0x4a')][_0xa913('0x5a')]){_0x2b5455['include']=[{'all':!![]}];}_0x2b5455=_[_0xa913('0x57')]({},_0x2b5455,_0x295c40[_0xa913('0x62')]);return db[_0xa913('0x47')][_0xa913('0x63')](_0x2b5455)[_0xa913('0x26')](handleEntityNotFound(_0x5726cb,null))[_0xa913('0x26')](respondWithResult(_0x5726cb,null))[_0xa913('0x2f')](handleError(_0x5726cb,null));};exports[_0xa913('0x64')]=function(_0x217817,_0x1a66d1){return db[_0xa913('0x47')]['create'](_0x217817[_0xa913('0x65')],{})['then'](function(_0x2f8718){var _0x55e379=_0x217817['user'][_0xa913('0x3d')]({'plain':!![]});if(!_0x55e379)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55e379[_0xa913('0x66')]===_0xa913('0x67')){var _0x47df7a=_0x2f8718['get']({'plain':!![]});var _0x3bbbb1=_0xa913('0x3e');return db['UserProfileSection'][_0xa913('0x63')]({'where':{'name':_0x3bbbb1,'userProfileId':_0x55e379[_0xa913('0x68')]},'raw':!![]})[_0xa913('0x26')](function(_0x5465e5){if(_0x5465e5&&_0x5465e5[_0xa913('0x69')]===0x0){return db[_0xa913('0x3f')][_0xa913('0x64')]({'name':_0x47df7a[_0xa913('0x42')],'resourceId':_0x47df7a['id'],'type':_0x5465e5[_0xa913('0x42')],'sectionId':_0x5465e5['id']},{})[_0xa913('0x26')](function(){return _0x2f8718;});}else{return _0x2f8718;}})[_0xa913('0x2f')](function(_0xfab294){logger[_0xa913('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xfab294);throw _0xfab294;});}return _0x2f8718;})[_0xa913('0x26')](respondWithResult(_0x1a66d1,0xc9))[_0xa913('0x2f')](handleError(_0x1a66d1,null));};exports[_0xa913('0x3b')]=function(_0x514092,_0x312dbb){if(_0x514092['body']['id']){delete _0x514092[_0xa913('0x65')]['id'];}return db[_0xa913('0x47')]['find']({'where':{'id':_0x514092[_0xa913('0x5f')]['id']},'include':[{'model':db[_0xa913('0x45')],'as':_0xa913('0x60')}]})['then'](handleEntityNotFound(_0x312dbb,null))['then'](saveUpdates(_0x514092[_0xa913('0x65')],null))[_0xa913('0x26')](respondWithResult(_0x312dbb,null))[_0xa913('0x2f')](handleError(_0x312dbb,null));};exports[_0xa913('0x3c')]=function(_0x443ce9,_0x300475){return db[_0xa913('0x47')][_0xa913('0x63')]({'where':{'id':_0x443ce9[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x300475,null))[_0xa913('0x26')](removeEntity(_0x300475,null))[_0xa913('0x2f')](handleError(_0x300475,null));};exports[_0xa913('0x6a')]=function(_0x4da73b,_0x28245){return db[_0xa913('0x47')][_0xa913('0x6a')]()['then'](respondWithResult(_0x28245,null))['catch'](handleError(_0x28245,null));};exports[_0xa913('0x6b')]=function(_0x2cfcf9,_0x202241,_0xe57e2b){if(_0x2cfcf9[_0xa913('0x65')]['id']){delete _0x2cfcf9['body']['id'];}return db[_0xa913('0x47')][_0xa913('0x63')]({'where':{'id':_0x2cfcf9['params']['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x202241,null))[_0xa913('0x26')](function(_0x31e663){if(_0x31e663){_0x2cfcf9[_0xa913('0x65')][_0xa913('0x6c')]=_0x31e663['id'];return db[_0xa913('0x6d')]['create'](_0x2cfcf9['body']);}})[_0xa913('0x26')](respondWithResult(_0x202241,null))[_0xa913('0x2f')](handleError(_0x202241,null));};exports[_0xa913('0x6e')]=function(_0x24fd74,_0x76f9e,_0x5a8a8b){var _0x45c09b={'raw':![],'where':{}};var _0x3ee32f={};var _0x263021={'count':0x0,'rows':[]};return db[_0xa913('0x47')]['findOne']({'where':{'id':_0x24fd74[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x76f9e,null))['then'](function(_0x8c6e51){if(_0x8c6e51){_0x3ee32f['model']=_[_0xa913('0x4b')](db[_0xa913('0x6d')][_0xa913('0x61')]);_0x3ee32f[_0xa913('0x4a')]=_[_0xa913('0x4b')](_0x24fd74[_0xa913('0x4a')]);_0x3ee32f[_0xa913('0x55')]=_[_0xa913('0x4c')](_0x3ee32f['model'],_0x3ee32f[_0xa913('0x4a')]);_0x45c09b[_0xa913('0x4f')]=_[_0xa913('0x4c')](_0x3ee32f[_0xa913('0x4d')],qs[_0xa913('0x4e')](_0x24fd74[_0xa913('0x4a')][_0xa913('0x4e')]));_0x45c09b[_0xa913('0x4f')]=_0x45c09b[_0xa913('0x4f')]['length']?_0x45c09b[_0xa913('0x4f')]:_0x3ee32f[_0xa913('0x4d')];if(!_0x24fd74[_0xa913('0x4a')][_0xa913('0x6f')](_0xa913('0x51'))){_0x45c09b['limit']=qs[_0xa913('0x35')](_0x24fd74[_0xa913('0x4a')][_0xa913('0x35')]);_0x45c09b['offset']=qs[_0xa913('0x33')](_0x24fd74[_0xa913('0x4a')]['offset']);}_0x45c09b['order']=qs['sort'](_0x24fd74[_0xa913('0x4a')][_0xa913('0x53')]);_0x45c09b[_0xa913('0x54')]=qs[_0xa913('0x55')](_['pick'](_0x24fd74[_0xa913('0x4a')],_0x3ee32f[_0xa913('0x55')]));_0x45c09b[_0xa913('0x54')][_0xa913('0x6c')]=_0x8c6e51['id'];if(_0x24fd74[_0xa913('0x4a')][_0xa913('0x59')]){_0x45c09b[_0xa913('0x54')]=_[_0xa913('0x57')](_0x45c09b['where'],{'$or':_[_0xa913('0x46')](_0x45c09b['attributes'],function(_0x568871){var _0x4da380={};_0x4da380[_0x568871]={'$like':'%'+_0x24fd74[_0xa913('0x4a')]['filter']+'%'};return _0x4da380;})});}_0x45c09b=_[_0xa913('0x57')]({},_0x45c09b,_0x24fd74[_0xa913('0x62')]);return db[_0xa913('0x6d')][_0xa913('0x36')]({'where':_0x45c09b[_0xa913('0x54')]})[_0xa913('0x26')](function(_0x1da1d9){_0x263021[_0xa913('0x36')]=_0x1da1d9;if(_0x24fd74[_0xa913('0x4a')][_0xa913('0x5a')]){_0x45c09b['include']=[{'all':!![]}];}return db['Disposition'][_0xa913('0x5c')](_0x45c09b);})[_0xa913('0x26')](function(_0x28774f){_0x263021[_0xa913('0x5d')]=_0x28774f;return _0x263021;});}})[_0xa913('0x26')](respondWithFilteredResult(_0x76f9e,_0x45c09b))[_0xa913('0x2f')](handleError(_0x76f9e,null));};exports[_0xa913('0x70')]=function(_0x4ee9ff,_0x28e456,_0x9a67a3){return db[_0xa913('0x47')]['find']({'where':{'id':_0x4ee9ff[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x28e456,null))[_0xa913('0x26')](function(_0x5f233c){if(_0x5f233c){return _0x5f233c[_0xa913('0x70')](_0x4ee9ff[_0xa913('0x4a')]['ids']);}})[_0xa913('0x26')](respondWithStatusCode(_0x28e456,null))[_0xa913('0x2f')](handleError(_0x28e456,null));};exports['addAnswer']=function(_0x35e5a9,_0x179aa5,_0x2c17cd){if(_0x35e5a9['body']['id']){delete _0x35e5a9[_0xa913('0x65')]['id'];}return db[_0xa913('0x47')][_0xa913('0x63')]({'where':{'id':_0x35e5a9[_0xa913('0x5f')]['id']}})['then'](handleEntityNotFound(_0x179aa5,null))[_0xa913('0x26')](function(_0x583a65){if(_0x583a65){_0x35e5a9['body']['SmsAccountId']=_0x583a65['id'];return db[_0xa913('0x71')][_0xa913('0x64')](_0x35e5a9[_0xa913('0x65')]);}})[_0xa913('0x26')](respondWithResult(_0x179aa5,null))[_0xa913('0x2f')](handleError(_0x179aa5,null));};exports[_0xa913('0x72')]=function(_0x55c94c,_0x213d14,_0x3d30fe){var _0x103a2c={'raw':![],'where':{}};var _0x446a9f={};var _0x95e6dc={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x55c94c[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x213d14,null))['then'](function(_0x5bbeb0){if(_0x5bbeb0){_0x446a9f[_0xa913('0x4d')]=_[_0xa913('0x4b')](db[_0xa913('0x71')]['rawAttributes']);_0x446a9f[_0xa913('0x4a')]=_[_0xa913('0x4b')](_0x55c94c['query']);_0x446a9f[_0xa913('0x55')]=_['intersection'](_0x446a9f[_0xa913('0x4d')],_0x446a9f[_0xa913('0x4a')]);_0x103a2c[_0xa913('0x4f')]=_['intersection'](_0x446a9f[_0xa913('0x4d')],qs['fields'](_0x55c94c[_0xa913('0x4a')][_0xa913('0x4e')]));_0x103a2c[_0xa913('0x4f')]=_0x103a2c[_0xa913('0x4f')][_0xa913('0x50')]?_0x103a2c['attributes']:_0x446a9f[_0xa913('0x4d')];if(!_0x55c94c[_0xa913('0x4a')][_0xa913('0x6f')](_0xa913('0x51'))){_0x103a2c[_0xa913('0x35')]=qs[_0xa913('0x35')](_0x55c94c[_0xa913('0x4a')]['limit']);_0x103a2c[_0xa913('0x33')]=qs[_0xa913('0x33')](_0x55c94c[_0xa913('0x4a')][_0xa913('0x33')]);}_0x103a2c[_0xa913('0x52')]=qs[_0xa913('0x53')](_0x55c94c['query'][_0xa913('0x53')]);_0x103a2c[_0xa913('0x54')]=qs[_0xa913('0x55')](_['pick'](_0x55c94c['query'],_0x446a9f[_0xa913('0x55')]));_0x103a2c['where']['SmsAccountId']=_0x5bbeb0['id'];if(_0x55c94c[_0xa913('0x4a')][_0xa913('0x59')]){_0x103a2c[_0xa913('0x54')]=_[_0xa913('0x57')](_0x103a2c[_0xa913('0x54')],{'$or':_[_0xa913('0x46')](_0x103a2c[_0xa913('0x4f')],function(_0x3e4b4c){var _0x299b37={};_0x299b37[_0x3e4b4c]={'$like':'%'+_0x55c94c[_0xa913('0x4a')][_0xa913('0x59')]+'%'};return _0x299b37;})});}_0x103a2c=_[_0xa913('0x57')]({},_0x103a2c,_0x55c94c[_0xa913('0x62')]);return db['CannedAnswer']['count']({'where':_0x103a2c[_0xa913('0x54')]})['then'](function(_0x12f4cf){_0x95e6dc[_0xa913('0x36')]=_0x12f4cf;if(_0x55c94c[_0xa913('0x4a')][_0xa913('0x5a')]){_0x103a2c[_0xa913('0x5b')]=[{'all':!![]}];}return db[_0xa913('0x71')][_0xa913('0x5c')](_0x103a2c);})['then'](function(_0x1f3e97){_0x95e6dc[_0xa913('0x5d')]=_0x1f3e97;return _0x95e6dc;});}})[_0xa913('0x26')](respondWithFilteredResult(_0x213d14,_0x103a2c))[_0xa913('0x2f')](handleError(_0x213d14,null));};exports['removeAnswers']=function(_0x19dd17,_0x3d765f,_0x5a56b4){return db['SmsAccount']['find']({'where':{'id':_0x19dd17[_0xa913('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3d765f,null))[_0xa913('0x26')](function(_0x2661bc){if(_0x2661bc){return _0x2661bc[_0xa913('0x73')](_0x19dd17['query'][_0xa913('0x74')]);}})[_0xa913('0x26')](respondWithStatusCode(_0x3d765f,null))[_0xa913('0x2f')](handleError(_0x3d765f,null));};exports['notify']=function(_0x3db342,_0x22ee1b,_0x1112b5){var _0x33a5e1={'channel':_0xa913('0x75')};var _0x16650a=[];var _0xa9afa1=[];var _0x312c6b={};return db['SmsAccount']['find']({'where':{'id':_0x3db342['params']['id']},'include':[{'model':db['SmsApplication'],'as':_0xa913('0x76')}]})[_0xa913('0x26')](handleEntityNotFound(_0x22ee1b,null))[_0xa913('0x26')](function(_0x322272){_0x33a5e1[_0xa913('0x77')]=_0x322272;_0x33a5e1['applications']=_[_0xa913('0x78')](_0x322272['Applications'],[_0xa913('0x79')],[_0xa913('0x7a')]);if(_0x33a5e1['account'][_0xa913('0x76')]){delete _0x33a5e1[_0xa913('0x77')][_0xa913('0x76')];}return db[_0xa913('0x7b')]['describe']();})[_0xa913('0x26')](function(_0x1c3c7d){if(!_0x1c3c7d){throw new db['Sequelize'][(_0xa913('0x7c'))](_0xa913('0x7d'));}_0x16650a=_[_0xa913('0x7e')](_[_0xa913('0x4b')](_0x1c3c7d),[_0xa913('0x7f'),_0xa913('0x80')]);_0xa9afa1=_['difference'](_[_0xa913('0x4b')](_0x1c3c7d),['createdAt',_0xa913('0x80'),_0xa913('0x81'),'ListId']);_0x33a5e1[_0xa913('0x65')]={'mapKey':_0xa913('0x82')};if(_0x33a5e1['account'][_0xa913('0x48')]){switch(_0x33a5e1[_0xa913('0x77')][_0xa913('0x48')]){case _0xa913('0x83'):_0x33a5e1['body'][_0xa913('0x84')]=_0x3db342['body']['From'];_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')]=_0x3db342['body']['Body'];_0x33a5e1[_0xa913('0x65')][_0xa913('0x85')]=_0x3db342[_0xa913('0x65')]['MessageSid'];break;case _0xa913('0x86'):_0x33a5e1['body']['from']='+'+_0x3db342['body'][_0xa913('0x87')];_0x33a5e1['body'][_0xa913('0x65')]=_0x3db342[_0xa913('0x65')][_0xa913('0x88')];break;case'connectel':_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')]=_0x3db342[_0xa913('0x65')]['from'];_0x33a5e1[_0xa913('0x65')]['body']=_0x3db342['body'][_0xa913('0x2d')];break;case _0xa913('0x89'):_0x33a5e1[_0xa913('0x65')]['from']=_0x3db342[_0xa913('0x65')][_0xa913('0x84')];_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')]=_0x3db342[_0xa913('0x65')][_0xa913('0x65')];_0x33a5e1[_0xa913('0x65')][_0xa913('0x85')]=_0x3db342[_0xa913('0x65')]['message_id'];break;case _0xa913('0x8a'):_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')]=_0x3db342[_0xa913('0x65')]['From'];_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')]=_0x3db342[_0xa913('0x65')][_0xa913('0x8b')];_0x33a5e1[_0xa913('0x65')][_0xa913('0x85')]=_0x3db342[_0xa913('0x65')][_0xa913('0x8c')];break;case'infobip':_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')]='+'+_0x3db342['body']['results'][0x0][_0xa913('0x84')];_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')]=_0x3db342[_0xa913('0x65')]['results'][0x0][_0xa913('0x88')];_0x33a5e1[_0xa913('0x65')][_0xa913('0x85')]=_0x3db342[_0xa913('0x65')]['results'][0x0][_0xa913('0x85')];break;case _0xa913('0x8d'):_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')]=_0x3db342['body'][_0xa913('0x8e')];_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')]=_0x3db342['body']['segmentedMessage'][_0xa913('0x2d')];break;case _0xa913('0x8f'):_0x33a5e1[_0xa913('0x65')]['from']=_0x3db342[_0xa913('0x65')]['fromNumber'];_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')]=_0x3db342[_0xa913('0x65')][_0xa913('0x88')];_0x33a5e1[_0xa913('0x65')][_0xa913('0x85')]=_0x3db342[_0xa913('0x65')][_0xa913('0x90')];break;case _0xa913('0x91'):_0x33a5e1['body'][_0xa913('0x85')]=_0x3db342[_0xa913('0x65')][0x0][_0xa913('0x2d')]['id'];_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')]=_0x3db342[_0xa913('0x65')][0x0][_0xa913('0x2d')][_0xa913('0x84')];_0x33a5e1['body'][_0xa913('0x65')]=_0x3db342[_0xa913('0x65')][0x0][_0xa913('0x2d')][_0xa913('0x88')];break;case _0xa913('0x92'):_0x33a5e1['body']['from']=_0x3db342[_0xa913('0x65')]['from'];_0x33a5e1[_0xa913('0x65')]['body']=_0x3db342[_0xa913('0x65')][_0xa913('0x2d')];_0x33a5e1['body']['messageId']=_0x3db342[_0xa913('0x65')][_0xa913('0x93')];break;}}if(_0x33a5e1[_0xa913('0x65')]['id']){delete _0x33a5e1[_0xa913('0x65')]['id'];}if(_[_0xa913('0x94')](_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')])){throw new db[(_0xa913('0x95'))][(_0xa913('0x7c'))](_0xa913('0x96'));}if(_['isNil'](_0x33a5e1['body'][_0xa913('0x65')])||_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')]===''){throw new db[(_0xa913('0x95'))]['ValidationError'](_0xa913('0x97'));}if(_[_0xa913('0x94')](_0x33a5e1[_0xa913('0x65')][_0xa913('0x98')])){throw new db['Sequelize'][(_0xa913('0x7c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xa9afa1);}if(!_['includes'](_0xa9afa1,_0x33a5e1[_0xa913('0x65')][_0xa913('0x98')])){throw new db[(_0xa913('0x95'))][(_0xa913('0x7c'))](_0xa913('0x99')+_0xa9afa1);}_0x312c6b[_0x33a5e1[_0xa913('0x65')]['mapKey']]=_0x33a5e1['body'][_0xa913('0x84')];return db['CmList']['find']({'where':{'id':_0x33a5e1['account'][_0xa913('0x9a')]},'include':[{'model':db[_0xa913('0x7b')],'as':_0xa913('0x9b'),'where':_0x312c6b,'limit':0x1,'order':[[_0xa913('0x80'),_0xa913('0x9c')]]}]});})[_0xa913('0x26')](handleEntityNotFound(_0x22ee1b,null))[_0xa913('0x26')](function(_0x5923d7){if(_0x5923d7){_0x33a5e1[_0xa913('0x9d')]=_[_0xa913('0x9e')](_0x5923d7,[_0xa913('0x9b')]);if(_0x5923d7['Contacts'][_0xa913('0x50')]){return _0x5923d7['Contacts'][0x0];}var _0x270bb8=_['defaults'](_0x33a5e1[_0xa913('0x65')],{'firstName':_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')],'ListId':_0x5923d7['id']});_0x270bb8[_0x33a5e1[_0xa913('0x65')][_0xa913('0x98')]]=_0x33a5e1['body'][_0xa913('0x84')];return db['CmContact'][_0xa913('0x64')](_0x270bb8,{'fields':_0x16650a,'raw':!![]});}})[_0xa913('0x26')](handleEntityNotFound(_0x22ee1b,null))[_0xa913('0x26')](function(_0x108fb9){if(_0x108fb9){_0x33a5e1[_0xa913('0x9f')]=_0x108fb9;var _0x33d4cf={'ContactId':_0x108fb9['id'],'phone':_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')],'SmsAccountId':_0x3db342['params']['id']};var _0x1b7e2c={'ContactId':_0x108fb9['id'],'SmsAccountId':_0x3db342[_0xa913('0x5f')]['id'],'closed':![]};return db['SmsInteraction']['find']({'where':_0x1b7e2c})[_0xa913('0x26')](function(_0x3b19d8){if(_0x3b19d8){return[_0x3b19d8,![]];}return db[_0xa913('0xa0')][_0xa913('0x64')](_0x33d4cf)['then'](function(_0x35b597){return[_0x35b597,!![]];});});}})[_0xa913('0xa1')](function(_0xd9b1f6,_0x1ce384){_0x33a5e1[_0xa913('0xa2')]=_0xd9b1f6['get']({'plain':!![]});_0x33a5e1[_0xa913('0xa2')][_0xa913('0xa3')]=![];if(_0x1ce384){if(_0x33a5e1[_0xa913('0x77')][_0xa913('0xa4')]){_0x33a5e1[_0xa913('0xa5')]['push']({'id':0x0,'priority':_0x33a5e1['applications'][_0xa913('0x50')]+0x1,'app':_0xa913('0xa6'),'appdata':'unmanaged','interval':_0xa913('0xa7')});}_0x33a5e1['interaction'][_0xa913('0xa3')]=!![];}return db[_0xa913('0xa8')][_0xa913('0x64')]({'phone':_0x33a5e1[_0xa913('0x65')][_0xa913('0x84')],'messageId':_0x33a5e1[_0xa913('0x65')][_0xa913('0x85')],'body':_0x33a5e1[_0xa913('0x65')][_0xa913('0x65')],'SmsAccountId':_0x3db342[_0xa913('0x5f')]['id'],'SmsInteractionId':_0xd9b1f6['id'],'direction':'in','ContactId':_0xd9b1f6[_0xa913('0xa9')],'AttachmentId':_0x33a5e1['body'][_0xa913('0xaa')]});})[_0xa913('0x26')](function(_0x13273b){_0x33a5e1['message']=_0x13273b;if(!_0x33a5e1[_0xa913('0xa2')][_0xa913('0xab')])return;return db[_0xa913('0xac')]['find']({'attributes':['id',_0xa913('0x42')],'where':{'id':_0x33a5e1[_0xa913('0xa2')][_0xa913('0xab')]}});})[_0xa913('0x26')](function(_0x191c78){if(_0x191c78){_0x33a5e1[_0xa913('0xa5')][_0xa913('0xad')]({'id':0x0,'priority':0x0,'app':_0xa913('0xae'),'appdata':_0x191c78[_0xa913('0x42')]+','+(_0x33a5e1[_0xa913('0x77')][_0xa913('0xaf')]||0xa),'interval':_0xa913('0xa7')});}if(!_0x33a5e1[_0xa913('0xa2')][_0xa913('0xb0')])return;return db[_0xa913('0xb1')][_0xa913('0x63')]({'attributes':['id',_0xa913('0x42')],'where':{'id':_0x33a5e1[_0xa913('0xa2')]['queueId']}});})[_0xa913('0x26')](function(_0x5f2269){if(_0x5f2269){_0x33a5e1['applications']['unshift']({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x5f2269[_0xa913('0x42')]+','+(_0x33a5e1[_0xa913('0x77')]['waitForTheAssignedQueue']||0x12c),'interval':_0xa913('0xa7')});}return respondWithRpcPromise(_0xa913('0xb2'),_0xa913('0xb3'),_0x33a5e1);})[_0xa913('0x26')](function(_0x28b680){if(_0x28b680){var _0x285ec9=0xc8;var _0x2b6792=_0xa913('0xb4');logger[_0xa913('0x2e')](_0xa913('0x2a'),_0x2b6792,_0x285ec9,_0xa913('0xb5'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x2b6792,_0x285ec9,'entity\x20found',JSON['stringify'](_0x28b680));if(_0x33a5e1[_0xa913('0x77')][_0xa913('0x48')]===_0xa913('0x83')){return _0x22ee1b[_0xa913('0x31')](_0x285ec9)[_0xa913('0x37')](_0xa913('0xb6'),_0xa913('0xb7'))[_0xa913('0x43')](_0xa913('0xb8'));}else{return _0x22ee1b[_0xa913('0x31')](_0x285ec9)[_0xa913('0x32')](_0x28b680);}}})['catch'](handleError(_0x22ee1b,null));};exports[_0xa913('0xb9')]=function(_0x3aff79,_0xe8d9a4){var _0x5d8076=_0x3aff79['params']['id'];var _0x2ee360=_0x3aff79['body'];var _0x1779aa=0xc8;var _0x3a6c6e=null;return db[_0xa913('0xba')][_0xa913('0xbb')]({'isolationLevel':db[_0xa913('0xba')]['Transaction'][_0xa913('0xbc')][_0xa913('0xbd')]},function(_0x249184){return db[_0xa913('0x47')][_0xa913('0xbe')]({'where':{'id':_0x5d8076},'transaction':_0x249184})[_0xa913('0x26')](function(_0x18cfdb){if(_0x18cfdb){return db[_0xa913('0xbf')][_0xa913('0x3c')]({'where':{'SmsAccountId':_0x5d8076},'transaction':_0x249184})[_0xa913('0x26')](function(){var _0x261407=_[_0xa913('0x46')](_0x2ee360,function(_0x208773){_0x208773['SmsAccountId']=_0x5d8076;return _0x208773;});return db[_0xa913('0xbf')][_0xa913('0xc0')](_0x261407,{'transaction':_0x249184});});}else{_0x1779aa=0x194;_0x3a6c6e=[];}});})[_0xa913('0x26')](function(){if(_0x1779aa!==0x194){return db[_0xa913('0xbf')][_0xa913('0xc1')]({'where':{'SmsAccountId':_0x5d8076},'order':'priority'})[_0xa913('0x26')](function(_0x1557e5){_0x3a6c6e=_0x1557e5;});}})['catch'](function(_0x14297a){_0x1779aa=0x1f4;logger[_0xa913('0x2b')](_0x14297a[_0xa913('0x41')]);if(_0x14297a['name']){delete _0x14297a[_0xa913('0x42')];}_0x3a6c6e=_0x14297a;})[_0xa913('0xc2')](function(){if(_0x3a6c6e===null){_0xe8d9a4[_0xa913('0x30')](_0x1779aa);}else{if(_0x1779aa===0x1f4){_0xe8d9a4[_0xa913('0x31')](_0x1779aa)[_0xa913('0x43')](_0x3a6c6e);}else{_0xe8d9a4[_0xa913('0x31')](_0x1779aa)['json'](_0x3a6c6e);}}});};exports[_0xa913('0xc3')]=function(_0x1124de,_0x59a274,_0x27b62f){var _0x290ada={};var _0x50e9eb={};var _0x1e5b19;var _0x1b3302;return db['SmsAccount'][_0xa913('0xbe')]({'where':{'id':_0x1124de[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x59a274,null))[_0xa913('0x26')](function(_0x5f4f73){if(_0x5f4f73){_0x1e5b19=_0x5f4f73;_0x50e9eb[_0xa913('0x4d')]=_[_0xa913('0x4b')](db['SmsApplication'][_0xa913('0x61')]);_0x50e9eb[_0xa913('0x4a')]=_[_0xa913('0x4b')](_0x1124de[_0xa913('0x4a')]);_0x50e9eb['filters']=_['intersection'](_0x50e9eb[_0xa913('0x4d')],_0x50e9eb['query']);_0x290ada['attributes']=_['intersection'](_0x50e9eb[_0xa913('0x4d')],qs[_0xa913('0x4e')](_0x1124de[_0xa913('0x4a')][_0xa913('0x4e')]));_0x290ada[_0xa913('0x4f')]=_0x290ada[_0xa913('0x4f')][_0xa913('0x50')]?_0x290ada['attributes']:_0x50e9eb[_0xa913('0x4d')];_0x290ada[_0xa913('0x52')]=qs[_0xa913('0x53')](_0x1124de['query']['sort']);_0x290ada[_0xa913('0x54')]=qs['filters'](_[_0xa913('0x56')](_0x1124de[_0xa913('0x4a')],_0x50e9eb[_0xa913('0x55')]));if(_0x1124de[_0xa913('0x4a')]['filter']){_0x290ada['where']=_[_0xa913('0x57')](_0x290ada[_0xa913('0x54')],{'$or':_['map'](_0x290ada[_0xa913('0x4f')],function(_0x4a0741){var _0x2b3850={};_0x2b3850[_0x4a0741]={'$like':'%'+_0x1124de[_0xa913('0x4a')][_0xa913('0x59')]+'%'};return _0x2b3850;})});}_0x290ada=_[_0xa913('0x57')]({},_0x290ada,_0x1124de['options']);return _0x1e5b19['getApplications'](_0x290ada);}})[_0xa913('0x26')](function(_0x22ca00){if(_0x22ca00){_0x1b3302=_0x22ca00['length'];if(!_0x1124de[_0xa913('0x4a')][_0xa913('0x6f')](_0xa913('0x51'))){_0x290ada[_0xa913('0x35')]=qs[_0xa913('0x35')](_0x1124de['query'][_0xa913('0x35')]);_0x290ada['offset']=qs[_0xa913('0x33')](_0x1124de[_0xa913('0x4a')][_0xa913('0x33')]);}return _0x1e5b19['getApplications'](_0x290ada);}})[_0xa913('0x26')](function(_0x550eae){if(_0x550eae){return _0x550eae?{'count':_0x1b3302,'rows':_0x550eae}:null;}})[_0xa913('0x26')](respondWithResult(_0x59a274,null))[_0xa913('0x2f')](handleError(_0x59a274,null));};exports['getInteractions']=function(_0x28fae2,_0x2262c3,_0x576e0f){var _0x2c6f2a={'raw':![],'where':{}};var _0x6839e1={};var _0x3c6d05={'count':0x0,'rows':[]};return db[_0xa913('0x47')]['findOne']({'where':{'id':_0x28fae2[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x2262c3,null))['then'](function(_0x52cc4e){if(_0x52cc4e){_0x6839e1[_0xa913('0x4d')]=_[_0xa913('0x4b')](db[_0xa913('0xa0')]['rawAttributes']);_0x6839e1['query']=_[_0xa913('0x4b')](_0x28fae2[_0xa913('0x4a')]);_0x6839e1[_0xa913('0x55')]=_[_0xa913('0x4c')](_0x6839e1['model'],_0x6839e1[_0xa913('0x4a')]);_0x2c6f2a[_0xa913('0x4f')]=_[_0xa913('0x4c')](_0x6839e1['model'],qs[_0xa913('0x4e')](_0x28fae2[_0xa913('0x4a')][_0xa913('0x4e')]));_0x2c6f2a['attributes']=_0x2c6f2a['attributes']['length']?_0x2c6f2a[_0xa913('0x4f')]:_0x6839e1['model'];if(!_0x28fae2[_0xa913('0x4a')][_0xa913('0x6f')](_0xa913('0x51'))){_0x2c6f2a[_0xa913('0x35')]=qs[_0xa913('0x35')](_0x28fae2[_0xa913('0x4a')][_0xa913('0x35')]);_0x2c6f2a[_0xa913('0x33')]=qs[_0xa913('0x33')](_0x28fae2[_0xa913('0x4a')][_0xa913('0x33')]);}_0x2c6f2a[_0xa913('0x52')]=qs[_0xa913('0x53')](_0x28fae2[_0xa913('0x4a')][_0xa913('0x53')]);_0x2c6f2a['where']=qs[_0xa913('0x55')](_['pick'](_0x28fae2[_0xa913('0x4a')],_0x6839e1[_0xa913('0x55')]));_0x2c6f2a['where'][_0xa913('0x6c')]=_0x52cc4e['id'];if(_0x28fae2[_0xa913('0x4a')][_0xa913('0x59')]){_0x2c6f2a[_0xa913('0x54')]=_[_0xa913('0x57')](_0x2c6f2a[_0xa913('0x54')],{'$or':_['map'](_0x2c6f2a[_0xa913('0x4f')],function(_0x262b8e){var _0x144206={};_0x144206[_0x262b8e]={'$like':'%'+_0x28fae2['query'][_0xa913('0x59')]+'%'};return _0x144206;})});}_0x2c6f2a=_[_0xa913('0x57')]({},_0x2c6f2a,_0x28fae2[_0xa913('0x62')]);return db[_0xa913('0xa0')][_0xa913('0x36')]({'where':_0x2c6f2a['where']})[_0xa913('0x26')](function(_0x53165f){_0x3c6d05[_0xa913('0x36')]=_0x53165f;if(_0x28fae2[_0xa913('0x4a')][_0xa913('0x5a')]){_0x2c6f2a['include']=[{'model':db[_0xa913('0x7b')],'as':_0xa913('0xc4'),'required':![]},{'model':db['User'],'as':_0xa913('0xc5'),'attributes':['name',_0xa913('0xc6'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xa913('0xc7'),'attributes':['id',_0xa913('0x42'),_0xa913('0xc8')],'where':_0x28fae2[_0xa913('0x4a')][_0xa913('0xc9')]?{'id':_0x28fae2[_0xa913('0x4a')][_0xa913('0xc9')]}:undefined,'required':_0x28fae2[_0xa913('0x4a')][_0xa913('0xc9')]?!![]:![]}];}return db['SmsInteraction'][_0xa913('0x5c')](_0x2c6f2a);})[_0xa913('0x26')](function(_0x51fdf5){_0x3c6d05[_0xa913('0x5d')]=_0x51fdf5;return _0x3c6d05;});}})[_0xa913('0x26')](respondWithFilteredResult(_0x2262c3,_0x2c6f2a))[_0xa913('0x2f')](handleError(_0x2262c3,null));};exports[_0xa913('0x43')]=function(_0x52b16e,_0x46b725,_0xe9148b){var _0x18d493,_0x5a8564,_0x2fe9e9;if(_[_0xa913('0x94')](_0x52b16e[_0xa913('0x65')][_0xa913('0x65')])||_0x52b16e[_0xa913('0x65')][_0xa913('0x65')]===''){throw new db[(_0xa913('0x95'))]['ValidationError'](_0xa913('0x97'));}if(_[_0xa913('0x94')](_0x52b16e[_0xa913('0x65')]['to'])){throw new db[(_0xa913('0x95'))][(_0xa913('0x7c'))]('to\x20is\x20mandatory');}_0x18d493=_0x52b16e[_0xa913('0x65')]['to'];return db[_0xa913('0x47')][_0xa913('0x63')]({'where':{'id':_0x52b16e[_0xa913('0x5f')]['id']},'include':[{'model':db[_0xa913('0xca')],'as':_0xa913('0xcb'),'include':[{'model':db[_0xa913('0x7b')],'as':_0xa913('0x9b'),'where':{'mobile':_0x18d493},'limit':0x1,'order':[[_0xa913('0x80'),'DESC']]}]}]})[_0xa913('0x26')](handleEntityNotFound(_0x46b725,null))['then'](function(_0x1881e5){if(_0x1881e5&&_0x1881e5[_0xa913('0xcb')]){_0x5a8564=_0x1881e5[_0xa913('0x3d')]({'plain':!![]});if(_0x5a8564[_0xa913('0xcb')]&&_0x5a8564[_0xa913('0xcb')]['Contacts'][_0xa913('0x50')]){return _0x5a8564[_0xa913('0xcb')]['Contacts'][0x0];}return db[_0xa913('0x7b')][_0xa913('0x64')](_['defaults'](_0x52b16e['body'],{'firstName':_0x18d493,'mobile':_0x18d493,'phone':_0x18d493,'ListId':_0x5a8564['ListId']}));}})[_0xa913('0x26')](handleEntityNotFound(_0x46b725,null))[_0xa913('0x26')](function(_0x97d616){if(_0x97d616){_0x2fe9e9=_0x97d616;return db[_0xa913('0xa0')][_0xa913('0x63')]({'where':{'ContactId':_0x2fe9e9['id'],'closed':![],'SmsAccountId':_0x5a8564['id']}})[_0xa913('0x26')](function(_0x42e7fe){if(_0x42e7fe){return[_0x42e7fe,![]];}return db['SmsInteraction'][_0xa913('0x64')]({'UserId':_0x52b16e[_0xa913('0x67')]['id'],'ContactId':_0x2fe9e9['id'],'SmsAccountId':_0x5a8564['id'],'phone':_0x18d493,'firstMsgDirection':_0xa913('0xcc'),'Messages':[_[_0xa913('0x57')](_0x52b16e[_0xa913('0x65')],{'read':![],'body':_0x52b16e[_0xa913('0x65')][_0xa913('0x65')],'phone':_0x18d493,'SmsAccountId':_0x5a8564['id'],'UserId':_0x52b16e[_0xa913('0x67')]['id'],'ContactId':_0x2fe9e9['id']})]},{'include':[{'model':db[_0xa913('0xa8')],'as':'Messages'}]})[_0xa913('0x26')](function(_0x393a2a){return[_0x393a2a,!![]];});});}})[_0xa913('0xa1')](function(_0xb83c54,_0x35aaab){if(_0x35aaab){return _0xb83c54;}return db['SmsMessage'][_0xa913('0x64')](_[_0xa913('0x57')](_0x52b16e[_0xa913('0x65')],{'read':![],'body':_0x52b16e['body'][_0xa913('0x65')],'phone':_0x18d493,'SmsAccountId':_0x5a8564['id'],'SmsInteractionId':_0xb83c54['id'],'UserId':_0x52b16e[_0xa913('0x67')]['id'],'ContactId':_0x2fe9e9['id']}))[_0xa913('0x26')](function(_0x1e4e3b){_0xb83c54[_0xa913('0xcd')][_0xa913('0xce')]=[];_0xb83c54[_0xa913('0xcd')][_0xa913('0xce')]['push'](_0x1e4e3b['dataValues']);return _0xb83c54;});})['then'](respondWithResult(_0x46b725,null))[_0xa913('0x2f')](handleError(_0x46b725,null));};exports[_0xa913('0x31')]=function(_0xaaf877,_0x598eac,_0x1be2ef){if(_0xaaf877[_0xa913('0x65')]['id']){delete _0xaaf877[_0xa913('0x65')]['id'];}var _0x256ac4,_0x3070e7,_0x1c761c;return db[_0xa913('0x47')][_0xa913('0x63')]({'where':{'id':_0xaaf877[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x598eac,null))['then'](function(_0xacc4a){if(_0xacc4a){_0x1c761c=_0xacc4a;logger[_0xa913('0x29')](_0xa913('0x2a'),_0xa913('0x31'),_0xa913('0xcf'),_0xacc4a[_0xa913('0x48')],util[_0xa913('0xd0')](_0xaaf877['body'],{'showHidden':![],'depth':null}));switch(_0xacc4a['type']){case'skebby':if(_0xaaf877[_0xa913('0x65')][_0xa913('0xd1')]&&_0xaaf877[_0xa913('0x65')][_0xa913('0x31')]){_0x3070e7=_0xaaf877['body'][_0xa913('0x31')];return db[_0xa913('0xa8')]['find']({'where':{'messageId':_0xaaf877['body'][_0xa913('0xd1')]}});}break;case _0xa913('0xd2'):if(_0xaaf877[_0xa913('0x65')][_0xa913('0xd3')]&&_0xaaf877[_0xa913('0x65')][_0xa913('0xd4')]){_0x3070e7=_0xaaf877['body']['statusInt'];return db['SmsMessage'][_0xa913('0x63')]({'where':{'messageId':_0xaaf877[_0xa913('0x65')]['requestid']}});}break;case'clicksend':if(_0xaaf877['body'][_0xa913('0xd5')]&&_0xaaf877[_0xa913('0x65')][_0xa913('0xd6')]){_0x3070e7=_0xaaf877['body'][_0xa913('0xd6')];return db[_0xa913('0xa8')]['find']({'where':{'messageId':_0xaaf877[_0xa913('0x65')]['message_id']}});}break;case _0xa913('0xd7'):var _0x98eee6=_0xaaf877[_0xa913('0x65')][_0xa913('0xd8')][0x0];if(_0x98eee6[_0xa913('0x85')]&&_0x98eee6['status'][_0xa913('0xd9')]===_0xa913('0xda')){_0x3070e7=_0x98eee6[_0xa913('0x31')][_0xa913('0xd9')];return db['SmsMessage']['find']({'where':{'messageId':_0x98eee6[_0xa913('0x85')]}});}break;case _0xa913('0x8f'):if(_0xaaf877[_0xa913('0x65')]['messageId']&&_0xaaf877[_0xa913('0x65')][_0xa913('0x31')]){_0x3070e7=_0xaaf877[_0xa913('0x65')]['status'];return db[_0xa913('0xa8')]['find']({'where':{'messageId':_0xaaf877[_0xa913('0x65')]['messageId']}});}break;case _0xa913('0x91'):if(_0xaaf877[_0xa913('0x65')][0x0][_0xa913('0x2d')]['id']){_0x3070e7=_0xaaf877['body'][0x0]['type'];return db[_0xa913('0xa8')][_0xa913('0x63')]({'where':{'messageId':_0xaaf877[_0xa913('0x65')][0x0][_0xa913('0x2d')]['id']}});}break;case _0xa913('0x92'):if(_0xaaf877[_0xa913('0x65')][_0xa913('0xdb')]&&_0xaaf877['body'][_0xa913('0x31')]){_0x3070e7=_0xaaf877['body']['status'];return db[_0xa913('0xa8')]['find']({'where':{'messageId':_0xaaf877[_0xa913('0x65')]['redif']}});}break;}}})[_0xa913('0x26')](handleEntityNotFound(_0x598eac,null))[_0xa913('0x26')](function(_0x2af675){if(_0x2af675){_0x256ac4=_0x2af675;switch(_0x1c761c['type']){case _0xa913('0x86'):if(_0x3070e7===_0xa913('0xda')){return _0x256ac4['update']({'read':!![]});}else{logger[_0xa913('0x2b')](_0xa913('0x2a'),_0xa913('0x31'),_0xa913('0x86'),util[_0xa913('0xd0')](_0xaaf877[_0xa913('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa913('0xd2'):if(_0x3070e7==='1'){return _0x256ac4[_0xa913('0x3b')]({'read':!![]});}else{logger[_0xa913('0x2b')](_0xa913('0x2a'),_0xa913('0x31'),_0xa913('0x86'),util[_0xa913('0xd0')](_0xaaf877[_0xa913('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa913('0x89'):if(!_0xaaf877[_0xa913('0x65')][_0xa913('0xdc')]&&_0x3070e7>=0xc8&&_0x3070e7<=0xce){return _0x256ac4[_0xa913('0x3b')]({'read':!![]});}else{logger['error'](_0xa913('0x2a'),_0xa913('0x31'),_0xa913('0x89'),util['inspect'](_0xaaf877[_0xa913('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa913('0xd7'):var _0x4bb29c=_0xaaf877[_0xa913('0x65')]['results'][0x0];if(_0x4bb29c['status'][_0xa913('0xd9')]===_0xa913('0xda')){return _0x256ac4[_0xa913('0x3b')]({'read':!![]});}else{logger['error'](_0xa913('0x2a'),'status',_0xa913('0xd7'),util['inspect'](_0xaaf877[_0xa913('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa913('0x8f'):if(_0x3070e7==_0xa913('0xdd')||_0x3070e7==_0xa913('0xde')){return _0x256ac4[_0xa913('0x3b')]({'read':!![]});}else{logger[_0xa913('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0xa913('0x8f'),util[_0xa913('0xd0')](_0xaaf877[_0xa913('0x65')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x3070e7=='message-delivered'){return _0x256ac4[_0xa913('0x3b')]({'read':!![]});}else{logger['error'](_0xa913('0x2a'),_0xa913('0x31'),'bandwidth',util[_0xa913('0xd0')](_0xaaf877[_0xa913('0x65')],{'showHidden':![],'depth':null}));}break;case _0xa913('0x92'):if(_0x3070e7==='DELIVRD'||_0x3070e7===_0xa913('0xdf')){return _0x256ac4['update']({'read':!![]});}else{logger[_0xa913('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa913('0x31'),_0xa913('0x92'),util[_0xa913('0xd0')](_0xaaf877[_0xa913('0x65')],{'showHidden':![],'depth':null}));}break;}return _0x256ac4;}})['then'](respondWithResult(_0x598eac,null))['catch'](handleError(_0x598eac,null));};exports[_0xa913('0xe0')]=function(_0x511f3e,_0x1f9427,_0xbfe0c2){var _0x26b94a,_0x61da66,_0x368c40;return db[_0xa913('0x47')][_0xa913('0x63')]({'where':{'id':_0x511f3e['params']['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x1f9427,null))[_0xa913('0x26')](function(_0x418607){if(_0x418607){_0x368c40=_0x418607;logger[_0xa913('0x29')](_0xa913('0x2a'),'status',_0xa913('0xcf'),_0x418607[_0xa913('0x48')],util[_0xa913('0xd0')](_0x511f3e['query'],{'showHidden':![],'depth':null}));switch(_0x418607[_0xa913('0x48')]){case _0xa913('0x8d'):if(_0x511f3e['query'][_0xa913('0xe1')]&&_0x511f3e[_0xa913('0x4a')][_0xa913('0xe2')]){_0x61da66=_0x511f3e['query']['state'];return db[_0xa913('0xa8')][_0xa913('0x63')]({'where':{'messageId':_0x511f3e[_0xa913('0x4a')][_0xa913('0xe1')]}});}break;}}})[_0xa913('0x26')](handleEntityNotFound(_0x1f9427,null))['then'](function(_0x2c3283){if(_0x2c3283){_0x26b94a=_0x2c3283;switch(_0x368c40[_0xa913('0x48')]){case _0xa913('0x8d'):if(_0x61da66==='2'||_0x61da66==='6'){return _0x26b94a[_0xa913('0x3b')]({'read':!![]});}else{logger[_0xa913('0x2b')](_0xa913('0x2a'),_0xa913('0x31'),_0xa913('0x8d'),util['inspect'](_0x511f3e[_0xa913('0x4a')],{'showHidden':![],'depth':null}));};break;}return _0x26b94a;}})[_0xa913('0x26')](respondWithResult(_0x1f9427,null))[_0xa913('0x2f')](handleError(_0x1f9427,null));};exports[_0xa913('0xe3')]=function(_0x497e59,_0x9aed9d,_0x4af8b5){return db[_0xa913('0x47')][_0xa913('0x63')]({'where':{'id':_0x497e59[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x9aed9d,null))[_0xa913('0x26')](function(_0x1f5d1e){if(_0x1f5d1e){return _0x1f5d1e[_0xa913('0xe3')](_0x497e59['body'][_0xa913('0x74')],_[_0xa913('0x9e')](_0x497e59[_0xa913('0x65')],[_0xa913('0x74'),'id'])||{})[_0xa913('0xa1')](function(_0xda96c1){for(var _0x1e0cc7=0x0;_0x1e0cc7<_0x497e59[_0xa913('0x65')][_0xa913('0x74')]['length'];_0x1e0cc7+=0x1){socket[_0xa913('0xe4')]('userSmsAccount:save',{'UserId':Number(_0x497e59[_0xa913('0x65')][_0xa913('0x74')][_0x1e0cc7]),'SmsAccountId':Number(_0x497e59['params']['id'])});}return _0xda96c1;});}})[_0xa913('0x26')](respondWithResult(_0x9aed9d,null))[_0xa913('0x2f')](handleError(_0x9aed9d,null));};exports[_0xa913('0xe5')]=function(_0x394aae,_0x17bee6,_0x9f7fe3){return db[_0xa913('0x47')]['find']({'where':{'id':_0x394aae[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0x17bee6,null))[_0xa913('0x26')](function(_0x5ac4f4){if(_0x5ac4f4){return _0x5ac4f4['removeAgents'](_0x394aae[_0xa913('0x4a')][_0xa913('0x74')])[_0xa913('0x26')](function(){if(_['isArray'](_0x394aae[_0xa913('0x4a')][_0xa913('0x74')])){for(var _0x5b71ff=0x0;_0x5b71ff<_0x394aae[_0xa913('0x4a')]['ids'][_0xa913('0x50')];_0x5b71ff+=0x1){socket['emit'](_0xa913('0xe6'),{'UserId':Number(_0x394aae[_0xa913('0x4a')][_0xa913('0x74')][_0x5b71ff]),'SmsAccountId':Number(_0x394aae[_0xa913('0x5f')]['id'])});}}else{socket[_0xa913('0xe4')](_0xa913('0xe6'),{'UserId':Number(_0x394aae['query']['ids']),'SmsAccountId':Number(_0x394aae[_0xa913('0x5f')]['id'])});}});}})[_0xa913('0x26')](respondWithStatusCode(_0x17bee6,null))['catch'](handleError(_0x17bee6,null));};exports[_0xa913('0xe7')]=function(_0xb393bb,_0xc65b22,_0x247db1){var _0x1413d3={};var _0x3cf891={};var _0x911639;var _0x255fab;return db['SmsAccount'][_0xa913('0xbe')]({'where':{'id':_0xb393bb[_0xa913('0x5f')]['id']}})[_0xa913('0x26')](handleEntityNotFound(_0xc65b22,null))['then'](function(_0x105e08){if(_0x105e08){_0x911639=_0x105e08;_0x3cf891[_0xa913('0x4d')]=_[_0xa913('0x4b')](db[_0xa913('0xac')]['rawAttributes']);_0x3cf891[_0xa913('0x4a')]=_[_0xa913('0x4b')](_0xb393bb['query']);_0x3cf891[_0xa913('0x55')]=_['intersection'](_0x3cf891[_0xa913('0x4d')],_0x3cf891[_0xa913('0x4a')]);_0x1413d3[_0xa913('0x4f')]=_[_0xa913('0x4c')](_0x3cf891[_0xa913('0x4d')],qs[_0xa913('0x4e')](_0xb393bb[_0xa913('0x4a')][_0xa913('0x4e')]));_0x1413d3[_0xa913('0x4f')]=_0x1413d3['attributes'][_0xa913('0x50')]?_0x1413d3[_0xa913('0x4f')]:_0x3cf891[_0xa913('0x4d')];_0x1413d3[_0xa913('0x52')]=qs['sort'](_0xb393bb[_0xa913('0x4a')][_0xa913('0x53')]);_0x1413d3[_0xa913('0x54')]=qs['filters'](_[_0xa913('0x56')](_0xb393bb[_0xa913('0x4a')],_0x3cf891[_0xa913('0x55')]));if(_0xb393bb[_0xa913('0x4a')][_0xa913('0x59')]){_0x1413d3['where']=_[_0xa913('0x57')](_0x1413d3['where'],{'$or':_[_0xa913('0x46')](_0x1413d3[_0xa913('0x4f')],function(_0x189c59){var _0x5aaa71={};_0x5aaa71[_0x189c59]={'$like':'%'+_0xb393bb[_0xa913('0x4a')][_0xa913('0x59')]+'%'};return _0x5aaa71;})});}_0x1413d3=_[_0xa913('0x57')]({},_0x1413d3,_0xb393bb[_0xa913('0x62')]);return _0x911639[_0xa913('0xe7')](_0x1413d3);}})[_0xa913('0x26')](function(_0x5d84ae){if(_0x5d84ae){_0x255fab=_0x5d84ae[_0xa913('0x50')];if(!_0xb393bb[_0xa913('0x4a')][_0xa913('0x6f')](_0xa913('0x51'))){_0x1413d3['limit']=qs['limit'](_0xb393bb[_0xa913('0x4a')][_0xa913('0x35')]);_0x1413d3['offset']=qs[_0xa913('0x33')](_0xb393bb[_0xa913('0x4a')][_0xa913('0x33')]);}return _0x911639['getAgents'](_0x1413d3);}})[_0xa913('0x26')](function(_0x4d253c){if(_0x4d253c){return _0x4d253c?{'count':_0x255fab,'rows':_0x4d253c}:null;}})[_0xa913('0x26')](respondWithResult(_0xc65b22,null))['catch'](handleError(_0xc65b22,null));}; \ No newline at end of file +var _0x3ca3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','then','info','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','get','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','filters','filter','merge','options','SmsAccount','include','rows','show','Pause','length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication','Applications','orderBy','priority','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','account','from','From','Body','messageId','MessageSid','skebby','sender','text','message_id','plivo','Text','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','refid','isNil','ValidationError','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','SmsInteraction','interaction','created','autoclose','applications','push','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','queueId','SmsQueue','queue','waitForTheAssignedQueue','Start','receiveMessage','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','text/xml','send','\x0a','addApplications','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','DESC','out','SmsMessage','Messages','spread','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','DELIVERED','groupName','redif','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','emit','removeAgents','userSmsAccount:remove','getAgents','eml-format','rimraf'];(function(_0x26c401,_0x5e0a1b){var _0x269a26=function(_0x3aa7bb){while(--_0x3aa7bb){_0x26c401['push'](_0x26c401['shift']());}};_0x269a26(++_0x5e0a1b);}(_0x3ca3,0xe4));var _0x33ca=function(_0x2ab124,_0x29445e){_0x2ab124=_0x2ab124-0x0;var _0x458b73=_0x3ca3[_0x2ab124];return _0x458b73;};'use strict';var emlformat=require(_0x33ca('0x0'));var rimraf=require(_0x33ca('0x1'));var zipdir=require(_0x33ca('0x2'));var jsonpatch=require(_0x33ca('0x3'));var rp=require(_0x33ca('0x4'));var moment=require(_0x33ca('0x5'));var BPromise=require(_0x33ca('0x6'));var Mustache=require(_0x33ca('0x7'));var util=require(_0x33ca('0x8'));var path=require(_0x33ca('0x9'));var sox=require(_0x33ca('0xa'));var csv=require('to-csv');var ejs=require(_0x33ca('0xb'));var fs=require('fs');var fs_extra=require(_0x33ca('0xc'));var _=require(_0x33ca('0xd'));var squel=require('squel');var crypto=require(_0x33ca('0xe'));var jsforce=require(_0x33ca('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x33ca('0x10'));var querystring=require(_0x33ca('0x11'));var Papa=require(_0x33ca('0x12'));var Redis=require('ioredis');var authService=require(_0x33ca('0x13'));var qs=require(_0x33ca('0x14'));var as=require(_0x33ca('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x33ca('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x33ca('0x17'));var db=require('../../mysqldb')['db'];config[_0x33ca('0x18')]=_[_0x33ca('0x19')](config['redis'],{'host':_0x33ca('0x1a'),'port':0x18eb});var socket=require(_0x33ca('0x1b'))(new Redis(config[_0x33ca('0x18')]));require('./smsAccount.socket')['register'](socket);var jayson=require(_0x33ca('0x1c'));var client=jayson['client'][_0x33ca('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x117e6a,_0x422d5e,_0x4d0a6f,_0x412d24){return new BPromise(function(_0x8ca98,_0x1058d0){var _0x23a77e=_0x412d24||client;return _0x23a77e['request'](_0x117e6a,_0x4d0a6f)[_0x33ca('0x1e')](function(_0x2051f7){logger[_0x33ca('0x1f')]('SmsAccount,\x20%s,\x20%s',_0x422d5e,_0x33ca('0x20'));logger[_0x33ca('0x21')](_0x33ca('0x22'),_0x422d5e,_0x33ca('0x20'),JSON[_0x33ca('0x23')](_0x2051f7));if(_0x2051f7[_0x33ca('0x24')]){if(_0x2051f7[_0x33ca('0x24')][_0x33ca('0x25')]===0x1f4){logger[_0x33ca('0x24')](_0x33ca('0x26'),_0x422d5e,_0x2051f7[_0x33ca('0x24')][_0x33ca('0x27')]);return _0x1058d0(_0x2051f7['error'][_0x33ca('0x27')]);}logger[_0x33ca('0x24')]('SmsAccount,\x20%s,\x20%s',_0x422d5e,_0x2051f7['error'][_0x33ca('0x27')]);return _0x8ca98(_0x2051f7[_0x33ca('0x24')][_0x33ca('0x27')]);}else{logger[_0x33ca('0x1f')](_0x33ca('0x26'),_0x422d5e,'request\x20sent');_0x8ca98(_0x2051f7[_0x33ca('0x28')][_0x33ca('0x27')]);}})[_0x33ca('0x29')](function(_0x4e822d){logger[_0x33ca('0x24')](_0x33ca('0x26'),_0x422d5e,_0x4e822d);_0x1058d0(_0x4e822d);});});}function respondWithStatusCode(_0x574f90,_0x144035){_0x144035=_0x144035||0xcc;return function(_0x55d866){if(_0x55d866){return _0x574f90[_0x33ca('0x2a')](_0x144035);}return _0x574f90[_0x33ca('0x2b')](_0x144035)[_0x33ca('0x2c')]();};}function respondWithResult(_0x35c101,_0x237ffe){_0x237ffe=_0x237ffe||0xc8;return function(_0xe3ac28){if(_0xe3ac28){return _0x35c101['status'](_0x237ffe)['json'](_0xe3ac28);}};}function respondWithFilteredResult(_0xbfec62,_0x4926dd){return function(_0x26ddc4){if(_0x26ddc4){var _0x4456eb=typeof _0x4926dd[_0x33ca('0x2d')]===_0x33ca('0x2e')&&typeof _0x4926dd['limit']==='undefined';var _0x124c5c=_0x26ddc4[_0x33ca('0x2f')];var _0x1b3957=_0x4456eb?0x0:_0x4926dd[_0x33ca('0x2d')];var _0x46577d=_0x4456eb?_0x26ddc4['count']:_0x4926dd[_0x33ca('0x2d')]+_0x4926dd[_0x33ca('0x30')];var _0x3f4477;if(_0x46577d>=_0x124c5c){_0x46577d=_0x124c5c;_0x3f4477=0xc8;}else{_0x3f4477=0xce;}_0xbfec62[_0x33ca('0x2b')](_0x3f4477);return _0xbfec62[_0x33ca('0x31')](_0x33ca('0x32'),_0x1b3957+'-'+_0x46577d+'/'+_0x124c5c)[_0x33ca('0x33')](_0x26ddc4);}return null;};}function patchUpdates(_0x34aacd){return function(_0x11e76b){try{jsonpatch['apply'](_0x11e76b,_0x34aacd,!![]);}catch(_0x168a94){return BPromise[_0x33ca('0x34')](_0x168a94);}return _0x11e76b[_0x33ca('0x35')]();};}function saveUpdates(_0x471fb1,_0x5620bd){return function(_0x1e7726){if(_0x1e7726){return _0x1e7726[_0x33ca('0x36')](_0x471fb1)[_0x33ca('0x1e')](function(_0x228e55){return _0x228e55;});}return null;};}function removeEntity(_0x1c8a80,_0x134391){return function(_0x1f45a1){if(_0x1f45a1){return _0x1f45a1[_0x33ca('0x37')]()[_0x33ca('0x1e')](function(){var _0xbeb924=_0x1f45a1[_0x33ca('0x38')]({'plain':!![]});var _0x44c6b5='SmsAccounts';return db[_0x33ca('0x39')][_0x33ca('0x37')]({'where':{'type':_0x44c6b5,'resourceId':_0xbeb924['id']}})[_0x33ca('0x1e')](function(){return _0x1f45a1;});})[_0x33ca('0x1e')](function(){_0x1c8a80[_0x33ca('0x2b')](0xcc)[_0x33ca('0x2c')]();});}};}function handleEntityNotFound(_0x2ab402,_0x58101b){return function(_0x10863a){if(!_0x10863a){_0x2ab402[_0x33ca('0x2a')](0x194);}return _0x10863a;};}function handleError(_0x38210a,_0x467437){_0x467437=_0x467437||0x1f4;return function(_0x403351){logger['error'](_0x403351[_0x33ca('0x3a')]);if(_0x403351[_0x33ca('0x3b')]){delete _0x403351[_0x33ca('0x3b')];}_0x38210a['status'](_0x467437)['send'](_0x403351);};}exports[_0x33ca('0x3c')]=function(_0x539099,_0x28d364){var _0x3a6134={'include':[{'model':db['Pause'],'as':_0x33ca('0x3d')}]},_0x2430e8={},_0x5dede7={'count':0x0,'rows':[]};var _0x1a7b17=_[_0x33ca('0x3e')](db['SmsAccount'][_0x33ca('0x3f')],function(_0x18296d){return{'name':_0x18296d[_0x33ca('0x40')],'type':_0x18296d[_0x33ca('0x41')][_0x33ca('0x42')]};});_0x2430e8['model']=_[_0x33ca('0x3e')](_0x1a7b17,_0x33ca('0x3b'));_0x2430e8[_0x33ca('0x43')]=_[_0x33ca('0x44')](_0x539099[_0x33ca('0x43')]);_0x2430e8['filters']=_[_0x33ca('0x45')](_0x2430e8[_0x33ca('0x46')],_0x2430e8[_0x33ca('0x43')]);_0x3a6134[_0x33ca('0x47')]=_['intersection'](_0x2430e8[_0x33ca('0x46')],qs[_0x33ca('0x48')](_0x539099[_0x33ca('0x43')][_0x33ca('0x48')]));_0x3a6134[_0x33ca('0x47')]=_0x3a6134[_0x33ca('0x47')]['length']?_0x3a6134['attributes']:_0x2430e8['model'];if(!_0x539099[_0x33ca('0x43')]['hasOwnProperty'](_0x33ca('0x49'))){_0x3a6134['limit']=qs['limit'](_0x539099[_0x33ca('0x43')][_0x33ca('0x30')]);_0x3a6134[_0x33ca('0x2d')]=qs['offset'](_0x539099[_0x33ca('0x43')]['offset']);}_0x3a6134[_0x33ca('0x4a')]=qs['sort'](_0x539099[_0x33ca('0x43')][_0x33ca('0x4b')]);_0x3a6134[_0x33ca('0x4c')]=qs[_0x33ca('0x4d')](_['pick'](_0x539099[_0x33ca('0x43')],_0x2430e8[_0x33ca('0x4d')]),_0x1a7b17);if(_0x539099[_0x33ca('0x43')][_0x33ca('0x4e')]){_0x3a6134['where']=_[_0x33ca('0x4f')](_0x3a6134['where'],{'$or':_[_0x33ca('0x3e')](_0x1a7b17,function(_0x3cd7c5){if(_0x3cd7c5[_0x33ca('0x41')]!=='VIRTUAL'){var _0xddaa37={};_0xddaa37[_0x3cd7c5[_0x33ca('0x3b')]]={'$like':'%'+_0x539099['query'][_0x33ca('0x4e')]+'%'};return _0xddaa37;}})});}_0x3a6134=_[_0x33ca('0x4f')]({},_0x3a6134,_0x539099[_0x33ca('0x50')]);var _0x283a43={'where':_0x3a6134[_0x33ca('0x4c')]};return db[_0x33ca('0x51')][_0x33ca('0x2f')](_0x283a43)['then'](function(_0x523362){_0x5dede7[_0x33ca('0x2f')]=_0x523362;if(_0x539099[_0x33ca('0x43')]['includeAll']){_0x3a6134[_0x33ca('0x52')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x3a6134);})[_0x33ca('0x1e')](function(_0x2da5bb){_0x5dede7[_0x33ca('0x53')]=_0x2da5bb;return _0x5dede7;})[_0x33ca('0x1e')](respondWithFilteredResult(_0x28d364,_0x3a6134))[_0x33ca('0x29')](handleError(_0x28d364,null));};exports[_0x33ca('0x54')]=function(_0x33fc63,_0x3a80c4){var _0x5af96f={'raw':![],'where':{'id':_0x33fc63['params']['id']},'include':[{'model':db[_0x33ca('0x55')],'as':_0x33ca('0x3d')}]},_0x3d2c0d={};_0x3d2c0d[_0x33ca('0x46')]=_[_0x33ca('0x44')](db['SmsAccount'][_0x33ca('0x3f')]);_0x3d2c0d[_0x33ca('0x43')]=_[_0x33ca('0x44')](_0x33fc63[_0x33ca('0x43')]);_0x3d2c0d[_0x33ca('0x4d')]=_['intersection'](_0x3d2c0d[_0x33ca('0x46')],_0x3d2c0d[_0x33ca('0x43')]);_0x5af96f['attributes']=_['intersection'](_0x3d2c0d[_0x33ca('0x46')],qs[_0x33ca('0x48')](_0x33fc63[_0x33ca('0x43')][_0x33ca('0x48')]));_0x5af96f[_0x33ca('0x47')]=_0x5af96f[_0x33ca('0x47')][_0x33ca('0x56')]?_0x5af96f[_0x33ca('0x47')]:_0x3d2c0d[_0x33ca('0x46')];if(_0x33fc63[_0x33ca('0x43')][_0x33ca('0x57')]){_0x5af96f[_0x33ca('0x52')]=[{'all':!![]}];}_0x5af96f=_[_0x33ca('0x4f')]({},_0x5af96f,_0x33fc63[_0x33ca('0x50')]);return db['SmsAccount'][_0x33ca('0x58')](_0x5af96f)[_0x33ca('0x1e')](handleEntityNotFound(_0x3a80c4,null))[_0x33ca('0x1e')](respondWithResult(_0x3a80c4,null))[_0x33ca('0x29')](handleError(_0x3a80c4,null));};exports[_0x33ca('0x59')]=function(_0x4fc37a,_0x1d7c7e){return db[_0x33ca('0x51')][_0x33ca('0x59')](_0x4fc37a[_0x33ca('0x5a')],{})['then'](function(_0x1a9c02){var _0x43d51c=_0x4fc37a[_0x33ca('0x5b')][_0x33ca('0x38')]({'plain':!![]});if(!_0x43d51c)throw new Error(_0x33ca('0x5c'));if(_0x43d51c['role']==='user'){var _0x43efad=_0x1a9c02[_0x33ca('0x38')]({'plain':!![]});var _0x3f6630=_0x33ca('0x5d');return db[_0x33ca('0x5e')][_0x33ca('0x58')]({'where':{'name':_0x3f6630,'userProfileId':_0x43d51c[_0x33ca('0x5f')]},'raw':!![]})['then'](function(_0xd4c004){if(_0xd4c004&&_0xd4c004[_0x33ca('0x60')]===0x0){return db[_0x33ca('0x39')][_0x33ca('0x59')]({'name':_0x43efad[_0x33ca('0x3b')],'resourceId':_0x43efad['id'],'type':_0xd4c004[_0x33ca('0x3b')],'sectionId':_0xd4c004['id']},{})[_0x33ca('0x1e')](function(){return _0x1a9c02;});}else{return _0x1a9c02;}})['catch'](function(_0x99f283){logger[_0x33ca('0x24')](_0x33ca('0x61'),_0x99f283);throw _0x99f283;});}return _0x1a9c02;})[_0x33ca('0x1e')](respondWithResult(_0x1d7c7e,0xc9))[_0x33ca('0x29')](handleError(_0x1d7c7e,null));};exports['update']=function(_0x20018c,_0x18f932){if(_0x20018c[_0x33ca('0x5a')]['id']){delete _0x20018c[_0x33ca('0x5a')]['id'];}return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x20018c['params']['id']},'include':[{'model':db[_0x33ca('0x55')],'as':'mandatoryDispositionPause'}]})[_0x33ca('0x1e')](handleEntityNotFound(_0x18f932,null))[_0x33ca('0x1e')](saveUpdates(_0x20018c['body'],null))[_0x33ca('0x1e')](respondWithResult(_0x18f932,null))['catch'](handleError(_0x18f932,null));};exports[_0x33ca('0x37')]=function(_0x19c6f9,_0x253691){return db['SmsAccount'][_0x33ca('0x58')]({'where':{'id':_0x19c6f9[_0x33ca('0x62')]['id']}})['then'](handleEntityNotFound(_0x253691,null))[_0x33ca('0x1e')](removeEntity(_0x253691,null))[_0x33ca('0x29')](handleError(_0x253691,null));};exports[_0x33ca('0x63')]=function(_0x42b34e,_0x2f8454){return db[_0x33ca('0x51')]['describe']()[_0x33ca('0x1e')](respondWithResult(_0x2f8454,null))['catch'](handleError(_0x2f8454,null));};exports['addDisposition']=function(_0x3ce569,_0x1db45b,_0x4e2585){if(_0x3ce569[_0x33ca('0x5a')]['id']){delete _0x3ce569[_0x33ca('0x5a')]['id'];}return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x3ce569[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x1db45b,null))[_0x33ca('0x1e')](function(_0x34c848){if(_0x34c848){_0x3ce569[_0x33ca('0x5a')][_0x33ca('0x64')]=_0x34c848['id'];return db[_0x33ca('0x65')][_0x33ca('0x59')](_0x3ce569[_0x33ca('0x5a')]);}})[_0x33ca('0x1e')](respondWithResult(_0x1db45b,null))[_0x33ca('0x29')](handleError(_0x1db45b,null));};exports[_0x33ca('0x66')]=function(_0x5394b6,_0x44f6a5,_0xd15b34){var _0x530763={'raw':![],'where':{}};var _0x378627={};var _0x458575={'count':0x0,'rows':[]};return db[_0x33ca('0x51')][_0x33ca('0x67')]({'where':{'id':_0x5394b6[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x44f6a5,null))[_0x33ca('0x1e')](function(_0x58994d){if(_0x58994d){_0x378627[_0x33ca('0x46')]=_['keys'](db[_0x33ca('0x65')][_0x33ca('0x3f')]);_0x378627[_0x33ca('0x43')]=_['keys'](_0x5394b6[_0x33ca('0x43')]);_0x378627[_0x33ca('0x4d')]=_[_0x33ca('0x45')](_0x378627['model'],_0x378627[_0x33ca('0x43')]);_0x530763[_0x33ca('0x47')]=_['intersection'](_0x378627[_0x33ca('0x46')],qs[_0x33ca('0x48')](_0x5394b6[_0x33ca('0x43')]['fields']));_0x530763[_0x33ca('0x47')]=_0x530763['attributes']['length']?_0x530763[_0x33ca('0x47')]:_0x378627[_0x33ca('0x46')];if(!_0x5394b6[_0x33ca('0x43')][_0x33ca('0x68')](_0x33ca('0x49'))){_0x530763['limit']=qs[_0x33ca('0x30')](_0x5394b6['query'][_0x33ca('0x30')]);_0x530763[_0x33ca('0x2d')]=qs['offset'](_0x5394b6[_0x33ca('0x43')]['offset']);}_0x530763[_0x33ca('0x4a')]=qs[_0x33ca('0x4b')](_0x5394b6['query'][_0x33ca('0x4b')]);_0x530763[_0x33ca('0x4c')]=qs[_0x33ca('0x4d')](_[_0x33ca('0x69')](_0x5394b6[_0x33ca('0x43')],_0x378627[_0x33ca('0x4d')]));_0x530763[_0x33ca('0x4c')][_0x33ca('0x64')]=_0x58994d['id'];if(_0x5394b6[_0x33ca('0x43')]['filter']){_0x530763[_0x33ca('0x4c')]=_[_0x33ca('0x4f')](_0x530763[_0x33ca('0x4c')],{'$or':_[_0x33ca('0x3e')](_0x530763[_0x33ca('0x47')],function(_0xd1af55){var _0x5ef083={};_0x5ef083[_0xd1af55]={'$like':'%'+_0x5394b6[_0x33ca('0x43')][_0x33ca('0x4e')]+'%'};return _0x5ef083;})});}_0x530763=_[_0x33ca('0x4f')]({},_0x530763,_0x5394b6[_0x33ca('0x50')]);return db['Disposition'][_0x33ca('0x2f')]({'where':_0x530763[_0x33ca('0x4c')]})[_0x33ca('0x1e')](function(_0x382ceb){_0x458575[_0x33ca('0x2f')]=_0x382ceb;if(_0x5394b6['query'][_0x33ca('0x57')]){_0x530763[_0x33ca('0x52')]=[{'all':!![]}];}return db[_0x33ca('0x65')][_0x33ca('0x6a')](_0x530763);})[_0x33ca('0x1e')](function(_0x3e5670){_0x458575[_0x33ca('0x53')]=_0x3e5670;return _0x458575;});}})[_0x33ca('0x1e')](respondWithFilteredResult(_0x44f6a5,_0x530763))[_0x33ca('0x29')](handleError(_0x44f6a5,null));};exports[_0x33ca('0x6b')]=function(_0x59f271,_0x2d0cde,_0x13da8a){return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x59f271[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x2d0cde,null))[_0x33ca('0x1e')](function(_0x17482e){if(_0x17482e){return _0x17482e[_0x33ca('0x6b')](_0x59f271[_0x33ca('0x43')][_0x33ca('0x6c')]);}})[_0x33ca('0x1e')](respondWithStatusCode(_0x2d0cde,null))[_0x33ca('0x29')](handleError(_0x2d0cde,null));};exports[_0x33ca('0x6d')]=function(_0x1f259e,_0x5b09dd,_0x2c8983){if(_0x1f259e['body']['id']){delete _0x1f259e[_0x33ca('0x5a')]['id'];}return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x1f259e[_0x33ca('0x62')]['id']}})['then'](handleEntityNotFound(_0x5b09dd,null))[_0x33ca('0x1e')](function(_0x47b8a8){if(_0x47b8a8){_0x1f259e[_0x33ca('0x5a')][_0x33ca('0x64')]=_0x47b8a8['id'];return db[_0x33ca('0x6e')][_0x33ca('0x59')](_0x1f259e['body']);}})[_0x33ca('0x1e')](respondWithResult(_0x5b09dd,null))[_0x33ca('0x29')](handleError(_0x5b09dd,null));};exports[_0x33ca('0x6f')]=function(_0x1f32d4,_0xb0f4c1,_0x3ba385){var _0x7c7523={'raw':![],'where':{}};var _0x602803={};var _0x5d5a49={'count':0x0,'rows':[]};return db[_0x33ca('0x51')][_0x33ca('0x67')]({'where':{'id':_0x1f32d4['params']['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0xb0f4c1,null))[_0x33ca('0x1e')](function(_0x1df048){if(_0x1df048){_0x602803['model']=_[_0x33ca('0x44')](db['CannedAnswer']['rawAttributes']);_0x602803['query']=_[_0x33ca('0x44')](_0x1f32d4[_0x33ca('0x43')]);_0x602803['filters']=_['intersection'](_0x602803['model'],_0x602803[_0x33ca('0x43')]);_0x7c7523[_0x33ca('0x47')]=_[_0x33ca('0x45')](_0x602803['model'],qs[_0x33ca('0x48')](_0x1f32d4[_0x33ca('0x43')][_0x33ca('0x48')]));_0x7c7523[_0x33ca('0x47')]=_0x7c7523[_0x33ca('0x47')][_0x33ca('0x56')]?_0x7c7523[_0x33ca('0x47')]:_0x602803[_0x33ca('0x46')];if(!_0x1f32d4[_0x33ca('0x43')][_0x33ca('0x68')](_0x33ca('0x49'))){_0x7c7523[_0x33ca('0x30')]=qs[_0x33ca('0x30')](_0x1f32d4[_0x33ca('0x43')][_0x33ca('0x30')]);_0x7c7523[_0x33ca('0x2d')]=qs[_0x33ca('0x2d')](_0x1f32d4['query']['offset']);}_0x7c7523['order']=qs['sort'](_0x1f32d4[_0x33ca('0x43')][_0x33ca('0x4b')]);_0x7c7523[_0x33ca('0x4c')]=qs['filters'](_[_0x33ca('0x69')](_0x1f32d4[_0x33ca('0x43')],_0x602803['filters']));_0x7c7523[_0x33ca('0x4c')]['SmsAccountId']=_0x1df048['id'];if(_0x1f32d4[_0x33ca('0x43')][_0x33ca('0x4e')]){_0x7c7523[_0x33ca('0x4c')]=_[_0x33ca('0x4f')](_0x7c7523[_0x33ca('0x4c')],{'$or':_['map'](_0x7c7523[_0x33ca('0x47')],function(_0x27d56c){var _0xdb73a7={};_0xdb73a7[_0x27d56c]={'$like':'%'+_0x1f32d4[_0x33ca('0x43')][_0x33ca('0x4e')]+'%'};return _0xdb73a7;})});}_0x7c7523=_[_0x33ca('0x4f')]({},_0x7c7523,_0x1f32d4[_0x33ca('0x50')]);return db[_0x33ca('0x6e')][_0x33ca('0x2f')]({'where':_0x7c7523[_0x33ca('0x4c')]})[_0x33ca('0x1e')](function(_0x50ff71){_0x5d5a49['count']=_0x50ff71;if(_0x1f32d4[_0x33ca('0x43')][_0x33ca('0x57')]){_0x7c7523[_0x33ca('0x52')]=[{'all':!![]}];}return db[_0x33ca('0x6e')][_0x33ca('0x6a')](_0x7c7523);})[_0x33ca('0x1e')](function(_0x407b18){_0x5d5a49['rows']=_0x407b18;return _0x5d5a49;});}})[_0x33ca('0x1e')](respondWithFilteredResult(_0xb0f4c1,_0x7c7523))['catch'](handleError(_0xb0f4c1,null));};exports[_0x33ca('0x70')]=function(_0x5883de,_0x5c0318,_0x2a410f){return db['SmsAccount'][_0x33ca('0x58')]({'where':{'id':_0x5883de[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x5c0318,null))['then'](function(_0xee2111){if(_0xee2111){return _0xee2111[_0x33ca('0x70')](_0x5883de[_0x33ca('0x43')][_0x33ca('0x6c')]);}})[_0x33ca('0x1e')](respondWithStatusCode(_0x5c0318,null))[_0x33ca('0x29')](handleError(_0x5c0318,null));};exports['notify']=function(_0x19403,_0xb13452,_0x55a2fd){var _0x21f4d3={'channel':_0x33ca('0x71')};var _0xce2f36=[];var _0xe573de=[];var _0x274276={};return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x19403['params']['id']},'include':[{'model':db[_0x33ca('0x72')],'as':_0x33ca('0x73')}]})[_0x33ca('0x1e')](handleEntityNotFound(_0xb13452,null))[_0x33ca('0x1e')](function(_0x17f050){_0x21f4d3['account']=_0x17f050;_0x21f4d3['applications']=_[_0x33ca('0x74')](_0x17f050[_0x33ca('0x73')],[_0x33ca('0x75')],['asc']);if(_0x21f4d3['account'][_0x33ca('0x73')]){delete _0x21f4d3['account'][_0x33ca('0x73')];}return db[_0x33ca('0x76')][_0x33ca('0x63')]();})[_0x33ca('0x1e')](function(_0x175b98){if(!_0x175b98){throw new db[(_0x33ca('0x77'))]['ValidationError'](_0x33ca('0x78'));}_0xce2f36=_[_0x33ca('0x79')](_['keys'](_0x175b98),[_0x33ca('0x7a'),_0x33ca('0x7b')]);_0xe573de=_[_0x33ca('0x79')](_[_0x33ca('0x44')](_0x175b98),['createdAt',_0x33ca('0x7b'),_0x33ca('0x7c'),_0x33ca('0x7d')]);_0x21f4d3[_0x33ca('0x5a')]={'mapKey':_0x33ca('0x7e')};if(_0x21f4d3[_0x33ca('0x7f')][_0x33ca('0x41')]){switch(_0x21f4d3[_0x33ca('0x7f')][_0x33ca('0x41')]){case'twilio':_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x81')];_0x21f4d3[_0x33ca('0x5a')]['body']=_0x19403['body'][_0x33ca('0x82')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x83')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x84')];break;case _0x33ca('0x85'):_0x21f4d3[_0x33ca('0x5a')]['from']='+'+_0x19403[_0x33ca('0x5a')][_0x33ca('0x86')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x87')];break;case'connectel':_0x21f4d3['body'][_0x33ca('0x80')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x80')];_0x21f4d3['body'][_0x33ca('0x5a')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x27')];break;case'clicksend':_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x80')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x5a')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x83')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x88')];break;case _0x33ca('0x89'):_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')]=_0x19403['body'][_0x33ca('0x81')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')]=_0x19403['body'][_0x33ca('0x8a')];_0x21f4d3[_0x33ca('0x5a')]['messageId']=_0x19403[_0x33ca('0x5a')]['MessageUUID'];break;case _0x33ca('0x8b'):_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')]='+'+_0x19403[_0x33ca('0x5a')]['results'][0x0][_0x33ca('0x80')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')]=_0x19403['body'][_0x33ca('0x8c')][0x0][_0x33ca('0x87')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x83')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x8c')][0x0]['messageId'];break;case _0x33ca('0x8d'):_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x8e')];_0x21f4d3['body'][_0x33ca('0x5a')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x8f')]['message'];break;case _0x33ca('0x90'):_0x21f4d3['body'][_0x33ca('0x80')]=_0x19403['body'][_0x33ca('0x91')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')]=_0x19403['body'][_0x33ca('0x87')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x83')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x92')];break;case _0x33ca('0x93'):_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x83')]=_0x19403[_0x33ca('0x5a')][0x0][_0x33ca('0x27')]['id'];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')]=_0x19403['body'][0x0][_0x33ca('0x27')][_0x33ca('0x80')];_0x21f4d3[_0x33ca('0x5a')]['body']=_0x19403[_0x33ca('0x5a')][0x0][_0x33ca('0x27')][_0x33ca('0x87')];break;case _0x33ca('0x94'):_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x80')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')]=_0x19403[_0x33ca('0x5a')][_0x33ca('0x27')];_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x83')]=_0x19403['body'][_0x33ca('0x95')];break;}}if(_0x21f4d3['body']['id']){delete _0x21f4d3[_0x33ca('0x5a')]['id'];}if(_[_0x33ca('0x96')](_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')])){throw new db[(_0x33ca('0x77'))][(_0x33ca('0x97'))](_0x33ca('0x98'));}if(_[_0x33ca('0x96')](_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')])||_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x5a')]===''){throw new db[(_0x33ca('0x77'))][(_0x33ca('0x97'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x33ca('0x96')](_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x99')])){throw new db[(_0x33ca('0x77'))][(_0x33ca('0x97'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe573de);}if(!_[_0x33ca('0x9a')](_0xe573de,_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x99')])){throw new db['Sequelize'][(_0x33ca('0x97'))](_0x33ca('0x9b')+_0xe573de);}_0x274276[_0x21f4d3['body'][_0x33ca('0x99')]]=_0x21f4d3[_0x33ca('0x5a')]['from'];return db[_0x33ca('0x9c')]['find']({'where':{'id':_0x21f4d3[_0x33ca('0x7f')]['ListId']},'include':[{'model':db[_0x33ca('0x76')],'as':_0x33ca('0x9d'),'where':_0x274276,'limit':0x1,'order':[[_0x33ca('0x7b'),'DESC']]}]});})[_0x33ca('0x1e')](handleEntityNotFound(_0xb13452,null))[_0x33ca('0x1e')](function(_0x1cb4fd){if(_0x1cb4fd){_0x21f4d3[_0x33ca('0x9e')]=_['omit'](_0x1cb4fd,[_0x33ca('0x9d')]);if(_0x1cb4fd['Contacts'][_0x33ca('0x56')]){return _0x1cb4fd[_0x33ca('0x9d')][0x0];}var _0x452067=_[_0x33ca('0x19')](_0x21f4d3[_0x33ca('0x5a')],{'firstName':_0x21f4d3[_0x33ca('0x5a')]['from'],'ListId':_0x1cb4fd['id']});_0x452067[_0x21f4d3['body'][_0x33ca('0x99')]]=_0x21f4d3['body'][_0x33ca('0x80')];return db[_0x33ca('0x76')][_0x33ca('0x59')](_0x452067,{'fields':_0xce2f36,'raw':!![]});}})['then'](handleEntityNotFound(_0xb13452,null))[_0x33ca('0x1e')](function(_0x24bd6d){if(_0x24bd6d){_0x21f4d3[_0x33ca('0x9f')]=_0x24bd6d;var _0x4aac77={'ContactId':_0x24bd6d['id'],'phone':_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')],'SmsAccountId':_0x19403[_0x33ca('0x62')]['id']};var _0x309f60={'ContactId':_0x24bd6d['id'],'SmsAccountId':_0x19403[_0x33ca('0x62')]['id'],'closed':![]};return db[_0x33ca('0xa0')][_0x33ca('0x58')]({'where':_0x309f60})['then'](function(_0x265efb){if(_0x265efb){return[_0x265efb,![]];}return db[_0x33ca('0xa0')][_0x33ca('0x59')](_0x4aac77)[_0x33ca('0x1e')](function(_0x39a82f){return[_0x39a82f,!![]];});});}})['spread'](function(_0x2226ce,_0x577fbe){_0x21f4d3['interaction']=_0x2226ce[_0x33ca('0x38')]({'plain':!![]});_0x21f4d3[_0x33ca('0xa1')][_0x33ca('0xa2')]=![];if(_0x577fbe){if(_0x21f4d3['account'][_0x33ca('0xa3')]){_0x21f4d3[_0x33ca('0xa4')][_0x33ca('0xa5')]({'id':0x0,'priority':_0x21f4d3[_0x33ca('0xa4')][_0x33ca('0x56')]+0x1,'app':_0x33ca('0xa6'),'appdata':_0x33ca('0xa7'),'interval':_0x33ca('0xa8')});}_0x21f4d3[_0x33ca('0xa1')][_0x33ca('0xa2')]=!![];}return db['SmsMessage'][_0x33ca('0x59')]({'phone':_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x80')],'messageId':_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0x83')],'body':_0x21f4d3['body'][_0x33ca('0x5a')],'SmsAccountId':_0x19403[_0x33ca('0x62')]['id'],'SmsInteractionId':_0x2226ce['id'],'direction':'in','ContactId':_0x2226ce[_0x33ca('0xa9')],'AttachmentId':_0x21f4d3[_0x33ca('0x5a')][_0x33ca('0xaa')]});})[_0x33ca('0x1e')](function(_0x521487){_0x21f4d3[_0x33ca('0x27')]=_0x521487;if(!_0x21f4d3['interaction'][_0x33ca('0xab')])return;return db[_0x33ca('0xac')]['find']({'attributes':['id',_0x33ca('0x3b')],'where':{'id':_0x21f4d3[_0x33ca('0xa1')][_0x33ca('0xab')]}});})[_0x33ca('0x1e')](function(_0x3945c5){if(_0x3945c5){_0x21f4d3[_0x33ca('0xa4')][_0x33ca('0xad')]({'id':0x0,'priority':0x0,'app':_0x33ca('0xae'),'appdata':_0x3945c5[_0x33ca('0x3b')]+','+(_0x21f4d3[_0x33ca('0x7f')][_0x33ca('0xaf')]||0xa),'interval':_0x33ca('0xa8')});}if(!_0x21f4d3[_0x33ca('0xa1')][_0x33ca('0xb0')])return;return db[_0x33ca('0xb1')][_0x33ca('0x58')]({'attributes':['id','name'],'where':{'id':_0x21f4d3[_0x33ca('0xa1')]['queueId']}});})['then'](function(_0x5ebf67){if(_0x5ebf67){_0x21f4d3[_0x33ca('0xa4')]['unshift']({'id':0x0,'priority':0x1,'app':_0x33ca('0xb2'),'appdata':_0x5ebf67['name']+','+(_0x21f4d3[_0x33ca('0x7f')][_0x33ca('0xb3')]||0x12c),'interval':_0x33ca('0xa8')});}return respondWithRpcPromise(_0x33ca('0xb4'),'startRouting',_0x21f4d3);})[_0x33ca('0x1e')](function(_0x25f9ff){if(_0x25f9ff){var _0x4b5223=0xc8;var _0x790604=_0x33ca('0xb5');logger[_0x33ca('0x1f')](_0x33ca('0x22'),_0x790604,_0x4b5223,_0x33ca('0xb6'));logger[_0x33ca('0x21')](_0x33ca('0xb7'),_0x790604,_0x4b5223,'entity\x20found',JSON['stringify'](_0x25f9ff));if(_0x21f4d3['account'][_0x33ca('0x41')]===_0x33ca('0xb8')){return _0xb13452[_0x33ca('0x2b')](_0x4b5223)[_0x33ca('0x31')]('Content-Type',_0x33ca('0xb9'))[_0x33ca('0xba')](_0x33ca('0xbb'));}else{return _0xb13452['status'](_0x4b5223)[_0x33ca('0x33')](_0x25f9ff);}}})[_0x33ca('0x29')](handleError(_0xb13452,null));};exports[_0x33ca('0xbc')]=function(_0x4955c2,_0xff8482){var _0x54b11c=_0x4955c2[_0x33ca('0x62')]['id'];var _0x40238b=_0x4955c2[_0x33ca('0x5a')];var _0x1a0b17=0xc8;var _0x4a4bbe=null;return db['sequelize']['transaction']({'isolationLevel':db['sequelize']['Transaction'][_0x33ca('0xbd')][_0x33ca('0xbe')]},function(_0xed599e){return db[_0x33ca('0x51')]['findOne']({'where':{'id':_0x54b11c},'transaction':_0xed599e})[_0x33ca('0x1e')](function(_0x396f05){if(_0x396f05){return db[_0x33ca('0x72')][_0x33ca('0x37')]({'where':{'SmsAccountId':_0x54b11c},'transaction':_0xed599e})[_0x33ca('0x1e')](function(){var _0x45fc31=_[_0x33ca('0x3e')](_0x40238b,function(_0x149549){_0x149549['SmsAccountId']=_0x54b11c;return _0x149549;});return db[_0x33ca('0x72')][_0x33ca('0xbf')](_0x45fc31,{'transaction':_0xed599e});});}else{_0x1a0b17=0x194;_0x4a4bbe=[];}});})['then'](function(){if(_0x1a0b17!==0x194){return db[_0x33ca('0x72')][_0x33ca('0xc0')]({'where':{'SmsAccountId':_0x54b11c},'order':_0x33ca('0x75')})[_0x33ca('0x1e')](function(_0xf80a39){_0x4a4bbe=_0xf80a39;});}})[_0x33ca('0x29')](function(_0x3b2570){_0x1a0b17=0x1f4;logger[_0x33ca('0x24')](_0x3b2570[_0x33ca('0x3a')]);if(_0x3b2570[_0x33ca('0x3b')]){delete _0x3b2570[_0x33ca('0x3b')];}_0x4a4bbe=_0x3b2570;})['finally'](function(){if(_0x4a4bbe===null){_0xff8482['sendStatus'](_0x1a0b17);}else{if(_0x1a0b17===0x1f4){_0xff8482[_0x33ca('0x2b')](_0x1a0b17)[_0x33ca('0xba')](_0x4a4bbe);}else{_0xff8482['status'](_0x1a0b17)[_0x33ca('0x33')](_0x4a4bbe);}}});};exports['getApplications']=function(_0x5c06f6,_0x5a7665,_0x2fdd7d){var _0x2bf8e4={};var _0x5f121e={};var _0x5a6da3;var _0x7469db;return db[_0x33ca('0x51')][_0x33ca('0x67')]({'where':{'id':_0x5c06f6[_0x33ca('0x62')]['id']}})['then'](handleEntityNotFound(_0x5a7665,null))[_0x33ca('0x1e')](function(_0x5882fc){if(_0x5882fc){_0x5a6da3=_0x5882fc;_0x5f121e['model']=_[_0x33ca('0x44')](db[_0x33ca('0x72')][_0x33ca('0x3f')]);_0x5f121e[_0x33ca('0x43')]=_[_0x33ca('0x44')](_0x5c06f6['query']);_0x5f121e['filters']=_[_0x33ca('0x45')](_0x5f121e[_0x33ca('0x46')],_0x5f121e[_0x33ca('0x43')]);_0x2bf8e4[_0x33ca('0x47')]=_[_0x33ca('0x45')](_0x5f121e['model'],qs[_0x33ca('0x48')](_0x5c06f6[_0x33ca('0x43')][_0x33ca('0x48')]));_0x2bf8e4[_0x33ca('0x47')]=_0x2bf8e4[_0x33ca('0x47')][_0x33ca('0x56')]?_0x2bf8e4[_0x33ca('0x47')]:_0x5f121e[_0x33ca('0x46')];_0x2bf8e4[_0x33ca('0x4a')]=qs['sort'](_0x5c06f6[_0x33ca('0x43')][_0x33ca('0x4b')]);_0x2bf8e4[_0x33ca('0x4c')]=qs[_0x33ca('0x4d')](_['pick'](_0x5c06f6[_0x33ca('0x43')],_0x5f121e[_0x33ca('0x4d')]));if(_0x5c06f6[_0x33ca('0x43')][_0x33ca('0x4e')]){_0x2bf8e4[_0x33ca('0x4c')]=_[_0x33ca('0x4f')](_0x2bf8e4['where'],{'$or':_['map'](_0x2bf8e4[_0x33ca('0x47')],function(_0x5d99e1){var _0x1fba29={};_0x1fba29[_0x5d99e1]={'$like':'%'+_0x5c06f6['query'][_0x33ca('0x4e')]+'%'};return _0x1fba29;})});}_0x2bf8e4=_['merge']({},_0x2bf8e4,_0x5c06f6[_0x33ca('0x50')]);return _0x5a6da3[_0x33ca('0xc1')](_0x2bf8e4);}})['then'](function(_0x1ccda0){if(_0x1ccda0){_0x7469db=_0x1ccda0['length'];if(!_0x5c06f6[_0x33ca('0x43')]['hasOwnProperty'](_0x33ca('0x49'))){_0x2bf8e4[_0x33ca('0x30')]=qs[_0x33ca('0x30')](_0x5c06f6['query']['limit']);_0x2bf8e4[_0x33ca('0x2d')]=qs[_0x33ca('0x2d')](_0x5c06f6[_0x33ca('0x43')][_0x33ca('0x2d')]);}return _0x5a6da3[_0x33ca('0xc1')](_0x2bf8e4);}})[_0x33ca('0x1e')](function(_0x54cb35){if(_0x54cb35){return _0x54cb35?{'count':_0x7469db,'rows':_0x54cb35}:null;}})[_0x33ca('0x1e')](respondWithResult(_0x5a7665,null))[_0x33ca('0x29')](handleError(_0x5a7665,null));};exports[_0x33ca('0xc2')]=function(_0x575dca,_0x154e4f,_0x567a9f){var _0x7a6c11={'raw':![],'where':{}};var _0x39a891={};var _0x292c20={'count':0x0,'rows':[]};return db[_0x33ca('0x51')][_0x33ca('0x67')]({'where':{'id':_0x575dca[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x154e4f,null))[_0x33ca('0x1e')](function(_0x1b701e){if(_0x1b701e){_0x39a891[_0x33ca('0x46')]=_[_0x33ca('0x44')](db[_0x33ca('0xa0')][_0x33ca('0x3f')]);_0x39a891['query']=_[_0x33ca('0x44')](_0x575dca[_0x33ca('0x43')]);_0x39a891[_0x33ca('0x4d')]=_['intersection'](_0x39a891['model'],_0x39a891['query']);_0x7a6c11['attributes']=_[_0x33ca('0x45')](_0x39a891[_0x33ca('0x46')],qs[_0x33ca('0x48')](_0x575dca['query'][_0x33ca('0x48')]));_0x7a6c11[_0x33ca('0x47')]=_0x7a6c11[_0x33ca('0x47')]['length']?_0x7a6c11[_0x33ca('0x47')]:_0x39a891['model'];if(!_0x575dca['query'][_0x33ca('0x68')]('nolimit')){_0x7a6c11[_0x33ca('0x30')]=qs['limit'](_0x575dca['query'][_0x33ca('0x30')]);_0x7a6c11[_0x33ca('0x2d')]=qs[_0x33ca('0x2d')](_0x575dca['query'][_0x33ca('0x2d')]);}_0x7a6c11[_0x33ca('0x4a')]=qs[_0x33ca('0x4b')](_0x575dca[_0x33ca('0x43')]['sort']);_0x7a6c11[_0x33ca('0x4c')]=qs[_0x33ca('0x4d')](_[_0x33ca('0x69')](_0x575dca[_0x33ca('0x43')],_0x39a891[_0x33ca('0x4d')]));_0x7a6c11['where'][_0x33ca('0x64')]=_0x1b701e['id'];if(_0x575dca[_0x33ca('0x43')]['filter']){_0x7a6c11[_0x33ca('0x4c')]=_['merge'](_0x7a6c11[_0x33ca('0x4c')],{'$or':_[_0x33ca('0x3e')](_0x7a6c11[_0x33ca('0x47')],function(_0x5bfe11){var _0x5e4764={};_0x5e4764[_0x5bfe11]={'$like':'%'+_0x575dca[_0x33ca('0x43')][_0x33ca('0x4e')]+'%'};return _0x5e4764;})});}_0x7a6c11=_['merge']({},_0x7a6c11,_0x575dca[_0x33ca('0x50')]);return db['SmsInteraction']['count']({'where':_0x7a6c11['where']})['then'](function(_0x54ac64){_0x292c20[_0x33ca('0x2f')]=_0x54ac64;if(_0x575dca[_0x33ca('0x43')][_0x33ca('0x57')]){_0x7a6c11[_0x33ca('0x52')]=[{'model':db[_0x33ca('0x76')],'as':_0x33ca('0xc3'),'required':![]},{'model':db[_0x33ca('0xac')],'as':_0x33ca('0xc4'),'attributes':[_0x33ca('0x3b'),_0x33ca('0xc5'),'internal'],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x33ca('0x3b'),'color'],'where':_0x575dca['query']['tag']?{'id':_0x575dca['query'][_0x33ca('0xc6')]}:undefined,'required':_0x575dca['query'][_0x33ca('0xc6')]?!![]:![]}];}return db['SmsInteraction'][_0x33ca('0x6a')](_0x7a6c11);})[_0x33ca('0x1e')](function(_0xbb59b6){_0x292c20[_0x33ca('0x53')]=_0xbb59b6;return _0x292c20;});}})['then'](respondWithFilteredResult(_0x154e4f,_0x7a6c11))[_0x33ca('0x29')](handleError(_0x154e4f,null));};exports[_0x33ca('0xba')]=function(_0x25604a,_0x5b7471,_0x1e8d69){var _0x361020,_0x209d37,_0x4264e4;if(_['isNil'](_0x25604a['body']['body'])||_0x25604a[_0x33ca('0x5a')][_0x33ca('0x5a')]===''){throw new db[(_0x33ca('0x77'))][(_0x33ca('0x97'))](_0x33ca('0xc7'));}if(_['isNil'](_0x25604a[_0x33ca('0x5a')]['to'])){throw new db[(_0x33ca('0x77'))]['ValidationError'](_0x33ca('0xc8'));}_0x361020=_0x25604a['body']['to'];return db['SmsAccount'][_0x33ca('0x58')]({'where':{'id':_0x25604a['params']['id']},'include':[{'model':db[_0x33ca('0x9c')],'as':_0x33ca('0xc9'),'include':[{'model':db[_0x33ca('0x76')],'as':'Contacts','where':{'mobile':_0x361020},'limit':0x1,'order':[[_0x33ca('0x7b'),_0x33ca('0xca')]]}]}]})[_0x33ca('0x1e')](handleEntityNotFound(_0x5b7471,null))['then'](function(_0xc52b50){if(_0xc52b50&&_0xc52b50[_0x33ca('0xc9')]){_0x209d37=_0xc52b50['get']({'plain':!![]});if(_0x209d37['List']&&_0x209d37[_0x33ca('0xc9')][_0x33ca('0x9d')]['length']){return _0x209d37[_0x33ca('0xc9')][_0x33ca('0x9d')][0x0];}return db['CmContact'][_0x33ca('0x59')](_[_0x33ca('0x19')](_0x25604a[_0x33ca('0x5a')],{'firstName':_0x361020,'mobile':_0x361020,'phone':_0x361020,'ListId':_0x209d37[_0x33ca('0x7d')]}));}})['then'](handleEntityNotFound(_0x5b7471,null))['then'](function(_0x14a8b5){if(_0x14a8b5){_0x4264e4=_0x14a8b5;return db[_0x33ca('0xa0')][_0x33ca('0x58')]({'where':{'ContactId':_0x4264e4['id'],'closed':![],'SmsAccountId':_0x209d37['id']}})[_0x33ca('0x1e')](function(_0x457b6d){if(_0x457b6d){return[_0x457b6d,![]];}return db[_0x33ca('0xa0')][_0x33ca('0x59')]({'UserId':_0x25604a[_0x33ca('0x5b')]['id'],'ContactId':_0x4264e4['id'],'SmsAccountId':_0x209d37['id'],'phone':_0x361020,'firstMsgDirection':_0x33ca('0xcb'),'Messages':[_[_0x33ca('0x4f')](_0x25604a[_0x33ca('0x5a')],{'read':![],'body':_0x25604a['body']['body'],'phone':_0x361020,'SmsAccountId':_0x209d37['id'],'UserId':_0x25604a['user']['id'],'ContactId':_0x4264e4['id']})]},{'include':[{'model':db[_0x33ca('0xcc')],'as':_0x33ca('0xcd')}]})[_0x33ca('0x1e')](function(_0x4ec152){return[_0x4ec152,!![]];});});}})[_0x33ca('0xce')](function(_0x46a53f,_0x504457){if(_0x504457){return _0x46a53f;}return db[_0x33ca('0xcc')][_0x33ca('0x59')](_[_0x33ca('0x4f')](_0x25604a[_0x33ca('0x5a')],{'read':![],'body':_0x25604a[_0x33ca('0x5a')][_0x33ca('0x5a')],'phone':_0x361020,'SmsAccountId':_0x209d37['id'],'SmsInteractionId':_0x46a53f['id'],'UserId':_0x25604a[_0x33ca('0x5b')]['id'],'ContactId':_0x4264e4['id']}))[_0x33ca('0x1e')](function(_0x40ef5f){_0x46a53f['dataValues'][_0x33ca('0xcd')]=[];_0x46a53f[_0x33ca('0xcf')][_0x33ca('0xcd')]['push'](_0x40ef5f[_0x33ca('0xcf')]);return _0x46a53f;});})[_0x33ca('0x1e')](respondWithResult(_0x5b7471,null))[_0x33ca('0x29')](handleError(_0x5b7471,null));};exports['status']=function(_0x1b4b4e,_0x945aa2,_0x4ac912){if(_0x1b4b4e[_0x33ca('0x5a')]['id']){delete _0x1b4b4e[_0x33ca('0x5a')]['id'];}var _0x190b6e,_0x5d23cb,_0x48ee5a;return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x1b4b4e[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x945aa2,null))[_0x33ca('0x1e')](function(_0x810dcf){if(_0x810dcf){_0x48ee5a=_0x810dcf;logger[_0x33ca('0x21')](_0x33ca('0x22'),'status',_0x33ca('0xd0'),_0x810dcf[_0x33ca('0x41')],util[_0x33ca('0xd1')](_0x1b4b4e[_0x33ca('0x5a')],{'showHidden':![],'depth':null}));switch(_0x810dcf[_0x33ca('0x41')]){case'skebby':if(_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd2')]&&_0x1b4b4e[_0x33ca('0x5a')]['status']){_0x5d23cb=_0x1b4b4e['body']['status'];return db[_0x33ca('0xcc')][_0x33ca('0x58')]({'where':{'messageId':_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd2')]}});}break;case'connectel':if(_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd3')]&&_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd4')]){_0x5d23cb=_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd4')];return db[_0x33ca('0xcc')]['find']({'where':{'messageId':_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd3')]}});}break;case _0x33ca('0xd5'):if(_0x1b4b4e['body'][_0x33ca('0x88')]&&_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd6')]){_0x5d23cb=_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd6')];return db[_0x33ca('0xcc')][_0x33ca('0x58')]({'where':{'messageId':_0x1b4b4e['body']['message_id']}});}break;case'infobip':var _0x829b28=_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0x8c')][0x0];if(_0x829b28[_0x33ca('0x83')]&&_0x829b28[_0x33ca('0x2b')]['groupName']===_0x33ca('0xd7')){_0x5d23cb=_0x829b28[_0x33ca('0x2b')][_0x33ca('0xd8')];return db[_0x33ca('0xcc')]['find']({'where':{'messageId':_0x829b28[_0x33ca('0x83')]}});}break;case _0x33ca('0x90'):if(_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0x83')]&&_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0x2b')]){_0x5d23cb=_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0x2b')];return db['SmsMessage'][_0x33ca('0x58')]({'where':{'messageId':_0x1b4b4e['body'][_0x33ca('0x83')]}});}break;case _0x33ca('0x93'):if(_0x1b4b4e['body'][0x0][_0x33ca('0x27')]['id']){_0x5d23cb=_0x1b4b4e[_0x33ca('0x5a')][0x0][_0x33ca('0x41')];return db['SmsMessage'][_0x33ca('0x58')]({'where':{'messageId':_0x1b4b4e['body'][0x0][_0x33ca('0x27')]['id']}});}break;case _0x33ca('0x94'):if(_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0xd9')]&&_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0x2b')]){_0x5d23cb=_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0x2b')];return db[_0x33ca('0xcc')][_0x33ca('0x58')]({'where':{'messageId':_0x1b4b4e['body'][_0x33ca('0xd9')]}});}break;}}})[_0x33ca('0x1e')](handleEntityNotFound(_0x945aa2,null))['then'](function(_0x42fac0){if(_0x42fac0){_0x190b6e=_0x42fac0;switch(_0x48ee5a[_0x33ca('0x41')]){case _0x33ca('0x85'):if(_0x5d23cb===_0x33ca('0xd7')){return _0x190b6e[_0x33ca('0x36')]({'read':!![]});}else{logger[_0x33ca('0x24')](_0x33ca('0x22'),_0x33ca('0x2b'),_0x33ca('0x85'),util[_0x33ca('0xd1')](_0x1b4b4e['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5d23cb==='1'){return _0x190b6e['update']({'read':!![]});}else{logger[_0x33ca('0x24')](_0x33ca('0x22'),_0x33ca('0x2b'),_0x33ca('0x85'),util['inspect'](_0x1b4b4e['body'],{'showHidden':![],'depth':null}));}break;case _0x33ca('0xd5'):if(!_0x1b4b4e['body']['error_code']&&_0x5d23cb>=0xc8&&_0x5d23cb<=0xce){return _0x190b6e[_0x33ca('0x36')]({'read':!![]});}else{logger[_0x33ca('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x33ca('0x2b'),_0x33ca('0xd5'),util['inspect'](_0x1b4b4e[_0x33ca('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x33ca('0x8b'):var _0x3f53df=_0x1b4b4e[_0x33ca('0x5a')][_0x33ca('0x8c')][0x0];if(_0x3f53df[_0x33ca('0x2b')][_0x33ca('0xd8')]===_0x33ca('0xd7')){return _0x190b6e[_0x33ca('0x36')]({'read':!![]});}else{logger[_0x33ca('0x24')](_0x33ca('0x22'),_0x33ca('0x2b'),_0x33ca('0x8b'),util[_0x33ca('0xd1')](_0x1b4b4e[_0x33ca('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x33ca('0x90'):if(_0x5d23cb==_0x33ca('0xda')||_0x5d23cb==_0x33ca('0xdb')){return _0x190b6e['update']({'read':!![]});}else{logger[_0x33ca('0x24')](_0x33ca('0x22'),_0x33ca('0x2b'),_0x33ca('0x90'),util[_0x33ca('0xd1')](_0x1b4b4e[_0x33ca('0x5a')],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x5d23cb==_0x33ca('0xdc')){return _0x190b6e['update']({'read':!![]});}else{logger[_0x33ca('0x24')](_0x33ca('0x22'),'status',_0x33ca('0x93'),util[_0x33ca('0xd1')](_0x1b4b4e[_0x33ca('0x5a')],{'showHidden':![],'depth':null}));}break;case _0x33ca('0x94'):if(_0x5d23cb==='DELIVRD'||_0x5d23cb===_0x33ca('0xdd')){return _0x190b6e['update']({'read':!![]});}else{logger[_0x33ca('0x24')](_0x33ca('0x22'),_0x33ca('0x2b'),_0x33ca('0x94'),util[_0x33ca('0xd1')](_0x1b4b4e[_0x33ca('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x190b6e;}})[_0x33ca('0x1e')](respondWithResult(_0x945aa2,null))['catch'](handleError(_0x945aa2,null));};exports[_0x33ca('0xde')]=function(_0x6e1ce3,_0x29d1dd,_0x400a03){var _0x429fc1,_0x10a75c,_0x98997f;return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x6e1ce3[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x29d1dd,null))[_0x33ca('0x1e')](function(_0x203cc5){if(_0x203cc5){_0x98997f=_0x203cc5;logger[_0x33ca('0x21')](_0x33ca('0x22'),_0x33ca('0x2b'),_0x33ca('0xd0'),_0x203cc5['type'],util[_0x33ca('0xd1')](_0x6e1ce3[_0x33ca('0x43')],{'showHidden':![],'depth':null}));switch(_0x203cc5[_0x33ca('0x41')]){case _0x33ca('0x8d'):if(_0x6e1ce3['query'][_0x33ca('0xdf')]&&_0x6e1ce3[_0x33ca('0x43')]['state']){_0x10a75c=_0x6e1ce3[_0x33ca('0x43')][_0x33ca('0xe0')];return db[_0x33ca('0xcc')][_0x33ca('0x58')]({'where':{'messageId':_0x6e1ce3['query'][_0x33ca('0xdf')]}});}break;}}})[_0x33ca('0x1e')](handleEntityNotFound(_0x29d1dd,null))[_0x33ca('0x1e')](function(_0x26275b){if(_0x26275b){_0x429fc1=_0x26275b;switch(_0x98997f[_0x33ca('0x41')]){case _0x33ca('0x8d'):if(_0x10a75c==='2'||_0x10a75c==='6'){return _0x429fc1[_0x33ca('0x36')]({'read':!![]});}else{logger[_0x33ca('0x24')](_0x33ca('0x22'),_0x33ca('0x2b'),'csc',util[_0x33ca('0xd1')](_0x6e1ce3[_0x33ca('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x429fc1;}})['then'](respondWithResult(_0x29d1dd,null))['catch'](handleError(_0x29d1dd,null));};exports[_0x33ca('0xe1')]=function(_0x2d9ffb,_0x2898c5,_0x52bbbf){return db[_0x33ca('0x51')][_0x33ca('0x58')]({'where':{'id':_0x2d9ffb[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x2898c5,null))[_0x33ca('0x1e')](function(_0x21ea13){if(_0x21ea13){return _0x21ea13['addAgents'](_0x2d9ffb[_0x33ca('0x5a')][_0x33ca('0x6c')],_['omit'](_0x2d9ffb[_0x33ca('0x5a')],[_0x33ca('0x6c'),'id'])||{})['spread'](function(_0x2ea75d){for(var _0x3b4b4c=0x0;_0x3b4b4c<_0x2d9ffb[_0x33ca('0x5a')][_0x33ca('0x6c')][_0x33ca('0x56')];_0x3b4b4c+=0x1){socket[_0x33ca('0xe2')]('userSmsAccount:save',{'UserId':Number(_0x2d9ffb['body'][_0x33ca('0x6c')][_0x3b4b4c]),'SmsAccountId':Number(_0x2d9ffb[_0x33ca('0x62')]['id'])});}return _0x2ea75d;});}})['then'](respondWithResult(_0x2898c5,null))[_0x33ca('0x29')](handleError(_0x2898c5,null));};exports[_0x33ca('0xe3')]=function(_0x96681d,_0x21bdce,_0x59a1e2){return db[_0x33ca('0x51')]['find']({'where':{'id':_0x96681d[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x21bdce,null))['then'](function(_0x3828f2){if(_0x3828f2){return _0x3828f2['removeAgents'](_0x96681d[_0x33ca('0x43')][_0x33ca('0x6c')])[_0x33ca('0x1e')](function(){if(_['isArray'](_0x96681d[_0x33ca('0x43')][_0x33ca('0x6c')])){for(var _0x22cc83=0x0;_0x22cc83<_0x96681d[_0x33ca('0x43')][_0x33ca('0x6c')]['length'];_0x22cc83+=0x1){socket[_0x33ca('0xe2')](_0x33ca('0xe4'),{'UserId':Number(_0x96681d[_0x33ca('0x43')][_0x33ca('0x6c')][_0x22cc83]),'SmsAccountId':Number(_0x96681d['params']['id'])});}}else{socket[_0x33ca('0xe2')](_0x33ca('0xe4'),{'UserId':Number(_0x96681d[_0x33ca('0x43')][_0x33ca('0x6c')]),'SmsAccountId':Number(_0x96681d['params']['id'])});}});}})[_0x33ca('0x1e')](respondWithStatusCode(_0x21bdce,null))[_0x33ca('0x29')](handleError(_0x21bdce,null));};exports[_0x33ca('0xe5')]=function(_0x12b595,_0x177eba,_0x54aedb){var _0x168b86={};var _0x46f484={};var _0x3bff6e;var _0x3896aa;return db[_0x33ca('0x51')][_0x33ca('0x67')]({'where':{'id':_0x12b595[_0x33ca('0x62')]['id']}})[_0x33ca('0x1e')](handleEntityNotFound(_0x177eba,null))[_0x33ca('0x1e')](function(_0x2c6eb5){if(_0x2c6eb5){_0x3bff6e=_0x2c6eb5;_0x46f484[_0x33ca('0x46')]=_[_0x33ca('0x44')](db['User'][_0x33ca('0x3f')]);_0x46f484[_0x33ca('0x43')]=_['keys'](_0x12b595[_0x33ca('0x43')]);_0x46f484[_0x33ca('0x4d')]=_[_0x33ca('0x45')](_0x46f484['model'],_0x46f484['query']);_0x168b86[_0x33ca('0x47')]=_['intersection'](_0x46f484[_0x33ca('0x46')],qs['fields'](_0x12b595[_0x33ca('0x43')][_0x33ca('0x48')]));_0x168b86['attributes']=_0x168b86[_0x33ca('0x47')][_0x33ca('0x56')]?_0x168b86['attributes']:_0x46f484[_0x33ca('0x46')];_0x168b86['order']=qs['sort'](_0x12b595[_0x33ca('0x43')][_0x33ca('0x4b')]);_0x168b86[_0x33ca('0x4c')]=qs[_0x33ca('0x4d')](_[_0x33ca('0x69')](_0x12b595['query'],_0x46f484[_0x33ca('0x4d')]));if(_0x12b595['query']['filter']){_0x168b86[_0x33ca('0x4c')]=_[_0x33ca('0x4f')](_0x168b86[_0x33ca('0x4c')],{'$or':_['map'](_0x168b86[_0x33ca('0x47')],function(_0xd18cfb){var _0x561957={};_0x561957[_0xd18cfb]={'$like':'%'+_0x12b595[_0x33ca('0x43')][_0x33ca('0x4e')]+'%'};return _0x561957;})});}_0x168b86=_['merge']({},_0x168b86,_0x12b595[_0x33ca('0x50')]);return _0x3bff6e[_0x33ca('0xe5')](_0x168b86);}})[_0x33ca('0x1e')](function(_0x1e3020){if(_0x1e3020){_0x3896aa=_0x1e3020['length'];if(!_0x12b595['query']['hasOwnProperty'](_0x33ca('0x49'))){_0x168b86[_0x33ca('0x30')]=qs['limit'](_0x12b595[_0x33ca('0x43')]['limit']);_0x168b86[_0x33ca('0x2d')]=qs[_0x33ca('0x2d')](_0x12b595['query'][_0x33ca('0x2d')]);}return _0x3bff6e[_0x33ca('0xe5')](_0x168b86);}})[_0x33ca('0x1e')](function(_0x814302){if(_0x814302){return _0x814302?{'count':_0x3896aa,'rows':_0x814302}:null;}})[_0x33ca('0x1e')](respondWithResult(_0x177eba,null))[_0x33ca('0x29')](handleError(_0x177eba,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 048de36..43b41de 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 _0x4a51=['emit','hook','../../mysqldb','setMaxListeners','save','remove'];(function(_0x3936e2,_0x583b33){var _0x2c9a38=function(_0x3316eb){while(--_0x3316eb){_0x3936e2['push'](_0x3936e2['shift']());}};_0x2c9a38(++_0x583b33);}(_0x4a51,0x68));var _0x14a5=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x4a51[_0xdea41a];return _0x15d0d8;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0x14a5('0x0'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x14a5('0x1')](0x0);var events={'afterCreate':_0x14a5('0x2'),'afterUpdate':'update','afterDestroy':_0x14a5('0x3')};function emitEvent(_0x2eb29a){return function(_0x44e37a,_0x419575,_0x1e0d16){SmsAccountEvents[_0x14a5('0x4')](_0x2eb29a+':'+_0x44e37a['id'],_0x44e37a);SmsAccountEvents[_0x14a5('0x4')](_0x2eb29a,_0x44e37a);_0x1e0d16(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0x14a5('0x5')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file +var _0x815a=['exports','events','SmsAccount','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x56405a,_0x2491cf){var _0x54c664=function(_0x29a081){while(--_0x29a081){_0x56405a['push'](_0x56405a['shift']());}};_0x54c664(++_0x2491cf);}(_0x815a,0x1a9));var _0xa815=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x815a[_0x5c351c];return _0x26f3b3;};'use strict';var EventEmitter=require(_0xa815('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0xa815('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xa815('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa815('0x3'),'afterDestroy':_0xa815('0x4')};function emitEvent(_0x4409ea){return function(_0x59b9db,_0x43ffbd,_0x135eab){SmsAccountEvents[_0xa815('0x5')](_0x4409ea+':'+_0x59b9db['id'],_0x59b9db);SmsAccountEvents['emit'](_0x4409ea,_0x59b9db);_0x135eab(null);};}for(var e in events){if(events[_0xa815('0x6')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0xa815('0x7')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 906689b..dce474e 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 _0x96da=['define','SmsAccount','sms_accounts','../../config/logger','moment','bluebird','path','../../config/environment','./smsAccount.attributes'];(function(_0x4f154e,_0x4b8dff){var _0x5b8e65=function(_0x294982){while(--_0x294982){_0x4f154e['push'](_0x4f154e['shift']());}};_0x5b8e65(++_0x4b8dff);}(_0x96da,0x198));var _0xa96d=function(_0x2a9bda,_0x24f266){_0x2a9bda=_0x2a9bda-0x0;var _0x4fc04c=_0x96da[_0x2a9bda];return _0x4fc04c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa96d('0x0'))('api');var moment=require(_0xa96d('0x1'));var BPromise=require(_0xa96d('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa96d('0x3'));var rimraf=require('rimraf');var config=require(_0xa96d('0x4'));var attributes=require(_0xa96d('0x5'));module['exports']=function(_0x256bfb,_0x163af0){return _0x256bfb[_0xa96d('0x6')](_0xa96d('0x7'),attributes,{'tableName':_0xa96d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x977c=['../../config/environment','./smsAccount.attributes','define','SmsAccount','sms_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x977c,0x171));var _0xc977=function(_0x16ce96,_0x11bbf7){_0x16ce96=_0x16ce96-0x0;var _0x9ec268=_0x977c[_0x16ce96];return _0x9ec268;};'use strict';var _=require('lodash');var util=require(_0xc977('0x0'));var logger=require(_0xc977('0x1'))(_0xc977('0x2'));var moment=require(_0xc977('0x3'));var BPromise=require(_0xc977('0x4'));var rp=require(_0xc977('0x5'));var fs=require('fs');var path=require(_0xc977('0x6'));var rimraf=require(_0xc977('0x7'));var config=require(_0xc977('0x8'));var attributes=require(_0xc977('0x9'));module['exports']=function(_0x282714,_0x4ffdbd){return _0x282714[_0xc977('0xa')](_0xc977('0xb'),attributes,{'tableName':_0xc977('0xc'),'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 3907085..1e059e5 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 _0x0ac6=['redis','localhost','socket.io-emitter','register','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','map','include','model','then','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0ac6,0x1bd));var _0x60ac=function(_0x225b38,_0x5bc4d9){_0x225b38=_0x225b38-0x0;var _0x1dcb19=_0x0ac6[_0x225b38];return _0x1dcb19;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x60ac('0x0'));var BPromise=require(_0x60ac('0x1'));var rs=require(_0x60ac('0x2'));var fs=require('fs');var Redis=require(_0x60ac('0x3'));var db=require(_0x60ac('0x4'))['db'];var utils=require(_0x60ac('0x5'));var logger=require(_0x60ac('0x6'))(_0x60ac('0x7'));var config=require(_0x60ac('0x8'));var jayson=require(_0x60ac('0x9'));var client=jayson['client'][_0x60ac('0xa')]({'port':0x232a});config[_0x60ac('0xb')]=_['defaults'](config['redis'],{'host':_0x60ac('0xc'),'port':0x18eb});var socket=require(_0x60ac('0xd'))(new Redis(config[_0x60ac('0xb')]));require('./smsAccount.socket')[_0x60ac('0xe')](socket);function respondWithRpcPromise(_0x3a922f,_0x1d312b,_0x15fc33){return new BPromise(function(_0x41ac68,_0x2ec3fa){return client[_0x60ac('0xf')](_0x3a922f,_0x15fc33)['then'](function(_0x18f3b7){logger[_0x60ac('0x10')](_0x60ac('0x11'),_0x1d312b,_0x60ac('0x12'));logger[_0x60ac('0x13')](_0x60ac('0x14'),_0x1d312b,_0x60ac('0x12'),JSON[_0x60ac('0x15')](_0x18f3b7));if(_0x18f3b7[_0x60ac('0x16')]){if(_0x18f3b7[_0x60ac('0x16')][_0x60ac('0x17')]===0x1f4){logger['error'](_0x60ac('0x11'),_0x1d312b,_0x18f3b7[_0x60ac('0x16')]['message']);return _0x2ec3fa(_0x18f3b7['error'][_0x60ac('0x18')]);}logger[_0x60ac('0x16')](_0x60ac('0x11'),_0x1d312b,_0x18f3b7[_0x60ac('0x16')][_0x60ac('0x18')]);return _0x41ac68(_0x18f3b7[_0x60ac('0x16')][_0x60ac('0x18')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x1d312b,_0x60ac('0x12'));_0x41ac68(_0x18f3b7[_0x60ac('0x19')]['message']);}})[_0x60ac('0x1a')](function(_0x56d3eb){logger[_0x60ac('0x16')]('SmsAccount,\x20%s,\x20%s',_0x1d312b,_0x56d3eb);_0x2ec3fa(_0x56d3eb);});});}exports[_0x60ac('0x1b')]=function(_0x14d1dc){var _0x41e6c9=this;return new Promise(function(_0x1b2ca3,_0x14ab38){return db[_0x60ac('0x1c')][_0x60ac('0x1d')]({'raw':_0x14d1dc[_0x60ac('0x1e')]?_0x14d1dc[_0x60ac('0x1e')][_0x60ac('0x1f')]===undefined?!![]:![]:!![],'where':_0x14d1dc[_0x60ac('0x1e')]?_0x14d1dc[_0x60ac('0x1e')][_0x60ac('0x20')]||null:null,'attributes':_0x14d1dc[_0x60ac('0x1e')]?_0x14d1dc[_0x60ac('0x1e')][_0x60ac('0x21')]||null:null,'include':_0x14d1dc['options']?_0x14d1dc[_0x60ac('0x1e')]['include']?_[_0x60ac('0x22')](_0x14d1dc[_0x60ac('0x1e')][_0x60ac('0x23')],function(_0x3c4b4a){return{'model':db[_0x3c4b4a['model']],'as':_0x3c4b4a['as'],'attributes':_0x3c4b4a[_0x60ac('0x21')],'include':_0x3c4b4a[_0x60ac('0x23')]?_['map'](_0x3c4b4a[_0x60ac('0x23')],function(_0x404ccb){return{'model':db[_0x404ccb['model']],'as':_0x404ccb['as'],'attributes':_0x404ccb[_0x60ac('0x21')],'include':_0x404ccb['include']?_[_0x60ac('0x22')](_0x404ccb[_0x60ac('0x23')],function(_0x415383){return{'model':db[_0x415383[_0x60ac('0x24')]],'as':_0x415383['as'],'attributes':_0x415383[_0x60ac('0x21')]};}):[]};}):[]};}):[]:[]})[_0x60ac('0x25')](function(_0x341064){logger[_0x60ac('0x10')](_0x60ac('0x1b'),_0x14d1dc);logger['debug']('ShowSmsAccount',_0x14d1dc,JSON[_0x60ac('0x15')](_0x341064));_0x1b2ca3(_0x341064);})[_0x60ac('0x1a')](function(_0x131342){logger[_0x60ac('0x16')](_0x60ac('0x1b'),_0x131342[_0x60ac('0x18')],_0x14d1dc);_0x14ab38(_0x41e6c9['error'](0x1f4,_0x131342[_0x60ac('0x18')]));});});}; \ No newline at end of file +var _0xfcbe=['ioredis','../../mysqldb','../../config/utils','../../config/environment','http','redis','defaults','localhost','register','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','catch','find','options','where','attributes','include','model','ShowSmsAccount','bluebird','randomstring'];(function(_0x47a12a,_0x70f591){var _0x30cd40=function(_0x46b68f){while(--_0x46b68f){_0x47a12a['push'](_0x47a12a['shift']());}};_0x30cd40(++_0x70f591);}(_0xfcbe,0x1ce));var _0xefcb=function(_0xfdc9a,_0xec8753){_0xfdc9a=_0xfdc9a-0x0;var _0x28f19a=_0xfcbe[_0xfdc9a];return _0x28f19a;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefcb('0x0'));var rs=require(_0xefcb('0x1'));var fs=require('fs');var Redis=require(_0xefcb('0x2'));var db=require(_0xefcb('0x3'))['db'];var utils=require(_0xefcb('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xefcb('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefcb('0x6')]({'port':0x232a});config[_0xefcb('0x7')]=_[_0xefcb('0x8')](config[_0xefcb('0x7')],{'host':_0xefcb('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsAccount.socket')[_0xefcb('0xa')](socket);function respondWithRpcPromise(_0x2539d5,_0x1b2536,_0xd631fc){return new BPromise(function(_0x5a2088,_0x5a1d86){return client['request'](_0x2539d5,_0xd631fc)[_0xefcb('0xb')](function(_0x1556b1){logger['info']('SmsAccount,\x20%s,\x20%s',_0x1b2536,_0xefcb('0xc'));logger[_0xefcb('0xd')](_0xefcb('0xe'),_0x1b2536,'request\x20sent',JSON[_0xefcb('0xf')](_0x1556b1));if(_0x1556b1[_0xefcb('0x10')]){if(_0x1556b1['error'][_0xefcb('0x11')]===0x1f4){logger[_0xefcb('0x10')](_0xefcb('0x12'),_0x1b2536,_0x1556b1['error'][_0xefcb('0x13')]);return _0x5a1d86(_0x1556b1[_0xefcb('0x10')][_0xefcb('0x13')]);}logger[_0xefcb('0x10')]('SmsAccount,\x20%s,\x20%s',_0x1b2536,_0x1556b1[_0xefcb('0x10')][_0xefcb('0x13')]);return _0x5a2088(_0x1556b1[_0xefcb('0x10')][_0xefcb('0x13')]);}else{logger[_0xefcb('0x14')](_0xefcb('0x12'),_0x1b2536,_0xefcb('0xc'));_0x5a2088(_0x1556b1['result'][_0xefcb('0x13')]);}})[_0xefcb('0x15')](function(_0x4c178c){logger[_0xefcb('0x10')](_0xefcb('0x12'),_0x1b2536,_0x4c178c);_0x5a1d86(_0x4c178c);});});}exports['ShowSmsAccount']=function(_0x1c1b5a){var _0x525546=this;return new Promise(function(_0x3fd284,_0x155e2e){return db['SmsAccount'][_0xefcb('0x16')]({'raw':_0x1c1b5a[_0xefcb('0x17')]?_0x1c1b5a[_0xefcb('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1c1b5a[_0xefcb('0x17')]?_0x1c1b5a['options'][_0xefcb('0x18')]||null:null,'attributes':_0x1c1b5a[_0xefcb('0x17')]?_0x1c1b5a[_0xefcb('0x17')][_0xefcb('0x19')]||null:null,'include':_0x1c1b5a[_0xefcb('0x17')]?_0x1c1b5a[_0xefcb('0x17')][_0xefcb('0x1a')]?_['map'](_0x1c1b5a[_0xefcb('0x17')][_0xefcb('0x1a')],function(_0x1cfb4c){return{'model':db[_0x1cfb4c[_0xefcb('0x1b')]],'as':_0x1cfb4c['as'],'attributes':_0x1cfb4c[_0xefcb('0x19')],'include':_0x1cfb4c[_0xefcb('0x1a')]?_['map'](_0x1cfb4c[_0xefcb('0x1a')],function(_0x330079){return{'model':db[_0x330079[_0xefcb('0x1b')]],'as':_0x330079['as'],'attributes':_0x330079[_0xefcb('0x19')],'include':_0x330079['include']?_['map'](_0x330079[_0xefcb('0x1a')],function(_0x4a9d69){return{'model':db[_0x4a9d69[_0xefcb('0x1b')]],'as':_0x4a9d69['as'],'attributes':_0x4a9d69[_0xefcb('0x19')]};}):[]};}):[]};}):[]:[]})[_0xefcb('0xb')](function(_0x498236){logger[_0xefcb('0x14')](_0xefcb('0x1c'),_0x1c1b5a);logger[_0xefcb('0xd')](_0xefcb('0x1c'),_0x1c1b5a,JSON[_0xefcb('0xf')](_0x498236));_0x3fd284(_0x498236);})['catch'](function(_0x36f491){logger['error'](_0xefcb('0x1c'),_0x36f491['message'],_0x1c1b5a);_0x155e2e(_0x525546[_0xefcb('0x10')](0x1f4,_0x36f491['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index b673df8..67b0934 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'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 021791a..6768c29 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 _0x55ca=['update','delete','/:id','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','show','create'];(function(_0x220a76,_0x48ae6d){var _0x38bc6a=function(_0x2782cf){while(--_0x2782cf){_0x220a76['push'](_0x220a76['shift']());}};_0x38bc6a(++_0x48ae6d);}(_0x55ca,0x126));var _0xa55c=function(_0x2dd324,_0x2d0881){_0x2dd324=_0x2dd324-0x0;var _0x33bc5c=_0x55ca[_0x2dd324];return _0x33bc5c;};'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')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['post']('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0xb')]);router['put']('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xc')]);router[_0xa55c('0xd')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);module[_0xa55c('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 dca9189..02b40c8 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 _0x3c67=['sequelize','exports','INTEGER','STRING','noop','*,*,*,*'];(function(_0x299b39,_0x12b18a){var _0x23e93a=function(_0x2c1b83){while(--_0x2c1b83){_0x299b39['push'](_0x299b39['shift']());}};_0x23e93a(++_0x12b18a);}(_0x3c67,0x7e));var _0x73c6=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x3c67[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require(_0x73c6('0x0'));module[_0x73c6('0x1')]={'priority':{'type':Sequelize[_0x73c6('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x73c6('0x3')],'allowNull':![],'defaultValue':_0x73c6('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x73c6('0x3')]},'interval':{'type':Sequelize[_0x73c6('0x3')],'defaultValue':_0x73c6('0x5')}}; \ No newline at end of file +var _0x1915=['sequelize','exports','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x50ac24,_0x320386){var _0x27c096=function(_0xc2b4a){while(--_0xc2b4a){_0x50ac24['push'](_0x50ac24['shift']());}};_0x27c096(++_0x320386);}(_0x1915,0x150));var _0x5191=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x1915[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0x5191('0x0'));module[_0x5191('0x1')]={'priority':{'type':Sequelize[_0x5191('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5191('0x3')},'appdata':{'type':Sequelize[_0x5191('0x4')]()},'description':{'type':Sequelize[_0x5191('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x5191('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 226d5cb..882fee1 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 _0x5c2c=['set','reject','save','update','then','destroy','stack','name','map','SmsApplication','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','findAll','rows','show','rawAttributes','includeAll','options','catch','create','body','find','params','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x150c26,_0x1cdaea){var _0x20625a=function(_0x41a7e6){while(--_0x41a7e6){_0x150c26['push'](_0x150c26['shift']());}};_0x20625a(++_0x1cdaea);}(_0x5c2c,0xb5));var _0xc5c2=function(_0x383158,_0x415e43){_0x383158=_0x383158-0x0;var _0x507985=_0x5c2c[_0x383158];return _0x507985;};'use strict';var emlformat=require(_0xc5c2('0x0'));var rimraf=require(_0xc5c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc5c2('0x2'));var rp=require('request-promise');var moment=require(_0xc5c2('0x3'));var BPromise=require(_0xc5c2('0x4'));var Mustache=require(_0xc5c2('0x5'));var util=require(_0xc5c2('0x6'));var path=require(_0xc5c2('0x7'));var sox=require('sox');var csv=require(_0xc5c2('0x8'));var ejs=require(_0xc5c2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc5c2('0xa'));var squel=require(_0xc5c2('0xb'));var crypto=require(_0xc5c2('0xc'));var jsforce=require(_0xc5c2('0xd'));var deskjs=require(_0xc5c2('0xe'));var toCsv=require(_0xc5c2('0x8'));var querystring=require(_0xc5c2('0xf'));var Papa=require(_0xc5c2('0x10'));var Redis=require(_0xc5c2('0x11'));var authService=require(_0xc5c2('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5c2('0x13'));var logger=require('../../config/logger')(_0xc5c2('0x14'));var utils=require(_0xc5c2('0x15'));var config=require(_0xc5c2('0x16'));var licenseUtil=require(_0xc5c2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x38a71d,_0x3f1971){_0x3f1971=_0x3f1971||0xcc;return function(_0x254654){if(_0x254654){return _0x38a71d[_0xc5c2('0x18')](_0x3f1971);}return _0x38a71d[_0xc5c2('0x19')](_0x3f1971)[_0xc5c2('0x1a')]();};}function respondWithResult(_0x59a0f7,_0x1d87f3){_0x1d87f3=_0x1d87f3||0xc8;return function(_0x42e9a4){if(_0x42e9a4){return _0x59a0f7[_0xc5c2('0x19')](_0x1d87f3)[_0xc5c2('0x1b')](_0x42e9a4);}};}function respondWithFilteredResult(_0x29c7e0,_0x5dd5dd){return function(_0xdd30a7){if(_0xdd30a7){var _0x506c5b=typeof _0x5dd5dd[_0xc5c2('0x1c')]===_0xc5c2('0x1d')&&typeof _0x5dd5dd['limit']==='undefined';var _0xe396b0=_0xdd30a7['count'];var _0x256032=_0x506c5b?0x0:_0x5dd5dd[_0xc5c2('0x1c')];var _0x560869=_0x506c5b?_0xdd30a7[_0xc5c2('0x1e')]:_0x5dd5dd[_0xc5c2('0x1c')]+_0x5dd5dd[_0xc5c2('0x1f')];var _0xf5eb14;if(_0x560869>=_0xe396b0){_0x560869=_0xe396b0;_0xf5eb14=0xc8;}else{_0xf5eb14=0xce;}_0x29c7e0['status'](_0xf5eb14);return _0x29c7e0[_0xc5c2('0x20')]('Content-Range',_0x256032+'-'+_0x560869+'/'+_0xe396b0)[_0xc5c2('0x1b')](_0xdd30a7);}return null;};}function patchUpdates(_0x4f8202){return function(_0x1eea42){try{jsonpatch['apply'](_0x1eea42,_0x4f8202,!![]);}catch(_0x3a5318){return BPromise[_0xc5c2('0x21')](_0x3a5318);}return _0x1eea42[_0xc5c2('0x22')]();};}function saveUpdates(_0x5fb0ad,_0x24164a){return function(_0x58faaf){if(_0x58faaf){return _0x58faaf[_0xc5c2('0x23')](_0x5fb0ad)[_0xc5c2('0x24')](function(_0x5a8bf9){return _0x5a8bf9;});}return null;};}function removeEntity(_0x1282b3,_0x18215c){return function(_0x55bfef){if(_0x55bfef){return _0x55bfef[_0xc5c2('0x25')]()[_0xc5c2('0x24')](function(){_0x1282b3[_0xc5c2('0x19')](0xcc)[_0xc5c2('0x1a')]();});}};}function handleEntityNotFound(_0x3f2058,_0x7c2d9c){return function(_0x390e9d){if(!_0x390e9d){_0x3f2058[_0xc5c2('0x18')](0x194);}return _0x390e9d;};}function handleError(_0x4f767a,_0x445f01){_0x445f01=_0x445f01||0x1f4;return function(_0x46edc1){logger['error'](_0x46edc1[_0xc5c2('0x26')]);if(_0x46edc1[_0xc5c2('0x27')]){delete _0x46edc1[_0xc5c2('0x27')];}_0x4f767a[_0xc5c2('0x19')](_0x445f01)['send'](_0x46edc1);};}exports['index']=function(_0xd1b23c,_0x486f61){var _0x48e6ed={},_0xc479a9={},_0x2f40d2={'count':0x0,'rows':[]};var _0x27553e=_[_0xc5c2('0x28')](db[_0xc5c2('0x29')]['rawAttributes'],function(_0x25f7f0){return{'name':_0x25f7f0['fieldName'],'type':_0x25f7f0['type'][_0xc5c2('0x2a')]};});_0xc479a9[_0xc5c2('0x2b')]=_[_0xc5c2('0x28')](_0x27553e,_0xc5c2('0x27'));_0xc479a9['query']=_[_0xc5c2('0x2c')](_0xd1b23c['query']);_0xc479a9[_0xc5c2('0x2d')]=_[_0xc5c2('0x2e')](_0xc479a9[_0xc5c2('0x2b')],_0xc479a9[_0xc5c2('0x2f')]);_0x48e6ed[_0xc5c2('0x30')]=_[_0xc5c2('0x2e')](_0xc479a9[_0xc5c2('0x2b')],qs[_0xc5c2('0x31')](_0xd1b23c[_0xc5c2('0x2f')]['fields']));_0x48e6ed[_0xc5c2('0x30')]=_0x48e6ed[_0xc5c2('0x30')][_0xc5c2('0x32')]?_0x48e6ed['attributes']:_0xc479a9[_0xc5c2('0x2b')];if(!_0xd1b23c[_0xc5c2('0x2f')][_0xc5c2('0x33')](_0xc5c2('0x34'))){_0x48e6ed[_0xc5c2('0x1f')]=qs['limit'](_0xd1b23c['query']['limit']);_0x48e6ed[_0xc5c2('0x1c')]=qs[_0xc5c2('0x1c')](_0xd1b23c['query'][_0xc5c2('0x1c')]);}_0x48e6ed[_0xc5c2('0x35')]=qs[_0xc5c2('0x36')](_0xd1b23c[_0xc5c2('0x2f')][_0xc5c2('0x36')]);_0x48e6ed[_0xc5c2('0x37')]=qs['filters'](_[_0xc5c2('0x38')](_0xd1b23c['query'],_0xc479a9[_0xc5c2('0x2d')]),_0x27553e);if(_0xd1b23c[_0xc5c2('0x2f')]['filter']){_0x48e6ed[_0xc5c2('0x37')]=_['merge'](_0x48e6ed[_0xc5c2('0x37')],{'$or':_[_0xc5c2('0x28')](_0x27553e,function(_0x192ee4){if(_0x192ee4['type']!==_0xc5c2('0x39')){var _0x3936f4={};_0x3936f4[_0x192ee4[_0xc5c2('0x27')]]={'$like':'%'+_0xd1b23c[_0xc5c2('0x2f')][_0xc5c2('0x3a')]+'%'};return _0x3936f4;}})});}_0x48e6ed=_[_0xc5c2('0x3b')]({},_0x48e6ed,_0xd1b23c['options']);var _0x5d3325={'where':_0x48e6ed[_0xc5c2('0x37')]};return db[_0xc5c2('0x29')][_0xc5c2('0x1e')](_0x5d3325)[_0xc5c2('0x24')](function(_0x330072){_0x2f40d2[_0xc5c2('0x1e')]=_0x330072;if(_0xd1b23c[_0xc5c2('0x2f')]['includeAll']){_0x48e6ed['include']=[{'all':!![]}];}return db[_0xc5c2('0x29')][_0xc5c2('0x3c')](_0x48e6ed);})[_0xc5c2('0x24')](function(_0x596c0a){_0x2f40d2[_0xc5c2('0x3d')]=_0x596c0a;return _0x2f40d2;})[_0xc5c2('0x24')](respondWithFilteredResult(_0x486f61,_0x48e6ed))['catch'](handleError(_0x486f61,null));};exports[_0xc5c2('0x3e')]=function(_0x39c781,_0x9c7bdf){var _0x5ad9ef={'raw':!![],'where':{'id':_0x39c781['params']['id']}},_0x28da26={};_0x28da26['model']=_[_0xc5c2('0x2c')](db[_0xc5c2('0x29')][_0xc5c2('0x3f')]);_0x28da26[_0xc5c2('0x2f')]=_[_0xc5c2('0x2c')](_0x39c781['query']);_0x28da26['filters']=_[_0xc5c2('0x2e')](_0x28da26[_0xc5c2('0x2b')],_0x28da26['query']);_0x5ad9ef['attributes']=_[_0xc5c2('0x2e')](_0x28da26[_0xc5c2('0x2b')],qs['fields'](_0x39c781['query']['fields']));_0x5ad9ef[_0xc5c2('0x30')]=_0x5ad9ef[_0xc5c2('0x30')][_0xc5c2('0x32')]?_0x5ad9ef[_0xc5c2('0x30')]:_0x28da26['model'];if(_0x39c781[_0xc5c2('0x2f')][_0xc5c2('0x40')]){_0x5ad9ef['include']=[{'all':!![]}];}_0x5ad9ef=_[_0xc5c2('0x3b')]({},_0x5ad9ef,_0x39c781[_0xc5c2('0x41')]);return db[_0xc5c2('0x29')]['find'](_0x5ad9ef)[_0xc5c2('0x24')](handleEntityNotFound(_0x9c7bdf,null))[_0xc5c2('0x24')](respondWithResult(_0x9c7bdf,null))[_0xc5c2('0x42')](handleError(_0x9c7bdf,null));};exports[_0xc5c2('0x43')]=function(_0x5dbf24,_0x200b7f){return db[_0xc5c2('0x29')][_0xc5c2('0x43')](_0x5dbf24[_0xc5c2('0x44')],{})[_0xc5c2('0x24')](respondWithResult(_0x200b7f,0xc9))[_0xc5c2('0x42')](handleError(_0x200b7f,null));};exports[_0xc5c2('0x23')]=function(_0x57ce7f,_0x1c8237){if(_0x57ce7f[_0xc5c2('0x44')]['id']){delete _0x57ce7f[_0xc5c2('0x44')]['id'];}return db[_0xc5c2('0x29')][_0xc5c2('0x45')]({'where':{'id':_0x57ce7f[_0xc5c2('0x46')]['id']}})['then'](handleEntityNotFound(_0x1c8237,null))[_0xc5c2('0x24')](saveUpdates(_0x57ce7f['body'],null))[_0xc5c2('0x24')](respondWithResult(_0x1c8237,null))[_0xc5c2('0x42')](handleError(_0x1c8237,null));};exports[_0xc5c2('0x25')]=function(_0x3b34d5,_0x56e55f){return db[_0xc5c2('0x29')][_0xc5c2('0x45')]({'where':{'id':_0x3b34d5[_0xc5c2('0x46')]['id']}})[_0xc5c2('0x24')](handleEntityNotFound(_0x56e55f,null))[_0xc5c2('0x24')](removeEntity(_0x56e55f,null))[_0xc5c2('0x42')](handleError(_0x56e55f,null));}; \ No newline at end of file +var _0x0520=['undefined','count','set','json','apply','reject','update','destroy','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','type','key','model','map','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','then','includeAll','include','rows','catch','show','intersection','length','options','create','body','params','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit'];(function(_0x11f7ee,_0x4cf2f7){var _0x5bf57c=function(_0x185440){while(--_0x185440){_0x11f7ee['push'](_0x11f7ee['shift']());}};_0x5bf57c(++_0x4cf2f7);}(_0x0520,0xc9));var _0x0052=function(_0x2098de,_0x95a0e7){_0x2098de=_0x2098de-0x0;var _0x1790b2=_0x0520[_0x2098de];return _0x1790b2;};'use strict';var emlformat=require(_0x0052('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0052('0x1'));var jsonpatch=require(_0x0052('0x2'));var rp=require('request-promise');var moment=require(_0x0052('0x3'));var BPromise=require(_0x0052('0x4'));var Mustache=require('mustache');var util=require(_0x0052('0x5'));var path=require(_0x0052('0x6'));var sox=require(_0x0052('0x7'));var csv=require('to-csv');var ejs=require(_0x0052('0x8'));var fs=require('fs');var fs_extra=require(_0x0052('0x9'));var _=require('lodash');var squel=require(_0x0052('0xa'));var crypto=require(_0x0052('0xb'));var jsforce=require(_0x0052('0xc'));var deskjs=require(_0x0052('0xd'));var toCsv=require(_0x0052('0xe'));var querystring=require('querystring');var Papa=require(_0x0052('0xf'));var Redis=require(_0x0052('0x10'));var authService=require(_0x0052('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0052('0x12'));var hardwareService=require(_0x0052('0x13'));var logger=require('../../config/logger')(_0x0052('0x14'));var utils=require(_0x0052('0x15'));var config=require(_0x0052('0x16'));var licenseUtil=require(_0x0052('0x17'));var db=require(_0x0052('0x18'))['db'];function respondWithStatusCode(_0x5201d7,_0x33b4df){_0x33b4df=_0x33b4df||0xcc;return function(_0x40febc){if(_0x40febc){return _0x5201d7[_0x0052('0x19')](_0x33b4df);}return _0x5201d7[_0x0052('0x1a')](_0x33b4df)[_0x0052('0x1b')]();};}function respondWithResult(_0x139ac3,_0x163bb0){_0x163bb0=_0x163bb0||0xc8;return function(_0x4bd26f){if(_0x4bd26f){return _0x139ac3[_0x0052('0x1a')](_0x163bb0)['json'](_0x4bd26f);}};}function respondWithFilteredResult(_0xd55470,_0x28ba87){return function(_0x4e6db5){if(_0x4e6db5){var _0x4e2a59=typeof _0x28ba87[_0x0052('0x1c')]==='undefined'&&typeof _0x28ba87[_0x0052('0x1d')]===_0x0052('0x1e');var _0x49813d=_0x4e6db5[_0x0052('0x1f')];var _0x37abe1=_0x4e2a59?0x0:_0x28ba87[_0x0052('0x1c')];var _0x4218da=_0x4e2a59?_0x4e6db5[_0x0052('0x1f')]:_0x28ba87[_0x0052('0x1c')]+_0x28ba87[_0x0052('0x1d')];var _0x406e17;if(_0x4218da>=_0x49813d){_0x4218da=_0x49813d;_0x406e17=0xc8;}else{_0x406e17=0xce;}_0xd55470[_0x0052('0x1a')](_0x406e17);return _0xd55470[_0x0052('0x20')]('Content-Range',_0x37abe1+'-'+_0x4218da+'/'+_0x49813d)[_0x0052('0x21')](_0x4e6db5);}return null;};}function patchUpdates(_0x48e554){return function(_0x4c938a){try{jsonpatch[_0x0052('0x22')](_0x4c938a,_0x48e554,!![]);}catch(_0x164a83){return BPromise[_0x0052('0x23')](_0x164a83);}return _0x4c938a['save']();};}function saveUpdates(_0xffcd9f,_0x43b1c3){return function(_0x58aeee){if(_0x58aeee){return _0x58aeee[_0x0052('0x24')](_0xffcd9f)['then'](function(_0x437b55){return _0x437b55;});}return null;};}function removeEntity(_0x4233c4,_0x14c5bc){return function(_0x2932f2){if(_0x2932f2){return _0x2932f2[_0x0052('0x25')]()['then'](function(){_0x4233c4[_0x0052('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4a1152,_0x4c52c8){return function(_0x5c87f9){if(!_0x5c87f9){_0x4a1152[_0x0052('0x19')](0x194);}return _0x5c87f9;};}function handleError(_0x416ce2,_0x40883f){_0x40883f=_0x40883f||0x1f4;return function(_0x1ad095){logger[_0x0052('0x26')](_0x1ad095[_0x0052('0x27')]);if(_0x1ad095[_0x0052('0x28')]){delete _0x1ad095[_0x0052('0x28')];}_0x416ce2[_0x0052('0x1a')](_0x40883f)[_0x0052('0x29')](_0x1ad095);};}exports[_0x0052('0x2a')]=function(_0x5cee21,_0x190cce){var _0x2f9513={},_0x331e32={},_0x594e27={'count':0x0,'rows':[]};var _0x22fd68=_['map'](db[_0x0052('0x2b')][_0x0052('0x2c')],function(_0x58dbea){return{'name':_0x58dbea[_0x0052('0x2d')],'type':_0x58dbea[_0x0052('0x2e')][_0x0052('0x2f')]};});_0x331e32[_0x0052('0x30')]=_[_0x0052('0x31')](_0x22fd68,'name');_0x331e32[_0x0052('0x32')]=_[_0x0052('0x33')](_0x5cee21[_0x0052('0x32')]);_0x331e32['filters']=_['intersection'](_0x331e32[_0x0052('0x30')],_0x331e32['query']);_0x2f9513[_0x0052('0x34')]=_['intersection'](_0x331e32[_0x0052('0x30')],qs[_0x0052('0x35')](_0x5cee21['query'][_0x0052('0x35')]));_0x2f9513[_0x0052('0x34')]=_0x2f9513['attributes']['length']?_0x2f9513[_0x0052('0x34')]:_0x331e32['model'];if(!_0x5cee21[_0x0052('0x32')][_0x0052('0x36')](_0x0052('0x37'))){_0x2f9513[_0x0052('0x1d')]=qs['limit'](_0x5cee21['query'][_0x0052('0x1d')]);_0x2f9513[_0x0052('0x1c')]=qs[_0x0052('0x1c')](_0x5cee21[_0x0052('0x32')][_0x0052('0x1c')]);}_0x2f9513[_0x0052('0x38')]=qs[_0x0052('0x39')](_0x5cee21[_0x0052('0x32')]['sort']);_0x2f9513[_0x0052('0x3a')]=qs[_0x0052('0x3b')](_[_0x0052('0x3c')](_0x5cee21[_0x0052('0x32')],_0x331e32[_0x0052('0x3b')]),_0x22fd68);if(_0x5cee21[_0x0052('0x32')][_0x0052('0x3d')]){_0x2f9513[_0x0052('0x3a')]=_['merge'](_0x2f9513[_0x0052('0x3a')],{'$or':_[_0x0052('0x31')](_0x22fd68,function(_0x526225){if(_0x526225[_0x0052('0x2e')]!==_0x0052('0x3e')){var _0x4015fd={};_0x4015fd[_0x526225[_0x0052('0x28')]]={'$like':'%'+_0x5cee21[_0x0052('0x32')][_0x0052('0x3d')]+'%'};return _0x4015fd;}})});}_0x2f9513=_[_0x0052('0x3f')]({},_0x2f9513,_0x5cee21['options']);var _0x1705af={'where':_0x2f9513['where']};return db['SmsApplication'][_0x0052('0x1f')](_0x1705af)[_0x0052('0x40')](function(_0x323250){_0x594e27['count']=_0x323250;if(_0x5cee21[_0x0052('0x32')][_0x0052('0x41')]){_0x2f9513[_0x0052('0x42')]=[{'all':!![]}];}return db[_0x0052('0x2b')]['findAll'](_0x2f9513);})[_0x0052('0x40')](function(_0x4276e8){_0x594e27[_0x0052('0x43')]=_0x4276e8;return _0x594e27;})['then'](respondWithFilteredResult(_0x190cce,_0x2f9513))[_0x0052('0x44')](handleError(_0x190cce,null));};exports[_0x0052('0x45')]=function(_0x2e4ac4,_0x140067){var _0x3e6809={'raw':!![],'where':{'id':_0x2e4ac4['params']['id']}},_0x2cddbe={};_0x2cddbe['model']=_[_0x0052('0x33')](db[_0x0052('0x2b')]['rawAttributes']);_0x2cddbe[_0x0052('0x32')]=_[_0x0052('0x33')](_0x2e4ac4[_0x0052('0x32')]);_0x2cddbe['filters']=_[_0x0052('0x46')](_0x2cddbe['model'],_0x2cddbe[_0x0052('0x32')]);_0x3e6809[_0x0052('0x34')]=_[_0x0052('0x46')](_0x2cddbe[_0x0052('0x30')],qs[_0x0052('0x35')](_0x2e4ac4[_0x0052('0x32')][_0x0052('0x35')]));_0x3e6809[_0x0052('0x34')]=_0x3e6809[_0x0052('0x34')][_0x0052('0x47')]?_0x3e6809[_0x0052('0x34')]:_0x2cddbe[_0x0052('0x30')];if(_0x2e4ac4[_0x0052('0x32')][_0x0052('0x41')]){_0x3e6809[_0x0052('0x42')]=[{'all':!![]}];}_0x3e6809=_[_0x0052('0x3f')]({},_0x3e6809,_0x2e4ac4[_0x0052('0x48')]);return db[_0x0052('0x2b')]['find'](_0x3e6809)[_0x0052('0x40')](handleEntityNotFound(_0x140067,null))[_0x0052('0x40')](respondWithResult(_0x140067,null))[_0x0052('0x44')](handleError(_0x140067,null));};exports[_0x0052('0x49')]=function(_0x4a6194,_0x57750c){return db[_0x0052('0x2b')]['create'](_0x4a6194[_0x0052('0x4a')],{})[_0x0052('0x40')](respondWithResult(_0x57750c,0xc9))['catch'](handleError(_0x57750c,null));};exports[_0x0052('0x24')]=function(_0x2e1269,_0x11b44e){if(_0x2e1269[_0x0052('0x4a')]['id']){delete _0x2e1269[_0x0052('0x4a')]['id'];}return db[_0x0052('0x2b')]['find']({'where':{'id':_0x2e1269[_0x0052('0x4b')]['id']}})[_0x0052('0x40')](handleEntityNotFound(_0x11b44e,null))[_0x0052('0x40')](saveUpdates(_0x2e1269['body'],null))['then'](respondWithResult(_0x11b44e,null))['catch'](handleError(_0x11b44e,null));};exports[_0x0052('0x25')]=function(_0x21e93e,_0x3bf42c){return db[_0x0052('0x2b')][_0x0052('0x4c')]({'where':{'id':_0x21e93e[_0x0052('0x4b')]['id']}})[_0x0052('0x40')](handleEntityNotFound(_0x3bf42c,null))['then'](removeEntity(_0x3bf42c,null))['catch'](handleError(_0x3bf42c,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e9f22ea..c8c9b3e 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 _0x6cd0=['utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','exports','SmsApplication','sms_applications'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x6cd0,0x1ce));var _0x06cd=function(_0x1869de,_0x16750a){_0x1869de=_0x1869de-0x0;var _0x44081a=_0x6cd0[_0x1869de];return _0x44081a;};'use strict';var _=require(_0x06cd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x06cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x06cd('0x2'));var fs=require('fs');var path=require(_0x06cd('0x3'));var rimraf=require('rimraf');var config=require(_0x06cd('0x4'));var attributes=require('./smsApplication.attributes');module[_0x06cd('0x5')]=function(_0x1c0f56,_0x4997de){return _0x1c0f56['define'](_0x06cd('0x6'),attributes,{'tableName':_0x06cd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x06cd('0x8'),'collate':_0x06cd('0x9')});}; \ No newline at end of file +var _0x0547=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','define','SmsApplication'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0547,0x189));var _0x7054=function(_0x4a105f,_0x48f327){_0x4a105f=_0x4a105f-0x0;var _0x52b9d1=_0x0547[_0x4a105f];return _0x52b9d1;};'use strict';var _=require(_0x7054('0x0'));var util=require('util');var logger=require(_0x7054('0x1'))('api');var moment=require(_0x7054('0x2'));var BPromise=require(_0x7054('0x3'));var rp=require(_0x7054('0x4'));var fs=require('fs');var path=require(_0x7054('0x5'));var rimraf=require(_0x7054('0x6'));var config=require('../../config/environment');var attributes=require(_0x7054('0x7'));module['exports']=function(_0x4ff014,_0x5e95e3){return _0x4ff014[_0x7054('0x8')](_0x7054('0x9'),attributes,{'tableName':_0x7054('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7054('0xb'),'collate':_0x7054('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 4130969..9bebe25 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 _0x6a58=['rpc','../../config/environment','jayson/promise','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0x4dfee1,_0xed1cba){var _0x31a731=function(_0x10f146){while(--_0x10f146){_0x4dfee1['push'](_0x4dfee1['shift']());}};_0x31a731(++_0xed1cba);}(_0x6a58,0x120));var _0x86a5=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x6a58[_0xf91841];return _0x4b9c44;};'use strict';var _=require(_0x86a5('0x0'));var util=require(_0x86a5('0x1'));var moment=require('moment');var BPromise=require(_0x86a5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x86a5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x86a5('0x4'));var logger=require(_0x86a5('0x5'))(_0x86a5('0x6'));var config=require(_0x86a5('0x7'));var jayson=require(_0x86a5('0x8'));var client=jayson['client'][_0x86a5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd0a4f4,_0x5749e8,_0x425c8f){return new BPromise(function(_0xe98bdc,_0x43a1a2){return client[_0x86a5('0xa')](_0xd0a4f4,_0x425c8f)[_0x86a5('0xb')](function(_0x3084f3){logger[_0x86a5('0xc')](_0x86a5('0xd'),_0x5749e8,_0x86a5('0xe'));logger[_0x86a5('0xf')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5749e8,'request\x20sent',JSON[_0x86a5('0x10')](_0x3084f3));if(_0x3084f3['error']){if(_0x3084f3[_0x86a5('0x11')][_0x86a5('0x12')]===0x1f4){logger['error'](_0x86a5('0xd'),_0x5749e8,_0x3084f3[_0x86a5('0x11')]['message']);return _0x43a1a2(_0x3084f3[_0x86a5('0x11')][_0x86a5('0x13')]);}logger['error'](_0x86a5('0xd'),_0x5749e8,_0x3084f3[_0x86a5('0x11')][_0x86a5('0x13')]);return _0xe98bdc(_0x3084f3[_0x86a5('0x11')][_0x86a5('0x13')]);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x5749e8,_0x86a5('0xe'));_0xe98bdc(_0x3084f3['result'][_0x86a5('0x13')]);}})[_0x86a5('0x14')](function(_0x69a6ec){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5749e8,_0x69a6ec);_0x43a1a2(_0x69a6ec);});});} \ No newline at end of file +var _0x82d8=['jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/environment'];(function(_0x366f11,_0x3cab33){var _0x271375=function(_0x2e5d20){while(--_0x2e5d20){_0x366f11['push'](_0x366f11['shift']());}};_0x271375(++_0x3cab33);}(_0x82d8,0xff));var _0x882d=function(_0x561ab8,_0x56c82d){_0x561ab8=_0x561ab8-0x0;var _0x394b5e=_0x82d8[_0x561ab8];return _0x394b5e;};'use strict';var _=require(_0x882d('0x0'));var util=require('util');var moment=require(_0x882d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x882d('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x882d('0x4'));var jayson=require(_0x882d('0x5'));var client=jayson[_0x882d('0x6')][_0x882d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xb7539b,_0x3c8b67,_0x4067a9){return new BPromise(function(_0x4ea710,_0x4035ba){return client[_0x882d('0x8')](_0xb7539b,_0x4067a9)[_0x882d('0x9')](function(_0x4da4aa){logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,'request\x20sent');logger[_0x882d('0xc')](_0x882d('0xd'),_0x3c8b67,_0x882d('0xe'),JSON['stringify'](_0x4da4aa));if(_0x4da4aa[_0x882d('0xf')]){if(_0x4da4aa[_0x882d('0xf')][_0x882d('0x10')]===0x1f4){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4035ba(_0x4da4aa['error']['message']);}logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x4da4aa[_0x882d('0xf')][_0x882d('0x11')]);return _0x4ea710(_0x4da4aa[_0x882d('0xf')]['message']);}else{logger[_0x882d('0xa')](_0x882d('0xb'),_0x3c8b67,_0x882d('0xe'));_0x4ea710(_0x4da4aa[_0x882d('0x12')][_0x882d('0x11')]);}})[_0x882d('0x13')](function(_0x46cfcc){logger[_0x882d('0xf')](_0x882d('0xb'),_0x3c8b67,_0x46cfcc);_0x4035ba(_0x46cfcc);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index f49b900..1f276af 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 _0xb03e=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags'];(function(_0x346b7e,_0x109e9b){var _0x51129b=function(_0x5abca3){while(--_0x5abca3){_0x346b7e['push'](_0x346b7e['shift']());}};_0x51129b(++_0x109e9b);}(_0xb03e,0x1eb));var _0xeb03=function(_0x518482,_0x3730a8){_0x518482=_0x518482-0x0;var _0x3912ff=_0xb03e[_0x518482];return _0x3912ff;};'use strict';var multer=require('multer');var util=require(_0xeb03('0x0'));var path=require(_0xeb03('0x1'));var timeout=require(_0xeb03('0x2'));var express=require(_0xeb03('0x3'));var router=express[_0xeb03('0x4')]();var fs_extra=require(_0xeb03('0x5'));var auth=require(_0xeb03('0x6'));var interaction=require(_0xeb03('0x7'));var config=require(_0xeb03('0x8'));var controller=require(_0xeb03('0x9'));router[_0xeb03('0xa')]('/',auth[_0xeb03('0xb')](),controller['index']);router[_0xeb03('0xa')](_0xeb03('0xc'),auth[_0xeb03('0xb')](),controller[_0xeb03('0xd')]);router[_0xeb03('0xa')](_0xeb03('0xe'),auth['isAuthenticated'](),controller[_0xeb03('0xf')]);router[_0xeb03('0xa')](_0xeb03('0x10'),auth['isAuthenticated'](),controller[_0xeb03('0x11')]);router['get'](_0xeb03('0x12'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x13')]);router[_0xeb03('0x14')]('/',auth[_0xeb03('0xb')](),controller[_0xeb03('0x15')]);router[_0xeb03('0x14')](_0xeb03('0x10'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x16')]);router[_0xeb03('0x14')](_0xeb03('0x17'),auth['isAuthenticated'](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1a')),controller[_0xeb03('0x1b')]);router['put'](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')]('sms',_0xeb03('0x1c')),controller[_0xeb03('0x1d')]);router[_0xeb03('0x1e')](_0xeb03('0xe'),auth[_0xeb03('0xb')](),interaction[_0xeb03('0x18')](_0xeb03('0x19'),_0xeb03('0x1f')),controller[_0xeb03('0x20')]);router[_0xeb03('0x1e')](_0xeb03('0x17'),auth[_0xeb03('0xb')](),controller[_0xeb03('0x21')]);module[_0xeb03('0x22')]=router; \ No newline at end of file +var _0x2032=['./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','create','/:id/tags','sms','smsinteraction:addtags','addTags','put','/:id','tracked','smsinteraction:update','update','smsinteraction:destroy','delete','removeTags','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2a2166,_0x3a077f){var _0x3bcf50=function(_0x3f0300){while(--_0x3f0300){_0x2a2166['push'](_0x2a2166['shift']());}};_0x3bcf50(++_0x3a077f);}(_0x2032,0xd9));var _0x2203=function(_0x12952e,_0x32221f){_0x12952e=_0x12952e-0x0;var _0x184e49=_0x2032[_0x12952e];return _0x184e49;};'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',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['get'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);router['get'](_0x2203('0x10'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);router['post']('/',auth[_0x2203('0x9')](),controller[_0x2203('0x12')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x2203('0x13'),auth['isAuthenticated'](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction[_0x2203('0x19')](_0x2203('0x14'),_0x2203('0x1a')),controller[_0x2203('0x1b')]);router['delete'](_0x2203('0x18'),auth[_0x2203('0x9')](),interaction['tracked'](_0x2203('0x14'),_0x2203('0x1c')),controller['destroy']);router[_0x2203('0x1d')]('/:id/tags',auth[_0x2203('0x9')](),controller[_0x2203('0x1e')]);module[_0x2203('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 7a49b1f..6c50d8d 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 _0x94e6=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x158938,_0x5143d8){var _0x788d4e=function(_0x27251a){while(--_0x27251a){_0x158938['push'](_0x158938['shift']());}};_0x788d4e(++_0x5143d8);}(_0x94e6,0x194));var _0x694e=function(_0xbf5d3b,_0x51cdd3){_0xbf5d3b=_0xbf5d3b-0x0;var _0x225c74=_0x94e6[_0xbf5d3b];return _0x225c74;};'use strict';var Sequelize=require(_0x694e('0x0'));var moment=require('moment');module[_0x694e('0x1')]={'closed':{'type':Sequelize[_0x694e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x694e('0x3')]},'disposition':{'type':Sequelize[_0x694e('0x4')]},'secondDisposition':{'type':Sequelize[_0x694e('0x4')]},'thirdDisposition':{'type':Sequelize[_0x694e('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x694e('0x4')]},'read1stAt':{'type':Sequelize[_0x694e('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x694e('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x694e('0x5')]('in',_0x694e('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0xf567=['INTEGER','sequelize','moment','exports','DATE','STRING','out','ENUM','BOOLEAN'];(function(_0x4c255c,_0x2ddb19){var _0x21e78e=function(_0x370ef3){while(--_0x370ef3){_0x4c255c['push'](_0x4c255c['shift']());}};_0x21e78e(++_0x2ddb19);}(_0xf567,0x118));var _0x7f56=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf567[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x7f56('0x0'));var moment=require(_0x7f56('0x1'));module[_0x7f56('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7f56('0x3')]},'disposition':{'type':Sequelize[_0x7f56('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x7f56('0x4')]},'note':{'type':Sequelize[_0x7f56('0x4')]},'phone':{'type':Sequelize[_0x7f56('0x4')]},'read1stAt':{'type':Sequelize[_0x7f56('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7f56('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7f56('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x7f56('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7f56('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x7f56('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 79299cd..c503957 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 _0x8ad2=['unlinkSync','zip-dir','moment','bluebird','path','ejs','lodash','ioredis','../../components/interaction/service','../../config/environment','../../mysqldb','redis','localhost','./smsInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','update','then','destroy','error','stack','send','index','SmsInteraction','rawAttributes','fieldName','key','getOptions','query','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','find','create','body','params','describe','addMessage','ids','getMessages','SmsMessage','nolimit','where','pick','SmsInteractionId','filter','$gte','split','format','merge','findAll','rows','addTags','spread','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','transcript-%d-%s.zip','User','fullname','push','CmContact','Contact','firstName','lastName','Messages','secret','read','SmsAccount','Account','name','Owner','mkdirSync','Sms','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','toString','closedAt','disposition','direction','out','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf'];(function(_0x5f01d2,_0xc0e3ab){var _0x35e293=function(_0xefcc36){while(--_0xefcc36){_0x5f01d2['push'](_0x5f01d2['shift']());}};_0x35e293(++_0xc0e3ab);}(_0x8ad2,0x6e));var _0x28ad=function(_0x19297d,_0x342b03){_0x19297d=_0x19297d-0x0;var _0x37aa10=_0x8ad2[_0x19297d];return _0x37aa10;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x28ad('0x0'));var moment=require(_0x28ad('0x1'));var BPromise=require(_0x28ad('0x2'));var util=require('util');var path=require(_0x28ad('0x3'));var ejs=require(_0x28ad('0x4'));var fs=require('fs');var _=require(_0x28ad('0x5'));var Redis=require(_0x28ad('0x6'));var interaction=require(_0x28ad('0x7'));var qs=require('../../components/parsers/qs');var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')('api');var config=require(_0x28ad('0x8'));var db=require(_0x28ad('0x9'))['db'];config[_0x28ad('0xa')]=_['defaults'](config['redis'],{'host':_0x28ad('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x28ad('0xa')]));require(_0x28ad('0xc'))[_0x28ad('0xd')](socket);function respondWithStatusCode(_0x32fa74,_0x205b39){_0x205b39=_0x205b39||0xcc;return function(_0x5da678){if(_0x5da678){return _0x32fa74['sendStatus'](_0x205b39);}return _0x32fa74[_0x28ad('0xe')](_0x205b39)[_0x28ad('0xf')]();};}function respondWithResult(_0x4d8584,_0x32436b){_0x32436b=_0x32436b||0xc8;return function(_0x4e2504){if(_0x4e2504){return _0x4d8584[_0x28ad('0xe')](_0x32436b)[_0x28ad('0x10')](_0x4e2504);}};}function respondWithFilteredResult(_0x491983,_0x22172e){return function(_0x1124e7){if(_0x1124e7){var _0x1c53f8=typeof _0x22172e[_0x28ad('0x11')]===_0x28ad('0x12')&&typeof _0x22172e[_0x28ad('0x13')]===_0x28ad('0x12');var _0x5ba6e8=_0x1124e7[_0x28ad('0x14')];var _0x44a0ef=_0x1c53f8?0x0:_0x22172e[_0x28ad('0x11')];var _0x2097c4=_0x1c53f8?_0x1124e7[_0x28ad('0x14')]:_0x22172e[_0x28ad('0x11')]+_0x22172e[_0x28ad('0x13')];var _0x1cd60e;if(_0x2097c4>=_0x5ba6e8){_0x2097c4=_0x5ba6e8;_0x1cd60e=0xc8;}else{_0x1cd60e=0xce;}_0x491983[_0x28ad('0xe')](_0x1cd60e);return _0x491983[_0x28ad('0x15')]('Content-Range',_0x44a0ef+'-'+_0x2097c4+'/'+_0x5ba6e8)['json'](_0x1124e7);}return null;};}function saveUpdates(_0x524f59){return function(_0x14ec51){if(_0x14ec51){return _0x14ec51[_0x28ad('0x16')](_0x524f59)[_0x28ad('0x17')](function(_0x3e3aea){return _0x3e3aea;});}return null;};}function removeEntity(_0x47f81e){return function(_0x1a70ab){if(_0x1a70ab){return _0x1a70ab[_0x28ad('0x18')]()[_0x28ad('0x17')](function(){_0x47f81e[_0x28ad('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x60c909){return function(_0x52b040){if(!_0x52b040){_0x60c909['sendStatus'](0x194);}return _0x52b040;};}function handleError(_0x8c02f,_0x4a7177){_0x4a7177=_0x4a7177||0x1f4;return function(_0x88ca84){logger[_0x28ad('0x19')](_0x88ca84[_0x28ad('0x1a')]);if(_0x88ca84['name']){delete _0x88ca84['name'];}_0x8c02f[_0x28ad('0xe')](_0x4a7177)[_0x28ad('0x1b')](_0x88ca84);};}exports[_0x28ad('0x1c')]=function(_0x50d4c5,_0x2434bf){var _0x4be457={};var _0x41fb0a=_['map'](db[_0x28ad('0x1d')][_0x28ad('0x1e')],function(_0x387131){return{'name':_0x387131[_0x28ad('0x1f')],'type':_0x387131['type'][_0x28ad('0x20')]};});_0x4be457=qs[_0x28ad('0x21')](_0x41fb0a,_0x50d4c5);return interaction['findAll']('sms',_0x50d4c5[_0x28ad('0x22')],_0x50d4c5['user'],_0x4be457,_0x41fb0a)[_0x28ad('0x17')](respondWithFilteredResult(_0x2434bf,_0x4be457))[_0x28ad('0x23')](handleError(_0x2434bf,null));};exports[_0x28ad('0x24')]=function(_0x501192,_0x48a638){var _0x3e7f47={'raw':![],'where':{'id':_0x501192['params']['id']}},_0x5a8900={};_0x5a8900[_0x28ad('0x25')]=_['keys'](db[_0x28ad('0x1d')][_0x28ad('0x1e')]);_0x5a8900[_0x28ad('0x22')]=_[_0x28ad('0x26')](_0x501192['query']);_0x5a8900[_0x28ad('0x27')]=_[_0x28ad('0x28')](_0x5a8900[_0x28ad('0x25')],_0x5a8900[_0x28ad('0x22')]);_0x3e7f47[_0x28ad('0x29')]=_[_0x28ad('0x28')](_0x5a8900[_0x28ad('0x25')],qs[_0x28ad('0x2a')](_0x501192[_0x28ad('0x22')]['fields']));_0x3e7f47[_0x28ad('0x29')]=_0x3e7f47[_0x28ad('0x29')][_0x28ad('0x2b')]?_0x3e7f47['attributes']:_0x5a8900[_0x28ad('0x25')];if(_0x501192[_0x28ad('0x22')][_0x28ad('0x2c')]){_0x3e7f47[_0x28ad('0x2d')]=[{'all':!![]}];}_0x3e7f47=_['merge']({},_0x3e7f47,_0x501192['options']);return db[_0x28ad('0x1d')][_0x28ad('0x2e')](_0x3e7f47)[_0x28ad('0x17')](handleEntityNotFound(_0x48a638,null))[_0x28ad('0x17')](respondWithResult(_0x48a638,null))[_0x28ad('0x23')](handleError(_0x48a638,null));};exports[_0x28ad('0x2f')]=function(_0x26a24b,_0x1050b6){return db[_0x28ad('0x1d')][_0x28ad('0x2f')](_0x26a24b[_0x28ad('0x30')],{})[_0x28ad('0x17')](respondWithResult(_0x1050b6,0xc9))[_0x28ad('0x23')](handleError(_0x1050b6,null));};exports['update']=function(_0x3cd5c1,_0x4c0e35){if(_0x3cd5c1['body']['id']){delete _0x3cd5c1['body']['id'];}return db[_0x28ad('0x1d')][_0x28ad('0x2e')]({'where':{'id':_0x3cd5c1[_0x28ad('0x31')]['id']}})[_0x28ad('0x17')](handleEntityNotFound(_0x4c0e35,null))[_0x28ad('0x17')](saveUpdates(_0x3cd5c1['body'],null))[_0x28ad('0x17')](respondWithResult(_0x4c0e35,null))[_0x28ad('0x23')](handleError(_0x4c0e35,null));};exports[_0x28ad('0x18')]=function(_0x1a2136,_0x4251b8){return db['SmsInteraction']['find']({'where':{'id':_0x1a2136[_0x28ad('0x31')]['id']}})[_0x28ad('0x17')](handleEntityNotFound(_0x4251b8,null))[_0x28ad('0x17')](removeEntity(_0x4251b8,null))[_0x28ad('0x23')](handleError(_0x4251b8,null));};exports['describe']=function(_0x5b6b0a,_0x3c1e15){return db[_0x28ad('0x1d')][_0x28ad('0x32')]()[_0x28ad('0x17')](respondWithResult(_0x3c1e15,null))['catch'](handleError(_0x3c1e15,null));};exports[_0x28ad('0x33')]=function(_0x4417e6,_0x8aa546){return db['SmsMessage']['find']({'where':{'id':_0x4417e6[_0x28ad('0x31')]['id']}})[_0x28ad('0x17')](handleEntityNotFound(_0x8aa546,null))[_0x28ad('0x17')](function(_0x2a577c){if(_0x2a577c){return _0x2a577c[_0x28ad('0x33')](_0x4417e6['body'][_0x28ad('0x34')],_['omit'](_0x4417e6[_0x28ad('0x30')],['ids','id'])||{});}})[_0x28ad('0x17')](respondWithResult(_0x8aa546,null))[_0x28ad('0x23')](handleError(_0x8aa546,null));};exports[_0x28ad('0x35')]=function(_0x4baa60,_0x4b22b6){var _0x17d4bc={'raw':![],'where':{}};var _0x515b2f={};var _0x12e6d1={'count':0x0,'rows':[]};return db['SmsInteraction']['findOne']({'where':{'id':_0x4baa60[_0x28ad('0x31')]['id']}})['then'](handleEntityNotFound(_0x4b22b6,null))[_0x28ad('0x17')](function(_0x4ead8d){if(_0x4ead8d){_0x515b2f[_0x28ad('0x25')]=_[_0x28ad('0x26')](db[_0x28ad('0x36')][_0x28ad('0x1e')]);_0x515b2f[_0x28ad('0x22')]=_['keys'](_0x4baa60['query']);_0x515b2f[_0x28ad('0x27')]=_[_0x28ad('0x28')](_0x515b2f[_0x28ad('0x25')],_0x515b2f['query']);_0x17d4bc[_0x28ad('0x29')]=_[_0x28ad('0x28')](_0x515b2f['model'],qs[_0x28ad('0x2a')](_0x4baa60[_0x28ad('0x22')][_0x28ad('0x2a')]));_0x17d4bc['attributes']=_0x17d4bc[_0x28ad('0x29')]['length']?_0x17d4bc[_0x28ad('0x29')]:_0x515b2f['model'];if(!_0x4baa60[_0x28ad('0x22')]['hasOwnProperty'](_0x28ad('0x37'))){_0x17d4bc[_0x28ad('0x13')]=qs[_0x28ad('0x13')](_0x4baa60[_0x28ad('0x22')][_0x28ad('0x13')]);_0x17d4bc['offset']=qs['offset'](_0x4baa60[_0x28ad('0x22')]['offset']);}_0x17d4bc['order']=qs['sort'](_0x4baa60['query']['sort']);_0x17d4bc[_0x28ad('0x38')]=qs[_0x28ad('0x27')](_[_0x28ad('0x39')](_0x4baa60[_0x28ad('0x22')],_0x515b2f[_0x28ad('0x27')]));_0x17d4bc[_0x28ad('0x38')][_0x28ad('0x3a')]=_0x4ead8d['id'];if(_0x4baa60['query'][_0x28ad('0x3b')]){_0x17d4bc[_0x28ad('0x38')]=_['merge'](_0x17d4bc[_0x28ad('0x38')],{'$or':_['map'](_0x17d4bc[_0x28ad('0x29')],function(_0x4b9ade){var _0x2e8a43={};_0x2e8a43[_0x4b9ade]={'$like':'%'+_0x4baa60['query'][_0x28ad('0x3b')]+'%'};return _0x2e8a43;})});}if(_0x4baa60[_0x28ad('0x22')][_0x28ad('0x3c')]){var _0x4bafe6=_0x4baa60[_0x28ad('0x22')][_0x28ad('0x3c')][_0x28ad('0x3d')](',');var _0x578c86={};_0x578c86[_0x4bafe6[0x0]]={'$gte':moment(_0x4bafe6[0x1])[_0x28ad('0x3e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x17d4bc[_0x28ad('0x38')]=_['merge'](_0x17d4bc[_0x28ad('0x38')],_0x578c86);}_0x17d4bc=_[_0x28ad('0x3f')]({},_0x17d4bc,_0x4baa60['options']);return db[_0x28ad('0x36')]['count']({'where':_0x17d4bc['where']})[_0x28ad('0x17')](function(_0x498232){_0x12e6d1[_0x28ad('0x14')]=_0x498232;if(_0x4baa60[_0x28ad('0x22')]['includeAll']){_0x17d4bc['include']=[{'all':!![]}];}return db['SmsMessage'][_0x28ad('0x40')](_0x17d4bc);})[_0x28ad('0x17')](function(_0x1507d9){_0x12e6d1[_0x28ad('0x41')]=_0x1507d9;return _0x12e6d1;});}})[_0x28ad('0x17')](respondWithFilteredResult(_0x4b22b6,_0x17d4bc))['catch'](handleError(_0x4b22b6,null));};exports[_0x28ad('0x42')]=function(_0x344551,_0x5b6007){return db[_0x28ad('0x1d')][_0x28ad('0x2e')]({'where':{'id':_0x344551['params']['id']}})['then'](handleEntityNotFound(_0x5b6007,null))[_0x28ad('0x17')](function(_0x149549){if(_0x149549){return _0x149549['setTags'](_0x344551[_0x28ad('0x30')][_0x28ad('0x34')],_['omit'](_0x344551[_0x28ad('0x30')],[_0x28ad('0x34'),'id'])||{})[_0x28ad('0x43')](function(){return db['Tag'][_0x28ad('0x40')]({'attributes':['id','name',_0x28ad('0x44')],'where':{'id':_0x344551[_0x28ad('0x30')][_0x28ad('0x34')]}});})[_0x28ad('0x17')](function(_0x2863eb){socket[_0x28ad('0x45')](_0x28ad('0x46'),{'id':Number(_0x344551[_0x28ad('0x31')]['id']),'tags':_0x2863eb||[]});return{'id':Number(_0x344551['params']['id']),'tags':_0x2863eb||[]};});}})[_0x28ad('0x17')](respondWithResult(_0x5b6007,null))[_0x28ad('0x23')](handleError(_0x5b6007,null));};exports[_0x28ad('0x47')]=function(_0x5bb546,_0x9b82ed){return db[_0x28ad('0x1d')][_0x28ad('0x2e')]({'where':{'id':_0x5bb546['params']['id']}})[_0x28ad('0x17')](handleEntityNotFound(_0x9b82ed,null))[_0x28ad('0x17')](function(_0x34f844){if(_0x34f844){return _0x34f844[_0x28ad('0x47')](_0x5bb546['query'][_0x28ad('0x34')]);}})[_0x28ad('0x17')](respondWithStatusCode(_0x9b82ed,null))[_0x28ad('0x23')](handleError(_0x9b82ed,null));};exports[_0x28ad('0x48')]=function(_0x21a24f,_0xe72821){var _0x2e1555=moment()[_0x28ad('0x49')]()['toString']();var _0x1ac7a3=path[_0x28ad('0x4a')](config[_0x28ad('0x4b')],_0x28ad('0x4c'),'files','tmp');var _0x25158e=path['join'](_0x1ac7a3,_0x2e1555);var _0x582df8=util[_0x28ad('0x3e')](_0x28ad('0x4d'),_0x21a24f[_0x28ad('0x31')]['id'],_0x2e1555);var _0x53df77=path[_0x28ad('0x4a')](_0x1ac7a3,_0x582df8);var _0x5d2937=[];_0x5d2937['push']({'model':db[_0x28ad('0x4e')],'as':'User','attributes':['id',_0x28ad('0x4f')],'raw':!![]});_0x5d2937[_0x28ad('0x50')]({'model':db[_0x28ad('0x51')],'as':_0x28ad('0x52'),'attributes':['id',_0x28ad('0x53'),_0x28ad('0x54')],'raw':!![]});var _0x1f0e54=[{'model':db[_0x28ad('0x36')],'as':_0x28ad('0x55'),'attributes':['id',_0x28ad('0x30'),'createdAt','direction',_0x28ad('0x56'),_0x28ad('0x57')],'include':_0x5d2937}];_0x1f0e54['push']({'model':db[_0x28ad('0x58')],'as':_0x28ad('0x59'),'attributes':['id',_0x28ad('0x5a')]});_0x1f0e54[_0x28ad('0x50')]({'model':db[_0x28ad('0x4e')],'as':_0x28ad('0x5b'),'attributes':['id',_0x28ad('0x4f')]});return db[_0x28ad('0x1d')][_0x28ad('0x2e')]({'where':{'id':_0x21a24f['params']['id']},'include':_0x1f0e54})[_0x28ad('0x17')](handleEntityNotFound(_0xe72821,null))[_0x28ad('0x17')](function(_0x2f6488){if(_0x2f6488){var _0x4d7460=_0x2f6488['get']({'plain':!![]});fs[_0x28ad('0x5c')](_0x25158e);var _0x9e8c28={'channel':_0x28ad('0x5d'),'account':_0x4d7460[_0x28ad('0x59')][_0x28ad('0x5a')],'agent':_0x4d7460[_0x28ad('0x5b')]?_0x4d7460['Owner']['fullname']:_0x28ad('0x5e'),'createdAt':moment(_0x4d7460[_0x28ad('0x5f')])[_0x28ad('0x3e')](_0x28ad('0x60'))[_0x28ad('0x61')](),'closedAt':_0x4d7460['closed']?moment(_0x4d7460[_0x28ad('0x62')])[_0x28ad('0x3e')](_0x28ad('0x60'))[_0x28ad('0x61')]():'','disposition':_0x4d7460[_0x28ad('0x63')],'messages':_(_0x4d7460['Messages'])['filter']({'secret':![]})['map'](function(_0x379f81){return{'date':moment(_0x379f81[_0x28ad('0x5f')])[_0x28ad('0x3e')]('YYYY-MM-DD\x20HH:mm:ss')[_0x28ad('0x61')](),'sender':_0x379f81[_0x28ad('0x64')]===_0x28ad('0x65')?_0x379f81[_0x28ad('0x4e')]?_0x379f81['User'][_0x28ad('0x4f')]:'System':_0x379f81[_0x28ad('0x52')]['firstName']+(_0x379f81[_0x28ad('0x52')][_0x28ad('0x54')]?'\x20'+_0x379f81['Contact'][_0x28ad('0x54')]:''),'body':_0x379f81['body'],'direction':_0x379f81[_0x28ad('0x64')]===_0x28ad('0x65')?'A':'C','secret':_0x379f81[_0x28ad('0x56')],'read':_0x379f81[_0x28ad('0x57')]};})[_0x28ad('0x66')]()};return ejs[_0x28ad('0x67')](path[_0x28ad('0x4a')](config[_0x28ad('0x4b')],_0x28ad('0x4c'),_0x28ad('0x68'),_0x28ad('0x69')),{'interaction':_0x9e8c28})['then'](function(_0x3ca1e3){var _0xbbfd3d=path[_0x28ad('0x4a')](_0x25158e,_0x28ad('0x6a')+_0x4d7460['id']+'-'+_0x2e1555+_0x28ad('0x6b'));var _0x135b69={'path':_0xbbfd3d,'channel':_0x28ad('0x5d'),'interactionId':_0x4d7460['id']};return pdf['createPdfFromHTML'](_0x3ca1e3,_0x135b69);})['then'](function(){return new BPromise(function(_0x421fdb,_0x34c9b5){zipdir(_0x25158e,{'saveTo':_0x53df77},function(_0x5465f1,_0x578eff){if(_0x5465f1)return _0x34c9b5(_0x5465f1);return _0x421fdb(_0x578eff);});})[_0x28ad('0x17')](function(){return new BPromise(function(_0x3120eb,_0xd56956){rimraf(_0x25158e,function(_0x22fa22){if(_0x22fa22)_0xd56956(_0x22fa22);return _0x3120eb();});});})[_0x28ad('0x17')](function(){return _0xe72821['download'](_0x53df77,_0x582df8,function(_0x39cbf4){if(_0x39cbf4){console['log']('err',_0x39cbf4);}else{fs[_0x28ad('0x6c')](_0x53df77);}});});});}else{return _0xe72821['sendStatus'](0xc8);}})[_0x28ad('0x23')](handleError(_0xe72821,null));}; \ No newline at end of file +var _0x2a17=['Account','get','mkdirSync','Sms','Owner','N.A.','createdAt','closed','closedAt','Messages','out','System','lastName','renderFile','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','moment','path','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./smsInteraction.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','then','destroy','error','stack','name','send','index','map','SmsInteraction','rawAttributes','key','getOptions','findAll','sms','query','catch','show','params','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','update','addMessage','SmsMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','SmsInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','setTags','spread','color','emit','smsInteractionTags:save','removeTags','unix','toString','root','server','files','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','direction','secret','read','SmsAccount'];(function(_0x5ad651,_0xf9a447){var _0x3283fd=function(_0x5a785a){while(--_0x5a785a){_0x5ad651['push'](_0x5ad651['shift']());}};_0x3283fd(++_0xf9a447);}(_0x2a17,0x1ec));var _0x72a1=function(_0x450fb4,_0x99a5e7){_0x450fb4=_0x450fb4-0x0;var _0x43e91a=_0x2a17[_0x450fb4];return _0x43e91a;};'use strict';var rimraf=require(_0x72a1('0x0'));var zipdir=require(_0x72a1('0x1'));var moment=require(_0x72a1('0x2'));var BPromise=require('bluebird');var util=require('util');var path=require(_0x72a1('0x3'));var ejs=require(_0x72a1('0x4'));var fs=require('fs');var _=require(_0x72a1('0x5'));var Redis=require('ioredis');var interaction=require(_0x72a1('0x6'));var qs=require(_0x72a1('0x7'));var pdf=require(_0x72a1('0x8'));var logger=require(_0x72a1('0x9'))(_0x72a1('0xa'));var config=require(_0x72a1('0xb'));var db=require(_0x72a1('0xc'))['db'];config[_0x72a1('0xd')]=_[_0x72a1('0xe')](config[_0x72a1('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x72a1('0xd')]));require(_0x72a1('0xf'))['register'](socket);function respondWithStatusCode(_0x4c5e30,_0x135a4a){_0x135a4a=_0x135a4a||0xcc;return function(_0x56bf87){if(_0x56bf87){return _0x4c5e30[_0x72a1('0x10')](_0x135a4a);}return _0x4c5e30[_0x72a1('0x11')](_0x135a4a)[_0x72a1('0x12')]();};}function respondWithResult(_0x42286c,_0x1bde34){_0x1bde34=_0x1bde34||0xc8;return function(_0x1b3ec6){if(_0x1b3ec6){return _0x42286c[_0x72a1('0x11')](_0x1bde34)[_0x72a1('0x13')](_0x1b3ec6);}};}function respondWithFilteredResult(_0x45d2c1,_0x285501){return function(_0x2b3dfe){if(_0x2b3dfe){var _0x513bf2=typeof _0x285501['offset']===_0x72a1('0x14')&&typeof _0x285501[_0x72a1('0x15')]===_0x72a1('0x14');var _0x4ddd30=_0x2b3dfe[_0x72a1('0x16')];var _0x268051=_0x513bf2?0x0:_0x285501[_0x72a1('0x17')];var _0xb9df97=_0x513bf2?_0x2b3dfe[_0x72a1('0x16')]:_0x285501['offset']+_0x285501[_0x72a1('0x15')];var _0x282459;if(_0xb9df97>=_0x4ddd30){_0xb9df97=_0x4ddd30;_0x282459=0xc8;}else{_0x282459=0xce;}_0x45d2c1[_0x72a1('0x11')](_0x282459);return _0x45d2c1[_0x72a1('0x18')]('Content-Range',_0x268051+'-'+_0xb9df97+'/'+_0x4ddd30)[_0x72a1('0x13')](_0x2b3dfe);}return null;};}function saveUpdates(_0x94de07){return function(_0x1649f9){if(_0x1649f9){return _0x1649f9['update'](_0x94de07)[_0x72a1('0x19')](function(_0x46a683){return _0x46a683;});}return null;};}function removeEntity(_0x36d263){return function(_0x20d781){if(_0x20d781){return _0x20d781[_0x72a1('0x1a')]()[_0x72a1('0x19')](function(){_0x36d263[_0x72a1('0x11')](0xcc)[_0x72a1('0x12')]();});}};}function handleEntityNotFound(_0xc7bde7){return function(_0x2e58de){if(!_0x2e58de){_0xc7bde7[_0x72a1('0x10')](0x194);}return _0x2e58de;};}function handleError(_0x52902d,_0x56e123){_0x56e123=_0x56e123||0x1f4;return function(_0x306b7d){logger[_0x72a1('0x1b')](_0x306b7d[_0x72a1('0x1c')]);if(_0x306b7d['name']){delete _0x306b7d[_0x72a1('0x1d')];}_0x52902d['status'](_0x56e123)[_0x72a1('0x1e')](_0x306b7d);};}exports[_0x72a1('0x1f')]=function(_0x403274,_0x5aa5c7){var _0x55fc1f={};var _0x30429e=_[_0x72a1('0x20')](db[_0x72a1('0x21')][_0x72a1('0x22')],function(_0x484473){return{'name':_0x484473['fieldName'],'type':_0x484473['type'][_0x72a1('0x23')]};});_0x55fc1f=qs[_0x72a1('0x24')](_0x30429e,_0x403274);return interaction[_0x72a1('0x25')](_0x72a1('0x26'),_0x403274[_0x72a1('0x27')],_0x403274['user'],_0x55fc1f,_0x30429e)[_0x72a1('0x19')](respondWithFilteredResult(_0x5aa5c7,_0x55fc1f))[_0x72a1('0x28')](handleError(_0x5aa5c7,null));};exports[_0x72a1('0x29')]=function(_0x13ed19,_0x161fbc){var _0x581712={'raw':![],'where':{'id':_0x13ed19[_0x72a1('0x2a')]['id']}},_0x29d0ce={};_0x29d0ce[_0x72a1('0x2b')]=_[_0x72a1('0x2c')](db[_0x72a1('0x21')][_0x72a1('0x22')]);_0x29d0ce[_0x72a1('0x27')]=_[_0x72a1('0x2c')](_0x13ed19[_0x72a1('0x27')]);_0x29d0ce[_0x72a1('0x2d')]=_['intersection'](_0x29d0ce[_0x72a1('0x2b')],_0x29d0ce['query']);_0x581712[_0x72a1('0x2e')]=_[_0x72a1('0x2f')](_0x29d0ce[_0x72a1('0x2b')],qs[_0x72a1('0x30')](_0x13ed19[_0x72a1('0x27')][_0x72a1('0x30')]));_0x581712[_0x72a1('0x2e')]=_0x581712['attributes'][_0x72a1('0x31')]?_0x581712[_0x72a1('0x2e')]:_0x29d0ce[_0x72a1('0x2b')];if(_0x13ed19['query'][_0x72a1('0x32')]){_0x581712[_0x72a1('0x33')]=[{'all':!![]}];}_0x581712=_[_0x72a1('0x34')]({},_0x581712,_0x13ed19[_0x72a1('0x35')]);return db['SmsInteraction'][_0x72a1('0x36')](_0x581712)[_0x72a1('0x19')](handleEntityNotFound(_0x161fbc,null))[_0x72a1('0x19')](respondWithResult(_0x161fbc,null))[_0x72a1('0x28')](handleError(_0x161fbc,null));};exports[_0x72a1('0x37')]=function(_0xf151b5,_0x5b0656){return db[_0x72a1('0x21')][_0x72a1('0x37')](_0xf151b5[_0x72a1('0x38')],{})['then'](respondWithResult(_0x5b0656,0xc9))[_0x72a1('0x28')](handleError(_0x5b0656,null));};exports[_0x72a1('0x39')]=function(_0x4f9429,_0x15968f){if(_0x4f9429[_0x72a1('0x38')]['id']){delete _0x4f9429['body']['id'];}return db[_0x72a1('0x21')][_0x72a1('0x36')]({'where':{'id':_0x4f9429['params']['id']}})[_0x72a1('0x19')](handleEntityNotFound(_0x15968f,null))[_0x72a1('0x19')](saveUpdates(_0x4f9429[_0x72a1('0x38')],null))[_0x72a1('0x19')](respondWithResult(_0x15968f,null))[_0x72a1('0x28')](handleError(_0x15968f,null));};exports[_0x72a1('0x1a')]=function(_0x34b234,_0x422602){return db[_0x72a1('0x21')][_0x72a1('0x36')]({'where':{'id':_0x34b234[_0x72a1('0x2a')]['id']}})[_0x72a1('0x19')](handleEntityNotFound(_0x422602,null))[_0x72a1('0x19')](removeEntity(_0x422602,null))[_0x72a1('0x28')](handleError(_0x422602,null));};exports['describe']=function(_0x30e94b,_0x418166){return db[_0x72a1('0x21')]['describe']()[_0x72a1('0x19')](respondWithResult(_0x418166,null))[_0x72a1('0x28')](handleError(_0x418166,null));};exports[_0x72a1('0x3a')]=function(_0x356576,_0x4e3adf){return db[_0x72a1('0x3b')][_0x72a1('0x36')]({'where':{'id':_0x356576[_0x72a1('0x2a')]['id']}})[_0x72a1('0x19')](handleEntityNotFound(_0x4e3adf,null))[_0x72a1('0x19')](function(_0x55b46b){if(_0x55b46b){return _0x55b46b[_0x72a1('0x3a')](_0x356576[_0x72a1('0x38')][_0x72a1('0x3c')],_[_0x72a1('0x3d')](_0x356576[_0x72a1('0x38')],['ids','id'])||{});}})[_0x72a1('0x19')](respondWithResult(_0x4e3adf,null))[_0x72a1('0x28')](handleError(_0x4e3adf,null));};exports[_0x72a1('0x3e')]=function(_0x5bdf9e,_0xe9c4f1){var _0x3af8aa={'raw':![],'where':{}};var _0x8faf58={};var _0x54c9c2={'count':0x0,'rows':[]};return db[_0x72a1('0x21')][_0x72a1('0x3f')]({'where':{'id':_0x5bdf9e[_0x72a1('0x2a')]['id']}})['then'](handleEntityNotFound(_0xe9c4f1,null))[_0x72a1('0x19')](function(_0x2a8de8){if(_0x2a8de8){_0x8faf58[_0x72a1('0x2b')]=_['keys'](db[_0x72a1('0x3b')][_0x72a1('0x22')]);_0x8faf58['query']=_[_0x72a1('0x2c')](_0x5bdf9e[_0x72a1('0x27')]);_0x8faf58['filters']=_[_0x72a1('0x2f')](_0x8faf58[_0x72a1('0x2b')],_0x8faf58[_0x72a1('0x27')]);_0x3af8aa[_0x72a1('0x2e')]=_[_0x72a1('0x2f')](_0x8faf58['model'],qs[_0x72a1('0x30')](_0x5bdf9e[_0x72a1('0x27')][_0x72a1('0x30')]));_0x3af8aa[_0x72a1('0x2e')]=_0x3af8aa[_0x72a1('0x2e')][_0x72a1('0x31')]?_0x3af8aa[_0x72a1('0x2e')]:_0x8faf58[_0x72a1('0x2b')];if(!_0x5bdf9e['query']['hasOwnProperty'](_0x72a1('0x40'))){_0x3af8aa[_0x72a1('0x15')]=qs[_0x72a1('0x15')](_0x5bdf9e[_0x72a1('0x27')][_0x72a1('0x15')]);_0x3af8aa['offset']=qs['offset'](_0x5bdf9e[_0x72a1('0x27')][_0x72a1('0x17')]);}_0x3af8aa[_0x72a1('0x41')]=qs[_0x72a1('0x42')](_0x5bdf9e[_0x72a1('0x27')][_0x72a1('0x42')]);_0x3af8aa[_0x72a1('0x43')]=qs[_0x72a1('0x2d')](_['pick'](_0x5bdf9e['query'],_0x8faf58[_0x72a1('0x2d')]));_0x3af8aa[_0x72a1('0x43')][_0x72a1('0x44')]=_0x2a8de8['id'];if(_0x5bdf9e['query'][_0x72a1('0x45')]){_0x3af8aa[_0x72a1('0x43')]=_['merge'](_0x3af8aa[_0x72a1('0x43')],{'$or':_['map'](_0x3af8aa[_0x72a1('0x2e')],function(_0x4cb9d8){var _0x18c10a={};_0x18c10a[_0x4cb9d8]={'$like':'%'+_0x5bdf9e[_0x72a1('0x27')][_0x72a1('0x45')]+'%'};return _0x18c10a;})});}if(_0x5bdf9e[_0x72a1('0x27')][_0x72a1('0x46')]){var _0x376d00=_0x5bdf9e[_0x72a1('0x27')][_0x72a1('0x46')]['split'](',');var _0x4a5465={};_0x4a5465[_0x376d00[0x0]]={'$gte':moment(_0x376d00[0x1])[_0x72a1('0x47')](_0x72a1('0x48'))};_0x3af8aa[_0x72a1('0x43')]=_[_0x72a1('0x34')](_0x3af8aa[_0x72a1('0x43')],_0x4a5465);}_0x3af8aa=_[_0x72a1('0x34')]({},_0x3af8aa,_0x5bdf9e[_0x72a1('0x35')]);return db[_0x72a1('0x3b')][_0x72a1('0x16')]({'where':_0x3af8aa[_0x72a1('0x43')]})[_0x72a1('0x19')](function(_0x336e97){_0x54c9c2['count']=_0x336e97;if(_0x5bdf9e['query'][_0x72a1('0x32')]){_0x3af8aa[_0x72a1('0x33')]=[{'all':!![]}];}return db[_0x72a1('0x3b')]['findAll'](_0x3af8aa);})[_0x72a1('0x19')](function(_0x2643d5){_0x54c9c2['rows']=_0x2643d5;return _0x54c9c2;});}})[_0x72a1('0x19')](respondWithFilteredResult(_0xe9c4f1,_0x3af8aa))['catch'](handleError(_0xe9c4f1,null));};exports[_0x72a1('0x49')]=function(_0x189ed1,_0x420b8e){return db[_0x72a1('0x21')][_0x72a1('0x36')]({'where':{'id':_0x189ed1[_0x72a1('0x2a')]['id']}})[_0x72a1('0x19')](handleEntityNotFound(_0x420b8e,null))['then'](function(_0x3aeaff){if(_0x3aeaff){return _0x3aeaff[_0x72a1('0x4a')](_0x189ed1['body'][_0x72a1('0x3c')],_[_0x72a1('0x3d')](_0x189ed1[_0x72a1('0x38')],[_0x72a1('0x3c'),'id'])||{})[_0x72a1('0x4b')](function(){return db['Tag'][_0x72a1('0x25')]({'attributes':['id',_0x72a1('0x1d'),_0x72a1('0x4c')],'where':{'id':_0x189ed1[_0x72a1('0x38')]['ids']}});})[_0x72a1('0x19')](function(_0x58e447){socket[_0x72a1('0x4d')](_0x72a1('0x4e'),{'id':Number(_0x189ed1[_0x72a1('0x2a')]['id']),'tags':_0x58e447||[]});return{'id':Number(_0x189ed1[_0x72a1('0x2a')]['id']),'tags':_0x58e447||[]};});}})['then'](respondWithResult(_0x420b8e,null))['catch'](handleError(_0x420b8e,null));};exports[_0x72a1('0x4f')]=function(_0x588593,_0x2efc43){return db['SmsInteraction'][_0x72a1('0x36')]({'where':{'id':_0x588593[_0x72a1('0x2a')]['id']}})[_0x72a1('0x19')](handleEntityNotFound(_0x2efc43,null))[_0x72a1('0x19')](function(_0x3b66d1){if(_0x3b66d1){return _0x3b66d1[_0x72a1('0x4f')](_0x588593[_0x72a1('0x27')][_0x72a1('0x3c')]);}})[_0x72a1('0x19')](respondWithStatusCode(_0x2efc43,null))[_0x72a1('0x28')](handleError(_0x2efc43,null));};exports['download']=function(_0x5cdfe7,_0x45c5dc){var _0x3eb4b2=moment()[_0x72a1('0x50')]()[_0x72a1('0x51')]();var _0x57e61b=path['join'](config[_0x72a1('0x52')],_0x72a1('0x53'),_0x72a1('0x54'),_0x72a1('0x55'));var _0x55c5d7=path[_0x72a1('0x56')](_0x57e61b,_0x3eb4b2);var _0x1123eb=util[_0x72a1('0x47')](_0x72a1('0x57'),_0x5cdfe7['params']['id'],_0x3eb4b2);var _0x5610f8=path[_0x72a1('0x56')](_0x57e61b,_0x1123eb);var _0x1fd467=[];_0x1fd467[_0x72a1('0x58')]({'model':db[_0x72a1('0x59')],'as':_0x72a1('0x59'),'attributes':['id',_0x72a1('0x5a')],'raw':!![]});_0x1fd467[_0x72a1('0x58')]({'model':db[_0x72a1('0x5b')],'as':_0x72a1('0x5c'),'attributes':['id',_0x72a1('0x5d'),'lastName'],'raw':!![]});var _0x3f6db0=[{'model':db[_0x72a1('0x3b')],'as':'Messages','attributes':['id',_0x72a1('0x38'),'createdAt',_0x72a1('0x5e'),_0x72a1('0x5f'),_0x72a1('0x60')],'include':_0x1fd467}];_0x3f6db0['push']({'model':db[_0x72a1('0x61')],'as':_0x72a1('0x62'),'attributes':['id',_0x72a1('0x1d')]});_0x3f6db0[_0x72a1('0x58')]({'model':db['User'],'as':'Owner','attributes':['id',_0x72a1('0x5a')]});return db[_0x72a1('0x21')][_0x72a1('0x36')]({'where':{'id':_0x5cdfe7[_0x72a1('0x2a')]['id']},'include':_0x3f6db0})['then'](handleEntityNotFound(_0x45c5dc,null))[_0x72a1('0x19')](function(_0x3226b1){if(_0x3226b1){var _0x14caad=_0x3226b1[_0x72a1('0x63')]({'plain':!![]});fs[_0x72a1('0x64')](_0x55c5d7);var _0x982c64={'channel':_0x72a1('0x65'),'account':_0x14caad[_0x72a1('0x62')][_0x72a1('0x1d')],'agent':_0x14caad[_0x72a1('0x66')]?_0x14caad[_0x72a1('0x66')][_0x72a1('0x5a')]:_0x72a1('0x67'),'createdAt':moment(_0x14caad[_0x72a1('0x68')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x72a1('0x51')](),'closedAt':_0x14caad[_0x72a1('0x69')]?moment(_0x14caad[_0x72a1('0x6a')])[_0x72a1('0x47')](_0x72a1('0x48'))[_0x72a1('0x51')]():'','disposition':_0x14caad['disposition'],'messages':_(_0x14caad[_0x72a1('0x6b')])[_0x72a1('0x45')]({'secret':![]})[_0x72a1('0x20')](function(_0x338a0c){return{'date':moment(_0x338a0c[_0x72a1('0x68')])[_0x72a1('0x47')]('YYYY-MM-DD\x20HH:mm:ss')[_0x72a1('0x51')](),'sender':_0x338a0c[_0x72a1('0x5e')]===_0x72a1('0x6c')?_0x338a0c[_0x72a1('0x59')]?_0x338a0c['User'][_0x72a1('0x5a')]:_0x72a1('0x6d'):_0x338a0c[_0x72a1('0x5c')][_0x72a1('0x5d')]+(_0x338a0c[_0x72a1('0x5c')][_0x72a1('0x6e')]?'\x20'+_0x338a0c[_0x72a1('0x5c')][_0x72a1('0x6e')]:''),'body':_0x338a0c[_0x72a1('0x38')],'direction':_0x338a0c[_0x72a1('0x5e')]===_0x72a1('0x6c')?'A':'C','secret':_0x338a0c[_0x72a1('0x5f')],'read':_0x338a0c[_0x72a1('0x60')]};})['value']()};return ejs[_0x72a1('0x6f')](path[_0x72a1('0x56')](config['root'],'server','views',_0x72a1('0x70')),{'interaction':_0x982c64})['then'](function(_0x448ece){var _0x247562=path[_0x72a1('0x56')](_0x55c5d7,'transcript-'+_0x14caad['id']+'-'+_0x3eb4b2+_0x72a1('0x71'));var _0x30b36d={'path':_0x247562,'channel':_0x72a1('0x65'),'interactionId':_0x14caad['id']};return pdf[_0x72a1('0x72')](_0x448ece,_0x30b36d);})['then'](function(){return new BPromise(function(_0x59f7d3,_0x4f2cf4){zipdir(_0x55c5d7,{'saveTo':_0x5610f8},function(_0x2a6eac,_0x2c54b1){if(_0x2a6eac)return _0x4f2cf4(_0x2a6eac);return _0x59f7d3(_0x2c54b1);});})[_0x72a1('0x19')](function(){return new BPromise(function(_0x524199,_0x41caf0){rimraf(_0x55c5d7,function(_0x1fc84d){if(_0x1fc84d)_0x41caf0(_0x1fc84d);return _0x524199();});});})[_0x72a1('0x19')](function(){return _0x45c5dc[_0x72a1('0x73')](_0x5610f8,_0x1123eb,function(_0x2ebc87){if(_0x2ebc87){console['log'](_0x72a1('0x74'),_0x2ebc87);}else{fs[_0x72a1('0x75')](_0x5610f8);}});});});}else{return _0x45c5dc[_0x72a1('0x10')](0xc8);}})['catch'](handleError(_0x45c5dc,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 5622dcf..94178cf 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 _0x3423=['then','setDataValue','Users','map','findAll','catch','hasOwnProperty','exports','SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x455b12,_0x1fcb37){var _0x33a47e=function(_0x496658){while(--_0x496658){_0x455b12['push'](_0x455b12['shift']());}};_0x33a47e(++_0x1fcb37);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x3342('0x0')];var SmsMessage=require(_0x3342('0x1'))['db'][_0x3342('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x3342('0x3')](0x0);var events={'afterCreate':_0x3342('0x4'),'afterUpdate':_0x3342('0x5'),'afterDestroy':_0x3342('0x6')};function emitEvent(_0x3c5d8d){return function(_0x3075f8,_0x19206f,_0x467453){_0x3075f8[_0x3342('0x7')]({'attributes':['id'],'raw':!![]})[_0x3342('0x8')](function(_0x420d4b){_0x3075f8[_0x3342('0x9')](_0x3342('0xa'),_0x420d4b[_0x3342('0xb')](function(_0xd9d129){return{'id':_0xd9d129['id']};}));return SmsMessage[_0x3342('0xc')]({'where':{'SmsInteractionId':_0x3075f8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x582c37){_0x3075f8[_0x3342('0x9')]('unreadMessages',_0x582c37['length']);SmsInteractionEvents['emit'](_0x3c5d8d+':'+_0x3075f8['id'],_0x3075f8);SmsInteractionEvents['emit'](_0x3c5d8d,_0x3075f8);_0x467453(null);})[_0x3342('0xd')](_0x467453(null));};}for(var e in events){if(events[_0x3342('0xe')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x3342('0xf')]=SmsInteractionEvents; \ No newline at end of file +var _0x0972=['save','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners'];(function(_0x47fd5e,_0x206e7b){var _0x1ef01e=function(_0x27aa7d){while(--_0x27aa7d){_0x47fd5e['push'](_0x47fd5e['shift']());}};_0x1ef01e(++_0x206e7b);}(_0x0972,0x64));var _0x2097=function(_0x2c1a57,_0x452283){_0x2c1a57=_0x2c1a57-0x0;var _0x15cf0e=_0x0972[_0x2c1a57];return _0x15cf0e;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x2097('0x0'))['db']['SmsInteraction'];var SmsMessage=require(_0x2097('0x0'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2097('0x1')](0x0);var events={'afterCreate':_0x2097('0x2'),'afterUpdate':'update','afterDestroy':_0x2097('0x3')};function emitEvent(_0x431d1c){return function(_0xe6fbae,_0x1a7d26,_0x2f84d8){_0xe6fbae[_0x2097('0x4')]({'attributes':['id'],'raw':!![]})[_0x2097('0x5')](function(_0x59739f){_0xe6fbae[_0x2097('0x6')](_0x2097('0x7'),_0x59739f[_0x2097('0x8')](function(_0x1d94e2){return{'id':_0x1d94e2['id']};}));return SmsMessage[_0x2097('0x9')]({'where':{'SmsInteractionId':_0xe6fbae['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e0024){_0xe6fbae[_0x2097('0x6')](_0x2097('0xa'),_0x2e0024[_0x2097('0xb')]);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c+':'+_0xe6fbae['id'],_0xe6fbae);SmsInteractionEvents[_0x2097('0xc')](_0x431d1c,_0xe6fbae);_0x2f84d8(null);})[_0x2097('0xd')](_0x2f84d8(null));};}for(var e in events){if(events[_0x2097('0xe')](e)){var event=events[e];SmsInteraction[_0x2097('0xf')](e,emitEvent(event));}}module[_0x2097('0x10')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 7a5474a..5bf750a 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 _0x005f=['rimraf','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5f1d10,_0x556f71){var _0x4b42ae=function(_0x687429){while(--_0x687429){_0x5f1d10['push'](_0x5f1d10['shift']());}};_0x4b42ae(++_0x556f71);}(_0x005f,0xe2));var _0xf005=function(_0x3f5729,_0x1fa3d0){_0x3f5729=_0x3f5729-0x0;var _0xadb6c5=_0x005f[_0x3f5729];return _0xadb6c5;};'use strict';var _=require(_0xf005('0x0'));var util=require(_0xf005('0x1'));var logger=require(_0xf005('0x2'))(_0xf005('0x3'));var moment=require(_0xf005('0x4'));var BPromise=require(_0xf005('0x5'));var rp=require(_0xf005('0x6'));var fs=require('fs');var path=require(_0xf005('0x7'));var rimraf=require(_0xf005('0x8'));var config=require('../../config/environment');var attributes=require(_0xf005('0x9'));module[_0xf005('0xa')]=function(_0x25b910,_0x2b4b48){return _0x25b910['define'](_0xf005('0xb'),attributes,{'tableName':_0xf005('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30c15c,_0xe90c6f,_0x54059d){if(_0x30c15c[_0xf005('0xd')](_0xf005('0xe'))){_0x30c15c[_0xf005('0xf')]=moment()[_0xf005('0x10')](_0xf005('0x11'));}_0x54059d(null,_0x30c15c);}}});}; \ No newline at end of file +var _0xc8b0=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sms_interactions'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0xc8b0,0x9e));var _0x0c8b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc8b0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0c8b('0x0'));var util=require(_0x0c8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0c8b('0x2'));var rp=require(_0x0c8b('0x3'));var fs=require('fs');var path=require(_0x0c8b('0x4'));var rimraf=require(_0x0c8b('0x5'));var config=require(_0x0c8b('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x0c8b('0x7')]=function(_0x414839,_0x6f012a){return _0x414839[_0x0c8b('0x8')]('SmsInteraction',attributes,{'tableName':_0x0c8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x538901,_0x1a4963,_0x12fb6e){if(_0x538901[_0x0c8b('0xa')](_0x0c8b('0xb'))){_0x538901[_0x0c8b('0xc')]=moment()['format'](_0x0c8b('0xd'));}_0x12fb6e(null,_0x538901);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 658d90f..01f5262 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 _0xb20d=['debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','SmsInteraction','addTags','ids','omit','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','request','then','info'];(function(_0x4f81b8,_0x5ab18b){var _0x3408c1=function(_0x4f78d5){while(--_0x4f78d5){_0x4f81b8['push'](_0x4f81b8['shift']());}};_0x3408c1(++_0x5ab18b);}(_0xb20d,0x96));var _0xdb20=function(_0x5fbeb0,_0x3eb180){_0x5fbeb0=_0x5fbeb0-0x0;var _0x502a3a=_0xb20d[_0x5fbeb0];return _0x502a3a;};'use strict';var _=require(_0xdb20('0x0'));var util=require(_0xdb20('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xdb20('0x2'));var fs=require('fs');var Redis=require(_0xdb20('0x3'));var db=require(_0xdb20('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb20('0x5'))(_0xdb20('0x6'));var config=require('../../config/environment');var jayson=require(_0xdb20('0x7'));var client=jayson[_0xdb20('0x8')][_0xdb20('0x9')]({'port':0x232a});config[_0xdb20('0xa')]=_[_0xdb20('0xb')](config[_0xdb20('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xdb20('0xc'))(new Redis(config[_0xdb20('0xa')]));require(_0xdb20('0xd'))[_0xdb20('0xe')](socket);function respondWithRpcPromise(_0x2d3d20,_0x3aa540,_0x4dd8f1){return new BPromise(function(_0x5804fc,_0x2ea05c){return client[_0xdb20('0xf')](_0x2d3d20,_0x4dd8f1)[_0xdb20('0x10')](function(_0x2ea7ef){logger[_0xdb20('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x3aa540,'request\x20sent');logger[_0xdb20('0x12')](_0xdb20('0x13'),_0x3aa540,_0xdb20('0x14'),JSON[_0xdb20('0x15')](_0x2ea7ef));if(_0x2ea7ef[_0xdb20('0x16')]){if(_0x2ea7ef[_0xdb20('0x16')][_0xdb20('0x17')]===0x1f4){logger['error'](_0xdb20('0x18'),_0x3aa540,_0x2ea7ef[_0xdb20('0x16')][_0xdb20('0x19')]);return _0x2ea05c(_0x2ea7ef[_0xdb20('0x16')][_0xdb20('0x19')]);}logger[_0xdb20('0x16')](_0xdb20('0x18'),_0x3aa540,_0x2ea7ef[_0xdb20('0x16')]['message']);return _0x5804fc(_0x2ea7ef[_0xdb20('0x16')][_0xdb20('0x19')]);}else{logger[_0xdb20('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x3aa540,_0xdb20('0x14'));_0x5804fc(_0x2ea7ef[_0xdb20('0x1a')]['message']);}})[_0xdb20('0x1b')](function(_0x232851){logger[_0xdb20('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x3aa540,_0x232851);_0x2ea05c(_0x232851);});});}exports[_0xdb20('0x1c')]=function(_0x87a744){var _0x2c3810=this;return new Promise(function(_0x3ccbbf,_0x473f1c){return db['SmsInteraction'][_0xdb20('0x1d')](_0x87a744[_0xdb20('0x1e')],{'raw':_0x87a744['options']?_0x87a744[_0xdb20('0x1f')][_0xdb20('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x87a744['options']?_0x87a744[_0xdb20('0x1f')][_0xdb20('0x21')]||null:null,'attributes':_0x87a744[_0xdb20('0x1f')]?_0x87a744[_0xdb20('0x1f')][_0xdb20('0x22')]||null:null,'limit':_0x87a744[_0xdb20('0x1f')]?_0x87a744['options'][_0xdb20('0x23')]||null:null})[_0xdb20('0x10')](function(_0x638edd){logger[_0xdb20('0x11')]('UpdateSmsInteraction',_0x87a744);logger[_0xdb20('0x12')](_0xdb20('0x1c'),_0x87a744,JSON[_0xdb20('0x15')](_0x638edd));_0x3ccbbf(_0x638edd);})['catch'](function(_0x49ae43){logger[_0xdb20('0x16')](_0xdb20('0x1c'),_0x49ae43[_0xdb20('0x19')],_0x87a744);_0x473f1c(_0x2c3810[_0xdb20('0x16')](0x1f4,_0x49ae43['message']));});});};exports[_0xdb20('0x24')]=function(_0x15a74b){return new Promise(function(_0x696fd,_0x3ca25f){return db[_0xdb20('0x25')]['find']({'where':_0x15a74b[_0xdb20('0x1f')]?_0x15a74b[_0xdb20('0x1f')][_0xdb20('0x21')]||null:null})[_0xdb20('0x10')](function(_0x50f716){if(_0x50f716){return _0x50f716[_0xdb20('0x26')](_0x15a74b[_0xdb20('0x1e')][_0xdb20('0x27')],_[_0xdb20('0x28')](_0x15a74b[_0xdb20('0x1e')],[_0xdb20('0x27'),'id'])||{});}})['spread'](function(_0xf8672){logger[_0xdb20('0x11')]('AddTags',_0x15a74b);logger[_0xdb20('0x12')](_0xdb20('0x29'),_0x15a74b,JSON[_0xdb20('0x15')](_0xf8672));_0x696fd(_0xf8672);})[_0xdb20('0x1b')](function(_0x4f0678){logger[_0xdb20('0x16')](_0xdb20('0x29'),_0x4f0678[_0xdb20('0x19')],_0x15a74b);_0x3ca25f(_this['error'](0x1f4,_0x4f0678[_0xdb20('0x19')]));});});}; \ No newline at end of file +var _0xac92=['update','body','options','attributes','limit','catch','AddTagsToSmsInteraction','where','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./smsInteraction.socket','register','then','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SmsInteraction,\x20%s,\x20%s','message','info','result','UpdateSmsInteraction','SmsInteraction'];(function(_0x23698f,_0x4aa89d){var _0x3221a8=function(_0x1abbc7){while(--_0x1abbc7){_0x23698f['push'](_0x23698f['shift']());}};_0x3221a8(++_0x4aa89d);}(_0xac92,0xb0));var _0x2ac9=function(_0x366965,_0x31a4da){_0x366965=_0x366965-0x0;var _0x18f308=_0xac92[_0x366965];return _0x18f308;};'use strict';var _=require('lodash');var util=require(_0x2ac9('0x0'));var moment=require(_0x2ac9('0x1'));var BPromise=require(_0x2ac9('0x2'));var rs=require(_0x2ac9('0x3'));var fs=require('fs');var Redis=require(_0x2ac9('0x4'));var db=require(_0x2ac9('0x5'))['db'];var utils=require(_0x2ac9('0x6'));var logger=require(_0x2ac9('0x7'))(_0x2ac9('0x8'));var config=require(_0x2ac9('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x2ac9('0xa')][_0x2ac9('0xb')]({'port':0x232a});config[_0x2ac9('0xc')]=_[_0x2ac9('0xd')](config[_0x2ac9('0xc')],{'host':_0x2ac9('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2ac9('0xf'))[_0x2ac9('0x10')](socket);function respondWithRpcPromise(_0x2158ed,_0x170795,_0x56bef6){return new BPromise(function(_0x52a836,_0x3b14a1){return client['request'](_0x2158ed,_0x56bef6)[_0x2ac9('0x11')](function(_0x89ad8b){logger['info']('SmsInteraction,\x20%s,\x20%s',_0x170795,'request\x20sent');logger[_0x2ac9('0x12')](_0x2ac9('0x13'),_0x170795,_0x2ac9('0x14'),JSON[_0x2ac9('0x15')](_0x89ad8b));if(_0x89ad8b['error']){if(_0x89ad8b[_0x2ac9('0x16')]['code']===0x1f4){logger[_0x2ac9('0x16')](_0x2ac9('0x17'),_0x170795,_0x89ad8b['error'][_0x2ac9('0x18')]);return _0x3b14a1(_0x89ad8b[_0x2ac9('0x16')][_0x2ac9('0x18')]);}logger['error'](_0x2ac9('0x17'),_0x170795,_0x89ad8b[_0x2ac9('0x16')][_0x2ac9('0x18')]);return _0x52a836(_0x89ad8b[_0x2ac9('0x16')][_0x2ac9('0x18')]);}else{logger[_0x2ac9('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x170795,_0x2ac9('0x14'));_0x52a836(_0x89ad8b[_0x2ac9('0x1a')][_0x2ac9('0x18')]);}})['catch'](function(_0xd660ae){logger[_0x2ac9('0x16')](_0x2ac9('0x17'),_0x170795,_0xd660ae);_0x3b14a1(_0xd660ae);});});}exports[_0x2ac9('0x1b')]=function(_0x465b1d){var _0x4cfbfa=this;return new Promise(function(_0x5e38d2,_0x5b836b){return db[_0x2ac9('0x1c')][_0x2ac9('0x1d')](_0x465b1d[_0x2ac9('0x1e')],{'raw':_0x465b1d[_0x2ac9('0x1f')]?_0x465b1d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x465b1d['options']?_0x465b1d[_0x2ac9('0x1f')]['where']||null:null,'attributes':_0x465b1d[_0x2ac9('0x1f')]?_0x465b1d['options'][_0x2ac9('0x20')]||null:null,'limit':_0x465b1d[_0x2ac9('0x1f')]?_0x465b1d[_0x2ac9('0x1f')][_0x2ac9('0x21')]||null:null})['then'](function(_0x25da79){logger[_0x2ac9('0x19')](_0x2ac9('0x1b'),_0x465b1d);logger[_0x2ac9('0x12')]('UpdateSmsInteraction',_0x465b1d,JSON[_0x2ac9('0x15')](_0x25da79));_0x5e38d2(_0x25da79);})[_0x2ac9('0x22')](function(_0x37b18b){logger['error'](_0x2ac9('0x1b'),_0x37b18b['message'],_0x465b1d);_0x5b836b(_0x4cfbfa[_0x2ac9('0x16')](0x1f4,_0x37b18b[_0x2ac9('0x18')]));});});};exports[_0x2ac9('0x23')]=function(_0x44209d){return new Promise(function(_0x10ffad,_0x5d9fbc){return db[_0x2ac9('0x1c')]['find']({'where':_0x44209d[_0x2ac9('0x1f')]?_0x44209d[_0x2ac9('0x1f')][_0x2ac9('0x24')]||null:null})[_0x2ac9('0x11')](function(_0x8123f6){if(_0x8123f6){return _0x8123f6['addTags'](_0x44209d['body'][_0x2ac9('0x25')],_[_0x2ac9('0x26')](_0x44209d[_0x2ac9('0x1e')],['ids','id'])||{});}})[_0x2ac9('0x27')](function(_0x5c01a2){logger['info']('AddTags',_0x44209d);logger[_0x2ac9('0x12')](_0x2ac9('0x28'),_0x44209d,JSON[_0x2ac9('0x15')](_0x5c01a2));_0x10ffad(_0x5c01a2);})['catch'](function(_0x3286e7){logger[_0x2ac9('0x16')](_0x2ac9('0x28'),_0x3286e7['message'],_0x44209d);_0x5d9fbc(_this['error'](0x1f4,_0x3286e7['message']));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 662f2b9..f15bfa4 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 _0xb176=['./smsInteraction.events','remove','register','length','smsInteraction:'];(function(_0x2cb445,_0x27b229){var _0x58664e=function(_0xe1d3d6){while(--_0xe1d3d6){_0x2cb445['push'](_0x2cb445['shift']());}};_0x58664e(++_0x27b229);}(_0xb176,0x11d));var _0x6b17=function(_0x532b8b,_0x4d0cb0){_0x532b8b=_0x532b8b-0x0;var _0x3e2607=_0xb176[_0x532b8b];return _0x3e2607;};'use strict';var SmsInteractionEvents=require(_0x6b17('0x0'));var events=['save',_0x6b17('0x1'),'update'];function createListener(_0xf4cb6,_0x1c0e8c){return function(_0x2b1da3){_0x1c0e8c['emit'](_0xf4cb6,_0x2b1da3);};}function removeListener(_0x466261,_0x2dbcf1){return function(){SmsInteractionEvents['removeListener'](_0x466261,_0x2dbcf1);};}exports[_0x6b17('0x2')]=function(_0x1f84ab){for(var _0x4a0bbb=0x0,_0x5951d9=events[_0x6b17('0x3')];_0x4a0bbb<_0x5951d9;_0x4a0bbb++){var _0x537862=events[_0x4a0bbb];var _0x43ddd2=createListener(_0x6b17('0x4')+_0x537862,_0x1f84ab);SmsInteractionEvents['on'](_0x537862,_0x43ddd2);}}; \ No newline at end of file +var _0x11d8=['length','smsInteraction:','./smsInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x11d8,0x1bb));var _0x811d=function(_0x331173,_0x3ea6ce){_0x331173=_0x331173-0x0;var _0x28cb62=_0x11d8[_0x331173];return _0x28cb62;};'use strict';var SmsInteractionEvents=require(_0x811d('0x0'));var events=[_0x811d('0x1'),_0x811d('0x2'),_0x811d('0x3')];function createListener(_0x762f4b,_0x404719){return function(_0x3481ba){_0x404719[_0x811d('0x4')](_0x762f4b,_0x3481ba);};}function removeListener(_0x168d7b,_0x4d41f5){return function(){SmsInteractionEvents[_0x811d('0x5')](_0x168d7b,_0x4d41f5);};}exports[_0x811d('0x6')]=function(_0x4f3a0a){for(var _0x300d2f=0x0,_0x557526=events[_0x811d('0x7')];_0x300d2f<_0x557526;_0x300d2f++){var _0x13405c=events[_0x300d2f];var _0x1c30fa=createListener(_0x811d('0x8')+_0x13405c,_0x4f3a0a);SmsInteractionEvents['on'](_0x13405c,_0x1c30fa);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 96aecae..add529f 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 _0x13e6=['../../config/environment','get','isAuthenticated','/describe','describe','show','tracked','sms','smsmessage:create','create','post','/:id/status','put','/:id','/:id/accept','accept','/:id/reject','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b8998,_0x3e0960){var _0x4e06ba=function(_0x399faf){while(--_0x399faf){_0x5b8998['push'](_0x5b8998['shift']());}};_0x4e06ba(++_0x3e0960);}(_0x13e6,0x1a3));var _0x613e=function(_0x351521,_0x2b9971){_0x351521=_0x351521-0x0;var _0x8bfb3a=_0x13e6[_0x351521];return _0x8bfb3a;};'use strict';var multer=require(_0x613e('0x0'));var util=require('util');var path=require(_0x613e('0x1'));var timeout=require(_0x613e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x613e('0x3'));var auth=require(_0x613e('0x4'));var interaction=require(_0x613e('0x5'));var config=require(_0x613e('0x6'));var controller=require('./smsMessage.controller');router[_0x613e('0x7')]('/',auth[_0x613e('0x8')](),controller['index']);router['get'](_0x613e('0x9'),auth['isAuthenticated'](),controller[_0x613e('0xa')]);router['get']('/:id',auth[_0x613e('0x8')](),controller[_0x613e('0xb')]);router['post']('/',auth[_0x613e('0x8')](),interaction[_0x613e('0xc')](_0x613e('0xd'),_0x613e('0xe')),controller[_0x613e('0xf')]);router[_0x613e('0x10')](_0x613e('0x11'),controller['status']);router[_0x613e('0x12')](_0x613e('0x13'),auth['isAuthenticated'](),controller['update']);router[_0x613e('0x12')](_0x613e('0x14'),auth[_0x613e('0x8')](),controller[_0x613e('0x15')]);router[_0x613e('0x12')](_0x613e('0x16'),auth[_0x613e('0x8')](),controller['reject']);router['delete'](_0x613e('0x13'),auth['isAuthenticated'](),controller[_0x613e('0x17')]);module[_0x613e('0x18')]=router; \ No newline at end of file +var _0xdaf9=['../../components/auth/service','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','post','tracked','sms','smsmessage:create','status','put','/:id/reject','reject','destroy','multer','util','path','express'];(function(_0x364f3d,_0x32d81d){var _0x248c05=function(_0x1c63db){while(--_0x1c63db){_0x364f3d['push'](_0x364f3d['shift']());}};_0x248c05(++_0x32d81d);}(_0xdaf9,0xac));var _0x9daf=function(_0x3e79de,_0xce06da){_0x3e79de=_0x3e79de-0x0;var _0x1244c8=_0xdaf9[_0x3e79de];return _0x1244c8;};'use strict';var multer=require(_0x9daf('0x0'));var util=require(_0x9daf('0x1'));var path=require(_0x9daf('0x2'));var timeout=require('connect-timeout');var express=require(_0x9daf('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9daf('0x4'));var interaction=require(_0x9daf('0x5'));var config=require('../../config/environment');var controller=require(_0x9daf('0x6'));router[_0x9daf('0x7')]('/',auth[_0x9daf('0x8')](),controller['index']);router[_0x9daf('0x7')](_0x9daf('0x9'),auth[_0x9daf('0x8')](),controller[_0x9daf('0xa')]);router[_0x9daf('0x7')](_0x9daf('0xb'),auth['isAuthenticated'](),controller[_0x9daf('0xc')]);router[_0x9daf('0xd')]('/',auth['isAuthenticated'](),interaction[_0x9daf('0xe')](_0x9daf('0xf'),_0x9daf('0x10')),controller['create']);router[_0x9daf('0xd')]('/:id/status',controller[_0x9daf('0x11')]);router[_0x9daf('0x12')](_0x9daf('0xb'),auth[_0x9daf('0x8')](),controller['update']);router[_0x9daf('0x12')]('/:id/accept',auth[_0x9daf('0x8')](),controller['accept']);router[_0x9daf('0x12')](_0x9daf('0x13'),auth[_0x9daf('0x8')](),controller[_0x9daf('0x14')]);router['delete'](_0x9daf('0xb'),auth[_0x9daf('0x8')](),controller[_0x9daf('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 5db8524..f07b4d9 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 _0x591c=['sequelize','exports','TEXT','ENUM','out','STRING','DATE'];(function(_0x4d9be9,_0x24e574){var _0x1b6632=function(_0x26550b){while(--_0x26550b){_0x4d9be9['push'](_0x4d9be9['shift']());}};_0x1b6632(++_0x24e574);}(_0x591c,0x165));var _0xc591=function(_0x3d86c8,_0x14aea6){_0x3d86c8=_0x3d86c8-0x0;var _0x39e0ac=_0x591c[_0x3d86c8];return _0x39e0ac;};'use strict';var Sequelize=require(_0xc591('0x0'));module[_0xc591('0x1')]={'body':{'type':Sequelize[_0xc591('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc591('0x3')]('in',_0xc591('0x4')),'defaultValue':_0xc591('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc591('0x5')](0xbe)},'phone':{'type':Sequelize[_0xc591('0x5')]},'readAt':{'type':Sequelize[_0xc591('0x6')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xc591('0x5')]},'providerResponse':{'type':Sequelize[_0xc591('0x2')]}}; \ No newline at end of file +var _0x495c=['out','STRING','DATE','BOOLEAN','exports','TEXT','ENUM'];(function(_0x1bf5fb,_0xc73ad7){var _0x2e93b2=function(_0x4b4db8){while(--_0x4b4db8){_0x1bf5fb['push'](_0x1bf5fb['shift']());}};_0x2e93b2(++_0xc73ad7);}(_0x495c,0x1d2));var _0xc495=function(_0x2ca5c0,_0x4263a6){_0x2ca5c0=_0x2ca5c0-0x0;var _0x1c113b=_0x495c[_0x2ca5c0];return _0x1c113b;};'use strict';var Sequelize=require('sequelize');module[_0xc495('0x0')]={'body':{'type':Sequelize[_0xc495('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xc495('0x2')]('in',_0xc495('0x3')),'defaultValue':_0xc495('0x3'),'allowNull':![]},'messageId':{'type':Sequelize[_0xc495('0x4')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xc495('0x5')]},'secret':{'type':Sequelize[_0xc495('0x6')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xc495('0x1')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index e48d8f9..e9e10a1 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 _0xf0f4=['SmsMessage','includeAll','findAll','rows','show','params','length','include','merge','find','create','body','describe','sms-interactions','sms','read','readAt','format','UserId','agent','get','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','user','role','interaction','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','accept','EventManager','../../config/logger','SmsInteraction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','event','reject','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','rimraf','request-promise','moment','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','VIRTUAL','options'];(function(_0x8560d3,_0x26a504){var _0x33b1b5=function(_0x3a2cad){while(--_0x3a2cad){_0x8560d3['push'](_0x8560d3['shift']());}};_0x33b1b5(++_0x26a504);}(_0xf0f4,0x182));var _0x4f0f=function(_0x2433ac,_0x1bc9f8){_0x2433ac=_0x2433ac-0x0;var _0x401d5c=_0xf0f4[_0x2433ac];return _0x401d5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f0f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f0f('0x1'));var moment=require(_0x4f0f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x4f0f('0x3'));var util=require(_0x4f0f('0x4'));var path=require(_0x4f0f('0x5'));var sox=require(_0x4f0f('0x6'));var csv=require(_0x4f0f('0x7'));var ejs=require(_0x4f0f('0x8'));var fs=require('fs');var fs_extra=require(_0x4f0f('0x9'));var _=require('lodash');var squel=require(_0x4f0f('0xa'));var crypto=require(_0x4f0f('0xb'));var jsforce=require(_0x4f0f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4f0f('0x7'));var querystring=require(_0x4f0f('0xd'));var Papa=require(_0x4f0f('0xe'));var Redis=require(_0x4f0f('0xf'));var authService=require(_0x4f0f('0x10'));var qs=require(_0x4f0f('0x11'));var as=require(_0x4f0f('0x12'));var hardwareService=require(_0x4f0f('0x13'));var logger=require('../../config/logger')(_0x4f0f('0x14'));var utils=require(_0x4f0f('0x15'));var config=require(_0x4f0f('0x16'));var licenseUtil=require(_0x4f0f('0x17'));var db=require(_0x4f0f('0x18'))['db'];config[_0x4f0f('0x19')]=_[_0x4f0f('0x1a')](config[_0x4f0f('0x19')],{'host':_0x4f0f('0x1b'),'port':0x18eb});var socket=require(_0x4f0f('0x1c'))(new Redis(config[_0x4f0f('0x19')]));require('./smsMessage.socket')[_0x4f0f('0x1d')](socket);var jayson=require(_0x4f0f('0x1e'));var client=jayson[_0x4f0f('0x1f')][_0x4f0f('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x4f0f('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x46d7cf,_0x5783,_0x1c0aa1,_0x4038fd){return new BPromise(function(_0x5f171b,_0x238cb8){var _0x1942cf=_0x4038fd||client;return _0x1942cf[_0x4f0f('0x21')](_0x46d7cf,_0x1c0aa1)['then'](function(_0x2ca0b3){logger[_0x4f0f('0x22')](_0x4f0f('0x23'),_0x5783,'request\x20sent');logger[_0x4f0f('0x24')](_0x4f0f('0x25'),_0x5783,_0x4f0f('0x26'),JSON[_0x4f0f('0x27')](_0x2ca0b3));if(_0x2ca0b3[_0x4f0f('0x28')]){if(_0x2ca0b3[_0x4f0f('0x28')]['code']===0x1f4){logger[_0x4f0f('0x28')]('SmsMessage,\x20%s,\x20%s',_0x5783,_0x2ca0b3[_0x4f0f('0x28')][_0x4f0f('0x29')]);return _0x238cb8(_0x2ca0b3['error']['message']);}logger[_0x4f0f('0x28')]('SmsMessage,\x20%s,\x20%s',_0x5783,_0x2ca0b3[_0x4f0f('0x28')][_0x4f0f('0x29')]);return _0x5f171b(_0x2ca0b3[_0x4f0f('0x28')][_0x4f0f('0x29')]);}else{logger[_0x4f0f('0x22')](_0x4f0f('0x23'),_0x5783,'request\x20sent');_0x5f171b(_0x2ca0b3[_0x4f0f('0x2a')][_0x4f0f('0x29')]);}})[_0x4f0f('0x2b')](function(_0x3bc77d){logger[_0x4f0f('0x28')](_0x4f0f('0x23'),_0x5783,_0x3bc77d);_0x238cb8(_0x3bc77d);});});}function respondWithStatusCode(_0x166ea6,_0x419986){_0x419986=_0x419986||0xcc;return function(_0x17cf17){if(_0x17cf17){return _0x166ea6[_0x4f0f('0x2c')](_0x419986);}return _0x166ea6[_0x4f0f('0x2d')](_0x419986)[_0x4f0f('0x2e')]();};}function respondWithResult(_0x381329,_0x5c13d1){_0x5c13d1=_0x5c13d1||0xc8;return function(_0x1e6941){if(_0x1e6941){return _0x381329[_0x4f0f('0x2d')](_0x5c13d1)[_0x4f0f('0x2f')](_0x1e6941);}};}function respondWithFilteredResult(_0x58ec43,_0xa8a240){return function(_0x4e5f0d){if(_0x4e5f0d){var _0x449788=typeof _0xa8a240[_0x4f0f('0x30')]==='undefined'&&typeof _0xa8a240['limit']===_0x4f0f('0x31');var _0x4bf387=_0x4e5f0d[_0x4f0f('0x32')];var _0x9319c0=_0x449788?0x0:_0xa8a240['offset'];var _0x3d3762=_0x449788?_0x4e5f0d[_0x4f0f('0x32')]:_0xa8a240[_0x4f0f('0x30')]+_0xa8a240[_0x4f0f('0x33')];var _0x4db575;if(_0x3d3762>=_0x4bf387){_0x3d3762=_0x4bf387;_0x4db575=0xc8;}else{_0x4db575=0xce;}_0x58ec43[_0x4f0f('0x2d')](_0x4db575);return _0x58ec43[_0x4f0f('0x34')](_0x4f0f('0x35'),_0x9319c0+'-'+_0x3d3762+'/'+_0x4bf387)[_0x4f0f('0x2f')](_0x4e5f0d);}return null;};}function patchUpdates(_0x5ea512){return function(_0xd987c4){try{jsonpatch[_0x4f0f('0x36')](_0xd987c4,_0x5ea512,!![]);}catch(_0x1c85cb){return BPromise['reject'](_0x1c85cb);}return _0xd987c4[_0x4f0f('0x37')]();};}function saveUpdates(_0x797230,_0x5d9fde){return function(_0x1a57b6){if(_0x1a57b6){return _0x1a57b6[_0x4f0f('0x38')](_0x797230)[_0x4f0f('0x39')](function(_0x341c6c){return _0x341c6c;});}return null;};}function removeEntity(_0x57e133,_0x2231cb){return function(_0x2a4bbc){if(_0x2a4bbc){return _0x2a4bbc[_0x4f0f('0x3a')]()[_0x4f0f('0x39')](function(){_0x57e133[_0x4f0f('0x2d')](0xcc)[_0x4f0f('0x2e')]();});}};}function handleEntityNotFound(_0x58d19,_0x3f87e8){return function(_0x5d8289){if(!_0x5d8289){_0x58d19[_0x4f0f('0x2c')](0x194);}return _0x5d8289;};}function handleError(_0x247898,_0x107b9b){_0x107b9b=_0x107b9b||0x1f4;return function(_0x3d2f46){logger[_0x4f0f('0x28')](_0x3d2f46[_0x4f0f('0x3b')]);if(_0x3d2f46[_0x4f0f('0x3c')]){delete _0x3d2f46['name'];}_0x247898[_0x4f0f('0x2d')](_0x107b9b)[_0x4f0f('0x3d')](_0x3d2f46);};}exports[_0x4f0f('0x3e')]=function(_0x563847,_0x171e41){var _0x47b3fc={},_0x18d57e={},_0x58da38={'count':0x0,'rows':[]};var _0x103a2f=_[_0x4f0f('0x3f')](db['SmsMessage'][_0x4f0f('0x40')],function(_0x2d58b0){return{'name':_0x2d58b0[_0x4f0f('0x41')],'type':_0x2d58b0['type'][_0x4f0f('0x42')]};});_0x18d57e[_0x4f0f('0x43')]=_[_0x4f0f('0x3f')](_0x103a2f,_0x4f0f('0x3c'));_0x18d57e[_0x4f0f('0x44')]=_[_0x4f0f('0x45')](_0x563847[_0x4f0f('0x44')]);_0x18d57e[_0x4f0f('0x46')]=_[_0x4f0f('0x47')](_0x18d57e[_0x4f0f('0x43')],_0x18d57e[_0x4f0f('0x44')]);_0x47b3fc['attributes']=_[_0x4f0f('0x47')](_0x18d57e[_0x4f0f('0x43')],qs[_0x4f0f('0x48')](_0x563847[_0x4f0f('0x44')][_0x4f0f('0x48')]));_0x47b3fc[_0x4f0f('0x49')]=_0x47b3fc[_0x4f0f('0x49')]['length']?_0x47b3fc[_0x4f0f('0x49')]:_0x18d57e[_0x4f0f('0x43')];if(!_0x563847[_0x4f0f('0x44')][_0x4f0f('0x4a')](_0x4f0f('0x4b'))){_0x47b3fc[_0x4f0f('0x33')]=qs['limit'](_0x563847[_0x4f0f('0x44')][_0x4f0f('0x33')]);_0x47b3fc['offset']=qs['offset'](_0x563847[_0x4f0f('0x44')][_0x4f0f('0x30')]);}_0x47b3fc[_0x4f0f('0x4c')]=qs['sort'](_0x563847[_0x4f0f('0x44')]['sort']);_0x47b3fc['where']=qs[_0x4f0f('0x46')](_[_0x4f0f('0x4d')](_0x563847[_0x4f0f('0x44')],_0x18d57e[_0x4f0f('0x46')]),_0x103a2f);if(_0x563847[_0x4f0f('0x44')][_0x4f0f('0x4e')]){_0x47b3fc['where']=_['merge'](_0x47b3fc[_0x4f0f('0x4f')],{'$or':_[_0x4f0f('0x3f')](_0x103a2f,function(_0x2df090){if(_0x2df090['type']!==_0x4f0f('0x50')){var _0x34d113={};_0x34d113[_0x2df090[_0x4f0f('0x3c')]]={'$like':'%'+_0x563847['query'][_0x4f0f('0x4e')]+'%'};return _0x34d113;}})});}_0x47b3fc=_['merge']({},_0x47b3fc,_0x563847[_0x4f0f('0x51')]);var _0x5231e5={'where':_0x47b3fc[_0x4f0f('0x4f')]};return db[_0x4f0f('0x52')][_0x4f0f('0x32')](_0x5231e5)[_0x4f0f('0x39')](function(_0x56c354){_0x58da38['count']=_0x56c354;if(_0x563847['query'][_0x4f0f('0x53')]){_0x47b3fc['include']=[{'all':!![]}];}return db[_0x4f0f('0x52')][_0x4f0f('0x54')](_0x47b3fc);})[_0x4f0f('0x39')](function(_0x204a1b){_0x58da38[_0x4f0f('0x55')]=_0x204a1b;return _0x58da38;})[_0x4f0f('0x39')](respondWithFilteredResult(_0x171e41,_0x47b3fc))[_0x4f0f('0x2b')](handleError(_0x171e41,null));};exports[_0x4f0f('0x56')]=function(_0x5b7a20,_0x37ce22){var _0x2ffb4d={'raw':!![],'where':{'id':_0x5b7a20[_0x4f0f('0x57')]['id']}},_0x175c03={};_0x175c03[_0x4f0f('0x43')]=_[_0x4f0f('0x45')](db[_0x4f0f('0x52')][_0x4f0f('0x40')]);_0x175c03[_0x4f0f('0x44')]=_[_0x4f0f('0x45')](_0x5b7a20['query']);_0x175c03[_0x4f0f('0x46')]=_['intersection'](_0x175c03[_0x4f0f('0x43')],_0x175c03[_0x4f0f('0x44')]);_0x2ffb4d['attributes']=_[_0x4f0f('0x47')](_0x175c03[_0x4f0f('0x43')],qs[_0x4f0f('0x48')](_0x5b7a20[_0x4f0f('0x44')][_0x4f0f('0x48')]));_0x2ffb4d[_0x4f0f('0x49')]=_0x2ffb4d[_0x4f0f('0x49')][_0x4f0f('0x58')]?_0x2ffb4d[_0x4f0f('0x49')]:_0x175c03['model'];if(_0x5b7a20[_0x4f0f('0x44')][_0x4f0f('0x53')]){_0x2ffb4d[_0x4f0f('0x59')]=[{'all':!![]}];}_0x2ffb4d=_[_0x4f0f('0x5a')]({},_0x2ffb4d,_0x5b7a20[_0x4f0f('0x51')]);return db[_0x4f0f('0x52')][_0x4f0f('0x5b')](_0x2ffb4d)['then'](handleEntityNotFound(_0x37ce22,null))['then'](respondWithResult(_0x37ce22,null))[_0x4f0f('0x2b')](handleError(_0x37ce22,null));};exports[_0x4f0f('0x5c')]=function(_0x374cd3,_0x2c99d9){return db[_0x4f0f('0x52')][_0x4f0f('0x5c')](_0x374cd3[_0x4f0f('0x5d')],{})[_0x4f0f('0x39')](respondWithResult(_0x2c99d9,0xc9))[_0x4f0f('0x2b')](handleError(_0x2c99d9,null));};exports[_0x4f0f('0x38')]=function(_0x18cfac,_0x1992c8){if(_0x18cfac['body']['id']){delete _0x18cfac[_0x4f0f('0x5d')]['id'];}return db['SmsMessage'][_0x4f0f('0x5b')]({'where':{'id':_0x18cfac[_0x4f0f('0x57')]['id']}})['then'](handleEntityNotFound(_0x1992c8,null))['then'](saveUpdates(_0x18cfac['body'],null))[_0x4f0f('0x39')](respondWithResult(_0x1992c8,null))[_0x4f0f('0x2b')](handleError(_0x1992c8,null));};exports[_0x4f0f('0x3a')]=function(_0x54f9fb,_0x5df4e0){return db['SmsMessage'][_0x4f0f('0x5b')]({'where':{'id':_0x54f9fb[_0x4f0f('0x57')]['id']}})[_0x4f0f('0x39')](handleEntityNotFound(_0x5df4e0,null))[_0x4f0f('0x39')](removeEntity(_0x5df4e0,null))[_0x4f0f('0x2b')](handleError(_0x5df4e0,null));};exports[_0x4f0f('0x5e')]=function(_0x25ec74,_0x4952b0){return db['SmsMessage'][_0x4f0f('0x5e')]()[_0x4f0f('0x39')](respondWithResult(_0x4952b0,null))[_0x4f0f('0x2b')](handleError(_0x4952b0,null));};var interaction_log=require('../../config/logger')(_0x4f0f('0x5f'));exports['accept']=function(_0x39b6d7,_0x528568,_0x17a9b8){var _0x52f5c8={'agent':{},'channel':_0x4f0f('0x60')};if(_0x39b6d7[_0x4f0f('0x5d')]['id']){delete _0x39b6d7[_0x4f0f('0x5d')]['id'];}_0x39b6d7[_0x4f0f('0x5d')][_0x4f0f('0x61')]=!![];_0x39b6d7[_0x4f0f('0x5d')][_0x4f0f('0x62')]=moment()[_0x4f0f('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x39b6d7[_0x4f0f('0x5d')][_0x4f0f('0x64')]=_0x39b6d7[_0x4f0f('0x5d')][_0x4f0f('0x64')]||_0x39b6d7['user']['id'];_0x52f5c8[_0x4f0f('0x65')]['id']=_0x39b6d7[_0x4f0f('0x5d')]['UserId'];return db['SmsMessage'][_0x4f0f('0x5b')]({'where':{'id':_0x39b6d7[_0x4f0f('0x57')]['id'],'UserId':null}})[_0x4f0f('0x39')](handleEntityNotFound(_0x528568,null))[_0x4f0f('0x39')](saveUpdates(_0x39b6d7[_0x4f0f('0x5d')],null))['then'](function(_0x1ad24a){if(_0x1ad24a){_0x52f5c8[_0x4f0f('0x29')]=_0x1ad24a[_0x4f0f('0x66')]({'plain':!![]});return db['SmsInteraction'][_0x4f0f('0x5b')]({'where':{'id':_0x1ad24a[_0x4f0f('0x67')]}});}return null;})[_0x4f0f('0x39')](handleEntityNotFound(_0x528568,null))['then'](function(_0xad5d7){if(_0xad5d7){return _0xad5d7[_0x4f0f('0x38')]({'UserId':_0x39b6d7['body'][_0x4f0f('0x64')],'read1stAt':_[_0x4f0f('0x68')](_0xad5d7[_0x4f0f('0x69')])?moment()[_0x4f0f('0x63')](_0x4f0f('0x6a')):undefined});}return null;})[_0x4f0f('0x39')](function(_0x47c182){if(_0x47c182){_0x52f5c8['interaction']=_0x47c182['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x39b6d7[_0x4f0f('0x6b')]['id'],_0x39b6d7[_0x4f0f('0x6b')][_0x4f0f('0x3c')],_0x39b6d7[_0x4f0f('0x6b')][_0x4f0f('0x6c')],_0x52f5c8[_0x4f0f('0x6d')]['id'],_0x39b6d7[_0x4f0f('0x5d')]?JSON[_0x4f0f('0x27')](_0x39b6d7[_0x4f0f('0x5d')]):_0x4f0f('0x6e'));return respondWithRpcPromise(_0x4f0f('0x6f'),_0x4f0f('0x70'),_0x52f5c8);}return null;})[_0x4f0f('0x39')](function(_0x9cd96e){var _0xa068e3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9cd96e[_0x4f0f('0x29')][_0x4f0f('0x71')];return db[_0x4f0f('0x72')][_0x4f0f('0x44')](_0xa068e3,{'type':db[_0x4f0f('0x73')][_0x4f0f('0x74')]['SELECT'],'raw':!![]})[_0x4f0f('0x39')](function(_0x52211c){return _0x52211c;});})[_0x4f0f('0x39')](function(_0x51d4c0){if(_0x51d4c0){_0x52f5c8[_0x4f0f('0x29')][_0x4f0f('0x75')]=_0x51d4c0[0x0];if(!_0x39b6d7[_0x4f0f('0x5d')]['UserId'])return;return db[_0x4f0f('0x76')][_0x4f0f('0x5b')]({'where':{'id':_0x39b6d7[_0x4f0f('0x5d')][_0x4f0f('0x64')],'role':_0x4f0f('0x65')},'attributes':['id','name',_0x4f0f('0x77'),_0x4f0f('0x78'),_0x4f0f('0x79')],'raw':!![]});}return null;})[_0x4f0f('0x39')](function(_0x469774){if(!_0x469774)return null;_0x52f5c8[_0x4f0f('0x29')][_0x4f0f('0x65')]=_0x469774;return _0x52f5c8;})[_0x4f0f('0x39')](function(_0x516704){if(_0x516704){if(_0x39b6d7[_0x4f0f('0x5d')][_0x4f0f('0x7a')]){_0x52f5c8['message'][_0x4f0f('0x7b')]=util[_0x4f0f('0x63')](_0x4f0f('0x7c'),_0x39b6d7['user'][_0x4f0f('0x3c')]);_0x52f5c8['message'][_0x4f0f('0x7d')]=_0x52f5c8[_0x4f0f('0x7d')];_0x52f5c8['message'][_0x4f0f('0x7e')]=_0x52f5c8[_0x4f0f('0x7d')];_0x52f5c8[_0x4f0f('0x29')]['event']=_0x4f0f('0x7f');return respondWithRpcPromise(_0x4f0f('0x80'),_0x4f0f('0x80'),{'event':'acceptmessage','message':_0x52f5c8[_0x4f0f('0x29')]},client9002)[_0x4f0f('0x39')](function(){return _0x52f5c8;});}return _0x52f5c8;}return null;})['then'](respondWithResult(_0x528568,null))['catch'](handleError(_0x528568,null));};var interaction_log=require(_0x4f0f('0x81'))(_0x4f0f('0x5f'));exports['reject']=function(_0x3ec559,_0x465cdd,_0x229592){var _0x340eb2={'agent':{},'channel':_0x4f0f('0x60')};if(_0x3ec559['body']['id']){delete _0x3ec559['body']['id'];}_0x3ec559[_0x4f0f('0x5d')]['UserId']=_0x3ec559[_0x4f0f('0x5d')][_0x4f0f('0x64')]||_0x3ec559[_0x4f0f('0x6b')]['id'];_0x340eb2[_0x4f0f('0x65')]['id']=_0x3ec559['body'][_0x4f0f('0x64')];return db[_0x4f0f('0x52')]['find']({'where':{'id':_0x3ec559[_0x4f0f('0x57')]['id'],'UserId':null}})[_0x4f0f('0x39')](handleEntityNotFound(_0x465cdd,null))[_0x4f0f('0x39')](function(_0x368136){if(_0x368136){_0x340eb2['message']=_0x368136['get']({'plain':!![]});return db[_0x4f0f('0x82')][_0x4f0f('0x5b')]({'where':{'id':_0x368136[_0x4f0f('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x465cdd,null))[_0x4f0f('0x39')](function(_0x52747b){if(_0x52747b){_0x340eb2['interaction']=_0x52747b[_0x4f0f('0x66')]({'plain':!![]});interaction_log[_0x4f0f('0x22')](_0x4f0f('0x83'),_0x3ec559[_0x4f0f('0x6b')]['id'],_0x3ec559['user'][_0x4f0f('0x3c')],_0x3ec559[_0x4f0f('0x6b')]['role'],_0x340eb2['interaction']['id'],_0x3ec559['body']?JSON[_0x4f0f('0x27')](_0x3ec559[_0x4f0f('0x5d')]):'null');return respondWithRpcPromise(_0x4f0f('0x84'),_0x4f0f('0x85'),_0x340eb2);}return null;})['then'](function(_0x43ee33){var _0x1a6a1a=_0x4f0f('0x86')+_0x43ee33['message'][_0x4f0f('0x71')];return db[_0x4f0f('0x72')][_0x4f0f('0x44')](_0x1a6a1a,{'type':db[_0x4f0f('0x73')][_0x4f0f('0x74')][_0x4f0f('0x87')],'raw':!![]})[_0x4f0f('0x39')](function(_0x4d9ea9){return _0x4d9ea9;});})[_0x4f0f('0x39')](function(_0x5a2c5b){if(_0x5a2c5b){_0x340eb2['message']['contact']=_0x5a2c5b[0x0];if(!_0x3ec559['body'][_0x4f0f('0x64')])return;return db[_0x4f0f('0x76')][_0x4f0f('0x5b')]({'where':{'id':_0x3ec559[_0x4f0f('0x5d')]['UserId'],'role':_0x4f0f('0x65')},'attributes':['id',_0x4f0f('0x3c'),'fullname','email',_0x4f0f('0x79')],'raw':!![]});}return null;})[_0x4f0f('0x39')](function(_0x3109d4){if(!_0x3109d4)return null;_0x340eb2[_0x4f0f('0x29')][_0x4f0f('0x65')]=_0x3109d4;return _0x340eb2;})['then'](function(_0x6f412c){if(_0x6f412c){_0x6f412c['message'][_0x4f0f('0x7b')]=util[_0x4f0f('0x63')](_0x4f0f('0x7c'),_0x3ec559['user'][_0x4f0f('0x3c')]);_0x6f412c[_0x4f0f('0x29')][_0x4f0f('0x7d')]=_0x340eb2[_0x4f0f('0x7d')];_0x6f412c[_0x4f0f('0x29')][_0x4f0f('0x7e')]=_0x340eb2[_0x4f0f('0x7d')];_0x6f412c[_0x4f0f('0x29')][_0x4f0f('0x88')]=_0x4f0f('0x89');respondWithRpcPromise(_0x4f0f('0x80'),_0x4f0f('0x80'),{'event':'rejectmessage','message':_0x6f412c[_0x4f0f('0x29')]},client9002);return _0x340eb2;}return null;})[_0x4f0f('0x39')](respondWithResult(_0x465cdd,null))['catch'](handleError(_0x465cdd,null));};exports[_0x4f0f('0x2d')]=function(_0x339f9b,_0x535c0e,_0x94dabb){if(_0x339f9b[_0x4f0f('0x5d')]['id']){delete _0x339f9b['body']['id'];}var _0x6acd67;return db['SmsMessage']['find']({'where':{'id':_0x339f9b[_0x4f0f('0x57')]['id']}})[_0x4f0f('0x39')](handleEntityNotFound(_0x535c0e,null))[_0x4f0f('0x39')](function(_0x1d97e2){if(_0x1d97e2){_0x6acd67=_0x1d97e2;return db[_0x4f0f('0x8a')][_0x4f0f('0x5b')]({'where':{'id':_0x1d97e2[_0x4f0f('0x8b')]}});}})[_0x4f0f('0x39')](handleEntityNotFound(_0x535c0e,null))[_0x4f0f('0x39')](function(_0x12ce49){if(_0x12ce49){logger[_0x4f0f('0x24')](_0x4f0f('0x25'),_0x4f0f('0x2d'),_0x4f0f('0x8c'),_0x12ce49['type'],util[_0x4f0f('0x8d')](_0x339f9b[_0x4f0f('0x5d')],{'showHidden':![],'depth':null}));switch(_0x12ce49['type']){case _0x4f0f('0x8e'):if(_0x339f9b[_0x4f0f('0x5d')]['MessageSid']&&_0x339f9b[_0x4f0f('0x5d')]['MessageSid']===_0x6acd67[_0x4f0f('0x8f')]){return _0x6acd67[_0x4f0f('0x38')]({'read':!![]});}else{logger[_0x4f0f('0x28')](_0x4f0f('0x90'),_0x4f0f('0x2d'),'twilio',util['inspect'](_0x339f9b['body'],{'showHidden':![],'depth':null}));}break;case _0x4f0f('0x91'):if(_0x339f9b[_0x4f0f('0x5d')][_0x4f0f('0x92')]&&_0x339f9b[_0x4f0f('0x5d')][_0x4f0f('0x92')]===_0x6acd67[_0x4f0f('0x8f')]&&_[_0x4f0f('0x93')]([_0x4f0f('0x94'),_0x4f0f('0x95')],_0x339f9b[_0x4f0f('0x5d')][_0x4f0f('0x96')])>=0x0){return _0x6acd67[_0x4f0f('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4f0f('0x2d'),_0x4f0f('0x97'),util[_0x4f0f('0x8d')](_0x339f9b[_0x4f0f('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x4f0f('0x98'):var _0x5a096d=_0x339f9b[_0x4f0f('0x5d')][_0x4f0f('0x99')][0x0];if(_0x5a096d[_0x4f0f('0x2d')][_0x4f0f('0x9a')]===_0x4f0f('0x9b')){return _0x6acd67[_0x4f0f('0x38')]({'read':!![]});}else{logger[_0x4f0f('0x28')](_0x4f0f('0x90'),_0x4f0f('0x2d'),_0x4f0f('0x98'),util[_0x4f0f('0x8d')](_0x339f9b[_0x4f0f('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x6acd67;}})['then'](respondWithResult(_0x535c0e,null))[_0x4f0f('0x2b')](handleError(_0x535c0e,null));}; \ No newline at end of file +var _0xb181=['acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','reject','info','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','interface','rejectmessage','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','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','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','destroy','stack','name','send','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','SmsMessage','includeAll','findAll','show','params','keys','rawAttributes','include','options','find','create','update','body','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage'];(function(_0x42e99e,_0x13c67e){var _0x6b3d34=function(_0x1f7ed0){while(--_0x1f7ed0){_0x42e99e['push'](_0x42e99e['shift']());}};_0x6b3d34(++_0x13c67e);}(_0xb181,0xc6));var _0x1b18=function(_0x1e66b8,_0x4099ec){_0x1e66b8=_0x1e66b8-0x0;var _0x484f6d=_0xb181[_0x1e66b8];return _0x484f6d;};'use strict';var emlformat=require(_0x1b18('0x0'));var rimraf=require(_0x1b18('0x1'));var zipdir=require(_0x1b18('0x2'));var jsonpatch=require(_0x1b18('0x3'));var rp=require('request-promise');var moment=require(_0x1b18('0x4'));var BPromise=require(_0x1b18('0x5'));var Mustache=require('mustache');var util=require(_0x1b18('0x6'));var path=require(_0x1b18('0x7'));var sox=require(_0x1b18('0x8'));var csv=require(_0x1b18('0x9'));var ejs=require(_0x1b18('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b18('0xb'));var squel=require(_0x1b18('0xc'));var crypto=require('crypto');var jsforce=require(_0x1b18('0xd'));var deskjs=require(_0x1b18('0xe'));var toCsv=require(_0x1b18('0x9'));var querystring=require(_0x1b18('0xf'));var Papa=require('papaparse');var Redis=require(_0x1b18('0x10'));var authService=require(_0x1b18('0x11'));var qs=require(_0x1b18('0x12'));var as=require(_0x1b18('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b18('0x14'))(_0x1b18('0x15'));var utils=require(_0x1b18('0x16'));var config=require(_0x1b18('0x17'));var licenseUtil=require(_0x1b18('0x18'));var db=require(_0x1b18('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1b18('0x1a'))(new Redis(config[_0x1b18('0x1b')]));require(_0x1b18('0x1c'))[_0x1b18('0x1d')](socket);var jayson=require(_0x1b18('0x1e'));var client=jayson[_0x1b18('0x1f')][_0x1b18('0x20')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1b301d,_0x5b421d,_0x3c8d52,_0xa4702b){return new BPromise(function(_0x364280,_0x1c7b95){var _0x294c8f=_0xa4702b||client;return _0x294c8f[_0x1b18('0x21')](_0x1b301d,_0x3c8d52)[_0x1b18('0x22')](function(_0x1e7d32){logger['info']('SmsMessage,\x20%s,\x20%s',_0x5b421d,_0x1b18('0x23'));logger[_0x1b18('0x24')](_0x1b18('0x25'),_0x5b421d,_0x1b18('0x23'),JSON['stringify'](_0x1e7d32));if(_0x1e7d32['error']){if(_0x1e7d32[_0x1b18('0x26')][_0x1b18('0x27')]===0x1f4){logger[_0x1b18('0x26')]('SmsMessage,\x20%s,\x20%s',_0x5b421d,_0x1e7d32['error']['message']);return _0x1c7b95(_0x1e7d32[_0x1b18('0x26')][_0x1b18('0x28')]);}logger['error'](_0x1b18('0x29'),_0x5b421d,_0x1e7d32[_0x1b18('0x26')][_0x1b18('0x28')]);return _0x364280(_0x1e7d32[_0x1b18('0x26')]['message']);}else{logger['info'](_0x1b18('0x29'),_0x5b421d,_0x1b18('0x23'));_0x364280(_0x1e7d32[_0x1b18('0x2a')][_0x1b18('0x28')]);}})[_0x1b18('0x2b')](function(_0x3523ce){logger[_0x1b18('0x26')]('SmsMessage,\x20%s,\x20%s',_0x5b421d,_0x3523ce);_0x1c7b95(_0x3523ce);});});}function respondWithStatusCode(_0x2bf404,_0x3308b6){_0x3308b6=_0x3308b6||0xcc;return function(_0x2a80e2){if(_0x2a80e2){return _0x2bf404[_0x1b18('0x2c')](_0x3308b6);}return _0x2bf404[_0x1b18('0x2d')](_0x3308b6)[_0x1b18('0x2e')]();};}function respondWithResult(_0x467b32,_0x511c90){_0x511c90=_0x511c90||0xc8;return function(_0x189b65){if(_0x189b65){return _0x467b32['status'](_0x511c90)[_0x1b18('0x2f')](_0x189b65);}};}function respondWithFilteredResult(_0x32500e,_0x1ce4ba){return function(_0x2ecc11){if(_0x2ecc11){var _0x187c07=typeof _0x1ce4ba[_0x1b18('0x30')]==='undefined'&&typeof _0x1ce4ba[_0x1b18('0x31')]===_0x1b18('0x32');var _0x1efc7c=_0x2ecc11[_0x1b18('0x33')];var _0x1e5e3d=_0x187c07?0x0:_0x1ce4ba[_0x1b18('0x30')];var _0x53e9c2=_0x187c07?_0x2ecc11[_0x1b18('0x33')]:_0x1ce4ba[_0x1b18('0x30')]+_0x1ce4ba[_0x1b18('0x31')];var _0x35f367;if(_0x53e9c2>=_0x1efc7c){_0x53e9c2=_0x1efc7c;_0x35f367=0xc8;}else{_0x35f367=0xce;}_0x32500e['status'](_0x35f367);return _0x32500e[_0x1b18('0x34')](_0x1b18('0x35'),_0x1e5e3d+'-'+_0x53e9c2+'/'+_0x1efc7c)[_0x1b18('0x2f')](_0x2ecc11);}return null;};}function patchUpdates(_0x34cb31){return function(_0x289e4c){try{jsonpatch[_0x1b18('0x36')](_0x289e4c,_0x34cb31,!![]);}catch(_0x146b97){return BPromise['reject'](_0x146b97);}return _0x289e4c[_0x1b18('0x37')]();};}function saveUpdates(_0x5fbecf,_0x714087){return function(_0x191126){if(_0x191126){return _0x191126['update'](_0x5fbecf)[_0x1b18('0x22')](function(_0x407b20){return _0x407b20;});}return null;};}function removeEntity(_0x1c2296,_0x473be2){return function(_0x39fca1){if(_0x39fca1){return _0x39fca1[_0x1b18('0x38')]()[_0x1b18('0x22')](function(){_0x1c2296[_0x1b18('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x120a58,_0x26da02){return function(_0x3f7468){if(!_0x3f7468){_0x120a58['sendStatus'](0x194);}return _0x3f7468;};}function handleError(_0x55bd28,_0x24ffde){_0x24ffde=_0x24ffde||0x1f4;return function(_0x203876){logger[_0x1b18('0x26')](_0x203876[_0x1b18('0x39')]);if(_0x203876[_0x1b18('0x3a')]){delete _0x203876['name'];}_0x55bd28[_0x1b18('0x2d')](_0x24ffde)[_0x1b18('0x3b')](_0x203876);};}exports['index']=function(_0x372b14,_0x5f193f){var _0x2b8ec6={},_0x3a8c27={},_0x486af6={'count':0x0,'rows':[]};var _0x3e6c86=_['map'](db['SmsMessage']['rawAttributes'],function(_0x261f07){return{'name':_0x261f07[_0x1b18('0x3c')],'type':_0x261f07[_0x1b18('0x3d')][_0x1b18('0x3e')]};});_0x3a8c27['model']=_[_0x1b18('0x3f')](_0x3e6c86,_0x1b18('0x3a'));_0x3a8c27[_0x1b18('0x40')]=_['keys'](_0x372b14['query']);_0x3a8c27[_0x1b18('0x41')]=_[_0x1b18('0x42')](_0x3a8c27[_0x1b18('0x43')],_0x3a8c27[_0x1b18('0x40')]);_0x2b8ec6[_0x1b18('0x44')]=_[_0x1b18('0x42')](_0x3a8c27[_0x1b18('0x43')],qs[_0x1b18('0x45')](_0x372b14[_0x1b18('0x40')][_0x1b18('0x45')]));_0x2b8ec6[_0x1b18('0x44')]=_0x2b8ec6['attributes'][_0x1b18('0x46')]?_0x2b8ec6[_0x1b18('0x44')]:_0x3a8c27['model'];if(!_0x372b14['query'][_0x1b18('0x47')]('nolimit')){_0x2b8ec6[_0x1b18('0x31')]=qs['limit'](_0x372b14[_0x1b18('0x40')][_0x1b18('0x31')]);_0x2b8ec6[_0x1b18('0x30')]=qs['offset'](_0x372b14[_0x1b18('0x40')]['offset']);}_0x2b8ec6[_0x1b18('0x48')]=qs['sort'](_0x372b14[_0x1b18('0x40')][_0x1b18('0x49')]);_0x2b8ec6[_0x1b18('0x4a')]=qs[_0x1b18('0x41')](_[_0x1b18('0x4b')](_0x372b14[_0x1b18('0x40')],_0x3a8c27[_0x1b18('0x41')]),_0x3e6c86);if(_0x372b14[_0x1b18('0x40')]['filter']){_0x2b8ec6[_0x1b18('0x4a')]=_['merge'](_0x2b8ec6['where'],{'$or':_['map'](_0x3e6c86,function(_0x105248){if(_0x105248[_0x1b18('0x3d')]!==_0x1b18('0x4c')){var _0xfd6f37={};_0xfd6f37[_0x105248[_0x1b18('0x3a')]]={'$like':'%'+_0x372b14[_0x1b18('0x40')][_0x1b18('0x4d')]+'%'};return _0xfd6f37;}})});}_0x2b8ec6=_[_0x1b18('0x4e')]({},_0x2b8ec6,_0x372b14['options']);var _0x23b1f5={'where':_0x2b8ec6[_0x1b18('0x4a')]};return db[_0x1b18('0x4f')]['count'](_0x23b1f5)[_0x1b18('0x22')](function(_0x4e4c40){_0x486af6[_0x1b18('0x33')]=_0x4e4c40;if(_0x372b14['query'][_0x1b18('0x50')]){_0x2b8ec6['include']=[{'all':!![]}];}return db[_0x1b18('0x4f')][_0x1b18('0x51')](_0x2b8ec6);})[_0x1b18('0x22')](function(_0x4fbc66){_0x486af6['rows']=_0x4fbc66;return _0x486af6;})[_0x1b18('0x22')](respondWithFilteredResult(_0x5f193f,_0x2b8ec6))[_0x1b18('0x2b')](handleError(_0x5f193f,null));};exports[_0x1b18('0x52')]=function(_0x281724,_0xfeaa07){var _0x535f2f={'raw':!![],'where':{'id':_0x281724[_0x1b18('0x53')]['id']}},_0x1cce4c={};_0x1cce4c[_0x1b18('0x43')]=_[_0x1b18('0x54')](db[_0x1b18('0x4f')][_0x1b18('0x55')]);_0x1cce4c[_0x1b18('0x40')]=_[_0x1b18('0x54')](_0x281724['query']);_0x1cce4c['filters']=_[_0x1b18('0x42')](_0x1cce4c['model'],_0x1cce4c[_0x1b18('0x40')]);_0x535f2f[_0x1b18('0x44')]=_[_0x1b18('0x42')](_0x1cce4c['model'],qs['fields'](_0x281724['query'][_0x1b18('0x45')]));_0x535f2f['attributes']=_0x535f2f['attributes'][_0x1b18('0x46')]?_0x535f2f[_0x1b18('0x44')]:_0x1cce4c[_0x1b18('0x43')];if(_0x281724[_0x1b18('0x40')][_0x1b18('0x50')]){_0x535f2f[_0x1b18('0x56')]=[{'all':!![]}];}_0x535f2f=_[_0x1b18('0x4e')]({},_0x535f2f,_0x281724[_0x1b18('0x57')]);return db['SmsMessage'][_0x1b18('0x58')](_0x535f2f)[_0x1b18('0x22')](handleEntityNotFound(_0xfeaa07,null))[_0x1b18('0x22')](respondWithResult(_0xfeaa07,null))[_0x1b18('0x2b')](handleError(_0xfeaa07,null));};exports['create']=function(_0x598788,_0x3ff1f0){return db['SmsMessage'][_0x1b18('0x59')](_0x598788['body'],{})[_0x1b18('0x22')](respondWithResult(_0x3ff1f0,0xc9))[_0x1b18('0x2b')](handleError(_0x3ff1f0,null));};exports[_0x1b18('0x5a')]=function(_0x47aa4a,_0x23d1de){if(_0x47aa4a[_0x1b18('0x5b')]['id']){delete _0x47aa4a[_0x1b18('0x5b')]['id'];}return db[_0x1b18('0x4f')][_0x1b18('0x58')]({'where':{'id':_0x47aa4a[_0x1b18('0x53')]['id']}})['then'](handleEntityNotFound(_0x23d1de,null))[_0x1b18('0x22')](saveUpdates(_0x47aa4a['body'],null))['then'](respondWithResult(_0x23d1de,null))[_0x1b18('0x2b')](handleError(_0x23d1de,null));};exports[_0x1b18('0x38')]=function(_0x5dd7f0,_0x40a6c3){return db[_0x1b18('0x4f')][_0x1b18('0x58')]({'where':{'id':_0x5dd7f0['params']['id']}})[_0x1b18('0x22')](handleEntityNotFound(_0x40a6c3,null))[_0x1b18('0x22')](removeEntity(_0x40a6c3,null))[_0x1b18('0x2b')](handleError(_0x40a6c3,null));};exports[_0x1b18('0x5c')]=function(_0x2757ad,_0x347f81){return db[_0x1b18('0x4f')][_0x1b18('0x5c')]()[_0x1b18('0x22')](respondWithResult(_0x347f81,null))['catch'](handleError(_0x347f81,null));};var interaction_log=require(_0x1b18('0x14'))(_0x1b18('0x5d'));exports[_0x1b18('0x5e')]=function(_0x14e081,_0x261eab,_0x28969c){var _0x56d1d9={'agent':{},'channel':_0x1b18('0x5f')};if(_0x14e081[_0x1b18('0x5b')]['id']){delete _0x14e081[_0x1b18('0x5b')]['id'];}_0x14e081['body'][_0x1b18('0x60')]=!![];_0x14e081['body']['readAt']=moment()['format'](_0x1b18('0x61'));_0x14e081[_0x1b18('0x5b')][_0x1b18('0x62')]=_0x14e081[_0x1b18('0x5b')][_0x1b18('0x62')]||_0x14e081[_0x1b18('0x63')]['id'];_0x56d1d9[_0x1b18('0x64')]['id']=_0x14e081[_0x1b18('0x5b')][_0x1b18('0x62')];return db['SmsMessage']['find']({'where':{'id':_0x14e081[_0x1b18('0x53')]['id'],'UserId':null}})[_0x1b18('0x22')](handleEntityNotFound(_0x261eab,null))[_0x1b18('0x22')](saveUpdates(_0x14e081[_0x1b18('0x5b')],null))[_0x1b18('0x22')](function(_0xcac858){if(_0xcac858){_0x56d1d9[_0x1b18('0x28')]=_0xcac858[_0x1b18('0x65')]({'plain':!![]});return db[_0x1b18('0x66')][_0x1b18('0x58')]({'where':{'id':_0xcac858[_0x1b18('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x261eab,null))['then'](function(_0x428179){if(_0x428179){return _0x428179[_0x1b18('0x5a')]({'UserId':_0x14e081[_0x1b18('0x5b')][_0x1b18('0x62')],'read1stAt':_['isNil'](_0x428179[_0x1b18('0x68')])?moment()[_0x1b18('0x69')](_0x1b18('0x61')):undefined});}return null;})[_0x1b18('0x22')](function(_0x532c28){if(_0x532c28){_0x56d1d9['interaction']=_0x532c28[_0x1b18('0x65')]({'plain':!![]});interaction_log['info'](_0x1b18('0x6a'),_0x14e081[_0x1b18('0x63')]['id'],_0x14e081[_0x1b18('0x63')][_0x1b18('0x3a')],_0x14e081[_0x1b18('0x63')][_0x1b18('0x6b')],_0x56d1d9[_0x1b18('0x6c')]['id'],_0x14e081[_0x1b18('0x5b')]?JSON[_0x1b18('0x6d')](_0x14e081[_0x1b18('0x5b')]):_0x1b18('0x6e'));return respondWithRpcPromise(_0x1b18('0x6f'),_0x1b18('0x70'),_0x56d1d9);}return null;})[_0x1b18('0x22')](function(_0x2bde07){var _0x17fbf0='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2bde07[_0x1b18('0x28')][_0x1b18('0x71')];return db[_0x1b18('0x72')]['query'](_0x17fbf0,{'type':db[_0x1b18('0x73')][_0x1b18('0x74')]['SELECT'],'raw':!![]})['then'](function(_0x27678e){return _0x27678e;});})['then'](function(_0x3d783f){if(_0x3d783f){_0x56d1d9['message']['contact']=_0x3d783f[0x0];if(!_0x14e081[_0x1b18('0x5b')]['UserId'])return;return db[_0x1b18('0x75')][_0x1b18('0x58')]({'where':{'id':_0x14e081[_0x1b18('0x5b')][_0x1b18('0x62')],'role':'agent'},'attributes':['id','name',_0x1b18('0x76'),_0x1b18('0x77'),_0x1b18('0x78')],'raw':!![]});}return null;})['then'](function(_0x3a14ed){if(!_0x3a14ed)return null;_0x56d1d9['message']['agent']=_0x3a14ed;return _0x56d1d9;})[_0x1b18('0x22')](function(_0x1454e1){if(_0x1454e1){if(_0x14e081['body'][_0x1b18('0x79')]){_0x56d1d9['message']['interface']=util[_0x1b18('0x69')](_0x1b18('0x7a'),_0x14e081[_0x1b18('0x63')][_0x1b18('0x3a')]);_0x56d1d9[_0x1b18('0x28')]['channel']=_0x56d1d9[_0x1b18('0x7b')];_0x56d1d9[_0x1b18('0x28')][_0x1b18('0x7c')]=_0x56d1d9[_0x1b18('0x7b')];_0x56d1d9['message'][_0x1b18('0x7d')]=_0x1b18('0x5e');return respondWithRpcPromise(_0x1b18('0x7e'),_0x1b18('0x7e'),{'event':_0x1b18('0x7f'),'message':_0x56d1d9['message']},client9002)[_0x1b18('0x22')](function(){return _0x56d1d9;});}return _0x56d1d9;}return null;})[_0x1b18('0x22')](respondWithResult(_0x261eab,null))[_0x1b18('0x2b')](handleError(_0x261eab,null));};var interaction_log=require('../../config/logger')(_0x1b18('0x5d'));exports[_0x1b18('0x80')]=function(_0x2f4f37,_0x40a7ba,_0xc02ba6){var _0x3ed5f4={'agent':{},'channel':_0x1b18('0x5f')};if(_0x2f4f37[_0x1b18('0x5b')]['id']){delete _0x2f4f37[_0x1b18('0x5b')]['id'];}_0x2f4f37[_0x1b18('0x5b')][_0x1b18('0x62')]=_0x2f4f37[_0x1b18('0x5b')][_0x1b18('0x62')]||_0x2f4f37['user']['id'];_0x3ed5f4[_0x1b18('0x64')]['id']=_0x2f4f37[_0x1b18('0x5b')][_0x1b18('0x62')];return db[_0x1b18('0x4f')]['find']({'where':{'id':_0x2f4f37[_0x1b18('0x53')]['id'],'UserId':null}})[_0x1b18('0x22')](handleEntityNotFound(_0x40a7ba,null))[_0x1b18('0x22')](function(_0x3b939d){if(_0x3b939d){_0x3ed5f4['message']=_0x3b939d[_0x1b18('0x65')]({'plain':!![]});return db['SmsInteraction'][_0x1b18('0x58')]({'where':{'id':_0x3b939d[_0x1b18('0x67')]}});}return null;})[_0x1b18('0x22')](handleEntityNotFound(_0x40a7ba,null))[_0x1b18('0x22')](function(_0x29b864){if(_0x29b864){_0x3ed5f4[_0x1b18('0x6c')]=_0x29b864[_0x1b18('0x65')]({'plain':!![]});interaction_log[_0x1b18('0x81')](_0x1b18('0x82'),_0x2f4f37[_0x1b18('0x63')]['id'],_0x2f4f37[_0x1b18('0x63')][_0x1b18('0x3a')],_0x2f4f37[_0x1b18('0x63')][_0x1b18('0x6b')],_0x3ed5f4[_0x1b18('0x6c')]['id'],_0x2f4f37['body']?JSON[_0x1b18('0x6d')](_0x2f4f37[_0x1b18('0x5b')]):_0x1b18('0x6e'));return respondWithRpcPromise(_0x1b18('0x83'),_0x1b18('0x84'),_0x3ed5f4);}return null;})[_0x1b18('0x22')](function(_0x5998c7){var _0x44c455=_0x1b18('0x85')+_0x5998c7[_0x1b18('0x28')][_0x1b18('0x71')];return db['sequelize'][_0x1b18('0x40')](_0x44c455,{'type':db[_0x1b18('0x73')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x34c90d){return _0x34c90d;});})[_0x1b18('0x22')](function(_0x2ba191){if(_0x2ba191){_0x3ed5f4['message'][_0x1b18('0x86')]=_0x2ba191[0x0];if(!_0x2f4f37['body'][_0x1b18('0x62')])return;return db[_0x1b18('0x75')][_0x1b18('0x58')]({'where':{'id':_0x2f4f37[_0x1b18('0x5b')]['UserId'],'role':_0x1b18('0x64')},'attributes':['id',_0x1b18('0x3a'),'fullname',_0x1b18('0x77'),_0x1b18('0x78')],'raw':!![]});}return null;})[_0x1b18('0x22')](function(_0x2ab4c8){if(!_0x2ab4c8)return null;_0x3ed5f4[_0x1b18('0x28')][_0x1b18('0x64')]=_0x2ab4c8;return _0x3ed5f4;})[_0x1b18('0x22')](function(_0x5b6025){if(_0x5b6025){_0x5b6025[_0x1b18('0x28')][_0x1b18('0x87')]=util['format'](_0x1b18('0x7a'),_0x2f4f37[_0x1b18('0x63')][_0x1b18('0x3a')]);_0x5b6025[_0x1b18('0x28')][_0x1b18('0x7b')]=_0x3ed5f4[_0x1b18('0x7b')];_0x5b6025[_0x1b18('0x28')][_0x1b18('0x7c')]=_0x3ed5f4[_0x1b18('0x7b')];_0x5b6025[_0x1b18('0x28')]['event']='reject';respondWithRpcPromise(_0x1b18('0x7e'),_0x1b18('0x7e'),{'event':_0x1b18('0x88'),'message':_0x5b6025[_0x1b18('0x28')]},client9002);return _0x3ed5f4;}return null;})[_0x1b18('0x22')](respondWithResult(_0x40a7ba,null))['catch'](handleError(_0x40a7ba,null));};exports['status']=function(_0x2a3ecd,_0x10ea2c,_0x19d1bd){if(_0x2a3ecd[_0x1b18('0x5b')]['id']){delete _0x2a3ecd[_0x1b18('0x5b')]['id'];}var _0x22edc9;return db[_0x1b18('0x4f')][_0x1b18('0x58')]({'where':{'id':_0x2a3ecd['params']['id']}})[_0x1b18('0x22')](handleEntityNotFound(_0x10ea2c,null))[_0x1b18('0x22')](function(_0x3f8d8f){if(_0x3f8d8f){_0x22edc9=_0x3f8d8f;return db[_0x1b18('0x89')][_0x1b18('0x58')]({'where':{'id':_0x3f8d8f[_0x1b18('0x8a')]}});}})[_0x1b18('0x22')](handleEntityNotFound(_0x10ea2c,null))[_0x1b18('0x22')](function(_0x574bed){if(_0x574bed){logger[_0x1b18('0x24')](_0x1b18('0x25'),_0x1b18('0x2d'),_0x1b18('0x8b'),_0x574bed[_0x1b18('0x3d')],util[_0x1b18('0x8c')](_0x2a3ecd[_0x1b18('0x5b')],{'showHidden':![],'depth':null}));switch(_0x574bed[_0x1b18('0x3d')]){case _0x1b18('0x8d'):if(_0x2a3ecd[_0x1b18('0x5b')][_0x1b18('0x8e')]&&_0x2a3ecd[_0x1b18('0x5b')][_0x1b18('0x8e')]===_0x22edc9[_0x1b18('0x8f')]){return _0x22edc9['update']({'read':!![]});}else{logger[_0x1b18('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1b18('0x2d'),_0x1b18('0x8d'),util[_0x1b18('0x8c')](_0x2a3ecd[_0x1b18('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x1b18('0x90'):if(_0x2a3ecd[_0x1b18('0x5b')][_0x1b18('0x91')]&&_0x2a3ecd['body'][_0x1b18('0x91')]===_0x22edc9[_0x1b18('0x8f')]&&_['indexOf']([_0x1b18('0x92'),_0x1b18('0x93')],_0x2a3ecd[_0x1b18('0x5b')][_0x1b18('0x94')])>=0x0){return _0x22edc9['update']({'read':!![]});}else{logger[_0x1b18('0x26')](_0x1b18('0x95'),_0x1b18('0x2d'),_0x1b18('0x96'),util[_0x1b18('0x8c')](_0x2a3ecd[_0x1b18('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x25f6be=_0x2a3ecd[_0x1b18('0x5b')][_0x1b18('0x97')][0x0];if(_0x25f6be[_0x1b18('0x2d')][_0x1b18('0x98')]===_0x1b18('0x99')){return _0x22edc9[_0x1b18('0x5a')]({'read':!![]});}else{logger[_0x1b18('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1b18('0x2d'),_0x1b18('0x9a'),util[_0x1b18('0x8c')](_0x2a3ecd[_0x1b18('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x22edc9;}})[_0x1b18('0x22')](respondWithResult(_0x10ea2c,null))[_0x1b18('0x2b')](handleError(_0x10ea2c,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index cb3824d..d13378e 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 _0xf97d=['exports','events','SmsMessage','setMaxListeners','save','update','remove','emit','hook'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xf97d,0x18d));var _0xdf97=function(_0x4b6a4b,_0x271355){_0x4b6a4b=_0x4b6a4b-0x0;var _0xe002d1=_0xf97d[_0x4b6a4b];return _0xe002d1;};'use strict';var EventEmitter=require(_0xdf97('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0xdf97('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xdf97('0x2')](0x0);var events={'afterCreate':_0xdf97('0x3'),'afterUpdate':_0xdf97('0x4'),'afterDestroy':_0xdf97('0x5')};function emitEvent(_0xfb3a35){return function(_0x56bf16,_0x577bec,_0x1be3ce){SmsMessageEvents[_0xdf97('0x6')](_0xfb3a35+':'+_0x56bf16['id'],_0x56bf16);SmsMessageEvents[_0xdf97('0x6')](_0xfb3a35,_0x56bf16);_0x1be3ce(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xdf97('0x7')](e,emitEvent(event));}}module[_0xdf97('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x305a=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x49d104,_0x3dd68e){var _0x2a30b9=function(_0x3d3631){while(--_0x3d3631){_0x49d104['push'](_0x49d104['shift']());}};_0x2a30b9(++_0x3dd68e);}(_0x305a,0x6a));var _0xa305=function(_0x3707b4,_0x381890){_0x3707b4=_0x3707b4-0x0;var _0x46aa90=_0x305a[_0x3707b4];return _0x46aa90;};'use strict';var EventEmitter=require(_0xa305('0x0'));var SmsMessage=require(_0xa305('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xa305('0x2')](0x0);var events={'afterCreate':_0xa305('0x3'),'afterUpdate':_0xa305('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45397c){return function(_0x50ac6f,_0x55e58a,_0xa4ef82){SmsMessageEvents[_0xa305('0x5')](_0x45397c+':'+_0x50ac6f['id'],_0x50ac6f);SmsMessageEvents[_0xa305('0x5')](_0x45397c,_0x50ac6f);_0xa4ef82(null);};}for(var e in events){if(events[_0xa305('0x6')](e)){var event=events[e];SmsMessage[_0xa305('0x7')](e,emitEvent(event));}}module[_0xa305('0x8')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index baf142c..d36270b 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 _0xf648=['timestamp','sort','apiKey','createHash','md5','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','uuid','apiMessageId','bandwidth','%s:%s','https://messaging.bandwidth.com/api/v2/users/','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','models','get','direction','toLowerCase','out','secret','isNil','findOne','SmsInteractionId','createdAt','catch','error','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','phone','authToken','create','remote','/api/sms/messages/','token','sid','update','SmsMessage,\x20%s,\x20%s,\x20%s','skebby','username','password','body','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','format','https://rest.clicksend.com/v3/sms/send','toString','base64','http_code','data','queued_count','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','/status?token=','application/json','csc','crypto','login'];(function(_0x5c619e,_0x1bccdf){var _0x445cf8=function(_0x2eaa64){while(--_0x2eaa64){_0x5c619e['push'](_0x5c619e['shift']());}};_0x445cf8(++_0x1bccdf);}(_0xf648,0x93));var _0x8f64=function(_0x3f48c0,_0x447552){_0x3f48c0=_0x3f48c0-0x0;var _0x5a6552=_0xf648[_0x3f48c0];return _0x5a6552;};'use strict';var _=require(_0x8f64('0x0'));var util=require(_0x8f64('0x1'));var logger=require(_0x8f64('0x2'))(_0x8f64('0x3'));var moment=require(_0x8f64('0x4'));var BPromise=require(_0x8f64('0x5'));var rp=require(_0x8f64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f64('0x7'));var config=require('../../config/environment');var attributes=require(_0x8f64('0x8'));module[_0x8f64('0x9')]=function(_0x5337d3,_0x1e15f8){return _0x5337d3['define'](_0x8f64('0xa'),attributes,{'tableName':_0x8f64('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8f64('0xc')]},{'name':_0x8f64('0xd'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x374eb9,_0x388026,_0x10f6f1){var _0x569c74=_0x5337d3[_0x8f64('0xe')];var _0x1ce1ea=_0x374eb9[_0x8f64('0xf')]({'plain':!![]});if(_0x1ce1ea[_0x8f64('0x10')]['toLowerCase']()==='in'||_0x1ce1ea[_0x8f64('0x10')][_0x8f64('0x11')]()===_0x8f64('0x12')&&!_0x1ce1ea[_0x8f64('0x13')]&&!_[_0x8f64('0x14')](_0x1ce1ea['UserId'])&&!_[_0x8f64('0x14')](_0x1ce1ea['SmsInteractionId'])){_0x569c74['SmsInteraction'][_0x8f64('0x15')]({'where':{'id':_0x1ce1ea[_0x8f64('0x16')]}})['then'](function(_0x1d5b39){if(_0x1d5b39){_0x1d5b39['update']({'lastMsgAt':_0x1ce1ea[_0x8f64('0x17')],'lastMsgDirection':_0x1ce1ea[_0x8f64('0x10')][_0x8f64('0x11')]()});}})[_0x8f64('0x18')](function(_0x4b60de){console[_0x8f64('0x19')](_0x4b60de);});}if(_0x1ce1ea[_0x8f64('0x10')]==='out'&&!_0x1ce1ea[_0x8f64('0x13')]){var _0xd968eb;_0x569c74[_0x8f64('0x1a')][_0x8f64('0x1b')]({'where':{'id':_0x1ce1ea[_0x8f64('0x1c')]},'raw':!![]})[_0x8f64('0x1d')](function(_0x3ea5f1){_0xd968eb=_0x3ea5f1;if(_0xd968eb&&_0xd968eb[_0x8f64('0x1e')]){switch(_0xd968eb[_0x8f64('0x1e')]){case _0x8f64('0x1f'):var _0x4d1087=require(_0x8f64('0x1f'));if(_0xd968eb[_0x8f64('0x20')]&&_0xd968eb['authToken']&&_0xd968eb[_0x8f64('0x21')]){var _0x42dbbd=new _0x4d1087(_0xd968eb[_0x8f64('0x20')],_0xd968eb[_0x8f64('0x22')]);_0x42dbbd['messages'][_0x8f64('0x23')]({'body':_0x1ce1ea['body'],'to':_0x1ce1ea[_0x8f64('0x21')],'from':_0xd968eb[_0x8f64('0x21')],'statusCallback':_0xd968eb[_0x8f64('0x24')]+_0x8f64('0x25')+_0x1ce1ea['id']+'/status?token='+_0xd968eb[_0x8f64('0x26')]})[_0x8f64('0x1d')](function(_0x2ecea0){if(_0x2ecea0[_0x8f64('0x27')]){return _0x374eb9[_0x8f64('0x28')]({'messageId':_0x2ecea0[_0x8f64('0x27')]});}})['catch'](function(_0x48a226){logger[_0x8f64('0x19')](_0x8f64('0x29'),'afterCreate',_0x8f64('0x1f'),util['inspect'](_0x48a226,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),'afterCreate',_0x8f64('0x1f'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x8f64('0x2a'):var _0x512370='https://api.skebby.it/API/v1.0/REST/';if(_0xd968eb[_0x8f64('0x2b')]&&_0xd968eb[_0x8f64('0x2c')]){var _0x1067f4={'recipient':[_0x1ce1ea[_0x8f64('0x21')]],'message':_0x1ce1ea[_0x8f64('0x2d')],'message_type':_0xd968eb['smsMethod']};if(_0xd968eb['smsMethod']&&_0xd968eb[_0x8f64('0x2e')]!=='SI'){_0x1067f4[_0x8f64('0x2f')]=_0xd968eb['phone'];}var _0x4bed62={'url':_0x512370+_0x8f64('0x30')+_0xd968eb['username']+_0x8f64('0x31')+_0xd968eb[_0x8f64('0x2c')],'method':_0x8f64('0x32')};rp(_0x4bed62)[_0x8f64('0x1d')](function(_0x79c7c3){var _0x595de7=_0x79c7c3[_0x8f64('0x33')](';');var _0x1a9cbb={'user_key':_0x595de7[0x0],'session_key':_0x595de7[0x1]};_0x4bed62={'url':_0x512370+_0x8f64('0x34'),'method':_0x8f64('0x35'),'headers':{'user_key':_0x1a9cbb[_0x8f64('0x36')],'Session_key':_0x1a9cbb[_0x8f64('0x37')]},'json':!![],'body':_0x1067f4};return rp(_0x4bed62);})['then'](function(_0x202c19){if(_0x202c19[_0x8f64('0x38')]>=0x1){var _0x556ac4={'messageId':_0x202c19[_0x8f64('0x39')]};if(_0xd968eb[_0x8f64('0x2e')]!=='GP'||!_0xd968eb[_0x8f64('0x3a')]){_0x556ac4[_0x8f64('0x3b')]=!![];}return _0x374eb9['update'](_0x556ac4);}else{return logger[_0x8f64('0x19')](_0x8f64('0x29'),'afterCreate',_0x8f64('0x2a'),util[_0x8f64('0x3c')](_0x202c19,{'showHidden':![],'depth':null}));}})[_0x8f64('0x18')](function(_0x4637ae){return logger[_0x8f64('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8f64('0x3d'),'skebby',util[_0x8f64('0x3c')](_0x4637ae,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x2a'),_0x8f64('0x3e'));}break;case _0x8f64('0x3f'):if(_0xd968eb[_0x8f64('0x22')]){var _0x3e2291={'recipient':_0x1ce1ea[_0x8f64('0x21')],'message':_0x1ce1ea[_0x8f64('0x2d')],'sender':_0xd968eb[_0x8f64('0x40')]||_0xd968eb['phone'],'authorization':_0xd968eb[_0x8f64('0x22')]};var _0x388026={'method':_0x8f64('0x35'),'uri':_0x8f64('0x41'),'body':_0x3e2291,'json':!![]};rp(_0x388026)[_0x8f64('0x1d')](function(_0x13b22d){var _0x362d12={'messageId':_0x13b22d[_0x8f64('0x42')]};if(!_0xd968eb[_0x8f64('0x3a')]){_0x362d12[_0x8f64('0x3b')]=!![];}return _0x374eb9[_0x8f64('0x28')](_0x362d12);})[_0x8f64('0x18')](function(_0x528373){logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),'connectel',util[_0x8f64('0x3c')](_0x528373,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x3f'),_0x8f64('0x43'));}break;case'clicksend':if(_0xd968eb[_0x8f64('0x2b')]&&_0xd968eb[_0x8f64('0x2c')]){var _0x3e2291={'messages':[{'source':'xCALLY\x20Motion','to':_0x1ce1ea['phone'],'body':_0x1ce1ea[_0x8f64('0x2d')],'from':_0xd968eb[_0x8f64('0x40')]||_0xd968eb[_0x8f64('0x21')]}]};var _0x53e0a7=util[_0x8f64('0x44')]('%s:%s',_0xd968eb[_0x8f64('0x2b')],_0xd968eb[_0x8f64('0x2c')]);var _0x388026={'method':_0x8f64('0x35'),'uri':_0x8f64('0x45'),'body':_0x3e2291,'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(_0x53e0a7)[_0x8f64('0x46')](_0x8f64('0x47')))},'json':!![]};rp(_0x388026)[_0x8f64('0x1d')](function(_0x4e5324){if(_0x4e5324['http_code']>=0xc8&&_0x4e5324[_0x8f64('0x48')]<=0xce){if(_0x4e5324['data']&&_0x4e5324[_0x8f64('0x49')][_0x8f64('0x4a')]>0x0){var _0xa922eb=_['head'](_0x4e5324[_0x8f64('0x49')][_0x8f64('0x4b')]);var _0x259289={'messageId':_0xa922eb[_0x8f64('0x4c')]};if(!_0xd968eb[_0x8f64('0x3a')]){_0x259289['read']=!![];}return _0x374eb9['update'](_0x259289);}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x4d'),util[_0x8f64('0x3c')](_0x4e5324,{'showHidden':![],'depth':null}));}}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),'afterCreate','clickSend',util[_0x8f64('0x3c')](_0x4e5324,{'showHidden':![],'depth':null}));}})[_0x8f64('0x18')](function(_0x46e5be){logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x4d'),util[_0x8f64('0x3c')](_0x46e5be,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x4d'),_0x8f64('0x3e'));}break;case _0x8f64('0x4e'):if(_0xd968eb['authId']&&_0xd968eb[_0x8f64('0x22')]){var _0x3e2291={'dst':_0x1ce1ea['phone'],'text':_0x1ce1ea[_0x8f64('0x2d')],'src':_0xd968eb['senderString']||_0xd968eb[_0x8f64('0x21')],'url':_0xd968eb['remote']+_0x8f64('0x25')+_0x1ce1ea['id']+'/status?token='+_0xd968eb[_0x8f64('0x26')]};var _0x53e0a7=util['format']('%s:%s',_0xd968eb[_0x8f64('0x4f')],_0xd968eb[_0x8f64('0x22')]);var _0x388026={'method':_0x8f64('0x35'),'uri':util[_0x8f64('0x44')](_0x8f64('0x50'),_0xd968eb['authId']),'body':_0x3e2291,'headers':{'Authorization':util[_0x8f64('0x44')](_0x8f64('0x51'),new Buffer(_0x53e0a7)[_0x8f64('0x46')](_0x8f64('0x47')))},'json':!![]};rp(_0x388026)[_0x8f64('0x1d')](function(_0x153887){var _0x40ca1b={'messageId':_0x153887[_0x8f64('0x52')][0x0]};return _0x374eb9[_0x8f64('0x28')](_0x40ca1b);})[_0x8f64('0x18')](function(_0x1a0624){logger['error'](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x4e'),util[_0x8f64('0x3c')](_0x1a0624,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x4e'),_0x8f64('0x53'));}break;case _0x8f64('0x54'):if(_0xd968eb[_0x8f64('0x2b')]&&_0xd968eb[_0x8f64('0x2c')]){if(_0xd968eb[_0x8f64('0x55')]){var _0x585e18={'method':_0x8f64('0x35'),'uri':_0xd968eb['baseUrl']+_0x8f64('0x56'),'body':{'username':_0xd968eb[_0x8f64('0x2b')],'password':_0xd968eb[_0x8f64('0x2c')]},'json':!![]};return rp(_0x585e18)[_0x8f64('0x1d')](function(_0x34c8ff){var _0x59e4d0={'method':'POST','uri':_0xd968eb[_0x8f64('0x55')]+_0x8f64('0x57'),'body':{'messages':[{'from':_0xd968eb['phone'],'destinations':[{'to':_0x1ce1ea[_0x8f64('0x21')]}],'text':_0x1ce1ea['body'],'notifyUrl':_0xd968eb[_0x8f64('0x24')]+'/api/sms/messages/'+_0x1ce1ea['id']+_0x8f64('0x58')+_0xd968eb[_0x8f64('0x26')],'notifyContentType':_0x8f64('0x59'),'callbackData':_0xd968eb['phone']+';'+_0x1ce1ea[_0x8f64('0x2d')]}]},'headers':{'Authorization':'IBSSO\x20'+_0x34c8ff[_0x8f64('0x26')]},'json':!![]};return rp(_0x59e4d0)['then'](function(_0x565ab9){if(_0x565ab9[_0x8f64('0x4b')]){var _0x2c3c80={'messageId':_0x565ab9[_0x8f64('0x4b')][0x0][_0x8f64('0xc')]};if(!_0xd968eb['deliveryReport']){_0x2c3c80['read']=!![];}return _0x374eb9[_0x8f64('0x28')](_0x2c3c80);}else{return logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x54'),util['inspect'](_0x565ab9,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x53743f){return logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),'infobip',util[_0x8f64('0x3c')](_0x53743f,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8f64('0x3d'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x54'),_0x8f64('0x3e'));}break;case _0x8f64('0x5a'):var _0x39a9e1=require(_0x8f64('0x5b'));if(_0xd968eb['apiKey']){var _0x1163fb={};_0x1163fb[_0x8f64('0x5c')]=_0xd968eb[_0x8f64('0x2b')];_0x1163fb[_0x8f64('0x21')]=_0x1ce1ea['phone'];_0x1163fb['sender']=_0xd968eb['phone'];_0x1163fb['text']=_0x1ce1ea[_0x8f64('0x2d')];_0x1163fb[_0x8f64('0x5d')]=+new Date();var _0x4bdd92='';var _0x6078ed='';var _0x949365=Object['keys'](_0x1163fb);_0x949365[_0x8f64('0x5e')]();for(var _0x5ac3f1=0x0;_0x5ac3f1<_0x949365['length'];_0x5ac3f1++){if(_0x4bdd92!=''){_0x4bdd92+='&';}_0x4bdd92+=_0x949365[_0x5ac3f1]+'='+encodeURIComponent(_0x1163fb[_0x949365[_0x5ac3f1]]);_0x6078ed+=_0x1163fb[_0x949365[_0x5ac3f1]];}_0x6078ed+=_0xd968eb[_0x8f64('0x5f')];_0x6078ed=_0x39a9e1[_0x8f64('0x60')](_0x8f64('0x61'))[_0x8f64('0x28')](_0x6078ed)['digest']('hex');if(_0x4bdd92!==''){_0x4bdd92+='&';}_0x4bdd92+=_0x8f64('0x62')+_0x6078ed;var _0x4bed62={'method':_0x8f64('0x32'),'uri':_0xd968eb['baseUrl']+_0x8f64('0x63')+_0x4bdd92,'json':!![]};return rp(_0x4bed62)[_0x8f64('0x1d')](function(_0x35905a){var _0x11b9c8=Object['keys'](_0x35905a);if(_0x35905a[_0x11b9c8[0x0]]['error']&&parseInt(_0x35905a[_0x11b9c8[0x0]][_0x8f64('0x19')])===0x0){var _0x34852e={'messageId':_0x35905a[_0x11b9c8[0x0]][_0x8f64('0x64')]};if(!_0xd968eb[_0x8f64('0x3a')]){_0x34852e[_0x8f64('0x3b')]=!![];}return _0x374eb9[_0x8f64('0x28')](_0x34852e);}else{return logger[_0x8f64('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8f64('0x3d'),'csc',util[_0x8f64('0x3c')](_0x35905a[_0x8f64('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x49d861){return logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),'csc',util[_0x8f64('0x3c')](_0x49d861,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x5a'),_0x8f64('0x65'));}break;case _0x8f64('0x66'):if(_0xd968eb['apiKey']){var _0x1e62dc={'method':_0x8f64('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0xd968eb['apiKey']},'body':{'content':_0x1ce1ea['body'],'to':[_0x1ce1ea[_0x8f64('0x21')]],'from':_0xd968eb[_0x8f64('0x21')],'binary':![],'clientMessageId':_0x8f64('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x1e62dc)[_0x8f64('0x1d')](function(_0x451f9f){if(!_0x451f9f[_0x8f64('0x19')]){var _0x31e15d={'messageId':_0x451f9f['messages'][0x0][_0x8f64('0x68')]};if(!_0xd968eb[_0x8f64('0x3a')]){_0x31e15d[_0x8f64('0x3b')]=!![];}return _0x374eb9[_0x8f64('0x28')](_0x31e15d);}else{return logger[_0x8f64('0x19')](_0x8f64('0x29'),'afterCreate',_0x8f64('0x66'),util[_0x8f64('0x3c')](_0x451f9f['error'],{'showHidden':![],'depth':null}));}})[_0x8f64('0x18')](function(_0x20b966){return logger['error'](_0x8f64('0x29'),'afterCreate',_0x8f64('0x66'),util[_0x8f64('0x3c')](_0x20b966,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x66'),_0x8f64('0x65'));}break;case _0x8f64('0x69'):if(_0xd968eb[_0x8f64('0x2b')]&&_0xd968eb['password']){var _0x53e0a7=util[_0x8f64('0x44')](_0x8f64('0x6a'),_0xd968eb['username'],_0xd968eb[_0x8f64('0x2c')]);var _0x388026={'method':'POST','uri':_0x8f64('0x6b')+_0xd968eb['accountId']+'/messages','body':{'to':[_0x1ce1ea[_0x8f64('0x21')]],'text':_0x1ce1ea[_0x8f64('0x2d')],'from':_0xd968eb[_0x8f64('0x21')],'applicationId':_0xd968eb[_0x8f64('0x6c')]},'headers':{'Authorization':util['format'](_0x8f64('0x51'),new Buffer(_0x53e0a7)[_0x8f64('0x46')](_0x8f64('0x47')))},'json':!![]};rp(_0x388026)[_0x8f64('0x1d')](function(_0x124e9a){if(_0x124e9a['id']){var _0x4e852f={'messageId':_0x124e9a['id']};return _0x374eb9[_0x8f64('0x28')](_0x4e852f);}else{logger['error'](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x69'),util[_0x8f64('0x3c')](_0x124e9a,{'showHidden':![],'depth':null}));}})[_0x8f64('0x18')](function(_0x3e644d){logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),'bandwidth',util[_0x8f64('0x3c')](_0x3e644d,{'showHidden':![],'depth':null}));});}else{logger[_0x8f64('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8f64('0x3d'),_0x8f64('0x69'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x8f64('0x6d'):if(_0xd968eb['apiKey']){var _0x37a429={};var _0x4bed62={'method':_0x8f64('0x35'),'uri':_0x8f64('0x6e'),'headers':{'Authorization':_0x8f64('0x6f')+_0xd968eb[_0x8f64('0x5f')],'Content-Type':'application/json'},'body':{'from':_0xd968eb[_0x8f64('0x21')],'to':_0x1ce1ea[_0x8f64('0x21')],'text':_0x1ce1ea[_0x8f64('0x2d')]},'json':!![]};return rp(_0x4bed62)[_0x8f64('0x1d')](function(_0x35ead3){if(_0x35ead3['code']==0xca){_0x37a429[_0x8f64('0x70')]=_0x35ead3;var _0xb9c502={'method':_0x8f64('0x35'),'uri':_0x8f64('0x71'),'headers':{'Authorization':_0x8f64('0x6f')+_0xd968eb[_0x8f64('0x5f')],'Content-Type':_0x8f64('0x59')},'body':{'refid':_0x37a429['message'][_0x8f64('0x72')]},'json':!![]};return rp(_0xb9c502)['then'](function(_0x9118d3){_0x37a429[_0x8f64('0x73')]=_0x9118d3;var _0x368319={'messageId':_0x37a429[_0x8f64('0x70')][_0x8f64('0x72')],'read':!![]};return _0x374eb9[_0x8f64('0x28')](_0x368319);});}else{return logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x6d'),util[_0x8f64('0x3c')](_0x35ead3,{'showHidden':![],'depth':null}));}})[_0x8f64('0x18')](function(_0x535dd2){return logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),'intelepeer',util['inspect'](_0x535dd2,{'showHidden':![],'depth':null}));});}else{return logger[_0x8f64('0x19')](_0x8f64('0x29'),_0x8f64('0x3d'),_0x8f64('0x6d'),_0x8f64('0x74'));}break;}}})[_0x8f64('0x75')](function(){_0x10f6f1();});}else{_0x10f6f1();}}},'charset':_0x8f64('0x76'),'collate':_0x8f64('0x77')});}; \ No newline at end of file +var _0xd447=['direction','toLowerCase','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','catch','error','out','secret','SmsAccount','SmsAccountId','type','twilio','authToken','phone','accountSid','create','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','login?username=','&password=','GET','sms','POST','user_key','afterCreate','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','read','connectel','Missing\x20parameters:\x20authToken','clicksend','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','message_uuid','infobip','/auth/1/session','baseUrl','/sms/2/text/advanced','/status?token=','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','timestamp','keys','sort','md5','digest','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','intelepeer','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','get'];(function(_0x333d93,_0xdaf8af){var _0x2027b7=function(_0x23af5d){while(--_0x23af5d){_0x333d93['push'](_0x333d93['shift']());}};_0x2027b7(++_0xdaf8af);}(_0xd447,0x1da));var _0x7d44=function(_0x350c2f,_0x12263e){_0x350c2f=_0x350c2f-0x0;var _0x1be698=_0xd447[_0x350c2f];return _0x1be698;};'use strict';var _=require(_0x7d44('0x0'));var util=require(_0x7d44('0x1'));var logger=require(_0x7d44('0x2'))(_0x7d44('0x3'));var moment=require(_0x7d44('0x4'));var BPromise=require(_0x7d44('0x5'));var rp=require(_0x7d44('0x6'));var fs=require('fs');var path=require(_0x7d44('0x7'));var rimraf=require(_0x7d44('0x8'));var config=require(_0x7d44('0x9'));var attributes=require(_0x7d44('0xa'));module['exports']=function(_0x3a9d7e,_0x3fe451){return _0x3a9d7e['define'](_0x7d44('0xb'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x7d44('0xc'),'fields':[_0x7d44('0xc')]},{'name':_0x7d44('0xd'),'fields':[_0x7d44('0xe')],'type':_0x7d44('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x9ae202,_0x5f4e24,_0x527ae8){var _0x558499=_0x3a9d7e[_0x7d44('0x10')];var _0x4d1e35=_0x9ae202[_0x7d44('0x11')]({'plain':!![]});if(_0x4d1e35[_0x7d44('0x12')]['toLowerCase']()==='in'||_0x4d1e35[_0x7d44('0x12')][_0x7d44('0x13')]()==='out'&&!_0x4d1e35['secret']&&!_[_0x7d44('0x14')](_0x4d1e35[_0x7d44('0x15')])&&!_['isNil'](_0x4d1e35['SmsInteractionId'])){_0x558499['SmsInteraction'][_0x7d44('0x16')]({'where':{'id':_0x4d1e35[_0x7d44('0x17')]}})[_0x7d44('0x18')](function(_0x5dd50f){if(_0x5dd50f){_0x5dd50f[_0x7d44('0x19')]({'lastMsgAt':_0x4d1e35[_0x7d44('0x1a')],'lastMsgDirection':_0x4d1e35[_0x7d44('0x12')][_0x7d44('0x13')]()});}})[_0x7d44('0x1b')](function(_0x1dfe27){console[_0x7d44('0x1c')](_0x1dfe27);});}if(_0x4d1e35['direction']===_0x7d44('0x1d')&&!_0x4d1e35[_0x7d44('0x1e')]){var _0x1a17d4;_0x558499[_0x7d44('0x1f')]['find']({'where':{'id':_0x4d1e35[_0x7d44('0x20')]},'raw':!![]})[_0x7d44('0x18')](function(_0x1b2948){_0x1a17d4=_0x1b2948;if(_0x1a17d4&&_0x1a17d4[_0x7d44('0x21')]){switch(_0x1a17d4[_0x7d44('0x21')]){case _0x7d44('0x22'):var _0x315283=require(_0x7d44('0x22'));if(_0x1a17d4['accountSid']&&_0x1a17d4[_0x7d44('0x23')]&&_0x1a17d4[_0x7d44('0x24')]){var _0x1921f8=new _0x315283(_0x1a17d4[_0x7d44('0x25')],_0x1a17d4[_0x7d44('0x23')]);_0x1921f8['messages'][_0x7d44('0x26')]({'body':_0x4d1e35[_0x7d44('0xe')],'to':_0x4d1e35[_0x7d44('0x24')],'from':_0x1a17d4['phone'],'statusCallback':_0x1a17d4[_0x7d44('0x27')]+_0x7d44('0x28')+_0x4d1e35['id']+'/status?token='+_0x1a17d4[_0x7d44('0x29')]})[_0x7d44('0x18')](function(_0x10dc47){if(_0x10dc47[_0x7d44('0x2a')]){return _0x9ae202[_0x7d44('0x19')]({'messageId':_0x10dc47[_0x7d44('0x2a')]});}})[_0x7d44('0x1b')](function(_0x430a7d){logger['error'](_0x7d44('0x2b'),'afterCreate',_0x7d44('0x22'),util[_0x7d44('0x2c')](_0x430a7d,{'showHidden':![],'depth':null}));});}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate','twilio',_0x7d44('0x2d'));}break;case _0x7d44('0x2e'):var _0x4c82fc='https://api.skebby.it/API/v1.0/REST/';if(_0x1a17d4[_0x7d44('0x2f')]&&_0x1a17d4[_0x7d44('0x30')]){var _0x429017={'recipient':[_0x4d1e35[_0x7d44('0x24')]],'message':_0x4d1e35[_0x7d44('0xe')],'message_type':_0x1a17d4[_0x7d44('0x31')]};if(_0x1a17d4['smsMethod']&&_0x1a17d4[_0x7d44('0x31')]!=='SI'){_0x429017['sender']=_0x1a17d4[_0x7d44('0x24')];}var _0x3d36f2={'url':_0x4c82fc+_0x7d44('0x32')+_0x1a17d4[_0x7d44('0x2f')]+_0x7d44('0x33')+_0x1a17d4['password'],'method':_0x7d44('0x34')};rp(_0x3d36f2)[_0x7d44('0x18')](function(_0x34130a){var _0x239655=_0x34130a['split'](';');var _0x219054={'user_key':_0x239655[0x0],'session_key':_0x239655[0x1]};_0x3d36f2={'url':_0x4c82fc+_0x7d44('0x35'),'method':_0x7d44('0x36'),'headers':{'user_key':_0x219054[_0x7d44('0x37')],'Session_key':_0x219054['session_key']},'json':!![],'body':_0x429017};return rp(_0x3d36f2);})[_0x7d44('0x18')](function(_0x1c6726){if(_0x1c6726['total_sent']>=0x1){var _0x662672={'messageId':_0x1c6726['internal_order_id']};if(_0x1a17d4[_0x7d44('0x31')]!=='GP'||!_0x1a17d4['deliveryReport']){_0x662672['read']=!![];}return _0x9ae202[_0x7d44('0x19')](_0x662672);}else{return logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate',_0x7d44('0x2e'),util[_0x7d44('0x2c')](_0x1c6726,{'showHidden':![],'depth':null}));}})[_0x7d44('0x1b')](function(_0x31f3ec){return logger[_0x7d44('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d44('0x38'),_0x7d44('0x2e'),util['inspect'](_0x31f3ec,{'showHidden':![],'depth':null}));});}else{logger[_0x7d44('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d44('0x38'),_0x7d44('0x2e'),_0x7d44('0x39'));}break;case'connectel':if(_0x1a17d4[_0x7d44('0x23')]){var _0x261d88={'recipient':_0x4d1e35[_0x7d44('0x24')],'message':_0x4d1e35[_0x7d44('0xe')],'sender':_0x1a17d4[_0x7d44('0x3a')]||_0x1a17d4['phone'],'authorization':_0x1a17d4[_0x7d44('0x23')]};var _0x5f4e24={'method':'POST','uri':_0x7d44('0x3b'),'body':_0x261d88,'json':!![]};rp(_0x5f4e24)[_0x7d44('0x18')](function(_0x1e3739){var _0x5794f4={'messageId':_0x1e3739[_0x7d44('0x3c')]};if(!_0x1a17d4[_0x7d44('0x3d')]){_0x5794f4[_0x7d44('0x3e')]=!![];}return _0x9ae202['update'](_0x5794f4);})[_0x7d44('0x1b')](function(_0x5e1202){logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate',_0x7d44('0x3f'),util[_0x7d44('0x2c')](_0x5e1202,{'showHidden':![],'depth':null}));});}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate',_0x7d44('0x3f'),_0x7d44('0x40'));}break;case _0x7d44('0x41'):if(_0x1a17d4['username']&&_0x1a17d4[_0x7d44('0x30')]){var _0x261d88={'messages':[{'source':'xCALLY\x20Motion','to':_0x4d1e35[_0x7d44('0x24')],'body':_0x4d1e35[_0x7d44('0xe')],'from':_0x1a17d4[_0x7d44('0x3a')]||_0x1a17d4[_0x7d44('0x24')]}]};var _0x5e8da0=util[_0x7d44('0x42')]('%s:%s',_0x1a17d4[_0x7d44('0x2f')],_0x1a17d4['password']);var _0x5f4e24={'method':_0x7d44('0x36'),'uri':_0x7d44('0x43'),'body':_0x261d88,'headers':{'Authorization':util['format'](_0x7d44('0x44'),new Buffer(_0x5e8da0)['toString']('base64'))},'json':!![]};rp(_0x5f4e24)['then'](function(_0x36f079){if(_0x36f079[_0x7d44('0x45')]>=0xc8&&_0x36f079[_0x7d44('0x45')]<=0xce){if(_0x36f079[_0x7d44('0x46')]&&_0x36f079[_0x7d44('0x46')][_0x7d44('0x47')]>0x0){var _0x219ca0=_[_0x7d44('0x48')](_0x36f079[_0x7d44('0x46')][_0x7d44('0x49')]);var _0x448744={'messageId':_0x219ca0[_0x7d44('0x4a')]};if(!_0x1a17d4[_0x7d44('0x3d')]){_0x448744['read']=!![];}return _0x9ae202[_0x7d44('0x19')](_0x448744);}else{logger[_0x7d44('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d44('0x38'),_0x7d44('0x4b'),util['inspect'](_0x36f079,{'showHidden':![],'depth':null}));}}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x4b'),util['inspect'](_0x36f079,{'showHidden':![],'depth':null}));}})[_0x7d44('0x1b')](function(_0x10033b){logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x4b'),util[_0x7d44('0x2c')](_0x10033b,{'showHidden':![],'depth':null}));});}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),'clickSend',_0x7d44('0x39'));}break;case _0x7d44('0x4c'):if(_0x1a17d4[_0x7d44('0x4d')]&&_0x1a17d4[_0x7d44('0x23')]){var _0x261d88={'dst':_0x4d1e35[_0x7d44('0x24')],'text':_0x4d1e35[_0x7d44('0xe')],'src':_0x1a17d4[_0x7d44('0x3a')]||_0x1a17d4[_0x7d44('0x24')],'url':_0x1a17d4[_0x7d44('0x27')]+'/api/sms/messages/'+_0x4d1e35['id']+'/status?token='+_0x1a17d4[_0x7d44('0x29')]};var _0x5e8da0=util[_0x7d44('0x42')](_0x7d44('0x4e'),_0x1a17d4[_0x7d44('0x4d')],_0x1a17d4[_0x7d44('0x23')]);var _0x5f4e24={'method':_0x7d44('0x36'),'uri':util[_0x7d44('0x42')](_0x7d44('0x4f'),_0x1a17d4['authId']),'body':_0x261d88,'headers':{'Authorization':util[_0x7d44('0x42')](_0x7d44('0x44'),new Buffer(_0x5e8da0)[_0x7d44('0x50')](_0x7d44('0x51')))},'json':!![]};rp(_0x5f4e24)[_0x7d44('0x18')](function(_0x49afed){var _0x1d0159={'messageId':_0x49afed[_0x7d44('0x52')][0x0]};return _0x9ae202['update'](_0x1d0159);})[_0x7d44('0x1b')](function(_0x4bea8c){logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate',_0x7d44('0x4c'),util[_0x7d44('0x2c')](_0x4bea8c,{'showHidden':![],'depth':null}));});}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate',_0x7d44('0x4c'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0x7d44('0x53'):if(_0x1a17d4[_0x7d44('0x2f')]&&_0x1a17d4[_0x7d44('0x30')]){if(_0x1a17d4['baseUrl']){var _0x248414={'method':_0x7d44('0x36'),'uri':_0x1a17d4['baseUrl']+_0x7d44('0x54'),'body':{'username':_0x1a17d4['username'],'password':_0x1a17d4[_0x7d44('0x30')]},'json':!![]};return rp(_0x248414)[_0x7d44('0x18')](function(_0x2a463b){var _0xcfebae={'method':'POST','uri':_0x1a17d4[_0x7d44('0x55')]+_0x7d44('0x56'),'body':{'messages':[{'from':_0x1a17d4[_0x7d44('0x24')],'destinations':[{'to':_0x4d1e35['phone']}],'text':_0x4d1e35[_0x7d44('0xe')],'notifyUrl':_0x1a17d4[_0x7d44('0x27')]+'/api/sms/messages/'+_0x4d1e35['id']+_0x7d44('0x57')+_0x1a17d4[_0x7d44('0x29')],'notifyContentType':_0x7d44('0x58'),'callbackData':_0x1a17d4[_0x7d44('0x24')]+';'+_0x4d1e35['body']}]},'headers':{'Authorization':_0x7d44('0x59')+_0x2a463b[_0x7d44('0x29')]},'json':!![]};return rp(_0xcfebae)[_0x7d44('0x18')](function(_0x37a6a7){if(_0x37a6a7['messages']){var _0x10153c={'messageId':_0x37a6a7[_0x7d44('0x49')][0x0][_0x7d44('0xc')]};if(!_0x1a17d4['deliveryReport']){_0x10153c['read']=!![];}return _0x9ae202[_0x7d44('0x19')](_0x10153c);}else{return logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x53'),util[_0x7d44('0x2c')](_0x37a6a7,{'showHidden':![],'depth':null}));}});})[_0x7d44('0x1b')](function(_0x79d4f2){return logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate',_0x7d44('0x53'),util[_0x7d44('0x2c')](_0x79d4f2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x53'),_0x7d44('0x5a'));}}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x53'),_0x7d44('0x39'));}break;case _0x7d44('0x5b'):var _0x4e59b1=require(_0x7d44('0x5c'));if(_0x1a17d4[_0x7d44('0x5d')]){var _0x59a1d0={};_0x59a1d0[_0x7d44('0x5e')]=_0x1a17d4[_0x7d44('0x2f')];_0x59a1d0[_0x7d44('0x24')]=_0x4d1e35[_0x7d44('0x24')];_0x59a1d0['sender']=_0x1a17d4[_0x7d44('0x24')];_0x59a1d0[_0x7d44('0x5f')]=_0x4d1e35[_0x7d44('0xe')];_0x59a1d0[_0x7d44('0x60')]=+new Date();var _0x44b846='';var _0x4c27a0='';var _0x3f7511=Object[_0x7d44('0x61')](_0x59a1d0);_0x3f7511[_0x7d44('0x62')]();for(var _0x2e91c8=0x0;_0x2e91c8<_0x3f7511['length'];_0x2e91c8++){if(_0x44b846!=''){_0x44b846+='&';}_0x44b846+=_0x3f7511[_0x2e91c8]+'='+encodeURIComponent(_0x59a1d0[_0x3f7511[_0x2e91c8]]);_0x4c27a0+=_0x59a1d0[_0x3f7511[_0x2e91c8]];}_0x4c27a0+=_0x1a17d4[_0x7d44('0x5d')];_0x4c27a0=_0x4e59b1['createHash'](_0x7d44('0x63'))[_0x7d44('0x19')](_0x4c27a0)[_0x7d44('0x64')]('hex');if(_0x44b846!==''){_0x44b846+='&';}_0x44b846+=_0x7d44('0x65')+_0x4c27a0;var _0x3d36f2={'method':_0x7d44('0x34'),'uri':_0x1a17d4['baseUrl']+_0x7d44('0x66')+_0x44b846,'json':!![]};return rp(_0x3d36f2)['then'](function(_0x201ec1){var _0xe5c064=Object[_0x7d44('0x61')](_0x201ec1);if(_0x201ec1[_0xe5c064[0x0]][_0x7d44('0x1c')]&&parseInt(_0x201ec1[_0xe5c064[0x0]][_0x7d44('0x1c')])===0x0){var _0x51cf20={'messageId':_0x201ec1[_0xe5c064[0x0]][_0x7d44('0x67')]};if(!_0x1a17d4['deliveryReport']){_0x51cf20[_0x7d44('0x3e')]=!![];}return _0x9ae202[_0x7d44('0x19')](_0x51cf20);}else{return logger['error'](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x5b'),util[_0x7d44('0x2c')](_0x201ec1[_0x7d44('0x1c')],{'showHidden':![],'depth':null}));}})[_0x7d44('0x1b')](function(_0x34d684){return logger[_0x7d44('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d44('0x38'),_0x7d44('0x5b'),util[_0x7d44('0x2c')](_0x34d684,{'showHidden':![],'depth':null}));});}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate','csc',_0x7d44('0x68'));}break;case'clickatell':if(_0x1a17d4[_0x7d44('0x5d')]){var _0x57f82b={'method':_0x7d44('0x36'),'uri':_0x7d44('0x69'),'headers':{'Authorization':_0x1a17d4[_0x7d44('0x5d')]},'body':{'content':_0x4d1e35[_0x7d44('0xe')],'to':[_0x4d1e35[_0x7d44('0x24')]],'from':_0x1a17d4[_0x7d44('0x24')],'binary':![],'clientMessageId':_0x7d44('0x6a'),'charset':_0x7d44('0x6b')},'json':!![]};rp(_0x57f82b)[_0x7d44('0x18')](function(_0x163076){if(!_0x163076[_0x7d44('0x1c')]){var _0x462749={'messageId':_0x163076[_0x7d44('0x49')][0x0][_0x7d44('0x6c')]};if(!_0x1a17d4[_0x7d44('0x3d')]){_0x462749[_0x7d44('0x3e')]=!![];}return _0x9ae202['update'](_0x462749);}else{return logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x6d'),util[_0x7d44('0x2c')](_0x163076['error'],{'showHidden':![],'depth':null}));}})[_0x7d44('0x1b')](function(_0xbb2fdd){return logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x6d'),util['inspect'](_0xbb2fdd,{'showHidden':![],'depth':null}));});}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x6d'),_0x7d44('0x68'));}break;case _0x7d44('0x6e'):if(_0x1a17d4[_0x7d44('0x2f')]&&_0x1a17d4[_0x7d44('0x30')]){var _0x5e8da0=util[_0x7d44('0x42')](_0x7d44('0x4e'),_0x1a17d4[_0x7d44('0x2f')],_0x1a17d4[_0x7d44('0x30')]);var _0x5f4e24={'method':_0x7d44('0x36'),'uri':_0x7d44('0x6f')+_0x1a17d4['accountId']+'/messages','body':{'to':[_0x4d1e35[_0x7d44('0x24')]],'text':_0x4d1e35['body'],'from':_0x1a17d4[_0x7d44('0x24')],'applicationId':_0x1a17d4[_0x7d44('0x70')]},'headers':{'Authorization':util[_0x7d44('0x42')]('Basic\x20%s',new Buffer(_0x5e8da0)[_0x7d44('0x50')](_0x7d44('0x51')))},'json':!![]};rp(_0x5f4e24)[_0x7d44('0x18')](function(_0x21906f){if(_0x21906f['id']){var _0x5433c9={'messageId':_0x21906f['id']};return _0x9ae202[_0x7d44('0x19')](_0x5433c9);}else{logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x6e'),util[_0x7d44('0x2c')](_0x21906f,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1e4132){logger[_0x7d44('0x1c')](_0x7d44('0x2b'),'afterCreate','bandwidth',util[_0x7d44('0x2c')](_0x1e4132,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x6e'),_0x7d44('0x39'));}break;case'intelepeer':if(_0x1a17d4[_0x7d44('0x5d')]){var _0x335ad7={};var _0x3d36f2={'method':_0x7d44('0x36'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/send','headers':{'Authorization':_0x7d44('0x71')+_0x1a17d4['apiKey'],'Content-Type':_0x7d44('0x58')},'body':{'from':_0x1a17d4[_0x7d44('0x24')],'to':_0x4d1e35[_0x7d44('0x24')],'text':_0x4d1e35[_0x7d44('0xe')]},'json':!![]};return rp(_0x3d36f2)[_0x7d44('0x18')](function(_0x9ba0a1){if(_0x9ba0a1['code']==0xca){_0x335ad7[_0x7d44('0x72')]=_0x9ba0a1;var _0x5d24a8={'method':_0x7d44('0x36'),'uri':_0x7d44('0x73'),'headers':{'Authorization':'Bearer\x20'+_0x1a17d4[_0x7d44('0x5d')],'Content-Type':_0x7d44('0x58')},'body':{'refid':_0x335ad7[_0x7d44('0x72')][_0x7d44('0x74')]},'json':!![]};return rp(_0x5d24a8)['then'](function(_0x5e1d1f){_0x335ad7[_0x7d44('0x75')]=_0x5e1d1f;var _0x1b7ac1={'messageId':_0x335ad7[_0x7d44('0x72')]['refid'],'read':!![]};return _0x9ae202[_0x7d44('0x19')](_0x1b7ac1);});}else{return logger[_0x7d44('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d44('0x38'),_0x7d44('0x76'),util[_0x7d44('0x2c')](_0x9ba0a1,{'showHidden':![],'depth':null}));}})[_0x7d44('0x1b')](function(_0x4cdf79){return logger[_0x7d44('0x1c')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x7d44('0x38'),_0x7d44('0x76'),util[_0x7d44('0x2c')](_0x4cdf79,{'showHidden':![],'depth':null}));});}else{return logger[_0x7d44('0x1c')](_0x7d44('0x2b'),_0x7d44('0x38'),_0x7d44('0x76'),_0x7d44('0x77'));}break;}}})[_0x7d44('0x78')](function(){_0x527ae8();});}else{_0x527ae8();}}},'charset':_0x7d44('0x79'),'collate':_0x7d44('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index d91b827..afb773a 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 _0x9a35=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','debug','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9a35,0x1e2));var _0x59a3=function(_0x27621c,_0x33125e){_0x27621c=_0x27621c-0x0;var _0x2e2df5=_0x9a35[_0x27621c];return _0x2e2df5;};'use strict';var _=require(_0x59a3('0x0'));var util=require(_0x59a3('0x1'));var moment=require('moment');var BPromise=require(_0x59a3('0x2'));var rs=require(_0x59a3('0x3'));var fs=require('fs');var Redis=require(_0x59a3('0x4'));var db=require(_0x59a3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x59a3('0x6'))(_0x59a3('0x7'));var config=require(_0x59a3('0x8'));var jayson=require(_0x59a3('0x9'));var client=jayson[_0x59a3('0xa')][_0x59a3('0xb')]({'port':0x232a});config[_0x59a3('0xc')]=_['defaults'](config[_0x59a3('0xc')],{'host':_0x59a3('0xd'),'port':0x18eb});var socket=require(_0x59a3('0xe'))(new Redis(config['redis']));require(_0x59a3('0xf'))[_0x59a3('0x10')](socket);function respondWithRpcPromise(_0x3b9dad,_0xca3664,_0x305490){return new BPromise(function(_0x511f97,_0x4843ec){return client[_0x59a3('0x11')](_0x3b9dad,_0x305490)['then'](function(_0x2fb8fe){logger[_0x59a3('0x12')](_0x59a3('0x13'),_0xca3664,_0x59a3('0x14'));logger['debug'](_0x59a3('0x15'),_0xca3664,_0x59a3('0x14'),JSON[_0x59a3('0x16')](_0x2fb8fe));if(_0x2fb8fe['error']){if(_0x2fb8fe[_0x59a3('0x17')][_0x59a3('0x18')]===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0xca3664,_0x2fb8fe[_0x59a3('0x17')]['message']);return _0x4843ec(_0x2fb8fe['error'][_0x59a3('0x19')]);}logger[_0x59a3('0x17')]('SmsMessage,\x20%s,\x20%s',_0xca3664,_0x2fb8fe[_0x59a3('0x17')][_0x59a3('0x19')]);return _0x511f97(_0x2fb8fe[_0x59a3('0x17')][_0x59a3('0x19')]);}else{logger[_0x59a3('0x12')](_0x59a3('0x13'),_0xca3664,'request\x20sent');_0x511f97(_0x2fb8fe[_0x59a3('0x1a')][_0x59a3('0x19')]);}})[_0x59a3('0x1b')](function(_0x524f69){logger['error']('SmsMessage,\x20%s,\x20%s',_0xca3664,_0x524f69);_0x4843ec(_0x524f69);});});}exports[_0x59a3('0x1c')]=function(_0x528d2b){var _0x164097=this;return new Promise(function(_0xde0251,_0x51b919){return db[_0x59a3('0x1d')][_0x59a3('0x1e')](_0x528d2b[_0x59a3('0x1f')],{'raw':_0x528d2b[_0x59a3('0x20')]?_0x528d2b[_0x59a3('0x20')][_0x59a3('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x4b8a15){logger[_0x59a3('0x12')](_0x59a3('0x1c'),_0x528d2b);logger[_0x59a3('0x22')](_0x59a3('0x1c'),_0x528d2b,JSON[_0x59a3('0x16')](_0x4b8a15));_0xde0251(_0x4b8a15);})['catch'](function(_0x202d32){logger[_0x59a3('0x17')](_0x59a3('0x1c'),_0x202d32[_0x59a3('0x19')],_0x528d2b);_0x51b919(_0x164097[_0x59a3('0x17')](0x1f4,_0x202d32[_0x59a3('0x19')]));});});}; \ No newline at end of file +var _0x2369=['defaults','localhost','socket.io-emitter','./smsMessage.socket','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','create','body','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x35a1d1,_0x494ff4){var _0x49595f=function(_0x5d7fca){while(--_0x5d7fca){_0x35a1d1['push'](_0x35a1d1['shift']());}};_0x49595f(++_0x494ff4);}(_0x2369,0xb3));var _0x9236=function(_0x541f52,_0x2551b2){_0x541f52=_0x541f52-0x0;var _0x57d9e4=_0x2369[_0x541f52];return _0x57d9e4;};'use strict';var _=require(_0x9236('0x0'));var util=require(_0x9236('0x1'));var moment=require(_0x9236('0x2'));var BPromise=require(_0x9236('0x3'));var rs=require(_0x9236('0x4'));var fs=require('fs');var Redis=require(_0x9236('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9236('0x6'));var logger=require(_0x9236('0x7'))(_0x9236('0x8'));var config=require(_0x9236('0x9'));var jayson=require(_0x9236('0xa'));var client=jayson[_0x9236('0xb')]['http']({'port':0x232a});config[_0x9236('0xc')]=_[_0x9236('0xd')](config[_0x9236('0xc')],{'host':_0x9236('0xe'),'port':0x18eb});var socket=require(_0x9236('0xf'))(new Redis(config[_0x9236('0xc')]));require(_0x9236('0x10'))['register'](socket);function respondWithRpcPromise(_0x54c7a7,_0x309db5,_0x164a4f){return new BPromise(function(_0x51e04e,_0x81f229){return client['request'](_0x54c7a7,_0x164a4f)[_0x9236('0x11')](function(_0x2ee70e){logger[_0x9236('0x12')](_0x9236('0x13'),_0x309db5,_0x9236('0x14'));logger[_0x9236('0x15')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x309db5,'request\x20sent',JSON[_0x9236('0x16')](_0x2ee70e));if(_0x2ee70e['error']){if(_0x2ee70e['error'][_0x9236('0x17')]===0x1f4){logger[_0x9236('0x18')](_0x9236('0x13'),_0x309db5,_0x2ee70e['error'][_0x9236('0x19')]);return _0x81f229(_0x2ee70e[_0x9236('0x18')][_0x9236('0x19')]);}logger['error'](_0x9236('0x13'),_0x309db5,_0x2ee70e[_0x9236('0x18')][_0x9236('0x19')]);return _0x51e04e(_0x2ee70e[_0x9236('0x18')][_0x9236('0x19')]);}else{logger[_0x9236('0x12')](_0x9236('0x13'),_0x309db5,_0x9236('0x14'));_0x51e04e(_0x2ee70e['result'][_0x9236('0x19')]);}})[_0x9236('0x1a')](function(_0x4458cb){logger[_0x9236('0x18')](_0x9236('0x13'),_0x309db5,_0x4458cb);_0x81f229(_0x4458cb);});});}exports['CreateSmsMessage']=function(_0x55565a){var _0x327156=this;return new Promise(function(_0x219aac,_0x5a2978){return db['SmsMessage'][_0x9236('0x1b')](_0x55565a[_0x9236('0x1c')],{'raw':_0x55565a[_0x9236('0x1d')]?_0x55565a[_0x9236('0x1d')][_0x9236('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x517d2a){logger[_0x9236('0x12')]('CreateSmsMessage',_0x55565a);logger[_0x9236('0x15')](_0x9236('0x1f'),_0x55565a,JSON[_0x9236('0x16')](_0x517d2a));_0x219aac(_0x517d2a);})[_0x9236('0x1a')](function(_0x232bf4){logger[_0x9236('0x18')](_0x9236('0x1f'),_0x232bf4[_0x9236('0x19')],_0x55565a);_0x5a2978(_0x327156[_0x9236('0x18')](0x1f4,_0x232bf4[_0x9236('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index d6ba24c..c05892e 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 _0x02ef=['save','emit','removeListener','register','length','smsMessage:','./smsMessage.events'];(function(_0x30c106,_0x4eafa9){var _0xfbcc47=function(_0x3f29f2){while(--_0x3f29f2){_0x30c106['push'](_0x30c106['shift']());}};_0xfbcc47(++_0x4eafa9);}(_0x02ef,0x187));var _0xf02e=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x02ef[_0x27beea];return _0x122645;};'use strict';var SmsMessageEvents=require(_0xf02e('0x0'));var events=[_0xf02e('0x1'),'remove','update'];function createListener(_0xd51929,_0x320267){return function(_0x165f77){_0x320267[_0xf02e('0x2')](_0xd51929,_0x165f77);};}function removeListener(_0x5e280f,_0x3d47e7){return function(){SmsMessageEvents[_0xf02e('0x3')](_0x5e280f,_0x3d47e7);};}exports[_0xf02e('0x4')]=function(_0x3c768c){for(var _0x1ab43f=0x0,_0x50ca95=events[_0xf02e('0x5')];_0x1ab43f<_0x50ca95;_0x1ab43f++){var _0x307769=events[_0x1ab43f];var _0x1a4fc7=createListener(_0xf02e('0x6')+_0x307769,_0x3c768c);SmsMessageEvents['on'](_0x307769,_0x1a4fc7);}}; \ No newline at end of file +var _0xa8a1=['removeListener','length','smsMessage:','./smsMessage.events','remove','update'];(function(_0x4b51fc,_0x4905d9){var _0x1bf5ae=function(_0xe4d48){while(--_0xe4d48){_0x4b51fc['push'](_0x4b51fc['shift']());}};_0x1bf5ae(++_0x4905d9);}(_0xa8a1,0x12f));var _0x1a8a=function(_0x44edc6,_0xd6d6ef){_0x44edc6=_0x44edc6-0x0;var _0x24be45=_0xa8a1[_0x44edc6];return _0x24be45;};'use strict';var SmsMessageEvents=require(_0x1a8a('0x0'));var events=['save',_0x1a8a('0x1'),_0x1a8a('0x2')];function createListener(_0x32f982,_0x420c51){return function(_0x3c51b7){_0x420c51['emit'](_0x32f982,_0x3c51b7);};}function removeListener(_0x45da86,_0xfcf834){return function(){SmsMessageEvents[_0x1a8a('0x3')](_0x45da86,_0xfcf834);};}exports['register']=function(_0xe0187){for(var _0x3dc3b7=0x0,_0x27eac5=events[_0x1a8a('0x4')];_0x3dc3b7<_0x27eac5;_0x3dc3b7++){var _0x1887b8=events[_0x3dc3b7];var _0x32c69c=createListener(_0x1a8a('0x5')+_0x1887b8,_0xe0187);SmsMessageEvents['on'](_0x1887b8,_0x32c69c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 727d0a6..0733a53 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 _0xa06c=['../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/users','getAgents','post','/:id/teams','put','destroy','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40cdfa,_0x1cf634){var _0x2c5e4d=function(_0x1a666c){while(--_0x1a666c){_0x40cdfa['push'](_0x40cdfa['shift']());}};_0x2c5e4d(++_0x1cf634);}(_0xa06c,0x19d));var _0xca06=function(_0x3d26e1,_0x4736af){_0x3d26e1=_0x3d26e1-0x0;var _0x173b71=_0xa06c[_0x3d26e1];return _0x173b71;};'use strict';var multer=require(_0xca06('0x0'));var util=require(_0xca06('0x1'));var path=require('path');var timeout=require(_0xca06('0x2'));var express=require(_0xca06('0x3'));var router=express['Router']();var fs_extra=require(_0xca06('0x4'));var auth=require(_0xca06('0x5'));var interaction=require(_0xca06('0x6'));var config=require(_0xca06('0x7'));var controller=require(_0xca06('0x8'));router[_0xca06('0x9')]('/',auth[_0xca06('0xa')](),controller[_0xca06('0xb')]);router[_0xca06('0x9')](_0xca06('0xc'),auth[_0xca06('0xa')](),controller[_0xca06('0xd')]);router[_0xca06('0x9')](_0xca06('0xe'),auth[_0xca06('0xa')](),controller[_0xca06('0xf')]);router['get'](_0xca06('0x10'),auth[_0xca06('0xa')](),controller[_0xca06('0x11')]);router[_0xca06('0x9')]('/:id/teams',auth[_0xca06('0xa')](),controller['getTeams']);router[_0xca06('0x9')](_0xca06('0x12'),auth[_0xca06('0xa')](),controller[_0xca06('0x13')]);router[_0xca06('0x14')]('/',auth[_0xca06('0xa')](),controller['create']);router[_0xca06('0x14')](_0xca06('0x15'),auth[_0xca06('0xa')](),controller['addTeams']);router[_0xca06('0x14')](_0xca06('0x12'),auth[_0xca06('0xa')](),controller['addAgents']);router[_0xca06('0x16')](_0xca06('0xe'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xca06('0xa')](),controller[_0xca06('0x17')]);router[_0xca06('0x18')](_0xca06('0x15'),auth['isAuthenticated'](),controller[_0xca06('0x19')]);router[_0xca06('0x18')]('/:id/users',auth[_0xca06('0xa')](),controller[_0xca06('0x1a')]);module[_0xca06('0x1b')]=router; \ No newline at end of file +var _0xb6f0=['express','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','create','post','/:id/teams','addTeams','delete','removeAgents','exports','util','path','connect-timeout'];(function(_0xaeb10d,_0x40cc24){var _0x356997=function(_0x37d75e){while(--_0x37d75e){_0xaeb10d['push'](_0xaeb10d['shift']());}};_0x356997(++_0x40cc24);}(_0xb6f0,0x9e));var _0x0b6f=function(_0x36f47c,_0x38ef4d){_0x36f47c=_0x36f47c-0x0;var _0x296c55=_0xb6f0[_0x36f47c];return _0x296c55;};'use strict';var multer=require('multer');var util=require(_0x0b6f('0x0'));var path=require(_0x0b6f('0x1'));var timeout=require(_0x0b6f('0x2'));var express=require(_0x0b6f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0b6f('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0b6f('0x5'));var controller=require(_0x0b6f('0x6'));router[_0x0b6f('0x7')]('/',auth[_0x0b6f('0x8')](),controller['index']);router['get']('/describe',auth[_0x0b6f('0x8')](),controller[_0x0b6f('0x9')]);router['get'](_0x0b6f('0xa'),auth[_0x0b6f('0x8')](),controller[_0x0b6f('0xb')]);router[_0x0b6f('0x7')](_0x0b6f('0xc'),auth[_0x0b6f('0x8')](),controller[_0x0b6f('0xd')]);router[_0x0b6f('0x7')]('/:id/teams',auth[_0x0b6f('0x8')](),controller[_0x0b6f('0xe')]);router[_0x0b6f('0x7')](_0x0b6f('0xf'),auth[_0x0b6f('0x8')](),controller['getAgents']);router['post']('/',auth[_0x0b6f('0x8')](),controller[_0x0b6f('0x10')]);router[_0x0b6f('0x11')](_0x0b6f('0x12'),auth[_0x0b6f('0x8')](),controller[_0x0b6f('0x13')]);router[_0x0b6f('0x11')]('/:id/users',auth[_0x0b6f('0x8')](),controller['addAgents']);router['put'](_0x0b6f('0xa'),auth[_0x0b6f('0x8')](),controller['update']);router[_0x0b6f('0x14')](_0x0b6f('0xa'),auth[_0x0b6f('0x8')](),controller['destroy']);router['delete'](_0x0b6f('0x12'),auth[_0x0b6f('0x8')](),controller['removeTeams']);router[_0x0b6f('0x14')](_0x0b6f('0xf'),auth['isAuthenticated'](),controller[_0x0b6f('0x15')]);module[_0x0b6f('0x16')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 42355b8..b480e74 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 _0x7d39=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x45c78e,_0x89aa5d){var _0x4fd81c=function(_0x3b7a75){while(--_0x3b7a75){_0x45c78e['push'](_0x45c78e['shift']());}};_0x4fd81c(++_0x89aa5d);}(_0x7d39,0x186));var _0x97d3=function(_0x4fe662,_0x2d99ba){_0x4fe662=_0x4fe662-0x0;var _0xd884ca=_0x7d39[_0x4fe662];return _0xd884ca;};'use strict';var Sequelize=require(_0x97d3('0x0'));module[_0x97d3('0x1')]={'name':{'type':Sequelize[_0x97d3('0x2')],'unique':_0x97d3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x97d3('0x2')]},'timeout':{'type':Sequelize[_0x97d3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x97d3('0x5')](_0x97d3('0x6'),_0x97d3('0x7'),_0x97d3('0x8'))}}; \ No newline at end of file +var _0x8f3d=['INTEGER','sequelize','exports','STRING'];(function(_0x50b7ce,_0x2ba6f7){var _0xbc4933=function(_0x1b28f9){while(--_0x1b28f9){_0x50b7ce['push'](_0x50b7ce['shift']());}};_0xbc4933(++_0x2ba6f7);}(_0x8f3d,0xc5));var _0xd8f3=function(_0x559885,_0x3e5b71){_0x559885=_0x559885-0x0;var _0x3ceca7=_0x8f3d[_0x559885];return _0x3ceca7;};'use strict';var Sequelize=require(_0xd8f3('0x0'));module[_0xd8f3('0x1')]={'name':{'type':Sequelize[_0xd8f3('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd8f3('0x2')]},'timeout':{'type':Sequelize[_0xd8f3('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 8511936..2a5e585 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 _0x5f2f=['redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','map','SmsQueue','rawAttributes','type','key','getOptions','where','include','findAll','rows','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','field','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','sequelize','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userSmsQueue:remove','getAgents','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api'];(function(_0x450447,_0x1adb93){var _0xf05a8a=function(_0x4aecf9){while(--_0x4aecf9){_0x450447['push'](_0x450447['shift']());}};_0xf05a8a(++_0x1adb93);}(_0x5f2f,0x73));var _0xf5f2=function(_0x556e23,_0xe582c3){_0x556e23=_0x556e23-0x0;var _0x1c5107=_0x5f2f[_0x556e23];return _0x1c5107;};'use strict';var BPromise=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var squel=require(_0xf5f2('0x3'));var Redis=require(_0xf5f2('0x4'));var qs=require(_0xf5f2('0x5'));var logger=require(_0xf5f2('0x6'))(_0xf5f2('0x7'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf5f2('0x8')]=_[_0xf5f2('0x9')](config[_0xf5f2('0x8')],{'host':_0xf5f2('0xa'),'port':0x18eb});var socket=require(_0xf5f2('0xb'))(new Redis(config[_0xf5f2('0x8')]));require('./smsQueue.socket')[_0xf5f2('0xc')](socket);function respondWithStatusCode(_0x46cd9c,_0x2ec345){_0x2ec345=_0x2ec345||0xcc;return function(_0x56a69f){if(_0x56a69f){return _0x46cd9c[_0xf5f2('0xd')](_0x2ec345);}return _0x46cd9c[_0xf5f2('0xe')](_0x2ec345)[_0xf5f2('0xf')]();};}function respondWithResult(_0x4e0e6b,_0x977a59){_0x977a59=_0x977a59||0xc8;return function(_0x4ebbbe){if(_0x4ebbbe){return _0x4e0e6b['status'](_0x977a59)[_0xf5f2('0x10')](_0x4ebbbe);}};}function respondWithFilteredResult(_0x151aba,_0x4b78cd){return function(_0x336f6b){if(_0x336f6b){var _0x14b51f=typeof _0x4b78cd[_0xf5f2('0x11')]===_0xf5f2('0x12')&&typeof _0x4b78cd[_0xf5f2('0x13')]===_0xf5f2('0x12');var _0x5c01b8=_0x336f6b[_0xf5f2('0x14')];var _0xea612c=_0x14b51f?0x0:_0x4b78cd[_0xf5f2('0x11')];var _0x1c1a5c=_0x14b51f?_0x336f6b[_0xf5f2('0x14')]:_0x4b78cd['offset']+_0x4b78cd[_0xf5f2('0x13')];var _0x286197;if(_0x1c1a5c>=_0x5c01b8){_0x1c1a5c=_0x5c01b8;_0x286197=0xc8;}else{_0x286197=0xce;}_0x151aba[_0xf5f2('0xe')](_0x286197);return _0x151aba[_0xf5f2('0x15')](_0xf5f2('0x16'),_0xea612c+'-'+_0x1c1a5c+'/'+_0x5c01b8)[_0xf5f2('0x10')](_0x336f6b);}return null;};}function saveUpdates(_0xdb61b3){return function(_0x395a5a){if(_0x395a5a){return _0x395a5a[_0xf5f2('0x17')](_0xdb61b3)[_0xf5f2('0x18')](function(_0x20fccd){return _0x20fccd;});}return null;};}function removeEntity(_0x28e097){return function(_0x4ff59b){if(_0x4ff59b){return _0x4ff59b[_0xf5f2('0x19')]()[_0xf5f2('0x18')](function(){var _0x626999=_0x4ff59b[_0xf5f2('0x1a')]({'plain':!![]});var _0x56acc5=_0xf5f2('0x1b');return db[_0xf5f2('0x1c')]['destroy']({'where':{'type':_0x56acc5,'resourceId':_0x626999['id']}})['then'](function(){return _0x4ff59b;});})[_0xf5f2('0x18')](function(){_0x28e097[_0xf5f2('0xe')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45b74f){return function(_0x170042){if(!_0x170042){_0x45b74f[_0xf5f2('0xd')](0x194);}return _0x170042;};}function handleError(_0x39c024,_0x36f1cb){_0x36f1cb=_0x36f1cb||0x1f4;return function(_0x4c691a){logger[_0xf5f2('0x1d')](_0x4c691a[_0xf5f2('0x1e')]);if(_0x4c691a[_0xf5f2('0x1f')]){delete _0x4c691a[_0xf5f2('0x1f')];}_0x39c024[_0xf5f2('0xe')](_0x36f1cb)['send'](_0x4c691a);};}exports['index']=function(_0x5f1124,_0x3f79d5){var _0x13da6f={};var _0x1a5bb3={'count':0x0,'rows':[]};var _0xf6c58d=_[_0xf5f2('0x20')](db[_0xf5f2('0x21')][_0xf5f2('0x22')],function(_0x294414){return{'name':_0x294414['fieldName'],'type':_0x294414[_0xf5f2('0x23')][_0xf5f2('0x24')]};});_0x13da6f=qs[_0xf5f2('0x25')](_0xf6c58d,_0x5f1124);var _0x31bfcb={'where':_0x13da6f[_0xf5f2('0x26')]};return db[_0xf5f2('0x21')]['count'](_0x31bfcb)['then'](function(_0x22c826){_0x1a5bb3[_0xf5f2('0x14')]=_0x22c826;_0x13da6f[_0xf5f2('0x27')]=qs['include'](_0x5f1124['query']);return db[_0xf5f2('0x21')][_0xf5f2('0x28')](_0x13da6f);})[_0xf5f2('0x18')](function(_0x153924){_0x1a5bb3[_0xf5f2('0x29')]=_0x153924;return _0x1a5bb3;})['then'](respondWithFilteredResult(_0x3f79d5,_0x13da6f))['catch'](handleError(_0x3f79d5,null));};exports[_0xf5f2('0x2a')]=function(_0x4e19cb,_0xb744b9){var _0x58a4df={'raw':!![],'where':{'id':_0x4e19cb[_0xf5f2('0x2b')]['id']}},_0x45b643={};_0x45b643[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x21')][_0xf5f2('0x22')]);_0x45b643[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x4e19cb['query']);_0x45b643[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],_0x45b643[_0xf5f2('0x2e')]);_0x58a4df[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x45b643[_0xf5f2('0x2c')],qs['fields'](_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x58a4df['attributes']=_0x58a4df[_0xf5f2('0x31')]['length']?_0x58a4df[_0xf5f2('0x31')]:_0x45b643[_0xf5f2('0x2c')];if(_0x4e19cb[_0xf5f2('0x2e')][_0xf5f2('0x33')]){_0x58a4df['include']=[{'all':!![]}];}_0x58a4df=_['merge']({},_0x58a4df,_0x4e19cb[_0xf5f2('0x34')]);return db[_0xf5f2('0x21')][_0xf5f2('0x35')](_0x58a4df)['then'](handleEntityNotFound(_0xb744b9,null))[_0xf5f2('0x18')](respondWithResult(_0xb744b9,null))['catch'](handleError(_0xb744b9,null));};exports[_0xf5f2('0x36')]=function(_0x566c47,_0x46f464){return db[_0xf5f2('0x21')]['create'](_0x566c47[_0xf5f2('0x37')],{})[_0xf5f2('0x18')](function(_0x5a4441){var _0x35f738=_0x566c47['user']['get']({'plain':!![]});if(!_0x35f738)throw new Error(_0xf5f2('0x38'));if(_0x35f738[_0xf5f2('0x39')]===_0xf5f2('0x3a')){var _0x2d4400=_0x5a4441[_0xf5f2('0x1a')]({'plain':!![]});var _0xe62b57=_0xf5f2('0x1b');return db['UserProfileSection'][_0xf5f2('0x35')]({'where':{'name':_0xe62b57,'userProfileId':_0x35f738[_0xf5f2('0x3b')]},'raw':!![]})['then'](function(_0xc6a1ae){if(_0xc6a1ae&&_0xc6a1ae[_0xf5f2('0x3c')]===0x0){return db[_0xf5f2('0x1c')][_0xf5f2('0x36')]({'name':_0x2d4400[_0xf5f2('0x1f')],'resourceId':_0x2d4400['id'],'type':_0xc6a1ae[_0xf5f2('0x1f')],'sectionId':_0xc6a1ae['id']},{})[_0xf5f2('0x18')](function(){return _0x5a4441;});}else{return _0x5a4441;}})[_0xf5f2('0x3d')](function(_0x574f24){logger[_0xf5f2('0x1d')](_0xf5f2('0x3e'),_0x574f24);throw _0x574f24;});}return _0x5a4441;})[_0xf5f2('0x18')](respondWithResult(_0x46f464,0xc9))['catch'](handleError(_0x46f464,null));};exports['update']=function(_0x59eb00,_0x76d21b){if(_0x59eb00[_0xf5f2('0x37')]['id']){delete _0x59eb00['body']['id'];}return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x59eb00[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x76d21b,null))[_0xf5f2('0x18')](saveUpdates(_0x59eb00[_0xf5f2('0x37')],null))[_0xf5f2('0x18')](respondWithResult(_0x76d21b,null))[_0xf5f2('0x3d')](handleError(_0x76d21b,null));};exports[_0xf5f2('0x19')]=function(_0x106062,_0x444317){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x106062[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x444317,null))[_0xf5f2('0x18')](removeEntity(_0x444317,null))['catch'](handleError(_0x444317,null));};exports[_0xf5f2('0x3f')]=function(_0xc04f44,_0x218def){return db[_0xf5f2('0x21')][_0xf5f2('0x3f')]()[_0xf5f2('0x18')](respondWithResult(_0x218def,null))['catch'](handleError(_0x218def,null));};exports[_0xf5f2('0x40')]=function(_0x2e7193,_0x1c1497){var _0x29b108={'raw':!![],'where':{}},_0x12124d={},_0x10753a;return db[_0xf5f2('0x21')][_0xf5f2('0x41')]({'where':{'id':_0x2e7193['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x1c1497,null))[_0xf5f2('0x18')](function(_0x45db9a){if(_0x45db9a){_0x10753a=_0x45db9a['get']({'plain':!![]});_0x12124d[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x42')]['rawAttributes']);_0x12124d['query']=_[_0xf5f2('0x2d')](_0x2e7193[_0xf5f2('0x2e')]);_0x12124d['filters']=_[_0xf5f2('0x30')](_0x12124d['model'],_0x12124d[_0xf5f2('0x2e')]);_0x29b108['attributes']=_[_0xf5f2('0x30')](_0x12124d['model'],qs[_0xf5f2('0x32')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x29b108[_0xf5f2('0x31')]=_0x29b108['attributes'][_0xf5f2('0x43')]?_0x29b108[_0xf5f2('0x31')]:_0x12124d['model'];if(!_0x2e7193['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x29b108['limit']=qs[_0xf5f2('0x13')](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x29b108[_0xf5f2('0x11')]=qs['offset'](_0x2e7193['query'][_0xf5f2('0x11')]);}_0x29b108[_0xf5f2('0x46')]=qs['sort'](_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x29b108[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2e7193[_0xf5f2('0x2e')],_0x12124d[_0xf5f2('0x2f')]));_0x29b108['where']['SmsQueueId']=_0x45db9a['id'];if(_0x2e7193[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x29b108[_0xf5f2('0x26')]=_[_0xf5f2('0x4a')](_0x29b108[_0xf5f2('0x26')],{'$or':_['map'](_0x29b108[_0xf5f2('0x31')],function(_0x20ba91){var _0x18b124={};_0x18b124[_0x20ba91]={'$like':'%'+_0x2e7193['query'][_0xf5f2('0x49')]+'%'};return _0x18b124;})});}_0x29b108=_['merge']({},_0x29b108,_0x2e7193[_0xf5f2('0x34')]);return db[_0xf5f2('0x42')][_0xf5f2('0x28')](_0x29b108);}})[_0xf5f2('0x18')](function(_0x4afa4d){if(_0x4afa4d){return db['User'][_0xf5f2('0x4b')]({'where':{'id':_['map'](_0x4afa4d,_0xf5f2('0x4c')),'role':_0xf5f2('0x4d')},'attributes':['id','name',_0xf5f2('0x4e'),_0xf5f2('0x4f'),_0xf5f2('0x50')]});}})['then'](function(_0x397b99){if(_0x397b99){return{'count':_0x397b99[_0xf5f2('0x14')],'rows':_[_0xf5f2('0x20')](_0x397b99[_0xf5f2('0x29')],function(_0x51fa7e){return{'membername':_0x51fa7e[_0xf5f2('0x1f')],'UserId':_0x51fa7e['id'],'queue_name':_0x10753a['name'],'SmsQueueId':_0x10753a['id'],'interface':util[_0xf5f2('0x51')](_0xf5f2('0x52'),_0xf5f2('0x53'),_0x51fa7e[_0xf5f2('0x1f')]),'penalty':0x0,'paused':_0x51fa7e[_0xf5f2('0x4e')],'createdAt':_0x51fa7e['createdAt'],'updatedAt':_0x51fa7e[_0xf5f2('0x4f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf5f2('0x18')](respondWithFilteredResult(_0x1c1497,_0x29b108))[_0xf5f2('0x3d')](handleError(_0x1c1497,null));};exports[_0xf5f2('0x54')]=function(_0x2c5733,_0x5359b5){var _0x31e16b={};var _0x5ee6bc={};var _0x4c96ee;var _0xd4f6ef;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x2c5733[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5359b5,null))[_0xf5f2('0x18')](function(_0x5767fc){if(_0x5767fc){_0x4c96ee=_0x5767fc;_0x5ee6bc[_0xf5f2('0x2c')]=_[_0xf5f2('0x2d')](db[_0xf5f2('0x55')][_0xf5f2('0x22')]);_0x5ee6bc[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x2c5733[_0xf5f2('0x2e')]);_0x5ee6bc['filters']=_[_0xf5f2('0x30')](_0x5ee6bc[_0xf5f2('0x2c')],_0x5ee6bc[_0xf5f2('0x2e')]);_0x31e16b[_0xf5f2('0x31')]=_['intersection'](_0x5ee6bc[_0xf5f2('0x2c')],qs['fields'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x31e16b['attributes']=_0x31e16b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x31e16b[_0xf5f2('0x31')]:_0x5ee6bc[_0xf5f2('0x2c')];_0x31e16b[_0xf5f2('0x46')]=qs['sort'](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x31e16b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_[_0xf5f2('0x48')](_0x2c5733[_0xf5f2('0x2e')],_0x5ee6bc['filters']));if(_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x31e16b['where']=_[_0xf5f2('0x4a')](_0x31e16b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x31e16b['attributes'],function(_0x551cc9){var _0x4f3df6={};_0x4f3df6[_0x551cc9]={'$like':'%'+_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x49')]+'%'};return _0x4f3df6;})});}_0x31e16b=_[_0xf5f2('0x4a')]({},_0x31e16b,_0x2c5733[_0xf5f2('0x34')]);return _0x4c96ee[_0xf5f2('0x54')](_0x31e16b);}})['then'](function(_0x278b76){if(_0x278b76){_0xd4f6ef=_0x278b76[_0xf5f2('0x43')];if(!_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x31e16b[_0xf5f2('0x13')]=qs[_0xf5f2('0x13')](_0x2c5733[_0xf5f2('0x2e')][_0xf5f2('0x13')]);_0x31e16b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x2c5733['query']['offset']);}return _0x4c96ee['getTeams'](_0x31e16b);}})[_0xf5f2('0x18')](function(_0xafba8e){if(_0xafba8e){return _0xafba8e?{'count':_0xd4f6ef,'rows':_0xafba8e}:null;}})[_0xf5f2('0x18')](respondWithResult(_0x5359b5,null))[_0xf5f2('0x3d')](handleError(_0x5359b5,null));};exports[_0xf5f2('0x56')]=function(_0x5c6959,_0x9d943f){var _0x43c732=_0x5c6959[_0xf5f2('0x37')][_0xf5f2('0x57')];return db[_0xf5f2('0x55')]['findAll']({'where':{'id':_0x43c732},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':_0xf5f2('0x59'),'attributes':['id','name',_0xf5f2('0x5a'),_0xf5f2('0x5b'),_0xf5f2('0x5c')],'raw':!![]}]})[_0xf5f2('0x18')](function(_0x588434){if(_0x588434){var _0x40b36e=_[_0xf5f2('0x5d')](_0x588434,function(_0x19602d){var _0x2adeb4=_0x19602d[_0xf5f2('0x1a')]({'plain':!![]});return _0x2adeb4['Agents'];});return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x5c6959[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0xe3ea1e){return db['sequelize']['transaction'](function(_0x16048e){return _0xe3ea1e['addTeams'](_0x43c732,{'transaction':_0x16048e})['then'](function(){return BPromise['each'](_0x40b36e,function(_0x57cb18){return db[_0xf5f2('0x42')][_0xf5f2('0x5e')]({'where':{'UserId':_0x57cb18['id'],'SmsQueueId':_0x5c6959[_0xf5f2('0x2b')]['id']},'transaction':_0x16048e});});})[_0xf5f2('0x18')](function(){_0x40b36e[_0xf5f2('0x5f')](function(_0x9f941e){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':_0x9f941e['id'],'SmsQueueId':_0xe3ea1e['id']});});});});});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x9d943f,null))[_0xf5f2('0x3d')](handleError(_0x9d943f,null));};exports[_0xf5f2('0x62')]=function(_0x2afeac,_0x1ba503){return db[_0xf5f2('0x55')][_0xf5f2('0x28')]({'where':{'id':_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')]},'attributes':['id'],'include':[{'model':db[_0xf5f2('0x58')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xf5f2('0x18')](handleEntityNotFound(_0x1ba503,null))[_0xf5f2('0x18')](function(_0x21043b){var _0x2811ad=_[_0xf5f2('0x20')](_0x21043b,'id');var _0x308220=[];var _0x16491c=[];var _0xcf48eb=squel['select']();_0xcf48eb[_0xf5f2('0x63')]('tq.TeamId')['from']('team_has_sms_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xf5f2('0x26')](_0xf5f2('0x64'),_0x2afeac[_0xf5f2('0x2b')]['id']);for(var _0x375bc9=0x0;_0x375bc9<_0x21043b[_0xf5f2('0x43')];_0x375bc9+=0x1){let _0x3cf857=_0x21043b[_0x375bc9];for(var _0x5dc63f=0x0;_0x5dc63f<_0x3cf857['Agents'][_0xf5f2('0x43')];_0x5dc63f+=0x1){let _0x578a22=_0x3cf857[_0xf5f2('0x59')][_0x5dc63f];var _0x186fdd=_0xcf48eb['clone']();_0x186fdd['where'](_0xf5f2('0x65'),_0x578a22['id']);_0x16491c[_0xf5f2('0x66')](db['sequelize'][_0xf5f2('0x2e')](_0x186fdd[_0xf5f2('0x67')](),{'type':db['sequelize'][_0xf5f2('0x68')][_0xf5f2('0x69')]})[_0xf5f2('0x18')](function(_0x4c1678){if(_0x4c1678[_0xf5f2('0x43')]===0x1){return _0x578a22['id'];}else{var _0xc28adc=_[_0xf5f2('0x6a')](_[_0xf5f2('0x20')](_0x4c1678,_0xf5f2('0x6b')),function(_0x3e0288){return _[_0xf5f2('0x6c')](_0x2811ad,_0x3e0288);});if(_0xc28adc){return _0x578a22['id'];}}}));}}return BPromise[_0xf5f2('0x6d')](_0x16491c)[_0xf5f2('0x18')](function(_0x3a6f60){_0x308220=_(_0x308220)[_0xf5f2('0x6e')](_0x3a6f60)[_0xf5f2('0x6f')]()[_0xf5f2('0x70')]();return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2afeac[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](function(_0x29a9d4){return db[_0xf5f2('0x71')][_0xf5f2('0x72')](function(_0x800f42){return _0x29a9d4['removeTeams'](_0x2afeac[_0xf5f2('0x2e')][_0xf5f2('0x57')],{'transaction':_0x800f42})['then'](function(){if(!_[_0xf5f2('0x73')](_0x308220)){return _0x29a9d4[_0xf5f2('0x74')](_0x308220,{'transaction':_0x800f42});}})['then'](function(){_0x308220[_0xf5f2('0x5f')](function(_0x2f54eb){socket[_0xf5f2('0x60')]('userSmsQueue:remove',{'UserId':_0x2f54eb,'SmsQueueId':_0x29a9d4['id']});});});});});});})['then'](respondWithStatusCode(_0x1ba503,null))[_0xf5f2('0x3d')](handleError(_0x1ba503,null));};exports[_0xf5f2('0x75')]=function(_0x213ade,_0x5ba275){return db['SmsQueue'][_0xf5f2('0x35')]({'where':{'id':_0x213ade[_0xf5f2('0x2b')]['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5ba275,null))['then'](function(_0x4cde64){if(_0x4cde64){return _0x4cde64['addAgents'](_0x213ade['body']['ids'],_[_0xf5f2('0x76')](_0x213ade['body'],[_0xf5f2('0x57'),'id'])||{})[_0xf5f2('0x77')](function(_0xec3c35){for(var _0x43a167=0x0;_0x43a167<_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0xf5f2('0x43')];_0x43a167+=0x1){socket[_0xf5f2('0x60')](_0xf5f2('0x61'),{'UserId':Number(_0x213ade[_0xf5f2('0x37')][_0xf5f2('0x57')][_0x43a167]),'SmsQueueId':Number(_0x213ade[_0xf5f2('0x2b')]['id'])});}return _0xec3c35;});}})[_0xf5f2('0x18')](respondWithResult(_0x5ba275,null))['catch'](handleError(_0x5ba275,null));};exports[_0xf5f2('0x74')]=function(_0x2a4fed,_0x5783e2){return db[_0xf5f2('0x21')][_0xf5f2('0x35')]({'where':{'id':_0x2a4fed['params']['id']}})[_0xf5f2('0x18')](handleEntityNotFound(_0x5783e2,null))[_0xf5f2('0x18')](function(_0x281f61){if(_0x281f61){return _0x281f61['removeAgents'](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])['then'](function(){if(_[_0xf5f2('0x78')](_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')])){for(var _0x517aa8=0x0;_0x517aa8<_0x2a4fed[_0xf5f2('0x2e')]['ids'][_0xf5f2('0x43')];_0x517aa8+=0x1){socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed[_0xf5f2('0x2e')][_0xf5f2('0x57')][_0x517aa8]),'SmsQueueId':Number(_0x2a4fed[_0xf5f2('0x2b')]['id'])});}}else{socket['emit'](_0xf5f2('0x79'),{'UserId':Number(_0x2a4fed['query']['ids']),'SmsQueueId':Number(_0x2a4fed['params']['id'])});}});}})[_0xf5f2('0x18')](respondWithStatusCode(_0x5783e2,null))[_0xf5f2('0x3d')](handleError(_0x5783e2,null));};exports['getAgents']=function(_0x3c8a1b,_0x15025d){var _0x35790b={};var _0x3962b2={};var _0x28873e;var _0x1fc5ae;return db['SmsQueue'][_0xf5f2('0x41')]({'where':{'id':_0x3c8a1b[_0xf5f2('0x2b')]['id']}})['then'](handleEntityNotFound(_0x15025d,null))[_0xf5f2('0x18')](function(_0x19cbff){if(_0x19cbff){_0x28873e=_0x19cbff;_0x3962b2['model']=_[_0xf5f2('0x2d')](db[_0xf5f2('0x58')][_0xf5f2('0x22')]);_0x3962b2[_0xf5f2('0x2e')]=_[_0xf5f2('0x2d')](_0x3c8a1b[_0xf5f2('0x2e')]);_0x3962b2['filters']=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],_0x3962b2[_0xf5f2('0x2e')]);_0x35790b[_0xf5f2('0x31')]=_[_0xf5f2('0x30')](_0x3962b2[_0xf5f2('0x2c')],qs[_0xf5f2('0x32')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x32')]));_0x35790b['attributes']=_0x35790b[_0xf5f2('0x31')][_0xf5f2('0x43')]?_0x35790b[_0xf5f2('0x31')]:_0x3962b2[_0xf5f2('0x2c')];_0x35790b[_0xf5f2('0x46')]=qs[_0xf5f2('0x47')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x47')]);_0x35790b[_0xf5f2('0x26')]=qs[_0xf5f2('0x2f')](_['pick'](_0x3c8a1b['query'],_0x3962b2[_0xf5f2('0x2f')]));if(_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x49')]){_0x35790b[_0xf5f2('0x26')]=_['merge'](_0x35790b[_0xf5f2('0x26')],{'$or':_[_0xf5f2('0x20')](_0x35790b[_0xf5f2('0x31')],function(_0x3d7f53){var _0x456a1e={};_0x456a1e[_0x3d7f53]={'$like':'%'+_0x3c8a1b['query'][_0xf5f2('0x49')]+'%'};return _0x456a1e;})});}_0x35790b=_[_0xf5f2('0x4a')]({},_0x35790b,_0x3c8a1b['options']);return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})[_0xf5f2('0x18')](function(_0x2563fa){if(_0x2563fa){_0x1fc5ae=_0x2563fa[_0xf5f2('0x43')];if(!_0x3c8a1b['query'][_0xf5f2('0x44')](_0xf5f2('0x45'))){_0x35790b[_0xf5f2('0x13')]=qs['limit'](_0x3c8a1b['query'][_0xf5f2('0x13')]);_0x35790b[_0xf5f2('0x11')]=qs[_0xf5f2('0x11')](_0x3c8a1b[_0xf5f2('0x2e')][_0xf5f2('0x11')]);}return _0x28873e[_0xf5f2('0x7a')](_0x35790b);}})['then'](function(_0x39dee8){if(_0x39dee8){return _0x39dee8?{'count':_0x1fc5ae,'rows':_0x39dee8}:null;}})['then'](respondWithResult(_0x15025d,null))[_0xf5f2('0x3d')](handleError(_0x15025d,null));}; \ No newline at end of file +var _0xadb5=['%s/%s','pick','filter','getTeams','addTeams','ids','findAll','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','forEach','userSmsQueue:save','removeTeams','Team','field','tq.TeamId','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','find','isEmpty','removeAgents','emit','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','util','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','update','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','index','SmsQueue','rawAttributes','type','key','getOptions','where','count','include','query','rows','catch','show','model','keys','filters','fields','attributes','length','includeAll','options','create','user','get','role','autoAssociation','body','params','describe','getMembers','findOne','intersection','hasOwnProperty','nolimit','order','sort','SmsQueueId','merge','UserSmsQueue','User','findAndCountAll','map','UserId','agent','smsPause','updatedAt','createdAt','format'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xadb5,0xad));var _0x5adb=function(_0x11a62f,_0x152168){_0x11a62f=_0x11a62f-0x0;var _0x2c86e2=_0xadb5[_0x11a62f];return _0x2c86e2;};'use strict';var BPromise=require('bluebird');var util=require(_0x5adb('0x0'));var _=require('lodash');var squel=require(_0x5adb('0x1'));var Redis=require(_0x5adb('0x2'));var qs=require(_0x5adb('0x3'));var logger=require('../../config/logger')(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var db=require(_0x5adb('0x6'))['db'];config['redis']=_[_0x5adb('0x7')](config[_0x5adb('0x8')],{'host':_0x5adb('0x9'),'port':0x18eb});var socket=require(_0x5adb('0xa'))(new Redis(config[_0x5adb('0x8')]));require(_0x5adb('0xb'))[_0x5adb('0xc')](socket);function respondWithStatusCode(_0x6d1b45,_0x41261c){_0x41261c=_0x41261c||0xcc;return function(_0x7293ab){if(_0x7293ab){return _0x6d1b45[_0x5adb('0xd')](_0x41261c);}return _0x6d1b45[_0x5adb('0xe')](_0x41261c)[_0x5adb('0xf')]();};}function respondWithResult(_0x275428,_0x563d86){_0x563d86=_0x563d86||0xc8;return function(_0x4c268d){if(_0x4c268d){return _0x275428[_0x5adb('0xe')](_0x563d86)[_0x5adb('0x10')](_0x4c268d);}};}function respondWithFilteredResult(_0x82e67e,_0x53b772){return function(_0x29f0d5){if(_0x29f0d5){var _0x56012f=typeof _0x53b772[_0x5adb('0x11')]==='undefined'&&typeof _0x53b772[_0x5adb('0x12')]===_0x5adb('0x13');var _0x44abe3=_0x29f0d5['count'];var _0x2a545b=_0x56012f?0x0:_0x53b772[_0x5adb('0x11')];var _0xf82f72=_0x56012f?_0x29f0d5['count']:_0x53b772[_0x5adb('0x11')]+_0x53b772['limit'];var _0x367d82;if(_0xf82f72>=_0x44abe3){_0xf82f72=_0x44abe3;_0x367d82=0xc8;}else{_0x367d82=0xce;}_0x82e67e[_0x5adb('0xe')](_0x367d82);return _0x82e67e[_0x5adb('0x14')](_0x5adb('0x15'),_0x2a545b+'-'+_0xf82f72+'/'+_0x44abe3)[_0x5adb('0x10')](_0x29f0d5);}return null;};}function saveUpdates(_0x39d24d){return function(_0xa29dc){if(_0xa29dc){return _0xa29dc[_0x5adb('0x16')](_0x39d24d)[_0x5adb('0x17')](function(_0x529b65){return _0x529b65;});}return null;};}function removeEntity(_0x3fff62){return function(_0x5de028){if(_0x5de028){return _0x5de028[_0x5adb('0x18')]()['then'](function(){var _0x3ef465=_0x5de028['get']({'plain':!![]});var _0x5e218c=_0x5adb('0x19');return db[_0x5adb('0x1a')][_0x5adb('0x18')]({'where':{'type':_0x5e218c,'resourceId':_0x3ef465['id']}})[_0x5adb('0x17')](function(){return _0x5de028;});})[_0x5adb('0x17')](function(){_0x3fff62['status'](0xcc)[_0x5adb('0xf')]();});}};}function handleEntityNotFound(_0x5c296e){return function(_0x4e9f16){if(!_0x4e9f16){_0x5c296e[_0x5adb('0xd')](0x194);}return _0x4e9f16;};}function handleError(_0x379b33,_0x1a38d3){_0x1a38d3=_0x1a38d3||0x1f4;return function(_0x1a8014){logger[_0x5adb('0x1b')](_0x1a8014[_0x5adb('0x1c')]);if(_0x1a8014[_0x5adb('0x1d')]){delete _0x1a8014['name'];}_0x379b33[_0x5adb('0xe')](_0x1a38d3)[_0x5adb('0x1e')](_0x1a8014);};}exports[_0x5adb('0x1f')]=function(_0x3839fb,_0xeb556c){var _0x49f203={};var _0x2fee18={'count':0x0,'rows':[]};var _0x2e1e63=_['map'](db[_0x5adb('0x20')][_0x5adb('0x21')],function(_0x1a0acd){return{'name':_0x1a0acd['fieldName'],'type':_0x1a0acd[_0x5adb('0x22')][_0x5adb('0x23')]};});_0x49f203=qs[_0x5adb('0x24')](_0x2e1e63,_0x3839fb);var _0x2c64a3={'where':_0x49f203[_0x5adb('0x25')]};return db[_0x5adb('0x20')]['count'](_0x2c64a3)['then'](function(_0x5d457e){_0x2fee18[_0x5adb('0x26')]=_0x5d457e;_0x49f203[_0x5adb('0x27')]=qs[_0x5adb('0x27')](_0x3839fb[_0x5adb('0x28')]);return db[_0x5adb('0x20')]['findAll'](_0x49f203);})[_0x5adb('0x17')](function(_0x34b793){_0x2fee18[_0x5adb('0x29')]=_0x34b793;return _0x2fee18;})[_0x5adb('0x17')](respondWithFilteredResult(_0xeb556c,_0x49f203))[_0x5adb('0x2a')](handleError(_0xeb556c,null));};exports[_0x5adb('0x2b')]=function(_0x28190d,_0x28bf1f){var _0x138bf6={'raw':!![],'where':{'id':_0x28190d['params']['id']}},_0x260295={};_0x260295[_0x5adb('0x2c')]=_['keys'](db[_0x5adb('0x20')][_0x5adb('0x21')]);_0x260295['query']=_[_0x5adb('0x2d')](_0x28190d[_0x5adb('0x28')]);_0x260295[_0x5adb('0x2e')]=_['intersection'](_0x260295[_0x5adb('0x2c')],_0x260295[_0x5adb('0x28')]);_0x138bf6['attributes']=_['intersection'](_0x260295[_0x5adb('0x2c')],qs['fields'](_0x28190d[_0x5adb('0x28')][_0x5adb('0x2f')]));_0x138bf6[_0x5adb('0x30')]=_0x138bf6[_0x5adb('0x30')][_0x5adb('0x31')]?_0x138bf6['attributes']:_0x260295[_0x5adb('0x2c')];if(_0x28190d[_0x5adb('0x28')][_0x5adb('0x32')]){_0x138bf6['include']=[{'all':!![]}];}_0x138bf6=_['merge']({},_0x138bf6,_0x28190d[_0x5adb('0x33')]);return db[_0x5adb('0x20')]['find'](_0x138bf6)[_0x5adb('0x17')](handleEntityNotFound(_0x28bf1f,null))['then'](respondWithResult(_0x28bf1f,null))[_0x5adb('0x2a')](handleError(_0x28bf1f,null));};exports['create']=function(_0x11cb37,_0x4d052f){return db[_0x5adb('0x20')][_0x5adb('0x34')](_0x11cb37['body'],{})[_0x5adb('0x17')](function(_0x5a6a79){var _0xadbe37=_0x11cb37[_0x5adb('0x35')][_0x5adb('0x36')]({'plain':!![]});if(!_0xadbe37)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xadbe37[_0x5adb('0x37')]===_0x5adb('0x35')){var _0xcdaf8e=_0x5a6a79[_0x5adb('0x36')]({'plain':!![]});var _0x22aa95='SmsQueues';return db['UserProfileSection']['find']({'where':{'name':_0x22aa95,'userProfileId':_0xadbe37['userProfileId']},'raw':!![]})[_0x5adb('0x17')](function(_0x2fbe14){if(_0x2fbe14&&_0x2fbe14[_0x5adb('0x38')]===0x0){return db[_0x5adb('0x1a')][_0x5adb('0x34')]({'name':_0xcdaf8e[_0x5adb('0x1d')],'resourceId':_0xcdaf8e['id'],'type':_0x2fbe14[_0x5adb('0x1d')],'sectionId':_0x2fbe14['id']},{})[_0x5adb('0x17')](function(){return _0x5a6a79;});}else{return _0x5a6a79;}})['catch'](function(_0x53f2c6){logger[_0x5adb('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53f2c6);throw _0x53f2c6;});}return _0x5a6a79;})[_0x5adb('0x17')](respondWithResult(_0x4d052f,0xc9))[_0x5adb('0x2a')](handleError(_0x4d052f,null));};exports[_0x5adb('0x16')]=function(_0x121714,_0xdfecfd){if(_0x121714['body']['id']){delete _0x121714[_0x5adb('0x39')]['id'];}return db[_0x5adb('0x20')]['find']({'where':{'id':_0x121714[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0xdfecfd,null))['then'](saveUpdates(_0x121714[_0x5adb('0x39')],null))[_0x5adb('0x17')](respondWithResult(_0xdfecfd,null))[_0x5adb('0x2a')](handleError(_0xdfecfd,null));};exports[_0x5adb('0x18')]=function(_0xea3307,_0x4362ec){return db[_0x5adb('0x20')]['find']({'where':{'id':_0xea3307['params']['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x4362ec,null))[_0x5adb('0x17')](removeEntity(_0x4362ec,null))[_0x5adb('0x2a')](handleError(_0x4362ec,null));};exports[_0x5adb('0x3b')]=function(_0x57b8af,_0x507e48){return db[_0x5adb('0x20')][_0x5adb('0x3b')]()[_0x5adb('0x17')](respondWithResult(_0x507e48,null))[_0x5adb('0x2a')](handleError(_0x507e48,null));};exports[_0x5adb('0x3c')]=function(_0x5358c0,_0x182cbc){var _0x437f52={'raw':!![],'where':{}},_0x5b574c={},_0x7786c4;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0x5358c0[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x182cbc,null))[_0x5adb('0x17')](function(_0x39840e){if(_0x39840e){_0x7786c4=_0x39840e[_0x5adb('0x36')]({'plain':!![]});_0x5b574c['model']=_[_0x5adb('0x2d')](db['UserSmsQueue']['rawAttributes']);_0x5b574c['query']=_[_0x5adb('0x2d')](_0x5358c0[_0x5adb('0x28')]);_0x5b574c[_0x5adb('0x2e')]=_['intersection'](_0x5b574c[_0x5adb('0x2c')],_0x5b574c['query']);_0x437f52[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x5b574c[_0x5adb('0x2c')],qs['fields'](_0x5358c0[_0x5adb('0x28')]['fields']));_0x437f52[_0x5adb('0x30')]=_0x437f52[_0x5adb('0x30')]['length']?_0x437f52[_0x5adb('0x30')]:_0x5b574c[_0x5adb('0x2c')];if(!_0x5358c0[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x437f52['limit']=qs[_0x5adb('0x12')](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x12')]);_0x437f52[_0x5adb('0x11')]=qs['offset'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x11')]);}_0x437f52[_0x5adb('0x41')]=qs['sort'](_0x5358c0[_0x5adb('0x28')][_0x5adb('0x42')]);_0x437f52[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_['pick'](_0x5358c0[_0x5adb('0x28')],_0x5b574c[_0x5adb('0x2e')]));_0x437f52[_0x5adb('0x25')][_0x5adb('0x43')]=_0x39840e['id'];if(_0x5358c0[_0x5adb('0x28')]['filter']){_0x437f52[_0x5adb('0x25')]=_['merge'](_0x437f52[_0x5adb('0x25')],{'$or':_['map'](_0x437f52[_0x5adb('0x30')],function(_0x35df22){var _0x1a9358={};_0x1a9358[_0x35df22]={'$like':'%'+_0x5358c0[_0x5adb('0x28')]['filter']+'%'};return _0x1a9358;})});}_0x437f52=_[_0x5adb('0x44')]({},_0x437f52,_0x5358c0[_0x5adb('0x33')]);return db[_0x5adb('0x45')]['findAll'](_0x437f52);}})['then'](function(_0x4ddfdf){if(_0x4ddfdf){return db[_0x5adb('0x46')][_0x5adb('0x47')]({'where':{'id':_[_0x5adb('0x48')](_0x4ddfdf,_0x5adb('0x49')),'role':_0x5adb('0x4a')},'attributes':['id',_0x5adb('0x1d'),_0x5adb('0x4b'),_0x5adb('0x4c'),_0x5adb('0x4d')]});}})[_0x5adb('0x17')](function(_0x452767){if(_0x452767){return{'count':_0x452767[_0x5adb('0x26')],'rows':_[_0x5adb('0x48')](_0x452767['rows'],function(_0x49f4c8){return{'membername':_0x49f4c8[_0x5adb('0x1d')],'UserId':_0x49f4c8['id'],'queue_name':_0x7786c4[_0x5adb('0x1d')],'SmsQueueId':_0x7786c4['id'],'interface':util[_0x5adb('0x4e')](_0x5adb('0x4f'),'SIP',_0x49f4c8[_0x5adb('0x1d')]),'penalty':0x0,'paused':_0x49f4c8[_0x5adb('0x4b')],'createdAt':_0x49f4c8['createdAt'],'updatedAt':_0x49f4c8[_0x5adb('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5adb('0x17')](respondWithFilteredResult(_0x182cbc,_0x437f52))[_0x5adb('0x2a')](handleError(_0x182cbc,null));};exports['getTeams']=function(_0x30d185,_0x409357){var _0x19df2f={};var _0x30c92c={};var _0x330290;var _0x428019;return db['SmsQueue'][_0x5adb('0x3d')]({'where':{'id':_0x30d185[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x409357,null))['then'](function(_0xcd71d2){if(_0xcd71d2){_0x330290=_0xcd71d2;_0x30c92c[_0x5adb('0x2c')]=_[_0x5adb('0x2d')](db['Team'][_0x5adb('0x21')]);_0x30c92c['query']=_[_0x5adb('0x2d')](_0x30d185[_0x5adb('0x28')]);_0x30c92c[_0x5adb('0x2e')]=_['intersection'](_0x30c92c[_0x5adb('0x2c')],_0x30c92c[_0x5adb('0x28')]);_0x19df2f['attributes']=_[_0x5adb('0x3e')](_0x30c92c[_0x5adb('0x2c')],qs[_0x5adb('0x2f')](_0x30d185[_0x5adb('0x28')]['fields']));_0x19df2f[_0x5adb('0x30')]=_0x19df2f[_0x5adb('0x30')][_0x5adb('0x31')]?_0x19df2f[_0x5adb('0x30')]:_0x30c92c['model'];_0x19df2f['order']=qs[_0x5adb('0x42')](_0x30d185['query']['sort']);_0x19df2f['where']=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0x30d185['query'],_0x30c92c[_0x5adb('0x2e')]));if(_0x30d185[_0x5adb('0x28')][_0x5adb('0x51')]){_0x19df2f[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x19df2f[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x19df2f[_0x5adb('0x30')],function(_0x5240c1){var _0x4b9e80={};_0x4b9e80[_0x5240c1]={'$like':'%'+_0x30d185['query'][_0x5adb('0x51')]+'%'};return _0x4b9e80;})});}_0x19df2f=_[_0x5adb('0x44')]({},_0x19df2f,_0x30d185[_0x5adb('0x33')]);return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x2f6ef7){if(_0x2f6ef7){_0x428019=_0x2f6ef7[_0x5adb('0x31')];if(!_0x30d185[_0x5adb('0x28')]['hasOwnProperty']('nolimit')){_0x19df2f[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x12')]);_0x19df2f[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0x30d185[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x330290[_0x5adb('0x52')](_0x19df2f);}})[_0x5adb('0x17')](function(_0x484f3d){if(_0x484f3d){return _0x484f3d?{'count':_0x428019,'rows':_0x484f3d}:null;}})[_0x5adb('0x17')](respondWithResult(_0x409357,null))[_0x5adb('0x2a')](handleError(_0x409357,null));};exports[_0x5adb('0x53')]=function(_0x5d3aa4,_0x31f041){var _0xa1bd33=_0x5d3aa4['body'][_0x5adb('0x54')];return db['Team'][_0x5adb('0x55')]({'where':{'id':_0xa1bd33},'attributes':['id'],'include':[{'model':db[_0x5adb('0x46')],'as':'Agents','attributes':['id',_0x5adb('0x1d'),_0x5adb('0x56'),_0x5adb('0x57'),_0x5adb('0x58')],'raw':!![]}]})[_0x5adb('0x17')](function(_0x10f54a){if(_0x10f54a){var _0x3cee6c=_[_0x5adb('0x59')](_0x10f54a,function(_0x49a8a6){var _0x3786b4=_0x49a8a6[_0x5adb('0x36')]({'plain':!![]});return _0x3786b4[_0x5adb('0x5a')];});return db['SmsQueue']['find']({'where':{'id':_0x5d3aa4[_0x5adb('0x3a')]['id']}})['then'](function(_0x27d3d8){return db[_0x5adb('0x5b')][_0x5adb('0x5c')](function(_0x50600f){return _0x27d3d8[_0x5adb('0x53')](_0xa1bd33,{'transaction':_0x50600f})[_0x5adb('0x17')](function(){return BPromise[_0x5adb('0x5d')](_0x3cee6c,function(_0x3ecc56){return db[_0x5adb('0x45')]['findOrCreate']({'where':{'UserId':_0x3ecc56['id'],'SmsQueueId':_0x5d3aa4[_0x5adb('0x3a')]['id']},'transaction':_0x50600f});});})[_0x5adb('0x17')](function(){_0x3cee6c[_0x5adb('0x5e')](function(_0xe3d12d){socket['emit'](_0x5adb('0x5f'),{'UserId':_0xe3d12d['id'],'SmsQueueId':_0x27d3d8['id']});});});});});}})[_0x5adb('0x17')](respondWithStatusCode(_0x31f041,null))[_0x5adb('0x2a')](handleError(_0x31f041,null));};exports[_0x5adb('0x60')]=function(_0x15d4f1,_0x20faf6){return db[_0x5adb('0x61')]['findAll']({'where':{'id':_0x15d4f1[_0x5adb('0x28')][_0x5adb('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5adb('0x5a'),'attributes':['id'],'raw':!![]}]})[_0x5adb('0x17')](handleEntityNotFound(_0x20faf6,null))['then'](function(_0x462fa0){var _0x50f8ed=_[_0x5adb('0x48')](_0x462fa0,'id');var _0x268df2=[];var _0x4a2ebc=[];var _0x167432=squel['select']();_0x167432[_0x5adb('0x62')](_0x5adb('0x63'))[_0x5adb('0x64')](_0x5adb('0x65'),'tq')[_0x5adb('0x66')]('user_has_teams','ut',_0x5adb('0x67'))[_0x5adb('0x25')](_0x5adb('0x68'),_0x15d4f1[_0x5adb('0x3a')]['id']);for(var _0x47c631=0x0;_0x47c631<_0x462fa0['length'];_0x47c631+=0x1){let _0x3f3db9=_0x462fa0[_0x47c631];for(var _0x461a07=0x0;_0x461a07<_0x3f3db9[_0x5adb('0x5a')][_0x5adb('0x31')];_0x461a07+=0x1){let _0x277668=_0x3f3db9[_0x5adb('0x5a')][_0x461a07];var _0x31f5b2=_0x167432['clone']();_0x31f5b2[_0x5adb('0x25')](_0x5adb('0x69'),_0x277668['id']);_0x4a2ebc[_0x5adb('0x6a')](db[_0x5adb('0x5b')]['query'](_0x31f5b2[_0x5adb('0x6b')](),{'type':db[_0x5adb('0x5b')][_0x5adb('0x6c')][_0x5adb('0x6d')]})[_0x5adb('0x17')](function(_0x188cbd){if(_0x188cbd[_0x5adb('0x31')]===0x1){return _0x277668['id'];}else{var _0x2d1b65=_[_0x5adb('0x6e')](_['map'](_0x188cbd,_0x5adb('0x6f')),function(_0x456799){return _['includes'](_0x50f8ed,_0x456799);});if(_0x2d1b65){return _0x277668['id'];}}}));}}return BPromise[_0x5adb('0x70')](_0x4a2ebc)[_0x5adb('0x17')](function(_0x2b8915){_0x268df2=_(_0x268df2)[_0x5adb('0x71')](_0x2b8915)[_0x5adb('0x72')]()[_0x5adb('0x73')]();return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x15d4f1['params']['id']}})[_0x5adb('0x17')](function(_0x2386c0){return db['sequelize'][_0x5adb('0x5c')](function(_0x58a26f){return _0x2386c0[_0x5adb('0x60')](_0x15d4f1['query']['ids'],{'transaction':_0x58a26f})[_0x5adb('0x17')](function(){if(!_[_0x5adb('0x75')](_0x268df2)){return _0x2386c0[_0x5adb('0x76')](_0x268df2,{'transaction':_0x58a26f});}})['then'](function(){_0x268df2[_0x5adb('0x5e')](function(_0x321c3a){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':_0x321c3a,'SmsQueueId':_0x2386c0['id']});});});});});});})[_0x5adb('0x17')](respondWithStatusCode(_0x20faf6,null))[_0x5adb('0x2a')](handleError(_0x20faf6,null));};exports[_0x5adb('0x79')]=function(_0x463e84,_0x28bd33){return db[_0x5adb('0x20')][_0x5adb('0x74')]({'where':{'id':_0x463e84[_0x5adb('0x3a')]['id']}})['then'](handleEntityNotFound(_0x28bd33,null))['then'](function(_0x312463){if(_0x312463){return _0x312463[_0x5adb('0x79')](_0x463e84['body'][_0x5adb('0x54')],_[_0x5adb('0x7a')](_0x463e84[_0x5adb('0x39')],[_0x5adb('0x54'),'id'])||{})[_0x5adb('0x7b')](function(_0x24cd3b){for(var _0x15626b=0x0;_0x15626b<_0x463e84[_0x5adb('0x39')][_0x5adb('0x54')]['length'];_0x15626b+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x5f'),{'UserId':Number(_0x463e84[_0x5adb('0x39')]['ids'][_0x15626b]),'SmsQueueId':Number(_0x463e84[_0x5adb('0x3a')]['id'])});}return _0x24cd3b;});}})[_0x5adb('0x17')](respondWithResult(_0x28bd33,null))[_0x5adb('0x2a')](handleError(_0x28bd33,null));};exports[_0x5adb('0x76')]=function(_0x64475f,_0x2a78f9){return db['SmsQueue'][_0x5adb('0x74')]({'where':{'id':_0x64475f[_0x5adb('0x3a')]['id']}})[_0x5adb('0x17')](handleEntityNotFound(_0x2a78f9,null))[_0x5adb('0x17')](function(_0x2c3af8){if(_0x2c3af8){return _0x2c3af8[_0x5adb('0x76')](_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')])[_0x5adb('0x17')](function(){if(_[_0x5adb('0x7c')](_0x64475f['query'][_0x5adb('0x54')])){for(var _0x5b9565=0x0;_0x5b9565<_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')][_0x5adb('0x31')];_0x5b9565+=0x1){socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f['query']['ids'][_0x5b9565]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}}else{socket[_0x5adb('0x77')](_0x5adb('0x78'),{'UserId':Number(_0x64475f[_0x5adb('0x28')][_0x5adb('0x54')]),'SmsQueueId':Number(_0x64475f[_0x5adb('0x3a')]['id'])});}});}})['then'](respondWithStatusCode(_0x2a78f9,null))['catch'](handleError(_0x2a78f9,null));};exports[_0x5adb('0x7d')]=function(_0xd5b95d,_0x9d80fd){var _0x4f5721={};var _0x542626={};var _0x227c17;var _0x5982a5;return db[_0x5adb('0x20')][_0x5adb('0x3d')]({'where':{'id':_0xd5b95d['params']['id']}})['then'](handleEntityNotFound(_0x9d80fd,null))[_0x5adb('0x17')](function(_0x4bb198){if(_0x4bb198){_0x227c17=_0x4bb198;_0x542626['model']=_[_0x5adb('0x2d')](db[_0x5adb('0x46')][_0x5adb('0x21')]);_0x542626[_0x5adb('0x28')]=_[_0x5adb('0x2d')](_0xd5b95d[_0x5adb('0x28')]);_0x542626[_0x5adb('0x2e')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],_0x542626[_0x5adb('0x28')]);_0x4f5721[_0x5adb('0x30')]=_[_0x5adb('0x3e')](_0x542626[_0x5adb('0x2c')],qs['fields'](_0xd5b95d[_0x5adb('0x28')]['fields']));_0x4f5721[_0x5adb('0x30')]=_0x4f5721[_0x5adb('0x30')][_0x5adb('0x31')]?_0x4f5721[_0x5adb('0x30')]:_0x542626[_0x5adb('0x2c')];_0x4f5721[_0x5adb('0x41')]=qs[_0x5adb('0x42')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x42')]);_0x4f5721[_0x5adb('0x25')]=qs[_0x5adb('0x2e')](_[_0x5adb('0x50')](_0xd5b95d['query'],_0x542626[_0x5adb('0x2e')]));if(_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]){_0x4f5721[_0x5adb('0x25')]=_[_0x5adb('0x44')](_0x4f5721[_0x5adb('0x25')],{'$or':_[_0x5adb('0x48')](_0x4f5721[_0x5adb('0x30')],function(_0x57c160){var _0xe7ddc4={};_0xe7ddc4[_0x57c160]={'$like':'%'+_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x51')]+'%'};return _0xe7ddc4;})});}_0x4f5721=_['merge']({},_0x4f5721,_0xd5b95d[_0x5adb('0x33')]);return _0x227c17['getAgents'](_0x4f5721);}})[_0x5adb('0x17')](function(_0x50c3a3){if(_0x50c3a3){_0x5982a5=_0x50c3a3['length'];if(!_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x3f')](_0x5adb('0x40'))){_0x4f5721[_0x5adb('0x12')]=qs[_0x5adb('0x12')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x12')]);_0x4f5721[_0x5adb('0x11')]=qs[_0x5adb('0x11')](_0xd5b95d[_0x5adb('0x28')][_0x5adb('0x11')]);}return _0x227c17[_0x5adb('0x7d')](_0x4f5721);}})['then'](function(_0x364da7){if(_0x364da7){return _0x364da7?{'count':_0x5982a5,'rows':_0x364da7}:null;}})['then'](respondWithResult(_0x9d80fd,null))[_0x5adb('0x2a')](handleError(_0x9d80fd,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 4e62c00..d56b336 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 _0x299a=['SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x3c7ae2,_0x5504e3){var _0x39f0d7=function(_0x54e317){while(--_0x54e317){_0x3c7ae2['push'](_0x3c7ae2['shift']());}};_0x39f0d7(++_0x5504e3);}(_0x299a,0x182));var _0xa299=function(_0x1d83fa,_0x4a5ca3){_0x1d83fa=_0x1d83fa-0x0;var _0x1cc828=_0x299a[_0x1d83fa];return _0x1cc828;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xa299('0x0'))['db'][_0xa299('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xa299('0x2')](0x0);var events={'afterCreate':_0xa299('0x3'),'afterUpdate':'update','afterDestroy':_0xa299('0x4')};function emitEvent(_0x198986){return function(_0x16aa7b,_0x123cd7,_0x38965e){SmsQueueEvents[_0xa299('0x5')](_0x198986+':'+_0x16aa7b['id'],_0x16aa7b);SmsQueueEvents[_0xa299('0x5')](_0x198986,_0x16aa7b);_0x38965e(null);};}for(var e in events){if(events[_0xa299('0x6')](e)){var event=events[e];SmsQueue[_0xa299('0x7')](e,emitEvent(event));}}module[_0xa299('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x621d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','SmsQueue'];(function(_0x29fe73,_0x35ff1b){var _0x500a23=function(_0x4dd14e){while(--_0x4dd14e){_0x29fe73['push'](_0x29fe73['shift']());}};_0x500a23(++_0x35ff1b);}(_0x621d,0x10c));var _0xd621=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0x621d[_0x54d4fe];return _0x1ab5bb;};'use strict';var EventEmitter=require(_0xd621('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xd621('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd621('0x2')](0x0);var events={'afterCreate':_0xd621('0x3'),'afterUpdate':_0xd621('0x4'),'afterDestroy':_0xd621('0x5')};function emitEvent(_0x3c7178){return function(_0x229f05,_0x2d39a7,_0x386eb3){SmsQueueEvents['emit'](_0x3c7178+':'+_0x229f05['id'],_0x229f05);SmsQueueEvents[_0xd621('0x6')](_0x3c7178,_0x229f05);_0x386eb3(null);};}for(var e in events){if(events[_0xd621('0x7')](e)){var event=events[e];SmsQueue[_0xd621('0x8')](e,emitEvent(event));}}module[_0xd621('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 0cbda95..a97c86a 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 _0x2da3=['SmsQueue','sms_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsQueue.attributes','exports'];(function(_0x1e6918,_0x48e621){var _0x2232b2=function(_0x3f9065){while(--_0x3f9065){_0x1e6918['push'](_0x1e6918['shift']());}};_0x2232b2(++_0x48e621);}(_0x2da3,0x18e));var _0x32da=function(_0x13cec1,_0x16cf5f){_0x13cec1=_0x13cec1-0x0;var _0x375fe2=_0x2da3[_0x13cec1];return _0x375fe2;};'use strict';var _=require(_0x32da('0x0'));var util=require(_0x32da('0x1'));var logger=require(_0x32da('0x2'))(_0x32da('0x3'));var moment=require(_0x32da('0x4'));var BPromise=require('bluebird');var rp=require(_0x32da('0x5'));var fs=require('fs');var path=require(_0x32da('0x6'));var rimraf=require(_0x32da('0x7'));var config=require('../../config/environment');var attributes=require(_0x32da('0x8'));module[_0x32da('0x9')]=function(_0x55a8eb,_0x555cd0){return _0x55a8eb['define'](_0x32da('0xa'),attributes,{'tableName':_0x32da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe319=['sms_queues','util','../../config/logger','api','moment','request-promise','rimraf','./smsQueue.attributes','exports','SmsQueue'];(function(_0x4c5708,_0x34b1f9){var _0x37fa9b=function(_0x534dc4){while(--_0x534dc4){_0x4c5708['push'](_0x4c5708['shift']());}};_0x37fa9b(++_0x34b1f9);}(_0xe319,0x10f));var _0x9e31=function(_0x27404d,_0xe78b9b){_0x27404d=_0x27404d-0x0;var _0x14e0bc=_0xe319[_0x27404d];return _0x14e0bc;};'use strict';var _=require('lodash');var util=require(_0x9e31('0x0'));var logger=require(_0x9e31('0x1'))(_0x9e31('0x2'));var moment=require(_0x9e31('0x3'));var BPromise=require('bluebird');var rp=require(_0x9e31('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e31('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e31('0x6'));module[_0x9e31('0x7')]=function(_0x5a7df7,_0xc3f587){return _0x5a7df7['define'](_0x9e31('0x8'),attributes,{'tableName':_0x9e31('0x9'),'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 32c5fce..f3fe94b 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 _0x4246=['defaults','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetSmsQueue','SmsQueue','options','raw','attributes','limit','map','include','model','find','where','ShowSmsQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0xd59547,_0x258684){var _0x1cbdbe=function(_0x2ab9c5){while(--_0x2ab9c5){_0xd59547['push'](_0xd59547['shift']());}};_0x1cbdbe(++_0x258684);}(_0x4246,0x142));var _0x6424=function(_0x4ca227,_0x5f51d2){_0x4ca227=_0x4ca227-0x0;var _0x239718=_0x4246[_0x4ca227];return _0x239718;};'use strict';var _=require('lodash');var util=require(_0x6424('0x0'));var moment=require(_0x6424('0x1'));var BPromise=require(_0x6424('0x2'));var rs=require(_0x6424('0x3'));var fs=require('fs');var Redis=require(_0x6424('0x4'));var db=require(_0x6424('0x5'))['db'];var utils=require(_0x6424('0x6'));var logger=require(_0x6424('0x7'))(_0x6424('0x8'));var config=require(_0x6424('0x9'));var jayson=require(_0x6424('0xa'));var client=jayson[_0x6424('0xb')][_0x6424('0xc')]({'port':0x232a});config[_0x6424('0xd')]=_[_0x6424('0xe')](config[_0x6424('0xd')],{'host':_0x6424('0xf'),'port':0x18eb});var socket=require(_0x6424('0x10'))(new Redis(config[_0x6424('0xd')]));require('./smsQueue.socket')[_0x6424('0x11')](socket);function respondWithRpcPromise(_0x32aad2,_0x5d4460,_0x12b42a){return new BPromise(function(_0xadfb30,_0x2179fa){return client[_0x6424('0x12')](_0x32aad2,_0x12b42a)[_0x6424('0x13')](function(_0x32285d){logger[_0x6424('0x14')](_0x6424('0x15'),_0x5d4460,'request\x20sent');logger[_0x6424('0x16')](_0x6424('0x17'),_0x5d4460,'request\x20sent',JSON[_0x6424('0x18')](_0x32285d));if(_0x32285d[_0x6424('0x19')]){if(_0x32285d[_0x6424('0x19')]['code']===0x1f4){logger[_0x6424('0x19')]('SmsQueue,\x20%s,\x20%s',_0x5d4460,_0x32285d[_0x6424('0x19')][_0x6424('0x1a')]);return _0x2179fa(_0x32285d['error'][_0x6424('0x1a')]);}logger[_0x6424('0x19')](_0x6424('0x15'),_0x5d4460,_0x32285d[_0x6424('0x19')][_0x6424('0x1a')]);return _0xadfb30(_0x32285d[_0x6424('0x19')][_0x6424('0x1a')]);}else{logger[_0x6424('0x14')](_0x6424('0x15'),_0x5d4460,_0x6424('0x1b'));_0xadfb30(_0x32285d[_0x6424('0x1c')][_0x6424('0x1a')]);}})[_0x6424('0x1d')](function(_0x33f5d0){logger[_0x6424('0x19')](_0x6424('0x15'),_0x5d4460,_0x33f5d0);_0x2179fa(_0x33f5d0);});});}exports[_0x6424('0x1e')]=function(_0x539bda){var _0x4a3db2=this;return new Promise(function(_0x23d36a,_0x20e04c){return db[_0x6424('0x1f')]['findAll']({'raw':_0x539bda['options']?_0x539bda[_0x6424('0x20')][_0x6424('0x21')]===undefined?!![]:![]:!![],'where':_0x539bda['options']?_0x539bda['options']['where']||null:null,'attributes':_0x539bda[_0x6424('0x20')]?_0x539bda[_0x6424('0x20')][_0x6424('0x22')]||null:null,'limit':_0x539bda[_0x6424('0x20')]?_0x539bda[_0x6424('0x20')][_0x6424('0x23')]||null:null,'include':_0x539bda['options']?_0x539bda[_0x6424('0x20')]['include']?_[_0x6424('0x24')](_0x539bda[_0x6424('0x20')][_0x6424('0x25')],function(_0x34f660){return{'model':db[_0x34f660[_0x6424('0x26')]],'as':_0x34f660['as'],'attributes':_0x34f660[_0x6424('0x22')],'include':_0x34f660[_0x6424('0x25')]?_[_0x6424('0x24')](_0x34f660[_0x6424('0x25')],function(_0x49ed48){return{'model':db[_0x49ed48[_0x6424('0x26')]],'as':_0x49ed48['as'],'attributes':_0x49ed48[_0x6424('0x22')],'include':_0x49ed48[_0x6424('0x25')]?_[_0x6424('0x24')](_0x49ed48[_0x6424('0x25')],function(_0x2e7b8d){return{'model':db[_0x2e7b8d[_0x6424('0x26')]],'as':_0x2e7b8d['as'],'attributes':_0x2e7b8d[_0x6424('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fc3a9){logger['info']('GetSmsQueue',_0x539bda);logger[_0x6424('0x16')](_0x6424('0x1e'),_0x539bda,JSON[_0x6424('0x18')](_0x2fc3a9));_0x23d36a(_0x2fc3a9);})['catch'](function(_0x46e7e4){logger[_0x6424('0x19')]('GetSmsQueue',_0x46e7e4['message'],_0x539bda);_0x20e04c(_0x4a3db2[_0x6424('0x19')](0x1f4,_0x46e7e4[_0x6424('0x1a')]));});});};exports['ShowSmsQueue']=function(_0x149dc7){var _0x59e926=this;return new Promise(function(_0x302a03,_0x3303e1){return db[_0x6424('0x1f')][_0x6424('0x27')]({'raw':_0x149dc7['options']?_0x149dc7[_0x6424('0x20')][_0x6424('0x21')]===undefined?!![]:![]:!![],'where':_0x149dc7[_0x6424('0x20')]?_0x149dc7['options'][_0x6424('0x28')]||null:null,'attributes':_0x149dc7[_0x6424('0x20')]?_0x149dc7[_0x6424('0x20')][_0x6424('0x22')]||null:null,'include':_0x149dc7[_0x6424('0x20')]?_0x149dc7['options'][_0x6424('0x25')]?_[_0x6424('0x24')](_0x149dc7[_0x6424('0x20')][_0x6424('0x25')],function(_0x5722c6){return{'model':db[_0x5722c6['model']],'as':_0x5722c6['as'],'attributes':_0x5722c6[_0x6424('0x22')],'include':_0x5722c6[_0x6424('0x25')]?_['map'](_0x5722c6['include'],function(_0x3d133f){return{'model':db[_0x3d133f['model']],'as':_0x3d133f['as'],'attributes':_0x3d133f[_0x6424('0x22')],'include':_0x3d133f[_0x6424('0x25')]?_[_0x6424('0x24')](_0x3d133f[_0x6424('0x25')],function(_0x1b03d6){return{'model':db[_0x1b03d6['model']],'as':_0x1b03d6['as'],'attributes':_0x1b03d6[_0x6424('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe6ad4){logger[_0x6424('0x14')](_0x6424('0x29'),_0x149dc7);logger[_0x6424('0x16')](_0x6424('0x29'),_0x149dc7,JSON[_0x6424('0x18')](_0xe6ad4));_0x302a03(_0xe6ad4);})['catch'](function(_0x420ecc){logger[_0x6424('0x19')](_0x6424('0x29'),_0x420ecc['message'],_0x149dc7);_0x3303e1(_0x59e926[_0x6424('0x19')](0x1f4,_0x420ecc[_0x6424('0x1a')]));});});}; \ No newline at end of file +var _0x622e=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','ShowSmsQueue','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x521bcb,_0x9c35d5){var _0x1400da=function(_0x4e0824){while(--_0x4e0824){_0x521bcb['push'](_0x521bcb['shift']());}};_0x1400da(++_0x9c35d5);}(_0x622e,0x92));var _0xe622=function(_0xe59443,_0x1c7fbc){_0xe59443=_0xe59443-0x0;var _0x155142=_0x622e[_0xe59443];return _0x155142;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe622('0x0'));var BPromise=require(_0xe622('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe622('0x2'));var db=require(_0xe622('0x3'))['db'];var utils=require(_0xe622('0x4'));var logger=require(_0xe622('0x5'))(_0xe622('0x6'));var config=require(_0xe622('0x7'));var jayson=require(_0xe622('0x8'));var client=jayson[_0xe622('0x9')][_0xe622('0xa')]({'port':0x232a});config[_0xe622('0xb')]=_[_0xe622('0xc')](config[_0xe622('0xb')],{'host':_0xe622('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0xe622('0xe')](socket);function respondWithRpcPromise(_0x281ffe,_0x285aba,_0x57f34e){return new BPromise(function(_0xddc60,_0x32eb42){return client[_0xe622('0xf')](_0x281ffe,_0x57f34e)['then'](function(_0x1e64a2){logger[_0xe622('0x10')](_0xe622('0x11'),_0x285aba,_0xe622('0x12'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x285aba,'request\x20sent',JSON['stringify'](_0x1e64a2));if(_0x1e64a2[_0xe622('0x13')]){if(_0x1e64a2[_0xe622('0x13')][_0xe622('0x14')]===0x1f4){logger[_0xe622('0x13')](_0xe622('0x11'),_0x285aba,_0x1e64a2[_0xe622('0x13')][_0xe622('0x15')]);return _0x32eb42(_0x1e64a2['error'][_0xe622('0x15')]);}logger[_0xe622('0x13')](_0xe622('0x11'),_0x285aba,_0x1e64a2['error']['message']);return _0xddc60(_0x1e64a2[_0xe622('0x13')][_0xe622('0x15')]);}else{logger[_0xe622('0x10')](_0xe622('0x11'),_0x285aba,_0xe622('0x12'));_0xddc60(_0x1e64a2[_0xe622('0x16')][_0xe622('0x15')]);}})[_0xe622('0x17')](function(_0x398d81){logger[_0xe622('0x13')](_0xe622('0x11'),_0x285aba,_0x398d81);_0x32eb42(_0x398d81);});});}exports[_0xe622('0x18')]=function(_0x33c69a){var _0x40c84c=this;return new Promise(function(_0x25a80a,_0x3543e1){return db[_0xe622('0x19')][_0xe622('0x1a')]({'raw':_0x33c69a[_0xe622('0x1b')]?_0x33c69a[_0xe622('0x1b')][_0xe622('0x1c')]===undefined?!![]:![]:!![],'where':_0x33c69a[_0xe622('0x1b')]?_0x33c69a[_0xe622('0x1b')][_0xe622('0x1d')]||null:null,'attributes':_0x33c69a[_0xe622('0x1b')]?_0x33c69a[_0xe622('0x1b')]['attributes']||null:null,'limit':_0x33c69a['options']?_0x33c69a[_0xe622('0x1b')][_0xe622('0x1e')]||null:null,'include':_0x33c69a[_0xe622('0x1b')]?_0x33c69a['options'][_0xe622('0x1f')]?_[_0xe622('0x20')](_0x33c69a[_0xe622('0x1b')][_0xe622('0x1f')],function(_0x49ebea){return{'model':db[_0x49ebea[_0xe622('0x21')]],'as':_0x49ebea['as'],'attributes':_0x49ebea[_0xe622('0x22')],'include':_0x49ebea['include']?_[_0xe622('0x20')](_0x49ebea['include'],function(_0x3fdaa8){return{'model':db[_0x3fdaa8[_0xe622('0x21')]],'as':_0x3fdaa8['as'],'attributes':_0x3fdaa8[_0xe622('0x22')],'include':_0x3fdaa8[_0xe622('0x1f')]?_['map'](_0x3fdaa8['include'],function(_0x59c27e){return{'model':db[_0x59c27e[_0xe622('0x21')]],'as':_0x59c27e['as'],'attributes':_0x59c27e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3b31b3){logger[_0xe622('0x10')]('GetSmsQueue',_0x33c69a);logger[_0xe622('0x23')](_0xe622('0x18'),_0x33c69a,JSON[_0xe622('0x24')](_0x3b31b3));_0x25a80a(_0x3b31b3);})[_0xe622('0x17')](function(_0x35eabd){logger[_0xe622('0x13')]('GetSmsQueue',_0x35eabd[_0xe622('0x15')],_0x33c69a);_0x3543e1(_0x40c84c[_0xe622('0x13')](0x1f4,_0x35eabd['message']));});});};exports[_0xe622('0x25')]=function(_0x1ccc59){var _0x56d492=this;return new Promise(function(_0xfa96b0,_0x4b2992){return db[_0xe622('0x19')]['find']({'raw':_0x1ccc59[_0xe622('0x1b')]?_0x1ccc59[_0xe622('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1ccc59[_0xe622('0x1b')]?_0x1ccc59[_0xe622('0x1b')][_0xe622('0x1d')]||null:null,'attributes':_0x1ccc59[_0xe622('0x1b')]?_0x1ccc59[_0xe622('0x1b')][_0xe622('0x22')]||null:null,'include':_0x1ccc59[_0xe622('0x1b')]?_0x1ccc59[_0xe622('0x1b')][_0xe622('0x1f')]?_[_0xe622('0x20')](_0x1ccc59[_0xe622('0x1b')][_0xe622('0x1f')],function(_0x2bdeca){return{'model':db[_0x2bdeca[_0xe622('0x21')]],'as':_0x2bdeca['as'],'attributes':_0x2bdeca[_0xe622('0x22')],'include':_0x2bdeca['include']?_[_0xe622('0x20')](_0x2bdeca[_0xe622('0x1f')],function(_0xeb8264){return{'model':db[_0xeb8264['model']],'as':_0xeb8264['as'],'attributes':_0xeb8264[_0xe622('0x22')],'include':_0xeb8264['include']?_['map'](_0xeb8264[_0xe622('0x1f')],function(_0x378fe0){return{'model':db[_0x378fe0[_0xe622('0x21')]],'as':_0x378fe0['as'],'attributes':_0x378fe0[_0xe622('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d3d3d){logger[_0xe622('0x10')]('ShowSmsQueue',_0x1ccc59);logger[_0xe622('0x23')](_0xe622('0x25'),_0x1ccc59,JSON[_0xe622('0x24')](_0x3d3d3d));_0xfa96b0(_0x3d3d3d);})[_0xe622('0x17')](function(_0x5036df){logger[_0xe622('0x13')](_0xe622('0x25'),_0x5036df[_0xe622('0x15')],_0x1ccc59);_0x4b2992(_0x56d492[_0xe622('0x13')](0x1f4,_0x5036df[_0xe622('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 0c7d6b5..5db595a 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 _0x2a7a=['smsQueue:','save','remove','update','removeListener'];(function(_0x1b7997,_0x5ca74d){var _0x5e5062=function(_0x49cdbe){while(--_0x49cdbe){_0x1b7997['push'](_0x1b7997['shift']());}};_0x5e5062(++_0x5ca74d);}(_0x2a7a,0xb5));var _0xa2a7=function(_0x267b7d,_0x32b424){_0x267b7d=_0x267b7d-0x0;var _0x10653b=_0x2a7a[_0x267b7d];return _0x10653b;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xa2a7('0x0'),_0xa2a7('0x1'),_0xa2a7('0x2')];function createListener(_0x24125f,_0x3efc1b){return function(_0x2b00d4){_0x3efc1b['emit'](_0x24125f,_0x2b00d4);};}function removeListener(_0x483e3a,_0x1a5e2f){return function(){SmsQueueEvents[_0xa2a7('0x3')](_0x483e3a,_0x1a5e2f);};}exports['register']=function(_0x345e20){for(var _0x1d8b67=0x0,_0x2be56e=events['length'];_0x1d8b67<_0x2be56e;_0x1d8b67++){var _0x2d7ad6=events[_0x1d8b67];var _0x18346d=createListener(_0xa2a7('0x4')+_0x2d7ad6,_0x345e20);SmsQueueEvents['on'](_0x2d7ad6,_0x18346d);}}; \ No newline at end of file +var _0xb1d3=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x845d6e,_0x4b66b0){var _0x5a9c1c=function(_0x56b184){while(--_0x56b184){_0x845d6e['push'](_0x845d6e['shift']());}};_0x5a9c1c(++_0x4b66b0);}(_0xb1d3,0x1d5));var _0x3b1d=function(_0x4d9db4,_0x5bb8e9){_0x4d9db4=_0x4d9db4-0x0;var _0x2a7bf4=_0xb1d3[_0x4d9db4];return _0x2a7bf4;};'use strict';var SmsQueueEvents=require(_0x3b1d('0x0'));var events=[_0x3b1d('0x1'),_0x3b1d('0x2'),_0x3b1d('0x3')];function createListener(_0x2953f7,_0x3176ad){return function(_0x2a868a){_0x3176ad[_0x3b1d('0x4')](_0x2953f7,_0x2a868a);};}function removeListener(_0x16480f,_0x365e72){return function(){SmsQueueEvents[_0x3b1d('0x5')](_0x16480f,_0x365e72);};}exports[_0x3b1d('0x6')]=function(_0x48bfba){for(var _0x4b40aa=0x0,_0x38a255=events[_0x3b1d('0x7')];_0x4b40aa<_0x38a255;_0x4b40aa++){var _0x85c346=events[_0x4b40aa];var _0x10b565=createListener(_0x3b1d('0x8')+_0x85c346,_0x48bfba);SmsQueueEvents['on'](_0x85c346,_0x10b565);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 2583e85..c29cf59 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 _0xab13=['post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x38af13,_0x3949a1){var _0x56a221=function(_0xf457af){while(--_0xf457af){_0x38af13['push'](_0x38af13['shift']());}};_0x56a221(++_0x3949a1);}(_0xab13,0x8b));var _0x3ab1=function(_0x172e0a,_0x15d22a){_0x172e0a=_0x172e0a-0x0;var _0x4baf16=_0xab13[_0x172e0a];return _0x4baf16;};'use strict';var multer=require(_0x3ab1('0x0'));var util=require('util');var path=require(_0x3ab1('0x1'));var timeout=require('connect-timeout');var express=require(_0x3ab1('0x2'));var router=express[_0x3ab1('0x3')]();var fs_extra=require(_0x3ab1('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x3ab1('0x5'));var controller=require(_0x3ab1('0x6'));router[_0x3ab1('0x7')]('/',auth[_0x3ab1('0x8')](),controller[_0x3ab1('0x9')]);router[_0x3ab1('0x7')](_0x3ab1('0xa'),auth[_0x3ab1('0x8')](),controller['describe']);router[_0x3ab1('0x7')](_0x3ab1('0xb'),auth[_0x3ab1('0x8')](),controller[_0x3ab1('0xc')]);router[_0x3ab1('0xd')]('/',auth[_0x3ab1('0x8')](),controller[_0x3ab1('0xe')]);router['put']('/:id',auth[_0x3ab1('0x8')](),controller[_0x3ab1('0xf')]);router[_0x3ab1('0x10')](_0x3ab1('0xb'),auth['isAuthenticated'](),controller[_0x3ab1('0x11')]);module[_0x3ab1('0x12')]=router; \ No newline at end of file +var _0x3be5=['post','create','put','update','exports','multer','path','connect-timeout','express','fs-extra','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x2b1741,_0x4376b0){var _0x2a62f0=function(_0x17cfc2){while(--_0x17cfc2){_0x2b1741['push'](_0x2b1741['shift']());}};_0x2a62f0(++_0x4376b0);}(_0x3be5,0x155));var _0x53be=function(_0x2a85fe,_0x157a6b){_0x2a85fe=_0x2a85fe-0x0;var _0x432e7e=_0x3be5[_0x2a85fe];return _0x432e7e;};'use strict';var multer=require(_0x53be('0x0'));var util=require('util');var path=require(_0x53be('0x1'));var timeout=require(_0x53be('0x2'));var express=require(_0x53be('0x3'));var router=express['Router']();var fs_extra=require(_0x53be('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x53be('0x5'));router[_0x53be('0x6')]('/',auth[_0x53be('0x7')](),controller[_0x53be('0x8')]);router[_0x53be('0x6')](_0x53be('0x9'),auth[_0x53be('0x7')](),controller['describe']);router['get'](_0x53be('0xa'),auth[_0x53be('0x7')](),controller['show']);router[_0x53be('0xb')]('/',auth[_0x53be('0x7')](),controller[_0x53be('0xc')]);router[_0x53be('0xd')]('/:id',auth[_0x53be('0x7')](),controller[_0x53be('0xe')]);router['delete']('/:id',auth[_0x53be('0x7')](),controller['destroy']);module[_0x53be('0xf')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 8d2eb04..98e3a05 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 _0x3e51=['DATE','exports','STRING'];(function(_0x570f95,_0x238b78){var _0x374de9=function(_0x39d8d6){while(--_0x39d8d6){_0x570f95['push'](_0x570f95['shift']());}};_0x374de9(++_0x238b78);}(_0x3e51,0xa3));var _0x13e5=function(_0x3ce938,_0x52bdc4){_0x3ce938=_0x3ce938-0x0;var _0x460dbd=_0x3e51[_0x3ce938];return _0x460dbd;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x13e5('0x0')]={'uniqueid':{'type':Sequelize[_0x13e5('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x13e5('0x1')]},'joinAt':{'type':Sequelize[_0x13e5('0x2')]},'leaveAt':{'type':Sequelize[_0x13e5('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x13e5('0x2')]},'reason':{'type':Sequelize[_0x13e5('0x1')]}}; \ No newline at end of file +var _0xf435=['DATE','moment','sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf435,0x115));var _0x5f43=function(_0x892a7f,_0x3b6e66){_0x892a7f=_0x892a7f-0x0;var _0x1696b7=_0xf435[_0x892a7f];return _0x1696b7;};'use strict';var moment=require(_0x5f43('0x0'));var Sequelize=require(_0x5f43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5f43('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x5f43('0x2')]},'joinAt':{'type':Sequelize[_0x5f43('0x3')]},'leaveAt':{'type':Sequelize[_0x5f43('0x3')]},'acceptAt':{'type':Sequelize[_0x5f43('0x3')]},'exitAt':{'type':Sequelize[_0x5f43('0x3')]},'reason':{'type':Sequelize[_0x5f43('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index dc2a40a..bb078e1 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 _0x1c0b=['error','name','send','index','map','rawAttributes','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsQueueReport','length','include','find','catch','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x1c0b,0xf9));var _0xb1c0=function(_0x85a333,_0x425aa7){_0x85a333=_0x85a333-0x0;var _0x36f553=_0x1c0b[_0x85a333];return _0x36f553;};'use strict';var emlformat=require(_0xb1c0('0x0'));var rimraf=require(_0xb1c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb1c0('0x2'));var rp=require(_0xb1c0('0x3'));var moment=require(_0xb1c0('0x4'));var BPromise=require(_0xb1c0('0x5'));var Mustache=require(_0xb1c0('0x6'));var util=require(_0xb1c0('0x7'));var path=require(_0xb1c0('0x8'));var sox=require(_0xb1c0('0x9'));var csv=require(_0xb1c0('0xa'));var ejs=require(_0xb1c0('0xb'));var fs=require('fs');var fs_extra=require(_0xb1c0('0xc'));var _=require(_0xb1c0('0xd'));var squel=require('squel');var crypto=require(_0xb1c0('0xe'));var jsforce=require(_0xb1c0('0xf'));var deskjs=require(_0xb1c0('0x10'));var toCsv=require(_0xb1c0('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb1c0('0x11'));var authService=require(_0xb1c0('0x12'));var qs=require(_0xb1c0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb1c0('0x14'));var logger=require('../../config/logger')(_0xb1c0('0x15'));var utils=require(_0xb1c0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xb1c0('0x17'));var db=require(_0xb1c0('0x18'))['db'];function respondWithStatusCode(_0x3c6ead,_0x35f2a4){_0x35f2a4=_0x35f2a4||0xcc;return function(_0x1fdca1){if(_0x1fdca1){return _0x3c6ead['sendStatus'](_0x35f2a4);}return _0x3c6ead[_0xb1c0('0x19')](_0x35f2a4)[_0xb1c0('0x1a')]();};}function respondWithResult(_0x5b8290,_0xf599a1){_0xf599a1=_0xf599a1||0xc8;return function(_0x2c47b9){if(_0x2c47b9){return _0x5b8290[_0xb1c0('0x19')](_0xf599a1)[_0xb1c0('0x1b')](_0x2c47b9);}};}function respondWithFilteredResult(_0x32a60c,_0xf65908){return function(_0x45cc78){if(_0x45cc78){var _0x5be614=typeof _0xf65908[_0xb1c0('0x1c')]===_0xb1c0('0x1d')&&typeof _0xf65908[_0xb1c0('0x1e')]==='undefined';var _0x5ee978=_0x45cc78[_0xb1c0('0x1f')];var _0x3067dc=_0x5be614?0x0:_0xf65908[_0xb1c0('0x1c')];var _0x1062df=_0x5be614?_0x45cc78[_0xb1c0('0x1f')]:_0xf65908[_0xb1c0('0x1c')]+_0xf65908[_0xb1c0('0x1e')];var _0x2a406d;if(_0x1062df>=_0x5ee978){_0x1062df=_0x5ee978;_0x2a406d=0xc8;}else{_0x2a406d=0xce;}_0x32a60c[_0xb1c0('0x19')](_0x2a406d);return _0x32a60c[_0xb1c0('0x20')]('Content-Range',_0x3067dc+'-'+_0x1062df+'/'+_0x5ee978)[_0xb1c0('0x1b')](_0x45cc78);}return null;};}function patchUpdates(_0x1a8421){return function(_0x309100){try{jsonpatch[_0xb1c0('0x21')](_0x309100,_0x1a8421,!![]);}catch(_0x4f85b6){return BPromise[_0xb1c0('0x22')](_0x4f85b6);}return _0x309100['save']();};}function saveUpdates(_0x49a234,_0x3dc425){return function(_0x228dd4){if(_0x228dd4){return _0x228dd4[_0xb1c0('0x23')](_0x49a234)[_0xb1c0('0x24')](function(_0x1202a9){return _0x1202a9;});}return null;};}function removeEntity(_0x45b344,_0x24743f){return function(_0x3050e1){if(_0x3050e1){return _0x3050e1[_0xb1c0('0x25')]()[_0xb1c0('0x24')](function(){_0x45b344[_0xb1c0('0x19')](0xcc)[_0xb1c0('0x1a')]();});}};}function handleEntityNotFound(_0x147124,_0x365d76){return function(_0x266bcb){if(!_0x266bcb){_0x147124[_0xb1c0('0x26')](0x194);}return _0x266bcb;};}function handleError(_0x8517b3,_0x4b9954){_0x4b9954=_0x4b9954||0x1f4;return function(_0x205e82){logger[_0xb1c0('0x27')](_0x205e82['stack']);if(_0x205e82[_0xb1c0('0x28')]){delete _0x205e82[_0xb1c0('0x28')];}_0x8517b3[_0xb1c0('0x19')](_0x4b9954)[_0xb1c0('0x29')](_0x205e82);};}exports[_0xb1c0('0x2a')]=function(_0x142804,_0x1362ab){var _0x2f2dc2={},_0x5cb3d4={},_0x5469f8={'count':0x0,'rows':[]};var _0x854ec0=_[_0xb1c0('0x2b')](db['SmsQueueReport'][_0xb1c0('0x2c')],function(_0x53870c){return{'name':_0x53870c['fieldName'],'type':_0x53870c['type']['key']};});_0x5cb3d4['model']=_['map'](_0x854ec0,_0xb1c0('0x28'));_0x5cb3d4['query']=_[_0xb1c0('0x2d')](_0x142804[_0xb1c0('0x2e')]);_0x5cb3d4[_0xb1c0('0x2f')]=_[_0xb1c0('0x30')](_0x5cb3d4[_0xb1c0('0x31')],_0x5cb3d4['query']);_0x2f2dc2[_0xb1c0('0x32')]=_[_0xb1c0('0x30')](_0x5cb3d4[_0xb1c0('0x31')],qs[_0xb1c0('0x33')](_0x142804[_0xb1c0('0x2e')][_0xb1c0('0x33')]));_0x2f2dc2[_0xb1c0('0x32')]=_0x2f2dc2['attributes']['length']?_0x2f2dc2['attributes']:_0x5cb3d4[_0xb1c0('0x31')];if(!_0x142804[_0xb1c0('0x2e')][_0xb1c0('0x34')](_0xb1c0('0x35'))){_0x2f2dc2[_0xb1c0('0x1e')]=qs[_0xb1c0('0x1e')](_0x142804[_0xb1c0('0x2e')][_0xb1c0('0x1e')]);_0x2f2dc2[_0xb1c0('0x1c')]=qs['offset'](_0x142804[_0xb1c0('0x2e')][_0xb1c0('0x1c')]);}_0x2f2dc2[_0xb1c0('0x36')]=qs[_0xb1c0('0x37')](_0x142804[_0xb1c0('0x2e')][_0xb1c0('0x37')]);_0x2f2dc2[_0xb1c0('0x38')]=qs[_0xb1c0('0x2f')](_[_0xb1c0('0x39')](_0x142804[_0xb1c0('0x2e')],_0x5cb3d4['filters']),_0x854ec0);if(_0x142804[_0xb1c0('0x2e')][_0xb1c0('0x3a')]){_0x2f2dc2[_0xb1c0('0x38')]=_[_0xb1c0('0x3b')](_0x2f2dc2[_0xb1c0('0x38')],{'$or':_['map'](_0x854ec0,function(_0x1a0a99){if(_0x1a0a99[_0xb1c0('0x3c')]!==_0xb1c0('0x3d')){var _0x435890={};_0x435890[_0x1a0a99[_0xb1c0('0x28')]]={'$like':'%'+_0x142804['query'][_0xb1c0('0x3a')]+'%'};return _0x435890;}})});}_0x2f2dc2=_['merge']({},_0x2f2dc2,_0x142804[_0xb1c0('0x3e')]);var _0x3d1463={'where':_0x2f2dc2['where']};return db[_0xb1c0('0x3f')][_0xb1c0('0x1f')](_0x3d1463)[_0xb1c0('0x24')](function(_0x162823){_0x5469f8[_0xb1c0('0x1f')]=_0x162823;if(_0x142804[_0xb1c0('0x2e')]['includeAll']){_0x2f2dc2['include']=[{'all':!![]}];}return db[_0xb1c0('0x3f')]['findAll'](_0x2f2dc2);})[_0xb1c0('0x24')](function(_0x35ae97){_0x5469f8['rows']=_0x35ae97;return _0x5469f8;})[_0xb1c0('0x24')](respondWithFilteredResult(_0x1362ab,_0x2f2dc2))['catch'](handleError(_0x1362ab,null));};exports['show']=function(_0x490131,_0x2c2832){var _0x16ef91={'raw':!![],'where':{'id':_0x490131['params']['id']}},_0x5be127={};_0x5be127[_0xb1c0('0x31')]=_[_0xb1c0('0x2d')](db[_0xb1c0('0x3f')]['rawAttributes']);_0x5be127[_0xb1c0('0x2e')]=_[_0xb1c0('0x2d')](_0x490131[_0xb1c0('0x2e')]);_0x5be127[_0xb1c0('0x2f')]=_[_0xb1c0('0x30')](_0x5be127[_0xb1c0('0x31')],_0x5be127[_0xb1c0('0x2e')]);_0x16ef91[_0xb1c0('0x32')]=_['intersection'](_0x5be127[_0xb1c0('0x31')],qs['fields'](_0x490131[_0xb1c0('0x2e')][_0xb1c0('0x33')]));_0x16ef91[_0xb1c0('0x32')]=_0x16ef91[_0xb1c0('0x32')][_0xb1c0('0x40')]?_0x16ef91[_0xb1c0('0x32')]:_0x5be127['model'];if(_0x490131[_0xb1c0('0x2e')]['includeAll']){_0x16ef91[_0xb1c0('0x41')]=[{'all':!![]}];}_0x16ef91=_[_0xb1c0('0x3b')]({},_0x16ef91,_0x490131[_0xb1c0('0x3e')]);return db[_0xb1c0('0x3f')][_0xb1c0('0x42')](_0x16ef91)['then'](handleEntityNotFound(_0x2c2832,null))[_0xb1c0('0x24')](respondWithResult(_0x2c2832,null))[_0xb1c0('0x43')](handleError(_0x2c2832,null));};exports[_0xb1c0('0x44')]=function(_0x4d42cd,_0x131273){return db['SmsQueueReport'][_0xb1c0('0x44')](_0x4d42cd['body'],{})['then'](respondWithResult(_0x131273,0xc9))[_0xb1c0('0x43')](handleError(_0x131273,null));};exports[_0xb1c0('0x23')]=function(_0x4a0684,_0x81937e){if(_0x4a0684[_0xb1c0('0x45')]['id']){delete _0x4a0684[_0xb1c0('0x45')]['id'];}return db[_0xb1c0('0x3f')][_0xb1c0('0x42')]({'where':{'id':_0x4a0684[_0xb1c0('0x46')]['id']}})['then'](handleEntityNotFound(_0x81937e,null))['then'](saveUpdates(_0x4a0684[_0xb1c0('0x45')],null))['then'](respondWithResult(_0x81937e,null))['catch'](handleError(_0x81937e,null));};exports['destroy']=function(_0x17300a,_0x1bc2a7){return db[_0xb1c0('0x3f')][_0xb1c0('0x42')]({'where':{'id':_0x17300a[_0xb1c0('0x46')]['id']}})[_0xb1c0('0x24')](handleEntityNotFound(_0x1bc2a7,null))[_0xb1c0('0x24')](removeEntity(_0x1bc2a7,null))[_0xb1c0('0x43')](handleError(_0x1bc2a7,null));};exports['describe']=function(_0xc3fdbb,_0x31a85c){return db[_0xb1c0('0x3f')][_0xb1c0('0x47')]()['then'](respondWithResult(_0x31a85c,null))[_0xb1c0('0x43')](handleError(_0x31a85c,null));}; \ No newline at end of file +var _0x94ed=['papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x308f,_0x282972){var _0x5959d3=function(_0x29775b){while(--_0x29775b){_0x308f['push'](_0x308f['shift']());}};_0x5959d3(++_0x282972);}(_0x94ed,0x123));var _0xd94e=function(_0x4bfd95,_0x1c3b3b){_0x4bfd95=_0x4bfd95-0x0;var _0x1484cd=_0x94ed[_0x4bfd95];return _0x1484cd;};'use strict';var emlformat=require(_0xd94e('0x0'));var rimraf=require(_0xd94e('0x1'));var zipdir=require(_0xd94e('0x2'));var jsonpatch=require(_0xd94e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd94e('0x4'));var Mustache=require(_0xd94e('0x5'));var util=require(_0xd94e('0x6'));var path=require('path');var sox=require(_0xd94e('0x7'));var csv=require(_0xd94e('0x8'));var ejs=require(_0xd94e('0x9'));var fs=require('fs');var fs_extra=require(_0xd94e('0xa'));var _=require(_0xd94e('0xb'));var squel=require(_0xd94e('0xc'));var crypto=require(_0xd94e('0xd'));var jsforce=require(_0xd94e('0xe'));var deskjs=require(_0xd94e('0xf'));var toCsv=require(_0xd94e('0x8'));var querystring=require(_0xd94e('0x10'));var Papa=require(_0xd94e('0x11'));var Redis=require(_0xd94e('0x12'));var authService=require(_0xd94e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xd94e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd94e('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd94e('0x16'));var db=require(_0xd94e('0x17'))['db'];function respondWithStatusCode(_0x2970e5,_0x50a370){_0x50a370=_0x50a370||0xcc;return function(_0x5e105b){if(_0x5e105b){return _0x2970e5[_0xd94e('0x18')](_0x50a370);}return _0x2970e5[_0xd94e('0x19')](_0x50a370)['end']();};}function respondWithResult(_0x15ff86,_0x358b93){_0x358b93=_0x358b93||0xc8;return function(_0x1c13f5){if(_0x1c13f5){return _0x15ff86[_0xd94e('0x19')](_0x358b93)[_0xd94e('0x1a')](_0x1c13f5);}};}function respondWithFilteredResult(_0x5bb467,_0x205814){return function(_0x1e53ba){if(_0x1e53ba){var _0x5d9f99=typeof _0x205814[_0xd94e('0x1b')]===_0xd94e('0x1c')&&typeof _0x205814[_0xd94e('0x1d')]===_0xd94e('0x1c');var _0x309632=_0x1e53ba[_0xd94e('0x1e')];var _0x695bea=_0x5d9f99?0x0:_0x205814[_0xd94e('0x1b')];var _0x15508a=_0x5d9f99?_0x1e53ba['count']:_0x205814['offset']+_0x205814[_0xd94e('0x1d')];var _0x406226;if(_0x15508a>=_0x309632){_0x15508a=_0x309632;_0x406226=0xc8;}else{_0x406226=0xce;}_0x5bb467[_0xd94e('0x19')](_0x406226);return _0x5bb467['set'](_0xd94e('0x1f'),_0x695bea+'-'+_0x15508a+'/'+_0x309632)[_0xd94e('0x1a')](_0x1e53ba);}return null;};}function patchUpdates(_0x418102){return function(_0x2c357d){try{jsonpatch[_0xd94e('0x20')](_0x2c357d,_0x418102,!![]);}catch(_0x38159e){return BPromise[_0xd94e('0x21')](_0x38159e);}return _0x2c357d[_0xd94e('0x22')]();};}function saveUpdates(_0x54b0b6,_0x2aa281){return function(_0x2211cb){if(_0x2211cb){return _0x2211cb[_0xd94e('0x23')](_0x54b0b6)[_0xd94e('0x24')](function(_0x725648){return _0x725648;});}return null;};}function removeEntity(_0x1a1e47,_0x3e8a0c){return function(_0x55bab6){if(_0x55bab6){return _0x55bab6[_0xd94e('0x25')]()[_0xd94e('0x24')](function(){_0x1a1e47[_0xd94e('0x19')](0xcc)[_0xd94e('0x26')]();});}};}function handleEntityNotFound(_0x3e4c9b,_0x125b6a){return function(_0x203d8c){if(!_0x203d8c){_0x3e4c9b[_0xd94e('0x18')](0x194);}return _0x203d8c;};}function handleError(_0x390430,_0x2ce39c){_0x2ce39c=_0x2ce39c||0x1f4;return function(_0x2b7d6f){logger[_0xd94e('0x27')](_0x2b7d6f[_0xd94e('0x28')]);if(_0x2b7d6f['name']){delete _0x2b7d6f[_0xd94e('0x29')];}_0x390430['status'](_0x2ce39c)[_0xd94e('0x2a')](_0x2b7d6f);};}exports[_0xd94e('0x2b')]=function(_0x2c81ef,_0x5cb4a5){var _0x856357={},_0x1d5ea5={},_0x39781e={'count':0x0,'rows':[]};var _0x30b813=_[_0xd94e('0x2c')](db[_0xd94e('0x2d')][_0xd94e('0x2e')],function(_0x4cd879){return{'name':_0x4cd879[_0xd94e('0x2f')],'type':_0x4cd879[_0xd94e('0x30')]['key']};});_0x1d5ea5[_0xd94e('0x31')]=_[_0xd94e('0x2c')](_0x30b813,_0xd94e('0x29'));_0x1d5ea5[_0xd94e('0x32')]=_[_0xd94e('0x33')](_0x2c81ef[_0xd94e('0x32')]);_0x1d5ea5[_0xd94e('0x34')]=_[_0xd94e('0x35')](_0x1d5ea5['model'],_0x1d5ea5[_0xd94e('0x32')]);_0x856357['attributes']=_['intersection'](_0x1d5ea5[_0xd94e('0x31')],qs['fields'](_0x2c81ef['query']['fields']));_0x856357[_0xd94e('0x36')]=_0x856357[_0xd94e('0x36')][_0xd94e('0x37')]?_0x856357[_0xd94e('0x36')]:_0x1d5ea5[_0xd94e('0x31')];if(!_0x2c81ef[_0xd94e('0x32')][_0xd94e('0x38')](_0xd94e('0x39'))){_0x856357[_0xd94e('0x1d')]=qs[_0xd94e('0x1d')](_0x2c81ef[_0xd94e('0x32')][_0xd94e('0x1d')]);_0x856357[_0xd94e('0x1b')]=qs['offset'](_0x2c81ef['query'][_0xd94e('0x1b')]);}_0x856357[_0xd94e('0x3a')]=qs[_0xd94e('0x3b')](_0x2c81ef['query'][_0xd94e('0x3b')]);_0x856357[_0xd94e('0x3c')]=qs['filters'](_[_0xd94e('0x3d')](_0x2c81ef[_0xd94e('0x32')],_0x1d5ea5[_0xd94e('0x34')]),_0x30b813);if(_0x2c81ef['query'][_0xd94e('0x3e')]){_0x856357['where']=_[_0xd94e('0x3f')](_0x856357['where'],{'$or':_[_0xd94e('0x2c')](_0x30b813,function(_0x2cabe2){if(_0x2cabe2[_0xd94e('0x30')]!==_0xd94e('0x40')){var _0x46a8dd={};_0x46a8dd[_0x2cabe2[_0xd94e('0x29')]]={'$like':'%'+_0x2c81ef[_0xd94e('0x32')][_0xd94e('0x3e')]+'%'};return _0x46a8dd;}})});}_0x856357=_[_0xd94e('0x3f')]({},_0x856357,_0x2c81ef[_0xd94e('0x41')]);var _0x3c16e1={'where':_0x856357['where']};return db[_0xd94e('0x2d')][_0xd94e('0x1e')](_0x3c16e1)[_0xd94e('0x24')](function(_0x4d191a){_0x39781e['count']=_0x4d191a;if(_0x2c81ef['query'][_0xd94e('0x42')]){_0x856357[_0xd94e('0x43')]=[{'all':!![]}];}return db[_0xd94e('0x2d')]['findAll'](_0x856357);})[_0xd94e('0x24')](function(_0x54da29){_0x39781e[_0xd94e('0x44')]=_0x54da29;return _0x39781e;})['then'](respondWithFilteredResult(_0x5cb4a5,_0x856357))[_0xd94e('0x45')](handleError(_0x5cb4a5,null));};exports[_0xd94e('0x46')]=function(_0x2534ce,_0x169aca){var _0xb26185={'raw':!![],'where':{'id':_0x2534ce[_0xd94e('0x47')]['id']}},_0x11542f={};_0x11542f[_0xd94e('0x31')]=_[_0xd94e('0x33')](db[_0xd94e('0x2d')][_0xd94e('0x2e')]);_0x11542f[_0xd94e('0x32')]=_['keys'](_0x2534ce[_0xd94e('0x32')]);_0x11542f[_0xd94e('0x34')]=_['intersection'](_0x11542f[_0xd94e('0x31')],_0x11542f[_0xd94e('0x32')]);_0xb26185[_0xd94e('0x36')]=_['intersection'](_0x11542f[_0xd94e('0x31')],qs[_0xd94e('0x48')](_0x2534ce[_0xd94e('0x32')]['fields']));_0xb26185[_0xd94e('0x36')]=_0xb26185[_0xd94e('0x36')]['length']?_0xb26185[_0xd94e('0x36')]:_0x11542f['model'];if(_0x2534ce[_0xd94e('0x32')][_0xd94e('0x42')]){_0xb26185[_0xd94e('0x43')]=[{'all':!![]}];}_0xb26185=_[_0xd94e('0x3f')]({},_0xb26185,_0x2534ce[_0xd94e('0x41')]);return db[_0xd94e('0x2d')][_0xd94e('0x49')](_0xb26185)['then'](handleEntityNotFound(_0x169aca,null))[_0xd94e('0x24')](respondWithResult(_0x169aca,null))['catch'](handleError(_0x169aca,null));};exports[_0xd94e('0x4a')]=function(_0x190a60,_0x266352){return db[_0xd94e('0x2d')][_0xd94e('0x4a')](_0x190a60[_0xd94e('0x4b')],{})[_0xd94e('0x24')](respondWithResult(_0x266352,0xc9))[_0xd94e('0x45')](handleError(_0x266352,null));};exports[_0xd94e('0x23')]=function(_0x2c2929,_0xe2f270){if(_0x2c2929[_0xd94e('0x4b')]['id']){delete _0x2c2929['body']['id'];}return db[_0xd94e('0x2d')][_0xd94e('0x49')]({'where':{'id':_0x2c2929['params']['id']}})['then'](handleEntityNotFound(_0xe2f270,null))['then'](saveUpdates(_0x2c2929[_0xd94e('0x4b')],null))[_0xd94e('0x24')](respondWithResult(_0xe2f270,null))[_0xd94e('0x45')](handleError(_0xe2f270,null));};exports[_0xd94e('0x25')]=function(_0x274f40,_0x2afade){return db['SmsQueueReport']['find']({'where':{'id':_0x274f40[_0xd94e('0x47')]['id']}})[_0xd94e('0x24')](handleEntityNotFound(_0x2afade,null))['then'](removeEntity(_0x2afade,null))[_0xd94e('0x45')](handleError(_0x2afade,null));};exports['describe']=function(_0x4d0c81,_0x300f17){return db[_0xd94e('0x2d')][_0xd94e('0x4c')]()[_0xd94e('0x24')](respondWithResult(_0x300f17,null))[_0xd94e('0x45')](handleError(_0x300f17,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 928e315..e364210 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x479b58,_0x4ca0d0){var _0x1f5094=function(_0x233481){while(--_0x233481){_0x479b58['push'](_0x479b58['shift']());}};_0x1f5094(++_0x4ca0d0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1f36bb,_0x8af718){_0x1f36bb=_0x1f36bb-0x0;var _0xaf97fa=_0xcb91[_0x1f36bb];return _0xaf97fa;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['define','SmsQueueReport','report_sms_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x1a14c3,_0x2c70c2){var _0x1d7ada=function(_0x40fafa){while(--_0x40fafa){_0x1a14c3['push'](_0x1a14c3['shift']());}};_0x1d7ada(++_0x2c70c2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'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/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 49eb3e0..8031639 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 _0x20dc=['attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','SmsQueueReport,\x20%s,\x20%s','message','request\x20sent','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','stringify','UpdateSmsQueueReport','update','where'];(function(_0x1305b0,_0x3cabe0){var _0x49299c=function(_0x5dd145){while(--_0x5dd145){_0x1305b0['push'](_0x1305b0['shift']());}};_0x49299c(++_0x3cabe0);}(_0x20dc,0x1d0));var _0xc20d=function(_0x4b8ba3,_0x74379c){_0x4b8ba3=_0x4b8ba3-0x0;var _0x2152dc=_0x20dc[_0x4b8ba3];return _0x2152dc;};'use strict';var _=require(_0xc20d('0x0'));var util=require(_0xc20d('0x1'));var moment=require('moment');var BPromise=require(_0xc20d('0x2'));var rs=require(_0xc20d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc20d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc20d('0x5'))(_0xc20d('0x6'));var config=require(_0xc20d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc20d('0x8')][_0xc20d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26f71e,_0x3708ea,_0x3a457f){return new BPromise(function(_0x211595,_0x1ad2c6){return client[_0xc20d('0xa')](_0x26f71e,_0x3a457f)[_0xc20d('0xb')](function(_0x61fbe4){logger[_0xc20d('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x3708ea,'request\x20sent');logger[_0xc20d('0xd')](_0xc20d('0xe'),_0x3708ea,'request\x20sent',JSON['stringify'](_0x61fbe4));if(_0x61fbe4[_0xc20d('0xf')]){if(_0x61fbe4[_0xc20d('0xf')]['code']===0x1f4){logger[_0xc20d('0xf')](_0xc20d('0x10'),_0x3708ea,_0x61fbe4[_0xc20d('0xf')]['message']);return _0x1ad2c6(_0x61fbe4[_0xc20d('0xf')][_0xc20d('0x11')]);}logger[_0xc20d('0xf')](_0xc20d('0x10'),_0x3708ea,_0x61fbe4[_0xc20d('0xf')][_0xc20d('0x11')]);return _0x211595(_0x61fbe4[_0xc20d('0xf')][_0xc20d('0x11')]);}else{logger[_0xc20d('0xc')]('SmsQueueReport,\x20%s,\x20%s',_0x3708ea,_0xc20d('0x12'));_0x211595(_0x61fbe4[_0xc20d('0x13')][_0xc20d('0x11')]);}})[_0xc20d('0x14')](function(_0x1d40a5){logger[_0xc20d('0xf')](_0xc20d('0x10'),_0x3708ea,_0x1d40a5);_0x1ad2c6(_0x1d40a5);});});}exports[_0xc20d('0x15')]=function(_0x1f7c19){var _0x2f8a0b=this;return new Promise(function(_0x4f07be,_0x56227c){return db[_0xc20d('0x16')][_0xc20d('0x17')](_0x1f7c19[_0xc20d('0x18')],{'raw':_0x1f7c19['options']?_0x1f7c19[_0xc20d('0x19')][_0xc20d('0x1a')]===undefined?!![]:![]:!![]})[_0xc20d('0xb')](function(_0x247d5c){logger[_0xc20d('0xc')](_0xc20d('0x15'),_0x1f7c19);logger[_0xc20d('0xd')](_0xc20d('0x15'),_0x1f7c19,JSON[_0xc20d('0x1b')](_0x247d5c));_0x4f07be(_0x247d5c);})[_0xc20d('0x14')](function(_0x33ddbe){logger[_0xc20d('0xf')](_0xc20d('0x15'),_0x33ddbe[_0xc20d('0x11')],_0x1f7c19);_0x56227c(_0x2f8a0b[_0xc20d('0xf')](0x1f4,_0x33ddbe[_0xc20d('0x11')]));});});};exports[_0xc20d('0x1c')]=function(_0x5640cd){var _0x4c296a=this;return new Promise(function(_0x43c71a,_0x10a356){return db[_0xc20d('0x16')][_0xc20d('0x1d')](_0x5640cd[_0xc20d('0x18')],{'raw':_0x5640cd['options']?_0x5640cd['options'][_0xc20d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5640cd[_0xc20d('0x19')]?_0x5640cd[_0xc20d('0x19')][_0xc20d('0x1e')]||null:null,'attributes':_0x5640cd[_0xc20d('0x19')]?_0x5640cd[_0xc20d('0x19')][_0xc20d('0x1f')]||null:null,'limit':_0x5640cd[_0xc20d('0x19')]?_0x5640cd[_0xc20d('0x19')][_0xc20d('0x20')]||null:null})[_0xc20d('0xb')](function(_0x476b27){logger['info'](_0xc20d('0x1c'),_0x5640cd);logger[_0xc20d('0xd')](_0xc20d('0x1c'),_0x5640cd,JSON[_0xc20d('0x1b')](_0x476b27));_0x43c71a(_0x476b27);})[_0xc20d('0x14')](function(_0x5b8528){logger[_0xc20d('0xf')](_0xc20d('0x1c'),_0x5b8528[_0xc20d('0x11')],_0x5640cd);_0x10a356(_0x4c296a[_0xc20d('0xf')](0x1f4,_0x5b8528[_0xc20d('0x11')]));});});}; \ No newline at end of file +var _0xcacd=['message','info','result','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','update','where','limit','then','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x14363e,_0x4f0e0d){var _0x17c56d=function(_0x1c7bac){while(--_0x1c7bac){_0x14363e['push'](_0x14363e['shift']());}};_0x17c56d(++_0x4f0e0d);}(_0xcacd,0x161));var _0xdcac=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xcacd[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xdcac('0x0'));var util=require(_0xdcac('0x1'));var moment=require(_0xdcac('0x2'));var BPromise=require(_0xdcac('0x3'));var rs=require(_0xdcac('0x4'));var fs=require('fs');var Redis=require(_0xdcac('0x5'));var db=require(_0xdcac('0x6'))['db'];var utils=require(_0xdcac('0x7'));var logger=require(_0xdcac('0x8'))(_0xdcac('0x9'));var config=require(_0xdcac('0xa'));var jayson=require(_0xdcac('0xb'));var client=jayson[_0xdcac('0xc')][_0xdcac('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x92f12b,_0x267db3,_0x428f9b){return new BPromise(function(_0x4dd00c,_0x2adff6){return client['request'](_0x92f12b,_0x428f9b)['then'](function(_0x5d40fa){logger['info'](_0xdcac('0xe'),_0x267db3,_0xdcac('0xf'));logger[_0xdcac('0x10')](_0xdcac('0x11'),_0x267db3,'request\x20sent',JSON[_0xdcac('0x12')](_0x5d40fa));if(_0x5d40fa[_0xdcac('0x13')]){if(_0x5d40fa[_0xdcac('0x13')][_0xdcac('0x14')]===0x1f4){logger[_0xdcac('0x13')](_0xdcac('0xe'),_0x267db3,_0x5d40fa[_0xdcac('0x13')]['message']);return _0x2adff6(_0x5d40fa[_0xdcac('0x13')][_0xdcac('0x15')]);}logger[_0xdcac('0x13')](_0xdcac('0xe'),_0x267db3,_0x5d40fa[_0xdcac('0x13')][_0xdcac('0x15')]);return _0x4dd00c(_0x5d40fa[_0xdcac('0x13')][_0xdcac('0x15')]);}else{logger[_0xdcac('0x16')](_0xdcac('0xe'),_0x267db3,_0xdcac('0xf'));_0x4dd00c(_0x5d40fa[_0xdcac('0x17')][_0xdcac('0x15')]);}})[_0xdcac('0x18')](function(_0x40f808){logger[_0xdcac('0x13')]('SmsQueueReport,\x20%s,\x20%s',_0x267db3,_0x40f808);_0x2adff6(_0x40f808);});});}exports[_0xdcac('0x19')]=function(_0x16a589){var _0x46fb24=this;return new Promise(function(_0x10b612,_0x52ff85){return db[_0xdcac('0x1a')]['create'](_0x16a589['body'],{'raw':_0x16a589[_0xdcac('0x1b')]?_0x16a589[_0xdcac('0x1b')][_0xdcac('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x47d321){logger['info'](_0xdcac('0x19'),_0x16a589);logger['debug'](_0xdcac('0x19'),_0x16a589,JSON[_0xdcac('0x12')](_0x47d321));_0x10b612(_0x47d321);})[_0xdcac('0x18')](function(_0x58642c){logger[_0xdcac('0x13')](_0xdcac('0x19'),_0x58642c[_0xdcac('0x15')],_0x16a589);_0x52ff85(_0x46fb24[_0xdcac('0x13')](0x1f4,_0x58642c[_0xdcac('0x15')]));});});};exports['UpdateSmsQueueReport']=function(_0x3daf8e){var _0x4a227=this;return new Promise(function(_0x505bc7,_0x447295){return db[_0xdcac('0x1a')][_0xdcac('0x1d')](_0x3daf8e['body'],{'raw':_0x3daf8e[_0xdcac('0x1b')]?_0x3daf8e[_0xdcac('0x1b')][_0xdcac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3daf8e['options']?_0x3daf8e[_0xdcac('0x1b')][_0xdcac('0x1e')]||null:null,'attributes':_0x3daf8e[_0xdcac('0x1b')]?_0x3daf8e[_0xdcac('0x1b')]['attributes']||null:null,'limit':_0x3daf8e[_0xdcac('0x1b')]?_0x3daf8e[_0xdcac('0x1b')][_0xdcac('0x1f')]||null:null})[_0xdcac('0x20')](function(_0x52ae3b){logger['info'](_0xdcac('0x21'),_0x3daf8e);logger[_0xdcac('0x10')](_0xdcac('0x21'),_0x3daf8e,JSON[_0xdcac('0x12')](_0x52ae3b));_0x505bc7(_0x52ae3b);})['catch'](function(_0x246709){logger[_0xdcac('0x13')](_0xdcac('0x21'),_0x246709[_0xdcac('0x15')],_0x3daf8e);_0x447295(_0x4a227[_0xdcac('0x13')](0x1f4,_0x246709[_0xdcac('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 4bb4183..20f87ab 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 _0x3937=['get','isAuthenticated','index','/describe','describe','show','post','create','delete','/:id','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3937,0xbf));var _0x7393=function(_0x14ed1f,_0x1739fb){_0x14ed1f=_0x14ed1f-0x0;var _0x575850=_0x3937[_0x14ed1f];return _0x575850;};'use strict';var multer=require(_0x7393('0x0'));var util=require('util');var path=require(_0x7393('0x1'));var timeout=require(_0x7393('0x2'));var express=require('express');var router=express[_0x7393('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x7393('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7393('0x5'));var controller=require(_0x7393('0x6'));router[_0x7393('0x7')]('/',auth[_0x7393('0x8')](),controller[_0x7393('0x9')]);router[_0x7393('0x7')](_0x7393('0xa'),auth[_0x7393('0x8')](),controller[_0x7393('0xb')]);router['get']('/:id',auth[_0x7393('0x8')](),controller[_0x7393('0xc')]);router[_0x7393('0xd')]('/',auth['isAuthenticated'](),controller[_0x7393('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x7393('0xf')](_0x7393('0x10'),auth[_0x7393('0x8')](),controller['destroy']);module[_0x7393('0x11')]=router; \ No newline at end of file +var _0xdf98=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','path','Router'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0xdf98,0xcf));var _0x8df9=function(_0x1b8f5a,_0x57c154){_0x1b8f5a=_0x1b8f5a-0x0;var _0x594189=_0xdf98[_0x1b8f5a];return _0x594189;};'use strict';var multer=require(_0x8df9('0x0'));var util=require('util');var path=require(_0x8df9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8df9('0x2')]();var fs_extra=require(_0x8df9('0x3'));var auth=require(_0x8df9('0x4'));var interaction=require(_0x8df9('0x5'));var config=require(_0x8df9('0x6'));var controller=require(_0x8df9('0x7'));router[_0x8df9('0x8')]('/',auth[_0x8df9('0x9')](),controller[_0x8df9('0xa')]);router['get'](_0x8df9('0xb'),auth[_0x8df9('0x9')](),controller[_0x8df9('0xc')]);router['get']('/:id',auth[_0x8df9('0x9')](),controller['show']);router[_0x8df9('0xd')]('/',auth[_0x8df9('0x9')](),controller[_0x8df9('0xe')]);router[_0x8df9('0xf')](_0x8df9('0x10'),auth[_0x8df9('0x9')](),controller[_0x8df9('0x11')]);router[_0x8df9('0x12')]('/:id',auth[_0x8df9('0x9')](),controller[_0x8df9('0x13')]);module[_0x8df9('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 c1f8ad7..b0a2365 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 _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x41071a,_0x3f2988){var _0xc4a6d9=function(_0x16d403){while(--_0x16d403){_0x41071a['push'](_0x41071a['shift']());}};_0xc4a6d9(++_0x3f2988);}(_0x70e0,0x17b));var _0x070e=function(_0x13e719,_0xd5639a){_0x13e719=_0x13e719-0x0;var _0x386195=_0x70e0[_0x13e719];return _0x386195;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xbd5881,_0x4918fd){var _0x5a8ea3=function(_0x4d2dac){while(--_0x4d2dac){_0xbd5881['push'](_0xbd5881['shift']());}};_0x5a8ea3(++_0x4918fd);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x41f6d4,_0x255693){_0x41f6d4=_0x41f6d4-0x0;var _0x42a2a9=_0xf3cd[_0x41f6d4];return _0x42a2a9;};'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/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index da3e412..5fd59c8 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 _0x7611=['eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','error','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe'];(function(_0x962fc5,_0x58f074){var _0x43667c=function(_0x5e6ec0){while(--_0x5e6ec0){_0x962fc5['push'](_0x962fc5['shift']());}};_0x43667c(++_0x58f074);}(_0x7611,0x8c));var _0x1761=function(_0x118c9c,_0x164505){_0x118c9c=_0x118c9c-0x0;var _0x108445=_0x7611[_0x118c9c];return _0x108445;};'use strict';var emlformat=require(_0x1761('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1761('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1761('0x2'));var moment=require(_0x1761('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1761('0x4'));var util=require(_0x1761('0x5'));var path=require('path');var sox=require(_0x1761('0x6'));var csv=require(_0x1761('0x7'));var ejs=require(_0x1761('0x8'));var fs=require('fs');var fs_extra=require(_0x1761('0x9'));var _=require(_0x1761('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1761('0x7'));var querystring=require(_0x1761('0xb'));var Papa=require('papaparse');var Redis=require(_0x1761('0xc'));var authService=require(_0x1761('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1761('0xe'));var hardwareService=require(_0x1761('0xf'));var logger=require(_0x1761('0x10'))('api');var utils=require(_0x1761('0x11'));var config=require(_0x1761('0x12'));var licenseUtil=require(_0x1761('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49aa,_0x54930d){_0x54930d=_0x54930d||0xcc;return function(_0x45b2e3){if(_0x45b2e3){return _0x49aa[_0x1761('0x14')](_0x54930d);}return _0x49aa[_0x1761('0x15')](_0x54930d)[_0x1761('0x16')]();};}function respondWithResult(_0x553999,_0x5ea23f){_0x5ea23f=_0x5ea23f||0xc8;return function(_0x3775d2){if(_0x3775d2){return _0x553999[_0x1761('0x15')](_0x5ea23f)[_0x1761('0x17')](_0x3775d2);}};}function respondWithFilteredResult(_0x47331a,_0x553b53){return function(_0x1d51c6){if(_0x1d51c6){var _0x237f25=typeof _0x553b53['offset']===_0x1761('0x18')&&typeof _0x553b53[_0x1761('0x19')]==='undefined';var _0x58b99c=_0x1d51c6[_0x1761('0x1a')];var _0x24fe57=_0x237f25?0x0:_0x553b53[_0x1761('0x1b')];var _0x215fe3=_0x237f25?_0x1d51c6[_0x1761('0x1a')]:_0x553b53[_0x1761('0x1b')]+_0x553b53[_0x1761('0x19')];var _0x319514;if(_0x215fe3>=_0x58b99c){_0x215fe3=_0x58b99c;_0x319514=0xc8;}else{_0x319514=0xce;}_0x47331a[_0x1761('0x15')](_0x319514);return _0x47331a[_0x1761('0x1c')](_0x1761('0x1d'),_0x24fe57+'-'+_0x215fe3+'/'+_0x58b99c)[_0x1761('0x17')](_0x1d51c6);}return null;};}function patchUpdates(_0x12444a){return function(_0x4e627e){try{jsonpatch['apply'](_0x4e627e,_0x12444a,!![]);}catch(_0x48e319){return BPromise[_0x1761('0x1e')](_0x48e319);}return _0x4e627e[_0x1761('0x1f')]();};}function saveUpdates(_0x1648c4,_0x384398){return function(_0x3d3267){if(_0x3d3267){return _0x3d3267[_0x1761('0x20')](_0x1648c4)[_0x1761('0x21')](function(_0x412496){return _0x412496;});}return null;};}function removeEntity(_0x507f4c,_0x4adbe1){return function(_0x2ef8f0){if(_0x2ef8f0){return _0x2ef8f0['destroy']()[_0x1761('0x21')](function(){_0x507f4c[_0x1761('0x15')](0xcc)[_0x1761('0x16')]();});}};}function handleEntityNotFound(_0x527dd8,_0x321c21){return function(_0x5e1c78){if(!_0x5e1c78){_0x527dd8['sendStatus'](0x194);}return _0x5e1c78;};}function handleError(_0x1f485d,_0x320fce){_0x320fce=_0x320fce||0x1f4;return function(_0x180f65){logger[_0x1761('0x22')](_0x180f65['stack']);if(_0x180f65['name']){delete _0x180f65[_0x1761('0x23')];}_0x1f485d[_0x1761('0x15')](_0x320fce)[_0x1761('0x24')](_0x180f65);};}exports[_0x1761('0x25')]=function(_0x32cbba,_0x5d8d9d){var _0x103d94={},_0x186c1a={},_0x39af04={'count':0x0,'rows':[]};var _0x3c57e4=_[_0x1761('0x26')](db[_0x1761('0x27')][_0x1761('0x28')],function(_0x42c044){return{'name':_0x42c044[_0x1761('0x29')],'type':_0x42c044[_0x1761('0x2a')][_0x1761('0x2b')]};});_0x186c1a[_0x1761('0x2c')]=_[_0x1761('0x26')](_0x3c57e4,_0x1761('0x23'));_0x186c1a[_0x1761('0x2d')]=_[_0x1761('0x2e')](_0x32cbba[_0x1761('0x2d')]);_0x186c1a[_0x1761('0x2f')]=_[_0x1761('0x30')](_0x186c1a[_0x1761('0x2c')],_0x186c1a['query']);_0x103d94['attributes']=_['intersection'](_0x186c1a['model'],qs[_0x1761('0x31')](_0x32cbba[_0x1761('0x2d')]['fields']));_0x103d94['attributes']=_0x103d94[_0x1761('0x32')]['length']?_0x103d94[_0x1761('0x32')]:_0x186c1a[_0x1761('0x2c')];if(!_0x32cbba['query']['hasOwnProperty']('nolimit')){_0x103d94[_0x1761('0x19')]=qs[_0x1761('0x19')](_0x32cbba[_0x1761('0x2d')][_0x1761('0x19')]);_0x103d94[_0x1761('0x1b')]=qs[_0x1761('0x1b')](_0x32cbba[_0x1761('0x2d')]['offset']);}_0x103d94['order']=qs['sort'](_0x32cbba[_0x1761('0x2d')][_0x1761('0x33')]);_0x103d94[_0x1761('0x34')]=qs[_0x1761('0x2f')](_[_0x1761('0x35')](_0x32cbba['query'],_0x186c1a[_0x1761('0x2f')]),_0x3c57e4);if(_0x32cbba['query']['filter']){_0x103d94[_0x1761('0x34')]=_['merge'](_0x103d94['where'],{'$or':_['map'](_0x3c57e4,function(_0x5ebd54){if(_0x5ebd54[_0x1761('0x2a')]!==_0x1761('0x36')){var _0x558e1f={};_0x558e1f[_0x5ebd54[_0x1761('0x23')]]={'$like':'%'+_0x32cbba[_0x1761('0x2d')][_0x1761('0x37')]+'%'};return _0x558e1f;}})});}_0x103d94=_[_0x1761('0x38')]({},_0x103d94,_0x32cbba[_0x1761('0x39')]);var _0x4ab46b={'where':_0x103d94[_0x1761('0x34')]};return db['SmsTransferReport'][_0x1761('0x1a')](_0x4ab46b)[_0x1761('0x21')](function(_0x529406){_0x39af04[_0x1761('0x1a')]=_0x529406;if(_0x32cbba['query'][_0x1761('0x3a')]){_0x103d94[_0x1761('0x3b')]=[{'all':!![]}];}return db['SmsTransferReport'][_0x1761('0x3c')](_0x103d94);})['then'](function(_0x1277be){_0x39af04[_0x1761('0x3d')]=_0x1277be;return _0x39af04;})[_0x1761('0x21')](respondWithFilteredResult(_0x5d8d9d,_0x103d94))[_0x1761('0x3e')](handleError(_0x5d8d9d,null));};exports[_0x1761('0x3f')]=function(_0x6b0101,_0x592168){var _0x3f84aa={'raw':!![],'where':{'id':_0x6b0101[_0x1761('0x40')]['id']}},_0x535722={};_0x535722[_0x1761('0x2c')]=_[_0x1761('0x2e')](db['SmsTransferReport'][_0x1761('0x28')]);_0x535722[_0x1761('0x2d')]=_[_0x1761('0x2e')](_0x6b0101[_0x1761('0x2d')]);_0x535722[_0x1761('0x2f')]=_[_0x1761('0x30')](_0x535722[_0x1761('0x2c')],_0x535722[_0x1761('0x2d')]);_0x3f84aa[_0x1761('0x32')]=_[_0x1761('0x30')](_0x535722[_0x1761('0x2c')],qs[_0x1761('0x31')](_0x6b0101[_0x1761('0x2d')]['fields']));_0x3f84aa[_0x1761('0x32')]=_0x3f84aa[_0x1761('0x32')][_0x1761('0x41')]?_0x3f84aa[_0x1761('0x32')]:_0x535722[_0x1761('0x2c')];if(_0x6b0101[_0x1761('0x2d')]['includeAll']){_0x3f84aa[_0x1761('0x3b')]=[{'all':!![]}];}_0x3f84aa=_[_0x1761('0x38')]({},_0x3f84aa,_0x6b0101[_0x1761('0x39')]);return db[_0x1761('0x27')][_0x1761('0x42')](_0x3f84aa)[_0x1761('0x21')](handleEntityNotFound(_0x592168,null))[_0x1761('0x21')](respondWithResult(_0x592168,null))[_0x1761('0x3e')](handleError(_0x592168,null));};exports[_0x1761('0x43')]=function(_0x1f9d0a,_0xf998f5){return db[_0x1761('0x27')][_0x1761('0x43')](_0x1f9d0a[_0x1761('0x44')],{})[_0x1761('0x21')](respondWithResult(_0xf998f5,0xc9))[_0x1761('0x3e')](handleError(_0xf998f5,null));};exports[_0x1761('0x20')]=function(_0x592f0c,_0x45f02e){if(_0x592f0c[_0x1761('0x44')]['id']){delete _0x592f0c[_0x1761('0x44')]['id'];}return db[_0x1761('0x27')]['find']({'where':{'id':_0x592f0c['params']['id']}})['then'](handleEntityNotFound(_0x45f02e,null))['then'](saveUpdates(_0x592f0c[_0x1761('0x44')],null))[_0x1761('0x21')](respondWithResult(_0x45f02e,null))[_0x1761('0x3e')](handleError(_0x45f02e,null));};exports['destroy']=function(_0x1b6577,_0x21d5e5){return db[_0x1761('0x27')][_0x1761('0x42')]({'where':{'id':_0x1b6577[_0x1761('0x40')]['id']}})[_0x1761('0x21')](handleEntityNotFound(_0x21d5e5,null))[_0x1761('0x21')](removeEntity(_0x21d5e5,null))[_0x1761('0x3e')](handleError(_0x21d5e5,null));};exports[_0x1761('0x45')]=function(_0x2fc57c,_0x3eece5){return db['SmsTransferReport']['describe']()[_0x1761('0x21')](respondWithResult(_0x3eece5,null))[_0x1761('0x3e')](handleError(_0x3eece5,null));}; \ No newline at end of file +var _0x6f36=['undefined','count','set','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','VIRTUAL','options','includeAll','include','rows','show','params','keys','merge','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset'];(function(_0x5a4b16,_0x294bb1){var _0x5236dc=function(_0x33e049){while(--_0x33e049){_0x5a4b16['push'](_0x5a4b16['shift']());}};_0x5236dc(++_0x294bb1);}(_0x6f36,0x1f3));var _0x66f3=function(_0x4e1bff,_0x165340){_0x4e1bff=_0x4e1bff-0x0;var _0x2570f1=_0x6f36[_0x4e1bff];return _0x2570f1;};'use strict';var emlformat=require(_0x66f3('0x0'));var rimraf=require(_0x66f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66f3('0x2'));var rp=require(_0x66f3('0x3'));var moment=require(_0x66f3('0x4'));var BPromise=require(_0x66f3('0x5'));var Mustache=require('mustache');var util=require(_0x66f3('0x6'));var path=require(_0x66f3('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x66f3('0x8'));var _=require(_0x66f3('0x9'));var squel=require(_0x66f3('0xa'));var crypto=require('crypto');var jsforce=require(_0x66f3('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x66f3('0xc'));var querystring=require(_0x66f3('0xd'));var Papa=require(_0x66f3('0xe'));var Redis=require(_0x66f3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x66f3('0x10'));var hardwareService=require(_0x66f3('0x11'));var logger=require(_0x66f3('0x12'))(_0x66f3('0x13'));var utils=require(_0x66f3('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x66f3('0x15'))['db'];function respondWithStatusCode(_0x35dfd8,_0x493e9e){_0x493e9e=_0x493e9e||0xcc;return function(_0x143cfb){if(_0x143cfb){return _0x35dfd8[_0x66f3('0x16')](_0x493e9e);}return _0x35dfd8[_0x66f3('0x17')](_0x493e9e)['end']();};}function respondWithResult(_0x4d731a,_0x1e20b2){_0x1e20b2=_0x1e20b2||0xc8;return function(_0x7f7db0){if(_0x7f7db0){return _0x4d731a[_0x66f3('0x17')](_0x1e20b2)[_0x66f3('0x18')](_0x7f7db0);}};}function respondWithFilteredResult(_0x4fbf5f,_0x1cd03b){return function(_0x38cbe6){if(_0x38cbe6){var _0x3a7a61=typeof _0x1cd03b[_0x66f3('0x19')]==='undefined'&&typeof _0x1cd03b['limit']===_0x66f3('0x1a');var _0x34d1e5=_0x38cbe6[_0x66f3('0x1b')];var _0x56422e=_0x3a7a61?0x0:_0x1cd03b[_0x66f3('0x19')];var _0x20bbb8=_0x3a7a61?_0x38cbe6[_0x66f3('0x1b')]:_0x1cd03b[_0x66f3('0x19')]+_0x1cd03b['limit'];var _0x46f9df;if(_0x20bbb8>=_0x34d1e5){_0x20bbb8=_0x34d1e5;_0x46f9df=0xc8;}else{_0x46f9df=0xce;}_0x4fbf5f['status'](_0x46f9df);return _0x4fbf5f[_0x66f3('0x1c')](_0x66f3('0x1d'),_0x56422e+'-'+_0x20bbb8+'/'+_0x34d1e5)[_0x66f3('0x18')](_0x38cbe6);}return null;};}function patchUpdates(_0x53baa9){return function(_0xefcdf9){try{jsonpatch[_0x66f3('0x1e')](_0xefcdf9,_0x53baa9,!![]);}catch(_0x31c429){return BPromise[_0x66f3('0x1f')](_0x31c429);}return _0xefcdf9[_0x66f3('0x20')]();};}function saveUpdates(_0x2327b5,_0x512285){return function(_0x1d02cc){if(_0x1d02cc){return _0x1d02cc['update'](_0x2327b5)['then'](function(_0x4127a1){return _0x4127a1;});}return null;};}function removeEntity(_0x563f9e,_0x4481fc){return function(_0x2631f6){if(_0x2631f6){return _0x2631f6[_0x66f3('0x21')]()[_0x66f3('0x22')](function(){_0x563f9e[_0x66f3('0x17')](0xcc)[_0x66f3('0x23')]();});}};}function handleEntityNotFound(_0x224e81,_0x31731){return function(_0x3dcb8f){if(!_0x3dcb8f){_0x224e81[_0x66f3('0x16')](0x194);}return _0x3dcb8f;};}function handleError(_0x2fa23d,_0x2f95c6){_0x2f95c6=_0x2f95c6||0x1f4;return function(_0x362d51){logger[_0x66f3('0x24')](_0x362d51[_0x66f3('0x25')]);if(_0x362d51[_0x66f3('0x26')]){delete _0x362d51['name'];}_0x2fa23d['status'](_0x2f95c6)[_0x66f3('0x27')](_0x362d51);};}exports['index']=function(_0x9a98e8,_0x4df4de){var _0x1cce5a={},_0x58f4f9={},_0x5ddb03={'count':0x0,'rows':[]};var _0x37e5d0=_[_0x66f3('0x28')](db[_0x66f3('0x29')][_0x66f3('0x2a')],function(_0x54c690){return{'name':_0x54c690[_0x66f3('0x2b')],'type':_0x54c690[_0x66f3('0x2c')][_0x66f3('0x2d')]};});_0x58f4f9[_0x66f3('0x2e')]=_[_0x66f3('0x28')](_0x37e5d0,_0x66f3('0x26'));_0x58f4f9[_0x66f3('0x2f')]=_['keys'](_0x9a98e8['query']);_0x58f4f9[_0x66f3('0x30')]=_[_0x66f3('0x31')](_0x58f4f9[_0x66f3('0x2e')],_0x58f4f9[_0x66f3('0x2f')]);_0x1cce5a[_0x66f3('0x32')]=_[_0x66f3('0x31')](_0x58f4f9[_0x66f3('0x2e')],qs['fields'](_0x9a98e8[_0x66f3('0x2f')][_0x66f3('0x33')]));_0x1cce5a[_0x66f3('0x32')]=_0x1cce5a[_0x66f3('0x32')][_0x66f3('0x34')]?_0x1cce5a[_0x66f3('0x32')]:_0x58f4f9[_0x66f3('0x2e')];if(!_0x9a98e8[_0x66f3('0x2f')][_0x66f3('0x35')](_0x66f3('0x36'))){_0x1cce5a[_0x66f3('0x37')]=qs[_0x66f3('0x37')](_0x9a98e8[_0x66f3('0x2f')]['limit']);_0x1cce5a[_0x66f3('0x19')]=qs['offset'](_0x9a98e8[_0x66f3('0x2f')][_0x66f3('0x19')]);}_0x1cce5a[_0x66f3('0x38')]=qs[_0x66f3('0x39')](_0x9a98e8['query'][_0x66f3('0x39')]);_0x1cce5a[_0x66f3('0x3a')]=qs[_0x66f3('0x30')](_['pick'](_0x9a98e8[_0x66f3('0x2f')],_0x58f4f9['filters']),_0x37e5d0);if(_0x9a98e8[_0x66f3('0x2f')][_0x66f3('0x3b')]){_0x1cce5a[_0x66f3('0x3a')]=_['merge'](_0x1cce5a[_0x66f3('0x3a')],{'$or':_['map'](_0x37e5d0,function(_0x123e5c){if(_0x123e5c[_0x66f3('0x2c')]!==_0x66f3('0x3c')){var _0x36ceb8={};_0x36ceb8[_0x123e5c[_0x66f3('0x26')]]={'$like':'%'+_0x9a98e8[_0x66f3('0x2f')][_0x66f3('0x3b')]+'%'};return _0x36ceb8;}})});}_0x1cce5a=_['merge']({},_0x1cce5a,_0x9a98e8[_0x66f3('0x3d')]);var _0x4e5488={'where':_0x1cce5a[_0x66f3('0x3a')]};return db['SmsTransferReport']['count'](_0x4e5488)[_0x66f3('0x22')](function(_0x755887){_0x5ddb03['count']=_0x755887;if(_0x9a98e8['query'][_0x66f3('0x3e')]){_0x1cce5a[_0x66f3('0x3f')]=[{'all':!![]}];}return db[_0x66f3('0x29')]['findAll'](_0x1cce5a);})[_0x66f3('0x22')](function(_0x2133bf){_0x5ddb03[_0x66f3('0x40')]=_0x2133bf;return _0x5ddb03;})[_0x66f3('0x22')](respondWithFilteredResult(_0x4df4de,_0x1cce5a))['catch'](handleError(_0x4df4de,null));};exports[_0x66f3('0x41')]=function(_0x350b0d,_0x23ba7f){var _0x22b874={'raw':!![],'where':{'id':_0x350b0d[_0x66f3('0x42')]['id']}},_0x4b078a={};_0x4b078a[_0x66f3('0x2e')]=_[_0x66f3('0x43')](db[_0x66f3('0x29')][_0x66f3('0x2a')]);_0x4b078a['query']=_[_0x66f3('0x43')](_0x350b0d[_0x66f3('0x2f')]);_0x4b078a['filters']=_[_0x66f3('0x31')](_0x4b078a[_0x66f3('0x2e')],_0x4b078a[_0x66f3('0x2f')]);_0x22b874[_0x66f3('0x32')]=_[_0x66f3('0x31')](_0x4b078a[_0x66f3('0x2e')],qs[_0x66f3('0x33')](_0x350b0d[_0x66f3('0x2f')][_0x66f3('0x33')]));_0x22b874['attributes']=_0x22b874[_0x66f3('0x32')][_0x66f3('0x34')]?_0x22b874[_0x66f3('0x32')]:_0x4b078a[_0x66f3('0x2e')];if(_0x350b0d[_0x66f3('0x2f')][_0x66f3('0x3e')]){_0x22b874[_0x66f3('0x3f')]=[{'all':!![]}];}_0x22b874=_[_0x66f3('0x44')]({},_0x22b874,_0x350b0d[_0x66f3('0x3d')]);return db['SmsTransferReport'][_0x66f3('0x45')](_0x22b874)[_0x66f3('0x22')](handleEntityNotFound(_0x23ba7f,null))['then'](respondWithResult(_0x23ba7f,null))[_0x66f3('0x46')](handleError(_0x23ba7f,null));};exports['create']=function(_0x4e2bb9,_0x2f71e9){return db[_0x66f3('0x29')][_0x66f3('0x47')](_0x4e2bb9[_0x66f3('0x48')],{})[_0x66f3('0x22')](respondWithResult(_0x2f71e9,0xc9))[_0x66f3('0x46')](handleError(_0x2f71e9,null));};exports[_0x66f3('0x49')]=function(_0x104a01,_0x375072){if(_0x104a01[_0x66f3('0x48')]['id']){delete _0x104a01['body']['id'];}return db[_0x66f3('0x29')][_0x66f3('0x45')]({'where':{'id':_0x104a01[_0x66f3('0x42')]['id']}})['then'](handleEntityNotFound(_0x375072,null))[_0x66f3('0x22')](saveUpdates(_0x104a01[_0x66f3('0x48')],null))['then'](respondWithResult(_0x375072,null))[_0x66f3('0x46')](handleError(_0x375072,null));};exports[_0x66f3('0x21')]=function(_0x38b49b,_0x2afb64){return db[_0x66f3('0x29')][_0x66f3('0x45')]({'where':{'id':_0x38b49b['params']['id']}})[_0x66f3('0x22')](handleEntityNotFound(_0x2afb64,null))[_0x66f3('0x22')](removeEntity(_0x2afb64,null))['catch'](handleError(_0x2afb64,null));};exports[_0x66f3('0x4a')]=function(_0x17e37b,_0x5cae46){return db[_0x66f3('0x29')]['describe']()['then'](respondWithResult(_0x5cae46,null))['catch'](handleError(_0x5cae46,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index d058acb..27b6b44 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 _0xf12f=['bluebird','request-promise','path','rimraf','./smsTransferReport.attributes','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x4c26e2,_0x38f788){var _0x44e470=function(_0x3fc0e3){while(--_0x3fc0e3){_0x4c26e2['push'](_0x4c26e2['shift']());}};_0x44e470(++_0x38f788);}(_0xf12f,0x1bb));var _0xff12=function(_0x5a281f,_0x413703){_0x5a281f=_0x5a281f-0x0;var _0xd97fbc=_0xf12f[_0x5a281f];return _0xd97fbc;};'use strict';var _=require(_0xff12('0x0'));var util=require(_0xff12('0x1'));var logger=require(_0xff12('0x2'))(_0xff12('0x3'));var moment=require(_0xff12('0x4'));var BPromise=require(_0xff12('0x5'));var rp=require(_0xff12('0x6'));var fs=require('fs');var path=require(_0xff12('0x7'));var rimraf=require(_0xff12('0x8'));var config=require('../../config/environment');var attributes=require(_0xff12('0x9'));module['exports']=function(_0x37a286,_0x271e49){return _0x37a286[_0xff12('0xa')](_0xff12('0xb'),attributes,{'tableName':_0xff12('0xc'),'paranoid':![],'indexes':[{'name':_0xff12('0xd'),'fields':[_0xff12('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbfa4=['path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash','api'];(function(_0x2704be,_0x2555d4){var _0x21d7b5=function(_0x5f2a1b){while(--_0x5f2a1b){_0x2704be['push'](_0x2704be['shift']());}};_0x21d7b5(++_0x2555d4);}(_0xbfa4,0x106));var _0x4bfa=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0xbfa4[_0x587fb5];return _0x551105;};'use strict';var _=require(_0x4bfa('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x4bfa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4bfa('0x2'));var rimraf=require(_0x4bfa('0x3'));var config=require(_0x4bfa('0x4'));var attributes=require(_0x4bfa('0x5'));module[_0x4bfa('0x6')]=function(_0x1ba9fe,_0x55eb98){return _0x1ba9fe[_0x4bfa('0x7')](_0x4bfa('0x8'),attributes,{'tableName':_0x4bfa('0x9'),'paranoid':![],'indexes':[{'name':_0x4bfa('0xa'),'fields':[_0x4bfa('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index d543d1c..38f6c99 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 _0x5c91=['code','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5c91,0x1e9));var _0x15c9=function(_0x2f6ae0,_0x1473a5){_0x2f6ae0=_0x2f6ae0-0x0;var _0x1ec3b7=_0x5c91[_0x2f6ae0];return _0x1ec3b7;};'use strict';var _=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var moment=require(_0x15c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x15c9('0x3'));var fs=require('fs');var Redis=require(_0x15c9('0x4'));var db=require(_0x15c9('0x5'))['db'];var utils=require(_0x15c9('0x6'));var logger=require(_0x15c9('0x7'))(_0x15c9('0x8'));var config=require('../../config/environment');var jayson=require(_0x15c9('0x9'));var client=jayson[_0x15c9('0xa')][_0x15c9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42bcb6,_0x2c213e,_0x51a779){return new BPromise(function(_0x191695,_0x114775){return client[_0x15c9('0xc')](_0x42bcb6,_0x51a779)['then'](function(_0x23adaf){logger[_0x15c9('0xd')](_0x15c9('0xe'),_0x2c213e,'request\x20sent');logger['debug'](_0x15c9('0xf'),_0x2c213e,_0x15c9('0x10'),JSON['stringify'](_0x23adaf));if(_0x23adaf['error']){if(_0x23adaf['error'][_0x15c9('0x11')]===0x1f4){logger[_0x15c9('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x2c213e,_0x23adaf[_0x15c9('0x12')][_0x15c9('0x13')]);return _0x114775(_0x23adaf[_0x15c9('0x12')]['message']);}logger['error'](_0x15c9('0xe'),_0x2c213e,_0x23adaf[_0x15c9('0x12')]['message']);return _0x191695(_0x23adaf[_0x15c9('0x12')]['message']);}else{logger[_0x15c9('0xd')](_0x15c9('0xe'),_0x2c213e,_0x15c9('0x10'));_0x191695(_0x23adaf[_0x15c9('0x14')][_0x15c9('0x13')]);}})[_0x15c9('0x15')](function(_0x5eb50e){logger[_0x15c9('0x12')](_0x15c9('0xe'),_0x2c213e,_0x5eb50e);_0x114775(_0x5eb50e);});});} \ No newline at end of file +var _0x782e=['request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s'];(function(_0x417386,_0x190fa8){var _0x1a2c64=function(_0x273a7c){while(--_0x273a7c){_0x417386['push'](_0x417386['shift']());}};_0x1a2c64(++_0x190fa8);}(_0x782e,0xb9));var _0xe782=function(_0x281c12,_0x1a2fb4){_0x281c12=_0x281c12-0x0;var _0x37a19e=_0x782e[_0x281c12];return _0x37a19e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe782('0x0'));var BPromise=require(_0xe782('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe782('0x2'));var db=require(_0xe782('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe782('0x4'))(_0xe782('0x5'));var config=require(_0xe782('0x6'));var jayson=require(_0xe782('0x7'));var client=jayson['client'][_0xe782('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a0cf3,_0x4c1bb7,_0x1029b0){return new BPromise(function(_0x4c6dd1,_0x2f1640){return client[_0xe782('0x9')](_0x4a0cf3,_0x1029b0)[_0xe782('0xa')](function(_0x381a36){logger[_0xe782('0xb')](_0xe782('0xc'),_0x4c1bb7,_0xe782('0xd'));logger[_0xe782('0xe')](_0xe782('0xf'),_0x4c1bb7,_0xe782('0xd'),JSON[_0xe782('0x10')](_0x381a36));if(_0x381a36[_0xe782('0x11')]){if(_0x381a36[_0xe782('0x11')][_0xe782('0x12')]===0x1f4){logger['error'](_0xe782('0xc'),_0x4c1bb7,_0x381a36['error'][_0xe782('0x13')]);return _0x2f1640(_0x381a36[_0xe782('0x11')][_0xe782('0x13')]);}logger[_0xe782('0x11')](_0xe782('0xc'),_0x4c1bb7,_0x381a36[_0xe782('0x11')]['message']);return _0x4c6dd1(_0x381a36['error']['message']);}else{logger[_0xe782('0xb')](_0xe782('0xc'),_0x4c1bb7,'request\x20sent');_0x4c6dd1(_0x381a36[_0xe782('0x14')][_0xe782('0x13')]);}})[_0xe782('0x15')](function(_0x1a7c8e){logger[_0xe782('0x11')](_0xe782('0xc'),_0x4c1bb7,_0x1a7c8e);_0x2f1640(_0x1a7c8e);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index e4033a1..8677d09 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 _0x7c81=['replace','%s-%s%s','extname','post','single','file','create','put','delete','/:id','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname'];(function(_0x42b2cb,_0x5008b6){var _0x2b054d=function(_0x31ca29){while(--_0x31ca29){_0x42b2cb['push'](_0x42b2cb['shift']());}};_0x2b054d(++_0x5008b6);}(_0x7c81,0xdd));var _0x17c8=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0x7c81[_0x1b1a3b];return _0x385347;};'use strict';var multer=require(_0x17c8('0x0'));var util=require('util');var path=require(_0x17c8('0x1'));var timeout=require(_0x17c8('0x2'));var express=require(_0x17c8('0x3'));var router=express['Router']();var fs_extra=require(_0x17c8('0x4'));var auth=require(_0x17c8('0x5'));var interaction=require(_0x17c8('0x6'));var config=require(_0x17c8('0x7'));var controller=require(_0x17c8('0x8'));router[_0x17c8('0x9')]('/',auth[_0x17c8('0xa')](),controller[_0x17c8('0xb')]);router[_0x17c8('0x9')]('/:id',auth[_0x17c8('0xa')](),controller[_0x17c8('0xc')]);router[_0x17c8('0x9')](_0x17c8('0xd'),auth[_0x17c8('0xa')](),controller[_0x17c8('0xe')]);var upload=multer({'storage':multer[_0x17c8('0xf')]({'destination':function(_0x57325f,_0x118dd9,_0x2665c1){_0x2665c1(null,path[_0x17c8('0x10')](config['root'],_0x17c8('0x11')));},'filename':function(_0x59cc40,_0x11cb80,_0x44c4c2){_0x11cb80[_0x17c8('0x12')]=_0x11cb80[_0x17c8('0x12')][_0x17c8('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x44c4c2(null,util['format'](_0x17c8('0x14'),path['basename'](_0x11cb80[_0x17c8('0x12')],path[_0x17c8('0x15')](_0x11cb80[_0x17c8('0x12')])),Date['now'](),path['extname'](_0x11cb80[_0x17c8('0x12')])));}})});router[_0x17c8('0x16')]('/',upload[_0x17c8('0x17')](_0x17c8('0x18')),controller[_0x17c8('0x19')]);router[_0x17c8('0x1a')]('/:id',auth[_0x17c8('0xa')](),controller['update']);router[_0x17c8('0x1b')](_0x17c8('0x1c'),auth[_0x17c8('0xa')](),controller['delete']);module[_0x17c8('0x1d')]=router; \ No newline at end of file +var _0xbfe0=['diskStorage','join','root','server/files/sounds/original/','originalname','%s-%s%s','basename','now','extname','post','single','file','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xbfe0,0x110));var _0x0bfe=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xbfe0[_0x297fd3];return _0x2af381;};'use strict';var multer=require(_0x0bfe('0x0'));var util=require(_0x0bfe('0x1'));var path=require(_0x0bfe('0x2'));var timeout=require(_0x0bfe('0x3'));var express=require(_0x0bfe('0x4'));var router=express[_0x0bfe('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0bfe('0x6'));var interaction=require(_0x0bfe('0x7'));var config=require(_0x0bfe('0x8'));var controller=require(_0x0bfe('0x9'));router[_0x0bfe('0xa')]('/',auth[_0x0bfe('0xb')](),controller[_0x0bfe('0xc')]);router[_0x0bfe('0xa')](_0x0bfe('0xd'),auth[_0x0bfe('0xb')](),controller[_0x0bfe('0xe')]);router[_0x0bfe('0xa')]('/:id/download',auth[_0x0bfe('0xb')](),controller[_0x0bfe('0xf')]);var upload=multer({'storage':multer[_0x0bfe('0x10')]({'destination':function(_0x5f416f,_0xd54448,_0x240eea){_0x240eea(null,path[_0x0bfe('0x11')](config[_0x0bfe('0x12')],_0x0bfe('0x13')));},'filename':function(_0x4cbb6f,_0x32055,_0x2094a9){_0x32055['originalname']=_0x32055[_0x0bfe('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2094a9(null,util['format'](_0x0bfe('0x15'),path[_0x0bfe('0x16')](_0x32055[_0x0bfe('0x14')],path['extname'](_0x32055['originalname'])),Date[_0x0bfe('0x17')](),path[_0x0bfe('0x18')](_0x32055['originalname'])));}})});router[_0x0bfe('0x19')]('/',upload[_0x0bfe('0x1a')](_0x0bfe('0x1b')),controller[_0x0bfe('0x1c')]);router['put'](_0x0bfe('0xd'),auth[_0x0bfe('0xb')](),controller[_0x0bfe('0x1d')]);router[_0x0bfe('0x1e')](_0x0bfe('0xd'),auth[_0x0bfe('0xb')](),controller[_0x0bfe('0x1e')]);module[_0x0bfe('0x1f')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 859f250..9c1e3fb 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 _0x9517=['exports','STRING','name','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x3eff4a,_0x409014){var _0x2b68d9=function(_0x14e638){while(--_0x14e638){_0x3eff4a['push'](_0x3eff4a['shift']());}};_0x2b68d9(++_0x409014);}(_0x9517,0x109));var _0x7951=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9517[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x7951('0x0'));module[_0x7951('0x1')]={'name':{'type':Sequelize[_0x7951('0x2')],'unique':_0x7951('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x7951('0x2')]},'display_name':{'type':Sequelize[_0x7951('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0x7951('0x2')]},'original_format':{'type':Sequelize[_0x7951('0x2')]},'original_duration':{'type':Sequelize[_0x7951('0x4')]},'original_sampleCount':{'type':Sequelize[_0x7951('0x5')]},'original_channelCount':{'type':Sequelize[_0x7951('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x7951('0x5')]},'converted_channelCount':{'type':Sequelize[_0x7951('0x6')]},'converted_bitRate':{'type':Sequelize[_0x7951('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x7951('0x6')]}}; \ No newline at end of file +var _0x423e=['FLOAT','BIGINT','INTEGER','exports','name','STRING'];(function(_0x149b25,_0x2bb415){var _0x40b742=function(_0x103584){while(--_0x103584){_0x149b25['push'](_0x149b25['shift']());}};_0x40b742(++_0x2bb415);}(_0x423e,0x123));var _0xe423=function(_0x2a6490,_0x1adf0f){_0x2a6490=_0x2a6490-0x0;var _0x1b31df=_0x423e[_0x2a6490];return _0x1b31df;};'use strict';var Sequelize=require('sequelize');module[_0xe423('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xe423('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0xe423('0x2')]},'display_name':{'type':Sequelize[_0xe423('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xe423('0x2')]},'original_format':{'type':Sequelize[_0xe423('0x2')]},'original_duration':{'type':Sequelize[_0xe423('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xe423('0x4')]},'original_sampleRate':{'type':Sequelize[_0xe423('0x5')]},'converted_format':{'type':Sequelize[_0xe423('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xe423('0x4')]},'converted_channelCount':{'type':Sequelize[_0xe423('0x5')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xe423('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 22a8c75..7451061 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 _0xf1fb=['sampleRate','dest','converted_duration','converted_channelCount','bitRate','converted_sampleRate','chmodSync','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','Sounds','autoAssociation','start','pick','description','delete','original_format','end','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','UserProfileResource','sendStatus','name','send','Sound','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','save_name','converted_format','root','Sequelize','ValidationError','download','join','format','%s.%s','create','basename','file','originalname','extname','filename','substring','server/files/sounds/original','server/files/sounds/converted','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','transcode','error','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_sampleRate'];(function(_0x26af41,_0x2657d3){var _0x28c017=function(_0x3a82d7){while(--_0x3a82d7){_0x26af41['push'](_0x26af41['shift']());}};_0x28c017(++_0x2657d3);}(_0xf1fb,0x96));var _0xbf1f=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xf1fb[_0x500419];return _0x241c1a;};'use strict';var emlformat=require(_0xbf1f('0x0'));var rimraf=require(_0xbf1f('0x1'));var zipdir=require(_0xbf1f('0x2'));var jsonpatch=require(_0xbf1f('0x3'));var rp=require(_0xbf1f('0x4'));var moment=require('moment');var BPromise=require(_0xbf1f('0x5'));var Mustache=require(_0xbf1f('0x6'));var util=require(_0xbf1f('0x7'));var path=require('path');var sox=require(_0xbf1f('0x8'));var csv=require(_0xbf1f('0x9'));var ejs=require(_0xbf1f('0xa'));var fs=require('fs');var fs_extra=require(_0xbf1f('0xb'));var _=require(_0xbf1f('0xc'));var squel=require(_0xbf1f('0xd'));var crypto=require(_0xbf1f('0xe'));var jsforce=require(_0xbf1f('0xf'));var deskjs=require(_0xbf1f('0x10'));var toCsv=require('to-csv');var querystring=require(_0xbf1f('0x11'));var Papa=require(_0xbf1f('0x12'));var Redis=require(_0xbf1f('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xbf1f('0x14'));var as=require(_0xbf1f('0x15'));var hardwareService=require(_0xbf1f('0x16'));var logger=require(_0xbf1f('0x17'))('api');var utils=require(_0xbf1f('0x18'));var config=require(_0xbf1f('0x19'));var licenseUtil=require(_0xbf1f('0x1a'));var db=require(_0xbf1f('0x1b'))['db'];function respondWithStatusCode(_0x361bdc,_0x370d49){_0x370d49=_0x370d49||0xcc;return function(_0x2a36fa){if(_0x2a36fa){return _0x361bdc['sendStatus'](_0x370d49);}return _0x361bdc[_0xbf1f('0x1c')](_0x370d49)['end']();};}function respondWithResult(_0x41f877,_0x545224){_0x545224=_0x545224||0xc8;return function(_0x39c8ba){if(_0x39c8ba){return _0x41f877[_0xbf1f('0x1c')](_0x545224)[_0xbf1f('0x1d')](_0x39c8ba);}};}function respondWithFilteredResult(_0x5a9ed8,_0x49b78f){return function(_0x1bf369){if(_0x1bf369){var _0x101823=typeof _0x49b78f[_0xbf1f('0x1e')]===_0xbf1f('0x1f')&&typeof _0x49b78f[_0xbf1f('0x20')]===_0xbf1f('0x1f');var _0x6ca68=_0x1bf369[_0xbf1f('0x21')];var _0x11198b=_0x101823?0x0:_0x49b78f['offset'];var _0x53fd3d=_0x101823?_0x1bf369[_0xbf1f('0x21')]:_0x49b78f[_0xbf1f('0x1e')]+_0x49b78f[_0xbf1f('0x20')];var _0x10b288;if(_0x53fd3d>=_0x6ca68){_0x53fd3d=_0x6ca68;_0x10b288=0xc8;}else{_0x10b288=0xce;}_0x5a9ed8[_0xbf1f('0x1c')](_0x10b288);return _0x5a9ed8['set'](_0xbf1f('0x22'),_0x11198b+'-'+_0x53fd3d+'/'+_0x6ca68)[_0xbf1f('0x1d')](_0x1bf369);}return null;};}function patchUpdates(_0x31a557){return function(_0x234aea){try{jsonpatch[_0xbf1f('0x23')](_0x234aea,_0x31a557,!![]);}catch(_0x3b0ced){return BPromise['reject'](_0x3b0ced);}return _0x234aea[_0xbf1f('0x24')]();};}function saveUpdates(_0x3e4a74,_0x13f02a){return function(_0x22cf36){if(_0x22cf36){return _0x22cf36[_0xbf1f('0x25')](_0x3e4a74)['then'](function(_0x5d1eb9){return _0x5d1eb9;});}return null;};}function removeEntity(_0x531c8a,_0xfac0c6){return function(_0x32766f){if(_0x32766f){return _0x32766f[_0xbf1f('0x26')]()[_0xbf1f('0x27')](function(){var _0x4d30fe=_0x32766f['get']({'plain':!![]});var _0x54eb31='Sounds';return db[_0xbf1f('0x28')][_0xbf1f('0x26')]({'where':{'type':_0x54eb31,'resourceId':_0x4d30fe['id']}})[_0xbf1f('0x27')](function(){return _0x32766f;});})[_0xbf1f('0x27')](function(){_0x531c8a[_0xbf1f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x457144,_0x3bd356){return function(_0x37bce8){if(!_0x37bce8){_0x457144[_0xbf1f('0x29')](0x194);}return _0x37bce8;};}function handleError(_0x128537,_0x4c91a7){_0x4c91a7=_0x4c91a7||0x1f4;return function(_0xf88eec){logger['error'](_0xf88eec['stack']);if(_0xf88eec[_0xbf1f('0x2a')]){delete _0xf88eec['name'];}_0x128537['status'](_0x4c91a7)[_0xbf1f('0x2b')](_0xf88eec);};}exports['index']=function(_0x723462,_0x226672){var _0x3722b2={},_0x2ec95e={},_0x9372e9={'count':0x0,'rows':[]};var _0x584720=_['map'](db[_0xbf1f('0x2c')]['rawAttributes'],function(_0x49fd7d){return{'name':_0x49fd7d[_0xbf1f('0x2d')],'type':_0x49fd7d[_0xbf1f('0x2e')][_0xbf1f('0x2f')]};});_0x2ec95e[_0xbf1f('0x30')]=_['map'](_0x584720,'name');_0x2ec95e[_0xbf1f('0x31')]=_[_0xbf1f('0x32')](_0x723462[_0xbf1f('0x31')]);_0x2ec95e[_0xbf1f('0x33')]=_['intersection'](_0x2ec95e[_0xbf1f('0x30')],_0x2ec95e[_0xbf1f('0x31')]);_0x3722b2[_0xbf1f('0x34')]=_[_0xbf1f('0x35')](_0x2ec95e[_0xbf1f('0x30')],qs[_0xbf1f('0x36')](_0x723462[_0xbf1f('0x31')]['fields']));_0x3722b2[_0xbf1f('0x34')]=_0x3722b2['attributes'][_0xbf1f('0x37')]?_0x3722b2[_0xbf1f('0x34')]:_0x2ec95e[_0xbf1f('0x30')];if(!_0x723462[_0xbf1f('0x31')][_0xbf1f('0x38')](_0xbf1f('0x39'))){_0x3722b2[_0xbf1f('0x20')]=qs[_0xbf1f('0x20')](_0x723462['query'][_0xbf1f('0x20')]);_0x3722b2['offset']=qs[_0xbf1f('0x1e')](_0x723462[_0xbf1f('0x31')]['offset']);}_0x3722b2[_0xbf1f('0x3a')]=qs[_0xbf1f('0x3b')](_0x723462[_0xbf1f('0x31')][_0xbf1f('0x3b')]);_0x3722b2['where']=qs[_0xbf1f('0x33')](_['pick'](_0x723462[_0xbf1f('0x31')],_0x2ec95e[_0xbf1f('0x33')]),_0x584720);if(_0x723462[_0xbf1f('0x31')][_0xbf1f('0x3c')]){_0x3722b2[_0xbf1f('0x3d')]=_[_0xbf1f('0x3e')](_0x3722b2[_0xbf1f('0x3d')],{'$or':_['map'](_0x584720,function(_0x2832d1){if(_0x2832d1['type']!==_0xbf1f('0x3f')){var _0x50f9f2={};_0x50f9f2[_0x2832d1[_0xbf1f('0x2a')]]={'$like':'%'+_0x723462[_0xbf1f('0x31')][_0xbf1f('0x3c')]+'%'};return _0x50f9f2;}})});}_0x3722b2=_[_0xbf1f('0x3e')]({},_0x3722b2,_0x723462[_0xbf1f('0x40')]);var _0xb265c0={'where':_0x3722b2[_0xbf1f('0x3d')]};return db[_0xbf1f('0x2c')][_0xbf1f('0x21')](_0xb265c0)[_0xbf1f('0x27')](function(_0x412ac4){_0x9372e9[_0xbf1f('0x21')]=_0x412ac4;if(_0x723462[_0xbf1f('0x31')]['includeAll']){_0x3722b2[_0xbf1f('0x41')]=[{'all':!![]}];}return db['Sound'][_0xbf1f('0x42')](_0x3722b2);})[_0xbf1f('0x27')](function(_0x479396){_0x9372e9[_0xbf1f('0x43')]=_0x479396;return _0x9372e9;})[_0xbf1f('0x27')](respondWithFilteredResult(_0x226672,_0x3722b2))[_0xbf1f('0x44')](handleError(_0x226672,null));};exports[_0xbf1f('0x45')]=function(_0xcb4123,_0xb21600){var _0x2bcb5b={'raw':!![],'where':{'id':_0xcb4123[_0xbf1f('0x46')]['id']}},_0x3b619f={};_0x3b619f[_0xbf1f('0x30')]=_[_0xbf1f('0x32')](db[_0xbf1f('0x2c')][_0xbf1f('0x47')]);_0x3b619f[_0xbf1f('0x31')]=_[_0xbf1f('0x32')](_0xcb4123[_0xbf1f('0x31')]);_0x3b619f[_0xbf1f('0x33')]=_[_0xbf1f('0x35')](_0x3b619f[_0xbf1f('0x30')],_0x3b619f[_0xbf1f('0x31')]);_0x2bcb5b[_0xbf1f('0x34')]=_['intersection'](_0x3b619f[_0xbf1f('0x30')],qs[_0xbf1f('0x36')](_0xcb4123[_0xbf1f('0x31')][_0xbf1f('0x36')]));_0x2bcb5b[_0xbf1f('0x34')]=_0x2bcb5b[_0xbf1f('0x34')][_0xbf1f('0x37')]?_0x2bcb5b[_0xbf1f('0x34')]:_0x3b619f['model'];if(_0xcb4123['query'][_0xbf1f('0x48')]){_0x2bcb5b[_0xbf1f('0x41')]=[{'all':!![]}];}_0x2bcb5b=_['merge']({},_0x2bcb5b,_0xcb4123['options']);return db[_0xbf1f('0x2c')][_0xbf1f('0x49')](_0x2bcb5b)[_0xbf1f('0x27')](handleEntityNotFound(_0xb21600,null))[_0xbf1f('0x27')](respondWithResult(_0xb21600,null))[_0xbf1f('0x44')](handleError(_0xb21600,null));};exports['download']=function(_0x38c0e1,_0x53f8af,_0x28427a){return db[_0xbf1f('0x2c')]['find']({'where':{'id':_0x38c0e1[_0xbf1f('0x46')]['id']},'attributes':['name',_0xbf1f('0x4a'),_0xbf1f('0x4b')],'raw':!![]})[_0xbf1f('0x27')](handleEntityNotFound(_0x53f8af,null))[_0xbf1f('0x27')](function(_0x2d2d96){if(_0x2d2d96){if(!fs['existsSync'](path['join'](config[_0xbf1f('0x4c')],'server/files/sounds/converted',_0x2d2d96['save_name']+'.'+_0x2d2d96[_0xbf1f('0x4b')]))){throw new db[(_0xbf1f('0x4d'))][(_0xbf1f('0x4e'))]('Sound\x20not\x20found');}return _0x53f8af[_0xbf1f('0x4f')](path[_0xbf1f('0x50')](config[_0xbf1f('0x4c')],'server/files/sounds/converted',util[_0xbf1f('0x51')](_0xbf1f('0x52'),_0x2d2d96[_0xbf1f('0x4a')],_0x2d2d96[_0xbf1f('0x4b')])),util[_0xbf1f('0x51')](_0xbf1f('0x52'),_0x2d2d96[_0xbf1f('0x2a')],_0x2d2d96[_0xbf1f('0x4b')]));}return null;})[_0xbf1f('0x44')](handleError(_0x53f8af,null));};exports[_0xbf1f('0x53')]=function(_0x4bd934,_0x270988,_0x35761e){var _0x1e923a={'name':path[_0xbf1f('0x54')](_0x4bd934[_0xbf1f('0x55')][_0xbf1f('0x56')],path[_0xbf1f('0x57')](_0x4bd934[_0xbf1f('0x55')]['originalname'])),'save_name':path[_0xbf1f('0x54')](_0x4bd934['file'][_0xbf1f('0x58')],path[_0xbf1f('0x57')](_0x4bd934[_0xbf1f('0x55')][_0xbf1f('0x58')])),'original_format':path[_0xbf1f('0x57')](_0x4bd934[_0xbf1f('0x55')][_0xbf1f('0x56')])[_0xbf1f('0x59')](0x1),'converted_format':'wav'};var _0x59e35c=path['join'](config[_0xbf1f('0x4c')],_0xbf1f('0x5a'),_0x4bd934['file'][_0xbf1f('0x58')]);var _0x294c70=path[_0xbf1f('0x50')](config[_0xbf1f('0x4c')],_0xbf1f('0x5b'),util[_0xbf1f('0x51')](_0xbf1f('0x52'),path[_0xbf1f('0x54')](_0x4bd934[_0xbf1f('0x55')]['filename'],path[_0xbf1f('0x57')](_0x4bd934[_0xbf1f('0x55')][_0xbf1f('0x58')])),_0x1e923a['converted_format']));logger[_0xbf1f('0x5c')](_0xbf1f('0x5d'),_0x59e35c);logger['info'](_0xbf1f('0x5e'),_0x294c70);try{fs['chmodSync'](_0x59e35c,parseInt('0777',0x8));var _0x15f717=sox[_0xbf1f('0x5f')](_0x59e35c,_0x294c70,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x15f717['on'](_0xbf1f('0x60'),function(_0x4e821c){fs[_0xbf1f('0x61')](_0x59e35c);_0x270988[_0xbf1f('0x1c')](0x1f4)[_0xbf1f('0x2b')](_0x4e821c);});_0x15f717['on'](_0xbf1f('0x62'),function(_0x1a993f){_0x1e923a[_0xbf1f('0x63')]=isNaN(_0x1a993f[_0xbf1f('0x64')])?null:_0x1a993f['duration']*0x3e8;_0x1e923a[_0xbf1f('0x65')]=isNaN(_0x1a993f[_0xbf1f('0x66')])?null:_0x1a993f[_0xbf1f('0x66')];_0x1e923a[_0xbf1f('0x67')]=isNaN(_0x1a993f['channelCount'])?null:_0x1a993f[_0xbf1f('0x68')];_0x1e923a['original_bitRate']=isNaN(_0x1a993f['bitRate'])?null:_0x1a993f['bitRate'];_0x1e923a[_0xbf1f('0x69')]=isNaN(_0x1a993f[_0xbf1f('0x6a')])?null:_0x1a993f[_0xbf1f('0x6a')];});_0x15f717['on'](_0xbf1f('0x6b'),function(_0x4fb485){_0x1e923a[_0xbf1f('0x6c')]=isNaN(_0x4fb485['duration'])?null:_0x4fb485[_0xbf1f('0x64')]*0x3e8;_0x1e923a['converted_sampleCount']=isNaN(_0x4fb485['sampleCount'])?null:_0x4fb485[_0xbf1f('0x66')];_0x1e923a[_0xbf1f('0x6d')]=isNaN(_0x4fb485[_0xbf1f('0x68')])?null:_0x4fb485[_0xbf1f('0x68')];_0x1e923a['converted_bitRate']=isNaN(_0x4fb485['bitRate'])?null:_0x4fb485[_0xbf1f('0x6e')];_0x1e923a[_0xbf1f('0x6f')]=isNaN(_0x4fb485['sampleRate'])?null:_0x4fb485[_0xbf1f('0x6a')];});_0x15f717['on']('end',function(){fs[_0xbf1f('0x70')](_0x294c70,parseInt('0777',0x8));return db[_0xbf1f('0x2c')][_0xbf1f('0x53')](_0x1e923a)[_0xbf1f('0x27')](function(_0x53c350){var _0x1a16bd={'role':_0x4bd934[_0xbf1f('0x71')][_0xbf1f('0x72')],'userProfileId':_0x4bd934[_0xbf1f('0x71')][_0xbf1f('0x73')]};if(!_0x1a16bd)throw new Error(_0xbf1f('0x74'));if(_0x1a16bd[_0xbf1f('0x72')]===_0xbf1f('0x75')){var _0x5e050e=_0x53c350[_0xbf1f('0x76')]({'plain':!![]});return db[_0xbf1f('0x77')]['find']({'where':{'name':_0xbf1f('0x78'),'userProfileId':_0x1a16bd[_0xbf1f('0x73')]},'raw':!![]})[_0xbf1f('0x27')](function(_0x3f7083){if(_0x3f7083&&_0x3f7083[_0xbf1f('0x79')]===0x0){return db[_0xbf1f('0x28')]['create']({'name':_0x5e050e[_0xbf1f('0x2a')],'resourceId':_0x5e050e['id'],'type':_0x3f7083['name'],'sectionId':_0x3f7083['id']},{})[_0xbf1f('0x27')](function(){return _0x53c350;});}else{return _0x53c350;}})[_0xbf1f('0x44')](function(_0x45a9ec){logger[_0xbf1f('0x60')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45a9ec);throw _0x45a9ec;});}return _0x53c350;})[_0xbf1f('0x27')](respondWithResult(_0x270988,null))['catch'](handleError(_0x270988,null));});_0x15f717[_0xbf1f('0x7a')]();}catch(_0x28e745){_0x270988[_0xbf1f('0x1c')](0x1f4)[_0xbf1f('0x2b')](_0x28e745);}};exports[_0xbf1f('0x25')]=function(_0x450199,_0x506f7e,_0x339e17){return db[_0xbf1f('0x2c')]['find']({'where':{'id':_0x450199['params']['id']}})['then'](handleEntityNotFound(_0x506f7e,null))[_0xbf1f('0x27')](saveUpdates(_[_0xbf1f('0x7b')](_0x450199['body'],[_0xbf1f('0x2a'),_0xbf1f('0x7c')]),null))[_0xbf1f('0x27')](respondWithResult(_0x506f7e,null))['catch'](handleError(_0x506f7e,null));};exports[_0xbf1f('0x7d')]=function(_0x49de1b,_0x29c887,_0x42129a){return db[_0xbf1f('0x2c')][_0xbf1f('0x49')]({'where':{'id':_0x49de1b[_0xbf1f('0x46')]['id']}})[_0xbf1f('0x27')](function(_0x7e8f6a){if(_0x7e8f6a){return _0x7e8f6a[_0xbf1f('0x26')]();}})[_0xbf1f('0x27')](function(_0x518e18){var _0x5d9531=path['join'](config[_0xbf1f('0x4c')],_0xbf1f('0x5a'),util[_0xbf1f('0x51')](_0xbf1f('0x52'),_0x518e18[_0xbf1f('0x4a')],_0x518e18[_0xbf1f('0x7e')]));var _0x4732fb=path['join'](config[_0xbf1f('0x4c')],_0xbf1f('0x5b'),util[_0xbf1f('0x51')](_0xbf1f('0x52'),_0x518e18[_0xbf1f('0x4a')],_0x518e18[_0xbf1f('0x4b')]));fs['unlinkSync'](_0x5d9531);fs[_0xbf1f('0x61')](_0x4732fb);return _0x518e18;})[_0xbf1f('0x27')](function(_0x46919f){if(_0x46919f){return _0x29c887['status'](0xcc)[_0xbf1f('0x7f')]();}})['then'](handleEntityNotFound(_0x29c887,null))[_0xbf1f('0x44')](handleError(_0x29c887,null));}; \ No newline at end of file +var _0xb255=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','find','save_name','converted_format','existsSync','join','server/files/sounds/converted','Sequelize','download','format','%s.%s','basename','file','extname','originalname','wav','root','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','send','src','duration','sampleCount','channelCount','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','delete','original_format','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','sendStatus','error','stack','name','index','Sound','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x19d4ae,_0x43245){var _0x1193b8=function(_0x3ce6ed){while(--_0x3ce6ed){_0x19d4ae['push'](_0x19d4ae['shift']());}};_0x1193b8(++_0x43245);}(_0xb255,0xb4));var _0x5b25=function(_0x152aad,_0x45310e){_0x152aad=_0x152aad-0x0;var _0x10e985=_0xb255[_0x152aad];return _0x10e985;};'use strict';var emlformat=require(_0x5b25('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b25('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5b25('0x2'));var moment=require(_0x5b25('0x3'));var BPromise=require(_0x5b25('0x4'));var Mustache=require(_0x5b25('0x5'));var util=require(_0x5b25('0x6'));var path=require('path');var sox=require(_0x5b25('0x7'));var csv=require(_0x5b25('0x8'));var ejs=require(_0x5b25('0x9'));var fs=require('fs');var fs_extra=require(_0x5b25('0xa'));var _=require(_0x5b25('0xb'));var squel=require(_0x5b25('0xc'));var crypto=require(_0x5b25('0xd'));var jsforce=require(_0x5b25('0xe'));var deskjs=require(_0x5b25('0xf'));var toCsv=require(_0x5b25('0x8'));var querystring=require('querystring');var Papa=require(_0x5b25('0x10'));var Redis=require(_0x5b25('0x11'));var authService=require(_0x5b25('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5b25('0x13'));var hardwareService=require(_0x5b25('0x14'));var logger=require(_0x5b25('0x15'))(_0x5b25('0x16'));var utils=require(_0x5b25('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5d7180,_0xdc4999){_0xdc4999=_0xdc4999||0xcc;return function(_0x58e0d4){if(_0x58e0d4){return _0x5d7180['sendStatus'](_0xdc4999);}return _0x5d7180[_0x5b25('0x18')](_0xdc4999)[_0x5b25('0x19')]();};}function respondWithResult(_0x3211bb,_0x31ed5a){_0x31ed5a=_0x31ed5a||0xc8;return function(_0x2acadf){if(_0x2acadf){return _0x3211bb[_0x5b25('0x18')](_0x31ed5a)[_0x5b25('0x1a')](_0x2acadf);}};}function respondWithFilteredResult(_0xa3df77,_0x7749ca){return function(_0x26d035){if(_0x26d035){var _0x1f606a=typeof _0x7749ca['offset']==='undefined'&&typeof _0x7749ca[_0x5b25('0x1b')]===_0x5b25('0x1c');var _0x1c4710=_0x26d035['count'];var _0x3bf897=_0x1f606a?0x0:_0x7749ca[_0x5b25('0x1d')];var _0x1f8a61=_0x1f606a?_0x26d035[_0x5b25('0x1e')]:_0x7749ca[_0x5b25('0x1d')]+_0x7749ca[_0x5b25('0x1b')];var _0x9bddf0;if(_0x1f8a61>=_0x1c4710){_0x1f8a61=_0x1c4710;_0x9bddf0=0xc8;}else{_0x9bddf0=0xce;}_0xa3df77[_0x5b25('0x18')](_0x9bddf0);return _0xa3df77[_0x5b25('0x1f')](_0x5b25('0x20'),_0x3bf897+'-'+_0x1f8a61+'/'+_0x1c4710)[_0x5b25('0x1a')](_0x26d035);}return null;};}function patchUpdates(_0x11954d){return function(_0xdb8731){try{jsonpatch[_0x5b25('0x21')](_0xdb8731,_0x11954d,!![]);}catch(_0x56a890){return BPromise[_0x5b25('0x22')](_0x56a890);}return _0xdb8731[_0x5b25('0x23')]();};}function saveUpdates(_0x492e95,_0x5ec256){return function(_0x306fe6){if(_0x306fe6){return _0x306fe6[_0x5b25('0x24')](_0x492e95)['then'](function(_0x7d4e68){return _0x7d4e68;});}return null;};}function removeEntity(_0x3ca210,_0x4c39eb){return function(_0x29142c){if(_0x29142c){return _0x29142c[_0x5b25('0x25')]()[_0x5b25('0x26')](function(){var _0x3c4f1a=_0x29142c[_0x5b25('0x27')]({'plain':!![]});var _0x3a0e94=_0x5b25('0x28');return db[_0x5b25('0x29')][_0x5b25('0x25')]({'where':{'type':_0x3a0e94,'resourceId':_0x3c4f1a['id']}})[_0x5b25('0x26')](function(){return _0x29142c;});})['then'](function(){_0x3ca210[_0x5b25('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x334525,_0x246304){return function(_0xf27f5a){if(!_0xf27f5a){_0x334525[_0x5b25('0x2a')](0x194);}return _0xf27f5a;};}function handleError(_0x268cd0,_0x3e16ac){_0x3e16ac=_0x3e16ac||0x1f4;return function(_0x25a861){logger[_0x5b25('0x2b')](_0x25a861[_0x5b25('0x2c')]);if(_0x25a861[_0x5b25('0x2d')]){delete _0x25a861[_0x5b25('0x2d')];}_0x268cd0['status'](_0x3e16ac)['send'](_0x25a861);};}exports[_0x5b25('0x2e')]=function(_0x178d60,_0x3cfe97){var _0x17a807={},_0x577f21={},_0x4ea5a6={'count':0x0,'rows':[]};var _0xe92721=_['map'](db[_0x5b25('0x2f')][_0x5b25('0x30')],function(_0x312405){return{'name':_0x312405[_0x5b25('0x31')],'type':_0x312405[_0x5b25('0x32')][_0x5b25('0x33')]};});_0x577f21[_0x5b25('0x34')]=_['map'](_0xe92721,_0x5b25('0x2d'));_0x577f21[_0x5b25('0x35')]=_[_0x5b25('0x36')](_0x178d60[_0x5b25('0x35')]);_0x577f21[_0x5b25('0x37')]=_[_0x5b25('0x38')](_0x577f21[_0x5b25('0x34')],_0x577f21[_0x5b25('0x35')]);_0x17a807['attributes']=_[_0x5b25('0x38')](_0x577f21[_0x5b25('0x34')],qs['fields'](_0x178d60[_0x5b25('0x35')][_0x5b25('0x39')]));_0x17a807[_0x5b25('0x3a')]=_0x17a807[_0x5b25('0x3a')][_0x5b25('0x3b')]?_0x17a807[_0x5b25('0x3a')]:_0x577f21['model'];if(!_0x178d60[_0x5b25('0x35')][_0x5b25('0x3c')](_0x5b25('0x3d'))){_0x17a807[_0x5b25('0x1b')]=qs[_0x5b25('0x1b')](_0x178d60[_0x5b25('0x35')]['limit']);_0x17a807['offset']=qs[_0x5b25('0x1d')](_0x178d60[_0x5b25('0x35')][_0x5b25('0x1d')]);}_0x17a807['order']=qs[_0x5b25('0x3e')](_0x178d60[_0x5b25('0x35')][_0x5b25('0x3e')]);_0x17a807[_0x5b25('0x3f')]=qs['filters'](_[_0x5b25('0x40')](_0x178d60[_0x5b25('0x35')],_0x577f21[_0x5b25('0x37')]),_0xe92721);if(_0x178d60[_0x5b25('0x35')][_0x5b25('0x41')]){_0x17a807[_0x5b25('0x3f')]=_[_0x5b25('0x42')](_0x17a807[_0x5b25('0x3f')],{'$or':_['map'](_0xe92721,function(_0x426c96){if(_0x426c96[_0x5b25('0x32')]!==_0x5b25('0x43')){var _0x294183={};_0x294183[_0x426c96[_0x5b25('0x2d')]]={'$like':'%'+_0x178d60['query'][_0x5b25('0x41')]+'%'};return _0x294183;}})});}_0x17a807=_['merge']({},_0x17a807,_0x178d60[_0x5b25('0x44')]);var _0x264fbd={'where':_0x17a807['where']};return db[_0x5b25('0x2f')][_0x5b25('0x1e')](_0x264fbd)[_0x5b25('0x26')](function(_0x2d816a){_0x4ea5a6[_0x5b25('0x1e')]=_0x2d816a;if(_0x178d60[_0x5b25('0x35')]['includeAll']){_0x17a807[_0x5b25('0x45')]=[{'all':!![]}];}return db[_0x5b25('0x2f')][_0x5b25('0x46')](_0x17a807);})[_0x5b25('0x26')](function(_0x28e546){_0x4ea5a6['rows']=_0x28e546;return _0x4ea5a6;})[_0x5b25('0x26')](respondWithFilteredResult(_0x3cfe97,_0x17a807))[_0x5b25('0x47')](handleError(_0x3cfe97,null));};exports[_0x5b25('0x48')]=function(_0x17dd33,_0x43487b){var _0x9a1bc6={'raw':!![],'where':{'id':_0x17dd33[_0x5b25('0x49')]['id']}},_0x23628b={};_0x23628b[_0x5b25('0x34')]=_[_0x5b25('0x36')](db[_0x5b25('0x2f')]['rawAttributes']);_0x23628b['query']=_[_0x5b25('0x36')](_0x17dd33['query']);_0x23628b[_0x5b25('0x37')]=_[_0x5b25('0x38')](_0x23628b[_0x5b25('0x34')],_0x23628b[_0x5b25('0x35')]);_0x9a1bc6[_0x5b25('0x3a')]=_[_0x5b25('0x38')](_0x23628b[_0x5b25('0x34')],qs['fields'](_0x17dd33[_0x5b25('0x35')]['fields']));_0x9a1bc6[_0x5b25('0x3a')]=_0x9a1bc6[_0x5b25('0x3a')][_0x5b25('0x3b')]?_0x9a1bc6[_0x5b25('0x3a')]:_0x23628b['model'];if(_0x17dd33[_0x5b25('0x35')]['includeAll']){_0x9a1bc6[_0x5b25('0x45')]=[{'all':!![]}];}_0x9a1bc6=_['merge']({},_0x9a1bc6,_0x17dd33[_0x5b25('0x44')]);return db['Sound']['find'](_0x9a1bc6)['then'](handleEntityNotFound(_0x43487b,null))[_0x5b25('0x26')](respondWithResult(_0x43487b,null))[_0x5b25('0x47')](handleError(_0x43487b,null));};exports['download']=function(_0x4b9189,_0x402605,_0x3963d6){return db[_0x5b25('0x2f')][_0x5b25('0x4a')]({'where':{'id':_0x4b9189[_0x5b25('0x49')]['id']},'attributes':['name',_0x5b25('0x4b'),_0x5b25('0x4c')],'raw':!![]})[_0x5b25('0x26')](handleEntityNotFound(_0x402605,null))['then'](function(_0x413c43){if(_0x413c43){if(!fs[_0x5b25('0x4d')](path[_0x5b25('0x4e')](config['root'],_0x5b25('0x4f'),_0x413c43['save_name']+'.'+_0x413c43[_0x5b25('0x4c')]))){throw new db[(_0x5b25('0x50'))]['ValidationError']('Sound\x20not\x20found');}return _0x402605[_0x5b25('0x51')](path[_0x5b25('0x4e')](config['root'],_0x5b25('0x4f'),util[_0x5b25('0x52')](_0x5b25('0x53'),_0x413c43['save_name'],_0x413c43[_0x5b25('0x4c')])),util[_0x5b25('0x52')](_0x5b25('0x53'),_0x413c43['name'],_0x413c43[_0x5b25('0x4c')]));}return null;})[_0x5b25('0x47')](handleError(_0x402605,null));};exports['create']=function(_0x423161,_0x263b60,_0x41d9bb){var _0x4c607a={'name':path[_0x5b25('0x54')](_0x423161[_0x5b25('0x55')]['originalname'],path[_0x5b25('0x56')](_0x423161['file'][_0x5b25('0x57')])),'save_name':path[_0x5b25('0x54')](_0x423161['file']['filename'],path[_0x5b25('0x56')](_0x423161['file']['filename'])),'original_format':path[_0x5b25('0x56')](_0x423161[_0x5b25('0x55')][_0x5b25('0x57')])['substring'](0x1),'converted_format':_0x5b25('0x58')};var _0xfd3776=path['join'](config[_0x5b25('0x59')],_0x5b25('0x5a'),_0x423161[_0x5b25('0x55')]['filename']);var _0x558599=path[_0x5b25('0x4e')](config[_0x5b25('0x59')],_0x5b25('0x4f'),util['format'](_0x5b25('0x53'),path[_0x5b25('0x54')](_0x423161[_0x5b25('0x55')][_0x5b25('0x5b')],path['extname'](_0x423161[_0x5b25('0x55')]['filename'])),_0x4c607a[_0x5b25('0x4c')]));logger[_0x5b25('0x5c')](_0x5b25('0x5d'),_0xfd3776);logger[_0x5b25('0x5c')](_0x5b25('0x5e'),_0x558599);try{fs[_0x5b25('0x5f')](_0xfd3776,parseInt(_0x5b25('0x60'),0x8));var _0x39a42a=sox[_0x5b25('0x61')](_0xfd3776,_0x558599,{'sampleRate':0x1f40,'format':_0x5b25('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x39a42a['on'](_0x5b25('0x2b'),function(_0x1bf9bc){fs[_0x5b25('0x62')](_0xfd3776);_0x263b60['status'](0x1f4)[_0x5b25('0x63')](_0x1bf9bc);});_0x39a42a['on'](_0x5b25('0x64'),function(_0x52285b){_0x4c607a['original_duration']=isNaN(_0x52285b[_0x5b25('0x65')])?null:_0x52285b[_0x5b25('0x65')]*0x3e8;_0x4c607a['original_sampleCount']=isNaN(_0x52285b[_0x5b25('0x66')])?null:_0x52285b[_0x5b25('0x66')];_0x4c607a['original_channelCount']=isNaN(_0x52285b[_0x5b25('0x67')])?null:_0x52285b[_0x5b25('0x67')];_0x4c607a['original_bitRate']=isNaN(_0x52285b['bitRate'])?null:_0x52285b[_0x5b25('0x68')];_0x4c607a[_0x5b25('0x69')]=isNaN(_0x52285b[_0x5b25('0x6a')])?null:_0x52285b[_0x5b25('0x6a')];});_0x39a42a['on']('dest',function(_0x5f562d){_0x4c607a[_0x5b25('0x6b')]=isNaN(_0x5f562d['duration'])?null:_0x5f562d[_0x5b25('0x65')]*0x3e8;_0x4c607a[_0x5b25('0x6c')]=isNaN(_0x5f562d['sampleCount'])?null:_0x5f562d[_0x5b25('0x66')];_0x4c607a['converted_channelCount']=isNaN(_0x5f562d[_0x5b25('0x67')])?null:_0x5f562d[_0x5b25('0x67')];_0x4c607a[_0x5b25('0x6d')]=isNaN(_0x5f562d[_0x5b25('0x68')])?null:_0x5f562d[_0x5b25('0x68')];_0x4c607a[_0x5b25('0x6e')]=isNaN(_0x5f562d[_0x5b25('0x6a')])?null:_0x5f562d[_0x5b25('0x6a')];});_0x39a42a['on'](_0x5b25('0x19'),function(){fs[_0x5b25('0x5f')](_0x558599,parseInt(_0x5b25('0x60'),0x8));return db['Sound']['create'](_0x4c607a)[_0x5b25('0x26')](function(_0x4640c8){var _0x4d40de={'role':_0x423161[_0x5b25('0x6f')][_0x5b25('0x70')],'userProfileId':_0x423161[_0x5b25('0x6f')][_0x5b25('0x71')]};if(!_0x4d40de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d40de[_0x5b25('0x70')]==='user'){var _0x6d0c9f=_0x4640c8[_0x5b25('0x27')]({'plain':!![]});return db['UserProfileSection'][_0x5b25('0x4a')]({'where':{'name':_0x5b25('0x28'),'userProfileId':_0x4d40de[_0x5b25('0x71')]},'raw':!![]})[_0x5b25('0x26')](function(_0xa56e1b){if(_0xa56e1b&&_0xa56e1b[_0x5b25('0x72')]===0x0){return db[_0x5b25('0x29')][_0x5b25('0x73')]({'name':_0x6d0c9f[_0x5b25('0x2d')],'resourceId':_0x6d0c9f['id'],'type':_0xa56e1b[_0x5b25('0x2d')],'sectionId':_0xa56e1b['id']},{})['then'](function(){return _0x4640c8;});}else{return _0x4640c8;}})[_0x5b25('0x47')](function(_0x31130d){logger[_0x5b25('0x2b')](_0x5b25('0x74'),_0x31130d);throw _0x31130d;});}return _0x4640c8;})[_0x5b25('0x26')](respondWithResult(_0x263b60,null))[_0x5b25('0x47')](handleError(_0x263b60,null));});_0x39a42a[_0x5b25('0x75')]();}catch(_0xe7360f){_0x263b60[_0x5b25('0x18')](0x1f4)[_0x5b25('0x63')](_0xe7360f);}};exports[_0x5b25('0x24')]=function(_0x45b60b,_0x43952e,_0x6458ff){return db[_0x5b25('0x2f')][_0x5b25('0x4a')]({'where':{'id':_0x45b60b[_0x5b25('0x49')]['id']}})[_0x5b25('0x26')](handleEntityNotFound(_0x43952e,null))[_0x5b25('0x26')](saveUpdates(_[_0x5b25('0x40')](_0x45b60b['body'],['name','description']),null))[_0x5b25('0x26')](respondWithResult(_0x43952e,null))['catch'](handleError(_0x43952e,null));};exports[_0x5b25('0x76')]=function(_0x11841d,_0x9f9bba,_0x303f68){return db[_0x5b25('0x2f')][_0x5b25('0x4a')]({'where':{'id':_0x11841d[_0x5b25('0x49')]['id']}})['then'](function(_0x2a50b4){if(_0x2a50b4){return _0x2a50b4[_0x5b25('0x25')]();}})['then'](function(_0x5d6041){var _0xd19c72=path[_0x5b25('0x4e')](config[_0x5b25('0x59')],_0x5b25('0x5a'),util['format'](_0x5b25('0x53'),_0x5d6041['save_name'],_0x5d6041[_0x5b25('0x77')]));var _0x49c9bd=path['join'](config[_0x5b25('0x59')],_0x5b25('0x4f'),util['format']('%s.%s',_0x5d6041['save_name'],_0x5d6041['converted_format']));fs[_0x5b25('0x62')](_0xd19c72);fs['unlinkSync'](_0x49c9bd);return _0x5d6041;})[_0x5b25('0x26')](function(_0x226906){if(_0x226906){return _0x9f9bba[_0x5b25('0x18')](0xcc)[_0x5b25('0x19')]();}})[_0x5b25('0x26')](handleEntityNotFound(_0x9f9bba,null))[_0x5b25('0x47')](handleError(_0x9f9bba,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index acb211c..3f92328 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 _0x4563=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds','lodash'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x4563,0x110));var _0x3456=function(_0x38704b,_0x166381){_0x38704b=_0x38704b-0x0;var _0x43692a=_0x4563[_0x38704b];return _0x43692a;};'use strict';var _=require(_0x3456('0x0'));var util=require(_0x3456('0x1'));var logger=require('../../config/logger')(_0x3456('0x2'));var moment=require(_0x3456('0x3'));var BPromise=require(_0x3456('0x4'));var rp=require(_0x3456('0x5'));var fs=require('fs');var path=require(_0x3456('0x6'));var rimraf=require(_0x3456('0x7'));var config=require(_0x3456('0x8'));var attributes=require(_0x3456('0x9'));module['exports']=function(_0x11d523,_0xd628e1){return _0x11d523[_0x3456('0xa')](_0x3456('0xb'),attributes,{'tableName':_0x3456('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe978=['moment','bluebird','request-promise','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','../../config/logger','api'];(function(_0x297b2b,_0x11eb85){var _0x14754b=function(_0x377d2f){while(--_0x377d2f){_0x297b2b['push'](_0x297b2b['shift']());}};_0x14754b(++_0x11eb85);}(_0xe978,0x10e));var _0x8e97=function(_0x215f55,_0x47f7b3){_0x215f55=_0x215f55-0x0;var _0x2b66f3=_0xe978[_0x215f55];return _0x2b66f3;};'use strict';var _=require(_0x8e97('0x0'));var util=require('util');var logger=require(_0x8e97('0x1'))(_0x8e97('0x2'));var moment=require(_0x8e97('0x3'));var BPromise=require(_0x8e97('0x4'));var rp=require(_0x8e97('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8e97('0x6'));var config=require(_0x8e97('0x7'));var attributes=require(_0x8e97('0x8'));module[_0x8e97('0x9')]=function(_0x16afff,_0x1bed91){return _0x16afff[_0x8e97('0xa')](_0x8e97('0xb'),attributes,{'tableName':_0x8e97('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 86e00fe..b5932d9 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 _0xbdb5=['attributes','util','moment','randomstring','ioredis','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','ShowSound','Sound','find','options','raw','where','include','model','map'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xbdb5,0x1ee));var _0x5bdb=function(_0x311341,_0x3ac13e){_0x311341=_0x311341-0x0;var _0x351f86=_0xbdb5[_0x311341];return _0x351f86;};'use strict';var _=require('lodash');var util=require(_0x5bdb('0x0'));var moment=require(_0x5bdb('0x1'));var BPromise=require('bluebird');var rs=require(_0x5bdb('0x2'));var fs=require('fs');var Redis=require(_0x5bdb('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5bdb('0x4'));var jayson=require(_0x5bdb('0x5'));var client=jayson['client'][_0x5bdb('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x566859,_0x10efb5,_0x100947){return new BPromise(function(_0x54be49,_0x1d6730){return client[_0x5bdb('0x7')](_0x566859,_0x100947)[_0x5bdb('0x8')](function(_0x30d11d){logger[_0x5bdb('0x9')]('Sound,\x20%s,\x20%s',_0x10efb5,_0x5bdb('0xa'));logger[_0x5bdb('0xb')](_0x5bdb('0xc'),_0x10efb5,_0x5bdb('0xa'),JSON[_0x5bdb('0xd')](_0x30d11d));if(_0x30d11d[_0x5bdb('0xe')]){if(_0x30d11d['error'][_0x5bdb('0xf')]===0x1f4){logger[_0x5bdb('0xe')](_0x5bdb('0x10'),_0x10efb5,_0x30d11d[_0x5bdb('0xe')][_0x5bdb('0x11')]);return _0x1d6730(_0x30d11d[_0x5bdb('0xe')]['message']);}logger[_0x5bdb('0xe')]('Sound,\x20%s,\x20%s',_0x10efb5,_0x30d11d[_0x5bdb('0xe')][_0x5bdb('0x11')]);return _0x54be49(_0x30d11d[_0x5bdb('0xe')][_0x5bdb('0x11')]);}else{logger[_0x5bdb('0x9')]('Sound,\x20%s,\x20%s',_0x10efb5,'request\x20sent');_0x54be49(_0x30d11d[_0x5bdb('0x12')]['message']);}})['catch'](function(_0x2e82bd){logger[_0x5bdb('0xe')](_0x5bdb('0x10'),_0x10efb5,_0x2e82bd);_0x1d6730(_0x2e82bd);});});}exports[_0x5bdb('0x13')]=function(_0x3c6686){var _0x3c310a=this;return new Promise(function(_0x10e4cc,_0x32fdfe){return db[_0x5bdb('0x14')][_0x5bdb('0x15')]({'raw':_0x3c6686['options']?_0x3c6686[_0x5bdb('0x16')][_0x5bdb('0x17')]===undefined?!![]:![]:!![],'where':_0x3c6686['options']?_0x3c6686[_0x5bdb('0x16')][_0x5bdb('0x18')]||null:null,'attributes':_0x3c6686[_0x5bdb('0x16')]?_0x3c6686['options']['attributes']||null:null,'include':_0x3c6686[_0x5bdb('0x16')]?_0x3c6686[_0x5bdb('0x16')]['include']?_['map'](_0x3c6686[_0x5bdb('0x16')][_0x5bdb('0x19')],function(_0x456f1b){return{'model':db[_0x456f1b[_0x5bdb('0x1a')]],'as':_0x456f1b['as'],'attributes':_0x456f1b['attributes'],'include':_0x456f1b[_0x5bdb('0x19')]?_[_0x5bdb('0x1b')](_0x456f1b[_0x5bdb('0x19')],function(_0x1907ec){return{'model':db[_0x1907ec[_0x5bdb('0x1a')]],'as':_0x1907ec['as'],'attributes':_0x1907ec[_0x5bdb('0x1c')],'include':_0x1907ec[_0x5bdb('0x19')]?_[_0x5bdb('0x1b')](_0x1907ec[_0x5bdb('0x19')],function(_0x42345a){return{'model':db[_0x42345a[_0x5bdb('0x1a')]],'as':_0x42345a['as'],'attributes':_0x42345a[_0x5bdb('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5bdb('0x8')](function(_0x2ca972){logger['info'](_0x5bdb('0x13'),_0x3c6686);logger[_0x5bdb('0xb')](_0x5bdb('0x13'),_0x3c6686,JSON['stringify'](_0x2ca972));_0x10e4cc(_0x2ca972);})['catch'](function(_0x30efa4){logger[_0x5bdb('0xe')](_0x5bdb('0x13'),_0x30efa4[_0x5bdb('0x11')],_0x3c6686);_0x32fdfe(_0x3c310a[_0x5bdb('0xe')](0x1f4,_0x30efa4['message']));});});}; \ No newline at end of file +var _0xb3d3=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSound','Sound','find','options','raw','include','map','model','attributes','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x5839c0,_0x4476f2){var _0x2704ec=function(_0x540d95){while(--_0x540d95){_0x5839c0['push'](_0x5839c0['shift']());}};_0x2704ec(++_0x4476f2);}(_0xb3d3,0x78));var _0x3b3d=function(_0x4ea413,_0x51ff3a){_0x4ea413=_0x4ea413-0x0;var _0x51cf25=_0xb3d3[_0x4ea413];return _0x51cf25;};'use strict';var _=require(_0x3b3d('0x0'));var util=require(_0x3b3d('0x1'));var moment=require(_0x3b3d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b3d('0x3'));var db=require(_0x3b3d('0x4'))['db'];var utils=require(_0x3b3d('0x5'));var logger=require(_0x3b3d('0x6'))(_0x3b3d('0x7'));var config=require(_0x3b3d('0x8'));var jayson=require(_0x3b3d('0x9'));var client=jayson[_0x3b3d('0xa')][_0x3b3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x594cb6,_0x34fd95,_0x55c2ed){return new BPromise(function(_0xaf7cfd,_0x41a94f){return client[_0x3b3d('0xc')](_0x594cb6,_0x55c2ed)[_0x3b3d('0xd')](function(_0x4d5d2f){logger['info'](_0x3b3d('0xe'),_0x34fd95,_0x3b3d('0xf'));logger[_0x3b3d('0x10')](_0x3b3d('0x11'),_0x34fd95,_0x3b3d('0xf'),JSON[_0x3b3d('0x12')](_0x4d5d2f));if(_0x4d5d2f[_0x3b3d('0x13')]){if(_0x4d5d2f[_0x3b3d('0x13')][_0x3b3d('0x14')]===0x1f4){logger[_0x3b3d('0x13')]('Sound,\x20%s,\x20%s',_0x34fd95,_0x4d5d2f['error'][_0x3b3d('0x15')]);return _0x41a94f(_0x4d5d2f[_0x3b3d('0x13')][_0x3b3d('0x15')]);}logger[_0x3b3d('0x13')](_0x3b3d('0xe'),_0x34fd95,_0x4d5d2f[_0x3b3d('0x13')][_0x3b3d('0x15')]);return _0xaf7cfd(_0x4d5d2f[_0x3b3d('0x13')]['message']);}else{logger[_0x3b3d('0x16')](_0x3b3d('0xe'),_0x34fd95,_0x3b3d('0xf'));_0xaf7cfd(_0x4d5d2f[_0x3b3d('0x17')][_0x3b3d('0x15')]);}})[_0x3b3d('0x18')](function(_0x1da761){logger[_0x3b3d('0x13')](_0x3b3d('0xe'),_0x34fd95,_0x1da761);_0x41a94f(_0x1da761);});});}exports[_0x3b3d('0x19')]=function(_0x4c37ca){var _0x46a383=this;return new Promise(function(_0x362f3f,_0x4fd857){return db[_0x3b3d('0x1a')][_0x3b3d('0x1b')]({'raw':_0x4c37ca['options']?_0x4c37ca[_0x3b3d('0x1c')][_0x3b3d('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c37ca[_0x3b3d('0x1c')]?_0x4c37ca[_0x3b3d('0x1c')]['where']||null:null,'attributes':_0x4c37ca[_0x3b3d('0x1c')]?_0x4c37ca[_0x3b3d('0x1c')]['attributes']||null:null,'include':_0x4c37ca[_0x3b3d('0x1c')]?_0x4c37ca['options'][_0x3b3d('0x1e')]?_[_0x3b3d('0x1f')](_0x4c37ca[_0x3b3d('0x1c')][_0x3b3d('0x1e')],function(_0x7807cd){return{'model':db[_0x7807cd[_0x3b3d('0x20')]],'as':_0x7807cd['as'],'attributes':_0x7807cd[_0x3b3d('0x21')],'include':_0x7807cd['include']?_[_0x3b3d('0x1f')](_0x7807cd[_0x3b3d('0x1e')],function(_0x174c44){return{'model':db[_0x174c44[_0x3b3d('0x20')]],'as':_0x174c44['as'],'attributes':_0x174c44[_0x3b3d('0x21')],'include':_0x174c44[_0x3b3d('0x1e')]?_['map'](_0x174c44[_0x3b3d('0x1e')],function(_0x4c19ee){return{'model':db[_0x4c19ee[_0x3b3d('0x20')]],'as':_0x4c19ee['as'],'attributes':_0x4c19ee[_0x3b3d('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3b3d('0xd')](function(_0x1aeffe){logger['info'](_0x3b3d('0x19'),_0x4c37ca);logger[_0x3b3d('0x10')](_0x3b3d('0x19'),_0x4c37ca,JSON[_0x3b3d('0x12')](_0x1aeffe));_0x362f3f(_0x1aeffe);})['catch'](function(_0x19e64e){logger[_0x3b3d('0x13')](_0x3b3d('0x19'),_0x19e64e[_0x3b3d('0x15')],_0x4c37ca);_0x4fd857(_0x46a383[_0x3b3d('0x13')](0x1f4,_0x19e64e['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 087895b..ae11d93 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x45943c,_0x292e90){var _0xe1cf98=function(_0x4ba1ae){while(--_0x4ba1ae){_0x45943c['push'](_0x45943c['shift']());}};_0xe1cf98(++_0x292e90);}(_0xda3f,0xec));var _0xfda3=function(_0x3a449a,_0x2df0ce){_0x3a449a=_0x3a449a-0x0;var _0x150539=_0xda3f[_0x3a449a];return _0x150539;};'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 +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(_0xaf29da,_0x117f5a){var _0x295c51=function(_0x3feaf4){while(--_0x3feaf4){_0xaf29da['push'](_0xaf29da['shift']());}};_0x295c51(++_0x117f5a);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1a4a09,_0x1a6484){_0x1a4a09=_0x1a4a09-0x0;var _0x54c92c=_0x9ffd[_0x1a4a09];return _0x54c92c;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xe')]('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd9ff('0x10')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 359f39a..88d234c 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 _0xd7b9=['medium','out','STRING','sequelize','exports','TEXT'];(function(_0x208c07,_0x141a05){var _0x107772=function(_0x4f15fe){while(--_0x4f15fe){_0x208c07['push'](_0x208c07['shift']());}};_0x107772(++_0x141a05);}(_0xd7b9,0x1d1));var _0x9d7b=function(_0x29678a,_0xd09044){_0x29678a=_0x29678a-0x0;var _0xd762b6=_0xd7b9[_0x29678a];return _0xd762b6;};'use strict';var Sequelize=require(_0x9d7b('0x0'));module[_0x9d7b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x9d7b('0x2')](_0x9d7b('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9d7b('0x4')),'defaultValue':_0x9d7b('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x9d7b('0x5')]},'providerResponse':{'type':Sequelize[_0x9d7b('0x2')]}}; \ No newline at end of file +var _0xfb09=['STRING','TEXT','medium','ENUM','out','sequelize'];(function(_0x3c4e27,_0x481e0c){var _0x724fe7=function(_0x2c4920){while(--_0x2c4920){_0x3c4e27['push'](_0x3c4e27['shift']());}};_0x724fe7(++_0x481e0c);}(_0xfb09,0x19d));var _0x9fb0=function(_0x3fedc9,_0x7c2b77){_0x3fedc9=_0x3fedc9-0x0;var _0x22513f=_0xfb09[_0x3fedc9];return _0x22513f;};'use strict';var Sequelize=require(_0x9fb0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9fb0('0x1')]},'body':{'type':Sequelize[_0x9fb0('0x2')](_0x9fb0('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9fb0('0x4')]('in',_0x9fb0('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9fb0('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 807dcf6..1d2e29d 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 _0x252e=['error','stack','name','map','SquareMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x453a79,_0x10d4e4){var _0x5eb7e6=function(_0x142aea){while(--_0x142aea){_0x453a79['push'](_0x453a79['shift']());}};_0x5eb7e6(++_0x10d4e4);}(_0x252e,0x74));var _0xe252=function(_0x4f57f0,_0x2086a6){_0x4f57f0=_0x4f57f0-0x0;var _0x839d46=_0x252e[_0x4f57f0];return _0x839d46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe252('0x0'));var zipdir=require(_0xe252('0x1'));var jsonpatch=require(_0xe252('0x2'));var rp=require(_0xe252('0x3'));var moment=require('moment');var BPromise=require(_0xe252('0x4'));var Mustache=require('mustache');var util=require(_0xe252('0x5'));var path=require(_0xe252('0x6'));var sox=require(_0xe252('0x7'));var csv=require(_0xe252('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe252('0x9'));var _=require(_0xe252('0xa'));var squel=require(_0xe252('0xb'));var crypto=require(_0xe252('0xc'));var jsforce=require(_0xe252('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe252('0x8'));var querystring=require(_0xe252('0xe'));var Papa=require(_0xe252('0xf'));var Redis=require(_0xe252('0x10'));var authService=require(_0xe252('0x11'));var qs=require(_0xe252('0x12'));var as=require(_0xe252('0x13'));var hardwareService=require(_0xe252('0x14'));var logger=require(_0xe252('0x15'))(_0xe252('0x16'));var utils=require(_0xe252('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe252('0x18'));var db=require(_0xe252('0x19'))['db'];function respondWithStatusCode(_0x136244,_0x9368e6){_0x9368e6=_0x9368e6||0xcc;return function(_0x3eb754){if(_0x3eb754){return _0x136244[_0xe252('0x1a')](_0x9368e6);}return _0x136244['status'](_0x9368e6)[_0xe252('0x1b')]();};}function respondWithResult(_0x3514e2,_0x59cc1a){_0x59cc1a=_0x59cc1a||0xc8;return function(_0x1db2a4){if(_0x1db2a4){return _0x3514e2[_0xe252('0x1c')](_0x59cc1a)[_0xe252('0x1d')](_0x1db2a4);}};}function respondWithFilteredResult(_0x2499d5,_0x58df10){return function(_0x4ed008){if(_0x4ed008){var _0x4778d4=typeof _0x58df10['offset']==='undefined'&&typeof _0x58df10['limit']===_0xe252('0x1e');var _0x141136=_0x4ed008[_0xe252('0x1f')];var _0x229cca=_0x4778d4?0x0:_0x58df10[_0xe252('0x20')];var _0x1e9a95=_0x4778d4?_0x4ed008[_0xe252('0x1f')]:_0x58df10[_0xe252('0x20')]+_0x58df10[_0xe252('0x21')];var _0x123fa8;if(_0x1e9a95>=_0x141136){_0x1e9a95=_0x141136;_0x123fa8=0xc8;}else{_0x123fa8=0xce;}_0x2499d5[_0xe252('0x1c')](_0x123fa8);return _0x2499d5[_0xe252('0x22')](_0xe252('0x23'),_0x229cca+'-'+_0x1e9a95+'/'+_0x141136)[_0xe252('0x1d')](_0x4ed008);}return null;};}function patchUpdates(_0x272915){return function(_0x13f313){try{jsonpatch[_0xe252('0x24')](_0x13f313,_0x272915,!![]);}catch(_0x3a9d15){return BPromise[_0xe252('0x25')](_0x3a9d15);}return _0x13f313[_0xe252('0x26')]();};}function saveUpdates(_0x29ae5f,_0x3b6e39){return function(_0x438c47){if(_0x438c47){return _0x438c47[_0xe252('0x27')](_0x29ae5f)[_0xe252('0x28')](function(_0x273052){return _0x273052;});}return null;};}function removeEntity(_0x17dbe7,_0x2f9659){return function(_0x2a86e0){if(_0x2a86e0){return _0x2a86e0[_0xe252('0x29')]()[_0xe252('0x28')](function(){_0x17dbe7[_0xe252('0x1c')](0xcc)[_0xe252('0x1b')]();});}};}function handleEntityNotFound(_0xa05e87,_0x436187){return function(_0x26a2fe){if(!_0x26a2fe){_0xa05e87[_0xe252('0x1a')](0x194);}return _0x26a2fe;};}function handleError(_0xf69cc9,_0x2549e9){_0x2549e9=_0x2549e9||0x1f4;return function(_0x394a85){logger[_0xe252('0x2a')](_0x394a85[_0xe252('0x2b')]);if(_0x394a85[_0xe252('0x2c')]){delete _0x394a85['name'];}_0xf69cc9[_0xe252('0x1c')](_0x2549e9)['send'](_0x394a85);};}exports['index']=function(_0x5e08fb,_0x20bdc2){var _0xd5d55a={},_0x2efec1={},_0x3ac835={'count':0x0,'rows':[]};var _0x4b08d7=_[_0xe252('0x2d')](db[_0xe252('0x2e')][_0xe252('0x2f')],function(_0x50bbca){return{'name':_0x50bbca[_0xe252('0x30')],'type':_0x50bbca[_0xe252('0x31')][_0xe252('0x32')]};});_0x2efec1['model']=_[_0xe252('0x2d')](_0x4b08d7,'name');_0x2efec1[_0xe252('0x33')]=_[_0xe252('0x34')](_0x5e08fb['query']);_0x2efec1[_0xe252('0x35')]=_[_0xe252('0x36')](_0x2efec1[_0xe252('0x37')],_0x2efec1[_0xe252('0x33')]);_0xd5d55a[_0xe252('0x38')]=_[_0xe252('0x36')](_0x2efec1[_0xe252('0x37')],qs[_0xe252('0x39')](_0x5e08fb['query'][_0xe252('0x39')]));_0xd5d55a[_0xe252('0x38')]=_0xd5d55a['attributes'][_0xe252('0x3a')]?_0xd5d55a[_0xe252('0x38')]:_0x2efec1[_0xe252('0x37')];if(!_0x5e08fb[_0xe252('0x33')][_0xe252('0x3b')](_0xe252('0x3c'))){_0xd5d55a[_0xe252('0x21')]=qs[_0xe252('0x21')](_0x5e08fb[_0xe252('0x33')][_0xe252('0x21')]);_0xd5d55a[_0xe252('0x20')]=qs[_0xe252('0x20')](_0x5e08fb[_0xe252('0x33')]['offset']);}_0xd5d55a[_0xe252('0x3d')]=qs[_0xe252('0x3e')](_0x5e08fb['query'][_0xe252('0x3e')]);_0xd5d55a[_0xe252('0x3f')]=qs[_0xe252('0x35')](_[_0xe252('0x40')](_0x5e08fb[_0xe252('0x33')],_0x2efec1[_0xe252('0x35')]),_0x4b08d7);if(_0x5e08fb['query'][_0xe252('0x41')]){_0xd5d55a['where']=_[_0xe252('0x42')](_0xd5d55a['where'],{'$or':_[_0xe252('0x2d')](_0x4b08d7,function(_0x46965c){if(_0x46965c['type']!==_0xe252('0x43')){var _0x1a458d={};_0x1a458d[_0x46965c[_0xe252('0x2c')]]={'$like':'%'+_0x5e08fb[_0xe252('0x33')][_0xe252('0x41')]+'%'};return _0x1a458d;}})});}_0xd5d55a=_[_0xe252('0x42')]({},_0xd5d55a,_0x5e08fb['options']);var _0x1402b9={'where':_0xd5d55a[_0xe252('0x3f')]};return db[_0xe252('0x2e')][_0xe252('0x1f')](_0x1402b9)[_0xe252('0x28')](function(_0x2095ce){_0x3ac835[_0xe252('0x1f')]=_0x2095ce;if(_0x5e08fb['query'][_0xe252('0x44')]){_0xd5d55a[_0xe252('0x45')]=[{'all':!![]}];}return db[_0xe252('0x2e')][_0xe252('0x46')](_0xd5d55a);})[_0xe252('0x28')](function(_0x3ba87a){_0x3ac835[_0xe252('0x47')]=_0x3ba87a;return _0x3ac835;})['then'](respondWithFilteredResult(_0x20bdc2,_0xd5d55a))[_0xe252('0x48')](handleError(_0x20bdc2,null));};exports[_0xe252('0x49')]=function(_0x37901d,_0x49477b){var _0x4bfc3d={'raw':!![],'where':{'id':_0x37901d['params']['id']}},_0x32d1de={};_0x32d1de[_0xe252('0x37')]=_[_0xe252('0x34')](db[_0xe252('0x2e')][_0xe252('0x2f')]);_0x32d1de['query']=_['keys'](_0x37901d['query']);_0x32d1de[_0xe252('0x35')]=_[_0xe252('0x36')](_0x32d1de[_0xe252('0x37')],_0x32d1de[_0xe252('0x33')]);_0x4bfc3d[_0xe252('0x38')]=_[_0xe252('0x36')](_0x32d1de[_0xe252('0x37')],qs[_0xe252('0x39')](_0x37901d[_0xe252('0x33')]['fields']));_0x4bfc3d['attributes']=_0x4bfc3d[_0xe252('0x38')][_0xe252('0x3a')]?_0x4bfc3d[_0xe252('0x38')]:_0x32d1de[_0xe252('0x37')];if(_0x37901d[_0xe252('0x33')][_0xe252('0x44')]){_0x4bfc3d[_0xe252('0x45')]=[{'all':!![]}];}_0x4bfc3d=_[_0xe252('0x42')]({},_0x4bfc3d,_0x37901d[_0xe252('0x4a')]);return db[_0xe252('0x2e')][_0xe252('0x4b')](_0x4bfc3d)[_0xe252('0x28')](handleEntityNotFound(_0x49477b,null))[_0xe252('0x28')](respondWithResult(_0x49477b,null))[_0xe252('0x48')](handleError(_0x49477b,null));};exports[_0xe252('0x4c')]=function(_0x5f27a7,_0x237c8c){return db[_0xe252('0x2e')]['create'](_0x5f27a7[_0xe252('0x4d')],{})[_0xe252('0x28')](respondWithResult(_0x237c8c,0xc9))[_0xe252('0x48')](handleError(_0x237c8c,null));};exports[_0xe252('0x27')]=function(_0x41cf62,_0x4ed398){if(_0x41cf62[_0xe252('0x4d')]['id']){delete _0x41cf62[_0xe252('0x4d')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x41cf62[_0xe252('0x4e')]['id']}})[_0xe252('0x28')](handleEntityNotFound(_0x4ed398,null))[_0xe252('0x28')](saveUpdates(_0x41cf62['body'],null))[_0xe252('0x28')](respondWithResult(_0x4ed398,null))[_0xe252('0x48')](handleError(_0x4ed398,null));};exports[_0xe252('0x29')]=function(_0x4e7d20,_0x4ee566){return db[_0xe252('0x2e')][_0xe252('0x4b')]({'where':{'id':_0x4e7d20[_0xe252('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4ee566,null))[_0xe252('0x28')](removeEntity(_0x4ee566,null))[_0xe252('0x48')](handleError(_0x4ee566,null));}; \ No newline at end of file +var _0x5c13=['json','apply','reject','save','update','then','error','name','index','map','SquareMessage','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','length','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x14bebd,_0x2d7427){var _0xf1c499=function(_0x47eab4){while(--_0x47eab4){_0x14bebd['push'](_0x14bebd['shift']());}};_0xf1c499(++_0x2d7427);}(_0x5c13,0x103));var _0x35c1=function(_0x338f73,_0x1945c8){_0x338f73=_0x338f73-0x0;var _0x163fdf=_0x5c13[_0x338f73];return _0x163fdf;};'use strict';var emlformat=require(_0x35c1('0x0'));var rimraf=require(_0x35c1('0x1'));var zipdir=require(_0x35c1('0x2'));var jsonpatch=require(_0x35c1('0x3'));var rp=require(_0x35c1('0x4'));var moment=require(_0x35c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x35c1('0x6'));var util=require(_0x35c1('0x7'));var path=require('path');var sox=require(_0x35c1('0x8'));var csv=require(_0x35c1('0x9'));var ejs=require(_0x35c1('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35c1('0xb'));var squel=require(_0x35c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x35c1('0xd'));var toCsv=require(_0x35c1('0x9'));var querystring=require(_0x35c1('0xe'));var Papa=require(_0x35c1('0xf'));var Redis=require(_0x35c1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35c1('0x11'));var as=require(_0x35c1('0x12'));var hardwareService=require(_0x35c1('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x35c1('0x14'));var config=require(_0x35c1('0x15'));var licenseUtil=require(_0x35c1('0x16'));var db=require(_0x35c1('0x17'))['db'];function respondWithStatusCode(_0x1deaed,_0x5e28ad){_0x5e28ad=_0x5e28ad||0xcc;return function(_0x525cf6){if(_0x525cf6){return _0x1deaed[_0x35c1('0x18')](_0x5e28ad);}return _0x1deaed[_0x35c1('0x19')](_0x5e28ad)[_0x35c1('0x1a')]();};}function respondWithResult(_0x1189c0,_0xa1ebb9){_0xa1ebb9=_0xa1ebb9||0xc8;return function(_0x1dc4e3){if(_0x1dc4e3){return _0x1189c0['status'](_0xa1ebb9)['json'](_0x1dc4e3);}};}function respondWithFilteredResult(_0x416746,_0x555b3d){return function(_0x4a0d73){if(_0x4a0d73){var _0xb8f1=typeof _0x555b3d[_0x35c1('0x1b')]===_0x35c1('0x1c')&&typeof _0x555b3d[_0x35c1('0x1d')]===_0x35c1('0x1c');var _0x506c3d=_0x4a0d73[_0x35c1('0x1e')];var _0x5b954c=_0xb8f1?0x0:_0x555b3d[_0x35c1('0x1b')];var _0x3e5375=_0xb8f1?_0x4a0d73[_0x35c1('0x1e')]:_0x555b3d['offset']+_0x555b3d[_0x35c1('0x1d')];var _0x32cd12;if(_0x3e5375>=_0x506c3d){_0x3e5375=_0x506c3d;_0x32cd12=0xc8;}else{_0x32cd12=0xce;}_0x416746[_0x35c1('0x19')](_0x32cd12);return _0x416746[_0x35c1('0x1f')](_0x35c1('0x20'),_0x5b954c+'-'+_0x3e5375+'/'+_0x506c3d)[_0x35c1('0x21')](_0x4a0d73);}return null;};}function patchUpdates(_0x3ea6ad){return function(_0x1d513f){try{jsonpatch[_0x35c1('0x22')](_0x1d513f,_0x3ea6ad,!![]);}catch(_0x130809){return BPromise[_0x35c1('0x23')](_0x130809);}return _0x1d513f[_0x35c1('0x24')]();};}function saveUpdates(_0x38fffd,_0x2c6427){return function(_0xdbaea3){if(_0xdbaea3){return _0xdbaea3[_0x35c1('0x25')](_0x38fffd)['then'](function(_0x40ef4c){return _0x40ef4c;});}return null;};}function removeEntity(_0x1e1a9f,_0x113ffb){return function(_0xde0cea){if(_0xde0cea){return _0xde0cea['destroy']()[_0x35c1('0x26')](function(){_0x1e1a9f[_0x35c1('0x19')](0xcc)[_0x35c1('0x1a')]();});}};}function handleEntityNotFound(_0x438103,_0x36f56b){return function(_0x28b497){if(!_0x28b497){_0x438103[_0x35c1('0x18')](0x194);}return _0x28b497;};}function handleError(_0x447f74,_0x187eb5){_0x187eb5=_0x187eb5||0x1f4;return function(_0x5eed3d){logger[_0x35c1('0x27')](_0x5eed3d['stack']);if(_0x5eed3d[_0x35c1('0x28')]){delete _0x5eed3d[_0x35c1('0x28')];}_0x447f74[_0x35c1('0x19')](_0x187eb5)['send'](_0x5eed3d);};}exports[_0x35c1('0x29')]=function(_0x2f9683,_0x31cee3){var _0x5ee0a6={},_0x3af9d8={},_0x146fd5={'count':0x0,'rows':[]};var _0x18b5c5=_[_0x35c1('0x2a')](db[_0x35c1('0x2b')]['rawAttributes'],function(_0x44ae72){return{'name':_0x44ae72[_0x35c1('0x2c')],'type':_0x44ae72['type']['key']};});_0x3af9d8[_0x35c1('0x2d')]=_[_0x35c1('0x2a')](_0x18b5c5,_0x35c1('0x28'));_0x3af9d8['query']=_['keys'](_0x2f9683[_0x35c1('0x2e')]);_0x3af9d8[_0x35c1('0x2f')]=_[_0x35c1('0x30')](_0x3af9d8[_0x35c1('0x2d')],_0x3af9d8['query']);_0x5ee0a6[_0x35c1('0x31')]=_[_0x35c1('0x30')](_0x3af9d8[_0x35c1('0x2d')],qs['fields'](_0x2f9683[_0x35c1('0x2e')][_0x35c1('0x32')]));_0x5ee0a6[_0x35c1('0x31')]=_0x5ee0a6[_0x35c1('0x31')]['length']?_0x5ee0a6[_0x35c1('0x31')]:_0x3af9d8['model'];if(!_0x2f9683['query'][_0x35c1('0x33')](_0x35c1('0x34'))){_0x5ee0a6[_0x35c1('0x1d')]=qs['limit'](_0x2f9683['query']['limit']);_0x5ee0a6['offset']=qs[_0x35c1('0x1b')](_0x2f9683['query'][_0x35c1('0x1b')]);}_0x5ee0a6[_0x35c1('0x35')]=qs[_0x35c1('0x36')](_0x2f9683[_0x35c1('0x2e')][_0x35c1('0x36')]);_0x5ee0a6[_0x35c1('0x37')]=qs[_0x35c1('0x2f')](_['pick'](_0x2f9683['query'],_0x3af9d8['filters']),_0x18b5c5);if(_0x2f9683[_0x35c1('0x2e')][_0x35c1('0x38')]){_0x5ee0a6[_0x35c1('0x37')]=_[_0x35c1('0x39')](_0x5ee0a6[_0x35c1('0x37')],{'$or':_[_0x35c1('0x2a')](_0x18b5c5,function(_0x414b8c){if(_0x414b8c['type']!=='VIRTUAL'){var _0x49354d={};_0x49354d[_0x414b8c[_0x35c1('0x28')]]={'$like':'%'+_0x2f9683['query']['filter']+'%'};return _0x49354d;}})});}_0x5ee0a6=_['merge']({},_0x5ee0a6,_0x2f9683[_0x35c1('0x3a')]);var _0x4f5110={'where':_0x5ee0a6[_0x35c1('0x37')]};return db['SquareMessage'][_0x35c1('0x1e')](_0x4f5110)['then'](function(_0x4a3ba7){_0x146fd5['count']=_0x4a3ba7;if(_0x2f9683[_0x35c1('0x2e')][_0x35c1('0x3b')]){_0x5ee0a6[_0x35c1('0x3c')]=[{'all':!![]}];}return db[_0x35c1('0x2b')][_0x35c1('0x3d')](_0x5ee0a6);})[_0x35c1('0x26')](function(_0x278500){_0x146fd5[_0x35c1('0x3e')]=_0x278500;return _0x146fd5;})[_0x35c1('0x26')](respondWithFilteredResult(_0x31cee3,_0x5ee0a6))[_0x35c1('0x3f')](handleError(_0x31cee3,null));};exports[_0x35c1('0x40')]=function(_0x2949f4,_0x40a601){var _0x492ac6={'raw':!![],'where':{'id':_0x2949f4[_0x35c1('0x41')]['id']}},_0x4166fc={};_0x4166fc[_0x35c1('0x2d')]=_['keys'](db[_0x35c1('0x2b')][_0x35c1('0x42')]);_0x4166fc[_0x35c1('0x2e')]=_[_0x35c1('0x43')](_0x2949f4[_0x35c1('0x2e')]);_0x4166fc[_0x35c1('0x2f')]=_[_0x35c1('0x30')](_0x4166fc[_0x35c1('0x2d')],_0x4166fc[_0x35c1('0x2e')]);_0x492ac6[_0x35c1('0x31')]=_[_0x35c1('0x30')](_0x4166fc[_0x35c1('0x2d')],qs[_0x35c1('0x32')](_0x2949f4[_0x35c1('0x2e')][_0x35c1('0x32')]));_0x492ac6[_0x35c1('0x31')]=_0x492ac6['attributes'][_0x35c1('0x44')]?_0x492ac6['attributes']:_0x4166fc[_0x35c1('0x2d')];if(_0x2949f4[_0x35c1('0x2e')][_0x35c1('0x3b')]){_0x492ac6['include']=[{'all':!![]}];}_0x492ac6=_[_0x35c1('0x39')]({},_0x492ac6,_0x2949f4['options']);return db[_0x35c1('0x2b')]['find'](_0x492ac6)[_0x35c1('0x26')](handleEntityNotFound(_0x40a601,null))['then'](respondWithResult(_0x40a601,null))[_0x35c1('0x3f')](handleError(_0x40a601,null));};exports[_0x35c1('0x45')]=function(_0x38d0a1,_0x180a5f){return db[_0x35c1('0x2b')][_0x35c1('0x45')](_0x38d0a1['body'],{})['then'](respondWithResult(_0x180a5f,0xc9))[_0x35c1('0x3f')](handleError(_0x180a5f,null));};exports['update']=function(_0x41e27b,_0x37c550){if(_0x41e27b[_0x35c1('0x46')]['id']){delete _0x41e27b[_0x35c1('0x46')]['id'];}return db[_0x35c1('0x2b')][_0x35c1('0x47')]({'where':{'id':_0x41e27b[_0x35c1('0x41')]['id']}})[_0x35c1('0x26')](handleEntityNotFound(_0x37c550,null))['then'](saveUpdates(_0x41e27b['body'],null))[_0x35c1('0x26')](respondWithResult(_0x37c550,null))[_0x35c1('0x3f')](handleError(_0x37c550,null));};exports[_0x35c1('0x48')]=function(_0x3bce8c,_0x472467){return db[_0x35c1('0x2b')][_0x35c1('0x47')]({'where':{'id':_0x3bce8c[_0x35c1('0x41')]['id']}})['then'](handleEntityNotFound(_0x472467,null))['then'](removeEntity(_0x472467,null))[_0x35c1('0x3f')](handleError(_0x472467,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index da1c48a..b766649 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 _0x8fc4=['../../config/environment','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x339f40,_0xd8ec0a){var _0x513213=function(_0x40e326){while(--_0x40e326){_0x339f40['push'](_0x339f40['shift']());}};_0x513213(++_0xd8ec0a);}(_0x8fc4,0x190));var _0x48fc=function(_0x397a9f,_0x46b24a){_0x397a9f=_0x397a9f-0x0;var _0x4667d5=_0x8fc4[_0x397a9f];return _0x4667d5;};'use strict';var _=require(_0x48fc('0x0'));var util=require(_0x48fc('0x1'));var logger=require(_0x48fc('0x2'))(_0x48fc('0x3'));var moment=require(_0x48fc('0x4'));var BPromise=require(_0x48fc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x48fc('0x6'));var rimraf=require(_0x48fc('0x7'));var config=require(_0x48fc('0x8'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x446c8c,_0x259aed){return _0x446c8c[_0x48fc('0x9')](_0x48fc('0xa'),attributes,{'tableName':_0x48fc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3f3=['exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf3f3,0x12f));var _0x3f3f=function(_0x21b359,_0x4dc80e){_0x21b359=_0x21b359-0x0;var _0x57b8e7=_0xf3f3[_0x21b359];return _0x57b8e7;};'use strict';var _=require(_0x3f3f('0x0'));var util=require(_0x3f3f('0x1'));var logger=require(_0x3f3f('0x2'))(_0x3f3f('0x3'));var moment=require(_0x3f3f('0x4'));var BPromise=require('bluebird');var rp=require(_0x3f3f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f3f('0x6'));var config=require(_0x3f3f('0x7'));var attributes=require(_0x3f3f('0x8'));module[_0x3f3f('0x9')]=function(_0x588521,_0x30d9d6){return _0x588521[_0x3f3f('0xa')](_0x3f3f('0xb'),attributes,{'tableName':_0x3f3f('0xc'),'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 c8e7701..72d36e0 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 _0xe910=['body','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','CreateSquareMessage','SquareMessage','create'];(function(_0x53234a,_0x2855b9){var _0x550ef3=function(_0x53f18d){while(--_0x53f18d){_0x53234a['push'](_0x53234a['shift']());}};_0x550ef3(++_0x2855b9);}(_0xe910,0x154));var _0x0e91=function(_0x77d310,_0x2b2fe7){_0x77d310=_0x77d310-0x0;var _0x2cdce4=_0xe910[_0x77d310];return _0x2cdce4;};'use strict';var _=require(_0x0e91('0x0'));var util=require('util');var moment=require(_0x0e91('0x1'));var BPromise=require(_0x0e91('0x2'));var rs=require(_0x0e91('0x3'));var fs=require('fs');var Redis=require(_0x0e91('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e91('0x5'));var logger=require('../../config/logger')(_0x0e91('0x6'));var config=require(_0x0e91('0x7'));var jayson=require(_0x0e91('0x8'));var client=jayson[_0x0e91('0x9')][_0x0e91('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x103f64,_0x5e9419,_0x235aa1){return new BPromise(function(_0x3e4f6d,_0x46907f){return client[_0x0e91('0xb')](_0x103f64,_0x235aa1)['then'](function(_0xefdc32){logger[_0x0e91('0xc')](_0x0e91('0xd'),_0x5e9419,'request\x20sent');logger[_0x0e91('0xe')](_0x0e91('0xf'),_0x5e9419,_0x0e91('0x10'),JSON[_0x0e91('0x11')](_0xefdc32));if(_0xefdc32['error']){if(_0xefdc32[_0x0e91('0x12')]['code']===0x1f4){logger['error'](_0x0e91('0xd'),_0x5e9419,_0xefdc32[_0x0e91('0x12')][_0x0e91('0x13')]);return _0x46907f(_0xefdc32[_0x0e91('0x12')][_0x0e91('0x13')]);}logger['error'](_0x0e91('0xd'),_0x5e9419,_0xefdc32['error'][_0x0e91('0x13')]);return _0x3e4f6d(_0xefdc32[_0x0e91('0x12')][_0x0e91('0x13')]);}else{logger[_0x0e91('0xc')](_0x0e91('0xd'),_0x5e9419,_0x0e91('0x10'));_0x3e4f6d(_0xefdc32['result']['message']);}})[_0x0e91('0x14')](function(_0x3440d0){logger['error'](_0x0e91('0xd'),_0x5e9419,_0x3440d0);_0x46907f(_0x3440d0);});});}exports[_0x0e91('0x15')]=function(_0x55a167){var _0x15b1be=this;return new Promise(function(_0x1f9b5f,_0x5310f4){return db[_0x0e91('0x16')][_0x0e91('0x17')](_0x55a167[_0x0e91('0x18')],{'raw':_0x55a167[_0x0e91('0x19')]?_0x55a167['options'][_0x0e91('0x1a')]===undefined?!![]:![]:!![]})[_0x0e91('0x1b')](function(_0x27e727){logger[_0x0e91('0xc')](_0x0e91('0x15'),_0x55a167);logger[_0x0e91('0xe')](_0x0e91('0x15'),_0x55a167,JSON[_0x0e91('0x11')](_0x27e727));_0x1f9b5f(_0x27e727);})[_0x0e91('0x14')](function(_0x16458f){logger[_0x0e91('0x12')]('CreateSquareMessage',_0x16458f[_0x0e91('0x13')],_0x55a167);_0x5310f4(_0x15b1be['error'](0x1f4,_0x16458f[_0x0e91('0x13')]));});});}; \ No newline at end of file +var _0x481c=['CreateSquareMessage','SquareMessage','body','options','raw','stringify','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x40a4a9,_0x393129){var _0x37268f=function(_0xf04248){while(--_0xf04248){_0x40a4a9['push'](_0x40a4a9['shift']());}};_0x37268f(++_0x393129);}(_0x481c,0x1d1));var _0xc481=function(_0x31befd,_0x4ff14d){_0x31befd=_0x31befd-0x0;var _0x5295eb=_0x481c[_0x31befd];return _0x5295eb;};'use strict';var _=require(_0xc481('0x0'));var util=require('util');var moment=require(_0xc481('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc481('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xc481('0x3'));var logger=require(_0xc481('0x4'))('rpc');var config=require(_0xc481('0x5'));var jayson=require(_0xc481('0x6'));var client=jayson[_0xc481('0x7')][_0xc481('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x40eb03,_0xd9eb81,_0x2d7139){return new BPromise(function(_0x1a59df,_0x5edf63){return client[_0xc481('0x9')](_0x40eb03,_0x2d7139)[_0xc481('0xa')](function(_0x481eb1){logger['info'](_0xc481('0xb'),_0xd9eb81,'request\x20sent');logger[_0xc481('0xc')](_0xc481('0xd'),_0xd9eb81,_0xc481('0xe'),JSON['stringify'](_0x481eb1));if(_0x481eb1[_0xc481('0xf')]){if(_0x481eb1['error'][_0xc481('0x10')]===0x1f4){logger['error'](_0xc481('0xb'),_0xd9eb81,_0x481eb1[_0xc481('0xf')][_0xc481('0x11')]);return _0x5edf63(_0x481eb1[_0xc481('0xf')][_0xc481('0x11')]);}logger[_0xc481('0xf')](_0xc481('0xb'),_0xd9eb81,_0x481eb1[_0xc481('0xf')][_0xc481('0x11')]);return _0x1a59df(_0x481eb1[_0xc481('0xf')][_0xc481('0x11')]);}else{logger[_0xc481('0x12')]('SquareMessage,\x20%s,\x20%s',_0xd9eb81,_0xc481('0xe'));_0x1a59df(_0x481eb1[_0xc481('0x13')]['message']);}})[_0xc481('0x14')](function(_0x5093d1){logger[_0xc481('0xf')](_0xc481('0xb'),_0xd9eb81,_0x5093d1);_0x5edf63(_0x5093d1);});});}exports[_0xc481('0x15')]=function(_0x51bc49){var _0x2b0117=this;return new Promise(function(_0xa11c12,_0x147460){return db[_0xc481('0x16')]['create'](_0x51bc49[_0xc481('0x17')],{'raw':_0x51bc49[_0xc481('0x18')]?_0x51bc49[_0xc481('0x18')][_0xc481('0x19')]===undefined?!![]:![]:!![]})[_0xc481('0xa')](function(_0x425183){logger[_0xc481('0x12')]('CreateSquareMessage',_0x51bc49);logger[_0xc481('0xc')](_0xc481('0x15'),_0x51bc49,JSON[_0xc481('0x1a')](_0x425183));_0xa11c12(_0x425183);})['catch'](function(_0x35b37c){logger[_0xc481('0xf')](_0xc481('0x15'),_0x35b37c[_0xc481('0x11')],_0x51bc49);_0x147460(_0x2b0117[_0xc481('0xf')](0x1f4,_0x35b37c[_0xc481('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d5821d2..7988d30 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 _0x9cce=['index','/:id/test','test','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x538e84,_0x8d8671){var _0x328e72=function(_0x44239c){while(--_0x44239c){_0x538e84['push'](_0x538e84['shift']());}};_0x328e72(++_0x8d8671);}(_0x9cce,0xb4));var _0xe9cc=function(_0x45f234,_0x4a6ca5){_0x45f234=_0x45f234-0x0;var _0x5435b0=_0x9cce[_0x45f234];return _0x5435b0;};'use strict';var multer=require(_0xe9cc('0x0'));var util=require(_0xe9cc('0x1'));var path=require(_0xe9cc('0x2'));var timeout=require(_0xe9cc('0x3'));var express=require('express');var router=express[_0xe9cc('0x4')]();var fs_extra=require(_0xe9cc('0x5'));var auth=require(_0xe9cc('0x6'));var interaction=require(_0xe9cc('0x7'));var config=require('../../config/environment');var controller=require('./squareOdbc.controller');router[_0xe9cc('0x8')]('/',auth[_0xe9cc('0x9')](),controller[_0xe9cc('0xa')]);router[_0xe9cc('0x8')]('/:id',auth[_0xe9cc('0x9')](),controller['show']);router[_0xe9cc('0x8')](_0xe9cc('0xb'),auth[_0xe9cc('0x9')](),timeout('15s'),controller[_0xe9cc('0xc')]);router[_0xe9cc('0xd')]('/',auth['isAuthenticated'](),controller[_0xe9cc('0xe')]);router[_0xe9cc('0xf')](_0xe9cc('0x10'),auth[_0xe9cc('0x9')](),controller[_0xe9cc('0x11')]);router[_0xe9cc('0x12')](_0xe9cc('0x10'),auth[_0xe9cc('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2dfe=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','/:id/test','15s','post','put','update','path','connect-timeout'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2dfe,0x18a));var _0xe2df=function(_0x39cdd9,_0x1f8b80){_0x39cdd9=_0x39cdd9-0x0;var _0x59a06e=_0x2dfe[_0x39cdd9];return _0x59a06e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe2df('0x0'));var timeout=require(_0xe2df('0x1'));var express=require('express');var router=express[_0xe2df('0x2')]();var fs_extra=require(_0xe2df('0x3'));var auth=require(_0xe2df('0x4'));var interaction=require(_0xe2df('0x5'));var config=require(_0xe2df('0x6'));var controller=require(_0xe2df('0x7'));router[_0xe2df('0x8')]('/',auth['isAuthenticated'](),controller[_0xe2df('0x9')]);router[_0xe2df('0x8')](_0xe2df('0xa'),auth[_0xe2df('0xb')](),controller[_0xe2df('0xc')]);router['get'](_0xe2df('0xd'),auth[_0xe2df('0xb')](),timeout(_0xe2df('0xe')),controller['test']);router[_0xe2df('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe2df('0x10')](_0xe2df('0xa'),auth[_0xe2df('0xb')](),controller[_0xe2df('0x11')]);router['delete'](_0xe2df('0xa'),auth[_0xe2df('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index eeed550..b446ac3 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 _0xf30e=['sequelize','exports','STRING','name'];(function(_0x32e9d6,_0x2b80d7){var _0x268835=function(_0x4e3741){while(--_0x4e3741){_0x32e9d6['push'](_0x32e9d6['shift']());}};_0x268835(++_0x2b80d7);}(_0xf30e,0x1cc));var _0xef30=function(_0x57fa7e,_0xd0b5ce){_0x57fa7e=_0x57fa7e-0x0;var _0x320671=_0xf30e[_0x57fa7e];return _0x320671;};'use strict';var Sequelize=require(_0xef30('0x0'));module[_0xef30('0x1')]={'name':{'type':Sequelize[_0xef30('0x2')],'unique':_0xef30('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xef30('0x2')]},'description':{'type':Sequelize[_0xef30('0x2')]}}; \ No newline at end of file +var _0x3d18=['exports','STRING','sequelize'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0x3d18,0x1d0));var _0x83d1=function(_0x4ae202,_0x16a768){_0x4ae202=_0x4ae202-0x0;var _0x2b362f=_0x3d18[_0x4ae202];return _0x2b362f;};'use strict';var Sequelize=require(_0x83d1('0x0'));module[_0x83d1('0x1')]={'name':{'type':Sequelize[_0x83d1('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x83d1('0x2')]},'description':{'type':Sequelize[_0x83d1('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index c158066..e1b06e3 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 _0x5407=['UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','include','SquareOdbc','findAll','rows','show','keys','includeAll','find','catch','create','body','user','role'];(function(_0x575228,_0x3f9bc1){var _0x4cb11e=function(_0x36820e){while(--_0x36820e){_0x575228['push'](_0x575228['shift']());}};_0x4cb11e(++_0x3f9bc1);}(_0x5407,0xb7));var _0x7540=function(_0x128651,_0xa5c7ad){_0x128651=_0x128651-0x0;var _0xcc6aaf=_0x5407[_0x128651];return _0xcc6aaf;};'use strict';var emlformat=require(_0x7540('0x0'));var rimraf=require(_0x7540('0x1'));var zipdir=require(_0x7540('0x2'));var jsonpatch=require(_0x7540('0x3'));var rp=require(_0x7540('0x4'));var moment=require(_0x7540('0x5'));var BPromise=require(_0x7540('0x6'));var Mustache=require(_0x7540('0x7'));var util=require(_0x7540('0x8'));var path=require('path');var sox=require(_0x7540('0x9'));var csv=require('to-csv');var ejs=require(_0x7540('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7540('0xb'));var squel=require(_0x7540('0xc'));var crypto=require(_0x7540('0xd'));var jsforce=require(_0x7540('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7540('0xf'));var querystring=require(_0x7540('0x10'));var Papa=require(_0x7540('0x11'));var Redis=require('ioredis');var authService=require(_0x7540('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7540('0x13'));var hardwareService=require(_0x7540('0x14'));var logger=require(_0x7540('0x15'))('api');var utils=require(_0x7540('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7540('0x17'))['db'];function respondWithStatusCode(_0x295790,_0xf62a8d){_0xf62a8d=_0xf62a8d||0xcc;return function(_0x4d9cd6){if(_0x4d9cd6){return _0x295790[_0x7540('0x18')](_0xf62a8d);}return _0x295790[_0x7540('0x19')](_0xf62a8d)[_0x7540('0x1a')]();};}function respondWithResult(_0x42e659,_0x1e5af5){_0x1e5af5=_0x1e5af5||0xc8;return function(_0x112637){if(_0x112637){return _0x42e659['status'](_0x1e5af5)[_0x7540('0x1b')](_0x112637);}};}function respondWithFilteredResult(_0x54f314,_0x279f63){return function(_0xe013a0){if(_0xe013a0){var _0x4eb160=typeof _0x279f63['offset']===_0x7540('0x1c')&&typeof _0x279f63[_0x7540('0x1d')]===_0x7540('0x1c');var _0x3a0cca=_0xe013a0[_0x7540('0x1e')];var _0x2ce83f=_0x4eb160?0x0:_0x279f63[_0x7540('0x1f')];var _0x50e755=_0x4eb160?_0xe013a0['count']:_0x279f63[_0x7540('0x1f')]+_0x279f63[_0x7540('0x1d')];var _0x1e3b48;if(_0x50e755>=_0x3a0cca){_0x50e755=_0x3a0cca;_0x1e3b48=0xc8;}else{_0x1e3b48=0xce;}_0x54f314['status'](_0x1e3b48);return _0x54f314[_0x7540('0x20')](_0x7540('0x21'),_0x2ce83f+'-'+_0x50e755+'/'+_0x3a0cca)[_0x7540('0x1b')](_0xe013a0);}return null;};}function patchUpdates(_0x541d27){return function(_0x1e7511){try{jsonpatch[_0x7540('0x22')](_0x1e7511,_0x541d27,!![]);}catch(_0x2d4b47){return BPromise[_0x7540('0x23')](_0x2d4b47);}return _0x1e7511[_0x7540('0x24')]();};}function saveUpdates(_0x2532c2,_0x2ac396){return function(_0x1706b7){if(_0x1706b7){return _0x1706b7[_0x7540('0x25')](_0x2532c2)[_0x7540('0x26')](function(_0x28c59d){return _0x28c59d;});}return null;};}function removeEntity(_0x59263d,_0x3d51a8){return function(_0xca2a6a){if(_0xca2a6a){return _0xca2a6a[_0x7540('0x27')]()[_0x7540('0x26')](function(){var _0x54b74a=_0xca2a6a[_0x7540('0x28')]({'plain':!![]});var _0x1a67a6='ODBC';return db['UserProfileResource'][_0x7540('0x27')]({'where':{'type':_0x1a67a6,'resourceId':_0x54b74a['id']}})['then'](function(){return _0xca2a6a;});})[_0x7540('0x26')](function(){_0x59263d[_0x7540('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x525601,_0x2da796){return function(_0x410b52){if(!_0x410b52){_0x525601['sendStatus'](0x194);}return _0x410b52;};}function handleError(_0x4bc93e,_0x206cb4){_0x206cb4=_0x206cb4||0x1f4;return function(_0x360d4a){logger['error'](_0x360d4a[_0x7540('0x29')]);if(_0x360d4a[_0x7540('0x2a')]){delete _0x360d4a[_0x7540('0x2a')];}_0x4bc93e[_0x7540('0x19')](_0x206cb4)[_0x7540('0x2b')](_0x360d4a);};}exports[_0x7540('0x2c')]=function(_0x32114f,_0x34da37){var _0x229f73={},_0x8c8e15={},_0x14d67b={'count':0x0,'rows':[]};var _0x274f77=_[_0x7540('0x2d')](db['SquareOdbc'][_0x7540('0x2e')],function(_0x260d3b){return{'name':_0x260d3b[_0x7540('0x2f')],'type':_0x260d3b[_0x7540('0x30')]['key']};});_0x8c8e15[_0x7540('0x31')]=_[_0x7540('0x2d')](_0x274f77,_0x7540('0x2a'));_0x8c8e15[_0x7540('0x32')]=_['keys'](_0x32114f['query']);_0x8c8e15[_0x7540('0x33')]=_[_0x7540('0x34')](_0x8c8e15[_0x7540('0x31')],_0x8c8e15[_0x7540('0x32')]);_0x229f73[_0x7540('0x35')]=_[_0x7540('0x34')](_0x8c8e15['model'],qs[_0x7540('0x36')](_0x32114f['query'][_0x7540('0x36')]));_0x229f73[_0x7540('0x35')]=_0x229f73[_0x7540('0x35')]['length']?_0x229f73[_0x7540('0x35')]:_0x8c8e15['model'];if(!_0x32114f[_0x7540('0x32')][_0x7540('0x37')](_0x7540('0x38'))){_0x229f73[_0x7540('0x1d')]=qs[_0x7540('0x1d')](_0x32114f['query'][_0x7540('0x1d')]);_0x229f73[_0x7540('0x1f')]=qs[_0x7540('0x1f')](_0x32114f['query'][_0x7540('0x1f')]);}_0x229f73['order']=qs[_0x7540('0x39')](_0x32114f[_0x7540('0x32')][_0x7540('0x39')]);_0x229f73['where']=qs[_0x7540('0x33')](_['pick'](_0x32114f[_0x7540('0x32')],_0x8c8e15[_0x7540('0x33')]),_0x274f77);if(_0x32114f[_0x7540('0x32')][_0x7540('0x3a')]){_0x229f73[_0x7540('0x3b')]=_['merge'](_0x229f73[_0x7540('0x3b')],{'$or':_[_0x7540('0x2d')](_0x274f77,function(_0x3435a0){if(_0x3435a0[_0x7540('0x30')]!==_0x7540('0x3c')){var _0x12351e={};_0x12351e[_0x3435a0[_0x7540('0x2a')]]={'$like':'%'+_0x32114f['query'][_0x7540('0x3a')]+'%'};return _0x12351e;}})});}_0x229f73=_[_0x7540('0x3d')]({},_0x229f73,_0x32114f['options']);var _0x365753={'where':_0x229f73['where']};return db['SquareOdbc']['count'](_0x365753)[_0x7540('0x26')](function(_0x1fd479){_0x14d67b['count']=_0x1fd479;if(_0x32114f[_0x7540('0x32')]['includeAll']){_0x229f73[_0x7540('0x3e')]=[{'all':!![]}];}return db[_0x7540('0x3f')][_0x7540('0x40')](_0x229f73);})[_0x7540('0x26')](function(_0x4e1ec5){_0x14d67b[_0x7540('0x41')]=_0x4e1ec5;return _0x14d67b;})['then'](respondWithFilteredResult(_0x34da37,_0x229f73))['catch'](handleError(_0x34da37,null));};exports[_0x7540('0x42')]=function(_0x2a57a6,_0x37b3c1){var _0x42b762={'raw':!![],'where':{'id':_0x2a57a6['params']['id']}},_0x374990={};_0x374990[_0x7540('0x31')]=_['keys'](db[_0x7540('0x3f')]['rawAttributes']);_0x374990[_0x7540('0x32')]=_[_0x7540('0x43')](_0x2a57a6[_0x7540('0x32')]);_0x374990[_0x7540('0x33')]=_[_0x7540('0x34')](_0x374990[_0x7540('0x31')],_0x374990[_0x7540('0x32')]);_0x42b762[_0x7540('0x35')]=_['intersection'](_0x374990['model'],qs['fields'](_0x2a57a6[_0x7540('0x32')][_0x7540('0x36')]));_0x42b762[_0x7540('0x35')]=_0x42b762[_0x7540('0x35')]['length']?_0x42b762[_0x7540('0x35')]:_0x374990['model'];if(_0x2a57a6[_0x7540('0x32')][_0x7540('0x44')]){_0x42b762['include']=[{'all':!![]}];}_0x42b762=_['merge']({},_0x42b762,_0x2a57a6['options']);return db[_0x7540('0x3f')][_0x7540('0x45')](_0x42b762)[_0x7540('0x26')](handleEntityNotFound(_0x37b3c1,null))[_0x7540('0x26')](respondWithResult(_0x37b3c1,null))[_0x7540('0x46')](handleError(_0x37b3c1,null));};exports[_0x7540('0x47')]=function(_0x28afc7,_0x2a2517){return db[_0x7540('0x3f')]['create'](_0x28afc7[_0x7540('0x48')],{})[_0x7540('0x26')](function(_0x3f3ddd){var _0x4a2317=_0x28afc7[_0x7540('0x49')][_0x7540('0x28')]({'plain':!![]});if(!_0x4a2317)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a2317[_0x7540('0x4a')]===_0x7540('0x49')){var _0x397730=_0x3f3ddd[_0x7540('0x28')]({'plain':!![]});var _0x16d95a='ODBC';return db[_0x7540('0x4b')]['find']({'where':{'name':_0x16d95a,'userProfileId':_0x4a2317[_0x7540('0x4c')]},'raw':!![]})['then'](function(_0xac5638){if(_0xac5638&&_0xac5638[_0x7540('0x4d')]===0x0){return db[_0x7540('0x4e')][_0x7540('0x47')]({'name':_0x397730[_0x7540('0x2a')],'resourceId':_0x397730['id'],'type':_0xac5638['name'],'sectionId':_0xac5638['id']},{})['then'](function(){return _0x3f3ddd;});}else{return _0x3f3ddd;}})[_0x7540('0x46')](function(_0x39f27a){logger[_0x7540('0x4f')](_0x7540('0x50'),_0x39f27a);throw _0x39f27a;});}return _0x3f3ddd;})['then'](respondWithResult(_0x2a2517,0xc9))[_0x7540('0x46')](handleError(_0x2a2517,null));};exports['update']=function(_0x2a0ad7,_0xe9e941){if(_0x2a0ad7[_0x7540('0x48')]['id']){delete _0x2a0ad7[_0x7540('0x48')]['id'];}return db[_0x7540('0x3f')][_0x7540('0x45')]({'where':{'id':_0x2a0ad7[_0x7540('0x51')]['id']}})[_0x7540('0x26')](handleEntityNotFound(_0xe9e941,null))[_0x7540('0x26')](saveUpdates(_0x2a0ad7[_0x7540('0x48')],null))[_0x7540('0x26')](respondWithResult(_0xe9e941,null))['catch'](handleError(_0xe9e941,null));};exports['destroy']=function(_0x9e39ed,_0x44e71d){return db[_0x7540('0x3f')][_0x7540('0x45')]({'where':{'id':_0x9e39ed['params']['id']}})[_0x7540('0x26')](handleEntityNotFound(_0x44e71d,null))[_0x7540('0x26')](removeEntity(_0x44e71d,null))[_0x7540('0x46')](handleError(_0x44e71d,null));};exports['test']=function(_0x5a7616,_0x48fa0f,_0x3dfdd6){var _0x3b0335;return db[_0x7540('0x3f')][_0x7540('0x45')]({'where':{'id':_0x5a7616[_0x7540('0x51')]['id']},'attributes':['id',_0x7540('0x52')]})[_0x7540('0x26')](handleEntityNotFound(_0x48fa0f,null))[_0x7540('0x26')](function(_0x45cecd){if(_0x45cecd){var _0x437911=require(_0x7540('0x53'))();_0x437911[_0x7540('0x54')](_0x45cecd[_0x7540('0x52')]);_0x437911[_0x7540('0x55')]();return _0x45cecd;}})['then'](respondWithResult(_0x48fa0f,null))[_0x7540('0x46')](handleError(_0x48fa0f,null));}; \ No newline at end of file +var _0x9a3f=['order','sort','where','merge','VIRTUAL','filter','options','SquareOdbc','include','findAll','rows','catch','show','params','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','test','dsn','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit'];(function(_0x34a84b,_0x503fad){var _0xae9f3a=function(_0x885a51){while(--_0x885a51){_0x34a84b['push'](_0x34a84b['shift']());}};_0xae9f3a(++_0x503fad);}(_0x9a3f,0x72));var _0xf9a3=function(_0xd67723,_0x1e576f){_0xd67723=_0xd67723-0x0;var _0x53b62b=_0x9a3f[_0xd67723];return _0x53b62b;};'use strict';var emlformat=require(_0xf9a3('0x0'));var rimraf=require(_0xf9a3('0x1'));var zipdir=require(_0xf9a3('0x2'));var jsonpatch=require(_0xf9a3('0x3'));var rp=require(_0xf9a3('0x4'));var moment=require(_0xf9a3('0x5'));var BPromise=require(_0xf9a3('0x6'));var Mustache=require(_0xf9a3('0x7'));var util=require('util');var path=require(_0xf9a3('0x8'));var sox=require('sox');var csv=require(_0xf9a3('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf9a3('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf9a3('0xb'));var jsforce=require(_0xf9a3('0xc'));var deskjs=require(_0xf9a3('0xd'));var toCsv=require(_0xf9a3('0x9'));var querystring=require(_0xf9a3('0xe'));var Papa=require(_0xf9a3('0xf'));var Redis=require(_0xf9a3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf9a3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf9a3('0x12'));var logger=require(_0xf9a3('0x13'))(_0xf9a3('0x14'));var utils=require(_0xf9a3('0x15'));var config=require(_0xf9a3('0x16'));var licenseUtil=require(_0xf9a3('0x17'));var db=require(_0xf9a3('0x18'))['db'];function respondWithStatusCode(_0x535a40,_0x3a0086){_0x3a0086=_0x3a0086||0xcc;return function(_0x484122){if(_0x484122){return _0x535a40[_0xf9a3('0x19')](_0x3a0086);}return _0x535a40[_0xf9a3('0x1a')](_0x3a0086)['end']();};}function respondWithResult(_0x1c022d,_0x1d44dd){_0x1d44dd=_0x1d44dd||0xc8;return function(_0x13ccfd){if(_0x13ccfd){return _0x1c022d['status'](_0x1d44dd)[_0xf9a3('0x1b')](_0x13ccfd);}};}function respondWithFilteredResult(_0x517367,_0x671fbd){return function(_0x456cb5){if(_0x456cb5){var _0x2589db=typeof _0x671fbd['offset']===_0xf9a3('0x1c')&&typeof _0x671fbd[_0xf9a3('0x1d')]===_0xf9a3('0x1c');var _0x35b907=_0x456cb5['count'];var _0x3a1802=_0x2589db?0x0:_0x671fbd['offset'];var _0x3a9a54=_0x2589db?_0x456cb5[_0xf9a3('0x1e')]:_0x671fbd[_0xf9a3('0x1f')]+_0x671fbd[_0xf9a3('0x1d')];var _0x36d365;if(_0x3a9a54>=_0x35b907){_0x3a9a54=_0x35b907;_0x36d365=0xc8;}else{_0x36d365=0xce;}_0x517367['status'](_0x36d365);return _0x517367[_0xf9a3('0x20')]('Content-Range',_0x3a1802+'-'+_0x3a9a54+'/'+_0x35b907)[_0xf9a3('0x1b')](_0x456cb5);}return null;};}function patchUpdates(_0x4c39c8){return function(_0x20570a){try{jsonpatch[_0xf9a3('0x21')](_0x20570a,_0x4c39c8,!![]);}catch(_0x4fe2d1){return BPromise[_0xf9a3('0x22')](_0x4fe2d1);}return _0x20570a[_0xf9a3('0x23')]();};}function saveUpdates(_0x16a785,_0x252143){return function(_0x14534b){if(_0x14534b){return _0x14534b[_0xf9a3('0x24')](_0x16a785)[_0xf9a3('0x25')](function(_0x1b1576){return _0x1b1576;});}return null;};}function removeEntity(_0x5730bb,_0xd8c6ef){return function(_0x20124a){if(_0x20124a){return _0x20124a[_0xf9a3('0x26')]()[_0xf9a3('0x25')](function(){var _0x1e8e87=_0x20124a[_0xf9a3('0x27')]({'plain':!![]});var _0x48fc4a=_0xf9a3('0x28');return db[_0xf9a3('0x29')][_0xf9a3('0x26')]({'where':{'type':_0x48fc4a,'resourceId':_0x1e8e87['id']}})['then'](function(){return _0x20124a;});})[_0xf9a3('0x25')](function(){_0x5730bb['status'](0xcc)[_0xf9a3('0x2a')]();});}};}function handleEntityNotFound(_0xa05c36,_0x3bc1be){return function(_0x3967fc){if(!_0x3967fc){_0xa05c36[_0xf9a3('0x19')](0x194);}return _0x3967fc;};}function handleError(_0x5a1e0b,_0x268162){_0x268162=_0x268162||0x1f4;return function(_0x50a39f){logger[_0xf9a3('0x2b')](_0x50a39f[_0xf9a3('0x2c')]);if(_0x50a39f['name']){delete _0x50a39f[_0xf9a3('0x2d')];}_0x5a1e0b[_0xf9a3('0x1a')](_0x268162)[_0xf9a3('0x2e')](_0x50a39f);};}exports[_0xf9a3('0x2f')]=function(_0x49099d,_0x42e8b6){var _0x55251f={},_0x555385={},_0xdc9c49={'count':0x0,'rows':[]};var _0x5cf5b0=_[_0xf9a3('0x30')](db['SquareOdbc'][_0xf9a3('0x31')],function(_0x113afd){return{'name':_0x113afd[_0xf9a3('0x32')],'type':_0x113afd[_0xf9a3('0x33')][_0xf9a3('0x34')]};});_0x555385[_0xf9a3('0x35')]=_['map'](_0x5cf5b0,_0xf9a3('0x2d'));_0x555385[_0xf9a3('0x36')]=_[_0xf9a3('0x37')](_0x49099d[_0xf9a3('0x36')]);_0x555385[_0xf9a3('0x38')]=_['intersection'](_0x555385[_0xf9a3('0x35')],_0x555385[_0xf9a3('0x36')]);_0x55251f['attributes']=_['intersection'](_0x555385[_0xf9a3('0x35')],qs['fields'](_0x49099d[_0xf9a3('0x36')][_0xf9a3('0x39')]));_0x55251f[_0xf9a3('0x3a')]=_0x55251f[_0xf9a3('0x3a')][_0xf9a3('0x3b')]?_0x55251f[_0xf9a3('0x3a')]:_0x555385[_0xf9a3('0x35')];if(!_0x49099d[_0xf9a3('0x36')][_0xf9a3('0x3c')](_0xf9a3('0x3d'))){_0x55251f[_0xf9a3('0x1d')]=qs['limit'](_0x49099d[_0xf9a3('0x36')]['limit']);_0x55251f[_0xf9a3('0x1f')]=qs['offset'](_0x49099d['query'][_0xf9a3('0x1f')]);}_0x55251f[_0xf9a3('0x3e')]=qs['sort'](_0x49099d[_0xf9a3('0x36')][_0xf9a3('0x3f')]);_0x55251f[_0xf9a3('0x40')]=qs[_0xf9a3('0x38')](_['pick'](_0x49099d['query'],_0x555385['filters']),_0x5cf5b0);if(_0x49099d[_0xf9a3('0x36')]['filter']){_0x55251f[_0xf9a3('0x40')]=_[_0xf9a3('0x41')](_0x55251f[_0xf9a3('0x40')],{'$or':_[_0xf9a3('0x30')](_0x5cf5b0,function(_0xe9c818){if(_0xe9c818[_0xf9a3('0x33')]!==_0xf9a3('0x42')){var _0x1a5637={};_0x1a5637[_0xe9c818[_0xf9a3('0x2d')]]={'$like':'%'+_0x49099d[_0xf9a3('0x36')][_0xf9a3('0x43')]+'%'};return _0x1a5637;}})});}_0x55251f=_[_0xf9a3('0x41')]({},_0x55251f,_0x49099d[_0xf9a3('0x44')]);var _0x209beb={'where':_0x55251f[_0xf9a3('0x40')]};return db[_0xf9a3('0x45')]['count'](_0x209beb)[_0xf9a3('0x25')](function(_0x3d3502){_0xdc9c49[_0xf9a3('0x1e')]=_0x3d3502;if(_0x49099d['query']['includeAll']){_0x55251f[_0xf9a3('0x46')]=[{'all':!![]}];}return db['SquareOdbc'][_0xf9a3('0x47')](_0x55251f);})[_0xf9a3('0x25')](function(_0x12ec69){_0xdc9c49[_0xf9a3('0x48')]=_0x12ec69;return _0xdc9c49;})[_0xf9a3('0x25')](respondWithFilteredResult(_0x42e8b6,_0x55251f))[_0xf9a3('0x49')](handleError(_0x42e8b6,null));};exports[_0xf9a3('0x4a')]=function(_0x3b407a,_0x34f9ae){var _0x51c36e={'raw':!![],'where':{'id':_0x3b407a[_0xf9a3('0x4b')]['id']}},_0x3ff5d4={};_0x3ff5d4[_0xf9a3('0x35')]=_[_0xf9a3('0x37')](db[_0xf9a3('0x45')][_0xf9a3('0x31')]);_0x3ff5d4['query']=_[_0xf9a3('0x37')](_0x3b407a[_0xf9a3('0x36')]);_0x3ff5d4['filters']=_[_0xf9a3('0x4c')](_0x3ff5d4[_0xf9a3('0x35')],_0x3ff5d4['query']);_0x51c36e[_0xf9a3('0x3a')]=_[_0xf9a3('0x4c')](_0x3ff5d4[_0xf9a3('0x35')],qs[_0xf9a3('0x39')](_0x3b407a[_0xf9a3('0x36')][_0xf9a3('0x39')]));_0x51c36e['attributes']=_0x51c36e['attributes'][_0xf9a3('0x3b')]?_0x51c36e[_0xf9a3('0x3a')]:_0x3ff5d4[_0xf9a3('0x35')];if(_0x3b407a['query'][_0xf9a3('0x4d')]){_0x51c36e['include']=[{'all':!![]}];}_0x51c36e=_[_0xf9a3('0x41')]({},_0x51c36e,_0x3b407a[_0xf9a3('0x44')]);return db[_0xf9a3('0x45')][_0xf9a3('0x4e')](_0x51c36e)[_0xf9a3('0x25')](handleEntityNotFound(_0x34f9ae,null))[_0xf9a3('0x25')](respondWithResult(_0x34f9ae,null))[_0xf9a3('0x49')](handleError(_0x34f9ae,null));};exports[_0xf9a3('0x4f')]=function(_0x381648,_0x3ca967){return db[_0xf9a3('0x45')][_0xf9a3('0x4f')](_0x381648[_0xf9a3('0x50')],{})[_0xf9a3('0x25')](function(_0x5c033f){var _0x61becb=_0x381648[_0xf9a3('0x51')][_0xf9a3('0x27')]({'plain':!![]});if(!_0x61becb)throw new Error(_0xf9a3('0x52'));if(_0x61becb[_0xf9a3('0x53')]==='user'){var _0x319074=_0x5c033f[_0xf9a3('0x27')]({'plain':!![]});var _0x41fa02=_0xf9a3('0x28');return db['UserProfileSection'][_0xf9a3('0x4e')]({'where':{'name':_0x41fa02,'userProfileId':_0x61becb['userProfileId']},'raw':!![]})[_0xf9a3('0x25')](function(_0x123374){if(_0x123374&&_0x123374[_0xf9a3('0x54')]===0x0){return db[_0xf9a3('0x29')][_0xf9a3('0x4f')]({'name':_0x319074[_0xf9a3('0x2d')],'resourceId':_0x319074['id'],'type':_0x123374[_0xf9a3('0x2d')],'sectionId':_0x123374['id']},{})[_0xf9a3('0x25')](function(){return _0x5c033f;});}else{return _0x5c033f;}})[_0xf9a3('0x49')](function(_0x3d6a43){logger[_0xf9a3('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3d6a43);throw _0x3d6a43;});}return _0x5c033f;})[_0xf9a3('0x25')](respondWithResult(_0x3ca967,0xc9))[_0xf9a3('0x49')](handleError(_0x3ca967,null));};exports[_0xf9a3('0x24')]=function(_0x3c552a,_0x3f6d7a){if(_0x3c552a[_0xf9a3('0x50')]['id']){delete _0x3c552a[_0xf9a3('0x50')]['id'];}return db[_0xf9a3('0x45')][_0xf9a3('0x4e')]({'where':{'id':_0x3c552a[_0xf9a3('0x4b')]['id']}})[_0xf9a3('0x25')](handleEntityNotFound(_0x3f6d7a,null))[_0xf9a3('0x25')](saveUpdates(_0x3c552a[_0xf9a3('0x50')],null))[_0xf9a3('0x25')](respondWithResult(_0x3f6d7a,null))[_0xf9a3('0x49')](handleError(_0x3f6d7a,null));};exports['destroy']=function(_0x311d75,_0x2b3ed8){return db[_0xf9a3('0x45')][_0xf9a3('0x4e')]({'where':{'id':_0x311d75[_0xf9a3('0x4b')]['id']}})[_0xf9a3('0x25')](handleEntityNotFound(_0x2b3ed8,null))['then'](removeEntity(_0x2b3ed8,null))[_0xf9a3('0x49')](handleError(_0x2b3ed8,null));};exports[_0xf9a3('0x55')]=function(_0x3fff7a,_0x5b301b,_0x45df3f){var _0x1e4f19;return db[_0xf9a3('0x45')][_0xf9a3('0x4e')]({'where':{'id':_0x3fff7a[_0xf9a3('0x4b')]['id']},'attributes':['id',_0xf9a3('0x56')]})[_0xf9a3('0x25')](handleEntityNotFound(_0x5b301b,null))[_0xf9a3('0x25')](function(_0x3a864c){if(_0x3a864c){var _0x1118e5=require('odbc')();_0x1118e5['openSync'](_0x3a864c[_0xf9a3('0x56')]);_0x1118e5[_0xf9a3('0x57')]();return _0x3a864c;}})[_0xf9a3('0x25')](respondWithResult(_0x5b301b,null))[_0xf9a3('0x49')](handleError(_0x5b301b,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 8fb6bb5..6979ee4 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 _0xcf49=['SquareOdbc','square_odbc','util','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','define'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xcf49,0x11a));var _0x9cf4=function(_0x32c98a,_0x5e6eb0){_0x32c98a=_0x32c98a-0x0;var _0x1796d3=_0xcf49[_0x32c98a];return _0x1796d3;};'use strict';var _=require('lodash');var util=require(_0x9cf4('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9cf4('0x1'));var BPromise=require(_0x9cf4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9cf4('0x3'));var rimraf=require(_0x9cf4('0x4'));var config=require(_0x9cf4('0x5'));var attributes=require(_0x9cf4('0x6'));module['exports']=function(_0x340a8a,_0xc2492c){return _0x340a8a[_0x9cf4('0x7')](_0x9cf4('0x8'),attributes,{'tableName':_0x9cf4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb728=['./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0xb728,0xe2));var _0x8b72=function(_0x11eb02,_0x5805c9){_0x11eb02=_0x11eb02-0x0;var _0x13245d=_0xb728[_0x11eb02];return _0x13245d;};'use strict';var _=require(_0x8b72('0x0'));var util=require(_0x8b72('0x1'));var logger=require(_0x8b72('0x2'))(_0x8b72('0x3'));var moment=require('moment');var BPromise=require(_0x8b72('0x4'));var rp=require(_0x8b72('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b72('0x6'));var config=require(_0x8b72('0x7'));var attributes=require(_0x8b72('0x8'));module[_0x8b72('0x9')]=function(_0x462703,_0x425832){return _0x462703[_0x8b72('0xa')](_0x8b72('0xb'),attributes,{'tableName':_0x8b72('0xc'),'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 4c26193..629bdee 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 _0x8d39=['map','model','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','result','catch','ShowSquareOdbc','options','where','attributes','include'];(function(_0x1bc988,_0x18fe71){var _0x581896=function(_0x25db17){while(--_0x25db17){_0x1bc988['push'](_0x1bc988['shift']());}};_0x581896(++_0x18fe71);}(_0x8d39,0xa3));var _0x98d3=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x8d39[_0x39c734];return _0xb2a2f9;};'use strict';var _=require(_0x98d3('0x0'));var util=require(_0x98d3('0x1'));var moment=require(_0x98d3('0x2'));var BPromise=require(_0x98d3('0x3'));var rs=require(_0x98d3('0x4'));var fs=require('fs');var Redis=require(_0x98d3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x98d3('0x6'));var logger=require(_0x98d3('0x7'))('rpc');var config=require(_0x98d3('0x8'));var jayson=require(_0x98d3('0x9'));var client=jayson[_0x98d3('0xa')][_0x98d3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa65d87,_0x5ebbf6,_0x588af2){return new BPromise(function(_0xa377dc,_0x56ed57){return client[_0x98d3('0xc')](_0xa65d87,_0x588af2)[_0x98d3('0xd')](function(_0x24106c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x5ebbf6,_0x98d3('0xe'));logger[_0x98d3('0xf')](_0x98d3('0x10'),_0x5ebbf6,_0x98d3('0xe'),JSON[_0x98d3('0x11')](_0x24106c));if(_0x24106c[_0x98d3('0x12')]){if(_0x24106c['error'][_0x98d3('0x13')]===0x1f4){logger[_0x98d3('0x12')](_0x98d3('0x14'),_0x5ebbf6,_0x24106c['error'][_0x98d3('0x15')]);return _0x56ed57(_0x24106c[_0x98d3('0x12')][_0x98d3('0x15')]);}logger[_0x98d3('0x12')](_0x98d3('0x14'),_0x5ebbf6,_0x24106c[_0x98d3('0x12')][_0x98d3('0x15')]);return _0xa377dc(_0x24106c[_0x98d3('0x12')][_0x98d3('0x15')]);}else{logger['info']('SquareOdbc,\x20%s,\x20%s',_0x5ebbf6,_0x98d3('0xe'));_0xa377dc(_0x24106c[_0x98d3('0x16')][_0x98d3('0x15')]);}})[_0x98d3('0x17')](function(_0x3140a9){logger['error'](_0x98d3('0x14'),_0x5ebbf6,_0x3140a9);_0x56ed57(_0x3140a9);});});}exports[_0x98d3('0x18')]=function(_0x35163e){var _0x2714a9=this;return new Promise(function(_0x585640,_0x17d29e){return db['SquareOdbc']['find']({'raw':_0x35163e[_0x98d3('0x19')]?_0x35163e[_0x98d3('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x35163e[_0x98d3('0x19')]?_0x35163e[_0x98d3('0x19')][_0x98d3('0x1a')]||null:null,'attributes':_0x35163e[_0x98d3('0x19')]?_0x35163e[_0x98d3('0x19')][_0x98d3('0x1b')]||null:null,'include':_0x35163e['options']?_0x35163e[_0x98d3('0x19')][_0x98d3('0x1c')]?_[_0x98d3('0x1d')](_0x35163e[_0x98d3('0x19')][_0x98d3('0x1c')],function(_0x439f62){return{'model':db[_0x439f62[_0x98d3('0x1e')]],'as':_0x439f62['as'],'attributes':_0x439f62[_0x98d3('0x1b')],'include':_0x439f62[_0x98d3('0x1c')]?_['map'](_0x439f62[_0x98d3('0x1c')],function(_0x15f1d5){return{'model':db[_0x15f1d5[_0x98d3('0x1e')]],'as':_0x15f1d5['as'],'attributes':_0x15f1d5[_0x98d3('0x1b')],'include':_0x15f1d5['include']?_[_0x98d3('0x1d')](_0x15f1d5[_0x98d3('0x1c')],function(_0x8b39b6){return{'model':db[_0x8b39b6[_0x98d3('0x1e')]],'as':_0x8b39b6['as'],'attributes':_0x8b39b6[_0x98d3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x98d3('0xd')](function(_0x5daaaa){logger[_0x98d3('0x1f')](_0x98d3('0x18'),_0x35163e);logger['debug']('ShowSquareOdbc',_0x35163e,JSON[_0x98d3('0x11')](_0x5daaaa));_0x585640(_0x5daaaa);})[_0x98d3('0x17')](function(_0x5eeaa){logger[_0x98d3('0x12')](_0x98d3('0x18'),_0x5eeaa[_0x98d3('0x15')],_0x35163e);_0x17d29e(_0x2714a9['error'](0x1f4,_0x5eeaa[_0x98d3('0x15')]));});});}; \ No newline at end of file +var _0x65be=['include','map','model','debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareOdbc','find','options','raw','where','attributes'];(function(_0x331af1,_0x5cdcba){var _0x4c2c09=function(_0x4967fb){while(--_0x4967fb){_0x331af1['push'](_0x331af1['shift']());}};_0x4c2c09(++_0x5cdcba);}(_0x65be,0x130));var _0xe65b=function(_0x48b632,_0x2760dd){_0x48b632=_0x48b632-0x0;var _0x3a89a1=_0x65be[_0x48b632];return _0x3a89a1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe65b('0x0'));var BPromise=require(_0xe65b('0x1'));var rs=require(_0xe65b('0x2'));var fs=require('fs');var Redis=require(_0xe65b('0x3'));var db=require(_0xe65b('0x4'))['db'];var utils=require(_0xe65b('0x5'));var logger=require(_0xe65b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe65b('0x7'));var client=jayson['client'][_0xe65b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5050b7,_0x4f1f69,_0x2eee63){return new BPromise(function(_0x4d2c11,_0x17ce4f){return client['request'](_0x5050b7,_0x2eee63)[_0xe65b('0x9')](function(_0x3aa67c){logger[_0xe65b('0xa')](_0xe65b('0xb'),_0x4f1f69,_0xe65b('0xc'));logger['debug'](_0xe65b('0xd'),_0x4f1f69,_0xe65b('0xc'),JSON[_0xe65b('0xe')](_0x3aa67c));if(_0x3aa67c[_0xe65b('0xf')]){if(_0x3aa67c[_0xe65b('0xf')][_0xe65b('0x10')]===0x1f4){logger[_0xe65b('0xf')](_0xe65b('0xb'),_0x4f1f69,_0x3aa67c['error'][_0xe65b('0x11')]);return _0x17ce4f(_0x3aa67c[_0xe65b('0xf')][_0xe65b('0x11')]);}logger['error'](_0xe65b('0xb'),_0x4f1f69,_0x3aa67c[_0xe65b('0xf')][_0xe65b('0x11')]);return _0x4d2c11(_0x3aa67c['error'][_0xe65b('0x11')]);}else{logger[_0xe65b('0xa')](_0xe65b('0xb'),_0x4f1f69,_0xe65b('0xc'));_0x4d2c11(_0x3aa67c[_0xe65b('0x12')][_0xe65b('0x11')]);}})[_0xe65b('0x13')](function(_0x3bb355){logger[_0xe65b('0xf')](_0xe65b('0xb'),_0x4f1f69,_0x3bb355);_0x17ce4f(_0x3bb355);});});}exports[_0xe65b('0x14')]=function(_0x5f32e9){var _0x12c32b=this;return new Promise(function(_0x287a17,_0x411301){return db['SquareOdbc'][_0xe65b('0x15')]({'raw':_0x5f32e9[_0xe65b('0x16')]?_0x5f32e9[_0xe65b('0x16')][_0xe65b('0x17')]===undefined?!![]:![]:!![],'where':_0x5f32e9[_0xe65b('0x16')]?_0x5f32e9[_0xe65b('0x16')][_0xe65b('0x18')]||null:null,'attributes':_0x5f32e9['options']?_0x5f32e9[_0xe65b('0x16')][_0xe65b('0x19')]||null:null,'include':_0x5f32e9['options']?_0x5f32e9[_0xe65b('0x16')][_0xe65b('0x1a')]?_[_0xe65b('0x1b')](_0x5f32e9[_0xe65b('0x16')][_0xe65b('0x1a')],function(_0x59d2a7){return{'model':db[_0x59d2a7[_0xe65b('0x1c')]],'as':_0x59d2a7['as'],'attributes':_0x59d2a7[_0xe65b('0x19')],'include':_0x59d2a7[_0xe65b('0x1a')]?_[_0xe65b('0x1b')](_0x59d2a7['include'],function(_0x4c5322){return{'model':db[_0x4c5322[_0xe65b('0x1c')]],'as':_0x4c5322['as'],'attributes':_0x4c5322[_0xe65b('0x19')],'include':_0x4c5322[_0xe65b('0x1a')]?_[_0xe65b('0x1b')](_0x4c5322[_0xe65b('0x1a')],function(_0x134ba8){return{'model':db[_0x134ba8[_0xe65b('0x1c')]],'as':_0x134ba8['as'],'attributes':_0x134ba8[_0xe65b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe65b('0x9')](function(_0x35c360){logger[_0xe65b('0xa')]('ShowSquareOdbc',_0x5f32e9);logger[_0xe65b('0x1d')]('ShowSquareOdbc',_0x5f32e9,JSON['stringify'](_0x35c360));_0x287a17(_0x35c360);})[_0xe65b('0x13')](function(_0x5d98a3){logger[_0xe65b('0xf')](_0xe65b('0x14'),_0x5d98a3[_0xe65b('0x11')],_0x5f32e9);_0x411301(_0x12c32b[_0xe65b('0xf')](0x1f4,_0x5d98a3[_0xe65b('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 7a3b68a..d0a2124 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 _0x7e76=['connect-timeout','Router','fs-extra','../../components/interaction/service','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','multer','path'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x7e76,0x17e));var _0x67e7=function(_0x50a626,_0x47af0f){_0x50a626=_0x50a626-0x0;var _0x1468f5=_0x7e76[_0x50a626];return _0x1468f5;};'use strict';var multer=require(_0x67e7('0x0'));var util=require('util');var path=require(_0x67e7('0x1'));var timeout=require(_0x67e7('0x2'));var express=require('express');var router=express[_0x67e7('0x3')]();var fs_extra=require(_0x67e7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x67e7('0x5'));var config=require('../../config/environment');var controller=require(_0x67e7('0x6'));router[_0x67e7('0x7')]('/',auth[_0x67e7('0x8')](),controller[_0x67e7('0x9')]);router[_0x67e7('0x7')](_0x67e7('0xa'),auth[_0x67e7('0x8')](),controller[_0x67e7('0xb')]);router[_0x67e7('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x67e7('0xd')]('/:id',auth[_0x67e7('0x8')](),controller[_0x67e7('0xe')]);router['delete']('/:id',auth[_0x67e7('0x8')](),controller[_0x67e7('0xf')]);module['exports']=router; \ No newline at end of file +var _0xada9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x3e17a9,_0x39afdc){var _0x402e91=function(_0x1a07b1){while(--_0x1a07b1){_0x3e17a9['push'](_0x3e17a9['shift']());}};_0x402e91(++_0x39afdc);}(_0xada9,0x1c9));var _0x9ada=function(_0x4c72f2,_0x42aba8){_0x4c72f2=_0x4c72f2-0x0;var _0xd26d61=_0xada9[_0x4c72f2];return _0xd26d61;};'use strict';var multer=require('multer');var util=require(_0x9ada('0x0'));var path=require(_0x9ada('0x1'));var timeout=require('connect-timeout');var express=require(_0x9ada('0x2'));var router=express[_0x9ada('0x3')]();var fs_extra=require(_0x9ada('0x4'));var auth=require(_0x9ada('0x5'));var interaction=require(_0x9ada('0x6'));var config=require(_0x9ada('0x7'));var controller=require(_0x9ada('0x8'));router[_0x9ada('0x9')]('/',auth[_0x9ada('0xa')](),controller[_0x9ada('0xb')]);router[_0x9ada('0x9')](_0x9ada('0xc'),auth[_0x9ada('0xa')](),controller[_0x9ada('0xd')]);router[_0x9ada('0xe')]('/',auth[_0x9ada('0xa')](),controller[_0x9ada('0xf')]);router[_0x9ada('0x10')]('/:id',auth[_0x9ada('0xa')](),controller[_0x9ada('0x11')]);router[_0x9ada('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x9ada('0x13')]);module[_0x9ada('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 7915061..b679e7e 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 _0xda90=['TEXT','BLOB','long','getDataValue','toString','utf8','production','DATE','sequelize','exports','STRING'];(function(_0xcf6f33,_0x11b2fd){var _0x15da26=function(_0x51859c){while(--_0x51859c){_0xcf6f33['push'](_0xcf6f33['shift']());}};_0x15da26(++_0x11b2fd);}(_0xda90,0x152));var _0x0da9=function(_0x13c315,_0x2b2e18){_0x13c315=_0x13c315-0x0;var _0x5ebb43=_0xda90[_0x13c315];return _0x5ebb43;};'use strict';var Sequelize=require(_0x0da9('0x0'));module[_0x0da9('0x1')]={'name':{'type':Sequelize[_0x0da9('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x0da9('0x2')]},'notes':{'type':Sequelize[_0x0da9('0x3')]},'preproduction':{'type':Sequelize[_0x0da9('0x4')](_0x0da9('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x0da9('0x6')]('preproduction')[_0x0da9('0x7')](_0x0da9('0x8'));}}},'production':{'type':Sequelize[_0x0da9('0x4')](_0x0da9('0x5')),'get':function(){if(this[_0x0da9('0x6')](_0x0da9('0x9'))){return this[_0x0da9('0x6')](_0x0da9('0x9'))[_0x0da9('0x7')](_0x0da9('0x8'));}}},'savedAt':{'type':Sequelize[_0x0da9('0xa')]},'publishedAt':{'type':Sequelize[_0x0da9('0xa')]}}; \ No newline at end of file +var _0x2e6d=['sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE'];(function(_0x5bb877,_0x2bf73e){var _0x59598d=function(_0x24605c){while(--_0x24605c){_0x5bb877['push'](_0x5bb877['shift']());}};_0x59598d(++_0x2bf73e);}(_0x2e6d,0x12b));var _0xd2e6=function(_0x9f6e7,_0x21c299){_0x9f6e7=_0x9f6e7-0x0;var _0x568fd6=_0x2e6d[_0x9f6e7];return _0x568fd6;};'use strict';var Sequelize=require(_0xd2e6('0x0'));module[_0xd2e6('0x1')]={'name':{'type':Sequelize[_0xd2e6('0x2')],'unique':_0xd2e6('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xd2e6('0x2')]},'notes':{'type':Sequelize[_0xd2e6('0x4')]},'preproduction':{'type':Sequelize[_0xd2e6('0x5')](_0xd2e6('0x6')),'get':function(){if(this[_0xd2e6('0x7')](_0xd2e6('0x8'))){return this[_0xd2e6('0x7')](_0xd2e6('0x8'))[_0xd2e6('0x9')](_0xd2e6('0xa'));}}},'production':{'type':Sequelize[_0xd2e6('0x5')]('long'),'get':function(){if(this[_0xd2e6('0x7')](_0xd2e6('0xb'))){return this[_0xd2e6('0x7')](_0xd2e6('0xb'))[_0xd2e6('0x9')]('utf8');}}},'savedAt':{'type':Sequelize[_0xd2e6('0xc')]},'publishedAt':{'type':Sequelize[_0xd2e6('0xc')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c0bc18f..e49e055 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 _0x6e2c=['map','query','filters','intersection','model','attributes','fields','length','nolimit','order','where','filter','merge','VIRTUAL','includeAll','include','SquareProject','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','SquareProjects','UserProfileSection','autoAssociation','production','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./squareProject.socket','register','json','offset','limit','undefined','count','Content-Range','update','then','destroy','UserProfileResource','publish','agi','stringify','status','end','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6e2c,0xeb));var _0xc6e2=function(_0x1886b6,_0x5d8bbe){_0x1886b6=_0x1886b6-0x0;var _0x5427bc=_0x6e2c[_0x1886b6];return _0x5427bc;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0xc6e2('0x0'));var logger=require(_0xc6e2('0x1'))(_0xc6e2('0x2'));var config=require(_0xc6e2('0x3'));var db=require(_0xc6e2('0x4'))['db'];config[_0xc6e2('0x5')]=_['defaults'](config[_0xc6e2('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xc6e2('0x6'))(new Redis(config['redis']));require(_0xc6e2('0x7'))[_0xc6e2('0x8')](socket);function respondWithResult(_0x48b9ea,_0x426436){_0x426436=_0x426436||0xc8;return function(_0x3a0a8f){if(_0x3a0a8f){return _0x48b9ea['status'](_0x426436)[_0xc6e2('0x9')](_0x3a0a8f);}};}function respondWithFilteredResult(_0x43e562,_0x19490d){return function(_0x4e4e43){if(_0x4e4e43){var _0x4e89bd=typeof _0x19490d[_0xc6e2('0xa')]==='undefined'&&typeof _0x19490d[_0xc6e2('0xb')]===_0xc6e2('0xc');var _0x46e1bc=_0x4e4e43[_0xc6e2('0xd')];var _0x504730=_0x4e89bd?0x0:_0x19490d[_0xc6e2('0xa')];var _0x249b06=_0x4e89bd?_0x4e4e43[_0xc6e2('0xd')]:_0x19490d[_0xc6e2('0xa')]+_0x19490d[_0xc6e2('0xb')];var _0x49a7f4;if(_0x249b06>=_0x46e1bc){_0x249b06=_0x46e1bc;_0x49a7f4=0xc8;}else{_0x49a7f4=0xce;}_0x43e562['status'](_0x49a7f4);return _0x43e562['set'](_0xc6e2('0xe'),_0x504730+'-'+_0x249b06+'/'+_0x46e1bc)[_0xc6e2('0x9')](_0x4e4e43);}return null;};}function saveUpdates(_0x6f5c5a){return function(_0x10c3e2){if(_0x10c3e2){return _0x10c3e2[_0xc6e2('0xf')](_0x6f5c5a)[_0xc6e2('0x10')](function(_0x16e1c3){return _0x16e1c3;});}return null;};}function removeEntity(_0x547eb2){return function(_0x59b445){if(_0x59b445){return _0x59b445[_0xc6e2('0x11')]()[_0xc6e2('0x10')](function(){var _0x160bd7=_0x59b445['get']({'plain':!![]});var _0x159e1d='SquareProjects';return db[_0xc6e2('0x12')][_0xc6e2('0x11')]({'where':{'type':_0x159e1d,'resourceId':_0x160bd7['id']}})[_0xc6e2('0x10')](function(){return _0x59b445;});})[_0xc6e2('0x10')](function(){var _0x272a5f=new Redis(config['redis']);_0x272a5f[_0xc6e2('0x13')](_0xc6e2('0x14'),JSON[_0xc6e2('0x15')]({'id':_0x59b445['id'],'deleted':!![]}));})[_0xc6e2('0x10')](function(){_0x547eb2[_0xc6e2('0x16')](0xcc)[_0xc6e2('0x17')]();});}};}function handleEntityNotFound(_0x284e44){return function(_0x5e0b84){if(!_0x5e0b84){_0x284e44[_0xc6e2('0x18')](0x194);}return _0x5e0b84;};}function handleError(_0x446442,_0x16ec6a){_0x16ec6a=_0x16ec6a||0x1f4;return function(_0x3da561){logger[_0xc6e2('0x19')](_0x3da561['stack']);if(_0x3da561[_0xc6e2('0x1a')]){delete _0x3da561['name'];}_0x446442[_0xc6e2('0x16')](_0x16ec6a)[_0xc6e2('0x1b')](_0x3da561);};}exports[_0xc6e2('0x1c')]=function(_0x461c86,_0x217d29){var _0x379aaf={},_0x3fcc64={},_0x13f9f8={'count':0x0,'rows':[]};var _0x2347ce=_['map'](db['SquareProject'][_0xc6e2('0x1d')],function(_0x5a2e35){return{'name':_0x5a2e35[_0xc6e2('0x1e')],'type':_0x5a2e35[_0xc6e2('0x1f')][_0xc6e2('0x20')]};});_0x3fcc64['model']=_[_0xc6e2('0x21')](_0x2347ce,_0xc6e2('0x1a'));_0x3fcc64[_0xc6e2('0x22')]=_['keys'](_0x461c86[_0xc6e2('0x22')]);_0x3fcc64[_0xc6e2('0x23')]=_[_0xc6e2('0x24')](_0x3fcc64[_0xc6e2('0x25')],_0x3fcc64[_0xc6e2('0x22')]);_0x379aaf[_0xc6e2('0x26')]=_[_0xc6e2('0x24')](_0x3fcc64[_0xc6e2('0x25')],qs[_0xc6e2('0x27')](_0x461c86[_0xc6e2('0x22')][_0xc6e2('0x27')]));_0x379aaf['attributes']=_0x379aaf['attributes'][_0xc6e2('0x28')]?_0x379aaf[_0xc6e2('0x26')]:_0x3fcc64[_0xc6e2('0x25')];if(!_0x461c86['query']['hasOwnProperty'](_0xc6e2('0x29'))){_0x379aaf[_0xc6e2('0xb')]=qs['limit'](_0x461c86[_0xc6e2('0x22')]['limit']);_0x379aaf[_0xc6e2('0xa')]=qs[_0xc6e2('0xa')](_0x461c86[_0xc6e2('0x22')][_0xc6e2('0xa')]);}_0x379aaf[_0xc6e2('0x2a')]=qs['sort'](_0x461c86[_0xc6e2('0x22')]['sort']);_0x379aaf[_0xc6e2('0x2b')]=qs[_0xc6e2('0x23')](_['pick'](_0x461c86[_0xc6e2('0x22')],_0x3fcc64[_0xc6e2('0x23')]),_0x2347ce);if(_0x461c86['query'][_0xc6e2('0x2c')]){_0x379aaf[_0xc6e2('0x2b')]=_[_0xc6e2('0x2d')](_0x379aaf[_0xc6e2('0x2b')],{'$or':_[_0xc6e2('0x21')](_0x2347ce,function(_0x501e02){if(_0x501e02[_0xc6e2('0x1f')]!==_0xc6e2('0x2e')){var _0x1ec0d4={};_0x1ec0d4[_0x501e02[_0xc6e2('0x1a')]]={'$like':'%'+_0x461c86[_0xc6e2('0x22')][_0xc6e2('0x2c')]+'%'};return _0x1ec0d4;}})});}_0x379aaf=_[_0xc6e2('0x2d')]({},_0x379aaf,_0x461c86['options']);var _0x599e8c={'where':_0x379aaf[_0xc6e2('0x2b')]};return db['SquareProject'][_0xc6e2('0xd')](_0x599e8c)['then'](function(_0x4fcaec){_0x13f9f8['count']=_0x4fcaec;if(_0x461c86[_0xc6e2('0x22')][_0xc6e2('0x2f')]){_0x379aaf[_0xc6e2('0x30')]=[{'all':!![]}];}return db[_0xc6e2('0x31')]['findAll'](_0x379aaf);})[_0xc6e2('0x10')](function(_0xd4f4f7){_0x13f9f8[_0xc6e2('0x32')]=_0xd4f4f7;return _0x13f9f8;})['then'](respondWithFilteredResult(_0x217d29,_0x379aaf))[_0xc6e2('0x33')](handleError(_0x217d29,null));};exports[_0xc6e2('0x34')]=function(_0x3d9527,_0xb24850){var _0x228beb={'raw':![],'where':{'id':_0x3d9527[_0xc6e2('0x35')]['id']}},_0x3db0d7={};_0x3db0d7[_0xc6e2('0x25')]=_[_0xc6e2('0x36')](db['SquareProject'][_0xc6e2('0x1d')]);_0x3db0d7[_0xc6e2('0x22')]=_[_0xc6e2('0x36')](_0x3d9527['query']);_0x3db0d7[_0xc6e2('0x23')]=_['intersection'](_0x3db0d7['model'],_0x3db0d7[_0xc6e2('0x22')]);_0x228beb[_0xc6e2('0x26')]=_[_0xc6e2('0x24')](_0x3db0d7[_0xc6e2('0x25')],qs[_0xc6e2('0x27')](_0x3d9527[_0xc6e2('0x22')][_0xc6e2('0x27')]));_0x228beb[_0xc6e2('0x26')]=_0x228beb[_0xc6e2('0x26')][_0xc6e2('0x28')]?_0x228beb['attributes']:_0x3db0d7[_0xc6e2('0x25')];if(_0x3d9527[_0xc6e2('0x22')]['includeAll']){_0x228beb[_0xc6e2('0x30')]=[{'all':!![]}];}_0x228beb=_['merge']({},_0x228beb,_0x3d9527[_0xc6e2('0x37')]);return db['SquareProject'][_0xc6e2('0x38')](_0x228beb)['then'](handleEntityNotFound(_0xb24850,null))[_0xc6e2('0x10')](respondWithResult(_0xb24850,null))[_0xc6e2('0x33')](handleError(_0xb24850,null));};exports[_0xc6e2('0x39')]=function(_0x5c09e2,_0xc41580){return db[_0xc6e2('0x31')][_0xc6e2('0x39')](_0x5c09e2[_0xc6e2('0x3a')],{})[_0xc6e2('0x10')](function(_0x3d902d){var _0x2e0472=_0x5c09e2[_0xc6e2('0x3b')]['get']({'plain':!![]});if(!_0x2e0472)throw new Error(_0xc6e2('0x3c'));if(_0x2e0472[_0xc6e2('0x3d')]===_0xc6e2('0x3b')){var _0x136e38=_0x3d902d[_0xc6e2('0x3e')]({'plain':!![]});var _0x33bf96=_0xc6e2('0x3f');return db[_0xc6e2('0x40')][_0xc6e2('0x38')]({'where':{'name':_0x33bf96,'userProfileId':_0x2e0472['userProfileId']},'raw':!![]})[_0xc6e2('0x10')](function(_0x5217c9){if(_0x5217c9&&_0x5217c9[_0xc6e2('0x41')]===0x0){return db['UserProfileResource'][_0xc6e2('0x39')]({'name':_0x136e38[_0xc6e2('0x1a')],'resourceId':_0x136e38['id'],'type':_0x5217c9['name'],'sectionId':_0x5217c9['id']},{})[_0xc6e2('0x10')](function(){return _0x3d902d;});}else{return _0x3d902d;}})[_0xc6e2('0x33')](function(_0x2333c2){logger[_0xc6e2('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2333c2);throw _0x2333c2;});}return _0x3d902d;})[_0xc6e2('0x10')](respondWithResult(_0xc41580,0xc9))['catch'](handleError(_0xc41580,null));};exports[_0xc6e2('0xf')]=function(_0x2dedb8,_0x2203a0){if(_0x2dedb8['body']['id']){delete _0x2dedb8[_0xc6e2('0x3a')]['id'];}return db[_0xc6e2('0x31')][_0xc6e2('0x38')]({'where':{'id':_0x2dedb8['params']['id']}})[_0xc6e2('0x10')](handleEntityNotFound(_0x2203a0,null))['then'](saveUpdates(_0x2dedb8[_0xc6e2('0x3a')],null))[_0xc6e2('0x10')](function(_0x5adc6b){if(!_0x5adc6b)return;var _0x55e502=_0x5adc6b['get']({'plain':!![]});return _0x55e502;})[_0xc6e2('0x10')](function(_0x4eabeb){var _0x1a8b74=new Redis(config[_0xc6e2('0x5')]);_0x1a8b74['publish']('agi',JSON[_0xc6e2('0x15')](_['pick'](_0x4eabeb,['id','name',_0xc6e2('0x42')])));return _0x4eabeb;})[_0xc6e2('0x10')](respondWithResult(_0x2203a0,null))[_0xc6e2('0x33')](handleError(_0x2203a0,null));};exports[_0xc6e2('0x11')]=function(_0x33194f,_0x2a68e2){return db['SquareProject'][_0xc6e2('0x38')]({'where':{'id':_0x33194f[_0xc6e2('0x35')]['id']}})[_0xc6e2('0x10')](handleEntityNotFound(_0x2a68e2,null))[_0xc6e2('0x10')](removeEntity(_0x2a68e2,null))[_0xc6e2('0x33')](handleError(_0x2a68e2,null));}; \ No newline at end of file +var _0x2d4b=['undefined','limit','count','offset','set','then','destroy','get','SquareProjects','UserProfileResource','publish','stringify','end','sendStatus','name','send','index','map','SquareProject','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','agi','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','./squareProject.socket','register','status','json'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x2d4b,0xc4));var _0xb2d4=function(_0x4ffafb,_0x20171a){_0x4ffafb=_0x4ffafb-0x0;var _0x4ab472=_0x2d4b[_0x4ffafb];return _0x4ab472;};'use strict';var _=require('lodash');var Redis=require(_0xb2d4('0x0'));var qs=require(_0xb2d4('0x1'));var logger=require('../../config/logger')(_0xb2d4('0x2'));var config=require(_0xb2d4('0x3'));var db=require(_0xb2d4('0x4'))['db'];config[_0xb2d4('0x5')]=_[_0xb2d4('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb2d4('0x7'))[_0xb2d4('0x8')](socket);function respondWithResult(_0x2e137c,_0x8ddc05){_0x8ddc05=_0x8ddc05||0xc8;return function(_0x538f4e){if(_0x538f4e){return _0x2e137c[_0xb2d4('0x9')](_0x8ddc05)[_0xb2d4('0xa')](_0x538f4e);}};}function respondWithFilteredResult(_0x31f98a,_0x280e52){return function(_0x481e18){if(_0x481e18){var _0x481781=typeof _0x280e52['offset']===_0xb2d4('0xb')&&typeof _0x280e52[_0xb2d4('0xc')]===_0xb2d4('0xb');var _0x8a9537=_0x481e18[_0xb2d4('0xd')];var _0x52f39b=_0x481781?0x0:_0x280e52[_0xb2d4('0xe')];var _0x214615=_0x481781?_0x481e18[_0xb2d4('0xd')]:_0x280e52['offset']+_0x280e52[_0xb2d4('0xc')];var _0x5f37ff;if(_0x214615>=_0x8a9537){_0x214615=_0x8a9537;_0x5f37ff=0xc8;}else{_0x5f37ff=0xce;}_0x31f98a[_0xb2d4('0x9')](_0x5f37ff);return _0x31f98a[_0xb2d4('0xf')]('Content-Range',_0x52f39b+'-'+_0x214615+'/'+_0x8a9537)[_0xb2d4('0xa')](_0x481e18);}return null;};}function saveUpdates(_0x33d89b){return function(_0xc197da){if(_0xc197da){return _0xc197da['update'](_0x33d89b)[_0xb2d4('0x10')](function(_0x285f1b){return _0x285f1b;});}return null;};}function removeEntity(_0x3d4cb5){return function(_0x3dde16){if(_0x3dde16){return _0x3dde16[_0xb2d4('0x11')]()[_0xb2d4('0x10')](function(){var _0x4362e8=_0x3dde16[_0xb2d4('0x12')]({'plain':!![]});var _0x4d9a4f=_0xb2d4('0x13');return db[_0xb2d4('0x14')][_0xb2d4('0x11')]({'where':{'type':_0x4d9a4f,'resourceId':_0x4362e8['id']}})[_0xb2d4('0x10')](function(){return _0x3dde16;});})[_0xb2d4('0x10')](function(){var _0x4d59c9=new Redis(config[_0xb2d4('0x5')]);_0x4d59c9[_0xb2d4('0x15')]('agi',JSON[_0xb2d4('0x16')]({'id':_0x3dde16['id'],'deleted':!![]}));})[_0xb2d4('0x10')](function(){_0x3d4cb5[_0xb2d4('0x9')](0xcc)[_0xb2d4('0x17')]();});}};}function handleEntityNotFound(_0x44b2a4){return function(_0x48c317){if(!_0x48c317){_0x44b2a4[_0xb2d4('0x18')](0x194);}return _0x48c317;};}function handleError(_0x422241,_0x58be38){_0x58be38=_0x58be38||0x1f4;return function(_0x29edd1){logger['error'](_0x29edd1['stack']);if(_0x29edd1[_0xb2d4('0x19')]){delete _0x29edd1[_0xb2d4('0x19')];}_0x422241['status'](_0x58be38)[_0xb2d4('0x1a')](_0x29edd1);};}exports[_0xb2d4('0x1b')]=function(_0x21e68f,_0x268528){var _0x1b319d={},_0x1aa2d7={},_0x3aa696={'count':0x0,'rows':[]};var _0x2f8b02=_[_0xb2d4('0x1c')](db[_0xb2d4('0x1d')][_0xb2d4('0x1e')],function(_0x237a3b){return{'name':_0x237a3b[_0xb2d4('0x1f')],'type':_0x237a3b[_0xb2d4('0x20')]['key']};});_0x1aa2d7[_0xb2d4('0x21')]=_[_0xb2d4('0x1c')](_0x2f8b02,_0xb2d4('0x19'));_0x1aa2d7[_0xb2d4('0x22')]=_[_0xb2d4('0x23')](_0x21e68f[_0xb2d4('0x22')]);_0x1aa2d7[_0xb2d4('0x24')]=_[_0xb2d4('0x25')](_0x1aa2d7[_0xb2d4('0x21')],_0x1aa2d7[_0xb2d4('0x22')]);_0x1b319d[_0xb2d4('0x26')]=_[_0xb2d4('0x25')](_0x1aa2d7[_0xb2d4('0x21')],qs[_0xb2d4('0x27')](_0x21e68f[_0xb2d4('0x22')]['fields']));_0x1b319d[_0xb2d4('0x26')]=_0x1b319d[_0xb2d4('0x26')][_0xb2d4('0x28')]?_0x1b319d[_0xb2d4('0x26')]:_0x1aa2d7[_0xb2d4('0x21')];if(!_0x21e68f['query'][_0xb2d4('0x29')](_0xb2d4('0x2a'))){_0x1b319d[_0xb2d4('0xc')]=qs['limit'](_0x21e68f['query'][_0xb2d4('0xc')]);_0x1b319d[_0xb2d4('0xe')]=qs[_0xb2d4('0xe')](_0x21e68f[_0xb2d4('0x22')][_0xb2d4('0xe')]);}_0x1b319d['order']=qs['sort'](_0x21e68f[_0xb2d4('0x22')][_0xb2d4('0x2b')]);_0x1b319d[_0xb2d4('0x2c')]=qs[_0xb2d4('0x24')](_[_0xb2d4('0x2d')](_0x21e68f[_0xb2d4('0x22')],_0x1aa2d7[_0xb2d4('0x24')]),_0x2f8b02);if(_0x21e68f[_0xb2d4('0x22')][_0xb2d4('0x2e')]){_0x1b319d[_0xb2d4('0x2c')]=_['merge'](_0x1b319d['where'],{'$or':_[_0xb2d4('0x1c')](_0x2f8b02,function(_0x2ed088){if(_0x2ed088[_0xb2d4('0x20')]!=='VIRTUAL'){var _0x4f040e={};_0x4f040e[_0x2ed088[_0xb2d4('0x19')]]={'$like':'%'+_0x21e68f[_0xb2d4('0x22')][_0xb2d4('0x2e')]+'%'};return _0x4f040e;}})});}_0x1b319d=_[_0xb2d4('0x2f')]({},_0x1b319d,_0x21e68f['options']);var _0x4c4ecb={'where':_0x1b319d[_0xb2d4('0x2c')]};return db[_0xb2d4('0x1d')][_0xb2d4('0xd')](_0x4c4ecb)['then'](function(_0x59a713){_0x3aa696[_0xb2d4('0xd')]=_0x59a713;if(_0x21e68f['query'][_0xb2d4('0x30')]){_0x1b319d[_0xb2d4('0x31')]=[{'all':!![]}];}return db['SquareProject'][_0xb2d4('0x32')](_0x1b319d);})[_0xb2d4('0x10')](function(_0x16d62e){_0x3aa696[_0xb2d4('0x33')]=_0x16d62e;return _0x3aa696;})[_0xb2d4('0x10')](respondWithFilteredResult(_0x268528,_0x1b319d))[_0xb2d4('0x34')](handleError(_0x268528,null));};exports[_0xb2d4('0x35')]=function(_0x46d0b5,_0x1d54db){var _0x1bbed1={'raw':![],'where':{'id':_0x46d0b5['params']['id']}},_0xa42c66={};_0xa42c66[_0xb2d4('0x21')]=_[_0xb2d4('0x23')](db['SquareProject'][_0xb2d4('0x1e')]);_0xa42c66[_0xb2d4('0x22')]=_[_0xb2d4('0x23')](_0x46d0b5['query']);_0xa42c66[_0xb2d4('0x24')]=_[_0xb2d4('0x25')](_0xa42c66[_0xb2d4('0x21')],_0xa42c66[_0xb2d4('0x22')]);_0x1bbed1[_0xb2d4('0x26')]=_[_0xb2d4('0x25')](_0xa42c66[_0xb2d4('0x21')],qs[_0xb2d4('0x27')](_0x46d0b5[_0xb2d4('0x22')][_0xb2d4('0x27')]));_0x1bbed1['attributes']=_0x1bbed1[_0xb2d4('0x26')][_0xb2d4('0x28')]?_0x1bbed1[_0xb2d4('0x26')]:_0xa42c66[_0xb2d4('0x21')];if(_0x46d0b5[_0xb2d4('0x22')][_0xb2d4('0x30')]){_0x1bbed1[_0xb2d4('0x31')]=[{'all':!![]}];}_0x1bbed1=_[_0xb2d4('0x2f')]({},_0x1bbed1,_0x46d0b5[_0xb2d4('0x36')]);return db[_0xb2d4('0x1d')]['find'](_0x1bbed1)[_0xb2d4('0x10')](handleEntityNotFound(_0x1d54db,null))[_0xb2d4('0x10')](respondWithResult(_0x1d54db,null))['catch'](handleError(_0x1d54db,null));};exports['create']=function(_0x2c120f,_0x431911){return db['SquareProject'][_0xb2d4('0x37')](_0x2c120f[_0xb2d4('0x38')],{})[_0xb2d4('0x10')](function(_0x4d8a3e){var _0x3ad297=_0x2c120f[_0xb2d4('0x39')][_0xb2d4('0x12')]({'plain':!![]});if(!_0x3ad297)throw new Error(_0xb2d4('0x3a'));if(_0x3ad297[_0xb2d4('0x3b')]===_0xb2d4('0x39')){var _0x62dffb=_0x4d8a3e[_0xb2d4('0x12')]({'plain':!![]});var _0x30edb0=_0xb2d4('0x13');return db[_0xb2d4('0x3c')][_0xb2d4('0x3d')]({'where':{'name':_0x30edb0,'userProfileId':_0x3ad297[_0xb2d4('0x3e')]},'raw':!![]})[_0xb2d4('0x10')](function(_0x5df452){if(_0x5df452&&_0x5df452[_0xb2d4('0x3f')]===0x0){return db[_0xb2d4('0x14')][_0xb2d4('0x37')]({'name':_0x62dffb[_0xb2d4('0x19')],'resourceId':_0x62dffb['id'],'type':_0x5df452[_0xb2d4('0x19')],'sectionId':_0x5df452['id']},{})['then'](function(){return _0x4d8a3e;});}else{return _0x4d8a3e;}})[_0xb2d4('0x34')](function(_0x26f044){logger[_0xb2d4('0x40')](_0xb2d4('0x41'),_0x26f044);throw _0x26f044;});}return _0x4d8a3e;})[_0xb2d4('0x10')](respondWithResult(_0x431911,0xc9))['catch'](handleError(_0x431911,null));};exports[_0xb2d4('0x42')]=function(_0x4b021a,_0x2cc28e){if(_0x4b021a[_0xb2d4('0x38')]['id']){delete _0x4b021a['body']['id'];}return db[_0xb2d4('0x1d')]['find']({'where':{'id':_0x4b021a[_0xb2d4('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cc28e,null))[_0xb2d4('0x10')](saveUpdates(_0x4b021a[_0xb2d4('0x38')],null))['then'](function(_0x7ab70e){if(!_0x7ab70e)return;var _0x5c5613=_0x7ab70e[_0xb2d4('0x12')]({'plain':!![]});return _0x5c5613;})[_0xb2d4('0x10')](function(_0x5159f6){var _0x288459=new Redis(config[_0xb2d4('0x5')]);_0x288459[_0xb2d4('0x15')](_0xb2d4('0x44'),JSON[_0xb2d4('0x16')](_[_0xb2d4('0x2d')](_0x5159f6,['id',_0xb2d4('0x19'),'production'])));return _0x5159f6;})[_0xb2d4('0x10')](respondWithResult(_0x2cc28e,null))[_0xb2d4('0x34')](handleError(_0x2cc28e,null));};exports[_0xb2d4('0x11')]=function(_0x2e7d4e,_0xd693ab){return db[_0xb2d4('0x1d')]['find']({'where':{'id':_0x2e7d4e['params']['id']}})[_0xb2d4('0x10')](handleEntityNotFound(_0xd693ab,null))[_0xb2d4('0x10')](removeEntity(_0xd693ab,null))[_0xb2d4('0x34')](handleError(_0xd693ab,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 8f163d4..89018b7 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 _0x52e5=['setMaxListeners','save','remove','emit','hook','exports','SquareProject'];(function(_0x52e604,_0x2068db){var _0x2716e6=function(_0x138d1f){while(--_0x138d1f){_0x52e604['push'](_0x52e604['shift']());}};_0x2716e6(++_0x2068db);}(_0x52e5,0x92));var _0x552e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x52e5[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0x552e('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x552e('0x1')](0x0);var events={'afterCreate':_0x552e('0x2'),'afterUpdate':'update','afterDestroy':_0x552e('0x3')};function emitEvent(_0x4d3c54){return function(_0x41e6e0,_0x49b35a,_0x175636){SquareProjectEvents[_0x552e('0x4')](_0x4d3c54+':'+_0x41e6e0['id'],_0x41e6e0);SquareProjectEvents[_0x552e('0x4')](_0x4d3c54,_0x41e6e0);_0x175636(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0x552e('0x5')](e,emitEvent(event));}}module[_0x552e('0x6')]=SquareProjectEvents; \ No newline at end of file +var _0x56d6=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x56d6,0x167));var _0x656d=function(_0x43d53b,_0x330712){_0x43d53b=_0x43d53b-0x0;var _0x38d869=_0x56d6[_0x43d53b];return _0x38d869;};'use strict';var EventEmitter=require(_0x656d('0x0'));var SquareProject=require(_0x656d('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x656d('0x2')](0x0);var events={'afterCreate':_0x656d('0x3'),'afterUpdate':'update','afterDestroy':_0x656d('0x4')};function emitEvent(_0x237700){return function(_0x6010d7,_0x4b6590,_0x51faf2){SquareProjectEvents[_0x656d('0x5')](_0x237700+':'+_0x6010d7['id'],_0x6010d7);SquareProjectEvents[_0x656d('0x5')](_0x237700,_0x6010d7);_0x51faf2(null);};}for(var e in events){if(events[_0x656d('0x6')](e)){var event=events[e];SquareProject[_0x656d('0x7')](e,emitEvent(event));}}module[_0x656d('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 91311a6..a23826f 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 _0x8f96=['lodash','util','../../config/logger','bluebird','path','exports','define','SquareProject','square_projects','preproduction','format','changed','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5e437f,_0x13dd96){var _0x2ad331=function(_0xd01868){while(--_0xd01868){_0x5e437f['push'](_0x5e437f['shift']());}};_0x2ad331(++_0x13dd96);}(_0x8f96,0x13b));var _0x68f9=function(_0x115993,_0x498fed){_0x115993=_0x115993-0x0;var _0x4c4e7c=_0x8f96[_0x115993];return _0x4c4e7c;};'use strict';var _=require(_0x68f9('0x0'));var util=require(_0x68f9('0x1'));var logger=require(_0x68f9('0x2'))('api');var moment=require('moment');var BPromise=require(_0x68f9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x68f9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module[_0x68f9('0x5')]=function(_0x2f210a,_0x251fe8){return _0x2f210a[_0x68f9('0x6')](_0x68f9('0x7'),attributes,{'tableName':_0x68f9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a9203,_0x14adea,_0x2d3f20){if(_0x2a9203['changed'](_0x68f9('0x9'))){_0x2a9203['savedAt']=moment()[_0x68f9('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2a9203[_0x68f9('0xb')](_0x68f9('0xc'))){_0x2a9203[_0x68f9('0xd')]=moment()[_0x68f9('0xa')](_0x68f9('0xe'));}_0x2d3f20(null,_0x2a9203);}}});}; \ No newline at end of file +var _0xbd25=['../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','moment','bluebird','request-promise','path'];(function(_0x211bc3,_0x5860c8){var _0x34c9a2=function(_0x4bfa37){while(--_0x4bfa37){_0x211bc3['push'](_0x211bc3['shift']());}};_0x34c9a2(++_0x5860c8);}(_0xbd25,0x1d7));var _0x5bd2=function(_0x2bcc87,_0x937b46){_0x2bcc87=_0x2bcc87-0x0;var _0x42e86e=_0xbd25[_0x2bcc87];return _0x42e86e;};'use strict';var _=require('lodash');var util=require(_0x5bd2('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x5bd2('0x1'));var BPromise=require(_0x5bd2('0x2'));var rp=require(_0x5bd2('0x3'));var fs=require('fs');var path=require(_0x5bd2('0x4'));var rimraf=require('rimraf');var config=require(_0x5bd2('0x5'));var attributes=require(_0x5bd2('0x6'));module[_0x5bd2('0x7')]=function(_0x5c9a78,_0x56dc0e){return _0x5c9a78[_0x5bd2('0x8')](_0x5bd2('0x9'),attributes,{'tableName':_0x5bd2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11d5ef,_0x5eb279,_0x36289b){if(_0x11d5ef[_0x5bd2('0xb')](_0x5bd2('0xc'))){_0x11d5ef['savedAt']=moment()[_0x5bd2('0xd')](_0x5bd2('0xe'));}if(_0x11d5ef[_0x5bd2('0xb')](_0x5bd2('0xf'))){_0x11d5ef[_0x5bd2('0x10')]=moment()[_0x5bd2('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x36289b(null,_0x11d5ef);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index fb4fe59..d4db511 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 _0xdb93=['include','map','model','then','debug','stringify','error','message','ShowSquareProject','find','info','catch','ioredis','../../mysqldb','../../config/logger','../../config/environment','redis','localhost','./squareProject.socket','GetSquareProjects','SquareProject','findAll','options','raw','where','attributes','limit'];(function(_0x3b29ce,_0x13de5f){var _0x57b233=function(_0x5e4248){while(--_0x5e4248){_0x3b29ce['push'](_0x3b29ce['shift']());}};_0x57b233(++_0x13de5f);}(_0xdb93,0x78));var _0x3db9=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xdb93[_0x2576d7];return _0x16a08c;};'use strict';var _=require('lodash');var Redis=require(_0x3db9('0x0'));var db=require(_0x3db9('0x1'))['db'];var logger=require(_0x3db9('0x2'))('rpc');var config=require(_0x3db9('0x3'));config['redis']=_['defaults'](config[_0x3db9('0x4')],{'host':_0x3db9('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3db9('0x4')]));require(_0x3db9('0x6'))['register'](socket);exports[_0x3db9('0x7')]=function(_0x349710){var _0x56000b=this;return new Promise(function(_0x4de10e,_0x1cce1b){return db[_0x3db9('0x8')][_0x3db9('0x9')]({'raw':_0x349710[_0x3db9('0xa')]?_0x349710[_0x3db9('0xa')][_0x3db9('0xb')]===undefined?!![]:![]:!![],'where':_0x349710['options']?_0x349710[_0x3db9('0xa')][_0x3db9('0xc')]||null:null,'attributes':_0x349710[_0x3db9('0xa')]?_0x349710[_0x3db9('0xa')][_0x3db9('0xd')]||null:null,'limit':_0x349710[_0x3db9('0xa')]?_0x349710['options'][_0x3db9('0xe')]||null:null,'include':_0x349710[_0x3db9('0xa')]?_0x349710[_0x3db9('0xa')][_0x3db9('0xf')]?_[_0x3db9('0x10')](_0x349710[_0x3db9('0xa')][_0x3db9('0xf')],function(_0x3f4a28){return{'model':db[_0x3f4a28[_0x3db9('0x11')]],'as':_0x3f4a28['as'],'attributes':_0x3f4a28[_0x3db9('0xd')],'include':_0x3f4a28[_0x3db9('0xf')]?_[_0x3db9('0x10')](_0x3f4a28[_0x3db9('0xf')],function(_0x2620ad){return{'model':db[_0x2620ad[_0x3db9('0x11')]],'as':_0x2620ad['as'],'attributes':_0x2620ad[_0x3db9('0xd')],'include':_0x2620ad[_0x3db9('0xf')]?_[_0x3db9('0x10')](_0x2620ad[_0x3db9('0xf')],function(_0x5ec52d){return{'model':db[_0x5ec52d[_0x3db9('0x11')]],'as':_0x5ec52d['as'],'attributes':_0x5ec52d[_0x3db9('0xd')]};}):[]};}):[]};}):[]:[]})[_0x3db9('0x12')](function(_0x1e45ab){logger['info'](_0x3db9('0x7'),_0x349710);logger[_0x3db9('0x13')](_0x3db9('0x7'),_0x349710,JSON[_0x3db9('0x14')](_0x1e45ab));_0x4de10e(_0x1e45ab);})['catch'](function(_0x1f53d4){logger[_0x3db9('0x15')]('GetSquareProjects',_0x1f53d4[_0x3db9('0x16')],_0x349710);_0x1cce1b(_0x56000b[_0x3db9('0x15')](0x1f4,_0x1f53d4['message']));});});};exports[_0x3db9('0x17')]=function(_0x3813f5){var _0x197ecc=this;return new Promise(function(_0xa88638,_0x3ce625){return db['SquareProject'][_0x3db9('0x18')]({'raw':_0x3813f5[_0x3db9('0xa')]?_0x3813f5[_0x3db9('0xa')][_0x3db9('0xb')]===undefined?!![]:![]:!![],'where':_0x3813f5[_0x3db9('0xa')]?_0x3813f5['options']['where']||null:null,'attributes':_0x3813f5[_0x3db9('0xa')]?_0x3813f5[_0x3db9('0xa')][_0x3db9('0xd')]||null:null,'include':_0x3813f5[_0x3db9('0xa')]?_0x3813f5[_0x3db9('0xa')]['include']?_[_0x3db9('0x10')](_0x3813f5[_0x3db9('0xa')]['include'],function(_0x98b153){return{'model':db[_0x98b153[_0x3db9('0x11')]],'as':_0x98b153['as'],'attributes':_0x98b153[_0x3db9('0xd')],'include':_0x98b153[_0x3db9('0xf')]?_[_0x3db9('0x10')](_0x98b153[_0x3db9('0xf')],function(_0x2f13d3){return{'model':db[_0x2f13d3[_0x3db9('0x11')]],'as':_0x2f13d3['as'],'attributes':_0x2f13d3[_0x3db9('0xd')],'include':_0x2f13d3['include']?_['map'](_0x2f13d3['include'],function(_0x2ce4fe){return{'model':db[_0x2ce4fe[_0x3db9('0x11')]],'as':_0x2ce4fe['as'],'attributes':_0x2ce4fe[_0x3db9('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x18d3c5){logger[_0x3db9('0x19')]('ShowSquareProject',_0x3813f5);logger['debug'](_0x3db9('0x17'),_0x3813f5,JSON['stringify'](_0x18d3c5));_0xa88638(_0x18d3c5);})[_0x3db9('0x1a')](function(_0x4dcef1){logger[_0x3db9('0x15')](_0x3db9('0x17'),_0x4dcef1['message'],_0x3813f5);_0x3ce625(_0x197ecc[_0x3db9('0x15')](0x1f4,_0x4dcef1[_0x3db9('0x16')]));});});}; \ No newline at end of file +var _0xa18d=['ioredis','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','GetSquareProjects','findAll','options','where','attributes','map','model','include','then','info','debug','stringify','catch','error','message','SquareProject','find','raw','ShowSquareProject'];(function(_0x577b92,_0xb672f9){var _0x430d28=function(_0x2509c4){while(--_0x2509c4){_0x577b92['push'](_0x577b92['shift']());}};_0x430d28(++_0xb672f9);}(_0xa18d,0xc4));var _0xda18=function(_0x1a99e0,_0x38f839){_0x1a99e0=_0x1a99e0-0x0;var _0xb02bcf=_0xa18d[_0x1a99e0];return _0xb02bcf;};'use strict';var _=require('lodash');var Redis=require(_0xda18('0x0'));var db=require('../../mysqldb')['db'];var logger=require(_0xda18('0x1'))('rpc');var config=require(_0xda18('0x2'));config[_0xda18('0x3')]=_[_0xda18('0x4')](config['redis'],{'host':_0xda18('0x5'),'port':0x18eb});var socket=require(_0xda18('0x6'))(new Redis(config[_0xda18('0x3')]));require(_0xda18('0x7'))[_0xda18('0x8')](socket);exports[_0xda18('0x9')]=function(_0x2be53e){var _0x32ea4e=this;return new Promise(function(_0x2d2f55,_0x4e39fd){return db['SquareProject'][_0xda18('0xa')]({'raw':_0x2be53e[_0xda18('0xb')]?_0x2be53e['options']['raw']===undefined?!![]:![]:!![],'where':_0x2be53e[_0xda18('0xb')]?_0x2be53e[_0xda18('0xb')][_0xda18('0xc')]||null:null,'attributes':_0x2be53e[_0xda18('0xb')]?_0x2be53e[_0xda18('0xb')][_0xda18('0xd')]||null:null,'limit':_0x2be53e['options']?_0x2be53e[_0xda18('0xb')]['limit']||null:null,'include':_0x2be53e[_0xda18('0xb')]?_0x2be53e['options']['include']?_[_0xda18('0xe')](_0x2be53e['options']['include'],function(_0xd28b8){return{'model':db[_0xd28b8[_0xda18('0xf')]],'as':_0xd28b8['as'],'attributes':_0xd28b8[_0xda18('0xd')],'include':_0xd28b8[_0xda18('0x10')]?_[_0xda18('0xe')](_0xd28b8[_0xda18('0x10')],function(_0x140399){return{'model':db[_0x140399[_0xda18('0xf')]],'as':_0x140399['as'],'attributes':_0x140399[_0xda18('0xd')],'include':_0x140399[_0xda18('0x10')]?_['map'](_0x140399[_0xda18('0x10')],function(_0x3ab2a6){return{'model':db[_0x3ab2a6[_0xda18('0xf')]],'as':_0x3ab2a6['as'],'attributes':_0x3ab2a6[_0xda18('0xd')]};}):[]};}):[]};}):[]:[]})[_0xda18('0x11')](function(_0x200d23){logger[_0xda18('0x12')]('GetSquareProjects',_0x2be53e);logger[_0xda18('0x13')]('GetSquareProjects',_0x2be53e,JSON[_0xda18('0x14')](_0x200d23));_0x2d2f55(_0x200d23);})[_0xda18('0x15')](function(_0x499d3f){logger[_0xda18('0x16')](_0xda18('0x9'),_0x499d3f[_0xda18('0x17')],_0x2be53e);_0x4e39fd(_0x32ea4e[_0xda18('0x16')](0x1f4,_0x499d3f[_0xda18('0x17')]));});});};exports['ShowSquareProject']=function(_0xbae20){var _0x3c9241=this;return new Promise(function(_0x24ddbc,_0x2b72a5){return db[_0xda18('0x18')][_0xda18('0x19')]({'raw':_0xbae20[_0xda18('0xb')]?_0xbae20[_0xda18('0xb')][_0xda18('0x1a')]===undefined?!![]:![]:!![],'where':_0xbae20[_0xda18('0xb')]?_0xbae20[_0xda18('0xb')][_0xda18('0xc')]||null:null,'attributes':_0xbae20[_0xda18('0xb')]?_0xbae20[_0xda18('0xb')][_0xda18('0xd')]||null:null,'include':_0xbae20[_0xda18('0xb')]?_0xbae20[_0xda18('0xb')][_0xda18('0x10')]?_[_0xda18('0xe')](_0xbae20['options']['include'],function(_0x1f509a){return{'model':db[_0x1f509a[_0xda18('0xf')]],'as':_0x1f509a['as'],'attributes':_0x1f509a['attributes'],'include':_0x1f509a['include']?_[_0xda18('0xe')](_0x1f509a[_0xda18('0x10')],function(_0x20f81a){return{'model':db[_0x20f81a[_0xda18('0xf')]],'as':_0x20f81a['as'],'attributes':_0x20f81a['attributes'],'include':_0x20f81a[_0xda18('0x10')]?_[_0xda18('0xe')](_0x20f81a['include'],function(_0x5c85a6){return{'model':db[_0x5c85a6[_0xda18('0xf')]],'as':_0x5c85a6['as'],'attributes':_0x5c85a6[_0xda18('0xd')]};}):[]};}):[]};}):[]:[]})[_0xda18('0x11')](function(_0x845acf){logger['info'](_0xda18('0x1b'),_0xbae20);logger['debug'](_0xda18('0x1b'),_0xbae20,JSON[_0xda18('0x14')](_0x845acf));_0x24ddbc(_0x845acf);})[_0xda18('0x15')](function(_0x464186){logger[_0xda18('0x16')](_0xda18('0x1b'),_0x464186['message'],_0xbae20);_0x2b72a5(_0x3c9241[_0xda18('0x16')](0x1f4,_0x464186[_0xda18('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 62c1bc1..69f273e 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 _0x113a=['./squareProject.events','save','remove','update','emit','register','length','squareProject:'];(function(_0x43a5ee,_0x229071){var _0x15e8d0=function(_0x799620){while(--_0x799620){_0x43a5ee['push'](_0x43a5ee['shift']());}};_0x15e8d0(++_0x229071);}(_0x113a,0xf8));var _0xa113=function(_0x122c0a,_0x15c8cc){_0x122c0a=_0x122c0a-0x0;var _0xc16f7=_0x113a[_0x122c0a];return _0xc16f7;};'use strict';var SquareProjectEvents=require(_0xa113('0x0'));var events=[_0xa113('0x1'),_0xa113('0x2'),_0xa113('0x3')];function createListener(_0x2ba19f,_0x49f60e){return function(_0x5cdb3e){_0x49f60e[_0xa113('0x4')](_0x2ba19f,_0x5cdb3e);};}function removeListener(_0x1cc16c,_0x17f9dd){return function(){SquareProjectEvents['removeListener'](_0x1cc16c,_0x17f9dd);};}exports[_0xa113('0x5')]=function(_0x910802){for(var _0x2b37be=0x0,_0x26edac=events[_0xa113('0x6')];_0x2b37be<_0x26edac;_0x2b37be++){var _0x2486a3=events[_0x2b37be];var _0x1298a4=createListener(_0xa113('0x7')+_0x2486a3,_0x910802);SquareProjectEvents['on'](_0x2486a3,_0x1298a4);}}; \ No newline at end of file +var _0xf966=['emit','register','save','remove','update'];(function(_0x424292,_0x580796){var _0x2909fa=function(_0x35e52e){while(--_0x35e52e){_0x424292['push'](_0x424292['shift']());}};_0x2909fa(++_0x580796);}(_0xf966,0x101));var _0x6f96=function(_0x55d50e,_0x67fa72){_0x55d50e=_0x55d50e-0x0;var _0xcd9855=_0xf966[_0x55d50e];return _0xcd9855;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6f96('0x0'),_0x6f96('0x1'),_0x6f96('0x2')];function createListener(_0x1a19c0,_0x3252c5){return function(_0x221fe3){_0x3252c5[_0x6f96('0x3')](_0x1a19c0,_0x221fe3);};}function removeListener(_0x4b996c,_0x572395){return function(){SquareProjectEvents['removeListener'](_0x4b996c,_0x572395);};}exports[_0x6f96('0x4')]=function(_0x505e36){for(var _0x243ebc=0x0,_0x3e3684=events['length'];_0x243ebc<_0x3e3684;_0x243ebc++){var _0x332c91=events[_0x243ebc];var _0x140b43=createListener('squareProject:'+_0x332c91,_0x505e36);SquareProjectEvents['on'](_0x332c91,_0x140b43);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index e82056a..51d7588 100644 --- a/server/api/squareRecording/index.js +++ b/server/api/squareRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabce=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','download','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0xca24ab,_0x59edcf){var _0x2e31ad=function(_0x362c71){while(--_0x362c71){_0xca24ab['push'](_0xca24ab['shift']());}};_0x2e31ad(++_0x59edcf);}(_0xabce,0x103));var _0xeabc=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xabce[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./squareRecording.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id/download',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0xc')]('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x10')]);router[_0xeabc('0x11')](_0xeabc('0xf'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x12')]);module[_0xeabc('0x13')]=router; \ No newline at end of file +var _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x4c5b1e,_0x53f68e){var _0x1fe3a6=function(_0x4dc81d){while(--_0x4dc81d){_0x4c5b1e['push'](_0x4c5b1e['shift']());}};_0x1fe3a6(++_0x53f68e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x25ff60,_0x2c91f7){_0x25ff60=_0x25ff60-0x0;var _0x3daebc=_0x1cb9[_0x25ff60];return _0x3daebc;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 78fd76c..8eeb4e9 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 _0x5d17=['getDataValue','savePath','substring','sequelize','exports','STRING','VIRTUAL'];(function(_0x5e4ab5,_0x515b8b){var _0x53c7ae=function(_0x3d7a36){while(--_0x3d7a36){_0x5e4ab5['push'](_0x5e4ab5['shift']());}};_0x53c7ae(++_0x515b8b);}(_0x5d17,0x114));var _0x75d1=function(_0x6317d6,_0x424384){_0x6317d6=_0x6317d6-0x0;var _0x5add4d=_0x5d17[_0x6317d6];return _0x5add4d;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x75d1('0x2')]},'context':{'type':Sequelize[_0x75d1('0x2')]},'extension':{'type':Sequelize[_0x75d1('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x75d1('0x2')]},'dnid':{'type':Sequelize[_0x75d1('0x2')]},'projectName':{'type':Sequelize[_0x75d1('0x2')]},'saveName':{'type':Sequelize[_0x75d1('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x75d1('0x2')]},'format':{'type':Sequelize[_0x75d1('0x3')],'get':function(){var _0x5c957a='';var _0x1ee61b=this[_0x75d1('0x4')](_0x75d1('0x5'));if(_0x1ee61b){_0x5c957a=_0x1ee61b[_0x75d1('0x6')](_0x1ee61b['lastIndexOf']('.'));}return _0x5c957a;}}}; \ No newline at end of file +var _0x6f47=['savePath','substring','lastIndexOf','exports','STRING','VIRTUAL','getDataValue'];(function(_0x4e1de7,_0x4e85e8){var _0xeeda46=function(_0x577c47){while(--_0x577c47){_0x4e1de7['push'](_0x4e1de7['shift']());}};_0xeeda46(++_0x4e85e8);}(_0x6f47,0xc7));var _0x76f4=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x6f47[_0x49ca18];return _0x145d54;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'uniqueid':{'type':Sequelize[_0x76f4('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x76f4('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x76f4('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x76f4('0x1')]},'dnid':{'type':Sequelize[_0x76f4('0x1')]},'projectName':{'type':Sequelize[_0x76f4('0x1')]},'saveName':{'type':Sequelize[_0x76f4('0x1')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x76f4('0x1')]},'format':{'type':Sequelize[_0x76f4('0x2')],'get':function(){var _0x2176a7='';var _0x497f99=this[_0x76f4('0x3')](_0x76f4('0x4'));if(_0x497f99){_0x2176a7=_0x497f99[_0x76f4('0x5')](_0x497f99[_0x76f4('0x6')]('.'));}return _0x2176a7;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index ed56844..b529820 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 _0x5ad0=['hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','create','body','download','../../components/encryptor','uniqueid','find','savePath','filename','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','extname','unlink','message','SquareRecording\x20not\x20found','send','Not\x20found','destroy','info','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','error','stack','name','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length'];(function(_0x16ce4b,_0x2097c4){var _0x346707=function(_0x166d4a){while(--_0x166d4a){_0x16ce4b['push'](_0x16ce4b['shift']());}};_0x346707(++_0x2097c4);}(_0x5ad0,0x8f));var _0x05ad=function(_0x6bbb11,_0x44e6b5){_0x6bbb11=_0x6bbb11-0x0;var _0x4c4dc3=_0x5ad0[_0x6bbb11];return _0x4c4dc3;};'use strict';var emlformat=require(_0x05ad('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x05ad('0x1'));var jsonpatch=require(_0x05ad('0x2'));var rp=require(_0x05ad('0x3'));var moment=require(_0x05ad('0x4'));var BPromise=require(_0x05ad('0x5'));var Mustache=require(_0x05ad('0x6'));var util=require('util');var path=require(_0x05ad('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x05ad('0x8'));var fs=require('fs');var fs_extra=require(_0x05ad('0x9'));var _=require(_0x05ad('0xa'));var squel=require(_0x05ad('0xb'));var crypto=require(_0x05ad('0xc'));var jsforce=require(_0x05ad('0xd'));var deskjs=require(_0x05ad('0xe'));var toCsv=require(_0x05ad('0xf'));var querystring=require('querystring');var Papa=require(_0x05ad('0x10'));var Redis=require(_0x05ad('0x11'));var authService=require(_0x05ad('0x12'));var qs=require(_0x05ad('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x05ad('0x14'));var logger=require(_0x05ad('0x15'))(_0x05ad('0x16'));var utils=require(_0x05ad('0x17'));var config=require(_0x05ad('0x18'));var licenseUtil=require(_0x05ad('0x19'));var db=require(_0x05ad('0x1a'))['db'];function respondWithStatusCode(_0xb5ac2b,_0x11655f){_0x11655f=_0x11655f||0xcc;return function(_0x1e09b3){if(_0x1e09b3){return _0xb5ac2b[_0x05ad('0x1b')](_0x11655f);}return _0xb5ac2b[_0x05ad('0x1c')](_0x11655f)[_0x05ad('0x1d')]();};}function respondWithResult(_0x21b190,_0x314bbf){_0x314bbf=_0x314bbf||0xc8;return function(_0x17ca0f){if(_0x17ca0f){return _0x21b190['status'](_0x314bbf)[_0x05ad('0x1e')](_0x17ca0f);}};}function respondWithFilteredResult(_0x1416b4,_0x1ee62a){return function(_0x4ea200){if(_0x4ea200){var _0x3de115=typeof _0x1ee62a[_0x05ad('0x1f')]===_0x05ad('0x20')&&typeof _0x1ee62a[_0x05ad('0x21')]===_0x05ad('0x20');var _0x3a4cff=_0x4ea200[_0x05ad('0x22')];var _0x8cc230=_0x3de115?0x0:_0x1ee62a[_0x05ad('0x1f')];var _0x3b30ed=_0x3de115?_0x4ea200[_0x05ad('0x22')]:_0x1ee62a[_0x05ad('0x1f')]+_0x1ee62a[_0x05ad('0x21')];var _0xeb3f82;if(_0x3b30ed>=_0x3a4cff){_0x3b30ed=_0x3a4cff;_0xeb3f82=0xc8;}else{_0xeb3f82=0xce;}_0x1416b4[_0x05ad('0x1c')](_0xeb3f82);return _0x1416b4['set'](_0x05ad('0x23'),_0x8cc230+'-'+_0x3b30ed+'/'+_0x3a4cff)[_0x05ad('0x1e')](_0x4ea200);}return null;};}function patchUpdates(_0x3d22cf){return function(_0x35a4cf){try{jsonpatch[_0x05ad('0x24')](_0x35a4cf,_0x3d22cf,!![]);}catch(_0x18826e){return BPromise['reject'](_0x18826e);}return _0x35a4cf[_0x05ad('0x25')]();};}function saveUpdates(_0x346d61,_0x25cbcd){return function(_0x465c44){if(_0x465c44){return _0x465c44[_0x05ad('0x26')](_0x346d61)[_0x05ad('0x27')](function(_0x151fcd){return _0x151fcd;});}return null;};}function removeEntity(_0x1331df,_0x1a92f7){return function(_0x490b87){if(_0x490b87){return _0x490b87['destroy']()[_0x05ad('0x27')](function(){_0x1331df[_0x05ad('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57f1e3,_0x6879fa){return function(_0x370748){if(!_0x370748){_0x57f1e3['sendStatus'](0x194);}return _0x370748;};}function handleError(_0x3260b6,_0x15559e){_0x15559e=_0x15559e||0x1f4;return function(_0x1f2366){logger[_0x05ad('0x28')](_0x1f2366[_0x05ad('0x29')]);if(_0x1f2366[_0x05ad('0x2a')]){delete _0x1f2366['name'];}_0x3260b6[_0x05ad('0x1c')](_0x15559e)['send'](_0x1f2366);};}exports[_0x05ad('0x2b')]=function(_0x29e5ca,_0x352ad6){var _0x4c362d={},_0x16f06c={},_0x448760={'count':0x0,'rows':[]};var _0x4e8e78=_[_0x05ad('0x2c')](db[_0x05ad('0x2d')][_0x05ad('0x2e')],function(_0x43dff4){return{'name':_0x43dff4[_0x05ad('0x2f')],'type':_0x43dff4[_0x05ad('0x30')][_0x05ad('0x31')]};});_0x16f06c[_0x05ad('0x32')]=_[_0x05ad('0x2c')](_0x4e8e78,'name');_0x16f06c['query']=_['keys'](_0x29e5ca[_0x05ad('0x33')]);_0x16f06c[_0x05ad('0x34')]=_[_0x05ad('0x35')](_0x16f06c[_0x05ad('0x32')],_0x16f06c[_0x05ad('0x33')]);_0x4c362d['attributes']=_['intersection'](_0x16f06c['model'],qs[_0x05ad('0x36')](_0x29e5ca[_0x05ad('0x33')][_0x05ad('0x36')]));_0x4c362d[_0x05ad('0x37')]=_0x4c362d[_0x05ad('0x37')][_0x05ad('0x38')]?_0x4c362d[_0x05ad('0x37')]:_0x16f06c[_0x05ad('0x32')];if(!_0x29e5ca[_0x05ad('0x33')][_0x05ad('0x39')](_0x05ad('0x3a'))){_0x4c362d['limit']=qs[_0x05ad('0x21')](_0x29e5ca[_0x05ad('0x33')][_0x05ad('0x21')]);_0x4c362d[_0x05ad('0x1f')]=qs['offset'](_0x29e5ca[_0x05ad('0x33')][_0x05ad('0x1f')]);}_0x4c362d['order']=qs[_0x05ad('0x3b')](_0x29e5ca['query'][_0x05ad('0x3b')]);_0x4c362d[_0x05ad('0x3c')]=qs[_0x05ad('0x34')](_[_0x05ad('0x3d')](_0x29e5ca['query'],_0x16f06c[_0x05ad('0x34')]),_0x4e8e78);if(_0x29e5ca[_0x05ad('0x33')][_0x05ad('0x3e')]){_0x4c362d[_0x05ad('0x3c')]=_[_0x05ad('0x3f')](_0x4c362d[_0x05ad('0x3c')],{'$or':_['map'](_0x4e8e78,function(_0x49df4f){if(_0x49df4f[_0x05ad('0x30')]!==_0x05ad('0x40')){var _0x2a75c7={};_0x2a75c7[_0x49df4f[_0x05ad('0x2a')]]={'$like':'%'+_0x29e5ca[_0x05ad('0x33')]['filter']+'%'};return _0x2a75c7;}})});}_0x4c362d=_[_0x05ad('0x3f')]({},_0x4c362d,_0x29e5ca[_0x05ad('0x41')]);var _0x2ef161={'where':_0x4c362d['where']};return db[_0x05ad('0x2d')][_0x05ad('0x22')](_0x2ef161)[_0x05ad('0x27')](function(_0x4bbcac){_0x448760[_0x05ad('0x22')]=_0x4bbcac;if(_0x29e5ca['query'][_0x05ad('0x42')]){_0x4c362d[_0x05ad('0x43')]=[{'all':!![]}];}return db[_0x05ad('0x2d')][_0x05ad('0x44')](_0x4c362d);})[_0x05ad('0x27')](function(_0x3d7bcd){_0x448760['rows']=_0x3d7bcd;return _0x448760;})[_0x05ad('0x27')](respondWithFilteredResult(_0x352ad6,_0x4c362d))[_0x05ad('0x45')](handleError(_0x352ad6,null));};exports[_0x05ad('0x46')]=function(_0x21c8c0,_0x592ec2){var _0x52d838={'raw':!![],'where':{'id':_0x21c8c0[_0x05ad('0x47')]['id']}},_0x2cc003={};_0x2cc003[_0x05ad('0x32')]=_[_0x05ad('0x48')](db['SquareRecording'][_0x05ad('0x2e')]);_0x2cc003[_0x05ad('0x33')]=_[_0x05ad('0x48')](_0x21c8c0[_0x05ad('0x33')]);_0x2cc003[_0x05ad('0x34')]=_[_0x05ad('0x35')](_0x2cc003['model'],_0x2cc003[_0x05ad('0x33')]);_0x52d838[_0x05ad('0x37')]=_[_0x05ad('0x35')](_0x2cc003['model'],qs['fields'](_0x21c8c0[_0x05ad('0x33')]['fields']));_0x52d838[_0x05ad('0x37')]=_0x52d838['attributes']['length']?_0x52d838[_0x05ad('0x37')]:_0x2cc003[_0x05ad('0x32')];if(_0x21c8c0[_0x05ad('0x33')][_0x05ad('0x42')]){_0x52d838['include']=[{'all':!![]}];}_0x52d838=_[_0x05ad('0x3f')]({},_0x52d838,_0x21c8c0[_0x05ad('0x41')]);return db[_0x05ad('0x2d')]['find'](_0x52d838)[_0x05ad('0x27')](handleEntityNotFound(_0x592ec2,null))['then'](respondWithResult(_0x592ec2,null))['catch'](handleError(_0x592ec2,null));};exports['create']=function(_0xe9616e,_0x18b9e1){return db[_0x05ad('0x2d')][_0x05ad('0x49')](_0xe9616e[_0x05ad('0x4a')],{})['then'](respondWithResult(_0x18b9e1,0xc9))[_0x05ad('0x45')](handleError(_0x18b9e1,null));};exports[_0x05ad('0x26')]=function(_0x4b809a,_0x47b2b0){if(_0x4b809a[_0x05ad('0x4a')]['id']){delete _0x4b809a[_0x05ad('0x4a')]['id'];}return db['SquareRecording']['find']({'where':{'id':_0x4b809a[_0x05ad('0x47')]['id']}})['then'](handleEntityNotFound(_0x47b2b0,null))[_0x05ad('0x27')](saveUpdates(_0x4b809a[_0x05ad('0x4a')],null))['then'](respondWithResult(_0x47b2b0,null))[_0x05ad('0x45')](handleError(_0x47b2b0,null));};exports[_0x05ad('0x4b')]=function(_0x1a0fa3,_0x3e739f,_0x4184cd){var _0x952d14=require(_0x05ad('0x4c'));var _0x2ee6d2=![];var _0x1029d8={};if(_0x1a0fa3['query'][_0x05ad('0x30')]&&_0x1a0fa3[_0x05ad('0x33')][_0x05ad('0x30')]===_0x05ad('0x4d')){_0x1029d8[_0x05ad('0x4d')]=_0x1a0fa3[_0x05ad('0x47')]['id'];}else{_0x1029d8['id']=_0x1a0fa3[_0x05ad('0x47')]['id'];}return db[_0x05ad('0x2d')][_0x05ad('0x4e')]({'where':_0x1029d8,'attributes':['id',_0x05ad('0x4f'),_0x05ad('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x3e739f,null))[_0x05ad('0x27')](function(_0x285882){if(_0x285882){var _0x2fa411=_0x285882[_0x05ad('0x4f')];var _0x98f870=util[_0x05ad('0x51')]('%s.cypher',_0x2fa411);if(fs[_0x05ad('0x52')](_0x98f870)){_0x2ee6d2=!![];return _0x952d14[_0x05ad('0x53')](_0x98f870,_0x2fa411,config[_0x05ad('0x54')][_0x05ad('0x55')])[_0x05ad('0x27')](function(){return _0x285882;});}return _0x285882;}})['then'](function(_0x13aee7){if(_0x13aee7){var _0x3cdf4f=_0x13aee7[_0x05ad('0x4f')];if(!fs[_0x05ad('0x52')](_0x3cdf4f)){throw new db[(_0x05ad('0x56'))][(_0x05ad('0x57'))]('SquareRecording\x20not\x20found');}if(_0x13aee7[_0x05ad('0x50')]){return _0x3e739f['download'](_0x3cdf4f,_0x13aee7[_0x05ad('0x50')]+path[_0x05ad('0x58')](_0x3cdf4f),function(){if(_0x2ee6d2){fs[_0x05ad('0x59')](_0x3cdf4f);}});}else{return _0x3e739f[_0x05ad('0x4b')](_0x3cdf4f,function(_0x28974c){if(_0x2ee6d2){fs[_0x05ad('0x59')](_0x3cdf4f);}});}}})[_0x05ad('0x45')](function(_0x536800){if(_0x536800[_0x05ad('0x5a')]===_0x05ad('0x5b')){_0x3e739f[_0x05ad('0x1c')](0x194)[_0x05ad('0x5c')](_0x05ad('0x5d'));}else{return handleError(_0x3e739f,null);}});};exports[_0x05ad('0x5e')]=function(_0x81ba3a,_0x2a814b){return db[_0x05ad('0x2d')][_0x05ad('0x4e')]({'where':{'id':_0x81ba3a[_0x05ad('0x47')]['id']}})[_0x05ad('0x27')](function(_0x585113){if(_['isNil'](_0x585113)){throw new ReferenceError('Entity\x20not\x20found');}return _0x585113;})[_0x05ad('0x27')](function(_0x41a19d){var _0x559daa=_0x41a19d[_0x05ad('0x4f')];logger[_0x05ad('0x5f')]('cancellazione\x20fisica\x20documento\x20%s',_0x559daa);if(!_[_0x05ad('0x60')](_0x41a19d[_0x05ad('0x4f')])&&fs['existsSync'](_0x559daa)){logger[_0x05ad('0x5f')](_0x05ad('0x61')+_0x559daa+_0x05ad('0x62'));fs['unlinkSync'](_0x559daa);}_0x559daa=_0x559daa+_0x05ad('0x63');if(!_['isNil'](_0x41a19d[_0x05ad('0x4f')])&&fs[_0x05ad('0x52')](_0x559daa)){logger[_0x05ad('0x5f')](_0x05ad('0x61')+_0x559daa+_0x05ad('0x62'));fs['unlinkSync'](_0x559daa);}return _0x41a19d;})[_0x05ad('0x27')](function(_0x297870){if(!_0x297870)throw new InternalError();return _0x297870['destroy']();})['then'](function(){_0x2a814b[_0x05ad('0x1c')](0xcc)[_0x05ad('0x1d')]();})[_0x05ad('0x45')](handleError(_0x2a814b,null));}; \ No newline at end of file +var _0x8d86=['merge','VIRTUAL','includeAll','rows','catch','show','options','find','create','body','params','download','uniqueid','filename','savePath','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','isNil','File:\x20\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','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','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','SquareRecording','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','filters','filter','where'];(function(_0x51f855,_0x1afe8a){var _0x958f34=function(_0x40426e){while(--_0x40426e){_0x51f855['push'](_0x51f855['shift']());}};_0x958f34(++_0x1afe8a);}(_0x8d86,0x138));var _0x68d8=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x8d86[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x68d8('0x0'));var rimraf=require(_0x68d8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x68d8('0x2'));var rp=require(_0x68d8('0x3'));var moment=require(_0x68d8('0x4'));var BPromise=require(_0x68d8('0x5'));var Mustache=require(_0x68d8('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x68d8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x68d8('0x8'));var _=require(_0x68d8('0x9'));var squel=require(_0x68d8('0xa'));var crypto=require(_0x68d8('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x68d8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x68d8('0xd'));var Papa=require(_0x68d8('0xe'));var Redis=require('ioredis');var authService=require(_0x68d8('0xf'));var qs=require(_0x68d8('0x10'));var as=require(_0x68d8('0x11'));var hardwareService=require(_0x68d8('0x12'));var logger=require('../../config/logger')(_0x68d8('0x13'));var utils=require(_0x68d8('0x14'));var config=require(_0x68d8('0x15'));var licenseUtil=require(_0x68d8('0x16'));var db=require(_0x68d8('0x17'))['db'];function respondWithStatusCode(_0x5ac3b3,_0x431014){_0x431014=_0x431014||0xcc;return function(_0x3f6671){if(_0x3f6671){return _0x5ac3b3[_0x68d8('0x18')](_0x431014);}return _0x5ac3b3[_0x68d8('0x19')](_0x431014)[_0x68d8('0x1a')]();};}function respondWithResult(_0x455f13,_0xf7f84a){_0xf7f84a=_0xf7f84a||0xc8;return function(_0x41293f){if(_0x41293f){return _0x455f13[_0x68d8('0x19')](_0xf7f84a)[_0x68d8('0x1b')](_0x41293f);}};}function respondWithFilteredResult(_0x2a2f2b,_0x1b29df){return function(_0x6ddb17){if(_0x6ddb17){var _0x311c13=typeof _0x1b29df['offset']===_0x68d8('0x1c')&&typeof _0x1b29df[_0x68d8('0x1d')]===_0x68d8('0x1c');var _0x3ee083=_0x6ddb17[_0x68d8('0x1e')];var _0x5d58b5=_0x311c13?0x0:_0x1b29df['offset'];var _0x7ce455=_0x311c13?_0x6ddb17[_0x68d8('0x1e')]:_0x1b29df[_0x68d8('0x1f')]+_0x1b29df['limit'];var _0x5668a7;if(_0x7ce455>=_0x3ee083){_0x7ce455=_0x3ee083;_0x5668a7=0xc8;}else{_0x5668a7=0xce;}_0x2a2f2b[_0x68d8('0x19')](_0x5668a7);return _0x2a2f2b[_0x68d8('0x20')](_0x68d8('0x21'),_0x5d58b5+'-'+_0x7ce455+'/'+_0x3ee083)['json'](_0x6ddb17);}return null;};}function patchUpdates(_0x362059){return function(_0x1e00f0){try{jsonpatch['apply'](_0x1e00f0,_0x362059,!![]);}catch(_0x511ec4){return BPromise[_0x68d8('0x22')](_0x511ec4);}return _0x1e00f0[_0x68d8('0x23')]();};}function saveUpdates(_0x1a786f,_0x406130){return function(_0x43fc50){if(_0x43fc50){return _0x43fc50[_0x68d8('0x24')](_0x1a786f)[_0x68d8('0x25')](function(_0x1ff290){return _0x1ff290;});}return null;};}function removeEntity(_0x3f37d1,_0x185f8f){return function(_0x20201a){if(_0x20201a){return _0x20201a[_0x68d8('0x26')]()[_0x68d8('0x25')](function(){_0x3f37d1[_0x68d8('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4373f7,_0xc86778){return function(_0x5c0506){if(!_0x5c0506){_0x4373f7[_0x68d8('0x18')](0x194);}return _0x5c0506;};}function handleError(_0x5196fb,_0x407dcb){_0x407dcb=_0x407dcb||0x1f4;return function(_0xe8716b){logger[_0x68d8('0x27')](_0xe8716b[_0x68d8('0x28')]);if(_0xe8716b[_0x68d8('0x29')]){delete _0xe8716b['name'];}_0x5196fb[_0x68d8('0x19')](_0x407dcb)[_0x68d8('0x2a')](_0xe8716b);};}exports[_0x68d8('0x2b')]=function(_0x290693,_0x3892f6){var _0x283861={},_0x395cf0={},_0x54281c={'count':0x0,'rows':[]};var _0x9fb259=_[_0x68d8('0x2c')](db[_0x68d8('0x2d')]['rawAttributes'],function(_0x4ca470){return{'name':_0x4ca470[_0x68d8('0x2e')],'type':_0x4ca470[_0x68d8('0x2f')]['key']};});_0x395cf0[_0x68d8('0x30')]=_[_0x68d8('0x2c')](_0x9fb259,_0x68d8('0x29'));_0x395cf0[_0x68d8('0x31')]=_[_0x68d8('0x32')](_0x290693['query']);_0x395cf0['filters']=_[_0x68d8('0x33')](_0x395cf0['model'],_0x395cf0[_0x68d8('0x31')]);_0x283861[_0x68d8('0x34')]=_[_0x68d8('0x33')](_0x395cf0[_0x68d8('0x30')],qs['fields'](_0x290693[_0x68d8('0x31')][_0x68d8('0x35')]));_0x283861[_0x68d8('0x34')]=_0x283861[_0x68d8('0x34')][_0x68d8('0x36')]?_0x283861['attributes']:_0x395cf0[_0x68d8('0x30')];if(!_0x290693[_0x68d8('0x31')][_0x68d8('0x37')](_0x68d8('0x38'))){_0x283861[_0x68d8('0x1d')]=qs['limit'](_0x290693['query'][_0x68d8('0x1d')]);_0x283861[_0x68d8('0x1f')]=qs[_0x68d8('0x1f')](_0x290693[_0x68d8('0x31')]['offset']);}_0x283861['order']=qs['sort'](_0x290693[_0x68d8('0x31')]['sort']);_0x283861['where']=qs[_0x68d8('0x39')](_['pick'](_0x290693[_0x68d8('0x31')],_0x395cf0[_0x68d8('0x39')]),_0x9fb259);if(_0x290693[_0x68d8('0x31')][_0x68d8('0x3a')]){_0x283861[_0x68d8('0x3b')]=_[_0x68d8('0x3c')](_0x283861[_0x68d8('0x3b')],{'$or':_[_0x68d8('0x2c')](_0x9fb259,function(_0x5e1b66){if(_0x5e1b66['type']!==_0x68d8('0x3d')){var _0x56747c={};_0x56747c[_0x5e1b66[_0x68d8('0x29')]]={'$like':'%'+_0x290693[_0x68d8('0x31')][_0x68d8('0x3a')]+'%'};return _0x56747c;}})});}_0x283861=_['merge']({},_0x283861,_0x290693['options']);var _0x34e7ac={'where':_0x283861['where']};return db[_0x68d8('0x2d')][_0x68d8('0x1e')](_0x34e7ac)['then'](function(_0x2193f2){_0x54281c[_0x68d8('0x1e')]=_0x2193f2;if(_0x290693[_0x68d8('0x31')][_0x68d8('0x3e')]){_0x283861['include']=[{'all':!![]}];}return db[_0x68d8('0x2d')]['findAll'](_0x283861);})[_0x68d8('0x25')](function(_0x23b95a){_0x54281c[_0x68d8('0x3f')]=_0x23b95a;return _0x54281c;})[_0x68d8('0x25')](respondWithFilteredResult(_0x3892f6,_0x283861))[_0x68d8('0x40')](handleError(_0x3892f6,null));};exports[_0x68d8('0x41')]=function(_0x159a85,_0x5d7b7d){var _0xc87e61={'raw':!![],'where':{'id':_0x159a85['params']['id']}},_0x47f262={};_0x47f262[_0x68d8('0x30')]=_[_0x68d8('0x32')](db[_0x68d8('0x2d')]['rawAttributes']);_0x47f262[_0x68d8('0x31')]=_[_0x68d8('0x32')](_0x159a85['query']);_0x47f262['filters']=_[_0x68d8('0x33')](_0x47f262[_0x68d8('0x30')],_0x47f262['query']);_0xc87e61['attributes']=_[_0x68d8('0x33')](_0x47f262[_0x68d8('0x30')],qs['fields'](_0x159a85[_0x68d8('0x31')][_0x68d8('0x35')]));_0xc87e61['attributes']=_0xc87e61['attributes'][_0x68d8('0x36')]?_0xc87e61[_0x68d8('0x34')]:_0x47f262['model'];if(_0x159a85['query'][_0x68d8('0x3e')]){_0xc87e61['include']=[{'all':!![]}];}_0xc87e61=_[_0x68d8('0x3c')]({},_0xc87e61,_0x159a85[_0x68d8('0x42')]);return db[_0x68d8('0x2d')][_0x68d8('0x43')](_0xc87e61)['then'](handleEntityNotFound(_0x5d7b7d,null))['then'](respondWithResult(_0x5d7b7d,null))[_0x68d8('0x40')](handleError(_0x5d7b7d,null));};exports[_0x68d8('0x44')]=function(_0x59ba8d,_0x54a252){return db[_0x68d8('0x2d')]['create'](_0x59ba8d[_0x68d8('0x45')],{})['then'](respondWithResult(_0x54a252,0xc9))[_0x68d8('0x40')](handleError(_0x54a252,null));};exports['update']=function(_0xc3181b,_0x432929){if(_0xc3181b['body']['id']){delete _0xc3181b[_0x68d8('0x45')]['id'];}return db[_0x68d8('0x2d')][_0x68d8('0x43')]({'where':{'id':_0xc3181b[_0x68d8('0x46')]['id']}})[_0x68d8('0x25')](handleEntityNotFound(_0x432929,null))['then'](saveUpdates(_0xc3181b['body'],null))[_0x68d8('0x25')](respondWithResult(_0x432929,null))[_0x68d8('0x40')](handleError(_0x432929,null));};exports[_0x68d8('0x47')]=function(_0x4d86f0,_0x426e64,_0x2a031b){var _0x2793c2=require('../../components/encryptor');var _0x3e6a29=![];var _0x40a278={};if(_0x4d86f0['query'][_0x68d8('0x2f')]&&_0x4d86f0['query']['type']===_0x68d8('0x48')){_0x40a278['uniqueid']=_0x4d86f0[_0x68d8('0x46')]['id'];}else{_0x40a278['id']=_0x4d86f0[_0x68d8('0x46')]['id'];}return db[_0x68d8('0x2d')][_0x68d8('0x43')]({'where':_0x40a278,'attributes':['id','savePath',_0x68d8('0x49')],'raw':!![]})[_0x68d8('0x25')](handleEntityNotFound(_0x426e64,null))[_0x68d8('0x25')](function(_0x40fd7d){if(_0x40fd7d){var _0x4fb21b=_0x40fd7d[_0x68d8('0x4a')];var _0x1867c7=util[_0x68d8('0x4b')](_0x68d8('0x4c'),_0x4fb21b);if(fs[_0x68d8('0x4d')](_0x1867c7)){_0x3e6a29=!![];return _0x2793c2[_0x68d8('0x4e')](_0x1867c7,_0x4fb21b,config[_0x68d8('0x4f')][_0x68d8('0x50')])[_0x68d8('0x25')](function(){return _0x40fd7d;});}return _0x40fd7d;}})[_0x68d8('0x25')](function(_0x5e077f){if(_0x5e077f){var _0xb2cd45=_0x5e077f[_0x68d8('0x4a')];if(!fs[_0x68d8('0x4d')](_0xb2cd45)){throw new db[(_0x68d8('0x51'))]['ValidationError'](_0x68d8('0x52'));}if(_0x5e077f[_0x68d8('0x49')]){return _0x426e64[_0x68d8('0x47')](_0xb2cd45,_0x5e077f[_0x68d8('0x49')]+path[_0x68d8('0x53')](_0xb2cd45),function(){if(_0x3e6a29){fs['unlink'](_0xb2cd45);}});}else{return _0x426e64[_0x68d8('0x47')](_0xb2cd45,function(_0x36e46b){if(_0x3e6a29){fs[_0x68d8('0x54')](_0xb2cd45);}});}}})[_0x68d8('0x40')](function(_0x43ab92){if(_0x43ab92[_0x68d8('0x55')]===_0x68d8('0x52')){_0x426e64[_0x68d8('0x19')](0x194)[_0x68d8('0x2a')](_0x68d8('0x56'));}else{return handleError(_0x426e64,null);}});};exports['destroy']=function(_0x36e1ef,_0x143043){return db[_0x68d8('0x2d')][_0x68d8('0x43')]({'where':{'id':_0x36e1ef[_0x68d8('0x46')]['id']}})[_0x68d8('0x25')](function(_0x54c669){if(_['isNil'](_0x54c669)){throw new ReferenceError(_0x68d8('0x57'));}return _0x54c669;})[_0x68d8('0x25')](function(_0x43c3bf){var _0x367178=_0x43c3bf[_0x68d8('0x4a')];logger['info'](_0x68d8('0x58'),_0x367178);if(!_['isNil'](_0x43c3bf[_0x68d8('0x4a')])&&fs[_0x68d8('0x4d')](_0x367178)){logger['info']('File:\x20\x22'+_0x367178+_0x68d8('0x59'));fs[_0x68d8('0x5a')](_0x367178);}_0x367178=_0x367178+'.cypher';if(!_[_0x68d8('0x5b')](_0x43c3bf[_0x68d8('0x4a')])&&fs[_0x68d8('0x4d')](_0x367178)){logger['info'](_0x68d8('0x5c')+_0x367178+_0x68d8('0x59'));fs[_0x68d8('0x5a')](_0x367178);}return _0x43c3bf;})['then'](function(_0x2fdd91){if(!_0x2fdd91)throw new InternalError();return _0x2fdd91[_0x68d8('0x26')]();})[_0x68d8('0x25')](function(){_0x143043[_0x68d8('0x19')](0xcc)[_0x68d8('0x1a')]();})[_0x68d8('0x40')](handleError(_0x143043,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index d6e878d..eade622 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 _0x5ff9=['api','moment','path','./squareRecording.attributes','exports','SquareRecording','square_recordings','lodash','util'];(function(_0x446cb3,_0x5baa92){var _0x124312=function(_0x296684){while(--_0x296684){_0x446cb3['push'](_0x446cb3['shift']());}};_0x124312(++_0x5baa92);}(_0x5ff9,0xa0));var _0x95ff=function(_0x22a3b7,_0xfc87eb){_0x22a3b7=_0x22a3b7-0x0;var _0x5d4ef3=_0x5ff9[_0x22a3b7];return _0x5d4ef3;};'use strict';var _=require(_0x95ff('0x0'));var util=require(_0x95ff('0x1'));var logger=require('../../config/logger')(_0x95ff('0x2'));var moment=require(_0x95ff('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95ff('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x95ff('0x5'));module[_0x95ff('0x6')]=function(_0x4d37f2,_0x1d9d79){return _0x4d37f2['define'](_0x95ff('0x7'),attributes,{'tableName':_0x95ff('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x714c=['define','util','../../config/logger','api','moment','bluebird','path','rimraf','exports'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x714c,0x18d));var _0xc714=function(_0xb875ee,_0x583042){_0xb875ee=_0xb875ee-0x0;var _0x4c7f3a=_0x714c[_0xb875ee];return _0x4c7f3a;};'use strict';var _=require('lodash');var util=require(_0xc714('0x0'));var logger=require(_0xc714('0x1'))(_0xc714('0x2'));var moment=require(_0xc714('0x3'));var BPromise=require(_0xc714('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc714('0x5'));var rimraf=require(_0xc714('0x6'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module[_0xc714('0x7')]=function(_0xf624fc,_0x1c4a3b){return _0xf624fc[_0xc714('0x8')]('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 07733e7..9e08e15 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 _0x3a7e=['SquareRecording','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','stringify','error','code','message','SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording'];(function(_0x3a37d7,_0x406e4b){var _0x3c6994=function(_0x449394){while(--_0x449394){_0x3a37d7['push'](_0x3a37d7['shift']());}};_0x3c6994(++_0x406e4b);}(_0x3a7e,0x70));var _0xe3a7=function(_0x525b28,_0x5cf5a0){_0x525b28=_0x525b28-0x0;var _0x180178=_0x3a7e[_0x525b28];return _0x180178;};'use strict';var _=require(_0xe3a7('0x0'));var util=require(_0xe3a7('0x1'));var moment=require(_0xe3a7('0x2'));var BPromise=require(_0xe3a7('0x3'));var rs=require(_0xe3a7('0x4'));var fs=require('fs');var Redis=require(_0xe3a7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe3a7('0x6'));var logger=require(_0xe3a7('0x7'))(_0xe3a7('0x8'));var config=require(_0xe3a7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe3a7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e9c03,_0x82f8e8,_0x1f47f7){return new BPromise(function(_0x2c238c,_0x1b041a){return client['request'](_0x3e9c03,_0x1f47f7)[_0xe3a7('0xb')](function(_0x36ebc4){logger[_0xe3a7('0xc')]('SquareRecording,\x20%s,\x20%s',_0x82f8e8,_0xe3a7('0xd'));logger[_0xe3a7('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x82f8e8,_0xe3a7('0xd'),JSON[_0xe3a7('0xf')](_0x36ebc4));if(_0x36ebc4[_0xe3a7('0x10')]){if(_0x36ebc4['error'][_0xe3a7('0x11')]===0x1f4){logger[_0xe3a7('0x10')]('SquareRecording,\x20%s,\x20%s',_0x82f8e8,_0x36ebc4[_0xe3a7('0x10')][_0xe3a7('0x12')]);return _0x1b041a(_0x36ebc4[_0xe3a7('0x10')][_0xe3a7('0x12')]);}logger[_0xe3a7('0x10')](_0xe3a7('0x13'),_0x82f8e8,_0x36ebc4['error'][_0xe3a7('0x12')]);return _0x2c238c(_0x36ebc4[_0xe3a7('0x10')][_0xe3a7('0x12')]);}else{logger[_0xe3a7('0xc')](_0xe3a7('0x13'),_0x82f8e8,_0xe3a7('0xd'));_0x2c238c(_0x36ebc4[_0xe3a7('0x14')][_0xe3a7('0x12')]);}})[_0xe3a7('0x15')](function(_0x5def13){logger[_0xe3a7('0x10')]('SquareRecording,\x20%s,\x20%s',_0x82f8e8,_0x5def13);_0x1b041a(_0x5def13);});});}exports[_0xe3a7('0x16')]=function(_0x2138c5){var _0x2bbcc2=this;return new Promise(function(_0x526656,_0x51490a){return db[_0xe3a7('0x17')][_0xe3a7('0x18')](_0x2138c5[_0xe3a7('0x19')],{'raw':_0x2138c5[_0xe3a7('0x1a')]?_0x2138c5[_0xe3a7('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x22be98){logger[_0xe3a7('0xc')]('CreateSquareRecording',_0x2138c5);logger[_0xe3a7('0xe')](_0xe3a7('0x16'),_0x2138c5,JSON[_0xe3a7('0xf')](_0x22be98));_0x526656(_0x22be98);})[_0xe3a7('0x15')](function(_0x40a065){logger[_0xe3a7('0x10')](_0xe3a7('0x16'),_0x40a065['message'],_0x2138c5);_0x51490a(_0x2bbcc2[_0xe3a7('0x10')](0x1f4,_0x40a065[_0xe3a7('0x12')]));});});}; \ No newline at end of file +var _0x1daa=['CreateSquareRecording','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','SquareRecording,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','SquareRecording','body','options','raw'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x1daa,0x139));var _0xa1da=function(_0x7bff4f,_0x45ce80){_0x7bff4f=_0x7bff4f-0x0;var _0x3c6a26=_0x1daa[_0x7bff4f];return _0x3c6a26;};'use strict';var _=require(_0xa1da('0x0'));var util=require('util');var moment=require(_0xa1da('0x1'));var BPromise=require('bluebird');var rs=require(_0xa1da('0x2'));var fs=require('fs');var Redis=require(_0xa1da('0x3'));var db=require(_0xa1da('0x4'))['db'];var utils=require(_0xa1da('0x5'));var logger=require('../../config/logger')(_0xa1da('0x6'));var config=require(_0xa1da('0x7'));var jayson=require(_0xa1da('0x8'));var client=jayson[_0xa1da('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0c37,_0x23cfb1,_0xd504da){return new BPromise(function(_0x2ea2d9,_0x160b51){return client['request'](_0x4d0c37,_0xd504da)[_0xa1da('0xa')](function(_0x20d995){logger[_0xa1da('0xb')](_0xa1da('0xc'),_0x23cfb1,'request\x20sent');logger[_0xa1da('0xd')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x23cfb1,_0xa1da('0xe'),JSON[_0xa1da('0xf')](_0x20d995));if(_0x20d995[_0xa1da('0x10')]){if(_0x20d995[_0xa1da('0x10')][_0xa1da('0x11')]===0x1f4){logger[_0xa1da('0x10')](_0xa1da('0xc'),_0x23cfb1,_0x20d995[_0xa1da('0x10')][_0xa1da('0x12')]);return _0x160b51(_0x20d995['error'][_0xa1da('0x12')]);}logger[_0xa1da('0x10')]('SquareRecording,\x20%s,\x20%s',_0x23cfb1,_0x20d995['error'][_0xa1da('0x12')]);return _0x2ea2d9(_0x20d995[_0xa1da('0x10')][_0xa1da('0x12')]);}else{logger[_0xa1da('0xb')](_0xa1da('0xc'),_0x23cfb1,'request\x20sent');_0x2ea2d9(_0x20d995[_0xa1da('0x13')][_0xa1da('0x12')]);}})[_0xa1da('0x14')](function(_0x2ed2c0){logger['error'](_0xa1da('0xc'),_0x23cfb1,_0x2ed2c0);_0x160b51(_0x2ed2c0);});});}exports['CreateSquareRecording']=function(_0x22ba38){var _0x491173=this;return new Promise(function(_0x13c066,_0x350403){return db[_0xa1da('0x15')]['create'](_0x22ba38[_0xa1da('0x16')],{'raw':_0x22ba38['options']?_0x22ba38[_0xa1da('0x17')][_0xa1da('0x18')]===undefined?!![]:![]:!![]})[_0xa1da('0xa')](function(_0x47ef24){logger[_0xa1da('0xb')](_0xa1da('0x19'),_0x22ba38);logger['debug'](_0xa1da('0x19'),_0x22ba38,JSON[_0xa1da('0xf')](_0x47ef24));_0x13c066(_0x47ef24);})[_0xa1da('0x14')](function(_0x352917){logger[_0xa1da('0x10')](_0xa1da('0x19'),_0x352917[_0xa1da('0x12')],_0x22ba38);_0x350403(_0x491173[_0xa1da('0x10')](0x1f4,_0x352917['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index ef3fe30..0d753ec 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 _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4df376,_0x33aad5){var _0x484417=function(_0x2093cf){while(--_0x2093cf){_0x4df376['push'](_0x4df376['shift']());}};_0x484417(++_0x33aad5);}(_0xb10b,0x12a));var _0xbb10=function(_0x91e5da,_0x25ce34){_0x91e5da=_0x91e5da-0x0;var _0x5533f3=_0xb10b[_0x91e5da];return _0x5533f3;};'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','./squareReport.controller','get','index','/describe','show','post'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['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/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 6ec53b9..edf333a 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 _0xaa56=['exports','STRING','DATE','BOOLEAN'];(function(_0x5458d1,_0x1aad44){var _0x43168a=function(_0x343be4){while(--_0x343be4){_0x5458d1['push'](_0x5458d1['shift']());}};_0x43168a(++_0x1aad44);}(_0xaa56,0x1ac));var _0x6aa5=function(_0x50ac22,_0xbd3132){_0x50ac22=_0x50ac22-0x0;var _0x22c73a=_0xaa56[_0x50ac22];return _0x22c73a;};'use strict';var Sequelize=require('sequelize');module[_0x6aa5('0x0')]={'network':{'type':Sequelize[_0x6aa5('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x6aa5('0x1')]},'channel':{'type':Sequelize[_0x6aa5('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x6aa5('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x6aa5('0x1')]},'calleridname':{'type':Sequelize[_0x6aa5('0x1')]},'callingpres':{'type':Sequelize[_0x6aa5('0x1')]},'callingani2':{'type':Sequelize[_0x6aa5('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x6aa5('0x1')]},'context':{'type':Sequelize[_0x6aa5('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6aa5('0x1')]},'enhanced':{'type':Sequelize[_0x6aa5('0x1')]},'accountcode':{'type':Sequelize[_0x6aa5('0x1')]},'threadid':{'type':Sequelize[_0x6aa5('0x1')]},'project_name':{'type':Sequelize[_0x6aa5('0x1')]},'joinAt':{'type':Sequelize[_0x6aa5('0x2')]},'leaveAt':{'type':Sequelize[_0x6aa5('0x2')]},'bot':{'type':Sequelize[_0x6aa5('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xb9f0=['DATE','exports','STRING'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb9f0,0x181));var _0x0b9f=function(_0x5be46a,_0x2fb035){_0x5be46a=_0x5be46a-0x0;var _0x1ce3b8=_0xb9f0[_0x5be46a];return _0x1ce3b8;};'use strict';var Sequelize=require('sequelize');module[_0x0b9f('0x0')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0b9f('0x1')]},'language':{'type':Sequelize[_0x0b9f('0x1')]},'type':{'type':Sequelize[_0x0b9f('0x1')]},'uniqueid':{'type':Sequelize[_0x0b9f('0x1')]},'version':{'type':Sequelize[_0x0b9f('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x0b9f('0x1')]},'callingpres':{'type':Sequelize[_0x0b9f('0x1')]},'callingani2':{'type':Sequelize[_0x0b9f('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x0b9f('0x1')]},'dnid':{'type':Sequelize[_0x0b9f('0x1')]},'rdnis':{'type':Sequelize[_0x0b9f('0x1')]},'context':{'type':Sequelize[_0x0b9f('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x0b9f('0x1')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x0b9f('0x2')]},'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 cd2bc13..72504d4 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 _0xa16a=['update','then','destroy','error','stack','name','send','index','SquareReport','rawAttributes','fieldName','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','length','find','create','body','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x142e34,_0x5ee5fd){var _0x1f14a6=function(_0x43fe54){while(--_0x43fe54){_0x142e34['push'](_0x142e34['shift']());}};_0x1f14a6(++_0x5ee5fd);}(_0xa16a,0xbf));var _0xaa16=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xa16a[_0x2283dc];return _0x16db90;};'use strict';var emlformat=require(_0xaa16('0x0'));var rimraf=require(_0xaa16('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa16('0x2'));var rp=require('request-promise');var moment=require(_0xaa16('0x3'));var BPromise=require(_0xaa16('0x4'));var Mustache=require(_0xaa16('0x5'));var util=require(_0xaa16('0x6'));var path=require(_0xaa16('0x7'));var sox=require(_0xaa16('0x8'));var csv=require(_0xaa16('0x9'));var ejs=require(_0xaa16('0xa'));var fs=require('fs');var fs_extra=require(_0xaa16('0xb'));var _=require(_0xaa16('0xc'));var squel=require(_0xaa16('0xd'));var crypto=require(_0xaa16('0xe'));var jsforce=require(_0xaa16('0xf'));var deskjs=require(_0xaa16('0x10'));var toCsv=require('to-csv');var querystring=require(_0xaa16('0x11'));var Papa=require(_0xaa16('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xaa16('0x13'));var as=require(_0xaa16('0x14'));var hardwareService=require(_0xaa16('0x15'));var logger=require(_0xaa16('0x16'))('api');var utils=require(_0xaa16('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xaa16('0x18'));var db=require(_0xaa16('0x19'))['db'];function respondWithStatusCode(_0x5a8dd3,_0x14471f){_0x14471f=_0x14471f||0xcc;return function(_0xb0eb7e){if(_0xb0eb7e){return _0x5a8dd3[_0xaa16('0x1a')](_0x14471f);}return _0x5a8dd3[_0xaa16('0x1b')](_0x14471f)[_0xaa16('0x1c')]();};}function respondWithResult(_0x15667f,_0x3b47c8){_0x3b47c8=_0x3b47c8||0xc8;return function(_0x4fe6bd){if(_0x4fe6bd){return _0x15667f[_0xaa16('0x1b')](_0x3b47c8)[_0xaa16('0x1d')](_0x4fe6bd);}};}function respondWithFilteredResult(_0x34d307,_0x2d0d12){return function(_0x21b7a4){if(_0x21b7a4){var _0x53faf1=typeof _0x2d0d12[_0xaa16('0x1e')]===_0xaa16('0x1f')&&typeof _0x2d0d12[_0xaa16('0x20')]===_0xaa16('0x1f');var _0x40b24f=_0x21b7a4['count'];var _0x4c2bb0=_0x53faf1?0x0:_0x2d0d12[_0xaa16('0x1e')];var _0x3dcd7c=_0x53faf1?_0x21b7a4[_0xaa16('0x21')]:_0x2d0d12[_0xaa16('0x1e')]+_0x2d0d12['limit'];var _0x2a72a3;if(_0x3dcd7c>=_0x40b24f){_0x3dcd7c=_0x40b24f;_0x2a72a3=0xc8;}else{_0x2a72a3=0xce;}_0x34d307['status'](_0x2a72a3);return _0x34d307[_0xaa16('0x22')](_0xaa16('0x23'),_0x4c2bb0+'-'+_0x3dcd7c+'/'+_0x40b24f)[_0xaa16('0x1d')](_0x21b7a4);}return null;};}function patchUpdates(_0x231e65){return function(_0x442e03){try{jsonpatch[_0xaa16('0x24')](_0x442e03,_0x231e65,!![]);}catch(_0x183d2f){return BPromise['reject'](_0x183d2f);}return _0x442e03['save']();};}function saveUpdates(_0x291732,_0xea329d){return function(_0x1aa4d1){if(_0x1aa4d1){return _0x1aa4d1[_0xaa16('0x25')](_0x291732)[_0xaa16('0x26')](function(_0x420fb4){return _0x420fb4;});}return null;};}function removeEntity(_0x4a3467,_0x4ed4dd){return function(_0x363999){if(_0x363999){return _0x363999[_0xaa16('0x27')]()[_0xaa16('0x26')](function(){_0x4a3467[_0xaa16('0x1b')](0xcc)[_0xaa16('0x1c')]();});}};}function handleEntityNotFound(_0x45f008,_0x60a79e){return function(_0x3fdc89){if(!_0x3fdc89){_0x45f008[_0xaa16('0x1a')](0x194);}return _0x3fdc89;};}function handleError(_0x25f01d,_0x556bd8){_0x556bd8=_0x556bd8||0x1f4;return function(_0x1aad3b){logger[_0xaa16('0x28')](_0x1aad3b[_0xaa16('0x29')]);if(_0x1aad3b[_0xaa16('0x2a')]){delete _0x1aad3b[_0xaa16('0x2a')];}_0x25f01d[_0xaa16('0x1b')](_0x556bd8)[_0xaa16('0x2b')](_0x1aad3b);};}exports[_0xaa16('0x2c')]=function(_0x1e04a4,_0x477388){var _0x45c7a0={},_0x267947={},_0x1d538d={'count':0x0,'rows':[]};var _0x52a0d9=_['map'](db[_0xaa16('0x2d')][_0xaa16('0x2e')],function(_0x5195da){return{'name':_0x5195da[_0xaa16('0x2f')],'type':_0x5195da['type'][_0xaa16('0x30')]};});_0x267947[_0xaa16('0x31')]=_[_0xaa16('0x32')](_0x52a0d9,_0xaa16('0x2a'));_0x267947[_0xaa16('0x33')]=_[_0xaa16('0x34')](_0x1e04a4[_0xaa16('0x33')]);_0x267947['filters']=_['intersection'](_0x267947[_0xaa16('0x31')],_0x267947[_0xaa16('0x33')]);_0x45c7a0[_0xaa16('0x35')]=_[_0xaa16('0x36')](_0x267947[_0xaa16('0x31')],qs['fields'](_0x1e04a4['query'][_0xaa16('0x37')]));_0x45c7a0[_0xaa16('0x35')]=_0x45c7a0[_0xaa16('0x35')]['length']?_0x45c7a0[_0xaa16('0x35')]:_0x267947['model'];if(!_0x1e04a4['query'][_0xaa16('0x38')]('nolimit')){_0x45c7a0[_0xaa16('0x20')]=qs[_0xaa16('0x20')](_0x1e04a4['query'][_0xaa16('0x20')]);_0x45c7a0[_0xaa16('0x1e')]=qs['offset'](_0x1e04a4[_0xaa16('0x33')][_0xaa16('0x1e')]);}_0x45c7a0[_0xaa16('0x39')]=qs['sort'](_0x1e04a4[_0xaa16('0x33')][_0xaa16('0x3a')]);_0x45c7a0[_0xaa16('0x3b')]=qs[_0xaa16('0x3c')](_[_0xaa16('0x3d')](_0x1e04a4['query'],_0x267947[_0xaa16('0x3c')]),_0x52a0d9);if(_0x1e04a4['query']['filter']){_0x45c7a0['where']=_[_0xaa16('0x3e')](_0x45c7a0[_0xaa16('0x3b')],{'$or':_['map'](_0x52a0d9,function(_0x14b95e){if(_0x14b95e['type']!=='VIRTUAL'){var _0x15f210={};_0x15f210[_0x14b95e[_0xaa16('0x2a')]]={'$like':'%'+_0x1e04a4[_0xaa16('0x33')][_0xaa16('0x3f')]+'%'};return _0x15f210;}})});}_0x45c7a0=_[_0xaa16('0x3e')]({},_0x45c7a0,_0x1e04a4[_0xaa16('0x40')]);var _0x442641={'where':_0x45c7a0[_0xaa16('0x3b')]};return db[_0xaa16('0x2d')][_0xaa16('0x21')](_0x442641)['then'](function(_0x225218){_0x1d538d['count']=_0x225218;if(_0x1e04a4['query'][_0xaa16('0x41')]){_0x45c7a0[_0xaa16('0x42')]=[{'all':!![]}];}return db[_0xaa16('0x2d')][_0xaa16('0x43')](_0x45c7a0);})[_0xaa16('0x26')](function(_0x4677cc){_0x1d538d['rows']=_0x4677cc;return _0x1d538d;})[_0xaa16('0x26')](respondWithFilteredResult(_0x477388,_0x45c7a0))[_0xaa16('0x44')](handleError(_0x477388,null));};exports[_0xaa16('0x45')]=function(_0x2105a5,_0x36dacd){var _0x4c6d00={'raw':!![],'where':{'id':_0x2105a5[_0xaa16('0x46')]['id']}},_0x1f0530={};_0x1f0530[_0xaa16('0x31')]=_[_0xaa16('0x34')](db[_0xaa16('0x2d')][_0xaa16('0x2e')]);_0x1f0530[_0xaa16('0x33')]=_['keys'](_0x2105a5[_0xaa16('0x33')]);_0x1f0530['filters']=_[_0xaa16('0x36')](_0x1f0530[_0xaa16('0x31')],_0x1f0530[_0xaa16('0x33')]);_0x4c6d00[_0xaa16('0x35')]=_[_0xaa16('0x36')](_0x1f0530[_0xaa16('0x31')],qs[_0xaa16('0x37')](_0x2105a5['query'][_0xaa16('0x37')]));_0x4c6d00['attributes']=_0x4c6d00['attributes'][_0xaa16('0x47')]?_0x4c6d00[_0xaa16('0x35')]:_0x1f0530['model'];if(_0x2105a5[_0xaa16('0x33')][_0xaa16('0x41')]){_0x4c6d00['include']=[{'all':!![]}];}_0x4c6d00=_[_0xaa16('0x3e')]({},_0x4c6d00,_0x2105a5[_0xaa16('0x40')]);return db[_0xaa16('0x2d')][_0xaa16('0x48')](_0x4c6d00)['then'](handleEntityNotFound(_0x36dacd,null))[_0xaa16('0x26')](respondWithResult(_0x36dacd,null))[_0xaa16('0x44')](handleError(_0x36dacd,null));};exports['create']=function(_0x30324b,_0x41f99d){return db[_0xaa16('0x2d')][_0xaa16('0x49')](_0x30324b[_0xaa16('0x4a')],{})[_0xaa16('0x26')](respondWithResult(_0x41f99d,0xc9))[_0xaa16('0x44')](handleError(_0x41f99d,null));};exports[_0xaa16('0x25')]=function(_0x1404fe,_0x435cb5){if(_0x1404fe[_0xaa16('0x4a')]['id']){delete _0x1404fe[_0xaa16('0x4a')]['id'];}return db[_0xaa16('0x2d')][_0xaa16('0x48')]({'where':{'id':_0x1404fe[_0xaa16('0x46')]['id']}})['then'](handleEntityNotFound(_0x435cb5,null))[_0xaa16('0x26')](saveUpdates(_0x1404fe['body'],null))[_0xaa16('0x26')](respondWithResult(_0x435cb5,null))[_0xaa16('0x44')](handleError(_0x435cb5,null));};exports[_0xaa16('0x27')]=function(_0x1537a9,_0x5170ca){return db[_0xaa16('0x2d')]['find']({'where':{'id':_0x1537a9['params']['id']}})[_0xaa16('0x26')](handleEntityNotFound(_0x5170ca,null))[_0xaa16('0x26')](removeEntity(_0x5170ca,null))[_0xaa16('0x44')](handleError(_0x5170ca,null));};exports[_0xaa16('0x4b')]=function(_0x58db30,_0x528260){return db[_0xaa16('0x2d')][_0xaa16('0x4b')]()[_0xaa16('0x26')](respondWithResult(_0x528260,null))[_0xaa16('0x44')](handleError(_0x528260,null));}; \ No newline at end of file +var _0x6a12=['filter','options','where','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','destroy','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','apply','reject','then','end','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','merge','type','VIRTUAL'];(function(_0x3032e2,_0x26a4e8){var _0x427aef=function(_0x4b9281){while(--_0x4b9281){_0x3032e2['push'](_0x3032e2['shift']());}};_0x427aef(++_0x26a4e8);}(_0x6a12,0xa6));var _0x26a1=function(_0x5de91e,_0x31cefd){_0x5de91e=_0x5de91e-0x0;var _0x3e409a=_0x6a12[_0x5de91e];return _0x3e409a;};'use strict';var emlformat=require(_0x26a1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26a1('0x1'));var jsonpatch=require(_0x26a1('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x26a1('0x3'));var Mustache=require(_0x26a1('0x4'));var util=require('util');var path=require(_0x26a1('0x5'));var sox=require(_0x26a1('0x6'));var csv=require(_0x26a1('0x7'));var ejs=require(_0x26a1('0x8'));var fs=require('fs');var fs_extra=require(_0x26a1('0x9'));var _=require(_0x26a1('0xa'));var squel=require(_0x26a1('0xb'));var crypto=require(_0x26a1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x26a1('0xd'));var toCsv=require('to-csv');var querystring=require(_0x26a1('0xe'));var Papa=require(_0x26a1('0xf'));var Redis=require(_0x26a1('0x10'));var authService=require(_0x26a1('0x11'));var qs=require(_0x26a1('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26a1('0x13'));var logger=require('../../config/logger')(_0x26a1('0x14'));var utils=require(_0x26a1('0x15'));var config=require(_0x26a1('0x16'));var licenseUtil=require(_0x26a1('0x17'));var db=require(_0x26a1('0x18'))['db'];function respondWithStatusCode(_0x29024d,_0x86c6e2){_0x86c6e2=_0x86c6e2||0xcc;return function(_0xdcadfa){if(_0xdcadfa){return _0x29024d[_0x26a1('0x19')](_0x86c6e2);}return _0x29024d['status'](_0x86c6e2)['end']();};}function respondWithResult(_0x11ac59,_0x4057c6){_0x4057c6=_0x4057c6||0xc8;return function(_0x323efa){if(_0x323efa){return _0x11ac59[_0x26a1('0x1a')](_0x4057c6)['json'](_0x323efa);}};}function respondWithFilteredResult(_0x168843,_0x5703be){return function(_0x42ab53){if(_0x42ab53){var _0x317772=typeof _0x5703be[_0x26a1('0x1b')]==='undefined'&&typeof _0x5703be[_0x26a1('0x1c')]===_0x26a1('0x1d');var _0x33262b=_0x42ab53[_0x26a1('0x1e')];var _0x451660=_0x317772?0x0:_0x5703be[_0x26a1('0x1b')];var _0x32a1e6=_0x317772?_0x42ab53[_0x26a1('0x1e')]:_0x5703be[_0x26a1('0x1b')]+_0x5703be[_0x26a1('0x1c')];var _0x48d289;if(_0x32a1e6>=_0x33262b){_0x32a1e6=_0x33262b;_0x48d289=0xc8;}else{_0x48d289=0xce;}_0x168843[_0x26a1('0x1a')](_0x48d289);return _0x168843[_0x26a1('0x1f')](_0x26a1('0x20'),_0x451660+'-'+_0x32a1e6+'/'+_0x33262b)['json'](_0x42ab53);}return null;};}function patchUpdates(_0x31e176){return function(_0x276095){try{jsonpatch[_0x26a1('0x21')](_0x276095,_0x31e176,!![]);}catch(_0x45c13e){return BPromise[_0x26a1('0x22')](_0x45c13e);}return _0x276095['save']();};}function saveUpdates(_0xe1a05b,_0x25417a){return function(_0x284cd3){if(_0x284cd3){return _0x284cd3['update'](_0xe1a05b)[_0x26a1('0x23')](function(_0x4baac7){return _0x4baac7;});}return null;};}function removeEntity(_0x3dcb4f,_0x1f8e6f){return function(_0x32f8aa){if(_0x32f8aa){return _0x32f8aa['destroy']()['then'](function(){_0x3dcb4f[_0x26a1('0x1a')](0xcc)[_0x26a1('0x24')]();});}};}function handleEntityNotFound(_0xb1f2e7,_0x2d78d2){return function(_0x5b05d0){if(!_0x5b05d0){_0xb1f2e7['sendStatus'](0x194);}return _0x5b05d0;};}function handleError(_0x49b3df,_0x2f9be9){_0x2f9be9=_0x2f9be9||0x1f4;return function(_0x4227af){logger['error'](_0x4227af[_0x26a1('0x25')]);if(_0x4227af['name']){delete _0x4227af[_0x26a1('0x26')];}_0x49b3df[_0x26a1('0x1a')](_0x2f9be9)[_0x26a1('0x27')](_0x4227af);};}exports[_0x26a1('0x28')]=function(_0x1e1ac2,_0x6f3532){var _0x59948c={},_0x454870={},_0x1524a5={'count':0x0,'rows':[]};var _0x3f0752=_[_0x26a1('0x29')](db[_0x26a1('0x2a')][_0x26a1('0x2b')],function(_0x5926a1){return{'name':_0x5926a1[_0x26a1('0x2c')],'type':_0x5926a1['type']['key']};});_0x454870['model']=_['map'](_0x3f0752,_0x26a1('0x26'));_0x454870['query']=_['keys'](_0x1e1ac2[_0x26a1('0x2d')]);_0x454870[_0x26a1('0x2e')]=_[_0x26a1('0x2f')](_0x454870[_0x26a1('0x30')],_0x454870[_0x26a1('0x2d')]);_0x59948c[_0x26a1('0x31')]=_[_0x26a1('0x2f')](_0x454870['model'],qs[_0x26a1('0x32')](_0x1e1ac2[_0x26a1('0x2d')][_0x26a1('0x32')]));_0x59948c['attributes']=_0x59948c[_0x26a1('0x31')][_0x26a1('0x33')]?_0x59948c[_0x26a1('0x31')]:_0x454870[_0x26a1('0x30')];if(!_0x1e1ac2[_0x26a1('0x2d')]['hasOwnProperty'](_0x26a1('0x34'))){_0x59948c['limit']=qs[_0x26a1('0x1c')](_0x1e1ac2[_0x26a1('0x2d')][_0x26a1('0x1c')]);_0x59948c[_0x26a1('0x1b')]=qs['offset'](_0x1e1ac2['query'][_0x26a1('0x1b')]);}_0x59948c[_0x26a1('0x35')]=qs[_0x26a1('0x36')](_0x1e1ac2[_0x26a1('0x2d')][_0x26a1('0x36')]);_0x59948c['where']=qs[_0x26a1('0x2e')](_[_0x26a1('0x37')](_0x1e1ac2[_0x26a1('0x2d')],_0x454870[_0x26a1('0x2e')]),_0x3f0752);if(_0x1e1ac2[_0x26a1('0x2d')]['filter']){_0x59948c['where']=_[_0x26a1('0x38')](_0x59948c['where'],{'$or':_['map'](_0x3f0752,function(_0x3de1dd){if(_0x3de1dd[_0x26a1('0x39')]!==_0x26a1('0x3a')){var _0xe9bd3f={};_0xe9bd3f[_0x3de1dd[_0x26a1('0x26')]]={'$like':'%'+_0x1e1ac2[_0x26a1('0x2d')][_0x26a1('0x3b')]+'%'};return _0xe9bd3f;}})});}_0x59948c=_[_0x26a1('0x38')]({},_0x59948c,_0x1e1ac2[_0x26a1('0x3c')]);var _0x1e85c5={'where':_0x59948c[_0x26a1('0x3d')]};return db[_0x26a1('0x2a')][_0x26a1('0x1e')](_0x1e85c5)[_0x26a1('0x23')](function(_0x4be69c){_0x1524a5[_0x26a1('0x1e')]=_0x4be69c;if(_0x1e1ac2[_0x26a1('0x2d')][_0x26a1('0x3e')]){_0x59948c[_0x26a1('0x3f')]=[{'all':!![]}];}return db['SquareReport'][_0x26a1('0x40')](_0x59948c);})[_0x26a1('0x23')](function(_0x41b281){_0x1524a5['rows']=_0x41b281;return _0x1524a5;})['then'](respondWithFilteredResult(_0x6f3532,_0x59948c))[_0x26a1('0x41')](handleError(_0x6f3532,null));};exports[_0x26a1('0x42')]=function(_0x3c8152,_0x536833){var _0x322d93={'raw':!![],'where':{'id':_0x3c8152[_0x26a1('0x43')]['id']}},_0x4e2a74={};_0x4e2a74['model']=_[_0x26a1('0x44')](db[_0x26a1('0x2a')][_0x26a1('0x2b')]);_0x4e2a74['query']=_[_0x26a1('0x44')](_0x3c8152[_0x26a1('0x2d')]);_0x4e2a74[_0x26a1('0x2e')]=_[_0x26a1('0x2f')](_0x4e2a74[_0x26a1('0x30')],_0x4e2a74[_0x26a1('0x2d')]);_0x322d93[_0x26a1('0x31')]=_['intersection'](_0x4e2a74['model'],qs['fields'](_0x3c8152[_0x26a1('0x2d')][_0x26a1('0x32')]));_0x322d93[_0x26a1('0x31')]=_0x322d93[_0x26a1('0x31')]['length']?_0x322d93[_0x26a1('0x31')]:_0x4e2a74['model'];if(_0x3c8152[_0x26a1('0x2d')][_0x26a1('0x3e')]){_0x322d93['include']=[{'all':!![]}];}_0x322d93=_[_0x26a1('0x38')]({},_0x322d93,_0x3c8152[_0x26a1('0x3c')]);return db[_0x26a1('0x2a')][_0x26a1('0x45')](_0x322d93)[_0x26a1('0x23')](handleEntityNotFound(_0x536833,null))['then'](respondWithResult(_0x536833,null))['catch'](handleError(_0x536833,null));};exports[_0x26a1('0x46')]=function(_0x3cef10,_0x2bc514){return db[_0x26a1('0x2a')][_0x26a1('0x46')](_0x3cef10[_0x26a1('0x47')],{})[_0x26a1('0x23')](respondWithResult(_0x2bc514,0xc9))[_0x26a1('0x41')](handleError(_0x2bc514,null));};exports[_0x26a1('0x48')]=function(_0x23346d,_0x30513a){if(_0x23346d[_0x26a1('0x47')]['id']){delete _0x23346d[_0x26a1('0x47')]['id'];}return db[_0x26a1('0x2a')][_0x26a1('0x45')]({'where':{'id':_0x23346d[_0x26a1('0x43')]['id']}})[_0x26a1('0x23')](handleEntityNotFound(_0x30513a,null))[_0x26a1('0x23')](saveUpdates(_0x23346d[_0x26a1('0x47')],null))['then'](respondWithResult(_0x30513a,null))[_0x26a1('0x41')](handleError(_0x30513a,null));};exports[_0x26a1('0x49')]=function(_0x442a43,_0x2347ae){return db[_0x26a1('0x2a')]['find']({'where':{'id':_0x442a43[_0x26a1('0x43')]['id']}})[_0x26a1('0x23')](handleEntityNotFound(_0x2347ae,null))['then'](removeEntity(_0x2347ae,null))[_0x26a1('0x41')](handleError(_0x2347ae,null));};exports[_0x26a1('0x4a')]=function(_0x1f8abd,_0x46f3f6){return db['SquareReport'][_0x26a1('0x4a')]()[_0x26a1('0x23')](respondWithResult(_0x46f3f6,null))[_0x26a1('0x41')](handleError(_0x46f3f6,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 564798b..e887768 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 _0xf914=['leaveAt','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name'];(function(_0x6d1214,_0x1829f0){var _0x22b23f=function(_0x454d1e){while(--_0x454d1e){_0x6d1214['push'](_0x6d1214['shift']());}};_0x22b23f(++_0x1829f0);}(_0xf914,0xe2));var _0x4f91=function(_0x598b5d,_0x3f4d1e){_0x598b5d=_0x598b5d-0x0;var _0x54ab06=_0xf914[_0x598b5d];return _0x54ab06;};'use strict';var _=require('lodash');var util=require(_0x4f91('0x0'));var logger=require(_0x4f91('0x1'))(_0x4f91('0x2'));var moment=require(_0x4f91('0x3'));var BPromise=require(_0x4f91('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f91('0x5'));var rimraf=require(_0x4f91('0x6'));var config=require('../../config/environment');var attributes=require('./squareReport.attributes');module[_0x4f91('0x7')]=function(_0x47faf3,_0x4d178a){return _0x47faf3[_0x4f91('0x8')](_0x4f91('0x9'),attributes,{'tableName':_0x4f91('0xa'),'paranoid':![],'indexes':[{'name':_0x4f91('0xb'),'fields':[_0x4f91('0xc'),_0x4f91('0xd')]},{'name':_0x4f91('0xe'),'fields':[_0x4f91('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf052=['api','request-promise','path','../../config/environment','./squareReport.attributes','exports','define','uid_pname','uniqueid','project_name','leaveAt','lodash'];(function(_0x3fdfa0,_0x582bb1){var _0x12d70a=function(_0x9d33e8){while(--_0x9d33e8){_0x3fdfa0['push'](_0x3fdfa0['shift']());}};_0x12d70a(++_0x582bb1);}(_0xf052,0x12b));var _0x2f05=function(_0xea81a1,_0xb28e9e){_0xea81a1=_0xea81a1-0x0;var _0x2cd030=_0xf052[_0xea81a1];return _0x2cd030;};'use strict';var _=require(_0x2f05('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2f05('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2f05('0x2'));var fs=require('fs');var path=require(_0x2f05('0x3'));var rimraf=require('rimraf');var config=require(_0x2f05('0x4'));var attributes=require(_0x2f05('0x5'));module[_0x2f05('0x6')]=function(_0x36b2be,_0x3b3e39){return _0x36b2be[_0x2f05('0x7')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x2f05('0x8'),'fields':[_0x2f05('0x9'),_0x2f05('0xa')]},{'name':'leaveAt','fields':[_0x2f05('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index c636ac1..67ca264 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 _0x2c2c=['raw','where','attributes','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request','then','info','SquareReport,\x20%s,\x20%s','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateSquareReport','SquareReport','create','body','options','debug','catch'];(function(_0x2f15ef,_0x45e669){var _0x461234=function(_0x40ea87){while(--_0x40ea87){_0x2f15ef['push'](_0x2f15ef['shift']());}};_0x461234(++_0x45e669);}(_0x2c2c,0x159));var _0xc2c2=function(_0x28460d,_0x6d386){_0x28460d=_0x28460d-0x0;var _0x1ff76b=_0x2c2c[_0x28460d];return _0x1ff76b;};'use strict';var _=require(_0xc2c2('0x0'));var util=require(_0xc2c2('0x1'));var moment=require(_0xc2c2('0x2'));var BPromise=require(_0xc2c2('0x3'));var rs=require(_0xc2c2('0x4'));var fs=require('fs');var Redis=require(_0xc2c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc2c2('0x6'));var logger=require(_0xc2c2('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc2c2('0x8')][_0xc2c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bdb77,_0x2f2503,_0x316fff){return new BPromise(function(_0x2bdad6,_0x5a5cae){return client[_0xc2c2('0xa')](_0x2bdb77,_0x316fff)[_0xc2c2('0xb')](function(_0x1d6cda){logger[_0xc2c2('0xc')](_0xc2c2('0xd'),_0x2f2503,'request\x20sent');logger['debug'](_0xc2c2('0xe'),_0x2f2503,_0xc2c2('0xf'),JSON[_0xc2c2('0x10')](_0x1d6cda));if(_0x1d6cda[_0xc2c2('0x11')]){if(_0x1d6cda[_0xc2c2('0x11')]['code']===0x1f4){logger['error'](_0xc2c2('0xd'),_0x2f2503,_0x1d6cda[_0xc2c2('0x11')][_0xc2c2('0x12')]);return _0x5a5cae(_0x1d6cda[_0xc2c2('0x11')][_0xc2c2('0x12')]);}logger[_0xc2c2('0x11')](_0xc2c2('0xd'),_0x2f2503,_0x1d6cda[_0xc2c2('0x11')][_0xc2c2('0x12')]);return _0x2bdad6(_0x1d6cda['error'][_0xc2c2('0x12')]);}else{logger[_0xc2c2('0xc')](_0xc2c2('0xd'),_0x2f2503,_0xc2c2('0xf'));_0x2bdad6(_0x1d6cda[_0xc2c2('0x13')]['message']);}})['catch'](function(_0x19666c){logger['error']('SquareReport,\x20%s,\x20%s',_0x2f2503,_0x19666c);_0x5a5cae(_0x19666c);});});}exports[_0xc2c2('0x14')]=function(_0x1677e5){var _0x5ecf39=this;return new Promise(function(_0x235ae7,_0x5414e3){return db[_0xc2c2('0x15')][_0xc2c2('0x16')](_0x1677e5[_0xc2c2('0x17')],{'raw':_0x1677e5[_0xc2c2('0x18')]?_0x1677e5[_0xc2c2('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc2c2('0xb')](function(_0x162b22){logger[_0xc2c2('0xc')](_0xc2c2('0x14'),_0x1677e5);logger[_0xc2c2('0x19')](_0xc2c2('0x14'),_0x1677e5,JSON[_0xc2c2('0x10')](_0x162b22));_0x235ae7(_0x162b22);})[_0xc2c2('0x1a')](function(_0x18cb78){logger[_0xc2c2('0x11')](_0xc2c2('0x14'),_0x18cb78['message'],_0x1677e5);_0x5414e3(_0x5ecf39[_0xc2c2('0x11')](0x1f4,_0x18cb78[_0xc2c2('0x12')]));});});};exports['UpdateSquareReport']=function(_0x248e09){var _0x546bff=this;return new Promise(function(_0x994182,_0x47da28){return db['SquareReport']['update'](_0x248e09[_0xc2c2('0x17')],{'raw':_0x248e09[_0xc2c2('0x18')]?_0x248e09[_0xc2c2('0x18')][_0xc2c2('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x248e09['options']?_0x248e09[_0xc2c2('0x18')][_0xc2c2('0x1c')]||null:null,'attributes':_0x248e09[_0xc2c2('0x18')]?_0x248e09[_0xc2c2('0x18')][_0xc2c2('0x1d')]||null:null,'limit':_0x248e09[_0xc2c2('0x18')]?_0x248e09[_0xc2c2('0x18')]['limit']||null:null})['then'](function(_0x261c85){logger['info'](_0xc2c2('0x1e'),_0x248e09);logger['debug']('UpdateSquareReport',_0x248e09,JSON['stringify'](_0x261c85));_0x994182(_0x261c85);})[_0xc2c2('0x1a')](function(_0x17d4c5){logger[_0xc2c2('0x11')](_0xc2c2('0x1e'),_0x17d4c5[_0xc2c2('0x12')],_0x248e09);_0x47da28(_0x546bff[_0xc2c2('0x11')](0x1f4,_0x17d4c5[_0xc2c2('0x12')]));});});}; \ No newline at end of file +var _0x35fa=['options','UpdateSquareReport','update','body','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','CreateSquareReport','SquareReport','create'];(function(_0x2d4a6f,_0x3ff15c){var _0x4344d7=function(_0x1e5b28){while(--_0x1e5b28){_0x2d4a6f['push'](_0x2d4a6f['shift']());}};_0x4344d7(++_0x3ff15c);}(_0x35fa,0x128));var _0xa35f=function(_0x453178,_0x4171d4){_0x453178=_0x453178-0x0;var _0x7a2475=_0x35fa[_0x453178];return _0x7a2475;};'use strict';var _=require(_0xa35f('0x0'));var util=require(_0xa35f('0x1'));var moment=require(_0xa35f('0x2'));var BPromise=require(_0xa35f('0x3'));var rs=require(_0xa35f('0x4'));var fs=require('fs');var Redis=require(_0xa35f('0x5'));var db=require(_0xa35f('0x6'))['db'];var utils=require(_0xa35f('0x7'));var logger=require(_0xa35f('0x8'))('rpc');var config=require(_0xa35f('0x9'));var jayson=require(_0xa35f('0xa'));var client=jayson[_0xa35f('0xb')][_0xa35f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x520f3c,_0x502c17,_0x9d0797){return new BPromise(function(_0x1a4418,_0x33050d){return client[_0xa35f('0xd')](_0x520f3c,_0x9d0797)[_0xa35f('0xe')](function(_0x19842f){logger['info'](_0xa35f('0xf'),_0x502c17,'request\x20sent');logger[_0xa35f('0x10')](_0xa35f('0x11'),_0x502c17,_0xa35f('0x12'),JSON[_0xa35f('0x13')](_0x19842f));if(_0x19842f[_0xa35f('0x14')]){if(_0x19842f[_0xa35f('0x14')]['code']===0x1f4){logger[_0xa35f('0x14')](_0xa35f('0xf'),_0x502c17,_0x19842f[_0xa35f('0x14')][_0xa35f('0x15')]);return _0x33050d(_0x19842f[_0xa35f('0x14')][_0xa35f('0x15')]);}logger[_0xa35f('0x14')](_0xa35f('0xf'),_0x502c17,_0x19842f['error'][_0xa35f('0x15')]);return _0x1a4418(_0x19842f[_0xa35f('0x14')][_0xa35f('0x15')]);}else{logger[_0xa35f('0x16')](_0xa35f('0xf'),_0x502c17,_0xa35f('0x12'));_0x1a4418(_0x19842f[_0xa35f('0x17')][_0xa35f('0x15')]);}})[_0xa35f('0x18')](function(_0x563974){logger[_0xa35f('0x14')](_0xa35f('0xf'),_0x502c17,_0x563974);_0x33050d(_0x563974);});});}exports[_0xa35f('0x19')]=function(_0x44f423){var _0xc5bb91=this;return new Promise(function(_0x2b4214,_0xae6339){return db[_0xa35f('0x1a')][_0xa35f('0x1b')](_0x44f423['body'],{'raw':_0x44f423[_0xa35f('0x1c')]?_0x44f423[_0xa35f('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0xa35f('0xe')](function(_0x4d1144){logger[_0xa35f('0x16')]('CreateSquareReport',_0x44f423);logger['debug'](_0xa35f('0x19'),_0x44f423,JSON['stringify'](_0x4d1144));_0x2b4214(_0x4d1144);})[_0xa35f('0x18')](function(_0x86367b){logger[_0xa35f('0x14')]('CreateSquareReport',_0x86367b[_0xa35f('0x15')],_0x44f423);_0xae6339(_0xc5bb91[_0xa35f('0x14')](0x1f4,_0x86367b['message']));});});};exports[_0xa35f('0x1d')]=function(_0x54f4ad){var _0x53abbe=this;return new Promise(function(_0x239904,_0x1cdd72){return db[_0xa35f('0x1a')][_0xa35f('0x1e')](_0x54f4ad[_0xa35f('0x1f')],{'raw':_0x54f4ad[_0xa35f('0x1c')]?_0x54f4ad[_0xa35f('0x1c')][_0xa35f('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54f4ad['options']?_0x54f4ad['options'][_0xa35f('0x21')]||null:null,'attributes':_0x54f4ad[_0xa35f('0x1c')]?_0x54f4ad[_0xa35f('0x1c')][_0xa35f('0x22')]||null:null,'limit':_0x54f4ad[_0xa35f('0x1c')]?_0x54f4ad[_0xa35f('0x1c')][_0xa35f('0x23')]||null:null})[_0xa35f('0xe')](function(_0x430fd1){logger[_0xa35f('0x16')](_0xa35f('0x1d'),_0x54f4ad);logger[_0xa35f('0x10')](_0xa35f('0x1d'),_0x54f4ad,JSON[_0xa35f('0x13')](_0x430fd1));_0x239904(_0x430fd1);})['catch'](function(_0x373f87){logger['error'](_0xa35f('0x1d'),_0x373f87['message'],_0x54f4ad);_0x1cdd72(_0x53abbe['error'](0x1f4,_0x373f87['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0f6db9a..023c6c3 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 _0x1162=['isAuthenticated','index','describe','/:id','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get'];(function(_0xab67ca,_0x29c008){var _0x13f28d=function(_0x4c1ed9){while(--_0x4c1ed9){_0xab67ca['push'](_0xab67ca['shift']());}};_0x13f28d(++_0x29c008);}(_0x1162,0x135));var _0x2116=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1162[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x2116('0x0'));var util=require(_0x2116('0x1'));var path=require('path');var timeout=require(_0x2116('0x2'));var express=require(_0x2116('0x3'));var router=express[_0x2116('0x4')]();var fs_extra=require(_0x2116('0x5'));var auth=require(_0x2116('0x6'));var interaction=require(_0x2116('0x7'));var config=require(_0x2116('0x8'));var controller=require(_0x2116('0x9'));router[_0x2116('0xa')]('/',auth[_0x2116('0xb')](),controller[_0x2116('0xc')]);router[_0x2116('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x2116('0xd')]);router[_0x2116('0xa')](_0x2116('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2116('0xf')](_0x2116('0xe'),auth[_0x2116('0xb')](),controller[_0x2116('0x10')]);router[_0x2116('0x11')](_0x2116('0xe'),auth[_0x2116('0xb')](),controller[_0x2116('0x12')]);module[_0x2116('0x13')]=router; \ No newline at end of file +var _0x7507=['../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2a337c,_0x2d32dd){var _0x4a7639=function(_0x236755){while(--_0x236755){_0x2a337c['push'](_0x2a337c['shift']());}};_0x4a7639(++_0x2d32dd);}(_0x7507,0x1f0));var _0x7750=function(_0x3f9e2c,_0x400d08){_0x3f9e2c=_0x3f9e2c-0x0;var _0x1d6c3b=_0x7507[_0x3f9e2c];return _0x1d6c3b;};'use strict';var multer=require(_0x7750('0x0'));var util=require(_0x7750('0x1'));var path=require(_0x7750('0x2'));var timeout=require(_0x7750('0x3'));var express=require(_0x7750('0x4'));var router=express[_0x7750('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7750('0x6'));var interaction=require(_0x7750('0x7'));var config=require(_0x7750('0x8'));var controller=require(_0x7750('0x9'));router[_0x7750('0xa')]('/',auth[_0x7750('0xb')](),controller[_0x7750('0xc')]);router['get'](_0x7750('0xd'),auth[_0x7750('0xb')](),controller[_0x7750('0xe')]);router[_0x7750('0xa')](_0x7750('0xf'),auth[_0x7750('0xb')](),controller['show']);router['post']('/',auth[_0x7750('0xb')](),controller[_0x7750('0x10')]);router[_0x7750('0x11')](_0x7750('0xf'),auth[_0x7750('0xb')](),controller['update']);router[_0x7750('0x12')](_0x7750('0xf'),auth[_0x7750('0xb')](),controller[_0x7750('0x13')]);module[_0x7750('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index ece2aa1..8395ff9 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 _0xb7af=['STRING','TEXT','exports'];(function(_0x4a7389,_0xa99bd9){var _0x246ee8=function(_0x29cbb0){while(--_0x29cbb0){_0x4a7389['push'](_0x4a7389['shift']());}};_0x246ee8(++_0xa99bd9);}(_0xb7af,0xa4));var _0xfb7a=function(_0x245e2d,_0x1515a6){_0x245e2d=_0x245e2d-0x0;var _0x2d1b6f=_0xb7af[_0x245e2d];return _0x2d1b6f;};'use strict';var Sequelize=require('sequelize');module[_0xfb7a('0x0')]={'uniqueid':{'type':Sequelize[_0xfb7a('0x1')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0xfb7a('0x1')]},'data':{'type':Sequelize[_0xfb7a('0x2')]},'project_name':{'type':Sequelize[_0xfb7a('0x1')]},'callerid':{'type':Sequelize[_0xfb7a('0x1')]}}; \ No newline at end of file +var _0x1abb=['TEXT','sequelize','STRING'];(function(_0x1c0b45,_0x1df578){var _0x115f1c=function(_0x1696d0){while(--_0x1696d0){_0x1c0b45['push'](_0x1c0b45['shift']());}};_0x115f1c(++_0x1df578);}(_0x1abb,0x6d));var _0xb1ab=function(_0x4401b7,_0x98b2f1){_0x4401b7=_0x4401b7-0x0;var _0x458b00=_0x1abb[_0x4401b7];return _0x458b00;};'use strict';var Sequelize=require(_0xb1ab('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xb1ab('0x1')]},'node':{'type':Sequelize[_0xb1ab('0x1')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xb1ab('0x2')]},'project_name':{'type':Sequelize[_0xb1ab('0x1')]},'callerid':{'type':Sequelize[_0xb1ab('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index aeea56c..341c0ed 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 _0x4a35=['SquareDetailsReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','update','body','describe','eml-format','rimraf','fast-json-patch','request-promise','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index'];(function(_0x9a23df,_0x2edc93){var _0x44c94e=function(_0xb17494){while(--_0xb17494){_0x9a23df['push'](_0x9a23df['shift']());}};_0x44c94e(++_0x2edc93);}(_0x4a35,0x1a0));var _0x54a3=function(_0x4683c5,_0x5a3ea8){_0x4683c5=_0x4683c5-0x0;var _0x175537=_0x4a35[_0x4683c5];return _0x175537;};'use strict';var emlformat=require(_0x54a3('0x0'));var rimraf=require(_0x54a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54a3('0x2'));var rp=require(_0x54a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x54a3('0x4'));var sox=require(_0x54a3('0x5'));var csv=require(_0x54a3('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x54a3('0x7'));var _=require(_0x54a3('0x8'));var squel=require(_0x54a3('0x9'));var crypto=require(_0x54a3('0xa'));var jsforce=require(_0x54a3('0xb'));var deskjs=require(_0x54a3('0xc'));var toCsv=require(_0x54a3('0x6'));var querystring=require('querystring');var Papa=require(_0x54a3('0xd'));var Redis=require(_0x54a3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x54a3('0xf'));var as=require(_0x54a3('0x10'));var hardwareService=require(_0x54a3('0x11'));var logger=require(_0x54a3('0x12'))('api');var utils=require(_0x54a3('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x54a3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa41954,_0x1c1623){_0x1c1623=_0x1c1623||0xcc;return function(_0x2e29f3){if(_0x2e29f3){return _0xa41954[_0x54a3('0x15')](_0x1c1623);}return _0xa41954[_0x54a3('0x16')](_0x1c1623)[_0x54a3('0x17')]();};}function respondWithResult(_0x27b37a,_0x1fbfe6){_0x1fbfe6=_0x1fbfe6||0xc8;return function(_0x1b8cb9){if(_0x1b8cb9){return _0x27b37a[_0x54a3('0x16')](_0x1fbfe6)[_0x54a3('0x18')](_0x1b8cb9);}};}function respondWithFilteredResult(_0x437bab,_0x3c6702){return function(_0x3fce78){if(_0x3fce78){var _0x4ce102=typeof _0x3c6702[_0x54a3('0x19')]==='undefined'&&typeof _0x3c6702[_0x54a3('0x1a')]==='undefined';var _0x55b5a3=_0x3fce78[_0x54a3('0x1b')];var _0x33824f=_0x4ce102?0x0:_0x3c6702[_0x54a3('0x19')];var _0x48aa6a=_0x4ce102?_0x3fce78[_0x54a3('0x1b')]:_0x3c6702[_0x54a3('0x19')]+_0x3c6702[_0x54a3('0x1a')];var _0x549a06;if(_0x48aa6a>=_0x55b5a3){_0x48aa6a=_0x55b5a3;_0x549a06=0xc8;}else{_0x549a06=0xce;}_0x437bab[_0x54a3('0x16')](_0x549a06);return _0x437bab[_0x54a3('0x1c')](_0x54a3('0x1d'),_0x33824f+'-'+_0x48aa6a+'/'+_0x55b5a3)['json'](_0x3fce78);}return null;};}function patchUpdates(_0x45f1e6){return function(_0x2d3870){try{jsonpatch[_0x54a3('0x1e')](_0x2d3870,_0x45f1e6,!![]);}catch(_0x2b4768){return BPromise[_0x54a3('0x1f')](_0x2b4768);}return _0x2d3870[_0x54a3('0x20')]();};}function saveUpdates(_0x40f82a,_0x3ae4b2){return function(_0x4ad227){if(_0x4ad227){return _0x4ad227['update'](_0x40f82a)[_0x54a3('0x21')](function(_0x996bb6){return _0x996bb6;});}return null;};}function removeEntity(_0x49f8cd,_0x52cb5f){return function(_0xd2ecef){if(_0xd2ecef){return _0xd2ecef[_0x54a3('0x22')]()[_0x54a3('0x21')](function(){_0x49f8cd['status'](0xcc)[_0x54a3('0x17')]();});}};}function handleEntityNotFound(_0xb3b328,_0x5503ef){return function(_0x43cd14){if(!_0x43cd14){_0xb3b328[_0x54a3('0x15')](0x194);}return _0x43cd14;};}function handleError(_0x225baa,_0x2c16a8){_0x2c16a8=_0x2c16a8||0x1f4;return function(_0x40f555){logger[_0x54a3('0x23')](_0x40f555[_0x54a3('0x24')]);if(_0x40f555[_0x54a3('0x25')]){delete _0x40f555[_0x54a3('0x25')];}_0x225baa['status'](_0x2c16a8)[_0x54a3('0x26')](_0x40f555);};}exports[_0x54a3('0x27')]=function(_0x1b7d14,_0x2c5d38){var _0x39ec67={},_0x490728={},_0x2d6cb9={'count':0x0,'rows':[]};var _0x226356=_['map'](db[_0x54a3('0x28')]['rawAttributes'],function(_0x39a25d){return{'name':_0x39a25d[_0x54a3('0x29')],'type':_0x39a25d[_0x54a3('0x2a')][_0x54a3('0x2b')]};});_0x490728[_0x54a3('0x2c')]=_[_0x54a3('0x2d')](_0x226356,'name');_0x490728[_0x54a3('0x2e')]=_[_0x54a3('0x2f')](_0x1b7d14[_0x54a3('0x2e')]);_0x490728[_0x54a3('0x30')]=_[_0x54a3('0x31')](_0x490728[_0x54a3('0x2c')],_0x490728[_0x54a3('0x2e')]);_0x39ec67[_0x54a3('0x32')]=_[_0x54a3('0x31')](_0x490728[_0x54a3('0x2c')],qs['fields'](_0x1b7d14[_0x54a3('0x2e')][_0x54a3('0x33')]));_0x39ec67[_0x54a3('0x32')]=_0x39ec67[_0x54a3('0x32')]['length']?_0x39ec67[_0x54a3('0x32')]:_0x490728[_0x54a3('0x2c')];if(!_0x1b7d14[_0x54a3('0x2e')][_0x54a3('0x34')](_0x54a3('0x35'))){_0x39ec67[_0x54a3('0x1a')]=qs['limit'](_0x1b7d14[_0x54a3('0x2e')][_0x54a3('0x1a')]);_0x39ec67[_0x54a3('0x19')]=qs[_0x54a3('0x19')](_0x1b7d14[_0x54a3('0x2e')][_0x54a3('0x19')]);}_0x39ec67[_0x54a3('0x36')]=qs['sort'](_0x1b7d14[_0x54a3('0x2e')][_0x54a3('0x37')]);_0x39ec67[_0x54a3('0x38')]=qs[_0x54a3('0x30')](_[_0x54a3('0x39')](_0x1b7d14[_0x54a3('0x2e')],_0x490728[_0x54a3('0x30')]),_0x226356);if(_0x1b7d14['query'][_0x54a3('0x3a')]){_0x39ec67['where']=_[_0x54a3('0x3b')](_0x39ec67[_0x54a3('0x38')],{'$or':_[_0x54a3('0x2d')](_0x226356,function(_0x5486de){if(_0x5486de['type']!==_0x54a3('0x3c')){var _0x323ed5={};_0x323ed5[_0x5486de[_0x54a3('0x25')]]={'$like':'%'+_0x1b7d14['query'][_0x54a3('0x3a')]+'%'};return _0x323ed5;}})});}_0x39ec67=_[_0x54a3('0x3b')]({},_0x39ec67,_0x1b7d14[_0x54a3('0x3d')]);var _0x281f8c={'where':_0x39ec67['where']};return db['SquareDetailsReport'][_0x54a3('0x1b')](_0x281f8c)['then'](function(_0x2fdaed){_0x2d6cb9['count']=_0x2fdaed;if(_0x1b7d14[_0x54a3('0x2e')][_0x54a3('0x3e')]){_0x39ec67[_0x54a3('0x3f')]=[{'all':!![]}];}return db[_0x54a3('0x28')][_0x54a3('0x40')](_0x39ec67);})[_0x54a3('0x21')](function(_0x4865ab){_0x2d6cb9[_0x54a3('0x41')]=_0x4865ab;return _0x2d6cb9;})[_0x54a3('0x21')](respondWithFilteredResult(_0x2c5d38,_0x39ec67))[_0x54a3('0x42')](handleError(_0x2c5d38,null));};exports[_0x54a3('0x43')]=function(_0x3ad883,_0x3e375a){var _0x1a6b8e={'raw':!![],'where':{'id':_0x3ad883[_0x54a3('0x44')]['id']}},_0x4cbe1a={};_0x4cbe1a['model']=_[_0x54a3('0x2f')](db[_0x54a3('0x28')][_0x54a3('0x45')]);_0x4cbe1a[_0x54a3('0x2e')]=_[_0x54a3('0x2f')](_0x3ad883[_0x54a3('0x2e')]);_0x4cbe1a['filters']=_[_0x54a3('0x31')](_0x4cbe1a[_0x54a3('0x2c')],_0x4cbe1a['query']);_0x1a6b8e[_0x54a3('0x32')]=_['intersection'](_0x4cbe1a[_0x54a3('0x2c')],qs[_0x54a3('0x33')](_0x3ad883[_0x54a3('0x2e')][_0x54a3('0x33')]));_0x1a6b8e['attributes']=_0x1a6b8e['attributes'][_0x54a3('0x46')]?_0x1a6b8e[_0x54a3('0x32')]:_0x4cbe1a[_0x54a3('0x2c')];if(_0x3ad883[_0x54a3('0x2e')][_0x54a3('0x3e')]){_0x1a6b8e[_0x54a3('0x3f')]=[{'all':!![]}];}_0x1a6b8e=_[_0x54a3('0x3b')]({},_0x1a6b8e,_0x3ad883[_0x54a3('0x3d')]);return db['SquareDetailsReport'][_0x54a3('0x47')](_0x1a6b8e)[_0x54a3('0x21')](handleEntityNotFound(_0x3e375a,null))[_0x54a3('0x21')](respondWithResult(_0x3e375a,null))[_0x54a3('0x42')](handleError(_0x3e375a,null));};exports['create']=function(_0x1af318,_0x492310){return db['SquareDetailsReport'][_0x54a3('0x48')](_0x1af318['body'],{})[_0x54a3('0x21')](respondWithResult(_0x492310,0xc9))['catch'](handleError(_0x492310,null));};exports[_0x54a3('0x49')]=function(_0xd338dc,_0x463d46){if(_0xd338dc[_0x54a3('0x4a')]['id']){delete _0xd338dc[_0x54a3('0x4a')]['id'];}return db[_0x54a3('0x28')][_0x54a3('0x47')]({'where':{'id':_0xd338dc[_0x54a3('0x44')]['id']}})['then'](handleEntityNotFound(_0x463d46,null))['then'](saveUpdates(_0xd338dc[_0x54a3('0x4a')],null))[_0x54a3('0x21')](respondWithResult(_0x463d46,null))['catch'](handleError(_0x463d46,null));};exports['destroy']=function(_0x420310,_0x27877c){return db['SquareDetailsReport']['find']({'where':{'id':_0x420310[_0x54a3('0x44')]['id']}})[_0x54a3('0x21')](handleEntityNotFound(_0x27877c,null))[_0x54a3('0x21')](removeEntity(_0x27877c,null))[_0x54a3('0x42')](handleError(_0x27877c,null));};exports[_0x54a3('0x4b')]=function(_0x234739,_0x1cbc27){return db[_0x54a3('0x28')][_0x54a3('0x4b')]()[_0x54a3('0x21')](respondWithResult(_0x1cbc27,null))[_0x54a3('0x42')](handleError(_0x1cbc27,null));}; \ No newline at end of file +var _0x15b0=['undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','lodash','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset'];(function(_0x4a71b4,_0x3a4e06){var _0x202ce2=function(_0x4e74c8){while(--_0x4e74c8){_0x4a71b4['push'](_0x4a71b4['shift']());}};_0x202ce2(++_0x3a4e06);}(_0x15b0,0x146));var _0x015b=function(_0x40244d,_0x54cfeb){_0x40244d=_0x40244d-0x0;var _0x28917f=_0x15b0[_0x40244d];return _0x28917f;};'use strict';var emlformat=require(_0x015b('0x0'));var rimraf=require(_0x015b('0x1'));var zipdir=require(_0x015b('0x2'));var jsonpatch=require(_0x015b('0x3'));var rp=require('request-promise');var moment=require(_0x015b('0x4'));var BPromise=require(_0x015b('0x5'));var Mustache=require(_0x015b('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x015b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x015b('0x8'));var squel=require(_0x015b('0x9'));var crypto=require('crypto');var jsforce=require(_0x015b('0xa'));var deskjs=require(_0x015b('0xb'));var toCsv=require(_0x015b('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x015b('0xc'));var qs=require(_0x015b('0xd'));var as=require(_0x015b('0xe'));var hardwareService=require(_0x015b('0xf'));var logger=require(_0x015b('0x10'))(_0x015b('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x015b('0x12'));var db=require(_0x015b('0x13'))['db'];function respondWithStatusCode(_0xc9bd83,_0x113f13){_0x113f13=_0x113f13||0xcc;return function(_0x5349f1){if(_0x5349f1){return _0xc9bd83['sendStatus'](_0x113f13);}return _0xc9bd83[_0x015b('0x14')](_0x113f13)[_0x015b('0x15')]();};}function respondWithResult(_0x5c0303,_0x535ede){_0x535ede=_0x535ede||0xc8;return function(_0x53718e){if(_0x53718e){return _0x5c0303[_0x015b('0x14')](_0x535ede)[_0x015b('0x16')](_0x53718e);}};}function respondWithFilteredResult(_0x2e721a,_0x2b07fd){return function(_0x35d7b6){if(_0x35d7b6){var _0xb1dbdd=typeof _0x2b07fd[_0x015b('0x17')]===_0x015b('0x18')&&typeof _0x2b07fd[_0x015b('0x19')]===_0x015b('0x18');var _0x4e1eca=_0x35d7b6['count'];var _0x3d1ea1=_0xb1dbdd?0x0:_0x2b07fd[_0x015b('0x17')];var _0x267325=_0xb1dbdd?_0x35d7b6[_0x015b('0x1a')]:_0x2b07fd[_0x015b('0x17')]+_0x2b07fd[_0x015b('0x19')];var _0x56ef06;if(_0x267325>=_0x4e1eca){_0x267325=_0x4e1eca;_0x56ef06=0xc8;}else{_0x56ef06=0xce;}_0x2e721a[_0x015b('0x14')](_0x56ef06);return _0x2e721a[_0x015b('0x1b')](_0x015b('0x1c'),_0x3d1ea1+'-'+_0x267325+'/'+_0x4e1eca)[_0x015b('0x16')](_0x35d7b6);}return null;};}function patchUpdates(_0x4d6334){return function(_0xc86756){try{jsonpatch[_0x015b('0x1d')](_0xc86756,_0x4d6334,!![]);}catch(_0x208fac){return BPromise[_0x015b('0x1e')](_0x208fac);}return _0xc86756[_0x015b('0x1f')]();};}function saveUpdates(_0x1b3061,_0x4e7631){return function(_0x4bfbf4){if(_0x4bfbf4){return _0x4bfbf4[_0x015b('0x20')](_0x1b3061)[_0x015b('0x21')](function(_0x3f76c5){return _0x3f76c5;});}return null;};}function removeEntity(_0x149f8a,_0x4ada75){return function(_0x48fa0e){if(_0x48fa0e){return _0x48fa0e[_0x015b('0x22')]()['then'](function(){_0x149f8a[_0x015b('0x14')](0xcc)[_0x015b('0x15')]();});}};}function handleEntityNotFound(_0x34742f,_0x59bda0){return function(_0x3dc70f){if(!_0x3dc70f){_0x34742f['sendStatus'](0x194);}return _0x3dc70f;};}function handleError(_0x2b283d,_0x2f6ce5){_0x2f6ce5=_0x2f6ce5||0x1f4;return function(_0x3c3dfc){logger['error'](_0x3c3dfc[_0x015b('0x23')]);if(_0x3c3dfc['name']){delete _0x3c3dfc[_0x015b('0x24')];}_0x2b283d[_0x015b('0x14')](_0x2f6ce5)[_0x015b('0x25')](_0x3c3dfc);};}exports[_0x015b('0x26')]=function(_0x4a9dde,_0x3d3690){var _0x4f5109={},_0xc091d5={},_0x190013={'count':0x0,'rows':[]};var _0x5bd262=_[_0x015b('0x27')](db[_0x015b('0x28')][_0x015b('0x29')],function(_0x23a304){return{'name':_0x23a304['fieldName'],'type':_0x23a304[_0x015b('0x2a')]['key']};});_0xc091d5[_0x015b('0x2b')]=_[_0x015b('0x27')](_0x5bd262,_0x015b('0x24'));_0xc091d5[_0x015b('0x2c')]=_[_0x015b('0x2d')](_0x4a9dde[_0x015b('0x2c')]);_0xc091d5[_0x015b('0x2e')]=_[_0x015b('0x2f')](_0xc091d5[_0x015b('0x2b')],_0xc091d5[_0x015b('0x2c')]);_0x4f5109[_0x015b('0x30')]=_[_0x015b('0x2f')](_0xc091d5[_0x015b('0x2b')],qs[_0x015b('0x31')](_0x4a9dde['query'][_0x015b('0x31')]));_0x4f5109[_0x015b('0x30')]=_0x4f5109['attributes']['length']?_0x4f5109['attributes']:_0xc091d5[_0x015b('0x2b')];if(!_0x4a9dde[_0x015b('0x2c')]['hasOwnProperty'](_0x015b('0x32'))){_0x4f5109[_0x015b('0x19')]=qs[_0x015b('0x19')](_0x4a9dde[_0x015b('0x2c')][_0x015b('0x19')]);_0x4f5109['offset']=qs[_0x015b('0x17')](_0x4a9dde['query'][_0x015b('0x17')]);}_0x4f5109[_0x015b('0x33')]=qs['sort'](_0x4a9dde[_0x015b('0x2c')][_0x015b('0x34')]);_0x4f5109[_0x015b('0x35')]=qs[_0x015b('0x2e')](_[_0x015b('0x36')](_0x4a9dde[_0x015b('0x2c')],_0xc091d5[_0x015b('0x2e')]),_0x5bd262);if(_0x4a9dde[_0x015b('0x2c')][_0x015b('0x37')]){_0x4f5109[_0x015b('0x35')]=_['merge'](_0x4f5109['where'],{'$or':_[_0x015b('0x27')](_0x5bd262,function(_0x3e84c5){if(_0x3e84c5['type']!=='VIRTUAL'){var _0x42f187={};_0x42f187[_0x3e84c5[_0x015b('0x24')]]={'$like':'%'+_0x4a9dde[_0x015b('0x2c')]['filter']+'%'};return _0x42f187;}})});}_0x4f5109=_[_0x015b('0x38')]({},_0x4f5109,_0x4a9dde[_0x015b('0x39')]);var _0x48c954={'where':_0x4f5109[_0x015b('0x35')]};return db[_0x015b('0x28')][_0x015b('0x1a')](_0x48c954)[_0x015b('0x21')](function(_0x1fad7a){_0x190013[_0x015b('0x1a')]=_0x1fad7a;if(_0x4a9dde[_0x015b('0x2c')][_0x015b('0x3a')]){_0x4f5109['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x015b('0x3b')](_0x4f5109);})['then'](function(_0xe7489a){_0x190013[_0x015b('0x3c')]=_0xe7489a;return _0x190013;})[_0x015b('0x21')](respondWithFilteredResult(_0x3d3690,_0x4f5109))[_0x015b('0x3d')](handleError(_0x3d3690,null));};exports[_0x015b('0x3e')]=function(_0x898cb1,_0x380d0e){var _0x398056={'raw':!![],'where':{'id':_0x898cb1[_0x015b('0x3f')]['id']}},_0x410d21={};_0x410d21['model']=_[_0x015b('0x2d')](db[_0x015b('0x28')]['rawAttributes']);_0x410d21['query']=_[_0x015b('0x2d')](_0x898cb1[_0x015b('0x2c')]);_0x410d21['filters']=_['intersection'](_0x410d21[_0x015b('0x2b')],_0x410d21[_0x015b('0x2c')]);_0x398056[_0x015b('0x30')]=_['intersection'](_0x410d21['model'],qs[_0x015b('0x31')](_0x898cb1['query'][_0x015b('0x31')]));_0x398056['attributes']=_0x398056['attributes'][_0x015b('0x40')]?_0x398056[_0x015b('0x30')]:_0x410d21[_0x015b('0x2b')];if(_0x898cb1[_0x015b('0x2c')][_0x015b('0x3a')]){_0x398056[_0x015b('0x41')]=[{'all':!![]}];}_0x398056=_[_0x015b('0x38')]({},_0x398056,_0x898cb1[_0x015b('0x39')]);return db['SquareDetailsReport'][_0x015b('0x42')](_0x398056)[_0x015b('0x21')](handleEntityNotFound(_0x380d0e,null))[_0x015b('0x21')](respondWithResult(_0x380d0e,null))['catch'](handleError(_0x380d0e,null));};exports[_0x015b('0x43')]=function(_0x4fb6ba,_0x1ba55b){return db['SquareDetailsReport'][_0x015b('0x43')](_0x4fb6ba[_0x015b('0x44')],{})[_0x015b('0x21')](respondWithResult(_0x1ba55b,0xc9))['catch'](handleError(_0x1ba55b,null));};exports[_0x015b('0x20')]=function(_0x15c0f5,_0x3b9b58){if(_0x15c0f5[_0x015b('0x44')]['id']){delete _0x15c0f5[_0x015b('0x44')]['id'];}return db[_0x015b('0x28')][_0x015b('0x42')]({'where':{'id':_0x15c0f5[_0x015b('0x3f')]['id']}})[_0x015b('0x21')](handleEntityNotFound(_0x3b9b58,null))['then'](saveUpdates(_0x15c0f5[_0x015b('0x44')],null))[_0x015b('0x21')](respondWithResult(_0x3b9b58,null))[_0x015b('0x3d')](handleError(_0x3b9b58,null));};exports[_0x015b('0x22')]=function(_0xb436ce,_0x38f27e){return db[_0x015b('0x28')][_0x015b('0x42')]({'where':{'id':_0xb436ce[_0x015b('0x3f')]['id']}})['then'](handleEntityNotFound(_0x38f27e,null))[_0x015b('0x21')](removeEntity(_0x38f27e,null))[_0x015b('0x3d')](handleError(_0x38f27e,null));};exports[_0x015b('0x45')]=function(_0x44af12,_0x38abbe){return db[_0x015b('0x28')][_0x015b('0x45')]()[_0x015b('0x21')](respondWithResult(_0x38abbe,null))[_0x015b('0x3d')](handleError(_0x38abbe,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index d66f7ec..71cf0d3 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 _0x0e86=['report_square_details','api','moment','bluebird','path','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport'];(function(_0x438226,_0x571b26){var _0x3c2ef3=function(_0x3ede1a){while(--_0x3ede1a){_0x438226['push'](_0x438226['shift']());}};_0x3c2ef3(++_0x571b26);}(_0x0e86,0x133));var _0x60e8=function(_0x3ea5e1,_0x17c486){_0x3ea5e1=_0x3ea5e1-0x0;var _0x1b81d7=_0x0e86[_0x3ea5e1];return _0x1b81d7;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x60e8('0x0'));var moment=require(_0x60e8('0x1'));var BPromise=require(_0x60e8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x60e8('0x3'));var rimraf=require('rimraf');var config=require(_0x60e8('0x4'));var attributes=require(_0x60e8('0x5'));module[_0x60e8('0x6')]=function(_0xb31939,_0x44d59d){return _0xb31939['define'](_0x60e8('0x7'),attributes,{'tableName':_0x60e8('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3228=['exports','define','report_square_details','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes'];(function(_0x246115,_0x398123){var _0x385878=function(_0x534a9c){while(--_0x534a9c){_0x246115['push'](_0x246115['shift']());}};_0x385878(++_0x398123);}(_0x3228,0x9f));var _0x8322=function(_0x4ced8e,_0x55d00e){_0x4ced8e=_0x4ced8e-0x0;var _0x41a988=_0x3228[_0x4ced8e];return _0x41a988;};'use strict';var _=require('lodash');var util=require(_0x8322('0x0'));var logger=require(_0x8322('0x1'))(_0x8322('0x2'));var moment=require(_0x8322('0x3'));var BPromise=require(_0x8322('0x4'));var rp=require(_0x8322('0x5'));var fs=require('fs');var path=require(_0x8322('0x6'));var rimraf=require(_0x8322('0x7'));var config=require(_0x8322('0x8'));var attributes=require(_0x8322('0x9'));module[_0x8322('0xa')]=function(_0x5e2991,_0x339610){return _0x5e2991[_0x8322('0xb')]('SquareDetailsReport',attributes,{'tableName':_0x8322('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 0714380..7afff80 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 _0x9861=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','stringify','lodash','bluebird','randomstring','ioredis'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x9861,0x176));var _0x1986=function(_0x8f052e,_0x5c0752){_0x8f052e=_0x8f052e-0x0;var _0xbc9ad6=_0x9861[_0x8f052e];return _0xbc9ad6;};'use strict';var _=require(_0x1986('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1986('0x1'));var rs=require(_0x1986('0x2'));var fs=require('fs');var Redis=require(_0x1986('0x3'));var db=require(_0x1986('0x4'))['db'];var utils=require(_0x1986('0x5'));var logger=require(_0x1986('0x6'))('rpc');var config=require(_0x1986('0x7'));var jayson=require(_0x1986('0x8'));var client=jayson[_0x1986('0x9')][_0x1986('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40a16f,_0xc5e066,_0x412444){return new BPromise(function(_0x4150da,_0x2bd40f){return client[_0x1986('0xb')](_0x40a16f,_0x412444)['then'](function(_0x14f7b4){logger[_0x1986('0xc')](_0x1986('0xd'),_0xc5e066,_0x1986('0xe'));logger['debug'](_0x1986('0xf'),_0xc5e066,_0x1986('0xe'),JSON['stringify'](_0x14f7b4));if(_0x14f7b4[_0x1986('0x10')]){if(_0x14f7b4['error']['code']===0x1f4){logger[_0x1986('0x10')](_0x1986('0xd'),_0xc5e066,_0x14f7b4[_0x1986('0x10')][_0x1986('0x11')]);return _0x2bd40f(_0x14f7b4[_0x1986('0x10')][_0x1986('0x11')]);}logger[_0x1986('0x10')](_0x1986('0xd'),_0xc5e066,_0x14f7b4[_0x1986('0x10')][_0x1986('0x11')]);return _0x4150da(_0x14f7b4['error']['message']);}else{logger[_0x1986('0xc')](_0x1986('0xd'),_0xc5e066,'request\x20sent');_0x4150da(_0x14f7b4[_0x1986('0x12')][_0x1986('0x11')]);}})[_0x1986('0x13')](function(_0x462f14){logger[_0x1986('0x10')](_0x1986('0xd'),_0xc5e066,_0x462f14);_0x2bd40f(_0x462f14);});});}exports[_0x1986('0x14')]=function(_0x15f7b9){var _0x3b2715=this;return new Promise(function(_0x7dec68,_0x257ab1){return db[_0x1986('0x15')][_0x1986('0x16')](_0x15f7b9[_0x1986('0x17')],{'raw':_0x15f7b9['options']?_0x15f7b9[_0x1986('0x18')][_0x1986('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3ab28e){logger[_0x1986('0xc')]('CreateSquareDetailsReport',_0x15f7b9);logger['debug'](_0x1986('0x14'),_0x15f7b9,JSON[_0x1986('0x1a')](_0x3ab28e));_0x7dec68(_0x3ab28e);})[_0x1986('0x13')](function(_0x530aa1){logger[_0x1986('0x10')](_0x1986('0x14'),_0x530aa1[_0x1986('0x11')],_0x15f7b9);_0x257ab1(_0x3b2715['error'](0x1f4,_0x530aa1[_0x1986('0x11')]));});});}; \ No newline at end of file +var _0x4bde=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareDetailsReport,\x20%s,\x20%s','message','info','result','catch','CreateSquareDetailsReport','SquareDetailsReport','options','raw','stringify','lodash','util'];(function(_0x4bf27a,_0x435cc2){var _0x22a0ba=function(_0x4b442e){while(--_0x4b442e){_0x4bf27a['push'](_0x4bf27a['shift']());}};_0x22a0ba(++_0x435cc2);}(_0x4bde,0x1b1));var _0xe4bd=function(_0x3308fa,_0x1b7c4a){_0x3308fa=_0x3308fa-0x0;var _0x148fbc=_0x4bde[_0x3308fa];return _0x148fbc;};'use strict';var _=require(_0xe4bd('0x0'));var util=require(_0xe4bd('0x1'));var moment=require(_0xe4bd('0x2'));var BPromise=require('bluebird');var rs=require(_0xe4bd('0x3'));var fs=require('fs');var Redis=require(_0xe4bd('0x4'));var db=require(_0xe4bd('0x5'))['db'];var utils=require(_0xe4bd('0x6'));var logger=require('../../config/logger')(_0xe4bd('0x7'));var config=require(_0xe4bd('0x8'));var jayson=require(_0xe4bd('0x9'));var client=jayson[_0xe4bd('0xa')][_0xe4bd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4008eb,_0x4c933b,_0x2cf33d){return new BPromise(function(_0xbd04ce,_0x262295){return client[_0xe4bd('0xc')](_0x4008eb,_0x2cf33d)[_0xe4bd('0xd')](function(_0x3ef7e7){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x4c933b,'request\x20sent');logger[_0xe4bd('0xe')](_0xe4bd('0xf'),_0x4c933b,_0xe4bd('0x10'),JSON['stringify'](_0x3ef7e7));if(_0x3ef7e7[_0xe4bd('0x11')]){if(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x12')]===0x1f4){logger[_0xe4bd('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')]['message']);return _0x262295(_0x3ef7e7[_0xe4bd('0x11')]['message']);}logger[_0xe4bd('0x11')](_0xe4bd('0x13'),_0x4c933b,_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);return _0xbd04ce(_0x3ef7e7[_0xe4bd('0x11')][_0xe4bd('0x14')]);}else{logger[_0xe4bd('0x15')](_0xe4bd('0x13'),_0x4c933b,_0xe4bd('0x10'));_0xbd04ce(_0x3ef7e7[_0xe4bd('0x16')][_0xe4bd('0x14')]);}})[_0xe4bd('0x17')](function(_0x470cd1){logger['error'](_0xe4bd('0x13'),_0x4c933b,_0x470cd1);_0x262295(_0x470cd1);});});}exports[_0xe4bd('0x18')]=function(_0x5982f4){var _0x1731a1=this;return new Promise(function(_0x3dccd4,_0x544b3c){return db[_0xe4bd('0x19')]['create'](_0x5982f4['body'],{'raw':_0x5982f4[_0xe4bd('0x1a')]?_0x5982f4[_0xe4bd('0x1a')][_0xe4bd('0x1b')]===undefined?!![]:![]:!![]})[_0xe4bd('0xd')](function(_0x10a234){logger[_0xe4bd('0x15')](_0xe4bd('0x18'),_0x5982f4);logger['debug'](_0xe4bd('0x18'),_0x5982f4,JSON[_0xe4bd('0x1c')](_0x10a234));_0x3dccd4(_0x10a234);})['catch'](function(_0x2a5f40){logger[_0xe4bd('0x11')](_0xe4bd('0x18'),_0x2a5f40[_0xe4bd('0x14')],_0x5982f4);_0x544b3c(_0x1731a1[_0xe4bd('0x11')](0x1f4,_0x2a5f40[_0xe4bd('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 44589cb..576d2bb 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 _0x957a=['get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','./system.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x957a,0xba));var _0xa957=function(_0x3b05e7,_0x397457){_0x3b05e7=_0x3b05e7-0x0;var _0x18a62a=_0x957a[_0x3b05e7];return _0x18a62a;};'use strict';var express=require(_0xa957('0x0'));var router=express[_0xa957('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xa957('0x2'));router[_0xa957('0x3')]('/',auth[_0xa957('0x4')](),controller[_0xa957('0x5')]);router[_0xa957('0x3')](_0xa957('0x6'),auth['isAuthenticated'](),controller[_0xa957('0x7')]);module[_0xa957('0x8')]=router; \ No newline at end of file +var _0xb7ff=['../../components/auth/service','./system.controller','get','isAuthenticated','index','/process/:pid/kill','exports','express'];(function(_0x5e5b6c,_0x3cef7b){var _0x21ac4f=function(_0x3520e7){while(--_0x3520e7){_0x5e5b6c['push'](_0x5e5b6c['shift']());}};_0x21ac4f(++_0x3cef7b);}(_0xb7ff,0x1d7));var _0xfb7f=function(_0xd51ad,_0xb8a953){_0xd51ad=_0xd51ad-0x0;var _0x53c197=_0xb7ff[_0xd51ad];return _0x53c197;};'use strict';var express=require(_0xfb7f('0x0'));var router=express['Router']();var auth=require(_0xfb7f('0x1'));var controller=require(_0xfb7f('0x2'));router[_0xfb7f('0x3')]('/',auth[_0xfb7f('0x4')](),controller[_0xfb7f('0x5')]);router['get'](_0xfb7f('0x6'),auth['isAuthenticated'](),controller['killProcess']);module[_0xfb7f('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 9e947c7..df8bffb 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 _0x9a0d=['indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','then','json','catch','killProcess','components/import/cm','format','pid','split','length'];(function(_0x1ca225,_0x393172){var _0x570fea=function(_0x366243){while(--_0x366243){_0x1ca225['push'](_0x1ca225['shift']());}};_0x570fea(++_0x393172);}(_0x9a0d,0x11e));var _0xd9a0=function(_0x324012,_0x23f45f){_0x324012=_0x324012-0x0;var _0x435cf2=_0x9a0d[_0x324012];return _0x435cf2;};'use strict';var info=require(_0xd9a0('0x0'));var exec=require(_0xd9a0('0x1'))[_0xd9a0('0x2')];var logger=require(_0xd9a0('0x3'))(_0xd9a0('0x4'));var util=require('util');var BPromise=require(_0xd9a0('0x5'));var _=require(_0xd9a0('0x6'));function handleError(_0x5124fe,_0x22bc40,_0x2d0084){_0x22bc40=_0x22bc40||0x1f4;return function(_0x4ef00b){logger[_0xd9a0('0x7')](_0xd9a0('0x8'),_0x2d0084,_0x22bc40,util[_0xd9a0('0x9')](_0x4ef00b,{'showHidden':![],'depth':null}));delete _0x4ef00b[_0xd9a0('0xa')];_0x5124fe['status'](_0x22bc40)[_0xd9a0('0xb')](_0x4ef00b);};}exports[_0xd9a0('0xc')]=function(_0x266029,_0x518385){return info['getAllData']()[_0xd9a0('0xd')](function(_0x522bf6){return _0x518385['status'](0xc8)[_0xd9a0('0xe')](_0x522bf6);})[_0xd9a0('0xf')](function(_0x6248ec){return _0x518385['status'](0x1f4)[_0xd9a0('0xe')](_0x6248ec);});};exports[_0xd9a0('0x10')]=function(_0x3fe6f1,_0xd14004){var _0x2d6b9c=[_0xd9a0('0x11')];return new BPromise(function(_0x1ada8b,_0x24b320){return exec(util[_0xd9a0('0x12')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x3fe6f1['params'][_0xd9a0('0x13')]),function(_0x3a57df,_0x56899b,_0x27f5e3){if(_0x3a57df){return _0x24b320(_0x3a57df);}return _0x1ada8b(_0x56899b);});})[_0xd9a0('0xd')](function(_0x21aef8){var _0x37036b=![];var _0x23bdb7=_0x21aef8[_0xd9a0('0x14')](/\n/);for(var _0xaaa0fe=0x0,_0x4b1213=_0x2d6b9c[_0xd9a0('0x15')];_0xaaa0fe<_0x4b1213,_0x37036b===![];_0xaaa0fe+=0x1){if(_0x21aef8[_0xd9a0('0x16')](_0x2d6b9c[_0xaaa0fe])>=0x0){_0x37036b=!![];}}if(!_0x37036b){throw new Error(util['format'](_0xd9a0('0x17'),_0x3fe6f1[_0xd9a0('0x18')][_0xd9a0('0x13')]));}process[_0xd9a0('0x19')](_0x3fe6f1[_0xd9a0('0x18')]['pid'],_0xd9a0('0x1a'));return _0xd14004['status'](0xc8)[_0xd9a0('0xe')]({'message':util[_0xd9a0('0x12')](_0xd9a0('0x1b'),_0x3fe6f1[_0xd9a0('0x18')][_0xd9a0('0x13')])});})[_0xd9a0('0xf')](handleError(_0xd14004,null,_0xd9a0('0x10')));}; \ No newline at end of file +var _0x300c=['systeminformation','exec','../../config/logger','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x251ae7,_0xa8af83){var _0x38aed7=function(_0x1518c9){while(--_0x1518c9){_0x251ae7['push'](_0x251ae7['shift']());}};_0x38aed7(++_0xa8af83);}(_0x300c,0x1b0));var _0xc300=function(_0x543c3a,_0x239efb){_0x543c3a=_0x543c3a-0x0;var _0x19108e=_0x300c[_0x543c3a];return _0x19108e;};'use strict';var info=require(_0xc300('0x0'));var exec=require('child_process')[_0xc300('0x1')];var logger=require(_0xc300('0x2'))('api');var util=require(_0xc300('0x3'));var BPromise=require(_0xc300('0x4'));var _=require(_0xc300('0x5'));function handleError(_0x45babe,_0x4affd8,_0x31b899){_0x4affd8=_0x4affd8||0x1f4;return function(_0x48a44b){logger[_0xc300('0x6')](_0xc300('0x7'),_0x31b899,_0x4affd8,util[_0xc300('0x8')](_0x48a44b,{'showHidden':![],'depth':null}));delete _0x48a44b['name'];_0x45babe[_0xc300('0x9')](_0x4affd8)['send'](_0x48a44b);};}exports[_0xc300('0xa')]=function(_0x4cf368,_0x55e4f7){return info[_0xc300('0xb')]()[_0xc300('0xc')](function(_0x50c457){return _0x55e4f7[_0xc300('0x9')](0xc8)[_0xc300('0xd')](_0x50c457);})[_0xc300('0xe')](function(_0x3476ac){return _0x55e4f7['status'](0x1f4)[_0xc300('0xd')](_0x3476ac);});};exports[_0xc300('0xf')]=function(_0x4f52d8,_0x571ddd){var _0x3369c6=[_0xc300('0x10')];return new BPromise(function(_0x16b422,_0x2b1787){return exec(util[_0xc300('0x11')](_0xc300('0x12'),_0x4f52d8['params'][_0xc300('0x13')]),function(_0x1cf5d9,_0x3d0954,_0x3282f4){if(_0x1cf5d9){return _0x2b1787(_0x1cf5d9);}return _0x16b422(_0x3d0954);});})['then'](function(_0x4a41b3){var _0x8cad57=![];var _0x5e1dfe=_0x4a41b3[_0xc300('0x14')](/\n/);for(var _0x4fee30=0x0,_0x125e53=_0x3369c6[_0xc300('0x15')];_0x4fee30<_0x125e53,_0x8cad57===![];_0x4fee30+=0x1){if(_0x4a41b3[_0xc300('0x16')](_0x3369c6[_0x4fee30])>=0x0){_0x8cad57=!![];}}if(!_0x8cad57){throw new Error(util[_0xc300('0x11')](_0xc300('0x17'),_0x4f52d8['params']['pid']));}process['kill'](_0x4f52d8[_0xc300('0x18')][_0xc300('0x13')],_0xc300('0x19'));return _0x571ddd[_0xc300('0x9')](0xc8)['json']({'message':util[_0xc300('0x11')](_0xc300('0x1a'),_0x4f52d8[_0xc300('0x18')]['pid'])});})['catch'](handleError(_0x571ddd,null,_0xc300('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 492e96b..3a46b81 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 _0x22fb=['./tag.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x7e82fc,_0x2e580e){var _0x13ae7c=function(_0x123a4d){while(--_0x123a4d){_0x7e82fc['push'](_0x7e82fc['shift']());}};_0x13ae7c(++_0x2e580e);}(_0x22fb,0x192));var _0xb22f=function(_0x4443b2,_0x14d189){_0x4443b2=_0x4443b2-0x0;var _0x1f3ad7=_0x22fb[_0x4443b2];return _0x1f3ad7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb22f('0x0'));var timeout=require('connect-timeout');var express=require(_0xb22f('0x1'));var router=express[_0xb22f('0x2')]();var fs_extra=require(_0xb22f('0x3'));var auth=require(_0xb22f('0x4'));var interaction=require(_0xb22f('0x5'));var config=require('../../config/environment');var controller=require(_0xb22f('0x6'));router[_0xb22f('0x7')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0x9')]);router[_0xb22f('0x7')](_0xb22f('0xa'),auth['isAuthenticated'](),controller[_0xb22f('0xb')]);router[_0xb22f('0x7')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller[_0xb22f('0xd')]);router[_0xb22f('0xe')]('/',auth[_0xb22f('0x8')](),controller[_0xb22f('0xf')]);router[_0xb22f('0x10')](_0xb22f('0xc'),auth[_0xb22f('0x8')](),controller['update']);router['delete']('/:id',auth[_0xb22f('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xf3cd=['delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update'];(function(_0x484994,_0x5e054c){var _0x273643=function(_0x5f0113){while(--_0x5f0113){_0x484994['push'](_0x484994['shift']());}};_0x273643(++_0x5e054c);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x3da832,_0x2133f1){_0x3da832=_0x3da832-0x0;var _0xe602f2=_0xf3cd[_0x3da832];return _0xe602f2;};'use strict';var multer=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var path=require(_0xdf3c('0x2'));var timeout=require(_0xdf3c('0x3'));var express=require(_0xdf3c('0x4'));var router=express[_0xdf3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdf3c('0x6'));var interaction=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var controller=require('./tag.controller');router[_0xdf3c('0x9')]('/',auth[_0xdf3c('0xa')](),controller[_0xdf3c('0xb')]);router[_0xdf3c('0x9')](_0xdf3c('0xc'),auth[_0xdf3c('0xa')](),controller['describe']);router[_0xdf3c('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xdf3c('0xd')]);router[_0xdf3c('0xe')]('/',auth['isAuthenticated'](),controller[_0xdf3c('0xf')]);router[_0xdf3c('0x10')](_0xdf3c('0x11'),auth[_0xdf3c('0xa')](),controller[_0xdf3c('0x12')]);router[_0xdf3c('0x13')](_0xdf3c('0x11'),auth[_0xdf3c('0xa')](),controller['destroy']);module[_0xdf3c('0x14')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index ff230df..9ff4281 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 _0x0f42=['exports','STRING','name','#0091EA','sequelize'];(function(_0x118ef2,_0x582094){var _0x2e55e9=function(_0x14919f){while(--_0x14919f){_0x118ef2['push'](_0x118ef2['shift']());}};_0x2e55e9(++_0x582094);}(_0x0f42,0x126));var _0x20f4=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x0f42[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require(_0x20f4('0x0'));module[_0x20f4('0x1')]={'name':{'type':Sequelize[_0x20f4('0x2')],'unique':_0x20f4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x20f4('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['STRING','sequelize','exports','#0091EA'];(function(_0x5259f7,_0xdcdc61){var _0x11e597=function(_0x390f89){while(--_0x390f89){_0x5259f7['push'](_0x5259f7['shift']());}};_0x11e597(++_0xdcdc61);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x0d8b('0x2')},'description':{'type':Sequelize[_0x0d8b('0x3')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index da6e290..000c17f 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 _0xb2ad=['set','Content-Range','json','then','destroy','get','Tags','UserProfileResource','error','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','findAll','show','params','includeAll','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','limit','undefined','count','offset','status'];(function(_0x1e1aa9,_0x3ea152){var _0x30e4c6=function(_0x4060c2){while(--_0x4060c2){_0x1e1aa9['push'](_0x1e1aa9['shift']());}};_0x30e4c6(++_0x3ea152);}(_0xb2ad,0x16d));var _0xdb2a=function(_0x4f21da,_0x327008){_0x4f21da=_0x4f21da-0x0;var _0x2faf8f=_0xb2ad[_0x4f21da];return _0x2faf8f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb2a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdb2a('0x1'));var rp=require(_0xdb2a('0x2'));var moment=require(_0xdb2a('0x3'));var BPromise=require(_0xdb2a('0x4'));var Mustache=require(_0xdb2a('0x5'));var util=require('util');var path=require(_0xdb2a('0x6'));var sox=require(_0xdb2a('0x7'));var csv=require(_0xdb2a('0x8'));var ejs=require(_0xdb2a('0x9'));var fs=require('fs');var fs_extra=require(_0xdb2a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xdb2a('0xb'));var jsforce=require(_0xdb2a('0xc'));var deskjs=require(_0xdb2a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdb2a('0xe'));var Papa=require(_0xdb2a('0xf'));var Redis=require('ioredis');var authService=require(_0xdb2a('0x10'));var qs=require(_0xdb2a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xdb2a('0x12'))(_0xdb2a('0x13'));var utils=require(_0xdb2a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xdb2a('0x15'));var db=require(_0xdb2a('0x16'))['db'];function respondWithStatusCode(_0x5c6688,_0x5f4a7b){_0x5f4a7b=_0x5f4a7b||0xcc;return function(_0x4e1cda){if(_0x4e1cda){return _0x5c6688[_0xdb2a('0x17')](_0x5f4a7b);}return _0x5c6688['status'](_0x5f4a7b)[_0xdb2a('0x18')]();};}function respondWithResult(_0x3c3ac3,_0x527af2){_0x527af2=_0x527af2||0xc8;return function(_0x33045a){if(_0x33045a){return _0x3c3ac3['status'](_0x527af2)['json'](_0x33045a);}};}function respondWithFilteredResult(_0x5d8282,_0x5dbbb1){return function(_0x8a580e){if(_0x8a580e){var _0x2df1fd=typeof _0x5dbbb1['offset']==='undefined'&&typeof _0x5dbbb1[_0xdb2a('0x19')]===_0xdb2a('0x1a');var _0x440dab=_0x8a580e[_0xdb2a('0x1b')];var _0x52508d=_0x2df1fd?0x0:_0x5dbbb1[_0xdb2a('0x1c')];var _0x2de4cf=_0x2df1fd?_0x8a580e[_0xdb2a('0x1b')]:_0x5dbbb1['offset']+_0x5dbbb1['limit'];var _0x424583;if(_0x2de4cf>=_0x440dab){_0x2de4cf=_0x440dab;_0x424583=0xc8;}else{_0x424583=0xce;}_0x5d8282[_0xdb2a('0x1d')](_0x424583);return _0x5d8282[_0xdb2a('0x1e')](_0xdb2a('0x1f'),_0x52508d+'-'+_0x2de4cf+'/'+_0x440dab)[_0xdb2a('0x20')](_0x8a580e);}return null;};}function patchUpdates(_0x5e6a59){return function(_0x5c3824){try{jsonpatch['apply'](_0x5c3824,_0x5e6a59,!![]);}catch(_0x444fcf){return BPromise['reject'](_0x444fcf);}return _0x5c3824['save']();};}function saveUpdates(_0x1e6985,_0x449fba){return function(_0x46910c){if(_0x46910c){return _0x46910c['update'](_0x1e6985)[_0xdb2a('0x21')](function(_0x871b44){return _0x871b44;});}return null;};}function removeEntity(_0x16035f,_0x391378){return function(_0x1f3d54){if(_0x1f3d54){return _0x1f3d54[_0xdb2a('0x22')]()['then'](function(){var _0x37af87=_0x1f3d54[_0xdb2a('0x23')]({'plain':!![]});var _0x5f00fb=_0xdb2a('0x24');return db[_0xdb2a('0x25')][_0xdb2a('0x22')]({'where':{'type':_0x5f00fb,'resourceId':_0x37af87['id']}})[_0xdb2a('0x21')](function(){return _0x1f3d54;});})['then'](function(){_0x16035f[_0xdb2a('0x1d')](0xcc)[_0xdb2a('0x18')]();});}};}function handleEntityNotFound(_0x3439c1,_0x1cab2b){return function(_0x4ed637){if(!_0x4ed637){_0x3439c1[_0xdb2a('0x17')](0x194);}return _0x4ed637;};}function handleError(_0x46a80a,_0x4262cf){_0x4262cf=_0x4262cf||0x1f4;return function(_0x2b1c6d){logger[_0xdb2a('0x26')](_0x2b1c6d['stack']);if(_0x2b1c6d[_0xdb2a('0x27')]){delete _0x2b1c6d[_0xdb2a('0x27')];}_0x46a80a[_0xdb2a('0x1d')](_0x4262cf)[_0xdb2a('0x28')](_0x2b1c6d);};}exports[_0xdb2a('0x29')]=function(_0xd3a8a3,_0x134053){var _0x2b01e5={},_0x3c55cc={},_0x24b30a={'count':0x0,'rows':[]};var _0x39c5cc=_[_0xdb2a('0x2a')](db[_0xdb2a('0x2b')][_0xdb2a('0x2c')],function(_0x4d605b){return{'name':_0x4d605b[_0xdb2a('0x2d')],'type':_0x4d605b[_0xdb2a('0x2e')][_0xdb2a('0x2f')]};});_0x3c55cc[_0xdb2a('0x30')]=_[_0xdb2a('0x2a')](_0x39c5cc,'name');_0x3c55cc[_0xdb2a('0x31')]=_[_0xdb2a('0x32')](_0xd3a8a3[_0xdb2a('0x31')]);_0x3c55cc['filters']=_[_0xdb2a('0x33')](_0x3c55cc[_0xdb2a('0x30')],_0x3c55cc[_0xdb2a('0x31')]);_0x2b01e5[_0xdb2a('0x34')]=_[_0xdb2a('0x33')](_0x3c55cc[_0xdb2a('0x30')],qs[_0xdb2a('0x35')](_0xd3a8a3[_0xdb2a('0x31')][_0xdb2a('0x35')]));_0x2b01e5[_0xdb2a('0x34')]=_0x2b01e5[_0xdb2a('0x34')][_0xdb2a('0x36')]?_0x2b01e5[_0xdb2a('0x34')]:_0x3c55cc[_0xdb2a('0x30')];if(!_0xd3a8a3[_0xdb2a('0x31')]['hasOwnProperty'](_0xdb2a('0x37'))){_0x2b01e5['limit']=qs['limit'](_0xd3a8a3[_0xdb2a('0x31')][_0xdb2a('0x19')]);_0x2b01e5[_0xdb2a('0x1c')]=qs[_0xdb2a('0x1c')](_0xd3a8a3[_0xdb2a('0x31')]['offset']);}_0x2b01e5['order']=qs[_0xdb2a('0x38')](_0xd3a8a3['query']['sort']);_0x2b01e5[_0xdb2a('0x39')]=qs[_0xdb2a('0x3a')](_[_0xdb2a('0x3b')](_0xd3a8a3['query'],_0x3c55cc[_0xdb2a('0x3a')]),_0x39c5cc);if(_0xd3a8a3[_0xdb2a('0x31')][_0xdb2a('0x3c')]){_0x2b01e5['where']=_[_0xdb2a('0x3d')](_0x2b01e5[_0xdb2a('0x39')],{'$or':_[_0xdb2a('0x2a')](_0x39c5cc,function(_0x2100bb){if(_0x2100bb[_0xdb2a('0x2e')]!==_0xdb2a('0x3e')){var _0x1c3768={};_0x1c3768[_0x2100bb['name']]={'$like':'%'+_0xd3a8a3[_0xdb2a('0x31')][_0xdb2a('0x3c')]+'%'};return _0x1c3768;}})});}_0x2b01e5=_[_0xdb2a('0x3d')]({},_0x2b01e5,_0xd3a8a3[_0xdb2a('0x3f')]);var _0x508fae={'where':_0x2b01e5[_0xdb2a('0x39')]};return db[_0xdb2a('0x2b')]['count'](_0x508fae)[_0xdb2a('0x21')](function(_0x39c387){_0x24b30a[_0xdb2a('0x1b')]=_0x39c387;if(_0xd3a8a3[_0xdb2a('0x31')]['includeAll']){_0x2b01e5['include']=[{'all':!![]}];}return db['Tag'][_0xdb2a('0x40')](_0x2b01e5);})[_0xdb2a('0x21')](function(_0x54ffcc){_0x24b30a['rows']=_0x54ffcc;return _0x24b30a;})['then'](respondWithFilteredResult(_0x134053,_0x2b01e5))['catch'](handleError(_0x134053,null));};exports[_0xdb2a('0x41')]=function(_0x51f8cd,_0x43dbdf){var _0x2ed575={'raw':!![],'where':{'id':_0x51f8cd[_0xdb2a('0x42')]['id']}},_0xd149f8={};_0xd149f8['model']=_[_0xdb2a('0x32')](db[_0xdb2a('0x2b')][_0xdb2a('0x2c')]);_0xd149f8['query']=_[_0xdb2a('0x32')](_0x51f8cd[_0xdb2a('0x31')]);_0xd149f8[_0xdb2a('0x3a')]=_[_0xdb2a('0x33')](_0xd149f8['model'],_0xd149f8[_0xdb2a('0x31')]);_0x2ed575['attributes']=_[_0xdb2a('0x33')](_0xd149f8['model'],qs['fields'](_0x51f8cd[_0xdb2a('0x31')][_0xdb2a('0x35')]));_0x2ed575[_0xdb2a('0x34')]=_0x2ed575[_0xdb2a('0x34')][_0xdb2a('0x36')]?_0x2ed575[_0xdb2a('0x34')]:_0xd149f8[_0xdb2a('0x30')];if(_0x51f8cd['query'][_0xdb2a('0x43')]){_0x2ed575[_0xdb2a('0x44')]=[{'all':!![]}];}_0x2ed575=_[_0xdb2a('0x3d')]({},_0x2ed575,_0x51f8cd[_0xdb2a('0x3f')]);return db['Tag'][_0xdb2a('0x45')](_0x2ed575)[_0xdb2a('0x21')](handleEntityNotFound(_0x43dbdf,null))['then'](respondWithResult(_0x43dbdf,null))[_0xdb2a('0x46')](handleError(_0x43dbdf,null));};exports[_0xdb2a('0x47')]=function(_0x2daae5,_0x2079d4){return db['Tag']['create'](_0x2daae5[_0xdb2a('0x48')],{})['then'](function(_0x1995e2){var _0x5bc6ff=_0x2daae5[_0xdb2a('0x49')][_0xdb2a('0x23')]({'plain':!![]});if(!_0x5bc6ff)throw new Error(_0xdb2a('0x4a'));if(_0x5bc6ff['role']===_0xdb2a('0x49')){var _0x471013=_0x1995e2[_0xdb2a('0x23')]({'plain':!![]});var _0x5bfd5a=_0xdb2a('0x24');return db['UserProfileSection'][_0xdb2a('0x45')]({'where':{'name':_0x5bfd5a,'userProfileId':_0x5bc6ff[_0xdb2a('0x4b')]},'raw':!![]})['then'](function(_0x2ce61c){if(_0x2ce61c&&_0x2ce61c[_0xdb2a('0x4c')]===0x0){return db[_0xdb2a('0x25')][_0xdb2a('0x47')]({'name':_0x471013['name'],'resourceId':_0x471013['id'],'type':_0x2ce61c[_0xdb2a('0x27')],'sectionId':_0x2ce61c['id']},{})[_0xdb2a('0x21')](function(){return _0x1995e2;});}else{return _0x1995e2;}})[_0xdb2a('0x46')](function(_0x197495){logger[_0xdb2a('0x26')](_0xdb2a('0x4d'),_0x197495);throw _0x197495;});}return _0x1995e2;})[_0xdb2a('0x21')](respondWithResult(_0x2079d4,0xc9))[_0xdb2a('0x46')](handleError(_0x2079d4,null));};exports['update']=function(_0x55f3ae,_0x2ae1a7){if(_0x55f3ae[_0xdb2a('0x48')]['id']){delete _0x55f3ae[_0xdb2a('0x48')]['id'];}return db[_0xdb2a('0x2b')][_0xdb2a('0x45')]({'where':{'id':_0x55f3ae[_0xdb2a('0x42')]['id']}})[_0xdb2a('0x21')](handleEntityNotFound(_0x2ae1a7,null))[_0xdb2a('0x21')](saveUpdates(_0x55f3ae[_0xdb2a('0x48')],null))[_0xdb2a('0x21')](respondWithResult(_0x2ae1a7,null))[_0xdb2a('0x46')](handleError(_0x2ae1a7,null));};exports[_0xdb2a('0x22')]=function(_0x287ee0,_0x69068a){return db['Tag'][_0xdb2a('0x45')]({'where':{'id':_0x287ee0[_0xdb2a('0x42')]['id']}})[_0xdb2a('0x21')](handleEntityNotFound(_0x69068a,null))[_0xdb2a('0x21')](removeEntity(_0x69068a,null))['catch'](handleError(_0x69068a,null));};exports[_0xdb2a('0x4e')]=function(_0x196624,_0x810206){return db['Tag'][_0xdb2a('0x4e')]()['then'](respondWithResult(_0x810206,null))['catch'](handleError(_0x810206,null));}; \ No newline at end of file +var _0xd9e5=['length','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','params','keys','fields'];(function(_0x5d880e,_0x52fb62){var _0x2dc29d=function(_0x31c082){while(--_0x31c082){_0x5d880e['push'](_0x5d880e['shift']());}};_0x2dc29d(++_0x52fb62);}(_0xd9e5,0x19d));var _0x5d9e=function(_0x19f978,_0x413fe1){_0x19f978=_0x19f978-0x0;var _0x531180=_0xd9e5[_0x19f978];return _0x531180;};'use strict';var emlformat=require(_0x5d9e('0x0'));var rimraf=require(_0x5d9e('0x1'));var zipdir=require(_0x5d9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5d9e('0x3'));var moment=require(_0x5d9e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5d9e('0x5'));var util=require(_0x5d9e('0x6'));var path=require(_0x5d9e('0x7'));var sox=require(_0x5d9e('0x8'));var csv=require('to-csv');var ejs=require(_0x5d9e('0x9'));var fs=require('fs');var fs_extra=require(_0x5d9e('0xa'));var _=require('lodash');var squel=require(_0x5d9e('0xb'));var crypto=require('crypto');var jsforce=require(_0x5d9e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5d9e('0xd'));var Redis=require(_0x5d9e('0xe'));var authService=require(_0x5d9e('0xf'));var qs=require(_0x5d9e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5d9e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5d9e('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68a111,_0x10ec7c){_0x10ec7c=_0x10ec7c||0xcc;return function(_0x44c74a){if(_0x44c74a){return _0x68a111[_0x5d9e('0x13')](_0x10ec7c);}return _0x68a111[_0x5d9e('0x14')](_0x10ec7c)['end']();};}function respondWithResult(_0x5962ef,_0x247be3){_0x247be3=_0x247be3||0xc8;return function(_0x322e58){if(_0x322e58){return _0x5962ef[_0x5d9e('0x14')](_0x247be3)['json'](_0x322e58);}};}function respondWithFilteredResult(_0x82ad55,_0x501960){return function(_0x1c99ef){if(_0x1c99ef){var _0x54436a=typeof _0x501960[_0x5d9e('0x15')]===_0x5d9e('0x16')&&typeof _0x501960[_0x5d9e('0x17')]===_0x5d9e('0x16');var _0x1ce5a9=_0x1c99ef['count'];var _0x11bb96=_0x54436a?0x0:_0x501960['offset'];var _0x303f07=_0x54436a?_0x1c99ef[_0x5d9e('0x18')]:_0x501960[_0x5d9e('0x15')]+_0x501960['limit'];var _0x69d066;if(_0x303f07>=_0x1ce5a9){_0x303f07=_0x1ce5a9;_0x69d066=0xc8;}else{_0x69d066=0xce;}_0x82ad55['status'](_0x69d066);return _0x82ad55[_0x5d9e('0x19')]('Content-Range',_0x11bb96+'-'+_0x303f07+'/'+_0x1ce5a9)['json'](_0x1c99ef);}return null;};}function patchUpdates(_0x219e29){return function(_0x337dd6){try{jsonpatch[_0x5d9e('0x1a')](_0x337dd6,_0x219e29,!![]);}catch(_0x1cfe2a){return BPromise[_0x5d9e('0x1b')](_0x1cfe2a);}return _0x337dd6[_0x5d9e('0x1c')]();};}function saveUpdates(_0x506c44,_0x465b1a){return function(_0x5b1320){if(_0x5b1320){return _0x5b1320[_0x5d9e('0x1d')](_0x506c44)[_0x5d9e('0x1e')](function(_0x65f1b){return _0x65f1b;});}return null;};}function removeEntity(_0x1cfa5b,_0x508cac){return function(_0x8c602c){if(_0x8c602c){return _0x8c602c[_0x5d9e('0x1f')]()[_0x5d9e('0x1e')](function(){var _0x39a741=_0x8c602c[_0x5d9e('0x20')]({'plain':!![]});var _0x1ffcfb=_0x5d9e('0x21');return db[_0x5d9e('0x22')][_0x5d9e('0x1f')]({'where':{'type':_0x1ffcfb,'resourceId':_0x39a741['id']}})[_0x5d9e('0x1e')](function(){return _0x8c602c;});})[_0x5d9e('0x1e')](function(){_0x1cfa5b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23c9ad,_0x364cda){return function(_0x3fd601){if(!_0x3fd601){_0x23c9ad[_0x5d9e('0x13')](0x194);}return _0x3fd601;};}function handleError(_0x4789e8,_0x210eb0){_0x210eb0=_0x210eb0||0x1f4;return function(_0x111531){logger[_0x5d9e('0x23')](_0x111531[_0x5d9e('0x24')]);if(_0x111531[_0x5d9e('0x25')]){delete _0x111531[_0x5d9e('0x25')];}_0x4789e8[_0x5d9e('0x14')](_0x210eb0)[_0x5d9e('0x26')](_0x111531);};}exports[_0x5d9e('0x27')]=function(_0x4dd55c,_0x590396){var _0x1c4ee1={},_0x517262={},_0x237924={'count':0x0,'rows':[]};var _0x521bf4=_[_0x5d9e('0x28')](db[_0x5d9e('0x29')][_0x5d9e('0x2a')],function(_0x2e9e9a){return{'name':_0x2e9e9a[_0x5d9e('0x2b')],'type':_0x2e9e9a[_0x5d9e('0x2c')][_0x5d9e('0x2d')]};});_0x517262[_0x5d9e('0x2e')]=_[_0x5d9e('0x28')](_0x521bf4,_0x5d9e('0x25'));_0x517262[_0x5d9e('0x2f')]=_['keys'](_0x4dd55c['query']);_0x517262[_0x5d9e('0x30')]=_[_0x5d9e('0x31')](_0x517262[_0x5d9e('0x2e')],_0x517262[_0x5d9e('0x2f')]);_0x1c4ee1[_0x5d9e('0x32')]=_[_0x5d9e('0x31')](_0x517262[_0x5d9e('0x2e')],qs['fields'](_0x4dd55c[_0x5d9e('0x2f')]['fields']));_0x1c4ee1[_0x5d9e('0x32')]=_0x1c4ee1['attributes']['length']?_0x1c4ee1[_0x5d9e('0x32')]:_0x517262['model'];if(!_0x4dd55c[_0x5d9e('0x2f')][_0x5d9e('0x33')]('nolimit')){_0x1c4ee1[_0x5d9e('0x17')]=qs['limit'](_0x4dd55c[_0x5d9e('0x2f')][_0x5d9e('0x17')]);_0x1c4ee1[_0x5d9e('0x15')]=qs[_0x5d9e('0x15')](_0x4dd55c[_0x5d9e('0x2f')]['offset']);}_0x1c4ee1[_0x5d9e('0x34')]=qs[_0x5d9e('0x35')](_0x4dd55c['query']['sort']);_0x1c4ee1['where']=qs[_0x5d9e('0x30')](_[_0x5d9e('0x36')](_0x4dd55c[_0x5d9e('0x2f')],_0x517262[_0x5d9e('0x30')]),_0x521bf4);if(_0x4dd55c[_0x5d9e('0x2f')][_0x5d9e('0x37')]){_0x1c4ee1['where']=_[_0x5d9e('0x38')](_0x1c4ee1[_0x5d9e('0x39')],{'$or':_[_0x5d9e('0x28')](_0x521bf4,function(_0x21797c){if(_0x21797c['type']!==_0x5d9e('0x3a')){var _0x29869d={};_0x29869d[_0x21797c[_0x5d9e('0x25')]]={'$like':'%'+_0x4dd55c[_0x5d9e('0x2f')][_0x5d9e('0x37')]+'%'};return _0x29869d;}})});}_0x1c4ee1=_[_0x5d9e('0x38')]({},_0x1c4ee1,_0x4dd55c[_0x5d9e('0x3b')]);var _0x4bc318={'where':_0x1c4ee1[_0x5d9e('0x39')]};return db[_0x5d9e('0x29')][_0x5d9e('0x18')](_0x4bc318)[_0x5d9e('0x1e')](function(_0x5705c1){_0x237924[_0x5d9e('0x18')]=_0x5705c1;if(_0x4dd55c[_0x5d9e('0x2f')]['includeAll']){_0x1c4ee1[_0x5d9e('0x3c')]=[{'all':!![]}];}return db[_0x5d9e('0x29')][_0x5d9e('0x3d')](_0x1c4ee1);})['then'](function(_0x3b47a0){_0x237924[_0x5d9e('0x3e')]=_0x3b47a0;return _0x237924;})[_0x5d9e('0x1e')](respondWithFilteredResult(_0x590396,_0x1c4ee1))[_0x5d9e('0x3f')](handleError(_0x590396,null));};exports['show']=function(_0x322a55,_0x42b2bd){var _0x55d233={'raw':!![],'where':{'id':_0x322a55[_0x5d9e('0x40')]['id']}},_0x1dfdbb={};_0x1dfdbb[_0x5d9e('0x2e')]=_[_0x5d9e('0x41')](db[_0x5d9e('0x29')][_0x5d9e('0x2a')]);_0x1dfdbb['query']=_[_0x5d9e('0x41')](_0x322a55['query']);_0x1dfdbb[_0x5d9e('0x30')]=_['intersection'](_0x1dfdbb[_0x5d9e('0x2e')],_0x1dfdbb[_0x5d9e('0x2f')]);_0x55d233[_0x5d9e('0x32')]=_[_0x5d9e('0x31')](_0x1dfdbb['model'],qs[_0x5d9e('0x42')](_0x322a55[_0x5d9e('0x2f')][_0x5d9e('0x42')]));_0x55d233[_0x5d9e('0x32')]=_0x55d233[_0x5d9e('0x32')][_0x5d9e('0x43')]?_0x55d233[_0x5d9e('0x32')]:_0x1dfdbb['model'];if(_0x322a55['query'][_0x5d9e('0x44')]){_0x55d233[_0x5d9e('0x3c')]=[{'all':!![]}];}_0x55d233=_[_0x5d9e('0x38')]({},_0x55d233,_0x322a55['options']);return db['Tag'][_0x5d9e('0x45')](_0x55d233)['then'](handleEntityNotFound(_0x42b2bd,null))[_0x5d9e('0x1e')](respondWithResult(_0x42b2bd,null))['catch'](handleError(_0x42b2bd,null));};exports[_0x5d9e('0x46')]=function(_0x104cbd,_0x186af1){return db[_0x5d9e('0x29')][_0x5d9e('0x46')](_0x104cbd[_0x5d9e('0x47')],{})[_0x5d9e('0x1e')](function(_0x5e8092){var _0x16bada=_0x104cbd[_0x5d9e('0x48')][_0x5d9e('0x20')]({'plain':!![]});if(!_0x16bada)throw new Error(_0x5d9e('0x49'));if(_0x16bada[_0x5d9e('0x4a')]===_0x5d9e('0x48')){var _0x349ce4=_0x5e8092['get']({'plain':!![]});var _0x2f423b='Tags';return db[_0x5d9e('0x4b')]['find']({'where':{'name':_0x2f423b,'userProfileId':_0x16bada[_0x5d9e('0x4c')]},'raw':!![]})[_0x5d9e('0x1e')](function(_0x3f6ad8){if(_0x3f6ad8&&_0x3f6ad8[_0x5d9e('0x4d')]===0x0){return db[_0x5d9e('0x22')][_0x5d9e('0x46')]({'name':_0x349ce4[_0x5d9e('0x25')],'resourceId':_0x349ce4['id'],'type':_0x3f6ad8['name'],'sectionId':_0x3f6ad8['id']},{})[_0x5d9e('0x1e')](function(){return _0x5e8092;});}else{return _0x5e8092;}})[_0x5d9e('0x3f')](function(_0x28f188){logger['error'](_0x5d9e('0x4e'),_0x28f188);throw _0x28f188;});}return _0x5e8092;})[_0x5d9e('0x1e')](respondWithResult(_0x186af1,0xc9))[_0x5d9e('0x3f')](handleError(_0x186af1,null));};exports[_0x5d9e('0x1d')]=function(_0x3fbd98,_0xed3262){if(_0x3fbd98[_0x5d9e('0x47')]['id']){delete _0x3fbd98[_0x5d9e('0x47')]['id'];}return db[_0x5d9e('0x29')][_0x5d9e('0x45')]({'where':{'id':_0x3fbd98[_0x5d9e('0x40')]['id']}})[_0x5d9e('0x1e')](handleEntityNotFound(_0xed3262,null))[_0x5d9e('0x1e')](saveUpdates(_0x3fbd98[_0x5d9e('0x47')],null))['then'](respondWithResult(_0xed3262,null))[_0x5d9e('0x3f')](handleError(_0xed3262,null));};exports[_0x5d9e('0x1f')]=function(_0x2d8de5,_0x29a402){return db['Tag'][_0x5d9e('0x45')]({'where':{'id':_0x2d8de5[_0x5d9e('0x40')]['id']}})['then'](handleEntityNotFound(_0x29a402,null))['then'](removeEntity(_0x29a402,null))['catch'](handleError(_0x29a402,null));};exports[_0x5d9e('0x4f')]=function(_0x3e563b,_0x32d8bf){return db[_0x5d9e('0x29')][_0x5d9e('0x4f')]()[_0x5d9e('0x1e')](respondWithResult(_0x32d8bf,null))[_0x5d9e('0x3f')](handleError(_0x32d8bf,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 75acb06..7f6d649 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 _0xa48c=['../../config/logger','api','bluebird','request-promise','path','./tag.attributes','exports','define','Tag','lodash','util'];(function(_0x35c9f9,_0x2702ab){var _0x65ac60=function(_0x112c2a){while(--_0x112c2a){_0x35c9f9['push'](_0x35c9f9['shift']());}};_0x65ac60(++_0x2702ab);}(_0xa48c,0x169));var _0xca48=function(_0x2ff88b,_0x559d50){_0x2ff88b=_0x2ff88b-0x0;var _0x52bca0=_0xa48c[_0x2ff88b];return _0x52bca0;};'use strict';var _=require(_0xca48('0x0'));var util=require(_0xca48('0x1'));var logger=require(_0xca48('0x2'))(_0xca48('0x3'));var moment=require('moment');var BPromise=require(_0xca48('0x4'));var rp=require(_0xca48('0x5'));var fs=require('fs');var path=require(_0xca48('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca48('0x7'));module[_0xca48('0x8')]=function(_0x3c0828,_0x4ddc3d){return _0x3c0828[_0xca48('0x9')](_0xca48('0xa'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1781=['exports','define','Tag','tools_tags','util','api','moment','bluebird','path','rimraf','./tag.attributes'];(function(_0x50939f,_0xf70ad4){var _0x425425=function(_0x59a853){while(--_0x59a853){_0x50939f['push'](_0x50939f['shift']());}};_0x425425(++_0xf70ad4);}(_0x1781,0x67));var _0x1178=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1781[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x1178('0x0'));var logger=require('../../config/logger')(_0x1178('0x1'));var moment=require(_0x1178('0x2'));var BPromise=require(_0x1178('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1178('0x4'));var rimraf=require(_0x1178('0x5'));var config=require('../../config/environment');var attributes=require(_0x1178('0x6'));module[_0x1178('0x7')]=function(_0x96aa80,_0x1d76a8){return _0x96aa80[_0x1178('0x8')](_0x1178('0x9'),attributes,{'tableName':_0x1178('0xa'),'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 422a6d6..df35d35 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 _0x5636=['code','Tag,\x20%s,\x20%s','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','error'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5636,0x102));var _0x6563=function(_0x310242,_0x123b00){_0x310242=_0x310242-0x0;var _0x256352=_0x5636[_0x310242];return _0x256352;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6563('0x2'));var db=require(_0x6563('0x3'))['db'];var utils=require(_0x6563('0x4'));var logger=require('../../config/logger')(_0x6563('0x5'));var config=require(_0x6563('0x6'));var jayson=require(_0x6563('0x7'));var client=jayson[_0x6563('0x8')][_0x6563('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x193942,_0x9884a9,_0x2d57d5){return new BPromise(function(_0x2d0d5b,_0x98fcd4){return client[_0x6563('0xa')](_0x193942,_0x2d57d5)[_0x6563('0xb')](function(_0x3ccb4e){logger['info']('Tag,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));logger[_0x6563('0xd')]('Tag,\x20%s,\x20%s,\x20%s',_0x9884a9,'request\x20sent',JSON['stringify'](_0x3ccb4e));if(_0x3ccb4e[_0x6563('0xe')]){if(_0x3ccb4e[_0x6563('0xe')][_0x6563('0xf')]===0x1f4){logger[_0x6563('0xe')](_0x6563('0x10'),_0x9884a9,_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);return _0x98fcd4(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}logger['error'](_0x6563('0x10'),_0x9884a9,_0x3ccb4e['error'][_0x6563('0x11')]);return _0x2d0d5b(_0x3ccb4e[_0x6563('0xe')][_0x6563('0x11')]);}else{logger[_0x6563('0x12')]('Tag,\x20%s,\x20%s',_0x9884a9,_0x6563('0xc'));_0x2d0d5b(_0x3ccb4e[_0x6563('0x13')][_0x6563('0x11')]);}})[_0x6563('0x14')](function(_0x4e7282){logger[_0x6563('0xe')]('Tag,\x20%s,\x20%s',_0x9884a9,_0x4e7282);_0x98fcd4(_0x4e7282);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4ab390,_0x47966e){var _0x2dd153=function(_0x2a4c8b){while(--_0x2a4c8b){_0x4ab390['push'](_0x4ab390['shift']());}};_0x2dd153(++_0x47966e);}(_0xa41a,0x6b));var _0xaa41=function(_0x32ebf8,_0x257eda){_0x32ebf8=_0x32ebf8-0x0;var _0x3942bd=_0xa41a[_0x32ebf8];return _0x3942bd;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 879593a..03fb73f 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_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'));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(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 e7e0ceb..4035eab 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 _0xb7e7=['STRING','sequelize'];(function(_0x3e25c1,_0x1d15f9){var _0x52e7f2=function(_0x597a5a){while(--_0x597a5a){_0x3e25c1['push'](_0x3e25c1['shift']());}};_0x52e7f2(++_0x1d15f9);}(_0xb7e7,0x121));var _0x7b7e=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xb7e7[_0x432fca];return _0x3adba4;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x2032=['name','exports','STRING'];(function(_0x59556c,_0x133924){var _0x140a77=function(_0x258658){while(--_0x258658){_0x59556c['push'](_0x59556c['shift']());}};_0x140a77(++_0x133924);}(_0x2032,0xd9));var _0x2203=function(_0x5cbb1b,_0x3174ae){_0x5cbb1b=_0x5cbb1b-0x0;var _0x33c24=_0x2032[_0x5cbb1b];return _0x33c24;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![],'unique':_0x2203('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 82e9cd8..1d97402 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 _0x22c9=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','create','body','user','get','role','Teams','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','params','sequelize','transaction','Sequelize','QueryTypes','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','UserVoiceQueue','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','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','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','UserProfileResource','getQueues','findOne','isValidChannel','channel','ValidationError','Unknown\x20channel','toLowerCase','Queue','addQueues','add','capitalize','Queues','ids','removeQueues','isArray','Voice','Chat','Sms','Fax','Openchannel','QueueId','defaults','TeamVoiceQueue','penalty','User','findOrCreate','Queue:save','voicePause','interface','UserVoiceQueueRt','isNil','format','all','upsert','addAgents','spread','removeAgents','Mail','emit','Queue:remove','getAgents','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','name','send'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x22c9,0xfd));var _0x922c=function(_0x1c72ac,_0x380a0e){_0x1c72ac=_0x1c72ac-0x0;var _0x274e46=_0x22c9[_0x1c72ac];return _0x274e46;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x922c('0x0'));var zipdir=require(_0x922c('0x1'));var jsonpatch=require(_0x922c('0x2'));var rp=require(_0x922c('0x3'));var moment=require(_0x922c('0x4'));var BPromise=require(_0x922c('0x5'));var Mustache=require(_0x922c('0x6'));var util=require(_0x922c('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x922c('0x8'));var fs=require('fs');var fs_extra=require(_0x922c('0x9'));var _=require(_0x922c('0xa'));var squel=require(_0x922c('0xb'));var crypto=require(_0x922c('0xc'));var jsforce=require(_0x922c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x922c('0xe'));var Redis=require(_0x922c('0xf'));var authService=require(_0x922c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x922c('0x11'));var hardwareService=require(_0x922c('0x12'));var logger=require('../../config/logger')(_0x922c('0x13'));var utils=require(_0x922c('0x14'));var config=require(_0x922c('0x15'));var licenseUtil=require(_0x922c('0x16'));var db=require(_0x922c('0x17'))['db'];config[_0x922c('0x18')]=_['defaults'](config[_0x922c('0x18')],{'host':_0x922c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x922c('0x1a'))['register'](socket);function respondWithStatusCode(_0x4c83a9,_0x382e60){_0x382e60=_0x382e60||0xcc;return function(_0x5d8849){if(_0x5d8849){return _0x4c83a9[_0x922c('0x1b')](_0x382e60);}return _0x4c83a9[_0x922c('0x1c')](_0x382e60)[_0x922c('0x1d')]();};}function respondWithResult(_0x5acc7b,_0x25e3d0){_0x25e3d0=_0x25e3d0||0xc8;return function(_0x1f8322){if(_0x1f8322){return _0x5acc7b['status'](_0x25e3d0)[_0x922c('0x1e')](_0x1f8322);}};}function respondWithFilteredResult(_0x8e0031,_0x3bbd97){return function(_0x6e94da){if(_0x6e94da){var _0x2ab198=typeof _0x3bbd97[_0x922c('0x1f')]===_0x922c('0x20')&&typeof _0x3bbd97[_0x922c('0x21')]===_0x922c('0x20');var _0x57057d=_0x6e94da[_0x922c('0x22')];var _0x2c8530=_0x2ab198?0x0:_0x3bbd97[_0x922c('0x1f')];var _0x5b67bd=_0x2ab198?_0x6e94da['count']:_0x3bbd97[_0x922c('0x1f')]+_0x3bbd97[_0x922c('0x21')];var _0x41d113;if(_0x5b67bd>=_0x57057d){_0x5b67bd=_0x57057d;_0x41d113=0xc8;}else{_0x41d113=0xce;}_0x8e0031[_0x922c('0x1c')](_0x41d113);return _0x8e0031[_0x922c('0x23')]('Content-Range',_0x2c8530+'-'+_0x5b67bd+'/'+_0x57057d)['json'](_0x6e94da);}return null;};}function patchUpdates(_0xa358a0){return function(_0x5960b5){try{jsonpatch[_0x922c('0x24')](_0x5960b5,_0xa358a0,!![]);}catch(_0x38dec9){return BPromise['reject'](_0x38dec9);}return _0x5960b5[_0x922c('0x25')]();};}function saveUpdates(_0x1af40d,_0xdb4933){return function(_0x765bbd){if(_0x765bbd){return _0x765bbd[_0x922c('0x26')](_0x1af40d)[_0x922c('0x27')](function(_0x5c7f38){return _0x5c7f38;});}return null;};}function handleEntityNotFound(_0x42d460,_0x6c143b){return function(_0x431051){if(!_0x431051){_0x42d460[_0x922c('0x1b')](0x194);}return _0x431051;};}function handleError(_0x3c8265,_0x1e3f8b){_0x1e3f8b=_0x1e3f8b||0x1f4;return function(_0x1be1fa){logger[_0x922c('0x28')](_0x1be1fa['stack']);if(_0x1be1fa[_0x922c('0x29')]){delete _0x1be1fa[_0x922c('0x29')];}_0x3c8265[_0x922c('0x1c')](_0x1e3f8b)[_0x922c('0x2a')](_0x1be1fa);};}exports['index']=function(_0x2b4546,_0x1b3f8e){var _0x5d27eb={},_0xd5b570={},_0xb05c36={'count':0x0,'rows':[]};var _0x25d645=_[_0x922c('0x2b')](db['Team'][_0x922c('0x2c')],function(_0x287d30){return{'name':_0x287d30[_0x922c('0x2d')],'type':_0x287d30[_0x922c('0x2e')][_0x922c('0x2f')]};});_0xd5b570[_0x922c('0x30')]=_[_0x922c('0x2b')](_0x25d645,'name');_0xd5b570[_0x922c('0x31')]=_[_0x922c('0x32')](_0x2b4546[_0x922c('0x31')]);_0xd5b570[_0x922c('0x33')]=_['intersection'](_0xd5b570[_0x922c('0x30')],_0xd5b570['query']);_0x5d27eb['attributes']=_[_0x922c('0x34')](_0xd5b570[_0x922c('0x30')],qs[_0x922c('0x35')](_0x2b4546[_0x922c('0x31')]['fields']));_0x5d27eb[_0x922c('0x36')]=_0x5d27eb[_0x922c('0x36')][_0x922c('0x37')]?_0x5d27eb['attributes']:_0xd5b570[_0x922c('0x30')];if(!_0x2b4546['query'][_0x922c('0x38')]('nolimit')){_0x5d27eb[_0x922c('0x21')]=qs[_0x922c('0x21')](_0x2b4546['query'][_0x922c('0x21')]);_0x5d27eb['offset']=qs[_0x922c('0x1f')](_0x2b4546['query']['offset']);}_0x5d27eb[_0x922c('0x39')]=qs[_0x922c('0x3a')](_0x2b4546[_0x922c('0x31')][_0x922c('0x3a')]);_0x5d27eb['where']=qs[_0x922c('0x33')](_[_0x922c('0x3b')](_0x2b4546[_0x922c('0x31')],_0xd5b570[_0x922c('0x33')]),_0x25d645);if(_0x2b4546['query'][_0x922c('0x3c')]){_0x5d27eb[_0x922c('0x3d')]=_[_0x922c('0x3e')](_0x5d27eb[_0x922c('0x3d')],{'$or':_[_0x922c('0x2b')](_0x25d645,function(_0xc9c523){if(_0xc9c523[_0x922c('0x2e')]!==_0x922c('0x3f')){var _0x21cebb={};_0x21cebb[_0xc9c523[_0x922c('0x29')]]={'$like':'%'+_0x2b4546['query']['filter']+'%'};return _0x21cebb;}})});}_0x5d27eb=_[_0x922c('0x3e')]({},_0x5d27eb,_0x2b4546[_0x922c('0x40')]);var _0x541e5d={'where':_0x5d27eb[_0x922c('0x3d')]};return db[_0x922c('0x41')][_0x922c('0x22')](_0x541e5d)[_0x922c('0x27')](function(_0x4b0a68){_0xb05c36['count']=_0x4b0a68;if(_0x2b4546[_0x922c('0x31')][_0x922c('0x42')]){_0x5d27eb[_0x922c('0x43')]=[{'all':!![]}];}return db[_0x922c('0x41')][_0x922c('0x44')](_0x5d27eb);})[_0x922c('0x27')](function(_0x1e0c86){_0xb05c36[_0x922c('0x45')]=_0x1e0c86;return _0xb05c36;})[_0x922c('0x27')](respondWithFilteredResult(_0x1b3f8e,_0x5d27eb))[_0x922c('0x46')](handleError(_0x1b3f8e,null));};exports['show']=function(_0x43563f,_0x1ab44b){var _0x56b8d9={'raw':![],'where':{'id':_0x43563f['params']['id']}},_0x52c8a5={};_0x52c8a5[_0x922c('0x30')]=_[_0x922c('0x32')](db[_0x922c('0x41')][_0x922c('0x2c')]);_0x52c8a5[_0x922c('0x31')]=_[_0x922c('0x32')](_0x43563f['query']);_0x52c8a5['filters']=_[_0x922c('0x34')](_0x52c8a5['model'],_0x52c8a5[_0x922c('0x31')]);_0x56b8d9['attributes']=_['intersection'](_0x52c8a5[_0x922c('0x30')],qs['fields'](_0x43563f[_0x922c('0x31')][_0x922c('0x35')]));_0x56b8d9[_0x922c('0x36')]=_0x56b8d9[_0x922c('0x36')][_0x922c('0x37')]?_0x56b8d9[_0x922c('0x36')]:_0x52c8a5[_0x922c('0x30')];if(_0x43563f['query']['includeAll']){_0x56b8d9[_0x922c('0x43')]=[{'all':!![]}];}_0x56b8d9=_[_0x922c('0x3e')]({},_0x56b8d9,_0x43563f[_0x922c('0x40')]);return db[_0x922c('0x41')]['find'](_0x56b8d9)[_0x922c('0x27')](handleEntityNotFound(_0x1ab44b,null))[_0x922c('0x27')](respondWithResult(_0x1ab44b,null))[_0x922c('0x46')](handleError(_0x1ab44b,null));};exports['create']=function(_0x3c6e19,_0x58fca4){return db[_0x922c('0x41')][_0x922c('0x47')](_0x3c6e19[_0x922c('0x48')],{})[_0x922c('0x27')](function(_0xaff6cd){var _0x4dc764=_0x3c6e19[_0x922c('0x49')][_0x922c('0x4a')]({'plain':!![]});if(!_0x4dc764)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4dc764[_0x922c('0x4b')]===_0x922c('0x49')){var _0x1cd0a1=_0xaff6cd['get']({'plain':!![]});var _0x2b3c27=_0x922c('0x4c');return db[_0x922c('0x4d')][_0x922c('0x4e')]({'where':{'name':_0x2b3c27,'userProfileId':_0x4dc764[_0x922c('0x4f')]},'raw':!![]})[_0x922c('0x27')](function(_0x3fb432){if(_0x3fb432&&_0x3fb432[_0x922c('0x50')]===0x0){return db['UserProfileResource'][_0x922c('0x47')]({'name':_0x1cd0a1[_0x922c('0x29')],'resourceId':_0x1cd0a1['id'],'type':_0x3fb432[_0x922c('0x29')],'sectionId':_0x3fb432['id']},{})[_0x922c('0x27')](function(){return _0xaff6cd;});}else{return _0xaff6cd;}})['catch'](function(_0x25ae3e){logger[_0x922c('0x28')](_0x922c('0x51'),_0x25ae3e);throw _0x25ae3e;});}return _0xaff6cd;})[_0x922c('0x27')](respondWithResult(_0x58fca4,0xc9))[_0x922c('0x46')](handleError(_0x58fca4,null));};exports[_0x922c('0x26')]=function(_0x4db749,_0xdc02b7){if(_0x4db749[_0x922c('0x48')]['id']){delete _0x4db749[_0x922c('0x48')]['id'];}return db[_0x922c('0x41')][_0x922c('0x4e')]({'where':{'id':_0x4db749['params']['id']}})[_0x922c('0x27')](handleEntityNotFound(_0xdc02b7,null))[_0x922c('0x27')](saveUpdates(_0x4db749[_0x922c('0x48')],null))[_0x922c('0x27')](respondWithResult(_0xdc02b7,null))[_0x922c('0x46')](handleError(_0xdc02b7,null));};exports[_0x922c('0x52')]=function(_0x44d701,_0x56d984){var _0x1ad50e=_0x44d701[_0x922c('0x53')]['id'];var _0x483d4e=[];return db[_0x922c('0x54')][_0x922c('0x55')](function(_0x230d7a){var _0x12cf3e='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x1ad50e;return db[_0x922c('0x54')][_0x922c('0x31')](_0x12cf3e,{'type':db[_0x922c('0x56')][_0x922c('0x57')]['SELECT'],'raw':!![],'transaction':_0x230d7a})[_0x922c('0x27')](function(_0x112587){_0x483d4e=_['map'](_0x112587,function(_0x158742){return Number(_0x158742['UserId']);});})['then'](function(){var _0x3b384a=_0x922c('0x58')+_0x1ad50e;return db[_0x922c('0x54')]['query'](_0x3b384a,{'type':db[_0x922c('0x56')][_0x922c('0x57')][_0x922c('0x59')],'raw':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0x412773){var _0x8c498e=_[_0x922c('0x2b')](_0x412773,function(_0x4c4e3f){return Number(_0x4c4e3f['VoiceQueueId']);});return db[_0x922c('0x5a')][_0x922c('0x52')]({'where':{'UserId':{'$in':_0x483d4e},'VoiceQueueId':{'$in':_0x8c498e}},'transaction':_0x230d7a});})['then'](function(){var _0x213a55='SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1ad50e;return db[_0x922c('0x54')][_0x922c('0x31')](_0x213a55,{'type':db[_0x922c('0x56')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0xfdd092){var _0x4a6859=_[_0x922c('0x2b')](_0xfdd092,function(_0x43a48f){return Number(_0x43a48f[_0x922c('0x5b')]);});return db['UserMailQueue'][_0x922c('0x52')]({'where':{'UserId':{'$in':_0x483d4e},'MailQueueId':{'$in':_0x4a6859}},'transaction':_0x230d7a});})[_0x922c('0x27')](function(){var _0x1e5ddb=_0x922c('0x5c')+_0x1ad50e;return db[_0x922c('0x54')][_0x922c('0x31')](_0x1e5ddb,{'type':db['Sequelize'][_0x922c('0x57')][_0x922c('0x59')],'raw':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0x1fd553){var _0x43c5ff=_[_0x922c('0x2b')](_0x1fd553,function(_0x4bf167){return Number(_0x4bf167[_0x922c('0x5d')]);});return db[_0x922c('0x5e')][_0x922c('0x52')]({'where':{'UserId':{'$in':_0x483d4e},'SmsQueueId':{'$in':_0x43c5ff}},'transaction':_0x230d7a});})['then'](function(){var _0x3c67d2=_0x922c('0x5f')+_0x1ad50e;return db[_0x922c('0x54')][_0x922c('0x31')](_0x3c67d2,{'type':db[_0x922c('0x56')]['QueryTypes'][_0x922c('0x59')],'raw':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0xc8e42e){var _0x37ebdd=_[_0x922c('0x2b')](_0xc8e42e,function(_0x231b40){return Number(_0x231b40[_0x922c('0x60')]);});return db[_0x922c('0x61')][_0x922c('0x52')]({'where':{'UserId':{'$in':_0x483d4e},'ChatQueueId':{'$in':_0x37ebdd}},'transaction':_0x230d7a});})[_0x922c('0x27')](function(){var _0x3020a1=_0x922c('0x62')+_0x1ad50e;return db[_0x922c('0x54')]['query'](_0x3020a1,{'type':db[_0x922c('0x56')]['QueryTypes'][_0x922c('0x59')],'raw':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0x201451){var _0xb7a0ad=_[_0x922c('0x2b')](_0x201451,function(_0x455a9e){return Number(_0x455a9e['FaxQueueId']);});return db[_0x922c('0x63')][_0x922c('0x52')]({'where':{'UserId':{'$in':_0x483d4e},'FaxQueueId':{'$in':_0xb7a0ad}},'transaction':_0x230d7a});})[_0x922c('0x27')](function(){var _0x9fca45=_0x922c('0x64')+_0x1ad50e;return db[_0x922c('0x54')][_0x922c('0x31')](_0x9fca45,{'type':db[_0x922c('0x56')][_0x922c('0x57')][_0x922c('0x59')],'raw':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0x106cbb){var _0xe28f5c=_[_0x922c('0x2b')](_0x106cbb,function(_0xc5abd9){return Number(_0xc5abd9[_0x922c('0x65')]);});return db['UserOpenchannelQueue'][_0x922c('0x52')]({'where':{'UserId':{'$in':_0x483d4e},'OpenchannelQueueId':{'$in':_0xe28f5c}},'transaction':_0x230d7a});})[_0x922c('0x27')](function(){var _0x5ee3bc='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1ad50e;return db['sequelize'][_0x922c('0x31')](_0x5ee3bc,{'type':db[_0x922c('0x56')]['QueryTypes'][_0x922c('0x59')],'raw':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0x487bde){var _0x2d8175=_[_0x922c('0x2b')](_0x487bde,function(_0x3f27fa){return Number(_0x3f27fa['WhatsappQueueId']);});return db['UserWhatsappQueue'][_0x922c('0x52')]({'where':{'UserId':{'$in':_0x483d4e},'WhatsappQueueId':{'$in':_0x2d8175}},'transaction':_0x230d7a});})[_0x922c('0x27')](function(){return db[_0x922c('0x66')][_0x922c('0x4e')]({'where':{'TeamId':_0x1ad50e}});})['then'](function(_0x61f13b){if(_0x61f13b===null){return;}return db[_0x922c('0x67')]['destroy']({'where':{'UserId':{'$in':_0x483d4e},'VoicePrefixId':_0x61f13b[_0x922c('0x68')]},'transaction':_0x230d7a});})[_0x922c('0x27')](function(){return db[_0x922c('0x41')][_0x922c('0x52')]({'where':{'id':_0x1ad50e},'cascade':!![],'transaction':_0x230d7a});})[_0x922c('0x27')](function(_0xf7ebb5){if(_0xf7ebb5===0x0){_0x56d984[_0x922c('0x1b')](0x194);}else{return db[_0x922c('0x69')]['destroy']({'where':{'type':_0x922c('0x4c'),'resourceId':_0x1ad50e},'cascade':!![],'transaction':_0x230d7a})[_0x922c('0x27')](function(){_0x56d984['status'](0xcc)[_0x922c('0x1d')]();});}})[_0x922c('0x46')](function(_0x1faafc){_0x56d984['status'](0x1f4)[_0x922c('0x2a')](_0x1faafc);});});};exports[_0x922c('0x6a')]=function(_0x271baf,_0x5872c6,_0xb4c701){return db[_0x922c('0x41')][_0x922c('0x6b')]({'where':{'id':_0x271baf[_0x922c('0x53')]['id']}})['then'](handleEntityNotFound(_0x5872c6,null))[_0x922c('0x27')](function(_0x1df8b7){if(!_0x271baf[_0x922c('0x31')]['channel']||!utils[_0x922c('0x6c')](_0x271baf[_0x922c('0x31')][_0x922c('0x6d')])){throw new db[(_0x922c('0x56'))][(_0x922c('0x6e'))](_0x922c('0x6f'));}var _0x5c258a={};var _0x2d79d4={};_0x2d79d4['model']=_[_0x922c('0x32')](db[_['capitalize'](_0x271baf['query'][_0x922c('0x6d')][_0x922c('0x70')]())+_0x922c('0x71')][_0x922c('0x2c')]);_0x2d79d4[_0x922c('0x31')]=_[_0x922c('0x32')](_0x271baf['query']);_0x2d79d4[_0x922c('0x33')]=_['intersection'](_0x2d79d4[_0x922c('0x30')],_0x2d79d4[_0x922c('0x31')]);_0x5c258a['attributes']=_['intersection'](_0x2d79d4['model'],qs['fields'](_0x271baf[_0x922c('0x31')][_0x922c('0x35')]));_0x5c258a[_0x922c('0x36')]=_0x5c258a[_0x922c('0x36')][_0x922c('0x37')]?_0x5c258a[_0x922c('0x36')]:_0x2d79d4['model'];_0x5c258a[_0x922c('0x21')]=qs[_0x922c('0x21')](_0x271baf['query']['limit']);_0x5c258a[_0x922c('0x1f')]=qs[_0x922c('0x1f')](_0x271baf['query'][_0x922c('0x1f')]);_0x5c258a[_0x922c('0x39')]=qs[_0x922c('0x3a')](_0x271baf[_0x922c('0x31')][_0x922c('0x3a')]);_0x5c258a['where']=qs[_0x922c('0x33')](_['pick'](_0x271baf[_0x922c('0x31')],_0x2d79d4[_0x922c('0x33')]));_0x5c258a=_[_0x922c('0x3e')]({},_0x5c258a,_0x271baf[_0x922c('0x40')]);return _0x1df8b7[_0x922c('0x4a')+_['capitalize'](_0x271baf[_0x922c('0x31')][_0x922c('0x6d')]['toLowerCase']())+'Queues'](_0x5c258a);})[_0x922c('0x27')](respondWithResult(_0x5872c6,null))[_0x922c('0x46')](handleError(_0x5872c6,null));};exports[_0x922c('0x72')]=function(_0x326fea,_0x1c05e0,_0x582a19){return db['Team'][_0x922c('0x6b')]({'where':{'id':_0x326fea[_0x922c('0x53')]['id']}})[_0x922c('0x27')](function(_0x44bc49){if(_0x44bc49){if(!_0x326fea[_0x922c('0x48')]['channel']||!utils[_0x922c('0x6c')](_0x326fea[_0x922c('0x48')]['channel'])){throw new db[(_0x922c('0x56'))]['ValidationError'](_0x922c('0x6f'));}return _0x44bc49[_0x922c('0x73')+_[_0x922c('0x74')](_0x326fea[_0x922c('0x48')][_0x922c('0x6d')][_0x922c('0x70')]())+_0x922c('0x75')](_0x326fea[_0x922c('0x48')][_0x922c('0x76')]);}return null;})[_0x922c('0x27')](handleEntityNotFound(_0x1c05e0,null))[_0x922c('0x27')](respondWithStatusCode(_0x1c05e0,null))[_0x922c('0x46')](handleError(_0x1c05e0,null));};exports[_0x922c('0x77')]=function(_0x35cf95,_0x8434b7,_0x4e83cc){return db[_0x922c('0x41')][_0x922c('0x6b')]({'where':{'id':_0x35cf95['params']['id']}})[_0x922c('0x27')](function(_0x16aaf3){if(_0x16aaf3){if(!_0x35cf95['query'][_0x922c('0x6d')]||!utils[_0x922c('0x6c')](_0x35cf95[_0x922c('0x31')][_0x922c('0x6d')])){throw new db[(_0x922c('0x56'))][(_0x922c('0x6e'))](_0x922c('0x6f'));}return _0x16aaf3['remove'+_[_0x922c('0x74')](_0x35cf95[_0x922c('0x31')][_0x922c('0x6d')][_0x922c('0x70')]())+'Queues'](_0x35cf95['query'][_0x922c('0x76')]);}return null;})['then'](handleEntityNotFound(_0x8434b7,null))[_0x922c('0x27')](respondWithStatusCode(_0x8434b7,null))[_0x922c('0x46')](handleError(_0x8434b7,null));};exports['addAgents']=function(_0x1f3b5c,_0x5b97a0){var _0x518f93=_[_0x922c('0x78')](_0x1f3b5c[_0x922c('0x48')][_0x922c('0x76')])?_0x1f3b5c[_0x922c('0x48')][_0x922c('0x76')]:[_0x1f3b5c[_0x922c('0x48')][_0x922c('0x76')]];var _0x55632e=_0x1f3b5c[_0x922c('0x53')]['id'];return db[_0x922c('0x41')][_0x922c('0x4e')]({'where':{'id':_0x55632e}})[_0x922c('0x27')](handleEntityNotFound(_0x5b97a0,null))['then'](function(_0x514e5b){if(_0x514e5b){var _0x135a76=[_0x922c('0x79'),_0x922c('0x7a'),'Mail',_0x922c('0x7b'),_0x922c('0x7c'),_0x922c('0x7d'),'Whatsapp'];return db[_0x922c('0x54')]['transaction'](function(_0x93796f){var _0xf6b449=_[_0x922c('0x2b')](_0x135a76,function(_0x474499){var _0x557ff3={'attributes':['id',_0x922c('0x29')]};if(_0x474499===_0x922c('0x79')){_0x557ff3['through']={'attributes':['penalty']};}return _0x514e5b['get'+_0x474499+_0x922c('0x75')](_0x557ff3)[_0x922c('0x27')](function(_0x535494){var _0xc8641a=_['map'](_0x535494,function(_0xaced22){var _0x2c52a2=_[_0x922c('0x2b')](_0x518f93,function(_0x457365){var _0x402860={'where':{'UserId':_0x457365,[_0x474499+_0x922c('0x7e')]:_0xaced22['id']},'transaction':_0x93796f};if(_0x474499==='Voice'){_0x402860[_0x922c('0x7f')]={'penalty':_0xaced22[_0x922c('0x80')][_0x922c('0x81')]};}return db[_0x922c('0x82')+_0x474499+_0x922c('0x71')][_0x922c('0x83')](_0x402860)[_0x922c('0x27')](function(){socket['emit'](_0x922c('0x49')+_0x474499+_0x922c('0x84'),{'UserId':_0x457365,[_0x474499+'QueueId']:_0xaced22['id']});if(_0x474499!==_0x922c('0x79')){return;}return db[_0x922c('0x82')]['findAll']({'where':{'id':_0x518f93,'online':0x1},'attributes':['id','name','online',_0x922c('0x85'),_0x922c('0x86')],'raw':!![]})[_0x922c('0x27')](function(_0x399008){var _0x1c3618=_[_0x922c('0x2b')](_0x399008,function(_0x3de78b){return db[_0x922c('0x87')]['upsert']({'membername':_0x3de78b['name'],'UserId':_0x3de78b['id'],'queue_name':_0xaced22['name'],'VoiceQueueId':_0xaced22['id'],'interface':_[_0x922c('0x88')](_0x3de78b['interface'])?util[_0x922c('0x89')]('SIP/%s',_0x3de78b[_0x922c('0x29')]):_0x3de78b[_0x922c('0x86')],'paused':_0x3de78b[_0x922c('0x85')]||![],'penalty':_0xaced22[_0x922c('0x80')][_0x922c('0x81')]},{'transaction':_0x93796f});});return Promise[_0x922c('0x8a')](_0x1c3618);});});});return Promise[_0x922c('0x8a')](_0x2c52a2);});return Promise['all'](_0xc8641a);})[_0x922c('0x27')](function(){return db[_0x922c('0x66')][_0x922c('0x6b')]({'where':{'teamId':_0x55632e}})[_0x922c('0x27')](function(_0x52a412){if(_0x52a412){var _0x1780ca=_[_0x922c('0x2b')](_0x518f93,function(_0x5c291f){db[_0x922c('0x67')][_0x922c('0x8b')]({'UserId':_0x5c291f,'VoicePrefixId':_0x52a412['VoicePrefixId']});});return Promise[_0x922c('0x8a')](_0x1780ca);}});});});return Promise[_0x922c('0x8a')](_0xf6b449)[_0x922c('0x27')](function(){return _0x514e5b[_0x922c('0x8c')](_0x518f93,{'transaction':_0x93796f})[_0x922c('0x8d')](function(_0x32c151){return _0x32c151;});});});}})[_0x922c('0x27')](respondWithResult(_0x5b97a0,null))[_0x922c('0x46')](handleError(_0x5b97a0,null));};exports[_0x922c('0x8e')]=function(_0x340a4e,_0x1f65f3){var _0xff0fb1=_[_0x922c('0x78')](_0x340a4e[_0x922c('0x31')][_0x922c('0x76')])?_0x340a4e[_0x922c('0x31')]['ids']:[_0x340a4e['query'][_0x922c('0x76')]];var _0xa6a378=_0x340a4e['params']['id'];return db[_0x922c('0x41')][_0x922c('0x4e')]({'where':{'id':_0xa6a378}})[_0x922c('0x27')](handleEntityNotFound(_0x1f65f3,null))[_0x922c('0x27')](function(_0x7945b){if(_0x7945b){var _0x31cd2d=[_0x922c('0x79'),_0x922c('0x7a'),_0x922c('0x8f'),_0x922c('0x7b'),'Fax',_0x922c('0x7d'),'Whatsapp'];return db[_0x922c('0x54')][_0x922c('0x55')](function(_0xbfddee){var _0x3f9520=_['map'](_0x31cd2d,function(_0xdce43b){var _0x8293b={'attributes':['id',_0x922c('0x29')]};return _0x7945b['get'+_0xdce43b+_0x922c('0x75')](_0x8293b)[_0x922c('0x27')](function(_0xb95c6a){var _0x572e85=_['map'](_0xb95c6a,function(_0x34df44){return _0x34df44[_0x922c('0x8e')](_0xff0fb1,{'transaction':_0xbfddee})[_0x922c('0x27')](function(){var _0x34e619=_[_0x922c('0x2b')](_0xff0fb1,function(_0x357ea3){socket[_0x922c('0x90')]('user'+_0xdce43b+_0x922c('0x91'),{'UserId':Number(_0x357ea3),[_0xdce43b+_0x922c('0x7e')]:_0x34df44['id']});if(_0xdce43b!==_0x922c('0x79')){return;}return db[_0x922c('0x87')]['destroy']({'where':{'VoiceQueueId':_0x34df44['id'],'UserId':_0x357ea3},'transaction':_0xbfddee});});return Promise['all'](_0x34e619);});});return Promise[_0x922c('0x8a')](_0x572e85);});});return Promise[_0x922c('0x8a')](_0x3f9520)[_0x922c('0x27')](function(){return _0x7945b[_0x922c('0x8e')](_0xff0fb1,{'transaction':_0xbfddee});})[_0x922c('0x27')](function(){return db[_0x922c('0x66')]['findOne']({'where':{'teamId':_0xa6a378}})[_0x922c('0x27')](function(_0x1cb2ff){if(_0x1cb2ff){var _0x57ef72=_['map'](_0xff0fb1,function(_0x236e56){db[_0x922c('0x67')]['destroy']({'where':{'UserId':_0x236e56,'VoicePrefixId':_0x1cb2ff[_0x922c('0x68')]}});});return Promise[_0x922c('0x8a')](_0x57ef72);}});});});}})[_0x922c('0x27')](respondWithStatusCode(_0x1f65f3,null))[_0x922c('0x46')](handleError(_0x1f65f3,null));};exports['getAgents']=function(_0x1fbc78,_0x2eae3c,_0x44d16d){var _0x49b6cd={};var _0x593a5e={};var _0x8d02f1;var _0x4e78dd;return db[_0x922c('0x41')][_0x922c('0x6b')]({'where':{'id':_0x1fbc78[_0x922c('0x53')]['id']}})[_0x922c('0x27')](handleEntityNotFound(_0x2eae3c,null))[_0x922c('0x27')](function(_0x5e792d){if(_0x5e792d){_0x8d02f1=_0x5e792d;_0x593a5e[_0x922c('0x30')]=_['keys'](db[_0x922c('0x82')][_0x922c('0x2c')]);_0x593a5e[_0x922c('0x31')]=_['keys'](_0x1fbc78['query']);_0x593a5e['filters']=_[_0x922c('0x34')](_0x593a5e[_0x922c('0x30')],_0x593a5e[_0x922c('0x31')]);_0x49b6cd['attributes']=_['intersection'](_0x593a5e[_0x922c('0x30')],qs[_0x922c('0x35')](_0x1fbc78[_0x922c('0x31')]['fields']));_0x49b6cd[_0x922c('0x36')]=_0x49b6cd[_0x922c('0x36')]['length']?_0x49b6cd[_0x922c('0x36')]:_0x593a5e['model'];_0x49b6cd[_0x922c('0x39')]=qs[_0x922c('0x3a')](_0x1fbc78[_0x922c('0x31')][_0x922c('0x3a')]);_0x49b6cd[_0x922c('0x3d')]=qs['filters'](_[_0x922c('0x3b')](_0x1fbc78['query'],_0x593a5e[_0x922c('0x33')]));if(_0x1fbc78['query'][_0x922c('0x3c')]){_0x49b6cd[_0x922c('0x3d')]=_[_0x922c('0x3e')](_0x49b6cd[_0x922c('0x3d')],{'$or':_[_0x922c('0x2b')](_0x49b6cd[_0x922c('0x36')],function(_0x2250fb){var _0x5ed2b8={};_0x5ed2b8[_0x2250fb]={'$like':'%'+_0x1fbc78['query']['filter']+'%'};return _0x5ed2b8;})});}_0x49b6cd=_[_0x922c('0x3e')]({},_0x49b6cd,_0x1fbc78['options']);return _0x8d02f1[_0x922c('0x92')](_0x49b6cd);}})[_0x922c('0x27')](function(_0x2d96cf){if(_0x2d96cf){_0x4e78dd=_0x2d96cf[_0x922c('0x37')];if(!_0x1fbc78['query'][_0x922c('0x38')](_0x922c('0x93'))){_0x49b6cd[_0x922c('0x21')]=qs[_0x922c('0x21')](_0x1fbc78[_0x922c('0x31')][_0x922c('0x21')]);_0x49b6cd[_0x922c('0x1f')]=qs[_0x922c('0x1f')](_0x1fbc78[_0x922c('0x31')][_0x922c('0x1f')]);}return _0x8d02f1[_0x922c('0x92')](_0x49b6cd);}})[_0x922c('0x27')](function(_0x102efd){if(_0x102efd){return _0x102efd?{'count':_0x4e78dd,'rows':_0x102efd}:null;}})[_0x922c('0x27')](respondWithResult(_0x2eae3c,null))[_0x922c('0x46')](handleError(_0x2eae3c,null));}; \ No newline at end of file +var _0xaee0=['User','Queue','emit','Queue:save','findAll','voicePause','upsert','interface','SIP/%s','all','TeamVoicePrefix','spread','removeAgents','Whatsapp','UserVoiceQueueRt','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','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/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','status','end','json','offset','undefined','limit','count','set','apply','reject','save','sendStatus','error','stack','name','map','Team','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','include','catch','show','params','length','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SmsQueueId','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','UserVoicePrefix','VoicePrefixId','send','getQueues','findOne','channel','ValidationError','capitalize','toLowerCase','Queues','isValidChannel','add','removeQueues','Unknown\x20channel','ids','addAgents','isArray','Voice','Chat','Mail','Sms','transaction','through','penalty','QueueId','TeamVoiceQueue'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0xaee0,0x1db));var _0x0aee=function(_0x187499,_0x5e416a){_0x187499=_0x187499-0x0;var _0x2965fe=_0xaee0[_0x187499];return _0x2965fe;};'use strict';var emlformat=require(_0x0aee('0x0'));var rimraf=require(_0x0aee('0x1'));var zipdir=require(_0x0aee('0x2'));var jsonpatch=require(_0x0aee('0x3'));var rp=require(_0x0aee('0x4'));var moment=require(_0x0aee('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0aee('0x6'));var util=require('util');var path=require(_0x0aee('0x7'));var sox=require(_0x0aee('0x8'));var csv=require('to-csv');var ejs=require(_0x0aee('0x9'));var fs=require('fs');var fs_extra=require(_0x0aee('0xa'));var _=require(_0x0aee('0xb'));var squel=require(_0x0aee('0xc'));var crypto=require(_0x0aee('0xd'));var jsforce=require(_0x0aee('0xe'));var deskjs=require(_0x0aee('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0aee('0x10'));var Papa=require(_0x0aee('0x11'));var Redis=require(_0x0aee('0x12'));var authService=require(_0x0aee('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0aee('0x14'));var hardwareService=require(_0x0aee('0x15'));var logger=require(_0x0aee('0x16'))(_0x0aee('0x17'));var utils=require('../../config/utils');var config=require(_0x0aee('0x18'));var licenseUtil=require(_0x0aee('0x19'));var db=require(_0x0aee('0x1a'))['db'];config['redis']=_[_0x0aee('0x1b')](config[_0x0aee('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0aee('0x1d'))(new Redis(config['redis']));require('./team.socket')[_0x0aee('0x1e')](socket);function respondWithStatusCode(_0x4e16de,_0x2bd60d){_0x2bd60d=_0x2bd60d||0xcc;return function(_0x3df991){if(_0x3df991){return _0x4e16de['sendStatus'](_0x2bd60d);}return _0x4e16de[_0x0aee('0x1f')](_0x2bd60d)[_0x0aee('0x20')]();};}function respondWithResult(_0x2418db,_0x536062){_0x536062=_0x536062||0xc8;return function(_0x312784){if(_0x312784){return _0x2418db[_0x0aee('0x1f')](_0x536062)[_0x0aee('0x21')](_0x312784);}};}function respondWithFilteredResult(_0x553ed3,_0x498005){return function(_0x26a640){if(_0x26a640){var _0x19bf37=typeof _0x498005[_0x0aee('0x22')]===_0x0aee('0x23')&&typeof _0x498005[_0x0aee('0x24')]===_0x0aee('0x23');var _0x41952d=_0x26a640[_0x0aee('0x25')];var _0x394820=_0x19bf37?0x0:_0x498005['offset'];var _0x187681=_0x19bf37?_0x26a640[_0x0aee('0x25')]:_0x498005[_0x0aee('0x22')]+_0x498005[_0x0aee('0x24')];var _0x55f4e9;if(_0x187681>=_0x41952d){_0x187681=_0x41952d;_0x55f4e9=0xc8;}else{_0x55f4e9=0xce;}_0x553ed3[_0x0aee('0x1f')](_0x55f4e9);return _0x553ed3[_0x0aee('0x26')]('Content-Range',_0x394820+'-'+_0x187681+'/'+_0x41952d)['json'](_0x26a640);}return null;};}function patchUpdates(_0x3fdbe0){return function(_0x30dc39){try{jsonpatch[_0x0aee('0x27')](_0x30dc39,_0x3fdbe0,!![]);}catch(_0x3150a9){return BPromise[_0x0aee('0x28')](_0x3150a9);}return _0x30dc39[_0x0aee('0x29')]();};}function saveUpdates(_0x445f87,_0x18fd02){return function(_0xcb0f3c){if(_0xcb0f3c){return _0xcb0f3c['update'](_0x445f87)['then'](function(_0x52daac){return _0x52daac;});}return null;};}function handleEntityNotFound(_0x189385,_0x245c07){return function(_0x40463c){if(!_0x40463c){_0x189385[_0x0aee('0x2a')](0x194);}return _0x40463c;};}function handleError(_0x180525,_0x55c5b9){_0x55c5b9=_0x55c5b9||0x1f4;return function(_0x1f4f20){logger[_0x0aee('0x2b')](_0x1f4f20[_0x0aee('0x2c')]);if(_0x1f4f20['name']){delete _0x1f4f20[_0x0aee('0x2d')];}_0x180525[_0x0aee('0x1f')](_0x55c5b9)['send'](_0x1f4f20);};}exports['index']=function(_0x48fa9d,_0x15da12){var _0x2ecb0f={},_0x1d2be3={},_0x30216f={'count':0x0,'rows':[]};var _0x17d335=_[_0x0aee('0x2e')](db[_0x0aee('0x2f')][_0x0aee('0x30')],function(_0x27e02a){return{'name':_0x27e02a[_0x0aee('0x31')],'type':_0x27e02a[_0x0aee('0x32')][_0x0aee('0x33')]};});_0x1d2be3[_0x0aee('0x34')]=_[_0x0aee('0x2e')](_0x17d335,_0x0aee('0x2d'));_0x1d2be3['query']=_[_0x0aee('0x35')](_0x48fa9d[_0x0aee('0x36')]);_0x1d2be3[_0x0aee('0x37')]=_[_0x0aee('0x38')](_0x1d2be3[_0x0aee('0x34')],_0x1d2be3['query']);_0x2ecb0f[_0x0aee('0x39')]=_[_0x0aee('0x38')](_0x1d2be3[_0x0aee('0x34')],qs[_0x0aee('0x3a')](_0x48fa9d['query']['fields']));_0x2ecb0f[_0x0aee('0x39')]=_0x2ecb0f['attributes']['length']?_0x2ecb0f[_0x0aee('0x39')]:_0x1d2be3[_0x0aee('0x34')];if(!_0x48fa9d[_0x0aee('0x36')][_0x0aee('0x3b')](_0x0aee('0x3c'))){_0x2ecb0f[_0x0aee('0x24')]=qs[_0x0aee('0x24')](_0x48fa9d[_0x0aee('0x36')][_0x0aee('0x24')]);_0x2ecb0f[_0x0aee('0x22')]=qs[_0x0aee('0x22')](_0x48fa9d[_0x0aee('0x36')][_0x0aee('0x22')]);}_0x2ecb0f[_0x0aee('0x3d')]=qs[_0x0aee('0x3e')](_0x48fa9d['query'][_0x0aee('0x3e')]);_0x2ecb0f[_0x0aee('0x3f')]=qs[_0x0aee('0x37')](_[_0x0aee('0x40')](_0x48fa9d[_0x0aee('0x36')],_0x1d2be3[_0x0aee('0x37')]),_0x17d335);if(_0x48fa9d[_0x0aee('0x36')][_0x0aee('0x41')]){_0x2ecb0f['where']=_[_0x0aee('0x42')](_0x2ecb0f[_0x0aee('0x3f')],{'$or':_[_0x0aee('0x2e')](_0x17d335,function(_0x16cc26){if(_0x16cc26[_0x0aee('0x32')]!==_0x0aee('0x43')){var _0x31537e={};_0x31537e[_0x16cc26[_0x0aee('0x2d')]]={'$like':'%'+_0x48fa9d[_0x0aee('0x36')][_0x0aee('0x41')]+'%'};return _0x31537e;}})});}_0x2ecb0f=_['merge']({},_0x2ecb0f,_0x48fa9d[_0x0aee('0x44')]);var _0xbdb713={'where':_0x2ecb0f['where']};return db[_0x0aee('0x2f')][_0x0aee('0x25')](_0xbdb713)[_0x0aee('0x45')](function(_0x4e4008){_0x30216f['count']=_0x4e4008;if(_0x48fa9d['query']['includeAll']){_0x2ecb0f[_0x0aee('0x46')]=[{'all':!![]}];}return db['Team']['findAll'](_0x2ecb0f);})['then'](function(_0x587137){_0x30216f['rows']=_0x587137;return _0x30216f;})[_0x0aee('0x45')](respondWithFilteredResult(_0x15da12,_0x2ecb0f))[_0x0aee('0x47')](handleError(_0x15da12,null));};exports[_0x0aee('0x48')]=function(_0x2410ad,_0x3e4e4e){var _0x211baa={'raw':![],'where':{'id':_0x2410ad[_0x0aee('0x49')]['id']}},_0x573df9={};_0x573df9['model']=_['keys'](db[_0x0aee('0x2f')]['rawAttributes']);_0x573df9[_0x0aee('0x36')]=_['keys'](_0x2410ad[_0x0aee('0x36')]);_0x573df9[_0x0aee('0x37')]=_[_0x0aee('0x38')](_0x573df9[_0x0aee('0x34')],_0x573df9[_0x0aee('0x36')]);_0x211baa['attributes']=_[_0x0aee('0x38')](_0x573df9[_0x0aee('0x34')],qs[_0x0aee('0x3a')](_0x2410ad['query'][_0x0aee('0x3a')]));_0x211baa[_0x0aee('0x39')]=_0x211baa[_0x0aee('0x39')][_0x0aee('0x4a')]?_0x211baa['attributes']:_0x573df9[_0x0aee('0x34')];if(_0x2410ad[_0x0aee('0x36')][_0x0aee('0x4b')]){_0x211baa['include']=[{'all':!![]}];}_0x211baa=_[_0x0aee('0x42')]({},_0x211baa,_0x2410ad[_0x0aee('0x44')]);return db[_0x0aee('0x2f')]['find'](_0x211baa)[_0x0aee('0x45')](handleEntityNotFound(_0x3e4e4e,null))[_0x0aee('0x45')](respondWithResult(_0x3e4e4e,null))['catch'](handleError(_0x3e4e4e,null));};exports[_0x0aee('0x4c')]=function(_0xfe6c19,_0x427f6d){return db[_0x0aee('0x2f')][_0x0aee('0x4c')](_0xfe6c19[_0x0aee('0x4d')],{})[_0x0aee('0x45')](function(_0x17aa13){var _0x314314=_0xfe6c19[_0x0aee('0x4e')][_0x0aee('0x4f')]({'plain':!![]});if(!_0x314314)throw new Error(_0x0aee('0x50'));if(_0x314314[_0x0aee('0x51')]===_0x0aee('0x4e')){var _0x2a9eee=_0x17aa13['get']({'plain':!![]});var _0x1f214a=_0x0aee('0x52');return db['UserProfileSection'][_0x0aee('0x53')]({'where':{'name':_0x1f214a,'userProfileId':_0x314314[_0x0aee('0x54')]},'raw':!![]})[_0x0aee('0x45')](function(_0x1f7e10){if(_0x1f7e10&&_0x1f7e10[_0x0aee('0x55')]===0x0){return db[_0x0aee('0x56')]['create']({'name':_0x2a9eee['name'],'resourceId':_0x2a9eee['id'],'type':_0x1f7e10['name'],'sectionId':_0x1f7e10['id']},{})['then'](function(){return _0x17aa13;});}else{return _0x17aa13;}})[_0x0aee('0x47')](function(_0x2ee0af){logger[_0x0aee('0x2b')](_0x0aee('0x57'),_0x2ee0af);throw _0x2ee0af;});}return _0x17aa13;})[_0x0aee('0x45')](respondWithResult(_0x427f6d,0xc9))[_0x0aee('0x47')](handleError(_0x427f6d,null));};exports[_0x0aee('0x58')]=function(_0xbbcc51,_0x1b7876){if(_0xbbcc51['body']['id']){delete _0xbbcc51['body']['id'];}return db[_0x0aee('0x2f')][_0x0aee('0x53')]({'where':{'id':_0xbbcc51[_0x0aee('0x49')]['id']}})[_0x0aee('0x45')](handleEntityNotFound(_0x1b7876,null))['then'](saveUpdates(_0xbbcc51['body'],null))[_0x0aee('0x45')](respondWithResult(_0x1b7876,null))['catch'](handleError(_0x1b7876,null));};exports[_0x0aee('0x59')]=function(_0x1a9a96,_0x30f2b1){var _0x1df5f0=_0x1a9a96[_0x0aee('0x49')]['id'];var _0x43ae1c=[];return db[_0x0aee('0x5a')]['transaction'](function(_0x42a546){var _0x352b55='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x1df5f0;return db[_0x0aee('0x5a')][_0x0aee('0x36')](_0x352b55,{'type':db[_0x0aee('0x5b')][_0x0aee('0x5c')][_0x0aee('0x5d')],'raw':!![],'transaction':_0x42a546})[_0x0aee('0x45')](function(_0x457d1){_0x43ae1c=_[_0x0aee('0x2e')](_0x457d1,function(_0x382ef1){return Number(_0x382ef1[_0x0aee('0x5e')]);});})[_0x0aee('0x45')](function(){var _0x4b4633=_0x0aee('0x5f')+_0x1df5f0;return db['sequelize'][_0x0aee('0x36')](_0x4b4633,{'type':db[_0x0aee('0x5b')][_0x0aee('0x5c')]['SELECT'],'raw':!![],'transaction':_0x42a546});})[_0x0aee('0x45')](function(_0x3aa2f5){var _0x5f3340=_[_0x0aee('0x2e')](_0x3aa2f5,function(_0x126428){return Number(_0x126428['VoiceQueueId']);});return db[_0x0aee('0x60')][_0x0aee('0x59')]({'where':{'UserId':{'$in':_0x43ae1c},'VoiceQueueId':{'$in':_0x5f3340}},'transaction':_0x42a546});})[_0x0aee('0x45')](function(){var _0x1c6138=_0x0aee('0x61')+_0x1df5f0;return db[_0x0aee('0x5a')][_0x0aee('0x36')](_0x1c6138,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x42a546});})['then'](function(_0x3d5199){var _0x276a0b=_[_0x0aee('0x2e')](_0x3d5199,function(_0x5766b9){return Number(_0x5766b9[_0x0aee('0x62')]);});return db['UserMailQueue'][_0x0aee('0x59')]({'where':{'UserId':{'$in':_0x43ae1c},'MailQueueId':{'$in':_0x276a0b}},'transaction':_0x42a546});})[_0x0aee('0x45')](function(){var _0xf129a1='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1df5f0;return db[_0x0aee('0x5a')][_0x0aee('0x36')](_0xf129a1,{'type':db[_0x0aee('0x5b')][_0x0aee('0x5c')][_0x0aee('0x5d')],'raw':!![],'transaction':_0x42a546});})['then'](function(_0x469eb){var _0x2282a1=_[_0x0aee('0x2e')](_0x469eb,function(_0x5a7968){return Number(_0x5a7968[_0x0aee('0x63')]);});return db['UserSmsQueue'][_0x0aee('0x59')]({'where':{'UserId':{'$in':_0x43ae1c},'SmsQueueId':{'$in':_0x2282a1}},'transaction':_0x42a546});})['then'](function(){var _0x250f6d=_0x0aee('0x64')+_0x1df5f0;return db[_0x0aee('0x5a')][_0x0aee('0x36')](_0x250f6d,{'type':db[_0x0aee('0x5b')][_0x0aee('0x5c')][_0x0aee('0x5d')],'raw':!![],'transaction':_0x42a546});})[_0x0aee('0x45')](function(_0x2e141b){var _0x422caa=_['map'](_0x2e141b,function(_0x2a3bfa){return Number(_0x2a3bfa[_0x0aee('0x65')]);});return db['UserChatQueue']['destroy']({'where':{'UserId':{'$in':_0x43ae1c},'ChatQueueId':{'$in':_0x422caa}},'transaction':_0x42a546});})[_0x0aee('0x45')](function(){var _0x228177=_0x0aee('0x66')+_0x1df5f0;return db[_0x0aee('0x5a')]['query'](_0x228177,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x42a546});})[_0x0aee('0x45')](function(_0x2973f3){var _0x498b60=_[_0x0aee('0x2e')](_0x2973f3,function(_0x22ea9f){return Number(_0x22ea9f[_0x0aee('0x67')]);});return db[_0x0aee('0x68')][_0x0aee('0x59')]({'where':{'UserId':{'$in':_0x43ae1c},'FaxQueueId':{'$in':_0x498b60}},'transaction':_0x42a546});})[_0x0aee('0x45')](function(){var _0x554a36=_0x0aee('0x69')+_0x1df5f0;return db['sequelize'][_0x0aee('0x36')](_0x554a36,{'type':db['Sequelize'][_0x0aee('0x5c')][_0x0aee('0x5d')],'raw':!![],'transaction':_0x42a546});})[_0x0aee('0x45')](function(_0x498d30){var _0x3c9020=_[_0x0aee('0x2e')](_0x498d30,function(_0x523d00){return Number(_0x523d00[_0x0aee('0x6a')]);});return db[_0x0aee('0x6b')][_0x0aee('0x59')]({'where':{'UserId':{'$in':_0x43ae1c},'OpenchannelQueueId':{'$in':_0x3c9020}},'transaction':_0x42a546});})[_0x0aee('0x45')](function(){var _0x24bf07=_0x0aee('0x6c')+_0x1df5f0;return db[_0x0aee('0x5a')][_0x0aee('0x36')](_0x24bf07,{'type':db[_0x0aee('0x5b')][_0x0aee('0x5c')][_0x0aee('0x5d')],'raw':!![],'transaction':_0x42a546});})[_0x0aee('0x45')](function(_0xd64393){var _0x3d8929=_[_0x0aee('0x2e')](_0xd64393,function(_0x344eb7){return Number(_0x344eb7[_0x0aee('0x6d')]);});return db[_0x0aee('0x6e')]['destroy']({'where':{'UserId':{'$in':_0x43ae1c},'WhatsappQueueId':{'$in':_0x3d8929}},'transaction':_0x42a546});})[_0x0aee('0x45')](function(){return db['TeamVoicePrefix'][_0x0aee('0x53')]({'where':{'TeamId':_0x1df5f0}});})['then'](function(_0x1dfecf){if(_0x1dfecf===null){return;}return db[_0x0aee('0x6f')][_0x0aee('0x59')]({'where':{'UserId':{'$in':_0x43ae1c},'VoicePrefixId':_0x1dfecf[_0x0aee('0x70')]},'transaction':_0x42a546});})['then'](function(){return db[_0x0aee('0x2f')]['destroy']({'where':{'id':_0x1df5f0},'cascade':!![],'transaction':_0x42a546});})[_0x0aee('0x45')](function(_0x19d509){if(_0x19d509===0x0){_0x30f2b1[_0x0aee('0x2a')](0x194);}else{return db[_0x0aee('0x56')][_0x0aee('0x59')]({'where':{'type':_0x0aee('0x52'),'resourceId':_0x1df5f0},'cascade':!![],'transaction':_0x42a546})[_0x0aee('0x45')](function(){_0x30f2b1['status'](0xcc)[_0x0aee('0x20')]();});}})[_0x0aee('0x47')](function(_0x8b4d46){_0x30f2b1[_0x0aee('0x1f')](0x1f4)[_0x0aee('0x71')](_0x8b4d46);});});};exports[_0x0aee('0x72')]=function(_0x5d5823,_0x190bb1,_0x3572d0){return db['Team'][_0x0aee('0x73')]({'where':{'id':_0x5d5823[_0x0aee('0x49')]['id']}})[_0x0aee('0x45')](handleEntityNotFound(_0x190bb1,null))[_0x0aee('0x45')](function(_0x6f3e83){if(!_0x5d5823[_0x0aee('0x36')][_0x0aee('0x74')]||!utils['isValidChannel'](_0x5d5823[_0x0aee('0x36')][_0x0aee('0x74')])){throw new db['Sequelize'][(_0x0aee('0x75'))]('Unknown\x20channel');}var _0x2b5c34={};var _0x25a7e2={};_0x25a7e2[_0x0aee('0x34')]=_[_0x0aee('0x35')](db[_[_0x0aee('0x76')](_0x5d5823['query'][_0x0aee('0x74')]['toLowerCase']())+'Queue'][_0x0aee('0x30')]);_0x25a7e2[_0x0aee('0x36')]=_[_0x0aee('0x35')](_0x5d5823[_0x0aee('0x36')]);_0x25a7e2[_0x0aee('0x37')]=_[_0x0aee('0x38')](_0x25a7e2[_0x0aee('0x34')],_0x25a7e2[_0x0aee('0x36')]);_0x2b5c34[_0x0aee('0x39')]=_[_0x0aee('0x38')](_0x25a7e2['model'],qs[_0x0aee('0x3a')](_0x5d5823['query'][_0x0aee('0x3a')]));_0x2b5c34['attributes']=_0x2b5c34[_0x0aee('0x39')][_0x0aee('0x4a')]?_0x2b5c34['attributes']:_0x25a7e2['model'];_0x2b5c34[_0x0aee('0x24')]=qs[_0x0aee('0x24')](_0x5d5823[_0x0aee('0x36')][_0x0aee('0x24')]);_0x2b5c34[_0x0aee('0x22')]=qs[_0x0aee('0x22')](_0x5d5823[_0x0aee('0x36')][_0x0aee('0x22')]);_0x2b5c34['order']=qs[_0x0aee('0x3e')](_0x5d5823[_0x0aee('0x36')][_0x0aee('0x3e')]);_0x2b5c34[_0x0aee('0x3f')]=qs[_0x0aee('0x37')](_['pick'](_0x5d5823['query'],_0x25a7e2[_0x0aee('0x37')]));_0x2b5c34=_[_0x0aee('0x42')]({},_0x2b5c34,_0x5d5823[_0x0aee('0x44')]);return _0x6f3e83[_0x0aee('0x4f')+_[_0x0aee('0x76')](_0x5d5823[_0x0aee('0x36')][_0x0aee('0x74')][_0x0aee('0x77')]())+_0x0aee('0x78')](_0x2b5c34);})[_0x0aee('0x45')](respondWithResult(_0x190bb1,null))[_0x0aee('0x47')](handleError(_0x190bb1,null));};exports['addQueues']=function(_0x5659a6,_0x854e2a,_0x43a041){return db['Team'][_0x0aee('0x73')]({'where':{'id':_0x5659a6[_0x0aee('0x49')]['id']}})['then'](function(_0x41a438){if(_0x41a438){if(!_0x5659a6[_0x0aee('0x4d')][_0x0aee('0x74')]||!utils[_0x0aee('0x79')](_0x5659a6[_0x0aee('0x4d')][_0x0aee('0x74')])){throw new db[(_0x0aee('0x5b'))]['ValidationError']('Unknown\x20channel');}return _0x41a438[_0x0aee('0x7a')+_[_0x0aee('0x76')](_0x5659a6[_0x0aee('0x4d')][_0x0aee('0x74')][_0x0aee('0x77')]())+_0x0aee('0x78')](_0x5659a6[_0x0aee('0x4d')]['ids']);}return null;})['then'](handleEntityNotFound(_0x854e2a,null))[_0x0aee('0x45')](respondWithStatusCode(_0x854e2a,null))[_0x0aee('0x47')](handleError(_0x854e2a,null));};exports[_0x0aee('0x7b')]=function(_0xa7e815,_0x1f9bb8,_0x22f22a){return db[_0x0aee('0x2f')][_0x0aee('0x73')]({'where':{'id':_0xa7e815['params']['id']}})[_0x0aee('0x45')](function(_0xca61fc){if(_0xca61fc){if(!_0xa7e815['query']['channel']||!utils['isValidChannel'](_0xa7e815[_0x0aee('0x36')][_0x0aee('0x74')])){throw new db['Sequelize'][(_0x0aee('0x75'))](_0x0aee('0x7c'));}return _0xca61fc['remove'+_[_0x0aee('0x76')](_0xa7e815[_0x0aee('0x36')][_0x0aee('0x74')]['toLowerCase']())+_0x0aee('0x78')](_0xa7e815[_0x0aee('0x36')][_0x0aee('0x7d')]);}return null;})[_0x0aee('0x45')](handleEntityNotFound(_0x1f9bb8,null))[_0x0aee('0x45')](respondWithStatusCode(_0x1f9bb8,null))[_0x0aee('0x47')](handleError(_0x1f9bb8,null));};exports[_0x0aee('0x7e')]=function(_0x2cdeac,_0x342745){var _0x337c84=_[_0x0aee('0x7f')](_0x2cdeac[_0x0aee('0x4d')]['ids'])?_0x2cdeac[_0x0aee('0x4d')]['ids']:[_0x2cdeac[_0x0aee('0x4d')][_0x0aee('0x7d')]];var _0x32e4a7=_0x2cdeac['params']['id'];return db[_0x0aee('0x2f')][_0x0aee('0x53')]({'where':{'id':_0x32e4a7}})[_0x0aee('0x45')](handleEntityNotFound(_0x342745,null))[_0x0aee('0x45')](function(_0x2af604){if(_0x2af604){var _0x2d07e8=[_0x0aee('0x80'),_0x0aee('0x81'),_0x0aee('0x82'),_0x0aee('0x83'),'Fax','Openchannel','Whatsapp'];return db['sequelize'][_0x0aee('0x84')](function(_0x1f38b6){var _0x31b7c2=_[_0x0aee('0x2e')](_0x2d07e8,function(_0x4f7f57){var _0x2598d0={'attributes':['id',_0x0aee('0x2d')]};if(_0x4f7f57==='Voice'){_0x2598d0[_0x0aee('0x85')]={'attributes':[_0x0aee('0x86')]};}return _0x2af604[_0x0aee('0x4f')+_0x4f7f57+'Queues'](_0x2598d0)[_0x0aee('0x45')](function(_0x11c593){var _0x456d7d=_['map'](_0x11c593,function(_0x58d88f){var _0xc4ae8c=_[_0x0aee('0x2e')](_0x337c84,function(_0x45a750){var _0x85bca2={'where':{'UserId':_0x45a750,[_0x4f7f57+_0x0aee('0x87')]:_0x58d88f['id']},'transaction':_0x1f38b6};if(_0x4f7f57===_0x0aee('0x80')){_0x85bca2[_0x0aee('0x1b')]={'penalty':_0x58d88f[_0x0aee('0x88')]['penalty']};}return db[_0x0aee('0x89')+_0x4f7f57+_0x0aee('0x8a')]['findOrCreate'](_0x85bca2)['then'](function(){socket[_0x0aee('0x8b')](_0x0aee('0x4e')+_0x4f7f57+_0x0aee('0x8c'),{'UserId':_0x45a750,[_0x4f7f57+_0x0aee('0x87')]:_0x58d88f['id']});if(_0x4f7f57!==_0x0aee('0x80')){return;}return db[_0x0aee('0x89')][_0x0aee('0x8d')]({'where':{'id':_0x337c84,'online':0x1},'attributes':['id',_0x0aee('0x2d'),'online',_0x0aee('0x8e'),'interface'],'raw':!![]})[_0x0aee('0x45')](function(_0x5be4be){var _0x52be60=_[_0x0aee('0x2e')](_0x5be4be,function(_0x502858){return db['UserVoiceQueueRt'][_0x0aee('0x8f')]({'membername':_0x502858['name'],'UserId':_0x502858['id'],'queue_name':_0x58d88f[_0x0aee('0x2d')],'VoiceQueueId':_0x58d88f['id'],'interface':_['isNil'](_0x502858[_0x0aee('0x90')])?util['format'](_0x0aee('0x91'),_0x502858[_0x0aee('0x2d')]):_0x502858[_0x0aee('0x90')],'paused':_0x502858[_0x0aee('0x8e')]||![],'penalty':_0x58d88f[_0x0aee('0x88')][_0x0aee('0x86')]},{'transaction':_0x1f38b6});});return Promise[_0x0aee('0x92')](_0x52be60);});});});return Promise[_0x0aee('0x92')](_0xc4ae8c);});return Promise[_0x0aee('0x92')](_0x456d7d);})[_0x0aee('0x45')](function(){return db[_0x0aee('0x93')][_0x0aee('0x73')]({'where':{'teamId':_0x32e4a7}})[_0x0aee('0x45')](function(_0xe4c1ef){if(_0xe4c1ef){var _0x577f99=_[_0x0aee('0x2e')](_0x337c84,function(_0x4f21d9){db[_0x0aee('0x6f')][_0x0aee('0x8f')]({'UserId':_0x4f21d9,'VoicePrefixId':_0xe4c1ef[_0x0aee('0x70')]});});return Promise['all'](_0x577f99);}});});});return Promise[_0x0aee('0x92')](_0x31b7c2)[_0x0aee('0x45')](function(){return _0x2af604[_0x0aee('0x7e')](_0x337c84,{'transaction':_0x1f38b6})[_0x0aee('0x94')](function(_0x3c8994){return _0x3c8994;});});});}})['then'](respondWithResult(_0x342745,null))['catch'](handleError(_0x342745,null));};exports[_0x0aee('0x95')]=function(_0xccee64,_0x12ece0){var _0x5577c8=_['isArray'](_0xccee64[_0x0aee('0x36')]['ids'])?_0xccee64[_0x0aee('0x36')][_0x0aee('0x7d')]:[_0xccee64[_0x0aee('0x36')][_0x0aee('0x7d')]];var _0x9b4d44=_0xccee64[_0x0aee('0x49')]['id'];return db[_0x0aee('0x2f')][_0x0aee('0x53')]({'where':{'id':_0x9b4d44}})[_0x0aee('0x45')](handleEntityNotFound(_0x12ece0,null))[_0x0aee('0x45')](function(_0x1aab2d){if(_0x1aab2d){var _0x3a0d0d=[_0x0aee('0x80'),_0x0aee('0x81'),_0x0aee('0x82'),_0x0aee('0x83'),'Fax','Openchannel',_0x0aee('0x96')];return db[_0x0aee('0x5a')][_0x0aee('0x84')](function(_0x5c7e68){var _0x124d90=_[_0x0aee('0x2e')](_0x3a0d0d,function(_0x22161a){var _0x8e1eeb={'attributes':['id',_0x0aee('0x2d')]};return _0x1aab2d['get'+_0x22161a+_0x0aee('0x78')](_0x8e1eeb)[_0x0aee('0x45')](function(_0x2e4cd4){var _0x54bad5=_['map'](_0x2e4cd4,function(_0x193ff9){return _0x193ff9[_0x0aee('0x95')](_0x5577c8,{'transaction':_0x5c7e68})[_0x0aee('0x45')](function(){var _0x23c122=_[_0x0aee('0x2e')](_0x5577c8,function(_0x2125bd){socket[_0x0aee('0x8b')](_0x0aee('0x4e')+_0x22161a+'Queue:remove',{'UserId':Number(_0x2125bd),[_0x22161a+'QueueId']:_0x193ff9['id']});if(_0x22161a!==_0x0aee('0x80')){return;}return db[_0x0aee('0x97')][_0x0aee('0x59')]({'where':{'VoiceQueueId':_0x193ff9['id'],'UserId':_0x2125bd},'transaction':_0x5c7e68});});return Promise[_0x0aee('0x92')](_0x23c122);});});return Promise[_0x0aee('0x92')](_0x54bad5);});});return Promise[_0x0aee('0x92')](_0x124d90)[_0x0aee('0x45')](function(){return _0x1aab2d['removeAgents'](_0x5577c8,{'transaction':_0x5c7e68});})[_0x0aee('0x45')](function(){return db[_0x0aee('0x93')][_0x0aee('0x73')]({'where':{'teamId':_0x9b4d44}})[_0x0aee('0x45')](function(_0x361659){if(_0x361659){var _0x30b3d3=_[_0x0aee('0x2e')](_0x5577c8,function(_0x8f3a6c){db['UserVoicePrefix'][_0x0aee('0x59')]({'where':{'UserId':_0x8f3a6c,'VoicePrefixId':_0x361659[_0x0aee('0x70')]}});});return Promise['all'](_0x30b3d3);}});});});}})[_0x0aee('0x45')](respondWithStatusCode(_0x12ece0,null))[_0x0aee('0x47')](handleError(_0x12ece0,null));};exports[_0x0aee('0x98')]=function(_0xc3f6ba,_0x1ddf20,_0x4dea3d){var _0xa31aa9={};var _0x24ed5f={};var _0x1f406b;var _0x9161e3;return db[_0x0aee('0x2f')]['findOne']({'where':{'id':_0xc3f6ba[_0x0aee('0x49')]['id']}})['then'](handleEntityNotFound(_0x1ddf20,null))[_0x0aee('0x45')](function(_0x401fc1){if(_0x401fc1){_0x1f406b=_0x401fc1;_0x24ed5f['model']=_['keys'](db[_0x0aee('0x89')][_0x0aee('0x30')]);_0x24ed5f[_0x0aee('0x36')]=_[_0x0aee('0x35')](_0xc3f6ba[_0x0aee('0x36')]);_0x24ed5f[_0x0aee('0x37')]=_[_0x0aee('0x38')](_0x24ed5f['model'],_0x24ed5f[_0x0aee('0x36')]);_0xa31aa9[_0x0aee('0x39')]=_[_0x0aee('0x38')](_0x24ed5f['model'],qs[_0x0aee('0x3a')](_0xc3f6ba['query'][_0x0aee('0x3a')]));_0xa31aa9[_0x0aee('0x39')]=_0xa31aa9[_0x0aee('0x39')]['length']?_0xa31aa9[_0x0aee('0x39')]:_0x24ed5f[_0x0aee('0x34')];_0xa31aa9[_0x0aee('0x3d')]=qs[_0x0aee('0x3e')](_0xc3f6ba[_0x0aee('0x36')][_0x0aee('0x3e')]);_0xa31aa9[_0x0aee('0x3f')]=qs['filters'](_['pick'](_0xc3f6ba[_0x0aee('0x36')],_0x24ed5f['filters']));if(_0xc3f6ba['query'][_0x0aee('0x41')]){_0xa31aa9[_0x0aee('0x3f')]=_[_0x0aee('0x42')](_0xa31aa9[_0x0aee('0x3f')],{'$or':_[_0x0aee('0x2e')](_0xa31aa9['attributes'],function(_0x4bba8c){var _0x182cd6={};_0x182cd6[_0x4bba8c]={'$like':'%'+_0xc3f6ba['query'][_0x0aee('0x41')]+'%'};return _0x182cd6;})});}_0xa31aa9=_[_0x0aee('0x42')]({},_0xa31aa9,_0xc3f6ba[_0x0aee('0x44')]);return _0x1f406b[_0x0aee('0x98')](_0xa31aa9);}})['then'](function(_0x253e13){if(_0x253e13){_0x9161e3=_0x253e13[_0x0aee('0x4a')];if(!_0xc3f6ba[_0x0aee('0x36')]['hasOwnProperty'](_0x0aee('0x3c'))){_0xa31aa9['limit']=qs[_0x0aee('0x24')](_0xc3f6ba[_0x0aee('0x36')][_0x0aee('0x24')]);_0xa31aa9[_0x0aee('0x22')]=qs[_0x0aee('0x22')](_0xc3f6ba[_0x0aee('0x36')][_0x0aee('0x22')]);}return _0x1f406b[_0x0aee('0x98')](_0xa31aa9);}})[_0x0aee('0x45')](function(_0x47c2b3){if(_0x47c2b3){return _0x47c2b3?{'count':_0x9161e3,'rows':_0x47c2b3}:null;}})['then'](respondWithResult(_0x1ddf20,null))['catch'](handleError(_0x1ddf20,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 0a7201c..840ccbc 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 _0xf56a=['setMaxListeners','save','update','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x395be8,_0x285479){var _0x5ceb20=function(_0x225920){while(--_0x225920){_0x395be8['push'](_0x395be8['shift']());}};_0x5ceb20(++_0x285479);}(_0xf56a,0xa6));var _0xaf56=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0xf56a[_0x3be0c4];return _0x11af9f;};'use strict';var EventEmitter=require(_0xaf56('0x0'));var Team=require(_0xaf56('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xaf56('0x2')](0x0);var events={'afterCreate':_0xaf56('0x3'),'afterUpdate':_0xaf56('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5a821b){return function(_0xe7bb16,_0x1985f0,_0x59f7a4){TeamEvents['emit'](_0x5a821b+':'+_0xe7bb16['id'],_0xe7bb16);TeamEvents[_0xaf56('0x5')](_0x5a821b,_0xe7bb16);_0x59f7a4(null);};}for(var e in events){if(events[_0xaf56('0x6')](e)){var event=events[e];Team[_0xaf56('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0xdcf1=['hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x52ce3b,_0x2d4e1d){var _0x4332ba=function(_0x3c4947){while(--_0x3c4947){_0x52ce3b['push'](_0x52ce3b['shift']());}};_0x4332ba(++_0x2d4e1d);}(_0xdcf1,0x73));var _0x1dcf=function(_0xa62163,_0x4a26fb){_0xa62163=_0xa62163-0x0;var _0x46b4fb=_0xdcf1[_0xa62163];return _0x46b4fb;};'use strict';var EventEmitter=require('events');var Team=require(_0x1dcf('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x1dcf('0x1')](0x0);var events={'afterCreate':_0x1dcf('0x2'),'afterUpdate':_0x1dcf('0x3'),'afterDestroy':_0x1dcf('0x4')};function emitEvent(_0x1a2ec9){return function(_0x5a1969,_0x21d8be,_0x437da7){TeamEvents['emit'](_0x1a2ec9+':'+_0x5a1969['id'],_0x5a1969);TeamEvents['emit'](_0x1a2ec9,_0x5a1969);_0x437da7(null);};}for(var e in events){if(events[_0x1dcf('0x5')](e)){var event=events[e];Team[_0x1dcf('0x6')](e,emitEvent(event));}}module[_0x1dcf('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 1089879..c0c51cf 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 _0x8339=['resolve','catch','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','exports','define','Team','teams','Chat','Fax','Mail','Openchannel','Voice','Whatsapp'];(function(_0xbc5053,_0x2cf59d){var _0x4df1f5=function(_0x3c2a1d){while(--_0x3c2a1d){_0xbc5053['push'](_0xbc5053['shift']());}};_0x4df1f5(++_0x2cf59d);}(_0x8339,0xb6));var _0x9833=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0x8339[_0x5280f4];return _0xba93e7;};'use strict';var _=require(_0x9833('0x0'));var attributes=require(_0x9833('0x1'));function getQueuesByChannel(_0x156489,_0x1be01a){var _0x3fec5d=_0x9833('0x2')+_0x1be01a+_0x9833('0x3');return _0x156489[_0x3fec5d]()[_0x9833('0x4')](function(_0x3c575e){return _[_0x9833('0x5')](_0x3c575e,function(_0x294c54){_0x294c54[_0x9833('0x6')](_0x9833('0x7'),_0x1be01a);return _0x294c54;});})['catch'](function(_0x2792d7){throw _0x2792d7;});}module[_0x9833('0x8')]=function(_0x141bf5){return _0x141bf5[_0x9833('0x9')](_0x9833('0xa'),attributes,{'tableName':_0x9833('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x299f88=this;var _0x3ec23f=[_0x9833('0xc'),_0x9833('0xd'),_0x9833('0xe'),_0x9833('0xf'),'Sms',_0x9833('0x10'),_0x9833('0x11')];return Promise[_0x9833('0x12')]()[_0x9833('0x4')](function(){var _0x4a3317=_[_0x9833('0x5')](_0x3ec23f,function(_0x582107){return getQueuesByChannel(_0x299f88,_0x582107);});return Promise['all'](_0x4a3317);})[_0x9833('0x13')](function(_0x13b16f){throw _0x13b16f;});}}});}; \ No newline at end of file +var _0xbf2f=['Queues','then','setDataValue','exports','define','Chat','Fax','Mail','Sms','Voice','resolve','map','catch','lodash','./team.attributes'];(function(_0x1545d9,_0x58519d){var _0x5ec577=function(_0x67f707){while(--_0x67f707){_0x1545d9['push'](_0x1545d9['shift']());}};_0x5ec577(++_0x58519d);}(_0xbf2f,0x85));var _0xfbf2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xbf2f[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xfbf2('0x0'));var attributes=require(_0xfbf2('0x1'));function getQueuesByChannel(_0x1c008b,_0x2d846d){var _0x36ab71='get'+_0x2d846d+_0xfbf2('0x2');return _0x1c008b[_0x36ab71]()[_0xfbf2('0x3')](function(_0x4021de){return _['map'](_0x4021de,function(_0x128c93){_0x128c93[_0xfbf2('0x4')]('channel',_0x2d846d);return _0x128c93;});})['catch'](function(_0x416397){throw _0x416397;});}module[_0xfbf2('0x5')]=function(_0x3e6056){return _0x3e6056[_0xfbf2('0x6')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0xbae545=this;var _0x1f3a4f=[_0xfbf2('0x7'),_0xfbf2('0x8'),_0xfbf2('0x9'),'Openchannel',_0xfbf2('0xa'),_0xfbf2('0xb'),'Whatsapp'];return Promise[_0xfbf2('0xc')]()[_0xfbf2('0x3')](function(){var _0x2568d9=_[_0xfbf2('0xd')](_0x1f3a4f,function(_0x56dbb3){return getQueuesByChannel(_0xbae545,_0x56dbb3);});return Promise['all'](_0x2568d9);})[_0xfbf2('0xe')](function(_0x274816){throw _0x274816;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index c5bda4f..8b8c652 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 _0x86fd=['rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./team.socket','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2bdf70,_0x26d84b){var _0x5c0ea0=function(_0x226845){while(--_0x226845){_0x2bdf70['push'](_0x2bdf70['shift']());}};_0x5c0ea0(++_0x26d84b);}(_0x86fd,0xe0));var _0xd86f=function(_0x29e3b6,_0x40b0b4){_0x29e3b6=_0x29e3b6-0x0;var _0x55d4b0=_0x86fd[_0x29e3b6];return _0x55d4b0;};'use strict';var _=require(_0xd86f('0x0'));var util=require(_0xd86f('0x1'));var moment=require(_0xd86f('0x2'));var BPromise=require('bluebird');var rs=require(_0xd86f('0x3'));var fs=require('fs');var Redis=require(_0xd86f('0x4'));var db=require(_0xd86f('0x5'))['db'];var utils=require(_0xd86f('0x6'));var logger=require(_0xd86f('0x7'))(_0xd86f('0x8'));var config=require(_0xd86f('0x9'));var jayson=require(_0xd86f('0xa'));var client=jayson[_0xd86f('0xb')][_0xd86f('0xc')]({'port':0x232a});config[_0xd86f('0xd')]=_['defaults'](config[_0xd86f('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xd86f('0xe'))(new Redis(config['redis']));require(_0xd86f('0xf'))[_0xd86f('0x10')](socket);function respondWithRpcPromise(_0x28a6e9,_0x27347b,_0x316713){return new BPromise(function(_0x4ba861,_0x395df8){return client['request'](_0x28a6e9,_0x316713)[_0xd86f('0x11')](function(_0x577f01){logger[_0xd86f('0x12')](_0xd86f('0x13'),_0x27347b,_0xd86f('0x14'));logger[_0xd86f('0x15')](_0xd86f('0x16'),_0x27347b,_0xd86f('0x14'),JSON[_0xd86f('0x17')](_0x577f01));if(_0x577f01[_0xd86f('0x18')]){if(_0x577f01[_0xd86f('0x18')][_0xd86f('0x19')]===0x1f4){logger[_0xd86f('0x18')](_0xd86f('0x13'),_0x27347b,_0x577f01[_0xd86f('0x18')][_0xd86f('0x1a')]);return _0x395df8(_0x577f01[_0xd86f('0x18')][_0xd86f('0x1a')]);}logger['error'](_0xd86f('0x13'),_0x27347b,_0x577f01[_0xd86f('0x18')][_0xd86f('0x1a')]);return _0x4ba861(_0x577f01[_0xd86f('0x18')][_0xd86f('0x1a')]);}else{logger['info'](_0xd86f('0x13'),_0x27347b,'request\x20sent');_0x4ba861(_0x577f01[_0xd86f('0x1b')][_0xd86f('0x1a')]);}})[_0xd86f('0x1c')](function(_0x5e5f03){logger[_0xd86f('0x18')](_0xd86f('0x13'),_0x27347b,_0x5e5f03);_0x395df8(_0x5e5f03);});});} \ No newline at end of file +var _0x5d8e=['socket.io-emitter','./team.socket','then','info','request\x20sent','debug','error','code','Team,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x5d8e,0x140));var _0xe5d8=function(_0x765b02,_0x1c6234){_0x765b02=_0x765b02-0x0;var _0x317a79=_0x5d8e[_0x765b02];return _0x317a79;};'use strict';var _=require('lodash');var util=require(_0xe5d8('0x0'));var moment=require(_0xe5d8('0x1'));var BPromise=require(_0xe5d8('0x2'));var rs=require(_0xe5d8('0x3'));var fs=require('fs');var Redis=require(_0xe5d8('0x4'));var db=require(_0xe5d8('0x5'))['db'];var utils=require(_0xe5d8('0x6'));var logger=require(_0xe5d8('0x7'))(_0xe5d8('0x8'));var config=require(_0xe5d8('0x9'));var jayson=require(_0xe5d8('0xa'));var client=jayson[_0xe5d8('0xb')][_0xe5d8('0xc')]({'port':0x232a});config[_0xe5d8('0xd')]=_[_0xe5d8('0xe')](config[_0xe5d8('0xd')],{'host':_0xe5d8('0xf'),'port':0x18eb});var socket=require(_0xe5d8('0x10'))(new Redis(config[_0xe5d8('0xd')]));require(_0xe5d8('0x11'))['register'](socket);function respondWithRpcPromise(_0xfaac99,_0x5953ea,_0x2f56ef){return new BPromise(function(_0x5a74fd,_0x48c4c6){return client['request'](_0xfaac99,_0x2f56ef)[_0xe5d8('0x12')](function(_0x1a064d){logger[_0xe5d8('0x13')]('Team,\x20%s,\x20%s',_0x5953ea,_0xe5d8('0x14'));logger[_0xe5d8('0x15')]('Team,\x20%s,\x20%s,\x20%s',_0x5953ea,_0xe5d8('0x14'),JSON['stringify'](_0x1a064d));if(_0x1a064d[_0xe5d8('0x16')]){if(_0x1a064d['error'][_0xe5d8('0x17')]===0x1f4){logger[_0xe5d8('0x16')](_0xe5d8('0x18'),_0x5953ea,_0x1a064d[_0xe5d8('0x16')][_0xe5d8('0x19')]);return _0x48c4c6(_0x1a064d[_0xe5d8('0x16')][_0xe5d8('0x19')]);}logger[_0xe5d8('0x16')](_0xe5d8('0x18'),_0x5953ea,_0x1a064d[_0xe5d8('0x16')][_0xe5d8('0x19')]);return _0x5a74fd(_0x1a064d[_0xe5d8('0x16')][_0xe5d8('0x19')]);}else{logger[_0xe5d8('0x13')](_0xe5d8('0x18'),_0x5953ea,_0xe5d8('0x14'));_0x5a74fd(_0x1a064d[_0xe5d8('0x1a')][_0xe5d8('0x19')]);}})[_0xe5d8('0x1b')](function(_0x1b50b1){logger[_0xe5d8('0x16')](_0xe5d8('0x18'),_0x5953ea,_0x1b50b1);_0x48c4c6(_0x1b50b1);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 71db9a1..7d6d707 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 _0x0286=['team:','save','remove','update','emit','register','length'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x0286,0x7f));var _0x6028=function(_0x413487,_0x5431b3){_0x413487=_0x413487-0x0;var _0x594923=_0x0286[_0x413487];return _0x594923;};'use strict';var TeamEvents=require('./team.events');var events=[_0x6028('0x0'),_0x6028('0x1'),_0x6028('0x2')];function createListener(_0x368bdb,_0x56dac2){return function(_0xaa875f){_0x56dac2[_0x6028('0x3')](_0x368bdb,_0xaa875f);};}function removeListener(_0x13469c,_0x18aedc){return function(){TeamEvents['removeListener'](_0x13469c,_0x18aedc);};}exports[_0x6028('0x4')]=function(_0x4b9b65){for(var _0x398959=0x0,_0x22cd7f=events[_0x6028('0x5')];_0x398959<_0x22cd7f;_0x398959++){var _0xa0bf1a=events[_0x398959];var _0x560d1a=createListener(_0x6028('0x6')+_0xa0bf1a,_0x4b9b65);TeamEvents['on'](_0xa0bf1a,_0x560d1a);}}; \ No newline at end of file +var _0x287b=['register','length','team:','./team.events','remove','update','emit'];(function(_0x51d105,_0x2cbd1b){var _0x132946=function(_0x14a28b){while(--_0x14a28b){_0x51d105['push'](_0x51d105['shift']());}};_0x132946(++_0x2cbd1b);}(_0x287b,0x96));var _0xb287=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x287b[_0x3cfb0d];return _0x3486b4;};'use strict';var TeamEvents=require(_0xb287('0x0'));var events=['save',_0xb287('0x1'),_0xb287('0x2')];function createListener(_0xd029b9,_0x5bd0fc){return function(_0x485a03){_0x5bd0fc[_0xb287('0x3')](_0xd029b9,_0x485a03);};}function removeListener(_0x5a5711,_0x37b46a){return function(){TeamEvents['removeListener'](_0x5a5711,_0x37b46a);};}exports[_0xb287('0x4')]=function(_0xc6c172){for(var _0x130648=0x0,_0x3b442a=events[_0xb287('0x5')];_0x130648<_0x3b442a;_0x130648++){var _0x1fcbd7=events[_0x130648];var _0x2a5111=createListener(_0xb287('0x6')+_0x1fcbd7,_0xc6c172);TeamEvents['on'](_0x1fcbd7,_0x2a5111);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 53292a9..1030b29 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 _0x5d40=['INTEGER','sequelize','exports'];(function(_0x77f8ee,_0x2edbd2){var _0x14afc6=function(_0x2d80ed){while(--_0x2d80ed){_0x77f8ee['push'](_0x77f8ee['shift']());}};_0x14afc6(++_0x2edbd2);}(_0x5d40,0x1a2));var _0x05d4=function(_0x1625e5,_0x59ce20){_0x1625e5=_0x1625e5-0x0;var _0x110154=_0x5d40[_0x1625e5];return _0x110154;};'use strict';var Sequelize=require(_0x05d4('0x0'));module[_0x05d4('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x05d4('0x2')]}}; \ No newline at end of file +var _0x7914=['exports','INTEGER','sequelize'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0x7914,0x107));var _0x4791=function(_0x4cda9f,_0x1c4b00){_0x4cda9f=_0x4cda9f-0x0;var _0x3c5b24=_0x7914[_0x4cda9f];return _0x3c5b24;};'use strict';var Sequelize=require(_0x4791('0x0'));module[_0x4791('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x4791('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index bcb7f75..65ac2e0 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 _0xe486=['TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./teamVoicePrefix.attributes','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe486,0x6a));var _0x6e48=function(_0x26b2a9,_0x34bf0d){_0x26b2a9=_0x26b2a9-0x0;var _0x54479b=_0xe486[_0x26b2a9];return _0x54479b;};'use strict';var _=require(_0x6e48('0x0'));var util=require(_0x6e48('0x1'));var logger=require(_0x6e48('0x2'))(_0x6e48('0x3'));var moment=require(_0x6e48('0x4'));var BPromise=require(_0x6e48('0x5'));var rp=require(_0x6e48('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6e48('0x7'));var attributes=require(_0x6e48('0x8'));module[_0x6e48('0x9')]=function(_0x404e2f,_0x5e77f1){return _0x404e2f[_0x6e48('0xa')](_0x6e48('0xb'),attributes,{'tableName':_0x6e48('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5269=['lodash','bluebird','request-promise','path','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes'];(function(_0x53fc2f,_0x409dad){var _0x17f3b5=function(_0x18626e){while(--_0x18626e){_0x53fc2f['push'](_0x53fc2f['shift']());}};_0x17f3b5(++_0x409dad);}(_0x5269,0x150));var _0x9526=function(_0x49c153,_0x1d7985){_0x49c153=_0x49c153-0x0;var _0x34b8b9=_0x5269[_0x49c153];return _0x34b8b9;};'use strict';var _=require(_0x9526('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9526('0x1'));var rp=require(_0x9526('0x2'));var fs=require('fs');var path=require(_0x9526('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9526('0x4'));module['exports']=function(_0x15d394,_0x9cf5eb){return _0x15d394[_0x9526('0x5')](_0x9526('0x6'),attributes,{'tableName':_0x9526('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index ed48842..8c023d5 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x6e28cc,_0xe4cd1f){var _0x19e0f6=function(_0x58c05d){while(--_0x58c05d){_0x6e28cc['push'](_0x6e28cc['shift']());}};_0x19e0f6(++_0xe4cd1f);}(_0xe706,0xa3));var _0x6e70=function(_0x200276,_0x3a39b5){_0x200276=_0x200276-0x0;var _0x496325=_0xe706[_0x200276];return _0x496325;};'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(_0x366cd5,_0x10f6ae){var _0x164df6=function(_0x4c9f25){while(--_0x4c9f25){_0x366cd5['push'](_0x366cd5['shift']());}};_0x164df6(++_0x10f6ae);}(_0xe706,0xa3));var _0x6e70=function(_0x3592ab,_0x4f669a){_0x3592ab=_0x3592ab-0x0;var _0x13298a=_0xe706[_0x3592ab];return _0x13298a;};'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/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 6762103..93eda30 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 _0xdf1e=['sequelize','exports'];(function(_0x5856fe,_0x423a6b){var _0x4919d6=function(_0x12350c){while(--_0x12350c){_0x5856fe['push'](_0x5856fe['shift']());}};_0x4919d6(++_0x423a6b);}(_0xdf1e,0x19a));var _0xedf1=function(_0x4bfb42,_0x43e0eb){_0x4bfb42=_0x4bfb42-0x0;var _0x19ac7f=_0xdf1e[_0x4bfb42];return _0x19ac7f;};'use strict';var Sequelize=require(_0xedf1('0x0'));module[_0xedf1('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xf696=['exports','INTEGER'];(function(_0x1d15fc,_0x4b6ce4){var _0x550924=function(_0x436e0c){while(--_0x436e0c){_0x1d15fc['push'](_0x1d15fc['shift']());}};_0x550924(++_0x4b6ce4);}(_0xf696,0x110));var _0x6f69=function(_0x405d8c,_0x38045a){_0x405d8c=_0x405d8c-0x0;var _0x2c7d48=_0xf696[_0x405d8c];return _0x2c7d48;};'use strict';var Sequelize=require('sequelize');module[_0x6f69('0x0')]={'penalty':{'type':Sequelize[_0x6f69('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 50eb360..d80b868 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 _0x7e16=['api','request-promise','rimraf','../../config/environment','exports','define','TeamVoiceQueue','lodash','util','../../config/logger'];(function(_0x5a7944,_0x571b64){var _0x5ea8c7=function(_0x1c234a){while(--_0x1c234a){_0x5a7944['push'](_0x5a7944['shift']());}};_0x5ea8c7(++_0x571b64);}(_0x7e16,0x16f));var _0x67e1=function(_0x16bce5,_0x3bc012){_0x16bce5=_0x16bce5-0x0;var _0x2cd5c9=_0x7e16[_0x16bce5];return _0x2cd5c9;};'use strict';var _=require(_0x67e1('0x0'));var util=require(_0x67e1('0x1'));var logger=require(_0x67e1('0x2'))(_0x67e1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x67e1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67e1('0x5'));var config=require(_0x67e1('0x6'));var attributes=require('./teamVoiceQueue.attributes');module[_0x67e1('0x7')]=function(_0x3b5769,_0x2e0cb9){return _0x3b5769[_0x67e1('0x8')](_0x67e1('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb201=['team_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./teamVoiceQueue.attributes','exports','TeamVoiceQueue'];(function(_0x5cddc0,_0x435d92){var _0x367d53=function(_0x479e03){while(--_0x479e03){_0x5cddc0['push'](_0x5cddc0['shift']());}};_0x367d53(++_0x435d92);}(_0xb201,0x1b1));var _0x1b20=function(_0x547b54,_0x33b195){_0x547b54=_0x547b54-0x0;var _0x190a92=_0xb201[_0x547b54];return _0x190a92;};'use strict';var _=require(_0x1b20('0x0'));var util=require('util');var logger=require(_0x1b20('0x1'))(_0x1b20('0x2'));var moment=require(_0x1b20('0x3'));var BPromise=require(_0x1b20('0x4'));var rp=require(_0x1b20('0x5'));var fs=require('fs');var path=require(_0x1b20('0x6'));var rimraf=require('rimraf');var config=require(_0x1b20('0x7'));var attributes=require(_0x1b20('0x8'));module[_0x1b20('0x9')]=function(_0x4da5a7,_0x29fbc1){return _0x4da5a7['define'](_0x1b20('0xa'),attributes,{'tableName':_0x1b20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 507aca1..32b5409 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 _0x2622=['../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2898d8,_0x4a4686){var _0x37d0b2=function(_0x1ca1a1){while(--_0x1ca1a1){_0x2898d8['push'](_0x2898d8['shift']());}};_0x37d0b2(++_0x4a4686);}(_0x2622,0x179));var _0x2262=function(_0x490d12,_0x3a2734){_0x490d12=_0x490d12-0x0;var _0x1a0210=_0x2622[_0x490d12];return _0x1a0210;};'use strict';var _=require(_0x2262('0x0'));var util=require('util');var moment=require(_0x2262('0x1'));var BPromise=require(_0x2262('0x2'));var rs=require(_0x2262('0x3'));var fs=require('fs');var Redis=require(_0x2262('0x4'));var db=require(_0x2262('0x5'))['db'];var utils=require(_0x2262('0x6'));var logger=require(_0x2262('0x7'))('rpc');var config=require(_0x2262('0x8'));var jayson=require(_0x2262('0x9'));var client=jayson[_0x2262('0xa')][_0x2262('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b9859,_0x56fbc6,_0x6c76e4){return new BPromise(function(_0x4c7da9,_0x3cb86d){return client[_0x2262('0xc')](_0x2b9859,_0x6c76e4)[_0x2262('0xd')](function(_0x578981){logger[_0x2262('0xe')](_0x2262('0xf'),_0x56fbc6,'request\x20sent');logger[_0x2262('0x10')](_0x2262('0x11'),_0x56fbc6,_0x2262('0x12'),JSON['stringify'](_0x578981));if(_0x578981[_0x2262('0x13')]){if(_0x578981['error'][_0x2262('0x14')]===0x1f4){logger['error'](_0x2262('0xf'),_0x56fbc6,_0x578981[_0x2262('0x13')][_0x2262('0x15')]);return _0x3cb86d(_0x578981['error']['message']);}logger[_0x2262('0x13')](_0x2262('0xf'),_0x56fbc6,_0x578981[_0x2262('0x13')][_0x2262('0x15')]);return _0x4c7da9(_0x578981['error']['message']);}else{logger[_0x2262('0xe')](_0x2262('0xf'),_0x56fbc6,_0x2262('0x12'));_0x4c7da9(_0x578981[_0x2262('0x16')][_0x2262('0x15')]);}})[_0x2262('0x17')](function(_0x33e9e4){logger[_0x2262('0x13')](_0x2262('0xf'),_0x56fbc6,_0x33e9e4);_0x3cb86d(_0x33e9e4);});});} \ No newline at end of file +var _0x2ec0=['jayson/promise','client','request','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2e63bb,_0x4a045b){var _0x655792=function(_0x2319bd){while(--_0x2319bd){_0x2e63bb['push'](_0x2e63bb['shift']());}};_0x655792(++_0x4a045b);}(_0x2ec0,0x69));var _0x02ec=function(_0x2cf2e9,_0xd58ea1){_0x2cf2e9=_0x2cf2e9-0x0;var _0xd3670d=_0x2ec0[_0x2cf2e9];return _0xd3670d;};'use strict';var _=require(_0x02ec('0x0'));var util=require(_0x02ec('0x1'));var moment=require(_0x02ec('0x2'));var BPromise=require(_0x02ec('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02ec('0x4'));var db=require(_0x02ec('0x5'))['db'];var utils=require(_0x02ec('0x6'));var logger=require(_0x02ec('0x7'))(_0x02ec('0x8'));var config=require(_0x02ec('0x9'));var jayson=require(_0x02ec('0xa'));var client=jayson[_0x02ec('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3da01f,_0x33ab31,_0x4898d2){return new BPromise(function(_0xbb651d,_0x3f34a2){return client[_0x02ec('0xc')](_0x3da01f,_0x4898d2)['then'](function(_0x1180b9){logger['info'](_0x02ec('0xd'),_0x33ab31,_0x02ec('0xe'));logger[_0x02ec('0xf')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x33ab31,_0x02ec('0xe'),JSON[_0x02ec('0x10')](_0x1180b9));if(_0x1180b9[_0x02ec('0x11')]){if(_0x1180b9[_0x02ec('0x11')][_0x02ec('0x12')]===0x1f4){logger[_0x02ec('0x11')](_0x02ec('0xd'),_0x33ab31,_0x1180b9['error'][_0x02ec('0x13')]);return _0x3f34a2(_0x1180b9['error'][_0x02ec('0x13')]);}logger[_0x02ec('0x11')](_0x02ec('0xd'),_0x33ab31,_0x1180b9['error'][_0x02ec('0x13')]);return _0xbb651d(_0x1180b9[_0x02ec('0x11')][_0x02ec('0x13')]);}else{logger[_0x02ec('0x14')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33ab31,_0x02ec('0xe'));_0xbb651d(_0x1180b9[_0x02ec('0x15')][_0x02ec('0x13')]);}})[_0x02ec('0x16')](function(_0x2747c7){logger[_0x02ec('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x33ab31,_0x2747c7);_0x3f34a2(_0x2747c7);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 5c425ba..733c8a2 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 _0xcaaf=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','destroy','exports','multer','path'];(function(_0x1b1a61,_0x50277f){var _0x2c09b1=function(_0x363c56){while(--_0x363c56){_0x1b1a61['push'](_0x1b1a61['shift']());}};_0x2c09b1(++_0x50277f);}(_0xcaaf,0x66));var _0xfcaa=function(_0x3bea29,_0x47c1b0){_0x3bea29=_0x3bea29-0x0;var _0x47445d=_0xcaaf[_0x3bea29];return _0x47445d;};'use strict';var multer=require(_0xfcaa('0x0'));var util=require('util');var path=require(_0xfcaa('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfcaa('0x2')]();var fs_extra=require(_0xfcaa('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfcaa('0x4'));var config=require('../../config/environment');var controller=require('./template.controller');router[_0xfcaa('0x5')]('/',auth[_0xfcaa('0x6')](),controller[_0xfcaa('0x7')]);router[_0xfcaa('0x5')](_0xfcaa('0x8'),auth[_0xfcaa('0x6')](),controller[_0xfcaa('0x9')]);router['post']('/',auth[_0xfcaa('0x6')](),controller['create']);router[_0xfcaa('0xa')]('/:id',auth[_0xfcaa('0x6')](),controller['update']);router['delete'](_0xfcaa('0x8'),auth['isAuthenticated'](),controller[_0xfcaa('0xb')]);module[_0xfcaa('0xc')]=router; \ No newline at end of file +var _0x556a=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./template.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','multer','util','path'];(function(_0x9341df,_0x5e689a){var _0x30f5df=function(_0x5c30ca){while(--_0x5c30ca){_0x9341df['push'](_0x9341df['shift']());}};_0x30f5df(++_0x5e689a);}(_0x556a,0x1dd));var _0xa556=function(_0xcdf752,_0x51b609){_0xcdf752=_0xcdf752-0x0;var _0x21448e=_0x556a[_0xcdf752];return _0x21448e;};'use strict';var multer=require(_0xa556('0x0'));var util=require(_0xa556('0x1'));var path=require(_0xa556('0x2'));var timeout=require(_0xa556('0x3'));var express=require(_0xa556('0x4'));var router=express[_0xa556('0x5')]();var fs_extra=require(_0xa556('0x6'));var auth=require(_0xa556('0x7'));var interaction=require(_0xa556('0x8'));var config=require('../../config/environment');var controller=require(_0xa556('0x9'));router[_0xa556('0xa')]('/',auth[_0xa556('0xb')](),controller[_0xa556('0xc')]);router[_0xa556('0xa')]('/:id',auth[_0xa556('0xb')](),controller[_0xa556('0xd')]);router[_0xa556('0xe')]('/',auth[_0xa556('0xb')](),controller['create']);router[_0xa556('0xf')](_0xa556('0x10'),auth[_0xa556('0xb')](),controller[_0xa556('0x11')]);router[_0xa556('0x12')](_0xa556('0x10'),auth[_0xa556('0xb')](),controller[_0xa556('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 0ed1359..bf9197f 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 _0x8e57=['sequelize','exports','STRING'];(function(_0x220e9f,_0x2b482b){var _0x284091=function(_0x1f408d){while(--_0x1f408d){_0x220e9f['push'](_0x220e9f['shift']());}};_0x284091(++_0x2b482b);}(_0x8e57,0xd8));var _0x78e5=function(_0x1dec45,_0x54b428){_0x1dec45=_0x1dec45-0x0;var _0x4524ae=_0x8e57[_0x1dec45];return _0x4524ae;};'use strict';var Sequelize=require(_0x78e5('0x0'));module[_0x78e5('0x1')]={'name':{'type':Sequelize[_0x78e5('0x2')]},'description':{'type':Sequelize[_0x78e5('0x2')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xcf5a=['exports','STRING','TEXT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xcf5a,0xa5));var _0xacf5=function(_0x40b6cc,_0xefdcc5){_0x40b6cc=_0x40b6cc-0x0;var _0x566d9d=_0xcf5a[_0x40b6cc];return _0x566d9d;};'use strict';var Sequelize=require('sequelize');module[_0xacf5('0x0')]={'name':{'type':Sequelize[_0xacf5('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xacf5('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 30509f1..87cb1f9 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 _0xfc54=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','get','Templates','then','end','sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Template','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xfc54,0x1a9));var _0x4fc5=function(_0xb6afe,_0x38671f){_0xb6afe=_0xb6afe-0x0;var _0x335218=_0xfc54[_0xb6afe];return _0x335218;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fc5('0x0'));var zipdir=require(_0x4fc5('0x1'));var jsonpatch=require(_0x4fc5('0x2'));var rp=require(_0x4fc5('0x3'));var moment=require(_0x4fc5('0x4'));var BPromise=require(_0x4fc5('0x5'));var Mustache=require(_0x4fc5('0x6'));var util=require(_0x4fc5('0x7'));var path=require(_0x4fc5('0x8'));var sox=require(_0x4fc5('0x9'));var csv=require(_0x4fc5('0xa'));var ejs=require(_0x4fc5('0xb'));var fs=require('fs');var fs_extra=require(_0x4fc5('0xc'));var _=require(_0x4fc5('0xd'));var squel=require(_0x4fc5('0xe'));var crypto=require(_0x4fc5('0xf'));var jsforce=require(_0x4fc5('0x10'));var deskjs=require(_0x4fc5('0x11'));var toCsv=require(_0x4fc5('0xa'));var querystring=require(_0x4fc5('0x12'));var Papa=require(_0x4fc5('0x13'));var Redis=require(_0x4fc5('0x14'));var authService=require(_0x4fc5('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4fc5('0x16'));var logger=require(_0x4fc5('0x17'))(_0x4fc5('0x18'));var utils=require(_0x4fc5('0x19'));var config=require(_0x4fc5('0x1a'));var licenseUtil=require(_0x4fc5('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x22847f,_0x579d49){_0x579d49=_0x579d49||0xcc;return function(_0x1ea74a){if(_0x1ea74a){return _0x22847f['sendStatus'](_0x579d49);}return _0x22847f[_0x4fc5('0x1c')](_0x579d49)['end']();};}function respondWithResult(_0x223772,_0x5a12a5){_0x5a12a5=_0x5a12a5||0xc8;return function(_0x4d1d71){if(_0x4d1d71){return _0x223772[_0x4fc5('0x1c')](_0x5a12a5)[_0x4fc5('0x1d')](_0x4d1d71);}};}function respondWithFilteredResult(_0x5bdc87,_0x443aef){return function(_0x37f60b){if(_0x37f60b){var _0x5609f4=typeof _0x443aef[_0x4fc5('0x1e')]===_0x4fc5('0x1f')&&typeof _0x443aef[_0x4fc5('0x20')]===_0x4fc5('0x1f');var _0x29bcab=_0x37f60b['count'];var _0x6ada1=_0x5609f4?0x0:_0x443aef[_0x4fc5('0x1e')];var _0x99bc05=_0x5609f4?_0x37f60b[_0x4fc5('0x21')]:_0x443aef[_0x4fc5('0x1e')]+_0x443aef['limit'];var _0x3826d1;if(_0x99bc05>=_0x29bcab){_0x99bc05=_0x29bcab;_0x3826d1=0xc8;}else{_0x3826d1=0xce;}_0x5bdc87[_0x4fc5('0x1c')](_0x3826d1);return _0x5bdc87[_0x4fc5('0x22')]('Content-Range',_0x6ada1+'-'+_0x99bc05+'/'+_0x29bcab)['json'](_0x37f60b);}return null;};}function patchUpdates(_0x4ea261){return function(_0x2564c4){try{jsonpatch[_0x4fc5('0x23')](_0x2564c4,_0x4ea261,!![]);}catch(_0x2d772e){return BPromise[_0x4fc5('0x24')](_0x2d772e);}return _0x2564c4[_0x4fc5('0x25')]();};}function saveUpdates(_0x43ca76,_0x1b3af3){return function(_0x1421d3){if(_0x1421d3){return _0x1421d3['update'](_0x43ca76)['then'](function(_0x46f22d){return _0x46f22d;});}return null;};}function removeEntity(_0x58820c,_0x2698ce){return function(_0x409ef3){if(_0x409ef3){return _0x409ef3[_0x4fc5('0x26')]()['then'](function(){var _0x353fe5=_0x409ef3[_0x4fc5('0x27')]({'plain':!![]});var _0x58d806=_0x4fc5('0x28');return db['UserProfileResource'][_0x4fc5('0x26')]({'where':{'type':_0x58d806,'resourceId':_0x353fe5['id']}})[_0x4fc5('0x29')](function(){return _0x409ef3;});})['then'](function(){_0x58820c[_0x4fc5('0x1c')](0xcc)[_0x4fc5('0x2a')]();});}};}function handleEntityNotFound(_0x29a83a,_0x5b4df4){return function(_0xc47b80){if(!_0xc47b80){_0x29a83a[_0x4fc5('0x2b')](0x194);}return _0xc47b80;};}function handleError(_0x6cdfb,_0x4e9a51){_0x4e9a51=_0x4e9a51||0x1f4;return function(_0x1c4b37){logger[_0x4fc5('0x2c')](_0x1c4b37[_0x4fc5('0x2d')]);if(_0x1c4b37[_0x4fc5('0x2e')]){delete _0x1c4b37[_0x4fc5('0x2e')];}_0x6cdfb[_0x4fc5('0x1c')](_0x4e9a51)['send'](_0x1c4b37);};}exports[_0x4fc5('0x2f')]=function(_0x2e5cc8,_0x1ee36d){var _0x6483b2={},_0xc91afe={},_0x2af8a6={'count':0x0,'rows':[]};var _0x4ca0bc=_[_0x4fc5('0x30')](db['Template'][_0x4fc5('0x31')],function(_0x157d59){return{'name':_0x157d59['fieldName'],'type':_0x157d59[_0x4fc5('0x32')][_0x4fc5('0x33')]};});_0xc91afe[_0x4fc5('0x34')]=_['map'](_0x4ca0bc,_0x4fc5('0x2e'));_0xc91afe[_0x4fc5('0x35')]=_['keys'](_0x2e5cc8[_0x4fc5('0x35')]);_0xc91afe[_0x4fc5('0x36')]=_[_0x4fc5('0x37')](_0xc91afe['model'],_0xc91afe[_0x4fc5('0x35')]);_0x6483b2['attributes']=_['intersection'](_0xc91afe['model'],qs[_0x4fc5('0x38')](_0x2e5cc8[_0x4fc5('0x35')]['fields']));_0x6483b2[_0x4fc5('0x39')]=_0x6483b2[_0x4fc5('0x39')][_0x4fc5('0x3a')]?_0x6483b2[_0x4fc5('0x39')]:_0xc91afe[_0x4fc5('0x34')];if(!_0x2e5cc8[_0x4fc5('0x35')][_0x4fc5('0x3b')](_0x4fc5('0x3c'))){_0x6483b2[_0x4fc5('0x20')]=qs[_0x4fc5('0x20')](_0x2e5cc8[_0x4fc5('0x35')][_0x4fc5('0x20')]);_0x6483b2[_0x4fc5('0x1e')]=qs['offset'](_0x2e5cc8['query'][_0x4fc5('0x1e')]);}_0x6483b2['order']=qs['sort'](_0x2e5cc8[_0x4fc5('0x35')][_0x4fc5('0x3d')]);_0x6483b2[_0x4fc5('0x3e')]=qs[_0x4fc5('0x36')](_['pick'](_0x2e5cc8[_0x4fc5('0x35')],_0xc91afe[_0x4fc5('0x36')]),_0x4ca0bc);if(_0x2e5cc8['query'][_0x4fc5('0x3f')]){_0x6483b2[_0x4fc5('0x3e')]=_[_0x4fc5('0x40')](_0x6483b2[_0x4fc5('0x3e')],{'$or':_[_0x4fc5('0x30')](_0x4ca0bc,function(_0x2d6fdb){if(_0x2d6fdb['type']!==_0x4fc5('0x41')){var _0x8c42d3={};_0x8c42d3[_0x2d6fdb[_0x4fc5('0x2e')]]={'$like':'%'+_0x2e5cc8[_0x4fc5('0x35')][_0x4fc5('0x3f')]+'%'};return _0x8c42d3;}})});}_0x6483b2=_[_0x4fc5('0x40')]({},_0x6483b2,_0x2e5cc8[_0x4fc5('0x42')]);var _0x54a713={'where':_0x6483b2[_0x4fc5('0x3e')]};return db[_0x4fc5('0x43')][_0x4fc5('0x21')](_0x54a713)[_0x4fc5('0x29')](function(_0x59e9c4){_0x2af8a6['count']=_0x59e9c4;if(_0x2e5cc8[_0x4fc5('0x35')][_0x4fc5('0x44')]){_0x6483b2[_0x4fc5('0x45')]=[{'all':!![]}];}return db[_0x4fc5('0x43')][_0x4fc5('0x46')](_0x6483b2);})[_0x4fc5('0x29')](function(_0x5d8084){_0x2af8a6[_0x4fc5('0x47')]=_0x5d8084;return _0x2af8a6;})[_0x4fc5('0x29')](respondWithFilteredResult(_0x1ee36d,_0x6483b2))[_0x4fc5('0x48')](handleError(_0x1ee36d,null));};exports[_0x4fc5('0x49')]=function(_0x2f4544,_0x199e9a){var _0x299e3e={'raw':!![],'where':{'id':_0x2f4544[_0x4fc5('0x4a')]['id']}},_0x55b4e4={};_0x55b4e4[_0x4fc5('0x34')]=_[_0x4fc5('0x4b')](db[_0x4fc5('0x43')][_0x4fc5('0x31')]);_0x55b4e4[_0x4fc5('0x35')]=_[_0x4fc5('0x4b')](_0x2f4544[_0x4fc5('0x35')]);_0x55b4e4[_0x4fc5('0x36')]=_['intersection'](_0x55b4e4[_0x4fc5('0x34')],_0x55b4e4['query']);_0x299e3e['attributes']=_['intersection'](_0x55b4e4[_0x4fc5('0x34')],qs[_0x4fc5('0x38')](_0x2f4544['query'][_0x4fc5('0x38')]));_0x299e3e[_0x4fc5('0x39')]=_0x299e3e['attributes']['length']?_0x299e3e[_0x4fc5('0x39')]:_0x55b4e4[_0x4fc5('0x34')];if(_0x2f4544[_0x4fc5('0x35')][_0x4fc5('0x44')]){_0x299e3e[_0x4fc5('0x45')]=[{'all':!![]}];}_0x299e3e=_['merge']({},_0x299e3e,_0x2f4544[_0x4fc5('0x42')]);return db[_0x4fc5('0x43')][_0x4fc5('0x4c')](_0x299e3e)[_0x4fc5('0x29')](handleEntityNotFound(_0x199e9a,null))[_0x4fc5('0x29')](respondWithResult(_0x199e9a,null))['catch'](handleError(_0x199e9a,null));};exports[_0x4fc5('0x4d')]=function(_0x46ffce,_0x3fa6a3){return db[_0x4fc5('0x43')][_0x4fc5('0x4d')](_0x46ffce[_0x4fc5('0x4e')],{})[_0x4fc5('0x29')](function(_0x1c5226){var _0xc57da9=_0x46ffce[_0x4fc5('0x4f')][_0x4fc5('0x27')]({'plain':!![]});if(!_0xc57da9)throw new Error(_0x4fc5('0x50'));if(_0xc57da9[_0x4fc5('0x51')]==='user'){var _0x1e82c7=_0x1c5226[_0x4fc5('0x27')]({'plain':!![]});var _0x3e022a=_0x4fc5('0x28');return db['UserProfileSection'][_0x4fc5('0x4c')]({'where':{'name':_0x3e022a,'userProfileId':_0xc57da9[_0x4fc5('0x52')]},'raw':!![]})[_0x4fc5('0x29')](function(_0x3c872f){if(_0x3c872f&&_0x3c872f['autoAssociation']===0x0){return db[_0x4fc5('0x53')][_0x4fc5('0x4d')]({'name':_0x1e82c7['name'],'resourceId':_0x1e82c7['id'],'type':_0x3c872f['name'],'sectionId':_0x3c872f['id']},{})[_0x4fc5('0x29')](function(){return _0x1c5226;});}else{return _0x1c5226;}})[_0x4fc5('0x48')](function(_0x560705){logger[_0x4fc5('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560705);throw _0x560705;});}return _0x1c5226;})[_0x4fc5('0x29')](respondWithResult(_0x3fa6a3,0xc9))[_0x4fc5('0x48')](handleError(_0x3fa6a3,null));};exports['update']=function(_0x4e7efe,_0x28e12a){if(_0x4e7efe[_0x4fc5('0x4e')]['id']){delete _0x4e7efe[_0x4fc5('0x4e')]['id'];}return db[_0x4fc5('0x43')][_0x4fc5('0x4c')]({'where':{'id':_0x4e7efe['params']['id']}})[_0x4fc5('0x29')](handleEntityNotFound(_0x28e12a,null))[_0x4fc5('0x29')](saveUpdates(_0x4e7efe[_0x4fc5('0x4e')],null))[_0x4fc5('0x29')](respondWithResult(_0x28e12a,null))[_0x4fc5('0x48')](handleError(_0x28e12a,null));};exports[_0x4fc5('0x26')]=function(_0x5af41f,_0x2daeb6){return db[_0x4fc5('0x43')][_0x4fc5('0x4c')]({'where':{'id':_0x5af41f[_0x4fc5('0x4a')]['id']}})[_0x4fc5('0x29')](handleEntityNotFound(_0x2daeb6,null))[_0x4fc5('0x29')](removeEntity(_0x2daeb6,null))['catch'](handleError(_0x2daeb6,null));}; \ No newline at end of file +var _0x29e9=['Template','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','where','filters','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','autoAssociation','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','squel','crypto','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map'];(function(_0x1f8c74,_0x484f95){var _0x1daf66=function(_0x4a21e1){while(--_0x4a21e1){_0x1f8c74['push'](_0x1f8c74['shift']());}};_0x1daf66(++_0x484f95);}(_0x29e9,0x1ba));var _0x929e=function(_0x3acd36,_0x31a9c5){_0x3acd36=_0x3acd36-0x0;var _0x463cf4=_0x29e9[_0x3acd36];return _0x463cf4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x929e('0x0'));var zipdir=require(_0x929e('0x1'));var jsonpatch=require(_0x929e('0x2'));var rp=require(_0x929e('0x3'));var moment=require(_0x929e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x929e('0x5'));var util=require('util');var path=require(_0x929e('0x6'));var sox=require(_0x929e('0x7'));var csv=require('to-csv');var ejs=require(_0x929e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x929e('0x9'));var crypto=require(_0x929e('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x929e('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x929e('0xc'));var as=require(_0x929e('0xd'));var hardwareService=require(_0x929e('0xe'));var logger=require(_0x929e('0xf'))(_0x929e('0x10'));var utils=require(_0x929e('0x11'));var config=require(_0x929e('0x12'));var licenseUtil=require(_0x929e('0x13'));var db=require(_0x929e('0x14'))['db'];function respondWithStatusCode(_0x12ecd5,_0x27b4ad){_0x27b4ad=_0x27b4ad||0xcc;return function(_0x6cc478){if(_0x6cc478){return _0x12ecd5[_0x929e('0x15')](_0x27b4ad);}return _0x12ecd5[_0x929e('0x16')](_0x27b4ad)[_0x929e('0x17')]();};}function respondWithResult(_0x12de2c,_0x195d0a){_0x195d0a=_0x195d0a||0xc8;return function(_0x5b85b2){if(_0x5b85b2){return _0x12de2c[_0x929e('0x16')](_0x195d0a)[_0x929e('0x18')](_0x5b85b2);}};}function respondWithFilteredResult(_0x47262b,_0x4acc4f){return function(_0x540e94){if(_0x540e94){var _0x18b56d=typeof _0x4acc4f[_0x929e('0x19')]==='undefined'&&typeof _0x4acc4f[_0x929e('0x1a')]===_0x929e('0x1b');var _0x4c2608=_0x540e94['count'];var _0x577391=_0x18b56d?0x0:_0x4acc4f[_0x929e('0x19')];var _0x2e43ea=_0x18b56d?_0x540e94[_0x929e('0x1c')]:_0x4acc4f['offset']+_0x4acc4f['limit'];var _0xbed77d;if(_0x2e43ea>=_0x4c2608){_0x2e43ea=_0x4c2608;_0xbed77d=0xc8;}else{_0xbed77d=0xce;}_0x47262b[_0x929e('0x16')](_0xbed77d);return _0x47262b[_0x929e('0x1d')](_0x929e('0x1e'),_0x577391+'-'+_0x2e43ea+'/'+_0x4c2608)['json'](_0x540e94);}return null;};}function patchUpdates(_0x4d9d3c){return function(_0x5d5d75){try{jsonpatch['apply'](_0x5d5d75,_0x4d9d3c,!![]);}catch(_0x4ba2ac){return BPromise[_0x929e('0x1f')](_0x4ba2ac);}return _0x5d5d75[_0x929e('0x20')]();};}function saveUpdates(_0x44ab56,_0x22d7be){return function(_0x594773){if(_0x594773){return _0x594773[_0x929e('0x21')](_0x44ab56)[_0x929e('0x22')](function(_0x38355c){return _0x38355c;});}return null;};}function removeEntity(_0x41b15b,_0x30bcff){return function(_0x1b05b7){if(_0x1b05b7){return _0x1b05b7[_0x929e('0x23')]()[_0x929e('0x22')](function(){var _0x286c17=_0x1b05b7[_0x929e('0x24')]({'plain':!![]});var _0x59d037='Templates';return db[_0x929e('0x25')][_0x929e('0x23')]({'where':{'type':_0x59d037,'resourceId':_0x286c17['id']}})[_0x929e('0x22')](function(){return _0x1b05b7;});})[_0x929e('0x22')](function(){_0x41b15b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x21f0bd,_0x46b624){return function(_0x4cd37e){if(!_0x4cd37e){_0x21f0bd['sendStatus'](0x194);}return _0x4cd37e;};}function handleError(_0x6d588c,_0x2fdae5){_0x2fdae5=_0x2fdae5||0x1f4;return function(_0x41dab5){logger[_0x929e('0x26')](_0x41dab5[_0x929e('0x27')]);if(_0x41dab5['name']){delete _0x41dab5[_0x929e('0x28')];}_0x6d588c['status'](_0x2fdae5)[_0x929e('0x29')](_0x41dab5);};}exports[_0x929e('0x2a')]=function(_0x719f79,_0x462a89){var _0x4e8783={},_0x3d89ad={},_0x464bb7={'count':0x0,'rows':[]};var _0x23ddef=_[_0x929e('0x2b')](db[_0x929e('0x2c')][_0x929e('0x2d')],function(_0x2cc1cd){return{'name':_0x2cc1cd[_0x929e('0x2e')],'type':_0x2cc1cd['type'][_0x929e('0x2f')]};});_0x3d89ad[_0x929e('0x30')]=_[_0x929e('0x2b')](_0x23ddef,_0x929e('0x28'));_0x3d89ad[_0x929e('0x31')]=_[_0x929e('0x32')](_0x719f79[_0x929e('0x31')]);_0x3d89ad['filters']=_[_0x929e('0x33')](_0x3d89ad[_0x929e('0x30')],_0x3d89ad[_0x929e('0x31')]);_0x4e8783['attributes']=_[_0x929e('0x33')](_0x3d89ad[_0x929e('0x30')],qs[_0x929e('0x34')](_0x719f79[_0x929e('0x31')]['fields']));_0x4e8783[_0x929e('0x35')]=_0x4e8783[_0x929e('0x35')][_0x929e('0x36')]?_0x4e8783[_0x929e('0x35')]:_0x3d89ad[_0x929e('0x30')];if(!_0x719f79['query'][_0x929e('0x37')]('nolimit')){_0x4e8783['limit']=qs['limit'](_0x719f79[_0x929e('0x31')][_0x929e('0x1a')]);_0x4e8783[_0x929e('0x19')]=qs[_0x929e('0x19')](_0x719f79[_0x929e('0x31')][_0x929e('0x19')]);}_0x4e8783['order']=qs['sort'](_0x719f79['query']['sort']);_0x4e8783[_0x929e('0x38')]=qs[_0x929e('0x39')](_[_0x929e('0x3a')](_0x719f79[_0x929e('0x31')],_0x3d89ad[_0x929e('0x39')]),_0x23ddef);if(_0x719f79[_0x929e('0x31')][_0x929e('0x3b')]){_0x4e8783['where']=_[_0x929e('0x3c')](_0x4e8783[_0x929e('0x38')],{'$or':_[_0x929e('0x2b')](_0x23ddef,function(_0x3118d0){if(_0x3118d0[_0x929e('0x3d')]!==_0x929e('0x3e')){var _0x524e27={};_0x524e27[_0x3118d0[_0x929e('0x28')]]={'$like':'%'+_0x719f79[_0x929e('0x31')]['filter']+'%'};return _0x524e27;}})});}_0x4e8783=_[_0x929e('0x3c')]({},_0x4e8783,_0x719f79[_0x929e('0x3f')]);var _0x861dec={'where':_0x4e8783['where']};return db['Template'][_0x929e('0x1c')](_0x861dec)[_0x929e('0x22')](function(_0x321534){_0x464bb7[_0x929e('0x1c')]=_0x321534;if(_0x719f79[_0x929e('0x31')]['includeAll']){_0x4e8783[_0x929e('0x40')]=[{'all':!![]}];}return db['Template'][_0x929e('0x41')](_0x4e8783);})[_0x929e('0x22')](function(_0x311e5b){_0x464bb7[_0x929e('0x42')]=_0x311e5b;return _0x464bb7;})[_0x929e('0x22')](respondWithFilteredResult(_0x462a89,_0x4e8783))['catch'](handleError(_0x462a89,null));};exports[_0x929e('0x43')]=function(_0x46dc90,_0xc5ed59){var _0x324592={'raw':!![],'where':{'id':_0x46dc90[_0x929e('0x44')]['id']}},_0x3f40a6={};_0x3f40a6[_0x929e('0x30')]=_[_0x929e('0x32')](db[_0x929e('0x2c')][_0x929e('0x2d')]);_0x3f40a6[_0x929e('0x31')]=_['keys'](_0x46dc90[_0x929e('0x31')]);_0x3f40a6['filters']=_[_0x929e('0x33')](_0x3f40a6[_0x929e('0x30')],_0x3f40a6[_0x929e('0x31')]);_0x324592[_0x929e('0x35')]=_[_0x929e('0x33')](_0x3f40a6[_0x929e('0x30')],qs[_0x929e('0x34')](_0x46dc90['query'][_0x929e('0x34')]));_0x324592[_0x929e('0x35')]=_0x324592[_0x929e('0x35')][_0x929e('0x36')]?_0x324592['attributes']:_0x3f40a6[_0x929e('0x30')];if(_0x46dc90[_0x929e('0x31')][_0x929e('0x45')]){_0x324592['include']=[{'all':!![]}];}_0x324592=_['merge']({},_0x324592,_0x46dc90['options']);return db[_0x929e('0x2c')][_0x929e('0x46')](_0x324592)[_0x929e('0x22')](handleEntityNotFound(_0xc5ed59,null))[_0x929e('0x22')](respondWithResult(_0xc5ed59,null))[_0x929e('0x47')](handleError(_0xc5ed59,null));};exports[_0x929e('0x48')]=function(_0x287913,_0x5c6cdd){return db[_0x929e('0x2c')][_0x929e('0x48')](_0x287913[_0x929e('0x49')],{})['then'](function(_0x5a05f5){var _0x6916c7=_0x287913['user']['get']({'plain':!![]});if(!_0x6916c7)throw new Error(_0x929e('0x4a'));if(_0x6916c7[_0x929e('0x4b')]===_0x929e('0x4c')){var _0x4b47e9=_0x5a05f5[_0x929e('0x24')]({'plain':!![]});var _0x1ddcec=_0x929e('0x4d');return db[_0x929e('0x4e')]['find']({'where':{'name':_0x1ddcec,'userProfileId':_0x6916c7[_0x929e('0x4f')]},'raw':!![]})['then'](function(_0x246de4){if(_0x246de4&&_0x246de4[_0x929e('0x50')]===0x0){return db[_0x929e('0x25')][_0x929e('0x48')]({'name':_0x4b47e9[_0x929e('0x28')],'resourceId':_0x4b47e9['id'],'type':_0x246de4[_0x929e('0x28')],'sectionId':_0x246de4['id']},{})[_0x929e('0x22')](function(){return _0x5a05f5;});}else{return _0x5a05f5;}})['catch'](function(_0xadc8e5){logger[_0x929e('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xadc8e5);throw _0xadc8e5;});}return _0x5a05f5;})[_0x929e('0x22')](respondWithResult(_0x5c6cdd,0xc9))['catch'](handleError(_0x5c6cdd,null));};exports[_0x929e('0x21')]=function(_0x2420ec,_0x5fea20){if(_0x2420ec[_0x929e('0x49')]['id']){delete _0x2420ec[_0x929e('0x49')]['id'];}return db[_0x929e('0x2c')][_0x929e('0x46')]({'where':{'id':_0x2420ec['params']['id']}})[_0x929e('0x22')](handleEntityNotFound(_0x5fea20,null))[_0x929e('0x22')](saveUpdates(_0x2420ec[_0x929e('0x49')],null))['then'](respondWithResult(_0x5fea20,null))[_0x929e('0x47')](handleError(_0x5fea20,null));};exports[_0x929e('0x23')]=function(_0xe8beb1,_0x2f0a36){return db[_0x929e('0x2c')][_0x929e('0x46')]({'where':{'id':_0xe8beb1[_0x929e('0x44')]['id']}})[_0x929e('0x22')](handleEntityNotFound(_0x2f0a36,null))[_0x929e('0x22')](removeEntity(_0x2f0a36,null))['catch'](handleError(_0x2f0a36,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 425dbcb..6c09fd7 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 _0x11f8=['../../config/environment','./template.attributes','define','Template','tools_templates','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11f8,0x87));var _0x811f=function(_0x356c13,_0x47f4de){_0x356c13=_0x356c13-0x0;var _0x36d9b3=_0x11f8[_0x356c13];return _0x36d9b3;};'use strict';var _=require(_0x811f('0x0'));var util=require(_0x811f('0x1'));var logger=require(_0x811f('0x2'))(_0x811f('0x3'));var moment=require('moment');var BPromise=require(_0x811f('0x4'));var rp=require(_0x811f('0x5'));var fs=require('fs');var path=require(_0x811f('0x6'));var rimraf=require(_0x811f('0x7'));var config=require(_0x811f('0x8'));var attributes=require(_0x811f('0x9'));module['exports']=function(_0x18be86,_0x598284){return _0x18be86[_0x811f('0xa')](_0x811f('0xb'),attributes,{'tableName':_0x811f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x34cd=['tools_templates','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./template.attributes','exports','Template'];(function(_0x23f6e2,_0x5ee063){var _0x255a5e=function(_0x329460){while(--_0x329460){_0x23f6e2['push'](_0x23f6e2['shift']());}};_0x255a5e(++_0x5ee063);}(_0x34cd,0x182));var _0xd34c=function(_0x23d57e,_0x510f80){_0x23d57e=_0x23d57e-0x0;var _0x5b4034=_0x34cd[_0x23d57e];return _0x5b4034;};'use strict';var _=require(_0xd34c('0x0'));var util=require(_0xd34c('0x1'));var logger=require('../../config/logger')(_0xd34c('0x2'));var moment=require(_0xd34c('0x3'));var BPromise=require(_0xd34c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd34c('0x5'));var config=require(_0xd34c('0x6'));var attributes=require(_0xd34c('0x7'));module[_0xd34c('0x8')]=function(_0x2a36ce,_0x18ddea){return _0x2a36ce['define'](_0xd34c('0x9'),attributes,{'tableName':_0xd34c('0xa'),'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 583b666..56a33ca 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 _0x503f=['catch','GetTemplate','findAll','options','raw','where','attributes','limit','include','map','model','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x28b0a4,_0x2ea758){var _0x105ce6=function(_0x6df20f){while(--_0x6df20f){_0x28b0a4['push'](_0x28b0a4['shift']());}};_0x105ce6(++_0x2ea758);}(_0x503f,0x18d));var _0xf503=function(_0x37c56c,_0x4d67fa){_0x37c56c=_0x37c56c-0x0;var _0x4bd3db=_0x503f[_0x37c56c];return _0x4bd3db;};'use strict';var _=require(_0xf503('0x0'));var util=require('util');var moment=require(_0xf503('0x1'));var BPromise=require('bluebird');var rs=require(_0xf503('0x2'));var fs=require('fs');var Redis=require(_0xf503('0x3'));var db=require(_0xf503('0x4'))['db'];var utils=require(_0xf503('0x5'));var logger=require(_0xf503('0x6'))(_0xf503('0x7'));var config=require(_0xf503('0x8'));var jayson=require(_0xf503('0x9'));var client=jayson[_0xf503('0xa')][_0xf503('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28e45c,_0x1e6aef,_0x12deda){return new BPromise(function(_0x80f276,_0x4073e8){return client[_0xf503('0xc')](_0x28e45c,_0x12deda)[_0xf503('0xd')](function(_0xf9d167){logger[_0xf503('0xe')](_0xf503('0xf'),_0x1e6aef,_0xf503('0x10'));logger[_0xf503('0x11')](_0xf503('0x12'),_0x1e6aef,_0xf503('0x10'),JSON['stringify'](_0xf9d167));if(_0xf9d167['error']){if(_0xf9d167[_0xf503('0x13')][_0xf503('0x14')]===0x1f4){logger[_0xf503('0x13')](_0xf503('0xf'),_0x1e6aef,_0xf9d167['error'][_0xf503('0x15')]);return _0x4073e8(_0xf9d167[_0xf503('0x13')][_0xf503('0x15')]);}logger[_0xf503('0x13')]('Template,\x20%s,\x20%s',_0x1e6aef,_0xf9d167[_0xf503('0x13')][_0xf503('0x15')]);return _0x80f276(_0xf9d167[_0xf503('0x13')][_0xf503('0x15')]);}else{logger['info'](_0xf503('0xf'),_0x1e6aef,'request\x20sent');_0x80f276(_0xf9d167[_0xf503('0x16')][_0xf503('0x15')]);}})[_0xf503('0x17')](function(_0x2caf04){logger[_0xf503('0x13')]('Template,\x20%s,\x20%s',_0x1e6aef,_0x2caf04);_0x4073e8(_0x2caf04);});});}exports[_0xf503('0x18')]=function(_0x32afc3){var _0x9ad194=this;return new Promise(function(_0x2d3ee8,_0x3c7fd8){return db['Template'][_0xf503('0x19')]({'raw':_0x32afc3[_0xf503('0x1a')]?_0x32afc3[_0xf503('0x1a')][_0xf503('0x1b')]===undefined?!![]:![]:!![],'where':_0x32afc3[_0xf503('0x1a')]?_0x32afc3['options'][_0xf503('0x1c')]||null:null,'attributes':_0x32afc3[_0xf503('0x1a')]?_0x32afc3[_0xf503('0x1a')][_0xf503('0x1d')]||null:null,'limit':_0x32afc3[_0xf503('0x1a')]?_0x32afc3['options'][_0xf503('0x1e')]||null:null,'include':_0x32afc3['options']?_0x32afc3[_0xf503('0x1a')][_0xf503('0x1f')]?_[_0xf503('0x20')](_0x32afc3[_0xf503('0x1a')]['include'],function(_0x1113a6){return{'model':db[_0x1113a6[_0xf503('0x21')]],'as':_0x1113a6['as'],'attributes':_0x1113a6[_0xf503('0x1d')],'include':_0x1113a6[_0xf503('0x1f')]?_[_0xf503('0x20')](_0x1113a6[_0xf503('0x1f')],function(_0x22d8dc){return{'model':db[_0x22d8dc[_0xf503('0x21')]],'as':_0x22d8dc['as'],'attributes':_0x22d8dc[_0xf503('0x1d')],'include':_0x22d8dc[_0xf503('0x1f')]?_[_0xf503('0x20')](_0x22d8dc[_0xf503('0x1f')],function(_0x3a98bb){return{'model':db[_0x3a98bb[_0xf503('0x21')]],'as':_0x3a98bb['as'],'attributes':_0x3a98bb[_0xf503('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf503('0xd')](function(_0x6a9dd5){logger[_0xf503('0xe')](_0xf503('0x18'),_0x32afc3);logger['debug']('GetTemplate',_0x32afc3,JSON[_0xf503('0x22')](_0x6a9dd5));_0x2d3ee8(_0x6a9dd5);})[_0xf503('0x17')](function(_0x10d241){logger['error'](_0xf503('0x18'),_0x10d241[_0xf503('0x15')],_0x32afc3);_0x3c7fd8(_0x9ad194[_0xf503('0x13')](0x1f4,_0x10d241[_0xf503('0x15')]));});});}; \ No newline at end of file +var _0x132a=['options','where','attributes','limit','include','map','model','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','raw'];(function(_0x516b8b,_0x52d1bc){var _0x162b73=function(_0x5036c7){while(--_0x5036c7){_0x516b8b['push'](_0x516b8b['shift']());}};_0x162b73(++_0x52d1bc);}(_0x132a,0xe7));var _0xa132=function(_0x573094,_0x2b6658){_0x573094=_0x573094-0x0;var _0x25f8c6=_0x132a[_0x573094];return _0x25f8c6;};'use strict';var _=require('lodash');var util=require(_0xa132('0x0'));var moment=require(_0xa132('0x1'));var BPromise=require(_0xa132('0x2'));var rs=require(_0xa132('0x3'));var fs=require('fs');var Redis=require(_0xa132('0x4'));var db=require(_0xa132('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa132('0x6'))(_0xa132('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa132('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58eda0,_0x4f94a6,_0x522d70){return new BPromise(function(_0xebba4e,_0x1b0d37){return client['request'](_0x58eda0,_0x522d70)[_0xa132('0x9')](function(_0x1b1ff6){logger[_0xa132('0xa')]('Template,\x20%s,\x20%s',_0x4f94a6,_0xa132('0xb'));logger[_0xa132('0xc')](_0xa132('0xd'),_0x4f94a6,'request\x20sent',JSON[_0xa132('0xe')](_0x1b1ff6));if(_0x1b1ff6[_0xa132('0xf')]){if(_0x1b1ff6[_0xa132('0xf')][_0xa132('0x10')]===0x1f4){logger[_0xa132('0xf')](_0xa132('0x11'),_0x4f94a6,_0x1b1ff6[_0xa132('0xf')][_0xa132('0x12')]);return _0x1b0d37(_0x1b1ff6[_0xa132('0xf')][_0xa132('0x12')]);}logger[_0xa132('0xf')](_0xa132('0x11'),_0x4f94a6,_0x1b1ff6[_0xa132('0xf')]['message']);return _0xebba4e(_0x1b1ff6[_0xa132('0xf')][_0xa132('0x12')]);}else{logger['info'](_0xa132('0x11'),_0x4f94a6,_0xa132('0xb'));_0xebba4e(_0x1b1ff6[_0xa132('0x13')]['message']);}})[_0xa132('0x14')](function(_0x158fa9){logger[_0xa132('0xf')](_0xa132('0x11'),_0x4f94a6,_0x158fa9);_0x1b0d37(_0x158fa9);});});}exports[_0xa132('0x15')]=function(_0x3c4b9e){var _0x4a28df=this;return new Promise(function(_0x235a01,_0x2f7072){return db[_0xa132('0x16')][_0xa132('0x17')]({'raw':_0x3c4b9e['options']?_0x3c4b9e['options'][_0xa132('0x18')]===undefined?!![]:![]:!![],'where':_0x3c4b9e[_0xa132('0x19')]?_0x3c4b9e[_0xa132('0x19')][_0xa132('0x1a')]||null:null,'attributes':_0x3c4b9e[_0xa132('0x19')]?_0x3c4b9e[_0xa132('0x19')][_0xa132('0x1b')]||null:null,'limit':_0x3c4b9e[_0xa132('0x19')]?_0x3c4b9e[_0xa132('0x19')][_0xa132('0x1c')]||null:null,'include':_0x3c4b9e[_0xa132('0x19')]?_0x3c4b9e[_0xa132('0x19')][_0xa132('0x1d')]?_[_0xa132('0x1e')](_0x3c4b9e[_0xa132('0x19')]['include'],function(_0x2a3c25){return{'model':db[_0x2a3c25[_0xa132('0x1f')]],'as':_0x2a3c25['as'],'attributes':_0x2a3c25[_0xa132('0x1b')],'include':_0x2a3c25[_0xa132('0x1d')]?_['map'](_0x2a3c25['include'],function(_0x4c8140){return{'model':db[_0x4c8140[_0xa132('0x1f')]],'as':_0x4c8140['as'],'attributes':_0x4c8140[_0xa132('0x1b')],'include':_0x4c8140[_0xa132('0x1d')]?_[_0xa132('0x1e')](_0x4c8140[_0xa132('0x1d')],function(_0x4661f9){return{'model':db[_0x4661f9[_0xa132('0x1f')]],'as':_0x4661f9['as'],'attributes':_0x4661f9[_0xa132('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48dad5){logger[_0xa132('0xa')](_0xa132('0x15'),_0x3c4b9e);logger[_0xa132('0xc')]('GetTemplate',_0x3c4b9e,JSON[_0xa132('0xe')](_0x48dad5));_0x235a01(_0x48dad5);})['catch'](function(_0x20c3d6){logger['error'](_0xa132('0x15'),_0x20c3d6[_0xa132('0x12')],_0x3c4b9e);_0x2f7072(_0x4a28df[_0xa132('0xf')](0x1f4,_0x20c3d6[_0xa132('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 484ab79..7034dbb 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 _0x1cbc=['getAnyConditions','/:id/actions','getActions','create','post','/:id/all_conditions','addAllCondition','addAnyCondition','addAction','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions'];(function(_0x4eda99,_0x21679d){var _0x3259ad=function(_0x22e301){while(--_0x22e301){_0x4eda99['push'](_0x4eda99['shift']());}};_0x3259ad(++_0x21679d);}(_0x1cbc,0xf4));var _0xc1cb=function(_0x1b999f,_0xada878){_0x1b999f=_0x1b999f-0x0;var _0x51d27a=_0x1cbc[_0x1b999f];return _0x51d27a;};'use strict';var multer=require(_0xc1cb('0x0'));var util=require('util');var path=require(_0xc1cb('0x1'));var timeout=require(_0xc1cb('0x2'));var express=require(_0xc1cb('0x3'));var router=express[_0xc1cb('0x4')]();var fs_extra=require(_0xc1cb('0x5'));var auth=require(_0xc1cb('0x6'));var interaction=require(_0xc1cb('0x7'));var config=require(_0xc1cb('0x8'));var controller=require(_0xc1cb('0x9'));router[_0xc1cb('0xa')]('/',auth[_0xc1cb('0xb')](),controller[_0xc1cb('0xc')]);router['get'](_0xc1cb('0xd'),auth['isAuthenticated'](),controller[_0xc1cb('0xe')]);router[_0xc1cb('0xa')]('/:id/all_conditions',auth[_0xc1cb('0xb')](),controller[_0xc1cb('0xf')]);router[_0xc1cb('0xa')](_0xc1cb('0x10'),auth[_0xc1cb('0xb')](),controller[_0xc1cb('0x11')]);router[_0xc1cb('0xa')](_0xc1cb('0x12'),auth['isAuthenticated'](),controller[_0xc1cb('0x13')]);router['post']('/',auth[_0xc1cb('0xb')](),controller[_0xc1cb('0x14')]);router[_0xc1cb('0x15')](_0xc1cb('0x16'),auth[_0xc1cb('0xb')](),controller[_0xc1cb('0x17')]);router[_0xc1cb('0x15')]('/:id/any_conditions',auth[_0xc1cb('0xb')](),controller[_0xc1cb('0x18')]);router[_0xc1cb('0x15')](_0xc1cb('0x12'),auth['isAuthenticated'](),controller[_0xc1cb('0x19')]);router[_0xc1cb('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0xc1cb('0x1b')]);router[_0xc1cb('0x1c')](_0xc1cb('0xd'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x0033=['index','/:id','show','getAllConditions','getAnyConditions','getActions','post','/:id/all_conditions','addAllCondition','addAnyCondition','/:id/actions','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0xd79494,_0x1fcda7){var _0x1c1698=function(_0x15e012){while(--_0x15e012){_0xd79494['push'](_0xd79494['shift']());}};_0x1c1698(++_0x1fcda7);}(_0x0033,0x1c0));var _0x3003=function(_0x1d94d1,_0x347bb8){_0x1d94d1=_0x1d94d1-0x0;var _0x23c397=_0x0033[_0x1d94d1];return _0x23c397;};'use strict';var multer=require(_0x3003('0x0'));var util=require(_0x3003('0x1'));var path=require(_0x3003('0x2'));var timeout=require(_0x3003('0x3'));var express=require(_0x3003('0x4'));var router=express[_0x3003('0x5')]();var fs_extra=require(_0x3003('0x6'));var auth=require(_0x3003('0x7'));var interaction=require(_0x3003('0x8'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0x3003('0x9')]('/',auth[_0x3003('0xa')](),controller[_0x3003('0xb')]);router[_0x3003('0x9')](_0x3003('0xc'),auth[_0x3003('0xa')](),controller[_0x3003('0xd')]);router[_0x3003('0x9')]('/:id/all_conditions',auth[_0x3003('0xa')](),controller[_0x3003('0xe')]);router[_0x3003('0x9')]('/:id/any_conditions',auth[_0x3003('0xa')](),controller[_0x3003('0xf')]);router[_0x3003('0x9')]('/:id/actions',auth[_0x3003('0xa')](),controller[_0x3003('0x10')]);router[_0x3003('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3003('0x11')](_0x3003('0x12'),auth[_0x3003('0xa')](),controller[_0x3003('0x13')]);router[_0x3003('0x11')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x3003('0x14')]);router[_0x3003('0x11')](_0x3003('0x15'),auth['isAuthenticated'](),controller[_0x3003('0x16')]);router[_0x3003('0x17')](_0x3003('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x3003('0x18')](_0x3003('0xc'),auth[_0x3003('0xa')](),controller[_0x3003('0x19')]);module[_0x3003('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index fcbeb0e..12ef6ed 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 _0x194e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x2ab1ec,_0x25cea3){var _0x5d296d=function(_0x53c530){while(--_0x53c530){_0x2ab1ec['push'](_0x2ab1ec['shift']());}};_0x5d296d(++_0x25cea3);}(_0x194e,0x1a2));var _0xe194=function(_0x328e26,_0x2486e5){_0x328e26=_0x328e26-0x0;var _0x236a14=_0x194e[_0x328e26];return _0x236a14;};'use strict';var Sequelize=require(_0xe194('0x0'));module[_0xe194('0x1')]={'name':{'type':Sequelize[_0xe194('0x2')]},'channel':{'type':Sequelize[_0xe194('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xe194('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x0679=['BOOLEAN','exports','STRING'];(function(_0x3089a1,_0x594203){var _0x35d4d6=function(_0x577dac){while(--_0x577dac){_0x3089a1['push'](_0x3089a1['shift']());}};_0x35d4d6(++_0x594203);}(_0x0679,0x1d8));var _0x9067=function(_0x166742,_0x55520c){_0x166742=_0x166742-0x0;var _0xb7814a=_0x0679[_0x166742];return _0xb7814a;};'use strict';var Sequelize=require('sequelize');module[_0x9067('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9067('0x1')]},'description':{'type':Sequelize[_0x9067('0x1')]},'status':{'type':Sequelize[_0x9067('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 4d0c6dc..2e223f3 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 _0xc315=['catch','show','intersection','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','length','pick','getAnyConditions','nolimit','addAction','Action','getActions','eml-format','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','Triggers','error','stack','name','index','Trigger','rawAttributes','fieldName','key','model','map','keys','query','filters','fields','attributes','hasOwnProperty','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xc315,0x12b));var _0x5c31=function(_0x2047c2,_0x482749){_0x2047c2=_0x2047c2-0x0;var _0x742cb9=_0xc315[_0x2047c2];return _0x742cb9;};'use strict';var emlformat=require(_0x5c31('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c31('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c31('0x2'));var moment=require(_0x5c31('0x3'));var BPromise=require(_0x5c31('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5c31('0x5'));var sox=require(_0x5c31('0x6'));var csv=require(_0x5c31('0x7'));var ejs=require(_0x5c31('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c31('0x9'));var squel=require(_0x5c31('0xa'));var crypto=require(_0x5c31('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x5c31('0xc'));var toCsv=require(_0x5c31('0x7'));var querystring=require('querystring');var Papa=require(_0x5c31('0xd'));var Redis=require(_0x5c31('0xe'));var authService=require(_0x5c31('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5c31('0x10'));var logger=require(_0x5c31('0x11'))(_0x5c31('0x12'));var utils=require(_0x5c31('0x13'));var config=require(_0x5c31('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c31('0x15'))['db'];function respondWithStatusCode(_0xd95376,_0x266965){_0x266965=_0x266965||0xcc;return function(_0x357dc3){if(_0x357dc3){return _0xd95376[_0x5c31('0x16')](_0x266965);}return _0xd95376[_0x5c31('0x17')](_0x266965)[_0x5c31('0x18')]();};}function respondWithResult(_0x3f2651,_0xc1ed3e){_0xc1ed3e=_0xc1ed3e||0xc8;return function(_0x1d9feb){if(_0x1d9feb){return _0x3f2651[_0x5c31('0x17')](_0xc1ed3e)['json'](_0x1d9feb);}};}function respondWithFilteredResult(_0x3385da,_0x3a764b){return function(_0x2e156d){if(_0x2e156d){var _0x2a2e34=typeof _0x3a764b[_0x5c31('0x19')]===_0x5c31('0x1a')&&typeof _0x3a764b[_0x5c31('0x1b')]===_0x5c31('0x1a');var _0x10c0c1=_0x2e156d[_0x5c31('0x1c')];var _0x1896e7=_0x2a2e34?0x0:_0x3a764b[_0x5c31('0x19')];var _0x7ac4b2=_0x2a2e34?_0x2e156d[_0x5c31('0x1c')]:_0x3a764b['offset']+_0x3a764b[_0x5c31('0x1b')];var _0x263d3b;if(_0x7ac4b2>=_0x10c0c1){_0x7ac4b2=_0x10c0c1;_0x263d3b=0xc8;}else{_0x263d3b=0xce;}_0x3385da['status'](_0x263d3b);return _0x3385da['set'](_0x5c31('0x1d'),_0x1896e7+'-'+_0x7ac4b2+'/'+_0x10c0c1)['json'](_0x2e156d);}return null;};}function patchUpdates(_0x9d6ea7){return function(_0x51a2a7){try{jsonpatch[_0x5c31('0x1e')](_0x51a2a7,_0x9d6ea7,!![]);}catch(_0x4b4bee){return BPromise[_0x5c31('0x1f')](_0x4b4bee);}return _0x51a2a7[_0x5c31('0x20')]();};}function saveUpdates(_0x4d47dd,_0x254ad9){return function(_0x36acdd){if(_0x36acdd){return _0x36acdd[_0x5c31('0x21')](_0x4d47dd)[_0x5c31('0x22')](function(_0x5df2a0){return _0x5df2a0;});}return null;};}function removeEntity(_0x471606,_0x88e5e3){return function(_0x2aaeda){if(_0x2aaeda){return _0x2aaeda[_0x5c31('0x23')]()[_0x5c31('0x22')](function(){var _0x250356=_0x2aaeda[_0x5c31('0x24')]({'plain':!![]});var _0x1f8855=_0x5c31('0x25');return db['UserProfileResource'][_0x5c31('0x23')]({'where':{'type':_0x1f8855,'resourceId':_0x250356['id']}})[_0x5c31('0x22')](function(){return _0x2aaeda;});})['then'](function(){_0x471606[_0x5c31('0x17')](0xcc)[_0x5c31('0x18')]();});}};}function handleEntityNotFound(_0x30c93a,_0x1a0020){return function(_0xc47126){if(!_0xc47126){_0x30c93a[_0x5c31('0x16')](0x194);}return _0xc47126;};}function handleError(_0x4b75d5,_0x9f9e55){_0x9f9e55=_0x9f9e55||0x1f4;return function(_0x9ab9ec){logger[_0x5c31('0x26')](_0x9ab9ec[_0x5c31('0x27')]);if(_0x9ab9ec[_0x5c31('0x28')]){delete _0x9ab9ec[_0x5c31('0x28')];}_0x4b75d5[_0x5c31('0x17')](_0x9f9e55)['send'](_0x9ab9ec);};}exports[_0x5c31('0x29')]=function(_0x3b3763,_0x3c35f6){var _0x390355={},_0x34a555={},_0x5360b9={'count':0x0,'rows':[]};var _0x346092=_['map'](db[_0x5c31('0x2a')][_0x5c31('0x2b')],function(_0x560c81){return{'name':_0x560c81[_0x5c31('0x2c')],'type':_0x560c81['type'][_0x5c31('0x2d')]};});_0x34a555[_0x5c31('0x2e')]=_[_0x5c31('0x2f')](_0x346092,_0x5c31('0x28'));_0x34a555['query']=_[_0x5c31('0x30')](_0x3b3763[_0x5c31('0x31')]);_0x34a555[_0x5c31('0x32')]=_['intersection'](_0x34a555[_0x5c31('0x2e')],_0x34a555[_0x5c31('0x31')]);_0x390355['attributes']=_['intersection'](_0x34a555['model'],qs[_0x5c31('0x33')](_0x3b3763[_0x5c31('0x31')][_0x5c31('0x33')]));_0x390355[_0x5c31('0x34')]=_0x390355[_0x5c31('0x34')]['length']?_0x390355['attributes']:_0x34a555[_0x5c31('0x2e')];if(!_0x3b3763[_0x5c31('0x31')][_0x5c31('0x35')]('nolimit')){_0x390355['limit']=qs[_0x5c31('0x1b')](_0x3b3763[_0x5c31('0x31')]['limit']);_0x390355[_0x5c31('0x19')]=qs[_0x5c31('0x19')](_0x3b3763[_0x5c31('0x31')]['offset']);}_0x390355[_0x5c31('0x36')]=qs[_0x5c31('0x37')](_0x3b3763['query'][_0x5c31('0x37')]);_0x390355['where']=qs[_0x5c31('0x32')](_['pick'](_0x3b3763[_0x5c31('0x31')],_0x34a555[_0x5c31('0x32')]),_0x346092);if(_0x3b3763[_0x5c31('0x31')][_0x5c31('0x38')]){_0x390355['where']=_[_0x5c31('0x39')](_0x390355[_0x5c31('0x3a')],{'$or':_[_0x5c31('0x2f')](_0x346092,function(_0xea0ada){if(_0xea0ada[_0x5c31('0x3b')]!==_0x5c31('0x3c')){var _0x3c98f8={};_0x3c98f8[_0xea0ada[_0x5c31('0x28')]]={'$like':'%'+_0x3b3763['query'][_0x5c31('0x38')]+'%'};return _0x3c98f8;}})});}_0x390355=_[_0x5c31('0x39')]({},_0x390355,_0x3b3763[_0x5c31('0x3d')]);var _0x31a161={'where':_0x390355['where']};return db[_0x5c31('0x2a')][_0x5c31('0x1c')](_0x31a161)['then'](function(_0x5f2eb8){_0x5360b9[_0x5c31('0x1c')]=_0x5f2eb8;if(_0x3b3763['query'][_0x5c31('0x3e')]){_0x390355[_0x5c31('0x3f')]=[{'all':!![]}];}return db[_0x5c31('0x2a')]['findAll'](_0x390355);})[_0x5c31('0x22')](function(_0x27d3c5){_0x5360b9[_0x5c31('0x40')]=_0x27d3c5;return _0x5360b9;})[_0x5c31('0x22')](respondWithFilteredResult(_0x3c35f6,_0x390355))[_0x5c31('0x41')](handleError(_0x3c35f6,null));};exports[_0x5c31('0x42')]=function(_0x299d0d,_0x183a62){var _0x436439={'raw':![],'where':{'id':_0x299d0d['params']['id']}},_0x37ba0d={};_0x37ba0d['model']=_[_0x5c31('0x30')](db[_0x5c31('0x2a')][_0x5c31('0x2b')]);_0x37ba0d[_0x5c31('0x31')]=_[_0x5c31('0x30')](_0x299d0d[_0x5c31('0x31')]);_0x37ba0d[_0x5c31('0x32')]=_[_0x5c31('0x43')](_0x37ba0d[_0x5c31('0x2e')],_0x37ba0d[_0x5c31('0x31')]);_0x436439[_0x5c31('0x34')]=_[_0x5c31('0x43')](_0x37ba0d[_0x5c31('0x2e')],qs[_0x5c31('0x33')](_0x299d0d[_0x5c31('0x31')]['fields']));_0x436439[_0x5c31('0x34')]=_0x436439[_0x5c31('0x34')]['length']?_0x436439['attributes']:_0x37ba0d['model'];if(_0x299d0d[_0x5c31('0x31')][_0x5c31('0x3e')]){_0x436439['include']=[{'all':!![]}];}_0x436439=_[_0x5c31('0x39')]({},_0x436439,_0x299d0d['options']);return db[_0x5c31('0x2a')][_0x5c31('0x44')](_0x436439)[_0x5c31('0x22')](handleEntityNotFound(_0x183a62,null))['then'](respondWithResult(_0x183a62,null))['catch'](handleError(_0x183a62,null));};exports[_0x5c31('0x45')]=function(_0x4002f7,_0x38241c){return db[_0x5c31('0x2a')][_0x5c31('0x45')](_0x4002f7[_0x5c31('0x46')],{})[_0x5c31('0x22')](function(_0x3c0c7e){var _0x425343=_0x4002f7[_0x5c31('0x47')][_0x5c31('0x24')]({'plain':!![]});if(!_0x425343)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x425343[_0x5c31('0x48')]==='user'){var _0x43589e=_0x3c0c7e[_0x5c31('0x24')]({'plain':!![]});var _0x585d2b=_0x5c31('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x585d2b,'userProfileId':_0x425343[_0x5c31('0x49')]},'raw':!![]})['then'](function(_0x28bd77){if(_0x28bd77&&_0x28bd77[_0x5c31('0x4a')]===0x0){return db[_0x5c31('0x4b')]['create']({'name':_0x43589e[_0x5c31('0x28')],'resourceId':_0x43589e['id'],'type':_0x28bd77['name'],'sectionId':_0x28bd77['id']},{})[_0x5c31('0x22')](function(){return _0x3c0c7e;});}else{return _0x3c0c7e;}})[_0x5c31('0x41')](function(_0x446f49){logger['error'](_0x5c31('0x4c'),_0x446f49);throw _0x446f49;});}return _0x3c0c7e;})[_0x5c31('0x22')](respondWithResult(_0x38241c,0xc9))['catch'](handleError(_0x38241c,null));};exports['update']=function(_0x7a166a,_0x175cd4){if(_0x7a166a[_0x5c31('0x46')]['id']){delete _0x7a166a[_0x5c31('0x46')]['id'];}return db['Trigger']['find']({'where':{'id':_0x7a166a[_0x5c31('0x4d')]['id']}})[_0x5c31('0x22')](handleEntityNotFound(_0x175cd4,null))[_0x5c31('0x22')](saveUpdates(_0x7a166a[_0x5c31('0x46')],null))['then'](respondWithResult(_0x175cd4,null))['catch'](handleError(_0x175cd4,null));};exports[_0x5c31('0x23')]=function(_0x52c6aa,_0x4d6f80){return db['Trigger']['find']({'where':{'id':_0x52c6aa[_0x5c31('0x4d')]['id']}})[_0x5c31('0x22')](handleEntityNotFound(_0x4d6f80,null))[_0x5c31('0x22')](removeEntity(_0x4d6f80,null))['catch'](handleError(_0x4d6f80,null));};exports[_0x5c31('0x4e')]=function(_0x17f340,_0x59b2ed,_0x47d8aa){if(_0x17f340['body']['id']){delete _0x17f340[_0x5c31('0x46')]['id'];}return db['Trigger'][_0x5c31('0x44')]({'where':{'id':_0x17f340[_0x5c31('0x4d')]['id']}})[_0x5c31('0x22')](handleEntityNotFound(_0x59b2ed,null))[_0x5c31('0x22')](function(_0xe1ad45){if(_0xe1ad45){_0x17f340['body']['TriggerAllId']=_0xe1ad45['id'];return db['Condition'][_0x5c31('0x45')](_0x17f340[_0x5c31('0x46')]);}})[_0x5c31('0x22')](respondWithResult(_0x59b2ed,null))[_0x5c31('0x41')](handleError(_0x59b2ed,null));};exports[_0x5c31('0x4f')]=function(_0x2bd975,_0x2a3f12,_0x7baccd){if(_0x2bd975['body']['id']){delete _0x2bd975[_0x5c31('0x46')]['id'];}return db[_0x5c31('0x2a')]['find']({'where':{'id':_0x2bd975[_0x5c31('0x4d')]['id']}})[_0x5c31('0x22')](handleEntityNotFound(_0x2a3f12,null))['then'](function(_0x12b398){if(_0x12b398){_0x2bd975[_0x5c31('0x46')][_0x5c31('0x50')]=_0x12b398['id'];return db[_0x5c31('0x51')][_0x5c31('0x45')](_0x2bd975[_0x5c31('0x46')]);}})[_0x5c31('0x22')](respondWithResult(_0x2a3f12,null))['catch'](handleError(_0x2a3f12,null));};exports[_0x5c31('0x52')]=function(_0xd04336,_0x2ad916,_0x12053f){var _0x15c2fc={};var _0x3226d4={};var _0x2f7fd0;var _0x2bfe5a;return db['Trigger'][_0x5c31('0x53')]({'where':{'id':_0xd04336[_0x5c31('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2ad916,null))['then'](function(_0x47ccff){if(_0x47ccff){_0x2f7fd0=_0x47ccff;_0x3226d4[_0x5c31('0x2e')]=_['keys'](db[_0x5c31('0x51')][_0x5c31('0x2b')]);_0x3226d4[_0x5c31('0x31')]=_[_0x5c31('0x30')](_0xd04336[_0x5c31('0x31')]);_0x3226d4[_0x5c31('0x32')]=_['intersection'](_0x3226d4[_0x5c31('0x2e')],_0x3226d4[_0x5c31('0x31')]);_0x15c2fc['attributes']=_[_0x5c31('0x43')](_0x3226d4[_0x5c31('0x2e')],qs[_0x5c31('0x33')](_0xd04336['query']['fields']));_0x15c2fc[_0x5c31('0x34')]=_0x15c2fc[_0x5c31('0x34')][_0x5c31('0x54')]?_0x15c2fc[_0x5c31('0x34')]:_0x3226d4[_0x5c31('0x2e')];_0x15c2fc[_0x5c31('0x36')]=qs[_0x5c31('0x37')](_0xd04336[_0x5c31('0x31')][_0x5c31('0x37')]);_0x15c2fc[_0x5c31('0x3a')]=qs[_0x5c31('0x32')](_[_0x5c31('0x55')](_0xd04336['query'],_0x3226d4[_0x5c31('0x32')]));if(_0xd04336[_0x5c31('0x31')][_0x5c31('0x38')]){_0x15c2fc[_0x5c31('0x3a')]=_['merge'](_0x15c2fc[_0x5c31('0x3a')],{'$or':_[_0x5c31('0x2f')](_0x15c2fc['attributes'],function(_0x3872bd){var _0x41701c={};_0x41701c[_0x3872bd]={'$like':'%'+_0xd04336[_0x5c31('0x31')]['filter']+'%'};return _0x41701c;})});}_0x15c2fc=_[_0x5c31('0x39')]({},_0x15c2fc,_0xd04336['options']);return _0x2f7fd0['getAllConditions'](_0x15c2fc);}})[_0x5c31('0x22')](function(_0x41cc0f){if(_0x41cc0f){_0x2bfe5a=_0x41cc0f['length'];if(!_0xd04336['query']['hasOwnProperty']('nolimit')){_0x15c2fc[_0x5c31('0x1b')]=qs[_0x5c31('0x1b')](_0xd04336[_0x5c31('0x31')][_0x5c31('0x1b')]);_0x15c2fc['offset']=qs['offset'](_0xd04336[_0x5c31('0x31')][_0x5c31('0x19')]);}return _0x2f7fd0[_0x5c31('0x52')](_0x15c2fc);}})['then'](function(_0x1ccabd){if(_0x1ccabd){return _0x1ccabd?{'count':_0x2bfe5a,'rows':_0x1ccabd}:null;}})[_0x5c31('0x22')](respondWithResult(_0x2ad916,null))['catch'](handleError(_0x2ad916,null));};exports[_0x5c31('0x56')]=function(_0x11be82,_0x36f84e,_0x4b4779){var _0x2860bc={};var _0x163bf5={};var _0xe6b2f2;var _0x23e8ed;return db[_0x5c31('0x2a')]['findOne']({'where':{'id':_0x11be82['params']['id']}})['then'](handleEntityNotFound(_0x36f84e,null))[_0x5c31('0x22')](function(_0x105f55){if(_0x105f55){_0xe6b2f2=_0x105f55;_0x163bf5[_0x5c31('0x2e')]=_[_0x5c31('0x30')](db[_0x5c31('0x51')]['rawAttributes']);_0x163bf5[_0x5c31('0x31')]=_[_0x5c31('0x30')](_0x11be82[_0x5c31('0x31')]);_0x163bf5[_0x5c31('0x32')]=_['intersection'](_0x163bf5[_0x5c31('0x2e')],_0x163bf5[_0x5c31('0x31')]);_0x2860bc[_0x5c31('0x34')]=_[_0x5c31('0x43')](_0x163bf5['model'],qs['fields'](_0x11be82[_0x5c31('0x31')][_0x5c31('0x33')]));_0x2860bc[_0x5c31('0x34')]=_0x2860bc[_0x5c31('0x34')][_0x5c31('0x54')]?_0x2860bc['attributes']:_0x163bf5[_0x5c31('0x2e')];_0x2860bc[_0x5c31('0x36')]=qs[_0x5c31('0x37')](_0x11be82[_0x5c31('0x31')][_0x5c31('0x37')]);_0x2860bc[_0x5c31('0x3a')]=qs[_0x5c31('0x32')](_['pick'](_0x11be82[_0x5c31('0x31')],_0x163bf5[_0x5c31('0x32')]));if(_0x11be82[_0x5c31('0x31')][_0x5c31('0x38')]){_0x2860bc[_0x5c31('0x3a')]=_['merge'](_0x2860bc['where'],{'$or':_[_0x5c31('0x2f')](_0x2860bc['attributes'],function(_0x282f32){var _0x17cb1e={};_0x17cb1e[_0x282f32]={'$like':'%'+_0x11be82[_0x5c31('0x31')][_0x5c31('0x38')]+'%'};return _0x17cb1e;})});}_0x2860bc=_[_0x5c31('0x39')]({},_0x2860bc,_0x11be82[_0x5c31('0x3d')]);return _0xe6b2f2[_0x5c31('0x56')](_0x2860bc);}})[_0x5c31('0x22')](function(_0x5091bb){if(_0x5091bb){_0x23e8ed=_0x5091bb['length'];if(!_0x11be82['query']['hasOwnProperty'](_0x5c31('0x57'))){_0x2860bc[_0x5c31('0x1b')]=qs[_0x5c31('0x1b')](_0x11be82[_0x5c31('0x31')][_0x5c31('0x1b')]);_0x2860bc[_0x5c31('0x19')]=qs[_0x5c31('0x19')](_0x11be82['query'][_0x5c31('0x19')]);}return _0xe6b2f2[_0x5c31('0x56')](_0x2860bc);}})['then'](function(_0x1610de){if(_0x1610de){return _0x1610de?{'count':_0x23e8ed,'rows':_0x1610de}:null;}})[_0x5c31('0x22')](respondWithResult(_0x36f84e,null))[_0x5c31('0x41')](handleError(_0x36f84e,null));};exports[_0x5c31('0x58')]=function(_0x259871,_0x3dd1df,_0x2d8451){if(_0x259871[_0x5c31('0x46')]['id']){delete _0x259871[_0x5c31('0x46')]['id'];}return db[_0x5c31('0x2a')]['find']({'where':{'id':_0x259871[_0x5c31('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3dd1df,null))[_0x5c31('0x22')](function(_0x1f3778){if(_0x1f3778){_0x259871['body']['TriggerId']=_0x1f3778['id'];return db[_0x5c31('0x59')][_0x5c31('0x45')](_0x259871[_0x5c31('0x46')]);}})[_0x5c31('0x22')](respondWithResult(_0x3dd1df,null))[_0x5c31('0x41')](handleError(_0x3dd1df,null));};exports[_0x5c31('0x5a')]=function(_0x4030a4,_0x49dd47,_0x54aa7f){var _0x12c15e={};var _0x4cb1b2={};var _0x524326;var _0x2715f5;return db[_0x5c31('0x2a')][_0x5c31('0x53')]({'where':{'id':_0x4030a4[_0x5c31('0x4d')]['id']}})['then'](handleEntityNotFound(_0x49dd47,null))[_0x5c31('0x22')](function(_0x512930){if(_0x512930){_0x524326=_0x512930;_0x4cb1b2[_0x5c31('0x2e')]=_[_0x5c31('0x30')](db[_0x5c31('0x59')]['rawAttributes']);_0x4cb1b2[_0x5c31('0x31')]=_['keys'](_0x4030a4[_0x5c31('0x31')]);_0x4cb1b2[_0x5c31('0x32')]=_[_0x5c31('0x43')](_0x4cb1b2[_0x5c31('0x2e')],_0x4cb1b2[_0x5c31('0x31')]);_0x12c15e[_0x5c31('0x34')]=_[_0x5c31('0x43')](_0x4cb1b2[_0x5c31('0x2e')],qs[_0x5c31('0x33')](_0x4030a4[_0x5c31('0x31')][_0x5c31('0x33')]));_0x12c15e[_0x5c31('0x34')]=_0x12c15e[_0x5c31('0x34')][_0x5c31('0x54')]?_0x12c15e['attributes']:_0x4cb1b2[_0x5c31('0x2e')];_0x12c15e[_0x5c31('0x36')]=qs[_0x5c31('0x37')](_0x4030a4[_0x5c31('0x31')][_0x5c31('0x37')]);_0x12c15e[_0x5c31('0x3a')]=qs['filters'](_['pick'](_0x4030a4['query'],_0x4cb1b2['filters']));if(_0x4030a4['query'][_0x5c31('0x38')]){_0x12c15e[_0x5c31('0x3a')]=_['merge'](_0x12c15e['where'],{'$or':_[_0x5c31('0x2f')](_0x12c15e[_0x5c31('0x34')],function(_0x10454f){var _0x23134d={};_0x23134d[_0x10454f]={'$like':'%'+_0x4030a4[_0x5c31('0x31')]['filter']+'%'};return _0x23134d;})});}_0x12c15e=_[_0x5c31('0x39')]({},_0x12c15e,_0x4030a4[_0x5c31('0x3d')]);return _0x524326[_0x5c31('0x5a')](_0x12c15e);}})[_0x5c31('0x22')](function(_0x5e6885){if(_0x5e6885){_0x2715f5=_0x5e6885[_0x5c31('0x54')];if(!_0x4030a4[_0x5c31('0x31')]['hasOwnProperty'](_0x5c31('0x57'))){_0x12c15e[_0x5c31('0x1b')]=qs['limit'](_0x4030a4[_0x5c31('0x31')][_0x5c31('0x1b')]);_0x12c15e['offset']=qs['offset'](_0x4030a4['query'][_0x5c31('0x19')]);}return _0x524326['getActions'](_0x12c15e);}})[_0x5c31('0x22')](function(_0x5c6593){if(_0x5c6593){return _0x5c6593?{'count':_0x2715f5,'rows':_0x5c6593}:null;}})[_0x5c31('0x22')](respondWithResult(_0x49dd47,null))[_0x5c31('0x41')](handleError(_0x49dd47,null));}; \ No newline at end of file +var _0xf044=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','Condition','addAnyCondition','TriggerAnyId','findOne','getAnyConditions','TriggerId','Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','UserProfileResource','error','stack','name','send','map','Trigger','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','user','get','Triggers','UserProfileSection','autoAssociation','catch'];(function(_0x3bbfea,_0x4b49e3){var _0x1d789c=function(_0x95bef0){while(--_0x95bef0){_0x3bbfea['push'](_0x3bbfea['shift']());}};_0x1d789c(++_0x4b49e3);}(_0xf044,0x11b));var _0x4f04=function(_0x25041c,_0x54a4a1){_0x25041c=_0x25041c-0x0;var _0x4a7939=_0xf044[_0x25041c];return _0x4a7939;};'use strict';var emlformat=require(_0x4f04('0x0'));var rimraf=require(_0x4f04('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f04('0x2'));var rp=require(_0x4f04('0x3'));var moment=require('moment');var BPromise=require(_0x4f04('0x4'));var Mustache=require(_0x4f04('0x5'));var util=require(_0x4f04('0x6'));var path=require('path');var sox=require(_0x4f04('0x7'));var csv=require(_0x4f04('0x8'));var ejs=require(_0x4f04('0x9'));var fs=require('fs');var fs_extra=require(_0x4f04('0xa'));var _=require('lodash');var squel=require(_0x4f04('0xb'));var crypto=require('crypto');var jsforce=require(_0x4f04('0xc'));var deskjs=require(_0x4f04('0xd'));var toCsv=require(_0x4f04('0x8'));var querystring=require(_0x4f04('0xe'));var Papa=require('papaparse');var Redis=require(_0x4f04('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4f04('0x10'));var hardwareService=require(_0x4f04('0x11'));var logger=require(_0x4f04('0x12'))(_0x4f04('0x13'));var utils=require(_0x4f04('0x14'));var config=require(_0x4f04('0x15'));var licenseUtil=require(_0x4f04('0x16'));var db=require(_0x4f04('0x17'))['db'];function respondWithStatusCode(_0x4c2169,_0x1d4383){_0x1d4383=_0x1d4383||0xcc;return function(_0x101229){if(_0x101229){return _0x4c2169['sendStatus'](_0x1d4383);}return _0x4c2169['status'](_0x1d4383)[_0x4f04('0x18')]();};}function respondWithResult(_0x74bb85,_0x316286){_0x316286=_0x316286||0xc8;return function(_0x309e78){if(_0x309e78){return _0x74bb85[_0x4f04('0x19')](_0x316286)['json'](_0x309e78);}};}function respondWithFilteredResult(_0x136992,_0x3b6ee9){return function(_0x19e319){if(_0x19e319){var _0x33803c=typeof _0x3b6ee9['offset']===_0x4f04('0x1a')&&typeof _0x3b6ee9[_0x4f04('0x1b')]===_0x4f04('0x1a');var _0x5000b7=_0x19e319['count'];var _0x54bdc7=_0x33803c?0x0:_0x3b6ee9['offset'];var _0x2ae738=_0x33803c?_0x19e319[_0x4f04('0x1c')]:_0x3b6ee9['offset']+_0x3b6ee9['limit'];var _0x4279c1;if(_0x2ae738>=_0x5000b7){_0x2ae738=_0x5000b7;_0x4279c1=0xc8;}else{_0x4279c1=0xce;}_0x136992['status'](_0x4279c1);return _0x136992['set'](_0x4f04('0x1d'),_0x54bdc7+'-'+_0x2ae738+'/'+_0x5000b7)[_0x4f04('0x1e')](_0x19e319);}return null;};}function patchUpdates(_0x5725e5){return function(_0x4a6ec8){try{jsonpatch[_0x4f04('0x1f')](_0x4a6ec8,_0x5725e5,!![]);}catch(_0x498c80){return BPromise[_0x4f04('0x20')](_0x498c80);}return _0x4a6ec8[_0x4f04('0x21')]();};}function saveUpdates(_0x3b967c,_0x355d23){return function(_0x443581){if(_0x443581){return _0x443581[_0x4f04('0x22')](_0x3b967c)[_0x4f04('0x23')](function(_0x1b05e4){return _0x1b05e4;});}return null;};}function removeEntity(_0x439f6d,_0x36e3c0){return function(_0x3a807f){if(_0x3a807f){return _0x3a807f[_0x4f04('0x24')]()['then'](function(){var _0x3bdf97=_0x3a807f['get']({'plain':!![]});var _0x79fb52='Triggers';return db[_0x4f04('0x25')][_0x4f04('0x24')]({'where':{'type':_0x79fb52,'resourceId':_0x3bdf97['id']}})['then'](function(){return _0x3a807f;});})[_0x4f04('0x23')](function(){_0x439f6d[_0x4f04('0x19')](0xcc)[_0x4f04('0x18')]();});}};}function handleEntityNotFound(_0x463a50,_0x39e4c9){return function(_0x38af88){if(!_0x38af88){_0x463a50['sendStatus'](0x194);}return _0x38af88;};}function handleError(_0x514aa3,_0x58a510){_0x58a510=_0x58a510||0x1f4;return function(_0x5cef22){logger[_0x4f04('0x26')](_0x5cef22[_0x4f04('0x27')]);if(_0x5cef22[_0x4f04('0x28')]){delete _0x5cef22[_0x4f04('0x28')];}_0x514aa3['status'](_0x58a510)[_0x4f04('0x29')](_0x5cef22);};}exports['index']=function(_0x3227a5,_0x3730fb){var _0x5e919a={},_0x5998fe={},_0xb6d91f={'count':0x0,'rows':[]};var _0x4f7f5d=_[_0x4f04('0x2a')](db[_0x4f04('0x2b')]['rawAttributes'],function(_0x9eda30){return{'name':_0x9eda30[_0x4f04('0x2c')],'type':_0x9eda30['type'][_0x4f04('0x2d')]};});_0x5998fe[_0x4f04('0x2e')]=_[_0x4f04('0x2a')](_0x4f7f5d,'name');_0x5998fe[_0x4f04('0x2f')]=_[_0x4f04('0x30')](_0x3227a5['query']);_0x5998fe[_0x4f04('0x31')]=_[_0x4f04('0x32')](_0x5998fe[_0x4f04('0x2e')],_0x5998fe[_0x4f04('0x2f')]);_0x5e919a[_0x4f04('0x33')]=_[_0x4f04('0x32')](_0x5998fe['model'],qs['fields'](_0x3227a5['query'][_0x4f04('0x34')]));_0x5e919a[_0x4f04('0x33')]=_0x5e919a['attributes'][_0x4f04('0x35')]?_0x5e919a[_0x4f04('0x33')]:_0x5998fe[_0x4f04('0x2e')];if(!_0x3227a5[_0x4f04('0x2f')][_0x4f04('0x36')](_0x4f04('0x37'))){_0x5e919a['limit']=qs[_0x4f04('0x1b')](_0x3227a5['query'][_0x4f04('0x1b')]);_0x5e919a[_0x4f04('0x38')]=qs[_0x4f04('0x38')](_0x3227a5[_0x4f04('0x2f')][_0x4f04('0x38')]);}_0x5e919a[_0x4f04('0x39')]=qs[_0x4f04('0x3a')](_0x3227a5['query'][_0x4f04('0x3a')]);_0x5e919a[_0x4f04('0x3b')]=qs['filters'](_[_0x4f04('0x3c')](_0x3227a5[_0x4f04('0x2f')],_0x5998fe[_0x4f04('0x31')]),_0x4f7f5d);if(_0x3227a5['query'][_0x4f04('0x3d')]){_0x5e919a[_0x4f04('0x3b')]=_[_0x4f04('0x3e')](_0x5e919a[_0x4f04('0x3b')],{'$or':_[_0x4f04('0x2a')](_0x4f7f5d,function(_0xb31759){if(_0xb31759[_0x4f04('0x3f')]!==_0x4f04('0x40')){var _0x388e17={};_0x388e17[_0xb31759[_0x4f04('0x28')]]={'$like':'%'+_0x3227a5[_0x4f04('0x2f')]['filter']+'%'};return _0x388e17;}})});}_0x5e919a=_['merge']({},_0x5e919a,_0x3227a5[_0x4f04('0x41')]);var _0x765b9={'where':_0x5e919a[_0x4f04('0x3b')]};return db[_0x4f04('0x2b')][_0x4f04('0x1c')](_0x765b9)['then'](function(_0x730672){_0xb6d91f[_0x4f04('0x1c')]=_0x730672;if(_0x3227a5[_0x4f04('0x2f')]['includeAll']){_0x5e919a[_0x4f04('0x42')]=[{'all':!![]}];}return db[_0x4f04('0x2b')][_0x4f04('0x43')](_0x5e919a);})[_0x4f04('0x23')](function(_0x4e4988){_0xb6d91f[_0x4f04('0x44')]=_0x4e4988;return _0xb6d91f;})[_0x4f04('0x23')](respondWithFilteredResult(_0x3730fb,_0x5e919a))['catch'](handleError(_0x3730fb,null));};exports[_0x4f04('0x45')]=function(_0x525e4e,_0xf91c96){var _0xb5932a={'raw':![],'where':{'id':_0x525e4e[_0x4f04('0x46')]['id']}},_0xee0cd={};_0xee0cd[_0x4f04('0x2e')]=_[_0x4f04('0x30')](db['Trigger'][_0x4f04('0x47')]);_0xee0cd['query']=_['keys'](_0x525e4e[_0x4f04('0x2f')]);_0xee0cd[_0x4f04('0x31')]=_[_0x4f04('0x32')](_0xee0cd[_0x4f04('0x2e')],_0xee0cd[_0x4f04('0x2f')]);_0xb5932a[_0x4f04('0x33')]=_[_0x4f04('0x32')](_0xee0cd[_0x4f04('0x2e')],qs[_0x4f04('0x34')](_0x525e4e['query']['fields']));_0xb5932a[_0x4f04('0x33')]=_0xb5932a['attributes'][_0x4f04('0x35')]?_0xb5932a[_0x4f04('0x33')]:_0xee0cd[_0x4f04('0x2e')];if(_0x525e4e[_0x4f04('0x2f')][_0x4f04('0x48')]){_0xb5932a[_0x4f04('0x42')]=[{'all':!![]}];}_0xb5932a=_[_0x4f04('0x3e')]({},_0xb5932a,_0x525e4e[_0x4f04('0x41')]);return db['Trigger'][_0x4f04('0x49')](_0xb5932a)[_0x4f04('0x23')](handleEntityNotFound(_0xf91c96,null))[_0x4f04('0x23')](respondWithResult(_0xf91c96,null))['catch'](handleError(_0xf91c96,null));};exports[_0x4f04('0x4a')]=function(_0x5b7568,_0x4df2b4){return db[_0x4f04('0x2b')][_0x4f04('0x4a')](_0x5b7568['body'],{})[_0x4f04('0x23')](function(_0x4deca4){var _0x562ca7=_0x5b7568[_0x4f04('0x4b')][_0x4f04('0x4c')]({'plain':!![]});if(!_0x562ca7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x562ca7['role']===_0x4f04('0x4b')){var _0x45fa61=_0x4deca4['get']({'plain':!![]});var _0x27167f=_0x4f04('0x4d');return db[_0x4f04('0x4e')][_0x4f04('0x49')]({'where':{'name':_0x27167f,'userProfileId':_0x562ca7['userProfileId']},'raw':!![]})[_0x4f04('0x23')](function(_0x248e3d){if(_0x248e3d&&_0x248e3d[_0x4f04('0x4f')]===0x0){return db[_0x4f04('0x25')]['create']({'name':_0x45fa61[_0x4f04('0x28')],'resourceId':_0x45fa61['id'],'type':_0x248e3d['name'],'sectionId':_0x248e3d['id']},{})[_0x4f04('0x23')](function(){return _0x4deca4;});}else{return _0x4deca4;}})[_0x4f04('0x50')](function(_0x10d7f2){logger[_0x4f04('0x26')](_0x4f04('0x51'),_0x10d7f2);throw _0x10d7f2;});}return _0x4deca4;})[_0x4f04('0x23')](respondWithResult(_0x4df2b4,0xc9))[_0x4f04('0x50')](handleError(_0x4df2b4,null));};exports[_0x4f04('0x22')]=function(_0x4a2dbc,_0x527d9d){if(_0x4a2dbc['body']['id']){delete _0x4a2dbc[_0x4f04('0x52')]['id'];}return db[_0x4f04('0x2b')][_0x4f04('0x49')]({'where':{'id':_0x4a2dbc[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x527d9d,null))[_0x4f04('0x23')](saveUpdates(_0x4a2dbc[_0x4f04('0x52')],null))[_0x4f04('0x23')](respondWithResult(_0x527d9d,null))['catch'](handleError(_0x527d9d,null));};exports['destroy']=function(_0x4a66fe,_0x88fd84){return db[_0x4f04('0x2b')]['find']({'where':{'id':_0x4a66fe[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x88fd84,null))[_0x4f04('0x23')](removeEntity(_0x88fd84,null))[_0x4f04('0x50')](handleError(_0x88fd84,null));};exports['addAllCondition']=function(_0x46150a,_0x30b51a,_0x1a74d4){if(_0x46150a['body']['id']){delete _0x46150a[_0x4f04('0x52')]['id'];}return db[_0x4f04('0x2b')][_0x4f04('0x49')]({'where':{'id':_0x46150a[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x30b51a,null))[_0x4f04('0x23')](function(_0xcbba90){if(_0xcbba90){_0x46150a[_0x4f04('0x52')]['TriggerAllId']=_0xcbba90['id'];return db[_0x4f04('0x53')][_0x4f04('0x4a')](_0x46150a[_0x4f04('0x52')]);}})['then'](respondWithResult(_0x30b51a,null))['catch'](handleError(_0x30b51a,null));};exports[_0x4f04('0x54')]=function(_0x441283,_0x2c9521,_0x1e4864){if(_0x441283[_0x4f04('0x52')]['id']){delete _0x441283[_0x4f04('0x52')]['id'];}return db['Trigger']['find']({'where':{'id':_0x441283['params']['id']}})['then'](handleEntityNotFound(_0x2c9521,null))[_0x4f04('0x23')](function(_0x2948eb){if(_0x2948eb){_0x441283[_0x4f04('0x52')][_0x4f04('0x55')]=_0x2948eb['id'];return db[_0x4f04('0x53')]['create'](_0x441283[_0x4f04('0x52')]);}})['then'](respondWithResult(_0x2c9521,null))[_0x4f04('0x50')](handleError(_0x2c9521,null));};exports['getAllConditions']=function(_0x32877d,_0x2f14d7,_0x1b9dad){var _0x3f2599={};var _0x2bf1af={};var _0x308f4f;var _0x356c0d;return db['Trigger'][_0x4f04('0x56')]({'where':{'id':_0x32877d[_0x4f04('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f14d7,null))['then'](function(_0x4afd18){if(_0x4afd18){_0x308f4f=_0x4afd18;_0x2bf1af['model']=_[_0x4f04('0x30')](db[_0x4f04('0x53')][_0x4f04('0x47')]);_0x2bf1af[_0x4f04('0x2f')]=_[_0x4f04('0x30')](_0x32877d[_0x4f04('0x2f')]);_0x2bf1af['filters']=_['intersection'](_0x2bf1af[_0x4f04('0x2e')],_0x2bf1af[_0x4f04('0x2f')]);_0x3f2599[_0x4f04('0x33')]=_[_0x4f04('0x32')](_0x2bf1af[_0x4f04('0x2e')],qs['fields'](_0x32877d[_0x4f04('0x2f')][_0x4f04('0x34')]));_0x3f2599[_0x4f04('0x33')]=_0x3f2599[_0x4f04('0x33')][_0x4f04('0x35')]?_0x3f2599[_0x4f04('0x33')]:_0x2bf1af[_0x4f04('0x2e')];_0x3f2599['order']=qs['sort'](_0x32877d[_0x4f04('0x2f')]['sort']);_0x3f2599[_0x4f04('0x3b')]=qs[_0x4f04('0x31')](_['pick'](_0x32877d[_0x4f04('0x2f')],_0x2bf1af[_0x4f04('0x31')]));if(_0x32877d['query'][_0x4f04('0x3d')]){_0x3f2599['where']=_['merge'](_0x3f2599['where'],{'$or':_[_0x4f04('0x2a')](_0x3f2599['attributes'],function(_0x1aadb2){var _0x36d01f={};_0x36d01f[_0x1aadb2]={'$like':'%'+_0x32877d[_0x4f04('0x2f')][_0x4f04('0x3d')]+'%'};return _0x36d01f;})});}_0x3f2599=_[_0x4f04('0x3e')]({},_0x3f2599,_0x32877d['options']);return _0x308f4f['getAllConditions'](_0x3f2599);}})[_0x4f04('0x23')](function(_0x2dcd84){if(_0x2dcd84){_0x356c0d=_0x2dcd84[_0x4f04('0x35')];if(!_0x32877d[_0x4f04('0x2f')]['hasOwnProperty'](_0x4f04('0x37'))){_0x3f2599['limit']=qs[_0x4f04('0x1b')](_0x32877d[_0x4f04('0x2f')][_0x4f04('0x1b')]);_0x3f2599[_0x4f04('0x38')]=qs[_0x4f04('0x38')](_0x32877d['query'][_0x4f04('0x38')]);}return _0x308f4f['getAllConditions'](_0x3f2599);}})[_0x4f04('0x23')](function(_0x406d80){if(_0x406d80){return _0x406d80?{'count':_0x356c0d,'rows':_0x406d80}:null;}})[_0x4f04('0x23')](respondWithResult(_0x2f14d7,null))[_0x4f04('0x50')](handleError(_0x2f14d7,null));};exports['getAnyConditions']=function(_0x1663fa,_0x43a1ce,_0x4ef397){var _0x2ab65e={};var _0x46f8fa={};var _0x3e7160;var _0x52663e;return db[_0x4f04('0x2b')][_0x4f04('0x56')]({'where':{'id':_0x1663fa['params']['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x43a1ce,null))[_0x4f04('0x23')](function(_0x221c7a){if(_0x221c7a){_0x3e7160=_0x221c7a;_0x46f8fa[_0x4f04('0x2e')]=_['keys'](db[_0x4f04('0x53')][_0x4f04('0x47')]);_0x46f8fa[_0x4f04('0x2f')]=_[_0x4f04('0x30')](_0x1663fa['query']);_0x46f8fa[_0x4f04('0x31')]=_[_0x4f04('0x32')](_0x46f8fa[_0x4f04('0x2e')],_0x46f8fa['query']);_0x2ab65e['attributes']=_[_0x4f04('0x32')](_0x46f8fa[_0x4f04('0x2e')],qs['fields'](_0x1663fa[_0x4f04('0x2f')]['fields']));_0x2ab65e[_0x4f04('0x33')]=_0x2ab65e[_0x4f04('0x33')][_0x4f04('0x35')]?_0x2ab65e[_0x4f04('0x33')]:_0x46f8fa[_0x4f04('0x2e')];_0x2ab65e[_0x4f04('0x39')]=qs[_0x4f04('0x3a')](_0x1663fa[_0x4f04('0x2f')]['sort']);_0x2ab65e['where']=qs[_0x4f04('0x31')](_[_0x4f04('0x3c')](_0x1663fa['query'],_0x46f8fa[_0x4f04('0x31')]));if(_0x1663fa[_0x4f04('0x2f')][_0x4f04('0x3d')]){_0x2ab65e[_0x4f04('0x3b')]=_[_0x4f04('0x3e')](_0x2ab65e['where'],{'$or':_[_0x4f04('0x2a')](_0x2ab65e[_0x4f04('0x33')],function(_0x1a21dc){var _0x58f9ca={};_0x58f9ca[_0x1a21dc]={'$like':'%'+_0x1663fa[_0x4f04('0x2f')]['filter']+'%'};return _0x58f9ca;})});}_0x2ab65e=_['merge']({},_0x2ab65e,_0x1663fa[_0x4f04('0x41')]);return _0x3e7160[_0x4f04('0x57')](_0x2ab65e);}})[_0x4f04('0x23')](function(_0x3d3944){if(_0x3d3944){_0x52663e=_0x3d3944[_0x4f04('0x35')];if(!_0x1663fa['query'][_0x4f04('0x36')]('nolimit')){_0x2ab65e[_0x4f04('0x1b')]=qs[_0x4f04('0x1b')](_0x1663fa['query']['limit']);_0x2ab65e[_0x4f04('0x38')]=qs['offset'](_0x1663fa[_0x4f04('0x2f')][_0x4f04('0x38')]);}return _0x3e7160[_0x4f04('0x57')](_0x2ab65e);}})[_0x4f04('0x23')](function(_0x3fcf17){if(_0x3fcf17){return _0x3fcf17?{'count':_0x52663e,'rows':_0x3fcf17}:null;}})[_0x4f04('0x23')](respondWithResult(_0x43a1ce,null))[_0x4f04('0x50')](handleError(_0x43a1ce,null));};exports['addAction']=function(_0x315529,_0x47f65a,_0x1e8270){if(_0x315529[_0x4f04('0x52')]['id']){delete _0x315529[_0x4f04('0x52')]['id'];}return db[_0x4f04('0x2b')][_0x4f04('0x49')]({'where':{'id':_0x315529[_0x4f04('0x46')]['id']}})['then'](handleEntityNotFound(_0x47f65a,null))[_0x4f04('0x23')](function(_0x1f5e31){if(_0x1f5e31){_0x315529['body'][_0x4f04('0x58')]=_0x1f5e31['id'];return db[_0x4f04('0x59')][_0x4f04('0x4a')](_0x315529[_0x4f04('0x52')]);}})['then'](respondWithResult(_0x47f65a,null))[_0x4f04('0x50')](handleError(_0x47f65a,null));};exports[_0x4f04('0x5a')]=function(_0x571bbf,_0x42b0a1,_0x4238a0){var _0x298b5d={};var _0x49d13e={};var _0x5941d0;var _0x39cf67;return db[_0x4f04('0x2b')]['findOne']({'where':{'id':_0x571bbf[_0x4f04('0x46')]['id']}})[_0x4f04('0x23')](handleEntityNotFound(_0x42b0a1,null))[_0x4f04('0x23')](function(_0xcf9f0c){if(_0xcf9f0c){_0x5941d0=_0xcf9f0c;_0x49d13e[_0x4f04('0x2e')]=_[_0x4f04('0x30')](db[_0x4f04('0x59')]['rawAttributes']);_0x49d13e[_0x4f04('0x2f')]=_[_0x4f04('0x30')](_0x571bbf[_0x4f04('0x2f')]);_0x49d13e[_0x4f04('0x31')]=_[_0x4f04('0x32')](_0x49d13e[_0x4f04('0x2e')],_0x49d13e[_0x4f04('0x2f')]);_0x298b5d['attributes']=_['intersection'](_0x49d13e[_0x4f04('0x2e')],qs['fields'](_0x571bbf[_0x4f04('0x2f')][_0x4f04('0x34')]));_0x298b5d[_0x4f04('0x33')]=_0x298b5d[_0x4f04('0x33')][_0x4f04('0x35')]?_0x298b5d[_0x4f04('0x33')]:_0x49d13e[_0x4f04('0x2e')];_0x298b5d[_0x4f04('0x39')]=qs['sort'](_0x571bbf[_0x4f04('0x2f')]['sort']);_0x298b5d[_0x4f04('0x3b')]=qs['filters'](_[_0x4f04('0x3c')](_0x571bbf[_0x4f04('0x2f')],_0x49d13e[_0x4f04('0x31')]));if(_0x571bbf[_0x4f04('0x2f')][_0x4f04('0x3d')]){_0x298b5d[_0x4f04('0x3b')]=_[_0x4f04('0x3e')](_0x298b5d['where'],{'$or':_['map'](_0x298b5d[_0x4f04('0x33')],function(_0x5ceeb){var _0x2b8b5d={};_0x2b8b5d[_0x5ceeb]={'$like':'%'+_0x571bbf['query'][_0x4f04('0x3d')]+'%'};return _0x2b8b5d;})});}_0x298b5d=_[_0x4f04('0x3e')]({},_0x298b5d,_0x571bbf[_0x4f04('0x41')]);return _0x5941d0[_0x4f04('0x5a')](_0x298b5d);}})[_0x4f04('0x23')](function(_0x4d4593){if(_0x4d4593){_0x39cf67=_0x4d4593['length'];if(!_0x571bbf[_0x4f04('0x2f')][_0x4f04('0x36')]('nolimit')){_0x298b5d[_0x4f04('0x1b')]=qs['limit'](_0x571bbf[_0x4f04('0x2f')][_0x4f04('0x1b')]);_0x298b5d['offset']=qs[_0x4f04('0x38')](_0x571bbf[_0x4f04('0x2f')][_0x4f04('0x38')]);}return _0x5941d0['getActions'](_0x298b5d);}})['then'](function(_0x4b6400){if(_0x4b6400){return _0x4b6400?{'count':_0x39cf67,'rows':_0x4b6400}:null;}})[_0x4f04('0x23')](respondWithResult(_0x42b0a1,null))[_0x4f04('0x50')](handleError(_0x42b0a1,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 8463322..a13f55d 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 _0x72b1=['./trigger.attributes','exports','Trigger','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x41fb8f,_0x1b3b53){var _0x3cd09d=function(_0x1f5122){while(--_0x1f5122){_0x41fb8f['push'](_0x41fb8f['shift']());}};_0x3cd09d(++_0x1b3b53);}(_0x72b1,0x16e));var _0x172b=function(_0xd53ab1,_0x154c37){_0xd53ab1=_0xd53ab1-0x0;var _0x2d0d4a=_0x72b1[_0xd53ab1];return _0x2d0d4a;};'use strict';var _=require(_0x172b('0x0'));var util=require('util');var logger=require(_0x172b('0x1'))(_0x172b('0x2'));var moment=require(_0x172b('0x3'));var BPromise=require(_0x172b('0x4'));var rp=require(_0x172b('0x5'));var fs=require('fs');var path=require(_0x172b('0x6'));var rimraf=require(_0x172b('0x7'));var config=require('../../config/environment');var attributes=require(_0x172b('0x8'));module[_0x172b('0x9')]=function(_0x475fd6,_0x222624){return _0x475fd6['define'](_0x172b('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x238f=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Trigger'];(function(_0x87de13,_0x4bbd67){var _0x187249=function(_0x29b83e){while(--_0x29b83e){_0x87de13['push'](_0x87de13['shift']());}};_0x187249(++_0x4bbd67);}(_0x238f,0xa5));var _0xf238=function(_0x547af1,_0x435140){_0x547af1=_0x547af1-0x0;var _0x2efe83=_0x238f[_0x547af1];return _0x2efe83;};'use strict';var _=require(_0xf238('0x0'));var util=require(_0xf238('0x1'));var logger=require(_0xf238('0x2'))('api');var moment=require(_0xf238('0x3'));var BPromise=require(_0xf238('0x4'));var rp=require(_0xf238('0x5'));var fs=require('fs');var path=require(_0xf238('0x6'));var rimraf=require(_0xf238('0x7'));var config=require(_0xf238('0x8'));var attributes=require('./trigger.attributes');module[_0xf238('0x9')]=function(_0x2b9e9f,_0x4e4685){return _0x2b9e9f['define'](_0xf238('0xa'),attributes,{'tableName':'tools_triggers','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 5c36ed1..52eb087 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 _0x3b14=['options','raw','where','attributes','limit','include','map','model','GetTrigger','ShowTrigger','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then','info','debug','Trigger,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Trigger,\x20%s,\x20%s','message','result','catch','Trigger','findAll'];(function(_0x44ae69,_0x5141b4){var _0xe37f56=function(_0x3598ca){while(--_0x3598ca){_0x44ae69['push'](_0x44ae69['shift']());}};_0xe37f56(++_0x5141b4);}(_0x3b14,0x1c4));var _0x43b1=function(_0x51e6a9,_0x576fbc){_0x51e6a9=_0x51e6a9-0x0;var _0x223cec=_0x3b14[_0x51e6a9];return _0x223cec;};'use strict';var _=require('lodash');var util=require(_0x43b1('0x0'));var moment=require(_0x43b1('0x1'));var BPromise=require(_0x43b1('0x2'));var rs=require(_0x43b1('0x3'));var fs=require('fs');var Redis=require(_0x43b1('0x4'));var db=require(_0x43b1('0x5'))['db'];var utils=require(_0x43b1('0x6'));var logger=require('../../config/logger')(_0x43b1('0x7'));var config=require(_0x43b1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x43b1('0x9')][_0x43b1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x111dea,_0x59fd26,_0x143bab){return new BPromise(function(_0x5191ca,_0x11df1a){return client['request'](_0x111dea,_0x143bab)[_0x43b1('0xb')](function(_0x4f1126){logger[_0x43b1('0xc')]('Trigger,\x20%s,\x20%s',_0x59fd26,'request\x20sent');logger[_0x43b1('0xd')](_0x43b1('0xe'),_0x59fd26,_0x43b1('0xf'),JSON[_0x43b1('0x10')](_0x4f1126));if(_0x4f1126[_0x43b1('0x11')]){if(_0x4f1126['error']['code']===0x1f4){logger[_0x43b1('0x11')](_0x43b1('0x12'),_0x59fd26,_0x4f1126[_0x43b1('0x11')][_0x43b1('0x13')]);return _0x11df1a(_0x4f1126['error'][_0x43b1('0x13')]);}logger['error'](_0x43b1('0x12'),_0x59fd26,_0x4f1126['error'][_0x43b1('0x13')]);return _0x5191ca(_0x4f1126[_0x43b1('0x11')][_0x43b1('0x13')]);}else{logger[_0x43b1('0xc')](_0x43b1('0x12'),_0x59fd26,_0x43b1('0xf'));_0x5191ca(_0x4f1126[_0x43b1('0x14')][_0x43b1('0x13')]);}})[_0x43b1('0x15')](function(_0x2fcc9c){logger[_0x43b1('0x11')](_0x43b1('0x12'),_0x59fd26,_0x2fcc9c);_0x11df1a(_0x2fcc9c);});});}exports['GetTrigger']=function(_0xf7e3ec){var _0x38c489=this;return new Promise(function(_0x1424bf,_0x1f754f){return db[_0x43b1('0x16')][_0x43b1('0x17')]({'raw':_0xf7e3ec['options']?_0xf7e3ec[_0x43b1('0x18')][_0x43b1('0x19')]===undefined?!![]:![]:!![],'where':_0xf7e3ec[_0x43b1('0x18')]?_0xf7e3ec[_0x43b1('0x18')][_0x43b1('0x1a')]||null:null,'attributes':_0xf7e3ec[_0x43b1('0x18')]?_0xf7e3ec['options'][_0x43b1('0x1b')]||null:null,'limit':_0xf7e3ec[_0x43b1('0x18')]?_0xf7e3ec['options'][_0x43b1('0x1c')]||null:null,'include':_0xf7e3ec[_0x43b1('0x18')]?_0xf7e3ec[_0x43b1('0x18')][_0x43b1('0x1d')]?_[_0x43b1('0x1e')](_0xf7e3ec[_0x43b1('0x18')][_0x43b1('0x1d')],function(_0x1427a4){return{'model':db[_0x1427a4[_0x43b1('0x1f')]],'as':_0x1427a4['as'],'attributes':_0x1427a4[_0x43b1('0x1b')],'include':_0x1427a4[_0x43b1('0x1d')]?_[_0x43b1('0x1e')](_0x1427a4[_0x43b1('0x1d')],function(_0xd29aaa){return{'model':db[_0xd29aaa[_0x43b1('0x1f')]],'as':_0xd29aaa['as'],'attributes':_0xd29aaa[_0x43b1('0x1b')],'include':_0xd29aaa[_0x43b1('0x1d')]?_[_0x43b1('0x1e')](_0xd29aaa[_0x43b1('0x1d')],function(_0x2f8a96){return{'model':db[_0x2f8a96['model']],'as':_0x2f8a96['as'],'attributes':_0x2f8a96[_0x43b1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x43b1('0xb')](function(_0xc577bb){logger[_0x43b1('0xc')](_0x43b1('0x20'),_0xf7e3ec);logger[_0x43b1('0xd')](_0x43b1('0x20'),_0xf7e3ec,JSON[_0x43b1('0x10')](_0xc577bb));_0x1424bf(_0xc577bb);})[_0x43b1('0x15')](function(_0x1d2f0e){logger[_0x43b1('0x11')](_0x43b1('0x20'),_0x1d2f0e['message'],_0xf7e3ec);_0x1f754f(_0x38c489[_0x43b1('0x11')](0x1f4,_0x1d2f0e[_0x43b1('0x13')]));});});};exports[_0x43b1('0x21')]=function(_0xf9d633){var _0x10386b=this;return new Promise(function(_0x23be90,_0x58dcd6){return db['Trigger']['find']({'raw':_0xf9d633['options']?_0xf9d633[_0x43b1('0x18')][_0x43b1('0x19')]===undefined?!![]:![]:!![],'where':_0xf9d633['options']?_0xf9d633[_0x43b1('0x18')][_0x43b1('0x1a')]||null:null,'attributes':_0xf9d633[_0x43b1('0x18')]?_0xf9d633['options'][_0x43b1('0x1b')]||null:null,'include':_0xf9d633['options']?_0xf9d633['options'][_0x43b1('0x1d')]?_[_0x43b1('0x1e')](_0xf9d633[_0x43b1('0x18')][_0x43b1('0x1d')],function(_0x49d68e){return{'model':db[_0x49d68e[_0x43b1('0x1f')]],'as':_0x49d68e['as'],'attributes':_0x49d68e[_0x43b1('0x1b')],'include':_0x49d68e[_0x43b1('0x1d')]?_[_0x43b1('0x1e')](_0x49d68e[_0x43b1('0x1d')],function(_0x1c425d){return{'model':db[_0x1c425d['model']],'as':_0x1c425d['as'],'attributes':_0x1c425d[_0x43b1('0x1b')],'include':_0x1c425d['include']?_[_0x43b1('0x1e')](_0x1c425d[_0x43b1('0x1d')],function(_0x1b2d32){return{'model':db[_0x1b2d32[_0x43b1('0x1f')]],'as':_0x1b2d32['as'],'attributes':_0x1b2d32[_0x43b1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x43b1('0xb')](function(_0x5940d5){logger[_0x43b1('0xc')]('ShowTrigger',_0xf9d633);logger[_0x43b1('0xd')](_0x43b1('0x21'),_0xf9d633,JSON[_0x43b1('0x10')](_0x5940d5));_0x23be90(_0x5940d5);})[_0x43b1('0x15')](function(_0x5725eb){logger[_0x43b1('0x11')](_0x43b1('0x21'),_0x5725eb['message'],_0xf9d633);_0x58dcd6(_0x10386b[_0x43b1('0x11')](0x1f4,_0x5725eb[_0x43b1('0x13')]));});});}; \ No newline at end of file +var _0x9012=['request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','Trigger,\x20%s,\x20%s','message','result','Trigger','options','raw','where','attributes','limit','include','map','model','debug','GetTrigger','ShowTrigger','find','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5adcb0,_0x11ecb8){var _0x90afed=function(_0x504873){while(--_0x504873){_0x5adcb0['push'](_0x5adcb0['shift']());}};_0x90afed(++_0x11ecb8);}(_0x9012,0x135));var _0x2901=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0x9012[_0x59ae8f];return _0x3900b5;};'use strict';var _=require(_0x2901('0x0'));var util=require(_0x2901('0x1'));var moment=require('moment');var BPromise=require(_0x2901('0x2'));var rs=require(_0x2901('0x3'));var fs=require('fs');var Redis=require(_0x2901('0x4'));var db=require(_0x2901('0x5'))['db'];var utils=require(_0x2901('0x6'));var logger=require('../../config/logger')(_0x2901('0x7'));var config=require(_0x2901('0x8'));var jayson=require(_0x2901('0x9'));var client=jayson[_0x2901('0xa')][_0x2901('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b67fe,_0x1bdd6b,_0x2187b1){return new BPromise(function(_0x13a3d9,_0x52ecba){return client[_0x2901('0xc')](_0x1b67fe,_0x2187b1)[_0x2901('0xd')](function(_0x592a8a){logger[_0x2901('0xe')]('Trigger,\x20%s,\x20%s',_0x1bdd6b,_0x2901('0xf'));logger['debug'](_0x2901('0x10'),_0x1bdd6b,_0x2901('0xf'),JSON[_0x2901('0x11')](_0x592a8a));if(_0x592a8a[_0x2901('0x12')]){if(_0x592a8a[_0x2901('0x12')]['code']===0x1f4){logger[_0x2901('0x12')](_0x2901('0x13'),_0x1bdd6b,_0x592a8a[_0x2901('0x12')][_0x2901('0x14')]);return _0x52ecba(_0x592a8a['error']['message']);}logger['error'](_0x2901('0x13'),_0x1bdd6b,_0x592a8a[_0x2901('0x12')][_0x2901('0x14')]);return _0x13a3d9(_0x592a8a['error']['message']);}else{logger['info'](_0x2901('0x13'),_0x1bdd6b,_0x2901('0xf'));_0x13a3d9(_0x592a8a[_0x2901('0x15')][_0x2901('0x14')]);}})['catch'](function(_0x321b7f){logger[_0x2901('0x12')](_0x2901('0x13'),_0x1bdd6b,_0x321b7f);_0x52ecba(_0x321b7f);});});}exports['GetTrigger']=function(_0x249586){var _0x731925=this;return new Promise(function(_0x45a4d0,_0x41779b){return db[_0x2901('0x16')]['findAll']({'raw':_0x249586[_0x2901('0x17')]?_0x249586['options'][_0x2901('0x18')]===undefined?!![]:![]:!![],'where':_0x249586[_0x2901('0x17')]?_0x249586[_0x2901('0x17')][_0x2901('0x19')]||null:null,'attributes':_0x249586['options']?_0x249586[_0x2901('0x17')][_0x2901('0x1a')]||null:null,'limit':_0x249586[_0x2901('0x17')]?_0x249586['options'][_0x2901('0x1b')]||null:null,'include':_0x249586['options']?_0x249586[_0x2901('0x17')][_0x2901('0x1c')]?_[_0x2901('0x1d')](_0x249586[_0x2901('0x17')][_0x2901('0x1c')],function(_0x3c0d22){return{'model':db[_0x3c0d22[_0x2901('0x1e')]],'as':_0x3c0d22['as'],'attributes':_0x3c0d22['attributes'],'include':_0x3c0d22[_0x2901('0x1c')]?_['map'](_0x3c0d22[_0x2901('0x1c')],function(_0x5903db){return{'model':db[_0x5903db[_0x2901('0x1e')]],'as':_0x5903db['as'],'attributes':_0x5903db[_0x2901('0x1a')],'include':_0x5903db[_0x2901('0x1c')]?_[_0x2901('0x1d')](_0x5903db[_0x2901('0x1c')],function(_0xb6e83d){return{'model':db[_0xb6e83d[_0x2901('0x1e')]],'as':_0xb6e83d['as'],'attributes':_0xb6e83d[_0x2901('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x2901('0xd')](function(_0x4706bb){logger[_0x2901('0xe')]('GetTrigger',_0x249586);logger[_0x2901('0x1f')](_0x2901('0x20'),_0x249586,JSON[_0x2901('0x11')](_0x4706bb));_0x45a4d0(_0x4706bb);})['catch'](function(_0x1189e9){logger[_0x2901('0x12')]('GetTrigger',_0x1189e9[_0x2901('0x14')],_0x249586);_0x41779b(_0x731925[_0x2901('0x12')](0x1f4,_0x1189e9[_0x2901('0x14')]));});});};exports[_0x2901('0x21')]=function(_0x187c37){var _0x476772=this;return new Promise(function(_0x47f3f3,_0x363099){return db[_0x2901('0x16')][_0x2901('0x22')]({'raw':_0x187c37['options']?_0x187c37['options'][_0x2901('0x18')]===undefined?!![]:![]:!![],'where':_0x187c37[_0x2901('0x17')]?_0x187c37[_0x2901('0x17')]['where']||null:null,'attributes':_0x187c37['options']?_0x187c37['options'][_0x2901('0x1a')]||null:null,'include':_0x187c37[_0x2901('0x17')]?_0x187c37[_0x2901('0x17')][_0x2901('0x1c')]?_[_0x2901('0x1d')](_0x187c37[_0x2901('0x17')]['include'],function(_0x41eba0){return{'model':db[_0x41eba0[_0x2901('0x1e')]],'as':_0x41eba0['as'],'attributes':_0x41eba0[_0x2901('0x1a')],'include':_0x41eba0[_0x2901('0x1c')]?_['map'](_0x41eba0[_0x2901('0x1c')],function(_0x5c97c0){return{'model':db[_0x5c97c0['model']],'as':_0x5c97c0['as'],'attributes':_0x5c97c0[_0x2901('0x1a')],'include':_0x5c97c0['include']?_[_0x2901('0x1d')](_0x5c97c0['include'],function(_0x4ef7f3){return{'model':db[_0x4ef7f3[_0x2901('0x1e')]],'as':_0x4ef7f3['as'],'attributes':_0x4ef7f3[_0x2901('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x588873){logger['info'](_0x2901('0x21'),_0x187c37);logger[_0x2901('0x1f')](_0x2901('0x21'),_0x187c37,JSON['stringify'](_0x588873));_0x47f3f3(_0x588873);})[_0x2901('0x23')](function(_0x221704){logger['error'](_0x2901('0x21'),_0x221704['message'],_0x187c37);_0x363099(_0x476772[_0x2901('0x12')](0x1f4,_0x221704['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d570087..7d6411d 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 _0x8734=['create','put','update','delete','destroy','util','connect-timeout','express','fs-extra','../../components/interaction/service','./trunk.controller','get','/:id','show','post','/:id/clone','isAuthenticated','clone'];(function(_0x3c0a36,_0x8e2f2b){var _0x5ac4cb=function(_0x42b695){while(--_0x42b695){_0x3c0a36['push'](_0x3c0a36['shift']());}};_0x5ac4cb(++_0x8e2f2b);}(_0x8734,0x1a3));var _0x4873=function(_0x4d3187,_0x267c51){_0x4d3187=_0x4d3187-0x0;var _0x107906=_0x8734[_0x4d3187];return _0x107906;};'use strict';var multer=require('multer');var util=require(_0x4873('0x0'));var path=require('path');var timeout=require(_0x4873('0x1'));var express=require(_0x4873('0x2'));var router=express['Router']();var fs_extra=require(_0x4873('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4873('0x4'));var config=require('../../config/environment');var controller=require(_0x4873('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x4873('0x6')](_0x4873('0x7'),auth['isAuthenticated'](),controller[_0x4873('0x8')]);router[_0x4873('0x9')](_0x4873('0xa'),auth[_0x4873('0xb')](),controller[_0x4873('0xc')]);router[_0x4873('0x9')]('/',auth[_0x4873('0xb')](),controller[_0x4873('0xd')]);router[_0x4873('0xe')](_0x4873('0x7'),auth[_0x4873('0xb')](),controller[_0x4873('0xf')]);router[_0x4873('0x10')](_0x4873('0x7'),auth[_0x4873('0xb')](),controller[_0x4873('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe666=['../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','util','connect-timeout','express','fs-extra'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0xe666,0x183));var _0x6e66=function(_0x298e16,_0x2c4521){_0x298e16=_0x298e16-0x0;var _0x11262e=_0xe666[_0x298e16];return _0x11262e;};'use strict';var multer=require('multer');var util=require(_0x6e66('0x0'));var path=require('path');var timeout=require(_0x6e66('0x1'));var express=require(_0x6e66('0x2'));var router=express['Router']();var fs_extra=require(_0x6e66('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x6e66('0x4'));var config=require(_0x6e66('0x5'));var controller=require(_0x6e66('0x6'));router[_0x6e66('0x7')]('/',auth[_0x6e66('0x8')](),controller[_0x6e66('0x9')]);router[_0x6e66('0x7')](_0x6e66('0xa'),auth['isAuthenticated'](),controller[_0x6e66('0xb')]);router['post']('/:id/clone',auth[_0x6e66('0x8')](),controller['clone']);router['post']('/',auth['isAuthenticated'](),controller[_0x6e66('0xc')]);router[_0x6e66('0xd')](_0x6e66('0xa'),auth[_0x6e66('0x8')](),controller[_0x6e66('0xe')]);router[_0x6e66('0xf')]('/:id',auth[_0x6e66('0x8')](),controller['destroy']);module[_0x6e66('0x10')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 29ee877..0e7fc6a 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 _0xe090=['yes','nonat','update','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','pai','fingerprint','passive','actpass','dynamic','BOOLEAN','sequelize','name','ENUM','peer','friend','STRING','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','setDataValue','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','auto'];(function(_0x4898de,_0x22a533){var _0x24a091=function(_0x1fdcd5){while(--_0x1fdcd5){_0x4898de['push'](_0x4898de['shift']());}};_0x24a091(++_0x22a533);}(_0xe090,0xd1));var _0x0e09=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xe090[_0x5ddaac];return _0x2a9c58;};'use strict';var Sequelize=require(_0x0e09('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0e09('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x0e09('0x2')]('friend','user',_0x0e09('0x3')),'allowNull':![],'defaultValue':_0x0e09('0x4')},'context':{'type':Sequelize[_0x0e09('0x5')],'allowNull':![],'defaultValue':_0x0e09('0x6')},'callingpres':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x7'),'ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0x0e09('0x8'),_0x0e09('0x9'),_0x0e09('0xa'),_0x0e09('0xb'),'PROHIB')},'deny':{'type':Sequelize[_0x0e09('0x5')]},'permit':{'type':Sequelize[_0x0e09('0x5')]},'secret':{'type':Sequelize[_0x0e09('0x5')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x0e09('0x5')]},'transport':{'type':Sequelize[_0x0e09('0x5')],'defaultValue':_0x0e09('0xc'),'set':function(_0x1212c1){this[_0x0e09('0xd')]('transport',_0x1212c1?_0x1212c1['join'](','):null);},'get':function(){return this[_0x0e09('0xe')](_0x0e09('0xf'))?this['getDataValue'](_0x0e09('0xf'))[_0x0e09('0x10')](','):null;},'comment':_0x0e09('0x11')},'dtmfmode':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x12'),'info',_0x0e09('0x13'),'inband',_0x0e09('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no',_0x0e09('0x16'),_0x0e09('0x17'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0e09('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0x0e09('0x5')],'defaultValue':'force_rport,comedia','set':function(_0x2af33f){this['setDataValue']('nat',_0x2af33f?_0x2af33f[_0x0e09('0x18')](','):null);},'get':function(){return this[_0x0e09('0xe')]('nat')?this['getDataValue']('nat')['split'](','):null;},'comment':_0x0e09('0x19')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0e09('0x5')]},'pickupgroup':{'type':Sequelize[_0x0e09('0x5')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0e09('0x5')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0e09('0x5')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x0e09('0x1a')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0e09('0x1b'),'set':function(_0x5c31ff){this[_0x0e09('0xd')]('allow',_0x5c31ff?_0x5c31ff[_0x0e09('0x18')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x0e09('0x1c'))?this[_0x0e09('0xe')](_0x0e09('0x1c'))[_0x0e09('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0x0e09('0x15'),'no')},'insecure':{'type':Sequelize[_0x0e09('0x5')],'defaultValue':_0x0e09('0x1d'),'set':function(_0x426c04){this[_0x0e09('0xd')](_0x0e09('0x1e'),_0x426c04?_0x426c04['join'](','):null);},'get':function(){return this[_0x0e09('0xe')](_0x0e09('0x1e'))?this[_0x0e09('0xe')](_0x0e09('0x1e'))[_0x0e09('0x10')](','):null;},'comment':_0x0e09('0x1f')},'trustrpid':{'type':Sequelize[_0x0e09('0x2')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0e09('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0x0e09('0x20'))},'promiscredir':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x0e09('0x15'),'no')},'accountcode':{'type':Sequelize[_0x0e09('0x21')](0xb)},'setvar':{'type':Sequelize[_0x0e09('0x5')]},'callerid':{'type':Sequelize[_0x0e09('0x5')],'defaultValue':_0x0e09('0x22')},'amaflags':{'type':Sequelize[_0x0e09('0x5')]},'callcounter':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no'),'defaultValue':_0x0e09('0x15')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x0e09('0x2')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no')},'allowtransfer':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no')},'ignoresdpversion':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no')},'subscribecontext':{'type':Sequelize[_0x0e09('0x5')]},'template':{'type':Sequelize[_0x0e09('0x5')]},'videosupport':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no',_0x0e09('0x23')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0e09('0x21')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no')},'mailbox':{'type':Sequelize[_0x0e09('0x5')]},'session_timers':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x24'),_0x0e09('0x25'),_0x0e09('0x26'))},'session_expires':{'type':Sequelize[_0x0e09('0x21')](0xb)},'session_minse':{'type':Sequelize[_0x0e09('0x21')](0xb)},'session_refresher':{'type':Sequelize[_0x0e09('0x2')]('uac',_0x0e09('0x27')),'defaultValue':_0x0e09('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x0e09('0x5')]},'regexten':{'type':Sequelize[_0x0e09('0x5')]},'fromdomain':{'type':Sequelize[_0x0e09('0x5')]},'fromuser':{'type':Sequelize[_0x0e09('0x5')]},'port':{'type':Sequelize[_0x0e09('0x21')](0x5)},'qualify':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no'),'defaultValue':_0x0e09('0x15')},'keepalive':{'type':Sequelize[_0x0e09('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x0e09('0x5')]},'defaultuser':{'type':Sequelize[_0x0e09('0x5')]},'rtptimeout':{'type':Sequelize[_0x0e09('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x0e09('0x21')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x0e09('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no',_0x0e09('0x28')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0e09('0x5')]},'callbackextension':{'type':Sequelize[_0x0e09('0x5')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x0e09('0x21')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x0e09('0x5')]},'contactacl':{'type':Sequelize[_0x0e09('0x5')]},'unsolicited_mailbox':{'type':Sequelize[_0x0e09('0x5')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x0e09('0x21')](0xb)},'encryption':{'type':Sequelize[_0x0e09('0x2')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0e09('0x2')]('yes','no')},'force_avp':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x0e09('0x15'),'no')},'dtlsenable':{'type':Sequelize['ENUM']('yes','no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x0e09('0x15'),'no',_0x0e09('0x29'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x0e09('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x0e09('0x5')]},'dtlsprivatekey':{'type':Sequelize[_0x0e09('0x5')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize[_0x0e09('0x5')]},'dtlscapath':{'type':Sequelize[_0x0e09('0x5')]},'dtlssetup':{'type':Sequelize[_0x0e09('0x2')]('active',_0x0e09('0x2a'),_0x0e09('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0e09('0x5')]},'usereqphone':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0e09('0x5')]},'recordofffeature':{'type':Sequelize[_0x0e09('0x5')]},'call_limit':{'type':Sequelize[_0x0e09('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x0e09('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no')},'vmexten':{'type':Sequelize[_0x0e09('0x5')]},'mohinterpret':{'type':Sequelize[_0x0e09('0x5')]},'mohsuggest':{'type':Sequelize[_0x0e09('0x5')]},'parkinglot':{'type':Sequelize[_0x0e09('0x5')]},'description':{'type':Sequelize[_0x0e09('0x5')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x0e09('0x2c')},'canreinvite':{'type':Sequelize[_0x0e09('0x2')](_0x0e09('0x15'),'no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0e09('0x2d')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x0e09('0x5')],'defaultValue':'no'}}; \ No newline at end of file +var _0x6f2d=['getDataValue','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','setDataValue','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','active','actpass','dynamic','BOOLEAN','exports','STRING','ENUM','friend','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','transport','join'];(function(_0x53bef4,_0x3faddf){var _0xc5c4f0=function(_0x48b61d){while(--_0x48b61d){_0x53bef4['push'](_0x53bef4['shift']());}};_0xc5c4f0(++_0x3faddf);}(_0x6f2d,0xa3));var _0xd6f2=function(_0x56dc77,_0x509aa5){_0x56dc77=_0x56dc77-0x0;var _0x1a03ff=_0x6f2d[_0x56dc77];return _0x1a03ff;};'use strict';var Sequelize=require('sequelize');module[_0xd6f2('0x0')]={'name':{'type':Sequelize[_0xd6f2('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x3'),_0xd6f2('0x4'),_0xd6f2('0x5')),'allowNull':![],'defaultValue':_0xd6f2('0x3')},'context':{'type':Sequelize[_0xd6f2('0x1')],'allowNull':![],'defaultValue':_0xd6f2('0x6')},'callingpres':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x7'),_0xd6f2('0x8'),'ALLOWED_FAILED_SCREEN',_0xd6f2('0x9'),'PROHIB_NOT_SCREENED',_0xd6f2('0xa'),'PROHIB_FAILED_SCREEN','PROHIB')},'deny':{'type':Sequelize[_0xd6f2('0x1')]},'permit':{'type':Sequelize[_0xd6f2('0x1')]},'secret':{'type':Sequelize[_0xd6f2('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xd6f2('0x1')]},'transport':{'type':Sequelize[_0xd6f2('0x1')],'defaultValue':'udp','set':function(_0x2bdf29){this['setDataValue'](_0xd6f2('0xb'),_0x2bdf29?_0x2bdf29[_0xd6f2('0xc')](','):null);},'get':function(){return this[_0xd6f2('0xd')]('transport')?this[_0xd6f2('0xd')]('transport')[_0xd6f2('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize['ENUM'](_0xd6f2('0xf'),_0xd6f2('0x10'),_0xd6f2('0x11'),_0xd6f2('0x12'),_0xd6f2('0x13')),'defaultValue':_0xd6f2('0xf')},'directmedia':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no',_0xd6f2('0x15'),_0xd6f2('0x16'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0xd6f2('0x14'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd6f2('0x1')]},'directmediadeny':{'type':Sequelize[_0xd6f2('0x1')]},'nat':{'type':Sequelize[_0xd6f2('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x27a7a2){this['setDataValue'](_0xd6f2('0x17'),_0x27a7a2?_0x27a7a2[_0xd6f2('0xc')](','):null);},'get':function(){return this['getDataValue'](_0xd6f2('0x17'))?this[_0xd6f2('0xd')]('nat')['split'](','):null;},'comment':_0xd6f2('0x18')},'callgroup':{'type':Sequelize[_0xd6f2('0x1')]},'namedcallgroup':{'type':Sequelize[_0xd6f2('0x1')]},'pickupgroup':{'type':Sequelize[_0xd6f2('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xd6f2('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd6f2('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xd6f2('0x1')],'defaultValue':_0xd6f2('0x19')},'allow':{'type':Sequelize[_0xd6f2('0x1')],'allowNull':![],'defaultValue':_0xd6f2('0x1a'),'set':function(_0x2207fb){this[_0xd6f2('0x1b')](_0xd6f2('0x1c'),_0x2207fb?_0x2207fb['join'](';'):_0xd6f2('0x1a'));},'get':function(){return this[_0xd6f2('0xd')](_0xd6f2('0x1c'))?this['getDataValue'](_0xd6f2('0x1c'))[_0xd6f2('0xe')](';'):null;},'comment':_0xd6f2('0x1d')},'autoframing':{'type':Sequelize['ENUM'](_0xd6f2('0x14'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x4ab94d){this[_0xd6f2('0x1b')]('insecure',_0x4ab94d?_0x4ab94d[_0xd6f2('0xc')](','):null);},'get':function(){return this['getDataValue'](_0xd6f2('0x1e'))?this[_0xd6f2('0xd')](_0xd6f2('0x1e'))[_0xd6f2('0xe')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd6f2('0x2')]('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no',_0xd6f2('0x1f'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize['ENUM'](_0xd6f2('0x14'),'no')},'accountcode':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xd6f2('0x21')},'amaflags':{'type':Sequelize[_0xd6f2('0x1')]},'callcounter':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no'),'defaultValue':_0xd6f2('0x14')},'busylevel':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'allowoverlap':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'allowsubscribe':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'allowtransfer':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'ignoresdpversion':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'subscribecontext':{'type':Sequelize[_0xd6f2('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no',_0xd6f2('0x22')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'mailbox':{'type':Sequelize[_0xd6f2('0x1')]},'session_timers':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x23'),_0xd6f2('0x24'),_0xd6f2('0x25'))},'session_expires':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xd6f2('0x2')]('uac',_0xd6f2('0x26')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xd6f2('0x1')]},'regexten':{'type':Sequelize[_0xd6f2('0x1')]},'fromdomain':{'type':Sequelize[_0xd6f2('0x1')]},'fromuser':{'type':Sequelize[_0xd6f2('0x1')]},'port':{'type':Sequelize[_0xd6f2('0x20')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xd6f2('0x14'),'no'),'defaultValue':_0xd6f2('0x14')},'keepalive':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'defaultip':{'type':Sequelize[_0xd6f2('0x1')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'sendrpid':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'timerb':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0xd6f2('0x1')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'force_avp':{'type':Sequelize[_0xd6f2('0x2')]('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0xd6f2('0x14'),'no')},'dtlsenable':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'dtlsverify':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no',_0xd6f2('0x27'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xd6f2('0x20')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd6f2('0x1')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0xd6f2('0x1')]},'dtlscafile':{'type':Sequelize[_0xd6f2('0x1')]},'dtlscapath':{'type':Sequelize[_0xd6f2('0x1')]},'dtlssetup':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x28'),'passive',_0xd6f2('0x29')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd6f2('0x1')]},'usereqphone':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd6f2('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0xd6f2('0x20')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'subscribemwi':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no')},'vmexten':{'type':Sequelize[_0xd6f2('0x1')]},'mohinterpret':{'type':Sequelize[_0xd6f2('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xd6f2('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0xd6f2('0x2a')},'canreinvite':{'type':Sequelize[_0xd6f2('0x2')](_0xd6f2('0x14'),'no',_0xd6f2('0x15'),'update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd6f2('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xd6f2('0x2b')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xd6f2('0x1')],'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 4376895..7759a50 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 _0xf2ca=['omit','createdAt','body','updatedAt','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','Trunks','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','Trunk','find','clone'];(function(_0x806d40,_0x5b1344){var _0x2bec86=function(_0x47c2ca){while(--_0x47c2ca){_0x806d40['push'](_0x806d40['shift']());}};_0x2bec86(++_0x5b1344);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x596684,_0x3e7a0a){_0x596684=_0x596684-0x0;var _0x21d272=_0xf2ca[_0x596684];return _0x21d272;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];var jayson=require(_0xaf2c('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15ccb4,_0x8eaf9b,_0x935959,_0x18a8a5){return new BPromise(function(_0x293ca6,_0x152c73){var _0x214f47=_0x18a8a5||client;return _0x214f47[_0xaf2c('0x19')](_0x15ccb4,_0x935959)[_0xaf2c('0x1a')](function(_0x1d0633){logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,_0xaf2c('0x1d'));logger[_0xaf2c('0x1e')](_0xaf2c('0x1f'),_0x8eaf9b,'request\x20sent',JSON[_0xaf2c('0x20')](_0x1d0633));if(_0x1d0633['error']){if(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x22')]===0x1f4){logger[_0xaf2c('0x21')]('Trunk,\x20%s,\x20%s',_0x8eaf9b,_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);return _0x152c73(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}logger[_0xaf2c('0x21')](_0xaf2c('0x1c'),_0x8eaf9b,_0x1d0633['error'][_0xaf2c('0x23')]);return _0x293ca6(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}else{logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,'request\x20sent');_0x293ca6(_0x1d0633[_0xaf2c('0x24')][_0xaf2c('0x23')]);}})[_0xaf2c('0x25')](function(_0x4be6ed){logger['error'](_0xaf2c('0x1c'),_0x8eaf9b,_0x4be6ed);_0x152c73(_0x4be6ed);});});}function respondWithStatusCode(_0x303546,_0x1cafad){_0x1cafad=_0x1cafad||0xcc;return function(_0x99f78d){if(_0x99f78d){return _0x303546['sendStatus'](_0x1cafad);}return _0x303546[_0xaf2c('0x26')](_0x1cafad)[_0xaf2c('0x27')]();};}function respondWithResult(_0x3a0145,_0x3c1ae6){_0x3c1ae6=_0x3c1ae6||0xc8;return function(_0xe929b5){if(_0xe929b5){return _0x3a0145[_0xaf2c('0x26')](_0x3c1ae6)[_0xaf2c('0x28')](_0xe929b5);}};}function respondWithFilteredResult(_0x4a8dd8,_0x29f8b0){return function(_0x2051be){if(_0x2051be){var _0x36f37c=typeof _0x29f8b0[_0xaf2c('0x29')]==='undefined'&&typeof _0x29f8b0[_0xaf2c('0x2a')]==='undefined';var _0x38db1b=_0x2051be[_0xaf2c('0x2b')];var _0x15466b=_0x36f37c?0x0:_0x29f8b0['offset'];var _0x2747bb=_0x36f37c?_0x2051be[_0xaf2c('0x2b')]:_0x29f8b0[_0xaf2c('0x29')]+_0x29f8b0['limit'];var _0xe18ba7;if(_0x2747bb>=_0x38db1b){_0x2747bb=_0x38db1b;_0xe18ba7=0xc8;}else{_0xe18ba7=0xce;}_0x4a8dd8[_0xaf2c('0x26')](_0xe18ba7);return _0x4a8dd8[_0xaf2c('0x2c')](_0xaf2c('0x2d'),_0x15466b+'-'+_0x2747bb+'/'+_0x38db1b)['json'](_0x2051be);}return null;};}function patchUpdates(_0x3da072){return function(_0x4072ff){try{jsonpatch[_0xaf2c('0x2e')](_0x4072ff,_0x3da072,!![]);}catch(_0x51a49c){return BPromise['reject'](_0x51a49c);}return _0x4072ff[_0xaf2c('0x2f')]();};}function saveUpdates(_0x4c9b4f,_0x39c0ed){return function(_0x5e7247){if(_0x5e7247){return _0x5e7247[_0xaf2c('0x30')](_0x4c9b4f)[_0xaf2c('0x1a')](function(_0x4ffbb9){return _0x4ffbb9;});}return null;};}function removeEntity(_0x1408e3,_0x5403f8){return function(_0x54db57){if(_0x54db57){return _0x54db57[_0xaf2c('0x31')]()[_0xaf2c('0x1a')](function(){var _0x211a69=_0x54db57[_0xaf2c('0x32')]({'plain':!![]});var _0x2d6ed7=_0xaf2c('0x33');return db['UserProfileResource'][_0xaf2c('0x31')]({'where':{'type':_0x2d6ed7,'resourceId':_0x211a69['id']}})['then'](function(){return _0x54db57;});})[_0xaf2c('0x1a')](function(){_0x1408e3['status'](0xcc)[_0xaf2c('0x27')]();});}};}function handleEntityNotFound(_0x59f686,_0x2f3d16){return function(_0x4e877e){if(!_0x4e877e){_0x59f686[_0xaf2c('0x34')](0x194);}return _0x4e877e;};}function handleError(_0x4b9c6b,_0x30fd87){_0x30fd87=_0x30fd87||0x1f4;return function(_0x356402){logger[_0xaf2c('0x21')](_0x356402[_0xaf2c('0x35')]);if(_0x356402[_0xaf2c('0x36')]){delete _0x356402['name'];}_0x4b9c6b['status'](_0x30fd87)[_0xaf2c('0x37')](_0x356402);};}exports[_0xaf2c('0x38')]=function(_0x409700,_0xa44813){var _0x4eeecf={},_0x316238={},_0x573db3={'count':0x0,'rows':[]};var _0xa1248e=_[_0xaf2c('0x39')](db['Trunk'][_0xaf2c('0x3a')],function(_0x24668d){return{'name':_0x24668d[_0xaf2c('0x3b')],'type':_0x24668d[_0xaf2c('0x3c')][_0xaf2c('0x3d')]};});_0x316238[_0xaf2c('0x3e')]=_[_0xaf2c('0x39')](_0xa1248e,_0xaf2c('0x36'));_0x316238[_0xaf2c('0x3f')]=_[_0xaf2c('0x40')](_0x409700[_0xaf2c('0x3f')]);_0x316238[_0xaf2c('0x41')]=_[_0xaf2c('0x42')](_0x316238['model'],_0x316238['query']);_0x4eeecf['attributes']=_[_0xaf2c('0x42')](_0x316238[_0xaf2c('0x3e')],qs[_0xaf2c('0x43')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x4eeecf[_0xaf2c('0x44')]=_0x4eeecf['attributes'][_0xaf2c('0x45')]?_0x4eeecf[_0xaf2c('0x44')]:_0x316238[_0xaf2c('0x3e')];if(!_0x409700['query']['hasOwnProperty'](_0xaf2c('0x46'))){_0x4eeecf['limit']=qs[_0xaf2c('0x2a')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x2a')]);_0x4eeecf[_0xaf2c('0x29')]=qs['offset'](_0x409700[_0xaf2c('0x3f')]['offset']);}_0x4eeecf[_0xaf2c('0x47')]=qs[_0xaf2c('0x48')](_0x409700['query'][_0xaf2c('0x48')]);_0x4eeecf['where']=qs[_0xaf2c('0x41')](_[_0xaf2c('0x49')](_0x409700[_0xaf2c('0x3f')],_0x316238[_0xaf2c('0x41')]),_0xa1248e);if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]){_0x4eeecf[_0xaf2c('0x4b')]=_[_0xaf2c('0x4c')](_0x4eeecf[_0xaf2c('0x4b')],{'$or':_['map'](_0xa1248e,function(_0x51d751){if(_0x51d751[_0xaf2c('0x3c')]!=='VIRTUAL'){var _0x4ad36e={};_0x4ad36e[_0x51d751['name']]={'$like':'%'+_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]+'%'};return _0x4ad36e;}})});}_0x4eeecf=_[_0xaf2c('0x4c')]({},_0x4eeecf,_0x409700[_0xaf2c('0x4d')]);var _0x599b2d={'where':_0x4eeecf[_0xaf2c('0x4b')]};return db['Trunk'][_0xaf2c('0x2b')](_0x599b2d)['then'](function(_0x166c26){_0x573db3[_0xaf2c('0x2b')]=_0x166c26;if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x4eeecf[_0xaf2c('0x4f')]=[{'all':!![]}];}return db['Trunk'][_0xaf2c('0x50')](_0x4eeecf);})[_0xaf2c('0x1a')](function(_0x4b3ca4){_0x573db3['rows']=_0x4b3ca4;return _0x573db3;})[_0xaf2c('0x1a')](respondWithFilteredResult(_0xa44813,_0x4eeecf))['catch'](handleError(_0xa44813,null));};exports[_0xaf2c('0x51')]=function(_0x23642b,_0x17b9ec){var _0x315b9f={'raw':![],'where':{'id':_0x23642b[_0xaf2c('0x52')]['id']}},_0x367112={};_0x367112[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x367112[_0xaf2c('0x3f')]=_['keys'](_0x23642b[_0xaf2c('0x3f')]);_0x367112[_0xaf2c('0x41')]=_['intersection'](_0x367112['model'],_0x367112['query']);_0x315b9f[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x367112['model'],qs[_0xaf2c('0x43')](_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x315b9f[_0xaf2c('0x44')]=_0x315b9f[_0xaf2c('0x44')][_0xaf2c('0x45')]?_0x315b9f[_0xaf2c('0x44')]:_0x367112['model'];if(_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x315b9f['include']=[{'all':!![]}];}_0x315b9f=_[_0xaf2c('0x4c')]({},_0x315b9f,_0x23642b[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x315b9f)[_0xaf2c('0x1a')](handleEntityNotFound(_0x17b9ec,null))[_0xaf2c('0x1a')](respondWithResult(_0x17b9ec,null))[_0xaf2c('0x25')](handleError(_0x17b9ec,null));};exports[_0xaf2c('0x55')]=function(_0x19b82d,_0x300254){var _0x133678={'where':{'id':_0x19b82d[_0xaf2c('0x52')]['id']}},_0x10a270={};_0x10a270[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x133678[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x10a270[_0xaf2c('0x3e')],qs['fields'](_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x133678[_0xaf2c('0x44')]=_0x133678['attributes'][_0xaf2c('0x45')]?_0x133678['attributes']:_0x10a270[_0xaf2c('0x3e')];if(_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x133678[_0xaf2c('0x4f')]=[{'all':!![]}];}_0x133678=_[_0xaf2c('0x4c')]({},_0x133678,_0x19b82d[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x133678)[_0xaf2c('0x1a')](handleEntityNotFound(_0x300254,null))['then'](function(_0x41d08b){if(_0x41d08b){var _0x400dcd=_0x41d08b[_0xaf2c('0x32')]({'plain':!![]});_0x400dcd=qs[_0xaf2c('0x56')](_0x400dcd,['id',_0xaf2c('0x57'),'updatedAt']);_0x19b82d[_0xaf2c('0x58')]=_[_0xaf2c('0x56')](_0x19b82d['body'],['id',_0xaf2c('0x57'),_0xaf2c('0x59')]);return db['Trunk']['create'](_[_0xaf2c('0x4c')](_0x400dcd,_0x19b82d[_0xaf2c('0x58')]),{'include':_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x36b6f0){var _0x3f48f1=_0x19b82d['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3f48f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f48f1[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x16e9f4=_0x36b6f0[_0xaf2c('0x32')]({'plain':!![]});var _0x1a297e=_0xaf2c('0x33');return db[_0xaf2c('0x5c')][_0xaf2c('0x54')]({'where':{'name':_0x1a297e,'userProfileId':_0x3f48f1[_0xaf2c('0x5d')]},'raw':!![]})[_0xaf2c('0x1a')](function(_0x53ba41){if(_0x53ba41&&_0x53ba41[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')][_0xaf2c('0x60')]({'name':_0x16e9f4[_0xaf2c('0x36')],'resourceId':_0x16e9f4['id'],'type':_0x53ba41[_0xaf2c('0x36')],'sectionId':_0x53ba41['id']},{})['then'](function(){return _0x36b6f0;});}else{return _0x36b6f0;}})[_0xaf2c('0x25')](function(_0x28b09f){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x28b09f);throw _0x28b09f;});}return _0x36b6f0;});}})[_0xaf2c('0x1a')](respondWithResult(_0x300254,0xc9))['catch'](handleError(_0x300254,null));};exports['create']=function(_0x1166c9,_0x1ead61,_0x5849f8){var _0xf96361;return db[_0xaf2c('0x53')][_0xaf2c('0x60')](_0x1166c9['body'],{'raw':!![]})[_0xaf2c('0x1a')](function(_0x2bd845){_0xf96361=_0x2bd845;return db[_0xaf2c('0x53')][_0xaf2c('0x50')]({'raw':!![]});})['then'](function(_0x32d552){var _0x26129c=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2767c7=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x5d965c=ejs[_0xaf2c('0x67')](_0x26129c,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5d965c);if(_0xf96361[_0xaf2c('0x69')]){var _0x5a95ac=ejs['render'](_0x2767c7,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6a'),_0x5a95ac);}})[_0xaf2c('0x1a')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0xaf2c('0x1a')](function(){var _0x3e972c=_0x1166c9['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3e972c)throw new Error(_0xaf2c('0x6b'));if(_0x3e972c[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x6e1837=_0xf96361[_0xaf2c('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xaf2c('0x54')]({'where':{'name':_0xaf2c('0x33'),'userProfileId':_0x3e972c[_0xaf2c('0x5d')]},'raw':!![]})['then'](function(_0xc9dd21){if(_0xc9dd21&&_0xc9dd21[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')]['create']({'name':_0x6e1837[_0xaf2c('0x36')],'resourceId':_0x6e1837['id'],'type':_0xc9dd21[_0xaf2c('0x36')],'sectionId':_0xc9dd21['id']},{})[_0xaf2c('0x1a')](function(){return _0xf96361;});}else{return _0xf96361;}})[_0xaf2c('0x25')](function(_0x491160){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x491160);throw _0x491160;});}return _0xf96361;})[_0xaf2c('0x1a')](respondWithResult(_0x1ead61,0xc9))['catch'](handleError(_0x1ead61,null));};exports['update']=function(_0x427ece,_0x1b7dc1,_0x5571eb){var _0x3675d9;return db[_0xaf2c('0x53')]['find']({'where':{'id':_0x427ece[_0xaf2c('0x52')]['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1b7dc1,null))[_0xaf2c('0x1a')](saveUpdates(_0x427ece[_0xaf2c('0x58')],null))[_0xaf2c('0x1a')](function(_0x4af252){if(_0x4af252){_0x3675d9=_0x4af252;return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});}})[_0xaf2c('0x1a')](function(_0x55b568){if(_0x55b568){var _0x4f378e=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x4b9fdc=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x6c')),_0xaf2c('0x66'));var _0x41c707=ejs['render'](_0x4f378e,{'trunks':_0x55b568||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x41c707);var _0x483774=ejs['render'](_0x4b9fdc,{'trunks':_0x55b568||[]});fs['writeFileSync'](_0xaf2c('0x6a'),_0x483774);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x30'),{'module':_0xaf2c('0x6f')});}return null;})['then'](function(_0x19fbd5){if(_0x19fbd5){return _0x3675d9;}})[_0xaf2c('0x1a')](respondWithResult(_0x1b7dc1,null))[_0xaf2c('0x25')](handleError(_0x1b7dc1,null));};exports[_0xaf2c('0x31')]=function(_0x4ddf95,_0x1e8fc0,_0x23aeac){var _0x41590;return db[_0xaf2c('0x53')][_0xaf2c('0x54')]({'where':{'id':_0x4ddf95['params']['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1e8fc0,null))[_0xaf2c('0x1a')](removeEntity(_0x1e8fc0,null))['then'](function(){return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});})[_0xaf2c('0x1a')](function(_0x5bce65){var _0x1e6a12=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2a3cb4=fs[_0xaf2c('0x62')](path['join'](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x7724cc=ejs['render'](_0x1e6a12,{'trunks':_0x5bce65});var _0x4a9ea8=ejs[_0xaf2c('0x67')](_0x2a3cb4,{'trunks':_0x5bce65});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x7724cc);fs['writeFileSync'](_0xaf2c('0x6a'),_0x4a9ea8);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1e8fc0,null));}; \ No newline at end of file +var _0x8d0e=['omit','updatedAt','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','reject','update','destroy','get','Trunks','stack','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','keys','rawAttributes','includeAll','find','createdAt','body'];(function(_0x38aa04,_0x2c8039){var _0x39bb22=function(_0x5b4e9a){while(--_0x5b4e9a){_0x38aa04['push'](_0x38aa04['shift']());}};_0x39bb22(++_0x2c8039);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x9ad14,_0x582138){_0x9ad14=_0x9ad14-0x0;var _0x1abec7=_0x8d0e[_0x9ad14];return _0x1abec7;};'use strict';var emlformat=require(_0xe8d0('0x0'));var rimraf=require(_0xe8d0('0x1'));var zipdir=require(_0xe8d0('0x2'));var jsonpatch=require(_0xe8d0('0x3'));var rp=require(_0xe8d0('0x4'));var moment=require(_0xe8d0('0x5'));var BPromise=require(_0xe8d0('0x6'));var Mustache=require(_0xe8d0('0x7'));var util=require(_0xe8d0('0x8'));var path=require('path');var sox=require(_0xe8d0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8d0('0xa'));var _=require(_0xe8d0('0xb'));var squel=require(_0xe8d0('0xc'));var crypto=require(_0xe8d0('0xd'));var jsforce=require(_0xe8d0('0xe'));var deskjs=require(_0xe8d0('0xf'));var toCsv=require(_0xe8d0('0x10'));var querystring=require(_0xe8d0('0x11'));var Papa=require('papaparse');var Redis=require(_0xe8d0('0x12'));var authService=require(_0xe8d0('0x13'));var qs=require(_0xe8d0('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe8d0('0x15'))(_0xe8d0('0x16'));var utils=require(_0xe8d0('0x17'));var config=require(_0xe8d0('0x18'));var licenseUtil=require(_0xe8d0('0x19'));var db=require(_0xe8d0('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe8d0('0x1b')][_0xe8d0('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x533b42,_0x2b640d,_0x4cbd26,_0x59b4b7){return new BPromise(function(_0x90a1ea,_0x2aa906){var _0x1aa725=_0x59b4b7||client;return _0x1aa725[_0xe8d0('0x1d')](_0x533b42,_0x4cbd26)[_0xe8d0('0x1e')](function(_0x7151c6){logger['info'](_0xe8d0('0x1f'),_0x2b640d,'request\x20sent');logger[_0xe8d0('0x20')](_0xe8d0('0x21'),_0x2b640d,_0xe8d0('0x22'),JSON['stringify'](_0x7151c6));if(_0x7151c6['error']){if(_0x7151c6['error'][_0xe8d0('0x23')]===0x1f4){logger[_0xe8d0('0x24')](_0xe8d0('0x1f'),_0x2b640d,_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);return _0x2aa906(_0x7151c6['error'][_0xe8d0('0x25')]);}logger[_0xe8d0('0x24')]('Trunk,\x20%s,\x20%s',_0x2b640d,_0x7151c6['error']['message']);return _0x90a1ea(_0x7151c6[_0xe8d0('0x24')][_0xe8d0('0x25')]);}else{logger[_0xe8d0('0x26')](_0xe8d0('0x1f'),_0x2b640d,_0xe8d0('0x22'));_0x90a1ea(_0x7151c6[_0xe8d0('0x27')][_0xe8d0('0x25')]);}})[_0xe8d0('0x28')](function(_0x32e39a){logger['error'](_0xe8d0('0x1f'),_0x2b640d,_0x32e39a);_0x2aa906(_0x32e39a);});});}function respondWithStatusCode(_0x9f747,_0x572c25){_0x572c25=_0x572c25||0xcc;return function(_0x106614){if(_0x106614){return _0x9f747[_0xe8d0('0x29')](_0x572c25);}return _0x9f747[_0xe8d0('0x2a')](_0x572c25)[_0xe8d0('0x2b')]();};}function respondWithResult(_0x146783,_0x149dfd){_0x149dfd=_0x149dfd||0xc8;return function(_0x31519b){if(_0x31519b){return _0x146783[_0xe8d0('0x2a')](_0x149dfd)[_0xe8d0('0x2c')](_0x31519b);}};}function respondWithFilteredResult(_0x2dee67,_0x264de4){return function(_0x539548){if(_0x539548){var _0x24982c=typeof _0x264de4[_0xe8d0('0x2d')]===_0xe8d0('0x2e')&&typeof _0x264de4['limit']===_0xe8d0('0x2e');var _0x343b08=_0x539548['count'];var _0x1519e2=_0x24982c?0x0:_0x264de4[_0xe8d0('0x2d')];var _0x11fcf2=_0x24982c?_0x539548[_0xe8d0('0x2f')]:_0x264de4[_0xe8d0('0x2d')]+_0x264de4['limit'];var _0x3cc292;if(_0x11fcf2>=_0x343b08){_0x11fcf2=_0x343b08;_0x3cc292=0xc8;}else{_0x3cc292=0xce;}_0x2dee67['status'](_0x3cc292);return _0x2dee67['set']('Content-Range',_0x1519e2+'-'+_0x11fcf2+'/'+_0x343b08)[_0xe8d0('0x2c')](_0x539548);}return null;};}function patchUpdates(_0x13cd4c){return function(_0x36ccec){try{jsonpatch['apply'](_0x36ccec,_0x13cd4c,!![]);}catch(_0x57e375){return BPromise[_0xe8d0('0x30')](_0x57e375);}return _0x36ccec['save']();};}function saveUpdates(_0x3b5d31,_0x383084){return function(_0x327004){if(_0x327004){return _0x327004[_0xe8d0('0x31')](_0x3b5d31)[_0xe8d0('0x1e')](function(_0x5bbc9e){return _0x5bbc9e;});}return null;};}function removeEntity(_0x1bee61,_0x4db53c){return function(_0x402e90){if(_0x402e90){return _0x402e90[_0xe8d0('0x32')]()['then'](function(){var _0x4547b6=_0x402e90[_0xe8d0('0x33')]({'plain':!![]});var _0x4c1347=_0xe8d0('0x34');return db['UserProfileResource'][_0xe8d0('0x32')]({'where':{'type':_0x4c1347,'resourceId':_0x4547b6['id']}})['then'](function(){return _0x402e90;});})[_0xe8d0('0x1e')](function(){_0x1bee61['status'](0xcc)[_0xe8d0('0x2b')]();});}};}function handleEntityNotFound(_0xb2cdbf,_0x1e2430){return function(_0x320565){if(!_0x320565){_0xb2cdbf['sendStatus'](0x194);}return _0x320565;};}function handleError(_0x36a650,_0x354e19){_0x354e19=_0x354e19||0x1f4;return function(_0x20eec5){logger['error'](_0x20eec5[_0xe8d0('0x35')]);if(_0x20eec5[_0xe8d0('0x36')]){delete _0x20eec5[_0xe8d0('0x36')];}_0x36a650[_0xe8d0('0x2a')](_0x354e19)[_0xe8d0('0x37')](_0x20eec5);};}exports['index']=function(_0x5a969a,_0x1828c5){var _0x10970d={},_0x3d76d5={},_0x318106={'count':0x0,'rows':[]};var _0x23d72e=_[_0xe8d0('0x38')](db[_0xe8d0('0x39')]['rawAttributes'],function(_0x5dff14){return{'name':_0x5dff14[_0xe8d0('0x3a')],'type':_0x5dff14[_0xe8d0('0x3b')][_0xe8d0('0x3c')]};});_0x3d76d5[_0xe8d0('0x3d')]=_[_0xe8d0('0x38')](_0x23d72e,'name');_0x3d76d5[_0xe8d0('0x3e')]=_['keys'](_0x5a969a[_0xe8d0('0x3e')]);_0x3d76d5[_0xe8d0('0x3f')]=_[_0xe8d0('0x40')](_0x3d76d5['model'],_0x3d76d5[_0xe8d0('0x3e')]);_0x10970d[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x3d76d5[_0xe8d0('0x3d')],qs[_0xe8d0('0x42')](_0x5a969a['query']['fields']));_0x10970d['attributes']=_0x10970d['attributes'][_0xe8d0('0x43')]?_0x10970d['attributes']:_0x3d76d5[_0xe8d0('0x3d')];if(!_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x44')](_0xe8d0('0x45'))){_0x10970d[_0xe8d0('0x46')]=qs[_0xe8d0('0x46')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x46')]);_0x10970d['offset']=qs[_0xe8d0('0x2d')](_0x5a969a[_0xe8d0('0x3e')]['offset']);}_0x10970d['order']=qs[_0xe8d0('0x47')](_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x47')]);_0x10970d['where']=qs[_0xe8d0('0x3f')](_[_0xe8d0('0x48')](_0x5a969a['query'],_0x3d76d5[_0xe8d0('0x3f')]),_0x23d72e);if(_0x5a969a[_0xe8d0('0x3e')]['filter']){_0x10970d[_0xe8d0('0x49')]=_[_0xe8d0('0x4a')](_0x10970d[_0xe8d0('0x49')],{'$or':_[_0xe8d0('0x38')](_0x23d72e,function(_0x1d5815){if(_0x1d5815[_0xe8d0('0x3b')]!==_0xe8d0('0x4b')){var _0x1ce97d={};_0x1ce97d[_0x1d5815['name']]={'$like':'%'+_0x5a969a[_0xe8d0('0x3e')][_0xe8d0('0x4c')]+'%'};return _0x1ce97d;}})});}_0x10970d=_[_0xe8d0('0x4a')]({},_0x10970d,_0x5a969a[_0xe8d0('0x4d')]);var _0x28d38b={'where':_0x10970d[_0xe8d0('0x49')]};return db[_0xe8d0('0x39')][_0xe8d0('0x2f')](_0x28d38b)[_0xe8d0('0x1e')](function(_0x2e2c05){_0x318106[_0xe8d0('0x2f')]=_0x2e2c05;if(_0x5a969a[_0xe8d0('0x3e')]['includeAll']){_0x10970d[_0xe8d0('0x4e')]=[{'all':!![]}];}return db[_0xe8d0('0x39')][_0xe8d0('0x4f')](_0x10970d);})[_0xe8d0('0x1e')](function(_0x34047c){_0x318106[_0xe8d0('0x50')]=_0x34047c;return _0x318106;})[_0xe8d0('0x1e')](respondWithFilteredResult(_0x1828c5,_0x10970d))['catch'](handleError(_0x1828c5,null));};exports[_0xe8d0('0x51')]=function(_0x424764,_0x151cf4){var _0x205933={'raw':![],'where':{'id':_0x424764[_0xe8d0('0x52')]['id']}},_0x4ed47f={};_0x4ed47f['model']=_[_0xe8d0('0x53')](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x4ed47f[_0xe8d0('0x3e')]=_[_0xe8d0('0x53')](_0x424764[_0xe8d0('0x3e')]);_0x4ed47f[_0xe8d0('0x3f')]=_['intersection'](_0x4ed47f[_0xe8d0('0x3d')],_0x4ed47f['query']);_0x205933['attributes']=_[_0xe8d0('0x40')](_0x4ed47f['model'],qs[_0xe8d0('0x42')](_0x424764['query'][_0xe8d0('0x42')]));_0x205933[_0xe8d0('0x41')]=_0x205933[_0xe8d0('0x41')][_0xe8d0('0x43')]?_0x205933['attributes']:_0x4ed47f[_0xe8d0('0x3d')];if(_0x424764[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x205933[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x205933=_[_0xe8d0('0x4a')]({},_0x205933,_0x424764['options']);return db[_0xe8d0('0x39')][_0xe8d0('0x56')](_0x205933)[_0xe8d0('0x1e')](handleEntityNotFound(_0x151cf4,null))['then'](respondWithResult(_0x151cf4,null))[_0xe8d0('0x28')](handleError(_0x151cf4,null));};exports['clone']=function(_0x56b4fa,_0x1bd329){var _0x37040a={'where':{'id':_0x56b4fa[_0xe8d0('0x52')]['id']}},_0x4e7b49={};_0x4e7b49[_0xe8d0('0x3d')]=_['keys'](db[_0xe8d0('0x39')][_0xe8d0('0x54')]);_0x37040a[_0xe8d0('0x41')]=_[_0xe8d0('0x40')](_0x4e7b49['model'],qs[_0xe8d0('0x42')](_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x42')]));_0x37040a[_0xe8d0('0x41')]=_0x37040a['attributes'][_0xe8d0('0x43')]?_0x37040a[_0xe8d0('0x41')]:_0x4e7b49[_0xe8d0('0x3d')];if(_0x56b4fa[_0xe8d0('0x3e')][_0xe8d0('0x55')]){_0x37040a[_0xe8d0('0x4e')]=[{'all':!![]}];}_0x37040a=_['merge']({},_0x37040a,_0x56b4fa['options']);return db[_0xe8d0('0x39')]['find'](_0x37040a)[_0xe8d0('0x1e')](handleEntityNotFound(_0x1bd329,null))[_0xe8d0('0x1e')](function(_0x4c0d4c){if(_0x4c0d4c){var _0x5ac1ae=_0x4c0d4c[_0xe8d0('0x33')]({'plain':!![]});_0x5ac1ae=qs['omit'](_0x5ac1ae,['id',_0xe8d0('0x57'),'updatedAt']);_0x56b4fa[_0xe8d0('0x58')]=_[_0xe8d0('0x59')](_0x56b4fa[_0xe8d0('0x58')],['id','createdAt',_0xe8d0('0x5a')]);return db[_0xe8d0('0x39')]['create'](_[_0xe8d0('0x4a')](_0x5ac1ae,_0x56b4fa['body']),{'include':_0x56b4fa[_0xe8d0('0x3e')]['includeAll']?[{'all':!![]}]:undefined})[_0xe8d0('0x1e')](function(_0x17afc2){var _0x29467d=_0x56b4fa[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x29467d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29467d['role']===_0xe8d0('0x5b')){var _0x55a2df=_0x17afc2[_0xe8d0('0x33')]({'plain':!![]});var _0x18b655=_0xe8d0('0x34');return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':_0x18b655,'userProfileId':_0x29467d[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0x20647d){if(_0x20647d&&_0x20647d[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')][_0xe8d0('0x60')]({'name':_0x55a2df[_0xe8d0('0x36')],'resourceId':_0x55a2df['id'],'type':_0x20647d[_0xe8d0('0x36')],'sectionId':_0x20647d['id']},{})[_0xe8d0('0x1e')](function(){return _0x17afc2;});}else{return _0x17afc2;}})[_0xe8d0('0x28')](function(_0x4a68d5){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x4a68d5);throw _0x4a68d5;});}return _0x17afc2;});}})[_0xe8d0('0x1e')](respondWithResult(_0x1bd329,0xc9))[_0xe8d0('0x28')](handleError(_0x1bd329,null));};exports[_0xe8d0('0x60')]=function(_0x4848d4,_0x2eeb92,_0x1d30c0){var _0x45b42b;return db[_0xe8d0('0x39')][_0xe8d0('0x60')](_0x4848d4[_0xe8d0('0x58')],{'raw':!![]})[_0xe8d0('0x1e')](function(_0x13ceb4){_0x45b42b=_0x13ceb4;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})[_0xe8d0('0x1e')](function(_0xdb3e53){var _0x556d7e=fs['readFileSync'](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x56761c=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x1b5df8=ejs[_0xe8d0('0x68')](_0x556d7e,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x1b5df8);if(_0x45b42b[_0xe8d0('0x6b')]){var _0xb078d8=ejs[_0xe8d0('0x68')](_0x56761c,{'trunks':_0xdb3e53||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0xb078d8);}})[_0xe8d0('0x1e')](function(){return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x60'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x1e')](function(){var _0x500fb0=_0x4848d4[_0xe8d0('0x5b')][_0xe8d0('0x33')]({'plain':!![]});if(!_0x500fb0)throw new Error(_0xe8d0('0x6f'));if(_0x500fb0['role']===_0xe8d0('0x5b')){var _0x4c54c4=_0x45b42b[_0xe8d0('0x33')]({'plain':!![]});return db[_0xe8d0('0x5c')][_0xe8d0('0x56')]({'where':{'name':'Trunks','userProfileId':_0x500fb0[_0xe8d0('0x5d')]},'raw':!![]})[_0xe8d0('0x1e')](function(_0xc94cd3){if(_0xc94cd3&&_0xc94cd3[_0xe8d0('0x5e')]===0x0){return db[_0xe8d0('0x5f')]['create']({'name':_0x4c54c4[_0xe8d0('0x36')],'resourceId':_0x4c54c4['id'],'type':_0xc94cd3[_0xe8d0('0x36')],'sectionId':_0xc94cd3['id']},{})[_0xe8d0('0x1e')](function(){return _0x45b42b;});}else{return _0x45b42b;}})[_0xe8d0('0x28')](function(_0x252f0e){logger[_0xe8d0('0x24')](_0xe8d0('0x61'),_0x252f0e);throw _0x252f0e;});}return _0x45b42b;})[_0xe8d0('0x1e')](respondWithResult(_0x2eeb92,0xc9))['catch'](handleError(_0x2eeb92,null));};exports[_0xe8d0('0x31')]=function(_0x31b9d3,_0x14d722,_0x2aa6fc){var _0x4d5997;return db[_0xe8d0('0x39')][_0xe8d0('0x56')]({'where':{'id':_0x31b9d3[_0xe8d0('0x52')]['id']}})['then'](handleEntityNotFound(_0x14d722,null))[_0xe8d0('0x1e')](saveUpdates(_0x31b9d3['body'],null))[_0xe8d0('0x1e')](function(_0x478eb2){if(_0x478eb2){_0x4d5997=_0x478eb2;return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});}})[_0xe8d0('0x1e')](function(_0xa90bdc){if(_0xa90bdc){var _0x87aa04=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2eaf2f=fs[_0xe8d0('0x65')](path['join'](config[_0xe8d0('0x66')],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x761e97=ejs[_0xe8d0('0x68')](_0x87aa04,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x761e97);var _0x605b5f=ejs[_0xe8d0('0x68')](_0x2eaf2f,{'trunks':_0xa90bdc||[]});fs[_0xe8d0('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x605b5f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x31'),{'module':_0xe8d0('0x6e')});}return null;})[_0xe8d0('0x1e')](function(_0x255e4b){if(_0x255e4b){return _0x4d5997;}})['then'](respondWithResult(_0x14d722,null))['catch'](handleError(_0x14d722,null));};exports[_0xe8d0('0x32')]=function(_0x5c8c7d,_0x3fb7c8,_0x16098b){var _0x363b3a;return db['Trunk'][_0xe8d0('0x56')]({'where':{'id':_0x5c8c7d['params']['id']}})[_0xe8d0('0x1e')](handleEntityNotFound(_0x3fb7c8,null))[_0xe8d0('0x1e')](removeEntity(_0x3fb7c8,null))[_0xe8d0('0x1e')](function(){return db[_0xe8d0('0x39')][_0xe8d0('0x4f')]({'raw':!![]});})['then'](function(_0x58034d){var _0xfbacce=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config[_0xe8d0('0x66')],_0xe8d0('0x63')),_0xe8d0('0x64'));var _0x2790f=fs[_0xe8d0('0x65')](path[_0xe8d0('0x62')](config['root'],_0xe8d0('0x67')),_0xe8d0('0x64'));var _0x142db4=ejs[_0xe8d0('0x68')](_0xfbacce,{'trunks':_0x58034d});var _0x4a568f=ejs['render'](_0x2790f,{'trunks':_0x58034d});fs[_0xe8d0('0x69')](_0xe8d0('0x6a'),_0x142db4);fs[_0xe8d0('0x69')](_0xe8d0('0x6c'),_0x4a568f);return respondWithRpcPromise(_0xe8d0('0x6d'),_0xe8d0('0x32'),{'module':_0xe8d0('0x6e')});})[_0xe8d0('0x28')](handleError(_0x3fb7c8,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index ac5a3e7..1caee24 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 _0xd2e5=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','lodash','util'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xd2e5,0x1d2));var _0x5d2e=function(_0x51160c,_0x374b59){_0x51160c=_0x51160c-0x0;var _0x15a3fb=_0xd2e5[_0x51160c];return _0x15a3fb;};'use strict';var _=require(_0x5d2e('0x0'));var util=require(_0x5d2e('0x1'));var logger=require(_0x5d2e('0x2'))(_0x5d2e('0x3'));var moment=require('moment');var BPromise=require(_0x5d2e('0x4'));var rp=require(_0x5d2e('0x5'));var fs=require('fs');var path=require(_0x5d2e('0x6'));var rimraf=require(_0x5d2e('0x7'));var config=require(_0x5d2e('0x8'));var attributes=require(_0x5d2e('0x9'));module[_0x5d2e('0xa')]=function(_0x45fdf3,_0x4a3133){return _0x45fdf3[_0x5d2e('0xb')](_0x5d2e('0xc'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x633d=['api','bluebird','request-promise','path','rimraf','exports','define','Trunk','tools_trunks'];(function(_0x2af71e,_0x1b1ef4){var _0x243300=function(_0x46b740){while(--_0x46b740){_0x2af71e['push'](_0x2af71e['shift']());}};_0x243300(++_0x1b1ef4);}(_0x633d,0x99));var _0xd633=function(_0x3997be,_0x3e8a1d){_0x3997be=_0x3997be-0x0;var _0x1c4093=_0x633d[_0x3997be];return _0x1c4093;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xd633('0x0'));var moment=require('moment');var BPromise=require(_0xd633('0x1'));var rp=require(_0xd633('0x2'));var fs=require('fs');var path=require(_0xd633('0x3'));var rimraf=require(_0xd633('0x4'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0xd633('0x5')]=function(_0x32bcc0,_0x58eeca){return _0x32bcc0[_0xd633('0x6')](_0xd633('0x7'),attributes,{'tableName':_0xd633('0x8'),'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 feb6dec..6b077e1 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 _0x257e=['model','attributes','ShowTrunk','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where','limit','include','map'];(function(_0x9645f7,_0x5a4ad3){var _0x2a6a56=function(_0x9e12ad){while(--_0x9e12ad){_0x9645f7['push'](_0x9645f7['shift']());}};_0x2a6a56(++_0x5a4ad3);}(_0x257e,0x1f3));var _0xe257=function(_0x429948,_0x1a6851){_0x429948=_0x429948-0x0;var _0x35d5d1=_0x257e[_0x429948];return _0x35d5d1;};'use strict';var _=require(_0xe257('0x0'));var util=require(_0xe257('0x1'));var moment=require(_0xe257('0x2'));var BPromise=require(_0xe257('0x3'));var rs=require(_0xe257('0x4'));var fs=require('fs');var Redis=require(_0xe257('0x5'));var db=require(_0xe257('0x6'))['db'];var utils=require(_0xe257('0x7'));var logger=require(_0xe257('0x8'))('rpc');var config=require(_0xe257('0x9'));var jayson=require(_0xe257('0xa'));var client=jayson[_0xe257('0xb')][_0xe257('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d7850,_0x363a3f,_0x36e8b6){return new BPromise(function(_0x1a9c27,_0x44aef0){return client[_0xe257('0xd')](_0x2d7850,_0x36e8b6)[_0xe257('0xe')](function(_0x4b4081){logger[_0xe257('0xf')]('Trunk,\x20%s,\x20%s',_0x363a3f,'request\x20sent');logger[_0xe257('0x10')](_0xe257('0x11'),_0x363a3f,_0xe257('0x12'),JSON['stringify'](_0x4b4081));if(_0x4b4081[_0xe257('0x13')]){if(_0x4b4081[_0xe257('0x13')]['code']===0x1f4){logger[_0xe257('0x13')](_0xe257('0x14'),_0x363a3f,_0x4b4081['error']['message']);return _0x44aef0(_0x4b4081[_0xe257('0x13')][_0xe257('0x15')]);}logger[_0xe257('0x13')]('Trunk,\x20%s,\x20%s',_0x363a3f,_0x4b4081[_0xe257('0x13')][_0xe257('0x15')]);return _0x1a9c27(_0x4b4081[_0xe257('0x13')]['message']);}else{logger[_0xe257('0xf')](_0xe257('0x14'),_0x363a3f,'request\x20sent');_0x1a9c27(_0x4b4081[_0xe257('0x16')][_0xe257('0x15')]);}})[_0xe257('0x17')](function(_0x3842b0){logger['error']('Trunk,\x20%s,\x20%s',_0x363a3f,_0x3842b0);_0x44aef0(_0x3842b0);});});}exports[_0xe257('0x18')]=function(_0x183ae4){var _0x43a29e=this;return new Promise(function(_0x5294b1,_0x1ac4c5){return db[_0xe257('0x19')][_0xe257('0x1a')]({'raw':_0x183ae4[_0xe257('0x1b')]?_0x183ae4['options'][_0xe257('0x1c')]===undefined?!![]:![]:!![],'where':_0x183ae4['options']?_0x183ae4['options'][_0xe257('0x1d')]||null:null,'attributes':_0x183ae4[_0xe257('0x1b')]?_0x183ae4[_0xe257('0x1b')]['attributes']||null:null,'limit':_0x183ae4['options']?_0x183ae4[_0xe257('0x1b')][_0xe257('0x1e')]||null:null,'include':_0x183ae4[_0xe257('0x1b')]?_0x183ae4[_0xe257('0x1b')][_0xe257('0x1f')]?_[_0xe257('0x20')](_0x183ae4[_0xe257('0x1b')][_0xe257('0x1f')],function(_0x310cb0){return{'model':db[_0x310cb0[_0xe257('0x21')]],'as':_0x310cb0['as'],'attributes':_0x310cb0[_0xe257('0x22')],'include':_0x310cb0[_0xe257('0x1f')]?_['map'](_0x310cb0[_0xe257('0x1f')],function(_0x2cba38){return{'model':db[_0x2cba38[_0xe257('0x21')]],'as':_0x2cba38['as'],'attributes':_0x2cba38[_0xe257('0x22')],'include':_0x2cba38[_0xe257('0x1f')]?_['map'](_0x2cba38['include'],function(_0x4288f2){return{'model':db[_0x4288f2[_0xe257('0x21')]],'as':_0x4288f2['as'],'attributes':_0x4288f2[_0xe257('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe257('0xe')](function(_0x452746){logger[_0xe257('0xf')](_0xe257('0x18'),_0x183ae4);logger['debug'](_0xe257('0x18'),_0x183ae4,JSON['stringify'](_0x452746));_0x5294b1(_0x452746);})['catch'](function(_0x42300d){logger['error'](_0xe257('0x18'),_0x42300d[_0xe257('0x15')],_0x183ae4);_0x1ac4c5(_0x43a29e[_0xe257('0x13')](0x1f4,_0x42300d[_0xe257('0x15')]));});});};exports[_0xe257('0x23')]=function(_0x5c9869){var _0x4e2055=this;return new Promise(function(_0x392c79,_0x101c24){return db[_0xe257('0x19')][_0xe257('0x24')]({'raw':_0x5c9869[_0xe257('0x1b')]?_0x5c9869[_0xe257('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5c9869[_0xe257('0x1b')]?_0x5c9869[_0xe257('0x1b')][_0xe257('0x1d')]||null:null,'attributes':_0x5c9869['options']?_0x5c9869[_0xe257('0x1b')]['attributes']||null:null,'include':_0x5c9869[_0xe257('0x1b')]?_0x5c9869['options']['include']?_['map'](_0x5c9869[_0xe257('0x1b')]['include'],function(_0x119516){return{'model':db[_0x119516['model']],'as':_0x119516['as'],'attributes':_0x119516[_0xe257('0x22')],'include':_0x119516[_0xe257('0x1f')]?_['map'](_0x119516[_0xe257('0x1f')],function(_0x262913){return{'model':db[_0x262913['model']],'as':_0x262913['as'],'attributes':_0x262913[_0xe257('0x22')],'include':_0x262913[_0xe257('0x1f')]?_[_0xe257('0x20')](_0x262913[_0xe257('0x1f')],function(_0x1ab8cd){return{'model':db[_0x1ab8cd[_0xe257('0x21')]],'as':_0x1ab8cd['as'],'attributes':_0x1ab8cd[_0xe257('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe257('0xe')](function(_0xec96f2){logger[_0xe257('0xf')](_0xe257('0x23'),_0x5c9869);logger[_0xe257('0x10')]('ShowTrunk',_0x5c9869,JSON[_0xe257('0x25')](_0xec96f2));_0x392c79(_0xec96f2);})[_0xe257('0x17')](function(_0x58370a){logger[_0xe257('0x13')](_0xe257('0x23'),_0x58370a[_0xe257('0x15')],_0x5c9869);_0x101c24(_0x4e2055[_0xe257('0x13')](0x1f4,_0x58370a[_0xe257('0x15')]));});});}; \ No newline at end of file +var _0x3fe7=['debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','Trunk,\x20%s,\x20%s','message','result','catch','Trunk','findAll','options','raw','where','limit','include','model','attributes','GetTrunk','stringify','ShowTrunk','find','map','lodash','util','moment','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x14785c,_0x306ce7){var _0x5a4ecf=function(_0x11c83d){while(--_0x11c83d){_0x14785c['push'](_0x14785c['shift']());}};_0x5a4ecf(++_0x306ce7);}(_0x3fe7,0xee));var _0x73fe=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x3fe7[_0x4c98b9];return _0x3a257a;};'use strict';var _=require(_0x73fe('0x0'));var util=require(_0x73fe('0x1'));var moment=require(_0x73fe('0x2'));var BPromise=require('bluebird');var rs=require(_0x73fe('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73fe('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x73fe('0x5'));var config=require(_0x73fe('0x6'));var jayson=require(_0x73fe('0x7'));var client=jayson[_0x73fe('0x8')][_0x73fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36bb60,_0x3d5c0c,_0x39693b){return new BPromise(function(_0x17194c,_0x5e5a8a){return client[_0x73fe('0xa')](_0x36bb60,_0x39693b)[_0x73fe('0xb')](function(_0x322145){logger[_0x73fe('0xc')]('Trunk,\x20%s,\x20%s',_0x3d5c0c,_0x73fe('0xd'));logger[_0x73fe('0xe')](_0x73fe('0xf'),_0x3d5c0c,'request\x20sent',JSON['stringify'](_0x322145));if(_0x322145[_0x73fe('0x10')]){if(_0x322145[_0x73fe('0x10')][_0x73fe('0x11')]===0x1f4){logger[_0x73fe('0x10')](_0x73fe('0x12'),_0x3d5c0c,_0x322145[_0x73fe('0x10')]['message']);return _0x5e5a8a(_0x322145[_0x73fe('0x10')][_0x73fe('0x13')]);}logger['error'](_0x73fe('0x12'),_0x3d5c0c,_0x322145[_0x73fe('0x10')][_0x73fe('0x13')]);return _0x17194c(_0x322145[_0x73fe('0x10')][_0x73fe('0x13')]);}else{logger[_0x73fe('0xc')]('Trunk,\x20%s,\x20%s',_0x3d5c0c,_0x73fe('0xd'));_0x17194c(_0x322145[_0x73fe('0x14')]['message']);}})[_0x73fe('0x15')](function(_0x3d7f89){logger[_0x73fe('0x10')]('Trunk,\x20%s,\x20%s',_0x3d5c0c,_0x3d7f89);_0x5e5a8a(_0x3d7f89);});});}exports['GetTrunk']=function(_0x339943){var _0x34fb80=this;return new Promise(function(_0x22339c,_0x2a919f){return db[_0x73fe('0x16')][_0x73fe('0x17')]({'raw':_0x339943['options']?_0x339943[_0x73fe('0x18')][_0x73fe('0x19')]===undefined?!![]:![]:!![],'where':_0x339943[_0x73fe('0x18')]?_0x339943[_0x73fe('0x18')][_0x73fe('0x1a')]||null:null,'attributes':_0x339943[_0x73fe('0x18')]?_0x339943[_0x73fe('0x18')]['attributes']||null:null,'limit':_0x339943['options']?_0x339943[_0x73fe('0x18')][_0x73fe('0x1b')]||null:null,'include':_0x339943[_0x73fe('0x18')]?_0x339943[_0x73fe('0x18')][_0x73fe('0x1c')]?_['map'](_0x339943[_0x73fe('0x18')][_0x73fe('0x1c')],function(_0x10e526){return{'model':db[_0x10e526[_0x73fe('0x1d')]],'as':_0x10e526['as'],'attributes':_0x10e526[_0x73fe('0x1e')],'include':_0x10e526[_0x73fe('0x1c')]?_['map'](_0x10e526[_0x73fe('0x1c')],function(_0xf82133){return{'model':db[_0xf82133[_0x73fe('0x1d')]],'as':_0xf82133['as'],'attributes':_0xf82133[_0x73fe('0x1e')],'include':_0xf82133[_0x73fe('0x1c')]?_['map'](_0xf82133[_0x73fe('0x1c')],function(_0xca333){return{'model':db[_0xca333[_0x73fe('0x1d')]],'as':_0xca333['as'],'attributes':_0xca333[_0x73fe('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19d331){logger[_0x73fe('0xc')](_0x73fe('0x1f'),_0x339943);logger[_0x73fe('0xe')]('GetTrunk',_0x339943,JSON[_0x73fe('0x20')](_0x19d331));_0x22339c(_0x19d331);})['catch'](function(_0x350963){logger[_0x73fe('0x10')](_0x73fe('0x1f'),_0x350963[_0x73fe('0x13')],_0x339943);_0x2a919f(_0x34fb80[_0x73fe('0x10')](0x1f4,_0x350963[_0x73fe('0x13')]));});});};exports[_0x73fe('0x21')]=function(_0x20aebf){var _0x3cef58=this;return new Promise(function(_0x1a14e4,_0x8c9039){return db[_0x73fe('0x16')][_0x73fe('0x22')]({'raw':_0x20aebf[_0x73fe('0x18')]?_0x20aebf[_0x73fe('0x18')][_0x73fe('0x19')]===undefined?!![]:![]:!![],'where':_0x20aebf[_0x73fe('0x18')]?_0x20aebf[_0x73fe('0x18')][_0x73fe('0x1a')]||null:null,'attributes':_0x20aebf['options']?_0x20aebf['options'][_0x73fe('0x1e')]||null:null,'include':_0x20aebf['options']?_0x20aebf[_0x73fe('0x18')][_0x73fe('0x1c')]?_[_0x73fe('0x23')](_0x20aebf['options'][_0x73fe('0x1c')],function(_0x9f732e){return{'model':db[_0x9f732e[_0x73fe('0x1d')]],'as':_0x9f732e['as'],'attributes':_0x9f732e['attributes'],'include':_0x9f732e[_0x73fe('0x1c')]?_[_0x73fe('0x23')](_0x9f732e['include'],function(_0x3faceb){return{'model':db[_0x3faceb[_0x73fe('0x1d')]],'as':_0x3faceb['as'],'attributes':_0x3faceb[_0x73fe('0x1e')],'include':_0x3faceb[_0x73fe('0x1c')]?_['map'](_0x3faceb['include'],function(_0x4f1022){return{'model':db[_0x4f1022[_0x73fe('0x1d')]],'as':_0x4f1022['as'],'attributes':_0x4f1022[_0x73fe('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e4499){logger[_0x73fe('0xc')]('ShowTrunk',_0x20aebf);logger[_0x73fe('0xe')](_0x73fe('0x21'),_0x20aebf,JSON[_0x73fe('0x20')](_0x5e4499));_0x1a14e4(_0x5e4499);})['catch'](function(_0x3f1a02){logger[_0x73fe('0x10')](_0x73fe('0x21'),_0x3f1a02[_0x73fe('0x13')],_0x20aebf);_0x8c9039(_0x3cef58['error'](0x1f4,_0x3f1a02['message']));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index ac296d7..65b3ffb 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2d83=['exports','express','Router','../../components/auth/service','./user-setting.controller','put','isAuthenticated','update'];(function(_0x2a71c1,_0xfe3e05){var _0x3c2b82=function(_0x26ea1e){while(--_0x26ea1e){_0x2a71c1['push'](_0x2a71c1['shift']());}};_0x3c2b82(++_0xfe3e05);}(_0x2d83,0x89));var _0x32d8=function(_0x1bdfec,_0xf909fd){_0x1bdfec=_0x1bdfec-0x0;var _0x2a0569=_0x2d83[_0x1bdfec];return _0x2a0569;};'use strict';var express=require(_0x32d8('0x0'));var router=express[_0x32d8('0x1')]();var auth=require(_0x32d8('0x2'));var controller=require(_0x32d8('0x3'));router[_0x32d8('0x4')]('/:id',auth[_0x32d8('0x5')](),controller[_0x32d8('0x6')]);module[_0x32d8('0x7')]=router; \ No newline at end of file +var _0xd8ff=['isAuthenticated','update','exports','express','Router','./user-setting.controller','put','/:id'];(function(_0x5784e9,_0x9e893d){var _0x319a92=function(_0xaaec53){while(--_0xaaec53){_0x5784e9['push'](_0x5784e9['shift']());}};_0x319a92(++_0x9e893d);}(_0xd8ff,0x7b));var _0xfd8f=function(_0x2d239f,_0x167856){_0x2d239f=_0x2d239f-0x0;var _0x1ca993=_0xd8ff[_0x2d239f];return _0x1ca993;};'use strict';var express=require(_0xfd8f('0x0'));var router=express[_0xfd8f('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xfd8f('0x2'));router[_0xfd8f('0x3')](_0xfd8f('0x4'),auth[_0xfd8f('0x5')](),controller[_0xfd8f('0x6')]);module[_0xfd8f('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index b367c23..b8c0b49 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9af7=['exports','ENUM','error','TEXT','DATE','INTEGER','sequelize','warning','info'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0x9af7,0x177));var _0x79af=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9af7[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x79af('0x0'));const CLIENT_SIDE_LOG_LEVELS=['error',_0x79af('0x1'),_0x79af('0x2'),'debug'];module[_0x79af('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x79af('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x79af('0x5'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0x79af('0x6')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x79af('0x7')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x79af('0x8')],'unique':'UserId'}}; \ No newline at end of file +var _0x14ab=['error','warning','info','BOOLEAN','TEXT','INTEGER','sequelize'];(function(_0x52ae63,_0x53d149){var _0x52c628=function(_0x334291){while(--_0x334291){_0x52ae63['push'](_0x52ae63['shift']());}};_0x52c628(++_0x53d149);}(_0x14ab,0x1aa));var _0xb14a=function(_0xecf62a,_0x4e26dc){_0xecf62a=_0xecf62a-0x0;var _0x46be49=_0x14ab[_0xecf62a];return _0x46be49;};'use strict';var Sequelize=require(_0xb14a('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xb14a('0x1'),_0xb14a('0x2'),_0xb14a('0x3'),'debug'];module['exports']={'clientSideLoggingLevel':{'type':Sequelize['ENUM'](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':'error','validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xb14a('0x4')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize[_0xb14a('0x5')],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize['DATE'],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0xb14a('0x6')],'unique':'UserId'}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index ec679fb..8829f61 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cd1=['../../config/logger','api','../../config/environment','../../mysqldb','socket.io-emitter','redis','./user-setting.socket','defaults','status','json','update','then','sendStatus','error','stack','name','user','role','admin','Unauthorized','params','UserSetting','body','catch','ioredis'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x3cd1,0x112));var _0x13cd=function(_0x10dde5,_0x4b4707){_0x10dde5=_0x10dde5-0x0;var _0x3cc471=_0x3cd1[_0x10dde5];return _0x3cc471;};'use strict';var _=require('lodash');var Redis=require(_0x13cd('0x0'));var logger=require(_0x13cd('0x1'))(_0x13cd('0x2'));var config=require(_0x13cd('0x3'));var db=require(_0x13cd('0x4'))['db'];var socket=require(_0x13cd('0x5'))(new Redis(config[_0x13cd('0x6')]));require(_0x13cd('0x7'))['register'](socket);config[_0x13cd('0x6')]=_[_0x13cd('0x8')](config[_0x13cd('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x55cac0,_0x461fe5){_0x461fe5=_0x461fe5||0xc8;return function(_0x427fb0){if(_0x427fb0){return _0x55cac0[_0x13cd('0x9')](_0x461fe5)[_0x13cd('0xa')](_0x427fb0);}};}function saveUpdates(_0x5a9b59){return function(_0x32e88c){if(_0x32e88c){return _0x32e88c[_0x13cd('0xb')](_0x5a9b59)[_0x13cd('0xc')](function(_0x5758a6){return _0x5758a6;});}return null;};}function handleEntityNotFound(_0x519889){return function(_0x171353){if(!_0x171353){_0x519889[_0x13cd('0xd')](0x194);}return _0x171353;};}function handleError(_0x8fd484,_0x23ce8c){_0x23ce8c=_0x23ce8c||0x1f4;return function(_0x30a650){logger[_0x13cd('0xe')](_0x30a650[_0x13cd('0xf')]);if(_0x30a650['name']){delete _0x30a650[_0x13cd('0x10')];}_0x8fd484[_0x13cd('0x9')](_0x23ce8c)['send'](_0x30a650);};}exports[_0x13cd('0xb')]=function(_0x10a4d8,_0x415eaa){if(_0x10a4d8[_0x13cd('0x11')][_0x13cd('0x12')]!==_0x13cd('0x13'))throw new Error(_0x13cd('0x14'));if(isNaN(Number(_0x10a4d8[_0x13cd('0x15')]['id'])))throw new Error('Invalid\x20user\x20setting\x20id');return db[_0x13cd('0x16')]['find']({'where':{'id':_0x10a4d8[_0x13cd('0x15')]['id']}})[_0x13cd('0xc')](handleEntityNotFound(_0x415eaa,null))['then'](saveUpdates(_0x10a4d8[_0x13cd('0x17')],null))[_0x13cd('0xc')](respondWithResult(_0x415eaa,null))[_0x13cd('0x18')](handleError(_0x415eaa,null));}; \ No newline at end of file +var _0xc874=['stack','name','user','role','admin','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','catch','lodash','../../config/logger','api','socket.io-emitter','redis','./user-setting.socket','defaults','localhost','status','update','then','error'];(function(_0x5a7ef1,_0x45d744){var _0x16fbfe=function(_0x20be2f){while(--_0x20be2f){_0x5a7ef1['push'](_0x5a7ef1['shift']());}};_0x16fbfe(++_0x45d744);}(_0xc874,0x154));var _0x4c87=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xc874[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x4c87('0x0'));var Redis=require('ioredis');var logger=require(_0x4c87('0x1'))(_0x4c87('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var socket=require(_0x4c87('0x3'))(new Redis(config[_0x4c87('0x4')]));require(_0x4c87('0x5'))['register'](socket);config[_0x4c87('0x4')]=_[_0x4c87('0x6')](config['redis'],{'host':_0x4c87('0x7'),'port':0x18eb});function respondWithResult(_0x3dafe0,_0x30c939){_0x30c939=_0x30c939||0xc8;return function(_0xdc4a29){if(_0xdc4a29){return _0x3dafe0[_0x4c87('0x8')](_0x30c939)['json'](_0xdc4a29);}};}function saveUpdates(_0x1e0897){return function(_0x492d32){if(_0x492d32){return _0x492d32[_0x4c87('0x9')](_0x1e0897)[_0x4c87('0xa')](function(_0x30e64f){return _0x30e64f;});}return null;};}function handleEntityNotFound(_0x1a15a2){return function(_0x46c0bc){if(!_0x46c0bc){_0x1a15a2['sendStatus'](0x194);}return _0x46c0bc;};}function handleError(_0x1fcc99,_0x2b82cb){_0x2b82cb=_0x2b82cb||0x1f4;return function(_0x527917){logger[_0x4c87('0xb')](_0x527917[_0x4c87('0xc')]);if(_0x527917[_0x4c87('0xd')]){delete _0x527917[_0x4c87('0xd')];}_0x1fcc99[_0x4c87('0x8')](_0x2b82cb)['send'](_0x527917);};}exports['update']=function(_0x4826cb,_0x7026cc){if(_0x4826cb[_0x4c87('0xe')][_0x4c87('0xf')]!==_0x4c87('0x10'))throw new Error(_0x4c87('0x11'));if(isNaN(Number(_0x4826cb[_0x4c87('0x12')]['id'])))throw new Error(_0x4c87('0x13'));return db[_0x4c87('0x14')]['find']({'where':{'id':_0x4826cb[_0x4c87('0x12')]['id']}})[_0x4c87('0xa')](handleEntityNotFound(_0x7026cc,null))['then'](saveUpdates(_0x4826cb['body'],null))[_0x4c87('0xa')](respondWithResult(_0x7026cc,null))[_0x4c87('0x15')](handleError(_0x7026cc,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 35d8394..a8c7494 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x56fe=['remove','emit','hasOwnProperty','exports','events','UserSetting','setMaxListeners','save','update'];(function(_0xa80816,_0x2a23e5){var _0x2fe58f=function(_0x2c3fc8){while(--_0x2c3fc8){_0xa80816['push'](_0xa80816['shift']());}};_0x2fe58f(++_0x2a23e5);}(_0x56fe,0x190));var _0xe56f=function(_0x5aba9e,_0x451888){_0x5aba9e=_0x5aba9e-0x0;var _0x1dbb8b=_0x56fe[_0x5aba9e];return _0x1dbb8b;};'use strict';var EventEmitter=require(_0xe56f('0x0'));var UserSetting=require('../../mysqldb')['db'][_0xe56f('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xe56f('0x2')](0x0);var events={'afterCreate':_0xe56f('0x3'),'afterUpdate':_0xe56f('0x4'),'afterDestroy':_0xe56f('0x5')};function emitEvent(_0x787d82){return function(_0xefb3cd,_0x5534f9,_0x2935bb){UserSettingEvents[_0xe56f('0x6')](_0x787d82+':'+_0xefb3cd['id'],_0xefb3cd);UserSettingEvents[_0xe56f('0x6')](_0x787d82,_0xefb3cd);_0x2935bb(null);};}for(var e in events){if(events[_0xe56f('0x7')](e)){var event=events[e];UserSetting['hook'](e,emitEvent(event));}}module[_0xe56f('0x8')]=UserSettingEvents; \ No newline at end of file +var _0x9d59=['UserSetting','save','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x90cae9,_0x448507){var _0x3db802=function(_0x1525aa){while(--_0x1525aa){_0x90cae9['push'](_0x90cae9['shift']());}};_0x3db802(++_0x448507);}(_0x9d59,0x18e));var _0x99d5=function(_0x211b69,_0x2ff49f){_0x211b69=_0x211b69-0x0;var _0x4fa9bd=_0x9d59[_0x211b69];return _0x4fa9bd;};'use strict';var EventEmitter=require(_0x99d5('0x0'));var UserSetting=require(_0x99d5('0x1'))['db'][_0x99d5('0x2')];var UserSettingEvents=new EventEmitter();UserSettingEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x99d5('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ce319){return function(_0x174d31,_0x130d9f,_0x5aca27){UserSettingEvents[_0x99d5('0x4')](_0x4ce319+':'+_0x174d31['id'],_0x174d31);UserSettingEvents[_0x99d5('0x4')](_0x4ce319,_0x174d31);_0x5aca27(null);};}for(var e in events){if(events[_0x99d5('0x5')](e)){var event=events[e];UserSetting[_0x99d5('0x6')](e,emitEvent(event));}}module[_0x99d5('0x7')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index a6c6319..b3e8be7 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3306=['exports','define','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x4b1bb0,_0x7dc32b){var _0x549407=function(_0xa08deb){while(--_0xa08deb){_0x4b1bb0['push'](_0x4b1bb0['shift']());}};_0x549407(++_0x7dc32b);}(_0x3306,0x107));var _0x6330=function(_0x27a236,_0x12ba14){_0x27a236=_0x27a236-0x0;var _0x47ae3d=_0x3306[_0x27a236];return _0x47ae3d;};'use strict';var attributes=require(_0x6330('0x0'));module[_0x6330('0x1')]=function(_0x396230){return _0x396230[_0x6330('0x2')]('UserSetting',attributes,{'tableName':_0x6330('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x440976){if(!_0x440976[_0x6330('0x4')])_0x440976[_0x6330('0x5')]=null;else if(_0x440976[_0x6330('0x5')]===null)_0x440976['clientSideLoggingEnabledSince']=new Date();}}});}; \ No newline at end of file +var _0x3609=['exports','define','UserSetting','user_settings','clientSideLoggingEnabledSince','./user-setting.attributes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3609,0x101));var _0x9360=function(_0x38e925,_0x4929fb){_0x38e925=_0x38e925-0x0;var _0x1fea76=_0x3609[_0x38e925];return _0x1fea76;};'use strict';var attributes=require(_0x9360('0x0'));module[_0x9360('0x1')]=function(_0x224249){return _0x224249[_0x9360('0x2')](_0x9360('0x3'),attributes,{'tableName':_0x9360('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x133b7c){if(!_0x133b7c['clientSideLoggingEnabled'])_0x133b7c[_0x9360('0x5')]=null;else if(_0x133b7c[_0x9360('0x5')]===null)_0x133b7c[_0x9360('0x5')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index cd0ed99..051a9c4 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb774=['user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events','save','remove','update','emit','user-setting:update'];(function(_0x30f9ab,_0x45cefe){var _0xfd64f7=function(_0x591f6c){while(--_0x591f6c){_0x30f9ab['push'](_0x30f9ab['shift']());}};_0xfd64f7(++_0x45cefe);}(_0xb774,0x1d3));var _0x4b77=function(_0x1a32d2,_0x288872){_0x1a32d2=_0x1a32d2-0x0;var _0x37182d=_0xb774[_0x1a32d2];return _0x37182d;};'use strict';var UserSettingEvents=require(_0x4b77('0x0'));var events=[_0x4b77('0x1'),_0x4b77('0x2'),_0x4b77('0x3')];function createListener(_0x2903d4,_0x337a8b){return function(_0x235aed){_0x337a8b[_0x4b77('0x4')](_0x2903d4,_0x235aed);if(_0x2903d4===_0x4b77('0x5')){_0x337a8b['emit'](_0x4b77('0x6')+_0x235aed[_0x4b77('0x7')],_0x235aed);}};}exports[_0x4b77('0x8')]=function(_0x47cd2a){for(var _0x44bebf=0x0,_0x5441fd=events[_0x4b77('0x9')];_0x44bebf<_0x5441fd;_0x44bebf++){var _0x18fe2c=events[_0x44bebf];var _0x287811=createListener(_0x4b77('0xa')+_0x18fe2c,_0x47cd2a);UserSettingEvents['on'](_0x18fe2c,_0x287811);}}; \ No newline at end of file +var _0x5ab9=['emit','user-setting:update','user-setting:update:user-','UserId','register','user-setting:','save','remove','update'];(function(_0x44b362,_0x1b5fd9){var _0x38b45c=function(_0x163919){while(--_0x163919){_0x44b362['push'](_0x44b362['shift']());}};_0x38b45c(++_0x1b5fd9);}(_0x5ab9,0xe7));var _0x95ab=function(_0x5cfdd8,_0x27555c){_0x5cfdd8=_0x5cfdd8-0x0;var _0x4fd729=_0x5ab9[_0x5cfdd8];return _0x4fd729;};'use strict';var UserSettingEvents=require('./user-setting.events');var events=[_0x95ab('0x0'),_0x95ab('0x1'),_0x95ab('0x2')];function createListener(_0x652913,_0x56ea15){return function(_0x15927b){_0x56ea15[_0x95ab('0x3')](_0x652913,_0x15927b);if(_0x652913===_0x95ab('0x4')){_0x56ea15[_0x95ab('0x3')](_0x95ab('0x5')+_0x15927b[_0x95ab('0x6')],_0x15927b);}};}exports[_0x95ab('0x7')]=function(_0x352f60){for(var _0x5c19f8=0x0,_0x26f2dd=events['length'];_0x5c19f8<_0x26f2dd;_0x5c19f8++){var _0x3bba0a=events[_0x5c19f8];var _0x55b787=createListener(_0x95ab('0x8')+_0x3bba0a,_0x352f60);UserSettingEvents['on'](_0x3bba0a,_0x55b787);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 379dee7..03f9817 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 _0x543b=['addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','messengerSoundNotification','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','/presence','getPresence','/:id','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getScheduledCalls','getApiKey','post','/:id/contacts','addContacts','create','bulkCreate','addQueues','join','root','server/files/images/','format','%s-%s','now','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions'];(function(_0x110c41,_0x41ec88){var _0x7c374a=function(_0x5b8edf){while(--_0x5b8edf){_0x110c41['push'](_0x110c41['shift']());}};_0x7c374a(++_0x41ec88);}(_0x543b,0x18d));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb543('0x0'));var util=require(_0xb543('0x1'));var path=require(_0xb543('0x2'));var timeout=require('connect-timeout');var express=require(_0xb543('0x3'));var router=express[_0xb543('0x4')]();var fs_extra=require(_0xb543('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb543('0x6'));var config=require(_0xb543('0x7'));var controller=require(_0xb543('0x8'));router[_0xb543('0x9')]('/',auth[_0xb543('0xa')](),controller[_0xb543('0xb')]);router[_0xb543('0x9')](_0xb543('0xc'),auth[_0xb543('0xa')](),controller[_0xb543('0xd')]);router[_0xb543('0x9')](_0xb543('0xe'),auth['isAuthenticated'](),controller[_0xb543('0xf')]);router['get'](_0xb543('0x10'),auth[_0xb543('0xa')](),controller[_0xb543('0x11')]);router[_0xb543('0x9')](_0xb543('0x12'),auth[_0xb543('0xa')](),controller['show']);router[_0xb543('0x9')](_0xb543('0x13'),controller[_0xb543('0x14')]);router['get'](_0xb543('0x15'),auth[_0xb543('0xa')](),controller[_0xb543('0x16')]);router['get']('/:id/contacts',auth[_0xb543('0xa')](),controller[_0xb543('0x17')]);router[_0xb543('0x9')](_0xb543('0x18'),auth['isAuthenticated'](),controller[_0xb543('0x19')]);router[_0xb543('0x9')](_0xb543('0x1a'),auth[_0xb543('0xa')](),controller['getVoiceQueuesRt']);router[_0xb543('0x9')]('/:id/groups',auth[_0xb543('0xa')](),controller[_0xb543('0x1b')]);router[_0xb543('0x9')](_0xb543('0x1c'),auth['isAuthenticated'](),controller[_0xb543('0x1d')]);router[_0xb543('0x9')](_0xb543('0x1e'),auth['isAuthenticated'](),controller['getScreenRecordings']);router[_0xb543('0x9')](_0xb543('0x1f'),auth[_0xb543('0xa')](),controller[_0xb543('0x20')]);router[_0xb543('0x9')](_0xb543('0x21'),auth[_0xb543('0xa')](),controller[_0xb543('0x22')]);router['get'](_0xb543('0x23'),auth[_0xb543('0xa')](),controller[_0xb543('0x24')]);router[_0xb543('0x9')](_0xb543('0x25'),auth[_0xb543('0xa')](),controller['getSmsInteractions']);router['get']('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0xb543('0x26')]);router[_0xb543('0x9')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0xb543('0x27')]);router[_0xb543('0x9')](_0xb543('0x28'),auth['isAuthenticated'](),controller[_0xb543('0x29')]);router['get'](_0xb543('0x2a'),auth[_0xb543('0xa')](),controller[_0xb543('0x2b')]);router[_0xb543('0x9')](_0xb543('0x2c'),auth['isAuthenticated'](),controller[_0xb543('0x2d')]);router['get']('/:id/prefixes',auth[_0xb543('0xa')](),controller[_0xb543('0x2e')]);router[_0xb543('0x9')](_0xb543('0x2f'),auth[_0xb543('0xa')](),controller[_0xb543('0x30')]);router['get'](_0xb543('0x31'),auth['isAuthenticated'](),controller[_0xb543('0x32')]);router[_0xb543('0x9')](_0xb543('0x33'),auth[_0xb543('0xa')](),controller['getOpenchannelAccounts']);router[_0xb543('0x9')]('/:id/sms_accounts',auth[_0xb543('0xa')](),controller[_0xb543('0x34')]);router[_0xb543('0x9')](_0xb543('0x35'),auth['isAuthenticated'](),controller[_0xb543('0x36')]);router[_0xb543('0x9')](_0xb543('0x37'),auth[_0xb543('0xa')](),controller[_0xb543('0x38')]);router[_0xb543('0x9')]('/:id/scheduled_calls',auth[_0xb543('0xa')](),controller[_0xb543('0x39')]);router[_0xb543('0x9')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xb543('0x3a')]);router[_0xb543('0x3b')](_0xb543('0x3c'),auth[_0xb543('0xa')](),controller[_0xb543('0x3d')]);router[_0xb543('0x3b')]('/',auth[_0xb543('0xa')](),controller[_0xb543('0x3e')]);router[_0xb543('0x3b')]('/create_many',auth[_0xb543('0xa')](),controller[_0xb543('0x3f')]);router['post'](_0xb543('0x18'),auth[_0xb543('0xa')](),controller[_0xb543('0x40')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xdec696,_0x82d876,_0x53e165){_0x53e165(null,path[_0xb543('0x41')](config[_0xb543('0x42')],_0xb543('0x43')));},'filename':function(_0x55832c,_0x53bf42,_0x1d1736){_0x1d1736(null,util[_0xb543('0x44')](_0xb543('0x45'),Date[_0xb543('0x46')](),_0x53bf42['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0xb543('0x47')),controller[_0xb543('0x48')]);router[_0xb543('0x3b')](_0xb543('0x49'),auth[_0xb543('0xa')](),controller[_0xb543('0x4a')]);router['post'](_0xb543('0x4b'),auth[_0xb543('0xa')](),controller[_0xb543('0x4c')]);router[_0xb543('0x3b')]('/:id/pause',auth[_0xb543('0xa')](),controller[_0xb543('0x4d')]);router[_0xb543('0x3b')](_0xb543('0x4e'),auth[_0xb543('0xa')](),controller[_0xb543('0x4f')]);router[_0xb543('0x3b')](_0xb543('0x28'),auth[_0xb543('0xa')](),controller[_0xb543('0x50')]);router[_0xb543('0x3b')](_0xb543('0x51'),auth[_0xb543('0xa')](),controller['addChatInteractions']);router[_0xb543('0x3b')](_0xb543('0x52'),auth[_0xb543('0xa')](),controller[_0xb543('0x53')]);router[_0xb543('0x3b')](_0xb543('0x54'),auth['isAuthenticated'](),controller[_0xb543('0x55')]);router[_0xb543('0x3b')](_0xb543('0x56'),auth[_0xb543('0xa')](),controller['addSmsInteractions']);router['post'](_0xb543('0x57'),auth[_0xb543('0xa')](),controller[_0xb543('0x58')]);router[_0xb543('0x3b')]('/:id/whatsapp_interactions',auth[_0xb543('0xa')](),controller[_0xb543('0x59')]);router[_0xb543('0x3b')](_0xb543('0x2f'),auth[_0xb543('0xa')](),controller[_0xb543('0x5a')]);router['post']('/:id/mail_accounts',auth[_0xb543('0xa')](),controller[_0xb543('0x5b')]);router['post']('/:id/openchannel_accounts',auth[_0xb543('0xa')](),controller[_0xb543('0x5c')]);router[_0xb543('0x3b')](_0xb543('0x5d'),auth[_0xb543('0xa')](),controller[_0xb543('0x5e')]);router[_0xb543('0x3b')]('/:id/chat_websites',auth[_0xb543('0xa')](),controller[_0xb543('0x5f')]);router['post'](_0xb543('0x37'),auth['isAuthenticated'](),controller['addWhatsappAccounts']);router[_0xb543('0x3b')]('/:id/api_key',auth[_0xb543('0xa')](),controller[_0xb543('0x60')]);router[_0xb543('0x61')](_0xb543('0x12'),auth['isAuthenticated'](),controller[_0xb543('0x62')]);router[_0xb543('0x61')](_0xb543('0x63'),auth[_0xb543('0xa')](),controller[_0xb543('0x64')]);router[_0xb543('0x65')](_0xb543('0x18'),auth[_0xb543('0xa')](),controller[_0xb543('0x66')]);router[_0xb543('0x65')]('/:id/teams',auth[_0xb543('0xa')](),controller[_0xb543('0x67')]);router[_0xb543('0x65')](_0xb543('0x12'),auth[_0xb543('0xa')](),controller[_0xb543('0x68')]);router[_0xb543('0x65')](_0xb543('0x51'),auth['isAuthenticated'](),controller['removeChatInteractions']);router[_0xb543('0x65')](_0xb543('0x52'),auth[_0xb543('0xa')](),controller[_0xb543('0x69')]);router[_0xb543('0x65')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0xb543('0x6a')]);router[_0xb543('0x65')](_0xb543('0x56'),auth[_0xb543('0xa')](),controller[_0xb543('0x6b')]);router[_0xb543('0x65')](_0xb543('0x57'),auth[_0xb543('0xa')](),controller[_0xb543('0x6c')]);router[_0xb543('0x65')](_0xb543('0x6d'),auth[_0xb543('0xa')](),controller[_0xb543('0x6e')]);router[_0xb543('0x65')](_0xb543('0x2f'),auth[_0xb543('0xa')](),controller[_0xb543('0x6f')]);router['delete'](_0xb543('0x31'),auth[_0xb543('0xa')](),controller[_0xb543('0x70')]);router[_0xb543('0x65')](_0xb543('0x33'),auth[_0xb543('0xa')](),controller[_0xb543('0x71')]);router[_0xb543('0x65')](_0xb543('0x5d'),auth[_0xb543('0xa')](),controller[_0xb543('0x72')]);router['delete'](_0xb543('0x35'),auth['isAuthenticated'](),controller[_0xb543('0x73')]);router[_0xb543('0x65')]('/:id/whatsapp_accounts',auth[_0xb543('0xa')](),controller[_0xb543('0x74')]);router[_0xb543('0x65')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xb543('0x75')]);router[_0xb543('0x3b')]('/:id/messengerSoundNotification',auth['isAuthenticated'](),controller[_0xb543('0x76')]);module[_0xb543('0x77')]=router; \ No newline at end of file +var _0x3c36=['addContacts','create','bulkCreate','diskStorage','join','server/files/images/','format','%s-%s','now','originalname','file','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','addWhatsappAccounts','createApiKey','put','update','changePassword','delete','removeQueues','removeTeams','destroy','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeWhatsappInteractions','/:id/mail_accounts','removeMailAccounts','removeSmsAccounts','/:id/chat_websites','removeApiKey','/:id/messengerSoundNotification','messengerSoundNotification','exports','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./user.controller','get','/describe','describe','/whoami','isAuthenticated','whoami','/:id','show','/:id/avatar','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post'];(function(_0x510aa6,_0x5984cc){var _0x5d7c19=function(_0x16b218){while(--_0x16b218){_0x510aa6['push'](_0x510aa6['shift']());}};_0x5d7c19(++_0x5984cc);}(_0x3c36,0x10c));var _0x63c3=function(_0x34b79b,_0x406583){_0x34b79b=_0x34b79b-0x0;var _0x2c2925=_0x3c36[_0x34b79b];return _0x2c2925;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x63c3('0x0'));var timeout=require(_0x63c3('0x1'));var express=require(_0x63c3('0x2'));var router=express['Router']();var fs_extra=require(_0x63c3('0x3'));var auth=require(_0x63c3('0x4'));var interaction=require(_0x63c3('0x5'));var config=require('../../config/environment');var controller=require(_0x63c3('0x6'));router[_0x63c3('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x63c3('0x8'),auth['isAuthenticated'](),controller[_0x63c3('0x9')]);router['get'](_0x63c3('0xa'),auth[_0x63c3('0xb')](),controller[_0x63c3('0xc')]);router[_0x63c3('0x7')]('/presence',auth[_0x63c3('0xb')](),controller['getPresence']);router['get'](_0x63c3('0xd'),auth[_0x63c3('0xb')](),controller[_0x63c3('0xe')]);router[_0x63c3('0x7')](_0x63c3('0xf'),controller[_0x63c3('0x10')]);router['get']('/:id/open_tabs',auth['isAuthenticated'](),controller['getOpenTabs']);router[_0x63c3('0x7')](_0x63c3('0x11'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x12')]);router[_0x63c3('0x7')](_0x63c3('0x13'),auth['isAuthenticated'](),controller[_0x63c3('0x14')]);router[_0x63c3('0x7')](_0x63c3('0x15'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x16')]);router[_0x63c3('0x7')](_0x63c3('0x17'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x18')]);router[_0x63c3('0x7')]('/:id/recordings',auth[_0x63c3('0xb')](),controller['getRecordings']);router[_0x63c3('0x7')](_0x63c3('0x19'),auth['isAuthenticated'](),controller[_0x63c3('0x1a')]);router[_0x63c3('0x7')](_0x63c3('0x1b'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x1c')]);router['get'](_0x63c3('0x1d'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x1e')]);router['get'](_0x63c3('0x1f'),auth[_0x63c3('0xb')](),controller['getMailInteractions']);router['get']('/:id/sms/interactions',auth[_0x63c3('0xb')](),controller[_0x63c3('0x20')]);router[_0x63c3('0x7')](_0x63c3('0x21'),auth[_0x63c3('0xb')](),controller['getFaxInteractions']);router[_0x63c3('0x7')](_0x63c3('0x22'),auth['isAuthenticated'](),controller[_0x63c3('0x23')]);router[_0x63c3('0x7')](_0x63c3('0x24'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x25')]);router[_0x63c3('0x7')](_0x63c3('0x26'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x27')]);router[_0x63c3('0x7')]('/:id/agents',auth[_0x63c3('0xb')](),controller[_0x63c3('0x28')]);router[_0x63c3('0x7')](_0x63c3('0x29'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x2a')]);router[_0x63c3('0x7')](_0x63c3('0x2b'),auth['isAuthenticated'](),controller[_0x63c3('0x2c')]);router[_0x63c3('0x7')]('/:id/mail_accounts',auth[_0x63c3('0xb')](),controller[_0x63c3('0x2d')]);router[_0x63c3('0x7')](_0x63c3('0x2e'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x2f')]);router[_0x63c3('0x7')](_0x63c3('0x30'),auth[_0x63c3('0xb')](),controller['getSmsAccounts']);router[_0x63c3('0x7')]('/:id/chat_websites',auth['isAuthenticated'](),controller['getChatWebsites']);router[_0x63c3('0x7')](_0x63c3('0x31'),auth['isAuthenticated'](),controller[_0x63c3('0x32')]);router[_0x63c3('0x7')](_0x63c3('0x33'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x34')]);router[_0x63c3('0x7')](_0x63c3('0x35'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x36')]);router[_0x63c3('0x37')](_0x63c3('0x11'),auth['isAuthenticated'](),controller[_0x63c3('0x38')]);router[_0x63c3('0x37')]('/',auth[_0x63c3('0xb')](),controller[_0x63c3('0x39')]);router[_0x63c3('0x37')]('/create_many',auth[_0x63c3('0xb')](),controller[_0x63c3('0x3a')]);router['post'](_0x63c3('0x13'),auth[_0x63c3('0xb')](),controller['addQueues']);var upload=multer({'storage':multer[_0x63c3('0x3b')]({'destination':function(_0x149d0e,_0x54f070,_0x312d64){_0x312d64(null,path[_0x63c3('0x3c')](config['root'],_0x63c3('0x3d')));},'filename':function(_0x53d084,_0x2f7912,_0x34ba89){_0x34ba89(null,util[_0x63c3('0x3e')](_0x63c3('0x3f'),Date[_0x63c3('0x40')](),_0x2f7912[_0x63c3('0x41')]));}})});router[_0x63c3('0x37')](_0x63c3('0xf'),upload['single'](_0x63c3('0x42')),controller['addAvatar']);router[_0x63c3('0x37')](_0x63c3('0x43'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x44')]);router[_0x63c3('0x37')]('/:id/logout',auth['isAuthenticated'](),controller[_0x63c3('0x45')]);router[_0x63c3('0x37')](_0x63c3('0x46'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x47')]);router['post'](_0x63c3('0x48'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x49')]);router[_0x63c3('0x37')](_0x63c3('0x24'),auth[_0x63c3('0xb')](),controller['addTeams']);router['post'](_0x63c3('0x4a'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x4b')]);router[_0x63c3('0x37')](_0x63c3('0x4c'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x4d')]);router['post'](_0x63c3('0x4e'),auth[_0x63c3('0xb')](),controller['addFaxInteractions']);router[_0x63c3('0x37')](_0x63c3('0x4f'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x50')]);router['post'](_0x63c3('0x51'),auth[_0x63c3('0xb')](),controller['addOpenchannelInteractions']);router[_0x63c3('0x37')](_0x63c3('0x52'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x53')]);router[_0x63c3('0x37')](_0x63c3('0x2b'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x54')]);router[_0x63c3('0x37')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x63c3('0x55')]);router[_0x63c3('0x37')](_0x63c3('0x2e'),auth[_0x63c3('0xb')](),controller['addOpenchannelAccounts']);router[_0x63c3('0x37')](_0x63c3('0x30'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x56')]);router[_0x63c3('0x37')]('/:id/chat_websites',auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x63c3('0x37')](_0x63c3('0x31'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x57')]);router[_0x63c3('0x37')](_0x63c3('0x35'),auth['isAuthenticated'](),controller[_0x63c3('0x58')]);router[_0x63c3('0x59')](_0x63c3('0xd'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x5a')]);router[_0x63c3('0x59')]('/:id/password',auth['isAuthenticated'](),controller[_0x63c3('0x5b')]);router[_0x63c3('0x5c')]('/:id/queues',auth['isAuthenticated'](),controller[_0x63c3('0x5d')]);router['delete'](_0x63c3('0x24'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x5e')]);router[_0x63c3('0x5c')](_0x63c3('0xd'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x5f')]);router[_0x63c3('0x5c')](_0x63c3('0x4a'),auth[_0x63c3('0xb')](),controller['removeChatInteractions']);router[_0x63c3('0x5c')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x63c3('0x60')]);router['delete'](_0x63c3('0x4e'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x61')]);router[_0x63c3('0x5c')](_0x63c3('0x4f'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x62')]);router[_0x63c3('0x5c')](_0x63c3('0x51'),auth[_0x63c3('0xb')](),controller['removeOpenchannelInteractions']);router[_0x63c3('0x5c')](_0x63c3('0x52'),auth['isAuthenticated'](),controller[_0x63c3('0x63')]);router[_0x63c3('0x5c')]('/:id/fax_accounts',auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x63c3('0x5c')](_0x63c3('0x64'),auth['isAuthenticated'](),controller[_0x63c3('0x65')]);router[_0x63c3('0x5c')](_0x63c3('0x2e'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x63c3('0x5c')](_0x63c3('0x30'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x66')]);router[_0x63c3('0x5c')](_0x63c3('0x67'),auth[_0x63c3('0xb')](),controller['removeChatWebsites']);router[_0x63c3('0x5c')](_0x63c3('0x31'),auth[_0x63c3('0xb')](),controller['removeWhatsappAccounts']);router[_0x63c3('0x5c')](_0x63c3('0x35'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x68')]);router[_0x63c3('0x37')](_0x63c3('0x69'),auth[_0x63c3('0xb')](),controller[_0x63c3('0x6a')]);module[_0x63c3('0x6b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index dab55c4..13ef12d 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 _0x2f41=['dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','blocked','loginAttempts','blockedAt','UNSIGNED','moment','lodash','exports','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','callerid','format','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','local','INTEGER','accountcode','getDataValue','fullname','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','info','auto','rfc2833','yes','nonat','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','update','update,nonat','DATE','TEXT','showWebBar','get','isArray','wss','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','rtcp_mux'];(function(_0x5e4e38,_0x53196a){var _0x109c89=function(_0x229947){while(--_0x229947){_0x5e4e38['push'](_0x5e4e38['shift']());}};_0x109c89(++_0x53196a);}(_0x2f41,0x125));var _0x12f4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x2f41[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x12f4('0x0'));var util=require('util');var _=require(_0x12f4('0x1'));module[_0x12f4('0x2')]={'name':{'type':Sequelize[_0x12f4('0x3')],'allowNull':![],'unique':_0x12f4('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x22805a){this['setDataValue'](_0x12f4('0x4'),_0x22805a);this[_0x12f4('0x5')](_0x12f4('0x6'),_0x22805a);},'comment':_0x12f4('0x7')},'fullname':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x4ec4d0){this['setDataValue']('fullname',_0x4ec4d0);this[_0x12f4('0x5')](_0x12f4('0x8'),util[_0x12f4('0x9')]('\x22%s\x22\x20<%s>',_0x4ec4d0,this['getDataValue'](_0x12f4('0xa'))));}},'alias':{'type':Sequelize[_0x12f4('0x3')]},'email':{'type':Sequelize[_0x12f4('0x3')],'allowNull':![],'unique':_0x12f4('0xb'),'validate':{'isEmail':!![]},'set':function(_0x2671cc){if(_0x2671cc){this[_0x12f4('0x5')](_0x12f4('0xb'),_0x2671cc[_0x12f4('0xc')]());}}},'role':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0xe'),_0x12f4('0xf'),_0x12f4('0x10'),_0x12f4('0x11')),'allowNull':![]},'password':{'type':Sequelize[_0x12f4('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x12f4('0x3')],'defaultValue':_0x12f4('0x12')},'internal':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':![],'unique':_0x12f4('0xa'),'set':function(_0x1d2a9a){this[_0x12f4('0x5')](_0x12f4('0xa'),_0x1d2a9a);this[_0x12f4('0x5')](_0x12f4('0x14'),_0x1d2a9a);this['setDataValue'](_0x12f4('0x8'),util[_0x12f4('0x9')]('\x22%s\x22\x20<%s>',this[_0x12f4('0x15')](_0x12f4('0x16')),_0x1d2a9a));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x12f4('0x3')]},'mobile':{'type':Sequelize[_0x12f4('0x3')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x12f4('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x12f4('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x12f4('0x3')],'defaultValue':_0x12f4('0x18')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x12f4('0x13')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x12f4('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize['INTEGER'],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'description':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![],'defaultValue':_0x12f4('0x19')},'ipaddr':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x12f4('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x1a'),_0x12f4('0xf'),_0x12f4('0x1b')),'allowNull':!![],'defaultValue':_0x12f4('0x1a')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x12f4('0x1c')},'callingpres':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x1d'),_0x12f4('0x1e'),_0x12f4('0x1f'),_0x12f4('0x20'),'PROHIB_NOT_SCREENED',_0x12f4('0x21'),'PROHIB_FAILED_SCREEN',_0x12f4('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![],'defaultValue':_0x12f4('0x23'),'set':function(_0x18c31d){this[_0x12f4('0x5')](_0x12f4('0x24'),_0x18c31d?_0x18c31d[_0x12f4('0x25')](','):null);},'get':function(){return this[_0x12f4('0x15')](_0x12f4('0x24'))?this[_0x12f4('0x15')](_0x12f4('0x24'))[_0x12f4('0x26')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x12f4('0xd')]('rfc2833',_0x12f4('0x27'),'shortinfo','inband',_0x12f4('0x28')),'allowNull':!![],'defaultValue':_0x12f4('0x29')},'directmedia':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no',_0x12f4('0x2b'),'update','outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![],'defaultValue':_0x12f4('0x2c'),'set':function(_0x3c0466){this[_0x12f4('0x5')]('nat',_0x3c0466?_0x3c0466[_0x12f4('0x25')](','):null);},'get':function(){return this[_0x12f4('0x15')](_0x12f4('0x2d'))?this[_0x12f4('0x15')](_0x12f4('0x2d'))['split'](','):null;},'comment':_0x12f4('0x2e')},'callgroup':{'type':Sequelize[_0x12f4('0x3')]},'namedcallgroup':{'type':Sequelize[_0x12f4('0x3')]},'pickupgroup':{'type':Sequelize[_0x12f4('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x12f4('0x3')]},'disallow':{'type':Sequelize[_0x12f4('0x3')],'allowNull':![],'defaultValue':_0x12f4('0x2f')},'allow':{'type':Sequelize[_0x12f4('0x3')],'allowNull':![],'defaultValue':_0x12f4('0x30'),'set':function(_0x96f6a2){this[_0x12f4('0x5')](_0x12f4('0x31'),_0x96f6a2?_0x96f6a2[_0x12f4('0x25')](';'):_0x12f4('0x30'));},'get':function(){return this[_0x12f4('0x15')](_0x12f4('0x31'))?this[_0x12f4('0x15')](_0x12f4('0x31'))[_0x12f4('0x26')](';'):null;},'comment':_0x12f4('0x32')},'autoframing':{'type':Sequelize[_0x12f4('0xd')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![],'set':function(_0x2c40bc){this[_0x12f4('0x5')](_0x12f4('0x33'),_0x2c40bc?_0x2c40bc[_0x12f4('0x25')](','):null);},'get':function(){return this[_0x12f4('0x15')]('insecure')?this[_0x12f4('0x15')](_0x12f4('0x33'))[_0x12f4('0x26')](','):null;},'comment':_0x12f4('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no',_0x12f4('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x12f4('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x12f4('0x2a')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x12f4('0xd')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no',_0x12f4('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x37'),_0x12f4('0x38'),_0x12f4('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x3a'),_0x12f4('0x3b')),'allowNull':!![],'defaultValue':_0x12f4('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize['STRING'],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x12f4('0x2a')},'keepalive':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x12f4('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x12f4('0xd')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x12f4('0xd')]('yes','no','fingerprint',_0x12f4('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x3d'),_0x12f4('0x3e'),_0x12f4('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x12f4('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x12f4('0x2a'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x12f4('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no','nonat',_0x12f4('0x40'),_0x12f4('0x41')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x12f4('0x3')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x12f4('0x42')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x12f4('0x43')]},'showWebBar':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0,'set':function(_0x3b9158){this[_0x12f4('0x5')](_0x12f4('0x44'),_0x3b9158);var _0x2424b6=this[_0x12f4('0x45')]({'plain':!![]});switch(_0x3b9158){case 0x0:case 0x1:var _0x48bb7a=_0x2424b6['transport']?_[_0x12f4('0x46')](_0x2424b6[_0x12f4('0x24')])?_0x2424b6[_0x12f4('0x24')][_0x12f4('0x25')]():_0x2424b6['transport']:_0x12f4('0x23');if(_0x48bb7a===_0x12f4('0x47')){_0x48bb7a=_0x12f4('0x23');}this[_0x12f4('0x5')](_0x12f4('0x24'),_0x48bb7a);this['setDataValue']('encryption','no');this[_0x12f4('0x5')](_0x12f4('0x48'),null);this[_0x12f4('0x5')](_0x12f4('0x49'),null);this['setDataValue'](_0x12f4('0x4a'),null);this['setDataValue'](_0x12f4('0x4b'),null);this['setDataValue']('dtlsverify',null);this[_0x12f4('0x5')](_0x12f4('0x4c'),null);this[_0x12f4('0x5')]('dtlscertfile',null);this[_0x12f4('0x5')](_0x12f4('0x4d'),null);this[_0x12f4('0x5')](_0x12f4('0x4e'),'no');break;case 0x2:this[_0x12f4('0x5')](_0x12f4('0x24'),_0x12f4('0x47'));this[_0x12f4('0x5')]('encryption',_0x12f4('0x2a'));this[_0x12f4('0x5')](_0x12f4('0x48'),'yes');this[_0x12f4('0x5')](_0x12f4('0x49'),_0x12f4('0x2a'));this[_0x12f4('0x5')](_0x12f4('0x4a'),_0x12f4('0x2a'));this[_0x12f4('0x5')]('dtlsenable',_0x12f4('0x2a'));this[_0x12f4('0x5')]('dtlsverify','no');this['setDataValue'](_0x12f4('0x4c'),'actpass');this['setDataValue'](_0x12f4('0x4f'),_0x2424b6[_0x12f4('0x4f')]||_0x12f4('0x50'));this[_0x12f4('0x5')](_0x12f4('0x4d'),_0x2424b6[_0x12f4('0x4d')]||_0x12f4('0x51'));this[_0x12f4('0x5')](_0x12f4('0x4e'),_0x12f4('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x12f4('0x43')],'set':function(_0x35b5){this[_0x12f4('0x5')](_0x12f4('0x52'),_0x35b5?_0x35b5[_0x12f4('0x25')](','):[]);},'get':function(){return this['getDataValue'](_0x12f4('0x52'))?_[_0x12f4('0x53')](this['getDataValue'](_0x12f4('0x52'))[_0x12f4('0x26')](','),function(_0x2b2605){return parseInt(_0x2b2605,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x12f4('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x12f4('0x3')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x12f4('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x12f4('0xd')](_0x12f4('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x12f4('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x12f4('0x54')],'get':function(){return this[_0x12f4('0x15')](_0x12f4('0x55'))?this[_0x12f4('0x15')](_0x12f4('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0x12f4('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x12f4('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x72cbc){if(typeof _0x72cbc===_0x12f4('0x56')){var _0x33d533=_0x72cbc==='1'?!![]:_0x72cbc==='0'?![]:_0x72cbc===_0x12f4('0x57')?!![]:_0x72cbc===_0x12f4('0x58')?![]:![];this[_0x12f4('0x5')]('screenrecording',_0x33d533);}else{this[_0x12f4('0x5')]('screenrecording',_0x72cbc);}}},'blocked':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![],'set':function(_0x115f02){this[_0x12f4('0x5')](_0x12f4('0x59'),_0x115f02);if(_0x115f02===!![]){this[_0x12f4('0x5')]('blockedAt',moment());this[_0x12f4('0x5')](_0x12f4('0x5a'),0x0);}else{this[_0x12f4('0x5')](_0x12f4('0x5b'),null);}}},'blockedAt':{'type':Sequelize['DATE'],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x12f4('0x13')](0x5)[_0x12f4('0x5c')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x12f4('0x13')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x12f4('0x17')],'defaultValue':![]}}; \ No newline at end of file +var _0xd1f1=['uas','fingerprint','certificate','active','update,nonat','showWebBar','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','string','false','screenrecording','blocked','blockedAt','UNSIGNED','moment','util','exports','setDataValue','name','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','INTEGER','friend','user','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac'];(function(_0x34b831,_0x44b82f){var _0x25dedb=function(_0x559f5e){while(--_0x559f5e){_0x34b831['push'](_0x34b831['shift']());}};_0x25dedb(++_0x44b82f);}(_0xd1f1,0x72));var _0x1d1f=function(_0x4030d4,_0x336ab2){_0x4030d4=_0x4030d4-0x0;var _0x342e02=_0xd1f1[_0x4030d4];return _0x342e02;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var _=require('lodash');module[_0x1d1f('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x17d1ca){this[_0x1d1f('0x3')](_0x1d1f('0x4'),_0x17d1ca);this[_0x1d1f('0x3')]('defaultuser',_0x17d1ca);},'comment':_0x1d1f('0x5')},'fullname':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':![],'set':function(_0x3d97b0){this[_0x1d1f('0x3')](_0x1d1f('0x7'),_0x3d97b0);this[_0x1d1f('0x3')](_0x1d1f('0x8'),util[_0x1d1f('0x9')](_0x1d1f('0xa'),_0x3d97b0,this[_0x1d1f('0xb')](_0x1d1f('0xc'))));}},'alias':{'type':Sequelize[_0x1d1f('0x6')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x1d1f('0xd'),'validate':{'isEmail':!![]},'set':function(_0x18b996){if(_0x18b996){this[_0x1d1f('0x3')](_0x1d1f('0xd'),_0x18b996[_0x1d1f('0xe')]());}}},'role':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x10'),'user',_0x1d1f('0x11'),_0x1d1f('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x1d1f('0x6')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x1d1f('0xc'),'set':function(_0x509313){this[_0x1d1f('0x3')](_0x1d1f('0xc'),_0x509313);this[_0x1d1f('0x3')](_0x1d1f('0x13'),_0x509313);this[_0x1d1f('0x3')](_0x1d1f('0x8'),util[_0x1d1f('0x9')](_0x1d1f('0xa'),this[_0x1d1f('0xb')](_0x1d1f('0x7')),_0x509313));}},'salt':{'type':Sequelize[_0x1d1f('0x6')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x1d1f('0x6')]},'address':{'type':Sequelize[_0x1d1f('0x6')]},'zipcode':{'type':Sequelize[_0x1d1f('0x6')]},'userpic':{'type':Sequelize[_0x1d1f('0x6')]},'city':{'type':Sequelize[_0x1d1f('0x6')]},'country':{'type':Sequelize[_0x1d1f('0x6')]},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x1d1f('0x14')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x1d1f('0x16')},'lastPauseAt':{'type':Sequelize[_0x1d1f('0x14')]},'chatCapacity':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x1d1f('0x17')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x1d1f('0x17')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x1d1f('0x17')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x18'),_0x1d1f('0x19'),'peer'),'allowNull':!![],'defaultValue':_0x1d1f('0x18')},'context':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0x1d1f('0xf')]('ALLOWED_NOT_SCREENED',_0x1d1f('0x1a'),_0x1d1f('0x1b'),_0x1d1f('0x1c'),_0x1d1f('0x1d'),_0x1d1f('0x1e'),_0x1d1f('0x1f'),_0x1d1f('0x20')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'secret':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'transport':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![],'defaultValue':_0x1d1f('0x21'),'set':function(_0x14d424){this[_0x1d1f('0x3')](_0x1d1f('0x22'),_0x14d424?_0x14d424[_0x1d1f('0x23')](','):null);},'get':function(){return this[_0x1d1f('0xb')](_0x1d1f('0x22'))?this['getDataValue'](_0x1d1f('0x22'))[_0x1d1f('0x24')](','):null;},'comment':_0x1d1f('0x25')},'dtmfmode':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x26'),_0x1d1f('0x27'),_0x1d1f('0x28'),_0x1d1f('0x29'),_0x1d1f('0x2a')),'allowNull':!![],'defaultValue':_0x1d1f('0x26')},'directmedia':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no',_0x1d1f('0x2c'),_0x1d1f('0x2d'),_0x1d1f('0x2e')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x1d1f('0x2f'),'set':function(_0x5364d1){this[_0x1d1f('0x3')](_0x1d1f('0x30'),_0x5364d1?_0x5364d1[_0x1d1f('0x23')](','):null);},'get':function(){return this[_0x1d1f('0xb')](_0x1d1f('0x30'))?this[_0x1d1f('0xb')]('nat')[_0x1d1f('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x1d1f('0x6')]},'namedcallgroup':{'type':Sequelize[_0x1d1f('0x6')]},'pickupgroup':{'type':Sequelize[_0x1d1f('0x6')]},'namedpickupgroup':{'type':Sequelize[_0x1d1f('0x6')]},'language':{'type':Sequelize[_0x1d1f('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x1d1f('0x6')]},'disallow':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':![],'defaultValue':_0x1d1f('0x31'),'set':function(_0x3512f0){this[_0x1d1f('0x3')](_0x1d1f('0x32'),_0x3512f0?_0x3512f0[_0x1d1f('0x23')](';'):_0x1d1f('0x31'));},'get':function(){return this['getDataValue'](_0x1d1f('0x32'))?this[_0x1d1f('0xb')](_0x1d1f('0x32'))['split'](';'):null;},'comment':_0x1d1f('0x33')},'autoframing':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![],'set':function(_0x21a02c){this[_0x1d1f('0x3')](_0x1d1f('0x34'),_0x21a02c?_0x21a02c['join'](','):null);},'get':function(){return this[_0x1d1f('0xb')](_0x1d1f('0x34'))?this['getDataValue'](_0x1d1f('0x34'))[_0x1d1f('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no',_0x1d1f('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x1d1f('0xf')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![],'defaultValue':_0x1d1f('0x36')},'amaflags':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':_0x1d1f('0x2b')},'busylevel':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x1d1f('0xf')]('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'template':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no',_0x1d1f('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x38'),_0x1d1f('0x39'),_0x1d1f('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x3b'),_0x1d1f('0x3c')),'allowNull':!![],'defaultValue':_0x1d1f('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x1d1f('0x17')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no',_0x1d1f('0x3d'),_0x1d1f('0x3e')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM'](_0x1d1f('0x3f'),'passive','actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x1d1f('0xf')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0x1d1f('0x2b'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x1d1f('0x2b'),'no',_0x1d1f('0x2c'),_0x1d1f('0x2d'),_0x1d1f('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x1d1f('0x6')]},'resetPasswordExpires':{'type':Sequelize[_0x1d1f('0x14')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize['TEXT']},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0xde930b){this[_0x1d1f('0x3')](_0x1d1f('0x41'),_0xde930b);var _0x226f7c=this['get']({'plain':!![]});switch(_0xde930b){case 0x0:case 0x1:var _0x5c27b2=_0x226f7c[_0x1d1f('0x22')]?_['isArray'](_0x226f7c[_0x1d1f('0x22')])?_0x226f7c['transport']['join']():_0x226f7c[_0x1d1f('0x22')]:_0x1d1f('0x21');if(_0x5c27b2===_0x1d1f('0x42')){_0x5c27b2=_0x1d1f('0x21');}this[_0x1d1f('0x3')](_0x1d1f('0x22'),_0x5c27b2);this['setDataValue'](_0x1d1f('0x43'),'no');this[_0x1d1f('0x3')]('avpf',null);this[_0x1d1f('0x3')](_0x1d1f('0x44'),null);this[_0x1d1f('0x3')](_0x1d1f('0x45'),null);this[_0x1d1f('0x3')](_0x1d1f('0x46'),null);this[_0x1d1f('0x3')](_0x1d1f('0x47'),null);this[_0x1d1f('0x3')](_0x1d1f('0x48'),null);this[_0x1d1f('0x3')](_0x1d1f('0x49'),null);this[_0x1d1f('0x3')]('dtlsprivatekey',null);this[_0x1d1f('0x3')](_0x1d1f('0x4a'),'no');break;case 0x2:this[_0x1d1f('0x3')]('transport',_0x1d1f('0x42'));this[_0x1d1f('0x3')](_0x1d1f('0x43'),_0x1d1f('0x2b'));this[_0x1d1f('0x3')]('avpf',_0x1d1f('0x2b'));this[_0x1d1f('0x3')](_0x1d1f('0x44'),_0x1d1f('0x2b'));this[_0x1d1f('0x3')](_0x1d1f('0x45'),_0x1d1f('0x2b'));this['setDataValue'](_0x1d1f('0x46'),_0x1d1f('0x2b'));this[_0x1d1f('0x3')]('dtlsverify','no');this[_0x1d1f('0x3')]('dtlssetup','actpass');this[_0x1d1f('0x3')](_0x1d1f('0x49'),_0x226f7c['dtlscertfile']||_0x1d1f('0x4b'));this[_0x1d1f('0x3')](_0x1d1f('0x4c'),_0x226f7c['dtlsprivatekey']||_0x1d1f('0x4d'));this[_0x1d1f('0x3')](_0x1d1f('0x4a'),_0x1d1f('0x2b'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x149a73){this['setDataValue'](_0x1d1f('0x4e'),_0x149a73?_0x149a73[_0x1d1f('0x23')](','):[]);},'get':function(){return this[_0x1d1f('0xb')]('permissions')?_[_0x1d1f('0x4f')](this[_0x1d1f('0xb')](_0x1d1f('0x4e'))[_0x1d1f('0x24')](','),function(_0x4b1284){return parseInt(_0x4b1284,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x1d1f('0x6')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x1d1f('0x6')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x1d1f('0xf')](_0x1d1f('0x2b'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x1d1f('0x6')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x1d1f('0xb')](_0x1d1f('0x50'))?this[_0x1d1f('0xb')](_0x1d1f('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'interface':{'type':Sequelize[_0x1d1f('0x6')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x1d1f('0x6')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![],'set':function(_0x546773){if(typeof _0x546773===_0x1d1f('0x51')){var _0x35c367=_0x546773==='1'?!![]:_0x546773==='0'?![]:_0x546773==='true'?!![]:_0x546773===_0x1d1f('0x52')?![]:![];this['setDataValue'](_0x1d1f('0x53'),_0x35c367);}else{this[_0x1d1f('0x3')](_0x1d1f('0x53'),_0x546773);}}},'blocked':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'set':function(_0x5e1a93){this['setDataValue'](_0x1d1f('0x54'),_0x5e1a93);if(_0x5e1a93===!![]){this['setDataValue'](_0x1d1f('0x55'),moment());this[_0x1d1f('0x3')]('loginAttempts',0x0);}else{this[_0x1d1f('0x3')](_0x1d1f('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x1d1f('0x14')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x1d1f('0x17')](0x5)[_0x1d1f('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x1d1f('0x17')],'defaultValue':0x0},'messengerSoundNotification':{'type':Sequelize[_0x1d1f('0x15')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 403c190..49d39bc 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 _0x7af2=['$ne','$eq','$between','$in','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','firstName','CmContact','Contact','dialActive','VoiceQueue','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','token','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getUserSetting','ringing','teams','queues','flatten','toString','lower','col','asc','desc','substring','orderBy','getRealtimeAgents','offline','pause','voiceStatus','unavailable','busy','slice','charAt','toUpperCase','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','messengerSoundNotification','enabled','moment','lodash','squel','ioredis','../../components/auth/service','../../components/contacts','../../components/parsers/qs','../../components/realtime/agents','../../config/logger','../../config/environment','../../config/license/util','APIBadRequestError','../../errors/api','../../mysqldb','redis','./user.socket','register','localhost','end','json','offset','limit','undefined','count','status','set','Content-Range','update','then','role','agent','emit','userNotification:recalc:','user','Agents','Telephones','telephone','filter','ignore','value','includes','find','name','UserProfileResource','sendStatus','error','stack','send','User','rawAttributes','map','fieldName','type','password','previousPasswords','resetPasswordToken','resetPasswordExpires','index','where','query','includeAll','include','userSetting','true','UserSetting','rows','openTabs','length','dataValues','push','sms','fax','mail','openchannel','whatsapp','all','catch','params','getOptions','merge','options','attributes','body','describe','addContacts','ids','internal','findById','securePassword','max','isNil','min_internal','sequelize','QueryTypes','SELECT','from','mailbox','VoiceMail','fullname','email','permissions','102','103','113','110','104','105','106','107','108','109','100','115','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','create','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','findAll','changePassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','authenticate','Wrong\x20credentials','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','QueueId','Queue:save','voice','get','interface','format','SIP/%s','UserVoiceQueueRt','upsert','isArray','Queue:remove','destroy','addAvatar','userpic','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getOpenTabs','chat','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','SMS','WHATSAPP','concat','getContacts','User\x20with\x20id\x20%s\x20not\x20found','List','Tag','tag','model','keys','filters','intersection','fields','sort','pick','Queue','findOne','order','getVoiceQueuesRt','nolimit','getGroups','ChatGroup','hasOwnProperty','getRecordings','UserId','VoiceRecording','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','SmsInteraction','getSmsInteractions','FaxInteraction','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','login','phone','LOCAL/%s@from-sip/n','intrf','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','MemberReport','LOGININPAUSE','resolve','logout','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','Channel\x20parameter\x20%s\x20is\x20invalid','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','getTeams','addTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addAgent','getDataValue','Voice','penalty','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','Query\x20parameter\x20\x27ids\x27\x20is\x20required','removeTeams','Team','getAssociatedQueues','flattenDeep','removeAgent','getLists','CmList','values','CmHopper','addChatInteractions','omit','spread','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','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','$and','$or','$gt','$gte','$lt','$lte'];(function(_0x46a9f4,_0x52bd94){var _0xbd3ed6=function(_0x540050){while(--_0x540050){_0x46a9f4['push'](_0x46a9f4['shift']());}};_0xbd3ed6(++_0x52bd94);}(_0x7af2,0x1c4));var _0x27af=function(_0x4ee253,_0x4c2486){_0x4ee253=_0x4ee253-0x0;var _0x51378d=_0x7af2[_0x4ee253];return _0x51378d;};'use strict';var moment=require(_0x27af('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x27af('0x1'));var squel=require(_0x27af('0x2'));var Redis=require(_0x27af('0x3'));var authService=require(_0x27af('0x4'));var contacts=require(_0x27af('0x5'));var qs=require(_0x27af('0x6'));var rta=require(_0x27af('0x7'));var logger=require(_0x27af('0x8'))('api');var utils=require('../../config/utils');var config=require(_0x27af('0x9'));var licenseUtil=require(_0x27af('0xa'));var APIBadRequestError=require('../../errors/api')[_0x27af('0xb')];var APINotFoundError=require(_0x27af('0xc'))['APINotFoundError'];var APIForbiddenError=require('../../errors/api')['APIForbiddenrror'];var APIHandleError=require(_0x27af('0xc'))['handleError'];var db=require(_0x27af('0xd'))['db'];var socket=require('socket.io-emitter')(new Redis(config[_0x27af('0xe')]));require(_0x27af('0xf'))[_0x27af('0x10')](socket);config['redis']=_['defaults'](config[_0x27af('0xe')],{'host':_0x27af('0x11'),'port':0x18eb});var values;function respondWithStatusCode(_0x3b6f8d,_0x2b3c66){_0x2b3c66=_0x2b3c66||0xcc;return function(_0x5b3298){if(_0x5b3298){return _0x3b6f8d['sendStatus'](_0x2b3c66);}return _0x3b6f8d['status'](_0x2b3c66)[_0x27af('0x12')]();};}function respondWithResult(_0x2f4986,_0x4ca88f){_0x4ca88f=_0x4ca88f||0xc8;return function(_0x18c0c4){if(_0x18c0c4){return _0x2f4986['status'](_0x4ca88f)[_0x27af('0x13')](_0x18c0c4);}};}function respondWithFilteredResult(_0x5d96d1,_0x5821ae){return function(_0x4daf59){if(_0x4daf59){var _0xca0c9e=typeof _0x5821ae[_0x27af('0x14')]==='undefined'&&typeof _0x5821ae[_0x27af('0x15')]===_0x27af('0x16');var _0x34e921=_0x4daf59[_0x27af('0x17')];var _0x1ed6bd=_0xca0c9e?0x0:_0x5821ae['offset'];var _0x3d58ac=_0xca0c9e?_0x4daf59[_0x27af('0x17')]:_0x5821ae['offset']+_0x5821ae[_0x27af('0x15')];var _0x1b42e3;if(_0x3d58ac>=_0x34e921){_0x3d58ac=_0x34e921;_0x1b42e3=0xc8;}else{_0x1b42e3=0xce;}_0x5d96d1[_0x27af('0x18')](_0x1b42e3);return _0x5d96d1[_0x27af('0x19')](_0x27af('0x1a'),_0x1ed6bd+'-'+_0x3d58ac+'/'+_0x34e921)['json'](_0x4daf59);}return null;};}function saveUpdates(_0x5ae316){return function(_0x454d6c){if(_0x454d6c){return _0x454d6c[_0x27af('0x1b')](_0x5ae316)[_0x27af('0x1c')](function(_0x22722b){if(_0x22722b[_0x27af('0x1d')]===_0x27af('0x1e')){socket[_0x27af('0x1f')](_0x27af('0x20')+_0x22722b['id'],_0x22722b);}return _0x22722b;});}return null;};}function removeEntity(_0x62e494,_0x8b93f5){return function(_0x404852){if(_0x404852){return _0x404852['destroy']({'transaction':_0x8b93f5})[_0x27af('0x1c')](function(){var _0x5337fb=_0x404852['get']({'plain':!![]});if(_0x5337fb[_0x27af('0x1d')]==='admin')return;var _0x531fb7=[{'name':'Users','value':_0x27af('0x21'),'ignore':!![]},{'name':_0x27af('0x22'),'value':_0x27af('0x1e'),'ignore':![]},{'name':_0x27af('0x23'),'value':_0x27af('0x24'),'ignore':![]}];var _0x1791dc=_(_0x531fb7)[_0x27af('0x25')](_0x27af('0x26'))['map'](_0x27af('0x27'))[_0x27af('0x27')]();if(_[_0x27af('0x28')](_0x1791dc,_0x5337fb[_0x27af('0x1d')])){return;}var _0x4fcc31=_[_0x27af('0x29')](_0x531fb7,[_0x27af('0x27'),_0x5337fb[_0x27af('0x1d')]])[_0x27af('0x2a')];return db[_0x27af('0x2b')]['destroy']({'where':{'type':_0x4fcc31,'resourceId':_0x5337fb['id']},'transaction':_0x8b93f5})['then'](function(){return _0x404852;});})['then'](function(){_0x62e494['status'](0xcc)[_0x27af('0x12')]();});}};}function handleEntityNotFound(_0x28e07e){return function(_0x2edd8c){if(!_0x2edd8c){_0x28e07e[_0x27af('0x2c')](0x194);}return _0x2edd8c;};}function handleError(_0x63e548,_0x1aec55){_0x1aec55=_0x1aec55||0x1f4;return function(_0x20ed2f){logger[_0x27af('0x2d')](_0x20ed2f[_0x27af('0x2e')]);if(_0x20ed2f['name']){delete _0x20ed2f[_0x27af('0x2a')];}_0x63e548[_0x27af('0x18')](_0x1aec55)[_0x27af('0x2f')](_0x20ed2f);};}function getUserAttributes(){return _(db[_0x27af('0x30')][_0x27af('0x31')])[_0x27af('0x32')](function(_0x48e87a){return{'name':_0x48e87a[_0x27af('0x33')],'type':_0x48e87a[_0x27af('0x34')]['key']};})[_0x27af('0x25')](function(_0x34832c){return![_0x27af('0x35'),'salt',_0x27af('0x36'),_0x27af('0x37'),_0x27af('0x38'),'md5secret'][_0x27af('0x28')](_0x34832c[_0x27af('0x2a')]);})[_0x27af('0x27')]();}exports[_0x27af('0x39')]=function(_0xc6b8c2,_0x246887){var _0x3e0fae={},_0x2635d7={'count':0x0,'rows':[]};var _0x2f5f37=getUserAttributes();_0x3e0fae=qs['getOptions'](_0x2f5f37,_0xc6b8c2);var _0xeadf99={'where':_0x3e0fae[_0x27af('0x3a')]};return db[_0x27af('0x30')][_0x27af('0x17')](_0xeadf99)[_0x27af('0x1c')](function(_0x443558){_0x2635d7['count']=_0x443558;if(_0xc6b8c2[_0x27af('0x3b')][_0x27af('0x3c')]){_0x3e0fae[_0x27af('0x3d')]=[{'all':!![]}];}if(_0xc6b8c2['query'][_0x27af('0x3e')]===_0x27af('0x3f')){_0x3e0fae[_0x27af('0x3d')]=[{'model':db[_0x27af('0x40')],'as':_0x27af('0x3e')}];}if(!_['includes'](_0x3e0fae['attributes'],'id')){_0x3e0fae['attributes']['push']('id');}return db[_0x27af('0x30')]['findAll'](_0x3e0fae);})[_0x27af('0x1c')](function(_0x39ecc0){_0x2635d7[_0x27af('0x41')]=_0x39ecc0;if(_0xc6b8c2[_0x27af('0x3b')][_0x27af('0x42')]===_0x27af('0x3f')){var _0x479c74=[];for(var _0xcca075=0x0;_0xcca075<_0x2635d7['rows'][_0x27af('0x43')];_0xcca075++){_0x479c74['push'](get_open_tabs('chat',_0x2635d7[_0x27af('0x41')][_0xcca075][_0x27af('0x44')]));_0x479c74[_0x27af('0x45')](get_open_tabs(_0x27af('0x46'),_0x2635d7['rows'][_0xcca075][_0x27af('0x44')]));_0x479c74[_0x27af('0x45')](get_open_tabs(_0x27af('0x47'),_0x2635d7['rows'][_0xcca075][_0x27af('0x44')]));_0x479c74[_0x27af('0x45')](get_open_tabs(_0x27af('0x48'),_0x2635d7['rows'][_0xcca075]['dataValues']));_0x479c74[_0x27af('0x45')](get_open_tabs(_0x27af('0x49'),_0x2635d7['rows'][_0xcca075][_0x27af('0x44')]));_0x479c74[_0x27af('0x45')](get_open_tabs(_0x27af('0x4a'),_0x2635d7['rows'][_0xcca075][_0x27af('0x44')]));}return Promise[_0x27af('0x4b')](_0x479c74)['then'](function(){return _0x2635d7;});}else{return _0x2635d7;}})['then'](respondWithFilteredResult(_0x246887,_0x3e0fae))[_0x27af('0x4c')](handleError(_0x246887,null));};exports['show']=function(_0x4bd83a,_0x3aa701){var _0x83f36e=getUserAttributes();_0x4bd83a[_0x27af('0x3b')]['id']=_0x4bd83a[_0x27af('0x4d')]['id'];var _0x8ba03e=qs[_0x27af('0x4e')](_0x83f36e,_0x4bd83a);if(_0x4bd83a[_0x27af('0x3b')][_0x27af('0x3c')]){_0x8ba03e[_0x27af('0x3d')]=[{'all':!![]}];}if(_0x4bd83a[_0x27af('0x3b')][_0x27af('0x3e')]==='true'){_0x8ba03e[_0x27af('0x3d')]=[{'model':db[_0x27af('0x40')],'as':_0x27af('0x3e')}];}_0x8ba03e=_[_0x27af('0x4f')]({},_0x8ba03e,_0x4bd83a[_0x27af('0x50')]);if(!_[_0x27af('0x28')](_0x8ba03e['attributes'],'id')){_0x8ba03e[_0x27af('0x51')][_0x27af('0x45')]('id');}return db[_0x27af('0x30')][_0x27af('0x29')](_0x8ba03e)[_0x27af('0x1c')](handleEntityNotFound(_0x3aa701,null))[_0x27af('0x1c')](function(_0x3b9d4b){var _0x316f82=[];values=_0x3b9d4b;if(_0x4bd83a['query']['openTabs']==='true'){_0x316f82[_0x27af('0x45')](get_open_tabs('chat',_0x3b9d4b[_0x27af('0x44')]));_0x316f82['push'](get_open_tabs(_0x27af('0x46'),_0x3b9d4b['dataValues']));_0x316f82[_0x27af('0x45')](get_open_tabs(_0x27af('0x49'),_0x3b9d4b['dataValues']));_0x316f82['push'](get_open_tabs(_0x27af('0x4a'),_0x3b9d4b['dataValues']));_0x316f82['push'](get_open_tabs(_0x27af('0x47'),_0x3b9d4b[_0x27af('0x44')]));_0x316f82['push'](get_open_tabs(_0x27af('0x48'),_0x3b9d4b[_0x27af('0x44')]));return Promise[_0x27af('0x4b')](_0x316f82);}else{return values;}})[_0x27af('0x1c')](function(){return values;})['then'](respondWithResult(_0x3aa701,null))[_0x27af('0x4c')](handleError(_0x3aa701,null));};exports[_0x27af('0x1b')]=function(_0x179bcb,_0x3a11b3){if(_0x179bcb[_0x27af('0x52')]['id']){delete _0x179bcb[_0x27af('0x52')]['id'];}delete _0x179bcb[_0x27af('0x52')][_0x27af('0x1d')];return db[_0x27af('0x30')][_0x27af('0x29')]({'where':{'id':_0x179bcb[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x3a11b3,null))['then'](saveUpdates(_0x179bcb[_0x27af('0x52')],null))['then'](respondWithResult(_0x3a11b3,null))[_0x27af('0x4c')](handleError(_0x3a11b3,null));};exports['describe']=function(_0x5e15a4,_0x346f97){return db['User'][_0x27af('0x53')]()[_0x27af('0x1c')](respondWithResult(_0x346f97,null))[_0x27af('0x4c')](handleError(_0x346f97,null));};exports[_0x27af('0x54')]=function(_0x47005b,_0x2fe3a0){return db[_0x27af('0x30')][_0x27af('0x29')]({'where':{'id':_0x47005b[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x2fe3a0,null))[_0x27af('0x1c')](function(_0x158242){if(_0x158242){return _0x158242['addContacts'](_0x47005b['body'][_0x27af('0x55')],_['omit'](_0x47005b['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2fe3a0,null))['catch'](handleError(_0x2fe3a0,null));};function validateUser(_0x406b1a){return new Promise(function(_0x44d9c7,_0xb78b59){if(_0x406b1a[_0x27af('0x56')])return _0x44d9c7(_0x406b1a);return db['Setting'][_0x27af('0x57')](0x1)['then'](function(_0x59504c){if(_0x59504c[_0x27af('0x58')])authService['validatePasswordPattern'](_0x406b1a['password']);db['User'][_0x27af('0x59')](_0x27af('0x56'))[_0x27af('0x1c')](function(_0x21393f){if(_[_0x27af('0x5a')](_0x21393f)){_0x406b1a[_0x27af('0x56')]=_0x59504c['min_internal']||0x1;return;}if(_[_0x27af('0x5a')](_0x59504c[_0x27af('0x5b')])||_0x59504c['min_internal']===_0x21393f){_0x406b1a[_0x27af('0x56')]=_0x21393f+0x1;return;}if(_0x59504c[_0x27af('0x5b')]>_0x21393f){_0x406b1a[_0x27af('0x56')]=_0x59504c[_0x27af('0x5b')];return;}return db[_0x27af('0x5c')][_0x27af('0x3b')]('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[_0x27af('0x5c')][_0x27af('0x5d')][_0x27af('0x5e')]})[_0x27af('0x1c')](function(_0xcf8fa4){if(_0xcf8fa4&&_0xcf8fa4[_0x27af('0x43')]){for(var _0x430b19=0x0,_0xf83f5b=_0xcf8fa4[_0x27af('0x43')];_0x430b19<_0xf83f5b&&_['isNil'](_0x406b1a['internal']);_0x430b19++){if(_0x59504c['min_internal']<=_0xcf8fa4[_0x430b19][_0x27af('0x5f')]){_0x406b1a[_0x27af('0x56')]=_0xcf8fa4[_0x430b19][_0x27af('0x5f')];}else if(_0x59504c[_0x27af('0x5b')]>_0xcf8fa4[_0x430b19]['from']&&_0x59504c[_0x27af('0x5b')]<=_0xcf8fa4[_0x430b19]['to']){_0x406b1a[_0x27af('0x56')]=_0x59504c[_0x27af('0x5b')];}}}if(_[_0x27af('0x5a')](_0x406b1a[_0x27af('0x56')])){_0x406b1a['internal']=_0x21393f+0x1;}return _0x44d9c7(_0x406b1a);});});})[_0x27af('0x4c')](function(_0x3a6f08){_0xb78b59(_0x3a6f08);});});}function updateUser(_0x5d4b51){return new Promise(function(_0x1503b8,_0x2f635f){try{if(_0x5d4b51['voicemail']){_0x5d4b51[_0x27af('0x60')]=_0x5d4b51[_0x27af('0x56')];_0x5d4b51[_0x27af('0x61')]={'mailbox':_0x5d4b51[_0x27af('0x56')],'password':_0x5d4b51[_0x27af('0x35')],'fullname':_0x5d4b51[_0x27af('0x62')],'email':_0x5d4b51[_0x27af('0x63')]};}if(_0x5d4b51[_0x27af('0x1d')]===_0x27af('0x1e')){if(!_0x5d4b51['permissions'])_0x5d4b51[_0x27af('0x64')]=['101',_0x27af('0x65'),_0x27af('0x66'),_0x27af('0x67'),_0x27af('0x68'),_0x27af('0x69'),_0x27af('0x6a'),_0x27af('0x6b'),_0x27af('0x6c'),_0x27af('0x6d'),_0x27af('0x6e'),_0x27af('0x6f'),'111','114',_0x27af('0x70')];}_0x1503b8(_0x5d4b51);}catch(_0x2158a5){_0x2f635f(_0x2158a5);}});}exports['create']=function(_0x12bdbd,_0x2487a3){if(_0x12bdbd[_0x27af('0x21')][_0x27af('0x1d')]===_0x27af('0x1e'))throw new Error(_0x27af('0x71'));if(_0x12bdbd[_0x27af('0x52')]['role']==='user'&&_0x12bdbd['user'][_0x27af('0x1d')]!=='admin'){throw new Error(_0x27af('0x72'));}if(_0x12bdbd[_0x27af('0x52')]['role']===_0x27af('0x73')&&_0x12bdbd[_0x27af('0x21')]['role']!==_0x27af('0x73')){throw new Error(_0x27af('0x74'));}return licenseUtil['checkUserLimits']([_0x12bdbd[_0x27af('0x52')]])[_0x27af('0x1c')](function(){return validateUser(_0x12bdbd[_0x27af('0x52')]);})['then'](function(_0x2a3c7f){return updateUser(_0x2a3c7f)[_0x27af('0x1c')](function(_0xd2f56b){if(_0xd2f56b[_0x27af('0x1d')]==='admin'){_0xd2f56b[_0x27af('0x75')]=_0x12bdbd[_0x27af('0x21')][_0x27af('0x75')];delete _0xd2f56b[_0x27af('0x76')];}return _0xd2f56b;});})[_0x27af('0x1c')](function(_0x2b55c6){return db[_0x27af('0x30')][_0x27af('0x77')](_0x2b55c6,{'include':[{'model':db[_0x27af('0x61')],'as':_0x27af('0x61')}]});})[_0x27af('0x1c')](function(_0x279cd2){if(_0x12bdbd['body'][_0x27af('0x1d')]==='user')return _0x279cd2;if(_0x12bdbd['user'][_0x27af('0x1d')]!==_0x27af('0x21'))return _0x279cd2;return db[_0x27af('0x78')][_0x27af('0x29')]({'where':{'name':_0x279cd2[_0x27af('0x1d')]==='agent'?_0x27af('0x22'):_0x27af('0x23'),'userProfileId':_0x12bdbd[_0x27af('0x21')]['userProfileId']},'raw':!![]})[_0x27af('0x1c')](function(_0x553d03){if(!_0x553d03||_0x553d03[_0x27af('0x79')]!=0x0)return _0x279cd2;return db['UserProfileResource'][_0x27af('0x77')]({'name':_0x279cd2[_0x27af('0x2a')],'resourceId':_0x279cd2['id'],'type':_0x553d03['name'],'sectionId':_0x553d03['id']},{})[_0x27af('0x1c')](function(){return _0x279cd2;});})[_0x27af('0x4c')](function(_0x40edf0){logger['error'](_0x27af('0x7a'),_0x40edf0);throw _0x40edf0;});})[_0x27af('0x1c')](respondWithResult(_0x2487a3,0xc9))['catch'](handleError(_0x2487a3,null));};exports[_0x27af('0x7b')]=function(_0x518387,_0x5452a9){var _0x10f315=_0x518387[_0x27af('0x52')];var _0x3710ed=[];if(_0x518387[_0x27af('0x21')][_0x27af('0x1d')]==='agent')throw new Error(_0x27af('0x71'));if(_['some'](_0x10f315,['role',_0x27af('0x21')])&&_0x518387[_0x27af('0x21')][_0x27af('0x1d')]!=='admin'){throw new Error(_0x27af('0x72'));}if(_[_0x27af('0x7c')](_0x10f315,[_0x27af('0x1d'),_0x27af('0x73')])&&_0x518387[_0x27af('0x21')][_0x27af('0x1d')]!==_0x27af('0x73')){throw new Error(_0x27af('0x7d'));}return licenseUtil['checkUserLimits'](_0x10f315)['then'](function(){return validateUser(_0x10f315[0x0]);})[_0x27af('0x1c')](function(){for(var _0x4a6c35=0x1;_0x4a6c35<_0x10f315[_0x27af('0x43')];_0x4a6c35++){var _0x433260=_0x10f315[_0x4a6c35-0x1][_0x27af('0x56')];if(!_0x10f315[_0x4a6c35][_0x27af('0x56')])_0x10f315[_0x4a6c35][_0x27af('0x56')]=_0x433260+0x1;_0x3710ed['push'](validateUser(_0x10f315[_0x4a6c35]));}return Promise[_0x27af('0x4b')](_0x3710ed);})[_0x27af('0x1c')](function(){_0x3710ed=[];for(var _0x225f5f=0x0;_0x225f5f<_0x10f315[_0x27af('0x43')];_0x225f5f++){_0x3710ed[_0x27af('0x45')](updateUser(_0x10f315[_0x225f5f]));}return Promise['all'](_0x3710ed);})['then'](function(){_0x3710ed=_0x10f315[_0x27af('0x32')](function(_0x489ed0){return db['User'][_0x27af('0x77')](_0x489ed0,{'include':[{'model':db[_0x27af('0x61')],'as':_0x27af('0x61')}]})[_0x27af('0x1c')](function(_0x4e371f){_0x489ed0['id']=_0x4e371f['id'];return _0x489ed0;});});return Promise[_0x27af('0x4b')](_0x3710ed);})[_0x27af('0x1c')](function(_0x23c590){if(_0x518387[_0x27af('0x52')][_0x27af('0x1d')]===_0x27af('0x21'))return _0x23c590;if(_0x518387[_0x27af('0x21')][_0x27af('0x1d')]!=='user')return _0x23c590;var _0x50e49f=_[_0x27af('0x7c')](_0x23c590,function(_0x33ec35){return _0x33ec35[_0x27af('0x1d')]===_0x27af('0x1e')||_0x33ec35[_0x27af('0x1d')]===_0x27af('0x24');});if(!_0x50e49f)return _0x23c590;return db['UserProfileSection'][_0x27af('0x7e')]({'where':{'name':{'$or':['Agents',_0x27af('0x23')]},'userProfileId':_0x518387[_0x27af('0x21')][_0x27af('0x76')]},'raw':!![]})[_0x27af('0x1c')](function(_0x35a471){if(_['isEmpty'](_0x35a471)||!_['some'](_0x35a471,['autoAssociation',0x0]))return _0x23c590;_0x3710ed=[];var _0x151005=_(_0x35a471)['map'](function(_0x2f3b4e){if(_0x2f3b4e['autoAssociation']===0x1)return;return _0x2f3b4e[_0x27af('0x2a')]===_0x27af('0x22')?_0x27af('0x1e'):_0x27af('0x24');})['compact']()[_0x27af('0x27')]();for(var _0x2f6362=0x0;_0x2f6362<_0x23c590[_0x27af('0x43')];_0x2f6362++){if(!_[_0x27af('0x28')](_0x151005,_0x23c590[_0x2f6362][_0x27af('0x1d')]))return;var _0xd3301f=_0x23c590[_0x2f6362][_0x27af('0x1d')]===_0x27af('0x1e')?'Agents':'Telephones';_0x3710ed[_0x27af('0x45')](db[_0x27af('0x2b')]['create']({'name':_0x23c590[_0x2f6362][_0x27af('0x2a')],'resourceId':_0x23c590[_0x2f6362]['id'],'type':_0xd3301f,'sectionId':_[_0x27af('0x29')](_0x35a471,[_0x27af('0x2a'),_0xd3301f])['id']},{}));}return Promise[_0x27af('0x4b')](_0x3710ed);});})['then'](respondWithResult(_0x5452a9,0xc9))[_0x27af('0x4c')](handleError(_0x5452a9,null));};exports[_0x27af('0x7f')]=function(_0x318372,_0xda3344){if(_0x318372['body']['id']){delete _0x318372[_0x27af('0x52')]['id'];}return db['User'][_0x27af('0x29')]({'where':{'id':_0x318372[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](function(_0x57389a){if(!_0x57389a)return null;if(_0x57389a['id']===_0x318372['user']['id']){if(!_0x318372[_0x27af('0x52')][_0x27af('0x80')]||!_0x318372[_0x27af('0x52')]['newPassword']){throw new db[(_0x27af('0x81'))][(_0x27af('0x82'))](_0x27af('0x83'));}if(!_0x57389a[_0x27af('0x84')](_0x318372['body'][_0x27af('0x80')])){throw new db[(_0x27af('0x81'))][(_0x27af('0x82'))](_0x27af('0x85'));}if(_0x318372[_0x27af('0x52')][_0x27af('0x80')]===_0x318372[_0x27af('0x52')][_0x27af('0x86')]){throw new db[(_0x27af('0x81'))][(_0x27af('0x82'))](_0x27af('0x87'));}}else if(_0x318372[_0x27af('0x21')][_0x27af('0x1d')]===_0x27af('0x73')){if(!_0x318372[_0x27af('0x52')][_0x27af('0x86')]){throw new db[(_0x27af('0x81'))][(_0x27af('0x82'))](_0x27af('0x88'));}}else if(_0x318372['user'][_0x27af('0x1d')]===_0x27af('0x21')){if(!_0x318372[_0x27af('0x52')][_0x27af('0x86')]){throw new db[(_0x27af('0x81'))][(_0x27af('0x82'))](_0x27af('0x88'));}if(_0x57389a[_0x27af('0x1d')]!=='agent'){throw new db['Sequelize'][(_0x27af('0x82'))]('Unauthorized');}}else{throw new db[(_0x27af('0x81'))][(_0x27af('0x82'))]('Unauthorized');}return _0x57389a;})[_0x27af('0x1c')](handleEntityNotFound(_0xda3344,null))[_0x27af('0x1c')](function(_0xc9b9db){return db[_0x27af('0x89')]['findOne']({'attributes':['id',_0x27af('0x58'),_0x27af('0x8a'),_0x27af('0x8b')]})['then'](function(_0x3ed68b){if(_0x3ed68b[_0x27af('0x58')])authService[_0x27af('0x8c')](_0x318372[_0x27af('0x52')]['newPassword']);if(!_0x3ed68b[_0x27af('0x8a')]||!_0xc9b9db[_0x27af('0x36')])return _0xc9b9db;authService['validatePasswordHistory'](_0x318372['body'][_0x27af('0x86')],_0xc9b9db[_0x27af('0x36')],_0x3ed68b[_0x27af('0x8b')]);return _0xc9b9db;})['then'](saveUpdates({'password':_0x318372[_0x27af('0x52')][_0x27af('0x86')],'passwordResetAt':_0x318372[_0x27af('0x21')]['id']==_0x318372[_0x27af('0x4d')]['id']?moment():null,'previousPasswords':authService[_0x27af('0x8d')](_0x318372[_0x27af('0x52')][_0x27af('0x86')],_0xc9b9db[_0x27af('0x36')])},null));})[_0x27af('0x1c')](respondWithResult(_0xda3344,null))['catch'](handleError(_0xda3344,null));};exports[_0x27af('0x8e')]=function(_0x2ad0c4,_0x330a4a){var _0x471cc0=_0x2ad0c4['body'][_0x27af('0x8f')];return db[_0x27af('0x30')][_0x27af('0x29')]({'where':{'id':_0x2ad0c4['params']['id']},'attributes':['id','name',_0x27af('0x1d'),_0x27af('0x90'),_0x27af('0x91'),_0x27af('0x92'),'interface']})['then'](handleEntityNotFound(_0x330a4a,null))[_0x27af('0x1c')](function(_0x5f5d14){if(_0x5f5d14){if(!utils[_0x27af('0x93')](_0x471cc0)){throw new db[(_0x27af('0x81'))]['ValidationError'](_0x27af('0x94'));}return _0x5f5d14[_0x27af('0x95')+_[_0x27af('0x96')](_0x471cc0[_0x27af('0x97')]())+_0x27af('0x98')](_0x2ad0c4[_0x27af('0x52')][_0x27af('0x55')],{'penalty':_0x2ad0c4['body']['penalty']||0x0})['spread'](function(_0x234bb1){for(var _0x5280d7=0x0;_0x5280d7<_0x2ad0c4[_0x27af('0x52')]['ids']['length'];_0x5280d7+=0x1){var _0x202c24={'UserId':Number(_0x2ad0c4[_0x27af('0x4d')]['id'])};_0x202c24[_[_0x27af('0x96')](_0x471cc0[_0x27af('0x97')]())+_0x27af('0x99')]=Number(_0x2ad0c4[_0x27af('0x52')][_0x27af('0x55')][_0x5280d7]);socket[_0x27af('0x1f')](_0x27af('0x21')+_[_0x27af('0x96')](_0x471cc0[_0x27af('0x97')]())+_0x27af('0x9a'),_0x202c24);}return _0x234bb1;})[_0x27af('0x1c')](function(){if(_0x471cc0===_0x27af('0x9b')){return db['VoiceQueue']['findAll']({'where':{'id':_0x2ad0c4[_0x27af('0x52')][_0x27af('0x55')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x3d90cb){var _0x2aaa2d=_0x5f5d14[_0x27af('0x9c')]({'plain':!![]});var _0x35d5ff=[];if(_0x471cc0==='voice'&&_0x2aaa2d[_0x27af('0x1d')]===_0x27af('0x1e')&&_0x2aaa2d['online']){for(let _0x39bbc3=0x0;_0x39bbc3<_0x3d90cb[_0x27af('0x43')];_0x39bbc3+=0x1){_0x35d5ff[_0x27af('0x45')]({'membername':_0x2aaa2d[_0x27af('0x2a')],'UserId':_0x2aaa2d['id'],'queue_name':_0x3d90cb[_0x39bbc3][_0x27af('0x2a')],'VoiceQueueId':_0x3d90cb[_0x39bbc3]['id'],'interface':_['isNil'](_0x2aaa2d[_0x27af('0x9d')])?util[_0x27af('0x9e')](_0x27af('0x9f'),_0x2aaa2d[_0x27af('0x2a')]):_0x2aaa2d[_0x27af('0x9d')],'paused':_0x2aaa2d['voicePause']||![],'penalty':_0x2ad0c4[_0x27af('0x52')]['penalty']||0x0});}return Promise[_0x27af('0x4b')](_0x35d5ff[_0x27af('0x32')](function(_0x5336a1){return db[_0x27af('0xa0')][_0x27af('0xa1')](_0x5336a1);}));}return _0x5f5d14;});}})[_0x27af('0x1c')](respondWithStatusCode(_0x330a4a,null))['catch'](handleError(_0x330a4a,null));};exports['removeQueues']=function(_0x445e41,_0x20f82e){var _0x323875,_0x57ea79;return db['User'][_0x27af('0x29')]({'where':{'id':_0x445e41[_0x27af('0x4d')]['id']},'attributes':['id',_0x27af('0x2a'),_0x27af('0x1d')]})[_0x27af('0x1c')](handleEntityNotFound(_0x20f82e,null))[_0x27af('0x1c')](function(_0x50c754){if(_0x50c754){_0x323875=_0x50c754;if(!_0x445e41[_0x27af('0x3b')][_0x27af('0x8f')]||!utils[_0x27af('0x93')](_0x445e41[_0x27af('0x3b')][_0x27af('0x8f')])){throw new db[(_0x27af('0x81'))][(_0x27af('0x82'))](_0x27af('0x94'));}return _0x50c754['remove'+_[_0x27af('0x96')](_0x445e41[_0x27af('0x3b')][_0x27af('0x8f')][_0x27af('0x97')]())+_0x27af('0x98')](_0x445e41[_0x27af('0x3b')]['ids']);}})[_0x27af('0x1c')](function(_0x24c5c8){if(_[_0x27af('0xa2')](_0x445e41[_0x27af('0x3b')][_0x27af('0x55')])){for(var _0x5f1fe3=0x0;_0x5f1fe3<_0x445e41[_0x27af('0x3b')][_0x27af('0x55')][_0x27af('0x43')];_0x5f1fe3+=0x1){_0x57ea79={'UserId':Number(_0x445e41['params']['id'])};_0x57ea79[_[_0x27af('0x96')](_0x445e41['query'][_0x27af('0x8f')]['toLowerCase']())+'QueueId']=Number(_0x445e41[_0x27af('0x3b')]['ids'][_0x5f1fe3]);socket[_0x27af('0x1f')](_0x27af('0x21')+_['capitalize'](_0x445e41[_0x27af('0x3b')]['channel']['toLowerCase']())+'Queue:remove',_0x57ea79);}}else{_0x57ea79={'UserId':Number(_0x445e41[_0x27af('0x4d')]['id'])};_0x57ea79[_[_0x27af('0x96')](_0x445e41[_0x27af('0x3b')][_0x27af('0x8f')][_0x27af('0x97')]())+'QueueId']=Number(_0x445e41[_0x27af('0x3b')][_0x27af('0x55')]);socket[_0x27af('0x1f')](_0x27af('0x21')+_[_0x27af('0x96')](_0x445e41[_0x27af('0x3b')]['channel'][_0x27af('0x97')]())+_0x27af('0xa3'),_0x57ea79);}return _0x24c5c8;})[_0x27af('0x1c')](function(){if(_0x445e41[_0x27af('0x3b')][_0x27af('0x8f')]===_0x27af('0x9b')){return db['UserVoiceQueueRt'][_0x27af('0xa4')]({'where':{'UserId':_0x445e41['params']['id'],'VoiceQueueId':_0x445e41[_0x27af('0x3b')]['ids']},'individualHooks':!![]})[_0x27af('0x1c')](function(){return _0x323875;});}return _0x323875;})[_0x27af('0x1c')](respondWithStatusCode(_0x20f82e,null))[_0x27af('0x4c')](handleError(_0x20f82e,null));};exports[_0x27af('0xa5')]=function(_0x54aba1,_0x7aafca){_0x54aba1['body'][_0x27af('0xa6')]=_0x54aba1['file'][_0x27af('0xa7')];return db[_0x27af('0x30')][_0x27af('0x29')]({'where':{'id':_0x54aba1[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x7aafca,null))['then'](saveUpdates(_0x54aba1[_0x27af('0x52')],null))['then'](respondWithResult(_0x7aafca,null))[_0x27af('0x4c')](handleError(_0x7aafca,null));};exports[_0x27af('0xa8')]=function(_0x7bce27,_0x5a4df1){var _0x23cb77=path[_0x27af('0xa9')](config[_0x27af('0xaa')],_0x27af('0xab'));return db[_0x27af('0x30')]['find']({'where':{'id':_0x7bce27[_0x27af('0x4d')]['id']},'attributes':['id',_0x27af('0xa6')],'raw':!![]})[_0x27af('0x1c')](handleEntityNotFound(_0x5a4df1,null))[_0x27af('0x1c')](function(_0x3b5899){if(_0x3b5899){if(_[_0x27af('0x5a')](_0x3b5899['userpic'])){return _0x5a4df1[_0x27af('0xac')](_0x23cb77);}else{if(!fs[_0x27af('0xad')](path[_0x27af('0xa9')](config['root'],_0x27af('0xae'),_0x3b5899[_0x27af('0xa6')]))){return _0x5a4df1[_0x27af('0xac')](_0x23cb77);}return _0x5a4df1[_0x27af('0xac')](path['join'](config[_0x27af('0xaa')],_0x27af('0xae'),_0x3b5899[_0x27af('0xa6')]));}}})[_0x27af('0x4c')](handleError(_0x5a4df1,null));};exports[_0x27af('0xaf')]=function(_0x5bd53c,_0x273d5b){return db[_0x27af('0x30')][_0x27af('0x29')]({'where':{'id':_0x5bd53c[_0x27af('0x4d')]['id']},'attributes':['id']})[_0x27af('0x1c')](handleEntityNotFound(_0x273d5b,null))[_0x27af('0x1c')](function(_0x5a09da){var _0x2a76ae=[];values=_0x5a09da[_0x27af('0x44')];_0x2a76ae[_0x27af('0x45')](get_open_tabs(_0x27af('0xb0'),_0x5a09da[_0x27af('0x44')]));_0x2a76ae[_0x27af('0x45')](get_open_tabs(_0x27af('0x46'),_0x5a09da[_0x27af('0x44')]));_0x2a76ae[_0x27af('0x45')](get_open_tabs('openchannel',_0x5a09da[_0x27af('0x44')]));_0x2a76ae[_0x27af('0x45')](get_open_tabs('whatsapp',_0x5a09da[_0x27af('0x44')]));_0x2a76ae[_0x27af('0x45')](get_open_tabs(_0x27af('0x47'),_0x5a09da[_0x27af('0x44')]));_0x2a76ae[_0x27af('0x45')](get_open_tabs(_0x27af('0x48'),_0x5a09da[_0x27af('0x44')]));return Promise[_0x27af('0x4b')](_0x2a76ae);})[_0x27af('0x1c')](function(_0x16ac0d){if(_0x16ac0d){var _0x49bf07=_[_0x27af('0x32')](values[_0x27af('0xb1')],function(_0x2bfd86){return{'channel':_0x27af('0xb2'),'id':_0x2bfd86['id'],'createdAt':_0x2bfd86[_0x27af('0xb3')]};});var _0x3608b5=_[_0x27af('0x32')](values[_0x27af('0xb4')],function(_0x126011){return{'channel':'FAX','id':_0x126011['id'],'createdAt':_0x126011['createdAt']};});var _0x59992a=_[_0x27af('0x32')](values[_0x27af('0xb5')],function(_0x4d2992){return{'channel':_0x27af('0xb6'),'id':_0x4d2992['id'],'createdAt':_0x4d2992[_0x27af('0xb3')]};});var _0x90d9b8=_[_0x27af('0x32')](values[_0x27af('0xb7')],function(_0x15b84d){return{'channel':'MAIL','id':_0x15b84d['id'],'createdAt':_0x15b84d[_0x27af('0xb3')]};});var _0x2f8431=_['map'](values[_0x27af('0xb8')],function(_0x5913d0){return{'channel':_0x27af('0xb9'),'id':_0x5913d0['id'],'createdAt':_0x5913d0['createdAt']};});var _0x1aa0a3=_[_0x27af('0x32')](values['WhatsappOpenTabs'],function(_0x4a2d78){return{'channel':_0x27af('0xba'),'id':_0x4a2d78['id'],'createdAt':_0x4a2d78['createdAt']};});var _0x238242=_[_0x27af('0xbb')](_0x49bf07,_0x3608b5,_0x59992a,_0x90d9b8,_0x2f8431,_0x1aa0a3);var _0x3edfaf={'count':_0x238242[_0x27af('0x43')],'rows':_0x238242};return _0x3edfaf;}else return null;})[_0x27af('0x1c')](respondWithResult(_0x273d5b,null))['catch'](handleError(_0x273d5b,null));};exports[_0x27af('0xbc')]=function(_0x4f863b,_0xee66da){var _0x6020e9={};return db['User']['findOne']({'where':{'id':_0x4f863b[_0x27af('0x4d')]['id']}})['then'](function(_0x5b5680){if(!_0x5b5680){throw new APINotFoundError(util['format'](_0x27af('0xbd'),_0x4f863b['params']['id']));}return contacts['describe']();})[_0x27af('0x1c')](function(_0x10e306){_0x4f863b[_0x27af('0x3b')][_0x27af('0x30')]=_0x4f863b[_0x27af('0x4d')]['id'];_0x6020e9=qs[_0x27af('0x4e')](_0x10e306,_0x4f863b);if(_0x4f863b['query']['hasOwnProperty']('includeAll')){_0x6020e9[_0x27af('0x3d')]=[{'model':db['CmList'],'as':_0x27af('0xbe'),'required':![]},{'model':db[_0x27af('0xbf')],'as':'Tags','attributes':['id',_0x27af('0x2a'),'color'],'where':_0x4f863b[_0x27af('0x3b')][_0x27af('0xc0')]?{'id':_0x4f863b[_0x27af('0x3b')]['tag']}:undefined,'required':_0x4f863b[_0x27af('0x3b')]['tag']?!![]:![]}];}return contacts['findAll'](_0x4f863b[_0x27af('0x3b')],_0x4f863b[_0x27af('0x21')],_0x6020e9,_0x10e306);})['then'](respondWithFilteredResult(_0xee66da,_0x6020e9))['catch'](APIHandleError(_0xee66da));};exports['getQueues']=function(_0x4eb3f0,_0x48e36f){var _0x4afe6a;var _0x2dc192={};var _0x4e2d23;return db[_0x27af('0x30')]['findOne']({'where':{'id':_0x4eb3f0[_0x27af('0x4d')]['id']},'attributes':['id',_0x27af('0x2a'),'role']})[_0x27af('0x1c')](handleEntityNotFound(_0x48e36f,null))[_0x27af('0x1c')](function(_0x44fa68){if(!utils['isValidChannel'](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0x8f')])){throw new db[(_0x27af('0x81'))]['ValidationError'](_0x27af('0x94'));}_0x4afe6a=_0x44fa68;var _0x1de3f4={};_0x1de3f4[_0x27af('0xc1')]=_[_0x27af('0xc2')](db[_['capitalize'](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0x8f')])+'Queue'][_0x27af('0x31')]);_0x1de3f4['query']=_['keys'](_0x4eb3f0['query']);_0x1de3f4[_0x27af('0xc3')]=_[_0x27af('0xc4')](_0x1de3f4[_0x27af('0xc1')],_0x1de3f4[_0x27af('0x3b')]);_0x2dc192[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x1de3f4['model'],qs[_0x27af('0xc5')](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0xc5')]));_0x2dc192[_0x27af('0x51')]=_0x2dc192[_0x27af('0x51')]['length']?_0x2dc192[_0x27af('0x51')]:_0x1de3f4[_0x27af('0xc1')];_0x2dc192['order']=qs['sort'](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0xc6')]);_0x2dc192[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x4eb3f0[_0x27af('0x3b')],_0x1de3f4[_0x27af('0xc3')]));if(_0x4eb3f0[_0x27af('0x3b')]['filter']){_0x2dc192['where']=_[_0x27af('0x4f')](_0x2dc192[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x2dc192[_0x27af('0x51')],function(_0x12e456){var _0x2a1085={};_0x2a1085[_0x12e456]={'$like':'%'+_0x4eb3f0[_0x27af('0x3b')]['filter']+'%'};return _0x2a1085;})});}_0x2dc192=_[_0x27af('0x4f')]({},_0x2dc192,_0x4eb3f0[_0x27af('0x50')]);switch(_0x4afe6a[_0x27af('0x1d')]){case _0x27af('0x73'):return db[_[_0x27af('0x96')](_0x4eb3f0[_0x27af('0x3b')]['channel'])+_0x27af('0xc8')][_0x27af('0x7e')](_0x2dc192);case'user':case'agent':return _0x4afe6a[_0x27af('0x9c')+_[_0x27af('0x96')](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0x8f')])+_0x27af('0x98')](_0x2dc192);default:throw new db[(_0x27af('0x81'))]['ValidationError']('Unknown\x20role');}})[_0x27af('0x1c')](function(_0x18a13c){_0x4e2d23=_0x18a13c[_0x27af('0x43')];if(!_0x4eb3f0[_0x27af('0x3b')]['hasOwnProperty']('nolimit')){_0x2dc192[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0x15')]);_0x2dc192['offset']=qs[_0x27af('0x14')](_0x4eb3f0[_0x27af('0x3b')]['offset']);}switch(_0x4afe6a[_0x27af('0x1d')]){case _0x27af('0x73'):return db[_[_0x27af('0x96')](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0x8f')])+_0x27af('0xc8')][_0x27af('0x7e')](_0x2dc192);case _0x27af('0x21'):case _0x27af('0x1e'):return _0x4afe6a[_0x27af('0x9c')+_['capitalize'](_0x4eb3f0[_0x27af('0x3b')][_0x27af('0x8f')])+_0x27af('0x98')](_0x2dc192);}})['then'](function(_0x4e181a){return{'count':_0x4e2d23,'rows':_0x4e181a};})[_0x27af('0x1c')](respondWithResult(_0x48e36f,null))[_0x27af('0x4c')](handleError(_0x48e36f,null));};exports['getVoiceQueuesRt']=function(_0x31f5b2,_0x164cd0){var _0x24b857={};var _0x2b18f6={};var _0x4ed92d;var _0x3b7819;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x31f5b2[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x164cd0,null))[_0x27af('0x1c')](function(_0x215845){if(_0x215845){_0x4ed92d=_0x215845;_0x2b18f6[_0x27af('0xc1')]=_[_0x27af('0xc2')](db[_0x27af('0xa0')][_0x27af('0x31')]);_0x2b18f6['query']=_[_0x27af('0xc2')](_0x31f5b2['query']);_0x2b18f6[_0x27af('0xc3')]=_['intersection'](_0x2b18f6[_0x27af('0xc1')],_0x2b18f6['query']);_0x24b857['attributes']=_[_0x27af('0xc4')](_0x2b18f6[_0x27af('0xc1')],qs['fields'](_0x31f5b2[_0x27af('0x3b')][_0x27af('0xc5')]));_0x24b857[_0x27af('0x51')]=_0x24b857[_0x27af('0x51')]['length']?_0x24b857[_0x27af('0x51')]:_0x2b18f6[_0x27af('0xc1')];_0x24b857[_0x27af('0xca')]=qs['sort'](_0x31f5b2[_0x27af('0x3b')][_0x27af('0xc6')]);_0x24b857[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x31f5b2['query'],_0x2b18f6[_0x27af('0xc3')]));if(_0x31f5b2[_0x27af('0x3b')][_0x27af('0x25')]){_0x24b857['where']=_[_0x27af('0x4f')](_0x24b857['where'],{'$or':_[_0x27af('0x32')](_0x24b857[_0x27af('0x51')],function(_0x3f95db){var _0x49e42d={};_0x49e42d[_0x3f95db]={'$like':'%'+_0x31f5b2[_0x27af('0x3b')][_0x27af('0x25')]+'%'};return _0x49e42d;})});}_0x24b857=_[_0x27af('0x4f')]({},_0x24b857,_0x31f5b2[_0x27af('0x50')]);return _0x4ed92d[_0x27af('0xcb')](_0x24b857);}})['then'](function(_0x56f599){if(_0x56f599){_0x3b7819=_0x56f599[_0x27af('0x43')];if(!_0x31f5b2['query']['hasOwnProperty'](_0x27af('0xcc'))){_0x24b857[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x31f5b2['query'][_0x27af('0x15')]);_0x24b857[_0x27af('0x14')]=qs[_0x27af('0x14')](_0x31f5b2['query'][_0x27af('0x14')]);}return _0x4ed92d[_0x27af('0xcb')](_0x24b857);}})[_0x27af('0x1c')](function(_0x1aab24){if(_0x1aab24){return _0x1aab24?{'count':_0x3b7819,'rows':_0x1aab24}:null;}})[_0x27af('0x1c')](respondWithResult(_0x164cd0,null))[_0x27af('0x4c')](handleError(_0x164cd0,null));};exports[_0x27af('0xcd')]=function(_0x2d6cb7,_0x2a7fcb){var _0x10cb5b={};var _0x53b3f0={};var _0x3f3d19;var _0x2956c2;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x2d6cb7['params']['id']}})['then'](handleEntityNotFound(_0x2a7fcb,null))[_0x27af('0x1c')](function(_0x4c4e68){if(_0x4c4e68){_0x3f3d19=_0x4c4e68;_0x53b3f0[_0x27af('0xc1')]=_['keys'](db[_0x27af('0xce')][_0x27af('0x31')]);_0x53b3f0[_0x27af('0x3b')]=_[_0x27af('0xc2')](_0x2d6cb7[_0x27af('0x3b')]);_0x53b3f0[_0x27af('0xc3')]=_[_0x27af('0xc4')](_0x53b3f0[_0x27af('0xc1')],_0x53b3f0['query']);_0x10cb5b['attributes']=_['intersection'](_0x53b3f0[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x2d6cb7['query'][_0x27af('0xc5')]));_0x10cb5b[_0x27af('0x51')]=_0x10cb5b[_0x27af('0x51')]['length']?_0x10cb5b[_0x27af('0x51')]:_0x53b3f0[_0x27af('0xc1')];_0x10cb5b[_0x27af('0xca')]=qs[_0x27af('0xc6')](_0x2d6cb7[_0x27af('0x3b')][_0x27af('0xc6')]);_0x10cb5b[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x2d6cb7['query'],_0x53b3f0[_0x27af('0xc3')]));if(_0x2d6cb7[_0x27af('0x3b')][_0x27af('0x25')]){_0x10cb5b[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0x10cb5b[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x10cb5b['attributes'],function(_0x4aedfe){var _0x2f8654={};_0x2f8654[_0x4aedfe]={'$like':'%'+_0x2d6cb7[_0x27af('0x3b')][_0x27af('0x25')]+'%'};return _0x2f8654;})});}_0x10cb5b=_[_0x27af('0x4f')]({},_0x10cb5b,_0x2d6cb7['options']);return _0x3f3d19[_0x27af('0xcd')](_0x10cb5b);}})[_0x27af('0x1c')](function(_0x324e7d){if(_0x324e7d){_0x2956c2=_0x324e7d[_0x27af('0x43')];if(!_0x2d6cb7[_0x27af('0x3b')][_0x27af('0xcf')](_0x27af('0xcc'))){_0x10cb5b['limit']=qs[_0x27af('0x15')](_0x2d6cb7['query'][_0x27af('0x15')]);_0x10cb5b['offset']=qs['offset'](_0x2d6cb7['query'][_0x27af('0x14')]);}return _0x3f3d19[_0x27af('0xcd')](_0x10cb5b);}})[_0x27af('0x1c')](function(_0x266bb3){if(_0x266bb3){return _0x266bb3?{'count':_0x2956c2,'rows':_0x266bb3}:null;}})['then'](respondWithResult(_0x2a7fcb,null))[_0x27af('0x4c')](handleError(_0x2a7fcb,null));};exports[_0x27af('0xd0')]=function(_0x5d05cf,_0xecad1f){var _0xa87eb1={'raw':!![],'where':{}};var _0x3f1138={};var _0x5a3894={'count':0x0,'rows':[]};return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x5d05cf['params']['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0xecad1f,null))[_0x27af('0x1c')](function(_0xbc1b58){if(_0xbc1b58){_0x3f1138[_0x27af('0xc1')]=_[_0x27af('0xc2')](db['VoiceRecording'][_0x27af('0x31')]);_0x3f1138['query']=_[_0x27af('0xc2')](_0x5d05cf[_0x27af('0x3b')]);_0x3f1138[_0x27af('0xc3')]=_['intersection'](_0x3f1138['model'],_0x3f1138[_0x27af('0x3b')]);_0xa87eb1[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x3f1138['model'],qs[_0x27af('0xc5')](_0x5d05cf[_0x27af('0x3b')][_0x27af('0xc5')]));_0xa87eb1['attributes']=_0xa87eb1[_0x27af('0x51')][_0x27af('0x43')]?_0xa87eb1[_0x27af('0x51')]:_0x3f1138['model'];if(!_0x5d05cf[_0x27af('0x3b')][_0x27af('0xcf')](_0x27af('0xcc'))){_0xa87eb1[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x5d05cf[_0x27af('0x3b')][_0x27af('0x15')]);_0xa87eb1['offset']=qs[_0x27af('0x14')](_0x5d05cf[_0x27af('0x3b')]['offset']);}_0xa87eb1[_0x27af('0xca')]=qs[_0x27af('0xc6')](_0x5d05cf[_0x27af('0x3b')]['sort']);_0xa87eb1[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x5d05cf[_0x27af('0x3b')],_0x3f1138['filters']));_0xa87eb1[_0x27af('0x3a')][_0x27af('0xd1')]=_0xbc1b58['id'];if(_0x5d05cf[_0x27af('0x3b')][_0x27af('0x25')]){_0xa87eb1[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0xa87eb1['where'],{'$or':_[_0x27af('0x32')](_0xa87eb1['attributes'],function(_0x5e827d){var _0x44395c={};_0x44395c[_0x5e827d]={'$like':'%'+_0x5d05cf[_0x27af('0x3b')][_0x27af('0x25')]+'%'};return _0x44395c;})});}_0xa87eb1=_['merge']({},_0xa87eb1,_0x5d05cf[_0x27af('0x50')]);return db[_0x27af('0xd2')]['count']({'where':_0xa87eb1[_0x27af('0x3a')]})[_0x27af('0x1c')](function(_0x151b98){_0x5a3894['count']=_0x151b98;if(_0x5d05cf[_0x27af('0x3b')][_0x27af('0x3c')]){_0xa87eb1['include']=[{'all':!![]}];}return db[_0x27af('0xd2')]['findAll'](_0xa87eb1);})[_0x27af('0x1c')](function(_0x56e1d3){_0x5a3894[_0x27af('0x41')]=_0x56e1d3;return _0x5a3894;});}})[_0x27af('0x1c')](respondWithFilteredResult(_0xecad1f,_0xa87eb1))[_0x27af('0x4c')](handleError(_0xecad1f,null));};exports['getScreenRecordings']=function(_0x4cd662,_0x2421de){var _0x475d13={'raw':!![],'where':{}};var _0x4b6275={};var _0x21f6ec={'count':0x0,'rows':[]};return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x4cd662[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x2421de,null))['then'](function(_0x297acd){if(_0x297acd){_0x4b6275['model']=_[_0x27af('0xc2')](db[_0x27af('0xd3')]['rawAttributes']);_0x4b6275[_0x27af('0x3b')]=_[_0x27af('0xc2')](_0x4cd662[_0x27af('0x3b')]);_0x4b6275[_0x27af('0xc3')]=_[_0x27af('0xc4')](_0x4b6275['model'],_0x4b6275['query']);_0x475d13[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x4b6275[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x4cd662[_0x27af('0x3b')][_0x27af('0xc5')]));_0x475d13['attributes']=_0x475d13[_0x27af('0x51')]['length']?_0x475d13[_0x27af('0x51')]:_0x4b6275[_0x27af('0xc1')];if(!_0x4cd662[_0x27af('0x3b')]['hasOwnProperty']('nolimit')){_0x475d13[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x4cd662[_0x27af('0x3b')]['limit']);_0x475d13[_0x27af('0x14')]=qs['offset'](_0x4cd662[_0x27af('0x3b')][_0x27af('0x14')]);}_0x475d13[_0x27af('0xca')]=qs[_0x27af('0xc6')](_0x4cd662[_0x27af('0x3b')][_0x27af('0xc6')]);_0x475d13[_0x27af('0x3a')]=qs['filters'](_[_0x27af('0xc7')](_0x4cd662['query'],_0x4b6275[_0x27af('0xc3')]));_0x475d13[_0x27af('0x3a')][_0x27af('0xd1')]=_0x297acd['id'];if(_0x4cd662[_0x27af('0x3b')][_0x27af('0x25')]){_0x475d13['where']=_[_0x27af('0x4f')](_0x475d13['where'],{'$or':_['map'](_0x475d13[_0x27af('0x51')],function(_0x486ed5){var _0x5ede16={};_0x5ede16[_0x486ed5]={'$like':'%'+_0x4cd662[_0x27af('0x3b')]['filter']+'%'};return _0x5ede16;})});}_0x475d13=_[_0x27af('0x4f')]({},_0x475d13,_0x4cd662['options']);return db[_0x27af('0xd3')][_0x27af('0x17')]({'where':_0x475d13[_0x27af('0x3a')]})['then'](function(_0x230e98){_0x21f6ec[_0x27af('0x17')]=_0x230e98;if(_0x4cd662[_0x27af('0x3b')]['includeAll']){_0x475d13[_0x27af('0x3d')]=[{'all':!![]}];}return db[_0x27af('0xd3')][_0x27af('0x7e')](_0x475d13);})[_0x27af('0x1c')](function(_0x27c474){_0x21f6ec[_0x27af('0x41')]=_0x27c474;return _0x21f6ec;});}})['then'](respondWithFilteredResult(_0x2421de,_0x475d13))[_0x27af('0x4c')](handleError(_0x2421de,null));};exports[_0x27af('0xd4')]=function(_0x59f24c,_0x8d5703){var _0x4326ae={};var _0x1cb940={};var _0x50a88f;var _0x4355da;return db[_0x27af('0x30')]['findOne']({'where':{'id':_0x59f24c[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x8d5703,null))[_0x27af('0x1c')](function(_0x1cb5dc){if(_0x1cb5dc){_0x50a88f=_0x1cb5dc;_0x1cb940[_0x27af('0xc1')]=_[_0x27af('0xc2')](db[_0x27af('0xd5')][_0x27af('0x31')]);_0x1cb940['query']=_['keys'](_0x59f24c[_0x27af('0x3b')]);_0x1cb940[_0x27af('0xc3')]=_['intersection'](_0x1cb940[_0x27af('0xc1')],_0x1cb940['query']);_0x4326ae[_0x27af('0x51')]=_['intersection'](_0x1cb940[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x59f24c['query'][_0x27af('0xc5')]));_0x4326ae['attributes']=_0x4326ae[_0x27af('0x51')][_0x27af('0x43')]?_0x4326ae[_0x27af('0x51')]:_0x1cb940['model'];_0x4326ae[_0x27af('0xca')]=qs[_0x27af('0xc6')](_0x59f24c['query'][_0x27af('0xc6')]);_0x4326ae[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x59f24c['query'],_0x1cb940[_0x27af('0xc3')]));if(_0x59f24c[_0x27af('0x3b')][_0x27af('0x25')]){_0x4326ae['where']=_[_0x27af('0x4f')](_0x4326ae[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x4326ae[_0x27af('0x51')],function(_0x594a6f){var _0x18f55d={};_0x18f55d[_0x594a6f]={'$like':'%'+_0x59f24c['query'][_0x27af('0x25')]+'%'};return _0x18f55d;})});}_0x4326ae=_[_0x27af('0x4f')]({},_0x4326ae,_0x59f24c[_0x27af('0x50')]);return _0x50a88f[_0x27af('0xd4')](_0x4326ae);}})[_0x27af('0x1c')](function(_0x5aa851){if(_0x5aa851){_0x4355da=_0x5aa851[_0x27af('0x43')];if(!_0x59f24c['query']['hasOwnProperty'](_0x27af('0xcc'))){_0x4326ae[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x59f24c[_0x27af('0x3b')][_0x27af('0x15')]);_0x4326ae['offset']=qs[_0x27af('0x14')](_0x59f24c['query']['offset']);}return _0x50a88f[_0x27af('0xd4')](_0x4326ae);}})[_0x27af('0x1c')](function(_0x55baf0){if(_0x55baf0){return _0x55baf0?{'count':_0x4355da,'rows':_0x55baf0}:null;}})[_0x27af('0x1c')](respondWithResult(_0x8d5703,null))[_0x27af('0x4c')](handleError(_0x8d5703,null));};exports[_0x27af('0xd6')]=function(_0x25028f,_0x10a721){var _0x515a9e={};var _0x1a9e6f={};var _0x546e08;var _0x15b683;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x25028f[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x10a721,null))[_0x27af('0x1c')](function(_0x51838e){if(_0x51838e){_0x546e08=_0x51838e;_0x1a9e6f[_0x27af('0xc1')]=_[_0x27af('0xc2')](db[_0x27af('0xd7')][_0x27af('0x31')]);_0x1a9e6f[_0x27af('0x3b')]=_[_0x27af('0xc2')](_0x25028f['query']);_0x1a9e6f[_0x27af('0xc3')]=_['intersection'](_0x1a9e6f['model'],_0x1a9e6f[_0x27af('0x3b')]);_0x515a9e[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x1a9e6f[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x25028f['query'][_0x27af('0xc5')]));_0x515a9e[_0x27af('0x51')]=_0x515a9e[_0x27af('0x51')][_0x27af('0x43')]?_0x515a9e[_0x27af('0x51')]:_0x1a9e6f['model'];_0x515a9e[_0x27af('0xca')]=qs['sort'](_0x25028f[_0x27af('0x3b')][_0x27af('0xc6')]);_0x515a9e[_0x27af('0x3a')]=qs['filters'](_[_0x27af('0xc7')](_0x25028f[_0x27af('0x3b')],_0x1a9e6f[_0x27af('0xc3')]));if(_0x25028f[_0x27af('0x3b')][_0x27af('0x25')]){_0x515a9e[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0x515a9e[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x515a9e['attributes'],function(_0x375ecf){var _0x5f48f0={};_0x5f48f0[_0x375ecf]={'$like':'%'+_0x25028f[_0x27af('0x3b')][_0x27af('0x25')]+'%'};return _0x5f48f0;})});}_0x515a9e=_[_0x27af('0x4f')]({},_0x515a9e,_0x25028f[_0x27af('0x50')]);return _0x546e08[_0x27af('0xd6')](_0x515a9e);}})['then'](function(_0x152e9c){if(_0x152e9c){_0x15b683=_0x152e9c[_0x27af('0x43')];if(!_0x25028f[_0x27af('0x3b')]['hasOwnProperty']('nolimit')){_0x515a9e['limit']=qs[_0x27af('0x15')](_0x25028f[_0x27af('0x3b')][_0x27af('0x15')]);_0x515a9e['offset']=qs[_0x27af('0x14')](_0x25028f[_0x27af('0x3b')][_0x27af('0x14')]);}return _0x546e08['getOpenchannelInteractions'](_0x515a9e);}})[_0x27af('0x1c')](function(_0x4414a8){if(_0x4414a8){return _0x4414a8?{'count':_0x15b683,'rows':_0x4414a8}:null;}})[_0x27af('0x1c')](respondWithResult(_0x10a721,null))[_0x27af('0x4c')](handleError(_0x10a721,null));};exports['getMailInteractions']=function(_0x1b21db,_0x5c229e){var _0x2c5953={'raw':!![],'where':{}};var _0x51bba4={};var _0x2a0aec={'count':0x0,'rows':[]};return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x1b21db[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x5c229e,null))['then'](function(_0x253bc4){if(_0x253bc4){_0x51bba4[_0x27af('0xc1')]=_['keys'](db['MailInteraction'][_0x27af('0x31')]);_0x51bba4[_0x27af('0x3b')]=_[_0x27af('0xc2')](_0x1b21db['query']);_0x51bba4[_0x27af('0xc3')]=_['intersection'](_0x51bba4[_0x27af('0xc1')],_0x51bba4['query']);_0x2c5953[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x51bba4[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x1b21db[_0x27af('0x3b')]['fields']));_0x2c5953[_0x27af('0x51')]=_0x2c5953[_0x27af('0x51')][_0x27af('0x43')]?_0x2c5953[_0x27af('0x51')]:_0x51bba4[_0x27af('0xc1')];if(!_0x1b21db['query'][_0x27af('0xcf')]('nolimit')){_0x2c5953[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x1b21db[_0x27af('0x3b')][_0x27af('0x15')]);_0x2c5953[_0x27af('0x14')]=qs['offset'](_0x1b21db['query'][_0x27af('0x14')]);}_0x2c5953[_0x27af('0xca')]=qs[_0x27af('0xc6')](_0x1b21db['query'][_0x27af('0xc6')]);_0x2c5953[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x1b21db[_0x27af('0x3b')],_0x51bba4[_0x27af('0xc3')]));_0x2c5953[_0x27af('0x3a')][_0x27af('0xd1')]=_0x253bc4['id'];if(_0x1b21db[_0x27af('0x3b')][_0x27af('0x25')]){_0x2c5953['where']=_[_0x27af('0x4f')](_0x2c5953[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x2c5953['attributes'],function(_0x332964){var _0x2c73af={};_0x2c73af[_0x332964]={'$like':'%'+_0x1b21db['query'][_0x27af('0x25')]+'%'};return _0x2c73af;})});}_0x2c5953=_['merge']({},_0x2c5953,_0x1b21db[_0x27af('0x50')]);return db[_0x27af('0xd8')][_0x27af('0x17')]({'where':_0x2c5953['where']})[_0x27af('0x1c')](function(_0x4cb678){_0x2a0aec['count']=_0x4cb678;if(_0x1b21db[_0x27af('0x3b')][_0x27af('0x3c')]){_0x2c5953[_0x27af('0x3d')]=[{'all':!![]}];}return db[_0x27af('0xd8')][_0x27af('0x7e')](_0x2c5953);})[_0x27af('0x1c')](function(_0x4e7586){_0x2a0aec[_0x27af('0x41')]=_0x4e7586;return _0x2a0aec;});}})[_0x27af('0x1c')](respondWithFilteredResult(_0x5c229e,_0x2c5953))[_0x27af('0x4c')](handleError(_0x5c229e,null));};exports['getSmsInteractions']=function(_0x2cf807,_0x58b4a8){var _0x361ef9={};var _0x286e50={};var _0x2ec080;var _0x5ad493;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x2cf807['params']['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x58b4a8,null))[_0x27af('0x1c')](function(_0x1acb55){if(_0x1acb55){_0x2ec080=_0x1acb55;_0x286e50['model']=_[_0x27af('0xc2')](db[_0x27af('0xd9')][_0x27af('0x31')]);_0x286e50['query']=_[_0x27af('0xc2')](_0x2cf807[_0x27af('0x3b')]);_0x286e50[_0x27af('0xc3')]=_[_0x27af('0xc4')](_0x286e50[_0x27af('0xc1')],_0x286e50[_0x27af('0x3b')]);_0x361ef9[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x286e50[_0x27af('0xc1')],qs['fields'](_0x2cf807[_0x27af('0x3b')][_0x27af('0xc5')]));_0x361ef9[_0x27af('0x51')]=_0x361ef9['attributes'][_0x27af('0x43')]?_0x361ef9[_0x27af('0x51')]:_0x286e50[_0x27af('0xc1')];_0x361ef9[_0x27af('0xca')]=qs[_0x27af('0xc6')](_0x2cf807['query'][_0x27af('0xc6')]);_0x361ef9[_0x27af('0x3a')]=qs['filters'](_[_0x27af('0xc7')](_0x2cf807[_0x27af('0x3b')],_0x286e50['filters']));if(_0x2cf807['query'][_0x27af('0x25')]){_0x361ef9[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0x361ef9[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x361ef9['attributes'],function(_0x55ae60){var _0x29b42a={};_0x29b42a[_0x55ae60]={'$like':'%'+_0x2cf807[_0x27af('0x3b')][_0x27af('0x25')]+'%'};return _0x29b42a;})});}_0x361ef9=_[_0x27af('0x4f')]({},_0x361ef9,_0x2cf807[_0x27af('0x50')]);return _0x2ec080[_0x27af('0xda')](_0x361ef9);}})[_0x27af('0x1c')](function(_0x3116ac){if(_0x3116ac){_0x5ad493=_0x3116ac[_0x27af('0x43')];if(!_0x2cf807[_0x27af('0x3b')][_0x27af('0xcf')]('nolimit')){_0x361ef9[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x2cf807[_0x27af('0x3b')][_0x27af('0x15')]);_0x361ef9[_0x27af('0x14')]=qs[_0x27af('0x14')](_0x2cf807[_0x27af('0x3b')][_0x27af('0x14')]);}return _0x2ec080['getSmsInteractions'](_0x361ef9);}})['then'](function(_0x2a0250){if(_0x2a0250){return _0x2a0250?{'count':_0x5ad493,'rows':_0x2a0250}:null;}})[_0x27af('0x1c')](respondWithResult(_0x58b4a8,null))['catch'](handleError(_0x58b4a8,null));};exports['getFaxInteractions']=function(_0xb3ce93,_0x25dc94){var _0x1dca16={};var _0x37ff28={};var _0x3a5caa;var _0x4defee;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0xb3ce93['params']['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x25dc94,null))[_0x27af('0x1c')](function(_0x527503){if(_0x527503){_0x3a5caa=_0x527503;_0x37ff28[_0x27af('0xc1')]=_[_0x27af('0xc2')](db[_0x27af('0xdb')][_0x27af('0x31')]);_0x37ff28[_0x27af('0x3b')]=_[_0x27af('0xc2')](_0xb3ce93[_0x27af('0x3b')]);_0x37ff28['filters']=_['intersection'](_0x37ff28[_0x27af('0xc1')],_0x37ff28[_0x27af('0x3b')]);_0x1dca16[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x37ff28[_0x27af('0xc1')],qs['fields'](_0xb3ce93[_0x27af('0x3b')]['fields']));_0x1dca16[_0x27af('0x51')]=_0x1dca16[_0x27af('0x51')]['length']?_0x1dca16[_0x27af('0x51')]:_0x37ff28['model'];_0x1dca16['order']=qs[_0x27af('0xc6')](_0xb3ce93[_0x27af('0x3b')][_0x27af('0xc6')]);_0x1dca16[_0x27af('0x3a')]=qs['filters'](_['pick'](_0xb3ce93[_0x27af('0x3b')],_0x37ff28['filters']));if(_0xb3ce93[_0x27af('0x3b')]['filter']){_0x1dca16[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0x1dca16[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x1dca16['attributes'],function(_0x1ff4b6){var _0x3598f9={};_0x3598f9[_0x1ff4b6]={'$like':'%'+_0xb3ce93['query']['filter']+'%'};return _0x3598f9;})});}_0x1dca16=_[_0x27af('0x4f')]({},_0x1dca16,_0xb3ce93[_0x27af('0x50')]);return _0x3a5caa[_0x27af('0xdc')](_0x1dca16);}})[_0x27af('0x1c')](function(_0x580c5e){if(_0x580c5e){_0x4defee=_0x580c5e[_0x27af('0x43')];if(!_0xb3ce93['query'][_0x27af('0xcf')](_0x27af('0xcc'))){_0x1dca16['limit']=qs[_0x27af('0x15')](_0xb3ce93[_0x27af('0x3b')]['limit']);_0x1dca16[_0x27af('0x14')]=qs[_0x27af('0x14')](_0xb3ce93[_0x27af('0x3b')][_0x27af('0x14')]);}return _0x3a5caa[_0x27af('0xdc')](_0x1dca16);}})[_0x27af('0x1c')](function(_0x2b887d){if(_0x2b887d){return _0x2b887d?{'count':_0x4defee,'rows':_0x2b887d}:null;}})[_0x27af('0x1c')](respondWithResult(_0x25dc94,null))['catch'](handleError(_0x25dc94,null));};exports[_0x27af('0xdd')]=function(_0x2e57e1,_0x1761d0){var _0x19bd13={};var _0xb341dd={};var _0xf1a93c;var _0x1a86aa;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x2e57e1[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x1761d0,null))[_0x27af('0x1c')](function(_0x3b5d89){if(_0x3b5d89){_0xf1a93c=_0x3b5d89;_0xb341dd['model']=_[_0x27af('0xc2')](db[_0x27af('0xde')][_0x27af('0x31')]);_0xb341dd[_0x27af('0x3b')]=_[_0x27af('0xc2')](_0x2e57e1[_0x27af('0x3b')]);_0xb341dd[_0x27af('0xc3')]=_['intersection'](_0xb341dd[_0x27af('0xc1')],_0xb341dd[_0x27af('0x3b')]);_0x19bd13[_0x27af('0x51')]=_[_0x27af('0xc4')](_0xb341dd['model'],qs[_0x27af('0xc5')](_0x2e57e1['query']['fields']));_0x19bd13[_0x27af('0x51')]=_0x19bd13[_0x27af('0x51')][_0x27af('0x43')]?_0x19bd13['attributes']:_0xb341dd[_0x27af('0xc1')];_0x19bd13[_0x27af('0xca')]=qs['sort'](_0x2e57e1[_0x27af('0x3b')][_0x27af('0xc6')]);_0x19bd13[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x2e57e1[_0x27af('0x3b')],_0xb341dd[_0x27af('0xc3')]));if(_0x2e57e1[_0x27af('0x3b')][_0x27af('0x25')]){_0x19bd13[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0x19bd13[_0x27af('0x3a')],{'$or':_['map'](_0x19bd13[_0x27af('0x51')],function(_0xfe905c){var _0x5360bf={};_0x5360bf[_0xfe905c]={'$like':'%'+_0x2e57e1[_0x27af('0x3b')]['filter']+'%'};return _0x5360bf;})});}_0x19bd13=_['merge']({},_0x19bd13,_0x2e57e1[_0x27af('0x50')]);return _0xf1a93c[_0x27af('0xdd')](_0x19bd13);}})[_0x27af('0x1c')](function(_0x1a28d7){if(_0x1a28d7){_0x1a86aa=_0x1a28d7[_0x27af('0x43')];if(!_0x2e57e1[_0x27af('0x3b')][_0x27af('0xcf')](_0x27af('0xcc'))){_0x19bd13[_0x27af('0x15')]=qs[_0x27af('0x15')](_0x2e57e1[_0x27af('0x3b')][_0x27af('0x15')]);_0x19bd13[_0x27af('0x14')]=qs['offset'](_0x2e57e1[_0x27af('0x3b')][_0x27af('0x14')]);}return _0xf1a93c['getWhatsappInteractions'](_0x19bd13);}})[_0x27af('0x1c')](function(_0x450ec0){if(_0x450ec0){return _0x450ec0?{'count':_0x1a86aa,'rows':_0x450ec0}:null;}})[_0x27af('0x1c')](respondWithResult(_0x1761d0,null))['catch'](handleError(_0x1761d0,null));};exports[_0x27af('0xdf')]=function(_0x294eb3,_0xa21807,_0x4d5f8b){var _0x3e847e;var _0x140aef;var _0x2751a9;var _0x313daf=!_[_0x27af('0x5a')](_0x294eb3[_0x27af('0x4d')]['id'])?_0x294eb3['params']['id']:!_[_0x27af('0x5a')](_0x294eb3[_0x27af('0x21')]['id'])?_0x294eb3[_0x27af('0x21')]['id']:null;return db['User'][_0x27af('0x29')]({'where':{'id':_0x313daf,'role':{'$or':[_0x27af('0x73'),_0x27af('0x21'),_0x27af('0x1e')]}},'attributes':['id',_0x27af('0x2a'),_0x27af('0xe0'),'mobile',_0x27af('0x1d'),_0x27af('0x56'),'loginInPause']})[_0x27af('0x1c')](function(_0x4bdf93){if(_0x4bdf93){if(_0x4bdf93[_0x27af('0x1d')]===_0x27af('0x1e')){_0x3e847e=_0x4bdf93;if(_0x294eb3[_0x27af('0x52')][_0x27af('0x9d')]){_0x2751a9=util[_0x27af('0x9e')](_0x27af('0xe1'),_0x3e847e[_0x294eb3['body'][_0x27af('0x9d')]]);}else if(_0x294eb3[_0x27af('0x52')]['intrf']){_0x2751a9=util[_0x27af('0x9e')](_0x27af('0x9f'),_0x294eb3[_0x27af('0x52')][_0x27af('0xe2')]);}else{_0x2751a9=util[_0x27af('0x9e')](_0x27af('0x9f'),_0x3e847e[_0x27af('0x2a')]);}socket['to'](util[_0x27af('0x9e')]('user:%s',_0x3e847e[_0x27af('0x2a')]))[_0x27af('0x1f')]('user:forcelogout',{'user':{'id':_0x3e847e['id'],'name':_0x3e847e[_0x27af('0x2a')]},'ip':_0x294eb3[_0x27af('0xe3')][_0x27af('0xe4')]||_0x294eb3[_0x27af('0xe5')][_0x27af('0xe6')]||_0x294eb3[_0x27af('0xe7')][_0x27af('0xe6')]||_0x294eb3[_0x27af('0xe5')][_0x27af('0xe7')][_0x27af('0xe6')]});return db[_0x27af('0xa0')][_0x27af('0xa4')]({'where':{'membername':_0x3e847e[_0x27af('0x2a')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x27af('0x82'))](_0x27af('0xe8'));}})['then'](function(){if(_0x3e847e){return _0x3e847e[_0x27af('0xe9')]({'raw':!![]});}})[_0x27af('0x1c')](function(_0x520453){if(_0x3e847e){if(_0x520453){_0x140aef=_0x520453;if(_0x140aef[_0x27af('0x43')]){var _0xd98f81=_0x140aef['map'](function(_0x36d3ba){var _0x211e72={'membername':_0x3e847e[_0x27af('0x2a')],'UserId':_0x3e847e['id'],'queue_name':_0x36d3ba['name'],'VoiceQueueId':_0x36d3ba['id'],'interface':_0x2751a9,'paused':_0x3e847e[_0x27af('0x91')]||![],'penalty':_0x36d3ba[_0x27af('0xea')]||0x0};return db[_0x27af('0xa0')]['upsert'](_0x211e72);});return Promise[_0x27af('0x4b')](_0xd98f81);}}}})[_0x27af('0x1c')](function(){if(_0x3e847e){return db['MemberReport']['findAll']({'where':{'membername':_0x3e847e[_0x27af('0x2a')],'exitAt':null}});}})[_0x27af('0x1c')](function(_0x1a6c89){if(_0x3e847e){var _0x502b8c=[];_0x1a6c89[_0x27af('0xeb')](function(_0x327f07){_0x502b8c['push'](_0x327f07['update']({'exitAt':moment()[_0x27af('0x9e')](_0x27af('0xec'))}));});return Promise[_0x27af('0x4b')](_0x502b8c);}})[_0x27af('0x1c')](function(){if(_0x3e847e){var _0x5b7309=[];var _0x3050ab=[];var _0x32736b=utils['getChannels']();var _0x1b5c8b={'membername':_0x3e847e[_0x27af('0x2a')],'interface':_0x2751a9,'enterAt':moment()[_0x27af('0x9e')](_0x27af('0xec')),'role':_0x3e847e[_0x27af('0x1d')],'internal':_0x3e847e[_0x27af('0x56')]};_0x32736b[_0x27af('0xeb')](function(_0x32276f){_0x5b7309['push'](_[_0x27af('0x4f')]({'channel':_0x32276f,'type':_0x27af('0xed'),'data1':_0x294eb3[_0x27af('0x52')][_0x27af('0xee')],'data2':_0x2751a9},_0x1b5c8b));if(_0x3e847e[_0x27af('0x91')]){_0x3050ab[_0x27af('0x45')](_[_0x27af('0x4f')]({'channel':_0x32276f,'type':_0x27af('0xef'),'data1':'LOGININPAUSE'},_0x1b5c8b));}});return db[_0x27af('0xf0')][_0x27af('0x7b')](_0x5b7309[_0x27af('0xbb')](_0x3050ab),{'individualHooks':!![]});}})[_0x27af('0x1c')](function(){if(_0x3e847e){return _0x3e847e[_0x27af('0x1b')]({'online':!![],'lastLoginAt':moment()['format'](_0x27af('0xec')),'voicePause':_0x3e847e[_0x27af('0x91')]||![],'mailPause':_0x3e847e[_0x27af('0x91')]||![],'chatPause':_0x3e847e['loginInPause']||![],'faxPause':_0x3e847e[_0x27af('0x91')]||![],'smsPause':_0x3e847e[_0x27af('0x91')]||![],'openchannelPause':_0x3e847e[_0x27af('0x91')]||![],'whatsappPause':_0x3e847e[_0x27af('0x91')]||![],'pauseType':_0x3e847e['loginInPause']?_0x27af('0xf1'):null,'interface':_0x2751a9,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x27af('0x1c')](function(_0xff5093){if(_0x294eb3['isMiddleware']){return _0x4d5f8b();}else{return Promise[_0x27af('0xf2')](_0xff5093)['then'](respondWithResult(_0xa21807,null));}})['catch'](handleError(_0xa21807,null));};exports[_0x27af('0xf3')]=function(_0x249c58,_0x217aae){var _0x42670f;return db[_0x27af('0x30')][_0x27af('0x29')]({'where':{'id':_0x249c58[_0x27af('0x4d')]['id'],'role':'agent'},'attributes':['id','name',_0x27af('0x1d')]})[_0x27af('0x1c')](handleEntityNotFound(_0x217aae,null))[_0x27af('0x1c')](function(_0x1d3eed){if(_0x1d3eed){_0x42670f=_0x1d3eed;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x42670f[_0x27af('0x2a')]},'individualHooks':!![]});}})['then'](function(){return db[_0x27af('0xf0')]['findAll']({'where':{'membername':_0x42670f[_0x27af('0x2a')],'exitAt':null}});})['then'](function(_0x2058ad){var _0x398e0e=[];_0x2058ad['forEach'](function(_0x36e948){_0x398e0e[_0x27af('0x45')](_0x36e948[_0x27af('0x1b')]({'exitAt':moment()[_0x27af('0x9e')](_0x27af('0xec'))}));});return Promise[_0x27af('0x4b')](_0x398e0e);})[_0x27af('0x1c')](function(){return _0x42670f['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x27af('0x1c')](respondWithResult(_0x217aae,null))[_0x27af('0x4c')](handleError(_0x217aae,null));};exports['pause']=function(_0x431eca,_0x1b325f){var _0x1067b2;return db[_0x27af('0xa0')][_0x27af('0x1b')]({'paused':0x1},{'where':{'UserId':_0x431eca['params']['id']},'individualHooks':!![]})[_0x27af('0x1c')](function(){return db['User']['find']({'where':{'id':_0x431eca[_0x27af('0x4d')]['id'],'role':_0x27af('0x1e')},'attributes':['id','name','role','internal',_0x27af('0x9d'),'online']});})[_0x27af('0x1c')](handleEntityNotFound(_0x1b325f,null))[_0x27af('0x1c')](function(_0x5645da){if(_0x5645da){_0x1067b2=_0x5645da;return db['MemberReport'][_0x27af('0x7e')]({'where':{'membername':_0x1067b2['name'],'type':_0x27af('0xef'),'exitAt':null}});}})['then'](function(_0x517dd2){if(_0x517dd2['length']){var _0x5e147c=moment()[_0x27af('0x9e')](_0x27af('0xec'));for(var _0x46aa17=0x0,_0x1ba73d=_0x517dd2[_0x27af('0x43')];_0x46aa17<_0x1ba73d;_0x46aa17++){_0x517dd2[_0x46aa17][_0x27af('0xf4')]({'exitAt':_0x5e147c});}}})[_0x27af('0x1c')](function(){var _0x18ca89=[];var _0x247a8f=utils[_0x27af('0xf5')]();_0x247a8f[_0x27af('0xeb')](function(_0x12d4de){_0x18ca89[_0x27af('0x45')]({'channel':_0x12d4de,'membername':_0x1067b2[_0x27af('0x2a')],'interface':_[_0x27af('0x5a')](_0x1067b2[_0x27af('0x9d')])?util['format']('SIP/%s',_0x1067b2[_0x27af('0x2a')]):_0x1067b2['interface'],'type':_0x27af('0xef'),'enterAt':moment()[_0x27af('0x9e')](_0x27af('0xec')),'data1':_0x431eca[_0x27af('0x52')]['type']||_0x27af('0xf6'),'role':_0x1067b2[_0x27af('0x1d')],'internal':_0x1067b2[_0x27af('0x56')]});});return db[_0x27af('0xf0')][_0x27af('0x7b')](_0x18ca89,{'individualHooks':!![]});})[_0x27af('0x1c')](function(){return _0x1067b2['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x431eca['body']['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x27af('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x27af('0x1c')](respondWithResult(_0x1b325f,null))['catch'](handleError(_0x1b325f,null));};exports[_0x27af('0xf7')]=function(_0x474bab,_0x3dbb4a){if(_0x474bab[_0x27af('0x52')]['channel']&&!utils[_0x27af('0x93')](_0x474bab[_0x27af('0x52')][_0x27af('0x8f')])){throw new APIBadRequestError(util['format'](_0x27af('0xf8'),_0x474bab[_0x27af('0x52')][_0x27af('0x8f')]));}return db[_0x27af('0x30')][_0x27af('0x29')]({'where':{'id':_0x474bab['params']['id']},'attributes':['id',_0x27af('0x2a'),_0x27af('0x1d'),_0x27af('0x56'),_0x27af('0x9d'),_0x27af('0x90'),'voicePause',_0x27af('0xf9'),'chatPause',_0x27af('0xfa'),_0x27af('0xfb'),_0x27af('0xfc'),_0x27af('0xfd'),_0x27af('0xfe'),_0x27af('0xff')]})['then'](function(_0x7a801){if(!_0x7a801){throw new APINotFoundError(util['format']('User\x20with\x20id\x20%s\x20not\x20found',_0x474bab[_0x27af('0x4d')]['id']));}return _0x7a801['unpause'](_0x474bab['body'][_0x27af('0x8f')]);})[_0x27af('0x1c')](respondWithResult(_0x3dbb4a,null))['catch'](APIHandleError(_0x3dbb4a));};exports[_0x27af('0x100')]=function(_0x2f40f1,_0x34baa5){var _0x1d081b={};var _0x19547e={};var _0x2ee598;var _0xc64328;return db['User'][_0x27af('0xc9')]({'where':{'id':_0x2f40f1[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x34baa5,null))[_0x27af('0x1c')](function(_0x2630dd){if(_0x2630dd){_0x2ee598=_0x2630dd;_0x19547e[_0x27af('0xc1')]=_['keys'](db['Team'][_0x27af('0x31')]);_0x19547e['query']=_[_0x27af('0xc2')](_0x2f40f1[_0x27af('0x3b')]);_0x19547e[_0x27af('0xc3')]=_['intersection'](_0x19547e['model'],_0x19547e[_0x27af('0x3b')]);_0x1d081b['attributes']=_['intersection'](_0x19547e[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x2f40f1['query']['fields']));_0x1d081b[_0x27af('0x51')]=_0x1d081b[_0x27af('0x51')][_0x27af('0x43')]?_0x1d081b[_0x27af('0x51')]:_0x19547e[_0x27af('0xc1')];_0x1d081b[_0x27af('0xca')]=qs['sort'](_0x2f40f1[_0x27af('0x3b')][_0x27af('0xc6')]);_0x1d081b[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_['pick'](_0x2f40f1[_0x27af('0x3b')],_0x19547e[_0x27af('0xc3')]));if(_0x2f40f1['query'][_0x27af('0x25')]){_0x1d081b[_0x27af('0x3a')]=_['merge'](_0x1d081b[_0x27af('0x3a')],{'$or':_[_0x27af('0x32')](_0x1d081b[_0x27af('0x51')],function(_0x48b345){var _0x417c6e={};_0x417c6e[_0x48b345]={'$like':'%'+_0x2f40f1[_0x27af('0x3b')][_0x27af('0x25')]+'%'};return _0x417c6e;})});}_0x1d081b=_[_0x27af('0x4f')]({},_0x1d081b,_0x2f40f1[_0x27af('0x50')]);return _0x2ee598[_0x27af('0x100')](_0x1d081b);}})[_0x27af('0x1c')](function(_0xfdeaac){if(_0xfdeaac){_0xc64328=_0xfdeaac[_0x27af('0x43')];if(!_0x2f40f1[_0x27af('0x3b')]['hasOwnProperty'](_0x27af('0xcc'))){_0x1d081b[_0x27af('0x15')]=qs['limit'](_0x2f40f1[_0x27af('0x3b')][_0x27af('0x15')]);_0x1d081b['offset']=qs[_0x27af('0x14')](_0x2f40f1['query'][_0x27af('0x14')]);}return _0x2ee598['getTeams'](_0x1d081b);}})[_0x27af('0x1c')](function(_0xf9a8fe){if(_0xf9a8fe){return _0xf9a8fe?{'count':_0xc64328,'rows':_0xf9a8fe}:null;}})['then'](respondWithResult(_0x34baa5,null))['catch'](handleError(_0x34baa5,null));};exports[_0x27af('0x101')]=function(_0x2672f3,_0x4c330b){var _0x16f6b1=_0x2672f3['params']['id'];var _0x45ac77=_0x2672f3['body']?_0x2672f3[_0x27af('0x52')]['ids']:null;var _0xec857b=[];return Promise['resolve']()[_0x27af('0x1c')](function(){if(!_0x45ac77)throw new APIBadRequestError(_0x27af('0x102'));})[_0x27af('0x1c')](function(){return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x16f6b1}});})[_0x27af('0x1c')](function(_0x4aa4d9){if(!_0x4aa4d9)throw new APINotFoundError(util[_0x27af('0x9e')](_0x27af('0xbd'),_0x2672f3[_0x27af('0x4d')]['id']));return db[_0x27af('0x5c')][_0x27af('0x103')](function(_0x435755){return _0x4aa4d9[_0x27af('0x101')](_0x45ac77,{'transaction':_0x435755})[_0x27af('0x1c')](function(){return db['Team']['findAll']({'where':{'id':{'$in':_0x45ac77}}});})['then'](function(_0x15fab4){var _0x17c2c1=_[_0x27af('0x32')](_0x15fab4,function(_0x52095a){return _0x52095a['getAssociatedQueues']();});return Promise[_0x27af('0x4b')](_0x17c2c1);})[_0x27af('0x1c')](function(_0x503a21){_0xec857b=_['flattenDeep'](_0x503a21);var _0x25cd05=_['map'](_0xec857b,function(_0x4a57a3){return _0x4a57a3[_0x27af('0x104')](_0x4aa4d9['id'],{'transaction':_0x435755});});return Promise[_0x27af('0x4b')](_0x25cd05);})['then'](function(){if(!_0x4aa4d9['online'])return;var _0x28d6cb=_[_0x27af('0x25')](_0xec857b,function(_0xdf70e3){return _0xdf70e3[_0x27af('0x105')](_0x27af('0x8f'))===_0x27af('0x106');});var _0x3a5110=_[_0x27af('0x32')](_0x28d6cb,function(_0x23229c){return db[_0x27af('0xa0')][_0x27af('0xa1')]({'membername':_0x4aa4d9[_0x27af('0x2a')],'UserId':_0x4aa4d9['id'],'queue_name':_0x23229c['name'],'VoiceQueueId':_0x23229c['id'],'interface':_['isNil'](_0x4aa4d9[_0x27af('0x9d')])?util[_0x27af('0x9e')](_0x27af('0x9f'),_0x4aa4d9[_0x27af('0x2a')]):_0x4aa4d9[_0x27af('0x9d')],'paused':_0x4aa4d9[_0x27af('0x92')]||![],'penalty':_0x4aa4d9[_0x27af('0x107')]},{'transaction':_0x435755});});return Promise[_0x27af('0x4b')](_0x3a5110);})[_0x27af('0x1c')](function(){return db[_0x27af('0x108')][_0x27af('0x7e')]({'where':{'teamId':{'$in':_0x45ac77}}});})['then'](function(_0x4731e){var _0x19baa4=_[_0x27af('0x32')](_0x4731e,function(_0x31bbe5){return db[_0x27af('0x109')][_0x27af('0x77')]({'UserId':_0x4aa4d9['id'],'VoicePrefixId':_0x31bbe5[_0x27af('0x10a')]},{'transaction':_0x435755});});return Promise[_0x27af('0x4b')](_0x19baa4);});});})[_0x27af('0x1c')](function(){for(var _0x53eeb9=0x0;_0x53eeb9<_0xec857b[_0x27af('0x43')];_0x53eeb9++){var _0x1a6947=_0xec857b[_0x53eeb9][_0x27af('0x105')]('channel');var _0x5a1407=_0x1a6947+'QueueId';socket['emit'](_0x27af('0x21')+_0x1a6947+_0x27af('0x9a'),{'UserId':_0x16f6b1,['queueField']:_0xec857b[_0x53eeb9]['id']});}})['then'](respondWithStatusCode(_0x4c330b,null))[_0x27af('0x4c')](APIHandleError(_0x4c330b));};exports['removeTeams']=function(_0x4c61d8,_0x482fc6){var _0x2e2d48=_0x4c61d8['params']['id'];var _0x25a6da=null;if(_0x4c61d8['query'][_0x27af('0x55')]){_0x25a6da=_[_0x27af('0xa2')](_0x4c61d8['query'][_0x27af('0x55')])?_0x4c61d8[_0x27af('0x3b')][_0x27af('0x55')]:[_0x4c61d8[_0x27af('0x3b')][_0x27af('0x55')]];}var _0x1ab57c=[];return Promise[_0x27af('0xf2')]()[_0x27af('0x1c')](function(){if(!_0x25a6da)throw new APIBadRequestError(_0x27af('0x10b'));})['then'](function(){return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x2e2d48}});})[_0x27af('0x1c')](function(_0x44a5e1){if(!_0x44a5e1)throw new APINotFoundError(util[_0x27af('0x9e')](_0x27af('0xbd'),_0x4c61d8[_0x27af('0x4d')]['id']));return db[_0x27af('0x5c')][_0x27af('0x103')](function(_0x3286a6){return _0x44a5e1[_0x27af('0x10c')](_0x25a6da,{'transaction':_0x3286a6})[_0x27af('0x1c')](function(){return db[_0x27af('0x10d')][_0x27af('0x7e')]({'where':{'id':{'$in':_0x25a6da}}});})[_0x27af('0x1c')](function(_0x5c8f04){var _0x10d3f7=_['map'](_0x5c8f04,function(_0x1edfe3){return _0x1edfe3[_0x27af('0x10e')]();});return Promise[_0x27af('0x4b')](_0x10d3f7);})[_0x27af('0x1c')](function(_0x1e01e3){_0x1ab57c=_[_0x27af('0x10f')](_0x1e01e3);var _0x2d9001=_[_0x27af('0x32')](_0x1ab57c,function(_0x471759){return _0x471759[_0x27af('0x110')](_0x44a5e1['id'],{'transaction':_0x3286a6});});return Promise[_0x27af('0x4b')](_0x2d9001);})[_0x27af('0x1c')](function(){if(!_0x44a5e1['online'])return;var _0x4f3f06=_[_0x27af('0x25')](_0x1ab57c,function(_0x1b602d){return _0x1b602d[_0x27af('0x105')](_0x27af('0x8f'))===_0x27af('0x106');});var _0x6e362a=_[_0x27af('0x32')](_0x4f3f06,function(_0x5163cf){return db['UserVoiceQueueRt'][_0x27af('0xa4')]({'where':{'VoiceQueueId':_0x5163cf['id'],'UserId':_0x44a5e1['id']},'transaction':_0x3286a6});});return Promise[_0x27af('0x4b')](_0x6e362a);})[_0x27af('0x1c')](function(){return db['TeamVoicePrefix']['findAll']({'where':{'teamId':{'$in':_0x25a6da}}});})['then'](function(_0x192176){var _0x29cc47=_[_0x27af('0x32')](_0x192176,function(_0x6e5f2b){return db['UserVoicePrefix'][_0x27af('0xa4')]({'where':{'UserId':_0x44a5e1['id'],'VoicePrefixId':_0x6e5f2b[_0x27af('0x10a')]}},{'transaction':_0x3286a6});});return Promise[_0x27af('0x4b')](_0x29cc47);});});})[_0x27af('0x1c')](function(){for(var _0x3cb7f8=0x0;_0x3cb7f8<_0x1ab57c['length'];_0x3cb7f8++){var _0x2aa184=_0x1ab57c[_0x3cb7f8][_0x27af('0x105')](_0x27af('0x8f'));var _0x198875=_0x2aa184+'QueueId';socket[_0x27af('0x1f')]('user'+_0x2aa184+_0x27af('0xa3'),{'UserId':_0x2e2d48,['queueField']:_0x1ab57c[_0x3cb7f8]['id']});}})[_0x27af('0x1c')](respondWithStatusCode(_0x482fc6,null))[_0x27af('0x4c')](APIHandleError(_0x482fc6));};exports[_0x27af('0x111')]=function(_0x2653dc,_0x5819ab){var _0x2269ea={};var _0x5a5e56={};var _0x12800a;var _0x336237;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x2653dc[_0x27af('0x4d')]['id']}})[_0x27af('0x1c')](handleEntityNotFound(_0x5819ab,null))[_0x27af('0x1c')](function(_0x41262a){if(_0x41262a){_0x12800a=_0x41262a;_0x5a5e56[_0x27af('0xc1')]=_[_0x27af('0xc2')](db[_0x27af('0x112')][_0x27af('0x31')]);_0x5a5e56[_0x27af('0x3b')]=_[_0x27af('0xc2')](_0x2653dc[_0x27af('0x3b')]);_0x5a5e56['filters']=_[_0x27af('0xc4')](_0x5a5e56[_0x27af('0xc1')],_0x5a5e56[_0x27af('0x3b')]);_0x2269ea[_0x27af('0x51')]=_[_0x27af('0xc4')](_0x5a5e56[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x2653dc[_0x27af('0x3b')][_0x27af('0xc5')]));_0x2269ea[_0x27af('0x51')]=_0x2269ea[_0x27af('0x51')]['length']?_0x2269ea[_0x27af('0x51')]:_0x5a5e56[_0x27af('0xc1')];_0x2269ea[_0x27af('0xca')]=qs['sort'](_0x2653dc[_0x27af('0x3b')][_0x27af('0xc6')]);_0x2269ea[_0x27af('0x3a')]=qs['filters'](_[_0x27af('0xc7')](_0x2653dc[_0x27af('0x3b')],_0x5a5e56[_0x27af('0xc3')]));if(_0x2653dc[_0x27af('0x3b')][_0x27af('0x25')]){_0x2269ea[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0x2269ea['where'],{'$or':_['map'](_0x2269ea[_0x27af('0x51')],function(_0x1dbed9){var _0x2e3e21={};_0x2e3e21[_0x1dbed9]={'$like':'%'+_0x2653dc['query'][_0x27af('0x25')]+'%'};return _0x2e3e21;})});}_0x2269ea=_['merge']({},_0x2269ea,_0x2653dc[_0x27af('0x50')]);return _0x12800a[_0x27af('0x111')](_0x2269ea);}})[_0x27af('0x1c')](function(_0x488f45){if(_0x488f45){_0x336237=_0x488f45[_0x27af('0x43')];if(!_0x2653dc[_0x27af('0x3b')]['hasOwnProperty']('nolimit')){_0x2269ea[_0x27af('0x15')]=qs['limit'](_0x2653dc[_0x27af('0x3b')][_0x27af('0x15')]);_0x2269ea[_0x27af('0x14')]=qs['offset'](_0x2653dc[_0x27af('0x3b')]['offset']);}return _0x12800a[_0x27af('0x111')](_0x2269ea);}})[_0x27af('0x1c')](function(_0x5e489a){if(_0x5e489a){return _0x5e489a?{'count':_0x336237,'rows':_0x5e489a}:null;}})[_0x27af('0x1c')](respondWithResult(_0x5819ab,null))[_0x27af('0x4c')](handleError(_0x5819ab,null));};exports['getAgents']=function(_0x28a619,_0x20d94a){var _0x22a56={};var _0x4c9f07={};var _0x331059;return db[_0x27af('0x30')][_0x27af('0xc9')]({'where':{'id':_0x28a619[_0x27af('0x4d')]['id']}})['then'](handleEntityNotFound(_0x20d94a,null))['then'](function(_0x5f0d46){if(_0x5f0d46){_0x331059=_0x5f0d46;_0x4c9f07[_0x27af('0xc1')]=_[_0x27af('0xc2')](db['User']['rawAttributes']);_0x4c9f07['query']=_[_0x27af('0xc2')](_0x28a619[_0x27af('0x3b')]);_0x4c9f07['filters']=_[_0x27af('0xc4')](_0x4c9f07[_0x27af('0xc1')],_0x4c9f07[_0x27af('0x3b')]);_0x22a56[_0x27af('0x51')]=_['intersection'](_0x4c9f07[_0x27af('0xc1')],qs[_0x27af('0xc5')](_0x28a619[_0x27af('0x3b')][_0x27af('0xc5')]));_0x22a56[_0x27af('0x51')]=_0x22a56['attributes']['length']?_0x22a56[_0x27af('0x51')]:_0x4c9f07[_0x27af('0xc1')];_0x22a56['order']=qs[_0x27af('0xc6')](_0x28a619['query'][_0x27af('0xc6')]);_0x22a56[_0x27af('0x3a')]=qs[_0x27af('0xc3')](_[_0x27af('0xc7')](_0x28a619[_0x27af('0x3b')],_0x4c9f07[_0x27af('0xc3')]));if(_0x28a619[_0x27af('0x3b')][_0x27af('0x25')]){_0x22a56[_0x27af('0x3a')]=_[_0x27af('0x4f')](_0x22a56[_0x27af('0x3a')],{'$or':_['map'](_0x22a56[_0x27af('0x51')],function(_0x3b07c6){var _0x375f9c={};_0x375f9c[_0x3b07c6]={'$like':'%'+_0x28a619[_0x27af('0x3b')]['filter']+'%'};return _0x375f9c;})});}_0x22a56[_0x27af('0xc1')]=db[_0x27af('0x30')];_0x22a56['as']=_0x27af('0x22');_0x22a56=_[_0x27af('0x4f')]({},_0x22a56,_0x28a619[_0x27af('0x50')]);return _0x331059[_0x27af('0xe9')]({'include':[_0x22a56]});}})[_0x27af('0x1c')](function(_0x1fa79e){if(_0x1fa79e){var _0x530a70={},_0x4e0028=[];for(var _0x5f1830=0x0;_0x5f1830<_0x1fa79e[_0x27af('0x43')];_0x5f1830+=0x1){for(var _0x2f9436=0x0,_0x5c5b81;_0x2f9436<_0x1fa79e[_0x5f1830]['Agents'][_0x27af('0x43')];_0x2f9436+=0x1){_0x5c5b81=_0x1fa79e[_0x5f1830]['Agents'][_0x2f9436][_0x27af('0x9c')]({'plain':!![]});_0x530a70[_0x5c5b81['id']]=_0x5c5b81;}}_0x530a70=_[_0x27af('0x113')](_0x530a70);for(var _0x15dacc=qs[_0x27af('0x14')](_0x28a619[_0x27af('0x3b')][_0x27af('0x14')]);_0x15dacc<_0x530a70[_0x27af('0x43')]&&_0x4e0028[_0x27af('0x43')]=_0x4b4bb2){_0x5c6fa3=_0x4b4bb2;_0x2a6617=0xc8;}else{_0x2a6617=0xce;}_0x53205b[_0x2721('0x1c')](_0x2a6617);return _0x53205b[_0x2721('0x1d')](_0x2721('0x1e'),_0x57a62d+'-'+_0x5c6fa3+'/'+_0x4b4bb2)[_0x2721('0x17')](_0xada36f);}return null;};}function saveUpdates(_0x4038de){return function(_0x479ae6){if(_0x479ae6){return _0x479ae6[_0x2721('0x1f')](_0x4038de)[_0x2721('0x20')](function(_0x8fafe3){if(_0x8fafe3[_0x2721('0x21')]==='agent'){socket[_0x2721('0x22')](_0x2721('0x23')+_0x8fafe3['id'],_0x8fafe3);}return _0x8fafe3;});}return null;};}function removeEntity(_0xbcde6c,_0x38af59){return function(_0x32547f){if(_0x32547f){return _0x32547f['destroy']({'transaction':_0x38af59})[_0x2721('0x20')](function(){var _0x81e8c6=_0x32547f[_0x2721('0x24')]({'plain':!![]});if(_0x81e8c6[_0x2721('0x21')]===_0x2721('0x25'))return;var _0x7c4b51=[{'name':_0x2721('0x26'),'value':'user','ignore':!![]},{'name':_0x2721('0x27'),'value':_0x2721('0x28'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x307b53=_(_0x7c4b51)['filter'](_0x2721('0x29'))[_0x2721('0x2a')](_0x2721('0x2b'))[_0x2721('0x2b')]();if(_[_0x2721('0x2c')](_0x307b53,_0x81e8c6[_0x2721('0x21')])){return;}var _0x5f4e21=_[_0x2721('0x2d')](_0x7c4b51,[_0x2721('0x2b'),_0x81e8c6[_0x2721('0x21')]])['name'];return db[_0x2721('0x2e')]['destroy']({'where':{'type':_0x5f4e21,'resourceId':_0x81e8c6['id']},'transaction':_0x38af59})[_0x2721('0x20')](function(){return _0x32547f;});})['then'](function(){_0xbcde6c[_0x2721('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x443f66){return function(_0x279386){if(!_0x279386){_0x443f66['sendStatus'](0x194);}return _0x279386;};}function handleError(_0x2751c0,_0x37adf0){_0x37adf0=_0x37adf0||0x1f4;return function(_0xc58d44){logger['error'](_0xc58d44[_0x2721('0x2f')]);if(_0xc58d44[_0x2721('0x30')]){delete _0xc58d44['name'];}_0x2751c0[_0x2721('0x1c')](_0x37adf0)[_0x2721('0x31')](_0xc58d44);};}function getUserAttributes(){return _(db[_0x2721('0x32')][_0x2721('0x33')])[_0x2721('0x2a')](function(_0x4489a4){return{'name':_0x4489a4[_0x2721('0x34')],'type':_0x4489a4['type'][_0x2721('0x35')]};})[_0x2721('0x36')](function(_0x2b738b){return![_0x2721('0x37'),_0x2721('0x38'),'previousPasswords',_0x2721('0x39'),_0x2721('0x3a'),'md5secret']['includes'](_0x2b738b[_0x2721('0x30')]);})['value']();}exports[_0x2721('0x3b')]=function(_0x598013,_0x4c0a14){var _0x36d0a9={},_0x25cb22={'count':0x0,'rows':[]};var _0x527d2c=getUserAttributes();_0x36d0a9=qs[_0x2721('0x3c')](_0x527d2c,_0x598013);var _0x1633f4={'where':_0x36d0a9['where']};return db[_0x2721('0x32')][_0x2721('0x1a')](_0x1633f4)[_0x2721('0x20')](function(_0x3dd28f){_0x25cb22[_0x2721('0x1a')]=_0x3dd28f;if(_0x598013[_0x2721('0x3d')][_0x2721('0x3e')]){_0x36d0a9[_0x2721('0x3f')]=[{'all':!![]}];}if(_0x598013['query'][_0x2721('0x40')]===_0x2721('0x41')){_0x36d0a9[_0x2721('0x3f')]=[{'model':db[_0x2721('0x42')],'as':_0x2721('0x40')}];}if(!_[_0x2721('0x2c')](_0x36d0a9['attributes'],'id')){_0x36d0a9[_0x2721('0x43')][_0x2721('0x44')]('id');}return db[_0x2721('0x32')][_0x2721('0x45')](_0x36d0a9);})['then'](function(_0x4fd09b){_0x25cb22['rows']=_0x4fd09b;if(_0x598013[_0x2721('0x3d')][_0x2721('0x46')]==='true'){var _0x18cfcd=[];for(var _0x5f4ffb=0x0;_0x5f4ffb<_0x25cb22[_0x2721('0x47')]['length'];_0x5f4ffb++){_0x18cfcd[_0x2721('0x44')](get_open_tabs(_0x2721('0x48'),_0x25cb22[_0x2721('0x47')][_0x5f4ffb][_0x2721('0x49')]));_0x18cfcd['push'](get_open_tabs(_0x2721('0x4a'),_0x25cb22[_0x2721('0x47')][_0x5f4ffb][_0x2721('0x49')]));_0x18cfcd[_0x2721('0x44')](get_open_tabs(_0x2721('0x4b'),_0x25cb22[_0x2721('0x47')][_0x5f4ffb][_0x2721('0x49')]));_0x18cfcd[_0x2721('0x44')](get_open_tabs(_0x2721('0x4c'),_0x25cb22[_0x2721('0x47')][_0x5f4ffb][_0x2721('0x49')]));_0x18cfcd[_0x2721('0x44')](get_open_tabs('openchannel',_0x25cb22[_0x2721('0x47')][_0x5f4ffb][_0x2721('0x49')]));_0x18cfcd[_0x2721('0x44')](get_open_tabs('whatsapp',_0x25cb22[_0x2721('0x47')][_0x5f4ffb][_0x2721('0x49')]));}return Promise[_0x2721('0x4d')](_0x18cfcd)[_0x2721('0x20')](function(){return _0x25cb22;});}else{return _0x25cb22;}})[_0x2721('0x20')](respondWithFilteredResult(_0x4c0a14,_0x36d0a9))[_0x2721('0x4e')](handleError(_0x4c0a14,null));};exports['show']=function(_0x2d284a,_0x233c4e){var _0x4696d3=getUserAttributes();_0x2d284a['query']['id']=_0x2d284a[_0x2721('0x4f')]['id'];var _0x5ad426=qs[_0x2721('0x3c')](_0x4696d3,_0x2d284a);if(_0x2d284a[_0x2721('0x3d')][_0x2721('0x3e')]){_0x5ad426[_0x2721('0x3f')]=[{'all':!![]}];}if(_0x2d284a['query'][_0x2721('0x40')]===_0x2721('0x41')){_0x5ad426[_0x2721('0x3f')]=[{'model':db[_0x2721('0x42')],'as':_0x2721('0x40')}];}_0x5ad426=_[_0x2721('0x50')]({},_0x5ad426,_0x2d284a['options']);if(!_['includes'](_0x5ad426[_0x2721('0x43')],'id')){_0x5ad426['attributes'][_0x2721('0x44')]('id');}return db[_0x2721('0x32')]['find'](_0x5ad426)[_0x2721('0x20')](handleEntityNotFound(_0x233c4e,null))['then'](function(_0x229ff8){var _0x275a97=[];values=_0x229ff8;if(_0x2d284a[_0x2721('0x3d')][_0x2721('0x46')]===_0x2721('0x41')){_0x275a97['push'](get_open_tabs(_0x2721('0x48'),_0x229ff8[_0x2721('0x49')]));_0x275a97[_0x2721('0x44')](get_open_tabs(_0x2721('0x4a'),_0x229ff8[_0x2721('0x49')]));_0x275a97[_0x2721('0x44')](get_open_tabs(_0x2721('0x51'),_0x229ff8['dataValues']));_0x275a97[_0x2721('0x44')](get_open_tabs(_0x2721('0x52'),_0x229ff8[_0x2721('0x49')]));_0x275a97[_0x2721('0x44')](get_open_tabs('fax',_0x229ff8[_0x2721('0x49')]));_0x275a97[_0x2721('0x44')](get_open_tabs('mail',_0x229ff8[_0x2721('0x49')]));return Promise[_0x2721('0x4d')](_0x275a97);}else{return values;}})[_0x2721('0x20')](function(){return values;})[_0x2721('0x20')](respondWithResult(_0x233c4e,null))[_0x2721('0x4e')](handleError(_0x233c4e,null));};exports['update']=function(_0x3017fc,_0x3f5ec8){if(_0x3017fc[_0x2721('0x53')]['id']){delete _0x3017fc[_0x2721('0x53')]['id'];}delete _0x3017fc[_0x2721('0x53')][_0x2721('0x21')];return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x3017fc[_0x2721('0x4f')]['id']}})['then'](handleEntityNotFound(_0x3f5ec8,null))['then'](saveUpdates(_0x3017fc['body'],null))[_0x2721('0x20')](respondWithResult(_0x3f5ec8,null))[_0x2721('0x4e')](handleError(_0x3f5ec8,null));};exports['describe']=function(_0x367cd6,_0x5c79f0){return db['User'][_0x2721('0x54')]()['then'](respondWithResult(_0x5c79f0,null))[_0x2721('0x4e')](handleError(_0x5c79f0,null));};exports['addContacts']=function(_0x2a0e27,_0x478551){return db['User']['find']({'where':{'id':_0x2a0e27[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x478551,null))['then'](function(_0x5c15e2){if(_0x5c15e2){return _0x5c15e2[_0x2721('0x55')](_0x2a0e27[_0x2721('0x53')][_0x2721('0x56')],_[_0x2721('0x57')](_0x2a0e27['body'],[_0x2721('0x56'),'id'])||{});}})[_0x2721('0x20')](respondWithResult(_0x478551,null))[_0x2721('0x4e')](handleError(_0x478551,null));};function validateUser(_0x12ea7e){return new Promise(function(_0x42dd94,_0x1d97ce){if(_0x12ea7e[_0x2721('0x58')])return _0x42dd94(_0x12ea7e);return db[_0x2721('0x59')][_0x2721('0x5a')](0x1)[_0x2721('0x20')](function(_0x2b5e84){if(_0x2b5e84['securePassword'])authService[_0x2721('0x5b')](_0x12ea7e['password']);db[_0x2721('0x32')][_0x2721('0x5c')](_0x2721('0x58'))[_0x2721('0x20')](function(_0x5acfba){if(_[_0x2721('0x5d')](_0x5acfba)){_0x12ea7e[_0x2721('0x58')]=_0x2b5e84['min_internal']||0x1;return;}if(_['isNil'](_0x2b5e84[_0x2721('0x5e')])||_0x2b5e84[_0x2721('0x5e')]===_0x5acfba){_0x12ea7e[_0x2721('0x58')]=_0x5acfba+0x1;return;}if(_0x2b5e84[_0x2721('0x5e')]>_0x5acfba){_0x12ea7e[_0x2721('0x58')]=_0x2b5e84['min_internal'];return;}return db[_0x2721('0x5f')][_0x2721('0x3d')](_0x2721('0x60'),{'type':db[_0x2721('0x5f')][_0x2721('0x61')][_0x2721('0x62')]})[_0x2721('0x20')](function(_0x39644d){if(_0x39644d&&_0x39644d[_0x2721('0x63')]){for(var _0x290f34=0x0,_0x3145f3=_0x39644d[_0x2721('0x63')];_0x290f34<_0x3145f3&&_['isNil'](_0x12ea7e[_0x2721('0x58')]);_0x290f34++){if(_0x2b5e84['min_internal']<=_0x39644d[_0x290f34][_0x2721('0x64')]){_0x12ea7e[_0x2721('0x58')]=_0x39644d[_0x290f34][_0x2721('0x64')];}else if(_0x2b5e84[_0x2721('0x5e')]>_0x39644d[_0x290f34][_0x2721('0x64')]&&_0x2b5e84['min_internal']<=_0x39644d[_0x290f34]['to']){_0x12ea7e[_0x2721('0x58')]=_0x2b5e84[_0x2721('0x5e')];}}}if(_[_0x2721('0x5d')](_0x12ea7e[_0x2721('0x58')])){_0x12ea7e['internal']=_0x5acfba+0x1;}return _0x42dd94(_0x12ea7e);});});})['catch'](function(_0x549536){_0x1d97ce(_0x549536);});});}function updateUser(_0x486aab){return new Promise(function(_0x1d7874,_0x22d53f){try{if(_0x486aab[_0x2721('0x65')]){_0x486aab[_0x2721('0x66')]=_0x486aab['internal'];_0x486aab[_0x2721('0x67')]={'mailbox':_0x486aab[_0x2721('0x58')],'password':_0x486aab['password'],'fullname':_0x486aab['fullname'],'email':_0x486aab[_0x2721('0x68')]};}if(_0x486aab[_0x2721('0x21')]===_0x2721('0x28')){if(!_0x486aab['permissions'])_0x486aab[_0x2721('0x69')]=[_0x2721('0x6a'),_0x2721('0x6b'),'103',_0x2721('0x6c'),_0x2721('0x6d'),_0x2721('0x6e'),_0x2721('0x6f'),_0x2721('0x70'),_0x2721('0x71'),_0x2721('0x72'),_0x2721('0x73'),_0x2721('0x74'),'111',_0x2721('0x75'),_0x2721('0x76')];}_0x1d7874(_0x486aab);}catch(_0x4e7d82){_0x22d53f(_0x4e7d82);}});}exports[_0x2721('0x77')]=function(_0x4451de,_0xf9c737){if(_0x4451de[_0x2721('0x78')][_0x2721('0x21')]===_0x2721('0x28'))throw new Error(_0x2721('0x79'));if(_0x4451de['body']['role']===_0x2721('0x78')&&_0x4451de[_0x2721('0x78')][_0x2721('0x21')]!==_0x2721('0x25')){throw new Error(_0x2721('0x7a'));}if(_0x4451de['body'][_0x2721('0x21')]===_0x2721('0x25')&&_0x4451de[_0x2721('0x78')][_0x2721('0x21')]!==_0x2721('0x25')){throw new Error(_0x2721('0x7b'));}return licenseUtil[_0x2721('0x7c')]([_0x4451de[_0x2721('0x53')]])[_0x2721('0x20')](function(){return validateUser(_0x4451de[_0x2721('0x53')]);})['then'](function(_0x5d8b7b){return updateUser(_0x5d8b7b)[_0x2721('0x20')](function(_0x321eb0){if(_0x321eb0['role']===_0x2721('0x25')){_0x321eb0[_0x2721('0x7d')]=_0x4451de[_0x2721('0x78')][_0x2721('0x7d')];delete _0x321eb0['userProfileId'];}return _0x321eb0;});})[_0x2721('0x20')](function(_0x4dd513){return db[_0x2721('0x32')][_0x2721('0x77')](_0x4dd513,{'include':[{'model':db[_0x2721('0x67')],'as':'VoiceMail'}]});})[_0x2721('0x20')](function(_0x836c2){if(_0x4451de['body'][_0x2721('0x21')]===_0x2721('0x78'))return _0x836c2;if(_0x4451de['user'][_0x2721('0x21')]!==_0x2721('0x78'))return _0x836c2;return db[_0x2721('0x7e')][_0x2721('0x2d')]({'where':{'name':_0x836c2['role']===_0x2721('0x28')?_0x2721('0x27'):_0x2721('0x7f'),'userProfileId':_0x4451de[_0x2721('0x78')]['userProfileId']},'raw':!![]})[_0x2721('0x20')](function(_0x22f839){if(!_0x22f839||_0x22f839[_0x2721('0x80')]!=0x0)return _0x836c2;return db[_0x2721('0x2e')][_0x2721('0x77')]({'name':_0x836c2[_0x2721('0x30')],'resourceId':_0x836c2['id'],'type':_0x22f839[_0x2721('0x30')],'sectionId':_0x22f839['id']},{})['then'](function(){return _0x836c2;});})[_0x2721('0x4e')](function(_0x5079c0){logger[_0x2721('0x81')](_0x2721('0x82'),_0x5079c0);throw _0x5079c0;});})['then'](respondWithResult(_0xf9c737,0xc9))[_0x2721('0x4e')](handleError(_0xf9c737,null));};exports[_0x2721('0x83')]=function(_0x28443f,_0x5c03aa){var _0x22d04c=_0x28443f[_0x2721('0x53')];var _0x5d2843=[];if(_0x28443f[_0x2721('0x78')][_0x2721('0x21')]===_0x2721('0x28'))throw new Error(_0x2721('0x79'));if(_[_0x2721('0x84')](_0x22d04c,[_0x2721('0x21'),_0x2721('0x78')])&&_0x28443f[_0x2721('0x78')]['role']!==_0x2721('0x25')){throw new Error(_0x2721('0x7a'));}if(_[_0x2721('0x84')](_0x22d04c,[_0x2721('0x21'),_0x2721('0x25')])&&_0x28443f[_0x2721('0x78')]['role']!=='admin'){throw new Error(_0x2721('0x85'));}return licenseUtil[_0x2721('0x7c')](_0x22d04c)[_0x2721('0x20')](function(){return validateUser(_0x22d04c[0x0]);})[_0x2721('0x20')](function(){for(var _0x32c4fe=0x1;_0x32c4fe<_0x22d04c[_0x2721('0x63')];_0x32c4fe++){var _0x4bf183=_0x22d04c[_0x32c4fe-0x1]['internal'];if(!_0x22d04c[_0x32c4fe][_0x2721('0x58')])_0x22d04c[_0x32c4fe][_0x2721('0x58')]=_0x4bf183+0x1;_0x5d2843[_0x2721('0x44')](validateUser(_0x22d04c[_0x32c4fe]));}return Promise['all'](_0x5d2843);})[_0x2721('0x20')](function(){_0x5d2843=[];for(var _0x3da6a7=0x0;_0x3da6a7<_0x22d04c[_0x2721('0x63')];_0x3da6a7++){_0x5d2843[_0x2721('0x44')](updateUser(_0x22d04c[_0x3da6a7]));}return Promise[_0x2721('0x4d')](_0x5d2843);})['then'](function(){_0x5d2843=_0x22d04c[_0x2721('0x2a')](function(_0x266f35){return db[_0x2721('0x32')][_0x2721('0x77')](_0x266f35,{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]})['then'](function(_0x4a8f83){_0x266f35['id']=_0x4a8f83['id'];return _0x266f35;});});return Promise[_0x2721('0x4d')](_0x5d2843);})[_0x2721('0x20')](function(_0xbc2f1f){if(_0x28443f['body'][_0x2721('0x21')]===_0x2721('0x78'))return _0xbc2f1f;if(_0x28443f[_0x2721('0x78')][_0x2721('0x21')]!==_0x2721('0x78'))return _0xbc2f1f;var _0x35359c=_['some'](_0xbc2f1f,function(_0xc04734){return _0xc04734[_0x2721('0x21')]===_0x2721('0x28')||_0xc04734[_0x2721('0x21')]===_0x2721('0x86');});if(!_0x35359c)return _0xbc2f1f;return db[_0x2721('0x7e')][_0x2721('0x45')]({'where':{'name':{'$or':[_0x2721('0x27'),'Telephones']},'userProfileId':_0x28443f[_0x2721('0x78')]['userProfileId']},'raw':!![]})[_0x2721('0x20')](function(_0x39a880){if(_[_0x2721('0x87')](_0x39a880)||!_[_0x2721('0x84')](_0x39a880,[_0x2721('0x80'),0x0]))return _0xbc2f1f;_0x5d2843=[];var _0x26ce7d=_(_0x39a880)[_0x2721('0x2a')](function(_0x1a8e05){if(_0x1a8e05['autoAssociation']===0x1)return;return _0x1a8e05['name']===_0x2721('0x27')?_0x2721('0x28'):_0x2721('0x86');})['compact']()[_0x2721('0x2b')]();for(var _0x4f8ca6=0x0;_0x4f8ca6<_0xbc2f1f[_0x2721('0x63')];_0x4f8ca6++){if(!_[_0x2721('0x2c')](_0x26ce7d,_0xbc2f1f[_0x4f8ca6]['role']))return;var _0x3fc1fc=_0xbc2f1f[_0x4f8ca6][_0x2721('0x21')]===_0x2721('0x28')?_0x2721('0x27'):_0x2721('0x7f');_0x5d2843[_0x2721('0x44')](db[_0x2721('0x2e')][_0x2721('0x77')]({'name':_0xbc2f1f[_0x4f8ca6]['name'],'resourceId':_0xbc2f1f[_0x4f8ca6]['id'],'type':_0x3fc1fc,'sectionId':_[_0x2721('0x2d')](_0x39a880,[_0x2721('0x30'),_0x3fc1fc])['id']},{}));}return Promise[_0x2721('0x4d')](_0x5d2843);});})[_0x2721('0x20')](respondWithResult(_0x5c03aa,0xc9))[_0x2721('0x4e')](handleError(_0x5c03aa,null));};exports[_0x2721('0x88')]=function(_0xdbd2cd,_0x4b93fd){if(_0xdbd2cd['body']['id']){delete _0xdbd2cd['body']['id'];}return db[_0x2721('0x32')]['find']({'where':{'id':_0xdbd2cd[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](function(_0x2fdc40){if(!_0x2fdc40)return null;if(_0x2fdc40['id']===_0xdbd2cd[_0x2721('0x78')]['id']){if(!_0xdbd2cd['body']['oldPassword']||!_0xdbd2cd[_0x2721('0x53')][_0x2721('0x89')]){throw new db[(_0x2721('0x8a'))][(_0x2721('0x8b'))](_0x2721('0x8c'));}if(!_0x2fdc40[_0x2721('0x8d')](_0xdbd2cd[_0x2721('0x53')]['oldPassword'])){throw new db[(_0x2721('0x8a'))][(_0x2721('0x8b'))](_0x2721('0x8e'));}if(_0xdbd2cd[_0x2721('0x53')][_0x2721('0x8f')]===_0xdbd2cd[_0x2721('0x53')]['newPassword']){throw new db['Sequelize'][(_0x2721('0x8b'))](_0x2721('0x90'));}}else if(_0xdbd2cd['user'][_0x2721('0x21')]==='admin'){if(!_0xdbd2cd[_0x2721('0x53')][_0x2721('0x89')]){throw new db['Sequelize']['ValidationError'](_0x2721('0x91'));}}else if(_0xdbd2cd[_0x2721('0x78')][_0x2721('0x21')]===_0x2721('0x78')){if(!_0xdbd2cd[_0x2721('0x53')][_0x2721('0x89')]){throw new db[(_0x2721('0x8a'))][(_0x2721('0x8b'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x2fdc40[_0x2721('0x21')]!=='agent'){throw new db[(_0x2721('0x8a'))]['ValidationError']('Unauthorized');}}else{throw new db[(_0x2721('0x8a'))][(_0x2721('0x8b'))](_0x2721('0x79'));}return _0x2fdc40;})[_0x2721('0x20')](handleEntityNotFound(_0x4b93fd,null))['then'](function(_0x2df322){return db[_0x2721('0x59')][_0x2721('0x92')]({'attributes':['id','securePassword',_0x2721('0x93'),'passwordHistoryLimit']})[_0x2721('0x20')](function(_0x36c8f8){if(_0x36c8f8['securePassword'])authService[_0x2721('0x5b')](_0xdbd2cd[_0x2721('0x53')][_0x2721('0x89')]);if(!_0x36c8f8[_0x2721('0x93')]||!_0x2df322[_0x2721('0x94')])return _0x2df322;authService[_0x2721('0x95')](_0xdbd2cd[_0x2721('0x53')]['newPassword'],_0x2df322[_0x2721('0x94')],_0x36c8f8[_0x2721('0x96')]);return _0x2df322;})[_0x2721('0x20')](saveUpdates({'password':_0xdbd2cd['body'][_0x2721('0x89')],'passwordResetAt':_0xdbd2cd[_0x2721('0x78')]['id']==_0xdbd2cd[_0x2721('0x4f')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0xdbd2cd[_0x2721('0x53')][_0x2721('0x89')],_0x2df322[_0x2721('0x94')])},null));})[_0x2721('0x20')](respondWithResult(_0x4b93fd,null))[_0x2721('0x4e')](handleError(_0x4b93fd,null));};exports[_0x2721('0x97')]=function(_0x1bd318,_0x1c01b3){var _0x3ee1e4=_0x1bd318[_0x2721('0x53')][_0x2721('0x98')];return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x1bd318[_0x2721('0x4f')]['id']},'attributes':['id',_0x2721('0x30'),_0x2721('0x21'),_0x2721('0x99'),'loginInPause',_0x2721('0x9a'),_0x2721('0x9b')]})[_0x2721('0x20')](handleEntityNotFound(_0x1c01b3,null))['then'](function(_0x2d7ca8){if(_0x2d7ca8){if(!utils[_0x2721('0x9c')](_0x3ee1e4)){throw new db[(_0x2721('0x8a'))][(_0x2721('0x8b'))](_0x2721('0x9d'));}return _0x2d7ca8[_0x2721('0x9e')+_[_0x2721('0x9f')](_0x3ee1e4[_0x2721('0xa0')]())+'Queues'](_0x1bd318[_0x2721('0x53')]['ids'],{'penalty':_0x1bd318[_0x2721('0x53')][_0x2721('0xa1')]||0x0})[_0x2721('0xa2')](function(_0x2e0f38){for(var _0x4a3264=0x0;_0x4a3264<_0x1bd318['body'][_0x2721('0x56')][_0x2721('0x63')];_0x4a3264+=0x1){var _0x2eb4b8={'UserId':Number(_0x1bd318['params']['id'])};_0x2eb4b8[_[_0x2721('0x9f')](_0x3ee1e4[_0x2721('0xa0')]())+_0x2721('0xa3')]=Number(_0x1bd318[_0x2721('0x53')][_0x2721('0x56')][_0x4a3264]);socket[_0x2721('0x22')]('user'+_[_0x2721('0x9f')](_0x3ee1e4[_0x2721('0xa0')]())+_0x2721('0xa4'),_0x2eb4b8);}return _0x2e0f38;})[_0x2721('0x20')](function(){if(_0x3ee1e4===_0x2721('0xa5')){return db[_0x2721('0xa6')]['findAll']({'where':{'id':_0x1bd318[_0x2721('0x53')][_0x2721('0x56')]||[]},'raw':!![],'attributes':['id',_0x2721('0x30')]});}})[_0x2721('0x20')](function(_0x32a81f){var _0x88c5a8=_0x2d7ca8['get']({'plain':!![]});var _0xb3d6f1=[];if(_0x3ee1e4===_0x2721('0xa5')&&_0x88c5a8[_0x2721('0x21')]==='agent'&&_0x88c5a8[_0x2721('0x99')]){for(let _0x3714d0=0x0;_0x3714d0<_0x32a81f[_0x2721('0x63')];_0x3714d0+=0x1){_0xb3d6f1['push']({'membername':_0x88c5a8[_0x2721('0x30')],'UserId':_0x88c5a8['id'],'queue_name':_0x32a81f[_0x3714d0]['name'],'VoiceQueueId':_0x32a81f[_0x3714d0]['id'],'interface':_['isNil'](_0x88c5a8[_0x2721('0x9b')])?util[_0x2721('0xa7')](_0x2721('0xa8'),_0x88c5a8['name']):_0x88c5a8[_0x2721('0x9b')],'paused':_0x88c5a8[_0x2721('0x9a')]||![],'penalty':_0x1bd318[_0x2721('0x53')]['penalty']||0x0});}return Promise[_0x2721('0x4d')](_0xb3d6f1[_0x2721('0x2a')](function(_0x552733){return db[_0x2721('0xa9')][_0x2721('0xaa')](_0x552733);}));}return _0x2d7ca8;});}})[_0x2721('0x20')](respondWithStatusCode(_0x1c01b3,null))[_0x2721('0x4e')](handleError(_0x1c01b3,null));};exports['removeQueues']=function(_0x2450ed,_0x4fa10b){var _0x159185,_0x4f84f6;return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x2450ed[_0x2721('0x4f')]['id']},'attributes':['id',_0x2721('0x30'),'role']})[_0x2721('0x20')](handleEntityNotFound(_0x4fa10b,null))[_0x2721('0x20')](function(_0x22077f){if(_0x22077f){_0x159185=_0x22077f;if(!_0x2450ed['query'][_0x2721('0x98')]||!utils[_0x2721('0x9c')](_0x2450ed[_0x2721('0x3d')][_0x2721('0x98')])){throw new db[(_0x2721('0x8a'))][(_0x2721('0x8b'))](_0x2721('0x9d'));}return _0x22077f[_0x2721('0xab')+_[_0x2721('0x9f')](_0x2450ed[_0x2721('0x3d')][_0x2721('0x98')][_0x2721('0xa0')]())+'Queues'](_0x2450ed[_0x2721('0x3d')][_0x2721('0x56')]);}})[_0x2721('0x20')](function(_0x50a166){if(_[_0x2721('0xac')](_0x2450ed[_0x2721('0x3d')]['ids'])){for(var _0x332049=0x0;_0x332049<_0x2450ed['query'][_0x2721('0x56')][_0x2721('0x63')];_0x332049+=0x1){_0x4f84f6={'UserId':Number(_0x2450ed[_0x2721('0x4f')]['id'])};_0x4f84f6[_[_0x2721('0x9f')](_0x2450ed[_0x2721('0x3d')]['channel'][_0x2721('0xa0')]())+_0x2721('0xa3')]=Number(_0x2450ed[_0x2721('0x3d')][_0x2721('0x56')][_0x332049]);socket[_0x2721('0x22')](_0x2721('0x78')+_[_0x2721('0x9f')](_0x2450ed['query'][_0x2721('0x98')]['toLowerCase']())+_0x2721('0xad'),_0x4f84f6);}}else{_0x4f84f6={'UserId':Number(_0x2450ed[_0x2721('0x4f')]['id'])};_0x4f84f6[_[_0x2721('0x9f')](_0x2450ed[_0x2721('0x3d')][_0x2721('0x98')]['toLowerCase']())+'QueueId']=Number(_0x2450ed['query'][_0x2721('0x56')]);socket[_0x2721('0x22')](_0x2721('0x78')+_[_0x2721('0x9f')](_0x2450ed[_0x2721('0x3d')][_0x2721('0x98')][_0x2721('0xa0')]())+_0x2721('0xad'),_0x4f84f6);}return _0x50a166;})[_0x2721('0x20')](function(){if(_0x2450ed[_0x2721('0x3d')][_0x2721('0x98')]===_0x2721('0xa5')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x2450ed[_0x2721('0x4f')]['id'],'VoiceQueueId':_0x2450ed[_0x2721('0x3d')][_0x2721('0x56')]},'individualHooks':!![]})[_0x2721('0x20')](function(){return _0x159185;});}return _0x159185;})['then'](respondWithStatusCode(_0x4fa10b,null))[_0x2721('0x4e')](handleError(_0x4fa10b,null));};exports['addAvatar']=function(_0x207d21,_0x1658a0){_0x207d21[_0x2721('0x53')][_0x2721('0xae')]=_0x207d21[_0x2721('0xaf')]['filename'];return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x207d21[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x1658a0,null))[_0x2721('0x20')](saveUpdates(_0x207d21[_0x2721('0x53')],null))[_0x2721('0x20')](respondWithResult(_0x1658a0,null))[_0x2721('0x4e')](handleError(_0x1658a0,null));};exports[_0x2721('0xb0')]=function(_0x4c5f9e,_0x4430dc){var _0x450023=path['join'](config[_0x2721('0xb1')],_0x2721('0xb2'));return db[_0x2721('0x32')]['find']({'where':{'id':_0x4c5f9e[_0x2721('0x4f')]['id']},'attributes':['id','userpic'],'raw':!![]})['then'](handleEntityNotFound(_0x4430dc,null))[_0x2721('0x20')](function(_0x406323){if(_0x406323){if(_[_0x2721('0x5d')](_0x406323[_0x2721('0xae')])){return _0x4430dc[_0x2721('0xb3')](_0x450023);}else{if(!fs[_0x2721('0xb4')](path[_0x2721('0xb5')](config[_0x2721('0xb1')],_0x2721('0xb6'),_0x406323['userpic']))){return _0x4430dc['download'](_0x450023);}return _0x4430dc[_0x2721('0xb3')](path['join'](config[_0x2721('0xb1')],_0x2721('0xb6'),_0x406323['userpic']));}}})[_0x2721('0x4e')](handleError(_0x4430dc,null));};exports[_0x2721('0xb7')]=function(_0x4df513,_0x17a7e6){return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x4df513['params']['id']},'attributes':['id']})[_0x2721('0x20')](handleEntityNotFound(_0x17a7e6,null))[_0x2721('0x20')](function(_0x36593d){var _0x4f2d66=[];values=_0x36593d[_0x2721('0x49')];_0x4f2d66['push'](get_open_tabs(_0x2721('0x48'),_0x36593d[_0x2721('0x49')]));_0x4f2d66[_0x2721('0x44')](get_open_tabs(_0x2721('0x4a'),_0x36593d[_0x2721('0x49')]));_0x4f2d66['push'](get_open_tabs(_0x2721('0x51'),_0x36593d['dataValues']));_0x4f2d66['push'](get_open_tabs(_0x2721('0x52'),_0x36593d[_0x2721('0x49')]));_0x4f2d66[_0x2721('0x44')](get_open_tabs(_0x2721('0x4b'),_0x36593d[_0x2721('0x49')]));_0x4f2d66[_0x2721('0x44')](get_open_tabs(_0x2721('0x4c'),_0x36593d['dataValues']));return Promise[_0x2721('0x4d')](_0x4f2d66);})[_0x2721('0x20')](function(_0x5815bb){if(_0x5815bb){var _0x450778=_['map'](values[_0x2721('0xb8')],function(_0x5992e4){return{'channel':_0x2721('0xb9'),'id':_0x5992e4['id'],'createdAt':_0x5992e4[_0x2721('0xba')]};});var _0x1c1cdd=_[_0x2721('0x2a')](values[_0x2721('0xbb')],function(_0x511316){return{'channel':_0x2721('0xbc'),'id':_0x511316['id'],'createdAt':_0x511316[_0x2721('0xba')]};});var _0x1a8b74=_[_0x2721('0x2a')](values[_0x2721('0xbd')],function(_0x164b56){return{'channel':_0x2721('0xbe'),'id':_0x164b56['id'],'createdAt':_0x164b56[_0x2721('0xba')]};});var _0x2a1e93=_[_0x2721('0x2a')](values[_0x2721('0xbf')],function(_0x14c979){return{'channel':'MAIL','id':_0x14c979['id'],'createdAt':_0x14c979[_0x2721('0xba')]};});var _0x160e7b=_[_0x2721('0x2a')](values[_0x2721('0xc0')],function(_0x5bc675){return{'channel':_0x2721('0xc1'),'id':_0x5bc675['id'],'createdAt':_0x5bc675['createdAt']};});var _0x67d784=_[_0x2721('0x2a')](values[_0x2721('0xc2')],function(_0x557976){return{'channel':'WHATSAPP','id':_0x557976['id'],'createdAt':_0x557976[_0x2721('0xba')]};});var _0x164256=_[_0x2721('0xc3')](_0x450778,_0x1c1cdd,_0x1a8b74,_0x2a1e93,_0x160e7b,_0x67d784);var _0x4f13f6={'count':_0x164256[_0x2721('0x63')],'rows':_0x164256};return _0x4f13f6;}else return null;})['then'](respondWithResult(_0x17a7e6,null))[_0x2721('0x4e')](handleError(_0x17a7e6,null));};exports[_0x2721('0xc4')]=function(_0x1d180a,_0x4997c6){var _0x3e5291={};return db['User'][_0x2721('0x92')]({'where':{'id':_0x1d180a[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](function(_0x291555){if(!_0x291555){throw new APINotFoundError(util[_0x2721('0xa7')](_0x2721('0xc5'),_0x1d180a[_0x2721('0x4f')]['id']));}return contacts['describe']();})[_0x2721('0x20')](function(_0x4ef395){_0x1d180a[_0x2721('0x3d')][_0x2721('0x32')]=_0x1d180a[_0x2721('0x4f')]['id'];_0x3e5291=qs['getOptions'](_0x4ef395,_0x1d180a);if(_0x1d180a[_0x2721('0x3d')][_0x2721('0xc6')]('includeAll')){_0x3e5291[_0x2721('0x3f')]=[{'model':db[_0x2721('0xc7')],'as':_0x2721('0xc8'),'required':![]},{'model':db[_0x2721('0xc9')],'as':_0x2721('0xca'),'attributes':['id',_0x2721('0x30'),_0x2721('0xcb')],'where':_0x1d180a[_0x2721('0x3d')]['tag']?{'id':_0x1d180a[_0x2721('0x3d')]['tag']}:undefined,'required':_0x1d180a['query'][_0x2721('0xcc')]?!![]:![]}];}return contacts[_0x2721('0x45')](_0x1d180a[_0x2721('0x3d')],_0x1d180a[_0x2721('0x78')],_0x3e5291,_0x4ef395);})['then'](respondWithFilteredResult(_0x4997c6,_0x3e5291))[_0x2721('0x4e')](APIHandleError(_0x4997c6));};exports[_0x2721('0xcd')]=function(_0x20718a,_0x58ba51){var _0x3ff2e8;var _0x576cb8={};var _0x494714;return db['User'][_0x2721('0x92')]({'where':{'id':_0x20718a[_0x2721('0x4f')]['id']},'attributes':['id',_0x2721('0x30'),_0x2721('0x21')]})['then'](handleEntityNotFound(_0x58ba51,null))[_0x2721('0x20')](function(_0x395526){if(!utils['isValidChannel'](_0x20718a[_0x2721('0x3d')][_0x2721('0x98')])){throw new db['Sequelize'][(_0x2721('0x8b'))](_0x2721('0x9d'));}_0x3ff2e8=_0x395526;var _0xcf9713={};_0xcf9713[_0x2721('0xce')]=_[_0x2721('0xcf')](db[_[_0x2721('0x9f')](_0x20718a[_0x2721('0x3d')][_0x2721('0x98')])+'Queue'][_0x2721('0x33')]);_0xcf9713[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x20718a[_0x2721('0x3d')]);_0xcf9713[_0x2721('0xd0')]=_['intersection'](_0xcf9713['model'],_0xcf9713[_0x2721('0x3d')]);_0x576cb8[_0x2721('0x43')]=_[_0x2721('0xd1')](_0xcf9713['model'],qs[_0x2721('0xd2')](_0x20718a[_0x2721('0x3d')][_0x2721('0xd2')]));_0x576cb8['attributes']=_0x576cb8[_0x2721('0x43')][_0x2721('0x63')]?_0x576cb8[_0x2721('0x43')]:_0xcf9713[_0x2721('0xce')];_0x576cb8['order']=qs[_0x2721('0xd3')](_0x20718a[_0x2721('0x3d')][_0x2721('0xd3')]);_0x576cb8['where']=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x20718a[_0x2721('0x3d')],_0xcf9713[_0x2721('0xd0')]));if(_0x20718a[_0x2721('0x3d')][_0x2721('0x36')]){_0x576cb8[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x576cb8[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x576cb8[_0x2721('0x43')],function(_0x37ad22){var _0x1cf7f4={};_0x1cf7f4[_0x37ad22]={'$like':'%'+_0x20718a[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x1cf7f4;})});}_0x576cb8=_[_0x2721('0x50')]({},_0x576cb8,_0x20718a[_0x2721('0xd6')]);switch(_0x3ff2e8[_0x2721('0x21')]){case _0x2721('0x25'):return db[_[_0x2721('0x9f')](_0x20718a[_0x2721('0x3d')][_0x2721('0x98')])+_0x2721('0xd7')]['findAll'](_0x576cb8);case'user':case _0x2721('0x28'):return _0x3ff2e8[_0x2721('0x24')+_[_0x2721('0x9f')](_0x20718a[_0x2721('0x3d')][_0x2721('0x98')])+_0x2721('0xd8')](_0x576cb8);default:throw new db[(_0x2721('0x8a'))][(_0x2721('0x8b'))](_0x2721('0xd9'));}})[_0x2721('0x20')](function(_0x2fccba){_0x494714=_0x2fccba[_0x2721('0x63')];if(!_0x20718a[_0x2721('0x3d')][_0x2721('0xc6')](_0x2721('0xda'))){_0x576cb8['limit']=qs[_0x2721('0x1b')](_0x20718a[_0x2721('0x3d')][_0x2721('0x1b')]);_0x576cb8[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x20718a[_0x2721('0x3d')][_0x2721('0x18')]);}switch(_0x3ff2e8['role']){case _0x2721('0x25'):return db[_['capitalize'](_0x20718a[_0x2721('0x3d')][_0x2721('0x98')])+_0x2721('0xd7')][_0x2721('0x45')](_0x576cb8);case'user':case _0x2721('0x28'):return _0x3ff2e8[_0x2721('0x24')+_[_0x2721('0x9f')](_0x20718a[_0x2721('0x3d')][_0x2721('0x98')])+_0x2721('0xd8')](_0x576cb8);}})[_0x2721('0x20')](function(_0x3c13b3){return{'count':_0x494714,'rows':_0x3c13b3};})['then'](respondWithResult(_0x58ba51,null))[_0x2721('0x4e')](handleError(_0x58ba51,null));};exports[_0x2721('0xdb')]=function(_0x42c6a3,_0x4126a0){var _0x221c7f={};var _0x3c04e6={};var _0x129c59;var _0x1d27a2;return db[_0x2721('0x32')]['findOne']({'where':{'id':_0x42c6a3['params']['id']}})['then'](handleEntityNotFound(_0x4126a0,null))['then'](function(_0x3c0c81){if(_0x3c0c81){_0x129c59=_0x3c0c81;_0x3c04e6[_0x2721('0xce')]=_[_0x2721('0xcf')](db['UserVoiceQueueRt'][_0x2721('0x33')]);_0x3c04e6[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x42c6a3['query']);_0x3c04e6[_0x2721('0xd0')]=_['intersection'](_0x3c04e6['model'],_0x3c04e6[_0x2721('0x3d')]);_0x221c7f['attributes']=_[_0x2721('0xd1')](_0x3c04e6['model'],qs[_0x2721('0xd2')](_0x42c6a3['query']['fields']));_0x221c7f[_0x2721('0x43')]=_0x221c7f[_0x2721('0x43')][_0x2721('0x63')]?_0x221c7f[_0x2721('0x43')]:_0x3c04e6['model'];_0x221c7f['order']=qs[_0x2721('0xd3')](_0x42c6a3[_0x2721('0x3d')][_0x2721('0xd3')]);_0x221c7f['where']=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x42c6a3[_0x2721('0x3d')],_0x3c04e6[_0x2721('0xd0')]));if(_0x42c6a3[_0x2721('0x3d')][_0x2721('0x36')]){_0x221c7f['where']=_[_0x2721('0x50')](_0x221c7f['where'],{'$or':_[_0x2721('0x2a')](_0x221c7f[_0x2721('0x43')],function(_0x466532){var _0x1f94ab={};_0x1f94ab[_0x466532]={'$like':'%'+_0x42c6a3[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x1f94ab;})});}_0x221c7f=_[_0x2721('0x50')]({},_0x221c7f,_0x42c6a3['options']);return _0x129c59[_0x2721('0xdb')](_0x221c7f);}})['then'](function(_0x267951){if(_0x267951){_0x1d27a2=_0x267951[_0x2721('0x63')];if(!_0x42c6a3[_0x2721('0x3d')][_0x2721('0xc6')]('nolimit')){_0x221c7f[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x42c6a3[_0x2721('0x3d')][_0x2721('0x1b')]);_0x221c7f[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x42c6a3[_0x2721('0x3d')][_0x2721('0x18')]);}return _0x129c59[_0x2721('0xdb')](_0x221c7f);}})[_0x2721('0x20')](function(_0x242022){if(_0x242022){return _0x242022?{'count':_0x1d27a2,'rows':_0x242022}:null;}})[_0x2721('0x20')](respondWithResult(_0x4126a0,null))[_0x2721('0x4e')](handleError(_0x4126a0,null));};exports['getGroups']=function(_0x1d3920,_0x395d9c){var _0x5473b8={};var _0x1459d9={};var _0x12359;var _0x42f7e3;return db[_0x2721('0x32')]['findOne']({'where':{'id':_0x1d3920[_0x2721('0x4f')]['id']}})['then'](handleEntityNotFound(_0x395d9c,null))[_0x2721('0x20')](function(_0x21f33f){if(_0x21f33f){_0x12359=_0x21f33f;_0x1459d9[_0x2721('0xce')]=_[_0x2721('0xcf')](db['ChatGroup'][_0x2721('0x33')]);_0x1459d9[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x1d3920[_0x2721('0x3d')]);_0x1459d9[_0x2721('0xd0')]=_[_0x2721('0xd1')](_0x1459d9[_0x2721('0xce')],_0x1459d9[_0x2721('0x3d')]);_0x5473b8[_0x2721('0x43')]=_[_0x2721('0xd1')](_0x1459d9[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x1d3920[_0x2721('0x3d')][_0x2721('0xd2')]));_0x5473b8['attributes']=_0x5473b8[_0x2721('0x43')][_0x2721('0x63')]?_0x5473b8[_0x2721('0x43')]:_0x1459d9[_0x2721('0xce')];_0x5473b8[_0x2721('0xdc')]=qs[_0x2721('0xd3')](_0x1d3920[_0x2721('0x3d')][_0x2721('0xd3')]);_0x5473b8[_0x2721('0xd5')]=qs[_0x2721('0xd0')](_['pick'](_0x1d3920[_0x2721('0x3d')],_0x1459d9[_0x2721('0xd0')]));if(_0x1d3920['query'][_0x2721('0x36')]){_0x5473b8[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x5473b8[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x5473b8[_0x2721('0x43')],function(_0x1e589f){var _0x3ffea3={};_0x3ffea3[_0x1e589f]={'$like':'%'+_0x1d3920['query']['filter']+'%'};return _0x3ffea3;})});}_0x5473b8=_[_0x2721('0x50')]({},_0x5473b8,_0x1d3920[_0x2721('0xd6')]);return _0x12359['getGroups'](_0x5473b8);}})['then'](function(_0x5f4981){if(_0x5f4981){_0x42f7e3=_0x5f4981[_0x2721('0x63')];if(!_0x1d3920[_0x2721('0x3d')][_0x2721('0xc6')](_0x2721('0xda'))){_0x5473b8[_0x2721('0x1b')]=qs['limit'](_0x1d3920[_0x2721('0x3d')][_0x2721('0x1b')]);_0x5473b8['offset']=qs[_0x2721('0x18')](_0x1d3920[_0x2721('0x3d')][_0x2721('0x18')]);}return _0x12359[_0x2721('0xdd')](_0x5473b8);}})[_0x2721('0x20')](function(_0x4722ef){if(_0x4722ef){return _0x4722ef?{'count':_0x42f7e3,'rows':_0x4722ef}:null;}})['then'](respondWithResult(_0x395d9c,null))[_0x2721('0x4e')](handleError(_0x395d9c,null));};exports[_0x2721('0xde')]=function(_0x3382fe,_0x1146c7){var _0x2549be={'raw':!![],'where':{}};var _0x14459e={};var _0x54a590={'count':0x0,'rows':[]};return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x3382fe[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x1146c7,null))[_0x2721('0x20')](function(_0x5cb212){if(_0x5cb212){_0x14459e[_0x2721('0xce')]=_[_0x2721('0xcf')](db['VoiceRecording'][_0x2721('0x33')]);_0x14459e['query']=_[_0x2721('0xcf')](_0x3382fe[_0x2721('0x3d')]);_0x14459e[_0x2721('0xd0')]=_[_0x2721('0xd1')](_0x14459e[_0x2721('0xce')],_0x14459e[_0x2721('0x3d')]);_0x2549be[_0x2721('0x43')]=_['intersection'](_0x14459e[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x3382fe[_0x2721('0x3d')][_0x2721('0xd2')]));_0x2549be[_0x2721('0x43')]=_0x2549be['attributes']['length']?_0x2549be[_0x2721('0x43')]:_0x14459e[_0x2721('0xce')];if(!_0x3382fe['query']['hasOwnProperty']('nolimit')){_0x2549be['limit']=qs[_0x2721('0x1b')](_0x3382fe['query'][_0x2721('0x1b')]);_0x2549be['offset']=qs['offset'](_0x3382fe[_0x2721('0x3d')]['offset']);}_0x2549be['order']=qs[_0x2721('0xd3')](_0x3382fe['query']['sort']);_0x2549be[_0x2721('0xd5')]=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x3382fe[_0x2721('0x3d')],_0x14459e['filters']));_0x2549be[_0x2721('0xd5')][_0x2721('0xdf')]=_0x5cb212['id'];if(_0x3382fe[_0x2721('0x3d')]['filter']){_0x2549be[_0x2721('0xd5')]=_['merge'](_0x2549be['where'],{'$or':_[_0x2721('0x2a')](_0x2549be[_0x2721('0x43')],function(_0x375e60){var _0x254f23={};_0x254f23[_0x375e60]={'$like':'%'+_0x3382fe[_0x2721('0x3d')]['filter']+'%'};return _0x254f23;})});}_0x2549be=_[_0x2721('0x50')]({},_0x2549be,_0x3382fe['options']);return db[_0x2721('0xe0')]['count']({'where':_0x2549be[_0x2721('0xd5')]})['then'](function(_0x3ea8ff){_0x54a590['count']=_0x3ea8ff;if(_0x3382fe[_0x2721('0x3d')]['includeAll']){_0x2549be['include']=[{'all':!![]}];}return db[_0x2721('0xe0')][_0x2721('0x45')](_0x2549be);})[_0x2721('0x20')](function(_0x269251){_0x54a590[_0x2721('0x47')]=_0x269251;return _0x54a590;});}})[_0x2721('0x20')](respondWithFilteredResult(_0x1146c7,_0x2549be))[_0x2721('0x4e')](handleError(_0x1146c7,null));};exports[_0x2721('0xe1')]=function(_0x4e39c5,_0x2fdbba){var _0x5db000={'raw':!![],'where':{}};var _0x2e991e={};var _0x387531={'count':0x0,'rows':[]};return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x4e39c5['params']['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x2fdbba,null))[_0x2721('0x20')](function(_0x529664){if(_0x529664){_0x2e991e['model']=_[_0x2721('0xcf')](db[_0x2721('0xe2')][_0x2721('0x33')]);_0x2e991e[_0x2721('0x3d')]=_['keys'](_0x4e39c5[_0x2721('0x3d')]);_0x2e991e['filters']=_[_0x2721('0xd1')](_0x2e991e['model'],_0x2e991e[_0x2721('0x3d')]);_0x5db000['attributes']=_[_0x2721('0xd1')](_0x2e991e[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x4e39c5[_0x2721('0x3d')][_0x2721('0xd2')]));_0x5db000['attributes']=_0x5db000['attributes'][_0x2721('0x63')]?_0x5db000[_0x2721('0x43')]:_0x2e991e[_0x2721('0xce')];if(!_0x4e39c5[_0x2721('0x3d')][_0x2721('0xc6')](_0x2721('0xda'))){_0x5db000[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x4e39c5[_0x2721('0x3d')]['limit']);_0x5db000[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x4e39c5['query'][_0x2721('0x18')]);}_0x5db000[_0x2721('0xdc')]=qs['sort'](_0x4e39c5['query'][_0x2721('0xd3')]);_0x5db000['where']=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x4e39c5[_0x2721('0x3d')],_0x2e991e['filters']));_0x5db000['where'][_0x2721('0xdf')]=_0x529664['id'];if(_0x4e39c5[_0x2721('0x3d')]['filter']){_0x5db000[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x5db000[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x5db000[_0x2721('0x43')],function(_0x334ba0){var _0x27ff7c={};_0x27ff7c[_0x334ba0]={'$like':'%'+_0x4e39c5[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x27ff7c;})});}_0x5db000=_['merge']({},_0x5db000,_0x4e39c5[_0x2721('0xd6')]);return db[_0x2721('0xe2')][_0x2721('0x1a')]({'where':_0x5db000['where']})['then'](function(_0x34e803){_0x387531['count']=_0x34e803;if(_0x4e39c5[_0x2721('0x3d')]['includeAll']){_0x5db000[_0x2721('0x3f')]=[{'all':!![]}];}return db[_0x2721('0xe2')][_0x2721('0x45')](_0x5db000);})[_0x2721('0x20')](function(_0x962ee3){_0x387531[_0x2721('0x47')]=_0x962ee3;return _0x387531;});}})[_0x2721('0x20')](respondWithFilteredResult(_0x2fdbba,_0x5db000))[_0x2721('0x4e')](handleError(_0x2fdbba,null));};exports[_0x2721('0xe3')]=function(_0xda577f,_0x30e4cf){var _0x3e5f67={};var _0x1aeba2={};var _0x2c73ba;var _0x20b25c;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0xda577f[_0x2721('0x4f')]['id']}})['then'](handleEntityNotFound(_0x30e4cf,null))[_0x2721('0x20')](function(_0x470070){if(_0x470070){_0x2c73ba=_0x470070;_0x1aeba2[_0x2721('0xce')]=_[_0x2721('0xcf')](db['ChatInteraction'][_0x2721('0x33')]);_0x1aeba2[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0xda577f['query']);_0x1aeba2[_0x2721('0xd0')]=_[_0x2721('0xd1')](_0x1aeba2[_0x2721('0xce')],_0x1aeba2['query']);_0x3e5f67[_0x2721('0x43')]=_[_0x2721('0xd1')](_0x1aeba2['model'],qs[_0x2721('0xd2')](_0xda577f[_0x2721('0x3d')][_0x2721('0xd2')]));_0x3e5f67[_0x2721('0x43')]=_0x3e5f67[_0x2721('0x43')][_0x2721('0x63')]?_0x3e5f67[_0x2721('0x43')]:_0x1aeba2[_0x2721('0xce')];_0x3e5f67[_0x2721('0xdc')]=qs[_0x2721('0xd3')](_0xda577f[_0x2721('0x3d')]['sort']);_0x3e5f67[_0x2721('0xd5')]=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0xda577f['query'],_0x1aeba2[_0x2721('0xd0')]));if(_0xda577f[_0x2721('0x3d')][_0x2721('0x36')]){_0x3e5f67[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x3e5f67[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x3e5f67[_0x2721('0x43')],function(_0x4da702){var _0x354908={};_0x354908[_0x4da702]={'$like':'%'+_0xda577f[_0x2721('0x3d')]['filter']+'%'};return _0x354908;})});}_0x3e5f67=_[_0x2721('0x50')]({},_0x3e5f67,_0xda577f[_0x2721('0xd6')]);return _0x2c73ba['getChatInteractions'](_0x3e5f67);}})[_0x2721('0x20')](function(_0x109da8){if(_0x109da8){_0x20b25c=_0x109da8[_0x2721('0x63')];if(!_0xda577f[_0x2721('0x3d')][_0x2721('0xc6')](_0x2721('0xda'))){_0x3e5f67['limit']=qs['limit'](_0xda577f['query'][_0x2721('0x1b')]);_0x3e5f67[_0x2721('0x18')]=qs[_0x2721('0x18')](_0xda577f[_0x2721('0x3d')]['offset']);}return _0x2c73ba[_0x2721('0xe3')](_0x3e5f67);}})['then'](function(_0x866ada){if(_0x866ada){return _0x866ada?{'count':_0x20b25c,'rows':_0x866ada}:null;}})['then'](respondWithResult(_0x30e4cf,null))[_0x2721('0x4e')](handleError(_0x30e4cf,null));};exports[_0x2721('0xe4')]=function(_0x114821,_0x30e179){var _0x14c135={};var _0x4b7ca6={};var _0x3deae8;var _0x5e33fe;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x114821[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x30e179,null))[_0x2721('0x20')](function(_0x52e07c){if(_0x52e07c){_0x3deae8=_0x52e07c;_0x4b7ca6['model']=_[_0x2721('0xcf')](db['OpenchannelInteraction'][_0x2721('0x33')]);_0x4b7ca6[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x114821[_0x2721('0x3d')]);_0x4b7ca6[_0x2721('0xd0')]=_[_0x2721('0xd1')](_0x4b7ca6['model'],_0x4b7ca6[_0x2721('0x3d')]);_0x14c135[_0x2721('0x43')]=_[_0x2721('0xd1')](_0x4b7ca6[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x114821['query'][_0x2721('0xd2')]));_0x14c135[_0x2721('0x43')]=_0x14c135[_0x2721('0x43')][_0x2721('0x63')]?_0x14c135[_0x2721('0x43')]:_0x4b7ca6['model'];_0x14c135['order']=qs[_0x2721('0xd3')](_0x114821[_0x2721('0x3d')][_0x2721('0xd3')]);_0x14c135[_0x2721('0xd5')]=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x114821[_0x2721('0x3d')],_0x4b7ca6[_0x2721('0xd0')]));if(_0x114821[_0x2721('0x3d')]['filter']){_0x14c135['where']=_['merge'](_0x14c135['where'],{'$or':_[_0x2721('0x2a')](_0x14c135[_0x2721('0x43')],function(_0x2a91d8){var _0x16d43f={};_0x16d43f[_0x2a91d8]={'$like':'%'+_0x114821[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x16d43f;})});}_0x14c135=_[_0x2721('0x50')]({},_0x14c135,_0x114821[_0x2721('0xd6')]);return _0x3deae8[_0x2721('0xe4')](_0x14c135);}})[_0x2721('0x20')](function(_0x111074){if(_0x111074){_0x5e33fe=_0x111074[_0x2721('0x63')];if(!_0x114821['query'][_0x2721('0xc6')]('nolimit')){_0x14c135[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x114821[_0x2721('0x3d')][_0x2721('0x1b')]);_0x14c135[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x114821[_0x2721('0x3d')][_0x2721('0x18')]);}return _0x3deae8['getOpenchannelInteractions'](_0x14c135);}})[_0x2721('0x20')](function(_0x4800a1){if(_0x4800a1){return _0x4800a1?{'count':_0x5e33fe,'rows':_0x4800a1}:null;}})['then'](respondWithResult(_0x30e179,null))['catch'](handleError(_0x30e179,null));};exports[_0x2721('0xe5')]=function(_0x3d2e80,_0x547ab0){var _0x3cb91c={'raw':!![],'where':{}};var _0x173d84={};var _0x1ea0bc={'count':0x0,'rows':[]};return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x3d2e80[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x547ab0,null))[_0x2721('0x20')](function(_0x539a71){if(_0x539a71){_0x173d84[_0x2721('0xce')]=_['keys'](db['MailInteraction'][_0x2721('0x33')]);_0x173d84['query']=_[_0x2721('0xcf')](_0x3d2e80['query']);_0x173d84[_0x2721('0xd0')]=_['intersection'](_0x173d84[_0x2721('0xce')],_0x173d84['query']);_0x3cb91c[_0x2721('0x43')]=_['intersection'](_0x173d84[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x3d2e80[_0x2721('0x3d')][_0x2721('0xd2')]));_0x3cb91c[_0x2721('0x43')]=_0x3cb91c['attributes'][_0x2721('0x63')]?_0x3cb91c[_0x2721('0x43')]:_0x173d84[_0x2721('0xce')];if(!_0x3d2e80['query'][_0x2721('0xc6')](_0x2721('0xda'))){_0x3cb91c[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x3d2e80['query'][_0x2721('0x1b')]);_0x3cb91c[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x3d2e80[_0x2721('0x3d')][_0x2721('0x18')]);}_0x3cb91c[_0x2721('0xdc')]=qs['sort'](_0x3d2e80[_0x2721('0x3d')][_0x2721('0xd3')]);_0x3cb91c[_0x2721('0xd5')]=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x3d2e80[_0x2721('0x3d')],_0x173d84['filters']));_0x3cb91c[_0x2721('0xd5')][_0x2721('0xdf')]=_0x539a71['id'];if(_0x3d2e80[_0x2721('0x3d')][_0x2721('0x36')]){_0x3cb91c[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x3cb91c['where'],{'$or':_[_0x2721('0x2a')](_0x3cb91c[_0x2721('0x43')],function(_0x1bfd98){var _0x12b60d={};_0x12b60d[_0x1bfd98]={'$like':'%'+_0x3d2e80['query']['filter']+'%'};return _0x12b60d;})});}_0x3cb91c=_[_0x2721('0x50')]({},_0x3cb91c,_0x3d2e80[_0x2721('0xd6')]);return db[_0x2721('0xe6')]['count']({'where':_0x3cb91c[_0x2721('0xd5')]})[_0x2721('0x20')](function(_0x2cb65b){_0x1ea0bc[_0x2721('0x1a')]=_0x2cb65b;if(_0x3d2e80['query'][_0x2721('0x3e')]){_0x3cb91c[_0x2721('0x3f')]=[{'all':!![]}];}return db[_0x2721('0xe6')][_0x2721('0x45')](_0x3cb91c);})[_0x2721('0x20')](function(_0x3e3f86){_0x1ea0bc['rows']=_0x3e3f86;return _0x1ea0bc;});}})['then'](respondWithFilteredResult(_0x547ab0,_0x3cb91c))[_0x2721('0x4e')](handleError(_0x547ab0,null));};exports[_0x2721('0xe7')]=function(_0x9a2b4d,_0x5e5996){var _0x3295c7={};var _0x276867={};var _0x47548b;var _0x9a4783;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x9a2b4d[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x5e5996,null))['then'](function(_0x92b0e5){if(_0x92b0e5){_0x47548b=_0x92b0e5;_0x276867[_0x2721('0xce')]=_[_0x2721('0xcf')](db[_0x2721('0xe8')]['rawAttributes']);_0x276867[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x9a2b4d['query']);_0x276867[_0x2721('0xd0')]=_[_0x2721('0xd1')](_0x276867[_0x2721('0xce')],_0x276867[_0x2721('0x3d')]);_0x3295c7['attributes']=_[_0x2721('0xd1')](_0x276867[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x9a2b4d[_0x2721('0x3d')][_0x2721('0xd2')]));_0x3295c7['attributes']=_0x3295c7['attributes'][_0x2721('0x63')]?_0x3295c7[_0x2721('0x43')]:_0x276867['model'];_0x3295c7[_0x2721('0xdc')]=qs[_0x2721('0xd3')](_0x9a2b4d[_0x2721('0x3d')]['sort']);_0x3295c7[_0x2721('0xd5')]=qs[_0x2721('0xd0')](_['pick'](_0x9a2b4d[_0x2721('0x3d')],_0x276867[_0x2721('0xd0')]));if(_0x9a2b4d['query'][_0x2721('0x36')]){_0x3295c7[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x3295c7[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x3295c7[_0x2721('0x43')],function(_0x3c3708){var _0x13f964={};_0x13f964[_0x3c3708]={'$like':'%'+_0x9a2b4d[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x13f964;})});}_0x3295c7=_[_0x2721('0x50')]({},_0x3295c7,_0x9a2b4d[_0x2721('0xd6')]);return _0x47548b['getSmsInteractions'](_0x3295c7);}})['then'](function(_0x511f57){if(_0x511f57){_0x9a4783=_0x511f57[_0x2721('0x63')];if(!_0x9a2b4d[_0x2721('0x3d')][_0x2721('0xc6')](_0x2721('0xda'))){_0x3295c7[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x9a2b4d[_0x2721('0x3d')]['limit']);_0x3295c7[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x9a2b4d[_0x2721('0x3d')][_0x2721('0x18')]);}return _0x47548b[_0x2721('0xe7')](_0x3295c7);}})['then'](function(_0xa7ddab){if(_0xa7ddab){return _0xa7ddab?{'count':_0x9a4783,'rows':_0xa7ddab}:null;}})[_0x2721('0x20')](respondWithResult(_0x5e5996,null))[_0x2721('0x4e')](handleError(_0x5e5996,null));};exports[_0x2721('0xe9')]=function(_0x54d7c6,_0x12bfaa){var _0x1275da={};var _0x5c7091={};var _0x996360;var _0x361aca;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x54d7c6[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x12bfaa,null))[_0x2721('0x20')](function(_0x51e82e){if(_0x51e82e){_0x996360=_0x51e82e;_0x5c7091['model']=_[_0x2721('0xcf')](db['FaxInteraction'][_0x2721('0x33')]);_0x5c7091['query']=_[_0x2721('0xcf')](_0x54d7c6[_0x2721('0x3d')]);_0x5c7091[_0x2721('0xd0')]=_['intersection'](_0x5c7091[_0x2721('0xce')],_0x5c7091['query']);_0x1275da['attributes']=_['intersection'](_0x5c7091[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x54d7c6['query'][_0x2721('0xd2')]));_0x1275da[_0x2721('0x43')]=_0x1275da[_0x2721('0x43')][_0x2721('0x63')]?_0x1275da[_0x2721('0x43')]:_0x5c7091[_0x2721('0xce')];_0x1275da[_0x2721('0xdc')]=qs[_0x2721('0xd3')](_0x54d7c6['query'][_0x2721('0xd3')]);_0x1275da[_0x2721('0xd5')]=qs['filters'](_['pick'](_0x54d7c6[_0x2721('0x3d')],_0x5c7091[_0x2721('0xd0')]));if(_0x54d7c6[_0x2721('0x3d')]['filter']){_0x1275da[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x1275da[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x1275da[_0x2721('0x43')],function(_0x1e0c13){var _0x4af21d={};_0x4af21d[_0x1e0c13]={'$like':'%'+_0x54d7c6[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x4af21d;})});}_0x1275da=_[_0x2721('0x50')]({},_0x1275da,_0x54d7c6[_0x2721('0xd6')]);return _0x996360[_0x2721('0xe9')](_0x1275da);}})[_0x2721('0x20')](function(_0x451a2d){if(_0x451a2d){_0x361aca=_0x451a2d['length'];if(!_0x54d7c6[_0x2721('0x3d')]['hasOwnProperty'](_0x2721('0xda'))){_0x1275da[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x54d7c6[_0x2721('0x3d')][_0x2721('0x1b')]);_0x1275da[_0x2721('0x18')]=qs['offset'](_0x54d7c6[_0x2721('0x3d')][_0x2721('0x18')]);}return _0x996360[_0x2721('0xe9')](_0x1275da);}})[_0x2721('0x20')](function(_0x4db2da){if(_0x4db2da){return _0x4db2da?{'count':_0x361aca,'rows':_0x4db2da}:null;}})[_0x2721('0x20')](respondWithResult(_0x12bfaa,null))[_0x2721('0x4e')](handleError(_0x12bfaa,null));};exports['getWhatsappInteractions']=function(_0x420a04,_0xe14a55){var _0x522c7b={};var _0x13cda6={};var _0x551f83;var _0x431dd5;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x420a04[_0x2721('0x4f')]['id']}})['then'](handleEntityNotFound(_0xe14a55,null))[_0x2721('0x20')](function(_0x45affa){if(_0x45affa){_0x551f83=_0x45affa;_0x13cda6[_0x2721('0xce')]=_[_0x2721('0xcf')](db[_0x2721('0xea')][_0x2721('0x33')]);_0x13cda6[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x420a04['query']);_0x13cda6['filters']=_[_0x2721('0xd1')](_0x13cda6[_0x2721('0xce')],_0x13cda6['query']);_0x522c7b[_0x2721('0x43')]=_['intersection'](_0x13cda6[_0x2721('0xce')],qs[_0x2721('0xd2')](_0x420a04[_0x2721('0x3d')]['fields']));_0x522c7b[_0x2721('0x43')]=_0x522c7b[_0x2721('0x43')][_0x2721('0x63')]?_0x522c7b[_0x2721('0x43')]:_0x13cda6['model'];_0x522c7b['order']=qs['sort'](_0x420a04[_0x2721('0x3d')][_0x2721('0xd3')]);_0x522c7b['where']=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x420a04[_0x2721('0x3d')],_0x13cda6[_0x2721('0xd0')]));if(_0x420a04[_0x2721('0x3d')][_0x2721('0x36')]){_0x522c7b[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x522c7b[_0x2721('0xd5')],{'$or':_['map'](_0x522c7b[_0x2721('0x43')],function(_0x57502d){var _0x197d3f={};_0x197d3f[_0x57502d]={'$like':'%'+_0x420a04['query'][_0x2721('0x36')]+'%'};return _0x197d3f;})});}_0x522c7b=_[_0x2721('0x50')]({},_0x522c7b,_0x420a04['options']);return _0x551f83[_0x2721('0xeb')](_0x522c7b);}})[_0x2721('0x20')](function(_0x26c131){if(_0x26c131){_0x431dd5=_0x26c131[_0x2721('0x63')];if(!_0x420a04[_0x2721('0x3d')][_0x2721('0xc6')](_0x2721('0xda'))){_0x522c7b['limit']=qs['limit'](_0x420a04['query'][_0x2721('0x1b')]);_0x522c7b[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x420a04['query'][_0x2721('0x18')]);}return _0x551f83[_0x2721('0xeb')](_0x522c7b);}})['then'](function(_0x55ab77){if(_0x55ab77){return _0x55ab77?{'count':_0x431dd5,'rows':_0x55ab77}:null;}})[_0x2721('0x20')](respondWithResult(_0xe14a55,null))[_0x2721('0x4e')](handleError(_0xe14a55,null));};exports[_0x2721('0xec')]=function(_0x83ec22,_0x548f13,_0x313965){var _0x5d4a4d;var _0xa53f22;var _0x5ce4e0;var _0x221df7=!_['isNil'](_0x83ec22[_0x2721('0x4f')]['id'])?_0x83ec22['params']['id']:!_[_0x2721('0x5d')](_0x83ec22[_0x2721('0x78')]['id'])?_0x83ec22[_0x2721('0x78')]['id']:null;return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x221df7,'role':{'$or':[_0x2721('0x25'),_0x2721('0x78'),'agent']}},'attributes':['id',_0x2721('0x30'),'phone',_0x2721('0xed'),_0x2721('0x21'),_0x2721('0x58'),'loginInPause']})['then'](function(_0x48a282){if(_0x48a282){if(_0x48a282[_0x2721('0x21')]===_0x2721('0x28')){_0x5d4a4d=_0x48a282;if(_0x83ec22['body']['interface']){_0x5ce4e0=util[_0x2721('0xa7')](_0x2721('0xee'),_0x5d4a4d[_0x83ec22[_0x2721('0x53')][_0x2721('0x9b')]]);}else if(_0x83ec22[_0x2721('0x53')]['intrf']){_0x5ce4e0=util[_0x2721('0xa7')](_0x2721('0xa8'),_0x83ec22['body']['intrf']);}else{_0x5ce4e0=util[_0x2721('0xa7')](_0x2721('0xa8'),_0x5d4a4d['name']);}socket['to'](util[_0x2721('0xa7')](_0x2721('0xef'),_0x5d4a4d[_0x2721('0x30')]))['emit'](_0x2721('0xf0'),{'user':{'id':_0x5d4a4d['id'],'name':_0x5d4a4d['name']},'ip':_0x83ec22[_0x2721('0xf1')][_0x2721('0xf2')]||_0x83ec22[_0x2721('0xf3')]['remoteAddress']||_0x83ec22[_0x2721('0xf4')][_0x2721('0xf5')]||_0x83ec22[_0x2721('0xf3')]['socket'][_0x2721('0xf5')]});return db[_0x2721('0xa9')]['destroy']({'where':{'membername':_0x5d4a4d[_0x2721('0x30')]},'individualHooks':!![]});}}else{throw new db[(_0x2721('0x8a'))]['ValidationError'](_0x2721('0xf6'));}})[_0x2721('0x20')](function(){if(_0x5d4a4d){return _0x5d4a4d[_0x2721('0xf7')]({'raw':!![]});}})['then'](function(_0x341cee){if(_0x5d4a4d){if(_0x341cee){_0xa53f22=_0x341cee;if(_0xa53f22[_0x2721('0x63')]){var _0x39416d=_0xa53f22[_0x2721('0x2a')](function(_0x178dc5){var _0x2168ac={'membername':_0x5d4a4d[_0x2721('0x30')],'UserId':_0x5d4a4d['id'],'queue_name':_0x178dc5[_0x2721('0x30')],'VoiceQueueId':_0x178dc5['id'],'interface':_0x5ce4e0,'paused':_0x5d4a4d[_0x2721('0xf8')]||![],'penalty':_0x178dc5[_0x2721('0xf9')]||0x0};return db[_0x2721('0xa9')][_0x2721('0xaa')](_0x2168ac);});return Promise['all'](_0x39416d);}}}})[_0x2721('0x20')](function(){if(_0x5d4a4d){return db[_0x2721('0xfa')][_0x2721('0x45')]({'where':{'membername':_0x5d4a4d[_0x2721('0x30')],'exitAt':null}});}})[_0x2721('0x20')](function(_0x406fa8){if(_0x5d4a4d){var _0xc41a56=[];_0x406fa8[_0x2721('0xfb')](function(_0xfb65c1){_0xc41a56[_0x2721('0x44')](_0xfb65c1[_0x2721('0x1f')]({'exitAt':moment()[_0x2721('0xa7')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x2721('0x4d')](_0xc41a56);}})[_0x2721('0x20')](function(){if(_0x5d4a4d){var _0x1eb13b=[];var _0x4e551b=[];var _0x2e5fa0=utils[_0x2721('0xfc')]();var _0x51f93a={'membername':_0x5d4a4d[_0x2721('0x30')],'interface':_0x5ce4e0,'enterAt':moment()['format'](_0x2721('0xfd')),'role':_0x5d4a4d[_0x2721('0x21')],'internal':_0x5d4a4d[_0x2721('0x58')]};_0x2e5fa0[_0x2721('0xfb')](function(_0x5723f9){_0x1eb13b[_0x2721('0x44')](_[_0x2721('0x50')]({'channel':_0x5723f9,'type':_0x2721('0xfe'),'data1':_0x83ec22[_0x2721('0x53')]['device'],'data2':_0x5ce4e0},_0x51f93a));if(_0x5d4a4d[_0x2721('0xf8')]){_0x4e551b[_0x2721('0x44')](_[_0x2721('0x50')]({'channel':_0x5723f9,'type':_0x2721('0xff'),'data1':_0x2721('0x100')},_0x51f93a));}});return db[_0x2721('0xfa')][_0x2721('0x83')](_0x1eb13b[_0x2721('0xc3')](_0x4e551b),{'individualHooks':!![]});}})[_0x2721('0x20')](function(){if(_0x5d4a4d){return _0x5d4a4d['update']({'online':!![],'lastLoginAt':moment()[_0x2721('0xa7')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x5d4a4d[_0x2721('0xf8')]||![],'mailPause':_0x5d4a4d[_0x2721('0xf8')]||![],'chatPause':_0x5d4a4d[_0x2721('0xf8')]||![],'faxPause':_0x5d4a4d['loginInPause']||![],'smsPause':_0x5d4a4d[_0x2721('0xf8')]||![],'openchannelPause':_0x5d4a4d[_0x2721('0xf8')]||![],'whatsappPause':_0x5d4a4d['loginInPause']||![],'pauseType':_0x5d4a4d[_0x2721('0xf8')]?_0x2721('0x100'):null,'interface':_0x5ce4e0,'lastPauseAt':moment()['format'](_0x2721('0xfd'))});}})[_0x2721('0x20')](function(_0x207142){if(_0x83ec22[_0x2721('0x101')]){return _0x313965();}else{return Promise[_0x2721('0x102')](_0x207142)[_0x2721('0x20')](respondWithResult(_0x548f13,null));}})[_0x2721('0x4e')](handleError(_0x548f13,null));};exports[_0x2721('0x103')]=function(_0x3c08c2,_0x235e72){var _0x427f86;return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x3c08c2[_0x2721('0x4f')]['id'],'role':_0x2721('0x28')},'attributes':['id','name',_0x2721('0x21')]})[_0x2721('0x20')](handleEntityNotFound(_0x235e72,null))[_0x2721('0x20')](function(_0x2ae10e){if(_0x2ae10e){_0x427f86=_0x2ae10e;return db[_0x2721('0xa9')][_0x2721('0x104')]({'where':{'membername':_0x427f86[_0x2721('0x30')]},'individualHooks':!![]});}})[_0x2721('0x20')](function(){return db[_0x2721('0xfa')][_0x2721('0x45')]({'where':{'membername':_0x427f86[_0x2721('0x30')],'exitAt':null}});})[_0x2721('0x20')](function(_0x45f049){var _0x214d85=[];_0x45f049[_0x2721('0xfb')](function(_0x136ebe){_0x214d85[_0x2721('0x44')](_0x136ebe[_0x2721('0x1f')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x2721('0x4d')](_0x214d85);})['then'](function(){return _0x427f86[_0x2721('0x1f')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x2721('0x20')](respondWithResult(_0x235e72,null))[_0x2721('0x4e')](handleError(_0x235e72,null));};exports[_0x2721('0x105')]=function(_0x5a77b4,_0x345b17){var _0x549b48;return db[_0x2721('0xa9')][_0x2721('0x1f')]({'paused':0x1},{'where':{'UserId':_0x5a77b4[_0x2721('0x4f')]['id']},'individualHooks':!![]})[_0x2721('0x20')](function(){return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0x5a77b4[_0x2721('0x4f')]['id'],'role':'agent'},'attributes':['id',_0x2721('0x30'),_0x2721('0x21'),'internal',_0x2721('0x9b'),_0x2721('0x99')]});})['then'](handleEntityNotFound(_0x345b17,null))[_0x2721('0x20')](function(_0x19b35b){if(_0x19b35b){_0x549b48=_0x19b35b;return db['MemberReport']['findAll']({'where':{'membername':_0x549b48[_0x2721('0x30')],'type':_0x2721('0xff'),'exitAt':null}});}})['then'](function(_0x2b183e){if(_0x2b183e['length']){var _0x2a1cb1=moment()[_0x2721('0xa7')](_0x2721('0xfd'));for(var _0x170855=0x0,_0x3ec4e3=_0x2b183e[_0x2721('0x63')];_0x170855<_0x3ec4e3;_0x170855++){_0x2b183e[_0x170855][_0x2721('0x106')]({'exitAt':_0x2a1cb1});}}})['then'](function(){var _0x4dddb2=[];var _0x107ee6=utils[_0x2721('0xfc')]();_0x107ee6[_0x2721('0xfb')](function(_0x2e863c){_0x4dddb2['push']({'channel':_0x2e863c,'membername':_0x549b48['name'],'interface':_[_0x2721('0x5d')](_0x549b48[_0x2721('0x9b')])?util[_0x2721('0xa7')](_0x2721('0xa8'),_0x549b48['name']):_0x549b48[_0x2721('0x9b')],'type':_0x2721('0xff'),'enterAt':moment()[_0x2721('0xa7')](_0x2721('0xfd')),'data1':_0x5a77b4[_0x2721('0x53')]['type']||_0x2721('0x107'),'role':_0x549b48[_0x2721('0x21')],'internal':_0x549b48[_0x2721('0x58')]});});return db[_0x2721('0xfa')][_0x2721('0x83')](_0x4dddb2,{'individualHooks':!![]});})['then'](function(){return _0x549b48['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x5a77b4[_0x2721('0x53')][_0x2721('0x108')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x2721('0xfd'))});})['then'](respondWithResult(_0x345b17,null))[_0x2721('0x4e')](handleError(_0x345b17,null));};exports[_0x2721('0x109')]=function(_0xe7be0,_0x57bd51){if(_0xe7be0[_0x2721('0x53')][_0x2721('0x98')]&&!utils[_0x2721('0x9c')](_0xe7be0[_0x2721('0x53')][_0x2721('0x98')])){throw new APIBadRequestError(util['format']('Channel\x20parameter\x20%s\x20is\x20invalid',_0xe7be0[_0x2721('0x53')][_0x2721('0x98')]));}return db[_0x2721('0x32')][_0x2721('0x2d')]({'where':{'id':_0xe7be0[_0x2721('0x4f')]['id']},'attributes':['id',_0x2721('0x30'),_0x2721('0x21'),_0x2721('0x58'),_0x2721('0x9b'),_0x2721('0x99'),'voicePause','mailPause',_0x2721('0x10a'),'faxPause',_0x2721('0x10b'),_0x2721('0x10c'),'whatsappPause',_0x2721('0x10d'),_0x2721('0x10e')]})[_0x2721('0x20')](function(_0x59366f){if(!_0x59366f){throw new APINotFoundError(util['format'](_0x2721('0xc5'),_0xe7be0['params']['id']));}return _0x59366f['unpause'](_0xe7be0[_0x2721('0x53')][_0x2721('0x98')]);})['then'](respondWithResult(_0x57bd51,null))[_0x2721('0x4e')](APIHandleError(_0x57bd51));};exports['getTeams']=function(_0x37d9ab,_0x24fcd8){var _0x57844b={};var _0xce5266={};var _0x5600f7;var _0x1ac42f;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x37d9ab['params']['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x24fcd8,null))[_0x2721('0x20')](function(_0x2aa554){if(_0x2aa554){_0x5600f7=_0x2aa554;_0xce5266[_0x2721('0xce')]=_[_0x2721('0xcf')](db['Team'][_0x2721('0x33')]);_0xce5266[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x37d9ab['query']);_0xce5266['filters']=_[_0x2721('0xd1')](_0xce5266[_0x2721('0xce')],_0xce5266[_0x2721('0x3d')]);_0x57844b['attributes']=_[_0x2721('0xd1')](_0xce5266[_0x2721('0xce')],qs['fields'](_0x37d9ab[_0x2721('0x3d')][_0x2721('0xd2')]));_0x57844b[_0x2721('0x43')]=_0x57844b[_0x2721('0x43')]['length']?_0x57844b[_0x2721('0x43')]:_0xce5266['model'];_0x57844b[_0x2721('0xdc')]=qs['sort'](_0x37d9ab[_0x2721('0x3d')][_0x2721('0xd3')]);_0x57844b[_0x2721('0xd5')]=qs[_0x2721('0xd0')](_['pick'](_0x37d9ab['query'],_0xce5266[_0x2721('0xd0')]));if(_0x37d9ab['query'][_0x2721('0x36')]){_0x57844b[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x57844b[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x57844b[_0x2721('0x43')],function(_0x47537e){var _0x1d9766={};_0x1d9766[_0x47537e]={'$like':'%'+_0x37d9ab[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x1d9766;})});}_0x57844b=_[_0x2721('0x50')]({},_0x57844b,_0x37d9ab[_0x2721('0xd6')]);return _0x5600f7[_0x2721('0x10f')](_0x57844b);}})[_0x2721('0x20')](function(_0x3cdbd4){if(_0x3cdbd4){_0x1ac42f=_0x3cdbd4[_0x2721('0x63')];if(!_0x37d9ab['query']['hasOwnProperty'](_0x2721('0xda'))){_0x57844b[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x37d9ab[_0x2721('0x3d')][_0x2721('0x1b')]);_0x57844b[_0x2721('0x18')]=qs['offset'](_0x37d9ab['query'][_0x2721('0x18')]);}return _0x5600f7[_0x2721('0x10f')](_0x57844b);}})['then'](function(_0x314b22){if(_0x314b22){return _0x314b22?{'count':_0x1ac42f,'rows':_0x314b22}:null;}})[_0x2721('0x20')](respondWithResult(_0x24fcd8,null))['catch'](handleError(_0x24fcd8,null));};exports[_0x2721('0x110')]=function(_0x4145e1,_0x562a15){var _0x2ac9ee=_0x4145e1[_0x2721('0x4f')]['id'];var _0x441ebd=_0x4145e1[_0x2721('0x53')]?_0x4145e1[_0x2721('0x53')][_0x2721('0x56')]:null;var _0x5395fa=[];return Promise[_0x2721('0x102')]()['then'](function(){if(!_0x441ebd)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x2721('0x20')](function(){return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x2ac9ee}});})[_0x2721('0x20')](function(_0x5b1a68){if(!_0x5b1a68)throw new APINotFoundError(util[_0x2721('0xa7')](_0x2721('0xc5'),_0x4145e1[_0x2721('0x4f')]['id']));return db[_0x2721('0x5f')][_0x2721('0x111')](function(_0x42feec){return _0x5b1a68['addTeams'](_0x441ebd,{'transaction':_0x42feec})[_0x2721('0x20')](function(){return db[_0x2721('0x112')][_0x2721('0x45')]({'where':{'id':{'$in':_0x441ebd}}});})[_0x2721('0x20')](function(_0xffc69e){var _0x3f0e34=_['map'](_0xffc69e,function(_0x5a6c0a){return _0x5a6c0a[_0x2721('0x113')]();});return Promise[_0x2721('0x4d')](_0x3f0e34);})[_0x2721('0x20')](function(_0x532115){_0x5395fa=_[_0x2721('0x114')](_0x532115);var _0x4473f2=_[_0x2721('0x2a')](_0x5395fa,function(_0x2ff95d){return _0x2ff95d[_0x2721('0x115')](_0x5b1a68['id'],{'transaction':_0x42feec});});return Promise['all'](_0x4473f2);})[_0x2721('0x20')](function(){if(!_0x5b1a68[_0x2721('0x99')])return;var _0x25bfa9=_['filter'](_0x5395fa,function(_0x298be6){return _0x298be6[_0x2721('0x116')](_0x2721('0x98'))===_0x2721('0x117');});var _0x397c3e=_[_0x2721('0x2a')](_0x25bfa9,function(_0x632941){return db[_0x2721('0xa9')]['upsert']({'membername':_0x5b1a68[_0x2721('0x30')],'UserId':_0x5b1a68['id'],'queue_name':_0x632941[_0x2721('0x30')],'VoiceQueueId':_0x632941['id'],'interface':_[_0x2721('0x5d')](_0x5b1a68[_0x2721('0x9b')])?util['format']('SIP/%s',_0x5b1a68['name']):_0x5b1a68[_0x2721('0x9b')],'paused':_0x5b1a68['voicePause']||![],'penalty':_0x5b1a68[_0x2721('0xa1')]},{'transaction':_0x42feec});});return Promise[_0x2721('0x4d')](_0x397c3e);})[_0x2721('0x20')](function(){return db[_0x2721('0x118')][_0x2721('0x45')]({'where':{'teamId':{'$in':_0x441ebd}}});})['then'](function(_0x284607){var _0x48396d=_[_0x2721('0x2a')](_0x284607,function(_0x2f0cb4){return db[_0x2721('0x119')][_0x2721('0x77')]({'UserId':_0x5b1a68['id'],'VoicePrefixId':_0x2f0cb4[_0x2721('0x11a')]},{'transaction':_0x42feec});});return Promise[_0x2721('0x4d')](_0x48396d);});});})[_0x2721('0x20')](function(){for(var _0x3feb97=0x0;_0x3feb97<_0x5395fa[_0x2721('0x63')];_0x3feb97++){var _0x32d134=_0x5395fa[_0x3feb97]['getDataValue'](_0x2721('0x98'));var _0x3059fb=_0x32d134+_0x2721('0xa3');socket['emit'](_0x2721('0x78')+_0x32d134+_0x2721('0xa4'),{'UserId':_0x2ac9ee,['queueField']:_0x5395fa[_0x3feb97]['id']});}})[_0x2721('0x20')](respondWithStatusCode(_0x562a15,null))[_0x2721('0x4e')](APIHandleError(_0x562a15));};exports[_0x2721('0x11b')]=function(_0xe975e4,_0x2aab05){var _0x199fa7=_0xe975e4[_0x2721('0x4f')]['id'];var _0x3da200=null;if(_0xe975e4['query'][_0x2721('0x56')]){_0x3da200=_[_0x2721('0xac')](_0xe975e4[_0x2721('0x3d')][_0x2721('0x56')])?_0xe975e4[_0x2721('0x3d')]['ids']:[_0xe975e4[_0x2721('0x3d')]['ids']];}var _0x54c4f4=[];return Promise[_0x2721('0x102')]()[_0x2721('0x20')](function(){if(!_0x3da200)throw new APIBadRequestError(_0x2721('0x11c'));})['then'](function(){return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x199fa7}});})[_0x2721('0x20')](function(_0x1f0861){if(!_0x1f0861)throw new APINotFoundError(util[_0x2721('0xa7')]('User\x20with\x20id\x20%s\x20not\x20found',_0xe975e4[_0x2721('0x4f')]['id']));return db[_0x2721('0x5f')][_0x2721('0x111')](function(_0xa93c29){return _0x1f0861['removeTeams'](_0x3da200,{'transaction':_0xa93c29})[_0x2721('0x20')](function(){return db[_0x2721('0x112')][_0x2721('0x45')]({'where':{'id':{'$in':_0x3da200}}});})['then'](function(_0x43f4b5){var _0x3d7401=_[_0x2721('0x2a')](_0x43f4b5,function(_0x5d4c04){return _0x5d4c04[_0x2721('0x113')]();});return Promise['all'](_0x3d7401);})['then'](function(_0x7125c0){_0x54c4f4=_[_0x2721('0x114')](_0x7125c0);var _0x4fb951=_[_0x2721('0x2a')](_0x54c4f4,function(_0x5d02c1){return _0x5d02c1[_0x2721('0x11d')](_0x1f0861['id'],{'transaction':_0xa93c29});});return Promise[_0x2721('0x4d')](_0x4fb951);})[_0x2721('0x20')](function(){if(!_0x1f0861['online'])return;var _0x4c064b=_['filter'](_0x54c4f4,function(_0x3c1628){return _0x3c1628[_0x2721('0x116')]('channel')===_0x2721('0x117');});var _0x4c2034=_[_0x2721('0x2a')](_0x4c064b,function(_0x1cc2f2){return db[_0x2721('0xa9')][_0x2721('0x104')]({'where':{'VoiceQueueId':_0x1cc2f2['id'],'UserId':_0x1f0861['id']},'transaction':_0xa93c29});});return Promise[_0x2721('0x4d')](_0x4c2034);})[_0x2721('0x20')](function(){return db[_0x2721('0x118')][_0x2721('0x45')]({'where':{'teamId':{'$in':_0x3da200}}});})[_0x2721('0x20')](function(_0x4660d6){var _0x40e62c=_[_0x2721('0x2a')](_0x4660d6,function(_0x1d9594){return db[_0x2721('0x119')]['destroy']({'where':{'UserId':_0x1f0861['id'],'VoicePrefixId':_0x1d9594[_0x2721('0x11a')]}},{'transaction':_0xa93c29});});return Promise[_0x2721('0x4d')](_0x40e62c);});});})[_0x2721('0x20')](function(){for(var _0x1623ec=0x0;_0x1623ec<_0x54c4f4[_0x2721('0x63')];_0x1623ec++){var _0x2b0634=_0x54c4f4[_0x1623ec]['getDataValue']('channel');var _0x251296=_0x2b0634+'QueueId';socket[_0x2721('0x22')](_0x2721('0x78')+_0x2b0634+_0x2721('0xad'),{'UserId':_0x199fa7,['queueField']:_0x54c4f4[_0x1623ec]['id']});}})['then'](respondWithStatusCode(_0x2aab05,null))[_0x2721('0x4e')](APIHandleError(_0x2aab05));};exports[_0x2721('0x11e')]=function(_0x397bee,_0x11b083){var _0x218152={};var _0x10b5f8={};var _0x42c889;var _0x56ec00;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x397bee[_0x2721('0x4f')]['id']}})['then'](handleEntityNotFound(_0x11b083,null))['then'](function(_0x438d6b){if(_0x438d6b){_0x42c889=_0x438d6b;_0x10b5f8['model']=_[_0x2721('0xcf')](db[_0x2721('0xc7')][_0x2721('0x33')]);_0x10b5f8[_0x2721('0x3d')]=_[_0x2721('0xcf')](_0x397bee[_0x2721('0x3d')]);_0x10b5f8[_0x2721('0xd0')]=_[_0x2721('0xd1')](_0x10b5f8[_0x2721('0xce')],_0x10b5f8[_0x2721('0x3d')]);_0x218152['attributes']=_[_0x2721('0xd1')](_0x10b5f8[_0x2721('0xce')],qs['fields'](_0x397bee[_0x2721('0x3d')][_0x2721('0xd2')]));_0x218152[_0x2721('0x43')]=_0x218152[_0x2721('0x43')]['length']?_0x218152[_0x2721('0x43')]:_0x10b5f8['model'];_0x218152[_0x2721('0xdc')]=qs[_0x2721('0xd3')](_0x397bee['query'][_0x2721('0xd3')]);_0x218152[_0x2721('0xd5')]=qs['filters'](_['pick'](_0x397bee[_0x2721('0x3d')],_0x10b5f8[_0x2721('0xd0')]));if(_0x397bee[_0x2721('0x3d')][_0x2721('0x36')]){_0x218152[_0x2721('0xd5')]=_[_0x2721('0x50')](_0x218152[_0x2721('0xd5')],{'$or':_[_0x2721('0x2a')](_0x218152['attributes'],function(_0x296a9c){var _0x53488d={};_0x53488d[_0x296a9c]={'$like':'%'+_0x397bee[_0x2721('0x3d')][_0x2721('0x36')]+'%'};return _0x53488d;})});}_0x218152=_[_0x2721('0x50')]({},_0x218152,_0x397bee[_0x2721('0xd6')]);return _0x42c889[_0x2721('0x11e')](_0x218152);}})[_0x2721('0x20')](function(_0x215395){if(_0x215395){_0x56ec00=_0x215395['length'];if(!_0x397bee[_0x2721('0x3d')][_0x2721('0xc6')]('nolimit')){_0x218152[_0x2721('0x1b')]=qs[_0x2721('0x1b')](_0x397bee[_0x2721('0x3d')][_0x2721('0x1b')]);_0x218152[_0x2721('0x18')]=qs[_0x2721('0x18')](_0x397bee[_0x2721('0x3d')][_0x2721('0x18')]);}return _0x42c889[_0x2721('0x11e')](_0x218152);}})[_0x2721('0x20')](function(_0x7b527b){if(_0x7b527b){return _0x7b527b?{'count':_0x56ec00,'rows':_0x7b527b}:null;}})[_0x2721('0x20')](respondWithResult(_0x11b083,null))[_0x2721('0x4e')](handleError(_0x11b083,null));};exports[_0x2721('0x11f')]=function(_0x1b4285,_0x1f05f0){var _0x30f16f={};var _0x5f306b={};var _0x316472;return db[_0x2721('0x32')][_0x2721('0x92')]({'where':{'id':_0x1b4285[_0x2721('0x4f')]['id']}})[_0x2721('0x20')](handleEntityNotFound(_0x1f05f0,null))[_0x2721('0x20')](function(_0x4ed80e){if(_0x4ed80e){_0x316472=_0x4ed80e;_0x5f306b[_0x2721('0xce')]=_['keys'](db[_0x2721('0x32')][_0x2721('0x33')]);_0x5f306b[_0x2721('0x3d')]=_['keys'](_0x1b4285[_0x2721('0x3d')]);_0x5f306b['filters']=_[_0x2721('0xd1')](_0x5f306b[_0x2721('0xce')],_0x5f306b[_0x2721('0x3d')]);_0x30f16f[_0x2721('0x43')]=_[_0x2721('0xd1')](_0x5f306b[_0x2721('0xce')],qs['fields'](_0x1b4285[_0x2721('0x3d')][_0x2721('0xd2')]));_0x30f16f[_0x2721('0x43')]=_0x30f16f[_0x2721('0x43')][_0x2721('0x63')]?_0x30f16f[_0x2721('0x43')]:_0x5f306b[_0x2721('0xce')];_0x30f16f['order']=qs['sort'](_0x1b4285[_0x2721('0x3d')][_0x2721('0xd3')]);_0x30f16f['where']=qs[_0x2721('0xd0')](_[_0x2721('0xd4')](_0x1b4285['query'],_0x5f306b[_0x2721('0xd0')]));if(_0x1b4285[_0x2721('0x3d')][_0x2721('0x36')]){_0x30f16f[_0x2721('0xd5')]=_['merge'](_0x30f16f['where'],{'$or':_[_0x2721('0x2a')](_0x30f16f['attributes'],function(_0x25f6d4){var _0x5ad928={};_0x5ad928[_0x25f6d4]={'$like':'%'+_0x1b4285['query'][_0x2721('0x36')]+'%'};return _0x5ad928;})});}_0x30f16f[_0x2721('0xce')]=db[_0x2721('0x32')];_0x30f16f['as']=_0x2721('0x27');_0x30f16f=_[_0x2721('0x50')]({},_0x30f16f,_0x1b4285[_0x2721('0xd6')]);return _0x316472[_0x2721('0xf7')]({'include':[_0x30f16f]});}})[_0x2721('0x20')](function(_0x33f86a){if(_0x33f86a){var _0x7aac26={},_0x20bd86=[];for(var _0x558720=0x0;_0x558720<_0x33f86a[_0x2721('0x63')];_0x558720+=0x1){for(var _0x4ff388=0x0,_0x5105dc;_0x4ff388<_0x33f86a[_0x558720][_0x2721('0x27')][_0x2721('0x63')];_0x4ff388+=0x1){_0x5105dc=_0x33f86a[_0x558720][_0x2721('0x27')][_0x4ff388][_0x2721('0x24')]({'plain':!![]});_0x7aac26[_0x5105dc['id']]=_0x5105dc;}}_0x7aac26=_[_0x2721('0x120')](_0x7aac26);for(var _0x467e50=qs[_0x2721('0x18')](_0x1b4285[_0x2721('0x3d')][_0x2721('0x18')]);_0x467e50<_0x7aac26['length']&&_0x20bd86[_0x2721('0x63')]=_0x288860[_0xc24a('0x48')]){throw new Error(_0xc24a('0x49'));}})[_0xc24a('0x1e')](function(){if(_0x2bd261){return db[_0xc24a('0x40')]['destroy']({'where':{'membername':_0x2bd261[_0xc24a('0x1f')]},'individualHooks':!![]});}})[_0xc24a('0x1e')](function(){if(_0x2bd261){return _0x2bd261[_0xc24a('0x4a')]({'raw':!![]});}})[_0xc24a('0x1e')](function(_0x4045b3){if(_0x2bd261){if(_0x4045b3){var _0x109498=[];_0x1422d2=_0x4045b3;if(_0x1422d2['length']){for(var _0x250e0d=0x0;_0x250e0d<_0x1422d2[_0xc24a('0x25')];_0x250e0d++){_0x109498[_0xc24a('0x28')](db['UserVoiceQueueRt'][_0xc24a('0x4b')]({'membername':_0x2bd261[_0xc24a('0x1f')],'UserId':_0x2bd261['id'],'queue_name':_0x1422d2[_0x250e0d][_0xc24a('0x1f')],'VoiceQueueId':_0x1422d2[_0x250e0d]['id'],'interface':_0x2d1dfb,'paused':_0x2bd261[_0xc24a('0x45')]||![],'penalty':_0x1422d2[_0x250e0d][_0xc24a('0x4c')]||0x0}));}return BPromise[_0xc24a('0x4d')](_0x109498);}}}})['then'](function(){if(_0x2bd261){return db[_0xc24a('0x24')][_0xc24a('0xd')]({'where':{'membername':_0x2bd261[_0xc24a('0x1f')],'exitAt':null}});}})[_0xc24a('0x1e')](function(_0x37cfd6){if(_0x2bd261){if(_0x37cfd6&&_0x37cfd6[_0xc24a('0x25')]){var _0x1f7e93=[];_0x37cfd6[_0xc24a('0x42')](function(_0x4333bf){_0x1f7e93['push'](_0x4333bf[_0xc24a('0x23')]({'exitAt':moment()[_0xc24a('0x21')](_0xc24a('0x26'))}));});return BPromise[_0xc24a('0x4d')](_0x1f7e93);}}})[_0xc24a('0x1e')](function(){if(_0x2bd261){var _0x223672=[];var _0x32bcf6=[];var _0x5a8774=utils[_0xc24a('0x4e')]();var _0x4d53a7={'membername':_0x2bd261[_0xc24a('0x1f')],'interface':_0x2d1dfb,'enterAt':moment()[_0xc24a('0x21')](_0xc24a('0x26')),'role':_0x2bd261['role'],'internal':_0x2bd261['internal']};_0x5a8774['forEach'](function(_0x1bd5a3){_0x223672[_0xc24a('0x28')](_[_0xc24a('0x4f')]({'channel':_0x1bd5a3,'type':_0xc24a('0x50'),'data1':_0xc24a('0x51'),'data2':_0x2d1dfb},_0x4d53a7));if(_0x2bd261[_0xc24a('0x45')]){_0x32bcf6['push'](_['merge']({'channel':_0x1bd5a3,'type':'PAUSE','data1':_0xc24a('0x52')},_0x4d53a7));}});return db[_0xc24a('0x24')][_0xc24a('0x2f')](_0x223672[_0xc24a('0x53')](_0x32bcf6),{'individualHooks':!![]});}})[_0xc24a('0x1e')](function(){if(_0x2bd261){return _0x2bd261['update']({'online':!![],'lastLoginAt':moment()[_0xc24a('0x21')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x2bd261['loginInPause']||![],'mailPause':_0x2bd261['loginInPause']||![],'chatPause':_0x2bd261[_0xc24a('0x45')]||![],'faxPause':_0x2bd261[_0xc24a('0x45')]||![],'smsPause':_0x2bd261[_0xc24a('0x45')]||![],'openchannelPause':_0x2bd261['loginInPause']||![],'pauseType':_0x2bd261[_0xc24a('0x45')]?_0xc24a('0x52'):null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x2d1dfb});}})[_0xc24a('0x1e')](function(_0x41bf21){_0x53ad0c(_0x41bf21);})[_0xc24a('0x19')](function(_0x4c817f){_0x3d7a73(_0x12bbb1[_0xc24a('0x1a')](0x1f4,_0x4c817f['message']));});});}; \ No newline at end of file +var _0xed77=['map','model','attributes','then','info','GetUser','debug','stringify','catch','error','message','find','ShowUser','PauseUser','where','role','internal','interface','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','name','length','updateAttributes','getChannels','forEach','push','isNil','PAUSE','body','type','DEFAULT\x20PAUSE','bulkCreate','YYYY-MM-DD\x20HH:mm:ss','UnpauseUser','resolve','channel','isValidChannel','Channel\x20parameter\x20%s\x20is\x20invalid','online','voicePause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','system','LogoutUser','findOne','destroy','findAll','all','LoginUser','phone','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./user.socket','User','options','raw','limit','include'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0xed77,0xa0));var _0x7ed7=function(_0x1f1e49,_0x3786b4){_0x1f1e49=_0x1f1e49-0x0;var _0x4b0f23=_0xed77[_0x1f1e49];return _0x4b0f23;};'use strict';var _=require(_0x7ed7('0x0'));var util=require(_0x7ed7('0x1'));var moment=require(_0x7ed7('0x2'));var BPromise=require(_0x7ed7('0x3'));var Redis=require(_0x7ed7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7ed7('0x5'))(_0x7ed7('0x6'));var config=require(_0x7ed7('0x7'));config[_0x7ed7('0x8')]=_[_0x7ed7('0x9')](config[_0x7ed7('0x8')],{'host':_0x7ed7('0xa'),'port':0x18eb});var socket=require(_0x7ed7('0xb'))(new Redis(config['redis']));require(_0x7ed7('0xc'))['register'](socket);exports['GetUser']=function(_0x424663){var _0x28ed1a=this;return new Promise(function(_0xc551b5,_0x413047){return db[_0x7ed7('0xd')]['findAll']({'raw':_0x424663[_0x7ed7('0xe')]?_0x424663[_0x7ed7('0xe')][_0x7ed7('0xf')]===undefined?!![]:![]:!![],'where':_0x424663[_0x7ed7('0xe')]?_0x424663[_0x7ed7('0xe')]['where']||null:null,'attributes':_0x424663[_0x7ed7('0xe')]?_0x424663[_0x7ed7('0xe')]['attributes']||null:null,'limit':_0x424663['options']?_0x424663[_0x7ed7('0xe')][_0x7ed7('0x10')]||null:null,'include':_0x424663[_0x7ed7('0xe')]?_0x424663['options'][_0x7ed7('0x11')]?_[_0x7ed7('0x12')](_0x424663['options']['include'],function(_0x2852eb){return{'model':db[_0x2852eb[_0x7ed7('0x13')]],'as':_0x2852eb['as'],'attributes':_0x2852eb[_0x7ed7('0x14')],'include':_0x2852eb[_0x7ed7('0x11')]?_[_0x7ed7('0x12')](_0x2852eb[_0x7ed7('0x11')],function(_0x16181f){return{'model':db[_0x16181f[_0x7ed7('0x13')]],'as':_0x16181f['as'],'attributes':_0x16181f[_0x7ed7('0x14')],'include':_0x16181f['include']?_[_0x7ed7('0x12')](_0x16181f[_0x7ed7('0x11')],function(_0x2b62eb){return{'model':db[_0x2b62eb[_0x7ed7('0x13')]],'as':_0x2b62eb['as'],'attributes':_0x2b62eb[_0x7ed7('0x14')]};}):[]};}):[]};}):[]:[]})[_0x7ed7('0x15')](function(_0x5a9c6b){logger[_0x7ed7('0x16')](_0x7ed7('0x17'),_0x424663);logger[_0x7ed7('0x18')]('GetUser',_0x424663,JSON[_0x7ed7('0x19')](_0x5a9c6b));_0xc551b5(_0x5a9c6b);})[_0x7ed7('0x1a')](function(_0xeae78e){logger[_0x7ed7('0x1b')]('GetUser',_0xeae78e[_0x7ed7('0x1c')],_0x424663);_0x413047(_0x28ed1a[_0x7ed7('0x1b')](0x1f4,_0xeae78e[_0x7ed7('0x1c')]));});});};exports['ShowUser']=function(_0x26f33e){var _0x488b08=this;return new Promise(function(_0x3d7163,_0x133399){return db[_0x7ed7('0xd')][_0x7ed7('0x1d')]({'raw':_0x26f33e[_0x7ed7('0xe')]?_0x26f33e[_0x7ed7('0xe')]['raw']===undefined?!![]:![]:!![],'where':_0x26f33e[_0x7ed7('0xe')]?_0x26f33e[_0x7ed7('0xe')]['where']||null:null,'attributes':_0x26f33e[_0x7ed7('0xe')]?_0x26f33e[_0x7ed7('0xe')][_0x7ed7('0x14')]||null:null,'include':_0x26f33e[_0x7ed7('0xe')]?_0x26f33e[_0x7ed7('0xe')]['include']?_['map'](_0x26f33e[_0x7ed7('0xe')]['include'],function(_0x2992d2){return{'model':db[_0x2992d2[_0x7ed7('0x13')]],'as':_0x2992d2['as'],'attributes':_0x2992d2[_0x7ed7('0x14')],'include':_0x2992d2[_0x7ed7('0x11')]?_['map'](_0x2992d2[_0x7ed7('0x11')],function(_0x185c6a){return{'model':db[_0x185c6a[_0x7ed7('0x13')]],'as':_0x185c6a['as'],'attributes':_0x185c6a['attributes'],'include':_0x185c6a[_0x7ed7('0x11')]?_[_0x7ed7('0x12')](_0x185c6a[_0x7ed7('0x11')],function(_0x2f8515){return{'model':db[_0x2f8515[_0x7ed7('0x13')]],'as':_0x2f8515['as'],'attributes':_0x2f8515[_0x7ed7('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b7310){logger[_0x7ed7('0x16')](_0x7ed7('0x1e'),_0x26f33e);logger[_0x7ed7('0x18')](_0x7ed7('0x1e'),_0x26f33e,JSON[_0x7ed7('0x19')](_0x4b7310));_0x3d7163(_0x4b7310);})[_0x7ed7('0x1a')](function(_0x373336){logger[_0x7ed7('0x1b')](_0x7ed7('0x1e'),_0x373336[_0x7ed7('0x1c')],_0x26f33e);_0x133399(_0x488b08[_0x7ed7('0x1b')](0x1f4,_0x373336[_0x7ed7('0x1c')]));});});};exports[_0x7ed7('0x1f')]=function(_0xb3073f){var _0x2f819f;return db[_0x7ed7('0xd')][_0x7ed7('0x1d')]({'where':_0xb3073f[_0x7ed7('0xe')][_0x7ed7('0x20')]||{},'attributes':['id','name',_0x7ed7('0x21'),_0x7ed7('0x22'),_0x7ed7('0x23')]})[_0x7ed7('0x15')](function(_0x45bc75){if(!_0x45bc75){throw new Error(util[_0x7ed7('0x24')](_0x7ed7('0x25'),_0xb3073f[_0x7ed7('0x26')]['id']));}_0x2f819f=_0x45bc75;return db[_0x7ed7('0x27')][_0x7ed7('0x28')]({'paused':0x1},{'where':{'UserId':_0x2f819f['id']},'individualHooks':!![]});})['then'](function(){return db[_0x7ed7('0x29')]['findAll']({'where':{'membername':_0x2f819f[_0x7ed7('0x2a')],'type':'PAUSE','exitAt':null}});})[_0x7ed7('0x15')](function(_0x175433){if(_0x175433&&_0x175433[_0x7ed7('0x2b')]){var _0x667ccd=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4e2c0e=0x0,_0xc92a52=_0x175433[_0x7ed7('0x2b')];_0x4e2c0e<_0xc92a52;_0x4e2c0e++){_0x175433[_0x4e2c0e][_0x7ed7('0x2c')]({'exitAt':_0x667ccd});}}})[_0x7ed7('0x15')](function(){var _0x59d53e=[];var _0x474872=utils[_0x7ed7('0x2d')]();_0x474872[_0x7ed7('0x2e')](function(_0x568206){_0x59d53e[_0x7ed7('0x2f')]({'channel':_0x568206,'membername':_0x2f819f['name'],'interface':_[_0x7ed7('0x30')](_0x2f819f[_0x7ed7('0x23')])?util['format']('SIP/%s',_0x2f819f[_0x7ed7('0x2a')]):_0x2f819f[_0x7ed7('0x23')],'type':_0x7ed7('0x31'),'enterAt':moment()[_0x7ed7('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xb3073f[_0x7ed7('0x32')][_0x7ed7('0x33')]||_0x7ed7('0x34'),'role':_0x2f819f[_0x7ed7('0x21')],'internal':_0x2f819f['internal'],'uniqueid':_0xb3073f[_0x7ed7('0x32')]['uniqueid']||null});});return db[_0x7ed7('0x29')][_0x7ed7('0x35')](_0x59d53e,{'individualHooks':!![]});})['then'](function(){return _0x2f819f['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0xb3073f[_0x7ed7('0x32')][_0x7ed7('0x33')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x7ed7('0x24')](_0x7ed7('0x36'))});})[_0x7ed7('0x1a')](function(_0x3ee267){throw _0x3ee267;});};exports[_0x7ed7('0x37')]=function(_0x5b53da){return Promise[_0x7ed7('0x38')]()['then'](function(){if(_0x5b53da['body'][_0x7ed7('0x39')]&&!utils[_0x7ed7('0x3a')](_0x5b53da['body'][_0x7ed7('0x39')])){throw new Error(util[_0x7ed7('0x24')](_0x7ed7('0x3b'),_0x5b53da[_0x7ed7('0x32')][_0x7ed7('0x39')]));}return db[_0x7ed7('0xd')]['findOne']({'where':_0x5b53da['options'][_0x7ed7('0x20')]||{},'attributes':['id',_0x7ed7('0x2a'),_0x7ed7('0x21'),'internal','interface',_0x7ed7('0x3c'),_0x7ed7('0x3d'),'mailPause','chatPause',_0x7ed7('0x3e'),_0x7ed7('0x3f'),_0x7ed7('0x40'),_0x7ed7('0x41'),_0x7ed7('0x42'),_0x7ed7('0x43')]});})['then'](function(_0x334bb5){if(!_0x334bb5){throw new Error(util[_0x7ed7('0x24')]('User\x20with\x20id\x20%s\x20not\x20found',_0x5b53da[_0x7ed7('0x26')]['id']));}return _0x334bb5['unpause'](_0x5b53da[_0x7ed7('0x32')][_0x7ed7('0x39')],_0x7ed7('0x44'));})[_0x7ed7('0x1a')](function(_0x13a2bb){throw _0x13a2bb;});};exports[_0x7ed7('0x45')]=function(_0x18ff3){var _0x1b1658=this;return new Promise(function(_0x4b29c2,_0x1b8243){var _0x49f2e7;return db[_0x7ed7('0xd')][_0x7ed7('0x46')]({'where':_0x18ff3[_0x7ed7('0xe')][_0x7ed7('0x20')]||{},'attributes':['id',_0x7ed7('0x2a')]})[_0x7ed7('0x15')](function(_0x373a66){if(_0x373a66){_0x49f2e7=_0x373a66;return db[_0x7ed7('0x27')][_0x7ed7('0x47')]({'where':{'membername':_0x49f2e7[_0x7ed7('0x2a')]},'individualHooks':!![]});}})[_0x7ed7('0x15')](function(){if(_0x49f2e7){return db[_0x7ed7('0x29')][_0x7ed7('0x48')]({'where':{'membername':_0x49f2e7[_0x7ed7('0x2a')],'exitAt':null}});}})['then'](function(_0xe006cd){if(_0x49f2e7){if(_0xe006cd&&_0xe006cd['length']){var _0x4fd001=[];_0xe006cd[_0x7ed7('0x2e')](function(_0x5b74ed){_0x4fd001[_0x7ed7('0x2f')](_0x5b74ed[_0x7ed7('0x28')]({'exitAt':moment()[_0x7ed7('0x24')](_0x7ed7('0x36'))}));});return BPromise[_0x7ed7('0x49')](_0x4fd001);}}})[_0x7ed7('0x15')](function(){if(_0x49f2e7){return _0x49f2e7[_0x7ed7('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x7ed7('0x15')](function(_0x2fe22f){_0x4b29c2(_0x2fe22f);})['catch'](function(_0xda6e75){_0x1b8243(_0x1b1658[_0x7ed7('0x1b')](0x1f4,_0xda6e75[_0x7ed7('0x1c')]));});});};exports[_0x7ed7('0x4a')]=function(_0x34b4e5){var _0x4350b1=this;return new Promise(function(_0x45161d,_0x3f1280){var _0x573e5c;var _0x1925dd;var _0x17d98b;var _0x50f6eb;return db[_0x7ed7('0xd')][_0x7ed7('0x46')]({'where':_0x34b4e5[_0x7ed7('0xe')]['where']||{},'attributes':['id',_0x7ed7('0x2a'),_0x7ed7('0x21'),'mobile',_0x7ed7('0x4b'),'internal',_0x7ed7('0x4c'),_0x7ed7('0x23')]})[_0x7ed7('0x15')](function(_0x2212c6){if(_0x2212c6){_0x573e5c=_0x2212c6;_0x50f6eb=_0x34b4e5[_0x7ed7('0x32')][_0x7ed7('0x23')]?_0x34b4e5['body']['interface']:util[_0x7ed7('0x24')]('SIP/%s',_0x573e5c[_0x7ed7('0x2a')]);return db[_0x7ed7('0xd')][_0x7ed7('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x573e5c['id']}}});}})[_0x7ed7('0x15')](function(_0x3730e0){if(_0x3730e0){_0x17d98b=_0x3730e0;return require(_0x7ed7('0x4e'))[_0x7ed7('0x4f')]();}})[_0x7ed7('0x15')](function(_0x29de95){if(_0x29de95&&_0x29de95[_0x7ed7('0x50')]&&_0x17d98b>=_0x29de95[_0x7ed7('0x50')]){throw new Error(_0x7ed7('0x51'));}})[_0x7ed7('0x15')](function(){if(_0x573e5c){return db[_0x7ed7('0x27')][_0x7ed7('0x47')]({'where':{'membername':_0x573e5c[_0x7ed7('0x2a')]},'individualHooks':!![]});}})[_0x7ed7('0x15')](function(){if(_0x573e5c){return _0x573e5c[_0x7ed7('0x52')]({'raw':!![]});}})[_0x7ed7('0x15')](function(_0x46ef21){if(_0x573e5c){if(_0x46ef21){var _0x39bc5a=[];_0x1925dd=_0x46ef21;if(_0x1925dd['length']){for(var _0x3f5627=0x0;_0x3f5627<_0x1925dd['length'];_0x3f5627++){_0x39bc5a[_0x7ed7('0x2f')](db[_0x7ed7('0x27')][_0x7ed7('0x53')]({'membername':_0x573e5c[_0x7ed7('0x2a')],'UserId':_0x573e5c['id'],'queue_name':_0x1925dd[_0x3f5627][_0x7ed7('0x2a')],'VoiceQueueId':_0x1925dd[_0x3f5627]['id'],'interface':_0x50f6eb,'paused':_0x573e5c[_0x7ed7('0x4c')]||![],'penalty':_0x1925dd[_0x3f5627][_0x7ed7('0x54')]||0x0}));}return BPromise[_0x7ed7('0x49')](_0x39bc5a);}}}})[_0x7ed7('0x15')](function(){if(_0x573e5c){return db[_0x7ed7('0x29')][_0x7ed7('0x48')]({'where':{'membername':_0x573e5c[_0x7ed7('0x2a')],'exitAt':null}});}})[_0x7ed7('0x15')](function(_0x60a65e){if(_0x573e5c){if(_0x60a65e&&_0x60a65e[_0x7ed7('0x2b')]){var _0x5b6a15=[];_0x60a65e['forEach'](function(_0x5348dc){_0x5b6a15[_0x7ed7('0x2f')](_0x5348dc[_0x7ed7('0x28')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7ed7('0x49')](_0x5b6a15);}}})[_0x7ed7('0x15')](function(){if(_0x573e5c){var _0x123fd3=[];var _0x2c8333=[];var _0x177ff3=utils[_0x7ed7('0x2d')]();var _0x1d9eb2={'membername':_0x573e5c[_0x7ed7('0x2a')],'interface':_0x50f6eb,'enterAt':moment()[_0x7ed7('0x24')](_0x7ed7('0x36')),'role':_0x573e5c['role'],'internal':_0x573e5c[_0x7ed7('0x22')]};_0x177ff3[_0x7ed7('0x2e')](function(_0x1049f2){_0x123fd3[_0x7ed7('0x2f')](_['merge']({'channel':_0x1049f2,'type':_0x7ed7('0x55'),'data1':_0x7ed7('0x56'),'data2':_0x50f6eb},_0x1d9eb2));if(_0x573e5c[_0x7ed7('0x4c')]){_0x2c8333[_0x7ed7('0x2f')](_['merge']({'channel':_0x1049f2,'type':_0x7ed7('0x31'),'data1':_0x7ed7('0x57')},_0x1d9eb2));}});return db[_0x7ed7('0x29')]['bulkCreate'](_0x123fd3[_0x7ed7('0x58')](_0x2c8333),{'individualHooks':!![]});}})[_0x7ed7('0x15')](function(){if(_0x573e5c){return _0x573e5c[_0x7ed7('0x28')]({'online':!![],'lastLoginAt':moment()[_0x7ed7('0x24')](_0x7ed7('0x36')),'voicePause':_0x573e5c[_0x7ed7('0x4c')]||![],'mailPause':_0x573e5c['loginInPause']||![],'chatPause':_0x573e5c[_0x7ed7('0x4c')]||![],'faxPause':_0x573e5c[_0x7ed7('0x4c')]||![],'smsPause':_0x573e5c[_0x7ed7('0x4c')]||![],'openchannelPause':_0x573e5c[_0x7ed7('0x4c')]||![],'pauseType':_0x573e5c[_0x7ed7('0x4c')]?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x7ed7('0x24')](_0x7ed7('0x36')),'interface':_0x50f6eb});}})['then'](function(_0x543d1b){_0x45161d(_0x543d1b);})['catch'](function(_0x2345b6){_0x3f1280(_0x4350b1[_0x7ed7('0x1b')](0x1f4,_0x2345b6['message']));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index fbdd824..30ef52f 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 _0x9bf3=['length','user:','save','remove','update','emit','register'];(function(_0x5484ff,_0x14a683){var _0x899860=function(_0x5e3124){while(--_0x5e3124){_0x5484ff['push'](_0x5484ff['shift']());}};_0x899860(++_0x14a683);}(_0x9bf3,0x6b));var _0x39bf=function(_0x4ac424,_0x554b5d){_0x4ac424=_0x4ac424-0x0;var _0xe1b890=_0x9bf3[_0x4ac424];return _0xe1b890;};'use strict';var UserEvents=require('./user.events');var events=[_0x39bf('0x0'),_0x39bf('0x1'),_0x39bf('0x2')];function createListener(_0x25b452,_0xc715a6){return function(_0x3f3303){_0xc715a6[_0x39bf('0x3')](_0x25b452,_0x3f3303);};}function removeListener(_0x3b8f8f,_0x21d467){return function(){UserEvents['removeListener'](_0x3b8f8f,_0x21d467);};}exports[_0x39bf('0x4')]=function(_0x2e7290){for(var _0x522ba0=0x0,_0x11dc45=events[_0x39bf('0x5')];_0x522ba0<_0x11dc45;_0x522ba0++){var _0x24017c=events[_0x522ba0];var _0x444f3b=createListener(_0x39bf('0x6')+_0x24017c,_0x2e7290);UserEvents['on'](_0x24017c,_0x444f3b);}}; \ No newline at end of file +var _0x0ed1=['user:','./user.events','remove','update','emit','removeListener','length'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x0ed1,0x6a));var _0x10ed=function(_0x49c851,_0x2a79b0){_0x49c851=_0x49c851-0x0;var _0x598351=_0x0ed1[_0x49c851];return _0x598351;};'use strict';var UserEvents=require(_0x10ed('0x0'));var events=['save',_0x10ed('0x1'),_0x10ed('0x2')];function createListener(_0x186aef,_0x1b74f8){return function(_0xd005f6){_0x1b74f8[_0x10ed('0x3')](_0x186aef,_0xd005f6);};}function removeListener(_0x4528d3,_0x54ba40){return function(){UserEvents[_0x10ed('0x4')](_0x4528d3,_0x54ba40);};}exports['register']=function(_0x40626e){for(var _0x53d523=0x0,_0x44cdde=events[_0x10ed('0x5')];_0x53d523<_0x44cdde;_0x53d523++){var _0x1ff5b6=events[_0x53d523];var _0x17de4f=createListener(_0x10ed('0x6')+_0x1ff5b6,_0x40626e);UserEvents['on'](_0x1ff5b6,_0x17de4f);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index beef95c..d3163ac 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x6c6d75,_0xef7deb){var _0x48a161=function(_0xf0fba0){while(--_0xf0fba0){_0x6c6d75['push'](_0x6c6d75['shift']());}};_0x48a161(++_0xef7deb);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x27c71f,_0xcfc791){var _0x244214=function(_0x436eac){while(--_0x436eac){_0x27c71f['push'](_0x27c71f['shift']());}};_0x244214(++_0xcfc791);}(_0xe706,0xa3));var _0x6e70=function(_0x134b6e,_0x21b5ca){_0x134b6e=_0x134b6e-0x0;var _0x2229a9=_0xe706[_0x134b6e];return _0x2229a9;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 11e3c0f..8c47c9f 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 _0xaa90=['sequelize','exports','INTEGER'];(function(_0xf8f75,_0x21f39c){var _0x3ee326=function(_0x40b59b){while(--_0x40b59b){_0xf8f75['push'](_0xf8f75['shift']());}};_0x3ee326(++_0x21f39c);}(_0xaa90,0x90));var _0x0aa9=function(_0x5d5cc4,_0x3afa99){_0x5d5cc4=_0x5d5cc4-0x0;var _0x28caff=_0xaa90[_0x5d5cc4];return _0x28caff;};'use strict';var Sequelize=require(_0x0aa9('0x0'));module[_0x0aa9('0x1')]={'penalty':{'type':Sequelize[_0x0aa9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7ca5=['INTEGER','exports'];(function(_0x401676,_0x3f1436){var _0x4f13fe=function(_0xd2f197){while(--_0xd2f197){_0x401676['push'](_0x401676['shift']());}};_0x4f13fe(++_0x3f1436);}(_0x7ca5,0x11d));var _0x57ca=function(_0x47b52d,_0x4c4ffe){_0x47b52d=_0x47b52d-0x0;var _0x42d925=_0x7ca5[_0x47b52d];return _0x42d925;};'use strict';var Sequelize=require('sequelize');module[_0x57ca('0x0')]={'penalty':{'type':Sequelize[_0x57ca('0x1')],'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 c47f66b..5cf7c93 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 _0x7f48=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./userChatQueue.attributes','exports','define','UserChatQueue'];(function(_0x575584,_0x149395){var _0x120d12=function(_0x32c3f6){while(--_0x32c3f6){_0x575584['push'](_0x575584['shift']());}};_0x120d12(++_0x149395);}(_0x7f48,0xb4));var _0x87f4=function(_0x4953da,_0x5adaca){_0x4953da=_0x4953da-0x0;var _0x2d3780=_0x7f48[_0x4953da];return _0x2d3780;};'use strict';var _=require(_0x87f4('0x0'));var util=require(_0x87f4('0x1'));var logger=require(_0x87f4('0x2'))(_0x87f4('0x3'));var moment=require('moment');var BPromise=require(_0x87f4('0x4'));var rp=require(_0x87f4('0x5'));var fs=require('fs');var path=require(_0x87f4('0x6'));var rimraf=require(_0x87f4('0x7'));var config=require('../../config/environment');var attributes=require(_0x87f4('0x8'));module[_0x87f4('0x9')]=function(_0x18f130,_0x2f5cbd){return _0x18f130[_0x87f4('0xa')](_0x87f4('0xb'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa6d=['../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','util','api','moment','rimraf'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xaa6d,0x1e6));var _0xdaa6=function(_0x2295c0,_0x41320b){_0x2295c0=_0x2295c0-0x0;var _0x39cc13=_0xaa6d[_0x2295c0];return _0x39cc13;};'use strict';var _=require('lodash');var util=require(_0xdaa6('0x0'));var logger=require('../../config/logger')(_0xdaa6('0x1'));var moment=require(_0xdaa6('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdaa6('0x3'));var config=require(_0xdaa6('0x4'));var attributes=require(_0xdaa6('0x5'));module[_0xdaa6('0x6')]=function(_0x3fa606,_0x24b194){return _0x3fa606[_0xdaa6('0x7')](_0xdaa6('0x8'),attributes,{'tableName':_0xdaa6('0x9'),'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 d3c7ced..40b170f 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 _0xc02f=['then','info','debug','request\x20sent','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xc02f,0x1bf));var _0xfc02=function(_0x171f63,_0x7d7c3e){_0x171f63=_0x171f63-0x0;var _0x2d80e8=_0xc02f[_0x171f63];return _0x2d80e8;};'use strict';var _=require('lodash');var util=require(_0xfc02('0x0'));var moment=require(_0xfc02('0x1'));var BPromise=require(_0xfc02('0x2'));var rs=require(_0xfc02('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc02('0x4'))['db'];var utils=require(_0xfc02('0x5'));var logger=require(_0xfc02('0x6'))(_0xfc02('0x7'));var config=require(_0xfc02('0x8'));var jayson=require(_0xfc02('0x9'));var client=jayson[_0xfc02('0xa')][_0xfc02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16a27b,_0x56e1c9,_0x1a96c6){return new BPromise(function(_0x11c53a,_0x4a3c03){return client[_0xfc02('0xc')](_0x16a27b,_0x1a96c6)[_0xfc02('0xd')](function(_0x40e7f7){logger[_0xfc02('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x56e1c9,'request\x20sent');logger[_0xfc02('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x56e1c9,_0xfc02('0x10'),JSON['stringify'](_0x40e7f7));if(_0x40e7f7[_0xfc02('0x11')]){if(_0x40e7f7['error'][_0xfc02('0x12')]===0x1f4){logger['error'](_0xfc02('0x13'),_0x56e1c9,_0x40e7f7[_0xfc02('0x11')][_0xfc02('0x14')]);return _0x4a3c03(_0x40e7f7[_0xfc02('0x11')][_0xfc02('0x14')]);}logger['error'](_0xfc02('0x13'),_0x56e1c9,_0x40e7f7['error'][_0xfc02('0x14')]);return _0x11c53a(_0x40e7f7[_0xfc02('0x11')]['message']);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x56e1c9,_0xfc02('0x10'));_0x11c53a(_0x40e7f7[_0xfc02('0x15')][_0xfc02('0x14')]);}})[_0xfc02('0x16')](function(_0x324f9d){logger[_0xfc02('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x56e1c9,_0x324f9d);_0x4a3c03(_0x324f9d);});});} \ No newline at end of file +var _0xedf8=['message','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','request','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserChatQueue,\x20%s,\x20%s','result'];(function(_0xa822a0,_0x38e2cc){var _0xaf7e66=function(_0x349fce){while(--_0x349fce){_0xa822a0['push'](_0xa822a0['shift']());}};_0xaf7e66(++_0x38e2cc);}(_0xedf8,0x133));var _0x8edf=function(_0x801aa1,_0x3bf51f){_0x801aa1=_0x801aa1-0x0;var _0xa142c1=_0xedf8[_0x801aa1];return _0xa142c1;};'use strict';var _=require(_0x8edf('0x0'));var util=require('util');var moment=require(_0x8edf('0x1'));var BPromise=require(_0x8edf('0x2'));var rs=require(_0x8edf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8edf('0x4'));var logger=require(_0x8edf('0x5'))(_0x8edf('0x6'));var config=require(_0x8edf('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x442951,_0x5df678,_0x396afe){return new BPromise(function(_0xc542e6,_0x7b483a){return client[_0x8edf('0x8')](_0x442951,_0x396afe)['then'](function(_0x4775bc){logger[_0x8edf('0x9')]('UserChatQueue,\x20%s,\x20%s',_0x5df678,_0x8edf('0xa'));logger[_0x8edf('0xb')](_0x8edf('0xc'),_0x5df678,'request\x20sent',JSON[_0x8edf('0xd')](_0x4775bc));if(_0x4775bc[_0x8edf('0xe')]){if(_0x4775bc[_0x8edf('0xe')]['code']===0x1f4){logger['error'](_0x8edf('0xf'),_0x5df678,_0x4775bc[_0x8edf('0xe')]['message']);return _0x7b483a(_0x4775bc[_0x8edf('0xe')]['message']);}logger[_0x8edf('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x5df678,_0x4775bc[_0x8edf('0xe')]['message']);return _0xc542e6(_0x4775bc['error']['message']);}else{logger[_0x8edf('0x9')](_0x8edf('0xf'),_0x5df678,_0x8edf('0xa'));_0xc542e6(_0x4775bc[_0x8edf('0x10')][_0x8edf('0x11')]);}})['catch'](function(_0x3c6e8f){logger[_0x8edf('0xe')](_0x8edf('0xf'),_0x5df678,_0x3c6e8f);_0x7b483a(_0x3c6e8f);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index eccb7e2..16080bd 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x133e8d,_0x4648f1){var _0x10ce55=function(_0x13e8bd){while(--_0x13e8bd){_0x133e8d['push'](_0x133e8d['shift']());}};_0x10ce55(++_0x4648f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x11522a,_0x597470){var _0x4890de=function(_0x1a3411){while(--_0x1a3411){_0x11522a['push'](_0x11522a['shift']());}};_0x4890de(++_0x597470);}(_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/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index f91141b..486e0bf 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 _0x3547=['INTEGER','exports'];(function(_0xf29c7b,_0x1286c2){var _0x4e51ae=function(_0x42d00c){while(--_0x42d00c){_0xf29c7b['push'](_0xf29c7b['shift']());}};_0x4e51ae(++_0x1286c2);}(_0x3547,0x111));var _0x7354=function(_0x561b60,_0x40dc04){_0x561b60=_0x561b60-0x0;var _0x279a6d=_0x3547[_0x561b60];return _0x279a6d;};'use strict';var Sequelize=require('sequelize');module[_0x7354('0x0')]={'penalty':{'type':Sequelize[_0x7354('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xcaef=['STRING','exports','INTEGER'];(function(_0x141609,_0x18557b){var _0x283526=function(_0xa81165){while(--_0xa81165){_0x141609['push'](_0x141609['shift']());}};_0x283526(++_0x18557b);}(_0xcaef,0x91));var _0xfcae=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0xcaef[_0x20a558];return _0x53d3f7;};'use strict';var Sequelize=require('sequelize');module[_0xfcae('0x0')]={'penalty':{'type':Sequelize[_0xfcae('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xfcae('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xfcae('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index c52c983..66e60bd 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 _0xd0eb=['UserFaxQueue','lodash','util','moment','bluebird','path','rimraf','./userFaxQueue.attributes','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd0eb,0xb5));var _0xbd0e=function(_0x456b57,_0x58691a){_0x456b57=_0x456b57-0x0;var _0x18f49f=_0xd0eb[_0x456b57];return _0x18f49f;};'use strict';var _=require(_0xbd0e('0x0'));var util=require(_0xbd0e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbd0e('0x2'));var BPromise=require(_0xbd0e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd0e('0x4'));var rimraf=require(_0xbd0e('0x5'));var config=require('../../config/environment');var attributes=require(_0xbd0e('0x6'));module['exports']=function(_0xed5e4,_0x3f91af){return _0xed5e4[_0xbd0e('0x7')](_0xbd0e('0x8'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55de=['rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x55de,0x1ab));var _0xe55d=function(_0x431f0f,_0x263b3c){_0x431f0f=_0x431f0f-0x0;var _0x334a40=_0x55de[_0x431f0f];return _0x334a40;};'use strict';var _=require(_0xe55d('0x0'));var util=require(_0xe55d('0x1'));var logger=require(_0xe55d('0x2'))(_0xe55d('0x3'));var moment=require('moment');var BPromise=require(_0xe55d('0x4'));var rp=require(_0xe55d('0x5'));var fs=require('fs');var path=require(_0xe55d('0x6'));var rimraf=require(_0xe55d('0x7'));var config=require(_0xe55d('0x8'));var attributes=require(_0xe55d('0x9'));module[_0xe55d('0xa')]=function(_0x4afc3a,_0x558a15){return _0x4afc3a[_0xe55d('0xb')](_0xe55d('0xc'),attributes,{'tableName':_0xe55d('0xd'),'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 e1882db..4762228 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 _0xcbf8=['UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x145a46,_0x22b851){var _0x47b921=function(_0x5ad33e){while(--_0x5ad33e){_0x145a46['push'](_0x145a46['shift']());}};_0x47b921(++_0x22b851);}(_0xcbf8,0x12c));var _0x8cbf=function(_0x3f5108,_0x2e7ae5){_0x3f5108=_0x3f5108-0x0;var _0x3898ca=_0xcbf8[_0x3f5108];return _0x3898ca;};'use strict';var _=require(_0x8cbf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8cbf('0x1'));var db=require(_0x8cbf('0x2'))['db'];var utils=require(_0x8cbf('0x3'));var logger=require(_0x8cbf('0x4'))(_0x8cbf('0x5'));var config=require(_0x8cbf('0x6'));var jayson=require(_0x8cbf('0x7'));var client=jayson[_0x8cbf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc76051,_0x890caf,_0x476ae0){return new BPromise(function(_0x143788,_0x98dc01){return client[_0x8cbf('0x9')](_0xc76051,_0x476ae0)[_0x8cbf('0xa')](function(_0x14b5c9){logger[_0x8cbf('0xb')](_0x8cbf('0xc'),_0x890caf,_0x8cbf('0xd'));logger[_0x8cbf('0xe')](_0x8cbf('0xf'),_0x890caf,_0x8cbf('0xd'),JSON[_0x8cbf('0x10')](_0x14b5c9));if(_0x14b5c9[_0x8cbf('0x11')]){if(_0x14b5c9[_0x8cbf('0x11')][_0x8cbf('0x12')]===0x1f4){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x890caf,_0x14b5c9[_0x8cbf('0x11')][_0x8cbf('0x13')]);return _0x98dc01(_0x14b5c9['error'][_0x8cbf('0x13')]);}logger[_0x8cbf('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x890caf,_0x14b5c9['error']['message']);return _0x143788(_0x14b5c9[_0x8cbf('0x11')]['message']);}else{logger[_0x8cbf('0xb')]('UserFaxQueue,\x20%s,\x20%s',_0x890caf,_0x8cbf('0xd'));_0x143788(_0x14b5c9[_0x8cbf('0x14')][_0x8cbf('0x13')]);}})['catch'](function(_0x5000d0){logger[_0x8cbf('0x11')](_0x8cbf('0xc'),_0x890caf,_0x5000d0);_0x98dc01(_0x5000d0);});});} \ No newline at end of file +var _0xa6b5=['jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x507c4b,_0x36cc1a){var _0x1b8bb6=function(_0x5aa094){while(--_0x5aa094){_0x507c4b['push'](_0x507c4b['shift']());}};_0x1b8bb6(++_0x36cc1a);}(_0xa6b5,0x87));var _0x5a6b=function(_0xbe0d57,_0x18baa6){_0xbe0d57=_0xbe0d57-0x0;var _0x2c7ae4=_0xa6b5[_0xbe0d57];return _0x2c7ae4;};'use strict';var _=require(_0x5a6b('0x0'));var util=require(_0x5a6b('0x1'));var moment=require(_0x5a6b('0x2'));var BPromise=require(_0x5a6b('0x3'));var rs=require(_0x5a6b('0x4'));var fs=require('fs');var Redis=require(_0x5a6b('0x5'));var db=require(_0x5a6b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5a6b('0x7'))('rpc');var config=require(_0x5a6b('0x8'));var jayson=require(_0x5a6b('0x9'));var client=jayson[_0x5a6b('0xa')][_0x5a6b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44a0c8,_0x17237d,_0x377309){return new BPromise(function(_0x2d3188,_0x4ccc08){return client[_0x5a6b('0xc')](_0x44a0c8,_0x377309)[_0x5a6b('0xd')](function(_0xf9eb6a){logger[_0x5a6b('0xe')](_0x5a6b('0xf'),_0x17237d,_0x5a6b('0x10'));logger[_0x5a6b('0x11')](_0x5a6b('0x12'),_0x17237d,_0x5a6b('0x10'),JSON[_0x5a6b('0x13')](_0xf9eb6a));if(_0xf9eb6a[_0x5a6b('0x14')]){if(_0xf9eb6a[_0x5a6b('0x14')]['code']===0x1f4){logger[_0x5a6b('0x14')](_0x5a6b('0xf'),_0x17237d,_0xf9eb6a[_0x5a6b('0x14')][_0x5a6b('0x15')]);return _0x4ccc08(_0xf9eb6a[_0x5a6b('0x14')][_0x5a6b('0x15')]);}logger[_0x5a6b('0x14')](_0x5a6b('0xf'),_0x17237d,_0xf9eb6a[_0x5a6b('0x14')]['message']);return _0x2d3188(_0xf9eb6a[_0x5a6b('0x14')][_0x5a6b('0x15')]);}else{logger[_0x5a6b('0xe')]('UserFaxQueue,\x20%s,\x20%s',_0x17237d,_0x5a6b('0x10'));_0x2d3188(_0xf9eb6a[_0x5a6b('0x16')][_0x5a6b('0x15')]);}})[_0x5a6b('0x17')](function(_0x2ca2ba){logger[_0x5a6b('0x14')](_0x5a6b('0xf'),_0x17237d,_0x2ca2ba);_0x4ccc08(_0x2ca2ba);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 8a9f292..fb9cd60 100644 --- a/server/api/userMailQueue/index.js +++ b/server/api/userMailQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x431d94,_0x1ef420){var _0x51900c=function(_0x27cd95){while(--_0x27cd95){_0x431d94['push'](_0x431d94['shift']());}};_0x51900c(++_0x1ef420);}(_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(_0x28d6c2,_0x274201){var _0x11d770=function(_0x5a636c){while(--_0x5a636c){_0x28d6c2['push'](_0x28d6c2['shift']());}};_0x11d770(++_0x274201);}(_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 082309c..271f848 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 _0xf101=['exports'];(function(_0x244594,_0x362955){var _0x12765d=function(_0x4361d5){while(--_0x4361d5){_0x244594['push'](_0x244594['shift']());}};_0x12765d(++_0x362955);}(_0xf101,0x12a));var _0x1f10=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0xf101[_0x3c22e0];return _0x215811;};'use strict';var Sequelize=require('sequelize');module[_0x1f10('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5d01=['INTEGER','sequelize'];(function(_0x5c9983,_0x21b64b){var _0x19e1bd=function(_0x34dff7){while(--_0x34dff7){_0x5c9983['push'](_0x5c9983['shift']());}};_0x19e1bd(++_0x21b64b);}(_0x5d01,0xe5));var _0x15d0=function(_0x14ccbb,_0x46308e){_0x14ccbb=_0x14ccbb-0x0;var _0x36b134=_0x5d01[_0x14ccbb];return _0x36b134;};'use strict';var Sequelize=require(_0x15d0('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x15d0('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 5e32e9e..21e3750 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 _0x7292=['util','../../config/logger','bluebird','request-promise','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0x7292,0x118));var _0x2729=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x7292[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0x2729('0x0'));var logger=require(_0x2729('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2729('0x2'));var rp=require(_0x2729('0x3'));var fs=require('fs');var path=require(_0x2729('0x4'));var rimraf=require('rimraf');var config=require(_0x2729('0x5'));var attributes=require(_0x2729('0x6'));module['exports']=function(_0x3427f3,_0x422288){return _0x3427f3[_0x2729('0x7')](_0x2729('0x8'),attributes,{'tableName':_0x2729('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa400=['UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports','define'];(function(_0x586805,_0x1ead6c){var _0x2f29f5=function(_0x708eb4){while(--_0x708eb4){_0x586805['push'](_0x586805['shift']());}};_0x2f29f5(++_0x1ead6c);}(_0xa400,0x11a));var _0x0a40=function(_0x58f113,_0x252744){_0x58f113=_0x58f113-0x0;var _0x4fcc6a=_0xa400[_0x58f113];return _0x4fcc6a;};'use strict';var _=require(_0x0a40('0x0'));var util=require(_0x0a40('0x1'));var logger=require('../../config/logger')(_0x0a40('0x2'));var moment=require(_0x0a40('0x3'));var BPromise=require(_0x0a40('0x4'));var rp=require(_0x0a40('0x5'));var fs=require('fs');var path=require(_0x0a40('0x6'));var rimraf=require(_0x0a40('0x7'));var config=require(_0x0a40('0x8'));var attributes=require(_0x0a40('0x9'));module[_0x0a40('0xa')]=function(_0x25b53c,_0x331bd4){return _0x25b53c[_0x0a40('0xb')](_0x0a40('0xc'),attributes,{'tableName':_0x0a40('0xd'),'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 19f1659..e6f2ca2 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x315593,_0x36bf6f){var _0x3a070a=function(_0x3d3991){while(--_0x3d3991){_0x315593['push'](_0x315593['shift']());}};_0x3a070a(++_0x36bf6f);}(_0xa41a,0x6b));var _0xaa41=function(_0x563138,_0x33aa03){_0x563138=_0x563138-0x0;var _0x5758da=_0xa41a[_0x563138];return _0x5758da;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x36ebfc,_0x52766f){var _0x729269=function(_0xffb1b9){while(--_0xffb1b9){_0x36ebfc['push'](_0x36ebfc['shift']());}};_0x729269(++_0x52766f);}(_0xa41a,0x6b));var _0xaa41=function(_0x1fd723,_0x1811b0){_0x1fd723=_0x1fd723-0x0;var _0x72bb0f=_0xa41a[_0x1fd723];return _0x72bb0f;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 7ebf12c..a77d2a9 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 _0xd132=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports','multer','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd132,0x76));var _0x2d13=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd132[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x2d13('0x0'));var util=require(_0x2d13('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2d13('0x2')]();var fs_extra=require(_0x2d13('0x3'));var auth=require(_0x2d13('0x4'));var interaction=require(_0x2d13('0x5'));var config=require(_0x2d13('0x6'));var controller=require(_0x2d13('0x7'));router[_0x2d13('0x8')]('/',auth[_0x2d13('0x9')](),controller[_0x2d13('0xa')]);module[_0x2d13('0xb')]=router; \ No newline at end of file +var _0x1808=['exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated'];(function(_0x4c7fb5,_0x2548ef){var _0x2e10ac=function(_0xf7e27c){while(--_0xf7e27c){_0x4c7fb5['push'](_0x4c7fb5['shift']());}};_0x2e10ac(++_0x2548ef);}(_0x1808,0xf1));var _0x8180=function(_0x23b946,_0x2653e1){_0x23b946=_0x23b946-0x0;var _0xcfad4f=_0x1808[_0x23b946];return _0xcfad4f;};'use strict';var multer=require('multer');var util=require(_0x8180('0x0'));var path=require('path');var timeout=require(_0x8180('0x1'));var express=require(_0x8180('0x2'));var router=express[_0x8180('0x3')]();var fs_extra=require(_0x8180('0x4'));var auth=require(_0x8180('0x5'));var interaction=require(_0x8180('0x6'));var config=require(_0x8180('0x7'));var controller=require(_0x8180('0x8'));router[_0x8180('0x9')]('/',auth[_0x8180('0xa')](),controller['sendUserNotification']);module[_0x8180('0xb')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 3777f3f..e6bc857 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 _0xfcec=['BOOLEAN','exports','TEXT','STRING'];(function(_0x58a0f2,_0xda36f5){var _0x590bb=function(_0x10553b){while(--_0x10553b){_0x58a0f2['push'](_0x58a0f2['shift']());}};_0x590bb(++_0xda36f5);}(_0xfcec,0x139));var _0xcfce=function(_0x15a346,_0x46d825){_0x15a346=_0x15a346-0x0;var _0x275a0f=_0xfcec[_0x15a346];return _0x275a0f;};'use strict';var Sequelize=require('sequelize');module[_0xcfce('0x0')]={'body':{'type':Sequelize[_0xcfce('0x1')]},'senderName':{'type':Sequelize[_0xcfce('0x2')]},'recipientsId':{'type':Sequelize[_0xcfce('0x1')]},'recipientsDescription':{'type':Sequelize[_0xcfce('0x2')]},'beep':{'type':Sequelize[_0xcfce('0x3')]}}; \ No newline at end of file +var _0x46ba=['sequelize','exports','STRING','TEXT'];(function(_0x6dbd7e,_0x541122){var _0x2cb261=function(_0x58f1ee){while(--_0x58f1ee){_0x6dbd7e['push'](_0x6dbd7e['shift']());}};_0x2cb261(++_0x541122);}(_0x46ba,0x118));var _0xa46b=function(_0x504760,_0x263cf5){_0x504760=_0x504760-0x0;var _0x5b132c=_0x46ba[_0x504760];return _0x5b132c;};'use strict';var Sequelize=require(_0xa46b('0x0'));module[_0xa46b('0x1')]={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0xa46b('0x2')]},'recipientsId':{'type':Sequelize[_0xa46b('0x3')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e27378a..7bc6ec3 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 _0xf8c0=['Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sequelize','transaction','UserNotification','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','User','union','ids','queue','replace','Queue','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userNotification.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','then','destroy','error','name','send','sendUserNotification','body','text','Sequelize','ValidationError','hasOwnProperty','TemplateId','view','Missing\x20\x27view\x27\x20parameter','recipients'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf8c0,0x1cb));var _0x0f8c=function(_0x5af59e,_0x3771c1){_0x5af59e=_0x5af59e-0x0;var _0x4240df=_0xf8c0[_0x5af59e];return _0x4240df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0f8c('0x0'));var zipdir=require(_0x0f8c('0x1'));var jsonpatch=require(_0x0f8c('0x2'));var rp=require(_0x0f8c('0x3'));var moment=require(_0x0f8c('0x4'));var BPromise=require(_0x0f8c('0x5'));var Mustache=require(_0x0f8c('0x6'));var util=require(_0x0f8c('0x7'));var path=require('path');var sox=require(_0x0f8c('0x8'));var csv=require(_0x0f8c('0x9'));var ejs=require(_0x0f8c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f8c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0f8c('0xc'));var deskjs=require(_0x0f8c('0xd'));var toCsv=require(_0x0f8c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0f8c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0f8c('0xf'));var as=require(_0x0f8c('0x10'));var hardwareService=require(_0x0f8c('0x11'));var logger=require(_0x0f8c('0x12'))(_0x0f8c('0x13'));var utils=require(_0x0f8c('0x14'));var config=require(_0x0f8c('0x15'));var licenseUtil=require(_0x0f8c('0x16'));var db=require(_0x0f8c('0x17'))['db'];config[_0x0f8c('0x18')]=_[_0x0f8c('0x19')](config[_0x0f8c('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0f8c('0x18')]));require(_0x0f8c('0x1a'))[_0x0f8c('0x1b')](socket);function respondWithStatusCode(_0x58dce0,_0xbc585c){_0xbc585c=_0xbc585c||0xcc;return function(_0x4919bb){if(_0x4919bb){return _0x58dce0[_0x0f8c('0x1c')](_0xbc585c);}return _0x58dce0[_0x0f8c('0x1d')](_0xbc585c)[_0x0f8c('0x1e')]();};}function respondWithResult(_0x41d503,_0xa232ae){_0xa232ae=_0xa232ae||0xc8;return function(_0x5d9d9e){if(_0x5d9d9e){return _0x41d503[_0x0f8c('0x1d')](_0xa232ae)['json'](_0x5d9d9e);}};}function respondWithFilteredResult(_0x57e8c8,_0x2a1c3e){return function(_0x35280b){if(_0x35280b){var _0x217210=typeof _0x2a1c3e[_0x0f8c('0x1f')]==='undefined'&&typeof _0x2a1c3e[_0x0f8c('0x20')]===_0x0f8c('0x21');var _0x5a0ae5=_0x35280b[_0x0f8c('0x22')];var _0x13a357=_0x217210?0x0:_0x2a1c3e[_0x0f8c('0x1f')];var _0x26d178=_0x217210?_0x35280b[_0x0f8c('0x22')]:_0x2a1c3e[_0x0f8c('0x1f')]+_0x2a1c3e[_0x0f8c('0x20')];var _0x5d302e;if(_0x26d178>=_0x5a0ae5){_0x26d178=_0x5a0ae5;_0x5d302e=0xc8;}else{_0x5d302e=0xce;}_0x57e8c8[_0x0f8c('0x1d')](_0x5d302e);return _0x57e8c8[_0x0f8c('0x23')](_0x0f8c('0x24'),_0x13a357+'-'+_0x26d178+'/'+_0x5a0ae5)[_0x0f8c('0x25')](_0x35280b);}return null;};}function patchUpdates(_0x301a65){return function(_0x6b6bc){try{jsonpatch[_0x0f8c('0x26')](_0x6b6bc,_0x301a65,!![]);}catch(_0x53de7a){return BPromise[_0x0f8c('0x27')](_0x53de7a);}return _0x6b6bc['save']();};}function saveUpdates(_0x537615,_0x3784bb){return function(_0x4bcf75){if(_0x4bcf75){return _0x4bcf75[_0x0f8c('0x28')](_0x537615)[_0x0f8c('0x29')](function(_0x5cbfff){return _0x5cbfff;});}return null;};}function removeEntity(_0x11f2b8,_0x200fde){return function(_0x36f28d){if(_0x36f28d){return _0x36f28d[_0x0f8c('0x2a')]()['then'](function(){_0x11f2b8[_0x0f8c('0x1d')](0xcc)[_0x0f8c('0x1e')]();});}};}function handleEntityNotFound(_0x5839a6,_0x864a08){return function(_0x2ff929){if(!_0x2ff929){_0x5839a6[_0x0f8c('0x1c')](0x194);}return _0x2ff929;};}function handleError(_0x13054d,_0x3f8317){_0x3f8317=_0x3f8317||0x1f4;return function(_0x148dc0){logger[_0x0f8c('0x2b')](_0x148dc0['stack']);if(_0x148dc0[_0x0f8c('0x2c')]){delete _0x148dc0[_0x0f8c('0x2c')];}_0x13054d[_0x0f8c('0x1d')](_0x3f8317)[_0x0f8c('0x2d')](_0x148dc0);};}exports[_0x0f8c('0x2e')]=function(_0x24306d,_0x3115ed,_0x2ad728){if(!_0x24306d[_0x0f8c('0x2f')]['hasOwnProperty'](_0x0f8c('0x30'))&&!_0x24306d[_0x0f8c('0x2f')]['hasOwnProperty']('TemplateId')){throw new db[(_0x0f8c('0x31'))][(_0x0f8c('0x32'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x24306d['body'][_0x0f8c('0x33')](_0x0f8c('0x34'))&&!_0x24306d[_0x0f8c('0x2f')][_0x0f8c('0x33')](_0x0f8c('0x35'))){throw new db[(_0x0f8c('0x31'))][(_0x0f8c('0x32'))](_0x0f8c('0x36'));}if(!_0x24306d['body'][_0x0f8c('0x33')](_0x0f8c('0x37'))){throw new db[(_0x0f8c('0x31'))][(_0x0f8c('0x32'))](_0x0f8c('0x38'));}else{try{var _0x8c4dc8=JSON[_0x0f8c('0x39')](_0x24306d['body'][_0x0f8c('0x37')]);}catch(_0x451f43){logger['error'](_0x451f43);throw new db['Sequelize'][(_0x0f8c('0x32'))](_0x0f8c('0x3a'));}var _0x37c343=[_0x0f8c('0x3b'),_0x0f8c('0x3c'),_0x0f8c('0x3d'),_0x0f8c('0x3e'),_0x0f8c('0x3f'),_0x0f8c('0x40'),_0x0f8c('0x41'),_0x0f8c('0x42'),_0x0f8c('0x43')];if(_[_0x0f8c('0x44')](_0x8c4dc8,function(_0x273163){return!_[_0x0f8c('0x45')](_0x37c343,_0x273163[_0x0f8c('0x46')][_0x0f8c('0x47')]());})){throw new db['Sequelize'][(_0x0f8c('0x32'))](_0x0f8c('0x48'));}}}var _0x2025fd={};_0x2025fd[_0x0f8c('0x49')]=_0x24306d[_0x0f8c('0x2f')][_0x0f8c('0x33')]('senderName')?_0x24306d[_0x0f8c('0x2f')][_0x0f8c('0x49')]:_0x24306d['user'][_0x0f8c('0x4a')];_0x2025fd[_0x0f8c('0x4b')]=_[_0x0f8c('0x4c')](_0x24306d[_0x0f8c('0x2f')][_0x0f8c('0x4b')])?null:_0x24306d[_0x0f8c('0x2f')][_0x0f8c('0x4b')];_0x2025fd[_0x0f8c('0x4d')]=_0x24306d['body'][_0x0f8c('0x4d')]||![];_0x2025fd['SenderId']=_0x24306d[_0x0f8c('0x43')]['id'];return getContent(_0x24306d[_0x0f8c('0x2f')])[_0x0f8c('0x29')](function(_0x913aac){_0x2025fd[_0x0f8c('0x2f')]=_0x913aac;return getRecipients(_0x8c4dc8);})[_0x0f8c('0x29')](function(_0x160732){_0x2025fd[_0x0f8c('0x4e')]=_['sortBy'](_0x160732)['join'](',');return db[_0x0f8c('0x4f')][_0x0f8c('0x50')](function(_0x4ef602){return db[_0x0f8c('0x51')]['create'](_0x2025fd,{'raw':!![],'transaction':_0x4ef602})[_0x0f8c('0x29')](function(_0x41db05){var _0x1d53b4={'sender':_0x2025fd[_0x0f8c('0x49')],'description':_0x2025fd[_0x0f8c('0x4b')],'content':_0x2025fd[_0x0f8c('0x2f')],'beep':_0x2025fd[_0x0f8c('0x4d')]};_0x160732[_0x0f8c('0x52')](function(_0x14d692){_0x1d53b4[_0x0f8c('0x53')]=_0x14d692;socket[_0x0f8c('0x54')](_0x0f8c('0x55'),_0x1d53b4);});return _0x41db05;});});})[_0x0f8c('0x29')](respondWithResult(_0x3115ed,0xc9))[_0x0f8c('0x56')](handleError(_0x3115ed,null));};function getContent(_0x34d1ae){return new BPromise(function(_0x587d33,_0x33c046){if(_0x34d1ae[_0x0f8c('0x30')]){_0x587d33(_0x34d1ae[_0x0f8c('0x30')]);return;}return db[_0x0f8c('0x57')][_0x0f8c('0x58')]({'attributes':[_0x0f8c('0x59')],'where':{'id':_0x34d1ae['TemplateId']},'raw':!![]})['then'](function(_0x14e310){if(!_0x14e310)throw new db[(_0x0f8c('0x31'))]['ValidationError'](_0x0f8c('0x5a'));var _0x72af09=Mustache[_0x0f8c('0x5b')](_0x14e310['html'],_0x34d1ae[_0x0f8c('0x35')]);_0x587d33(_0x72af09);})['catch'](function(_0x36f182){_0x33c046(_0x36f182);});});}function getRecipients(_0x4942b0){return new BPromise(function(_0x4a6f50,_0x5d9765){var _0x23bb27=[];var _0xea75f6=[];_0x4942b0[_0x0f8c('0x52')](function(_0xf587a4){var _0x39933a=_[_0x0f8c('0x5c')](_0xf587a4['model'][_0x0f8c('0x47')]());if(_0x39933a===_0x0f8c('0x5d')){_0x23bb27=_[_0x0f8c('0x5e')](_0x23bb27,_0xf587a4[_0x0f8c('0x5f')]);}else{if(_[_0x0f8c('0x45')](_0x39933a,_0x0f8c('0x60')))_0x39933a=_0x39933a[_0x0f8c('0x61')]('queue',_0x0f8c('0x62'));_0xf587a4[_0x0f8c('0x5f')][_0x0f8c('0x52')](function(_0xfdbe23){_0xea75f6['push'](getAgents(_0x39933a,_0xfdbe23));});}});return BPromise[_0x0f8c('0x63')](_0xea75f6)[_0x0f8c('0x29')](function(_0x53e7b2){_0x23bb27=_[_0x0f8c('0x5e')](_0x23bb27,_[_0x0f8c('0x64')](_0x53e7b2));_0x4a6f50(_0x23bb27);})[_0x0f8c('0x56')](function(_0x30ca03){_0x5d9765(_0x30ca03);});});}function getAgents(_0x3c318a,_0x131cec){return new BPromise(function(_0x4dac9a,_0x7a21d2){return db[_0x3c318a][_0x0f8c('0x58')]({'where':{'id':_0x131cec}})[_0x0f8c('0x29')](function(_0x1ae929){return _0x1ae929[_0x0f8c('0x65')]({'attributes':['id'],'raw':!![]})[_0x0f8c('0x29')](function(_0x45b32d){var _0x1cb29a=_[_0x0f8c('0x66')](_0x45b32d,'id');_0x4dac9a(_0x1cb29a);});})[_0x0f8c('0x56')](function(_0x1b118b){_0x7a21d2(_0x1b118b);});});} \ No newline at end of file +var _0xb8cc=['map','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','sendStatus','stack','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','parse','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','senderName','fullname','recipientsDescription','isEmpty','beep','recipientsId','sortBy','join','sequelize','create','forEach','emit','userNotification:send','Template','html','render','startCase','toLowerCase','User','ids','queue','Queue','push','all','union','flatten','catch','findOne','getAgents'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xb8cc,0xcd));var _0xcb8c=function(_0x129a36,_0x5add80){_0x129a36=_0x129a36-0x0;var _0x58a5a1=_0xb8cc[_0x129a36];return _0x58a5a1;};'use strict';var emlformat=require(_0xcb8c('0x0'));var rimraf=require(_0xcb8c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb8c('0x2'));var rp=require('request-promise');var moment=require(_0xcb8c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcb8c('0x4'));var util=require(_0xcb8c('0x5'));var path=require(_0xcb8c('0x6'));var sox=require(_0xcb8c('0x7'));var csv=require(_0xcb8c('0x8'));var ejs=require(_0xcb8c('0x9'));var fs=require('fs');var fs_extra=require(_0xcb8c('0xa'));var _=require(_0xcb8c('0xb'));var squel=require(_0xcb8c('0xc'));var crypto=require(_0xcb8c('0xd'));var jsforce=require(_0xcb8c('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcb8c('0xf'));var Papa=require(_0xcb8c('0x10'));var Redis=require(_0xcb8c('0x11'));var authService=require(_0xcb8c('0x12'));var qs=require(_0xcb8c('0x13'));var as=require(_0xcb8c('0x14'));var hardwareService=require(_0xcb8c('0x15'));var logger=require(_0xcb8c('0x16'))(_0xcb8c('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb8c('0x18'));var db=require(_0xcb8c('0x19'))['db'];config[_0xcb8c('0x1a')]=_[_0xcb8c('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xcb8c('0x1c'))(new Redis(config[_0xcb8c('0x1a')]));require(_0xcb8c('0x1d'))[_0xcb8c('0x1e')](socket);function respondWithStatusCode(_0xc0cf85,_0x30165c){_0x30165c=_0x30165c||0xcc;return function(_0x18b101){if(_0x18b101){return _0xc0cf85['sendStatus'](_0x30165c);}return _0xc0cf85[_0xcb8c('0x1f')](_0x30165c)[_0xcb8c('0x20')]();};}function respondWithResult(_0x30c519,_0x4d1383){_0x4d1383=_0x4d1383||0xc8;return function(_0x34a960){if(_0x34a960){return _0x30c519['status'](_0x4d1383)[_0xcb8c('0x21')](_0x34a960);}};}function respondWithFilteredResult(_0x264a7c,_0x196f6e){return function(_0x514746){if(_0x514746){var _0x11a5e6=typeof _0x196f6e[_0xcb8c('0x22')]===_0xcb8c('0x23')&&typeof _0x196f6e[_0xcb8c('0x24')]===_0xcb8c('0x23');var _0x468d71=_0x514746[_0xcb8c('0x25')];var _0x528d6e=_0x11a5e6?0x0:_0x196f6e[_0xcb8c('0x22')];var _0x2f5cd0=_0x11a5e6?_0x514746[_0xcb8c('0x25')]:_0x196f6e[_0xcb8c('0x22')]+_0x196f6e[_0xcb8c('0x24')];var _0x5e9552;if(_0x2f5cd0>=_0x468d71){_0x2f5cd0=_0x468d71;_0x5e9552=0xc8;}else{_0x5e9552=0xce;}_0x264a7c[_0xcb8c('0x1f')](_0x5e9552);return _0x264a7c[_0xcb8c('0x26')](_0xcb8c('0x27'),_0x528d6e+'-'+_0x2f5cd0+'/'+_0x468d71)[_0xcb8c('0x21')](_0x514746);}return null;};}function patchUpdates(_0x539d03){return function(_0x2dfdf3){try{jsonpatch['apply'](_0x2dfdf3,_0x539d03,!![]);}catch(_0x2ec52a){return BPromise[_0xcb8c('0x28')](_0x2ec52a);}return _0x2dfdf3[_0xcb8c('0x29')]();};}function saveUpdates(_0x52fdb8,_0x31bc28){return function(_0xc19e24){if(_0xc19e24){return _0xc19e24['update'](_0x52fdb8)[_0xcb8c('0x2a')](function(_0xe20e36){return _0xe20e36;});}return null;};}function removeEntity(_0x427e8b,_0x33bdab){return function(_0xa474c8){if(_0xa474c8){return _0xa474c8['destroy']()[_0xcb8c('0x2a')](function(){_0x427e8b[_0xcb8c('0x1f')](0xcc)[_0xcb8c('0x20')]();});}};}function handleEntityNotFound(_0x382c9c,_0x253145){return function(_0x1a1cd4){if(!_0x1a1cd4){_0x382c9c[_0xcb8c('0x2b')](0x194);}return _0x1a1cd4;};}function handleError(_0x36ab17,_0x325ece){_0x325ece=_0x325ece||0x1f4;return function(_0x3720bb){logger['error'](_0x3720bb[_0xcb8c('0x2c')]);if(_0x3720bb[_0xcb8c('0x2d')]){delete _0x3720bb[_0xcb8c('0x2d')];}_0x36ab17[_0xcb8c('0x1f')](_0x325ece)[_0xcb8c('0x2e')](_0x3720bb);};}exports[_0xcb8c('0x2f')]=function(_0x5490ad,_0x5524b1,_0x382bb8){if(!_0x5490ad[_0xcb8c('0x30')]['hasOwnProperty'](_0xcb8c('0x31'))&&!_0x5490ad[_0xcb8c('0x30')][_0xcb8c('0x32')](_0xcb8c('0x33'))){throw new db[(_0xcb8c('0x34'))][(_0xcb8c('0x35'))](_0xcb8c('0x36'));}else{if(_0x5490ad[_0xcb8c('0x30')][_0xcb8c('0x32')](_0xcb8c('0x33'))&&!_0x5490ad['body'][_0xcb8c('0x32')](_0xcb8c('0x37'))){throw new db[(_0xcb8c('0x34'))][(_0xcb8c('0x35'))](_0xcb8c('0x38'));}if(!_0x5490ad['body'][_0xcb8c('0x32')](_0xcb8c('0x39'))){throw new db[(_0xcb8c('0x34'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x36389b=JSON[_0xcb8c('0x3a')](_0x5490ad[_0xcb8c('0x30')][_0xcb8c('0x39')]);}catch(_0x164003){logger[_0xcb8c('0x3b')](_0x164003);throw new db['Sequelize'][(_0xcb8c('0x35'))](_0xcb8c('0x3c'));}var _0x2ddc94=[_0xcb8c('0x3d'),_0xcb8c('0x3e'),_0xcb8c('0x3f'),'openchannelqueue',_0xcb8c('0x40'),_0xcb8c('0x41'),_0xcb8c('0x42'),_0xcb8c('0x43'),_0xcb8c('0x44')];if(_[_0xcb8c('0x45')](_0x36389b,function(_0x17de50){return!_[_0xcb8c('0x46')](_0x2ddc94,_0x17de50[_0xcb8c('0x47')]['toLowerCase']());})){throw new db['Sequelize'][(_0xcb8c('0x35'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x249f4f={};_0x249f4f[_0xcb8c('0x48')]=_0x5490ad[_0xcb8c('0x30')][_0xcb8c('0x32')](_0xcb8c('0x48'))?_0x5490ad[_0xcb8c('0x30')][_0xcb8c('0x48')]:_0x5490ad['user'][_0xcb8c('0x49')];_0x249f4f[_0xcb8c('0x4a')]=_[_0xcb8c('0x4b')](_0x5490ad['body']['recipientsDescription'])?null:_0x5490ad[_0xcb8c('0x30')]['recipientsDescription'];_0x249f4f[_0xcb8c('0x4c')]=_0x5490ad[_0xcb8c('0x30')]['beep']||![];_0x249f4f['SenderId']=_0x5490ad[_0xcb8c('0x44')]['id'];return getContent(_0x5490ad[_0xcb8c('0x30')])[_0xcb8c('0x2a')](function(_0x142548){_0x249f4f[_0xcb8c('0x30')]=_0x142548;return getRecipients(_0x36389b);})[_0xcb8c('0x2a')](function(_0x1ce6dd){_0x249f4f[_0xcb8c('0x4d')]=_[_0xcb8c('0x4e')](_0x1ce6dd)[_0xcb8c('0x4f')](',');return db[_0xcb8c('0x50')]['transaction'](function(_0xbe75e2){return db['UserNotification'][_0xcb8c('0x51')](_0x249f4f,{'raw':!![],'transaction':_0xbe75e2})[_0xcb8c('0x2a')](function(_0x4a1407){var _0x5a2e36={'sender':_0x249f4f[_0xcb8c('0x48')],'description':_0x249f4f[_0xcb8c('0x4a')],'content':_0x249f4f[_0xcb8c('0x30')],'beep':_0x249f4f[_0xcb8c('0x4c')]};_0x1ce6dd[_0xcb8c('0x52')](function(_0x5baf82){_0x5a2e36['recipient']=_0x5baf82;socket[_0xcb8c('0x53')](_0xcb8c('0x54'),_0x5a2e36);});return _0x4a1407;});});})[_0xcb8c('0x2a')](respondWithResult(_0x5524b1,0xc9))['catch'](handleError(_0x5524b1,null));};function getContent(_0x380315){return new BPromise(function(_0x422d2c,_0x2ee72d){if(_0x380315[_0xcb8c('0x31')]){_0x422d2c(_0x380315[_0xcb8c('0x31')]);return;}return db[_0xcb8c('0x55')]['findOne']({'attributes':[_0xcb8c('0x56')],'where':{'id':_0x380315['TemplateId']},'raw':!![]})['then'](function(_0x3c8753){if(!_0x3c8753)throw new db['Sequelize'][(_0xcb8c('0x35'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x3fdf5d=Mustache[_0xcb8c('0x57')](_0x3c8753['html'],_0x380315[_0xcb8c('0x37')]);_0x422d2c(_0x3fdf5d);})['catch'](function(_0x2a9b3){_0x2ee72d(_0x2a9b3);});});}function getRecipients(_0x17bd25){return new BPromise(function(_0x41b951,_0x633125){var _0x41cf58=[];var _0xc2b28f=[];_0x17bd25[_0xcb8c('0x52')](function(_0x26d5e8){var _0x70c32c=_[_0xcb8c('0x58')](_0x26d5e8[_0xcb8c('0x47')][_0xcb8c('0x59')]());if(_0x70c32c===_0xcb8c('0x5a')){_0x41cf58=_['union'](_0x41cf58,_0x26d5e8[_0xcb8c('0x5b')]);}else{if(_[_0xcb8c('0x46')](_0x70c32c,_0xcb8c('0x5c')))_0x70c32c=_0x70c32c['replace'](_0xcb8c('0x5c'),_0xcb8c('0x5d'));_0x26d5e8[_0xcb8c('0x5b')]['forEach'](function(_0x375a98){_0xc2b28f[_0xcb8c('0x5e')](getAgents(_0x70c32c,_0x375a98));});}});return BPromise[_0xcb8c('0x5f')](_0xc2b28f)[_0xcb8c('0x2a')](function(_0x3950ac){_0x41cf58=_[_0xcb8c('0x60')](_0x41cf58,_[_0xcb8c('0x61')](_0x3950ac));_0x41b951(_0x41cf58);})[_0xcb8c('0x62')](function(_0x13b095){_0x633125(_0x13b095);});});}function getAgents(_0x54c397,_0x579f6){return new BPromise(function(_0x493cec,_0x3f8f1b){return db[_0x54c397][_0xcb8c('0x63')]({'where':{'id':_0x579f6}})[_0xcb8c('0x2a')](function(_0x4bae12){return _0x4bae12[_0xcb8c('0x64')]({'attributes':['id'],'raw':!![]})[_0xcb8c('0x2a')](function(_0x5334cf){var _0x8c9ee6=_[_0xcb8c('0x65')](_0x5334cf,'id');_0x493cec(_0x8c9ee6);});})[_0xcb8c('0x62')](function(_0x2c746a){_0x3f8f1b(_0x2c746a);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index cefa135..bf1e0c4 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 _0x5c61=['remove','emit','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','update'];(function(_0x1df7c0,_0x4f0416){var _0x282ed7=function(_0x41c14d){while(--_0x41c14d){_0x1df7c0['push'](_0x1df7c0['shift']());}};_0x282ed7(++_0x4f0416);}(_0x5c61,0xf7));var _0x15c6=function(_0xac113c,_0x330dba){_0xac113c=_0xac113c-0x0;var _0x5cf644=_0x5c61[_0xac113c];return _0x5cf644;};'use strict';var EventEmitter=require(_0x15c6('0x0'));var UserNotification=require(_0x15c6('0x1'))['db'][_0x15c6('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x15c6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x15c6('0x4'),'afterDestroy':_0x15c6('0x5')};function emitEvent(_0x1a63c1){return function(_0x1b89bc,_0x20d6bf,_0x554083){UserNotificationEvents[_0x15c6('0x6')](_0x1a63c1+':'+_0x1b89bc['id'],_0x1b89bc);UserNotificationEvents[_0x15c6('0x6')](_0x1a63c1,_0x1b89bc);_0x554083(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0x15c6('0x7')](e,emitEvent(event));}}module[_0x15c6('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0x3cb7=['exports','events','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0x1f782d,_0x5906b8){var _0x228cce=function(_0x3036cc){while(--_0x3036cc){_0x1f782d['push'](_0x1f782d['shift']());}};_0x228cce(++_0x5906b8);}(_0x3cb7,0x119));var _0x73cb=function(_0x42f687,_0x558724){_0x42f687=_0x42f687-0x0;var _0x108838=_0x3cb7[_0x42f687];return _0x108838;};'use strict';var EventEmitter=require(_0x73cb('0x0'));var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x73cb('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x73cb('0x2'),'afterDestroy':_0x73cb('0x3')};function emitEvent(_0x140d8b){return function(_0xe7b0e6,_0x39584a,_0xfdbd39){UserNotificationEvents[_0x73cb('0x4')](_0x140d8b+':'+_0xe7b0e6['id'],_0xe7b0e6);UserNotificationEvents['emit'](_0x140d8b,_0xe7b0e6);_0xfdbd39(null);};}for(var e in events){if(events[_0x73cb('0x5')](e)){var event=events[e];UserNotification[_0x73cb('0x6')](e,emitEvent(event));}}module[_0x73cb('0x7')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 09ecd1c..4c4b5e5 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 _0x98c6=['./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x555283,_0x1c3b1e){var _0x1aac64=function(_0x4267a5){while(--_0x4267a5){_0x555283['push'](_0x555283['shift']());}};_0x1aac64(++_0x1c3b1e);}(_0x98c6,0x8e));var _0x698c=function(_0x5d856e,_0x3aa144){_0x5d856e=_0x5d856e-0x0;var _0x52e4a3=_0x98c6[_0x5d856e];return _0x52e4a3;};'use strict';var _=require(_0x698c('0x0'));var util=require(_0x698c('0x1'));var logger=require(_0x698c('0x2'))(_0x698c('0x3'));var moment=require(_0x698c('0x4'));var BPromise=require('bluebird');var rp=require(_0x698c('0x5'));var fs=require('fs');var path=require(_0x698c('0x6'));var rimraf=require(_0x698c('0x7'));var config=require('../../config/environment');var attributes=require(_0x698c('0x8'));module[_0x698c('0x9')]=function(_0x57248b,_0x568212){return _0x57248b[_0x698c('0xa')](_0x698c('0xb'),attributes,{'tableName':_0x698c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x698c('0xd'),'collate':_0x698c('0xe')});}; \ No newline at end of file +var _0xe9cb=['lodash','util','../../config/logger','api','bluebird','rimraf','./userNotification.attributes','define','userNotifications','utf8mb4','utf8mb4_unicode_ci'];(function(_0xa6ab54,_0x69c129){var _0x27f9b3=function(_0x2c58c2){while(--_0x2c58c2){_0xa6ab54['push'](_0xa6ab54['shift']());}};_0x27f9b3(++_0x69c129);}(_0xe9cb,0x160));var _0xbe9c=function(_0x4349cd,_0xc9bf81){_0x4349cd=_0x4349cd-0x0;var _0x3df0ef=_0xe9cb[_0x4349cd];return _0x3df0ef;};'use strict';var _=require(_0xbe9c('0x0'));var util=require(_0xbe9c('0x1'));var logger=require(_0xbe9c('0x2'))(_0xbe9c('0x3'));var moment=require('moment');var BPromise=require(_0xbe9c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbe9c('0x5'));var config=require('../../config/environment');var attributes=require(_0xbe9c('0x6'));module['exports']=function(_0x545cfd,_0x30ba4a){return _0x545cfd[_0xbe9c('0x7')]('UserNotification',attributes,{'tableName':_0xbe9c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe9c('0x9'),'collate':_0xbe9c('0xa')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 76edfd9..0b65ce9 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 _0xc6cb=['redis','defaults','localhost','./userNotification.socket','register','then','request\x20sent','debug','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x400273,_0x5e3cc0){var _0x417b73=function(_0x19c3c){while(--_0x19c3c){_0x400273['push'](_0x400273['shift']());}};_0x417b73(++_0x5e3cc0);}(_0xc6cb,0x10c));var _0xbc6c=function(_0x1b0cef,_0x21c0ed){_0x1b0cef=_0x1b0cef-0x0;var _0x18365e=_0xc6cb[_0x1b0cef];return _0x18365e;};'use strict';var _=require('lodash');var util=require(_0xbc6c('0x0'));var moment=require(_0xbc6c('0x1'));var BPromise=require(_0xbc6c('0x2'));var rs=require(_0xbc6c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbc6c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbc6c('0x5'));var jayson=require(_0xbc6c('0x6'));var client=jayson[_0xbc6c('0x7')]['http']({'port':0x232a});config[_0xbc6c('0x8')]=_[_0xbc6c('0x9')](config['redis'],{'host':_0xbc6c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc6c('0x8')]));require(_0xbc6c('0xb'))[_0xbc6c('0xc')](socket);function respondWithRpcPromise(_0x44f1c5,_0xdf6675,_0x28bcf1){return new BPromise(function(_0xff64f,_0x5b5039){return client['request'](_0x44f1c5,_0x28bcf1)[_0xbc6c('0xd')](function(_0x16004c){logger['info']('UserNotification,\x20%s,\x20%s',_0xdf6675,_0xbc6c('0xe'));logger[_0xbc6c('0xf')]('UserNotification,\x20%s,\x20%s,\x20%s',_0xdf6675,_0xbc6c('0xe'),JSON[_0xbc6c('0x10')](_0x16004c));if(_0x16004c['error']){if(_0x16004c[_0xbc6c('0x11')][_0xbc6c('0x12')]===0x1f4){logger[_0xbc6c('0x11')](_0xbc6c('0x13'),_0xdf6675,_0x16004c[_0xbc6c('0x11')][_0xbc6c('0x14')]);return _0x5b5039(_0x16004c[_0xbc6c('0x11')][_0xbc6c('0x14')]);}logger['error'](_0xbc6c('0x13'),_0xdf6675,_0x16004c[_0xbc6c('0x11')][_0xbc6c('0x14')]);return _0xff64f(_0x16004c[_0xbc6c('0x11')][_0xbc6c('0x14')]);}else{logger[_0xbc6c('0x15')](_0xbc6c('0x13'),_0xdf6675,_0xbc6c('0xe'));_0xff64f(_0x16004c[_0xbc6c('0x16')][_0xbc6c('0x14')]);}})['catch'](function(_0x85790b){logger[_0xbc6c('0x11')]('UserNotification,\x20%s,\x20%s',_0xdf6675,_0x85790b);_0x5b5039(_0x85790b);});});} \ No newline at end of file +var _0xea3e=['bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./userNotification.socket','request','then','info','request\x20sent','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','catch','util','moment'];(function(_0x165300,_0x7b6a39){var _0x4b3560=function(_0x2741c){while(--_0x2741c){_0x165300['push'](_0x165300['shift']());}};_0x4b3560(++_0x7b6a39);}(_0xea3e,0x1c0));var _0xeea3=function(_0x1b9f87,_0x55d160){_0x1b9f87=_0x1b9f87-0x0;var _0x4d1ad9=_0xea3e[_0x1b9f87];return _0x4d1ad9;};'use strict';var _=require('lodash');var util=require(_0xeea3('0x0'));var moment=require(_0xeea3('0x1'));var BPromise=require(_0xeea3('0x2'));var rs=require(_0xeea3('0x3'));var fs=require('fs');var Redis=require(_0xeea3('0x4'));var db=require(_0xeea3('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xeea3('0x6'));var config=require('../../config/environment');var jayson=require(_0xeea3('0x7'));var client=jayson[_0xeea3('0x8')]['http']({'port':0x232a});config['redis']=_[_0xeea3('0x9')](config[_0xeea3('0xa')],{'host':_0xeea3('0xb'),'port':0x18eb});var socket=require(_0xeea3('0xc'))(new Redis(config[_0xeea3('0xa')]));require(_0xeea3('0xd'))['register'](socket);function respondWithRpcPromise(_0x704268,_0x11ef7d,_0x37a0aa){return new BPromise(function(_0x3a4479,_0x22a516){return client[_0xeea3('0xe')](_0x704268,_0x37a0aa)[_0xeea3('0xf')](function(_0x37c8a1){logger[_0xeea3('0x10')]('UserNotification,\x20%s,\x20%s',_0x11ef7d,_0xeea3('0x11'));logger['debug'](_0xeea3('0x12'),_0x11ef7d,'request\x20sent',JSON[_0xeea3('0x13')](_0x37c8a1));if(_0x37c8a1[_0xeea3('0x14')]){if(_0x37c8a1[_0xeea3('0x14')][_0xeea3('0x15')]===0x1f4){logger['error'](_0xeea3('0x16'),_0x11ef7d,_0x37c8a1[_0xeea3('0x14')][_0xeea3('0x17')]);return _0x22a516(_0x37c8a1[_0xeea3('0x14')][_0xeea3('0x17')]);}logger[_0xeea3('0x14')]('UserNotification,\x20%s,\x20%s',_0x11ef7d,_0x37c8a1[_0xeea3('0x14')]['message']);return _0x3a4479(_0x37c8a1[_0xeea3('0x14')][_0xeea3('0x17')]);}else{logger[_0xeea3('0x10')](_0xeea3('0x16'),_0x11ef7d,_0xeea3('0x11'));_0x3a4479(_0x37c8a1['result']['message']);}})[_0xeea3('0x18')](function(_0x1e9c9e){logger[_0xeea3('0x14')]('UserNotification,\x20%s,\x20%s',_0x11ef7d,_0x1e9c9e);_0x22a516(_0x1e9c9e);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 66511ea..c0c6abe 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 _0xd94d=['register','length','userNotification:','save','remove','removeListener'];(function(_0x1cffe2,_0x5383e8){var _0x57030e=function(_0xe9c73f){while(--_0xe9c73f){_0x1cffe2['push'](_0x1cffe2['shift']());}};_0x57030e(++_0x5383e8);}(_0xd94d,0x7b));var _0xdd94=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd94d[_0x3dd15e];return _0x231fd0;};'use strict';var UserNotificationEvents=require('./userNotification.events');var events=[_0xdd94('0x0'),_0xdd94('0x1'),'update'];function createListener(_0x10ef89,_0x37355b){return function(_0x38321c){_0x37355b['emit'](_0x10ef89,_0x38321c);};}function removeListener(_0x334b5b,_0x333c0e){return function(){UserNotificationEvents[_0xdd94('0x2')](_0x334b5b,_0x333c0e);};}exports[_0xdd94('0x3')]=function(_0x3db1de){for(var _0x4a666f=0x0,_0x387db1=events[_0xdd94('0x4')];_0x4a666f<_0x387db1;_0x4a666f++){var _0xa87150=events[_0x4a666f];var _0x1d97a3=createListener(_0xdd94('0x5')+_0xa87150,_0x3db1de);UserNotificationEvents['on'](_0xa87150,_0x1d97a3);}}; \ No newline at end of file +var _0x9d38=['emit','register','length','./userNotification.events','save','remove','update'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x9d38,0x16f));var _0x89d3=function(_0x3632a9,_0x34a9dc){_0x3632a9=_0x3632a9-0x0;var _0x171036=_0x9d38[_0x3632a9];return _0x171036;};'use strict';var UserNotificationEvents=require(_0x89d3('0x0'));var events=[_0x89d3('0x1'),_0x89d3('0x2'),_0x89d3('0x3')];function createListener(_0x52c31a,_0x4cd05a){return function(_0x253522){_0x4cd05a[_0x89d3('0x4')](_0x52c31a,_0x253522);};}function removeListener(_0x5c0134,_0x139ea5){return function(){UserNotificationEvents['removeListener'](_0x5c0134,_0x139ea5);};}exports[_0x89d3('0x5')]=function(_0x3298c9){for(var _0x4db46e=0x0,_0x598ab5=events[_0x89d3('0x6')];_0x4db46e<_0x598ab5;_0x4db46e++){var _0x5413cd=events[_0x4db46e];var _0x8573a5=createListener('userNotification:'+_0x5413cd,_0x3298c9);UserNotificationEvents['on'](_0x5413cd,_0x8573a5);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 56c2eb0..1a4a591 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x25adc0,_0x1c76d8){var _0x33cbd4=function(_0x2baca2){while(--_0x2baca2){_0x25adc0['push'](_0x25adc0['shift']());}};_0x33cbd4(++_0x1c76d8);}(_0xe706,0xa3));var _0x6e70=function(_0x42446c,_0x106c25){_0x42446c=_0x42446c-0x0;var _0x29059d=_0xe706[_0x42446c];return _0x29059d;};'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(_0x310831,_0x40b71a){var _0x252af3=function(_0x597f08){while(--_0x597f08){_0x310831['push'](_0x310831['shift']());}};_0x252af3(++_0x40b71a);}(_0x70e0,0x17b));var _0x070e=function(_0x5e24f7,_0x246d19){_0x5e24f7=_0x5e24f7-0x0;var _0x4fa03f=_0x70e0[_0x5e24f7];return _0x4fa03f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 30b4885..43abcbb 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 _0x55ad=['INTEGER','sequelize'];(function(_0x1ef020,_0x3a563b){var _0x3f3654=function(_0x495c49){while(--_0x495c49){_0x1ef020['push'](_0x1ef020['shift']());}};_0x3f3654(++_0x3a563b);}(_0x55ad,0x1dd));var _0xd55a=function(_0x3dc56a,_0x58d218){_0x3dc56a=_0x3dc56a-0x0;var _0x56e948=_0x55ad[_0x3dc56a];return _0x56e948;};'use strict';var Sequelize=require(_0xd55a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd55a('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xc00c=['sequelize','INTEGER'];(function(_0x41da22,_0x2d02f4){var _0x27b255=function(_0x3ac6a0){while(--_0x3ac6a0){_0x41da22['push'](_0x41da22['shift']());}};_0x27b255(++_0x2d02f4);}(_0xc00c,0x92));var _0xcc00=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0xc00c[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0xcc00('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xcc00('0x1')],'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 88483c0..2b09962 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 _0x24e3=['../../config/environment','./userOpenchannelQueue.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x40492a,_0x4a8217){var _0x5dc4fa=function(_0xa3fbac){while(--_0xa3fbac){_0x40492a['push'](_0x40492a['shift']());}};_0x5dc4fa(++_0x4a8217);}(_0x24e3,0x130));var _0x324e=function(_0x41a35a,_0xda06ad){_0x41a35a=_0x41a35a-0x0;var _0x33899c=_0x24e3[_0x41a35a];return _0x33899c;};'use strict';var _=require('lodash');var util=require(_0x324e('0x0'));var logger=require(_0x324e('0x1'))(_0x324e('0x2'));var moment=require(_0x324e('0x3'));var BPromise=require(_0x324e('0x4'));var rp=require(_0x324e('0x5'));var fs=require('fs');var path=require(_0x324e('0x6'));var rimraf=require(_0x324e('0x7'));var config=require(_0x324e('0x8'));var attributes=require(_0x324e('0x9'));module[_0x324e('0xa')]=function(_0x18b535,_0x19184e){return _0x18b535[_0x324e('0xb')]('UserOpenchannelQueue',attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x74a0=['user_has_openchannel_queues','lodash','util','api','moment','bluebird','../../config/environment','./userOpenchannelQueue.attributes','exports','define'];(function(_0x4fda3d,_0x3686c5){var _0x5e7c72=function(_0xe10694){while(--_0xe10694){_0x4fda3d['push'](_0x4fda3d['shift']());}};_0x5e7c72(++_0x3686c5);}(_0x74a0,0x17d));var _0x074a=function(_0x419859,_0x3766e4){_0x419859=_0x419859-0x0;var _0x21fc52=_0x74a0[_0x419859];return _0x21fc52;};'use strict';var _=require(_0x074a('0x0'));var util=require(_0x074a('0x1'));var logger=require('../../config/logger')(_0x074a('0x2'));var moment=require(_0x074a('0x3'));var BPromise=require(_0x074a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x074a('0x5'));var attributes=require(_0x074a('0x6'));module[_0x074a('0x7')]=function(_0x312d9a,_0x4182ad){return _0x312d9a[_0x074a('0x8')]('UserOpenchannelQueue',attributes,{'tableName':_0x074a('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 8a22e76..450f2e6 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 _0x8316=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x470760,_0x373776){var _0x25b9da=function(_0x409cd3){while(--_0x409cd3){_0x470760['push'](_0x470760['shift']());}};_0x25b9da(++_0x373776);}(_0x8316,0x1f3));var _0x6831=function(_0x456359,_0x3b9ca0){_0x456359=_0x456359-0x0;var _0x430918=_0x8316[_0x456359];return _0x430918;};'use strict';var _=require(_0x6831('0x0'));var util=require(_0x6831('0x1'));var moment=require(_0x6831('0x2'));var BPromise=require(_0x6831('0x3'));var rs=require(_0x6831('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6831('0x5'))['db'];var utils=require(_0x6831('0x6'));var logger=require(_0x6831('0x7'))(_0x6831('0x8'));var config=require(_0x6831('0x9'));var jayson=require(_0x6831('0xa'));var client=jayson['client'][_0x6831('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5150c6,_0x11be83,_0x102386){return new BPromise(function(_0x12a4d3,_0x215304){return client[_0x6831('0xc')](_0x5150c6,_0x102386)['then'](function(_0x1b4feb){logger[_0x6831('0xd')](_0x6831('0xe'),_0x11be83,'request\x20sent');logger[_0x6831('0xf')](_0x6831('0x10'),_0x11be83,_0x6831('0x11'),JSON['stringify'](_0x1b4feb));if(_0x1b4feb['error']){if(_0x1b4feb['error'][_0x6831('0x12')]===0x1f4){logger[_0x6831('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x11be83,_0x1b4feb[_0x6831('0x13')]['message']);return _0x215304(_0x1b4feb[_0x6831('0x13')][_0x6831('0x14')]);}logger[_0x6831('0x13')](_0x6831('0xe'),_0x11be83,_0x1b4feb[_0x6831('0x13')][_0x6831('0x14')]);return _0x12a4d3(_0x1b4feb[_0x6831('0x13')][_0x6831('0x14')]);}else{logger[_0x6831('0xd')](_0x6831('0xe'),_0x11be83,_0x6831('0x11'));_0x12a4d3(_0x1b4feb[_0x6831('0x15')][_0x6831('0x14')]);}})['catch'](function(_0x1305aa){logger[_0x6831('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x11be83,_0x1305aa);_0x215304(_0x1305aa);});});} \ No newline at end of file +var _0xf9e0=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','bluebird'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xf9e0,0x106));var _0x0f9e=function(_0x50bbb4,_0x50fa46){_0x50bbb4=_0x50bbb4-0x0;var _0x25e426=_0xf9e0[_0x50bbb4];return _0x25e426;};'use strict';var _=require('lodash');var util=require(_0x0f9e('0x0'));var moment=require('moment');var BPromise=require(_0x0f9e('0x1'));var rs=require(_0x0f9e('0x2'));var fs=require('fs');var Redis=require(_0x0f9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f9e('0x4'));var logger=require(_0x0f9e('0x5'))(_0x0f9e('0x6'));var config=require(_0x0f9e('0x7'));var jayson=require(_0x0f9e('0x8'));var client=jayson[_0x0f9e('0x9')][_0x0f9e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x69b53e,_0x20396d,_0x2757d9){return new BPromise(function(_0x199e78,_0x16f6fc){return client[_0x0f9e('0xb')](_0x69b53e,_0x2757d9)[_0x0f9e('0xc')](function(_0x4e4296){logger[_0x0f9e('0xd')](_0x0f9e('0xe'),_0x20396d,_0x0f9e('0xf'));logger['debug'](_0x0f9e('0x10'),_0x20396d,_0x0f9e('0xf'),JSON[_0x0f9e('0x11')](_0x4e4296));if(_0x4e4296[_0x0f9e('0x12')]){if(_0x4e4296[_0x0f9e('0x12')][_0x0f9e('0x13')]===0x1f4){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x20396d,_0x4e4296[_0x0f9e('0x12')][_0x0f9e('0x14')]);return _0x16f6fc(_0x4e4296[_0x0f9e('0x12')][_0x0f9e('0x14')]);}logger[_0x0f9e('0x12')](_0x0f9e('0xe'),_0x20396d,_0x4e4296['error'][_0x0f9e('0x14')]);return _0x199e78(_0x4e4296['error'][_0x0f9e('0x14')]);}else{logger['info'](_0x0f9e('0xe'),_0x20396d,_0x0f9e('0xf'));_0x199e78(_0x4e4296[_0x0f9e('0x15')][_0x0f9e('0x14')]);}})['catch'](function(_0x1dc6b1){logger[_0x0f9e('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x20396d,_0x1dc6b1);_0x16f6fc(_0x1dc6b1);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 4dbbf68..b034548 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 _0x6e10=['fs-extra','../../config/environment','./userProfile.controller','get','/describe','isAuthenticated','describe','/:id','getSections','/:id/resources','getResources','post','clone','/:id/sections','addSections','addResources','put','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x1087c2,_0x4d15a2){var _0x504fcc=function(_0x29ddd1){while(--_0x29ddd1){_0x1087c2['push'](_0x1087c2['shift']());}};_0x504fcc(++_0x4d15a2);}(_0x6e10,0x1bc));var _0x06e1=function(_0x3437b8,_0x607c2b){_0x3437b8=_0x3437b8-0x0;var _0x32522b=_0x6e10[_0x3437b8];return _0x32522b;};'use strict';var multer=require(_0x06e1('0x0'));var util=require(_0x06e1('0x1'));var path=require(_0x06e1('0x2'));var timeout=require(_0x06e1('0x3'));var express=require(_0x06e1('0x4'));var router=express[_0x06e1('0x5')]();var fs_extra=require(_0x06e1('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x06e1('0x7'));var controller=require(_0x06e1('0x8'));router[_0x06e1('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x06e1('0x9')](_0x06e1('0xa'),auth[_0x06e1('0xb')](),controller[_0x06e1('0xc')]);router[_0x06e1('0x9')](_0x06e1('0xd'),auth[_0x06e1('0xb')](),controller['show']);router['get']('/:id/sections',auth[_0x06e1('0xb')](),controller[_0x06e1('0xe')]);router[_0x06e1('0x9')](_0x06e1('0xf'),auth[_0x06e1('0xb')](),controller[_0x06e1('0x10')]);router[_0x06e1('0x11')]('/',auth[_0x06e1('0xb')](),controller['create']);router[_0x06e1('0x11')]('/:id/clone',auth['isAuthenticated'](),controller[_0x06e1('0x12')]);router[_0x06e1('0x11')](_0x06e1('0x13'),auth[_0x06e1('0xb')](),controller[_0x06e1('0x14')]);router['post']('/:id/resources',auth[_0x06e1('0xb')](),controller[_0x06e1('0x15')]);router[_0x06e1('0x16')](_0x06e1('0xd'),auth[_0x06e1('0xb')](),controller[_0x06e1('0x17')]);router[_0x06e1('0x18')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x06e1('0x18')](_0x06e1('0x13'),auth[_0x06e1('0xb')](),controller['removeSections']);router[_0x06e1('0x18')](_0x06e1('0xf'),auth['isAuthenticated'](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0x11b2=['../../config/environment','./userProfile.controller','get','index','/describe','isAuthenticated','getSections','/:id/resources','getResources','post','/:id/clone','clone','/:id/sections','addResources','/:id','update','delete','destroy','removeSections','removeResources','exports','multer','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11b2,0xd2));var _0x211b=function(_0x34b7e0,_0x4f759b){_0x34b7e0=_0x34b7e0-0x0;var _0x3a4657=_0x11b2[_0x34b7e0];return _0x3a4657;};'use strict';var multer=require(_0x211b('0x0'));var util=require('util');var path=require(_0x211b('0x1'));var timeout=require('connect-timeout');var express=require(_0x211b('0x2'));var router=express[_0x211b('0x3')]();var fs_extra=require(_0x211b('0x4'));var auth=require(_0x211b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x211b('0x6'));var controller=require(_0x211b('0x7'));router[_0x211b('0x8')]('/',auth['isAuthenticated'](),controller[_0x211b('0x9')]);router['get'](_0x211b('0xa'),auth[_0x211b('0xb')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x211b('0x8')]('/:id/sections',auth[_0x211b('0xb')](),controller[_0x211b('0xc')]);router[_0x211b('0x8')](_0x211b('0xd'),auth['isAuthenticated'](),controller[_0x211b('0xe')]);router[_0x211b('0xf')]('/',auth[_0x211b('0xb')](),controller['create']);router['post'](_0x211b('0x10'),auth[_0x211b('0xb')](),controller[_0x211b('0x11')]);router['post'](_0x211b('0x12'),auth[_0x211b('0xb')](),controller['addSections']);router[_0x211b('0xf')](_0x211b('0xd'),auth['isAuthenticated'](),controller[_0x211b('0x13')]);router['put'](_0x211b('0x14'),auth[_0x211b('0xb')](),controller[_0x211b('0x15')]);router[_0x211b('0x16')](_0x211b('0x14'),auth[_0x211b('0xb')](),controller[_0x211b('0x17')]);router[_0x211b('0x16')](_0x211b('0x12'),auth['isAuthenticated'](),controller[_0x211b('0x18')]);router[_0x211b('0x16')](_0x211b('0xd'),auth[_0x211b('0xb')](),controller[_0x211b('0x19')]);module[_0x211b('0x1a')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 885ddd4..0d7ec4d 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 _0x0ddf=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize'];(function(_0x488b4d,_0x233540){var _0x51ee8f=function(_0x166556){while(--_0x166556){_0x488b4d['push'](_0x488b4d['shift']());}};_0x51ee8f(++_0x233540);}(_0x0ddf,0x185));var _0xf0dd=function(_0x31d5d6,_0x14db90){_0x31d5d6=_0x31d5d6-0x0;var _0x28b5ef=_0x0ddf[_0x31d5d6];return _0x28b5ef;};'use strict';var Sequelize=require(_0xf0dd('0x0'));module[_0xf0dd('0x1')]={'name':{'type':Sequelize[_0xf0dd('0x2')],'allowNull':![],'unique':_0xf0dd('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x1e2497){this[_0xf0dd('0x4')](_0xf0dd('0x5'),_0x1e2497?_0x1e2497[_0xf0dd('0x6')](''):[]);},'get':function(){return this[_0xf0dd('0x7')](_0xf0dd('0x5'))?this[_0xf0dd('0x7')]('crudPermissions')[_0xf0dd('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf0dd('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xf0dd('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf0dd('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf0dd('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf0dd('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2c0d=['getDataValue','BOOLEAN','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0x2c0d,0x16e));var _0xd2c0=function(_0x5c3b5c,_0x1d193a){_0x5c3b5c=_0x5c3b5c-0x0;var _0x3951e3=_0x2c0d[_0x5c3b5c];return _0x3951e3;};'use strict';var Sequelize=require('sequelize');module[_0xd2c0('0x0')]={'name':{'type':Sequelize[_0xd2c0('0x1')],'allowNull':![],'unique':_0xd2c0('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x3237b1){this[_0xd2c0('0x3')](_0xd2c0('0x4'),_0x3237b1?_0x3237b1['join'](''):[]);},'get':function(){return this[_0xd2c0('0x5')](_0xd2c0('0x4'))?this[_0xd2c0('0x5')](_0xd2c0('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xd2c0('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd2c0('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd2c0('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xd2c0('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd2c0('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index f8df6fa..9d4a05b 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 _0x9013=['register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','UserProfile','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','rawAttributes','get','createdAt','updatedAt','crudPermissions','each','autoAssociation','UserProfileResource','omit','sectionId','userProfileId','Resources','UserProfileSection','describe','addSections','sequelize','transaction','destroy','push','removeSections','getSections','includes','isEmpty','subsections','concat','enabled','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x9013,0x140));var _0x3901=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x9013[_0x46698a];return _0x356db0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3901('0x0'));var jsonpatch=require(_0x3901('0x1'));var rp=require(_0x3901('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3901('0x3'));var util=require(_0x3901('0x4'));var path=require('path');var sox=require(_0x3901('0x5'));var csv=require(_0x3901('0x6'));var ejs=require(_0x3901('0x7'));var fs=require('fs');var fs_extra=require(_0x3901('0x8'));var _=require(_0x3901('0x9'));var squel=require(_0x3901('0xa'));var crypto=require(_0x3901('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3901('0xc'));var toCsv=require(_0x3901('0x6'));var querystring=require(_0x3901('0xd'));var Papa=require('papaparse');var Redis=require(_0x3901('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x3901('0xf'));var as=require(_0x3901('0x10'));var hardwareService=require(_0x3901('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x3901('0x12'));var config=require(_0x3901('0x13'));var licenseUtil=require(_0x3901('0x14'));var db=require('../../mysqldb')['db'];config[_0x3901('0x15')]=_[_0x3901('0x16')](config[_0x3901('0x15')],{'host':_0x3901('0x17'),'port':0x18eb});var socket=require(_0x3901('0x18'))(new Redis(config[_0x3901('0x15')]));require('./userProfile.socket')[_0x3901('0x19')](socket);function respondWithStatusCode(_0x2d8416,_0x35f4df){_0x35f4df=_0x35f4df||0xcc;return function(_0x1cb778){if(_0x1cb778){return _0x2d8416[_0x3901('0x1a')](_0x35f4df);}return _0x2d8416[_0x3901('0x1b')](_0x35f4df)[_0x3901('0x1c')]();};}function respondWithResult(_0x4c6068,_0x44423b){_0x44423b=_0x44423b||0xc8;return function(_0x339ca2){if(_0x339ca2){return _0x4c6068[_0x3901('0x1b')](_0x44423b)[_0x3901('0x1d')](_0x339ca2);}};}function respondWithFilteredResult(_0x4580f7,_0x3bc6a2){return function(_0x4ce92f){if(_0x4ce92f){var _0x173e79=typeof _0x3bc6a2[_0x3901('0x1e')]==='undefined'&&typeof _0x3bc6a2[_0x3901('0x1f')]===_0x3901('0x20');var _0x23627d=_0x4ce92f[_0x3901('0x21')];var _0x30b7aa=_0x173e79?0x0:_0x3bc6a2[_0x3901('0x1e')];var _0x4f9c80=_0x173e79?_0x4ce92f[_0x3901('0x21')]:_0x3bc6a2[_0x3901('0x1e')]+_0x3bc6a2[_0x3901('0x1f')];var _0x308664;if(_0x4f9c80>=_0x23627d){_0x4f9c80=_0x23627d;_0x308664=0xc8;}else{_0x308664=0xce;}_0x4580f7['status'](_0x308664);return _0x4580f7[_0x3901('0x22')](_0x3901('0x23'),_0x30b7aa+'-'+_0x4f9c80+'/'+_0x23627d)['json'](_0x4ce92f);}return null;};}function patchUpdates(_0x5adcfa){return function(_0x2b1923){try{jsonpatch[_0x3901('0x24')](_0x2b1923,_0x5adcfa,!![]);}catch(_0x54bace){return BPromise[_0x3901('0x25')](_0x54bace);}return _0x2b1923[_0x3901('0x26')]();};}function saveUpdates(_0xe3709,_0x3b86c0){return function(_0x5c5dc5){if(_0x5c5dc5){return _0x5c5dc5[_0x3901('0x27')](_0xe3709)['then'](function(_0x35848e){return _0x35848e;});}return null;};}function removeEntity(_0x4e13b2,_0x15228b){return function(_0x17bae1){if(_0x17bae1){return _0x17bae1['destroy']()['then'](function(){_0x4e13b2[_0x3901('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ffb16,_0x269654){return function(_0x15652f){if(!_0x15652f){_0x4ffb16[_0x3901('0x1a')](0x194);}return _0x15652f;};}function handleError(_0x38a790,_0x507e79){_0x507e79=_0x507e79||0x1f4;return function(_0x2f741f){logger[_0x3901('0x28')](_0x2f741f[_0x3901('0x29')]);if(_0x2f741f[_0x3901('0x2a')]){delete _0x2f741f[_0x3901('0x2a')];}_0x38a790['status'](_0x507e79)[_0x3901('0x2b')](_0x2f741f);};}exports['index']=function(_0x2cf0b0,_0x556d91){var _0x5c474e={},_0x24c0f5={},_0xc49b9b={'count':0x0,'rows':[]};var _0x53c640=_[_0x3901('0x2c')](db['UserProfile']['rawAttributes'],function(_0x2016ba){return{'name':_0x2016ba[_0x3901('0x2d')],'type':_0x2016ba['type'][_0x3901('0x2e')]};});_0x24c0f5[_0x3901('0x2f')]=_['map'](_0x53c640,_0x3901('0x2a'));_0x24c0f5[_0x3901('0x30')]=_[_0x3901('0x31')](_0x2cf0b0[_0x3901('0x30')]);_0x24c0f5[_0x3901('0x32')]=_[_0x3901('0x33')](_0x24c0f5[_0x3901('0x2f')],_0x24c0f5[_0x3901('0x30')]);_0x5c474e[_0x3901('0x34')]=_['intersection'](_0x24c0f5[_0x3901('0x2f')],qs[_0x3901('0x35')](_0x2cf0b0[_0x3901('0x30')][_0x3901('0x35')]));_0x5c474e[_0x3901('0x34')]=_0x5c474e['attributes'][_0x3901('0x36')]?_0x5c474e['attributes']:_0x24c0f5[_0x3901('0x2f')];if(!_0x2cf0b0[_0x3901('0x30')][_0x3901('0x37')](_0x3901('0x38'))){_0x5c474e[_0x3901('0x1f')]=qs[_0x3901('0x1f')](_0x2cf0b0['query'][_0x3901('0x1f')]);_0x5c474e['offset']=qs['offset'](_0x2cf0b0[_0x3901('0x30')]['offset']);}_0x5c474e[_0x3901('0x39')]=qs['sort'](_0x2cf0b0[_0x3901('0x30')][_0x3901('0x3a')]);_0x5c474e[_0x3901('0x3b')]=qs[_0x3901('0x32')](_[_0x3901('0x3c')](_0x2cf0b0['query'],_0x24c0f5[_0x3901('0x32')]),_0x53c640);if(_0x2cf0b0[_0x3901('0x30')][_0x3901('0x3d')]){_0x5c474e[_0x3901('0x3b')]=_[_0x3901('0x3e')](_0x5c474e['where'],{'$or':_[_0x3901('0x2c')](_0x53c640,function(_0x37ca77){if(_0x37ca77[_0x3901('0x3f')]!==_0x3901('0x40')){var _0x369875={};_0x369875[_0x37ca77['name']]={'$like':'%'+_0x2cf0b0[_0x3901('0x30')][_0x3901('0x3d')]+'%'};return _0x369875;}})});}_0x5c474e=_['merge']({},_0x5c474e,_0x2cf0b0[_0x3901('0x41')]);var _0x3f2528={'where':_0x5c474e[_0x3901('0x3b')]};return db[_0x3901('0x42')][_0x3901('0x21')](_0x3f2528)[_0x3901('0x43')](function(_0xacb651){_0xc49b9b[_0x3901('0x21')]=_0xacb651;if(_0x2cf0b0[_0x3901('0x30')][_0x3901('0x44')]){_0x5c474e[_0x3901('0x45')]=[{'all':!![]}];}return db[_0x3901('0x42')][_0x3901('0x46')](_0x5c474e);})[_0x3901('0x43')](function(_0x5be445){_0xc49b9b[_0x3901('0x47')]=_0x5be445;return _0xc49b9b;})['then'](respondWithFilteredResult(_0x556d91,_0x5c474e))[_0x3901('0x48')](handleError(_0x556d91,null));};exports[_0x3901('0x49')]=function(_0x3989e1,_0x504d53){var _0x550bc7={'raw':![],'where':{'id':_0x3989e1[_0x3901('0x4a')]['id']}},_0x42b24a={};_0x42b24a[_0x3901('0x2f')]=_[_0x3901('0x31')](db[_0x3901('0x42')]['rawAttributes']);_0x42b24a[_0x3901('0x30')]=_[_0x3901('0x31')](_0x3989e1[_0x3901('0x30')]);_0x42b24a[_0x3901('0x32')]=_[_0x3901('0x33')](_0x42b24a[_0x3901('0x2f')],_0x42b24a[_0x3901('0x30')]);_0x550bc7[_0x3901('0x34')]=_[_0x3901('0x33')](_0x42b24a[_0x3901('0x2f')],qs[_0x3901('0x35')](_0x3989e1[_0x3901('0x30')][_0x3901('0x35')]));_0x550bc7['attributes']=_0x550bc7[_0x3901('0x34')][_0x3901('0x36')]?_0x550bc7[_0x3901('0x34')]:_0x42b24a[_0x3901('0x2f')];if(_0x3989e1[_0x3901('0x30')][_0x3901('0x44')]){_0x550bc7[_0x3901('0x45')]=[{'all':!![]}];}_0x550bc7=_[_0x3901('0x3e')]({},_0x550bc7,_0x3989e1[_0x3901('0x41')]);return db[_0x3901('0x42')][_0x3901('0x4b')](_0x550bc7)[_0x3901('0x43')](handleEntityNotFound(_0x504d53,null))[_0x3901('0x43')](respondWithResult(_0x504d53,null))['catch'](handleError(_0x504d53,null));};exports['create']=function(_0x5434c0,_0x2dfba1){return db['UserProfile'][_0x3901('0x4c')](_0x5434c0[_0x3901('0x4d')],{})['then'](respondWithResult(_0x2dfba1,0xc9))[_0x3901('0x48')](handleError(_0x2dfba1,null));};exports['clone']=function(_0x8b3968,_0xeea334){var _0x53b156={'where':{'id':_0x8b3968[_0x3901('0x4a')]['id']}},_0xd0f90e={};_0xd0f90e['model']=_[_0x3901('0x31')](db[_0x3901('0x42')][_0x3901('0x4e')]);_0x53b156[_0x3901('0x34')]=_[_0x3901('0x33')](_0xd0f90e[_0x3901('0x2f')],qs['fields'](_0x8b3968[_0x3901('0x30')]['fields']));_0x53b156[_0x3901('0x34')]=_0x53b156[_0x3901('0x34')][_0x3901('0x36')]?_0x53b156[_0x3901('0x34')]:_0xd0f90e['model'];if(_0x8b3968['query']['includeAll']){_0x53b156[_0x3901('0x45')]=[{'all':!![]}];}_0x53b156=_[_0x3901('0x3e')]({},_0x53b156,_0x8b3968['options']);return db[_0x3901('0x42')][_0x3901('0x4b')](_0x53b156)[_0x3901('0x43')](handleEntityNotFound(_0xeea334,null))[_0x3901('0x43')](function(_0x5aafad){if(_0x5aafad){var _0x5c545e=_0x5aafad[_0x3901('0x4f')]({'plain':!![]});_0x5c545e=qs['omit'](_0x5c545e,['id',_0x3901('0x50'),_0x3901('0x51'),_0x3901('0x52')]);_0x8b3968[_0x3901('0x4d')]=_['omit'](_0x8b3968[_0x3901('0x4d')],['id',_0x3901('0x50'),_0x3901('0x51')]);return db['sequelize']['transaction'](function(_0x3221fa){return db[_0x3901('0x42')][_0x3901('0x4c')](_['merge'](_0x5c545e,_0x8b3968[_0x3901('0x4d')]),{'include':_0x8b3968[_0x3901('0x30')][_0x3901('0x44')]?[{'all':!![]}]:undefined,'transaction':_0x3221fa})['then'](function(_0x4febd4){var _0x39e3c4=_0x4febd4[_0x3901('0x4f')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x8b3968[_0x3901('0x4a')]['id']},'raw':!![]})['then'](function(_0x414a96){if(_0x414a96){return BPromise[_0x3901('0x53')](_0x414a96,function(_0x145eea){return new BPromise(function(_0x2444fd,_0x4ee8f1){if(_0x145eea[_0x3901('0x54')]===null||_0x145eea[_0x3901('0x54')]===0x1)_0x2444fd(null);return db[_0x3901('0x55')]['findAll']({'where':{'sectionId':_0x145eea['id']},'raw':!![]})['then'](function(_0x447eef){var _0x1cc2f7=_[_0x3901('0x2c')](_0x447eef,function(_0x583d64){return qs[_0x3901('0x56')](_0x583d64,['id',_0x3901('0x50'),_0x3901('0x51'),_0x3901('0x57')]);});_0x2444fd(_0x1cc2f7);})[_0x3901('0x48')](function(_0x4a4c86){_0x4ee8f1(_0x4a4c86);});})[_0x3901('0x43')](function(_0x292384){var _0x1107b5=qs[_0x3901('0x56')](_0x145eea,['id','createdAt','updatedAt']);_0x1107b5[_0x3901('0x58')]=_0x39e3c4['id'];if(_0x292384)_0x1107b5[_0x3901('0x59')]=_0x292384;return _0x1107b5;})['then'](function(_0x338f99){return db[_0x3901('0x5a')][_0x3901('0x4c')](_0x338f99,{'include':[{'model':db['UserProfileResource'],'as':_0x3901('0x59')}],'raw':!![],'transaction':_0x3221fa});});})[_0x3901('0x43')](function(){return _0x39e3c4;});}});});});}})['then'](respondWithResult(_0xeea334,0xc9))[_0x3901('0x48')](handleError(_0xeea334,null));};exports[_0x3901('0x27')]=function(_0xa5148b,_0x44da28){if(_0xa5148b[_0x3901('0x4d')]['id']){delete _0xa5148b[_0x3901('0x4d')]['id'];}return db[_0x3901('0x42')][_0x3901('0x4b')]({'where':{'id':_0xa5148b[_0x3901('0x4a')]['id']}})['then'](handleEntityNotFound(_0x44da28,null))['then'](saveUpdates(_0xa5148b[_0x3901('0x4d')],null))[_0x3901('0x43')](respondWithResult(_0x44da28,null))[_0x3901('0x48')](handleError(_0x44da28,null));};exports['destroy']=function(_0x51f735,_0x3472fe){return db[_0x3901('0x42')][_0x3901('0x4b')]({'where':{'id':_0x51f735[_0x3901('0x4a')]['id']}})[_0x3901('0x43')](handleEntityNotFound(_0x3472fe,null))[_0x3901('0x43')](removeEntity(_0x3472fe,null))[_0x3901('0x48')](handleError(_0x3472fe,null));};exports[_0x3901('0x5b')]=function(_0x2c5bb1,_0x401d71){return db[_0x3901('0x42')][_0x3901('0x5b')]()[_0x3901('0x43')](respondWithResult(_0x401d71,null))[_0x3901('0x48')](handleError(_0x401d71,null));};exports[_0x3901('0x5c')]=function(_0x5d9f9a,_0x2f5ffa){var _0x560a9a=_0x5d9f9a['body'];return db[_0x3901('0x42')]['find']({'where':{'id':_0x5d9f9a[_0x3901('0x4a')]['id']}})[_0x3901('0x43')](handleEntityNotFound(_0x2f5ffa,null))[_0x3901('0x43')](function(_0x380e17){if(_0x380e17){return db[_0x3901('0x5d')][_0x3901('0x5e')](function(_0xe20fdd){return db['UserProfileSection'][_0x3901('0x5f')]({'where':{'userProfileId':_0x5d9f9a[_0x3901('0x4a')]['id'],'sectionId':_[_0x3901('0x2c')](_0x560a9a,function(_0x44eba1){return _0x44eba1[_0x3901('0x57')];})},'transaction':_0xe20fdd})[_0x3901('0x43')](function(){var _0x5e5acd=_[_0x3901('0x2c')](_0x560a9a,function(_0x4e0e60){_0x4e0e60[_0x3901('0x58')]=_0x5d9f9a['params']['id'];return _0x4e0e60;});var _0x24fdfe=[];return BPromise['each'](_0x5e5acd,function(_0x28aa2c){return db['UserProfileSection'][_0x3901('0x4c')](_0x28aa2c,{'include':[{'model':db[_0x3901('0x55')],'as':_0x3901('0x59')}],'raw':!![],'transaction':_0xe20fdd})[_0x3901('0x43')](function(_0x18ccf4){_0x24fdfe[_0x3901('0x60')](_0x18ccf4[_0x3901('0x4f')]({'plain':!![]}));});})[_0x3901('0x43')](function(){return _0x24fdfe;});});});}})[_0x3901('0x43')](function(_0x3c15ba){return _0x3c15ba;})[_0x3901('0x43')](respondWithResult(_0x2f5ffa,null))[_0x3901('0x48')](handleError(_0x2f5ffa,null));};exports[_0x3901('0x61')]=function(_0x14a627,_0x196e45){var _0x101d86;return db[_0x3901('0x42')][_0x3901('0x4b')]({'where':{'id':_0x14a627['params']['id']},'attributes':['id','name']})[_0x3901('0x43')](handleEntityNotFound(_0x196e45,null))[_0x3901('0x43')](function(_0x2d3a9d){if(_0x2d3a9d){_0x101d86=_0x2d3a9d;return db['UserProfileSection'][_0x3901('0x5f')]({'where':{'userProfileId':_0x14a627[_0x3901('0x4a')]['id'],'sectionId':_0x14a627[_0x3901('0x30')]['ids']}});}})[_0x3901('0x43')](function(){return _0x101d86;})[_0x3901('0x43')](respondWithStatusCode(_0x196e45,null))[_0x3901('0x48')](handleError(_0x196e45,null));};exports[_0x3901('0x62')]=function(_0x5cfe60,_0x23387a){var _0x12dbe1=[];var _0x4953ff=[];return db[_0x3901('0x5a')][_0x3901('0x46')]({'where':{'userProfileId':_0x5cfe60[_0x3901('0x4a')]['id']},'raw':!![]})[_0x3901('0x43')](function(_0x5d58de){_0x12dbe1=_['filter'](_0x5d58de,function(_0x10fc47){return _0x10fc47['enabled']===0x1||_[_0x3901('0x63')]([0x3eb,0x709],_0x10fc47['sectionId']);});if(!_[_0x3901('0x64')](_0x12dbe1)){return _[_0x3901('0x2c')](_0x12dbe1,function(_0x19ba49){return _0x19ba49[_0x3901('0x57')];});}else{return;}})[_0x3901('0x43')](function(_0x457f0a){if(_0x457f0a)_0x4953ff=_0x457f0a;if(_[_0x3901('0x63')](_0x4953ff,0x64)){var _0x266d13=_[_0x3901('0x4b')](_0x12dbe1,{'sectionId':0x64});return hasDefaultDashboard(_0x266d13)[_0x3901('0x43')](function(_0xfe3400){return _['map'](_0x12dbe1,function(_0x4f9398){if(_0x4f9398[_0x3901('0x57')]===0x64){_0x4f9398[_0x3901('0x65')]=_0xfe3400;}return _0x4f9398;});});}else{return;}})[_0x3901('0x43')](function(_0xdf4cad){if(_0xdf4cad)_0x12dbe1=_0xdf4cad;if(_[_0x3901('0x63')](_0x4953ff,0x3eb)){var _0x4c5a02=_[_0x3901('0x4b')](_0x12dbe1,{'sectionId':0x3eb});return getCustomDashboards(_0x4c5a02)['then'](function(_0x47f006){return _[_0x3901('0x2c')](_0x12dbe1,function(_0x442149){if(_0x4c5a02['enabled']){if(_0x442149[_0x3901('0x57')]===0x3eb){_0x442149['subsections']=_0x47f006;}}else{if(_0x442149[_0x3901('0x57')]===0x64){if(!_0x442149[_0x3901('0x65')]){_0x442149[_0x3901('0x65')]=[];}_0x442149[_0x3901('0x65')]=_0x442149[_0x3901('0x65')][_0x3901('0x66')](_0x47f006);}}return _0x442149;});});}else{return;}})[_0x3901('0x43')](function(_0x58d1ac){if(_0x58d1ac)_0x12dbe1=_0x58d1ac;if(_['includes'](_0x4953ff,0x709)){var _0x3a1c06=_[_0x3901('0x4b')](_0x12dbe1,{'sectionId':0x709});return getPlugins(_0x3a1c06)['then'](function(_0x4abaf4){if(_0x3a1c06[_0x3901('0x67')]){return _['map'](_0x12dbe1,function(_0x1bceee){if(_0x1bceee['sectionId']===0x709){_0x1bceee[_0x3901('0x65')]=_0x4abaf4;}return _0x1bceee;});}else{var _0x131d6e={'sectionId':0x76c,'enabled':0x1,'subsections':_0x4abaf4};var _0x435f78=_[_0x3901('0x2c')](_0x12dbe1);_0x435f78['push'](_0x131d6e);return _0x435f78;}});}else{return;}})[_0x3901('0x43')](function(_0x4035c3){if(_0x4035c3)_0x12dbe1=_0x4035c3;return _[_0x3901('0x3d')](_0x12dbe1,['enabled',0x1]);})[_0x3901('0x43')](respondWithResult(_0x23387a,null))['catch'](handleError(_0x23387a,null));};function hasDefaultDashboard(_0x25ce89){var _0xbebb37=[0x65];return new BPromise(function(_0x847392,_0x2964d2){try{if(_0x25ce89[_0x3901('0x54')]){_0x847392(_0xbebb37);}else{return db[_0x3901('0x55')]['findOne']({'where':{'sectionId':_0x25ce89['id']},'raw':!![]})[_0x3901('0x43')](function(_0x31b023){_0x31b023?_0x847392(_0xbebb37):_0x847392();});}}catch(_0x258f34){_0x2964d2(_0x258f34);}});}function getCustomDashboards(_0x436777){var _0x3293eb=[];return new BPromise(function(_0x858391,_0x4b8828){try{if(_0x436777['autoAssociation']){return db[_0x3901('0x68')]['findAll']({'raw':!![]})[_0x3901('0x43')](function(_0x14bf71){_0x14bf71[_0x3901('0x69')](function(_0x5c2a60){_0x3293eb[_0x3901('0x60')](_0x5c2a60['id']+0x1869f);});_0x858391(_0x3293eb);});}else{return db[_0x3901('0x55')][_0x3901('0x46')]({'where':{'sectionId':_0x436777['id']},'raw':!![]})[_0x3901('0x43')](function(_0x1f98c6){_0x1f98c6[_0x3901('0x69')](function(_0x5ba169){_0x3293eb['push'](_0x5ba169[_0x3901('0x6a')]+0x1869f);});_0x858391(_0x3293eb);});}}catch(_0x150958){_0x4b8828(_0x150958);}});}function getPlugins(_0x4c9dea){var _0x579d3c=[];return new BPromise(function(_0x247f99,_0x32b320){try{if(_0x4c9dea[_0x3901('0x54')]){return db[_0x3901('0x6b')][_0x3901('0x46')]({'raw':!![]})[_0x3901('0x43')](function(_0x561366){_0x561366['forEach'](function(_0x371264){_0x579d3c[_0x3901('0x60')](_0x371264['id']+0x15b38);});_0x247f99(_0x579d3c);});}else{return db[_0x3901('0x55')][_0x3901('0x46')]({'where':{'sectionId':_0x4c9dea['id']},'raw':!![]})[_0x3901('0x43')](function(_0x11ad58){_0x11ad58['forEach'](function(_0x10c7b8){_0x579d3c['push'](_0x10c7b8[_0x3901('0x6a')]+0x15b38);});_0x247f99(_0x579d3c);});}}catch(_0xbe9e4a){_0x32b320(_0xbe9e4a);}});}exports[_0x3901('0x6c')]=function(_0x3d0a68,_0x58f383){return db['UserProfile'][_0x3901('0x4b')]({'where':{'id':_0x3d0a68[_0x3901('0x4a')]['id']}})[_0x3901('0x43')](handleEntityNotFound(_0x58f383,null))[_0x3901('0x43')](function(_0x349b04){if(_0x349b04){return db[_0x3901('0x5d')][_0x3901('0x5e')](function(_0x32d53a){return db[_0x3901('0x5a')][_0x3901('0x46')]({'where':{'userProfileId':_0x3d0a68['params']['id']},'attributes':['id'],'raw':!![]})[_0x3901('0x43')](function(_0x3e36fb){if(_0x3e36fb){return db[_0x3901('0x5a')][_0x3901('0x5f')]({'where':{'userProfileId':_0x3d0a68[_0x3901('0x4a')]['id'],'id':_[_0x3901('0x2c')](_0x3e36fb,function(_0x20dbae){return _0x20dbae['id'];})},'transaction':_0x32d53a});}})['then'](function(_0x29701e){var _0x497464=_['map'](_0x3d0a68[_0x3901('0x4d')],function(_0x2d1b7e){_0x2d1b7e['userProfileId']=_0x3d0a68['params']['id'];return _0x2d1b7e;});return db[_0x3901('0x5a')]['bulkCreate'](_0x497464,{'raw':!![],'transaction':_0x32d53a});})['then'](function(_0x1f79c1){var _0x5133b0=_[_0x3901('0x3d')](_[_0x3901('0x2c')](_0x1f79c1,function(_0x79fb23){return _0x79fb23[_0x3901('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x5133b0){return db[_0x3901('0x5a')][_0x3901('0x46')]({'where':{'userProfileId':_0x3d0a68[_0x3901('0x4a')]['id'],'sectionId':_[_0x3901('0x2c')](_0x5133b0,function(_0x3fe501){return _0x3fe501[_0x3901('0x57')];})},'attributes':['id',_0x3901('0x57')],'raw':!![]})[_0x3901('0x43')](function(_0x155c35){var _0x4c09d8=_[_0x3901('0x2c')](_0x3d0a68[_0x3901('0x4d')],function(_0x58c7b1){_0x58c7b1[_0x3901('0x58')]=_0x3d0a68[_0x3901('0x4a')]['id'];return _0x58c7b1;});return db['UserProfileResource'][_0x3901('0x6d')](_0x4c09d8,{'raw':!![],'transaction':_0x32d53a});});}})['catch'](handleError(_0x58f383,null));});}})[_0x3901('0x43')](function(_0x460776){var _0x49c334=_[_0x3901('0x2c')](_0x460776,function(_0x51b639){return _0x51b639[_0x3901('0x4f')]({'plain':!![]});});})[_0x3901('0x43')](respondWithResult(_0x58f383,null))[_0x3901('0x48')](handleError(_0x58f383,null));};exports[_0x3901('0x6e')]=function(_0x1223df,_0x18c4e5,_0x39aa52){return db[_0x3901('0x42')][_0x3901('0x4b')]({'where':{'id':_0x1223df['params']['id']}})[_0x3901('0x43')](handleEntityNotFound(_0x18c4e5,null))[_0x3901('0x43')](function(_0x40df62){if(_0x40df62){return _0x40df62[_0x3901('0x6e')](_0x1223df[_0x3901('0x30')]['ids']);}})[_0x3901('0x43')](respondWithStatusCode(_0x18c4e5,null))[_0x3901('0x48')](handleError(_0x18c4e5,null));};exports[_0x3901('0x6f')]=function(_0x279d8f,_0x12ef69){var _0x514fcc={};if(!_0x279d8f[_0x3901('0x30')][_0x3901('0x70')])throw new Error(_0x3901('0x71'));if(!_0x279d8f[_0x3901('0x30')]['hasOwnProperty'](_0x3901('0x38'))){_0x514fcc['limit']=qs[_0x3901('0x1f')](_0x279d8f[_0x3901('0x30')][_0x3901('0x1f')]);_0x514fcc['offset']=qs[_0x3901('0x1e')](_0x279d8f[_0x3901('0x30')][_0x3901('0x1e')]);}return db[_0x3901('0x42')][_0x3901('0x4b')]({'where':{'id':_0x279d8f[_0x3901('0x4a')]['id']}})[_0x3901('0x43')](function(_0x397310){if(!_0x397310)throw new Error(_0x3901('0x72')+_0x279d8f[_0x3901('0x4a')]['id']);return db[_0x3901('0x42')][_0x3901('0x6f')](_0x279d8f);})[_0x3901('0x43')](respondWithFilteredResult(_0x12ef69,_0x514fcc))[_0x3901('0x48')](handleError(_0x12ef69,null));}; \ No newline at end of file +var _0x38d2=['removeSections','ids','getSections','enabled','isEmpty','includes','subsections','concat','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','getResources','section','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfile','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','clone','get','createdAt','updatedAt','sequelize','transaction','UserProfileSection','each','autoAssociation','omit','sectionId','userProfileId','Resources','UserProfileResource','describe','addSections','push'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x38d2,0x86));var _0x238d=function(_0x1ff20d,_0x2c7796){_0x1ff20d=_0x1ff20d-0x0;var _0x18be6a=_0x38d2[_0x1ff20d];return _0x18be6a;};'use strict';var emlformat=require(_0x238d('0x0'));var rimraf=require(_0x238d('0x1'));var zipdir=require(_0x238d('0x2'));var jsonpatch=require(_0x238d('0x3'));var rp=require(_0x238d('0x4'));var moment=require(_0x238d('0x5'));var BPromise=require(_0x238d('0x6'));var Mustache=require(_0x238d('0x7'));var util=require(_0x238d('0x8'));var path=require(_0x238d('0x9'));var sox=require(_0x238d('0xa'));var csv=require('to-csv');var ejs=require(_0x238d('0xb'));var fs=require('fs');var fs_extra=require(_0x238d('0xc'));var _=require(_0x238d('0xd'));var squel=require(_0x238d('0xe'));var crypto=require(_0x238d('0xf'));var jsforce=require(_0x238d('0x10'));var deskjs=require(_0x238d('0x11'));var toCsv=require('to-csv');var querystring=require(_0x238d('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x238d('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x238d('0x14'));var logger=require(_0x238d('0x15'))(_0x238d('0x16'));var utils=require(_0x238d('0x17'));var config=require(_0x238d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x238d('0x19'))['db'];config[_0x238d('0x1a')]=_['defaults'](config[_0x238d('0x1a')],{'host':_0x238d('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x238d('0x1a')]));require('./userProfile.socket')[_0x238d('0x1c')](socket);function respondWithStatusCode(_0x2eabf1,_0xd49479){_0xd49479=_0xd49479||0xcc;return function(_0x1975c0){if(_0x1975c0){return _0x2eabf1[_0x238d('0x1d')](_0xd49479);}return _0x2eabf1['status'](_0xd49479)[_0x238d('0x1e')]();};}function respondWithResult(_0x4abf9a,_0xa9b50b){_0xa9b50b=_0xa9b50b||0xc8;return function(_0x1d34f5){if(_0x1d34f5){return _0x4abf9a[_0x238d('0x1f')](_0xa9b50b)[_0x238d('0x20')](_0x1d34f5);}};}function respondWithFilteredResult(_0x587bbd,_0x2bb7a2){return function(_0x5aaa57){if(_0x5aaa57){var _0x23e0f0=typeof _0x2bb7a2[_0x238d('0x21')]===_0x238d('0x22')&&typeof _0x2bb7a2[_0x238d('0x23')]==='undefined';var _0x14b07a=_0x5aaa57[_0x238d('0x24')];var _0x33d6fd=_0x23e0f0?0x0:_0x2bb7a2[_0x238d('0x21')];var _0x2977df=_0x23e0f0?_0x5aaa57[_0x238d('0x24')]:_0x2bb7a2['offset']+_0x2bb7a2[_0x238d('0x23')];var _0x49c51c;if(_0x2977df>=_0x14b07a){_0x2977df=_0x14b07a;_0x49c51c=0xc8;}else{_0x49c51c=0xce;}_0x587bbd['status'](_0x49c51c);return _0x587bbd[_0x238d('0x25')](_0x238d('0x26'),_0x33d6fd+'-'+_0x2977df+'/'+_0x14b07a)['json'](_0x5aaa57);}return null;};}function patchUpdates(_0x5de17f){return function(_0x23d136){try{jsonpatch[_0x238d('0x27')](_0x23d136,_0x5de17f,!![]);}catch(_0x130c15){return BPromise[_0x238d('0x28')](_0x130c15);}return _0x23d136[_0x238d('0x29')]();};}function saveUpdates(_0x435ad7,_0x3f1676){return function(_0x50d162){if(_0x50d162){return _0x50d162[_0x238d('0x2a')](_0x435ad7)[_0x238d('0x2b')](function(_0x533747){return _0x533747;});}return null;};}function removeEntity(_0x5571a5,_0x5cb130){return function(_0x14f43c){if(_0x14f43c){return _0x14f43c[_0x238d('0x2c')]()[_0x238d('0x2b')](function(){_0x5571a5[_0x238d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d86c8,_0x49bc5a){return function(_0x90ef99){if(!_0x90ef99){_0x2d86c8[_0x238d('0x1d')](0x194);}return _0x90ef99;};}function handleError(_0x453aa6,_0x5ce68b){_0x5ce68b=_0x5ce68b||0x1f4;return function(_0x34ff84){logger[_0x238d('0x2d')](_0x34ff84[_0x238d('0x2e')]);if(_0x34ff84[_0x238d('0x2f')]){delete _0x34ff84['name'];}_0x453aa6[_0x238d('0x1f')](_0x5ce68b)[_0x238d('0x30')](_0x34ff84);};}exports[_0x238d('0x31')]=function(_0x3ddfaa,_0x42bb97){var _0x5c2457={},_0x4ff398={},_0x29d115={'count':0x0,'rows':[]};var _0x439435=_['map'](db[_0x238d('0x32')][_0x238d('0x33')],function(_0x31e9b5){return{'name':_0x31e9b5[_0x238d('0x34')],'type':_0x31e9b5[_0x238d('0x35')]['key']};});_0x4ff398[_0x238d('0x36')]=_[_0x238d('0x37')](_0x439435,_0x238d('0x2f'));_0x4ff398[_0x238d('0x38')]=_[_0x238d('0x39')](_0x3ddfaa[_0x238d('0x38')]);_0x4ff398[_0x238d('0x3a')]=_[_0x238d('0x3b')](_0x4ff398[_0x238d('0x36')],_0x4ff398['query']);_0x5c2457[_0x238d('0x3c')]=_[_0x238d('0x3b')](_0x4ff398['model'],qs[_0x238d('0x3d')](_0x3ddfaa[_0x238d('0x38')][_0x238d('0x3d')]));_0x5c2457[_0x238d('0x3c')]=_0x5c2457[_0x238d('0x3c')]['length']?_0x5c2457[_0x238d('0x3c')]:_0x4ff398[_0x238d('0x36')];if(!_0x3ddfaa[_0x238d('0x38')][_0x238d('0x3e')](_0x238d('0x3f'))){_0x5c2457['limit']=qs['limit'](_0x3ddfaa[_0x238d('0x38')]['limit']);_0x5c2457[_0x238d('0x21')]=qs[_0x238d('0x21')](_0x3ddfaa[_0x238d('0x38')][_0x238d('0x21')]);}_0x5c2457[_0x238d('0x40')]=qs[_0x238d('0x41')](_0x3ddfaa['query'][_0x238d('0x41')]);_0x5c2457[_0x238d('0x42')]=qs[_0x238d('0x3a')](_[_0x238d('0x43')](_0x3ddfaa[_0x238d('0x38')],_0x4ff398[_0x238d('0x3a')]),_0x439435);if(_0x3ddfaa[_0x238d('0x38')]['filter']){_0x5c2457['where']=_[_0x238d('0x44')](_0x5c2457[_0x238d('0x42')],{'$or':_[_0x238d('0x37')](_0x439435,function(_0x36cb33){if(_0x36cb33[_0x238d('0x35')]!==_0x238d('0x45')){var _0x1b8043={};_0x1b8043[_0x36cb33['name']]={'$like':'%'+_0x3ddfaa[_0x238d('0x38')][_0x238d('0x46')]+'%'};return _0x1b8043;}})});}_0x5c2457=_[_0x238d('0x44')]({},_0x5c2457,_0x3ddfaa['options']);var _0x484eac={'where':_0x5c2457[_0x238d('0x42')]};return db[_0x238d('0x32')]['count'](_0x484eac)['then'](function(_0x1e9695){_0x29d115[_0x238d('0x24')]=_0x1e9695;if(_0x3ddfaa[_0x238d('0x38')][_0x238d('0x47')]){_0x5c2457[_0x238d('0x48')]=[{'all':!![]}];}return db[_0x238d('0x32')][_0x238d('0x49')](_0x5c2457);})[_0x238d('0x2b')](function(_0x151376){_0x29d115[_0x238d('0x4a')]=_0x151376;return _0x29d115;})[_0x238d('0x2b')](respondWithFilteredResult(_0x42bb97,_0x5c2457))[_0x238d('0x4b')](handleError(_0x42bb97,null));};exports[_0x238d('0x4c')]=function(_0x1a7743,_0x496ad2){var _0x3a26b1={'raw':![],'where':{'id':_0x1a7743[_0x238d('0x4d')]['id']}},_0x2d767d={};_0x2d767d[_0x238d('0x36')]=_['keys'](db[_0x238d('0x32')]['rawAttributes']);_0x2d767d[_0x238d('0x38')]=_['keys'](_0x1a7743[_0x238d('0x38')]);_0x2d767d['filters']=_['intersection'](_0x2d767d['model'],_0x2d767d[_0x238d('0x38')]);_0x3a26b1[_0x238d('0x3c')]=_[_0x238d('0x3b')](_0x2d767d[_0x238d('0x36')],qs['fields'](_0x1a7743[_0x238d('0x38')][_0x238d('0x3d')]));_0x3a26b1['attributes']=_0x3a26b1[_0x238d('0x3c')][_0x238d('0x4e')]?_0x3a26b1[_0x238d('0x3c')]:_0x2d767d[_0x238d('0x36')];if(_0x1a7743[_0x238d('0x38')][_0x238d('0x47')]){_0x3a26b1[_0x238d('0x48')]=[{'all':!![]}];}_0x3a26b1=_[_0x238d('0x44')]({},_0x3a26b1,_0x1a7743[_0x238d('0x4f')]);return db[_0x238d('0x32')][_0x238d('0x50')](_0x3a26b1)[_0x238d('0x2b')](handleEntityNotFound(_0x496ad2,null))[_0x238d('0x2b')](respondWithResult(_0x496ad2,null))[_0x238d('0x4b')](handleError(_0x496ad2,null));};exports[_0x238d('0x51')]=function(_0x381cbc,_0x26bec1){return db[_0x238d('0x32')]['create'](_0x381cbc[_0x238d('0x52')],{})[_0x238d('0x2b')](respondWithResult(_0x26bec1,0xc9))[_0x238d('0x4b')](handleError(_0x26bec1,null));};exports[_0x238d('0x53')]=function(_0x1cb678,_0x3dbb24){var _0x20e684={'where':{'id':_0x1cb678[_0x238d('0x4d')]['id']}},_0x5f3e37={};_0x5f3e37['model']=_[_0x238d('0x39')](db['UserProfile']['rawAttributes']);_0x20e684['attributes']=_[_0x238d('0x3b')](_0x5f3e37[_0x238d('0x36')],qs[_0x238d('0x3d')](_0x1cb678[_0x238d('0x38')][_0x238d('0x3d')]));_0x20e684[_0x238d('0x3c')]=_0x20e684[_0x238d('0x3c')]['length']?_0x20e684['attributes']:_0x5f3e37[_0x238d('0x36')];if(_0x1cb678[_0x238d('0x38')][_0x238d('0x47')]){_0x20e684['include']=[{'all':!![]}];}_0x20e684=_[_0x238d('0x44')]({},_0x20e684,_0x1cb678['options']);return db['UserProfile'][_0x238d('0x50')](_0x20e684)[_0x238d('0x2b')](handleEntityNotFound(_0x3dbb24,null))[_0x238d('0x2b')](function(_0x423e80){if(_0x423e80){var _0x3ecaf7=_0x423e80[_0x238d('0x54')]({'plain':!![]});_0x3ecaf7=qs['omit'](_0x3ecaf7,['id',_0x238d('0x55'),_0x238d('0x56'),'crudPermissions']);_0x1cb678[_0x238d('0x52')]=_['omit'](_0x1cb678[_0x238d('0x52')],['id',_0x238d('0x55'),'updatedAt']);return db[_0x238d('0x57')][_0x238d('0x58')](function(_0xdfc4b8){return db['UserProfile'][_0x238d('0x51')](_['merge'](_0x3ecaf7,_0x1cb678[_0x238d('0x52')]),{'include':_0x1cb678[_0x238d('0x38')][_0x238d('0x47')]?[{'all':!![]}]:undefined,'transaction':_0xdfc4b8})[_0x238d('0x2b')](function(_0x4c9e91){var _0x284865=_0x4c9e91['get']({'plain':!![]});return db[_0x238d('0x59')][_0x238d('0x49')]({'where':{'userProfileId':_0x1cb678['params']['id']},'raw':!![]})[_0x238d('0x2b')](function(_0x16510e){if(_0x16510e){return BPromise[_0x238d('0x5a')](_0x16510e,function(_0x43f9a2){return new BPromise(function(_0x121409,_0x2e9141){if(_0x43f9a2[_0x238d('0x5b')]===null||_0x43f9a2[_0x238d('0x5b')]===0x1)_0x121409(null);return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x43f9a2['id']},'raw':!![]})[_0x238d('0x2b')](function(_0x5b6de9){var _0x20e405=_[_0x238d('0x37')](_0x5b6de9,function(_0x371c3a){return qs[_0x238d('0x5c')](_0x371c3a,['id',_0x238d('0x55'),_0x238d('0x56'),_0x238d('0x5d')]);});_0x121409(_0x20e405);})[_0x238d('0x4b')](function(_0x49c31d){_0x2e9141(_0x49c31d);});})[_0x238d('0x2b')](function(_0x497832){var _0x29723e=qs['omit'](_0x43f9a2,['id',_0x238d('0x55'),'updatedAt']);_0x29723e[_0x238d('0x5e')]=_0x284865['id'];if(_0x497832)_0x29723e[_0x238d('0x5f')]=_0x497832;return _0x29723e;})['then'](function(_0x44561d){return db[_0x238d('0x59')][_0x238d('0x51')](_0x44561d,{'include':[{'model':db[_0x238d('0x60')],'as':_0x238d('0x5f')}],'raw':!![],'transaction':_0xdfc4b8});});})[_0x238d('0x2b')](function(){return _0x284865;});}});});});}})[_0x238d('0x2b')](respondWithResult(_0x3dbb24,0xc9))[_0x238d('0x4b')](handleError(_0x3dbb24,null));};exports[_0x238d('0x2a')]=function(_0x3b7257,_0x1848cb){if(_0x3b7257[_0x238d('0x52')]['id']){delete _0x3b7257[_0x238d('0x52')]['id'];}return db[_0x238d('0x32')][_0x238d('0x50')]({'where':{'id':_0x3b7257[_0x238d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1848cb,null))[_0x238d('0x2b')](saveUpdates(_0x3b7257[_0x238d('0x52')],null))[_0x238d('0x2b')](respondWithResult(_0x1848cb,null))['catch'](handleError(_0x1848cb,null));};exports[_0x238d('0x2c')]=function(_0x46330f,_0x2d07c3){return db[_0x238d('0x32')]['find']({'where':{'id':_0x46330f['params']['id']}})[_0x238d('0x2b')](handleEntityNotFound(_0x2d07c3,null))['then'](removeEntity(_0x2d07c3,null))[_0x238d('0x4b')](handleError(_0x2d07c3,null));};exports[_0x238d('0x61')]=function(_0x9ec470,_0x4cced4){return db[_0x238d('0x32')][_0x238d('0x61')]()[_0x238d('0x2b')](respondWithResult(_0x4cced4,null))['catch'](handleError(_0x4cced4,null));};exports[_0x238d('0x62')]=function(_0x5e1393,_0x8c29d9){var _0x1368d5=_0x5e1393[_0x238d('0x52')];return db[_0x238d('0x32')][_0x238d('0x50')]({'where':{'id':_0x5e1393['params']['id']}})[_0x238d('0x2b')](handleEntityNotFound(_0x8c29d9,null))['then'](function(_0x10cebb){if(_0x10cebb){return db['sequelize']['transaction'](function(_0x2ecde6){return db[_0x238d('0x59')][_0x238d('0x2c')]({'where':{'userProfileId':_0x5e1393[_0x238d('0x4d')]['id'],'sectionId':_['map'](_0x1368d5,function(_0x3ae2aa){return _0x3ae2aa['sectionId'];})},'transaction':_0x2ecde6})['then'](function(){var _0x56c7c0=_[_0x238d('0x37')](_0x1368d5,function(_0x4fb5f7){_0x4fb5f7['userProfileId']=_0x5e1393['params']['id'];return _0x4fb5f7;});var _0x557089=[];return BPromise['each'](_0x56c7c0,function(_0x43dd5a){return db[_0x238d('0x59')]['create'](_0x43dd5a,{'include':[{'model':db['UserProfileResource'],'as':_0x238d('0x5f')}],'raw':!![],'transaction':_0x2ecde6})[_0x238d('0x2b')](function(_0xea9e27){_0x557089[_0x238d('0x63')](_0xea9e27[_0x238d('0x54')]({'plain':!![]}));});})['then'](function(){return _0x557089;});});});}})[_0x238d('0x2b')](function(_0x5e49cb){return _0x5e49cb;})[_0x238d('0x2b')](respondWithResult(_0x8c29d9,null))['catch'](handleError(_0x8c29d9,null));};exports[_0x238d('0x64')]=function(_0x3ddf11,_0xbd6240){var _0x2c9308;return db['UserProfile'][_0x238d('0x50')]({'where':{'id':_0x3ddf11[_0x238d('0x4d')]['id']},'attributes':['id','name']})[_0x238d('0x2b')](handleEntityNotFound(_0xbd6240,null))['then'](function(_0xaebd00){if(_0xaebd00){_0x2c9308=_0xaebd00;return db[_0x238d('0x59')]['destroy']({'where':{'userProfileId':_0x3ddf11[_0x238d('0x4d')]['id'],'sectionId':_0x3ddf11[_0x238d('0x38')][_0x238d('0x65')]}});}})[_0x238d('0x2b')](function(){return _0x2c9308;})['then'](respondWithStatusCode(_0xbd6240,null))['catch'](handleError(_0xbd6240,null));};exports[_0x238d('0x66')]=function(_0x370148,_0x43b866){var _0xd770b3=[];var _0x1a58eb=[];return db[_0x238d('0x59')][_0x238d('0x49')]({'where':{'userProfileId':_0x370148['params']['id']},'raw':!![]})[_0x238d('0x2b')](function(_0x312dea){_0xd770b3=_['filter'](_0x312dea,function(_0x58bce3){return _0x58bce3[_0x238d('0x67')]===0x1||_['includes']([0x3eb,0x709],_0x58bce3[_0x238d('0x5d')]);});if(!_[_0x238d('0x68')](_0xd770b3)){return _[_0x238d('0x37')](_0xd770b3,function(_0x47abc1){return _0x47abc1['sectionId'];});}else{return;}})[_0x238d('0x2b')](function(_0x34f1ba){if(_0x34f1ba)_0x1a58eb=_0x34f1ba;if(_['includes'](_0x1a58eb,0x64)){var _0x8ffbd8=_[_0x238d('0x50')](_0xd770b3,{'sectionId':0x64});return hasDefaultDashboard(_0x8ffbd8)[_0x238d('0x2b')](function(_0x175890){return _[_0x238d('0x37')](_0xd770b3,function(_0x35443f){if(_0x35443f[_0x238d('0x5d')]===0x64){_0x35443f['subsections']=_0x175890;}return _0x35443f;});});}else{return;}})[_0x238d('0x2b')](function(_0x6c3684){if(_0x6c3684)_0xd770b3=_0x6c3684;if(_[_0x238d('0x69')](_0x1a58eb,0x3eb)){var _0x45ef2d=_[_0x238d('0x50')](_0xd770b3,{'sectionId':0x3eb});return getCustomDashboards(_0x45ef2d)[_0x238d('0x2b')](function(_0x1ea228){return _[_0x238d('0x37')](_0xd770b3,function(_0x4a4cb1){if(_0x45ef2d[_0x238d('0x67')]){if(_0x4a4cb1['sectionId']===0x3eb){_0x4a4cb1[_0x238d('0x6a')]=_0x1ea228;}}else{if(_0x4a4cb1[_0x238d('0x5d')]===0x64){if(!_0x4a4cb1[_0x238d('0x6a')]){_0x4a4cb1[_0x238d('0x6a')]=[];}_0x4a4cb1[_0x238d('0x6a')]=_0x4a4cb1[_0x238d('0x6a')][_0x238d('0x6b')](_0x1ea228);}}return _0x4a4cb1;});});}else{return;}})[_0x238d('0x2b')](function(_0x2b645a){if(_0x2b645a)_0xd770b3=_0x2b645a;if(_[_0x238d('0x69')](_0x1a58eb,0x709)){var _0xe4785f=_['find'](_0xd770b3,{'sectionId':0x709});return getPlugins(_0xe4785f)['then'](function(_0x1164b1){if(_0xe4785f[_0x238d('0x67')]){return _[_0x238d('0x37')](_0xd770b3,function(_0x262f66){if(_0x262f66[_0x238d('0x5d')]===0x709){_0x262f66[_0x238d('0x6a')]=_0x1164b1;}return _0x262f66;});}else{var _0x40639c={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1164b1};var _0x21048a=_[_0x238d('0x37')](_0xd770b3);_0x21048a[_0x238d('0x63')](_0x40639c);return _0x21048a;}});}else{return;}})[_0x238d('0x2b')](function(_0x509029){if(_0x509029)_0xd770b3=_0x509029;return _[_0x238d('0x46')](_0xd770b3,[_0x238d('0x67'),0x1]);})[_0x238d('0x2b')](respondWithResult(_0x43b866,null))[_0x238d('0x4b')](handleError(_0x43b866,null));};function hasDefaultDashboard(_0x5b135b){var _0x5c95d8=[0x65];return new BPromise(function(_0x47b785,_0x5bdc6c){try{if(_0x5b135b[_0x238d('0x5b')]){_0x47b785(_0x5c95d8);}else{return db[_0x238d('0x60')]['findOne']({'where':{'sectionId':_0x5b135b['id']},'raw':!![]})[_0x238d('0x2b')](function(_0x5984d7){_0x5984d7?_0x47b785(_0x5c95d8):_0x47b785();});}}catch(_0x511f5f){_0x5bdc6c(_0x511f5f);}});}function getCustomDashboards(_0x973a21){var _0x5c30b7=[];return new BPromise(function(_0x17ce40,_0x1e7797){try{if(_0x973a21[_0x238d('0x5b')]){return db['Dashboard'][_0x238d('0x49')]({'raw':!![]})[_0x238d('0x2b')](function(_0x31dc69){_0x31dc69[_0x238d('0x6c')](function(_0x4729bc){_0x5c30b7['push'](_0x4729bc['id']+0x1869f);});_0x17ce40(_0x5c30b7);});}else{return db[_0x238d('0x60')][_0x238d('0x49')]({'where':{'sectionId':_0x973a21['id']},'raw':!![]})[_0x238d('0x2b')](function(_0x310ae2){_0x310ae2['forEach'](function(_0x1008e4){_0x5c30b7[_0x238d('0x63')](_0x1008e4['resourceId']+0x1869f);});_0x17ce40(_0x5c30b7);});}}catch(_0xce9380){_0x1e7797(_0xce9380);}});}function getPlugins(_0x4609c1){var _0x16a594=[];return new BPromise(function(_0x727743,_0x42dcd7){try{if(_0x4609c1[_0x238d('0x5b')]){return db[_0x238d('0x6d')][_0x238d('0x49')]({'raw':!![]})['then'](function(_0x3cb4a6){_0x3cb4a6['forEach'](function(_0x51a8e9){_0x16a594[_0x238d('0x63')](_0x51a8e9['id']+0x15b38);});_0x727743(_0x16a594);});}else{return db[_0x238d('0x60')]['findAll']({'where':{'sectionId':_0x4609c1['id']},'raw':!![]})[_0x238d('0x2b')](function(_0x28e9ff){_0x28e9ff[_0x238d('0x6c')](function(_0x168c58){_0x16a594[_0x238d('0x63')](_0x168c58[_0x238d('0x6e')]+0x15b38);});_0x727743(_0x16a594);});}}catch(_0x4923cc){_0x42dcd7(_0x4923cc);}});}exports[_0x238d('0x6f')]=function(_0x307f64,_0x26a94f){return db[_0x238d('0x32')][_0x238d('0x50')]({'where':{'id':_0x307f64[_0x238d('0x4d')]['id']}})[_0x238d('0x2b')](handleEntityNotFound(_0x26a94f,null))['then'](function(_0x2c6d86){if(_0x2c6d86){return db[_0x238d('0x57')]['transaction'](function(_0x39bcaa){return db[_0x238d('0x59')][_0x238d('0x49')]({'where':{'userProfileId':_0x307f64['params']['id']},'attributes':['id'],'raw':!![]})[_0x238d('0x2b')](function(_0x4ded8b){if(_0x4ded8b){return db[_0x238d('0x59')]['destroy']({'where':{'userProfileId':_0x307f64[_0x238d('0x4d')]['id'],'id':_[_0x238d('0x37')](_0x4ded8b,function(_0x41794a){return _0x41794a['id'];})},'transaction':_0x39bcaa});}})[_0x238d('0x2b')](function(_0x1def13){var _0x519437=_[_0x238d('0x37')](_0x307f64[_0x238d('0x52')],function(_0x3fecfd){_0x3fecfd['userProfileId']=_0x307f64['params']['id'];return _0x3fecfd;});return db['UserProfileSection'][_0x238d('0x70')](_0x519437,{'raw':!![],'transaction':_0x39bcaa});})['then'](function(_0x203710){var _0x347044=_[_0x238d('0x46')](_['map'](_0x203710,function(_0x471859){return _0x471859[_0x238d('0x54')]({'plain':!![]});}),{'includeAll':![]});if(_0x347044){return db[_0x238d('0x59')][_0x238d('0x49')]({'where':{'userProfileId':_0x307f64[_0x238d('0x4d')]['id'],'sectionId':_['map'](_0x347044,function(_0x554ffc){return _0x554ffc[_0x238d('0x5d')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x238d('0x2b')](function(_0x28ed81){var _0x227e78=_['map'](_0x307f64[_0x238d('0x52')],function(_0x1e16d6){_0x1e16d6[_0x238d('0x5e')]=_0x307f64['params']['id'];return _0x1e16d6;});return db[_0x238d('0x60')][_0x238d('0x70')](_0x227e78,{'raw':!![],'transaction':_0x39bcaa});});}})[_0x238d('0x4b')](handleError(_0x26a94f,null));});}})['then'](function(_0x4d29c9){var _0x2b3595=_['map'](_0x4d29c9,function(_0x2c4079){return _0x2c4079[_0x238d('0x54')]({'plain':!![]});});})[_0x238d('0x2b')](respondWithResult(_0x26a94f,null))[_0x238d('0x4b')](handleError(_0x26a94f,null));};exports['removeResources']=function(_0xcd1880,_0x5d3b0d,_0x3098e5){return db[_0x238d('0x32')][_0x238d('0x50')]({'where':{'id':_0xcd1880[_0x238d('0x4d')]['id']}})[_0x238d('0x2b')](handleEntityNotFound(_0x5d3b0d,null))[_0x238d('0x2b')](function(_0xe483a1){if(_0xe483a1){return _0xe483a1[_0x238d('0x71')](_0xcd1880[_0x238d('0x38')][_0x238d('0x65')]);}})['then'](respondWithStatusCode(_0x5d3b0d,null))[_0x238d('0x4b')](handleError(_0x5d3b0d,null));};exports[_0x238d('0x72')]=function(_0x1ee6ea,_0x4cb571){var _0x173790={};if(!_0x1ee6ea['query'][_0x238d('0x73')])throw new Error('Missing\x20section\x20parameter');if(!_0x1ee6ea['query'][_0x238d('0x3e')](_0x238d('0x3f'))){_0x173790[_0x238d('0x23')]=qs['limit'](_0x1ee6ea[_0x238d('0x38')]['limit']);_0x173790[_0x238d('0x21')]=qs['offset'](_0x1ee6ea[_0x238d('0x38')][_0x238d('0x21')]);}return db[_0x238d('0x32')][_0x238d('0x50')]({'where':{'id':_0x1ee6ea[_0x238d('0x4d')]['id']}})['then'](function(_0x1ab7b7){if(!_0x1ab7b7)throw new Error(_0x238d('0x74')+_0x1ee6ea[_0x238d('0x4d')]['id']);return db[_0x238d('0x32')][_0x238d('0x72')](_0x1ee6ea);})[_0x238d('0x2b')](respondWithFilteredResult(_0x4cb571,_0x173790))[_0x238d('0x4b')](handleError(_0x4cb571,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index a2d7f1e..28791ea 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 _0x07d7=['exports','events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x332b7d,_0x18765b){var _0xcef350=function(_0x4e17fc){while(--_0x4e17fc){_0x332b7d['push'](_0x332b7d['shift']());}};_0xcef350(++_0x18765b);}(_0x07d7,0x85));var _0x707d=function(_0x2a6754,_0x277259){_0x2a6754=_0x2a6754-0x0;var _0x17feda=_0x07d7[_0x2a6754];return _0x17feda;};'use strict';var EventEmitter=require(_0x707d('0x0'));var UserProfile=require(_0x707d('0x1'))['db'][_0x707d('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x707d('0x3')](0x0);var events={'afterCreate':_0x707d('0x4'),'afterUpdate':_0x707d('0x5'),'afterDestroy':_0x707d('0x6')};function emitEvent(_0x3d6fed){return function(_0x38c520,_0x2a5ddd,_0x3b44c7){UserProfileEvents[_0x707d('0x7')](_0x3d6fed+':'+_0x38c520['id'],_0x38c520);UserProfileEvents[_0x707d('0x7')](_0x3d6fed,_0x38c520);_0x3b44c7(null);};}for(var e in events){if(events[_0x707d('0x8')](e)){var event=events[e];UserProfile[_0x707d('0x9')](e,emitEvent(event));}}module[_0x707d('0xa')]=UserProfileEvents; \ No newline at end of file +var _0x002d=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','UserProfile','update','remove'];(function(_0xeb0d44,_0x3ad8a2){var _0x1ef4db=function(_0x4e5946){while(--_0x4e5946){_0xeb0d44['push'](_0xeb0d44['shift']());}};_0x1ef4db(++_0x3ad8a2);}(_0x002d,0xca));var _0xd002=function(_0x182108,_0x315890){_0x182108=_0x182108-0x0;var _0x48612f=_0x002d[_0x182108];return _0x48612f;};'use strict';var EventEmitter=require(_0xd002('0x0'));var UserProfile=require(_0xd002('0x1'))['db'][_0xd002('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd002('0x3'),'afterDestroy':_0xd002('0x4')};function emitEvent(_0x1c0d0a){return function(_0x24ff42,_0x1323f0,_0x179915){UserProfileEvents[_0xd002('0x5')](_0x1c0d0a+':'+_0x24ff42['id'],_0x24ff42);UserProfileEvents[_0xd002('0x5')](_0x1c0d0a,_0x24ff42);_0x179915(null);};}for(var e in events){if(events[_0xd002('0x6')](e)){var event=events[e];UserProfile[_0xd002('0x7')](e,emitEvent(event));}}module[_0xd002('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8504de7..ef0b55c 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 _0x771e=['ZendeskAccount','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','Dashboard','Interval','pauses','Pause','scheduler','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','../../components/parsers/qs','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','union','ignore','autoAssociation','model','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','limit','offset','order','sort','filters','merge','key','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','count','ids','customSorting','extraQueryConditions','Tags','color','tag','rows','openTabs','chat','dataValues','sms','openchannel','./userProfile.attributes','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','CmContact','Lists','ListId','lists','companies','CmCompany','chatqueues','chatwebsites','ChatWebsite','FaxQueue','FaxAccount','internalroutes','outboundroutes','VoiceContext','voicemails','VoiceMail','voicerecordings','membername','role','agent','User','telephone','VoiceQueues','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','smsaccounts','SmsAccount','whatsappqueues','whatsappaccounts','teams','Team','voicequeues','queuecampaigns','QueueCampaigns','users','agents','telephones','Users','admin','user','Agents','Telephones'];(function(_0x7318c7,_0x4fbc46){var _0x589f4c=function(_0x500059){while(--_0x500059){_0x7318c7['push'](_0x7318c7['shift']());}};_0x589f4c(++_0x4fbc46);}(_0x771e,0x1df));var _0xe771=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x771e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var attributes=require(_0xe771('0x0'));var squel=require('squel');module[_0xe771('0x1')]=function(_0x1a266e){var _0x3d8db3=_0x1a266e[_0xe771('0x2')];function _0xffaffd(_0x756be6,_0x3f5c06){return new Promise(function(_0x4c6a72,_0x5e2709){if(!_0x3f5c06)return _0x4c6a72(null);var _0x4ba961=_0x3f5c06['filter']?{[_0x3f5c06[_0xe771('0x3')][_0xe771('0x4')]]:_0x3f5c06[_0xe771('0x3')][_0xe771('0x5')]}:undefined;return _0x3d8db3[_0x756be6][_0xe771('0x6')]({'where':_0x4ba961,'raw':!![]})[_0xe771('0x7')](function(_0x7447eb){_0x3f5c06[_0xe771('0x8')]=_[_0xe771('0x9')](_0x7447eb,'id');_0x4c6a72(_0x3f5c06);})[_0xe771('0xa')](function(_0x5d450a){_0x5e2709(_0x5d450a);});});}function _0x4bb587(_0x2ca97e,_0x4a41f1){return new Promise(function(_0x5b6545,_0x6e8c1e){var _0x66dc6d=_0x2ca97e[_0xe771('0x3')]?{[_0x2ca97e[_0xe771('0x3')][_0xe771('0x4')]]:_0x2ca97e[_0xe771('0x3')][_0xe771('0x5')]}:undefined;return _0x3d8db3[_0x2ca97e['model']][_0xe771('0x6')]({'where':_0x66dc6d,'raw':!![]})[_0xe771('0x7')](function(_0x188069){_0x4a41f1[_0xe771('0x8')]=_['map'](_0x188069,function(_0x12d24c){return _0x12d24c[_0xe771('0xb')];});_0x5b6545(_0x4a41f1);})[_0xe771('0xa')](function(_0x17e356){_0x6e8c1e(_0x17e356);});});}function _0x352245(_0x15a434,_0x3a6b78,_0x53d1c5){if(!_0x3a6b78)return Promise[_0xe771('0xc')](null);return new Promise(function(_0x45b7f5,_0x3dc920){return _0x3d8db3[_0xe771('0xd')][_0xe771('0x6')]({'where':{'sectionId':_0x3a6b78['id']},'raw':!![]})[_0xe771('0x7')](function(_0x42c0ed){if(_0x15a434[_0xe771('0x4')]&&_0x15a434[_0xe771('0x4')]!=='id'){_0x3a6b78[_0xe771('0x8')]=_['map'](_0x42c0ed,function(_0x5b9d57){return _0x5b9d57[_0x15a434[_0xe771('0x4')]];});}else{if(_0x53d1c5===_0xe771('0xe')){_0x3a6b78[_0xe771('0x8')]=_['map'](_0x42c0ed,function(_0x1727a0){return{'id':_0x1727a0[_0xe771('0xf')],'type':_0x1727a0[_0xe771('0x10')]};});}else{_0x3a6b78[_0xe771('0x8')]=_[_0xe771('0x9')](_0x42c0ed,function(_0x32a334){return _0x32a334[_0xe771('0xf')];});}}_0x45b7f5(_0x3a6b78);})[_0xe771('0xa')](function(_0x52c15f){_0x3dc920(_0x52c15f);});});}function _0x3b99a7(_0x3930c4,_0x19fc7d){var _0x2aec37={'parentSections':[]};switch(_0x3930c4[_0xe771('0x11')]()){case'squareprojects':_0x2aec37[_0xe771('0x12')]='SquareProject';break;case _0xe771('0x13'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x14');break;case _0xe771('0x15'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x16');_0x2aec37[_0xe771('0x17')]=[{'name':'SquareProjects','field':_0xe771('0xb'),'foreignKey':'projectName'}];break;case'projects':_0x2aec37[_0xe771('0x12')]='JscriptyProject';break;case'contacts':_0x2aec37['childModel']=_0xe771('0x18');_0x2aec37[_0xe771('0x17')]=[{'name':_0xe771('0x19'),'field':'id','foreignKey':_0xe771('0x1a')}];break;case _0xe771('0x1b'):_0x2aec37[_0xe771('0x12')]='CmList';break;case _0xe771('0x1c'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x1d');break;case'globalcustomfields':_0x2aec37['childModel']='CmCustomField';break;case _0xe771('0x1e'):_0x2aec37[_0xe771('0x12')]='ChatQueue';break;case _0xe771('0x1f'):_0x2aec37['childModel']=_0xe771('0x20');break;case'faxqueues':_0x2aec37[_0xe771('0x12')]=_0xe771('0x21');break;case'faxaccounts':_0x2aec37[_0xe771('0x12')]=_0xe771('0x22');break;case'inboundroutes':case _0xe771('0x23'):case _0xe771('0x24'):_0x2aec37[_0xe771('0x12')]='VoiceExtension';break;case'contexts':_0x2aec37[_0xe771('0x12')]=_0xe771('0x25');break;case _0xe771('0x26'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x27');break;case _0xe771('0x28'):_0x2aec37[_0xe771('0x12')]='VoiceRecording';_0x2aec37['parentSections']=[{'name':'Agents','field':_0xe771('0xb'),'foreignKey':_0xe771('0x29'),'model':'User','filter':{'field':_0xe771('0x2a'),'value':[_0xe771('0x2b')]}},{'name':'Telephones','field':_0xe771('0xb'),'foreignKey':'membername','model':_0xe771('0x2c'),'filter':{'field':_0xe771('0x2a'),'value':[_0xe771('0x2d')]}},{'name':_0xe771('0x2e'),'field':'name','foreignKey':_0xe771('0x2f'),'model':_0xe771('0x30'),'filter':{'field':_0xe771('0x10'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xe771('0xb'),'foreignKey':_0xe771('0x2f'),'model':_0xe771('0x30'),'filter':{'field':'type','value':[_0xe771('0x31')]}}];break;case _0xe771('0x32'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x33');break;case'chanspies':_0x2aec37[_0xe771('0x12')]=_0xe771('0x34');break;case _0xe771('0x35'):_0x2aec37['childModel']='VoicePrefix';break;case _0xe771('0x36'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x37');break;case _0xe771('0x38'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x39');break;case _0xe771('0x3a'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x3b');break;case _0xe771('0x3c'):_0x2aec37['childModel']='MailSubstatus';break;case _0xe771('0x3d'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x3e');break;case _0xe771('0x3f'):_0x2aec37['childModel']='OpenchannelAccount';break;case _0xe771('0x40'):_0x2aec37[_0xe771('0x12')]='SmsQueue';break;case _0xe771('0x41'):_0x2aec37['childModel']=_0xe771('0x42');break;case _0xe771('0x43'):_0x2aec37['childModel']='WhatsappQueue';break;case _0xe771('0x44'):_0x2aec37[_0xe771('0x12')]='WhatsappAccount';break;case _0xe771('0x45'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x46');break;case _0xe771('0x47'):case _0xe771('0x48'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x30');if(_0x19fc7d){_0x2aec37[_0xe771('0x17')]=[{'name':_0xe771('0x2e')},{'name':_0xe771('0x49')}];}break;case _0xe771('0x4a'):case _0xe771('0x4b'):case _0xe771('0x4c'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x2c');if(_0x19fc7d){_0x2aec37[_0xe771('0x17')]=[{'name':_0xe771('0x4d'),'filter':{'field':_0xe771('0x2a'),'value':[_0xe771('0x4e'),_0xe771('0x4f')]},'ignore':!![]},{'name':_0xe771('0x50')},{'name':_0xe771('0x51')}];}break;case'zendeskaccounts':_0x2aec37['childModel']=_0xe771('0x52');break;case'salesforceaccounts':_0x2aec37[_0xe771('0x12')]='SalesforceAccount';break;case'freshdeskaccounts':_0x2aec37['childModel']=_0xe771('0x53');break;case _0xe771('0x54'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x55');break;case _0xe771('0x56'):_0x2aec37[_0xe771('0x12')]='DeskAccount';break;case _0xe771('0x57'):_0x2aec37[_0xe771('0x12')]='ZohoAccount';break;case _0xe771('0x58'):_0x2aec37['childModel']='User';break;case _0xe771('0x59'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x5a');break;case'dispositions':_0x2aec37[_0xe771('0x12')]='Disposition';break;case _0xe771('0x5b'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x5c');break;case'intervals':_0x2aec37[_0xe771('0x12')]=_0xe771('0x5d');break;case _0xe771('0x5e'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x5f');break;case _0xe771('0x60'):_0x2aec37[_0xe771('0x12')]='Schedule';break;case _0xe771('0x61'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x62');break;case _0xe771('0x63'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x64');break;case _0xe771('0x65'):_0x2aec37['childModel']=_0xe771('0x66');break;case _0xe771('0x67'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x68');break;case'trunks':_0x2aec37[_0xe771('0x12')]=_0xe771('0x69');break;case _0xe771('0x6a'):_0x2aec37['childModel']=_0xe771('0x6b');break;case _0xe771('0x6c'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x6d');break;case _0xe771('0x6e'):_0x2aec37['childModel']=_0xe771('0xe');_0x2aec37[_0xe771('0x17')]=[{'name':_0xe771('0x6f'),'field':'id','foreignKey':_0xe771('0x70')}];break;case _0xe771('0x71'):_0x2aec37[_0xe771('0x12')]=_0xe771('0x72');break;}return _0x2aec37;}function _0x497acf(_0x221cf6,_0x5a7b25){var _0x3b1a8e=_0x221cf6[_0xe771('0x73')](0x0)[_0xe771('0x74')]()+_0x221cf6[_0xe771('0x75')](0x1);var _0x2c5d5e={'type':_0x3d8db3[_0xe771('0x76')]['QueryTypes'][_0xe771('0x77')],'raw':!![]};return new Promise(function(_0x112f92,_0x4ddbff){var _0x56d24a=squel[_0xe771('0x78')]()[_0xe771('0x4')](_0xe771('0x79')+_0x3b1a8e+_0xe771('0x7a'),'id')[_0xe771('0x4')](_0xe771('0x7b'))[_0xe771('0x7c')]('user_has_'+_0x221cf6+_0xe771('0x7d'),'ui')[_0xe771('0x7e')](_0xe771('0x7f'),_0x5a7b25['id']);return _0x3d8db3[_0xe771('0x80')][_0xe771('0x81')](_0x56d24a[_0xe771('0x82')](),_0x2c5d5e)[_0xe771('0x7')](function(_0x33e4fe){_0x5a7b25[_0x3b1a8e+_0xe771('0x83')]=_0x33e4fe;_0x112f92(_0x33e4fe);})[_0xe771('0xa')](function(_0x494432){_0x4ddbff(_0x494432);});});}return _0x1a266e[_0xe771('0x84')](_0xe771('0x85'),attributes,{'tableName':_0xe771('0x86'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x3e564b){var _0x12d9ab=require(_0xe771('0x87'));var _0x246657={'raw':_0x3e564b[_0xe771('0x81')][_0xe771('0x88')],'where':{}};var _0x44bf4a={};var _0x2acb75={'count':0x0,'rows':[]};var _0x2e1eac=_0x3e564b[_0xe771('0x81')][_0xe771('0x89')];var _0x3d894c=_0x3e564b['query'][_0xe771('0x8a')]||![];var _0x222be2=_0x3b99a7(_0x2e1eac,_0x3d894c);if(!_0x222be2['childModel'])throw new Error(_0xe771('0x8b')+_0x2e1eac+'\x27');var _0x3d5349=[{'name':_0x2e1eac}];if(!_[_0xe771('0x8c')](_0x222be2[_0xe771('0x17')]))_0x3d5349=_0x222be2[_0xe771('0x17')];var _0x229e34=[];for(var _0xc62771=0x0;_0xc62771<_0x3d5349[_0xe771('0x8d')];_0xc62771++){_0x229e34[_0xe771('0x8e')](_0x3d8db3[_0xe771('0x8f')][_0xe771('0x90')]({'where':{'userProfileId':_0x3e564b[_0xe771('0x91')]['id'],'name':_0x3d5349[_0xc62771][_0xe771('0xb')]},'raw':!![]}));}return Promise[_0xe771('0x92')](_0x229e34)[_0xe771('0x7')](function(_0x71c85f){var _0x1c83d4=_['filter'](_0x71c85f,function(_0x159148){return _0x159148?_0x159148:undefined;});var _0xb2be5f=_[_0xe771('0x3')](_0x3d5349,['ignore',!![]]);var _0x881ce4=_[_0xe771('0x8c')](_0x1c83d4)&&_['isEmpty'](_0xb2be5f)?null:_[_0xe771('0x93')](_0xb2be5f,_0x1c83d4);if(!_0x881ce4)return null;var _0x2a1a40=[];for(var _0x2151b4=0x0;_0x2151b4<_0x881ce4[_0xe771('0x8d')];_0x2151b4++){var _0x2a2417=_[_0xe771('0x90')](_0x3d5349,function(_0x563078){return _0x881ce4[_0x2151b4]?_0x563078[_0xe771('0xb')]===_0x881ce4[_0x2151b4][_0xe771('0xb')]:null;});if(_0x2a2417){if(_0x881ce4[_0x2151b4][_0xe771('0x94')]){_0x2a1a40['push'](_0xffaffd(_0x222be2[_0xe771('0x12')],_0x881ce4[_0x2151b4]));}else{if(!_0x881ce4[_0x2151b4][_0xe771('0x95')]){_0x2a1a40[_0xe771('0x8e')](_0x352245(_0x2a2417,_0x881ce4[_0x2151b4],_0x222be2['childModel']));}else{if(_0x2a2417[_0xe771('0x96')]){_0x2a1a40[_0xe771('0x8e')](_0x4bb587(_0x2a2417,_0x881ce4[_0x2151b4]));}}}}}return Promise['all'](_0x2a1a40);})[_0xe771('0x7')](function(_0x46c098){var _0x36e288=_0x46c098;var _0x2c028c=null;if(_0x36e288){_0x2c028c=_0x36e288[_0xe771('0x8d')]===0x1?_0x36e288[0x0]:null;}if(!_0x2c028c&&!_0x36e288)return _0x2acb75;var _0x152874=_0x3d8db3[_0x222be2['childModel']][_0xe771('0x97')];_0x44bf4a[_0xe771('0x96')]=_[_0xe771('0x98')](_0x152874);_0x44bf4a[_0xe771('0x81')]=_[_0xe771('0x98')](_0x3e564b[_0xe771('0x81')]);_0x44bf4a['filters']=_[_0xe771('0x99')](_0x44bf4a[_0xe771('0x96')],_0x44bf4a[_0xe771('0x81')]);_0x246657[_0xe771('0x9a')]=_[_0xe771('0x99')](_0x44bf4a[_0xe771('0x96')],_0x12d9ab[_0xe771('0x9b')](_0x3e564b[_0xe771('0x81')][_0xe771('0x9b')]));_0x246657['attributes']=_0x246657[_0xe771('0x9a')][_0xe771('0x8d')]?_0x246657[_0xe771('0x9a')]:_0x44bf4a[_0xe771('0x96')];if(!_0x3e564b[_0xe771('0x81')][_0xe771('0x9c')]('nolimit')){_0x246657[_0xe771('0x9d')]=_0x12d9ab[_0xe771('0x9d')](_0x3e564b[_0xe771('0x81')][_0xe771('0x9d')]);_0x246657[_0xe771('0x9e')]=_0x12d9ab[_0xe771('0x9e')](_0x3e564b[_0xe771('0x81')][_0xe771('0x9e')]);}_0x246657[_0xe771('0x9f')]=_0x12d9ab[_0xe771('0xa0')](_0x3e564b[_0xe771('0x81')]['sort']);_0x246657[_0xe771('0x7e')]=_0x12d9ab[_0xe771('0xa1')](_['pick'](_0x3e564b['query'],_0x44bf4a['filters']));if(_0x3e564b['query'][_0xe771('0x3')]){_0x246657[_0xe771('0x7e')]=_[_0xe771('0xa2')](_0x246657[_0xe771('0x7e')],{'$or':_[_0xe771('0x9')](_0x152874,function(_0x3b82d4){if(_0x3b82d4['type'][_0xe771('0xa3')]!=='VIRTUAL'){var _0x50c291={};_0x50c291[_0x3b82d4['field']]={'$like':'%'+_0x3e564b[_0xe771('0x81')][_0xe771('0x3')]+'%'};return _0x50c291;}})});}var _0x20a5e2=[];var _0x1ccb4e=null;var _0x4294bd={};if(_0x2c028c){_0x1ccb4e=_[_0xe771('0x90')](_0x3d5349,[_0xe771('0xb'),_0x2c028c[_0xe771('0xb')]]);if(_0x1ccb4e[_0xe771('0x4')]){_0x4294bd={};if(_0x222be2[_0xe771('0x12')]===_0xe771('0xe')){_0x4294bd[_0x1ccb4e[_0xe771('0xa4')]]=_[_0xe771('0x9')](_0x2c028c[_0xe771('0x8')],'id');}else{_0x4294bd[_0x1ccb4e['foreignKey']]=_0x2c028c[_0xe771('0x8')];}_0x20a5e2['push'](_0x4294bd);}else{_0x246657[_0xe771('0x7e')]['id']=_0x2c028c[_0xe771('0x8')];}}else{for(var _0x4a2d1d=0x0;_0x4a2d1d<_0x36e288[_0xe771('0x8d')];_0x4a2d1d++){_0x1ccb4e=_[_0xe771('0x90')](_0x3d5349,[_0xe771('0xb'),_0x36e288[_0x4a2d1d][_0xe771('0xb')]]);if(_0x1ccb4e[_0xe771('0x4')]){_0x4294bd={};_0x4294bd[_0x1ccb4e[_0xe771('0xa4')]]=_0x36e288[_0x4a2d1d][_0xe771('0x8')];_0x20a5e2[_0xe771('0x8e')](_0x4294bd);}else{if(!_0x246657[_0xe771('0x7e')]['id'])_0x246657['where']['id']=[];_0x36e288[_0x4a2d1d]['associatedResources'][_0xe771('0xa5')](function(_0xc00081){_0x246657[_0xe771('0x7e')]['id'][_0xe771('0x8e')](_0xc00081);});}}}if(!_[_0xe771('0x8c')](_0x20a5e2)){_0x246657['where']=_[_0xe771('0xa2')](_0x246657[_0xe771('0x7e')],{'$and':{'$or':_0x20a5e2}});}_0x246657=_[_0xe771('0xa2')]({},_0x246657,_0x3e564b[_0xe771('0xa6')]);if(_0x2c028c&&!_0x2c028c['autoAssociation']&&_0x222be2[_0xe771('0x12')]===_0xe771('0xe')){if(_0x3e564b[_0xe771('0x81')][_0xe771('0xa7')]){_0x246657[_0xe771('0xa8')]=[{'all':!![]}];}return _0x3d8db3[_0x222be2['childModel']]['findAll'](_0x246657)[_0xe771('0x7')](function(_0x2f7ed3){var _0x207fce=[];_0x2f7ed3[_0xe771('0xa5')](function(_0x47e0c1){var _0x2f4f0d;switch(_0x47e0c1[_0xe771('0xa9')]){case _0xe771('0xaa'):_0x2f4f0d=_[_0xe771('0x90')](_0x2c028c['associatedResources'],function(_0x3c8b07){return _0x3c8b07['id']===_0x47e0c1[_0xe771('0x70')]&&_0x3c8b07['type']===_0xe771('0xab');});break;case _0xe771('0xac'):_0x2f4f0d=_[_0xe771('0x90')](_0x2c028c[_0xe771('0x8')],function(_0x4a7ae8){return _0x4a7ae8['id']===_0x47e0c1['reportId']&&_0x4a7ae8['type']===_0xe771('0xad');});break;}if(_0x2f4f0d)_0x207fce[_0xe771('0x8e')](_0x47e0c1);});_0x2acb75[_0xe771('0xae')]=_0x207fce[_0xe771('0x8d')];_0x2acb75['rows']=_0x207fce;return _0x2acb75;});}else{if(!_[_0xe771('0x8c')](_0x3e564b['query'][_0xe771('0xaf')])){_0x246657['where']['id']=_0x246657[_0xe771('0x7e')]['id']?_[_0xe771('0x99')](_0x246657[_0xe771('0x7e')]['id'],_0x3e564b[_0xe771('0x81')]['ids']):_0x3e564b[_0xe771('0x81')][_0xe771('0xaf')];if(_0x3e564b[_0xe771('0x81')]['customSorting']){_0x246657[_0xe771('0x9f')]=_0x3e564b['query'][_0xe771('0xb0')];}}if(_0x3e564b[_0xe771('0x81')][_0xe771('0xb1')]){_0x246657[_0xe771('0x7e')]=_[_0xe771('0xa2')](_0x246657[_0xe771('0x7e')],{'$and':_0x3e564b[_0xe771('0x81')][_0xe771('0xb1')]});}return _0x3d8db3[_0x222be2[_0xe771('0x12')]]['count']({'where':_0x246657[_0xe771('0x7e')]})[_0xe771('0x7')](function(_0x27eb5c){_0x2acb75[_0xe771('0xae')]=_0x27eb5c;if(_0x3e564b['query']['includeAll']){if(_0x222be2[_0xe771('0x12')]===_0xe771('0x18')){_0x246657[_0xe771('0xa8')]=[{'model':_0x3d8db3[_0xe771('0x64')],'as':_0xe771('0xb2'),'attributes':['id',_0xe771('0xb'),_0xe771('0xb3')],'required':_0x3e564b[_0xe771('0x81')][_0xe771('0xb4')]?!![]:![]},{'model':_0x3d8db3[_0xe771('0x64')],'as':'ThroughTags','attributes':['id','name',_0xe771('0xb3')],'through':_0x3e564b[_0xe771('0x81')][_0xe771('0xb4')]?{'attributes':[],'where':{'TagId':_0x3e564b[_0xe771('0x81')][_0xe771('0xb4')]||undefined}}:{},'required':_0x3e564b[_0xe771('0x81')][_0xe771('0xb4')]?!![]:![]}];}else{_0x246657[_0xe771('0xa8')]=[{'all':!![]}];}}return _0x3d8db3[_0x222be2[_0xe771('0x12')]][_0xe771('0x6')](_0x246657);})['then'](function(_0x281684){_0x2acb75[_0xe771('0xb5')]=_0x281684;if(_0x2e1eac===_0xe771('0x50')&&_0x3e564b[_0xe771('0x81')][_0xe771('0xb6')]==='true'){var _0x37dc21=[];for(var _0x33a7f9=0x0;_0x33a7f9<_0x2acb75[_0xe771('0xb5')][_0xe771('0x8d')];_0x33a7f9++){_0x37dc21[_0xe771('0x8e')](_0x497acf(_0xe771('0xb7'),_0x2acb75[_0xe771('0xb5')][_0x33a7f9][_0xe771('0xb8')]));_0x37dc21[_0xe771('0x8e')](_0x497acf(_0xe771('0xb9'),_0x2acb75[_0xe771('0xb5')][_0x33a7f9]['dataValues']));_0x37dc21[_0xe771('0x8e')](_0x497acf('fax',_0x2acb75[_0xe771('0xb5')][_0x33a7f9][_0xe771('0xb8')]));_0x37dc21[_0xe771('0x8e')](_0x497acf('mail',_0x2acb75[_0xe771('0xb5')][_0x33a7f9][_0xe771('0xb8')]));_0x37dc21[_0xe771('0x8e')](_0x497acf(_0xe771('0xba'),_0x2acb75[_0xe771('0xb5')][_0x33a7f9][_0xe771('0xb8')]));_0x37dc21[_0xe771('0x8e')](_0x497acf('whatsapp',_0x2acb75[_0xe771('0xb5')][_0x33a7f9]['dataValues']));}return Promise['all'](_0x37dc21)[_0xe771('0x7')](function(){return _0x2acb75;});}return _0x2acb75;});}});}}});}; \ No newline at end of file +var _0x2eea=['Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','parentSections','agents','Users','admin','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','Dashboard','intervals','Interval','scheduler','Sound','tags','Tag','templates','Template','triggers','Trunk','Variable','plugins','Plugin','extractedreports','Reports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','section','Invalid\x20section\x20\x27','isEmpty','length','UserProfileSection','find','params','all','ignore','union','push','autoAssociation','model','rawAttributes','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','filters','pick','merge','key','VIRTUAL','foreignKey','options','includeAll','include','forEach','default','DefaultReports','custom','CustomReports','count','rows','ids','customSorting','extraQueryConditions','color','ThroughTags','tag','openTabs','true','sms','fax','dataValues','mail','openchannel','./userProfile.attributes','squel','models','filter','value','findAll','then','map','catch','field','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','projectName','projects','JscriptyProject','contacts','lists','CmList','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','inboundroutes','outboundroutes','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','role','agent','Telephones','membername','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','chanspies','VoiceChanSpy','VoicePrefix','ivrcampaigns'];(function(_0x1c1a3b,_0x1c9f1){var _0x21da40=function(_0x8f1783){while(--_0x8f1783){_0x1c1a3b['push'](_0x1c1a3b['shift']());}};_0x21da40(++_0x1c9f1);}(_0x2eea,0x135));var _0xa2ee=function(_0x3e0d95,_0x3609ed){_0x3e0d95=_0x3e0d95-0x0;var _0x367b62=_0x2eea[_0x3e0d95];return _0x367b62;};'use strict';var _=require('lodash');var attributes=require(_0xa2ee('0x0'));var squel=require(_0xa2ee('0x1'));module['exports']=function(_0x293f78){var _0x127bb5=_0x293f78[_0xa2ee('0x2')];function _0xb3a101(_0x48729f,_0x10fb56){return new Promise(function(_0x59f461,_0x453720){if(!_0x10fb56)return _0x59f461(null);var _0x14eb76=_0x10fb56[_0xa2ee('0x3')]?{[_0x10fb56[_0xa2ee('0x3')]['field']]:_0x10fb56[_0xa2ee('0x3')][_0xa2ee('0x4')]}:undefined;return _0x127bb5[_0x48729f][_0xa2ee('0x5')]({'where':_0x14eb76,'raw':!![]})[_0xa2ee('0x6')](function(_0x21d054){_0x10fb56['associatedResources']=_[_0xa2ee('0x7')](_0x21d054,'id');_0x59f461(_0x10fb56);})[_0xa2ee('0x8')](function(_0x53cd45){_0x453720(_0x53cd45);});});}function _0x21e854(_0x37b651,_0x47b1c0){return new Promise(function(_0x2e3aff,_0x6eb3e5){var _0x3a7400=_0x37b651['filter']?{[_0x37b651['filter'][_0xa2ee('0x9')]]:_0x37b651[_0xa2ee('0x3')]['value']}:undefined;return _0x127bb5[_0x37b651['model']][_0xa2ee('0x5')]({'where':_0x3a7400,'raw':!![]})[_0xa2ee('0x6')](function(_0x54278d){_0x47b1c0[_0xa2ee('0xa')]=_[_0xa2ee('0x7')](_0x54278d,function(_0x1796a3){return _0x1796a3[_0xa2ee('0xb')];});_0x2e3aff(_0x47b1c0);})[_0xa2ee('0x8')](function(_0x2f4150){_0x6eb3e5(_0x2f4150);});});}function _0xec17d0(_0x237ce4,_0x34e8e6,_0x3b8c2c){if(!_0x34e8e6)return Promise[_0xa2ee('0xc')](null);return new Promise(function(_0x223167,_0xe780e0){return _0x127bb5[_0xa2ee('0xd')][_0xa2ee('0x5')]({'where':{'sectionId':_0x34e8e6['id']},'raw':!![]})[_0xa2ee('0x6')](function(_0x2a0632){if(_0x237ce4['field']&&_0x237ce4[_0xa2ee('0x9')]!=='id'){_0x34e8e6[_0xa2ee('0xa')]=_[_0xa2ee('0x7')](_0x2a0632,function(_0x3d6471){return _0x3d6471[_0x237ce4[_0xa2ee('0x9')]];});}else{if(_0x3b8c2c===_0xa2ee('0xe')){_0x34e8e6[_0xa2ee('0xa')]=_[_0xa2ee('0x7')](_0x2a0632,function(_0x3518b1){return{'id':_0x3518b1[_0xa2ee('0xf')],'type':_0x3518b1[_0xa2ee('0x10')]};});}else{_0x34e8e6[_0xa2ee('0xa')]=_[_0xa2ee('0x7')](_0x2a0632,function(_0x4f42be){return _0x4f42be['resourceId'];});}}_0x223167(_0x34e8e6);})[_0xa2ee('0x8')](function(_0x8ccffc){_0xe780e0(_0x8ccffc);});});}function _0x3c6bd5(_0x1fb101,_0x4de6ae){var _0xdc417a={'parentSections':[]};switch(_0x1fb101[_0xa2ee('0x11')]()){case _0xa2ee('0x12'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x14');break;case _0xa2ee('0x15'):_0xdc417a['childModel']=_0xa2ee('0x16');break;case'squarerecordings':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x17');_0xdc417a['parentSections']=[{'name':'SquareProjects','field':'name','foreignKey':_0xa2ee('0x18')}];break;case _0xa2ee('0x19'):_0xdc417a['childModel']=_0xa2ee('0x1a');break;case _0xa2ee('0x1b'):_0xdc417a[_0xa2ee('0x13')]='CmContact';_0xdc417a['parentSections']=[{'name':'Lists','field':'id','foreignKey':'ListId'}];break;case _0xa2ee('0x1c'):_0xdc417a['childModel']=_0xa2ee('0x1d');break;case'companies':_0xdc417a[_0xa2ee('0x13')]='CmCompany';break;case'globalcustomfields':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x1e');break;case _0xa2ee('0x1f'):_0xdc417a['childModel']=_0xa2ee('0x20');break;case _0xa2ee('0x21'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x22');break;case _0xa2ee('0x23'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x24');break;case'faxaccounts':_0xdc417a[_0xa2ee('0x13')]='FaxAccount';break;case _0xa2ee('0x25'):case'internalroutes':case _0xa2ee('0x26'):_0xdc417a['childModel']='VoiceExtension';break;case _0xa2ee('0x27'):_0xdc417a['childModel']='VoiceContext';break;case _0xa2ee('0x28'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x29');break;case _0xa2ee('0x2a'):_0xdc417a['childModel']=_0xa2ee('0x2b');_0xdc417a['parentSections']=[{'name':'Agents','field':_0xa2ee('0xb'),'foreignKey':'membername','model':_0xa2ee('0x2c'),'filter':{'field':_0xa2ee('0x2d'),'value':[_0xa2ee('0x2e')]}},{'name':_0xa2ee('0x2f'),'field':_0xa2ee('0xb'),'foreignKey':_0xa2ee('0x30'),'model':_0xa2ee('0x2c'),'filter':{'field':_0xa2ee('0x2d'),'value':[_0xa2ee('0x31')]}},{'name':_0xa2ee('0x32'),'field':_0xa2ee('0xb'),'foreignKey':_0xa2ee('0x33'),'model':_0xa2ee('0x34'),'filter':{'field':'type','value':[_0xa2ee('0x35')]}},{'name':_0xa2ee('0x36'),'field':'name','foreignKey':'queue','model':_0xa2ee('0x34'),'filter':{'field':_0xa2ee('0x10'),'value':[_0xa2ee('0x37')]}}];break;case _0xa2ee('0x38'):_0xdc417a[_0xa2ee('0x13')]='VoiceMusicOnHold';break;case _0xa2ee('0x39'):_0xdc417a['childModel']=_0xa2ee('0x3a');break;case'voiceprefixes':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x3b');break;case _0xa2ee('0x3c'):_0xdc417a['childModel']=_0xa2ee('0x3d');break;case _0xa2ee('0x3e'):_0xdc417a['childModel']=_0xa2ee('0x3f');break;case _0xa2ee('0x40'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x41');break;case _0xa2ee('0x42'):_0xdc417a[_0xa2ee('0x13')]='MailSubstatus';break;case _0xa2ee('0x43'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x44');break;case _0xa2ee('0x45'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x46');break;case'smsqueues':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x47');break;case _0xa2ee('0x48'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x49');break;case _0xa2ee('0x4a'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x4b');break;case _0xa2ee('0x4c'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x4d');break;case _0xa2ee('0x4e'):_0xdc417a['childModel']=_0xa2ee('0x4f');break;case'voicequeues':case'queuecampaigns':_0xdc417a['childModel']=_0xa2ee('0x34');if(_0x4de6ae){_0xdc417a[_0xa2ee('0x50')]=[{'name':_0xa2ee('0x32')},{'name':'QueueCampaigns'}];}break;case'users':case _0xa2ee('0x51'):case'telephones':_0xdc417a['childModel']=_0xa2ee('0x2c');if(_0x4de6ae){_0xdc417a[_0xa2ee('0x50')]=[{'name':_0xa2ee('0x52'),'filter':{'field':_0xa2ee('0x2d'),'value':[_0xa2ee('0x53'),'user']},'ignore':!![]},{'name':_0xa2ee('0x54')},{'name':_0xa2ee('0x2f')}];}break;case _0xa2ee('0x55'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x56');break;case _0xa2ee('0x57'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x58');break;case _0xa2ee('0x59'):_0xdc417a[_0xa2ee('0x13')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x5a');break;case _0xa2ee('0x5b'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x5c');break;case _0xa2ee('0x5d'):_0xdc417a[_0xa2ee('0x13')]='ZohoAccount';break;case _0xa2ee('0x5e'):_0xdc417a['childModel']='User';break;case _0xa2ee('0x5f'):_0xdc417a['childModel']='CannedAnswer';break;case'dispositions':_0xdc417a['childModel']='Disposition';break;case'customdashboards':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x60');break;case _0xa2ee('0x61'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x62');break;case'pauses':_0xdc417a[_0xa2ee('0x13')]='Pause';break;case _0xa2ee('0x63'):_0xdc417a['childModel']='Schedule';break;case'sounds':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x64');break;case _0xa2ee('0x65'):_0xdc417a['childModel']=_0xa2ee('0x66');break;case _0xa2ee('0x67'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x68');break;case _0xa2ee('0x69'):_0xdc417a[_0xa2ee('0x13')]='Trigger';break;case'trunks':_0xdc417a['childModel']=_0xa2ee('0x6a');break;case'variables':_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x6b');break;case _0xa2ee('0x6c'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x6d');break;case _0xa2ee('0x6e'):_0xdc417a['childModel']=_0xa2ee('0xe');_0xdc417a['parentSections']=[{'name':_0xa2ee('0x6f'),'field':'id','foreignKey':_0xa2ee('0x70')}];break;case _0xa2ee('0x71'):_0xdc417a[_0xa2ee('0x13')]=_0xa2ee('0x72');break;}return _0xdc417a;}function _0x258887(_0x31c3b0,_0x1fc363){var _0x2123b4=_0x31c3b0[_0xa2ee('0x73')](0x0)[_0xa2ee('0x74')]()+_0x31c3b0[_0xa2ee('0x75')](0x1);var _0x3cd22c={'type':_0x127bb5[_0xa2ee('0x76')]['QueryTypes']['SELECT'],'raw':!![]};return new Promise(function(_0x55fb45,_0x429858){var _0x169170=squel[_0xa2ee('0x77')]()['field'](_0xa2ee('0x78')+_0x2123b4+_0xa2ee('0x79'),'id')[_0xa2ee('0x9')](_0xa2ee('0x7a'))[_0xa2ee('0x7b')](_0xa2ee('0x7c')+_0x31c3b0+_0xa2ee('0x7d'),'ui')[_0xa2ee('0x7e')]('ui.UserId\x20=\x20?',_0x1fc363['id']);return _0x127bb5[_0xa2ee('0x7f')][_0xa2ee('0x80')](_0x169170[_0xa2ee('0x81')](),_0x3cd22c)['then'](function(_0x415b44){_0x1fc363[_0x2123b4+_0xa2ee('0x82')]=_0x415b44;_0x55fb45(_0x415b44);})['catch'](function(_0x5651bd){_0x429858(_0x5651bd);});});}return _0x293f78[_0xa2ee('0x83')]('UserProfile',attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x32462d){var _0x341615=require('../../components/parsers/qs');var _0x535c38={'raw':_0x32462d[_0xa2ee('0x80')]['raw'],'where':{}};var _0x48ad22={};var _0x2c4e02={'count':0x0,'rows':[]};var _0x274b1b=_0x32462d[_0xa2ee('0x80')][_0xa2ee('0x84')];var _0x1f66bd=_0x32462d[_0xa2ee('0x80')]['mergeResources']||![];var _0x323ab7=_0x3c6bd5(_0x274b1b,_0x1f66bd);if(!_0x323ab7['childModel'])throw new Error(_0xa2ee('0x85')+_0x274b1b+'\x27');var _0xccb236=[{'name':_0x274b1b}];if(!_[_0xa2ee('0x86')](_0x323ab7['parentSections']))_0xccb236=_0x323ab7[_0xa2ee('0x50')];var _0xb7a7c6=[];for(var _0xbf58cc=0x0;_0xbf58cc<_0xccb236[_0xa2ee('0x87')];_0xbf58cc++){_0xb7a7c6['push'](_0x127bb5[_0xa2ee('0x88')][_0xa2ee('0x89')]({'where':{'userProfileId':_0x32462d[_0xa2ee('0x8a')]['id'],'name':_0xccb236[_0xbf58cc][_0xa2ee('0xb')]},'raw':!![]}));}return Promise[_0xa2ee('0x8b')](_0xb7a7c6)[_0xa2ee('0x6')](function(_0x3c8d20){var _0x5a6892=_[_0xa2ee('0x3')](_0x3c8d20,function(_0x269627){return _0x269627?_0x269627:undefined;});var _0x144696=_[_0xa2ee('0x3')](_0xccb236,[_0xa2ee('0x8c'),!![]]);var _0x402ca4=_['isEmpty'](_0x5a6892)&&_[_0xa2ee('0x86')](_0x144696)?null:_[_0xa2ee('0x8d')](_0x144696,_0x5a6892);if(!_0x402ca4)return null;var _0xcc2550=[];for(var _0x3373c0=0x0;_0x3373c0<_0x402ca4[_0xa2ee('0x87')];_0x3373c0++){var _0x4d9409=_[_0xa2ee('0x89')](_0xccb236,function(_0x58b796){return _0x402ca4[_0x3373c0]?_0x58b796[_0xa2ee('0xb')]===_0x402ca4[_0x3373c0][_0xa2ee('0xb')]:null;});if(_0x4d9409){if(_0x402ca4[_0x3373c0][_0xa2ee('0x8c')]){_0xcc2550[_0xa2ee('0x8e')](_0xb3a101(_0x323ab7[_0xa2ee('0x13')],_0x402ca4[_0x3373c0]));}else{if(!_0x402ca4[_0x3373c0][_0xa2ee('0x8f')]){_0xcc2550[_0xa2ee('0x8e')](_0xec17d0(_0x4d9409,_0x402ca4[_0x3373c0],_0x323ab7[_0xa2ee('0x13')]));}else{if(_0x4d9409[_0xa2ee('0x90')]){_0xcc2550[_0xa2ee('0x8e')](_0x21e854(_0x4d9409,_0x402ca4[_0x3373c0]));}}}}}return Promise[_0xa2ee('0x8b')](_0xcc2550);})[_0xa2ee('0x6')](function(_0x49c543){var _0x146e94=_0x49c543;var _0x5700ee=null;if(_0x146e94){_0x5700ee=_0x146e94[_0xa2ee('0x87')]===0x1?_0x146e94[0x0]:null;}if(!_0x5700ee&&!_0x146e94)return _0x2c4e02;var _0x5f4939=_0x127bb5[_0x323ab7[_0xa2ee('0x13')]][_0xa2ee('0x91')];_0x48ad22['model']=_[_0xa2ee('0x92')](_0x5f4939);_0x48ad22['query']=_[_0xa2ee('0x92')](_0x32462d[_0xa2ee('0x80')]);_0x48ad22['filters']=_[_0xa2ee('0x93')](_0x48ad22[_0xa2ee('0x90')],_0x48ad22['query']);_0x535c38[_0xa2ee('0x94')]=_['intersection'](_0x48ad22['model'],_0x341615[_0xa2ee('0x95')](_0x32462d['query'][_0xa2ee('0x95')]));_0x535c38[_0xa2ee('0x94')]=_0x535c38[_0xa2ee('0x94')][_0xa2ee('0x87')]?_0x535c38['attributes']:_0x48ad22['model'];if(!_0x32462d['query'][_0xa2ee('0x96')](_0xa2ee('0x97'))){_0x535c38[_0xa2ee('0x98')]=_0x341615['limit'](_0x32462d[_0xa2ee('0x80')][_0xa2ee('0x98')]);_0x535c38[_0xa2ee('0x99')]=_0x341615[_0xa2ee('0x99')](_0x32462d['query'][_0xa2ee('0x99')]);}_0x535c38[_0xa2ee('0x9a')]=_0x341615[_0xa2ee('0x9b')](_0x32462d['query'][_0xa2ee('0x9b')]);_0x535c38[_0xa2ee('0x7e')]=_0x341615[_0xa2ee('0x9c')](_[_0xa2ee('0x9d')](_0x32462d['query'],_0x48ad22[_0xa2ee('0x9c')]));if(_0x32462d[_0xa2ee('0x80')][_0xa2ee('0x3')]){_0x535c38['where']=_[_0xa2ee('0x9e')](_0x535c38[_0xa2ee('0x7e')],{'$or':_['map'](_0x5f4939,function(_0x58979f){if(_0x58979f[_0xa2ee('0x10')][_0xa2ee('0x9f')]!==_0xa2ee('0xa0')){var _0x172c08={};_0x172c08[_0x58979f[_0xa2ee('0x9')]]={'$like':'%'+_0x32462d[_0xa2ee('0x80')]['filter']+'%'};return _0x172c08;}})});}var _0x22f414=[];var _0x70cb42=null;var _0x17d017={};if(_0x5700ee){_0x70cb42=_['find'](_0xccb236,[_0xa2ee('0xb'),_0x5700ee[_0xa2ee('0xb')]]);if(_0x70cb42[_0xa2ee('0x9')]){_0x17d017={};if(_0x323ab7[_0xa2ee('0x13')]===_0xa2ee('0xe')){_0x17d017[_0x70cb42['foreignKey']]=_[_0xa2ee('0x7')](_0x5700ee[_0xa2ee('0xa')],'id');}else{_0x17d017[_0x70cb42[_0xa2ee('0xa1')]]=_0x5700ee[_0xa2ee('0xa')];}_0x22f414['push'](_0x17d017);}else{_0x535c38[_0xa2ee('0x7e')]['id']=_0x5700ee[_0xa2ee('0xa')];}}else{for(var _0x4668c8=0x0;_0x4668c8<_0x146e94[_0xa2ee('0x87')];_0x4668c8++){_0x70cb42=_[_0xa2ee('0x89')](_0xccb236,['name',_0x146e94[_0x4668c8][_0xa2ee('0xb')]]);if(_0x70cb42['field']){_0x17d017={};_0x17d017[_0x70cb42[_0xa2ee('0xa1')]]=_0x146e94[_0x4668c8]['associatedResources'];_0x22f414[_0xa2ee('0x8e')](_0x17d017);}else{if(!_0x535c38[_0xa2ee('0x7e')]['id'])_0x535c38[_0xa2ee('0x7e')]['id']=[];_0x146e94[_0x4668c8][_0xa2ee('0xa')]['forEach'](function(_0x4c2823){_0x535c38[_0xa2ee('0x7e')]['id'][_0xa2ee('0x8e')](_0x4c2823);});}}}if(!_[_0xa2ee('0x86')](_0x22f414)){_0x535c38[_0xa2ee('0x7e')]=_[_0xa2ee('0x9e')](_0x535c38[_0xa2ee('0x7e')],{'$and':{'$or':_0x22f414}});}_0x535c38=_[_0xa2ee('0x9e')]({},_0x535c38,_0x32462d[_0xa2ee('0xa2')]);if(_0x5700ee&&!_0x5700ee['autoAssociation']&&_0x323ab7[_0xa2ee('0x13')]===_0xa2ee('0xe')){if(_0x32462d[_0xa2ee('0x80')][_0xa2ee('0xa3')]){_0x535c38[_0xa2ee('0xa4')]=[{'all':!![]}];}return _0x127bb5[_0x323ab7[_0xa2ee('0x13')]][_0xa2ee('0x5')](_0x535c38)[_0xa2ee('0x6')](function(_0x5a2ac0){var _0x2ac1c7=[];_0x5a2ac0[_0xa2ee('0xa5')](function(_0x30bbed){var _0x5ae3a6;switch(_0x30bbed['reportType']){case _0xa2ee('0xa6'):_0x5ae3a6=_[_0xa2ee('0x89')](_0x5700ee['associatedResources'],function(_0x56c9a2){return _0x56c9a2['id']===_0x30bbed[_0xa2ee('0x70')]&&_0x56c9a2[_0xa2ee('0x10')]===_0xa2ee('0xa7');});break;case _0xa2ee('0xa8'):_0x5ae3a6=_[_0xa2ee('0x89')](_0x5700ee['associatedResources'],function(_0x35b415){return _0x35b415['id']===_0x30bbed[_0xa2ee('0x70')]&&_0x35b415['type']===_0xa2ee('0xa9');});break;}if(_0x5ae3a6)_0x2ac1c7[_0xa2ee('0x8e')](_0x30bbed);});_0x2c4e02[_0xa2ee('0xaa')]=_0x2ac1c7['length'];_0x2c4e02[_0xa2ee('0xab')]=_0x2ac1c7;return _0x2c4e02;});}else{if(!_[_0xa2ee('0x86')](_0x32462d[_0xa2ee('0x80')]['ids'])){_0x535c38[_0xa2ee('0x7e')]['id']=_0x535c38[_0xa2ee('0x7e')]['id']?_[_0xa2ee('0x93')](_0x535c38[_0xa2ee('0x7e')]['id'],_0x32462d[_0xa2ee('0x80')]['ids']):_0x32462d['query'][_0xa2ee('0xac')];if(_0x32462d[_0xa2ee('0x80')][_0xa2ee('0xad')]){_0x535c38['order']=_0x32462d['query']['customSorting'];}}if(_0x32462d['query'][_0xa2ee('0xae')]){_0x535c38[_0xa2ee('0x7e')]=_[_0xa2ee('0x9e')](_0x535c38[_0xa2ee('0x7e')],{'$and':_0x32462d[_0xa2ee('0x80')][_0xa2ee('0xae')]});}return _0x127bb5[_0x323ab7[_0xa2ee('0x13')]][_0xa2ee('0xaa')]({'where':_0x535c38[_0xa2ee('0x7e')]})[_0xa2ee('0x6')](function(_0x4896b9){_0x2c4e02[_0xa2ee('0xaa')]=_0x4896b9;if(_0x32462d[_0xa2ee('0x80')]['includeAll']){if(_0x323ab7[_0xa2ee('0x13')]==='CmContact'){_0x535c38[_0xa2ee('0xa4')]=[{'model':_0x127bb5[_0xa2ee('0x66')],'as':'Tags','attributes':['id','name',_0xa2ee('0xaf')],'required':_0x32462d[_0xa2ee('0x80')]['tag']?!![]:![]},{'model':_0x127bb5['Tag'],'as':_0xa2ee('0xb0'),'attributes':['id',_0xa2ee('0xb'),_0xa2ee('0xaf')],'through':_0x32462d[_0xa2ee('0x80')][_0xa2ee('0xb1')]?{'attributes':[],'where':{'TagId':_0x32462d['query'][_0xa2ee('0xb1')]||undefined}}:{},'required':_0x32462d['query'][_0xa2ee('0xb1')]?!![]:![]}];}else{_0x535c38[_0xa2ee('0xa4')]=[{'all':!![]}];}}return _0x127bb5[_0x323ab7['childModel']][_0xa2ee('0x5')](_0x535c38);})[_0xa2ee('0x6')](function(_0x4d31d3){_0x2c4e02[_0xa2ee('0xab')]=_0x4d31d3;if(_0x274b1b==='Agents'&&_0x32462d[_0xa2ee('0x80')][_0xa2ee('0xb2')]===_0xa2ee('0xb3')){var _0x2a4733=[];for(var _0x2cbec0=0x0;_0x2cbec0<_0x2c4e02['rows'][_0xa2ee('0x87')];_0x2cbec0++){_0x2a4733[_0xa2ee('0x8e')](_0x258887('chat',_0x2c4e02[_0xa2ee('0xab')][_0x2cbec0]['dataValues']));_0x2a4733[_0xa2ee('0x8e')](_0x258887(_0xa2ee('0xb4'),_0x2c4e02[_0xa2ee('0xab')][_0x2cbec0]['dataValues']));_0x2a4733[_0xa2ee('0x8e')](_0x258887(_0xa2ee('0xb5'),_0x2c4e02[_0xa2ee('0xab')][_0x2cbec0][_0xa2ee('0xb6')]));_0x2a4733[_0xa2ee('0x8e')](_0x258887(_0xa2ee('0xb7'),_0x2c4e02[_0xa2ee('0xab')][_0x2cbec0]['dataValues']));_0x2a4733['push'](_0x258887(_0xa2ee('0xb8'),_0x2c4e02[_0xa2ee('0xab')][_0x2cbec0][_0xa2ee('0xb6')]));_0x2a4733[_0xa2ee('0x8e')](_0x258887('whatsapp',_0x2c4e02['rows'][_0x2cbec0][_0xa2ee('0xb6')]));}return Promise[_0xa2ee('0x8b')](_0x2a4733)[_0xa2ee('0x6')](function(){return _0x2c4e02;});}return _0x2c4e02;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index aa10e46..4e8d015 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 _0x90ec=['UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','request\x20sent','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','./userProfile.socket','register','then','debug'];(function(_0xf47a02,_0x3e9d35){var _0x513d7a=function(_0x335ec4){while(--_0x335ec4){_0xf47a02['push'](_0xf47a02['shift']());}};_0x513d7a(++_0x3e9d35);}(_0x90ec,0x1d4));var _0xc90e=function(_0x3e1fd6,_0x4b4d3f){_0x3e1fd6=_0x3e1fd6-0x0;var _0x340a20=_0x90ec[_0x3e1fd6];return _0x340a20;};'use strict';var _=require(_0xc90e('0x0'));var util=require(_0xc90e('0x1'));var moment=require('moment');var BPromise=require(_0xc90e('0x2'));var rs=require(_0xc90e('0x3'));var fs=require('fs');var Redis=require(_0xc90e('0x4'));var db=require(_0xc90e('0x5'))['db'];var utils=require(_0xc90e('0x6'));var logger=require('../../config/logger')(_0xc90e('0x7'));var config=require(_0xc90e('0x8'));var jayson=require(_0xc90e('0x9'));var client=jayson['client'][_0xc90e('0xa')]({'port':0x232a});config['redis']=_[_0xc90e('0xb')](config[_0xc90e('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xc90e('0xd'))(new Redis(config[_0xc90e('0xc')]));require(_0xc90e('0xe'))[_0xc90e('0xf')](socket);function respondWithRpcPromise(_0x3702ed,_0x1bfb66,_0x386e63){return new BPromise(function(_0x3aff4c,_0xc4cba){return client['request'](_0x3702ed,_0x386e63)[_0xc90e('0x10')](function(_0x5e14b7){logger['info']('UserProfile,\x20%s,\x20%s',_0x1bfb66,'request\x20sent');logger[_0xc90e('0x11')](_0xc90e('0x12'),_0x1bfb66,'request\x20sent',JSON[_0xc90e('0x13')](_0x5e14b7));if(_0x5e14b7[_0xc90e('0x14')]){if(_0x5e14b7['error'][_0xc90e('0x15')]===0x1f4){logger[_0xc90e('0x14')](_0xc90e('0x16'),_0x1bfb66,_0x5e14b7[_0xc90e('0x14')][_0xc90e('0x17')]);return _0xc4cba(_0x5e14b7[_0xc90e('0x14')]['message']);}logger[_0xc90e('0x14')](_0xc90e('0x16'),_0x1bfb66,_0x5e14b7['error'][_0xc90e('0x17')]);return _0x3aff4c(_0x5e14b7['error'][_0xc90e('0x17')]);}else{logger[_0xc90e('0x18')]('UserProfile,\x20%s,\x20%s',_0x1bfb66,_0xc90e('0x19'));_0x3aff4c(_0x5e14b7[_0xc90e('0x1a')][_0xc90e('0x17')]);}})['catch'](function(_0x5cf3f5){logger['error'](_0xc90e('0x16'),_0x1bfb66,_0x5cf3f5);_0xc4cba(_0x5cf3f5);});});} \ No newline at end of file +var _0x0c23=['stringify','error','code','UserProfile,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xa7e345,_0x37979a){var _0x59e4e3=function(_0x3bfcb7){while(--_0x3bfcb7){_0xa7e345['push'](_0xa7e345['shift']());}};_0x59e4e3(++_0x37979a);}(_0x0c23,0x13e));var _0x30c2=function(_0x4ac872,_0x40d2fb){_0x4ac872=_0x4ac872-0x0;var _0x377939=_0x0c23[_0x4ac872];return _0x377939;};'use strict';var _=require(_0x30c2('0x0'));var util=require(_0x30c2('0x1'));var moment=require(_0x30c2('0x2'));var BPromise=require(_0x30c2('0x3'));var rs=require(_0x30c2('0x4'));var fs=require('fs');var Redis=require(_0x30c2('0x5'));var db=require(_0x30c2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x30c2('0x7'))(_0x30c2('0x8'));var config=require(_0x30c2('0x9'));var jayson=require(_0x30c2('0xa'));var client=jayson[_0x30c2('0xb')][_0x30c2('0xc')]({'port':0x232a});config['redis']=_[_0x30c2('0xd')](config[_0x30c2('0xe')],{'host':_0x30c2('0xf'),'port':0x18eb});var socket=require(_0x30c2('0x10'))(new Redis(config[_0x30c2('0xe')]));require('./userProfile.socket')[_0x30c2('0x11')](socket);function respondWithRpcPromise(_0x2b6595,_0x4bd5be,_0x3365c5){return new BPromise(function(_0x44e778,_0x40f639){return client[_0x30c2('0x12')](_0x2b6595,_0x3365c5)[_0x30c2('0x13')](function(_0x17eb67){logger['info']('UserProfile,\x20%s,\x20%s',_0x4bd5be,'request\x20sent');logger[_0x30c2('0x14')](_0x30c2('0x15'),_0x4bd5be,_0x30c2('0x16'),JSON[_0x30c2('0x17')](_0x17eb67));if(_0x17eb67[_0x30c2('0x18')]){if(_0x17eb67[_0x30c2('0x18')][_0x30c2('0x19')]===0x1f4){logger['error'](_0x30c2('0x1a'),_0x4bd5be,_0x17eb67[_0x30c2('0x18')]['message']);return _0x40f639(_0x17eb67[_0x30c2('0x18')][_0x30c2('0x1b')]);}logger[_0x30c2('0x18')](_0x30c2('0x1a'),_0x4bd5be,_0x17eb67[_0x30c2('0x18')][_0x30c2('0x1b')]);return _0x44e778(_0x17eb67[_0x30c2('0x18')][_0x30c2('0x1b')]);}else{logger[_0x30c2('0x1c')](_0x30c2('0x1a'),_0x4bd5be,_0x30c2('0x16'));_0x44e778(_0x17eb67[_0x30c2('0x1d')]['message']);}})[_0x30c2('0x1e')](function(_0x48697c){logger['error'](_0x30c2('0x1a'),_0x4bd5be,_0x48697c);_0x40f639(_0x48697c);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 0320f9b..7b87880 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 _0xde83=['save','emit','length','userProfile:'];(function(_0x25a146,_0x42f449){var _0x2446dc=function(_0x14f020){while(--_0x14f020){_0x25a146['push'](_0x25a146['shift']());}};_0x2446dc(++_0x42f449);}(_0xde83,0x1cc));var _0x3de8=function(_0x596f6e,_0x3f8857){_0x596f6e=_0x596f6e-0x0;var _0x1e0803=_0xde83[_0x596f6e];return _0x1e0803;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x3de8('0x0'),'remove','update'];function createListener(_0x22f945,_0x3033bc){return function(_0x1889be){_0x3033bc[_0x3de8('0x1')](_0x22f945,_0x1889be);};}function removeListener(_0xbda9d7,_0xac4ad1){return function(){UserProfileEvents['removeListener'](_0xbda9d7,_0xac4ad1);};}exports['register']=function(_0x55c154){for(var _0x4d4e91=0x0,_0x4c7d2c=events[_0x3de8('0x2')];_0x4d4e91<_0x4c7d2c;_0x4d4e91++){var _0x2d2430=events[_0x4d4e91];var _0x5527bc=createListener(_0x3de8('0x3')+_0x2d2430,_0x55c154);UserProfileEvents['on'](_0x2d2430,_0x5527bc);}}; \ No newline at end of file +var _0x04ff=['emit','removeListener','length','save','remove'];(function(_0x5e0c7e,_0x831d41){var _0x46af2c=function(_0x1e9989){while(--_0x1e9989){_0x5e0c7e['push'](_0x5e0c7e['shift']());}};_0x46af2c(++_0x831d41);}(_0x04ff,0xa8));var _0xf04f=function(_0x1e524e,_0x5531e2){_0x1e524e=_0x1e524e-0x0;var _0x496883=_0x04ff[_0x1e524e];return _0x496883;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0xf04f('0x0'),_0xf04f('0x1'),'update'];function createListener(_0x56e69f,_0x617b27){return function(_0x5b2c4f){_0x617b27[_0xf04f('0x2')](_0x56e69f,_0x5b2c4f);};}function removeListener(_0x543c4d,_0x5b0d42){return function(){UserProfileEvents[_0xf04f('0x3')](_0x543c4d,_0x5b0d42);};}exports['register']=function(_0x272f71){for(var _0x15c4aa=0x0,_0x73672a=events[_0xf04f('0x4')];_0x15c4aa<_0x73672a;_0x15c4aa++){var _0x2ee678=events[_0x15c4aa];var _0x3819ae=createListener('userProfile:'+_0x2ee678,_0x272f71);UserProfileEvents['on'](_0x2ee678,_0x3819ae);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 26adb2e..4b82177 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 _0x58e6=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x7c008b,_0x149cd4){var _0x43b711=function(_0x44cb93){while(--_0x44cb93){_0x7c008b['push'](_0x7c008b['shift']());}};_0x43b711(++_0x149cd4);}(_0x58e6,0x104));var _0x658e=function(_0x17d1b5,_0x59b87e){_0x17d1b5=_0x17d1b5-0x0;var _0x3be626=_0x58e6[_0x17d1b5];return _0x3be626;};'use strict';var multer=require('multer');var util=require(_0x658e('0x0'));var path=require(_0x658e('0x1'));var timeout=require(_0x658e('0x2'));var express=require(_0x658e('0x3'));var router=express[_0x658e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x658e('0x5'));var interaction=require(_0x658e('0x6'));var config=require(_0x658e('0x7'));var controller=require(_0x658e('0x8'));router[_0x658e('0x9')]('/',auth[_0x658e('0xa')](),controller['index']);router[_0x658e('0x9')](_0x658e('0xb'),auth[_0x658e('0xa')](),controller['describe']);router[_0x658e('0x9')](_0x658e('0xc'),auth[_0x658e('0xa')](),controller[_0x658e('0xd')]);router[_0x658e('0xe')]('/',auth[_0x658e('0xa')](),controller[_0x658e('0xf')]);router[_0x658e('0x10')](_0x658e('0xc'),auth[_0x658e('0xa')](),controller[_0x658e('0x11')]);router['delete'](_0x658e('0xc'),auth['isAuthenticated'](),controller[_0x658e('0x12')]);module[_0x658e('0x13')]=router; \ No newline at end of file +var _0x0ddc=['../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','/describe','describe','/:id','post','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x19c718,_0xfbc00b){var _0x1af074=function(_0xd4e852){while(--_0xd4e852){_0x19c718['push'](_0x19c718['shift']());}};_0x1af074(++_0xfbc00b);}(_0x0ddc,0xa3));var _0xc0dd=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x0ddc[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0xc0dd('0x0'));var util=require(_0xc0dd('0x1'));var path=require('path');var timeout=require(_0xc0dd('0x2'));var express=require(_0xc0dd('0x3'));var router=express[_0xc0dd('0x4')]();var fs_extra=require(_0xc0dd('0x5'));var auth=require(_0xc0dd('0x6'));var interaction=require(_0xc0dd('0x7'));var config=require(_0xc0dd('0x8'));var controller=require(_0xc0dd('0x9'));router[_0xc0dd('0xa')]('/',auth[_0xc0dd('0xb')](),controller[_0xc0dd('0xc')]);router[_0xc0dd('0xa')](_0xc0dd('0xd'),auth['isAuthenticated'](),controller[_0xc0dd('0xe')]);router['get'](_0xc0dd('0xf'),auth[_0xc0dd('0xb')](),controller['show']);router[_0xc0dd('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xc0dd('0xf'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xc0dd('0xb')](),controller[_0xc0dd('0x11')]);module[_0xc0dd('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 a5223c4..7c0a174 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 _0xea6a=['sequelize','exports','STRING','INTEGER'];(function(_0x34c764,_0x34d549){var _0x56594d=function(_0x39b9be){while(--_0x39b9be){_0x34c764['push'](_0x34c764['shift']());}};_0x56594d(++_0x34d549);}(_0xea6a,0x98));var _0xaea6=function(_0x4c2607,_0x5415bf){_0x4c2607=_0x4c2607-0x0;var _0xad698c=_0xea6a[_0x4c2607];return _0xad698c;};'use strict';var Sequelize=require(_0xaea6('0x0'));module[_0xaea6('0x1')]={'name':{'type':Sequelize[_0xaea6('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xaea6('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x8a80=['INTEGER','STRING'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x8a80,0x105));var _0x08a8=function(_0x4c1758,_0x2dae92){_0x4c1758=_0x4c1758-0x0;var _0x2f353e=_0x8a80[_0x4c1758];return _0x2f353e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x08a8('0x0')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x08a8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x08a8('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d34cd51..ebab702 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 _0xe3da=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','describe','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x245ee0,_0x2ea702){var _0x560080=function(_0x5dac5a){while(--_0x5dac5a){_0x245ee0['push'](_0x245ee0['shift']());}};_0x560080(++_0x2ea702);}(_0xe3da,0x1cd));var _0xae3d=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xe3da[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));};exports['describe']=function(_0x4f4694,_0x4c6dab){return db[_0xae3d('0x2f')][_0xae3d('0x50')]()['then'](respondWithResult(_0x4c6dab,null))[_0xae3d('0x48')](handleError(_0x4c6dab,null));}; \ No newline at end of file +var _0x4975=['to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','map','VIRTUAL','options','UserProfileResource','count','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x29646e,_0x4f2abf){var _0x17a1f6=function(_0x3352e2){while(--_0x3352e2){_0x29646e['push'](_0x29646e['shift']());}};_0x17a1f6(++_0x4f2abf);}(_0x4975,0x86));var _0x5497=function(_0x3c16b8,_0x1e5341){_0x3c16b8=_0x3c16b8-0x0;var _0x290538=_0x4975[_0x3c16b8];return _0x290538;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}exports['index']=function(_0x39a2b7,_0x48d146){var _0x5e9356={},_0xc3465={},_0xb14593={'count':0x0,'rows':[]};var _0x1cf908=_['map'](db['UserProfileResource']['rawAttributes'],function(_0x371874){return{'name':_0x371874[_0x5497('0x29')],'type':_0x371874[_0x5497('0x2a')]['key']};});_0xc3465['model']=_['map'](_0x1cf908,_0x5497('0x28'));_0xc3465['query']=_[_0x5497('0x2b')](_0x39a2b7[_0x5497('0x2c')]);_0xc3465[_0x5497('0x2d')]=_['intersection'](_0xc3465[_0x5497('0x2e')],_0xc3465[_0x5497('0x2c')]);_0x5e9356['attributes']=_[_0x5497('0x2f')](_0xc3465[_0x5497('0x2e')],qs[_0x5497('0x30')](_0x39a2b7['query'][_0x5497('0x30')]));_0x5e9356[_0x5497('0x31')]=_0x5e9356[_0x5497('0x31')][_0x5497('0x32')]?_0x5e9356[_0x5497('0x31')]:_0xc3465['model'];if(!_0x39a2b7[_0x5497('0x2c')][_0x5497('0x33')]('nolimit')){_0x5e9356[_0x5497('0x1e')]=qs[_0x5497('0x1e')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x1e')]);_0x5e9356[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x39a2b7['query'][_0x5497('0x1c')]);}_0x5e9356['order']=qs[_0x5497('0x34')](_0x39a2b7[_0x5497('0x2c')][_0x5497('0x34')]);_0x5e9356['where']=qs['filters'](_[_0x5497('0x35')](_0x39a2b7[_0x5497('0x2c')],_0xc3465[_0x5497('0x2d')]),_0x1cf908);if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]){_0x5e9356[_0x5497('0x37')]=_['merge'](_0x5e9356[_0x5497('0x37')],{'$or':_[_0x5497('0x38')](_0x1cf908,function(_0x3de8fe){if(_0x3de8fe[_0x5497('0x2a')]!==_0x5497('0x39')){var _0x468902={};_0x468902[_0x3de8fe[_0x5497('0x28')]]={'$like':'%'+_0x39a2b7[_0x5497('0x2c')][_0x5497('0x36')]+'%'};return _0x468902;}})});}_0x5e9356=_['merge']({},_0x5e9356,_0x39a2b7[_0x5497('0x3a')]);var _0x32fa2b={'where':_0x5e9356[_0x5497('0x37')]};return db[_0x5497('0x3b')][_0x5497('0x3c')](_0x32fa2b)[_0x5497('0x24')](function(_0x4299be){_0xb14593['count']=_0x4299be;if(_0x39a2b7[_0x5497('0x2c')][_0x5497('0x3d')]){_0x5e9356[_0x5497('0x3e')]=[{'all':!![]}];}return db[_0x5497('0x3b')][_0x5497('0x3f')](_0x5e9356);})[_0x5497('0x24')](function(_0x114471){_0xb14593['rows']=_0x114471;return _0xb14593;})[_0x5497('0x24')](respondWithFilteredResult(_0x48d146,_0x5e9356))[_0x5497('0x40')](handleError(_0x48d146,null));};exports[_0x5497('0x41')]=function(_0x1e6389,_0x20e947){var _0xd90608={'raw':![],'where':{'id':_0x1e6389[_0x5497('0x42')]['id']}},_0xc1a999={};_0xc1a999[_0x5497('0x2e')]=_[_0x5497('0x2b')](db['UserProfileResource'][_0x5497('0x43')]);_0xc1a999['query']=_[_0x5497('0x2b')](_0x1e6389[_0x5497('0x2c')]);_0xc1a999[_0x5497('0x2d')]=_[_0x5497('0x2f')](_0xc1a999[_0x5497('0x2e')],_0xc1a999['query']);_0xd90608[_0x5497('0x31')]=_[_0x5497('0x2f')](_0xc1a999['model'],qs[_0x5497('0x30')](_0x1e6389['query'][_0x5497('0x30')]));_0xd90608['attributes']=_0xd90608[_0x5497('0x31')][_0x5497('0x32')]?_0xd90608[_0x5497('0x31')]:_0xc1a999[_0x5497('0x2e')];if(_0x1e6389[_0x5497('0x2c')]['includeAll']){_0xd90608['include']=[{'all':!![]}];}_0xd90608=_['merge']({},_0xd90608,_0x1e6389['options']);return db[_0x5497('0x3b')][_0x5497('0x44')](_0xd90608)[_0x5497('0x24')](handleEntityNotFound(_0x20e947,null))[_0x5497('0x24')](respondWithResult(_0x20e947,null))[_0x5497('0x40')](handleError(_0x20e947,null));};exports[_0x5497('0x45')]=function(_0xc78abe,_0x466287){return db[_0x5497('0x3b')]['create'](_0xc78abe[_0x5497('0x46')],{})[_0x5497('0x24')](respondWithResult(_0x466287,0xc9))[_0x5497('0x40')](handleError(_0x466287,null));};exports['update']=function(_0x3e4da2,_0x530475){if(_0x3e4da2[_0x5497('0x46')]['id']){delete _0x3e4da2[_0x5497('0x46')]['id'];}return db[_0x5497('0x3b')]['find']({'where':{'id':_0x3e4da2[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x530475,null))['then'](saveUpdates(_0x3e4da2[_0x5497('0x46')],null))['then'](respondWithResult(_0x530475,null))[_0x5497('0x40')](handleError(_0x530475,null));};exports['destroy']=function(_0x416f76,_0x400860){return db[_0x5497('0x3b')][_0x5497('0x44')]({'where':{'id':_0x416f76[_0x5497('0x42')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x400860,null))[_0x5497('0x24')](removeEntity(_0x400860,null))[_0x5497('0x40')](handleError(_0x400860,null));};exports['describe']=function(_0x1f73eb,_0x5b2c22){return db['UserProfileResource'][_0x5497('0x47')]()[_0x5497('0x24')](respondWithResult(_0x5b2c22,null))['catch'](handleError(_0x5b2c22,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 555d70c..d3d2554 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 _0xd20f=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util'];(function(_0x4ec3f9,_0x2befa9){var _0x134584=function(_0x1f2b8e){while(--_0x1f2b8e){_0x4ec3f9['push'](_0x4ec3f9['shift']());}};_0x134584(++_0x2befa9);}(_0xd20f,0x1c0));var _0xfd20=function(_0x356f17,_0x3b8033){_0x356f17=_0x356f17-0x0;var _0x4b4ce0=_0xd20f[_0x356f17];return _0x4b4ce0;};'use strict';var _=require(_0xfd20('0x0'));var util=require(_0xfd20('0x1'));var logger=require(_0xfd20('0x2'))('api');var moment=require(_0xfd20('0x3'));var BPromise=require(_0xfd20('0x4'));var rp=require(_0xfd20('0x5'));var fs=require('fs');var path=require(_0xfd20('0x6'));var rimraf=require('rimraf');var config=require(_0xfd20('0x7'));var attributes=require(_0xfd20('0x8'));module[_0xfd20('0x9')]=function(_0x291e56,_0x270327){return _0x291e56[_0xfd20('0xa')](_0xfd20('0xb'),attributes,{'tableName':_0xfd20('0xc'),'paranoid':![],'indexes':[{'name':_0xfd20('0xd'),'fields':[_0xfd20('0xe'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x5b44=['define','UserProfileResource','user_profile_has_resources','resourceId','sectionId','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xd6a74,_0x3b878a){var _0x4ed128=function(_0x15cc95){while(--_0x15cc95){_0xd6a74['push'](_0xd6a74['shift']());}};_0x4ed128(++_0x3b878a);}(_0x5b44,0xbb));var _0x45b4=function(_0x259b16,_0x4641b9){_0x259b16=_0x259b16-0x0;var _0x388e7b=_0x5b44[_0x259b16];return _0x388e7b;};'use strict';var _=require(_0x45b4('0x0'));var util=require(_0x45b4('0x1'));var logger=require(_0x45b4('0x2'))(_0x45b4('0x3'));var moment=require('moment');var BPromise=require(_0x45b4('0x4'));var rp=require(_0x45b4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x45b4('0x6'));var config=require(_0x45b4('0x7'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x463659,_0x2c4c2a){return _0x463659[_0x45b4('0x8')](_0x45b4('0x9'),attributes,{'tableName':_0x45b4('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x45b4('0xb'),_0x45b4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index f40629b..20d7fc3 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 _0xec81=['../../config/logger','../../config/environment','jayson/promise','client','http','then','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x17f5fb,_0x233eb7){var _0x5856aa=function(_0x1d4e1b){while(--_0x1d4e1b){_0x17f5fb['push'](_0x17f5fb['shift']());}};_0x5856aa(++_0x233eb7);}(_0xec81,0xf6));var _0x1ec8=function(_0x31c798,_0x2f1872){_0x31c798=_0x31c798-0x0;var _0x5e508d=_0xec81[_0x31c798];return _0x5e508d;};'use strict';var _=require(_0x1ec8('0x0'));var util=require(_0x1ec8('0x1'));var moment=require(_0x1ec8('0x2'));var BPromise=require(_0x1ec8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1ec8('0x4'));var db=require(_0x1ec8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ec8('0x6'))('rpc');var config=require(_0x1ec8('0x7'));var jayson=require(_0x1ec8('0x8'));var client=jayson[_0x1ec8('0x9')][_0x1ec8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54f67e,_0x4c4044,_0x1408d2){return new BPromise(function(_0x5c0f35,_0x4c468f){return client['request'](_0x54f67e,_0x1408d2)[_0x1ec8('0xb')](function(_0x4c36b1){logger['info'](_0x1ec8('0xc'),_0x4c4044,_0x1ec8('0xd'));logger['debug'](_0x1ec8('0xe'),_0x4c4044,_0x1ec8('0xd'),JSON[_0x1ec8('0xf')](_0x4c36b1));if(_0x4c36b1[_0x1ec8('0x10')]){if(_0x4c36b1[_0x1ec8('0x10')][_0x1ec8('0x11')]===0x1f4){logger[_0x1ec8('0x10')](_0x1ec8('0xc'),_0x4c4044,_0x4c36b1[_0x1ec8('0x10')][_0x1ec8('0x12')]);return _0x4c468f(_0x4c36b1[_0x1ec8('0x10')][_0x1ec8('0x12')]);}logger[_0x1ec8('0x10')](_0x1ec8('0xc'),_0x4c4044,_0x4c36b1[_0x1ec8('0x10')][_0x1ec8('0x12')]);return _0x5c0f35(_0x4c36b1[_0x1ec8('0x10')][_0x1ec8('0x12')]);}else{logger[_0x1ec8('0x13')](_0x1ec8('0xc'),_0x4c4044,_0x1ec8('0xd'));_0x5c0f35(_0x4c36b1['result']['message']);}})[_0x1ec8('0x14')](function(_0x557ad4){logger[_0x1ec8('0x10')](_0x1ec8('0xc'),_0x4c4044,_0x557ad4);_0x4c468f(_0x557ad4);});});} \ No newline at end of file +var _0x1b68=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','error','message','result','util','bluebird'];(function(_0xa78639,_0x3717f0){var _0x2d3b4d=function(_0x58e019){while(--_0x58e019){_0xa78639['push'](_0xa78639['shift']());}};_0x2d3b4d(++_0x3717f0);}(_0x1b68,0xa0));var _0x81b6=function(_0x46b26c,_0x4e42a0){_0x46b26c=_0x46b26c-0x0;var _0xbba68b=_0x1b68[_0x46b26c];return _0xbba68b;};'use strict';var _=require('lodash');var util=require(_0x81b6('0x0'));var moment=require('moment');var BPromise=require(_0x81b6('0x1'));var rs=require(_0x81b6('0x2'));var fs=require('fs');var Redis=require(_0x81b6('0x3'));var db=require(_0x81b6('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x81b6('0x5'));var config=require(_0x81b6('0x6'));var jayson=require(_0x81b6('0x7'));var client=jayson['client'][_0x81b6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21f2e5,_0x4c6e95,_0x2f1c51){return new BPromise(function(_0x29200b,_0x2812eb){return client[_0x81b6('0x9')](_0x21f2e5,_0x2f1c51)[_0x81b6('0xa')](function(_0x4acb74){logger[_0x81b6('0xb')](_0x81b6('0xc'),_0x4c6e95,'request\x20sent');logger[_0x81b6('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x4c6e95,_0x81b6('0xe'),JSON['stringify'](_0x4acb74));if(_0x4acb74[_0x81b6('0xf')]){if(_0x4acb74[_0x81b6('0xf')]['code']===0x1f4){logger[_0x81b6('0xf')]('UserProfileResource,\x20%s,\x20%s',_0x4c6e95,_0x4acb74[_0x81b6('0xf')]['message']);return _0x2812eb(_0x4acb74[_0x81b6('0xf')][_0x81b6('0x10')]);}logger[_0x81b6('0xf')](_0x81b6('0xc'),_0x4c6e95,_0x4acb74[_0x81b6('0xf')][_0x81b6('0x10')]);return _0x29200b(_0x4acb74['error'][_0x81b6('0x10')]);}else{logger['info'](_0x81b6('0xc'),_0x4c6e95,_0x81b6('0xe'));_0x29200b(_0x4acb74[_0x81b6('0x11')][_0x81b6('0x10')]);}})['catch'](function(_0x556fb2){logger[_0x81b6('0xf')](_0x81b6('0xc'),_0x4c6e95,_0x556fb2);_0x2812eb(_0x556fb2);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 74c6a97..b6928e7 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 _0x5020=['update','destroy','util','path','express','Router','fs-extra','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id'];(function(_0x469e9b,_0x44e1cf){var _0x2d6269=function(_0x24491e){while(--_0x24491e){_0x469e9b['push'](_0x469e9b['shift']());}};_0x2d6269(++_0x44e1cf);}(_0x5020,0x1f0));var _0x0502=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x5020[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0502('0x0'));var path=require(_0x0502('0x1'));var timeout=require('connect-timeout');var express=require(_0x0502('0x2'));var router=express[_0x0502('0x3')]();var fs_extra=require(_0x0502('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0502('0x5'));var controller=require(_0x0502('0x6'));router[_0x0502('0x7')]('/',auth[_0x0502('0x8')](),controller[_0x0502('0x9')]);router[_0x0502('0x7')](_0x0502('0xa'),auth[_0x0502('0x8')](),controller[_0x0502('0xb')]);router[_0x0502('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0502('0xc')]);router[_0x0502('0xd')]('/',auth[_0x0502('0x8')](),controller[_0x0502('0xe')]);router[_0x0502('0xf')](_0x0502('0x10'),auth[_0x0502('0x8')](),controller[_0x0502('0x11')]);router['delete']('/:id',auth[_0x0502('0x8')](),controller[_0x0502('0x12')]);module['exports']=router; \ No newline at end of file +var _0xce62=['isAuthenticated','index','/describe','describe','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileSection.controller','get'];(function(_0x5e186e,_0x379091){var _0x49998b=function(_0x53fb5b){while(--_0x53fb5b){_0x5e186e['push'](_0x5e186e['shift']());}};_0x49998b(++_0x379091);}(_0xce62,0x79));var _0x2ce6=function(_0x5e2471,_0x4279b7){_0x5e2471=_0x5e2471-0x0;var _0x329410=_0xce62[_0x5e2471];return _0x329410;};'use strict';var multer=require(_0x2ce6('0x0'));var util=require(_0x2ce6('0x1'));var path=require(_0x2ce6('0x2'));var timeout=require(_0x2ce6('0x3'));var express=require(_0x2ce6('0x4'));var router=express[_0x2ce6('0x5')]();var fs_extra=require(_0x2ce6('0x6'));var auth=require(_0x2ce6('0x7'));var interaction=require(_0x2ce6('0x8'));var config=require('../../config/environment');var controller=require(_0x2ce6('0x9'));router[_0x2ce6('0xa')]('/',auth[_0x2ce6('0xb')](),controller[_0x2ce6('0xc')]);router['get'](_0x2ce6('0xd'),auth[_0x2ce6('0xb')](),controller[_0x2ce6('0xe')]);router[_0x2ce6('0xa')]('/:id',auth[_0x2ce6('0xb')](),controller['show']);router[_0x2ce6('0xf')]('/',auth[_0x2ce6('0xb')](),controller['create']);router[_0x2ce6('0x10')](_0x2ce6('0x11'),auth[_0x2ce6('0xb')](),controller[_0x2ce6('0x12')]);router[_0x2ce6('0x13')](_0x2ce6('0x11'),auth[_0x2ce6('0xb')](),controller[_0x2ce6('0x14')]);module[_0x2ce6('0x15')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index d672b31..1da3044 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 _0xb9a7=['getDataValue','split','exports','BOOLEAN','STRING','setDataValue','crudPermissions','join'];(function(_0x3aa8fe,_0x113712){var _0x1bb053=function(_0x13f5fa){while(--_0x13f5fa){_0x3aa8fe['push'](_0x3aa8fe['shift']());}};_0x1bb053(++_0x113712);}(_0xb9a7,0x112));var _0x7b9a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xb9a7[_0x2235bf];return _0x4c3a64;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x7b9a('0x1')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x7b9a('0x2')],'set':function(_0x40ef7d){this[_0x7b9a('0x3')](_0x7b9a('0x4'),_0x40ef7d?_0x40ef7d[_0x7b9a('0x5')](''):[]);},'get':function(){return this[_0x7b9a('0x6')](_0x7b9a('0x4'))?this[_0x7b9a('0x6')](_0x7b9a('0x4'))[_0x7b9a('0x7')](''):[];}}}; \ No newline at end of file +var _0xfef3=['sequelize','STRING','INTEGER','BOOLEAN','crudPermissions','join','getDataValue','split'];(function(_0x3cec3e,_0xd9c0a1){var _0x1beeda=function(_0x93549f){while(--_0x93549f){_0x3cec3e['push'](_0x3cec3e['shift']());}};_0x1beeda(++_0xd9c0a1);}(_0xfef3,0x118));var _0x3fef=function(_0x515099,_0x46bdbd){_0x515099=_0x515099-0x0;var _0x26e0a7=_0xfef3[_0x515099];return _0x26e0a7;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x3fef('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x3fef('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x3fef('0x1')],'set':function(_0x3b71e5){this['setDataValue'](_0x3fef('0x4'),_0x3b71e5?_0x3b71e5[_0x3fef('0x5')](''):[]);},'get':function(){return this['getDataValue'](_0x3fef('0x4'))?this[_0x3fef('0x6')](_0x3fef('0x4'))[_0x3fef('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 53f7e92..7381943 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 _0x596c=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','show','params','length','includeAll','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set'];(function(_0x17a402,_0x17716b){var _0x2bfcac=function(_0x5d63f5){while(--_0x5d63f5){_0x17a402['push'](_0x17a402['shift']());}};_0x2bfcac(++_0x17716b);}(_0x596c,0xc8));var _0xc596=function(_0x664d72,_0x5dd796){_0x664d72=_0x664d72-0x0;var _0x1d2aa6=_0x596c[_0x664d72];return _0x1d2aa6;};'use strict';var emlformat=require(_0xc596('0x0'));var rimraf=require(_0xc596('0x1'));var zipdir=require(_0xc596('0x2'));var jsonpatch=require(_0xc596('0x3'));var rp=require(_0xc596('0x4'));var moment=require(_0xc596('0x5'));var BPromise=require(_0xc596('0x6'));var Mustache=require(_0xc596('0x7'));var util=require(_0xc596('0x8'));var path=require('path');var sox=require(_0xc596('0x9'));var csv=require(_0xc596('0xa'));var ejs=require(_0xc596('0xb'));var fs=require('fs');var fs_extra=require(_0xc596('0xc'));var _=require('lodash');var squel=require(_0xc596('0xd'));var crypto=require(_0xc596('0xe'));var jsforce=require(_0xc596('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc596('0xa'));var querystring=require(_0xc596('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc596('0x11'));var qs=require(_0xc596('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc596('0x13'));var logger=require('../../config/logger')(_0xc596('0x14'));var utils=require(_0xc596('0x15'));var config=require(_0xc596('0x16'));var licenseUtil=require(_0xc596('0x17'));var db=require(_0xc596('0x18'))['db'];function respondWithStatusCode(_0xdf8120,_0x320223){_0x320223=_0x320223||0xcc;return function(_0x5588f9){if(_0x5588f9){return _0xdf8120[_0xc596('0x19')](_0x320223);}return _0xdf8120['status'](_0x320223)[_0xc596('0x1a')]();};}function respondWithResult(_0xaf8bea,_0x4a3309){_0x4a3309=_0x4a3309||0xc8;return function(_0x10ddbe){if(_0x10ddbe){return _0xaf8bea[_0xc596('0x1b')](_0x4a3309)[_0xc596('0x1c')](_0x10ddbe);}};}function respondWithFilteredResult(_0xa8b97d,_0x5b9927){return function(_0x5989a0){if(_0x5989a0){var _0x1c9c7d=typeof _0x5b9927[_0xc596('0x1d')]===_0xc596('0x1e')&&typeof _0x5b9927[_0xc596('0x1f')]===_0xc596('0x1e');var _0x3a3ff8=_0x5989a0[_0xc596('0x20')];var _0x20a4c8=_0x1c9c7d?0x0:_0x5b9927[_0xc596('0x1d')];var _0x368794=_0x1c9c7d?_0x5989a0['count']:_0x5b9927[_0xc596('0x1d')]+_0x5b9927[_0xc596('0x1f')];var _0x5a381f;if(_0x368794>=_0x3a3ff8){_0x368794=_0x3a3ff8;_0x5a381f=0xc8;}else{_0x5a381f=0xce;}_0xa8b97d['status'](_0x5a381f);return _0xa8b97d[_0xc596('0x21')](_0xc596('0x22'),_0x20a4c8+'-'+_0x368794+'/'+_0x3a3ff8)[_0xc596('0x1c')](_0x5989a0);}return null;};}function patchUpdates(_0x249110){return function(_0x36223c){try{jsonpatch[_0xc596('0x23')](_0x36223c,_0x249110,!![]);}catch(_0x50509c){return BPromise[_0xc596('0x24')](_0x50509c);}return _0x36223c[_0xc596('0x25')]();};}function saveUpdates(_0x3966a2,_0x301f16){return function(_0x579d3c){if(_0x579d3c){return _0x579d3c[_0xc596('0x26')](_0x3966a2)[_0xc596('0x27')](function(_0x3d0f4d){return _0x3d0f4d;});}return null;};}function removeEntity(_0x537845,_0x2c7ae4){return function(_0x2d0535){if(_0x2d0535){return _0x2d0535[_0xc596('0x28')]()['then'](function(){_0x537845['status'](0xcc)[_0xc596('0x1a')]();});}};}function handleEntityNotFound(_0x1c5d7f,_0x10908a){return function(_0x119b87){if(!_0x119b87){_0x1c5d7f[_0xc596('0x19')](0x194);}return _0x119b87;};}function handleError(_0x23b58b,_0x2d086f){_0x2d086f=_0x2d086f||0x1f4;return function(_0x554c89){logger[_0xc596('0x29')](_0x554c89[_0xc596('0x2a')]);if(_0x554c89['name']){delete _0x554c89[_0xc596('0x2b')];}_0x23b58b['status'](_0x2d086f)[_0xc596('0x2c')](_0x554c89);};}exports[_0xc596('0x2d')]=function(_0x178d6b,_0x7db04a){var _0x2bc394={},_0x645f3c={},_0x57a914={'count':0x0,'rows':[]};var _0x41c532=_['map'](db[_0xc596('0x2e')][_0xc596('0x2f')],function(_0xd6074b){return{'name':_0xd6074b[_0xc596('0x30')],'type':_0xd6074b[_0xc596('0x31')][_0xc596('0x32')]};});_0x645f3c[_0xc596('0x33')]=_[_0xc596('0x34')](_0x41c532,_0xc596('0x2b'));_0x645f3c['query']=_[_0xc596('0x35')](_0x178d6b['query']);_0x645f3c[_0xc596('0x36')]=_[_0xc596('0x37')](_0x645f3c[_0xc596('0x33')],_0x645f3c[_0xc596('0x38')]);_0x2bc394[_0xc596('0x39')]=_[_0xc596('0x37')](_0x645f3c[_0xc596('0x33')],qs[_0xc596('0x3a')](_0x178d6b[_0xc596('0x38')][_0xc596('0x3a')]));_0x2bc394[_0xc596('0x39')]=_0x2bc394['attributes']['length']?_0x2bc394[_0xc596('0x39')]:_0x645f3c['model'];if(!_0x178d6b[_0xc596('0x38')]['hasOwnProperty'](_0xc596('0x3b'))){_0x2bc394[_0xc596('0x1f')]=qs[_0xc596('0x1f')](_0x178d6b[_0xc596('0x38')]['limit']);_0x2bc394[_0xc596('0x1d')]=qs[_0xc596('0x1d')](_0x178d6b[_0xc596('0x38')]['offset']);}_0x2bc394[_0xc596('0x3c')]=qs[_0xc596('0x3d')](_0x178d6b[_0xc596('0x38')][_0xc596('0x3d')]);_0x2bc394[_0xc596('0x3e')]=qs[_0xc596('0x36')](_[_0xc596('0x3f')](_0x178d6b[_0xc596('0x38')],_0x645f3c[_0xc596('0x36')]),_0x41c532);if(_0x178d6b[_0xc596('0x38')][_0xc596('0x40')]){_0x2bc394[_0xc596('0x3e')]=_[_0xc596('0x41')](_0x2bc394[_0xc596('0x3e')],{'$or':_[_0xc596('0x34')](_0x41c532,function(_0xf58f4){if(_0xf58f4[_0xc596('0x31')]!==_0xc596('0x42')){var _0xb367bb={};_0xb367bb[_0xf58f4['name']]={'$like':'%'+_0x178d6b[_0xc596('0x38')][_0xc596('0x40')]+'%'};return _0xb367bb;}})});}_0x2bc394=_[_0xc596('0x41')]({},_0x2bc394,_0x178d6b[_0xc596('0x43')]);var _0x2bd264={'where':_0x2bc394[_0xc596('0x3e')]};return db['UserProfileSection'][_0xc596('0x20')](_0x2bd264)['then'](function(_0x1969ed){_0x57a914[_0xc596('0x20')]=_0x1969ed;if(_0x178d6b['query']['includeAll']){_0x2bc394[_0xc596('0x44')]=[{'all':!![]}];}return db[_0xc596('0x2e')]['findAll'](_0x2bc394);})[_0xc596('0x27')](function(_0x486333){_0x57a914['rows']=_0x486333;return _0x57a914;})[_0xc596('0x27')](respondWithFilteredResult(_0x7db04a,_0x2bc394))['catch'](handleError(_0x7db04a,null));};exports[_0xc596('0x45')]=function(_0xead907,_0x464386){var _0x4617c5={'raw':![],'where':{'id':_0xead907[_0xc596('0x46')]['id']}},_0x7998c6={};_0x7998c6[_0xc596('0x33')]=_[_0xc596('0x35')](db[_0xc596('0x2e')]['rawAttributes']);_0x7998c6[_0xc596('0x38')]=_[_0xc596('0x35')](_0xead907[_0xc596('0x38')]);_0x7998c6[_0xc596('0x36')]=_[_0xc596('0x37')](_0x7998c6[_0xc596('0x33')],_0x7998c6['query']);_0x4617c5['attributes']=_[_0xc596('0x37')](_0x7998c6[_0xc596('0x33')],qs[_0xc596('0x3a')](_0xead907[_0xc596('0x38')][_0xc596('0x3a')]));_0x4617c5[_0xc596('0x39')]=_0x4617c5[_0xc596('0x39')][_0xc596('0x47')]?_0x4617c5[_0xc596('0x39')]:_0x7998c6[_0xc596('0x33')];if(_0xead907[_0xc596('0x38')][_0xc596('0x48')]){_0x4617c5[_0xc596('0x44')]=[{'all':!![]}];}_0x4617c5=_[_0xc596('0x41')]({},_0x4617c5,_0xead907[_0xc596('0x43')]);return db[_0xc596('0x2e')][_0xc596('0x49')](_0x4617c5)['then'](handleEntityNotFound(_0x464386,null))[_0xc596('0x27')](respondWithResult(_0x464386,null))['catch'](handleError(_0x464386,null));};exports[_0xc596('0x4a')]=function(_0x547503,_0x3975a6){return db['UserProfileSection']['create'](_0x547503[_0xc596('0x4b')],{})[_0xc596('0x27')](respondWithResult(_0x3975a6,0xc9))[_0xc596('0x4c')](handleError(_0x3975a6,null));};exports[_0xc596('0x26')]=function(_0xfd8600,_0x52865b){if(_0xfd8600[_0xc596('0x4b')]['id']){delete _0xfd8600[_0xc596('0x4b')]['id'];}return db[_0xc596('0x2e')][_0xc596('0x49')]({'where':{'id':_0xfd8600[_0xc596('0x46')]['id']}})[_0xc596('0x27')](handleEntityNotFound(_0x52865b,null))[_0xc596('0x27')](saveUpdates(_0xfd8600[_0xc596('0x4b')],null))[_0xc596('0x27')](respondWithResult(_0x52865b,null))['catch'](handleError(_0x52865b,null));};exports['destroy']=function(_0x20054a,_0xd1afda){return db[_0xc596('0x2e')][_0xc596('0x49')]({'where':{'id':_0x20054a['params']['id']}})['then'](handleEntityNotFound(_0xd1afda,null))[_0xc596('0x27')](removeEntity(_0xd1afda,null))['catch'](handleError(_0xd1afda,null));};exports[_0xc596('0x4d')]=function(_0xbe29f0,_0x2b80ed){return db[_0xc596('0x2e')][_0xc596('0x4d')]()[_0xc596('0x27')](respondWithResult(_0x2b80ed,null))[_0xc596('0x4c')](handleError(_0x2b80ed,null));}; \ No newline at end of file +var _0x17e0=['offset','undefined','limit','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','end','json'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x17e0,0x118));var _0x017e=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x17e0[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x017e('0x0'));var zipdir=require(_0x017e('0x1'));var jsonpatch=require(_0x017e('0x2'));var rp=require(_0x017e('0x3'));var moment=require('moment');var BPromise=require(_0x017e('0x4'));var Mustache=require(_0x017e('0x5'));var util=require(_0x017e('0x6'));var path=require(_0x017e('0x7'));var sox=require(_0x017e('0x8'));var csv=require(_0x017e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x017e('0xa'));var _=require(_0x017e('0xb'));var squel=require(_0x017e('0xc'));var crypto=require('crypto');var jsforce=require(_0x017e('0xd'));var deskjs=require(_0x017e('0xe'));var toCsv=require(_0x017e('0x9'));var querystring=require(_0x017e('0xf'));var Papa=require('papaparse');var Redis=require(_0x017e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x017e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x017e('0x12'));var logger=require('../../config/logger')(_0x017e('0x13'));var utils=require(_0x017e('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x017e('0x15'))['db'];function respondWithStatusCode(_0x4796fe,_0x235332){_0x235332=_0x235332||0xcc;return function(_0x38c436){if(_0x38c436){return _0x4796fe['sendStatus'](_0x235332);}return _0x4796fe['status'](_0x235332)[_0x017e('0x16')]();};}function respondWithResult(_0x183095,_0x4bbbfa){_0x4bbbfa=_0x4bbbfa||0xc8;return function(_0x57895c){if(_0x57895c){return _0x183095['status'](_0x4bbbfa)[_0x017e('0x17')](_0x57895c);}};}function respondWithFilteredResult(_0x2ca456,_0x40f07e){return function(_0x3674c7){if(_0x3674c7){var _0x449b5a=typeof _0x40f07e[_0x017e('0x18')]===_0x017e('0x19')&&typeof _0x40f07e[_0x017e('0x1a')]===_0x017e('0x19');var _0x58c3d0=_0x3674c7['count'];var _0x1836c4=_0x449b5a?0x0:_0x40f07e['offset'];var _0x33dd82=_0x449b5a?_0x3674c7['count']:_0x40f07e['offset']+_0x40f07e[_0x017e('0x1a')];var _0x3cc4cf;if(_0x33dd82>=_0x58c3d0){_0x33dd82=_0x58c3d0;_0x3cc4cf=0xc8;}else{_0x3cc4cf=0xce;}_0x2ca456[_0x017e('0x1b')](_0x3cc4cf);return _0x2ca456[_0x017e('0x1c')](_0x017e('0x1d'),_0x1836c4+'-'+_0x33dd82+'/'+_0x58c3d0)[_0x017e('0x17')](_0x3674c7);}return null;};}function patchUpdates(_0xa4131f){return function(_0x772f2d){try{jsonpatch[_0x017e('0x1e')](_0x772f2d,_0xa4131f,!![]);}catch(_0x240364){return BPromise['reject'](_0x240364);}return _0x772f2d[_0x017e('0x1f')]();};}function saveUpdates(_0x5a15a9,_0x37b016){return function(_0x468546){if(_0x468546){return _0x468546[_0x017e('0x20')](_0x5a15a9)[_0x017e('0x21')](function(_0x8167fb){return _0x8167fb;});}return null;};}function removeEntity(_0x1183a8,_0x23eac6){return function(_0x21ee21){if(_0x21ee21){return _0x21ee21[_0x017e('0x22')]()[_0x017e('0x21')](function(){_0x1183a8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38bf85,_0x5cd67b){return function(_0xb8130d){if(!_0xb8130d){_0x38bf85[_0x017e('0x23')](0x194);}return _0xb8130d;};}function handleError(_0x341ceb,_0x707738){_0x707738=_0x707738||0x1f4;return function(_0x1f4568){logger[_0x017e('0x24')](_0x1f4568[_0x017e('0x25')]);if(_0x1f4568['name']){delete _0x1f4568[_0x017e('0x26')];}_0x341ceb[_0x017e('0x1b')](_0x707738)[_0x017e('0x27')](_0x1f4568);};}exports[_0x017e('0x28')]=function(_0x9f95b7,_0x3da4c5){var _0x185b74={},_0x225f04={},_0x53d059={'count':0x0,'rows':[]};var _0x231bdd=_[_0x017e('0x29')](db[_0x017e('0x2a')][_0x017e('0x2b')],function(_0x2b1a44){return{'name':_0x2b1a44[_0x017e('0x2c')],'type':_0x2b1a44[_0x017e('0x2d')][_0x017e('0x2e')]};});_0x225f04[_0x017e('0x2f')]=_['map'](_0x231bdd,_0x017e('0x26'));_0x225f04[_0x017e('0x30')]=_[_0x017e('0x31')](_0x9f95b7[_0x017e('0x30')]);_0x225f04['filters']=_[_0x017e('0x32')](_0x225f04[_0x017e('0x2f')],_0x225f04['query']);_0x185b74['attributes']=_[_0x017e('0x32')](_0x225f04['model'],qs[_0x017e('0x33')](_0x9f95b7[_0x017e('0x30')]['fields']));_0x185b74[_0x017e('0x34')]=_0x185b74['attributes'][_0x017e('0x35')]?_0x185b74[_0x017e('0x34')]:_0x225f04[_0x017e('0x2f')];if(!_0x9f95b7[_0x017e('0x30')][_0x017e('0x36')](_0x017e('0x37'))){_0x185b74[_0x017e('0x1a')]=qs['limit'](_0x9f95b7[_0x017e('0x30')][_0x017e('0x1a')]);_0x185b74[_0x017e('0x18')]=qs[_0x017e('0x18')](_0x9f95b7[_0x017e('0x30')][_0x017e('0x18')]);}_0x185b74[_0x017e('0x38')]=qs[_0x017e('0x39')](_0x9f95b7[_0x017e('0x30')]['sort']);_0x185b74[_0x017e('0x3a')]=qs[_0x017e('0x3b')](_[_0x017e('0x3c')](_0x9f95b7[_0x017e('0x30')],_0x225f04[_0x017e('0x3b')]),_0x231bdd);if(_0x9f95b7[_0x017e('0x30')]['filter']){_0x185b74['where']=_['merge'](_0x185b74[_0x017e('0x3a')],{'$or':_[_0x017e('0x29')](_0x231bdd,function(_0x13e8fe){if(_0x13e8fe[_0x017e('0x2d')]!=='VIRTUAL'){var _0x131542={};_0x131542[_0x13e8fe[_0x017e('0x26')]]={'$like':'%'+_0x9f95b7[_0x017e('0x30')][_0x017e('0x3d')]+'%'};return _0x131542;}})});}_0x185b74=_[_0x017e('0x3e')]({},_0x185b74,_0x9f95b7[_0x017e('0x3f')]);var _0x56c95f={'where':_0x185b74['where']};return db[_0x017e('0x2a')][_0x017e('0x40')](_0x56c95f)['then'](function(_0x39680b){_0x53d059[_0x017e('0x40')]=_0x39680b;if(_0x9f95b7[_0x017e('0x30')][_0x017e('0x41')]){_0x185b74[_0x017e('0x42')]=[{'all':!![]}];}return db[_0x017e('0x2a')][_0x017e('0x43')](_0x185b74);})[_0x017e('0x21')](function(_0x57f301){_0x53d059[_0x017e('0x44')]=_0x57f301;return _0x53d059;})[_0x017e('0x21')](respondWithFilteredResult(_0x3da4c5,_0x185b74))[_0x017e('0x45')](handleError(_0x3da4c5,null));};exports[_0x017e('0x46')]=function(_0x2b3d9e,_0x2b101e){var _0x406930={'raw':![],'where':{'id':_0x2b3d9e['params']['id']}},_0x1e6fdf={};_0x1e6fdf[_0x017e('0x2f')]=_[_0x017e('0x31')](db[_0x017e('0x2a')][_0x017e('0x2b')]);_0x1e6fdf[_0x017e('0x30')]=_[_0x017e('0x31')](_0x2b3d9e[_0x017e('0x30')]);_0x1e6fdf['filters']=_[_0x017e('0x32')](_0x1e6fdf[_0x017e('0x2f')],_0x1e6fdf[_0x017e('0x30')]);_0x406930[_0x017e('0x34')]=_['intersection'](_0x1e6fdf[_0x017e('0x2f')],qs[_0x017e('0x33')](_0x2b3d9e[_0x017e('0x30')][_0x017e('0x33')]));_0x406930['attributes']=_0x406930[_0x017e('0x34')][_0x017e('0x35')]?_0x406930[_0x017e('0x34')]:_0x1e6fdf[_0x017e('0x2f')];if(_0x2b3d9e[_0x017e('0x30')]['includeAll']){_0x406930['include']=[{'all':!![]}];}_0x406930=_[_0x017e('0x3e')]({},_0x406930,_0x2b3d9e[_0x017e('0x3f')]);return db['UserProfileSection'][_0x017e('0x47')](_0x406930)['then'](handleEntityNotFound(_0x2b101e,null))[_0x017e('0x21')](respondWithResult(_0x2b101e,null))[_0x017e('0x45')](handleError(_0x2b101e,null));};exports[_0x017e('0x48')]=function(_0x8fc0fe,_0x5d9fb6){return db['UserProfileSection'][_0x017e('0x48')](_0x8fc0fe[_0x017e('0x49')],{})['then'](respondWithResult(_0x5d9fb6,0xc9))[_0x017e('0x45')](handleError(_0x5d9fb6,null));};exports['update']=function(_0x1b81ca,_0x493b9d){if(_0x1b81ca[_0x017e('0x49')]['id']){delete _0x1b81ca[_0x017e('0x49')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0x1b81ca[_0x017e('0x4a')]['id']}})['then'](handleEntityNotFound(_0x493b9d,null))['then'](saveUpdates(_0x1b81ca[_0x017e('0x49')],null))[_0x017e('0x21')](respondWithResult(_0x493b9d,null))[_0x017e('0x45')](handleError(_0x493b9d,null));};exports[_0x017e('0x22')]=function(_0x5c96f6,_0x4f6006){return db['UserProfileSection'][_0x017e('0x47')]({'where':{'id':_0x5c96f6['params']['id']}})[_0x017e('0x21')](handleEntityNotFound(_0x4f6006,null))['then'](removeEntity(_0x4f6006,null))['catch'](handleError(_0x4f6006,null));};exports[_0x017e('0x4b')]=function(_0x19c5ee,_0x49b9f2){return db[_0x017e('0x2a')][_0x017e('0x4b')]()[_0x017e('0x21')](respondWithResult(_0x49b9f2,null))[_0x017e('0x45')](handleError(_0x49b9f2,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index dae943e..89f9f04 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 _0x0858=['./userProfileSection.attributes','UserProfileSection','sectionId','userProfileId','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x37dd7c,_0x3d824b){var _0x44e492=function(_0x5a2573){while(--_0x5a2573){_0x37dd7c['push'](_0x37dd7c['shift']());}};_0x44e492(++_0x3d824b);}(_0x0858,0x1f3));var _0x8085=function(_0x3ef743,_0x102927){_0x3ef743=_0x3ef743-0x0;var _0x58b5fb=_0x0858[_0x3ef743];return _0x58b5fb;};'use strict';var _=require('lodash');var util=require(_0x8085('0x0'));var logger=require('../../config/logger')(_0x8085('0x1'));var moment=require(_0x8085('0x2'));var BPromise=require(_0x8085('0x3'));var rp=require(_0x8085('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8085('0x5'));var config=require(_0x8085('0x6'));var attributes=require(_0x8085('0x7'));module['exports']=function(_0x3ebec8,_0x42cb96){return _0x3ebec8['define'](_0x8085('0x8'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x8085('0x9'),_0x8085('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x56ad=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','compositeIndex','userProfileId'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0x56ad,0xb4));var _0xd56a=function(_0x3a81a6,_0x56b5d3){_0x3a81a6=_0x3a81a6-0x0;var _0x544ed6=_0x56ad[_0x3a81a6];return _0x544ed6;};'use strict';var _=require('lodash');var util=require(_0xd56a('0x0'));var logger=require(_0xd56a('0x1'))('api');var moment=require('moment');var BPromise=require(_0xd56a('0x2'));var rp=require(_0xd56a('0x3'));var fs=require('fs');var path=require(_0xd56a('0x4'));var rimraf=require(_0xd56a('0x5'));var config=require(_0xd56a('0x6'));var attributes=require(_0xd56a('0x7'));module[_0xd56a('0x8')]=function(_0x3d01ee,_0x1acaf2){return _0x3d01ee[_0xd56a('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xd56a('0xa'),'fields':['sectionId',_0xd56a('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ef802c8..c3c94e9 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 _0xbd54=['request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3c9fd4,_0x5c8ca6){var _0x2e9729=function(_0x349922){while(--_0x349922){_0x3c9fd4['push'](_0x3c9fd4['shift']());}};_0x2e9729(++_0x5c8ca6);}(_0xbd54,0x67));var _0x4bd5=function(_0x2cd1e4,_0x23d906){_0x2cd1e4=_0x2cd1e4-0x0;var _0x167374=_0xbd54[_0x2cd1e4];return _0x167374;};'use strict';var _=require(_0x4bd5('0x0'));var util=require(_0x4bd5('0x1'));var moment=require(_0x4bd5('0x2'));var BPromise=require(_0x4bd5('0x3'));var rs=require(_0x4bd5('0x4'));var fs=require('fs');var Redis=require(_0x4bd5('0x5'));var db=require(_0x4bd5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4bd5('0x7'));var config=require(_0x4bd5('0x8'));var jayson=require(_0x4bd5('0x9'));var client=jayson[_0x4bd5('0xa')][_0x4bd5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x348fcb,_0x3140c3,_0x23d3bb){return new BPromise(function(_0xdbd3f3,_0x98191c){return client[_0x4bd5('0xc')](_0x348fcb,_0x23d3bb)[_0x4bd5('0xd')](function(_0x970bcc){logger[_0x4bd5('0xe')](_0x4bd5('0xf'),_0x3140c3,'request\x20sent');logger[_0x4bd5('0x10')](_0x4bd5('0x11'),_0x3140c3,_0x4bd5('0x12'),JSON[_0x4bd5('0x13')](_0x970bcc));if(_0x970bcc[_0x4bd5('0x14')]){if(_0x970bcc[_0x4bd5('0x14')]['code']===0x1f4){logger[_0x4bd5('0x14')](_0x4bd5('0xf'),_0x3140c3,_0x970bcc[_0x4bd5('0x14')][_0x4bd5('0x15')]);return _0x98191c(_0x970bcc[_0x4bd5('0x14')][_0x4bd5('0x15')]);}logger[_0x4bd5('0x14')](_0x4bd5('0xf'),_0x3140c3,_0x970bcc[_0x4bd5('0x14')]['message']);return _0xdbd3f3(_0x970bcc[_0x4bd5('0x14')][_0x4bd5('0x15')]);}else{logger['info'](_0x4bd5('0xf'),_0x3140c3,_0x4bd5('0x12'));_0xdbd3f3(_0x970bcc['result'][_0x4bd5('0x15')]);}})[_0x4bd5('0x16')](function(_0x42688c){logger[_0x4bd5('0x14')](_0x4bd5('0xf'),_0x3140c3,_0x42688c);_0x98191c(_0x42688c);});});} \ No newline at end of file +var _0xdf4e=['error','UserProfileSection,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x359fad,_0xbe6068){var _0x38e3f3=function(_0x4fa37d){while(--_0x4fa37d){_0x359fad['push'](_0x359fad['shift']());}};_0x38e3f3(++_0xbe6068);}(_0xdf4e,0x17a));var _0xedf4=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0xdf4e[_0x3b2244];return _0x2dcc14;};'use strict';var _=require(_0xedf4('0x0'));var util=require(_0xedf4('0x1'));var moment=require(_0xedf4('0x2'));var BPromise=require(_0xedf4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xedf4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xedf4('0x5'));var logger=require(_0xedf4('0x6'))(_0xedf4('0x7'));var config=require(_0xedf4('0x8'));var jayson=require(_0xedf4('0x9'));var client=jayson[_0xedf4('0xa')][_0xedf4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2f6eb1,_0x5765fc,_0x36c1b4){return new BPromise(function(_0x57a83e,_0x488a55){return client[_0xedf4('0xc')](_0x2f6eb1,_0x36c1b4)[_0xedf4('0xd')](function(_0x536b28){logger[_0xedf4('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x5765fc,_0xedf4('0xf'));logger['debug'](_0xedf4('0x10'),_0x5765fc,_0xedf4('0xf'),JSON[_0xedf4('0x11')](_0x536b28));if(_0x536b28[_0xedf4('0x12')]){if(_0x536b28['error']['code']===0x1f4){logger['error'](_0xedf4('0x13'),_0x5765fc,_0x536b28[_0xedf4('0x12')][_0xedf4('0x14')]);return _0x488a55(_0x536b28['error'][_0xedf4('0x14')]);}logger[_0xedf4('0x12')]('UserProfileSection,\x20%s,\x20%s',_0x5765fc,_0x536b28[_0xedf4('0x12')][_0xedf4('0x14')]);return _0x57a83e(_0x536b28[_0xedf4('0x12')][_0xedf4('0x14')]);}else{logger[_0xedf4('0xe')](_0xedf4('0x13'),_0x5765fc,_0xedf4('0xf'));_0x57a83e(_0x536b28[_0xedf4('0x15')]['message']);}})['catch'](function(_0x10efdb){logger[_0xedf4('0x12')](_0xedf4('0x13'),_0x5765fc,_0x10efdb);_0x488a55(_0x10efdb);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 4fbc304..0294587 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x40a063,_0x3fa92b){var _0x40d4c9=function(_0x25c2e1){while(--_0x25c2e1){_0x40a063['push'](_0x40a063['shift']());}};_0x40d4c9(++_0x3fa92b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xdefbc3,_0x1ea49a){_0xdefbc3=_0xdefbc3-0x0;var _0x367798=_0xcb91[_0xdefbc3];return _0x367798;};'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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1342d7,_0x18e439){var _0x30a883=function(_0x429a55){while(--_0x429a55){_0x1342d7['push'](_0x1342d7['shift']());}};_0x30a883(++_0x18e439);}(_0xe706,0xa3));var _0x6e70=function(_0x1cdabe,_0x286194){_0x1cdabe=_0x1cdabe-0x0;var _0x3dcc9c=_0xe706[_0x1cdabe];return _0x3dcc9c;};'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 c8f09fe..715006b 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 _0x282b=['INTEGER','sequelize','exports'];(function(_0xcba874,_0x50a8e9){var _0x34c769=function(_0x38b26d){while(--_0x38b26d){_0xcba874['push'](_0xcba874['shift']());}};_0x34c769(++_0x50a8e9);}(_0x282b,0x19c));var _0xb282=function(_0x3756b6,_0x1ec52d){_0x3756b6=_0x3756b6-0x0;var _0x5b9a51=_0x282b[_0x3756b6];return _0x5b9a51;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'penalty':{'type':Sequelize[_0xb282('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7f24=['sequelize','INTEGER'];(function(_0x4c06cc,_0x506d79){var _0x19350a=function(_0x23b92c){while(--_0x23b92c){_0x4c06cc['push'](_0x4c06cc['shift']());}};_0x19350a(++_0x506d79);}(_0x7f24,0x16a));var _0x47f2=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0x7f24[_0x8a2dae];return _0x308f20;};'use strict';var Sequelize=require(_0x47f2('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x47f2('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 1d9d3c3..9afe5bd 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 _0x83d0=['./userSmsQueue.attributes','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x47968d,_0x1aeb1c){var _0x4fdbc2=function(_0x3ee314){while(--_0x3ee314){_0x47968d['push'](_0x47968d['shift']());}};_0x4fdbc2(++_0x1aeb1c);}(_0x83d0,0xb7));var _0x083d=function(_0x139edc,_0x5b73de){_0x139edc=_0x139edc-0x0;var _0x28f31b=_0x83d0[_0x139edc];return _0x28f31b;};'use strict';var _=require(_0x083d('0x0'));var util=require(_0x083d('0x1'));var logger=require(_0x083d('0x2'))(_0x083d('0x3'));var moment=require(_0x083d('0x4'));var BPromise=require(_0x083d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x083d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x083d('0x7'));module[_0x083d('0x8')]=function(_0x3c4b8c,_0x2e75e8){return _0x3c4b8c[_0x083d('0x9')]('UserSmsQueue',attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50e5=['user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x2805cb,_0x449d53){var _0x1a1724=function(_0x732635){while(--_0x732635){_0x2805cb['push'](_0x2805cb['shift']());}};_0x1a1724(++_0x449d53);}(_0x50e5,0xb7));var _0x550e=function(_0x43ed19,_0x537ea4){_0x43ed19=_0x43ed19-0x0;var _0x2126f6=_0x50e5[_0x43ed19];return _0x2126f6;};'use strict';var _=require(_0x550e('0x0'));var util=require(_0x550e('0x1'));var logger=require('../../config/logger')(_0x550e('0x2'));var moment=require(_0x550e('0x3'));var BPromise=require(_0x550e('0x4'));var rp=require(_0x550e('0x5'));var fs=require('fs');var path=require(_0x550e('0x6'));var rimraf=require(_0x550e('0x7'));var config=require(_0x550e('0x8'));var attributes=require(_0x550e('0x9'));module[_0x550e('0xa')]=function(_0x3d8c9b,_0x863e3b){return _0x3d8c9b[_0x550e('0xb')]('UserSmsQueue',attributes,{'tableName':_0x550e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index cbf4be2..1497477 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 _0x1454=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UserSmsQueue,\x20%s,\x20%s','util','moment','bluebird','randomstring','ioredis'];(function(_0x1ad41a,_0x49e38e){var _0x45fc22=function(_0xaa2efe){while(--_0xaa2efe){_0x1ad41a['push'](_0x1ad41a['shift']());}};_0x45fc22(++_0x49e38e);}(_0x1454,0x103));var _0x4145=function(_0x521787,_0x2c699b){_0x521787=_0x521787-0x0;var _0x126c3e=_0x1454[_0x521787];return _0x126c3e;};'use strict';var _=require('lodash');var util=require(_0x4145('0x0'));var moment=require(_0x4145('0x1'));var BPromise=require(_0x4145('0x2'));var rs=require(_0x4145('0x3'));var fs=require('fs');var Redis=require(_0x4145('0x4'));var db=require(_0x4145('0x5'))['db'];var utils=require(_0x4145('0x6'));var logger=require(_0x4145('0x7'))(_0x4145('0x8'));var config=require(_0x4145('0x9'));var jayson=require(_0x4145('0xa'));var client=jayson[_0x4145('0xb')][_0x4145('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1757e4,_0x44956e,_0x2d4aa8){return new BPromise(function(_0x1c9ecc,_0x3962a4){return client[_0x4145('0xd')](_0x1757e4,_0x2d4aa8)[_0x4145('0xe')](function(_0x249f43){logger[_0x4145('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x44956e,_0x4145('0x10'));logger[_0x4145('0x11')](_0x4145('0x12'),_0x44956e,_0x4145('0x10'),JSON[_0x4145('0x13')](_0x249f43));if(_0x249f43['error']){if(_0x249f43[_0x4145('0x14')][_0x4145('0x15')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x44956e,_0x249f43['error']['message']);return _0x3962a4(_0x249f43[_0x4145('0x14')][_0x4145('0x16')]);}logger[_0x4145('0x14')](_0x4145('0x17'),_0x44956e,_0x249f43[_0x4145('0x14')]['message']);return _0x1c9ecc(_0x249f43[_0x4145('0x14')]['message']);}else{logger[_0x4145('0xf')]('UserSmsQueue,\x20%s,\x20%s',_0x44956e,_0x4145('0x10'));_0x1c9ecc(_0x249f43['result'][_0x4145('0x16')]);}})['catch'](function(_0xde4932){logger[_0x4145('0x14')](_0x4145('0x17'),_0x44956e,_0xde4932);_0x3962a4(_0xde4932);});});} \ No newline at end of file +var _0x9bf9=['moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x3c3530,_0x374b49){var _0x1e3374=function(_0x31fe72){while(--_0x31fe72){_0x3c3530['push'](_0x3c3530['shift']());}};_0x1e3374(++_0x374b49);}(_0x9bf9,0x1a3));var _0x99bf=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x9bf9[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x99bf('0x0'));var util=require('util');var moment=require(_0x99bf('0x1'));var BPromise=require('bluebird');var rs=require(_0x99bf('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x99bf('0x3'))(_0x99bf('0x4'));var config=require(_0x99bf('0x5'));var jayson=require(_0x99bf('0x6'));var client=jayson[_0x99bf('0x7')][_0x99bf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x188537,_0x2ec35f,_0xfef775){return new BPromise(function(_0x49efa6,_0x157bed){return client[_0x99bf('0x9')](_0x188537,_0xfef775)[_0x99bf('0xa')](function(_0x377e0b){logger[_0x99bf('0xb')](_0x99bf('0xc'),_0x2ec35f,_0x99bf('0xd'));logger[_0x99bf('0xe')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x2ec35f,_0x99bf('0xd'),JSON[_0x99bf('0xf')](_0x377e0b));if(_0x377e0b['error']){if(_0x377e0b['error']['code']===0x1f4){logger[_0x99bf('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x2ec35f,_0x377e0b[_0x99bf('0x10')][_0x99bf('0x11')]);return _0x157bed(_0x377e0b[_0x99bf('0x10')][_0x99bf('0x11')]);}logger[_0x99bf('0x10')](_0x99bf('0xc'),_0x2ec35f,_0x377e0b[_0x99bf('0x10')][_0x99bf('0x11')]);return _0x49efa6(_0x377e0b[_0x99bf('0x10')]['message']);}else{logger[_0x99bf('0xb')](_0x99bf('0xc'),_0x2ec35f,_0x99bf('0xd'));_0x49efa6(_0x377e0b[_0x99bf('0x12')][_0x99bf('0x11')]);}})[_0x99bf('0x13')](function(_0x133251){logger[_0x99bf('0x10')](_0x99bf('0xc'),_0x2ec35f,_0x133251);_0x157bed(_0x133251);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index ae49363..107a0b7 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 _0xcc27=['exports','INTEGER','sequelize'];(function(_0x598c2e,_0x502529){var _0x5a7b59=function(_0x167f62){while(--_0x167f62){_0x598c2e['push'](_0x598c2e['shift']());}};_0x5a7b59(++_0x502529);}(_0xcc27,0x161));var _0x7cc2=function(_0x4558a,_0x5648b3){_0x4558a=_0x4558a-0x0;var _0x15df35=_0xcc27[_0x4558a];return _0x15df35;};'use strict';var Sequelize=require(_0x7cc2('0x0'));module[_0x7cc2('0x1')]={'UserId':{'type':Sequelize[_0x7cc2('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7cc2('0x2')]}}; \ No newline at end of file +var _0x9da6=['exports','INTEGER','sequelize'];(function(_0x4b1fe2,_0x57d65f){var _0x1f438e=function(_0x24c689){while(--_0x24c689){_0x4b1fe2['push'](_0x4b1fe2['shift']());}};_0x1f438e(++_0x57d65f);}(_0x9da6,0x1e5));var _0x69da=function(_0x53faa2,_0x4e3c94){_0x53faa2=_0x53faa2-0x0;var _0x5e33c8=_0x9da6[_0x53faa2];return _0x5e33c8;};'use strict';var Sequelize=require(_0x69da('0x0'));module[_0x69da('0x1')]={'UserId':{'type':Sequelize[_0x69da('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x69da('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 4078bc8..01c07a7 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(_0x2fb4eb,_0x577bfb){var _0x583c6b=function(_0x4a7c9e){while(--_0x4a7c9e){_0x2fb4eb['push'](_0x2fb4eb['shift']());}};_0x583c6b(++_0x577bfb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x25c2ba,_0x429385){var _0x5aa947=function(_0x215aeb){while(--_0x215aeb){_0x25c2ba['push'](_0x25c2ba['shift']());}};_0x5aa947(++_0x429385);}(_0xa9e0,0x123));var _0x0a9e=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xa9e0[_0x138f59];return _0x3d114d;};'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 c903c68..4725327 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xb3e470,_0x3315d3){var _0x565b61=function(_0x14169e){while(--_0x14169e){_0xb3e470['push'](_0xb3e470['shift']());}};_0x565b61(++_0x3315d3);}(_0xe706,0xa3));var _0x6e70=function(_0x1eadfb,_0xc1e08b){_0x1eadfb=_0x1eadfb-0x0;var _0x5500fc=_0xe706[_0x1eadfb];return _0x5500fc;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x54ba9d,_0x3adcce){var _0x37c24e=function(_0x49f896){while(--_0x49f896){_0x54ba9d['push'](_0x54ba9d['shift']());}};_0x37c24e(++_0x3adcce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 67eef37..47eb289 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 _0x01b2=['INTEGER','sequelize','exports'];(function(_0x1a5770,_0x23aa8f){var _0x3b6610=function(_0x2abd01){while(--_0x2abd01){_0x1a5770['push'](_0x1a5770['shift']());}};_0x3b6610(++_0x23aa8f);}(_0x01b2,0xf1));var _0x201b=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0x01b2[_0x2341c6];return _0x54c34d;};'use strict';var Sequelize=require(_0x201b('0x0'));module[_0x201b('0x1')]={'penalty':{'type':Sequelize[_0x201b('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x4f8f=['exports'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x4f8f,0x90));var _0xf4f8=function(_0x49aba9,_0x429e1e){_0x49aba9=_0x49aba9-0x0;var _0x987361=_0x4f8f[_0x49aba9];return _0x987361;};'use strict';var Sequelize=require('sequelize');module[_0xf4f8('0x0')]={'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 476bdc3..da26f41 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 _0xa8f6=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','lodash'];(function(_0x408cd5,_0x363582){var _0x189c9b=function(_0xd89018){while(--_0xd89018){_0x408cd5['push'](_0x408cd5['shift']());}};_0x189c9b(++_0x363582);}(_0xa8f6,0x1d3));var _0x6a8f=function(_0x389af8,_0x211259){_0x389af8=_0x389af8-0x0;var _0x2b3a5a=_0xa8f6[_0x389af8];return _0x2b3a5a;};'use strict';var _=require(_0x6a8f('0x0'));var util=require(_0x6a8f('0x1'));var logger=require(_0x6a8f('0x2'))(_0x6a8f('0x3'));var moment=require(_0x6a8f('0x4'));var BPromise=require(_0x6a8f('0x5'));var rp=require(_0x6a8f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a8f('0x7'));var config=require(_0x6a8f('0x8'));var attributes=require(_0x6a8f('0x9'));module[_0x6a8f('0xa')]=function(_0x48452b,_0x3f0709){return _0x48452b[_0x6a8f('0xb')](_0x6a8f('0xc'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x999c=['../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','util','../../config/logger','api','path','rimraf'];(function(_0x564821,_0x4d037e){var _0x2b604d=function(_0x26fabf){while(--_0x26fabf){_0x564821['push'](_0x564821['shift']());}};_0x2b604d(++_0x4d037e);}(_0x999c,0x16c));var _0xc999=function(_0x3bb00e,_0x825c75){_0x3bb00e=_0x3bb00e-0x0;var _0x1e17fe=_0x999c[_0x3bb00e];return _0x1e17fe;};'use strict';var _=require('lodash');var util=require(_0xc999('0x0'));var logger=require(_0xc999('0x1'))(_0xc999('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc999('0x3'));var rimraf=require(_0xc999('0x4'));var config=require(_0xc999('0x5'));var attributes=require(_0xc999('0x6'));module['exports']=function(_0x4e2659,_0x5987a0){return _0x4e2659[_0xc999('0x7')](_0xc999('0x8'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index d24c76e..87283d5 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 _0x4086=['rpc','../../config/environment','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x1c917d,_0x403310){var _0x418d11=function(_0x46b826){while(--_0x46b826){_0x1c917d['push'](_0x1c917d['shift']());}};_0x418d11(++_0x403310);}(_0x4086,0x160));var _0x6408=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4086[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x6408('0x0'));var util=require(_0x6408('0x1'));var moment=require(_0x6408('0x2'));var BPromise=require(_0x6408('0x3'));var rs=require(_0x6408('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6408('0x5'))['db'];var utils=require(_0x6408('0x6'));var logger=require(_0x6408('0x7'))(_0x6408('0x8'));var config=require(_0x6408('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6408('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a741c,_0x34fec7,_0x4bbac4){return new BPromise(function(_0x2ecc20,_0x5b2756){return client[_0x6408('0xb')](_0x1a741c,_0x4bbac4)[_0x6408('0xc')](function(_0x457570){logger[_0x6408('0xd')](_0x6408('0xe'),_0x34fec7,'request\x20sent');logger[_0x6408('0xf')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x34fec7,_0x6408('0x10'),JSON['stringify'](_0x457570));if(_0x457570['error']){if(_0x457570[_0x6408('0x11')]['code']===0x1f4){logger[_0x6408('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x34fec7,_0x457570['error'][_0x6408('0x12')]);return _0x5b2756(_0x457570[_0x6408('0x11')][_0x6408('0x12')]);}logger[_0x6408('0x11')](_0x6408('0xe'),_0x34fec7,_0x457570[_0x6408('0x11')][_0x6408('0x12')]);return _0x2ecc20(_0x457570[_0x6408('0x11')]['message']);}else{logger[_0x6408('0xd')](_0x6408('0xe'),_0x34fec7,_0x6408('0x10'));_0x2ecc20(_0x457570[_0x6408('0x13')][_0x6408('0x12')]);}})['catch'](function(_0x39567f){logger[_0x6408('0x11')](_0x6408('0xe'),_0x34fec7,_0x39567f);_0x5b2756(_0x39567f);});});} \ No newline at end of file +var _0x29f2=['error','code','message','request\x20sent','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4b4f24,_0x5654a8){var _0x1c13d4=function(_0x4940bf){while(--_0x4940bf){_0x4b4f24['push'](_0x4b4f24['shift']());}};_0x1c13d4(++_0x5654a8);}(_0x29f2,0x102));var _0x229f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x29f2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x229f('0x0'));var util=require(_0x229f('0x1'));var moment=require('moment');var BPromise=require(_0x229f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x229f('0x3'))['db'];var utils=require(_0x229f('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x229f('0x5'));var jayson=require(_0x229f('0x6'));var client=jayson[_0x229f('0x7')][_0x229f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4a6fec,_0xda2bf0,_0x23b4ab){return new BPromise(function(_0x54a835,_0x4cdb3c){return client['request'](_0x4a6fec,_0x23b4ab)[_0x229f('0x9')](function(_0x43a525){logger[_0x229f('0xa')](_0x229f('0xb'),_0xda2bf0,'request\x20sent');logger[_0x229f('0xc')](_0x229f('0xd'),_0xda2bf0,'request\x20sent',JSON[_0x229f('0xe')](_0x43a525));if(_0x43a525[_0x229f('0xf')]){if(_0x43a525[_0x229f('0xf')][_0x229f('0x10')]===0x1f4){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0xda2bf0,_0x43a525['error'][_0x229f('0x11')]);return _0x4cdb3c(_0x43a525['error'][_0x229f('0x11')]);}logger['error'](_0x229f('0xb'),_0xda2bf0,_0x43a525['error']['message']);return _0x54a835(_0x43a525['error'][_0x229f('0x11')]);}else{logger[_0x229f('0xa')](_0x229f('0xb'),_0xda2bf0,_0x229f('0x12'));_0x54a835(_0x43a525[_0x229f('0x13')][_0x229f('0x11')]);}})[_0x229f('0x14')](function(_0x23d6d3){logger[_0x229f('0xf')]('UserVoiceQueue,\x20%s,\x20%s',_0xda2bf0,_0x23d6d3);_0x4cdb3c(_0x23d6d3);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ae44090..f04082c 100644 --- a/server/api/userVoiceQueueRt/index.js +++ b/server/api/userVoiceQueueRt/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x7179ba,_0x37504f){var _0x4ad820=function(_0x131107){while(--_0x131107){_0x7179ba['push'](_0x7179ba['shift']());}};_0x4ad820(++_0x37504f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4f4715,_0x3cb040){var _0x471eb3=function(_0x2dc636){while(--_0x2dc636){_0x4f4715['push'](_0x4f4715['shift']());}};_0x471eb3(++_0x3cb040);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 075fa3d..54fbafe 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 _0x95d9=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x1352f0,_0x4cd565){var _0x1c2a82=function(_0x2a9b63){while(--_0x2a9b63){_0x1352f0['push'](_0x1352f0['shift']());}};_0x1c2a82(++_0x4cd565);}(_0x95d9,0x138));var _0x995d=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x95d9[_0x1d24eb];return _0x1dc576;};'use strict';var Sequelize=require(_0x995d('0x0'));module[_0x995d('0x1')]={'uniqueid':{'type':Sequelize[_0x995d('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x995d('0x3')},'membername':{'type':Sequelize[_0x995d('0x4')],'allowNull':![],'comment':_0x995d('0x3')},'UserId':{'type':Sequelize[_0x995d('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x995d('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x995d('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x995d('0x4')],'allowNull':![],'unique':_0x995d('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x995d('0x2')](0xb),'defaultValue':0x0,'comment':_0x995d('0x3')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x8d88=['STRING','queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk'];(function(_0x1ee10a,_0x1ecc44){var _0x4bb4b4=function(_0x4b28ef){while(--_0x4b28ef){_0x1ee10a['push'](_0x1ee10a['shift']());}};_0x4bb4b4(++_0x1ecc44);}(_0x8d88,0x1be));var _0x88d8=function(_0x1bfec9,_0x2a863a){_0x1bfec9=_0x1bfec9-0x0;var _0x35cb18=_0x8d88[_0x1bfec9];return _0x35cb18;};'use strict';var Sequelize=require(_0x88d8('0x0'));module[_0x88d8('0x1')]={'uniqueid':{'type':Sequelize[_0x88d8('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x88d8('0x3')},'membername':{'type':Sequelize[_0x88d8('0x4')],'allowNull':![],'comment':_0x88d8('0x3')},'UserId':{'type':Sequelize[_0x88d8('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x88d8('0x4')],'allowNull':![],'unique':_0x88d8('0x5'),'comment':_0x88d8('0x3')},'VoiceQueueId':{'type':Sequelize[_0x88d8('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0x88d8('0x4')],'allowNull':![],'unique':_0x88d8('0x5'),'comment':_0x88d8('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x88d8('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 31626a6..c08c414 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 _0xe022=['hasOwnProperty','hook','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','remove','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe022,0xe2));var _0x2e02=function(_0x11088e,_0x31a0b4){_0x11088e=_0x11088e-0x0;var _0x5bfd4a=_0xe022[_0x11088e];return _0x5bfd4a;};'use strict';var EventEmitter=require(_0x2e02('0x0'));var UserVoiceQueueRt=require(_0x2e02('0x1'))['db'][_0x2e02('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x2e02('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2e02('0x4')};function emitEvent(_0x3e30fa){return function(_0x450f5b,_0x1b3dfc,_0x362af0){UserVoiceQueueRtEvents['emit'](_0x3e30fa+':'+_0x450f5b['id'],_0x450f5b);UserVoiceQueueRtEvents[_0x2e02('0x5')](_0x3e30fa,_0x450f5b);_0x362af0(null);};}for(var e in events){if(events[_0x2e02('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x2e02('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x4e22=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x554296,_0x404cc5){var _0x5d9fe7=function(_0x255627){while(--_0x255627){_0x554296['push'](_0x554296['shift']());}};_0x5d9fe7(++_0x404cc5);}(_0x4e22,0x11f));var _0x24e2=function(_0x1a78b4,_0x22e8f4){_0x1a78b4=_0x1a78b4-0x0;var _0x55a28a=_0x4e22[_0x1a78b4];return _0x55a28a;};'use strict';var EventEmitter=require(_0x24e2('0x0'));var UserVoiceQueueRt=require(_0x24e2('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x24e2('0x2')](0x0);var events={'afterCreate':_0x24e2('0x3'),'afterUpdate':_0x24e2('0x4'),'afterDestroy':_0x24e2('0x5')};function emitEvent(_0x594a6c){return function(_0x20d841,_0x262273,_0x3740c9){UserVoiceQueueRtEvents[_0x24e2('0x6')](_0x594a6c+':'+_0x20d841['id'],_0x20d841);UserVoiceQueueRtEvents[_0x24e2('0x6')](_0x594a6c,_0x20d841);_0x3740c9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x24e2('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 ea76801..994c617 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 _0x43d2=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x43d2,0x154));var _0x243d=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0x43d2[_0x1ea6eb];return _0x127200;};'use strict';var _=require('lodash');var util=require(_0x243d('0x0'));var logger=require(_0x243d('0x1'))('api');var moment=require(_0x243d('0x2'));var BPromise=require(_0x243d('0x3'));var rp=require(_0x243d('0x4'));var fs=require('fs');var path=require(_0x243d('0x5'));var rimraf=require(_0x243d('0x6'));var config=require(_0x243d('0x7'));var attributes=require(_0x243d('0x8'));module['exports']=function(_0x385d82,_0x52c70c){return _0x385d82[_0x243d('0x9')]('UserVoiceQueueRt',attributes,{'tableName':'user_has_voice_queues_rt','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa231=['./userVoiceQueueRt.attributes','define','user_has_voice_queues_rt','util','api','moment','request-promise','../../config/environment'];(function(_0x550575,_0x3d19da){var _0x1f148f=function(_0xedc217){while(--_0xedc217){_0x550575['push'](_0x550575['shift']());}};_0x1f148f(++_0x3d19da);}(_0xa231,0x6b));var _0x1a23=function(_0x13fe35,_0x537cee){_0x13fe35=_0x13fe35-0x0;var _0x4875a8=_0xa231[_0x13fe35];return _0x4875a8;};'use strict';var _=require('lodash');var util=require(_0x1a23('0x0'));var logger=require('../../config/logger')(_0x1a23('0x1'));var moment=require(_0x1a23('0x2'));var BPromise=require('bluebird');var rp=require(_0x1a23('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1a23('0x4'));var attributes=require(_0x1a23('0x5'));module['exports']=function(_0x341c97,_0x5639f5){return _0x341c97[_0x1a23('0x6')]('UserVoiceQueueRt',attributes,{'tableName':_0x1a23('0x7'),'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 1947764..78b1c7b 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 _0xf940=['UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request'];(function(_0x462fe4,_0x394d3e){var _0x82b23a=function(_0x2c071f){while(--_0x2c071f){_0x462fe4['push'](_0x462fe4['shift']());}};_0x82b23a(++_0x394d3e);}(_0xf940,0x87));var _0x0f94=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xf940[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require('lodash');var util=require(_0x0f94('0x0'));var moment=require(_0x0f94('0x1'));var BPromise=require('bluebird');var rs=require(_0x0f94('0x2'));var fs=require('fs');var Redis=require(_0x0f94('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f94('0x4'));var logger=require(_0x0f94('0x5'))('rpc');var config=require(_0x0f94('0x6'));var jayson=require(_0x0f94('0x7'));var client=jayson[_0x0f94('0x8')][_0x0f94('0x9')]({'port':0x232a});config['redis']=_[_0x0f94('0xa')](config[_0x0f94('0xb')],{'host':_0x0f94('0xc'),'port':0x18eb});var socket=require(_0x0f94('0xd'))(new Redis(config[_0x0f94('0xb')]));require(_0x0f94('0xe'))[_0x0f94('0xf')](socket);function respondWithRpcPromise(_0x37447d,_0x409c5e,_0x4d1841){return new BPromise(function(_0x1935e9,_0x505833){return client[_0x0f94('0x10')](_0x37447d,_0x4d1841)['then'](function(_0x47b10f){logger['info'](_0x0f94('0x11'),_0x409c5e,_0x0f94('0x12'));logger[_0x0f94('0x13')](_0x0f94('0x14'),_0x409c5e,_0x0f94('0x12'),JSON[_0x0f94('0x15')](_0x47b10f));if(_0x47b10f[_0x0f94('0x16')]){if(_0x47b10f['error'][_0x0f94('0x17')]===0x1f4){logger[_0x0f94('0x16')](_0x0f94('0x11'),_0x409c5e,_0x47b10f[_0x0f94('0x16')]['message']);return _0x505833(_0x47b10f[_0x0f94('0x16')]['message']);}logger['error'](_0x0f94('0x11'),_0x409c5e,_0x47b10f['error']['message']);return _0x1935e9(_0x47b10f[_0x0f94('0x16')][_0x0f94('0x18')]);}else{logger[_0x0f94('0x19')](_0x0f94('0x11'),_0x409c5e,_0x0f94('0x12'));_0x1935e9(_0x47b10f[_0x0f94('0x1a')][_0x0f94('0x18')]);}})['catch'](function(_0x32805f){logger[_0x0f94('0x16')](_0x0f94('0x11'),_0x409c5e,_0x32805f);_0x505833(_0x32805f);});});}exports[_0x0f94('0x1b')]=function(_0x194900){var _0x19a204=this;return new Promise(function(_0x2055aa,_0x5875f0){return db[_0x0f94('0x1c')][_0x0f94('0x1d')]({'raw':_0x194900[_0x0f94('0x1e')]?_0x194900[_0x0f94('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x194900[_0x0f94('0x1e')]?_0x194900['options'][_0x0f94('0x1f')]||null:null,'attributes':[[db[_0x0f94('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x0f94('0x21')](_0x0f94('0x22')))),_0x0f94('0x23')]]})[_0x0f94('0x24')](function(_0x440d57){logger['info'](_0x0f94('0x1b'),_0x194900);logger[_0x0f94('0x13')](_0x0f94('0x1b'),_0x194900,JSON[_0x0f94('0x15')](_0x440d57));_0x2055aa(_0x440d57);})[_0x0f94('0x25')](function(_0x3d2e06){logger[_0x0f94('0x16')]('GetVoiceQueueRtPauses',_0x3d2e06['message'],_0x194900);_0x5875f0(_0x19a204['error'](0x1f4,_0x3d2e06[_0x0f94('0x18')]));});});}; \ No newline at end of file +var _0x1d8b=['GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message'];(function(_0x2dda1a,_0x1d9ba8){var _0x33dacb=function(_0x333139){while(--_0x333139){_0x2dda1a['push'](_0x2dda1a['shift']());}};_0x33dacb(++_0x1d9ba8);}(_0x1d8b,0x1b0));var _0xb1d8=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x1d8b[_0x934425];return _0x31d596;};'use strict';var _=require('lodash');var util=require(_0xb1d8('0x0'));var moment=require('moment');var BPromise=require(_0xb1d8('0x1'));var rs=require(_0xb1d8('0x2'));var fs=require('fs');var Redis=require(_0xb1d8('0x3'));var db=require(_0xb1d8('0x4'))['db'];var utils=require(_0xb1d8('0x5'));var logger=require(_0xb1d8('0x6'))(_0xb1d8('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1d8('0x8'));var client=jayson[_0xb1d8('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xb1d8('0xa'),'port':0x18eb});var socket=require(_0xb1d8('0xb'))(new Redis(config['redis']));require(_0xb1d8('0xc'))[_0xb1d8('0xd')](socket);function respondWithRpcPromise(_0x34b54b,_0x378f41,_0x57b7bc){return new BPromise(function(_0x295485,_0x2d9f6f){return client['request'](_0x34b54b,_0x57b7bc)[_0xb1d8('0xe')](function(_0x516d8d){logger[_0xb1d8('0xf')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x378f41,_0xb1d8('0x10'));logger['debug'](_0xb1d8('0x11'),_0x378f41,_0xb1d8('0x10'),JSON[_0xb1d8('0x12')](_0x516d8d));if(_0x516d8d['error']){if(_0x516d8d[_0xb1d8('0x13')][_0xb1d8('0x14')]===0x1f4){logger[_0xb1d8('0x13')](_0xb1d8('0x15'),_0x378f41,_0x516d8d[_0xb1d8('0x13')][_0xb1d8('0x16')]);return _0x2d9f6f(_0x516d8d['error'][_0xb1d8('0x16')]);}logger[_0xb1d8('0x13')](_0xb1d8('0x15'),_0x378f41,_0x516d8d[_0xb1d8('0x13')][_0xb1d8('0x16')]);return _0x295485(_0x516d8d[_0xb1d8('0x13')]['message']);}else{logger[_0xb1d8('0xf')](_0xb1d8('0x15'),_0x378f41,_0xb1d8('0x10'));_0x295485(_0x516d8d['result'][_0xb1d8('0x16')]);}})['catch'](function(_0x351cb8){logger[_0xb1d8('0x13')](_0xb1d8('0x15'),_0x378f41,_0x351cb8);_0x2d9f6f(_0x351cb8);});});}exports[_0xb1d8('0x17')]=function(_0x3fef88){var _0x554c4f=this;return new Promise(function(_0x56bd60,_0x56ebaf){return db[_0xb1d8('0x18')][_0xb1d8('0x19')]({'raw':_0x3fef88[_0xb1d8('0x1a')]?_0x3fef88[_0xb1d8('0x1a')][_0xb1d8('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fef88['options']?_0x3fef88[_0xb1d8('0x1a')][_0xb1d8('0x1c')]||null:null,'attributes':[[db[_0xb1d8('0x1d')]['fn'](_0xb1d8('0x1e'),db['sequelize']['fn']('IF',db[_0xb1d8('0x1d')]['literal'](_0xb1d8('0x1f')))),_0xb1d8('0x20')]]})[_0xb1d8('0xe')](function(_0x4ff1d1){logger[_0xb1d8('0xf')](_0xb1d8('0x17'),_0x3fef88);logger[_0xb1d8('0x21')](_0xb1d8('0x17'),_0x3fef88,JSON[_0xb1d8('0x12')](_0x4ff1d1));_0x56bd60(_0x4ff1d1);})[_0xb1d8('0x22')](function(_0x457957){logger[_0xb1d8('0x13')](_0xb1d8('0x17'),_0x457957[_0xb1d8('0x16')],_0x3fef88);_0x56ebaf(_0x554c4f[_0xb1d8('0x13')](0x1f4,_0x457957[_0xb1d8('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 3399985..1e37df8 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 _0xdedd=['register','./userVoiceQueueRt.events','save','remove','update','emit','removeListener'];(function(_0x4fc3e0,_0xac71d2){var _0x5bb658=function(_0xf64aaf){while(--_0xf64aaf){_0x4fc3e0['push'](_0x4fc3e0['shift']());}};_0x5bb658(++_0xac71d2);}(_0xdedd,0x197));var _0xdded=function(_0x3fb91f,_0xacff65){_0x3fb91f=_0x3fb91f-0x0;var _0x36599f=_0xdedd[_0x3fb91f];return _0x36599f;};'use strict';var UserVoiceQueueRtEvents=require(_0xdded('0x0'));var events=[_0xdded('0x1'),_0xdded('0x2'),_0xdded('0x3')];function createListener(_0x357ada,_0x53d8af){return function(_0x18ba9d){_0x53d8af[_0xdded('0x4')](_0x357ada,_0x18ba9d);};}function removeListener(_0x207a33,_0x3e91ad){return function(){UserVoiceQueueRtEvents[_0xdded('0x5')](_0x207a33,_0x3e91ad);};}exports[_0xdded('0x6')]=function(_0x2e327c){for(var _0x277fab=0x0,_0x59aa13=events['length'];_0x277fab<_0x59aa13;_0x277fab++){var _0x558cff=events[_0x277fab];var _0x224a4d=createListener('userVoiceQueueRt:'+_0x558cff,_0x2e327c);UserVoiceQueueRtEvents['on'](_0x558cff,_0x224a4d);}}; \ No newline at end of file +var _0x88d5=['remove','update','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events','save'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x88d5,0x76));var _0x588d=function(_0x410344,_0x11c039){_0x410344=_0x410344-0x0;var _0x210ff4=_0x88d5[_0x410344];return _0x210ff4;};'use strict';var UserVoiceQueueRtEvents=require(_0x588d('0x0'));var events=[_0x588d('0x1'),_0x588d('0x2'),_0x588d('0x3')];function createListener(_0x315178,_0x5372b1){return function(_0xe46c98){_0x5372b1[_0x588d('0x4')](_0x315178,_0xe46c98);};}function removeListener(_0x504b52,_0x474e79){return function(){UserVoiceQueueRtEvents[_0x588d('0x5')](_0x504b52,_0x474e79);};}exports[_0x588d('0x6')]=function(_0x1b193f){for(var _0xecfb11=0x0,_0x413748=events['length'];_0xecfb11<_0x413748;_0xecfb11++){var _0x57699a=events[_0xecfb11];var _0x41ddf3=createListener(_0x588d('0x7')+_0x57699a,_0x1b193f);UserVoiceQueueRtEvents['on'](_0x57699a,_0x41ddf3);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index c526946..b9bdd51 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x55dc93,_0x5652e1){var _0x3cc66b=function(_0x8e1def){while(--_0x8e1def){_0x55dc93['push'](_0x55dc93['shift']());}};_0x3cc66b(++_0x5652e1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x973ad9,_0x57e9c1){var _0x5d2daf=function(_0x4594b0){while(--_0x4594b0){_0x973ad9['push'](_0x973ad9['shift']());}};_0x5d2daf(++_0x57e9c1);}(_0x70e0,0x17b));var _0x070e=function(_0x1d38de,_0x38c0ed){_0x1d38de=_0x1d38de-0x0;var _0xafbac8=_0x70e0[_0x1d38de];return _0xafbac8;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 4a95ff2..e9184dc 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 _0xf379=['sequelize','exports'];(function(_0x591de5,_0x1dcb5f){var _0x3a4ca2=function(_0xfd6455){while(--_0xfd6455){_0x591de5['push'](_0x591de5['shift']());}};_0x3a4ca2(++_0x1dcb5f);}(_0xf379,0x7a));var _0x9f37=function(_0x1d481c,_0x9e096f){_0x1d481c=_0x1d481c-0x0;var _0x37af97=_0xf379[_0x1d481c];return _0x37af97;};'use strict';var Sequelize=require(_0x9f37('0x0'));module[_0x9f37('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3383=['INTEGER','sequelize'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x3383,0x1b5));var _0x3338=function(_0x40e5a1,_0x13a13a){_0x40e5a1=_0x40e5a1-0x0;var _0x1d52e4=_0x3383[_0x40e5a1];return _0x1d52e4;};'use strict';var Sequelize=require(_0x3338('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x3338('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index fa1a231..f70bd08 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 _0xbf34=['exports','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2d2712,_0x8e383f){var _0x40059f=function(_0x3d4bf3){while(--_0x3d4bf3){_0x2d2712['push'](_0x2d2712['shift']());}};_0x40059f(++_0x8e383f);}(_0xbf34,0x1a5));var _0x4bf3=function(_0x5f5444,_0x23ff74){_0x5f5444=_0x5f5444-0x0;var _0x42f407=_0xbf34[_0x5f5444];return _0x42f407;};'use strict';var _=require(_0x4bf3('0x0'));var util=require(_0x4bf3('0x1'));var logger=require(_0x4bf3('0x2'))(_0x4bf3('0x3'));var moment=require(_0x4bf3('0x4'));var BPromise=require('bluebird');var rp=require(_0x4bf3('0x5'));var fs=require('fs');var path=require(_0x4bf3('0x6'));var rimraf=require(_0x4bf3('0x7'));var config=require('../../config/environment');var attributes=require('./userWhatsappQueue.attributes');module[_0x4bf3('0x8')]=function(_0x354c82,_0x5d1a85){return _0x354c82['define'](_0x4bf3('0x9'),attributes,{'tableName':_0x4bf3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xede1=['exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes'];(function(_0x339425,_0xe27955){var _0x3e8102=function(_0x1f0fa1){while(--_0x1f0fa1){_0x339425['push'](_0x339425['shift']());}};_0x3e8102(++_0xe27955);}(_0xede1,0x1b4));var _0x1ede=function(_0x3b002c,_0x4547d6){_0x3b002c=_0x3b002c-0x0;var _0x294519=_0xede1[_0x3b002c];return _0x294519;};'use strict';var _=require(_0x1ede('0x0'));var util=require('util');var logger=require(_0x1ede('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1ede('0x2'));var rp=require(_0x1ede('0x3'));var fs=require('fs');var path=require(_0x1ede('0x4'));var rimraf=require(_0x1ede('0x5'));var config=require(_0x1ede('0x6'));var attributes=require(_0x1ede('0x7'));module[_0x1ede('0x8')]=function(_0xf8d62c,_0x3c5c87){return _0xf8d62c[_0x1ede('0x9')](_0x1ede('0xa'),attributes,{'tableName':_0x1ede('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 44e91d7..397e31e 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 _0x6f18=['../../config/logger','rpc','../../config/environment','client','http','request','info','debug','request\x20sent','error','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x36854d,_0x5d6e52){var _0xaafaee=function(_0x278100){while(--_0x278100){_0x36854d['push'](_0x36854d['shift']());}};_0xaafaee(++_0x5d6e52);}(_0x6f18,0x15e));var _0x86f1=function(_0x2459c7,_0x1b20a9){_0x2459c7=_0x2459c7-0x0;var _0x44eb46=_0x6f18[_0x2459c7];return _0x44eb46;};'use strict';var _=require('lodash');var util=require(_0x86f1('0x0'));var moment=require(_0x86f1('0x1'));var BPromise=require(_0x86f1('0x2'));var rs=require(_0x86f1('0x3'));var fs=require('fs');var Redis=require(_0x86f1('0x4'));var db=require(_0x86f1('0x5'))['db'];var utils=require(_0x86f1('0x6'));var logger=require(_0x86f1('0x7'))(_0x86f1('0x8'));var config=require(_0x86f1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x86f1('0xa')][_0x86f1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x470e6,_0x17b7a9,_0x40a298){return new BPromise(function(_0x592f74,_0x31ab3b){return client[_0x86f1('0xc')](_0x470e6,_0x40a298)['then'](function(_0x2ce3d3){logger[_0x86f1('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x17b7a9,'request\x20sent');logger[_0x86f1('0xe')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x17b7a9,_0x86f1('0xf'),JSON['stringify'](_0x2ce3d3));if(_0x2ce3d3[_0x86f1('0x10')]){if(_0x2ce3d3['error']['code']===0x1f4){logger['error'](_0x86f1('0x11'),_0x17b7a9,_0x2ce3d3[_0x86f1('0x10')]['message']);return _0x31ab3b(_0x2ce3d3['error'][_0x86f1('0x12')]);}logger['error'](_0x86f1('0x11'),_0x17b7a9,_0x2ce3d3[_0x86f1('0x10')][_0x86f1('0x12')]);return _0x592f74(_0x2ce3d3[_0x86f1('0x10')]['message']);}else{logger[_0x86f1('0xd')](_0x86f1('0x11'),_0x17b7a9,_0x86f1('0xf'));_0x592f74(_0x2ce3d3[_0x86f1('0x13')][_0x86f1('0x12')]);}})[_0x86f1('0x14')](function(_0x4e545e){logger['error'](_0x86f1('0x11'),_0x17b7a9,_0x4e545e);_0x31ab3b(_0x4e545e);});});} \ No newline at end of file +var _0x42aa=['request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug'];(function(_0x2adc7c,_0x4c526b){var _0x167879=function(_0x38aca9){while(--_0x38aca9){_0x2adc7c['push'](_0x2adc7c['shift']());}};_0x167879(++_0x4c526b);}(_0x42aa,0x1a8));var _0xa42a=function(_0x245d1a,_0x133b59){_0x245d1a=_0x245d1a-0x0;var _0x40c189=_0x42aa[_0x245d1a];return _0x40c189;};'use strict';var _=require(_0xa42a('0x0'));var util=require('util');var moment=require(_0xa42a('0x1'));var BPromise=require(_0xa42a('0x2'));var rs=require(_0xa42a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa42a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa42a('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa42a('0x6')][_0xa42a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3c9709,_0x52feba,_0x231fdd){return new BPromise(function(_0xd33970,_0x3a2c74){return client[_0xa42a('0x8')](_0x3c9709,_0x231fdd)[_0xa42a('0x9')](function(_0x31b51b){logger[_0xa42a('0xa')](_0xa42a('0xb'),_0x52feba,'request\x20sent');logger[_0xa42a('0xc')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x52feba,_0xa42a('0xd'),JSON[_0xa42a('0xe')](_0x31b51b));if(_0x31b51b[_0xa42a('0xf')]){if(_0x31b51b[_0xa42a('0xf')]['code']===0x1f4){logger[_0xa42a('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x52feba,_0x31b51b[_0xa42a('0xf')][_0xa42a('0x10')]);return _0x3a2c74(_0x31b51b[_0xa42a('0xf')]['message']);}logger['error'](_0xa42a('0xb'),_0x52feba,_0x31b51b[_0xa42a('0xf')][_0xa42a('0x10')]);return _0xd33970(_0x31b51b[_0xa42a('0xf')]['message']);}else{logger[_0xa42a('0xa')](_0xa42a('0xb'),_0x52feba,_0xa42a('0xd'));_0xd33970(_0x31b51b[_0xa42a('0x11')][_0xa42a('0x10')]);}})[_0xa42a('0x12')](function(_0x407e58){logger[_0xa42a('0xf')]('UserWhatsappQueue,\x20%s,\x20%s',_0x52feba,_0x407e58);_0x3a2c74(_0x407e58);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index caf83fb..2be1ba3 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 _0xb43b=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','show','post','create','put','update','delete','/:id'];(function(_0x482812,_0x4e76f2){var _0x2a1584=function(_0x479a3f){while(--_0x479a3f){_0x482812['push'](_0x482812['shift']());}};_0x2a1584(++_0x4e76f2);}(_0xb43b,0xbf));var _0xbb43=function(_0x48918f,_0x20d043){_0x48918f=_0x48918f-0x0;var _0x3bfd68=_0xb43b[_0x48918f];return _0x3bfd68;};'use strict';var multer=require(_0xbb43('0x0'));var util=require('util');var path=require(_0xbb43('0x1'));var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var fs_extra=require(_0xbb43('0x5'));var auth=require(_0xbb43('0x6'));var interaction=require(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var controller=require(_0xbb43('0x9'));router[_0xbb43('0xa')]('/',auth[_0xbb43('0xb')](),controller['index']);router[_0xbb43('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xbb43('0xc')]);router[_0xbb43('0xd')]('/',auth[_0xbb43('0xb')](),controller[_0xbb43('0xe')]);router[_0xbb43('0xf')]('/:id',auth[_0xbb43('0xb')](),controller[_0xbb43('0x10')]);router[_0xbb43('0x11')](_0xbb43('0x12'),auth['isAuthenticated'](),controller[_0xbb43('0x13')]);module[_0xbb43('0x14')]=router; \ No newline at end of file +var _0x6c84=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x113045,_0x15fe51){var _0x5d1ded=function(_0x125532){while(--_0x125532){_0x113045['push'](_0x113045['shift']());}};_0x5d1ded(++_0x15fe51);}(_0x6c84,0x112));var _0x46c8=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x6c84[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x46c8('0x0'));var util=require(_0x46c8('0x1'));var path=require(_0x46c8('0x2'));var timeout=require(_0x46c8('0x3'));var express=require(_0x46c8('0x4'));var router=express['Router']();var fs_extra=require(_0x46c8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x46c8('0x6'));var config=require('../../config/environment');var controller=require('./variable.controller');router[_0x46c8('0x7')]('/',auth[_0x46c8('0x8')](),controller[_0x46c8('0x9')]);router[_0x46c8('0x7')](_0x46c8('0xa'),auth[_0x46c8('0x8')](),controller[_0x46c8('0xb')]);router[_0x46c8('0xc')]('/',auth['isAuthenticated'](),controller[_0x46c8('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x46c8('0xe')]);router['delete'](_0x46c8('0xa'),auth[_0x46c8('0x8')](),controller[_0x46c8('0xf')]);module[_0x46c8('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index c5cba7a..80e0071 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 _0x16bb=['sequelize','exports','name'];(function(_0x45b6bf,_0x5d90a6){var _0x58b1dd=function(_0x43ac36){while(--_0x43ac36){_0x45b6bf['push'](_0x45b6bf['shift']());}};_0x58b1dd(++_0x5d90a6);}(_0x16bb,0x1a1));var _0xb16b=function(_0x219729,_0x19f07d){_0x219729=_0x219729-0x0;var _0x35c464=_0x16bb[_0x219729];return _0x35c464;};'use strict';var Sequelize=require(_0xb16b('0x0'));module[_0xb16b('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb16b('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4a81=['exports','STRING','name','sequelize'];(function(_0x4ecdda,_0x3b092d){var _0x397020=function(_0x42bc44){while(--_0x42bc44){_0x4ecdda['push'](_0x4ecdda['shift']());}};_0x397020(++_0x3b092d);}(_0x4a81,0x1b7));var _0x14a8=function(_0x3fb73b,_0x2cd34a){_0x3fb73b=_0x3fb73b-0x0;var _0x48cf16=_0x4a81[_0x3fb73b];return _0x48cf16;};'use strict';var Sequelize=require(_0x14a8('0x0'));module[_0x14a8('0x1')]={'name':{'type':Sequelize[_0x14a8('0x2')],'unique':_0x14a8('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index a69cd68..07e4590 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 _0x2ea2=['rows','show','params','length','include','find','create','user','get','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','Variables','UserProfileResource','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll'];(function(_0x51e2b4,_0x590b7b){var _0x1de6f2=function(_0x295cfc){while(--_0x295cfc){_0x51e2b4['push'](_0x51e2b4['shift']());}};_0x1de6f2(++_0x590b7b);}(_0x2ea2,0x1ad));var _0x22ea=function(_0x417b97,_0x9a9155){_0x417b97=_0x417b97-0x0;var _0x5b2f97=_0x2ea2[_0x417b97];return _0x5b2f97;};'use strict';var emlformat=require(_0x22ea('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x22ea('0x1'));var jsonpatch=require(_0x22ea('0x2'));var rp=require(_0x22ea('0x3'));var moment=require(_0x22ea('0x4'));var BPromise=require(_0x22ea('0x5'));var Mustache=require(_0x22ea('0x6'));var util=require(_0x22ea('0x7'));var path=require(_0x22ea('0x8'));var sox=require('sox');var csv=require(_0x22ea('0x9'));var ejs=require(_0x22ea('0xa'));var fs=require('fs');var fs_extra=require(_0x22ea('0xb'));var _=require(_0x22ea('0xc'));var squel=require(_0x22ea('0xd'));var crypto=require(_0x22ea('0xe'));var jsforce=require(_0x22ea('0xf'));var deskjs=require(_0x22ea('0x10'));var toCsv=require('to-csv');var querystring=require(_0x22ea('0x11'));var Papa=require(_0x22ea('0x12'));var Redis=require('ioredis');var authService=require(_0x22ea('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x22ea('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22ea('0x15'))('api');var utils=require(_0x22ea('0x16'));var config=require(_0x22ea('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30f46e,_0x16fcb9){_0x16fcb9=_0x16fcb9||0xcc;return function(_0x478b1d){if(_0x478b1d){return _0x30f46e[_0x22ea('0x18')](_0x16fcb9);}return _0x30f46e[_0x22ea('0x19')](_0x16fcb9)[_0x22ea('0x1a')]();};}function respondWithResult(_0x50a8d9,_0x399a20){_0x399a20=_0x399a20||0xc8;return function(_0x116d27){if(_0x116d27){return _0x50a8d9[_0x22ea('0x19')](_0x399a20)[_0x22ea('0x1b')](_0x116d27);}};}function respondWithFilteredResult(_0x4c2e09,_0x3a6e82){return function(_0x965d63){if(_0x965d63){var _0x394e39=typeof _0x3a6e82[_0x22ea('0x1c')]==='undefined'&&typeof _0x3a6e82['limit']===_0x22ea('0x1d');var _0x23d579=_0x965d63[_0x22ea('0x1e')];var _0x1dd75f=_0x394e39?0x0:_0x3a6e82[_0x22ea('0x1c')];var _0x26f224=_0x394e39?_0x965d63[_0x22ea('0x1e')]:_0x3a6e82[_0x22ea('0x1c')]+_0x3a6e82[_0x22ea('0x1f')];var _0x4bff99;if(_0x26f224>=_0x23d579){_0x26f224=_0x23d579;_0x4bff99=0xc8;}else{_0x4bff99=0xce;}_0x4c2e09[_0x22ea('0x19')](_0x4bff99);return _0x4c2e09[_0x22ea('0x20')]('Content-Range',_0x1dd75f+'-'+_0x26f224+'/'+_0x23d579)[_0x22ea('0x1b')](_0x965d63);}return null;};}function patchUpdates(_0x2a0b4f){return function(_0x50a9c7){try{jsonpatch['apply'](_0x50a9c7,_0x2a0b4f,!![]);}catch(_0x45a241){return BPromise[_0x22ea('0x21')](_0x45a241);}return _0x50a9c7[_0x22ea('0x22')]();};}function saveUpdates(_0x53756c,_0x20c718){return function(_0x5c05c1){if(_0x5c05c1){return _0x5c05c1[_0x22ea('0x23')](_0x53756c)[_0x22ea('0x24')](function(_0x578eb0){return _0x578eb0;});}return null;};}function removeEntity(_0x4dc456,_0x6c2df3){return function(_0x128b3f){if(_0x128b3f){return _0x128b3f[_0x22ea('0x25')]()['then'](function(){var _0x1794a4=_0x128b3f['get']({'plain':!![]});var _0x211097=_0x22ea('0x26');return db[_0x22ea('0x27')][_0x22ea('0x25')]({'where':{'type':_0x211097,'resourceId':_0x1794a4['id']}})['then'](function(){return _0x128b3f;});})[_0x22ea('0x24')](function(){_0x4dc456['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd9eab3,_0x5aa402){return function(_0x92fa1f){if(!_0x92fa1f){_0xd9eab3[_0x22ea('0x18')](0x194);}return _0x92fa1f;};}function handleError(_0x3b693c,_0x543513){_0x543513=_0x543513||0x1f4;return function(_0x5d775a){logger[_0x22ea('0x28')](_0x5d775a[_0x22ea('0x29')]);if(_0x5d775a['name']){delete _0x5d775a[_0x22ea('0x2a')];}_0x3b693c[_0x22ea('0x19')](_0x543513)[_0x22ea('0x2b')](_0x5d775a);};}exports[_0x22ea('0x2c')]=function(_0x55f1cc,_0x18b24a){var _0x1fe427={},_0xb3fb4={},_0x2efb5f={'count':0x0,'rows':[]};var _0x2b53b6=_[_0x22ea('0x2d')](db[_0x22ea('0x2e')][_0x22ea('0x2f')],function(_0x21daa6){return{'name':_0x21daa6[_0x22ea('0x30')],'type':_0x21daa6[_0x22ea('0x31')]['key']};});_0xb3fb4[_0x22ea('0x32')]=_[_0x22ea('0x2d')](_0x2b53b6,_0x22ea('0x2a'));_0xb3fb4[_0x22ea('0x33')]=_[_0x22ea('0x34')](_0x55f1cc[_0x22ea('0x33')]);_0xb3fb4[_0x22ea('0x35')]=_['intersection'](_0xb3fb4[_0x22ea('0x32')],_0xb3fb4[_0x22ea('0x33')]);_0x1fe427[_0x22ea('0x36')]=_[_0x22ea('0x37')](_0xb3fb4[_0x22ea('0x32')],qs[_0x22ea('0x38')](_0x55f1cc[_0x22ea('0x33')][_0x22ea('0x38')]));_0x1fe427[_0x22ea('0x36')]=_0x1fe427[_0x22ea('0x36')]['length']?_0x1fe427[_0x22ea('0x36')]:_0xb3fb4[_0x22ea('0x32')];if(!_0x55f1cc[_0x22ea('0x33')][_0x22ea('0x39')](_0x22ea('0x3a'))){_0x1fe427[_0x22ea('0x1f')]=qs['limit'](_0x55f1cc[_0x22ea('0x33')][_0x22ea('0x1f')]);_0x1fe427[_0x22ea('0x1c')]=qs[_0x22ea('0x1c')](_0x55f1cc[_0x22ea('0x33')]['offset']);}_0x1fe427[_0x22ea('0x3b')]=qs['sort'](_0x55f1cc['query'][_0x22ea('0x3c')]);_0x1fe427['where']=qs[_0x22ea('0x35')](_[_0x22ea('0x3d')](_0x55f1cc[_0x22ea('0x33')],_0xb3fb4[_0x22ea('0x35')]),_0x2b53b6);if(_0x55f1cc[_0x22ea('0x33')][_0x22ea('0x3e')]){_0x1fe427[_0x22ea('0x3f')]=_[_0x22ea('0x40')](_0x1fe427[_0x22ea('0x3f')],{'$or':_[_0x22ea('0x2d')](_0x2b53b6,function(_0x156911){if(_0x156911[_0x22ea('0x31')]!==_0x22ea('0x41')){var _0x533c64={};_0x533c64[_0x156911[_0x22ea('0x2a')]]={'$like':'%'+_0x55f1cc[_0x22ea('0x33')][_0x22ea('0x3e')]+'%'};return _0x533c64;}})});}_0x1fe427=_[_0x22ea('0x40')]({},_0x1fe427,_0x55f1cc[_0x22ea('0x42')]);var _0x333216={'where':_0x1fe427[_0x22ea('0x3f')]};return db[_0x22ea('0x2e')][_0x22ea('0x1e')](_0x333216)[_0x22ea('0x24')](function(_0x30c433){_0x2efb5f[_0x22ea('0x1e')]=_0x30c433;if(_0x55f1cc[_0x22ea('0x33')][_0x22ea('0x43')]){_0x1fe427['include']=[{'all':!![]}];}return db[_0x22ea('0x2e')][_0x22ea('0x44')](_0x1fe427);})['then'](function(_0x241f37){_0x2efb5f[_0x22ea('0x45')]=_0x241f37;return _0x2efb5f;})[_0x22ea('0x24')](respondWithFilteredResult(_0x18b24a,_0x1fe427))['catch'](handleError(_0x18b24a,null));};exports[_0x22ea('0x46')]=function(_0x4b4114,_0x5d7b90){var _0x45d28b={'raw':!![],'where':{'id':_0x4b4114[_0x22ea('0x47')]['id']}},_0x39db65={};_0x39db65[_0x22ea('0x32')]=_[_0x22ea('0x34')](db[_0x22ea('0x2e')]['rawAttributes']);_0x39db65[_0x22ea('0x33')]=_[_0x22ea('0x34')](_0x4b4114[_0x22ea('0x33')]);_0x39db65[_0x22ea('0x35')]=_[_0x22ea('0x37')](_0x39db65[_0x22ea('0x32')],_0x39db65['query']);_0x45d28b[_0x22ea('0x36')]=_['intersection'](_0x39db65[_0x22ea('0x32')],qs[_0x22ea('0x38')](_0x4b4114['query'][_0x22ea('0x38')]));_0x45d28b['attributes']=_0x45d28b[_0x22ea('0x36')][_0x22ea('0x48')]?_0x45d28b[_0x22ea('0x36')]:_0x39db65[_0x22ea('0x32')];if(_0x4b4114[_0x22ea('0x33')][_0x22ea('0x43')]){_0x45d28b[_0x22ea('0x49')]=[{'all':!![]}];}_0x45d28b=_[_0x22ea('0x40')]({},_0x45d28b,_0x4b4114['options']);return db[_0x22ea('0x2e')][_0x22ea('0x4a')](_0x45d28b)[_0x22ea('0x24')](handleEntityNotFound(_0x5d7b90,null))['then'](respondWithResult(_0x5d7b90,null))['catch'](handleError(_0x5d7b90,null));};exports[_0x22ea('0x4b')]=function(_0x395e9c,_0x25626b){return db[_0x22ea('0x2e')][_0x22ea('0x4b')](_0x395e9c['body'],{})['then'](function(_0x595cfa){var _0x2ce7bc=_0x395e9c[_0x22ea('0x4c')][_0x22ea('0x4d')]({'plain':!![]});if(!_0x2ce7bc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2ce7bc['role']===_0x22ea('0x4c')){var _0x1cc0b9=_0x595cfa[_0x22ea('0x4d')]({'plain':!![]});var _0x31d13b=_0x22ea('0x26');return db[_0x22ea('0x4e')][_0x22ea('0x4a')]({'where':{'name':_0x31d13b,'userProfileId':_0x2ce7bc['userProfileId']},'raw':!![]})[_0x22ea('0x24')](function(_0x8eaaaa){if(_0x8eaaaa&&_0x8eaaaa[_0x22ea('0x4f')]===0x0){return db['UserProfileResource'][_0x22ea('0x4b')]({'name':_0x1cc0b9[_0x22ea('0x2a')],'resourceId':_0x1cc0b9['id'],'type':_0x8eaaaa[_0x22ea('0x2a')],'sectionId':_0x8eaaaa['id']},{})[_0x22ea('0x24')](function(){return _0x595cfa;});}else{return _0x595cfa;}})[_0x22ea('0x50')](function(_0x281c13){logger[_0x22ea('0x28')](_0x22ea('0x51'),_0x281c13);throw _0x281c13;});}return _0x595cfa;})[_0x22ea('0x24')](respondWithResult(_0x25626b,0xc9))[_0x22ea('0x50')](handleError(_0x25626b,null));};exports[_0x22ea('0x23')]=function(_0x133cd0,_0x69476d){if(_0x133cd0[_0x22ea('0x52')]['id']){delete _0x133cd0[_0x22ea('0x52')]['id'];}return db[_0x22ea('0x2e')][_0x22ea('0x4a')]({'where':{'id':_0x133cd0[_0x22ea('0x47')]['id']}})[_0x22ea('0x24')](handleEntityNotFound(_0x69476d,null))['then'](saveUpdates(_0x133cd0[_0x22ea('0x52')],null))[_0x22ea('0x24')](respondWithResult(_0x69476d,null))[_0x22ea('0x50')](handleError(_0x69476d,null));};exports['destroy']=function(_0x593cae,_0x1135fc){return db[_0x22ea('0x2e')][_0x22ea('0x4a')]({'where':{'id':_0x593cae['params']['id']}})['then'](handleEntityNotFound(_0x1135fc,null))[_0x22ea('0x24')](removeEntity(_0x1135fc,null))['catch'](handleError(_0x1135fc,null));}; \ No newline at end of file +var _0x422b=['util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','update','destroy','then','get','stack','name','send','map','Variable','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Variables','UserProfileSection','find','userProfileId','autoAssociation','catch','error','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x51ce14,_0x5cd58b){var _0x301a2d=function(_0x85fdf){while(--_0x85fdf){_0x51ce14['push'](_0x51ce14['shift']());}};_0x301a2d(++_0x5cd58b);}(_0x422b,0x1c1));var _0xb422=function(_0x5278b9,_0x392ae5){_0x5278b9=_0x5278b9-0x0;var _0x1c5a52=_0x422b[_0x5278b9];return _0x1c5a52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb422('0x0'));var zipdir=require(_0xb422('0x1'));var jsonpatch=require(_0xb422('0x2'));var rp=require(_0xb422('0x3'));var moment=require(_0xb422('0x4'));var BPromise=require(_0xb422('0x5'));var Mustache=require(_0xb422('0x6'));var util=require(_0xb422('0x7'));var path=require(_0xb422('0x8'));var sox=require(_0xb422('0x9'));var csv=require(_0xb422('0xa'));var ejs=require(_0xb422('0xb'));var fs=require('fs');var fs_extra=require(_0xb422('0xc'));var _=require(_0xb422('0xd'));var squel=require('squel');var crypto=require(_0xb422('0xe'));var jsforce=require(_0xb422('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb422('0xa'));var querystring=require(_0xb422('0x10'));var Papa=require(_0xb422('0x11'));var Redis=require(_0xb422('0x12'));var authService=require(_0xb422('0x13'));var qs=require(_0xb422('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb422('0x15'));var config=require(_0xb422('0x16'));var licenseUtil=require(_0xb422('0x17'));var db=require(_0xb422('0x18'))['db'];function respondWithStatusCode(_0x2e22e1,_0x4e4f8e){_0x4e4f8e=_0x4e4f8e||0xcc;return function(_0x1282ef){if(_0x1282ef){return _0x2e22e1[_0xb422('0x19')](_0x4e4f8e);}return _0x2e22e1['status'](_0x4e4f8e)['end']();};}function respondWithResult(_0x5c171b,_0x18e806){_0x18e806=_0x18e806||0xc8;return function(_0x3c7bb1){if(_0x3c7bb1){return _0x5c171b[_0xb422('0x1a')](_0x18e806)[_0xb422('0x1b')](_0x3c7bb1);}};}function respondWithFilteredResult(_0x2bf60d,_0x55a0bd){return function(_0x1feaf0){if(_0x1feaf0){var _0x9f469c=typeof _0x55a0bd[_0xb422('0x1c')]===_0xb422('0x1d')&&typeof _0x55a0bd['limit']===_0xb422('0x1d');var _0x2889b6=_0x1feaf0[_0xb422('0x1e')];var _0x2a1f86=_0x9f469c?0x0:_0x55a0bd[_0xb422('0x1c')];var _0x33ee05=_0x9f469c?_0x1feaf0[_0xb422('0x1e')]:_0x55a0bd['offset']+_0x55a0bd['limit'];var _0x16102c;if(_0x33ee05>=_0x2889b6){_0x33ee05=_0x2889b6;_0x16102c=0xc8;}else{_0x16102c=0xce;}_0x2bf60d[_0xb422('0x1a')](_0x16102c);return _0x2bf60d[_0xb422('0x1f')](_0xb422('0x20'),_0x2a1f86+'-'+_0x33ee05+'/'+_0x2889b6)[_0xb422('0x1b')](_0x1feaf0);}return null;};}function patchUpdates(_0x112404){return function(_0x4b77fe){try{jsonpatch['apply'](_0x4b77fe,_0x112404,!![]);}catch(_0x375d4b){return BPromise['reject'](_0x375d4b);}return _0x4b77fe['save']();};}function saveUpdates(_0x3abc7c,_0x47018f){return function(_0x53cec3){if(_0x53cec3){return _0x53cec3[_0xb422('0x21')](_0x3abc7c)['then'](function(_0x226f44){return _0x226f44;});}return null;};}function removeEntity(_0xa6646f,_0x5966ec){return function(_0x5aa743){if(_0x5aa743){return _0x5aa743[_0xb422('0x22')]()[_0xb422('0x23')](function(){var _0x2f620b=_0x5aa743[_0xb422('0x24')]({'plain':!![]});var _0x545ffa='Variables';return db['UserProfileResource'][_0xb422('0x22')]({'where':{'type':_0x545ffa,'resourceId':_0x2f620b['id']}})[_0xb422('0x23')](function(){return _0x5aa743;});})['then'](function(){_0xa6646f[_0xb422('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b541,_0x2fe131){return function(_0x3e21b2){if(!_0x3e21b2){_0x52b541[_0xb422('0x19')](0x194);}return _0x3e21b2;};}function handleError(_0x4cea17,_0x4f33b3){_0x4f33b3=_0x4f33b3||0x1f4;return function(_0x3d0c99){logger['error'](_0x3d0c99[_0xb422('0x25')]);if(_0x3d0c99['name']){delete _0x3d0c99[_0xb422('0x26')];}_0x4cea17[_0xb422('0x1a')](_0x4f33b3)[_0xb422('0x27')](_0x3d0c99);};}exports['index']=function(_0x2a8140,_0x638b5e){var _0x237352={},_0x8777cf={},_0x42aa24={'count':0x0,'rows':[]};var _0x196e1b=_[_0xb422('0x28')](db[_0xb422('0x29')][_0xb422('0x2a')],function(_0x52d529){return{'name':_0x52d529['fieldName'],'type':_0x52d529[_0xb422('0x2b')][_0xb422('0x2c')]};});_0x8777cf[_0xb422('0x2d')]=_[_0xb422('0x28')](_0x196e1b,_0xb422('0x26'));_0x8777cf[_0xb422('0x2e')]=_[_0xb422('0x2f')](_0x2a8140[_0xb422('0x2e')]);_0x8777cf['filters']=_[_0xb422('0x30')](_0x8777cf[_0xb422('0x2d')],_0x8777cf['query']);_0x237352['attributes']=_[_0xb422('0x30')](_0x8777cf[_0xb422('0x2d')],qs['fields'](_0x2a8140[_0xb422('0x2e')][_0xb422('0x31')]));_0x237352[_0xb422('0x32')]=_0x237352['attributes']['length']?_0x237352[_0xb422('0x32')]:_0x8777cf[_0xb422('0x2d')];if(!_0x2a8140[_0xb422('0x2e')][_0xb422('0x33')]('nolimit')){_0x237352[_0xb422('0x34')]=qs['limit'](_0x2a8140[_0xb422('0x2e')][_0xb422('0x34')]);_0x237352[_0xb422('0x1c')]=qs[_0xb422('0x1c')](_0x2a8140[_0xb422('0x2e')]['offset']);}_0x237352['order']=qs[_0xb422('0x35')](_0x2a8140[_0xb422('0x2e')][_0xb422('0x35')]);_0x237352[_0xb422('0x36')]=qs[_0xb422('0x37')](_[_0xb422('0x38')](_0x2a8140[_0xb422('0x2e')],_0x8777cf['filters']),_0x196e1b);if(_0x2a8140[_0xb422('0x2e')][_0xb422('0x39')]){_0x237352['where']=_[_0xb422('0x3a')](_0x237352[_0xb422('0x36')],{'$or':_['map'](_0x196e1b,function(_0x8c3ee1){if(_0x8c3ee1['type']!=='VIRTUAL'){var _0x267fd7={};_0x267fd7[_0x8c3ee1[_0xb422('0x26')]]={'$like':'%'+_0x2a8140[_0xb422('0x2e')]['filter']+'%'};return _0x267fd7;}})});}_0x237352=_[_0xb422('0x3a')]({},_0x237352,_0x2a8140[_0xb422('0x3b')]);var _0x4d03f2={'where':_0x237352[_0xb422('0x36')]};return db['Variable'][_0xb422('0x1e')](_0x4d03f2)[_0xb422('0x23')](function(_0xd8a813){_0x42aa24[_0xb422('0x1e')]=_0xd8a813;if(_0x2a8140[_0xb422('0x2e')][_0xb422('0x3c')]){_0x237352[_0xb422('0x3d')]=[{'all':!![]}];}return db['Variable'][_0xb422('0x3e')](_0x237352);})[_0xb422('0x23')](function(_0x2783e0){_0x42aa24['rows']=_0x2783e0;return _0x42aa24;})['then'](respondWithFilteredResult(_0x638b5e,_0x237352))['catch'](handleError(_0x638b5e,null));};exports[_0xb422('0x3f')]=function(_0x1c506c,_0x564e72){var _0x44c961={'raw':!![],'where':{'id':_0x1c506c['params']['id']}},_0x4b8ec5={};_0x4b8ec5[_0xb422('0x2d')]=_[_0xb422('0x2f')](db[_0xb422('0x29')][_0xb422('0x2a')]);_0x4b8ec5[_0xb422('0x2e')]=_['keys'](_0x1c506c[_0xb422('0x2e')]);_0x4b8ec5[_0xb422('0x37')]=_['intersection'](_0x4b8ec5[_0xb422('0x2d')],_0x4b8ec5[_0xb422('0x2e')]);_0x44c961[_0xb422('0x32')]=_[_0xb422('0x30')](_0x4b8ec5[_0xb422('0x2d')],qs[_0xb422('0x31')](_0x1c506c[_0xb422('0x2e')][_0xb422('0x31')]));_0x44c961[_0xb422('0x32')]=_0x44c961[_0xb422('0x32')]['length']?_0x44c961[_0xb422('0x32')]:_0x4b8ec5[_0xb422('0x2d')];if(_0x1c506c[_0xb422('0x2e')][_0xb422('0x3c')]){_0x44c961[_0xb422('0x3d')]=[{'all':!![]}];}_0x44c961=_['merge']({},_0x44c961,_0x1c506c[_0xb422('0x3b')]);return db[_0xb422('0x29')]['find'](_0x44c961)[_0xb422('0x23')](handleEntityNotFound(_0x564e72,null))[_0xb422('0x23')](respondWithResult(_0x564e72,null))['catch'](handleError(_0x564e72,null));};exports[_0xb422('0x40')]=function(_0x712f7,_0x3f72d5){return db[_0xb422('0x29')][_0xb422('0x40')](_0x712f7['body'],{})[_0xb422('0x23')](function(_0x4b8cfd){var _0x331af4=_0x712f7[_0xb422('0x41')][_0xb422('0x24')]({'plain':!![]});if(!_0x331af4)throw new Error(_0xb422('0x42'));if(_0x331af4['role']===_0xb422('0x41')){var _0x3de4b2=_0x4b8cfd[_0xb422('0x24')]({'plain':!![]});var _0x51e6cf=_0xb422('0x43');return db[_0xb422('0x44')][_0xb422('0x45')]({'where':{'name':_0x51e6cf,'userProfileId':_0x331af4[_0xb422('0x46')]},'raw':!![]})[_0xb422('0x23')](function(_0x382fbc){if(_0x382fbc&&_0x382fbc[_0xb422('0x47')]===0x0){return db['UserProfileResource'][_0xb422('0x40')]({'name':_0x3de4b2[_0xb422('0x26')],'resourceId':_0x3de4b2['id'],'type':_0x382fbc[_0xb422('0x26')],'sectionId':_0x382fbc['id']},{})['then'](function(){return _0x4b8cfd;});}else{return _0x4b8cfd;}})[_0xb422('0x48')](function(_0x81a82){logger[_0xb422('0x49')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x81a82);throw _0x81a82;});}return _0x4b8cfd;})[_0xb422('0x23')](respondWithResult(_0x3f72d5,0xc9))[_0xb422('0x48')](handleError(_0x3f72d5,null));};exports[_0xb422('0x21')]=function(_0x2b0778,_0x283e32){if(_0x2b0778[_0xb422('0x4a')]['id']){delete _0x2b0778[_0xb422('0x4a')]['id'];}return db[_0xb422('0x29')][_0xb422('0x45')]({'where':{'id':_0x2b0778[_0xb422('0x4b')]['id']}})[_0xb422('0x23')](handleEntityNotFound(_0x283e32,null))[_0xb422('0x23')](saveUpdates(_0x2b0778[_0xb422('0x4a')],null))[_0xb422('0x23')](respondWithResult(_0x283e32,null))[_0xb422('0x48')](handleError(_0x283e32,null));};exports[_0xb422('0x22')]=function(_0x3796f1,_0x7b48b3){return db['Variable'][_0xb422('0x45')]({'where':{'id':_0x3796f1[_0xb422('0x4b')]['id']}})[_0xb422('0x23')](handleEntityNotFound(_0x7b48b3,null))[_0xb422('0x23')](removeEntity(_0x7b48b3,null))[_0xb422('0x48')](handleError(_0x7b48b3,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 6248657..2ba25f8 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 _0x0514=['./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x647982,_0x6798c0){var _0x2993e6=function(_0x2796f1){while(--_0x2796f1){_0x647982['push'](_0x647982['shift']());}};_0x2993e6(++_0x6798c0);}(_0x0514,0x75));var _0x4051=function(_0x48374d,_0x52be50){_0x48374d=_0x48374d-0x0;var _0x27d87c=_0x0514[_0x48374d];return _0x27d87c;};'use strict';var _=require(_0x4051('0x0'));var util=require('util');var logger=require(_0x4051('0x1'))(_0x4051('0x2'));var moment=require(_0x4051('0x3'));var BPromise=require(_0x4051('0x4'));var rp=require(_0x4051('0x5'));var fs=require('fs');var path=require(_0x4051('0x6'));var rimraf=require(_0x4051('0x7'));var config=require(_0x4051('0x8'));var attributes=require(_0x4051('0x9'));module[_0x4051('0xa')]=function(_0x407d2a,_0x746a77){return _0x407d2a[_0x4051('0xb')](_0x4051('0xc'),attributes,{'tableName':_0x4051('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2ca=['rimraf','exports','define','Variable','tools_variables','util','api','moment','request-promise','path'];(function(_0x26daf6,_0x149fdf){var _0x45c206=function(_0x823851){while(--_0x823851){_0x26daf6['push'](_0x26daf6['shift']());}};_0x45c206(++_0x149fdf);}(_0xf2ca,0xaf));var _0xaf2c=function(_0x111494,_0x1d73da){_0x111494=_0x111494-0x0;var _0x1d0d8b=_0xf2ca[_0x111494];return _0x1d0d8b;};'use strict';var _=require('lodash');var util=require(_0xaf2c('0x0'));var logger=require('../../config/logger')(_0xaf2c('0x1'));var moment=require(_0xaf2c('0x2'));var BPromise=require('bluebird');var rp=require(_0xaf2c('0x3'));var fs=require('fs');var path=require(_0xaf2c('0x4'));var rimraf=require(_0xaf2c('0x5'));var config=require('../../config/environment');var attributes=require('./variable.attributes');module[_0xaf2c('0x6')]=function(_0x4b5eba,_0x10c2c0){return _0x4b5eba[_0xaf2c('0x7')](_0xaf2c('0x8'),attributes,{'tableName':_0xaf2c('0x9'),'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 7b9a355..f5ae40b 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6aa7=['include','model','attributes','map','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowVariable','find','options','raw','where'];(function(_0x3e4d75,_0xdd04a7){var _0x5c19a5=function(_0x3321e6){while(--_0x3321e6){_0x3e4d75['push'](_0x3e4d75['shift']());}};_0x5c19a5(++_0xdd04a7);}(_0x6aa7,0x178));var _0x76aa=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x6aa7[_0x35da42];return _0x370035;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});}exports[_0x76aa('0x16')]=function(_0x21c16d){var _0xa1bc7=this;return new Promise(function(_0x3ead3f,_0x496902){return db['Variable'][_0x76aa('0x17')]({'raw':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x19')]===undefined?!![]:![]:!![],'where':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1a')]||null:null,'attributes':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')]['attributes']||null:null,'include':_0x21c16d[_0x76aa('0x18')]?_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')]?_['map'](_0x21c16d[_0x76aa('0x18')][_0x76aa('0x1b')],function(_0x31252f){return{'model':db[_0x31252f[_0x76aa('0x1c')]],'as':_0x31252f['as'],'attributes':_0x31252f[_0x76aa('0x1d')],'include':_0x31252f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x31252f[_0x76aa('0x1b')],function(_0x32bf9f){return{'model':db[_0x32bf9f[_0x76aa('0x1c')]],'as':_0x32bf9f['as'],'attributes':_0x32bf9f[_0x76aa('0x1d')],'include':_0x32bf9f[_0x76aa('0x1b')]?_[_0x76aa('0x1e')](_0x32bf9f['include'],function(_0xb5e8a9){return{'model':db[_0xb5e8a9[_0x76aa('0x1c')]],'as':_0xb5e8a9['as'],'attributes':_0xb5e8a9[_0x76aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x76aa('0xa')](function(_0xa1e6){logger[_0x76aa('0xb')](_0x76aa('0x16'),_0x21c16d);logger[_0x76aa('0xe')](_0x76aa('0x16'),_0x21c16d,JSON[_0x76aa('0x10')](_0xa1e6));_0x3ead3f(_0xa1e6);})['catch'](function(_0x3fcb7f){logger['error'](_0x76aa('0x16'),_0x3fcb7f[_0x76aa('0x13')],_0x21c16d);_0x496902(_0xa1bc7[_0x76aa('0x11')](0x1f4,_0x3fcb7f[_0x76aa('0x13')]));});});}; \ No newline at end of file +var _0x7217=['where','attributes','map','include','model','ShowVariable','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Variable,\x20%s,\x20%s','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','Variable','find','options','raw'];(function(_0x3066f8,_0x41b414){var _0x3e9f08=function(_0x5d8969){while(--_0x5d8969){_0x3066f8['push'](_0x3066f8['shift']());}};_0x3e9f08(++_0x41b414);}(_0x7217,0x19e));var _0x7721=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x7217[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var moment=require(_0x7721('0x1'));var BPromise=require(_0x7721('0x2'));var rs=require(_0x7721('0x3'));var fs=require('fs');var Redis=require(_0x7721('0x4'));var db=require(_0x7721('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7ff37,_0x18ab6b,_0x21f680){return new BPromise(function(_0x225610,_0x2f99ed){return client[_0x7721('0xb')](_0xf7ff37,_0x21f680)[_0x7721('0xc')](function(_0xfa8835){logger[_0x7721('0xd')](_0x7721('0xe'),_0x18ab6b,'request\x20sent');logger[_0x7721('0xf')](_0x7721('0x10'),_0x18ab6b,_0x7721('0x11'),JSON[_0x7721('0x12')](_0xfa8835));if(_0xfa8835[_0x7721('0x13')]){if(_0xfa8835[_0x7721('0x13')][_0x7721('0x14')]===0x1f4){logger[_0x7721('0x13')]('Variable,\x20%s,\x20%s',_0x18ab6b,_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);return _0x2f99ed(_0xfa8835['error'][_0x7721('0x15')]);}logger[_0x7721('0x13')](_0x7721('0xe'),_0x18ab6b,_0xfa8835[_0x7721('0x13')]['message']);return _0x225610(_0xfa8835[_0x7721('0x13')][_0x7721('0x15')]);}else{logger['info']('Variable,\x20%s,\x20%s',_0x18ab6b,'request\x20sent');_0x225610(_0xfa8835[_0x7721('0x16')][_0x7721('0x15')]);}})[_0x7721('0x17')](function(_0x32550d){logger['error'](_0x7721('0xe'),_0x18ab6b,_0x32550d);_0x2f99ed(_0x32550d);});});}exports['ShowVariable']=function(_0x3fc09e){var _0x5cb0e6=this;return new Promise(function(_0xfec626,_0x4e96fb){return db[_0x7721('0x18')][_0x7721('0x19')]({'raw':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1b')]===undefined?!![]:![]:!![],'where':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1c')]||null:null,'attributes':_0x3fc09e['options']?_0x3fc09e[_0x7721('0x1a')][_0x7721('0x1d')]||null:null,'include':_0x3fc09e[_0x7721('0x1a')]?_0x3fc09e[_0x7721('0x1a')]['include']?_[_0x7721('0x1e')](_0x3fc09e['options'][_0x7721('0x1f')],function(_0x288e3a){return{'model':db[_0x288e3a[_0x7721('0x20')]],'as':_0x288e3a['as'],'attributes':_0x288e3a[_0x7721('0x1d')],'include':_0x288e3a[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x288e3a[_0x7721('0x1f')],function(_0x5b4d74){return{'model':db[_0x5b4d74[_0x7721('0x20')]],'as':_0x5b4d74['as'],'attributes':_0x5b4d74[_0x7721('0x1d')],'include':_0x5b4d74[_0x7721('0x1f')]?_[_0x7721('0x1e')](_0x5b4d74[_0x7721('0x1f')],function(_0x16355a){return{'model':db[_0x16355a[_0x7721('0x20')]],'as':_0x16355a['as'],'attributes':_0x16355a[_0x7721('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7721('0xc')](function(_0x52316e){logger[_0x7721('0xd')]('ShowVariable',_0x3fc09e);logger['debug'](_0x7721('0x21'),_0x3fc09e,JSON[_0x7721('0x12')](_0x52316e));_0xfec626(_0x52316e);})[_0x7721('0x17')](function(_0x158d98){logger[_0x7721('0x13')](_0x7721('0x21'),_0x158d98[_0x7721('0x15')],_0x3fc09e);_0x4e96fb(_0x5cb0e6[_0x7721('0x13')](0x1f4,_0x158d98['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index f64bb3d..d9e73c6 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 _0x8e9d=['/pull','pull','/restart','migrations','exports','Router','../../components/auth/service','get','index','isAuthenticated','canUpdate','reset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e9d,0x101));var _0xd8e9=function(_0x24bcec,_0x282a85){_0x24bcec=_0x24bcec-0x0;var _0x2d8b73=_0x8e9d[_0x24bcec];return _0x2d8b73;};'use strict';var express=require('express');var router=express[_0xd8e9('0x0')]();var auth=require(_0xd8e9('0x1'));var controller=require('./version.controller');router[_0xd8e9('0x2')]('/',controller[_0xd8e9('0x3')]);router[_0xd8e9('0x2')]('/fetch',auth[_0xd8e9('0x4')](),auth['canUpdate'](),controller['fetch']);router['get']('/reset',auth[_0xd8e9('0x4')](),auth[_0xd8e9('0x5')](),controller[_0xd8e9('0x6')]);router[_0xd8e9('0x2')](_0xd8e9('0x7'),auth['isAuthenticated'](),auth[_0xd8e9('0x5')](),controller[_0xd8e9('0x8')]);router[_0xd8e9('0x2')](_0xd8e9('0x9'),auth[_0xd8e9('0x4')](),controller['restart']);router[_0xd8e9('0x2')]('/migrations',controller[_0xd8e9('0xa')]);module[_0xd8e9('0xb')]=router; \ No newline at end of file +var _0x938e=['../../components/auth/service','./version.controller','get','/fetch','isAuthenticated','/reset','canUpdate','/pull','pull','/restart','restart','/migrations','express','Router'];(function(_0x238671,_0x34aea0){var _0x474844=function(_0x26cab4){while(--_0x26cab4){_0x238671['push'](_0x238671['shift']());}};_0x474844(++_0x34aea0);}(_0x938e,0x132));var _0xe938=function(_0x15cbce,_0xda8402){_0x15cbce=_0x15cbce-0x0;var _0x257f29=_0x938e[_0x15cbce];return _0x257f29;};'use strict';var express=require(_0xe938('0x0'));var router=express[_0xe938('0x1')]();var auth=require(_0xe938('0x2'));var controller=require(_0xe938('0x3'));router[_0xe938('0x4')]('/',controller['index']);router['get'](_0xe938('0x5'),auth[_0xe938('0x6')](),auth['canUpdate'](),controller['fetch']);router[_0xe938('0x4')](_0xe938('0x7'),auth[_0xe938('0x6')](),auth[_0xe938('0x8')](),controller['reset']);router[_0xe938('0x4')](_0xe938('0x9'),auth['isAuthenticated'](),auth[_0xe938('0x8')](),controller[_0xe938('0xa')]);router[_0xe938('0x4')](_0xe938('0xb'),auth['isAuthenticated'](),controller[_0xe938('0xc')]);router[_0xe938('0x4')](_0xe938('0xd'),controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cd0eb10..dbba27d 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 _0x14f6=['master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','pull','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','sequelize','Migration','getQueryInterface','constructor','\x20to\x20','last','catch','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','version','compare-versions','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','index','exports','query','latest','fetch','tags','2.0.0','status','json'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x14f6,0xc2));var _0x614f=function(_0x39d6ea,_0x1e1405){_0x39d6ea=_0x39d6ea-0x0;var _0x599d33=_0x14f6[_0x39d6ea];return _0x599d33;};'use strict';var Umzug=require('umzug');var path=require(_0x614f('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x614f('0x1'))(module,_0x614f('0x2'));var compareVersions=require(_0x614f('0x3'));var exec=require('child_process')['exec'];var db=require(_0x614f('0x4'))['db'];var config=require(_0x614f('0x5'));var pm2=require(_0x614f('0x6'));var logger=require(_0x614f('0x7'))(_0x614f('0x8'));var git=require('simple-git')(config['root']);exports[_0x614f('0x9')]=function(_0x973709,_0x32e626){var _0x43520d={'current':module[_0x614f('0xa')][_0x614f('0x2')],'phonebar':0x2};if(_0x973709['query']&&_0x973709[_0x614f('0xb')][_0x614f('0xc')]){return git[_0x614f('0xd')]()[_0x614f('0xe')](function(_0x3f46e0,_0x1b4c30){_0x43520d[_0x614f('0xc')]=(_0x3f46e0?module[_0x614f('0xa')][_0x614f('0x2')]:_0x1b4c30[_0x614f('0xc')])||_0x614f('0xf');return _0x32e626[_0x614f('0x10')](0xc8)[_0x614f('0x11')](_0x43520d);});}else{return _0x32e626[_0x614f('0x10')](0xc8)[_0x614f('0x11')](_0x43520d);}};exports[_0x614f('0xd')]=function(_0x37ec8d,_0x1745eb){return git[_0x614f('0xd')](['origin',_0x614f('0x12')],function(_0x5d3e39){if(_0x5d3e39){logger[_0x614f('0x13')](_0x5d3e39);return _0x1745eb['status'](0x1f4)[_0x614f('0x11')](_0x5d3e39);}logger[_0x614f('0x14')](_0x614f('0x15'));return _0x1745eb[_0x614f('0x10')](0xc8)[_0x614f('0x11')]({'output':_0x614f('0x16')});});};exports[_0x614f('0x17')]=function(_0x2c066f,_0x1165dd){return git[_0x614f('0x17')]([_0x614f('0x18'),_0x614f('0x19')],function(_0xdcd992){if(_0xdcd992){logger[_0x614f('0x13')](_0xdcd992);return _0x1165dd['status'](0x1f4)['json'](_0xdcd992);}logger['info'](_0x614f('0x1a'));return _0x1165dd[_0x614f('0x10')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports[_0x614f('0x1b')]=function(_0x592211,_0x12775a){exec(_0x614f('0x1c'),function(_0x2bd37d,_0x88f32c,_0x1f28a3){logger[_0x614f('0x14')](_0x88f32c);logger['info'](_0x1f28a3);if(_0x2bd37d){logger['error'](_0x2bd37d);return _0x12775a[_0x614f('0x10')](0x1f4)[_0x614f('0x11')](_0x2bd37d);}return _0x12775a[_0x614f('0x10')](0xc8)[_0x614f('0x11')]({'output':_0x88f32c});});};exports[_0x614f('0x1d')]=function(_0x1e05e3,_0x1d2496){return pm2[_0x614f('0x1d')](_0x614f('0x1e'))[_0x614f('0x1f')](function(_0x395ff0){logger[_0x614f('0x14')](_0x614f('0x20'),_0x395ff0);return _0x1d2496[_0x614f('0x10')](0xc8)[_0x614f('0x11')]({'output':_0x614f('0x21')});})['catch'](function(_0x898d4e){logger['error'](_0x898d4e);return _0x1d2496[_0x614f('0x10')](0x1f4)['json'](_0x898d4e);});};exports[_0x614f('0x22')]=function(_0x281813,_0x38b36d){var _0xa850f6=fs[_0x614f('0x23')](path[_0x614f('0x24')](config[_0x614f('0x25')],_0x614f('0x26'),_0x614f('0x22')));var _0x1a69b7=[];for(var _0x1a4504=0x0;_0x1a4504<_0xa850f6[_0x614f('0x27')];_0x1a4504++){var _0x30d252=_0xa850f6[_0x1a4504][_0x614f('0x28')](_0x614f('0x29'),'');if(compareVersions(module[_0x614f('0xa')][_0x614f('0x2')],_0x30d252)===-0x1){_0x1a69b7[_0x614f('0x2a')](_0x30d252);}}if(_0x1a69b7[_0x614f('0x27')]){var _0x11c83d=_0x1a69b7[_0x614f('0x2b')](compareVersions);var _0xe757b=new Umzug({'storage':_0x614f('0x2c'),'storageOptions':{'model':db[_0x614f('0x2d')],'modelName':_0x614f('0x2d'),'columnName':_0x614f('0x2')},'migrations':{'params':[db[_0x614f('0x2c')][_0x614f('0x2e')](),db[_0x614f('0x2c')][_0x614f('0x2f')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config['root'],_0x614f('0x26'),'migrations'),'pattern':/\.js$/}});_0xe757b['up']({'migrations':_['map'](_0x11c83d,function(_0xd2cc39){return _0xd2cc39+'.js';})})['then'](function(){return _0x38b36d[_0x614f('0x10')](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x614f('0xa')]['version']+_0x614f('0x30')+_[_0x614f('0x31')](_0x11c83d),'migrations':_['join'](_0x11c83d)});})[_0x614f('0x32')](function(_0x30c2ee){if(_0x30c2ee instanceof db[_0x614f('0x2c')][_0x614f('0x33')]){return _0x38b36d[_0x614f('0x10')](0xc8)[_0x614f('0x11')]({'output':_0x614f('0x34')});}else{return _0x38b36d[_0x614f('0x10')](0x1f4)['json'](_0x30c2ee);}});}else{return _0x38b36d['status'](0xc8)[_0x614f('0x11')]({'output':_0x614f('0x34')});}}; \ No newline at end of file +var _0x6a7e=['pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','index','exports','fetch','tags','latest','2.0.0','status','json','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','npm\x20install\x20--production','restart','motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','push','sort','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.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6a7e,0x170));var _0xe6a7=function(_0x27821d,_0x56d1b8){_0x27821d=_0x27821d-0x0;var _0x173437=_0x6a7e[_0x27821d];return _0x173437;};'use strict';var Umzug=require(_0xe6a7('0x0'));var path=require(_0xe6a7('0x1'));var fs=require('fs');var _=require(_0xe6a7('0x2'));var pkginfo=require(_0xe6a7('0x3'))(module,_0xe6a7('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xe6a7('0x5'))[_0xe6a7('0x6')];var db=require(_0xe6a7('0x7'))['db'];var config=require(_0xe6a7('0x8'));var pm2=require(_0xe6a7('0x9'));var logger=require(_0xe6a7('0xa'))('update');var git=require(_0xe6a7('0xb'))(config['root']);exports[_0xe6a7('0xc')]=function(_0x5abbef,_0x29ac35){var _0x544af8={'current':module[_0xe6a7('0xd')][_0xe6a7('0x4')],'phonebar':0x2};if(_0x5abbef['query']&&_0x5abbef['query']['latest']){return git[_0xe6a7('0xe')]()[_0xe6a7('0xf')](function(_0x5b1066,_0x33f17e){_0x544af8[_0xe6a7('0x10')]=(_0x5b1066?module['exports'][_0xe6a7('0x4')]:_0x33f17e[_0xe6a7('0x10')])||_0xe6a7('0x11');return _0x29ac35[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')](_0x544af8);});}else{return _0x29ac35[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')](_0x544af8);}};exports[_0xe6a7('0xe')]=function(_0x4e43d3,_0x18d6ae){return git[_0xe6a7('0xe')](['origin','master'],function(_0x31d926){if(_0x31d926){logger[_0xe6a7('0x14')](_0x31d926);return _0x18d6ae[_0xe6a7('0x12')](0x1f4)[_0xe6a7('0x13')](_0x31d926);}logger[_0xe6a7('0x15')]('git\x20fetch');return _0x18d6ae[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')]({'output':_0xe6a7('0x16')});});};exports[_0xe6a7('0x17')]=function(_0x535049,_0x44a338){return git[_0xe6a7('0x17')]([_0xe6a7('0x18'),_0xe6a7('0x19')],function(_0x1114e9){if(_0x1114e9){logger['error'](_0x1114e9);return _0x44a338['status'](0x1f4)[_0xe6a7('0x13')](_0x1114e9);}logger[_0xe6a7('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x44a338[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x4b8575,_0x2cc242){exec(_0xe6a7('0x1a'),function(_0x219403,_0x98fd1e,_0x7e28a3){logger[_0xe6a7('0x15')](_0x98fd1e);logger[_0xe6a7('0x15')](_0x7e28a3);if(_0x219403){logger[_0xe6a7('0x14')](_0x219403);return _0x2cc242[_0xe6a7('0x12')](0x1f4)[_0xe6a7('0x13')](_0x219403);}return _0x2cc242['status'](0xc8)[_0xe6a7('0x13')]({'output':_0x98fd1e});});};exports[_0xe6a7('0x1b')]=function(_0x5a858d,_0xb5694b){return pm2[_0xe6a7('0x1b')](_0xe6a7('0x1c'))[_0xe6a7('0x1d')](function(_0x5d852c){logger['info'](_0xe6a7('0x1e'),_0x5d852c);return _0xb5694b[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')]({'output':_0xe6a7('0x1f')});})[_0xe6a7('0x20')](function(_0x5ee0c2){logger[_0xe6a7('0x14')](_0x5ee0c2);return _0xb5694b['status'](0x1f4)[_0xe6a7('0x13')](_0x5ee0c2);});};exports[_0xe6a7('0x21')]=function(_0x40463e,_0x5c1720){var _0x3bf98c=fs[_0xe6a7('0x22')](path[_0xe6a7('0x23')](config[_0xe6a7('0x24')],_0xe6a7('0x25'),'migrations'));var _0x2be714=[];for(var _0x195748=0x0;_0x195748<_0x3bf98c[_0xe6a7('0x26')];_0x195748++){var _0x8a22d=_0x3bf98c[_0x195748][_0xe6a7('0x27')](_0xe6a7('0x28'),'');if(compareVersions(module[_0xe6a7('0xd')][_0xe6a7('0x4')],_0x8a22d)===-0x1){_0x2be714[_0xe6a7('0x29')](_0x8a22d);}}if(_0x2be714[_0xe6a7('0x26')]){var _0x5e9825=_0x2be714[_0xe6a7('0x2a')](compareVersions);var _0x4110c6=new Umzug({'storage':_0xe6a7('0x2b'),'storageOptions':{'model':db[_0xe6a7('0x2c')],'modelName':_0xe6a7('0x2c'),'columnName':_0xe6a7('0x4')},'migrations':{'params':[db[_0xe6a7('0x2b')][_0xe6a7('0x2d')](),db[_0xe6a7('0x2b')][_0xe6a7('0x2e')],function(){throw new Error(_0xe6a7('0x2f'));}],'path':path[_0xe6a7('0x23')](config[_0xe6a7('0x24')],_0xe6a7('0x25'),'migrations'),'pattern':/\.js$/}});_0x4110c6['up']({'migrations':_[_0xe6a7('0x30')](_0x5e9825,function(_0x2e79cb){return _0x2e79cb+_0xe6a7('0x28');})})['then'](function(){return _0x5c1720[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0xe6a7('0xd')][_0xe6a7('0x4')]+_0xe6a7('0x31')+_[_0xe6a7('0x32')](_0x5e9825),'migrations':_[_0xe6a7('0x23')](_0x5e9825)});})[_0xe6a7('0x20')](function(_0x27f35b){if(_0x27f35b instanceof db[_0xe6a7('0x2b')][_0xe6a7('0x33')]){return _0x5c1720[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')]({'output':_0xe6a7('0x34')});}else{return _0x5c1720[_0xe6a7('0x12')](0x1f4)['json'](_0x27f35b);}});}else{return _0x5c1720[_0xe6a7('0x12')](0xc8)[_0xe6a7('0x13')]({'output':_0xe6a7('0x34')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 71f7f4b..cdc0adc 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 _0x1345=['create','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','index','get','/describe','isAuthenticated','/:id','show'];(function(_0xf7a9cf,_0x2cfa33){var _0x7fdc45=function(_0x44b354){while(--_0x44b354){_0xf7a9cf['push'](_0xf7a9cf['shift']());}};_0x7fdc45(++_0x2cfa33);}(_0x1345,0xa6));var _0x5134=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x1345[_0x25bea7];return _0x175952;};'use strict';var multer=require(_0x5134('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5134('0x1'));var express=require(_0x5134('0x2'));var router=express[_0x5134('0x3')]();var fs_extra=require(_0x5134('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5134('0x5'));var config=require(_0x5134('0x6'));var controller=require(_0x5134('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x5134('0x8')]);router[_0x5134('0x9')](_0x5134('0xa'),auth[_0x5134('0xb')](),controller['describe']);router['get'](_0x5134('0xc'),auth['isAuthenticated'](),controller[_0x5134('0xd')]);router['post']('/',auth[_0x5134('0xb')](),controller[_0x5134('0xe')]);router['put'](_0x5134('0xc'),auth[_0x5134('0xb')](),controller[_0x5134('0xf')]);router[_0x5134('0x10')](_0x5134('0xc'),auth[_0x5134('0xb')](),controller[_0x5134('0x11')]);module['exports']=router; \ No newline at end of file +var _0x9d77=['create','put','update','/:id','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','index','get','/describe','describe','show','post'];(function(_0x594e9d,_0x883433){var _0x2f4839=function(_0x28e1d4){while(--_0x28e1d4){_0x594e9d['push'](_0x594e9d['shift']());}};_0x2f4839(++_0x883433);}(_0x9d77,0x1ce));var _0x79d7=function(_0x261f3e,_0x12c296){_0x261f3e=_0x261f3e-0x0;var _0x193e98=_0x9d77[_0x261f3e];return _0x193e98;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x79d7('0x0'));var timeout=require(_0x79d7('0x1'));var express=require('express');var router=express[_0x79d7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x79d7('0x3'));var config=require(_0x79d7('0x4'));var controller=require(_0x79d7('0x5'));router['get']('/',auth[_0x79d7('0x6')](),controller[_0x79d7('0x7')]);router[_0x79d7('0x8')](_0x79d7('0x9'),auth[_0x79d7('0x6')](),controller[_0x79d7('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x79d7('0xb')]);router[_0x79d7('0xc')]('/',auth[_0x79d7('0x6')](),controller[_0x79d7('0xd')]);router[_0x79d7('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x79d7('0xf')]);router['delete'](_0x79d7('0x10'),auth['isAuthenticated'](),controller[_0x79d7('0x11')]);module[_0x79d7('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 41582f7..6cee3c4 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 _0x6cb4=['DATE','INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x2e92eb,_0x1c1a36){var _0x28fcee=function(_0x17026e){while(--_0x17026e){_0x2e92eb['push'](_0x2e92eb['shift']());}};_0x28fcee(++_0x1c1a36);}(_0x6cb4,0xff));var _0x46cb=function(_0x4ba954,_0x20b8bd){_0x4ba954=_0x4ba954-0x0;var _0x2b0add=_0x6cb4[_0x4ba954];return _0x2b0add;};'use strict';var Sequelize=require(_0x46cb('0x0'));module[_0x46cb('0x1')]={'type':{'type':Sequelize[_0x46cb('0x2')]},'uniqueid':{'type':Sequelize[_0x46cb('0x2')]},'calleridnum':{'type':Sequelize[_0x46cb('0x2')]},'calleridname':{'type':Sequelize[_0x46cb('0x2')]},'queue':{'type':Sequelize[_0x46cb('0x2')]},'interface':{'type':Sequelize[_0x46cb('0x2')]},'membername':{'type':Sequelize[_0x46cb('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x46cb('0x3')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x46cb('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x46cb('0x4')]},'agentcomplete':{'type':Sequelize[_0x46cb('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x46cb('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x46cb('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x46cb('0x4')]},'agentacw':{'type':Sequelize[_0x46cb('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x46cb('0x2')]},'lastevent':{'type':Sequelize[_0x46cb('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x46cb('0x4')]},'channelstatedesc':{'type':Sequelize[_0x46cb('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x46cb('0x2')]},'language':{'type':Sequelize[_0x46cb('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x46cb('0x2')]},'destchannel':{'type':Sequelize[_0x46cb('0x2')]},'destchannelstate':{'type':Sequelize[_0x46cb('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x46cb('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x46cb('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x46cb('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x46cb('0x2')]},'destlanguage':{'type':Sequelize[_0x46cb('0x2')]},'destaccountcode':{'type':Sequelize[_0x46cb('0x2')]},'destcontext':{'type':Sequelize[_0x46cb('0x2')]},'destexten':{'type':Sequelize[_0x46cb('0x2')]},'destpriority':{'type':Sequelize[_0x46cb('0x2')]},'destuniqueid':{'type':Sequelize[_0x46cb('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x46cb('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x46cb('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x46cb('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x46cb('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x02a7=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN'];(function(_0x57e554,_0x22d31d){var _0x5b5906=function(_0x4ee66b){while(--_0x4ee66b){_0x57e554['push'](_0x57e554['shift']());}};_0x5b5906(++_0x22d31d);}(_0x02a7,0x1a6));var _0x702a=function(_0x5c3072,_0x13dc1e){_0x5c3072=_0x5c3072-0x0;var _0x507c29=_0x02a7[_0x5c3072];return _0x507c29;};'use strict';var Sequelize=require('sequelize');module[_0x702a('0x0')]={'type':{'type':Sequelize[_0x702a('0x1')]},'uniqueid':{'type':Sequelize[_0x702a('0x1')]},'calleridnum':{'type':Sequelize[_0x702a('0x1')]},'calleridname':{'type':Sequelize[_0x702a('0x1')]},'queue':{'type':Sequelize[_0x702a('0x1')]},'interface':{'type':Sequelize[_0x702a('0x1')]},'membername':{'type':Sequelize[_0x702a('0x1')]},'agentcalledAt':{'type':Sequelize[_0x702a('0x2')]},'agentconnectAt':{'type':Sequelize[_0x702a('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x702a('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x702a('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x702a('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x702a('0x1')]},'lastevent':{'type':Sequelize[_0x702a('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x702a('0x4')]},'channelstatedesc':{'type':Sequelize[_0x702a('0x1')]},'connectedlinenum':{'type':Sequelize[_0x702a('0x1')]},'connectedlinename':{'type':Sequelize[_0x702a('0x1')]},'language':{'type':Sequelize[_0x702a('0x1')]},'accountcode':{'type':Sequelize[_0x702a('0x1')]},'context':{'type':Sequelize[_0x702a('0x1')]},'exten':{'type':Sequelize[_0x702a('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x702a('0x1')]},'destchannelstate':{'type':Sequelize[_0x702a('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x702a('0x1')]},'destcalleridnum':{'type':Sequelize[_0x702a('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x702a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x702a('0x1')]},'destlanguage':{'type':Sequelize[_0x702a('0x1')]},'destaccountcode':{'type':Sequelize[_0x702a('0x1')]},'destcontext':{'type':Sequelize[_0x702a('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x702a('0x1')]},'destuniqueid':{'type':Sequelize[_0x702a('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x702a('0x1')]},'answeredelsewheremembername':{'type':Sequelize[_0x702a('0x1')]},'transfer':{'type':Sequelize[_0x702a('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x702a('0x1')],'comment':_0x702a('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x702a('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 1443028..a68d479 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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'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(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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 29a7dec..a712958 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 _0x7da7=['exports','define','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x44a28c,_0x40d96b){var _0x5f4eac=function(_0x176bdd){while(--_0x176bdd){_0x44a28c['push'](_0x44a28c['shift']());}};_0x5f4eac(++_0x40d96b);}(_0x7da7,0x10d));var _0x77da=function(_0x4f4d19,_0x574245){_0x4f4d19=_0x4f4d19-0x0;var _0x27a258=_0x7da7[_0x4f4d19];return _0x27a258;};'use strict';var _=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var logger=require(_0x77da('0x2'))('api');var moment=require('moment');var BPromise=require(_0x77da('0x3'));var rp=require(_0x77da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77da('0x5'));var config=require(_0x77da('0x6'));var attributes=require('./voiceAgentReport.attributes');module[_0x77da('0x7')]=function(_0xc54a12,_0x47da81){return _0xc54a12[_0x77da('0x8')]('VoiceAgentReport',attributes,{'tableName':_0x77da('0x9'),'paranoid':![],'indexes':[{'fields':[_0x77da('0xa'),_0x77da('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x46ed=['bluebird','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','api','moment'];(function(_0x190478,_0x5c634a){var _0x2f18ae=function(_0x3213d6){while(--_0x3213d6){_0x190478['push'](_0x190478['shift']());}};_0x2f18ae(++_0x5c634a);}(_0x46ed,0x168));var _0xd46e=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x46ed[_0x25e7cb];return _0x375d92;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var logger=require('../../config/logger')(_0xd46e('0x2'));var moment=require(_0xd46e('0x3'));var BPromise=require(_0xd46e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd46e('0x5'));var rimraf=require(_0xd46e('0x6'));var config=require('../../config/environment');var attributes=require(_0xd46e('0x7'));module[_0xd46e('0x8')]=function(_0x160bcf,_0x25cf78){return _0x160bcf[_0xd46e('0x9')](_0xd46e('0xa'),attributes,{'tableName':_0xd46e('0xb'),'paranoid':![],'indexes':[{'fields':[_0xd46e('0xc'),_0xd46e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 297f91f..9983a95 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 _0x4d7d=['http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','message','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','stringify','where','limit','UpdateVoiceAgentReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x4d7d,0x1e5));var _0xd4d7=function(_0x2e249d,_0x41b7e7){_0x2e249d=_0x2e249d-0x0;var _0x1faa37=_0x4d7d[_0x2e249d];return _0x1faa37;};'use strict';var _=require(_0xd4d7('0x0'));var util=require(_0xd4d7('0x1'));var moment=require(_0xd4d7('0x2'));var BPromise=require('bluebird');var rs=require(_0xd4d7('0x3'));var fs=require('fs');var Redis=require(_0xd4d7('0x4'));var db=require(_0xd4d7('0x5'))['db'];var utils=require(_0xd4d7('0x6'));var logger=require('../../config/logger')(_0xd4d7('0x7'));var config=require(_0xd4d7('0x8'));var jayson=require(_0xd4d7('0x9'));var client=jayson[_0xd4d7('0xa')][_0xd4d7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2dc606,_0x18a44e,_0x56d585){return new BPromise(function(_0x579b54,_0x725be5){return client[_0xd4d7('0xc')](_0x2dc606,_0x56d585)[_0xd4d7('0xd')](function(_0x3dd5fe){logger[_0xd4d7('0xe')](_0xd4d7('0xf'),_0x18a44e,_0xd4d7('0x10'));logger[_0xd4d7('0x11')](_0xd4d7('0x12'),_0x18a44e,_0xd4d7('0x10'),JSON['stringify'](_0x3dd5fe));if(_0x3dd5fe[_0xd4d7('0x13')]){if(_0x3dd5fe[_0xd4d7('0x13')]['code']===0x1f4){logger['error'](_0xd4d7('0xf'),_0x18a44e,_0x3dd5fe[_0xd4d7('0x13')]['message']);return _0x725be5(_0x3dd5fe[_0xd4d7('0x13')][_0xd4d7('0x14')]);}logger[_0xd4d7('0x13')](_0xd4d7('0xf'),_0x18a44e,_0x3dd5fe[_0xd4d7('0x13')][_0xd4d7('0x14')]);return _0x579b54(_0x3dd5fe['error']['message']);}else{logger[_0xd4d7('0xe')](_0xd4d7('0xf'),_0x18a44e,_0xd4d7('0x10'));_0x579b54(_0x3dd5fe['result'][_0xd4d7('0x14')]);}})[_0xd4d7('0x15')](function(_0x4732a6){logger[_0xd4d7('0x13')](_0xd4d7('0xf'),_0x18a44e,_0x4732a6);_0x725be5(_0x4732a6);});});}exports[_0xd4d7('0x16')]=function(_0x1c37ae){var _0x4b7b1d=this;return new Promise(function(_0x19c944,_0x5bc501){return db[_0xd4d7('0x17')][_0xd4d7('0x18')](_0x1c37ae[_0xd4d7('0x19')],{'raw':_0x1c37ae[_0xd4d7('0x1a')]?_0x1c37ae['options']['raw']===undefined?!![]:![]:!![]})[_0xd4d7('0xd')](function(_0x4506a3){logger['info'](_0xd4d7('0x16'),_0x1c37ae);logger[_0xd4d7('0x11')](_0xd4d7('0x16'),_0x1c37ae,JSON[_0xd4d7('0x1b')](_0x4506a3));_0x19c944(_0x4506a3);})[_0xd4d7('0x15')](function(_0x9e93af){logger[_0xd4d7('0x13')](_0xd4d7('0x16'),_0x9e93af[_0xd4d7('0x14')],_0x1c37ae);_0x5bc501(_0x4b7b1d[_0xd4d7('0x13')](0x1f4,_0x9e93af[_0xd4d7('0x14')]));});});};exports['UpdateVoiceAgentReport']=function(_0x55c2fb){var _0x4acbb3=this;return new Promise(function(_0x444c41,_0x264d64){return db['VoiceAgentReport']['update'](_0x55c2fb[_0xd4d7('0x19')],{'raw':_0x55c2fb[_0xd4d7('0x1a')]?_0x55c2fb[_0xd4d7('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x55c2fb[_0xd4d7('0x1a')]?_0x55c2fb[_0xd4d7('0x1a')][_0xd4d7('0x1c')]||null:null,'attributes':_0x55c2fb['options']?_0x55c2fb[_0xd4d7('0x1a')]['attributes']||null:null,'limit':_0x55c2fb[_0xd4d7('0x1a')]?_0x55c2fb[_0xd4d7('0x1a')][_0xd4d7('0x1d')]||null:null})[_0xd4d7('0xd')](function(_0x3df020){logger[_0xd4d7('0xe')](_0xd4d7('0x1e'),_0x55c2fb);logger[_0xd4d7('0x11')](_0xd4d7('0x1e'),_0x55c2fb,JSON[_0xd4d7('0x1b')](_0x3df020));_0x444c41(_0x3df020);})[_0xd4d7('0x15')](function(_0x3e6f1e){logger['error'](_0xd4d7('0x1e'),_0x3e6f1e[_0xd4d7('0x14')],_0x55c2fb);_0x264d64(_0x4acbb3[_0xd4d7('0x13')](0x1f4,_0x3e6f1e[_0xd4d7('0x14')]));});});}; \ No newline at end of file +var _0x6645=['client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','update','where','stringify','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x261631,_0x4749d8){var _0x4067ad=function(_0x5a3d6c){while(--_0x5a3d6c){_0x261631['push'](_0x261631['shift']());}};_0x4067ad(++_0x4749d8);}(_0x6645,0xe0));var _0x5664=function(_0x5835df,_0x4a82af){_0x5835df=_0x5835df-0x0;var _0xa0b1d6=_0x6645[_0x5835df];return _0xa0b1d6;};'use strict';var _=require(_0x5664('0x0'));var util=require(_0x5664('0x1'));var moment=require(_0x5664('0x2'));var BPromise=require('bluebird');var rs=require(_0x5664('0x3'));var fs=require('fs');var Redis=require(_0x5664('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5664('0x5'));var logger=require(_0x5664('0x6'))(_0x5664('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5664('0x8')][_0x5664('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d3163,_0x12b7e1,_0x5bf0e5){return new BPromise(function(_0x9e7a4b,_0x2d8dec){return client[_0x5664('0xa')](_0x4d3163,_0x5bf0e5)[_0x5664('0xb')](function(_0x4a0562){logger[_0x5664('0xc')](_0x5664('0xd'),_0x12b7e1,_0x5664('0xe'));logger['debug'](_0x5664('0xf'),_0x12b7e1,'request\x20sent',JSON['stringify'](_0x4a0562));if(_0x4a0562[_0x5664('0x10')]){if(_0x4a0562[_0x5664('0x10')][_0x5664('0x11')]===0x1f4){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x12b7e1,_0x4a0562[_0x5664('0x10')][_0x5664('0x12')]);return _0x2d8dec(_0x4a0562['error'][_0x5664('0x12')]);}logger[_0x5664('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x12b7e1,_0x4a0562[_0x5664('0x10')][_0x5664('0x12')]);return _0x9e7a4b(_0x4a0562[_0x5664('0x10')][_0x5664('0x12')]);}else{logger[_0x5664('0xc')](_0x5664('0xd'),_0x12b7e1,_0x5664('0xe'));_0x9e7a4b(_0x4a0562['result'][_0x5664('0x12')]);}})[_0x5664('0x13')](function(_0x2289c8){logger[_0x5664('0x10')](_0x5664('0xd'),_0x12b7e1,_0x2289c8);_0x2d8dec(_0x2289c8);});});}exports[_0x5664('0x14')]=function(_0x444b1b){var _0x168b23=this;return new Promise(function(_0x1eabcd,_0x232718){return db[_0x5664('0x15')]['create'](_0x444b1b[_0x5664('0x16')],{'raw':_0x444b1b['options']?_0x444b1b[_0x5664('0x17')][_0x5664('0x18')]===undefined?!![]:![]:!![]})[_0x5664('0xb')](function(_0xc4b8c0){logger[_0x5664('0xc')]('CreateVoiceAgentReport',_0x444b1b);logger['debug']('CreateVoiceAgentReport',_0x444b1b,JSON['stringify'](_0xc4b8c0));_0x1eabcd(_0xc4b8c0);})[_0x5664('0x13')](function(_0x3640d9){logger[_0x5664('0x10')](_0x5664('0x14'),_0x3640d9[_0x5664('0x12')],_0x444b1b);_0x232718(_0x168b23['error'](0x1f4,_0x3640d9[_0x5664('0x12')]));});});};exports[_0x5664('0x19')]=function(_0x5d6eaf){var _0x5a382a=this;return new Promise(function(_0x5b44b0,_0x3e3b00){return db[_0x5664('0x15')][_0x5664('0x1a')](_0x5d6eaf['body'],{'raw':_0x5d6eaf[_0x5664('0x17')]?_0x5d6eaf[_0x5664('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d6eaf[_0x5664('0x17')]?_0x5d6eaf[_0x5664('0x17')][_0x5664('0x1b')]||null:null,'attributes':_0x5d6eaf['options']?_0x5d6eaf[_0x5664('0x17')]['attributes']||null:null,'limit':_0x5d6eaf[_0x5664('0x17')]?_0x5d6eaf[_0x5664('0x17')]['limit']||null:null})[_0x5664('0xb')](function(_0x300b1d){logger[_0x5664('0xc')](_0x5664('0x19'),_0x5d6eaf);logger['debug'](_0x5664('0x19'),_0x5d6eaf,JSON[_0x5664('0x1c')](_0x300b1d));_0x5b44b0(_0x300b1d);})['catch'](function(_0x39e7f3){logger[_0x5664('0x10')](_0x5664('0x19'),_0x39e7f3['message'],_0x5d6eaf);_0x3e3b00(_0x5a382a[_0x5664('0x10')](0x1f4,_0x39e7f3[_0x5664('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 0a13f05..2c6b60b 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 _0x50a6=['create','/:id','update','destroy','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','index','get','/describe','isAuthenticated','show'];(function(_0x3c8887,_0x221819){var _0x1bea4a=function(_0x746b6b){while(--_0x746b6b){_0x3c8887['push'](_0x3c8887['shift']());}};_0x1bea4a(++_0x221819);}(_0x50a6,0xa4));var _0x650a=function(_0x416d75,_0x2c8e81){_0x416d75=_0x416d75-0x0;var _0x10af66=_0x50a6[_0x416d75];return _0x10af66;};'use strict';var multer=require(_0x650a('0x0'));var util=require(_0x650a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x650a('0x2'));var router=express['Router']();var fs_extra=require(_0x650a('0x3'));var auth=require(_0x650a('0x4'));var interaction=require(_0x650a('0x5'));var config=require('../../config/environment');var controller=require(_0x650a('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x650a('0x7')]);router[_0x650a('0x8')](_0x650a('0x9'),auth[_0x650a('0xa')](),controller['describe']);router[_0x650a('0x8')]('/:id',auth[_0x650a('0xa')](),controller[_0x650a('0xb')]);router['post']('/',auth[_0x650a('0xa')](),controller[_0x650a('0xc')]);router['put'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xe')]);router['delete'](_0x650a('0xd'),auth['isAuthenticated'](),controller[_0x650a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9b67=['../../components/auth/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','destroy','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x36184b,_0x58bc1c){var _0x2d7246=function(_0x5557a2){while(--_0x5557a2){_0x36184b['push'](_0x36184b['shift']());}};_0x2d7246(++_0x58bc1c);}(_0x9b67,0xf6));var _0x79b6=function(_0x54f22a,_0x100ac9){_0x54f22a=_0x54f22a-0x0;var _0x5503bd=_0x9b67[_0x54f22a];return _0x5503bd;};'use strict';var multer=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var path=require(_0x79b6('0x2'));var timeout=require(_0x79b6('0x3'));var express=require(_0x79b6('0x4'));var router=express['Router']();var fs_extra=require(_0x79b6('0x5'));var auth=require(_0x79b6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x79b6('0x7'));router[_0x79b6('0x8')]('/',auth[_0x79b6('0x9')](),controller[_0x79b6('0xa')]);router[_0x79b6('0x8')](_0x79b6('0xb'),auth[_0x79b6('0x9')](),controller['describe']);router[_0x79b6('0x8')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0xd')]);router[_0x79b6('0xe')]('/',auth['isAuthenticated'](),controller[_0x79b6('0xf')]);router[_0x79b6('0x10')](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller['update']);router['delete'](_0x79b6('0xc'),auth[_0x79b6('0x9')](),controller[_0x79b6('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index caa8b90..de9e904 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 _0xca91=['STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize','exports'];(function(_0x3923d4,_0x41d061){var _0x3179ed=function(_0x34a0c1){while(--_0x34a0c1){_0x3923d4['push'](_0x3923d4['shift']());}};_0x3179ed(++_0x41d061);}(_0xca91,0x1d2));var _0x1ca9=function(_0x5f25b3,_0x35481a){_0x5f25b3=_0x5f25b3-0x0;var _0x4ab9bf=_0xca91[_0x5f25b3];return _0x4ab9bf;};'use strict';var Sequelize=require(_0x1ca9('0x0'));module[_0x1ca9('0x1')]={'uniqueid':{'type':Sequelize[_0x1ca9('0x2')]},'type':{'type':Sequelize[_0x1ca9('0x3')](_0x1ca9('0x4'),_0x1ca9('0x5'),_0x1ca9('0x6'),_0x1ca9('0x7'),_0x1ca9('0x8'),_0x1ca9('0x9'))},'tag':{'type':Sequelize[_0x1ca9('0x2')]},'accountcode':{'type':Sequelize[_0x1ca9('0x2')]},'source':{'type':Sequelize[_0x1ca9('0x2')]},'destination':{'type':Sequelize[_0x1ca9('0x2')]},'destinationcontext':{'type':Sequelize[_0x1ca9('0x2')]},'callerid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x1ca9('0x2')]},'destinationchannel':{'type':Sequelize[_0x1ca9('0x2')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x1ca9('0xa')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x1ca9('0xb')]},'answertime':{'type':Sequelize[_0x1ca9('0xb')]},'endtime':{'type':Sequelize[_0x1ca9('0xb')]},'duration':{'type':Sequelize[_0x1ca9('0xc')]},'billableseconds':{'type':Sequelize[_0x1ca9('0xc')]},'mohtime':{'type':Sequelize[_0x1ca9('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x1ca9('0x2')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x1ca9('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x1ca9('0x2')]},'note':{'type':Sequelize[_0x1ca9('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x1ca9('0xc')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe59f=['TEXT','DATE','INTEGER','sequelize','exports','STRING','ENUM','internal','outbound'];(function(_0x515a35,_0x4f9db5){var _0x895530=function(_0x46c590){while(--_0x46c590){_0x515a35['push'](_0x515a35['shift']());}};_0x895530(++_0x4f9db5);}(_0xe59f,0x1c5));var _0xfe59=function(_0x55cc83,_0x492a0b){_0x55cc83=_0x55cc83-0x0;var _0x39880e=_0xe59f[_0x55cc83];return _0x39880e;};'use strict';var Sequelize=require(_0xfe59('0x0'));module[_0xfe59('0x1')]={'uniqueid':{'type':Sequelize[_0xfe59('0x2')]},'type':{'type':Sequelize[_0xfe59('0x3')]('inbound',_0xfe59('0x4'),_0xfe59('0x5'),'inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0xfe59('0x2')]},'accountcode':{'type':Sequelize[_0xfe59('0x2')]},'source':{'type':Sequelize[_0xfe59('0x2')]},'destination':{'type':Sequelize[_0xfe59('0x2')]},'destinationcontext':{'type':Sequelize[_0xfe59('0x2')]},'callerid':{'type':Sequelize[_0xfe59('0x2')]},'channel':{'type':Sequelize[_0xfe59('0x2')]},'destinationchannel':{'type':Sequelize[_0xfe59('0x2')]},'lastapplication':{'type':Sequelize[_0xfe59('0x2')]},'lastdata':{'type':Sequelize[_0xfe59('0x6')]},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfe59('0x7')]},'endtime':{'type':Sequelize['DATE']},'duration':{'type':Sequelize[_0xfe59('0x8')]},'billableseconds':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0xfe59('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xfe59('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xfe59('0x2')]},'userDisposition':{'type':Sequelize[_0xfe59('0x2')]},'userSecondDisposition':{'type':Sequelize[_0xfe59('0x2')]},'userThirdDisposition':{'type':Sequelize[_0xfe59('0x2')]},'note':{'type':Sequelize[_0xfe59('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xfe59('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index f11d9ae..9e020c8 100644 --- a/server/api/voiceCallReport/voiceCallReport.controller.js +++ b/server/api/voiceCallReport/voiceCallReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['stack','name','send','index','VoiceCallReport','rawAttributes','fieldName','type','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','options','includeAll','include','fullname','alias','User','findAll','catch','params','keys','find','create','body','destroy','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then'];(function(_0x581af1,_0x4f02c5){var _0x54c22e=function(_0x5a7a5a){while(--_0x5a7a5a){_0x581af1['push'](_0x581af1['shift']());}};_0x54c22e(++_0x4f02c5);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbb7587,_0x4288a1){_0xbb7587=_0xbb7587-0x0;var _0x467c1b=_0x5f2f[_0xbb7587];return _0x467c1b;};'use strict';var emlformat=require(_0xf5f2('0x0'));var rimraf=require(_0xf5f2('0x1'));var zipdir=require(_0xf5f2('0x2'));var jsonpatch=require(_0xf5f2('0x3'));var rp=require(_0xf5f2('0x4'));var moment=require(_0xf5f2('0x5'));var BPromise=require(_0xf5f2('0x6'));var Mustache=require(_0xf5f2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xf5f2('0x8'));var csv=require(_0xf5f2('0x9'));var ejs=require(_0xf5f2('0xa'));var fs=require('fs');var fs_extra=require(_0xf5f2('0xb'));var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf5f2('0x16'));var db=require(_0xf5f2('0x17'))['db'];function respondWithStatusCode(_0x331482,_0x3f2997){_0x3f2997=_0x3f2997||0xcc;return function(_0x59bb6c){if(_0x59bb6c){return _0x331482[_0xf5f2('0x18')](_0x3f2997);}return _0x331482['status'](_0x3f2997)[_0xf5f2('0x19')]();};}function respondWithResult(_0xea612c,_0x269909){_0x269909=_0x269909||0xc8;return function(_0x1c1a5c){if(_0x1c1a5c){return _0xea612c[_0xf5f2('0x1a')](_0x269909)['json'](_0x1c1a5c);}};}function respondWithFilteredResult(_0xafe430,_0x286197){return function(_0x17d656){if(_0x17d656){var _0x1b6dd2=typeof _0x286197[_0xf5f2('0x1b')]===_0xf5f2('0x1c')&&typeof _0x286197[_0xf5f2('0x1d')]===_0xf5f2('0x1c');var _0x11f702=_0x17d656[_0xf5f2('0x1e')];var _0x20fccd=_0x1b6dd2?0x0:_0x286197[_0xf5f2('0x1b')];var _0x4ff59b=_0x1b6dd2?_0x17d656[_0xf5f2('0x1e')]:_0x286197[_0xf5f2('0x1b')]+_0x286197[_0xf5f2('0x1d')];var _0x1bf655;if(_0x4ff59b>=_0x11f702){_0x4ff59b=_0x11f702;_0x1bf655=0xc8;}else{_0x1bf655=0xce;}_0xafe430['status'](_0x1bf655);return _0xafe430[_0xf5f2('0x1f')](_0xf5f2('0x20'),_0x20fccd+'-'+_0x4ff59b+'/'+_0x11f702)['json'](_0x17d656);}return null;};}function patchUpdates(_0x47acfc){return function(_0x2d2805){try{jsonpatch[_0xf5f2('0x21')](_0x2d2805,_0x47acfc,!![]);}catch(_0x4ae323){return BPromise[_0xf5f2('0x22')](_0x4ae323);}return _0x2d2805[_0xf5f2('0x23')]();};}function saveUpdates(_0x39e44a,_0x39c024){return function(_0x36f1cb){if(_0x36f1cb){return _0x36f1cb['update'](_0x39e44a)[_0xf5f2('0x24')](function(_0x4669a6){return _0x4669a6;});}return null;};}function removeEntity(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(_0x287ad5){return _0x287ad5['destroy']()['then'](function(){_0x4e8bda[_0xf5f2('0x1a')](0xcc)[_0xf5f2('0x19')]();});}};}function handleEntityNotFound(_0x13da6f,_0x1a5bb3){return function(_0xf6c58d){if(!_0xf6c58d){_0x13da6f[_0xf5f2('0x18')](0x194);}return _0xf6c58d;};}function handleError(_0x13a3be,_0x281ec8){_0x281ec8=_0x281ec8||0x1f4;return function(_0x294414){logger['error'](_0x294414[_0xf5f2('0x25')]);if(_0x294414[_0xf5f2('0x26')]){delete _0x294414[_0xf5f2('0x26')];}_0x13a3be[_0xf5f2('0x1a')](_0x281ec8)[_0xf5f2('0x27')](_0x294414);};}exports[_0xf5f2('0x28')]=function(_0x5b6672,_0x53cb96){var _0x22c826={},_0x14c829={},_0x11c771={'count':0x0,'rows':[]};var _0x5027ab=_['map'](db[_0xf5f2('0x29')][_0xf5f2('0x2a')],function(_0x17394a){return{'name':_0x17394a[_0xf5f2('0x2b')],'type':_0x17394a[_0xf5f2('0x2c')]['key']};});_0x14c829['model']=_[_0xf5f2('0x2d')](_0x5027ab,'name');_0x14c829[_0xf5f2('0x2e')]=_['keys'](_0x5b6672[_0xf5f2('0x2e')]);_0x14c829[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],_0x14c829[_0xf5f2('0x2e')]);_0x22c826[_0xf5f2('0x32')]=_[_0xf5f2('0x30')](_0x14c829[_0xf5f2('0x31')],qs['fields'](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x22c826[_0xf5f2('0x32')]=_0x22c826[_0xf5f2('0x32')][_0xf5f2('0x34')]?_0x22c826[_0xf5f2('0x32')]:_0x14c829[_0xf5f2('0x31')];if(!_0x5b6672['query'][_0xf5f2('0x35')](_0xf5f2('0x36'))){_0x22c826['limit']=qs[_0xf5f2('0x1d')](_0x5b6672['query'][_0xf5f2('0x1d')]);_0x22c826[_0xf5f2('0x1b')]=qs[_0xf5f2('0x1b')](_0x5b6672[_0xf5f2('0x2e')]['offset']);}_0x22c826['order']=qs[_0xf5f2('0x37')](_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x37')]);_0x22c826['where']=qs[_0xf5f2('0x2f')](_['pick'](_0x5b6672[_0xf5f2('0x2e')],_0x14c829['filters']),_0x5027ab);if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]){_0x22c826['where']=_[_0xf5f2('0x39')](_0x22c826[_0xf5f2('0x3a')],{'$or':_[_0xf5f2('0x2d')](_0x5027ab,function(_0x35f738){if(_0x35f738['type']!=='VIRTUAL'){var _0x3d328f={};_0x3d328f[_0x35f738[_0xf5f2('0x26')]]={'$like':'%'+_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x38')]+'%'};return _0x3d328f;}})});}_0x22c826=_[_0xf5f2('0x39')]({},_0x22c826,_0x5b6672[_0xf5f2('0x3b')]);var _0x2bc20e={'where':_0x22c826['where']};return db[_0xf5f2('0x29')][_0xf5f2('0x1e')](_0x2bc20e)['then'](function(_0xc6a1ae){_0x11c771[_0xf5f2('0x1e')]=_0xc6a1ae;if(_0x5b6672[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x22c826[_0xf5f2('0x3d')]=[{'attributes':['id',_0xf5f2('0x26'),_0xf5f2('0x3e'),_0xf5f2('0x3f')],'model':db['User'],'as':_0xf5f2('0x40')}];}return db[_0xf5f2('0x29')][_0xf5f2('0x41')](_0x22c826);})['then'](function(_0x509dbc){_0x11c771['rows']=_0x509dbc;return _0x11c771;})[_0xf5f2('0x24')](respondWithFilteredResult(_0x53cb96,_0x22c826))[_0xf5f2('0x42')](handleError(_0x53cb96,null));};exports['show']=function(_0x106272,_0xeed03d){var _0x28e33f={'raw':!![],'where':{'id':_0x106272[_0xf5f2('0x43')]['id']}},_0x31f86c={};_0x31f86c[_0xf5f2('0x31')]=_[_0xf5f2('0x44')](db[_0xf5f2('0x29')][_0xf5f2('0x2a')]);_0x31f86c[_0xf5f2('0x2e')]=_[_0xf5f2('0x44')](_0x106272[_0xf5f2('0x2e')]);_0x31f86c[_0xf5f2('0x2f')]=_[_0xf5f2('0x30')](_0x31f86c['model'],_0x31f86c[_0xf5f2('0x2e')]);_0x28e33f['attributes']=_[_0xf5f2('0x30')](_0x31f86c[_0xf5f2('0x31')],qs[_0xf5f2('0x33')](_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x33')]));_0x28e33f[_0xf5f2('0x32')]=_0x28e33f['attributes'][_0xf5f2('0x34')]?_0x28e33f[_0xf5f2('0x32')]:_0x31f86c[_0xf5f2('0x31')];if(_0x106272[_0xf5f2('0x2e')][_0xf5f2('0x3c')]){_0x28e33f[_0xf5f2('0x3d')]=[{'all':!![]}];}_0x28e33f=_[_0xf5f2('0x39')]({},_0x28e33f,_0x106272[_0xf5f2('0x3b')]);return db['VoiceCallReport'][_0xf5f2('0x45')](_0x28e33f)[_0xf5f2('0x24')](handleEntityNotFound(_0xeed03d,null))[_0xf5f2('0x24')](respondWithResult(_0xeed03d,null))['catch'](handleError(_0xeed03d,null));};exports[_0xf5f2('0x46')]=function(_0xc91b64,_0x3179a9){return db['VoiceCallReport']['create'](_0xc91b64[_0xf5f2('0x47')],{})[_0xf5f2('0x24')](respondWithResult(_0x3179a9,0xc9))['catch'](handleError(_0x3179a9,null));};exports[_0xf5f2('0x48')]=function(_0x533cca,_0x740321){return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'id':_0x533cca['params']['id']}})[_0xf5f2('0x24')](handleEntityNotFound(_0x740321,null))[_0xf5f2('0x24')](removeEntity(_0x740321,null))[_0xf5f2('0x42')](handleError(_0x740321,null));};exports[_0xf5f2('0x49')]=function(_0x4fa738,_0x3154c1){return db[_0xf5f2('0x29')]['describe']()['then'](respondWithResult(_0x3154c1,null))[_0xf5f2('0x42')](handleError(_0x3154c1,null));};exports[_0xf5f2('0x4a')]=function(_0x57782c,_0x22b645){if(_0x57782c[_0xf5f2('0x47')][_0xf5f2('0x4b')]){delete _0x57782c[_0xf5f2('0x47')]['uniqueid'];}return db['VoiceCallReport'][_0xf5f2('0x45')]({'where':{'uniqueid':_0x57782c[_0xf5f2('0x43')]['id'],'UserId':{'$or':[null,_0x57782c['user']['id']]}}})[_0xf5f2('0x24')](handleEntityNotFound(_0x22b645,null))[_0xf5f2('0x24')](saveUpdates(_0x57782c[_0xf5f2('0x47')],null))[_0xf5f2('0x24')](respondWithResult(_0x22b645,null))[_0xf5f2('0x42')](handleError(_0x22b645,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','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','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0xadb5,0xad));var _0x5adb=function(_0x993451,_0x1c5da8){_0x993451=_0x993451-0x0;var _0x5df1cf=_0xadb5[_0x993451];return _0x5df1cf;};'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['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index ec42302..8e1d698 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 _0xcbe0=['rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api'];(function(_0x177ed8,_0x16a86e){var _0x5ddc22=function(_0x518fc9){while(--_0x518fc9){_0x177ed8['push'](_0x177ed8['shift']());}};_0x5ddc22(++_0x16a86e);}(_0xcbe0,0x13c));var _0x0cbe=function(_0x4cc492,_0x162c85){_0x4cc492=_0x4cc492-0x0;var _0x1f36b9=_0xcbe0[_0x4cc492];return _0x1f36b9;};'use strict';var _=require(_0x0cbe('0x0'));var util=require('util');var logger=require(_0x0cbe('0x1'))(_0x0cbe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0cbe('0x3'));var config=require(_0x0cbe('0x4'));var attributes=require(_0x0cbe('0x5'));module[_0x0cbe('0x6')]=function(_0x5eec2e,_0x53da82){return _0x5eec2e[_0x0cbe('0x7')](_0x0cbe('0x8'),attributes,{'tableName':_0x0cbe('0x9'),'paranoid':![],'indexes':[{'fields':[_0x0cbe('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d23=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport'];(function(_0x217154,_0x2c85a9){var _0x4a0702=function(_0x42a05c){while(--_0x42a05c){_0x217154['push'](_0x217154['shift']());}};_0x4a0702(++_0x2c85a9);}(_0x4d23,0x12c));var _0x34d2=function(_0x1182b2,_0x51f6bb){_0x1182b2=_0x1182b2-0x0;var _0x4364dc=_0x4d23[_0x1182b2];return _0x4364dc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x34d2('0x0'))(_0x34d2('0x1'));var moment=require(_0x34d2('0x2'));var BPromise=require(_0x34d2('0x3'));var rp=require(_0x34d2('0x4'));var fs=require('fs');var path=require(_0x34d2('0x5'));var rimraf=require(_0x34d2('0x6'));var config=require(_0x34d2('0x7'));var attributes=require(_0x34d2('0x8'));module[_0x34d2('0x9')]=function(_0x401beb,_0x56cf21){return _0x401beb[_0x34d2('0xa')](_0x34d2('0xb'),attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index ae99df1..03b4e67 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 _0x72bf=['body','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceCallReport','findAll','options','raw','where','attributes','include','map','model','debug','CreateVoiceCallReport','VoiceCallReport','create','catch','UpdateVoiceCallReport','update'];(function(_0x3f8282,_0x11b607){var _0x50f918=function(_0x3a37de){while(--_0x3a37de){_0x3f8282['push'](_0x3f8282['shift']());}};_0x50f918(++_0x11b607);}(_0x72bf,0x1bd));var _0xf72b=function(_0x3f3ac8,_0x30592a){_0x3f3ac8=_0x3f3ac8-0x0;var _0x59f8f2=_0x72bf[_0x3f3ac8];return _0x59f8f2;};'use strict';var _=require(_0xf72b('0x0'));var util=require('util');var moment=require(_0xf72b('0x1'));var BPromise=require(_0xf72b('0x2'));var rs=require(_0xf72b('0x3'));var fs=require('fs');var Redis=require(_0xf72b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf72b('0x5'));var logger=require(_0xf72b('0x6'))('rpc');var config=require(_0xf72b('0x7'));var jayson=require(_0xf72b('0x8'));var client=jayson[_0xf72b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x447012,_0x347da3,_0x2f5abc){return new BPromise(function(_0x1d8362,_0x39661c){return client[_0xf72b('0xa')](_0x447012,_0x2f5abc)[_0xf72b('0xb')](function(_0x3e55a9){logger[_0xf72b('0xc')](_0xf72b('0xd'),_0x347da3,_0xf72b('0xe'));logger['debug'](_0xf72b('0xf'),_0x347da3,_0xf72b('0xe'),JSON[_0xf72b('0x10')](_0x3e55a9));if(_0x3e55a9[_0xf72b('0x11')]){if(_0x3e55a9[_0xf72b('0x11')][_0xf72b('0x12')]===0x1f4){logger[_0xf72b('0x11')](_0xf72b('0xd'),_0x347da3,_0x3e55a9[_0xf72b('0x11')][_0xf72b('0x13')]);return _0x39661c(_0x3e55a9[_0xf72b('0x11')][_0xf72b('0x13')]);}logger[_0xf72b('0x11')](_0xf72b('0xd'),_0x347da3,_0x3e55a9[_0xf72b('0x11')][_0xf72b('0x13')]);return _0x1d8362(_0x3e55a9[_0xf72b('0x11')][_0xf72b('0x13')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x347da3,_0xf72b('0xe'));_0x1d8362(_0x3e55a9['result'][_0xf72b('0x13')]);}})['catch'](function(_0x5a4acf){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x347da3,_0x5a4acf);_0x39661c(_0x5a4acf);});});}exports[_0xf72b('0x14')]=function(_0x51de01){var _0x543a99=this;return new Promise(function(_0x4703db,_0x296899){return db['VoiceCallReport'][_0xf72b('0x15')]({'raw':_0x51de01[_0xf72b('0x16')]?_0x51de01[_0xf72b('0x16')][_0xf72b('0x17')]===undefined?!![]:![]:!![],'where':_0x51de01[_0xf72b('0x16')]?_0x51de01[_0xf72b('0x16')][_0xf72b('0x18')]||null:null,'attributes':_0x51de01[_0xf72b('0x16')]?_0x51de01[_0xf72b('0x16')][_0xf72b('0x19')]||null:null,'limit':_0x51de01[_0xf72b('0x16')]?_0x51de01[_0xf72b('0x16')]['limit']||null:null,'include':_0x51de01[_0xf72b('0x16')]?_0x51de01['options'][_0xf72b('0x1a')]?_[_0xf72b('0x1b')](_0x51de01[_0xf72b('0x16')][_0xf72b('0x1a')],function(_0x5d9c25){return{'model':db[_0x5d9c25['model']],'as':_0x5d9c25['as'],'attributes':_0x5d9c25[_0xf72b('0x19')],'include':_0x5d9c25[_0xf72b('0x1a')]?_[_0xf72b('0x1b')](_0x5d9c25['include'],function(_0x289de6){return{'model':db[_0x289de6[_0xf72b('0x1c')]],'as':_0x289de6['as'],'attributes':_0x289de6[_0xf72b('0x19')],'include':_0x289de6[_0xf72b('0x1a')]?_[_0xf72b('0x1b')](_0x289de6[_0xf72b('0x1a')],function(_0x23fdbf){return{'model':db[_0x23fdbf['model']],'as':_0x23fdbf['as'],'attributes':_0x23fdbf[_0xf72b('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf72b('0xb')](function(_0x21628a){logger[_0xf72b('0xc')]('GetVoiceCallReport',_0x51de01);logger[_0xf72b('0x1d')](_0xf72b('0x14'),_0x51de01,JSON[_0xf72b('0x10')](_0x21628a));_0x4703db(_0x21628a);})['catch'](function(_0xeb8bb6){logger[_0xf72b('0x11')]('GetVoiceCallReport',_0xeb8bb6['message'],_0x51de01);_0x296899(_0x543a99[_0xf72b('0x11')](0x1f4,_0xeb8bb6[_0xf72b('0x13')]));});});};exports[_0xf72b('0x1e')]=function(_0x21f277){var _0x5abda1=this;return new Promise(function(_0x15f704,_0x321480){return db[_0xf72b('0x1f')][_0xf72b('0x20')](_0x21f277['body'],{'raw':_0x21f277[_0xf72b('0x16')]?_0x21f277['options'][_0xf72b('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5d6e8e){logger[_0xf72b('0xc')](_0xf72b('0x1e'),_0x21f277);logger[_0xf72b('0x1d')]('CreateVoiceCallReport',_0x21f277,JSON[_0xf72b('0x10')](_0x5d6e8e));_0x15f704(_0x5d6e8e);})[_0xf72b('0x21')](function(_0x30f340){logger[_0xf72b('0x11')]('CreateVoiceCallReport',_0x30f340['message'],_0x21f277);_0x321480(_0x5abda1[_0xf72b('0x11')](0x1f4,_0x30f340[_0xf72b('0x13')]));});});};exports[_0xf72b('0x22')]=function(_0x2609bc){var _0x2af704=this;return new Promise(function(_0x50983b,_0x27dfc5){return db[_0xf72b('0x1f')][_0xf72b('0x23')](_0x2609bc[_0xf72b('0x24')],{'raw':_0x2609bc[_0xf72b('0x16')]?_0x2609bc[_0xf72b('0x16')][_0xf72b('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2609bc[_0xf72b('0x16')]?_0x2609bc['options'][_0xf72b('0x18')]||null:null,'attributes':_0x2609bc['options']?_0x2609bc[_0xf72b('0x16')][_0xf72b('0x19')]||null:null,'limit':_0x2609bc['options']?_0x2609bc['options']['limit']||null:null})[_0xf72b('0xb')](function(_0x3066a8){logger[_0xf72b('0xc')](_0xf72b('0x22'),_0x2609bc);logger[_0xf72b('0x1d')]('UpdateVoiceCallReport',_0x2609bc,JSON[_0xf72b('0x10')](_0x3066a8));_0x50983b(_0x3066a8);})[_0xf72b('0x21')](function(_0x334cf2){logger['error'](_0xf72b('0x22'),_0x334cf2[_0xf72b('0x13')],_0x2609bc);_0x27dfc5(_0x2af704['error'](0x1f4,_0x334cf2[_0xf72b('0x13')]));});});}; \ No newline at end of file +var _0xd0a8=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','VoiceCallReport,\x20%s,\x20%s','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetVoiceCallReport','findAll','options','raw','attributes','include','model','map','CreateVoiceCallReport','VoiceCallReport','body','UpdateVoiceCallReport','where','limit','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x437f5a,_0x21a929){var _0x1d6636=function(_0x4e48ca){while(--_0x4e48ca){_0x437f5a['push'](_0x437f5a['shift']());}};_0x1d6636(++_0x21a929);}(_0xd0a8,0x148));var _0x8d0a=function(_0x422654,_0x44cfd4){_0x422654=_0x422654-0x0;var _0x466d2d=_0xd0a8[_0x422654];return _0x466d2d;};'use strict';var _=require('lodash');var util=require(_0x8d0a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8d0a('0x1'));var fs=require('fs');var Redis=require(_0x8d0a('0x2'));var db=require(_0x8d0a('0x3'))['db'];var utils=require(_0x8d0a('0x4'));var logger=require(_0x8d0a('0x5'))(_0x8d0a('0x6'));var config=require(_0x8d0a('0x7'));var jayson=require(_0x8d0a('0x8'));var client=jayson[_0x8d0a('0x9')][_0x8d0a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57dda8,_0x4a635e,_0x45ee64){return new BPromise(function(_0x10d9c2,_0x3f19aa){return client['request'](_0x57dda8,_0x45ee64)[_0x8d0a('0xb')](function(_0x56cb7d){logger['info'](_0x8d0a('0xc'),_0x4a635e,'request\x20sent');logger[_0x8d0a('0xd')](_0x8d0a('0xe'),_0x4a635e,_0x8d0a('0xf'),JSON[_0x8d0a('0x10')](_0x56cb7d));if(_0x56cb7d['error']){if(_0x56cb7d[_0x8d0a('0x11')][_0x8d0a('0x12')]===0x1f4){logger['error'](_0x8d0a('0xc'),_0x4a635e,_0x56cb7d[_0x8d0a('0x11')][_0x8d0a('0x13')]);return _0x3f19aa(_0x56cb7d[_0x8d0a('0x11')][_0x8d0a('0x13')]);}logger[_0x8d0a('0x11')](_0x8d0a('0xc'),_0x4a635e,_0x56cb7d[_0x8d0a('0x11')][_0x8d0a('0x13')]);return _0x10d9c2(_0x56cb7d['error'][_0x8d0a('0x13')]);}else{logger[_0x8d0a('0x14')](_0x8d0a('0xc'),_0x4a635e,'request\x20sent');_0x10d9c2(_0x56cb7d[_0x8d0a('0x15')]['message']);}})[_0x8d0a('0x16')](function(_0x2b1547){logger[_0x8d0a('0x11')]('VoiceCallReport,\x20%s,\x20%s',_0x4a635e,_0x2b1547);_0x3f19aa(_0x2b1547);});});}exports[_0x8d0a('0x17')]=function(_0x376941){var _0xf9396c=this;return new Promise(function(_0x771ca4,_0x35afe5){return db['VoiceCallReport'][_0x8d0a('0x18')]({'raw':_0x376941[_0x8d0a('0x19')]?_0x376941[_0x8d0a('0x19')][_0x8d0a('0x1a')]===undefined?!![]:![]:!![],'where':_0x376941[_0x8d0a('0x19')]?_0x376941[_0x8d0a('0x19')]['where']||null:null,'attributes':_0x376941[_0x8d0a('0x19')]?_0x376941[_0x8d0a('0x19')][_0x8d0a('0x1b')]||null:null,'limit':_0x376941[_0x8d0a('0x19')]?_0x376941[_0x8d0a('0x19')]['limit']||null:null,'include':_0x376941[_0x8d0a('0x19')]?_0x376941['options'][_0x8d0a('0x1c')]?_['map'](_0x376941[_0x8d0a('0x19')][_0x8d0a('0x1c')],function(_0x432cd2){return{'model':db[_0x432cd2[_0x8d0a('0x1d')]],'as':_0x432cd2['as'],'attributes':_0x432cd2[_0x8d0a('0x1b')],'include':_0x432cd2[_0x8d0a('0x1c')]?_['map'](_0x432cd2[_0x8d0a('0x1c')],function(_0x407900){return{'model':db[_0x407900['model']],'as':_0x407900['as'],'attributes':_0x407900[_0x8d0a('0x1b')],'include':_0x407900['include']?_[_0x8d0a('0x1e')](_0x407900[_0x8d0a('0x1c')],function(_0x37a9c7){return{'model':db[_0x37a9c7['model']],'as':_0x37a9c7['as'],'attributes':_0x37a9c7['attributes']};}):[]};}):[]};}):[]:[]})[_0x8d0a('0xb')](function(_0x27f171){logger[_0x8d0a('0x14')](_0x8d0a('0x17'),_0x376941);logger['debug'](_0x8d0a('0x17'),_0x376941,JSON[_0x8d0a('0x10')](_0x27f171));_0x771ca4(_0x27f171);})[_0x8d0a('0x16')](function(_0x14a25d){logger[_0x8d0a('0x11')](_0x8d0a('0x17'),_0x14a25d['message'],_0x376941);_0x35afe5(_0xf9396c[_0x8d0a('0x11')](0x1f4,_0x14a25d['message']));});});};exports[_0x8d0a('0x1f')]=function(_0x3c9f70){var _0x7bb5a8=this;return new Promise(function(_0x5bd96d,_0x2c0f9f){return db[_0x8d0a('0x20')]['create'](_0x3c9f70[_0x8d0a('0x21')],{'raw':_0x3c9f70[_0x8d0a('0x19')]?_0x3c9f70['options'][_0x8d0a('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1969fe){logger[_0x8d0a('0x14')](_0x8d0a('0x1f'),_0x3c9f70);logger['debug'](_0x8d0a('0x1f'),_0x3c9f70,JSON[_0x8d0a('0x10')](_0x1969fe));_0x5bd96d(_0x1969fe);})[_0x8d0a('0x16')](function(_0x3b414c){logger['error']('CreateVoiceCallReport',_0x3b414c[_0x8d0a('0x13')],_0x3c9f70);_0x2c0f9f(_0x7bb5a8[_0x8d0a('0x11')](0x1f4,_0x3b414c['message']));});});};exports[_0x8d0a('0x22')]=function(_0x208969){var _0x18d781=this;return new Promise(function(_0x37ed61,_0x3584f6){return db[_0x8d0a('0x20')]['update'](_0x208969[_0x8d0a('0x21')],{'raw':_0x208969['options']?_0x208969[_0x8d0a('0x19')][_0x8d0a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x208969[_0x8d0a('0x19')]?_0x208969[_0x8d0a('0x19')][_0x8d0a('0x23')]||null:null,'attributes':_0x208969[_0x8d0a('0x19')]?_0x208969['options'][_0x8d0a('0x1b')]||null:null,'limit':_0x208969[_0x8d0a('0x19')]?_0x208969[_0x8d0a('0x19')][_0x8d0a('0x24')]||null:null})['then'](function(_0x405e95){logger[_0x8d0a('0x14')]('UpdateVoiceCallReport',_0x208969);logger[_0x8d0a('0xd')](_0x8d0a('0x22'),_0x208969,JSON[_0x8d0a('0x10')](_0x405e95));_0x37ed61(_0x405e95);})[_0x8d0a('0x16')](function(_0x4ed3df){logger['error'](_0x8d0a('0x22'),_0x4ed3df['message'],_0x208969);_0x3584f6(_0x18d781[_0x8d0a('0x11')](0x1f4,_0x4ed3df[_0x8d0a('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 4e34c3f..da89300 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 _0xb307=['path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','put','update','delete','destroy','multer','util'];(function(_0x116f6b,_0x4687ab){var _0x2bd42d=function(_0x175bc1){while(--_0x175bc1){_0x116f6b['push'](_0x116f6b['shift']());}};_0x2bd42d(++_0x4687ab);}(_0xb307,0x10e));var _0x7b30=function(_0x5e8e10,_0x5486b0){_0x5e8e10=_0x5e8e10-0x0;var _0x4ba1e0=_0xb307[_0x5e8e10];return _0x4ba1e0;};'use strict';var multer=require(_0x7b30('0x0'));var util=require(_0x7b30('0x1'));var path=require(_0x7b30('0x2'));var timeout=require('connect-timeout');var express=require(_0x7b30('0x3'));var router=express[_0x7b30('0x4')]();var fs_extra=require(_0x7b30('0x5'));var auth=require(_0x7b30('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7b30('0x7'));var controller=require(_0x7b30('0x8'));router[_0x7b30('0x9')]('/',auth[_0x7b30('0xa')](),controller[_0x7b30('0xb')]);router[_0x7b30('0x9')](_0x7b30('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7b30('0xd')]('/:id',auth[_0x7b30('0xa')](),controller[_0x7b30('0xe')]);router[_0x7b30('0xf')](_0x7b30('0xc'),auth[_0x7b30('0xa')](),controller[_0x7b30('0x10')]);module['exports']=router; \ No newline at end of file +var _0x4667=['./voiceChanSpy.controller','get','isAuthenticated','index','show','post','create','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x586436,_0x450595){var _0x5cb030=function(_0x58a0d3){while(--_0x58a0d3){_0x586436['push'](_0x586436['shift']());}};_0x5cb030(++_0x450595);}(_0x4667,0x13b));var _0x7466=function(_0x475727,_0x413c17){_0x475727=_0x475727-0x0;var _0x37903c=_0x4667[_0x475727];return _0x37903c;};'use strict';var multer=require(_0x7466('0x0'));var util=require('util');var path=require(_0x7466('0x1'));var timeout=require(_0x7466('0x2'));var express=require(_0x7466('0x3'));var router=express[_0x7466('0x4')]();var fs_extra=require(_0x7466('0x5'));var auth=require(_0x7466('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7466('0x7'));var controller=require(_0x7466('0x8'));router[_0x7466('0x9')]('/',auth[_0x7466('0xa')](),controller[_0x7466('0xb')]);router['get']('/:id',auth[_0x7466('0xa')](),controller[_0x7466('0xc')]);router[_0x7466('0xd')]('/',auth['isAuthenticated'](),controller[_0x7466('0xe')]);router['put']('/:id',auth[_0x7466('0xa')](),controller['update']);router[_0x7466('0xf')](_0x7466('0x10'),auth[_0x7466('0xa')](),controller[_0x7466('0x11')]);module[_0x7466('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index fcb9f6a..1986a1a 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 _0xd75d=['getDataValue','split','BOOLEAN','sequelize','exports','STRING','options'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd75d,0x168));var _0xdd75=function(_0x40f242,_0x59a2b3){_0x40f242=_0x40f242-0x0;var _0x12d4b8=_0xd75d[_0x40f242];return _0x12d4b8;};'use strict';var Sequelize=require(_0xdd75('0x0'));module[_0xdd75('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xdd75('0x2')],'set':function(_0x2a1455){this['setDataValue'](_0xdd75('0x3'),_0x2a1455?_0x2a1455['join'](''):[]);},'get':function(){return this[_0xdd75('0x4')](_0xdd75('0x3'))?this['getDataValue'](_0xdd75('0x3'))[_0xdd75('0x5')](''):[];}},'auth':{'type':Sequelize[_0xdd75('0x6')],'defaultValue':![]},'password':{'type':Sequelize[_0xdd75('0x2')]},'record':{'type':Sequelize[_0xdd75('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xdd75('0x2')]},'description':{'type':Sequelize[_0xdd75('0x2')]}}; \ No newline at end of file +var _0xea32=['split','BOOLEAN','sequelize','STRING','name','setDataValue','getDataValue','options'];(function(_0x5b7e3c,_0x1e7bc0){var _0x21dd67=function(_0x3f1b3e){while(--_0x3f1b3e){_0x5b7e3c['push'](_0x5b7e3c['shift']());}};_0x21dd67(++_0x1e7bc0);}(_0xea32,0x82));var _0x2ea3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xea32[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2ea3('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x2ea3('0x1')],'unique':_0x2ea3('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x2ea3('0x1')],'set':function(_0x1d892b){this[_0x2ea3('0x3')]('options',_0x1d892b?_0x1d892b['join'](''):[]);},'get':function(){return this[_0x2ea3('0x4')](_0x2ea3('0x5'))?this[_0x2ea3('0x4')](_0x2ea3('0x5'))[_0x2ea3('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0x2ea3('0x1')]},'record':{'type':Sequelize[_0x2ea3('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2ea3('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 4ef1609..0374346 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 _0xfe57=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','update','then','get','ChanSpies','UserProfileResource','destroy','stack','name','send','index','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','merge','VIRTUAL','options','rows','show','includeAll','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0xc3999c,_0x4db921){var _0x256213=function(_0x8f6565){while(--_0x8f6565){_0xc3999c['push'](_0xc3999c['shift']());}};_0x256213(++_0x4db921);}(_0xfe57,0x195));var _0x7fe5=function(_0x11dc39,_0x491115){_0x11dc39=_0x11dc39-0x0;var _0x457277=_0xfe57[_0x11dc39];return _0x457277;};'use strict';var emlformat=require(_0x7fe5('0x0'));var rimraf=require(_0x7fe5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7fe5('0x2'));var moment=require(_0x7fe5('0x3'));var BPromise=require(_0x7fe5('0x4'));var Mustache=require(_0x7fe5('0x5'));var util=require(_0x7fe5('0x6'));var path=require(_0x7fe5('0x7'));var sox=require(_0x7fe5('0x8'));var csv=require(_0x7fe5('0x9'));var ejs=require(_0x7fe5('0xa'));var fs=require('fs');var fs_extra=require(_0x7fe5('0xb'));var _=require(_0x7fe5('0xc'));var squel=require(_0x7fe5('0xd'));var crypto=require(_0x7fe5('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x7fe5('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7fe5('0x10'));var Papa=require(_0x7fe5('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7fe5('0x12'));var as=require(_0x7fe5('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7fe5('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x7fe5('0x15'));var licenseUtil=require(_0x7fe5('0x16'));var db=require(_0x7fe5('0x17'))['db'];function respondWithStatusCode(_0x225fc3,_0x53f76c){_0x53f76c=_0x53f76c||0xcc;return function(_0x329c95){if(_0x329c95){return _0x225fc3[_0x7fe5('0x18')](_0x53f76c);}return _0x225fc3['status'](_0x53f76c)[_0x7fe5('0x19')]();};}function respondWithResult(_0x54cfb2,_0x1f84b5){_0x1f84b5=_0x1f84b5||0xc8;return function(_0x2d297b){if(_0x2d297b){return _0x54cfb2['status'](_0x1f84b5)[_0x7fe5('0x1a')](_0x2d297b);}};}function respondWithFilteredResult(_0x56e76f,_0x39f175){return function(_0x221ab2){if(_0x221ab2){var _0xbdf0a4=typeof _0x39f175[_0x7fe5('0x1b')]===_0x7fe5('0x1c')&&typeof _0x39f175[_0x7fe5('0x1d')]==='undefined';var _0x166e23=_0x221ab2[_0x7fe5('0x1e')];var _0x340d5e=_0xbdf0a4?0x0:_0x39f175[_0x7fe5('0x1b')];var _0x2533db=_0xbdf0a4?_0x221ab2[_0x7fe5('0x1e')]:_0x39f175[_0x7fe5('0x1b')]+_0x39f175[_0x7fe5('0x1d')];var _0x478523;if(_0x2533db>=_0x166e23){_0x2533db=_0x166e23;_0x478523=0xc8;}else{_0x478523=0xce;}_0x56e76f[_0x7fe5('0x1f')](_0x478523);return _0x56e76f['set']('Content-Range',_0x340d5e+'-'+_0x2533db+'/'+_0x166e23)[_0x7fe5('0x1a')](_0x221ab2);}return null;};}function patchUpdates(_0x459c2d){return function(_0x2f6592){try{jsonpatch[_0x7fe5('0x20')](_0x2f6592,_0x459c2d,!![]);}catch(_0x39c560){return BPromise[_0x7fe5('0x21')](_0x39c560);}return _0x2f6592[_0x7fe5('0x22')]();};}function saveUpdates(_0xdd9df7,_0x1b271c){return function(_0x28a7fd){if(_0x28a7fd){return _0x28a7fd[_0x7fe5('0x23')](_0xdd9df7)[_0x7fe5('0x24')](function(_0x54ee98){return _0x54ee98;});}return null;};}function removeEntity(_0x3e7340,_0x2f39e0){return function(_0x43e547){if(_0x43e547){return _0x43e547['destroy']()[_0x7fe5('0x24')](function(){var _0x48ee56=_0x43e547[_0x7fe5('0x25')]({'plain':!![]});var _0x53f522=_0x7fe5('0x26');return db[_0x7fe5('0x27')][_0x7fe5('0x28')]({'where':{'type':_0x53f522,'resourceId':_0x48ee56['id']}})[_0x7fe5('0x24')](function(){return _0x43e547;});})[_0x7fe5('0x24')](function(){_0x3e7340[_0x7fe5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f2d25,_0x417a56){return function(_0x450759){if(!_0x450759){_0x5f2d25[_0x7fe5('0x18')](0x194);}return _0x450759;};}function handleError(_0x13c96b,_0x51407b){_0x51407b=_0x51407b||0x1f4;return function(_0x46f816){logger['error'](_0x46f816[_0x7fe5('0x29')]);if(_0x46f816[_0x7fe5('0x2a')]){delete _0x46f816[_0x7fe5('0x2a')];}_0x13c96b[_0x7fe5('0x1f')](_0x51407b)[_0x7fe5('0x2b')](_0x46f816);};}exports[_0x7fe5('0x2c')]=function(_0x5c07f0,_0xe521c6){var _0x423da8={},_0x5ec0b4={},_0xfc1189={'count':0x0,'rows':[]};var _0x246b70=_[_0x7fe5('0x2d')](db[_0x7fe5('0x2e')][_0x7fe5('0x2f')],function(_0x53ef16){return{'name':_0x53ef16['fieldName'],'type':_0x53ef16[_0x7fe5('0x30')][_0x7fe5('0x31')]};});_0x5ec0b4[_0x7fe5('0x32')]=_[_0x7fe5('0x2d')](_0x246b70,'name');_0x5ec0b4[_0x7fe5('0x33')]=_[_0x7fe5('0x34')](_0x5c07f0[_0x7fe5('0x33')]);_0x5ec0b4[_0x7fe5('0x35')]=_[_0x7fe5('0x36')](_0x5ec0b4[_0x7fe5('0x32')],_0x5ec0b4['query']);_0x423da8[_0x7fe5('0x37')]=_[_0x7fe5('0x36')](_0x5ec0b4[_0x7fe5('0x32')],qs[_0x7fe5('0x38')](_0x5c07f0['query']['fields']));_0x423da8[_0x7fe5('0x37')]=_0x423da8['attributes'][_0x7fe5('0x39')]?_0x423da8['attributes']:_0x5ec0b4[_0x7fe5('0x32')];if(!_0x5c07f0['query']['hasOwnProperty']('nolimit')){_0x423da8['limit']=qs[_0x7fe5('0x1d')](_0x5c07f0[_0x7fe5('0x33')]['limit']);_0x423da8[_0x7fe5('0x1b')]=qs[_0x7fe5('0x1b')](_0x5c07f0['query'][_0x7fe5('0x1b')]);}_0x423da8['order']=qs['sort'](_0x5c07f0[_0x7fe5('0x33')][_0x7fe5('0x3a')]);_0x423da8[_0x7fe5('0x3b')]=qs[_0x7fe5('0x35')](_[_0x7fe5('0x3c')](_0x5c07f0['query'],_0x5ec0b4[_0x7fe5('0x35')]),_0x246b70);if(_0x5c07f0[_0x7fe5('0x33')]['filter']){_0x423da8[_0x7fe5('0x3b')]=_[_0x7fe5('0x3d')](_0x423da8[_0x7fe5('0x3b')],{'$or':_[_0x7fe5('0x2d')](_0x246b70,function(_0x21c6d0){if(_0x21c6d0[_0x7fe5('0x30')]!==_0x7fe5('0x3e')){var _0x50cfa5={};_0x50cfa5[_0x21c6d0['name']]={'$like':'%'+_0x5c07f0[_0x7fe5('0x33')]['filter']+'%'};return _0x50cfa5;}})});}_0x423da8=_[_0x7fe5('0x3d')]({},_0x423da8,_0x5c07f0[_0x7fe5('0x3f')]);var _0x5df71d={'where':_0x423da8[_0x7fe5('0x3b')]};return db[_0x7fe5('0x2e')][_0x7fe5('0x1e')](_0x5df71d)[_0x7fe5('0x24')](function(_0x2fd004){_0xfc1189[_0x7fe5('0x1e')]=_0x2fd004;if(_0x5c07f0[_0x7fe5('0x33')]['includeAll']){_0x423da8['include']=[{'all':!![]}];}return db[_0x7fe5('0x2e')]['findAll'](_0x423da8);})[_0x7fe5('0x24')](function(_0x1a3e0d){_0xfc1189[_0x7fe5('0x40')]=_0x1a3e0d;return _0xfc1189;})[_0x7fe5('0x24')](respondWithFilteredResult(_0xe521c6,_0x423da8))['catch'](handleError(_0xe521c6,null));};exports[_0x7fe5('0x41')]=function(_0x5439bc,_0x498312){var _0x14a570={'raw':![],'where':{'id':_0x5439bc['params']['id']}},_0x585f27={};_0x585f27[_0x7fe5('0x32')]=_[_0x7fe5('0x34')](db[_0x7fe5('0x2e')][_0x7fe5('0x2f')]);_0x585f27[_0x7fe5('0x33')]=_['keys'](_0x5439bc[_0x7fe5('0x33')]);_0x585f27[_0x7fe5('0x35')]=_['intersection'](_0x585f27[_0x7fe5('0x32')],_0x585f27[_0x7fe5('0x33')]);_0x14a570[_0x7fe5('0x37')]=_[_0x7fe5('0x36')](_0x585f27['model'],qs[_0x7fe5('0x38')](_0x5439bc[_0x7fe5('0x33')][_0x7fe5('0x38')]));_0x14a570['attributes']=_0x14a570[_0x7fe5('0x37')][_0x7fe5('0x39')]?_0x14a570[_0x7fe5('0x37')]:_0x585f27['model'];if(_0x5439bc[_0x7fe5('0x33')][_0x7fe5('0x42')]){_0x14a570[_0x7fe5('0x43')]=[{'all':!![]}];}_0x14a570=_['merge']({},_0x14a570,_0x5439bc[_0x7fe5('0x3f')]);return db[_0x7fe5('0x2e')][_0x7fe5('0x44')](_0x14a570)[_0x7fe5('0x24')](handleEntityNotFound(_0x498312,null))[_0x7fe5('0x24')](respondWithResult(_0x498312,null))[_0x7fe5('0x45')](handleError(_0x498312,null));};exports[_0x7fe5('0x46')]=function(_0x447b57,_0x446f01){return db[_0x7fe5('0x2e')][_0x7fe5('0x46')](_0x447b57['body'],{})['then'](function(_0x54dbb9){var _0x5f2232=_0x447b57[_0x7fe5('0x47')]['get']({'plain':!![]});if(!_0x5f2232)throw new Error(_0x7fe5('0x48'));if(_0x5f2232[_0x7fe5('0x49')]===_0x7fe5('0x47')){var _0x1d9ca8=_0x54dbb9[_0x7fe5('0x25')]({'plain':!![]});var _0x5b24a4=_0x7fe5('0x26');return db[_0x7fe5('0x4a')][_0x7fe5('0x44')]({'where':{'name':_0x5b24a4,'userProfileId':_0x5f2232[_0x7fe5('0x4b')]},'raw':!![]})[_0x7fe5('0x24')](function(_0x259f7e){if(_0x259f7e&&_0x259f7e[_0x7fe5('0x4c')]===0x0){return db[_0x7fe5('0x27')][_0x7fe5('0x46')]({'name':_0x1d9ca8[_0x7fe5('0x2a')],'resourceId':_0x1d9ca8['id'],'type':_0x259f7e['name'],'sectionId':_0x259f7e['id']},{})[_0x7fe5('0x24')](function(){return _0x54dbb9;});}else{return _0x54dbb9;}})[_0x7fe5('0x45')](function(_0x2aa38d){logger[_0x7fe5('0x4d')](_0x7fe5('0x4e'),_0x2aa38d);throw _0x2aa38d;});}return _0x54dbb9;})[_0x7fe5('0x24')](respondWithResult(_0x446f01,0xc9))['catch'](handleError(_0x446f01,null));};exports[_0x7fe5('0x23')]=function(_0x1a44d3,_0x3d83fd){if(_0x1a44d3[_0x7fe5('0x4f')]['id']){delete _0x1a44d3[_0x7fe5('0x4f')]['id'];}return db[_0x7fe5('0x2e')][_0x7fe5('0x44')]({'where':{'id':_0x1a44d3['params']['id']}})[_0x7fe5('0x24')](handleEntityNotFound(_0x3d83fd,null))[_0x7fe5('0x24')](saveUpdates(_0x1a44d3[_0x7fe5('0x4f')],null))[_0x7fe5('0x24')](respondWithResult(_0x3d83fd,null))[_0x7fe5('0x45')](handleError(_0x3d83fd,null));};exports['destroy']=function(_0x2ddf6b,_0x34a430){return db[_0x7fe5('0x2e')][_0x7fe5('0x44')]({'where':{'id':_0x2ddf6b['params']['id']}})[_0x7fe5('0x24')](handleEntityNotFound(_0x34a430,null))[_0x7fe5('0x24')](removeEntity(_0x34a430,null))[_0x7fe5('0x45')](handleError(_0x34a430,null));}; \ No newline at end of file +var _0xc36d=['error','stack','name','VoiceChanSpy','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','ChanSpies','UserProfileResource'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xc36d,0x7d));var _0xdc36=function(_0x11e30d,_0x5584aa){_0x11e30d=_0x11e30d-0x0;var _0x2d4e29=_0xc36d[_0x11e30d];return _0x2d4e29;};'use strict';var emlformat=require(_0xdc36('0x0'));var rimraf=require(_0xdc36('0x1'));var zipdir=require(_0xdc36('0x2'));var jsonpatch=require(_0xdc36('0x3'));var rp=require(_0xdc36('0x4'));var moment=require(_0xdc36('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc36('0x6'));var util=require(_0xdc36('0x7'));var path=require('path');var sox=require(_0xdc36('0x8'));var csv=require(_0xdc36('0x9'));var ejs=require(_0xdc36('0xa'));var fs=require('fs');var fs_extra=require(_0xdc36('0xb'));var _=require(_0xdc36('0xc'));var squel=require('squel');var crypto=require(_0xdc36('0xd'));var jsforce=require(_0xdc36('0xe'));var deskjs=require(_0xdc36('0xf'));var toCsv=require(_0xdc36('0x9'));var querystring=require('querystring');var Papa=require(_0xdc36('0x10'));var Redis=require(_0xdc36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdc36('0x12'));var as=require(_0xdc36('0x13'));var hardwareService=require(_0xdc36('0x14'));var logger=require('../../config/logger')(_0xdc36('0x15'));var utils=require(_0xdc36('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdc36('0x17'))['db'];function respondWithStatusCode(_0x276692,_0x519fa5){_0x519fa5=_0x519fa5||0xcc;return function(_0x5d62ee){if(_0x5d62ee){return _0x276692['sendStatus'](_0x519fa5);}return _0x276692[_0xdc36('0x18')](_0x519fa5)[_0xdc36('0x19')]();};}function respondWithResult(_0x243d54,_0xae6ad3){_0xae6ad3=_0xae6ad3||0xc8;return function(_0x30803d){if(_0x30803d){return _0x243d54[_0xdc36('0x18')](_0xae6ad3)[_0xdc36('0x1a')](_0x30803d);}};}function respondWithFilteredResult(_0x809cf0,_0x57ebde){return function(_0x155cce){if(_0x155cce){var _0x526ac8=typeof _0x57ebde['offset']==='undefined'&&typeof _0x57ebde[_0xdc36('0x1b')]===_0xdc36('0x1c');var _0x5a498f=_0x155cce[_0xdc36('0x1d')];var _0x219a73=_0x526ac8?0x0:_0x57ebde[_0xdc36('0x1e')];var _0x225878=_0x526ac8?_0x155cce[_0xdc36('0x1d')]:_0x57ebde[_0xdc36('0x1e')]+_0x57ebde['limit'];var _0x3d4c4c;if(_0x225878>=_0x5a498f){_0x225878=_0x5a498f;_0x3d4c4c=0xc8;}else{_0x3d4c4c=0xce;}_0x809cf0[_0xdc36('0x18')](_0x3d4c4c);return _0x809cf0['set'](_0xdc36('0x1f'),_0x219a73+'-'+_0x225878+'/'+_0x5a498f)[_0xdc36('0x1a')](_0x155cce);}return null;};}function patchUpdates(_0x3f25f0){return function(_0x5f15ef){try{jsonpatch[_0xdc36('0x20')](_0x5f15ef,_0x3f25f0,!![]);}catch(_0x235a39){return BPromise['reject'](_0x235a39);}return _0x5f15ef[_0xdc36('0x21')]();};}function saveUpdates(_0x480277,_0x5a6e35){return function(_0x12f9d8){if(_0x12f9d8){return _0x12f9d8[_0xdc36('0x22')](_0x480277)[_0xdc36('0x23')](function(_0xda916b){return _0xda916b;});}return null;};}function removeEntity(_0x2d83c0,_0x34d261){return function(_0x14b595){if(_0x14b595){return _0x14b595[_0xdc36('0x24')]()['then'](function(){var _0x34057e=_0x14b595['get']({'plain':!![]});var _0x2338d7=_0xdc36('0x25');return db[_0xdc36('0x26')]['destroy']({'where':{'type':_0x2338d7,'resourceId':_0x34057e['id']}})[_0xdc36('0x23')](function(){return _0x14b595;});})[_0xdc36('0x23')](function(){_0x2d83c0[_0xdc36('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a005,_0x2f3b6a){return function(_0x2a596d){if(!_0x2a596d){_0x28a005['sendStatus'](0x194);}return _0x2a596d;};}function handleError(_0x3c39e3,_0x2dcef7){_0x2dcef7=_0x2dcef7||0x1f4;return function(_0x4b15b4){logger[_0xdc36('0x27')](_0x4b15b4[_0xdc36('0x28')]);if(_0x4b15b4['name']){delete _0x4b15b4[_0xdc36('0x29')];}_0x3c39e3['status'](_0x2dcef7)['send'](_0x4b15b4);};}exports['index']=function(_0x3b0839,_0x2f2bb4){var _0x4f57aa={},_0x13bf82={},_0x983eab={'count':0x0,'rows':[]};var _0x336447=_['map'](db[_0xdc36('0x2a')][_0xdc36('0x2b')],function(_0x1d010c){return{'name':_0x1d010c[_0xdc36('0x2c')],'type':_0x1d010c[_0xdc36('0x2d')][_0xdc36('0x2e')]};});_0x13bf82[_0xdc36('0x2f')]=_['map'](_0x336447,_0xdc36('0x29'));_0x13bf82[_0xdc36('0x30')]=_['keys'](_0x3b0839['query']);_0x13bf82[_0xdc36('0x31')]=_[_0xdc36('0x32')](_0x13bf82[_0xdc36('0x2f')],_0x13bf82['query']);_0x4f57aa['attributes']=_[_0xdc36('0x32')](_0x13bf82[_0xdc36('0x2f')],qs[_0xdc36('0x33')](_0x3b0839[_0xdc36('0x30')][_0xdc36('0x33')]));_0x4f57aa[_0xdc36('0x34')]=_0x4f57aa[_0xdc36('0x34')][_0xdc36('0x35')]?_0x4f57aa[_0xdc36('0x34')]:_0x13bf82[_0xdc36('0x2f')];if(!_0x3b0839[_0xdc36('0x30')]['hasOwnProperty'](_0xdc36('0x36'))){_0x4f57aa[_0xdc36('0x1b')]=qs[_0xdc36('0x1b')](_0x3b0839[_0xdc36('0x30')]['limit']);_0x4f57aa[_0xdc36('0x1e')]=qs[_0xdc36('0x1e')](_0x3b0839[_0xdc36('0x30')][_0xdc36('0x1e')]);}_0x4f57aa['order']=qs[_0xdc36('0x37')](_0x3b0839['query']['sort']);_0x4f57aa[_0xdc36('0x38')]=qs[_0xdc36('0x31')](_[_0xdc36('0x39')](_0x3b0839['query'],_0x13bf82[_0xdc36('0x31')]),_0x336447);if(_0x3b0839['query'][_0xdc36('0x3a')]){_0x4f57aa[_0xdc36('0x38')]=_[_0xdc36('0x3b')](_0x4f57aa['where'],{'$or':_[_0xdc36('0x3c')](_0x336447,function(_0x3394ca){if(_0x3394ca[_0xdc36('0x2d')]!==_0xdc36('0x3d')){var _0x50cf7b={};_0x50cf7b[_0x3394ca[_0xdc36('0x29')]]={'$like':'%'+_0x3b0839[_0xdc36('0x30')][_0xdc36('0x3a')]+'%'};return _0x50cf7b;}})});}_0x4f57aa=_['merge']({},_0x4f57aa,_0x3b0839['options']);var _0x2cefcf={'where':_0x4f57aa[_0xdc36('0x38')]};return db['VoiceChanSpy']['count'](_0x2cefcf)[_0xdc36('0x23')](function(_0x8f4c80){_0x983eab[_0xdc36('0x1d')]=_0x8f4c80;if(_0x3b0839[_0xdc36('0x30')][_0xdc36('0x3e')]){_0x4f57aa[_0xdc36('0x3f')]=[{'all':!![]}];}return db[_0xdc36('0x2a')][_0xdc36('0x40')](_0x4f57aa);})[_0xdc36('0x23')](function(_0x125f0e){_0x983eab[_0xdc36('0x41')]=_0x125f0e;return _0x983eab;})[_0xdc36('0x23')](respondWithFilteredResult(_0x2f2bb4,_0x4f57aa))[_0xdc36('0x42')](handleError(_0x2f2bb4,null));};exports[_0xdc36('0x43')]=function(_0x1f2604,_0x133166){var _0xc8cb3d={'raw':![],'where':{'id':_0x1f2604[_0xdc36('0x44')]['id']}},_0x16dcb7={};_0x16dcb7[_0xdc36('0x2f')]=_[_0xdc36('0x45')](db[_0xdc36('0x2a')][_0xdc36('0x2b')]);_0x16dcb7[_0xdc36('0x30')]=_[_0xdc36('0x45')](_0x1f2604[_0xdc36('0x30')]);_0x16dcb7['filters']=_[_0xdc36('0x32')](_0x16dcb7[_0xdc36('0x2f')],_0x16dcb7['query']);_0xc8cb3d['attributes']=_[_0xdc36('0x32')](_0x16dcb7['model'],qs[_0xdc36('0x33')](_0x1f2604['query'][_0xdc36('0x33')]));_0xc8cb3d[_0xdc36('0x34')]=_0xc8cb3d[_0xdc36('0x34')][_0xdc36('0x35')]?_0xc8cb3d[_0xdc36('0x34')]:_0x16dcb7[_0xdc36('0x2f')];if(_0x1f2604[_0xdc36('0x30')][_0xdc36('0x3e')]){_0xc8cb3d[_0xdc36('0x3f')]=[{'all':!![]}];}_0xc8cb3d=_[_0xdc36('0x3b')]({},_0xc8cb3d,_0x1f2604[_0xdc36('0x46')]);return db[_0xdc36('0x2a')][_0xdc36('0x47')](_0xc8cb3d)[_0xdc36('0x23')](handleEntityNotFound(_0x133166,null))[_0xdc36('0x23')](respondWithResult(_0x133166,null))[_0xdc36('0x42')](handleError(_0x133166,null));};exports[_0xdc36('0x48')]=function(_0x3399cc,_0x562c86){return db['VoiceChanSpy'][_0xdc36('0x48')](_0x3399cc[_0xdc36('0x49')],{})[_0xdc36('0x23')](function(_0x45dd51){var _0x205f76=_0x3399cc[_0xdc36('0x4a')]['get']({'plain':!![]});if(!_0x205f76)throw new Error(_0xdc36('0x4b'));if(_0x205f76[_0xdc36('0x4c')]===_0xdc36('0x4a')){var _0x49f456=_0x45dd51[_0xdc36('0x4d')]({'plain':!![]});var _0x53ed42=_0xdc36('0x25');return db[_0xdc36('0x4e')][_0xdc36('0x47')]({'where':{'name':_0x53ed42,'userProfileId':_0x205f76[_0xdc36('0x4f')]},'raw':!![]})['then'](function(_0x2f1707){if(_0x2f1707&&_0x2f1707[_0xdc36('0x50')]===0x0){return db[_0xdc36('0x26')][_0xdc36('0x48')]({'name':_0x49f456[_0xdc36('0x29')],'resourceId':_0x49f456['id'],'type':_0x2f1707[_0xdc36('0x29')],'sectionId':_0x2f1707['id']},{})[_0xdc36('0x23')](function(){return _0x45dd51;});}else{return _0x45dd51;}})[_0xdc36('0x42')](function(_0x4abeaf){logger[_0xdc36('0x27')](_0xdc36('0x51'),_0x4abeaf);throw _0x4abeaf;});}return _0x45dd51;})[_0xdc36('0x23')](respondWithResult(_0x562c86,0xc9))[_0xdc36('0x42')](handleError(_0x562c86,null));};exports[_0xdc36('0x22')]=function(_0x187b00,_0x1e7332){if(_0x187b00[_0xdc36('0x49')]['id']){delete _0x187b00['body']['id'];}return db['VoiceChanSpy'][_0xdc36('0x47')]({'where':{'id':_0x187b00[_0xdc36('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e7332,null))[_0xdc36('0x23')](saveUpdates(_0x187b00[_0xdc36('0x49')],null))['then'](respondWithResult(_0x1e7332,null))['catch'](handleError(_0x1e7332,null));};exports[_0xdc36('0x24')]=function(_0x5cf2ee,_0x4277b4){return db['VoiceChanSpy'][_0xdc36('0x47')]({'where':{'id':_0x5cf2ee['params']['id']}})['then'](handleEntityNotFound(_0x4277b4,null))[_0xdc36('0x23')](removeEntity(_0x4277b4,null))['catch'](handleError(_0x4277b4,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 9c8bd78..8da1423 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 _0x065b=['concat','internal','User','name','agent','then','catch','exports','models','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','system','chanspy','push','merge','MixMonitor','recordingFormat','auth','Authenticate','password','SIP/%s,%s','options','join','length'];(function(_0x422974,_0x11fa92){var _0x38ff85=function(_0x271d61){while(--_0x271d61){_0x422974['push'](_0x422974['shift']());}};_0x38ff85(++_0x11fa92);}(_0x065b,0x96));var _0xb065=function(_0x9ff1c0,_0x207afc){_0x9ff1c0=_0x9ff1c0-0x0;var _0x3e6c23=_0x065b[_0x9ff1c0];return _0x3e6c23;};'use strict';var _=require(_0xb065('0x0'));var util=require(_0xb065('0x1'));var BPromise=require(_0xb065('0x2'));var attributes=require(_0xb065('0x3'));var getUserApplications=function(_0x11d4a2,_0x597aee,_0x4e31ee){var _0x304d11=0x1;var _0x1cbe79=[];var _0x21b214={'context':_0x597aee[_0xb065('0x4')]||_0xb065('0x5'),'exten':util[_0xb065('0x6')]('%s%s',_0x11d4a2['prefix'],_0x4e31ee),'type':_0xb065('0x7'),'isApp':![],'ChanSpyId':_0x11d4a2['id'],'UserId':_0x597aee['id']};_0x1cbe79['push'](_['merge']({'app':'Set','appdata':util[_0xb065('0x6')]('CDR(type)=%s',_0xb065('0x8')),'priority':_0x304d11++},_0x21b214));if(_0x11d4a2['record']){_0x1cbe79[_0xb065('0x9')](_[_0xb065('0xa')]({'app':_0xb065('0xb'),'appdata':util['format']('${UNIQUEID}.%s,a',_0x11d4a2[_0xb065('0xc')]),'priority':_0x304d11++},_0x21b214));}if(_0x11d4a2[_0xb065('0xd')]){_0x1cbe79['push'](_[_0xb065('0xa')]({'app':_0xb065('0xe'),'appdata':_0x11d4a2[_0xb065('0xf')],'priority':_0x304d11++},_0x21b214));}_0x1cbe79['push'](_[_0xb065('0xa')]({'app':'ChanSpy','appdata':util[_0xb065('0x6')](_0xb065('0x10'),_0x597aee['name'],_0x11d4a2[_0xb065('0x11')]?_0x11d4a2['options'][_0xb065('0x12')](''):''),'priority':_0x304d11++},_0x21b214));if(_0x11d4a2['record']){_0x1cbe79[_0xb065('0x9')](_[_0xb065('0xa')]({'app':'StopMixMonitor','priority':_0x304d11++},_0x21b214));}return _0x1cbe79;};var getChanSpyApplications=function(_0xbea82c,_0x29757b){var _0x5eaf78=[];for(var _0x43de9a=0x0,_0x4919f4=0x1;_0x43de9a<_0x29757b[_0xb065('0x13')];_0x43de9a++,_0x4919f4=0x1){_0x5eaf78=_0x5eaf78[_0xb065('0x14')](getUserApplications(_0xbea82c,_0x29757b[_0x43de9a],_0x29757b[_0x43de9a][_0xb065('0x15')]));if(_0x29757b[_0x43de9a]['internal']!=_0x29757b[_0x43de9a]['name']){_0x5eaf78=_0x5eaf78[_0xb065('0x14')](getUserApplications(_0xbea82c,_0x29757b[_0x43de9a],_0x29757b[_0x43de9a]['name']));}}return _0x5eaf78;};var getChanSpyPromise=function(_0x1c0a58,_0x3a7611){return new BPromise(function(_0x349bfc,_0x575efc){return _0x1c0a58[_0xb065('0x16')]['findAll']({'attributes':['id',_0xb065('0x17'),_0xb065('0x15')],'where':{'role':_0xb065('0x18'),'chanspy':!![]},'raw':!![]})[_0xb065('0x19')](function(_0xc17f40){if(_0xc17f40){return _0x349bfc(getChanSpyApplications(_0x3a7611,_0xc17f40));}return _0x349bfc([]);})[_0xb065('0x1a')](function(_0x5c509e){_0x575efc(_0x5c509e);});});};module[_0xb065('0x1b')]=function(_0x2c3056,_0x2bb6d4){var _0x5d4af2=_0x2c3056[_0xb065('0x1c')];return _0x2c3056['define'](_0xb065('0x1d'),attributes,{'tableName':_0xb065('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xfcac93,_0x35e3fc,_0x3ce85f){return getChanSpyPromise(_0x5d4af2,_0xfcac93)[_0xb065('0x19')](function(_0x28b446){if(_0x28b446&&_0x28b446['length']){return _0x5d4af2[_0xb065('0x1f')][_0xb065('0x20')](_0x28b446);}})[_0xb065('0x19')](function(){_0x3ce85f();})['catch'](function(_0x323e78){_0x3ce85f(_0x323e78);});},'afterUpdate':function(_0x474178,_0x21f61e,_0x500c36){return _0x5d4af2[_0xb065('0x1f')][_0xb065('0x21')]({'where':{'ChanSpyId':_0x474178['id']}})['then'](function(){return getChanSpyPromise(_0x5d4af2,_0x474178);})[_0xb065('0x19')](function(_0x1de942){if(_0x1de942&&_0x1de942[_0xb065('0x13')]){return _0x5d4af2[_0xb065('0x1f')][_0xb065('0x20')](_0x1de942);}})[_0xb065('0x19')](function(){_0x500c36();})[_0xb065('0x1a')](function(_0x2d50af){_0x500c36(_0x2d50af);});},'afterDestroy':function(_0x1d3cb3,_0x88f718,_0x104143){return _0x5d4af2[_0xb065('0x1f')][_0xb065('0x21')]({'where':{'ChanSpyId':_0x1d3cb3['id']}})['then'](function(){_0x104143();})[_0xb065('0x1a')](function(_0x542a0f){_0x104143(_0x542a0f);});}}});}; \ No newline at end of file +var _0xabf0=['VoiceChanSpy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','prefix','system','push','merge','Set','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','length','concat','internal','User','findAll','then','exports','models','define'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0xabf0,0x98));var _0x0abf=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xabf0[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x0abf('0x0'));var util=require(_0x0abf('0x1'));var BPromise=require(_0x0abf('0x2'));var attributes=require(_0x0abf('0x3'));var getUserApplications=function(_0x1df615,_0x3aafa8,_0x532456){var _0x4fbcf4=0x1;var _0x27cdda=[];var _0x57527e={'context':_0x3aafa8[_0x0abf('0x4')]||_0x0abf('0x5'),'exten':util[_0x0abf('0x6')]('%s%s',_0x1df615[_0x0abf('0x7')],_0x532456),'type':_0x0abf('0x8'),'isApp':![],'ChanSpyId':_0x1df615['id'],'UserId':_0x3aafa8['id']};_0x27cdda[_0x0abf('0x9')](_[_0x0abf('0xa')]({'app':_0x0abf('0xb'),'appdata':util['format']('CDR(type)=%s',_0x0abf('0xc')),'priority':_0x4fbcf4++},_0x57527e));if(_0x1df615[_0x0abf('0xd')]){_0x27cdda['push'](_[_0x0abf('0xa')]({'app':_0x0abf('0xe'),'appdata':util[_0x0abf('0x6')](_0x0abf('0xf'),_0x1df615['recordingFormat']),'priority':_0x4fbcf4++},_0x57527e));}if(_0x1df615[_0x0abf('0x10')]){_0x27cdda['push'](_['merge']({'app':_0x0abf('0x11'),'appdata':_0x1df615[_0x0abf('0x12')],'priority':_0x4fbcf4++},_0x57527e));}_0x27cdda[_0x0abf('0x9')](_['merge']({'app':_0x0abf('0x13'),'appdata':util['format'](_0x0abf('0x14'),_0x3aafa8[_0x0abf('0x15')],_0x1df615[_0x0abf('0x16')]?_0x1df615[_0x0abf('0x16')][_0x0abf('0x17')](''):''),'priority':_0x4fbcf4++},_0x57527e));if(_0x1df615[_0x0abf('0xd')]){_0x27cdda[_0x0abf('0x9')](_[_0x0abf('0xa')]({'app':'StopMixMonitor','priority':_0x4fbcf4++},_0x57527e));}return _0x27cdda;};var getChanSpyApplications=function(_0x59c991,_0x571053){var _0x49a34b=[];for(var _0x22120a=0x0,_0x4c9fab=0x1;_0x22120a<_0x571053[_0x0abf('0x18')];_0x22120a++,_0x4c9fab=0x1){_0x49a34b=_0x49a34b[_0x0abf('0x19')](getUserApplications(_0x59c991,_0x571053[_0x22120a],_0x571053[_0x22120a][_0x0abf('0x1a')]));if(_0x571053[_0x22120a][_0x0abf('0x1a')]!=_0x571053[_0x22120a][_0x0abf('0x15')]){_0x49a34b=_0x49a34b[_0x0abf('0x19')](getUserApplications(_0x59c991,_0x571053[_0x22120a],_0x571053[_0x22120a][_0x0abf('0x15')]));}}return _0x49a34b;};var getChanSpyPromise=function(_0x473c3d,_0x4c05b6){return new BPromise(function(_0x394c84,_0x456fe5){return _0x473c3d[_0x0abf('0x1b')][_0x0abf('0x1c')]({'attributes':['id','name',_0x0abf('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x0abf('0x1d')](function(_0x4dc28a){if(_0x4dc28a){return _0x394c84(getChanSpyApplications(_0x4c05b6,_0x4dc28a));}return _0x394c84([]);})['catch'](function(_0x2b8be1){_0x456fe5(_0x2b8be1);});});};module[_0x0abf('0x1e')]=function(_0x56b088,_0x2b5bd4){var _0x3159a9=_0x56b088[_0x0abf('0x1f')];return _0x56b088[_0x0abf('0x20')](_0x0abf('0x21'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e434d,_0xda6ea0,_0x2c74fb){return getChanSpyPromise(_0x3159a9,_0x5e434d)[_0x0abf('0x1d')](function(_0x45ebd6){if(_0x45ebd6&&_0x45ebd6[_0x0abf('0x18')]){return _0x3159a9[_0x0abf('0x22')]['bulkCreate'](_0x45ebd6);}})[_0x0abf('0x1d')](function(){_0x2c74fb();})['catch'](function(_0x27d503){_0x2c74fb(_0x27d503);});},'afterUpdate':function(_0x1d163a,_0x53d2e7,_0x41fcbb){return _0x3159a9[_0x0abf('0x22')][_0x0abf('0x23')]({'where':{'ChanSpyId':_0x1d163a['id']}})['then'](function(){return getChanSpyPromise(_0x3159a9,_0x1d163a);})['then'](function(_0x548e7e){if(_0x548e7e&&_0x548e7e[_0x0abf('0x18')]){return _0x3159a9[_0x0abf('0x22')][_0x0abf('0x24')](_0x548e7e);}})[_0x0abf('0x1d')](function(){_0x41fcbb();})['catch'](function(_0x20091a){_0x41fcbb(_0x20091a);});},'afterDestroy':function(_0x43da34,_0x2694b8,_0x24c1aa){return _0x3159a9['VoiceExtension'][_0x0abf('0x23')]({'where':{'ChanSpyId':_0x43da34['id']}})[_0x0abf('0x1d')](function(){_0x24c1aa();})['catch'](function(_0x23cde2){_0x24c1aa(_0x23cde2);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index f89bfaf..1365683 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 _0x0e9f=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x185334,_0x4630ac){var _0xf2e59a=function(_0x3cc497){while(--_0x3cc497){_0x185334['push'](_0x185334['shift']());}};_0xf2e59a(++_0x4630ac);}(_0x0e9f,0x116));var _0xf0e9=function(_0x2ecc67,_0x4f87f6){_0x2ecc67=_0x2ecc67-0x0;var _0x48d94d=_0x0e9f[_0x2ecc67];return _0x48d94d;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});} \ No newline at end of file +var _0xac4a=['VoiceChanSpy,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xac4a,0x13f));var _0xaac4=function(_0x1d74d5,_0x3fa150){_0x1d74d5=_0x1d74d5-0x0;var _0x3631bb=_0xac4a[_0x1d74d5];return _0x3631bb;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('VoiceChanSpy,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index f230b05..de447a6 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 _0x9776=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x575532,_0x1afb71){var _0x348d94=function(_0xea0884){while(--_0xea0884){_0x575532['push'](_0x575532['shift']());}};_0x348d94(++_0x1afb71);}(_0x9776,0x162));var _0x6977=function(_0x226fbf,_0x4dfd81){_0x226fbf=_0x226fbf-0x0;var _0x3cc2be=_0x9776[_0x226fbf];return _0x3cc2be;};'use strict';var multer=require(_0x6977('0x0'));var util=require(_0x6977('0x1'));var path=require(_0x6977('0x2'));var timeout=require(_0x6977('0x3'));var express=require(_0x6977('0x4'));var router=express[_0x6977('0x5')]();var fs_extra=require(_0x6977('0x6'));var auth=require(_0x6977('0x7'));var interaction=require(_0x6977('0x8'));var config=require(_0x6977('0x9'));var controller=require('./voiceContext.controller');router[_0x6977('0xa')]('/',auth[_0x6977('0xb')](),controller['index']);router[_0x6977('0xa')](_0x6977('0xc'),auth[_0x6977('0xb')](),controller['show']);router['post']('/',auth[_0x6977('0xb')](),controller[_0x6977('0xd')]);router[_0x6977('0xe')](_0x6977('0xc'),auth[_0x6977('0xb')](),controller['update']);router[_0x6977('0xf')](_0x6977('0xc'),auth[_0x6977('0xb')](),controller[_0x6977('0x10')]);module[_0x6977('0x11')]=router; \ No newline at end of file +var _0x6618=['../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra'];(function(_0x282853,_0x410fe9){var _0xf163ac=function(_0x5c4a27){while(--_0x5c4a27){_0x282853['push'](_0x282853['shift']());}};_0xf163ac(++_0x410fe9);}(_0x6618,0x9d));var _0x8661=function(_0x55a3a8,_0x55f54f){_0x55a3a8=_0x55a3a8-0x0;var _0x45b597=_0x6618[_0x55a3a8];return _0x45b597;};'use strict';var multer=require(_0x8661('0x0'));var util=require('util');var path=require(_0x8661('0x1'));var timeout=require(_0x8661('0x2'));var express=require('express');var router=express[_0x8661('0x3')]();var fs_extra=require(_0x8661('0x4'));var auth=require(_0x8661('0x5'));var interaction=require(_0x8661('0x6'));var config=require(_0x8661('0x7'));var controller=require('./voiceContext.controller');router['get']('/',auth[_0x8661('0x8')](),controller[_0x8661('0x9')]);router[_0x8661('0xa')]('/:id',auth[_0x8661('0x8')](),controller['show']);router[_0x8661('0xb')]('/',auth[_0x8661('0x8')](),controller['create']);router[_0x8661('0xc')](_0x8661('0xd'),auth[_0x8661('0x8')](),controller[_0x8661('0xe')]);router[_0x8661('0xf')]('/:id',auth[_0x8661('0x8')](),controller[_0x8661('0x10')]);module[_0x8661('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index f40b27c..0e4b18f 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 _0xaee4=['sequelize','exports','STRING','BOOLEAN'];(function(_0x149ca0,_0x2ac7f5){var _0x56b6b9=function(_0x486ac3){while(--_0x486ac3){_0x149ca0['push'](_0x149ca0['shift']());}};_0x56b6b9(++_0x2ac7f5);}(_0xaee4,0x108));var _0x4aee=function(_0x36e6a4,_0x10306a){_0x36e6a4=_0x36e6a4-0x0;var _0x334b24=_0xaee4[_0x36e6a4];return _0x334b24;};'use strict';var Sequelize=require(_0x4aee('0x0'));module[_0x4aee('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x4aee('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x4aee('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x72fa=['STRING','name','BOOLEAN','sequelize','exports'];(function(_0x35f1de,_0x4dda19){var _0x4b66d6=function(_0x4ff6c5){while(--_0x4ff6c5){_0x35f1de['push'](_0x35f1de['shift']());}};_0x4b66d6(++_0x4dda19);}(_0x72fa,0x120));var _0xa72f=function(_0x11c1a1,_0x17ba8c){_0x11c1a1=_0x11c1a1-0x0;var _0x483746=_0x72fa[_0x11c1a1];return _0x483746;};'use strict';var Sequelize=require(_0xa72f('0x0'));module[_0xa72f('0x1')]={'name':{'type':Sequelize[_0xa72f('0x2')],'unique':_0xa72f('0x3')},'description':{'type':Sequelize[_0xa72f('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa72f('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 22fd8b7..17745bb 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 _0x866d=['set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VoiceContext','includeAll','findAll','rows','params','keys','include','find','create','body','join','root','server/files/templates/context.ejs','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','utf8','Reload','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x2859f2,_0x1e3102){var _0x4974cd=function(_0x13ec65){while(--_0x13ec65){_0x2859f2['push'](_0x2859f2['shift']());}};_0x4974cd(++_0x1e3102);}(_0x866d,0x110));var _0xd866=function(_0x36e20c,_0x43caa5){_0x36e20c=_0x36e20c-0x0;var _0x48eba2=_0x866d[_0x36e20c];return _0x48eba2;};'use strict';var emlformat=require(_0xd866('0x0'));var rimraf=require(_0xd866('0x1'));var zipdir=require(_0xd866('0x2'));var jsonpatch=require(_0xd866('0x3'));var rp=require(_0xd866('0x4'));var moment=require(_0xd866('0x5'));var BPromise=require(_0xd866('0x6'));var Mustache=require(_0xd866('0x7'));var util=require('util');var path=require(_0xd866('0x8'));var sox=require(_0xd866('0x9'));var csv=require(_0xd866('0xa'));var ejs=require(_0xd866('0xb'));var fs=require('fs');var fs_extra=require(_0xd866('0xc'));var _=require(_0xd866('0xd'));var squel=require(_0xd866('0xe'));var crypto=require(_0xd866('0xf'));var jsforce=require(_0xd866('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xd866('0xa'));var querystring=require(_0xd866('0x11'));var Papa=require(_0xd866('0x12'));var Redis=require('ioredis');var authService=require(_0xd866('0x13'));var qs=require(_0xd866('0x14'));var as=require(_0xd866('0x15'));var hardwareService=require(_0xd866('0x16'));var logger=require(_0xd866('0x17'))(_0xd866('0x18'));var utils=require('../../config/utils');var config=require(_0xd866('0x19'));var licenseUtil=require(_0xd866('0x1a'));var db=require(_0xd866('0x1b'))['db'];var jayson=require(_0xd866('0x1c'));var client=jayson[_0xd866('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30439e,_0x5e117c,_0x33a000,_0x1e0d1c){return new BPromise(function(_0x54ef4d,_0x615468){var _0x181554=_0x1e0d1c||client;return _0x181554['request'](_0x30439e,_0x33a000)[_0xd866('0x1e')](function(_0x273f95){logger['info']('VoiceContext,\x20%s,\x20%s',_0x5e117c,_0xd866('0x1f'));logger[_0xd866('0x20')](_0xd866('0x21'),_0x5e117c,'request\x20sent',JSON[_0xd866('0x22')](_0x273f95));if(_0x273f95[_0xd866('0x23')]){if(_0x273f95[_0xd866('0x23')][_0xd866('0x24')]===0x1f4){logger[_0xd866('0x23')]('VoiceContext,\x20%s,\x20%s',_0x5e117c,_0x273f95['error'][_0xd866('0x25')]);return _0x615468(_0x273f95[_0xd866('0x23')][_0xd866('0x25')]);}logger[_0xd866('0x23')]('VoiceContext,\x20%s,\x20%s',_0x5e117c,_0x273f95[_0xd866('0x23')][_0xd866('0x25')]);return _0x54ef4d(_0x273f95[_0xd866('0x23')][_0xd866('0x25')]);}else{logger['info'](_0xd866('0x26'),_0x5e117c,_0xd866('0x1f'));_0x54ef4d(_0x273f95[_0xd866('0x27')][_0xd866('0x25')]);}})[_0xd866('0x28')](function(_0x22c29f){logger[_0xd866('0x23')](_0xd866('0x26'),_0x5e117c,_0x22c29f);_0x615468(_0x22c29f);});});}function respondWithStatusCode(_0x51c02c,_0x46d673){_0x46d673=_0x46d673||0xcc;return function(_0x5c4ee1){if(_0x5c4ee1){return _0x51c02c[_0xd866('0x29')](_0x46d673);}return _0x51c02c[_0xd866('0x2a')](_0x46d673)[_0xd866('0x2b')]();};}function respondWithResult(_0x3b9a20,_0x5b741a){_0x5b741a=_0x5b741a||0xc8;return function(_0x51ab88){if(_0x51ab88){return _0x3b9a20['status'](_0x5b741a)[_0xd866('0x2c')](_0x51ab88);}};}function respondWithFilteredResult(_0x27c7c9,_0x117d64){return function(_0x599b7e){if(_0x599b7e){var _0x43ecc3=typeof _0x117d64[_0xd866('0x2d')]===_0xd866('0x2e')&&typeof _0x117d64[_0xd866('0x2f')]===_0xd866('0x2e');var _0x2853bd=_0x599b7e[_0xd866('0x30')];var _0x8b1450=_0x43ecc3?0x0:_0x117d64['offset'];var _0x34ee61=_0x43ecc3?_0x599b7e['count']:_0x117d64['offset']+_0x117d64['limit'];var _0x9f0161;if(_0x34ee61>=_0x2853bd){_0x34ee61=_0x2853bd;_0x9f0161=0xc8;}else{_0x9f0161=0xce;}_0x27c7c9[_0xd866('0x2a')](_0x9f0161);return _0x27c7c9[_0xd866('0x31')](_0xd866('0x32'),_0x8b1450+'-'+_0x34ee61+'/'+_0x2853bd)[_0xd866('0x2c')](_0x599b7e);}return null;};}function patchUpdates(_0x47b224){return function(_0x170a1e){try{jsonpatch[_0xd866('0x33')](_0x170a1e,_0x47b224,!![]);}catch(_0x561787){return BPromise[_0xd866('0x34')](_0x561787);}return _0x170a1e[_0xd866('0x35')]();};}function saveUpdates(_0x2051da,_0x541b83){return function(_0x3c5430){if(_0x3c5430){return _0x3c5430[_0xd866('0x36')](_0x2051da)['then'](function(_0x1e1f96){return _0x1e1f96;});}return null;};}function removeEntity(_0x2efdfa,_0x3127b7){return function(_0x4e786d){if(_0x4e786d){return _0x4e786d[_0xd866('0x37')]()[_0xd866('0x1e')](function(){var _0x521eea=_0x4e786d[_0xd866('0x38')]({'plain':!![]});var _0x3f1d6a=_0xd866('0x39');return db[_0xd866('0x3a')][_0xd866('0x37')]({'where':{'type':_0x3f1d6a,'resourceId':_0x521eea['id']}})[_0xd866('0x1e')](function(){return _0x4e786d;});})[_0xd866('0x1e')](function(){_0x2efdfa[_0xd866('0x2a')](0xcc)[_0xd866('0x2b')]();});}};}function handleEntityNotFound(_0x350ae8,_0x4766d8){return function(_0x544c83){if(!_0x544c83){_0x350ae8[_0xd866('0x29')](0x194);}return _0x544c83;};}function handleError(_0x41c3eb,_0x336364){_0x336364=_0x336364||0x1f4;return function(_0x2b9cae){logger[_0xd866('0x23')](_0x2b9cae[_0xd866('0x3b')]);if(_0x2b9cae[_0xd866('0x3c')]){delete _0x2b9cae[_0xd866('0x3c')];}_0x41c3eb[_0xd866('0x2a')](_0x336364)[_0xd866('0x3d')](_0x2b9cae);};}exports[_0xd866('0x3e')]=function(_0x43c7ab,_0x1087e9){var _0x3e9143={},_0x4ee4e2={},_0x58afa9={'count':0x0,'rows':[]};var _0x118228=_[_0xd866('0x3f')](db['VoiceContext'][_0xd866('0x40')],function(_0x3f7843){return{'name':_0x3f7843[_0xd866('0x41')],'type':_0x3f7843[_0xd866('0x42')]['key']};});_0x4ee4e2[_0xd866('0x43')]=_[_0xd866('0x3f')](_0x118228,_0xd866('0x3c'));_0x4ee4e2[_0xd866('0x44')]=_['keys'](_0x43c7ab['query']);_0x4ee4e2[_0xd866('0x45')]=_[_0xd866('0x46')](_0x4ee4e2[_0xd866('0x43')],_0x4ee4e2[_0xd866('0x44')]);_0x3e9143[_0xd866('0x47')]=_['intersection'](_0x4ee4e2[_0xd866('0x43')],qs['fields'](_0x43c7ab[_0xd866('0x44')][_0xd866('0x48')]));_0x3e9143[_0xd866('0x47')]=_0x3e9143['attributes'][_0xd866('0x49')]?_0x3e9143[_0xd866('0x47')]:_0x4ee4e2[_0xd866('0x43')];if(!_0x43c7ab[_0xd866('0x44')][_0xd866('0x4a')](_0xd866('0x4b'))){_0x3e9143[_0xd866('0x2f')]=qs[_0xd866('0x2f')](_0x43c7ab['query'][_0xd866('0x2f')]);_0x3e9143['offset']=qs[_0xd866('0x2d')](_0x43c7ab['query'][_0xd866('0x2d')]);}_0x3e9143[_0xd866('0x4c')]=qs['sort'](_0x43c7ab[_0xd866('0x44')][_0xd866('0x4d')]);_0x3e9143[_0xd866('0x4e')]=qs[_0xd866('0x45')](_['pick'](_0x43c7ab[_0xd866('0x44')],_0x4ee4e2[_0xd866('0x45')]),_0x118228);if(_0x43c7ab[_0xd866('0x44')][_0xd866('0x4f')]){_0x3e9143[_0xd866('0x4e')]=_[_0xd866('0x50')](_0x3e9143[_0xd866('0x4e')],{'$or':_['map'](_0x118228,function(_0x3fbb31){if(_0x3fbb31[_0xd866('0x42')]!==_0xd866('0x51')){var _0x3710a3={};_0x3710a3[_0x3fbb31[_0xd866('0x3c')]]={'$like':'%'+_0x43c7ab['query'][_0xd866('0x4f')]+'%'};return _0x3710a3;}})});}_0x3e9143=_[_0xd866('0x50')]({},_0x3e9143,_0x43c7ab[_0xd866('0x52')]);var _0x585a86={'where':_0x3e9143[_0xd866('0x4e')]};return db[_0xd866('0x53')]['count'](_0x585a86)[_0xd866('0x1e')](function(_0x4135ce){_0x58afa9[_0xd866('0x30')]=_0x4135ce;if(_0x43c7ab[_0xd866('0x44')][_0xd866('0x54')]){_0x3e9143['include']=[{'all':!![]}];}return db[_0xd866('0x53')][_0xd866('0x55')](_0x3e9143);})[_0xd866('0x1e')](function(_0x506977){_0x58afa9[_0xd866('0x56')]=_0x506977;return _0x58afa9;})[_0xd866('0x1e')](respondWithFilteredResult(_0x1087e9,_0x3e9143))[_0xd866('0x28')](handleError(_0x1087e9,null));};exports['show']=function(_0x1b0bd0,_0x2c34fa){var _0x504bc9={'raw':![],'where':{'id':_0x1b0bd0[_0xd866('0x57')]['id']}},_0x35d7ac={};_0x35d7ac[_0xd866('0x43')]=_[_0xd866('0x58')](db['VoiceContext']['rawAttributes']);_0x35d7ac[_0xd866('0x44')]=_[_0xd866('0x58')](_0x1b0bd0[_0xd866('0x44')]);_0x35d7ac['filters']=_[_0xd866('0x46')](_0x35d7ac[_0xd866('0x43')],_0x35d7ac['query']);_0x504bc9[_0xd866('0x47')]=_[_0xd866('0x46')](_0x35d7ac[_0xd866('0x43')],qs[_0xd866('0x48')](_0x1b0bd0[_0xd866('0x44')]['fields']));_0x504bc9[_0xd866('0x47')]=_0x504bc9[_0xd866('0x47')]['length']?_0x504bc9[_0xd866('0x47')]:_0x35d7ac['model'];if(_0x1b0bd0[_0xd866('0x44')][_0xd866('0x54')]){_0x504bc9[_0xd866('0x59')]=[{'all':!![]}];}_0x504bc9=_[_0xd866('0x50')]({},_0x504bc9,_0x1b0bd0['options']);return db[_0xd866('0x53')][_0xd866('0x5a')](_0x504bc9)[_0xd866('0x1e')](handleEntityNotFound(_0x2c34fa,null))[_0xd866('0x1e')](respondWithResult(_0x2c34fa,null))['catch'](handleError(_0x2c34fa,null));};exports[_0xd866('0x5b')]=function(_0x34e1b0,_0x43e5bf,_0xb8bbba){var _0x152ee2;return db[_0xd866('0x53')]['create'](_0x34e1b0[_0xd866('0x5c')],{'raw':!![]})[_0xd866('0x1e')](function(_0x1fde1b){_0x152ee2=_0x1fde1b;return db[_0xd866('0x53')][_0xd866('0x55')]({'raw':!![]});})[_0xd866('0x1e')](function(_0x5b8527){var _0x19b945=fs['readFileSync'](path[_0xd866('0x5d')](config[_0xd866('0x5e')],_0xd866('0x5f')),'utf8');var _0x74bbab=ejs[_0xd866('0x60')](_0x19b945,{'contexts':_0x5b8527||[]});fs[_0xd866('0x61')](_0xd866('0x62'),_0x74bbab);})[_0xd866('0x1e')](function(){return respondWithRpcPromise('Reload',_0xd866('0x5b'),{'module':_0xd866('0x63')});})[_0xd866('0x1e')](function(){var _0x54026f=_0x34e1b0[_0xd866('0x64')][_0xd866('0x38')]({'plain':!![]});if(!_0x54026f)throw new Error(_0xd866('0x65'));if(_0x54026f['role']==='user'){var _0x4a3d0e=_0x152ee2['get']({'plain':!![]});return db['UserProfileSection'][_0xd866('0x5a')]({'where':{'name':_0xd866('0x39'),'userProfileId':_0x54026f['userProfileId']},'raw':!![]})[_0xd866('0x1e')](function(_0x3c5e2b){if(_0x3c5e2b&&_0x3c5e2b[_0xd866('0x66')]===0x0){return db[_0xd866('0x3a')]['create']({'name':_0x4a3d0e[_0xd866('0x3c')],'resourceId':_0x4a3d0e['id'],'type':_0x3c5e2b[_0xd866('0x3c')],'sectionId':_0x3c5e2b['id']},{})[_0xd866('0x1e')](function(){return _0x152ee2;});}else{return _0x152ee2;}})[_0xd866('0x28')](function(_0x575500){logger[_0xd866('0x23')](_0xd866('0x67'),_0x575500);throw _0x575500;});}return _0x152ee2;})['then'](respondWithResult(_0x43e5bf,0xc9))[_0xd866('0x28')](handleError(_0x43e5bf,null));};exports[_0xd866('0x36')]=function(_0xd97dca,_0x280597,_0x48eb55){var _0x2da503;return db['VoiceContext']['find']({'where':{'id':_0xd97dca[_0xd866('0x57')]['id']}})[_0xd866('0x1e')](handleEntityNotFound(_0x280597,null))[_0xd866('0x1e')](saveUpdates(_0xd97dca[_0xd866('0x5c')],null))[_0xd866('0x1e')](function(_0xddca8d){if(_0xddca8d){_0x2da503=_0xddca8d;return db[_0xd866('0x53')][_0xd866('0x55')]({'raw':!![]});}})[_0xd866('0x1e')](function(_0x31ebe6){var _0x3c971d=fs[_0xd866('0x68')](path[_0xd866('0x5d')](config[_0xd866('0x5e')],_0xd866('0x5f')),_0xd866('0x69'));var _0x491cd5=ejs['render'](_0x3c971d,{'contexts':_0x31ebe6||[]});fs['writeFileSync'](_0xd866('0x62'),_0x491cd5);})[_0xd866('0x1e')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xd866('0x63')});})[_0xd866('0x1e')](function(){return _0x2da503;})[_0xd866('0x1e')](respondWithResult(_0x280597,null))[_0xd866('0x28')](handleError(_0x280597,null));};exports['destroy']=function(_0x68007f,_0x249b16,_0x5c7e98){var _0x1ce7d8;return db[_0xd866('0x53')][_0xd866('0x5a')]({'where':{'id':_0x68007f['params']['id']}})[_0xd866('0x1e')](handleEntityNotFound(_0x249b16,null))[_0xd866('0x1e')](removeEntity(_0x249b16,null))['then'](function(){return db[_0xd866('0x53')][_0xd866('0x55')]({'raw':!![]});})[_0xd866('0x1e')](function(_0x31e71c){var _0x287adb=fs[_0xd866('0x68')](path[_0xd866('0x5d')](config[_0xd866('0x5e')],_0xd866('0x5f')),'utf8');var _0x409f52=ejs[_0xd866('0x60')](_0x287adb,{'contexts':_0x31e71c});fs[_0xd866('0x61')](_0xd866('0x62'),_0x409f52);return respondWithRpcPromise(_0xd866('0x6a'),'destroy',{'module':_0xd866('0x63')});})[_0xd866('0x28')](handleError(_0x249b16,null));}; \ No newline at end of file +var _0x3f8a=['map','VoiceContext','rawAttributes','fieldName','type','model','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','include','rows','show','params','keys','find','create','body','findAll','readFileSync','join','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','render','rimraf','zip-dir','fast-json-patch','moment','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','undefined','limit','count','json','apply','reject','save','update','destroy','get','Contexts','end','sendStatus','stack','name','send'];(function(_0x2fc20d,_0x28357f){var _0x3c1824=function(_0x248334){while(--_0x248334){_0x2fc20d['push'](_0x2fc20d['shift']());}};_0x3c1824(++_0x28357f);}(_0x3f8a,0x8e));var _0xa3f8=function(_0x4609a1,_0x482de8){_0x4609a1=_0x4609a1-0x0;var _0x27f7b1=_0x3f8a[_0x4609a1];return _0x27f7b1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa3f8('0x0'));var zipdir=require(_0xa3f8('0x1'));var jsonpatch=require(_0xa3f8('0x2'));var rp=require('request-promise');var moment=require(_0xa3f8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa3f8('0x4'));var util=require(_0xa3f8('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xa3f8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa3f8('0x7'));var _=require('lodash');var squel=require(_0xa3f8('0x8'));var crypto=require(_0xa3f8('0x9'));var jsforce=require(_0xa3f8('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xa3f8('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa3f8('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xa3f8('0xc'));var as=require(_0xa3f8('0xd'));var hardwareService=require(_0xa3f8('0xe'));var logger=require(_0xa3f8('0xf'))(_0xa3f8('0x10'));var utils=require(_0xa3f8('0x11'));var config=require(_0xa3f8('0x12'));var licenseUtil=require(_0xa3f8('0x13'));var db=require(_0xa3f8('0x14'))['db'];var jayson=require(_0xa3f8('0x15'));var client=jayson[_0xa3f8('0x16')][_0xa3f8('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x22e312,_0x1946e7,_0x505e24,_0x32b2e4){return new BPromise(function(_0x51d1dd,_0x25e3d7){var _0x2e4392=_0x32b2e4||client;return _0x2e4392[_0xa3f8('0x18')](_0x22e312,_0x505e24)[_0xa3f8('0x19')](function(_0x5388e9){logger[_0xa3f8('0x1a')](_0xa3f8('0x1b'),_0x1946e7,'request\x20sent');logger['debug'](_0xa3f8('0x1c'),_0x1946e7,'request\x20sent',JSON[_0xa3f8('0x1d')](_0x5388e9));if(_0x5388e9[_0xa3f8('0x1e')]){if(_0x5388e9[_0xa3f8('0x1e')][_0xa3f8('0x1f')]===0x1f4){logger[_0xa3f8('0x1e')](_0xa3f8('0x1b'),_0x1946e7,_0x5388e9[_0xa3f8('0x1e')][_0xa3f8('0x20')]);return _0x25e3d7(_0x5388e9[_0xa3f8('0x1e')][_0xa3f8('0x20')]);}logger[_0xa3f8('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x1946e7,_0x5388e9['error'][_0xa3f8('0x20')]);return _0x51d1dd(_0x5388e9['error'][_0xa3f8('0x20')]);}else{logger[_0xa3f8('0x1a')](_0xa3f8('0x1b'),_0x1946e7,'request\x20sent');_0x51d1dd(_0x5388e9['result']['message']);}})[_0xa3f8('0x21')](function(_0x4e21c0){logger[_0xa3f8('0x1e')](_0xa3f8('0x1b'),_0x1946e7,_0x4e21c0);_0x25e3d7(_0x4e21c0);});});}function respondWithStatusCode(_0x9a1457,_0x5e90fd){_0x5e90fd=_0x5e90fd||0xcc;return function(_0x484a83){if(_0x484a83){return _0x9a1457['sendStatus'](_0x5e90fd);}return _0x9a1457['status'](_0x5e90fd)['end']();};}function respondWithResult(_0x60a32,_0x2daebe){_0x2daebe=_0x2daebe||0xc8;return function(_0x1e52ab){if(_0x1e52ab){return _0x60a32[_0xa3f8('0x22')](_0x2daebe)['json'](_0x1e52ab);}};}function respondWithFilteredResult(_0x4b49ee,_0xdea477){return function(_0x68d804){if(_0x68d804){var _0x527491=typeof _0xdea477[_0xa3f8('0x23')]===_0xa3f8('0x24')&&typeof _0xdea477[_0xa3f8('0x25')]===_0xa3f8('0x24');var _0x268d10=_0x68d804[_0xa3f8('0x26')];var _0x428c91=_0x527491?0x0:_0xdea477[_0xa3f8('0x23')];var _0x2b4cdf=_0x527491?_0x68d804['count']:_0xdea477[_0xa3f8('0x23')]+_0xdea477['limit'];var _0x173bb6;if(_0x2b4cdf>=_0x268d10){_0x2b4cdf=_0x268d10;_0x173bb6=0xc8;}else{_0x173bb6=0xce;}_0x4b49ee[_0xa3f8('0x22')](_0x173bb6);return _0x4b49ee['set']('Content-Range',_0x428c91+'-'+_0x2b4cdf+'/'+_0x268d10)[_0xa3f8('0x27')](_0x68d804);}return null;};}function patchUpdates(_0x45843f){return function(_0xf6e78f){try{jsonpatch[_0xa3f8('0x28')](_0xf6e78f,_0x45843f,!![]);}catch(_0x34d059){return BPromise[_0xa3f8('0x29')](_0x34d059);}return _0xf6e78f[_0xa3f8('0x2a')]();};}function saveUpdates(_0x14c7e6,_0x34e6a1){return function(_0x421fe0){if(_0x421fe0){return _0x421fe0[_0xa3f8('0x2b')](_0x14c7e6)[_0xa3f8('0x19')](function(_0x4e82d4){return _0x4e82d4;});}return null;};}function removeEntity(_0x53eb81,_0xfc07fd){return function(_0x2d5ce2){if(_0x2d5ce2){return _0x2d5ce2[_0xa3f8('0x2c')]()[_0xa3f8('0x19')](function(){var _0x2d33c4=_0x2d5ce2[_0xa3f8('0x2d')]({'plain':!![]});var _0x5ae314=_0xa3f8('0x2e');return db['UserProfileResource'][_0xa3f8('0x2c')]({'where':{'type':_0x5ae314,'resourceId':_0x2d33c4['id']}})[_0xa3f8('0x19')](function(){return _0x2d5ce2;});})[_0xa3f8('0x19')](function(){_0x53eb81[_0xa3f8('0x22')](0xcc)[_0xa3f8('0x2f')]();});}};}function handleEntityNotFound(_0x10ca15,_0x28cc2c){return function(_0x3ee1a1){if(!_0x3ee1a1){_0x10ca15[_0xa3f8('0x30')](0x194);}return _0x3ee1a1;};}function handleError(_0x2de5c4,_0x514d68){_0x514d68=_0x514d68||0x1f4;return function(_0x167fe7){logger[_0xa3f8('0x1e')](_0x167fe7[_0xa3f8('0x31')]);if(_0x167fe7[_0xa3f8('0x32')]){delete _0x167fe7['name'];}_0x2de5c4[_0xa3f8('0x22')](_0x514d68)[_0xa3f8('0x33')](_0x167fe7);};}exports['index']=function(_0x2da9f7,_0x49281e){var _0x1f189e={},_0x495bca={},_0x1394ce={'count':0x0,'rows':[]};var _0x57ce53=_[_0xa3f8('0x34')](db[_0xa3f8('0x35')][_0xa3f8('0x36')],function(_0x2fb604){return{'name':_0x2fb604[_0xa3f8('0x37')],'type':_0x2fb604[_0xa3f8('0x38')]['key']};});_0x495bca[_0xa3f8('0x39')]=_[_0xa3f8('0x34')](_0x57ce53,_0xa3f8('0x32'));_0x495bca['query']=_['keys'](_0x2da9f7['query']);_0x495bca[_0xa3f8('0x3a')]=_[_0xa3f8('0x3b')](_0x495bca[_0xa3f8('0x39')],_0x495bca[_0xa3f8('0x3c')]);_0x1f189e[_0xa3f8('0x3d')]=_['intersection'](_0x495bca[_0xa3f8('0x39')],qs[_0xa3f8('0x3e')](_0x2da9f7['query'][_0xa3f8('0x3e')]));_0x1f189e[_0xa3f8('0x3d')]=_0x1f189e['attributes'][_0xa3f8('0x3f')]?_0x1f189e[_0xa3f8('0x3d')]:_0x495bca[_0xa3f8('0x39')];if(!_0x2da9f7[_0xa3f8('0x3c')][_0xa3f8('0x40')](_0xa3f8('0x41'))){_0x1f189e['limit']=qs[_0xa3f8('0x25')](_0x2da9f7[_0xa3f8('0x3c')][_0xa3f8('0x25')]);_0x1f189e['offset']=qs[_0xa3f8('0x23')](_0x2da9f7[_0xa3f8('0x3c')][_0xa3f8('0x23')]);}_0x1f189e['order']=qs[_0xa3f8('0x42')](_0x2da9f7[_0xa3f8('0x3c')][_0xa3f8('0x42')]);_0x1f189e['where']=qs[_0xa3f8('0x3a')](_[_0xa3f8('0x43')](_0x2da9f7[_0xa3f8('0x3c')],_0x495bca[_0xa3f8('0x3a')]),_0x57ce53);if(_0x2da9f7[_0xa3f8('0x3c')][_0xa3f8('0x44')]){_0x1f189e[_0xa3f8('0x45')]=_[_0xa3f8('0x46')](_0x1f189e[_0xa3f8('0x45')],{'$or':_[_0xa3f8('0x34')](_0x57ce53,function(_0x38f3d5){if(_0x38f3d5[_0xa3f8('0x38')]!=='VIRTUAL'){var _0x34e643={};_0x34e643[_0x38f3d5[_0xa3f8('0x32')]]={'$like':'%'+_0x2da9f7[_0xa3f8('0x3c')][_0xa3f8('0x44')]+'%'};return _0x34e643;}})});}_0x1f189e=_['merge']({},_0x1f189e,_0x2da9f7[_0xa3f8('0x47')]);var _0x4a2114={'where':_0x1f189e[_0xa3f8('0x45')]};return db[_0xa3f8('0x35')][_0xa3f8('0x26')](_0x4a2114)['then'](function(_0x5a2168){_0x1394ce[_0xa3f8('0x26')]=_0x5a2168;if(_0x2da9f7[_0xa3f8('0x3c')]['includeAll']){_0x1f189e[_0xa3f8('0x48')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x1f189e);})[_0xa3f8('0x19')](function(_0x24ab99){_0x1394ce[_0xa3f8('0x49')]=_0x24ab99;return _0x1394ce;})[_0xa3f8('0x19')](respondWithFilteredResult(_0x49281e,_0x1f189e))['catch'](handleError(_0x49281e,null));};exports[_0xa3f8('0x4a')]=function(_0x41d3c4,_0x211cce){var _0x1db19d={'raw':![],'where':{'id':_0x41d3c4[_0xa3f8('0x4b')]['id']}},_0x40c4fc={};_0x40c4fc[_0xa3f8('0x39')]=_[_0xa3f8('0x4c')](db['VoiceContext'][_0xa3f8('0x36')]);_0x40c4fc[_0xa3f8('0x3c')]=_['keys'](_0x41d3c4[_0xa3f8('0x3c')]);_0x40c4fc[_0xa3f8('0x3a')]=_[_0xa3f8('0x3b')](_0x40c4fc['model'],_0x40c4fc[_0xa3f8('0x3c')]);_0x1db19d[_0xa3f8('0x3d')]=_['intersection'](_0x40c4fc[_0xa3f8('0x39')],qs[_0xa3f8('0x3e')](_0x41d3c4['query'][_0xa3f8('0x3e')]));_0x1db19d[_0xa3f8('0x3d')]=_0x1db19d[_0xa3f8('0x3d')][_0xa3f8('0x3f')]?_0x1db19d[_0xa3f8('0x3d')]:_0x40c4fc['model'];if(_0x41d3c4[_0xa3f8('0x3c')]['includeAll']){_0x1db19d[_0xa3f8('0x48')]=[{'all':!![]}];}_0x1db19d=_['merge']({},_0x1db19d,_0x41d3c4[_0xa3f8('0x47')]);return db[_0xa3f8('0x35')][_0xa3f8('0x4d')](_0x1db19d)[_0xa3f8('0x19')](handleEntityNotFound(_0x211cce,null))[_0xa3f8('0x19')](respondWithResult(_0x211cce,null))['catch'](handleError(_0x211cce,null));};exports['create']=function(_0x5972d4,_0x543fd8,_0x267750){var _0x55d84f;return db['VoiceContext'][_0xa3f8('0x4e')](_0x5972d4[_0xa3f8('0x4f')],{'raw':!![]})[_0xa3f8('0x19')](function(_0x540b39){_0x55d84f=_0x540b39;return db[_0xa3f8('0x35')][_0xa3f8('0x50')]({'raw':!![]});})[_0xa3f8('0x19')](function(_0x2dc06d){var _0x3c9652=fs[_0xa3f8('0x51')](path[_0xa3f8('0x52')](config['root'],_0xa3f8('0x53')),_0xa3f8('0x54'));var _0x985f05=ejs['render'](_0x3c9652,{'contexts':_0x2dc06d||[]});fs[_0xa3f8('0x55')](_0xa3f8('0x56'),_0x985f05);})['then'](function(){return respondWithRpcPromise(_0xa3f8('0x57'),_0xa3f8('0x4e'),{'module':_0xa3f8('0x58')});})[_0xa3f8('0x19')](function(){var _0x2bd8fc=_0x5972d4[_0xa3f8('0x59')][_0xa3f8('0x2d')]({'plain':!![]});if(!_0x2bd8fc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2bd8fc[_0xa3f8('0x5a')]==='user'){var _0x108d75=_0x55d84f['get']({'plain':!![]});return db[_0xa3f8('0x5b')]['find']({'where':{'name':_0xa3f8('0x2e'),'userProfileId':_0x2bd8fc[_0xa3f8('0x5c')]},'raw':!![]})['then'](function(_0x567fae){if(_0x567fae&&_0x567fae['autoAssociation']===0x0){return db[_0xa3f8('0x5d')][_0xa3f8('0x4e')]({'name':_0x108d75[_0xa3f8('0x32')],'resourceId':_0x108d75['id'],'type':_0x567fae['name'],'sectionId':_0x567fae['id']},{})['then'](function(){return _0x55d84f;});}else{return _0x55d84f;}})[_0xa3f8('0x21')](function(_0x138421){logger['error'](_0xa3f8('0x5e'),_0x138421);throw _0x138421;});}return _0x55d84f;})[_0xa3f8('0x19')](respondWithResult(_0x543fd8,0xc9))[_0xa3f8('0x21')](handleError(_0x543fd8,null));};exports[_0xa3f8('0x2b')]=function(_0x5aa0e7,_0x2af785,_0x169661){var _0x322a61;return db[_0xa3f8('0x35')]['find']({'where':{'id':_0x5aa0e7[_0xa3f8('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2af785,null))[_0xa3f8('0x19')](saveUpdates(_0x5aa0e7['body'],null))['then'](function(_0x30474d){if(_0x30474d){_0x322a61=_0x30474d;return db['VoiceContext'][_0xa3f8('0x50')]({'raw':!![]});}})[_0xa3f8('0x19')](function(_0x239f26){var _0x9ae03c=fs[_0xa3f8('0x51')](path[_0xa3f8('0x52')](config[_0xa3f8('0x5f')],_0xa3f8('0x53')),'utf8');var _0xe083cb=ejs[_0xa3f8('0x60')](_0x9ae03c,{'contexts':_0x239f26||[]});fs[_0xa3f8('0x55')](_0xa3f8('0x56'),_0xe083cb);})[_0xa3f8('0x19')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xa3f8('0x58')});})['then'](function(){return _0x322a61;})[_0xa3f8('0x19')](respondWithResult(_0x2af785,null))[_0xa3f8('0x21')](handleError(_0x2af785,null));};exports[_0xa3f8('0x2c')]=function(_0xfb6546,_0x2c804b,_0x283442){var _0x4d958b;return db[_0xa3f8('0x35')]['find']({'where':{'id':_0xfb6546[_0xa3f8('0x4b')]['id']}})[_0xa3f8('0x19')](handleEntityNotFound(_0x2c804b,null))[_0xa3f8('0x19')](removeEntity(_0x2c804b,null))[_0xa3f8('0x19')](function(){return db[_0xa3f8('0x35')][_0xa3f8('0x50')]({'raw':!![]});})[_0xa3f8('0x19')](function(_0x58b80c){var _0x12cc5a=fs[_0xa3f8('0x51')](path[_0xa3f8('0x52')](config[_0xa3f8('0x5f')],_0xa3f8('0x53')),_0xa3f8('0x54'));var _0x26970a=ejs[_0xa3f8('0x60')](_0x12cc5a,{'contexts':_0x58b80c});fs[_0xa3f8('0x55')](_0xa3f8('0x56'),_0x26970a);return respondWithRpcPromise(_0xa3f8('0x57'),_0xa3f8('0x2c'),{'module':'chan_sip.so'});})[_0xa3f8('0x21')](handleError(_0x2c804b,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 4a8a152..8ba5d82 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 _0x9a1b=['voice_contexts','lodash','moment','bluebird','request-promise','path','../../config/environment','./voiceContext.attributes','define'];(function(_0x77773a,_0x5a7026){var _0x1091a2=function(_0x276af5){while(--_0x276af5){_0x77773a['push'](_0x77773a['shift']());}};_0x1091a2(++_0x5a7026);}(_0x9a1b,0x1ba));var _0xb9a1=function(_0x51b183,_0x250306){_0x51b183=_0x51b183-0x0;var _0x5c998b=_0x9a1b[_0x51b183];return _0x5c998b;};'use strict';var _=require(_0xb9a1('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb9a1('0x1'));var BPromise=require(_0xb9a1('0x2'));var rp=require(_0xb9a1('0x3'));var fs=require('fs');var path=require(_0xb9a1('0x4'));var rimraf=require('rimraf');var config=require(_0xb9a1('0x5'));var attributes=require(_0xb9a1('0x6'));module['exports']=function(_0x69b74e,_0x455fac){return _0x69b74e[_0xb9a1('0x7')]('VoiceContext',attributes,{'tableName':_0xb9a1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ec8=['moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','util','api'];(function(_0x479dce,_0x4dce8b){var _0x320557=function(_0x130d44){while(--_0x130d44){_0x479dce['push'](_0x479dce['shift']());}};_0x320557(++_0x4dce8b);}(_0x6ec8,0x18a));var _0x86ec=function(_0x3ce2c4,_0x4544c1){_0x3ce2c4=_0x3ce2c4-0x0;var _0x4047c1=_0x6ec8[_0x3ce2c4];return _0x4047c1;};'use strict';var _=require('lodash');var util=require(_0x86ec('0x0'));var logger=require('../../config/logger')(_0x86ec('0x1'));var moment=require(_0x86ec('0x2'));var BPromise=require(_0x86ec('0x3'));var rp=require(_0x86ec('0x4'));var fs=require('fs');var path=require(_0x86ec('0x5'));var rimraf=require(_0x86ec('0x6'));var config=require('../../config/environment');var attributes=require(_0x86ec('0x7'));module[_0x86ec('0x8')]=function(_0x1091da,_0x2c4e9d){return _0x1091da['define']('VoiceContext',attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 6f404df..d1551cf 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 _0x95aa=['jayson/promise','client','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x95aa,0x91));var _0xa95a=function(_0x2f32c4,_0x531dc6){_0x2f32c4=_0x2f32c4-0x0;var _0x3f3018=_0x95aa[_0x2f32c4];return _0x3f3018;};'use strict';var _=require(_0xa95a('0x0'));var util=require('util');var moment=require(_0xa95a('0x1'));var BPromise=require(_0xa95a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa95a('0x3'));var db=require(_0xa95a('0x4'))['db'];var utils=require(_0xa95a('0x5'));var logger=require(_0xa95a('0x6'))(_0xa95a('0x7'));var config=require(_0xa95a('0x8'));var jayson=require(_0xa95a('0x9'));var client=jayson[_0xa95a('0xa')][_0xa95a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ae8e0,_0x17749a,_0x4e550d){return new BPromise(function(_0x183558,_0x204630){return client['request'](_0x5ae8e0,_0x4e550d)['then'](function(_0x2f6dab){logger[_0xa95a('0xc')](_0xa95a('0xd'),_0x17749a,_0xa95a('0xe'));logger[_0xa95a('0xf')](_0xa95a('0x10'),_0x17749a,_0xa95a('0xe'),JSON[_0xa95a('0x11')](_0x2f6dab));if(_0x2f6dab[_0xa95a('0x12')]){if(_0x2f6dab[_0xa95a('0x12')][_0xa95a('0x13')]===0x1f4){logger['error']('VoiceContext,\x20%s,\x20%s',_0x17749a,_0x2f6dab[_0xa95a('0x12')]['message']);return _0x204630(_0x2f6dab[_0xa95a('0x12')][_0xa95a('0x14')]);}logger[_0xa95a('0x12')](_0xa95a('0xd'),_0x17749a,_0x2f6dab[_0xa95a('0x12')][_0xa95a('0x14')]);return _0x183558(_0x2f6dab[_0xa95a('0x12')][_0xa95a('0x14')]);}else{logger[_0xa95a('0xc')](_0xa95a('0xd'),_0x17749a,'request\x20sent');_0x183558(_0x2f6dab[_0xa95a('0x15')][_0xa95a('0x14')]);}})['catch'](function(_0x27608c){logger[_0xa95a('0x12')](_0xa95a('0xd'),_0x17749a,_0x27608c);_0x204630(_0x27608c);});});} \ No newline at end of file +var _0xb627=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xb627,0x144));var _0x7b62=function(_0x55e28f,_0x20cedb){_0x55e28f=_0x55e28f-0x0;var _0xee48e9=_0xb627[_0x55e28f];return _0xee48e9;};'use strict';var _=require(_0x7b62('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7b62('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b62('0x2'));var db=require(_0x7b62('0x3'))['db'];var utils=require(_0x7b62('0x4'));var logger=require(_0x7b62('0x5'))(_0x7b62('0x6'));var config=require(_0x7b62('0x7'));var jayson=require(_0x7b62('0x8'));var client=jayson['client'][_0x7b62('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547533,_0x387d76,_0x264cfa){return new BPromise(function(_0x4ae3ef,_0x30652e){return client['request'](_0x547533,_0x264cfa)[_0x7b62('0xa')](function(_0x379d07){logger[_0x7b62('0xb')]('VoiceContext,\x20%s,\x20%s',_0x387d76,_0x7b62('0xc'));logger[_0x7b62('0xd')](_0x7b62('0xe'),_0x387d76,_0x7b62('0xc'),JSON[_0x7b62('0xf')](_0x379d07));if(_0x379d07[_0x7b62('0x10')]){if(_0x379d07[_0x7b62('0x10')][_0x7b62('0x11')]===0x1f4){logger[_0x7b62('0x10')](_0x7b62('0x12'),_0x387d76,_0x379d07[_0x7b62('0x10')][_0x7b62('0x13')]);return _0x30652e(_0x379d07[_0x7b62('0x10')]['message']);}logger[_0x7b62('0x10')]('VoiceContext,\x20%s,\x20%s',_0x387d76,_0x379d07[_0x7b62('0x10')]['message']);return _0x4ae3ef(_0x379d07[_0x7b62('0x10')]['message']);}else{logger['info'](_0x7b62('0x12'),_0x387d76,'request\x20sent');_0x4ae3ef(_0x379d07[_0x7b62('0x14')][_0x7b62('0x13')]);}})[_0x7b62('0x15')](function(_0x4ebaa2){logger[_0x7b62('0x10')]('VoiceContext,\x20%s,\x20%s',_0x387d76,_0x4ebaa2);_0x30652e(_0x4ebaa2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 9e244b7..4f57258 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 _0x9205=['connect-timeout','express','Router','index','/describe','isAuthenticated','describe','get','/:id','show','create','update','exports','multer','util','path'];(function(_0x4a9aef,_0x1a28ae){var _0x12058a=function(_0xe6b7ae){while(--_0xe6b7ae){_0x4a9aef['push'](_0x4a9aef['shift']());}};_0x12058a(++_0x1a28ae);}(_0x9205,0x14d));var _0x5920=function(_0x22a9fc,_0x412267){_0x22a9fc=_0x22a9fc-0x0;var _0x15acd0=_0x9205[_0x22a9fc];return _0x15acd0;};'use strict';var multer=require(_0x5920('0x0'));var util=require(_0x5920('0x1'));var path=require(_0x5920('0x2'));var timeout=require(_0x5920('0x3'));var express=require(_0x5920('0x4'));var router=express[_0x5920('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceDialReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x5920('0x6')]);router['get'](_0x5920('0x7'),auth[_0x5920('0x8')](),controller[_0x5920('0x9')]);router[_0x5920('0xa')](_0x5920('0xb'),auth[_0x5920('0x8')](),controller[_0x5920('0xc')]);router['post']('/',auth[_0x5920('0x8')](),controller[_0x5920('0xd')]);router['put'](_0x5920('0xb'),auth[_0x5920('0x8')](),controller[_0x5920('0xe')]);router['delete'](_0x5920('0xb'),auth[_0x5920('0x8')](),controller['destroy']);module[_0x5920('0xf')]=router; \ No newline at end of file +var _0x0404=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','/:id','isAuthenticated','post','create','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1953a0,_0x26009c){var _0x285391=function(_0x5771aa){while(--_0x5771aa){_0x1953a0['push'](_0x1953a0['shift']());}};_0x285391(++_0x26009c);}(_0x0404,0xf4));var _0x4040=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x0404[_0x50e40b];return _0x2608b7;};'use strict';var multer=require('multer');var util=require(_0x4040('0x0'));var path=require(_0x4040('0x1'));var timeout=require(_0x4040('0x2'));var express=require(_0x4040('0x3'));var router=express[_0x4040('0x4')]();var fs_extra=require(_0x4040('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4040('0x6'));var config=require(_0x4040('0x7'));var controller=require(_0x4040('0x8'));router[_0x4040('0x9')]('/',auth['isAuthenticated'](),controller[_0x4040('0xa')]);router['get'](_0x4040('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x4040('0x9')](_0x4040('0xc'),auth[_0x4040('0xd')](),controller['show']);router[_0x4040('0xe')]('/',auth[_0x4040('0xd')](),controller[_0x4040('0xf')]);router['put'](_0x4040('0xc'),auth[_0x4040('0xd')](),controller['update']);router[_0x4040('0x10')](_0x4040('0xc'),auth['isAuthenticated'](),controller[_0x4040('0x11')]);module[_0x4040('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 69b8c36..e4d813a 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 _0x425d=['sequelize','STRING','INTEGER','DATE'];(function(_0x62dee8,_0x30be5c){var _0x45c46c=function(_0x1b2c8d){while(--_0x1b2c8d){_0x62dee8['push'](_0x62dee8['shift']());}};_0x45c46c(++_0x30be5c);}(_0x425d,0x1e0));var _0xd425=function(_0xcc47fe,_0x429b15){_0xcc47fe=_0xcc47fe-0x0;var _0x17db06=_0x425d[_0xcc47fe];return _0x17db06;};'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 +var _0x00bb=['STRING','INTEGER','DATE','called,connect,complete','sequelize','exports'];(function(_0x144313,_0x3f7fdc){var _0xc90cf=function(_0xc80fe8){while(--_0xc80fe8){_0x144313['push'](_0x144313['shift']());}};_0xc90cf(++_0x3f7fdc);}(_0x00bb,0x1d8));var _0xb00b=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x00bb[_0x30ae5e];return _0x1f2e93;};'use strict';var Sequelize=require(_0xb00b('0x0'));module[_0xb00b('0x1')]={'privilege':{'type':Sequelize[_0xb00b('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xb00b('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xb00b('0x2')]},'calleridname':{'type':Sequelize[_0xb00b('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'language':{'type':Sequelize[_0xb00b('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb00b('0x3')]},'uniqueid':{'type':Sequelize[_0xb00b('0x2')]},'linkedid':{'type':Sequelize[_0xb00b('0x2')]},'destchannel':{'type':Sequelize[_0xb00b('0x2')]},'destchannelstate':{'type':Sequelize[_0xb00b('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xb00b('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xb00b('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xb00b('0x2')]},'destlanguage':{'type':Sequelize[_0xb00b('0x2')]},'destaccountcode':{'type':Sequelize[_0xb00b('0x2')]},'destcontext':{'type':Sequelize[_0xb00b('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0xb00b('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize[_0xb00b('0x2')]},'starttime':{'type':Sequelize[_0xb00b('0x4')]},'answertime':{'type':Sequelize[_0xb00b('0x4')]},'endtime':{'type':Sequelize[_0xb00b('0x4')]},'lastevent':{'type':Sequelize[_0xb00b('0x2')],'comment':_0xb00b('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xb00b('0x3')]},'holdtime':{'type':Sequelize[_0xb00b('0x3')]},'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 c6893c9..fa39fd3 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 _0xe459=['nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','catch','params','fields','length','find','create','body','destroy','describe','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','offset','limit','status','set','json','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','VoiceDialReport','rawAttributes','fieldName','type','model','map','query','keys','intersection','attributes','hasOwnProperty'];(function(_0x465d51,_0x479425){var _0x530306=function(_0x1eb19a){while(--_0x1eb19a){_0x465d51['push'](_0x465d51['shift']());}};_0x530306(++_0x479425);}(_0xe459,0xa5));var _0x9e45=function(_0x27d225,_0x74e675){_0x27d225=_0x27d225-0x0;var _0x16e019=_0xe459[_0x27d225];return _0x16e019;};'use strict';var emlformat=require(_0x9e45('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9e45('0x1'));var moment=require(_0x9e45('0x2'));var BPromise=require(_0x9e45('0x3'));var Mustache=require(_0x9e45('0x4'));var util=require(_0x9e45('0x5'));var path=require(_0x9e45('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e45('0x7'));var fs=require('fs');var fs_extra=require(_0x9e45('0x8'));var _=require(_0x9e45('0x9'));var squel=require(_0x9e45('0xa'));var crypto=require('crypto');var jsforce=require(_0x9e45('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9e45('0xc'));var Papa=require(_0x9e45('0xd'));var Redis=require(_0x9e45('0xe'));var authService=require(_0x9e45('0xf'));var qs=require(_0x9e45('0x10'));var as=require(_0x9e45('0x11'));var hardwareService=require(_0x9e45('0x12'));var logger=require(_0x9e45('0x13'))(_0x9e45('0x14'));var utils=require(_0x9e45('0x15'));var config=require(_0x9e45('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9e45('0x17'))['db'];function respondWithStatusCode(_0x37b533,_0xfe763f){_0xfe763f=_0xfe763f||0xcc;return function(_0x2a5aa0){if(_0x2a5aa0){return _0x37b533['sendStatus'](_0xfe763f);}return _0x37b533['status'](_0xfe763f)['end']();};}function respondWithResult(_0x1b56a6,_0x441f0a){_0x441f0a=_0x441f0a||0xc8;return function(_0x3c4bbe){if(_0x3c4bbe){return _0x1b56a6['status'](_0x441f0a)['json'](_0x3c4bbe);}};}function respondWithFilteredResult(_0x46ec43,_0x37791e){return function(_0x419837){if(_0x419837){var _0xfc4050=typeof _0x37791e[_0x9e45('0x18')]==='undefined'&&typeof _0x37791e[_0x9e45('0x19')]==='undefined';var _0x3f22ed=_0x419837['count'];var _0x4c1fc7=_0xfc4050?0x0:_0x37791e['offset'];var _0x5eacc0=_0xfc4050?_0x419837['count']:_0x37791e[_0x9e45('0x18')]+_0x37791e[_0x9e45('0x19')];var _0x23f53c;if(_0x5eacc0>=_0x3f22ed){_0x5eacc0=_0x3f22ed;_0x23f53c=0xc8;}else{_0x23f53c=0xce;}_0x46ec43[_0x9e45('0x1a')](_0x23f53c);return _0x46ec43[_0x9e45('0x1b')]('Content-Range',_0x4c1fc7+'-'+_0x5eacc0+'/'+_0x3f22ed)[_0x9e45('0x1c')](_0x419837);}return null;};}function patchUpdates(_0x4f7c21){return function(_0x423e53){try{jsonpatch[_0x9e45('0x1d')](_0x423e53,_0x4f7c21,!![]);}catch(_0x1d7ce8){return BPromise[_0x9e45('0x1e')](_0x1d7ce8);}return _0x423e53[_0x9e45('0x1f')]();};}function saveUpdates(_0x47052d,_0x34a3d9){return function(_0x2f8b30){if(_0x2f8b30){return _0x2f8b30[_0x9e45('0x20')](_0x47052d)[_0x9e45('0x21')](function(_0x389fa1){return _0x389fa1;});}return null;};}function removeEntity(_0x3bd3d9,_0x2cc2d4){return function(_0x6cad24){if(_0x6cad24){return _0x6cad24['destroy']()[_0x9e45('0x21')](function(){_0x3bd3d9[_0x9e45('0x1a')](0xcc)[_0x9e45('0x22')]();});}};}function handleEntityNotFound(_0x2018d9,_0x540c7f){return function(_0x414fe0){if(!_0x414fe0){_0x2018d9[_0x9e45('0x23')](0x194);}return _0x414fe0;};}function handleError(_0x33ad33,_0x46ebe5){_0x46ebe5=_0x46ebe5||0x1f4;return function(_0x56d61e){logger[_0x9e45('0x24')](_0x56d61e[_0x9e45('0x25')]);if(_0x56d61e[_0x9e45('0x26')]){delete _0x56d61e[_0x9e45('0x26')];}_0x33ad33[_0x9e45('0x1a')](_0x46ebe5)[_0x9e45('0x27')](_0x56d61e);};}exports['index']=function(_0x44723d,_0x47b54c){var _0x2cb0d5={},_0x15df11={},_0x250c29={'count':0x0,'rows':[]};var _0x50f8fe=_['map'](db[_0x9e45('0x28')][_0x9e45('0x29')],function(_0x12611c){return{'name':_0x12611c[_0x9e45('0x2a')],'type':_0x12611c[_0x9e45('0x2b')]['key']};});_0x15df11[_0x9e45('0x2c')]=_[_0x9e45('0x2d')](_0x50f8fe,'name');_0x15df11[_0x9e45('0x2e')]=_[_0x9e45('0x2f')](_0x44723d[_0x9e45('0x2e')]);_0x15df11['filters']=_[_0x9e45('0x30')](_0x15df11['model'],_0x15df11['query']);_0x2cb0d5[_0x9e45('0x31')]=_[_0x9e45('0x30')](_0x15df11[_0x9e45('0x2c')],qs['fields'](_0x44723d[_0x9e45('0x2e')]['fields']));_0x2cb0d5[_0x9e45('0x31')]=_0x2cb0d5[_0x9e45('0x31')]['length']?_0x2cb0d5[_0x9e45('0x31')]:_0x15df11[_0x9e45('0x2c')];if(!_0x44723d[_0x9e45('0x2e')][_0x9e45('0x32')](_0x9e45('0x33'))){_0x2cb0d5['limit']=qs['limit'](_0x44723d['query']['limit']);_0x2cb0d5[_0x9e45('0x18')]=qs[_0x9e45('0x18')](_0x44723d[_0x9e45('0x2e')][_0x9e45('0x18')]);}_0x2cb0d5['order']=qs[_0x9e45('0x34')](_0x44723d[_0x9e45('0x2e')][_0x9e45('0x34')]);_0x2cb0d5[_0x9e45('0x35')]=qs[_0x9e45('0x36')](_[_0x9e45('0x37')](_0x44723d['query'],_0x15df11[_0x9e45('0x36')]),_0x50f8fe);if(_0x44723d[_0x9e45('0x2e')][_0x9e45('0x38')]){_0x2cb0d5[_0x9e45('0x35')]=_[_0x9e45('0x39')](_0x2cb0d5['where'],{'$or':_['map'](_0x50f8fe,function(_0x26e7a0){if(_0x26e7a0[_0x9e45('0x2b')]!==_0x9e45('0x3a')){var _0x2007bf={};_0x2007bf[_0x26e7a0[_0x9e45('0x26')]]={'$like':'%'+_0x44723d['query'][_0x9e45('0x38')]+'%'};return _0x2007bf;}})});}_0x2cb0d5=_['merge']({},_0x2cb0d5,_0x44723d[_0x9e45('0x3b')]);var _0x107a00={'where':_0x2cb0d5['where']};return db[_0x9e45('0x28')][_0x9e45('0x3c')](_0x107a00)[_0x9e45('0x21')](function(_0x698315){_0x250c29[_0x9e45('0x3c')]=_0x698315;if(_0x44723d[_0x9e45('0x2e')][_0x9e45('0x3d')]){_0x2cb0d5[_0x9e45('0x3e')]=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0x2cb0d5);})['then'](function(_0x1b57e9){_0x250c29['rows']=_0x1b57e9;return _0x250c29;})[_0x9e45('0x21')](respondWithFilteredResult(_0x47b54c,_0x2cb0d5))[_0x9e45('0x3f')](handleError(_0x47b54c,null));};exports['show']=function(_0x46f65c,_0x2810a3){var _0x4d036b={'raw':!![],'where':{'id':_0x46f65c[_0x9e45('0x40')]['id']}},_0x37c977={};_0x37c977[_0x9e45('0x2c')]=_[_0x9e45('0x2f')](db[_0x9e45('0x28')][_0x9e45('0x29')]);_0x37c977[_0x9e45('0x2e')]=_[_0x9e45('0x2f')](_0x46f65c['query']);_0x37c977[_0x9e45('0x36')]=_[_0x9e45('0x30')](_0x37c977[_0x9e45('0x2c')],_0x37c977[_0x9e45('0x2e')]);_0x4d036b[_0x9e45('0x31')]=_[_0x9e45('0x30')](_0x37c977[_0x9e45('0x2c')],qs['fields'](_0x46f65c[_0x9e45('0x2e')][_0x9e45('0x41')]));_0x4d036b[_0x9e45('0x31')]=_0x4d036b[_0x9e45('0x31')][_0x9e45('0x42')]?_0x4d036b[_0x9e45('0x31')]:_0x37c977[_0x9e45('0x2c')];if(_0x46f65c[_0x9e45('0x2e')]['includeAll']){_0x4d036b[_0x9e45('0x3e')]=[{'all':!![]}];}_0x4d036b=_[_0x9e45('0x39')]({},_0x4d036b,_0x46f65c[_0x9e45('0x3b')]);return db[_0x9e45('0x28')][_0x9e45('0x43')](_0x4d036b)[_0x9e45('0x21')](handleEntityNotFound(_0x2810a3,null))[_0x9e45('0x21')](respondWithResult(_0x2810a3,null))[_0x9e45('0x3f')](handleError(_0x2810a3,null));};exports[_0x9e45('0x44')]=function(_0xb38008,_0x1ef0dc){return db[_0x9e45('0x28')]['create'](_0xb38008[_0x9e45('0x45')],{})[_0x9e45('0x21')](respondWithResult(_0x1ef0dc,0xc9))[_0x9e45('0x3f')](handleError(_0x1ef0dc,null));};exports[_0x9e45('0x20')]=function(_0x55f617,_0x40fffb){if(_0x55f617[_0x9e45('0x45')]['id']){delete _0x55f617[_0x9e45('0x45')]['id'];}return db[_0x9e45('0x28')][_0x9e45('0x43')]({'where':{'id':_0x55f617[_0x9e45('0x40')]['id']}})[_0x9e45('0x21')](handleEntityNotFound(_0x40fffb,null))['then'](saveUpdates(_0x55f617['body'],null))[_0x9e45('0x21')](respondWithResult(_0x40fffb,null))[_0x9e45('0x3f')](handleError(_0x40fffb,null));};exports[_0x9e45('0x46')]=function(_0x4422e6,_0x406746){return db[_0x9e45('0x28')][_0x9e45('0x43')]({'where':{'id':_0x4422e6[_0x9e45('0x40')]['id']}})['then'](handleEntityNotFound(_0x406746,null))[_0x9e45('0x21')](removeEntity(_0x406746,null))[_0x9e45('0x3f')](handleError(_0x406746,null));};exports[_0x9e45('0x47')]=function(_0x413c04,_0x18612d){return db[_0x9e45('0x28')][_0x9e45('0x47')]()[_0x9e45('0x21')](respondWithResult(_0x18612d,null))[_0x9e45('0x3f')](handleError(_0x18612d,null));}; \ No newline at end of file +var _0xd7d3=['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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','error','name','send','index','map','VoiceDialReport','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','create','body','destroy','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xd7d3,0x97));var _0x3d7d=function(_0x1f71d8,_0x278518){_0x1f71d8=_0x1f71d8-0x0;var _0x10b045=_0xd7d3[_0x1f71d8];return _0x10b045;};'use strict';var emlformat=require(_0x3d7d('0x0'));var rimraf=require(_0x3d7d('0x1'));var zipdir=require(_0x3d7d('0x2'));var jsonpatch=require(_0x3d7d('0x3'));var rp=require(_0x3d7d('0x4'));var moment=require(_0x3d7d('0x5'));var BPromise=require(_0x3d7d('0x6'));var Mustache=require(_0x3d7d('0x7'));var util=require(_0x3d7d('0x8'));var path=require(_0x3d7d('0x9'));var sox=require(_0x3d7d('0xa'));var csv=require(_0x3d7d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d7d('0xc'));var _=require(_0x3d7d('0xd'));var squel=require(_0x3d7d('0xe'));var crypto=require('crypto');var jsforce=require(_0x3d7d('0xf'));var deskjs=require(_0x3d7d('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3d7d('0x11'));var Papa=require(_0x3d7d('0x12'));var Redis=require(_0x3d7d('0x13'));var authService=require(_0x3d7d('0x14'));var qs=require(_0x3d7d('0x15'));var as=require(_0x3d7d('0x16'));var hardwareService=require(_0x3d7d('0x17'));var logger=require(_0x3d7d('0x18'))('api');var utils=require(_0x3d7d('0x19'));var config=require(_0x3d7d('0x1a'));var licenseUtil=require(_0x3d7d('0x1b'));var db=require(_0x3d7d('0x1c'))['db'];function respondWithStatusCode(_0x22c8b4,_0x5cb24a){_0x5cb24a=_0x5cb24a||0xcc;return function(_0xc5e2d0){if(_0xc5e2d0){return _0x22c8b4[_0x3d7d('0x1d')](_0x5cb24a);}return _0x22c8b4['status'](_0x5cb24a)[_0x3d7d('0x1e')]();};}function respondWithResult(_0x5e0dba,_0x5c9d2e){_0x5c9d2e=_0x5c9d2e||0xc8;return function(_0x5b42c6){if(_0x5b42c6){return _0x5e0dba['status'](_0x5c9d2e)[_0x3d7d('0x1f')](_0x5b42c6);}};}function respondWithFilteredResult(_0x4a299b,_0x1e0064){return function(_0x502c45){if(_0x502c45){var _0x1d00d8=typeof _0x1e0064[_0x3d7d('0x20')]===_0x3d7d('0x21')&&typeof _0x1e0064[_0x3d7d('0x22')]===_0x3d7d('0x21');var _0x38acd7=_0x502c45[_0x3d7d('0x23')];var _0x422b81=_0x1d00d8?0x0:_0x1e0064[_0x3d7d('0x20')];var _0x308781=_0x1d00d8?_0x502c45['count']:_0x1e0064[_0x3d7d('0x20')]+_0x1e0064[_0x3d7d('0x22')];var _0xf1cb10;if(_0x308781>=_0x38acd7){_0x308781=_0x38acd7;_0xf1cb10=0xc8;}else{_0xf1cb10=0xce;}_0x4a299b[_0x3d7d('0x24')](_0xf1cb10);return _0x4a299b[_0x3d7d('0x25')](_0x3d7d('0x26'),_0x422b81+'-'+_0x308781+'/'+_0x38acd7)['json'](_0x502c45);}return null;};}function patchUpdates(_0x238ba9){return function(_0x717aa6){try{jsonpatch[_0x3d7d('0x27')](_0x717aa6,_0x238ba9,!![]);}catch(_0x54c55f){return BPromise[_0x3d7d('0x28')](_0x54c55f);}return _0x717aa6[_0x3d7d('0x29')]();};}function saveUpdates(_0x19679f,_0xb3c7b2){return function(_0xf03302){if(_0xf03302){return _0xf03302[_0x3d7d('0x2a')](_0x19679f)[_0x3d7d('0x2b')](function(_0x1c7c69){return _0x1c7c69;});}return null;};}function removeEntity(_0x4bf8f7,_0x1e310d){return function(_0x456995){if(_0x456995){return _0x456995['destroy']()[_0x3d7d('0x2b')](function(){_0x4bf8f7[_0x3d7d('0x24')](0xcc)[_0x3d7d('0x1e')]();});}};}function handleEntityNotFound(_0x2fd9e8,_0x459ae4){return function(_0x20fb08){if(!_0x20fb08){_0x2fd9e8[_0x3d7d('0x1d')](0x194);}return _0x20fb08;};}function handleError(_0x2e8603,_0x328237){_0x328237=_0x328237||0x1f4;return function(_0x104af5){logger[_0x3d7d('0x2c')](_0x104af5['stack']);if(_0x104af5[_0x3d7d('0x2d')]){delete _0x104af5['name'];}_0x2e8603[_0x3d7d('0x24')](_0x328237)[_0x3d7d('0x2e')](_0x104af5);};}exports[_0x3d7d('0x2f')]=function(_0x452316,_0x455549){var _0xf332a2={},_0x409bb9={},_0x7cd9ba={'count':0x0,'rows':[]};var _0x55fe08=_[_0x3d7d('0x30')](db[_0x3d7d('0x31')]['rawAttributes'],function(_0x237e08){return{'name':_0x237e08['fieldName'],'type':_0x237e08[_0x3d7d('0x32')]['key']};});_0x409bb9[_0x3d7d('0x33')]=_[_0x3d7d('0x30')](_0x55fe08,_0x3d7d('0x2d'));_0x409bb9[_0x3d7d('0x34')]=_[_0x3d7d('0x35')](_0x452316[_0x3d7d('0x34')]);_0x409bb9['filters']=_[_0x3d7d('0x36')](_0x409bb9[_0x3d7d('0x33')],_0x409bb9[_0x3d7d('0x34')]);_0xf332a2[_0x3d7d('0x37')]=_[_0x3d7d('0x36')](_0x409bb9[_0x3d7d('0x33')],qs['fields'](_0x452316['query'][_0x3d7d('0x38')]));_0xf332a2[_0x3d7d('0x37')]=_0xf332a2[_0x3d7d('0x37')]['length']?_0xf332a2['attributes']:_0x409bb9[_0x3d7d('0x33')];if(!_0x452316[_0x3d7d('0x34')][_0x3d7d('0x39')]('nolimit')){_0xf332a2[_0x3d7d('0x22')]=qs[_0x3d7d('0x22')](_0x452316[_0x3d7d('0x34')]['limit']);_0xf332a2[_0x3d7d('0x20')]=qs['offset'](_0x452316[_0x3d7d('0x34')][_0x3d7d('0x20')]);}_0xf332a2[_0x3d7d('0x3a')]=qs[_0x3d7d('0x3b')](_0x452316['query'][_0x3d7d('0x3b')]);_0xf332a2[_0x3d7d('0x3c')]=qs[_0x3d7d('0x3d')](_['pick'](_0x452316[_0x3d7d('0x34')],_0x409bb9[_0x3d7d('0x3d')]),_0x55fe08);if(_0x452316[_0x3d7d('0x34')][_0x3d7d('0x3e')]){_0xf332a2[_0x3d7d('0x3c')]=_[_0x3d7d('0x3f')](_0xf332a2['where'],{'$or':_[_0x3d7d('0x30')](_0x55fe08,function(_0x5a640b){if(_0x5a640b[_0x3d7d('0x32')]!==_0x3d7d('0x40')){var _0x4e1481={};_0x4e1481[_0x5a640b[_0x3d7d('0x2d')]]={'$like':'%'+_0x452316[_0x3d7d('0x34')]['filter']+'%'};return _0x4e1481;}})});}_0xf332a2=_[_0x3d7d('0x3f')]({},_0xf332a2,_0x452316['options']);var _0x286e21={'where':_0xf332a2['where']};return db['VoiceDialReport'][_0x3d7d('0x23')](_0x286e21)['then'](function(_0x4b728e){_0x7cd9ba[_0x3d7d('0x23')]=_0x4b728e;if(_0x452316[_0x3d7d('0x34')][_0x3d7d('0x41')]){_0xf332a2[_0x3d7d('0x42')]=[{'all':!![]}];}return db[_0x3d7d('0x31')][_0x3d7d('0x43')](_0xf332a2);})['then'](function(_0x268bb5){_0x7cd9ba[_0x3d7d('0x44')]=_0x268bb5;return _0x7cd9ba;})[_0x3d7d('0x2b')](respondWithFilteredResult(_0x455549,_0xf332a2))[_0x3d7d('0x45')](handleError(_0x455549,null));};exports[_0x3d7d('0x46')]=function(_0x30d72c,_0x4bdd09){var _0x28e614={'raw':!![],'where':{'id':_0x30d72c[_0x3d7d('0x47')]['id']}},_0x523013={};_0x523013[_0x3d7d('0x33')]=_[_0x3d7d('0x35')](db[_0x3d7d('0x31')]['rawAttributes']);_0x523013[_0x3d7d('0x34')]=_['keys'](_0x30d72c[_0x3d7d('0x34')]);_0x523013[_0x3d7d('0x3d')]=_[_0x3d7d('0x36')](_0x523013[_0x3d7d('0x33')],_0x523013['query']);_0x28e614[_0x3d7d('0x37')]=_[_0x3d7d('0x36')](_0x523013[_0x3d7d('0x33')],qs[_0x3d7d('0x38')](_0x30d72c['query'][_0x3d7d('0x38')]));_0x28e614[_0x3d7d('0x37')]=_0x28e614[_0x3d7d('0x37')]['length']?_0x28e614[_0x3d7d('0x37')]:_0x523013[_0x3d7d('0x33')];if(_0x30d72c[_0x3d7d('0x34')][_0x3d7d('0x41')]){_0x28e614['include']=[{'all':!![]}];}_0x28e614=_[_0x3d7d('0x3f')]({},_0x28e614,_0x30d72c[_0x3d7d('0x48')]);return db[_0x3d7d('0x31')]['find'](_0x28e614)[_0x3d7d('0x2b')](handleEntityNotFound(_0x4bdd09,null))['then'](respondWithResult(_0x4bdd09,null))[_0x3d7d('0x45')](handleError(_0x4bdd09,null));};exports[_0x3d7d('0x49')]=function(_0x23369d,_0xc17ecc){return db[_0x3d7d('0x31')]['create'](_0x23369d[_0x3d7d('0x4a')],{})[_0x3d7d('0x2b')](respondWithResult(_0xc17ecc,0xc9))[_0x3d7d('0x45')](handleError(_0xc17ecc,null));};exports['update']=function(_0x598d60,_0x5db59a){if(_0x598d60['body']['id']){delete _0x598d60[_0x3d7d('0x4a')]['id'];}return db[_0x3d7d('0x31')]['find']({'where':{'id':_0x598d60[_0x3d7d('0x47')]['id']}})[_0x3d7d('0x2b')](handleEntityNotFound(_0x5db59a,null))[_0x3d7d('0x2b')](saveUpdates(_0x598d60['body'],null))[_0x3d7d('0x2b')](respondWithResult(_0x5db59a,null))[_0x3d7d('0x45')](handleError(_0x5db59a,null));};exports[_0x3d7d('0x4b')]=function(_0x1c54c9,_0x5011f2){return db[_0x3d7d('0x31')][_0x3d7d('0x4c')]({'where':{'id':_0x1c54c9['params']['id']}})['then'](handleEntityNotFound(_0x5011f2,null))[_0x3d7d('0x2b')](removeEntity(_0x5011f2,null))[_0x3d7d('0x45')](handleError(_0x5011f2,null));};exports[_0x3d7d('0x4d')]=function(_0x5e81b3,_0x5528af){return db[_0x3d7d('0x31')][_0x3d7d('0x4d')]()[_0x3d7d('0x2b')](respondWithResult(_0x5528af,null))['catch'](handleError(_0x5528af,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index f9cd459..6ff91a8 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 _0x326a=['define','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports'];(function(_0x50cc93,_0x497526){var _0x4eb1bd=function(_0x1aa069){while(--_0x1aa069){_0x50cc93['push'](_0x50cc93['shift']());}};_0x4eb1bd(++_0x497526);}(_0x326a,0x6d));var _0xa326=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x326a[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0xa326('0x0'));var util=require(_0xa326('0x1'));var logger=require(_0xa326('0x2'))(_0xa326('0x3'));var moment=require(_0xa326('0x4'));var BPromise=require('bluebird');var rp=require(_0xa326('0x5'));var fs=require('fs');var path=require(_0xa326('0x6'));var rimraf=require(_0xa326('0x7'));var config=require(_0xa326('0x8'));var attributes=require(_0xa326('0x9'));module[_0xa326('0xa')]=function(_0x2e2438,_0x4bf8dc){return _0x2e2438[_0xa326('0xb')](_0xa326('0xc'),attributes,{'tableName':_0xa326('0xd'),'paranoid':![],'indexes':[{'fields':[_0xa326('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x474f=['exports','define','VoiceDialReport','report_dial','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x4fe5b9,_0xfaf7fb){var _0x3dfa89=function(_0x2c4931){while(--_0x2c4931){_0x4fe5b9['push'](_0x4fe5b9['shift']());}};_0x3dfa89(++_0xfaf7fb);}(_0x474f,0xac));var _0xf474=function(_0x362e36,_0x22a49b){_0x362e36=_0x362e36-0x0;var _0xb31147=_0x474f[_0x362e36];return _0xb31147;};'use strict';var _=require(_0xf474('0x0'));var util=require('util');var logger=require(_0xf474('0x1'))(_0xf474('0x2'));var moment=require(_0xf474('0x3'));var BPromise=require(_0xf474('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf474('0x5'));var config=require(_0xf474('0x6'));var attributes=require(_0xf474('0x7'));module[_0xf474('0x8')]=function(_0x346d31,_0x2e2d5d){return _0x346d31[_0xf474('0x9')](_0xf474('0xa'),attributes,{'tableName':_0xf474('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 017058b..a030dc8 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 _0xcb03=['client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceDialReport','create','options','raw','catch','UpdateVoiceDialReport','body','where','attributes','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2ea4c6,_0x1818ed){var _0x4570f3=function(_0x3a1446){while(--_0x3a1446){_0x2ea4c6['push'](_0x2ea4c6['shift']());}};_0x4570f3(++_0x1818ed);}(_0xcb03,0x74));var _0x3cb0=function(_0x5c3e62,_0x3f7cf8){_0x5c3e62=_0x5c3e62-0x0;var _0x3dff2b=_0xcb03[_0x5c3e62];return _0x3dff2b;};'use strict';var _=require(_0x3cb0('0x0'));var util=require(_0x3cb0('0x1'));var moment=require(_0x3cb0('0x2'));var BPromise=require('bluebird');var rs=require(_0x3cb0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3cb0('0x4'));var logger=require(_0x3cb0('0x5'))(_0x3cb0('0x6'));var config=require(_0x3cb0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3cb0('0x8')][_0x3cb0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8a6cdf,_0x276fcf,_0x9fffa6){return new BPromise(function(_0x4768c4,_0x15bb21){return client[_0x3cb0('0xa')](_0x8a6cdf,_0x9fffa6)[_0x3cb0('0xb')](function(_0x40fa6c){logger[_0x3cb0('0xc')](_0x3cb0('0xd'),_0x276fcf,_0x3cb0('0xe'));logger[_0x3cb0('0xf')](_0x3cb0('0x10'),_0x276fcf,_0x3cb0('0xe'),JSON[_0x3cb0('0x11')](_0x40fa6c));if(_0x40fa6c[_0x3cb0('0x12')]){if(_0x40fa6c[_0x3cb0('0x12')][_0x3cb0('0x13')]===0x1f4){logger['error'](_0x3cb0('0xd'),_0x276fcf,_0x40fa6c[_0x3cb0('0x12')][_0x3cb0('0x14')]);return _0x15bb21(_0x40fa6c[_0x3cb0('0x12')][_0x3cb0('0x14')]);}logger[_0x3cb0('0x12')](_0x3cb0('0xd'),_0x276fcf,_0x40fa6c[_0x3cb0('0x12')]['message']);return _0x4768c4(_0x40fa6c['error'][_0x3cb0('0x14')]);}else{logger['info'](_0x3cb0('0xd'),_0x276fcf,'request\x20sent');_0x4768c4(_0x40fa6c[_0x3cb0('0x15')]['message']);}})['catch'](function(_0x2996ff){logger[_0x3cb0('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x276fcf,_0x2996ff);_0x15bb21(_0x2996ff);});});}exports[_0x3cb0('0x16')]=function(_0x238184){var _0x36ddc1=this;return new Promise(function(_0x5a33e5,_0x23fa6e){return db['VoiceDialReport'][_0x3cb0('0x17')](_0x238184['body'],{'raw':_0x238184[_0x3cb0('0x18')]?_0x238184[_0x3cb0('0x18')][_0x3cb0('0x19')]===undefined?!![]:![]:!![]})[_0x3cb0('0xb')](function(_0x1d5459){logger[_0x3cb0('0xc')](_0x3cb0('0x16'),_0x238184);logger[_0x3cb0('0xf')](_0x3cb0('0x16'),_0x238184,JSON[_0x3cb0('0x11')](_0x1d5459));_0x5a33e5(_0x1d5459);})[_0x3cb0('0x1a')](function(_0x4e5b4c){logger['error'](_0x3cb0('0x16'),_0x4e5b4c[_0x3cb0('0x14')],_0x238184);_0x23fa6e(_0x36ddc1[_0x3cb0('0x12')](0x1f4,_0x4e5b4c['message']));});});};exports[_0x3cb0('0x1b')]=function(_0x39db6c){var _0x2b813c=this;return new Promise(function(_0x339788,_0x5ab8eb){return db['VoiceDialReport']['update'](_0x39db6c[_0x3cb0('0x1c')],{'raw':_0x39db6c[_0x3cb0('0x18')]?_0x39db6c[_0x3cb0('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39db6c[_0x3cb0('0x18')]?_0x39db6c[_0x3cb0('0x18')][_0x3cb0('0x1d')]||null:null,'attributes':_0x39db6c[_0x3cb0('0x18')]?_0x39db6c[_0x3cb0('0x18')][_0x3cb0('0x1e')]||null:null,'limit':_0x39db6c[_0x3cb0('0x18')]?_0x39db6c[_0x3cb0('0x18')]['limit']||null:null})[_0x3cb0('0xb')](function(_0x193ed7){logger['info'](_0x3cb0('0x1b'),_0x39db6c);logger[_0x3cb0('0xf')]('UpdateVoiceDialReport',_0x39db6c,JSON[_0x3cb0('0x11')](_0x193ed7));_0x339788(_0x193ed7);})[_0x3cb0('0x1a')](function(_0x2256be){logger['error'](_0x3cb0('0x1b'),_0x2256be['message'],_0x39db6c);_0x5ab8eb(_0x2b813c['error'](0x1f4,_0x2256be['message']));});});}; \ No newline at end of file +var _0xa7c8=['catch','CreateVoiceDialReport','body','options','stringify','VoiceDialReport','update','raw','attributes','limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','VoiceDialReport,\x20%s,\x20%s','message','result'];(function(_0x3ba857,_0x44b549){var _0x466c57=function(_0x5e2151){while(--_0x5e2151){_0x3ba857['push'](_0x3ba857['shift']());}};_0x466c57(++_0x44b549);}(_0xa7c8,0xeb));var _0x8a7c=function(_0x2af13c,_0x58e9bb){_0x2af13c=_0x2af13c-0x0;var _0x3e004d=_0xa7c8[_0x2af13c];return _0x3e004d;};'use strict';var _=require(_0x8a7c('0x0'));var util=require(_0x8a7c('0x1'));var moment=require(_0x8a7c('0x2'));var BPromise=require(_0x8a7c('0x3'));var rs=require(_0x8a7c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8a7c('0x5'));var logger=require(_0x8a7c('0x6'))(_0x8a7c('0x7'));var config=require(_0x8a7c('0x8'));var jayson=require(_0x8a7c('0x9'));var client=jayson[_0x8a7c('0xa')][_0x8a7c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x9fc9da,_0x3a9bd9,_0x334959){return new BPromise(function(_0x3b4b2c,_0x3c35b0){return client['request'](_0x9fc9da,_0x334959)[_0x8a7c('0xc')](function(_0x1a0c53){logger[_0x8a7c('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x3a9bd9,'request\x20sent');logger[_0x8a7c('0xe')](_0x8a7c('0xf'),_0x3a9bd9,'request\x20sent',JSON['stringify'](_0x1a0c53));if(_0x1a0c53[_0x8a7c('0x10')]){if(_0x1a0c53['error'][_0x8a7c('0x11')]===0x1f4){logger[_0x8a7c('0x10')](_0x8a7c('0x12'),_0x3a9bd9,_0x1a0c53['error'][_0x8a7c('0x13')]);return _0x3c35b0(_0x1a0c53['error']['message']);}logger[_0x8a7c('0x10')]('VoiceDialReport,\x20%s,\x20%s',_0x3a9bd9,_0x1a0c53[_0x8a7c('0x10')][_0x8a7c('0x13')]);return _0x3b4b2c(_0x1a0c53[_0x8a7c('0x10')][_0x8a7c('0x13')]);}else{logger[_0x8a7c('0xd')]('VoiceDialReport,\x20%s,\x20%s',_0x3a9bd9,'request\x20sent');_0x3b4b2c(_0x1a0c53[_0x8a7c('0x14')][_0x8a7c('0x13')]);}})[_0x8a7c('0x15')](function(_0x1a148b){logger[_0x8a7c('0x10')](_0x8a7c('0x12'),_0x3a9bd9,_0x1a148b);_0x3c35b0(_0x1a148b);});});}exports[_0x8a7c('0x16')]=function(_0x37b023){var _0x448d64=this;return new Promise(function(_0x23de5f,_0x7b698f){return db['VoiceDialReport']['create'](_0x37b023[_0x8a7c('0x17')],{'raw':_0x37b023[_0x8a7c('0x18')]?_0x37b023['options']['raw']===undefined?!![]:![]:!![]})[_0x8a7c('0xc')](function(_0x2d5535){logger['info']('CreateVoiceDialReport',_0x37b023);logger[_0x8a7c('0xe')]('CreateVoiceDialReport',_0x37b023,JSON[_0x8a7c('0x19')](_0x2d5535));_0x23de5f(_0x2d5535);})[_0x8a7c('0x15')](function(_0x3fe063){logger[_0x8a7c('0x10')](_0x8a7c('0x16'),_0x3fe063['message'],_0x37b023);_0x7b698f(_0x448d64[_0x8a7c('0x10')](0x1f4,_0x3fe063['message']));});});};exports['UpdateVoiceDialReport']=function(_0xd39bd4){var _0x25ac24=this;return new Promise(function(_0xf3259c,_0x1cc16e){return db[_0x8a7c('0x1a')][_0x8a7c('0x1b')](_0xd39bd4[_0x8a7c('0x17')],{'raw':_0xd39bd4[_0x8a7c('0x18')]?_0xd39bd4[_0x8a7c('0x18')][_0x8a7c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd39bd4['options']?_0xd39bd4[_0x8a7c('0x18')]['where']||null:null,'attributes':_0xd39bd4[_0x8a7c('0x18')]?_0xd39bd4['options'][_0x8a7c('0x1d')]||null:null,'limit':_0xd39bd4[_0x8a7c('0x18')]?_0xd39bd4[_0x8a7c('0x18')][_0x8a7c('0x1e')]||null:null})[_0x8a7c('0xc')](function(_0x575f98){logger[_0x8a7c('0xd')](_0x8a7c('0x1f'),_0xd39bd4);logger[_0x8a7c('0xe')](_0x8a7c('0x1f'),_0xd39bd4,JSON[_0x8a7c('0x19')](_0x575f98));_0xf3259c(_0x575f98);})['catch'](function(_0x4766e6){logger[_0x8a7c('0x10')](_0x8a7c('0x1f'),_0x4766e6['message'],_0xd39bd4);_0x1cc16e(_0x25ac24[_0x8a7c('0x10')](0x1f4,_0x4766e6['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a222b5b..21bd516 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 _0xd79c=['fs-extra','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','/:id/applications','addApplications','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x5447aa,_0x3afc00){var _0xb21e53=function(_0x2d05f6){while(--_0x2d05f6){_0x5447aa['push'](_0x5447aa['shift']());}};_0xb21e53(++_0x3afc00);}(_0xd79c,0x145));var _0xcd79=function(_0x507f6b,_0x24dd89){_0x507f6b=_0x507f6b-0x0;var _0x134fe7=_0xd79c[_0x507f6b];return _0x134fe7;};'use strict';var multer=require(_0xcd79('0x0'));var util=require(_0xcd79('0x1'));var path=require('path');var timeout=require(_0xcd79('0x2'));var express=require(_0xcd79('0x3'));var router=express[_0xcd79('0x4')]();var fs_extra=require(_0xcd79('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcd79('0x6'));var config=require(_0xcd79('0x7'));var controller=require('./voiceExtension.controller');router[_0xcd79('0x8')]('/',auth['isAuthenticated'](),controller[_0xcd79('0x9')]);router[_0xcd79('0x8')](_0xcd79('0xa'),auth[_0xcd79('0xb')](),controller[_0xcd79('0xc')]);router[_0xcd79('0xd')]('/',auth[_0xcd79('0xb')](),controller[_0xcd79('0xe')]);router[_0xcd79('0xd')](_0xcd79('0xf'),auth[_0xcd79('0xb')](),controller[_0xcd79('0x10')]);router[_0xcd79('0x11')](_0xcd79('0xa'),auth['isAuthenticated'](),controller[_0xcd79('0x12')]);router[_0xcd79('0x13')](_0xcd79('0xa'),auth['isAuthenticated'](),controller[_0xcd79('0x14')]);module[_0xcd79('0x15')]=router; \ No newline at end of file +var _0xe88e=['destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','post','/:id/applications','put','update','delete'];(function(_0x34277d,_0x6a654){var _0x1975bb=function(_0x24ede0){while(--_0x24ede0){_0x34277d['push'](_0x34277d['shift']());}};_0x1975bb(++_0x6a654);}(_0xe88e,0xd4));var _0xee88=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0xe88e[_0x220f3f];return _0x1f170e;};'use strict';var multer=require(_0xee88('0x0'));var util=require('util');var path=require(_0xee88('0x1'));var timeout=require('connect-timeout');var express=require(_0xee88('0x2'));var router=express['Router']();var fs_extra=require(_0xee88('0x3'));var auth=require(_0xee88('0x4'));var interaction=require(_0xee88('0x5'));var config=require(_0xee88('0x6'));var controller=require(_0xee88('0x7'));router[_0xee88('0x8')]('/',auth[_0xee88('0x9')](),controller[_0xee88('0xa')]);router[_0xee88('0x8')](_0xee88('0xb'),auth[_0xee88('0x9')](),controller[_0xee88('0xc')]);router['post']('/',auth[_0xee88('0x9')](),controller[_0xee88('0xd')]);router[_0xee88('0xe')](_0xee88('0xf'),auth[_0xee88('0x9')](),controller['addApplications']);router[_0xee88('0x10')](_0xee88('0xb'),auth[_0xee88('0x9')](),controller[_0xee88('0x11')]);router[_0xee88('0x12')](_0xee88('0xb'),auth['isAuthenticated'](),controller[_0xee88('0x13')]);module[_0xee88('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index ec3b319..49a1014 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 _0x5646=['ENUM','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','getDataValue','exten','compositeIndex','STRING','NoOp'];(function(_0x20724c,_0x4f1432){var _0x4e523d=function(_0x50a1ed){while(--_0x50a1ed){_0x20724c['push'](_0x20724c['shift']());}};_0x4e523d(++_0x4f1432);}(_0x5646,0x173));var _0x6564=function(_0x5bfb78,_0x22e3ff){_0x5bfb78=_0x5bfb78-0x0;var _0x4efd00=_0x5646[_0x5bfb78];return _0x4efd00;};'use strict';var Sequelize=require('sequelize');module['exports']={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6564('0x0'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x6564('0x1')],'allowNull':![],'unique':_0x6564('0x0')},'priority':{'type':Sequelize[_0x6564('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x6564('0x0')},'tag':{'type':Sequelize[_0x6564('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6564('0x2')},'appdata':{'type':Sequelize[_0x6564('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x6564('0x3')](_0x6564('0x4'),_0x6564('0x5'),_0x6564('0x6'),'inbound-fax',_0x6564('0x7'),_0x6564('0x8'),_0x6564('0x9')),'allowNull':![]},'description':{'type':Sequelize[_0x6564('0x1')]},'interval':{'type':Sequelize[_0x6564('0x1')],'allowNull':![],'defaultValue':_0x6564('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x6564('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x6564('0xc')]},'recordingFormat':{'type':Sequelize[_0x6564('0x1')],'defaultValue':_0x6564('0xd')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize[_0x6564('0xe')],'get':function(_0x171d5a){return this[_0x6564('0xf')](_0x6564('0x10'));}},'alias':{'type':Sequelize[_0x6564('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xafec=['INTEGER','BOOLEAN','VIRTUAL','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','outbound-fax','system','any','*,*,*,*'];(function(_0x240786,_0x1fcb4a){var _0x3968c6=function(_0x125b7d){while(--_0x125b7d){_0x240786['push'](_0x240786['shift']());}};_0x3968c6(++_0x1fcb4a);}(_0xafec,0x144));var _0xcafe=function(_0x2bc6c1,_0x4dd131){_0x2bc6c1=_0x2bc6c1-0x0;var _0x2f29a2=_0xafec[_0x2bc6c1];return _0x2f29a2;};'use strict';var Sequelize=require(_0xcafe('0x0'));module[_0xcafe('0x1')]={'context':{'type':Sequelize[_0xcafe('0x2')],'allowNull':![],'unique':_0xcafe('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xcafe('0x3')},'priority':{'type':Sequelize[_0xcafe('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xcafe('0x3')},'tag':{'type':Sequelize[_0xcafe('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcafe('0x4')},'appdata':{'type':Sequelize[_0xcafe('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0xcafe('0x5'),_0xcafe('0x6'),_0xcafe('0x7'),'inbound-fax',_0xcafe('0x8'),_0xcafe('0x9'),_0xcafe('0xa')),'allowNull':![]},'description':{'type':Sequelize[_0xcafe('0x2')]},'interval':{'type':Sequelize[_0xcafe('0x2')],'allowNull':![],'defaultValue':_0xcafe('0xb')},'IntervalId':{'type':Sequelize[_0xcafe('0xc')]},'isApp':{'type':Sequelize[_0xcafe('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xcafe('0x2')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xcafe('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xcafe('0xc')]},'recordingFormat':{'type':Sequelize[_0xcafe('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0xcafe('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xcafe('0xe')],'get':function(_0x6213c){return this['getDataValue'](_0xcafe('0xf'));}},'alias':{'type':Sequelize[_0xcafe('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 d2cd387..b3dcd9f 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 _0x76cd=['inbound','OutboundRoutes','internal','map','value','includes','find','type','name','UserProfileResource','error','stack','index','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','VoiceExtension','rows','catch','show','create','body','outbound','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','InternalRoutes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','pick','context','description','mandatoryDisposition','alias','addApplications','sequelize','transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','isApp','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','send','lodash','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes'];(function(_0x507c81,_0x3e1b56){var _0x368a25=function(_0x1e7519){while(--_0x1e7519){_0x507c81['push'](_0x507c81['shift']());}};_0x368a25(++_0x3e1b56);}(_0x76cd,0x9e));var _0xd76c=function(_0x1d4251,_0xc7b6cc){_0x1d4251=_0x1d4251-0x0;var _0x3aaf81=_0x76cd[_0x1d4251];return _0x3aaf81;};'use strict';var _=require(_0xd76c('0x0'));var Redis=require(_0xd76c('0x1'));var qs=require(_0xd76c('0x2'));var logger=require(_0xd76c('0x3'))('api');var config=require(_0xd76c('0x4'));var db=require(_0xd76c('0x5'))['db'];config[_0xd76c('0x6')]=_[_0xd76c('0x7')](config[_0xd76c('0x6')],{'host':_0xd76c('0x8'),'port':0x18eb});var socket=require(_0xd76c('0x9'))(new Redis(config[_0xd76c('0x6')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x290531,_0x3a1d28){_0x3a1d28=_0x3a1d28||0xcc;return function(_0x51c80e){if(_0x51c80e){return _0x290531[_0xd76c('0xa')](_0x3a1d28);}return _0x290531[_0xd76c('0xb')](_0x3a1d28)[_0xd76c('0xc')]();};}function respondWithResult(_0x3bb207,_0x9d6c81){_0x9d6c81=_0x9d6c81||0xc8;return function(_0x3aebcd){if(_0x3aebcd){return _0x3bb207[_0xd76c('0xb')](_0x9d6c81)[_0xd76c('0xd')](_0x3aebcd);}};}function respondWithFilteredResult(_0x5662e7,_0x3b3fdd){return function(_0x312e70){if(_0x312e70){var _0x328b94=typeof _0x3b3fdd[_0xd76c('0xe')]===_0xd76c('0xf')&&typeof _0x3b3fdd[_0xd76c('0x10')]==='undefined';var _0x35bc8b=_0x312e70['count'];var _0x4805c5=_0x328b94?0x0:_0x3b3fdd[_0xd76c('0xe')];var _0x441f76=_0x328b94?_0x312e70[_0xd76c('0x11')]:_0x3b3fdd['offset']+_0x3b3fdd[_0xd76c('0x10')];var _0x1662b2;if(_0x441f76>=_0x35bc8b){_0x441f76=_0x35bc8b;_0x1662b2=0xc8;}else{_0x1662b2=0xce;}_0x5662e7['status'](_0x1662b2);return _0x5662e7[_0xd76c('0x12')](_0xd76c('0x13'),_0x4805c5+'-'+_0x441f76+'/'+_0x35bc8b)[_0xd76c('0xd')](_0x312e70);}return null;};}function removeEntity(_0x2c2e6f){return function(_0x235349){if(_0x235349){return _0x235349[_0xd76c('0x14')]()[_0xd76c('0x15')](function(){var _0x2c2bbb=_0x235349[_0xd76c('0x16')]({'plain':!![]});var _0x4c677a=[{'name':_0xd76c('0x17'),'value':_0xd76c('0x18'),'ignore':![]},{'name':_0xd76c('0x19'),'value':'outbound','ignore':![]},{'name':'InternalRoutes','value':_0xd76c('0x1a'),'ignore':![]}];var _0x967581=_(_0x4c677a)['filter']('ignore')[_0xd76c('0x1b')](_0xd76c('0x1c'))['value']();if(_[_0xd76c('0x1d')](_0x967581,_0x2c2bbb['type'])){return;}var _0x72b757=_[_0xd76c('0x1e')](_0x4c677a,[_0xd76c('0x1c'),_0x2c2bbb[_0xd76c('0x1f')]])[_0xd76c('0x20')];return db[_0xd76c('0x21')][_0xd76c('0x14')]({'where':{'type':_0x72b757,'resourceId':_0x2c2bbb['id']}})[_0xd76c('0x15')](function(){return _0x235349;});})[_0xd76c('0x15')](function(){_0x2c2e6f[_0xd76c('0xb')](0xcc)[_0xd76c('0xc')]();});}};}function handleEntityNotFound(_0x568e48){return function(_0x2626f9){if(!_0x2626f9){_0x568e48[_0xd76c('0xa')](0x194);}return _0x2626f9;};}function handleError(_0x4f416f,_0x35f99f){_0x35f99f=_0x35f99f||0x1f4;return function(_0x508e4b){logger[_0xd76c('0x22')](_0x508e4b[_0xd76c('0x23')]);if(_0x508e4b['name']){delete _0x508e4b[_0xd76c('0x20')];}_0x4f416f[_0xd76c('0xb')](_0x35f99f)['send'](_0x508e4b);};}exports[_0xd76c('0x24')]=function(_0x18abd5,_0x1681c5){var _0x1d1b7b={},_0x69648c={},_0x11d5a7={'count':0x0,'rows':[]};var _0x10b0aa=_[_0xd76c('0x1b')](db['VoiceExtension'][_0xd76c('0x25')],function(_0x4d57a2){return{'name':_0x4d57a2[_0xd76c('0x26')],'type':_0x4d57a2[_0xd76c('0x1f')]['key']};});_0x69648c[_0xd76c('0x27')]=_[_0xd76c('0x1b')](_0x10b0aa,_0xd76c('0x20'));_0x69648c['query']=_[_0xd76c('0x28')](_0x18abd5[_0xd76c('0x29')]);_0x69648c[_0xd76c('0x2a')]=_[_0xd76c('0x2b')](_0x69648c[_0xd76c('0x27')],_0x69648c['query']);_0x1d1b7b['attributes']=_[_0xd76c('0x2b')](_0x69648c['model'],qs[_0xd76c('0x2c')](_0x18abd5[_0xd76c('0x29')]['fields']));_0x1d1b7b[_0xd76c('0x2d')]=_0x1d1b7b['attributes'][_0xd76c('0x2e')]?_0x1d1b7b[_0xd76c('0x2d')]:_0x69648c[_0xd76c('0x27')];if(!_0x18abd5[_0xd76c('0x29')][_0xd76c('0x2f')]('nolimit')){_0x1d1b7b[_0xd76c('0x10')]=qs['limit'](_0x18abd5['query'][_0xd76c('0x10')]);_0x1d1b7b['offset']=qs['offset'](_0x18abd5[_0xd76c('0x29')][_0xd76c('0xe')]);}_0x1d1b7b['order']=qs[_0xd76c('0x30')](_0x18abd5[_0xd76c('0x29')]['sort']);_0x1d1b7b[_0xd76c('0x31')]=qs[_0xd76c('0x2a')](_['pick'](_0x18abd5[_0xd76c('0x29')],_0x69648c['filters']),_0x10b0aa);if(_0x18abd5[_0xd76c('0x29')][_0xd76c('0x32')]){_0x1d1b7b[_0xd76c('0x31')]=_[_0xd76c('0x33')](_0x1d1b7b['where'],{'$or':_['map'](_0x10b0aa,function(_0x3e5b93){if(_0x3e5b93[_0xd76c('0x1f')]!==_0xd76c('0x34')){var _0x42e33e={};_0x42e33e[_0x3e5b93['name']]={'$like':'%'+_0x18abd5[_0xd76c('0x29')][_0xd76c('0x32')]+'%'};return _0x42e33e;}})});}_0x1d1b7b=_['merge']({},_0x1d1b7b,_0x18abd5[_0xd76c('0x35')]);var _0x57d811={'where':_0x1d1b7b[_0xd76c('0x31')]};return db['VoiceExtension'][_0xd76c('0x11')](_0x57d811)[_0xd76c('0x15')](function(_0x7635aa){_0x11d5a7['count']=_0x7635aa;if(_0x18abd5['query'][_0xd76c('0x36')]){_0x1d1b7b[_0xd76c('0x37')]=[{'all':!![]}];}return db[_0xd76c('0x38')]['findAll'](_0x1d1b7b);})[_0xd76c('0x15')](function(_0xe913fd){_0x11d5a7[_0xd76c('0x39')]=_0xe913fd;return _0x11d5a7;})['then'](respondWithFilteredResult(_0x1681c5,_0x1d1b7b))[_0xd76c('0x3a')](handleError(_0x1681c5,null));};exports[_0xd76c('0x3b')]=function(_0x305b84,_0x3110ac){var _0x417a26={'raw':![],'where':{'id':_0x305b84['params']['id']}},_0x18a018={};_0x18a018[_0xd76c('0x27')]=_['keys'](db['VoiceExtension'][_0xd76c('0x25')]);_0x18a018[_0xd76c('0x29')]=_['keys'](_0x305b84['query']);_0x18a018[_0xd76c('0x2a')]=_[_0xd76c('0x2b')](_0x18a018['model'],_0x18a018[_0xd76c('0x29')]);_0x417a26[_0xd76c('0x2d')]=_[_0xd76c('0x2b')](_0x18a018['model'],qs['fields'](_0x305b84[_0xd76c('0x29')][_0xd76c('0x2c')]));_0x417a26['attributes']=_0x417a26['attributes'][_0xd76c('0x2e')]?_0x417a26['attributes']:_0x18a018[_0xd76c('0x27')];if(_0x305b84[_0xd76c('0x29')][_0xd76c('0x36')]){_0x417a26['include']=[{'all':!![]}];}_0x417a26=_[_0xd76c('0x33')]({},_0x417a26,_0x305b84['options']);return db['VoiceExtension'][_0xd76c('0x1e')](_0x417a26)['then'](handleEntityNotFound(_0x3110ac,null))[_0xd76c('0x15')](respondWithResult(_0x3110ac,null))[_0xd76c('0x3a')](handleError(_0x3110ac,null));};exports[_0xd76c('0x14')]=function(_0x90c619,_0x3632c5){return db[_0xd76c('0x38')][_0xd76c('0x1e')]({'where':{'id':_0x90c619['params']['id']}})[_0xd76c('0x15')](handleEntityNotFound(_0x3632c5,null))['then'](removeEntity(_0x3632c5,null))[_0xd76c('0x3a')](handleError(_0x3632c5,null));};exports[_0xd76c('0x3c')]=function(_0x480c34,_0x12aa70){if(_0x480c34[_0xd76c('0x3d')][_0xd76c('0x1f')]===_0xd76c('0x3e')&&!_['startsWith'](_0x480c34[_0xd76c('0x3d')][_0xd76c('0x3f')],'_')){_0x480c34['body']['exten']='_'[_0xd76c('0x40')](_0x480c34[_0xd76c('0x3d')][_0xd76c('0x3f')]);}return db[_0xd76c('0x38')]['create'](_0x480c34[_0xd76c('0x3d')],{'raw':![]})[_0xd76c('0x15')](function(_0x4788f7){var _0x4543dd=_0x480c34['user'][_0xd76c('0x16')]({'plain':!![]});if(!_0x4543dd)throw new Error(_0xd76c('0x41'));if(_0x4543dd[_0xd76c('0x42')]==='user'){var _0x3dd18c=_0x4788f7[_0xd76c('0x16')]({'plain':!![]});var _0x206950=[{'name':_0xd76c('0x17'),'value':_0xd76c('0x18')},{'name':_0xd76c('0x19'),'value':_0xd76c('0x3e')},{'name':_0xd76c('0x43'),'value':_0xd76c('0x1a')}];var _0x334b60=_[_0xd76c('0x1e')](_0x206950,['value',_0x3dd18c[_0xd76c('0x1f')]])['name'];return db['UserProfileSection']['find']({'where':{'name':_0x334b60,'userProfileId':_0x4543dd[_0xd76c('0x44')]},'raw':!![]})['then'](function(_0x1b26c4){if(_0x1b26c4&&_0x1b26c4[_0xd76c('0x45')]===0x0){return db[_0xd76c('0x21')]['create']({'name':_0x3dd18c[_0xd76c('0x20')],'resourceId':_0x3dd18c['id'],'type':_0x1b26c4[_0xd76c('0x20')],'sectionId':_0x1b26c4['id']},{})[_0xd76c('0x15')](function(){return _0x4788f7;});}else{return _0x4788f7;}})[_0xd76c('0x3a')](function(_0x1f5dcb){logger[_0xd76c('0x22')](_0xd76c('0x46'),_0x1f5dcb);throw _0x1f5dcb;});}return _0x4788f7;})[_0xd76c('0x15')](respondWithResult(_0x12aa70,0xc9))[_0xd76c('0x3a')](handleError(_0x12aa70,null));};exports[_0xd76c('0x47')]=function(_0x5ccc60,_0x849da2){if(_0x5ccc60['body']['id']){delete _0x5ccc60[_0xd76c('0x3d')]['id'];}return db[_0xd76c('0x38')][_0xd76c('0x1e')]({'where':{'id':_0x5ccc60[_0xd76c('0x48')]['id']}})[_0xd76c('0x15')](handleEntityNotFound(_0x849da2,null))[_0xd76c('0x15')](function(_0x53e0be){if(_0x53e0be){return db[_0xd76c('0x38')][_0xd76c('0x47')](_[_0xd76c('0x49')](_0x5ccc60[_0xd76c('0x3d')],[_0xd76c('0x3f'),_0xd76c('0x4a'),_0xd76c('0x4b'),'recordingFormat','cutdigits',_0xd76c('0x4c'),_0xd76c('0x4d')]),{'where':{'context':_0x53e0be['context'],'exten':_0x53e0be[_0xd76c('0x3f')]},'individualHooks':!![]})[_0xd76c('0x15')](function(_0x8c1aff){return _0x8c1aff;});}return null;})[_0xd76c('0x15')](respondWithStatusCode(_0x849da2,null))['catch'](handleError(_0x849da2,null));};exports[_0xd76c('0x4e')]=function(_0x53ec52,_0x56912b){var _0x4b5938=_0x53ec52['params']['id'];var _0x19021c=_0x53ec52['body'];var _0x40afd0=0xc8;var _0xff5eb4=null;return db[_0xd76c('0x4f')][_0xd76c('0x50')]({'isolationLevel':db[_0xd76c('0x4f')]['Transaction'][_0xd76c('0x51')]['READ_COMMITTED']},function(_0x25b10f){return db['VoiceExtension'][_0xd76c('0x52')]({'where':{'id':_0x4b5938},'transaction':_0x25b10f})['then'](function(_0x46fdc8){if(_0x46fdc8){return db[_0xd76c('0x38')][_0xd76c('0x14')]({'where':{'VoiceExtensionId':_0x4b5938},'transaction':_0x25b10f})[_0xd76c('0x15')](function(){var _0x23f28e=_[_0xd76c('0x1b')](_0x19021c,function(_0x32193d){_0x32193d[_0xd76c('0x53')]=_0x4b5938;_0x32193d[_0xd76c('0x54')]=!![];return _0x32193d;});return _0x46fdc8[_0xd76c('0x55')](_0x23f28e);})[_0xd76c('0x15')](function(_0x721231){return db[_0xd76c('0x38')][_0xd76c('0x56')](_0x721231,{'transaction':_0x25b10f});});}else{_0x40afd0=0x194;_0xff5eb4=[];}});})[_0xd76c('0x15')](function(){if(_0x40afd0!==0x194){return db[_0xd76c('0x38')][_0xd76c('0x57')]({'where':{'isApp':!![],'VoiceExtensionId':_0x4b5938},'order':_0xd76c('0x58')})['then'](function(_0x19c82a){_0xff5eb4=_0x19c82a;});}})[_0xd76c('0x3a')](function(_0x478e99){_0x40afd0=0x1f4;logger['error'](_0x478e99[_0xd76c('0x23')]);if(_0x478e99['name']){delete _0x478e99[_0xd76c('0x20')];}_0xff5eb4=_0x478e99;})[_0xd76c('0x59')](function(){if(_0xff5eb4===null){_0x56912b['sendStatus'](_0x40afd0);}else{if(_0x40afd0===0x1f4){_0x56912b[_0xd76c('0xb')](_0x40afd0)[_0xd76c('0x5a')](_0xff5eb4);}else{_0x56912b[_0xd76c('0xb')](_0x40afd0)['json'](_0xff5eb4);}}});}; \ No newline at end of file +var _0x1099=['OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','find','name','UserProfileResource','then','error','stack','send','index','VoiceExtension','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','intersection','params','create','body','startsWith','exten','concat','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../config/environment','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','destroy','InboundRoutes','inbound'];(function(_0x3dd9b0,_0x28a54a){var _0x4af95d=function(_0x2e908e){while(--_0x2e908e){_0x3dd9b0['push'](_0x3dd9b0['shift']());}};_0x4af95d(++_0x28a54a);}(_0x1099,0xa8));var _0x9109=function(_0x10e505,_0x39f6a4){_0x10e505=_0x10e505-0x0;var _0x4ad775=_0x1099[_0x10e505];return _0x4ad775;};'use strict';var _=require(_0x9109('0x0'));var Redis=require(_0x9109('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')('api');var config=require(_0x9109('0x2'));var db=require('../../mysqldb')['db'];config[_0x9109('0x3')]=_['defaults'](config['redis'],{'host':_0x9109('0x4'),'port':0x18eb});var socket=require(_0x9109('0x5'))(new Redis(config[_0x9109('0x3')]));require('./voiceExtension.socket')['register'](socket);function respondWithStatusCode(_0x31dd2d,_0x4eff66){_0x4eff66=_0x4eff66||0xcc;return function(_0x44553d){if(_0x44553d){return _0x31dd2d[_0x9109('0x6')](_0x4eff66);}return _0x31dd2d[_0x9109('0x7')](_0x4eff66)[_0x9109('0x8')]();};}function respondWithResult(_0x20fd45,_0x164d86){_0x164d86=_0x164d86||0xc8;return function(_0x21f10c){if(_0x21f10c){return _0x20fd45[_0x9109('0x7')](_0x164d86)[_0x9109('0x9')](_0x21f10c);}};}function respondWithFilteredResult(_0x50936e,_0x5d311f){return function(_0x172e00){if(_0x172e00){var _0x52a011=typeof _0x5d311f[_0x9109('0xa')]===_0x9109('0xb')&&typeof _0x5d311f[_0x9109('0xc')]===_0x9109('0xb');var _0x373fdd=_0x172e00[_0x9109('0xd')];var _0x206892=_0x52a011?0x0:_0x5d311f[_0x9109('0xa')];var _0x5adf9b=_0x52a011?_0x172e00[_0x9109('0xd')]:_0x5d311f[_0x9109('0xa')]+_0x5d311f[_0x9109('0xc')];var _0x57d3c3;if(_0x5adf9b>=_0x373fdd){_0x5adf9b=_0x373fdd;_0x57d3c3=0xc8;}else{_0x57d3c3=0xce;}_0x50936e[_0x9109('0x7')](_0x57d3c3);return _0x50936e[_0x9109('0xe')]('Content-Range',_0x206892+'-'+_0x5adf9b+'/'+_0x373fdd)[_0x9109('0x9')](_0x172e00);}return null;};}function removeEntity(_0x455d55){return function(_0x2f6d67){if(_0x2f6d67){return _0x2f6d67[_0x9109('0xf')]()['then'](function(){var _0x54009b=_0x2f6d67['get']({'plain':!![]});var _0x2a739f=[{'name':_0x9109('0x10'),'value':_0x9109('0x11'),'ignore':![]},{'name':_0x9109('0x12'),'value':_0x9109('0x13'),'ignore':![]},{'name':_0x9109('0x14'),'value':_0x9109('0x15'),'ignore':![]}];var _0x52a5e3=_(_0x2a739f)['filter'](_0x9109('0x16'))[_0x9109('0x17')](_0x9109('0x18'))[_0x9109('0x18')]();if(_[_0x9109('0x19')](_0x52a5e3,_0x54009b['type'])){return;}var _0x80a9c9=_[_0x9109('0x1a')](_0x2a739f,['value',_0x54009b['type']])[_0x9109('0x1b')];return db[_0x9109('0x1c')][_0x9109('0xf')]({'where':{'type':_0x80a9c9,'resourceId':_0x54009b['id']}})[_0x9109('0x1d')](function(){return _0x2f6d67;});})[_0x9109('0x1d')](function(){_0x455d55['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x345eee){return function(_0x54d158){if(!_0x54d158){_0x345eee['sendStatus'](0x194);}return _0x54d158;};}function handleError(_0x3f1013,_0x3ca7e3){_0x3ca7e3=_0x3ca7e3||0x1f4;return function(_0x19f0de){logger[_0x9109('0x1e')](_0x19f0de[_0x9109('0x1f')]);if(_0x19f0de[_0x9109('0x1b')]){delete _0x19f0de[_0x9109('0x1b')];}_0x3f1013[_0x9109('0x7')](_0x3ca7e3)[_0x9109('0x20')](_0x19f0de);};}exports[_0x9109('0x21')]=function(_0x2381d6,_0x1e1339){var _0xef5791={},_0x1e0986={},_0x46d860={'count':0x0,'rows':[]};var _0x5d3697=_['map'](db[_0x9109('0x22')][_0x9109('0x23')],function(_0x314ae5){return{'name':_0x314ae5[_0x9109('0x24')],'type':_0x314ae5[_0x9109('0x25')][_0x9109('0x26')]};});_0x1e0986[_0x9109('0x27')]=_['map'](_0x5d3697,_0x9109('0x1b'));_0x1e0986[_0x9109('0x28')]=_[_0x9109('0x29')](_0x2381d6[_0x9109('0x28')]);_0x1e0986[_0x9109('0x2a')]=_['intersection'](_0x1e0986[_0x9109('0x27')],_0x1e0986[_0x9109('0x28')]);_0xef5791[_0x9109('0x2b')]=_['intersection'](_0x1e0986['model'],qs[_0x9109('0x2c')](_0x2381d6[_0x9109('0x28')]['fields']));_0xef5791['attributes']=_0xef5791[_0x9109('0x2b')][_0x9109('0x2d')]?_0xef5791[_0x9109('0x2b')]:_0x1e0986[_0x9109('0x27')];if(!_0x2381d6['query'][_0x9109('0x2e')](_0x9109('0x2f'))){_0xef5791[_0x9109('0xc')]=qs[_0x9109('0xc')](_0x2381d6[_0x9109('0x28')][_0x9109('0xc')]);_0xef5791[_0x9109('0xa')]=qs[_0x9109('0xa')](_0x2381d6['query'][_0x9109('0xa')]);}_0xef5791[_0x9109('0x30')]=qs[_0x9109('0x31')](_0x2381d6[_0x9109('0x28')][_0x9109('0x31')]);_0xef5791['where']=qs[_0x9109('0x2a')](_[_0x9109('0x32')](_0x2381d6[_0x9109('0x28')],_0x1e0986[_0x9109('0x2a')]),_0x5d3697);if(_0x2381d6['query'][_0x9109('0x33')]){_0xef5791['where']=_[_0x9109('0x34')](_0xef5791['where'],{'$or':_[_0x9109('0x17')](_0x5d3697,function(_0xe25eb4){if(_0xe25eb4[_0x9109('0x25')]!==_0x9109('0x35')){var _0x4ab374={};_0x4ab374[_0xe25eb4[_0x9109('0x1b')]]={'$like':'%'+_0x2381d6[_0x9109('0x28')]['filter']+'%'};return _0x4ab374;}})});}_0xef5791=_['merge']({},_0xef5791,_0x2381d6[_0x9109('0x36')]);var _0x33941b={'where':_0xef5791['where']};return db[_0x9109('0x22')][_0x9109('0xd')](_0x33941b)[_0x9109('0x1d')](function(_0x2bad20){_0x46d860[_0x9109('0xd')]=_0x2bad20;if(_0x2381d6[_0x9109('0x28')][_0x9109('0x37')]){_0xef5791[_0x9109('0x38')]=[{'all':!![]}];}return db[_0x9109('0x22')][_0x9109('0x39')](_0xef5791);})[_0x9109('0x1d')](function(_0x5c6781){_0x46d860[_0x9109('0x3a')]=_0x5c6781;return _0x46d860;})[_0x9109('0x1d')](respondWithFilteredResult(_0x1e1339,_0xef5791))[_0x9109('0x3b')](handleError(_0x1e1339,null));};exports['show']=function(_0x440a60,_0x368ab1){var _0x41f6de={'raw':![],'where':{'id':_0x440a60['params']['id']}},_0xfe021e={};_0xfe021e[_0x9109('0x27')]=_['keys'](db[_0x9109('0x22')]['rawAttributes']);_0xfe021e[_0x9109('0x28')]=_[_0x9109('0x29')](_0x440a60[_0x9109('0x28')]);_0xfe021e[_0x9109('0x2a')]=_[_0x9109('0x3c')](_0xfe021e['model'],_0xfe021e['query']);_0x41f6de[_0x9109('0x2b')]=_[_0x9109('0x3c')](_0xfe021e[_0x9109('0x27')],qs[_0x9109('0x2c')](_0x440a60[_0x9109('0x28')]['fields']));_0x41f6de[_0x9109('0x2b')]=_0x41f6de['attributes']['length']?_0x41f6de['attributes']:_0xfe021e[_0x9109('0x27')];if(_0x440a60[_0x9109('0x28')][_0x9109('0x37')]){_0x41f6de['include']=[{'all':!![]}];}_0x41f6de=_['merge']({},_0x41f6de,_0x440a60[_0x9109('0x36')]);return db['VoiceExtension'][_0x9109('0x1a')](_0x41f6de)[_0x9109('0x1d')](handleEntityNotFound(_0x368ab1,null))[_0x9109('0x1d')](respondWithResult(_0x368ab1,null))[_0x9109('0x3b')](handleError(_0x368ab1,null));};exports[_0x9109('0xf')]=function(_0x414a57,_0x3637e2){return db[_0x9109('0x22')][_0x9109('0x1a')]({'where':{'id':_0x414a57[_0x9109('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3637e2,null))[_0x9109('0x1d')](removeEntity(_0x3637e2,null))[_0x9109('0x3b')](handleError(_0x3637e2,null));};exports[_0x9109('0x3e')]=function(_0xd7c4a6,_0x3cb04d){if(_0xd7c4a6[_0x9109('0x3f')]['type']===_0x9109('0x13')&&!_[_0x9109('0x40')](_0xd7c4a6[_0x9109('0x3f')][_0x9109('0x41')],'_')){_0xd7c4a6[_0x9109('0x3f')]['exten']='_'[_0x9109('0x42')](_0xd7c4a6[_0x9109('0x3f')]['exten']);}return db[_0x9109('0x22')][_0x9109('0x3e')](_0xd7c4a6[_0x9109('0x3f')],{'raw':![]})[_0x9109('0x1d')](function(_0x29294d){var _0x56eeb5=_0xd7c4a6[_0x9109('0x43')][_0x9109('0x44')]({'plain':!![]});if(!_0x56eeb5)throw new Error(_0x9109('0x45'));if(_0x56eeb5[_0x9109('0x46')]===_0x9109('0x43')){var _0x5de045=_0x29294d[_0x9109('0x44')]({'plain':!![]});var _0x5623bd=[{'name':_0x9109('0x10'),'value':'inbound'},{'name':'OutboundRoutes','value':'outbound'},{'name':'InternalRoutes','value':'internal'}];var _0x191750=_['find'](_0x5623bd,[_0x9109('0x18'),_0x5de045[_0x9109('0x25')]])[_0x9109('0x1b')];return db[_0x9109('0x47')][_0x9109('0x1a')]({'where':{'name':_0x191750,'userProfileId':_0x56eeb5[_0x9109('0x48')]},'raw':!![]})[_0x9109('0x1d')](function(_0x2b727b){if(_0x2b727b&&_0x2b727b[_0x9109('0x49')]===0x0){return db[_0x9109('0x1c')][_0x9109('0x3e')]({'name':_0x5de045[_0x9109('0x1b')],'resourceId':_0x5de045['id'],'type':_0x2b727b['name'],'sectionId':_0x2b727b['id']},{})[_0x9109('0x1d')](function(){return _0x29294d;});}else{return _0x29294d;}})[_0x9109('0x3b')](function(_0x212c06){logger['error'](_0x9109('0x4a'),_0x212c06);throw _0x212c06;});}return _0x29294d;})[_0x9109('0x1d')](respondWithResult(_0x3cb04d,0xc9))[_0x9109('0x3b')](handleError(_0x3cb04d,null));};exports[_0x9109('0x4b')]=function(_0x241cce,_0x224882){if(_0x241cce[_0x9109('0x3f')]['id']){delete _0x241cce[_0x9109('0x3f')]['id'];}return db[_0x9109('0x22')][_0x9109('0x1a')]({'where':{'id':_0x241cce[_0x9109('0x3d')]['id']}})[_0x9109('0x1d')](handleEntityNotFound(_0x224882,null))[_0x9109('0x1d')](function(_0x22d01a){if(_0x22d01a){return db['VoiceExtension'][_0x9109('0x4b')](_[_0x9109('0x32')](_0x241cce['body'],[_0x9109('0x41'),'context',_0x9109('0x4c'),_0x9109('0x4d'),_0x9109('0x4e'),_0x9109('0x4f'),'alias']),{'where':{'context':_0x22d01a[_0x9109('0x50')],'exten':_0x22d01a[_0x9109('0x41')]},'individualHooks':!![]})[_0x9109('0x1d')](function(_0x1dc652){return _0x1dc652;});}return null;})[_0x9109('0x1d')](respondWithStatusCode(_0x224882,null))['catch'](handleError(_0x224882,null));};exports[_0x9109('0x51')]=function(_0x17295f,_0x4a4151){var _0x5b6a4c=_0x17295f[_0x9109('0x3d')]['id'];var _0x1ec9fd=_0x17295f['body'];var _0x445edb=0xc8;var _0x349556=null;return db[_0x9109('0x52')][_0x9109('0x53')]({'isolationLevel':db[_0x9109('0x52')]['Transaction'][_0x9109('0x54')][_0x9109('0x55')]},function(_0x10be52){return db[_0x9109('0x22')][_0x9109('0x56')]({'where':{'id':_0x5b6a4c},'transaction':_0x10be52})[_0x9109('0x1d')](function(_0x3270a9){if(_0x3270a9){return db[_0x9109('0x22')]['destroy']({'where':{'VoiceExtensionId':_0x5b6a4c},'transaction':_0x10be52})[_0x9109('0x1d')](function(){var _0x4af65a=_[_0x9109('0x17')](_0x1ec9fd,function(_0x130695){_0x130695[_0x9109('0x57')]=_0x5b6a4c;_0x130695['isApp']=!![];return _0x130695;});return _0x3270a9[_0x9109('0x58')](_0x4af65a);})[_0x9109('0x1d')](function(_0x14d5f5){return db[_0x9109('0x22')][_0x9109('0x59')](_0x14d5f5,{'transaction':_0x10be52});});}else{_0x445edb=0x194;_0x349556=[];}});})[_0x9109('0x1d')](function(){if(_0x445edb!==0x194){return db[_0x9109('0x22')][_0x9109('0x5a')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5b6a4c},'order':_0x9109('0x5b')})[_0x9109('0x1d')](function(_0x5544b7){_0x349556=_0x5544b7;});}})[_0x9109('0x3b')](function(_0x418ad1){_0x445edb=0x1f4;logger[_0x9109('0x1e')](_0x418ad1['stack']);if(_0x418ad1[_0x9109('0x1b')]){delete _0x418ad1[_0x9109('0x1b')];}_0x349556=_0x418ad1;})[_0x9109('0x5c')](function(){if(_0x349556===null){_0x4a4151['sendStatus'](_0x445edb);}else{if(_0x445edb===0x1f4){_0x4a4151[_0x9109('0x7')](_0x445edb)['send'](_0x349556);}else{_0x4a4151[_0x9109('0x7')](_0x445edb)[_0x9109('0x9')](_0x349556);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d2be33a..49fc605 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 _0x0f15=['save','update','remove','emit','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x3403b3,_0x5889a6){var _0x1f90ce=function(_0x1c045c){while(--_0x1c045c){_0x3403b3['push'](_0x3403b3['shift']());}};_0x1f90ce(++_0x5889a6);}(_0x0f15,0x1af));var _0x50f1=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x0f15[_0x1b6186];return _0x186121;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x50f1('0x0'))['db'][_0x50f1('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x50f1('0x2')](0x0);var events={'afterCreate':_0x50f1('0x3'),'afterUpdate':_0x50f1('0x4'),'afterDestroy':_0x50f1('0x5')};function emitEvent(_0x493ce9){return function(_0x4c9920,_0x4af9a2,_0x4e9642){VoiceExtensionEvents[_0x50f1('0x6')](_0x493ce9+':'+_0x4c9920['id'],_0x4c9920);VoiceExtensionEvents[_0x50f1('0x6')](_0x493ce9,_0x4c9920);_0x4e9642(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file +var _0xcc78=['VoiceExtension','setMaxListeners','save','update','remove','hasOwnProperty','hook','events'];(function(_0x324e86,_0x81b1cb){var _0x592846=function(_0x33439c){while(--_0x33439c){_0x324e86['push'](_0x324e86['shift']());}};_0x592846(++_0x81b1cb);}(_0xcc78,0x187));var _0x8cc7=function(_0x30d70d,_0x4d942f){_0x30d70d=_0x30d70d-0x0;var _0x27c089=_0xcc78[_0x30d70d];return _0x27c089;};'use strict';var EventEmitter=require(_0x8cc7('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x8cc7('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8cc7('0x2')](0x0);var events={'afterCreate':_0x8cc7('0x3'),'afterUpdate':_0x8cc7('0x4'),'afterDestroy':_0x8cc7('0x5')};function emitEvent(_0x45465d){return function(_0x487846,_0x48ae1f,_0x2ff7c6){VoiceExtensionEvents['emit'](_0x45465d+':'+_0x487846['id'],_0x487846);VoiceExtensionEvents['emit'](_0x45465d,_0x487846);_0x2ff7c6(null);};}for(var e in events){if(events[_0x8cc7('0x6')](e)){var event=events[e];VoiceExtension[_0x8cc7('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f7d533b..0e7327a 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 _0xbe49=['type','CDR(type)=','context','exten','alias','Set','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','options','split','length','param','phone','prefix','join','indexOf','U(xcally-mixmonitor-context)','replace','findAll','interval','IntervalId','then','intervals','filter','toLowerCase','tag','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','playback','includes','app','appType','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','concat','last','define','voice_extensions','get','Hangup','lodash','./voiceExtension.attributes','exports'];(function(_0x520744,_0x5a7171){var _0x161d33=function(_0x4c7794){while(--_0x4c7794){_0x520744['push'](_0x520744['shift']());}};_0x161d33(++_0x5a7171);}(_0xbe49,0x135));var _0x9be4=function(_0x239d38,_0x3e7fef){_0x239d38=_0x239d38-0x0;var _0x397d0a=_0xbe49[_0x239d38];return _0x397d0a;};'use strict';var _=require(_0x9be4('0x0'));var attributes=require(_0x9be4('0x1'));module[_0x9be4('0x2')]=function(_0x2a98e4){var _0x37d576=_0x2a98e4['models'];function _0x369e03(_0x5d05e0){var _0x56a615=0x2;var _0x286790=[{'type':_0x5d05e0[_0x9be4('0x3')],'app':'Set','appdata':_0x9be4('0x4')+_0x5d05e0['type'],'context':_0x5d05e0[_0x9be4('0x5')],'exten':_0x5d05e0[_0x9be4('0x6')],'priority':_0x56a615++,'VoiceExtensionId':_0x5d05e0['id']},{'type':_0x5d05e0[_0x9be4('0x3')],'app':_0x5d05e0[_0x9be4('0x7')]?_0x9be4('0x8'):_0x9be4('0x9'),'appdata':_0x5d05e0['alias']?_0x9be4('0xa')+_0x5d05e0[_0x9be4('0x7')]:_0x9be4('0xb'),'context':_0x5d05e0['context'],'exten':_0x5d05e0[_0x9be4('0x6')],'priority':_0x56a615++,'VoiceExtensionId':_0x5d05e0['id']}];if(_0x5d05e0[_0x9be4('0x3')]===_0x9be4('0xc')){_0x286790[_0x9be4('0xd')]({'type':_0x9be4('0xc'),'app':_0x9be4('0x8'),'appdata':_0x9be4('0xe')+_0x5d05e0['id'],'context':_0x5d05e0['context'],'exten':_0x5d05e0[_0x9be4('0x6')],'priority':_0x56a615++,'VoiceExtensionId':_0x5d05e0['id']});}_0x286790[_0x9be4('0xd')]({'type':_0x5d05e0[_0x9be4('0x3')],'app':_0x9be4('0x8'),'appdata':_0x9be4('0xf'),'context':_0x5d05e0[_0x9be4('0x5')],'exten':_0x5d05e0['exten'],'priority':_0x56a615++,'VoiceExtensionId':_0x5d05e0['id']},{'type':_0x5d05e0[_0x9be4('0x3')],'app':'Set','appdata':_0x9be4('0x10'),'context':_0x5d05e0[_0x9be4('0x5')],'exten':_0x5d05e0['exten'],'priority':_0x56a615++,'VoiceExtensionId':_0x5d05e0['id']},{'type':_0x5d05e0[_0x9be4('0x3')],'app':_0x9be4('0x8'),'appdata':_0x9be4('0x11'),'context':_0x5d05e0['context'],'exten':_0x5d05e0[_0x9be4('0x6')],'priority':_0x56a615++,'VoiceExtensionId':_0x5d05e0['id']});return _0x286790;}function _0x55ea1b(_0x26cab4){var _0x26d93e=0x2;var _0x4be2f6=[{'type':'outbound','app':_0x9be4('0x8'),'appdata':_0x9be4('0x12'),'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4['exten'],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':'outbound','app':_0x26cab4[_0x9be4('0x7')]?_0x9be4('0x8'):_0x9be4('0x9'),'appdata':_0x26cab4[_0x9be4('0x7')]?_0x9be4('0xa')+_0x26cab4[_0x9be4('0x7')]:_0x9be4('0xb'),'context':_0x26cab4['context'],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':'CDR(destination)='+(_0x26cab4[_0x9be4('0x14')]?_0x9be4('0x15')+_0x26cab4['cutdigits']+'}':_0x9be4('0x16')),'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':'CDR(routeid)='+_0x26cab4['id'],'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4['exten'],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':'outbound','app':_0x9be4('0x17'),'appdata':_0x9be4('0x18')+(_0x26d93e+0x2)+'):Goto('+(_0x26d93e+0x1)+')','context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':'outbound','app':_0x9be4('0x8'),'appdata':_0x26cab4[_0x9be4('0x14')]?_0x9be4('0x19')+_0x26cab4[_0x9be4('0x14')]+'}':_0x9be4('0x1a'),'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':_0x9be4('0xf'),'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':_0x9be4('0x10'),'context':_0x26cab4['context'],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':_0x9be4('0x11'),'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4['exten'],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':_0x9be4('0x1b')+_0x26cab4['id'],'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']}];if(_0x26cab4[_0x9be4('0x1c')](_0x9be4('0x1d'))&&_0x26cab4[_0x9be4('0x1d')]!==_0x9be4('0x1e')){_0x4be2f6[_0x9be4('0xd')]({'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':_0x9be4('0x1f'),'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']},{'type':_0x9be4('0x13'),'app':_0x9be4('0x8'),'appdata':_0x9be4('0x20')+_0x26cab4['recordingFormat']||_0x9be4('0x21'),'context':_0x26cab4[_0x9be4('0x5')],'exten':_0x26cab4[_0x9be4('0x6')],'priority':_0x26d93e++,'VoiceExtensionId':_0x26cab4['id']});}return _0x4be2f6;}function _0x47a207(_0x6f6e3e,_0x4cf603){var _0x4623a5=[{'name':_0x9be4('0x22'),'param':0x0},{'name':'timeout','param':0x1},{'name':_0x9be4('0x23'),'param':0x2},{'name':'url','param':0x3}];var _0x1fc2c9={};var _0x291179=_0x4cf603[_0x9be4('0x24')](',');var _0x2e911a=[];for(var _0x270bb5=0x0;_0x270bb5<_0x4623a5[_0x9be4('0x25')];_0x270bb5++){switch(_0x4623a5[_0x270bb5]['name']){case'trunk':_0x1fc2c9['trunk']=_0x291179[_0x4623a5[_0x270bb5][_0x9be4('0x26')]][_0x9be4('0x24')]('/')[0x1];_0x1fc2c9[_0x9be4('0x27')]=_0x291179[_0x4623a5[_0x270bb5][_0x9be4('0x26')]][_0x9be4('0x24')]('/')[0x2];_0x1fc2c9[_0x9be4('0x28')]=_0x1fc2c9[_0x9be4('0x27')]?_0x1fc2c9['phone'][_0x9be4('0x24')]('$')[0x0]:undefined;_0x1fc2c9[_0x9be4('0x27')]=_0x6f6e3e[_0x9be4('0x14')]?(_0x1fc2c9[_0x9be4('0x28')]||'')+_0x9be4('0x15')+_0x6f6e3e[_0x9be4('0x14')]+'}':(_0x1fc2c9[_0x9be4('0x28')]||'')+_0x9be4('0x16');_0x2e911a[_0x4623a5[_0x270bb5][_0x9be4('0x26')]]=['SIP',_0x1fc2c9[_0x9be4('0x22')],_0x1fc2c9[_0x9be4('0x27')]][_0x9be4('0x29')]('/');break;case _0x9be4('0x23'):_0x1fc2c9[_0x9be4('0x23')]=_0x291179[_0x4623a5[_0x270bb5][_0x9be4('0x26')]];if(_0x6f6e3e[_0x9be4('0x1d')]!==_0x9be4('0x1e')){if(_0x1fc2c9[_0x9be4('0x23')][_0x9be4('0x2a')]('U(xcally-mixmonitor-context)')<0x0){_0x1fc2c9[_0x9be4('0x23')]+=_0x9be4('0x2b');}}else{_0x1fc2c9['options']=_0x1fc2c9[_0x9be4('0x23')][_0x9be4('0x2c')](_0x9be4('0x2b'),'');}_0x2e911a[_0x4623a5[_0x270bb5][_0x9be4('0x26')]]=_0x1fc2c9['options'];break;default:_0x2e911a[_0x4623a5[_0x270bb5][_0x9be4('0x26')]]=_0x291179[_0x4623a5[_0x270bb5][_0x9be4('0x26')]];}}return _0x2e911a[_0x9be4('0x29')](',');}function _0xf94992(_0x70b624,_0xd89f3e,_0x4660c1){return new Promise(function(_0x408ebc,_0x4cef80){var _0x16496a=[];if(_['isEmpty'](_0xd89f3e))return _0x408ebc(_0x16496a);_0x37d576['Interval'][_0x9be4('0x2d')]({'attributes':['id',_0x9be4('0x2e'),_0x9be4('0x2f')],'raw':!![]})[_0x9be4('0x30')](function(_0x1b2d36){for(var _0x5025e5=0x0,_0x5763d=0x0;_0x5025e5<_0xd89f3e[_0x9be4('0x25')];_0x5025e5++,_0x5763d=0x0){var _0x249bbc=_0xd89f3e[_0x5025e5];var _0x1e179a=[];var _0x4c7276=[];delete _0x249bbc['id'];if(_0x249bbc[_0x9be4('0x2e')]!=='*,*,*,*'){_0x249bbc[_0x9be4('0x31')]=[_0x249bbc[_0x9be4('0x2e')]];}else{_0x249bbc[_0x9be4('0x31')]=_0x249bbc['IntervalId']?_['map'](_[_0x9be4('0x32')](_0x1b2d36,{'IntervalId':_0x249bbc[_0x9be4('0x2f')]}),'interval'):[];}_0x249bbc[_0x9be4('0x5')]=_0x70b624['context'];_0x249bbc[_0x9be4('0x6')]=_0x70b624[_0x9be4('0x6')];if(_0x249bbc[_0x9be4('0x3')])_0x249bbc[_0x9be4('0x3')]=_0x249bbc[_0x9be4('0x3')][_0x9be4('0x33')]();if(_0x70b624[_0x9be4('0x3')]===_0x9be4('0x13')){if(_0x249bbc['hasOwnProperty'](_0x9be4('0x34'))&&_0x249bbc[_0x9be4('0x34')]&&_0x249bbc[_0x9be4('0x34')]!=='--'){_0x1e179a[_0x9be4('0xd')]({'type':_0x249bbc['type'][_0x9be4('0x33')](),'app':_0x9be4('0x8'),'appdata':'CDR(tag)='+_0x249bbc[_0x9be4('0x34')],'context':_0x70b624[_0x9be4('0x5')],'exten':_0x70b624['exten'],'priority':_0x249bbc[_0x9be4('0x31')]['length']+_0x4660c1+_0x5763d++,'VoiceExtensionId':_0x70b624['id']});}_0x1e179a[_0x9be4('0xd')]({'type':_0x249bbc[_0x9be4('0x3')]['toLowerCase'](),'app':_0x9be4('0x17'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x249bbc[_0x9be4('0x35')]?_0x9be4('0x36')+_0x249bbc[_0x9be4('0x35')]+')':_0x9be4('0x37')),'context':_0x70b624[_0x9be4('0x5')],'exten':_0x70b624['exten'],'priority':_0x249bbc[_0x9be4('0x31')][_0x9be4('0x25')]+_0x4660c1+_0x5763d++,'VoiceExtensionId':_0x70b624['id']});}else{if(_0x249bbc[_0x9be4('0x1c')]('answer')){if([_0x9be4('0x38'),_0x9be4('0x39')][_0x9be4('0x3a')](_0x249bbc[_0x9be4('0x3b')]['toLowerCase']())&&_0x249bbc[_0x9be4('0x3c')]!=='custom'){if(_0x249bbc[_0x9be4('0x3d')]){_0x1e179a[_0x9be4('0xd')]({'type':_0x249bbc[_0x9be4('0x3')][_0x9be4('0x33')](),'app':_0x9be4('0x17'),'appdata':_0x9be4('0x3e'),'context':_0x70b624[_0x9be4('0x5')],'exten':_0x70b624['exten'],'priority':_0x249bbc[_0x9be4('0x31')][_0x9be4('0x25')]+_0x4660c1+_0x5763d++,'VoiceExtensionId':_0x70b624['id']});_0x1e179a[_0x9be4('0xd')]({'type':_0x249bbc[_0x9be4('0x3')][_0x9be4('0x33')](),'app':_0x9be4('0x8'),'appdata':_0x9be4('0x3f'),'context':_0x70b624[_0x9be4('0x5')],'exten':_0x70b624[_0x9be4('0x6')],'priority':_0x249bbc[_0x9be4('0x31')][_0x9be4('0x25')]+_0x4660c1+_0x5763d++,'VoiceExtensionId':_0x70b624['id']});}else{_0x1e179a['push']({'type':_0x249bbc['type']['toLowerCase'](),'app':_0x9be4('0x17'),'appdata':_0x9be4('0x40'),'context':_0x70b624[_0x9be4('0x5')],'exten':_0x70b624[_0x9be4('0x6')],'priority':_0x249bbc[_0x9be4('0x31')]['length']+_0x4660c1+_0x5763d++,'VoiceExtensionId':_0x70b624['id']});_0x1e179a[_0x9be4('0xd')]({'type':_0x249bbc[_0x9be4('0x3')]['toLowerCase'](),'app':_0x9be4('0x8'),'appdata':_0x9be4('0x41'),'context':_0x70b624[_0x9be4('0x5')],'exten':_0x70b624[_0x9be4('0x6')],'priority':_0x249bbc[_0x9be4('0x31')][_0x9be4('0x25')]+_0x4660c1+_0x5763d++,'VoiceExtensionId':_0x70b624['id']});}}}}for(var _0x4bf263=0x0;_0x4bf263<_0x249bbc[_0x9be4('0x31')][_0x9be4('0x25')];_0x4bf263++){var _0x1241c8=_0x4660c1+_0x249bbc['intervals'][_0x9be4('0x25')];var _0x4157c4=_0x4bf263===_0x249bbc[_0x9be4('0x31')][_0x9be4('0x25')]-0x1?_0x4660c1+_0x1e179a[_0x9be4('0x25')]+_0x4c7276[_0x9be4('0x25')]+0x2:_0x4660c1+_0x4bf263+0x1;_0x1e179a['splice'](_0x4bf263,0x0,{'type':_0x70b624['type'],'app':_0x9be4('0x42'),'appdata':_0x249bbc[_0x9be4('0x31')][_0x4bf263]+'?'+_0x70b624['context']+_0x9be4('0x43')+_0x1241c8+':'+_0x70b624[_0x9be4('0x5')]+_0x9be4('0x43')+_0x4157c4,'exten':_0x70b624[_0x9be4('0x6')],'context':_0x70b624['context'],'priority':_0x4660c1+_0x4bf263,'VoiceExtensionId':_0x70b624['id']});}if(_0x249bbc[_0x9be4('0x3c')]===_0x9be4('0x44')){_0x249bbc[_0x9be4('0x45')]=_0x47a207(_0x70b624,_0x249bbc[_0x9be4('0x45')]);}if(_0x249bbc[_0x9be4('0x3c')]==='agi'){_0x1e179a[_0x9be4('0xd')]({'type':_0x249bbc[_0x9be4('0x3')]['toLowerCase'](),'app':'Set','appdata':_0x9be4('0x46'),'context':_0x70b624[_0x9be4('0x5')],'exten':_0x70b624[_0x9be4('0x6')],'priority':_0x249bbc[_0x9be4('0x31')][_0x9be4('0x25')]+_0x4660c1+_0x5763d++,'VoiceExtensionId':_0x70b624['id']});}_0x249bbc[_0x9be4('0x47')]=_0x1e179a['length']?_['last'](_0x1e179a)[_0x9be4('0x47')]+0x1:_0x4660c1;_0x16496a=_[_0x9be4('0x48')](_0x16496a,_0x1e179a,[_0x249bbc],_0x4c7276);_0x4660c1=_[_0x9be4('0x49')](_0x16496a)['priority']+0x1;}return _0x408ebc(_0x16496a);})['catch'](function(_0xaae169){_0x4cef80(_0xaae169);});});}return _0x2a98e4[_0x9be4('0x4a')]('VoiceExtension',attributes,{'tableName':_0x9be4('0x4b'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x386381){var _0x2690e6=this[_0x9be4('0x4c')]({'plain':!![]});var _0x28f2a7=_0x2690e6[_0x9be4('0x3')]===_0x9be4('0x13')?_0x55ea1b(_0x2690e6):_0x369e03(_0x2690e6);return _0xf94992(_0x2690e6,_0x386381,_[_0x9be4('0x49')](_0x28f2a7)[_0x9be4('0x47')]+0x1)[_0x9be4('0x30')](function(_0x1d3ba8){var _0x28eee1=_[_0x9be4('0x48')](_0x28f2a7,_0x1d3ba8);_0x28eee1['push']({'type':_0x2690e6[_0x9be4('0x3')],'app':_0x9be4('0x4d'),'exten':_0x2690e6[_0x9be4('0x6')],'context':_0x2690e6[_0x9be4('0x5')],'priority':_[_0x9be4('0x49')](_0x28eee1)[_0x9be4('0x47')]+0x1,'VoiceExtensionId':_0x2690e6['id']});return _0x28eee1;});}}});}; \ No newline at end of file +var _0x5dd1=['lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','outbound','CDR(type)=outbound','NoOp','CDR(destination)=','cutdigits','${EXTEN:','ExecIf','):Goto(','CDR(prefix)=noprefix','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','timeout','options','split','length','name','trunk','param','phone','prefix','${EXTEN}','SIP','join','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','interval','IntervalId','then','filter','toLowerCase','tag','CDR(tag)=','intervals','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','playback','includes','app','appType','answer','XCALLY-MOTION-ANSWER=1','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime','appdata','XMCS-UNIQUEID=${CHANNEL(LINKEDID)}','priority','last','concat','catch','VoiceExtension','voice_extensions','get','Hangup'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x5dd1,0xed));var _0x15dd=function(_0x43dbe9,_0xf43a4a){_0x43dbe9=_0x43dbe9-0x0;var _0x11a746=_0x5dd1[_0x43dbe9];return _0x11a746;};'use strict';var _=require(_0x15dd('0x0'));var attributes=require(_0x15dd('0x1'));module['exports']=function(_0x4282d9){var _0x3e5b75=_0x4282d9[_0x15dd('0x2')];function _0x3247f3(_0x3fd855){var _0x1572e5=0x2;var _0x1e4d7e=[{'type':_0x3fd855[_0x15dd('0x3')],'app':_0x15dd('0x4'),'appdata':_0x15dd('0x5')+_0x3fd855[_0x15dd('0x3')],'context':_0x3fd855[_0x15dd('0x6')],'exten':_0x3fd855[_0x15dd('0x7')],'priority':_0x1572e5++,'VoiceExtensionId':_0x3fd855['id']},{'type':_0x3fd855['type'],'app':_0x3fd855[_0x15dd('0x8')]?_0x15dd('0x4'):'NoOp','appdata':_0x3fd855['alias']?_0x15dd('0x9')+_0x3fd855[_0x15dd('0x8')]:_0x15dd('0xa'),'context':_0x3fd855[_0x15dd('0x6')],'exten':_0x3fd855[_0x15dd('0x7')],'priority':_0x1572e5++,'VoiceExtensionId':_0x3fd855['id']}];if(_0x3fd855[_0x15dd('0x3')]===_0x15dd('0xb')){_0x1e4d7e['push']({'type':_0x15dd('0xb'),'app':'Set','appdata':'CDR(routeid)='+_0x3fd855['id'],'context':_0x3fd855[_0x15dd('0x6')],'exten':_0x3fd855[_0x15dd('0x7')],'priority':_0x1572e5++,'VoiceExtensionId':_0x3fd855['id']});}_0x1e4d7e[_0x15dd('0xc')]({'type':_0x3fd855[_0x15dd('0x3')],'app':'Set','appdata':_0x15dd('0xd'),'context':_0x3fd855[_0x15dd('0x6')],'exten':_0x3fd855[_0x15dd('0x7')],'priority':_0x1572e5++,'VoiceExtensionId':_0x3fd855['id']},{'type':_0x3fd855[_0x15dd('0x3')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3fd855[_0x15dd('0x6')],'exten':_0x3fd855[_0x15dd('0x7')],'priority':_0x1572e5++,'VoiceExtensionId':_0x3fd855['id']},{'type':_0x3fd855['type'],'app':_0x15dd('0x4'),'appdata':'MONITOR_OPTIONS=ab','context':_0x3fd855[_0x15dd('0x6')],'exten':_0x3fd855[_0x15dd('0x7')],'priority':_0x1572e5++,'VoiceExtensionId':_0x3fd855['id']});return _0x1e4d7e;}function _0x2c6610(_0x2583fe){var _0x3938ea=0x2;var _0x4f65ec=[{'type':_0x15dd('0xe'),'app':'Set','appdata':_0x15dd('0xf'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe[_0x15dd('0x7')],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':'outbound','app':_0x2583fe[_0x15dd('0x8')]?'Set':_0x15dd('0x10'),'appdata':_0x2583fe[_0x15dd('0x8')]?'CDR(routeAlias)='+_0x2583fe[_0x15dd('0x8')]:_0x15dd('0xa'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe['exten'],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':'outbound','app':_0x15dd('0x4'),'appdata':_0x15dd('0x11')+(_0x2583fe[_0x15dd('0x12')]?_0x15dd('0x13')+_0x2583fe[_0x15dd('0x12')]+'}':'${EXTEN}'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe['exten'],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':_0x15dd('0xe'),'app':_0x15dd('0x4'),'appdata':'CDR(routeid)='+_0x2583fe['id'],'context':_0x2583fe['context'],'exten':_0x2583fe[_0x15dd('0x7')],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':_0x15dd('0xe'),'app':_0x15dd('0x14'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x3938ea+0x2)+_0x15dd('0x15')+(_0x3938ea+0x1)+')','context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe[_0x15dd('0x7')],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':_0x15dd('0xe'),'app':_0x15dd('0x4'),'appdata':_0x2583fe['cutdigits']?'CDR(prefix)=${EXTEN:0:'+_0x2583fe['cutdigits']+'}':_0x15dd('0x16'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe['exten'],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':'outbound','app':_0x15dd('0x4'),'appdata':_0x15dd('0xd'),'context':_0x2583fe['context'],'exten':_0x2583fe[_0x15dd('0x7')],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':_0x15dd('0xe'),'app':_0x15dd('0x4'),'appdata':_0x15dd('0x17'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe[_0x15dd('0x7')],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':_0x15dd('0xe'),'app':'Set','appdata':_0x15dd('0x18'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe['exten'],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':_0x15dd('0xe'),'app':'Set','appdata':_0x15dd('0x19')+_0x2583fe['id'],'context':_0x2583fe['context'],'exten':_0x2583fe['exten'],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']}];if(_0x2583fe[_0x15dd('0x1a')](_0x15dd('0x1b'))&&_0x2583fe[_0x15dd('0x1b')]!==_0x15dd('0x1c')){_0x4f65ec[_0x15dd('0xc')]({'type':_0x15dd('0xe'),'app':_0x15dd('0x4'),'appdata':_0x15dd('0x1d'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe[_0x15dd('0x7')],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']},{'type':_0x15dd('0xe'),'app':_0x15dd('0x4'),'appdata':_0x15dd('0x1e')+_0x2583fe[_0x15dd('0x1b')]||_0x15dd('0x1f'),'context':_0x2583fe[_0x15dd('0x6')],'exten':_0x2583fe[_0x15dd('0x7')],'priority':_0x3938ea++,'VoiceExtensionId':_0x2583fe['id']});}return _0x4f65ec;}function _0x479261(_0x2d9424,_0xf61328){var _0x5d1273=[{'name':'trunk','param':0x0},{'name':_0x15dd('0x20'),'param':0x1},{'name':_0x15dd('0x21'),'param':0x2},{'name':'url','param':0x3}];var _0x5ad09e={};var _0x2e02fa=_0xf61328[_0x15dd('0x22')](',');var _0x565041=[];for(var _0x2e92ca=0x0;_0x2e92ca<_0x5d1273[_0x15dd('0x23')];_0x2e92ca++){switch(_0x5d1273[_0x2e92ca][_0x15dd('0x24')]){case _0x15dd('0x25'):_0x5ad09e[_0x15dd('0x25')]=_0x2e02fa[_0x5d1273[_0x2e92ca][_0x15dd('0x26')]][_0x15dd('0x22')]('/')[0x1];_0x5ad09e[_0x15dd('0x27')]=_0x2e02fa[_0x5d1273[_0x2e92ca][_0x15dd('0x26')]]['split']('/')[0x2];_0x5ad09e[_0x15dd('0x28')]=_0x5ad09e['phone']?_0x5ad09e[_0x15dd('0x27')][_0x15dd('0x22')]('$')[0x0]:undefined;_0x5ad09e[_0x15dd('0x27')]=_0x2d9424['cutdigits']?(_0x5ad09e[_0x15dd('0x28')]||'')+_0x15dd('0x13')+_0x2d9424['cutdigits']+'}':(_0x5ad09e['prefix']||'')+_0x15dd('0x29');_0x565041[_0x5d1273[_0x2e92ca][_0x15dd('0x26')]]=[_0x15dd('0x2a'),_0x5ad09e[_0x15dd('0x25')],_0x5ad09e[_0x15dd('0x27')]][_0x15dd('0x2b')]('/');break;case _0x15dd('0x21'):_0x5ad09e[_0x15dd('0x21')]=_0x2e02fa[_0x5d1273[_0x2e92ca][_0x15dd('0x26')]];if(_0x2d9424['recordingFormat']!==_0x15dd('0x1c')){if(_0x5ad09e[_0x15dd('0x21')][_0x15dd('0x2c')]('U(xcally-mixmonitor-context)')<0x0){_0x5ad09e[_0x15dd('0x21')]+=_0x15dd('0x2d');}}else{_0x5ad09e[_0x15dd('0x21')]=_0x5ad09e[_0x15dd('0x21')][_0x15dd('0x2e')](_0x15dd('0x2d'),'');}_0x565041[_0x5d1273[_0x2e92ca][_0x15dd('0x26')]]=_0x5ad09e[_0x15dd('0x21')];break;default:_0x565041[_0x5d1273[_0x2e92ca][_0x15dd('0x26')]]=_0x2e02fa[_0x5d1273[_0x2e92ca]['param']];}}return _0x565041[_0x15dd('0x2b')](',');}function _0x315223(_0x2a05d7,_0x50d182,_0x995fde){return new Promise(function(_0x476566,_0x57e1cb){var _0x24bed0=[];if(_[_0x15dd('0x2f')](_0x50d182))return _0x476566(_0x24bed0);_0x3e5b75[_0x15dd('0x30')]['findAll']({'attributes':['id',_0x15dd('0x31'),_0x15dd('0x32')],'raw':!![]})[_0x15dd('0x33')](function(_0xdfd42d){for(var _0x27e4d1=0x0,_0x179e64=0x0;_0x27e4d1<_0x50d182[_0x15dd('0x23')];_0x27e4d1++,_0x179e64=0x0){var _0x53f567=_0x50d182[_0x27e4d1];var _0xdae672=[];var _0x5f2f74=[];delete _0x53f567['id'];if(_0x53f567['interval']!=='*,*,*,*'){_0x53f567['intervals']=[_0x53f567['interval']];}else{_0x53f567['intervals']=_0x53f567[_0x15dd('0x32')]?_['map'](_[_0x15dd('0x34')](_0xdfd42d,{'IntervalId':_0x53f567['IntervalId']}),'interval'):[];}_0x53f567[_0x15dd('0x6')]=_0x2a05d7[_0x15dd('0x6')];_0x53f567[_0x15dd('0x7')]=_0x2a05d7[_0x15dd('0x7')];if(_0x53f567[_0x15dd('0x3')])_0x53f567[_0x15dd('0x3')]=_0x53f567['type'][_0x15dd('0x35')]();if(_0x2a05d7[_0x15dd('0x3')]===_0x15dd('0xe')){if(_0x53f567[_0x15dd('0x1a')](_0x15dd('0x36'))&&_0x53f567[_0x15dd('0x36')]&&_0x53f567['tag']!=='--'){_0xdae672[_0x15dd('0xc')]({'type':_0x53f567[_0x15dd('0x3')][_0x15dd('0x35')](),'app':'Set','appdata':_0x15dd('0x37')+_0x53f567['tag'],'context':_0x2a05d7[_0x15dd('0x6')],'exten':_0x2a05d7[_0x15dd('0x7')],'priority':_0x53f567[_0x15dd('0x38')][_0x15dd('0x23')]+_0x995fde+_0x179e64++,'VoiceExtensionId':_0x2a05d7['id']});}_0xdae672['push']({'type':_0x53f567[_0x15dd('0x3')][_0x15dd('0x35')](),'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x53f567[_0x15dd('0x39')]?_0x15dd('0x3a')+_0x53f567[_0x15dd('0x39')]+')':_0x15dd('0x3b')),'context':_0x2a05d7[_0x15dd('0x6')],'exten':_0x2a05d7[_0x15dd('0x7')],'priority':_0x53f567[_0x15dd('0x38')][_0x15dd('0x23')]+_0x995fde+_0x179e64++,'VoiceExtensionId':_0x2a05d7['id']});}else{if(_0x53f567['hasOwnProperty']('answer')){if(['queue',_0x15dd('0x3c')][_0x15dd('0x3d')](_0x53f567[_0x15dd('0x3e')][_0x15dd('0x35')]())&&_0x53f567[_0x15dd('0x3f')]!=='custom'){if(_0x53f567[_0x15dd('0x40')]){_0xdae672[_0x15dd('0xc')]({'type':_0x53f567['type'][_0x15dd('0x35')](),'app':_0x15dd('0x14'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x2a05d7[_0x15dd('0x6')],'exten':_0x2a05d7[_0x15dd('0x7')],'priority':_0x53f567[_0x15dd('0x38')][_0x15dd('0x23')]+_0x995fde+_0x179e64++,'VoiceExtensionId':_0x2a05d7['id']});_0xdae672[_0x15dd('0xc')]({'type':_0x53f567['type'][_0x15dd('0x35')](),'app':_0x15dd('0x4'),'appdata':_0x15dd('0x41'),'context':_0x2a05d7['context'],'exten':_0x2a05d7[_0x15dd('0x7')],'priority':_0x53f567[_0x15dd('0x38')][_0x15dd('0x23')]+_0x995fde+_0x179e64++,'VoiceExtensionId':_0x2a05d7['id']});}else{_0xdae672[_0x15dd('0xc')]({'type':_0x53f567[_0x15dd('0x3')][_0x15dd('0x35')](),'app':_0x15dd('0x14'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x2a05d7[_0x15dd('0x6')],'exten':_0x2a05d7['exten'],'priority':_0x53f567[_0x15dd('0x38')]['length']+_0x995fde+_0x179e64++,'VoiceExtensionId':_0x2a05d7['id']});_0xdae672[_0x15dd('0xc')]({'type':_0x53f567[_0x15dd('0x3')][_0x15dd('0x35')](),'app':'Set','appdata':_0x15dd('0x42'),'context':_0x2a05d7[_0x15dd('0x6')],'exten':_0x2a05d7[_0x15dd('0x7')],'priority':_0x53f567[_0x15dd('0x38')][_0x15dd('0x23')]+_0x995fde+_0x179e64++,'VoiceExtensionId':_0x2a05d7['id']});}}}}for(var _0x128312=0x0;_0x128312<_0x53f567['intervals'][_0x15dd('0x23')];_0x128312++){var _0x8e5a6e=_0x995fde+_0x53f567[_0x15dd('0x38')][_0x15dd('0x23')];var _0x30cdfc=_0x128312===_0x53f567[_0x15dd('0x38')]['length']-0x1?_0x995fde+_0xdae672[_0x15dd('0x23')]+_0x5f2f74[_0x15dd('0x23')]+0x2:_0x995fde+_0x128312+0x1;_0xdae672[_0x15dd('0x43')](_0x128312,0x0,{'type':_0x2a05d7[_0x15dd('0x3')],'app':_0x15dd('0x44'),'appdata':_0x53f567[_0x15dd('0x38')][_0x128312]+'?'+_0x2a05d7[_0x15dd('0x6')]+',${EXTEN},'+_0x8e5a6e+':'+_0x2a05d7[_0x15dd('0x6')]+',${EXTEN},'+_0x30cdfc,'exten':_0x2a05d7[_0x15dd('0x7')],'context':_0x2a05d7['context'],'priority':_0x995fde+_0x128312,'VoiceExtensionId':_0x2a05d7['id']});}if(_0x53f567[_0x15dd('0x3f')]==='outboundDial'){_0x53f567[_0x15dd('0x45')]=_0x479261(_0x2a05d7,_0x53f567['appdata']);}if(_0x53f567[_0x15dd('0x3f')]==='agi'){_0xdae672['push']({'type':_0x53f567[_0x15dd('0x3')][_0x15dd('0x35')](),'app':_0x15dd('0x4'),'appdata':_0x15dd('0x46'),'context':_0x2a05d7[_0x15dd('0x6')],'exten':_0x2a05d7[_0x15dd('0x7')],'priority':_0x53f567[_0x15dd('0x38')][_0x15dd('0x23')]+_0x995fde+_0x179e64++,'VoiceExtensionId':_0x2a05d7['id']});}_0x53f567[_0x15dd('0x47')]=_0xdae672[_0x15dd('0x23')]?_[_0x15dd('0x48')](_0xdae672)[_0x15dd('0x47')]+0x1:_0x995fde;_0x24bed0=_[_0x15dd('0x49')](_0x24bed0,_0xdae672,[_0x53f567],_0x5f2f74);_0x995fde=_[_0x15dd('0x48')](_0x24bed0)['priority']+0x1;}return _0x476566(_0x24bed0);})[_0x15dd('0x4a')](function(_0x133acd){_0x57e1cb(_0x133acd);});});}return _0x4282d9['define'](_0x15dd('0x4b'),attributes,{'tableName':_0x15dd('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x23f916){var _0x4f98ea=this[_0x15dd('0x4d')]({'plain':!![]});var _0x61dc66=_0x4f98ea[_0x15dd('0x3')]===_0x15dd('0xe')?_0x2c6610(_0x4f98ea):_0x3247f3(_0x4f98ea);return _0x315223(_0x4f98ea,_0x23f916,_[_0x15dd('0x48')](_0x61dc66)[_0x15dd('0x47')]+0x1)['then'](function(_0xc129fc){var _0xc24378=_[_0x15dd('0x49')](_0x61dc66,_0xc129fc);_0xc24378[_0x15dd('0xc')]({'type':_0x4f98ea[_0x15dd('0x3')],'app':_0x15dd('0x4e'),'exten':_0x4f98ea[_0x15dd('0x7')],'context':_0x4f98ea[_0x15dd('0x6')],'priority':_[_0x15dd('0x48')](_0xc24378)[_0x15dd('0x47')]+0x1,'VoiceExtensionId':_0x4f98ea['id']});return _0xc24378;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 0fd13e9..7f39b33 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 _0x078c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','info','GetVoiceExtension','catch','lodash','moment','bluebird'];(function(_0xc9a730,_0x5c37c7){var _0x1bfdda=function(_0x223e9c){while(--_0x223e9c){_0xc9a730['push'](_0xc9a730['shift']());}};_0x1bfdda(++_0x5c37c7);}(_0x078c,0x19f));var _0xc078=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x078c[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0xc078('0x0'));var util=require('util');var moment=require(_0xc078('0x1'));var BPromise=require(_0xc078('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc078('0x3'));var db=require(_0xc078('0x4'))['db'];var utils=require(_0xc078('0x5'));var logger=require(_0xc078('0x6'))('rpc');var config=require(_0xc078('0x7'));var jayson=require(_0xc078('0x8'));var client=jayson[_0xc078('0x9')][_0xc078('0xa')]({'port':0x232a});config[_0xc078('0xb')]=_[_0xc078('0xc')](config[_0xc078('0xb')],{'host':_0xc078('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xc078('0xe')](socket);function respondWithRpcPromise(_0x1bd3ba,_0x47aca0,_0xf3ab2c){return new BPromise(function(_0x7eeb05,_0x3119f7){return client[_0xc078('0xf')](_0x1bd3ba,_0xf3ab2c)[_0xc078('0x10')](function(_0x5cd849){logger['info'](_0xc078('0x11'),_0x47aca0,_0xc078('0x12'));logger[_0xc078('0x13')](_0xc078('0x14'),_0x47aca0,_0xc078('0x12'),JSON[_0xc078('0x15')](_0x5cd849));if(_0x5cd849[_0xc078('0x16')]){if(_0x5cd849[_0xc078('0x16')][_0xc078('0x17')]===0x1f4){logger[_0xc078('0x16')](_0xc078('0x11'),_0x47aca0,_0x5cd849[_0xc078('0x16')][_0xc078('0x18')]);return _0x3119f7(_0x5cd849[_0xc078('0x16')][_0xc078('0x18')]);}logger['error'](_0xc078('0x11'),_0x47aca0,_0x5cd849[_0xc078('0x16')][_0xc078('0x18')]);return _0x7eeb05(_0x5cd849['error'][_0xc078('0x18')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x47aca0,_0xc078('0x12'));_0x7eeb05(_0x5cd849['result'][_0xc078('0x18')]);}})['catch'](function(_0x9d3868){logger[_0xc078('0x16')](_0xc078('0x11'),_0x47aca0,_0x9d3868);_0x3119f7(_0x9d3868);});});}exports['GetVoiceExtension']=function(_0x2e0825){var _0x4a05ee=this;return new Promise(function(_0xcf2627,_0x2a9bbf){return db[_0xc078('0x19')][_0xc078('0x1a')]({'raw':_0x2e0825[_0xc078('0x1b')]?_0x2e0825['options'][_0xc078('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e0825[_0xc078('0x1b')]?_0x2e0825[_0xc078('0x1b')][_0xc078('0x1d')]||null:null,'attributes':_0x2e0825['options']?_0x2e0825[_0xc078('0x1b')][_0xc078('0x1e')]||null:null,'limit':_0x2e0825[_0xc078('0x1b')]?_0x2e0825[_0xc078('0x1b')][_0xc078('0x1f')]||null:null,'include':_0x2e0825[_0xc078('0x1b')]?_0x2e0825[_0xc078('0x1b')][_0xc078('0x20')]?_[_0xc078('0x21')](_0x2e0825[_0xc078('0x1b')][_0xc078('0x20')],function(_0x531945){return{'model':db[_0x531945['model']],'as':_0x531945['as'],'attributes':_0x531945[_0xc078('0x1e')],'include':_0x531945['include']?_['map'](_0x531945['include'],function(_0x3c7843){return{'model':db[_0x3c7843['model']],'as':_0x3c7843['as'],'attributes':_0x3c7843[_0xc078('0x1e')],'include':_0x3c7843[_0xc078('0x20')]?_[_0xc078('0x21')](_0x3c7843[_0xc078('0x20')],function(_0xd43338){return{'model':db[_0xd43338[_0xc078('0x22')]],'as':_0xd43338['as'],'attributes':_0xd43338[_0xc078('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xc078('0x10')](function(_0x50e5d){logger[_0xc078('0x23')](_0xc078('0x24'),_0x2e0825);logger['debug'](_0xc078('0x24'),_0x2e0825,JSON['stringify'](_0x50e5d));_0xcf2627(_0x50e5d);})[_0xc078('0x25')](function(_0x10949c){logger[_0xc078('0x16')](_0xc078('0x24'),_0x10949c['message'],_0x2e0825);_0x2a9bbf(_0x4a05ee[_0xc078('0x16')](0x1f4,_0x10949c['message']));});});}; \ No newline at end of file +var _0xd6d2=['findAll','options','raw','where','include','map','attributes','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension'];(function(_0x11df9b,_0x14619b){var _0x3c4400=function(_0x3de933){while(--_0x3de933){_0x11df9b['push'](_0x11df9b['shift']());}};_0x3c4400(++_0x14619b);}(_0xd6d2,0xcb));var _0x2d6d=function(_0x169c24,_0x31eeea){_0x169c24=_0x169c24-0x0;var _0x2b9692=_0xd6d2[_0x169c24];return _0x2b9692;};'use strict';var _=require(_0x2d6d('0x0'));var util=require(_0x2d6d('0x1'));var moment=require('moment');var BPromise=require(_0x2d6d('0x2'));var rs=require(_0x2d6d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d6d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2d6d('0x5'))(_0x2d6d('0x6'));var config=require(_0x2d6d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2d6d('0x8')][_0x2d6d('0x9')]({'port':0x232a});config[_0x2d6d('0xa')]=_[_0x2d6d('0xb')](config[_0x2d6d('0xa')],{'host':_0x2d6d('0xc'),'port':0x18eb});var socket=require(_0x2d6d('0xd'))(new Redis(config[_0x2d6d('0xa')]));require(_0x2d6d('0xe'))[_0x2d6d('0xf')](socket);function respondWithRpcPromise(_0x1a1f60,_0x4bf440,_0x25fc41){return new BPromise(function(_0x32a9c3,_0x3ea447){return client[_0x2d6d('0x10')](_0x1a1f60,_0x25fc41)[_0x2d6d('0x11')](function(_0x4f1a98){logger[_0x2d6d('0x12')](_0x2d6d('0x13'),_0x4bf440,_0x2d6d('0x14'));logger[_0x2d6d('0x15')](_0x2d6d('0x16'),_0x4bf440,'request\x20sent',JSON[_0x2d6d('0x17')](_0x4f1a98));if(_0x4f1a98[_0x2d6d('0x18')]){if(_0x4f1a98[_0x2d6d('0x18')][_0x2d6d('0x19')]===0x1f4){logger['error'](_0x2d6d('0x13'),_0x4bf440,_0x4f1a98[_0x2d6d('0x18')]['message']);return _0x3ea447(_0x4f1a98['error'][_0x2d6d('0x1a')]);}logger[_0x2d6d('0x18')](_0x2d6d('0x13'),_0x4bf440,_0x4f1a98['error'][_0x2d6d('0x1a')]);return _0x32a9c3(_0x4f1a98['error']['message']);}else{logger['info'](_0x2d6d('0x13'),_0x4bf440,_0x2d6d('0x14'));_0x32a9c3(_0x4f1a98[_0x2d6d('0x1b')][_0x2d6d('0x1a')]);}})[_0x2d6d('0x1c')](function(_0x1bb4db){logger[_0x2d6d('0x18')](_0x2d6d('0x13'),_0x4bf440,_0x1bb4db);_0x3ea447(_0x1bb4db);});});}exports[_0x2d6d('0x1d')]=function(_0x4898a7){var _0x315d13=this;return new Promise(function(_0x41d287,_0x5b0c61){return db[_0x2d6d('0x1e')][_0x2d6d('0x1f')]({'raw':_0x4898a7[_0x2d6d('0x20')]?_0x4898a7[_0x2d6d('0x20')][_0x2d6d('0x21')]===undefined?!![]:![]:!![],'where':_0x4898a7[_0x2d6d('0x20')]?_0x4898a7['options'][_0x2d6d('0x22')]||null:null,'attributes':_0x4898a7[_0x2d6d('0x20')]?_0x4898a7[_0x2d6d('0x20')]['attributes']||null:null,'limit':_0x4898a7['options']?_0x4898a7[_0x2d6d('0x20')]['limit']||null:null,'include':_0x4898a7['options']?_0x4898a7['options'][_0x2d6d('0x23')]?_[_0x2d6d('0x24')](_0x4898a7[_0x2d6d('0x20')][_0x2d6d('0x23')],function(_0x3e5a92){return{'model':db[_0x3e5a92['model']],'as':_0x3e5a92['as'],'attributes':_0x3e5a92[_0x2d6d('0x25')],'include':_0x3e5a92[_0x2d6d('0x23')]?_[_0x2d6d('0x24')](_0x3e5a92[_0x2d6d('0x23')],function(_0x33817d){return{'model':db[_0x33817d[_0x2d6d('0x26')]],'as':_0x33817d['as'],'attributes':_0x33817d[_0x2d6d('0x25')],'include':_0x33817d[_0x2d6d('0x23')]?_[_0x2d6d('0x24')](_0x33817d['include'],function(_0x1016e1){return{'model':db[_0x1016e1[_0x2d6d('0x26')]],'as':_0x1016e1['as'],'attributes':_0x1016e1[_0x2d6d('0x25')]};}):[]};}):[]};}):[]:[]})[_0x2d6d('0x11')](function(_0x486963){logger[_0x2d6d('0x12')]('GetVoiceExtension',_0x4898a7);logger[_0x2d6d('0x15')]('GetVoiceExtension',_0x4898a7,JSON['stringify'](_0x486963));_0x41d287(_0x486963);})[_0x2d6d('0x1c')](function(_0x557ad8){logger[_0x2d6d('0x18')](_0x2d6d('0x1d'),_0x557ad8['message'],_0x4898a7);_0x5b0c61(_0x315d13[_0x2d6d('0x18')](0x1f4,_0x557ad8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 8e50513..b9f3259 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 _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x47276a,_0x192634){var _0x932957=function(_0x1f0b81){while(--_0x1f0b81){_0x47276a['push'](_0x47276a['shift']());}};_0x932957(++_0x192634);}(_0x4975,0x86));var _0x5497=function(_0x4b5ab6,_0x5974a7){_0x4b5ab6=_0x4b5ab6-0x0;var _0x366b81=_0x4975[_0x4b5ab6];return _0x366b81;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file +var _0x4975=['length','./voiceExtension.events','remove','update','emit','removeListener','register'];(function(_0x344928,_0x213937){var _0x329b36=function(_0x5a5b5f){while(--_0x5a5b5f){_0x344928['push'](_0x344928['shift']());}};_0x329b36(++_0x213937);}(_0x4975,0x86));var _0x5497=function(_0x24dd9,_0x33428a){_0x24dd9=_0x24dd9-0x0;var _0x5c308c=_0x4975[_0x24dd9];return _0x5c308c;};'use strict';var VoiceExtensionEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){VoiceExtensionEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('voiceExtension:'+_0x674a2a,_0x539a27);VoiceExtensionEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 7a7958b..f79746f 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 _0x6455=['get','isAuthenticated','index','/:id','/:id/messages','getMessages','post','create','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller'];(function(_0x3af324,_0x431fdb){var _0x14d7af=function(_0x259f35){while(--_0x259f35){_0x3af324['push'](_0x3af324['shift']());}};_0x14d7af(++_0x431fdb);}(_0x6455,0x97));var _0x5645=function(_0x4b1750,_0x3934ad){_0x4b1750=_0x4b1750-0x0;var _0x3b03bd=_0x6455[_0x4b1750];return _0x3b03bd;};'use strict';var multer=require(_0x5645('0x0'));var util=require('util');var path=require(_0x5645('0x1'));var timeout=require(_0x5645('0x2'));var express=require(_0x5645('0x3'));var router=express[_0x5645('0x4')]();var fs_extra=require(_0x5645('0x5'));var auth=require(_0x5645('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5645('0x7'));var controller=require(_0x5645('0x8'));router[_0x5645('0x9')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0xb')]);router[_0x5645('0x9')](_0x5645('0xc'),auth[_0x5645('0xa')](),controller['show']);router['get'](_0x5645('0xd'),auth[_0x5645('0xa')](),controller[_0x5645('0xe')]);router[_0x5645('0xf')]('/',auth[_0x5645('0xa')](),controller[_0x5645('0x10')]);router['put'](_0x5645('0xc'),auth[_0x5645('0xa')](),controller[_0x5645('0x11')]);router[_0x5645('0x12')]('/:id',auth[_0x5645('0xa')](),controller['destroy']);module[_0x5645('0x13')]=router; \ No newline at end of file +var _0xba34=['getMessages','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','show','/:id/messages'];(function(_0x267a92,_0x144bb1){var _0x41c589=function(_0x4ceae2){while(--_0x4ceae2){_0x267a92['push'](_0x267a92['shift']());}};_0x41c589(++_0x144bb1);}(_0xba34,0x119));var _0x4ba3=function(_0x449758,_0x3ca803){_0x449758=_0x449758-0x0;var _0x3fdfe6=_0xba34[_0x449758];return _0x3fdfe6;};'use strict';var multer=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var path=require(_0x4ba3('0x2'));var timeout=require(_0x4ba3('0x3'));var express=require(_0x4ba3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var controller=require(_0x4ba3('0x7'));router[_0x4ba3('0x8')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xa')]);router[_0x4ba3('0x8')]('/:id',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xb')]);router[_0x4ba3('0x8')](_0x4ba3('0xc'),auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xd')]);router[_0x4ba3('0xe')]('/',auth[_0x4ba3('0x9')](),controller[_0x4ba3('0xf')]);router[_0x4ba3('0x10')](_0x4ba3('0x11'),auth['isAuthenticated'](),controller[_0x4ba3('0x12')]);router[_0x4ba3('0x13')]('/:id',auth[_0x4ba3('0x9')](),controller['destroy']);module[_0x4ba3('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 3f2a033..96a294d 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 _0x5fa0=['contest_mailbox','setDataValue','email','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail'];(function(_0x239244,_0x4e2066){var _0x4739d0=function(_0x17fcd9){while(--_0x17fcd9){_0x239244['push'](_0x239244['shift']());}};_0x4739d0(++_0x4e2066);}(_0x5fa0,0xe0));var _0x05fa=function(_0x55b946,_0x30bede){_0x55b946=_0x55b946-0x0;var _0x538666=_0x5fa0[_0x55b946];return _0x538666;};'use strict';var Sequelize=require(_0x05fa('0x0'));module[_0x05fa('0x1')]={'customer_id':{'type':Sequelize[_0x05fa('0x2')]},'context':{'type':Sequelize[_0x05fa('0x2')],'defaultValue':_0x05fa('0x3'),'unique':_0x05fa('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x05fa('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x05fa('0x2')],'validate':{'isEmail':!![]},'set':function(_0x48ef26){this[_0x05fa('0x5')](_0x05fa('0x6'),typeof _0x48ef26==='string'&&_0x48ef26[_0x05fa('0x7')]()?_0x48ef26['trim']():null);}},'pager':{'type':Sequelize[_0x05fa('0x2')]},'tz':{'type':Sequelize[_0x05fa('0x2')],'defaultValue':_0x05fa('0x8')},'attach':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':_0x05fa('0xa'),'allowNull':![]},'dialout':{'type':Sequelize[_0x05fa('0x2')]},'callback':{'type':Sequelize[_0x05fa('0x2')]},'review':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM'](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x05fa('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':_0x05fa('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x05fa('0x9')](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x05fa('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x05fa('0x9')]('yes','no'),'defaultValue':_0x05fa('0xa'),'allowNull':![]},'stamp':{'type':_0x05fa('0xc')},'emailsubject':{'type':Sequelize[_0x05fa('0x2')]},'emailbody':{'type':Sequelize[_0x05fa('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x05fa('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x05fa('0xe')],'get':function(){return this[_0x05fa('0xf')](_0x05fa('0x10'))+_0x05fa('0x11')+this['getDataValue'](_0x05fa('0x12'));}}}; \ No newline at end of file +var _0x4fe6=['TIMESTAMP','INTEGER','VIRTUAL','\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes','ENUM'];(function(_0x35fd27,_0x3dc2cd){var _0x5733c7=function(_0x2c836e){while(--_0x2c836e){_0x35fd27['push'](_0x35fd27['shift']());}};_0x5733c7(++_0x3dc2cd);}(_0x4fe6,0xc1));var _0x64fe=function(_0x3669bd,_0x4bcb4c){_0x3669bd=_0x3669bd-0x0;var _0x7a401e=_0x4fe6[_0x3669bd];return _0x7a401e;};'use strict';var Sequelize=require(_0x64fe('0x0'));module[_0x64fe('0x1')]={'customer_id':{'type':Sequelize[_0x64fe('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x64fe('0x3'),'unique':_0x64fe('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0x64fe('0x4')},'password':{'type':Sequelize[_0x64fe('0x2')]},'fullname':{'type':Sequelize[_0x64fe('0x2')]},'email':{'type':Sequelize[_0x64fe('0x2')],'validate':{'isEmail':!![]},'set':function(_0x59a26a){this[_0x64fe('0x5')]('email',typeof _0x59a26a===_0x64fe('0x6')&&_0x59a26a[_0x64fe('0x7')]()?_0x59a26a['trim']():null);}},'pager':{'type':Sequelize[_0x64fe('0x2')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x64fe('0x8')},'attach':{'type':Sequelize['ENUM'](_0x64fe('0x9'),'no'),'defaultValue':_0x64fe('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':_0x64fe('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x64fe('0x2')]},'callback':{'type':Sequelize[_0x64fe('0x2')]},'review':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x64fe('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x64fe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x64fe('0xa')](_0x64fe('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'stamp':{'type':_0x64fe('0xb')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x64fe('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x64fe('0xd')],'get':function(){return this['getDataValue']('fullname')+_0x64fe('0xe')+this[_0x64fe('0xf')](_0x64fe('0x10'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index fa54353..049b41a 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 _0xb574=['filter','merge','VoiceMail','includeAll','findAll','rows','catch','show','params','intersection','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','body','length','pick','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','fs-extra','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','error','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x13e724,_0x296739){var _0x334a44=function(_0x28f54e){while(--_0x28f54e){_0x13e724['push'](_0x13e724['shift']());}};_0x334a44(++_0x296739);}(_0xb574,0x106));var _0x4b57=function(_0x257206,_0x5548b0){_0x257206=_0x257206-0x0;var _0x263019=_0xb574[_0x257206];return _0x263019;};'use strict';var emlformat=require(_0x4b57('0x0'));var rimraf=require(_0x4b57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b57('0x2'));var rp=require(_0x4b57('0x3'));var moment=require('moment');var BPromise=require(_0x4b57('0x4'));var Mustache=require(_0x4b57('0x5'));var util=require(_0x4b57('0x6'));var path=require(_0x4b57('0x7'));var sox=require(_0x4b57('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4b57('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4b57('0xa'));var toCsv=require(_0x4b57('0xb'));var querystring=require(_0x4b57('0xc'));var Papa=require(_0x4b57('0xd'));var Redis=require(_0x4b57('0xe'));var authService=require(_0x4b57('0xf'));var qs=require(_0x4b57('0x10'));var as=require(_0x4b57('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b57('0x12'))(_0x4b57('0x13'));var utils=require(_0x4b57('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b57('0x15'))['db'];function respondWithStatusCode(_0x357c8b,_0x43d066){_0x43d066=_0x43d066||0xcc;return function(_0xf8a6fc){if(_0xf8a6fc){return _0x357c8b[_0x4b57('0x16')](_0x43d066);}return _0x357c8b[_0x4b57('0x17')](_0x43d066)[_0x4b57('0x18')]();};}function respondWithResult(_0xd5ee6d,_0x31cced){_0x31cced=_0x31cced||0xc8;return function(_0x4e15be){if(_0x4e15be){return _0xd5ee6d['status'](_0x31cced)[_0x4b57('0x19')](_0x4e15be);}};}function respondWithFilteredResult(_0x24f776,_0x10b9ff){return function(_0x58d6bd){if(_0x58d6bd){var _0x284640=typeof _0x10b9ff['offset']===_0x4b57('0x1a')&&typeof _0x10b9ff[_0x4b57('0x1b')]===_0x4b57('0x1a');var _0x10eda5=_0x58d6bd[_0x4b57('0x1c')];var _0xfb71cc=_0x284640?0x0:_0x10b9ff['offset'];var _0x1b35ff=_0x284640?_0x58d6bd[_0x4b57('0x1c')]:_0x10b9ff[_0x4b57('0x1d')]+_0x10b9ff[_0x4b57('0x1b')];var _0x4baaeb;if(_0x1b35ff>=_0x10eda5){_0x1b35ff=_0x10eda5;_0x4baaeb=0xc8;}else{_0x4baaeb=0xce;}_0x24f776[_0x4b57('0x17')](_0x4baaeb);return _0x24f776[_0x4b57('0x1e')](_0x4b57('0x1f'),_0xfb71cc+'-'+_0x1b35ff+'/'+_0x10eda5)[_0x4b57('0x19')](_0x58d6bd);}return null;};}function patchUpdates(_0xef1eae){return function(_0x4454c8){try{jsonpatch['apply'](_0x4454c8,_0xef1eae,!![]);}catch(_0x4b504b){return BPromise[_0x4b57('0x20')](_0x4b504b);}return _0x4454c8[_0x4b57('0x21')]();};}function saveUpdates(_0x567d8f,_0x380554){return function(_0x4a34b2){if(_0x4a34b2){return _0x4a34b2[_0x4b57('0x22')](_0x567d8f)[_0x4b57('0x23')](function(_0x56f017){return _0x56f017;});}return null;};}function removeEntity(_0x271361,_0x368c5f){return function(_0x4d07c9){if(_0x4d07c9){return _0x4d07c9[_0x4b57('0x24')]()[_0x4b57('0x23')](function(){var _0x25d190=_0x4d07c9[_0x4b57('0x25')]({'plain':!![]});var _0x540eff=_0x4b57('0x26');return db['UserProfileResource'][_0x4b57('0x24')]({'where':{'type':_0x540eff,'resourceId':_0x25d190['id']}})['then'](function(){return _0x4d07c9;});})[_0x4b57('0x23')](function(){_0x271361[_0x4b57('0x17')](0xcc)[_0x4b57('0x18')]();});}};}function handleEntityNotFound(_0x6584c4,_0x104f52){return function(_0x392e37){if(!_0x392e37){_0x6584c4['sendStatus'](0x194);}return _0x392e37;};}function handleError(_0x5c3c7a,_0x16d196){_0x16d196=_0x16d196||0x1f4;return function(_0x4c58e4){logger[_0x4b57('0x27')](_0x4c58e4[_0x4b57('0x28')]);if(_0x4c58e4[_0x4b57('0x29')]){delete _0x4c58e4[_0x4b57('0x29')];}_0x5c3c7a[_0x4b57('0x17')](_0x16d196)[_0x4b57('0x2a')](_0x4c58e4);};}exports['index']=function(_0xab365c,_0x2e9922){var _0x68be27={},_0x3cd331={},_0x4ccf89={'count':0x0,'rows':[]};var _0xa91ba=_[_0x4b57('0x2b')](db['VoiceMail'][_0x4b57('0x2c')],function(_0xa5b5dc){return{'name':_0xa5b5dc[_0x4b57('0x2d')],'type':_0xa5b5dc[_0x4b57('0x2e')]['key']};});_0x3cd331['model']=_['map'](_0xa91ba,_0x4b57('0x29'));_0x3cd331[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0xab365c[_0x4b57('0x2f')]);_0x3cd331[_0x4b57('0x31')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],_0x3cd331[_0x4b57('0x2f')]);_0x68be27[_0x4b57('0x33')]=_['intersection'](_0x3cd331[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0xab365c[_0x4b57('0x2f')]['fields']));_0x68be27[_0x4b57('0x33')]=_0x68be27[_0x4b57('0x33')]['length']?_0x68be27[_0x4b57('0x33')]:_0x3cd331[_0x4b57('0x32')];if(!_0xab365c[_0x4b57('0x2f')][_0x4b57('0x35')](_0x4b57('0x36'))){_0x68be27[_0x4b57('0x1b')]=qs['limit'](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1b')]);_0x68be27[_0x4b57('0x1d')]=qs[_0x4b57('0x1d')](_0xab365c[_0x4b57('0x2f')][_0x4b57('0x1d')]);}_0x68be27[_0x4b57('0x37')]=qs['sort'](_0xab365c['query'][_0x4b57('0x38')]);_0x68be27[_0x4b57('0x39')]=qs[_0x4b57('0x31')](_['pick'](_0xab365c[_0x4b57('0x2f')],_0x3cd331[_0x4b57('0x31')]),_0xa91ba);if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]){_0x68be27['where']=_[_0x4b57('0x3b')](_0x68be27[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0xa91ba,function(_0x2d24ab){if(_0x2d24ab['type']!=='VIRTUAL'){var _0x5d624c={};_0x5d624c[_0x2d24ab[_0x4b57('0x29')]]={'$like':'%'+_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3a')]+'%'};return _0x5d624c;}})});}_0x68be27=_[_0x4b57('0x3b')]({},_0x68be27,_0xab365c['options']);var _0x445353={'where':_0x68be27[_0x4b57('0x39')]};return db[_0x4b57('0x3c')][_0x4b57('0x1c')](_0x445353)[_0x4b57('0x23')](function(_0x453129){_0x4ccf89[_0x4b57('0x1c')]=_0x453129;if(_0xab365c[_0x4b57('0x2f')][_0x4b57('0x3d')]){_0x68be27['include']=[{'all':!![]}];}return db[_0x4b57('0x3c')][_0x4b57('0x3e')](_0x68be27);})[_0x4b57('0x23')](function(_0x5b2f50){_0x4ccf89[_0x4b57('0x3f')]=_0x5b2f50;return _0x4ccf89;})['then'](respondWithFilteredResult(_0x2e9922,_0x68be27))[_0x4b57('0x40')](handleError(_0x2e9922,null));};exports[_0x4b57('0x41')]=function(_0x457273,_0x19ba66){var _0x189fd0={'raw':!![],'where':{'id':_0x457273[_0x4b57('0x42')]['id']}},_0x477352={};_0x477352[_0x4b57('0x32')]=_[_0x4b57('0x30')](db[_0x4b57('0x3c')][_0x4b57('0x2c')]);_0x477352[_0x4b57('0x2f')]=_[_0x4b57('0x30')](_0x457273['query']);_0x477352['filters']=_[_0x4b57('0x43')](_0x477352[_0x4b57('0x32')],_0x477352[_0x4b57('0x2f')]);_0x189fd0[_0x4b57('0x33')]=_['intersection'](_0x477352[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x457273['query'][_0x4b57('0x34')]));_0x189fd0['attributes']=_0x189fd0[_0x4b57('0x33')]['length']?_0x189fd0['attributes']:_0x477352[_0x4b57('0x32')];if(_0x457273[_0x4b57('0x2f')]['includeAll']){_0x189fd0[_0x4b57('0x44')]=[{'all':!![]}];}_0x189fd0=_[_0x4b57('0x3b')]({},_0x189fd0,_0x457273[_0x4b57('0x45')]);return db[_0x4b57('0x3c')][_0x4b57('0x46')](_0x189fd0)[_0x4b57('0x23')](handleEntityNotFound(_0x19ba66,null))['then'](respondWithResult(_0x19ba66,null))[_0x4b57('0x40')](handleError(_0x19ba66,null));};exports[_0x4b57('0x47')]=function(_0x4a632c,_0xd529fb){return db[_0x4b57('0x3c')][_0x4b57('0x47')](_0x4a632c['body'],{})[_0x4b57('0x23')](function(_0x5cba5f){var _0x213dca=_0x4a632c[_0x4b57('0x48')][_0x4b57('0x25')]({'plain':!![]});if(!_0x213dca)throw new Error(_0x4b57('0x49'));if(_0x213dca[_0x4b57('0x4a')]===_0x4b57('0x48')){var _0x3d1ecd=_0x5cba5f[_0x4b57('0x25')]({'plain':!![]});var _0x5ab120=_0x4b57('0x26');return db[_0x4b57('0x4b')][_0x4b57('0x46')]({'where':{'name':_0x5ab120,'userProfileId':_0x213dca['userProfileId']},'raw':!![]})[_0x4b57('0x23')](function(_0xcf72b6){if(_0xcf72b6&&_0xcf72b6[_0x4b57('0x4c')]===0x0){return db['UserProfileResource'][_0x4b57('0x47')]({'name':_0x3d1ecd[_0x4b57('0x29')],'resourceId':_0x3d1ecd['id'],'type':_0xcf72b6[_0x4b57('0x29')],'sectionId':_0xcf72b6['id']},{})[_0x4b57('0x23')](function(){return _0x5cba5f;});}else{return _0x5cba5f;}})[_0x4b57('0x40')](function(_0xb7c37c){logger[_0x4b57('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb7c37c);throw _0xb7c37c;});}return _0x5cba5f;})['then'](respondWithResult(_0xd529fb,0xc9))[_0x4b57('0x40')](handleError(_0xd529fb,null));};exports[_0x4b57('0x22')]=function(_0x3b4cbf,_0x2e64c2){if(_0x3b4cbf['body']['id']){delete _0x3b4cbf[_0x4b57('0x4d')]['id'];}return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x3b4cbf[_0x4b57('0x42')]['id']}})['then'](handleEntityNotFound(_0x2e64c2,null))['then'](saveUpdates(_0x3b4cbf[_0x4b57('0x4d')],null))[_0x4b57('0x23')](respondWithResult(_0x2e64c2,null))['catch'](handleError(_0x2e64c2,null));};exports['destroy']=function(_0x451737,_0x5c1082){return db[_0x4b57('0x3c')][_0x4b57('0x46')]({'where':{'id':_0x451737[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x5c1082,null))[_0x4b57('0x23')](removeEntity(_0x5c1082,null))['catch'](handleError(_0x5c1082,null));};exports['getMessages']=function(_0x54ff9d,_0x4c241a,_0x179802){return db[_0x4b57('0x3c')]['findOne']({'where':{'id':_0x54ff9d[_0x4b57('0x42')]['id']}})[_0x4b57('0x23')](handleEntityNotFound(_0x4c241a,null))[_0x4b57('0x23')](function(_0x9ed750){var _0x64b0fd;var _0x1fcc10={},_0xf1bf63={};_0xf1bf63[_0x4b57('0x32')]=_[_0x4b57('0x30')](db['VoiceMailMessage'][_0x4b57('0x2c')]);_0xf1bf63['query']=_[_0x4b57('0x30')](_0x54ff9d[_0x4b57('0x2f')]);_0xf1bf63['filters']=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],_0xf1bf63[_0x4b57('0x2f')]);_0x1fcc10[_0x4b57('0x33')]=_[_0x4b57('0x43')](_0xf1bf63[_0x4b57('0x32')],qs[_0x4b57('0x34')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x34')]));_0x1fcc10[_0x4b57('0x33')]=_0x1fcc10[_0x4b57('0x33')][_0x4b57('0x4e')]?_0x1fcc10['attributes']:_0xf1bf63[_0x4b57('0x32')];if(!_0x54ff9d[_0x4b57('0x2f')]['hasOwnProperty'](_0x4b57('0x36'))){_0x1fcc10['limit']=qs['limit'](_0x54ff9d['query'][_0x4b57('0x1b')]);_0x1fcc10['offset']=qs[_0x4b57('0x1d')](_0x54ff9d[_0x4b57('0x2f')]['offset']);}_0x1fcc10['order']=qs[_0x4b57('0x38')](_0x54ff9d[_0x4b57('0x2f')][_0x4b57('0x38')]);_0x1fcc10['where']=qs[_0x4b57('0x31')](_[_0x4b57('0x4f')](_0x54ff9d['query'],_0xf1bf63[_0x4b57('0x31')]));if(_0x54ff9d[_0x4b57('0x2f')]['filter']){_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10[_0x4b57('0x39')],{'$or':_[_0x4b57('0x2b')](_0x1fcc10[_0x4b57('0x33')],function(_0x5d9dd5){var _0x2112d5={};_0x2112d5[_0x5d9dd5]={'$like':'%'+_0x54ff9d['query']['filter']+'%'};return _0x2112d5;})});}_0x1fcc10[_0x4b57('0x39')]=_[_0x4b57('0x3b')](_0x1fcc10['where'],{'mailboxuser':_0x9ed750['mailbox']});_0x1fcc10=_[_0x4b57('0x3b')]({},_0x1fcc10,_0x54ff9d[_0x4b57('0x45')]);return db['VoiceMailMessage']['findAndCountAll'](_0x1fcc10)['then'](respondWithFilteredResult(_0x4c241a,_0x1fcc10));})[_0x4b57('0x40')](handleError(_0x4c241a,null));}; \ No newline at end of file +var _0xe5b5=['stack','name','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','filter','where','merge','options','VoiceMail','includeAll','include','findAll','catch','length','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','getMessages','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2e2681,_0x4089c1){_0x2e2681=_0x2e2681-0x0;var _0x368a64=_0xe5b5[_0x2e2681];return _0x368a64;};'use strict';var emlformat=require(_0x5e5b('0x0'));var rimraf=require(_0x5e5b('0x1'));var zipdir=require(_0x5e5b('0x2'));var jsonpatch=require(_0x5e5b('0x3'));var rp=require(_0x5e5b('0x4'));var moment=require(_0x5e5b('0x5'));var BPromise=require(_0x5e5b('0x6'));var Mustache=require(_0x5e5b('0x7'));var util=require(_0x5e5b('0x8'));var path=require(_0x5e5b('0x9'));var sox=require(_0x5e5b('0xa'));var csv=require(_0x5e5b('0xb'));var ejs=require(_0x5e5b('0xc'));var fs=require('fs');var fs_extra=require(_0x5e5b('0xd'));var _=require(_0x5e5b('0xe'));var squel=require(_0x5e5b('0xf'));var crypto=require(_0x5e5b('0x10'));var jsforce=require(_0x5e5b('0x11'));var deskjs=require(_0x5e5b('0x12'));var toCsv=require(_0x5e5b('0xb'));var querystring=require(_0x5e5b('0x13'));var Papa=require(_0x5e5b('0x14'));var Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x310f71,_0x18434e){_0x18434e=_0x18434e||0xcc;return function(_0x4559a0){if(_0x4559a0){return _0x310f71[_0x5e5b('0x1b')](_0x18434e);}return _0x310f71[_0x5e5b('0x1c')](_0x18434e)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x2e331d,_0x49edd0){_0x49edd0=_0x49edd0||0xc8;return function(_0x2b37fa){if(_0x2b37fa){return _0x2e331d[_0x5e5b('0x1c')](_0x49edd0)['json'](_0x2b37fa);}};}function respondWithFilteredResult(_0x227417,_0x578c14){return function(_0x4e9509){if(_0x4e9509){var _0x13a1cb=typeof _0x578c14[_0x5e5b('0x1e')]===_0x5e5b('0x1f')&&typeof _0x578c14['limit']===_0x5e5b('0x1f');var _0x4d490c=_0x4e9509[_0x5e5b('0x20')];var _0x45a091=_0x13a1cb?0x0:_0x578c14['offset'];var _0xe5aa6b=_0x13a1cb?_0x4e9509[_0x5e5b('0x20')]:_0x578c14[_0x5e5b('0x1e')]+_0x578c14['limit'];var _0x2bf0b7;if(_0xe5aa6b>=_0x4d490c){_0xe5aa6b=_0x4d490c;_0x2bf0b7=0xc8;}else{_0x2bf0b7=0xce;}_0x227417[_0x5e5b('0x1c')](_0x2bf0b7);return _0x227417['set'](_0x5e5b('0x21'),_0x45a091+'-'+_0xe5aa6b+'/'+_0x4d490c)[_0x5e5b('0x22')](_0x4e9509);}return null;};}function patchUpdates(_0x3c488e){return function(_0x2d8252){try{jsonpatch[_0x5e5b('0x23')](_0x2d8252,_0x3c488e,!![]);}catch(_0x33d61b){return BPromise[_0x5e5b('0x24')](_0x33d61b);}return _0x2d8252[_0x5e5b('0x25')]();};}function saveUpdates(_0x4a78e3,_0x512e46){return function(_0x256a00){if(_0x256a00){return _0x256a00[_0x5e5b('0x26')](_0x4a78e3)[_0x5e5b('0x27')](function(_0xe1c268){return _0xe1c268;});}return null;};}function removeEntity(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(_0x135c6c){return _0x135c6c[_0x5e5b('0x28')]()[_0x5e5b('0x27')](function(){var _0x26bc02=_0x135c6c[_0x5e5b('0x29')]({'plain':!![]});var _0x4da321=_0x5e5b('0x2a');return db[_0x5e5b('0x2b')][_0x5e5b('0x28')]({'where':{'type':_0x4da321,'resourceId':_0x26bc02['id']}})['then'](function(){return _0x135c6c;});})[_0x5e5b('0x27')](function(){_0x2e38ed[_0x5e5b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ff91,_0x21c74b){return function(_0x39ce16){if(!_0x39ce16){_0x13ff91[_0x5e5b('0x1b')](0x194);}return _0x39ce16;};}function handleError(_0x31af09,_0x250fbd){_0x250fbd=_0x250fbd||0x1f4;return function(_0x2cb695){logger[_0x5e5b('0x2c')](_0x2cb695[_0x5e5b('0x2d')]);if(_0x2cb695[_0x5e5b('0x2e')]){delete _0x2cb695[_0x5e5b('0x2e')];}_0x31af09[_0x5e5b('0x1c')](_0x250fbd)['send'](_0x2cb695);};}exports['index']=function(_0x365f6f,_0x289f54){var _0xb68419={},_0x3dcdab={},_0x12f1ee={'count':0x0,'rows':[]};var _0x4b9be8=_[_0x5e5b('0x2f')](db['VoiceMail'][_0x5e5b('0x30')],function(_0x384d8f){return{'name':_0x384d8f[_0x5e5b('0x31')],'type':_0x384d8f[_0x5e5b('0x32')]['key']};});_0x3dcdab[_0x5e5b('0x33')]=_[_0x5e5b('0x2f')](_0x4b9be8,'name');_0x3dcdab[_0x5e5b('0x34')]=_[_0x5e5b('0x35')](_0x365f6f[_0x5e5b('0x34')]);_0x3dcdab[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x3dcdab[_0x5e5b('0x33')],_0x3dcdab[_0x5e5b('0x34')]);_0xb68419[_0x5e5b('0x38')]=_['intersection'](_0x3dcdab[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x39')]));_0xb68419[_0x5e5b('0x38')]=_0xb68419[_0x5e5b('0x38')]['length']?_0xb68419['attributes']:_0x3dcdab[_0x5e5b('0x33')];if(!_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0xb68419[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0xb68419['offset']=qs[_0x5e5b('0x1e')](_0x365f6f[_0x5e5b('0x34')]['offset']);}_0xb68419['order']=qs[_0x5e5b('0x3c')](_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3c')]);_0xb68419['where']=qs[_0x5e5b('0x36')](_['pick'](_0x365f6f['query'],_0x3dcdab[_0x5e5b('0x36')]),_0x4b9be8);if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0xb68419[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0xb68419[_0x5e5b('0x3e')],{'$or':_[_0x5e5b('0x2f')](_0x4b9be8,function(_0x14ac35){if(_0x14ac35[_0x5e5b('0x32')]!=='VIRTUAL'){var _0x1f1907={};_0x1f1907[_0x14ac35[_0x5e5b('0x2e')]]={'$like':'%'+_0x365f6f['query'][_0x5e5b('0x3d')]+'%'};return _0x1f1907;}})});}_0xb68419=_['merge']({},_0xb68419,_0x365f6f[_0x5e5b('0x40')]);var _0x14b152={'where':_0xb68419[_0x5e5b('0x3e')]};return db[_0x5e5b('0x41')][_0x5e5b('0x20')](_0x14b152)[_0x5e5b('0x27')](function(_0x371550){_0x12f1ee[_0x5e5b('0x20')]=_0x371550;if(_0x365f6f[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0xb68419[_0x5e5b('0x43')]=[{'all':!![]}];}return db['VoiceMail'][_0x5e5b('0x44')](_0xb68419);})[_0x5e5b('0x27')](function(_0x46fec9){_0x12f1ee['rows']=_0x46fec9;return _0x12f1ee;})[_0x5e5b('0x27')](respondWithFilteredResult(_0x289f54,_0xb68419))[_0x5e5b('0x45')](handleError(_0x289f54,null));};exports['show']=function(_0x6672d9,_0x44b7be){var _0x5d3135={'raw':!![],'where':{'id':_0x6672d9['params']['id']}},_0x257bb7={};_0x257bb7['model']=_['keys'](db[_0x5e5b('0x41')]['rawAttributes']);_0x257bb7[_0x5e5b('0x34')]=_['keys'](_0x6672d9[_0x5e5b('0x34')]);_0x257bb7[_0x5e5b('0x36')]=_[_0x5e5b('0x37')](_0x257bb7[_0x5e5b('0x33')],_0x257bb7[_0x5e5b('0x34')]);_0x5d3135[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x257bb7['model'],qs['fields'](_0x6672d9[_0x5e5b('0x34')]['fields']));_0x5d3135['attributes']=_0x5d3135['attributes'][_0x5e5b('0x46')]?_0x5d3135['attributes']:_0x257bb7[_0x5e5b('0x33')];if(_0x6672d9[_0x5e5b('0x34')][_0x5e5b('0x42')]){_0x5d3135[_0x5e5b('0x43')]=[{'all':!![]}];}_0x5d3135=_[_0x5e5b('0x3f')]({},_0x5d3135,_0x6672d9[_0x5e5b('0x40')]);return db['VoiceMail'][_0x5e5b('0x47')](_0x5d3135)[_0x5e5b('0x27')](handleEntityNotFound(_0x44b7be,null))['then'](respondWithResult(_0x44b7be,null))[_0x5e5b('0x45')](handleError(_0x44b7be,null));};exports['create']=function(_0x41e4b3,_0x36d8fa){return db[_0x5e5b('0x41')][_0x5e5b('0x48')](_0x41e4b3['body'],{})[_0x5e5b('0x27')](function(_0x1c4efe){var _0x4f4ea3=_0x41e4b3[_0x5e5b('0x49')][_0x5e5b('0x29')]({'plain':!![]});if(!_0x4f4ea3)throw new Error(_0x5e5b('0x4a'));if(_0x4f4ea3[_0x5e5b('0x4b')]===_0x5e5b('0x49')){var _0x5ae8d0=_0x1c4efe['get']({'plain':!![]});var _0x690f8c=_0x5e5b('0x2a');return db['UserProfileSection'][_0x5e5b('0x47')]({'where':{'name':_0x690f8c,'userProfileId':_0x4f4ea3[_0x5e5b('0x4c')]},'raw':!![]})[_0x5e5b('0x27')](function(_0x5a9eae){if(_0x5a9eae&&_0x5a9eae[_0x5e5b('0x4d')]===0x0){return db[_0x5e5b('0x2b')][_0x5e5b('0x48')]({'name':_0x5ae8d0['name'],'resourceId':_0x5ae8d0['id'],'type':_0x5a9eae[_0x5e5b('0x2e')],'sectionId':_0x5a9eae['id']},{})[_0x5e5b('0x27')](function(){return _0x1c4efe;});}else{return _0x1c4efe;}})[_0x5e5b('0x45')](function(_0x4a4e0f){logger['error'](_0x5e5b('0x4e'),_0x4a4e0f);throw _0x4a4e0f;});}return _0x1c4efe;})['then'](respondWithResult(_0x36d8fa,0xc9))['catch'](handleError(_0x36d8fa,null));};exports[_0x5e5b('0x26')]=function(_0x13eee9,_0x4774ee){if(_0x13eee9['body']['id']){delete _0x13eee9[_0x5e5b('0x4f')]['id'];}return db[_0x5e5b('0x41')][_0x5e5b('0x47')]({'where':{'id':_0x13eee9[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x4774ee,null))[_0x5e5b('0x27')](saveUpdates(_0x13eee9['body'],null))['then'](respondWithResult(_0x4774ee,null))[_0x5e5b('0x45')](handleError(_0x4774ee,null));};exports[_0x5e5b('0x28')]=function(_0x1cc741,_0x357e55){return db['VoiceMail'][_0x5e5b('0x47')]({'where':{'id':_0x1cc741['params']['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x357e55,null))[_0x5e5b('0x27')](removeEntity(_0x357e55,null))[_0x5e5b('0x45')](handleError(_0x357e55,null));};exports[_0x5e5b('0x51')]=function(_0x2d17b0,_0x30b010,_0x275930){return db[_0x5e5b('0x41')]['findOne']({'where':{'id':_0x2d17b0[_0x5e5b('0x50')]['id']}})[_0x5e5b('0x27')](handleEntityNotFound(_0x30b010,null))[_0x5e5b('0x27')](function(_0x1aea38){var _0x129026;var _0x5543eb={},_0x2ccee2={};_0x2ccee2[_0x5e5b('0x33')]=_[_0x5e5b('0x35')](db[_0x5e5b('0x52')][_0x5e5b('0x30')]);_0x2ccee2['query']=_[_0x5e5b('0x35')](_0x2d17b0['query']);_0x2ccee2[_0x5e5b('0x36')]=_['intersection'](_0x2ccee2[_0x5e5b('0x33')],_0x2ccee2[_0x5e5b('0x34')]);_0x5543eb[_0x5e5b('0x38')]=_[_0x5e5b('0x37')](_0x2ccee2[_0x5e5b('0x33')],qs[_0x5e5b('0x39')](_0x2d17b0['query'][_0x5e5b('0x39')]));_0x5543eb[_0x5e5b('0x38')]=_0x5543eb[_0x5e5b('0x38')][_0x5e5b('0x46')]?_0x5543eb['attributes']:_0x2ccee2['model'];if(!_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3a')]('nolimit')){_0x5543eb[_0x5e5b('0x3b')]=qs[_0x5e5b('0x3b')](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3b')]);_0x5543eb[_0x5e5b('0x1e')]=qs['offset'](_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x1e')]);}_0x5543eb['order']=qs['sort'](_0x2d17b0['query'][_0x5e5b('0x3c')]);_0x5543eb[_0x5e5b('0x3e')]=qs[_0x5e5b('0x36')](_[_0x5e5b('0x53')](_0x2d17b0[_0x5e5b('0x34')],_0x2ccee2['filters']));if(_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]){_0x5543eb['where']=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'$or':_['map'](_0x5543eb[_0x5e5b('0x38')],function(_0x4fa0db){var _0x454026={};_0x454026[_0x4fa0db]={'$like':'%'+_0x2d17b0[_0x5e5b('0x34')][_0x5e5b('0x3d')]+'%'};return _0x454026;})});}_0x5543eb[_0x5e5b('0x3e')]=_[_0x5e5b('0x3f')](_0x5543eb['where'],{'mailboxuser':_0x1aea38[_0x5e5b('0x54')]});_0x5543eb=_[_0x5e5b('0x3f')]({},_0x5543eb,_0x2d17b0[_0x5e5b('0x40')]);return db[_0x5e5b('0x52')][_0x5e5b('0x55')](_0x5543eb)[_0x5e5b('0x27')](respondWithFilteredResult(_0x30b010,_0x5543eb));})[_0x5e5b('0x45')](handleError(_0x30b010,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 4b3d97a..e9942ea 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 _0x73d9=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','lodash','util'];(function(_0x66808a,_0x60f3bd){var _0x760006=function(_0x520c41){while(--_0x520c41){_0x66808a['push'](_0x66808a['shift']());}};_0x760006(++_0x60f3bd);}(_0x73d9,0x1ce));var _0x973d=function(_0x15db62,_0x14e90a){_0x15db62=_0x15db62-0x0;var _0x2db426=_0x73d9[_0x15db62];return _0x2db426;};'use strict';var _=require(_0x973d('0x0'));var util=require(_0x973d('0x1'));var logger=require(_0x973d('0x2'))(_0x973d('0x3'));var moment=require(_0x973d('0x4'));var BPromise=require(_0x973d('0x5'));var rp=require(_0x973d('0x6'));var fs=require('fs');var path=require(_0x973d('0x7'));var rimraf=require(_0x973d('0x8'));var config=require(_0x973d('0x9'));var attributes=require(_0x973d('0xa'));module[_0x973d('0xb')]=function(_0x3f5cf0,_0x3ac0b2){return _0x3f5cf0[_0x973d('0xc')](_0x973d('0xd'),attributes,{'tableName':_0x973d('0xe'),'paranoid':![],'indexes':[{'name':_0x973d('0xf'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3ee8=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','context'];(function(_0x40e4e2,_0x4ed936){var _0x1242dc=function(_0x3cabf3){while(--_0x3cabf3){_0x40e4e2['push'](_0x40e4e2['shift']());}};_0x1242dc(++_0x4ed936);}(_0x3ee8,0x14a));var _0x83ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ee8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x83ee('0x0'));var util=require('util');var logger=require(_0x83ee('0x1'))('api');var moment=require(_0x83ee('0x2'));var BPromise=require(_0x83ee('0x3'));var rp=require(_0x83ee('0x4'));var fs=require('fs');var path=require(_0x83ee('0x5'));var rimraf=require(_0x83ee('0x6'));var config=require(_0x83ee('0x7'));var attributes=require(_0x83ee('0x8'));module[_0x83ee('0x9')]=function(_0x9f795a,_0x15880f){return _0x9f795a[_0x83ee('0xa')](_0x83ee('0xb'),attributes,{'tableName':_0x83ee('0xc'),'paranoid':![],'indexes':[{'name':_0x83ee('0xd'),'fields':['mailbox',_0x83ee('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index dfcb6e9..9343177 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 _0x6192=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s'];(function(_0x59eeef,_0x4bf1b7){var _0x321a40=function(_0x462816){while(--_0x462816){_0x59eeef['push'](_0x59eeef['shift']());}};_0x321a40(++_0x4bf1b7);}(_0x6192,0xa8));var _0x2619=function(_0x4f65f6,_0x34de05){_0x4f65f6=_0x4f65f6-0x0;var _0x43724f=_0x6192[_0x4f65f6];return _0x43724f;};'use strict';var _=require(_0x2619('0x0'));var util=require(_0x2619('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2619('0x2'));var db=require(_0x2619('0x3'))['db'];var utils=require(_0x2619('0x4'));var logger=require(_0x2619('0x5'))(_0x2619('0x6'));var config=require(_0x2619('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2619('0x8')][_0x2619('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3250ad,_0x5e3cbd,_0xe4e8a0){return new BPromise(function(_0x1489db,_0x5e2485){return client[_0x2619('0xa')](_0x3250ad,_0xe4e8a0)[_0x2619('0xb')](function(_0x4c847f){logger[_0x2619('0xc')](_0x2619('0xd'),_0x5e3cbd,'request\x20sent');logger[_0x2619('0xe')](_0x2619('0xf'),_0x5e3cbd,_0x2619('0x10'),JSON[_0x2619('0x11')](_0x4c847f));if(_0x4c847f[_0x2619('0x12')]){if(_0x4c847f[_0x2619('0x12')][_0x2619('0x13')]===0x1f4){logger[_0x2619('0x12')](_0x2619('0xd'),_0x5e3cbd,_0x4c847f['error'][_0x2619('0x14')]);return _0x5e2485(_0x4c847f[_0x2619('0x12')][_0x2619('0x14')]);}logger[_0x2619('0x12')](_0x2619('0xd'),_0x5e3cbd,_0x4c847f[_0x2619('0x12')][_0x2619('0x14')]);return _0x1489db(_0x4c847f[_0x2619('0x12')][_0x2619('0x14')]);}else{logger[_0x2619('0xc')](_0x2619('0xd'),_0x5e3cbd,_0x2619('0x10'));_0x1489db(_0x4c847f[_0x2619('0x15')]['message']);}})[_0x2619('0x16')](function(_0xb9bf0d){logger['error'](_0x2619('0xd'),_0x5e3cbd,_0xb9bf0d);_0x5e2485(_0xb9bf0d);});});} \ No newline at end of file +var _0x40fd=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis'];(function(_0x1061c4,_0x4039f5){var _0xd25154=function(_0x911022){while(--_0x911022){_0x1061c4['push'](_0x1061c4['shift']());}};_0xd25154(++_0x4039f5);}(_0x40fd,0x103));var _0xd40f=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0x40fd[_0x2af053];return _0x4b4001;};'use strict';var _=require(_0xd40f('0x0'));var util=require(_0xd40f('0x1'));var moment=require('moment');var BPromise=require(_0xd40f('0x2'));var rs=require(_0xd40f('0x3'));var fs=require('fs');var Redis=require(_0xd40f('0x4'));var db=require(_0xd40f('0x5'))['db'];var utils=require(_0xd40f('0x6'));var logger=require('../../config/logger')(_0xd40f('0x7'));var config=require('../../config/environment');var jayson=require(_0xd40f('0x8'));var client=jayson[_0xd40f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f4b77,_0x50d7f8,_0x30e85d){return new BPromise(function(_0x18642e,_0x3af68d){return client[_0xd40f('0xa')](_0x2f4b77,_0x30e85d)[_0xd40f('0xb')](function(_0x31a155){logger[_0xd40f('0xc')]('VoiceMail,\x20%s,\x20%s',_0x50d7f8,_0xd40f('0xd'));logger[_0xd40f('0xe')](_0xd40f('0xf'),_0x50d7f8,_0xd40f('0xd'),JSON[_0xd40f('0x10')](_0x31a155));if(_0x31a155[_0xd40f('0x11')]){if(_0x31a155[_0xd40f('0x11')][_0xd40f('0x12')]===0x1f4){logger['error'](_0xd40f('0x13'),_0x50d7f8,_0x31a155[_0xd40f('0x11')]['message']);return _0x3af68d(_0x31a155['error']['message']);}logger['error'](_0xd40f('0x13'),_0x50d7f8,_0x31a155['error'][_0xd40f('0x14')]);return _0x18642e(_0x31a155['error']['message']);}else{logger[_0xd40f('0xc')]('VoiceMail,\x20%s,\x20%s',_0x50d7f8,_0xd40f('0xd'));_0x18642e(_0x31a155[_0xd40f('0x15')]['message']);}})['catch'](function(_0x18f6c4){logger[_0xd40f('0x11')](_0xd40f('0x13'),_0x50d7f8,_0x18f6c4);_0x3af68d(_0x18f6c4);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 3605354..f31fec7 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 _0xd59b=['update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/download','download','post','create','put','/:id'];(function(_0x37ff40,_0x2c5d91){var _0x2c2ccd=function(_0x539450){while(--_0x539450){_0x37ff40['push'](_0x37ff40['shift']());}};_0x2c2ccd(++_0x2c5d91);}(_0xd59b,0xca));var _0xbd59=function(_0x4b0690,_0x3be1bb){_0x4b0690=_0x4b0690-0x0;var _0x26dc96=_0xd59b[_0x4b0690];return _0x26dc96;};'use strict';var multer=require(_0xbd59('0x0'));var util=require(_0xbd59('0x1'));var path=require(_0xbd59('0x2'));var timeout=require(_0xbd59('0x3'));var express=require(_0xbd59('0x4'));var router=express[_0xbd59('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbd59('0x6'));var interaction=require(_0xbd59('0x7'));var config=require(_0xbd59('0x8'));var controller=require('./voiceMailMessage.controller');router['get']('/',auth[_0xbd59('0x9')](),controller['index']);router[_0xbd59('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xbd59('0xb')]);router[_0xbd59('0xa')](_0xbd59('0xc'),auth[_0xbd59('0x9')](),controller[_0xbd59('0xd')]);router[_0xbd59('0xe')]('/',auth['isAuthenticated'](),controller[_0xbd59('0xf')]);router[_0xbd59('0x10')](_0xbd59('0x11'),auth[_0xbd59('0x9')](),controller[_0xbd59('0x12')]);router['delete']('/:id',auth[_0xbd59('0x9')](),controller['destroy']);module[_0xbd59('0x13')]=router; \ No newline at end of file +var _0xcf7d=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','/:id'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xcf7d,0xdf));var _0xdcf7=function(_0x46fda1,_0x2af91e){_0x46fda1=_0x46fda1-0x0;var _0x45254e=_0xcf7d[_0x46fda1];return _0x45254e;};'use strict';var multer=require(_0xdcf7('0x0'));var util=require(_0xdcf7('0x1'));var path=require(_0xdcf7('0x2'));var timeout=require(_0xdcf7('0x3'));var express=require(_0xdcf7('0x4'));var router=express[_0xdcf7('0x5')]();var fs_extra=require(_0xdcf7('0x6'));var auth=require(_0xdcf7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdcf7('0x8'));var controller=require(_0xdcf7('0x9'));router[_0xdcf7('0xa')]('/',auth[_0xdcf7('0xb')](),controller[_0xdcf7('0xc')]);router['get']('/:id',auth[_0xdcf7('0xb')](),controller[_0xdcf7('0xd')]);router[_0xdcf7('0xa')](_0xdcf7('0xe'),auth[_0xdcf7('0xb')](),controller[_0xdcf7('0xf')]);router[_0xdcf7('0x10')]('/',auth[_0xdcf7('0xb')](),controller[_0xdcf7('0x11')]);router['put'](_0xdcf7('0x12'),auth[_0xdcf7('0xb')](),controller[_0xdcf7('0x13')]);router['delete'](_0xdcf7('0x12'),auth[_0xdcf7('0xb')](),controller[_0xdcf7('0x14')]);module[_0xdcf7('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 78be3b5..3430438 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 _0x7b3c=['BLOB','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x20b6ad,_0x3c885c){var _0x3d703d=function(_0x160e67){while(--_0x160e67){_0x20b6ad['push'](_0x20b6ad['shift']());}};_0x3d703d(++_0x3c885c);}(_0x7b3c,0x102));var _0xc7b3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7b3c[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0xc7b3('0x0'));module[_0xc7b3('0x1')]={'name':{'type':Sequelize[_0xc7b3('0x2')],'get':function(_0x3c1ff4){return this[_0xc7b3('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xc7b3('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xc7b3('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xc7b3('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0xc7b3('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0xc7b3('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xc7b3('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xc7b3('0x6')](_0xc7b3('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xc7b3('0x5')],'defaultValue':''},'stamp':{'type':_0xc7b3('0x8'),'defaultValue':Sequelize[_0xc7b3('0x9')](_0xc7b3('0xa'))}}; \ No newline at end of file +var _0xddcb=['STRING','BLOB','long','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xddcb,0x193));var _0xbddc=function(_0x1baae7,_0x57f8f3){_0x1baae7=_0x1baae7-0x0;var _0x3ddc1e=_0xddcb[_0x1baae7];return _0x3ddc1e;};'use strict';var Sequelize=require(_0xbddc('0x0'));module[_0xbddc('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x19a6c5){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0xbddc('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xbddc('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0xbddc('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xbddc('0x3')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xbddc('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0xbddc('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0xbddc('0x4')](_0xbddc('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0xbddc('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize['literal'](_0xbddc('0x6'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index b52f6de..75485a0 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 _0xa68f=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','keys','find','create','body','catch','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','attachment','Content-Disposition','attachment;\x20filename=\x22','set'];(function(_0x576d8a,_0x2d7bde){var _0x3dc3ef=function(_0xc76758){while(--_0xc76758){_0x576d8a['push'](_0x576d8a['shift']());}};_0x3dc3ef(++_0x2d7bde);}(_0xa68f,0x150));var _0xfa68=function(_0x28a5da,_0x219b4d){_0x28a5da=_0x28a5da-0x0;var _0x233390=_0xa68f[_0x28a5da];return _0x233390;};'use strict';var emlformat=require(_0xfa68('0x0'));var rimraf=require(_0xfa68('0x1'));var zipdir=require(_0xfa68('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfa68('0x3'));var BPromise=require(_0xfa68('0x4'));var Mustache=require(_0xfa68('0x5'));var util=require('util');var path=require(_0xfa68('0x6'));var sox=require(_0xfa68('0x7'));var csv=require(_0xfa68('0x8'));var ejs=require(_0xfa68('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfa68('0xa'));var crypto=require(_0xfa68('0xb'));var jsforce=require(_0xfa68('0xc'));var deskjs=require(_0xfa68('0xd'));var toCsv=require(_0xfa68('0x8'));var querystring=require(_0xfa68('0xe'));var Papa=require(_0xfa68('0xf'));var Redis=require(_0xfa68('0x10'));var authService=require(_0xfa68('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfa68('0x12'));var hardwareService=require(_0xfa68('0x13'));var logger=require(_0xfa68('0x14'))(_0xfa68('0x15'));var utils=require(_0xfa68('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ae946,_0x470a97){_0x470a97=_0x470a97||0xcc;return function(_0x29b4f8){if(_0x29b4f8){return _0x3ae946[_0xfa68('0x17')](_0x470a97);}return _0x3ae946[_0xfa68('0x18')](_0x470a97)['end']();};}function respondWithResult(_0x5f179d,_0x41961c){_0x41961c=_0x41961c||0xc8;return function(_0x5686f9){if(_0x5686f9){return _0x5f179d[_0xfa68('0x18')](_0x41961c)[_0xfa68('0x19')](_0x5686f9);}};}function respondWithFilteredResult(_0x5848eb,_0x22ecff){return function(_0x9dc190){if(_0x9dc190){var _0x606a65=typeof _0x22ecff['offset']===_0xfa68('0x1a')&&typeof _0x22ecff[_0xfa68('0x1b')]===_0xfa68('0x1a');var _0x484937=_0x9dc190[_0xfa68('0x1c')];var _0x5cd192=_0x606a65?0x0:_0x22ecff[_0xfa68('0x1d')];var _0x240fc3=_0x606a65?_0x9dc190[_0xfa68('0x1c')]:_0x22ecff[_0xfa68('0x1d')]+_0x22ecff[_0xfa68('0x1b')];var _0x3737e0;if(_0x240fc3>=_0x484937){_0x240fc3=_0x484937;_0x3737e0=0xc8;}else{_0x3737e0=0xce;}_0x5848eb[_0xfa68('0x18')](_0x3737e0);return _0x5848eb['set'](_0xfa68('0x1e'),_0x5cd192+'-'+_0x240fc3+'/'+_0x484937)[_0xfa68('0x19')](_0x9dc190);}return null;};}function patchUpdates(_0x56fac3){return function(_0x3bd85f){try{jsonpatch[_0xfa68('0x1f')](_0x3bd85f,_0x56fac3,!![]);}catch(_0x4a9aa2){return BPromise[_0xfa68('0x20')](_0x4a9aa2);}return _0x3bd85f[_0xfa68('0x21')]();};}function saveUpdates(_0xd28a0a,_0x1e527e){return function(_0x25dd13){if(_0x25dd13){return _0x25dd13[_0xfa68('0x22')](_0xd28a0a)['then'](function(_0x135a5e){return _0x135a5e;});}return null;};}function removeEntity(_0x32b568,_0x34b5da){return function(_0x8fe3d6){if(_0x8fe3d6){return _0x8fe3d6[_0xfa68('0x23')]()[_0xfa68('0x24')](function(){_0x32b568[_0xfa68('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f3463,_0x99a539){return function(_0x270891){if(!_0x270891){_0x1f3463[_0xfa68('0x17')](0x194);}return _0x270891;};}function handleError(_0x2e3486,_0x32342f){_0x32342f=_0x32342f||0x1f4;return function(_0x43a2b3){logger[_0xfa68('0x25')](_0x43a2b3[_0xfa68('0x26')]);if(_0x43a2b3[_0xfa68('0x27')]){delete _0x43a2b3[_0xfa68('0x27')];}_0x2e3486[_0xfa68('0x18')](_0x32342f)[_0xfa68('0x28')](_0x43a2b3);};}exports['index']=function(_0x532087,_0x2b0f27){var _0x1436f5={},_0x49f425={},_0xaea5d4={'count':0x0,'rows':[]};var _0x33e224=_[_0xfa68('0x29')](db[_0xfa68('0x2a')][_0xfa68('0x2b')],function(_0x504154){return{'name':_0x504154[_0xfa68('0x2c')],'type':_0x504154[_0xfa68('0x2d')][_0xfa68('0x2e')]};});_0x49f425[_0xfa68('0x2f')]=_[_0xfa68('0x30')](_[_0xfa68('0x29')](_0x33e224,'name'),[_0xfa68('0x27')]);_0x49f425[_0xfa68('0x31')]=_['keys'](_0x532087['query']);_0x49f425['filters']=_['intersection'](_0x49f425[_0xfa68('0x2f')],_0x49f425['query']);_0x1436f5[_0xfa68('0x32')]=_['intersection'](_0x49f425[_0xfa68('0x2f')],qs['fields'](_0x532087[_0xfa68('0x31')][_0xfa68('0x33')]));_0x1436f5[_0xfa68('0x32')]=_0x1436f5[_0xfa68('0x32')][_0xfa68('0x34')]?_0x1436f5[_0xfa68('0x32')]:_0x49f425['model'];if(!_0x532087['query'][_0xfa68('0x35')](_0xfa68('0x36'))){_0x1436f5[_0xfa68('0x1b')]=qs[_0xfa68('0x1b')](_0x532087[_0xfa68('0x31')][_0xfa68('0x1b')]);_0x1436f5[_0xfa68('0x1d')]=qs['offset'](_0x532087['query'][_0xfa68('0x1d')]);}_0x1436f5[_0xfa68('0x37')]=qs[_0xfa68('0x38')](_0x532087[_0xfa68('0x31')]['sort']);_0x1436f5[_0xfa68('0x39')]=qs[_0xfa68('0x3a')](_[_0xfa68('0x3b')](_0x532087[_0xfa68('0x31')],_0x49f425[_0xfa68('0x3a')]),_0x33e224);if(_0x532087[_0xfa68('0x31')]['filter']){_0x1436f5['where']=_[_0xfa68('0x3c')](_0x1436f5[_0xfa68('0x39')],{'$or':_['map'](_0x33e224,function(_0x157848){if(_0x157848['type']!==_0xfa68('0x3d')){var _0x21a26f={};_0x21a26f[_0x157848['name']]={'$like':'%'+_0x532087[_0xfa68('0x31')][_0xfa68('0x3e')]+'%'};return _0x21a26f;}})});}_0x1436f5=_[_0xfa68('0x3c')]({},_0x1436f5,_0x532087[_0xfa68('0x3f')]);var _0x5c0c22={'where':_0x1436f5[_0xfa68('0x39')]};return db[_0xfa68('0x2a')][_0xfa68('0x1c')](_0x5c0c22)[_0xfa68('0x24')](function(_0x5315f8){_0xaea5d4[_0xfa68('0x1c')]=_0x5315f8;if(_0x532087[_0xfa68('0x31')][_0xfa68('0x40')]){_0x1436f5[_0xfa68('0x41')]=[{'all':!![]}];}return db[_0xfa68('0x2a')]['findAll'](_0x1436f5);})[_0xfa68('0x24')](function(_0x5377f3){_0xaea5d4[_0xfa68('0x42')]=_0x5377f3;return _0xaea5d4;})[_0xfa68('0x24')](respondWithFilteredResult(_0x2b0f27,_0x1436f5))['catch'](handleError(_0x2b0f27,null));};exports[_0xfa68('0x43')]=function(_0x566143,_0x46c485){var _0x804cf7={'raw':!![],'where':{'id':_0x566143[_0xfa68('0x44')]['id']}},_0x118255={};_0x118255[_0xfa68('0x2f')]=_[_0xfa68('0x45')](db[_0xfa68('0x2a')]['rawAttributes']);_0x118255[_0xfa68('0x31')]=_[_0xfa68('0x45')](_0x566143[_0xfa68('0x31')]);_0x118255[_0xfa68('0x3a')]=_['intersection'](_0x118255[_0xfa68('0x2f')],_0x118255[_0xfa68('0x31')]);_0x804cf7[_0xfa68('0x32')]=_['intersection'](_0x118255[_0xfa68('0x2f')],qs[_0xfa68('0x33')](_0x566143[_0xfa68('0x31')][_0xfa68('0x33')]));_0x804cf7[_0xfa68('0x32')]=_0x804cf7[_0xfa68('0x32')][_0xfa68('0x34')]?_0x804cf7['attributes']:_0x118255[_0xfa68('0x2f')];if(_0x566143['query'][_0xfa68('0x40')]){_0x804cf7[_0xfa68('0x41')]=[{'all':!![]}];}_0x804cf7=_[_0xfa68('0x3c')]({},_0x804cf7,_0x566143[_0xfa68('0x3f')]);return db['VoiceMailMessage'][_0xfa68('0x46')](_0x804cf7)['then'](handleEntityNotFound(_0x46c485,null))['then'](respondWithResult(_0x46c485,null))['catch'](handleError(_0x46c485,null));};exports['create']=function(_0x2288bb,_0x2ec589){return db[_0xfa68('0x2a')][_0xfa68('0x47')](_0x2288bb[_0xfa68('0x48')],{})['then'](respondWithResult(_0x2ec589,0xc9))['catch'](handleError(_0x2ec589,null));};exports[_0xfa68('0x22')]=function(_0x9beea3,_0x1aaae0){if(_0x9beea3['body']['id']){delete _0x9beea3[_0xfa68('0x48')]['id'];}return db['VoiceMailMessage'][_0xfa68('0x46')]({'where':{'id':_0x9beea3[_0xfa68('0x44')]['id']}})[_0xfa68('0x24')](handleEntityNotFound(_0x1aaae0,null))[_0xfa68('0x24')](saveUpdates(_0x9beea3['body'],null))[_0xfa68('0x24')](respondWithResult(_0x1aaae0,null))[_0xfa68('0x49')](handleError(_0x1aaae0,null));};exports[_0xfa68('0x23')]=function(_0x374e52,_0x20c1e3){return db[_0xfa68('0x2a')][_0xfa68('0x46')]({'where':{'id':_0x374e52[_0xfa68('0x44')]['id']}})[_0xfa68('0x24')](handleEntityNotFound(_0x20c1e3,null))['then'](removeEntity(_0x20c1e3,null))[_0xfa68('0x49')](handleError(_0x20c1e3,null));};exports[_0xfa68('0x4a')]=function(_0x48e79f,_0x3056b4,_0x3b45a5){return db[_0xfa68('0x2a')][_0xfa68('0x46')]({'where':{'id':_0x48e79f[_0xfa68('0x44')]['id']},'attributes':['id','recording',_0xfa68('0x4b')]})[_0xfa68('0x24')](handleEntityNotFound(_0x3056b4,null))['then'](function(_0x1c064b){if(_0x1c064b){if(!_0x1c064b[_0xfa68('0x4c')]){throw new db[(_0xfa68('0x4d'))][(_0xfa68('0x4e'))](_0xfa68('0x4f'));}var _0x1fc7af={'Content-Type':'audio/wav','Content-Disposition':_0xfa68('0x50')};if(_0x1c064b['msg_id']){_0x1fc7af[_0xfa68('0x51')]=_0xfa68('0x52')+_0x1c064b[_0xfa68('0x4b')]+'.wav\x22';}_0x3056b4[_0xfa68('0x53')](_0x1fc7af);return _0x3056b4['send'](new Buffer(_0x1c064b['recording']));}})[_0xfa68('0x49')](handleError(_0x3056b4,null));}; \ No newline at end of file +var _0xb0e6=['Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','model','differenceBy','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','VoiceMailMessage','rows','catch','show','params','intersection','find','create','body','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set'];(function(_0x2787ba,_0x21b7c2){var _0x46e5ec=function(_0x32529f){while(--_0x32529f){_0x2787ba['push'](_0x2787ba['shift']());}};_0x46e5ec(++_0x21b7c2);}(_0xb0e6,0x1ee));var _0x6b0e=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xb0e6[_0x5d2803];return _0xdcad2c;};'use strict';var emlformat=require(_0x6b0e('0x0'));var rimraf=require(_0x6b0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6b0e('0x2'));var rp=require(_0x6b0e('0x3'));var moment=require('moment');var BPromise=require(_0x6b0e('0x4'));var Mustache=require(_0x6b0e('0x5'));var util=require(_0x6b0e('0x6'));var path=require(_0x6b0e('0x7'));var sox=require(_0x6b0e('0x8'));var csv=require(_0x6b0e('0x9'));var ejs=require(_0x6b0e('0xa'));var fs=require('fs');var fs_extra=require(_0x6b0e('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6b0e('0xc'));var jsforce=require(_0x6b0e('0xd'));var deskjs=require(_0x6b0e('0xe'));var toCsv=require(_0x6b0e('0x9'));var querystring=require(_0x6b0e('0xf'));var Papa=require(_0x6b0e('0x10'));var Redis=require(_0x6b0e('0x11'));var authService=require(_0x6b0e('0x12'));var qs=require(_0x6b0e('0x13'));var as=require(_0x6b0e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b0e('0x15'))(_0x6b0e('0x16'));var utils=require('../../config/utils');var config=require(_0x6b0e('0x17'));var licenseUtil=require(_0x6b0e('0x18'));var db=require(_0x6b0e('0x19'))['db'];function respondWithStatusCode(_0x1eeb96,_0x242c7e){_0x242c7e=_0x242c7e||0xcc;return function(_0x48ce1e){if(_0x48ce1e){return _0x1eeb96[_0x6b0e('0x1a')](_0x242c7e);}return _0x1eeb96[_0x6b0e('0x1b')](_0x242c7e)[_0x6b0e('0x1c')]();};}function respondWithResult(_0x5d68f5,_0x175cb4){_0x175cb4=_0x175cb4||0xc8;return function(_0x2124f9){if(_0x2124f9){return _0x5d68f5[_0x6b0e('0x1b')](_0x175cb4)[_0x6b0e('0x1d')](_0x2124f9);}};}function respondWithFilteredResult(_0x4aaf3f,_0x2230e9){return function(_0x2ce156){if(_0x2ce156){var _0xc12596=typeof _0x2230e9[_0x6b0e('0x1e')]===_0x6b0e('0x1f')&&typeof _0x2230e9[_0x6b0e('0x20')]===_0x6b0e('0x1f');var _0x5b4f13=_0x2ce156['count'];var _0x111f07=_0xc12596?0x0:_0x2230e9['offset'];var _0x543d2e=_0xc12596?_0x2ce156['count']:_0x2230e9[_0x6b0e('0x1e')]+_0x2230e9[_0x6b0e('0x20')];var _0x3de1dd;if(_0x543d2e>=_0x5b4f13){_0x543d2e=_0x5b4f13;_0x3de1dd=0xc8;}else{_0x3de1dd=0xce;}_0x4aaf3f['status'](_0x3de1dd);return _0x4aaf3f[_0x6b0e('0x21')](_0x6b0e('0x22'),_0x111f07+'-'+_0x543d2e+'/'+_0x5b4f13)[_0x6b0e('0x1d')](_0x2ce156);}return null;};}function patchUpdates(_0x1ce428){return function(_0x5290f0){try{jsonpatch['apply'](_0x5290f0,_0x1ce428,!![]);}catch(_0x351478){return BPromise[_0x6b0e('0x23')](_0x351478);}return _0x5290f0[_0x6b0e('0x24')]();};}function saveUpdates(_0x2d8512,_0xea210){return function(_0x164c34){if(_0x164c34){return _0x164c34[_0x6b0e('0x25')](_0x2d8512)[_0x6b0e('0x26')](function(_0x3ebf1e){return _0x3ebf1e;});}return null;};}function removeEntity(_0x46c450,_0x428a37){return function(_0x4ba25e){if(_0x4ba25e){return _0x4ba25e[_0x6b0e('0x27')]()[_0x6b0e('0x26')](function(){_0x46c450[_0x6b0e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x190ff0,_0x533bc8){return function(_0x373502){if(!_0x373502){_0x190ff0[_0x6b0e('0x1a')](0x194);}return _0x373502;};}function handleError(_0x52ac40,_0x1a8389){_0x1a8389=_0x1a8389||0x1f4;return function(_0x1f9d56){logger[_0x6b0e('0x28')](_0x1f9d56[_0x6b0e('0x29')]);if(_0x1f9d56['name']){delete _0x1f9d56[_0x6b0e('0x2a')];}_0x52ac40['status'](_0x1a8389)['send'](_0x1f9d56);};}exports[_0x6b0e('0x2b')]=function(_0x382214,_0x19f060){var _0x530c03={},_0x337533={},_0x2dc146={'count':0x0,'rows':[]};var _0x5d5eae=_[_0x6b0e('0x2c')](db['VoiceMailMessage'][_0x6b0e('0x2d')],function(_0x2ff950){return{'name':_0x2ff950[_0x6b0e('0x2e')],'type':_0x2ff950['type'][_0x6b0e('0x2f')]};});_0x337533[_0x6b0e('0x30')]=_[_0x6b0e('0x31')](_[_0x6b0e('0x2c')](_0x5d5eae,_0x6b0e('0x2a')),[_0x6b0e('0x2a')]);_0x337533[_0x6b0e('0x32')]=_[_0x6b0e('0x33')](_0x382214[_0x6b0e('0x32')]);_0x337533[_0x6b0e('0x34')]=_['intersection'](_0x337533['model'],_0x337533[_0x6b0e('0x32')]);_0x530c03[_0x6b0e('0x35')]=_['intersection'](_0x337533[_0x6b0e('0x30')],qs[_0x6b0e('0x36')](_0x382214[_0x6b0e('0x32')][_0x6b0e('0x36')]));_0x530c03[_0x6b0e('0x35')]=_0x530c03['attributes'][_0x6b0e('0x37')]?_0x530c03[_0x6b0e('0x35')]:_0x337533[_0x6b0e('0x30')];if(!_0x382214[_0x6b0e('0x32')][_0x6b0e('0x38')](_0x6b0e('0x39'))){_0x530c03[_0x6b0e('0x20')]=qs[_0x6b0e('0x20')](_0x382214[_0x6b0e('0x32')][_0x6b0e('0x20')]);_0x530c03[_0x6b0e('0x1e')]=qs['offset'](_0x382214['query'][_0x6b0e('0x1e')]);}_0x530c03[_0x6b0e('0x3a')]=qs['sort'](_0x382214['query']['sort']);_0x530c03[_0x6b0e('0x3b')]=qs['filters'](_['pick'](_0x382214[_0x6b0e('0x32')],_0x337533['filters']),_0x5d5eae);if(_0x382214[_0x6b0e('0x32')][_0x6b0e('0x3c')]){_0x530c03[_0x6b0e('0x3b')]=_[_0x6b0e('0x3d')](_0x530c03[_0x6b0e('0x3b')],{'$or':_['map'](_0x5d5eae,function(_0xe7d7c2){if(_0xe7d7c2[_0x6b0e('0x3e')]!==_0x6b0e('0x3f')){var _0x24a396={};_0x24a396[_0xe7d7c2[_0x6b0e('0x2a')]]={'$like':'%'+_0x382214[_0x6b0e('0x32')][_0x6b0e('0x3c')]+'%'};return _0x24a396;}})});}_0x530c03=_[_0x6b0e('0x3d')]({},_0x530c03,_0x382214[_0x6b0e('0x40')]);var _0x25ee49={'where':_0x530c03[_0x6b0e('0x3b')]};return db['VoiceMailMessage'][_0x6b0e('0x41')](_0x25ee49)[_0x6b0e('0x26')](function(_0x3f3719){_0x2dc146['count']=_0x3f3719;if(_0x382214[_0x6b0e('0x32')][_0x6b0e('0x42')]){_0x530c03[_0x6b0e('0x43')]=[{'all':!![]}];}return db[_0x6b0e('0x44')]['findAll'](_0x530c03);})[_0x6b0e('0x26')](function(_0x496c53){_0x2dc146[_0x6b0e('0x45')]=_0x496c53;return _0x2dc146;})[_0x6b0e('0x26')](respondWithFilteredResult(_0x19f060,_0x530c03))[_0x6b0e('0x46')](handleError(_0x19f060,null));};exports[_0x6b0e('0x47')]=function(_0x3773c2,_0x408a6f){var _0x1dd4f9={'raw':!![],'where':{'id':_0x3773c2[_0x6b0e('0x48')]['id']}},_0x5a1221={};_0x5a1221[_0x6b0e('0x30')]=_[_0x6b0e('0x33')](db[_0x6b0e('0x44')][_0x6b0e('0x2d')]);_0x5a1221['query']=_[_0x6b0e('0x33')](_0x3773c2[_0x6b0e('0x32')]);_0x5a1221[_0x6b0e('0x34')]=_[_0x6b0e('0x49')](_0x5a1221['model'],_0x5a1221[_0x6b0e('0x32')]);_0x1dd4f9[_0x6b0e('0x35')]=_[_0x6b0e('0x49')](_0x5a1221[_0x6b0e('0x30')],qs[_0x6b0e('0x36')](_0x3773c2['query'][_0x6b0e('0x36')]));_0x1dd4f9[_0x6b0e('0x35')]=_0x1dd4f9[_0x6b0e('0x35')][_0x6b0e('0x37')]?_0x1dd4f9['attributes']:_0x5a1221['model'];if(_0x3773c2[_0x6b0e('0x32')][_0x6b0e('0x42')]){_0x1dd4f9[_0x6b0e('0x43')]=[{'all':!![]}];}_0x1dd4f9=_[_0x6b0e('0x3d')]({},_0x1dd4f9,_0x3773c2[_0x6b0e('0x40')]);return db['VoiceMailMessage'][_0x6b0e('0x4a')](_0x1dd4f9)[_0x6b0e('0x26')](handleEntityNotFound(_0x408a6f,null))[_0x6b0e('0x26')](respondWithResult(_0x408a6f,null))[_0x6b0e('0x46')](handleError(_0x408a6f,null));};exports[_0x6b0e('0x4b')]=function(_0x251908,_0x1f1589){return db['VoiceMailMessage']['create'](_0x251908[_0x6b0e('0x4c')],{})[_0x6b0e('0x26')](respondWithResult(_0x1f1589,0xc9))['catch'](handleError(_0x1f1589,null));};exports[_0x6b0e('0x25')]=function(_0x30358d,_0x630fef){if(_0x30358d['body']['id']){delete _0x30358d['body']['id'];}return db['VoiceMailMessage'][_0x6b0e('0x4a')]({'where':{'id':_0x30358d[_0x6b0e('0x48')]['id']}})[_0x6b0e('0x26')](handleEntityNotFound(_0x630fef,null))[_0x6b0e('0x26')](saveUpdates(_0x30358d['body'],null))[_0x6b0e('0x26')](respondWithResult(_0x630fef,null))[_0x6b0e('0x46')](handleError(_0x630fef,null));};exports[_0x6b0e('0x27')]=function(_0x4185c9,_0x5721f1){return db['VoiceMailMessage'][_0x6b0e('0x4a')]({'where':{'id':_0x4185c9['params']['id']}})[_0x6b0e('0x26')](handleEntityNotFound(_0x5721f1,null))['then'](removeEntity(_0x5721f1,null))[_0x6b0e('0x46')](handleError(_0x5721f1,null));};exports[_0x6b0e('0x4d')]=function(_0x14bafb,_0x15c091,_0x20ad3c){return db[_0x6b0e('0x44')]['find']({'where':{'id':_0x14bafb[_0x6b0e('0x48')]['id']},'attributes':['id','recording',_0x6b0e('0x4e')]})[_0x6b0e('0x26')](handleEntityNotFound(_0x15c091,null))[_0x6b0e('0x26')](function(_0x44749d){if(_0x44749d){if(!_0x44749d[_0x6b0e('0x4f')]){throw new db[(_0x6b0e('0x50'))][(_0x6b0e('0x51'))](_0x6b0e('0x52'));}var _0x1fa0c={'Content-Type':_0x6b0e('0x53'),'Content-Disposition':_0x6b0e('0x54')};if(_0x44749d[_0x6b0e('0x4e')]){_0x1fa0c[_0x6b0e('0x55')]=_0x6b0e('0x56')+_0x44749d[_0x6b0e('0x4e')]+_0x6b0e('0x57');}_0x15c091['set'](_0x1fa0c);return _0x15c091['send'](new Buffer(_0x44749d[_0x6b0e('0x4f')]));}})[_0x6b0e('0x46')](handleError(_0x15c091,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index d586c35..19bcd55 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 _0x3b43=['define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x18dd15,_0x252692){var _0x46719e=function(_0x29eba7){while(--_0x29eba7){_0x18dd15['push'](_0x18dd15['shift']());}};_0x46719e(++_0x252692);}(_0x3b43,0x9e));var _0x33b4=function(_0x95f522,_0x42d6cd){_0x95f522=_0x95f522-0x0;var _0xcb79fb=_0x3b43[_0x95f522];return _0xcb79fb;};'use strict';var _=require('lodash');var util=require(_0x33b4('0x0'));var logger=require(_0x33b4('0x1'))('api');var moment=require(_0x33b4('0x2'));var BPromise=require(_0x33b4('0x3'));var rp=require(_0x33b4('0x4'));var fs=require('fs');var path=require(_0x33b4('0x5'));var rimraf=require(_0x33b4('0x6'));var config=require(_0x33b4('0x7'));var attributes=require(_0x33b4('0x8'));module[_0x33b4('0x9')]=function(_0x4c88b4,_0x583fcd){return _0x4c88b4[_0x33b4('0xa')](_0x33b4('0xb'),attributes,{'tableName':_0x33b4('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x33b4('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xcd9f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMailMessage.attributes','define','voice_voicemail_messages','dir','lodash','../../config/logger','api'];(function(_0x4f9352,_0x40ce43){var _0xbc9624=function(_0x12cd73){while(--_0x12cd73){_0x4f9352['push'](_0x4f9352['shift']());}};_0xbc9624(++_0x40ce43);}(_0xcd9f,0x11b));var _0xfcd9=function(_0xb893ef,_0x4cf0a5){_0xb893ef=_0xb893ef-0x0;var _0x1bc015=_0xcd9f[_0xb893ef];return _0x1bc015;};'use strict';var _=require(_0xfcd9('0x0'));var util=require('util');var logger=require(_0xfcd9('0x1'))(_0xfcd9('0x2'));var moment=require(_0xfcd9('0x3'));var BPromise=require(_0xfcd9('0x4'));var rp=require(_0xfcd9('0x5'));var fs=require('fs');var path=require(_0xfcd9('0x6'));var rimraf=require(_0xfcd9('0x7'));var config=require(_0xfcd9('0x8'));var attributes=require(_0xfcd9('0x9'));module['exports']=function(_0x2b6708,_0x5a4942){return _0x2b6708[_0xfcd9('0xa')]('VoiceMailMessage',attributes,{'tableName':_0xfcd9('0xb'),'paranoid':![],'indexes':[{'name':_0xfcd9('0xc'),'fields':[_0xfcd9('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 9c30b02..ac0607c 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 _0xdb43=['then','info','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x470bfb,_0x389787){var _0x2f5d97=function(_0x3431b4){while(--_0x3431b4){_0x470bfb['push'](_0x470bfb['shift']());}};_0x2f5d97(++_0x389787);}(_0xdb43,0x83));var _0x3db4=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xdb43[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x3db4('0x0'));var util=require(_0x3db4('0x1'));var moment=require(_0x3db4('0x2'));var BPromise=require(_0x3db4('0x3'));var rs=require(_0x3db4('0x4'));var fs=require('fs');var Redis=require(_0x3db4('0x5'));var db=require(_0x3db4('0x6'))['db'];var utils=require(_0x3db4('0x7'));var logger=require(_0x3db4('0x8'))(_0x3db4('0x9'));var config=require(_0x3db4('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3db4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf5ba95,_0x566b24,_0x3f0ebc){return new BPromise(function(_0x1e6b60,_0x2c2323){return client[_0x3db4('0xc')](_0xf5ba95,_0x3f0ebc)[_0x3db4('0xd')](function(_0x27eed6){logger[_0x3db4('0xe')](_0x3db4('0xf'),_0x566b24,'request\x20sent');logger[_0x3db4('0x10')](_0x3db4('0x11'),_0x566b24,_0x3db4('0x12'),JSON['stringify'](_0x27eed6));if(_0x27eed6[_0x3db4('0x13')]){if(_0x27eed6['error'][_0x3db4('0x14')]===0x1f4){logger[_0x3db4('0x13')](_0x3db4('0xf'),_0x566b24,_0x27eed6[_0x3db4('0x13')][_0x3db4('0x15')]);return _0x2c2323(_0x27eed6[_0x3db4('0x13')][_0x3db4('0x15')]);}logger[_0x3db4('0x13')](_0x3db4('0xf'),_0x566b24,_0x27eed6[_0x3db4('0x13')]['message']);return _0x1e6b60(_0x27eed6[_0x3db4('0x13')]['message']);}else{logger['info'](_0x3db4('0xf'),_0x566b24,_0x3db4('0x12'));_0x1e6b60(_0x27eed6[_0x3db4('0x16')][_0x3db4('0x15')]);}})[_0x3db4('0x17')](function(_0x292512){logger['error'](_0x3db4('0xf'),_0x566b24,_0x292512);_0x2c2323(_0x292512);});});} \ No newline at end of file +var _0x7aaf=['then','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMailMessage,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x7aaf,0x75));var _0xf7aa=function(_0x201aca,_0x596130){_0x201aca=_0x201aca-0x0;var _0x336800=_0x7aaf[_0x201aca];return _0x336800;};'use strict';var _=require(_0xf7aa('0x0'));var util=require('util');var moment=require(_0xf7aa('0x1'));var BPromise=require('bluebird');var rs=require(_0xf7aa('0x2'));var fs=require('fs');var Redis=require(_0xf7aa('0x3'));var db=require(_0xf7aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf7aa('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf7aa('0x6'));var client=jayson[_0xf7aa('0x7')][_0xf7aa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x270465,_0x320338,_0x1ec1df){return new BPromise(function(_0x328a74,_0x2b91f7){return client['request'](_0x270465,_0x1ec1df)[_0xf7aa('0x9')](function(_0x717b9c){logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x320338,_0xf7aa('0xa'));logger[_0xf7aa('0xb')](_0xf7aa('0xc'),_0x320338,'request\x20sent',JSON[_0xf7aa('0xd')](_0x717b9c));if(_0x717b9c[_0xf7aa('0xe')]){if(_0x717b9c[_0xf7aa('0xe')][_0xf7aa('0xf')]===0x1f4){logger['error'](_0xf7aa('0x10'),_0x320338,_0x717b9c[_0xf7aa('0xe')][_0xf7aa('0x11')]);return _0x2b91f7(_0x717b9c[_0xf7aa('0xe')][_0xf7aa('0x11')]);}logger[_0xf7aa('0xe')](_0xf7aa('0x10'),_0x320338,_0x717b9c[_0xf7aa('0xe')][_0xf7aa('0x11')]);return _0x328a74(_0x717b9c[_0xf7aa('0xe')]['message']);}else{logger[_0xf7aa('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x320338,_0xf7aa('0xa'));_0x328a74(_0x717b9c[_0xf7aa('0x13')][_0xf7aa('0x11')]);}})[_0xf7aa('0x14')](function(_0x36e17b){logger['error'](_0xf7aa('0x10'),_0x320338,_0x36e17b);_0x2b91f7(_0x36e17b);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 11921d0..dcc0b7c 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 _0xd25a=['update','destroy','delete','removeSound','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','post','create','/:id/sounds'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0xd25a,0xa5));var _0xad25=function(_0x2351c5,_0x47d986){_0x2351c5=_0x2351c5-0x0;var _0x13ca2e=_0xd25a[_0x2351c5];return _0x13ca2e;};'use strict';var multer=require('multer');var util=require(_0xad25('0x0'));var path=require(_0xad25('0x1'));var timeout=require(_0xad25('0x2'));var express=require(_0xad25('0x3'));var router=express['Router']();var fs_extra=require(_0xad25('0x4'));var auth=require(_0xad25('0x5'));var interaction=require(_0xad25('0x6'));var config=require(_0xad25('0x7'));var controller=require(_0xad25('0x8'));router[_0xad25('0x9')]('/',auth[_0xad25('0xa')](),controller['index']);router[_0xad25('0x9')](_0xad25('0xb'),auth[_0xad25('0xa')](),controller['show']);router[_0xad25('0x9')]('/:id/sounds',auth[_0xad25('0xa')](),controller['getSounds']);router[_0xad25('0xc')]('/',auth[_0xad25('0xa')](),controller[_0xad25('0xd')]);router[_0xad25('0xc')](_0xad25('0xe'),auth[_0xad25('0xa')](),controller['addSound']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xad25('0xf')]);router['delete'](_0xad25('0xb'),auth[_0xad25('0xa')](),controller[_0xad25('0x10')]);router[_0xad25('0x11')]('/:id/sounds/:id2',auth[_0xad25('0xa')](),controller[_0xad25('0x12')]);module[_0xad25('0x13')]=router; \ No newline at end of file +var _0xc83c=['isAuthenticated','index','/:id','show','/:id/sounds','getSounds','post','addSound','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get'];(function(_0x103af2,_0x54ef67){var _0x377945=function(_0x1e988c){while(--_0x1e988c){_0x103af2['push'](_0x103af2['shift']());}};_0x377945(++_0x54ef67);}(_0xc83c,0x98));var _0xcc83=function(_0x2338fa,_0x80579a){_0x2338fa=_0x2338fa-0x0;var _0x42df9b=_0xc83c[_0x2338fa];return _0x42df9b;};'use strict';var multer=require(_0xcc83('0x0'));var util=require(_0xcc83('0x1'));var path=require('path');var timeout=require(_0xcc83('0x2'));var express=require(_0xcc83('0x3'));var router=express[_0xcc83('0x4')]();var fs_extra=require(_0xcc83('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xcc83('0x6'));var config=require(_0xcc83('0x7'));var controller=require('./voiceMusicOnHold.controller');router[_0xcc83('0x8')]('/',auth[_0xcc83('0x9')](),controller[_0xcc83('0xa')]);router[_0xcc83('0x8')](_0xcc83('0xb'),auth[_0xcc83('0x9')](),controller[_0xcc83('0xc')]);router[_0xcc83('0x8')](_0xcc83('0xd'),auth['isAuthenticated'](),controller[_0xcc83('0xe')]);router['post']('/',auth[_0xcc83('0x9')](),controller['create']);router[_0xcc83('0xf')](_0xcc83('0xd'),auth[_0xcc83('0x9')](),controller[_0xcc83('0x10')]);router['put'](_0xcc83('0xb'),auth[_0xcc83('0x9')](),controller[_0xcc83('0x11')]);router[_0xcc83('0x12')]('/:id',auth[_0xcc83('0x9')](),controller[_0xcc83('0x13')]);router['delete'](_0xcc83('0x14'),auth[_0xcc83('0x9')](),controller[_0xcc83('0x15')]);module[_0xcc83('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index bcf72a0..5e611b2 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 _0xbb08=['custom','files','quietmp3nb','quietmp3','TIMESTAMP','BOOLEAN','sequelize','STRING','name','ENUM'];(function(_0x101394,_0x45e4b8){var _0x2d51f2=function(_0x1add1a){while(--_0x1add1a){_0x101394['push'](_0x101394['shift']());}};_0x2d51f2(++_0x45e4b8);}(_0xbb08,0xce));var _0x8bb0=function(_0xcdd6d,_0x49d6ef){_0xcdd6d=_0xcdd6d-0x0;var _0x4881be=_0xbb08[_0xcdd6d];return _0x4881be;};'use strict';var Sequelize=require(_0x8bb0('0x0'));module['exports']={'name':{'type':Sequelize[_0x8bb0('0x1')],'allowNull':![],'unique':_0x8bb0('0x2')},'mode':{'type':Sequelize[_0x8bb0('0x3')](_0x8bb0('0x4'),_0x8bb0('0x5'),'mp3nb',_0x8bb0('0x6'),_0x8bb0('0x7'),'mp3'),'allowNull':!![],'defaultValue':_0x8bb0('0x5')},'directory':{'type':Sequelize[_0x8bb0('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x8bb0('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x8bb0('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x8bb0('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x8bb0('0x1')],'allowNull':!![]},'stamp':{'type':_0x8bb0('0x8')},'defaultEntry':{'type':Sequelize[_0x8bb0('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a7a=['files','mp3nb','mp3','TIMESTAMP','BOOLEAN','exports','STRING','name','ENUM','custom'];(function(_0x4855bf,_0x10758e){var _0x32e91b=function(_0x2ae296){while(--_0x2ae296){_0x4855bf['push'](_0x4855bf['shift']());}};_0x32e91b(++_0x10758e);}(_0x6a7a,0xb9));var _0xa6a7=function(_0x4f144c,_0xc554bc){_0x4f144c=_0x4f144c-0x0;var _0x3b8fda=_0x6a7a[_0x4f144c];return _0x3b8fda;};'use strict';var Sequelize=require('sequelize');module[_0xa6a7('0x0')]={'name':{'type':Sequelize[_0xa6a7('0x1')],'allowNull':![],'unique':_0xa6a7('0x2')},'mode':{'type':Sequelize[_0xa6a7('0x3')](_0xa6a7('0x4'),_0xa6a7('0x5'),_0xa6a7('0x6'),'quietmp3nb','quietmp3',_0xa6a7('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xa6a7('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0xa6a7('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0xa6a7('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0xa6a7('0x1')],'allowNull':!![]},'stamp':{'type':_0xa6a7('0x8')},'defaultEntry':{'type':Sequelize[_0xa6a7('0x9')],'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 5bb5196..294770f 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 _0x6211=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','include','findAll','rows','catch','show','params','includeAll','find','body','create','sequelize','transaction','mode','files','join','root','server/files/moh','mkdirSync','directory','user','role','UserProfileSection','userProfileId','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','save_name','converted_format','createdAt','server/files/sounds/converted','%s.%s','basename','extname','format','symlinkSync','findOne','id2','Sound','unlinkSync','getSounds','order','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis'];(function(_0x295730,_0x3f779e){var _0x34f7e4=function(_0x335761){while(--_0x335761){_0x295730['push'](_0x295730['shift']());}};_0x34f7e4(++_0x3f779e);}(_0x6211,0x1bc));var _0x1621=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6211[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1621('0x0'));var jsonpatch=require(_0x1621('0x1'));var rp=require(_0x1621('0x2'));var moment=require(_0x1621('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1621('0x4'));var util=require(_0x1621('0x5'));var path=require(_0x1621('0x6'));var sox=require(_0x1621('0x7'));var csv=require(_0x1621('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1621('0x9'));var _=require(_0x1621('0xa'));var squel=require(_0x1621('0xb'));var crypto=require(_0x1621('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1621('0xd'));var toCsv=require(_0x1621('0x8'));var querystring=require(_0x1621('0xe'));var Papa=require('papaparse');var Redis=require(_0x1621('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1621('0x10'));var as=require(_0x1621('0x11'));var hardwareService=require(_0x1621('0x12'));var logger=require(_0x1621('0x13'))(_0x1621('0x14'));var utils=require(_0x1621('0x15'));var config=require(_0x1621('0x16'));var licenseUtil=require(_0x1621('0x17'));var db=require(_0x1621('0x18'))['db'];function respondWithStatusCode(_0x2dd64c,_0xd00431){_0xd00431=_0xd00431||0xcc;return function(_0x1042c2){if(_0x1042c2){return _0x2dd64c[_0x1621('0x19')](_0xd00431);}return _0x2dd64c[_0x1621('0x1a')](_0xd00431)[_0x1621('0x1b')]();};}function respondWithResult(_0xb26f35,_0x19b2d6){_0x19b2d6=_0x19b2d6||0xc8;return function(_0x53cf85){if(_0x53cf85){return _0xb26f35[_0x1621('0x1a')](_0x19b2d6)[_0x1621('0x1c')](_0x53cf85);}};}function respondWithFilteredResult(_0x163fae,_0x223e53){return function(_0x2ebd3a){if(_0x2ebd3a){var _0x52d37b=typeof _0x223e53[_0x1621('0x1d')]===_0x1621('0x1e')&&typeof _0x223e53[_0x1621('0x1f')]===_0x1621('0x1e');var _0x581442=_0x2ebd3a[_0x1621('0x20')];var _0x5a30e4=_0x52d37b?0x0:_0x223e53[_0x1621('0x1d')];var _0x333420=_0x52d37b?_0x2ebd3a[_0x1621('0x20')]:_0x223e53[_0x1621('0x1d')]+_0x223e53['limit'];var _0x528d15;if(_0x333420>=_0x581442){_0x333420=_0x581442;_0x528d15=0xc8;}else{_0x528d15=0xce;}_0x163fae[_0x1621('0x1a')](_0x528d15);return _0x163fae[_0x1621('0x21')](_0x1621('0x22'),_0x5a30e4+'-'+_0x333420+'/'+_0x581442)[_0x1621('0x1c')](_0x2ebd3a);}return null;};}function patchUpdates(_0x68a8db){return function(_0x3b0454){try{jsonpatch[_0x1621('0x23')](_0x3b0454,_0x68a8db,!![]);}catch(_0x57b870){return BPromise[_0x1621('0x24')](_0x57b870);}return _0x3b0454['save']();};}function saveUpdates(_0x576b66,_0x336055){return function(_0x2a4b84){if(_0x2a4b84){return _0x2a4b84['update'](_0x576b66)[_0x1621('0x25')](function(_0x4e4fc6){return _0x4e4fc6;});}return null;};}function removeEntity(_0x4d093b,_0x2312ba){return function(_0x33491d){if(_0x33491d){return _0x33491d[_0x1621('0x26')]()[_0x1621('0x25')](function(){var _0x5e1d53=_0x33491d[_0x1621('0x27')]({'plain':!![]});var _0x237885=_0x1621('0x28');return db[_0x1621('0x29')][_0x1621('0x26')]({'where':{'type':_0x237885,'resourceId':_0x5e1d53['id']}})[_0x1621('0x25')](function(){return _0x33491d;});})[_0x1621('0x25')](function(){_0x4d093b[_0x1621('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ff96,_0xd658a6){return function(_0x486477){if(!_0x486477){_0x23ff96[_0x1621('0x19')](0x194);}return _0x486477;};}function handleError(_0x3aff65,_0x66b3b3){_0x66b3b3=_0x66b3b3||0x1f4;return function(_0x56b320){logger[_0x1621('0x2a')](_0x56b320[_0x1621('0x2b')]);if(_0x56b320[_0x1621('0x2c')]){delete _0x56b320['name'];}_0x3aff65['status'](_0x66b3b3)[_0x1621('0x2d')](_0x56b320);};}exports[_0x1621('0x2e')]=function(_0x29a63b,_0x1ad71b){var _0x1029b5={},_0x1c0f8c={},_0x423053={'count':0x0,'rows':[]};var _0x351f2b=_['map'](db['VoiceMusicOnHold'][_0x1621('0x2f')],function(_0x2a9af3){return{'name':_0x2a9af3[_0x1621('0x30')],'type':_0x2a9af3[_0x1621('0x31')][_0x1621('0x32')]};});_0x1c0f8c[_0x1621('0x33')]=_[_0x1621('0x34')](_0x351f2b,_0x1621('0x2c'));_0x1c0f8c[_0x1621('0x35')]=_[_0x1621('0x36')](_0x29a63b['query']);_0x1c0f8c[_0x1621('0x37')]=_[_0x1621('0x38')](_0x1c0f8c[_0x1621('0x33')],_0x1c0f8c[_0x1621('0x35')]);_0x1029b5[_0x1621('0x39')]=_[_0x1621('0x38')](_0x1c0f8c[_0x1621('0x33')],qs['fields'](_0x29a63b[_0x1621('0x35')][_0x1621('0x3a')]));_0x1029b5[_0x1621('0x39')]=_0x1029b5[_0x1621('0x39')][_0x1621('0x3b')]?_0x1029b5[_0x1621('0x39')]:_0x1c0f8c[_0x1621('0x33')];if(!_0x29a63b[_0x1621('0x35')][_0x1621('0x3c')](_0x1621('0x3d'))){_0x1029b5[_0x1621('0x1f')]=qs[_0x1621('0x1f')](_0x29a63b['query'][_0x1621('0x1f')]);_0x1029b5['offset']=qs[_0x1621('0x1d')](_0x29a63b['query']['offset']);}_0x1029b5['order']=qs[_0x1621('0x3e')](_0x29a63b['query'][_0x1621('0x3e')]);delete _0x29a63b[_0x1621('0x35')][_0x1621('0x3e')];_0x1029b5[_0x1621('0x3f')]=qs['filters'](_[_0x1621('0x40')](_0x29a63b[_0x1621('0x35')],_0x1c0f8c[_0x1621('0x37')]),_0x351f2b);if(_0x29a63b[_0x1621('0x35')][_0x1621('0x41')]){_0x1029b5[_0x1621('0x3f')]=_[_0x1621('0x42')](_0x1029b5[_0x1621('0x3f')],{'$or':_[_0x1621('0x34')](_0x351f2b,function(_0x29e0fc){if(_0x29e0fc[_0x1621('0x31')]!==_0x1621('0x43')){var _0x2a2a6b={};_0x2a2a6b[_0x29e0fc[_0x1621('0x2c')]]={'$like':'%'+_0x29a63b[_0x1621('0x35')][_0x1621('0x41')]+'%'};return _0x2a2a6b;}})});}_0x1029b5=_['merge']({},_0x1029b5,_0x29a63b[_0x1621('0x44')]);var _0x4e2215={'where':_0x1029b5[_0x1621('0x3f')]};return db[_0x1621('0x45')][_0x1621('0x20')](_0x4e2215)[_0x1621('0x25')](function(_0x5632e3){_0x423053['count']=_0x5632e3;if(_0x29a63b[_0x1621('0x35')]['includeAll']){_0x1029b5[_0x1621('0x46')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x1621('0x47')](_0x1029b5);})[_0x1621('0x25')](function(_0x52998c){_0x423053[_0x1621('0x48')]=_0x52998c;return _0x423053;})[_0x1621('0x25')](respondWithFilteredResult(_0x1ad71b,_0x1029b5))[_0x1621('0x49')](handleError(_0x1ad71b,null));};exports[_0x1621('0x4a')]=function(_0x2bd585,_0x1e66ec){var _0x29c15f={'raw':![],'where':{'id':_0x2bd585[_0x1621('0x4b')]['id']}},_0x14c2cf={};_0x14c2cf[_0x1621('0x33')]=_[_0x1621('0x36')](db[_0x1621('0x45')]['rawAttributes']);_0x14c2cf[_0x1621('0x35')]=_[_0x1621('0x36')](_0x2bd585[_0x1621('0x35')]);_0x14c2cf[_0x1621('0x37')]=_[_0x1621('0x38')](_0x14c2cf['model'],_0x14c2cf[_0x1621('0x35')]);_0x29c15f[_0x1621('0x39')]=_['intersection'](_0x14c2cf['model'],qs['fields'](_0x2bd585[_0x1621('0x35')]['fields']));_0x29c15f['attributes']=_0x29c15f['attributes'][_0x1621('0x3b')]?_0x29c15f[_0x1621('0x39')]:_0x14c2cf['model'];if(_0x2bd585[_0x1621('0x35')][_0x1621('0x4c')]){_0x29c15f[_0x1621('0x46')]=[{'all':!![]}];}_0x29c15f=_[_0x1621('0x42')]({},_0x29c15f,_0x2bd585[_0x1621('0x44')]);return db[_0x1621('0x45')][_0x1621('0x4d')](_0x29c15f)[_0x1621('0x25')](handleEntityNotFound(_0x1e66ec,null))[_0x1621('0x25')](respondWithResult(_0x1e66ec,null))['catch'](handleError(_0x1e66ec,null));};exports['update']=function(_0x260a36,_0x1e00a5){if(_0x260a36['body']['id']){delete _0x260a36[_0x1621('0x4e')]['id'];}return db[_0x1621('0x45')][_0x1621('0x4d')]({'where':{'id':_0x260a36['params']['id']}})['then'](handleEntityNotFound(_0x1e00a5,null))['then'](saveUpdates(_0x260a36[_0x1621('0x4e')],null))[_0x1621('0x25')](respondWithResult(_0x1e00a5,null))['catch'](handleError(_0x1e00a5,null));};exports[_0x1621('0x4f')]=function(_0x42372c,_0x3ad56b,_0x4969d4){return db[_0x1621('0x50')][_0x1621('0x51')](function(_0x527cc2){if(_0x42372c[_0x1621('0x4e')][_0x1621('0x52')]===_0x1621('0x53')){_0x42372c[_0x1621('0x4e')]['directory']=path[_0x1621('0x54')](config[_0x1621('0x55')],_0x1621('0x56'),_0x42372c[_0x1621('0x4e')][_0x1621('0x2c')]);}return db['VoiceMusicOnHold'][_0x1621('0x4f')](_0x42372c['body'],{'transaction':_0x527cc2})[_0x1621('0x25')](function(_0x5935f6){if(_0x42372c[_0x1621('0x4e')][_0x1621('0x52')]===_0x1621('0x53')){fs[_0x1621('0x57')](_0x5935f6[_0x1621('0x58')],parseInt('0777',0x8));}var _0x245e56=_0x42372c[_0x1621('0x59')]['get']({'plain':!![]});if(!_0x245e56)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x245e56[_0x1621('0x5a')]===_0x1621('0x59')){var _0x5893f5=_0x5935f6['get']({'plain':!![]});return db[_0x1621('0x5b')][_0x1621('0x4d')]({'where':{'name':'MusicOnHolds','userProfileId':_0x245e56[_0x1621('0x5c')]},'raw':!![]})[_0x1621('0x25')](function(_0x9aaa12){if(_0x9aaa12&&_0x9aaa12['autoAssociation']===0x0){return db[_0x1621('0x29')][_0x1621('0x4f')]({'name':_0x5893f5['name'],'resourceId':_0x5893f5['id'],'type':_0x9aaa12['name'],'sectionId':_0x9aaa12['id']},{})[_0x1621('0x25')](function(){return _0x5935f6;});}else{return _0x5935f6;}})[_0x1621('0x49')](function(_0x1d1041){logger[_0x1621('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1d1041);});}return _0x5935f6;});})[_0x1621('0x25')](respondWithResult(_0x3ad56b,0xc9))[_0x1621('0x49')](handleError(_0x3ad56b,null));};exports[_0x1621('0x26')]=function(_0x111d23,_0x33aae5,_0x1c5356){var _0xc080ed;return db[_0x1621('0x45')][_0x1621('0x4d')]({'where':{'id':_0x111d23[_0x1621('0x4b')]['id']}})[_0x1621('0x25')](function(_0x2976b7){if(_0x2976b7){return db[_0x1621('0x50')][_0x1621('0x51')](function(_0x55d002){return _0x2976b7['destroy']({'transaction':_0x55d002,'raw':!![]})['then'](function(_0x32b41d){if(_0x32b41d[_0x1621('0x58')]){fs[_0x1621('0x5d')](_0x32b41d[_0x1621('0x58')])[_0x1621('0x5e')](function(_0x25a53a){fs['unlinkSync'](path[_0x1621('0x54')](_0x32b41d[_0x1621('0x58')],_0x25a53a));});fs[_0x1621('0x5f')](_0x32b41d[_0x1621('0x58')]);}return _0x32b41d;});})[_0x1621('0x49')](function(_0x58048a){throw new db[(_0x1621('0x60'))][(_0x1621('0x61'))](_0x58048a[_0x1621('0x62')]);});}})[_0x1621('0x25')](handleEntityNotFound(_0x33aae5,null))[_0x1621('0x25')](removeEntity(_0x33aae5,null))[_0x1621('0x49')](handleError(_0x33aae5,null));};exports[_0x1621('0x63')]=function(_0x272e2f,_0x23ad99,_0x3171cb){return db[_0x1621('0x50')][_0x1621('0x51')](function(_0x103282){var _0x122b63;return db['VoiceMusicOnHold'][_0x1621('0x4d')]({'where':{'id':_0x272e2f['params']['id']}})[_0x1621('0x25')](function(_0x2d6de5){if(_0x2d6de5){_0x122b63=_0x2d6de5;return _0x2d6de5[_0x1621('0x63')](_0x272e2f[_0x1621('0x4e')]['id'],{'transaction':_0x103282});}})[_0x1621('0x25')](function(_0x50ff74){if(_0x50ff74){return db['Sound']['findOne']({'where':{'id':_0x272e2f[_0x1621('0x4e')]['id']},'attributes':['id','name',_0x1621('0x64'),_0x1621('0x65'),_0x1621('0x66')],'raw':!![]});}})[_0x1621('0x25')](function(_0x30b7b9){if(_0x30b7b9){var _0x42d89b=path[_0x1621('0x54')](config[_0x1621('0x55')],_0x1621('0x67'),util['format'](_0x1621('0x68'),path[_0x1621('0x69')](_0x30b7b9[_0x1621('0x64')],path[_0x1621('0x6a')](_0x30b7b9['save_name'])),_0x30b7b9['converted_format']));var _0x12e082=path['join'](config[_0x1621('0x55')],'server/files/moh',_0x122b63[_0x1621('0x2c')],util[_0x1621('0x6b')](_0x1621('0x68'),_0x30b7b9[_0x1621('0x2c')],_0x30b7b9[_0x1621('0x65')]));fs[_0x1621('0x6c')](_0x42d89b,_0x12e082);return _0x30b7b9;}})['catch'](function(_0x482f37){throw new db['Sequelize'][(_0x1621('0x61'))](_0x482f37['message']);});})[_0x1621('0x25')](handleEntityNotFound(_0x23ad99,null))[_0x1621('0x25')](respondWithResult(_0x23ad99,0xc9))[_0x1621('0x49')](handleError(_0x23ad99,null));};exports['removeSound']=function(_0x505a22,_0xeb7ab0,_0x24855a){return db[_0x1621('0x50')][_0x1621('0x51')](function(_0x4e5d62){var _0x1bff7e;return db[_0x1621('0x45')][_0x1621('0x6d')]({'where':{'id':_0x505a22[_0x1621('0x4b')]['id']}})['then'](handleEntityNotFound(_0xeb7ab0,null))[_0x1621('0x25')](function(_0x587394){if(_0x587394){_0x1bff7e=_0x587394;return _0x587394['removeSound'](_0x505a22[_0x1621('0x4b')][_0x1621('0x6e')]);}})[_0x1621('0x25')](function(_0x1d45a0){if(_0x1d45a0){return db[_0x1621('0x6f')][_0x1621('0x6d')]({'where':{'id':_0x505a22['params'][_0x1621('0x6e')]},'attributes':['id','name',_0x1621('0x64'),_0x1621('0x65'),_0x1621('0x66')],'raw':!![]});}})[_0x1621('0x25')](function(_0x1f1df2){if(_0x1f1df2){fs[_0x1621('0x70')](path[_0x1621('0x54')](_0x1bff7e['directory'],util['format'](_0x1621('0x68'),_0x1f1df2[_0x1621('0x2c')],_0x1f1df2['converted_format'])));return _0x1f1df2;}})[_0x1621('0x49')](function(_0x4cbec1){throw new db[(_0x1621('0x60'))][(_0x1621('0x61'))](_0x4cbec1[_0x1621('0x62')]);});})['then'](handleEntityNotFound(_0xeb7ab0,null))[_0x1621('0x25')](respondWithStatusCode(_0xeb7ab0,0xcc))[_0x1621('0x49')](handleError(_0xeb7ab0,null));};exports[_0x1621('0x71')]=function(_0x36c648,_0x23bbde,_0x53c34d){var _0x597615={};var _0x2f6a64={};var _0x5e71ce;var _0x56584c;return db['VoiceMusicOnHold'][_0x1621('0x6d')]({'where':{'id':_0x36c648[_0x1621('0x4b')]['id']}})[_0x1621('0x25')](handleEntityNotFound(_0x23bbde,null))[_0x1621('0x25')](function(_0x4fbe83){if(_0x4fbe83){_0x5e71ce=_0x4fbe83;_0x2f6a64[_0x1621('0x33')]=_[_0x1621('0x36')](db['Sound'][_0x1621('0x2f')]);_0x2f6a64[_0x1621('0x35')]=_[_0x1621('0x36')](_0x36c648[_0x1621('0x35')]);_0x2f6a64['filters']=_[_0x1621('0x38')](_0x2f6a64[_0x1621('0x33')],_0x2f6a64[_0x1621('0x35')]);_0x597615[_0x1621('0x39')]=_['intersection'](_0x2f6a64['model'],qs[_0x1621('0x3a')](_0x36c648['query']['fields']));_0x597615[_0x1621('0x39')]=_0x597615[_0x1621('0x39')][_0x1621('0x3b')]?_0x597615[_0x1621('0x39')]:_0x2f6a64[_0x1621('0x33')];_0x597615[_0x1621('0x72')]=qs[_0x1621('0x3e')](_0x36c648[_0x1621('0x35')][_0x1621('0x3e')]);_0x597615[_0x1621('0x3f')]=qs[_0x1621('0x37')](_[_0x1621('0x40')](_0x36c648[_0x1621('0x35')],_0x2f6a64[_0x1621('0x37')]));if(_0x36c648[_0x1621('0x35')][_0x1621('0x41')]){_0x597615['where']=_[_0x1621('0x42')](_0x597615['where'],{'$or':_[_0x1621('0x34')](_0x597615[_0x1621('0x39')],function(_0x356a8c){var _0xd22f10={};_0xd22f10[_0x356a8c]={'$like':'%'+_0x36c648[_0x1621('0x35')][_0x1621('0x41')]+'%'};return _0xd22f10;})});}_0x597615=_[_0x1621('0x42')]({},_0x597615,_0x36c648[_0x1621('0x44')]);return _0x5e71ce[_0x1621('0x71')](_0x597615);}})[_0x1621('0x25')](function(_0x14f915){if(_0x14f915){_0x56584c=_0x14f915['length'];if(!_0x36c648[_0x1621('0x35')][_0x1621('0x3c')](_0x1621('0x3d'))){_0x597615[_0x1621('0x1f')]=qs[_0x1621('0x1f')](_0x36c648['query']['limit']);_0x597615[_0x1621('0x1d')]=qs[_0x1621('0x1d')](_0x36c648[_0x1621('0x35')][_0x1621('0x1d')]);}return _0x5e71ce[_0x1621('0x71')](_0x597615);}})[_0x1621('0x25')](function(_0x3e3ced){if(_0x3e3ced){return _0x3e3ced?{'count':_0x56584c,'rows':_0x3e3ced}:null;}})['then'](respondWithResult(_0x23bbde,null))[_0x1621('0x49')](handleError(_0x23bbde,null));}; \ No newline at end of file +var _0x73d4=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','filters','filter','where','merge','VIRTUAL','options','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','show','params','body','find','create','sequelize','transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','save_name','converted_format','createdAt','format','%s.%s','basename','symlinkSync','removeSound','id2','ValidationError','getSounds','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','limit','undefined','count','status','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','stack'];(function(_0x3eb958,_0x249551){var _0x34efca=function(_0x1a3981){while(--_0x1a3981){_0x3eb958['push'](_0x3eb958['shift']());}};_0x34efca(++_0x249551);}(_0x73d4,0x1a0));var _0x473d=function(_0xe6beba,_0x3f15d1){_0xe6beba=_0xe6beba-0x0;var _0x2f1c08=_0x73d4[_0xe6beba];return _0x2f1c08;};'use strict';var emlformat=require(_0x473d('0x0'));var rimraf=require(_0x473d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x473d('0x2'));var rp=require(_0x473d('0x3'));var moment=require(_0x473d('0x4'));var BPromise=require(_0x473d('0x5'));var Mustache=require(_0x473d('0x6'));var util=require('util');var path=require(_0x473d('0x7'));var sox=require(_0x473d('0x8'));var csv=require(_0x473d('0x9'));var ejs=require(_0x473d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x473d('0xb'));var squel=require('squel');var crypto=require(_0x473d('0xc'));var jsforce=require(_0x473d('0xd'));var deskjs=require(_0x473d('0xe'));var toCsv=require(_0x473d('0x9'));var querystring=require(_0x473d('0xf'));var Papa=require(_0x473d('0x10'));var Redis=require(_0x473d('0x11'));var authService=require(_0x473d('0x12'));var qs=require(_0x473d('0x13'));var as=require(_0x473d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x473d('0x15'));var utils=require('../../config/utils');var config=require(_0x473d('0x16'));var licenseUtil=require(_0x473d('0x17'));var db=require(_0x473d('0x18'))['db'];function respondWithStatusCode(_0x4c46f2,_0xde5e21){_0xde5e21=_0xde5e21||0xcc;return function(_0x2b26b3){if(_0x2b26b3){return _0x4c46f2[_0x473d('0x19')](_0xde5e21);}return _0x4c46f2['status'](_0xde5e21)[_0x473d('0x1a')]();};}function respondWithResult(_0x591295,_0x5c9fc6){_0x5c9fc6=_0x5c9fc6||0xc8;return function(_0xd495b6){if(_0xd495b6){return _0x591295['status'](_0x5c9fc6)[_0x473d('0x1b')](_0xd495b6);}};}function respondWithFilteredResult(_0xeff95f,_0x1578e2){return function(_0x1d54b1){if(_0x1d54b1){var _0x2fcbc1=typeof _0x1578e2[_0x473d('0x1c')]==='undefined'&&typeof _0x1578e2[_0x473d('0x1d')]===_0x473d('0x1e');var _0xb25a8c=_0x1d54b1[_0x473d('0x1f')];var _0x3bcfa1=_0x2fcbc1?0x0:_0x1578e2[_0x473d('0x1c')];var _0x25c3de=_0x2fcbc1?_0x1d54b1[_0x473d('0x1f')]:_0x1578e2['offset']+_0x1578e2[_0x473d('0x1d')];var _0x55e7c1;if(_0x25c3de>=_0xb25a8c){_0x25c3de=_0xb25a8c;_0x55e7c1=0xc8;}else{_0x55e7c1=0xce;}_0xeff95f[_0x473d('0x20')](_0x55e7c1);return _0xeff95f['set'](_0x473d('0x21'),_0x3bcfa1+'-'+_0x25c3de+'/'+_0xb25a8c)[_0x473d('0x1b')](_0x1d54b1);}return null;};}function patchUpdates(_0x970c8c){return function(_0x4f5cc1){try{jsonpatch['apply'](_0x4f5cc1,_0x970c8c,!![]);}catch(_0x2b02ec){return BPromise[_0x473d('0x22')](_0x2b02ec);}return _0x4f5cc1[_0x473d('0x23')]();};}function saveUpdates(_0x58de02,_0x317ad8){return function(_0x340a48){if(_0x340a48){return _0x340a48[_0x473d('0x24')](_0x58de02)[_0x473d('0x25')](function(_0x216dea){return _0x216dea;});}return null;};}function removeEntity(_0xb92ad8,_0x18d8ca){return function(_0x47c7d3){if(_0x47c7d3){return _0x47c7d3[_0x473d('0x26')]()[_0x473d('0x25')](function(){var _0x135ad6=_0x47c7d3[_0x473d('0x27')]({'plain':!![]});var _0x47e8ad=_0x473d('0x28');return db[_0x473d('0x29')][_0x473d('0x26')]({'where':{'type':_0x47e8ad,'resourceId':_0x135ad6['id']}})[_0x473d('0x25')](function(){return _0x47c7d3;});})[_0x473d('0x25')](function(){_0xb92ad8[_0x473d('0x20')](0xcc)[_0x473d('0x1a')]();});}};}function handleEntityNotFound(_0x125ff9,_0x5e3c8f){return function(_0x5da127){if(!_0x5da127){_0x125ff9[_0x473d('0x19')](0x194);}return _0x5da127;};}function handleError(_0x3a870c,_0x1111e1){_0x1111e1=_0x1111e1||0x1f4;return function(_0x26319f){logger[_0x473d('0x2a')](_0x26319f[_0x473d('0x2b')]);if(_0x26319f['name']){delete _0x26319f[_0x473d('0x2c')];}_0x3a870c[_0x473d('0x20')](_0x1111e1)[_0x473d('0x2d')](_0x26319f);};}exports[_0x473d('0x2e')]=function(_0xd23d94,_0x46f128){var _0x409e1a={},_0x106c36={},_0xcc6692={'count':0x0,'rows':[]};var _0x3031cc=_[_0x473d('0x2f')](db['VoiceMusicOnHold'][_0x473d('0x30')],function(_0x2dcfb5){return{'name':_0x2dcfb5[_0x473d('0x31')],'type':_0x2dcfb5[_0x473d('0x32')][_0x473d('0x33')]};});_0x106c36['model']=_[_0x473d('0x2f')](_0x3031cc,_0x473d('0x2c'));_0x106c36[_0x473d('0x34')]=_[_0x473d('0x35')](_0xd23d94['query']);_0x106c36['filters']=_[_0x473d('0x36')](_0x106c36[_0x473d('0x37')],_0x106c36[_0x473d('0x34')]);_0x409e1a[_0x473d('0x38')]=_['intersection'](_0x106c36[_0x473d('0x37')],qs['fields'](_0xd23d94[_0x473d('0x34')][_0x473d('0x39')]));_0x409e1a[_0x473d('0x38')]=_0x409e1a[_0x473d('0x38')][_0x473d('0x3a')]?_0x409e1a[_0x473d('0x38')]:_0x106c36[_0x473d('0x37')];if(!_0xd23d94[_0x473d('0x34')]['hasOwnProperty'](_0x473d('0x3b'))){_0x409e1a[_0x473d('0x1d')]=qs[_0x473d('0x1d')](_0xd23d94[_0x473d('0x34')][_0x473d('0x1d')]);_0x409e1a[_0x473d('0x1c')]=qs['offset'](_0xd23d94[_0x473d('0x34')]['offset']);}_0x409e1a['order']=qs[_0x473d('0x3c')](_0xd23d94[_0x473d('0x34')][_0x473d('0x3c')]);delete _0xd23d94['query'][_0x473d('0x3c')];_0x409e1a['where']=qs[_0x473d('0x3d')](_['pick'](_0xd23d94[_0x473d('0x34')],_0x106c36['filters']),_0x3031cc);if(_0xd23d94['query'][_0x473d('0x3e')]){_0x409e1a[_0x473d('0x3f')]=_[_0x473d('0x40')](_0x409e1a[_0x473d('0x3f')],{'$or':_[_0x473d('0x2f')](_0x3031cc,function(_0x2f0684){if(_0x2f0684[_0x473d('0x32')]!==_0x473d('0x41')){var _0xdf698e={};_0xdf698e[_0x2f0684[_0x473d('0x2c')]]={'$like':'%'+_0xd23d94[_0x473d('0x34')][_0x473d('0x3e')]+'%'};return _0xdf698e;}})});}_0x409e1a=_['merge']({},_0x409e1a,_0xd23d94[_0x473d('0x42')]);var _0x5704d7={'where':_0x409e1a['where']};return db['VoiceMusicOnHold'][_0x473d('0x1f')](_0x5704d7)[_0x473d('0x25')](function(_0x1f43b6){_0xcc6692[_0x473d('0x1f')]=_0x1f43b6;if(_0xd23d94['query'][_0x473d('0x43')]){_0x409e1a[_0x473d('0x44')]=[{'all':!![]}];}return db[_0x473d('0x45')][_0x473d('0x46')](_0x409e1a);})[_0x473d('0x25')](function(_0x3dbc5f){_0xcc6692[_0x473d('0x47')]=_0x3dbc5f;return _0xcc6692;})[_0x473d('0x25')](respondWithFilteredResult(_0x46f128,_0x409e1a))[_0x473d('0x48')](handleError(_0x46f128,null));};exports[_0x473d('0x49')]=function(_0x4cac24,_0x57b2bb){var _0x340632={'raw':![],'where':{'id':_0x4cac24[_0x473d('0x4a')]['id']}},_0x15d635={};_0x15d635[_0x473d('0x37')]=_[_0x473d('0x35')](db['VoiceMusicOnHold']['rawAttributes']);_0x15d635[_0x473d('0x34')]=_[_0x473d('0x35')](_0x4cac24[_0x473d('0x34')]);_0x15d635[_0x473d('0x3d')]=_[_0x473d('0x36')](_0x15d635[_0x473d('0x37')],_0x15d635[_0x473d('0x34')]);_0x340632[_0x473d('0x38')]=_[_0x473d('0x36')](_0x15d635[_0x473d('0x37')],qs[_0x473d('0x39')](_0x4cac24['query']['fields']));_0x340632[_0x473d('0x38')]=_0x340632[_0x473d('0x38')][_0x473d('0x3a')]?_0x340632['attributes']:_0x15d635[_0x473d('0x37')];if(_0x4cac24[_0x473d('0x34')][_0x473d('0x43')]){_0x340632[_0x473d('0x44')]=[{'all':!![]}];}_0x340632=_[_0x473d('0x40')]({},_0x340632,_0x4cac24[_0x473d('0x42')]);return db['VoiceMusicOnHold']['find'](_0x340632)['then'](handleEntityNotFound(_0x57b2bb,null))['then'](respondWithResult(_0x57b2bb,null))['catch'](handleError(_0x57b2bb,null));};exports[_0x473d('0x24')]=function(_0x2813e0,_0x18ab96){if(_0x2813e0[_0x473d('0x4b')]['id']){delete _0x2813e0['body']['id'];}return db[_0x473d('0x45')][_0x473d('0x4c')]({'where':{'id':_0x2813e0['params']['id']}})[_0x473d('0x25')](handleEntityNotFound(_0x18ab96,null))[_0x473d('0x25')](saveUpdates(_0x2813e0['body'],null))['then'](respondWithResult(_0x18ab96,null))[_0x473d('0x48')](handleError(_0x18ab96,null));};exports[_0x473d('0x4d')]=function(_0x33c39c,_0x5966d4,_0x2e1cf1){return db[_0x473d('0x4e')][_0x473d('0x4f')](function(_0x31e998){if(_0x33c39c[_0x473d('0x4b')][_0x473d('0x50')]===_0x473d('0x51')){_0x33c39c[_0x473d('0x4b')][_0x473d('0x52')]=path[_0x473d('0x53')](config[_0x473d('0x54')],_0x473d('0x55'),_0x33c39c[_0x473d('0x4b')]['name']);}return db[_0x473d('0x45')][_0x473d('0x4d')](_0x33c39c['body'],{'transaction':_0x31e998})[_0x473d('0x25')](function(_0x353d7d){if(_0x33c39c['body'][_0x473d('0x50')]==='files'){fs[_0x473d('0x56')](_0x353d7d[_0x473d('0x52')],parseInt(_0x473d('0x57'),0x8));}var _0x56c1e4=_0x33c39c[_0x473d('0x58')][_0x473d('0x27')]({'plain':!![]});if(!_0x56c1e4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56c1e4[_0x473d('0x59')]===_0x473d('0x58')){var _0x10dddb=_0x353d7d['get']({'plain':!![]});return db[_0x473d('0x5a')]['find']({'where':{'name':'MusicOnHolds','userProfileId':_0x56c1e4[_0x473d('0x5b')]},'raw':!![]})['then'](function(_0x579a8f){if(_0x579a8f&&_0x579a8f[_0x473d('0x5c')]===0x0){return db['UserProfileResource'][_0x473d('0x4d')]({'name':_0x10dddb[_0x473d('0x2c')],'resourceId':_0x10dddb['id'],'type':_0x579a8f[_0x473d('0x2c')],'sectionId':_0x579a8f['id']},{})[_0x473d('0x25')](function(){return _0x353d7d;});}else{return _0x353d7d;}})[_0x473d('0x48')](function(_0xe9f03b){logger[_0x473d('0x2a')](_0x473d('0x5d'),_0xe9f03b);});}return _0x353d7d;});})[_0x473d('0x25')](respondWithResult(_0x5966d4,0xc9))[_0x473d('0x48')](handleError(_0x5966d4,null));};exports[_0x473d('0x26')]=function(_0x1bc910,_0x57309b,_0x394e39){var _0x1d89c4;return db[_0x473d('0x45')][_0x473d('0x4c')]({'where':{'id':_0x1bc910[_0x473d('0x4a')]['id']}})[_0x473d('0x25')](function(_0x21c845){if(_0x21c845){return db[_0x473d('0x4e')][_0x473d('0x4f')](function(_0x52bd62){return _0x21c845[_0x473d('0x26')]({'transaction':_0x52bd62,'raw':!![]})[_0x473d('0x25')](function(_0x5ad02e){if(_0x5ad02e['directory']){fs[_0x473d('0x5e')](_0x5ad02e['directory'])[_0x473d('0x5f')](function(_0xa68f4f){fs[_0x473d('0x60')](path[_0x473d('0x53')](_0x5ad02e[_0x473d('0x52')],_0xa68f4f));});fs[_0x473d('0x61')](_0x5ad02e[_0x473d('0x52')]);}return _0x5ad02e;});})[_0x473d('0x48')](function(_0xc3c90d){throw new db[(_0x473d('0x62'))]['ValidationError'](_0xc3c90d[_0x473d('0x63')]);});}})['then'](handleEntityNotFound(_0x57309b,null))[_0x473d('0x25')](removeEntity(_0x57309b,null))[_0x473d('0x48')](handleError(_0x57309b,null));};exports[_0x473d('0x64')]=function(_0x1fbac3,_0x46ba8e,_0x49672f){return db[_0x473d('0x4e')][_0x473d('0x4f')](function(_0x11d19e){var _0x334ad8;return db[_0x473d('0x45')][_0x473d('0x4c')]({'where':{'id':_0x1fbac3[_0x473d('0x4a')]['id']}})[_0x473d('0x25')](function(_0xc550d8){if(_0xc550d8){_0x334ad8=_0xc550d8;return _0xc550d8[_0x473d('0x64')](_0x1fbac3['body']['id'],{'transaction':_0x11d19e});}})[_0x473d('0x25')](function(_0x48edbf){if(_0x48edbf){return db[_0x473d('0x65')][_0x473d('0x66')]({'where':{'id':_0x1fbac3['body']['id']},'attributes':['id',_0x473d('0x2c'),_0x473d('0x67'),_0x473d('0x68'),_0x473d('0x69')],'raw':!![]});}})[_0x473d('0x25')](function(_0x206ccf){if(_0x206ccf){var _0x5d2baa=path[_0x473d('0x53')](config[_0x473d('0x54')],'server/files/sounds/converted',util[_0x473d('0x6a')](_0x473d('0x6b'),path[_0x473d('0x6c')](_0x206ccf[_0x473d('0x67')],path['extname'](_0x206ccf[_0x473d('0x67')])),_0x206ccf[_0x473d('0x68')]));var _0x42571a=path['join'](config['root'],_0x473d('0x55'),_0x334ad8[_0x473d('0x2c')],util['format'](_0x473d('0x6b'),_0x206ccf[_0x473d('0x2c')],_0x206ccf['converted_format']));fs[_0x473d('0x6d')](_0x5d2baa,_0x42571a);return _0x206ccf;}})[_0x473d('0x48')](function(_0x41955b){throw new db[(_0x473d('0x62'))]['ValidationError'](_0x41955b['message']);});})[_0x473d('0x25')](handleEntityNotFound(_0x46ba8e,null))[_0x473d('0x25')](respondWithResult(_0x46ba8e,0xc9))[_0x473d('0x48')](handleError(_0x46ba8e,null));};exports[_0x473d('0x6e')]=function(_0x2b48d4,_0x5bd4d3,_0xface47){return db[_0x473d('0x4e')][_0x473d('0x4f')](function(_0x459aa3){var _0xd88d;return db[_0x473d('0x45')][_0x473d('0x66')]({'where':{'id':_0x2b48d4[_0x473d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5bd4d3,null))[_0x473d('0x25')](function(_0x51ec99){if(_0x51ec99){_0xd88d=_0x51ec99;return _0x51ec99[_0x473d('0x6e')](_0x2b48d4[_0x473d('0x4a')][_0x473d('0x6f')]);}})['then'](function(_0x5d2443){if(_0x5d2443){return db[_0x473d('0x65')][_0x473d('0x66')]({'where':{'id':_0x2b48d4[_0x473d('0x4a')][_0x473d('0x6f')]},'attributes':['id','name',_0x473d('0x67'),_0x473d('0x68'),_0x473d('0x69')],'raw':!![]});}})[_0x473d('0x25')](function(_0x111ad9){if(_0x111ad9){fs[_0x473d('0x60')](path[_0x473d('0x53')](_0xd88d['directory'],util[_0x473d('0x6a')](_0x473d('0x6b'),_0x111ad9['name'],_0x111ad9[_0x473d('0x68')])));return _0x111ad9;}})['catch'](function(_0x462146){throw new db['Sequelize'][(_0x473d('0x70'))](_0x462146[_0x473d('0x63')]);});})['then'](handleEntityNotFound(_0x5bd4d3,null))[_0x473d('0x25')](respondWithStatusCode(_0x5bd4d3,0xcc))[_0x473d('0x48')](handleError(_0x5bd4d3,null));};exports['getSounds']=function(_0x10bac7,_0x186758,_0xfd4729){var _0x56f736={};var _0x4aa8c4={};var _0x130dea;var _0x35d8e5;return db['VoiceMusicOnHold'][_0x473d('0x66')]({'where':{'id':_0x10bac7[_0x473d('0x4a')]['id']}})[_0x473d('0x25')](handleEntityNotFound(_0x186758,null))[_0x473d('0x25')](function(_0x10e9c9){if(_0x10e9c9){_0x130dea=_0x10e9c9;_0x4aa8c4['model']=_[_0x473d('0x35')](db['Sound'][_0x473d('0x30')]);_0x4aa8c4[_0x473d('0x34')]=_['keys'](_0x10bac7[_0x473d('0x34')]);_0x4aa8c4[_0x473d('0x3d')]=_[_0x473d('0x36')](_0x4aa8c4[_0x473d('0x37')],_0x4aa8c4['query']);_0x56f736[_0x473d('0x38')]=_[_0x473d('0x36')](_0x4aa8c4[_0x473d('0x37')],qs[_0x473d('0x39')](_0x10bac7[_0x473d('0x34')][_0x473d('0x39')]));_0x56f736[_0x473d('0x38')]=_0x56f736[_0x473d('0x38')]['length']?_0x56f736['attributes']:_0x4aa8c4[_0x473d('0x37')];_0x56f736['order']=qs['sort'](_0x10bac7[_0x473d('0x34')][_0x473d('0x3c')]);_0x56f736[_0x473d('0x3f')]=qs['filters'](_['pick'](_0x10bac7[_0x473d('0x34')],_0x4aa8c4[_0x473d('0x3d')]));if(_0x10bac7[_0x473d('0x34')][_0x473d('0x3e')]){_0x56f736['where']=_[_0x473d('0x40')](_0x56f736[_0x473d('0x3f')],{'$or':_[_0x473d('0x2f')](_0x56f736[_0x473d('0x38')],function(_0x46cc04){var _0x49ff92={};_0x49ff92[_0x46cc04]={'$like':'%'+_0x10bac7['query'][_0x473d('0x3e')]+'%'};return _0x49ff92;})});}_0x56f736=_[_0x473d('0x40')]({},_0x56f736,_0x10bac7[_0x473d('0x42')]);return _0x130dea[_0x473d('0x71')](_0x56f736);}})[_0x473d('0x25')](function(_0x2af893){if(_0x2af893){_0x35d8e5=_0x2af893['length'];if(!_0x10bac7['query'][_0x473d('0x72')](_0x473d('0x3b'))){_0x56f736[_0x473d('0x1d')]=qs[_0x473d('0x1d')](_0x10bac7['query'][_0x473d('0x1d')]);_0x56f736[_0x473d('0x1c')]=qs[_0x473d('0x1c')](_0x10bac7[_0x473d('0x34')][_0x473d('0x1c')]);}return _0x130dea[_0x473d('0x71')](_0x56f736);}})[_0x473d('0x25')](function(_0x39552b){if(_0x39552b){return _0x39552b?{'count':_0x35d8e5,'rows':_0x39552b}:null;}})[_0x473d('0x25')](respondWithResult(_0x186758,null))[_0x473d('0x48')](handleError(_0x186758,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index cb43ae5..14a845f 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 _0x5fd4=['api','moment','request-promise','path','rimraf','../../config/environment','define','voice_musiconhold','lodash','../../config/logger'];(function(_0x11e05d,_0x3a4491){var _0x335588=function(_0x35ec3f){while(--_0x35ec3f){_0x11e05d['push'](_0x11e05d['shift']());}};_0x335588(++_0x3a4491);}(_0x5fd4,0x184));var _0x45fd=function(_0x25633f,_0x3f1e8f){_0x25633f=_0x25633f-0x0;var _0x1dc5b2=_0x5fd4[_0x25633f];return _0x1dc5b2;};'use strict';var _=require(_0x45fd('0x0'));var util=require('util');var logger=require(_0x45fd('0x1'))(_0x45fd('0x2'));var moment=require(_0x45fd('0x3'));var BPromise=require('bluebird');var rp=require(_0x45fd('0x4'));var fs=require('fs');var path=require(_0x45fd('0x5'));var rimraf=require(_0x45fd('0x6'));var config=require(_0x45fd('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0xfa5ec7,_0x52c93a){return _0xfa5ec7[_0x45fd('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x45fd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4596=['../../config/logger','bluebird','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','VoiceMusicOnHold','lodash','util'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x4596,0x193));var _0x6459=function(_0x3151d2,_0x297560){_0x3151d2=_0x3151d2-0x0;var _0x31a8e8=_0x4596[_0x3151d2];return _0x31a8e8;};'use strict';var _=require(_0x6459('0x0'));var util=require(_0x6459('0x1'));var logger=require(_0x6459('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6459('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6459('0x4'));var config=require(_0x6459('0x5'));var attributes=require(_0x6459('0x6'));module[_0x6459('0x7')]=function(_0x4334e6,_0x5ec9b2){return _0x4334e6['define'](_0x6459('0x8'),attributes,{'tableName':'voice_musiconhold','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 53154f6..f1d65d6 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(_0x555e55,_0x1c6784){var _0x26def4=function(_0x5b4b9e){while(--_0x5b4b9e){_0x555e55['push'](_0x555e55['shift']());}};_0x26def4(++_0x1c6784);}(_0x70e0,0x17b));var _0x070e=function(_0x5753de,_0x20185){_0x5753de=_0x5753de-0x0;var _0x1a908f=_0x70e0[_0x5753de];return _0x1a908f;};'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 _0xe706=['http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4d1d47,_0x3e8362){var _0x936764=function(_0x5f597a){while(--_0x5f597a){_0x4d1d47['push'](_0x4d1d47['shift']());}};_0x936764(++_0x3e8362);}(_0xe706,0xa3));var _0x6e70=function(_0x44799d,_0x26c23a){_0x44799d=_0x44799d-0x0;var _0x4f4a20=_0xe706[_0x44799d];return _0x4f4a20;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('VoiceMusicOnHold,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 1a229fc..ef05bb2 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 _0xae1c=['../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/users','getAgents','/:id/teams','create','post','addAgents','addTeams','put','update','delete','destroy','removeAgents','exports','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x47a83c,_0x361def){var _0x312b32=function(_0x464c27){while(--_0x464c27){_0x47a83c['push'](_0x47a83c['shift']());}};_0x312b32(++_0x361def);}(_0xae1c,0xff));var _0xcae1=function(_0x50c818,_0x8e53bb){_0x50c818=_0x50c818-0x0;var _0x32c247=_0xae1c[_0x50c818];return _0x32c247;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcae1('0x0'));var router=express[_0xcae1('0x1')]();var fs_extra=require(_0xcae1('0x2'));var auth=require(_0xcae1('0x3'));var interaction=require(_0xcae1('0x4'));var config=require(_0xcae1('0x5'));var controller=require(_0xcae1('0x6'));router[_0xcae1('0x7')]('/',auth[_0xcae1('0x8')](),controller[_0xcae1('0x9')]);router[_0xcae1('0x7')](_0xcae1('0xa'),auth[_0xcae1('0x8')](),controller['describe']);router['get'](_0xcae1('0xb'),auth[_0xcae1('0x8')](),controller[_0xcae1('0xc')]);router['get'](_0xcae1('0xd'),auth[_0xcae1('0x8')](),controller[_0xcae1('0xe')]);router['get'](_0xcae1('0xf'),auth[_0xcae1('0x8')](),controller['getTeams']);router['post']('/',auth[_0xcae1('0x8')](),controller[_0xcae1('0x10')]);router[_0xcae1('0x11')](_0xcae1('0xd'),auth[_0xcae1('0x8')](),controller[_0xcae1('0x12')]);router[_0xcae1('0x11')](_0xcae1('0xf'),auth[_0xcae1('0x8')](),controller[_0xcae1('0x13')]);router[_0xcae1('0x14')](_0xcae1('0xb'),auth[_0xcae1('0x8')](),controller[_0xcae1('0x15')]);router[_0xcae1('0x16')]('/:id',auth[_0xcae1('0x8')](),controller[_0xcae1('0x17')]);router['delete']('/:id/users',auth[_0xcae1('0x8')](),controller[_0xcae1('0x18')]);router['delete']('/:id/teams',auth[_0xcae1('0x8')](),controller['removeTeams']);module[_0xcae1('0x19')]=router; \ No newline at end of file +var _0x2392=['multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getAgents','/:id/teams','getTeams','post','/:id/users','addAgents','put','update','delete','destroy','exports'];(function(_0x746a99,_0x55ef7a){var _0x33444e=function(_0x4dda3c){while(--_0x4dda3c){_0x746a99['push'](_0x746a99['shift']());}};_0x33444e(++_0x55ef7a);}(_0x2392,0xd0));var _0x2239=function(_0xbf201d,_0x6bfda8){_0xbf201d=_0xbf201d-0x0;var _0x24430e=_0x2392[_0xbf201d];return _0x24430e;};'use strict';var multer=require(_0x2239('0x0'));var util=require(_0x2239('0x1'));var path=require('path');var timeout=require(_0x2239('0x2'));var express=require(_0x2239('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2239('0x4'));var interaction=require(_0x2239('0x5'));var config=require(_0x2239('0x6'));var controller=require(_0x2239('0x7'));router[_0x2239('0x8')]('/',auth[_0x2239('0x9')](),controller[_0x2239('0xa')]);router[_0x2239('0x8')](_0x2239('0xb'),auth[_0x2239('0x9')](),controller[_0x2239('0xc')]);router[_0x2239('0x8')](_0x2239('0xd'),auth['isAuthenticated'](),controller[_0x2239('0xe')]);router[_0x2239('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x2239('0xf')]);router[_0x2239('0x8')](_0x2239('0x10'),auth[_0x2239('0x9')](),controller[_0x2239('0x11')]);router[_0x2239('0x12')]('/',auth[_0x2239('0x9')](),controller['create']);router[_0x2239('0x12')](_0x2239('0x13'),auth['isAuthenticated'](),controller[_0x2239('0x14')]);router[_0x2239('0x12')](_0x2239('0x10'),auth[_0x2239('0x9')](),controller['addTeams']);router[_0x2239('0x15')]('/:id',auth[_0x2239('0x9')](),controller[_0x2239('0x16')]);router[_0x2239('0x17')](_0x2239('0xd'),auth['isAuthenticated'](),controller[_0x2239('0x18')]);router[_0x2239('0x17')]('/:id/users',auth[_0x2239('0x9')](),controller['removeAgents']);router[_0x2239('0x17')]('/:id/teams',auth[_0x2239('0x9')](),controller['removeTeams']);module[_0x2239('0x19')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 829d3d9..59ec887 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 _0x1e9f=['name','INTEGER','STRING','VIRTUAL','system-','getDataValue'];(function(_0x1a4e06,_0x442dcd){var _0x19c18f=function(_0x20984d){while(--_0x20984d){_0x1a4e06['push'](_0x1a4e06['shift']());}};_0x19c18f(++_0x442dcd);}(_0x1e9f,0x74));var _0xf1e9=function(_0x5c9d18,_0xaeef50){_0x5c9d18=_0x5c9d18-0x0;var _0x4e626d=_0x1e9f[_0x5c9d18];return _0x4e626d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf1e9('0x0')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xf1e9('0x1')],'get':function(_0x6e0981){return _0xf1e9('0x2')+this[_0xf1e9('0x3')](_0xf1e9('0x4'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xf1e9('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0xf1e9('0x5')]}}; \ No newline at end of file +var _0x67d0=['name','VIRTUAL','system-','getDataValue','INTEGER','STRING'];(function(_0x12c60c,_0x12cfde){var _0x2b2d52=function(_0x1f2d38){while(--_0x1f2d38){_0x12c60c['push'](_0x12c60c['shift']());}};_0x2b2d52(++_0x12cfde);}(_0x67d0,0xbf));var _0x067d=function(_0x7b963e,_0x1ad7a6){_0x7b963e=_0x7b963e-0x0;var _0x42b65f=_0x67d0[_0x7b963e];return _0x42b65f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x067d('0x0')],'allowNull':![],'unique':_0x067d('0x1')},'prefix':{'type':Sequelize[_0x067d('0x2')],'get':function(_0x10243e){return _0x067d('0x3')+this[_0x067d('0x4')](_0x067d('0x1'))+'-';}},'description':{'type':Sequelize[_0x067d('0x0')]},'callerIdAll':{'type':Sequelize[_0x067d('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0x067d('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 888e57d..d1e804e 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 _0x8f59=['../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','includeAll','find','describe','create','sequelize','transaction','body','VoiceExtensionId','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description','priority','appdata','VoicePrefixId','VoiceExtension','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','PREFIX-CALLERIDALL=','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','params','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','Team','getTeams','Agents','online','voicePause','interface','flatMap','addTeams','each','TeamVoicePrefix','upsert','findOrCreate','forEach','removeTeams','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','TeamId','includes','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x3987a4,_0x4e2fea){var _0x453e09=function(_0x1f8114){while(--_0x1f8114){_0x3987a4['push'](_0x3987a4['shift']());}};_0x453e09(++_0x4e2fea);}(_0x8f59,0x11d));var _0x98f5=function(_0x2ac13,_0x3f98a5){_0x2ac13=_0x2ac13-0x0;var _0x2a5c5f=_0x8f59[_0x2ac13];return _0x2a5c5f;};'use strict';var emlformat=require(_0x98f5('0x0'));var rimraf=require(_0x98f5('0x1'));var zipdir=require(_0x98f5('0x2'));var jsonpatch=require(_0x98f5('0x3'));var rp=require(_0x98f5('0x4'));var moment=require(_0x98f5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x98f5('0x6'));var util=require(_0x98f5('0x7'));var path=require(_0x98f5('0x8'));var sox=require(_0x98f5('0x9'));var csv=require('to-csv');var ejs=require(_0x98f5('0xa'));var fs=require('fs');var fs_extra=require(_0x98f5('0xb'));var _=require(_0x98f5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x98f5('0xd'));var deskjs=require(_0x98f5('0xe'));var toCsv=require(_0x98f5('0xf'));var querystring=require('querystring');var Papa=require(_0x98f5('0x10'));var Redis=require(_0x98f5('0x11'));var authService=require(_0x98f5('0x12'));var qs=require(_0x98f5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x98f5('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x98f5('0x15'));var config=require(_0x98f5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x98f5('0x17'))['db'];config[_0x98f5('0x18')]=_[_0x98f5('0x19')](config[_0x98f5('0x18')],{'host':_0x98f5('0x1a'),'port':0x18eb});var socket=require(_0x98f5('0x1b'))(new Redis(config['redis']));require(_0x98f5('0x1c'))[_0x98f5('0x1d')](socket);function respondWithStatusCode(_0x5b8bab,_0x9df84){_0x9df84=_0x9df84||0xcc;return function(_0x3d6b5c){if(_0x3d6b5c){return _0x5b8bab[_0x98f5('0x1e')](_0x9df84);}return _0x5b8bab['status'](_0x9df84)[_0x98f5('0x1f')]();};}function respondWithResult(_0xc7a49b,_0x113545){_0x113545=_0x113545||0xc8;return function(_0x5bb486){if(_0x5bb486){return _0xc7a49b[_0x98f5('0x20')](_0x113545)[_0x98f5('0x21')](_0x5bb486);}};}function respondWithFilteredResult(_0x574644,_0x1df52d){return function(_0x51a567){if(_0x51a567){var _0x10c57c=typeof _0x1df52d[_0x98f5('0x22')]===_0x98f5('0x23')&&typeof _0x1df52d[_0x98f5('0x24')]===_0x98f5('0x23');var _0xa4477c=_0x51a567['count'];var _0xf88f34=_0x10c57c?0x0:_0x1df52d['offset'];var _0xd1209d=_0x10c57c?_0x51a567[_0x98f5('0x25')]:_0x1df52d['offset']+_0x1df52d[_0x98f5('0x24')];var _0x2933d1;if(_0xd1209d>=_0xa4477c){_0xd1209d=_0xa4477c;_0x2933d1=0xc8;}else{_0x2933d1=0xce;}_0x574644[_0x98f5('0x20')](_0x2933d1);return _0x574644[_0x98f5('0x26')](_0x98f5('0x27'),_0xf88f34+'-'+_0xd1209d+'/'+_0xa4477c)[_0x98f5('0x21')](_0x51a567);}return null;};}function patchUpdates(_0x38b46d){return function(_0x5ac2b7){try{jsonpatch[_0x98f5('0x28')](_0x5ac2b7,_0x38b46d,!![]);}catch(_0x49ee4e){return BPromise[_0x98f5('0x29')](_0x49ee4e);}return _0x5ac2b7['save']();};}function saveUpdates(_0x44bfbb,_0x40c69b){return function(_0x106b24){if(_0x106b24){return _0x106b24[_0x98f5('0x2a')](_0x44bfbb)[_0x98f5('0x2b')](function(_0x18052d){return _0x18052d;});}return null;};}function removeEntity(_0x46dbd4,_0x58d506){return function(_0x27a533){if(_0x27a533){return _0x27a533[_0x98f5('0x2c')]()['then'](function(){var _0x1a1c55=_0x27a533[_0x98f5('0x2d')]({'plain':!![]});var _0x5b08c2=_0x98f5('0x2e');return db[_0x98f5('0x2f')][_0x98f5('0x2c')]({'where':{'type':_0x5b08c2,'resourceId':_0x1a1c55['id']}})[_0x98f5('0x2b')](function(){return _0x27a533;});})[_0x98f5('0x2b')](function(){_0x46dbd4['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x428c85,_0x71661e){return function(_0x18bb29){if(!_0x18bb29){_0x428c85[_0x98f5('0x1e')](0x194);}return _0x18bb29;};}function handleError(_0x15bf92,_0x1ae531){_0x1ae531=_0x1ae531||0x1f4;return function(_0x5e9d73){logger[_0x98f5('0x30')](_0x5e9d73[_0x98f5('0x31')]);if(_0x5e9d73[_0x98f5('0x32')]){delete _0x5e9d73[_0x98f5('0x32')];}_0x15bf92[_0x98f5('0x20')](_0x1ae531)[_0x98f5('0x33')](_0x5e9d73);};}exports['index']=function(_0x1e7027,_0x4d4b5c){var _0x229495={},_0x1e193c={},_0x492771={'count':0x0,'rows':[]};var _0x45ca95=_[_0x98f5('0x34')](db[_0x98f5('0x35')][_0x98f5('0x36')],function(_0x45e55c){return{'name':_0x45e55c[_0x98f5('0x37')],'type':_0x45e55c[_0x98f5('0x38')][_0x98f5('0x39')]};});_0x1e193c[_0x98f5('0x3a')]=_[_0x98f5('0x34')](_0x45ca95,_0x98f5('0x32'));_0x1e193c[_0x98f5('0x3b')]=_[_0x98f5('0x3c')](_0x1e7027[_0x98f5('0x3b')]);_0x1e193c[_0x98f5('0x3d')]=_[_0x98f5('0x3e')](_0x1e193c[_0x98f5('0x3a')],_0x1e193c[_0x98f5('0x3b')]);_0x229495[_0x98f5('0x3f')]=_[_0x98f5('0x3e')](_0x1e193c['model'],qs[_0x98f5('0x40')](_0x1e7027['query']['fields']));_0x229495[_0x98f5('0x3f')]=_0x229495[_0x98f5('0x3f')][_0x98f5('0x41')]?_0x229495[_0x98f5('0x3f')]:_0x1e193c['model'];if(!_0x1e7027[_0x98f5('0x3b')][_0x98f5('0x42')](_0x98f5('0x43'))){_0x229495['limit']=qs[_0x98f5('0x24')](_0x1e7027[_0x98f5('0x3b')]['limit']);_0x229495[_0x98f5('0x22')]=qs[_0x98f5('0x22')](_0x1e7027[_0x98f5('0x3b')]['offset']);}_0x229495[_0x98f5('0x44')]=qs[_0x98f5('0x45')](_0x1e7027[_0x98f5('0x3b')][_0x98f5('0x45')]);_0x229495[_0x98f5('0x46')]=qs['filters'](_['pick'](_0x1e7027[_0x98f5('0x3b')],_0x1e193c[_0x98f5('0x3d')]),_0x45ca95);if(_0x1e7027[_0x98f5('0x3b')][_0x98f5('0x47')]){_0x229495[_0x98f5('0x46')]=_[_0x98f5('0x48')](_0x229495['where'],{'$or':_['map'](_0x45ca95,function(_0x3f6394){if(_0x3f6394[_0x98f5('0x38')]!==_0x98f5('0x49')){var _0x2f9638={};_0x2f9638[_0x3f6394['name']]={'$like':'%'+_0x1e7027['query'][_0x98f5('0x47')]+'%'};return _0x2f9638;}})});}_0x229495=_[_0x98f5('0x48')]({},_0x229495,_0x1e7027[_0x98f5('0x4a')]);var _0x110aa7={'where':_0x229495['where']};return db['VoicePrefix'][_0x98f5('0x25')](_0x110aa7)[_0x98f5('0x2b')](function(_0x372c33){_0x492771['count']=_0x372c33;if(_0x1e7027[_0x98f5('0x3b')]['includeAll']){_0x229495[_0x98f5('0x4b')]=[{'all':!![]}];}return db['VoicePrefix'][_0x98f5('0x4c')](_0x229495);})[_0x98f5('0x2b')](function(_0x1b8d40){_0x492771['rows']=_0x1b8d40;return _0x492771;})[_0x98f5('0x2b')](respondWithFilteredResult(_0x4d4b5c,_0x229495))[_0x98f5('0x4d')](handleError(_0x4d4b5c,null));};exports['show']=function(_0x3b5dee,_0xd27e7c){var _0x5ed787={'raw':![],'where':{'id':_0x3b5dee['params']['id']}},_0x42ec3e={};_0x42ec3e[_0x98f5('0x3a')]=_[_0x98f5('0x3c')](db['VoicePrefix']['rawAttributes']);_0x42ec3e['query']=_['keys'](_0x3b5dee[_0x98f5('0x3b')]);_0x42ec3e['filters']=_[_0x98f5('0x3e')](_0x42ec3e[_0x98f5('0x3a')],_0x42ec3e[_0x98f5('0x3b')]);_0x5ed787[_0x98f5('0x3f')]=_[_0x98f5('0x3e')](_0x42ec3e[_0x98f5('0x3a')],qs['fields'](_0x3b5dee[_0x98f5('0x3b')][_0x98f5('0x40')]));_0x5ed787[_0x98f5('0x3f')]=_0x5ed787[_0x98f5('0x3f')][_0x98f5('0x41')]?_0x5ed787[_0x98f5('0x3f')]:_0x42ec3e['model'];if(_0x3b5dee[_0x98f5('0x3b')][_0x98f5('0x4e')]){_0x5ed787[_0x98f5('0x4b')]=[{'all':!![]}];}_0x5ed787=_[_0x98f5('0x48')]({},_0x5ed787,_0x3b5dee['options']);return db[_0x98f5('0x35')][_0x98f5('0x4f')](_0x5ed787)[_0x98f5('0x2b')](handleEntityNotFound(_0xd27e7c,null))[_0x98f5('0x2b')](respondWithResult(_0xd27e7c,null))[_0x98f5('0x4d')](handleError(_0xd27e7c,null));};exports['destroy']=function(_0x8d7ebd,_0x254005){return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x8d7ebd['params']['id']}})[_0x98f5('0x2b')](handleEntityNotFound(_0x254005,null))['then'](removeEntity(_0x254005,null))[_0x98f5('0x4d')](handleError(_0x254005,null));};exports[_0x98f5('0x50')]=function(_0x3114a4,_0x5b495e){return db[_0x98f5('0x35')][_0x98f5('0x50')]()[_0x98f5('0x2b')](respondWithResult(_0x5b495e,null))[_0x98f5('0x4d')](handleError(_0x5b495e,null));};exports[_0x98f5('0x51')]=function(_0xf39073,_0x37e620){var _0x1891ac;return db[_0x98f5('0x52')][_0x98f5('0x53')](function(_0x50343c){return db[_0x98f5('0x35')][_0x98f5('0x51')](_0xf39073[_0x98f5('0x54')],{'transaction':_0x50343c})[_0x98f5('0x2b')](function(_0x1289a7){_0x1891ac=_0x1289a7[_0x98f5('0x2d')]({'plain':!![]});return db['VoiceExtension'][_0x98f5('0x4f')]({'where':{'id':_0x1891ac[_0x98f5('0x55')]},'raw':!![]})[_0x98f5('0x2b')](function(_0x4663f2){return createVoicePrefixExtensions(_0x1891ac,_0x4663f2,_0x50343c);});});})[_0x98f5('0x2b')](function(){var _0x15c514=_0xf39073['user']['get']({'plain':!![]});if(!_0x15c514)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x15c514[_0x98f5('0x56')]===_0x98f5('0x57')){var _0x372c49=_0x1891ac;return db[_0x98f5('0x58')]['find']({'where':{'name':_0x98f5('0x2e'),'userProfileId':_0x15c514['userProfileId']},'raw':!![]})[_0x98f5('0x2b')](function(_0x583be6){if(_0x583be6&&_0x583be6['autoAssociation']===0x0){return db[_0x98f5('0x2f')][_0x98f5('0x51')]({'name':_0x372c49[_0x98f5('0x32')],'resourceId':_0x372c49['id'],'type':_0x583be6['name'],'sectionId':_0x583be6['id']},{})['then'](function(){return _0x1891ac;});}else{return _0x1891ac;}})[_0x98f5('0x4d')](function(_0x139ca3){logger['error'](_0x98f5('0x59'),_0x139ca3);throw _0x139ca3;});}return _0x1891ac;})[_0x98f5('0x2b')](respondWithResult(_0x37e620,null))['catch'](handleError(_0x37e620,null));};function Extension(_0x400f32,_0x974509,_0x8e6975,_0x53249f){this[_0x98f5('0x5a')]=_0x98f5('0x5b');this[_0x98f5('0x5c')]=_0x400f32;this[_0x98f5('0x5d')]=_0x8e6975;this[_0x98f5('0x38')]=_0x98f5('0x5e');this[_0x98f5('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x98f5('0x60')]=_0x974509;this[_0x98f5('0x61')]=_0x53249f;}function createVoicePrefixExtensions(_0x3f2da8,_0x58041d,_0x577552){return new BPromise(function(_0x43b8de,_0x43edfc){var _0x5ae48c=new Extension(formatPrefixName(_0x3f2da8['prefix']),0x1,'NoOp','Voice\x20Prefix');_0x5ae48c[_0x98f5('0x62')]=_0x3f2da8['id'];return db['VoiceExtension'][_0x98f5('0x51')](_0x5ae48c,{'transaction':_0x577552})[_0x98f5('0x2b')](function(_0x44149f){var _0x368567=_0x44149f[_0x98f5('0x2d')]({'plain':!![]});var _0x26cc86=_[_0x98f5('0x34')](addVoicePrefixExtensions(_0x3f2da8,_0x58041d),function(_0x9758e8){_0x9758e8['VoiceExtensionId']=_0x368567['id'];_0x9758e8['VoicePrefixId']=_0x3f2da8['id'];return _0x9758e8;});return db[_0x98f5('0x63')]['bulkCreate'](_0x26cc86,{'transaction':_0x577552})[_0x98f5('0x2b')](function(_0x4ae63d){if(!_0x4ae63d){return _0x43edfc(_0x98f5('0x64'));}else{return _0x43b8de(_0x4ae63d);}})['catch'](function(_0x1cd03f){return _0x43edfc(_0x1cd03f);});});;});};function addVoicePrefixExtensions(_0x56b308,_0x4a1de1){var _0x595aee=[];var _0x2d9cd8=formatPrefixName(_0x56b308['prefix']);_0x595aee[_0x98f5('0x65')](new Extension(_0x2d9cd8,0x2,_0x98f5('0x66'),_0x98f5('0x67')+_0x56b308['name']));if(_0x56b308['callerIdAll']){_0x595aee['push'](new Extension(_0x2d9cd8,0x3,_0x98f5('0x66'),_0x98f5('0x68')+_0x56b308['callerIdAll']));}else{_0x595aee['push'](new Extension(_0x2d9cd8,0x3,_0x98f5('0x69'),_0x98f5('0x6a')));}_0x595aee[_0x98f5('0x65')](new Extension(_0x2d9cd8,0x4,_0x98f5('0x6b'),_0x4a1de1[_0x98f5('0x5a')]+','+_0x98f5('0x6c')+(0x8+_0x56b308[_0x98f5('0x32')][_0x98f5('0x41')])+'}'+','+0x1));return _0x595aee;}function formatPrefixName(_0x139d2c){var _0x4fc5d6='_';for(var _0x35e965=0x0;_0x35e965<_0x139d2c[_0x98f5('0x41')];_0x35e965++){if(_0x139d2c[_0x98f5('0x6d')](_0x35e965)=='-'){_0x4fc5d6+=_0x139d2c[_0x98f5('0x6d')](_0x35e965);}else{_0x4fc5d6+='['+_0x139d2c['charAt'](_0x35e965)+']';}}_0x4fc5d6+='.';return _0x4fc5d6;}exports[_0x98f5('0x2a')]=function(_0x48b175,_0x42c7a6,_0x5760b3){var _0x1d54d8=_0x48b175[_0x98f5('0x54')];_0x1d54d8['prefix']=_0x98f5('0x6e')+_0x1d54d8[_0x98f5('0x32')]+'-';return db[_0x98f5('0x52')]['transaction'](function(_0x45413e){return db[_0x98f5('0x35')][_0x98f5('0x2a')](_0x1d54d8,{'where':{'id':_0x1d54d8['id']},'transaction':_0x45413e})[_0x98f5('0x2b')](function(){return db[_0x98f5('0x63')][_0x98f5('0x2c')]({'where':{'VoicePrefixId':_0x1d54d8['id']},'transaction':_0x45413e})[_0x98f5('0x2b')](function(){return db[_0x98f5('0x63')][_0x98f5('0x4f')]({'where':{'id':_0x1d54d8['VoiceExtensionId']},'raw':!![]})[_0x98f5('0x2b')](function(_0x486ff6){return createVoicePrefixExtensions(_0x1d54d8,_0x486ff6,_0x45413e);});});});})[_0x98f5('0x2b')](function(){return db[_0x98f5('0x35')][_0x98f5('0x6f')](_0x1d54d8['id']);})[_0x98f5('0x2b')](respondWithResult(_0x42c7a6,null))['catch'](handleError(_0x42c7a6,null));};exports[_0x98f5('0x70')]=function(_0x23bf5f,_0x57b9c1,_0x540c00){return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x23bf5f[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](handleEntityNotFound(_0x57b9c1,null))[_0x98f5('0x2b')](function(_0x5427a3){if(_0x5427a3){return _0x5427a3['addAgents'](_0x23bf5f[_0x98f5('0x54')][_0x98f5('0x72')],_['omit'](_0x23bf5f[_0x98f5('0x54')],[_0x98f5('0x72'),'id'])||{})[_0x98f5('0x73')](function(_0x28aa43){for(var _0x258ee7=0x0;_0x258ee7<_0x23bf5f[_0x98f5('0x54')][_0x98f5('0x72')][_0x98f5('0x41')];_0x258ee7+=0x1){socket[_0x98f5('0x74')](_0x98f5('0x75'),{'UserId':Number(_0x23bf5f[_0x98f5('0x54')]['ids'][_0x258ee7]),'VoicePrefixId':Number(_0x23bf5f['params']['id'])});}return _0x28aa43;});}})[_0x98f5('0x2b')](respondWithResult(_0x57b9c1,null))[_0x98f5('0x4d')](handleError(_0x57b9c1,null));};exports[_0x98f5('0x76')]=function(_0x54c7f9,_0x28d910,_0x3303d4){return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x54c7f9[_0x98f5('0x71')]['id']}})['then'](handleEntityNotFound(_0x28d910,null))['then'](function(_0x4dfef7){if(_0x4dfef7){return _0x4dfef7['removeAgents'](_0x54c7f9[_0x98f5('0x3b')][_0x98f5('0x72')])['then'](function(){if(_[_0x98f5('0x77')](_0x54c7f9[_0x98f5('0x3b')]['ids'])){for(var _0x2afe1d=0x0;_0x2afe1d<_0x54c7f9['query']['ids'][_0x98f5('0x41')];_0x2afe1d+=0x1){socket[_0x98f5('0x74')](_0x98f5('0x78'),{'UserId':Number(_0x54c7f9[_0x98f5('0x3b')]['ids'][_0x2afe1d]),'VoicePrefixId':Number(_0x54c7f9[_0x98f5('0x71')]['id'])});}}else{socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x54c7f9['query'][_0x98f5('0x72')]),'VoicePrefixId':Number(_0x54c7f9[_0x98f5('0x71')]['id'])});}});}})[_0x98f5('0x2b')](respondWithStatusCode(_0x28d910,null))[_0x98f5('0x4d')](handleError(_0x28d910,null));};exports[_0x98f5('0x79')]=function(_0x3ab0dc,_0x36048c,_0x11e72a){var _0x1a3a76={};var _0x2aa9a4={};var _0x485a15;var _0x40b6fa;return db[_0x98f5('0x35')][_0x98f5('0x7a')]({'where':{'id':_0x3ab0dc[_0x98f5('0x71')]['id']}})['then'](handleEntityNotFound(_0x36048c,null))[_0x98f5('0x2b')](function(_0x1aba52){if(_0x1aba52){_0x485a15=_0x1aba52;_0x2aa9a4['model']=_[_0x98f5('0x3c')](db[_0x98f5('0x7b')][_0x98f5('0x36')]);_0x2aa9a4['query']=_[_0x98f5('0x3c')](_0x3ab0dc[_0x98f5('0x3b')]);_0x2aa9a4[_0x98f5('0x3d')]=_[_0x98f5('0x3e')](_0x2aa9a4[_0x98f5('0x3a')],_0x2aa9a4[_0x98f5('0x3b')]);_0x1a3a76['attributes']=_['intersection'](_0x2aa9a4[_0x98f5('0x3a')],qs[_0x98f5('0x40')](_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x40')]));_0x1a3a76['attributes']=_0x1a3a76[_0x98f5('0x3f')][_0x98f5('0x41')]?_0x1a3a76['attributes']:_0x2aa9a4['model'];_0x1a3a76[_0x98f5('0x44')]=qs['sort'](_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x45')]);_0x1a3a76[_0x98f5('0x46')]=qs['filters'](_[_0x98f5('0x7c')](_0x3ab0dc[_0x98f5('0x3b')],_0x2aa9a4['filters']));if(_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x47')]){_0x1a3a76[_0x98f5('0x46')]=_[_0x98f5('0x48')](_0x1a3a76['where'],{'$or':_['map'](_0x1a3a76[_0x98f5('0x3f')],function(_0x1e32f1){var _0x514dea={};_0x514dea[_0x1e32f1]={'$like':'%'+_0x3ab0dc[_0x98f5('0x3b')][_0x98f5('0x47')]+'%'};return _0x514dea;})});}_0x1a3a76=_[_0x98f5('0x48')]({},_0x1a3a76,_0x3ab0dc['options']);return _0x485a15[_0x98f5('0x79')](_0x1a3a76);}})[_0x98f5('0x2b')](function(_0x2de7e7){if(_0x2de7e7){_0x40b6fa=_0x2de7e7[_0x98f5('0x41')];if(!_0x3ab0dc['query'][_0x98f5('0x42')]('nolimit')){_0x1a3a76[_0x98f5('0x24')]=qs[_0x98f5('0x24')](_0x3ab0dc['query'][_0x98f5('0x24')]);_0x1a3a76[_0x98f5('0x22')]=qs[_0x98f5('0x22')](_0x3ab0dc[_0x98f5('0x3b')]['offset']);}return _0x485a15[_0x98f5('0x79')](_0x1a3a76);}})['then'](function(_0x6c3951){if(_0x6c3951){return _0x6c3951?{'count':_0x40b6fa,'rows':_0x6c3951}:null;}})['then'](respondWithResult(_0x36048c,null))[_0x98f5('0x4d')](handleError(_0x36048c,null));};exports['getTeams']=function(_0x1ba9a2,_0x193cbb,_0x3a411f){var _0x1a04f6={};var _0x40eb2f={};var _0x421e3c;var _0x1e28b7;return db[_0x98f5('0x35')][_0x98f5('0x7a')]({'where':{'id':_0x1ba9a2[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](handleEntityNotFound(_0x193cbb,null))[_0x98f5('0x2b')](function(_0x5bec4f){if(_0x5bec4f){_0x421e3c=_0x5bec4f;_0x40eb2f['model']=_[_0x98f5('0x3c')](db[_0x98f5('0x7d')]['rawAttributes']);_0x40eb2f[_0x98f5('0x3b')]=_[_0x98f5('0x3c')](_0x1ba9a2[_0x98f5('0x3b')]);_0x40eb2f[_0x98f5('0x3d')]=_[_0x98f5('0x3e')](_0x40eb2f[_0x98f5('0x3a')],_0x40eb2f['query']);_0x1a04f6[_0x98f5('0x3f')]=_[_0x98f5('0x3e')](_0x40eb2f[_0x98f5('0x3a')],qs[_0x98f5('0x40')](_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x40')]));_0x1a04f6['attributes']=_0x1a04f6[_0x98f5('0x3f')]['length']?_0x1a04f6[_0x98f5('0x3f')]:_0x40eb2f[_0x98f5('0x3a')];_0x1a04f6[_0x98f5('0x44')]=qs[_0x98f5('0x45')](_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x45')]);_0x1a04f6[_0x98f5('0x46')]=qs[_0x98f5('0x3d')](_['pick'](_0x1ba9a2['query'],_0x40eb2f[_0x98f5('0x3d')]));if(_0x1ba9a2['query'][_0x98f5('0x47')]){_0x1a04f6[_0x98f5('0x46')]=_[_0x98f5('0x48')](_0x1a04f6['where'],{'$or':_['map'](_0x1a04f6['attributes'],function(_0x20cbaf){var _0x45779d={};_0x45779d[_0x20cbaf]={'$like':'%'+_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x47')]+'%'};return _0x45779d;})});}_0x1a04f6=_[_0x98f5('0x48')]({},_0x1a04f6,_0x1ba9a2['options']);return _0x421e3c[_0x98f5('0x7e')](_0x1a04f6);}})[_0x98f5('0x2b')](function(_0x163f7e){if(_0x163f7e){_0x1e28b7=_0x163f7e[_0x98f5('0x41')];if(!_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x42')](_0x98f5('0x43'))){_0x1a04f6[_0x98f5('0x24')]=qs[_0x98f5('0x24')](_0x1ba9a2[_0x98f5('0x3b')]['limit']);_0x1a04f6[_0x98f5('0x22')]=qs[_0x98f5('0x22')](_0x1ba9a2[_0x98f5('0x3b')][_0x98f5('0x22')]);}return _0x421e3c[_0x98f5('0x7e')](_0x1a04f6);}})['then'](function(_0x3af4fc){if(_0x3af4fc){return _0x3af4fc?{'count':_0x1e28b7,'rows':_0x3af4fc}:null;}})[_0x98f5('0x2b')](respondWithResult(_0x193cbb,null))[_0x98f5('0x4d')](handleError(_0x193cbb,null));};exports['addTeams']=function(_0x87ae6,_0x14a01b,_0x31282d){var _0x2e85ad=_0x87ae6[_0x98f5('0x54')][_0x98f5('0x72')];var _0x2a983e;return db[_0x98f5('0x7d')][_0x98f5('0x4c')]({'where':{'id':_0x2e85ad},'attributes':['id'],'include':[{'model':db['User'],'as':_0x98f5('0x7f'),'attributes':['id','name',_0x98f5('0x80'),_0x98f5('0x81'),_0x98f5('0x82')],'raw':!![]}]})[_0x98f5('0x2b')](function(_0x1f90ce){if(_0x1f90ce){_0x2a983e=_0x1f90ce;var _0x2bf55c=_[_0x98f5('0x83')](_0x1f90ce,function(_0x54eb1d){var _0x1aa66f=_0x54eb1d[_0x98f5('0x2d')]({'plain':!![]});return _0x1aa66f[_0x98f5('0x7f')];});return db['VoicePrefix'][_0x98f5('0x4f')]({'where':{'id':_0x87ae6[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](function(_0x37a1a7){return db[_0x98f5('0x52')][_0x98f5('0x53')](function(_0x55de57){return _0x37a1a7[_0x98f5('0x84')](_0x2e85ad,{'transaction':_0x55de57})[_0x98f5('0x2b')](function(){return BPromise[_0x98f5('0x85')](_0x2a983e,function(_0x462498){return db[_0x98f5('0x86')][_0x98f5('0x87')]({'TeamId':_0x462498['id'],'VoicePrefixId':_0x87ae6[_0x98f5('0x71')]['id']},{'transaction':_0x55de57});});})[_0x98f5('0x2b')](function(){return BPromise[_0x98f5('0x85')](_0x2bf55c,function(_0x2adc96){return db['UserVoicePrefix'][_0x98f5('0x88')]({'where':{'UserId':_0x2adc96['id'],'VoicePrefixId':_0x87ae6[_0x98f5('0x71')]['id']},'transaction':_0x55de57});});})[_0x98f5('0x2b')](function(){_0x2bf55c[_0x98f5('0x89')](function(_0x4c06c3){socket[_0x98f5('0x74')](_0x98f5('0x75'),{'UserId':_0x4c06c3['id'],'VoicePrefixId':_0x37a1a7['id']});});});});});}})[_0x98f5('0x2b')](respondWithStatusCode(_0x14a01b,null))['catch'](handleError(_0x14a01b,null));};exports[_0x98f5('0x8a')]=function(_0x29f1af,_0x165c5c,_0x401ec7){return db[_0x98f5('0x7d')]['findAll']({'where':{'id':_0x29f1af['query']['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x98f5('0x7f'),'attributes':['id'],'raw':!![]}]})[_0x98f5('0x2b')](handleEntityNotFound(_0x165c5c,null))['then'](function(_0x55edfd){var _0x339388=_[_0x98f5('0x34')](_0x55edfd,'id');var _0x1f1e6c=[];var _0x22009b=[];var _0x269fe1=squel['select']();_0x269fe1['field'](_0x98f5('0x8b'))[_0x98f5('0x8c')](_0x98f5('0x8d'),'tq')['join'](_0x98f5('0x8e'),'ut',_0x98f5('0x8f'))['where']('VoicePrefixId\x20=\x20?',_0x29f1af[_0x98f5('0x71')]['id']);for(var _0x4a8f92=0x0;_0x4a8f92<_0x55edfd['length'];_0x4a8f92+=0x1){let _0x20b788=_0x55edfd[_0x4a8f92];for(var _0x1743a8=0x0;_0x1743a8<_0x20b788[_0x98f5('0x7f')][_0x98f5('0x41')];_0x1743a8+=0x1){let _0x18bb66=_0x20b788[_0x98f5('0x7f')][_0x1743a8];var _0x1f1b89=_0x269fe1['clone']();_0x1f1b89[_0x98f5('0x46')](_0x98f5('0x90'),_0x18bb66['id']);_0x22009b[_0x98f5('0x65')](db[_0x98f5('0x52')]['query'](_0x1f1b89[_0x98f5('0x91')](),{'type':db[_0x98f5('0x52')][_0x98f5('0x92')][_0x98f5('0x93')]})[_0x98f5('0x2b')](function(_0x10d7d0){if(_0x10d7d0[_0x98f5('0x41')]===0x1){return _0x18bb66['id'];}else{var _0x4cc03e=_['every'](_[_0x98f5('0x34')](_0x10d7d0,_0x98f5('0x94')),function(_0x1068ff){return _[_0x98f5('0x95')](_0x339388,_0x1068ff);});if(_0x4cc03e){return _0x18bb66['id'];}}}));}}return BPromise['all'](_0x22009b)['then'](function(_0x2ddef8){_0x1f1e6c=_(_0x1f1e6c)['union'](_0x2ddef8)[_0x98f5('0x96')]()[_0x98f5('0x97')]();return db[_0x98f5('0x35')][_0x98f5('0x4f')]({'where':{'id':_0x29f1af[_0x98f5('0x71')]['id']}})[_0x98f5('0x2b')](function(_0x1d1949){return db['sequelize'][_0x98f5('0x53')](function(_0x2391f1){return _0x1d1949['removeTeams'](_0x29f1af[_0x98f5('0x3b')][_0x98f5('0x72')],{'transaction':_0x2391f1})[_0x98f5('0x2b')](function(){if(!_['isEmpty'](_0x1f1e6c)){return _0x1d1949['removeAgents'](_0x1f1e6c,{'transaction':_0x2391f1});}})[_0x98f5('0x2b')](function(){_0x1f1e6c[_0x98f5('0x89')](function(_0x4de795){socket['emit'](_0x98f5('0x78'),{'UserId':_0x4de795,'VoicePrefixId':_0x1d1949['id']});});});});});});})[_0x98f5('0x2b')](respondWithStatusCode(_0x165c5c,null))[_0x98f5('0x4d')](handleError(_0x165c5c,null));}; \ No newline at end of file +var _0x1c7c=['isArray','userVoicePrefix:remove','getAgents','findOne','keys','User','order','getTeams','Team','addTeams','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','every','TeamId','includes','all','union','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','map','rawAttributes','fieldName','type','key','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoicePrefix','includeAll','findAll','rows','catch','show','include','find','describe','sequelize','transaction','create','body','VoiceExtension','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','VoicePrefixes','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','app','system','description','Voice\x20Prefix\x20Extension','priority','prefix','NoOp','VoicePrefixId','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','addAgents','params','omit','ids','emit','userVoicePrefix:save','removeAgents'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1c7c,0x164));var _0xc1c7=function(_0x106c66,_0x418ee1){_0x106c66=_0x106c66-0x0;var _0x3240f1=_0x1c7c[_0x106c66];return _0x3240f1;};'use strict';var emlformat=require(_0xc1c7('0x0'));var rimraf=require(_0xc1c7('0x1'));var zipdir=require(_0xc1c7('0x2'));var jsonpatch=require(_0xc1c7('0x3'));var rp=require('request-promise');var moment=require(_0xc1c7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc1c7('0x5'));var util=require(_0xc1c7('0x6'));var path=require(_0xc1c7('0x7'));var sox=require(_0xc1c7('0x8'));var csv=require(_0xc1c7('0x9'));var ejs=require(_0xc1c7('0xa'));var fs=require('fs');var fs_extra=require(_0xc1c7('0xb'));var _=require(_0xc1c7('0xc'));var squel=require(_0xc1c7('0xd'));var crypto=require(_0xc1c7('0xe'));var jsforce=require(_0xc1c7('0xf'));var deskjs=require(_0xc1c7('0x10'));var toCsv=require(_0xc1c7('0x9'));var querystring=require(_0xc1c7('0x11'));var Papa=require(_0xc1c7('0x12'));var Redis=require(_0xc1c7('0x13'));var authService=require(_0xc1c7('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xc1c7('0x15'));var hardwareService=require(_0xc1c7('0x16'));var logger=require('../../config/logger')(_0xc1c7('0x17'));var utils=require(_0xc1c7('0x18'));var config=require(_0xc1c7('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1c7('0x1a'))['db'];config[_0xc1c7('0x1b')]=_[_0xc1c7('0x1c')](config[_0xc1c7('0x1b')],{'host':_0xc1c7('0x1d'),'port':0x18eb});var socket=require(_0xc1c7('0x1e'))(new Redis(config[_0xc1c7('0x1b')]));require(_0xc1c7('0x1f'))[_0xc1c7('0x20')](socket);function respondWithStatusCode(_0x1b6905,_0x99b874){_0x99b874=_0x99b874||0xcc;return function(_0x34d392){if(_0x34d392){return _0x1b6905['sendStatus'](_0x99b874);}return _0x1b6905[_0xc1c7('0x21')](_0x99b874)[_0xc1c7('0x22')]();};}function respondWithResult(_0x21911c,_0x555b59){_0x555b59=_0x555b59||0xc8;return function(_0x94678a){if(_0x94678a){return _0x21911c[_0xc1c7('0x21')](_0x555b59)[_0xc1c7('0x23')](_0x94678a);}};}function respondWithFilteredResult(_0x39ac54,_0x20439e){return function(_0xb42702){if(_0xb42702){var _0x21758a=typeof _0x20439e[_0xc1c7('0x24')]==='undefined'&&typeof _0x20439e[_0xc1c7('0x25')]===_0xc1c7('0x26');var _0x3ec66a=_0xb42702[_0xc1c7('0x27')];var _0x4b706e=_0x21758a?0x0:_0x20439e[_0xc1c7('0x24')];var _0x4d6171=_0x21758a?_0xb42702[_0xc1c7('0x27')]:_0x20439e[_0xc1c7('0x24')]+_0x20439e['limit'];var _0x5846f0;if(_0x4d6171>=_0x3ec66a){_0x4d6171=_0x3ec66a;_0x5846f0=0xc8;}else{_0x5846f0=0xce;}_0x39ac54[_0xc1c7('0x21')](_0x5846f0);return _0x39ac54[_0xc1c7('0x28')](_0xc1c7('0x29'),_0x4b706e+'-'+_0x4d6171+'/'+_0x3ec66a)['json'](_0xb42702);}return null;};}function patchUpdates(_0x813853){return function(_0x341b41){try{jsonpatch[_0xc1c7('0x2a')](_0x341b41,_0x813853,!![]);}catch(_0x31a0e0){return BPromise[_0xc1c7('0x2b')](_0x31a0e0);}return _0x341b41[_0xc1c7('0x2c')]();};}function saveUpdates(_0x3180fd,_0x120168){return function(_0x22b654){if(_0x22b654){return _0x22b654[_0xc1c7('0x2d')](_0x3180fd)[_0xc1c7('0x2e')](function(_0x363fbc){return _0x363fbc;});}return null;};}function removeEntity(_0x33aac7,_0x260a3f){return function(_0xf1c405){if(_0xf1c405){return _0xf1c405[_0xc1c7('0x2f')]()['then'](function(){var _0xf0ab9c=_0xf1c405[_0xc1c7('0x30')]({'plain':!![]});var _0x4e1721='VoicePrefixes';return db[_0xc1c7('0x31')]['destroy']({'where':{'type':_0x4e1721,'resourceId':_0xf0ab9c['id']}})['then'](function(){return _0xf1c405;});})[_0xc1c7('0x2e')](function(){_0x33aac7[_0xc1c7('0x21')](0xcc)[_0xc1c7('0x22')]();});}};}function handleEntityNotFound(_0x243450,_0x461360){return function(_0x4adb81){if(!_0x4adb81){_0x243450['sendStatus'](0x194);}return _0x4adb81;};}function handleError(_0x1b6f97,_0x4275f9){_0x4275f9=_0x4275f9||0x1f4;return function(_0x9a0ab3){logger[_0xc1c7('0x32')](_0x9a0ab3[_0xc1c7('0x33')]);if(_0x9a0ab3['name']){delete _0x9a0ab3['name'];}_0x1b6f97[_0xc1c7('0x21')](_0x4275f9)[_0xc1c7('0x34')](_0x9a0ab3);};}exports['index']=function(_0x41b154,_0x3cf425){var _0x39b68c={},_0x1f9708={},_0x74b523={'count':0x0,'rows':[]};var _0x2d69d3=_[_0xc1c7('0x35')](db['VoicePrefix'][_0xc1c7('0x36')],function(_0xeac123){return{'name':_0xeac123[_0xc1c7('0x37')],'type':_0xeac123[_0xc1c7('0x38')][_0xc1c7('0x39')]};});_0x1f9708[_0xc1c7('0x3a')]=_[_0xc1c7('0x35')](_0x2d69d3,_0xc1c7('0x3b'));_0x1f9708[_0xc1c7('0x3c')]=_['keys'](_0x41b154['query']);_0x1f9708[_0xc1c7('0x3d')]=_[_0xc1c7('0x3e')](_0x1f9708[_0xc1c7('0x3a')],_0x1f9708[_0xc1c7('0x3c')]);_0x39b68c[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x1f9708[_0xc1c7('0x3a')],qs[_0xc1c7('0x40')](_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x40')]));_0x39b68c[_0xc1c7('0x3f')]=_0x39b68c[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x39b68c[_0xc1c7('0x3f')]:_0x1f9708[_0xc1c7('0x3a')];if(!_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x39b68c[_0xc1c7('0x25')]=qs[_0xc1c7('0x25')](_0x41b154[_0xc1c7('0x3c')]['limit']);_0x39b68c['offset']=qs['offset'](_0x41b154[_0xc1c7('0x3c')]['offset']);}_0x39b68c['order']=qs[_0xc1c7('0x44')](_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x44')]);_0x39b68c[_0xc1c7('0x45')]=qs['filters'](_[_0xc1c7('0x46')](_0x41b154[_0xc1c7('0x3c')],_0x1f9708[_0xc1c7('0x3d')]),_0x2d69d3);if(_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x47')]){_0x39b68c[_0xc1c7('0x45')]=_[_0xc1c7('0x48')](_0x39b68c[_0xc1c7('0x45')],{'$or':_[_0xc1c7('0x35')](_0x2d69d3,function(_0x1810c7){if(_0x1810c7[_0xc1c7('0x38')]!==_0xc1c7('0x49')){var _0x23d0b2={};_0x23d0b2[_0x1810c7['name']]={'$like':'%'+_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x47')]+'%'};return _0x23d0b2;}})});}_0x39b68c=_['merge']({},_0x39b68c,_0x41b154[_0xc1c7('0x4a')]);var _0x23b10b={'where':_0x39b68c[_0xc1c7('0x45')]};return db[_0xc1c7('0x4b')][_0xc1c7('0x27')](_0x23b10b)[_0xc1c7('0x2e')](function(_0xd5e06a){_0x74b523[_0xc1c7('0x27')]=_0xd5e06a;if(_0x41b154[_0xc1c7('0x3c')][_0xc1c7('0x4c')]){_0x39b68c['include']=[{'all':!![]}];}return db[_0xc1c7('0x4b')][_0xc1c7('0x4d')](_0x39b68c);})['then'](function(_0x4c6834){_0x74b523[_0xc1c7('0x4e')]=_0x4c6834;return _0x74b523;})[_0xc1c7('0x2e')](respondWithFilteredResult(_0x3cf425,_0x39b68c))[_0xc1c7('0x4f')](handleError(_0x3cf425,null));};exports[_0xc1c7('0x50')]=function(_0x429221,_0x51a33f){var _0x1eca39={'raw':![],'where':{'id':_0x429221['params']['id']}},_0x805dac={};_0x805dac['model']=_['keys'](db[_0xc1c7('0x4b')][_0xc1c7('0x36')]);_0x805dac[_0xc1c7('0x3c')]=_['keys'](_0x429221[_0xc1c7('0x3c')]);_0x805dac[_0xc1c7('0x3d')]=_['intersection'](_0x805dac[_0xc1c7('0x3a')],_0x805dac[_0xc1c7('0x3c')]);_0x1eca39[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x805dac[_0xc1c7('0x3a')],qs[_0xc1c7('0x40')](_0x429221[_0xc1c7('0x3c')][_0xc1c7('0x40')]));_0x1eca39[_0xc1c7('0x3f')]=_0x1eca39[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x1eca39[_0xc1c7('0x3f')]:_0x805dac[_0xc1c7('0x3a')];if(_0x429221[_0xc1c7('0x3c')][_0xc1c7('0x4c')]){_0x1eca39[_0xc1c7('0x51')]=[{'all':!![]}];}_0x1eca39=_[_0xc1c7('0x48')]({},_0x1eca39,_0x429221[_0xc1c7('0x4a')]);return db['VoicePrefix'][_0xc1c7('0x52')](_0x1eca39)['then'](handleEntityNotFound(_0x51a33f,null))[_0xc1c7('0x2e')](respondWithResult(_0x51a33f,null))[_0xc1c7('0x4f')](handleError(_0x51a33f,null));};exports[_0xc1c7('0x2f')]=function(_0x524088,_0x473e8d){return db[_0xc1c7('0x4b')]['find']({'where':{'id':_0x524088['params']['id']}})['then'](handleEntityNotFound(_0x473e8d,null))[_0xc1c7('0x2e')](removeEntity(_0x473e8d,null))[_0xc1c7('0x4f')](handleError(_0x473e8d,null));};exports['describe']=function(_0x49542,_0x12a1d2){return db[_0xc1c7('0x4b')][_0xc1c7('0x53')]()[_0xc1c7('0x2e')](respondWithResult(_0x12a1d2,null))[_0xc1c7('0x4f')](handleError(_0x12a1d2,null));};exports['create']=function(_0x259e55,_0x568377){var _0x307b5e;return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0x557cb6){return db[_0xc1c7('0x4b')][_0xc1c7('0x56')](_0x259e55[_0xc1c7('0x57')],{'transaction':_0x557cb6})[_0xc1c7('0x2e')](function(_0x1679c5){_0x307b5e=_0x1679c5[_0xc1c7('0x30')]({'plain':!![]});return db[_0xc1c7('0x58')][_0xc1c7('0x52')]({'where':{'id':_0x307b5e['VoiceExtensionId']},'raw':!![]})[_0xc1c7('0x2e')](function(_0x2a8664){return createVoicePrefixExtensions(_0x307b5e,_0x2a8664,_0x557cb6);});});})[_0xc1c7('0x2e')](function(){var _0x575fc5=_0x259e55['user'][_0xc1c7('0x30')]({'plain':!![]});if(!_0x575fc5)throw new Error(_0xc1c7('0x59'));if(_0x575fc5[_0xc1c7('0x5a')]==='user'){var _0x1c636c=_0x307b5e;return db['UserProfileSection'][_0xc1c7('0x52')]({'where':{'name':_0xc1c7('0x5b'),'userProfileId':_0x575fc5[_0xc1c7('0x5c')]},'raw':!![]})[_0xc1c7('0x2e')](function(_0x345a46){if(_0x345a46&&_0x345a46[_0xc1c7('0x5d')]===0x0){return db[_0xc1c7('0x31')]['create']({'name':_0x1c636c[_0xc1c7('0x3b')],'resourceId':_0x1c636c['id'],'type':_0x345a46[_0xc1c7('0x3b')],'sectionId':_0x345a46['id']},{})[_0xc1c7('0x2e')](function(){return _0x307b5e;});}else{return _0x307b5e;}})['catch'](function(_0x24fa71){logger['error'](_0xc1c7('0x5e'),_0x24fa71);throw _0x24fa71;});}return _0x307b5e;})['then'](respondWithResult(_0x568377,null))[_0xc1c7('0x4f')](handleError(_0x568377,null));};function Extension(_0x212d53,_0x314232,_0x3a94fb,_0x156d51){this['context']='from-sip';this['exten']=_0x212d53;this[_0xc1c7('0x5f')]=_0x3a94fb;this[_0xc1c7('0x38')]=_0xc1c7('0x60');this[_0xc1c7('0x61')]=_0xc1c7('0x62');this[_0xc1c7('0x63')]=_0x314232;this['appdata']=_0x156d51;}function createVoicePrefixExtensions(_0x19b8d7,_0xe5882,_0x1c010a){return new BPromise(function(_0x6e300e,_0x5f4f7a){var _0x2e4673=new Extension(formatPrefixName(_0x19b8d7[_0xc1c7('0x64')]),0x1,_0xc1c7('0x65'),'Voice\x20Prefix');_0x2e4673[_0xc1c7('0x66')]=_0x19b8d7['id'];return db[_0xc1c7('0x58')][_0xc1c7('0x56')](_0x2e4673,{'transaction':_0x1c010a})[_0xc1c7('0x2e')](function(_0x58b08b){var _0x552691=_0x58b08b[_0xc1c7('0x30')]({'plain':!![]});var _0x203790=_['map'](addVoicePrefixExtensions(_0x19b8d7,_0xe5882),function(_0x46dc1e){_0x46dc1e[_0xc1c7('0x67')]=_0x552691['id'];_0x46dc1e['VoicePrefixId']=_0x19b8d7['id'];return _0x46dc1e;});return db[_0xc1c7('0x58')][_0xc1c7('0x68')](_0x203790,{'transaction':_0x1c010a})['then'](function(_0x6b9337){if(!_0x6b9337){return _0x5f4f7a(_0xc1c7('0x69'));}else{return _0x6e300e(_0x6b9337);}})[_0xc1c7('0x4f')](function(_0x2b4db2){return _0x5f4f7a(_0x2b4db2);});});;});};function addVoicePrefixExtensions(_0x1087b2,_0x11c9d8){var _0x1ed9fc=[];var _0x33104e=formatPrefixName(_0x1087b2[_0xc1c7('0x64')]);_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x2,_0xc1c7('0x6b'),_0xc1c7('0x6c')+_0x1087b2[_0xc1c7('0x3b')]));if(_0x1087b2[_0xc1c7('0x6d')]){_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x3,_0xc1c7('0x6b'),_0xc1c7('0x6e')+_0x1087b2[_0xc1c7('0x6d')]));}else{_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x3,_0xc1c7('0x65'),_0xc1c7('0x6f')));}_0x1ed9fc[_0xc1c7('0x6a')](new Extension(_0x33104e,0x4,_0xc1c7('0x70'),_0x11c9d8[_0xc1c7('0x71')]+','+_0xc1c7('0x72')+(0x8+_0x1087b2[_0xc1c7('0x3b')][_0xc1c7('0x41')])+'}'+','+0x1));return _0x1ed9fc;}function formatPrefixName(_0x1448d8){var _0x47d58e='_';for(var _0x8c88c0=0x0;_0x8c88c0<_0x1448d8[_0xc1c7('0x41')];_0x8c88c0++){if(_0x1448d8[_0xc1c7('0x73')](_0x8c88c0)=='-'){_0x47d58e+=_0x1448d8[_0xc1c7('0x73')](_0x8c88c0);}else{_0x47d58e+='['+_0x1448d8[_0xc1c7('0x73')](_0x8c88c0)+']';}}_0x47d58e+='.';return _0x47d58e;}exports[_0xc1c7('0x2d')]=function(_0x1ccd7d,_0x29181f,_0x5f4f50){var _0xbbd4e3=_0x1ccd7d[_0xc1c7('0x57')];_0xbbd4e3[_0xc1c7('0x64')]=_0xc1c7('0x74')+_0xbbd4e3[_0xc1c7('0x3b')]+'-';return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0xa00af6){return db['VoicePrefix'][_0xc1c7('0x2d')](_0xbbd4e3,{'where':{'id':_0xbbd4e3['id']},'transaction':_0xa00af6})[_0xc1c7('0x2e')](function(){return db[_0xc1c7('0x58')][_0xc1c7('0x2f')]({'where':{'VoicePrefixId':_0xbbd4e3['id']},'transaction':_0xa00af6})[_0xc1c7('0x2e')](function(){return db[_0xc1c7('0x58')][_0xc1c7('0x52')]({'where':{'id':_0xbbd4e3[_0xc1c7('0x67')]},'raw':!![]})[_0xc1c7('0x2e')](function(_0x125270){return createVoicePrefixExtensions(_0xbbd4e3,_0x125270,_0xa00af6);});});});})[_0xc1c7('0x2e')](function(){return db[_0xc1c7('0x4b')]['findById'](_0xbbd4e3['id']);})['then'](respondWithResult(_0x29181f,null))[_0xc1c7('0x4f')](handleError(_0x29181f,null));};exports[_0xc1c7('0x75')]=function(_0xc16f09,_0x11fd01,_0x44a24b){return db[_0xc1c7('0x4b')][_0xc1c7('0x52')]({'where':{'id':_0xc16f09[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x11fd01,null))[_0xc1c7('0x2e')](function(_0x180607){if(_0x180607){return _0x180607[_0xc1c7('0x75')](_0xc16f09[_0xc1c7('0x57')]['ids'],_[_0xc1c7('0x77')](_0xc16f09[_0xc1c7('0x57')],[_0xc1c7('0x78'),'id'])||{})['spread'](function(_0x4de022){for(var _0x550c4a=0x0;_0x550c4a<_0xc16f09[_0xc1c7('0x57')][_0xc1c7('0x78')]['length'];_0x550c4a+=0x1){socket[_0xc1c7('0x79')](_0xc1c7('0x7a'),{'UserId':Number(_0xc16f09['body']['ids'][_0x550c4a]),'VoicePrefixId':Number(_0xc16f09['params']['id'])});}return _0x4de022;});}})[_0xc1c7('0x2e')](respondWithResult(_0x11fd01,null))['catch'](handleError(_0x11fd01,null));};exports[_0xc1c7('0x7b')]=function(_0x3bc3aa,_0xf899a,_0x4b7a34){return db[_0xc1c7('0x4b')]['find']({'where':{'id':_0x3bc3aa[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0xf899a,null))['then'](function(_0xf7b22e){if(_0xf7b22e){return _0xf7b22e[_0xc1c7('0x7b')](_0x3bc3aa[_0xc1c7('0x3c')][_0xc1c7('0x78')])[_0xc1c7('0x2e')](function(){if(_[_0xc1c7('0x7c')](_0x3bc3aa[_0xc1c7('0x3c')][_0xc1c7('0x78')])){for(var _0x425f3d=0x0;_0x425f3d<_0x3bc3aa[_0xc1c7('0x3c')]['ids'][_0xc1c7('0x41')];_0x425f3d+=0x1){socket[_0xc1c7('0x79')](_0xc1c7('0x7d'),{'UserId':Number(_0x3bc3aa[_0xc1c7('0x3c')]['ids'][_0x425f3d]),'VoicePrefixId':Number(_0x3bc3aa[_0xc1c7('0x76')]['id'])});}}else{socket[_0xc1c7('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x3bc3aa['query'][_0xc1c7('0x78')]),'VoicePrefixId':Number(_0x3bc3aa[_0xc1c7('0x76')]['id'])});}});}})[_0xc1c7('0x2e')](respondWithStatusCode(_0xf899a,null))[_0xc1c7('0x4f')](handleError(_0xf899a,null));};exports[_0xc1c7('0x7e')]=function(_0x176603,_0x48309e,_0x1f0c3f){var _0x2ad4f5={};var _0x5698e9={};var _0x65161e;var _0x32c26e;return db[_0xc1c7('0x4b')][_0xc1c7('0x7f')]({'where':{'id':_0x176603[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x48309e,null))[_0xc1c7('0x2e')](function(_0x175bba){if(_0x175bba){_0x65161e=_0x175bba;_0x5698e9[_0xc1c7('0x3a')]=_[_0xc1c7('0x80')](db[_0xc1c7('0x81')][_0xc1c7('0x36')]);_0x5698e9[_0xc1c7('0x3c')]=_[_0xc1c7('0x80')](_0x176603['query']);_0x5698e9[_0xc1c7('0x3d')]=_[_0xc1c7('0x3e')](_0x5698e9[_0xc1c7('0x3a')],_0x5698e9[_0xc1c7('0x3c')]);_0x2ad4f5[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x5698e9['model'],qs[_0xc1c7('0x40')](_0x176603[_0xc1c7('0x3c')]['fields']));_0x2ad4f5['attributes']=_0x2ad4f5[_0xc1c7('0x3f')][_0xc1c7('0x41')]?_0x2ad4f5[_0xc1c7('0x3f')]:_0x5698e9[_0xc1c7('0x3a')];_0x2ad4f5[_0xc1c7('0x82')]=qs[_0xc1c7('0x44')](_0x176603['query'][_0xc1c7('0x44')]);_0x2ad4f5[_0xc1c7('0x45')]=qs[_0xc1c7('0x3d')](_[_0xc1c7('0x46')](_0x176603['query'],_0x5698e9[_0xc1c7('0x3d')]));if(_0x176603['query'][_0xc1c7('0x47')]){_0x2ad4f5['where']=_[_0xc1c7('0x48')](_0x2ad4f5[_0xc1c7('0x45')],{'$or':_['map'](_0x2ad4f5[_0xc1c7('0x3f')],function(_0x30e6ca){var _0x44aee1={};_0x44aee1[_0x30e6ca]={'$like':'%'+_0x176603[_0xc1c7('0x3c')][_0xc1c7('0x47')]+'%'};return _0x44aee1;})});}_0x2ad4f5=_[_0xc1c7('0x48')]({},_0x2ad4f5,_0x176603[_0xc1c7('0x4a')]);return _0x65161e[_0xc1c7('0x7e')](_0x2ad4f5);}})[_0xc1c7('0x2e')](function(_0xe1e5dd){if(_0xe1e5dd){_0x32c26e=_0xe1e5dd[_0xc1c7('0x41')];if(!_0x176603[_0xc1c7('0x3c')][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x2ad4f5[_0xc1c7('0x25')]=qs[_0xc1c7('0x25')](_0x176603[_0xc1c7('0x3c')][_0xc1c7('0x25')]);_0x2ad4f5[_0xc1c7('0x24')]=qs['offset'](_0x176603['query']['offset']);}return _0x65161e[_0xc1c7('0x7e')](_0x2ad4f5);}})['then'](function(_0x49c29b){if(_0x49c29b){return _0x49c29b?{'count':_0x32c26e,'rows':_0x49c29b}:null;}})['then'](respondWithResult(_0x48309e,null))[_0xc1c7('0x4f')](handleError(_0x48309e,null));};exports[_0xc1c7('0x83')]=function(_0x56cd17,_0x5d60e8,_0x57b04b){var _0x238077={};var _0x454b0d={};var _0x20a948;var _0x18b20f;return db[_0xc1c7('0x4b')][_0xc1c7('0x7f')]({'where':{'id':_0x56cd17['params']['id']}})[_0xc1c7('0x2e')](handleEntityNotFound(_0x5d60e8,null))[_0xc1c7('0x2e')](function(_0x2b9cff){if(_0x2b9cff){_0x20a948=_0x2b9cff;_0x454b0d['model']=_[_0xc1c7('0x80')](db[_0xc1c7('0x84')][_0xc1c7('0x36')]);_0x454b0d['query']=_[_0xc1c7('0x80')](_0x56cd17[_0xc1c7('0x3c')]);_0x454b0d[_0xc1c7('0x3d')]=_[_0xc1c7('0x3e')](_0x454b0d[_0xc1c7('0x3a')],_0x454b0d[_0xc1c7('0x3c')]);_0x238077[_0xc1c7('0x3f')]=_[_0xc1c7('0x3e')](_0x454b0d['model'],qs['fields'](_0x56cd17[_0xc1c7('0x3c')][_0xc1c7('0x40')]));_0x238077[_0xc1c7('0x3f')]=_0x238077['attributes'][_0xc1c7('0x41')]?_0x238077[_0xc1c7('0x3f')]:_0x454b0d[_0xc1c7('0x3a')];_0x238077[_0xc1c7('0x82')]=qs[_0xc1c7('0x44')](_0x56cd17['query'][_0xc1c7('0x44')]);_0x238077[_0xc1c7('0x45')]=qs[_0xc1c7('0x3d')](_[_0xc1c7('0x46')](_0x56cd17[_0xc1c7('0x3c')],_0x454b0d[_0xc1c7('0x3d')]));if(_0x56cd17[_0xc1c7('0x3c')][_0xc1c7('0x47')]){_0x238077[_0xc1c7('0x45')]=_[_0xc1c7('0x48')](_0x238077[_0xc1c7('0x45')],{'$or':_[_0xc1c7('0x35')](_0x238077[_0xc1c7('0x3f')],function(_0x38e932){var _0x265a7a={};_0x265a7a[_0x38e932]={'$like':'%'+_0x56cd17['query'][_0xc1c7('0x47')]+'%'};return _0x265a7a;})});}_0x238077=_[_0xc1c7('0x48')]({},_0x238077,_0x56cd17[_0xc1c7('0x4a')]);return _0x20a948[_0xc1c7('0x83')](_0x238077);}})[_0xc1c7('0x2e')](function(_0x4855ba){if(_0x4855ba){_0x18b20f=_0x4855ba[_0xc1c7('0x41')];if(!_0x56cd17['query'][_0xc1c7('0x42')](_0xc1c7('0x43'))){_0x238077[_0xc1c7('0x25')]=qs[_0xc1c7('0x25')](_0x56cd17['query'][_0xc1c7('0x25')]);_0x238077['offset']=qs[_0xc1c7('0x24')](_0x56cd17[_0xc1c7('0x3c')]['offset']);}return _0x20a948[_0xc1c7('0x83')](_0x238077);}})[_0xc1c7('0x2e')](function(_0x324a87){if(_0x324a87){return _0x324a87?{'count':_0x18b20f,'rows':_0x324a87}:null;}})['then'](respondWithResult(_0x5d60e8,null))[_0xc1c7('0x4f')](handleError(_0x5d60e8,null));};exports[_0xc1c7('0x85')]=function(_0x2b4a14,_0x18e4c4,_0x27edc3){var _0x4bae45=_0x2b4a14[_0xc1c7('0x57')]['ids'];var _0x183c59;return db['Team'][_0xc1c7('0x4d')]({'where':{'id':_0x4bae45},'attributes':['id'],'include':[{'model':db[_0xc1c7('0x81')],'as':_0xc1c7('0x86'),'attributes':['id','name',_0xc1c7('0x87'),_0xc1c7('0x88'),_0xc1c7('0x89')],'raw':!![]}]})[_0xc1c7('0x2e')](function(_0x4ccff5){if(_0x4ccff5){_0x183c59=_0x4ccff5;var _0x287d57=_[_0xc1c7('0x8a')](_0x4ccff5,function(_0x1732a5){var _0x20dccd=_0x1732a5[_0xc1c7('0x30')]({'plain':!![]});return _0x20dccd[_0xc1c7('0x86')];});return db[_0xc1c7('0x4b')][_0xc1c7('0x52')]({'where':{'id':_0x2b4a14[_0xc1c7('0x76')]['id']}})[_0xc1c7('0x2e')](function(_0x45e974){return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0x4d78b8){return _0x45e974[_0xc1c7('0x85')](_0x4bae45,{'transaction':_0x4d78b8})[_0xc1c7('0x2e')](function(){return BPromise['each'](_0x183c59,function(_0x125085){return db[_0xc1c7('0x8b')][_0xc1c7('0x8c')]({'TeamId':_0x125085['id'],'VoicePrefixId':_0x2b4a14[_0xc1c7('0x76')]['id']},{'transaction':_0x4d78b8});});})[_0xc1c7('0x2e')](function(){return BPromise[_0xc1c7('0x8d')](_0x287d57,function(_0x846c80){return db['UserVoicePrefix'][_0xc1c7('0x8e')]({'where':{'UserId':_0x846c80['id'],'VoicePrefixId':_0x2b4a14[_0xc1c7('0x76')]['id']},'transaction':_0x4d78b8});});})[_0xc1c7('0x2e')](function(){_0x287d57[_0xc1c7('0x8f')](function(_0x2a5267){socket['emit'](_0xc1c7('0x7a'),{'UserId':_0x2a5267['id'],'VoicePrefixId':_0x45e974['id']});});});});});}})[_0xc1c7('0x2e')](respondWithStatusCode(_0x18e4c4,null))[_0xc1c7('0x4f')](handleError(_0x18e4c4,null));};exports[_0xc1c7('0x90')]=function(_0x1bed9e,_0x39997a,_0x1273ae){return db['Team'][_0xc1c7('0x4d')]({'where':{'id':_0x1bed9e[_0xc1c7('0x3c')][_0xc1c7('0x78')]},'attributes':['id'],'include':[{'model':db[_0xc1c7('0x81')],'as':_0xc1c7('0x86'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x39997a,null))[_0xc1c7('0x2e')](function(_0x1e7149){var _0x23d84c=_[_0xc1c7('0x35')](_0x1e7149,'id');var _0x22052c=[];var _0x2ca2c1=[];var _0x1f926a=squel[_0xc1c7('0x91')]();_0x1f926a['field'](_0xc1c7('0x92'))[_0xc1c7('0x93')](_0xc1c7('0x94'),'tq')['join'](_0xc1c7('0x95'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc1c7('0x45')](_0xc1c7('0x96'),_0x1bed9e[_0xc1c7('0x76')]['id']);for(var _0x146e74=0x0;_0x146e74<_0x1e7149[_0xc1c7('0x41')];_0x146e74+=0x1){let _0x3f10ac=_0x1e7149[_0x146e74];for(var _0x3a5abd=0x0;_0x3a5abd<_0x3f10ac[_0xc1c7('0x86')][_0xc1c7('0x41')];_0x3a5abd+=0x1){let _0x494ba4=_0x3f10ac[_0xc1c7('0x86')][_0x3a5abd];var _0x4fead5=_0x1f926a[_0xc1c7('0x97')]();_0x4fead5[_0xc1c7('0x45')](_0xc1c7('0x98'),_0x494ba4['id']);_0x2ca2c1[_0xc1c7('0x6a')](db[_0xc1c7('0x54')][_0xc1c7('0x3c')](_0x4fead5[_0xc1c7('0x99')](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0xc1c7('0x2e')](function(_0x198e78){if(_0x198e78[_0xc1c7('0x41')]===0x1){return _0x494ba4['id'];}else{var _0xde9a91=_[_0xc1c7('0x9a')](_['map'](_0x198e78,_0xc1c7('0x9b')),function(_0x3d6078){return _[_0xc1c7('0x9c')](_0x23d84c,_0x3d6078);});if(_0xde9a91){return _0x494ba4['id'];}}}));}}return BPromise[_0xc1c7('0x9d')](_0x2ca2c1)[_0xc1c7('0x2e')](function(_0x3f0e2c){_0x22052c=_(_0x22052c)[_0xc1c7('0x9e')](_0x3f0e2c)['compact']()[_0xc1c7('0x9f')]();return db[_0xc1c7('0x4b')]['find']({'where':{'id':_0x1bed9e['params']['id']}})[_0xc1c7('0x2e')](function(_0x2801fb){return db[_0xc1c7('0x54')][_0xc1c7('0x55')](function(_0x43c3c3){return _0x2801fb[_0xc1c7('0x90')](_0x1bed9e[_0xc1c7('0x3c')][_0xc1c7('0x78')],{'transaction':_0x43c3c3})[_0xc1c7('0x2e')](function(){if(!_['isEmpty'](_0x22052c)){return _0x2801fb['removeAgents'](_0x22052c,{'transaction':_0x43c3c3});}})[_0xc1c7('0x2e')](function(){_0x22052c['forEach'](function(_0x479d8a){socket[_0xc1c7('0x79')](_0xc1c7('0x7d'),{'UserId':_0x479d8a,'VoicePrefixId':_0x2801fb['id']});});});});});});})[_0xc1c7('0x2e')](respondWithStatusCode(_0x39997a,null))[_0xc1c7('0x4f')](handleError(_0x39997a,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index c76c973..f37993a 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 _0x360e=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2d11a1,_0x2c12a0){var _0xa9c675=function(_0x10403c){while(--_0x10403c){_0x2d11a1['push'](_0x2d11a1['shift']());}};_0xa9c675(++_0x2c12a0);}(_0x360e,0xa9));var _0xe360=function(_0x7f3667,_0x30c3f1){_0x7f3667=_0x7f3667-0x0;var _0x2c4c24=_0x360e[_0x7f3667];return _0x2c4c24;};'use strict';var EventEmitter=require(_0xe360('0x0'));var VoicePrefix=require(_0xe360('0x1'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xe360('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe360('0x3'),'afterDestroy':_0xe360('0x4')};function emitEvent(_0x5ae5bd){return function(_0x493761,_0x485ac6,_0x4145cf){VoicePrefixEvents[_0xe360('0x5')](_0x5ae5bd+':'+_0x493761['id'],_0x493761);VoicePrefixEvents['emit'](_0x5ae5bd,_0x493761);_0x4145cf(null);};}for(var e in events){if(events[_0xe360('0x6')](e)){var event=events[e];VoicePrefix[_0xe360('0x7')](e,emitEvent(event));}}module[_0xe360('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x457f=['hook','exports','../../mysqldb','save','update','remove','emit','hasOwnProperty'];(function(_0x27ddf5,_0x5a3e18){var _0x26e74a=function(_0x5f24ac){while(--_0x5f24ac){_0x27ddf5['push'](_0x27ddf5['shift']());}};_0x26e74a(++_0x5a3e18);}(_0x457f,0xca));var _0xf457=function(_0x1dabc1,_0x59a781){_0x1dabc1=_0x1dabc1-0x0;var _0x24322d=_0x457f[_0x1dabc1];return _0x24322d;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xf457('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf457('0x1'),'afterUpdate':_0xf457('0x2'),'afterDestroy':_0xf457('0x3')};function emitEvent(_0x3e76e8){return function(_0x1a3a4c,_0x4ca3ae,_0x4e6314){VoicePrefixEvents['emit'](_0x3e76e8+':'+_0x1a3a4c['id'],_0x1a3a4c);VoicePrefixEvents[_0xf457('0x4')](_0x3e76e8,_0x1a3a4c);_0x4e6314(null);};}for(var e in events){if(events[_0xf457('0x5')](e)){var event=events[e];VoicePrefix[_0xf457('0x6')](e,emitEvent(event));}}module[_0xf457('0x7')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index c8d928f..8cac3e1 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 _0x19b0=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./voicePrefix.attributes','exports','define','voice_prefixes','lodash'];(function(_0x4b0a1b,_0x107cd6){var _0x5c7367=function(_0x125cc8){while(--_0x125cc8){_0x4b0a1b['push'](_0x4b0a1b['shift']());}};_0x5c7367(++_0x107cd6);}(_0x19b0,0x18b));var _0x019b=function(_0xf4356f,_0x478f6d){_0xf4356f=_0xf4356f-0x0;var _0x3c304c=_0x19b0[_0xf4356f];return _0x3c304c;};'use strict';var _=require(_0x019b('0x0'));var util=require(_0x019b('0x1'));var logger=require(_0x019b('0x2'))(_0x019b('0x3'));var moment=require(_0x019b('0x4'));var BPromise=require(_0x019b('0x5'));var rp=require(_0x019b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x019b('0x7'));var config=require('../../config/environment');var attributes=require(_0x019b('0x8'));module[_0x019b('0x9')]=function(_0x4181f2,_0xbbf9cc){return _0x4181f2[_0x019b('0xa')]('VoicePrefix',attributes,{'tableName':_0x019b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7665=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x373b82,_0xc66d54){var _0x3e134b=function(_0x197179){while(--_0x197179){_0x373b82['push'](_0x373b82['shift']());}};_0x3e134b(++_0xc66d54);}(_0x7665,0x18b));var _0x5766=function(_0xb7c727,_0x3ffc79){_0xb7c727=_0xb7c727-0x0;var _0x6c27c8=_0x7665[_0xb7c727];return _0x6c27c8;};'use strict';var _=require(_0x5766('0x0'));var util=require(_0x5766('0x1'));var logger=require(_0x5766('0x2'))(_0x5766('0x3'));var moment=require('moment');var BPromise=require(_0x5766('0x4'));var rp=require(_0x5766('0x5'));var fs=require('fs');var path=require(_0x5766('0x6'));var rimraf=require('rimraf');var config=require(_0x5766('0x7'));var attributes=require(_0x5766('0x8'));module[_0x5766('0x9')]=function(_0x85a12,_0x131d53){return _0x85a12[_0x5766('0xa')](_0x5766('0xb'),attributes,{'tableName':_0x5766('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index f9dc3df..9dc03c4 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 _0x8374=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./voicePrefix.socket','register','VoicePrefix,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x198a73,_0x4a8fd9){var _0x1ae708=function(_0x289e00){while(--_0x289e00){_0x198a73['push'](_0x198a73['shift']());}};_0x1ae708(++_0x4a8fd9);}(_0x8374,0x174));var _0x4837=function(_0xa5255e,_0x50e9ec){_0xa5255e=_0xa5255e-0x0;var _0x214f00=_0x8374[_0xa5255e];return _0x214f00;};'use strict';var _=require(_0x4837('0x0'));var util=require(_0x4837('0x1'));var moment=require(_0x4837('0x2'));var BPromise=require(_0x4837('0x3'));var rs=require(_0x4837('0x4'));var fs=require('fs');var Redis=require(_0x4837('0x5'));var db=require(_0x4837('0x6'))['db'];var utils=require(_0x4837('0x7'));var logger=require(_0x4837('0x8'))(_0x4837('0x9'));var config=require(_0x4837('0xa'));var jayson=require(_0x4837('0xb'));var client=jayson[_0x4837('0xc')][_0x4837('0xd')]({'port':0x232a});config['redis']=_[_0x4837('0xe')](config['redis'],{'host':_0x4837('0xf'),'port':0x18eb});var socket=require(_0x4837('0x10'))(new Redis(config[_0x4837('0x11')]));require(_0x4837('0x12'))[_0x4837('0x13')](socket);function respondWithRpcPromise(_0x3d0e2b,_0x7c34dd,_0xcf709b){return new BPromise(function(_0x37f017,_0x299827){return client['request'](_0x3d0e2b,_0xcf709b)['then'](function(_0x2cad13){logger['info'](_0x4837('0x14'),_0x7c34dd,_0x4837('0x15'));logger['debug']('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x7c34dd,'request\x20sent',JSON[_0x4837('0x16')](_0x2cad13));if(_0x2cad13[_0x4837('0x17')]){if(_0x2cad13[_0x4837('0x17')][_0x4837('0x18')]===0x1f4){logger['error'](_0x4837('0x14'),_0x7c34dd,_0x2cad13[_0x4837('0x17')][_0x4837('0x19')]);return _0x299827(_0x2cad13['error'][_0x4837('0x19')]);}logger[_0x4837('0x17')]('VoicePrefix,\x20%s,\x20%s',_0x7c34dd,_0x2cad13[_0x4837('0x17')][_0x4837('0x19')]);return _0x37f017(_0x2cad13[_0x4837('0x17')][_0x4837('0x19')]);}else{logger[_0x4837('0x1a')](_0x4837('0x14'),_0x7c34dd,'request\x20sent');_0x37f017(_0x2cad13[_0x4837('0x1b')][_0x4837('0x19')]);}})[_0x4837('0x1c')](function(_0x3c4d53){logger[_0x4837('0x17')](_0x4837('0x14'),_0x7c34dd,_0x3c4d53);_0x299827(_0x3c4d53);});});} \ No newline at end of file +var _0x8b52=['http','redis','defaults','localhost','./voicePrefix.socket','register','request','then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x37974a,_0x2804cf){var _0x45fd4e=function(_0x33559d){while(--_0x33559d){_0x37974a['push'](_0x37974a['shift']());}};_0x45fd4e(++_0x2804cf);}(_0x8b52,0x151));var _0x28b5=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8b52[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var moment=require(_0x28b5('0x2'));var BPromise=require('bluebird');var rs=require(_0x28b5('0x3'));var fs=require('fs');var Redis=require(_0x28b5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x28b5('0x5'));var logger=require(_0x28b5('0x6'))(_0x28b5('0x7'));var config=require(_0x28b5('0x8'));var jayson=require(_0x28b5('0x9'));var client=jayson[_0x28b5('0xa')][_0x28b5('0xb')]({'port':0x232a});config[_0x28b5('0xc')]=_[_0x28b5('0xd')](config['redis'],{'host':_0x28b5('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x28b5('0xf'))[_0x28b5('0x10')](socket);function respondWithRpcPromise(_0x4f2a41,_0xd8f394,_0x315ed6){return new BPromise(function(_0x4d3d4e,_0x10d2b5){return client[_0x28b5('0x11')](_0x4f2a41,_0x315ed6)[_0x28b5('0x12')](function(_0x6b22a8){logger['info'](_0x28b5('0x13'),_0xd8f394,'request\x20sent');logger[_0x28b5('0x14')](_0x28b5('0x15'),_0xd8f394,'request\x20sent',JSON[_0x28b5('0x16')](_0x6b22a8));if(_0x6b22a8['error']){if(_0x6b22a8[_0x28b5('0x17')]['code']===0x1f4){logger['error'](_0x28b5('0x13'),_0xd8f394,_0x6b22a8[_0x28b5('0x17')]['message']);return _0x10d2b5(_0x6b22a8[_0x28b5('0x17')][_0x28b5('0x18')]);}logger[_0x28b5('0x17')](_0x28b5('0x13'),_0xd8f394,_0x6b22a8[_0x28b5('0x17')]['message']);return _0x4d3d4e(_0x6b22a8[_0x28b5('0x17')]['message']);}else{logger[_0x28b5('0x19')](_0x28b5('0x13'),_0xd8f394,_0x28b5('0x1a'));_0x4d3d4e(_0x6b22a8[_0x28b5('0x1b')]['message']);}})[_0x28b5('0x1c')](function(_0x1396cf){logger[_0x28b5('0x17')]('VoicePrefix,\x20%s,\x20%s',_0xd8f394,_0x1396cf);_0x10d2b5(_0x1396cf);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index d012283..56f6a23 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 _0xbf1a=['remove','update','removeListener','length','voicePrefix:','./voicePrefix.events','save'];(function(_0x377ac8,_0x4ea072){var _0x30b068=function(_0x350719){while(--_0x350719){_0x377ac8['push'](_0x377ac8['shift']());}};_0x30b068(++_0x4ea072);}(_0xbf1a,0x7c));var _0xabf1=function(_0x34e50f,_0x40045b){_0x34e50f=_0x34e50f-0x0;var _0x3a0b82=_0xbf1a[_0x34e50f];return _0x3a0b82;};'use strict';var VoicePrefixEvents=require(_0xabf1('0x0'));var events=[_0xabf1('0x1'),_0xabf1('0x2'),_0xabf1('0x3')];function createListener(_0x690e59,_0x567007){return function(_0x132189){_0x567007['emit'](_0x690e59,_0x132189);};}function removeListener(_0x1b5f1a,_0x288b6c){return function(){VoicePrefixEvents[_0xabf1('0x4')](_0x1b5f1a,_0x288b6c);};}exports['register']=function(_0x5a477e){for(var _0x2a4ebd=0x0,_0x4f5b53=events[_0xabf1('0x5')];_0x2a4ebd<_0x4f5b53;_0x2a4ebd++){var _0x1cc1f6=events[_0x2a4ebd];var _0x1f48f5=createListener(_0xabf1('0x6')+_0x1cc1f6,_0x5a477e);VoicePrefixEvents['on'](_0x1cc1f6,_0x1f48f5);}}; \ No newline at end of file +var _0x97f5=['length','voicePrefix:','./voicePrefix.events','save','remove','emit','removeListener','register'];(function(_0x34e798,_0x1ef981){var _0xed3d6e=function(_0x343e15){while(--_0x343e15){_0x34e798['push'](_0x34e798['shift']());}};_0xed3d6e(++_0x1ef981);}(_0x97f5,0x72));var _0x597f=function(_0x436615,_0x3aa6f8){_0x436615=_0x436615-0x0;var _0x2dc60d=_0x97f5[_0x436615];return _0x2dc60d;};'use strict';var VoicePrefixEvents=require(_0x597f('0x0'));var events=[_0x597f('0x1'),_0x597f('0x2'),'update'];function createListener(_0x5c0754,_0xae9eeb){return function(_0x4058fa){_0xae9eeb[_0x597f('0x3')](_0x5c0754,_0x4058fa);};}function removeListener(_0xa1eb97,_0x3e3c7e){return function(){VoicePrefixEvents[_0x597f('0x4')](_0xa1eb97,_0x3e3c7e);};}exports[_0x597f('0x5')]=function(_0x1abf16){for(var _0x89d13a=0x0,_0x5f4eb9=events[_0x597f('0x6')];_0x89d13a<_0x5f4eb9;_0x89d13a++){var _0x20f0fc=events[_0x89d13a];var _0x1098e6=createListener(_0x597f('0x7')+_0x20f0fc,_0x1abf16);VoicePrefixEvents['on'](_0x20f0fc,_0x1098e6);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index c889107..d9193cc 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(_0x43b5be,_0x1d47a6){var _0x512e53=function(_0x4f2999){while(--_0x4f2999){_0x43b5be['push'](_0x43b5be['shift']());}};_0x512e53(++_0x1d47a6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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(_0x5c08cb,_0x456960){var _0x147907=function(_0x1da1be){while(--_0x1da1be){_0x5c08cb['push'](_0x5c08cb['shift']());}};_0x147907(++_0x456960);}(_0xb10b,0x12a));var _0xbb10=function(_0x598408,_0x5e6f74){_0x598408=_0x598408-0x0;var _0x560720=_0xb10b[_0x598408];return _0x560720;};'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 7c97494..075e71e 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 _0x3d0e=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','name','inbound','default','ringall','leastrecent','fewestcalls','random','wrandom','rrmemory','type','getDataValue','strategy','outbound','preview','booked','roundrobin','INTEGER','ENUM','yes','TEXT','setDataValue','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\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)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x4961e8,_0x31f873){var _0x448213=function(_0x1c0f01){while(--_0x1c0f01){_0x4961e8['push'](_0x4961e8['shift']());}};_0x448213(++_0x31f873);}(_0x3d0e,0x1b1));var _0xe3d0=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x3d0e[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0xe3d0('0x0'));module[_0xe3d0('0x1')]={'name':{'type':Sequelize[_0xe3d0('0x2')],'allowNull':![],'unique':_0xe3d0('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe3d0('0x4'),'outbound'),'allowNull':![],'defaultValue':_0xe3d0('0x4')},'musiconhold':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':_0xe3d0('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xe3d0('0x6'),_0xe3d0('0x7'),_0xe3d0('0x8'),_0xe3d0('0x9'),'rrmemory','linear',_0xe3d0('0xa'),'rrordered'),'allowNull':![],'defaultValue':_0xe3d0('0x6'),'set':function(_0x1203aa){this['setDataValue']('strategy',_0x1203aa?_0x1203aa:_0xe3d0('0xb'));},'get':function(){var _0x672333=this['getDataValue'](_0xe3d0('0xc'));var _0x40bc26=this[_0xe3d0('0xd')]('dialMethod');var _0x11b52f=this[_0xe3d0('0xd')](_0xe3d0('0xe'));if(_0x672333===_0xe3d0('0xf')){if(_0x40bc26===_0xe3d0('0x10')){return null;}if(_0x40bc26===_0xe3d0('0x11')&&![_0xe3d0('0xb'),_0xe3d0('0x12')]['includes'](_0x11b52f)){this['setDataValue'](_0xe3d0('0xe'),_0xe3d0('0xb'));}}return _0x11b52f;}},'servicelevel':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xe3d0('0x2')]},'weight':{'type':Sequelize[_0xe3d0('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x15'),'no'),'defaultValue':_0xe3d0('0x15')},'autopause':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xe3d0('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xe3d0('0x14')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xe3d0('0x14')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xe3d0('0x14')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xe3d0('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xe3d0('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xe3d0('0x14')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xe3d0('0x15'),'no'),'defaultValue':_0xe3d0('0x15')},'announce_holdtime':{'type':Sequelize[_0xe3d0('0x14')]('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0xe3d0('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xe3d0('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xe3d0('0x2')]},'queue_youarenext':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xe3d0('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[_0xe3d0('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xe3d0('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xe3d0('0x2')]},'queue_less_than':{'type':Sequelize[_0xe3d0('0x2')]},'periodic_announce':{'type':Sequelize[_0xe3d0('0x16')],'set':function(_0x55c712){this[_0xe3d0('0x17')](_0xe3d0('0x18'),_0x55c712?_0x55c712['join'](','):[]);},'get':function(){return this[_0xe3d0('0xd')]('periodic_announce')?this['getDataValue']('periodic_announce')[_0xe3d0('0x19')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':'yes','set':function(_0x4037fb){this[_0xe3d0('0x17')](_0xe3d0('0x1a'),_0x4037fb?_0x4037fb[_0xe3d0('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0xe3d0('0x1a'))?this[_0xe3d0('0xd')]('joinempty')['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':'no','set':function(_0x2e57e1){this['setDataValue'](_0xe3d0('0x1c'),_0x2e57e1?_0x2e57e1[_0xe3d0('0x1b')](','):undefined);},'get':function(){return this[_0xe3d0('0xd')]('leavewhenempty')?this[_0xe3d0('0xd')]('leavewhenempty')[_0xe3d0('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0xe3d0('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xe3d0('0x2')]},'description':{'type':Sequelize[_0xe3d0('0x2')]},'acw':{'type':Sequelize[_0xe3d0('0x1d')],'defaultValue':0x0,'set':function(_0x37a38b){this['setDataValue'](_0xe3d0('0x1e'),_0x37a38b);if(_0x37a38b){if(this[_0xe3d0('0xd')](_0xe3d0('0x1f'))<0x2){this[_0xe3d0('0x17')](_0xe3d0('0x1f'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xe3d0('0x13')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xe3d0('0x1d')],'defaultValue':0x0,'comment':_0xe3d0('0x20')},'dialMethod':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x10'),_0xe3d0('0x21'),_0xe3d0('0x22'),_0xe3d0('0x23'),_0xe3d0('0x11')),'defaultValue':_0xe3d0('0x21'),'comment':_0xe3d0('0x24')},'dialLimitChannel':{'type':Sequelize[_0xe3d0('0x13')](0x4)[_0xe3d0('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xe3d0('0x26')},'dialLimitQueue':{'type':Sequelize[_0xe3d0('0x13')](0x4)[_0xe3d0('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0xe3d0('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x27'),'dropRate'),'defaultValue':_0xe3d0('0x28'),'comment':_0xe3d0('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xe3d0('0x2a')](0x2)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xe3d0('0x2b')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xe3d0('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize[_0xe3d0('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xe3d0('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xe3d0('0x13')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':_0xe3d0('0x2d'),'comment':_0xe3d0('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0xe3d0('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe3d0('0x2f')},'dialQueueProject':{'type':Sequelize[_0xe3d0('0x2')],'comment':_0xe3d0('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe3d0('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe3d0('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe3d0('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xe3d0('0x13')](0x5)[_0xe3d0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe3d0('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'defaultValue':0x3,'comment':_0xe3d0('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe3d0('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':_0xe3d0('0x36')},'dialPrefix':{'type':Sequelize[_0xe3d0('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xe3d0('0x14')](_0xe3d0('0x37'),'never',_0xe3d0('0x38')),'defaultValue':_0xe3d0('0x37')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xe3d0('0x39')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe3d0('0x3a')},'dialAMDGreeting':{'type':Sequelize[_0xe3d0('0x13')](0x9)[_0xe3d0('0x25')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe3d0('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe3d0('0x13')](0x9)[_0xe3d0('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xe3d0('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe3d0('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0xe3d0('0x13')](0x9)[_0xe3d0('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe3d0('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xe3d0('0x13')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe3d0('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe3d0('0x13')](0x9)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe3d0('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe3d0('0x3f')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe3d0('0x13')](0x9)[_0xe3d0('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe3d0('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0xe3d0('0x13')](0x5)[_0xe3d0('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize[_0xe3d0('0x1d')],'defaultValue':0x0,'comment':_0xe3d0('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe3d0('0x14')]('DESC',_0xe3d0('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xe3d0('0x2')],'comment':_0xe3d0('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xe3d0('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xe3d0('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe3d0('0x43')},'dialCutDigit':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe3d0('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe3d0('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xe3d0('0x13')](0x5)[_0xe3d0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe3d0('0x46')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xe3d0('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe3d0('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe3d0('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xe3d0('0x13')](0x5)[_0xe3d0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe3d0('0x49')},'dialMachineMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe3d0('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe3d0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe3d0('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe3d0('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xe3d0('0x13')](0x5)[_0xe3d0('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe3d0('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xe3d0('0x13')],'allowNull':!![],'comment':_0xe3d0('0x4e')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xe3d0('0x4f'),'set':function(_0x5ce19f){if(!_0x5ce19f)this[_0xe3d0('0x17')]('mandatoryDispositionPauseId',null);this[_0xe3d0('0x17')](_0xe3d0('0x50'),_0x5ce19f);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xe3d0('0x13')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xe3d0('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xe3d0('0x13')](0x3)[_0xe3d0('0x25')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xe3d0('0x1d')],'defaultValue':![]}}; \ No newline at end of file +var _0x8612=['join','getDataValue','split','joinempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen','always','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','linear','rrordered','setDataValue','type','dialMethod','strategy','preview','booked','roundrobin','INTEGER','yes','TEXT','periodic_announce'];(function(_0x39e509,_0x1645a6){var _0x202468=function(_0x5c4dff){while(--_0x5c4dff){_0x39e509['push'](_0x39e509['shift']());}};_0x202468(++_0x1645a6);}(_0x8612,0x1c2));var _0x2861=function(_0x13fb77,_0x24e81a){_0x13fb77=_0x13fb77-0x0;var _0xfbdd17=_0x8612[_0x13fb77];return _0xfbdd17;};'use strict';var Sequelize=require(_0x2861('0x0'));module[_0x2861('0x1')]={'name':{'type':Sequelize[_0x2861('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x4'),_0x2861('0x5')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':'default'},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x2861('0x6'),_0x2861('0x7'),_0x2861('0x8'),_0x2861('0x9'),_0x2861('0xa'),_0x2861('0xb'),'wrandom',_0x2861('0xc')),'allowNull':![],'defaultValue':_0x2861('0x6'),'set':function(_0x201ccd){this[_0x2861('0xd')]('strategy',_0x201ccd?_0x201ccd:'rrmemory');},'get':function(){var _0x26095a=this['getDataValue'](_0x2861('0xe'));var _0x1dc3fc=this['getDataValue'](_0x2861('0xf'));var _0x2f3a13=this['getDataValue'](_0x2861('0x10'));if(_0x26095a===_0x2861('0x5')){if(_0x1dc3fc===_0x2861('0x11')){return null;}if(_0x1dc3fc===_0x2861('0x12')&&![_0x2861('0xa'),_0x2861('0x13')]['includes'](_0x2f3a13)){this['setDataValue'](_0x2861('0x10'),_0x2861('0xa'));}}return _0x2f3a13;}},'servicelevel':{'type':Sequelize[_0x2861('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x2861('0x14')](0xb)},'timeout':{'type':Sequelize[_0x2861('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x2861('0x2')]},'weight':{'type':Sequelize[_0x2861('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x2861('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x2861('0x3')]('yes','no'),'defaultValue':_0x2861('0x15')},'autopause':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x2861('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x2861('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x2861('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x2861('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x2861('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x2861('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x2861('0x3')]('yes','no'),'defaultValue':_0x2861('0x15')},'announce_holdtime':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x2861('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x2861('0x3')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0x2861('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x2861('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x2861('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x2861('0x2')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x2861('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x2861('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x2861('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x2861('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x2861('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x2861('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x2861('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x2861('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x2861('0x2')]},'queue_less_than':{'type':Sequelize[_0x2861('0x2')]},'periodic_announce':{'type':Sequelize[_0x2861('0x16')],'set':function(_0x9148df){this[_0x2861('0xd')](_0x2861('0x17'),_0x9148df?_0x9148df[_0x2861('0x18')](','):[]);},'get':function(){return this[_0x2861('0x19')](_0x2861('0x17'))?this['getDataValue'](_0x2861('0x17'))[_0x2861('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x2861('0x2')],'defaultValue':_0x2861('0x15'),'set':function(_0x2e2207){this[_0x2861('0xd')]('joinempty',_0x2e2207?_0x2e2207[_0x2861('0x18')](','):undefined);},'get':function(){return this[_0x2861('0x19')](_0x2861('0x1b'))?this[_0x2861('0x19')](_0x2861('0x1b'))[_0x2861('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x2861('0x2')],'defaultValue':'no','set':function(_0x523ac6){this[_0x2861('0xd')]('leavewhenempty',_0x523ac6?_0x523ac6[_0x2861('0x18')](','):undefined);},'get':function(){return this[_0x2861('0x19')]('leavewhenempty')?this[_0x2861('0x19')]('leavewhenempty')[_0x2861('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x2861('0x3')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x2861('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x2861('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x2861('0x2')]},'description':{'type':Sequelize[_0x2861('0x2')]},'acw':{'type':Sequelize[_0x2861('0x1c')],'defaultValue':0x0,'set':function(_0x3ebf3e){this[_0x2861('0xd')](_0x2861('0x1d'),_0x3ebf3e);if(_0x3ebf3e){if(this[_0x2861('0x19')](_0x2861('0x1e'))<0x2){this['setDataValue'](_0x2861('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x2861('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2861('0x1f')},'dialMethod':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x11'),'progressive',_0x2861('0x20'),'predictive',_0x2861('0x12')),'defaultValue':'progressive','comment':_0x2861('0x21')},'dialLimitChannel':{'type':Sequelize[_0x2861('0x14')](0x4)[_0x2861('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2861('0x23')},'dialLimitQueue':{'type':Sequelize[_0x2861('0x14')](0x4)[_0x2861('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x2861('0x24')},'dialPowerLevel':{'type':Sequelize[_0x2861('0x25')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x2861('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x27'),_0x2861('0x28')),'defaultValue':_0x2861('0x28'),'comment':_0x2861('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x2861('0x25')](0x2)[_0x2861('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x2861('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x2861('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2861('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2861('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2861('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x2861('0x2')],'defaultValue':_0x2861('0x2d'),'comment':_0x2861('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2861('0x2f')},'dialQueueProject':{'type':Sequelize[_0x2861('0x2')],'comment':_0x2861('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2861('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2861('0x14')](0x5)[_0x2861('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2861('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2861('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2861('0x14')](0x5)[_0x2861('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2861('0x34')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2861('0x22')],'defaultValue':0x3,'comment':_0x2861('0x35')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2861('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2861('0x36')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2861('0x37')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2861('0x2')],'defaultValue':_0x2861('0x38')},'dialPrefix':{'type':Sequelize[_0x2861('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x2861('0x39')),'defaultValue':_0x2861('0x3a')},'dialAMDActive':{'type':Sequelize[_0x2861('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x2861('0x14')](0x9)[_0x2861('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x2861('0x14')](0x9)[_0x2861('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2861('0x3b')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2861('0x14')](0x9)[_0x2861('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x2861('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x2861('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x2861('0x14')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2861('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2861('0x14')](0x9)[_0x2861('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2861('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2861('0x14')](0x9)[_0x2861('0x22')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2861('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2861('0x14')](0x5)[_0x2861('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2861('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2861('0x40')},'dialRecallMeTimeout':{'type':Sequelize[_0x2861('0x14')](0x5)[_0x2861('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x2861('0x41')},'dialRecallInQueue':{'type':Sequelize[_0x2861('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0x2861('0x3')](_0x2861('0x42'),_0x2861('0x43')),'defaultValue':_0x2861('0x42')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':_0x2861('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x2861('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x2861('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2861('0x44')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x2861('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2861('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x2861('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2861('0x46')},'dialDropMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2861('0x47')},'dialDropRetryFrequency':{'type':Sequelize[_0x2861('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2861('0x48')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x2861('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2861('0x49')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2861('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2861('0x4a')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2861('0x14')],'allowNull':!![],'comment':_0x2861('0x4b')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2861('0x4c'),'set':function(_0x9f8804){if(!_0x9f8804)this[_0x2861('0xd')](_0x2861('0x4d'),null);this[_0x2861('0xd')](_0x2861('0x4e'),_0x9f8804);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x2861('0x14')](0x3)[_0x2861('0x22')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x2861('0x1c')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0x2861('0x22')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0x2861('0x1c')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 132fbf2..abed904 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 _0x8ef6=['select','field','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','includes','all','union','compact','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isArray','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','VoiceQueueId\x20=\x20?','into','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId=ci.CmContactId','ci.ItemClass=?','PHONE','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','moment','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','VoiceQueues','inbound','outbound','ignore','map','value','find','type','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','getOptions','include','query','findAll','rows','catch','show','model','keys','intersection','attributes','fields','length','merge','options','create','body','user','get','role','QueueCampaigns','UserProfileSection','userProfileId','clone','includeAll','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','getHoppers','findOne','CmHopper','filters','hasOwnProperty','order','sort','where','pick','filter','getHopperHistories','CmHopperHistory','nolimit','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','flatMap','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids'];(function(_0x8a5380,_0x3bdcab){var _0xd7c44=function(_0x5a4c4c){while(--_0x5a4c4c){_0x8a5380['push'](_0x8a5380['shift']());}};_0xd7c44(++_0x3bdcab);}(_0x8ef6,0xf2));var _0x68ef=function(_0x4b1bc7,_0x381977){_0x4b1bc7=_0x4b1bc7-0x0;var _0x38236c=_0x8ef6[_0x4b1bc7];return _0x38236c;};'use strict';var moment=require(_0x68ef('0x0'));var BPromise=require(_0x68ef('0x1'));var util=require(_0x68ef('0x2'));var _=require(_0x68ef('0x3'));var squel=require(_0x68ef('0x4'));var Redis=require(_0x68ef('0x5'));var qs=require(_0x68ef('0x6'));var logger=require('../../config/logger')(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var db=require(_0x68ef('0x9'))['db'];config[_0x68ef('0xa')]=_['defaults'](config['redis'],{'host':_0x68ef('0xb'),'port':0x18eb});var socket=require(_0x68ef('0xc'))(new Redis(config[_0x68ef('0xa')]));require('./voiceQueue.socket')[_0x68ef('0xd')](socket);function respondWithStatusCode(_0x31007e,_0x1bee73){_0x1bee73=_0x1bee73||0xcc;return function(_0x22ae26){if(_0x22ae26){return _0x31007e[_0x68ef('0xe')](_0x1bee73);}return _0x31007e[_0x68ef('0xf')](_0x1bee73)[_0x68ef('0x10')]();};}function respondWithResult(_0x23da00,_0x1f6747){_0x1f6747=_0x1f6747||0xc8;return function(_0x255c85){if(_0x255c85){return _0x23da00[_0x68ef('0xf')](_0x1f6747)[_0x68ef('0x11')](_0x255c85);}};}function respondWithFilteredResult(_0x582a79,_0x1aa045){return function(_0x46356f){if(_0x46356f){var _0x1e117a=typeof _0x1aa045[_0x68ef('0x12')]===_0x68ef('0x13')&&typeof _0x1aa045[_0x68ef('0x14')]==='undefined';var _0x3b48dd=_0x46356f[_0x68ef('0x15')];var _0x2657c5=_0x1e117a?0x0:_0x1aa045['offset'];var _0x22fe96=_0x1e117a?_0x46356f[_0x68ef('0x15')]:_0x1aa045[_0x68ef('0x12')]+_0x1aa045['limit'];var _0x35493d;if(_0x22fe96>=_0x3b48dd){_0x22fe96=_0x3b48dd;_0x35493d=0xc8;}else{_0x35493d=0xce;}_0x582a79[_0x68ef('0xf')](_0x35493d);return _0x582a79[_0x68ef('0x16')](_0x68ef('0x17'),_0x2657c5+'-'+_0x22fe96+'/'+_0x3b48dd)['json'](_0x46356f);}return null;};}function saveUpdates(_0x2ada1c){return function(_0x54139e){if(_0x54139e){return _0x54139e['update'](_0x2ada1c)[_0x68ef('0x18')](function(_0x404870){return _0x404870;});}return null;};}function removeEntity(_0x4ade0d){return function(_0x527870){if(_0x527870){return _0x527870[_0x68ef('0x19')]()[_0x68ef('0x18')](function(){var _0x318514=_0x527870['get']({'plain':!![]});var _0x1dc49c=[{'name':_0x68ef('0x1a'),'value':_0x68ef('0x1b'),'ignore':![]},{'name':'QueueCampaigns','value':_0x68ef('0x1c'),'ignore':![]}];var _0x3be4c0=_(_0x1dc49c)['filter'](_0x68ef('0x1d'))[_0x68ef('0x1e')](_0x68ef('0x1f'))['value']();if(_['includes'](_0x3be4c0,_0x318514['type'])){return;}var _0x26018d=_[_0x68ef('0x20')](_0x1dc49c,[_0x68ef('0x1f'),_0x318514[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x23')][_0x68ef('0x19')]({'where':{'type':_0x26018d,'resourceId':_0x318514['id']}})[_0x68ef('0x18')](function(){return _0x527870;});})[_0x68ef('0x18')](function(){_0x4ade0d[_0x68ef('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x178460){return function(_0x57f9ee){if(!_0x57f9ee){_0x178460['sendStatus'](0x194);}return _0x57f9ee;};}function handleError(_0x55d8b0,_0x1a7ce1){_0x1a7ce1=_0x1a7ce1||0x1f4;return function(_0x268f32){logger[_0x68ef('0x24')](_0x268f32[_0x68ef('0x25')]);if(_0x268f32['name']){delete _0x268f32['name'];}_0x55d8b0[_0x68ef('0xf')](_0x1a7ce1)[_0x68ef('0x26')](_0x268f32);};}exports[_0x68ef('0x27')]=function(_0x263b30,_0x22ef25){var _0x201884={};var _0x26288a={'count':0x0,'rows':[]};var _0x4579cb=_['map'](db[_0x68ef('0x28')][_0x68ef('0x29')],function(_0x132d9e){return{'name':_0x132d9e['fieldName'],'type':_0x132d9e[_0x68ef('0x21')]['key']};});_0x201884=qs[_0x68ef('0x2a')](_0x4579cb,_0x263b30);var _0x17588a={'where':_0x201884['where']};return db['VoiceQueue'][_0x68ef('0x15')](_0x17588a)[_0x68ef('0x18')](function(_0x4b8fc8){_0x26288a[_0x68ef('0x15')]=_0x4b8fc8;_0x201884[_0x68ef('0x2b')]=qs[_0x68ef('0x2b')](_0x263b30[_0x68ef('0x2c')]);return db['VoiceQueue'][_0x68ef('0x2d')](_0x201884);})[_0x68ef('0x18')](function(_0x5f137b){_0x26288a[_0x68ef('0x2e')]=_0x5f137b;return _0x26288a;})['then'](respondWithFilteredResult(_0x22ef25,_0x201884))[_0x68ef('0x2f')](handleError(_0x22ef25,null));};exports[_0x68ef('0x30')]=function(_0x4973c2,_0x24c2c9){var _0x4a0763={'raw':![],'where':{'id':_0x4973c2['params']['id']}},_0x38c2f8={};_0x38c2f8[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x28')]['rawAttributes']);_0x38c2f8[_0x68ef('0x2c')]=_['keys'](_0x4973c2[_0x68ef('0x2c')]);_0x38c2f8['filters']=_[_0x68ef('0x33')](_0x38c2f8[_0x68ef('0x31')],_0x38c2f8[_0x68ef('0x2c')]);_0x4a0763[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x38c2f8[_0x68ef('0x31')],qs['fields'](_0x4973c2[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4a0763[_0x68ef('0x34')]=_0x4a0763['attributes'][_0x68ef('0x36')]?_0x4a0763[_0x68ef('0x34')]:_0x38c2f8[_0x68ef('0x31')];if(_0x4973c2['query']['includeAll']){_0x4a0763[_0x68ef('0x2b')]=[{'all':!![]}];}_0x4a0763=_[_0x68ef('0x37')]({},_0x4a0763,_0x4973c2[_0x68ef('0x38')]);return db[_0x68ef('0x28')][_0x68ef('0x20')](_0x4a0763)[_0x68ef('0x18')](handleEntityNotFound(_0x24c2c9,null))[_0x68ef('0x18')](respondWithResult(_0x24c2c9,null))['catch'](handleError(_0x24c2c9,null));};exports[_0x68ef('0x39')]=function(_0xd7f9ca,_0x2f6ee0){return db[_0x68ef('0x28')]['create'](_0xd7f9ca[_0x68ef('0x3a')],{})[_0x68ef('0x18')](function(_0xcf595d){var _0x410c10=_0xd7f9ca[_0x68ef('0x3b')][_0x68ef('0x3c')]({'plain':!![]});if(!_0x410c10)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410c10[_0x68ef('0x3d')]===_0x68ef('0x3b')){var _0xf5010c=_0xcf595d[_0x68ef('0x3c')]({'plain':!![]});var _0x449f3c=[{'name':_0x68ef('0x1a'),'value':_0x68ef('0x1b')},{'name':_0x68ef('0x3e'),'value':_0x68ef('0x1c')}];var _0x531096=_[_0x68ef('0x20')](_0x449f3c,[_0x68ef('0x1f'),_0xf5010c[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x3f')][_0x68ef('0x20')]({'where':{'name':_0x531096,'userProfileId':_0x410c10[_0x68ef('0x40')]},'raw':!![]})['then'](function(_0xb3d396){if(_0xb3d396&&_0xb3d396['autoAssociation']===0x0){return db[_0x68ef('0x23')][_0x68ef('0x39')]({'name':_0xf5010c[_0x68ef('0x22')],'resourceId':_0xf5010c['id'],'type':_0xb3d396[_0x68ef('0x22')],'sectionId':_0xb3d396['id']},{})['then'](function(){return _0xcf595d;});}else{return _0xcf595d;}})[_0x68ef('0x2f')](function(_0x5a8231){logger[_0x68ef('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a8231);throw _0x5a8231;});}return _0xcf595d;})[_0x68ef('0x18')](respondWithResult(_0x2f6ee0,0xc9))[_0x68ef('0x2f')](handleError(_0x2f6ee0,null));};exports[_0x68ef('0x41')]=function(_0x5c4a66,_0x59b148){var _0x4044d5={'where':{'id':_0x5c4a66['params']['id']}},_0x399055={};_0x399055['model']=_['keys'](db[_0x68ef('0x28')][_0x68ef('0x29')]);_0x4044d5[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x399055[_0x68ef('0x31')],qs['fields'](_0x5c4a66['query'][_0x68ef('0x35')]));_0x4044d5[_0x68ef('0x34')]=_0x4044d5[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4044d5['attributes']:_0x399055[_0x68ef('0x31')];if(_0x5c4a66[_0x68ef('0x2c')][_0x68ef('0x42')]){_0x4044d5[_0x68ef('0x2b')]=[{'all':!![]}];}_0x4044d5=_['merge']({},_0x4044d5,_0x5c4a66['options']);return db[_0x68ef('0x28')][_0x68ef('0x20')](_0x4044d5)['then'](handleEntityNotFound(_0x59b148,null))[_0x68ef('0x18')](function(_0x12fff3){if(_0x12fff3){var _0x3a82a0=_0x12fff3[_0x68ef('0x3c')]({'plain':!![]});_0x3a82a0=qs[_0x68ef('0x43')](_0x3a82a0,['id','createdAt',_0x68ef('0x44')]);_0x5c4a66[_0x68ef('0x3a')]=_[_0x68ef('0x43')](_0x5c4a66['body'],['id',_0x68ef('0x45'),_0x68ef('0x44')]);return db[_0x68ef('0x28')]['create'](_[_0x68ef('0x37')](_0x3a82a0,_0x5c4a66['body']),{'include':_0x5c4a66['query'][_0x68ef('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x39dd21){var _0xb33afd=_0x5c4a66[_0x68ef('0x3b')][_0x68ef('0x3c')]({'plain':!![]});if(!_0xb33afd)throw new Error(_0x68ef('0x46'));if(_0xb33afd[_0x68ef('0x3d')]===_0x68ef('0x3b')){var _0x1d1d6e=_0x39dd21[_0x68ef('0x3c')]({'plain':!![]});var _0x247915=[{'name':'VoiceQueues','value':'inbound'},{'name':_0x68ef('0x3e'),'value':_0x68ef('0x1c')}];var _0x317b79=_[_0x68ef('0x20')](_0x247915,[_0x68ef('0x1f'),_0x1d1d6e[_0x68ef('0x21')]])[_0x68ef('0x22')];return db[_0x68ef('0x3f')][_0x68ef('0x20')]({'where':{'name':_0x317b79,'userProfileId':_0xb33afd['userProfileId']},'raw':!![]})['then'](function(_0x42a4b2){if(_0x42a4b2&&_0x42a4b2['autoAssociation']===0x0){return db[_0x68ef('0x23')]['create']({'name':_0x1d1d6e[_0x68ef('0x22')],'resourceId':_0x1d1d6e['id'],'type':_0x42a4b2[_0x68ef('0x22')],'sectionId':_0x42a4b2['id']},{})['then'](function(){return _0x39dd21;});}else{return _0x39dd21;}})[_0x68ef('0x2f')](function(_0x4e097e){logger[_0x68ef('0x24')](_0x68ef('0x47'),_0x4e097e);throw _0x4e097e;});}return _0x39dd21;});}})[_0x68ef('0x18')](respondWithResult(_0x59b148,0xc9))[_0x68ef('0x2f')](handleError(_0x59b148,null));};exports[_0x68ef('0x48')]=function(_0x3d81c8,_0x5c347c){if(_0x3d81c8[_0x68ef('0x3a')]['id']){delete _0x3d81c8[_0x68ef('0x3a')]['id'];}return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x3d81c8[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x5c347c,null))['then'](saveUpdates(_0x3d81c8[_0x68ef('0x3a')],null))[_0x68ef('0x18')](respondWithResult(_0x5c347c,null))['catch'](handleError(_0x5c347c,null));};exports[_0x68ef('0x19')]=function(_0x114d9f,_0x3d3087){return db['VoiceQueue'][_0x68ef('0x20')]({'where':{'id':_0x114d9f['params']['id']}})['then'](handleEntityNotFound(_0x3d3087,null))[_0x68ef('0x18')](removeEntity(_0x3d3087,null))['catch'](handleError(_0x3d3087,null));};exports[_0x68ef('0x4a')]=function(_0x47c1d5,_0x100a20){var _0x9e8554={'raw':![],'where':{}};var _0x304405={};var _0x3fbd39={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x47c1d5['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x100a20,null))['then'](function(_0x2cbd99){if(_0x2cbd99){_0x304405['model']=_[_0x68ef('0x32')](db[_0x68ef('0x4c')][_0x68ef('0x29')]);_0x304405[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x47c1d5[_0x68ef('0x2c')]);_0x304405[_0x68ef('0x4d')]=_['intersection'](_0x304405[_0x68ef('0x31')],_0x304405[_0x68ef('0x2c')]);_0x9e8554[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x304405[_0x68ef('0x31')],qs['fields'](_0x47c1d5[_0x68ef('0x2c')]['fields']));_0x9e8554[_0x68ef('0x34')]=_0x9e8554['attributes']['length']?_0x9e8554[_0x68ef('0x34')]:_0x304405[_0x68ef('0x31')];if(!_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x4e')]('nolimit')){_0x9e8554[_0x68ef('0x14')]=qs['limit'](_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x9e8554[_0x68ef('0x12')]=qs['offset'](_0x47c1d5['query'][_0x68ef('0x12')]);}_0x9e8554[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x47c1d5[_0x68ef('0x2c')]['sort']);_0x9e8554[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x47c1d5[_0x68ef('0x2c')],_0x304405['filters']));_0x9e8554[_0x68ef('0x51')]['VoiceQueueId']=_0x2cbd99['id'];if(_0x47c1d5[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x9e8554[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x9e8554[_0x68ef('0x51')],{'$or':_['map'](_0x9e8554[_0x68ef('0x34')],function(_0x2caed7){var _0x147695={};_0x147695[_0x2caed7]={'$like':'%'+_0x47c1d5['query'][_0x68ef('0x53')]+'%'};return _0x147695;})});}_0x9e8554=_['merge']({},_0x9e8554,_0x47c1d5[_0x68ef('0x38')]);return db['CmHopper']['count']({'where':_0x9e8554[_0x68ef('0x51')]})[_0x68ef('0x18')](function(_0x38c117){_0x3fbd39[_0x68ef('0x15')]=_0x38c117;if(_0x47c1d5['query'][_0x68ef('0x42')]){_0x9e8554[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x4c')]['findAll'](_0x9e8554);})[_0x68ef('0x18')](function(_0x2db826){_0x3fbd39[_0x68ef('0x2e')]=_0x2db826;return _0x3fbd39;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0x100a20,_0x9e8554))[_0x68ef('0x2f')](handleError(_0x100a20,null));};exports[_0x68ef('0x54')]=function(_0x139557,_0xfe72dc){var _0x156ce3={'raw':!![],'where':{}};var _0x11feff={};var _0x454999={'count':0x0,'rows':[]};return db[_0x68ef('0x28')]['findOne']({'where':{'id':_0x139557[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0xfe72dc,null))['then'](function(_0x513c69){if(_0x513c69){_0x11feff[_0x68ef('0x31')]=_['keys'](db[_0x68ef('0x55')][_0x68ef('0x29')]);_0x11feff['query']=_['keys'](_0x139557[_0x68ef('0x2c')]);_0x11feff['filters']=_[_0x68ef('0x33')](_0x11feff['model'],_0x11feff[_0x68ef('0x2c')]);_0x156ce3['attributes']=_[_0x68ef('0x33')](_0x11feff[_0x68ef('0x31')],qs['fields'](_0x139557[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x156ce3[_0x68ef('0x34')]=_0x156ce3[_0x68ef('0x34')]['length']?_0x156ce3[_0x68ef('0x34')]:_0x11feff[_0x68ef('0x31')];if(!_0x139557['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x156ce3[_0x68ef('0x14')]=qs['limit'](_0x139557[_0x68ef('0x2c')]['limit']);_0x156ce3[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x139557['query']['offset']);}_0x156ce3['order']=qs['sort'](_0x139557[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x156ce3[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x139557[_0x68ef('0x2c')],_0x11feff[_0x68ef('0x4d')]));_0x156ce3[_0x68ef('0x51')][_0x68ef('0x57')]=_0x513c69['id'];if(_0x139557[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x156ce3[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x156ce3['where'],{'$or':_[_0x68ef('0x1e')](_0x156ce3['attributes'],function(_0x791181){var _0x5b39a8={};_0x5b39a8[_0x791181]={'$like':'%'+_0x139557['query'][_0x68ef('0x53')]+'%'};return _0x5b39a8;})});}_0x156ce3=_[_0x68ef('0x37')]({},_0x156ce3,_0x139557[_0x68ef('0x38')]);return db[_0x68ef('0x55')]['count']({'where':_0x156ce3['where']})[_0x68ef('0x18')](function(_0x308997){_0x454999[_0x68ef('0x15')]=_0x308997;if(_0x139557['query'][_0x68ef('0x42')]){_0x156ce3[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x55')][_0x68ef('0x2d')](_0x156ce3);})['then'](function(_0x214e89){_0x454999[_0x68ef('0x2e')]=_0x214e89;return _0x454999;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0xfe72dc,_0x156ce3))[_0x68ef('0x2f')](handleError(_0xfe72dc,null));};exports[_0x68ef('0x58')]=function(_0x346049,_0x489ca6){var _0x2a72e8={'raw':!![],'where':{}};var _0x49844f={};var _0xea97f4={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x346049[_0x68ef('0x49')]['id']}})['then'](handleEntityNotFound(_0x489ca6,null))[_0x68ef('0x18')](function(_0x4c47ab){if(_0x4c47ab){_0x49844f[_0x68ef('0x31')]=_[_0x68ef('0x32')](db['CmHopperFinal']['rawAttributes']);_0x49844f[_0x68ef('0x2c')]=_['keys'](_0x346049[_0x68ef('0x2c')]);_0x49844f['filters']=_[_0x68ef('0x33')](_0x49844f[_0x68ef('0x31')],_0x49844f[_0x68ef('0x2c')]);_0x2a72e8[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x49844f[_0x68ef('0x31')],qs['fields'](_0x346049[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x2a72e8[_0x68ef('0x34')]=_0x2a72e8[_0x68ef('0x34')][_0x68ef('0x36')]?_0x2a72e8[_0x68ef('0x34')]:_0x49844f[_0x68ef('0x31')];if(!_0x346049['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x2a72e8[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x346049[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x2a72e8[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x346049[_0x68ef('0x2c')]['offset']);}_0x2a72e8[_0x68ef('0x4f')]=qs['sort'](_0x346049['query']['sort']);_0x2a72e8[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x346049['query'],_0x49844f['filters']));_0x2a72e8['where'][_0x68ef('0x57')]=_0x4c47ab['id'];if(_0x346049[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x2a72e8[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x2a72e8[_0x68ef('0x51')],{'$or':_['map'](_0x2a72e8[_0x68ef('0x34')],function(_0x2c7f18){var _0x1bdacc={};_0x1bdacc[_0x2c7f18]={'$like':'%'+_0x346049[_0x68ef('0x2c')]['filter']+'%'};return _0x1bdacc;})});}_0x2a72e8=_[_0x68ef('0x37')]({},_0x2a72e8,_0x346049[_0x68ef('0x38')]);return db[_0x68ef('0x59')][_0x68ef('0x15')]({'where':_0x2a72e8[_0x68ef('0x51')]})[_0x68ef('0x18')](function(_0x6ca6f4){_0xea97f4[_0x68ef('0x15')]=_0x6ca6f4;if(_0x346049['query'][_0x68ef('0x42')]){_0x2a72e8[_0x68ef('0x2b')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x68ef('0x2d')](_0x2a72e8);})[_0x68ef('0x18')](function(_0x1b9028){_0xea97f4[_0x68ef('0x2e')]=_0x1b9028;return _0xea97f4;});}})[_0x68ef('0x18')](respondWithFilteredResult(_0x489ca6,_0x2a72e8))[_0x68ef('0x2f')](handleError(_0x489ca6,null));};exports[_0x68ef('0x5a')]=function(_0x2e626c,_0x3b1781){var _0x159169={'raw':!![],'where':{}};var _0x29522c={};var _0x37bf89={'count':0x0,'rows':[]};return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x2e626c[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x3b1781,null))[_0x68ef('0x18')](function(_0x24af15){if(_0x24af15){_0x29522c['model']=_[_0x68ef('0x32')](db[_0x68ef('0x5b')][_0x68ef('0x29')]);_0x29522c[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x2e626c['query']);_0x29522c[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x29522c['model'],_0x29522c[_0x68ef('0x2c')]);_0x159169['attributes']=_['intersection'](_0x29522c['model'],qs['fields'](_0x2e626c[_0x68ef('0x2c')]['fields']));_0x159169[_0x68ef('0x34')]=_0x159169['attributes']['length']?_0x159169['attributes']:_0x29522c[_0x68ef('0x31')];if(!_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x159169[_0x68ef('0x14')]=qs['limit'](_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x159169[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x2e626c['query'][_0x68ef('0x12')]);}_0x159169['order']=qs['sort'](_0x2e626c['query'][_0x68ef('0x50')]);_0x159169[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x2e626c[_0x68ef('0x2c')],_0x29522c[_0x68ef('0x4d')]));_0x159169[_0x68ef('0x51')][_0x68ef('0x57')]=_0x24af15['id'];if(_0x2e626c[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x159169[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x159169['where'],{'$or':_['map'](_0x159169['attributes'],function(_0x25e698){var _0x1cad59={};_0x1cad59[_0x25e698]={'$like':'%'+_0x2e626c[_0x68ef('0x2c')]['filter']+'%'};return _0x1cad59;})});}_0x159169=_[_0x68ef('0x37')]({},_0x159169,_0x2e626c['options']);return db[_0x68ef('0x5b')][_0x68ef('0x15')]({'where':_0x159169[_0x68ef('0x51')]})['then'](function(_0x304260){_0x37bf89[_0x68ef('0x15')]=_0x304260;if(_0x2e626c['query'][_0x68ef('0x42')]){_0x159169[_0x68ef('0x2b')]=[{'all':!![]}];}return db[_0x68ef('0x5b')][_0x68ef('0x2d')](_0x159169);})[_0x68ef('0x18')](function(_0x23126a){_0x37bf89[_0x68ef('0x2e')]=_0x23126a;return _0x37bf89;});}})['then'](respondWithFilteredResult(_0x3b1781,_0x159169))[_0x68ef('0x2f')](handleError(_0x3b1781,null));};exports[_0x68ef('0x5c')]=function(_0x5a262d,_0x28cad4){var _0x424e46={};var _0x46c87e={};var _0x20a131;var _0x1b8250;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x5a262d['params']['id']}})['then'](handleEntityNotFound(_0x28cad4,null))[_0x68ef('0x18')](function(_0x4dcf9e){if(_0x4dcf9e){_0x20a131=_0x4dcf9e;_0x46c87e[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x5d')][_0x68ef('0x29')]);_0x46c87e[_0x68ef('0x2c')]=_['keys'](_0x5a262d[_0x68ef('0x2c')]);_0x46c87e[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x46c87e[_0x68ef('0x31')],_0x46c87e['query']);_0x424e46['attributes']=_[_0x68ef('0x33')](_0x46c87e[_0x68ef('0x31')],qs[_0x68ef('0x35')](_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x424e46[_0x68ef('0x34')]=_0x424e46[_0x68ef('0x34')][_0x68ef('0x36')]?_0x424e46[_0x68ef('0x34')]:_0x46c87e[_0x68ef('0x31')];_0x424e46[_0x68ef('0x4f')]=qs['sort'](_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x424e46[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x5a262d[_0x68ef('0x2c')],_0x46c87e[_0x68ef('0x4d')]));if(_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x424e46[_0x68ef('0x51')]=_['merge'](_0x424e46['where'],{'$or':_[_0x68ef('0x1e')](_0x424e46[_0x68ef('0x34')],function(_0x3ef9e2){var _0x12ef69={};_0x12ef69[_0x3ef9e2]={'$like':'%'+_0x5a262d[_0x68ef('0x2c')][_0x68ef('0x53')]+'%'};return _0x12ef69;})});}_0x424e46=_[_0x68ef('0x37')]({},_0x424e46,_0x5a262d['options']);return _0x20a131[_0x68ef('0x5c')](_0x424e46);}})[_0x68ef('0x18')](function(_0x11c717){if(_0x11c717){_0x1b8250=_0x11c717[_0x68ef('0x36')];if(!_0x5a262d['query'][_0x68ef('0x4e')]('nolimit')){_0x424e46[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x5a262d[_0x68ef('0x2c')]['limit']);_0x424e46['offset']=qs[_0x68ef('0x12')](_0x5a262d['query'][_0x68ef('0x12')]);}return _0x20a131['getTeams'](_0x424e46);}})[_0x68ef('0x18')](function(_0x426274){if(_0x426274){return _0x426274?{'count':_0x1b8250,'rows':_0x426274}:null;}})['then'](respondWithResult(_0x28cad4,null))['catch'](handleError(_0x28cad4,null));};exports[_0x68ef('0x5e')]=function(_0x1d429a,_0x4d96a9){var _0xf9f2c4=_0x1d429a[_0x68ef('0x3a')][_0x68ef('0x5f')];var _0x4ae311=_['map'](_0xf9f2c4,'id');return db[_0x68ef('0x5d')]['findAll']({'where':{'id':_0x4ae311},'attributes':['id'],'include':[{'model':db[_0x68ef('0x60')],'as':_0x68ef('0x61'),'attributes':['id',_0x68ef('0x22'),_0x68ef('0x62'),_0x68ef('0x63'),_0x68ef('0x64')],'raw':!![]}]})['then'](function(_0x48f3f6){if(_0x48f3f6){var _0x453f91=_[_0x68ef('0x65')](_0x48f3f6,function(_0x8eb711){var _0x39ab6a=_0x8eb711[_0x68ef('0x3c')]({'plain':!![]});_0x39ab6a['Agents'][_0x68ef('0x66')](function(_0x428fd5){_0x428fd5[_0x68ef('0x67')]=_[_0x68ef('0x20')](_0xf9f2c4,{'id':_0x39ab6a['id']})[_0x68ef('0x67')];});return _0x39ab6a[_0x68ef('0x61')];});return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x1d429a['params']['id']}})[_0x68ef('0x18')](function(_0x261ce6){return db[_0x68ef('0x68')][_0x68ef('0x69')](function(_0x2138cd){return _0x261ce6[_0x68ef('0x5e')](_0x4ae311,{'transaction':_0x2138cd})['then'](function(){return BPromise[_0x68ef('0x6a')](_0xf9f2c4,function(_0x13fae2){return db[_0x68ef('0x6b')][_0x68ef('0x6c')]({'TeamId':_0x13fae2['id'],'VoiceQueueId':_0x1d429a[_0x68ef('0x49')]['id'],'penalty':_0x13fae2['penalty']},{'transaction':_0x2138cd});});})[_0x68ef('0x18')](function(){return BPromise[_0x68ef('0x6a')](_0x453f91,function(_0x5d156e){return db['UserVoiceQueue'][_0x68ef('0x6d')]({'where':{'UserId':_0x5d156e['id'],'VoiceQueueId':_0x1d429a[_0x68ef('0x49')]['id']},'defaults':{'penalty':_0x5d156e[_0x68ef('0x67')]},'transaction':_0x2138cd});});})['then'](function(){return BPromise['each'](_[_0x68ef('0x53')](_0x453f91,{'online':!![]}),function(_0x10a3f9){return db[_0x68ef('0x6e')][_0x68ef('0x6c')]({'membername':_0x10a3f9[_0x68ef('0x22')],'UserId':_0x10a3f9['id'],'queue_name':_0x261ce6[_0x68ef('0x22')],'VoiceQueueId':_0x261ce6['id'],'interface':_[_0x68ef('0x6f')](_0x10a3f9[_0x68ef('0x64')])?util[_0x68ef('0x70')](_0x68ef('0x71'),_0x10a3f9[_0x68ef('0x22')]):_0x10a3f9[_0x68ef('0x64')],'paused':_0x10a3f9[_0x68ef('0x63')]||![],'penalty':_0x10a3f9[_0x68ef('0x67')]},{'transaction':_0x2138cd});});})['then'](function(){_0x453f91['forEach'](function(_0x503219){socket[_0x68ef('0x72')](_0x68ef('0x73'),{'UserId':_0x503219['id'],'VoiceQueueId':_0x261ce6['id']});});});});});}})[_0x68ef('0x18')](respondWithStatusCode(_0x4d96a9,null))['catch'](handleError(_0x4d96a9,null));};exports[_0x68ef('0x74')]=function(_0x3713e0,_0x5af5d0){return db['Team'][_0x68ef('0x2d')]({'where':{'id':_0x3713e0[_0x68ef('0x2c')][_0x68ef('0x75')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x68ef('0x61'),'attributes':['id'],'raw':!![]}]})[_0x68ef('0x18')](handleEntityNotFound(_0x5af5d0,null))[_0x68ef('0x18')](function(_0x48959f){var _0x1bb11f=_['map'](_0x48959f,'id');var _0x211d51=[];var _0x3e37e3=[];var _0x5168cd=squel[_0x68ef('0x76')]();_0x5168cd[_0x68ef('0x77')](_0x68ef('0x78'))[_0x68ef('0x79')](_0x68ef('0x7a'),'tq')[_0x68ef('0x7b')](_0x68ef('0x7c'),'ut',_0x68ef('0x7d'))[_0x68ef('0x51')]('VoiceQueueId\x20=\x20?',_0x3713e0[_0x68ef('0x49')]['id']);for(var _0x121a0f=0x0;_0x121a0f<_0x48959f[_0x68ef('0x36')];_0x121a0f+=0x1){let _0x465198=_0x48959f[_0x121a0f];for(var _0x3e3775=0x0;_0x3e3775<_0x465198[_0x68ef('0x61')][_0x68ef('0x36')];_0x3e3775+=0x1){let _0x4906d2=_0x465198['Agents'][_0x3e3775];var _0x1e8577=_0x5168cd['clone']();_0x1e8577[_0x68ef('0x51')](_0x68ef('0x7e'),_0x4906d2['id']);_0x3e37e3[_0x68ef('0x7f')](db[_0x68ef('0x68')]['query'](_0x1e8577[_0x68ef('0x80')](),{'type':db[_0x68ef('0x68')][_0x68ef('0x81')]['SELECT']})[_0x68ef('0x18')](function(_0xe82f3a){if(_0xe82f3a['length']===0x1){return _0x4906d2['id'];}else{var _0x3c3933=_[_0x68ef('0x82')](_['map'](_0xe82f3a,'TeamId'),function(_0x522ef7){return _[_0x68ef('0x83')](_0x1bb11f,_0x522ef7);});if(_0x3c3933){return _0x4906d2['id'];}}}));}}return BPromise[_0x68ef('0x84')](_0x3e37e3)[_0x68ef('0x18')](function(_0x3e92e0){_0x211d51=_(_0x211d51)[_0x68ef('0x85')](_0x3e92e0)[_0x68ef('0x86')]()[_0x68ef('0x1f')]();return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x3713e0['params']['id']}})[_0x68ef('0x18')](function(_0x62a830){return db['sequelize'][_0x68ef('0x69')](function(_0x2374fa){return _0x62a830[_0x68ef('0x74')](_0x3713e0['query'][_0x68ef('0x75')],{'transaction':_0x2374fa})['then'](function(){if(!_[_0x68ef('0x87')](_0x211d51)){return _0x62a830[_0x68ef('0x88')](_0x211d51,{'transaction':_0x2374fa})[_0x68ef('0x18')](function(){return db[_0x68ef('0x6e')][_0x68ef('0x19')]({'where':{'VoiceQueueId':_0x3713e0[_0x68ef('0x49')]['id'],'UserId':_0x211d51},'transaction':_0x2374fa});});}})[_0x68ef('0x18')](function(){_0x211d51[_0x68ef('0x66')](function(_0x491464){socket[_0x68ef('0x72')](_0x68ef('0x89'),{'UserId':_0x491464,'VoiceQueueId':_0x62a830['id']});});});});});});})['then'](respondWithStatusCode(_0x5af5d0,null))[_0x68ef('0x2f')](handleError(_0x5af5d0,null));};exports[_0x68ef('0x8a')]=function(_0x430ef5,_0x1d3499){var _0x2b1686,_0x51c52b;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x430ef5[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x1d3499,null))[_0x68ef('0x18')](function(_0x5548b1){if(_0x5548b1){_0x51c52b=_0x5548b1;return _0x5548b1[_0x68ef('0x8a')](_0x430ef5['body']['ids'],_[_0x68ef('0x43')](_0x430ef5[_0x68ef('0x3a')],[_0x68ef('0x75'),'id'])||{})[_0x68ef('0x8b')](function(_0x32e1e3){for(var _0x150e0d=0x0;_0x150e0d<_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')]['length'];_0x150e0d+=0x1){socket[_0x68ef('0x72')](_0x68ef('0x73'),{'UserId':Number(_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')][_0x150e0d]),'VoiceQueueId':Number(_0x430ef5[_0x68ef('0x49')]['id'])});}return _0x32e1e3;});}})[_0x68ef('0x18')](function(_0x39302e){_0x2b1686=_0x39302e||[];if(_0x51c52b){return db[_0x68ef('0x60')][_0x68ef('0x2d')]({'where':{'id':_0x430ef5[_0x68ef('0x3a')][_0x68ef('0x75')]},'attributes':['id',_0x68ef('0x22'),'online',_0x68ef('0x63'),_0x68ef('0x64')],'raw':!![]});}})[_0x68ef('0x18')](function(_0xe4c314){if(!_['isEmpty'](_0xe4c314)){var _0xc5163d=[];for(var _0xb342e5=0x0;_0xb342e5<_0xe4c314[_0x68ef('0x36')];_0xb342e5++){if(_0xe4c314[_0xb342e5]['online']){_0xc5163d[_0x68ef('0x7f')](db['UserVoiceQueueRt'][_0x68ef('0x6c')]({'membername':_0xe4c314[_0xb342e5][_0x68ef('0x22')],'UserId':_0xe4c314[_0xb342e5]['id'],'queue_name':_0x51c52b[_0x68ef('0x22')],'VoiceQueueId':_0x51c52b['id'],'interface':_[_0x68ef('0x6f')](_0xe4c314[_0xb342e5][_0x68ef('0x64')])?util['format']('SIP/%s',_0xe4c314[_0xb342e5]['name']):_0xe4c314[_0xb342e5][_0x68ef('0x64')],'paused':_0xe4c314[_0xb342e5][_0x68ef('0x63')]||![],'penalty':_0x430ef5['body'][_0x68ef('0x67')]||0x0}));}}return BPromise[_0x68ef('0x84')](_0xc5163d);}})[_0x68ef('0x18')](function(){return _0x2b1686;})[_0x68ef('0x18')](respondWithResult(_0x1d3499,null))[_0x68ef('0x2f')](handleError(_0x1d3499,null));};exports[_0x68ef('0x88')]=function(_0x34edc4,_0x1576ac){return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x34edc4[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x1576ac,null))[_0x68ef('0x18')](function(_0x31b61d){if(_0x31b61d){return _0x31b61d[_0x68ef('0x88')](_0x34edc4[_0x68ef('0x2c')]['ids'])[_0x68ef('0x18')](function(){if(_[_0x68ef('0x8c')](_0x34edc4['query'][_0x68ef('0x75')])){for(var _0x1774a9=0x0;_0x1774a9<_0x34edc4[_0x68ef('0x2c')][_0x68ef('0x75')][_0x68ef('0x36')];_0x1774a9+=0x1){socket[_0x68ef('0x72')](_0x68ef('0x89'),{'UserId':Number(_0x34edc4['query']['ids'][_0x1774a9]),'VoiceQueueId':Number(_0x34edc4[_0x68ef('0x49')]['id'])});}}else{socket[_0x68ef('0x72')]('userVoiceQueue:remove',{'UserId':Number(_0x34edc4[_0x68ef('0x2c')]['ids']),'VoiceQueueId':Number(_0x34edc4[_0x68ef('0x49')]['id'])});}});}})['then'](function(_0x3054e8){return db[_0x68ef('0x6e')][_0x68ef('0x19')]({'where':{'VoiceQueueId':_0x34edc4[_0x68ef('0x49')]['id'],'UserId':_0x34edc4[_0x68ef('0x2c')][_0x68ef('0x75')]}})[_0x68ef('0x18')](function(){return _0x3054e8;});})[_0x68ef('0x18')](respondWithStatusCode(_0x1576ac,null))['catch'](handleError(_0x1576ac,null));};exports[_0x68ef('0x8d')]=function(_0x60a1e7,_0x3bd9f2){var _0x3dd5f7={};var _0x35eba3={};var _0x18e166;var _0x3a6e25;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x60a1e7['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x3bd9f2,null))[_0x68ef('0x18')](function(_0x33ec8e){if(_0x33ec8e){_0x18e166=_0x33ec8e;_0x35eba3['model']=_[_0x68ef('0x32')](db[_0x68ef('0x60')][_0x68ef('0x29')]);_0x35eba3[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x60a1e7[_0x68ef('0x2c')]);_0x35eba3[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x35eba3[_0x68ef('0x31')],_0x35eba3[_0x68ef('0x2c')]);_0x3dd5f7[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x35eba3[_0x68ef('0x31')],qs[_0x68ef('0x35')](_0x60a1e7[_0x68ef('0x2c')]['fields']));_0x3dd5f7[_0x68ef('0x34')]=_0x3dd5f7[_0x68ef('0x34')]['length']?_0x3dd5f7[_0x68ef('0x34')]:_0x35eba3['model'];_0x3dd5f7[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x3dd5f7[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x60a1e7[_0x68ef('0x2c')],_0x35eba3[_0x68ef('0x4d')]));if(_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x3dd5f7[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x3dd5f7['where'],{'$or':_[_0x68ef('0x1e')](_0x3dd5f7[_0x68ef('0x34')],function(_0x2cf7d3){var _0x154c78={};_0x154c78[_0x2cf7d3]={'$like':'%'+_0x60a1e7['query'][_0x68ef('0x53')]+'%'};return _0x154c78;})});}_0x3dd5f7=_[_0x68ef('0x37')]({},_0x3dd5f7,_0x60a1e7[_0x68ef('0x38')]);return _0x18e166['getAgents'](_0x3dd5f7);}})[_0x68ef('0x18')](function(_0x225067){if(_0x225067){_0x3a6e25=_0x225067[_0x68ef('0x36')];if(!_0x60a1e7[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x3dd5f7[_0x68ef('0x14')]=qs['limit'](_0x60a1e7['query'][_0x68ef('0x14')]);_0x3dd5f7[_0x68ef('0x12')]=qs['offset'](_0x60a1e7['query'][_0x68ef('0x12')]);}return _0x18e166[_0x68ef('0x8d')](_0x3dd5f7);}})[_0x68ef('0x18')](function(_0x1e1738){if(_0x1e1738){return _0x1e1738?{'count':_0x3a6e25,'rows':_0x1e1738}:null;}})[_0x68ef('0x18')](respondWithResult(_0x3bd9f2,null))[_0x68ef('0x2f')](handleError(_0x3bd9f2,null));};exports[_0x68ef('0x8e')]=function(_0x13db31,_0x58800b){var _0x4cc80a={};var _0x3452d1={};var _0x1c5b4a;var _0x33dd03;return db['VoiceQueue'][_0x68ef('0x4b')]({'where':{'id':_0x13db31[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x58800b,null))[_0x68ef('0x18')](function(_0x535c5c){if(_0x535c5c){_0x1c5b4a=_0x535c5c;_0x3452d1['model']=_[_0x68ef('0x32')](db[_0x68ef('0x6e')][_0x68ef('0x29')]);_0x3452d1['query']=_[_0x68ef('0x32')](_0x13db31[_0x68ef('0x2c')]);_0x3452d1[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x3452d1[_0x68ef('0x31')],_0x3452d1[_0x68ef('0x2c')]);_0x4cc80a[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x3452d1[_0x68ef('0x31')],qs['fields'](_0x13db31[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4cc80a['attributes']=_0x4cc80a[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4cc80a[_0x68ef('0x34')]:_0x3452d1[_0x68ef('0x31')];_0x4cc80a['order']=qs[_0x68ef('0x50')](_0x13db31[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x4cc80a['where']=qs[_0x68ef('0x4d')](_['pick'](_0x13db31['query'],_0x3452d1['filters']));if(_0x13db31[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x4cc80a['where']=_[_0x68ef('0x37')](_0x4cc80a['where'],{'$or':_['map'](_0x4cc80a[_0x68ef('0x34')],function(_0x103585){var _0xa28738={};_0xa28738[_0x103585]={'$like':'%'+_0x13db31[_0x68ef('0x2c')][_0x68ef('0x53')]+'%'};return _0xa28738;})});}_0x4cc80a=_[_0x68ef('0x37')]({},_0x4cc80a,_0x13db31[_0x68ef('0x38')]);return _0x1c5b4a[_0x68ef('0x8e')](_0x4cc80a);}})[_0x68ef('0x18')](function(_0xcd5609){if(_0xcd5609){_0x33dd03=_0xcd5609[_0x68ef('0x36')];if(!_0x13db31['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x4cc80a['limit']=qs[_0x68ef('0x14')](_0x13db31['query'][_0x68ef('0x14')]);_0x4cc80a[_0x68ef('0x12')]=qs[_0x68ef('0x12')](_0x13db31['query'][_0x68ef('0x12')]);}return _0x1c5b4a[_0x68ef('0x8e')](_0x4cc80a);}})[_0x68ef('0x18')](function(_0x799597){return _0x799597?{'count':_0x33dd03,'rows':_0x799597}:null;})[_0x68ef('0x18')](respondWithResult(_0x58800b,null))[_0x68ef('0x2f')](handleError(_0x58800b,null));};exports['getLists']=function(_0x5e4ec4,_0x40c6ec){var _0x4a45f9={};var _0x16ba3d={};var _0x405008;var _0x3ecec3;return db[_0x68ef('0x28')][_0x68ef('0x4b')]({'where':{'id':_0x5e4ec4[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x40c6ec,null))[_0x68ef('0x18')](function(_0x4d4bfa){if(_0x4d4bfa){_0x405008=_0x4d4bfa;_0x16ba3d[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x8f')]['rawAttributes']);_0x16ba3d[_0x68ef('0x2c')]=_[_0x68ef('0x32')](_0x5e4ec4[_0x68ef('0x2c')]);_0x16ba3d[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x16ba3d[_0x68ef('0x31')],_0x16ba3d[_0x68ef('0x2c')]);_0x4a45f9[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x16ba3d['model'],qs['fields'](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x4a45f9['attributes']=_0x4a45f9[_0x68ef('0x34')][_0x68ef('0x36')]?_0x4a45f9['attributes']:_0x16ba3d['model'];_0x4a45f9['order']=qs['sort'](_0x5e4ec4[_0x68ef('0x2c')]['sort']);_0x4a45f9[_0x68ef('0x51')]=qs['filters'](_[_0x68ef('0x52')](_0x5e4ec4[_0x68ef('0x2c')],_0x16ba3d['filters']));if(_0x5e4ec4['query']['filter']){_0x4a45f9[_0x68ef('0x51')]=_[_0x68ef('0x37')](_0x4a45f9[_0x68ef('0x51')],{'$or':_['map'](_0x4a45f9[_0x68ef('0x34')],function(_0x4898ad){var _0x22a810={};_0x22a810[_0x4898ad]={'$like':'%'+_0x5e4ec4['query'][_0x68ef('0x53')]+'%'};return _0x22a810;})});}_0x4a45f9=_[_0x68ef('0x37')]({},_0x4a45f9,_0x5e4ec4[_0x68ef('0x38')]);return _0x405008[_0x68ef('0x90')](_0x4a45f9);}})[_0x68ef('0x18')](function(_0x3f9113){if(_0x3f9113){_0x3ecec3=_0x3f9113[_0x68ef('0x36')];if(!_0x5e4ec4['query'][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x4a45f9[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x4a45f9[_0x68ef('0x12')]=qs['offset'](_0x5e4ec4[_0x68ef('0x2c')][_0x68ef('0x12')]);}return _0x405008[_0x68ef('0x90')](_0x4a45f9);}})[_0x68ef('0x18')](function(_0x2a93bf){if(_0x2a93bf){return _0x2a93bf?{'count':_0x3ecec3,'rows':_0x2a93bf}:null;}})[_0x68ef('0x18')](respondWithResult(_0x40c6ec,null))[_0x68ef('0x2f')](handleError(_0x40c6ec,null));};exports[_0x68ef('0x91')]=function(_0x2d0bf5,_0x40da26){var _0x202e78=moment()[_0x68ef('0x70')]('YYYY-MM-DD\x20HH:mm:ss');var _0x253b31,_0x14b845;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x2d0bf5['params']['id']}})['then'](handleEntityNotFound(_0x40da26,null))['then'](function(_0x2e6bcf){if(_0x2e6bcf){_0x14b845=_0x2e6bcf;return _0x2e6bcf[_0x68ef('0x91')](_0x2d0bf5[_0x68ef('0x3a')][_0x68ef('0x75')],_['omit'](_0x2d0bf5['body'],['ids','id'])||{});}return null;})[_0x68ef('0x8b')](function(_0x12dbe5){var _0x547e6d;_0x253b31=_0x12dbe5||[];var _0x575f73=[];if(_0x12dbe5){for(var _0x6dc883=0x0;_0x6dc883<_0x12dbe5[_0x68ef('0x36')];_0x6dc883+=0x1){var _0x1dcc3e=_0x12dbe5[_0x6dc883][_0x68ef('0x3c')]({'plain':!![]});_0x14b845[_0x68ef('0x92')]=_0x2d0bf5[_0x68ef('0x3a')][_0x68ef('0x92')]?_0x2d0bf5['body'][_0x68ef('0x92')]:_0x14b845[_0x68ef('0x92')];switch(_0x14b845[_0x68ef('0x92')]){case _0x68ef('0x93'):_0x547e6d=squel[_0x68ef('0x94')]()['into'](_0x68ef('0x95'))[_0x68ef('0x96')](['phone',_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),_0x68ef('0x57'),'createdAt',_0x68ef('0x44')],squel['select']()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))[_0x68ef('0x77')]('id','ContactId')['field'](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),'ListId')['field'](_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0x9c'))[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f'))[_0x68ef('0x51')](_0x68ef('0xa0'),squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa1'))[_0x68ef('0x79')]('cm_hopper_final')['where'](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')]()))[_0x68ef('0x51')]('phone\x20NOT\x20IN\x20(?)',squel[_0x68ef('0x76')]()[_0x68ef('0x77')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')[_0x68ef('0x51')](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id']['toString']())))[_0x68ef('0x80')]();break;case'onlyIfOpen':_0x547e6d=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0x95'))[_0x68ef('0x96')]([_0x68ef('0x9a'),_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),_0x68ef('0x57'),_0x68ef('0x45'),_0x68ef('0x44')],squel[_0x68ef('0x76')]()['field'](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))[_0x68ef('0x77')]('id',_0x68ef('0x98'))['field'](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),_0x68ef('0x99'))[_0x68ef('0x77')](_0x2d0bf5['params']['id']['toString'](),_0x68ef('0x57'))['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))[_0x68ef('0x79')](_0x68ef('0x9c'))[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f'))[_0x68ef('0x51')](_0x68ef('0xa0'),squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa4'))[_0x68ef('0x79')]('cm_hopper')['where'](_0x68ef('0xa2'),_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')]())))[_0x68ef('0x80')]();break;default:_0x547e6d=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')]('cm_hopper')[_0x68ef('0x96')]([_0x68ef('0x9a'),_0x68ef('0x97'),_0x68ef('0x98'),_0x68ef('0x99'),'VoiceQueueId','createdAt',_0x68ef('0x44')],squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x97'))['field']('id','ContactId')[_0x68ef('0x77')](_0x1dcc3e[_0x68ef('0x9b')][_0x68ef('0x80')](),'ListId')[_0x68ef('0x77')](_0x2d0bf5[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0x9c'))['where'](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x1dcc3e['CmListId'][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f')))[_0x68ef('0x80')]();}_0x575f73[_0x68ef('0x7f')](db[_0x68ef('0x68')][_0x68ef('0x2c')](_0x547e6d));}return BPromise[_0x68ef('0x84')](_0x575f73);}})[_0x68ef('0x18')](function(){var _0x54b4cc=[];var _0x59637f=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0xa5'))['fromQuery']([_0x68ef('0xa6'),_0x68ef('0x9a'),_0x68ef('0xa7'),'createdAt','updatedAt'],squel[_0x68ef('0x76')]()[_0x68ef('0x77')](_0x68ef('0xa8'))[_0x68ef('0x77')](_0x68ef('0xa9'))[_0x68ef('0x77')]('ci.OrderBy+1')['field']('\x27'+_0x202e78+'\x27',_0x68ef('0x45'))[_0x68ef('0x77')]('\x27'+_0x202e78+'\x27',_0x68ef('0x44'))['from'](_0x68ef('0xaa'),'ci')[_0x68ef('0x7b')](_0x68ef('0x95'),'h',_0x68ef('0xab'))[_0x68ef('0x51')]('h.scheduledat=?',_0x202e78)[_0x68ef('0x51')](_0x68ef('0xac'),_0x68ef('0xad')))['toString']();_0x54b4cc[_0x68ef('0x7f')](db[_0x68ef('0x68')][_0x68ef('0x2c')](_0x59637f));return BPromise[_0x68ef('0x84')](_0x54b4cc);})[_0x68ef('0x18')](function(){return _0x253b31;})[_0x68ef('0x18')](respondWithResult(_0x40da26,null))[_0x68ef('0x2f')](handleError(_0x40da26,null));};exports[_0x68ef('0xae')]=function(_0x58d5da,_0x1873b5){return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0x58d5da[_0x68ef('0x49')]['id']}})['then'](handleEntityNotFound(_0x1873b5,null))[_0x68ef('0x18')](function(_0x351b99){if(_0x351b99){return _0x351b99[_0x68ef('0xae')](_0x58d5da[_0x68ef('0x2c')][_0x68ef('0x75')]);}})['then'](function(_0x5b41f0){if(_0x5b41f0){return db[_0x68ef('0x4c')]['destroy']({'where':{'ListId':_0x58d5da['query'][_0x68ef('0x75')],'VoiceQueueId':_0x58d5da[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](function(){return _0x5b41f0;});}})[_0x68ef('0x18')](respondWithStatusCode(_0x1873b5,null))[_0x68ef('0x2f')](handleError(_0x1873b5,null));};exports[_0x68ef('0xaf')]=function(_0x3ee069,_0x5f49e9){var _0x40cd91={};var _0x848118={};var _0x794d1e;var _0x266f6c;return db[_0x68ef('0x28')]['findOne']({'where':{'id':_0x3ee069[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x5f49e9,null))[_0x68ef('0x18')](function(_0x2b5994){if(_0x2b5994){_0x794d1e=_0x2b5994;_0x848118[_0x68ef('0x31')]=_[_0x68ef('0x32')](db[_0x68ef('0x8f')][_0x68ef('0x29')]);_0x848118['query']=_[_0x68ef('0x32')](_0x3ee069[_0x68ef('0x2c')]);_0x848118[_0x68ef('0x4d')]=_[_0x68ef('0x33')](_0x848118[_0x68ef('0x31')],_0x848118[_0x68ef('0x2c')]);_0x40cd91[_0x68ef('0x34')]=_[_0x68ef('0x33')](_0x848118['model'],qs[_0x68ef('0x35')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x35')]));_0x40cd91[_0x68ef('0x34')]=_0x40cd91[_0x68ef('0x34')]['length']?_0x40cd91[_0x68ef('0x34')]:_0x848118[_0x68ef('0x31')];_0x40cd91[_0x68ef('0x4f')]=qs[_0x68ef('0x50')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x50')]);_0x40cd91[_0x68ef('0x51')]=qs[_0x68ef('0x4d')](_[_0x68ef('0x52')](_0x3ee069[_0x68ef('0x2c')],_0x848118[_0x68ef('0x4d')]));if(_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x53')]){_0x40cd91['where']=_[_0x68ef('0x37')](_0x40cd91[_0x68ef('0x51')],{'$or':_[_0x68ef('0x1e')](_0x40cd91[_0x68ef('0x34')],function(_0x124eda){var _0x4b738d={};_0x4b738d[_0x124eda]={'$like':'%'+_0x3ee069[_0x68ef('0x2c')]['filter']+'%'};return _0x4b738d;})});}_0x40cd91=_['merge']({},_0x40cd91,_0x3ee069[_0x68ef('0x38')]);return _0x794d1e['getBlackLists'](_0x40cd91);}})['then'](function(_0x4210c0){if(_0x4210c0){_0x266f6c=_0x4210c0['length'];if(!_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x4e')](_0x68ef('0x56'))){_0x40cd91[_0x68ef('0x14')]=qs[_0x68ef('0x14')](_0x3ee069[_0x68ef('0x2c')][_0x68ef('0x14')]);_0x40cd91[_0x68ef('0x12')]=qs['offset'](_0x3ee069['query'][_0x68ef('0x12')]);}return _0x794d1e[_0x68ef('0xaf')](_0x40cd91);}})[_0x68ef('0x18')](function(_0x23946d){if(_0x23946d){return _0x23946d?{'count':_0x266f6c,'rows':_0x23946d}:null;}})[_0x68ef('0x18')](respondWithResult(_0x5f49e9,null))[_0x68ef('0x2f')](handleError(_0x5f49e9,null));};exports[_0x68ef('0xb0')]=function(_0xcc1765,_0x29662c){var _0x1185bd;return db[_0x68ef('0x28')][_0x68ef('0x20')]({'where':{'id':_0xcc1765['params']['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x29662c,null))['then'](function(_0x30876d){if(_0x30876d){return _0x30876d[_0x68ef('0xb0')](_0xcc1765[_0x68ef('0x3a')][_0x68ef('0x75')],_['omit'](_0xcc1765[_0x68ef('0x3a')],[_0x68ef('0x75'),'id'])||{});}return null;})[_0x68ef('0x8b')](function(_0x295b66){var _0x3455b5;_0x1185bd=_0x295b66||[];var _0xbf2168=[];if(_0x295b66){for(var _0x4cf8b6=0x0;_0x4cf8b6<_0x295b66[_0x68ef('0x36')];_0x4cf8b6+=0x1){var _0x4e3f0a=_0x295b66[_0x4cf8b6][_0x68ef('0x3c')]({'plain':!![]});_0x3455b5=squel[_0x68ef('0x94')]()[_0x68ef('0xa3')](_0x68ef('0xb1'))[_0x68ef('0x96')]([_0x68ef('0x9a'),'ContactId','ListId','VoiceQueueId',_0x68ef('0x45'),_0x68ef('0x44')],squel['select']()[_0x68ef('0x77')](_0x68ef('0x9a'),_0x68ef('0x9a'))[_0x68ef('0x77')]('id','ContactId')[_0x68ef('0x77')](_0x4e3f0a[_0x68ef('0x9b')][_0x68ef('0x80')](),_0x68ef('0x99'))[_0x68ef('0x77')](_0xcc1765[_0x68ef('0x49')]['id'][_0x68ef('0x80')](),_0x68ef('0x57'))[_0x68ef('0x77')](_0x68ef('0xb2'),'createdAt')[_0x68ef('0x77')](_0x68ef('0xb2'),_0x68ef('0x44'))[_0x68ef('0x79')]('cm_contacts')[_0x68ef('0x51')](_0x68ef('0x9d'))[_0x68ef('0x51')](_0x68ef('0x9e'),_0x4e3f0a['CmListId'][_0x68ef('0x80')]())[_0x68ef('0x51')](_0x68ef('0x9f')))['toString']();_0xbf2168['push'](db['sequelize'][_0x68ef('0x2c')](_0x3455b5));}return BPromise['all'](_0xbf2168);}})['then'](function(){return _0x1185bd;})[_0x68ef('0x18')](respondWithResult(_0x29662c,null))['catch'](handleError(_0x29662c,null));};exports[_0x68ef('0xb3')]=function(_0x398899,_0x8dd212){return db[_0x68ef('0x28')]['find']({'where':{'id':_0x398899[_0x68ef('0x49')]['id']}})[_0x68ef('0x18')](handleEntityNotFound(_0x8dd212,null))[_0x68ef('0x18')](function(_0x57d305){if(_0x57d305){return _0x57d305[_0x68ef('0xb3')](_0x398899[_0x68ef('0x2c')][_0x68ef('0x75')]);}})['then'](function(_0x4c6756){if(_0x4c6756){return db[_0x68ef('0x5b')]['destroy']({'where':{'ListId':_0x398899[_0x68ef('0x2c')]['ids'],'VoiceQueueId':_0x398899['params']['id']}})['then'](function(){return _0x4c6756;});}})[_0x68ef('0x18')](respondWithStatusCode(_0x8dd212,null))[_0x68ef('0x2f')](handleError(_0x8dd212,null));}; \ No newline at end of file +var _0x3e74=['phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','insert','into','fromQuery','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','ListId\x20=\x20?','cm_hopper_additional_phones','CmHopperId','OrderBy','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','PHONE','removeLists','getBlackLists','addBlackLists','NOW()','removeBlackLists','moment','util','lodash','squel','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','end','json','offset','undefined','count','limit','Content-Range','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','map','value','includes','type','UserProfileResource','sendStatus','stack','name','status','send','index','VoiceQueue','rawAttributes','fieldName','key','getOptions','where','include','query','findAll','catch','show','intersection','model','attributes','fields','length','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','error','clone','params','keys','omit','updatedAt','createdAt','outbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','findOne','CmHopper','hasOwnProperty','nolimit','sort','filters','pick','VoiceQueueId','options','rows','CmHopperHistory','getHopperFinals','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','teams','online','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','addTeams','each','upsert','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','removeTeams','ids','User','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','every','all','union','compact','isEmpty','userVoiceQueue:remove','addAgents','removeAgents','getAgents','getMembers','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','phone','scheduledAt','field','ContactId','CmListId','toString','ListId','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?'];(function(_0x780d36,_0x285189){var _0x4ac128=function(_0x1b157f){while(--_0x1b157f){_0x780d36['push'](_0x780d36['shift']());}};_0x4ac128(++_0x285189);}(_0x3e74,0x175));var _0x43e7=function(_0x1aefb6,_0x5891a3){_0x1aefb6=_0x1aefb6-0x0;var _0x3d1e01=_0x3e74[_0x1aefb6];return _0x3d1e01;};'use strict';var moment=require(_0x43e7('0x0'));var BPromise=require('bluebird');var util=require(_0x43e7('0x1'));var _=require(_0x43e7('0x2'));var squel=require(_0x43e7('0x3'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0x43e7('0x4'))('api');var config=require(_0x43e7('0x5'));var db=require(_0x43e7('0x6'))['db'];config[_0x43e7('0x7')]=_[_0x43e7('0x8')](config[_0x43e7('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x43e7('0x9'))(new Redis(config[_0x43e7('0x7')]));require(_0x43e7('0xa'))[_0x43e7('0xb')](socket);function respondWithStatusCode(_0x21f491,_0x516b4d){_0x516b4d=_0x516b4d||0xcc;return function(_0x212c6c){if(_0x212c6c){return _0x21f491['sendStatus'](_0x516b4d);}return _0x21f491['status'](_0x516b4d)[_0x43e7('0xc')]();};}function respondWithResult(_0x4139c9,_0x5c34f4){_0x5c34f4=_0x5c34f4||0xc8;return function(_0x2803d9){if(_0x2803d9){return _0x4139c9['status'](_0x5c34f4)[_0x43e7('0xd')](_0x2803d9);}};}function respondWithFilteredResult(_0x37302c,_0x4ebc8e){return function(_0x3eb206){if(_0x3eb206){var _0xc960ea=typeof _0x4ebc8e[_0x43e7('0xe')]===_0x43e7('0xf')&&typeof _0x4ebc8e['limit']==='undefined';var _0x2fcb36=_0x3eb206[_0x43e7('0x10')];var _0x44b0bd=_0xc960ea?0x0:_0x4ebc8e['offset'];var _0x5e641c=_0xc960ea?_0x3eb206[_0x43e7('0x10')]:_0x4ebc8e[_0x43e7('0xe')]+_0x4ebc8e[_0x43e7('0x11')];var _0x328445;if(_0x5e641c>=_0x2fcb36){_0x5e641c=_0x2fcb36;_0x328445=0xc8;}else{_0x328445=0xce;}_0x37302c['status'](_0x328445);return _0x37302c['set'](_0x43e7('0x12'),_0x44b0bd+'-'+_0x5e641c+'/'+_0x2fcb36)[_0x43e7('0xd')](_0x3eb206);}return null;};}function saveUpdates(_0x273a32){return function(_0x5d346f){if(_0x5d346f){return _0x5d346f['update'](_0x273a32)[_0x43e7('0x13')](function(_0x1ca758){return _0x1ca758;});}return null;};}function removeEntity(_0x9037d3){return function(_0x140657){if(_0x140657){return _0x140657[_0x43e7('0x14')]()[_0x43e7('0x13')](function(){var _0x619236=_0x140657[_0x43e7('0x15')]({'plain':!![]});var _0x2377a3=[{'name':_0x43e7('0x16'),'value':_0x43e7('0x17'),'ignore':![]},{'name':_0x43e7('0x18'),'value':'outbound','ignore':![]}];var _0xef1a5a=_(_0x2377a3)[_0x43e7('0x19')]('ignore')[_0x43e7('0x1a')](_0x43e7('0x1b'))[_0x43e7('0x1b')]();if(_[_0x43e7('0x1c')](_0xef1a5a,_0x619236[_0x43e7('0x1d')])){return;}var _0x2f4cb4=_['find'](_0x2377a3,[_0x43e7('0x1b'),_0x619236['type']])['name'];return db[_0x43e7('0x1e')][_0x43e7('0x14')]({'where':{'type':_0x2f4cb4,'resourceId':_0x619236['id']}})['then'](function(){return _0x140657;});})[_0x43e7('0x13')](function(){_0x9037d3['status'](0xcc)[_0x43e7('0xc')]();});}};}function handleEntityNotFound(_0x5c5e67){return function(_0x1af208){if(!_0x1af208){_0x5c5e67[_0x43e7('0x1f')](0x194);}return _0x1af208;};}function handleError(_0x20888b,_0x405f85){_0x405f85=_0x405f85||0x1f4;return function(_0x51f4d7){logger['error'](_0x51f4d7[_0x43e7('0x20')]);if(_0x51f4d7['name']){delete _0x51f4d7[_0x43e7('0x21')];}_0x20888b[_0x43e7('0x22')](_0x405f85)[_0x43e7('0x23')](_0x51f4d7);};}exports[_0x43e7('0x24')]=function(_0x5087d7,_0x33a1a5){var _0x4690a6={};var _0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x1a')](db[_0x43e7('0x25')][_0x43e7('0x26')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x27')],'type':_0x31b2a6[_0x43e7('0x1d')][_0x43e7('0x28')]};});_0x4690a6=qs[_0x43e7('0x29')](_0x50f9f5,_0x5087d7);var _0x2bde44={'where':_0x4690a6[_0x43e7('0x2a')]};return db['VoiceQueue'][_0x43e7('0x10')](_0x2bde44)[_0x43e7('0x13')](function(_0x3b8f78){_0x45b675[_0x43e7('0x10')]=_0x3b8f78;_0x4690a6[_0x43e7('0x2b')]=qs['include'](_0x5087d7[_0x43e7('0x2c')]);return db[_0x43e7('0x25')][_0x43e7('0x2d')](_0x4690a6);})[_0x43e7('0x13')](function(_0x4c61b9){_0x45b675['rows']=_0x4c61b9;return _0x45b675;})['then'](respondWithFilteredResult(_0x33a1a5,_0x4690a6))[_0x43e7('0x2e')](handleError(_0x33a1a5,null));};exports[_0x43e7('0x2f')]=function(_0x117c07,_0x234fe6){var _0x108313={'raw':![],'where':{'id':_0x117c07['params']['id']}},_0xde7ed={};_0xde7ed['model']=_['keys'](db['VoiceQueue']['rawAttributes']);_0xde7ed['query']=_['keys'](_0x117c07[_0x43e7('0x2c')]);_0xde7ed['filters']=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],_0xde7ed[_0x43e7('0x2c')]);_0x108313[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0xde7ed[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x117c07['query']['fields']));_0x108313['attributes']=_0x108313[_0x43e7('0x32')][_0x43e7('0x34')]?_0x108313[_0x43e7('0x32')]:_0xde7ed[_0x43e7('0x31')];if(_0x117c07[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x108313[_0x43e7('0x2b')]=[{'all':!![]}];}_0x108313=_[_0x43e7('0x36')]({},_0x108313,_0x117c07['options']);return db[_0x43e7('0x25')][_0x43e7('0x37')](_0x108313)['then'](handleEntityNotFound(_0x234fe6,null))[_0x43e7('0x13')](respondWithResult(_0x234fe6,null))['catch'](handleError(_0x234fe6,null));};exports[_0x43e7('0x38')]=function(_0x2ad008,_0x1c6f45){return db[_0x43e7('0x25')][_0x43e7('0x38')](_0x2ad008[_0x43e7('0x39')],{})['then'](function(_0x574a93){var _0x30dfa9=_0x2ad008[_0x43e7('0x3a')][_0x43e7('0x15')]({'plain':!![]});if(!_0x30dfa9)throw new Error(_0x43e7('0x3b'));if(_0x30dfa9[_0x43e7('0x3c')]==='user'){var _0x32a451=_0x574a93[_0x43e7('0x15')]({'plain':!![]});var _0x575439=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':_0x43e7('0x18'),'value':'outbound'}];var _0x3d81ae=_[_0x43e7('0x37')](_0x575439,[_0x43e7('0x1b'),_0x32a451[_0x43e7('0x1d')]])['name'];return db['UserProfileSection'][_0x43e7('0x37')]({'where':{'name':_0x3d81ae,'userProfileId':_0x30dfa9[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x36b770){if(_0x36b770&&_0x36b770['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x32a451[_0x43e7('0x21')],'resourceId':_0x32a451['id'],'type':_0x36b770['name'],'sectionId':_0x36b770['id']},{})[_0x43e7('0x13')](function(){return _0x574a93;});}else{return _0x574a93;}})['catch'](function(_0x5b28db){logger[_0x43e7('0x3e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b28db);throw _0x5b28db;});}return _0x574a93;})[_0x43e7('0x13')](respondWithResult(_0x1c6f45,0xc9))[_0x43e7('0x2e')](handleError(_0x1c6f45,null));};exports[_0x43e7('0x3f')]=function(_0x99b9e1,_0x4fc5e8){var _0x91f1e4={'where':{'id':_0x99b9e1[_0x43e7('0x40')]['id']}},_0x2b9046={};_0x2b9046[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x25')]['rawAttributes']);_0x91f1e4['attributes']=_[_0x43e7('0x30')](_0x2b9046[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x99b9e1['query']['fields']));_0x91f1e4['attributes']=_0x91f1e4[_0x43e7('0x32')][_0x43e7('0x34')]?_0x91f1e4['attributes']:_0x2b9046[_0x43e7('0x31')];if(_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x91f1e4['include']=[{'all':!![]}];}_0x91f1e4=_['merge']({},_0x91f1e4,_0x99b9e1['options']);return db['VoiceQueue'][_0x43e7('0x37')](_0x91f1e4)[_0x43e7('0x13')](handleEntityNotFound(_0x4fc5e8,null))['then'](function(_0x23e7cb){if(_0x23e7cb){var _0x82d32f=_0x23e7cb[_0x43e7('0x15')]({'plain':!![]});_0x82d32f=qs[_0x43e7('0x42')](_0x82d32f,['id','createdAt',_0x43e7('0x43')]);_0x99b9e1['body']=_['omit'](_0x99b9e1[_0x43e7('0x39')],['id',_0x43e7('0x44'),_0x43e7('0x43')]);return db[_0x43e7('0x25')][_0x43e7('0x38')](_[_0x43e7('0x36')](_0x82d32f,_0x99b9e1[_0x43e7('0x39')]),{'include':_0x99b9e1[_0x43e7('0x2c')][_0x43e7('0x35')]?[{'all':!![]}]:undefined})[_0x43e7('0x13')](function(_0x58dfd0){var _0x119d34=_0x99b9e1[_0x43e7('0x3a')]['get']({'plain':!![]});if(!_0x119d34)throw new Error(_0x43e7('0x3b'));if(_0x119d34['role']===_0x43e7('0x3a')){var _0x520857=_0x58dfd0[_0x43e7('0x15')]({'plain':!![]});var _0x1f561f=[{'name':_0x43e7('0x16'),'value':'inbound'},{'name':'QueueCampaigns','value':_0x43e7('0x45')}];var _0x2ab7ee=_[_0x43e7('0x37')](_0x1f561f,[_0x43e7('0x1b'),_0x520857[_0x43e7('0x1d')]])[_0x43e7('0x21')];return db[_0x43e7('0x46')][_0x43e7('0x37')]({'where':{'name':_0x2ab7ee,'userProfileId':_0x119d34[_0x43e7('0x3d')]},'raw':!![]})[_0x43e7('0x13')](function(_0x312306){if(_0x312306&&_0x312306['autoAssociation']===0x0){return db[_0x43e7('0x1e')][_0x43e7('0x38')]({'name':_0x520857['name'],'resourceId':_0x520857['id'],'type':_0x312306[_0x43e7('0x21')],'sectionId':_0x312306['id']},{})[_0x43e7('0x13')](function(){return _0x58dfd0;});}else{return _0x58dfd0;}})[_0x43e7('0x2e')](function(_0x558d54){logger['error'](_0x43e7('0x47'),_0x558d54);throw _0x558d54;});}return _0x58dfd0;});}})[_0x43e7('0x13')](respondWithResult(_0x4fc5e8,0xc9))['catch'](handleError(_0x4fc5e8,null));};exports[_0x43e7('0x48')]=function(_0x54506d,_0x49a6ce){if(_0x54506d[_0x43e7('0x39')]['id']){delete _0x54506d[_0x43e7('0x39')]['id'];}return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x54506d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x49a6ce,null))[_0x43e7('0x13')](saveUpdates(_0x54506d[_0x43e7('0x39')],null))['then'](respondWithResult(_0x49a6ce,null))[_0x43e7('0x2e')](handleError(_0x49a6ce,null));};exports[_0x43e7('0x14')]=function(_0x296a0d,_0x5bb536){return db['VoiceQueue']['find']({'where':{'id':_0x296a0d[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x5bb536,null))[_0x43e7('0x13')](removeEntity(_0x5bb536,null))[_0x43e7('0x2e')](handleError(_0x5bb536,null));};exports['getHoppers']=function(_0x5a50fc,_0x1b27da){var _0x8b50bb={'raw':![],'where':{}};var _0x140438={};var _0x5dd349={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x5a50fc[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1b27da,null))[_0x43e7('0x13')](function(_0x3369b8){if(_0x3369b8){_0x140438[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x4a')][_0x43e7('0x26')]);_0x140438[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x5a50fc['query']);_0x140438['filters']=_[_0x43e7('0x30')](_0x140438['model'],_0x140438['query']);_0x8b50bb['attributes']=_[_0x43e7('0x30')](_0x140438[_0x43e7('0x31')],qs['fields'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x8b50bb[_0x43e7('0x32')]=_0x8b50bb['attributes'][_0x43e7('0x34')]?_0x8b50bb[_0x43e7('0x32')]:_0x140438[_0x43e7('0x31')];if(!_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x8b50bb[_0x43e7('0x11')]=qs['limit'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x8b50bb[_0x43e7('0xe')]=qs['offset'](_0x5a50fc['query'][_0x43e7('0xe')]);}_0x8b50bb['order']=qs['sort'](_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x8b50bb['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x5a50fc[_0x43e7('0x2c')],_0x140438[_0x43e7('0x4e')]));_0x8b50bb[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x3369b8['id'];if(_0x5a50fc[_0x43e7('0x2c')]['filter']){_0x8b50bb[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x8b50bb['where'],{'$or':_[_0x43e7('0x1a')](_0x8b50bb['attributes'],function(_0x26ee52){var _0x248936={};_0x248936[_0x26ee52]={'$like':'%'+_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x248936;})});}_0x8b50bb=_['merge']({},_0x8b50bb,_0x5a50fc[_0x43e7('0x51')]);return db[_0x43e7('0x4a')][_0x43e7('0x10')]({'where':_0x8b50bb['where']})[_0x43e7('0x13')](function(_0x38fa5b){_0x5dd349[_0x43e7('0x10')]=_0x38fa5b;if(_0x5a50fc[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x8b50bb['include']=[{'all':!![]}];}return db[_0x43e7('0x4a')][_0x43e7('0x2d')](_0x8b50bb);})[_0x43e7('0x13')](function(_0x2499ef){_0x5dd349[_0x43e7('0x52')]=_0x2499ef;return _0x5dd349;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x1b27da,_0x8b50bb))[_0x43e7('0x2e')](handleError(_0x1b27da,null));};exports['getHopperHistories']=function(_0x499ee9,_0x405faa){var _0x536477={'raw':!![],'where':{}};var _0x550036={};var _0x5b98bf={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x499ee9[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x405faa,null))[_0x43e7('0x13')](function(_0x1ae0c8){if(_0x1ae0c8){_0x550036['model']=_[_0x43e7('0x41')](db[_0x43e7('0x53')][_0x43e7('0x26')]);_0x550036['query']=_[_0x43e7('0x41')](_0x499ee9[_0x43e7('0x2c')]);_0x550036[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x550036[_0x43e7('0x31')],_0x550036[_0x43e7('0x2c')]);_0x536477[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x550036['model'],qs['fields'](_0x499ee9['query'][_0x43e7('0x33')]));_0x536477[_0x43e7('0x32')]=_0x536477['attributes'][_0x43e7('0x34')]?_0x536477[_0x43e7('0x32')]:_0x550036[_0x43e7('0x31')];if(!_0x499ee9[_0x43e7('0x2c')]['hasOwnProperty']('nolimit')){_0x536477['limit']=qs[_0x43e7('0x11')](_0x499ee9[_0x43e7('0x2c')]['limit']);_0x536477['offset']=qs[_0x43e7('0xe')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x536477['order']=qs[_0x43e7('0x4d')](_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x536477[_0x43e7('0x2a')]=qs['filters'](_[_0x43e7('0x4f')](_0x499ee9['query'],_0x550036[_0x43e7('0x4e')]));_0x536477[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1ae0c8['id'];if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x536477[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x536477['where'],{'$or':_[_0x43e7('0x1a')](_0x536477[_0x43e7('0x32')],function(_0x1aea4e){var _0x6fb694={};_0x6fb694[_0x1aea4e]={'$like':'%'+_0x499ee9['query']['filter']+'%'};return _0x6fb694;})});}_0x536477=_['merge']({},_0x536477,_0x499ee9[_0x43e7('0x51')]);return db['CmHopperHistory'][_0x43e7('0x10')]({'where':_0x536477[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x7387f6){_0x5b98bf[_0x43e7('0x10')]=_0x7387f6;if(_0x499ee9[_0x43e7('0x2c')][_0x43e7('0x35')]){_0x536477[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x53')][_0x43e7('0x2d')](_0x536477);})[_0x43e7('0x13')](function(_0x5b3565){_0x5b98bf[_0x43e7('0x52')]=_0x5b3565;return _0x5b98bf;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x405faa,_0x536477))[_0x43e7('0x2e')](handleError(_0x405faa,null));};exports[_0x43e7('0x54')]=function(_0x206e54,_0x4ea4a9){var _0x5e04ec={'raw':!![],'where':{}};var _0x162a27={};var _0x3e3c82={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x206e54[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4ea4a9,null))['then'](function(_0x1e869a){if(_0x1e869a){_0x162a27[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x55')][_0x43e7('0x26')]);_0x162a27['query']=_['keys'](_0x206e54[_0x43e7('0x2c')]);_0x162a27[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],_0x162a27['query']);_0x5e04ec[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x162a27[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x206e54['query'][_0x43e7('0x33')]));_0x5e04ec[_0x43e7('0x32')]=_0x5e04ec[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5e04ec[_0x43e7('0x32')]:_0x162a27['model'];if(!_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0x5e04ec[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5e04ec['offset']=qs[_0x43e7('0xe')](_0x206e54['query'][_0x43e7('0xe')]);}_0x5e04ec[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x206e54[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5e04ec[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x206e54[_0x43e7('0x2c')],_0x162a27['filters']));_0x5e04ec[_0x43e7('0x2a')][_0x43e7('0x50')]=_0x1e869a['id'];if(_0x206e54[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x5e04ec['where']=_['merge'](_0x5e04ec[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5e04ec[_0x43e7('0x32')],function(_0x4d30f7){var _0x12e7a8={};_0x12e7a8[_0x4d30f7]={'$like':'%'+_0x206e54['query']['filter']+'%'};return _0x12e7a8;})});}_0x5e04ec=_['merge']({},_0x5e04ec,_0x206e54[_0x43e7('0x51')]);return db['CmHopperFinal'][_0x43e7('0x10')]({'where':_0x5e04ec[_0x43e7('0x2a')]})[_0x43e7('0x13')](function(_0x2fea54){_0x3e3c82[_0x43e7('0x10')]=_0x2fea54;if(_0x206e54['query']['includeAll']){_0x5e04ec[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x55')]['findAll'](_0x5e04ec);})[_0x43e7('0x13')](function(_0x10fd28){_0x3e3c82[_0x43e7('0x52')]=_0x10fd28;return _0x3e3c82;});}})[_0x43e7('0x13')](respondWithFilteredResult(_0x4ea4a9,_0x5e04ec))[_0x43e7('0x2e')](handleError(_0x4ea4a9,null));};exports[_0x43e7('0x57')]=function(_0x399253,_0x32e698){var _0x39ce5e={'raw':!![],'where':{}};var _0x284617={};var _0x610819={'count':0x0,'rows':[]};return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x399253[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x32e698,null))[_0x43e7('0x13')](function(_0x3286b1){if(_0x3286b1){_0x284617[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x58')][_0x43e7('0x26')]);_0x284617[_0x43e7('0x2c')]=_['keys'](_0x399253[_0x43e7('0x2c')]);_0x284617[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x284617[_0x43e7('0x31')],_0x284617['query']);_0x39ce5e[_0x43e7('0x32')]=_['intersection'](_0x284617[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x399253[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x39ce5e[_0x43e7('0x32')]=_0x39ce5e[_0x43e7('0x32')]['length']?_0x39ce5e[_0x43e7('0x32')]:_0x284617[_0x43e7('0x31')];if(!_0x399253[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x39ce5e['limit']=qs['limit'](_0x399253[_0x43e7('0x2c')]['limit']);_0x39ce5e[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x399253[_0x43e7('0x2c')][_0x43e7('0xe')]);}_0x39ce5e['order']=qs['sort'](_0x399253['query'][_0x43e7('0x4d')]);_0x39ce5e['where']=qs['filters'](_['pick'](_0x399253[_0x43e7('0x2c')],_0x284617[_0x43e7('0x4e')]));_0x39ce5e['where'][_0x43e7('0x50')]=_0x3286b1['id'];if(_0x399253['query'][_0x43e7('0x19')]){_0x39ce5e[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x39ce5e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x39ce5e['attributes'],function(_0x1f4162){var _0x449cb4={};_0x449cb4[_0x1f4162]={'$like':'%'+_0x399253[_0x43e7('0x2c')]['filter']+'%'};return _0x449cb4;})});}_0x39ce5e=_['merge']({},_0x39ce5e,_0x399253[_0x43e7('0x51')]);return db[_0x43e7('0x58')][_0x43e7('0x10')]({'where':_0x39ce5e[_0x43e7('0x2a')]})['then'](function(_0x385cc1){_0x610819[_0x43e7('0x10')]=_0x385cc1;if(_0x399253[_0x43e7('0x2c')]['includeAll']){_0x39ce5e[_0x43e7('0x2b')]=[{'all':!![]}];}return db[_0x43e7('0x58')][_0x43e7('0x2d')](_0x39ce5e);})[_0x43e7('0x13')](function(_0x541ce8){_0x610819[_0x43e7('0x52')]=_0x541ce8;return _0x610819;});}})['then'](respondWithFilteredResult(_0x32e698,_0x39ce5e))[_0x43e7('0x2e')](handleError(_0x32e698,null));};exports[_0x43e7('0x59')]=function(_0x47f29f,_0x4e5484){var _0xc62dc9={};var _0x1480c6={};var _0x21d001;var _0x4600e5;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x47f29f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x4e5484,null))[_0x43e7('0x13')](function(_0xfc577b){if(_0xfc577b){_0x21d001=_0xfc577b;_0x1480c6[_0x43e7('0x31')]=_['keys'](db[_0x43e7('0x5a')]['rawAttributes']);_0x1480c6[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x47f29f[_0x43e7('0x2c')]);_0x1480c6['filters']=_[_0x43e7('0x30')](_0x1480c6[_0x43e7('0x31')],_0x1480c6[_0x43e7('0x2c')]);_0xc62dc9[_0x43e7('0x32')]=_['intersection'](_0x1480c6[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x47f29f['query']['fields']));_0xc62dc9['attributes']=_0xc62dc9[_0x43e7('0x32')][_0x43e7('0x34')]?_0xc62dc9[_0x43e7('0x32')]:_0x1480c6[_0x43e7('0x31')];_0xc62dc9[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0xc62dc9['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x47f29f[_0x43e7('0x2c')],_0x1480c6[_0x43e7('0x4e')]));if(_0x47f29f['query']['filter']){_0xc62dc9[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0xc62dc9[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0xc62dc9['attributes'],function(_0x2f529b){var _0x427cec={};_0x427cec[_0x2f529b]={'$like':'%'+_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x427cec;})});}_0xc62dc9=_[_0x43e7('0x36')]({},_0xc62dc9,_0x47f29f[_0x43e7('0x51')]);return _0x21d001['getTeams'](_0xc62dc9);}})[_0x43e7('0x13')](function(_0x52c974){if(_0x52c974){_0x4600e5=_0x52c974['length'];if(!_0x47f29f[_0x43e7('0x2c')][_0x43e7('0x4b')]('nolimit')){_0xc62dc9['limit']=qs[_0x43e7('0x11')](_0x47f29f[_0x43e7('0x2c')]['limit']);_0xc62dc9[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x47f29f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x21d001['getTeams'](_0xc62dc9);}})['then'](function(_0x2a084b){if(_0x2a084b){return _0x2a084b?{'count':_0x4600e5,'rows':_0x2a084b}:null;}})[_0x43e7('0x13')](respondWithResult(_0x4e5484,null))[_0x43e7('0x2e')](handleError(_0x4e5484,null));};exports['addTeams']=function(_0x49de67,_0x298239){var _0xf682ec=_0x49de67[_0x43e7('0x39')][_0x43e7('0x5b')];var _0x1e247f=_[_0x43e7('0x1a')](_0xf682ec,'id');return db[_0x43e7('0x5a')][_0x43e7('0x2d')]({'where':{'id':_0x1e247f},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name',_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]}]})[_0x43e7('0x13')](function(_0x44fee0){if(_0x44fee0){var _0x41d130=_[_0x43e7('0x5e')](_0x44fee0,function(_0x5e87d6){var _0x21039a=_0x5e87d6[_0x43e7('0x15')]({'plain':!![]});_0x21039a[_0x43e7('0x5f')][_0x43e7('0x60')](function(_0x59f68a){_0x59f68a[_0x43e7('0x61')]=_[_0x43e7('0x37')](_0xf682ec,{'id':_0x21039a['id']})[_0x43e7('0x61')];});return _0x21039a[_0x43e7('0x5f')];});return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x49de67[_0x43e7('0x40')]['id']}})['then'](function(_0xc9356c){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0x3637d9){return _0xc9356c[_0x43e7('0x64')](_0x1e247f,{'transaction':_0x3637d9})['then'](function(){return BPromise[_0x43e7('0x65')](_0xf682ec,function(_0x25ddf8){return db['TeamVoiceQueue'][_0x43e7('0x66')]({'TeamId':_0x25ddf8['id'],'VoiceQueueId':_0x49de67[_0x43e7('0x40')]['id'],'penalty':_0x25ddf8['penalty']},{'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_0x41d130,function(_0x110154){return db[_0x43e7('0x67')][_0x43e7('0x68')]({'where':{'UserId':_0x110154['id'],'VoiceQueueId':_0x49de67['params']['id']},'defaults':{'penalty':_0x110154[_0x43e7('0x61')]},'transaction':_0x3637d9});});})[_0x43e7('0x13')](function(){return BPromise[_0x43e7('0x65')](_['filter'](_0x41d130,{'online':!![]}),function(_0x32b788){return db[_0x43e7('0x69')]['upsert']({'membername':_0x32b788[_0x43e7('0x21')],'UserId':_0x32b788['id'],'queue_name':_0xc9356c[_0x43e7('0x21')],'VoiceQueueId':_0xc9356c['id'],'interface':_[_0x43e7('0x6a')](_0x32b788[_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x32b788['name']):_0x32b788[_0x43e7('0x5d')],'paused':_0x32b788[_0x43e7('0x6d')]||![],'penalty':_0x32b788[_0x43e7('0x61')]},{'transaction':_0x3637d9});});})['then'](function(){_0x41d130[_0x43e7('0x60')](function(_0x21901c){socket[_0x43e7('0x6e')](_0x43e7('0x6f'),{'UserId':_0x21901c['id'],'VoiceQueueId':_0xc9356c['id']});});});});});}})[_0x43e7('0x13')](respondWithStatusCode(_0x298239,null))[_0x43e7('0x2e')](handleError(_0x298239,null));};exports[_0x43e7('0x70')]=function(_0x1896b3,_0x4345a5){return db['Team'][_0x43e7('0x2d')]({'where':{'id':_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')]},'attributes':['id'],'include':[{'model':db[_0x43e7('0x72')],'as':_0x43e7('0x5f'),'attributes':['id'],'raw':!![]}]})[_0x43e7('0x13')](handleEntityNotFound(_0x4345a5,null))[_0x43e7('0x13')](function(_0x3e8631){var _0x51e17c=_[_0x43e7('0x1a')](_0x3e8631,'id');var _0x6246c4=[];var _0xd0dca2=[];var _0xa721ba=squel[_0x43e7('0x73')]();_0xa721ba['field'](_0x43e7('0x74'))[_0x43e7('0x75')](_0x43e7('0x76'),'tq')[_0x43e7('0x77')](_0x43e7('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x1896b3[_0x43e7('0x40')]['id']);for(var _0x339826=0x0;_0x339826<_0x3e8631[_0x43e7('0x34')];_0x339826+=0x1){let _0xc28ac6=_0x3e8631[_0x339826];for(var _0x4b0abd=0x0;_0x4b0abd<_0xc28ac6[_0x43e7('0x5f')][_0x43e7('0x34')];_0x4b0abd+=0x1){let _0x41d636=_0xc28ac6[_0x43e7('0x5f')][_0x4b0abd];var _0x19bdf7=_0xa721ba[_0x43e7('0x3f')]();_0x19bdf7[_0x43e7('0x2a')](_0x43e7('0x79'),_0x41d636['id']);_0xd0dca2[_0x43e7('0x7a')](db[_0x43e7('0x62')][_0x43e7('0x2c')](_0x19bdf7['toString'](),{'type':db['sequelize'][_0x43e7('0x7b')]['SELECT']})['then'](function(_0x4a0d5d){if(_0x4a0d5d[_0x43e7('0x34')]===0x1){return _0x41d636['id'];}else{var _0x5eae45=_[_0x43e7('0x7c')](_['map'](_0x4a0d5d,'TeamId'),function(_0x55f1df){return _[_0x43e7('0x1c')](_0x51e17c,_0x55f1df);});if(_0x5eae45){return _0x41d636['id'];}}}));}}return BPromise[_0x43e7('0x7d')](_0xd0dca2)[_0x43e7('0x13')](function(_0xd6ebb0){_0x6246c4=_(_0x6246c4)[_0x43e7('0x7e')](_0xd6ebb0)[_0x43e7('0x7f')]()[_0x43e7('0x1b')]();return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1896b3[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](function(_0x2a1218){return db[_0x43e7('0x62')][_0x43e7('0x63')](function(_0xe14e67){return _0x2a1218[_0x43e7('0x70')](_0x1896b3[_0x43e7('0x2c')][_0x43e7('0x71')],{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){if(!_[_0x43e7('0x80')](_0x6246c4)){return _0x2a1218['removeAgents'](_0x6246c4,{'transaction':_0xe14e67})[_0x43e7('0x13')](function(){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x1896b3[_0x43e7('0x40')]['id'],'UserId':_0x6246c4},'transaction':_0xe14e67});});}})[_0x43e7('0x13')](function(){_0x6246c4[_0x43e7('0x60')](function(_0x32b33c){socket['emit'](_0x43e7('0x81'),{'UserId':_0x32b33c,'VoiceQueueId':_0x2a1218['id']});});});});});});})[_0x43e7('0x13')](respondWithStatusCode(_0x4345a5,null))['catch'](handleError(_0x4345a5,null));};exports[_0x43e7('0x82')]=function(_0x1a520e,_0xb4cf23){var _0x559145,_0x22b824;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1a520e[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0xb4cf23,null))['then'](function(_0x33b63b){if(_0x33b63b){_0x22b824=_0x33b63b;return _0x33b63b[_0x43e7('0x82')](_0x1a520e['body'][_0x43e7('0x71')],_['omit'](_0x1a520e['body'],['ids','id'])||{})['spread'](function(_0x255113){for(var _0x451fb5=0x0;_0x451fb5<_0x1a520e[_0x43e7('0x39')][_0x43e7('0x71')]['length'];_0x451fb5+=0x1){socket['emit'](_0x43e7('0x6f'),{'UserId':Number(_0x1a520e['body'][_0x43e7('0x71')][_0x451fb5]),'VoiceQueueId':Number(_0x1a520e['params']['id'])});}return _0x255113;});}})[_0x43e7('0x13')](function(_0x4cf7e9){_0x559145=_0x4cf7e9||[];if(_0x22b824){return db['User']['findAll']({'where':{'id':_0x1a520e['body'][_0x43e7('0x71')]},'attributes':['id',_0x43e7('0x21'),_0x43e7('0x5c'),'voicePause',_0x43e7('0x5d')],'raw':!![]});}})[_0x43e7('0x13')](function(_0x517289){if(!_['isEmpty'](_0x517289)){var _0x25fd39=[];for(var _0xb2aca0=0x0;_0xb2aca0<_0x517289[_0x43e7('0x34')];_0xb2aca0++){if(_0x517289[_0xb2aca0][_0x43e7('0x5c')]){_0x25fd39['push'](db[_0x43e7('0x69')]['upsert']({'membername':_0x517289[_0xb2aca0][_0x43e7('0x21')],'UserId':_0x517289[_0xb2aca0]['id'],'queue_name':_0x22b824[_0x43e7('0x21')],'VoiceQueueId':_0x22b824['id'],'interface':_[_0x43e7('0x6a')](_0x517289[_0xb2aca0][_0x43e7('0x5d')])?util[_0x43e7('0x6b')](_0x43e7('0x6c'),_0x517289[_0xb2aca0][_0x43e7('0x21')]):_0x517289[_0xb2aca0]['interface'],'paused':_0x517289[_0xb2aca0][_0x43e7('0x6d')]||![],'penalty':_0x1a520e[_0x43e7('0x39')]['penalty']||0x0}));}}return BPromise[_0x43e7('0x7d')](_0x25fd39);}})[_0x43e7('0x13')](function(){return _0x559145;})[_0x43e7('0x13')](respondWithResult(_0xb4cf23,null))[_0x43e7('0x2e')](handleError(_0xb4cf23,null));};exports[_0x43e7('0x83')]=function(_0x4fd17e,_0x3fd573){return db['VoiceQueue'][_0x43e7('0x37')]({'where':{'id':_0x4fd17e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3fd573,null))[_0x43e7('0x13')](function(_0x4446cb){if(_0x4446cb){return _0x4446cb[_0x43e7('0x83')](_0x4fd17e[_0x43e7('0x2c')]['ids'])[_0x43e7('0x13')](function(){if(_['isArray'](_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')])){for(var _0x34d476=0x0;_0x34d476<_0x4fd17e['query'][_0x43e7('0x71')][_0x43e7('0x34')];_0x34d476+=0x1){socket[_0x43e7('0x6e')](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')]['ids'][_0x34d476]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}}else{socket['emit'](_0x43e7('0x81'),{'UserId':Number(_0x4fd17e[_0x43e7('0x2c')][_0x43e7('0x71')]),'VoiceQueueId':Number(_0x4fd17e[_0x43e7('0x40')]['id'])});}});}})[_0x43e7('0x13')](function(_0x34ed9e){return db[_0x43e7('0x69')]['destroy']({'where':{'VoiceQueueId':_0x4fd17e[_0x43e7('0x40')]['id'],'UserId':_0x4fd17e['query'][_0x43e7('0x71')]}})[_0x43e7('0x13')](function(){return _0x34ed9e;});})[_0x43e7('0x13')](respondWithStatusCode(_0x3fd573,null))[_0x43e7('0x2e')](handleError(_0x3fd573,null));};exports[_0x43e7('0x84')]=function(_0xf9178f,_0x3bb7ab){var _0x2be8c7={};var _0x2bb14d={};var _0x57f7ea;var _0x240478;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0xf9178f[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x3bb7ab,null))[_0x43e7('0x13')](function(_0x381e47){if(_0x381e47){_0x57f7ea=_0x381e47;_0x2bb14d['model']=_[_0x43e7('0x41')](db[_0x43e7('0x72')][_0x43e7('0x26')]);_0x2bb14d[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0xf9178f[_0x43e7('0x2c')]);_0x2bb14d[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2bb14d['model'],_0x2bb14d[_0x43e7('0x2c')]);_0x2be8c7[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2bb14d['model'],qs[_0x43e7('0x33')](_0xf9178f[_0x43e7('0x2c')]['fields']));_0x2be8c7[_0x43e7('0x32')]=_0x2be8c7[_0x43e7('0x32')]['length']?_0x2be8c7[_0x43e7('0x32')]:_0x2bb14d[_0x43e7('0x31')];_0x2be8c7[_0x43e7('0x56')]=qs['sort'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x2be8c7['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0xf9178f[_0x43e7('0x2c')],_0x2bb14d[_0x43e7('0x4e')]));if(_0xf9178f['query']['filter']){_0x2be8c7[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x2be8c7[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x2be8c7['attributes'],function(_0x1e6245){var _0x36860d={};_0x36860d[_0x1e6245]={'$like':'%'+_0xf9178f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x36860d;})});}_0x2be8c7=_['merge']({},_0x2be8c7,_0xf9178f[_0x43e7('0x51')]);return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x3ff5d6){if(_0x3ff5d6){_0x240478=_0x3ff5d6[_0x43e7('0x34')];if(!_0xf9178f['query']['hasOwnProperty']('nolimit')){_0x2be8c7[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0xf9178f[_0x43e7('0x2c')]['limit']);_0x2be8c7[_0x43e7('0xe')]=qs['offset'](_0xf9178f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x57f7ea[_0x43e7('0x84')](_0x2be8c7);}})[_0x43e7('0x13')](function(_0x249a8d){if(_0x249a8d){return _0x249a8d?{'count':_0x240478,'rows':_0x249a8d}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3bb7ab,null))['catch'](handleError(_0x3bb7ab,null));};exports[_0x43e7('0x85')]=function(_0x202421,_0x12e4a3){var _0x16ca0e={};var _0x2f467b={};var _0x7f43b5;var _0x4637f6;return db[_0x43e7('0x25')][_0x43e7('0x49')]({'where':{'id':_0x202421[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x12e4a3,null))[_0x43e7('0x13')](function(_0x24e9a7){if(_0x24e9a7){_0x7f43b5=_0x24e9a7;_0x2f467b['model']=_[_0x43e7('0x41')](db[_0x43e7('0x69')]['rawAttributes']);_0x2f467b[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x202421['query']);_0x2f467b[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],_0x2f467b['query']);_0x16ca0e['attributes']=_[_0x43e7('0x30')](_0x2f467b[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x16ca0e[_0x43e7('0x32')]=_0x16ca0e[_0x43e7('0x32')][_0x43e7('0x34')]?_0x16ca0e['attributes']:_0x2f467b[_0x43e7('0x31')];_0x16ca0e[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x16ca0e[_0x43e7('0x2a')]=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x202421[_0x43e7('0x2c')],_0x2f467b[_0x43e7('0x4e')]));if(_0x202421[_0x43e7('0x2c')][_0x43e7('0x19')]){_0x16ca0e['where']=_[_0x43e7('0x36')](_0x16ca0e[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x16ca0e[_0x43e7('0x32')],function(_0x49f43c){var _0xad02f6={};_0xad02f6[_0x49f43c]={'$like':'%'+_0x202421['query'][_0x43e7('0x19')]+'%'};return _0xad02f6;})});}_0x16ca0e=_['merge']({},_0x16ca0e,_0x202421[_0x43e7('0x51')]);return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})[_0x43e7('0x13')](function(_0x4a500c){if(_0x4a500c){_0x4637f6=_0x4a500c[_0x43e7('0x34')];if(!_0x202421[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x16ca0e['limit']=qs[_0x43e7('0x11')](_0x202421[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x16ca0e[_0x43e7('0xe')]=qs['offset'](_0x202421[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x7f43b5[_0x43e7('0x85')](_0x16ca0e);}})['then'](function(_0x12c4f9){return _0x12c4f9?{'count':_0x4637f6,'rows':_0x12c4f9}:null;})[_0x43e7('0x13')](respondWithResult(_0x12e4a3,null))[_0x43e7('0x2e')](handleError(_0x12e4a3,null));};exports[_0x43e7('0x86')]=function(_0x77c2f,_0x1e4a25){var _0x5790b5={};var _0x3f057e={};var _0x505287;var _0x221938;return db[_0x43e7('0x25')]['findOne']({'where':{'id':_0x77c2f[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x1e4a25,null))['then'](function(_0x46aa47){if(_0x46aa47){_0x505287=_0x46aa47;_0x3f057e[_0x43e7('0x31')]=_[_0x43e7('0x41')](db[_0x43e7('0x87')]['rawAttributes']);_0x3f057e['query']=_[_0x43e7('0x41')](_0x77c2f[_0x43e7('0x2c')]);_0x3f057e[_0x43e7('0x4e')]=_[_0x43e7('0x30')](_0x3f057e[_0x43e7('0x31')],_0x3f057e[_0x43e7('0x2c')]);_0x5790b5[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x3f057e['model'],qs[_0x43e7('0x33')](_0x77c2f[_0x43e7('0x2c')]['fields']));_0x5790b5[_0x43e7('0x32')]=_0x5790b5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5790b5[_0x43e7('0x32')]:_0x3f057e[_0x43e7('0x31')];_0x5790b5[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x77c2f['query'][_0x43e7('0x4d')]);_0x5790b5['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x77c2f['query'],_0x3f057e[_0x43e7('0x4e')]));if(_0x77c2f['query'][_0x43e7('0x19')]){_0x5790b5[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5790b5['where'],{'$or':_['map'](_0x5790b5[_0x43e7('0x32')],function(_0xcfecd2){var _0x4cd879={};_0x4cd879[_0xcfecd2]={'$like':'%'+_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x19')]+'%'};return _0x4cd879;})});}_0x5790b5=_[_0x43e7('0x36')]({},_0x5790b5,_0x77c2f['options']);return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0xb2eb62){if(_0xb2eb62){_0x221938=_0xb2eb62['length'];if(!_0x77c2f[_0x43e7('0x2c')][_0x43e7('0x4b')](_0x43e7('0x4c'))){_0x5790b5[_0x43e7('0x11')]=qs[_0x43e7('0x11')](_0x77c2f[_0x43e7('0x2c')]['limit']);_0x5790b5[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x77c2f[_0x43e7('0x2c')][_0x43e7('0xe')]);}return _0x505287[_0x43e7('0x86')](_0x5790b5);}})[_0x43e7('0x13')](function(_0x34ab5a){if(_0x34ab5a){return _0x34ab5a?{'count':_0x221938,'rows':_0x34ab5a}:null;}})[_0x43e7('0x13')](respondWithResult(_0x1e4a25,null))[_0x43e7('0x2e')](handleError(_0x1e4a25,null));};exports[_0x43e7('0x88')]=function(_0x13133c,_0x288d6a){var _0x47ef9d=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x56598f,_0x280668;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x13133c[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x288d6a,null))[_0x43e7('0x13')](function(_0x51dc07){if(_0x51dc07){_0x280668=_0x51dc07;return _0x51dc07['addLists'](_0x13133c[_0x43e7('0x39')][_0x43e7('0x71')],_['omit'](_0x13133c['body'],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x58a783){var _0x3d6659;_0x56598f=_0x58a783||[];var _0x57bcab=[];if(_0x58a783){for(var _0x5f4023=0x0;_0x5f4023<_0x58a783[_0x43e7('0x34')];_0x5f4023+=0x1){var _0x2be66d=_0x58a783[_0x5f4023]['get']({'plain':!![]});_0x280668['dialCheckDuplicateType']=_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]?_0x13133c[_0x43e7('0x39')][_0x43e7('0x8a')]:_0x280668['dialCheckDuplicateType'];switch(_0x280668[_0x43e7('0x8a')]){case _0x43e7('0x8b'):_0x3d6659=squel['insert']()['into']('cm_hopper')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8d'),'ContactId','ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')]('phone',_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))['field'](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')]['toString']())[_0x43e7('0x2a')]('phone\x20IS\x20NOT\x20NULL')[_0x43e7('0x2a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x43e7('0x73')]()['field'](_0x43e7('0x95'))[_0x43e7('0x75')](_0x43e7('0x96'))[_0x43e7('0x2a')](_0x43e7('0x97'),_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]()))[_0x43e7('0x2a')](_0x43e7('0x98'),squel[_0x43e7('0x73')]()['field']('COALESCE(phone,\x27\x27)')['from'](_0x43e7('0x99'))['where']('VoiceQueueId\x20=\x20?',_0x13133c[_0x43e7('0x40')]['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;case _0x43e7('0x9a'):_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0x99'))[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),'ListId',_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel['select']()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))[_0x43e7('0x8e')]('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),_0x43e7('0x92'))['field'](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0x93'))['where'](_0x43e7('0x94'))[_0x43e7('0x2a')]('ListId\x20=\x20?',_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e'))['where'](_0x43e7('0x98'),squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x9f'))['from']('cm_hopper')[_0x43e7('0x2a')]('VoiceQueueId\x20=\x20?',_0x13133c['params']['id'][_0x43e7('0x91')]())))[_0x43e7('0x91')]();break;default:_0x3d6659=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper')[_0x43e7('0x9d')]([_0x43e7('0x8c'),_0x43e7('0x8d'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),'createdAt','updatedAt'],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27',_0x43e7('0x8d'))['field']('id',_0x43e7('0x8f'))[_0x43e7('0x8e')](_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')](),'ListId')[_0x43e7('0x8e')](_0x13133c['params']['id'][_0x43e7('0x91')](),_0x43e7('0x50'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x44'))['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))[_0x43e7('0x75')]('cm_contacts')[_0x43e7('0x2a')](_0x43e7('0x94'))[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x2be66d[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();}_0x57bcab['push'](db['sequelize'][_0x43e7('0x2c')](_0x3d6659));}return BPromise[_0x43e7('0x7d')](_0x57bcab);}})[_0x43e7('0x13')](function(){var _0x3ac223=[];var _0x486780=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')](_0x43e7('0xa1'))[_0x43e7('0x9d')]([_0x43e7('0xa2'),_0x43e7('0x8c'),_0x43e7('0xa3'),'createdAt',_0x43e7('0x43')],squel['select']()['field']('h.id')[_0x43e7('0x8e')](_0x43e7('0xa4'))[_0x43e7('0x8e')](_0x43e7('0xa5'))[_0x43e7('0x8e')]('\x27'+_0x47ef9d+'\x27','createdAt')['field']('\x27'+_0x47ef9d+'\x27',_0x43e7('0x43'))['from'](_0x43e7('0xa6'),'ci')['join'](_0x43e7('0x99'),'h',_0x43e7('0xa7'))[_0x43e7('0x2a')](_0x43e7('0xa8'),_0x47ef9d)['where']('ci.ItemClass=?',_0x43e7('0xa9')))[_0x43e7('0x91')]();_0x3ac223['push'](db['sequelize'][_0x43e7('0x2c')](_0x486780));return BPromise[_0x43e7('0x7d')](_0x3ac223);})[_0x43e7('0x13')](function(){return _0x56598f;})[_0x43e7('0x13')](respondWithResult(_0x288d6a,null))[_0x43e7('0x2e')](handleError(_0x288d6a,null));};exports[_0x43e7('0xaa')]=function(_0x71807e,_0x314259){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x71807e['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x314259,null))[_0x43e7('0x13')](function(_0x2613fc){if(_0x2613fc){return _0x2613fc[_0x43e7('0xaa')](_0x71807e['query'][_0x43e7('0x71')]);}})['then'](function(_0x17b298){if(_0x17b298){return db[_0x43e7('0x4a')][_0x43e7('0x14')]({'where':{'ListId':_0x71807e[_0x43e7('0x2c')]['ids'],'VoiceQueueId':_0x71807e['params']['id']}})[_0x43e7('0x13')](function(){return _0x17b298;});}})['then'](respondWithStatusCode(_0x314259,null))[_0x43e7('0x2e')](handleError(_0x314259,null));};exports[_0x43e7('0xab')]=function(_0x44c536,_0x3a9550){var _0x5dcd3f={};var _0x2e7f00={};var _0x2627e2;var _0x591517;return db['VoiceQueue'][_0x43e7('0x49')]({'where':{'id':_0x44c536[_0x43e7('0x40')]['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x3a9550,null))[_0x43e7('0x13')](function(_0x5e042f){if(_0x5e042f){_0x2627e2=_0x5e042f;_0x2e7f00['model']=_[_0x43e7('0x41')](db[_0x43e7('0x87')][_0x43e7('0x26')]);_0x2e7f00[_0x43e7('0x2c')]=_[_0x43e7('0x41')](_0x44c536[_0x43e7('0x2c')]);_0x2e7f00[_0x43e7('0x4e')]=_['intersection'](_0x2e7f00[_0x43e7('0x31')],_0x2e7f00[_0x43e7('0x2c')]);_0x5dcd3f[_0x43e7('0x32')]=_[_0x43e7('0x30')](_0x2e7f00[_0x43e7('0x31')],qs[_0x43e7('0x33')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x33')]));_0x5dcd3f[_0x43e7('0x32')]=_0x5dcd3f[_0x43e7('0x32')][_0x43e7('0x34')]?_0x5dcd3f[_0x43e7('0x32')]:_0x2e7f00[_0x43e7('0x31')];_0x5dcd3f[_0x43e7('0x56')]=qs[_0x43e7('0x4d')](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x4d')]);_0x5dcd3f['where']=qs[_0x43e7('0x4e')](_[_0x43e7('0x4f')](_0x44c536[_0x43e7('0x2c')],_0x2e7f00[_0x43e7('0x4e')]));if(_0x44c536[_0x43e7('0x2c')]['filter']){_0x5dcd3f[_0x43e7('0x2a')]=_[_0x43e7('0x36')](_0x5dcd3f[_0x43e7('0x2a')],{'$or':_[_0x43e7('0x1a')](_0x5dcd3f[_0x43e7('0x32')],function(_0x5278fd){var _0x84b4f4={};_0x84b4f4[_0x5278fd]={'$like':'%'+_0x44c536['query']['filter']+'%'};return _0x84b4f4;})});}_0x5dcd3f=_['merge']({},_0x5dcd3f,_0x44c536[_0x43e7('0x51')]);return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x4ee587){if(_0x4ee587){_0x591517=_0x4ee587[_0x43e7('0x34')];if(!_0x44c536[_0x43e7('0x2c')]['hasOwnProperty'](_0x43e7('0x4c'))){_0x5dcd3f[_0x43e7('0x11')]=qs['limit'](_0x44c536[_0x43e7('0x2c')][_0x43e7('0x11')]);_0x5dcd3f[_0x43e7('0xe')]=qs[_0x43e7('0xe')](_0x44c536[_0x43e7('0x2c')]['offset']);}return _0x2627e2[_0x43e7('0xab')](_0x5dcd3f);}})[_0x43e7('0x13')](function(_0x3b641e){if(_0x3b641e){return _0x3b641e?{'count':_0x591517,'rows':_0x3b641e}:null;}})[_0x43e7('0x13')](respondWithResult(_0x3a9550,null))[_0x43e7('0x2e')](handleError(_0x3a9550,null));};exports['addBlackLists']=function(_0x5b046d,_0x4a0427){var _0xc3460c;return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x5b046d[_0x43e7('0x40')]['id']}})['then'](handleEntityNotFound(_0x4a0427,null))[_0x43e7('0x13')](function(_0x19c1d2){if(_0x19c1d2){return _0x19c1d2[_0x43e7('0xac')](_0x5b046d['body'][_0x43e7('0x71')],_['omit'](_0x5b046d[_0x43e7('0x39')],[_0x43e7('0x71'),'id'])||{});}return null;})[_0x43e7('0x89')](function(_0x40cc83){var _0x148d72;_0xc3460c=_0x40cc83||[];var _0x1ceb94=[];if(_0x40cc83){for(var _0x19c29b=0x0;_0x19c29b<_0x40cc83[_0x43e7('0x34')];_0x19c29b+=0x1){var _0x38a8db=_0x40cc83[_0x19c29b]['get']({'plain':!![]});_0x148d72=squel[_0x43e7('0x9b')]()[_0x43e7('0x9c')]('cm_hopper_black')['fromQuery']([_0x43e7('0x8c'),_0x43e7('0x8f'),_0x43e7('0x92'),_0x43e7('0x50'),_0x43e7('0x44'),_0x43e7('0x43')],squel[_0x43e7('0x73')]()[_0x43e7('0x8e')](_0x43e7('0x8c'),_0x43e7('0x8c'))[_0x43e7('0x8e')]('id','ContactId')[_0x43e7('0x8e')](_0x38a8db['CmListId'][_0x43e7('0x91')](),_0x43e7('0x92'))[_0x43e7('0x8e')](_0x5b046d[_0x43e7('0x40')]['id']['toString'](),_0x43e7('0x50'))[_0x43e7('0x8e')]('NOW()',_0x43e7('0x44'))[_0x43e7('0x8e')](_0x43e7('0xad'),_0x43e7('0x43'))[_0x43e7('0x75')](_0x43e7('0x93'))[_0x43e7('0x2a')]('deletedAt\x20IS\x20NULL')[_0x43e7('0x2a')](_0x43e7('0xa0'),_0x38a8db[_0x43e7('0x90')][_0x43e7('0x91')]())[_0x43e7('0x2a')](_0x43e7('0x9e')))[_0x43e7('0x91')]();_0x1ceb94[_0x43e7('0x7a')](db[_0x43e7('0x62')]['query'](_0x148d72));}return BPromise[_0x43e7('0x7d')](_0x1ceb94);}})['then'](function(){return _0xc3460c;})[_0x43e7('0x13')](respondWithResult(_0x4a0427,null))[_0x43e7('0x2e')](handleError(_0x4a0427,null));};exports[_0x43e7('0xae')]=function(_0x1dc579,_0x6d9fb){return db[_0x43e7('0x25')][_0x43e7('0x37')]({'where':{'id':_0x1dc579['params']['id']}})[_0x43e7('0x13')](handleEntityNotFound(_0x6d9fb,null))['then'](function(_0x59ca95){if(_0x59ca95){return _0x59ca95[_0x43e7('0xae')](_0x1dc579['query']['ids']);}})[_0x43e7('0x13')](function(_0x759eb5){if(_0x759eb5){return db[_0x43e7('0x58')][_0x43e7('0x14')]({'where':{'ListId':_0x1dc579['query'][_0x43e7('0x71')],'VoiceQueueId':_0x1dc579['params']['id']}})[_0x43e7('0x13')](function(){return _0x759eb5;});}})[_0x43e7('0x13')](respondWithStatusCode(_0x6d9fb,null))[_0x43e7('0x2e')](handleError(_0x6d9fb,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 3ede8cb..b1d7b43 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 _0xb0c9=['hasOwnProperty','events','VoiceQueue','setMaxListeners','save','remove','emit'];(function(_0x186258,_0x1282c2){var _0x125488=function(_0x16719f){while(--_0x16719f){_0x186258['push'](_0x186258['shift']());}};_0x125488(++_0x1282c2);}(_0xb0c9,0xda));var _0x9b0c=function(_0xe9fc75,_0x301b64){_0xe9fc75=_0xe9fc75-0x0;var _0x482b79=_0xb0c9[_0xe9fc75];return _0x482b79;};'use strict';var EventEmitter=require(_0x9b0c('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0x9b0c('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x9b0c('0x2')](0x0);var events={'afterCreate':_0x9b0c('0x3'),'afterUpdate':'update','afterDestroy':_0x9b0c('0x4')};function emitEvent(_0x251809){return function(_0x245e38,_0x567774,_0xab496e){VoiceQueueEvents[_0x9b0c('0x5')](_0x251809+':'+_0x245e38['id'],_0x245e38);VoiceQueueEvents[_0x9b0c('0x5')](_0x251809,_0x245e38);_0xab496e(null);};}for(var e in events){if(events[_0x9b0c('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xdd1d=['setMaxListeners','update','remove','emit','hook','exports','events','VoiceQueue'];(function(_0x1d1855,_0x4a4d2f){var _0x495672=function(_0x122a21){while(--_0x122a21){_0x1d1855['push'](_0x1d1855['shift']());}};_0x495672(++_0x4a4d2f);}(_0xdd1d,0x66));var _0xddd1=function(_0x2f8a7c,_0x3f65fd){_0x2f8a7c=_0x2f8a7c-0x0;var _0x257e01=_0xdd1d[_0x2f8a7c];return _0x257e01;};'use strict';var EventEmitter=require(_0xddd1('0x0'));var VoiceQueue=require('../../mysqldb')['db'][_0xddd1('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xddd1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xddd1('0x3'),'afterDestroy':_0xddd1('0x4')};function emitEvent(_0x5dd485){return function(_0x170550,_0x583359,_0x371146){VoiceQueueEvents[_0xddd1('0x5')](_0x5dd485+':'+_0x170550['id'],_0x170550);VoiceQueueEvents[_0xddd1('0x5')](_0x5dd485,_0x170550);_0x371146(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xddd1('0x6')](e,emitEvent(event));}}module[_0xddd1('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 4d08c52..952b92f 100644 --- a/server/api/voiceQueue/voiceQueue.model.js +++ b/server/api/voiceQueue/voiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x1ac6af,_0x9ee48f){var _0x21f6ef=function(_0x27c5a2){while(--_0x27c5a2){_0x1ac6af['push'](_0x1ac6af['shift']());}};_0x21f6ef(++_0x9ee48f);}(_0x70e0,0x17b));var _0x070e=function(_0x4d7b8b,_0x29fb76){_0x4d7b8b=_0x4d7b8b-0x0;var _0x5756c4=_0x70e0[_0x4d7b8b];return _0x5756c4;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x31d98a,_0x292465){var _0x56e10e=function(_0x54a82f){while(--_0x54a82f){_0x31d98a['push'](_0x31d98a['shift']());}};_0x56e10e(++_0x292465);}(_0x008c,0x188));var _0xc008=function(_0x42540c,_0x27ca3b){_0x42540c=_0x42540c-0x0;var _0x1a27dc=_0x008c[_0x42540c];return _0x1a27dc;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index d5ded9f..08fe0e3 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 _0x9ad8=['include','map','model','ShowVoiceQueue','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','where','attributes','limit'];(function(_0x2df4cc,_0x1233c6){var _0x40af8d=function(_0x5e0f2a){while(--_0x5e0f2a){_0x2df4cc['push'](_0x2df4cc['shift']());}};_0x40af8d(++_0x1233c6);}(_0x9ad8,0xce));var _0x89ad=function(_0x132fb6,_0x7a257b){_0x132fb6=_0x132fb6-0x0;var _0x2ca9d5=_0x9ad8[_0x132fb6];return _0x2ca9d5;};'use strict';var _=require(_0x89ad('0x0'));var util=require(_0x89ad('0x1'));var moment=require(_0x89ad('0x2'));var BPromise=require(_0x89ad('0x3'));var rs=require(_0x89ad('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x89ad('0x5'))['db'];var utils=require(_0x89ad('0x6'));var logger=require('../../config/logger')(_0x89ad('0x7'));var config=require(_0x89ad('0x8'));var jayson=require(_0x89ad('0x9'));var client=jayson[_0x89ad('0xa')][_0x89ad('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x89ad('0xc')],{'host':_0x89ad('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x89ad('0xc')]));require(_0x89ad('0xe'))[_0x89ad('0xf')](socket);function respondWithRpcPromise(_0x1dd4e2,_0x4fb8ca,_0x3634c6){return new BPromise(function(_0x34faf0,_0x30f897){return client[_0x89ad('0x10')](_0x1dd4e2,_0x3634c6)[_0x89ad('0x11')](function(_0x52af49){logger[_0x89ad('0x12')](_0x89ad('0x13'),_0x4fb8ca,_0x89ad('0x14'));logger['debug']('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4fb8ca,_0x89ad('0x14'),JSON[_0x89ad('0x15')](_0x52af49));if(_0x52af49[_0x89ad('0x16')]){if(_0x52af49[_0x89ad('0x16')][_0x89ad('0x17')]===0x1f4){logger[_0x89ad('0x16')](_0x89ad('0x13'),_0x4fb8ca,_0x52af49['error']['message']);return _0x30f897(_0x52af49[_0x89ad('0x16')][_0x89ad('0x18')]);}logger[_0x89ad('0x16')](_0x89ad('0x13'),_0x4fb8ca,_0x52af49['error'][_0x89ad('0x18')]);return _0x34faf0(_0x52af49['error'][_0x89ad('0x18')]);}else{logger['info'](_0x89ad('0x13'),_0x4fb8ca,_0x89ad('0x14'));_0x34faf0(_0x52af49[_0x89ad('0x19')][_0x89ad('0x18')]);}})[_0x89ad('0x1a')](function(_0x1b0c92){logger['error'](_0x89ad('0x13'),_0x4fb8ca,_0x1b0c92);_0x30f897(_0x1b0c92);});});}exports[_0x89ad('0x1b')]=function(_0x3c98f3){var _0x28d10f=this;return new Promise(function(_0x58ef26,_0x3c891f){return db[_0x89ad('0x1c')][_0x89ad('0x1d')]({'raw':_0x3c98f3[_0x89ad('0x1e')]?_0x3c98f3[_0x89ad('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3c98f3['options']?_0x3c98f3[_0x89ad('0x1e')][_0x89ad('0x1f')]||null:null,'attributes':_0x3c98f3['options']?_0x3c98f3['options'][_0x89ad('0x20')]||null:null,'limit':_0x3c98f3['options']?_0x3c98f3[_0x89ad('0x1e')][_0x89ad('0x21')]||null:null,'include':_0x3c98f3[_0x89ad('0x1e')]?_0x3c98f3['options'][_0x89ad('0x22')]?_['map'](_0x3c98f3[_0x89ad('0x1e')]['include'],function(_0x412149){return{'model':db[_0x412149['model']],'as':_0x412149['as'],'attributes':_0x412149[_0x89ad('0x20')],'include':_0x412149['include']?_[_0x89ad('0x23')](_0x412149[_0x89ad('0x22')],function(_0x49a867){return{'model':db[_0x49a867[_0x89ad('0x24')]],'as':_0x49a867['as'],'attributes':_0x49a867['attributes'],'include':_0x49a867[_0x89ad('0x22')]?_['map'](_0x49a867[_0x89ad('0x22')],function(_0x584477){return{'model':db[_0x584477[_0x89ad('0x24')]],'as':_0x584477['as'],'attributes':_0x584477[_0x89ad('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5084f3){logger[_0x89ad('0x12')](_0x89ad('0x1b'),_0x3c98f3);logger['debug'](_0x89ad('0x1b'),_0x3c98f3,JSON[_0x89ad('0x15')](_0x5084f3));_0x58ef26(_0x5084f3);})[_0x89ad('0x1a')](function(_0x50d0a5){logger[_0x89ad('0x16')](_0x89ad('0x1b'),_0x50d0a5['message'],_0x3c98f3);_0x3c891f(_0x28d10f[_0x89ad('0x16')](0x1f4,_0x50d0a5[_0x89ad('0x18')]));});});};exports[_0x89ad('0x25')]=function(_0x5c04ab){var _0x4875d2=this;return new Promise(function(_0x3e5cd0,_0xcbb229){return db['VoiceQueue']['find']({'raw':_0x5c04ab[_0x89ad('0x1e')]?_0x5c04ab[_0x89ad('0x1e')][_0x89ad('0x26')]===undefined?!![]:![]:!![],'where':_0x5c04ab[_0x89ad('0x1e')]?_0x5c04ab[_0x89ad('0x1e')][_0x89ad('0x1f')]||null:null,'attributes':_0x5c04ab['options']?_0x5c04ab['options']['attributes']||null:null,'include':_0x5c04ab[_0x89ad('0x1e')]?_0x5c04ab[_0x89ad('0x1e')][_0x89ad('0x22')]?_[_0x89ad('0x23')](_0x5c04ab[_0x89ad('0x1e')][_0x89ad('0x22')],function(_0x400e2d){return{'model':db[_0x400e2d[_0x89ad('0x24')]],'as':_0x400e2d['as'],'attributes':_0x400e2d[_0x89ad('0x20')],'include':_0x400e2d['include']?_[_0x89ad('0x23')](_0x400e2d['include'],function(_0x43357b){return{'model':db[_0x43357b[_0x89ad('0x24')]],'as':_0x43357b['as'],'attributes':_0x43357b[_0x89ad('0x20')],'include':_0x43357b[_0x89ad('0x22')]?_[_0x89ad('0x23')](_0x43357b[_0x89ad('0x22')],function(_0x1dc44b){return{'model':db[_0x1dc44b[_0x89ad('0x24')]],'as':_0x1dc44b['as'],'attributes':_0x1dc44b['attributes']};}):[]};}):[]};}):[]:[]})[_0x89ad('0x11')](function(_0x3a4a53){logger['info'](_0x89ad('0x25'),_0x5c04ab);logger[_0x89ad('0x27')](_0x89ad('0x25'),_0x5c04ab,JSON[_0x89ad('0x15')](_0x3a4a53));_0x3e5cd0(_0x3a4a53);})[_0x89ad('0x1a')](function(_0x300504){logger['error'](_0x89ad('0x25'),_0x300504['message'],_0x5c04ab);_0xcbb229(_0x4875d2[_0x89ad('0x16')](0x1f4,_0x300504[_0x89ad('0x18')]));});});}; \ No newline at end of file +var _0x7c30=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','result','GetVoiceQueue','options','where','attributes','limit','include','model','map','stringify','ShowVoiceQueue','find'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x7c30,0x17d));var _0x07c3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x7c30[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x07c3('0x0'));var util=require(_0x07c3('0x1'));var moment=require(_0x07c3('0x2'));var BPromise=require(_0x07c3('0x3'));var rs=require(_0x07c3('0x4'));var fs=require('fs');var Redis=require(_0x07c3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x07c3('0x6'));var logger=require(_0x07c3('0x7'))(_0x07c3('0x8'));var config=require('../../config/environment');var jayson=require(_0x07c3('0x9'));var client=jayson[_0x07c3('0xa')][_0x07c3('0xb')]({'port':0x232a});config[_0x07c3('0xc')]=_['defaults'](config[_0x07c3('0xc')],{'host':_0x07c3('0xd'),'port':0x18eb});var socket=require(_0x07c3('0xe'))(new Redis(config[_0x07c3('0xc')]));require(_0x07c3('0xf'))['register'](socket);function respondWithRpcPromise(_0x4fbe6c,_0x59fe79,_0xd6012b){return new BPromise(function(_0x4360f4,_0x2cd8ba){return client['request'](_0x4fbe6c,_0xd6012b)[_0x07c3('0x10')](function(_0x43d106){logger['info'](_0x07c3('0x11'),_0x59fe79,_0x07c3('0x12'));logger[_0x07c3('0x13')](_0x07c3('0x14'),_0x59fe79,_0x07c3('0x12'),JSON['stringify'](_0x43d106));if(_0x43d106['error']){if(_0x43d106[_0x07c3('0x15')][_0x07c3('0x16')]===0x1f4){logger[_0x07c3('0x15')](_0x07c3('0x11'),_0x59fe79,_0x43d106['error']['message']);return _0x2cd8ba(_0x43d106[_0x07c3('0x15')]['message']);}logger[_0x07c3('0x15')](_0x07c3('0x11'),_0x59fe79,_0x43d106['error']['message']);return _0x4360f4(_0x43d106['error'][_0x07c3('0x17')]);}else{logger[_0x07c3('0x18')](_0x07c3('0x11'),_0x59fe79,_0x07c3('0x12'));_0x4360f4(_0x43d106[_0x07c3('0x19')][_0x07c3('0x17')]);}})['catch'](function(_0x5e801f){logger['error']('VoiceQueue,\x20%s,\x20%s',_0x59fe79,_0x5e801f);_0x2cd8ba(_0x5e801f);});});}exports[_0x07c3('0x1a')]=function(_0x5979cb){var _0x4eeff5=this;return new Promise(function(_0x4782fe,_0xc6ee8d){return db['VoiceQueue']['findAll']({'raw':_0x5979cb[_0x07c3('0x1b')]?_0x5979cb[_0x07c3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x5979cb[_0x07c3('0x1b')]?_0x5979cb[_0x07c3('0x1b')][_0x07c3('0x1c')]||null:null,'attributes':_0x5979cb[_0x07c3('0x1b')]?_0x5979cb[_0x07c3('0x1b')][_0x07c3('0x1d')]||null:null,'limit':_0x5979cb['options']?_0x5979cb[_0x07c3('0x1b')][_0x07c3('0x1e')]||null:null,'include':_0x5979cb['options']?_0x5979cb['options'][_0x07c3('0x1f')]?_['map'](_0x5979cb[_0x07c3('0x1b')][_0x07c3('0x1f')],function(_0x4b2ac4){return{'model':db[_0x4b2ac4[_0x07c3('0x20')]],'as':_0x4b2ac4['as'],'attributes':_0x4b2ac4[_0x07c3('0x1d')],'include':_0x4b2ac4[_0x07c3('0x1f')]?_[_0x07c3('0x21')](_0x4b2ac4[_0x07c3('0x1f')],function(_0x2d9092){return{'model':db[_0x2d9092[_0x07c3('0x20')]],'as':_0x2d9092['as'],'attributes':_0x2d9092['attributes'],'include':_0x2d9092[_0x07c3('0x1f')]?_[_0x07c3('0x21')](_0x2d9092[_0x07c3('0x1f')],function(_0x878e68){return{'model':db[_0x878e68['model']],'as':_0x878e68['as'],'attributes':_0x878e68[_0x07c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x07c3('0x10')](function(_0x36c687){logger[_0x07c3('0x18')]('GetVoiceQueue',_0x5979cb);logger[_0x07c3('0x13')]('GetVoiceQueue',_0x5979cb,JSON[_0x07c3('0x22')](_0x36c687));_0x4782fe(_0x36c687);})['catch'](function(_0x101463){logger[_0x07c3('0x15')]('GetVoiceQueue',_0x101463[_0x07c3('0x17')],_0x5979cb);_0xc6ee8d(_0x4eeff5[_0x07c3('0x15')](0x1f4,_0x101463['message']));});});};exports[_0x07c3('0x23')]=function(_0x580a37){var _0x1c8c4b=this;return new Promise(function(_0x4cf33b,_0x546c77){return db['VoiceQueue'][_0x07c3('0x24')]({'raw':_0x580a37['options']?_0x580a37[_0x07c3('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x580a37[_0x07c3('0x1b')]?_0x580a37[_0x07c3('0x1b')]['where']||null:null,'attributes':_0x580a37[_0x07c3('0x1b')]?_0x580a37[_0x07c3('0x1b')][_0x07c3('0x1d')]||null:null,'include':_0x580a37[_0x07c3('0x1b')]?_0x580a37[_0x07c3('0x1b')][_0x07c3('0x1f')]?_['map'](_0x580a37[_0x07c3('0x1b')][_0x07c3('0x1f')],function(_0x5285b5){return{'model':db[_0x5285b5['model']],'as':_0x5285b5['as'],'attributes':_0x5285b5[_0x07c3('0x1d')],'include':_0x5285b5[_0x07c3('0x1f')]?_[_0x07c3('0x21')](_0x5285b5[_0x07c3('0x1f')],function(_0x1d7fec){return{'model':db[_0x1d7fec[_0x07c3('0x20')]],'as':_0x1d7fec['as'],'attributes':_0x1d7fec[_0x07c3('0x1d')],'include':_0x1d7fec[_0x07c3('0x1f')]?_['map'](_0x1d7fec[_0x07c3('0x1f')],function(_0x1edadb){return{'model':db[_0x1edadb[_0x07c3('0x20')]],'as':_0x1edadb['as'],'attributes':_0x1edadb[_0x07c3('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x07c3('0x10')](function(_0x91bc75){logger['info'](_0x07c3('0x23'),_0x580a37);logger[_0x07c3('0x13')](_0x07c3('0x23'),_0x580a37,JSON['stringify'](_0x91bc75));_0x4cf33b(_0x91bc75);})[_0x07c3('0x25')](function(_0x119cbd){logger[_0x07c3('0x15')](_0x07c3('0x23'),_0x119cbd[_0x07c3('0x17')],_0x580a37);_0x546c77(_0x1c8c4b[_0x07c3('0x15')](0x1f4,_0x119cbd[_0x07c3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 5e7fedc..cb9bddc 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 _0xad10=['length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x336734,_0x3ce610){var _0x585408=function(_0x29469f){while(--_0x29469f){_0x336734['push'](_0x336734['shift']());}};_0x585408(++_0x3ce610);}(_0xad10,0x1f1));var _0x0ad1=function(_0x7658c8,_0x148d4d){_0x7658c8=_0x7658c8-0x0;var _0x5bca5e=_0xad10[_0x7658c8];return _0x5bca5e;};'use strict';var VoiceQueueEvents=require(_0x0ad1('0x0'));var events=[_0x0ad1('0x1'),_0x0ad1('0x2'),_0x0ad1('0x3')];function createListener(_0x3a18f3,_0x4cf057){return function(_0x33c963){_0x4cf057[_0x0ad1('0x4')](_0x3a18f3,_0x33c963);};}function removeListener(_0x565cc2,_0x2e380c){return function(){VoiceQueueEvents[_0x0ad1('0x5')](_0x565cc2,_0x2e380c);};}exports[_0x0ad1('0x6')]=function(_0x1c83ab){for(var _0x545141=0x0,_0x4da8d3=events[_0x0ad1('0x7')];_0x545141<_0x4da8d3;_0x545141++){var _0x1d0d19=events[_0x545141];var _0x7daf44=createListener(_0x0ad1('0x8')+_0x1d0d19,_0x1c83ab);VoiceQueueEvents['on'](_0x1d0d19,_0x7daf44);}}; \ No newline at end of file +var _0x2309=['removeListener','register','voiceQueue:','save','update','emit'];(function(_0x5c0b80,_0x2712d1){var _0x366dd7=function(_0x444473){while(--_0x444473){_0x5c0b80['push'](_0x5c0b80['shift']());}};_0x366dd7(++_0x2712d1);}(_0x2309,0x147));var _0x9230=function(_0x238688,_0x390848){_0x238688=_0x238688-0x0;var _0x2efa6f=_0x2309[_0x238688];return _0x2efa6f;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x9230('0x0'),'remove',_0x9230('0x1')];function createListener(_0x2ca1d4,_0x21f927){return function(_0x40cc9f){_0x21f927[_0x9230('0x2')](_0x2ca1d4,_0x40cc9f);};}function removeListener(_0x5787bb,_0x289d1a){return function(){VoiceQueueEvents[_0x9230('0x3')](_0x5787bb,_0x289d1a);};}exports[_0x9230('0x4')]=function(_0x31c1b2){for(var _0x3f1a9d=0x0,_0x84ea91=events['length'];_0x3f1a9d<_0x84ea91;_0x3f1a9d++){var _0xb4a1dc=events[_0x3f1a9d];var _0x548210=createListener(_0x9230('0x5')+_0xb4a1dc,_0x31c1b2);VoiceQueueEvents['on'](_0xb4a1dc,_0x548210);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 56d0367..836854c 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 _0x2cf7=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','post','create','put','update'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x2cf7,0x192));var _0x72cf=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x2cf7[_0x45fe9c];return _0x233d48;};'use strict';var multer=require(_0x72cf('0x0'));var util=require(_0x72cf('0x1'));var path=require(_0x72cf('0x2'));var timeout=require(_0x72cf('0x3'));var express=require(_0x72cf('0x4'));var router=express[_0x72cf('0x5')]();var fs_extra=require(_0x72cf('0x6'));var auth=require(_0x72cf('0x7'));var interaction=require(_0x72cf('0x8'));var config=require(_0x72cf('0x9'));var controller=require('./voiceQueueReport.controller');router[_0x72cf('0xa')]('/',auth[_0x72cf('0xb')](),controller['index']);router[_0x72cf('0xa')](_0x72cf('0xc'),auth[_0x72cf('0xb')](),controller['describe']);router['get']('/index',auth['isAuthenticated'](),controller['getVoiceQueuesReport']);router[_0x72cf('0xa')](_0x72cf('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x72cf('0xe')]('/',auth[_0x72cf('0xb')](),controller[_0x72cf('0xf')]);router[_0x72cf('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x72cf('0x11')]);router[_0x72cf('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x72cf('0x13')]);module[_0x72cf('0x14')]=router; \ No newline at end of file +var _0x29d4=['../../config/environment','get','isAuthenticated','index','/describe','describe','/index','/:id','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x155aec,_0x353a91){var _0x56cba8=function(_0x22f191){while(--_0x22f191){_0x155aec['push'](_0x155aec['shift']());}};_0x56cba8(++_0x353a91);}(_0x29d4,0x1c7));var _0x429d=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0x29d4[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0x429d('0x0'));var util=require(_0x429d('0x1'));var path=require(_0x429d('0x2'));var timeout=require(_0x429d('0x3'));var express=require(_0x429d('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x429d('0x5'));var interaction=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var controller=require('./voiceQueueReport.controller');router[_0x429d('0x8')]('/',auth[_0x429d('0x9')](),controller[_0x429d('0xa')]);router[_0x429d('0x8')](_0x429d('0xb'),auth[_0x429d('0x9')](),controller[_0x429d('0xc')]);router[_0x429d('0x8')](_0x429d('0xd'),auth[_0x429d('0x9')](),controller['getVoiceQueuesReport']);router[_0x429d('0x8')](_0x429d('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x429d('0xf')]('/',auth[_0x429d('0x9')](),controller[_0x429d('0x10')]);router[_0x429d('0x11')]('/:id',auth[_0x429d('0x9')](),controller[_0x429d('0x12')]);router['delete'](_0x429d('0xe'),auth['isAuthenticated'](),controller[_0x429d('0x13')]);module[_0x429d('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 47f7b84..2fa0dd1 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 _0xe304=['seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x15ec35,_0x5b9972){var _0x937cce=function(_0x59326b){while(--_0x59326b){_0x15ec35['push'](_0x15ec35['shift']());}};_0x937cce(++_0x5b9972);}(_0xe304,0xca));var _0x4e30=function(_0x17503a,_0x4912f7){_0x17503a=_0x17503a-0x0;var _0x3d0d08=_0xe304[_0x17503a];return _0x3d0d08;};'use strict';var Sequelize=require(_0x4e30('0x0'));var moment=require(_0x4e30('0x1'));module[_0x4e30('0x2')]={'type':{'type':Sequelize[_0x4e30('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x4e30('0x3')]},'calleridname':{'type':Sequelize[_0x4e30('0x3')]},'queue':{'type':Sequelize[_0x4e30('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x4e30('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x1724de){var _0xa92734=moment(_0x1724de);var _0x1dcf8c=moment(this[_0x4e30('0x5')](_0x4e30('0x6')))['format'](_0x4e30('0x7'));var _0x221329=_0xa92734['diff'](_0x1dcf8c,_0x4e30('0x8'));this[_0x4e30('0x9')](_0x4e30('0xa'),_0x1724de);this[_0x4e30('0x9')]('holdtime',_0x221329||null);}},'position':{'type':Sequelize[_0x4e30('0xb')]},'count':{'type':Sequelize[_0x4e30('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x4e30('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x4e30('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x4e30('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x4e30('0x4')]},'queuecallerexit':{'type':Sequelize[_0x4e30('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x4e30('0x3')],'comment':_0x4e30('0xd')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x4e30('0x3')]},'connectedlinenum':{'type':Sequelize[_0x4e30('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x4e30('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x4e30('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x4e30('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x4e30('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x4e30('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x4e30('0x3')],'comment':_0x4e30('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x4e30('0x3')]},'secondDisposition':{'type':Sequelize[_0x4e30('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x4e30('0xb')],'defaultValue':0x0},'note':{'type':Sequelize[_0x4e30('0x3')]}}; \ No newline at end of file +var _0xe517=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment'];(function(_0x1620b3,_0x2c34f4){var _0x380fb1=function(_0x2a5722){while(--_0x2a5722){_0x1620b3['push'](_0x1620b3['shift']());}};_0x380fb1(++_0x2c34f4);}(_0xe517,0xee));var _0x7e51=function(_0x7938fe,_0x38fc44){_0x7938fe=_0x7938fe-0x0;var _0x30cc3e=_0xe517[_0x7938fe];return _0x30cc3e;};'use strict';var Sequelize=require(_0x7e51('0x0'));var moment=require(_0x7e51('0x1'));module[_0x7e51('0x2')]={'type':{'type':Sequelize[_0x7e51('0x3')]},'uniqueid':{'type':Sequelize[_0x7e51('0x3')]},'calleridnum':{'type':Sequelize[_0x7e51('0x3')]},'calleridname':{'type':Sequelize[_0x7e51('0x3')]},'queue':{'type':Sequelize[_0x7e51('0x3')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x7e51('0x4')],'set':function(_0x3cfd98){var _0x55e366=moment(_0x3cfd98);var _0x195068=moment(this[_0x7e51('0x5')](_0x7e51('0x6')))[_0x7e51('0x7')](_0x7e51('0x8'));var _0x13856b=_0x55e366[_0x7e51('0x9')](_0x195068,_0x7e51('0xa'));this['setDataValue']('queuecallerleaveAt',_0x3cfd98);this['setDataValue'](_0x7e51('0xb'),_0x13856b||null);}},'position':{'type':Sequelize[_0x7e51('0xc')]},'count':{'type':Sequelize[_0x7e51('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x7e51('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x7e51('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x7e51('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x7e51('0x4')]},'queuecallerexit':{'type':Sequelize[_0x7e51('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x7e51('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x7e51('0xe')},'originalposition':{'type':Sequelize[_0x7e51('0xc')]},'channel':{'type':Sequelize[_0x7e51('0x3')]},'connectedlinenum':{'type':Sequelize[_0x7e51('0x3')]},'connectedlinename':{'type':Sequelize[_0x7e51('0x3')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7e51('0x3')]},'exten':{'type':Sequelize[_0x7e51('0x3')]},'priority':{'type':Sequelize[_0x7e51('0x3')]},'holdtime':{'type':Sequelize[_0x7e51('0xc')]},'mohtime':{'type':Sequelize[_0x7e51('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x7e51('0x3')],'comment':_0x7e51('0xf')},'transferexten':{'type':Sequelize[_0x7e51('0x3')]},'transferuniqueid':{'type':Sequelize[_0x7e51('0x3')]},'disposition':{'type':Sequelize[_0x7e51('0x3')]},'secondDisposition':{'type':Sequelize[_0x7e51('0x3')]},'thirdDisposition':{'type':Sequelize[_0x7e51('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x7e51('0xc')],'defaultValue':0x0},'note':{'type':Sequelize[_0x7e51('0x3')]}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index dce7634..98c3e7a 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 _0x1237=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','undefined','limit','offset','count','set','json','reject','save','update','then','destroy','error','stack','name','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox'];(function(_0x1fd0e9,_0xbd759f){var _0x5d9f31=function(_0x293131){while(--_0x293131){_0x1fd0e9['push'](_0x1fd0e9['shift']());}};_0x5d9f31(++_0xbd759f);}(_0x1237,0x19f));var _0x7123=function(_0x262967,_0x2336fb){_0x262967=_0x262967-0x0;var _0x38120b=_0x1237[_0x262967];return _0x38120b;};'use strict';var emlformat=require(_0x7123('0x0'));var rimraf=require(_0x7123('0x1'));var zipdir=require(_0x7123('0x2'));var jsonpatch=require(_0x7123('0x3'));var rp=require(_0x7123('0x4'));var moment=require('moment');var BPromise=require(_0x7123('0x5'));var Mustache=require(_0x7123('0x6'));var util=require(_0x7123('0x7'));var path=require(_0x7123('0x8'));var sox=require(_0x7123('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7123('0xa'));var _=require(_0x7123('0xb'));var squel=require(_0x7123('0xc'));var crypto=require(_0x7123('0xd'));var jsforce=require(_0x7123('0xe'));var deskjs=require(_0x7123('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7123('0x10'));var Papa=require(_0x7123('0x11'));var Redis=require(_0x7123('0x12'));var authService=require(_0x7123('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7123('0x14'));var hardwareService=require(_0x7123('0x15'));var logger=require(_0x7123('0x16'))(_0x7123('0x17'));var utils=require(_0x7123('0x18'));var config=require(_0x7123('0x19'));var licenseUtil=require(_0x7123('0x1a'));var db=require(_0x7123('0x1b'))['db'];config[_0x7123('0x1c')]=_[_0x7123('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7123('0x1e'))(new Redis(config[_0x7123('0x1c')]));require(_0x7123('0x1f'))['register'](socket);function respondWithStatusCode(_0x3835c6,_0x156c27){_0x156c27=_0x156c27||0xcc;return function(_0x40fafb){if(_0x40fafb){return _0x3835c6[_0x7123('0x20')](_0x156c27);}return _0x3835c6[_0x7123('0x21')](_0x156c27)[_0x7123('0x22')]();};}function respondWithResult(_0xf28f9c,_0x42f2cd){_0x42f2cd=_0x42f2cd||0xc8;return function(_0x4442b0){if(_0x4442b0){return _0xf28f9c[_0x7123('0x21')](_0x42f2cd)['json'](_0x4442b0);}};}function respondWithFilteredResult(_0x5eab53,_0x4e03ce){return function(_0x2bc49e){if(_0x2bc49e){var _0x2a245d=typeof _0x4e03ce['offset']===_0x7123('0x23')&&typeof _0x4e03ce[_0x7123('0x24')]===_0x7123('0x23');var _0x15c11e=_0x2bc49e['count'];var _0x2e70f6=_0x2a245d?0x0:_0x4e03ce[_0x7123('0x25')];var _0x55cc2f=_0x2a245d?_0x2bc49e[_0x7123('0x26')]:_0x4e03ce[_0x7123('0x25')]+_0x4e03ce[_0x7123('0x24')];var _0x4f397c;if(_0x55cc2f>=_0x15c11e){_0x55cc2f=_0x15c11e;_0x4f397c=0xc8;}else{_0x4f397c=0xce;}_0x5eab53['status'](_0x4f397c);return _0x5eab53[_0x7123('0x27')]('Content-Range',_0x2e70f6+'-'+_0x55cc2f+'/'+_0x15c11e)[_0x7123('0x28')](_0x2bc49e);}return null;};}function patchUpdates(_0x4c1083){return function(_0x4a742d){try{jsonpatch['apply'](_0x4a742d,_0x4c1083,!![]);}catch(_0x41952c){return BPromise[_0x7123('0x29')](_0x41952c);}return _0x4a742d[_0x7123('0x2a')]();};}function saveUpdates(_0x4af211,_0x2afd48){return function(_0x1b6ef0){if(_0x1b6ef0){return _0x1b6ef0[_0x7123('0x2b')](_0x4af211)[_0x7123('0x2c')](function(_0x30ff5b){return _0x30ff5b;});}return null;};}function removeEntity(_0x3fbc0a,_0x206fa8){return function(_0x3c8428){if(_0x3c8428){return _0x3c8428[_0x7123('0x2d')]()['then'](function(){_0x3fbc0a[_0x7123('0x21')](0xcc)[_0x7123('0x22')]();});}};}function handleEntityNotFound(_0x2e9d17,_0x52f41d){return function(_0x41a0ba){if(!_0x41a0ba){_0x2e9d17[_0x7123('0x20')](0x194);}return _0x41a0ba;};}function handleError(_0x5e66df,_0x44a1aa){_0x44a1aa=_0x44a1aa||0x1f4;return function(_0x337401){logger[_0x7123('0x2e')](_0x337401[_0x7123('0x2f')]);if(_0x337401[_0x7123('0x30')]){delete _0x337401[_0x7123('0x30')];}_0x5e66df[_0x7123('0x21')](_0x44a1aa)['send'](_0x337401);};}exports[_0x7123('0x31')]=function(_0xd8af7f,_0x4a9740){var _0x2f199c={},_0x393680={},_0x1c2df4={'count':0x0,'rows':[]};var _0x3e91cb=_[_0x7123('0x32')](db[_0x7123('0x33')][_0x7123('0x34')],function(_0x5b9dbc){return{'name':_0x5b9dbc[_0x7123('0x35')],'type':_0x5b9dbc[_0x7123('0x36')][_0x7123('0x37')]};});_0x393680[_0x7123('0x38')]=_[_0x7123('0x32')](_0x3e91cb,'name');_0x393680[_0x7123('0x39')]=_[_0x7123('0x3a')](_0xd8af7f[_0x7123('0x39')]);_0x393680['filters']=_[_0x7123('0x3b')](_0x393680['model'],_0x393680['query']);_0x2f199c['attributes']=_[_0x7123('0x3b')](_0x393680[_0x7123('0x38')],qs[_0x7123('0x3c')](_0xd8af7f[_0x7123('0x39')][_0x7123('0x3c')]));_0x2f199c[_0x7123('0x3d')]=_0x2f199c['attributes'][_0x7123('0x3e')]?_0x2f199c[_0x7123('0x3d')]:_0x393680[_0x7123('0x38')];if(!_0xd8af7f['query'][_0x7123('0x3f')](_0x7123('0x40'))){_0x2f199c[_0x7123('0x24')]=qs[_0x7123('0x24')](_0xd8af7f[_0x7123('0x39')][_0x7123('0x24')]);_0x2f199c[_0x7123('0x25')]=qs[_0x7123('0x25')](_0xd8af7f[_0x7123('0x39')][_0x7123('0x25')]);}_0x2f199c[_0x7123('0x41')]=qs[_0x7123('0x42')](_0xd8af7f[_0x7123('0x39')]['sort']);_0x2f199c['where']=qs[_0x7123('0x43')](_[_0x7123('0x44')](_0xd8af7f[_0x7123('0x39')],_0x393680[_0x7123('0x43')]),_0x3e91cb);if(_0xd8af7f[_0x7123('0x39')][_0x7123('0x45')]){_0x2f199c[_0x7123('0x46')]=_[_0x7123('0x47')](_0x2f199c['where'],{'$or':_[_0x7123('0x32')](_0x3e91cb,function(_0x59c3cb){if(_0x59c3cb['type']!==_0x7123('0x48')){var _0x2c09eb={};_0x2c09eb[_0x59c3cb[_0x7123('0x30')]]={'$like':'%'+_0xd8af7f[_0x7123('0x39')][_0x7123('0x45')]+'%'};return _0x2c09eb;}})});}_0x2f199c=_[_0x7123('0x47')]({},_0x2f199c,_0xd8af7f[_0x7123('0x49')]);var _0x127e4c={'where':_0x2f199c[_0x7123('0x46')]};return db[_0x7123('0x33')][_0x7123('0x26')](_0x127e4c)['then'](function(_0x4a8f65){_0x1c2df4['count']=_0x4a8f65;if(_0xd8af7f[_0x7123('0x39')][_0x7123('0x4a')]){_0x2f199c[_0x7123('0x4b')]=[{'all':!![]}];}return db[_0x7123('0x33')]['findAll'](_0x2f199c);})['then'](function(_0x553732){_0x1c2df4[_0x7123('0x4c')]=_0x553732;return _0x1c2df4;})[_0x7123('0x2c')](respondWithFilteredResult(_0x4a9740,_0x2f199c))[_0x7123('0x4d')](handleError(_0x4a9740,null));};exports[_0x7123('0x4e')]=function(_0x34c671,_0x15ab33){var _0x3fa6a7={'raw':![],'where':{'id':_0x34c671[_0x7123('0x4f')]['id']}},_0x54216d={};_0x54216d[_0x7123('0x38')]=_[_0x7123('0x3a')](db[_0x7123('0x33')]['rawAttributes']);_0x54216d['query']=_['keys'](_0x34c671['query']);_0x54216d[_0x7123('0x43')]=_[_0x7123('0x3b')](_0x54216d[_0x7123('0x38')],_0x54216d[_0x7123('0x39')]);_0x3fa6a7[_0x7123('0x3d')]=_[_0x7123('0x3b')](_0x54216d[_0x7123('0x38')],qs['fields'](_0x34c671[_0x7123('0x39')][_0x7123('0x3c')]));_0x3fa6a7[_0x7123('0x3d')]=_0x3fa6a7[_0x7123('0x3d')][_0x7123('0x3e')]?_0x3fa6a7[_0x7123('0x3d')]:_0x54216d[_0x7123('0x38')];if(_0x34c671[_0x7123('0x39')][_0x7123('0x4a')]){_0x3fa6a7[_0x7123('0x4b')]=[{'all':!![]}];}_0x3fa6a7=_[_0x7123('0x47')]({},_0x3fa6a7,_0x34c671[_0x7123('0x49')]);return db[_0x7123('0x33')][_0x7123('0x50')](_0x3fa6a7)[_0x7123('0x2c')](handleEntityNotFound(_0x15ab33,null))[_0x7123('0x2c')](respondWithResult(_0x15ab33,null))[_0x7123('0x4d')](handleError(_0x15ab33,null));};exports['create']=function(_0xbac39e,_0xe99595){return db['VoiceQueueReport'][_0x7123('0x51')](_0xbac39e[_0x7123('0x52')],{})['then'](respondWithResult(_0xe99595,0xc9))[_0x7123('0x4d')](handleError(_0xe99595,null));};exports[_0x7123('0x2b')]=function(_0x29de5f,_0x2630f6){if(_0x29de5f[_0x7123('0x52')]['id']){delete _0x29de5f[_0x7123('0x52')]['id'];}return db[_0x7123('0x33')]['find']({'where':{'id':_0x29de5f[_0x7123('0x4f')]['id']}})[_0x7123('0x2c')](handleEntityNotFound(_0x2630f6,null))['then'](saveUpdates(_0x29de5f['body'],null))['then'](respondWithResult(_0x2630f6,null))[_0x7123('0x4d')](handleError(_0x2630f6,null));};exports[_0x7123('0x2d')]=function(_0x21e0ba,_0x15fa95){return db[_0x7123('0x33')]['find']({'where':{'id':_0x21e0ba[_0x7123('0x4f')]['id']}})[_0x7123('0x2c')](handleEntityNotFound(_0x15fa95,null))['then'](removeEntity(_0x15fa95,null))[_0x7123('0x4d')](handleError(_0x15fa95,null));};exports[_0x7123('0x53')]=function(_0x367401,_0x10bc26){return db[_0x7123('0x33')][_0x7123('0x53')]()['then'](respondWithResult(_0x10bc26,null))['catch'](handleError(_0x10bc26,null));};exports[_0x7123('0x54')]=function(_0x3a467d,_0x6d670){var _0x14ebd2={},_0x559d33={},_0x1f9ab1={'count':0x0,'rows':[]};_0x559d33[_0x7123('0x38')]=_[_0x7123('0x3a')](db[_0x7123('0x33')]['rawAttributes']);_0x559d33[_0x7123('0x39')]=_['keys'](_0x3a467d['query']);_0x559d33[_0x7123('0x43')]=_['intersection'](_0x559d33['model'],_0x559d33[_0x7123('0x39')]);_0x14ebd2['attributes']=_[_0x7123('0x3b')](_0x559d33[_0x7123('0x38')],qs['fields'](_0x3a467d[_0x7123('0x39')][_0x7123('0x3c')]));_0x14ebd2[_0x7123('0x3d')]=_0x14ebd2[_0x7123('0x3d')][_0x7123('0x3e')]?_0x14ebd2[_0x7123('0x3d')]:_0x559d33[_0x7123('0x38')];if(!_0x3a467d[_0x7123('0x39')]['hasOwnProperty'](_0x7123('0x40'))){_0x14ebd2['limit']=qs['limit'](_0x3a467d[_0x7123('0x39')][_0x7123('0x24')]);_0x14ebd2[_0x7123('0x25')]=qs['offset'](_0x3a467d['query'][_0x7123('0x25')]);}_0x14ebd2[_0x7123('0x41')]=qs[_0x7123('0x42')](_0x3a467d[_0x7123('0x39')][_0x7123('0x42')]);_0x14ebd2[_0x7123('0x46')]=qs[_0x7123('0x43')](_[_0x7123('0x44')](_0x3a467d[_0x7123('0x39')],_0x559d33[_0x7123('0x43')]));if(_0x3a467d[_0x7123('0x39')]['filter']){_0x14ebd2['where']=_['merge'](_0x14ebd2['where'],{'$or':_[_0x7123('0x32')](_0x14ebd2[_0x7123('0x3d')],function(_0x2f8c31){var _0x548287={};_0x548287[_0x2f8c31]={'$like':'%'+_0x3a467d['query'][_0x7123('0x45')]+'%'};return _0x548287;})});}_0x14ebd2=_[_0x7123('0x47')]({},_0x14ebd2,_0x3a467d[_0x7123('0x49')]);var _0x2d5076={'where':_0x14ebd2[_0x7123('0x46')]};return db[_0x7123('0x33')]['count'](_0x2d5076)['then'](function(_0x5f5307){_0x1f9ab1[_0x7123('0x26')]=_0x5f5307;if(_0x3a467d['query'][_0x7123('0x4a')]){_0x14ebd2[_0x7123('0x4b')]=[{'all':!![]}];}return db[_0x7123('0x33')]['findAll'](_0x14ebd2);})[_0x7123('0x2c')](function(_0x3ee3eb){_0x1f9ab1[_0x7123('0x4c')]=_0x3ee3eb;return _0x1f9ab1;})[_0x7123('0x2c')](respondWithFilteredResult(_0x6d670,_0x14ebd2,'getVoiceQueuesReport'))[_0x7123('0x4d')](handleError(_0x6d670,null,_0x7123('0x54')));}; \ No newline at end of file +var _0x92d5=['set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','create','body','find','describe','getVoiceQueuesReport','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','offset','undefined','limit','count'];(function(_0x8e889a,_0x4a9814){var _0x742950=function(_0x142753){while(--_0x142753){_0x8e889a['push'](_0x8e889a['shift']());}};_0x742950(++_0x4a9814);}(_0x92d5,0x7f));var _0x592d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x92d5[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x592d('0x0'));var rimraf=require(_0x592d('0x1'));var zipdir=require(_0x592d('0x2'));var jsonpatch=require(_0x592d('0x3'));var rp=require(_0x592d('0x4'));var moment=require(_0x592d('0x5'));var BPromise=require(_0x592d('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x592d('0x7'));var sox=require(_0x592d('0x8'));var csv=require(_0x592d('0x9'));var ejs=require(_0x592d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x592d('0xb'));var squel=require(_0x592d('0xc'));var crypto=require(_0x592d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x592d('0xe'));var toCsv=require(_0x592d('0x9'));var querystring=require('querystring');var Papa=require(_0x592d('0xf'));var Redis=require(_0x592d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x592d('0x11'));var as=require(_0x592d('0x12'));var hardwareService=require(_0x592d('0x13'));var logger=require(_0x592d('0x14'))(_0x592d('0x15'));var utils=require('../../config/utils');var config=require(_0x592d('0x16'));var licenseUtil=require(_0x592d('0x17'));var db=require(_0x592d('0x18'))['db'];config[_0x592d('0x19')]=_[_0x592d('0x1a')](config[_0x592d('0x19')],{'host':_0x592d('0x1b'),'port':0x18eb});var socket=require(_0x592d('0x1c'))(new Redis(config[_0x592d('0x19')]));require(_0x592d('0x1d'))[_0x592d('0x1e')](socket);function respondWithStatusCode(_0x5aad72,_0x3051bf){_0x3051bf=_0x3051bf||0xcc;return function(_0xe62884){if(_0xe62884){return _0x5aad72[_0x592d('0x1f')](_0x3051bf);}return _0x5aad72['status'](_0x3051bf)['end']();};}function respondWithResult(_0x35b44d,_0x4c21e2){_0x4c21e2=_0x4c21e2||0xc8;return function(_0x365a9e){if(_0x365a9e){return _0x35b44d[_0x592d('0x20')](_0x4c21e2)['json'](_0x365a9e);}};}function respondWithFilteredResult(_0x5541a0,_0x1595ab){return function(_0x2dfb37){if(_0x2dfb37){var _0x2a3863=typeof _0x1595ab[_0x592d('0x21')]===_0x592d('0x22')&&typeof _0x1595ab[_0x592d('0x23')]===_0x592d('0x22');var _0x5e48db=_0x2dfb37[_0x592d('0x24')];var _0x2ee0e9=_0x2a3863?0x0:_0x1595ab[_0x592d('0x21')];var _0x31f9b9=_0x2a3863?_0x2dfb37[_0x592d('0x24')]:_0x1595ab[_0x592d('0x21')]+_0x1595ab['limit'];var _0x427e17;if(_0x31f9b9>=_0x5e48db){_0x31f9b9=_0x5e48db;_0x427e17=0xc8;}else{_0x427e17=0xce;}_0x5541a0['status'](_0x427e17);return _0x5541a0[_0x592d('0x25')](_0x592d('0x26'),_0x2ee0e9+'-'+_0x31f9b9+'/'+_0x5e48db)['json'](_0x2dfb37);}return null;};}function patchUpdates(_0xa9b227){return function(_0x22a7d3){try{jsonpatch[_0x592d('0x27')](_0x22a7d3,_0xa9b227,!![]);}catch(_0x209761){return BPromise[_0x592d('0x28')](_0x209761);}return _0x22a7d3['save']();};}function saveUpdates(_0x2aff31,_0x2b1cb5){return function(_0x5e8012){if(_0x5e8012){return _0x5e8012['update'](_0x2aff31)[_0x592d('0x29')](function(_0xc06670){return _0xc06670;});}return null;};}function removeEntity(_0x155649,_0x4b9609){return function(_0x5514cd){if(_0x5514cd){return _0x5514cd[_0x592d('0x2a')]()[_0x592d('0x29')](function(){_0x155649[_0x592d('0x20')](0xcc)[_0x592d('0x2b')]();});}};}function handleEntityNotFound(_0x3bc2df,_0x5e7f7a){return function(_0x568e05){if(!_0x568e05){_0x3bc2df[_0x592d('0x1f')](0x194);}return _0x568e05;};}function handleError(_0x3a137e,_0x3a27f0){_0x3a27f0=_0x3a27f0||0x1f4;return function(_0x1cab57){logger[_0x592d('0x2c')](_0x1cab57[_0x592d('0x2d')]);if(_0x1cab57['name']){delete _0x1cab57[_0x592d('0x2e')];}_0x3a137e[_0x592d('0x20')](_0x3a27f0)[_0x592d('0x2f')](_0x1cab57);};}exports[_0x592d('0x30')]=function(_0x4942fa,_0x2f2ad0){var _0x524dd1={},_0x218188={},_0x381201={'count':0x0,'rows':[]};var _0xa72183=_[_0x592d('0x31')](db[_0x592d('0x32')][_0x592d('0x33')],function(_0x3b70ed){return{'name':_0x3b70ed['fieldName'],'type':_0x3b70ed[_0x592d('0x34')][_0x592d('0x35')]};});_0x218188[_0x592d('0x36')]=_[_0x592d('0x31')](_0xa72183,'name');_0x218188[_0x592d('0x37')]=_[_0x592d('0x38')](_0x4942fa[_0x592d('0x37')]);_0x218188[_0x592d('0x39')]=_['intersection'](_0x218188[_0x592d('0x36')],_0x218188[_0x592d('0x37')]);_0x524dd1[_0x592d('0x3a')]=_['intersection'](_0x218188[_0x592d('0x36')],qs[_0x592d('0x3b')](_0x4942fa['query'][_0x592d('0x3b')]));_0x524dd1[_0x592d('0x3a')]=_0x524dd1[_0x592d('0x3a')][_0x592d('0x3c')]?_0x524dd1[_0x592d('0x3a')]:_0x218188[_0x592d('0x36')];if(!_0x4942fa[_0x592d('0x37')][_0x592d('0x3d')]('nolimit')){_0x524dd1[_0x592d('0x23')]=qs[_0x592d('0x23')](_0x4942fa['query'][_0x592d('0x23')]);_0x524dd1[_0x592d('0x21')]=qs[_0x592d('0x21')](_0x4942fa['query']['offset']);}_0x524dd1[_0x592d('0x3e')]=qs['sort'](_0x4942fa[_0x592d('0x37')][_0x592d('0x3f')]);_0x524dd1['where']=qs[_0x592d('0x39')](_['pick'](_0x4942fa[_0x592d('0x37')],_0x218188[_0x592d('0x39')]),_0xa72183);if(_0x4942fa[_0x592d('0x37')][_0x592d('0x40')]){_0x524dd1[_0x592d('0x41')]=_[_0x592d('0x42')](_0x524dd1[_0x592d('0x41')],{'$or':_['map'](_0xa72183,function(_0x347b0a){if(_0x347b0a['type']!=='VIRTUAL'){var _0x4ba9aa={};_0x4ba9aa[_0x347b0a[_0x592d('0x2e')]]={'$like':'%'+_0x4942fa[_0x592d('0x37')]['filter']+'%'};return _0x4ba9aa;}})});}_0x524dd1=_[_0x592d('0x42')]({},_0x524dd1,_0x4942fa[_0x592d('0x43')]);var _0x4bb3ce={'where':_0x524dd1[_0x592d('0x41')]};return db['VoiceQueueReport'][_0x592d('0x24')](_0x4bb3ce)[_0x592d('0x29')](function(_0x5a8f8e){_0x381201[_0x592d('0x24')]=_0x5a8f8e;if(_0x4942fa[_0x592d('0x37')][_0x592d('0x44')]){_0x524dd1[_0x592d('0x45')]=[{'all':!![]}];}return db[_0x592d('0x32')][_0x592d('0x46')](_0x524dd1);})['then'](function(_0x2e48d2){_0x381201[_0x592d('0x47')]=_0x2e48d2;return _0x381201;})['then'](respondWithFilteredResult(_0x2f2ad0,_0x524dd1))[_0x592d('0x48')](handleError(_0x2f2ad0,null));};exports[_0x592d('0x49')]=function(_0x10e207,_0x36c0e5){var _0x59145e={'raw':![],'where':{'id':_0x10e207[_0x592d('0x4a')]['id']}},_0x3104d0={};_0x3104d0[_0x592d('0x36')]=_[_0x592d('0x38')](db[_0x592d('0x32')][_0x592d('0x33')]);_0x3104d0['query']=_[_0x592d('0x38')](_0x10e207[_0x592d('0x37')]);_0x3104d0['filters']=_[_0x592d('0x4b')](_0x3104d0[_0x592d('0x36')],_0x3104d0[_0x592d('0x37')]);_0x59145e['attributes']=_[_0x592d('0x4b')](_0x3104d0['model'],qs[_0x592d('0x3b')](_0x10e207[_0x592d('0x37')][_0x592d('0x3b')]));_0x59145e[_0x592d('0x3a')]=_0x59145e[_0x592d('0x3a')][_0x592d('0x3c')]?_0x59145e[_0x592d('0x3a')]:_0x3104d0['model'];if(_0x10e207['query'][_0x592d('0x44')]){_0x59145e[_0x592d('0x45')]=[{'all':!![]}];}_0x59145e=_['merge']({},_0x59145e,_0x10e207['options']);return db[_0x592d('0x32')]['find'](_0x59145e)[_0x592d('0x29')](handleEntityNotFound(_0x36c0e5,null))[_0x592d('0x29')](respondWithResult(_0x36c0e5,null))[_0x592d('0x48')](handleError(_0x36c0e5,null));};exports[_0x592d('0x4c')]=function(_0x2e7075,_0x29feba){return db['VoiceQueueReport'][_0x592d('0x4c')](_0x2e7075[_0x592d('0x4d')],{})['then'](respondWithResult(_0x29feba,0xc9))[_0x592d('0x48')](handleError(_0x29feba,null));};exports['update']=function(_0x246641,_0x597816){if(_0x246641['body']['id']){delete _0x246641[_0x592d('0x4d')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x246641[_0x592d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x597816,null))[_0x592d('0x29')](saveUpdates(_0x246641['body'],null))[_0x592d('0x29')](respondWithResult(_0x597816,null))[_0x592d('0x48')](handleError(_0x597816,null));};exports[_0x592d('0x2a')]=function(_0x2ff51e,_0x2627ab){return db['VoiceQueueReport'][_0x592d('0x4e')]({'where':{'id':_0x2ff51e[_0x592d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2627ab,null))[_0x592d('0x29')](removeEntity(_0x2627ab,null))[_0x592d('0x48')](handleError(_0x2627ab,null));};exports[_0x592d('0x4f')]=function(_0x28e35e,_0x5b874e){return db[_0x592d('0x32')][_0x592d('0x4f')]()['then'](respondWithResult(_0x5b874e,null))[_0x592d('0x48')](handleError(_0x5b874e,null));};exports[_0x592d('0x50')]=function(_0x10c5ad,_0x3745c8){var _0x3f1638={},_0x39d24c={},_0x2ad502={'count':0x0,'rows':[]};_0x39d24c[_0x592d('0x36')]=_['keys'](db[_0x592d('0x32')][_0x592d('0x33')]);_0x39d24c[_0x592d('0x37')]=_[_0x592d('0x38')](_0x10c5ad[_0x592d('0x37')]);_0x39d24c[_0x592d('0x39')]=_[_0x592d('0x4b')](_0x39d24c[_0x592d('0x36')],_0x39d24c[_0x592d('0x37')]);_0x3f1638[_0x592d('0x3a')]=_[_0x592d('0x4b')](_0x39d24c[_0x592d('0x36')],qs[_0x592d('0x3b')](_0x10c5ad[_0x592d('0x37')][_0x592d('0x3b')]));_0x3f1638[_0x592d('0x3a')]=_0x3f1638[_0x592d('0x3a')]['length']?_0x3f1638[_0x592d('0x3a')]:_0x39d24c[_0x592d('0x36')];if(!_0x10c5ad[_0x592d('0x37')]['hasOwnProperty']('nolimit')){_0x3f1638['limit']=qs[_0x592d('0x23')](_0x10c5ad['query']['limit']);_0x3f1638['offset']=qs[_0x592d('0x21')](_0x10c5ad['query'][_0x592d('0x21')]);}_0x3f1638[_0x592d('0x3e')]=qs['sort'](_0x10c5ad[_0x592d('0x37')][_0x592d('0x3f')]);_0x3f1638['where']=qs['filters'](_[_0x592d('0x51')](_0x10c5ad[_0x592d('0x37')],_0x39d24c[_0x592d('0x39')]));if(_0x10c5ad['query'][_0x592d('0x40')]){_0x3f1638[_0x592d('0x41')]=_[_0x592d('0x42')](_0x3f1638[_0x592d('0x41')],{'$or':_[_0x592d('0x31')](_0x3f1638[_0x592d('0x3a')],function(_0x4991c5){var _0x56bb1c={};_0x56bb1c[_0x4991c5]={'$like':'%'+_0x10c5ad['query']['filter']+'%'};return _0x56bb1c;})});}_0x3f1638=_['merge']({},_0x3f1638,_0x10c5ad['options']);var _0x262c5a={'where':_0x3f1638['where']};return db[_0x592d('0x32')]['count'](_0x262c5a)[_0x592d('0x29')](function(_0x49a6df){_0x2ad502['count']=_0x49a6df;if(_0x10c5ad['query'][_0x592d('0x44')]){_0x3f1638[_0x592d('0x45')]=[{'all':!![]}];}return db[_0x592d('0x32')][_0x592d('0x46')](_0x3f1638);})[_0x592d('0x29')](function(_0xf4d292){_0x2ad502[_0x592d('0x47')]=_0xf4d292;return _0x2ad502;})[_0x592d('0x29')](respondWithFilteredResult(_0x3745c8,_0x3f1638,_0x592d('0x50')))[_0x592d('0x48')](handleError(_0x3745c8,null,_0x592d('0x50')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index b47745e..ec56596 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 _0x3132=['../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5374b8,_0x3c43f2){var _0x4b2f1f=function(_0x48c69a){while(--_0x48c69a){_0x5374b8['push'](_0x5374b8['shift']());}};_0x4b2f1f(++_0x3c43f2);}(_0x3132,0x1ee));var _0x2313=function(_0x3f5dca,_0x59472b){_0x3f5dca=_0x3f5dca-0x0;var _0x5b833a=_0x3132[_0x3f5dca];return _0x5b833a;};'use strict';var EventEmitter=require(_0x2313('0x0'));var VoiceQueueReport=require(_0x2313('0x1'))['db'][_0x2313('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x2313('0x3')](0x0);var events={'afterCreate':_0x2313('0x4'),'afterUpdate':_0x2313('0x5'),'afterDestroy':_0x2313('0x6')};function emitEvent(_0x4ad86d){return function(_0x21023c,_0x51a6d0,_0x471e03){VoiceQueueReportEvents[_0x2313('0x7')](_0x4ad86d+':'+_0x21023c['id'],_0x21023c);VoiceQueueReportEvents[_0x2313('0x7')](_0x4ad86d,_0x21023c);_0x471e03(null);};}for(var e in events){if(events[_0x2313('0x8')](e)){var event=events[e];VoiceQueueReport[_0x2313('0x9')](e,emitEvent(event));}}module[_0x2313('0xa')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xce96=['hasOwnProperty','hook','exports','VoiceQueueReport','setMaxListeners','save','update','remove','emit'];(function(_0x4c1a81,_0x3221ed){var _0x1957ba=function(_0x5760b3){while(--_0x5760b3){_0x4c1a81['push'](_0x4c1a81['shift']());}};_0x1957ba(++_0x3221ed);}(_0xce96,0x1e9));var _0x6ce9=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xce96[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x6ce9('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x6ce9('0x1')](0x0);var events={'afterCreate':_0x6ce9('0x2'),'afterUpdate':_0x6ce9('0x3'),'afterDestroy':_0x6ce9('0x4')};function emitEvent(_0x2174db){return function(_0x8d0d44,_0x14aebd,_0x493b66){VoiceQueueReportEvents[_0x6ce9('0x5')](_0x2174db+':'+_0x8d0d44['id'],_0x8d0d44);VoiceQueueReportEvents[_0x6ce9('0x5')](_0x2174db,_0x8d0d44);_0x493b66(null);};}for(var e in events){if(events[_0x6ce9('0x6')](e)){var event=events[e];VoiceQueueReport[_0x6ce9('0x7')](e,emitEvent(event));}}module[_0x6ce9('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 6c68aca..ea32217 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 _0x3339=['define','report_queue','calleridnum','lodash','util','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x27a14c,_0xd7338){var _0x5c8604=function(_0x5cfb09){while(--_0x5cfb09){_0x27a14c['push'](_0x27a14c['shift']());}};_0x5c8604(++_0xd7338);}(_0x3339,0x19d));var _0x9333=function(_0x215a93,_0x549269){_0x215a93=_0x215a93-0x0;var _0x41435f=_0x3339[_0x215a93];return _0x41435f;};'use strict';var _=require(_0x9333('0x0'));var util=require(_0x9333('0x1'));var logger=require(_0x9333('0x2'))(_0x9333('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9333('0x4'));var fs=require('fs');var path=require(_0x9333('0x5'));var rimraf=require('rimraf');var config=require(_0x9333('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x10c741,_0x4e19c7){return _0x10c741[_0x9333('0x7')]('VoiceQueueReport',attributes,{'tableName':_0x9333('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x9333('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0773=['define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','api','moment','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','exports'];(function(_0x5e01c5,_0x58c317){var _0xfab2f8=function(_0xbc1fb5){while(--_0xbc1fb5){_0x5e01c5['push'](_0x5e01c5['shift']());}};_0xfab2f8(++_0x58c317);}(_0x0773,0xa1));var _0x3077=function(_0x1f9074,_0x1444d6){_0x1f9074=_0x1f9074-0x0;var _0x4fac7c=_0x0773[_0x1f9074];return _0x4fac7c;};'use strict';var _=require('lodash');var util=require(_0x3077('0x0'));var logger=require('../../config/logger')(_0x3077('0x1'));var moment=require(_0x3077('0x2'));var BPromise=require('bluebird');var rp=require(_0x3077('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3077('0x4'));var config=require(_0x3077('0x5'));var attributes=require(_0x3077('0x6'));module[_0x3077('0x7')]=function(_0x2a15b1,_0x4cb8fc){return _0x2a15b1[_0x3077('0x8')](_0x3077('0x9'),attributes,{'tableName':_0x3077('0xa'),'paranoid':![],'indexes':[{'fields':[_0x3077('0xb')]},{'fields':[_0x3077('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 8e7fe37..ace20e9 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 _0xa853=['register','request','then','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','request\x20sent','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','raw','options','where','attributes','limit','include','map','model','debug','stringify','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','lodash','moment','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x8879b2,_0x4ba6a1){var _0x55e2fd=function(_0x55fa49){while(--_0x55fa49){_0x8879b2['push'](_0x8879b2['shift']());}};_0x55e2fd(++_0x4ba6a1);}(_0xa853,0x12c));var _0x3a85=function(_0x24bdac,_0x32c278){_0x24bdac=_0x24bdac-0x0;var _0x1b10cf=_0xa853[_0x24bdac];return _0x1b10cf;};'use strict';var _=require(_0x3a85('0x0'));var util=require('util');var moment=require(_0x3a85('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3a85('0x2'));var logger=require(_0x3a85('0x3'))(_0x3a85('0x4'));var config=require(_0x3a85('0x5'));var jayson=require(_0x3a85('0x6'));var client=jayson[_0x3a85('0x7')]['http']({'port':0x232a});config[_0x3a85('0x8')]=_[_0x3a85('0x9')](config[_0x3a85('0x8')],{'host':_0x3a85('0xa'),'port':0x18eb});var socket=require(_0x3a85('0xb'))(new Redis(config[_0x3a85('0x8')]));require('./voiceQueueReport.socket')[_0x3a85('0xc')](socket);function respondWithRpcPromise(_0x211bee,_0x198292,_0x3efed5){return new BPromise(function(_0x57b955,_0x13c168){return client[_0x3a85('0xd')](_0x211bee,_0x3efed5)[_0x3a85('0xe')](function(_0x3489ff){logger['info'](_0x3a85('0xf'),_0x198292,'request\x20sent');logger['debug'](_0x3a85('0x10'),_0x198292,'request\x20sent',JSON['stringify'](_0x3489ff));if(_0x3489ff[_0x3a85('0x11')]){if(_0x3489ff[_0x3a85('0x11')]['code']===0x1f4){logger[_0x3a85('0x11')](_0x3a85('0xf'),_0x198292,_0x3489ff[_0x3a85('0x11')][_0x3a85('0x12')]);return _0x13c168(_0x3489ff[_0x3a85('0x11')][_0x3a85('0x12')]);}logger[_0x3a85('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x198292,_0x3489ff[_0x3a85('0x11')][_0x3a85('0x12')]);return _0x57b955(_0x3489ff[_0x3a85('0x11')][_0x3a85('0x12')]);}else{logger[_0x3a85('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x198292,_0x3a85('0x14'));_0x57b955(_0x3489ff[_0x3a85('0x15')][_0x3a85('0x12')]);}})[_0x3a85('0x16')](function(_0x2e2db6){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x198292,_0x2e2db6);_0x13c168(_0x2e2db6);});});}exports[_0x3a85('0x17')]=function(_0x39cd5e){var _0x1469bc=this;return new Promise(function(_0x32beef,_0x4c9bb4){return db[_0x3a85('0x18')][_0x3a85('0x19')]({'raw':_0x39cd5e['options']?_0x39cd5e['options'][_0x3a85('0x1a')]===undefined?!![]:![]:!![],'where':_0x39cd5e[_0x3a85('0x1b')]?_0x39cd5e[_0x3a85('0x1b')][_0x3a85('0x1c')]||null:null,'attributes':_0x39cd5e[_0x3a85('0x1b')]?_0x39cd5e[_0x3a85('0x1b')][_0x3a85('0x1d')]||null:null,'limit':_0x39cd5e['options']?_0x39cd5e[_0x3a85('0x1b')][_0x3a85('0x1e')]||null:null,'include':_0x39cd5e[_0x3a85('0x1b')]?_0x39cd5e[_0x3a85('0x1b')][_0x3a85('0x1f')]?_[_0x3a85('0x20')](_0x39cd5e[_0x3a85('0x1b')][_0x3a85('0x1f')],function(_0x4e1b07){return{'model':db[_0x4e1b07['model']],'as':_0x4e1b07['as'],'attributes':_0x4e1b07[_0x3a85('0x1d')],'include':_0x4e1b07[_0x3a85('0x1f')]?_[_0x3a85('0x20')](_0x4e1b07[_0x3a85('0x1f')],function(_0xf3b4e4){return{'model':db[_0xf3b4e4[_0x3a85('0x21')]],'as':_0xf3b4e4['as'],'attributes':_0xf3b4e4[_0x3a85('0x1d')],'include':_0xf3b4e4[_0x3a85('0x1f')]?_[_0x3a85('0x20')](_0xf3b4e4[_0x3a85('0x1f')],function(_0x28759e){return{'model':db[_0x28759e['model']],'as':_0x28759e['as'],'attributes':_0x28759e[_0x3a85('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3a85('0xe')](function(_0x53d4fc){logger['info'](_0x3a85('0x17'),_0x39cd5e);logger[_0x3a85('0x22')](_0x3a85('0x17'),_0x39cd5e,JSON[_0x3a85('0x23')](_0x53d4fc));_0x32beef(_0x53d4fc);})[_0x3a85('0x16')](function(_0x2fc366){logger[_0x3a85('0x11')](_0x3a85('0x17'),_0x2fc366[_0x3a85('0x12')],_0x39cd5e);_0x4c9bb4(_0x1469bc['error'](0x1f4,_0x2fc366['message']));});});};exports[_0x3a85('0x24')]=function(_0x51e637){var _0x9c24c0=this;return new Promise(function(_0x4f8a78,_0x271a28){return db[_0x3a85('0x18')]['create'](_0x51e637[_0x3a85('0x25')],{'raw':_0x51e637['options']?_0x51e637[_0x3a85('0x1b')][_0x3a85('0x1a')]===undefined?!![]:![]:!![]})[_0x3a85('0xe')](function(_0x803dd0){logger[_0x3a85('0x13')]('CreateVoiceQueueReport',_0x51e637);logger[_0x3a85('0x22')](_0x3a85('0x24'),_0x51e637,JSON[_0x3a85('0x23')](_0x803dd0));_0x4f8a78(_0x803dd0);})[_0x3a85('0x16')](function(_0x36c6e2){logger[_0x3a85('0x11')]('CreateVoiceQueueReport',_0x36c6e2[_0x3a85('0x12')],_0x51e637);_0x271a28(_0x9c24c0[_0x3a85('0x11')](0x1f4,_0x36c6e2[_0x3a85('0x12')]));});});};exports[_0x3a85('0x26')]=function(_0x111d75){var _0x3d3c5d=this;return new Promise(function(_0x3b3768,_0x1dc8be){return db[_0x3a85('0x18')]['update'](_0x111d75[_0x3a85('0x25')],{'raw':_0x111d75[_0x3a85('0x1b')]?_0x111d75['options'][_0x3a85('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x111d75[_0x3a85('0x1b')]?_0x111d75[_0x3a85('0x1b')]['where']||null:null,'attributes':_0x111d75[_0x3a85('0x1b')]?_0x111d75[_0x3a85('0x1b')][_0x3a85('0x1d')]||null:null,'limit':_0x111d75[_0x3a85('0x1b')]?_0x111d75[_0x3a85('0x1b')][_0x3a85('0x1e')]||null:null})[_0x3a85('0xe')](function(_0x165085){logger[_0x3a85('0x13')](_0x3a85('0x26'),_0x111d75);logger[_0x3a85('0x22')](_0x3a85('0x26'),_0x111d75,JSON[_0x3a85('0x23')](_0x165085));_0x3b3768(_0x165085);})[_0x3a85('0x16')](function(_0x5c5681){logger['error']('UpdateVoiceQueueReport',_0x5c5681[_0x3a85('0x12')],_0x111d75);_0x1dc8be(_0x3d3c5d['error'](0x1f4,_0x5c5681['message']));});});}; \ No newline at end of file +var _0xdd75=['result','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','attributes','include','map','model','debug','catch','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','where','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message'];(function(_0x37d5ff,_0x5ee83b){var _0x146b37=function(_0x596170){while(--_0x596170){_0x37d5ff['push'](_0x37d5ff['shift']());}};_0x146b37(++_0x5ee83b);}(_0xdd75,0xf9));var _0x5dd7=function(_0x12c076,_0x5bef17){_0x12c076=_0x12c076-0x0;var _0x2ddd18=_0xdd75[_0x12c076];return _0x2ddd18;};'use strict';var _=require(_0x5dd7('0x0'));var util=require(_0x5dd7('0x1'));var moment=require('moment');var BPromise=require(_0x5dd7('0x2'));var rs=require(_0x5dd7('0x3'));var fs=require('fs');var Redis=require(_0x5dd7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dd7('0x5'));var logger=require(_0x5dd7('0x6'))(_0x5dd7('0x7'));var config=require(_0x5dd7('0x8'));var jayson=require(_0x5dd7('0x9'));var client=jayson[_0x5dd7('0xa')][_0x5dd7('0xb')]({'port':0x232a});config[_0x5dd7('0xc')]=_[_0x5dd7('0xd')](config[_0x5dd7('0xc')],{'host':_0x5dd7('0xe'),'port':0x18eb});var socket=require(_0x5dd7('0xf'))(new Redis(config['redis']));require(_0x5dd7('0x10'))[_0x5dd7('0x11')](socket);function respondWithRpcPromise(_0xc0e400,_0x21182b,_0x3ff9ee){return new BPromise(function(_0x3ea30f,_0x45c32c){return client[_0x5dd7('0x12')](_0xc0e400,_0x3ff9ee)[_0x5dd7('0x13')](function(_0x4e243e){logger[_0x5dd7('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x21182b,_0x5dd7('0x15'));logger['debug']('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x21182b,_0x5dd7('0x15'),JSON[_0x5dd7('0x16')](_0x4e243e));if(_0x4e243e['error']){if(_0x4e243e[_0x5dd7('0x17')][_0x5dd7('0x18')]===0x1f4){logger[_0x5dd7('0x17')](_0x5dd7('0x19'),_0x21182b,_0x4e243e[_0x5dd7('0x17')][_0x5dd7('0x1a')]);return _0x45c32c(_0x4e243e['error']['message']);}logger[_0x5dd7('0x17')](_0x5dd7('0x19'),_0x21182b,_0x4e243e['error'][_0x5dd7('0x1a')]);return _0x3ea30f(_0x4e243e[_0x5dd7('0x17')][_0x5dd7('0x1a')]);}else{logger[_0x5dd7('0x14')](_0x5dd7('0x19'),_0x21182b,_0x5dd7('0x15'));_0x3ea30f(_0x4e243e[_0x5dd7('0x1b')]['message']);}})['catch'](function(_0x57f1ca){logger[_0x5dd7('0x17')](_0x5dd7('0x19'),_0x21182b,_0x57f1ca);_0x45c32c(_0x57f1ca);});});}exports[_0x5dd7('0x1c')]=function(_0x12be1d){var _0x31f5a9=this;return new Promise(function(_0x54c95e,_0xa943db){return db[_0x5dd7('0x1d')][_0x5dd7('0x1e')]({'raw':_0x12be1d[_0x5dd7('0x1f')]?_0x12be1d[_0x5dd7('0x1f')][_0x5dd7('0x20')]===undefined?!![]:![]:!![],'where':_0x12be1d[_0x5dd7('0x1f')]?_0x12be1d['options']['where']||null:null,'attributes':_0x12be1d[_0x5dd7('0x1f')]?_0x12be1d['options'][_0x5dd7('0x21')]||null:null,'limit':_0x12be1d[_0x5dd7('0x1f')]?_0x12be1d[_0x5dd7('0x1f')]['limit']||null:null,'include':_0x12be1d[_0x5dd7('0x1f')]?_0x12be1d[_0x5dd7('0x1f')][_0x5dd7('0x22')]?_[_0x5dd7('0x23')](_0x12be1d[_0x5dd7('0x1f')]['include'],function(_0x2c61cf){return{'model':db[_0x2c61cf[_0x5dd7('0x24')]],'as':_0x2c61cf['as'],'attributes':_0x2c61cf[_0x5dd7('0x21')],'include':_0x2c61cf['include']?_[_0x5dd7('0x23')](_0x2c61cf[_0x5dd7('0x22')],function(_0x3c9597){return{'model':db[_0x3c9597[_0x5dd7('0x24')]],'as':_0x3c9597['as'],'attributes':_0x3c9597[_0x5dd7('0x21')],'include':_0x3c9597[_0x5dd7('0x22')]?_[_0x5dd7('0x23')](_0x3c9597[_0x5dd7('0x22')],function(_0x2f8b7e){return{'model':db[_0x2f8b7e['model']],'as':_0x2f8b7e['as'],'attributes':_0x2f8b7e[_0x5dd7('0x21')]};}):[]};}):[]};}):[]:[]})[_0x5dd7('0x13')](function(_0x5e6cb9){logger['info']('GetVoiceQueueReport',_0x12be1d);logger[_0x5dd7('0x25')](_0x5dd7('0x1c'),_0x12be1d,JSON['stringify'](_0x5e6cb9));_0x54c95e(_0x5e6cb9);})[_0x5dd7('0x26')](function(_0x36b203){logger['error'](_0x5dd7('0x1c'),_0x36b203['message'],_0x12be1d);_0xa943db(_0x31f5a9[_0x5dd7('0x17')](0x1f4,_0x36b203[_0x5dd7('0x1a')]));});});};exports['CreateVoiceQueueReport']=function(_0x3bc476){var _0xa06ce3=this;return new Promise(function(_0x4d1999,_0x198a10){return db[_0x5dd7('0x1d')][_0x5dd7('0x27')](_0x3bc476[_0x5dd7('0x28')],{'raw':_0x3bc476[_0x5dd7('0x1f')]?_0x3bc476[_0x5dd7('0x1f')][_0x5dd7('0x20')]===undefined?!![]:![]:!![]})[_0x5dd7('0x13')](function(_0x133550){logger[_0x5dd7('0x14')](_0x5dd7('0x29'),_0x3bc476);logger[_0x5dd7('0x25')](_0x5dd7('0x29'),_0x3bc476,JSON[_0x5dd7('0x16')](_0x133550));_0x4d1999(_0x133550);})['catch'](function(_0x7544dc){logger[_0x5dd7('0x17')](_0x5dd7('0x29'),_0x7544dc[_0x5dd7('0x1a')],_0x3bc476);_0x198a10(_0xa06ce3[_0x5dd7('0x17')](0x1f4,_0x7544dc[_0x5dd7('0x1a')]));});});};exports[_0x5dd7('0x2a')]=function(_0x15d7b2){var _0x45dc1f=this;return new Promise(function(_0x3c9cfc,_0x50d311){return db[_0x5dd7('0x1d')][_0x5dd7('0x2b')](_0x15d7b2[_0x5dd7('0x28')],{'raw':_0x15d7b2[_0x5dd7('0x1f')]?_0x15d7b2[_0x5dd7('0x1f')][_0x5dd7('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15d7b2[_0x5dd7('0x1f')]?_0x15d7b2[_0x5dd7('0x1f')][_0x5dd7('0x2c')]||null:null,'attributes':_0x15d7b2[_0x5dd7('0x1f')]?_0x15d7b2[_0x5dd7('0x1f')][_0x5dd7('0x21')]||null:null,'limit':_0x15d7b2['options']?_0x15d7b2[_0x5dd7('0x1f')][_0x5dd7('0x2d')]||null:null})[_0x5dd7('0x13')](function(_0x2ae1e8){logger[_0x5dd7('0x14')](_0x5dd7('0x2a'),_0x15d7b2);logger[_0x5dd7('0x25')](_0x5dd7('0x2a'),_0x15d7b2,JSON[_0x5dd7('0x16')](_0x2ae1e8));_0x3c9cfc(_0x2ae1e8);})[_0x5dd7('0x26')](function(_0xd8b763){logger['error']('UpdateVoiceQueueReport',_0xd8b763['message'],_0x15d7b2);_0x50d311(_0x45dc1f[_0x5dd7('0x17')](0x1f4,_0xd8b763[_0x5dd7('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 5975666..ae60cc2 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 _0xd837=['register','length','save','update','removeListener'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xd837,0x1a1));var _0x7d83=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xd837[_0xb0f7c3];return _0x28ea68;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x7d83('0x0'),'remove',_0x7d83('0x1')];function createListener(_0x3b826e,_0x4d4749){return function(_0x2c1c99){_0x4d4749['emit'](_0x3b826e,_0x2c1c99);};}function removeListener(_0x2556d2,_0xffd170){return function(){VoiceQueueReportEvents[_0x7d83('0x2')](_0x2556d2,_0xffd170);};}exports[_0x7d83('0x3')]=function(_0x375376){for(var _0x312cf5=0x0,_0x2fb1f4=events[_0x7d83('0x4')];_0x312cf5<_0x2fb1f4;_0x312cf5++){var _0x3ee7b6=events[_0x312cf5];var _0x1b2fef=createListener('voiceQueueReport:'+_0x3ee7b6,_0x375376);VoiceQueueReportEvents['on'](_0x3ee7b6,_0x1b2fef);}}; \ No newline at end of file +var _0xcff4=['remove','update','emit','removeListener','register','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x36d221,_0x268765){var _0x15cb44=function(_0x317c54){while(--_0x317c54){_0x36d221['push'](_0x36d221['shift']());}};_0x15cb44(++_0x268765);}(_0xcff4,0x11e));var _0x4cff=function(_0x29db36,_0x3c512f){_0x29db36=_0x29db36-0x0;var _0x71bd1f=_0xcff4[_0x29db36];return _0x71bd1f;};'use strict';var VoiceQueueReportEvents=require(_0x4cff('0x0'));var events=[_0x4cff('0x1'),_0x4cff('0x2'),_0x4cff('0x3')];function createListener(_0x3c4650,_0x627b49){return function(_0x59febf){_0x627b49[_0x4cff('0x4')](_0x3c4650,_0x59febf);};}function removeListener(_0x47a41f,_0x34a2f1){return function(){VoiceQueueReportEvents[_0x4cff('0x5')](_0x47a41f,_0x34a2f1);};}exports[_0x4cff('0x6')]=function(_0x46dfc1){for(var _0x355206=0x0,_0x3c486a=events['length'];_0x355206<_0x3c486a;_0x355206++){var _0x1af778=events[_0x355206];var _0x85a634=createListener(_0x4cff('0x7')+_0x1af778,_0x46dfc1);VoiceQueueReportEvents['on'](_0x1af778,_0x85a634);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index daf7da6..86a2c4f 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 _0x301d=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get'];(function(_0xbc5a19,_0x544769){var _0x4f8f5b=function(_0x52eca3){while(--_0x52eca3){_0xbc5a19['push'](_0xbc5a19['shift']());}};_0x4f8f5b(++_0x544769);}(_0x301d,0xe6));var _0xd301=function(_0x3cb8fb,_0x2f289f){_0x3cb8fb=_0x3cb8fb-0x0;var _0x5bc097=_0x301d[_0x3cb8fb];return _0x5bc097;};'use strict';var multer=require(_0xd301('0x0'));var util=require(_0xd301('0x1'));var path=require(_0xd301('0x2'));var timeout=require(_0xd301('0x3'));var express=require(_0xd301('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd301('0x5'));var interaction=require(_0xd301('0x6'));var config=require(_0xd301('0x7'));var controller=require(_0xd301('0x8'));router[_0xd301('0x9')]('/',auth[_0xd301('0xa')](),controller['index']);router[_0xd301('0x9')](_0xd301('0xb'),auth[_0xd301('0xa')](),controller[_0xd301('0xc')]);router[_0xd301('0xd')]('/',auth['isAuthenticated'](),controller[_0xd301('0xe')]);router[_0xd301('0xf')](_0xd301('0xb'),auth['isAuthenticated'](),controller[_0xd301('0x10')]);router[_0xd301('0x11')]('/:id',auth[_0xd301('0xa')](),controller[_0xd301('0x12')]);module[_0xd301('0x13')]=router; \ No newline at end of file +var _0xbeed=['../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','Router'];(function(_0x39de7e,_0xfa5402){var _0x1d43a8=function(_0x574953){while(--_0x574953){_0x39de7e['push'](_0x39de7e['shift']());}};_0x1d43a8(++_0xfa5402);}(_0xbeed,0xad));var _0xdbee=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xbeed[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0xdbee('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdbee('0x1'));var express=require('express');var router=express[_0xdbee('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdbee('0x3'));var config=require(_0xdbee('0x4'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth[_0xdbee('0x5')](),controller[_0xdbee('0x6')]);router['get'](_0xdbee('0x7'),auth[_0xdbee('0x5')](),controller[_0xdbee('0x8')]);router[_0xdbee('0x9')]('/',auth[_0xdbee('0x5')](),controller[_0xdbee('0xa')]);router[_0xdbee('0xb')](_0xdbee('0x7'),auth['isAuthenticated'](),controller[_0xdbee('0xc')]);router[_0xdbee('0xd')](_0xdbee('0x7'),auth[_0xdbee('0x5')](),controller[_0xdbee('0xe')]);module[_0xdbee('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 9ad48c6..88d818f 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 _0x3a43=['exports','STRING','DATE','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','moment'];(function(_0xb2acc,_0x3a5e45){var _0x5a59f8=function(_0x10c33c){while(--_0x10c33c){_0xb2acc['push'](_0xb2acc['shift']());}};_0x5a59f8(++_0x3a5e45);}(_0x3a43,0x1a9));var _0x33a4=function(_0x43a5c7,_0x2286bf){_0x43a5c7=_0x43a5c7-0x0;var _0x3b12a2=_0x3a43[_0x43a5c7];return _0x3b12a2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x33a4('0x0'));module[_0x33a4('0x1')]={'time':{'type':Sequelize[_0x33a4('0x2')]},'callid':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x33a4('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x33a4('0x3')],'allowNull':![],'defaultValue':Sequelize[_0x33a4('0x4')](_0x33a4('0x5'))}}; \ No newline at end of file +var _0x49d9=['moment','STRING','DATE','sequelize'];(function(_0x4582e9,_0x2aee96){var _0x24ca51=function(_0x343bdf){while(--_0x343bdf){_0x4582e9['push'](_0x4582e9['shift']());}};_0x24ca51(++_0x2aee96);}(_0x49d9,0xfb));var _0x949d=function(_0x21198c,_0x10c7ff){_0x21198c=_0x21198c-0x0;var _0x113d00=_0x49d9[_0x21198c];return _0x113d00;};'use strict';var Sequelize=require(_0x949d('0x0'));var moment=require(_0x949d('0x1'));module['exports']={'time':{'type':Sequelize[_0x949d('0x2')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x949d('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x949d('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x949d('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x949d('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x949d('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x949d('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x949d('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x949d('0x3')],'allowNull':![],'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 2c03df3..9311a93 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 _0x2f5d=['where','pick','filters','filter','VIRTUAL','merge','options','include','rows','catch','show','keys','rawAttributes','attributes','length','includeAll','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','intersection','fields','hasOwnProperty','sort'];(function(_0x38f26c,_0x303ab2){var _0x3b8899=function(_0x4de57c){while(--_0x4de57c){_0x38f26c['push'](_0x38f26c['shift']());}};_0x3b8899(++_0x303ab2);}(_0x2f5d,0x1d6));var _0xd2f5=function(_0x13d7ec,_0x185d9b){_0x13d7ec=_0x13d7ec-0x0;var _0xccca37=_0x2f5d[_0x13d7ec];return _0xccca37;};'use strict';var emlformat=require(_0xd2f5('0x0'));var rimraf=require(_0xd2f5('0x1'));var zipdir=require(_0xd2f5('0x2'));var jsonpatch=require(_0xd2f5('0x3'));var rp=require(_0xd2f5('0x4'));var moment=require(_0xd2f5('0x5'));var BPromise=require(_0xd2f5('0x6'));var Mustache=require(_0xd2f5('0x7'));var util=require(_0xd2f5('0x8'));var path=require(_0xd2f5('0x9'));var sox=require(_0xd2f5('0xa'));var csv=require(_0xd2f5('0xb'));var ejs=require(_0xd2f5('0xc'));var fs=require('fs');var fs_extra=require(_0xd2f5('0xd'));var _=require(_0xd2f5('0xe'));var squel=require(_0xd2f5('0xf'));var crypto=require(_0xd2f5('0x10'));var jsforce=require(_0xd2f5('0x11'));var deskjs=require(_0xd2f5('0x12'));var toCsv=require(_0xd2f5('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd2f5('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd2f5('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd2f5('0x15'));var logger=require(_0xd2f5('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xd2f5('0x17'));var licenseUtil=require(_0xd2f5('0x18'));var db=require(_0xd2f5('0x19'))['db'];function respondWithStatusCode(_0x185ced,_0x29a365){_0x29a365=_0x29a365||0xcc;return function(_0x5ea01e){if(_0x5ea01e){return _0x185ced['sendStatus'](_0x29a365);}return _0x185ced[_0xd2f5('0x1a')](_0x29a365)[_0xd2f5('0x1b')]();};}function respondWithResult(_0xc29722,_0xcb7e65){_0xcb7e65=_0xcb7e65||0xc8;return function(_0xff1cfb){if(_0xff1cfb){return _0xc29722[_0xd2f5('0x1a')](_0xcb7e65)[_0xd2f5('0x1c')](_0xff1cfb);}};}function respondWithFilteredResult(_0xc1c282,_0x377a47){return function(_0x15102b){if(_0x15102b){var _0xb8b815=typeof _0x377a47['offset']==='undefined'&&typeof _0x377a47[_0xd2f5('0x1d')]===_0xd2f5('0x1e');var _0x49ec96=_0x15102b[_0xd2f5('0x1f')];var _0x333b5d=_0xb8b815?0x0:_0x377a47[_0xd2f5('0x20')];var _0x9270fd=_0xb8b815?_0x15102b['count']:_0x377a47[_0xd2f5('0x20')]+_0x377a47[_0xd2f5('0x1d')];var _0x59cef2;if(_0x9270fd>=_0x49ec96){_0x9270fd=_0x49ec96;_0x59cef2=0xc8;}else{_0x59cef2=0xce;}_0xc1c282[_0xd2f5('0x1a')](_0x59cef2);return _0xc1c282[_0xd2f5('0x21')]('Content-Range',_0x333b5d+'-'+_0x9270fd+'/'+_0x49ec96)[_0xd2f5('0x1c')](_0x15102b);}return null;};}function patchUpdates(_0x3c934a){return function(_0x5c044d){try{jsonpatch[_0xd2f5('0x22')](_0x5c044d,_0x3c934a,!![]);}catch(_0x57c646){return BPromise[_0xd2f5('0x23')](_0x57c646);}return _0x5c044d[_0xd2f5('0x24')]();};}function saveUpdates(_0xc07ad6,_0x2264bf){return function(_0x34ea56){if(_0x34ea56){return _0x34ea56[_0xd2f5('0x25')](_0xc07ad6)[_0xd2f5('0x26')](function(_0xd8ae43){return _0xd8ae43;});}return null;};}function removeEntity(_0x231619,_0x40072e){return function(_0x19d57d){if(_0x19d57d){return _0x19d57d[_0xd2f5('0x27')]()[_0xd2f5('0x26')](function(){_0x231619['status'](0xcc)[_0xd2f5('0x1b')]();});}};}function handleEntityNotFound(_0x3aa8cd,_0x501c82){return function(_0x317f5e){if(!_0x317f5e){_0x3aa8cd[_0xd2f5('0x28')](0x194);}return _0x317f5e;};}function handleError(_0x53f7f3,_0x52ef97){_0x52ef97=_0x52ef97||0x1f4;return function(_0x35eb88){logger['error'](_0x35eb88[_0xd2f5('0x29')]);if(_0x35eb88[_0xd2f5('0x2a')]){delete _0x35eb88[_0xd2f5('0x2a')];}_0x53f7f3['status'](_0x52ef97)[_0xd2f5('0x2b')](_0x35eb88);};}exports['index']=function(_0x56c1c2,_0x42582f){var _0xccb264={},_0x1a9c6f={},_0x571bb8={'count':0x0,'rows':[]};var _0x21ffa5=_[_0xd2f5('0x2c')](db[_0xd2f5('0x2d')]['rawAttributes'],function(_0x5176fb){return{'name':_0x5176fb[_0xd2f5('0x2e')],'type':_0x5176fb[_0xd2f5('0x2f')][_0xd2f5('0x30')]};});_0x1a9c6f[_0xd2f5('0x31')]=_['map'](_0x21ffa5,_0xd2f5('0x2a'));_0x1a9c6f['query']=_['keys'](_0x56c1c2[_0xd2f5('0x32')]);_0x1a9c6f['filters']=_['intersection'](_0x1a9c6f[_0xd2f5('0x31')],_0x1a9c6f['query']);_0xccb264['attributes']=_[_0xd2f5('0x33')](_0x1a9c6f[_0xd2f5('0x31')],qs[_0xd2f5('0x34')](_0x56c1c2[_0xd2f5('0x32')]['fields']));_0xccb264['attributes']=_0xccb264['attributes']['length']?_0xccb264['attributes']:_0x1a9c6f[_0xd2f5('0x31')];if(!_0x56c1c2[_0xd2f5('0x32')][_0xd2f5('0x35')]('nolimit')){_0xccb264[_0xd2f5('0x1d')]=qs[_0xd2f5('0x1d')](_0x56c1c2[_0xd2f5('0x32')][_0xd2f5('0x1d')]);_0xccb264['offset']=qs[_0xd2f5('0x20')](_0x56c1c2[_0xd2f5('0x32')][_0xd2f5('0x20')]);}_0xccb264['order']=qs['sort'](_0x56c1c2[_0xd2f5('0x32')][_0xd2f5('0x36')]);_0xccb264[_0xd2f5('0x37')]=qs['filters'](_[_0xd2f5('0x38')](_0x56c1c2[_0xd2f5('0x32')],_0x1a9c6f[_0xd2f5('0x39')]),_0x21ffa5);if(_0x56c1c2[_0xd2f5('0x32')][_0xd2f5('0x3a')]){_0xccb264[_0xd2f5('0x37')]=_['merge'](_0xccb264['where'],{'$or':_[_0xd2f5('0x2c')](_0x21ffa5,function(_0x3e25f3){if(_0x3e25f3[_0xd2f5('0x2f')]!==_0xd2f5('0x3b')){var _0x8899a={};_0x8899a[_0x3e25f3['name']]={'$like':'%'+_0x56c1c2['query'][_0xd2f5('0x3a')]+'%'};return _0x8899a;}})});}_0xccb264=_[_0xd2f5('0x3c')]({},_0xccb264,_0x56c1c2[_0xd2f5('0x3d')]);var _0x5010c3={'where':_0xccb264[_0xd2f5('0x37')]};return db[_0xd2f5('0x2d')]['count'](_0x5010c3)['then'](function(_0xdd5cc){_0x571bb8[_0xd2f5('0x1f')]=_0xdd5cc;if(_0x56c1c2[_0xd2f5('0x32')]['includeAll']){_0xccb264[_0xd2f5('0x3e')]=[{'all':!![]}];}return db[_0xd2f5('0x2d')]['findAll'](_0xccb264);})['then'](function(_0x332e24){_0x571bb8[_0xd2f5('0x3f')]=_0x332e24;return _0x571bb8;})[_0xd2f5('0x26')](respondWithFilteredResult(_0x42582f,_0xccb264))[_0xd2f5('0x40')](handleError(_0x42582f,null));};exports[_0xd2f5('0x41')]=function(_0x2241d6,_0x27723b){var _0x4dcde4={'raw':!![],'where':{'id':_0x2241d6['params']['id']}},_0x540c5d={};_0x540c5d[_0xd2f5('0x31')]=_[_0xd2f5('0x42')](db[_0xd2f5('0x2d')][_0xd2f5('0x43')]);_0x540c5d[_0xd2f5('0x32')]=_[_0xd2f5('0x42')](_0x2241d6[_0xd2f5('0x32')]);_0x540c5d['filters']=_['intersection'](_0x540c5d[_0xd2f5('0x31')],_0x540c5d['query']);_0x4dcde4[_0xd2f5('0x44')]=_[_0xd2f5('0x33')](_0x540c5d[_0xd2f5('0x31')],qs[_0xd2f5('0x34')](_0x2241d6[_0xd2f5('0x32')][_0xd2f5('0x34')]));_0x4dcde4[_0xd2f5('0x44')]=_0x4dcde4[_0xd2f5('0x44')][_0xd2f5('0x45')]?_0x4dcde4[_0xd2f5('0x44')]:_0x540c5d[_0xd2f5('0x31')];if(_0x2241d6['query'][_0xd2f5('0x46')]){_0x4dcde4[_0xd2f5('0x3e')]=[{'all':!![]}];}_0x4dcde4=_[_0xd2f5('0x3c')]({},_0x4dcde4,_0x2241d6[_0xd2f5('0x3d')]);return db[_0xd2f5('0x2d')][_0xd2f5('0x47')](_0x4dcde4)['then'](handleEntityNotFound(_0x27723b,null))['then'](respondWithResult(_0x27723b,null))[_0xd2f5('0x40')](handleError(_0x27723b,null));};exports[_0xd2f5('0x48')]=function(_0x13be18,_0x43d049){return db['VoiceQueuesLog'][_0xd2f5('0x48')](_0x13be18[_0xd2f5('0x49')],{})['then'](respondWithResult(_0x43d049,0xc9))[_0xd2f5('0x40')](handleError(_0x43d049,null));};exports[_0xd2f5('0x25')]=function(_0x28b720,_0x41a36a){if(_0x28b720[_0xd2f5('0x49')]['id']){delete _0x28b720['body']['id'];}return db[_0xd2f5('0x2d')][_0xd2f5('0x47')]({'where':{'id':_0x28b720[_0xd2f5('0x4a')]['id']}})[_0xd2f5('0x26')](handleEntityNotFound(_0x41a36a,null))[_0xd2f5('0x26')](saveUpdates(_0x28b720[_0xd2f5('0x49')],null))[_0xd2f5('0x26')](respondWithResult(_0x41a36a,null))[_0xd2f5('0x40')](handleError(_0x41a36a,null));};exports['destroy']=function(_0x5ab788,_0xef8cb9){return db[_0xd2f5('0x2d')][_0xd2f5('0x47')]({'where':{'id':_0x5ab788['params']['id']}})[_0xd2f5('0x26')](handleEntityNotFound(_0xef8cb9,null))['then'](removeEntity(_0xef8cb9,null))[_0xd2f5('0x40')](handleError(_0xef8cb9,null));}; \ No newline at end of file +var _0xdfb0=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','intersection','query','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','keys','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x15a805,_0x1f0bc5){var _0xf861be=function(_0x3764fa){while(--_0x3764fa){_0x15a805['push'](_0x15a805['shift']());}};_0xf861be(++_0x1f0bc5);}(_0xdfb0,0x167));var _0x0dfb=function(_0x1b9e50,_0x23bb05){_0x1b9e50=_0x1b9e50-0x0;var _0x36ad0f=_0xdfb0[_0x1b9e50];return _0x36ad0f;};'use strict';var emlformat=require(_0x0dfb('0x0'));var rimraf=require(_0x0dfb('0x1'));var zipdir=require(_0x0dfb('0x2'));var jsonpatch=require(_0x0dfb('0x3'));var rp=require('request-promise');var moment=require(_0x0dfb('0x4'));var BPromise=require(_0x0dfb('0x5'));var Mustache=require(_0x0dfb('0x6'));var util=require(_0x0dfb('0x7'));var path=require(_0x0dfb('0x8'));var sox=require('sox');var csv=require(_0x0dfb('0x9'));var ejs=require(_0x0dfb('0xa'));var fs=require('fs');var fs_extra=require(_0x0dfb('0xb'));var _=require(_0x0dfb('0xc'));var squel=require(_0x0dfb('0xd'));var crypto=require(_0x0dfb('0xe'));var jsforce=require(_0x0dfb('0xf'));var deskjs=require(_0x0dfb('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0dfb('0x11'));var Redis=require(_0x0dfb('0x12'));var authService=require(_0x0dfb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x0dfb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0dfb('0x15'))(_0x0dfb('0x16'));var utils=require(_0x0dfb('0x17'));var config=require(_0x0dfb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0dfb('0x19'))['db'];function respondWithStatusCode(_0x4cfedf,_0x5541db){_0x5541db=_0x5541db||0xcc;return function(_0x269daf){if(_0x269daf){return _0x4cfedf[_0x0dfb('0x1a')](_0x5541db);}return _0x4cfedf['status'](_0x5541db)[_0x0dfb('0x1b')]();};}function respondWithResult(_0x4f32fd,_0x2429b6){_0x2429b6=_0x2429b6||0xc8;return function(_0x83e432){if(_0x83e432){return _0x4f32fd[_0x0dfb('0x1c')](_0x2429b6)[_0x0dfb('0x1d')](_0x83e432);}};}function respondWithFilteredResult(_0x499c29,_0x5a1714){return function(_0x61ea1){if(_0x61ea1){var _0x544d28=typeof _0x5a1714[_0x0dfb('0x1e')]===_0x0dfb('0x1f')&&typeof _0x5a1714[_0x0dfb('0x20')]===_0x0dfb('0x1f');var _0x5e1d16=_0x61ea1[_0x0dfb('0x21')];var _0x31045c=_0x544d28?0x0:_0x5a1714[_0x0dfb('0x1e')];var _0x420045=_0x544d28?_0x61ea1[_0x0dfb('0x21')]:_0x5a1714['offset']+_0x5a1714[_0x0dfb('0x20')];var _0x547835;if(_0x420045>=_0x5e1d16){_0x420045=_0x5e1d16;_0x547835=0xc8;}else{_0x547835=0xce;}_0x499c29['status'](_0x547835);return _0x499c29['set'](_0x0dfb('0x22'),_0x31045c+'-'+_0x420045+'/'+_0x5e1d16)[_0x0dfb('0x1d')](_0x61ea1);}return null;};}function patchUpdates(_0x203367){return function(_0x165ffe){try{jsonpatch[_0x0dfb('0x23')](_0x165ffe,_0x203367,!![]);}catch(_0x204ae3){return BPromise['reject'](_0x204ae3);}return _0x165ffe[_0x0dfb('0x24')]();};}function saveUpdates(_0x54045,_0x42bf3f){return function(_0x3426c7){if(_0x3426c7){return _0x3426c7[_0x0dfb('0x25')](_0x54045)[_0x0dfb('0x26')](function(_0xe39c5f){return _0xe39c5f;});}return null;};}function removeEntity(_0x51cc29,_0x2e2533){return function(_0x5932a2){if(_0x5932a2){return _0x5932a2[_0x0dfb('0x27')]()[_0x0dfb('0x26')](function(){_0x51cc29['status'](0xcc)[_0x0dfb('0x1b')]();});}};}function handleEntityNotFound(_0x8b5b2f,_0x15606a){return function(_0x10d301){if(!_0x10d301){_0x8b5b2f[_0x0dfb('0x1a')](0x194);}return _0x10d301;};}function handleError(_0x547dd6,_0x500c72){_0x500c72=_0x500c72||0x1f4;return function(_0x158ecd){logger[_0x0dfb('0x28')](_0x158ecd[_0x0dfb('0x29')]);if(_0x158ecd[_0x0dfb('0x2a')]){delete _0x158ecd[_0x0dfb('0x2a')];}_0x547dd6[_0x0dfb('0x1c')](_0x500c72)[_0x0dfb('0x2b')](_0x158ecd);};}exports[_0x0dfb('0x2c')]=function(_0x510d6,_0x11975e){var _0xdf461c={},_0xc6a645={},_0x4b6e4e={'count':0x0,'rows':[]};var _0x571d0d=_[_0x0dfb('0x2d')](db[_0x0dfb('0x2e')][_0x0dfb('0x2f')],function(_0x1cf700){return{'name':_0x1cf700['fieldName'],'type':_0x1cf700[_0x0dfb('0x30')][_0x0dfb('0x31')]};});_0xc6a645[_0x0dfb('0x32')]=_[_0x0dfb('0x2d')](_0x571d0d,_0x0dfb('0x2a'));_0xc6a645['query']=_['keys'](_0x510d6['query']);_0xc6a645['filters']=_[_0x0dfb('0x33')](_0xc6a645['model'],_0xc6a645[_0x0dfb('0x34')]);_0xdf461c[_0x0dfb('0x35')]=_[_0x0dfb('0x33')](_0xc6a645[_0x0dfb('0x32')],qs[_0x0dfb('0x36')](_0x510d6[_0x0dfb('0x34')][_0x0dfb('0x36')]));_0xdf461c[_0x0dfb('0x35')]=_0xdf461c[_0x0dfb('0x35')][_0x0dfb('0x37')]?_0xdf461c[_0x0dfb('0x35')]:_0xc6a645[_0x0dfb('0x32')];if(!_0x510d6[_0x0dfb('0x34')]['hasOwnProperty'](_0x0dfb('0x38'))){_0xdf461c[_0x0dfb('0x20')]=qs[_0x0dfb('0x20')](_0x510d6[_0x0dfb('0x34')][_0x0dfb('0x20')]);_0xdf461c[_0x0dfb('0x1e')]=qs[_0x0dfb('0x1e')](_0x510d6['query'][_0x0dfb('0x1e')]);}_0xdf461c[_0x0dfb('0x39')]=qs[_0x0dfb('0x3a')](_0x510d6[_0x0dfb('0x34')][_0x0dfb('0x3a')]);_0xdf461c[_0x0dfb('0x3b')]=qs[_0x0dfb('0x3c')](_[_0x0dfb('0x3d')](_0x510d6[_0x0dfb('0x34')],_0xc6a645[_0x0dfb('0x3c')]),_0x571d0d);if(_0x510d6[_0x0dfb('0x34')][_0x0dfb('0x3e')]){_0xdf461c[_0x0dfb('0x3b')]=_[_0x0dfb('0x3f')](_0xdf461c[_0x0dfb('0x3b')],{'$or':_[_0x0dfb('0x2d')](_0x571d0d,function(_0x440dd5){if(_0x440dd5[_0x0dfb('0x30')]!==_0x0dfb('0x40')){var _0xa0746={};_0xa0746[_0x440dd5[_0x0dfb('0x2a')]]={'$like':'%'+_0x510d6['query'][_0x0dfb('0x3e')]+'%'};return _0xa0746;}})});}_0xdf461c=_[_0x0dfb('0x3f')]({},_0xdf461c,_0x510d6['options']);var _0x50b2ef={'where':_0xdf461c[_0x0dfb('0x3b')]};return db[_0x0dfb('0x2e')][_0x0dfb('0x21')](_0x50b2ef)[_0x0dfb('0x26')](function(_0x6f4aaf){_0x4b6e4e[_0x0dfb('0x21')]=_0x6f4aaf;if(_0x510d6[_0x0dfb('0x34')][_0x0dfb('0x41')]){_0xdf461c[_0x0dfb('0x42')]=[{'all':!![]}];}return db[_0x0dfb('0x2e')]['findAll'](_0xdf461c);})[_0x0dfb('0x26')](function(_0x345edf){_0x4b6e4e[_0x0dfb('0x43')]=_0x345edf;return _0x4b6e4e;})[_0x0dfb('0x26')](respondWithFilteredResult(_0x11975e,_0xdf461c))[_0x0dfb('0x44')](handleError(_0x11975e,null));};exports[_0x0dfb('0x45')]=function(_0x8bfa14,_0x110b8a){var _0x3707d9={'raw':!![],'where':{'id':_0x8bfa14['params']['id']}},_0x269e4f={};_0x269e4f[_0x0dfb('0x32')]=_[_0x0dfb('0x46')](db[_0x0dfb('0x2e')]['rawAttributes']);_0x269e4f['query']=_[_0x0dfb('0x46')](_0x8bfa14[_0x0dfb('0x34')]);_0x269e4f['filters']=_[_0x0dfb('0x33')](_0x269e4f[_0x0dfb('0x32')],_0x269e4f[_0x0dfb('0x34')]);_0x3707d9[_0x0dfb('0x35')]=_['intersection'](_0x269e4f[_0x0dfb('0x32')],qs[_0x0dfb('0x36')](_0x8bfa14['query'][_0x0dfb('0x36')]));_0x3707d9[_0x0dfb('0x35')]=_0x3707d9['attributes'][_0x0dfb('0x37')]?_0x3707d9[_0x0dfb('0x35')]:_0x269e4f[_0x0dfb('0x32')];if(_0x8bfa14['query'][_0x0dfb('0x41')]){_0x3707d9['include']=[{'all':!![]}];}_0x3707d9=_[_0x0dfb('0x3f')]({},_0x3707d9,_0x8bfa14[_0x0dfb('0x47')]);return db[_0x0dfb('0x2e')][_0x0dfb('0x48')](_0x3707d9)[_0x0dfb('0x26')](handleEntityNotFound(_0x110b8a,null))[_0x0dfb('0x26')](respondWithResult(_0x110b8a,null))[_0x0dfb('0x44')](handleError(_0x110b8a,null));};exports[_0x0dfb('0x49')]=function(_0x2d4a5d,_0x1e187f){return db[_0x0dfb('0x2e')]['create'](_0x2d4a5d[_0x0dfb('0x4a')],{})[_0x0dfb('0x26')](respondWithResult(_0x1e187f,0xc9))[_0x0dfb('0x44')](handleError(_0x1e187f,null));};exports['update']=function(_0x32ccfb,_0x2645d9){if(_0x32ccfb[_0x0dfb('0x4a')]['id']){delete _0x32ccfb[_0x0dfb('0x4a')]['id'];}return db[_0x0dfb('0x2e')][_0x0dfb('0x48')]({'where':{'id':_0x32ccfb[_0x0dfb('0x4b')]['id']}})[_0x0dfb('0x26')](handleEntityNotFound(_0x2645d9,null))[_0x0dfb('0x26')](saveUpdates(_0x32ccfb[_0x0dfb('0x4a')],null))['then'](respondWithResult(_0x2645d9,null))[_0x0dfb('0x44')](handleError(_0x2645d9,null));};exports[_0x0dfb('0x27')]=function(_0x30118c,_0x51f4b0){return db[_0x0dfb('0x2e')][_0x0dfb('0x48')]({'where':{'id':_0x30118c['params']['id']}})[_0x0dfb('0x26')](handleEntityNotFound(_0x51f4b0,null))[_0x0dfb('0x26')](removeEntity(_0x51f4b0,null))[_0x0dfb('0x44')](handleError(_0x51f4b0,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index c657463..7dc2b5e 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 _0x255d=['api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','dtm','lodash','../../config/logger'];(function(_0xfa99ba,_0x4d6ba2){var _0x3f2c62=function(_0x15af5a){while(--_0x15af5a){_0xfa99ba['push'](_0xfa99ba['shift']());}};_0x3f2c62(++_0x4d6ba2);}(_0x255d,0xc1));var _0xd255=function(_0xf015c0,_0xbceb0){_0xf015c0=_0xf015c0-0x0;var _0x14a80e=_0x255d[_0xf015c0];return _0x14a80e;};'use strict';var _=require(_0xd255('0x0'));var util=require('util');var logger=require(_0xd255('0x1'))(_0xd255('0x2'));var moment=require(_0xd255('0x3'));var BPromise=require(_0xd255('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd255('0x5'));var rimraf=require(_0xd255('0x6'));var config=require(_0xd255('0x7'));var attributes=require(_0xd255('0x8'));module[_0xd255('0x9')]=function(_0x20c5bb,_0x21b58c){return _0x20c5bb[_0xd255('0xa')](_0xd255('0xb'),attributes,{'tableName':_0xd255('0xc'),'paranoid':![],'indexes':[{'name':_0xd255('0xd'),'fields':['event',_0xd255('0xe')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe65d=['event','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm'];(function(_0x1ec41f,_0xee9fa4){var _0x477a91=function(_0x501543){while(--_0x501543){_0x1ec41f['push'](_0x1ec41f['shift']());}};_0x477a91(++_0xee9fa4);}(_0xe65d,0x1dd));var _0xde65=function(_0x27d978,_0x36f778){_0x27d978=_0x27d978-0x0;var _0x3aa092=_0xe65d[_0x27d978];return _0x3aa092;};'use strict';var _=require(_0xde65('0x0'));var util=require(_0xde65('0x1'));var logger=require(_0xde65('0x2'))('api');var moment=require(_0xde65('0x3'));var BPromise=require(_0xde65('0x4'));var rp=require(_0xde65('0x5'));var fs=require('fs');var path=require(_0xde65('0x6'));var rimraf=require(_0xde65('0x7'));var config=require('../../config/environment');var attributes=require(_0xde65('0x8'));module[_0xde65('0x9')]=function(_0x178138,_0x22e32b){return _0x178138[_0xde65('0xa')](_0xde65('0xb'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0xde65('0xc'),'fields':[_0xde65('0xd'),'dtm']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 97c562c..394d58d 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 _0x500a=['client','http','request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','result','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1b633f,_0x431d3c){var _0x3468d0=function(_0x399a54){while(--_0x399a54){_0x1b633f['push'](_0x1b633f['shift']());}};_0x3468d0(++_0x431d3c);}(_0x500a,0xd6));var _0xa500=function(_0xb61af0,_0x5da44d){_0xb61af0=_0xb61af0-0x0;var _0x2e2eeb=_0x500a[_0xb61af0];return _0x2e2eeb;};'use strict';var _=require('lodash');var util=require(_0xa500('0x0'));var moment=require('moment');var BPromise=require(_0xa500('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa500('0x2'))['db'];var utils=require(_0xa500('0x3'));var logger=require(_0xa500('0x4'))(_0xa500('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa500('0x6')][_0xa500('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3781b0,_0xfa3fea,_0x3b0aa0){return new BPromise(function(_0x4ca517,_0x54dbfc){return client[_0xa500('0x8')](_0x3781b0,_0x3b0aa0)[_0xa500('0x9')](function(_0x456376){logger[_0xa500('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0xfa3fea,_0xa500('0xb'));logger[_0xa500('0xc')](_0xa500('0xd'),_0xfa3fea,_0xa500('0xb'),JSON[_0xa500('0xe')](_0x456376));if(_0x456376[_0xa500('0xf')]){if(_0x456376[_0xa500('0xf')][_0xa500('0x10')]===0x1f4){logger[_0xa500('0xf')](_0xa500('0x11'),_0xfa3fea,_0x456376[_0xa500('0xf')][_0xa500('0x12')]);return _0x54dbfc(_0x456376[_0xa500('0xf')][_0xa500('0x12')]);}logger['error'](_0xa500('0x11'),_0xfa3fea,_0x456376[_0xa500('0xf')][_0xa500('0x12')]);return _0x4ca517(_0x456376[_0xa500('0xf')][_0xa500('0x12')]);}else{logger[_0xa500('0xa')](_0xa500('0x11'),_0xfa3fea,_0xa500('0xb'));_0x4ca517(_0x456376[_0xa500('0x13')]['message']);}})['catch'](function(_0x159ae0){logger[_0xa500('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0xfa3fea,_0x159ae0);_0x54dbfc(_0x159ae0);});});} \ No newline at end of file +var _0x6b40=['stringify','error','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x24eb2f,_0x361426){var _0x231c1b=function(_0x49cc7d){while(--_0x49cc7d){_0x24eb2f['push'](_0x24eb2f['shift']());}};_0x231c1b(++_0x361426);}(_0x6b40,0xcb));var _0x06b4=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x6b40[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x06b4('0x0'));var util=require(_0x06b4('0x1'));var moment=require(_0x06b4('0x2'));var BPromise=require(_0x06b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x06b4('0x4'));var db=require(_0x06b4('0x5'))['db'];var utils=require(_0x06b4('0x6'));var logger=require(_0x06b4('0x7'))('rpc');var config=require(_0x06b4('0x8'));var jayson=require(_0x06b4('0x9'));var client=jayson[_0x06b4('0xa')][_0x06b4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x267d17,_0x26cd84,_0x11b5c9){return new BPromise(function(_0x5083e4,_0xe3a08a){return client[_0x06b4('0xc')](_0x267d17,_0x11b5c9)['then'](function(_0x1e974e){logger['info'](_0x06b4('0xd'),_0x26cd84,'request\x20sent');logger[_0x06b4('0xe')](_0x06b4('0xf'),_0x26cd84,_0x06b4('0x10'),JSON[_0x06b4('0x11')](_0x1e974e));if(_0x1e974e['error']){if(_0x1e974e[_0x06b4('0x12')]['code']===0x1f4){logger[_0x06b4('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x26cd84,_0x1e974e[_0x06b4('0x12')][_0x06b4('0x13')]);return _0xe3a08a(_0x1e974e['error'][_0x06b4('0x13')]);}logger[_0x06b4('0x12')](_0x06b4('0xd'),_0x26cd84,_0x1e974e['error']['message']);return _0x5083e4(_0x1e974e[_0x06b4('0x12')]['message']);}else{logger[_0x06b4('0x14')]('VoiceQueuesLog,\x20%s,\x20%s',_0x26cd84,_0x06b4('0x10'));_0x5083e4(_0x1e974e['result']['message']);}})[_0x06b4('0x15')](function(_0x3290ee){logger[_0x06b4('0x12')](_0x06b4('0xd'),_0x26cd84,_0x3290ee);_0xe3a08a(_0x3290ee);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 8946cd7..0ab5450 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 _0x9858=['connect-timeout','express','../../components/auth/service','../../config/environment','isAuthenticated','describe','get','/:id','show','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','update','delete','destroy','exports','path'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0x9858,0x1cd));var _0x8985=function(_0x22e782,_0x314c09){_0x22e782=_0x22e782-0x0;var _0xc6a20d=_0x9858[_0x22e782];return _0xc6a20d;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8985('0x0'));var timeout=require(_0x8985('0x1'));var express=require(_0x8985('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8985('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x8985('0x4'));var controller=require('./voiceRecording.controller');router['get']('/',auth[_0x8985('0x5')](),controller['index']);router['get']('/describe',auth[_0x8985('0x5')](),controller[_0x8985('0x6')]);router[_0x8985('0x7')](_0x8985('0x8'),auth['isAuthenticated'](),controller[_0x8985('0x9')]);router['get']('/:id/download',auth[_0x8985('0x5')](),controller['download']);router[_0x8985('0x7')](_0x8985('0xa'),controller[_0x8985('0xb')]);router['get'](_0x8985('0xc'),auth[_0x8985('0x5')](),controller[_0x8985('0xd')]);router[_0x8985('0xe')]('/',auth[_0x8985('0x5')](),controller[_0x8985('0xf')]);router[_0x8985('0xe')](_0x8985('0xc'),auth[_0x8985('0x5')](),controller[_0x8985('0x10')]);router[_0x8985('0x11')](_0x8985('0x8'),auth[_0x8985('0x5')](),controller[_0x8985('0x12')]);router[_0x8985('0x13')](_0x8985('0x8'),auth[_0x8985('0x5')](),controller[_0x8985('0x14')]);module[_0x8985('0x15')]=router; \ No newline at end of file +var _0x1b91=['/describe','describe','/:id','isAuthenticated','show','/:id/download','download','/:id/downloads','downloads','downloadTranscribe','post','create','/:id/transcribe','runTranscribe','update','delete','destroy','exports','multer','util','express','Router','../../components/interaction/service','../../config/environment','get','index'];(function(_0x136365,_0x206b1d){var _0x2d2152=function(_0x1b9400){while(--_0x1b9400){_0x136365['push'](_0x136365['shift']());}};_0x2d2152(++_0x206b1d);}(_0x1b91,0x14a));var _0x11b9=function(_0x2083b8,_0x464a42){_0x2083b8=_0x2083b8-0x0;var _0x4643ba=_0x1b91[_0x2083b8];return _0x4643ba;};'use strict';var multer=require(_0x11b9('0x0'));var util=require(_0x11b9('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x11b9('0x2'));var router=express[_0x11b9('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x11b9('0x4'));var config=require(_0x11b9('0x5'));var controller=require('./voiceRecording.controller');router[_0x11b9('0x6')]('/',auth['isAuthenticated'](),controller[_0x11b9('0x7')]);router[_0x11b9('0x6')](_0x11b9('0x8'),auth['isAuthenticated'](),controller[_0x11b9('0x9')]);router[_0x11b9('0x6')](_0x11b9('0xa'),auth[_0x11b9('0xb')](),controller[_0x11b9('0xc')]);router[_0x11b9('0x6')](_0x11b9('0xd'),auth[_0x11b9('0xb')](),controller[_0x11b9('0xe')]);router[_0x11b9('0x6')](_0x11b9('0xf'),controller[_0x11b9('0x10')]);router['get']('/:id/transcribe',auth['isAuthenticated'](),controller[_0x11b9('0x11')]);router[_0x11b9('0x12')]('/',auth[_0x11b9('0xb')](),controller[_0x11b9('0x13')]);router[_0x11b9('0x12')](_0x11b9('0x14'),auth[_0x11b9('0xb')](),controller[_0x11b9('0x15')]);router['put'](_0x11b9('0xa'),auth[_0x11b9('0xb')](),controller[_0x11b9('0x16')]);router[_0x11b9('0x17')](_0x11b9('0xa'),auth[_0x11b9('0xb')](),controller[_0x11b9('0x18')]);module[_0x11b9('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 390eea4..d48ec07 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(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 934eb18..3424a77 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 _0x637c=['VoiceRecording\x20not\x20found','filename','unlink','message','downloads','MD5','col','token','$and','push','Sequelize','extname','isNil','Entity\x20not\x20found','info','File:\x20\x22','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','readFileSync','Location','bucket','Bucket','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJobName','transcribeStatus','TranscriptionJob','TranscriptionJobStatus','runTranscribe','Voice\x20Recording\x20not\x20found','Setting','findOne','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','end','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','show','params','keys','include','find','catch','body','describe','download','../../components/encryptor','uniqueid','%s.cypher','existsSync','decryptFile','secrets','recording','value','ValidationError'];(function(_0x35e1ab,_0x1bdfe3){var _0x5da970=function(_0x31f541){while(--_0x31f541){_0x35e1ab['push'](_0x35e1ab['shift']());}};_0x5da970(++_0x1bdfe3);}(_0x637c,0x171));var _0xc637=function(_0x1211de,_0x2563a1){_0x1211de=_0x1211de-0x0;var _0x3a90a1=_0x637c[_0x1211de];return _0x3a90a1;};'use strict';var emlformat=require(_0xc637('0x0'));var rimraf=require(_0xc637('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc637('0x2'));var moment=require('moment');var BPromise=require(_0xc637('0x3'));var Mustache=require(_0xc637('0x4'));var util=require(_0xc637('0x5'));var path=require(_0xc637('0x6'));var sox=require(_0xc637('0x7'));var csv=require(_0xc637('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc637('0x9'));var crypto=require(_0xc637('0xa'));var jsforce=require(_0xc637('0xb'));var deskjs=require(_0xc637('0xc'));var toCsv=require(_0xc637('0x8'));var querystring=require(_0xc637('0xd'));var Papa=require('papaparse');var AWS=require(_0xc637('0xe'));var uuidv4=require('uuid/v4');var Redis=require(_0xc637('0xf'));var authService=require(_0xc637('0x10'));var qs=require(_0xc637('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc637('0x12'));var logger=require('../../config/logger')(_0xc637('0x13'));var utils=require('../../config/utils');var config=require(_0xc637('0x14'));var licenseUtil=require(_0xc637('0x15'));var db=require(_0xc637('0x16'))['db'];function respondWithStatusCode(_0x6556e0,_0x36b63d){_0x36b63d=_0x36b63d||0xcc;return function(_0x22cff6){if(_0x22cff6){return _0x6556e0[_0xc637('0x17')](_0x36b63d);}return _0x6556e0[_0xc637('0x18')](_0x36b63d)['end']();};}function respondWithResult(_0x56d4fc,_0x5d0496){_0x5d0496=_0x5d0496||0xc8;return function(_0x18dc26){if(_0x18dc26){return _0x56d4fc[_0xc637('0x18')](_0x5d0496)[_0xc637('0x19')](_0x18dc26);}};}function respondWithFilteredResult(_0xad45e0,_0x3425d1){return function(_0x42af49){if(_0x42af49){var _0x58b0f1=typeof _0x3425d1[_0xc637('0x1a')]===_0xc637('0x1b')&&typeof _0x3425d1[_0xc637('0x1c')]===_0xc637('0x1b');var _0x100be3=_0x42af49['count'];var _0x55ae12=_0x58b0f1?0x0:_0x3425d1[_0xc637('0x1a')];var _0x3ae02e=_0x58b0f1?_0x42af49['count']:_0x3425d1['offset']+_0x3425d1[_0xc637('0x1c')];var _0x651b2b;if(_0x3ae02e>=_0x100be3){_0x3ae02e=_0x100be3;_0x651b2b=0xc8;}else{_0x651b2b=0xce;}_0xad45e0[_0xc637('0x18')](_0x651b2b);return _0xad45e0[_0xc637('0x1d')](_0xc637('0x1e'),_0x55ae12+'-'+_0x3ae02e+'/'+_0x100be3)[_0xc637('0x19')](_0x42af49);}return null;};}function patchUpdates(_0x5df12d){return function(_0x4f75ed){try{jsonpatch[_0xc637('0x1f')](_0x4f75ed,_0x5df12d,!![]);}catch(_0x6d301a){return BPromise[_0xc637('0x20')](_0x6d301a);}return _0x4f75ed['save']();};}function saveUpdates(_0x419707,_0x243b8b){return function(_0x2f597f){if(_0x2f597f){return _0x2f597f[_0xc637('0x21')](_0x419707)[_0xc637('0x22')](function(_0x4aa242){return _0x4aa242;});}return null;};}function removeEntity(_0x4308b0,_0x5bf450){return function(_0x547287){if(_0x547287){return _0x547287[_0xc637('0x23')]()[_0xc637('0x22')](function(){_0x4308b0[_0xc637('0x18')](0xcc)[_0xc637('0x24')]();});}};}function handleEntityNotFound(_0x55384f,_0x456756){return function(_0x145406){if(!_0x145406){_0x55384f[_0xc637('0x17')](0x194);}return _0x145406;};}function handleError(_0xdeb030,_0x27814f){_0x27814f=_0x27814f||0x1f4;return function(_0x2a1f0a){logger[_0xc637('0x25')](_0x2a1f0a['stack']);if(_0x2a1f0a['name']){delete _0x2a1f0a[_0xc637('0x26')];}_0xdeb030[_0xc637('0x18')](_0x27814f)[_0xc637('0x27')](_0x2a1f0a);};}exports[_0xc637('0x28')]=function(_0x2826cc,_0x71e64c){var _0x29b9a5={},_0x3f5250={},_0xc53d={'count':0x0,'rows':[]};var _0x43499a=_[_0xc637('0x29')](db[_0xc637('0x2a')][_0xc637('0x2b')],function(_0x18f75c){return{'name':_0x18f75c[_0xc637('0x2c')],'type':_0x18f75c[_0xc637('0x2d')][_0xc637('0x2e')]};});_0x3f5250[_0xc637('0x2f')]=_[_0xc637('0x30')](_[_0xc637('0x29')](_0x43499a,_0xc637('0x26')),[_0xc637('0x31')]);_0x3f5250[_0xc637('0x32')]=_['keys'](_0x2826cc[_0xc637('0x32')]);_0x3f5250[_0xc637('0x33')]=_[_0xc637('0x34')](_0x3f5250[_0xc637('0x2f')],_0x3f5250[_0xc637('0x32')]);_0x29b9a5['attributes']=_[_0xc637('0x34')](_0x3f5250['model'],qs[_0xc637('0x35')](_0x2826cc['query'][_0xc637('0x35')]));_0x29b9a5[_0xc637('0x36')]=_0x29b9a5['attributes'][_0xc637('0x37')]?_0x29b9a5[_0xc637('0x36')]:_0x3f5250['model'];if(!_0x2826cc[_0xc637('0x32')]['hasOwnProperty'](_0xc637('0x38'))){_0x29b9a5[_0xc637('0x1c')]=qs[_0xc637('0x1c')](_0x2826cc['query'][_0xc637('0x1c')]);_0x29b9a5['offset']=qs[_0xc637('0x1a')](_0x2826cc[_0xc637('0x32')][_0xc637('0x1a')]);}_0x29b9a5[_0xc637('0x39')]=qs[_0xc637('0x3a')](_0x2826cc['query'][_0xc637('0x3a')]);_0x29b9a5[_0xc637('0x3b')]=qs[_0xc637('0x33')](_[_0xc637('0x3c')](_0x2826cc[_0xc637('0x32')],_0x3f5250[_0xc637('0x33')]),_0x43499a);if(_0x2826cc[_0xc637('0x32')][_0xc637('0x3d')]){_0x29b9a5[_0xc637('0x3b')]=_['merge'](_0x29b9a5['where'],{'$or':_[_0xc637('0x29')](_0x43499a,function(_0x2d3b62){if(_0x2d3b62[_0xc637('0x2d')]!==_0xc637('0x3e')){var _0x27e0e4={};_0x27e0e4[_0x2d3b62[_0xc637('0x26')]]={'$like':'%'+_0x2826cc['query']['filter']+'%'};return _0x27e0e4;}})});}_0x29b9a5=_[_0xc637('0x3f')]({},_0x29b9a5,_0x2826cc[_0xc637('0x40')]);var _0x1230f7={'where':_0x29b9a5[_0xc637('0x3b')]};return db['VoiceRecording']['count'](_0x1230f7)[_0xc637('0x22')](function(_0xebfc5c){_0xc53d['count']=_0xebfc5c;if(_0x2826cc[_0xc637('0x32')][_0xc637('0x41')]){_0x29b9a5['include']=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x29b9a5);})[_0xc637('0x22')](function(_0x5938e7){_0xc53d['rows']=_0x5938e7;return _0xc53d;})['then'](respondWithFilteredResult(_0x71e64c,_0x29b9a5))['catch'](handleError(_0x71e64c,null));};exports[_0xc637('0x42')]=function(_0x3b3f8a,_0x397626){var _0x456ba5={'raw':![],'where':{'id':_0x3b3f8a[_0xc637('0x43')]['id']}},_0x210b58={};_0x210b58[_0xc637('0x2f')]=_['keys'](db[_0xc637('0x2a')][_0xc637('0x2b')]);_0x210b58['query']=_[_0xc637('0x44')](_0x3b3f8a[_0xc637('0x32')]);_0x210b58['filters']=_[_0xc637('0x34')](_0x210b58[_0xc637('0x2f')],_0x210b58['query']);_0x456ba5[_0xc637('0x36')]=_[_0xc637('0x34')](_0x210b58[_0xc637('0x2f')],qs[_0xc637('0x35')](_0x3b3f8a[_0xc637('0x32')][_0xc637('0x35')]));_0x456ba5[_0xc637('0x36')]=_0x456ba5[_0xc637('0x36')][_0xc637('0x37')]?_0x456ba5['attributes']:_0x210b58[_0xc637('0x2f')];if(_0x3b3f8a['query'][_0xc637('0x41')]){_0x456ba5[_0xc637('0x45')]=[{'all':!![]}];}_0x456ba5=_[_0xc637('0x3f')]({},_0x456ba5,_0x3b3f8a[_0xc637('0x40')]);return db[_0xc637('0x2a')][_0xc637('0x46')](_0x456ba5)[_0xc637('0x22')](handleEntityNotFound(_0x397626,null))['then'](respondWithResult(_0x397626,null))[_0xc637('0x47')](handleError(_0x397626,null));};exports['create']=function(_0x128a38,_0x4ca8f2){return db[_0xc637('0x2a')]['create'](_0x128a38[_0xc637('0x48')],{})[_0xc637('0x22')](respondWithResult(_0x4ca8f2,0xc9))[_0xc637('0x47')](handleError(_0x4ca8f2,null));};exports[_0xc637('0x21')]=function(_0x292915,_0x139706){if(_0x292915[_0xc637('0x48')]['id']){delete _0x292915[_0xc637('0x48')]['id'];}return db['VoiceRecording'][_0xc637('0x46')]({'where':{'id':_0x292915['params']['id']}})[_0xc637('0x22')](handleEntityNotFound(_0x139706,null))['then'](saveUpdates(_0x292915[_0xc637('0x48')],null))['then'](respondWithResult(_0x139706,null))[_0xc637('0x47')](handleError(_0x139706,null));};exports[_0xc637('0x49')]=function(_0x1c8da5,_0x3f9fbf){return db['VoiceRecording'][_0xc637('0x49')]()[_0xc637('0x22')](respondWithResult(_0x3f9fbf,null))[_0xc637('0x47')](handleError(_0x3f9fbf,null));};exports[_0xc637('0x4a')]=function(_0x1e60ba,_0xe56a88,_0x137615){var _0x56da2e=require(_0xc637('0x4b'));var _0x71ea60=![];var _0x38ac5a={};if(_0x1e60ba[_0xc637('0x32')][_0xc637('0x2d')]&&_0x1e60ba[_0xc637('0x32')][_0xc637('0x2d')]===_0xc637('0x4c')){_0x38ac5a[_0xc637('0x4c')]=_0x1e60ba[_0xc637('0x43')]['id'];}else{_0x38ac5a['id']=_0x1e60ba[_0xc637('0x43')]['id'];}return db[_0xc637('0x2a')][_0xc637('0x46')]({'where':_0x38ac5a,'attributes':['id','value'],'raw':!![]})[_0xc637('0x22')](handleEntityNotFound(_0xe56a88,null))['then'](function(_0x19bda9){if(_0x19bda9){var _0x4a114a=_0x19bda9['value'];var _0x1602d9=util[_0xc637('0x31')](_0xc637('0x4d'),_0x4a114a);if(fs[_0xc637('0x4e')](_0x1602d9)){_0x71ea60=!![];return _0x56da2e[_0xc637('0x4f')](_0x1602d9,_0x4a114a,config[_0xc637('0x50')][_0xc637('0x51')])[_0xc637('0x22')](function(){return _0x19bda9;});}return _0x19bda9;}})['then'](function(_0x81b67){if(_0x81b67){var _0x4edbe3=_0x81b67[_0xc637('0x52')];if(!fs[_0xc637('0x4e')](_0x4edbe3)){throw new db['Sequelize'][(_0xc637('0x53'))](_0xc637('0x54'));}if(_0x81b67[_0xc637('0x55')]){return _0xe56a88[_0xc637('0x4a')](_0x4edbe3,_0x81b67['filename']+path['extname'](_0x4edbe3),function(){if(_0x71ea60){fs[_0xc637('0x56')](_0x4edbe3);}});}else{return _0xe56a88[_0xc637('0x4a')](_0x4edbe3,function(_0x1d06c4){if(_0x71ea60){fs[_0xc637('0x56')](_0x4edbe3);}});}}})[_0xc637('0x47')](function(_0x3364c3){if(_0x3364c3[_0xc637('0x57')]===_0xc637('0x54')){_0xe56a88['status'](0x194)[_0xc637('0x27')]('Not\x20found');}else{return handleError(_0xe56a88,null);}});};exports[_0xc637('0x58')]=function(_0x33b9f8,_0x5c3d14,_0x49b628){var _0x22231b=require('../../components/encryptor');var _0x48d232=![];var _0x55b3a5={'$and':[db['sequelize'][_0xc637('0x3b')](db['sequelize']['fn'](_0xc637('0x59'),db['sequelize'][_0xc637('0x5a')](_0xc637('0x4c'))),_0x33b9f8[_0xc637('0x32')][_0xc637('0x5b')])]};if(_0x33b9f8['query']['type']&&_0x33b9f8[_0xc637('0x32')][_0xc637('0x2d')]==='uniqueid'){_0x55b3a5[_0xc637('0x5c')][_0xc637('0x5d')]({'uniqueid':_0x33b9f8['params']['id']});}else{_0x55b3a5[_0xc637('0x5c')][_0xc637('0x5d')]({'id':_0x33b9f8[_0xc637('0x43')]['id']});}return db[_0xc637('0x2a')][_0xc637('0x46')]({'where':_0x55b3a5,'attributes':['id',_0xc637('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x5c3d14,null))[_0xc637('0x22')](function(_0x5c7df8){if(_0x5c7df8){var _0x24972b=util['format'](_0xc637('0x4d'),_0x5c7df8[_0xc637('0x52')]);if(fs[_0xc637('0x4e')](_0x24972b)){_0x48d232=!![];return _0x22231b[_0xc637('0x4f')](_0x24972b,_0x5c7df8[_0xc637('0x52')],config['secrets'][_0xc637('0x51')])['then'](function(){return _0x5c7df8;});}return _0x5c7df8;}})[_0xc637('0x22')](function(_0x303a16){if(_0x303a16){if(!fs[_0xc637('0x4e')](_0x303a16[_0xc637('0x52')])){throw new db[(_0xc637('0x5e'))][(_0xc637('0x53'))](_0xc637('0x54'));}if(_0x303a16[_0xc637('0x55')]){return _0x5c3d14['download'](_0x303a16[_0xc637('0x52')],_0x303a16['filename']+path[_0xc637('0x5f')](_0x303a16[_0xc637('0x52')]),function(){if(_0x48d232){fs[_0xc637('0x56')](_0x303a16[_0xc637('0x52')]);}});}else{return _0x5c3d14[_0xc637('0x4a')](_0x303a16['value'],function(_0x1b578b){if(_0x48d232){fs[_0xc637('0x56')](_0x303a16[_0xc637('0x52')]);}});}}})['catch'](handleError(_0x5c3d14,null));};exports[_0xc637('0x23')]=function(_0x5bf310,_0x898103){return db[_0xc637('0x2a')][_0xc637('0x46')]({'where':{'id':_0x5bf310[_0xc637('0x43')]['id']}})[_0xc637('0x22')](function(_0x3c64a7){if(_[_0xc637('0x60')](_0x3c64a7)){throw new ReferenceError(_0xc637('0x61'));}return _0x3c64a7;})['then'](function(_0x512238){var _0x9e13ce=_0x512238[_0xc637('0x52')];logger[_0xc637('0x62')]('cancellazione\x20fisica\x20documento\x20%s',_0x9e13ce);if(!_['isNil'](_0x512238['value'])&&fs[_0xc637('0x4e')](_0x9e13ce)){logger[_0xc637('0x62')](_0xc637('0x63')+_0x9e13ce+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x9e13ce);}_0x9e13ce=_0x9e13ce+_0xc637('0x64');if(!_['isNil'](_0x512238[_0xc637('0x52')])&&fs[_0xc637('0x4e')](_0x9e13ce)){logger['info']('File:\x20\x22'+_0x9e13ce+_0xc637('0x65'));fs[_0xc637('0x66')](_0x9e13ce);}return _0x512238;})[_0xc637('0x22')](function(_0x21dfaf){if(!_0x21dfaf)throw new InternalError();return _0x21dfaf[_0xc637('0x23')]();})[_0xc637('0x22')](function(){_0x898103[_0xc637('0x18')](0xcc)[_0xc637('0x24')]();})[_0xc637('0x47')](handleError(_0x898103,null));};function getBucketslist(_0x1578d3,_0x43b3f4,_0x477e13){return new Promise(function(_0x21afbf,_0x29c15b){var _0x452c6a=new AWS['S3']({'accessKeyId':_0x43b3f4,'secretAccessKey':_0x1578d3,'region':_0x477e13});_0x452c6a[_0xc637('0x67')]({},function(_0x304773,_0x3e615b){if(_0x304773){return _0x29c15b(_0x304773);}else{return _0x21afbf(_0x3e615b);}});});}function createBucket(_0x1cccbf,_0x2827a2,_0x3ccaa7,_0x139198){return new Promise(function(_0x153956,_0x3d2ea0){var _0x45c196=new AWS['S3']({'accessKeyId':_0x2827a2,'secretAccessKey':_0x1cccbf,'region':_0x3ccaa7});_0x45c196[_0xc637('0x68')]({'Bucket':_0x139198},function(_0x4bc4bd,_0xe156a9){if(_0x4bc4bd){return _0x3d2ea0(_0x4bc4bd);}else{return _0x153956(_0xe156a9);}});});}function uploadFile(_0x46fcda,_0x5e4778,_0xd6161f,_0xa70c5a,_0x5b42d6,_0x14946d){return new Promise(function(_0x5af8c6,_0x2bd87e){var _0x42426b=new AWS['S3']({'accessKeyId':_0x5e4778,'secretAccessKey':_0x46fcda,'region':_0xd6161f});_0x42426b[_0xc637('0x69')]({'Bucket':_0xa70c5a,'Key':_0x5b42d6,'Body':_0x14946d},function(_0x2ec024,_0x2b7d2a){if(_0x2ec024){return _0x2bd87e(_0x2ec024);}else{return _0x5af8c6(_0x2b7d2a);}});});}function startTranscribe(_0x766832,_0x42820a,_0x39f8a2,_0x352b88,_0xe42824,_0x86ff75){return new Promise(function(_0x2703cf,_0x1cd865){var _0x1acffd=new AWS[(_0xc637('0x6a'))]({'accessKeyId':_0x42820a,'secretAccessKey':_0x766832,'region':_0x39f8a2});_0x1acffd[_0xc637('0x6b')]({'TranscriptionJobName':_0x352b88,'LanguageCode':_0xe42824,'Media':{'MediaFileUri':_0x86ff75}},function(_0x33e727,_0x5239a3){if(_0x33e727){return _0x1cd865(_0x33e727);}else{return _0x2703cf(_0x5239a3);}});});}function transcribe(_0x375b58,_0x2e0dc3,_0x54feda,_0x2e49a8,_0x3e2fa8,_0x5ee85c,_0x3b17cc){return new Promise(function(_0x3753b1,_0x3b315d){var _0x4e612a={};logger[_0xc637('0x62')](util[_0xc637('0x31')](_0xc637('0x6c'),_0x375b58,_0x3e2fa8));return uploadFile(_0x2e0dc3,_0x54feda,_0x2e49a8,_0x3e2fa8,path[_0xc637('0x6d')](_0x5ee85c),fs[_0xc637('0x6e')](_0x5ee85c))['then'](function(_0x595f20){logger[_0xc637('0x62')](util[_0xc637('0x31')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x375b58,_0x3e2fa8,_0x595f20[_0xc637('0x6f')]));_0x4e612a[_0xc637('0x70')]=_0x595f20[_0xc637('0x71')];_0x4e612a['location']=_0x595f20[_0xc637('0x6f')];logger[_0xc637('0x62')](util[_0xc637('0x31')](_0xc637('0x72'),_0x375b58));return startTranscribe(_0x2e0dc3,_0x54feda,_0x2e49a8,uuidv4(),_0x3b17cc,_0x595f20[_0xc637('0x6f')]);})['then'](function(_0x29eebe){logger[_0xc637('0x62')](util[_0xc637('0x31')](_0xc637('0x73'),_0x375b58,_0x29eebe['TranscriptionJob']['TranscriptionJobName']));_0x4e612a['transcribeName']=_0x29eebe['TranscriptionJob'][_0xc637('0x74')];_0x4e612a[_0xc637('0x75')]=_0x29eebe[_0xc637('0x76')][_0xc637('0x77')];return _0x3753b1(_0x4e612a);})[_0xc637('0x47')](function(_0x4447bf){return _0x3b315d(_0x4447bf);});});}exports[_0xc637('0x78')]=function(_0x5f35ec,_0x234a61,_0x40f281){var _0x1a3140;var _0x501ff6;var _0x1fb72f;var _0x47d5cf=require(_0xc637('0x4b'));return db[_0xc637('0x2a')]['findOne']({'where':{'id':_0x5f35ec['params']['id']}})[_0xc637('0x22')](function(_0x2bf978){if(_0x2bf978){var _0x5f3296=util[_0xc637('0x31')](_0xc637('0x4d'),_0x2bf978[_0xc637('0x52')]);if(fs[_0xc637('0x4e')](_0x5f3296)){cypher=!![];return _0x47d5cf['decryptFile'](_0x5f3296,_0x2bf978[_0xc637('0x52')],config[_0xc637('0x50')]['recording'])[_0xc637('0x22')](function(){return _0x2bf978;});}return _0x2bf978;}})['then'](function(_0x5168fb){if(!_0x5168fb){throw new db[(_0xc637('0x5e'))]['ValidationError'](_0xc637('0x79'));}_0x501ff6=_0x5168fb;return db[_0xc637('0x7a')][_0xc637('0x7b')]({'where':{'id':0x1}});})[_0xc637('0x22')](handleEntityNotFound(_0x234a61,null))[_0xc637('0x22')](function(_0x1bab5e){if(_0x1bab5e){_0x1a3140=_0x1bab5e;if(!_0x1a3140['transcribe']||!_0x1a3140['transcribeAccountId']||!_0x1a3140[_0xc637('0x7c')]||!_0x1a3140[_0xc637('0x7d')]||!_0x1a3140[_0xc637('0x70')]){throw new db[(_0xc637('0x5e'))][(_0xc637('0x53'))](_0xc637('0x7e'));}if(_0x5f35ec[_0xc637('0x48')][_0xc637('0x7f')]&&(!_0x1a3140[_0xc637('0x80')]||!_0x1a3140[_0xc637('0x81')]||!_0x1a3140[_0xc637('0x82')]||!_0x1a3140[_0xc637('0x7d')]||!_0x1a3140[_0xc637('0x70')])){throw new db[(_0xc637('0x5e'))][(_0xc637('0x53'))](_0xc637('0x83'));}return db['CloudProvider']['findOne']({'where':{'id':_0x1a3140[_0xc637('0x84')]}});}})['then'](function(_0x19dabc){if(!_0x19dabc){throw new db[(_0xc637('0x5e'))][(_0xc637('0x53'))](_0xc637('0x85'));}if(!_0x19dabc[_0xc637('0x86')]||!_0x19dabc[_0xc637('0x87')]){throw new db[(_0xc637('0x5e'))][(_0xc637('0x53'))](_0xc637('0x88'));}_0x1fb72f=_0x19dabc;return getBucketslist(_0x1fb72f['data1'],_0x1fb72f[_0xc637('0x87')],_0x1a3140[_0xc637('0x7c')]);})['then'](function(_0x5e6305){if(_0x5e6305&&_0x5e6305['Buckets']){var _0x33a2eb=_[_0xc637('0x46')](_0x5e6305[_0xc637('0x89')],function(_0x215c6d){return _0x215c6d[_0xc637('0x8a')]===_0x1a3140[_0xc637('0x70')];});if(!_0x33a2eb){logger[_0xc637('0x62')](util[_0xc637('0x31')](_0xc637('0x8b'),_0x5f35ec['params']['id'],_0x1a3140['bucket']));return createBucket(_0x1fb72f[_0xc637('0x86')],_0x1fb72f[_0xc637('0x87')],_0x1a3140[_0xc637('0x7c')],_0x1a3140[_0xc637('0x70')]);}logger[_0xc637('0x62')](util[_0xc637('0x31')](_0xc637('0x8c'),_0x5f35ec[_0xc637('0x43')]['id'],_0x1a3140[_0xc637('0x70')]));return;}})[_0xc637('0x22')](function(_0x2a38f4){if(_0x501ff6['transcribeStatus']===_0xc637('0x8d')){return transcribe(_0x5f35ec[_0xc637('0x43')]['id'],_0x1fb72f[_0xc637('0x86')],_0x1fb72f[_0xc637('0x87')],_0x1a3140[_0xc637('0x7c')],_0x1a3140[_0xc637('0x70')],_0x501ff6[_0xc637('0x52')],_0x1a3140[_0xc637('0x7d')]);}else{logger['info'](util['format'](_0xc637('0x8e'),_0x5f35ec[_0xc637('0x43')]['id']));return{'transcribeStatus':_0xc637('0x8f')};}})[_0xc637('0x22')](function(_0x235510){if(_0x235510){_0x235510[_0xc637('0x90')]=_0x5f35ec[_0xc637('0x48')]['runSentiment'];return _0x501ff6['updateAttributes'](_0x235510);}})[_0xc637('0x22')](respondWithResult(_0x234a61,null))[_0xc637('0x47')](handleError(_0x234a61,null));};function writeFile(_0x7e4862,_0x166d47){return new Promise(function(_0x433c5e,_0x4fe080){fs['writeFile'](_0x166d47,_0x7e4862,function(_0xc44843,_0x47e2b6){if(_0xc44843){return _0x4fe080(_0xc44843);}else{return _0x433c5e(_0x47e2b6);}});});}exports[_0xc637('0x91')]=function(_0x4c3b7c,_0x4b2436,_0xd93089){return db[_0xc637('0x2a')][_0xc637('0x7b')]({'where':{'id':_0x4c3b7c[_0xc637('0x43')]['id']}})[_0xc637('0x22')](handleEntityNotFound(_0x4b2436))[_0xc637('0x22')](function(_0xfec107){if(_0xfec107&&_0xfec107[_0xc637('0x92')]){var _0x5c186f=_0xfec107[_0xc637('0x92')];var _0x1ca46e=config[_0xc637('0x93')]+_0xc637('0x94')+_0xfec107['id']+_0xc637('0x95');if(fs[_0xc637('0x4e')](_0x1ca46e)){return _0x1ca46e;}return writeFile(_0x5c186f,_0x1ca46e)[_0xc637('0x22')](function(){return _0x1ca46e;});}else{throw new db['Sequelize'][(_0xc637('0x53'))](_0xc637('0x96'));}})[_0xc637('0x22')](function(_0x188e0c){return _0x4b2436[_0xc637('0x4a')](_0x188e0c);})['catch'](handleError(_0x4b2436));}; \ No newline at end of file +var _0xfc59=['filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','describe','download','../../components/encryptor','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','secrets','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','unlinkSync','.cypher','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','end','listBuckets','createBucket','upload','TranscribeService','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJob','TranscriptionJobStatus','runTranscribe','findOne','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','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','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','offset','undefined','count','limit','Content-Range','json','apply','reject','update','then','destroy','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick'];(function(_0xa20194,_0x4b1f24){var _0x202cd2=function(_0x509099){while(--_0x509099){_0xa20194['push'](_0xa20194['shift']());}};_0x202cd2(++_0x4b1f24);}(_0xfc59,0x195));var _0x9fc5=function(_0x150762,_0x18475e){_0x150762=_0x150762-0x0;var _0x3f4cb5=_0xfc59[_0x150762];return _0x3f4cb5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fc5('0x0'));var zipdir=require(_0x9fc5('0x1'));var jsonpatch=require(_0x9fc5('0x2'));var rp=require(_0x9fc5('0x3'));var moment=require(_0x9fc5('0x4'));var BPromise=require(_0x9fc5('0x5'));var Mustache=require(_0x9fc5('0x6'));var util=require(_0x9fc5('0x7'));var path=require(_0x9fc5('0x8'));var sox=require(_0x9fc5('0x9'));var csv=require(_0x9fc5('0xa'));var ejs=require(_0x9fc5('0xb'));var fs=require('fs');var fs_extra=require(_0x9fc5('0xc'));var _=require(_0x9fc5('0xd'));var squel=require(_0x9fc5('0xe'));var crypto=require('crypto');var jsforce=require(_0x9fc5('0xf'));var deskjs=require(_0x9fc5('0x10'));var toCsv=require(_0x9fc5('0xa'));var querystring=require(_0x9fc5('0x11'));var Papa=require(_0x9fc5('0x12'));var AWS=require(_0x9fc5('0x13'));var uuidv4=require(_0x9fc5('0x14'));var Redis=require(_0x9fc5('0x15'));var authService=require(_0x9fc5('0x16'));var qs=require(_0x9fc5('0x17'));var as=require(_0x9fc5('0x18'));var hardwareService=require(_0x9fc5('0x19'));var logger=require(_0x9fc5('0x1a'))(_0x9fc5('0x1b'));var utils=require(_0x9fc5('0x1c'));var config=require('../../config/environment');var licenseUtil=require(_0x9fc5('0x1d'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a2cda,_0xdcfd5e){_0xdcfd5e=_0xdcfd5e||0xcc;return function(_0x16cec4){if(_0x16cec4){return _0x5a2cda[_0x9fc5('0x1e')](_0xdcfd5e);}return _0x5a2cda[_0x9fc5('0x1f')](_0xdcfd5e)['end']();};}function respondWithResult(_0x1656d9,_0xf5f691){_0xf5f691=_0xf5f691||0xc8;return function(_0x44f806){if(_0x44f806){return _0x1656d9[_0x9fc5('0x1f')](_0xf5f691)['json'](_0x44f806);}};}function respondWithFilteredResult(_0x5992e8,_0x45cbeb){return function(_0x1675c0){if(_0x1675c0){var _0x11c27e=typeof _0x45cbeb[_0x9fc5('0x20')]===_0x9fc5('0x21')&&typeof _0x45cbeb['limit']===_0x9fc5('0x21');var _0x5cf191=_0x1675c0['count'];var _0x36465a=_0x11c27e?0x0:_0x45cbeb['offset'];var _0x10fd90=_0x11c27e?_0x1675c0[_0x9fc5('0x22')]:_0x45cbeb[_0x9fc5('0x20')]+_0x45cbeb[_0x9fc5('0x23')];var _0x333dcf;if(_0x10fd90>=_0x5cf191){_0x10fd90=_0x5cf191;_0x333dcf=0xc8;}else{_0x333dcf=0xce;}_0x5992e8[_0x9fc5('0x1f')](_0x333dcf);return _0x5992e8['set'](_0x9fc5('0x24'),_0x36465a+'-'+_0x10fd90+'/'+_0x5cf191)[_0x9fc5('0x25')](_0x1675c0);}return null;};}function patchUpdates(_0x7dd8f0){return function(_0x168692){try{jsonpatch[_0x9fc5('0x26')](_0x168692,_0x7dd8f0,!![]);}catch(_0x5785aa){return BPromise[_0x9fc5('0x27')](_0x5785aa);}return _0x168692['save']();};}function saveUpdates(_0x2d4815,_0x111a5e){return function(_0x13cab7){if(_0x13cab7){return _0x13cab7[_0x9fc5('0x28')](_0x2d4815)[_0x9fc5('0x29')](function(_0x4dda56){return _0x4dda56;});}return null;};}function removeEntity(_0x318066,_0x45a4b1){return function(_0x147437){if(_0x147437){return _0x147437[_0x9fc5('0x2a')]()[_0x9fc5('0x29')](function(){_0x318066[_0x9fc5('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ab1e3,_0x30dbbd){return function(_0x24195c){if(!_0x24195c){_0x2ab1e3['sendStatus'](0x194);}return _0x24195c;};}function handleError(_0xeed638,_0x1ce6a9){_0x1ce6a9=_0x1ce6a9||0x1f4;return function(_0x4f7c84){logger['error'](_0x4f7c84['stack']);if(_0x4f7c84[_0x9fc5('0x2b')]){delete _0x4f7c84[_0x9fc5('0x2b')];}_0xeed638[_0x9fc5('0x1f')](_0x1ce6a9)[_0x9fc5('0x2c')](_0x4f7c84);};}exports[_0x9fc5('0x2d')]=function(_0x3b9d85,_0x395355){var _0x4f755f={},_0x5f2549={},_0x5455c4={'count':0x0,'rows':[]};var _0x5edc17=_[_0x9fc5('0x2e')](db[_0x9fc5('0x2f')][_0x9fc5('0x30')],function(_0x946166){return{'name':_0x946166[_0x9fc5('0x31')],'type':_0x946166['type'][_0x9fc5('0x32')]};});_0x5f2549[_0x9fc5('0x33')]=_[_0x9fc5('0x34')](_[_0x9fc5('0x2e')](_0x5edc17,_0x9fc5('0x2b')),['format']);_0x5f2549[_0x9fc5('0x35')]=_[_0x9fc5('0x36')](_0x3b9d85[_0x9fc5('0x35')]);_0x5f2549['filters']=_[_0x9fc5('0x37')](_0x5f2549['model'],_0x5f2549[_0x9fc5('0x35')]);_0x4f755f[_0x9fc5('0x38')]=_[_0x9fc5('0x37')](_0x5f2549['model'],qs[_0x9fc5('0x39')](_0x3b9d85['query']['fields']));_0x4f755f[_0x9fc5('0x38')]=_0x4f755f[_0x9fc5('0x38')][_0x9fc5('0x3a')]?_0x4f755f['attributes']:_0x5f2549['model'];if(!_0x3b9d85['query']['hasOwnProperty'](_0x9fc5('0x3b'))){_0x4f755f[_0x9fc5('0x23')]=qs['limit'](_0x3b9d85['query'][_0x9fc5('0x23')]);_0x4f755f[_0x9fc5('0x20')]=qs[_0x9fc5('0x20')](_0x3b9d85[_0x9fc5('0x35')][_0x9fc5('0x20')]);}_0x4f755f['order']=qs[_0x9fc5('0x3c')](_0x3b9d85[_0x9fc5('0x35')]['sort']);_0x4f755f[_0x9fc5('0x3d')]=qs['filters'](_[_0x9fc5('0x3e')](_0x3b9d85['query'],_0x5f2549[_0x9fc5('0x3f')]),_0x5edc17);if(_0x3b9d85['query'][_0x9fc5('0x40')]){_0x4f755f['where']=_[_0x9fc5('0x41')](_0x4f755f[_0x9fc5('0x3d')],{'$or':_['map'](_0x5edc17,function(_0x543ea2){if(_0x543ea2[_0x9fc5('0x42')]!==_0x9fc5('0x43')){var _0x2060d6={};_0x2060d6[_0x543ea2[_0x9fc5('0x2b')]]={'$like':'%'+_0x3b9d85[_0x9fc5('0x35')]['filter']+'%'};return _0x2060d6;}})});}_0x4f755f=_['merge']({},_0x4f755f,_0x3b9d85[_0x9fc5('0x44')]);var _0x12b222={'where':_0x4f755f['where']};return db[_0x9fc5('0x2f')][_0x9fc5('0x22')](_0x12b222)['then'](function(_0x3a32f7){_0x5455c4['count']=_0x3a32f7;if(_0x3b9d85[_0x9fc5('0x35')][_0x9fc5('0x45')]){_0x4f755f[_0x9fc5('0x46')]=[{'all':!![]}];}return db[_0x9fc5('0x2f')][_0x9fc5('0x47')](_0x4f755f);})['then'](function(_0x3da5df){_0x5455c4[_0x9fc5('0x48')]=_0x3da5df;return _0x5455c4;})[_0x9fc5('0x29')](respondWithFilteredResult(_0x395355,_0x4f755f))[_0x9fc5('0x49')](handleError(_0x395355,null));};exports['show']=function(_0x518e15,_0x49ccf1){var _0x29cb79={'raw':![],'where':{'id':_0x518e15[_0x9fc5('0x4a')]['id']}},_0x43dc7a={};_0x43dc7a[_0x9fc5('0x33')]=_[_0x9fc5('0x36')](db['VoiceRecording'][_0x9fc5('0x30')]);_0x43dc7a[_0x9fc5('0x35')]=_[_0x9fc5('0x36')](_0x518e15[_0x9fc5('0x35')]);_0x43dc7a[_0x9fc5('0x3f')]=_[_0x9fc5('0x37')](_0x43dc7a[_0x9fc5('0x33')],_0x43dc7a[_0x9fc5('0x35')]);_0x29cb79[_0x9fc5('0x38')]=_[_0x9fc5('0x37')](_0x43dc7a[_0x9fc5('0x33')],qs[_0x9fc5('0x39')](_0x518e15[_0x9fc5('0x35')][_0x9fc5('0x39')]));_0x29cb79[_0x9fc5('0x38')]=_0x29cb79['attributes'][_0x9fc5('0x3a')]?_0x29cb79[_0x9fc5('0x38')]:_0x43dc7a[_0x9fc5('0x33')];if(_0x518e15[_0x9fc5('0x35')]['includeAll']){_0x29cb79['include']=[{'all':!![]}];}_0x29cb79=_[_0x9fc5('0x41')]({},_0x29cb79,_0x518e15[_0x9fc5('0x44')]);return db[_0x9fc5('0x2f')]['find'](_0x29cb79)[_0x9fc5('0x29')](handleEntityNotFound(_0x49ccf1,null))[_0x9fc5('0x29')](respondWithResult(_0x49ccf1,null))[_0x9fc5('0x49')](handleError(_0x49ccf1,null));};exports['create']=function(_0x5f0ed5,_0x3d84c1){return db['VoiceRecording'][_0x9fc5('0x4b')](_0x5f0ed5[_0x9fc5('0x4c')],{})[_0x9fc5('0x29')](respondWithResult(_0x3d84c1,0xc9))[_0x9fc5('0x49')](handleError(_0x3d84c1,null));};exports[_0x9fc5('0x28')]=function(_0xa81b0e,_0x3b9228){if(_0xa81b0e[_0x9fc5('0x4c')]['id']){delete _0xa81b0e[_0x9fc5('0x4c')]['id'];}return db[_0x9fc5('0x2f')][_0x9fc5('0x4d')]({'where':{'id':_0xa81b0e[_0x9fc5('0x4a')]['id']}})[_0x9fc5('0x29')](handleEntityNotFound(_0x3b9228,null))[_0x9fc5('0x29')](saveUpdates(_0xa81b0e[_0x9fc5('0x4c')],null))[_0x9fc5('0x29')](respondWithResult(_0x3b9228,null))[_0x9fc5('0x49')](handleError(_0x3b9228,null));};exports[_0x9fc5('0x4e')]=function(_0x501a26,_0x40e1d3){return db['VoiceRecording'][_0x9fc5('0x4e')]()[_0x9fc5('0x29')](respondWithResult(_0x40e1d3,null))[_0x9fc5('0x49')](handleError(_0x40e1d3,null));};exports[_0x9fc5('0x4f')]=function(_0x3dbb9d,_0x4e1b11,_0xfc6346){var _0x1d102a=require(_0x9fc5('0x50'));var _0x570f2b=![];var _0x44b568={};if(_0x3dbb9d[_0x9fc5('0x35')]['type']&&_0x3dbb9d[_0x9fc5('0x35')][_0x9fc5('0x42')]===_0x9fc5('0x51')){_0x44b568[_0x9fc5('0x51')]=_0x3dbb9d[_0x9fc5('0x4a')]['id'];}else{_0x44b568['id']=_0x3dbb9d[_0x9fc5('0x4a')]['id'];}return db[_0x9fc5('0x2f')]['find']({'where':_0x44b568,'attributes':['id','value'],'raw':!![]})[_0x9fc5('0x29')](handleEntityNotFound(_0x4e1b11,null))['then'](function(_0x3f9fce){if(_0x3f9fce){var _0x305b90=_0x3f9fce[_0x9fc5('0x52')];var _0x3f4eda=util[_0x9fc5('0x53')](_0x9fc5('0x54'),_0x305b90);if(fs[_0x9fc5('0x55')](_0x3f4eda)){_0x570f2b=!![];return _0x1d102a[_0x9fc5('0x56')](_0x3f4eda,_0x305b90,config['secrets'][_0x9fc5('0x57')])[_0x9fc5('0x29')](function(){return _0x3f9fce;});}return _0x3f9fce;}})[_0x9fc5('0x29')](function(_0x786045){if(_0x786045){var _0x44a182=_0x786045[_0x9fc5('0x52')];if(!fs['existsSync'](_0x44a182)){throw new db[(_0x9fc5('0x58'))][(_0x9fc5('0x59'))](_0x9fc5('0x5a'));}if(_0x786045[_0x9fc5('0x5b')]){return _0x4e1b11[_0x9fc5('0x4f')](_0x44a182,_0x786045[_0x9fc5('0x5b')]+path[_0x9fc5('0x5c')](_0x44a182),function(){if(_0x570f2b){fs[_0x9fc5('0x5d')](_0x44a182);}});}else{return _0x4e1b11[_0x9fc5('0x4f')](_0x44a182,function(_0x1ffcf6){if(_0x570f2b){fs[_0x9fc5('0x5d')](_0x44a182);}});}}})['catch'](function(_0x31221e){if(_0x31221e[_0x9fc5('0x5e')]===_0x9fc5('0x5a')){_0x4e1b11[_0x9fc5('0x1f')](0x194)[_0x9fc5('0x2c')](_0x9fc5('0x5f'));}else{return handleError(_0x4e1b11,null);}});};exports[_0x9fc5('0x60')]=function(_0x56acf,_0x4569bd,_0xb0030){var _0x501ca6=require('../../components/encryptor');var _0x3c2b3a=![];var _0x5143fe={'$and':[db[_0x9fc5('0x61')][_0x9fc5('0x3d')](db[_0x9fc5('0x61')]['fn'](_0x9fc5('0x62'),db[_0x9fc5('0x61')][_0x9fc5('0x63')](_0x9fc5('0x51'))),_0x56acf[_0x9fc5('0x35')][_0x9fc5('0x64')])]};if(_0x56acf[_0x9fc5('0x35')][_0x9fc5('0x42')]&&_0x56acf[_0x9fc5('0x35')][_0x9fc5('0x42')]===_0x9fc5('0x51')){_0x5143fe[_0x9fc5('0x65')]['push']({'uniqueid':_0x56acf[_0x9fc5('0x4a')]['id']});}else{_0x5143fe[_0x9fc5('0x65')][_0x9fc5('0x66')]({'id':_0x56acf[_0x9fc5('0x4a')]['id']});}return db[_0x9fc5('0x2f')][_0x9fc5('0x4d')]({'where':_0x5143fe,'attributes':['id',_0x9fc5('0x52')],'raw':!![]})[_0x9fc5('0x29')](handleEntityNotFound(_0x4569bd,null))[_0x9fc5('0x29')](function(_0x194320){if(_0x194320){var _0x380ad0=util[_0x9fc5('0x53')]('%s.cypher',_0x194320['value']);if(fs['existsSync'](_0x380ad0)){_0x3c2b3a=!![];return _0x501ca6['decryptFile'](_0x380ad0,_0x194320[_0x9fc5('0x52')],config[_0x9fc5('0x67')]['recording'])[_0x9fc5('0x29')](function(){return _0x194320;});}return _0x194320;}})[_0x9fc5('0x29')](function(_0x43cec3){if(_0x43cec3){if(!fs[_0x9fc5('0x55')](_0x43cec3['value'])){throw new db[(_0x9fc5('0x58'))]['ValidationError'](_0x9fc5('0x5a'));}if(_0x43cec3[_0x9fc5('0x5b')]){return _0x4569bd[_0x9fc5('0x4f')](_0x43cec3[_0x9fc5('0x52')],_0x43cec3[_0x9fc5('0x5b')]+path[_0x9fc5('0x5c')](_0x43cec3[_0x9fc5('0x52')]),function(){if(_0x3c2b3a){fs[_0x9fc5('0x5d')](_0x43cec3[_0x9fc5('0x52')]);}});}else{return _0x4569bd[_0x9fc5('0x4f')](_0x43cec3[_0x9fc5('0x52')],function(_0x402df1){if(_0x3c2b3a){fs[_0x9fc5('0x5d')](_0x43cec3[_0x9fc5('0x52')]);}});}}})[_0x9fc5('0x49')](handleError(_0x4569bd,null));};exports[_0x9fc5('0x2a')]=function(_0x232f55,_0x5b8350){return db[_0x9fc5('0x2f')][_0x9fc5('0x4d')]({'where':{'id':_0x232f55[_0x9fc5('0x4a')]['id']}})[_0x9fc5('0x29')](function(_0x1e1186){if(_['isNil'](_0x1e1186)){throw new ReferenceError(_0x9fc5('0x68'));}return _0x1e1186;})[_0x9fc5('0x29')](function(_0x519874){var _0x2db3d1=_0x519874[_0x9fc5('0x52')];logger['info'](_0x9fc5('0x69'),_0x2db3d1);if(!_[_0x9fc5('0x6a')](_0x519874[_0x9fc5('0x52')])&&fs['existsSync'](_0x2db3d1)){logger['info']('File:\x20\x22'+_0x2db3d1+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x9fc5('0x6b')](_0x2db3d1);}_0x2db3d1=_0x2db3d1+_0x9fc5('0x6c');if(!_[_0x9fc5('0x6a')](_0x519874[_0x9fc5('0x52')])&&fs[_0x9fc5('0x55')](_0x2db3d1)){logger[_0x9fc5('0x6d')]('File:\x20\x22'+_0x2db3d1+_0x9fc5('0x6e'));fs[_0x9fc5('0x6b')](_0x2db3d1);}return _0x519874;})[_0x9fc5('0x29')](function(_0x37783c){if(!_0x37783c)throw new InternalError();return _0x37783c['destroy']();})[_0x9fc5('0x29')](function(){_0x5b8350['status'](0xcc)[_0x9fc5('0x6f')]();})[_0x9fc5('0x49')](handleError(_0x5b8350,null));};function getBucketslist(_0x1657dc,_0x39aba8,_0x58974c){return new Promise(function(_0x5e7bbb,_0x17064d){var _0x220ac8=new AWS['S3']({'accessKeyId':_0x39aba8,'secretAccessKey':_0x1657dc,'region':_0x58974c});_0x220ac8[_0x9fc5('0x70')]({},function(_0x1e25dc,_0x1ad4b9){if(_0x1e25dc){return _0x17064d(_0x1e25dc);}else{return _0x5e7bbb(_0x1ad4b9);}});});}function createBucket(_0x30d855,_0x493d9c,_0xa6a10,_0x28f115){return new Promise(function(_0x3fdfb4,_0x3ea7d1){var _0x4b3eb6=new AWS['S3']({'accessKeyId':_0x493d9c,'secretAccessKey':_0x30d855,'region':_0xa6a10});_0x4b3eb6[_0x9fc5('0x71')]({'Bucket':_0x28f115},function(_0x145af0,_0x41346f){if(_0x145af0){return _0x3ea7d1(_0x145af0);}else{return _0x3fdfb4(_0x41346f);}});});}function uploadFile(_0xa922fc,_0x427641,_0x3db9b7,_0x5e012e,_0x268fb4,_0x3dce29){return new Promise(function(_0x35deeb,_0x11668a){var _0x92b2c2=new AWS['S3']({'accessKeyId':_0x427641,'secretAccessKey':_0xa922fc,'region':_0x3db9b7});_0x92b2c2[_0x9fc5('0x72')]({'Bucket':_0x5e012e,'Key':_0x268fb4,'Body':_0x3dce29},function(_0x66db47,_0x25597b){if(_0x66db47){return _0x11668a(_0x66db47);}else{return _0x35deeb(_0x25597b);}});});}function startTranscribe(_0x22d95b,_0x2ea429,_0x5d17fa,_0x506def,_0x435e4b,_0x24053d){return new Promise(function(_0x44a765,_0x4e8533){var _0x3bd494=new AWS[(_0x9fc5('0x73'))]({'accessKeyId':_0x2ea429,'secretAccessKey':_0x22d95b,'region':_0x5d17fa});_0x3bd494['startTranscriptionJob']({'TranscriptionJobName':_0x506def,'LanguageCode':_0x435e4b,'Media':{'MediaFileUri':_0x24053d}},function(_0x113393,_0x310352){if(_0x113393){return _0x4e8533(_0x113393);}else{return _0x44a765(_0x310352);}});});}function transcribe(_0x4cb234,_0x450e6f,_0x2736e2,_0x41148f,_0x2d0e2f,_0x3b3a88,_0x25e6f9){return new Promise(function(_0x3c6786,_0x33ed70){var _0x349862={};logger[_0x9fc5('0x6d')](util[_0x9fc5('0x53')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x4cb234,_0x2d0e2f));return uploadFile(_0x450e6f,_0x2736e2,_0x41148f,_0x2d0e2f,path[_0x9fc5('0x74')](_0x3b3a88),fs[_0x9fc5('0x75')](_0x3b3a88))[_0x9fc5('0x29')](function(_0x5e542e){logger['info'](util[_0x9fc5('0x53')](_0x9fc5('0x76'),_0x4cb234,_0x2d0e2f,_0x5e542e[_0x9fc5('0x77')]));_0x349862[_0x9fc5('0x78')]=_0x5e542e[_0x9fc5('0x79')];_0x349862[_0x9fc5('0x7a')]=_0x5e542e['Location'];logger[_0x9fc5('0x6d')](util[_0x9fc5('0x53')](_0x9fc5('0x7b'),_0x4cb234));return startTranscribe(_0x450e6f,_0x2736e2,_0x41148f,uuidv4(),_0x25e6f9,_0x5e542e[_0x9fc5('0x77')]);})['then'](function(_0x49d413){logger['info'](util[_0x9fc5('0x53')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x4cb234,_0x49d413[_0x9fc5('0x7c')]['TranscriptionJobName']));_0x349862['transcribeName']=_0x49d413['TranscriptionJob']['TranscriptionJobName'];_0x349862['transcribeStatus']=_0x49d413[_0x9fc5('0x7c')][_0x9fc5('0x7d')];return _0x3c6786(_0x349862);})['catch'](function(_0x3fb8c4){return _0x33ed70(_0x3fb8c4);});});}exports[_0x9fc5('0x7e')]=function(_0xeb5e0b,_0x454620,_0x7ce4c6){var _0x5cd190;var _0x214bce;var _0x5e57bb;var _0x24544b=require(_0x9fc5('0x50'));return db[_0x9fc5('0x2f')][_0x9fc5('0x7f')]({'where':{'id':_0xeb5e0b[_0x9fc5('0x4a')]['id']}})[_0x9fc5('0x29')](function(_0x4c6cf1){if(_0x4c6cf1){var _0x42cd50=util[_0x9fc5('0x53')](_0x9fc5('0x54'),_0x4c6cf1[_0x9fc5('0x52')]);if(fs['existsSync'](_0x42cd50)){cypher=!![];return _0x24544b[_0x9fc5('0x56')](_0x42cd50,_0x4c6cf1[_0x9fc5('0x52')],config[_0x9fc5('0x67')][_0x9fc5('0x57')])['then'](function(){return _0x4c6cf1;});}return _0x4c6cf1;}})['then'](function(_0x1423bc){if(!_0x1423bc){throw new db[(_0x9fc5('0x58'))][(_0x9fc5('0x59'))]('Voice\x20Recording\x20not\x20found');}_0x214bce=_0x1423bc;return db[_0x9fc5('0x80')][_0x9fc5('0x7f')]({'where':{'id':0x1}});})[_0x9fc5('0x29')](handleEntityNotFound(_0x454620,null))[_0x9fc5('0x29')](function(_0x4d4e54){if(_0x4d4e54){_0x5cd190=_0x4d4e54;if(!_0x5cd190[_0x9fc5('0x81')]||!_0x5cd190[_0x9fc5('0x82')]||!_0x5cd190[_0x9fc5('0x83')]||!_0x5cd190[_0x9fc5('0x84')]||!_0x5cd190[_0x9fc5('0x78')]){throw new db[(_0x9fc5('0x58'))][(_0x9fc5('0x59'))](_0x9fc5('0x85'));}if(_0xeb5e0b[_0x9fc5('0x4c')][_0x9fc5('0x86')]&&(!_0x5cd190['sentiment']||!_0x5cd190[_0x9fc5('0x87')]||!_0x5cd190[_0x9fc5('0x88')]||!_0x5cd190[_0x9fc5('0x84')]||!_0x5cd190[_0x9fc5('0x78')])){throw new db['Sequelize'][(_0x9fc5('0x59'))](_0x9fc5('0x89'));}return db['CloudProvider'][_0x9fc5('0x7f')]({'where':{'id':_0x5cd190[_0x9fc5('0x82')]}});}})[_0x9fc5('0x29')](function(_0x1b2a06){if(!_0x1b2a06){throw new db[(_0x9fc5('0x58'))][(_0x9fc5('0x59'))](_0x9fc5('0x8a'));}if(!_0x1b2a06[_0x9fc5('0x8b')]||!_0x1b2a06[_0x9fc5('0x8c')]){throw new db['Sequelize'][(_0x9fc5('0x59'))](_0x9fc5('0x8d'));}_0x5e57bb=_0x1b2a06;return getBucketslist(_0x5e57bb[_0x9fc5('0x8b')],_0x5e57bb[_0x9fc5('0x8c')],_0x5cd190['transcribeRegion']);})[_0x9fc5('0x29')](function(_0x51ff97){if(_0x51ff97&&_0x51ff97[_0x9fc5('0x8e')]){var _0x179365=_[_0x9fc5('0x4d')](_0x51ff97['Buckets'],function(_0x56f08e){return _0x56f08e[_0x9fc5('0x8f')]===_0x5cd190['bucket'];});if(!_0x179365){logger[_0x9fc5('0x6d')](util['format'](_0x9fc5('0x90'),_0xeb5e0b['params']['id'],_0x5cd190[_0x9fc5('0x78')]));return createBucket(_0x5e57bb[_0x9fc5('0x8b')],_0x5e57bb['data2'],_0x5cd190['transcribeRegion'],_0x5cd190[_0x9fc5('0x78')]);}logger[_0x9fc5('0x6d')](util[_0x9fc5('0x53')](_0x9fc5('0x91'),_0xeb5e0b['params']['id'],_0x5cd190[_0x9fc5('0x78')]));return;}})[_0x9fc5('0x29')](function(_0xdc0237){if(_0x214bce['transcribeStatus']===_0x9fc5('0x92')){return transcribe(_0xeb5e0b[_0x9fc5('0x4a')]['id'],_0x5e57bb[_0x9fc5('0x8b')],_0x5e57bb['data2'],_0x5cd190[_0x9fc5('0x83')],_0x5cd190[_0x9fc5('0x78')],_0x214bce[_0x9fc5('0x52')],_0x5cd190[_0x9fc5('0x84')]);}else{logger[_0x9fc5('0x6d')](util[_0x9fc5('0x53')](_0x9fc5('0x93'),_0xeb5e0b[_0x9fc5('0x4a')]['id']));return{'transcribeStatus':_0x9fc5('0x94')};}})[_0x9fc5('0x29')](function(_0x3a0d4f){if(_0x3a0d4f){_0x3a0d4f[_0x9fc5('0x95')]=_0xeb5e0b[_0x9fc5('0x4c')][_0x9fc5('0x86')];return _0x214bce[_0x9fc5('0x96')](_0x3a0d4f);}})['then'](respondWithResult(_0x454620,null))[_0x9fc5('0x49')](handleError(_0x454620,null));};function writeFile(_0x3f4b84,_0x33c983){return new Promise(function(_0x205231,_0x5bafde){fs[_0x9fc5('0x97')](_0x33c983,_0x3f4b84,function(_0x23389f,_0x2fdad4){if(_0x23389f){return _0x5bafde(_0x23389f);}else{return _0x205231(_0x2fdad4);}});});}exports['downloadTranscribe']=function(_0x409ce5,_0x504e95,_0x1996a7){return db[_0x9fc5('0x2f')][_0x9fc5('0x7f')]({'where':{'id':_0x409ce5[_0x9fc5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x504e95))[_0x9fc5('0x29')](function(_0x3b407d){if(_0x3b407d&&_0x3b407d[_0x9fc5('0x98')]){var _0x4d483c=_0x3b407d[_0x9fc5('0x98')];var _0xd3ac8=config[_0x9fc5('0x99')]+_0x9fc5('0x9a')+_0x3b407d['id']+'.txt';if(fs[_0x9fc5('0x55')](_0xd3ac8)){return _0xd3ac8;}return writeFile(_0x4d483c,_0xd3ac8)[_0x9fc5('0x29')](function(){return _0xd3ac8;});}else{throw new db[(_0x9fc5('0x58'))]['ValidationError'](_0x9fc5('0x9b'));}})['then'](function(_0x69d5f0){return _0x504e95[_0x9fc5('0x4f')](_0x69d5f0);})[_0x9fc5('0x49')](handleError(_0x504e95));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index f016115..95f642a 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 _0xf3dc=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings'];(function(_0xc96929,_0x6b9a4c){var _0x305d00=function(_0x38c36b){while(--_0x38c36b){_0xc96929['push'](_0xc96929['shift']());}};_0x305d00(++_0x6b9a4c);}(_0xf3dc,0x9c));var _0xcf3d=function(_0x435ba5,_0x55875f){_0x435ba5=_0x435ba5-0x0;var _0x5af51d=_0xf3dc[_0x435ba5];return _0x5af51d;};'use strict';var attributes=require(_0xcf3d('0x0'));module[_0xcf3d('0x1')]=function(_0x3a135c,_0x47f284){return _0x3a135c[_0xcf3d('0x2')](_0xcf3d('0x3'),attributes,{'tableName':_0xcf3d('0x4'),'paranoid':![],'indexes':[{'name':_0xcf3d('0x5'),'fields':[_0xcf3d('0x5')]},{'name':_0xcf3d('0x6'),'fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0c2b=['uniqueid','transcribeStatus','./voiceRecording.attributes','exports','define','voice_recordings'];(function(_0xaaa123,_0x4c23e3){var _0x44d6d7=function(_0x5c92e4){while(--_0x5c92e4){_0xaaa123['push'](_0xaaa123['shift']());}};_0x44d6d7(++_0x4c23e3);}(_0x0c2b,0x134));var _0xb0c2=function(_0x1fdc8c,_0x9d6526){_0x1fdc8c=_0x1fdc8c-0x0;var _0x2a095d=_0x0c2b[_0x1fdc8c];return _0x2a095d;};'use strict';var attributes=require(_0xb0c2('0x0'));module[_0xb0c2('0x1')]=function(_0x4fbd93,_0x5e4432){return _0x4fbd93[_0xb0c2('0x2')]('VoiceRecording',attributes,{'tableName':_0xb0c2('0x3'),'paranoid':![],'indexes':[{'name':_0xb0c2('0x4'),'fields':[_0xb0c2('0x4')]},{'name':_0xb0c2('0x5'),'fields':[_0xb0c2('0x5')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index d66c75c..7f20d3d 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 _0x3a6d=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateVoiceRecording','VoiceRecording','update','options','raw','where','debug','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','body','value','%s.cypher','encryptFile','secrets','recording','unlink','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x139cf2,_0x21ce88){var _0x1f82a7=function(_0x37d99e){while(--_0x37d99e){_0x139cf2['push'](_0x139cf2['shift']());}};_0x1f82a7(++_0x21ce88);}(_0x3a6d,0x143));var _0xd3a6=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x3a6d[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('VoiceRecording,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')](_0x8d1286['body'],{'raw':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286['options'][_0xd3a6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')]['attributes']||null:null,'limit':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')]['limit']||null:null})['then'](function(_0x5846bc){logger['info']('UpdateVoiceRecording',_0x8d1286);logger[_0xd3a6('0x1c')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x5846bc));_0xbe58b4(_0x5846bc);})['catch'](function(_0x456541){logger['error'](_0xd3a6('0x16'),_0x456541[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x456541['message']));});});};exports[_0xd3a6('0x1d')]=function(_0x3bc8d1){var _0x1b09ac=this;return new Promise(function(_0x219e32,_0x169d11){var _0x3106f1=require('../../components/encryptor');var _0x30df90;return db[_0xd3a6('0x1e')][_0xd3a6('0x1f')]({'attributes':['id',_0xd3a6('0x20')],'where':{'id':0x1},'raw':!![]})[_0xd3a6('0xd')](function(_0x45c628){_0x30df90=_0x45c628;return db['VoiceRecording']['create'](_0x3bc8d1[_0xd3a6('0x21')]);})[_0xd3a6('0xd')](function(_0x35981c){if(_0x30df90[_0xd3a6('0x20')]&&fs['existsSync'](_0x35981c[_0xd3a6('0x22')])){var _0xa4efd=util['format'](_0xd3a6('0x23'),_0x35981c['value']);return _0x3106f1[_0xd3a6('0x24')](_0x35981c[_0xd3a6('0x22')],_0xa4efd,config[_0xd3a6('0x25')][_0xd3a6('0x26')])[_0xd3a6('0xd')](function(){fs[_0xd3a6('0x27')](_0x35981c[_0xd3a6('0x22')]);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x35981c;});}return _0x35981c;})[_0xd3a6('0xd')](function(_0x155640){logger[_0xd3a6('0xe')]('CreateVoiceRecording',_0x3bc8d1);logger[_0xd3a6('0x1c')](_0xd3a6('0x1d'),_0x3bc8d1,JSON[_0xd3a6('0x12')](_0x155640));_0x219e32(_0x155640);})[_0xd3a6('0x28')](function(_0x3ebd0d){logger[_0xd3a6('0x13')](_0xd3a6('0x1d'),_0x3ebd0d[_0xd3a6('0x14')],_0x3bc8d1);_0x169d11(_0x1b09ac['error'](0x1f4,_0x3ebd0d[_0xd3a6('0x14')]));});});}; \ No newline at end of file +var _0xa46e=['then','request\x20sent','debug','stringify','error','code','message','VoiceRecording,\x20%s,\x20%s','info','result','catch','VoiceRecording','update','options','raw','where','attributes','findOne','callRecordingEncryption','create','value','format','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request'];(function(_0x23f8c8,_0xb536b9){var _0x3dc718=function(_0x25d719){while(--_0x25d719){_0x23f8c8['push'](_0x23f8c8['shift']());}};_0x3dc718(++_0xb536b9);}(_0xa46e,0x8a));var _0xea46=function(_0x1196bd,_0xba4aea){_0x1196bd=_0x1196bd-0x0;var _0x26014f=_0xa46e[_0x1196bd];return _0x26014f;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('VoiceRecording,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('VoiceRecording,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('VoiceRecording,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}exports['UpdateVoiceRecording']=function(_0x19d5c1){var _0x3f463d=this;return new Promise(function(_0x5cf5dd,_0x4b6745){return db[_0xea46('0x15')][_0xea46('0x16')](_0x19d5c1['body'],{'raw':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options'][_0xea46('0x19')]||null:null,'attributes':_0x19d5c1['options']?_0x19d5c1['options'][_0xea46('0x1a')]||null:null,'limit':_0x19d5c1['options']?_0x19d5c1['options']['limit']||null:null})[_0xea46('0xa')](function(_0x36f982){logger[_0xea46('0x12')]('UpdateVoiceRecording',_0x19d5c1);logger[_0xea46('0xc')]('UpdateVoiceRecording',_0x19d5c1,JSON[_0xea46('0xd')](_0x36f982));_0x5cf5dd(_0x36f982);})[_0xea46('0x14')](function(_0x528eae){logger[_0xea46('0xe')]('UpdateVoiceRecording',_0x528eae[_0xea46('0x10')],_0x19d5c1);_0x4b6745(_0x3f463d[_0xea46('0xe')](0x1f4,_0x528eae[_0xea46('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x5d2de1){var _0x44e797=this;return new Promise(function(_0x38ac07,_0x4b369c){var _0x3b3928=require('../../components/encryptor');var _0x11129d;return db['Setting'][_0xea46('0x1b')]({'attributes':['id',_0xea46('0x1c')],'where':{'id':0x1},'raw':!![]})[_0xea46('0xa')](function(_0x44517d){_0x11129d=_0x44517d;return db[_0xea46('0x15')][_0xea46('0x1d')](_0x5d2de1['body']);})[_0xea46('0xa')](function(_0x338e96){if(_0x11129d[_0xea46('0x1c')]&&fs['existsSync'](_0x338e96[_0xea46('0x1e')])){var _0x3cdf96=util[_0xea46('0x1f')]('%s.cypher',_0x338e96['value']);return _0x3b3928['encryptFile'](_0x338e96[_0xea46('0x1e')],_0x3cdf96,config[_0xea46('0x20')][_0xea46('0x21')])[_0xea46('0xa')](function(){fs[_0xea46('0x22')](_0x338e96[_0xea46('0x1e')]);logger[_0xea46('0x12')](_0xea46('0x23'));return _0x338e96;});}return _0x338e96;})[_0xea46('0xa')](function(_0x1c7201){logger[_0xea46('0x12')]('CreateVoiceRecording',_0x5d2de1);logger[_0xea46('0xc')](_0xea46('0x24'),_0x5d2de1,JSON[_0xea46('0xd')](_0x1c7201));_0x38ac07(_0x1c7201);})[_0xea46('0x14')](function(_0x1472c0){logger[_0xea46('0xe')](_0xea46('0x24'),_0x1472c0['message'],_0x5d2de1);_0x4b369c(_0x44e797[_0xea46('0xe')](0x1f4,_0x1472c0[_0xea46('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 013c97c..e794e94 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 _0xfcd6=['get','/describe','/:id','show','post','create','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','isAuthenticated','index'];(function(_0x123a6f,_0x20edae){var _0x17afd3=function(_0x2e1d25){while(--_0x2e1d25){_0x123a6f['push'](_0x123a6f['shift']());}};_0x17afd3(++_0x20edae);}(_0xfcd6,0x8e));var _0x6fcd=function(_0x1e4d76,_0x227cfc){_0x1e4d76=_0x1e4d76-0x0;var _0x51dc81=_0xfcd6[_0x1e4d76];return _0x51dc81;};'use strict';var multer=require(_0x6fcd('0x0'));var util=require(_0x6fcd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6fcd('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6fcd('0x3'));var interaction=require(_0x6fcd('0x4'));var config=require('../../config/environment');var controller=require(_0x6fcd('0x5'));router['get']('/',auth[_0x6fcd('0x6')](),controller[_0x6fcd('0x7')]);router[_0x6fcd('0x8')](_0x6fcd('0x9'),auth[_0x6fcd('0x6')](),controller['describe']);router[_0x6fcd('0x8')](_0x6fcd('0xa'),auth[_0x6fcd('0x6')](),controller[_0x6fcd('0xb')]);router[_0x6fcd('0xc')]('/',auth['isAuthenticated'](),controller[_0x6fcd('0xd')]);router['put'](_0x6fcd('0xa'),auth[_0x6fcd('0x6')](),controller['update']);router['delete'](_0x6fcd('0xa'),auth[_0x6fcd('0x6')](),controller[_0x6fcd('0xe')]);module['exports']=router; \ No newline at end of file +var _0x0fda=['update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post'];(function(_0x5d4ca7,_0x19113b){var _0x3efc03=function(_0x59675b){while(--_0x59675b){_0x5d4ca7['push'](_0x5d4ca7['shift']());}};_0x3efc03(++_0x19113b);}(_0x0fda,0x153));var _0xa0fd=function(_0x594347,_0x5555ff){_0x594347=_0x594347-0x0;var _0x2ba654=_0x0fda[_0x594347];return _0x2ba654;};'use strict';var multer=require(_0xa0fd('0x0'));var util=require(_0xa0fd('0x1'));var path=require(_0xa0fd('0x2'));var timeout=require(_0xa0fd('0x3'));var express=require('express');var router=express[_0xa0fd('0x4')]();var fs_extra=require(_0xa0fd('0x5'));var auth=require(_0xa0fd('0x6'));var interaction=require(_0xa0fd('0x7'));var config=require(_0xa0fd('0x8'));var controller=require(_0xa0fd('0x9'));router[_0xa0fd('0xa')]('/',auth['isAuthenticated'](),controller[_0xa0fd('0xb')]);router[_0xa0fd('0xa')](_0xa0fd('0xc'),auth['isAuthenticated'](),controller[_0xa0fd('0xd')]);router['get'](_0xa0fd('0xe'),auth[_0xa0fd('0xf')](),controller[_0xa0fd('0x10')]);router[_0xa0fd('0x11')]('/',auth[_0xa0fd('0xf')](),controller['create']);router['put'](_0xa0fd('0xe'),auth['isAuthenticated'](),controller[_0xa0fd('0x12')]);router[_0xa0fd('0x13')](_0xa0fd('0xe'),auth[_0xa0fd('0xf')](),controller['destroy']);module[_0xa0fd('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 791cf99..078b518 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 _0x7d2f=['ENUM','blind','attended','STRING','Yes'];(function(_0xa4f047,_0x30cffe){var _0x280a03=function(_0x1c4c36){while(--_0x1c4c36){_0xa4f047['push'](_0xa4f047['shift']());}};_0x280a03(++_0x30cffe);}(_0x7d2f,0x127));var _0xf7d2=function(_0x4c6fe5,_0x1fb2f2){_0x4c6fe5=_0x4c6fe5-0x0;var _0x5dc725=_0x7d2f[_0x4c6fe5];return _0x5dc725;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'type':{'type':Sequelize[_0xf7d2('0x0')](_0xf7d2('0x1'),_0xf7d2('0x2'))},'result':{'type':Sequelize[_0xf7d2('0x3')]},'transfererchannel':{'type':Sequelize[_0xf7d2('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xf7d2('0x3')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0xf7d2('0x3')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0xf7d2('0x3')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xf7d2('0x3')]},'transfererlinkedid':{'type':Sequelize[_0xf7d2('0x3')]},'transfereechannel':{'type':Sequelize[_0xf7d2('0x3')]},'transfereecalleridnum':{'type':Sequelize[_0xf7d2('0x3')]},'transfereecalleridname':{'type':Sequelize[_0xf7d2('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xf7d2('0x3')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0xf7d2('0x3')]},'transfereeexten':{'type':Sequelize[_0xf7d2('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xf7d2('0x3')]},'isexternal':{'type':Sequelize[_0xf7d2('0x0')](_0xf7d2('0x4'),'No')},'context':{'type':Sequelize[_0xf7d2('0x3')]},'extension':{'type':Sequelize[_0xf7d2('0x3')]}}; \ No newline at end of file +var _0xc90c=['ENUM','Yes','sequelize','moment','exports','STRING'];(function(_0x2ee223,_0x4d7078){var _0x421eaf=function(_0x4b8074){while(--_0x4b8074){_0x2ee223['push'](_0x2ee223['shift']());}};_0x421eaf(++_0x4d7078);}(_0xc90c,0xec));var _0xcc90=function(_0x3ac281,_0x2cf959){_0x3ac281=_0x3ac281-0x0;var _0x274faf=_0xc90c[_0x3ac281];return _0x274faf;};'use strict';var Sequelize=require(_0xcc90('0x0'));var moment=require(_0xcc90('0x1'));module[_0xcc90('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0xcc90('0x3')]},'transferercalleridnum':{'type':Sequelize[_0xcc90('0x3')]},'transferercalleridname':{'type':Sequelize[_0xcc90('0x3')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xcc90('0x3')]},'transfereraccountcode':{'type':Sequelize[_0xcc90('0x3')]},'transferercontext':{'type':Sequelize[_0xcc90('0x3')]},'transfererexten':{'type':Sequelize[_0xcc90('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize[_0xcc90('0x3')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0xcc90('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0xcc90('0x3')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0xcc90('0x3')]},'transfereecontext':{'type':Sequelize[_0xcc90('0x3')]},'transfereeexten':{'type':Sequelize[_0xcc90('0x3')]},'transfereelinkedid':{'type':Sequelize[_0xcc90('0x3')]},'isexternal':{'type':Sequelize[_0xcc90('0x4')](_0xcc90('0x5'),'No')},'context':{'type':Sequelize[_0xcc90('0x3')]},'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 31c59a3..e8c91bc 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 _0xcf98=['mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','apply','save','update','destroy','then','error','name','index','VoiceTransferReport','fieldName','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment'];(function(_0x5333d8,_0x4cbe38){var _0x3e8edb=function(_0x26fc36){while(--_0x26fc36){_0x5333d8['push'](_0x5333d8['shift']());}};_0x3e8edb(++_0x4cbe38);}(_0xcf98,0xc4));var _0x8cf9=function(_0x56cabb,_0x598abb){_0x56cabb=_0x56cabb-0x0;var _0x6360ed=_0xcf98[_0x56cabb];return _0x6360ed;};'use strict';var emlformat=require(_0x8cf9('0x0'));var rimraf=require(_0x8cf9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8cf9('0x2'));var rp=require(_0x8cf9('0x3'));var moment=require(_0x8cf9('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8cf9('0x5'));var util=require(_0x8cf9('0x6'));var path=require('path');var sox=require(_0x8cf9('0x7'));var csv=require(_0x8cf9('0x8'));var ejs=require(_0x8cf9('0x9'));var fs=require('fs');var fs_extra=require(_0x8cf9('0xa'));var _=require(_0x8cf9('0xb'));var squel=require(_0x8cf9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8cf9('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8cf9('0xe'));var Redis=require(_0x8cf9('0xf'));var authService=require(_0x8cf9('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8cf9('0x11'));var logger=require(_0x8cf9('0x12'))(_0x8cf9('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x8cf9('0x14'));var db=require(_0x8cf9('0x15'))['db'];function respondWithStatusCode(_0x2a5d3d,_0xf9f6b6){_0xf9f6b6=_0xf9f6b6||0xcc;return function(_0x4cd305){if(_0x4cd305){return _0x2a5d3d[_0x8cf9('0x16')](_0xf9f6b6);}return _0x2a5d3d[_0x8cf9('0x17')](_0xf9f6b6)[_0x8cf9('0x18')]();};}function respondWithResult(_0x3894bd,_0x2df867){_0x2df867=_0x2df867||0xc8;return function(_0x5227e0){if(_0x5227e0){return _0x3894bd[_0x8cf9('0x17')](_0x2df867)[_0x8cf9('0x19')](_0x5227e0);}};}function respondWithFilteredResult(_0x4b47e1,_0x3a76dd){return function(_0x45a7ad){if(_0x45a7ad){var _0x33297a=typeof _0x3a76dd[_0x8cf9('0x1a')]===_0x8cf9('0x1b')&&typeof _0x3a76dd['limit']===_0x8cf9('0x1b');var _0x238eec=_0x45a7ad[_0x8cf9('0x1c')];var _0x10ee15=_0x33297a?0x0:_0x3a76dd['offset'];var _0x14fa49=_0x33297a?_0x45a7ad[_0x8cf9('0x1c')]:_0x3a76dd[_0x8cf9('0x1a')]+_0x3a76dd[_0x8cf9('0x1d')];var _0x51deb8;if(_0x14fa49>=_0x238eec){_0x14fa49=_0x238eec;_0x51deb8=0xc8;}else{_0x51deb8=0xce;}_0x4b47e1[_0x8cf9('0x17')](_0x51deb8);return _0x4b47e1['set']('Content-Range',_0x10ee15+'-'+_0x14fa49+'/'+_0x238eec)['json'](_0x45a7ad);}return null;};}function patchUpdates(_0x1049b4){return function(_0x8f672c){try{jsonpatch[_0x8cf9('0x1e')](_0x8f672c,_0x1049b4,!![]);}catch(_0x1e9610){return BPromise['reject'](_0x1e9610);}return _0x8f672c[_0x8cf9('0x1f')]();};}function saveUpdates(_0x344731,_0x4ede15){return function(_0x364916){if(_0x364916){return _0x364916[_0x8cf9('0x20')](_0x344731)['then'](function(_0x31798a){return _0x31798a;});}return null;};}function removeEntity(_0x3c2e9b,_0x357199){return function(_0x3092e7){if(_0x3092e7){return _0x3092e7[_0x8cf9('0x21')]()[_0x8cf9('0x22')](function(){_0x3c2e9b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b762d,_0x254000){return function(_0x52f663){if(!_0x52f663){_0x1b762d['sendStatus'](0x194);}return _0x52f663;};}function handleError(_0x16ff3d,_0x5de994){_0x5de994=_0x5de994||0x1f4;return function(_0x35faae){logger[_0x8cf9('0x23')](_0x35faae['stack']);if(_0x35faae[_0x8cf9('0x24')]){delete _0x35faae[_0x8cf9('0x24')];}_0x16ff3d[_0x8cf9('0x17')](_0x5de994)['send'](_0x35faae);};}exports[_0x8cf9('0x25')]=function(_0x191cfa,_0x348331){var _0x1f750a={},_0x2712c9={},_0x44c4fa={'count':0x0,'rows':[]};var _0x15581f=_['map'](db[_0x8cf9('0x26')]['rawAttributes'],function(_0x347028){return{'name':_0x347028[_0x8cf9('0x27')],'type':_0x347028['type']['key']};});_0x2712c9[_0x8cf9('0x28')]=_[_0x8cf9('0x29')](_0x15581f,_0x8cf9('0x24'));_0x2712c9[_0x8cf9('0x2a')]=_[_0x8cf9('0x2b')](_0x191cfa[_0x8cf9('0x2a')]);_0x2712c9[_0x8cf9('0x2c')]=_[_0x8cf9('0x2d')](_0x2712c9[_0x8cf9('0x28')],_0x2712c9[_0x8cf9('0x2a')]);_0x1f750a[_0x8cf9('0x2e')]=_[_0x8cf9('0x2d')](_0x2712c9[_0x8cf9('0x28')],qs[_0x8cf9('0x2f')](_0x191cfa[_0x8cf9('0x2a')][_0x8cf9('0x2f')]));_0x1f750a[_0x8cf9('0x2e')]=_0x1f750a[_0x8cf9('0x2e')]['length']?_0x1f750a[_0x8cf9('0x2e')]:_0x2712c9[_0x8cf9('0x28')];if(!_0x191cfa[_0x8cf9('0x2a')][_0x8cf9('0x30')](_0x8cf9('0x31'))){_0x1f750a[_0x8cf9('0x1d')]=qs[_0x8cf9('0x1d')](_0x191cfa[_0x8cf9('0x2a')][_0x8cf9('0x1d')]);_0x1f750a[_0x8cf9('0x1a')]=qs[_0x8cf9('0x1a')](_0x191cfa['query'][_0x8cf9('0x1a')]);}_0x1f750a['order']=qs[_0x8cf9('0x32')](_0x191cfa[_0x8cf9('0x2a')]['sort']);_0x1f750a[_0x8cf9('0x33')]=qs[_0x8cf9('0x2c')](_[_0x8cf9('0x34')](_0x191cfa[_0x8cf9('0x2a')],_0x2712c9[_0x8cf9('0x2c')]),_0x15581f);if(_0x191cfa[_0x8cf9('0x2a')][_0x8cf9('0x35')]){_0x1f750a[_0x8cf9('0x33')]=_['merge'](_0x1f750a[_0x8cf9('0x33')],{'$or':_[_0x8cf9('0x29')](_0x15581f,function(_0x15d9c0){if(_0x15d9c0['type']!==_0x8cf9('0x36')){var _0x7276e0={};_0x7276e0[_0x15d9c0[_0x8cf9('0x24')]]={'$like':'%'+_0x191cfa[_0x8cf9('0x2a')]['filter']+'%'};return _0x7276e0;}})});}_0x1f750a=_[_0x8cf9('0x37')]({},_0x1f750a,_0x191cfa['options']);var _0xded80b={'where':_0x1f750a[_0x8cf9('0x33')]};return db['VoiceTransferReport'][_0x8cf9('0x1c')](_0xded80b)[_0x8cf9('0x22')](function(_0x16bbb3){_0x44c4fa[_0x8cf9('0x1c')]=_0x16bbb3;if(_0x191cfa[_0x8cf9('0x2a')][_0x8cf9('0x38')]){_0x1f750a[_0x8cf9('0x39')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x8cf9('0x3a')](_0x1f750a);})[_0x8cf9('0x22')](function(_0x1ac7da){_0x44c4fa['rows']=_0x1ac7da;return _0x44c4fa;})[_0x8cf9('0x22')](respondWithFilteredResult(_0x348331,_0x1f750a))[_0x8cf9('0x3b')](handleError(_0x348331,null));};exports[_0x8cf9('0x3c')]=function(_0x2cf430,_0x41bcc2){var _0x252970={'raw':!![],'where':{'id':_0x2cf430['params']['id']}},_0x2b0536={};_0x2b0536[_0x8cf9('0x28')]=_[_0x8cf9('0x2b')](db[_0x8cf9('0x26')]['rawAttributes']);_0x2b0536[_0x8cf9('0x2a')]=_[_0x8cf9('0x2b')](_0x2cf430[_0x8cf9('0x2a')]);_0x2b0536[_0x8cf9('0x2c')]=_['intersection'](_0x2b0536[_0x8cf9('0x28')],_0x2b0536[_0x8cf9('0x2a')]);_0x252970['attributes']=_[_0x8cf9('0x2d')](_0x2b0536['model'],qs[_0x8cf9('0x2f')](_0x2cf430[_0x8cf9('0x2a')][_0x8cf9('0x2f')]));_0x252970['attributes']=_0x252970[_0x8cf9('0x2e')]['length']?_0x252970['attributes']:_0x2b0536[_0x8cf9('0x28')];if(_0x2cf430[_0x8cf9('0x2a')][_0x8cf9('0x38')]){_0x252970[_0x8cf9('0x39')]=[{'all':!![]}];}_0x252970=_[_0x8cf9('0x37')]({},_0x252970,_0x2cf430[_0x8cf9('0x3d')]);return db[_0x8cf9('0x26')][_0x8cf9('0x3e')](_0x252970)[_0x8cf9('0x22')](handleEntityNotFound(_0x41bcc2,null))[_0x8cf9('0x22')](respondWithResult(_0x41bcc2,null))[_0x8cf9('0x3b')](handleError(_0x41bcc2,null));};exports[_0x8cf9('0x3f')]=function(_0x179c7a,_0x5087a5){return db[_0x8cf9('0x26')][_0x8cf9('0x3f')](_0x179c7a[_0x8cf9('0x40')],{})[_0x8cf9('0x22')](respondWithResult(_0x5087a5,0xc9))[_0x8cf9('0x3b')](handleError(_0x5087a5,null));};exports['update']=function(_0x33998a,_0x18b0b3){if(_0x33998a[_0x8cf9('0x40')]['id']){delete _0x33998a['body']['id'];}return db[_0x8cf9('0x26')]['find']({'where':{'id':_0x33998a[_0x8cf9('0x41')]['id']}})[_0x8cf9('0x22')](handleEntityNotFound(_0x18b0b3,null))[_0x8cf9('0x22')](saveUpdates(_0x33998a[_0x8cf9('0x40')],null))[_0x8cf9('0x22')](respondWithResult(_0x18b0b3,null))[_0x8cf9('0x3b')](handleError(_0x18b0b3,null));};exports[_0x8cf9('0x21')]=function(_0x19bd36,_0x214fbd){return db[_0x8cf9('0x26')][_0x8cf9('0x3e')]({'where':{'id':_0x19bd36[_0x8cf9('0x41')]['id']}})[_0x8cf9('0x22')](handleEntityNotFound(_0x214fbd,null))['then'](removeEntity(_0x214fbd,null))['catch'](handleError(_0x214fbd,null));};exports[_0x8cf9('0x42')]=function(_0x10c3b9,_0x3efdc1){return db[_0x8cf9('0x26')]['describe']()[_0x8cf9('0x22')](respondWithResult(_0x3efdc1,null))[_0x8cf9('0x3b')](handleError(_0x3efdc1,null));}; \ No newline at end of file +var _0x03f6=['moment','bluebird','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','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','stack','name','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VoiceTransferReport','includeAll','include','findAll','rows','params','keys','fields','options','find','create','catch','body','describe','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x409480,_0x5ebc62){var _0xb49dee=function(_0x352bf4){while(--_0x352bf4){_0x409480['push'](_0x409480['shift']());}};_0xb49dee(++_0x5ebc62);}(_0x03f6,0x90));var _0x603f=function(_0x4c227b,_0x5b5a0e){_0x4c227b=_0x4c227b-0x0;var _0xdf15ac=_0x03f6[_0x4c227b];return _0xdf15ac;};'use strict';var emlformat=require(_0x603f('0x0'));var rimraf=require(_0x603f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x603f('0x2'));var rp=require(_0x603f('0x3'));var moment=require(_0x603f('0x4'));var BPromise=require(_0x603f('0x5'));var Mustache=require(_0x603f('0x6'));var util=require(_0x603f('0x7'));var path=require('path');var sox=require(_0x603f('0x8'));var csv=require(_0x603f('0x9'));var ejs=require(_0x603f('0xa'));var fs=require('fs');var fs_extra=require(_0x603f('0xb'));var _=require(_0x603f('0xc'));var squel=require(_0x603f('0xd'));var crypto=require(_0x603f('0xe'));var jsforce=require(_0x603f('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x603f('0x10'));var Papa=require(_0x603f('0x11'));var Redis=require(_0x603f('0x12'));var authService=require(_0x603f('0x13'));var qs=require(_0x603f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x603f('0x15'));var logger=require(_0x603f('0x16'))('api');var utils=require(_0x603f('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x603f('0x18'))['db'];function respondWithStatusCode(_0x33b5b4,_0x47ea0e){_0x47ea0e=_0x47ea0e||0xcc;return function(_0x27d865){if(_0x27d865){return _0x33b5b4[_0x603f('0x19')](_0x47ea0e);}return _0x33b5b4[_0x603f('0x1a')](_0x47ea0e)[_0x603f('0x1b')]();};}function respondWithResult(_0xffae5d,_0x505fac){_0x505fac=_0x505fac||0xc8;return function(_0x25c80f){if(_0x25c80f){return _0xffae5d[_0x603f('0x1a')](_0x505fac)[_0x603f('0x1c')](_0x25c80f);}};}function respondWithFilteredResult(_0x2e0318,_0xab4f17){return function(_0x5b24a7){if(_0x5b24a7){var _0x531ac6=typeof _0xab4f17[_0x603f('0x1d')]===_0x603f('0x1e')&&typeof _0xab4f17[_0x603f('0x1f')]==='undefined';var _0x58539c=_0x5b24a7[_0x603f('0x20')];var _0xf7b0f7=_0x531ac6?0x0:_0xab4f17[_0x603f('0x1d')];var _0x1170a8=_0x531ac6?_0x5b24a7[_0x603f('0x20')]:_0xab4f17[_0x603f('0x1d')]+_0xab4f17[_0x603f('0x1f')];var _0x108d12;if(_0x1170a8>=_0x58539c){_0x1170a8=_0x58539c;_0x108d12=0xc8;}else{_0x108d12=0xce;}_0x2e0318[_0x603f('0x1a')](_0x108d12);return _0x2e0318[_0x603f('0x21')]('Content-Range',_0xf7b0f7+'-'+_0x1170a8+'/'+_0x58539c)['json'](_0x5b24a7);}return null;};}function patchUpdates(_0x158bb9){return function(_0x574989){try{jsonpatch['apply'](_0x574989,_0x158bb9,!![]);}catch(_0x426cd8){return BPromise[_0x603f('0x22')](_0x426cd8);}return _0x574989[_0x603f('0x23')]();};}function saveUpdates(_0x243223,_0x2f5893){return function(_0x2083aa){if(_0x2083aa){return _0x2083aa[_0x603f('0x24')](_0x243223)[_0x603f('0x25')](function(_0x307846){return _0x307846;});}return null;};}function removeEntity(_0x5d2d3b,_0x282cc4){return function(_0x4b4ced){if(_0x4b4ced){return _0x4b4ced[_0x603f('0x26')]()[_0x603f('0x25')](function(){_0x5d2d3b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x44bde9,_0x15e905){return function(_0x47815b){if(!_0x47815b){_0x44bde9[_0x603f('0x19')](0x194);}return _0x47815b;};}function handleError(_0x406344,_0x8e6b31){_0x8e6b31=_0x8e6b31||0x1f4;return function(_0x335715){logger['error'](_0x335715[_0x603f('0x27')]);if(_0x335715['name']){delete _0x335715[_0x603f('0x28')];}_0x406344['status'](_0x8e6b31)['send'](_0x335715);};}exports[_0x603f('0x29')]=function(_0x252ab3,_0x244b78){var _0x27d6ef={},_0x1fed4a={},_0x5d6d45={'count':0x0,'rows':[]};var _0x3f3171=_['map'](db['VoiceTransferReport'][_0x603f('0x2a')],function(_0x10fc7b){return{'name':_0x10fc7b[_0x603f('0x2b')],'type':_0x10fc7b[_0x603f('0x2c')][_0x603f('0x2d')]};});_0x1fed4a[_0x603f('0x2e')]=_['map'](_0x3f3171,_0x603f('0x28'));_0x1fed4a[_0x603f('0x2f')]=_['keys'](_0x252ab3[_0x603f('0x2f')]);_0x1fed4a[_0x603f('0x30')]=_[_0x603f('0x31')](_0x1fed4a[_0x603f('0x2e')],_0x1fed4a[_0x603f('0x2f')]);_0x27d6ef[_0x603f('0x32')]=_[_0x603f('0x31')](_0x1fed4a[_0x603f('0x2e')],qs['fields'](_0x252ab3[_0x603f('0x2f')]['fields']));_0x27d6ef[_0x603f('0x32')]=_0x27d6ef[_0x603f('0x32')][_0x603f('0x33')]?_0x27d6ef['attributes']:_0x1fed4a[_0x603f('0x2e')];if(!_0x252ab3[_0x603f('0x2f')][_0x603f('0x34')](_0x603f('0x35'))){_0x27d6ef['limit']=qs['limit'](_0x252ab3[_0x603f('0x2f')][_0x603f('0x1f')]);_0x27d6ef[_0x603f('0x1d')]=qs['offset'](_0x252ab3[_0x603f('0x2f')][_0x603f('0x1d')]);}_0x27d6ef[_0x603f('0x36')]=qs[_0x603f('0x37')](_0x252ab3[_0x603f('0x2f')][_0x603f('0x37')]);_0x27d6ef[_0x603f('0x38')]=qs[_0x603f('0x30')](_['pick'](_0x252ab3[_0x603f('0x2f')],_0x1fed4a[_0x603f('0x30')]),_0x3f3171);if(_0x252ab3[_0x603f('0x2f')][_0x603f('0x39')]){_0x27d6ef[_0x603f('0x38')]=_[_0x603f('0x3a')](_0x27d6ef['where'],{'$or':_[_0x603f('0x3b')](_0x3f3171,function(_0x245ac8){if(_0x245ac8[_0x603f('0x2c')]!=='VIRTUAL'){var _0x271a3a={};_0x271a3a[_0x245ac8[_0x603f('0x28')]]={'$like':'%'+_0x252ab3[_0x603f('0x2f')][_0x603f('0x39')]+'%'};return _0x271a3a;}})});}_0x27d6ef=_[_0x603f('0x3a')]({},_0x27d6ef,_0x252ab3['options']);var _0xa7503={'where':_0x27d6ef['where']};return db[_0x603f('0x3c')][_0x603f('0x20')](_0xa7503)[_0x603f('0x25')](function(_0x52864e){_0x5d6d45[_0x603f('0x20')]=_0x52864e;if(_0x252ab3[_0x603f('0x2f')][_0x603f('0x3d')]){_0x27d6ef[_0x603f('0x3e')]=[{'all':!![]}];}return db[_0x603f('0x3c')][_0x603f('0x3f')](_0x27d6ef);})[_0x603f('0x25')](function(_0x306f5e){_0x5d6d45[_0x603f('0x40')]=_0x306f5e;return _0x5d6d45;})[_0x603f('0x25')](respondWithFilteredResult(_0x244b78,_0x27d6ef))['catch'](handleError(_0x244b78,null));};exports['show']=function(_0x26cd1d,_0x23180f){var _0x57ed28={'raw':!![],'where':{'id':_0x26cd1d[_0x603f('0x41')]['id']}},_0x15af18={};_0x15af18[_0x603f('0x2e')]=_[_0x603f('0x42')](db[_0x603f('0x3c')]['rawAttributes']);_0x15af18['query']=_[_0x603f('0x42')](_0x26cd1d[_0x603f('0x2f')]);_0x15af18['filters']=_[_0x603f('0x31')](_0x15af18[_0x603f('0x2e')],_0x15af18['query']);_0x57ed28['attributes']=_[_0x603f('0x31')](_0x15af18[_0x603f('0x2e')],qs[_0x603f('0x43')](_0x26cd1d[_0x603f('0x2f')][_0x603f('0x43')]));_0x57ed28[_0x603f('0x32')]=_0x57ed28[_0x603f('0x32')][_0x603f('0x33')]?_0x57ed28[_0x603f('0x32')]:_0x15af18['model'];if(_0x26cd1d['query'][_0x603f('0x3d')]){_0x57ed28[_0x603f('0x3e')]=[{'all':!![]}];}_0x57ed28=_['merge']({},_0x57ed28,_0x26cd1d[_0x603f('0x44')]);return db[_0x603f('0x3c')][_0x603f('0x45')](_0x57ed28)['then'](handleEntityNotFound(_0x23180f,null))[_0x603f('0x25')](respondWithResult(_0x23180f,null))['catch'](handleError(_0x23180f,null));};exports[_0x603f('0x46')]=function(_0xebe2e8,_0x43a97e){return db[_0x603f('0x3c')][_0x603f('0x46')](_0xebe2e8['body'],{})[_0x603f('0x25')](respondWithResult(_0x43a97e,0xc9))[_0x603f('0x47')](handleError(_0x43a97e,null));};exports[_0x603f('0x24')]=function(_0xb1b385,_0x170a61){if(_0xb1b385[_0x603f('0x48')]['id']){delete _0xb1b385[_0x603f('0x48')]['id'];}return db[_0x603f('0x3c')][_0x603f('0x45')]({'where':{'id':_0xb1b385[_0x603f('0x41')]['id']}})[_0x603f('0x25')](handleEntityNotFound(_0x170a61,null))[_0x603f('0x25')](saveUpdates(_0xb1b385[_0x603f('0x48')],null))[_0x603f('0x25')](respondWithResult(_0x170a61,null))['catch'](handleError(_0x170a61,null));};exports['destroy']=function(_0x59ad25,_0x23bc6a){return db[_0x603f('0x3c')][_0x603f('0x45')]({'where':{'id':_0x59ad25[_0x603f('0x41')]['id']}})[_0x603f('0x25')](handleEntityNotFound(_0x23bc6a,null))[_0x603f('0x25')](removeEntity(_0x23bc6a,null))[_0x603f('0x47')](handleError(_0x23bc6a,null));};exports[_0x603f('0x49')]=function(_0x3a7c81,_0x4d1a7b){return db[_0x603f('0x3c')][_0x603f('0x49')]()[_0x603f('0x25')](respondWithResult(_0x4d1a7b,null))[_0x603f('0x47')](handleError(_0x4d1a7b,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 62cfe81..e807a16 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 _0xf5b9=['exports','define','VoiceTransferReport','report_call_transfer','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./voiceTransferReport.attributes'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xf5b9,0xb8));var _0x9f5b=function(_0x393c80,_0x336329){_0x393c80=_0x393c80-0x0;var _0x10798d=_0xf5b9[_0x393c80];return _0x10798d;};'use strict';var _=require(_0x9f5b('0x0'));var util=require(_0x9f5b('0x1'));var logger=require('../../config/logger')(_0x9f5b('0x2'));var moment=require(_0x9f5b('0x3'));var BPromise=require(_0x9f5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f5b('0x5'));var config=require(_0x9f5b('0x6'));var attributes=require(_0x9f5b('0x7'));module[_0x9f5b('0x8')]=function(_0x3364f2,_0x35d04d){return _0x3364f2[_0x9f5b('0x9')](_0x9f5b('0xa'),attributes,{'tableName':_0x9f5b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf3f=['request-promise','path','../../config/environment','./voiceTransferReport.attributes','exports','define','report_call_transfer','lodash','api'];(function(_0x180dda,_0x577ad9){var _0x5d003c=function(_0x2cdfd6){while(--_0x2cdfd6){_0x180dda['push'](_0x180dda['shift']());}};_0x5d003c(++_0x577ad9);}(_0xbf3f,0x1ed));var _0xfbf3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf3f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfbf3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfbf3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfbf3('0x2'));var fs=require('fs');var path=require(_0xfbf3('0x3'));var rimraf=require('rimraf');var config=require(_0xfbf3('0x4'));var attributes=require(_0xfbf3('0x5'));module[_0xfbf3('0x6')]=function(_0x1ffdba,_0x35b557){return _0x1ffdba[_0xfbf3('0x7')]('VoiceTransferReport',attributes,{'tableName':_0xfbf3('0x8'),'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 91f37c9..cc5f06c 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 _0x1125=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceTransferReport','body','options','raw','lodash'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0x1125,0x1ca));var _0x5112=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0x1125[_0x5a1cc9];return _0x471761;};'use strict';var _=require(_0x5112('0x0'));var util=require(_0x5112('0x1'));var moment=require(_0x5112('0x2'));var BPromise=require(_0x5112('0x3'));var rs=require(_0x5112('0x4'));var fs=require('fs');var Redis=require(_0x5112('0x5'));var db=require(_0x5112('0x6'))['db'];var utils=require(_0x5112('0x7'));var logger=require(_0x5112('0x8'))('rpc');var config=require(_0x5112('0x9'));var jayson=require(_0x5112('0xa'));var client=jayson[_0x5112('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2499f6,_0x32033b,_0x5d15a2){return new BPromise(function(_0x228b6e,_0x1040e5){return client['request'](_0x2499f6,_0x5d15a2)[_0x5112('0xc')](function(_0xd5719d){logger[_0x5112('0xd')](_0x5112('0xe'),_0x32033b,_0x5112('0xf'));logger[_0x5112('0x10')](_0x5112('0x11'),_0x32033b,_0x5112('0xf'),JSON['stringify'](_0xd5719d));if(_0xd5719d[_0x5112('0x12')]){if(_0xd5719d[_0x5112('0x12')][_0x5112('0x13')]===0x1f4){logger[_0x5112('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x32033b,_0xd5719d['error'][_0x5112('0x14')]);return _0x1040e5(_0xd5719d[_0x5112('0x12')][_0x5112('0x14')]);}logger['error'](_0x5112('0xe'),_0x32033b,_0xd5719d[_0x5112('0x12')][_0x5112('0x14')]);return _0x228b6e(_0xd5719d[_0x5112('0x12')][_0x5112('0x14')]);}else{logger[_0x5112('0xd')](_0x5112('0xe'),_0x32033b,_0x5112('0xf'));_0x228b6e(_0xd5719d[_0x5112('0x15')][_0x5112('0x14')]);}})[_0x5112('0x16')](function(_0xdb6271){logger['error'](_0x5112('0xe'),_0x32033b,_0xdb6271);_0x1040e5(_0xdb6271);});});}exports[_0x5112('0x17')]=function(_0xec6f8b){var _0x40dd4a=this;return new Promise(function(_0xf16787,_0x36ec54){return db['VoiceTransferReport']['create'](_0xec6f8b[_0x5112('0x18')],{'raw':_0xec6f8b[_0x5112('0x19')]?_0xec6f8b[_0x5112('0x19')][_0x5112('0x1a')]===undefined?!![]:![]:!![]})[_0x5112('0xc')](function(_0x27f0a8){logger['info'](_0x5112('0x17'),_0xec6f8b);logger[_0x5112('0x10')]('CreateVoiceTransferReport',_0xec6f8b,JSON['stringify'](_0x27f0a8));_0xf16787(_0x27f0a8);})[_0x5112('0x16')](function(_0x17c7ef){logger[_0x5112('0x12')](_0x5112('0x17'),_0x17c7ef['message'],_0xec6f8b);_0x36ec54(_0x40dd4a[_0x5112('0x12')](0x1f4,_0x17c7ef[_0x5112('0x14')]));});});}; \ No newline at end of file +var _0x3704=['stringify','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CreateVoiceTransferReport','create','body','options','raw'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x3704,0x88));var _0x4370=function(_0x3e70a0,_0x55bd37){_0x3e70a0=_0x3e70a0-0x0;var _0x1df417=_0x3704[_0x3e70a0];return _0x1df417;};'use strict';var _=require('lodash');var util=require(_0x4370('0x0'));var moment=require(_0x4370('0x1'));var BPromise=require(_0x4370('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4370('0x3'));var logger=require(_0x4370('0x4'))(_0x4370('0x5'));var config=require(_0x4370('0x6'));var jayson=require(_0x4370('0x7'));var client=jayson[_0x4370('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x22a9d9,_0x507909,_0x34348b){return new BPromise(function(_0x47d481,_0x2abfe5){return client[_0x4370('0x9')](_0x22a9d9,_0x34348b)[_0x4370('0xa')](function(_0x3622f5){logger['info'](_0x4370('0xb'),_0x507909,_0x4370('0xc'));logger[_0x4370('0xd')](_0x4370('0xe'),_0x507909,_0x4370('0xc'),JSON['stringify'](_0x3622f5));if(_0x3622f5[_0x4370('0xf')]){if(_0x3622f5[_0x4370('0xf')][_0x4370('0x10')]===0x1f4){logger[_0x4370('0xf')](_0x4370('0xb'),_0x507909,_0x3622f5[_0x4370('0xf')][_0x4370('0x11')]);return _0x2abfe5(_0x3622f5[_0x4370('0xf')][_0x4370('0x11')]);}logger[_0x4370('0xf')](_0x4370('0xb'),_0x507909,_0x3622f5['error'][_0x4370('0x11')]);return _0x47d481(_0x3622f5['error'][_0x4370('0x11')]);}else{logger[_0x4370('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x507909,_0x4370('0xc'));_0x47d481(_0x3622f5[_0x4370('0x13')][_0x4370('0x11')]);}})[_0x4370('0x14')](function(_0x3444b5){logger[_0x4370('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x507909,_0x3444b5);_0x2abfe5(_0x3444b5);});});}exports[_0x4370('0x15')]=function(_0x12dfea){var _0x263c16=this;return new Promise(function(_0x2164aa,_0x337364){return db['VoiceTransferReport'][_0x4370('0x16')](_0x12dfea[_0x4370('0x17')],{'raw':_0x12dfea[_0x4370('0x18')]?_0x12dfea[_0x4370('0x18')][_0x4370('0x19')]===undefined?!![]:![]:!![]})[_0x4370('0xa')](function(_0x130d78){logger[_0x4370('0x12')](_0x4370('0x15'),_0x12dfea);logger[_0x4370('0xd')](_0x4370('0x15'),_0x12dfea,JSON[_0x4370('0x1a')](_0x130d78));_0x2164aa(_0x130d78);})[_0x4370('0x14')](function(_0x4877c9){logger[_0x4370('0xf')](_0x4370('0x15'),_0x4877c9[_0x4370('0x11')],_0x12dfea);_0x337364(_0x263c16[_0x4370('0xf')](0x1f4,_0x4877c9[_0x4370('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index a397f34..99c9f50 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 _0x00bb=['answer','hold','/unhold','unhold','calls','/transfer','exports','express','Router','../../components/auth/service','post','isAuthenticated','isWebrtcLicence','/hangup','/answer'];(function(_0x367c8e,_0x3a6502){var _0x1c2789=function(_0x908461){while(--_0x908461){_0x367c8e['push'](_0x367c8e['shift']());}};_0x1c2789(++_0x3a6502);}(_0x00bb,0x1d8));var _0xb00b=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x00bb[_0x3ff085];return _0x2b68c3;};'use strict';var express=require(_0xb00b('0x0'));var router=express[_0xb00b('0x1')]();var auth=require(_0xb00b('0x2'));var controller=require('./webbar.controller');router[_0xb00b('0x3')]('/originate',auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['originate']);router[_0xb00b('0x3')](_0xb00b('0x6'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller['hangup']);router[_0xb00b('0x3')](_0xb00b('0x7'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x8')]);router[_0xb00b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0x9')]);router[_0xb00b('0x3')](_0xb00b('0xa'),auth[_0xb00b('0x4')](),auth['isWebrtcLicence'](),controller[_0xb00b('0xb')]);router['post']('/calls',auth['isAuthenticated'](),auth[_0xb00b('0x5')](),controller[_0xb00b('0xc')]);router[_0xb00b('0x3')](_0xb00b('0xd'),auth[_0xb00b('0x4')](),auth[_0xb00b('0x5')](),controller['transfer']);module[_0xb00b('0xe')]=router; \ No newline at end of file +var _0xcb91=['/unhold','unhold','/calls','transfer','exports','../../components/auth/service','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','isAuthenticated','hangup','hold'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0xcb91[_0x20aadb];return _0x520018;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x1cb9('0x0'));var controller=require(_0x1cb9('0x1'));router[_0x1cb9('0x2')](_0x1cb9('0x3'),auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x5')]);router['post'](_0x1cb9('0x6'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x2')]('/answer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['answer']);router[_0x1cb9('0x2')]('/hold',auth['isAuthenticated'](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x2')](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),auth['isWebrtcLicence'](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0x2')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller['calls']);router['post']('/transfer',auth[_0x1cb9('0x7')](),auth[_0x1cb9('0x4')](),controller[_0x1cb9('0xd')]);module[_0x1cb9('0xe')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index e3b10d2..bc1f5a2 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 _0x6f7a=['findOne','agent','then','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','originate','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','user:%s','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','sessionId','format','webbar:hangup','hangup\x20executed!','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','unhold\x20executed!','calls\x20fired:','conference','conference\x20fired:','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','info','stringify','emit','log','error','stack','name','status','send','NotFound','code','catch','User'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x331ba9,_0x1586bd){_0x331ba9=_0x331ba9-0x0;var _0x4eee6e=_0x6f7a[_0x331ba9];return _0x4eee6e;};'use strict';var path=require(_0xa6f7('0x0'));var fs=require('fs');var _=require(_0xa6f7('0x1'));var db=require(_0xa6f7('0x2'))['db'];var config=require(_0xa6f7('0x3'));var util=require('util');var BPromise=require(_0xa6f7('0x4'));var jayson=require(_0xa6f7('0x5'));var amiClient=jayson[_0xa6f7('0x6')][_0xa6f7('0x7')]({'port':0x232a});var logger=require(_0xa6f7('0x8'))(_0xa6f7('0x9'));var Redis=require(_0xa6f7('0xa'));config[_0xa6f7('0xb')]=_[_0xa6f7('0xc')](config[_0xa6f7('0xb')],{'host':_0xa6f7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0xa6f7('0xe'));var originateValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'callNumber':{'type':_0xa6f7('0x11'),'required':[!![],_0xa6f7('0x12')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xa6f7('0x11'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':_0xa6f7('0x11'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xa6f7('0x11'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':_0xa6f7('0x11'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa6f7('0x10')]},'sessionId':{'type':'string','required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xa6f7('0xf'),'required':[!![],_0xa6f7('0x10')]}});function emit(_0x6efd38,_0x47e664,_0xdb37e2){logger[_0xa6f7('0x13')](_0x6efd38,_0x47e664,JSON[_0xa6f7('0x14')](_0xdb37e2));io['to'](_0x6efd38)[_0xa6f7('0x15')](_0x47e664,_0xdb37e2);}function handleError(_0x5681d5){return function(_0x4a8827){console[_0xa6f7('0x16')]('handleError:',_0x4a8827,_0x4a8827 instanceof RangeError);logger[_0xa6f7('0x17')](_0x4a8827[_0xa6f7('0x18')]);if(_0x4a8827 instanceof RangeError){if(_0x4a8827['name']){delete _0x4a8827[_0xa6f7('0x19')];}_0x5681d5[_0xa6f7('0x1a')](0x194)[_0xa6f7('0x1b')](_0x4a8827);}else{if(_0x4a8827[_0xa6f7('0x19')]){delete _0x4a8827[_0xa6f7('0x19')];}_0x5681d5[_0xa6f7('0x1a')](0x1f4)['send'](_0x4a8827);}};}function checkError(){return function(_0x3c0c55){if(!_0x3c0c55){throw new RangeError(_0xa6f7('0x1c'));}return _0x3c0c55;};}function respondWithRpcPromise(_0x58b6a1,_0x5d1159){return new BPromise(function(_0x5ddc8d,_0x1de6c9){var _0x119950=amiClient;return _0x119950['request'](_0x58b6a1,_0x5d1159)['then'](function(_0x50e2be){if(_0x50e2be[_0xa6f7('0x17')]){if(_0x50e2be[_0xa6f7('0x17')][_0xa6f7('0x1d')]===0x1f4){return _0x1de6c9(_0x50e2be['error']['message']);}return _0x5ddc8d(_0x50e2be[_0xa6f7('0x17')]['message']);}else{_0x5ddc8d(_0x50e2be['result']);}})[_0xa6f7('0x1e')](function(_0x5efdce){_0x1de6c9(_0x5efdce);});});}function getAgent(_0x35847e){return db[_0xa6f7('0x1f')][_0xa6f7('0x20')]({'where':{'id':_0x35847e,'role':_0xa6f7('0x21')}})[_0xa6f7('0x22')](checkError());}function getAgentCheckSession(_0x4b8d2b,_0x51db47){return new BPromise(function(_0x1c419b,_0x2ad0d9){var _0x55d45a=respondWithRpcPromise(_0xa6f7('0x23'));var _0x27babb=getAgent(_0x4b8d2b);Promise[_0xa6f7('0x24')]([_0x55d45a,_0x27babb])[_0xa6f7('0x22')](function(_0x224f5a){var _0x10bf77=_0x224f5a[0x0];var _0x353de8=_0x224f5a[0x1];var _0x54f72c=_[_0xa6f7('0x25')](_0x10bf77[_0xa6f7('0x26')],function(_0x40b0f8){return _0x40b0f8[_0xa6f7('0x27')]==_0x353de8['id']&&_0x40b0f8['sessionId']==_0x51db47;});if(_0x54f72c[_0xa6f7('0x28')]==0x1){_0x1c419b(_0x353de8);}else{_0x2ad0d9(new RangeError(_0xa6f7('0x29')+_0x51db47+'\x20not\x20found!'));}});});}exports[_0xa6f7('0x2a')]=function(_0x34d571,_0x4d79d8){logger['info'](_0xa6f7('0x2b'),_0x34d571[_0xa6f7('0x2c')]);var _0x2b33d=originateValidation[_0xa6f7('0xe')](_0x34d571[_0xa6f7('0x2c')]);if(_0x2b33d['length']>0x0){return _0x4d79d8['status'](0x190)[_0xa6f7('0x2d')](_0x2b33d);}var _0x4c2acd=_0x34d571[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0xfa0fb6=_0x34d571[_0xa6f7('0x2c')][_0xa6f7('0x2f')];var _0xbdfc5a=_0x34d571['body'][_0xa6f7('0x30')];var _0xb1a7f8=_0x34d571[_0xa6f7('0x2c')]['callbackUrl'];return getAgent(_0x4c2acd)[_0xa6f7('0x22')](function(_0x5ab03d){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x5ab03d[_0xa6f7('0x19')]);emit(util['format'](_0xa6f7('0x32'),_0x5ab03d[_0xa6f7('0x19')]),_0xa6f7('0x33'),{'callNumber':_0xfa0fb6,'callerId':_0xbdfc5a,'callbackUrl':_0xb1a7f8});return _0x4d79d8[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x34')});})['catch'](handleError(_0x4d79d8));};exports[_0xa6f7('0x35')]=function(_0xd930e8,_0xc25a1b){logger[_0xa6f7('0x13')](_0xa6f7('0x36'),_0xd930e8[_0xa6f7('0x2c')]);var _0x45acdd=hangupValidation[_0xa6f7('0xe')](_0xd930e8['body']);if(_0x45acdd[_0xa6f7('0x28')]>0x0){return _0xc25a1b[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x45acdd);}var _0x518088=_0xd930e8[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x589d94=_0xd930e8[_0xa6f7('0x2c')][_0xa6f7('0x37')];return getAgent(_0x518088)[_0xa6f7('0x22')](function(_0x14d532){logger[_0xa6f7('0x13')]('entityFound:',_0x14d532[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x14d532[_0xa6f7('0x19')]),_0xa6f7('0x39'),{'sessionId':_0x589d94});return _0xc25a1b[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x3a')});})['catch'](handleError(_0xc25a1b));};exports['answer']=function(_0x12f7b5,_0x3e1535){logger[_0xa6f7('0x13')](_0xa6f7('0x3b'),_0x12f7b5[_0xa6f7('0x2c')]);var _0x387714=answerValidation[_0xa6f7('0xe')](_0x12f7b5[_0xa6f7('0x2c')]);if(_0x387714[_0xa6f7('0x28')]>0x0){return _0x3e1535[_0xa6f7('0x1a')](0x190)['json'](_0x387714);}var _0x41917c=_0x12f7b5[_0xa6f7('0x2c')]['userId'];var _0x22d500=_0x12f7b5[_0xa6f7('0x2c')][_0xa6f7('0x37')];return getAgent(_0x41917c)[_0xa6f7('0x22')](function(_0x51de13){logger[_0xa6f7('0x13')]('entityFound:',_0x51de13['name']);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x51de13[_0xa6f7('0x19')]),_0xa6f7('0x3c'),{'sessionId':_0x22d500});return _0x3e1535[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x3d')});})['catch'](handleError(_0x3e1535));};exports[_0xa6f7('0x3e')]=function(_0x40dbe6,_0x55cb70){logger[_0xa6f7('0x13')](_0xa6f7('0x3f'),_0x40dbe6[_0xa6f7('0x2c')]);var _0x5cc89c=holdValidation[_0xa6f7('0xe')](_0x40dbe6['body']);if(_0x5cc89c[_0xa6f7('0x28')]>0x0){return _0x55cb70[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x5cc89c);}var _0x5f3c84=_0x40dbe6['body'][_0xa6f7('0x2e')];var _0x5928e4=_0x40dbe6[_0xa6f7('0x2c')]['sessionId'];return getAgent(_0x5f3c84)['then'](function(_0x1e7089){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x1e7089[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x1e7089['name']),_0xa6f7('0x40'),{'sessionId':_0x5928e4});return _0x55cb70[_0xa6f7('0x1a')](0xc8)['json']({'error':![],'message':_0xa6f7('0x41')});})['catch'](handleError(_0x55cb70));};exports[_0xa6f7('0x42')]=function(_0x59091a,_0x488efc){logger[_0xa6f7('0x13')](_0xa6f7('0x43'),_0x59091a[_0xa6f7('0x2c')]);var _0x2b3de2=unholdValidation[_0xa6f7('0xe')](_0x59091a['body']);if(_0x2b3de2[_0xa6f7('0x28')]>0x0){return _0x488efc[_0xa6f7('0x1a')](0x190)['json'](_0x2b3de2);}var _0x4b83f6=_0x59091a['body'][_0xa6f7('0x2e')];var _0x1c2099=_0x59091a[_0xa6f7('0x2c')]['sessionId'];return getAgent(_0x4b83f6)[_0xa6f7('0x22')](function(_0x5dab05){logger[_0xa6f7('0x13')](_0xa6f7('0x31'),_0x5dab05[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x5dab05['name']),'webbar:unhold',{'sessionId':_0x1c2099});return _0x488efc[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':_0xa6f7('0x44')});})[_0xa6f7('0x1e')](handleError(_0x488efc));};exports['calls']=function(_0x9d901e,_0x2105dd){logger[_0xa6f7('0x13')](_0xa6f7('0x45'),_0x2105dd[_0xa6f7('0x2c')]);var _0x39538e=callsValidation['validate'](_0x9d901e[_0xa6f7('0x2c')]);if(_0x39538e[_0xa6f7('0x28')]>0x0){return _0x2105dd[_0xa6f7('0x1a')](0x190)['json'](_0x39538e);}var _0xb049d7=_0x9d901e[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x4496f1=respondWithRpcPromise('VoiceChannels');var _0x4ec005=getAgent(_0xb049d7);return Promise[_0xa6f7('0x24')]([_0x4496f1,_0x4ec005])[_0xa6f7('0x22')](function(_0x1103c6){var _0x52e647=_0x1103c6[0x0];var _0x301327=_0x1103c6[0x1];var _0x269249=_[_0xa6f7('0x25')](_0x52e647['rows'],function(_0x169bbe){return _0x169bbe[_0xa6f7('0x27')]==_0x301327['id'];});return _0x2105dd[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'count':_0x269249[_0xa6f7('0x28')],'rows':_0x269249});})[_0xa6f7('0x1e')](handleError(_0x2105dd));};exports[_0xa6f7('0x46')]=function(_0x3bc870,_0x444177){logger[_0xa6f7('0x13')](_0xa6f7('0x47'),_0x3bc870['body']);var _0x224e33=conferenceValidation['validate'](_0x3bc870[_0xa6f7('0x2c')]);if(_0x224e33['length']>0x0){return _0x444177[_0xa6f7('0x1a')](0x190)[_0xa6f7('0x2d')](_0x224e33);}var _0x5a158f=_0x3bc870[_0xa6f7('0x2c')][_0xa6f7('0x2e')];return getAgent(_0x5a158f)[_0xa6f7('0x22')](function(_0x501503){logger[_0xa6f7('0x13')]('entityFound:',_0x501503[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')]('user:%s',_0x501503[_0xa6f7('0x19')]),'webbar:conference');return _0x444177[_0xa6f7('0x1a')](0xc8)['json']({'error':![],'message':_0xa6f7('0x48')});})[_0xa6f7('0x1e')](handleError(_0x444177));};exports[_0xa6f7('0x49')]=function(_0xca47c2,_0x315939){logger[_0xa6f7('0x13')](_0xa6f7('0x4a'),_0xca47c2[_0xa6f7('0x2c')]);var _0x153635=transferValidation[_0xa6f7('0xe')](_0xca47c2[_0xa6f7('0x2c')]);if(_0x153635[_0xa6f7('0x28')]>0x0){return _0x315939['status'](0x190)[_0xa6f7('0x2d')](_0x153635);}var _0x3c0c6e=_0xca47c2[_0xa6f7('0x2c')][_0xa6f7('0x2e')];var _0x154c78=_0xca47c2[_0xa6f7('0x2c')][_0xa6f7('0x37')];var _0x3a5700=_0xca47c2['body'][_0xa6f7('0x4b')];return getAgent(_0x3c0c6e)[_0xa6f7('0x22')](function(_0x9c102f){logger['info'](_0xa6f7('0x31'),_0x9c102f[_0xa6f7('0x19')]);emit(util[_0xa6f7('0x38')](_0xa6f7('0x32'),_0x9c102f[_0xa6f7('0x19')]),_0xa6f7('0x4c'),{'sessionId':_0x154c78,'transferNumber':_0x3a5700});return _0x315939[_0xa6f7('0x1a')](0xc8)[_0xa6f7('0x2d')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0x315939));}; \ No newline at end of file +var _0x0eaa=['transfer\x20fired:','webbar:transfer','transfer\x20executed!','path','lodash','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','defaults','socket.io-emitter','redis','userId\x20is\x20required','string','callNumber\x20is\x20required','number','sessionId\x20is\x20required','info','stringify','emit','error','stack','name','status','send','request','code','message','catch','User','findOne','agent','then','all','filter','sessionId','length','sessionId\x20','originate','originate\x20fired:','body','userId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','validate','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','rows','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer'];(function(_0x5e62b0,_0x289456){var _0x3ffbc6=function(_0x56ff51){while(--_0x56ff51){_0x5e62b0['push'](_0x5e62b0['shift']());}};_0x3ffbc6(++_0x289456);}(_0x0eaa,0x1c5));var _0xa0ea=function(_0x203338,_0x251a5f){_0x203338=_0x203338-0x0;var _0x11adad=_0x0eaa[_0x203338];return _0x11adad;};'use strict';var path=require(_0xa0ea('0x0'));var fs=require('fs');var _=require(_0xa0ea('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var util=require(_0xa0ea('0x2'));var BPromise=require(_0xa0ea('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0xa0ea('0x4')][_0xa0ea('0x5')]({'port':0x232a});var logger=require(_0xa0ea('0x6'))(_0xa0ea('0x7'));var Redis=require(_0xa0ea('0x8'));config['redis']=_[_0xa0ea('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xa0ea('0xa'))(new Redis(config[_0xa0ea('0xb')]));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa0ea('0xc')]},'callNumber':{'type':_0xa0ea('0xd'),'required':[!![],_0xa0ea('0xe')]},'callerId':{'type':_0xa0ea('0xd')},'callbackUrl':{'type':_0xa0ea('0xd')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0xa0ea('0xc')]},'sessionId':{'type':_0xa0ea('0xd'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xa0ea('0xf'),'required':[!![],_0xa0ea('0xc')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0xa0ea('0xf'),'required':[!![],_0xa0ea('0xc')]},'sessionId':{'type':_0xa0ea('0xd'),'required':[!![],_0xa0ea('0x10')]},'transferNumber':{'type':_0xa0ea('0xd'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xa0ea('0xf'),'required':[!![],_0xa0ea('0xc')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xa0ea('0xf'),'required':[!![],_0xa0ea('0xc')]},'sessionId':{'type':_0xa0ea('0xd'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xa0ea('0xf'),'required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0xa0ea('0xf'),'required':[!![],_0xa0ea('0xc')]}});function emit(_0x4274c2,_0x130156,_0x10d8f9){logger[_0xa0ea('0x11')](_0x4274c2,_0x130156,JSON[_0xa0ea('0x12')](_0x10d8f9));io['to'](_0x4274c2)[_0xa0ea('0x13')](_0x130156,_0x10d8f9);}function handleError(_0x345fb6){return function(_0x405f7f){console['log']('handleError:',_0x405f7f,_0x405f7f instanceof RangeError);logger[_0xa0ea('0x14')](_0x405f7f[_0xa0ea('0x15')]);if(_0x405f7f instanceof RangeError){if(_0x405f7f[_0xa0ea('0x16')]){delete _0x405f7f[_0xa0ea('0x16')];}_0x345fb6[_0xa0ea('0x17')](0x194)[_0xa0ea('0x18')](_0x405f7f);}else{if(_0x405f7f[_0xa0ea('0x16')]){delete _0x405f7f['name'];}_0x345fb6[_0xa0ea('0x17')](0x1f4)[_0xa0ea('0x18')](_0x405f7f);}};}function checkError(){return function(_0x94806e){if(!_0x94806e){throw new RangeError('NotFound');}return _0x94806e;};}function respondWithRpcPromise(_0x103e4f,_0x345d27){return new BPromise(function(_0x45fda4,_0x12cda2){var _0x2b5af5=amiClient;return _0x2b5af5[_0xa0ea('0x19')](_0x103e4f,_0x345d27)['then'](function(_0x35faa4){if(_0x35faa4['error']){if(_0x35faa4['error'][_0xa0ea('0x1a')]===0x1f4){return _0x12cda2(_0x35faa4[_0xa0ea('0x14')][_0xa0ea('0x1b')]);}return _0x45fda4(_0x35faa4['error'][_0xa0ea('0x1b')]);}else{_0x45fda4(_0x35faa4['result']);}})[_0xa0ea('0x1c')](function(_0x51cfbd){_0x12cda2(_0x51cfbd);});});}function getAgent(_0xcf155b){return db[_0xa0ea('0x1d')][_0xa0ea('0x1e')]({'where':{'id':_0xcf155b,'role':_0xa0ea('0x1f')}})[_0xa0ea('0x20')](checkError());}function getAgentCheckSession(_0x287728,_0x380e09){return new BPromise(function(_0x208c8,_0x4b6541){var _0x15534e=respondWithRpcPromise('VoiceChannels');var _0x21640c=getAgent(_0x287728);Promise[_0xa0ea('0x21')]([_0x15534e,_0x21640c])[_0xa0ea('0x20')](function(_0x705022){var _0x389050=_0x705022[0x0];var _0x129130=_0x705022[0x1];var _0x4e9748=_[_0xa0ea('0x22')](_0x389050['rows'],function(_0x210ce3){return _0x210ce3['UserId']==_0x129130['id']&&_0x210ce3[_0xa0ea('0x23')]==_0x380e09;});if(_0x4e9748[_0xa0ea('0x24')]==0x1){_0x208c8(_0x129130);}else{_0x4b6541(new RangeError(_0xa0ea('0x25')+_0x380e09+'\x20not\x20found!'));}});});}exports[_0xa0ea('0x26')]=function(_0x37a5b3,_0x502df5){logger[_0xa0ea('0x11')](_0xa0ea('0x27'),_0x37a5b3[_0xa0ea('0x28')]);var _0x4e8975=originateValidation['validate'](_0x37a5b3[_0xa0ea('0x28')]);if(_0x4e8975[_0xa0ea('0x24')]>0x0){return _0x502df5[_0xa0ea('0x17')](0x190)['json'](_0x4e8975);}var _0x610345=_0x37a5b3[_0xa0ea('0x28')][_0xa0ea('0x29')];var _0x41be34=_0x37a5b3[_0xa0ea('0x28')]['callNumber'];var _0x49a7fa=_0x37a5b3[_0xa0ea('0x28')]['callerId'];var _0x272dca=_0x37a5b3[_0xa0ea('0x28')][_0xa0ea('0x2a')];return getAgent(_0x610345)[_0xa0ea('0x20')](function(_0x628464){logger['info'](_0xa0ea('0x2b'),_0x628464[_0xa0ea('0x16')]);emit(util[_0xa0ea('0x2c')](_0xa0ea('0x2d'),_0x628464[_0xa0ea('0x16')]),_0xa0ea('0x2e'),{'callNumber':_0x41be34,'callerId':_0x49a7fa,'callbackUrl':_0x272dca});return _0x502df5[_0xa0ea('0x17')](0xc8)[_0xa0ea('0x2f')]({'error':![],'message':_0xa0ea('0x30')});})[_0xa0ea('0x1c')](handleError(_0x502df5));};exports['hangup']=function(_0x412364,_0x479008){logger[_0xa0ea('0x11')]('hangup\x20fired:',_0x412364[_0xa0ea('0x28')]);var _0x5b8159=hangupValidation[_0xa0ea('0x31')](_0x412364[_0xa0ea('0x28')]);if(_0x5b8159[_0xa0ea('0x24')]>0x0){return _0x479008[_0xa0ea('0x17')](0x190)['json'](_0x5b8159);}var _0x26f8aa=_0x412364[_0xa0ea('0x28')][_0xa0ea('0x29')];var _0x139496=_0x412364[_0xa0ea('0x28')][_0xa0ea('0x23')];return getAgent(_0x26f8aa)[_0xa0ea('0x20')](function(_0x24ac13){logger[_0xa0ea('0x11')]('entityFound:',_0x24ac13[_0xa0ea('0x16')]);emit(util['format'](_0xa0ea('0x2d'),_0x24ac13[_0xa0ea('0x16')]),_0xa0ea('0x32'),{'sessionId':_0x139496});return _0x479008[_0xa0ea('0x17')](0xc8)[_0xa0ea('0x2f')]({'error':![],'message':_0xa0ea('0x33')});})[_0xa0ea('0x1c')](handleError(_0x479008));};exports[_0xa0ea('0x34')]=function(_0x15d3ab,_0x21a2d5){logger[_0xa0ea('0x11')](_0xa0ea('0x35'),_0x15d3ab[_0xa0ea('0x28')]);var _0x37e38b=answerValidation[_0xa0ea('0x31')](_0x15d3ab['body']);if(_0x37e38b[_0xa0ea('0x24')]>0x0){return _0x21a2d5['status'](0x190)[_0xa0ea('0x2f')](_0x37e38b);}var _0x59e305=_0x15d3ab['body']['userId'];var _0x53606e=_0x15d3ab[_0xa0ea('0x28')][_0xa0ea('0x23')];return getAgent(_0x59e305)['then'](function(_0x3e17be){logger[_0xa0ea('0x11')](_0xa0ea('0x2b'),_0x3e17be['name']);emit(util['format']('user:%s',_0x3e17be[_0xa0ea('0x16')]),_0xa0ea('0x36'),{'sessionId':_0x53606e});return _0x21a2d5[_0xa0ea('0x17')](0xc8)[_0xa0ea('0x2f')]({'error':![],'message':_0xa0ea('0x37')});})[_0xa0ea('0x1c')](handleError(_0x21a2d5));};exports[_0xa0ea('0x38')]=function(_0xf7d20f,_0x541463){logger[_0xa0ea('0x11')](_0xa0ea('0x39'),_0xf7d20f[_0xa0ea('0x28')]);var _0x54161d=holdValidation[_0xa0ea('0x31')](_0xf7d20f[_0xa0ea('0x28')]);if(_0x54161d[_0xa0ea('0x24')]>0x0){return _0x541463[_0xa0ea('0x17')](0x190)['json'](_0x54161d);}var _0x482601=_0xf7d20f[_0xa0ea('0x28')][_0xa0ea('0x29')];var _0x1b841a=_0xf7d20f[_0xa0ea('0x28')][_0xa0ea('0x23')];return getAgent(_0x482601)[_0xa0ea('0x20')](function(_0x219540){logger[_0xa0ea('0x11')](_0xa0ea('0x2b'),_0x219540[_0xa0ea('0x16')]);emit(util['format'](_0xa0ea('0x2d'),_0x219540[_0xa0ea('0x16')]),_0xa0ea('0x3a'),{'sessionId':_0x1b841a});return _0x541463[_0xa0ea('0x17')](0xc8)[_0xa0ea('0x2f')]({'error':![],'message':_0xa0ea('0x3b')});})[_0xa0ea('0x1c')](handleError(_0x541463));};exports['unhold']=function(_0x140155,_0x176f68){logger['info'](_0xa0ea('0x3c'),_0x140155['body']);var _0x3feeb0=unholdValidation[_0xa0ea('0x31')](_0x140155[_0xa0ea('0x28')]);if(_0x3feeb0[_0xa0ea('0x24')]>0x0){return _0x176f68[_0xa0ea('0x17')](0x190)['json'](_0x3feeb0);}var _0x3b5861=_0x140155['body'][_0xa0ea('0x29')];var _0x4afa03=_0x140155[_0xa0ea('0x28')][_0xa0ea('0x23')];return getAgent(_0x3b5861)['then'](function(_0x2fbc9b){logger[_0xa0ea('0x11')](_0xa0ea('0x2b'),_0x2fbc9b['name']);emit(util[_0xa0ea('0x2c')]('user:%s',_0x2fbc9b[_0xa0ea('0x16')]),_0xa0ea('0x3d'),{'sessionId':_0x4afa03});return _0x176f68[_0xa0ea('0x17')](0xc8)[_0xa0ea('0x2f')]({'error':![],'message':_0xa0ea('0x3e')});})['catch'](handleError(_0x176f68));};exports[_0xa0ea('0x3f')]=function(_0x4ea7d1,_0x493676){logger[_0xa0ea('0x11')](_0xa0ea('0x40'),_0x493676[_0xa0ea('0x28')]);var _0x4c8aa7=callsValidation[_0xa0ea('0x31')](_0x4ea7d1[_0xa0ea('0x28')]);if(_0x4c8aa7[_0xa0ea('0x24')]>0x0){return _0x493676[_0xa0ea('0x17')](0x190)[_0xa0ea('0x2f')](_0x4c8aa7);}var _0xf4bf41=_0x4ea7d1[_0xa0ea('0x28')][_0xa0ea('0x29')];var _0x4e5a3f=respondWithRpcPromise(_0xa0ea('0x41'));var _0x3c79d0=getAgent(_0xf4bf41);return Promise[_0xa0ea('0x21')]([_0x4e5a3f,_0x3c79d0])['then'](function(_0x1ae398){var _0x545ad7=_0x1ae398[0x0];var _0x16026b=_0x1ae398[0x1];var _0x406586=_[_0xa0ea('0x22')](_0x545ad7[_0xa0ea('0x42')],function(_0x293de2){return _0x293de2['UserId']==_0x16026b['id'];});return _0x493676[_0xa0ea('0x17')](0xc8)[_0xa0ea('0x2f')]({'count':_0x406586[_0xa0ea('0x24')],'rows':_0x406586});})[_0xa0ea('0x1c')](handleError(_0x493676));};exports[_0xa0ea('0x43')]=function(_0x422b93,_0x4d2ec3){logger[_0xa0ea('0x11')](_0xa0ea('0x44'),_0x422b93[_0xa0ea('0x28')]);var _0x4abb20=conferenceValidation[_0xa0ea('0x31')](_0x422b93[_0xa0ea('0x28')]);if(_0x4abb20[_0xa0ea('0x24')]>0x0){return _0x4d2ec3[_0xa0ea('0x17')](0x190)[_0xa0ea('0x2f')](_0x4abb20);}var _0x2f94a5=_0x422b93[_0xa0ea('0x28')][_0xa0ea('0x29')];return getAgent(_0x2f94a5)['then'](function(_0x4cb062){logger['info'](_0xa0ea('0x2b'),_0x4cb062['name']);emit(util[_0xa0ea('0x2c')](_0xa0ea('0x2d'),_0x4cb062[_0xa0ea('0x16')]),_0xa0ea('0x45'));return _0x4d2ec3[_0xa0ea('0x17')](0xc8)['json']({'error':![],'message':_0xa0ea('0x46')});})[_0xa0ea('0x1c')](handleError(_0x4d2ec3));};exports[_0xa0ea('0x47')]=function(_0x1f792a,_0x532a29){logger[_0xa0ea('0x11')](_0xa0ea('0x48'),_0x1f792a['body']);var _0x145630=transferValidation['validate'](_0x1f792a['body']);if(_0x145630[_0xa0ea('0x24')]>0x0){return _0x532a29['status'](0x190)[_0xa0ea('0x2f')](_0x145630);}var _0x6f5039=_0x1f792a['body'][_0xa0ea('0x29')];var _0x1d57e8=_0x1f792a[_0xa0ea('0x28')][_0xa0ea('0x23')];var _0x4ca3fd=_0x1f792a[_0xa0ea('0x28')]['transferNumber'];return getAgent(_0x6f5039)[_0xa0ea('0x20')](function(_0x4052ed){logger[_0xa0ea('0x11')](_0xa0ea('0x2b'),_0x4052ed[_0xa0ea('0x16')]);emit(util[_0xa0ea('0x2c')]('user:%s',_0x4052ed['name']),_0xa0ea('0x49'),{'sessionId':_0x1d57e8,'transferNumber':_0x4ca3fd});return _0x532a29['status'](0xc8)[_0xa0ea('0x2f')]({'error':![],'message':_0xa0ea('0x4a')});})[_0xa0ea('0x1c')](handleError(_0x532a29));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index a8318f6..8f63029 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 _0x55f7=['/:id/send','send','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','/:id/users','/:id/applications','post','addDisposition','addAnswer','addApplications','/:id/notify','notify'];(function(_0x342700,_0x569f75){var _0x53406f=function(_0x3b3c32){while(--_0x3b3c32){_0x342700['push'](_0x342700['shift']());}};_0x53406f(++_0x569f75);}(_0x55f7,0x1e9));var _0x755f=function(_0x418305,_0xcf9d75){_0x418305=_0x418305-0x0;var _0x39a433=_0x55f7[_0x418305];return _0x39a433;};'use strict';var multer=require(_0x755f('0x0'));var util=require(_0x755f('0x1'));var path=require('path');var timeout=require(_0x755f('0x2'));var express=require(_0x755f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x755f('0x4'));var interaction=require(_0x755f('0x5'));var config=require(_0x755f('0x6'));var controller=require('./whatsappAccount.controller');router[_0x755f('0x7')]('/',auth[_0x755f('0x8')](),controller['index']);router['get'](_0x755f('0x9'),auth[_0x755f('0x8')](),controller[_0x755f('0xa')]);router['get'](_0x755f('0xb'),auth[_0x755f('0x8')](),controller[_0x755f('0xc')]);router[_0x755f('0x7')](_0x755f('0xd'),auth[_0x755f('0x8')](),controller['getDispositions']);router[_0x755f('0x7')](_0x755f('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x755f('0x7')](_0x755f('0xf'),auth[_0x755f('0x8')](),controller['getAgents']);router[_0x755f('0x7')](_0x755f('0x10'),auth[_0x755f('0x8')](),controller['getApplications']);router[_0x755f('0x11')]('/',auth[_0x755f('0x8')](),controller['create']);router[_0x755f('0x11')]('/:id/dispositions',auth[_0x755f('0x8')](),controller[_0x755f('0x12')]);router[_0x755f('0x11')](_0x755f('0xe'),auth[_0x755f('0x8')](),controller[_0x755f('0x13')]);router[_0x755f('0x11')](_0x755f('0xf'),auth[_0x755f('0x8')](),controller['addAgents']);router[_0x755f('0x11')]('/:id/applications',auth['isAuthenticated'](),controller[_0x755f('0x14')]);router[_0x755f('0x11')](_0x755f('0x15'),controller[_0x755f('0x16')]);router[_0x755f('0x11')](_0x755f('0x17'),auth[_0x755f('0x8')](),controller[_0x755f('0x18')]);router['put'](_0x755f('0xb'),auth[_0x755f('0x8')](),controller[_0x755f('0x19')]);router['delete']('/:id',auth[_0x755f('0x8')](),controller[_0x755f('0x1a')]);router[_0x755f('0x1b')](_0x755f('0xd'),auth['isAuthenticated'](),controller[_0x755f('0x1c')]);router[_0x755f('0x1b')](_0x755f('0xe'),auth[_0x755f('0x8')](),controller[_0x755f('0x1d')]);router[_0x755f('0x1b')](_0x755f('0xf'),auth['isAuthenticated'](),controller[_0x755f('0x1e')]);module[_0x755f('0x1f')]=router; \ No newline at end of file +var _0xea39=['exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappAccount.controller','index','get','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents','/:id/applications','getApplications','post','create','addAnswer','/:id/users','addAgents','addApplications','/:id/notify','notify','/:id/send','send','put','update','delete','/:id','destroy','removeDispositions','removeAgents'];(function(_0x3bfc6b,_0x504f37){var _0x1d4018=function(_0x4a8746){while(--_0x4a8746){_0x3bfc6b['push'](_0x3bfc6b['shift']());}};_0x1d4018(++_0x504f37);}(_0xea39,0x9d));var _0x9ea3=function(_0x398348,_0x219eac){_0x398348=_0x398348-0x0;var _0x514e5a=_0xea39[_0x398348];return _0x514e5a;};'use strict';var multer=require(_0x9ea3('0x0'));var util=require(_0x9ea3('0x1'));var path=require('path');var timeout=require(_0x9ea3('0x2'));var express=require('express');var router=express[_0x9ea3('0x3')]();var fs_extra=require(_0x9ea3('0x4'));var auth=require(_0x9ea3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ea3('0x6'));var controller=require(_0x9ea3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9ea3('0x8')]);router[_0x9ea3('0x9')](_0x9ea3('0xa'),auth[_0x9ea3('0xb')](),controller[_0x9ea3('0xc')]);router['get']('/:id',auth[_0x9ea3('0xb')](),controller[_0x9ea3('0xd')]);router[_0x9ea3('0x9')](_0x9ea3('0xe'),auth[_0x9ea3('0xb')](),controller[_0x9ea3('0xf')]);router[_0x9ea3('0x9')](_0x9ea3('0x10'),auth['isAuthenticated'](),controller[_0x9ea3('0x11')]);router[_0x9ea3('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0x9ea3('0x12')]);router[_0x9ea3('0x9')](_0x9ea3('0x13'),auth[_0x9ea3('0xb')](),controller[_0x9ea3('0x14')]);router[_0x9ea3('0x15')]('/',auth[_0x9ea3('0xb')](),controller[_0x9ea3('0x16')]);router['post'](_0x9ea3('0xe'),auth[_0x9ea3('0xb')](),controller['addDisposition']);router['post'](_0x9ea3('0x10'),auth[_0x9ea3('0xb')](),controller[_0x9ea3('0x17')]);router[_0x9ea3('0x15')](_0x9ea3('0x18'),auth['isAuthenticated'](),controller[_0x9ea3('0x19')]);router[_0x9ea3('0x15')](_0x9ea3('0x13'),auth['isAuthenticated'](),controller[_0x9ea3('0x1a')]);router[_0x9ea3('0x15')](_0x9ea3('0x1b'),controller[_0x9ea3('0x1c')]);router[_0x9ea3('0x15')](_0x9ea3('0x1d'),auth['isAuthenticated'](),controller[_0x9ea3('0x1e')]);router[_0x9ea3('0x1f')]('/:id',auth[_0x9ea3('0xb')](),controller[_0x9ea3('0x20')]);router[_0x9ea3('0x21')](_0x9ea3('0x22'),auth['isAuthenticated'](),controller[_0x9ea3('0x23')]);router[_0x9ea3('0x21')](_0x9ea3('0xe'),auth[_0x9ea3('0xb')](),controller[_0x9ea3('0x24')]);router[_0x9ea3('0x21')]('/:id/canned_answers',auth[_0x9ea3('0xb')](),controller['removeAnswers']);router[_0x9ea3('0x21')](_0x9ea3('0x18'),auth[_0x9ea3('0xb')](),controller[_0x9ea3('0x25')]);module[_0x9ea3('0x26')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index e6d098b..bebdbe5 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 _0xdf42=['INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x5740bd,_0x38ba1a){var _0x1339bd=function(_0x39e810){while(--_0x39e810){_0x5740bd['push'](_0x5740bd['shift']());}};_0x1339bd(++_0x38ba1a);}(_0xdf42,0x158));var _0x2df4=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdf42[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x2df4('0x0'));var rs=require('randomstring');module[_0x2df4('0x1')]={'name':{'type':Sequelize[_0x2df4('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x2df4('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x2df4('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x2df4('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM']('twilio','sinch')},'accountSid':{'type':Sequelize[_0x2df4('0x2')]},'baseUrl':{'type':Sequelize[_0x2df4('0x2')]},'authToken':{'type':Sequelize[_0x2df4('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2df4('0x3')],'defaultValue':function(){return _0x2df4('0x4');}},'notificationSound':{'type':Sequelize[_0x2df4('0x5')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x2df4('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2df4('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2df4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2df4('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2df4('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2df4('0x6')],'comment':_0x2df4('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b7d09){if(!_0x2b7d09){this['setDataValue'](_0x2df4('0x8'),null);}this['setDataValue'](_0x2df4('0x9'),_0x2b7d09);}},'description':{'type':Sequelize[_0x2df4('0x2')]}}; \ No newline at end of file +var _0x15c5=['BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','name','STRING','ENUM','TEXT'];(function(_0x161aed,_0x572367){var _0x313caf=function(_0x3f5538){while(--_0x3f5538){_0x161aed['push'](_0x161aed['shift']());}};_0x313caf(++_0x572367);}(_0x15c5,0x192));var _0x515c=function(_0x154cb5,_0x1a8d5a){_0x154cb5=_0x154cb5-0x0;var _0x3f574f=_0x15c5[_0x154cb5];return _0x3f574f;};'use strict';var Sequelize=require(_0x515c('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x515c('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0x515c('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x515c('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x515c('0x3')]('twilio','sinch')},'accountSid':{'type':Sequelize['STRING']},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x515c('0x2')]},'notificationTemplate':{'type':Sequelize[_0x515c('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x515c('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x515c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x515c('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x515c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x515c('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x515c('0x6')],'comment':_0x515c('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x515c('0x5')],'defaultValue':![],'comment':_0x515c('0x8'),'set':function(_0x1173f7){if(!_0x1173f7){this[_0x515c('0x9')](_0x515c('0xa'),null);}this[_0x515c('0x9')]('mandatoryDisposition',_0x1173f7);}},'description':{'type':Sequelize[_0x515c('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 59a84ce..e9baebb 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 _0x9173=['rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','reject','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','Pause','map','WhatsappAccount','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','count','includeAll','include','findAll','rows','show','mandatoryDispositionPause','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addAgents','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','priority','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','applications','orderBy','asc','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','createdAt','ListId','mobile','twilio','from','From','replace','whatsapp:','messageId','notifications','message_id','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','Contacts','DESC','list','omit','defaults','contact','WhatsappInteraction','interaction','push','close','unmanaged','*,*,*,*','created','AttachmentId','UserId','User','unshift','agent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format'];(function(_0xcbc9bf,_0x329ecc){var _0x26a5da=function(_0x205ef3){while(--_0x205ef3){_0xcbc9bf['push'](_0xcbc9bf['shift']());}};_0x26a5da(++_0x329ecc);}(_0x9173,0xc2));var _0x3917=function(_0x5a749f,_0x5b0eb1){_0x5a749f=_0x5a749f-0x0;var _0x3651c1=_0x9173[_0x5a749f];return _0x3651c1;};'use strict';var emlformat=require(_0x3917('0x0'));var rimraf=require(_0x3917('0x1'));var zipdir=require(_0x3917('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3917('0x3'));var moment=require(_0x3917('0x4'));var BPromise=require(_0x3917('0x5'));var Mustache=require(_0x3917('0x6'));var util=require(_0x3917('0x7'));var path=require('path');var sox=require(_0x3917('0x8'));var csv=require(_0x3917('0x9'));var ejs=require(_0x3917('0xa'));var fs=require('fs');var fs_extra=require(_0x3917('0xb'));var _=require(_0x3917('0xc'));var squel=require(_0x3917('0xd'));var crypto=require('crypto');var jsforce=require(_0x3917('0xe'));var deskjs=require(_0x3917('0xf'));var toCsv=require(_0x3917('0x9'));var querystring=require(_0x3917('0x10'));var Papa=require(_0x3917('0x11'));var Redis=require(_0x3917('0x12'));var authService=require(_0x3917('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3917('0x14'));var logger=require(_0x3917('0x15'))(_0x3917('0x16'));var utils=require('../../config/utils');var config=require(_0x3917('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x3917('0x18'))['db'];config[_0x3917('0x19')]=_['defaults'](config[_0x3917('0x19')],{'host':_0x3917('0x1a'),'port':0x18eb});var socket=require(_0x3917('0x1b'))(new Redis(config[_0x3917('0x19')]));require(_0x3917('0x1c'))['register'](socket);var jayson=require(_0x3917('0x1d'));var client=jayson[_0x3917('0x1e')][_0x3917('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x1e89be,_0x152022,_0x54d040,_0x2ea6cf){return new BPromise(function(_0x5583b7,_0x214e45){var _0x4d4dcc=_0x2ea6cf||client;return _0x4d4dcc[_0x3917('0x20')](_0x1e89be,_0x54d040)['then'](function(_0x48ab08){logger[_0x3917('0x21')](_0x3917('0x22'),_0x152022,_0x3917('0x23'));logger[_0x3917('0x24')](_0x3917('0x25'),_0x152022,_0x3917('0x23'),JSON[_0x3917('0x26')](_0x48ab08));if(_0x48ab08['error']){if(_0x48ab08[_0x3917('0x27')]['code']===0x1f4){logger[_0x3917('0x27')](_0x3917('0x22'),_0x152022,_0x48ab08['error']['message']);return _0x214e45(_0x48ab08[_0x3917('0x27')][_0x3917('0x28')]);}logger[_0x3917('0x27')](_0x3917('0x22'),_0x152022,_0x48ab08[_0x3917('0x27')][_0x3917('0x28')]);return _0x5583b7(_0x48ab08['error'][_0x3917('0x28')]);}else{logger[_0x3917('0x21')](_0x3917('0x22'),_0x152022,_0x3917('0x23'));_0x5583b7(_0x48ab08[_0x3917('0x29')][_0x3917('0x28')]);}})[_0x3917('0x2a')](function(_0x447aae){logger[_0x3917('0x27')](_0x3917('0x22'),_0x152022,_0x447aae);_0x214e45(_0x447aae);});});}function respondWithStatusCode(_0x9539a1,_0x49fa59){_0x49fa59=_0x49fa59||0xcc;return function(_0x1bcd9a){if(_0x1bcd9a){return _0x9539a1[_0x3917('0x2b')](_0x49fa59);}return _0x9539a1[_0x3917('0x2c')](_0x49fa59)['end']();};}function respondWithResult(_0x4d17d2,_0x1674e1){_0x1674e1=_0x1674e1||0xc8;return function(_0x5e02f6){if(_0x5e02f6){return _0x4d17d2[_0x3917('0x2c')](_0x1674e1)[_0x3917('0x2d')](_0x5e02f6);}};}function respondWithFilteredResult(_0x2d95a3,_0x554933){return function(_0x1474ec){if(_0x1474ec){var _0x5d9cb6=typeof _0x554933[_0x3917('0x2e')]===_0x3917('0x2f')&&typeof _0x554933[_0x3917('0x30')]===_0x3917('0x2f');var _0x10a136=_0x1474ec['count'];var _0x571f91=_0x5d9cb6?0x0:_0x554933[_0x3917('0x2e')];var _0x45cdda=_0x5d9cb6?_0x1474ec['count']:_0x554933[_0x3917('0x2e')]+_0x554933[_0x3917('0x30')];var _0x106f68;if(_0x45cdda>=_0x10a136){_0x45cdda=_0x10a136;_0x106f68=0xc8;}else{_0x106f68=0xce;}_0x2d95a3[_0x3917('0x2c')](_0x106f68);return _0x2d95a3[_0x3917('0x31')]('Content-Range',_0x571f91+'-'+_0x45cdda+'/'+_0x10a136)[_0x3917('0x2d')](_0x1474ec);}return null;};}function patchUpdates(_0x5b0daa){return function(_0x4aa96b){try{jsonpatch['apply'](_0x4aa96b,_0x5b0daa,!![]);}catch(_0x271705){return BPromise[_0x3917('0x32')](_0x271705);}return _0x4aa96b['save']();};}function saveUpdates(_0x591784,_0x457954){return function(_0x1df670){if(_0x1df670){return _0x1df670[_0x3917('0x33')](_0x591784)[_0x3917('0x34')](function(_0x38cd48){return _0x38cd48;});}return null;};}function removeEntity(_0x358077,_0x759d9c){return function(_0xa5be26){if(_0xa5be26){return _0xa5be26[_0x3917('0x35')]()[_0x3917('0x34')](function(){var _0x4f2bab=_0xa5be26[_0x3917('0x36')]({'plain':!![]});var _0x414bda='WhatsappAccounts';return db[_0x3917('0x37')][_0x3917('0x35')]({'where':{'type':_0x414bda,'resourceId':_0x4f2bab['id']}})['then'](function(){return _0xa5be26;});})['then'](function(){_0x358077[_0x3917('0x2c')](0xcc)[_0x3917('0x38')]();});}};}function handleEntityNotFound(_0x18b3dc,_0x5f08c6){return function(_0x2cb10d){if(!_0x2cb10d){_0x18b3dc[_0x3917('0x2b')](0x194);}return _0x2cb10d;};}function handleError(_0x4dc590,_0x2889e7){_0x2889e7=_0x2889e7||0x1f4;return function(_0x57861f){logger['error'](_0x57861f[_0x3917('0x39')]);if(_0x57861f[_0x3917('0x3a')]){delete _0x57861f[_0x3917('0x3a')];}_0x4dc590['status'](_0x2889e7)[_0x3917('0x3b')](_0x57861f);};}exports[_0x3917('0x3c')]=function(_0x106ed6,_0x27e16f){var _0x405432={'include':[{'model':db[_0x3917('0x3d')],'as':'mandatoryDispositionPause'}]},_0x356a87={},_0x428ca1={'count':0x0,'rows':[]};var _0x4e85be=_[_0x3917('0x3e')](db[_0x3917('0x3f')][_0x3917('0x40')],function(_0xe1d705){return{'name':_0xe1d705[_0x3917('0x41')],'type':_0xe1d705[_0x3917('0x42')]['key']};});_0x356a87['model']=_[_0x3917('0x3e')](_0x4e85be,_0x3917('0x3a'));_0x356a87[_0x3917('0x43')]=_[_0x3917('0x44')](_0x106ed6[_0x3917('0x43')]);_0x356a87['filters']=_[_0x3917('0x45')](_0x356a87[_0x3917('0x46')],_0x356a87[_0x3917('0x43')]);_0x405432[_0x3917('0x47')]=_[_0x3917('0x45')](_0x356a87[_0x3917('0x46')],qs[_0x3917('0x48')](_0x106ed6['query'][_0x3917('0x48')]));_0x405432[_0x3917('0x47')]=_0x405432[_0x3917('0x47')][_0x3917('0x49')]?_0x405432[_0x3917('0x47')]:_0x356a87['model'];if(!_0x106ed6[_0x3917('0x43')][_0x3917('0x4a')](_0x3917('0x4b'))){_0x405432[_0x3917('0x30')]=qs[_0x3917('0x30')](_0x106ed6[_0x3917('0x43')][_0x3917('0x30')]);_0x405432['offset']=qs[_0x3917('0x2e')](_0x106ed6[_0x3917('0x43')][_0x3917('0x2e')]);}_0x405432['order']=qs[_0x3917('0x4c')](_0x106ed6[_0x3917('0x43')][_0x3917('0x4c')]);_0x405432[_0x3917('0x4d')]=qs[_0x3917('0x4e')](_[_0x3917('0x4f')](_0x106ed6[_0x3917('0x43')],_0x356a87[_0x3917('0x4e')]),_0x4e85be);if(_0x106ed6[_0x3917('0x43')]['filter']){_0x405432[_0x3917('0x4d')]=_[_0x3917('0x50')](_0x405432['where'],{'$or':_[_0x3917('0x3e')](_0x4e85be,function(_0x2724ce){if(_0x2724ce[_0x3917('0x42')]!==_0x3917('0x51')){var _0x588648={};_0x588648[_0x2724ce[_0x3917('0x3a')]]={'$like':'%'+_0x106ed6[_0x3917('0x43')][_0x3917('0x52')]+'%'};return _0x588648;}})});}_0x405432=_['merge']({},_0x405432,_0x106ed6['options']);var _0x2b811a={'where':_0x405432['where']};return db[_0x3917('0x3f')][_0x3917('0x53')](_0x2b811a)['then'](function(_0x309b15){_0x428ca1['count']=_0x309b15;if(_0x106ed6[_0x3917('0x43')][_0x3917('0x54')]){_0x405432[_0x3917('0x55')]=[{'all':!![]}];}return db[_0x3917('0x3f')][_0x3917('0x56')](_0x405432);})['then'](function(_0x5e4187){_0x428ca1[_0x3917('0x57')]=_0x5e4187;return _0x428ca1;})['then'](respondWithFilteredResult(_0x27e16f,_0x405432))[_0x3917('0x2a')](handleError(_0x27e16f,null));};exports[_0x3917('0x58')]=function(_0x1f18b6,_0x13011b){var _0xdc6022={'raw':![],'where':{'id':_0x1f18b6['params']['id']},'include':[{'model':db['Pause'],'as':_0x3917('0x59')}]},_0x1bf461={};_0x1bf461['model']=_['keys'](db[_0x3917('0x3f')][_0x3917('0x40')]);_0x1bf461[_0x3917('0x43')]=_[_0x3917('0x44')](_0x1f18b6[_0x3917('0x43')]);_0x1bf461[_0x3917('0x4e')]=_['intersection'](_0x1bf461[_0x3917('0x46')],_0x1bf461[_0x3917('0x43')]);_0xdc6022['attributes']=_[_0x3917('0x45')](_0x1bf461[_0x3917('0x46')],qs[_0x3917('0x48')](_0x1f18b6[_0x3917('0x43')][_0x3917('0x48')]));_0xdc6022[_0x3917('0x47')]=_0xdc6022[_0x3917('0x47')][_0x3917('0x49')]?_0xdc6022[_0x3917('0x47')]:_0x1bf461[_0x3917('0x46')];if(_0x1f18b6['query']['includeAll']){_0xdc6022['include']=[{'all':!![]}];}_0xdc6022=_[_0x3917('0x50')]({},_0xdc6022,_0x1f18b6[_0x3917('0x5a')]);return db['WhatsappAccount'][_0x3917('0x5b')](_0xdc6022)[_0x3917('0x34')](handleEntityNotFound(_0x13011b,null))['then'](respondWithResult(_0x13011b,null))['catch'](handleError(_0x13011b,null));};exports[_0x3917('0x5c')]=function(_0x24b626,_0x1dc3d1){return db[_0x3917('0x3f')]['create'](_0x24b626[_0x3917('0x5d')],{})['then'](function(_0x3b12fb){var _0x33ed43=_0x24b626['user'][_0x3917('0x36')]({'plain':!![]});if(!_0x33ed43)throw new Error(_0x3917('0x5e'));if(_0x33ed43['role']===_0x3917('0x5f')){var _0x540fb3=_0x3b12fb['get']({'plain':!![]});var _0x336034='WhatsappAccounts';return db['UserProfileSection']['find']({'where':{'name':_0x336034,'userProfileId':_0x33ed43[_0x3917('0x60')]},'raw':!![]})[_0x3917('0x34')](function(_0x13d4e6){if(_0x13d4e6&&_0x13d4e6['autoAssociation']===0x0){return db[_0x3917('0x37')][_0x3917('0x5c')]({'name':_0x540fb3['name'],'resourceId':_0x540fb3['id'],'type':_0x13d4e6[_0x3917('0x3a')],'sectionId':_0x13d4e6['id']},{})[_0x3917('0x34')](function(){return _0x3b12fb;});}else{return _0x3b12fb;}})[_0x3917('0x2a')](function(_0x2ed63a){logger[_0x3917('0x27')](_0x3917('0x61'),_0x2ed63a);throw _0x2ed63a;});}return _0x3b12fb;})[_0x3917('0x34')](respondWithResult(_0x1dc3d1,0xc9))['catch'](handleError(_0x1dc3d1,null));};exports['update']=function(_0x38cc14,_0x242c4e){if(_0x38cc14[_0x3917('0x5d')]['id']){delete _0x38cc14[_0x3917('0x5d')]['id'];}return db[_0x3917('0x3f')][_0x3917('0x5b')]({'where':{'id':_0x38cc14[_0x3917('0x62')]['id']},'include':[{'model':db[_0x3917('0x3d')],'as':_0x3917('0x59')}]})[_0x3917('0x34')](handleEntityNotFound(_0x242c4e,null))[_0x3917('0x34')](saveUpdates(_0x38cc14['body'],null))['then'](respondWithResult(_0x242c4e,null))[_0x3917('0x2a')](handleError(_0x242c4e,null));};exports['destroy']=function(_0x179924,_0x1b39a2){return db[_0x3917('0x3f')][_0x3917('0x5b')]({'where':{'id':_0x179924[_0x3917('0x62')]['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x1b39a2,null))[_0x3917('0x34')](removeEntity(_0x1b39a2,null))[_0x3917('0x2a')](handleError(_0x1b39a2,null));};exports['describe']=function(_0x761ac0,_0x12eb59){return db[_0x3917('0x3f')][_0x3917('0x63')]()[_0x3917('0x34')](respondWithResult(_0x12eb59,null))['catch'](handleError(_0x12eb59,null));};exports[_0x3917('0x64')]=function(_0xf0a7bc,_0x4c71a8,_0x1a72cd){if(_0xf0a7bc[_0x3917('0x5d')]['id']){delete _0xf0a7bc[_0x3917('0x5d')]['id'];}return db[_0x3917('0x3f')]['find']({'where':{'id':_0xf0a7bc['params']['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x4c71a8,null))[_0x3917('0x34')](function(_0x350ec5){if(_0x350ec5){_0xf0a7bc[_0x3917('0x5d')][_0x3917('0x65')]=_0x350ec5['id'];return db[_0x3917('0x66')][_0x3917('0x5c')](_0xf0a7bc[_0x3917('0x5d')]);}})['then'](respondWithResult(_0x4c71a8,null))[_0x3917('0x2a')](handleError(_0x4c71a8,null));};exports[_0x3917('0x67')]=function(_0x31eb33,_0x3aad34,_0x787806){var _0x39c2f0={'raw':![],'where':{}};var _0x3f9a99={};var _0x284ea4={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x3917('0x68')]({'where':{'id':_0x31eb33[_0x3917('0x62')]['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x3aad34,null))[_0x3917('0x34')](function(_0x5cea7d){if(_0x5cea7d){_0x3f9a99[_0x3917('0x46')]=_[_0x3917('0x44')](db['Disposition']['rawAttributes']);_0x3f9a99[_0x3917('0x43')]=_['keys'](_0x31eb33[_0x3917('0x43')]);_0x3f9a99[_0x3917('0x4e')]=_[_0x3917('0x45')](_0x3f9a99['model'],_0x3f9a99[_0x3917('0x43')]);_0x39c2f0[_0x3917('0x47')]=_[_0x3917('0x45')](_0x3f9a99[_0x3917('0x46')],qs[_0x3917('0x48')](_0x31eb33[_0x3917('0x43')][_0x3917('0x48')]));_0x39c2f0[_0x3917('0x47')]=_0x39c2f0[_0x3917('0x47')][_0x3917('0x49')]?_0x39c2f0['attributes']:_0x3f9a99['model'];if(!_0x31eb33[_0x3917('0x43')][_0x3917('0x4a')](_0x3917('0x4b'))){_0x39c2f0['limit']=qs[_0x3917('0x30')](_0x31eb33['query'][_0x3917('0x30')]);_0x39c2f0['offset']=qs['offset'](_0x31eb33['query'][_0x3917('0x2e')]);}_0x39c2f0[_0x3917('0x69')]=qs[_0x3917('0x4c')](_0x31eb33[_0x3917('0x43')]['sort']);_0x39c2f0['where']=qs[_0x3917('0x4e')](_[_0x3917('0x4f')](_0x31eb33[_0x3917('0x43')],_0x3f9a99[_0x3917('0x4e')]));_0x39c2f0[_0x3917('0x4d')]['WhatsappAccountId']=_0x5cea7d['id'];if(_0x31eb33[_0x3917('0x43')][_0x3917('0x52')]){_0x39c2f0['where']=_[_0x3917('0x50')](_0x39c2f0[_0x3917('0x4d')],{'$or':_['map'](_0x39c2f0[_0x3917('0x47')],function(_0xd3cbe3){var _0x4034c1={};_0x4034c1[_0xd3cbe3]={'$like':'%'+_0x31eb33['query'][_0x3917('0x52')]+'%'};return _0x4034c1;})});}_0x39c2f0=_[_0x3917('0x50')]({},_0x39c2f0,_0x31eb33[_0x3917('0x5a')]);return db[_0x3917('0x66')][_0x3917('0x53')]({'where':_0x39c2f0[_0x3917('0x4d')]})[_0x3917('0x34')](function(_0x49e278){_0x284ea4[_0x3917('0x53')]=_0x49e278;if(_0x31eb33[_0x3917('0x43')]['includeAll']){_0x39c2f0[_0x3917('0x55')]=[{'all':!![]}];}return db[_0x3917('0x66')][_0x3917('0x56')](_0x39c2f0);})[_0x3917('0x34')](function(_0x157968){_0x284ea4[_0x3917('0x57')]=_0x157968;return _0x284ea4;});}})[_0x3917('0x34')](respondWithFilteredResult(_0x3aad34,_0x39c2f0))['catch'](handleError(_0x3aad34,null));};exports[_0x3917('0x6a')]=function(_0x209d00,_0x24948a,_0x3f2df7){return db[_0x3917('0x3f')]['find']({'where':{'id':_0x209d00['params']['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x24948a,null))[_0x3917('0x34')](function(_0x5ef532){if(_0x5ef532){return _0x5ef532[_0x3917('0x6a')](_0x209d00[_0x3917('0x43')][_0x3917('0x6b')]);}})[_0x3917('0x34')](respondWithStatusCode(_0x24948a,null))[_0x3917('0x2a')](handleError(_0x24948a,null));};exports[_0x3917('0x6c')]=function(_0x222498,_0x1a5869,_0x2f010f){if(_0x222498[_0x3917('0x5d')]['id']){delete _0x222498[_0x3917('0x5d')]['id'];}return db[_0x3917('0x3f')][_0x3917('0x5b')]({'where':{'id':_0x222498['params']['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x1a5869,null))[_0x3917('0x34')](function(_0x241137){if(_0x241137){_0x222498[_0x3917('0x5d')][_0x3917('0x65')]=_0x241137['id'];return db['CannedAnswer'][_0x3917('0x5c')](_0x222498[_0x3917('0x5d')]);}})[_0x3917('0x34')](respondWithResult(_0x1a5869,null))['catch'](handleError(_0x1a5869,null));};exports[_0x3917('0x6d')]=function(_0x5b05de,_0x8db197,_0x305428){var _0x1103b9={'raw':![],'where':{}};var _0x3fcc5c={};var _0x423ce6={'count':0x0,'rows':[]};return db['WhatsappAccount']['findOne']({'where':{'id':_0x5b05de[_0x3917('0x62')]['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x8db197,null))['then'](function(_0x7a18f){if(_0x7a18f){_0x3fcc5c[_0x3917('0x46')]=_[_0x3917('0x44')](db[_0x3917('0x6e')][_0x3917('0x40')]);_0x3fcc5c[_0x3917('0x43')]=_['keys'](_0x5b05de[_0x3917('0x43')]);_0x3fcc5c[_0x3917('0x4e')]=_['intersection'](_0x3fcc5c[_0x3917('0x46')],_0x3fcc5c[_0x3917('0x43')]);_0x1103b9[_0x3917('0x47')]=_[_0x3917('0x45')](_0x3fcc5c['model'],qs[_0x3917('0x48')](_0x5b05de[_0x3917('0x43')][_0x3917('0x48')]));_0x1103b9[_0x3917('0x47')]=_0x1103b9[_0x3917('0x47')][_0x3917('0x49')]?_0x1103b9[_0x3917('0x47')]:_0x3fcc5c[_0x3917('0x46')];if(!_0x5b05de[_0x3917('0x43')][_0x3917('0x4a')]('nolimit')){_0x1103b9[_0x3917('0x30')]=qs[_0x3917('0x30')](_0x5b05de[_0x3917('0x43')][_0x3917('0x30')]);_0x1103b9['offset']=qs[_0x3917('0x2e')](_0x5b05de[_0x3917('0x43')]['offset']);}_0x1103b9[_0x3917('0x69')]=qs[_0x3917('0x4c')](_0x5b05de[_0x3917('0x43')]['sort']);_0x1103b9[_0x3917('0x4d')]=qs['filters'](_[_0x3917('0x4f')](_0x5b05de[_0x3917('0x43')],_0x3fcc5c[_0x3917('0x4e')]));_0x1103b9['where']['WhatsappAccountId']=_0x7a18f['id'];if(_0x5b05de[_0x3917('0x43')]['filter']){_0x1103b9['where']=_['merge'](_0x1103b9[_0x3917('0x4d')],{'$or':_[_0x3917('0x3e')](_0x1103b9[_0x3917('0x47')],function(_0x2db725){var _0x1f3be9={};_0x1f3be9[_0x2db725]={'$like':'%'+_0x5b05de[_0x3917('0x43')][_0x3917('0x52')]+'%'};return _0x1f3be9;})});}_0x1103b9=_[_0x3917('0x50')]({},_0x1103b9,_0x5b05de[_0x3917('0x5a')]);return db[_0x3917('0x6e')][_0x3917('0x53')]({'where':_0x1103b9[_0x3917('0x4d')]})[_0x3917('0x34')](function(_0x2bb49c){_0x423ce6[_0x3917('0x53')]=_0x2bb49c;if(_0x5b05de['query'][_0x3917('0x54')]){_0x1103b9[_0x3917('0x55')]=[{'all':!![]}];}return db[_0x3917('0x6e')]['findAll'](_0x1103b9);})[_0x3917('0x34')](function(_0x16358f){_0x423ce6['rows']=_0x16358f;return _0x423ce6;});}})[_0x3917('0x34')](respondWithFilteredResult(_0x8db197,_0x1103b9))[_0x3917('0x2a')](handleError(_0x8db197,null));};exports[_0x3917('0x6f')]=function(_0x37ffd6,_0x58c61b,_0x477b98){return db[_0x3917('0x3f')]['find']({'where':{'id':_0x37ffd6[_0x3917('0x62')]['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x58c61b,null))['then'](function(_0x3119df){if(_0x3119df){return _0x3119df[_0x3917('0x6f')](_0x37ffd6[_0x3917('0x43')][_0x3917('0x6b')]);}})[_0x3917('0x34')](respondWithStatusCode(_0x58c61b,null))[_0x3917('0x2a')](handleError(_0x58c61b,null));};exports['addAgents']=function(_0x39c895,_0x4f65df,_0x2ba044){return db[_0x3917('0x3f')][_0x3917('0x5b')]({'where':{'id':_0x39c895[_0x3917('0x62')]['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x4f65df,null))[_0x3917('0x34')](function(_0x1a9c4b){if(_0x1a9c4b){return _0x1a9c4b[_0x3917('0x70')](_0x39c895[_0x3917('0x5d')][_0x3917('0x6b')],_['omit'](_0x39c895[_0x3917('0x5d')],[_0x3917('0x6b'),'id'])||{})[_0x3917('0x71')](function(_0x5d26a1){for(var _0x268a59=0x0;_0x268a59<_0x39c895[_0x3917('0x5d')][_0x3917('0x6b')][_0x3917('0x49')];_0x268a59+=0x1){socket[_0x3917('0x72')](_0x3917('0x73'),{'UserId':Number(_0x39c895['body']['ids'][_0x268a59]),'WhatsappAccountId':Number(_0x39c895[_0x3917('0x62')]['id'])});}return _0x5d26a1;});}})[_0x3917('0x34')](respondWithResult(_0x4f65df,null))[_0x3917('0x2a')](handleError(_0x4f65df,null));};exports[_0x3917('0x74')]=function(_0x203d04,_0x173983,_0x49488e){return db[_0x3917('0x3f')][_0x3917('0x5b')]({'where':{'id':_0x203d04[_0x3917('0x62')]['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x173983,null))[_0x3917('0x34')](function(_0x17dfc9){if(_0x17dfc9){return _0x17dfc9[_0x3917('0x74')](_0x203d04[_0x3917('0x43')]['ids'])[_0x3917('0x34')](function(){if(_[_0x3917('0x75')](_0x203d04[_0x3917('0x43')][_0x3917('0x6b')])){for(var _0x113aaf=0x0;_0x113aaf<_0x203d04[_0x3917('0x43')][_0x3917('0x6b')][_0x3917('0x49')];_0x113aaf+=0x1){socket[_0x3917('0x72')](_0x3917('0x76'),{'UserId':Number(_0x203d04[_0x3917('0x43')][_0x3917('0x6b')][_0x113aaf]),'WhatsappAccountId':Number(_0x203d04['params']['id'])});}}else{socket[_0x3917('0x72')]('userWhatsappAccount:remove',{'UserId':Number(_0x203d04['query'][_0x3917('0x6b')]),'WhatsappAccountId':Number(_0x203d04[_0x3917('0x62')]['id'])});}});}})['then'](respondWithStatusCode(_0x173983,null))[_0x3917('0x2a')](handleError(_0x173983,null));};exports[_0x3917('0x77')]=function(_0x3a05ec,_0x456d35,_0x13189d){var _0x5e45db={};var _0x16adda={};var _0xc59437;var _0x59278b;return db[_0x3917('0x3f')][_0x3917('0x68')]({'where':{'id':_0x3a05ec[_0x3917('0x62')]['id']}})['then'](handleEntityNotFound(_0x456d35,null))[_0x3917('0x34')](function(_0x12e556){if(_0x12e556){_0xc59437=_0x12e556;_0x16adda['model']=_[_0x3917('0x44')](db['User']['rawAttributes']);_0x16adda['query']=_[_0x3917('0x44')](_0x3a05ec[_0x3917('0x43')]);_0x16adda[_0x3917('0x4e')]=_[_0x3917('0x45')](_0x16adda['model'],_0x16adda[_0x3917('0x43')]);_0x5e45db[_0x3917('0x47')]=_[_0x3917('0x45')](_0x16adda[_0x3917('0x46')],qs[_0x3917('0x48')](_0x3a05ec[_0x3917('0x43')][_0x3917('0x48')]));_0x5e45db[_0x3917('0x47')]=_0x5e45db[_0x3917('0x47')][_0x3917('0x49')]?_0x5e45db['attributes']:_0x16adda[_0x3917('0x46')];_0x5e45db[_0x3917('0x69')]=qs[_0x3917('0x4c')](_0x3a05ec[_0x3917('0x43')][_0x3917('0x4c')]);_0x5e45db['where']=qs[_0x3917('0x4e')](_[_0x3917('0x4f')](_0x3a05ec[_0x3917('0x43')],_0x16adda['filters']));if(_0x3a05ec[_0x3917('0x43')][_0x3917('0x52')]){_0x5e45db[_0x3917('0x4d')]=_[_0x3917('0x50')](_0x5e45db[_0x3917('0x4d')],{'$or':_['map'](_0x5e45db['attributes'],function(_0x1124ad){var _0x28ca24={};_0x28ca24[_0x1124ad]={'$like':'%'+_0x3a05ec[_0x3917('0x43')][_0x3917('0x52')]+'%'};return _0x28ca24;})});}_0x5e45db=_[_0x3917('0x50')]({},_0x5e45db,_0x3a05ec[_0x3917('0x5a')]);return _0xc59437[_0x3917('0x77')](_0x5e45db);}})[_0x3917('0x34')](function(_0x5a3385){if(_0x5a3385){_0x59278b=_0x5a3385[_0x3917('0x49')];if(!_0x3a05ec['query']['hasOwnProperty'](_0x3917('0x4b'))){_0x5e45db[_0x3917('0x30')]=qs['limit'](_0x3a05ec[_0x3917('0x43')]['limit']);_0x5e45db[_0x3917('0x2e')]=qs['offset'](_0x3a05ec[_0x3917('0x43')][_0x3917('0x2e')]);}return _0xc59437[_0x3917('0x77')](_0x5e45db);}})[_0x3917('0x34')](function(_0x1290f7){if(_0x1290f7){return _0x1290f7?{'count':_0x59278b,'rows':_0x1290f7}:null;}})['then'](respondWithResult(_0x456d35,null))[_0x3917('0x2a')](handleError(_0x456d35,null));};exports[_0x3917('0x78')]=function(_0x404736,_0x2fc52){var _0xf7a46=_0x404736[_0x3917('0x62')]['id'];var _0x502cd4=_0x404736[_0x3917('0x5d')];var _0x351d24=0xc8;var _0x451c11=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x3917('0x79')]['Transaction'][_0x3917('0x7a')][_0x3917('0x7b')]},function(_0x239ecf){return db[_0x3917('0x3f')][_0x3917('0x68')]({'where':{'id':_0xf7a46},'transaction':_0x239ecf})['then'](function(_0x3b6a82){if(_0x3b6a82){return db['WhatsappApplication'][_0x3917('0x35')]({'where':{'WhatsappAccountId':_0xf7a46},'transaction':_0x239ecf})[_0x3917('0x34')](function(){var _0x3abcdf=_[_0x3917('0x3e')](_0x502cd4,function(_0x2e2cde){_0x2e2cde['WhatsappAccountId']=_0xf7a46;return _0x2e2cde;});return db['WhatsappApplication']['bulkCreate'](_0x3abcdf,{'transaction':_0x239ecf});});}else{_0x351d24=0x194;_0x451c11=[];}});})[_0x3917('0x34')](function(){if(_0x351d24!==0x194){return db[_0x3917('0x7c')]['findAndCountAll']({'where':{'WhatsappAccountId':_0xf7a46},'order':_0x3917('0x7d')})[_0x3917('0x34')](function(_0x616403){_0x451c11=_0x616403;});}})[_0x3917('0x2a')](function(_0x226f9e){_0x351d24=0x1f4;logger[_0x3917('0x27')](_0x226f9e[_0x3917('0x39')]);if(_0x226f9e[_0x3917('0x3a')]){delete _0x226f9e[_0x3917('0x3a')];}_0x451c11=_0x226f9e;})['finally'](function(){if(_0x451c11===null){_0x2fc52['sendStatus'](_0x351d24);}else{if(_0x351d24===0x1f4){_0x2fc52[_0x3917('0x2c')](_0x351d24)[_0x3917('0x3b')](_0x451c11);}else{_0x2fc52[_0x3917('0x2c')](_0x351d24)[_0x3917('0x2d')](_0x451c11);}}});};exports[_0x3917('0x7e')]=function(_0x2a425c,_0x586110,_0x26128c){var _0x21fe54={};var _0x54710f={};var _0x31df29;var _0x6e75ec;return db['WhatsappAccount'][_0x3917('0x68')]({'where':{'id':_0x2a425c[_0x3917('0x62')]['id']}})[_0x3917('0x34')](handleEntityNotFound(_0x586110,null))[_0x3917('0x34')](function(_0x2e0e62){if(_0x2e0e62){_0x31df29=_0x2e0e62;_0x54710f[_0x3917('0x46')]=_[_0x3917('0x44')](db['WhatsappApplication'][_0x3917('0x40')]);_0x54710f['query']=_[_0x3917('0x44')](_0x2a425c['query']);_0x54710f[_0x3917('0x4e')]=_['intersection'](_0x54710f[_0x3917('0x46')],_0x54710f[_0x3917('0x43')]);_0x21fe54[_0x3917('0x47')]=_['intersection'](_0x54710f[_0x3917('0x46')],qs['fields'](_0x2a425c[_0x3917('0x43')][_0x3917('0x48')]));_0x21fe54[_0x3917('0x47')]=_0x21fe54[_0x3917('0x47')][_0x3917('0x49')]?_0x21fe54['attributes']:_0x54710f['model'];_0x21fe54[_0x3917('0x69')]=qs['sort'](_0x2a425c[_0x3917('0x43')]['sort']);_0x21fe54['where']=qs['filters'](_['pick'](_0x2a425c[_0x3917('0x43')],_0x54710f['filters']));if(_0x2a425c[_0x3917('0x43')][_0x3917('0x52')]){_0x21fe54[_0x3917('0x4d')]=_[_0x3917('0x50')](_0x21fe54[_0x3917('0x4d')],{'$or':_['map'](_0x21fe54[_0x3917('0x47')],function(_0x4064d9){var _0x40da6a={};_0x40da6a[_0x4064d9]={'$like':'%'+_0x2a425c[_0x3917('0x43')][_0x3917('0x52')]+'%'};return _0x40da6a;})});}_0x21fe54=_[_0x3917('0x50')]({},_0x21fe54,_0x2a425c[_0x3917('0x5a')]);return _0x31df29[_0x3917('0x7e')](_0x21fe54);}})[_0x3917('0x34')](function(_0x47b8f2){if(_0x47b8f2){_0x6e75ec=_0x47b8f2['length'];if(!_0x2a425c[_0x3917('0x43')]['hasOwnProperty'](_0x3917('0x4b'))){_0x21fe54[_0x3917('0x30')]=qs['limit'](_0x2a425c[_0x3917('0x43')][_0x3917('0x30')]);_0x21fe54[_0x3917('0x2e')]=qs[_0x3917('0x2e')](_0x2a425c[_0x3917('0x43')][_0x3917('0x2e')]);}return _0x31df29[_0x3917('0x7e')](_0x21fe54);}})[_0x3917('0x34')](function(_0x4672cf){if(_0x4672cf){return _0x4672cf?{'count':_0x6e75ec,'rows':_0x4672cf}:null;}})[_0x3917('0x34')](respondWithResult(_0x586110,null))[_0x3917('0x2a')](handleError(_0x586110,null));};exports[_0x3917('0x7f')]=function(_0x13b31f,_0x11c8ce,_0x13fa17){var _0x3fee28={'channel':_0x3917('0x80')};var _0x3768e0=[];var _0x5a7002=[];var _0x1d5d95={};return db[_0x3917('0x3f')][_0x3917('0x5b')]({'where':{'id':_0x13b31f[_0x3917('0x62')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x3917('0x81')}]})[_0x3917('0x34')](handleEntityNotFound(_0x11c8ce,null))[_0x3917('0x34')](function(_0x208bc0){_0x3fee28[_0x3917('0x82')]=_0x208bc0;if(_0x3fee28[_0x3917('0x82')]&&_0x3fee28[_0x3917('0x82')][_0x3917('0x42')]===_0x3917('0x83')&&_0x13b31f[_0x3917('0x5d')][_0x3917('0x84')]){if(_0x13b31f['body'][_0x3917('0x84')][_0x3917('0x49')]===0x0)return;if(_0x13b31f[_0x3917('0x5d')][_0x3917('0x84')][0x0]['state']!==_0x3917('0x85'))return;return db[_0x3917('0x86')]['update']({'read':!![],'readAt':_0x13b31f[_0x3917('0x5d')][_0x3917('0x84')][0x0]['timestamp']},{'where':{'messageId':_0x13b31f[_0x3917('0x5d')][_0x3917('0x84')][0x0]['message_id']},'individualHooks':!![]})[_0x3917('0x34')](function(_0x3584ee){return _0x11c8ce[_0x3917('0x2c')](0xc8)[_0x3917('0x2d')](_0x3584ee);});}_0x3fee28[_0x3917('0x87')]=_[_0x3917('0x88')](_0x208bc0[_0x3917('0x81')],[_0x3917('0x7d')],[_0x3917('0x89')]);if(_0x3fee28[_0x3917('0x82')]['Applications']){delete _0x3fee28['account'][_0x3917('0x81')];}return db[_0x3917('0x8a')][_0x3917('0x63')]()[_0x3917('0x34')](function(_0x547a4f){if(!_0x547a4f){throw new db[(_0x3917('0x8b'))]['ValidationError'](_0x3917('0x8c'));}_0x3768e0=_[_0x3917('0x8d')](_[_0x3917('0x44')](_0x547a4f),['createdAt',_0x3917('0x8e')]);_0x5a7002=_[_0x3917('0x8d')](_[_0x3917('0x44')](_0x547a4f),[_0x3917('0x8f'),_0x3917('0x8e'),'CompanyId',_0x3917('0x90')]);_0x3fee28[_0x3917('0x5d')]={'mapKey':_0x3917('0x91')};if(_0x3fee28[_0x3917('0x82')]&&_0x3fee28[_0x3917('0x82')][_0x3917('0x42')]===_0x3917('0x92')){_0x3fee28[_0x3917('0x5d')][_0x3917('0x93')]=_0x13b31f[_0x3917('0x5d')][_0x3917('0x94')][_0x3917('0x95')](_0x3917('0x96'),'');_0x3fee28[_0x3917('0x5d')][_0x3917('0x5d')]=_0x13b31f['body']['Body'];_0x3fee28[_0x3917('0x5d')][_0x3917('0x97')]=_0x13b31f['body']['MessageSid'];}if(_0x3fee28[_0x3917('0x82')]&&_0x3fee28[_0x3917('0x82')]['type']===_0x3917('0x83')){_0x3fee28[_0x3917('0x5d')][_0x3917('0x93')]=_0x13b31f[_0x3917('0x5d')][_0x3917('0x98')][0x0][_0x3917('0x93')];_0x3fee28[_0x3917('0x5d')][_0x3917('0x5d')]=_0x13b31f[_0x3917('0x5d')]['notifications'][0x0][_0x3917('0x28')]['body'];_0x3fee28[_0x3917('0x5d')][_0x3917('0x97')]=_0x13b31f[_0x3917('0x5d')][_0x3917('0x98')][0x0][_0x3917('0x99')];}if(_0x3fee28['body']['id']){delete _0x3fee28[_0x3917('0x5d')]['id'];}if(_[_0x3917('0x9a')](_0x3fee28['body'][_0x3917('0x93')])){throw new db[(_0x3917('0x8b'))][(_0x3917('0x9b'))]('from\x20is\x20mandatory');}if(_[_0x3917('0x9a')](_0x3fee28[_0x3917('0x5d')][_0x3917('0x5d')])||_0x3fee28[_0x3917('0x5d')][_0x3917('0x5d')]===''){throw new db['Sequelize'][(_0x3917('0x9b'))](_0x3917('0x9c'));}if(_['isNil'](_0x3fee28[_0x3917('0x5d')][_0x3917('0x9d')])){throw new db[(_0x3917('0x8b'))][(_0x3917('0x9b'))](_0x3917('0x9e')+_0x5a7002);}if(!_[_0x3917('0x9f')](_0x5a7002,_0x3fee28[_0x3917('0x5d')]['mapKey'])){throw new db[(_0x3917('0x8b'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5a7002);}_0x1d5d95[_0x3fee28['body']['mapKey']]=_0x3fee28['body'][_0x3917('0x93')];return db[_0x3917('0xa0')][_0x3917('0x5b')]({'where':{'id':_0x3fee28[_0x3917('0x82')]['ListId']},'include':[{'model':db[_0x3917('0x8a')],'as':_0x3917('0xa1'),'where':_0x1d5d95,'limit':0x1,'order':[[_0x3917('0x8e'),_0x3917('0xa2')]]}]});})[_0x3917('0x34')](handleEntityNotFound(_0x11c8ce,null))['then'](function(_0x1b60ed){if(_0x1b60ed){_0x3fee28[_0x3917('0xa3')]=_[_0x3917('0xa4')](_0x1b60ed,[_0x3917('0xa1')]);if(_0x1b60ed[_0x3917('0xa1')][_0x3917('0x49')]){return _0x1b60ed['Contacts'][0x0];}var _0x5e8166=_[_0x3917('0xa5')](_0x3fee28[_0x3917('0x5d')],{'firstName':_0x3fee28[_0x3917('0x5d')][_0x3917('0x93')],'ListId':_0x1b60ed['id']});_0x5e8166[_0x3fee28['body'][_0x3917('0x9d')]]=_0x3fee28[_0x3917('0x5d')]['from'];return db['CmContact'][_0x3917('0x5c')](_0x5e8166,{'fields':_0x3768e0,'raw':!![]});}})[_0x3917('0x34')](handleEntityNotFound(_0x11c8ce,null))['then'](function(_0x18a5a1){if(_0x18a5a1){_0x3fee28[_0x3917('0xa6')]=_0x18a5a1;var _0x4b8fad={'ContactId':_0x18a5a1['id'],'phone':_0x3fee28[_0x3917('0x5d')][_0x3917('0x93')],'WhatsappAccountId':_0x13b31f[_0x3917('0x62')]['id']};var _0x2cf31d={'ContactId':_0x18a5a1['id'],'WhatsappAccountId':_0x13b31f[_0x3917('0x62')]['id'],'closed':![]};return db[_0x3917('0xa7')][_0x3917('0x5b')]({'where':_0x2cf31d})[_0x3917('0x34')](function(_0x1f9069){if(_0x1f9069){return[_0x1f9069,![]];}return db['WhatsappInteraction'][_0x3917('0x5c')](_0x4b8fad)[_0x3917('0x34')](function(_0x37cb7c){return[_0x37cb7c,!![]];});});}})['spread'](function(_0x8ce447,_0x4d0761){_0x3fee28['interaction']=_0x8ce447[_0x3917('0x36')]({'plain':!![]});_0x3fee28[_0x3917('0xa8')]['created']=![];if(_0x4d0761){if(_0x3fee28['account']['autoclose']){_0x3fee28[_0x3917('0x87')][_0x3917('0xa9')]({'id':0x0,'priority':_0x3fee28['applications'][_0x3917('0x49')]+0x1,'app':_0x3917('0xaa'),'appdata':_0x3917('0xab'),'interval':_0x3917('0xac')});}_0x3fee28[_0x3917('0xa8')][_0x3917('0xad')]=!![];}return db[_0x3917('0x86')][_0x3917('0x5c')]({'phone':_0x3fee28['body'][_0x3917('0x93')],'messageId':_0x3fee28['body'][_0x3917('0x97')],'body':_0x3fee28[_0x3917('0x5d')][_0x3917('0x5d')],'WhatsappAccountId':_0x13b31f[_0x3917('0x62')]['id'],'WhatsappInteractionId':_0x8ce447['id'],'direction':'in','ContactId':_0x8ce447['ContactId'],'AttachmentId':_0x3fee28[_0x3917('0x5d')][_0x3917('0xae')]});})[_0x3917('0x34')](function(_0x531f58){_0x3fee28['message']=_0x531f58;if(!_0x3fee28[_0x3917('0xa8')][_0x3917('0xaf')])return;return db[_0x3917('0xb0')][_0x3917('0x5b')]({'attributes':['id',_0x3917('0x3a')],'where':{'id':_0x3fee28[_0x3917('0xa8')]['UserId']}});})[_0x3917('0x34')](function(_0xfcf8d2){if(_0xfcf8d2){_0x3fee28[_0x3917('0x87')][_0x3917('0xb1')]({'id':0x0,'priority':0x0,'app':_0x3917('0xb2'),'appdata':_0xfcf8d2[_0x3917('0x3a')]+','+(_0x3fee28['account']['waitForTheAssignedAgent']||0xa),'interval':_0x3917('0xac')});}if(!_0x3fee28[_0x3917('0xa8')][_0x3917('0xb3')])return;return db['WhatsappQueue']['find']({'attributes':['id',_0x3917('0x3a')],'where':{'id':_0x3fee28[_0x3917('0xa8')]['queueId']}});})[_0x3917('0x34')](function(_0x36989b){if(_0x36989b){_0x3fee28[_0x3917('0x87')]['unshift']({'id':0x0,'priority':0x1,'app':_0x3917('0xb4'),'appdata':_0x36989b['name']+','+(_0x3fee28[_0x3917('0x82')][_0x3917('0xb5')]||0x12c),'interval':_0x3917('0xac')});}return respondWithRpcPromise(_0x3917('0xb6'),_0x3917('0xb7'),_0x3fee28);})[_0x3917('0x34')](function(_0x6348e6){if(_0x6348e6){var _0x42c9bf=0xc8;var _0x39d96b=_0x3917('0xb8');logger['info'](_0x3917('0x25'),_0x39d96b,_0x42c9bf,_0x3917('0xb9'));logger[_0x3917('0x24')](_0x3917('0xba'),_0x39d96b,_0x42c9bf,_0x3917('0xb9'),JSON[_0x3917('0x26')](_0x6348e6));if(_0x3fee28[_0x3917('0x82')][_0x3917('0x42')]===_0x3917('0x92')){return _0x11c8ce[_0x3917('0x2c')](_0x42c9bf)[_0x3917('0x31')](_0x3917('0xbb'),_0x3917('0xbc'))[_0x3917('0x3b')](_0x3917('0xbd'));}else{return _0x11c8ce[_0x3917('0x2c')](_0x42c9bf)[_0x3917('0x2d')](_0x6348e6);}}});})[_0x3917('0x2a')](handleError(_0x11c8ce,null));};exports[_0x3917('0x3b')]=function(_0xef565f,_0x2fb8c0,_0x102825){var _0x4ce652,_0x557c31,_0x5bacca;if(_[_0x3917('0x9a')](_0xef565f[_0x3917('0x5d')]['body'])||_0xef565f[_0x3917('0x5d')][_0x3917('0x5d')]===''){throw new db['Sequelize'][(_0x3917('0x9b'))](_0x3917('0x9c'));}if(_['isNil'](_0xef565f[_0x3917('0x5d')]['to'])){throw new db['Sequelize'][(_0x3917('0x9b'))](_0x3917('0xbe'));}_0x4ce652=_0xef565f[_0x3917('0x5d')]['to'];return db[_0x3917('0x3f')]['find']({'where':{'id':_0xef565f[_0x3917('0x62')]['id']},'include':[{'model':db[_0x3917('0xa0')],'as':_0x3917('0xbf'),'include':[{'model':db[_0x3917('0x8a')],'as':'Contacts','where':{'mobile':_0x4ce652},'limit':0x1,'order':[['updatedAt',_0x3917('0xa2')]]}]}]})['then'](handleEntityNotFound(_0x2fb8c0,null))['then'](function(_0x2bd519){if(_0x2bd519&&_0x2bd519[_0x3917('0xbf')]){_0x557c31=_0x2bd519[_0x3917('0x36')]({'plain':!![]});if(_0x557c31[_0x3917('0xbf')]&&_0x557c31['List'][_0x3917('0xa1')]['length']){return _0x557c31['List'][_0x3917('0xa1')][0x0];}return db['CmContact'][_0x3917('0x5c')](_[_0x3917('0xa5')](_0xef565f['body'],{'firstName':_0x4ce652,'mobile':_0x4ce652,'phone':_0x4ce652,'ListId':_0x557c31[_0x3917('0x90')]}));}})['then'](handleEntityNotFound(_0x2fb8c0,null))['then'](function(_0x30aeb2){if(_0x30aeb2){_0x5bacca=_0x30aeb2;return db[_0x3917('0xa7')][_0x3917('0x5b')]({'where':{'ContactId':_0x5bacca['id'],'closed':![],'WhatsappAccountId':_0x557c31['id']}})['then'](function(_0x294470){if(_0x294470){return[_0x294470,![]];}return db[_0x3917('0xa7')]['create']({'UserId':_0xef565f['user']['id'],'ContactId':_0x5bacca['id'],'WhatsappAccountId':_0x557c31['id'],'phone':_0x4ce652,'firstMsgDirection':_0x3917('0xc0'),'Messages':[_['merge'](_0xef565f[_0x3917('0x5d')],{'read':![],'body':_0xef565f[_0x3917('0x5d')][_0x3917('0x5d')],'phone':_0x4ce652,'WhatsappAccountId':_0x557c31['id'],'UserId':_0xef565f[_0x3917('0x5f')]['id'],'ContactId':_0x5bacca['id']})]},{'include':[{'model':db[_0x3917('0x86')],'as':_0x3917('0xc1')}]})[_0x3917('0x34')](function(_0x2d4102){return[_0x2d4102,!![]];});});}})[_0x3917('0x71')](function(_0x50a298,_0x3b53f0){if(_0x3b53f0){return _0x50a298;}return db['WhatsappMessage']['create'](_['merge'](_0xef565f[_0x3917('0x5d')],{'read':![],'body':_0xef565f[_0x3917('0x5d')][_0x3917('0x5d')],'phone':_0x4ce652,'WhatsappAccountId':_0x557c31['id'],'WhatsappInteractionId':_0x50a298['id'],'UserId':_0xef565f[_0x3917('0x5f')]['id'],'ContactId':_0x5bacca['id']}))[_0x3917('0x34')](function(_0x432b28){_0x50a298['dataValues'][_0x3917('0xc1')]=[];_0x50a298[_0x3917('0xc2')]['Messages']['push'](_0x432b28[_0x3917('0xc2')]);return _0x50a298;});})[_0x3917('0x34')](respondWithResult(_0x2fb8c0,null))['catch'](handleError(_0x2fb8c0,null));}; \ No newline at end of file +var _0x21fe=['findAll','rows','show','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','WhatsappAccountId','getDispositions','Disposition','pick','includeAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','ids','addAgents','omit','emit','removeAgents','userWhatsappAccount:remove','getAgents','User','sequelize','Transaction','ISOLATION_LEVELS','WhatsappApplication','findAndCountAll','priority','stack','finally','send','getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','ListId','twilio','from','replace','messageId','notifications','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','contact','WhatsappInteraction','spread','interaction','autoclose','close','*,*,*,*','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','queueId','WhatsappQueue','queue','waitForTheAssignedQueue','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','http','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','WhatsappAccounts','sendStatus','name','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','WhatsappAccount','include'];(function(_0x1c646f,_0x368292){var _0xa49e97=function(_0x239af7){while(--_0x239af7){_0x1c646f['push'](_0x1c646f['shift']());}};_0xa49e97(++_0x368292);}(_0x21fe,0x136));var _0xe21f=function(_0x5e84b4,_0x13dcec){_0x5e84b4=_0x5e84b4-0x0;var _0x4beaa2=_0x21fe[_0x5e84b4];return _0x4beaa2;};'use strict';var emlformat=require(_0xe21f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe21f('0x1'));var jsonpatch=require(_0xe21f('0x2'));var rp=require(_0xe21f('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe21f('0x4'));var util=require(_0xe21f('0x5'));var path=require(_0xe21f('0x6'));var sox=require(_0xe21f('0x7'));var csv=require(_0xe21f('0x8'));var ejs=require(_0xe21f('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe21f('0xa'));var squel=require(_0xe21f('0xb'));var crypto=require(_0xe21f('0xc'));var jsforce=require(_0xe21f('0xd'));var deskjs=require(_0xe21f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe21f('0xf'));var Papa=require(_0xe21f('0x10'));var Redis=require(_0xe21f('0x11'));var authService=require(_0xe21f('0x12'));var qs=require(_0xe21f('0x13'));var as=require(_0xe21f('0x14'));var hardwareService=require(_0xe21f('0x15'));var logger=require(_0xe21f('0x16'))(_0xe21f('0x17'));var utils=require(_0xe21f('0x18'));var config=require(_0xe21f('0x19'));var licenseUtil=require(_0xe21f('0x1a'));var db=require(_0xe21f('0x1b'))['db'];config[_0xe21f('0x1c')]=_[_0xe21f('0x1d')](config[_0xe21f('0x1c')],{'host':_0xe21f('0x1e'),'port':0x18eb});var socket=require(_0xe21f('0x1f'))(new Redis(config[_0xe21f('0x1c')]));require(_0xe21f('0x20'))[_0xe21f('0x21')](socket);var jayson=require(_0xe21f('0x22'));var client=jayson[_0xe21f('0x23')][_0xe21f('0x24')]({'port':0x232c});function respondWithRpcPromise(_0x3b6b91,_0x3eceb4,_0xae0fb5,_0x274734){return new BPromise(function(_0x9d4e10,_0x5270d5){var _0x2b6714=_0x274734||client;return _0x2b6714[_0xe21f('0x25')](_0x3b6b91,_0xae0fb5)[_0xe21f('0x26')](function(_0x4b3394){logger[_0xe21f('0x27')](_0xe21f('0x28'),_0x3eceb4,_0xe21f('0x29'));logger[_0xe21f('0x2a')](_0xe21f('0x2b'),_0x3eceb4,_0xe21f('0x29'),JSON[_0xe21f('0x2c')](_0x4b3394));if(_0x4b3394[_0xe21f('0x2d')]){if(_0x4b3394[_0xe21f('0x2d')][_0xe21f('0x2e')]===0x1f4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x3eceb4,_0x4b3394[_0xe21f('0x2d')][_0xe21f('0x2f')]);return _0x5270d5(_0x4b3394['error']['message']);}logger[_0xe21f('0x2d')]('WhatsappAccount,\x20%s,\x20%s',_0x3eceb4,_0x4b3394[_0xe21f('0x2d')][_0xe21f('0x2f')]);return _0x9d4e10(_0x4b3394['error'][_0xe21f('0x2f')]);}else{logger[_0xe21f('0x27')](_0xe21f('0x28'),_0x3eceb4,'request\x20sent');_0x9d4e10(_0x4b3394[_0xe21f('0x30')][_0xe21f('0x2f')]);}})[_0xe21f('0x31')](function(_0x594ce0){logger[_0xe21f('0x2d')](_0xe21f('0x28'),_0x3eceb4,_0x594ce0);_0x5270d5(_0x594ce0);});});}function respondWithStatusCode(_0x35c280,_0x885c04){_0x885c04=_0x885c04||0xcc;return function(_0x1bd111){if(_0x1bd111){return _0x35c280['sendStatus'](_0x885c04);}return _0x35c280[_0xe21f('0x32')](_0x885c04)[_0xe21f('0x33')]();};}function respondWithResult(_0xe38963,_0x5b9ab7){_0x5b9ab7=_0x5b9ab7||0xc8;return function(_0xf8c0f8){if(_0xf8c0f8){return _0xe38963[_0xe21f('0x32')](_0x5b9ab7)[_0xe21f('0x34')](_0xf8c0f8);}};}function respondWithFilteredResult(_0x18e797,_0x331313){return function(_0x523705){if(_0x523705){var _0x2f6be0=typeof _0x331313[_0xe21f('0x35')]==='undefined'&&typeof _0x331313[_0xe21f('0x36')]==='undefined';var _0x2c9267=_0x523705[_0xe21f('0x37')];var _0x3c42d8=_0x2f6be0?0x0:_0x331313[_0xe21f('0x35')];var _0x28b6a7=_0x2f6be0?_0x523705[_0xe21f('0x37')]:_0x331313['offset']+_0x331313[_0xe21f('0x36')];var _0x54db62;if(_0x28b6a7>=_0x2c9267){_0x28b6a7=_0x2c9267;_0x54db62=0xc8;}else{_0x54db62=0xce;}_0x18e797[_0xe21f('0x32')](_0x54db62);return _0x18e797[_0xe21f('0x38')](_0xe21f('0x39'),_0x3c42d8+'-'+_0x28b6a7+'/'+_0x2c9267)['json'](_0x523705);}return null;};}function patchUpdates(_0x57a011){return function(_0x5b0140){try{jsonpatch[_0xe21f('0x3a')](_0x5b0140,_0x57a011,!![]);}catch(_0x1e0575){return BPromise[_0xe21f('0x3b')](_0x1e0575);}return _0x5b0140[_0xe21f('0x3c')]();};}function saveUpdates(_0xc470c6,_0x350a9c){return function(_0xbea198){if(_0xbea198){return _0xbea198[_0xe21f('0x3d')](_0xc470c6)['then'](function(_0x48c431){return _0x48c431;});}return null;};}function removeEntity(_0x5274e7,_0x32fb7f){return function(_0x4c7766){if(_0x4c7766){return _0x4c7766[_0xe21f('0x3e')]()[_0xe21f('0x26')](function(){var _0x3391e9=_0x4c7766['get']({'plain':!![]});var _0x1347fb=_0xe21f('0x3f');return db['UserProfileResource'][_0xe21f('0x3e')]({'where':{'type':_0x1347fb,'resourceId':_0x3391e9['id']}})[_0xe21f('0x26')](function(){return _0x4c7766;});})[_0xe21f('0x26')](function(){_0x5274e7[_0xe21f('0x32')](0xcc)[_0xe21f('0x33')]();});}};}function handleEntityNotFound(_0x4c5974,_0x59b628){return function(_0x2a5bca){if(!_0x2a5bca){_0x4c5974[_0xe21f('0x40')](0x194);}return _0x2a5bca;};}function handleError(_0x3c9450,_0x9f373a){_0x9f373a=_0x9f373a||0x1f4;return function(_0x3896d5){logger['error'](_0x3896d5['stack']);if(_0x3896d5[_0xe21f('0x41')]){delete _0x3896d5[_0xe21f('0x41')];}_0x3c9450[_0xe21f('0x32')](_0x9f373a)['send'](_0x3896d5);};}exports['index']=function(_0x16fc8d,_0x725552){var _0x5a52c1={'include':[{'model':db[_0xe21f('0x42')],'as':_0xe21f('0x43')}]},_0x1a3695={},_0x2e74cf={'count':0x0,'rows':[]};var _0x12dedd=_['map'](db['WhatsappAccount'][_0xe21f('0x44')],function(_0x635a9f){return{'name':_0x635a9f[_0xe21f('0x45')],'type':_0x635a9f[_0xe21f('0x46')][_0xe21f('0x47')]};});_0x1a3695['model']=_[_0xe21f('0x48')](_0x12dedd,'name');_0x1a3695[_0xe21f('0x49')]=_[_0xe21f('0x4a')](_0x16fc8d[_0xe21f('0x49')]);_0x1a3695['filters']=_[_0xe21f('0x4b')](_0x1a3695[_0xe21f('0x4c')],_0x1a3695[_0xe21f('0x49')]);_0x5a52c1[_0xe21f('0x4d')]=_[_0xe21f('0x4b')](_0x1a3695['model'],qs[_0xe21f('0x4e')](_0x16fc8d['query'][_0xe21f('0x4e')]));_0x5a52c1[_0xe21f('0x4d')]=_0x5a52c1['attributes'][_0xe21f('0x4f')]?_0x5a52c1[_0xe21f('0x4d')]:_0x1a3695[_0xe21f('0x4c')];if(!_0x16fc8d['query'][_0xe21f('0x50')](_0xe21f('0x51'))){_0x5a52c1[_0xe21f('0x36')]=qs[_0xe21f('0x36')](_0x16fc8d[_0xe21f('0x49')]['limit']);_0x5a52c1[_0xe21f('0x35')]=qs['offset'](_0x16fc8d[_0xe21f('0x49')]['offset']);}_0x5a52c1[_0xe21f('0x52')]=qs[_0xe21f('0x53')](_0x16fc8d['query'][_0xe21f('0x53')]);_0x5a52c1[_0xe21f('0x54')]=qs[_0xe21f('0x55')](_['pick'](_0x16fc8d['query'],_0x1a3695[_0xe21f('0x55')]),_0x12dedd);if(_0x16fc8d[_0xe21f('0x49')][_0xe21f('0x56')]){_0x5a52c1['where']=_[_0xe21f('0x57')](_0x5a52c1[_0xe21f('0x54')],{'$or':_[_0xe21f('0x48')](_0x12dedd,function(_0x496adc){if(_0x496adc[_0xe21f('0x46')]!==_0xe21f('0x58')){var _0xa15088={};_0xa15088[_0x496adc[_0xe21f('0x41')]]={'$like':'%'+_0x16fc8d[_0xe21f('0x49')][_0xe21f('0x56')]+'%'};return _0xa15088;}})});}_0x5a52c1=_[_0xe21f('0x57')]({},_0x5a52c1,_0x16fc8d[_0xe21f('0x59')]);var _0x1e6284={'where':_0x5a52c1[_0xe21f('0x54')]};return db[_0xe21f('0x5a')][_0xe21f('0x37')](_0x1e6284)[_0xe21f('0x26')](function(_0x33ce50){_0x2e74cf['count']=_0x33ce50;if(_0x16fc8d[_0xe21f('0x49')]['includeAll']){_0x5a52c1[_0xe21f('0x5b')]=[{'all':!![]}];}return db[_0xe21f('0x5a')][_0xe21f('0x5c')](_0x5a52c1);})[_0xe21f('0x26')](function(_0x5688b9){_0x2e74cf[_0xe21f('0x5d')]=_0x5688b9;return _0x2e74cf;})[_0xe21f('0x26')](respondWithFilteredResult(_0x725552,_0x5a52c1))[_0xe21f('0x31')](handleError(_0x725552,null));};exports[_0xe21f('0x5e')]=function(_0x394310,_0x1fa522){var _0x8ae616={'raw':![],'where':{'id':_0x394310['params']['id']},'include':[{'model':db[_0xe21f('0x42')],'as':'mandatoryDispositionPause'}]},_0x4a7ebc={};_0x4a7ebc['model']=_[_0xe21f('0x4a')](db['WhatsappAccount']['rawAttributes']);_0x4a7ebc[_0xe21f('0x49')]=_[_0xe21f('0x4a')](_0x394310['query']);_0x4a7ebc[_0xe21f('0x55')]=_[_0xe21f('0x4b')](_0x4a7ebc['model'],_0x4a7ebc[_0xe21f('0x49')]);_0x8ae616['attributes']=_['intersection'](_0x4a7ebc['model'],qs[_0xe21f('0x4e')](_0x394310[_0xe21f('0x49')]['fields']));_0x8ae616[_0xe21f('0x4d')]=_0x8ae616[_0xe21f('0x4d')]['length']?_0x8ae616['attributes']:_0x4a7ebc['model'];if(_0x394310[_0xe21f('0x49')]['includeAll']){_0x8ae616[_0xe21f('0x5b')]=[{'all':!![]}];}_0x8ae616=_[_0xe21f('0x57')]({},_0x8ae616,_0x394310[_0xe21f('0x59')]);return db['WhatsappAccount']['find'](_0x8ae616)[_0xe21f('0x26')](handleEntityNotFound(_0x1fa522,null))['then'](respondWithResult(_0x1fa522,null))[_0xe21f('0x31')](handleError(_0x1fa522,null));};exports[_0xe21f('0x5f')]=function(_0x255058,_0x229494){return db['WhatsappAccount'][_0xe21f('0x5f')](_0x255058['body'],{})[_0xe21f('0x26')](function(_0x16c80e){var _0x1896dd=_0x255058[_0xe21f('0x60')][_0xe21f('0x61')]({'plain':!![]});if(!_0x1896dd)throw new Error(_0xe21f('0x62'));if(_0x1896dd['role']===_0xe21f('0x60')){var _0x5a3851=_0x16c80e[_0xe21f('0x61')]({'plain':!![]});var _0x427c9e='WhatsappAccounts';return db[_0xe21f('0x63')][_0xe21f('0x64')]({'where':{'name':_0x427c9e,'userProfileId':_0x1896dd[_0xe21f('0x65')]},'raw':!![]})['then'](function(_0x2f657c){if(_0x2f657c&&_0x2f657c['autoAssociation']===0x0){return db[_0xe21f('0x66')][_0xe21f('0x5f')]({'name':_0x5a3851[_0xe21f('0x41')],'resourceId':_0x5a3851['id'],'type':_0x2f657c['name'],'sectionId':_0x2f657c['id']},{})['then'](function(){return _0x16c80e;});}else{return _0x16c80e;}})[_0xe21f('0x31')](function(_0x470093){logger[_0xe21f('0x2d')](_0xe21f('0x67'),_0x470093);throw _0x470093;});}return _0x16c80e;})['then'](respondWithResult(_0x229494,0xc9))[_0xe21f('0x31')](handleError(_0x229494,null));};exports[_0xe21f('0x3d')]=function(_0x481f83,_0x5e739){if(_0x481f83[_0xe21f('0x68')]['id']){delete _0x481f83[_0xe21f('0x68')]['id'];}return db[_0xe21f('0x5a')][_0xe21f('0x64')]({'where':{'id':_0x481f83['params']['id']},'include':[{'model':db[_0xe21f('0x42')],'as':_0xe21f('0x43')}]})[_0xe21f('0x26')](handleEntityNotFound(_0x5e739,null))['then'](saveUpdates(_0x481f83[_0xe21f('0x68')],null))[_0xe21f('0x26')](respondWithResult(_0x5e739,null))[_0xe21f('0x31')](handleError(_0x5e739,null));};exports['destroy']=function(_0x205a43,_0x5e475c){return db[_0xe21f('0x5a')][_0xe21f('0x64')]({'where':{'id':_0x205a43[_0xe21f('0x69')]['id']}})[_0xe21f('0x26')](handleEntityNotFound(_0x5e475c,null))['then'](removeEntity(_0x5e475c,null))[_0xe21f('0x31')](handleError(_0x5e475c,null));};exports['describe']=function(_0x48f252,_0x3eb3e7){return db[_0xe21f('0x5a')][_0xe21f('0x6a')]()[_0xe21f('0x26')](respondWithResult(_0x3eb3e7,null))[_0xe21f('0x31')](handleError(_0x3eb3e7,null));};exports[_0xe21f('0x6b')]=function(_0x27bc51,_0xb602ef,_0x1a03d3){if(_0x27bc51[_0xe21f('0x68')]['id']){delete _0x27bc51[_0xe21f('0x68')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x27bc51[_0xe21f('0x69')]['id']}})[_0xe21f('0x26')](handleEntityNotFound(_0xb602ef,null))['then'](function(_0x39fc47){if(_0x39fc47){_0x27bc51[_0xe21f('0x68')][_0xe21f('0x6c')]=_0x39fc47['id'];return db['Disposition'][_0xe21f('0x5f')](_0x27bc51[_0xe21f('0x68')]);}})[_0xe21f('0x26')](respondWithResult(_0xb602ef,null))[_0xe21f('0x31')](handleError(_0xb602ef,null));};exports[_0xe21f('0x6d')]=function(_0x4cfa3a,_0x19ba8e,_0x55e316){var _0x19f3b6={'raw':![],'where':{}};var _0x151e26={};var _0x4a91a0={'count':0x0,'rows':[]};return db[_0xe21f('0x5a')]['findOne']({'where':{'id':_0x4cfa3a[_0xe21f('0x69')]['id']}})[_0xe21f('0x26')](handleEntityNotFound(_0x19ba8e,null))[_0xe21f('0x26')](function(_0x3d1618){if(_0x3d1618){_0x151e26[_0xe21f('0x4c')]=_[_0xe21f('0x4a')](db[_0xe21f('0x6e')][_0xe21f('0x44')]);_0x151e26['query']=_['keys'](_0x4cfa3a[_0xe21f('0x49')]);_0x151e26[_0xe21f('0x55')]=_['intersection'](_0x151e26[_0xe21f('0x4c')],_0x151e26[_0xe21f('0x49')]);_0x19f3b6[_0xe21f('0x4d')]=_[_0xe21f('0x4b')](_0x151e26[_0xe21f('0x4c')],qs[_0xe21f('0x4e')](_0x4cfa3a['query'][_0xe21f('0x4e')]));_0x19f3b6[_0xe21f('0x4d')]=_0x19f3b6[_0xe21f('0x4d')][_0xe21f('0x4f')]?_0x19f3b6['attributes']:_0x151e26[_0xe21f('0x4c')];if(!_0x4cfa3a['query'][_0xe21f('0x50')](_0xe21f('0x51'))){_0x19f3b6[_0xe21f('0x36')]=qs[_0xe21f('0x36')](_0x4cfa3a[_0xe21f('0x49')][_0xe21f('0x36')]);_0x19f3b6[_0xe21f('0x35')]=qs[_0xe21f('0x35')](_0x4cfa3a[_0xe21f('0x49')][_0xe21f('0x35')]);}_0x19f3b6['order']=qs[_0xe21f('0x53')](_0x4cfa3a[_0xe21f('0x49')][_0xe21f('0x53')]);_0x19f3b6[_0xe21f('0x54')]=qs[_0xe21f('0x55')](_[_0xe21f('0x6f')](_0x4cfa3a[_0xe21f('0x49')],_0x151e26[_0xe21f('0x55')]));_0x19f3b6[_0xe21f('0x54')][_0xe21f('0x6c')]=_0x3d1618['id'];if(_0x4cfa3a[_0xe21f('0x49')][_0xe21f('0x56')]){_0x19f3b6[_0xe21f('0x54')]=_[_0xe21f('0x57')](_0x19f3b6[_0xe21f('0x54')],{'$or':_['map'](_0x19f3b6['attributes'],function(_0x2a6f62){var _0x396a55={};_0x396a55[_0x2a6f62]={'$like':'%'+_0x4cfa3a[_0xe21f('0x49')][_0xe21f('0x56')]+'%'};return _0x396a55;})});}_0x19f3b6=_['merge']({},_0x19f3b6,_0x4cfa3a['options']);return db[_0xe21f('0x6e')]['count']({'where':_0x19f3b6['where']})[_0xe21f('0x26')](function(_0x90c914){_0x4a91a0[_0xe21f('0x37')]=_0x90c914;if(_0x4cfa3a[_0xe21f('0x49')][_0xe21f('0x70')]){_0x19f3b6[_0xe21f('0x5b')]=[{'all':!![]}];}return db[_0xe21f('0x6e')][_0xe21f('0x5c')](_0x19f3b6);})[_0xe21f('0x26')](function(_0x3b8c2d){_0x4a91a0[_0xe21f('0x5d')]=_0x3b8c2d;return _0x4a91a0;});}})[_0xe21f('0x26')](respondWithFilteredResult(_0x19ba8e,_0x19f3b6))['catch'](handleError(_0x19ba8e,null));};exports[_0xe21f('0x71')]=function(_0x190303,_0x456fed,_0x1ee16e){return db[_0xe21f('0x5a')][_0xe21f('0x64')]({'where':{'id':_0x190303[_0xe21f('0x69')]['id']}})[_0xe21f('0x26')](handleEntityNotFound(_0x456fed,null))['then'](function(_0x2f7bdc){if(_0x2f7bdc){return _0x2f7bdc[_0xe21f('0x71')](_0x190303['query']['ids']);}})[_0xe21f('0x26')](respondWithStatusCode(_0x456fed,null))['catch'](handleError(_0x456fed,null));};exports[_0xe21f('0x72')]=function(_0x16b29d,_0x587550,_0x18a121){if(_0x16b29d['body']['id']){delete _0x16b29d[_0xe21f('0x68')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x16b29d[_0xe21f('0x69')]['id']}})[_0xe21f('0x26')](handleEntityNotFound(_0x587550,null))[_0xe21f('0x26')](function(_0x5a6fa1){if(_0x5a6fa1){_0x16b29d[_0xe21f('0x68')][_0xe21f('0x6c')]=_0x5a6fa1['id'];return db[_0xe21f('0x73')][_0xe21f('0x5f')](_0x16b29d['body']);}})['then'](respondWithResult(_0x587550,null))[_0xe21f('0x31')](handleError(_0x587550,null));};exports[_0xe21f('0x74')]=function(_0x22639f,_0x4ee33c,_0x280eb2){var _0xe3ae4a={'raw':![],'where':{}};var _0x5eb7be={};var _0x4ee6de={'count':0x0,'rows':[]};return db[_0xe21f('0x5a')][_0xe21f('0x75')]({'where':{'id':_0x22639f[_0xe21f('0x69')]['id']}})['then'](handleEntityNotFound(_0x4ee33c,null))[_0xe21f('0x26')](function(_0x17a042){if(_0x17a042){_0x5eb7be[_0xe21f('0x4c')]=_[_0xe21f('0x4a')](db[_0xe21f('0x73')][_0xe21f('0x44')]);_0x5eb7be[_0xe21f('0x49')]=_[_0xe21f('0x4a')](_0x22639f[_0xe21f('0x49')]);_0x5eb7be[_0xe21f('0x55')]=_['intersection'](_0x5eb7be['model'],_0x5eb7be['query']);_0xe3ae4a['attributes']=_[_0xe21f('0x4b')](_0x5eb7be['model'],qs['fields'](_0x22639f[_0xe21f('0x49')][_0xe21f('0x4e')]));_0xe3ae4a[_0xe21f('0x4d')]=_0xe3ae4a['attributes'][_0xe21f('0x4f')]?_0xe3ae4a[_0xe21f('0x4d')]:_0x5eb7be[_0xe21f('0x4c')];if(!_0x22639f[_0xe21f('0x49')][_0xe21f('0x50')](_0xe21f('0x51'))){_0xe3ae4a['limit']=qs['limit'](_0x22639f[_0xe21f('0x49')][_0xe21f('0x36')]);_0xe3ae4a[_0xe21f('0x35')]=qs[_0xe21f('0x35')](_0x22639f[_0xe21f('0x49')][_0xe21f('0x35')]);}_0xe3ae4a[_0xe21f('0x52')]=qs[_0xe21f('0x53')](_0x22639f['query'][_0xe21f('0x53')]);_0xe3ae4a[_0xe21f('0x54')]=qs[_0xe21f('0x55')](_[_0xe21f('0x6f')](_0x22639f[_0xe21f('0x49')],_0x5eb7be[_0xe21f('0x55')]));_0xe3ae4a[_0xe21f('0x54')][_0xe21f('0x6c')]=_0x17a042['id'];if(_0x22639f[_0xe21f('0x49')][_0xe21f('0x56')]){_0xe3ae4a[_0xe21f('0x54')]=_['merge'](_0xe3ae4a[_0xe21f('0x54')],{'$or':_['map'](_0xe3ae4a[_0xe21f('0x4d')],function(_0x3933ca){var _0x3b6d82={};_0x3b6d82[_0x3933ca]={'$like':'%'+_0x22639f[_0xe21f('0x49')][_0xe21f('0x56')]+'%'};return _0x3b6d82;})});}_0xe3ae4a=_[_0xe21f('0x57')]({},_0xe3ae4a,_0x22639f[_0xe21f('0x59')]);return db[_0xe21f('0x73')][_0xe21f('0x37')]({'where':_0xe3ae4a['where']})[_0xe21f('0x26')](function(_0x452da7){_0x4ee6de[_0xe21f('0x37')]=_0x452da7;if(_0x22639f[_0xe21f('0x49')][_0xe21f('0x70')]){_0xe3ae4a[_0xe21f('0x5b')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe21f('0x5c')](_0xe3ae4a);})[_0xe21f('0x26')](function(_0x285fe3){_0x4ee6de['rows']=_0x285fe3;return _0x4ee6de;});}})[_0xe21f('0x26')](respondWithFilteredResult(_0x4ee33c,_0xe3ae4a))[_0xe21f('0x31')](handleError(_0x4ee33c,null));};exports[_0xe21f('0x76')]=function(_0x42cc47,_0x3f441e,_0x4d2366){return db[_0xe21f('0x5a')][_0xe21f('0x64')]({'where':{'id':_0x42cc47[_0xe21f('0x69')]['id']}})['then'](handleEntityNotFound(_0x3f441e,null))[_0xe21f('0x26')](function(_0x1ccf1d){if(_0x1ccf1d){return _0x1ccf1d['removeAnswers'](_0x42cc47[_0xe21f('0x49')][_0xe21f('0x77')]);}})['then'](respondWithStatusCode(_0x3f441e,null))[_0xe21f('0x31')](handleError(_0x3f441e,null));};exports[_0xe21f('0x78')]=function(_0x55090c,_0x198a4f,_0x1cba8d){return db['WhatsappAccount'][_0xe21f('0x64')]({'where':{'id':_0x55090c[_0xe21f('0x69')]['id']}})['then'](handleEntityNotFound(_0x198a4f,null))[_0xe21f('0x26')](function(_0x49722e){if(_0x49722e){return _0x49722e[_0xe21f('0x78')](_0x55090c[_0xe21f('0x68')]['ids'],_[_0xe21f('0x79')](_0x55090c[_0xe21f('0x68')],['ids','id'])||{})['spread'](function(_0x3b53f3){for(var _0x1f84c4=0x0;_0x1f84c4<_0x55090c[_0xe21f('0x68')][_0xe21f('0x77')]['length'];_0x1f84c4+=0x1){socket[_0xe21f('0x7a')]('userWhatsappAccount:save',{'UserId':Number(_0x55090c['body']['ids'][_0x1f84c4]),'WhatsappAccountId':Number(_0x55090c[_0xe21f('0x69')]['id'])});}return _0x3b53f3;});}})[_0xe21f('0x26')](respondWithResult(_0x198a4f,null))[_0xe21f('0x31')](handleError(_0x198a4f,null));};exports['removeAgents']=function(_0x5078c8,_0xec96df,_0xf9d381){return db[_0xe21f('0x5a')][_0xe21f('0x64')]({'where':{'id':_0x5078c8[_0xe21f('0x69')]['id']}})['then'](handleEntityNotFound(_0xec96df,null))[_0xe21f('0x26')](function(_0x359e41){if(_0x359e41){return _0x359e41[_0xe21f('0x7b')](_0x5078c8[_0xe21f('0x49')][_0xe21f('0x77')])['then'](function(){if(_['isArray'](_0x5078c8[_0xe21f('0x49')][_0xe21f('0x77')])){for(var _0x33851e=0x0;_0x33851e<_0x5078c8[_0xe21f('0x49')][_0xe21f('0x77')]['length'];_0x33851e+=0x1){socket[_0xe21f('0x7a')]('userWhatsappAccount:remove',{'UserId':Number(_0x5078c8['query'][_0xe21f('0x77')][_0x33851e]),'WhatsappAccountId':Number(_0x5078c8[_0xe21f('0x69')]['id'])});}}else{socket[_0xe21f('0x7a')](_0xe21f('0x7c'),{'UserId':Number(_0x5078c8[_0xe21f('0x49')]['ids']),'WhatsappAccountId':Number(_0x5078c8[_0xe21f('0x69')]['id'])});}});}})['then'](respondWithStatusCode(_0xec96df,null))[_0xe21f('0x31')](handleError(_0xec96df,null));};exports[_0xe21f('0x7d')]=function(_0xe9973f,_0x34b7cc,_0x3bb4e8){var _0x4aad2b={};var _0x5808bb={};var _0x261bfc;var _0x47efab;return db[_0xe21f('0x5a')][_0xe21f('0x75')]({'where':{'id':_0xe9973f[_0xe21f('0x69')]['id']}})[_0xe21f('0x26')](handleEntityNotFound(_0x34b7cc,null))[_0xe21f('0x26')](function(_0x296b14){if(_0x296b14){_0x261bfc=_0x296b14;_0x5808bb['model']=_[_0xe21f('0x4a')](db[_0xe21f('0x7e')][_0xe21f('0x44')]);_0x5808bb[_0xe21f('0x49')]=_['keys'](_0xe9973f[_0xe21f('0x49')]);_0x5808bb['filters']=_[_0xe21f('0x4b')](_0x5808bb[_0xe21f('0x4c')],_0x5808bb[_0xe21f('0x49')]);_0x4aad2b[_0xe21f('0x4d')]=_[_0xe21f('0x4b')](_0x5808bb[_0xe21f('0x4c')],qs[_0xe21f('0x4e')](_0xe9973f['query'][_0xe21f('0x4e')]));_0x4aad2b['attributes']=_0x4aad2b['attributes'][_0xe21f('0x4f')]?_0x4aad2b[_0xe21f('0x4d')]:_0x5808bb[_0xe21f('0x4c')];_0x4aad2b[_0xe21f('0x52')]=qs[_0xe21f('0x53')](_0xe9973f[_0xe21f('0x49')][_0xe21f('0x53')]);_0x4aad2b[_0xe21f('0x54')]=qs[_0xe21f('0x55')](_[_0xe21f('0x6f')](_0xe9973f[_0xe21f('0x49')],_0x5808bb[_0xe21f('0x55')]));if(_0xe9973f[_0xe21f('0x49')][_0xe21f('0x56')]){_0x4aad2b[_0xe21f('0x54')]=_[_0xe21f('0x57')](_0x4aad2b[_0xe21f('0x54')],{'$or':_['map'](_0x4aad2b[_0xe21f('0x4d')],function(_0x241e1a){var _0x1a3505={};_0x1a3505[_0x241e1a]={'$like':'%'+_0xe9973f[_0xe21f('0x49')][_0xe21f('0x56')]+'%'};return _0x1a3505;})});}_0x4aad2b=_[_0xe21f('0x57')]({},_0x4aad2b,_0xe9973f[_0xe21f('0x59')]);return _0x261bfc['getAgents'](_0x4aad2b);}})['then'](function(_0x117a94){if(_0x117a94){_0x47efab=_0x117a94['length'];if(!_0xe9973f[_0xe21f('0x49')][_0xe21f('0x50')]('nolimit')){_0x4aad2b[_0xe21f('0x36')]=qs['limit'](_0xe9973f[_0xe21f('0x49')][_0xe21f('0x36')]);_0x4aad2b[_0xe21f('0x35')]=qs[_0xe21f('0x35')](_0xe9973f[_0xe21f('0x49')][_0xe21f('0x35')]);}return _0x261bfc[_0xe21f('0x7d')](_0x4aad2b);}})[_0xe21f('0x26')](function(_0x524260){if(_0x524260){return _0x524260?{'count':_0x47efab,'rows':_0x524260}:null;}})[_0xe21f('0x26')](respondWithResult(_0x34b7cc,null))[_0xe21f('0x31')](handleError(_0x34b7cc,null));};exports['addApplications']=function(_0x2f2a4e,_0x48b66d){var _0x29c9df=_0x2f2a4e[_0xe21f('0x69')]['id'];var _0x16d1cd=_0x2f2a4e[_0xe21f('0x68')];var _0xacb149=0xc8;var _0x59facc=null;return db[_0xe21f('0x7f')]['transaction']({'isolationLevel':db['sequelize'][_0xe21f('0x80')][_0xe21f('0x81')]['READ_COMMITTED']},function(_0x141515){return db[_0xe21f('0x5a')][_0xe21f('0x75')]({'where':{'id':_0x29c9df},'transaction':_0x141515})[_0xe21f('0x26')](function(_0x4526e4){if(_0x4526e4){return db[_0xe21f('0x82')][_0xe21f('0x3e')]({'where':{'WhatsappAccountId':_0x29c9df},'transaction':_0x141515})[_0xe21f('0x26')](function(){var _0x45a4cc=_['map'](_0x16d1cd,function(_0x2c5c53){_0x2c5c53[_0xe21f('0x6c')]=_0x29c9df;return _0x2c5c53;});return db[_0xe21f('0x82')]['bulkCreate'](_0x45a4cc,{'transaction':_0x141515});});}else{_0xacb149=0x194;_0x59facc=[];}});})[_0xe21f('0x26')](function(){if(_0xacb149!==0x194){return db[_0xe21f('0x82')][_0xe21f('0x83')]({'where':{'WhatsappAccountId':_0x29c9df},'order':_0xe21f('0x84')})[_0xe21f('0x26')](function(_0x28b8a8){_0x59facc=_0x28b8a8;});}})[_0xe21f('0x31')](function(_0x2aa1a7){_0xacb149=0x1f4;logger[_0xe21f('0x2d')](_0x2aa1a7[_0xe21f('0x85')]);if(_0x2aa1a7[_0xe21f('0x41')]){delete _0x2aa1a7[_0xe21f('0x41')];}_0x59facc=_0x2aa1a7;})[_0xe21f('0x86')](function(){if(_0x59facc===null){_0x48b66d['sendStatus'](_0xacb149);}else{if(_0xacb149===0x1f4){_0x48b66d[_0xe21f('0x32')](_0xacb149)[_0xe21f('0x87')](_0x59facc);}else{_0x48b66d['status'](_0xacb149)['json'](_0x59facc);}}});};exports[_0xe21f('0x88')]=function(_0x10bc74,_0x2e8a40,_0x1abb60){var _0x382579={};var _0x4d1e95={};var _0x419ca7;var _0x40450a;return db['WhatsappAccount'][_0xe21f('0x75')]({'where':{'id':_0x10bc74[_0xe21f('0x69')]['id']}})[_0xe21f('0x26')](handleEntityNotFound(_0x2e8a40,null))[_0xe21f('0x26')](function(_0x48f533){if(_0x48f533){_0x419ca7=_0x48f533;_0x4d1e95[_0xe21f('0x4c')]=_[_0xe21f('0x4a')](db[_0xe21f('0x82')][_0xe21f('0x44')]);_0x4d1e95[_0xe21f('0x49')]=_[_0xe21f('0x4a')](_0x10bc74[_0xe21f('0x49')]);_0x4d1e95[_0xe21f('0x55')]=_[_0xe21f('0x4b')](_0x4d1e95['model'],_0x4d1e95[_0xe21f('0x49')]);_0x382579[_0xe21f('0x4d')]=_[_0xe21f('0x4b')](_0x4d1e95['model'],qs['fields'](_0x10bc74['query'][_0xe21f('0x4e')]));_0x382579[_0xe21f('0x4d')]=_0x382579['attributes'][_0xe21f('0x4f')]?_0x382579[_0xe21f('0x4d')]:_0x4d1e95[_0xe21f('0x4c')];_0x382579['order']=qs[_0xe21f('0x53')](_0x10bc74['query'][_0xe21f('0x53')]);_0x382579[_0xe21f('0x54')]=qs[_0xe21f('0x55')](_['pick'](_0x10bc74[_0xe21f('0x49')],_0x4d1e95['filters']));if(_0x10bc74[_0xe21f('0x49')]['filter']){_0x382579[_0xe21f('0x54')]=_[_0xe21f('0x57')](_0x382579[_0xe21f('0x54')],{'$or':_[_0xe21f('0x48')](_0x382579[_0xe21f('0x4d')],function(_0x595a18){var _0x43ccbc={};_0x43ccbc[_0x595a18]={'$like':'%'+_0x10bc74[_0xe21f('0x49')]['filter']+'%'};return _0x43ccbc;})});}_0x382579=_[_0xe21f('0x57')]({},_0x382579,_0x10bc74['options']);return _0x419ca7['getApplications'](_0x382579);}})[_0xe21f('0x26')](function(_0x4cf054){if(_0x4cf054){_0x40450a=_0x4cf054[_0xe21f('0x4f')];if(!_0x10bc74[_0xe21f('0x49')][_0xe21f('0x50')](_0xe21f('0x51'))){_0x382579['limit']=qs[_0xe21f('0x36')](_0x10bc74['query'][_0xe21f('0x36')]);_0x382579[_0xe21f('0x35')]=qs[_0xe21f('0x35')](_0x10bc74[_0xe21f('0x49')][_0xe21f('0x35')]);}return _0x419ca7[_0xe21f('0x88')](_0x382579);}})[_0xe21f('0x26')](function(_0x3f686f){if(_0x3f686f){return _0x3f686f?{'count':_0x40450a,'rows':_0x3f686f}:null;}})['then'](respondWithResult(_0x2e8a40,null))['catch'](handleError(_0x2e8a40,null));};exports[_0xe21f('0x89')]=function(_0x361ffd,_0x1518bd,_0x44244f){var _0x24e433={'channel':_0xe21f('0x8a')};var _0x5a84f7=[];var _0x3aae92=[];var _0x2d3a2a={};return db[_0xe21f('0x5a')][_0xe21f('0x64')]({'where':{'id':_0x361ffd[_0xe21f('0x69')]['id']},'include':[{'model':db[_0xe21f('0x82')],'as':_0xe21f('0x8b')}]})[_0xe21f('0x26')](handleEntityNotFound(_0x1518bd,null))[_0xe21f('0x26')](function(_0x42e5e6){_0x24e433[_0xe21f('0x8c')]=_0x42e5e6;if(_0x24e433[_0xe21f('0x8c')]&&_0x24e433[_0xe21f('0x8c')]['type']===_0xe21f('0x8d')&&_0x361ffd[_0xe21f('0x68')][_0xe21f('0x8e')]){if(_0x361ffd[_0xe21f('0x68')][_0xe21f('0x8e')][_0xe21f('0x4f')]===0x0)return;if(_0x361ffd[_0xe21f('0x68')][_0xe21f('0x8e')][0x0][_0xe21f('0x8f')]!=='read')return;return db['WhatsappMessage'][_0xe21f('0x3d')]({'read':!![],'readAt':_0x361ffd[_0xe21f('0x68')][_0xe21f('0x8e')][0x0][_0xe21f('0x90')]},{'where':{'messageId':_0x361ffd['body'][_0xe21f('0x8e')][0x0][_0xe21f('0x91')]},'individualHooks':!![]})[_0xe21f('0x26')](function(_0x2bd865){return _0x1518bd['status'](0xc8)[_0xe21f('0x34')](_0x2bd865);});}_0x24e433[_0xe21f('0x92')]=_[_0xe21f('0x93')](_0x42e5e6[_0xe21f('0x8b')],['priority'],[_0xe21f('0x94')]);if(_0x24e433[_0xe21f('0x8c')][_0xe21f('0x8b')]){delete _0x24e433[_0xe21f('0x8c')][_0xe21f('0x8b')];}return db[_0xe21f('0x95')][_0xe21f('0x6a')]()[_0xe21f('0x26')](function(_0x2713b6){if(!_0x2713b6){throw new db[(_0xe21f('0x96'))][(_0xe21f('0x97'))](_0xe21f('0x98'));}_0x5a84f7=_[_0xe21f('0x99')](_[_0xe21f('0x4a')](_0x2713b6),[_0xe21f('0x9a'),'updatedAt']);_0x3aae92=_[_0xe21f('0x99')](_[_0xe21f('0x4a')](_0x2713b6),[_0xe21f('0x9a'),'updatedAt','CompanyId',_0xe21f('0x9b')]);_0x24e433[_0xe21f('0x68')]={'mapKey':'mobile'};if(_0x24e433[_0xe21f('0x8c')]&&_0x24e433[_0xe21f('0x8c')][_0xe21f('0x46')]===_0xe21f('0x9c')){_0x24e433[_0xe21f('0x68')][_0xe21f('0x9d')]=_0x361ffd[_0xe21f('0x68')]['From'][_0xe21f('0x9e')]('whatsapp:','');_0x24e433[_0xe21f('0x68')]['body']=_0x361ffd[_0xe21f('0x68')]['Body'];_0x24e433['body'][_0xe21f('0x9f')]=_0x361ffd['body']['MessageSid'];}if(_0x24e433[_0xe21f('0x8c')]&&_0x24e433[_0xe21f('0x8c')][_0xe21f('0x46')]===_0xe21f('0x8d')){_0x24e433[_0xe21f('0x68')][_0xe21f('0x9d')]=_0x361ffd[_0xe21f('0x68')][_0xe21f('0xa0')][0x0][_0xe21f('0x9d')];_0x24e433[_0xe21f('0x68')]['body']=_0x361ffd['body'][_0xe21f('0xa0')][0x0]['message']['body'];_0x24e433[_0xe21f('0x68')][_0xe21f('0x9f')]=_0x361ffd[_0xe21f('0x68')][_0xe21f('0xa0')][0x0]['message_id'];}if(_0x24e433[_0xe21f('0x68')]['id']){delete _0x24e433[_0xe21f('0x68')]['id'];}if(_[_0xe21f('0xa1')](_0x24e433[_0xe21f('0x68')][_0xe21f('0x9d')])){throw new db[(_0xe21f('0x96'))][(_0xe21f('0x97'))]('from\x20is\x20mandatory');}if(_[_0xe21f('0xa1')](_0x24e433[_0xe21f('0x68')][_0xe21f('0x68')])||_0x24e433[_0xe21f('0x68')][_0xe21f('0x68')]===''){throw new db[(_0xe21f('0x96'))]['ValidationError'](_0xe21f('0xa2'));}if(_['isNil'](_0x24e433[_0xe21f('0x68')][_0xe21f('0xa3')])){throw new db['Sequelize'][(_0xe21f('0x97'))](_0xe21f('0xa4')+_0x3aae92);}if(!_[_0xe21f('0xa5')](_0x3aae92,_0x24e433[_0xe21f('0x68')][_0xe21f('0xa3')])){throw new db[(_0xe21f('0x96'))][(_0xe21f('0x97'))](_0xe21f('0xa6')+_0x3aae92);}_0x2d3a2a[_0x24e433[_0xe21f('0x68')][_0xe21f('0xa3')]]=_0x24e433[_0xe21f('0x68')]['from'];return db[_0xe21f('0xa7')][_0xe21f('0x64')]({'where':{'id':_0x24e433[_0xe21f('0x8c')][_0xe21f('0x9b')]},'include':[{'model':db['CmContact'],'as':_0xe21f('0xa8'),'where':_0x2d3a2a,'limit':0x1,'order':[[_0xe21f('0xa9'),_0xe21f('0xaa')]]}]});})[_0xe21f('0x26')](handleEntityNotFound(_0x1518bd,null))['then'](function(_0x4376ee){if(_0x4376ee){_0x24e433['list']=_[_0xe21f('0x79')](_0x4376ee,[_0xe21f('0xa8')]);if(_0x4376ee[_0xe21f('0xa8')][_0xe21f('0x4f')]){return _0x4376ee['Contacts'][0x0];}var _0x930dd9=_[_0xe21f('0x1d')](_0x24e433[_0xe21f('0x68')],{'firstName':_0x24e433['body'][_0xe21f('0x9d')],'ListId':_0x4376ee['id']});_0x930dd9[_0x24e433[_0xe21f('0x68')][_0xe21f('0xa3')]]=_0x24e433[_0xe21f('0x68')][_0xe21f('0x9d')];return db[_0xe21f('0x95')][_0xe21f('0x5f')](_0x930dd9,{'fields':_0x5a84f7,'raw':!![]});}})['then'](handleEntityNotFound(_0x1518bd,null))['then'](function(_0x5c1d2b){if(_0x5c1d2b){_0x24e433[_0xe21f('0xab')]=_0x5c1d2b;var _0xc48c78={'ContactId':_0x5c1d2b['id'],'phone':_0x24e433[_0xe21f('0x68')][_0xe21f('0x9d')],'WhatsappAccountId':_0x361ffd[_0xe21f('0x69')]['id']};var _0x1b7fcd={'ContactId':_0x5c1d2b['id'],'WhatsappAccountId':_0x361ffd[_0xe21f('0x69')]['id'],'closed':![]};return db[_0xe21f('0xac')][_0xe21f('0x64')]({'where':_0x1b7fcd})[_0xe21f('0x26')](function(_0x1681af){if(_0x1681af){return[_0x1681af,![]];}return db[_0xe21f('0xac')]['create'](_0xc48c78)[_0xe21f('0x26')](function(_0x35bee1){return[_0x35bee1,!![]];});});}})[_0xe21f('0xad')](function(_0x2ffccc,_0x4fc6ce){_0x24e433[_0xe21f('0xae')]=_0x2ffccc['get']({'plain':!![]});_0x24e433[_0xe21f('0xae')]['created']=![];if(_0x4fc6ce){if(_0x24e433[_0xe21f('0x8c')][_0xe21f('0xaf')]){_0x24e433[_0xe21f('0x92')]['push']({'id':0x0,'priority':_0x24e433['applications']['length']+0x1,'app':_0xe21f('0xb0'),'appdata':'unmanaged','interval':_0xe21f('0xb1')});}_0x24e433['interaction']['created']=!![];}return db[_0xe21f('0xb2')][_0xe21f('0x5f')]({'phone':_0x24e433['body'][_0xe21f('0x9d')],'messageId':_0x24e433[_0xe21f('0x68')]['messageId'],'body':_0x24e433[_0xe21f('0x68')]['body'],'WhatsappAccountId':_0x361ffd[_0xe21f('0x69')]['id'],'WhatsappInteractionId':_0x2ffccc['id'],'direction':'in','ContactId':_0x2ffccc[_0xe21f('0xb3')],'AttachmentId':_0x24e433[_0xe21f('0x68')][_0xe21f('0xb4')]});})[_0xe21f('0x26')](function(_0x2bd4c0){_0x24e433[_0xe21f('0x2f')]=_0x2bd4c0;if(!_0x24e433['interaction'][_0xe21f('0xb5')])return;return db[_0xe21f('0x7e')]['find']({'attributes':['id',_0xe21f('0x41')],'where':{'id':_0x24e433[_0xe21f('0xae')][_0xe21f('0xb5')]}});})[_0xe21f('0x26')](function(_0x5b2616){if(_0x5b2616){_0x24e433['applications'][_0xe21f('0xb6')]({'id':0x0,'priority':0x0,'app':_0xe21f('0xb7'),'appdata':_0x5b2616[_0xe21f('0x41')]+','+(_0x24e433[_0xe21f('0x8c')][_0xe21f('0xb8')]||0xa),'interval':_0xe21f('0xb1')});}if(!_0x24e433[_0xe21f('0xae')][_0xe21f('0xb9')])return;return db[_0xe21f('0xba')][_0xe21f('0x64')]({'attributes':['id',_0xe21f('0x41')],'where':{'id':_0x24e433[_0xe21f('0xae')][_0xe21f('0xb9')]}});})['then'](function(_0x14e5ce){if(_0x14e5ce){_0x24e433['applications'][_0xe21f('0xb6')]({'id':0x0,'priority':0x1,'app':_0xe21f('0xbb'),'appdata':_0x14e5ce['name']+','+(_0x24e433[_0xe21f('0x8c')][_0xe21f('0xbc')]||0x12c),'interval':_0xe21f('0xb1')});}return respondWithRpcPromise(_0xe21f('0xbd'),_0xe21f('0xbe'),_0x24e433);})['then'](function(_0x51fe8c){if(_0x51fe8c){var _0x18c598=0xc8;var _0x5bb3c5=_0xe21f('0xbf');logger['info'](_0xe21f('0x2b'),_0x5bb3c5,_0x18c598,_0xe21f('0xc0'));logger[_0xe21f('0x2a')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x5bb3c5,_0x18c598,_0xe21f('0xc0'),JSON[_0xe21f('0x2c')](_0x51fe8c));if(_0x24e433[_0xe21f('0x8c')][_0xe21f('0x46')]==='twilio'){return _0x1518bd['status'](_0x18c598)['set'](_0xe21f('0xc1'),_0xe21f('0xc2'))['send'](_0xe21f('0xc3'));}else{return _0x1518bd[_0xe21f('0x32')](_0x18c598)['json'](_0x51fe8c);}}});})[_0xe21f('0x31')](handleError(_0x1518bd,null));};exports['send']=function(_0x3e6d16,_0xaf1dba,_0x265bc8){var _0x5d7807,_0x22b05b,_0x44fda0;if(_[_0xe21f('0xa1')](_0x3e6d16['body']['body'])||_0x3e6d16['body']['body']===''){throw new db[(_0xe21f('0x96'))][(_0xe21f('0x97'))](_0xe21f('0xa2'));}if(_[_0xe21f('0xa1')](_0x3e6d16[_0xe21f('0x68')]['to'])){throw new db[(_0xe21f('0x96'))][(_0xe21f('0x97'))](_0xe21f('0xc4'));}_0x5d7807=_0x3e6d16['body']['to'];return db[_0xe21f('0x5a')][_0xe21f('0x64')]({'where':{'id':_0x3e6d16[_0xe21f('0x69')]['id']},'include':[{'model':db[_0xe21f('0xa7')],'as':_0xe21f('0xc5'),'include':[{'model':db[_0xe21f('0x95')],'as':_0xe21f('0xa8'),'where':{'mobile':_0x5d7807},'limit':0x1,'order':[[_0xe21f('0xa9'),_0xe21f('0xaa')]]}]}]})['then'](handleEntityNotFound(_0xaf1dba,null))['then'](function(_0x2f1364){if(_0x2f1364&&_0x2f1364['List']){_0x22b05b=_0x2f1364['get']({'plain':!![]});if(_0x22b05b['List']&&_0x22b05b['List']['Contacts'][_0xe21f('0x4f')]){return _0x22b05b[_0xe21f('0xc5')][_0xe21f('0xa8')][0x0];}return db['CmContact'][_0xe21f('0x5f')](_['defaults'](_0x3e6d16['body'],{'firstName':_0x5d7807,'mobile':_0x5d7807,'phone':_0x5d7807,'ListId':_0x22b05b[_0xe21f('0x9b')]}));}})[_0xe21f('0x26')](handleEntityNotFound(_0xaf1dba,null))[_0xe21f('0x26')](function(_0x8464c4){if(_0x8464c4){_0x44fda0=_0x8464c4;return db[_0xe21f('0xac')][_0xe21f('0x64')]({'where':{'ContactId':_0x44fda0['id'],'closed':![],'WhatsappAccountId':_0x22b05b['id']}})[_0xe21f('0x26')](function(_0x50fc7b){if(_0x50fc7b){return[_0x50fc7b,![]];}return db[_0xe21f('0xac')][_0xe21f('0x5f')]({'UserId':_0x3e6d16[_0xe21f('0x60')]['id'],'ContactId':_0x44fda0['id'],'WhatsappAccountId':_0x22b05b['id'],'phone':_0x5d7807,'firstMsgDirection':_0xe21f('0xc6'),'Messages':[_[_0xe21f('0x57')](_0x3e6d16['body'],{'read':![],'body':_0x3e6d16[_0xe21f('0x68')]['body'],'phone':_0x5d7807,'WhatsappAccountId':_0x22b05b['id'],'UserId':_0x3e6d16['user']['id'],'ContactId':_0x44fda0['id']})]},{'include':[{'model':db[_0xe21f('0xb2')],'as':'Messages'}]})[_0xe21f('0x26')](function(_0x23f67b){return[_0x23f67b,!![]];});});}})[_0xe21f('0xad')](function(_0x5d1827,_0xf3221d){if(_0xf3221d){return _0x5d1827;}return db[_0xe21f('0xb2')]['create'](_['merge'](_0x3e6d16[_0xe21f('0x68')],{'read':![],'body':_0x3e6d16[_0xe21f('0x68')][_0xe21f('0x68')],'phone':_0x5d7807,'WhatsappAccountId':_0x22b05b['id'],'WhatsappInteractionId':_0x5d1827['id'],'UserId':_0x3e6d16['user']['id'],'ContactId':_0x44fda0['id']}))[_0xe21f('0x26')](function(_0x7d91ac){_0x5d1827['dataValues'][_0xe21f('0xc7')]=[];_0x5d1827[_0xe21f('0xc8')]['Messages']['push'](_0x7d91ac['dataValues']);return _0x5d1827;});})[_0xe21f('0x26')](respondWithResult(_0xaf1dba,null))[_0xe21f('0x31')](handleError(_0xaf1dba,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index b9f43a8..208e849 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 _0x6136=['WhatsappAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x391154,_0x40fb12){var _0x4b7767=function(_0x3b1573){while(--_0x3b1573){_0x391154['push'](_0x391154['shift']());}};_0x4b7767(++_0x40fb12);}(_0x6136,0x80));var _0x6613=function(_0x237375,_0x5169e5){_0x237375=_0x237375-0x0;var _0x316066=_0x6136[_0x237375];return _0x316066;};'use strict';var EventEmitter=require(_0x6613('0x0'));var WhatsappAccount=require(_0x6613('0x1'))['db'][_0x6613('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6613('0x3'),'afterUpdate':_0x6613('0x4'),'afterDestroy':_0x6613('0x5')};function emitEvent(_0x5d20fd){return function(_0x4acc22,_0x12d727,_0x316d30){WhatsappAccountEvents[_0x6613('0x6')](_0x5d20fd+':'+_0x4acc22['id'],_0x4acc22);WhatsappAccountEvents['emit'](_0x5d20fd,_0x4acc22);_0x316d30(null);};}for(var e in events){if(events[_0x6613('0x7')](e)){var event=events[e];WhatsappAccount[_0x6613('0x8')](e,emitEvent(event));}}module[_0x6613('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x9b84=['hook','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0x570627,_0x3aaf2e){var _0x575a20=function(_0x220880){while(--_0x220880){_0x570627['push'](_0x570627['shift']());}};_0x575a20(++_0x3aaf2e);}(_0x9b84,0x12a));var _0x49b8=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x9b84[_0x28407a];return _0x8bd6ef;};'use strict';var EventEmitter=require(_0x49b8('0x0'));var WhatsappAccount=require(_0x49b8('0x1'))['db'][_0x49b8('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x49b8('0x3')](0x0);var events={'afterCreate':_0x49b8('0x4'),'afterUpdate':_0x49b8('0x5'),'afterDestroy':_0x49b8('0x6')};function emitEvent(_0x115c45){return function(_0x1523c0,_0xbe2a64,_0x9dd791){WhatsappAccountEvents['emit'](_0x115c45+':'+_0x1523c0['id'],_0x1523c0);WhatsappAccountEvents[_0x49b8('0x7')](_0x115c45,_0x1523c0);_0x9dd791(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x49b8('0x8')](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 d41985c..24a1ac6 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 _0xc125=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x57ac19,_0x3f130c){var _0xa97795=function(_0x402480){while(--_0x402480){_0x57ac19['push'](_0x57ac19['shift']());}};_0xa97795(++_0x3f130c);}(_0xc125,0xc7));var _0x5c12=function(_0x5d342e,_0x4da865){_0x5d342e=_0x5d342e-0x0;var _0x2f9764=_0xc125[_0x5d342e];return _0x2f9764;};'use strict';var _=require(_0x5c12('0x0'));var util=require(_0x5c12('0x1'));var logger=require(_0x5c12('0x2'))(_0x5c12('0x3'));var moment=require(_0x5c12('0x4'));var BPromise=require(_0x5c12('0x5'));var rp=require(_0x5c12('0x6'));var fs=require('fs');var path=require(_0x5c12('0x7'));var rimraf=require(_0x5c12('0x8'));var config=require(_0x5c12('0x9'));var attributes=require('./whatsappAccount.attributes');module[_0x5c12('0xa')]=function(_0x24068c,_0xb6f0ce){return _0x24068c[_0x5c12('0xb')](_0x5c12('0xc'),attributes,{'tableName':_0x5c12('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x563e=['define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x335209,_0x2b983b){var _0x115ed9=function(_0x1d23c7){while(--_0x1d23c7){_0x335209['push'](_0x335209['shift']());}};_0x115ed9(++_0x2b983b);}(_0x563e,0xc3));var _0xe563=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0x563e[_0x219fa0];return _0xc603fb;};'use strict';var _=require(_0xe563('0x0'));var util=require('util');var logger=require(_0xe563('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe563('0x2'));var rp=require(_0xe563('0x3'));var fs=require('fs');var path=require(_0xe563('0x4'));var rimraf=require(_0xe563('0x5'));var config=require(_0xe563('0x6'));var attributes=require(_0xe563('0x7'));module[_0xe563('0x8')]=function(_0x5cdbb8,_0x18558c){return _0x5cdbb8[_0xe563('0x9')](_0xe563('0xa'),attributes,{'tableName':_0xe563('0xb'),'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 5d55d21..60488ae 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 _0x62cc=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','where','include','model','map','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x62cc,0xf4));var _0xc62c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x62cc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc62c('0x0'));var util=require(_0xc62c('0x1'));var moment=require(_0xc62c('0x2'));var BPromise=require(_0xc62c('0x3'));var rs=require(_0xc62c('0x4'));var fs=require('fs');var Redis=require(_0xc62c('0x5'));var db=require(_0xc62c('0x6'))['db'];var utils=require(_0xc62c('0x7'));var logger=require(_0xc62c('0x8'))(_0xc62c('0x9'));var config=require('../../config/environment');var jayson=require(_0xc62c('0xa'));var client=jayson[_0xc62c('0xb')]['http']({'port':0x232a});config[_0xc62c('0xc')]=_[_0xc62c('0xd')](config[_0xc62c('0xc')],{'host':_0xc62c('0xe'),'port':0x18eb});var socket=require(_0xc62c('0xf'))(new Redis(config['redis']));require(_0xc62c('0x10'))[_0xc62c('0x11')](socket);function respondWithRpcPromise(_0x4c7d58,_0x245ae3,_0x27efb6){return new BPromise(function(_0xbfef77,_0x20e60f){return client['request'](_0x4c7d58,_0x27efb6)[_0xc62c('0x12')](function(_0x3a3491){logger[_0xc62c('0x13')](_0xc62c('0x14'),_0x245ae3,_0xc62c('0x15'));logger[_0xc62c('0x16')](_0xc62c('0x17'),_0x245ae3,_0xc62c('0x15'),JSON[_0xc62c('0x18')](_0x3a3491));if(_0x3a3491['error']){if(_0x3a3491[_0xc62c('0x19')]['code']===0x1f4){logger[_0xc62c('0x19')](_0xc62c('0x14'),_0x245ae3,_0x3a3491[_0xc62c('0x19')]['message']);return _0x20e60f(_0x3a3491[_0xc62c('0x19')]['message']);}logger[_0xc62c('0x19')](_0xc62c('0x14'),_0x245ae3,_0x3a3491[_0xc62c('0x19')]['message']);return _0xbfef77(_0x3a3491[_0xc62c('0x19')][_0xc62c('0x1a')]);}else{logger[_0xc62c('0x13')](_0xc62c('0x14'),_0x245ae3,'request\x20sent');_0xbfef77(_0x3a3491[_0xc62c('0x1b')]['message']);}})[_0xc62c('0x1c')](function(_0x48284a){logger[_0xc62c('0x19')](_0xc62c('0x14'),_0x245ae3,_0x48284a);_0x20e60f(_0x48284a);});});}exports[_0xc62c('0x1d')]=function(_0x55d22d){var _0x5e879b=this;return new Promise(function(_0x459a4a,_0x481ebd){return db[_0xc62c('0x1e')][_0xc62c('0x1f')]({'raw':_0x55d22d[_0xc62c('0x20')]?_0x55d22d[_0xc62c('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x55d22d['options']?_0x55d22d[_0xc62c('0x20')][_0xc62c('0x21')]||null:null,'attributes':_0x55d22d[_0xc62c('0x20')]?_0x55d22d['options']['attributes']||null:null,'include':_0x55d22d['options']?_0x55d22d[_0xc62c('0x20')][_0xc62c('0x22')]?_['map'](_0x55d22d[_0xc62c('0x20')]['include'],function(_0xe844c4){return{'model':db[_0xe844c4[_0xc62c('0x23')]],'as':_0xe844c4['as'],'attributes':_0xe844c4['attributes'],'include':_0xe844c4[_0xc62c('0x22')]?_[_0xc62c('0x24')](_0xe844c4[_0xc62c('0x22')],function(_0x2a7252){return{'model':db[_0x2a7252[_0xc62c('0x23')]],'as':_0x2a7252['as'],'attributes':_0x2a7252[_0xc62c('0x25')],'include':_0x2a7252[_0xc62c('0x22')]?_[_0xc62c('0x24')](_0x2a7252[_0xc62c('0x22')],function(_0x2f46f9){return{'model':db[_0x2f46f9[_0xc62c('0x23')]],'as':_0x2f46f9['as'],'attributes':_0x2f46f9[_0xc62c('0x25')]};}):[]};}):[]};}):[]:[]})[_0xc62c('0x12')](function(_0x4e32bb){logger[_0xc62c('0x13')](_0xc62c('0x1d'),_0x55d22d);logger[_0xc62c('0x16')](_0xc62c('0x1d'),_0x55d22d,JSON[_0xc62c('0x18')](_0x4e32bb));_0x459a4a(_0x4e32bb);})[_0xc62c('0x1c')](function(_0x4343f9){logger[_0xc62c('0x19')]('ShowWhatsappAccount',_0x4343f9['message'],_0x55d22d);_0x481ebd(_0x5e879b[_0xc62c('0x19')](0x1f4,_0x4343f9[_0xc62c('0x1a')]));});});}; \ No newline at end of file +var _0x3f18=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','debug','request\x20sent','error','message','result','WhatsappAccount','find','options','raw','where','attributes','include','map','model','ShowWhatsappAccount','stringify','catch','bluebird','randomstring','ioredis'];(function(_0x465b38,_0x148cd9){var _0x198fb5=function(_0x4746c1){while(--_0x4746c1){_0x465b38['push'](_0x465b38['shift']());}};_0x198fb5(++_0x148cd9);}(_0x3f18,0xc9));var _0x83f1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x3f18[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x83f1('0x0'));var rs=require(_0x83f1('0x1'));var fs=require('fs');var Redis=require(_0x83f1('0x2'));var db=require(_0x83f1('0x3'))['db'];var utils=require(_0x83f1('0x4'));var logger=require(_0x83f1('0x5'))(_0x83f1('0x6'));var config=require(_0x83f1('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x83f1('0x8')]({'port':0x232a});config[_0x83f1('0x9')]=_['defaults'](config[_0x83f1('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x83f1('0xa'))(new Redis(config[_0x83f1('0x9')]));require(_0x83f1('0xb'))[_0x83f1('0xc')](socket);function respondWithRpcPromise(_0xa1ea80,_0x649fbe,_0x5ab419){return new BPromise(function(_0x2f72cc,_0x4a62b4){return client[_0x83f1('0xd')](_0xa1ea80,_0x5ab419)[_0x83f1('0xe')](function(_0x259ac8){logger[_0x83f1('0xf')](_0x83f1('0x10'),_0x649fbe,'request\x20sent');logger[_0x83f1('0x11')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x649fbe,_0x83f1('0x12'),JSON['stringify'](_0x259ac8));if(_0x259ac8[_0x83f1('0x13')]){if(_0x259ac8[_0x83f1('0x13')]['code']===0x1f4){logger[_0x83f1('0x13')](_0x83f1('0x10'),_0x649fbe,_0x259ac8[_0x83f1('0x13')][_0x83f1('0x14')]);return _0x4a62b4(_0x259ac8[_0x83f1('0x13')]['message']);}logger['error'](_0x83f1('0x10'),_0x649fbe,_0x259ac8[_0x83f1('0x13')]['message']);return _0x2f72cc(_0x259ac8['error'][_0x83f1('0x14')]);}else{logger[_0x83f1('0xf')]('WhatsappAccount,\x20%s,\x20%s',_0x649fbe,_0x83f1('0x12'));_0x2f72cc(_0x259ac8[_0x83f1('0x15')][_0x83f1('0x14')]);}})['catch'](function(_0x295e13){logger[_0x83f1('0x13')](_0x83f1('0x10'),_0x649fbe,_0x295e13);_0x4a62b4(_0x295e13);});});}exports['ShowWhatsappAccount']=function(_0x3aa4d8){var _0x5a891b=this;return new Promise(function(_0x141b19,_0x29bf82){return db[_0x83f1('0x16')][_0x83f1('0x17')]({'raw':_0x3aa4d8[_0x83f1('0x18')]?_0x3aa4d8['options'][_0x83f1('0x19')]===undefined?!![]:![]:!![],'where':_0x3aa4d8[_0x83f1('0x18')]?_0x3aa4d8[_0x83f1('0x18')][_0x83f1('0x1a')]||null:null,'attributes':_0x3aa4d8['options']?_0x3aa4d8['options'][_0x83f1('0x1b')]||null:null,'include':_0x3aa4d8[_0x83f1('0x18')]?_0x3aa4d8[_0x83f1('0x18')][_0x83f1('0x1c')]?_[_0x83f1('0x1d')](_0x3aa4d8['options']['include'],function(_0x5b26b7){return{'model':db[_0x5b26b7['model']],'as':_0x5b26b7['as'],'attributes':_0x5b26b7[_0x83f1('0x1b')],'include':_0x5b26b7['include']?_[_0x83f1('0x1d')](_0x5b26b7[_0x83f1('0x1c')],function(_0x1abb23){return{'model':db[_0x1abb23['model']],'as':_0x1abb23['as'],'attributes':_0x1abb23[_0x83f1('0x1b')],'include':_0x1abb23['include']?_[_0x83f1('0x1d')](_0x1abb23['include'],function(_0x4cec8a){return{'model':db[_0x4cec8a[_0x83f1('0x1e')]],'as':_0x4cec8a['as'],'attributes':_0x4cec8a[_0x83f1('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x83f1('0xe')](function(_0x3913a9){logger[_0x83f1('0xf')](_0x83f1('0x1f'),_0x3aa4d8);logger[_0x83f1('0x11')](_0x83f1('0x1f'),_0x3aa4d8,JSON[_0x83f1('0x20')](_0x3913a9));_0x141b19(_0x3913a9);})[_0x83f1('0x21')](function(_0xcff679){logger[_0x83f1('0x13')](_0x83f1('0x1f'),_0xcff679['message'],_0x3aa4d8);_0x29bf82(_0x5a891b[_0x83f1('0x13')](0x1f4,_0xcff679['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index a8805c7..42cd934 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 _0x703c=['whatsappAccount:','./whatsappAccount.events','remove','emit','register'];(function(_0x861f3,_0x295267){var _0x56c197=function(_0x3ddcdd){while(--_0x3ddcdd){_0x861f3['push'](_0x861f3['shift']());}};_0x56c197(++_0x295267);}(_0x703c,0x1a5));var _0xc703=function(_0x109cba,_0x541e5b){_0x109cba=_0x109cba-0x0;var _0x55cd0c=_0x703c[_0x109cba];return _0x55cd0c;};'use strict';var WhatsappAccountEvents=require(_0xc703('0x0'));var events=['save',_0xc703('0x1'),'update'];function createListener(_0x2b980a,_0x24d9ef){return function(_0x4ea440){_0x24d9ef[_0xc703('0x2')](_0x2b980a,_0x4ea440);};}function removeListener(_0x29d40b,_0x5b4bbf){return function(){WhatsappAccountEvents['removeListener'](_0x29d40b,_0x5b4bbf);};}exports[_0xc703('0x3')]=function(_0x3c7b20){for(var _0x4a5def=0x0,_0x28a598=events['length'];_0x4a5def<_0x28a598;_0x4a5def++){var _0x2750c7=events[_0x4a5def];var _0x24cd88=createListener(_0xc703('0x4')+_0x2750c7,_0x3c7b20);WhatsappAccountEvents['on'](_0x2750c7,_0x24cd88);}}; \ No newline at end of file +var _0xa505=['whatsappAccount:','./whatsappAccount.events','remove','update','emit','removeListener'];(function(_0x374235,_0x242c26){var _0x67630d=function(_0x4fc722){while(--_0x4fc722){_0x374235['push'](_0x374235['shift']());}};_0x67630d(++_0x242c26);}(_0xa505,0x199));var _0x5a50=function(_0x4d8511,_0x14f75f){_0x4d8511=_0x4d8511-0x0;var _0x47a898=_0xa505[_0x4d8511];return _0x47a898;};'use strict';var WhatsappAccountEvents=require(_0x5a50('0x0'));var events=['save',_0x5a50('0x1'),_0x5a50('0x2')];function createListener(_0x234d8d,_0xb1d9aa){return function(_0x2ee974){_0xb1d9aa[_0x5a50('0x3')](_0x234d8d,_0x2ee974);};}function removeListener(_0x2eded0,_0x39c318){return function(){WhatsappAccountEvents[_0x5a50('0x4')](_0x2eded0,_0x39c318);};}exports['register']=function(_0x4149af){for(var _0x59e9ad=0x0,_0x15e129=events['length'];_0x59e9ad<_0x15e129;_0x59e9ad++){var _0x378905=events[_0x59e9ad];var _0x158fd7=createListener(_0x5a50('0x5')+_0x378905,_0x4149af);WhatsappAccountEvents['on'](_0x378905,_0x158fd7);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 230ba9d..d21700b 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 _0x1d73=['destroy','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','create','put','/:id','update'];(function(_0x9716c4,_0x551b55){var _0x5c75dc=function(_0x5b77c7){while(--_0x5b77c7){_0x9716c4['push'](_0x9716c4['shift']());}};_0x5c75dc(++_0x551b55);}(_0x1d73,0x141));var _0x31d7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1d73[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x31d7('0x0'));var path=require('path');var timeout=require(_0x31d7('0x1'));var express=require('express');var router=express[_0x31d7('0x2')]();var fs_extra=require(_0x31d7('0x3'));var auth=require(_0x31d7('0x4'));var interaction=require(_0x31d7('0x5'));var config=require(_0x31d7('0x6'));var controller=require('./whatsappApplication.controller');router[_0x31d7('0x7')]('/',auth[_0x31d7('0x8')](),controller[_0x31d7('0x9')]);router[_0x31d7('0x7')]('/:id',auth[_0x31d7('0x8')](),controller[_0x31d7('0xa')]);router['post']('/',auth[_0x31d7('0x8')](),controller[_0x31d7('0xb')]);router[_0x31d7('0xc')](_0x31d7('0xd'),auth['isAuthenticated'](),controller[_0x31d7('0xe')]);router['delete'](_0x31d7('0xd'),auth[_0x31d7('0x8')](),controller[_0x31d7('0xf')]);module['exports']=router; \ No newline at end of file +var _0x9c08=['util','path','express','Router','fs-extra','../../components/auth/service','./whatsappApplication.controller','get','isAuthenticated','show','create','put','/:id','update','delete','destroy'];(function(_0xa28b1a,_0x384f4b){var _0x4c9b78=function(_0x3cf640){while(--_0x3cf640){_0xa28b1a['push'](_0xa28b1a['shift']());}};_0x4c9b78(++_0x384f4b);}(_0x9c08,0x1c0));var _0x89c0=function(_0x2c9cf9,_0x2bed45){_0x2c9cf9=_0x2c9cf9-0x0;var _0x560d6d=_0x9c08[_0x2c9cf9];return _0x560d6d;};'use strict';var multer=require('multer');var util=require(_0x89c0('0x0'));var path=require(_0x89c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x89c0('0x2'));var router=express[_0x89c0('0x3')]();var fs_extra=require(_0x89c0('0x4'));var auth=require(_0x89c0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x89c0('0x6'));router[_0x89c0('0x7')]('/',auth[_0x89c0('0x8')](),controller['index']);router[_0x89c0('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x89c0('0x9')]);router['post']('/',auth[_0x89c0('0x8')](),controller[_0x89c0('0xa')]);router[_0x89c0('0xb')](_0x89c0('0xc'),auth['isAuthenticated'](),controller[_0x89c0('0xd')]);router[_0x89c0('0xe')](_0x89c0('0xc'),auth[_0x89c0('0x8')](),controller[_0x89c0('0xf')]);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 fbfb33f..ed0a1f6 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 _0x25f0=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x24d47e,_0x33fcb7){var _0x594236=function(_0x18e239){while(--_0x18e239){_0x24d47e['push'](_0x24d47e['shift']());}};_0x594236(++_0x33fcb7);}(_0x25f0,0xd7));var _0x025f=function(_0x277435,_0x59d8a6){_0x277435=_0x277435-0x0;var _0x37a255=_0x25f0[_0x277435];return _0x37a255;};'use strict';var Sequelize=require(_0x025f('0x0'));module['exports']={'priority':{'type':Sequelize[_0x025f('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x025f('0x2')],'allowNull':![],'defaultValue':_0x025f('0x3')},'appdata':{'type':Sequelize[_0x025f('0x4')]()},'description':{'type':Sequelize[_0x025f('0x2')]},'interval':{'type':Sequelize[_0x025f('0x2')],'defaultValue':_0x025f('0x5')}}; \ No newline at end of file +var _0xa548=['exports','INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x1c841d,_0x376f78){var _0x123d8d=function(_0x4009e7){while(--_0x4009e7){_0x1c841d['push'](_0x1c841d['shift']());}};_0x123d8d(++_0x376f78);}(_0xa548,0x191));var _0x8a54=function(_0x3a3bae,_0x5c64d7){_0x3a3bae=_0x3a3bae-0x0;var _0x58cf6d=_0xa548[_0x3a3bae];return _0x58cf6d;};'use strict';var Sequelize=require(_0x8a54('0x0'));module[_0x8a54('0x1')]={'priority':{'type':Sequelize[_0x8a54('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8a54('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8a54('0x4')],'defaultValue':_0x8a54('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 3755286..5f346cf 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 _0x41d0=['rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','filter','where','VIRTUAL','merge','options','WhatsappApplication','then','includeAll','include','findAll','rows','show','length','find','body','catch','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map'];(function(_0x39caaa,_0x1f37bc){var _0x9b9c7d=function(_0x2da02c){while(--_0x2da02c){_0x39caaa['push'](_0x39caaa['shift']());}};_0x9b9c7d(++_0x1f37bc);}(_0x41d0,0x1c6));var _0x041d=function(_0x353eeb,_0x2b72f1){_0x353eeb=_0x353eeb-0x0;var _0x311f1a=_0x41d0[_0x353eeb];return _0x311f1a;};'use strict';var emlformat=require(_0x041d('0x0'));var rimraf=require(_0x041d('0x1'));var zipdir=require(_0x041d('0x2'));var jsonpatch=require(_0x041d('0x3'));var rp=require('request-promise');var moment=require(_0x041d('0x4'));var BPromise=require(_0x041d('0x5'));var Mustache=require(_0x041d('0x6'));var util=require(_0x041d('0x7'));var path=require(_0x041d('0x8'));var sox=require(_0x041d('0x9'));var csv=require(_0x041d('0xa'));var ejs=require(_0x041d('0xb'));var fs=require('fs');var fs_extra=require(_0x041d('0xc'));var _=require('lodash');var squel=require(_0x041d('0xd'));var crypto=require('crypto');var jsforce=require(_0x041d('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x041d('0xa'));var querystring=require(_0x041d('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x041d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x041d('0x11'));var logger=require('../../config/logger')(_0x041d('0x12'));var utils=require(_0x041d('0x13'));var config=require(_0x041d('0x14'));var licenseUtil=require(_0x041d('0x15'));var db=require(_0x041d('0x16'))['db'];function respondWithStatusCode(_0x51b1d1,_0x34b0f9){_0x34b0f9=_0x34b0f9||0xcc;return function(_0x111e9b){if(_0x111e9b){return _0x51b1d1[_0x041d('0x17')](_0x34b0f9);}return _0x51b1d1['status'](_0x34b0f9)[_0x041d('0x18')]();};}function respondWithResult(_0x3205ea,_0x61dc3b){_0x61dc3b=_0x61dc3b||0xc8;return function(_0x1efe79){if(_0x1efe79){return _0x3205ea[_0x041d('0x19')](_0x61dc3b)[_0x041d('0x1a')](_0x1efe79);}};}function respondWithFilteredResult(_0x481221,_0xaadc6f){return function(_0x167cfe){if(_0x167cfe){var _0x362289=typeof _0xaadc6f[_0x041d('0x1b')]===_0x041d('0x1c')&&typeof _0xaadc6f[_0x041d('0x1d')]==='undefined';var _0x488468=_0x167cfe[_0x041d('0x1e')];var _0x32a20e=_0x362289?0x0:_0xaadc6f['offset'];var _0x15b10b=_0x362289?_0x167cfe['count']:_0xaadc6f[_0x041d('0x1b')]+_0xaadc6f[_0x041d('0x1d')];var _0x137878;if(_0x15b10b>=_0x488468){_0x15b10b=_0x488468;_0x137878=0xc8;}else{_0x137878=0xce;}_0x481221['status'](_0x137878);return _0x481221[_0x041d('0x1f')]('Content-Range',_0x32a20e+'-'+_0x15b10b+'/'+_0x488468)['json'](_0x167cfe);}return null;};}function patchUpdates(_0x22a8d9){return function(_0x597c1d){try{jsonpatch[_0x041d('0x20')](_0x597c1d,_0x22a8d9,!![]);}catch(_0x339d10){return BPromise[_0x041d('0x21')](_0x339d10);}return _0x597c1d[_0x041d('0x22')]();};}function saveUpdates(_0xb6ec9a,_0x6ee379){return function(_0x437841){if(_0x437841){return _0x437841[_0x041d('0x23')](_0xb6ec9a)['then'](function(_0x1fee9a){return _0x1fee9a;});}return null;};}function removeEntity(_0x302aaa,_0x6058d7){return function(_0x6c8547){if(_0x6c8547){return _0x6c8547[_0x041d('0x24')]()['then'](function(){_0x302aaa[_0x041d('0x19')](0xcc)[_0x041d('0x18')]();});}};}function handleEntityNotFound(_0x3e04e3,_0x3b34a7){return function(_0x315d73){if(!_0x315d73){_0x3e04e3[_0x041d('0x17')](0x194);}return _0x315d73;};}function handleError(_0x2ae739,_0x927bb1){_0x927bb1=_0x927bb1||0x1f4;return function(_0x1ca19c){logger[_0x041d('0x25')](_0x1ca19c[_0x041d('0x26')]);if(_0x1ca19c[_0x041d('0x27')]){delete _0x1ca19c[_0x041d('0x27')];}_0x2ae739[_0x041d('0x19')](_0x927bb1)[_0x041d('0x28')](_0x1ca19c);};}exports[_0x041d('0x29')]=function(_0x1df7cc,_0x414dbc){var _0x189028={},_0x18b06b={},_0x3cd52c={'count':0x0,'rows':[]};var _0x30ec8f=_[_0x041d('0x2a')](db['WhatsappApplication'][_0x041d('0x2b')],function(_0x296614){return{'name':_0x296614['fieldName'],'type':_0x296614[_0x041d('0x2c')]['key']};});_0x18b06b['model']=_[_0x041d('0x2a')](_0x30ec8f,'name');_0x18b06b[_0x041d('0x2d')]=_[_0x041d('0x2e')](_0x1df7cc['query']);_0x18b06b[_0x041d('0x2f')]=_[_0x041d('0x30')](_0x18b06b[_0x041d('0x31')],_0x18b06b[_0x041d('0x2d')]);_0x189028['attributes']=_[_0x041d('0x30')](_0x18b06b[_0x041d('0x31')],qs[_0x041d('0x32')](_0x1df7cc[_0x041d('0x2d')][_0x041d('0x32')]));_0x189028['attributes']=_0x189028[_0x041d('0x33')]['length']?_0x189028[_0x041d('0x33')]:_0x18b06b[_0x041d('0x31')];if(!_0x1df7cc['query']['hasOwnProperty'](_0x041d('0x34'))){_0x189028[_0x041d('0x1d')]=qs[_0x041d('0x1d')](_0x1df7cc['query'][_0x041d('0x1d')]);_0x189028[_0x041d('0x1b')]=qs[_0x041d('0x1b')](_0x1df7cc[_0x041d('0x2d')]['offset']);}_0x189028[_0x041d('0x35')]=qs['sort'](_0x1df7cc[_0x041d('0x2d')][_0x041d('0x36')]);_0x189028['where']=qs[_0x041d('0x2f')](_['pick'](_0x1df7cc[_0x041d('0x2d')],_0x18b06b[_0x041d('0x2f')]),_0x30ec8f);if(_0x1df7cc['query'][_0x041d('0x37')]){_0x189028[_0x041d('0x38')]=_['merge'](_0x189028[_0x041d('0x38')],{'$or':_[_0x041d('0x2a')](_0x30ec8f,function(_0xee43b){if(_0xee43b[_0x041d('0x2c')]!==_0x041d('0x39')){var _0xf32448={};_0xf32448[_0xee43b[_0x041d('0x27')]]={'$like':'%'+_0x1df7cc[_0x041d('0x2d')][_0x041d('0x37')]+'%'};return _0xf32448;}})});}_0x189028=_[_0x041d('0x3a')]({},_0x189028,_0x1df7cc[_0x041d('0x3b')]);var _0x1ffcc8={'where':_0x189028['where']};return db[_0x041d('0x3c')][_0x041d('0x1e')](_0x1ffcc8)[_0x041d('0x3d')](function(_0x2ce779){_0x3cd52c['count']=_0x2ce779;if(_0x1df7cc[_0x041d('0x2d')][_0x041d('0x3e')]){_0x189028[_0x041d('0x3f')]=[{'all':!![]}];}return db[_0x041d('0x3c')][_0x041d('0x40')](_0x189028);})[_0x041d('0x3d')](function(_0x27745c){_0x3cd52c[_0x041d('0x41')]=_0x27745c;return _0x3cd52c;})[_0x041d('0x3d')](respondWithFilteredResult(_0x414dbc,_0x189028))['catch'](handleError(_0x414dbc,null));};exports[_0x041d('0x42')]=function(_0x9c0db8,_0x4c96c0){var _0x5f1135={'raw':!![],'where':{'id':_0x9c0db8['params']['id']}},_0x4b43c4={};_0x4b43c4['model']=_[_0x041d('0x2e')](db[_0x041d('0x3c')]['rawAttributes']);_0x4b43c4['query']=_[_0x041d('0x2e')](_0x9c0db8[_0x041d('0x2d')]);_0x4b43c4[_0x041d('0x2f')]=_[_0x041d('0x30')](_0x4b43c4['model'],_0x4b43c4['query']);_0x5f1135[_0x041d('0x33')]=_[_0x041d('0x30')](_0x4b43c4[_0x041d('0x31')],qs[_0x041d('0x32')](_0x9c0db8[_0x041d('0x2d')][_0x041d('0x32')]));_0x5f1135[_0x041d('0x33')]=_0x5f1135['attributes'][_0x041d('0x43')]?_0x5f1135[_0x041d('0x33')]:_0x4b43c4[_0x041d('0x31')];if(_0x9c0db8[_0x041d('0x2d')][_0x041d('0x3e')]){_0x5f1135['include']=[{'all':!![]}];}_0x5f1135=_['merge']({},_0x5f1135,_0x9c0db8['options']);return db['WhatsappApplication'][_0x041d('0x44')](_0x5f1135)[_0x041d('0x3d')](handleEntityNotFound(_0x4c96c0,null))[_0x041d('0x3d')](respondWithResult(_0x4c96c0,null))['catch'](handleError(_0x4c96c0,null));};exports['create']=function(_0x431086,_0x204d6a){return db[_0x041d('0x3c')]['create'](_0x431086['body'],{})[_0x041d('0x3d')](respondWithResult(_0x204d6a,0xc9))['catch'](handleError(_0x204d6a,null));};exports['update']=function(_0x5ce86b,_0x1d40f3){if(_0x5ce86b[_0x041d('0x45')]['id']){delete _0x5ce86b[_0x041d('0x45')]['id'];}return db[_0x041d('0x3c')][_0x041d('0x44')]({'where':{'id':_0x5ce86b['params']['id']}})['then'](handleEntityNotFound(_0x1d40f3,null))[_0x041d('0x3d')](saveUpdates(_0x5ce86b[_0x041d('0x45')],null))[_0x041d('0x3d')](respondWithResult(_0x1d40f3,null))[_0x041d('0x46')](handleError(_0x1d40f3,null));};exports['destroy']=function(_0x538c34,_0xa8fba7){return db['WhatsappApplication'][_0x041d('0x44')]({'where':{'id':_0x538c34['params']['id']}})[_0x041d('0x3d')](handleEntityNotFound(_0xa8fba7,null))['then'](removeEntity(_0xa8fba7,null))[_0x041d('0x46')](handleError(_0xa8fba7,null));}; \ No newline at end of file +var _0x1f2d=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','error','stack','name','send','index','WhatsappApplication','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','VIRTUAL','options','then','include','findAll','catch','show','params','rawAttributes','create','update','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x9a87a8,_0x46fc68){var _0x25be63=function(_0x3c9e09){while(--_0x3c9e09){_0x9a87a8['push'](_0x9a87a8['shift']());}};_0x25be63(++_0x46fc68);}(_0x1f2d,0x1c4));var _0xd1f2=function(_0x5b1c50,_0x56e694){_0x5b1c50=_0x5b1c50-0x0;var _0x2d379b=_0x1f2d[_0x5b1c50];return _0x2d379b;};'use strict';var emlformat=require(_0xd1f2('0x0'));var rimraf=require(_0xd1f2('0x1'));var zipdir=require(_0xd1f2('0x2'));var jsonpatch=require(_0xd1f2('0x3'));var rp=require('request-promise');var moment=require(_0xd1f2('0x4'));var BPromise=require(_0xd1f2('0x5'));var Mustache=require(_0xd1f2('0x6'));var util=require(_0xd1f2('0x7'));var path=require(_0xd1f2('0x8'));var sox=require(_0xd1f2('0x9'));var csv=require(_0xd1f2('0xa'));var ejs=require(_0xd1f2('0xb'));var fs=require('fs');var fs_extra=require(_0xd1f2('0xc'));var _=require(_0xd1f2('0xd'));var squel=require(_0xd1f2('0xe'));var crypto=require(_0xd1f2('0xf'));var jsforce=require(_0xd1f2('0x10'));var deskjs=require(_0xd1f2('0x11'));var toCsv=require(_0xd1f2('0xa'));var querystring=require(_0xd1f2('0x12'));var Papa=require(_0xd1f2('0x13'));var Redis=require('ioredis');var authService=require(_0xd1f2('0x14'));var qs=require(_0xd1f2('0x15'));var as=require(_0xd1f2('0x16'));var hardwareService=require(_0xd1f2('0x17'));var logger=require('../../config/logger')(_0xd1f2('0x18'));var utils=require(_0xd1f2('0x19'));var config=require(_0xd1f2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xd1f2('0x1b'))['db'];function respondWithStatusCode(_0x347eba,_0x2ef331){_0x2ef331=_0x2ef331||0xcc;return function(_0x1d09f6){if(_0x1d09f6){return _0x347eba[_0xd1f2('0x1c')](_0x2ef331);}return _0x347eba[_0xd1f2('0x1d')](_0x2ef331)[_0xd1f2('0x1e')]();};}function respondWithResult(_0x596a54,_0x4d71d1){_0x4d71d1=_0x4d71d1||0xc8;return function(_0x5a3c44){if(_0x5a3c44){return _0x596a54['status'](_0x4d71d1)['json'](_0x5a3c44);}};}function respondWithFilteredResult(_0x19eb09,_0x1e0226){return function(_0x20d25d){if(_0x20d25d){var _0x1bd6ac=typeof _0x1e0226[_0xd1f2('0x1f')]===_0xd1f2('0x20')&&typeof _0x1e0226[_0xd1f2('0x21')]==='undefined';var _0x2af2d8=_0x20d25d[_0xd1f2('0x22')];var _0x2cd4fa=_0x1bd6ac?0x0:_0x1e0226[_0xd1f2('0x1f')];var _0x1f05f4=_0x1bd6ac?_0x20d25d[_0xd1f2('0x22')]:_0x1e0226[_0xd1f2('0x1f')]+_0x1e0226['limit'];var _0x12343a;if(_0x1f05f4>=_0x2af2d8){_0x1f05f4=_0x2af2d8;_0x12343a=0xc8;}else{_0x12343a=0xce;}_0x19eb09[_0xd1f2('0x1d')](_0x12343a);return _0x19eb09[_0xd1f2('0x23')](_0xd1f2('0x24'),_0x2cd4fa+'-'+_0x1f05f4+'/'+_0x2af2d8)[_0xd1f2('0x25')](_0x20d25d);}return null;};}function patchUpdates(_0x40b992){return function(_0x2a666f){try{jsonpatch[_0xd1f2('0x26')](_0x2a666f,_0x40b992,!![]);}catch(_0x23250f){return BPromise[_0xd1f2('0x27')](_0x23250f);}return _0x2a666f[_0xd1f2('0x28')]();};}function saveUpdates(_0x4b74ff,_0x3ccd12){return function(_0x779022){if(_0x779022){return _0x779022['update'](_0x4b74ff)['then'](function(_0x36c147){return _0x36c147;});}return null;};}function removeEntity(_0x824485,_0x5a5278){return function(_0x527471){if(_0x527471){return _0x527471['destroy']()['then'](function(){_0x824485['status'](0xcc)[_0xd1f2('0x1e')]();});}};}function handleEntityNotFound(_0x3f181b,_0x2557d0){return function(_0x2c0bbb){if(!_0x2c0bbb){_0x3f181b[_0xd1f2('0x1c')](0x194);}return _0x2c0bbb;};}function handleError(_0x493870,_0xf935fc){_0xf935fc=_0xf935fc||0x1f4;return function(_0x3a99b2){logger[_0xd1f2('0x29')](_0x3a99b2[_0xd1f2('0x2a')]);if(_0x3a99b2[_0xd1f2('0x2b')]){delete _0x3a99b2[_0xd1f2('0x2b')];}_0x493870[_0xd1f2('0x1d')](_0xf935fc)[_0xd1f2('0x2c')](_0x3a99b2);};}exports[_0xd1f2('0x2d')]=function(_0x2c1d0e,_0x3e5e6c){var _0x58dd7c={},_0x4ef315={},_0x174306={'count':0x0,'rows':[]};var _0x409640=_['map'](db[_0xd1f2('0x2e')]['rawAttributes'],function(_0x1b9c0f){return{'name':_0x1b9c0f[_0xd1f2('0x2f')],'type':_0x1b9c0f[_0xd1f2('0x30')]['key']};});_0x4ef315[_0xd1f2('0x31')]=_['map'](_0x409640,'name');_0x4ef315[_0xd1f2('0x32')]=_[_0xd1f2('0x33')](_0x2c1d0e[_0xd1f2('0x32')]);_0x4ef315[_0xd1f2('0x34')]=_['intersection'](_0x4ef315[_0xd1f2('0x31')],_0x4ef315['query']);_0x58dd7c[_0xd1f2('0x35')]=_[_0xd1f2('0x36')](_0x4ef315['model'],qs[_0xd1f2('0x37')](_0x2c1d0e['query'][_0xd1f2('0x37')]));_0x58dd7c[_0xd1f2('0x35')]=_0x58dd7c[_0xd1f2('0x35')][_0xd1f2('0x38')]?_0x58dd7c[_0xd1f2('0x35')]:_0x4ef315[_0xd1f2('0x31')];if(!_0x2c1d0e['query'][_0xd1f2('0x39')](_0xd1f2('0x3a'))){_0x58dd7c[_0xd1f2('0x21')]=qs[_0xd1f2('0x21')](_0x2c1d0e[_0xd1f2('0x32')]['limit']);_0x58dd7c[_0xd1f2('0x1f')]=qs[_0xd1f2('0x1f')](_0x2c1d0e['query'][_0xd1f2('0x1f')]);}_0x58dd7c['order']=qs[_0xd1f2('0x3b')](_0x2c1d0e[_0xd1f2('0x32')][_0xd1f2('0x3b')]);_0x58dd7c[_0xd1f2('0x3c')]=qs['filters'](_[_0xd1f2('0x3d')](_0x2c1d0e[_0xd1f2('0x32')],_0x4ef315[_0xd1f2('0x34')]),_0x409640);if(_0x2c1d0e[_0xd1f2('0x32')][_0xd1f2('0x3e')]){_0x58dd7c[_0xd1f2('0x3c')]=_[_0xd1f2('0x3f')](_0x58dd7c['where'],{'$or':_[_0xd1f2('0x40')](_0x409640,function(_0x5db7f0){if(_0x5db7f0[_0xd1f2('0x30')]!==_0xd1f2('0x41')){var _0x1edc3d={};_0x1edc3d[_0x5db7f0['name']]={'$like':'%'+_0x2c1d0e[_0xd1f2('0x32')]['filter']+'%'};return _0x1edc3d;}})});}_0x58dd7c=_[_0xd1f2('0x3f')]({},_0x58dd7c,_0x2c1d0e[_0xd1f2('0x42')]);var _0x3c4cc1={'where':_0x58dd7c[_0xd1f2('0x3c')]};return db[_0xd1f2('0x2e')]['count'](_0x3c4cc1)[_0xd1f2('0x43')](function(_0x468311){_0x174306['count']=_0x468311;if(_0x2c1d0e[_0xd1f2('0x32')]['includeAll']){_0x58dd7c[_0xd1f2('0x44')]=[{'all':!![]}];}return db[_0xd1f2('0x2e')][_0xd1f2('0x45')](_0x58dd7c);})['then'](function(_0x3af39d){_0x174306['rows']=_0x3af39d;return _0x174306;})[_0xd1f2('0x43')](respondWithFilteredResult(_0x3e5e6c,_0x58dd7c))[_0xd1f2('0x46')](handleError(_0x3e5e6c,null));};exports[_0xd1f2('0x47')]=function(_0x6c46f8,_0x4256b6){var _0x1cca88={'raw':!![],'where':{'id':_0x6c46f8[_0xd1f2('0x48')]['id']}},_0x436b8b={};_0x436b8b['model']=_[_0xd1f2('0x33')](db[_0xd1f2('0x2e')][_0xd1f2('0x49')]);_0x436b8b[_0xd1f2('0x32')]=_[_0xd1f2('0x33')](_0x6c46f8[_0xd1f2('0x32')]);_0x436b8b['filters']=_[_0xd1f2('0x36')](_0x436b8b[_0xd1f2('0x31')],_0x436b8b[_0xd1f2('0x32')]);_0x1cca88['attributes']=_[_0xd1f2('0x36')](_0x436b8b[_0xd1f2('0x31')],qs[_0xd1f2('0x37')](_0x6c46f8[_0xd1f2('0x32')][_0xd1f2('0x37')]));_0x1cca88[_0xd1f2('0x35')]=_0x1cca88['attributes'][_0xd1f2('0x38')]?_0x1cca88[_0xd1f2('0x35')]:_0x436b8b[_0xd1f2('0x31')];if(_0x6c46f8[_0xd1f2('0x32')]['includeAll']){_0x1cca88[_0xd1f2('0x44')]=[{'all':!![]}];}_0x1cca88=_[_0xd1f2('0x3f')]({},_0x1cca88,_0x6c46f8['options']);return db[_0xd1f2('0x2e')]['find'](_0x1cca88)[_0xd1f2('0x43')](handleEntityNotFound(_0x4256b6,null))['then'](respondWithResult(_0x4256b6,null))[_0xd1f2('0x46')](handleError(_0x4256b6,null));};exports[_0xd1f2('0x4a')]=function(_0x45b0c6,_0x1b7b47){return db[_0xd1f2('0x2e')][_0xd1f2('0x4a')](_0x45b0c6['body'],{})[_0xd1f2('0x43')](respondWithResult(_0x1b7b47,0xc9))[_0xd1f2('0x46')](handleError(_0x1b7b47,null));};exports[_0xd1f2('0x4b')]=function(_0x83734e,_0xc33ad5){if(_0x83734e['body']['id']){delete _0x83734e[_0xd1f2('0x4c')]['id'];}return db[_0xd1f2('0x2e')][_0xd1f2('0x4d')]({'where':{'id':_0x83734e[_0xd1f2('0x48')]['id']}})[_0xd1f2('0x43')](handleEntityNotFound(_0xc33ad5,null))['then'](saveUpdates(_0x83734e[_0xd1f2('0x4c')],null))[_0xd1f2('0x43')](respondWithResult(_0xc33ad5,null))[_0xd1f2('0x46')](handleError(_0xc33ad5,null));};exports[_0xd1f2('0x4e')]=function(_0x23b429,_0x1f7d4c){return db[_0xd1f2('0x2e')][_0xd1f2('0x4d')]({'where':{'id':_0x23b429[_0xd1f2('0x48')]['id']}})[_0xd1f2('0x43')](handleEntityNotFound(_0x1f7d4c,null))['then'](removeEntity(_0x1f7d4c,null))['catch'](handleError(_0x1f7d4c,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 7008856..f9ccc70 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 _0x165d=['request-promise','rimraf','../../config/environment','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3af76b,_0x3ff964){var _0x441064=function(_0xe0529a){while(--_0xe0529a){_0x3af76b['push'](_0x3af76b['shift']());}};_0x441064(++_0x3ff964);}(_0x165d,0x14a));var _0xd165=function(_0x3a6b72,_0x25fd76){_0x3a6b72=_0x3a6b72-0x0;var _0x2d1ca2=_0x165d[_0x3a6b72];return _0x2d1ca2;};'use strict';var _=require(_0xd165('0x0'));var util=require(_0xd165('0x1'));var logger=require(_0xd165('0x2'))(_0xd165('0x3'));var moment=require(_0xd165('0x4'));var BPromise=require(_0xd165('0x5'));var rp=require(_0xd165('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd165('0x7'));var config=require(_0xd165('0x8'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x5435f9,_0x42d256){return _0x5435f9[_0xd165('0x9')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd165('0xa'),'collate':_0xd165('0xb')});}; \ No newline at end of file +var _0xf0ba=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','exports','define','WhatsappApplication'];(function(_0x1e3f11,_0x5d000a){var _0x268233=function(_0x5137d1){while(--_0x5137d1){_0x1e3f11['push'](_0x1e3f11['shift']());}};_0x268233(++_0x5d000a);}(_0xf0ba,0x1ed));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaf0b('0x0'));var util=require(_0xaf0b('0x1'));var logger=require(_0xaf0b('0x2'))(_0xaf0b('0x3'));var moment=require(_0xaf0b('0x4'));var BPromise=require('bluebird');var rp=require(_0xaf0b('0x5'));var fs=require('fs');var path=require(_0xaf0b('0x6'));var rimraf=require('rimraf');var config=require(_0xaf0b('0x7'));var attributes=require('./whatsappApplication.attributes');module[_0xaf0b('0x8')]=function(_0x4b3b85,_0x4d1479){return _0x4b3b85[_0xaf0b('0x9')](_0xaf0b('0xa'),attributes,{'tableName':_0xaf0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xaf0b('0xc'),'collate':_0xaf0b('0xd')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 10072a8..3c19bcc 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 _0xac31=['code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x21cae3,_0x48a5b6){var _0x31d4e0=function(_0x1786ef){while(--_0x1786ef){_0x21cae3['push'](_0x21cae3['shift']());}};_0x31d4e0(++_0x48a5b6);}(_0xac31,0xca));var _0x1ac3=function(_0x271b45,_0x432076){_0x271b45=_0x271b45-0x0;var _0x35b609=_0xac31[_0x271b45];return _0x35b609;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('WhatsappApplication,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0x98a8=['request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1d5a5b,_0x4482dc){var _0x245785=function(_0x80b9e5){while(--_0x80b9e5){_0x1d5a5b['push'](_0x1d5a5b['shift']());}};_0x245785(++_0x4482dc);}(_0x98a8,0x12c));var _0x898a=function(_0x395054,_0x3cada4){_0x395054=_0x395054-0x0;var _0x274ee2=_0x98a8[_0x395054];return _0x274ee2;};'use strict';var _=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var moment=require(_0x898a('0x2'));var BPromise=require(_0x898a('0x3'));var rs=require(_0x898a('0x4'));var fs=require('fs');var Redis=require(_0x898a('0x5'));var db=require(_0x898a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x898a('0x7'))(_0x898a('0x8'));var config=require(_0x898a('0x9'));var jayson=require(_0x898a('0xa'));var client=jayson[_0x898a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3aadc2,_0x564583,_0xfa8c50){return new BPromise(function(_0x4fbce5,_0x42021d){return client[_0x898a('0xc')](_0x3aadc2,_0xfa8c50)[_0x898a('0xd')](function(_0x96b636){logger[_0x898a('0xe')](_0x898a('0xf'),_0x564583,_0x898a('0x10'));logger[_0x898a('0x11')](_0x898a('0x12'),_0x564583,'request\x20sent',JSON[_0x898a('0x13')](_0x96b636));if(_0x96b636['error']){if(_0x96b636[_0x898a('0x14')]['code']===0x1f4){logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')]['message']);return _0x42021d(_0x96b636['error']['message']);}logger[_0x898a('0x14')](_0x898a('0xf'),_0x564583,_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);return _0x4fbce5(_0x96b636[_0x898a('0x14')][_0x898a('0x15')]);}else{logger['info'](_0x898a('0xf'),_0x564583,'request\x20sent');_0x4fbce5(_0x96b636[_0x898a('0x16')]['message']);}})[_0x898a('0x17')](function(_0x4fb05b){logger[_0x898a('0x14')]('WhatsappApplication,\x20%s,\x20%s',_0x564583,_0x4fb05b);_0x42021d(_0x4fb05b);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index ea3cb7b..e438a4b 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 _0xa899=['/:id/messages','tracked','whatsappinteraction:addtags','addTags','put','whatsapp','delete','whatsappinteraction:destroy','/:id/tags','removeTags','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id','getMessages','/:id/download','download','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa899,0x155));var _0x9a89=function(_0x5933fb,_0x9115ad){_0x5933fb=_0x5933fb-0x0;var _0x44d988=_0xa899[_0x5933fb];return _0x44d988;};'use strict';var multer=require(_0x9a89('0x0'));var util=require(_0x9a89('0x1'));var path=require(_0x9a89('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a89('0x3'));var router=express[_0x9a89('0x4')]();var fs_extra=require(_0x9a89('0x5'));var auth=require(_0x9a89('0x6'));var interaction=require(_0x9a89('0x7'));var config=require(_0x9a89('0x8'));var controller=require(_0x9a89('0x9'));router[_0x9a89('0xa')]('/',auth[_0x9a89('0xb')](),controller[_0x9a89('0xc')]);router[_0x9a89('0xa')](_0x9a89('0xd'),auth[_0x9a89('0xb')](),controller['describe']);router['get'](_0x9a89('0xe'),auth[_0x9a89('0xb')](),controller['show']);router[_0x9a89('0xa')]('/:id/messages',auth[_0x9a89('0xb')](),controller[_0x9a89('0xf')]);router[_0x9a89('0xa')](_0x9a89('0x10'),auth[_0x9a89('0xb')](),controller[_0x9a89('0x11')]);router[_0x9a89('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x9a89('0x12')](_0x9a89('0x13'),auth[_0x9a89('0xb')](),controller['addMessage']);router['post']('/:id/tags',auth[_0x9a89('0xb')](),interaction[_0x9a89('0x14')]('whatsapp',_0x9a89('0x15')),controller[_0x9a89('0x16')]);router[_0x9a89('0x17')](_0x9a89('0xe'),auth['isAuthenticated'](),interaction[_0x9a89('0x14')](_0x9a89('0x18'),'whatsappinteraction:update'),controller['update']);router[_0x9a89('0x19')]('/:id',auth[_0x9a89('0xb')](),interaction[_0x9a89('0x14')]('whatsapp',_0x9a89('0x1a')),controller['destroy']);router[_0x9a89('0x19')](_0x9a89('0x1b'),auth['isAuthenticated'](),controller[_0x9a89('0x1c')]);module[_0x9a89('0x1d')]=router; \ No newline at end of file +var _0xf9d5=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','getMessages','download','post','create','/:id/messages','/:id/tags','whatsapp','whatsappinteraction:addtags','tracked','whatsappinteraction:update','destroy','delete','removeTags','exports'];(function(_0x165ec4,_0x1d0f75){var _0x352800=function(_0x52fd3f){while(--_0x52fd3f){_0x165ec4['push'](_0x165ec4['shift']());}};_0x352800(++_0x1d0f75);}(_0xf9d5,0x122));var _0x5f9d=function(_0x46c9a5,_0x1cb9e7){_0x46c9a5=_0x46c9a5-0x0;var _0x5e3eec=_0xf9d5[_0x46c9a5];return _0x5e3eec;};'use strict';var multer=require('multer');var util=require(_0x5f9d('0x0'));var path=require(_0x5f9d('0x1'));var timeout=require('connect-timeout');var express=require(_0x5f9d('0x2'));var router=express[_0x5f9d('0x3')]();var fs_extra=require(_0x5f9d('0x4'));var auth=require(_0x5f9d('0x5'));var interaction=require(_0x5f9d('0x6'));var config=require(_0x5f9d('0x7'));var controller=require(_0x5f9d('0x8'));router['get']('/',auth[_0x5f9d('0x9')](),controller['index']);router[_0x5f9d('0xa')](_0x5f9d('0xb'),auth['isAuthenticated'](),controller[_0x5f9d('0xc')]);router[_0x5f9d('0xa')](_0x5f9d('0xd'),auth[_0x5f9d('0x9')](),controller[_0x5f9d('0xe')]);router[_0x5f9d('0xa')]('/:id/messages',auth[_0x5f9d('0x9')](),controller[_0x5f9d('0xf')]);router['get']('/:id/download',auth[_0x5f9d('0x9')](),controller[_0x5f9d('0x10')]);router[_0x5f9d('0x11')]('/',auth['isAuthenticated'](),controller[_0x5f9d('0x12')]);router[_0x5f9d('0x11')](_0x5f9d('0x13'),auth[_0x5f9d('0x9')](),controller['addMessage']);router[_0x5f9d('0x11')](_0x5f9d('0x14'),auth[_0x5f9d('0x9')](),interaction['tracked'](_0x5f9d('0x15'),_0x5f9d('0x16')),controller['addTags']);router['put'](_0x5f9d('0xd'),auth[_0x5f9d('0x9')](),interaction[_0x5f9d('0x17')](_0x5f9d('0x15'),_0x5f9d('0x18')),controller['update']);router['delete']('/:id',auth[_0x5f9d('0x9')](),interaction['tracked'](_0x5f9d('0x15'),'whatsappinteraction:destroy'),controller[_0x5f9d('0x19')]);router[_0x5f9d('0x1a')](_0x5f9d('0x14'),auth['isAuthenticated'](),controller[_0x5f9d('0x1b')]);module[_0x5f9d('0x1c')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index a4b4bf3..b1464b0 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 _0xd9eb=['STRING','ENUM','out','INTEGER','sequelize','moment','exports','BOOLEAN','DATE'];(function(_0x434e89,_0x542132){var _0x1c90c5=function(_0x55cfda){while(--_0x55cfda){_0x434e89['push'](_0x434e89['shift']());}};_0x1c90c5(++_0x542132);}(_0xd9eb,0xca));var _0xbd9e=function(_0x505f51,_0x1a3e1d){_0x505f51=_0x505f51-0x0;var _0x5468b3=_0xd9eb[_0x505f51];return _0x5468b3;};'use strict';var Sequelize=require(_0xbd9e('0x0'));var moment=require(_0xbd9e('0x1'));module[_0xbd9e('0x2')]={'closed':{'type':Sequelize[_0xbd9e('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbd9e('0x4')]},'disposition':{'type':Sequelize[_0xbd9e('0x5')]},'secondDisposition':{'type':Sequelize[_0xbd9e('0x5')]},'thirdDisposition':{'type':Sequelize[_0xbd9e('0x5')]},'note':{'type':Sequelize[_0xbd9e('0x5')]},'phone':{'type':Sequelize[_0xbd9e('0x5')]},'read1stAt':{'type':Sequelize[_0xbd9e('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xbd9e('0x6')]('in',_0xbd9e('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xbd9e('0x6')]('in',_0xbd9e('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xbd9e('0x3')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xbd9e('0x8')]}}; \ No newline at end of file +var _0xc224=['moment','exports','DATE','STRING','ENUM','out','BOOLEAN','INTEGER','sequelize'];(function(_0x49eaed,_0x38b981){var _0x262b66=function(_0x1bc243){while(--_0x1bc243){_0x49eaed['push'](_0x49eaed['shift']());}};_0x262b66(++_0x38b981);}(_0xc224,0x1af));var _0x4c22=function(_0x123038,_0x3f4470){_0x123038=_0x123038-0x0;var _0x3be01a=_0xc224[_0x123038];return _0x3be01a;};'use strict';var Sequelize=require(_0x4c22('0x0'));var moment=require(_0x4c22('0x1'));module[_0x4c22('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4c22('0x3')]},'disposition':{'type':Sequelize[_0x4c22('0x4')]},'secondDisposition':{'type':Sequelize[_0x4c22('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4c22('0x4')]},'note':{'type':Sequelize[_0x4c22('0x4')]},'phone':{'type':Sequelize[_0x4c22('0x4')]},'read1stAt':{'type':Sequelize[_0x4c22('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4c22('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x4c22('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4c22('0x7')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x4c22('0x8')]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index ae46199..c1e7afd 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 _0xd1bd=['firstName','Attachment','direction','secret','read','WhatsappAccount','Account','Owner','mkdirSync','Whatsapp','N.A.','closed','closedAt','toString','disposition','basename','createReadStream','pipe','out','System','lastName','value','downloadInteraction.ejs','transcript-','download','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','ejs','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','error','stack','name','send','index','map','WhatsappInteraction','rawAttributes','fieldName','key','getOptions','findAll','whatsapp','query','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','update','find','describe','addMessage','WhatsappMessage','ids','getMessages','hasOwnProperty','nolimit','sort','filters','pick','where','WhatsappInteractionId','filter','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','color','removeTags','unix','root','server','tmp','files','attachments','join','format','push','User','fullname','Contact'];(function(_0x543f9f,_0x563bf5){var _0x23e5d3=function(_0x5cd0e0){while(--_0x5cd0e0){_0x543f9f['push'](_0x543f9f['shift']());}};_0x23e5d3(++_0x563bf5);}(_0xd1bd,0x184));var _0xdd1b=function(_0x156091,_0x577de1){_0x156091=_0x156091-0x0;var _0x3c429c=_0xd1bd[_0x156091];return _0x3c429c;};'use strict';var rimraf=require(_0xdd1b('0x0'));var zipdir=require(_0xdd1b('0x1'));var moment=require(_0xdd1b('0x2'));var BPromise=require(_0xdd1b('0x3'));var util=require(_0xdd1b('0x4'));var path=require('path');var ejs=require(_0xdd1b('0x5'));var fs=require('fs');var _=require(_0xdd1b('0x6'));var Redis=require('ioredis');var interaction=require(_0xdd1b('0x7'));var qs=require(_0xdd1b('0x8'));var pdf=require(_0xdd1b('0x9'));var logger=require('../../config/logger')(_0xdd1b('0xa'));var config=require(_0xdd1b('0xb'));var db=require(_0xdd1b('0xc'))['db'];config[_0xdd1b('0xd')]=_[_0xdd1b('0xe')](config[_0xdd1b('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xdd1b('0xf'))(new Redis(config[_0xdd1b('0xd')]));require(_0xdd1b('0x10'))[_0xdd1b('0x11')](socket);function respondWithStatusCode(_0x3c1604,_0x2851cb){_0x2851cb=_0x2851cb||0xcc;return function(_0x51b54b){if(_0x51b54b){return _0x3c1604[_0xdd1b('0x12')](_0x2851cb);}return _0x3c1604['status'](_0x2851cb)[_0xdd1b('0x13')]();};}function respondWithResult(_0x58d661,_0x4993cf){_0x4993cf=_0x4993cf||0xc8;return function(_0x6831a3){if(_0x6831a3){return _0x58d661[_0xdd1b('0x14')](_0x4993cf)[_0xdd1b('0x15')](_0x6831a3);}};}function respondWithFilteredResult(_0x2ecff8,_0x259583){return function(_0x441dbb){if(_0x441dbb){var _0x25b70a=typeof _0x259583[_0xdd1b('0x16')]===_0xdd1b('0x17')&&typeof _0x259583[_0xdd1b('0x18')]===_0xdd1b('0x17');var _0x1cf7ad=_0x441dbb['count'];var _0x19b02c=_0x25b70a?0x0:_0x259583[_0xdd1b('0x16')];var _0x307173=_0x25b70a?_0x441dbb[_0xdd1b('0x19')]:_0x259583[_0xdd1b('0x16')]+_0x259583['limit'];var _0x438a07;if(_0x307173>=_0x1cf7ad){_0x307173=_0x1cf7ad;_0x438a07=0xc8;}else{_0x438a07=0xce;}_0x2ecff8['status'](_0x438a07);return _0x2ecff8[_0xdd1b('0x1a')](_0xdd1b('0x1b'),_0x19b02c+'-'+_0x307173+'/'+_0x1cf7ad)[_0xdd1b('0x15')](_0x441dbb);}return null;};}function saveUpdates(_0x53260a){return function(_0xf0e7c2){if(_0xf0e7c2){return _0xf0e7c2['update'](_0x53260a)[_0xdd1b('0x1c')](function(_0x2386c2){return _0x2386c2;});}return null;};}function removeEntity(_0x21ed00){return function(_0x3c68e3){if(_0x3c68e3){return _0x3c68e3[_0xdd1b('0x1d')]()[_0xdd1b('0x1c')](function(){_0x21ed00['status'](0xcc)[_0xdd1b('0x13')]();});}};}function handleEntityNotFound(_0x4b2663){return function(_0x2b59b7){if(!_0x2b59b7){_0x4b2663[_0xdd1b('0x12')](0x194);}return _0x2b59b7;};}function handleError(_0x186959,_0x22c61b){_0x22c61b=_0x22c61b||0x1f4;return function(_0x3056aa){logger[_0xdd1b('0x1e')](_0x3056aa[_0xdd1b('0x1f')]);if(_0x3056aa[_0xdd1b('0x20')]){delete _0x3056aa['name'];}_0x186959['status'](_0x22c61b)[_0xdd1b('0x21')](_0x3056aa);};}exports[_0xdd1b('0x22')]=function(_0x2c76f4,_0x1602f3){var _0x2e399f={};var _0x2174a2=_[_0xdd1b('0x23')](db[_0xdd1b('0x24')][_0xdd1b('0x25')],function(_0x18f15e){return{'name':_0x18f15e[_0xdd1b('0x26')],'type':_0x18f15e['type'][_0xdd1b('0x27')]};});_0x2e399f=qs[_0xdd1b('0x28')](_0x2174a2,_0x2c76f4);return interaction[_0xdd1b('0x29')](_0xdd1b('0x2a'),_0x2c76f4[_0xdd1b('0x2b')],_0x2c76f4['user'],_0x2e399f,_0x2174a2)['then'](respondWithFilteredResult(_0x1602f3,_0x2e399f))[_0xdd1b('0x2c')](handleError(_0x1602f3,null));};exports[_0xdd1b('0x2d')]=function(_0x205bc1,_0x138628){var _0x5bb471={'raw':![],'where':{'id':_0x205bc1[_0xdd1b('0x2e')]['id']}},_0x38435d={};_0x38435d[_0xdd1b('0x2f')]=_[_0xdd1b('0x30')](db[_0xdd1b('0x24')][_0xdd1b('0x25')]);_0x38435d[_0xdd1b('0x2b')]=_[_0xdd1b('0x30')](_0x205bc1[_0xdd1b('0x2b')]);_0x38435d['filters']=_[_0xdd1b('0x31')](_0x38435d[_0xdd1b('0x2f')],_0x38435d[_0xdd1b('0x2b')]);_0x5bb471[_0xdd1b('0x32')]=_[_0xdd1b('0x31')](_0x38435d['model'],qs[_0xdd1b('0x33')](_0x205bc1['query'][_0xdd1b('0x33')]));_0x5bb471[_0xdd1b('0x32')]=_0x5bb471['attributes'][_0xdd1b('0x34')]?_0x5bb471['attributes']:_0x38435d[_0xdd1b('0x2f')];if(_0x205bc1[_0xdd1b('0x2b')][_0xdd1b('0x35')]){_0x5bb471[_0xdd1b('0x36')]=[{'all':!![]}];}_0x5bb471=_[_0xdd1b('0x37')]({},_0x5bb471,_0x205bc1[_0xdd1b('0x38')]);return db['WhatsappInteraction']['find'](_0x5bb471)['then'](handleEntityNotFound(_0x138628,null))[_0xdd1b('0x1c')](respondWithResult(_0x138628,null))[_0xdd1b('0x2c')](handleError(_0x138628,null));};exports[_0xdd1b('0x39')]=function(_0x2c1bf5,_0x1ff68e){return db[_0xdd1b('0x24')]['create'](_0x2c1bf5[_0xdd1b('0x3a')],{})[_0xdd1b('0x1c')](respondWithResult(_0x1ff68e,0xc9))['catch'](handleError(_0x1ff68e,null));};exports[_0xdd1b('0x3b')]=function(_0x13baae,_0x21b93b){if(_0x13baae[_0xdd1b('0x3a')]['id']){delete _0x13baae[_0xdd1b('0x3a')]['id'];}return db[_0xdd1b('0x24')]['find']({'where':{'id':_0x13baae[_0xdd1b('0x2e')]['id']}})['then'](handleEntityNotFound(_0x21b93b,null))[_0xdd1b('0x1c')](saveUpdates(_0x13baae['body'],null))['then'](respondWithResult(_0x21b93b,null))[_0xdd1b('0x2c')](handleError(_0x21b93b,null));};exports[_0xdd1b('0x1d')]=function(_0x3c1088,_0x140fd0){return db['WhatsappInteraction'][_0xdd1b('0x3c')]({'where':{'id':_0x3c1088[_0xdd1b('0x2e')]['id']}})['then'](handleEntityNotFound(_0x140fd0,null))[_0xdd1b('0x1c')](removeEntity(_0x140fd0,null))[_0xdd1b('0x2c')](handleError(_0x140fd0,null));};exports[_0xdd1b('0x3d')]=function(_0x442252,_0x1049d0){return db[_0xdd1b('0x24')]['describe']()['then'](respondWithResult(_0x1049d0,null))[_0xdd1b('0x2c')](handleError(_0x1049d0,null));};exports[_0xdd1b('0x3e')]=function(_0x330eed,_0x23c440){return db[_0xdd1b('0x3f')][_0xdd1b('0x3c')]({'where':{'id':_0x330eed[_0xdd1b('0x2e')]['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x23c440,null))['then'](function(_0x3fa8c7){if(_0x3fa8c7){return _0x3fa8c7[_0xdd1b('0x3e')](_0x330eed['body'][_0xdd1b('0x40')],_['omit'](_0x330eed[_0xdd1b('0x3a')],['ids','id'])||{});}})[_0xdd1b('0x1c')](respondWithResult(_0x23c440,null))[_0xdd1b('0x2c')](handleError(_0x23c440,null));};exports[_0xdd1b('0x41')]=function(_0x295b71,_0x1c811c){var _0x4c15c6={'raw':![],'where':{}};var _0x5d1a6b={};var _0x512a3a={'count':0x0,'rows':[]};return db['WhatsappInteraction']['findOne']({'where':{'id':_0x295b71[_0xdd1b('0x2e')]['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x1c811c,null))[_0xdd1b('0x1c')](function(_0x21f03f){if(_0x21f03f){_0x5d1a6b[_0xdd1b('0x2f')]=_['keys'](db[_0xdd1b('0x3f')][_0xdd1b('0x25')]);_0x5d1a6b[_0xdd1b('0x2b')]=_['keys'](_0x295b71['query']);_0x5d1a6b['filters']=_[_0xdd1b('0x31')](_0x5d1a6b[_0xdd1b('0x2f')],_0x5d1a6b[_0xdd1b('0x2b')]);_0x4c15c6[_0xdd1b('0x32')]=_[_0xdd1b('0x31')](_0x5d1a6b[_0xdd1b('0x2f')],qs[_0xdd1b('0x33')](_0x295b71[_0xdd1b('0x2b')][_0xdd1b('0x33')]));_0x4c15c6[_0xdd1b('0x32')]=_0x4c15c6[_0xdd1b('0x32')][_0xdd1b('0x34')]?_0x4c15c6['attributes']:_0x5d1a6b[_0xdd1b('0x2f')];if(!_0x295b71[_0xdd1b('0x2b')][_0xdd1b('0x42')](_0xdd1b('0x43'))){_0x4c15c6[_0xdd1b('0x18')]=qs['limit'](_0x295b71[_0xdd1b('0x2b')][_0xdd1b('0x18')]);_0x4c15c6[_0xdd1b('0x16')]=qs['offset'](_0x295b71[_0xdd1b('0x2b')]['offset']);}_0x4c15c6['order']=qs[_0xdd1b('0x44')](_0x295b71[_0xdd1b('0x2b')]['sort']);_0x4c15c6['where']=qs[_0xdd1b('0x45')](_[_0xdd1b('0x46')](_0x295b71['query'],_0x5d1a6b['filters']));_0x4c15c6[_0xdd1b('0x47')][_0xdd1b('0x48')]=_0x21f03f['id'];if(_0x295b71[_0xdd1b('0x2b')]['filter']){_0x4c15c6[_0xdd1b('0x47')]=_['merge'](_0x4c15c6[_0xdd1b('0x47')],{'$or':_[_0xdd1b('0x23')](_0x4c15c6[_0xdd1b('0x32')],function(_0x45cb2e){var _0x235893={};_0x235893[_0x45cb2e]={'$like':'%'+_0x295b71[_0xdd1b('0x2b')][_0xdd1b('0x49')]+'%'};return _0x235893;})});}if(_0x295b71[_0xdd1b('0x2b')][_0xdd1b('0x4a')]){var _0x37b249=_0x295b71[_0xdd1b('0x2b')][_0xdd1b('0x4a')]['split'](',');var _0x4cbf36={};_0x4cbf36[_0x37b249[0x0]]={'$gte':moment(_0x37b249[0x1])['format'](_0xdd1b('0x4b'))};_0x4c15c6[_0xdd1b('0x47')]=_[_0xdd1b('0x37')](_0x4c15c6['where'],_0x4cbf36);}_0x4c15c6=_[_0xdd1b('0x37')]({},_0x4c15c6,_0x295b71[_0xdd1b('0x38')]);return db['WhatsappMessage'][_0xdd1b('0x19')]({'where':_0x4c15c6[_0xdd1b('0x47')]})[_0xdd1b('0x1c')](function(_0x2c081d){_0x512a3a[_0xdd1b('0x19')]=_0x2c081d;if(_0x295b71[_0xdd1b('0x2b')][_0xdd1b('0x35')]){_0x4c15c6[_0xdd1b('0x36')]=[{'all':!![]}];}return db[_0xdd1b('0x3f')][_0xdd1b('0x29')](_0x4c15c6);})[_0xdd1b('0x1c')](function(_0x4c0325){_0x512a3a[_0xdd1b('0x4c')]=_0x4c0325;return _0x512a3a;});}})['then'](respondWithFilteredResult(_0x1c811c,_0x4c15c6))[_0xdd1b('0x2c')](handleError(_0x1c811c,null));};exports['addTags']=function(_0x2b8e37,_0x49333a){return db['WhatsappInteraction'][_0xdd1b('0x3c')]({'where':{'id':_0x2b8e37[_0xdd1b('0x2e')]['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x49333a,null))[_0xdd1b('0x1c')](function(_0x521d51){if(_0x521d51){return _0x521d51[_0xdd1b('0x4d')](_0x2b8e37[_0xdd1b('0x3a')][_0xdd1b('0x40')],_['omit'](_0x2b8e37[_0xdd1b('0x3a')],[_0xdd1b('0x40'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id','name',_0xdd1b('0x4e')],'where':{'id':_0x2b8e37[_0xdd1b('0x3a')][_0xdd1b('0x40')]}});})[_0xdd1b('0x1c')](function(_0x2a11a6){socket['emit']('whatsappInteractionTags:save',{'id':Number(_0x2b8e37[_0xdd1b('0x2e')]['id']),'tags':_0x2a11a6||[]});return{'id':Number(_0x2b8e37[_0xdd1b('0x2e')]['id']),'tags':_0x2a11a6||[]};});}})[_0xdd1b('0x1c')](respondWithResult(_0x49333a,null))[_0xdd1b('0x2c')](handleError(_0x49333a,null));};exports[_0xdd1b('0x4f')]=function(_0x2254c1,_0x69a213){return db[_0xdd1b('0x24')][_0xdd1b('0x3c')]({'where':{'id':_0x2254c1[_0xdd1b('0x2e')]['id']}})[_0xdd1b('0x1c')](handleEntityNotFound(_0x69a213,null))[_0xdd1b('0x1c')](function(_0x1b58ff){if(_0x1b58ff){return _0x1b58ff[_0xdd1b('0x4f')](_0x2254c1[_0xdd1b('0x2b')]['ids']);}})['then'](respondWithStatusCode(_0x69a213,null))[_0xdd1b('0x2c')](handleError(_0x69a213,null));};exports['download']=function(_0x33cdd6,_0x59a9ea){var _0x59f103=moment()[_0xdd1b('0x50')]()['toString']();var _0x3df758=path['join'](config[_0xdd1b('0x51')],_0xdd1b('0x52'),'files',_0xdd1b('0x53'));var _0x2a7dbb=path['join'](config['root'],_0xdd1b('0x52'),_0xdd1b('0x54'),_0xdd1b('0x55'));var _0x1bd371=path[_0xdd1b('0x56')](_0x3df758,_0x59f103);var _0x183789=util[_0xdd1b('0x57')]('transcript-%d-%s.zip',_0x33cdd6['params']['id'],_0x59f103);var _0x1c3ffa=path[_0xdd1b('0x56')](_0x3df758,_0x183789);var _0x3c85ab=[];_0x3c85ab[_0xdd1b('0x58')]({'model':db[_0xdd1b('0x59')],'as':_0xdd1b('0x59'),'attributes':['id',_0xdd1b('0x5a')],'raw':!![]});_0x3c85ab[_0xdd1b('0x58')]({'model':db['CmContact'],'as':_0xdd1b('0x5b'),'attributes':['id',_0xdd1b('0x5c'),'lastName'],'raw':!![]});if(_0x33cdd6[_0xdd1b('0x2b')][_0xdd1b('0x55')]){_0x3c85ab[_0xdd1b('0x58')]({'model':db[_0xdd1b('0x5d')],'as':_0xdd1b('0x5d'),'raw':!![]});}var _0x3c9623=[{'model':db[_0xdd1b('0x3f')],'as':'Messages','attributes':['id',_0xdd1b('0x3a'),'createdAt',_0xdd1b('0x5e'),_0xdd1b('0x5f'),_0xdd1b('0x60')],'include':_0x3c85ab}];_0x3c9623['push']({'model':db[_0xdd1b('0x61')],'as':_0xdd1b('0x62'),'attributes':['id',_0xdd1b('0x20')]});_0x3c9623[_0xdd1b('0x58')]({'model':db[_0xdd1b('0x59')],'as':_0xdd1b('0x63'),'attributes':['id',_0xdd1b('0x5a')]});return db[_0xdd1b('0x24')][_0xdd1b('0x3c')]({'where':{'id':_0x33cdd6[_0xdd1b('0x2e')]['id']},'include':_0x3c9623})[_0xdd1b('0x1c')](handleEntityNotFound(_0x59a9ea,null))[_0xdd1b('0x1c')](function(_0x5033d5){if(_0x5033d5){var _0x569b63=_0x5033d5['get']({'plain':!![]});fs[_0xdd1b('0x64')](_0x1bd371);var _0xe6fb9c={'channel':_0xdd1b('0x65'),'account':_0x569b63[_0xdd1b('0x62')][_0xdd1b('0x20')],'agent':_0x569b63['Owner']?_0x569b63['Owner'][_0xdd1b('0x5a')]:_0xdd1b('0x66'),'createdAt':moment(_0x569b63['createdAt'])[_0xdd1b('0x57')](_0xdd1b('0x4b'))['toString'](),'closedAt':_0x569b63[_0xdd1b('0x67')]?moment(_0x569b63[_0xdd1b('0x68')])['format'](_0xdd1b('0x4b'))[_0xdd1b('0x69')]():'','disposition':_0x569b63[_0xdd1b('0x6a')],'messages':_(_0x569b63['Messages'])['filter']({'secret':![]})[_0xdd1b('0x23')](function(_0x22b419){if(_0x22b419['Attachment']){var _0x58a02f=path[_0xdd1b('0x56')](_0x2a7dbb,_0x22b419['Attachment'][_0xdd1b('0x6b')]);if(fs['existsSync'](_0x58a02f)){fs[_0xdd1b('0x6c')](_0x58a02f)[_0xdd1b('0x6d')](fs['createWriteStream'](path['join'](_0x1bd371,_0x22b419[_0xdd1b('0x5d')][_0xdd1b('0x6b')])));}}return{'date':moment(_0x22b419['createdAt'])[_0xdd1b('0x57')](_0xdd1b('0x4b'))[_0xdd1b('0x69')](),'sender':_0x22b419[_0xdd1b('0x5e')]===_0xdd1b('0x6e')?_0x22b419[_0xdd1b('0x59')]?_0x22b419[_0xdd1b('0x59')][_0xdd1b('0x5a')]:_0xdd1b('0x6f'):_0x22b419[_0xdd1b('0x5b')][_0xdd1b('0x5c')]+(_0x22b419['Contact']['lastName']?'\x20'+_0x22b419[_0xdd1b('0x5b')][_0xdd1b('0x70')]:''),'body':_0x22b419[_0xdd1b('0x5d')]?_0x22b419[_0xdd1b('0x5d')][_0xdd1b('0x6b')]:_0x22b419['body'],'direction':_0x22b419[_0xdd1b('0x5e')]===_0xdd1b('0x6e')?'A':'C','secret':_0x22b419[_0xdd1b('0x5f')],'read':_0x22b419[_0xdd1b('0x60')],'attachment':_0x22b419[_0xdd1b('0x5d')]};})[_0xdd1b('0x71')]()};return ejs['renderFile'](path['join'](config[_0xdd1b('0x51')],_0xdd1b('0x52'),'views',_0xdd1b('0x72')),{'interaction':_0xe6fb9c})['then'](function(_0x4848c9){var _0x2a9cc8=path[_0xdd1b('0x56')](_0x1bd371,_0xdd1b('0x73')+_0x569b63['id']+'-'+_0x59f103+'.pdf');var _0x18352e={'path':_0x2a9cc8,'channel':_0xdd1b('0x65'),'interactionId':_0x569b63['id']};return pdf['createPdfFromHTML'](_0x4848c9,_0x18352e);})[_0xdd1b('0x1c')](function(){return new BPromise(function(_0x2770c2,_0x553703){zipdir(_0x1bd371,{'saveTo':_0x1c3ffa},function(_0x1f97ca,_0x35467d){if(_0x1f97ca)return _0x553703(_0x1f97ca);return _0x2770c2(_0x35467d);});})[_0xdd1b('0x1c')](function(){return new BPromise(function(_0x45848e,_0x2a18c3){rimraf(_0x1bd371,function(_0x1f5285){if(_0x1f5285)_0x2a18c3(_0x1f5285);return _0x45848e();});});})[_0xdd1b('0x1c')](function(){return _0x59a9ea[_0xdd1b('0x74')](_0x1c3ffa,_0x183789,function(_0x2ea082){if(_0x2ea082){console[_0xdd1b('0x75')](_0xdd1b('0x76'),_0x2ea082);}else{fs[_0xdd1b('0x77')](_0x1c3ffa);}});});});}else{return _0x59a9ea['sendStatus'](0xc8);}})[_0xdd1b('0x2c')](handleError(_0x59a9ea,null));}; \ No newline at end of file +var _0x77cb=['then','destroy','end','sendStatus','stack','name','index','map','rawAttributes','fieldName','type','key','getOptions','whatsapp','query','catch','show','params','model','keys','WhatsappInteraction','intersection','attributes','length','include','merge','create','body','update','find','describe','WhatsappMessage','ids','omit','getMessages','findOne','fields','nolimit','order','sort','where','filters','pick','WhatsappInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','rows','addTags','setTags','spread','color','whatsappInteractionTags:save','removeTags','download','unix','toString','join','root','server','files','tmp','attachments','format','push','User','fullname','CmContact','Contact','firstName','lastName','Attachment','createdAt','direction','secret','WhatsappAccount','Account','get','mkdirSync','Whatsapp','Owner','N.A.','closedAt','disposition','filter','basename','existsSync','createWriteStream','out','System','read','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','moment','bluebird','ejs','lodash','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','status','json','offset','undefined','limit','count'];(function(_0x3ec501,_0x1d035a){var _0x5a3037=function(_0x383d66){while(--_0x383d66){_0x3ec501['push'](_0x3ec501['shift']());}};_0x5a3037(++_0x1d035a);}(_0x77cb,0x1e1));var _0xb77c=function(_0x1e7812,_0x4a0b31){_0x1e7812=_0x1e7812-0x0;var _0x22c229=_0x77cb[_0x1e7812];return _0x22c229;};'use strict';var rimraf=require(_0xb77c('0x0'));var zipdir=require(_0xb77c('0x1'));var moment=require(_0xb77c('0x2'));var BPromise=require(_0xb77c('0x3'));var util=require('util');var path=require('path');var ejs=require(_0xb77c('0x4'));var fs=require('fs');var _=require(_0xb77c('0x5'));var Redis=require('ioredis');var interaction=require(_0xb77c('0x6'));var qs=require('../../components/parsers/qs');var pdf=require(_0xb77c('0x7'));var logger=require(_0xb77c('0x8'))(_0xb77c('0x9'));var config=require(_0xb77c('0xa'));var db=require(_0xb77c('0xb'))['db'];config[_0xb77c('0xc')]=_[_0xb77c('0xd')](config[_0xb77c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xb77c('0xe'))(new Redis(config[_0xb77c('0xc')]));require(_0xb77c('0xf'))[_0xb77c('0x10')](socket);function respondWithStatusCode(_0x262607,_0x4066db){_0x4066db=_0x4066db||0xcc;return function(_0x49e90e){if(_0x49e90e){return _0x262607['sendStatus'](_0x4066db);}return _0x262607[_0xb77c('0x11')](_0x4066db)['end']();};}function respondWithResult(_0x532b65,_0x56d169){_0x56d169=_0x56d169||0xc8;return function(_0x33c2b1){if(_0x33c2b1){return _0x532b65[_0xb77c('0x11')](_0x56d169)[_0xb77c('0x12')](_0x33c2b1);}};}function respondWithFilteredResult(_0x3c42f5,_0x8f164d){return function(_0x52dbcf){if(_0x52dbcf){var _0x9c82d=typeof _0x8f164d[_0xb77c('0x13')]===_0xb77c('0x14')&&typeof _0x8f164d[_0xb77c('0x15')]===_0xb77c('0x14');var _0x2f1e1a=_0x52dbcf[_0xb77c('0x16')];var _0x40bfa0=_0x9c82d?0x0:_0x8f164d[_0xb77c('0x13')];var _0x1985c1=_0x9c82d?_0x52dbcf[_0xb77c('0x16')]:_0x8f164d[_0xb77c('0x13')]+_0x8f164d[_0xb77c('0x15')];var _0x39f94a;if(_0x1985c1>=_0x2f1e1a){_0x1985c1=_0x2f1e1a;_0x39f94a=0xc8;}else{_0x39f94a=0xce;}_0x3c42f5[_0xb77c('0x11')](_0x39f94a);return _0x3c42f5['set']('Content-Range',_0x40bfa0+'-'+_0x1985c1+'/'+_0x2f1e1a)[_0xb77c('0x12')](_0x52dbcf);}return null;};}function saveUpdates(_0x7317e7){return function(_0x529f61){if(_0x529f61){return _0x529f61['update'](_0x7317e7)[_0xb77c('0x17')](function(_0x526b01){return _0x526b01;});}return null;};}function removeEntity(_0x2923f2){return function(_0x4c14d7){if(_0x4c14d7){return _0x4c14d7[_0xb77c('0x18')]()['then'](function(){_0x2923f2[_0xb77c('0x11')](0xcc)[_0xb77c('0x19')]();});}};}function handleEntityNotFound(_0x4cca2e){return function(_0x570204){if(!_0x570204){_0x4cca2e[_0xb77c('0x1a')](0x194);}return _0x570204;};}function handleError(_0x387610,_0x52edca){_0x52edca=_0x52edca||0x1f4;return function(_0x322a24){logger['error'](_0x322a24[_0xb77c('0x1b')]);if(_0x322a24[_0xb77c('0x1c')]){delete _0x322a24['name'];}_0x387610['status'](_0x52edca)['send'](_0x322a24);};}exports[_0xb77c('0x1d')]=function(_0x3ef83b,_0x559e60){var _0x391496={};var _0x38eb5d=_[_0xb77c('0x1e')](db['WhatsappInteraction'][_0xb77c('0x1f')],function(_0x3bab6c){return{'name':_0x3bab6c[_0xb77c('0x20')],'type':_0x3bab6c[_0xb77c('0x21')][_0xb77c('0x22')]};});_0x391496=qs[_0xb77c('0x23')](_0x38eb5d,_0x3ef83b);return interaction['findAll'](_0xb77c('0x24'),_0x3ef83b[_0xb77c('0x25')],_0x3ef83b['user'],_0x391496,_0x38eb5d)[_0xb77c('0x17')](respondWithFilteredResult(_0x559e60,_0x391496))[_0xb77c('0x26')](handleError(_0x559e60,null));};exports[_0xb77c('0x27')]=function(_0x3f5601,_0x3a98d3){var _0x4d7612={'raw':![],'where':{'id':_0x3f5601[_0xb77c('0x28')]['id']}},_0x11935f={};_0x11935f[_0xb77c('0x29')]=_[_0xb77c('0x2a')](db[_0xb77c('0x2b')][_0xb77c('0x1f')]);_0x11935f[_0xb77c('0x25')]=_[_0xb77c('0x2a')](_0x3f5601[_0xb77c('0x25')]);_0x11935f['filters']=_[_0xb77c('0x2c')](_0x11935f[_0xb77c('0x29')],_0x11935f[_0xb77c('0x25')]);_0x4d7612[_0xb77c('0x2d')]=_[_0xb77c('0x2c')](_0x11935f[_0xb77c('0x29')],qs['fields'](_0x3f5601['query']['fields']));_0x4d7612[_0xb77c('0x2d')]=_0x4d7612[_0xb77c('0x2d')][_0xb77c('0x2e')]?_0x4d7612[_0xb77c('0x2d')]:_0x11935f['model'];if(_0x3f5601[_0xb77c('0x25')]['includeAll']){_0x4d7612[_0xb77c('0x2f')]=[{'all':!![]}];}_0x4d7612=_[_0xb77c('0x30')]({},_0x4d7612,_0x3f5601['options']);return db['WhatsappInteraction']['find'](_0x4d7612)[_0xb77c('0x17')](handleEntityNotFound(_0x3a98d3,null))[_0xb77c('0x17')](respondWithResult(_0x3a98d3,null))[_0xb77c('0x26')](handleError(_0x3a98d3,null));};exports['create']=function(_0x3887b1,_0x1ffd4c){return db[_0xb77c('0x2b')][_0xb77c('0x31')](_0x3887b1[_0xb77c('0x32')],{})['then'](respondWithResult(_0x1ffd4c,0xc9))[_0xb77c('0x26')](handleError(_0x1ffd4c,null));};exports[_0xb77c('0x33')]=function(_0x421b3a,_0x3d24e9){if(_0x421b3a['body']['id']){delete _0x421b3a[_0xb77c('0x32')]['id'];}return db['WhatsappInteraction']['find']({'where':{'id':_0x421b3a['params']['id']}})[_0xb77c('0x17')](handleEntityNotFound(_0x3d24e9,null))[_0xb77c('0x17')](saveUpdates(_0x421b3a[_0xb77c('0x32')],null))[_0xb77c('0x17')](respondWithResult(_0x3d24e9,null))['catch'](handleError(_0x3d24e9,null));};exports[_0xb77c('0x18')]=function(_0x58e885,_0x252959){return db[_0xb77c('0x2b')][_0xb77c('0x34')]({'where':{'id':_0x58e885[_0xb77c('0x28')]['id']}})[_0xb77c('0x17')](handleEntityNotFound(_0x252959,null))[_0xb77c('0x17')](removeEntity(_0x252959,null))[_0xb77c('0x26')](handleError(_0x252959,null));};exports[_0xb77c('0x35')]=function(_0x4297ed,_0x182176){return db[_0xb77c('0x2b')]['describe']()[_0xb77c('0x17')](respondWithResult(_0x182176,null))[_0xb77c('0x26')](handleError(_0x182176,null));};exports['addMessage']=function(_0x45c56d,_0x52f7bf){return db[_0xb77c('0x36')][_0xb77c('0x34')]({'where':{'id':_0x45c56d[_0xb77c('0x28')]['id']}})['then'](handleEntityNotFound(_0x52f7bf,null))[_0xb77c('0x17')](function(_0x620681){if(_0x620681){return _0x620681['addMessage'](_0x45c56d[_0xb77c('0x32')][_0xb77c('0x37')],_[_0xb77c('0x38')](_0x45c56d[_0xb77c('0x32')],[_0xb77c('0x37'),'id'])||{});}})['then'](respondWithResult(_0x52f7bf,null))['catch'](handleError(_0x52f7bf,null));};exports[_0xb77c('0x39')]=function(_0x200f85,_0x5ef373){var _0x1985c4={'raw':![],'where':{}};var _0x4d21d8={};var _0x1d805f={'count':0x0,'rows':[]};return db[_0xb77c('0x2b')][_0xb77c('0x3a')]({'where':{'id':_0x200f85['params']['id']}})[_0xb77c('0x17')](handleEntityNotFound(_0x5ef373,null))['then'](function(_0x45d7fd){if(_0x45d7fd){_0x4d21d8[_0xb77c('0x29')]=_['keys'](db[_0xb77c('0x36')][_0xb77c('0x1f')]);_0x4d21d8[_0xb77c('0x25')]=_[_0xb77c('0x2a')](_0x200f85[_0xb77c('0x25')]);_0x4d21d8['filters']=_['intersection'](_0x4d21d8[_0xb77c('0x29')],_0x4d21d8[_0xb77c('0x25')]);_0x1985c4['attributes']=_[_0xb77c('0x2c')](_0x4d21d8[_0xb77c('0x29')],qs['fields'](_0x200f85[_0xb77c('0x25')][_0xb77c('0x3b')]));_0x1985c4[_0xb77c('0x2d')]=_0x1985c4[_0xb77c('0x2d')][_0xb77c('0x2e')]?_0x1985c4[_0xb77c('0x2d')]:_0x4d21d8[_0xb77c('0x29')];if(!_0x200f85['query']['hasOwnProperty'](_0xb77c('0x3c'))){_0x1985c4['limit']=qs[_0xb77c('0x15')](_0x200f85['query']['limit']);_0x1985c4[_0xb77c('0x13')]=qs[_0xb77c('0x13')](_0x200f85[_0xb77c('0x25')][_0xb77c('0x13')]);}_0x1985c4[_0xb77c('0x3d')]=qs[_0xb77c('0x3e')](_0x200f85[_0xb77c('0x25')][_0xb77c('0x3e')]);_0x1985c4[_0xb77c('0x3f')]=qs[_0xb77c('0x40')](_[_0xb77c('0x41')](_0x200f85['query'],_0x4d21d8[_0xb77c('0x40')]));_0x1985c4[_0xb77c('0x3f')][_0xb77c('0x42')]=_0x45d7fd['id'];if(_0x200f85[_0xb77c('0x25')]['filter']){_0x1985c4[_0xb77c('0x3f')]=_[_0xb77c('0x30')](_0x1985c4[_0xb77c('0x3f')],{'$or':_[_0xb77c('0x1e')](_0x1985c4[_0xb77c('0x2d')],function(_0xe7c1f1){var _0x1c4be4={};_0x1c4be4[_0xe7c1f1]={'$like':'%'+_0x200f85['query']['filter']+'%'};return _0x1c4be4;})});}if(_0x200f85[_0xb77c('0x25')][_0xb77c('0x43')]){var _0x4b38a3=_0x200f85['query'][_0xb77c('0x43')][_0xb77c('0x44')](',');var _0x1cb9f2={};_0x1cb9f2[_0x4b38a3[0x0]]={'$gte':moment(_0x4b38a3[0x1])['format'](_0xb77c('0x45'))};_0x1985c4[_0xb77c('0x3f')]=_[_0xb77c('0x30')](_0x1985c4[_0xb77c('0x3f')],_0x1cb9f2);}_0x1985c4=_[_0xb77c('0x30')]({},_0x1985c4,_0x200f85[_0xb77c('0x46')]);return db[_0xb77c('0x36')][_0xb77c('0x16')]({'where':_0x1985c4[_0xb77c('0x3f')]})[_0xb77c('0x17')](function(_0x5ae6e9){_0x1d805f[_0xb77c('0x16')]=_0x5ae6e9;if(_0x200f85['query'][_0xb77c('0x47')]){_0x1985c4[_0xb77c('0x2f')]=[{'all':!![]}];}return db[_0xb77c('0x36')][_0xb77c('0x48')](_0x1985c4);})[_0xb77c('0x17')](function(_0xe4a462){_0x1d805f[_0xb77c('0x49')]=_0xe4a462;return _0x1d805f;});}})['then'](respondWithFilteredResult(_0x5ef373,_0x1985c4))['catch'](handleError(_0x5ef373,null));};exports[_0xb77c('0x4a')]=function(_0x471c70,_0x3221bc){return db['WhatsappInteraction']['find']({'where':{'id':_0x471c70['params']['id']}})[_0xb77c('0x17')](handleEntityNotFound(_0x3221bc,null))[_0xb77c('0x17')](function(_0x41ad7d){if(_0x41ad7d){return _0x41ad7d[_0xb77c('0x4b')](_0x471c70[_0xb77c('0x32')]['ids'],_[_0xb77c('0x38')](_0x471c70[_0xb77c('0x32')],[_0xb77c('0x37'),'id'])||{})[_0xb77c('0x4c')](function(){return db['Tag'][_0xb77c('0x48')]({'attributes':['id',_0xb77c('0x1c'),_0xb77c('0x4d')],'where':{'id':_0x471c70[_0xb77c('0x32')]['ids']}});})[_0xb77c('0x17')](function(_0x286ed8){socket['emit'](_0xb77c('0x4e'),{'id':Number(_0x471c70[_0xb77c('0x28')]['id']),'tags':_0x286ed8||[]});return{'id':Number(_0x471c70[_0xb77c('0x28')]['id']),'tags':_0x286ed8||[]};});}})[_0xb77c('0x17')](respondWithResult(_0x3221bc,null))[_0xb77c('0x26')](handleError(_0x3221bc,null));};exports['removeTags']=function(_0x330a40,_0x42446e){return db[_0xb77c('0x2b')][_0xb77c('0x34')]({'where':{'id':_0x330a40[_0xb77c('0x28')]['id']}})['then'](handleEntityNotFound(_0x42446e,null))[_0xb77c('0x17')](function(_0x38fa19){if(_0x38fa19){return _0x38fa19[_0xb77c('0x4f')](_0x330a40[_0xb77c('0x25')][_0xb77c('0x37')]);}})['then'](respondWithStatusCode(_0x42446e,null))[_0xb77c('0x26')](handleError(_0x42446e,null));};exports[_0xb77c('0x50')]=function(_0x24b308,_0x4a8bad){var _0x579c6b=moment()[_0xb77c('0x51')]()[_0xb77c('0x52')]();var _0x396129=path[_0xb77c('0x53')](config[_0xb77c('0x54')],_0xb77c('0x55'),_0xb77c('0x56'),_0xb77c('0x57'));var _0x47238e=path[_0xb77c('0x53')](config[_0xb77c('0x54')],_0xb77c('0x55'),_0xb77c('0x56'),_0xb77c('0x58'));var _0x305624=path[_0xb77c('0x53')](_0x396129,_0x579c6b);var _0x490f28=util[_0xb77c('0x59')]('transcript-%d-%s.zip',_0x24b308['params']['id'],_0x579c6b);var _0x44a977=path[_0xb77c('0x53')](_0x396129,_0x490f28);var _0x52bed5=[];_0x52bed5[_0xb77c('0x5a')]({'model':db[_0xb77c('0x5b')],'as':_0xb77c('0x5b'),'attributes':['id',_0xb77c('0x5c')],'raw':!![]});_0x52bed5['push']({'model':db[_0xb77c('0x5d')],'as':_0xb77c('0x5e'),'attributes':['id',_0xb77c('0x5f'),_0xb77c('0x60')],'raw':!![]});if(_0x24b308['query']['attachments']){_0x52bed5[_0xb77c('0x5a')]({'model':db[_0xb77c('0x61')],'as':_0xb77c('0x61'),'raw':!![]});}var _0x124c35=[{'model':db[_0xb77c('0x36')],'as':'Messages','attributes':['id',_0xb77c('0x32'),_0xb77c('0x62'),_0xb77c('0x63'),_0xb77c('0x64'),'read'],'include':_0x52bed5}];_0x124c35[_0xb77c('0x5a')]({'model':db[_0xb77c('0x65')],'as':_0xb77c('0x66'),'attributes':['id',_0xb77c('0x1c')]});_0x124c35[_0xb77c('0x5a')]({'model':db[_0xb77c('0x5b')],'as':'Owner','attributes':['id',_0xb77c('0x5c')]});return db[_0xb77c('0x2b')][_0xb77c('0x34')]({'where':{'id':_0x24b308[_0xb77c('0x28')]['id']},'include':_0x124c35})['then'](handleEntityNotFound(_0x4a8bad,null))[_0xb77c('0x17')](function(_0x2198df){if(_0x2198df){var _0x419436=_0x2198df[_0xb77c('0x67')]({'plain':!![]});fs[_0xb77c('0x68')](_0x305624);var _0x1cf821={'channel':_0xb77c('0x69'),'account':_0x419436[_0xb77c('0x66')][_0xb77c('0x1c')],'agent':_0x419436['Owner']?_0x419436[_0xb77c('0x6a')][_0xb77c('0x5c')]:_0xb77c('0x6b'),'createdAt':moment(_0x419436[_0xb77c('0x62')])[_0xb77c('0x59')](_0xb77c('0x45'))[_0xb77c('0x52')](),'closedAt':_0x419436['closed']?moment(_0x419436[_0xb77c('0x6c')])[_0xb77c('0x59')](_0xb77c('0x45'))['toString']():'','disposition':_0x419436[_0xb77c('0x6d')],'messages':_(_0x419436['Messages'])[_0xb77c('0x6e')]({'secret':![]})[_0xb77c('0x1e')](function(_0x2fb9ac){if(_0x2fb9ac[_0xb77c('0x61')]){var _0xac5661=path['join'](_0x47238e,_0x2fb9ac[_0xb77c('0x61')][_0xb77c('0x6f')]);if(fs[_0xb77c('0x70')](_0xac5661)){fs['createReadStream'](_0xac5661)['pipe'](fs[_0xb77c('0x71')](path['join'](_0x305624,_0x2fb9ac[_0xb77c('0x61')][_0xb77c('0x6f')])));}}return{'date':moment(_0x2fb9ac[_0xb77c('0x62')])[_0xb77c('0x59')](_0xb77c('0x45'))[_0xb77c('0x52')](),'sender':_0x2fb9ac[_0xb77c('0x63')]===_0xb77c('0x72')?_0x2fb9ac[_0xb77c('0x5b')]?_0x2fb9ac[_0xb77c('0x5b')][_0xb77c('0x5c')]:_0xb77c('0x73'):_0x2fb9ac[_0xb77c('0x5e')][_0xb77c('0x5f')]+(_0x2fb9ac[_0xb77c('0x5e')][_0xb77c('0x60')]?'\x20'+_0x2fb9ac['Contact'][_0xb77c('0x60')]:''),'body':_0x2fb9ac[_0xb77c('0x61')]?_0x2fb9ac[_0xb77c('0x61')]['basename']:_0x2fb9ac['body'],'direction':_0x2fb9ac[_0xb77c('0x63')]===_0xb77c('0x72')?'A':'C','secret':_0x2fb9ac[_0xb77c('0x64')],'read':_0x2fb9ac[_0xb77c('0x74')],'attachment':_0x2fb9ac[_0xb77c('0x61')]};})[_0xb77c('0x75')]()};return ejs[_0xb77c('0x76')](path[_0xb77c('0x53')](config['root'],_0xb77c('0x55'),_0xb77c('0x77'),_0xb77c('0x78')),{'interaction':_0x1cf821})[_0xb77c('0x17')](function(_0x39ddbc){var _0x344ce0=path['join'](_0x305624,_0xb77c('0x79')+_0x419436['id']+'-'+_0x579c6b+_0xb77c('0x7a'));var _0x3f93b7={'path':_0x344ce0,'channel':_0xb77c('0x69'),'interactionId':_0x419436['id']};return pdf['createPdfFromHTML'](_0x39ddbc,_0x3f93b7);})[_0xb77c('0x17')](function(){return new BPromise(function(_0x436a9d,_0x5427f5){zipdir(_0x305624,{'saveTo':_0x44a977},function(_0x16cdd3,_0x2c05bb){if(_0x16cdd3)return _0x5427f5(_0x16cdd3);return _0x436a9d(_0x2c05bb);});})[_0xb77c('0x17')](function(){return new BPromise(function(_0xa8c239,_0x226a3e){rimraf(_0x305624,function(_0x59fb2e){if(_0x59fb2e)_0x226a3e(_0x59fb2e);return _0xa8c239();});});})[_0xb77c('0x17')](function(){return _0x4a8bad[_0xb77c('0x50')](_0x44a977,_0x490f28,function(_0x3a86f7){if(_0x3a86f7){console[_0xb77c('0x7b')](_0xb77c('0x7c'),_0x3a86f7);}else{fs[_0xb77c('0x7d')](_0x44a977);}});});});}else{return _0x4a8bad['sendStatus'](0xc8);}})['catch'](handleError(_0x4a8bad,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 66b202e..4f6bd71 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 _0x4899=['save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','events','WhatsappInteraction','WhatsappMessage'];(function(_0x4a41d2,_0x397d4e){var _0x4b6f4e=function(_0x116e87){while(--_0x116e87){_0x4a41d2['push'](_0x4a41d2['shift']());}};_0x4b6f4e(++_0x397d4e);}(_0x4899,0x74));var _0x9489=function(_0x32796f,_0xf18bf0){_0x32796f=_0x32796f-0x0;var _0x2165c4=_0x4899[_0x32796f];return _0x2165c4;};'use strict';var EventEmitter=require(_0x9489('0x0'));var WhatsappInteraction=require('../../mysqldb')['db'][_0x9489('0x1')];var WhatsappMessage=require('../../mysqldb')['db'][_0x9489('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9489('0x3'),'afterUpdate':_0x9489('0x4'),'afterDestroy':_0x9489('0x5')};function emitEvent(_0x2a8d19){return function(_0xbeb4d3,_0x49173a,_0x99c731){_0xbeb4d3[_0x9489('0x6')]({'attributes':['id'],'raw':!![]})[_0x9489('0x7')](function(_0x31e8c3){_0xbeb4d3['setDataValue']('Users',_0x31e8c3[_0x9489('0x8')](function(_0x5ec4cf){return{'id':_0x5ec4cf['id']};}));return WhatsappMessage[_0x9489('0x9')]({'where':{'WhatsappInteractionId':_0xbeb4d3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9489('0x7')](function(_0x52f169){_0xbeb4d3[_0x9489('0xa')](_0x9489('0xb'),_0x52f169[_0x9489('0xc')]);WhatsappInteractionEvents[_0x9489('0xd')](_0x2a8d19+':'+_0xbeb4d3['id'],_0xbeb4d3);WhatsappInteractionEvents[_0x9489('0xd')](_0x2a8d19,_0xbeb4d3);_0x99c731(null);})[_0x9489('0xe')](_0x99c731(null));};}for(var e in events){if(events[_0x9489('0xf')](e)){var event=events[e];WhatsappInteraction[_0x9489('0x10')](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x01d3=['WhatsappMessage','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','WhatsappInteraction','../../mysqldb'];(function(_0x502e60,_0x217700){var _0x124fcd=function(_0xd42dbe){while(--_0xd42dbe){_0x502e60['push'](_0x502e60['shift']());}};_0x124fcd(++_0x217700);}(_0x01d3,0xdb));var _0x301d=function(_0x1e77ed,_0x5720c1){_0x1e77ed=_0x1e77ed-0x0;var _0x32ed55=_0x01d3[_0x1e77ed];return _0x32ed55;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require('../../mysqldb')['db'][_0x301d('0x0')];var WhatsappMessage=require(_0x301d('0x1'))['db'][_0x301d('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x301d('0x3'),'afterUpdate':_0x301d('0x4'),'afterDestroy':_0x301d('0x5')};function emitEvent(_0x11ba0e){return function(_0x13cd36,_0x4f3b25,_0x44f428){_0x13cd36[_0x301d('0x6')]({'attributes':['id'],'raw':!![]})[_0x301d('0x7')](function(_0x30e89e){_0x13cd36[_0x301d('0x8')]('Users',_0x30e89e[_0x301d('0x9')](function(_0x1d8e83){return{'id':_0x1d8e83['id']};}));return WhatsappMessage[_0x301d('0xa')]({'where':{'WhatsappInteractionId':_0x13cd36['id'],'direction':'in','read':![]},'raw':!![]});})[_0x301d('0x7')](function(_0xc54235){_0x13cd36[_0x301d('0x8')](_0x301d('0xb'),_0xc54235[_0x301d('0xc')]);WhatsappInteractionEvents[_0x301d('0xd')](_0x11ba0e+':'+_0x13cd36['id'],_0x13cd36);WhatsappInteractionEvents['emit'](_0x11ba0e,_0x13cd36);_0x44f428(null);})[_0x301d('0xe')](_0x44f428(null));};}for(var e in events){if(events[_0x301d('0xf')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x301d('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index d72425e..0bd48fa 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 _0x2085=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3b91bd,_0x5242a0){var _0x5bf715=function(_0x572db6){while(--_0x572db6){_0x3b91bd['push'](_0x3b91bd['shift']());}};_0x5bf715(++_0x5242a0);}(_0x2085,0xb2));var _0x5208=function(_0x10a8d8,_0x28f292){_0x10a8d8=_0x10a8d8-0x0;var _0x3b2b79=_0x2085[_0x10a8d8];return _0x3b2b79;};'use strict';var _=require('lodash');var util=require(_0x5208('0x0'));var logger=require(_0x5208('0x1'))(_0x5208('0x2'));var moment=require(_0x5208('0x3'));var BPromise=require(_0x5208('0x4'));var rp=require(_0x5208('0x5'));var fs=require('fs');var path=require(_0x5208('0x6'));var rimraf=require(_0x5208('0x7'));var config=require(_0x5208('0x8'));var attributes=require(_0x5208('0x9'));module[_0x5208('0xa')]=function(_0x24cdd3,_0x434ad8){return _0x24cdd3[_0x5208('0xb')](_0x5208('0xc'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1293ad,_0x47f901,_0x6dcde3){if(_0x1293ad[_0x5208('0xd')](_0x5208('0xe'))){_0x1293ad[_0x5208('0xf')]=moment()['format'](_0x5208('0x10'));}_0x6dcde3(null,_0x1293ad);}}});}; \ No newline at end of file +var _0x022b=['moment','bluebird','request-promise','path','rimraf','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','format','util','../../config/logger','api'];(function(_0x338a58,_0x2d5ac5){var _0x92bd1d=function(_0x1e9cb5){while(--_0x1e9cb5){_0x338a58['push'](_0x338a58['shift']());}};_0x92bd1d(++_0x2d5ac5);}(_0x022b,0x1cb));var _0xb022=function(_0x1bf471,_0x378f16){_0x1bf471=_0x1bf471-0x0;var _0x8a2d4=_0x022b[_0x1bf471];return _0x8a2d4;};'use strict';var _=require('lodash');var util=require(_0xb022('0x0'));var logger=require(_0xb022('0x1'))(_0xb022('0x2'));var moment=require(_0xb022('0x3'));var BPromise=require(_0xb022('0x4'));var rp=require(_0xb022('0x5'));var fs=require('fs');var path=require(_0xb022('0x6'));var rimraf=require(_0xb022('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0xb022('0x8')]=function(_0x4e0280,_0x5ed4d0){return _0x4e0280['define'](_0xb022('0x9'),attributes,{'tableName':_0xb022('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x216672,_0x3c00e7,_0x149de3){if(_0x216672[_0xb022('0xb')](_0xb022('0xc'))){_0x216672['closedAt']=moment()[_0xb022('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x149de3(null,_0x216672);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 8ec0d0a..fdbe816 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 _0x5f95=['find','addTags','ids','omit','spread','AddTags','debug','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','AddTagsToWhatsappInteraction'];(function(_0x54adb2,_0x4b6c6f){var _0x3fd2c5=function(_0x42b3e4){while(--_0x42b3e4){_0x54adb2['push'](_0x54adb2['shift']());}};_0x3fd2c5(++_0x4b6c6f);}(_0x5f95,0x10f));var _0x55f9=function(_0x123639,_0x86f8c5){_0x123639=_0x123639-0x0;var _0x410415=_0x5f95[_0x123639];return _0x410415;};'use strict';var _=require(_0x55f9('0x0'));var util=require(_0x55f9('0x1'));var moment=require(_0x55f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55f9('0x3'));var db=require(_0x55f9('0x4'))['db'];var utils=require(_0x55f9('0x5'));var logger=require(_0x55f9('0x6'))(_0x55f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x55f9('0x8'));var client=jayson['client'][_0x55f9('0x9')]({'port':0x232a});config[_0x55f9('0xa')]=_[_0x55f9('0xb')](config['redis'],{'host':_0x55f9('0xc'),'port':0x18eb});var socket=require(_0x55f9('0xd'))(new Redis(config[_0x55f9('0xa')]));require('./whatsappInteraction.socket')[_0x55f9('0xe')](socket);function respondWithRpcPromise(_0x15edb9,_0x133c73,_0x23cddf){return new BPromise(function(_0x2b2134,_0x178716){return client[_0x55f9('0xf')](_0x15edb9,_0x23cddf)[_0x55f9('0x10')](function(_0x1e5d1a){logger[_0x55f9('0x11')](_0x55f9('0x12'),_0x133c73,'request\x20sent');logger['debug'](_0x55f9('0x13'),_0x133c73,_0x55f9('0x14'),JSON[_0x55f9('0x15')](_0x1e5d1a));if(_0x1e5d1a[_0x55f9('0x16')]){if(_0x1e5d1a[_0x55f9('0x16')][_0x55f9('0x17')]===0x1f4){logger['error'](_0x55f9('0x12'),_0x133c73,_0x1e5d1a[_0x55f9('0x16')][_0x55f9('0x18')]);return _0x178716(_0x1e5d1a[_0x55f9('0x16')]['message']);}logger[_0x55f9('0x16')](_0x55f9('0x12'),_0x133c73,_0x1e5d1a[_0x55f9('0x16')][_0x55f9('0x18')]);return _0x2b2134(_0x1e5d1a[_0x55f9('0x16')][_0x55f9('0x18')]);}else{logger[_0x55f9('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x133c73,_0x55f9('0x14'));_0x2b2134(_0x1e5d1a[_0x55f9('0x19')][_0x55f9('0x18')]);}})[_0x55f9('0x1a')](function(_0x209670){logger[_0x55f9('0x16')](_0x55f9('0x12'),_0x133c73,_0x209670);_0x178716(_0x209670);});});}exports[_0x55f9('0x1b')]=function(_0x30f6be){var _0x35a131=this;return new Promise(function(_0x393d10,_0x1944db){return db[_0x55f9('0x1c')][_0x55f9('0x1d')](_0x30f6be[_0x55f9('0x1e')],{'raw':_0x30f6be[_0x55f9('0x1f')]?_0x30f6be[_0x55f9('0x1f')][_0x55f9('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x30f6be[_0x55f9('0x1f')]?_0x30f6be[_0x55f9('0x1f')][_0x55f9('0x21')]||null:null,'attributes':_0x30f6be[_0x55f9('0x1f')]?_0x30f6be[_0x55f9('0x1f')][_0x55f9('0x22')]||null:null,'limit':_0x30f6be['options']?_0x30f6be[_0x55f9('0x1f')][_0x55f9('0x23')]||null:null})[_0x55f9('0x10')](function(_0x3d938f){logger[_0x55f9('0x11')](_0x55f9('0x1b'),_0x30f6be);logger['debug'](_0x55f9('0x1b'),_0x30f6be,JSON['stringify'](_0x3d938f));_0x393d10(_0x3d938f);})[_0x55f9('0x1a')](function(_0x34cfa4){logger['error'](_0x55f9('0x1b'),_0x34cfa4['message'],_0x30f6be);_0x1944db(_0x35a131[_0x55f9('0x16')](0x1f4,_0x34cfa4[_0x55f9('0x18')]));});});};exports[_0x55f9('0x24')]=function(_0x189348){return new Promise(function(_0x298487,_0x5da1fd){return db['WhatsappInteraction'][_0x55f9('0x25')]({'where':_0x189348[_0x55f9('0x1f')]?_0x189348['options'][_0x55f9('0x21')]||null:null})[_0x55f9('0x10')](function(_0x49c411){if(_0x49c411){return _0x49c411[_0x55f9('0x26')](_0x189348[_0x55f9('0x1e')][_0x55f9('0x27')],_[_0x55f9('0x28')](_0x189348[_0x55f9('0x1e')],[_0x55f9('0x27'),'id'])||{});}})[_0x55f9('0x29')](function(_0x2ff631){logger[_0x55f9('0x11')](_0x55f9('0x2a'),_0x189348);logger[_0x55f9('0x2b')]('AddTags',_0x189348,JSON[_0x55f9('0x15')](_0x2ff631));_0x298487(_0x2ff631);})['catch'](function(_0x2ea24c){logger['error']('AddTags',_0x2ea24c[_0x55f9('0x18')],_0x189348);_0x5da1fd(_this['error'](0x1f4,_0x2ea24c[_0x55f9('0x18')]));});});}; \ No newline at end of file +var _0x5408=['socket.io-emitter','redis','./whatsappInteraction.socket','info','request\x20sent','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','body','options','attributes','limit','UpdateWhatsappInteraction','debug','AddTagsToWhatsappInteraction','WhatsappInteraction','find','where','then','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x4cc90a,_0x524121){var _0x2fb216=function(_0x3541ba){while(--_0x3541ba){_0x4cc90a['push'](_0x4cc90a['shift']());}};_0x2fb216(++_0x524121);}(_0x5408,0x14a));var _0x8540=function(_0x5676fc,_0x1507e4){_0x5676fc=_0x5676fc-0x0;var _0x13999b=_0x5408[_0x5676fc];return _0x13999b;};'use strict';var _=require(_0x8540('0x0'));var util=require(_0x8540('0x1'));var moment=require(_0x8540('0x2'));var BPromise=require(_0x8540('0x3'));var rs=require(_0x8540('0x4'));var fs=require('fs');var Redis=require(_0x8540('0x5'));var db=require(_0x8540('0x6'))['db'];var utils=require(_0x8540('0x7'));var logger=require(_0x8540('0x8'))(_0x8540('0x9'));var config=require(_0x8540('0xa'));var jayson=require(_0x8540('0xb'));var client=jayson[_0x8540('0xc')][_0x8540('0xd')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x8540('0xe'))(new Redis(config[_0x8540('0xf')]));require(_0x8540('0x10'))['register'](socket);function respondWithRpcPromise(_0x355e8e,_0x57e3c4,_0x5403e7){return new BPromise(function(_0x1213fd,_0x12ba83){return client['request'](_0x355e8e,_0x5403e7)['then'](function(_0xafa493){logger[_0x8540('0x11')]('WhatsappInteraction,\x20%s,\x20%s',_0x57e3c4,_0x8540('0x12'));logger['debug'](_0x8540('0x13'),_0x57e3c4,'request\x20sent',JSON[_0x8540('0x14')](_0xafa493));if(_0xafa493['error']){if(_0xafa493[_0x8540('0x15')][_0x8540('0x16')]===0x1f4){logger[_0x8540('0x15')](_0x8540('0x17'),_0x57e3c4,_0xafa493['error']['message']);return _0x12ba83(_0xafa493[_0x8540('0x15')]['message']);}logger[_0x8540('0x15')]('WhatsappInteraction,\x20%s,\x20%s',_0x57e3c4,_0xafa493[_0x8540('0x15')][_0x8540('0x18')]);return _0x1213fd(_0xafa493['error']['message']);}else{logger[_0x8540('0x11')](_0x8540('0x17'),_0x57e3c4,_0x8540('0x12'));_0x1213fd(_0xafa493[_0x8540('0x19')]['message']);}})[_0x8540('0x1a')](function(_0x5576bc){logger[_0x8540('0x15')](_0x8540('0x17'),_0x57e3c4,_0x5576bc);_0x12ba83(_0x5576bc);});});}exports['UpdateWhatsappInteraction']=function(_0x427f17){var _0x1914eb=this;return new Promise(function(_0x3df99e,_0x41b73c){return db['WhatsappInteraction']['update'](_0x427f17[_0x8540('0x1b')],{'raw':_0x427f17[_0x8540('0x1c')]?_0x427f17[_0x8540('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x427f17[_0x8540('0x1c')]?_0x427f17[_0x8540('0x1c')]['where']||null:null,'attributes':_0x427f17['options']?_0x427f17[_0x8540('0x1c')][_0x8540('0x1d')]||null:null,'limit':_0x427f17[_0x8540('0x1c')]?_0x427f17[_0x8540('0x1c')][_0x8540('0x1e')]||null:null})['then'](function(_0x26bb18){logger[_0x8540('0x11')](_0x8540('0x1f'),_0x427f17);logger[_0x8540('0x20')](_0x8540('0x1f'),_0x427f17,JSON[_0x8540('0x14')](_0x26bb18));_0x3df99e(_0x26bb18);})[_0x8540('0x1a')](function(_0x221852){logger[_0x8540('0x15')](_0x8540('0x1f'),_0x221852['message'],_0x427f17);_0x41b73c(_0x1914eb[_0x8540('0x15')](0x1f4,_0x221852[_0x8540('0x18')]));});});};exports[_0x8540('0x21')]=function(_0x155a66){return new Promise(function(_0xd4c275,_0x1a2890){return db[_0x8540('0x22')][_0x8540('0x23')]({'where':_0x155a66[_0x8540('0x1c')]?_0x155a66[_0x8540('0x1c')][_0x8540('0x24')]||null:null})[_0x8540('0x25')](function(_0x4a62b1){if(_0x4a62b1){return _0x4a62b1[_0x8540('0x26')](_0x155a66[_0x8540('0x1b')]['ids'],_[_0x8540('0x27')](_0x155a66[_0x8540('0x1b')],[_0x8540('0x28'),'id'])||{});}})[_0x8540('0x29')](function(_0x4db6c8){logger[_0x8540('0x11')](_0x8540('0x2a'),_0x155a66);logger[_0x8540('0x20')](_0x8540('0x2a'),_0x155a66,JSON[_0x8540('0x14')](_0x4db6c8));_0xd4c275(_0x4db6c8);})['catch'](function(_0x5c922b){logger[_0x8540('0x15')]('AddTags',_0x5c922b['message'],_0x155a66);_0x1a2890(_this[_0x8540('0x15')](0x1f4,_0x5c922b[_0x8540('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 702c85e..07185b8 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 _0x5ffb=['whatsappInteraction:','./whatsappInteraction.events','save','update','emit','removeListener','register'];(function(_0x13588f,_0x5d891f){var _0x47c5ba=function(_0x152595){while(--_0x152595){_0x13588f['push'](_0x13588f['shift']());}};_0x47c5ba(++_0x5d891f);}(_0x5ffb,0x1a5));var _0xb5ff=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ffb[_0x122ef9];return _0x42fba0;};'use strict';var WhatsappInteractionEvents=require(_0xb5ff('0x0'));var events=[_0xb5ff('0x1'),'remove',_0xb5ff('0x2')];function createListener(_0x66a239,_0x3cf369){return function(_0x7b44a0){_0x3cf369[_0xb5ff('0x3')](_0x66a239,_0x7b44a0);};}function removeListener(_0x5e0630,_0x2c674a){return function(){WhatsappInteractionEvents[_0xb5ff('0x4')](_0x5e0630,_0x2c674a);};}exports[_0xb5ff('0x5')]=function(_0x28138d){for(var _0x3d2217=0x0,_0x59701e=events['length'];_0x3d2217<_0x59701e;_0x3d2217++){var _0x434d12=events[_0x3d2217];var _0x5082ef=createListener(_0xb5ff('0x6')+_0x434d12,_0x28138d);WhatsappInteractionEvents['on'](_0x434d12,_0x5082ef);}}; \ No newline at end of file +var _0xf766=['length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x3a6b78,_0x2d62be){var _0x4943d4=function(_0x33ab64){while(--_0x33ab64){_0x3a6b78['push'](_0x3a6b78['shift']());}};_0x4943d4(++_0x2d62be);}(_0xf766,0x14f));var _0x6f76=function(_0x22c684,_0x753309){_0x22c684=_0x22c684-0x0;var _0x39fcbb=_0xf766[_0x22c684];return _0x39fcbb;};'use strict';var WhatsappInteractionEvents=require(_0x6f76('0x0'));var events=[_0x6f76('0x1'),_0x6f76('0x2'),_0x6f76('0x3')];function createListener(_0x54808a,_0x39ed01){return function(_0x37b09b){_0x39ed01[_0x6f76('0x4')](_0x54808a,_0x37b09b);};}function removeListener(_0x7e327a,_0x2c9573){return function(){WhatsappInteractionEvents[_0x6f76('0x5')](_0x7e327a,_0x2c9573);};}exports[_0x6f76('0x6')]=function(_0x454294){for(var _0x55c14d=0x0,_0x28cc33=events[_0x6f76('0x7')];_0x55c14d<_0x28cc33;_0x55c14d++){var _0x11fc97=events[_0x55c14d];var _0xbd69c3=createListener(_0x6f76('0x8')+_0x11fc97,_0x454294);WhatsappInteractionEvents['on'](_0x11fc97,_0xbd69c3);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index 5486aa3..5dde764 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 _0x7e82=['get','isAuthenticated','describe','show','post','whatsapp','whatsappmessage:create','create','/:id/status','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappMessage.controller','index'];(function(_0x31e310,_0x3860cb){var _0x24ba4f=function(_0x4abd19){while(--_0x4abd19){_0x31e310['push'](_0x31e310['shift']());}};_0x24ba4f(++_0x3860cb);}(_0x7e82,0x11f));var _0x27e8=function(_0xca5596,_0x3d5fe0){_0xca5596=_0xca5596-0x0;var _0x5deb57=_0x7e82[_0xca5596];return _0x5deb57;};'use strict';var multer=require(_0x27e8('0x0'));var util=require(_0x27e8('0x1'));var path=require(_0x27e8('0x2'));var timeout=require(_0x27e8('0x3'));var express=require(_0x27e8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x27e8('0x5'));var interaction=require(_0x27e8('0x6'));var config=require(_0x27e8('0x7'));var controller=require(_0x27e8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x27e8('0x9')]);router[_0x27e8('0xa')]('/describe',auth[_0x27e8('0xb')](),controller[_0x27e8('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x27e8('0xd')]);router[_0x27e8('0xe')]('/',auth[_0x27e8('0xb')](),interaction['tracked'](_0x27e8('0xf'),_0x27e8('0x10')),controller[_0x27e8('0x11')]);router[_0x27e8('0xe')](_0x27e8('0x12'),controller['status']);router[_0x27e8('0x13')](_0x27e8('0x14'),auth[_0x27e8('0xb')](),controller[_0x27e8('0x15')]);router[_0x27e8('0x13')](_0x27e8('0x16'),auth[_0x27e8('0xb')](),controller['accept']);router['put'](_0x27e8('0x17'),auth['isAuthenticated'](),controller[_0x27e8('0x18')]);router[_0x27e8('0x19')](_0x27e8('0x14'),auth[_0x27e8('0xb')](),controller[_0x27e8('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x4ddd=['/:id/reject','reject','delete','destroy','multer','util','path','fs-extra','../../components/auth/service','./whatsappMessage.controller','get','index','/describe','describe','isAuthenticated','show','post','whatsappmessage:create','create','/:id/status','status','put','/:id','update','/:id/accept','accept'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x4ddd,0x86));var _0xd4dd=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x4ddd[_0x173d7e];return _0x2220d6;};'use strict';var multer=require(_0xd4dd('0x0'));var util=require(_0xd4dd('0x1'));var path=require(_0xd4dd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd4dd('0x3'));var auth=require(_0xd4dd('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd4dd('0x5'));router[_0xd4dd('0x6')]('/',auth['isAuthenticated'](),controller[_0xd4dd('0x7')]);router[_0xd4dd('0x6')](_0xd4dd('0x8'),auth['isAuthenticated'](),controller[_0xd4dd('0x9')]);router[_0xd4dd('0x6')]('/:id',auth[_0xd4dd('0xa')](),controller[_0xd4dd('0xb')]);router[_0xd4dd('0xc')]('/',auth[_0xd4dd('0xa')](),interaction['tracked']('whatsapp',_0xd4dd('0xd')),controller[_0xd4dd('0xe')]);router[_0xd4dd('0xc')](_0xd4dd('0xf'),controller[_0xd4dd('0x10')]);router[_0xd4dd('0x11')](_0xd4dd('0x12'),auth[_0xd4dd('0xa')](),controller[_0xd4dd('0x13')]);router[_0xd4dd('0x11')](_0xd4dd('0x14'),auth[_0xd4dd('0xa')](),controller[_0xd4dd('0x15')]);router[_0xd4dd('0x11')](_0xd4dd('0x16'),auth['isAuthenticated'](),controller[_0xd4dd('0x17')]);router[_0xd4dd('0x18')](_0xd4dd('0x12'),auth[_0xd4dd('0xa')](),controller[_0xd4dd('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index d537089..6dd5928 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 _0x59b7=['medium','BOOLEAN','out','STRING','DATE','exports','TEXT'];(function(_0x4c445a,_0x4ee80f){var _0x2f611c=function(_0x4f3699){while(--_0x4f3699){_0x4c445a['push'](_0x4c445a['shift']());}};_0x2f611c(++_0x4ee80f);}(_0x59b7,0x1ef));var _0x759b=function(_0x34b47c,_0x416c9b){_0x34b47c=_0x34b47c-0x0;var _0x43c731=_0x59b7[_0x34b47c];return _0x43c731;};'use strict';var Sequelize=require('sequelize');module[_0x759b('0x0')]={'body':{'type':Sequelize[_0x759b('0x1')](_0x759b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x759b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':_0x759b('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x759b('0x5')](0xbe)},'phone':{'type':Sequelize[_0x759b('0x5')]},'readAt':{'type':Sequelize[_0x759b('0x6')]},'secret':{'type':Sequelize[_0x759b('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x759b('0x1')]}}; \ No newline at end of file +var _0xcf7a=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x874cf1,_0x2a4954){var _0x233579=function(_0xa6e939){while(--_0xa6e939){_0x874cf1['push'](_0x874cf1['shift']());}};_0x233579(++_0x2a4954);}(_0xcf7a,0x159));var _0xacf7=function(_0x2ea709,_0x1679e4){_0x2ea709=_0x2ea709-0x0;var _0x573672=_0xcf7a[_0x2ea709];return _0x573672;};'use strict';var Sequelize=require(_0xacf7('0x0'));module[_0xacf7('0x1')]={'body':{'type':Sequelize[_0xacf7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xacf7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xacf7('0x4')]('in',_0xacf7('0x5')),'defaultValue':_0xacf7('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xacf7('0x6')]},'readAt':{'type':Sequelize[_0xacf7('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0xacf7('0x6')]},'providerResponse':{'type':Sequelize[_0xacf7('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 6186329..7d2d8d2 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 _0x7dcb=['pick','filter','merge','includeAll','include','findAll','rows','show','params','keys','create','body','update','find','describe','../../config/logger','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteraction','read1stAt','interaction','get','user','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','whatsapp-interactions','whatsapp','RejectMessage','rejectMessage','Sequelize','User','internal','reject','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','read','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','info','catch','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','end','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x36211c,_0x178508){var _0xd2487b=function(_0x101cd8){while(--_0x101cd8){_0x36211c['push'](_0x36211c['shift']());}};_0xd2487b(++_0x178508);}(_0x7dcb,0x152));var _0xb7dc=function(_0x516968,_0x58c439){_0x516968=_0x516968-0x0;var _0x4be190=_0x7dcb[_0x516968];return _0x4be190;};'use strict';var emlformat=require(_0xb7dc('0x0'));var rimraf=require(_0xb7dc('0x1'));var zipdir=require(_0xb7dc('0x2'));var jsonpatch=require(_0xb7dc('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb7dc('0x4'));var Mustache=require(_0xb7dc('0x5'));var util=require('util');var path=require(_0xb7dc('0x6'));var sox=require(_0xb7dc('0x7'));var csv=require(_0xb7dc('0x8'));var ejs=require(_0xb7dc('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb7dc('0xa'));var squel=require(_0xb7dc('0xb'));var crypto=require(_0xb7dc('0xc'));var jsforce=require(_0xb7dc('0xd'));var deskjs=require(_0xb7dc('0xe'));var toCsv=require(_0xb7dc('0x8'));var querystring=require(_0xb7dc('0xf'));var Papa=require(_0xb7dc('0x10'));var Redis=require(_0xb7dc('0x11'));var authService=require(_0xb7dc('0x12'));var qs=require(_0xb7dc('0x13'));var as=require(_0xb7dc('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb7dc('0x15'));var config=require(_0xb7dc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xb7dc('0x17'))['db'];config[_0xb7dc('0x18')]=_[_0xb7dc('0x19')](config[_0xb7dc('0x18')],{'host':_0xb7dc('0x1a'),'port':0x18eb});var socket=require(_0xb7dc('0x1b'))(new Redis(config[_0xb7dc('0x18')]));require('./whatsappMessage.socket')[_0xb7dc('0x1c')](socket);var jayson=require(_0xb7dc('0x1d'));var client=jayson[_0xb7dc('0x1e')][_0xb7dc('0x1f')]({'port':0x232c});var client9002=jayson[_0xb7dc('0x1e')][_0xb7dc('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x369cc1,_0x2cb195,_0x3e32f7,_0xdbb145){return new BPromise(function(_0x45e089,_0x384b13){var _0x24cb24=_0xdbb145||client;return _0x24cb24[_0xb7dc('0x20')](_0x369cc1,_0x3e32f7)[_0xb7dc('0x21')](function(_0x16643f){logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x2cb195,_0xb7dc('0x22'));logger[_0xb7dc('0x23')](_0xb7dc('0x24'),_0x2cb195,_0xb7dc('0x22'),JSON[_0xb7dc('0x25')](_0x16643f));if(_0x16643f[_0xb7dc('0x26')]){if(_0x16643f[_0xb7dc('0x26')][_0xb7dc('0x27')]===0x1f4){logger[_0xb7dc('0x26')](_0xb7dc('0x28'),_0x2cb195,_0x16643f[_0xb7dc('0x26')][_0xb7dc('0x29')]);return _0x384b13(_0x16643f[_0xb7dc('0x26')][_0xb7dc('0x29')]);}logger[_0xb7dc('0x26')](_0xb7dc('0x28'),_0x2cb195,_0x16643f[_0xb7dc('0x26')][_0xb7dc('0x29')]);return _0x45e089(_0x16643f[_0xb7dc('0x26')][_0xb7dc('0x29')]);}else{logger[_0xb7dc('0x2a')](_0xb7dc('0x28'),_0x2cb195,_0xb7dc('0x22'));_0x45e089(_0x16643f['result']['message']);}})[_0xb7dc('0x2b')](function(_0x2fe082){logger[_0xb7dc('0x26')](_0xb7dc('0x28'),_0x2cb195,_0x2fe082);_0x384b13(_0x2fe082);});});}function respondWithStatusCode(_0x2b1bd7,_0x572431){_0x572431=_0x572431||0xcc;return function(_0x3b48a5){if(_0x3b48a5){return _0x2b1bd7[_0xb7dc('0x2c')](_0x572431);}return _0x2b1bd7['status'](_0x572431)['end']();};}function respondWithResult(_0xe7c848,_0xee0412){_0xee0412=_0xee0412||0xc8;return function(_0x404c31){if(_0x404c31){return _0xe7c848[_0xb7dc('0x2d')](_0xee0412)[_0xb7dc('0x2e')](_0x404c31);}};}function respondWithFilteredResult(_0x280ff4,_0x1c0381){return function(_0x1dddd2){if(_0x1dddd2){var _0x4c59e8=typeof _0x1c0381[_0xb7dc('0x2f')]===_0xb7dc('0x30')&&typeof _0x1c0381['limit']===_0xb7dc('0x30');var _0x14a936=_0x1dddd2[_0xb7dc('0x31')];var _0xe9975f=_0x4c59e8?0x0:_0x1c0381['offset'];var _0x2bbe76=_0x4c59e8?_0x1dddd2[_0xb7dc('0x31')]:_0x1c0381[_0xb7dc('0x2f')]+_0x1c0381[_0xb7dc('0x32')];var _0x3815e7;if(_0x2bbe76>=_0x14a936){_0x2bbe76=_0x14a936;_0x3815e7=0xc8;}else{_0x3815e7=0xce;}_0x280ff4[_0xb7dc('0x2d')](_0x3815e7);return _0x280ff4['set'](_0xb7dc('0x33'),_0xe9975f+'-'+_0x2bbe76+'/'+_0x14a936)[_0xb7dc('0x2e')](_0x1dddd2);}return null;};}function patchUpdates(_0x3e927a){return function(_0x343afa){try{jsonpatch[_0xb7dc('0x34')](_0x343afa,_0x3e927a,!![]);}catch(_0x1403d6){return BPromise['reject'](_0x1403d6);}return _0x343afa[_0xb7dc('0x35')]();};}function saveUpdates(_0x1e5637,_0x178378){return function(_0xc8a07b){if(_0xc8a07b){return _0xc8a07b['update'](_0x1e5637)['then'](function(_0x4d323e){return _0x4d323e;});}return null;};}function removeEntity(_0x4792e4,_0x259041){return function(_0x2a00b3){if(_0x2a00b3){return _0x2a00b3[_0xb7dc('0x36')]()[_0xb7dc('0x21')](function(){_0x4792e4['status'](0xcc)[_0xb7dc('0x37')]();});}};}function handleEntityNotFound(_0x2870d9,_0x2eb12a){return function(_0x56e98d){if(!_0x56e98d){_0x2870d9[_0xb7dc('0x2c')](0x194);}return _0x56e98d;};}function handleError(_0x27e474,_0x1d6e51){_0x1d6e51=_0x1d6e51||0x1f4;return function(_0x475c1b){logger[_0xb7dc('0x26')](_0x475c1b[_0xb7dc('0x38')]);if(_0x475c1b[_0xb7dc('0x39')]){delete _0x475c1b[_0xb7dc('0x39')];}_0x27e474[_0xb7dc('0x2d')](_0x1d6e51)['send'](_0x475c1b);};}exports[_0xb7dc('0x3a')]=function(_0x25e78d,_0x30b2f9){var _0x24a318={},_0x3bbc7e={},_0x2a4ccd={'count':0x0,'rows':[]};var _0x593a31=_[_0xb7dc('0x3b')](db[_0xb7dc('0x3c')][_0xb7dc('0x3d')],function(_0x418ecb){return{'name':_0x418ecb[_0xb7dc('0x3e')],'type':_0x418ecb[_0xb7dc('0x3f')]['key']};});_0x3bbc7e[_0xb7dc('0x40')]=_[_0xb7dc('0x3b')](_0x593a31,_0xb7dc('0x39'));_0x3bbc7e[_0xb7dc('0x41')]=_['keys'](_0x25e78d[_0xb7dc('0x41')]);_0x3bbc7e[_0xb7dc('0x42')]=_[_0xb7dc('0x43')](_0x3bbc7e[_0xb7dc('0x40')],_0x3bbc7e[_0xb7dc('0x41')]);_0x24a318[_0xb7dc('0x44')]=_['intersection'](_0x3bbc7e[_0xb7dc('0x40')],qs[_0xb7dc('0x45')](_0x25e78d[_0xb7dc('0x41')]['fields']));_0x24a318[_0xb7dc('0x44')]=_0x24a318[_0xb7dc('0x44')][_0xb7dc('0x46')]?_0x24a318[_0xb7dc('0x44')]:_0x3bbc7e[_0xb7dc('0x40')];if(!_0x25e78d[_0xb7dc('0x41')][_0xb7dc('0x47')](_0xb7dc('0x48'))){_0x24a318[_0xb7dc('0x32')]=qs[_0xb7dc('0x32')](_0x25e78d['query'][_0xb7dc('0x32')]);_0x24a318[_0xb7dc('0x2f')]=qs[_0xb7dc('0x2f')](_0x25e78d[_0xb7dc('0x41')][_0xb7dc('0x2f')]);}_0x24a318[_0xb7dc('0x49')]=qs['sort'](_0x25e78d[_0xb7dc('0x41')][_0xb7dc('0x4a')]);_0x24a318[_0xb7dc('0x4b')]=qs[_0xb7dc('0x42')](_[_0xb7dc('0x4c')](_0x25e78d[_0xb7dc('0x41')],_0x3bbc7e[_0xb7dc('0x42')]),_0x593a31);if(_0x25e78d['query']['filter']){_0x24a318[_0xb7dc('0x4b')]=_['merge'](_0x24a318[_0xb7dc('0x4b')],{'$or':_[_0xb7dc('0x3b')](_0x593a31,function(_0x3447d7){if(_0x3447d7['type']!=='VIRTUAL'){var _0x57c571={};_0x57c571[_0x3447d7[_0xb7dc('0x39')]]={'$like':'%'+_0x25e78d['query'][_0xb7dc('0x4d')]+'%'};return _0x57c571;}})});}_0x24a318=_[_0xb7dc('0x4e')]({},_0x24a318,_0x25e78d['options']);var _0x432674={'where':_0x24a318['where']};return db[_0xb7dc('0x3c')][_0xb7dc('0x31')](_0x432674)[_0xb7dc('0x21')](function(_0x53c396){_0x2a4ccd[_0xb7dc('0x31')]=_0x53c396;if(_0x25e78d[_0xb7dc('0x41')][_0xb7dc('0x4f')]){_0x24a318[_0xb7dc('0x50')]=[{'all':!![]}];}return db[_0xb7dc('0x3c')][_0xb7dc('0x51')](_0x24a318);})[_0xb7dc('0x21')](function(_0x5a15bf){_0x2a4ccd[_0xb7dc('0x52')]=_0x5a15bf;return _0x2a4ccd;})['then'](respondWithFilteredResult(_0x30b2f9,_0x24a318))[_0xb7dc('0x2b')](handleError(_0x30b2f9,null));};exports[_0xb7dc('0x53')]=function(_0x4d5b38,_0x5b8425){var _0x56f2b9={'raw':!![],'where':{'id':_0x4d5b38[_0xb7dc('0x54')]['id']}},_0x1e855e={};_0x1e855e[_0xb7dc('0x40')]=_[_0xb7dc('0x55')](db[_0xb7dc('0x3c')][_0xb7dc('0x3d')]);_0x1e855e[_0xb7dc('0x41')]=_[_0xb7dc('0x55')](_0x4d5b38['query']);_0x1e855e[_0xb7dc('0x42')]=_[_0xb7dc('0x43')](_0x1e855e['model'],_0x1e855e[_0xb7dc('0x41')]);_0x56f2b9['attributes']=_[_0xb7dc('0x43')](_0x1e855e[_0xb7dc('0x40')],qs[_0xb7dc('0x45')](_0x4d5b38['query']['fields']));_0x56f2b9[_0xb7dc('0x44')]=_0x56f2b9[_0xb7dc('0x44')][_0xb7dc('0x46')]?_0x56f2b9['attributes']:_0x1e855e['model'];if(_0x4d5b38[_0xb7dc('0x41')][_0xb7dc('0x4f')]){_0x56f2b9[_0xb7dc('0x50')]=[{'all':!![]}];}_0x56f2b9=_['merge']({},_0x56f2b9,_0x4d5b38['options']);return db[_0xb7dc('0x3c')]['find'](_0x56f2b9)[_0xb7dc('0x21')](handleEntityNotFound(_0x5b8425,null))[_0xb7dc('0x21')](respondWithResult(_0x5b8425,null))[_0xb7dc('0x2b')](handleError(_0x5b8425,null));};exports[_0xb7dc('0x56')]=function(_0x43c1e0,_0x345b0c){return db[_0xb7dc('0x3c')][_0xb7dc('0x56')](_0x43c1e0[_0xb7dc('0x57')],{})['then'](respondWithResult(_0x345b0c,0xc9))[_0xb7dc('0x2b')](handleError(_0x345b0c,null));};exports[_0xb7dc('0x58')]=function(_0x328f12,_0x3a57c9){if(_0x328f12[_0xb7dc('0x57')]['id']){delete _0x328f12[_0xb7dc('0x57')]['id'];}return db[_0xb7dc('0x3c')][_0xb7dc('0x59')]({'where':{'id':_0x328f12[_0xb7dc('0x54')]['id']}})[_0xb7dc('0x21')](handleEntityNotFound(_0x3a57c9,null))[_0xb7dc('0x21')](saveUpdates(_0x328f12[_0xb7dc('0x57')],null))['then'](respondWithResult(_0x3a57c9,null))[_0xb7dc('0x2b')](handleError(_0x3a57c9,null));};exports[_0xb7dc('0x36')]=function(_0x447885,_0x4cbe18){return db[_0xb7dc('0x3c')][_0xb7dc('0x59')]({'where':{'id':_0x447885['params']['id']}})[_0xb7dc('0x21')](handleEntityNotFound(_0x4cbe18,null))[_0xb7dc('0x21')](removeEntity(_0x4cbe18,null))[_0xb7dc('0x2b')](handleError(_0x4cbe18,null));};exports[_0xb7dc('0x5a')]=function(_0x1eb52f,_0x3b9549){return db[_0xb7dc('0x3c')][_0xb7dc('0x5a')]()[_0xb7dc('0x21')](respondWithResult(_0x3b9549,null))[_0xb7dc('0x2b')](handleError(_0x3b9549,null));};var interaction_log=require(_0xb7dc('0x5b'))('whatsapp-interactions');exports[_0xb7dc('0x5c')]=function(_0x320337,_0x80dcdd,_0x276af8){var _0xd1e2ad={'agent':{},'channel':'whatsapp'};if(_0x320337['body']['id']){delete _0x320337[_0xb7dc('0x57')]['id'];}_0x320337['body']['read']=!![];_0x320337[_0xb7dc('0x57')][_0xb7dc('0x5d')]=moment()[_0xb7dc('0x5e')](_0xb7dc('0x5f'));_0x320337[_0xb7dc('0x57')][_0xb7dc('0x60')]=_0x320337[_0xb7dc('0x57')][_0xb7dc('0x60')]||_0x320337['user']['id'];_0xd1e2ad[_0xb7dc('0x61')]['id']=_0x320337[_0xb7dc('0x57')][_0xb7dc('0x60')];return db[_0xb7dc('0x3c')]['find']({'where':{'id':_0x320337[_0xb7dc('0x54')]['id'],'UserId':null}})[_0xb7dc('0x21')](handleEntityNotFound(_0x80dcdd,null))[_0xb7dc('0x21')](saveUpdates(_0x320337[_0xb7dc('0x57')],null))[_0xb7dc('0x21')](function(_0x396076){if(_0x396076){_0xd1e2ad[_0xb7dc('0x29')]=_0x396076['get']({'plain':!![]});return db[_0xb7dc('0x62')]['find']({'where':{'id':_0x396076['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x80dcdd,null))[_0xb7dc('0x21')](function(_0x406b18){if(_0x406b18){return _0x406b18[_0xb7dc('0x58')]({'UserId':_0x320337[_0xb7dc('0x57')][_0xb7dc('0x60')],'read1stAt':_['isNil'](_0x406b18[_0xb7dc('0x63')])?moment()[_0xb7dc('0x5e')](_0xb7dc('0x5f')):undefined});}return null;})[_0xb7dc('0x21')](function(_0x3e756a){if(_0x3e756a){_0xd1e2ad[_0xb7dc('0x64')]=_0x3e756a[_0xb7dc('0x65')]({'plain':!![]});interaction_log[_0xb7dc('0x2a')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x320337['user']['id'],_0x320337['user'][_0xb7dc('0x39')],_0x320337[_0xb7dc('0x66')][_0xb7dc('0x67')],_0xd1e2ad[_0xb7dc('0x64')]['id'],_0x320337[_0xb7dc('0x57')]?JSON[_0xb7dc('0x25')](_0x320337['body']):'null');return respondWithRpcPromise(_0xb7dc('0x68'),'acceptMessage',_0xd1e2ad);}return null;})[_0xb7dc('0x21')](function(_0x253a63){var _0x919f0a=_0xb7dc('0x69')+_0x253a63['message'][_0xb7dc('0x6a')];return db[_0xb7dc('0x6b')][_0xb7dc('0x41')](_0x919f0a,{'type':db['Sequelize'][_0xb7dc('0x6c')][_0xb7dc('0x6d')],'raw':!![]})['then'](function(_0x400d47){return _0x400d47;});})[_0xb7dc('0x21')](function(_0x5272c7){if(_0x5272c7){_0xd1e2ad[_0xb7dc('0x29')][_0xb7dc('0x6e')]=_0x5272c7[0x0];if(!_0x320337[_0xb7dc('0x57')][_0xb7dc('0x60')])return;return db['User']['find']({'where':{'id':_0x320337[_0xb7dc('0x57')]['UserId'],'role':_0xb7dc('0x61')},'attributes':['id',_0xb7dc('0x39'),'fullname',_0xb7dc('0x6f'),'internal'],'raw':!![]});}return null;})['then'](function(_0x3297df){if(!_0x3297df)return null;_0xd1e2ad[_0xb7dc('0x29')]['agent']=_0x3297df;return _0xd1e2ad;})[_0xb7dc('0x21')](function(_0x5f2c8c){if(_0x5f2c8c){if(_0x320337[_0xb7dc('0x57')][_0xb7dc('0x70')]){_0xd1e2ad['message'][_0xb7dc('0x71')]=util[_0xb7dc('0x5e')](_0xb7dc('0x72'),_0x320337[_0xb7dc('0x66')]['name']);_0xd1e2ad['message'][_0xb7dc('0x73')]=_0xd1e2ad[_0xb7dc('0x73')];_0xd1e2ad['message'][_0xb7dc('0x74')]=_0xd1e2ad[_0xb7dc('0x73')];_0xd1e2ad[_0xb7dc('0x29')][_0xb7dc('0x75')]=_0xb7dc('0x5c');return respondWithRpcPromise(_0xb7dc('0x76'),'EventManager',{'event':'acceptmessage','message':_0xd1e2ad['message']},client9002)[_0xb7dc('0x21')](function(){return _0xd1e2ad;});}return _0xd1e2ad;}return null;})[_0xb7dc('0x21')](respondWithResult(_0x80dcdd,null))['catch'](handleError(_0x80dcdd,null));};var interaction_log=require(_0xb7dc('0x5b'))(_0xb7dc('0x77'));exports['reject']=function(_0x2fe93e,_0x30b148,_0x439c7e){var _0x254185={'agent':{},'channel':_0xb7dc('0x78')};if(_0x2fe93e[_0xb7dc('0x57')]['id']){delete _0x2fe93e[_0xb7dc('0x57')]['id'];}_0x2fe93e[_0xb7dc('0x57')]['UserId']=_0x2fe93e['body']['UserId']||_0x2fe93e[_0xb7dc('0x66')]['id'];_0x254185[_0xb7dc('0x61')]['id']=_0x2fe93e[_0xb7dc('0x57')]['UserId'];return db[_0xb7dc('0x3c')]['find']({'where':{'id':_0x2fe93e['params']['id'],'UserId':null}})[_0xb7dc('0x21')](handleEntityNotFound(_0x30b148,null))['then'](function(_0x2f09b5){if(_0x2f09b5){_0x254185[_0xb7dc('0x29')]=_0x2f09b5[_0xb7dc('0x65')]({'plain':!![]});return db[_0xb7dc('0x62')][_0xb7dc('0x59')]({'where':{'id':_0x2f09b5['WhatsappInteractionId']}});}return null;})[_0xb7dc('0x21')](handleEntityNotFound(_0x30b148,null))[_0xb7dc('0x21')](function(_0x23a2a4){if(_0x23a2a4){_0x254185[_0xb7dc('0x64')]=_0x23a2a4['get']({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2fe93e[_0xb7dc('0x66')]['id'],_0x2fe93e[_0xb7dc('0x66')][_0xb7dc('0x39')],_0x2fe93e[_0xb7dc('0x66')][_0xb7dc('0x67')],_0x254185[_0xb7dc('0x64')]['id'],_0x2fe93e[_0xb7dc('0x57')]?JSON[_0xb7dc('0x25')](_0x2fe93e['body']):'null');return respondWithRpcPromise(_0xb7dc('0x79'),_0xb7dc('0x7a'),_0x254185);}return null;})[_0xb7dc('0x21')](function(_0x2321ba){var _0x15ee2b=_0xb7dc('0x69')+_0x2321ba[_0xb7dc('0x29')][_0xb7dc('0x6a')];return db[_0xb7dc('0x6b')]['query'](_0x15ee2b,{'type':db[_0xb7dc('0x7b')]['QueryTypes'][_0xb7dc('0x6d')],'raw':!![]})[_0xb7dc('0x21')](function(_0x10f98c){return _0x10f98c;});})['then'](function(_0x1f337a){if(_0x1f337a){_0x254185[_0xb7dc('0x29')]['contact']=_0x1f337a[0x0];if(!_0x2fe93e['body']['UserId'])return;return db[_0xb7dc('0x7c')]['find']({'where':{'id':_0x2fe93e[_0xb7dc('0x57')]['UserId'],'role':_0xb7dc('0x61')},'attributes':['id',_0xb7dc('0x39'),'fullname',_0xb7dc('0x6f'),_0xb7dc('0x7d')],'raw':!![]});}return null;})[_0xb7dc('0x21')](function(_0x148b5f){if(!_0x148b5f)return null;_0x254185[_0xb7dc('0x29')]['agent']=_0x148b5f;return _0x254185;})['then'](function(_0x5dfd20){if(_0x5dfd20){_0x5dfd20[_0xb7dc('0x29')]['interface']=util['format'](_0xb7dc('0x72'),_0x2fe93e[_0xb7dc('0x66')][_0xb7dc('0x39')]);_0x5dfd20[_0xb7dc('0x29')]['channel']=_0x254185['channel'];_0x5dfd20[_0xb7dc('0x29')][_0xb7dc('0x74')]=_0x254185[_0xb7dc('0x73')];_0x5dfd20['message'][_0xb7dc('0x75')]=_0xb7dc('0x7e');respondWithRpcPromise(_0xb7dc('0x76'),_0xb7dc('0x76'),{'event':'rejectmessage','message':_0x5dfd20[_0xb7dc('0x29')]},client9002);return _0x254185;}return null;})[_0xb7dc('0x21')](respondWithResult(_0x30b148,null))[_0xb7dc('0x2b')](handleError(_0x30b148,null));};exports[_0xb7dc('0x2d')]=function(_0x40764c,_0xfc3379,_0x308e42){if(_0x40764c['body']['id']){delete _0x40764c[_0xb7dc('0x57')]['id'];}var _0x283453;return db[_0xb7dc('0x3c')][_0xb7dc('0x59')]({'where':{'id':_0x40764c[_0xb7dc('0x54')]['id']}})['then'](handleEntityNotFound(_0xfc3379,null))[_0xb7dc('0x21')](function(_0x1e04b1){if(_0x1e04b1){_0x283453=_0x1e04b1;return db[_0xb7dc('0x7f')]['find']({'where':{'id':_0x1e04b1[_0xb7dc('0x80')]}});}})[_0xb7dc('0x21')](handleEntityNotFound(_0xfc3379,null))[_0xb7dc('0x21')](function(_0x3310c0){if(_0x3310c0){logger['debug'](_0xb7dc('0x81'),_0xb7dc('0x2d'),_0xb7dc('0x82'),_0x3310c0['type'],util[_0xb7dc('0x83')](_0x40764c['body'],{'showHidden':![],'depth':null}));switch(_0x3310c0['type']){case _0xb7dc('0x84'):if(_0x40764c[_0xb7dc('0x57')]['MessageSid']&&_0x40764c[_0xb7dc('0x57')][_0xb7dc('0x85')]===_0x283453[_0xb7dc('0x86')]&&_0x40764c[_0xb7dc('0x57')]['MessageStatus']&&_0x40764c[_0xb7dc('0x57')][_0xb7dc('0x87')]===_0xb7dc('0x88')){return _0x283453[_0xb7dc('0x58')]({'read':!![]});}else{logger[_0xb7dc('0x26')](_0xb7dc('0x89'),_0xb7dc('0x2d'),'twilio',util[_0xb7dc('0x83')](_0x40764c[_0xb7dc('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x283453;}})[_0xb7dc('0x21')](respondWithResult(_0xfc3379,null))['catch'](handleError(_0xfc3379,null));}; \ No newline at end of file +var _0x7dbf=['http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','map','rawAttributes','fieldName','type','query','keys','filters','model','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','WhatsappMessage','includeAll','findAll','rows','catch','intersection','options','find','create','body','params','describe','whatsapp-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteraction','WhatsappInteractionId','isNil','format','interaction','user','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','event','EventManager','acceptmessage','reject','whatsapp','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','QueryTypes','internal','motionChannel','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','messageId','MessageStatus','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','defaults','localhost','redis','./whatsappMessage.socket','register','client'];(function(_0x3d3b2d,_0x2e9821){var _0x5a00f7=function(_0x3de0bc){while(--_0x3de0bc){_0x3d3b2d['push'](_0x3d3b2d['shift']());}};_0x5a00f7(++_0x2e9821);}(_0x7dbf,0x66));var _0xf7db=function(_0x634673,_0x27a672){_0x634673=_0x634673-0x0;var _0xe9916e=_0x7dbf[_0x634673];return _0xe9916e;};'use strict';var emlformat=require(_0xf7db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf7db('0x1'));var jsonpatch=require(_0xf7db('0x2'));var rp=require(_0xf7db('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf7db('0x4'));var util=require(_0xf7db('0x5'));var path=require(_0xf7db('0x6'));var sox=require(_0xf7db('0x7'));var csv=require(_0xf7db('0x8'));var ejs=require(_0xf7db('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf7db('0xa'));var crypto=require(_0xf7db('0xb'));var jsforce=require(_0xf7db('0xc'));var deskjs=require(_0xf7db('0xd'));var toCsv=require(_0xf7db('0x8'));var querystring=require(_0xf7db('0xe'));var Papa=require('papaparse');var Redis=require(_0xf7db('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf7db('0x10'));var as=require(_0xf7db('0x11'));var hardwareService=require(_0xf7db('0x12'));var logger=require(_0xf7db('0x13'))(_0xf7db('0x14'));var utils=require(_0xf7db('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xf7db('0x16')](config['redis'],{'host':_0xf7db('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf7db('0x18')]));require(_0xf7db('0x19'))[_0xf7db('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xf7db('0x1b')][_0xf7db('0x1c')]({'port':0x232c});var client9002=jayson[_0xf7db('0x1b')][_0xf7db('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3f1321,_0x3a74c2,_0x5c694d,_0x339662){return new BPromise(function(_0x291a36,_0x546b73){var _0x660c39=_0x339662||client;return _0x660c39[_0xf7db('0x1d')](_0x3f1321,_0x5c694d)['then'](function(_0xcae621){logger[_0xf7db('0x1e')](_0xf7db('0x1f'),_0x3a74c2,_0xf7db('0x20'));logger[_0xf7db('0x21')](_0xf7db('0x22'),_0x3a74c2,'request\x20sent',JSON[_0xf7db('0x23')](_0xcae621));if(_0xcae621[_0xf7db('0x24')]){if(_0xcae621[_0xf7db('0x24')]['code']===0x1f4){logger[_0xf7db('0x24')](_0xf7db('0x1f'),_0x3a74c2,_0xcae621['error'][_0xf7db('0x25')]);return _0x546b73(_0xcae621[_0xf7db('0x24')]['message']);}logger[_0xf7db('0x24')](_0xf7db('0x1f'),_0x3a74c2,_0xcae621[_0xf7db('0x24')][_0xf7db('0x25')]);return _0x291a36(_0xcae621[_0xf7db('0x24')][_0xf7db('0x25')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x3a74c2,_0xf7db('0x20'));_0x291a36(_0xcae621[_0xf7db('0x26')][_0xf7db('0x25')]);}})['catch'](function(_0x976464){logger['error'](_0xf7db('0x1f'),_0x3a74c2,_0x976464);_0x546b73(_0x976464);});});}function respondWithStatusCode(_0x52ec8d,_0x213b04){_0x213b04=_0x213b04||0xcc;return function(_0x50c7b5){if(_0x50c7b5){return _0x52ec8d[_0xf7db('0x27')](_0x213b04);}return _0x52ec8d[_0xf7db('0x28')](_0x213b04)[_0xf7db('0x29')]();};}function respondWithResult(_0x16d86f,_0x44c04c){_0x44c04c=_0x44c04c||0xc8;return function(_0x21e3f6){if(_0x21e3f6){return _0x16d86f[_0xf7db('0x28')](_0x44c04c)[_0xf7db('0x2a')](_0x21e3f6);}};}function respondWithFilteredResult(_0x3dd711,_0x5bb903){return function(_0x147e11){if(_0x147e11){var _0x5bf9ca=typeof _0x5bb903[_0xf7db('0x2b')]==='undefined'&&typeof _0x5bb903['limit']==='undefined';var _0x3325e0=_0x147e11[_0xf7db('0x2c')];var _0x158d64=_0x5bf9ca?0x0:_0x5bb903[_0xf7db('0x2b')];var _0x198996=_0x5bf9ca?_0x147e11['count']:_0x5bb903[_0xf7db('0x2b')]+_0x5bb903[_0xf7db('0x2d')];var _0x3c1777;if(_0x198996>=_0x3325e0){_0x198996=_0x3325e0;_0x3c1777=0xc8;}else{_0x3c1777=0xce;}_0x3dd711[_0xf7db('0x28')](_0x3c1777);return _0x3dd711['set'](_0xf7db('0x2e'),_0x158d64+'-'+_0x198996+'/'+_0x3325e0)[_0xf7db('0x2a')](_0x147e11);}return null;};}function patchUpdates(_0x3db41e){return function(_0xe14cbf){try{jsonpatch[_0xf7db('0x2f')](_0xe14cbf,_0x3db41e,!![]);}catch(_0x1548fb){return BPromise['reject'](_0x1548fb);}return _0xe14cbf[_0xf7db('0x30')]();};}function saveUpdates(_0x562a34,_0x492e97){return function(_0x482665){if(_0x482665){return _0x482665[_0xf7db('0x31')](_0x562a34)[_0xf7db('0x32')](function(_0x34c47c){return _0x34c47c;});}return null;};}function removeEntity(_0x49a0cf,_0xbe0551){return function(_0x258008){if(_0x258008){return _0x258008[_0xf7db('0x33')]()[_0xf7db('0x32')](function(){_0x49a0cf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x80d19f,_0x11d9a2){return function(_0xddb640){if(!_0xddb640){_0x80d19f[_0xf7db('0x27')](0x194);}return _0xddb640;};}function handleError(_0x3d310a,_0x3e19e6){_0x3e19e6=_0x3e19e6||0x1f4;return function(_0x444331){logger[_0xf7db('0x24')](_0x444331[_0xf7db('0x34')]);if(_0x444331[_0xf7db('0x35')]){delete _0x444331[_0xf7db('0x35')];}_0x3d310a[_0xf7db('0x28')](_0x3e19e6)[_0xf7db('0x36')](_0x444331);};}exports['index']=function(_0x3e0902,_0x5ed245){var _0x45f9ff={},_0x49ca46={},_0x106ad0={'count':0x0,'rows':[]};var _0x2c0b35=_[_0xf7db('0x37')](db['WhatsappMessage'][_0xf7db('0x38')],function(_0x4976ee){return{'name':_0x4976ee[_0xf7db('0x39')],'type':_0x4976ee[_0xf7db('0x3a')]['key']};});_0x49ca46['model']=_[_0xf7db('0x37')](_0x2c0b35,_0xf7db('0x35'));_0x49ca46[_0xf7db('0x3b')]=_[_0xf7db('0x3c')](_0x3e0902[_0xf7db('0x3b')]);_0x49ca46[_0xf7db('0x3d')]=_['intersection'](_0x49ca46[_0xf7db('0x3e')],_0x49ca46[_0xf7db('0x3b')]);_0x45f9ff[_0xf7db('0x3f')]=_['intersection'](_0x49ca46[_0xf7db('0x3e')],qs[_0xf7db('0x40')](_0x3e0902[_0xf7db('0x3b')][_0xf7db('0x40')]));_0x45f9ff[_0xf7db('0x3f')]=_0x45f9ff['attributes'][_0xf7db('0x41')]?_0x45f9ff[_0xf7db('0x3f')]:_0x49ca46[_0xf7db('0x3e')];if(!_0x3e0902[_0xf7db('0x3b')]['hasOwnProperty'](_0xf7db('0x42'))){_0x45f9ff[_0xf7db('0x2d')]=qs[_0xf7db('0x2d')](_0x3e0902['query']['limit']);_0x45f9ff[_0xf7db('0x2b')]=qs[_0xf7db('0x2b')](_0x3e0902[_0xf7db('0x3b')]['offset']);}_0x45f9ff[_0xf7db('0x43')]=qs['sort'](_0x3e0902[_0xf7db('0x3b')]['sort']);_0x45f9ff[_0xf7db('0x44')]=qs['filters'](_[_0xf7db('0x45')](_0x3e0902['query'],_0x49ca46[_0xf7db('0x3d')]),_0x2c0b35);if(_0x3e0902['query'][_0xf7db('0x46')]){_0x45f9ff[_0xf7db('0x44')]=_[_0xf7db('0x47')](_0x45f9ff['where'],{'$or':_[_0xf7db('0x37')](_0x2c0b35,function(_0x1bef9b){if(_0x1bef9b['type']!==_0xf7db('0x48')){var _0x321cbd={};_0x321cbd[_0x1bef9b[_0xf7db('0x35')]]={'$like':'%'+_0x3e0902['query'][_0xf7db('0x46')]+'%'};return _0x321cbd;}})});}_0x45f9ff=_[_0xf7db('0x47')]({},_0x45f9ff,_0x3e0902['options']);var _0xe1f281={'where':_0x45f9ff[_0xf7db('0x44')]};return db[_0xf7db('0x49')][_0xf7db('0x2c')](_0xe1f281)['then'](function(_0x3ec679){_0x106ad0[_0xf7db('0x2c')]=_0x3ec679;if(_0x3e0902[_0xf7db('0x3b')][_0xf7db('0x4a')]){_0x45f9ff['include']=[{'all':!![]}];}return db[_0xf7db('0x49')][_0xf7db('0x4b')](_0x45f9ff);})[_0xf7db('0x32')](function(_0x434fd5){_0x106ad0[_0xf7db('0x4c')]=_0x434fd5;return _0x106ad0;})['then'](respondWithFilteredResult(_0x5ed245,_0x45f9ff))[_0xf7db('0x4d')](handleError(_0x5ed245,null));};exports['show']=function(_0x3c8b9c,_0x1a1493){var _0x4d988d={'raw':!![],'where':{'id':_0x3c8b9c['params']['id']}},_0x45612f={};_0x45612f['model']=_[_0xf7db('0x3c')](db[_0xf7db('0x49')]['rawAttributes']);_0x45612f[_0xf7db('0x3b')]=_[_0xf7db('0x3c')](_0x3c8b9c[_0xf7db('0x3b')]);_0x45612f[_0xf7db('0x3d')]=_[_0xf7db('0x4e')](_0x45612f['model'],_0x45612f['query']);_0x4d988d['attributes']=_[_0xf7db('0x4e')](_0x45612f['model'],qs[_0xf7db('0x40')](_0x3c8b9c[_0xf7db('0x3b')][_0xf7db('0x40')]));_0x4d988d[_0xf7db('0x3f')]=_0x4d988d[_0xf7db('0x3f')][_0xf7db('0x41')]?_0x4d988d[_0xf7db('0x3f')]:_0x45612f[_0xf7db('0x3e')];if(_0x3c8b9c['query'][_0xf7db('0x4a')]){_0x4d988d['include']=[{'all':!![]}];}_0x4d988d=_[_0xf7db('0x47')]({},_0x4d988d,_0x3c8b9c[_0xf7db('0x4f')]);return db[_0xf7db('0x49')][_0xf7db('0x50')](_0x4d988d)[_0xf7db('0x32')](handleEntityNotFound(_0x1a1493,null))[_0xf7db('0x32')](respondWithResult(_0x1a1493,null))[_0xf7db('0x4d')](handleError(_0x1a1493,null));};exports[_0xf7db('0x51')]=function(_0xca3d86,_0x192cba){return db[_0xf7db('0x49')]['create'](_0xca3d86[_0xf7db('0x52')],{})['then'](respondWithResult(_0x192cba,0xc9))[_0xf7db('0x4d')](handleError(_0x192cba,null));};exports['update']=function(_0x94fc15,_0x5c565f){if(_0x94fc15[_0xf7db('0x52')]['id']){delete _0x94fc15[_0xf7db('0x52')]['id'];}return db['WhatsappMessage'][_0xf7db('0x50')]({'where':{'id':_0x94fc15[_0xf7db('0x53')]['id']}})[_0xf7db('0x32')](handleEntityNotFound(_0x5c565f,null))[_0xf7db('0x32')](saveUpdates(_0x94fc15['body'],null))['then'](respondWithResult(_0x5c565f,null))['catch'](handleError(_0x5c565f,null));};exports[_0xf7db('0x33')]=function(_0x38d63e,_0x35e199){return db[_0xf7db('0x49')][_0xf7db('0x50')]({'where':{'id':_0x38d63e[_0xf7db('0x53')]['id']}})['then'](handleEntityNotFound(_0x35e199,null))['then'](removeEntity(_0x35e199,null))['catch'](handleError(_0x35e199,null));};exports[_0xf7db('0x54')]=function(_0xf224d1,_0x504bec){return db[_0xf7db('0x49')][_0xf7db('0x54')]()[_0xf7db('0x32')](respondWithResult(_0x504bec,null))[_0xf7db('0x4d')](handleError(_0x504bec,null));};var interaction_log=require('../../config/logger')(_0xf7db('0x55'));exports[_0xf7db('0x56')]=function(_0x232f39,_0x213745,_0x1be560){var _0x5a883d={'agent':{},'channel':'whatsapp'};if(_0x232f39[_0xf7db('0x52')]['id']){delete _0x232f39[_0xf7db('0x52')]['id'];}_0x232f39[_0xf7db('0x52')][_0xf7db('0x57')]=!![];_0x232f39['body']['readAt']=moment()['format'](_0xf7db('0x58'));_0x232f39[_0xf7db('0x52')][_0xf7db('0x59')]=_0x232f39[_0xf7db('0x52')]['UserId']||_0x232f39['user']['id'];_0x5a883d[_0xf7db('0x5a')]['id']=_0x232f39[_0xf7db('0x52')][_0xf7db('0x59')];return db[_0xf7db('0x49')][_0xf7db('0x50')]({'where':{'id':_0x232f39['params']['id'],'UserId':null}})[_0xf7db('0x32')](handleEntityNotFound(_0x213745,null))[_0xf7db('0x32')](saveUpdates(_0x232f39[_0xf7db('0x52')],null))[_0xf7db('0x32')](function(_0x3194f6){if(_0x3194f6){_0x5a883d['message']=_0x3194f6[_0xf7db('0x5b')]({'plain':!![]});return db[_0xf7db('0x5c')][_0xf7db('0x50')]({'where':{'id':_0x3194f6[_0xf7db('0x5d')]}});}return null;})[_0xf7db('0x32')](handleEntityNotFound(_0x213745,null))['then'](function(_0x1fa693){if(_0x1fa693){return _0x1fa693['update']({'UserId':_0x232f39[_0xf7db('0x52')][_0xf7db('0x59')],'read1stAt':_[_0xf7db('0x5e')](_0x1fa693['read1stAt'])?moment()[_0xf7db('0x5f')](_0xf7db('0x58')):undefined});}return null;})[_0xf7db('0x32')](function(_0x54ce25){if(_0x54ce25){_0x5a883d[_0xf7db('0x60')]=_0x54ce25['get']({'plain':!![]});interaction_log[_0xf7db('0x1e')]('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x232f39[_0xf7db('0x61')]['id'],_0x232f39['user'][_0xf7db('0x35')],_0x232f39[_0xf7db('0x61')]['role'],_0x5a883d[_0xf7db('0x60')]['id'],_0x232f39[_0xf7db('0x52')]?JSON[_0xf7db('0x23')](_0x232f39[_0xf7db('0x52')]):_0xf7db('0x62'));return respondWithRpcPromise(_0xf7db('0x63'),_0xf7db('0x64'),_0x5a883d);}return null;})['then'](function(_0x26b5cf){var _0x7b0317=_0xf7db('0x65')+_0x26b5cf[_0xf7db('0x25')]['ContactId'];return db[_0xf7db('0x66')][_0xf7db('0x3b')](_0x7b0317,{'type':db[_0xf7db('0x67')]['QueryTypes'][_0xf7db('0x68')],'raw':!![]})[_0xf7db('0x32')](function(_0xb8b88b){return _0xb8b88b;});})['then'](function(_0x123b90){if(_0x123b90){_0x5a883d['message'][_0xf7db('0x69')]=_0x123b90[0x0];if(!_0x232f39[_0xf7db('0x52')][_0xf7db('0x59')])return;return db[_0xf7db('0x6a')]['find']({'where':{'id':_0x232f39['body'][_0xf7db('0x59')],'role':_0xf7db('0x5a')},'attributes':['id','name',_0xf7db('0x6b'),_0xf7db('0x6c'),'internal'],'raw':!![]});}return null;})['then'](function(_0x19f915){if(!_0x19f915)return null;_0x5a883d['message']['agent']=_0x19f915;return _0x5a883d;})[_0xf7db('0x32')](function(_0x3211da){if(_0x3211da){if(_0x232f39[_0xf7db('0x52')]['manual']){_0x5a883d[_0xf7db('0x25')][_0xf7db('0x6d')]=util[_0xf7db('0x5f')](_0xf7db('0x6e'),_0x232f39[_0xf7db('0x61')][_0xf7db('0x35')]);_0x5a883d['message']['channel']=_0x5a883d[_0xf7db('0x6f')];_0x5a883d[_0xf7db('0x25')]['motionChannel']=_0x5a883d[_0xf7db('0x6f')];_0x5a883d[_0xf7db('0x25')][_0xf7db('0x70')]=_0xf7db('0x56');return respondWithRpcPromise(_0xf7db('0x71'),_0xf7db('0x71'),{'event':_0xf7db('0x72'),'message':_0x5a883d[_0xf7db('0x25')]},client9002)['then'](function(){return _0x5a883d;});}return _0x5a883d;}return null;})['then'](respondWithResult(_0x213745,null))['catch'](handleError(_0x213745,null));};var interaction_log=require(_0xf7db('0x13'))(_0xf7db('0x55'));exports[_0xf7db('0x73')]=function(_0x1c416d,_0x5c3ce3,_0x43cd4b){var _0x32fa50={'agent':{},'channel':_0xf7db('0x74')};if(_0x1c416d[_0xf7db('0x52')]['id']){delete _0x1c416d[_0xf7db('0x52')]['id'];}_0x1c416d[_0xf7db('0x52')][_0xf7db('0x59')]=_0x1c416d[_0xf7db('0x52')][_0xf7db('0x59')]||_0x1c416d[_0xf7db('0x61')]['id'];_0x32fa50[_0xf7db('0x5a')]['id']=_0x1c416d[_0xf7db('0x52')][_0xf7db('0x59')];return db[_0xf7db('0x49')]['find']({'where':{'id':_0x1c416d[_0xf7db('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5c3ce3,null))[_0xf7db('0x32')](function(_0x4b1840){if(_0x4b1840){_0x32fa50[_0xf7db('0x25')]=_0x4b1840[_0xf7db('0x5b')]({'plain':!![]});return db[_0xf7db('0x5c')]['find']({'where':{'id':_0x4b1840[_0xf7db('0x5d')]}});}return null;})['then'](handleEntityNotFound(_0x5c3ce3,null))[_0xf7db('0x32')](function(_0x3ba09c){if(_0x3ba09c){_0x32fa50[_0xf7db('0x60')]=_0x3ba09c[_0xf7db('0x5b')]({'plain':!![]});interaction_log[_0xf7db('0x1e')](_0xf7db('0x75'),_0x1c416d['user']['id'],_0x1c416d[_0xf7db('0x61')][_0xf7db('0x35')],_0x1c416d[_0xf7db('0x61')][_0xf7db('0x76')],_0x32fa50['interaction']['id'],_0x1c416d[_0xf7db('0x52')]?JSON[_0xf7db('0x23')](_0x1c416d[_0xf7db('0x52')]):_0xf7db('0x62'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x32fa50);}return null;})[_0xf7db('0x32')](function(_0x3aaa36){var _0x297ab3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3aaa36['message']['ContactId'];return db[_0xf7db('0x66')][_0xf7db('0x3b')](_0x297ab3,{'type':db[_0xf7db('0x67')][_0xf7db('0x77')]['SELECT'],'raw':!![]})[_0xf7db('0x32')](function(_0x3e1c0f){return _0x3e1c0f;});})[_0xf7db('0x32')](function(_0x26d221){if(_0x26d221){_0x32fa50['message']['contact']=_0x26d221[0x0];if(!_0x1c416d[_0xf7db('0x52')]['UserId'])return;return db[_0xf7db('0x6a')][_0xf7db('0x50')]({'where':{'id':_0x1c416d['body']['UserId'],'role':'agent'},'attributes':['id',_0xf7db('0x35'),_0xf7db('0x6b'),_0xf7db('0x6c'),_0xf7db('0x78')],'raw':!![]});}return null;})[_0xf7db('0x32')](function(_0x4b8090){if(!_0x4b8090)return null;_0x32fa50[_0xf7db('0x25')][_0xf7db('0x5a')]=_0x4b8090;return _0x32fa50;})['then'](function(_0x3926a0){if(_0x3926a0){_0x3926a0[_0xf7db('0x25')][_0xf7db('0x6d')]=util['format'](_0xf7db('0x6e'),_0x1c416d[_0xf7db('0x61')][_0xf7db('0x35')]);_0x3926a0['message'][_0xf7db('0x6f')]=_0x32fa50[_0xf7db('0x6f')];_0x3926a0['message'][_0xf7db('0x79')]=_0x32fa50['channel'];_0x3926a0[_0xf7db('0x25')][_0xf7db('0x70')]=_0xf7db('0x73');respondWithRpcPromise(_0xf7db('0x71'),_0xf7db('0x71'),{'event':_0xf7db('0x7a'),'message':_0x3926a0[_0xf7db('0x25')]},client9002);return _0x32fa50;}return null;})[_0xf7db('0x32')](respondWithResult(_0x5c3ce3,null))[_0xf7db('0x4d')](handleError(_0x5c3ce3,null));};exports[_0xf7db('0x28')]=function(_0x4a04b8,_0x566740,_0xa080fb){if(_0x4a04b8[_0xf7db('0x52')]['id']){delete _0x4a04b8[_0xf7db('0x52')]['id'];}var _0xac834f;return db['WhatsappMessage'][_0xf7db('0x50')]({'where':{'id':_0x4a04b8[_0xf7db('0x53')]['id']}})['then'](handleEntityNotFound(_0x566740,null))[_0xf7db('0x32')](function(_0xd13b79){if(_0xd13b79){_0xac834f=_0xd13b79;return db[_0xf7db('0x7b')][_0xf7db('0x50')]({'where':{'id':_0xd13b79['WhatsappAccountId']}});}})[_0xf7db('0x32')](handleEntityNotFound(_0x566740,null))[_0xf7db('0x32')](function(_0x5ddadd){if(_0x5ddadd){logger['debug'](_0xf7db('0x7c'),_0xf7db('0x28'),_0xf7db('0x7d'),_0x5ddadd[_0xf7db('0x3a')],util[_0xf7db('0x7e')](_0x4a04b8[_0xf7db('0x52')],{'showHidden':![],'depth':null}));switch(_0x5ddadd[_0xf7db('0x3a')]){case _0xf7db('0x7f'):if(_0x4a04b8[_0xf7db('0x52')]['MessageSid']&&_0x4a04b8[_0xf7db('0x52')]['MessageSid']===_0xac834f[_0xf7db('0x80')]&&_0x4a04b8[_0xf7db('0x52')][_0xf7db('0x81')]&&_0x4a04b8['body'][_0xf7db('0x81')]===_0xf7db('0x57')){return _0xac834f[_0xf7db('0x31')]({'read':!![]});}else{logger['error']('WhatsappAccount,\x20%s,\x20%s,\x20%s','status',_0xf7db('0x7f'),util['inspect'](_0x4a04b8[_0xf7db('0x52')],{'showHidden':![],'depth':null}));}break;}return _0xac834f;}})['then'](respondWithResult(_0x566740,null))[_0xf7db('0x4d')](handleError(_0x566740,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 22cbd3e..fbae8d4 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 _0xe3d4=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','../../mysqldb','WhatsappMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x1b4695,_0x3a90e3){_0x1b4695=_0x1b4695-0x0;var _0x376a90=_0xe3d4[_0x1b4695];return _0x376a90;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x4e3d('0x0'))['db'][_0x4e3d('0x1')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4e3d('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4e3d('0x3'),'afterDestroy':_0x4e3d('0x4')};function emitEvent(_0x5a7634){return function(_0x1db7a4,_0x4ece82,_0x438b9a){WhatsappMessageEvents[_0x4e3d('0x5')](_0x5a7634+':'+_0x1db7a4['id'],_0x1db7a4);WhatsappMessageEvents['emit'](_0x5a7634,_0x1db7a4);_0x438b9a(null);};}for(var e in events){if(events[_0x4e3d('0x6')](e)){var event=events[e];WhatsappMessage[_0x4e3d('0x7')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x087b=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0x087b,0x11a));var _0xb087=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x087b[_0x500419];return _0x241c1a;};'use strict';var EventEmitter=require(_0xb087('0x0'));var WhatsappMessage=require(_0xb087('0x1'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb087('0x2'),'afterUpdate':'update','afterDestroy':_0xb087('0x3')};function emitEvent(_0x2020b7){return function(_0x1d3299,_0xf1cf84,_0x183efd){WhatsappMessageEvents[_0xb087('0x4')](_0x2020b7+':'+_0x1d3299['id'],_0x1d3299);WhatsappMessageEvents[_0xb087('0x4')](_0x2020b7,_0x1d3299);_0x183efd(null);};}for(var e in events){if(events[_0xb087('0x5')](e)){var event=events[e];WhatsappMessage[_0xb087('0x6')](e,emitEvent(event));}}module[_0xb087('0x7')]=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index f8fc4d8..fb77169 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 _0x3edf=['body','models','get','direction','secret','UserId','findOne','then','update','toLowerCase','catch','error','out','WhatsappAccount','WhatsappAccountId','type','twilio','authToken','messages','create','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','accountSid','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages'];(function(_0x501d96,_0x52ee71){var _0x3c00e4=function(_0x1c94a8){while(--_0x1c94a8){_0x501d96['push'](_0x501d96['shift']());}};_0x3c00e4(++_0x52ee71);}(_0x3edf,0xde));var _0xf3ed=function(_0x114c9e,_0x5890ce){_0x114c9e=_0x114c9e-0x0;var _0x362c05=_0x3edf[_0x114c9e];return _0x362c05;};'use strict';var _=require(_0xf3ed('0x0'));var util=require(_0xf3ed('0x1'));var logger=require(_0xf3ed('0x2'))(_0xf3ed('0x3'));var moment=require(_0xf3ed('0x4'));var BPromise=require(_0xf3ed('0x5'));var rp=require(_0xf3ed('0x6'));var fetch=require('node-fetch');var fs=require('fs');var path=require(_0xf3ed('0x7'));var rimraf=require(_0xf3ed('0x8'));var config=require('../../config/environment');var attributes=require('./whatsappMessage.attributes');module[_0xf3ed('0x9')]=function(_0x381208,_0xe3d983){return _0x381208['define'](_0xf3ed('0xa'),attributes,{'tableName':_0xf3ed('0xb'),'paranoid':![],'indexes':[{'name':_0xf3ed('0xc'),'fields':[_0xf3ed('0xc')]},{'name':_0xf3ed('0xd'),'fields':[_0xf3ed('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2e1f78,_0x2fdeb7,_0x3ec304){var _0x3fe080=_0x381208[_0xf3ed('0xf')];var _0x24ff34=_0x2e1f78[_0xf3ed('0x10')]({'plain':!![]});if(_0x24ff34[_0xf3ed('0x11')]['toLowerCase']()==='in'||_0x24ff34[_0xf3ed('0x11')]['toLowerCase']()==='out'&&!_0x24ff34[_0xf3ed('0x12')]&&!_['isNil'](_0x24ff34[_0xf3ed('0x13')])){_0x3fe080['WhatsappInteraction'][_0xf3ed('0x14')]({'where':{'id':_0x24ff34['WhatsappInteractionId']}})[_0xf3ed('0x15')](function(_0x43a8f2){if(_0x43a8f2){_0x43a8f2[_0xf3ed('0x16')]({'lastMsgAt':_0x24ff34['createdAt'],'lastMsgDirection':_0x24ff34['direction'][_0xf3ed('0x17')]()});}})[_0xf3ed('0x18')](function(_0x142f71){console[_0xf3ed('0x19')](_0x142f71);});}if(_0x24ff34[_0xf3ed('0x11')]===_0xf3ed('0x1a')&&!_0x24ff34[_0xf3ed('0x12')]){var _0x218561;_0x3fe080[_0xf3ed('0x1b')]['find']({'where':{'id':_0x24ff34[_0xf3ed('0x1c')]},'raw':!![]})['then'](function(_0x2ee0f0){_0x218561=_0x2ee0f0;if(_0x218561&&_0x218561[_0xf3ed('0x1d')]){switch(_0x218561['type']){case _0xf3ed('0x1e'):var _0x5ec84d=require(_0xf3ed('0x1e'));if(_0x218561['accountSid']&&_0x218561['authToken']&&_0x218561['phone']){var _0x349317=new _0x5ec84d(_0x218561['accountSid'],_0x218561[_0xf3ed('0x1f')]);_0x349317[_0xf3ed('0x20')][_0xf3ed('0x21')]({'body':_0x24ff34['body'],'to':_0xf3ed('0x22')+_0x24ff34[_0xf3ed('0x23')],'from':_0xf3ed('0x22')+_0x218561[_0xf3ed('0x23')],'statusCallback':_0x218561[_0xf3ed('0x24')]+_0xf3ed('0x25')+_0x24ff34['id']+_0xf3ed('0x26')+_0x218561[_0xf3ed('0x27')]})[_0xf3ed('0x15')](function(_0x471eb1){if(_0x471eb1[_0xf3ed('0x28')]){return _0x2e1f78['update']({'messageId':_0x471eb1[_0xf3ed('0x28')]});}})[_0xf3ed('0x18')](function(_0x28221f){logger[_0xf3ed('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xf3ed('0x29'),_0xf3ed('0x1e'),util[_0xf3ed('0x2a')](_0x28221f,{'showHidden':![],'depth':null}));});}else{logger[_0xf3ed('0x19')](_0xf3ed('0x2b'),_0xf3ed('0x29'),_0xf3ed('0x1e'),_0xf3ed('0x2c'));}break;case _0xf3ed('0x2d'):var _0x46e675=_0x218561[_0xf3ed('0x2e')];var _0x3ff0ce=_0x218561[_0xf3ed('0x1f')];var _0x512c67=_0x218561[_0xf3ed('0x2f')]+_0xf3ed('0x30')+_0x46e675+_0xf3ed('0x31');var _0x9e57cf={'to':[_0x24ff34[_0xf3ed('0x23')]],'message':{'type':_0xf3ed('0x32'),'text':_0x24ff34['body']}};var _0x288be2={'method':'POST','uri':_0x512c67,'headers':{'Authorization':_0xf3ed('0x33')+_0x3ff0ce,'Content-Type':_0xf3ed('0x34')},'body':_0x9e57cf,'json':!![]};rp(_0x288be2)[_0xf3ed('0x15')](function(_0x45dcf2){if(_0x45dcf2[_0xf3ed('0x35')][0x0]['message_id']){return _0x2e1f78[_0xf3ed('0x16')]({'messageId':_0x45dcf2[_0xf3ed('0x35')][0x0][_0xf3ed('0x36')]});}})[_0xf3ed('0x18')](function(_0xd8b528){logger[_0xf3ed('0x37')](_0xf3ed('0x38'),_0xd8b528);});break;}}})[_0xf3ed('0x39')](function(){_0x3ec304();});}else{_0x3ec304();}}},'charset':'utf8mb4','collate':_0xf3ed('0x3a')});}; \ No newline at end of file +var _0x0605=['finally','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','./whatsappMessage.attributes','define','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','update','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','then','catch','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','accountSid','baseUrl','/whatsapp/v1/','text','POST','application/json','statuses','message_id','err','WhatsappMessage,\x20%s'];(function(_0x5e93be,_0xf4e717){var _0x44bf05=function(_0x7fb1a2){while(--_0x7fb1a2){_0x5e93be['push'](_0x5e93be['shift']());}};_0x44bf05(++_0xf4e717);}(_0x0605,0x1c2));var _0x5060=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x0605[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0x5060('0x0'));var util=require(_0x5060('0x1'));var logger=require('../../config/logger')(_0x5060('0x2'));var moment=require(_0x5060('0x3'));var BPromise=require(_0x5060('0x4'));var rp=require(_0x5060('0x5'));var fetch=require(_0x5060('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5060('0x7'));var config=require(_0x5060('0x8'));var attributes=require(_0x5060('0x9'));module['exports']=function(_0x27aae3,_0x5e752c){return _0x27aae3[_0x5060('0xa')]('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':'messageId','fields':['messageId']},{'name':'fti_whatsapp_messages','fields':[_0x5060('0xb')],'type':_0x5060('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2edd61,_0x3ef9de,_0x12412f){var _0x5097d9=_0x27aae3[_0x5060('0xd')];var _0x1a3285=_0x2edd61[_0x5060('0xe')]({'plain':!![]});if(_0x1a3285[_0x5060('0xf')][_0x5060('0x10')]()==='in'||_0x1a3285[_0x5060('0xf')][_0x5060('0x10')]()===_0x5060('0x11')&&!_0x1a3285[_0x5060('0x12')]&&!_[_0x5060('0x13')](_0x1a3285[_0x5060('0x14')])){_0x5097d9[_0x5060('0x15')][_0x5060('0x16')]({'where':{'id':_0x1a3285['WhatsappInteractionId']}})['then'](function(_0x3605e0){if(_0x3605e0){_0x3605e0[_0x5060('0x17')]({'lastMsgAt':_0x1a3285[_0x5060('0x18')],'lastMsgDirection':_0x1a3285[_0x5060('0xf')][_0x5060('0x10')]()});}})['catch'](function(_0x33bd5b){console[_0x5060('0x19')](_0x33bd5b);});}if(_0x1a3285[_0x5060('0xf')]===_0x5060('0x11')&&!_0x1a3285[_0x5060('0x12')]){var _0x1f25f5;_0x5097d9[_0x5060('0x1a')][_0x5060('0x1b')]({'where':{'id':_0x1a3285[_0x5060('0x1c')]},'raw':!![]})['then'](function(_0x16925b){_0x1f25f5=_0x16925b;if(_0x1f25f5&&_0x1f25f5['type']){switch(_0x1f25f5[_0x5060('0x1d')]){case _0x5060('0x1e'):var _0x191879=require(_0x5060('0x1e'));if(_0x1f25f5['accountSid']&&_0x1f25f5[_0x5060('0x1f')]&&_0x1f25f5[_0x5060('0x20')]){var _0x46f00a=new _0x191879(_0x1f25f5['accountSid'],_0x1f25f5[_0x5060('0x1f')]);_0x46f00a['messages']['create']({'body':_0x1a3285[_0x5060('0xb')],'to':_0x5060('0x21')+_0x1a3285['phone'],'from':'whatsapp:'+_0x1f25f5[_0x5060('0x20')],'statusCallback':_0x1f25f5[_0x5060('0x22')]+_0x5060('0x23')+_0x1a3285['id']+_0x5060('0x24')+_0x1f25f5[_0x5060('0x25')]})[_0x5060('0x26')](function(_0x48a1aa){if(_0x48a1aa['sid']){return _0x2edd61[_0x5060('0x17')]({'messageId':_0x48a1aa['sid']});}})[_0x5060('0x27')](function(_0x5b4852){logger[_0x5060('0x19')](_0x5060('0x28'),_0x5060('0x29'),_0x5060('0x1e'),util[_0x5060('0x2a')](_0x5b4852,{'showHidden':![],'depth':null}));});}else{logger[_0x5060('0x19')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5060('0x29'),_0x5060('0x1e'),_0x5060('0x2b'));}break;case'sinch':var _0x471aee=_0x1f25f5[_0x5060('0x2c')];var _0x4996ce=_0x1f25f5[_0x5060('0x1f')];var _0x8a094a=_0x1f25f5[_0x5060('0x2d')]+_0x5060('0x2e')+_0x471aee+'/messages/';var _0x342845={'to':[_0x1a3285['phone']],'message':{'type':_0x5060('0x2f'),'text':_0x1a3285[_0x5060('0xb')]}};var _0x435529={'method':_0x5060('0x30'),'uri':_0x8a094a,'headers':{'Authorization':'Bearer\x20'+_0x4996ce,'Content-Type':_0x5060('0x31')},'body':_0x342845,'json':!![]};rp(_0x435529)[_0x5060('0x26')](function(_0x2005a5){if(_0x2005a5[_0x5060('0x32')][0x0]['message_id']){return _0x2edd61['update']({'messageId':_0x2005a5['statuses'][0x0][_0x5060('0x33')]});}})[_0x5060('0x27')](function(_0x2be9c2){logger[_0x5060('0x34')](_0x5060('0x35'),_0x2be9c2);});break;}}})[_0x5060('0x36')](function(){_0x12412f();});}else{_0x12412f();}}},'charset':'utf8mb4','collate':_0x5060('0x37')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index abd386b..bcd5f49 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 _0x02d7=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','create','body','options','CreateWhatsappMessage','lodash','util','moment','randomstring','ioredis'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x02d7,0xa5));var _0x702d=function(_0x15c5ea,_0x5ef5cb){_0x15c5ea=_0x15c5ea-0x0;var _0x3890d6=_0x02d7[_0x15c5ea];return _0x3890d6;};'use strict';var _=require(_0x702d('0x0'));var util=require(_0x702d('0x1'));var moment=require(_0x702d('0x2'));var BPromise=require('bluebird');var rs=require(_0x702d('0x3'));var fs=require('fs');var Redis=require(_0x702d('0x4'));var db=require(_0x702d('0x5'))['db'];var utils=require(_0x702d('0x6'));var logger=require(_0x702d('0x7'))(_0x702d('0x8'));var config=require(_0x702d('0x9'));var jayson=require(_0x702d('0xa'));var client=jayson['client'][_0x702d('0xb')]({'port':0x232a});config[_0x702d('0xc')]=_[_0x702d('0xd')](config[_0x702d('0xc')],{'host':_0x702d('0xe'),'port':0x18eb});var socket=require(_0x702d('0xf'))(new Redis(config[_0x702d('0xc')]));require(_0x702d('0x10'))[_0x702d('0x11')](socket);function respondWithRpcPromise(_0x3c481a,_0x1007aa,_0x31de26){return new BPromise(function(_0x2fc14e,_0x1585ac){return client['request'](_0x3c481a,_0x31de26)[_0x702d('0x12')](function(_0x2eb2e9){logger[_0x702d('0x13')](_0x702d('0x14'),_0x1007aa,_0x702d('0x15'));logger[_0x702d('0x16')](_0x702d('0x17'),_0x1007aa,_0x702d('0x15'),JSON[_0x702d('0x18')](_0x2eb2e9));if(_0x2eb2e9[_0x702d('0x19')]){if(_0x2eb2e9[_0x702d('0x19')][_0x702d('0x1a')]===0x1f4){logger[_0x702d('0x19')](_0x702d('0x14'),_0x1007aa,_0x2eb2e9[_0x702d('0x19')]['message']);return _0x1585ac(_0x2eb2e9[_0x702d('0x19')][_0x702d('0x1b')]);}logger[_0x702d('0x19')]('WhatsappMessage,\x20%s,\x20%s',_0x1007aa,_0x2eb2e9[_0x702d('0x19')]['message']);return _0x2fc14e(_0x2eb2e9[_0x702d('0x19')][_0x702d('0x1b')]);}else{logger[_0x702d('0x13')](_0x702d('0x14'),_0x1007aa,_0x702d('0x15'));_0x2fc14e(_0x2eb2e9[_0x702d('0x1c')][_0x702d('0x1b')]);}})[_0x702d('0x1d')](function(_0x87a4a){logger[_0x702d('0x19')](_0x702d('0x14'),_0x1007aa,_0x87a4a);_0x1585ac(_0x87a4a);});});}exports['CreateWhatsappMessage']=function(_0x1c47d0){var _0x495192=this;return new Promise(function(_0x4c301f,_0x10b768){return db['WhatsappMessage'][_0x702d('0x1e')](_0x1c47d0[_0x702d('0x1f')],{'raw':_0x1c47d0[_0x702d('0x20')]?_0x1c47d0['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x916bac){logger[_0x702d('0x13')](_0x702d('0x21'),_0x1c47d0);logger['debug'](_0x702d('0x21'),_0x1c47d0,JSON[_0x702d('0x18')](_0x916bac));_0x4c301f(_0x916bac);})[_0x702d('0x1d')](function(_0x284647){logger[_0x702d('0x19')]('CreateWhatsappMessage',_0x284647[_0x702d('0x1b')],_0x1c47d0);_0x10b768(_0x495192[_0x702d('0x19')](0x1f4,_0x284647['message']));});});}; \ No newline at end of file +var _0x0c95=['http','defaults','redis','localhost','./whatsappMessage.socket','request','then','info','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','bluebird','randomstring','../../config/utils','rpc','jayson/promise'];(function(_0x16e82d,_0x1c05fd){var _0x293da2=function(_0xaa9bcd){while(--_0xaa9bcd){_0x16e82d['push'](_0x16e82d['shift']());}};_0x293da2(++_0x1c05fd);}(_0x0c95,0x1da));var _0x50c9=function(_0x1ae975,_0x70b40e){_0x1ae975=_0x1ae975-0x0;var _0x2576ca=_0x0c95[_0x1ae975];return _0x2576ca;};'use strict';var _=require(_0x50c9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x50c9('0x1'));var rs=require(_0x50c9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x50c9('0x3'));var logger=require('../../config/logger')(_0x50c9('0x4'));var config=require('../../config/environment');var jayson=require(_0x50c9('0x5'));var client=jayson['client'][_0x50c9('0x6')]({'port':0x232a});config['redis']=_[_0x50c9('0x7')](config[_0x50c9('0x8')],{'host':_0x50c9('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x50c9('0xa'))['register'](socket);function respondWithRpcPromise(_0xd3e9b6,_0x442e4c,_0x2c7ae2){return new BPromise(function(_0x3c664a,_0x292a03){return client[_0x50c9('0xb')](_0xd3e9b6,_0x2c7ae2)[_0x50c9('0xc')](function(_0x5d2613){logger[_0x50c9('0xd')]('WhatsappMessage,\x20%s,\x20%s',_0x442e4c,_0x50c9('0xe'));logger[_0x50c9('0xf')](_0x50c9('0x10'),_0x442e4c,_0x50c9('0xe'),JSON[_0x50c9('0x11')](_0x5d2613));if(_0x5d2613['error']){if(_0x5d2613[_0x50c9('0x12')][_0x50c9('0x13')]===0x1f4){logger['error'](_0x50c9('0x14'),_0x442e4c,_0x5d2613[_0x50c9('0x12')][_0x50c9('0x15')]);return _0x292a03(_0x5d2613[_0x50c9('0x12')]['message']);}logger[_0x50c9('0x12')](_0x50c9('0x14'),_0x442e4c,_0x5d2613['error'][_0x50c9('0x15')]);return _0x3c664a(_0x5d2613[_0x50c9('0x12')][_0x50c9('0x15')]);}else{logger['info']('WhatsappMessage,\x20%s,\x20%s',_0x442e4c,_0x50c9('0xe'));_0x3c664a(_0x5d2613[_0x50c9('0x16')]['message']);}})[_0x50c9('0x17')](function(_0x1f4d9b){logger[_0x50c9('0x12')](_0x50c9('0x14'),_0x442e4c,_0x1f4d9b);_0x292a03(_0x1f4d9b);});});}exports[_0x50c9('0x18')]=function(_0x3af853){var _0x1824af=this;return new Promise(function(_0x2e332a,_0x5a671d){return db[_0x50c9('0x19')][_0x50c9('0x1a')](_0x3af853[_0x50c9('0x1b')],{'raw':_0x3af853[_0x50c9('0x1c')]?_0x3af853[_0x50c9('0x1c')][_0x50c9('0x1d')]===undefined?!![]:![]:!![]})[_0x50c9('0xc')](function(_0x492c9b){logger[_0x50c9('0xd')](_0x50c9('0x18'),_0x3af853);logger[_0x50c9('0xf')](_0x50c9('0x18'),_0x3af853,JSON['stringify'](_0x492c9b));_0x2e332a(_0x492c9b);})['catch'](function(_0x2ed31b){logger['error'](_0x50c9('0x18'),_0x2ed31b['message'],_0x3af853);_0x5a671d(_0x1824af[_0x50c9('0x12')](0x1f4,_0x2ed31b[_0x50c9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 6bd0d1d..b5ccd46 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 _0x58af=['register','length','./whatsappMessage.events','save','remove','emit'];(function(_0x531390,_0x27b40e){var _0x31f045=function(_0x1f8624){while(--_0x1f8624){_0x531390['push'](_0x531390['shift']());}};_0x31f045(++_0x27b40e);}(_0x58af,0x122));var _0xf58a=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x58af[_0x397e5f];return _0x5302b8;};'use strict';var WhatsappMessageEvents=require(_0xf58a('0x0'));var events=[_0xf58a('0x1'),_0xf58a('0x2'),'update'];function createListener(_0x31b86a,_0x28e8d6){return function(_0x58f6cd){_0x28e8d6[_0xf58a('0x3')](_0x31b86a,_0x58f6cd);};}function removeListener(_0x4e0565,_0x5a1c81){return function(){WhatsappMessageEvents['removeListener'](_0x4e0565,_0x5a1c81);};}exports[_0xf58a('0x4')]=function(_0x5ee300){for(var _0x32b492=0x0,_0x30746b=events[_0xf58a('0x5')];_0x32b492<_0x30746b;_0x32b492++){var _0x3f1213=events[_0x32b492];var _0x6c3687=createListener('whatsappMessage:'+_0x3f1213,_0x5ee300);WhatsappMessageEvents['on'](_0x3f1213,_0x6c3687);}}; \ No newline at end of file +var _0x73bc=['register','whatsappMessage:','save','remove','emit','removeListener'];(function(_0x5e9f06,_0x3dd75c){var _0x4c9dd5=function(_0x5dc2e1){while(--_0x5dc2e1){_0x5e9f06['push'](_0x5e9f06['shift']());}};_0x4c9dd5(++_0x3dd75c);}(_0x73bc,0xb0));var _0xc73b=function(_0xec11e3,_0x56b091){_0xec11e3=_0xec11e3-0x0;var _0x42e7d5=_0x73bc[_0xec11e3];return _0x42e7d5;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xc73b('0x0'),_0xc73b('0x1'),'update'];function createListener(_0x43b3f1,_0x3c4db8){return function(_0x4c840d){_0x3c4db8[_0xc73b('0x2')](_0x43b3f1,_0x4c840d);};}function removeListener(_0x163f98,_0x1fb62e){return function(){WhatsappMessageEvents[_0xc73b('0x3')](_0x163f98,_0x1fb62e);};}exports[_0xc73b('0x4')]=function(_0x1de9d8){for(var _0x4f18c7=0x0,_0x156691=events['length'];_0x4f18c7<_0x156691;_0x4f18c7++){var _0x16661f=events[_0x4f18c7];var _0x2b0fe6=createListener(_0xc73b('0x5')+_0x16661f,_0x1de9d8);WhatsappMessageEvents['on'](_0x16661f,_0x2b0fe6);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 63b1b85..6a3414e 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 _0xdba0=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','get','/describe','describe','/:id','isAuthenticated','show','/:id/members','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','removeAgents','multer'];(function(_0x597207,_0x91374){var _0x3bdac4=function(_0x49f027){while(--_0x49f027){_0x597207['push'](_0x597207['shift']());}};_0x3bdac4(++_0x91374);}(_0xdba0,0x128));var _0x0dba=function(_0x35181c,_0x82694a){_0x35181c=_0x35181c-0x0;var _0xe14bf9=_0xdba0[_0x35181c];return _0xe14bf9;};'use strict';var multer=require(_0x0dba('0x0'));var util=require(_0x0dba('0x1'));var path=require(_0x0dba('0x2'));var timeout=require('connect-timeout');var express=require(_0x0dba('0x3'));var router=express[_0x0dba('0x4')]();var fs_extra=require(_0x0dba('0x5'));var auth=require(_0x0dba('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0dba('0x7'));var controller=require(_0x0dba('0x8'));router[_0x0dba('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0dba('0xa'),auth['isAuthenticated'](),controller[_0x0dba('0xb')]);router[_0x0dba('0x9')](_0x0dba('0xc'),auth[_0x0dba('0xd')](),controller[_0x0dba('0xe')]);router[_0x0dba('0x9')](_0x0dba('0xf'),auth['isAuthenticated'](),controller['getMembers']);router[_0x0dba('0x9')](_0x0dba('0x10'),auth[_0x0dba('0xd')](),controller['getTeams']);router['get'](_0x0dba('0x11'),auth[_0x0dba('0xd')](),controller[_0x0dba('0x12')]);router['post']('/',auth[_0x0dba('0xd')](),controller[_0x0dba('0x13')]);router[_0x0dba('0x14')](_0x0dba('0x10'),auth[_0x0dba('0xd')](),controller[_0x0dba('0x15')]);router['post']('/:id/users',auth[_0x0dba('0xd')](),controller[_0x0dba('0x16')]);router[_0x0dba('0x17')]('/:id',auth[_0x0dba('0xd')](),controller[_0x0dba('0x18')]);router[_0x0dba('0x19')](_0x0dba('0xc'),auth[_0x0dba('0xd')](),controller['destroy']);router[_0x0dba('0x19')]('/:id/teams',auth[_0x0dba('0xd')](),controller['removeTeams']);router[_0x0dba('0x19')](_0x0dba('0x11'),auth['isAuthenticated'](),controller[_0x0dba('0x1a')]);module['exports']=router; \ No newline at end of file +var _0xd829=['getAgents','post','create','put','update','destroy','removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueue.controller','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users'];(function(_0x4c41f6,_0x127768){var _0xe8c09f=function(_0x3701fc){while(--_0x3701fc){_0x4c41f6['push'](_0x4c41f6['shift']());}};_0xe8c09f(++_0x127768);}(_0xd829,0x167));var _0x9d82=function(_0x3c5325,_0x3f4553){_0x3c5325=_0x3c5325-0x0;var _0x5391cd=_0xd829[_0x3c5325];return _0x5391cd;};'use strict';var multer=require(_0x9d82('0x0'));var util=require(_0x9d82('0x1'));var path=require(_0x9d82('0x2'));var timeout=require('connect-timeout');var express=require(_0x9d82('0x3'));var router=express[_0x9d82('0x4')]();var fs_extra=require(_0x9d82('0x5'));var auth=require(_0x9d82('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9d82('0x7'));var controller=require(_0x9d82('0x8'));router['get']('/',auth[_0x9d82('0x9')](),controller['index']);router['get']('/describe',auth[_0x9d82('0x9')](),controller[_0x9d82('0xa')]);router[_0x9d82('0xb')](_0x9d82('0xc'),auth['isAuthenticated'](),controller[_0x9d82('0xd')]);router[_0x9d82('0xb')](_0x9d82('0xe'),auth[_0x9d82('0x9')](),controller[_0x9d82('0xf')]);router[_0x9d82('0xb')](_0x9d82('0x10'),auth[_0x9d82('0x9')](),controller[_0x9d82('0x11')]);router['get'](_0x9d82('0x12'),auth[_0x9d82('0x9')](),controller[_0x9d82('0x13')]);router[_0x9d82('0x14')]('/',auth[_0x9d82('0x9')](),controller[_0x9d82('0x15')]);router[_0x9d82('0x14')](_0x9d82('0x10'),auth['isAuthenticated'](),controller['addTeams']);router[_0x9d82('0x14')](_0x9d82('0x12'),auth[_0x9d82('0x9')](),controller['addAgents']);router[_0x9d82('0x16')](_0x9d82('0xc'),auth['isAuthenticated'](),controller[_0x9d82('0x17')]);router['delete'](_0x9d82('0xc'),auth[_0x9d82('0x9')](),controller[_0x9d82('0x18')]);router['delete'](_0x9d82('0x10'),auth[_0x9d82('0x9')](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x9d82('0x9')](),controller[_0x9d82('0x19')]);module[_0x9d82('0x1a')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index dda683e..372ef1e 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 _0x422f=['exports','name','INTEGER','rrmemory','beepall','roundrobin','STRING'];(function(_0x51fde3,_0x12a089){var _0x23364e=function(_0x120492){while(--_0x120492){_0x51fde3['push'](_0x51fde3['shift']());}};_0x23364e(++_0x12a089);}(_0x422f,0x1c7));var _0xf422=function(_0x5e1f5b,_0x192f4c){_0x5e1f5b=_0x5e1f5b-0x0;var _0xba7575=_0x422f[_0x5e1f5b];return _0xba7575;};'use strict';var Sequelize=require('sequelize');module[_0xf422('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xf422('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xf422('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf422('0x3'),_0xf422('0x4'),_0xf422('0x5'))},'description':{'type':Sequelize[_0xf422('0x6')]}}; \ No newline at end of file +var _0x50c1=['ENUM','rrmemory','beepall','roundrobin','STRING','sequelize','name','INTEGER'];(function(_0x171b8e,_0x119493){var _0x46447f=function(_0x512b79){while(--_0x512b79){_0x171b8e['push'](_0x171b8e['shift']());}};_0x46447f(++_0x119493);}(_0x50c1,0x1a5));var _0x150c=function(_0x9c90d,_0x3da89e){_0x9c90d=_0x9c90d-0x0;var _0x259eb6=_0x50c1[_0x9c90d];return _0x259eb6;};'use strict';var Sequelize=require(_0x150c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x150c('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x150c('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x150c('0x3')](_0x150c('0x4'),_0x150c('0x5'),_0x150c('0x6'))},'description':{'type':Sequelize[_0x150c('0x7')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index fc03c50..6099297 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 _0xbbe7=['removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','util','lodash','squel','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','end','offset','undefined','limit','count','Content-Range','json','update','then','destroy','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','WhatsappQueue','include','query','findAll','rows','params','model','keys','filters','intersection','fields','attributes','length','merge','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','hasOwnProperty','order','sort','where','pick','filter','User','findAndCountAll','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','nolimit','addTeams','Agents','online','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','ids','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty'];(function(_0xbce261,_0x5bf87e){var _0x23848f=function(_0x582169){while(--_0x582169){_0xbce261['push'](_0xbce261['shift']());}};_0x23848f(++_0x5bf87e);}(_0xbbe7,0x181));var _0x7bbe=function(_0x28fde6,_0x3abadb){_0x28fde6=_0x28fde6-0x0;var _0x253385=_0xbbe7[_0x28fde6];return _0x253385;};'use strict';var BPromise=require('bluebird');var util=require(_0x7bbe('0x0'));var _=require(_0x7bbe('0x1'));var squel=require(_0x7bbe('0x2'));var Redis=require(_0x7bbe('0x3'));var qs=require(_0x7bbe('0x4'));var logger=require('../../config/logger')(_0x7bbe('0x5'));var config=require(_0x7bbe('0x6'));var db=require(_0x7bbe('0x7'))['db'];config['redis']=_['defaults'](config[_0x7bbe('0x8')],{'host':_0x7bbe('0x9'),'port':0x18eb});var socket=require(_0x7bbe('0xa'))(new Redis(config[_0x7bbe('0x8')]));require(_0x7bbe('0xb'))[_0x7bbe('0xc')](socket);function respondWithStatusCode(_0x49484e,_0x49fa9f){_0x49fa9f=_0x49fa9f||0xcc;return function(_0x377ec8){if(_0x377ec8){return _0x49484e['sendStatus'](_0x49fa9f);}return _0x49484e[_0x7bbe('0xd')](_0x49fa9f)[_0x7bbe('0xe')]();};}function respondWithResult(_0x551c6a,_0x59f689){_0x59f689=_0x59f689||0xc8;return function(_0x5a7643){if(_0x5a7643){return _0x551c6a[_0x7bbe('0xd')](_0x59f689)['json'](_0x5a7643);}};}function respondWithFilteredResult(_0x7f9d5d,_0x2f29e7){return function(_0x5d86a0){if(_0x5d86a0){var _0x4fbc2f=typeof _0x2f29e7[_0x7bbe('0xf')]===_0x7bbe('0x10')&&typeof _0x2f29e7[_0x7bbe('0x11')]==='undefined';var _0x40f46f=_0x5d86a0[_0x7bbe('0x12')];var _0x121627=_0x4fbc2f?0x0:_0x2f29e7['offset'];var _0xff46=_0x4fbc2f?_0x5d86a0[_0x7bbe('0x12')]:_0x2f29e7[_0x7bbe('0xf')]+_0x2f29e7['limit'];var _0x3ffd8a;if(_0xff46>=_0x40f46f){_0xff46=_0x40f46f;_0x3ffd8a=0xc8;}else{_0x3ffd8a=0xce;}_0x7f9d5d[_0x7bbe('0xd')](_0x3ffd8a);return _0x7f9d5d['set'](_0x7bbe('0x13'),_0x121627+'-'+_0xff46+'/'+_0x40f46f)[_0x7bbe('0x14')](_0x5d86a0);}return null;};}function saveUpdates(_0x38f116){return function(_0x1d04f2){if(_0x1d04f2){return _0x1d04f2[_0x7bbe('0x15')](_0x38f116)[_0x7bbe('0x16')](function(_0x296be2){return _0x296be2;});}return null;};}function removeEntity(_0xdd88fb){return function(_0x5e4b33){if(_0x5e4b33){return _0x5e4b33[_0x7bbe('0x17')]()[_0x7bbe('0x16')](function(){var _0x121563=_0x5e4b33['get']({'plain':!![]});var _0x1b66eb=_0x7bbe('0x18');return db[_0x7bbe('0x19')][_0x7bbe('0x17')]({'where':{'type':_0x1b66eb,'resourceId':_0x121563['id']}})[_0x7bbe('0x16')](function(){return _0x5e4b33;});})[_0x7bbe('0x16')](function(){_0xdd88fb[_0x7bbe('0xd')](0xcc)[_0x7bbe('0xe')]();});}};}function handleEntityNotFound(_0xfb1d93){return function(_0x5a1b42){if(!_0x5a1b42){_0xfb1d93[_0x7bbe('0x1a')](0x194);}return _0x5a1b42;};}function handleError(_0x287b64,_0x3a366c){_0x3a366c=_0x3a366c||0x1f4;return function(_0x3df541){logger[_0x7bbe('0x1b')](_0x3df541[_0x7bbe('0x1c')]);if(_0x3df541[_0x7bbe('0x1d')]){delete _0x3df541['name'];}_0x287b64[_0x7bbe('0xd')](_0x3a366c)[_0x7bbe('0x1e')](_0x3df541);};}exports[_0x7bbe('0x1f')]=function(_0x13d31e,_0x51e075){var _0x494062={};var _0x10cf56={'count':0x0,'rows':[]};var _0x177736=_[_0x7bbe('0x20')](db['WhatsappQueue'][_0x7bbe('0x21')],function(_0x1dd730){return{'name':_0x1dd730[_0x7bbe('0x22')],'type':_0x1dd730[_0x7bbe('0x23')][_0x7bbe('0x24')]};});_0x494062=qs[_0x7bbe('0x25')](_0x177736,_0x13d31e);var _0x251455={'where':_0x494062['where']};return db[_0x7bbe('0x26')][_0x7bbe('0x12')](_0x251455)[_0x7bbe('0x16')](function(_0x4f871c){_0x10cf56[_0x7bbe('0x12')]=_0x4f871c;_0x494062[_0x7bbe('0x27')]=qs['include'](_0x13d31e[_0x7bbe('0x28')]);return db[_0x7bbe('0x26')][_0x7bbe('0x29')](_0x494062);})[_0x7bbe('0x16')](function(_0x1659c9){_0x10cf56[_0x7bbe('0x2a')]=_0x1659c9;return _0x10cf56;})[_0x7bbe('0x16')](respondWithFilteredResult(_0x51e075,_0x494062))['catch'](handleError(_0x51e075,null));};exports['show']=function(_0x2b3b05,_0x577e43){var _0x4e8a4f={'raw':!![],'where':{'id':_0x2b3b05[_0x7bbe('0x2b')]['id']}},_0xd51e92={};_0xd51e92[_0x7bbe('0x2c')]=_['keys'](db[_0x7bbe('0x26')][_0x7bbe('0x21')]);_0xd51e92[_0x7bbe('0x28')]=_[_0x7bbe('0x2d')](_0x2b3b05['query']);_0xd51e92[_0x7bbe('0x2e')]=_['intersection'](_0xd51e92['model'],_0xd51e92[_0x7bbe('0x28')]);_0x4e8a4f['attributes']=_[_0x7bbe('0x2f')](_0xd51e92[_0x7bbe('0x2c')],qs[_0x7bbe('0x30')](_0x2b3b05[_0x7bbe('0x28')][_0x7bbe('0x30')]));_0x4e8a4f['attributes']=_0x4e8a4f[_0x7bbe('0x31')][_0x7bbe('0x32')]?_0x4e8a4f[_0x7bbe('0x31')]:_0xd51e92['model'];if(_0x2b3b05[_0x7bbe('0x28')]['includeAll']){_0x4e8a4f['include']=[{'all':!![]}];}_0x4e8a4f=_[_0x7bbe('0x33')]({},_0x4e8a4f,_0x2b3b05[_0x7bbe('0x34')]);return db[_0x7bbe('0x26')][_0x7bbe('0x35')](_0x4e8a4f)[_0x7bbe('0x16')](handleEntityNotFound(_0x577e43,null))['then'](respondWithResult(_0x577e43,null))['catch'](handleError(_0x577e43,null));};exports[_0x7bbe('0x36')]=function(_0x2f76dc,_0x3ee3d7){return db['WhatsappQueue'][_0x7bbe('0x36')](_0x2f76dc['body'],{})[_0x7bbe('0x16')](function(_0x1b66c0){var _0x12d16b=_0x2f76dc[_0x7bbe('0x37')][_0x7bbe('0x38')]({'plain':!![]});if(!_0x12d16b)throw new Error(_0x7bbe('0x39'));if(_0x12d16b[_0x7bbe('0x3a')]===_0x7bbe('0x37')){var _0x3a99c7=_0x1b66c0['get']({'plain':!![]});var _0x52a8e8=_0x7bbe('0x18');return db[_0x7bbe('0x3b')]['find']({'where':{'name':_0x52a8e8,'userProfileId':_0x12d16b['userProfileId']},'raw':!![]})[_0x7bbe('0x16')](function(_0xe80d25){if(_0xe80d25&&_0xe80d25[_0x7bbe('0x3c')]===0x0){return db[_0x7bbe('0x19')]['create']({'name':_0x3a99c7[_0x7bbe('0x1d')],'resourceId':_0x3a99c7['id'],'type':_0xe80d25[_0x7bbe('0x1d')],'sectionId':_0xe80d25['id']},{})[_0x7bbe('0x16')](function(){return _0x1b66c0;});}else{return _0x1b66c0;}})[_0x7bbe('0x3d')](function(_0x284a46){logger['error'](_0x7bbe('0x3e'),_0x284a46);throw _0x284a46;});}return _0x1b66c0;})[_0x7bbe('0x16')](respondWithResult(_0x3ee3d7,0xc9))[_0x7bbe('0x3d')](handleError(_0x3ee3d7,null));};exports['update']=function(_0x2f758d,_0xfa05f0){if(_0x2f758d[_0x7bbe('0x3f')]['id']){delete _0x2f758d['body']['id'];}return db['WhatsappQueue']['find']({'where':{'id':_0x2f758d[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](handleEntityNotFound(_0xfa05f0,null))[_0x7bbe('0x16')](saveUpdates(_0x2f758d['body'],null))[_0x7bbe('0x16')](respondWithResult(_0xfa05f0,null))[_0x7bbe('0x3d')](handleError(_0xfa05f0,null));};exports[_0x7bbe('0x17')]=function(_0x4ca6cb,_0x192b80){return db[_0x7bbe('0x26')][_0x7bbe('0x35')]({'where':{'id':_0x4ca6cb[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](handleEntityNotFound(_0x192b80,null))['then'](removeEntity(_0x192b80,null))[_0x7bbe('0x3d')](handleError(_0x192b80,null));};exports[_0x7bbe('0x40')]=function(_0x450e83,_0x1639b8){return db[_0x7bbe('0x26')][_0x7bbe('0x40')]()[_0x7bbe('0x16')](respondWithResult(_0x1639b8,null))['catch'](handleError(_0x1639b8,null));};exports[_0x7bbe('0x41')]=function(_0x2aa95a,_0x33267f){var _0x2e43af={'raw':!![],'where':{}},_0x25d331={},_0x3d0082;return db[_0x7bbe('0x26')][_0x7bbe('0x42')]({'where':{'id':_0x2aa95a[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](handleEntityNotFound(_0x33267f,null))[_0x7bbe('0x16')](function(_0x2c0a6f){if(_0x2c0a6f){_0x3d0082=_0x2c0a6f[_0x7bbe('0x38')]({'plain':!![]});_0x25d331[_0x7bbe('0x2c')]=_['keys'](db[_0x7bbe('0x43')]['rawAttributes']);_0x25d331[_0x7bbe('0x28')]=_['keys'](_0x2aa95a[_0x7bbe('0x28')]);_0x25d331['filters']=_[_0x7bbe('0x2f')](_0x25d331[_0x7bbe('0x2c')],_0x25d331['query']);_0x2e43af[_0x7bbe('0x31')]=_[_0x7bbe('0x2f')](_0x25d331[_0x7bbe('0x2c')],qs[_0x7bbe('0x30')](_0x2aa95a[_0x7bbe('0x28')]['fields']));_0x2e43af[_0x7bbe('0x31')]=_0x2e43af[_0x7bbe('0x31')][_0x7bbe('0x32')]?_0x2e43af['attributes']:_0x25d331['model'];if(!_0x2aa95a['query'][_0x7bbe('0x44')]('nolimit')){_0x2e43af[_0x7bbe('0x11')]=qs[_0x7bbe('0x11')](_0x2aa95a['query'][_0x7bbe('0x11')]);_0x2e43af['offset']=qs['offset'](_0x2aa95a[_0x7bbe('0x28')][_0x7bbe('0xf')]);}_0x2e43af[_0x7bbe('0x45')]=qs[_0x7bbe('0x46')](_0x2aa95a[_0x7bbe('0x28')][_0x7bbe('0x46')]);_0x2e43af[_0x7bbe('0x47')]=qs[_0x7bbe('0x2e')](_[_0x7bbe('0x48')](_0x2aa95a[_0x7bbe('0x28')],_0x25d331['filters']));_0x2e43af[_0x7bbe('0x47')]['WhatsappQueueId']=_0x2c0a6f['id'];if(_0x2aa95a[_0x7bbe('0x28')][_0x7bbe('0x49')]){_0x2e43af[_0x7bbe('0x47')]=_[_0x7bbe('0x33')](_0x2e43af[_0x7bbe('0x47')],{'$or':_[_0x7bbe('0x20')](_0x2e43af[_0x7bbe('0x31')],function(_0x26cb70){var _0x16e8d5={};_0x16e8d5[_0x26cb70]={'$like':'%'+_0x2aa95a[_0x7bbe('0x28')][_0x7bbe('0x49')]+'%'};return _0x16e8d5;})});}_0x2e43af=_[_0x7bbe('0x33')]({},_0x2e43af,_0x2aa95a[_0x7bbe('0x34')]);return db[_0x7bbe('0x43')][_0x7bbe('0x29')](_0x2e43af);}})[_0x7bbe('0x16')](function(_0x575434){if(_0x575434){return db[_0x7bbe('0x4a')][_0x7bbe('0x4b')]({'where':{'id':_[_0x7bbe('0x20')](_0x575434,'UserId'),'role':_0x7bbe('0x4c')},'attributes':['id',_0x7bbe('0x1d'),_0x7bbe('0x4d'),_0x7bbe('0x4e'),_0x7bbe('0x4f')]});}})[_0x7bbe('0x16')](function(_0x1ab725){if(_0x1ab725){return{'count':_0x1ab725[_0x7bbe('0x12')],'rows':_[_0x7bbe('0x20')](_0x1ab725[_0x7bbe('0x2a')],function(_0xd4db68){return{'membername':_0xd4db68[_0x7bbe('0x1d')],'UserId':_0xd4db68['id'],'queue_name':_0x3d0082[_0x7bbe('0x1d')],'WhatsappQueueId':_0x3d0082['id'],'interface':util[_0x7bbe('0x50')](_0x7bbe('0x51'),_0x7bbe('0x52'),_0xd4db68['name']),'penalty':0x0,'paused':_0xd4db68['whatsappPause'],'createdAt':_0xd4db68[_0x7bbe('0x4f')],'updatedAt':_0xd4db68['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x7bbe('0x16')](respondWithFilteredResult(_0x33267f,_0x2e43af))['catch'](handleError(_0x33267f,null));};exports[_0x7bbe('0x53')]=function(_0x30f665,_0x59d1a0){var _0x435510={};var _0x3151d7={};var _0x333e62;var _0x3dc7a3;return db[_0x7bbe('0x26')][_0x7bbe('0x42')]({'where':{'id':_0x30f665[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](handleEntityNotFound(_0x59d1a0,null))[_0x7bbe('0x16')](function(_0x359073){if(_0x359073){_0x333e62=_0x359073;_0x3151d7['model']=_['keys'](db[_0x7bbe('0x54')][_0x7bbe('0x21')]);_0x3151d7['query']=_[_0x7bbe('0x2d')](_0x30f665[_0x7bbe('0x28')]);_0x3151d7[_0x7bbe('0x2e')]=_['intersection'](_0x3151d7['model'],_0x3151d7[_0x7bbe('0x28')]);_0x435510['attributes']=_[_0x7bbe('0x2f')](_0x3151d7[_0x7bbe('0x2c')],qs['fields'](_0x30f665[_0x7bbe('0x28')][_0x7bbe('0x30')]));_0x435510[_0x7bbe('0x31')]=_0x435510[_0x7bbe('0x31')]['length']?_0x435510[_0x7bbe('0x31')]:_0x3151d7[_0x7bbe('0x2c')];_0x435510[_0x7bbe('0x45')]=qs[_0x7bbe('0x46')](_0x30f665[_0x7bbe('0x28')][_0x7bbe('0x46')]);_0x435510[_0x7bbe('0x47')]=qs['filters'](_[_0x7bbe('0x48')](_0x30f665[_0x7bbe('0x28')],_0x3151d7[_0x7bbe('0x2e')]));if(_0x30f665[_0x7bbe('0x28')][_0x7bbe('0x49')]){_0x435510['where']=_['merge'](_0x435510[_0x7bbe('0x47')],{'$or':_['map'](_0x435510[_0x7bbe('0x31')],function(_0x2a986d){var _0x466b04={};_0x466b04[_0x2a986d]={'$like':'%'+_0x30f665['query']['filter']+'%'};return _0x466b04;})});}_0x435510=_[_0x7bbe('0x33')]({},_0x435510,_0x30f665['options']);return _0x333e62[_0x7bbe('0x53')](_0x435510);}})[_0x7bbe('0x16')](function(_0xdb5707){if(_0xdb5707){_0x3dc7a3=_0xdb5707[_0x7bbe('0x32')];if(!_0x30f665[_0x7bbe('0x28')][_0x7bbe('0x44')](_0x7bbe('0x55'))){_0x435510[_0x7bbe('0x11')]=qs[_0x7bbe('0x11')](_0x30f665[_0x7bbe('0x28')][_0x7bbe('0x11')]);_0x435510[_0x7bbe('0xf')]=qs[_0x7bbe('0xf')](_0x30f665[_0x7bbe('0x28')][_0x7bbe('0xf')]);}return _0x333e62[_0x7bbe('0x53')](_0x435510);}})[_0x7bbe('0x16')](function(_0x2634f7){if(_0x2634f7){return _0x2634f7?{'count':_0x3dc7a3,'rows':_0x2634f7}:null;}})[_0x7bbe('0x16')](respondWithResult(_0x59d1a0,null))[_0x7bbe('0x3d')](handleError(_0x59d1a0,null));};exports[_0x7bbe('0x56')]=function(_0x1b5bd8,_0x58b053){var _0x36fc97=_0x1b5bd8[_0x7bbe('0x3f')]['ids'];return db['Team'][_0x7bbe('0x29')]({'where':{'id':_0x36fc97},'attributes':['id'],'include':[{'model':db[_0x7bbe('0x4a')],'as':_0x7bbe('0x57'),'attributes':['id',_0x7bbe('0x1d'),_0x7bbe('0x58'),'voicePause',_0x7bbe('0x59')],'raw':!![]}]})['then'](function(_0x51b1cd){if(_0x51b1cd){var _0x46a2b3=_[_0x7bbe('0x5a')](_0x51b1cd,function(_0x4a76d2){var _0x106df4=_0x4a76d2[_0x7bbe('0x38')]({'plain':!![]});return _0x106df4[_0x7bbe('0x57')];});return db['WhatsappQueue'][_0x7bbe('0x35')]({'where':{'id':_0x1b5bd8[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](function(_0x522511){return db[_0x7bbe('0x5b')][_0x7bbe('0x5c')](function(_0x493cf9){return _0x522511[_0x7bbe('0x56')](_0x36fc97,{'transaction':_0x493cf9})[_0x7bbe('0x16')](function(){return BPromise[_0x7bbe('0x5d')](_0x46a2b3,function(_0x409768){return db['UserWhatsappQueue'][_0x7bbe('0x5e')]({'where':{'UserId':_0x409768['id'],'WhatsappQueueId':_0x1b5bd8['params']['id']},'transaction':_0x493cf9});});})[_0x7bbe('0x16')](function(){_0x46a2b3[_0x7bbe('0x5f')](function(_0x43f558){socket[_0x7bbe('0x60')](_0x7bbe('0x61'),{'UserId':_0x43f558['id'],'WhatsappQueueId':_0x522511['id']});});});});});}})['then'](respondWithStatusCode(_0x58b053,null))[_0x7bbe('0x3d')](handleError(_0x58b053,null));};exports[_0x7bbe('0x62')]=function(_0xe77da,_0x5d86ae){return db[_0x7bbe('0x54')][_0x7bbe('0x29')]({'where':{'id':_0xe77da[_0x7bbe('0x28')][_0x7bbe('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x7bbe('0x16')](handleEntityNotFound(_0x5d86ae,null))[_0x7bbe('0x16')](function(_0x3171eb){var _0x10590b=_['map'](_0x3171eb,'id');var _0x10c213=[];var _0x39857f=[];var _0x374b6e=squel[_0x7bbe('0x64')]();_0x374b6e[_0x7bbe('0x65')]('tq.TeamId')['from'](_0x7bbe('0x66'),'tq')[_0x7bbe('0x67')](_0x7bbe('0x68'),'ut',_0x7bbe('0x69'))[_0x7bbe('0x47')](_0x7bbe('0x6a'),_0xe77da[_0x7bbe('0x2b')]['id']);for(var _0x12b48c=0x0;_0x12b48c<_0x3171eb['length'];_0x12b48c+=0x1){let _0x4b08e1=_0x3171eb[_0x12b48c];for(var _0x243ef7=0x0;_0x243ef7<_0x4b08e1[_0x7bbe('0x57')]['length'];_0x243ef7+=0x1){let _0x56bdc6=_0x4b08e1[_0x7bbe('0x57')][_0x243ef7];var _0x1274fa=_0x374b6e['clone']();_0x1274fa[_0x7bbe('0x47')](_0x7bbe('0x6b'),_0x56bdc6['id']);_0x39857f['push'](db[_0x7bbe('0x5b')][_0x7bbe('0x28')](_0x1274fa[_0x7bbe('0x6c')](),{'type':db[_0x7bbe('0x5b')][_0x7bbe('0x6d')][_0x7bbe('0x6e')]})['then'](function(_0x5e9282){if(_0x5e9282[_0x7bbe('0x32')]===0x1){return _0x56bdc6['id'];}else{var _0x1ed3c8=_[_0x7bbe('0x6f')](_[_0x7bbe('0x20')](_0x5e9282,_0x7bbe('0x70')),function(_0x259eac){return _[_0x7bbe('0x71')](_0x10590b,_0x259eac);});if(_0x1ed3c8){return _0x56bdc6['id'];}}}));}}return BPromise[_0x7bbe('0x72')](_0x39857f)['then'](function(_0x588b4e){_0x10c213=_(_0x10c213)[_0x7bbe('0x73')](_0x588b4e)[_0x7bbe('0x74')]()[_0x7bbe('0x75')]();return db['WhatsappQueue'][_0x7bbe('0x35')]({'where':{'id':_0xe77da[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](function(_0x33e1b7){return db[_0x7bbe('0x5b')][_0x7bbe('0x5c')](function(_0x144d6a){return _0x33e1b7[_0x7bbe('0x62')](_0xe77da['query'][_0x7bbe('0x63')],{'transaction':_0x144d6a})[_0x7bbe('0x16')](function(){if(!_[_0x7bbe('0x76')](_0x10c213)){return _0x33e1b7[_0x7bbe('0x77')](_0x10c213,{'transaction':_0x144d6a});}})[_0x7bbe('0x16')](function(){_0x10c213[_0x7bbe('0x5f')](function(_0x250764){socket[_0x7bbe('0x60')]('userWhatsappQueue:remove',{'UserId':_0x250764,'WhatsappQueueId':_0x33e1b7['id']});});});});});});})[_0x7bbe('0x16')](respondWithStatusCode(_0x5d86ae,null))['catch'](handleError(_0x5d86ae,null));};exports[_0x7bbe('0x78')]=function(_0x3ea4c9,_0x242156){return db[_0x7bbe('0x26')][_0x7bbe('0x35')]({'where':{'id':_0x3ea4c9[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](handleEntityNotFound(_0x242156,null))[_0x7bbe('0x16')](function(_0x3b0aef){if(_0x3b0aef){return _0x3b0aef[_0x7bbe('0x78')](_0x3ea4c9[_0x7bbe('0x3f')][_0x7bbe('0x63')],_[_0x7bbe('0x79')](_0x3ea4c9['body'],['ids','id'])||{})[_0x7bbe('0x7a')](function(_0x448fcb){for(var _0x53f60a=0x0;_0x53f60a<_0x3ea4c9[_0x7bbe('0x3f')][_0x7bbe('0x63')]['length'];_0x53f60a+=0x1){socket[_0x7bbe('0x60')](_0x7bbe('0x61'),{'UserId':Number(_0x3ea4c9[_0x7bbe('0x3f')][_0x7bbe('0x63')][_0x53f60a]),'WhatsappQueueId':Number(_0x3ea4c9[_0x7bbe('0x2b')]['id'])});}return _0x448fcb;});}})[_0x7bbe('0x16')](respondWithResult(_0x242156,null))[_0x7bbe('0x3d')](handleError(_0x242156,null));};exports[_0x7bbe('0x77')]=function(_0x58e4fa,_0x11559e){return db[_0x7bbe('0x26')][_0x7bbe('0x35')]({'where':{'id':_0x58e4fa[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](handleEntityNotFound(_0x11559e,null))[_0x7bbe('0x16')](function(_0x3967aa){if(_0x3967aa){return _0x3967aa['removeAgents'](_0x58e4fa[_0x7bbe('0x28')][_0x7bbe('0x63')])['then'](function(){if(_[_0x7bbe('0x7b')](_0x58e4fa[_0x7bbe('0x28')]['ids'])){for(var _0x5719fe=0x0;_0x5719fe<_0x58e4fa[_0x7bbe('0x28')][_0x7bbe('0x63')][_0x7bbe('0x32')];_0x5719fe+=0x1){socket['emit'](_0x7bbe('0x7c'),{'UserId':Number(_0x58e4fa['query'][_0x7bbe('0x63')][_0x5719fe]),'WhatsappQueueId':Number(_0x58e4fa[_0x7bbe('0x2b')]['id'])});}}else{socket[_0x7bbe('0x60')](_0x7bbe('0x7c'),{'UserId':Number(_0x58e4fa[_0x7bbe('0x28')][_0x7bbe('0x63')]),'WhatsappQueueId':Number(_0x58e4fa[_0x7bbe('0x2b')]['id'])});}});}})['then'](respondWithStatusCode(_0x11559e,null))['catch'](handleError(_0x11559e,null));};exports['getAgents']=function(_0x41b1e4,_0x20984f){var _0x2f0ba1={};var _0x3ba232={};var _0x1e817f;var _0x6468f7;return db[_0x7bbe('0x26')]['findOne']({'where':{'id':_0x41b1e4[_0x7bbe('0x2b')]['id']}})[_0x7bbe('0x16')](handleEntityNotFound(_0x20984f,null))['then'](function(_0x1eb68a){if(_0x1eb68a){_0x1e817f=_0x1eb68a;_0x3ba232[_0x7bbe('0x2c')]=_[_0x7bbe('0x2d')](db[_0x7bbe('0x4a')][_0x7bbe('0x21')]);_0x3ba232[_0x7bbe('0x28')]=_[_0x7bbe('0x2d')](_0x41b1e4[_0x7bbe('0x28')]);_0x3ba232[_0x7bbe('0x2e')]=_[_0x7bbe('0x2f')](_0x3ba232[_0x7bbe('0x2c')],_0x3ba232['query']);_0x2f0ba1[_0x7bbe('0x31')]=_['intersection'](_0x3ba232[_0x7bbe('0x2c')],qs[_0x7bbe('0x30')](_0x41b1e4[_0x7bbe('0x28')][_0x7bbe('0x30')]));_0x2f0ba1[_0x7bbe('0x31')]=_0x2f0ba1['attributes'][_0x7bbe('0x32')]?_0x2f0ba1['attributes']:_0x3ba232['model'];_0x2f0ba1['order']=qs[_0x7bbe('0x46')](_0x41b1e4['query']['sort']);_0x2f0ba1[_0x7bbe('0x47')]=qs[_0x7bbe('0x2e')](_[_0x7bbe('0x48')](_0x41b1e4['query'],_0x3ba232[_0x7bbe('0x2e')]));if(_0x41b1e4[_0x7bbe('0x28')][_0x7bbe('0x49')]){_0x2f0ba1[_0x7bbe('0x47')]=_[_0x7bbe('0x33')](_0x2f0ba1[_0x7bbe('0x47')],{'$or':_['map'](_0x2f0ba1[_0x7bbe('0x31')],function(_0x78c5e0){var _0x396bd9={};_0x396bd9[_0x78c5e0]={'$like':'%'+_0x41b1e4['query'][_0x7bbe('0x49')]+'%'};return _0x396bd9;})});}_0x2f0ba1=_[_0x7bbe('0x33')]({},_0x2f0ba1,_0x41b1e4['options']);return _0x1e817f[_0x7bbe('0x7d')](_0x2f0ba1);}})[_0x7bbe('0x16')](function(_0x58668e){if(_0x58668e){_0x6468f7=_0x58668e[_0x7bbe('0x32')];if(!_0x41b1e4[_0x7bbe('0x28')][_0x7bbe('0x44')](_0x7bbe('0x55'))){_0x2f0ba1[_0x7bbe('0x11')]=qs['limit'](_0x41b1e4[_0x7bbe('0x28')][_0x7bbe('0x11')]);_0x2f0ba1[_0x7bbe('0xf')]=qs['offset'](_0x41b1e4[_0x7bbe('0x28')][_0x7bbe('0xf')]);}return _0x1e817f[_0x7bbe('0x7d')](_0x2f0ba1);}})['then'](function(_0x599002){if(_0x599002){return _0x599002?{'count':_0x6468f7,'rows':_0x599002}:null;}})['then'](respondWithResult(_0x20984f,null))['catch'](handleError(_0x20984f,null));}; \ No newline at end of file +var _0x4b7c=['nolimit','order','sort','pick','WhatsappQueueId','filter','UserId','agent','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','filters','getTeams','ids','Agents','online','voicePause','sequelize','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','includes','all','union','compact','value','transaction','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','emit','isArray','User','getAgents','util','squel','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','sendStatus','end','status','offset','undefined','limit','count','set','json','UserProfileResource','destroy','then','error','stack','name','send','index','map','WhatsappQueue','fieldName','type','key','getOptions','where','include','findAll','rows','show','params','query','keys','intersection','fields','attributes','length','model','includeAll','merge','options','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','WhatsappQueues','UserProfileSection','userProfileId','autoAssociation','catch','body','describe','getMembers','UserWhatsappQueue','rawAttributes','hasOwnProperty'];(function(_0x2cbba4,_0x5e8cd2){var _0x4d26ea=function(_0x2f74e5){while(--_0x2f74e5){_0x2cbba4['push'](_0x2cbba4['shift']());}};_0x4d26ea(++_0x5e8cd2);}(_0x4b7c,0x12b));var _0xc4b7=function(_0x2a4242,_0x333864){_0x2a4242=_0x2a4242-0x0;var _0x1eba07=_0x4b7c[_0x2a4242];return _0x1eba07;};'use strict';var BPromise=require('bluebird');var util=require(_0xc4b7('0x0'));var _=require('lodash');var squel=require(_0xc4b7('0x1'));var Redis=require(_0xc4b7('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0xc4b7('0x3'))(_0xc4b7('0x4'));var config=require(_0xc4b7('0x5'));var db=require(_0xc4b7('0x6'))['db'];config[_0xc4b7('0x7')]=_[_0xc4b7('0x8')](config[_0xc4b7('0x7')],{'host':_0xc4b7('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xc4b7('0xa'))['register'](socket);function respondWithStatusCode(_0x1dea03,_0x24a82d){_0x24a82d=_0x24a82d||0xcc;return function(_0x1c257e){if(_0x1c257e){return _0x1dea03[_0xc4b7('0xb')](_0x24a82d);}return _0x1dea03['status'](_0x24a82d)[_0xc4b7('0xc')]();};}function respondWithResult(_0x4a23eb,_0x897ee6){_0x897ee6=_0x897ee6||0xc8;return function(_0x155cf7){if(_0x155cf7){return _0x4a23eb[_0xc4b7('0xd')](_0x897ee6)['json'](_0x155cf7);}};}function respondWithFilteredResult(_0x4695d2,_0x2b2f77){return function(_0x4cc42a){if(_0x4cc42a){var _0x4f477c=typeof _0x2b2f77[_0xc4b7('0xe')]===_0xc4b7('0xf')&&typeof _0x2b2f77[_0xc4b7('0x10')]===_0xc4b7('0xf');var _0x139f36=_0x4cc42a[_0xc4b7('0x11')];var _0x1a6363=_0x4f477c?0x0:_0x2b2f77[_0xc4b7('0xe')];var _0x53765c=_0x4f477c?_0x4cc42a[_0xc4b7('0x11')]:_0x2b2f77[_0xc4b7('0xe')]+_0x2b2f77[_0xc4b7('0x10')];var _0x570338;if(_0x53765c>=_0x139f36){_0x53765c=_0x139f36;_0x570338=0xc8;}else{_0x570338=0xce;}_0x4695d2['status'](_0x570338);return _0x4695d2[_0xc4b7('0x12')]('Content-Range',_0x1a6363+'-'+_0x53765c+'/'+_0x139f36)[_0xc4b7('0x13')](_0x4cc42a);}return null;};}function saveUpdates(_0x5f1db9){return function(_0x1ed7f7){if(_0x1ed7f7){return _0x1ed7f7['update'](_0x5f1db9)['then'](function(_0x16fed5){return _0x16fed5;});}return null;};}function removeEntity(_0x3448a7){return function(_0x489067){if(_0x489067){return _0x489067['destroy']()['then'](function(){var _0x5b306d=_0x489067['get']({'plain':!![]});var _0x282bbe='WhatsappQueues';return db[_0xc4b7('0x14')][_0xc4b7('0x15')]({'where':{'type':_0x282bbe,'resourceId':_0x5b306d['id']}})[_0xc4b7('0x16')](function(){return _0x489067;});})['then'](function(){_0x3448a7[_0xc4b7('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13ec12){return function(_0x24a8cc){if(!_0x24a8cc){_0x13ec12[_0xc4b7('0xb')](0x194);}return _0x24a8cc;};}function handleError(_0x3d9bac,_0x5174f6){_0x5174f6=_0x5174f6||0x1f4;return function(_0x2a4b93){logger[_0xc4b7('0x17')](_0x2a4b93[_0xc4b7('0x18')]);if(_0x2a4b93[_0xc4b7('0x19')]){delete _0x2a4b93['name'];}_0x3d9bac[_0xc4b7('0xd')](_0x5174f6)[_0xc4b7('0x1a')](_0x2a4b93);};}exports[_0xc4b7('0x1b')]=function(_0xf56e05,_0x391511){var _0x14ceb2={};var _0x52104a={'count':0x0,'rows':[]};var _0x185a33=_[_0xc4b7('0x1c')](db[_0xc4b7('0x1d')]['rawAttributes'],function(_0x52fae7){return{'name':_0x52fae7[_0xc4b7('0x1e')],'type':_0x52fae7[_0xc4b7('0x1f')][_0xc4b7('0x20')]};});_0x14ceb2=qs[_0xc4b7('0x21')](_0x185a33,_0xf56e05);var _0x15ac0d={'where':_0x14ceb2[_0xc4b7('0x22')]};return db[_0xc4b7('0x1d')][_0xc4b7('0x11')](_0x15ac0d)[_0xc4b7('0x16')](function(_0x1a26ff){_0x52104a[_0xc4b7('0x11')]=_0x1a26ff;_0x14ceb2[_0xc4b7('0x23')]=qs[_0xc4b7('0x23')](_0xf56e05['query']);return db['WhatsappQueue'][_0xc4b7('0x24')](_0x14ceb2);})['then'](function(_0x38350d){_0x52104a[_0xc4b7('0x25')]=_0x38350d;return _0x52104a;})[_0xc4b7('0x16')](respondWithFilteredResult(_0x391511,_0x14ceb2))['catch'](handleError(_0x391511,null));};exports[_0xc4b7('0x26')]=function(_0x468d2a,_0x59d816){var _0x1fa81f={'raw':!![],'where':{'id':_0x468d2a[_0xc4b7('0x27')]['id']}},_0x1aac19={};_0x1aac19['model']=_['keys'](db[_0xc4b7('0x1d')]['rawAttributes']);_0x1aac19[_0xc4b7('0x28')]=_[_0xc4b7('0x29')](_0x468d2a[_0xc4b7('0x28')]);_0x1aac19['filters']=_[_0xc4b7('0x2a')](_0x1aac19['model'],_0x1aac19[_0xc4b7('0x28')]);_0x1fa81f['attributes']=_['intersection'](_0x1aac19['model'],qs[_0xc4b7('0x2b')](_0x468d2a[_0xc4b7('0x28')]['fields']));_0x1fa81f[_0xc4b7('0x2c')]=_0x1fa81f[_0xc4b7('0x2c')][_0xc4b7('0x2d')]?_0x1fa81f[_0xc4b7('0x2c')]:_0x1aac19[_0xc4b7('0x2e')];if(_0x468d2a[_0xc4b7('0x28')][_0xc4b7('0x2f')]){_0x1fa81f['include']=[{'all':!![]}];}_0x1fa81f=_[_0xc4b7('0x30')]({},_0x1fa81f,_0x468d2a[_0xc4b7('0x31')]);return db[_0xc4b7('0x1d')][_0xc4b7('0x32')](_0x1fa81f)['then'](handleEntityNotFound(_0x59d816,null))[_0xc4b7('0x16')](respondWithResult(_0x59d816,null))['catch'](handleError(_0x59d816,null));};exports[_0xc4b7('0x33')]=function(_0xf09691,_0x31bef9){return db[_0xc4b7('0x1d')]['create'](_0xf09691['body'],{})['then'](function(_0x5a75bd){var _0x1b88ec=_0xf09691['user'][_0xc4b7('0x34')]({'plain':!![]});if(!_0x1b88ec)throw new Error(_0xc4b7('0x35'));if(_0x1b88ec[_0xc4b7('0x36')]===_0xc4b7('0x37')){var _0x45cff4=_0x5a75bd[_0xc4b7('0x34')]({'plain':!![]});var _0xafeff8=_0xc4b7('0x38');return db[_0xc4b7('0x39')]['find']({'where':{'name':_0xafeff8,'userProfileId':_0x1b88ec[_0xc4b7('0x3a')]},'raw':!![]})[_0xc4b7('0x16')](function(_0x495267){if(_0x495267&&_0x495267[_0xc4b7('0x3b')]===0x0){return db[_0xc4b7('0x14')][_0xc4b7('0x33')]({'name':_0x45cff4[_0xc4b7('0x19')],'resourceId':_0x45cff4['id'],'type':_0x495267['name'],'sectionId':_0x495267['id']},{})['then'](function(){return _0x5a75bd;});}else{return _0x5a75bd;}})['catch'](function(_0x11e075){logger[_0xc4b7('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11e075);throw _0x11e075;});}return _0x5a75bd;})['then'](respondWithResult(_0x31bef9,0xc9))[_0xc4b7('0x3c')](handleError(_0x31bef9,null));};exports['update']=function(_0x1322ba,_0x12b1f7){if(_0x1322ba['body']['id']){delete _0x1322ba['body']['id'];}return db['WhatsappQueue'][_0xc4b7('0x32')]({'where':{'id':_0x1322ba[_0xc4b7('0x27')]['id']}})[_0xc4b7('0x16')](handleEntityNotFound(_0x12b1f7,null))['then'](saveUpdates(_0x1322ba[_0xc4b7('0x3d')],null))[_0xc4b7('0x16')](respondWithResult(_0x12b1f7,null))['catch'](handleError(_0x12b1f7,null));};exports[_0xc4b7('0x15')]=function(_0x3416f5,_0x76e49f){return db[_0xc4b7('0x1d')][_0xc4b7('0x32')]({'where':{'id':_0x3416f5[_0xc4b7('0x27')]['id']}})[_0xc4b7('0x16')](handleEntityNotFound(_0x76e49f,null))[_0xc4b7('0x16')](removeEntity(_0x76e49f,null))['catch'](handleError(_0x76e49f,null));};exports[_0xc4b7('0x3e')]=function(_0x1a0838,_0x47795c){return db['WhatsappQueue'][_0xc4b7('0x3e')]()[_0xc4b7('0x16')](respondWithResult(_0x47795c,null))[_0xc4b7('0x3c')](handleError(_0x47795c,null));};exports[_0xc4b7('0x3f')]=function(_0x2da72f,_0x4eaf35){var _0x276792={'raw':!![],'where':{}},_0x5c0764={},_0x3d7323;return db['WhatsappQueue']['findOne']({'where':{'id':_0x2da72f[_0xc4b7('0x27')]['id']}})[_0xc4b7('0x16')](handleEntityNotFound(_0x4eaf35,null))[_0xc4b7('0x16')](function(_0x215c33){if(_0x215c33){_0x3d7323=_0x215c33[_0xc4b7('0x34')]({'plain':!![]});_0x5c0764['model']=_['keys'](db[_0xc4b7('0x40')][_0xc4b7('0x41')]);_0x5c0764[_0xc4b7('0x28')]=_[_0xc4b7('0x29')](_0x2da72f[_0xc4b7('0x28')]);_0x5c0764['filters']=_[_0xc4b7('0x2a')](_0x5c0764['model'],_0x5c0764[_0xc4b7('0x28')]);_0x276792[_0xc4b7('0x2c')]=_[_0xc4b7('0x2a')](_0x5c0764[_0xc4b7('0x2e')],qs[_0xc4b7('0x2b')](_0x2da72f[_0xc4b7('0x28')][_0xc4b7('0x2b')]));_0x276792[_0xc4b7('0x2c')]=_0x276792['attributes'][_0xc4b7('0x2d')]?_0x276792[_0xc4b7('0x2c')]:_0x5c0764[_0xc4b7('0x2e')];if(!_0x2da72f['query'][_0xc4b7('0x42')](_0xc4b7('0x43'))){_0x276792[_0xc4b7('0x10')]=qs[_0xc4b7('0x10')](_0x2da72f[_0xc4b7('0x28')][_0xc4b7('0x10')]);_0x276792[_0xc4b7('0xe')]=qs['offset'](_0x2da72f['query'][_0xc4b7('0xe')]);}_0x276792[_0xc4b7('0x44')]=qs[_0xc4b7('0x45')](_0x2da72f[_0xc4b7('0x28')]['sort']);_0x276792['where']=qs['filters'](_[_0xc4b7('0x46')](_0x2da72f[_0xc4b7('0x28')],_0x5c0764['filters']));_0x276792[_0xc4b7('0x22')][_0xc4b7('0x47')]=_0x215c33['id'];if(_0x2da72f[_0xc4b7('0x28')][_0xc4b7('0x48')]){_0x276792[_0xc4b7('0x22')]=_[_0xc4b7('0x30')](_0x276792[_0xc4b7('0x22')],{'$or':_[_0xc4b7('0x1c')](_0x276792[_0xc4b7('0x2c')],function(_0x428034){var _0x1a8e91={};_0x1a8e91[_0x428034]={'$like':'%'+_0x2da72f[_0xc4b7('0x28')][_0xc4b7('0x48')]+'%'};return _0x1a8e91;})});}_0x276792=_['merge']({},_0x276792,_0x2da72f[_0xc4b7('0x31')]);return db[_0xc4b7('0x40')]['findAll'](_0x276792);}})[_0xc4b7('0x16')](function(_0x4b4490){if(_0x4b4490){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x4b4490,_0xc4b7('0x49')),'role':_0xc4b7('0x4a')},'attributes':['id',_0xc4b7('0x19'),'whatsappPause',_0xc4b7('0x4b'),_0xc4b7('0x4c')]});}})['then'](function(_0x38d62e){if(_0x38d62e){return{'count':_0x38d62e[_0xc4b7('0x11')],'rows':_[_0xc4b7('0x1c')](_0x38d62e['rows'],function(_0x413055){return{'membername':_0x413055[_0xc4b7('0x19')],'UserId':_0x413055['id'],'queue_name':_0x3d7323[_0xc4b7('0x19')],'WhatsappQueueId':_0x3d7323['id'],'interface':util[_0xc4b7('0x4d')](_0xc4b7('0x4e'),_0xc4b7('0x4f'),_0x413055['name']),'penalty':0x0,'paused':_0x413055['whatsappPause'],'createdAt':_0x413055[_0xc4b7('0x4c')],'updatedAt':_0x413055[_0xc4b7('0x4b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xc4b7('0x16')](respondWithFilteredResult(_0x4eaf35,_0x276792))[_0xc4b7('0x3c')](handleError(_0x4eaf35,null));};exports['getTeams']=function(_0x204d9b,_0x3e878c){var _0x16bcd3={};var _0x11e4d7={};var _0x1acf28;var _0x25c15;return db[_0xc4b7('0x1d')][_0xc4b7('0x50')]({'where':{'id':_0x204d9b['params']['id']}})['then'](handleEntityNotFound(_0x3e878c,null))['then'](function(_0x1cb9cc){if(_0x1cb9cc){_0x1acf28=_0x1cb9cc;_0x11e4d7['model']=_[_0xc4b7('0x29')](db[_0xc4b7('0x51')]['rawAttributes']);_0x11e4d7[_0xc4b7('0x28')]=_['keys'](_0x204d9b[_0xc4b7('0x28')]);_0x11e4d7[_0xc4b7('0x52')]=_[_0xc4b7('0x2a')](_0x11e4d7['model'],_0x11e4d7[_0xc4b7('0x28')]);_0x16bcd3['attributes']=_['intersection'](_0x11e4d7[_0xc4b7('0x2e')],qs[_0xc4b7('0x2b')](_0x204d9b[_0xc4b7('0x28')][_0xc4b7('0x2b')]));_0x16bcd3[_0xc4b7('0x2c')]=_0x16bcd3[_0xc4b7('0x2c')][_0xc4b7('0x2d')]?_0x16bcd3[_0xc4b7('0x2c')]:_0x11e4d7[_0xc4b7('0x2e')];_0x16bcd3[_0xc4b7('0x44')]=qs[_0xc4b7('0x45')](_0x204d9b[_0xc4b7('0x28')][_0xc4b7('0x45')]);_0x16bcd3[_0xc4b7('0x22')]=qs[_0xc4b7('0x52')](_[_0xc4b7('0x46')](_0x204d9b[_0xc4b7('0x28')],_0x11e4d7[_0xc4b7('0x52')]));if(_0x204d9b[_0xc4b7('0x28')]['filter']){_0x16bcd3[_0xc4b7('0x22')]=_['merge'](_0x16bcd3[_0xc4b7('0x22')],{'$or':_['map'](_0x16bcd3[_0xc4b7('0x2c')],function(_0xb029e1){var _0x4ddd9f={};_0x4ddd9f[_0xb029e1]={'$like':'%'+_0x204d9b[_0xc4b7('0x28')]['filter']+'%'};return _0x4ddd9f;})});}_0x16bcd3=_[_0xc4b7('0x30')]({},_0x16bcd3,_0x204d9b[_0xc4b7('0x31')]);return _0x1acf28[_0xc4b7('0x53')](_0x16bcd3);}})[_0xc4b7('0x16')](function(_0xf08a2a){if(_0xf08a2a){_0x25c15=_0xf08a2a[_0xc4b7('0x2d')];if(!_0x204d9b[_0xc4b7('0x28')][_0xc4b7('0x42')](_0xc4b7('0x43'))){_0x16bcd3[_0xc4b7('0x10')]=qs['limit'](_0x204d9b[_0xc4b7('0x28')]['limit']);_0x16bcd3['offset']=qs[_0xc4b7('0xe')](_0x204d9b[_0xc4b7('0x28')][_0xc4b7('0xe')]);}return _0x1acf28[_0xc4b7('0x53')](_0x16bcd3);}})[_0xc4b7('0x16')](function(_0x22a2ad){if(_0x22a2ad){return _0x22a2ad?{'count':_0x25c15,'rows':_0x22a2ad}:null;}})[_0xc4b7('0x16')](respondWithResult(_0x3e878c,null))[_0xc4b7('0x3c')](handleError(_0x3e878c,null));};exports['addTeams']=function(_0x289a89,_0x2edcd4){var _0x47ca20=_0x289a89['body'][_0xc4b7('0x54')];return db[_0xc4b7('0x51')][_0xc4b7('0x24')]({'where':{'id':_0x47ca20},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc4b7('0x55'),'attributes':['id',_0xc4b7('0x19'),_0xc4b7('0x56'),_0xc4b7('0x57'),'interface'],'raw':!![]}]})[_0xc4b7('0x16')](function(_0x1e8eaa){if(_0x1e8eaa){var _0x5e09f0=_['flatMap'](_0x1e8eaa,function(_0x57ad0f){var _0x36490d=_0x57ad0f[_0xc4b7('0x34')]({'plain':!![]});return _0x36490d[_0xc4b7('0x55')];});return db[_0xc4b7('0x1d')][_0xc4b7('0x32')]({'where':{'id':_0x289a89[_0xc4b7('0x27')]['id']}})[_0xc4b7('0x16')](function(_0x148a0e){return db[_0xc4b7('0x58')]['transaction'](function(_0x260b1d){return _0x148a0e['addTeams'](_0x47ca20,{'transaction':_0x260b1d})[_0xc4b7('0x16')](function(){return BPromise[_0xc4b7('0x59')](_0x5e09f0,function(_0x2a2f70){return db[_0xc4b7('0x40')][_0xc4b7('0x5a')]({'where':{'UserId':_0x2a2f70['id'],'WhatsappQueueId':_0x289a89[_0xc4b7('0x27')]['id']},'transaction':_0x260b1d});});})[_0xc4b7('0x16')](function(){_0x5e09f0[_0xc4b7('0x5b')](function(_0x1c4347){socket['emit'](_0xc4b7('0x5c'),{'UserId':_0x1c4347['id'],'WhatsappQueueId':_0x148a0e['id']});});});});});}})[_0xc4b7('0x16')](respondWithStatusCode(_0x2edcd4,null))['catch'](handleError(_0x2edcd4,null));};exports[_0xc4b7('0x5d')]=function(_0x38fbd6,_0x578dde){return db['Team'][_0xc4b7('0x24')]({'where':{'id':_0x38fbd6[_0xc4b7('0x28')][_0xc4b7('0x54')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xc4b7('0x16')](handleEntityNotFound(_0x578dde,null))[_0xc4b7('0x16')](function(_0x9fa774){var _0x44dc4e=_['map'](_0x9fa774,'id');var _0x115c04=[];var _0x2fa0d5=[];var _0x104b93=squel[_0xc4b7('0x5e')]();_0x104b93[_0xc4b7('0x5f')](_0xc4b7('0x60'))[_0xc4b7('0x61')]('team_has_whatsapp_queues','tq')[_0xc4b7('0x62')](_0xc4b7('0x63'),'ut',_0xc4b7('0x64'))['where'](_0xc4b7('0x65'),_0x38fbd6[_0xc4b7('0x27')]['id']);for(var _0x414651=0x0;_0x414651<_0x9fa774[_0xc4b7('0x2d')];_0x414651+=0x1){let _0x2d1226=_0x9fa774[_0x414651];for(var _0x121f7b=0x0;_0x121f7b<_0x2d1226['Agents']['length'];_0x121f7b+=0x1){let _0x296618=_0x2d1226['Agents'][_0x121f7b];var _0x5458ab=_0x104b93[_0xc4b7('0x66')]();_0x5458ab['where'](_0xc4b7('0x67'),_0x296618['id']);_0x2fa0d5[_0xc4b7('0x68')](db[_0xc4b7('0x58')][_0xc4b7('0x28')](_0x5458ab[_0xc4b7('0x69')](),{'type':db[_0xc4b7('0x58')][_0xc4b7('0x6a')]['SELECT']})[_0xc4b7('0x16')](function(_0x1d7512){if(_0x1d7512[_0xc4b7('0x2d')]===0x1){return _0x296618['id'];}else{var _0x214ea0=_['every'](_[_0xc4b7('0x1c')](_0x1d7512,'TeamId'),function(_0x1529d3){return _[_0xc4b7('0x6b')](_0x44dc4e,_0x1529d3);});if(_0x214ea0){return _0x296618['id'];}}}));}}return BPromise[_0xc4b7('0x6c')](_0x2fa0d5)[_0xc4b7('0x16')](function(_0x296830){_0x115c04=_(_0x115c04)[_0xc4b7('0x6d')](_0x296830)[_0xc4b7('0x6e')]()[_0xc4b7('0x6f')]();return db[_0xc4b7('0x1d')]['find']({'where':{'id':_0x38fbd6[_0xc4b7('0x27')]['id']}})[_0xc4b7('0x16')](function(_0x49c761){return db['sequelize'][_0xc4b7('0x70')](function(_0x148d3a){return _0x49c761['removeTeams'](_0x38fbd6[_0xc4b7('0x28')]['ids'],{'transaction':_0x148d3a})[_0xc4b7('0x16')](function(){if(!_['isEmpty'](_0x115c04)){return _0x49c761[_0xc4b7('0x71')](_0x115c04,{'transaction':_0x148d3a});}})[_0xc4b7('0x16')](function(){_0x115c04[_0xc4b7('0x5b')](function(_0xde7b7d){socket['emit'](_0xc4b7('0x72'),{'UserId':_0xde7b7d,'WhatsappQueueId':_0x49c761['id']});});});});});});})[_0xc4b7('0x16')](respondWithStatusCode(_0x578dde,null))[_0xc4b7('0x3c')](handleError(_0x578dde,null));};exports[_0xc4b7('0x73')]=function(_0xe96fd9,_0x18a484){return db[_0xc4b7('0x1d')][_0xc4b7('0x32')]({'where':{'id':_0xe96fd9[_0xc4b7('0x27')]['id']}})[_0xc4b7('0x16')](handleEntityNotFound(_0x18a484,null))[_0xc4b7('0x16')](function(_0x58dfb4){if(_0x58dfb4){return _0x58dfb4[_0xc4b7('0x73')](_0xe96fd9['body']['ids'],_[_0xc4b7('0x74')](_0xe96fd9[_0xc4b7('0x3d')],[_0xc4b7('0x54'),'id'])||{})[_0xc4b7('0x75')](function(_0xd81f64){for(var _0xac7b93=0x0;_0xac7b93<_0xe96fd9[_0xc4b7('0x3d')]['ids'][_0xc4b7('0x2d')];_0xac7b93+=0x1){socket[_0xc4b7('0x76')](_0xc4b7('0x5c'),{'UserId':Number(_0xe96fd9[_0xc4b7('0x3d')][_0xc4b7('0x54')][_0xac7b93]),'WhatsappQueueId':Number(_0xe96fd9[_0xc4b7('0x27')]['id'])});}return _0xd81f64;});}})[_0xc4b7('0x16')](respondWithResult(_0x18a484,null))[_0xc4b7('0x3c')](handleError(_0x18a484,null));};exports[_0xc4b7('0x71')]=function(_0x133044,_0x2025a6){return db[_0xc4b7('0x1d')][_0xc4b7('0x32')]({'where':{'id':_0x133044['params']['id']}})[_0xc4b7('0x16')](handleEntityNotFound(_0x2025a6,null))['then'](function(_0x1a8208){if(_0x1a8208){return _0x1a8208['removeAgents'](_0x133044[_0xc4b7('0x28')]['ids'])['then'](function(){if(_[_0xc4b7('0x77')](_0x133044[_0xc4b7('0x28')][_0xc4b7('0x54')])){for(var _0x3afdb1=0x0;_0x3afdb1<_0x133044[_0xc4b7('0x28')][_0xc4b7('0x54')]['length'];_0x3afdb1+=0x1){socket[_0xc4b7('0x76')](_0xc4b7('0x72'),{'UserId':Number(_0x133044[_0xc4b7('0x28')][_0xc4b7('0x54')][_0x3afdb1]),'WhatsappQueueId':Number(_0x133044[_0xc4b7('0x27')]['id'])});}}else{socket[_0xc4b7('0x76')](_0xc4b7('0x72'),{'UserId':Number(_0x133044[_0xc4b7('0x28')][_0xc4b7('0x54')]),'WhatsappQueueId':Number(_0x133044[_0xc4b7('0x27')]['id'])});}});}})[_0xc4b7('0x16')](respondWithStatusCode(_0x2025a6,null))['catch'](handleError(_0x2025a6,null));};exports['getAgents']=function(_0x1dc952,_0x510539){var _0x4fad72={};var _0x23913c={};var _0x206857;var _0x525f63;return db['WhatsappQueue'][_0xc4b7('0x50')]({'where':{'id':_0x1dc952[_0xc4b7('0x27')]['id']}})['then'](handleEntityNotFound(_0x510539,null))[_0xc4b7('0x16')](function(_0x51a499){if(_0x51a499){_0x206857=_0x51a499;_0x23913c['model']=_['keys'](db[_0xc4b7('0x78')]['rawAttributes']);_0x23913c['query']=_['keys'](_0x1dc952['query']);_0x23913c[_0xc4b7('0x52')]=_['intersection'](_0x23913c['model'],_0x23913c[_0xc4b7('0x28')]);_0x4fad72[_0xc4b7('0x2c')]=_[_0xc4b7('0x2a')](_0x23913c['model'],qs[_0xc4b7('0x2b')](_0x1dc952[_0xc4b7('0x28')]['fields']));_0x4fad72['attributes']=_0x4fad72[_0xc4b7('0x2c')][_0xc4b7('0x2d')]?_0x4fad72[_0xc4b7('0x2c')]:_0x23913c[_0xc4b7('0x2e')];_0x4fad72['order']=qs[_0xc4b7('0x45')](_0x1dc952[_0xc4b7('0x28')][_0xc4b7('0x45')]);_0x4fad72[_0xc4b7('0x22')]=qs['filters'](_[_0xc4b7('0x46')](_0x1dc952[_0xc4b7('0x28')],_0x23913c[_0xc4b7('0x52')]));if(_0x1dc952[_0xc4b7('0x28')]['filter']){_0x4fad72[_0xc4b7('0x22')]=_[_0xc4b7('0x30')](_0x4fad72[_0xc4b7('0x22')],{'$or':_['map'](_0x4fad72[_0xc4b7('0x2c')],function(_0x157905){var _0x432618={};_0x432618[_0x157905]={'$like':'%'+_0x1dc952['query'][_0xc4b7('0x48')]+'%'};return _0x432618;})});}_0x4fad72=_[_0xc4b7('0x30')]({},_0x4fad72,_0x1dc952[_0xc4b7('0x31')]);return _0x206857[_0xc4b7('0x79')](_0x4fad72);}})[_0xc4b7('0x16')](function(_0x2e5cd2){if(_0x2e5cd2){_0x525f63=_0x2e5cd2[_0xc4b7('0x2d')];if(!_0x1dc952['query'][_0xc4b7('0x42')](_0xc4b7('0x43'))){_0x4fad72[_0xc4b7('0x10')]=qs[_0xc4b7('0x10')](_0x1dc952[_0xc4b7('0x28')][_0xc4b7('0x10')]);_0x4fad72[_0xc4b7('0xe')]=qs[_0xc4b7('0xe')](_0x1dc952[_0xc4b7('0x28')][_0xc4b7('0xe')]);}return _0x206857['getAgents'](_0x4fad72);}})['then'](function(_0x10d9de){if(_0x10d9de){return _0x10d9de?{'count':_0x525f63,'rows':_0x10d9de}:null;}})[_0xc4b7('0x16')](respondWithResult(_0x510539,null))[_0xc4b7('0x3c')](handleError(_0x510539,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index a4af2d7..172e03e 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 _0x768c=['WhatsappQueue','update','remove','emit','hasOwnProperty','exports','events'];(function(_0x5b1fa0,_0x1ca722){var _0x3fbb3a=function(_0x5d31e3){while(--_0x5d31e3){_0x5b1fa0['push'](_0x5b1fa0['shift']());}};_0x3fbb3a(++_0x1ca722);}(_0x768c,0x141));var _0xc768=function(_0x4d5e82,_0x51c752){_0x4d5e82=_0x4d5e82-0x0;var _0xf0724b=_0x768c[_0x4d5e82];return _0xf0724b;};'use strict';var EventEmitter=require(_0xc768('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0xc768('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xc768('0x2'),'afterDestroy':_0xc768('0x3')};function emitEvent(_0x411c72){return function(_0xa93080,_0x48b791,_0xb4630f){WhatsappQueueEvents[_0xc768('0x4')](_0x411c72+':'+_0xa93080['id'],_0xa93080);WhatsappQueueEvents[_0xc768('0x4')](_0x411c72,_0xa93080);_0xb4630f(null);};}for(var e in events){if(events[_0xc768('0x5')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xc768('0x6')]=WhatsappQueueEvents; \ No newline at end of file +var _0xb66a=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','save'];(function(_0x15fc87,_0x6bc691){var _0x1e4d93=function(_0x4b1d65){while(--_0x4b1d65){_0x15fc87['push'](_0x15fc87['shift']());}};_0x1e4d93(++_0x6bc691);}(_0xb66a,0xe2));var _0xab66=function(_0x41b600,_0x576374){_0x41b600=_0x41b600-0x0;var _0x26114f=_0xb66a[_0x41b600];return _0x26114f;};'use strict';var EventEmitter=require(_0xab66('0x0'));var WhatsappQueue=require(_0xab66('0x1'))['db'][_0xab66('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xab66('0x3'),'afterUpdate':_0xab66('0x4'),'afterDestroy':_0xab66('0x5')};function emitEvent(_0x5dbe3d){return function(_0xdbfd83,_0x27e01b,_0x5cd9f3){WhatsappQueueEvents[_0xab66('0x6')](_0x5dbe3d+':'+_0xdbfd83['id'],_0xdbfd83);WhatsappQueueEvents['emit'](_0x5dbe3d,_0xdbfd83);_0x5cd9f3(null);};}for(var e in events){if(events[_0xab66('0x7')](e)){var event=events[e];WhatsappQueue[_0xab66('0x8')](e,emitEvent(event));}}module[_0xab66('0x9')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index b6413f0..cc9f0da 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 _0x8f28=['exports','define','whatsapp_queues','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueue.attributes'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8f28,0x183));var _0x88f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f28[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x88f2('0x0'));var logger=require('../../config/logger')(_0x88f2('0x1'));var moment=require(_0x88f2('0x2'));var BPromise=require(_0x88f2('0x3'));var rp=require(_0x88f2('0x4'));var fs=require('fs');var path=require(_0x88f2('0x5'));var rimraf=require(_0x88f2('0x6'));var config=require(_0x88f2('0x7'));var attributes=require(_0x88f2('0x8'));module[_0x88f2('0x9')]=function(_0x48f3d6,_0x5f56b8){return _0x48f3d6[_0x88f2('0xa')]('WhatsappQueue',attributes,{'tableName':_0x88f2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x350b=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','WhatsappQueue','whatsapp_queues','lodash','util'];(function(_0x2f37bd,_0x295e9f){var _0x33362b=function(_0x51264e){while(--_0x51264e){_0x2f37bd['push'](_0x2f37bd['shift']());}};_0x33362b(++_0x295e9f);}(_0x350b,0x1a2));var _0xb350=function(_0x2882ca,_0x2b3d00){_0x2882ca=_0x2882ca-0x0;var _0x26fcba=_0x350b[_0x2882ca];return _0x26fcba;};'use strict';var _=require(_0xb350('0x0'));var util=require(_0xb350('0x1'));var logger=require(_0xb350('0x2'))(_0xb350('0x3'));var moment=require(_0xb350('0x4'));var BPromise=require(_0xb350('0x5'));var rp=require(_0xb350('0x6'));var fs=require('fs');var path=require(_0xb350('0x7'));var rimraf=require(_0xb350('0x8'));var config=require(_0xb350('0x9'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x121537,_0x21ad85){return _0x121537['define'](_0xb350('0xa'),attributes,{'tableName':_0xb350('0xb'),'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 d9b65bd..ad03d21 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 _0x6f68=['request\x20sent','stringify','error','WhatsappQueue,\x20%s,\x20%s','message','info','result','catch','WhatsappQueue','findAll','options','raw','where','attributes','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','debug'];(function(_0x73ea6d,_0x57d5bd){var _0x4c3a66=function(_0xb3ffd1){while(--_0xb3ffd1){_0x73ea6d['push'](_0x73ea6d['shift']());}};_0x4c3a66(++_0x57d5bd);}(_0x6f68,0x184));var _0x86f6=function(_0x4dfd67,_0x24bfb1){_0x4dfd67=_0x4dfd67-0x0;var _0x413394=_0x6f68[_0x4dfd67];return _0x413394;};'use strict';var _=require(_0x86f6('0x0'));var util=require(_0x86f6('0x1'));var moment=require(_0x86f6('0x2'));var BPromise=require(_0x86f6('0x3'));var rs=require(_0x86f6('0x4'));var fs=require('fs');var Redis=require(_0x86f6('0x5'));var db=require(_0x86f6('0x6'))['db'];var utils=require(_0x86f6('0x7'));var logger=require(_0x86f6('0x8'))(_0x86f6('0x9'));var config=require('../../config/environment');var jayson=require(_0x86f6('0xa'));var client=jayson[_0x86f6('0xb')][_0x86f6('0xc')]({'port':0x232a});config[_0x86f6('0xd')]=_[_0x86f6('0xe')](config[_0x86f6('0xd')],{'host':_0x86f6('0xf'),'port':0x18eb});var socket=require(_0x86f6('0x10'))(new Redis(config[_0x86f6('0xd')]));require(_0x86f6('0x11'))[_0x86f6('0x12')](socket);function respondWithRpcPromise(_0x429f18,_0x321d77,_0x38db02){return new BPromise(function(_0x30f7f1,_0x4387dd){return client[_0x86f6('0x13')](_0x429f18,_0x38db02)[_0x86f6('0x14')](function(_0x15db38){logger['info']('WhatsappQueue,\x20%s,\x20%s',_0x321d77,'request\x20sent');logger[_0x86f6('0x15')]('WhatsappQueue,\x20%s,\x20%s,\x20%s',_0x321d77,_0x86f6('0x16'),JSON[_0x86f6('0x17')](_0x15db38));if(_0x15db38[_0x86f6('0x18')]){if(_0x15db38[_0x86f6('0x18')]['code']===0x1f4){logger[_0x86f6('0x18')](_0x86f6('0x19'),_0x321d77,_0x15db38[_0x86f6('0x18')][_0x86f6('0x1a')]);return _0x4387dd(_0x15db38[_0x86f6('0x18')][_0x86f6('0x1a')]);}logger[_0x86f6('0x18')](_0x86f6('0x19'),_0x321d77,_0x15db38[_0x86f6('0x18')]['message']);return _0x30f7f1(_0x15db38[_0x86f6('0x18')][_0x86f6('0x1a')]);}else{logger[_0x86f6('0x1b')](_0x86f6('0x19'),_0x321d77,_0x86f6('0x16'));_0x30f7f1(_0x15db38[_0x86f6('0x1c')][_0x86f6('0x1a')]);}})[_0x86f6('0x1d')](function(_0xf6a6c8){logger[_0x86f6('0x18')](_0x86f6('0x19'),_0x321d77,_0xf6a6c8);_0x4387dd(_0xf6a6c8);});});}exports['GetWhatsappQueue']=function(_0x5f0f70){var _0x44de08=this;return new Promise(function(_0x2d8138,_0x3bd16a){return db[_0x86f6('0x1e')][_0x86f6('0x1f')]({'raw':_0x5f0f70['options']?_0x5f0f70[_0x86f6('0x20')][_0x86f6('0x21')]===undefined?!![]:![]:!![],'where':_0x5f0f70[_0x86f6('0x20')]?_0x5f0f70[_0x86f6('0x20')][_0x86f6('0x22')]||null:null,'attributes':_0x5f0f70[_0x86f6('0x20')]?_0x5f0f70[_0x86f6('0x20')][_0x86f6('0x23')]||null:null,'limit':_0x5f0f70[_0x86f6('0x20')]?_0x5f0f70[_0x86f6('0x20')]['limit']||null:null,'include':_0x5f0f70[_0x86f6('0x20')]?_0x5f0f70['options'][_0x86f6('0x24')]?_[_0x86f6('0x25')](_0x5f0f70[_0x86f6('0x20')][_0x86f6('0x24')],function(_0x323ad0){return{'model':db[_0x323ad0['model']],'as':_0x323ad0['as'],'attributes':_0x323ad0[_0x86f6('0x23')],'include':_0x323ad0['include']?_[_0x86f6('0x25')](_0x323ad0[_0x86f6('0x24')],function(_0x238b17){return{'model':db[_0x238b17[_0x86f6('0x26')]],'as':_0x238b17['as'],'attributes':_0x238b17[_0x86f6('0x23')],'include':_0x238b17['include']?_[_0x86f6('0x25')](_0x238b17[_0x86f6('0x24')],function(_0x76c3c9){return{'model':db[_0x76c3c9[_0x86f6('0x26')]],'as':_0x76c3c9['as'],'attributes':_0x76c3c9[_0x86f6('0x23')]};}):[]};}):[]};}):[]:[]})[_0x86f6('0x14')](function(_0x142f64){logger[_0x86f6('0x1b')](_0x86f6('0x27'),_0x5f0f70);logger[_0x86f6('0x15')]('GetWhatsappQueue',_0x5f0f70,JSON[_0x86f6('0x17')](_0x142f64));_0x2d8138(_0x142f64);})[_0x86f6('0x1d')](function(_0x56eb1a){logger[_0x86f6('0x18')](_0x86f6('0x27'),_0x56eb1a[_0x86f6('0x1a')],_0x5f0f70);_0x3bd16a(_0x44de08[_0x86f6('0x18')](0x1f4,_0x56eb1a[_0x86f6('0x1a')]));});});};exports[_0x86f6('0x28')]=function(_0x3ccfec){var _0x389f67=this;return new Promise(function(_0xc35081,_0x2ae53e){return db['WhatsappQueue']['find']({'raw':_0x3ccfec['options']?_0x3ccfec[_0x86f6('0x20')][_0x86f6('0x21')]===undefined?!![]:![]:!![],'where':_0x3ccfec[_0x86f6('0x20')]?_0x3ccfec[_0x86f6('0x20')][_0x86f6('0x22')]||null:null,'attributes':_0x3ccfec[_0x86f6('0x20')]?_0x3ccfec[_0x86f6('0x20')][_0x86f6('0x23')]||null:null,'include':_0x3ccfec[_0x86f6('0x20')]?_0x3ccfec[_0x86f6('0x20')][_0x86f6('0x24')]?_[_0x86f6('0x25')](_0x3ccfec[_0x86f6('0x20')][_0x86f6('0x24')],function(_0x528762){return{'model':db[_0x528762['model']],'as':_0x528762['as'],'attributes':_0x528762[_0x86f6('0x23')],'include':_0x528762[_0x86f6('0x24')]?_[_0x86f6('0x25')](_0x528762['include'],function(_0x44b0c1){return{'model':db[_0x44b0c1[_0x86f6('0x26')]],'as':_0x44b0c1['as'],'attributes':_0x44b0c1[_0x86f6('0x23')],'include':_0x44b0c1[_0x86f6('0x24')]?_[_0x86f6('0x25')](_0x44b0c1['include'],function(_0x45d86e){return{'model':db[_0x45d86e['model']],'as':_0x45d86e['as'],'attributes':_0x45d86e['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b00c7){logger[_0x86f6('0x1b')]('ShowWhatsappQueue',_0x3ccfec);logger[_0x86f6('0x15')](_0x86f6('0x28'),_0x3ccfec,JSON['stringify'](_0x5b00c7));_0xc35081(_0x5b00c7);})[_0x86f6('0x1d')](function(_0x1c7af8){logger[_0x86f6('0x18')]('ShowWhatsappQueue',_0x1c7af8[_0x86f6('0x1a')],_0x3ccfec);_0x2ae53e(_0x389f67[_0x86f6('0x18')](0x1f4,_0x1c7af8[_0x86f6('0x1a')]));});});}; \ No newline at end of file +var _0x73f7=['info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','include','map','model','ShowWhatsappQueue','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./whatsappQueue.socket','then'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x73f7,0x89));var _0x773f=function(_0x2e453f,_0x30e481){_0x2e453f=_0x2e453f-0x0;var _0x3ae32f=_0x73f7[_0x2e453f];return _0x3ae32f;};'use strict';var _=require(_0x773f('0x0'));var util=require(_0x773f('0x1'));var moment=require(_0x773f('0x2'));var BPromise=require(_0x773f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x773f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x773f('0x5'))('rpc');var config=require(_0x773f('0x6'));var jayson=require(_0x773f('0x7'));var client=jayson[_0x773f('0x8')][_0x773f('0x9')]({'port':0x232a});config['redis']=_[_0x773f('0xa')](config[_0x773f('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x773f('0xc'))(new Redis(config[_0x773f('0xb')]));require(_0x773f('0xd'))['register'](socket);function respondWithRpcPromise(_0x235a44,_0x4c638f,_0x1b63e1){return new BPromise(function(_0x2f2b59,_0x56a2c5){return client['request'](_0x235a44,_0x1b63e1)[_0x773f('0xe')](function(_0x2e1bd5){logger[_0x773f('0xf')](_0x773f('0x10'),_0x4c638f,_0x773f('0x11'));logger[_0x773f('0x12')](_0x773f('0x13'),_0x4c638f,'request\x20sent',JSON[_0x773f('0x14')](_0x2e1bd5));if(_0x2e1bd5[_0x773f('0x15')]){if(_0x2e1bd5[_0x773f('0x15')][_0x773f('0x16')]===0x1f4){logger[_0x773f('0x15')](_0x773f('0x10'),_0x4c638f,_0x2e1bd5['error']['message']);return _0x56a2c5(_0x2e1bd5[_0x773f('0x15')][_0x773f('0x17')]);}logger[_0x773f('0x15')](_0x773f('0x10'),_0x4c638f,_0x2e1bd5['error']['message']);return _0x2f2b59(_0x2e1bd5[_0x773f('0x15')][_0x773f('0x17')]);}else{logger[_0x773f('0xf')](_0x773f('0x10'),_0x4c638f,'request\x20sent');_0x2f2b59(_0x2e1bd5[_0x773f('0x18')][_0x773f('0x17')]);}})[_0x773f('0x19')](function(_0x495dfe){logger[_0x773f('0x15')](_0x773f('0x10'),_0x4c638f,_0x495dfe);_0x56a2c5(_0x495dfe);});});}exports[_0x773f('0x1a')]=function(_0x5c2e0b){var _0x345355=this;return new Promise(function(_0xb2952f,_0x58a75e){return db[_0x773f('0x1b')][_0x773f('0x1c')]({'raw':_0x5c2e0b['options']?_0x5c2e0b[_0x773f('0x1d')][_0x773f('0x1e')]===undefined?!![]:![]:!![],'where':_0x5c2e0b['options']?_0x5c2e0b[_0x773f('0x1d')][_0x773f('0x1f')]||null:null,'attributes':_0x5c2e0b['options']?_0x5c2e0b['options'][_0x773f('0x20')]||null:null,'limit':_0x5c2e0b[_0x773f('0x1d')]?_0x5c2e0b['options'][_0x773f('0x21')]||null:null,'include':_0x5c2e0b[_0x773f('0x1d')]?_0x5c2e0b[_0x773f('0x1d')][_0x773f('0x22')]?_[_0x773f('0x23')](_0x5c2e0b[_0x773f('0x1d')]['include'],function(_0x3d0f33){return{'model':db[_0x3d0f33[_0x773f('0x24')]],'as':_0x3d0f33['as'],'attributes':_0x3d0f33[_0x773f('0x20')],'include':_0x3d0f33[_0x773f('0x22')]?_['map'](_0x3d0f33['include'],function(_0x31631d){return{'model':db[_0x31631d[_0x773f('0x24')]],'as':_0x31631d['as'],'attributes':_0x31631d[_0x773f('0x20')],'include':_0x31631d['include']?_['map'](_0x31631d[_0x773f('0x22')],function(_0x59e4d3){return{'model':db[_0x59e4d3[_0x773f('0x24')]],'as':_0x59e4d3['as'],'attributes':_0x59e4d3['attributes']};}):[]};}):[]};}):[]:[]})[_0x773f('0xe')](function(_0x104a90){logger[_0x773f('0xf')](_0x773f('0x1a'),_0x5c2e0b);logger[_0x773f('0x12')](_0x773f('0x1a'),_0x5c2e0b,JSON[_0x773f('0x14')](_0x104a90));_0xb2952f(_0x104a90);})[_0x773f('0x19')](function(_0x518562){logger[_0x773f('0x15')](_0x773f('0x1a'),_0x518562[_0x773f('0x17')],_0x5c2e0b);_0x58a75e(_0x345355[_0x773f('0x15')](0x1f4,_0x518562[_0x773f('0x17')]));});});};exports['ShowWhatsappQueue']=function(_0x3759d6){var _0x452456=this;return new Promise(function(_0x459915,_0x29240d){return db[_0x773f('0x1b')]['find']({'raw':_0x3759d6['options']?_0x3759d6['options'][_0x773f('0x1e')]===undefined?!![]:![]:!![],'where':_0x3759d6[_0x773f('0x1d')]?_0x3759d6[_0x773f('0x1d')][_0x773f('0x1f')]||null:null,'attributes':_0x3759d6[_0x773f('0x1d')]?_0x3759d6[_0x773f('0x1d')][_0x773f('0x20')]||null:null,'include':_0x3759d6[_0x773f('0x1d')]?_0x3759d6[_0x773f('0x1d')][_0x773f('0x22')]?_['map'](_0x3759d6[_0x773f('0x1d')][_0x773f('0x22')],function(_0x4187fe){return{'model':db[_0x4187fe[_0x773f('0x24')]],'as':_0x4187fe['as'],'attributes':_0x4187fe[_0x773f('0x20')],'include':_0x4187fe[_0x773f('0x22')]?_[_0x773f('0x23')](_0x4187fe[_0x773f('0x22')],function(_0x2f023e){return{'model':db[_0x2f023e['model']],'as':_0x2f023e['as'],'attributes':_0x2f023e[_0x773f('0x20')],'include':_0x2f023e[_0x773f('0x22')]?_[_0x773f('0x23')](_0x2f023e[_0x773f('0x22')],function(_0x1228cd){return{'model':db[_0x1228cd[_0x773f('0x24')]],'as':_0x1228cd['as'],'attributes':_0x1228cd[_0x773f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x773f('0xe')](function(_0x2060cb){logger[_0x773f('0xf')]('ShowWhatsappQueue',_0x3759d6);logger[_0x773f('0x12')](_0x773f('0x25'),_0x3759d6,JSON[_0x773f('0x14')](_0x2060cb));_0x459915(_0x2060cb);})[_0x773f('0x19')](function(_0x2bad8f){logger[_0x773f('0x15')](_0x773f('0x25'),_0x2bad8f[_0x773f('0x17')],_0x3759d6);_0x29240d(_0x452456[_0x773f('0x15')](0x1f4,_0x2bad8f[_0x773f('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index eb94f9b..a79dcd5 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 _0x98d7=['remove','update','register','length','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x160900,_0x320ec7){var _0x32cf2d=function(_0x4a0f4a){while(--_0x4a0f4a){_0x160900['push'](_0x160900['shift']());}};_0x32cf2d(++_0x320ec7);}(_0x98d7,0x1a2));var _0x798d=function(_0x542d08,_0x4a2f44){_0x542d08=_0x542d08-0x0;var _0x56f6c9=_0x98d7[_0x542d08];return _0x56f6c9;};'use strict';var WhatsappQueueEvents=require(_0x798d('0x0'));var events=[_0x798d('0x1'),_0x798d('0x2'),_0x798d('0x3')];function createListener(_0x550e13,_0x203399){return function(_0x1ffcfe){_0x203399['emit'](_0x550e13,_0x1ffcfe);};}function removeListener(_0x21007b,_0x19bab1){return function(){WhatsappQueueEvents['removeListener'](_0x21007b,_0x19bab1);};}exports[_0x798d('0x4')]=function(_0x2b9f25){for(var _0x1b9258=0x0,_0xe5dd53=events[_0x798d('0x5')];_0x1b9258<_0xe5dd53;_0x1b9258++){var _0x2dab7c=events[_0x1b9258];var _0x558cee=createListener(_0x798d('0x6')+_0x2dab7c,_0x2b9f25);WhatsappQueueEvents['on'](_0x2dab7c,_0x558cee);}}; \ No newline at end of file +var _0x986a=['remove','update','emit','register','whatsappQueue:','./whatsappQueue.events','save'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x986a,0x132));var _0xa986=function(_0x44c0c0,_0x45e95b){_0x44c0c0=_0x44c0c0-0x0;var _0xdb53cc=_0x986a[_0x44c0c0];return _0xdb53cc;};'use strict';var WhatsappQueueEvents=require(_0xa986('0x0'));var events=[_0xa986('0x1'),_0xa986('0x2'),_0xa986('0x3')];function createListener(_0x4ab3d6,_0x5c8660){return function(_0x3e7c64){_0x5c8660[_0xa986('0x4')](_0x4ab3d6,_0x3e7c64);};}function removeListener(_0x56b013,_0x411cd4){return function(){WhatsappQueueEvents['removeListener'](_0x56b013,_0x411cd4);};}exports[_0xa986('0x5')]=function(_0xe7fe37){for(var _0x4f35e2=0x0,_0x5bd9a4=events['length'];_0x4f35e2<_0x5bd9a4;_0x4f35e2++){var _0x4d3793=events[_0x4f35e2];var _0x1b607d=createListener(_0xa986('0x6')+_0x4d3793,_0xe7fe37);WhatsappQueueEvents['on'](_0x4d3793,_0x1b607d);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 043fa52..3bd2f81 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 _0xaf3c=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','describe','get','/:id','show','put','update','destroy','path','connect-timeout'];(function(_0x554dc7,_0x348a57){var _0x3d7bc6=function(_0x3dddea){while(--_0x3dddea){_0x554dc7['push'](_0x554dc7['shift']());}};_0x3d7bc6(++_0x348a57);}(_0xaf3c,0x1ee));var _0xcaf3=function(_0x19db55,_0x4b6c44){_0x19db55=_0x19db55-0x0;var _0x154707=_0xaf3c[_0x19db55];return _0x154707;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcaf3('0x0'));var timeout=require(_0xcaf3('0x1'));var express=require('express');var router=express[_0xcaf3('0x2')]();var fs_extra=require(_0xcaf3('0x3'));var auth=require(_0xcaf3('0x4'));var interaction=require(_0xcaf3('0x5'));var config=require(_0xcaf3('0x6'));var controller=require('./whatsappQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcaf3('0x7')]);router['get']('/describe',auth[_0xcaf3('0x8')](),controller[_0xcaf3('0x9')]);router[_0xcaf3('0xa')](_0xcaf3('0xb'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0xc')]);router['post']('/',auth[_0xcaf3('0x8')](),controller['create']);router[_0xcaf3('0xd')](_0xcaf3('0xb'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0xe')]);router['delete'](_0xcaf3('0xb'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0xf')]);module['exports']=router; \ No newline at end of file +var _0xf300=['./whatsappQueueReport.controller','isAuthenticated','index','get','describe','/:id','show','post','create','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5e6bec,_0x1eb54d){var _0x5dc5cf=function(_0x59429a){while(--_0x59429a){_0x5e6bec['push'](_0x5e6bec['shift']());}};_0x5dc5cf(++_0x1eb54d);}(_0xf300,0x16c));var _0x0f30=function(_0x3f6c29,_0x370d86){_0x3f6c29=_0x3f6c29-0x0;var _0x4af959=_0xf300[_0x3f6c29];return _0x4af959;};'use strict';var multer=require(_0x0f30('0x0'));var util=require(_0x0f30('0x1'));var path=require(_0x0f30('0x2'));var timeout=require(_0x0f30('0x3'));var express=require(_0x0f30('0x4'));var router=express[_0x0f30('0x5')]();var fs_extra=require(_0x0f30('0x6'));var auth=require(_0x0f30('0x7'));var interaction=require(_0x0f30('0x8'));var config=require(_0x0f30('0x9'));var controller=require(_0x0f30('0xa'));router['get']('/',auth[_0x0f30('0xb')](),controller[_0x0f30('0xc')]);router[_0x0f30('0xd')]('/describe',auth[_0x0f30('0xb')](),controller[_0x0f30('0xe')]);router[_0x0f30('0xd')](_0x0f30('0xf'),auth['isAuthenticated'](),controller[_0x0f30('0x10')]);router[_0x0f30('0x11')]('/',auth[_0x0f30('0xb')](),controller[_0x0f30('0x12')]);router['put'](_0x0f30('0xf'),auth[_0x0f30('0xb')](),controller[_0x0f30('0x13')]);router[_0x0f30('0x14')]('/:id',auth[_0x0f30('0xb')](),controller[_0x0f30('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 2718175..db94cf2 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x498d6d,_0x4129c9){var _0x406fd6=function(_0x53f207){while(--_0x53f207){_0x498d6d['push'](_0x498d6d['shift']());}};_0x406fd6(++_0x4129c9);}(_0x7a54,0x106));var _0x47a5=function(_0x22e13d,_0x166e83){_0x22e13d=_0x22e13d-0x0;var _0x58a22a=_0x7a54[_0x22e13d];return _0x58a22a;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x19477d,_0x1c4259){var _0x3cb9ba=function(_0x228fa3){while(--_0x228fa3){_0x19477d['push'](_0x19477d['shift']());}};_0x3cb9ba(++_0x1c4259);}(_0x7a54,0x106));var _0x47a5=function(_0x252221,_0x2f6150){_0x252221=_0x252221-0x0;var _0x588e04=_0x7a54[_0x252221];return _0x588e04;};'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 7a90b37..b165a47 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 _0x0565=['length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','WhatsappQueueReport','includeAll','findAll','rows','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','fields','attributes'];(function(_0x3b83ad,_0x51290d){var _0x20e6fd=function(_0x5f4f4f){while(--_0x5f4f4f){_0x3b83ad['push'](_0x3b83ad['shift']());}};_0x20e6fd(++_0x51290d);}(_0x0565,0xf2));var _0x5056=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x0565[_0x9fd887];return _0x1a54ab;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x548bcf,_0x53e98a){_0x53e98a=_0x53e98a||0xcc;return function(_0x2d44fb){if(_0x2d44fb){return _0x548bcf['sendStatus'](_0x53e98a);}return _0x548bcf[_0x5056('0x19')](_0x53e98a)[_0x5056('0x1a')]();};}function respondWithResult(_0x7af76b,_0x543cee){_0x543cee=_0x543cee||0xc8;return function(_0x1e8b64){if(_0x1e8b64){return _0x7af76b[_0x5056('0x19')](_0x543cee)[_0x5056('0x1b')](_0x1e8b64);}};}function respondWithFilteredResult(_0x56c3ef,_0x21561d){return function(_0x6a044a){if(_0x6a044a){var _0x4ac332=typeof _0x21561d[_0x5056('0x1c')]==='undefined'&&typeof _0x21561d[_0x5056('0x1d')]===_0x5056('0x1e');var _0x1c0ee9=_0x6a044a[_0x5056('0x1f')];var _0x4056ce=_0x4ac332?0x0:_0x21561d['offset'];var _0x9ea88=_0x4ac332?_0x6a044a[_0x5056('0x1f')]:_0x21561d['offset']+_0x21561d['limit'];var _0x20776c;if(_0x9ea88>=_0x1c0ee9){_0x9ea88=_0x1c0ee9;_0x20776c=0xc8;}else{_0x20776c=0xce;}_0x56c3ef[_0x5056('0x19')](_0x20776c);return _0x56c3ef[_0x5056('0x20')](_0x5056('0x21'),_0x4056ce+'-'+_0x9ea88+'/'+_0x1c0ee9)[_0x5056('0x1b')](_0x6a044a);}return null;};}function patchUpdates(_0xf04e08){return function(_0x33035c){try{jsonpatch['apply'](_0x33035c,_0xf04e08,!![]);}catch(_0x13b363){return BPromise[_0x5056('0x22')](_0x13b363);}return _0x33035c['save']();};}function saveUpdates(_0x271efc,_0x1bccef){return function(_0x2564d0){if(_0x2564d0){return _0x2564d0['update'](_0x271efc)[_0x5056('0x23')](function(_0x26a3c2){return _0x26a3c2;});}return null;};}function removeEntity(_0x5afbfe,_0x4a64be){return function(_0x29e166){if(_0x29e166){return _0x29e166[_0x5056('0x24')]()[_0x5056('0x23')](function(){_0x5afbfe[_0x5056('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x267048,_0x25409f){return function(_0x5d1656){if(!_0x5d1656){_0x267048[_0x5056('0x25')](0x194);}return _0x5d1656;};}function handleError(_0x505ccf,_0x15f03f){_0x15f03f=_0x15f03f||0x1f4;return function(_0x39d539){logger[_0x5056('0x26')](_0x39d539[_0x5056('0x27')]);if(_0x39d539[_0x5056('0x28')]){delete _0x39d539['name'];}_0x505ccf[_0x5056('0x19')](_0x15f03f)[_0x5056('0x29')](_0x39d539);};}exports[_0x5056('0x2a')]=function(_0x2ac79a,_0x53e6db){var _0x24d33e={},_0x5b0270={},_0x70246c={'count':0x0,'rows':[]};var _0x49fe67=_['map'](db['WhatsappQueueReport'][_0x5056('0x2b')],function(_0x252f75){return{'name':_0x252f75['fieldName'],'type':_0x252f75[_0x5056('0x2c')][_0x5056('0x2d')]};});_0x5b0270[_0x5056('0x2e')]=_[_0x5056('0x2f')](_0x49fe67,_0x5056('0x28'));_0x5b0270[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2ac79a[_0x5056('0x30')]);_0x5b0270[_0x5056('0x32')]=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],_0x5b0270['query']);_0x24d33e['attributes']=_[_0x5056('0x33')](_0x5b0270[_0x5056('0x2e')],qs['fields'](_0x2ac79a[_0x5056('0x30')][_0x5056('0x34')]));_0x24d33e['attributes']=_0x24d33e[_0x5056('0x35')][_0x5056('0x36')]?_0x24d33e[_0x5056('0x35')]:_0x5b0270[_0x5056('0x2e')];if(!_0x2ac79a[_0x5056('0x30')][_0x5056('0x37')](_0x5056('0x38'))){_0x24d33e[_0x5056('0x1d')]=qs[_0x5056('0x1d')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1d')]);_0x24d33e[_0x5056('0x1c')]=qs[_0x5056('0x1c')](_0x2ac79a[_0x5056('0x30')][_0x5056('0x1c')]);}_0x24d33e['order']=qs[_0x5056('0x39')](_0x2ac79a['query'][_0x5056('0x39')]);_0x24d33e[_0x5056('0x3a')]=qs[_0x5056('0x32')](_[_0x5056('0x3b')](_0x2ac79a['query'],_0x5b0270[_0x5056('0x32')]),_0x49fe67);if(_0x2ac79a[_0x5056('0x30')]['filter']){_0x24d33e[_0x5056('0x3a')]=_['merge'](_0x24d33e[_0x5056('0x3a')],{'$or':_[_0x5056('0x2f')](_0x49fe67,function(_0x3d56cf){if(_0x3d56cf['type']!==_0x5056('0x3c')){var _0x16a940={};_0x16a940[_0x3d56cf[_0x5056('0x28')]]={'$like':'%'+_0x2ac79a[_0x5056('0x30')][_0x5056('0x3d')]+'%'};return _0x16a940;}})});}_0x24d33e=_[_0x5056('0x3e')]({},_0x24d33e,_0x2ac79a[_0x5056('0x3f')]);var _0x21aa75={'where':_0x24d33e[_0x5056('0x3a')]};return db[_0x5056('0x40')][_0x5056('0x1f')](_0x21aa75)[_0x5056('0x23')](function(_0xc1024a){_0x70246c[_0x5056('0x1f')]=_0xc1024a;if(_0x2ac79a[_0x5056('0x30')][_0x5056('0x41')]){_0x24d33e['include']=[{'all':!![]}];}return db['WhatsappQueueReport'][_0x5056('0x42')](_0x24d33e);})[_0x5056('0x23')](function(_0x6946b4){_0x70246c[_0x5056('0x43')]=_0x6946b4;return _0x70246c;})[_0x5056('0x23')](respondWithFilteredResult(_0x53e6db,_0x24d33e))[_0x5056('0x44')](handleError(_0x53e6db,null));};exports[_0x5056('0x45')]=function(_0x2bf472,_0x48ab5e){var _0x58f12f={'raw':!![],'where':{'id':_0x2bf472[_0x5056('0x46')]['id']}},_0x68a385={};_0x68a385[_0x5056('0x2e')]=_['keys'](db[_0x5056('0x40')]['rawAttributes']);_0x68a385[_0x5056('0x30')]=_[_0x5056('0x31')](_0x2bf472[_0x5056('0x30')]);_0x68a385[_0x5056('0x32')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],_0x68a385['query']);_0x58f12f[_0x5056('0x35')]=_[_0x5056('0x33')](_0x68a385[_0x5056('0x2e')],qs['fields'](_0x2bf472['query']['fields']));_0x58f12f['attributes']=_0x58f12f[_0x5056('0x35')][_0x5056('0x36')]?_0x58f12f[_0x5056('0x35')]:_0x68a385[_0x5056('0x2e')];if(_0x2bf472[_0x5056('0x30')]['includeAll']){_0x58f12f['include']=[{'all':!![]}];}_0x58f12f=_[_0x5056('0x3e')]({},_0x58f12f,_0x2bf472[_0x5056('0x3f')]);return db[_0x5056('0x40')][_0x5056('0x47')](_0x58f12f)[_0x5056('0x23')](handleEntityNotFound(_0x48ab5e,null))[_0x5056('0x23')](respondWithResult(_0x48ab5e,null))[_0x5056('0x44')](handleError(_0x48ab5e,null));};exports['create']=function(_0x52d6ea,_0x14e3f5){return db[_0x5056('0x40')]['create'](_0x52d6ea[_0x5056('0x48')],{})[_0x5056('0x23')](respondWithResult(_0x14e3f5,0xc9))['catch'](handleError(_0x14e3f5,null));};exports['update']=function(_0x83d8e4,_0x1ab1a9){if(_0x83d8e4['body']['id']){delete _0x83d8e4['body']['id'];}return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0x83d8e4['params']['id']}})['then'](handleEntityNotFound(_0x1ab1a9,null))[_0x5056('0x23')](saveUpdates(_0x83d8e4[_0x5056('0x48')],null))[_0x5056('0x23')](respondWithResult(_0x1ab1a9,null))[_0x5056('0x44')](handleError(_0x1ab1a9,null));};exports[_0x5056('0x24')]=function(_0xdf427c,_0x97f7d8){return db[_0x5056('0x40')][_0x5056('0x47')]({'where':{'id':_0xdf427c[_0x5056('0x46')]['id']}})[_0x5056('0x23')](handleEntityNotFound(_0x97f7d8,null))[_0x5056('0x23')](removeEntity(_0x97f7d8,null))[_0x5056('0x44')](handleError(_0x97f7d8,null));};exports[_0x5056('0x49')]=function(_0x34e86e,_0x4bf758){return db['WhatsappQueueReport'][_0x5056('0x49')]()[_0x5056('0x23')](respondWithResult(_0x4bf758,null))[_0x5056('0x44')](handleError(_0x4bf758,null));}; \ No newline at end of file +var _0x9ffd=['model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','apply','update','then','error','name','send','map','WhatsappQueueReport','rawAttributes','fieldName','key'];(function(_0x4b2251,_0x393f10){var _0x5d22fb=function(_0x10992c){while(--_0x10992c){_0x4b2251['push'](_0x4b2251['shift']());}};_0x5d22fb(++_0x393f10);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x1f2916,_0x597f5a){_0x1f2916=_0x1f2916-0x0;var _0x56436f=_0x9ffd[_0x1f2916];return _0x56436f;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];function respondWithStatusCode(_0x47d842,_0x47b0d7){_0x47b0d7=_0x47b0d7||0xcc;return function(_0xaaf7af){if(_0xaaf7af){return _0x47d842[_0xd9ff('0x1a')](_0x47b0d7);}return _0x47d842[_0xd9ff('0x1b')](_0x47b0d7)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x12c39a,_0x556aa4){_0x556aa4=_0x556aa4||0xc8;return function(_0x2f78c1){if(_0x2f78c1){return _0x12c39a[_0xd9ff('0x1b')](_0x556aa4)['json'](_0x2f78c1);}};}function respondWithFilteredResult(_0xf14c9f,_0x5db010){return function(_0x4ffe54){if(_0x4ffe54){var _0x547e28=typeof _0x5db010['offset']===_0xd9ff('0x1d')&&typeof _0x5db010['limit']===_0xd9ff('0x1d');var _0xa30fd2=_0x4ffe54[_0xd9ff('0x1e')];var _0x3afd19=_0x547e28?0x0:_0x5db010[_0xd9ff('0x1f')];var _0x2d4df1=_0x547e28?_0x4ffe54[_0xd9ff('0x1e')]:_0x5db010[_0xd9ff('0x1f')]+_0x5db010[_0xd9ff('0x20')];var _0x1f028f;if(_0x2d4df1>=_0xa30fd2){_0x2d4df1=_0xa30fd2;_0x1f028f=0xc8;}else{_0x1f028f=0xce;}_0xf14c9f[_0xd9ff('0x1b')](_0x1f028f);return _0xf14c9f[_0xd9ff('0x21')](_0xd9ff('0x22'),_0x3afd19+'-'+_0x2d4df1+'/'+_0xa30fd2)['json'](_0x4ffe54);}return null;};}function patchUpdates(_0x4cf8ec){return function(_0x264a3d){try{jsonpatch[_0xd9ff('0x23')](_0x264a3d,_0x4cf8ec,!![]);}catch(_0x4eea4d){return BPromise['reject'](_0x4eea4d);}return _0x264a3d['save']();};}function saveUpdates(_0x4b1477,_0x1f4d9e){return function(_0x58eb5f){if(_0x58eb5f){return _0x58eb5f[_0xd9ff('0x24')](_0x4b1477)[_0xd9ff('0x25')](function(_0x291f52){return _0x291f52;});}return null;};}function removeEntity(_0x9f074e,_0x278b66){return function(_0x42a828){if(_0x42a828){return _0x42a828['destroy']()['then'](function(){_0x9f074e[_0xd9ff('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ca906,_0x4d86fe){return function(_0x285002){if(!_0x285002){_0x3ca906['sendStatus'](0x194);}return _0x285002;};}function handleError(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0x1f4;return function(_0x2138b4){logger[_0xd9ff('0x26')](_0x2138b4['stack']);if(_0x2138b4[_0xd9ff('0x27')]){delete _0x2138b4[_0xd9ff('0x27')];}_0x10cbdd[_0xd9ff('0x1b')](_0x159e56)[_0xd9ff('0x28')](_0x2138b4);};}exports['index']=function(_0x1d3684,_0x3792d9){var _0x44b5a7={},_0x45fb63={},_0x263d3a={'count':0x0,'rows':[]};var _0xe516e2=_[_0xd9ff('0x29')](db[_0xd9ff('0x2a')][_0xd9ff('0x2b')],function(_0x5706cf){return{'name':_0x5706cf[_0xd9ff('0x2c')],'type':_0x5706cf['type'][_0xd9ff('0x2d')]};});_0x45fb63[_0xd9ff('0x2e')]=_[_0xd9ff('0x29')](_0xe516e2,'name');_0x45fb63[_0xd9ff('0x2f')]=_[_0xd9ff('0x30')](_0x1d3684[_0xd9ff('0x2f')]);_0x45fb63[_0xd9ff('0x31')]=_['intersection'](_0x45fb63[_0xd9ff('0x2e')],_0x45fb63['query']);_0x44b5a7[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x45fb63[_0xd9ff('0x2e')],qs[_0xd9ff('0x34')](_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x34')]));_0x44b5a7[_0xd9ff('0x32')]=_0x44b5a7[_0xd9ff('0x32')][_0xd9ff('0x35')]?_0x44b5a7[_0xd9ff('0x32')]:_0x45fb63[_0xd9ff('0x2e')];if(!_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x36')](_0xd9ff('0x37'))){_0x44b5a7['limit']=qs[_0xd9ff('0x20')](_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x20')]);_0x44b5a7['offset']=qs[_0xd9ff('0x1f')](_0x1d3684['query'][_0xd9ff('0x1f')]);}_0x44b5a7['order']=qs[_0xd9ff('0x38')](_0x1d3684['query'][_0xd9ff('0x38')]);_0x44b5a7[_0xd9ff('0x39')]=qs[_0xd9ff('0x31')](_['pick'](_0x1d3684['query'],_0x45fb63['filters']),_0xe516e2);if(_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x3a')]){_0x44b5a7[_0xd9ff('0x39')]=_[_0xd9ff('0x3b')](_0x44b5a7[_0xd9ff('0x39')],{'$or':_[_0xd9ff('0x29')](_0xe516e2,function(_0x596d29){if(_0x596d29['type']!=='VIRTUAL'){var _0x316d93={};_0x316d93[_0x596d29[_0xd9ff('0x27')]]={'$like':'%'+_0x1d3684[_0xd9ff('0x2f')][_0xd9ff('0x3a')]+'%'};return _0x316d93;}})});}_0x44b5a7=_['merge']({},_0x44b5a7,_0x1d3684[_0xd9ff('0x3c')]);var _0x5b8e17={'where':_0x44b5a7[_0xd9ff('0x39')]};return db[_0xd9ff('0x2a')][_0xd9ff('0x1e')](_0x5b8e17)[_0xd9ff('0x25')](function(_0x59fc07){_0x263d3a[_0xd9ff('0x1e')]=_0x59fc07;if(_0x1d3684[_0xd9ff('0x2f')]['includeAll']){_0x44b5a7[_0xd9ff('0x3d')]=[{'all':!![]}];}return db[_0xd9ff('0x2a')][_0xd9ff('0x3e')](_0x44b5a7);})[_0xd9ff('0x25')](function(_0x1fe44d){_0x263d3a[_0xd9ff('0x3f')]=_0x1fe44d;return _0x263d3a;})['then'](respondWithFilteredResult(_0x3792d9,_0x44b5a7))[_0xd9ff('0x40')](handleError(_0x3792d9,null));};exports[_0xd9ff('0x41')]=function(_0x10533a,_0x39fbbb){var _0x472724={'raw':!![],'where':{'id':_0x10533a[_0xd9ff('0x42')]['id']}},_0x52aab8={};_0x52aab8[_0xd9ff('0x2e')]=_[_0xd9ff('0x30')](db['WhatsappQueueReport']['rawAttributes']);_0x52aab8[_0xd9ff('0x2f')]=_[_0xd9ff('0x30')](_0x10533a[_0xd9ff('0x2f')]);_0x52aab8[_0xd9ff('0x31')]=_[_0xd9ff('0x33')](_0x52aab8[_0xd9ff('0x2e')],_0x52aab8['query']);_0x472724[_0xd9ff('0x32')]=_[_0xd9ff('0x33')](_0x52aab8['model'],qs[_0xd9ff('0x34')](_0x10533a[_0xd9ff('0x2f')][_0xd9ff('0x34')]));_0x472724[_0xd9ff('0x32')]=_0x472724[_0xd9ff('0x32')]['length']?_0x472724['attributes']:_0x52aab8['model'];if(_0x10533a[_0xd9ff('0x2f')]['includeAll']){_0x472724[_0xd9ff('0x3d')]=[{'all':!![]}];}_0x472724=_[_0xd9ff('0x3b')]({},_0x472724,_0x10533a[_0xd9ff('0x3c')]);return db['WhatsappQueueReport'][_0xd9ff('0x43')](_0x472724)[_0xd9ff('0x25')](handleEntityNotFound(_0x39fbbb,null))['then'](respondWithResult(_0x39fbbb,null))[_0xd9ff('0x40')](handleError(_0x39fbbb,null));};exports[_0xd9ff('0x44')]=function(_0x23b224,_0x316854){return db['WhatsappQueueReport'][_0xd9ff('0x44')](_0x23b224['body'],{})[_0xd9ff('0x25')](respondWithResult(_0x316854,0xc9))['catch'](handleError(_0x316854,null));};exports[_0xd9ff('0x24')]=function(_0x3d91e6,_0x2bf37a){if(_0x3d91e6[_0xd9ff('0x45')]['id']){delete _0x3d91e6[_0xd9ff('0x45')]['id'];}return db['WhatsappQueueReport'][_0xd9ff('0x43')]({'where':{'id':_0x3d91e6[_0xd9ff('0x42')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x2bf37a,null))[_0xd9ff('0x25')](saveUpdates(_0x3d91e6['body'],null))['then'](respondWithResult(_0x2bf37a,null))['catch'](handleError(_0x2bf37a,null));};exports[_0xd9ff('0x46')]=function(_0x40be56,_0x29c6bd){return db['WhatsappQueueReport'][_0xd9ff('0x43')]({'where':{'id':_0x40be56[_0xd9ff('0x42')]['id']}})[_0xd9ff('0x25')](handleEntityNotFound(_0x29c6bd,null))[_0xd9ff('0x25')](removeEntity(_0x29c6bd,null))[_0xd9ff('0x40')](handleError(_0x29c6bd,null));};exports[_0xd9ff('0x47')]=function(_0x43a8ae,_0x1e1364){return db[_0xd9ff('0x2a')][_0xd9ff('0x47')]()[_0xd9ff('0x25')](respondWithResult(_0x1e1364,null))[_0xd9ff('0x40')](handleError(_0x1e1364,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 3dcc33c..45ed1d1 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 _0xce18=['WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports'];(function(_0x93d2f0,_0x324413){var _0x44dc81=function(_0x746fdf){while(--_0x746fdf){_0x93d2f0['push'](_0x93d2f0['shift']());}};_0x44dc81(++_0x324413);}(_0xce18,0x65));var _0x8ce1=function(_0x3b2bc5,_0x531464){_0x3b2bc5=_0x3b2bc5-0x0;var _0x53a070=_0xce18[_0x3b2bc5];return _0x53a070;};'use strict';var _=require(_0x8ce1('0x0'));var util=require('util');var logger=require(_0x8ce1('0x1'))(_0x8ce1('0x2'));var moment=require(_0x8ce1('0x3'));var BPromise=require(_0x8ce1('0x4'));var rp=require(_0x8ce1('0x5'));var fs=require('fs');var path=require(_0x8ce1('0x6'));var rimraf=require(_0x8ce1('0x7'));var config=require(_0x8ce1('0x8'));var attributes=require(_0x8ce1('0x9'));module[_0x8ce1('0xa')]=function(_0x51d949,_0x1d3908){return _0x51d949['define'](_0x8ce1('0xb'),attributes,{'tableName':_0x8ce1('0xc'),'paranoid':![],'indexes':[{'name':_0x8ce1('0xd'),'fields':[_0x8ce1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd7e=['./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','util','api','bluebird','path','rimraf'];(function(_0x28496e,_0x1c5e82){var _0x1e5334=function(_0x4965c8){while(--_0x4965c8){_0x28496e['push'](_0x28496e['shift']());}};_0x1e5334(++_0x1c5e82);}(_0xcd7e,0x150));var _0xecd7=function(_0x2cc8bb,_0x5f2607){_0x2cc8bb=_0x2cc8bb-0x0;var _0x140e40=_0xcd7e[_0x2cc8bb];return _0x140e40;};'use strict';var _=require('lodash');var util=require(_0xecd7('0x0'));var logger=require('../../config/logger')(_0xecd7('0x1'));var moment=require('moment');var BPromise=require(_0xecd7('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xecd7('0x3'));var rimraf=require(_0xecd7('0x4'));var config=require('../../config/environment');var attributes=require(_0xecd7('0x5'));module[_0xecd7('0x6')]=function(_0x1fb0b5,_0x2dd6d4){return _0x1fb0b5[_0xecd7('0x7')](_0xecd7('0x8'),attributes,{'tableName':_0xecd7('0x9'),'paranoid':![],'indexes':[{'name':_0xecd7('0xa'),'fields':[_0xecd7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index e687f49..4fd9c24 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 _0x4d82=['raw','stringify','catch','UpdateWhatsappQueueReport','WhatsappQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','message','info','result','CreateWhatsappQueueReport','create','body','options'];(function(_0x25e775,_0x130383){var _0x32af10=function(_0x1c3bad){while(--_0x1c3bad){_0x25e775['push'](_0x25e775['shift']());}};_0x32af10(++_0x130383);}(_0x4d82,0x1e9));var _0x24d8=function(_0x51be7f,_0xd159f3){_0x51be7f=_0x51be7f-0x0;var _0x58f88c=_0x4d82[_0x51be7f];return _0x58f88c;};'use strict';var _=require(_0x24d8('0x0'));var util=require('util');var moment=require(_0x24d8('0x1'));var BPromise=require(_0x24d8('0x2'));var rs=require(_0x24d8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24d8('0x4'))['db'];var utils=require(_0x24d8('0x5'));var logger=require('../../config/logger')(_0x24d8('0x6'));var config=require(_0x24d8('0x7'));var jayson=require(_0x24d8('0x8'));var client=jayson[_0x24d8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x265b4f,_0x5039df,_0xb562af){return new BPromise(function(_0x2002e4,_0x33bee1){return client[_0x24d8('0xa')](_0x265b4f,_0xb562af)[_0x24d8('0xb')](function(_0x24a415){logger['info'](_0x24d8('0xc'),_0x5039df,_0x24d8('0xd'));logger[_0x24d8('0xe')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x5039df,_0x24d8('0xd'),JSON['stringify'](_0x24a415));if(_0x24a415[_0x24d8('0xf')]){if(_0x24a415[_0x24d8('0xf')]['code']===0x1f4){logger[_0x24d8('0xf')](_0x24d8('0xc'),_0x5039df,_0x24a415['error']['message']);return _0x33bee1(_0x24a415['error']['message']);}logger[_0x24d8('0xf')](_0x24d8('0xc'),_0x5039df,_0x24a415['error'][_0x24d8('0x10')]);return _0x2002e4(_0x24a415['error'][_0x24d8('0x10')]);}else{logger[_0x24d8('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x5039df,_0x24d8('0xd'));_0x2002e4(_0x24a415[_0x24d8('0x12')][_0x24d8('0x10')]);}})['catch'](function(_0x582914){logger[_0x24d8('0xf')](_0x24d8('0xc'),_0x5039df,_0x582914);_0x33bee1(_0x582914);});});}exports[_0x24d8('0x13')]=function(_0x471fab){var _0xf7a614=this;return new Promise(function(_0x1425e0,_0x175503){return db['WhatsappQueueReport'][_0x24d8('0x14')](_0x471fab[_0x24d8('0x15')],{'raw':_0x471fab['options']?_0x471fab[_0x24d8('0x16')][_0x24d8('0x17')]===undefined?!![]:![]:!![]})[_0x24d8('0xb')](function(_0x5722ac){logger[_0x24d8('0x11')](_0x24d8('0x13'),_0x471fab);logger[_0x24d8('0xe')](_0x24d8('0x13'),_0x471fab,JSON[_0x24d8('0x18')](_0x5722ac));_0x1425e0(_0x5722ac);})[_0x24d8('0x19')](function(_0x4f3cf7){logger[_0x24d8('0xf')]('CreateWhatsappQueueReport',_0x4f3cf7[_0x24d8('0x10')],_0x471fab);_0x175503(_0xf7a614[_0x24d8('0xf')](0x1f4,_0x4f3cf7['message']));});});};exports[_0x24d8('0x1a')]=function(_0x1fc6c2){var _0x58c1fb=this;return new Promise(function(_0x4c3ffb,_0x35822f){return db[_0x24d8('0x1b')][_0x24d8('0x1c')](_0x1fc6c2[_0x24d8('0x15')],{'raw':_0x1fc6c2['options']?_0x1fc6c2[_0x24d8('0x16')][_0x24d8('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fc6c2[_0x24d8('0x16')]?_0x1fc6c2[_0x24d8('0x16')][_0x24d8('0x1d')]||null:null,'attributes':_0x1fc6c2[_0x24d8('0x16')]?_0x1fc6c2[_0x24d8('0x16')][_0x24d8('0x1e')]||null:null,'limit':_0x1fc6c2[_0x24d8('0x16')]?_0x1fc6c2[_0x24d8('0x16')][_0x24d8('0x1f')]||null:null})['then'](function(_0x1fffe3){logger[_0x24d8('0x11')]('UpdateWhatsappQueueReport',_0x1fc6c2);logger[_0x24d8('0xe')](_0x24d8('0x1a'),_0x1fc6c2,JSON['stringify'](_0x1fffe3));_0x4c3ffb(_0x1fffe3);})['catch'](function(_0x38ae33){logger[_0x24d8('0xf')](_0x24d8('0x1a'),_0x38ae33[_0x24d8('0x10')],_0x1fc6c2);_0x35822f(_0x58c1fb[_0x24d8('0xf')](0x1f4,_0x38ae33['message']));});});}; \ No newline at end of file +var _0x7882=['stringify','UpdateWhatsappQueueReport','where','limit','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','then'];(function(_0x7fac60,_0x2cb009){var _0x5bcfac=function(_0x15da63){while(--_0x15da63){_0x7fac60['push'](_0x7fac60['shift']());}};_0x5bcfac(++_0x2cb009);}(_0x7882,0x184));var _0x2788=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x7882[_0x1db831];return _0x39ba56;};'use strict';var _=require(_0x2788('0x0'));var util=require(_0x2788('0x1'));var moment=require(_0x2788('0x2'));var BPromise=require(_0x2788('0x3'));var rs=require(_0x2788('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2788('0x5'));var logger=require(_0x2788('0x6'))(_0x2788('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2788('0x8')][_0x2788('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547f3a,_0xf53f4c,_0x56da91){return new BPromise(function(_0x2162c0,_0x3f858e){return client[_0x2788('0xa')](_0x547f3a,_0x56da91)['then'](function(_0x59974c){logger[_0x2788('0xb')](_0x2788('0xc'),_0xf53f4c,_0x2788('0xd'));logger[_0x2788('0xe')](_0x2788('0xf'),_0xf53f4c,'request\x20sent',JSON['stringify'](_0x59974c));if(_0x59974c[_0x2788('0x10')]){if(_0x59974c['error'][_0x2788('0x11')]===0x1f4){logger['error'](_0x2788('0xc'),_0xf53f4c,_0x59974c[_0x2788('0x10')][_0x2788('0x12')]);return _0x3f858e(_0x59974c['error'][_0x2788('0x12')]);}logger['error'](_0x2788('0xc'),_0xf53f4c,_0x59974c[_0x2788('0x10')]['message']);return _0x2162c0(_0x59974c[_0x2788('0x10')][_0x2788('0x12')]);}else{logger[_0x2788('0xb')](_0x2788('0xc'),_0xf53f4c,'request\x20sent');_0x2162c0(_0x59974c[_0x2788('0x13')][_0x2788('0x12')]);}})[_0x2788('0x14')](function(_0x1731cd){logger['error'](_0x2788('0xc'),_0xf53f4c,_0x1731cd);_0x3f858e(_0x1731cd);});});}exports[_0x2788('0x15')]=function(_0x2b749f){var _0x4c3e3a=this;return new Promise(function(_0x10fb0b,_0x237c37){return db[_0x2788('0x16')][_0x2788('0x17')](_0x2b749f[_0x2788('0x18')],{'raw':_0x2b749f[_0x2788('0x19')]?_0x2b749f['options'][_0x2788('0x1a')]===undefined?!![]:![]:!![]})[_0x2788('0x1b')](function(_0x29ad92){logger[_0x2788('0xb')](_0x2788('0x15'),_0x2b749f);logger['debug']('CreateWhatsappQueueReport',_0x2b749f,JSON[_0x2788('0x1c')](_0x29ad92));_0x10fb0b(_0x29ad92);})[_0x2788('0x14')](function(_0x3ffb43){logger[_0x2788('0x10')](_0x2788('0x15'),_0x3ffb43[_0x2788('0x12')],_0x2b749f);_0x237c37(_0x4c3e3a['error'](0x1f4,_0x3ffb43[_0x2788('0x12')]));});});};exports[_0x2788('0x1d')]=function(_0x22a14a){var _0x259b27=this;return new Promise(function(_0x278884,_0x52df05){return db['WhatsappQueueReport']['update'](_0x22a14a[_0x2788('0x18')],{'raw':_0x22a14a['options']?_0x22a14a[_0x2788('0x19')][_0x2788('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22a14a[_0x2788('0x19')]?_0x22a14a[_0x2788('0x19')][_0x2788('0x1e')]||null:null,'attributes':_0x22a14a[_0x2788('0x19')]?_0x22a14a['options']['attributes']||null:null,'limit':_0x22a14a['options']?_0x22a14a[_0x2788('0x19')][_0x2788('0x1f')]||null:null})['then'](function(_0x4889d1){logger['info'](_0x2788('0x1d'),_0x22a14a);logger[_0x2788('0xe')](_0x2788('0x1d'),_0x22a14a,JSON['stringify'](_0x4889d1));_0x278884(_0x4889d1);})[_0x2788('0x14')](function(_0x5d660d){logger[_0x2788('0x10')](_0x2788('0x1d'),_0x5d660d[_0x2788('0x12')],_0x22a14a);_0x52df05(_0x259b27[_0x2788('0x10')](0x1f4,_0x5d660d[_0x2788('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index de571c8..444b1bc 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 _0xba4a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x45adaf,_0x21c3c1){var _0x15d189=function(_0x48dc43){while(--_0x48dc43){_0x45adaf['push'](_0x45adaf['shift']());}};_0x15d189(++_0x21c3c1);}(_0xba4a,0x120));var _0xaba4=function(_0x32d31b,_0x633459){_0x32d31b=_0x32d31b-0x0;var _0x178b31=_0xba4a[_0x32d31b];return _0x178b31;};'use strict';var multer=require(_0xaba4('0x0'));var util=require(_0xaba4('0x1'));var path=require(_0xaba4('0x2'));var timeout=require(_0xaba4('0x3'));var express=require(_0xaba4('0x4'));var router=express[_0xaba4('0x5')]();var fs_extra=require(_0xaba4('0x6'));var auth=require(_0xaba4('0x7'));var interaction=require(_0xaba4('0x8'));var config=require(_0xaba4('0x9'));var controller=require('./whatsappTransferReport.controller');router[_0xaba4('0xa')]('/',auth[_0xaba4('0xb')](),controller[_0xaba4('0xc')]);router[_0xaba4('0xa')](_0xaba4('0xd'),auth[_0xaba4('0xb')](),controller['describe']);router[_0xaba4('0xa')](_0xaba4('0xe'),auth['isAuthenticated'](),controller[_0xaba4('0xf')]);router[_0xaba4('0x10')]('/',auth[_0xaba4('0xb')](),controller[_0xaba4('0x11')]);router['put'](_0xaba4('0xe'),auth[_0xaba4('0xb')](),controller[_0xaba4('0x12')]);router['delete'](_0xaba4('0xe'),auth['isAuthenticated'](),controller[_0xaba4('0x13')]);module[_0xaba4('0x14')]=router; \ No newline at end of file +var _0x9e1a=['fs-extra','../../components/interaction/service','./whatsappTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','connect-timeout','express'];(function(_0x1265ed,_0x4b85e8){var _0x5ac459=function(_0xf0c114){while(--_0xf0c114){_0x1265ed['push'](_0x1265ed['shift']());}};_0x5ac459(++_0x4b85e8);}(_0x9e1a,0x1c8));var _0xa9e1=function(_0x38deb8,_0x572466){_0x38deb8=_0x38deb8-0x0;var _0xae0a3b=_0x9e1a[_0x38deb8];return _0xae0a3b;};'use strict';var multer=require(_0xa9e1('0x0'));var util=require(_0xa9e1('0x1'));var path=require('path');var timeout=require(_0xa9e1('0x2'));var express=require(_0xa9e1('0x3'));var router=express['Router']();var fs_extra=require(_0xa9e1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa9e1('0x5'));var config=require('../../config/environment');var controller=require(_0xa9e1('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xa9e1('0x7')]);router[_0xa9e1('0x8')](_0xa9e1('0x9'),auth[_0xa9e1('0xa')](),controller[_0xa9e1('0xb')]);router[_0xa9e1('0x8')](_0xa9e1('0xc'),auth[_0xa9e1('0xa')](),controller[_0xa9e1('0xd')]);router[_0xa9e1('0xe')]('/',auth['isAuthenticated'](),controller[_0xa9e1('0xf')]);router[_0xa9e1('0x10')](_0xa9e1('0xc'),auth[_0xa9e1('0xa')](),controller[_0xa9e1('0x11')]);router['delete'](_0xa9e1('0xc'),auth[_0xa9e1('0xa')](),controller[_0xa9e1('0x12')]);module[_0xa9e1('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index b1b1f17..bfc278e 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 _0xf4f4=['agent','queue','DATE','sequelize','exports','ENUM','account'];(function(_0x8b026d,_0x47f300){var _0x2361b2=function(_0x4b179c){while(--_0x4b179c){_0x8b026d['push'](_0x8b026d['shift']());}};_0x2361b2(++_0x47f300);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x304600,_0x4ecdfe){_0x304600=_0x304600-0x0;var _0x337878=_0xf4f4[_0x304600];return _0x337878;};'use strict';var Sequelize=require(_0x4f4f('0x0'));module[_0x4f4f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4f4f('0x2')](_0x4f4f('0x3'),_0x4f4f('0x4'),_0x4f4f('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4f4f('0x6')]}}; \ No newline at end of file +var _0x4959=['STRING','ENUM','account','queue','DATE'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4959,0x9b));var _0x9495=function(_0x335575,_0x47fe74){_0x335575=_0x335575-0x0;var _0x8ac286=_0x4959[_0x335575];return _0x8ac286;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x9495('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x9495('0x1')](_0x9495('0x2'),'agent',_0x9495('0x3')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x9495('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 3e87743..efb74c3 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 _0xf17b=['name','send','index','WhatsappTransferReport','fieldName','key','map','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','body','params','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','stack'];(function(_0x5b7838,_0x40aadd){var _0x4c13e6=function(_0x33d0f5){while(--_0x33d0f5){_0x5b7838['push'](_0x5b7838['shift']());}};_0x4c13e6(++_0x40aadd);}(_0xf17b,0x13e));var _0xbf17=function(_0x43941d,_0x45fd0d){_0x43941d=_0x43941d-0x0;var _0x27b82a=_0xf17b[_0x43941d];return _0x27b82a;};'use strict';var emlformat=require(_0xbf17('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbf17('0x1'));var rp=require(_0xbf17('0x2'));var moment=require('moment');var BPromise=require(_0xbf17('0x3'));var Mustache=require(_0xbf17('0x4'));var util=require(_0xbf17('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xbf17('0x6'));var ejs=require(_0xbf17('0x7'));var fs=require('fs');var fs_extra=require(_0xbf17('0x8'));var _=require(_0xbf17('0x9'));var squel=require(_0xbf17('0xa'));var crypto=require(_0xbf17('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbf17('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf17('0xd'));var Redis=require('ioredis');var authService=require(_0xbf17('0xe'));var qs=require(_0xbf17('0xf'));var as=require(_0xbf17('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf17('0x11'));var utils=require(_0xbf17('0x12'));var config=require(_0xbf17('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf17('0x14'))['db'];function respondWithStatusCode(_0x4231ce,_0x3614f5){_0x3614f5=_0x3614f5||0xcc;return function(_0x4a8021){if(_0x4a8021){return _0x4231ce[_0xbf17('0x15')](_0x3614f5);}return _0x4231ce[_0xbf17('0x16')](_0x3614f5)[_0xbf17('0x17')]();};}function respondWithResult(_0x27a0c8,_0x4334f9){_0x4334f9=_0x4334f9||0xc8;return function(_0x27eafb){if(_0x27eafb){return _0x27a0c8['status'](_0x4334f9)[_0xbf17('0x18')](_0x27eafb);}};}function respondWithFilteredResult(_0x217870,_0x34df22){return function(_0xc58cb5){if(_0xc58cb5){var _0x42f190=typeof _0x34df22[_0xbf17('0x19')]===_0xbf17('0x1a')&&typeof _0x34df22[_0xbf17('0x1b')]==='undefined';var _0x408ed6=_0xc58cb5['count'];var _0xc38d73=_0x42f190?0x0:_0x34df22[_0xbf17('0x19')];var _0x4b243f=_0x42f190?_0xc58cb5[_0xbf17('0x1c')]:_0x34df22['offset']+_0x34df22[_0xbf17('0x1b')];var _0x379396;if(_0x4b243f>=_0x408ed6){_0x4b243f=_0x408ed6;_0x379396=0xc8;}else{_0x379396=0xce;}_0x217870[_0xbf17('0x16')](_0x379396);return _0x217870[_0xbf17('0x1d')](_0xbf17('0x1e'),_0xc38d73+'-'+_0x4b243f+'/'+_0x408ed6)[_0xbf17('0x18')](_0xc58cb5);}return null;};}function patchUpdates(_0x5708c4){return function(_0x5ef862){try{jsonpatch[_0xbf17('0x1f')](_0x5ef862,_0x5708c4,!![]);}catch(_0x4549e9){return BPromise[_0xbf17('0x20')](_0x4549e9);}return _0x5ef862['save']();};}function saveUpdates(_0x4afe22,_0xed0abc){return function(_0x2db5c2){if(_0x2db5c2){return _0x2db5c2[_0xbf17('0x21')](_0x4afe22)['then'](function(_0x371c5f){return _0x371c5f;});}return null;};}function removeEntity(_0x49ea22,_0x97dec5){return function(_0x130b09){if(_0x130b09){return _0x130b09[_0xbf17('0x22')]()[_0xbf17('0x23')](function(){_0x49ea22[_0xbf17('0x16')](0xcc)[_0xbf17('0x17')]();});}};}function handleEntityNotFound(_0x920323,_0x39c0bf){return function(_0x1289ed){if(!_0x1289ed){_0x920323[_0xbf17('0x15')](0x194);}return _0x1289ed;};}function handleError(_0x5a18cd,_0x1898ed){_0x1898ed=_0x1898ed||0x1f4;return function(_0x2d17eb){logger['error'](_0x2d17eb[_0xbf17('0x24')]);if(_0x2d17eb[_0xbf17('0x25')]){delete _0x2d17eb[_0xbf17('0x25')];}_0x5a18cd[_0xbf17('0x16')](_0x1898ed)[_0xbf17('0x26')](_0x2d17eb);};}exports[_0xbf17('0x27')]=function(_0x2ee4ee,_0x16c9fc){var _0x51899b={},_0x3359da={},_0x126c87={'count':0x0,'rows':[]};var _0xca9415=_['map'](db[_0xbf17('0x28')]['rawAttributes'],function(_0x1cc40e){return{'name':_0x1cc40e[_0xbf17('0x29')],'type':_0x1cc40e['type'][_0xbf17('0x2a')]};});_0x3359da['model']=_[_0xbf17('0x2b')](_0xca9415,_0xbf17('0x25'));_0x3359da[_0xbf17('0x2c')]=_[_0xbf17('0x2d')](_0x2ee4ee[_0xbf17('0x2c')]);_0x3359da['filters']=_[_0xbf17('0x2e')](_0x3359da[_0xbf17('0x2f')],_0x3359da[_0xbf17('0x2c')]);_0x51899b['attributes']=_[_0xbf17('0x2e')](_0x3359da['model'],qs[_0xbf17('0x30')](_0x2ee4ee[_0xbf17('0x2c')][_0xbf17('0x30')]));_0x51899b['attributes']=_0x51899b[_0xbf17('0x31')]['length']?_0x51899b[_0xbf17('0x31')]:_0x3359da['model'];if(!_0x2ee4ee[_0xbf17('0x2c')][_0xbf17('0x32')](_0xbf17('0x33'))){_0x51899b[_0xbf17('0x1b')]=qs[_0xbf17('0x1b')](_0x2ee4ee['query'][_0xbf17('0x1b')]);_0x51899b['offset']=qs[_0xbf17('0x19')](_0x2ee4ee[_0xbf17('0x2c')][_0xbf17('0x19')]);}_0x51899b[_0xbf17('0x34')]=qs[_0xbf17('0x35')](_0x2ee4ee[_0xbf17('0x2c')][_0xbf17('0x35')]);_0x51899b[_0xbf17('0x36')]=qs['filters'](_[_0xbf17('0x37')](_0x2ee4ee[_0xbf17('0x2c')],_0x3359da[_0xbf17('0x38')]),_0xca9415);if(_0x2ee4ee[_0xbf17('0x2c')][_0xbf17('0x39')]){_0x51899b[_0xbf17('0x36')]=_[_0xbf17('0x3a')](_0x51899b[_0xbf17('0x36')],{'$or':_[_0xbf17('0x2b')](_0xca9415,function(_0x449964){if(_0x449964[_0xbf17('0x3b')]!==_0xbf17('0x3c')){var _0x2a4bb0={};_0x2a4bb0[_0x449964[_0xbf17('0x25')]]={'$like':'%'+_0x2ee4ee[_0xbf17('0x2c')][_0xbf17('0x39')]+'%'};return _0x2a4bb0;}})});}_0x51899b=_['merge']({},_0x51899b,_0x2ee4ee[_0xbf17('0x3d')]);var _0x300f2f={'where':_0x51899b[_0xbf17('0x36')]};return db[_0xbf17('0x28')][_0xbf17('0x1c')](_0x300f2f)[_0xbf17('0x23')](function(_0x2842c7){_0x126c87['count']=_0x2842c7;if(_0x2ee4ee[_0xbf17('0x2c')][_0xbf17('0x3e')]){_0x51899b['include']=[{'all':!![]}];}return db[_0xbf17('0x28')][_0xbf17('0x3f')](_0x51899b);})[_0xbf17('0x23')](function(_0x342edb){_0x126c87[_0xbf17('0x40')]=_0x342edb;return _0x126c87;})['then'](respondWithFilteredResult(_0x16c9fc,_0x51899b))[_0xbf17('0x41')](handleError(_0x16c9fc,null));};exports['show']=function(_0x3ae32e,_0x303bfe){var _0x210d31={'raw':!![],'where':{'id':_0x3ae32e['params']['id']}},_0x431f05={};_0x431f05[_0xbf17('0x2f')]=_[_0xbf17('0x2d')](db['WhatsappTransferReport']['rawAttributes']);_0x431f05[_0xbf17('0x2c')]=_[_0xbf17('0x2d')](_0x3ae32e['query']);_0x431f05[_0xbf17('0x38')]=_[_0xbf17('0x2e')](_0x431f05[_0xbf17('0x2f')],_0x431f05['query']);_0x210d31[_0xbf17('0x31')]=_[_0xbf17('0x2e')](_0x431f05['model'],qs['fields'](_0x3ae32e[_0xbf17('0x2c')][_0xbf17('0x30')]));_0x210d31[_0xbf17('0x31')]=_0x210d31[_0xbf17('0x31')]['length']?_0x210d31[_0xbf17('0x31')]:_0x431f05[_0xbf17('0x2f')];if(_0x3ae32e[_0xbf17('0x2c')][_0xbf17('0x3e')]){_0x210d31[_0xbf17('0x42')]=[{'all':!![]}];}_0x210d31=_['merge']({},_0x210d31,_0x3ae32e[_0xbf17('0x3d')]);return db[_0xbf17('0x28')][_0xbf17('0x43')](_0x210d31)[_0xbf17('0x23')](handleEntityNotFound(_0x303bfe,null))[_0xbf17('0x23')](respondWithResult(_0x303bfe,null))[_0xbf17('0x41')](handleError(_0x303bfe,null));};exports['create']=function(_0x3e61e9,_0x137f14){return db[_0xbf17('0x28')]['create'](_0x3e61e9[_0xbf17('0x44')],{})[_0xbf17('0x23')](respondWithResult(_0x137f14,0xc9))[_0xbf17('0x41')](handleError(_0x137f14,null));};exports[_0xbf17('0x21')]=function(_0x34a9bf,_0x574fde){if(_0x34a9bf[_0xbf17('0x44')]['id']){delete _0x34a9bf[_0xbf17('0x44')]['id'];}return db[_0xbf17('0x28')][_0xbf17('0x43')]({'where':{'id':_0x34a9bf[_0xbf17('0x45')]['id']}})[_0xbf17('0x23')](handleEntityNotFound(_0x574fde,null))[_0xbf17('0x23')](saveUpdates(_0x34a9bf['body'],null))[_0xbf17('0x23')](respondWithResult(_0x574fde,null))[_0xbf17('0x41')](handleError(_0x574fde,null));};exports[_0xbf17('0x22')]=function(_0x15dd61,_0x286cad){return db['WhatsappTransferReport'][_0xbf17('0x43')]({'where':{'id':_0x15dd61[_0xbf17('0x45')]['id']}})[_0xbf17('0x23')](handleEntityNotFound(_0x286cad,null))[_0xbf17('0x23')](removeEntity(_0x286cad,null))[_0xbf17('0x41')](handleError(_0x286cad,null));};exports[_0xbf17('0x46')]=function(_0x38da55,_0x5db96f){return db[_0xbf17('0x28')]['describe']()[_0xbf17('0x23')](respondWithResult(_0x5db96f,null))[_0xbf17('0x41')](handleError(_0x5db96f,null));}; \ No newline at end of file +var _0xdeff=['status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','stack','name','index','WhatsappTransferReport','rawAttributes','type','key','model','map','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','show','params','length','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x25adba,_0x4d7fe6){var _0x34fd87=function(_0x44df43){while(--_0x44df43){_0x25adba['push'](_0x25adba['shift']());}};_0x34fd87(++_0x4d7fe6);}(_0xdeff,0x151));var _0xfdef=function(_0x4605dc,_0x3f7ae5){_0x4605dc=_0x4605dc-0x0;var _0x5d3e81=_0xdeff[_0x4605dc];return _0x5d3e81;};'use strict';var emlformat=require(_0xfdef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfdef('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfdef('0x2'));var moment=require('moment');var BPromise=require(_0xfdef('0x3'));var Mustache=require('mustache');var util=require(_0xfdef('0x4'));var path=require(_0xfdef('0x5'));var sox=require(_0xfdef('0x6'));var csv=require(_0xfdef('0x7'));var ejs=require(_0xfdef('0x8'));var fs=require('fs');var fs_extra=require(_0xfdef('0x9'));var _=require('lodash');var squel=require(_0xfdef('0xa'));var crypto=require(_0xfdef('0xb'));var jsforce=require(_0xfdef('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xfdef('0x7'));var querystring=require('querystring');var Papa=require(_0xfdef('0xd'));var Redis=require(_0xfdef('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xfdef('0xf'));var as=require(_0xfdef('0x10'));var hardwareService=require(_0xfdef('0x11'));var logger=require(_0xfdef('0x12'))(_0xfdef('0x13'));var utils=require('../../config/utils');var config=require(_0xfdef('0x14'));var licenseUtil=require(_0xfdef('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3f21,_0x1b012a){_0x1b012a=_0x1b012a||0xcc;return function(_0x40e629){if(_0x40e629){return _0x5e3f21[_0xfdef('0x16')](_0x1b012a);}return _0x5e3f21[_0xfdef('0x17')](_0x1b012a)[_0xfdef('0x18')]();};}function respondWithResult(_0x3e521d,_0x3ec5e2){_0x3ec5e2=_0x3ec5e2||0xc8;return function(_0x1dcf30){if(_0x1dcf30){return _0x3e521d[_0xfdef('0x17')](_0x3ec5e2)[_0xfdef('0x19')](_0x1dcf30);}};}function respondWithFilteredResult(_0x2baf5c,_0x1c8ec2){return function(_0x228344){if(_0x228344){var _0x2c90a6=typeof _0x1c8ec2['offset']===_0xfdef('0x1a')&&typeof _0x1c8ec2[_0xfdef('0x1b')]==='undefined';var _0x2c5c7c=_0x228344[_0xfdef('0x1c')];var _0x546ee9=_0x2c90a6?0x0:_0x1c8ec2[_0xfdef('0x1d')];var _0x4d27cb=_0x2c90a6?_0x228344[_0xfdef('0x1c')]:_0x1c8ec2[_0xfdef('0x1d')]+_0x1c8ec2[_0xfdef('0x1b')];var _0x30f5a9;if(_0x4d27cb>=_0x2c5c7c){_0x4d27cb=_0x2c5c7c;_0x30f5a9=0xc8;}else{_0x30f5a9=0xce;}_0x2baf5c[_0xfdef('0x17')](_0x30f5a9);return _0x2baf5c[_0xfdef('0x1e')](_0xfdef('0x1f'),_0x546ee9+'-'+_0x4d27cb+'/'+_0x2c5c7c)[_0xfdef('0x19')](_0x228344);}return null;};}function patchUpdates(_0x10bfe8){return function(_0x1abbdf){try{jsonpatch[_0xfdef('0x20')](_0x1abbdf,_0x10bfe8,!![]);}catch(_0x22d56c){return BPromise['reject'](_0x22d56c);}return _0x1abbdf['save']();};}function saveUpdates(_0x3f8b17,_0x3c5279){return function(_0x1804ed){if(_0x1804ed){return _0x1804ed[_0xfdef('0x21')](_0x3f8b17)[_0xfdef('0x22')](function(_0x5f2402){return _0x5f2402;});}return null;};}function removeEntity(_0xe009be,_0x467b58){return function(_0x511340){if(_0x511340){return _0x511340[_0xfdef('0x23')]()['then'](function(){_0xe009be['status'](0xcc)[_0xfdef('0x18')]();});}};}function handleEntityNotFound(_0x5a9f4c,_0x40361f){return function(_0x1fdca3){if(!_0x1fdca3){_0x5a9f4c[_0xfdef('0x16')](0x194);}return _0x1fdca3;};}function handleError(_0x355fec,_0x4fd454){_0x4fd454=_0x4fd454||0x1f4;return function(_0xfe4a40){logger[_0xfdef('0x24')](_0xfe4a40[_0xfdef('0x25')]);if(_0xfe4a40[_0xfdef('0x26')]){delete _0xfe4a40[_0xfdef('0x26')];}_0x355fec[_0xfdef('0x17')](_0x4fd454)['send'](_0xfe4a40);};}exports[_0xfdef('0x27')]=function(_0x5ed5c0,_0x59f831){var _0x4dbcf7={},_0x2f90c5={},_0x3448a1={'count':0x0,'rows':[]};var _0xace958=_['map'](db[_0xfdef('0x28')][_0xfdef('0x29')],function(_0x1d852d){return{'name':_0x1d852d['fieldName'],'type':_0x1d852d[_0xfdef('0x2a')][_0xfdef('0x2b')]};});_0x2f90c5[_0xfdef('0x2c')]=_[_0xfdef('0x2d')](_0xace958,_0xfdef('0x26'));_0x2f90c5['query']=_[_0xfdef('0x2e')](_0x5ed5c0['query']);_0x2f90c5[_0xfdef('0x2f')]=_[_0xfdef('0x30')](_0x2f90c5[_0xfdef('0x2c')],_0x2f90c5[_0xfdef('0x31')]);_0x4dbcf7[_0xfdef('0x32')]=_[_0xfdef('0x30')](_0x2f90c5['model'],qs['fields'](_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x33')]));_0x4dbcf7[_0xfdef('0x32')]=_0x4dbcf7[_0xfdef('0x32')]['length']?_0x4dbcf7['attributes']:_0x2f90c5['model'];if(!_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x34')](_0xfdef('0x35'))){_0x4dbcf7[_0xfdef('0x1b')]=qs[_0xfdef('0x1b')](_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x1b')]);_0x4dbcf7[_0xfdef('0x1d')]=qs['offset'](_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x1d')]);}_0x4dbcf7[_0xfdef('0x36')]=qs[_0xfdef('0x37')](_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x37')]);_0x4dbcf7[_0xfdef('0x38')]=qs[_0xfdef('0x2f')](_[_0xfdef('0x39')](_0x5ed5c0[_0xfdef('0x31')],_0x2f90c5[_0xfdef('0x2f')]),_0xace958);if(_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x3a')]){_0x4dbcf7[_0xfdef('0x38')]=_['merge'](_0x4dbcf7[_0xfdef('0x38')],{'$or':_[_0xfdef('0x2d')](_0xace958,function(_0x1dc801){if(_0x1dc801[_0xfdef('0x2a')]!==_0xfdef('0x3b')){var _0x4eb1aa={};_0x4eb1aa[_0x1dc801[_0xfdef('0x26')]]={'$like':'%'+_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x3a')]+'%'};return _0x4eb1aa;}})});}_0x4dbcf7=_[_0xfdef('0x3c')]({},_0x4dbcf7,_0x5ed5c0[_0xfdef('0x3d')]);var _0x316a61={'where':_0x4dbcf7[_0xfdef('0x38')]};return db['WhatsappTransferReport']['count'](_0x316a61)['then'](function(_0x5814ee){_0x3448a1['count']=_0x5814ee;if(_0x5ed5c0[_0xfdef('0x31')][_0xfdef('0x3e')]){_0x4dbcf7[_0xfdef('0x3f')]=[{'all':!![]}];}return db[_0xfdef('0x28')]['findAll'](_0x4dbcf7);})[_0xfdef('0x22')](function(_0x2aaef4){_0x3448a1['rows']=_0x2aaef4;return _0x3448a1;})['then'](respondWithFilteredResult(_0x59f831,_0x4dbcf7))[_0xfdef('0x40')](handleError(_0x59f831,null));};exports[_0xfdef('0x41')]=function(_0x1ac690,_0x2e0e15){var _0x3c5e37={'raw':!![],'where':{'id':_0x1ac690[_0xfdef('0x42')]['id']}},_0x1fd5bc={};_0x1fd5bc['model']=_[_0xfdef('0x2e')](db[_0xfdef('0x28')][_0xfdef('0x29')]);_0x1fd5bc[_0xfdef('0x31')]=_[_0xfdef('0x2e')](_0x1ac690[_0xfdef('0x31')]);_0x1fd5bc[_0xfdef('0x2f')]=_[_0xfdef('0x30')](_0x1fd5bc['model'],_0x1fd5bc[_0xfdef('0x31')]);_0x3c5e37[_0xfdef('0x32')]=_[_0xfdef('0x30')](_0x1fd5bc[_0xfdef('0x2c')],qs[_0xfdef('0x33')](_0x1ac690[_0xfdef('0x31')]['fields']));_0x3c5e37['attributes']=_0x3c5e37[_0xfdef('0x32')][_0xfdef('0x43')]?_0x3c5e37['attributes']:_0x1fd5bc[_0xfdef('0x2c')];if(_0x1ac690[_0xfdef('0x31')]['includeAll']){_0x3c5e37[_0xfdef('0x3f')]=[{'all':!![]}];}_0x3c5e37=_[_0xfdef('0x3c')]({},_0x3c5e37,_0x1ac690['options']);return db[_0xfdef('0x28')][_0xfdef('0x44')](_0x3c5e37)[_0xfdef('0x22')](handleEntityNotFound(_0x2e0e15,null))[_0xfdef('0x22')](respondWithResult(_0x2e0e15,null))['catch'](handleError(_0x2e0e15,null));};exports[_0xfdef('0x45')]=function(_0x20338a,_0x2369fb){return db['WhatsappTransferReport']['create'](_0x20338a['body'],{})[_0xfdef('0x22')](respondWithResult(_0x2369fb,0xc9))[_0xfdef('0x40')](handleError(_0x2369fb,null));};exports[_0xfdef('0x21')]=function(_0x4e8dfe,_0x2f8a28){if(_0x4e8dfe[_0xfdef('0x46')]['id']){delete _0x4e8dfe[_0xfdef('0x46')]['id'];}return db['WhatsappTransferReport'][_0xfdef('0x44')]({'where':{'id':_0x4e8dfe[_0xfdef('0x42')]['id']}})[_0xfdef('0x22')](handleEntityNotFound(_0x2f8a28,null))[_0xfdef('0x22')](saveUpdates(_0x4e8dfe['body'],null))[_0xfdef('0x22')](respondWithResult(_0x2f8a28,null))[_0xfdef('0x40')](handleError(_0x2f8a28,null));};exports[_0xfdef('0x23')]=function(_0x188414,_0x394dff){return db[_0xfdef('0x28')]['find']({'where':{'id':_0x188414['params']['id']}})[_0xfdef('0x22')](handleEntityNotFound(_0x394dff,null))[_0xfdef('0x22')](removeEntity(_0x394dff,null))[_0xfdef('0x40')](handleError(_0x394dff,null));};exports[_0xfdef('0x47')]=function(_0x1e53be,_0x586f78){return db[_0xfdef('0x28')][_0xfdef('0x47')]()[_0xfdef('0x22')](respondWithResult(_0x586f78,null))[_0xfdef('0x40')](handleError(_0x586f78,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 54b9509..55665f4 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 _0x35dd=['request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x3b711c,_0x4b22dc){var _0x2685f0=function(_0x3b5ba6){while(--_0x3b5ba6){_0x3b711c['push'](_0x3b711c['shift']());}};_0x2685f0(++_0x4b22dc);}(_0x35dd,0x167));var _0xd35d=function(_0x267181,_0x1f3e88){_0x267181=_0x267181-0x0;var _0x3f4125=_0x35dd[_0x267181];return _0x3f4125;};'use strict';var _=require(_0xd35d('0x0'));var util=require(_0xd35d('0x1'));var logger=require(_0xd35d('0x2'))(_0xd35d('0x3'));var moment=require(_0xd35d('0x4'));var BPromise=require('bluebird');var rp=require(_0xd35d('0x5'));var fs=require('fs');var path=require(_0xd35d('0x6'));var rimraf=require(_0xd35d('0x7'));var config=require(_0xd35d('0x8'));var attributes=require(_0xd35d('0x9'));module[_0xd35d('0xa')]=function(_0x491ff7,_0x400b33){return _0x491ff7[_0xd35d('0xb')]('WhatsappTransferReport',attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0xd35d('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x49d3=['WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappTransferReport.attributes','exports'];(function(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0x49d3,0x153));var _0x349d=function(_0x347503,_0x10238c){_0x347503=_0x347503-0x0;var _0x3b2ebd=_0x49d3[_0x347503];return _0x3b2ebd;};'use strict';var _=require(_0x349d('0x0'));var util=require('util');var logger=require(_0x349d('0x1'))(_0x349d('0x2'));var moment=require(_0x349d('0x3'));var BPromise=require(_0x349d('0x4'));var rp=require(_0x349d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x349d('0x6'));var attributes=require(_0x349d('0x7'));module[_0x349d('0x8')]=function(_0x3d9924,_0x478e28){return _0x3d9924['define'](_0x349d('0x9'),attributes,{'tableName':_0x349d('0xa'),'paranoid':![],'indexes':[{'name':_0x349d('0xb'),'fields':[_0x349d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index bb79851..be46d10 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 _0x43c0=['jayson/promise','client','http','request','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4f12c1,_0x12db34){var _0x4aa4f5=function(_0x2d107a){while(--_0x2d107a){_0x4f12c1['push'](_0x4f12c1['shift']());}};_0x4aa4f5(++_0x12db34);}(_0x43c0,0x13b));var _0x043c=function(_0x367fe3,_0x39634e){_0x367fe3=_0x367fe3-0x0;var _0x2471c1=_0x43c0[_0x367fe3];return _0x2471c1;};'use strict';var _=require(_0x043c('0x0'));var util=require(_0x043c('0x1'));var moment=require(_0x043c('0x2'));var BPromise=require(_0x043c('0x3'));var rs=require(_0x043c('0x4'));var fs=require('fs');var Redis=require(_0x043c('0x5'));var db=require(_0x043c('0x6'))['db'];var utils=require(_0x043c('0x7'));var logger=require(_0x043c('0x8'))('rpc');var config=require(_0x043c('0x9'));var jayson=require(_0x043c('0xa'));var client=jayson[_0x043c('0xb')][_0x043c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1f6a4c,_0x4fd5f8,_0x23672b){return new BPromise(function(_0x783da3,_0x646894){return client[_0x043c('0xd')](_0x1f6a4c,_0x23672b)['then'](function(_0x5222ee){logger[_0x043c('0xe')](_0x043c('0xf'),_0x4fd5f8,_0x043c('0x10'));logger[_0x043c('0x11')](_0x043c('0x12'),_0x4fd5f8,_0x043c('0x10'),JSON[_0x043c('0x13')](_0x5222ee));if(_0x5222ee[_0x043c('0x14')]){if(_0x5222ee[_0x043c('0x14')][_0x043c('0x15')]===0x1f4){logger['error'](_0x043c('0xf'),_0x4fd5f8,_0x5222ee[_0x043c('0x14')][_0x043c('0x16')]);return _0x646894(_0x5222ee[_0x043c('0x14')][_0x043c('0x16')]);}logger['error'](_0x043c('0xf'),_0x4fd5f8,_0x5222ee[_0x043c('0x14')][_0x043c('0x16')]);return _0x783da3(_0x5222ee[_0x043c('0x14')][_0x043c('0x16')]);}else{logger[_0x043c('0xe')](_0x043c('0xf'),_0x4fd5f8,_0x043c('0x10'));_0x783da3(_0x5222ee[_0x043c('0x17')]['message']);}})[_0x043c('0x18')](function(_0xb38b1){logger[_0x043c('0x14')](_0x043c('0xf'),_0x4fd5f8,_0xb38b1);_0x646894(_0xb38b1);});});} \ No newline at end of file +var _0x37ec=['client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4d6fc9,_0x5b472a){var _0x2e906b=function(_0x7c1eb2){while(--_0x7c1eb2){_0x4d6fc9['push'](_0x4d6fc9['shift']());}};_0x2e906b(++_0x5b472a);}(_0x37ec,0x1ed));var _0xc37e=function(_0x4e9211,_0x4d707f){_0x4e9211=_0x4e9211-0x0;var _0xf35ab6=_0x37ec[_0x4e9211];return _0xf35ab6;};'use strict';var _=require(_0xc37e('0x0'));var util=require(_0xc37e('0x1'));var moment=require(_0xc37e('0x2'));var BPromise=require(_0xc37e('0x3'));var rs=require(_0xc37e('0x4'));var fs=require('fs');var Redis=require(_0xc37e('0x5'));var db=require(_0xc37e('0x6'))['db'];var utils=require(_0xc37e('0x7'));var logger=require(_0xc37e('0x8'))(_0xc37e('0x9'));var config=require('../../config/environment');var jayson=require(_0xc37e('0xa'));var client=jayson[_0xc37e('0xb')][_0xc37e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x241824,_0x5f5263,_0x554df4){return new BPromise(function(_0x2c670f,_0xa40f12){return client[_0xc37e('0xd')](_0x241824,_0x554df4)[_0xc37e('0xe')](function(_0x57879a){logger[_0xc37e('0xf')](_0xc37e('0x10'),_0x5f5263,_0xc37e('0x11'));logger[_0xc37e('0x12')](_0xc37e('0x13'),_0x5f5263,_0xc37e('0x11'),JSON[_0xc37e('0x14')](_0x57879a));if(_0x57879a['error']){if(_0x57879a[_0xc37e('0x15')][_0xc37e('0x16')]===0x1f4){logger[_0xc37e('0x15')](_0xc37e('0x10'),_0x5f5263,_0x57879a[_0xc37e('0x15')][_0xc37e('0x17')]);return _0xa40f12(_0x57879a['error'][_0xc37e('0x17')]);}logger[_0xc37e('0x15')]('WhatsappTransferReport,\x20%s,\x20%s',_0x5f5263,_0x57879a['error'][_0xc37e('0x17')]);return _0x2c670f(_0x57879a[_0xc37e('0x15')]['message']);}else{logger[_0xc37e('0xf')](_0xc37e('0x10'),_0x5f5263,'request\x20sent');_0x2c670f(_0x57879a['result'][_0xc37e('0x17')]);}})['catch'](function(_0x210bbe){logger[_0xc37e('0x15')](_0xc37e('0x10'),_0x5f5263,_0x210bbe);_0xa40f12(_0x210bbe);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 9afdaca..83c8dec 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc03=['./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','default','listen','info','start','filter','exitCode','number','length','map','pm2_env','Online\x20apps:','online','name','join','Offline\x20apps:','status','None','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','exit','lodash','./config/seedDB','./config/license','./config/environment'];(function(_0x1765c4,_0x151565){var _0x56645f=function(_0x12dfbe){while(--_0x12dfbe){_0x1765c4['push'](_0x1765c4['shift']());}};_0x56645f(++_0x151565);}(_0xdc03,0x65));var _0x3dc0=function(_0x181e06,_0x27f198){_0x181e06=_0x181e06-0x0;var _0x2127a8=_0xdc03[_0x181e06];return _0x2127a8;};'use strict';var _=require(_0x3dc0('0x0'));var db=require('./mysqldb')['db'];var seedDb=require(_0x3dc0('0x1'));var checkLicense=require(_0x3dc0('0x2'));var rpc=require('./rpc');var config=require(_0x3dc0('0x3'));var logger=require(_0x3dc0('0x4'))(_0x3dc0('0x5'));var pm2=require(_0x3dc0('0x6'));var pm2Config=require(_0x3dc0('0x7'));var schedule=require(_0x3dc0('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x3dc0('0x9'));var transcribe=require(_0x3dc0('0xa'));var provider=require(_0x3dc0('0xb'));function main(){return db['sequelize'][_0x3dc0('0xc')]()['then'](function(){if(config['seedDB']){return seedDb['default']();}})[_0x3dc0('0xd')](function(){return checkLicense[_0x3dc0('0xe')]();})[_0x3dc0('0xd')](function(){return rpc[_0x3dc0('0xf')]();})[_0x3dc0('0xd')](function(_0x1fb434){logger[_0x3dc0('0x10')](_0x1fb434);return chat['start']();})['then'](function(){return whatsapp[_0x3dc0('0x11')]();})[_0x3dc0('0xd')](function(){return schedule[_0x3dc0('0x11')]();})['then'](function(){return transcribe['start']();})[_0x3dc0('0xd')](function(){return provider['start']();})[_0x3dc0('0xd')](function(_0x49c112){logger['info'](_0x49c112);return pm2[_0x3dc0('0x11')](pm2Config);})[_0x3dc0('0xd')](function(_0x1d250c){var _0x1a69c0=_0x1d250c[_0x3dc0('0x12')](function(_0x309423){return typeof _0x309423[_0x3dc0('0x13')]===_0x3dc0('0x14')&&_0x309423['exitCode']>=0x0;});if(_0x1a69c0[_0x3dc0('0x15')]>0x0){throw new Error(_0x1a69c0[_0x3dc0('0x15')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x3dc0('0x16')](_0x1a69c0,function(_0xd5b9f1){return'\x22'+_0xd5b9f1[_0x3dc0('0x17')]['name']+'\x22';}));}logger[_0x3dc0('0x10')](_0x3dc0('0x18'),_[_0x3dc0('0x16')](_['filter'](_0x1d250c,{'status':_0x3dc0('0x19')}),_0x3dc0('0x1a'))[_0x3dc0('0x1b')]());logger[_0x3dc0('0x10')](_0x3dc0('0x1c'),_[_0x3dc0('0x16')](_[_0x3dc0('0x12')](_0x1d250c,function(_0x257696){return _0x257696[_0x3dc0('0x1d')]!==_0x3dc0('0x19');}),'name')[_0x3dc0('0x1b')]()||_0x3dc0('0x1e'));console[_0x3dc0('0x1f')]('App\x20Ready!');})['catch'](function(_0x362488){console[_0x3dc0('0x1f')](_0x3dc0('0x20'),_0x362488);logger[_0x3dc0('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x362488);process[_0x3dc0('0x22')](0x1);});}main(); \ No newline at end of file +var _0xbcba=['App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule/chat','./config/schedule/whatsapp','sequelize','sync','default','then','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','None','log'];(function(_0x552660,_0x220535){var _0x4d3a54=function(_0x1212a2){while(--_0x1212a2){_0x552660['push'](_0x552660['shift']());}};_0x4d3a54(++_0x220535);}(_0xbcba,0x6d));var _0xabcb=function(_0x3ac536,_0x5a3d21){_0x3ac536=_0x3ac536-0x0;var _0x237843=_0xbcba[_0x3ac536];return _0x237843;};'use strict';var _=require(_0xabcb('0x0'));var db=require(_0xabcb('0x1'))['db'];var seedDb=require('./config/seedDB');var checkLicense=require(_0xabcb('0x2'));var rpc=require(_0xabcb('0x3'));var config=require(_0xabcb('0x4'));var logger=require(_0xabcb('0x5'))(_0xabcb('0x6'));var pm2=require(_0xabcb('0x7'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0xabcb('0x8'));var whatsapp=require(_0xabcb('0x9'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xabcb('0xa')][_0xabcb('0xb')]()['then'](function(){if(config['seedDB']){return seedDb[_0xabcb('0xc')]();}})['then'](function(){return checkLicense[_0xabcb('0xc')]();})[_0xabcb('0xd')](function(){return rpc[_0xabcb('0xe')]();})[_0xabcb('0xd')](function(_0x4d2585){logger[_0xabcb('0xf')](_0x4d2585);return chat[_0xabcb('0x10')]();})[_0xabcb('0xd')](function(){return whatsapp[_0xabcb('0x10')]();})[_0xabcb('0xd')](function(){return schedule[_0xabcb('0x10')]();})[_0xabcb('0xd')](function(){return transcribe[_0xabcb('0x10')]();})['then'](function(){return provider[_0xabcb('0x10')]();})[_0xabcb('0xd')](function(_0x3fb92d){logger[_0xabcb('0xf')](_0x3fb92d);return pm2[_0xabcb('0x10')](pm2Config);})[_0xabcb('0xd')](function(_0x5672c1){var _0x1790c6=_0x5672c1[_0xabcb('0x11')](function(_0x18d526){return typeof _0x18d526[_0xabcb('0x12')]===_0xabcb('0x13')&&_0x18d526[_0xabcb('0x12')]>=0x0;});if(_0x1790c6[_0xabcb('0x14')]>0x0){throw new Error(_0x1790c6[_0xabcb('0x14')]+_0xabcb('0x15')+_[_0xabcb('0x16')](_0x1790c6,function(_0x48dd27){return'\x22'+_0x48dd27[_0xabcb('0x17')][_0xabcb('0x18')]+'\x22';}));}logger[_0xabcb('0xf')](_0xabcb('0x19'),_[_0xabcb('0x16')](_[_0xabcb('0x11')](_0x5672c1,{'status':_0xabcb('0x1a')}),_0xabcb('0x18'))[_0xabcb('0x1b')]());logger[_0xabcb('0xf')](_0xabcb('0x1c'),_[_0xabcb('0x16')](_[_0xabcb('0x11')](_0x5672c1,function(_0x850a6e){return _0x850a6e['status']!=='online';}),'name')[_0xabcb('0x1b')]()||_0xabcb('0x1d'));console[_0xabcb('0x1e')](_0xabcb('0x1f'));})[_0xabcb('0x20')](function(_0x495d3c){console[_0xabcb('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x495d3c);logger['error'](_0xabcb('0x21'),_0x495d3c);process[_0xabcb('0x22')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 944ec23..af2078c 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 _0x3e63=['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.','split','splice','encryptString','promisify','sign','secret','options','verify','randomBytes','toString','hex','floor','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','fullname','name','internal','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','chatAutoanswer','emailAutoanswer','smsAutoanswer','openchannelAutoanswer','openchannelAutoanswerDelay','whatsappAutoanswer','messengerSoundNotification','isAuthenticated','use','user','ChatInteraction','findOne','params','disposition','then','closed','query','status','unmanaged','json','authorization','startsWith','headers','User','find','authenticate','Wrong\x20credentials.','catch','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','blocked','minutes','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','test','Sequelize','ValidationError','decryptString','toLowerCase','format'];(function(_0x277c6b,_0x4ba316){var _0x212468=function(_0xd366a1){while(--_0xd366a1){_0x277c6b['push'](_0x277c6b['shift']());}};_0x212468(++_0x4ba316);}(_0x3e63,0x95));var _0x33e6=function(_0x208128,_0x9e2557){_0x208128=_0x208128-0x0;var _0x213a02=_0x3e63[_0x208128];return _0x213a02;};'use strict';var db=require(_0x33e6('0x0'))['db'];var config=require(_0x33e6('0x1'));var hardwareConf=require(_0x33e6('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require(_0x33e6('0x3'));var _=require('lodash');var jwt=require(_0x33e6('0x4'));var expressJwt=require(_0x33e6('0x5'));var compose=require(_0x33e6('0x6'));var basicAuth=require(_0x33e6('0x7'));var crypto=require(_0x33e6('0x8'));var BPromise=require(_0x33e6('0x9'));var util=require(_0x33e6('0xa'));var moment=require(_0x33e6('0xb'));var validateJwt=expressJwt({'secret':config[_0x33e6('0xc')][_0x33e6('0xd')]});var userAttributes=['id','role',_0x33e6('0xe'),_0x33e6('0xf'),_0x33e6('0x10'),_0x33e6('0x11'),_0x33e6('0x12'),_0x33e6('0x13'),_0x33e6('0x14'),_0x33e6('0x15'),_0x33e6('0x16'),_0x33e6('0x17'),_0x33e6('0x18'),_0x33e6('0x19'),_0x33e6('0x1a'),_0x33e6('0x1b'),_0x33e6('0x1c'),_0x33e6('0x1d'),_0x33e6('0x1e'),_0x33e6('0x1f'),_0x33e6('0x20'),_0x33e6('0x21'),'alias',_0x33e6('0x22'),_0x33e6('0x23'),_0x33e6('0x24'),_0x33e6('0x25'),_0x33e6('0x26'),_0x33e6('0x27'),'phoneBarExpires','phoneBarPrefixRequired',_0x33e6('0x28'),_0x33e6('0x29'),_0x33e6('0x2a'),'interface',_0x33e6('0x2b'),_0x33e6('0x2c'),_0x33e6('0x2d'),_0x33e6('0x2e'),'downloadVoiceRecordings',_0x33e6('0x2f'),_0x33e6('0x30'),_0x33e6('0x31'),'selectRecallMeCampaign',_0x33e6('0x32'),'chatAutoanswerDelay',_0x33e6('0x33'),'emailAutoanswerDelay',_0x33e6('0x34'),'smsAutoanswerDelay',_0x33e6('0x35'),_0x33e6('0x36'),'faxAutoanswer','faxAutoanswerDelay',_0x33e6('0x37'),'whatsappAutoanswerDelay',_0x33e6('0x38')];exports['isChatInteractionAuthorized']=function(){return this[_0x33e6('0x39')](!![])[_0x33e6('0x3a')](function(_0x3bc81f,_0x1efe23,_0xaa222e){if(_0x3bc81f[_0x33e6('0x3b')]){_0xaa222e();}else{return db[_0x33e6('0x3c')][_0x33e6('0x3d')]({'where':{'id':_0x3bc81f[_0x33e6('0x3e')]['id']},'attributes':['id','closed',_0x33e6('0x3f')],'raw':!![]})[_0x33e6('0x40')](function(_0xc4f274){if(_0xc4f274&&_0xc4f274[_0x33e6('0x41')]&&!_0x3bc81f[_0x33e6('0x42')]['forceDownload']){return _0x1efe23[_0x33e6('0x43')](_0xc4f274[_0x33e6('0x3f')]===_0x33e6('0x44')?0x195:0x193)[_0x33e6('0x45')]({'message':_0xc4f274[_0x33e6('0x3f')]==='unmanaged'?'Unmanaged.':'Forbidden.'});}else{_0xaa222e();}})['catch'](function(_0x32fe97){_0xaa222e(_0x32fe97);});}});};exports[_0x33e6('0x39')]=function isAuthenticated(_0x1b2cab){return compose()[_0x33e6('0x3a')](function(_0x31ccd6,_0x31082c,_0x2536a4){var _0x5bdf32;if(_0x31ccd6['headers'][_0x33e6('0x46')]){if(_[_0x33e6('0x47')](_0x31ccd6[_0x33e6('0x48')][_0x33e6('0x46')],'Basic')){var _0x454c4a=basicAuth(_0x31ccd6);db[_0x33e6('0x49')][_0x33e6('0x4a')]({'where':{'name':_0x454c4a['name']}})['then'](function(_0x5b4d9d){if(!_0x5b4d9d||!_0x5b4d9d[_0x33e6('0x4b')](_0x454c4a['pass'])){return _0x31082c[_0x33e6('0x43')](0x191)[_0x33e6('0x45')]({'message':_0x33e6('0x4c')});}_0x31ccd6[_0x33e6('0x3b')]={'id':_0x5b4d9d['id']};_0x2536a4();})[_0x33e6('0x4d')](function(_0x42a5e6){_0x2536a4(_0x42a5e6);});}else if(_['startsWith'](_0x31ccd6[_0x33e6('0x48')]['authorization'],_0x33e6('0x4e'))){validateJwt(_0x31ccd6,_0x31082c,_0x2536a4);}else{if(_0x1b2cab){_0x2536a4();}else{return _0x31082c[_0x33e6('0x43')](0x193)[_0x33e6('0x45')]({'message':_0x33e6('0x4f')});}}}else if(_0x31ccd6[_0x33e6('0x42')][_0x33e6('0x50')]){try{var _0x3ad696={'audience':hardwareConf[_0x33e6('0x51')](),'issuer':hardwareConf[_0x33e6('0x51')]()};verifyJwt(_0x31ccd6[_0x33e6('0x42')][_0x33e6('0x50')],_0x3ad696)[_0x33e6('0x40')](function(_0x4208a6){return db['User'][_0x33e6('0x4a')]({'where':{'id':_0x4208a6[_0x33e6('0x52')]}})[_0x33e6('0x40')](function(_0x5969e5){_0x5bdf32=_0x5969e5;return db[_0x33e6('0x53')][_0x33e6('0x3d')]({'where':{'id':0x1},'attributes':[_0x33e6('0x54'),_0x33e6('0x55')],'raw':!![]});})['then'](function(_0x473911){if(!_0x5bdf32||!_[_0x33e6('0x56')](_0x5bdf32[_0x33e6('0x57')],_0x4208a6[_0x33e6('0x58')])){return _0x31082c[_0x33e6('0x43')](0x191)['json']({'message':_0x33e6('0x59')});}if(_0x5bdf32['disabled']){return _0x31082c['status'](0x191)[_0x33e6('0x45')]({'message':_0x33e6('0x5a')});}if(_0x5bdf32[_0x33e6('0x5b')]){if(_0x473911[_0x33e6('0x55')]>0x0){if(moment(_0x5bdf32['blockedAt'])['add'](_0x473911[_0x33e6('0x55')],_0x33e6('0x5c'))>moment()){return _0x31082c[_0x33e6('0x43')](0x191)[_0x33e6('0x45')]({'message':_0x33e6('0x5a')});}}else{return _0x31082c[_0x33e6('0x43')](0x191)[_0x33e6('0x45')]({'message':_0x33e6('0x5a')});}}_0x31ccd6[_0x33e6('0x3b')]={'id':_0x5bdf32['id']};_0x2536a4();});})['catch'](function(){return _0x31082c[_0x33e6('0x43')](0x191)[_0x33e6('0x45')]({'message':_0x33e6('0x5a')});});}catch(_0x3b5e0b){_0x2536a4(_0x3b5e0b);}}else if(_0x1b2cab){_0x2536a4();}else{return _0x31082c['status'](0x193)[_0x33e6('0x45')]({'message':_0x33e6('0x4f')});}})[_0x33e6('0x3a')](function(_0x1f4782,_0x1c986d,_0x4e73bf){if(_0x1f4782[_0x33e6('0x3b')]){db[_0x33e6('0x49')][_0x33e6('0x4a')]({'where':{'id':_0x1f4782['user']['id']},'attributes':userAttributes})[_0x33e6('0x40')](function(_0x1ce1af){if(!_0x1ce1af){return _0x1c986d['status'](0x194)['json']({'message':_0x33e6('0x5d')});}_0x1f4782[_0x33e6('0x3b')]=_0x1ce1af;_0x4e73bf();})[_0x33e6('0x4d')](function(_0xe249f9){_0x4e73bf(_0xe249f9);});}else if(_0x1b2cab){_0x4e73bf();}else{return _0x1c986d[_0x33e6('0x43')](0x194)['json']({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x33e6('0x5e')]=function canUpdate(){return compose()[_0x33e6('0x3a')](function(_0x5bee53,_0x44dda0,_0x2b43c1){return licenseUtil[_0x33e6('0x5f')]()[_0x33e6('0x40')](function(_0x443c95){if(_0x443c95[_0x33e6('0x60')]){_0x2b43c1();}else{return _0x44dda0['status'](0x193)[_0x33e6('0x45')]({'message':_0x33e6('0x61')});}})['catch'](function(_0x3cf880){_0x2b43c1(_0x3cf880);});});};exports[_0x33e6('0x62')]=function isWebrtcLicence(){return compose()[_0x33e6('0x3a')](function(_0x17db56,_0xa9fe99,_0x302956){return licenseUtil[_0x33e6('0x5f')]()['then'](function(_0x55fc9c){if(_0x55fc9c[_0x33e6('0x63')]){_0x302956();}else{return _0xa9fe99[_0x33e6('0x43')](0x193)[_0x33e6('0x45')]({'message':_0x33e6('0x61')});}})[_0x33e6('0x4d')](function(_0x3fb06c){_0x302956(_0x3fb06c);});});};exports[_0x33e6('0x64')]=function(_0xd88578,_0x2e4306,_0x53ffa3){_0xd88578[_0x33e6('0x64')]=!![];return _0x53ffa3();};exports[_0x33e6('0x65')]=function signToken(_0xb8ee91){return signJwt(_0xb8ee91);};exports[_0x33e6('0x66')]=function(_0x24abe3,_0x5cc9ab){if(!_0x24abe3[_0x33e6('0x3b')]){return _0x5cc9ab[_0x33e6('0x43')](0x194)[_0x33e6('0x45')]({'message':_0x33e6('0x67')});}var _0x3e6d1e={'payload':{'id':_0x24abe3[_0x33e6('0x3b')]['id'],'role':_0x24abe3['user'][_0x33e6('0x68')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3e6d1e)[_0x33e6('0x40')](function(_0x1e7d9d){_0x5cc9ab[_0x33e6('0x69')](_0x33e6('0x6a'),_0x1e7d9d);_0x5cc9ab[_0x33e6('0x6b')](_0x33e6('0x6c'));})[_0x33e6('0x4d')](function(_0x5465e9){return _0x5cc9ab[_0x33e6('0x43')](0x1f4)['send'](_0x5465e9);});};exports[_0x33e6('0x6d')]=function(_0x3002e9){if(_[_0x33e6('0x6e')](_0x3002e9[_0x33e6('0x57')])||_[_0x33e6('0x6e')](_0x3002e9[_0x33e6('0x6f')])){return null;}else{return createJwt(_0x3002e9);}};exports['generateApiKey']=function(_0x3b13b9){_0x3b13b9[_0x33e6('0x57')]=generateNonce();_0x3b13b9[_0x33e6('0x6f')]=generateIssuedAt();return createJwt(_0x3b13b9);};exports['regenerateApiKey']=function(_0x444266,_0x26acd3){var _0x5d372e=_0x444266[_0x33e6('0x42')]['apikey'];if(_0x5d372e){var _0x567b7b={'nonce':_0x26acd3[_0x33e6('0x57')],'iat':_0x26acd3[_0x33e6('0x6f')],'audience':hardwareConf[_0x33e6('0x51')](),'issuer':hardwareConf[_0x33e6('0x51')]()};return verifyJwt(_0x5d372e,_0x567b7b)[_0x33e6('0x40')](function(){return generateApiKey(_0x26acd3);});}else{throw{'message':_0x33e6('0x70')};}};exports['validatePasswordPattern']=function(_0x1fe08f){var _0x31686d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x31686d[_0x33e6('0x71')](_0x1fe08f))throw new db[(_0x33e6('0x72'))][(_0x33e6('0x73'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');return;};exports['validatePasswordHistory']=function(_0xaa184a,_0x3ef630,_0x56fe1f){var _0x2a059c=encryptor[_0x33e6('0x74')](_0x3ef630)['split'](',');for(var _0x1ffa3e=0x0;_0x1ffa3e<_0x56fe1f;_0x1ffa3e++){if(!_0x2a059c[_0x1ffa3e])break;if(_0xaa184a[_0x33e6('0x75')]()===_0x2a059c[_0x1ffa3e][_0x33e6('0x75')]()){var _0x53e176=util[_0x33e6('0x76')](_0x33e6('0x77'),_0x56fe1f);if(_0x56fe1f===0x1){_0x53e176=_0x33e6('0x78');}throw new db['Sequelize'][(_0x33e6('0x73'))](_0x53e176);}}return;};exports['updatePasswordsHistory']=function(_0x5ad1d6,_0x4f0e93){var _0x4b8e72=_0x4f0e93?encryptor[_0x33e6('0x74')](_0x4f0e93)[_0x33e6('0x79')](','):[];if(_0x4b8e72['length']===0x5){_0x4b8e72[_0x33e6('0x7a')](-0x1,0x1);}_0x4b8e72['unshift'](_0x5ad1d6);return encryptor[_0x33e6('0x7b')](_0x4b8e72['join'](','));};function signJwt(_0x524c97){var _0x4a2018=BPromise[_0x33e6('0x7c')](jwt[_0x33e6('0x7d')],{'context':jwt});var _0x21440e=_0x524c97[_0x33e6('0x7e')]||config['secrets'][_0x33e6('0xd')];return new BPromise(function(_0x1e04ef,_0x4a92f0){_0x4a2018(_0x524c97['payload'],_0x21440e,_0x524c97[_0x33e6('0x7f')])[_0x33e6('0x40')](function(_0x14186c){_0x1e04ef(_0x14186c);})[_0x33e6('0x4d')](function(_0x387307){_0x4a92f0(_0x387307);});});}function verifyJwt(_0x19a4b6,_0x566975,_0x3e1dbb){var _0x33c44a=BPromise[_0x33e6('0x7c')](jwt[_0x33e6('0x80')],{'context':jwt});var _0x52d8ec=_0x3e1dbb||config[_0x33e6('0xc')]['session'];return new BPromise(function(_0x6e4a37,_0x58e9ad){_0x33c44a(_0x19a4b6,_0x52d8ec,_0x566975)[_0x33e6('0x40')](function(_0x36b9ad){_0x6e4a37(_0x36b9ad);})['catch'](function(_0x1eecf2){_0x58e9ad(_0x1eecf2);});});}function generateNonce(){return crypto[_0x33e6('0x81')](0x10)[_0x33e6('0x82')](_0x33e6('0x83'));}function generateIssuedAt(){return Math[_0x33e6('0x84')](Date['now']()/0x3e8)[_0x33e6('0x82')]();}function createJwt(_0x36b780){var _0x5bc2be={'payload':{'iat':_0x36b780[_0x33e6('0x6f')],'nonce':_0x36b780['apiKeyNonce']},'options':{'algorithm':_0x33e6('0x85'),'subject':_0x36b780['id']['toString'](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x33e6('0x51')]()}};return signJwt(_0x5bc2be)[_0x33e6('0x40')](function(_0x167420){return{'iat':_0x36b780[_0x33e6('0x6f')],'nonce':_0x36b780[_0x33e6('0x57')],'token':_0x167420};});} \ No newline at end of file +var _0xf430=['findOne','params','closed','disposition','then','forceDownload','status','json','unmanaged','Unmanaged.','Forbidden.','use','headers','startsWith','Basic','User','find','authenticate','pass','Wrong\x20credentials.','catch','Unknown\x20authorization\x20format','query','getUuid','apikey','Setting','allowedLoginAttempts','apiKeyNonce','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockDuration','blockedAt','add','minutes','user','User\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','decryptString','split','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','encryptString','join','sign','secret','options','promisify','randomBytes','hex','now','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','session','role','name','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay','whatsappAutoanswer','whatsappAutoanswerDelay','isChatInteractionAuthorized','isAuthenticated','ChatInteraction'];(function(_0x5ed865,_0x540964){var _0x2d8d23=function(_0x1f9cda){while(--_0x1f9cda){_0x5ed865['push'](_0x5ed865['shift']());}};_0x2d8d23(++_0x540964);}(_0xf430,0xd6));var _0x0f43=function(_0x448f8,_0x2aa1d7){_0x448f8=_0x448f8-0x0;var _0xa73126=_0xf430[_0x448f8];return _0xa73126;};'use strict';var db=require(_0x0f43('0x0'))['db'];var config=require(_0x0f43('0x1'));var hardwareConf=require(_0x0f43('0x2'));var licenseUtil=require(_0x0f43('0x3'));var encryptor=require(_0x0f43('0x4'));var _=require(_0x0f43('0x5'));var jwt=require('jsonwebtoken');var expressJwt=require('express-jwt');var compose=require(_0x0f43('0x6'));var basicAuth=require(_0x0f43('0x7'));var crypto=require(_0x0f43('0x8'));var BPromise=require(_0x0f43('0x9'));var util=require(_0x0f43('0xa'));var moment=require(_0x0f43('0xb'));var validateJwt=expressJwt({'secret':config[_0x0f43('0xc')][_0x0f43('0xd')]});var userAttributes=['id',_0x0f43('0xe'),'fullname',_0x0f43('0xf'),_0x0f43('0x10'),_0x0f43('0x11'),_0x0f43('0x12'),'permissions',_0x0f43('0x13'),_0x0f43('0x14'),_0x0f43('0x15'),_0x0f43('0x16'),_0x0f43('0x17'),_0x0f43('0x18'),_0x0f43('0x19'),'pauseType',_0x0f43('0x1a'),_0x0f43('0x1b'),_0x0f43('0x1c'),_0x0f43('0x1d'),'allowmessenger',_0x0f43('0x1e'),_0x0f43('0x1f'),_0x0f43('0x20'),_0x0f43('0x21'),_0x0f43('0x22'),_0x0f43('0x23'),_0x0f43('0x24'),'phoneBarEnableSettings','phoneBarExpires',_0x0f43('0x25'),_0x0f43('0x26'),_0x0f43('0x27'),'hotdesk',_0x0f43('0x28'),'userProfileId',_0x0f43('0x29'),'settingsEnabled',_0x0f43('0x2a'),_0x0f43('0x2b'),_0x0f43('0x2c'),_0x0f43('0x2d'),_0x0f43('0x2e'),_0x0f43('0x2f'),_0x0f43('0x30'),_0x0f43('0x31'),'emailAutoanswer',_0x0f43('0x32'),_0x0f43('0x33'),_0x0f43('0x34'),_0x0f43('0x35'),_0x0f43('0x36'),_0x0f43('0x37'),_0x0f43('0x38'),_0x0f43('0x39'),_0x0f43('0x3a'),'messengerSoundNotification'];exports[_0x0f43('0x3b')]=function(){return this[_0x0f43('0x3c')](!![])['use'](function(_0xe63ef6,_0x371fbb,_0x22fa17){if(_0xe63ef6['user']){_0x22fa17();}else{return db[_0x0f43('0x3d')][_0x0f43('0x3e')]({'where':{'id':_0xe63ef6[_0x0f43('0x3f')]['id']},'attributes':['id',_0x0f43('0x40'),_0x0f43('0x41')],'raw':!![]})[_0x0f43('0x42')](function(_0x12a750){if(_0x12a750&&_0x12a750[_0x0f43('0x40')]&&!_0xe63ef6['query'][_0x0f43('0x43')]){return _0x371fbb[_0x0f43('0x44')](_0x12a750['disposition']==='unmanaged'?0x195:0x193)[_0x0f43('0x45')]({'message':_0x12a750['disposition']===_0x0f43('0x46')?_0x0f43('0x47'):_0x0f43('0x48')});}else{_0x22fa17();}})['catch'](function(_0x5031ac){_0x22fa17(_0x5031ac);});}});};exports[_0x0f43('0x3c')]=function isAuthenticated(_0x34d1b8){return compose()[_0x0f43('0x49')](function(_0x4bdfbe,_0x1f7ecf,_0x37fc80){var _0x25f81b;if(_0x4bdfbe[_0x0f43('0x4a')]['authorization']){if(_[_0x0f43('0x4b')](_0x4bdfbe[_0x0f43('0x4a')]['authorization'],_0x0f43('0x4c'))){var _0x17b168=basicAuth(_0x4bdfbe);db[_0x0f43('0x4d')][_0x0f43('0x4e')]({'where':{'name':_0x17b168[_0x0f43('0xf')]}})[_0x0f43('0x42')](function(_0x555654){if(!_0x555654||!_0x555654[_0x0f43('0x4f')](_0x17b168[_0x0f43('0x50')])){return _0x1f7ecf['status'](0x191)[_0x0f43('0x45')]({'message':_0x0f43('0x51')});}_0x4bdfbe['user']={'id':_0x555654['id']};_0x37fc80();})[_0x0f43('0x52')](function(_0x50db8d){_0x37fc80(_0x50db8d);});}else if(_[_0x0f43('0x4b')](_0x4bdfbe['headers']['authorization'],'Bearer')){validateJwt(_0x4bdfbe,_0x1f7ecf,_0x37fc80);}else{if(_0x34d1b8){_0x37fc80();}else{return _0x1f7ecf[_0x0f43('0x44')](0x193)[_0x0f43('0x45')]({'message':_0x0f43('0x53')});}}}else if(_0x4bdfbe[_0x0f43('0x54')]['apikey']){try{var _0x55eda4={'audience':hardwareConf[_0x0f43('0x55')](),'issuer':hardwareConf[_0x0f43('0x55')]()};verifyJwt(_0x4bdfbe['query'][_0x0f43('0x56')],_0x55eda4)[_0x0f43('0x42')](function(_0x2a6a53){return db[_0x0f43('0x4d')][_0x0f43('0x4e')]({'where':{'id':_0x2a6a53['sub']}})['then'](function(_0x15308f){_0x25f81b=_0x15308f;return db[_0x0f43('0x57')][_0x0f43('0x3e')]({'where':{'id':0x1},'attributes':[_0x0f43('0x58'),'blockDuration'],'raw':!![]});})['then'](function(_0x21774d){if(!_0x25f81b||!_['isEqual'](_0x25f81b[_0x0f43('0x59')],_0x2a6a53[_0x0f43('0x5a')])){return _0x1f7ecf[_0x0f43('0x44')](0x191)[_0x0f43('0x45')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x25f81b[_0x0f43('0x5b')]){return _0x1f7ecf[_0x0f43('0x44')](0x191)[_0x0f43('0x45')]({'message':_0x0f43('0x5c')});}if(_0x25f81b[_0x0f43('0x5d')]){if(_0x21774d[_0x0f43('0x5e')]>0x0){if(moment(_0x25f81b[_0x0f43('0x5f')])[_0x0f43('0x60')](_0x21774d['blockDuration'],_0x0f43('0x61'))>moment()){return _0x1f7ecf[_0x0f43('0x44')](0x191)[_0x0f43('0x45')]({'message':_0x0f43('0x5c')});}}else{return _0x1f7ecf[_0x0f43('0x44')](0x191)[_0x0f43('0x45')]({'message':_0x0f43('0x5c')});}}_0x4bdfbe[_0x0f43('0x62')]={'id':_0x25f81b['id']};_0x37fc80();});})[_0x0f43('0x52')](function(){return _0x1f7ecf[_0x0f43('0x44')](0x191)[_0x0f43('0x45')]({'message':_0x0f43('0x5c')});});}catch(_0x1fe5fd){_0x37fc80(_0x1fe5fd);}}else if(_0x34d1b8){_0x37fc80();}else{return _0x1f7ecf[_0x0f43('0x44')](0x193)[_0x0f43('0x45')]({'message':_0x0f43('0x53')});}})[_0x0f43('0x49')](function(_0x2d2d71,_0x4f3eab,_0x380f04){if(_0x2d2d71[_0x0f43('0x62')]){db[_0x0f43('0x4d')]['find']({'where':{'id':_0x2d2d71['user']['id']},'attributes':userAttributes})[_0x0f43('0x42')](function(_0xf6c5ae){if(!_0xf6c5ae){return _0x4f3eab['status'](0x194)[_0x0f43('0x45')]({'message':_0x0f43('0x63')});}_0x2d2d71[_0x0f43('0x62')]=_0xf6c5ae;_0x380f04();})['catch'](function(_0x52a858){_0x380f04(_0x52a858);});}else if(_0x34d1b8){_0x380f04();}else{return _0x4f3eab[_0x0f43('0x44')](0x194)[_0x0f43('0x45')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0x0f43('0x64')]=function canUpdate(){return compose()['use'](function(_0x12db70,_0xd6ac41,_0x5ccc76){return licenseUtil[_0x0f43('0x65')]()[_0x0f43('0x42')](function(_0x4623e0){if(_0x4623e0[_0x0f43('0x66')]){_0x5ccc76();}else{return _0xd6ac41[_0x0f43('0x44')](0x193)['json']({'message':_0x0f43('0x67')});}})['catch'](function(_0x4d325c){_0x5ccc76(_0x4d325c);});});};exports[_0x0f43('0x68')]=function isWebrtcLicence(){return compose()[_0x0f43('0x49')](function(_0x28316d,_0xd555e6,_0x20ea25){return licenseUtil[_0x0f43('0x65')]()['then'](function(_0x2ff125){if(_0x2ff125[_0x0f43('0x69')]){_0x20ea25();}else{return _0xd555e6[_0x0f43('0x44')](0x193)[_0x0f43('0x45')]({'message':_0x0f43('0x67')});}})[_0x0f43('0x52')](function(_0x2c0790){_0x20ea25(_0x2c0790);});});};exports['isMiddleware']=function(_0x40f21d,_0x23bba8,_0x25f93a){_0x40f21d[_0x0f43('0x6a')]=!![];return _0x25f93a();};exports[_0x0f43('0x6b')]=function signToken(_0x158eff){return signJwt(_0x158eff);};exports['setTokenCookie']=function(_0x4174f2,_0xe981ad){if(!_0x4174f2[_0x0f43('0x62')]){return _0xe981ad[_0x0f43('0x44')](0x194)[_0x0f43('0x45')]({'message':_0x0f43('0x6c')});}var _0x3c20dd={'payload':{'id':_0x4174f2[_0x0f43('0x62')]['id'],'role':_0x4174f2['user'][_0x0f43('0xe')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3c20dd)[_0x0f43('0x42')](function(_0x439504){_0xe981ad['cookie'](_0x0f43('0x6d'),_0x439504);_0xe981ad[_0x0f43('0x6e')]('/dashboards/general');})['catch'](function(_0x20c5b0){return _0xe981ad[_0x0f43('0x44')](0x1f4)[_0x0f43('0x6f')](_0x20c5b0);});};exports['retrieveApiKey']=function(_0xb94d81){if(_['isNil'](_0xb94d81[_0x0f43('0x59')])||_[_0x0f43('0x70')](_0xb94d81[_0x0f43('0x71')])){return null;}else{return createJwt(_0xb94d81);}};exports[_0x0f43('0x72')]=function(_0x5f4e0d){_0x5f4e0d[_0x0f43('0x59')]=generateNonce();_0x5f4e0d[_0x0f43('0x71')]=generateIssuedAt();return createJwt(_0x5f4e0d);};exports[_0x0f43('0x73')]=function(_0x29b981,_0x42a52c){var _0x2a598a=_0x29b981['query'][_0x0f43('0x56')];if(_0x2a598a){var _0xc78266={'nonce':_0x42a52c[_0x0f43('0x59')],'iat':_0x42a52c[_0x0f43('0x71')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x0f43('0x55')]()};return verifyJwt(_0x2a598a,_0xc78266)['then'](function(){return generateApiKey(_0x42a52c);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x0f43('0x74')]=function(_0x9b0c80){var _0x44bad0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x44bad0[_0x0f43('0x75')](_0x9b0c80))throw new db[(_0x0f43('0x76'))][(_0x0f43('0x77'))](_0x0f43('0x78'));return;};exports[_0x0f43('0x79')]=function(_0x5815b6,_0x57b6f6,_0x4b489b){var _0x5e2c51=encryptor[_0x0f43('0x7a')](_0x57b6f6)[_0x0f43('0x7b')](',');for(var _0x3f36dc=0x0;_0x3f36dc<_0x4b489b;_0x3f36dc++){if(!_0x5e2c51[_0x3f36dc])break;if(_0x5815b6['toLowerCase']()===_0x5e2c51[_0x3f36dc]['toLowerCase']()){var _0x309aaf=util[_0x0f43('0x7c')](_0x0f43('0x7d'),_0x4b489b);if(_0x4b489b===0x1){_0x309aaf=_0x0f43('0x7e');}throw new db[(_0x0f43('0x76'))][(_0x0f43('0x77'))](_0x309aaf);}}return;};exports[_0x0f43('0x7f')]=function(_0x2da1f9,_0x4f52b3){var _0x45fe2c=_0x4f52b3?encryptor[_0x0f43('0x7a')](_0x4f52b3)[_0x0f43('0x7b')](','):[];if(_0x45fe2c['length']===0x5){_0x45fe2c['splice'](-0x1,0x1);}_0x45fe2c['unshift'](_0x2da1f9);return encryptor[_0x0f43('0x80')](_0x45fe2c[_0x0f43('0x81')](','));};function signJwt(_0xcf44f){var _0x3228a0=BPromise['promisify'](jwt[_0x0f43('0x82')],{'context':jwt});var _0x47e7b0=_0xcf44f[_0x0f43('0x83')]||config[_0x0f43('0xc')]['session'];return new BPromise(function(_0x4fad5f,_0x548201){_0x3228a0(_0xcf44f['payload'],_0x47e7b0,_0xcf44f[_0x0f43('0x84')])[_0x0f43('0x42')](function(_0x2a4d47){_0x4fad5f(_0x2a4d47);})[_0x0f43('0x52')](function(_0x44a0e4){_0x548201(_0x44a0e4);});});}function verifyJwt(_0x4e305f,_0x3403c7,_0x5c18c8){var _0x50780e=BPromise[_0x0f43('0x85')](jwt['verify'],{'context':jwt});var _0x539af9=_0x5c18c8||config[_0x0f43('0xc')]['session'];return new BPromise(function(_0x1b2600,_0x5544b3){_0x50780e(_0x4e305f,_0x539af9,_0x3403c7)[_0x0f43('0x42')](function(_0x3257b6){_0x1b2600(_0x3257b6);})[_0x0f43('0x52')](function(_0x50f0c7){_0x5544b3(_0x50f0c7);});});}function generateNonce(){return crypto[_0x0f43('0x86')](0x10)['toString'](_0x0f43('0x87'));}function generateIssuedAt(){return Math['floor'](Date[_0x0f43('0x88')]()/0x3e8)[_0x0f43('0x89')]();}function createJwt(_0x5a8098){var _0x4a1d82={'payload':{'iat':_0x5a8098['apiKeyIat'],'nonce':_0x5a8098[_0x0f43('0x59')]},'options':{'algorithm':'HS512','subject':_0x5a8098['id'][_0x0f43('0x89')](),'issuer':hardwareConf[_0x0f43('0x55')](),'audience':hardwareConf[_0x0f43('0x55')]()}};return signJwt(_0x4a1d82)['then'](function(_0x11c98a){return{'iat':_0x5a8098[_0x0f43('0x71')],'nonce':_0x5a8098[_0x0f43('0x59')],'token':_0x11c98a};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 9173997..174ebb5 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0af8=['findAll','skipContactsQuery','resolve','getContactsSubquery','then','search','where','default','filter','user','skip','checkListsRestrictions','ids','tag','count','User','fields','rows','catch','describe','CmContact','keys','startsWith','CmCustomField','slice','all','length','cf_','fieldType','type','map','lodash','./sql-utils','../../mysqldb'];(function(_0x214ee1,_0x333313){var _0x178b38=function(_0x3ec8e5){while(--_0x3ec8e5){_0x214ee1['push'](_0x214ee1['shift']());}};_0x178b38(++_0x333313);}(_0x0af8,0x151));var _0x80af=function(_0x35bc78,_0x40b2b2){_0x35bc78=_0x35bc78-0x0;var _0x4a5a12=_0x0af8[_0x35bc78];return _0x4a5a12;};'use strict';var _=require(_0x80af('0x0'));var sqlUtils=require(_0x80af('0x1'));var db=require(_0x80af('0x2'))['db'];exports[_0x80af('0x3')]=function(_0x271457,_0x40ee3b,_0x3b411b,_0x28933b){var _0x2f4016={'count':0x0,'rows':[]};var _0xbf0a9f=sqlUtils[_0x80af('0x4')](_0x40ee3b,_0x271457);if(_0xbf0a9f){return Promise[_0x80af('0x5')](_0x2f4016);}var _0x47ca57=sqlUtils[_0x80af('0x6')]();var _0x2d1989={};var _0x19cbcb=![];var _0x21bb75=![];return Promise[_0x80af('0x5')]()[_0x80af('0x7')](function(){if(_0x271457['search']){return sqlUtils['parseAdvancedSearchFilter'](_0x271457[_0x80af('0x8')],_0x28933b);}else{return sqlUtils['parseQueryParameters'](_0x271457,_0x28933b);}})['then'](function(_0x407295){_0x47ca57[_0x80af('0x9')](_0x407295[_0x80af('0xa')]);_0x47ca57[_0x80af('0x9')](_0x407295['fields']);_0x47ca57[_0x80af('0x9')](_0x407295[_0x80af('0xb')]);_0x47ca57[_0x80af('0x9')](_0x407295[_0x80af('0xc')]['clause']);_0x2d1989=_0x407295['tags'];_0x21bb75=_0x407295[_0x80af('0xc')][_0x80af('0xd')];return sqlUtils[_0x80af('0xe')](_0x40ee3b,_0x271457,_0x21bb75);})[_0x80af('0x7')](function(_0x385381){_0x47ca57[_0x80af('0x9')](_0x385381);var _0x13c82d=_0x271457[_0x80af('0x8')]?_0x2d1989[_0x80af('0xf')]:_0x271457[_0x80af('0x10')];_0x19cbcb=_0x13c82d?!![]:![];return sqlUtils['countFilteredContacts'](_0x47ca57,_0x13c82d);})['then'](function(_0x5c29f1){_0x2f4016[_0x80af('0x11')]=_0x5c29f1;if(_0x2f4016[_0x80af('0x11')]===0x0){return;}if(_0x271457[_0x80af('0x12')]){_0x21bb75=!![];}return sqlUtils['buildContactsQuery'](_0x47ca57,_0x271457[_0x80af('0x13')],_0x3b411b,_0x19cbcb,_0x2d1989['clause'],_0x21bb75);})[_0x80af('0x7')](function(_0x3a4a5f){if(!_0x3a4a5f){return[];}return sqlUtils['getFilteredContacts'](_0x3a4a5f,_0x271457,_0x3b411b);})[_0x80af('0x7')](function(_0x3bb3c5){_0x2f4016[_0x80af('0x14')]=_0x3bb3c5;return _0x2f4016;})[_0x80af('0x15')](function(_0x38e5f4){throw _0x38e5f4;});};exports[_0x80af('0x16')]=function(){var _0x296ab4={};var _0x230449=[];return db[_0x80af('0x17')][_0x80af('0x16')]()[_0x80af('0x7')](function(_0x1f8055){_0x296ab4=_0x1f8055;var _0x447682=Object[_0x80af('0x18')](_0x296ab4)[_0x80af('0xb')](function(_0x3eaea3){return _[_0x80af('0x19')](_0x3eaea3,'cf_')?_0x3eaea3:undefined;});var _0x1743c0=_0x447682['map'](function(_0x63ddca){return db[_0x80af('0x1a')]['findOne']({'where':{'id':_0x63ddca[_0x80af('0x1b')](0x3)},'raw':!![]});});return Promise[_0x80af('0x1c')](_0x1743c0);})[_0x80af('0x7')](function(_0x3016cb){for(var _0x4093d7=0x0;_0x4093d7<_0x3016cb[_0x80af('0x1d')];_0x4093d7++){if(_0x3016cb[_0x4093d7]){var _0x276b59=_0x80af('0x1e')+_0x3016cb[_0x4093d7]['id'];_0x296ab4[_0x276b59][_0x80af('0x1f')]=_0x3016cb[_0x4093d7][_0x80af('0x20')];}}_0x230449=_[_0x80af('0x21')](Object[_0x80af('0x18')](_0x296ab4),function(_0x427668){return{'name':_0x427668,'type':_0x296ab4[_0x427668]['type']};});return _0x230449;})[_0x80af('0x15')](function(_0x2c4083){throw _0x2c4083;});}; \ No newline at end of file +var _0xca7c=['filter','cf_','map','CmCustomField','findOne','slice','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','default','fields','where','user','clause','tags','skip','checkListsRestrictions','ids','count','buildContactsQuery','rows','catch','describe','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xca7c,0x69));var _0xcca7=function(_0x473fd2,_0x21c4f6){_0x473fd2=_0x473fd2-0x0;var _0x3b3561=_0xca7c[_0x473fd2];return _0x3b3561;};'use strict';var _=require(_0xcca7('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xcca7('0x1'))['db'];exports['findAll']=function(_0x46bb1c,_0x55d810,_0xa32706,_0x2aa242){var _0x27963d={'count':0x0,'rows':[]};var _0x5e2000=sqlUtils[_0xcca7('0x2')](_0x55d810,_0x46bb1c);if(_0x5e2000){return Promise[_0xcca7('0x3')](_0x27963d);}var _0x1d8a72=sqlUtils[_0xcca7('0x4')]();var _0xaff90f={};var _0x3504bf=![];var _0x20c61b=![];return Promise[_0xcca7('0x3')]()[_0xcca7('0x5')](function(){if(_0x46bb1c['search']){return sqlUtils[_0xcca7('0x6')](_0x46bb1c[_0xcca7('0x7')],_0x2aa242);}else{return sqlUtils['parseQueryParameters'](_0x46bb1c,_0x2aa242);}})[_0xcca7('0x5')](function(_0x4c852f){_0x1d8a72['where'](_0x4c852f[_0xcca7('0x8')]);_0x1d8a72['where'](_0x4c852f[_0xcca7('0x9')]);_0x1d8a72[_0xcca7('0xa')](_0x4c852f['filter']);_0x1d8a72[_0xcca7('0xa')](_0x4c852f[_0xcca7('0xb')][_0xcca7('0xc')]);_0xaff90f=_0x4c852f[_0xcca7('0xd')];_0x20c61b=_0x4c852f[_0xcca7('0xb')][_0xcca7('0xe')];return sqlUtils[_0xcca7('0xf')](_0x55d810,_0x46bb1c,_0x20c61b);})[_0xcca7('0x5')](function(_0x31cc50){_0x1d8a72[_0xcca7('0xa')](_0x31cc50);var _0x1fc487=_0x46bb1c[_0xcca7('0x7')]?_0xaff90f[_0xcca7('0x10')]:_0x46bb1c['tag'];_0x3504bf=_0x1fc487?!![]:![];return sqlUtils['countFilteredContacts'](_0x1d8a72,_0x1fc487);})[_0xcca7('0x5')](function(_0x45d6f9){_0x27963d[_0xcca7('0x11')]=_0x45d6f9;if(_0x27963d[_0xcca7('0x11')]===0x0){return;}if(_0x46bb1c['User']){_0x20c61b=!![];}return sqlUtils[_0xcca7('0x12')](_0x1d8a72,_0x46bb1c['fields'],_0xa32706,_0x3504bf,_0xaff90f['clause'],_0x20c61b);})[_0xcca7('0x5')](function(_0x1b7680){if(!_0x1b7680){return[];}return sqlUtils['getFilteredContacts'](_0x1b7680,_0x46bb1c,_0xa32706);})[_0xcca7('0x5')](function(_0x59401e){_0x27963d[_0xcca7('0x13')]=_0x59401e;return _0x27963d;})[_0xcca7('0x14')](function(_0x360574){throw _0x360574;});};exports[_0xcca7('0x15')]=function(){var _0x2e5f0f={};var _0x496a0c=[];return db['CmContact'][_0xcca7('0x15')]()['then'](function(_0x1a974e){_0x2e5f0f=_0x1a974e;var _0x5bc7fe=Object[_0xcca7('0x16')](_0x2e5f0f)[_0xcca7('0x17')](function(_0x3bddf6){return _['startsWith'](_0x3bddf6,_0xcca7('0x18'))?_0x3bddf6:undefined;});var _0x3bf9d9=_0x5bc7fe[_0xcca7('0x19')](function(_0x2044c0){return db[_0xcca7('0x1a')][_0xcca7('0x1b')]({'where':{'id':_0x2044c0[_0xcca7('0x1c')](0x3)},'raw':!![]});});return Promise[_0xcca7('0x1d')](_0x3bf9d9);})[_0xcca7('0x5')](function(_0x1a39ef){for(var _0xfef0da=0x0;_0xfef0da<_0x1a39ef[_0xcca7('0x1e')];_0xfef0da++){if(_0x1a39ef[_0xfef0da]){var _0x1808ff='cf_'+_0x1a39ef[_0xfef0da]['id'];_0x2e5f0f[_0x1808ff]['fieldType']=_0x1a39ef[_0xfef0da][_0xcca7('0x1f')];}}_0x496a0c=_[_0xcca7('0x19')](Object[_0xcca7('0x16')](_0x2e5f0f),function(_0x18f06c){return{'name':_0x18f06c,'type':_0x2e5f0f[_0x18f06c][_0xcca7('0x1f')]};});return _0x496a0c;})[_0xcca7('0x14')](function(_0x5f1242){throw _0x5f1242;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 14d901f..8a58259 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaa62=['concat','uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','fields','filter','getLists','limit','offset','group','subqry.id','having','order','subqry.','DESC','findAll','keyBy','QueryTypes','CmContact','sequelize','toString','Tags','c.id','isEmpty','Sequelize','SELECT','query','COUNT(*)','exports','lodash','../parsers/qs','../../mysqldb','role','agent','search','ListId','autocomplete','select','from','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','uc.CmContactId\x20=\x20','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','lastName','phone','mobile','fax','email','createdAt','updatedAt','deletedAt','TagIds','includes','push','forEach','field','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.firstName\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','find','fieldType','datetime','castTo','DATE','type','default','text','value','start','end','Tag','map','tags','ids','User','clause','user','keys','some','name','compact','Contact','and','c.ListId\x20IN\x20?'];(function(_0x5aa317,_0xb9edaa){var _0x58665f=function(_0x1374bd){while(--_0x1374bd){_0x5aa317['push'](_0x5aa317['shift']());}};_0x58665f(++_0xb9edaa);}(_0xaa62,0x1ca));var _0x2aa6=function(_0xdb146e,_0x4fab7d){_0xdb146e=_0xdb146e-0x0;var _0x36cb55=_0xaa62[_0xdb146e];return _0x36cb55;};'use strict';var _=require(_0x2aa6('0x0'));var squel=require('squel');var as=require('../parsers/advancedSearch');var qs=require(_0x2aa6('0x1'));var utils=require('../interaction/utils');var db=require(_0x2aa6('0x2'))['db'];function skipContactsQuery(_0x381248,_0x509153){var _0x43fc73=![];if(_0x381248[_0x2aa6('0x3')]===_0x2aa6('0x4')&&!_0x509153[_0x2aa6('0x5')]&&!_0x509153[_0x2aa6('0x6')]&&_0x509153[_0x2aa6('0x7')]!=='true'){_0x43fc73=!![];}return _0x43fc73;}function getContactsSubquery(){return squel[_0x2aa6('0x8')]()[_0x2aa6('0x9')]('cm_contacts','c')[_0x2aa6('0xa')](_0x2aa6('0xb'));}function applyJoinClauses(_0x50fe4b,_0x1ec8b9){var _0x3fcbec=_0x1ec8b9?'c':_0x2aa6('0xc');_0x50fe4b[_0x2aa6('0xd')]('cm_user_has_contacts','uc',_0x2aa6('0xe')+_0x3fcbec+_0x2aa6('0xf'))[_0x2aa6('0xd')](_0x2aa6('0x10'),'ct',_0x2aa6('0x11')+_0x3fcbec+_0x2aa6('0xf'))[_0x2aa6('0xd')](_0x2aa6('0x12'),'t',_0x2aa6('0x13'));return _0x50fe4b;}function addFieldsToQuery(_0x2e75b4,_0x41f7d0,_0x2a091b,_0x4bebb2,_0x44cdcb){var _0x24b49d=_0x44cdcb?'c':_0x2aa6('0xc');if(!_0x41f7d0){_0x41f7d0=['id',_0x2aa6('0x14'),_0x2aa6('0x15'),_0x2aa6('0x16'),_0x2aa6('0x17'),_0x2aa6('0x18'),_0x2aa6('0x19'),_0x2aa6('0x6'),'CompanyId',_0x2aa6('0x1a'),_0x2aa6('0x1b'),_0x2aa6('0x1c'),_0x2aa6('0x1d')];}else if(!_0x41f7d0[_0x2aa6('0x1e')]('id')){_0x41f7d0[_0x2aa6('0x1f')]('id');}var _0xe75ed6=_0x2a091b&&_0x44cdcb||!_0x2a091b&&!_0x44cdcb;if(_0x4bebb2){_0xe75ed6=_0x4bebb2&&_0x44cdcb||!_0x4bebb2&&!_0x44cdcb;}_0x41f7d0[_0x2aa6('0x20')](function(_0x113ed9){if(_0x113ed9===_0x2aa6('0x1d')){if(_0xe75ed6){_0x2e75b4[_0x2aa6('0x21')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x113ed9);}else if(_0x2a091b||_0x4bebb2){_0x2e75b4[_0x2aa6('0x21')](_0x24b49d+'.'+_0x113ed9);}}else{_0x2e75b4[_0x2aa6('0x21')](_0x24b49d+'.'+_0x113ed9);}});return _0x2e75b4;}function getSqlClauses(){var _0x3b9d87={'default':squel[_0x2aa6('0x22')](),'fields':squel[_0x2aa6('0x22')](),'filter':squel[_0x2aa6('0x22')](),'tags':{'clause':squel[_0x2aa6('0x22')](),'ids':null},'user':{'clause':squel[_0x2aa6('0x22')](),'skip':![]}};return _0x3b9d87;}function parseTagParameter(_0x757cdd){var _0xf9ccfa=squel[_0x2aa6('0x22')]();if(_0x757cdd){var _0x34a383=utils[_0x2aa6('0x23')](_0x757cdd);_0x34a383[_0x2aa6('0x20')](function(_0x3169f6){_0xf9ccfa['or'](_0x2aa6('0x24'),'%,'+_0x3169f6+',%');});}return _0xf9ccfa;}function parseSearchFilter(_0x404829){var _0x4409bd=squel['expr']();if(_0x404829){var _0x21b25d=_0x404829[_0x2aa6('0x25')]('\x5c','\x5c\x5c')[_0x2aa6('0x25')](/'/g,'\x27\x27');if(_0x21b25d[_0x2aa6('0x26')]('\x20')[_0x2aa6('0x27')]>0x1){_0x4409bd['or'](_0x2aa6('0x28'),qs[_0x2aa6('0x29')](_0x21b25d,!![]),null);}else{if(qs[_0x2aa6('0x2a')](_0x21b25d)){_0x4409bd['or']('c.id\x20LIKE\x20?',_0x21b25d+'%');_0x4409bd['or'](_0x2aa6('0x2b'),_0x21b25d+'%');_0x4409bd['or'](_0x2aa6('0x2c'),_0x21b25d+'%');_0x4409bd['or'](_0x2aa6('0x2d'),_0x21b25d+'%');}else if(qs[_0x2aa6('0x2e')](_0x21b25d)){_0x4409bd['or']('c.email\x20LIKE\x20?',_0x21b25d+'%');}else{_0x4409bd['or'](_0x2aa6('0x2f'),'%'+_0x21b25d+'%');_0x4409bd['or']('c.lastName\x20LIKE\x20?','%'+_0x21b25d+'%');_0x4409bd['or'](_0x2aa6('0x30'),'%'+_0x21b25d+'%');}}}return _0x4409bd;}function parseAdvancedSearchFilter(_0x4df409,_0x7b5df){var _0xa03c3b=getSqlClauses();var _0x32d346=as[_0x2aa6('0x31')](_0x4df409);var _0xa640f5=_0x32d346[_0x2aa6('0x32')];for(var _0x1d2611=0x0;_0x1d2611<_0x32d346['conditions'][_0x2aa6('0x27')];_0x1d2611++){var _0x110d12=_0x32d346[_0x2aa6('0x33')][_0x1d2611];var _0x549af2='c';var _0xa55d9e=_[_0x2aa6('0x34')](_0x7b5df,['name',_0x110d12[_0x2aa6('0x21')]]);if(_0xa55d9e){if(_0x110d12[_0x2aa6('0x21')]==='dateOfBirth'||_0xa55d9e[_0x2aa6('0x35')]===_0x2aa6('0x36')){_0x110d12[_0x2aa6('0x37')]=_0x2aa6('0x38');}var _0x25ae54=as['buildExpression'](_0x549af2,_0xa55d9e[_0x2aa6('0x39')],_0x110d12);_0xa03c3b[_0x2aa6('0x3a')][_0xa640f5](_0x25ae54[_0x2aa6('0x3b')],_0x25ae54[_0x2aa6('0x3c')][_0x2aa6('0x3d')],_0x25ae54[_0x2aa6('0x3c')][_0x2aa6('0x3e')]);}else{if(_0x110d12[_0x2aa6('0x21')]===_0x2aa6('0x3f')){var _0x269afe=_0x110d12[_0x2aa6('0x3c')][_0x2aa6('0x26')](',')[_0x2aa6('0x40')](function(_0x3472f4){return Number(_0x3472f4);});var _0x4a83b0=parseTagParameter(_0x269afe);_0xa03c3b[_0x2aa6('0x41')]['clause']['and'](_0x4a83b0);_0xa03c3b[_0x2aa6('0x41')][_0x2aa6('0x42')]=_0x269afe;}else if(_0x110d12[_0x2aa6('0x21')]===_0x2aa6('0x43')){_0xa03c3b['user'][_0x2aa6('0x44')]['and']('uc.UserId\x20=\x20?',_0x110d12['value']);_0xa03c3b[_0x2aa6('0x45')]['skip']=!![];}}}return _0xa03c3b;}function parseModelFields(_0x3710c1,_0xd9e696){var _0x4bcdb6=squel['expr']();var _0x597c7c=_(_0x3710c1)[_0x2aa6('0x46')]()[_0x2aa6('0x40')](function(_0x2ff127){return _[_0x2aa6('0x47')](_0xd9e696,[_0x2aa6('0x48'),_0x2ff127])?_0x2ff127:undefined;})[_0x2aa6('0x49')]()[_0x2aa6('0x3c')]();if(_0x3710c1[_0x2aa6('0x4a')]){_0x597c7c['push'](_0x2aa6('0x4a'));}if(_0x3710c1['User']){_0x597c7c[_0x2aa6('0x1f')](_0x2aa6('0x43'));}if(_0x597c7c[_0x2aa6('0x27')]>0x0){_0x597c7c[_0x2aa6('0x20')](function(_0x3e9be5){if(_0x3e9be5==='ListId'){_0x4bcdb6[_0x2aa6('0x4b')](_0x2aa6('0x4c'),[][_0x2aa6('0x4d')](_0x3710c1[_0x3e9be5]));}else if(_0x3e9be5===_0x2aa6('0x4a')){var _0x38f602='%'+_0x3710c1[_0x3e9be5]+'%';_0x4bcdb6[_0x2aa6('0x4b')]('CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?',_0x38f602);}else if(_0x3e9be5===_0x2aa6('0x43')){_0x4bcdb6[_0x2aa6('0x4b')](_0x2aa6('0x4e'),_0x3710c1[_0x3e9be5]);}else{_0x4bcdb6[_0x2aa6('0x4b')]('c.'+_0x3e9be5+_0x2aa6('0x4f'),_0x3710c1[_0x3e9be5]);}});}return _0x4bcdb6;}function parseQueryParameters(_0x16e9ad,_0x377b57){var _0x5beed9=getSqlClauses();return Promise[_0x2aa6('0x50')]()[_0x2aa6('0x51')](function(){return parseModelFields(_0x16e9ad,_0x377b57);})[_0x2aa6('0x51')](function(_0x567031){_0x5beed9[_0x2aa6('0x52')][_0x2aa6('0x4b')](_0x567031);return parseTagParameter(_0x16e9ad['tag']);})[_0x2aa6('0x51')](function(_0x1e8b70){_0x5beed9[_0x2aa6('0x41')][_0x2aa6('0x44')]['and'](_0x1e8b70);return parseSearchFilter(_0x16e9ad[_0x2aa6('0x53')]);})[_0x2aa6('0x51')](function(_0x53fb29){_0x5beed9['filter']=_0x53fb29;return _0x5beed9;});}function checkListsRestrictions(_0x5906a1,_0x172b8d,_0x4151a3){var _0x182d5=squel['expr']();return Promise[_0x2aa6('0x50')]()[_0x2aa6('0x51')](function(){if(_0x172b8d[_0x2aa6('0x5')]&&_0x5906a1[_0x2aa6('0x3')]===_0x2aa6('0x4')&&!_0x4151a3){return _0x5906a1[_0x2aa6('0x54')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x56c66c){if(_0x56c66c){if(_0x56c66c[_0x2aa6('0x27')]===0x0){_0x182d5[_0x2aa6('0x4b')]('c.ListId\x20IS\x20NULL');}else{_0x182d5[_0x2aa6('0x4b')](_0x2aa6('0x4c'),_[_0x2aa6('0x40')](_0x56c66c,'id'));}}})['then'](function(){return _0x182d5;});}function buildContactsQuery(_0x3033e9,_0x56685c,_0x59f8d2,_0x6c4d80,_0x36c06c,_0x268d2c){if(_0x56685c){_0x56685c=_0x59f8d2['attributes'];}_0x3033e9=addFieldsToQuery(_0x3033e9,_0x56685c,_0x6c4d80,_0x268d2c,!![]);var _0x667fd2=squel[_0x2aa6('0x8')]();_0x667fd2=addFieldsToQuery(_0x667fd2,_0x56685c,_0x6c4d80,_0x268d2c,![]);if(_0x6c4d80||_0x268d2c){_0x3033e9=applyJoinClauses(_0x3033e9,!![]);_0x3033e9['group']('c.id');if(_0x59f8d2[_0x2aa6('0x55')]){_0x667fd2[_0x2aa6('0x55')](_0x59f8d2[_0x2aa6('0x55')]);}if(_0x59f8d2[_0x2aa6('0x56')]){_0x667fd2[_0x2aa6('0x56')](_0x59f8d2['offset']);}}else{_0x667fd2=applyJoinClauses(_0x667fd2,![]);_0x667fd2[_0x2aa6('0x57')](_0x2aa6('0x58'));if(_0x59f8d2[_0x2aa6('0x55')]){_0x3033e9[_0x2aa6('0x55')](_0x59f8d2[_0x2aa6('0x55')]);}if(_0x59f8d2['offset']){_0x3033e9[_0x2aa6('0x56')](_0x59f8d2[_0x2aa6('0x56')]);}}_0x667fd2[_0x2aa6('0x59')](_0x36c06c);if(_0x59f8d2[_0x2aa6('0x5a')]){_0x59f8d2[_0x2aa6('0x5a')][_0x2aa6('0x20')](function(_0x7ddf9e){_0x3033e9[_0x2aa6('0x5a')]('c.'+_0x7ddf9e[0x0],_0x7ddf9e[0x1]==='DESC'?![]:!![]);_0x667fd2[_0x2aa6('0x5a')](_0x2aa6('0x5b')+_0x7ddf9e[0x0],_0x7ddf9e[0x1]===_0x2aa6('0x5c')?![]:!![]);});}_0x667fd2[_0x2aa6('0x9')](_0x3033e9,'subqry');return _0x667fd2;}function getFilteredContacts(_0x48d53e){var _0x39a352=[];return db[_0x2aa6('0x3f')][_0x2aa6('0x5d')]({'attributes':['id','name','color'],'raw':!![]})[_0x2aa6('0x51')](function(_0x24c966){_0x39a352=_[_0x2aa6('0x5e')](_0x24c966,'id');var _0x5b7809={'type':db['Sequelize'][_0x2aa6('0x5f')]['SELECT'],'model':db[_0x2aa6('0x60')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x2aa6('0x61')]['query'](_0x48d53e[_0x2aa6('0x62')](),_0x5b7809);})[_0x2aa6('0x51')](function(_0x137f6e){_0x137f6e[_0x2aa6('0x20')](function(_0x109f2d){if(_0x109f2d[_0x2aa6('0x1d')]){_0x109f2d[_0x2aa6('0x63')]=[];_0x109f2d[_0x2aa6('0x1d')][_0x2aa6('0x26')](',')[_0x2aa6('0x20')](function(_0x215314){_0x109f2d[_0x2aa6('0x63')][_0x2aa6('0x1f')](_0x39a352[_0x215314]);});}delete _0x109f2d[_0x2aa6('0x1d')];});return _0x137f6e;});}function countFilteredContacts(_0x2ec301,_0x59f18c){var _0x1ceb41=_0x2ec301['clone']();_0x1ceb41['field']('COUNT(*)');_0x1ceb41=applyJoinClauses(_0x1ceb41,!![]);_0x2ec301[_0x2aa6('0x57')](_0x2aa6('0x64'));var _0x281679=utils[_0x2aa6('0x23')](_0x59f18c);if(!_[_0x2aa6('0x65')](_0x281679)){_0x1ceb41[_0x2aa6('0xa')]('t.id\x20IN\x20?',_0x281679);}var _0x564aa7={'type':db[_0x2aa6('0x66')][_0x2aa6('0x5f')][_0x2aa6('0x67')],'raw':!![]};return db[_0x2aa6('0x61')][_0x2aa6('0x68')](_0x1ceb41[_0x2aa6('0x62')](),_0x564aa7)['then'](function(_0x5d1b82){return _0x5d1b82[0x0][_0x2aa6('0x69')];});}module[_0x2aa6('0x6a')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0x825d=['keyBy','QueryTypes','SELECT','CmContact','query','Tags','COUNT(*)','isEmpty','t.id\x20IN\x20?','Sequelize','sequelize','toString','exports','squel','../parsers/advancedSearch','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','ListId','autocomplete','true','select','from','cm_contacts','where','c.deletedAt\x20IS\x20NULL','subqry','left_join','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','fax','email','CompanyId','updatedAt','TagIds','forEach','field','GROUP_CONCAT(DISTINCT\x20t.id)','expr','getSelectedTags','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','parseSearch','sqlOperator','conditions','length','find','name','dateOfBirth','fieldType','datetime','castTo','buildExpression','value','start','end','Tag','map','tags','and','ids','User','clause','keys','compact','concat','Contact','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','uc.UserId\x20=\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','group','limit','offset','subqry.id','order','DESC','subqry.','findAll','color'];(function(_0x171d07,_0x59c974){var _0x135563=function(_0x2aea19){while(--_0x2aea19){_0x171d07['push'](_0x171d07['shift']());}};_0x135563(++_0x59c974);}(_0x825d,0x13f));var _0xd825=function(_0x4ddfb1,_0x3c2f40){_0x4ddfb1=_0x4ddfb1-0x0;var _0x2c44f5=_0x825d[_0x4ddfb1];return _0x2c44f5;};'use strict';var _=require('lodash');var squel=require(_0xd825('0x0'));var as=require(_0xd825('0x1'));var qs=require(_0xd825('0x2'));var utils=require(_0xd825('0x3'));var db=require(_0xd825('0x4'))['db'];function skipContactsQuery(_0x7656a,_0x178a53){var _0x190eb9=![];if(_0x7656a['role']===_0xd825('0x5')&&!_0x178a53[_0xd825('0x6')]&&!_0x178a53[_0xd825('0x7')]&&_0x178a53[_0xd825('0x8')]!==_0xd825('0x9')){_0x190eb9=!![];}return _0x190eb9;}function getContactsSubquery(){return squel[_0xd825('0xa')]()[_0xd825('0xb')](_0xd825('0xc'),'c')[_0xd825('0xd')](_0xd825('0xe'));}function applyJoinClauses(_0x1a9214,_0x5f5c0f){var _0x3523c9=_0x5f5c0f?'c':_0xd825('0xf');_0x1a9214[_0xd825('0x10')]('cm_user_has_contacts','uc','uc.CmContactId\x20=\x20'+_0x3523c9+_0xd825('0x11'))[_0xd825('0x10')](_0xd825('0x12'),'ct',_0xd825('0x13')+_0x3523c9+_0xd825('0x11'))[_0xd825('0x10')](_0xd825('0x14'),'t',_0xd825('0x15'));return _0x1a9214;}function addFieldsToQuery(_0x3c8c20,_0x51bc52,_0x4b6115,_0x5d514e,_0x28fd73){var _0x1a7551=_0x28fd73?'c':_0xd825('0xf');if(!_0x51bc52){_0x51bc52=['id',_0xd825('0x16'),'lastName',_0xd825('0x17'),'mobile',_0xd825('0x18'),_0xd825('0x19'),_0xd825('0x7'),_0xd825('0x1a'),'createdAt',_0xd825('0x1b'),'deletedAt',_0xd825('0x1c')];}else if(!_0x51bc52['includes']('id')){_0x51bc52['push']('id');}var _0x22e452=_0x4b6115&&_0x28fd73||!_0x4b6115&&!_0x28fd73;if(_0x5d514e){_0x22e452=_0x5d514e&&_0x28fd73||!_0x5d514e&&!_0x28fd73;}_0x51bc52[_0xd825('0x1d')](function(_0x1fe73f){if(_0x1fe73f===_0xd825('0x1c')){if(_0x22e452){_0x3c8c20[_0xd825('0x1e')](_0xd825('0x1f'),_0x1fe73f);}else if(_0x4b6115||_0x5d514e){_0x3c8c20[_0xd825('0x1e')](_0x1a7551+'.'+_0x1fe73f);}}else{_0x3c8c20[_0xd825('0x1e')](_0x1a7551+'.'+_0x1fe73f);}});return _0x3c8c20;}function getSqlClauses(){var _0x5a2871={'default':squel[_0xd825('0x20')](),'fields':squel[_0xd825('0x20')](),'filter':squel[_0xd825('0x20')](),'tags':{'clause':squel[_0xd825('0x20')](),'ids':null},'user':{'clause':squel[_0xd825('0x20')](),'skip':![]}};return _0x5a2871;}function parseTagParameter(_0x1b6043){var _0x2005f9=squel[_0xd825('0x20')]();if(_0x1b6043){var _0x21d62f=utils[_0xd825('0x21')](_0x1b6043);_0x21d62f[_0xd825('0x1d')](function(_0x1a1d52){_0x2005f9['or'](_0xd825('0x22'),'%,'+_0x1a1d52+',%');});}return _0x2005f9;}function parseSearchFilter(_0x363dcf){var _0x527da1=squel['expr']();if(_0x363dcf){var _0x44eb64=_0x363dcf[_0xd825('0x23')]('\x5c','\x5c\x5c')[_0xd825('0x23')](/'/g,'\x27\x27');if(_0x44eb64[_0xd825('0x24')]('\x20')['length']>0x1){_0x527da1['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd825('0x25')](_0x44eb64,!![]),null);}else{if(qs[_0xd825('0x26')](_0x44eb64)){_0x527da1['or'](_0xd825('0x27'),_0x44eb64+'%');_0x527da1['or'](_0xd825('0x28'),_0x44eb64+'%');_0x527da1['or'](_0xd825('0x29'),_0x44eb64+'%');_0x527da1['or'](_0xd825('0x2a'),_0x44eb64+'%');}else if(qs['isEmail'](_0x44eb64)){_0x527da1['or']('c.email\x20LIKE\x20?',_0x44eb64+'%');}else{_0x527da1['or']('c.firstName\x20LIKE\x20?','%'+_0x44eb64+'%');_0x527da1['or']('c.lastName\x20LIKE\x20?','%'+_0x44eb64+'%');_0x527da1['or'](_0xd825('0x2b'),'%'+_0x44eb64+'%');}}}return _0x527da1;}function parseAdvancedSearchFilter(_0x267cf1,_0x3026a3){var _0x4e7b52=getSqlClauses();var _0x1a20ba=as[_0xd825('0x2c')](_0x267cf1);var _0x225357=_0x1a20ba[_0xd825('0x2d')];for(var _0x1db48f=0x0;_0x1db48f<_0x1a20ba[_0xd825('0x2e')][_0xd825('0x2f')];_0x1db48f++){var _0x3907c3=_0x1a20ba[_0xd825('0x2e')][_0x1db48f];var _0x1d4a2b='c';var _0x577d05=_[_0xd825('0x30')](_0x3026a3,[_0xd825('0x31'),_0x3907c3[_0xd825('0x1e')]]);if(_0x577d05){if(_0x3907c3[_0xd825('0x1e')]===_0xd825('0x32')||_0x577d05[_0xd825('0x33')]===_0xd825('0x34')){_0x3907c3[_0xd825('0x35')]='DATE';}var _0x54aad9=as[_0xd825('0x36')](_0x1d4a2b,_0x577d05['type'],_0x3907c3);_0x4e7b52['default'][_0x225357](_0x54aad9['text'],_0x54aad9[_0xd825('0x37')][_0xd825('0x38')],_0x54aad9[_0xd825('0x37')][_0xd825('0x39')]);}else{if(_0x3907c3[_0xd825('0x1e')]===_0xd825('0x3a')){var _0x1dcbf9=_0x3907c3[_0xd825('0x37')][_0xd825('0x24')](',')[_0xd825('0x3b')](function(_0x39da90){return Number(_0x39da90);});var _0x2cc901=parseTagParameter(_0x1dcbf9);_0x4e7b52[_0xd825('0x3c')]['clause'][_0xd825('0x3d')](_0x2cc901);_0x4e7b52[_0xd825('0x3c')][_0xd825('0x3e')]=_0x1dcbf9;}else if(_0x3907c3[_0xd825('0x1e')]===_0xd825('0x3f')){_0x4e7b52['user'][_0xd825('0x40')]['and']('uc.UserId\x20=\x20?',_0x3907c3[_0xd825('0x37')]);_0x4e7b52['user']['skip']=!![];}}}return _0x4e7b52;}function parseModelFields(_0x16389c,_0x47ef53){var _0x4fa6a6=squel['expr']();var _0x4e37a2=_(_0x16389c)[_0xd825('0x41')]()[_0xd825('0x3b')](function(_0x3b9c7f){return _['some'](_0x47ef53,[_0xd825('0x31'),_0x3b9c7f])?_0x3b9c7f:undefined;})[_0xd825('0x42')]()[_0xd825('0x37')]();if(_0x16389c['Contact']){_0x4e37a2['push']('Contact');}if(_0x16389c[_0xd825('0x3f')]){_0x4e37a2['push'](_0xd825('0x3f'));}if(_0x4e37a2[_0xd825('0x2f')]>0x0){_0x4e37a2[_0xd825('0x1d')](function(_0x5bd354){if(_0x5bd354===_0xd825('0x7')){_0x4fa6a6[_0xd825('0x3d')]('c.ListId\x20IN\x20?',[][_0xd825('0x43')](_0x16389c[_0x5bd354]));}else if(_0x5bd354===_0xd825('0x44')){var _0x5083bb='%'+_0x16389c[_0x5bd354]+'%';_0x4fa6a6[_0xd825('0x3d')](_0xd825('0x45'),_0x5083bb);}else if(_0x5bd354===_0xd825('0x3f')){_0x4fa6a6[_0xd825('0x3d')](_0xd825('0x46'),_0x16389c[_0x5bd354]);}else{_0x4fa6a6[_0xd825('0x3d')]('c.'+_0x5bd354+_0xd825('0x47'),_0x16389c[_0x5bd354]);}});}return _0x4fa6a6;}function parseQueryParameters(_0x21bdd8,_0x1ba197){var _0x74d21f=getSqlClauses();return Promise[_0xd825('0x48')]()[_0xd825('0x49')](function(){return parseModelFields(_0x21bdd8,_0x1ba197);})[_0xd825('0x49')](function(_0x31b670){_0x74d21f[_0xd825('0x4a')][_0xd825('0x3d')](_0x31b670);return parseTagParameter(_0x21bdd8[_0xd825('0x4b')]);})[_0xd825('0x49')](function(_0x22c322){_0x74d21f[_0xd825('0x3c')][_0xd825('0x40')][_0xd825('0x3d')](_0x22c322);return parseSearchFilter(_0x21bdd8[_0xd825('0x4c')]);})[_0xd825('0x49')](function(_0x35e76e){_0x74d21f['filter']=_0x35e76e;return _0x74d21f;});}function checkListsRestrictions(_0x56b964,_0xa01863,_0x19fa69){var _0x5f138a=squel[_0xd825('0x20')]();return Promise['resolve']()[_0xd825('0x49')](function(){if(_0xa01863[_0xd825('0x6')]&&_0x56b964[_0xd825('0x4d')]===_0xd825('0x5')&&!_0x19fa69){return _0x56b964['getLists']({'attributes':['id'],'raw':!![]});}})[_0xd825('0x49')](function(_0x578168){if(_0x578168){if(_0x578168[_0xd825('0x2f')]===0x0){_0x5f138a[_0xd825('0x3d')](_0xd825('0x4e'));}else{_0x5f138a[_0xd825('0x3d')](_0xd825('0x4f'),_[_0xd825('0x3b')](_0x578168,'id'));}}})[_0xd825('0x49')](function(){return _0x5f138a;});}function buildContactsQuery(_0x53a9d3,_0x2c2824,_0x1746b5,_0x1a6dc2,_0x8f47e,_0x56080f){if(_0x2c2824){_0x2c2824=_0x1746b5['attributes'];}_0x53a9d3=addFieldsToQuery(_0x53a9d3,_0x2c2824,_0x1a6dc2,_0x56080f,!![]);var _0x27d091=squel[_0xd825('0xa')]();_0x27d091=addFieldsToQuery(_0x27d091,_0x2c2824,_0x1a6dc2,_0x56080f,![]);if(_0x1a6dc2||_0x56080f){_0x53a9d3=applyJoinClauses(_0x53a9d3,!![]);_0x53a9d3[_0xd825('0x50')]('c.id');if(_0x1746b5[_0xd825('0x51')]){_0x27d091[_0xd825('0x51')](_0x1746b5[_0xd825('0x51')]);}if(_0x1746b5[_0xd825('0x52')]){_0x27d091['offset'](_0x1746b5[_0xd825('0x52')]);}}else{_0x27d091=applyJoinClauses(_0x27d091,![]);_0x27d091[_0xd825('0x50')](_0xd825('0x53'));if(_0x1746b5['limit']){_0x53a9d3['limit'](_0x1746b5['limit']);}if(_0x1746b5['offset']){_0x53a9d3[_0xd825('0x52')](_0x1746b5[_0xd825('0x52')]);}}_0x27d091['having'](_0x8f47e);if(_0x1746b5[_0xd825('0x54')]){_0x1746b5[_0xd825('0x54')][_0xd825('0x1d')](function(_0x648a2e){_0x53a9d3[_0xd825('0x54')]('c.'+_0x648a2e[0x0],_0x648a2e[0x1]===_0xd825('0x55')?![]:!![]);_0x27d091[_0xd825('0x54')](_0xd825('0x56')+_0x648a2e[0x0],_0x648a2e[0x1]===_0xd825('0x55')?![]:!![]);});}_0x27d091[_0xd825('0xb')](_0x53a9d3,_0xd825('0xf'));return _0x27d091;}function getFilteredContacts(_0xb3e16a){var _0x3f4e79=[];return db['Tag'][_0xd825('0x57')]({'attributes':['id',_0xd825('0x31'),_0xd825('0x58')],'raw':!![]})[_0xd825('0x49')](function(_0x282345){_0x3f4e79=_[_0xd825('0x59')](_0x282345,'id');var _0x2c1ac1={'type':db['Sequelize'][_0xd825('0x5a')][_0xd825('0x5b')],'model':db[_0xd825('0x5c')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0xd825('0x5d')](_0xb3e16a['toString'](),_0x2c1ac1);})[_0xd825('0x49')](function(_0x31ba10){_0x31ba10[_0xd825('0x1d')](function(_0x4445e3){if(_0x4445e3[_0xd825('0x1c')]){_0x4445e3[_0xd825('0x5e')]=[];_0x4445e3[_0xd825('0x1c')][_0xd825('0x24')](',')['forEach'](function(_0x57f17f){_0x4445e3[_0xd825('0x5e')]['push'](_0x3f4e79[_0x57f17f]);});}delete _0x4445e3[_0xd825('0x1c')];});return _0x31ba10;});}function countFilteredContacts(_0x40912c,_0x4e4b72){var _0x5be873=_0x40912c['clone']();_0x5be873[_0xd825('0x1e')](_0xd825('0x5f'));_0x5be873=applyJoinClauses(_0x5be873,!![]);_0x40912c[_0xd825('0x50')]('c.id');var _0x4aca77=utils['getSelectedTags'](_0x4e4b72);if(!_[_0xd825('0x60')](_0x4aca77)){_0x5be873['where'](_0xd825('0x61'),_0x4aca77);}var _0x2be867={'type':db[_0xd825('0x62')][_0xd825('0x5a')][_0xd825('0x5b')],'raw':!![]};return db[_0xd825('0x63')][_0xd825('0x5d')](_0x5be873[_0xd825('0x64')](),_0x2be867)[_0xd825('0x49')](function(_0x3fd873){return _0x3fd873[0x0][_0xd825('0x5f')];});}module[_0xd825('0x65')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 57a94fe..e79338a 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 _0x2e1b=['binary','write','end','final','close','decryptFile','update','unlink','encryptString','secret','utf8','base64','decryptString','createDecipher','crypto','lodash','../../config/environment','../../config/logger','app','secrets','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','indexOf','encryptFile','createReadStream','createWriteStream','data'];(function(_0x76d88d,_0x48b0f2){var _0x2fa9e0=function(_0x55aac5){while(--_0x55aac5){_0x76d88d['push'](_0x76d88d['shift']());}};_0x2fa9e0(++_0x48b0f2);}(_0x2e1b,0xc8));var _0xb2e1=function(_0x30325b,_0x245c08){_0x30325b=_0x30325b-0x0;var _0x441239=_0x2e1b[_0x30325b];return _0x441239;};'use strict';var crypto=require(_0xb2e1('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xb2e1('0x1'));var config=require(_0xb2e1('0x2'));var logger=require(_0xb2e1('0x3'))(_0xb2e1('0x4'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xb2e1('0x5')]['session'],'algorithm':_0xb2e1('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0xb2e1('0x7')]&&config['encrypt'][_0xb2e1('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0xb2e1('0x8')]);if(isSupported){fileOptions[_0xb2e1('0x8')]=config[_0xb2e1('0x7')][_0xb2e1('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0xb2e1('0x9')](',\x20');logger['error'](config['encrypt']['algorithm'],_0xb2e1('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x27bf66){return AES_SUPPORTED_RX['test'](_0x27bf66);}function getSupportedCiphers(){return crypto[_0xb2e1('0xb')]()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0xca925e){return getSupportedCiphers()[_0xb2e1('0xc')](_0xca925e)>-0x1;}function combineOptions(_0x14b2d7){var _0x390bd0={};for(var _0x3e0a2f in fileOptions){if(fileOptions['hasOwnProperty'](_0x3e0a2f)){_0x390bd0[_0x3e0a2f]=fileOptions[_0x3e0a2f];}}if(_0x14b2d7){for(var _0xe11247 in _0x14b2d7){if(_0x14b2d7['hasOwnProperty'](_0xe11247)){_0x390bd0[_0xe11247]=_0x14b2d7[_0xe11247];}}}return _0x390bd0;}exports[_0xb2e1('0xd')]=function(_0x2f5da7,_0x3af0e6,_0x36a8a7,_0x4bf932){return new BPromise(function(_0x470c12,_0x47fe87){_0x4bf932=combineOptions(_0x4bf932);var _0x1bb060=new Buffer(_0x36a8a7);var _0x504727=fs[_0xb2e1('0xe')](_0x2f5da7);var _0x58f77f=fs[_0xb2e1('0xf')](_0x3af0e6);var _0x199451=crypto['createCipher'](_0x4bf932[_0xb2e1('0x8')],_0x1bb060);_0x504727['on'](_0xb2e1('0x10'),function(_0x150361){var _0x2c2e98=new Buffer(_0x199451['update'](_0x150361),_0xb2e1('0x11'));_0x58f77f[_0xb2e1('0x12')](_0x2c2e98);});_0x504727['on'](_0xb2e1('0x13'),function(){try{var _0x1a0abd=new Buffer(_0x199451[_0xb2e1('0x14')](_0xb2e1('0x11')),_0xb2e1('0x11'));_0x58f77f[_0xb2e1('0x12')](_0x1a0abd);_0x58f77f[_0xb2e1('0x13')]();_0x58f77f['on'](_0xb2e1('0x15'),function(){return _0x470c12(_0x3af0e6);});}catch(_0x50c982){fs['unlink'](_0x3af0e6);return _0x47fe87(_0x50c982);}});});};exports[_0xb2e1('0x16')]=function(_0x16bc52,_0x21e5c3,_0x4f0bc7,_0x4f9cb5){return new BPromise(function(_0x8f668c,_0x408bd2){_0x4f9cb5=combineOptions(_0x4f9cb5);var _0x295a6a=new Buffer(_0x4f0bc7);var _0x475420=fs['createReadStream'](_0x16bc52);var _0x5cc0d1=fs['createWriteStream'](_0x21e5c3);var _0x434892=crypto['createDecipher'](_0x4f9cb5[_0xb2e1('0x8')],_0x295a6a);_0x475420['on']('data',function(_0x2d562c){var _0x5a7668=new Buffer(_0x434892[_0xb2e1('0x17')](_0x2d562c),_0xb2e1('0x11'));_0x5cc0d1[_0xb2e1('0x12')](_0x5a7668);});_0x475420['on'](_0xb2e1('0x13'),function(){try{var _0x3b01dd=new Buffer(_0x434892[_0xb2e1('0x14')](_0xb2e1('0x11')),_0xb2e1('0x11'));_0x5cc0d1[_0xb2e1('0x12')](_0x3b01dd);_0x5cc0d1['end']();_0x5cc0d1['on'](_0xb2e1('0x15'),function(){return _0x8f668c(_0x21e5c3);});}catch(_0x133354){fs[_0xb2e1('0x18')](_0x21e5c3);return _0x408bd2(_0x133354);}});});};exports[_0xb2e1('0x19')]=function(_0x41fe7b,_0x5353b7,_0x470ce2){var _0x58c0c7=_0x470ce2||stringOptions[_0xb2e1('0x8')];var _0xea3ff6=_0x5353b7||stringOptions[_0xb2e1('0x1a')];var _0x55b7d2=crypto['createCipher'](_0x58c0c7,_0xea3ff6);var _0x4c1a8c=_0x55b7d2[_0xb2e1('0x17')](_0x41fe7b,_0xb2e1('0x1b'),_0xb2e1('0x1c'));_0x4c1a8c+=_0x55b7d2[_0xb2e1('0x14')](_0xb2e1('0x1c'));return _0x4c1a8c;};exports[_0xb2e1('0x1d')]=function(_0x5121f8,_0x364e1e,_0x9d74c8){var _0x5ca1bf=_0x9d74c8||stringOptions[_0xb2e1('0x8')];var _0x58d57b=_0x364e1e||stringOptions[_0xb2e1('0x1a')];var _0x32f9a3=crypto[_0xb2e1('0x1e')](_0x5ca1bf,_0x58d57b);var _0x16fbf6=_0x32f9a3[_0xb2e1('0x17')](_0x5121f8,_0xb2e1('0x1c'),_0xb2e1('0x1b'));_0x16fbf6+=_0x32f9a3[_0xb2e1('0x14')](_0xb2e1('0x1b'));return _0x16fbf6;}; \ No newline at end of file +var _0xe876=['base64','decryptString','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createCipher','data','update','binary','write','end','final','close','unlink','createReadStream','createWriteStream','createDecipher','encryptString','secret','utf8'];(function(_0x59d424,_0x2ce287){var _0x12641c=function(_0x498c06){while(--_0x498c06){_0x59d424['push'](_0x59d424['shift']());}};_0x12641c(++_0x2ce287);}(_0xe876,0x1f1));var _0x6e87=function(_0x308f8c,_0x4eb53c){_0x308f8c=_0x308f8c-0x0;var _0x2e8ace=_0xe876[_0x308f8c];return _0x2e8ace;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x6e87('0x0'));var config=require(_0x6e87('0x1'));var logger=require(_0x6e87('0x2'))(_0x6e87('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x6e87('0x4')][_0x6e87('0x5')],'algorithm':_0x6e87('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x6e87('0x7')]&&config[_0x6e87('0x7')][_0x6e87('0x8')]){var isSupported=isAlgorithmSupported(config[_0x6e87('0x7')][_0x6e87('0x8')]);if(isSupported){fileOptions[_0x6e87('0x8')]=config[_0x6e87('0x7')][_0x6e87('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x6e87('0x9')](',\x20');logger['error'](config['encrypt'][_0x6e87('0x8')],_0x6e87('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0x19d153){return AES_SUPPORTED_RX['test'](_0x19d153);}function getSupportedCiphers(){return crypto[_0x6e87('0xb')]()[_0x6e87('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x2e5bd7){return getSupportedCiphers()[_0x6e87('0xd')](_0x2e5bd7)>-0x1;}function combineOptions(_0x3dcc2b){var _0x45bd24={};for(var _0x2db2a2 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2db2a2)){_0x45bd24[_0x2db2a2]=fileOptions[_0x2db2a2];}}if(_0x3dcc2b){for(var _0x1a5ac6 in _0x3dcc2b){if(_0x3dcc2b[_0x6e87('0xe')](_0x1a5ac6)){_0x45bd24[_0x1a5ac6]=_0x3dcc2b[_0x1a5ac6];}}}return _0x45bd24;}exports[_0x6e87('0xf')]=function(_0xd54c16,_0x348147,_0xb54986,_0x448c65){return new BPromise(function(_0x1eb264,_0xdbe853){_0x448c65=combineOptions(_0x448c65);var _0x26c639=new Buffer(_0xb54986);var _0x41a306=fs['createReadStream'](_0xd54c16);var _0x5c6ce8=fs['createWriteStream'](_0x348147);var _0x40606a=crypto[_0x6e87('0x10')](_0x448c65['algorithm'],_0x26c639);_0x41a306['on'](_0x6e87('0x11'),function(_0x5c2d5c){var _0x44416d=new Buffer(_0x40606a[_0x6e87('0x12')](_0x5c2d5c),_0x6e87('0x13'));_0x5c6ce8[_0x6e87('0x14')](_0x44416d);});_0x41a306['on'](_0x6e87('0x15'),function(){try{var _0x42836e=new Buffer(_0x40606a[_0x6e87('0x16')]('binary'),_0x6e87('0x13'));_0x5c6ce8[_0x6e87('0x14')](_0x42836e);_0x5c6ce8['end']();_0x5c6ce8['on'](_0x6e87('0x17'),function(){return _0x1eb264(_0x348147);});}catch(_0x5ae738){fs[_0x6e87('0x18')](_0x348147);return _0xdbe853(_0x5ae738);}});});};exports['decryptFile']=function(_0x3d68e7,_0x1de0a7,_0x20968d,_0x40c05a){return new BPromise(function(_0x202497,_0x9344d3){_0x40c05a=combineOptions(_0x40c05a);var _0x3c18e4=new Buffer(_0x20968d);var _0x599ea4=fs[_0x6e87('0x19')](_0x3d68e7);var _0x1ff530=fs[_0x6e87('0x1a')](_0x1de0a7);var _0x129c2b=crypto[_0x6e87('0x1b')](_0x40c05a[_0x6e87('0x8')],_0x3c18e4);_0x599ea4['on'](_0x6e87('0x11'),function(_0x58b29c){var _0x507911=new Buffer(_0x129c2b[_0x6e87('0x12')](_0x58b29c),'binary');_0x1ff530[_0x6e87('0x14')](_0x507911);});_0x599ea4['on'](_0x6e87('0x15'),function(){try{var _0x82f6=new Buffer(_0x129c2b['final']('binary'),_0x6e87('0x13'));_0x1ff530[_0x6e87('0x14')](_0x82f6);_0x1ff530[_0x6e87('0x15')]();_0x1ff530['on']('close',function(){return _0x202497(_0x1de0a7);});}catch(_0x3976db){fs['unlink'](_0x1de0a7);return _0x9344d3(_0x3976db);}});});};exports[_0x6e87('0x1c')]=function(_0xd2c89e,_0x49f93a,_0x53a3f0){var _0x14bae3=_0x53a3f0||stringOptions[_0x6e87('0x8')];var _0x35192a=_0x49f93a||stringOptions[_0x6e87('0x1d')];var _0x458021=crypto['createCipher'](_0x14bae3,_0x35192a);var _0x2bf174=_0x458021[_0x6e87('0x12')](_0xd2c89e,_0x6e87('0x1e'),_0x6e87('0x1f'));_0x2bf174+=_0x458021[_0x6e87('0x16')](_0x6e87('0x1f'));return _0x2bf174;};exports[_0x6e87('0x20')]=function(_0x4b2240,_0x246dbc,_0x216de7){var _0x3a7eda=_0x216de7||stringOptions['algorithm'];var _0x29d80f=_0x246dbc||stringOptions['secret'];var _0x51466c=crypto['createDecipher'](_0x3a7eda,_0x29d80f);var _0x37384b=_0x51466c[_0x6e87('0x12')](_0x4b2240,_0x6e87('0x1f'),_0x6e87('0x1e'));_0x37384b+=_0x51466c[_0x6e87('0x16')](_0x6e87('0x1e'));return _0x37384b;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 0c5727a..7cf993e 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 _0x545a=['forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','join','mkdirSync','each','%s%d.%s','%s.%s','csv','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','finally','exit','path','lodash','bluebird','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range'];(function(_0x2eb398,_0x10491a){var _0x5b14bb=function(_0xa89c41){while(--_0xa89c41){_0x2eb398['push'](_0x2eb398['shift']());}};_0x5b14bb(++_0x10491a);}(_0x545a,0x13a));var _0xa545=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x545a[_0x1b2ff7];return _0x31656a;};'use strict';var util=require('util');var path=require(_0xa545('0x0'));var _=require(_0xa545('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0xa545('0x2'));var zipdir=require(_0xa545('0x3'));var rimraf=require('rimraf');var db=require(_0xa545('0x4'))['db'];var dbH=require('../../mysqldb')[_0xa545('0x5')];var logger=require(_0xa545('0x6'))(_0xa545('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xa545('0x8')][0x2]);var QUERY=process[_0xa545('0x8')][0x3];var PATH=process[_0xa545('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5084e6,_0x57f634){var _0x4e3fc4={'status':_0x5084e6};var _0x56a261={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x57f634){_0x4e3fc4[_0xa545('0x9')]=_0x57f634;}return db[_0xa545('0xa')][_0xa545('0xb')](_0x4e3fc4,_0x56a261);}function main(){var _0x14a69b=0x1388;var _0x4dfd5c;logger[_0xa545('0xc')](util['format'](_0xa545('0xd'),EXTRACTED_REPORT_ID,_0xa545('0xe')));return db[_0xa545('0xf')][_0xa545('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa545('0x11'),_0xa545('0x12')]})[_0xa545('0x13')](function(_0x95eafe){if(_0x95eafe){_0x4dfd5c=_0x95eafe;_0x14a69b=_0x4dfd5c[_0xa545('0x12')]||0x1388;}})[_0xa545('0x13')](function(){return dbH[_0xa545('0x14')][_0xa545('0x15')](util[_0xa545('0x16')](_0xa545('0x17'),QUERY),{'type':dbH[_0xa545('0x14')][_0xa545('0x18')][_0xa545('0x19')]});})[_0xa545('0x13')](function(_0x1c420a){if(!_0x1c420a[0x0][_0xa545('0x1a')]){return analyticExtractedReport('Empty');}var _0x53eed9=[];var _0x44b2c0=0x0;if(_0x4dfd5c[_0xa545('0x11')]){if(_0x1c420a&&_0x1c420a[_0xa545('0x1b')]){var _0x3bef7c=_[_0xa545('0x1c')](_0x1c420a[0x0]['num']/_0x14a69b);var _0x465551=Number['isInteger'](_0x1c420a[0x0][_0xa545('0x1a')]/_0x14a69b)?_0x1c420a[0x0]['num']%_0x14a69b:0x0;_0x3bef7c[_0xa545('0x1d')](function(_0x44ffb2){if(_0x44ffb2>0x0){_0x44b2c0+=_0x14a69b;}_0x53eed9[_0xa545('0x1e')](dbH[_0xa545('0x14')][_0xa545('0x15')](util[_0xa545('0x16')](_0xa545('0x1f'),QUERY,_0x14a69b,_0x44b2c0),{'type':dbH[_0xa545('0x14')][_0xa545('0x18')][_0xa545('0x19')]}));});if(_0x465551>0x0){_0x44b2c0+=_0x14a69b;_0x53eed9['push'](dbH[_0xa545('0x14')][_0xa545('0x15')](util[_0xa545('0x16')](_0xa545('0x1f'),QUERY,_0x465551,_0x44b2c0),{'type':dbH[_0xa545('0x14')][_0xa545('0x18')]['SELECT']}));}}}else{_0x53eed9[_0xa545('0x1e')](dbH[_0xa545('0x14')][_0xa545('0x15')](QUERY,{'type':dbH[_0xa545('0x14')][_0xa545('0x18')]['SELECT']}));}var _0x5231ef=path[_0xa545('0x20')](PATH);var _0x4f45fc=path[_0xa545('0x21')](PATH,_0xa545('0x22'));var _0x5467a8=_0x4dfd5c[_0xa545('0x11')]&&_0x53eed9[_0xa545('0x1b')]>0x1;var _0x8b5a19=[];if(!fs['existsSync'](path[_0xa545('0x23')](_0x5231ef,_0x4f45fc))&&_0x5467a8){fs[_0xa545('0x24')](path[_0xa545('0x23')](_0x5231ef,_0x4f45fc));}return BPromise[_0xa545('0x25')](_0x53eed9,function(_0x31eecf){_0x8b5a19['push'](_0x31eecf);})[_0xa545('0x13')](function(){for(var _0x45688a=0x0;_0x45688a<_0x8b5a19['length'];_0x45688a+=0x1){var _0x106d90;var _0x5d9f4c=_0x8b5a19[_0x45688a];if(_0x5467a8){_0x106d90=path[_0xa545('0x23')](_0x5231ef,_0x4f45fc,util[_0xa545('0x16')](_0xa545('0x26'),_0x4f45fc,_0x45688a,'csv'));}else{_0x106d90=path[_0xa545('0x23')](_0x5231ef,util[_0xa545('0x16')](_0xa545('0x27'),_0x4f45fc,_0xa545('0x28')));}fs['writeFileSync'](_0x106d90,csv(_0x5d9f4c));}})['then'](function(){if(_0x5467a8){return new Promise(function(_0x2c30be){zipdir(path[_0xa545('0x23')](_0x5231ef,_0x4f45fc),{'saveTo':path[_0xa545('0x23')](_0x5231ef,util[_0xa545('0x16')]('%s.%s',_0x4f45fc,'zip'))},function(_0x54bb72,_0x36f2bf){rimraf(path[_0xa545('0x23')](_0x5231ef,_0x4f45fc),function(){});_0x2c30be(_0xa545('0x29'));});});}})[_0xa545('0x13')](function(){logger['info'](util[_0xa545('0x16')](_0xa545('0x2a'),EXTRACTED_REPORT_ID,_0xa545('0xe')));return analyticExtractedReport(_0xa545('0x2b'),_0x5467a8?util[_0xa545('0x16')](_0xa545('0x27'),_0x4f45fc,_0x5467a8?_0xa545('0x2c'):_0xa545('0x28')):null);});})[_0xa545('0x2d')](function(_0x4437b6){logger[_0xa545('0xc')](util[_0xa545('0x16')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa545('0xe')),util[_0xa545('0x2e')](_0x4437b6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xa545('0x2f')](function(){process[_0xa545('0x30')](EXIT_CODE);});}main(); \ No newline at end of file +var _0xb0ee=['info','format','Setting','find','split','splitSizeCsv','sequelize','query','SELECT','then','num','Empty','length','range','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','dirname','basename','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','zip\x20finished','CSV','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','exit','util','path','lodash','to-csv','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport'];(function(_0x41c3bc,_0x271ee0){var _0x56f6f1=function(_0x37054e){while(--_0x37054e){_0x41c3bc['push'](_0x41c3bc['shift']());}};_0x56f6f1(++_0x271ee0);}(_0xb0ee,0x18b));var _0xeb0e=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0xb0ee[_0x4e9d3c];return _0x2d0825;};'use strict';var util=require(_0xeb0e('0x0'));var path=require(_0xeb0e('0x1'));var _=require(_0xeb0e('0x2'));var csv=require(_0xeb0e('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xeb0e('0x4'))['db'];var dbH=require(_0xeb0e('0x4'))[_0xeb0e('0x5')];var logger=require(_0xeb0e('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xeb0e('0x7')][0x2]);var QUERY=process[_0xeb0e('0x7')][0x3];var PATH=process[_0xeb0e('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x388c23,_0x401daf){var _0x343601={'status':_0x388c23};var _0x21e66d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x401daf){_0x343601[_0xeb0e('0x8')]=_0x401daf;}return db[_0xeb0e('0x9')]['update'](_0x343601,_0x21e66d);}function main(){var _0x1840ba=0x1388;var _0x569f8c;logger[_0xeb0e('0xa')](util[_0xeb0e('0xb')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0xeb0e('0xc')][_0xeb0e('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeb0e('0xe'),_0xeb0e('0xf')]})['then'](function(_0x33e5ec){if(_0x33e5ec){_0x569f8c=_0x33e5ec;_0x1840ba=_0x569f8c[_0xeb0e('0xf')]||0x1388;}})['then'](function(){return dbH[_0xeb0e('0x10')][_0xeb0e('0x11')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xeb0e('0x10')]['QueryTypes'][_0xeb0e('0x12')]});})[_0xeb0e('0x13')](function(_0xc1c310){if(!_0xc1c310[0x0][_0xeb0e('0x14')]){return analyticExtractedReport(_0xeb0e('0x15'));}var _0x3f14b5=[];var _0x4d4d3b=0x0;if(_0x569f8c[_0xeb0e('0xe')]){if(_0xc1c310&&_0xc1c310[_0xeb0e('0x16')]){var _0x2ab678=_[_0xeb0e('0x17')](_0xc1c310[0x0]['num']/_0x1840ba);var _0x542bf9=Number['isInteger'](_0xc1c310[0x0][_0xeb0e('0x14')]/_0x1840ba)?_0xc1c310[0x0][_0xeb0e('0x14')]%_0x1840ba:0x0;_0x2ab678[_0xeb0e('0x18')](function(_0x1b0cf7){if(_0x1b0cf7>0x0){_0x4d4d3b+=_0x1840ba;}_0x3f14b5[_0xeb0e('0x19')](dbH[_0xeb0e('0x10')][_0xeb0e('0x11')](util['format'](_0xeb0e('0x1a'),QUERY,_0x1840ba,_0x4d4d3b),{'type':dbH[_0xeb0e('0x10')]['QueryTypes'][_0xeb0e('0x12')]}));});if(_0x542bf9>0x0){_0x4d4d3b+=_0x1840ba;_0x3f14b5['push'](dbH['sequelize'][_0xeb0e('0x11')](util[_0xeb0e('0xb')](_0xeb0e('0x1a'),QUERY,_0x542bf9,_0x4d4d3b),{'type':dbH['sequelize'][_0xeb0e('0x1b')]['SELECT']}));}}}else{_0x3f14b5[_0xeb0e('0x19')](dbH[_0xeb0e('0x10')][_0xeb0e('0x11')](QUERY,{'type':dbH[_0xeb0e('0x10')][_0xeb0e('0x1b')][_0xeb0e('0x12')]}));}var _0x4e0f2d=path[_0xeb0e('0x1c')](PATH);var _0x59ed76=path[_0xeb0e('0x1d')](PATH,'.csv');var _0x41c7a8=_0x569f8c[_0xeb0e('0xe')]&&_0x3f14b5[_0xeb0e('0x16')]>0x1;var _0x415eee=[];if(!fs[_0xeb0e('0x1e')](path[_0xeb0e('0x1f')](_0x4e0f2d,_0x59ed76))&&_0x41c7a8){fs[_0xeb0e('0x20')](path[_0xeb0e('0x1f')](_0x4e0f2d,_0x59ed76));}return BPromise[_0xeb0e('0x21')](_0x3f14b5,function(_0x2855d9){_0x415eee[_0xeb0e('0x19')](_0x2855d9);})[_0xeb0e('0x13')](function(){for(var _0x50f0c2=0x0;_0x50f0c2<_0x415eee[_0xeb0e('0x16')];_0x50f0c2+=0x1){var _0x4c4174;var _0x20c6de=_0x415eee[_0x50f0c2];if(_0x41c7a8){_0x4c4174=path['join'](_0x4e0f2d,_0x59ed76,util[_0xeb0e('0xb')](_0xeb0e('0x22'),_0x59ed76,_0x50f0c2,_0xeb0e('0x23')));}else{_0x4c4174=path[_0xeb0e('0x1f')](_0x4e0f2d,util[_0xeb0e('0xb')](_0xeb0e('0x24'),_0x59ed76,_0xeb0e('0x23')));}fs['writeFileSync'](_0x4c4174,csv(_0x20c6de));}})[_0xeb0e('0x13')](function(){if(_0x41c7a8){return new Promise(function(_0x2eb850){zipdir(path[_0xeb0e('0x1f')](_0x4e0f2d,_0x59ed76),{'saveTo':path[_0xeb0e('0x1f')](_0x4e0f2d,util[_0xeb0e('0xb')](_0xeb0e('0x24'),_0x59ed76,'zip'))},function(_0x8ebc06,_0x3afd93){rimraf(path[_0xeb0e('0x1f')](_0x4e0f2d,_0x59ed76),function(){});_0x2eb850(_0xeb0e('0x25'));});});}})[_0xeb0e('0x13')](function(){logger[_0xeb0e('0xa')](util[_0xeb0e('0xb')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xeb0e('0x26')));return analyticExtractedReport(_0xeb0e('0x27'),_0x41c7a8?util[_0xeb0e('0xb')](_0xeb0e('0x24'),_0x59ed76,_0x41c7a8?_0xeb0e('0x28'):_0xeb0e('0x23')):null);});})[_0xeb0e('0x29')](function(_0x475dbc){logger[_0xeb0e('0xa')](util[_0xeb0e('0xb')](_0xeb0e('0x2a'),EXTRACTED_REPORT_ID,_0xeb0e('0x26')),util['inspect'](_0x475dbc,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xeb0e('0x2b'));})['finally'](function(){process[_0xeb0e('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 94e6db7..46f4ee4 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 _0x90fd=['forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','endDate','header','pageBreak','margin','landscape','\x20/\x20','footer','Arial','black','num','Empty','Setting','find','splitSizePdf','then','split','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','mkdirSync','each','flatten','%s%d.%s','pdf','all','%s.%s','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','JSDOM','bluebird','../../mysqldb','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','tableHeader','pick','map','toString','value','fill','length','auto','body','concat','keys'];(function(_0x4d093a,_0x15d59c){var _0x5d7227=function(_0x4e2fee){while(--_0x4e2fee){_0x4d093a['push'](_0x4d093a['shift']());}};_0x5d7227(++_0x15d59c);}(_0x90fd,0xa1));var _0xd90f=function(_0x2110db,_0x14af52){_0x2110db=_0x2110db-0x0;var _0x2b9c71=_0x90fd[_0x2110db];return _0x2b9c71;};'use strict';var _=require(_0xd90f('0x0'));var fs=require('fs');var util=require(_0xd90f('0x1'));var path=require(_0xd90f('0x2'));var moment=require(_0xd90f('0x3'));var htmlToPdfmake=require(_0xd90f('0x4'));var PdfPrinter=require(_0xd90f('0x5'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var JSDOM=require('jsdom')[_0xd90f('0x6')];var window=new JSDOM('')['window'];var BPromise=require(_0xd90f('0x7'));var db=require('../../mysqldb')['db'];var dbH=require(_0xd90f('0x8'))['dbH'];var logger=require(_0xd90f('0x9'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xd90f('0xa')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xd90f('0xa')][0x5];var FORMAT=_0xd90f('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x979381,_0x5933ad){var _0x3fda81={'status':_0x979381};var _0x4990e8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5933ad){_0x3fda81[_0xd90f('0xc')]=_0x5933ad;}return db['AnalyticExtractedReport'][_0xd90f('0xd')](_0x3fda81,_0x4990e8);}function getHeaders(_0x2c3718){return _['map'](_0x2c3718,function(_0x5d8ca7){return{'text':_0x5d8ca7,'style':_0xd90f('0xe')};});}function getRows(_0x558f79,_0x106f75){return _['map'](_0x106f75,function(_0x3f2082){return _(_0x3f2082)[_0xd90f('0xf')](_0x558f79)[_0xd90f('0x10')](function(_0x664210){return _0x664210?_[_0xd90f('0x11')](_0x664210):'';})[_0xd90f('0x12')]();});}function createTable(_0x2e5f6e,_0x500a55){var _0x522dd9={'widths':_[_0xd90f('0x13')](Array(_0x2e5f6e[_0xd90f('0x14')]),0x91),'heights':function(_0x2bda1c){return _0x2bda1c===0x0?_0xd90f('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x2ae80f=getHeaders(_0x2e5f6e);_0x522dd9['body']['push'](_0x2ae80f);var _0x3d72fc=getRows(_0x2e5f6e,_0x500a55);_0x522dd9[_0xd90f('0x16')]=_0x522dd9[_0xd90f('0x16')][_0xd90f('0x17')](_0x3d72fc);return _0x522dd9;}function createTables(_0x59ed26){var _0x3a0ab9=[];var _0x2e3ed5=_['chunk'](Object[_0xd90f('0x18')](_0x59ed26[0x0]),0x5);_0x2e3ed5[_0xd90f('0x19')](function(_0x42ca31){_0x3a0ab9[_0xd90f('0x1a')](createTable(_0x42ca31,_0x59ed26));});return _0x3a0ab9;}function getPDFDocDefinition(_0x5444e8){var _0x6ace4d=util[_0xd90f('0x1b')](_0xd90f('0x1c'),NAME,EXTRACTED_REPORT[_0xd90f('0x1d')],moment(EXTRACTED_REPORT[_0xd90f('0x1e')])[_0xd90f('0x1b')](FORMAT),moment(EXTRACTED_REPORT[_0xd90f('0x1f')])[_0xd90f('0x1b')](FORMAT));var _0x3fa9e0=[];for(var _0x1f79d0=0x0;_0x1f79d0<_0x5444e8['length'];_0x1f79d0++){var _0x465cab=[];if(_0x1f79d0===0x0){_0x465cab[_0xd90f('0x1a')]({'text':_0x6ace4d,'style':_0xd90f('0x20')});}var _0x49802d={'table':_0x5444e8[_0x1f79d0]};if(_0x1f79d0>0x0){_0x49802d[_0xd90f('0x21')]='before';_0x49802d[_0xd90f('0x22')]=[0x0,0x46,0x0,0x0];}_0x465cab[_0xd90f('0x1a')](_0x49802d);_0x3fa9e0[_0xd90f('0x1a')](_0x465cab);}return{'pageSize':'A4','pageOrientation':_0xd90f('0x23'),'content':_0x3fa9e0,'footer':function(_0x389d6b,_0x5162dc){return{'text':_0x389d6b[_0xd90f('0x11')]()+_0xd90f('0x24')+_0x5162dc,'style':_0xd90f('0x25')};},'defaultStyle':{'font':_0xd90f('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xd90f('0x27')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x511f4d){var _0x3d88ab=0x1388;var _0x4d128c;if(!_0x511f4d[0x0][_0xd90f('0x28')]){return analyticExtractedReport(_0xd90f('0x29'));}return db[_0xd90f('0x2a')][_0xd90f('0x2b')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xd90f('0x2c')]})['then'](function(_0x18f63f){if(_0x18f63f){_0x4d128c=_0x18f63f;_0x3d88ab=_0x4d128c[_0xd90f('0x2c')]||0x3e8;}})[_0xd90f('0x2d')](function(){var _0x246b56=[];var _0x40fec5=0x0;if(_0x4d128c[_0xd90f('0x2e')]){if(_0x511f4d&&_0x511f4d[_0xd90f('0x14')]){var _0x36f256=_['range'](_0x511f4d[0x0][_0xd90f('0x28')]/_0x3d88ab);var _0x44ea4d=Number[_0xd90f('0x2f')](_0x511f4d[0x0][_0xd90f('0x28')]/_0x3d88ab)?_0x511f4d[0x0]['num']%_0x3d88ab:0x0;_0x36f256[_0xd90f('0x19')](function(_0x4e9a89){if(_0x4e9a89>0x0){_0x40fec5+=_0x3d88ab;}_0x246b56[_0xd90f('0x1a')](dbH[_0xd90f('0x30')][_0xd90f('0x31')](util[_0xd90f('0x1b')](_0xd90f('0x32'),QUERY,_0x3d88ab,_0x40fec5),{'type':dbH[_0xd90f('0x30')][_0xd90f('0x33')][_0xd90f('0x34')]}));});if(_0x44ea4d>0x0){_0x40fec5+=_0x3d88ab;_0x246b56[_0xd90f('0x1a')](dbH[_0xd90f('0x30')]['query'](util[_0xd90f('0x1b')](_0xd90f('0x32'),QUERY,_0x44ea4d,_0x40fec5),{'type':dbH[_0xd90f('0x30')][_0xd90f('0x33')][_0xd90f('0x34')]}));}}}else{_0x246b56[_0xd90f('0x1a')](dbH[_0xd90f('0x30')][_0xd90f('0x31')](QUERY,{'type':dbH[_0xd90f('0x30')][_0xd90f('0x33')][_0xd90f('0x34')]}));}var _0xc0659c=path[_0xd90f('0x35')](PATH);var _0x52411f=path[_0xd90f('0x36')](PATH,_0xd90f('0x37'));var _0x3904e9=_0x4d128c[_0xd90f('0x2e')]&&_0x246b56[_0xd90f('0x14')]>0x1;var _0x785e7=[];if(!fs[_0xd90f('0x38')](path[_0xd90f('0x39')](_0xc0659c,_0x52411f))&&_0x3904e9){fs[_0xd90f('0x3a')](path['join'](_0xc0659c,_0x52411f));}return BPromise[_0xd90f('0x3b')](_0x246b56,function(_0x1a6702){_0x785e7[_0xd90f('0x1a')](_0x1a6702);})['then'](function(){var _0x196343=[];for(var _0x270fc9=0x0;_0x270fc9<_0x785e7[_0xd90f('0x14')];_0x270fc9+=0x1){var _0x4d058e=_0x785e7[_0x270fc9];var _0x4fe7ee=createTables(_[_0xd90f('0x3c')](_0x4d058e));var _0x1d2a0f;var _0xfd72a9=getPDFDocDefinition(_0x4fe7ee);var _0xdf3bc0=getPDFPrinter();var _0x55b9a2=_0xdf3bc0['createPdfKitDocument'](_0xfd72a9);if(_0x3904e9){_0x1d2a0f=path[_0xd90f('0x39')](_0xc0659c,_0x52411f,util[_0xd90f('0x1b')](_0xd90f('0x3d'),_0x52411f,_0x270fc9,_0xd90f('0x3e')));}else{_0x1d2a0f=path[_0xd90f('0x39')](_0xc0659c,util[_0xd90f('0x1b')]('%s.%s',_0x52411f,_0xd90f('0x3e')));}_0x196343[_0xd90f('0x1a')](writePDFDocument(_0x55b9a2,_0x1d2a0f));}return Promise[_0xd90f('0x3f')](_0x196343);})[_0xd90f('0x2d')](function(){if(_0x3904e9){return new Promise(function(_0x359385){zipdir(path[_0xd90f('0x39')](_0xc0659c,_0x52411f),{'saveTo':path[_0xd90f('0x39')](_0xc0659c,util[_0xd90f('0x1b')](_0xd90f('0x40'),_0x52411f,'zip'))},function(){rimraf(path[_0xd90f('0x39')](_0xc0659c,_0x52411f),function(){});_0x359385(_0xd90f('0x41'));});});}})[_0xd90f('0x2d')](function(){if(!_0x3904e9)return;rimraf(path[_0xd90f('0x39')](_0xc0659c,_0x52411f),function(){});})[_0xd90f('0x2d')](function(){logger[_0xd90f('0x42')](util[_0xd90f('0x1b')](_0xd90f('0x43'),EXTRACTED_REPORT_ID,_0xd90f('0x44')));return analyticExtractedReport('Completed',_0x3904e9?util['format'](_0xd90f('0x40'),_0x52411f,_0x3904e9?_0xd90f('0x45'):_0xd90f('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xd90f('0x42')](util['format'](_0xd90f('0x46'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xd90f('0x47')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0xd90f('0x2d')](function(_0x13f3bf){EXTRACTED_REPORT=_0x13f3bf;return dbH['sequelize'][_0xd90f('0x31')](util[_0xd90f('0x1b')](_0xd90f('0x48'),QUERY),{'type':dbH['sequelize'][_0xd90f('0x33')][_0xd90f('0x34')]});})[_0xd90f('0x2d')](extractReport)['catch'](function(_0x49cf54){logger['info'](util[_0xd90f('0x1b')](_0xd90f('0x49'),EXTRACTED_REPORT_ID,'PDF'),util['inspect'](_0x49cf54,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xd90f('0x4a'));})[_0xd90f('0x4b')](function(){process[_0xd90f('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x5747ac=new PdfPrinter({'Arial':{'normal':__dirname+_0xd90f('0x4d'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xd90f('0x4e')}});return _0x5747ac;}function getPDFDocDefinitionFromHTML(_0x12127c,_0x2e0841){var _0x4628e3=util[_0xd90f('0x1b')](_0xd90f('0x4f'),_0x2e0841[_0xd90f('0x50')],_0x2e0841[_0xd90f('0x51')]);var _0x39bb98=moment()[_0xd90f('0x1b')](_0xd90f('0x52'))[_0xd90f('0x11')]();var _0x572077=htmlToPdfmake(_0x12127c,{'window':window,'tableAutoSize':!![]});return{'content':[_0x572077],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xd90f('0x53'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xd90f('0x53'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xd90f('0x53')}},'header':function(){return[{'text':_0xd90f('0x54'),'style':_0xd90f('0x20')}];},'footer':function(_0x3e334d,_0x324c71){return[{'text':util[_0xd90f('0x1b')](_0xd90f('0x55'),_0x4628e3,_0x3e334d,_0x324c71,_0x39bb98),'style':_0xd90f('0x25')}];}};}function writePDFDocument(_0x97268a,_0x3ad05d){return new Promise(function(_0x3f1627,_0x49c377){var _0x227d33=_0x97268a['pipe'](fs[_0xd90f('0x56')](_0x3ad05d));_0x227d33['on'](_0xd90f('0x57'),function(){_0x3f1627(_0xd90f('0x57'));});_0x227d33['on'](_0xd90f('0x58'),function(_0x215711){_0x49c377(_0x215711);});_0x97268a[_0xd90f('0x59')]();});}exports[_0xd90f('0x5a')]=function(_0xc9e4f9,_0x3d083b){var _0x32a2cb=getPDFPrinter();var _0x3507d9=getPDFDocDefinitionFromHTML(_0xc9e4f9,_0x3d083b);var _0x1ce48d=_0x32a2cb[_0xd90f('0x5b')](_0x3507d9);return writePDFDocument(_0x1ce48d,_0x3d083b[_0xd90f('0x2')])[_0xd90f('0x5c')](function(_0x362d15){throw _0x362d15;});}; \ No newline at end of file +var _0x703f=['Arial','right','num','Empty','Setting','find','splitSizePdf','then','split','range','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','.pdf','mkdirSync','each','flatten','createPdfKitDocument','pdf','%s.%s','all','join','zip','info','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','footer','pipe','createWriteStream','finish','end','lodash','path','rimraf','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','tableHeader','pick','toString','value','fill','length','auto','body','push','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','format','endDate','header','margin','landscape','\x20/\x20'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0x703f,0x87));var _0xf703=function(_0x38797a,_0x5b2537){_0x38797a=_0x38797a-0x0;var _0x51cbcf=_0x703f[_0x38797a];return _0x51cbcf;};'use strict';var _=require(_0xf703('0x0'));var fs=require('fs');var util=require('util');var path=require(_0xf703('0x1'));var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0xf703('0x2'));var JSDOM=require('jsdom')[_0xf703('0x3')];var window=new JSDOM('')[_0xf703('0x4')];var BPromise=require(_0xf703('0x5'));var db=require(_0xf703('0x6'))['db'];var dbH=require('../../mysqldb')[_0xf703('0x7')];var logger=require(_0xf703('0x8'))(_0xf703('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xf703('0xa')][0x2]);var QUERY=process[_0xf703('0xa')][0x3];var PATH=process[_0xf703('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf703('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x1d445f,_0x1b33c7){var _0xff9ec={'status':_0x1d445f};var _0x9451d1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1b33c7){_0xff9ec[_0xf703('0xc')]=_0x1b33c7;}return db['AnalyticExtractedReport'][_0xf703('0xd')](_0xff9ec,_0x9451d1);}function getHeaders(_0x2c00c7){return _[_0xf703('0xe')](_0x2c00c7,function(_0x116edc){return{'text':_0x116edc,'style':_0xf703('0xf')};});}function getRows(_0x2ebf0a,_0x25590f){return _[_0xf703('0xe')](_0x25590f,function(_0x55f36f){return _(_0x55f36f)[_0xf703('0x10')](_0x2ebf0a)[_0xf703('0xe')](function(_0x1f370c){return _0x1f370c?_[_0xf703('0x11')](_0x1f370c):'';})[_0xf703('0x12')]();});}function createTable(_0x109ae0,_0x4eb4f8){var _0x38cbea={'widths':_[_0xf703('0x13')](Array(_0x109ae0[_0xf703('0x14')]),0x91),'heights':function(_0x560407){return _0x560407===0x0?_0xf703('0x15'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x55e878=getHeaders(_0x109ae0);_0x38cbea[_0xf703('0x16')][_0xf703('0x17')](_0x55e878);var _0x26b0d8=getRows(_0x109ae0,_0x4eb4f8);_0x38cbea['body']=_0x38cbea[_0xf703('0x16')]['concat'](_0x26b0d8);return _0x38cbea;}function createTables(_0x1b30c7){var _0x262281=[];var _0x4c851e=_[_0xf703('0x18')](Object[_0xf703('0x19')](_0x1b30c7[0x0]),0x5);_0x4c851e[_0xf703('0x1a')](function(_0x5c5734){_0x262281[_0xf703('0x17')](createTable(_0x5c5734,_0x1b30c7));});return _0x262281;}function getPDFDocDefinition(_0x1e2110){var _0x3823df=util['format'](_0xf703('0x1b'),NAME,EXTRACTED_REPORT[_0xf703('0x1c')],moment(EXTRACTED_REPORT['startDate'])[_0xf703('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0xf703('0x1e')])[_0xf703('0x1d')](FORMAT));var _0x2e597b=[];for(var _0x3366ab=0x0;_0x3366ab<_0x1e2110['length'];_0x3366ab++){var _0x4d15a6=[];if(_0x3366ab===0x0){_0x4d15a6[_0xf703('0x17')]({'text':_0x3823df,'style':_0xf703('0x1f')});}var _0x15e1bf={'table':_0x1e2110[_0x3366ab]};if(_0x3366ab>0x0){_0x15e1bf['pageBreak']='before';_0x15e1bf[_0xf703('0x20')]=[0x0,0x46,0x0,0x0];}_0x4d15a6[_0xf703('0x17')](_0x15e1bf);_0x2e597b[_0xf703('0x17')](_0x4d15a6);}return{'pageSize':'A4','pageOrientation':_0xf703('0x21'),'content':_0x2e597b,'footer':function(_0x553465,_0x166214){return{'text':_0x553465[_0xf703('0x11')]()+_0xf703('0x22')+_0x166214,'style':'footer'};},'defaultStyle':{'font':_0xf703('0x23')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xf703('0x24'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x34fe01){var _0x40b38f=0x1388;var _0x5e4674;if(!_0x34fe01[0x0][_0xf703('0x25')]){return analyticExtractedReport(_0xf703('0x26'));}return db[_0xf703('0x27')][_0xf703('0x28')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xf703('0x29')]})[_0xf703('0x2a')](function(_0x18c9e8){if(_0x18c9e8){_0x5e4674=_0x18c9e8;_0x40b38f=_0x5e4674[_0xf703('0x29')]||0x3e8;}})[_0xf703('0x2a')](function(){var _0x3edfe0=[];var _0xb80cfa=0x0;if(_0x5e4674[_0xf703('0x2b')]){if(_0x34fe01&&_0x34fe01[_0xf703('0x14')]){var _0x28dcc0=_[_0xf703('0x2c')](_0x34fe01[0x0][_0xf703('0x25')]/_0x40b38f);var _0x3a8098=Number[_0xf703('0x2d')](_0x34fe01[0x0][_0xf703('0x25')]/_0x40b38f)?_0x34fe01[0x0][_0xf703('0x25')]%_0x40b38f:0x0;_0x28dcc0[_0xf703('0x1a')](function(_0x52582e){if(_0x52582e>0x0){_0xb80cfa+=_0x40b38f;}_0x3edfe0[_0xf703('0x17')](dbH[_0xf703('0x2e')][_0xf703('0x2f')](util['format'](_0xf703('0x30'),QUERY,_0x40b38f,_0xb80cfa),{'type':dbH[_0xf703('0x2e')][_0xf703('0x31')]['SELECT']}));});if(_0x3a8098>0x0){_0xb80cfa+=_0x40b38f;_0x3edfe0['push'](dbH[_0xf703('0x2e')][_0xf703('0x2f')](util[_0xf703('0x1d')](_0xf703('0x30'),QUERY,_0x3a8098,_0xb80cfa),{'type':dbH['sequelize'][_0xf703('0x31')][_0xf703('0x32')]}));}}}else{_0x3edfe0['push'](dbH[_0xf703('0x2e')][_0xf703('0x2f')](QUERY,{'type':dbH['sequelize']['QueryTypes'][_0xf703('0x32')]}));}var _0xeada40=path[_0xf703('0x33')](PATH);var _0x4dd01=path['basename'](PATH,_0xf703('0x34'));var _0x18c515=_0x5e4674['split']&&_0x3edfe0[_0xf703('0x14')]>0x1;var _0x289cd3=[];if(!fs['existsSync'](path['join'](_0xeada40,_0x4dd01))&&_0x18c515){fs[_0xf703('0x35')](path['join'](_0xeada40,_0x4dd01));}return BPromise[_0xf703('0x36')](_0x3edfe0,function(_0xeeb442){_0x289cd3[_0xf703('0x17')](_0xeeb442);})[_0xf703('0x2a')](function(){var _0x40d84c=[];for(var _0x548d1e=0x0;_0x548d1e<_0x289cd3[_0xf703('0x14')];_0x548d1e+=0x1){var _0x578f68=_0x289cd3[_0x548d1e];var _0x5a707f=createTables(_[_0xf703('0x37')](_0x578f68));var _0xfb85;var _0x471d5f=getPDFDocDefinition(_0x5a707f);var _0x409030=getPDFPrinter();var _0x4944c2=_0x409030[_0xf703('0x38')](_0x471d5f);if(_0x18c515){_0xfb85=path['join'](_0xeada40,_0x4dd01,util[_0xf703('0x1d')]('%s%d.%s',_0x4dd01,_0x548d1e,_0xf703('0x39')));}else{_0xfb85=path['join'](_0xeada40,util[_0xf703('0x1d')](_0xf703('0x3a'),_0x4dd01,_0xf703('0x39')));}_0x40d84c[_0xf703('0x17')](writePDFDocument(_0x4944c2,_0xfb85));}return Promise[_0xf703('0x3b')](_0x40d84c);})[_0xf703('0x2a')](function(){if(_0x18c515){return new Promise(function(_0x5415cc){zipdir(path['join'](_0xeada40,_0x4dd01),{'saveTo':path[_0xf703('0x3c')](_0xeada40,util['format'](_0xf703('0x3a'),_0x4dd01,_0xf703('0x3d')))},function(){rimraf(path[_0xf703('0x3c')](_0xeada40,_0x4dd01),function(){});_0x5415cc('zip\x20finished');});});}})['then'](function(){if(!_0x18c515)return;rimraf(path[_0xf703('0x3c')](_0xeada40,_0x4dd01),function(){});})[_0xf703('0x2a')](function(){logger[_0xf703('0x3e')](util[_0xf703('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xf703('0x3f'),_0x18c515?util[_0xf703('0x1d')](_0xf703('0x3a'),_0x4dd01,_0x18c515?_0xf703('0x3d'):_0xf703('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xf703('0x3e')](util[_0xf703('0x1d')](_0xf703('0x40'),EXTRACTED_REPORT_ID,_0xf703('0x41')));return db[_0xf703('0x42')][_0xf703('0x43')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf703('0x2a')](function(_0x320898){EXTRACTED_REPORT=_0x320898;return dbH['sequelize']['query'](util[_0xf703('0x1d')](_0xf703('0x44'),QUERY),{'type':dbH[_0xf703('0x2e')][_0xf703('0x31')][_0xf703('0x32')]});})['then'](extractReport)[_0xf703('0x45')](function(_0x35b770){logger[_0xf703('0x3e')](util[_0xf703('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf703('0x41')),util['inspect'](_0x35b770,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0xf703('0x46')](function(){process[_0xf703('0x47')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x385027=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0xf703('0x48'),'italics':__dirname+_0xf703('0x49'),'bolditalics':__dirname+_0xf703('0x4a')}});return _0x385027;}function getPDFDocDefinitionFromHTML(_0x3dcda3,_0x2ea92e){var _0x2c7f7f=util[_0xf703('0x1d')]('%s\x20#%d',_0x2ea92e[_0xf703('0x4b')],_0x2ea92e[_0xf703('0x4c')]);var _0x5d9abd=moment()[_0xf703('0x1d')](_0xf703('0x4d'))[_0xf703('0x11')]();var _0x5eb3fb=htmlToPdfmake(_0x3dcda3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5eb3fb],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xf703('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xf703('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xf703('0x1f')}];},'footer':function(_0x9353f1,_0x272cbe){return[{'text':util[_0xf703('0x1d')](_0xf703('0x4f'),_0x2c7f7f,_0x9353f1,_0x272cbe,_0x5d9abd),'style':_0xf703('0x50')}];}};}function writePDFDocument(_0x74f216,_0x2db450){return new Promise(function(_0x39b7ff,_0x458a3c){var _0x3deb69=_0x74f216[_0xf703('0x51')](fs[_0xf703('0x52')](_0x2db450));_0x3deb69['on'](_0xf703('0x53'),function(){_0x39b7ff('finish');});_0x3deb69['on']('error',function(_0xc03a60){_0x458a3c(_0xc03a60);});_0x74f216[_0xf703('0x54')]();});}exports['createPdfFromHTML']=function(_0x5d6504,_0x4c437f){var _0x1aa440=getPDFPrinter();var _0x4a7ea9=getPDFDocDefinitionFromHTML(_0x5d6504,_0x4c437f);var _0x51bd27=_0x1aa440['createPdfKitDocument'](_0x4a7ea9);return writePDFDocument(_0x51bd27,_0x4c437f[_0xf703('0x1')])['catch'](function(_0x4172ef){throw _0x4172ef;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 17c0c9f..2909df6 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 _0x112f=['dirname','.xlsx','length','join','each','%s%d.%s','%s.%s','writeFileSync','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','AnalyticExtractedReport','update','info','format','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT'];(function(_0x5c7ab7,_0x35cadd){var _0x52b02b=function(_0x2ee7b7){while(--_0x2ee7b7){_0x5c7ab7['push'](_0x5c7ab7['shift']());}};_0x52b02b(++_0x35cadd);}(_0x112f,0x11e));var _0xf112=function(_0x10e53f,_0x4d819c){_0x10e53f=_0x10e53f-0x0;var _0xcf0a64=_0x112f[_0x10e53f];return _0xcf0a64;};'use strict';var util=require(_0xf112('0x0'));var path=require('path');var _=require(_0xf112('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xf112('0x2'));var zipdir=require(_0xf112('0x3'));var rimraf=require(_0xf112('0x4'));var db=require(_0xf112('0x5'))['db'];var dbH=require('../../mysqldb')[_0xf112('0x6')];var logger=require('../../config/logger')(_0xf112('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xf112('0x8')][0x2]);var QUERY=process[_0xf112('0x8')][0x3];var PATH=process[_0xf112('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2fcbcb,_0x3f0411){var _0x48aaf0={'status':_0x2fcbcb};var _0x420e3c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3f0411){_0x48aaf0['savename']=_0x3f0411;}return db[_0xf112('0x9')][_0xf112('0xa')](_0x48aaf0,_0x420e3c);}function main(){var _0x1301b5=0x1388;var _0x4310a7;logger[_0xf112('0xb')](util[_0xf112('0xc')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'XLSX'));return db['Setting'][_0xf112('0xd')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf112('0xe'),_0xf112('0xf')]})[_0xf112('0x10')](function(_0x350f60){if(_0x350f60){_0x4310a7=_0x350f60;_0x1301b5=_0x4310a7[_0xf112('0xf')]||0x1388;}})[_0xf112('0x10')](function(){return dbH[_0xf112('0x11')][_0xf112('0x12')](util['format'](_0xf112('0x13'),QUERY),{'type':dbH['sequelize'][_0xf112('0x14')]['SELECT']});})[_0xf112('0x10')](function(_0x5111e9){if(!_0x5111e9[0x0][_0xf112('0x15')]){return analyticExtractedReport(_0xf112('0x16'));}var _0x3e5780=[];var _0x3df24b=0x0;if(_0x4310a7[_0xf112('0xe')]){if(_0x5111e9&&_0x5111e9['length']){var _0x443f47=_[_0xf112('0x17')](_0x5111e9[0x0]['num']/_0x1301b5);var _0x16d575=Number[_0xf112('0x18')](_0x5111e9[0x0][_0xf112('0x15')]/_0x1301b5)?_0x5111e9[0x0]['num']%_0x1301b5:0x0;_0x443f47[_0xf112('0x19')](function(_0x456c8b){if(_0x456c8b>0x0){_0x3df24b+=_0x1301b5;}_0x3e5780[_0xf112('0x1a')](dbH[_0xf112('0x11')][_0xf112('0x12')](util[_0xf112('0xc')](_0xf112('0x1b'),QUERY,_0x1301b5,_0x3df24b),{'type':dbH[_0xf112('0x11')][_0xf112('0x14')][_0xf112('0x1c')]}));});if(_0x16d575>0x0){_0x3df24b+=_0x1301b5;_0x3e5780[_0xf112('0x1a')](dbH['sequelize'][_0xf112('0x12')](util['format'](_0xf112('0x1b'),QUERY,_0x16d575,_0x3df24b),{'type':dbH[_0xf112('0x11')][_0xf112('0x14')][_0xf112('0x1c')]}));}}}else{_0x3e5780[_0xf112('0x1a')](dbH[_0xf112('0x11')][_0xf112('0x12')](QUERY,{'type':dbH[_0xf112('0x11')][_0xf112('0x14')][_0xf112('0x1c')]}));}var _0x27a894=path[_0xf112('0x1d')](PATH);var _0x48a5c9=path['basename'](PATH,_0xf112('0x1e'));var _0x938bb0=_0x4310a7['split']&&_0x3e5780[_0xf112('0x1f')]>0x1;var _0x16a491=[];if(!fs['existsSync'](path[_0xf112('0x20')](_0x27a894,_0x48a5c9))&&_0x938bb0){fs['mkdirSync'](path['join'](_0x27a894,_0x48a5c9));}return BPromise[_0xf112('0x21')](_0x3e5780,function(_0x1967df){_0x16a491['push'](_0x1967df);})['then'](function(){for(var _0x167c07=0x0;_0x167c07<_0x16a491[_0xf112('0x1f')];_0x167c07+=0x1){var _0x85dc43;var _0x17f157=_0x16a491[_0x167c07];if(_0x938bb0){_0x85dc43=path[_0xf112('0x20')](_0x27a894,_0x48a5c9,util[_0xf112('0xc')](_0xf112('0x22'),_0x48a5c9,_0x167c07,'xlsx'));}else{_0x85dc43=path['join'](_0x27a894,util[_0xf112('0xc')](_0xf112('0x23'),_0x48a5c9,'xlsx'));}fs[_0xf112('0x24')](_0x85dc43,json2xls(_0x17f157),'binary');}})[_0xf112('0x10')](function(){if(_0x938bb0){return new Promise(function(_0x427e5e){zipdir(path['join'](_0x27a894,_0x48a5c9),{'saveTo':path[_0xf112('0x20')](_0x27a894,util[_0xf112('0xc')](_0xf112('0x23'),_0x48a5c9,'zip'))},function(_0x290c6a,_0x2e5d15){rimraf(path[_0xf112('0x20')](_0x27a894,_0x48a5c9),function(){});_0x427e5e('zip\x20finished');});});}})[_0xf112('0x10')](function(){logger['info'](util[_0xf112('0xc')](_0xf112('0x25'),EXTRACTED_REPORT_ID,_0xf112('0x26')));return analyticExtractedReport('Completed',_0x938bb0?util[_0xf112('0xc')](_0xf112('0x23'),_0x48a5c9,_0x938bb0?'zip':'xlsx'):null);});})[_0xf112('0x27')](function(_0x3c11e2){logger[_0xf112('0xb')](util[_0xf112('0xc')](_0xf112('0x28'),EXTRACTED_REPORT_ID,_0xf112('0x26')),util[_0xf112('0x29')](_0x3c11e2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xf112('0x2a'));})[_0xf112('0x2b')](function(){process[_0xf112('0x2c')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6b39=['AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','split','isInteger','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','writeFileSync','binary','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x6b39,0x1bf));var _0x96b3=function(_0x3c02e0,_0x49fbc5){_0x3c02e0=_0x3c02e0-0x0;var _0x344759=_0x6b39[_0x3c02e0];return _0x344759;};'use strict';var util=require(_0x96b3('0x0'));var path=require(_0x96b3('0x1'));var _=require(_0x96b3('0x2'));var fs=require('fs');var json2xls=require(_0x96b3('0x3'));var BPromise=require(_0x96b3('0x4'));var zipdir=require(_0x96b3('0x5'));var rimraf=require(_0x96b3('0x6'));var db=require(_0x96b3('0x7'))['db'];var dbH=require('../../mysqldb')[_0x96b3('0x8')];var logger=require(_0x96b3('0x9'))(_0x96b3('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0x96b3('0xb')][0x2]);var QUERY=process[_0x96b3('0xb')][0x3];var PATH=process[_0x96b3('0xb')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4a0499,_0x54cf39){var _0x25ea59={'status':_0x4a0499};var _0x3abc19={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x54cf39){_0x25ea59['savename']=_0x54cf39;}return db[_0x96b3('0xc')][_0x96b3('0xd')](_0x25ea59,_0x3abc19);}function main(){var _0x1c955c=0x1388;var _0x26594b;logger[_0x96b3('0xe')](util[_0x96b3('0xf')](_0x96b3('0x10'),EXTRACTED_REPORT_ID,_0x96b3('0x11')));return db['Setting'][_0x96b3('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x96b3('0x13')]})[_0x96b3('0x14')](function(_0x23a23e){if(_0x23a23e){_0x26594b=_0x23a23e;_0x1c955c=_0x26594b['splitSizeXlsx']||0x1388;}})[_0x96b3('0x14')](function(){return dbH[_0x96b3('0x15')][_0x96b3('0x16')](util['format'](_0x96b3('0x17'),QUERY),{'type':dbH['sequelize'][_0x96b3('0x18')][_0x96b3('0x19')]});})[_0x96b3('0x14')](function(_0xf50792){if(!_0xf50792[0x0][_0x96b3('0x1a')]){return analyticExtractedReport('Empty');}var _0x139137=[];var _0x4ac3a9=0x0;if(_0x26594b[_0x96b3('0x1b')]){if(_0xf50792&&_0xf50792['length']){var _0x163ab4=_['range'](_0xf50792[0x0][_0x96b3('0x1a')]/_0x1c955c);var _0x4f1194=Number[_0x96b3('0x1c')](_0xf50792[0x0][_0x96b3('0x1a')]/_0x1c955c)?_0xf50792[0x0][_0x96b3('0x1a')]%_0x1c955c:0x0;_0x163ab4['forEach'](function(_0xf3d249){if(_0xf3d249>0x0){_0x4ac3a9+=_0x1c955c;}_0x139137['push'](dbH['sequelize'][_0x96b3('0x16')](util[_0x96b3('0xf')](_0x96b3('0x1d'),QUERY,_0x1c955c,_0x4ac3a9),{'type':dbH[_0x96b3('0x15')][_0x96b3('0x18')][_0x96b3('0x19')]}));});if(_0x4f1194>0x0){_0x4ac3a9+=_0x1c955c;_0x139137['push'](dbH[_0x96b3('0x15')][_0x96b3('0x16')](util[_0x96b3('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x4f1194,_0x4ac3a9),{'type':dbH['sequelize'][_0x96b3('0x18')][_0x96b3('0x19')]}));}}}else{_0x139137['push'](dbH[_0x96b3('0x15')][_0x96b3('0x16')](QUERY,{'type':dbH['sequelize'][_0x96b3('0x18')][_0x96b3('0x19')]}));}var _0x48480f=path[_0x96b3('0x1e')](PATH);var _0x33bf68=path[_0x96b3('0x1f')](PATH,_0x96b3('0x20'));var _0x10b4b0=_0x26594b[_0x96b3('0x1b')]&&_0x139137[_0x96b3('0x21')]>0x1;var _0x18913e=[];if(!fs[_0x96b3('0x22')](path[_0x96b3('0x23')](_0x48480f,_0x33bf68))&&_0x10b4b0){fs[_0x96b3('0x24')](path[_0x96b3('0x23')](_0x48480f,_0x33bf68));}return BPromise[_0x96b3('0x25')](_0x139137,function(_0x337f73){_0x18913e['push'](_0x337f73);})['then'](function(){for(var _0x60296a=0x0;_0x60296a<_0x18913e[_0x96b3('0x21')];_0x60296a+=0x1){var _0x45e717;var _0x57711d=_0x18913e[_0x60296a];if(_0x10b4b0){_0x45e717=path['join'](_0x48480f,_0x33bf68,util[_0x96b3('0xf')](_0x96b3('0x26'),_0x33bf68,_0x60296a,_0x96b3('0x27')));}else{_0x45e717=path[_0x96b3('0x23')](_0x48480f,util[_0x96b3('0xf')]('%s.%s',_0x33bf68,_0x96b3('0x27')));}fs[_0x96b3('0x28')](_0x45e717,json2xls(_0x57711d),_0x96b3('0x29'));}})[_0x96b3('0x14')](function(){if(_0x10b4b0){return new Promise(function(_0x35ff93){zipdir(path[_0x96b3('0x23')](_0x48480f,_0x33bf68),{'saveTo':path[_0x96b3('0x23')](_0x48480f,util[_0x96b3('0xf')]('%s.%s',_0x33bf68,_0x96b3('0x2a')))},function(_0x4377c5,_0x5340b1){rimraf(path['join'](_0x48480f,_0x33bf68),function(){});_0x35ff93(_0x96b3('0x2b'));});});}})[_0x96b3('0x14')](function(){logger['info'](util[_0x96b3('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x96b3('0x11')));return analyticExtractedReport(_0x96b3('0x2c'),_0x10b4b0?util[_0x96b3('0xf')]('%s.%s',_0x33bf68,_0x10b4b0?_0x96b3('0x2a'):_0x96b3('0x27')):null);});})[_0x96b3('0x2d')](function(_0x45276c){logger[_0x96b3('0xe')](util[_0x96b3('0xf')](_0x96b3('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x96b3('0x2f')](_0x45276c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x96b3('0x30'));})[_0x96b3('0x31')](function(){process[_0x96b3('0x32')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 26bd2ea..331df5d 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 _0x3597=['answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','sortBy','error','lodash','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','priority','extensions','extension','find','push','type','format','VoiceExtensionId','inbound','context','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','Set','CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','updatedAt','interval','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)','indexOf','app','custom'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3597,0x150));var _0x7359=function(_0x5e5c22,_0x2533dc){_0x5e5c22=_0x5e5c22-0x0;var _0x124d9a=_0x3597[_0x5e5c22];return _0x124d9a;};'use strict';var _=require(_0x7359('0x0'));var util=require(_0x7359('0x1'));function rewrite(_0x368fa3,_0xc95e0d){var _0x15f26b=this;return _0x368fa3[_0x7359('0x2')][_0x7359('0x3')][_0x7359('0x4')]({'raw':!![]})['then'](function(_0x2f11e7){_0x15f26b[_0x7359('0x5')]=_0x2f11e7;return _0x368fa3[_0x7359('0x2')][_0x7359('0x6')][_0x7359('0x4')]({'where':{'IntervalId':_0xc95e0d[_0x7359('0x7')]},'raw':!![]});})[_0x7359('0x8')](function(_0x43a290){return _0x368fa3[_0x7359('0x2')][_0x7359('0x6')][_0x7359('0x4')]({'where':{'exten':{'$in':_['uniq'](_[_0x7359('0x9')](_0x43a290,_0x7359('0xa')))}},'order':[{'raw':_0x7359('0xb')}],'raw':!![]});})[_0x7359('0x8')](function(_0x5b7311){var _0x26ae7a=_[_0x7359('0xc')](_0x5b7311,{'priority':'1'});var _0x47c81f=_['filter'](_0x5b7311,{'isApp':0x1});var _0x1d1879=_[_0x7359('0xd')](_0x47c81f,_0x7359('0xa'));var _0x284a7=[_0x7359('0xe'),'playback'];var _0xce7cd2=[];var _0x109933=[];for(var _0x4de6f7 in _0x1d1879){if(_0x1d1879['hasOwnProperty'](_0x4de6f7)){_0x15f26b[_0x7359('0xf')]=0x2;_0x15f26b[_0x7359('0x10')]=[];_0x15f26b[_0x7359('0x11')]=_[_0x7359('0x12')](_0x26ae7a,{'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')]});_0x15f26b['extensions'][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':'Set','appdata':util[_0x7359('0x15')]('CDR(type)=%s',_0x1d1879[_0x4de6f7][0x0]['type']),'context':_0x1d1879[_0x4de6f7][0x0]['context'],'exten':_0x1d1879[_0x4de6f7][0x0]['exten'],'priority':_0x15f26b['priority']++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});if(_0x1d1879[_0x4de6f7][0x0]['type']===_0x7359('0x17')){_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')],'context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});}else if(_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')]===_0x7359('0x19')){if(_0x15f26b['extension']){_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':'Set','appdata':_0x7359('0x1a')+(_0x15f26b['extension'][_0x7359('0x1b')]?_0x7359('0x1c')+_0x15f26b[_0x7359('0x11')][_0x7359('0x1b')]+'}':_0x7359('0x1d')),'context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'exten':_0x1d1879[_0x4de6f7][0x0]['exten'],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});}_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0x1d1879[_0x4de6f7][0x0]['VoiceExtensionId'],'context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});var _0x469cb6=_0x15f26b[_0x7359('0xf')]++;_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':_0x7359('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x469cb6+0x2)+_0x7359('0x1f')+(_0x469cb6+0x1)+')','context':_0x1d1879[_0x4de6f7][0x0]['context'],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x469cb6,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});if(_0x15f26b['extension']){_0x15f26b['extensions'][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':_0x7359('0x20'),'appdata':_0x15f26b[_0x7359('0x11')][_0x7359('0x1b')]?_0x7359('0x21')+_0x15f26b['extension'][_0x7359('0x1b')]+'}':'CDR(prefix)=noprefix','context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0]['VoiceExtensionId']});}_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':_0x7359('0x20'),'appdata':_0x7359('0x22')+_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')],'context':_0x1d1879[_0x4de6f7][0x0]['context'],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b['priority']++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});if(_0x15f26b[_0x7359('0x11')]&&_0x15f26b['extension'][_0x7359('0x23')](_0x7359('0x24'))&&_0x15f26b['extension'][_0x7359('0x24')]!==_0x7359('0x25')){_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':_0x7359('0x20'),'appdata':_0x7359('0x26'),'context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':'Set','appdata':_0x7359('0x27')+_0x15f26b[_0x7359('0x11')][_0x7359('0x24')]||'wav','context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0]['VoiceExtensionId']});}}_0x15f26b[_0x7359('0x10')][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0]['type'],'app':_0x7359('0x20'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'exten':_0x1d1879[_0x4de6f7][0x0]['exten'],'priority':_0x15f26b['priority']++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});_0x15f26b[_0x7359('0x10')]['push']({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':_0x7359('0x20'),'appdata':_0x7359('0x28'),'context':_0x1d1879[_0x4de6f7][0x0]['context'],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});_0x15f26b[_0x7359('0x10')]['push']({'type':_0x1d1879[_0x4de6f7][0x0]['type'],'app':_0x7359('0x20'),'appdata':_0x7359('0x29'),'context':_0x1d1879[_0x4de6f7][0x0]['context'],'exten':_0x1d1879[_0x4de6f7][0x0][_0x7359('0xa')],'priority':_0x15f26b[_0x7359('0xf')]++,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0]['VoiceExtensionId']});for(var _0x3a73e6=0x0,_0x585f0c=0x0;_0x3a73e6<_0x1d1879[_0x4de6f7]['length'];_0x3a73e6+=0x1,_0x585f0c=0x0){var _0x1c58b2=_0x1d1879[_0x4de6f7][_0x3a73e6];if(_0x1c58b2['type']){_0x1c58b2[_0x7359('0x14')]=_0x1c58b2[_0x7359('0x14')][_0x7359('0x2a')]();}var _0x108117=[];var _0x31ce6d=[];delete _0x1c58b2['id'];delete _0x1c58b2['createdAt'];delete _0x1c58b2[_0x7359('0x2b')];var _0x204396=_0x1c58b2[_0x7359('0x2c')]!=='*,*,*,*'?[_0x1c58b2[_0x7359('0x2c')]]:_0x1c58b2[_0x7359('0x7')]?_[_0x7359('0x9')](_['filter'](_0x15f26b['intervals'],{'IntervalId':_0x1c58b2[_0x7359('0x7')]}),_0x7359('0x2c')):[];if(_0x1c58b2['hasOwnProperty'](_0x7359('0x2d'))){if(_0x1c58b2[_0x7359('0x2d')]&&_0x1c58b2[_0x7359('0x2d')]!=='--'){_0x108117[_0x7359('0x13')]({'type':_0x1c58b2[_0x7359('0x14')],'app':_0x7359('0x20'),'appdata':_0x7359('0x2e')+_0x1c58b2[_0x7359('0x2d')],'context':_0x1c58b2[_0x7359('0x18')],'exten':_0x1c58b2[_0x7359('0xa')],'priority':_0x204396['length']+_0x15f26b[_0x7359('0xf')]+_0x585f0c++,'VoiceExtensionId':_0x1c58b2['VoiceExtensionId']});}}if(_0x1c58b2['type']===_0x7359('0x19')&&_0x1c58b2[_0x7359('0x23')](_0x7359('0x2f'))){if(_0x1c58b2[_0x7359('0x2f')]){_0x108117[_0x7359('0x13')]({'type':_0x1c58b2[_0x7359('0x14')],'app':_0x7359('0x1e'),'appdata':_0x7359('0x30')+_0x1c58b2['callerID']+')','context':_0x1c58b2['context'],'exten':_0x1c58b2[_0x7359('0xa')],'priority':_0x204396[_0x7359('0x31')]+_0x15f26b[_0x7359('0xf')]+_0x585f0c++,'VoiceExtensionId':_0x1c58b2[_0x7359('0x16')]});}else{_0x108117[_0x7359('0x13')]({'type':_0x1c58b2['type'],'app':_0x7359('0x1e'),'appdata':_0x7359('0x32'),'context':_0x1c58b2[_0x7359('0x18')],'exten':_0x1c58b2['exten'],'priority':_0x204396[_0x7359('0x31')]+_0x15f26b[_0x7359('0xf')]+_0x585f0c++,'VoiceExtensionId':_0x1c58b2[_0x7359('0x16')]});}}if(_0x1c58b2[_0x7359('0x23')]('answer')){if(_0x284a7[_0x7359('0x33')](_0x1c58b2[_0x7359('0x34')][_0x7359('0x2a')]())>=0x0&&_0x1c58b2['appType']!==_0x7359('0x35')){if(_0x1c58b2[_0x7359('0x36')]){_0x108117['push']({'type':_0x1c58b2[_0x7359('0x14')],'app':_0x7359('0x1e'),'appdata':_0x7359('0x37'),'context':_0x1c58b2[_0x7359('0x18')],'exten':_0x1c58b2[_0x7359('0xa')],'priority':_0x204396[_0x7359('0x31')]+_0x15f26b['priority']+_0x585f0c++,'VoiceExtensionId':_0x1c58b2[_0x7359('0x16')]});_0x108117[_0x7359('0x13')]({'type':_0x1c58b2[_0x7359('0x14')],'app':'Set','appdata':_0x7359('0x38'),'context':_0x1c58b2[_0x7359('0x18')],'exten':_0x1c58b2['exten'],'priority':_0x204396[_0x7359('0x31')]+_0x15f26b[_0x7359('0xf')]+_0x585f0c++,'VoiceExtensionId':_0x1c58b2[_0x7359('0x16')]});}else{_0x108117['push']({'type':_0x1c58b2[_0x7359('0x14')],'app':_0x7359('0x1e'),'appdata':_0x7359('0x39'),'context':_0x1c58b2[_0x7359('0x18')],'exten':_0x1c58b2[_0x7359('0xa')],'priority':_0x204396[_0x7359('0x31')]+_0x15f26b['priority']+_0x585f0c++,'VoiceExtensionId':_0x1c58b2[_0x7359('0x16')]});_0x108117[_0x7359('0x13')]({'type':_0x1c58b2[_0x7359('0x14')],'app':_0x7359('0x20'),'appdata':_0x7359('0x3a'),'context':_0x1c58b2[_0x7359('0x18')],'exten':_0x1c58b2[_0x7359('0xa')],'priority':_0x204396[_0x7359('0x31')]+_0x15f26b[_0x7359('0xf')]+_0x585f0c++,'VoiceExtensionId':_0x1c58b2[_0x7359('0x16')]});}}}for(var _0x4b02a0=0x0;_0x4b02a0<_0x204396[_0x7359('0x31')];_0x4b02a0+=0x1){var _0x378254=_0x15f26b['priority']+_0x204396[_0x7359('0x31')];var _0x53e482=_0x4b02a0===_0x204396['length']-0x1?_0x15f26b[_0x7359('0xf')]+_0x108117['length']+_0x31ce6d['length']+0x2:_0x15f26b['priority']+_0x4b02a0+0x1;_0x108117['splice'](_0x4b02a0,0x0,{'type':_0x1c58b2['type'],'app':_0x7359('0x3b'),'appdata':_0x204396[_0x4b02a0]+'?'+_0x1c58b2[_0x7359('0x18')]+_0x7359('0x3c')+_0x378254+':'+_0x1c58b2[_0x7359('0x18')]+_0x7359('0x3c')+_0x53e482,'exten':_0x1c58b2['exten'],'context':_0x1c58b2['context'],'priority':_0x15f26b['priority']+_0x4b02a0,'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});}_0x1c58b2[_0x7359('0xf')]=_0x108117['length']?_[_0x7359('0x3d')](_0x108117)[_0x7359('0xf')]+0x1:_0x15f26b['priority'];_0x15f26b[_0x7359('0xf')]=(_0x31ce6d[_0x7359('0x31')]?_[_0x7359('0x3d')](_0x31ce6d)['priority']:_0x1c58b2[_0x7359('0xf')])+0x1;_0x15f26b[_0x7359('0x10')]=_[_0x7359('0x3e')](_0x15f26b['extensions'],_0x108117,[_0x1c58b2],_0x31ce6d);}_0x15f26b['extensions'][_0x7359('0x13')]({'type':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x14')],'app':'Hangup','exten':_0x1d1879[_0x4de6f7][0x0]['exten'],'context':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x18')],'priority':_0x15f26b[_0x7359('0xf')],'VoiceExtensionId':_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]});_0xce7cd2[_0x7359('0x13')](_0x1d1879[_0x4de6f7][0x0][_0x7359('0x16')]);_0x109933=_['concat'](_0x109933,_0x15f26b[_0x7359('0x10')]);}}return _0x368fa3['transaction'](function(_0x1a71a3){return _0x368fa3[_0x7359('0x2')][_0x7359('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0xce7cd2}},'transaction':_0x1a71a3})['then'](function(_0x2e2a5e){return _0x368fa3[_0x7359('0x2')][_0x7359('0x6')]['bulkCreate'](_[_0x7359('0x3f')](_0x109933,_0x7359('0xf')),{'transaction':_0x1a71a3});});});})['catch'](function(_0x274c86){console[_0x7359('0x40')](_0x274c86);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xd063=[',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','catch','error','rewrite','lodash','util','Interval','findAll','models','VoiceExtension','then','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','CDR(type)=%s','VoiceExtensionId','inbound','Set','context','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','cutdigits','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','intervals','IntervalId','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','GotoIfTime'];(function(_0x21ebba,_0x36fafb){var _0xfabede=function(_0x70a662){while(--_0x70a662){_0x21ebba['push'](_0x21ebba['shift']());}};_0xfabede(++_0x36fafb);}(_0xd063,0x1c5));var _0x3d06=function(_0x497182,_0x40b150){_0x497182=_0x497182-0x0;var _0x33fcfc=_0xd063[_0x497182];return _0x33fcfc;};'use strict';var _=require(_0x3d06('0x0'));var util=require(_0x3d06('0x1'));function rewrite(_0x2d4692,_0x5f2028){var _0x579f8c=this;return _0x2d4692['models'][_0x3d06('0x2')][_0x3d06('0x3')]({'raw':!![]})['then'](function(_0xd4bf99){_0x579f8c['intervals']=_0xd4bf99;return _0x2d4692[_0x3d06('0x4')][_0x3d06('0x5')][_0x3d06('0x3')]({'where':{'IntervalId':_0x5f2028['IntervalId']},'raw':!![]});})[_0x3d06('0x6')](function(_0x5e3ff7){return _0x2d4692[_0x3d06('0x4')]['VoiceExtension'][_0x3d06('0x3')]({'where':{'exten':{'$in':_[_0x3d06('0x7')](_[_0x3d06('0x8')](_0x5e3ff7,'exten'))}},'order':[{'raw':_0x3d06('0x9')}],'raw':!![]});})['then'](function(_0x56eb75){var _0x3ce6da=_[_0x3d06('0xa')](_0x56eb75,{'priority':'1'});var _0x2687cf=_[_0x3d06('0xa')](_0x56eb75,{'isApp':0x1});var _0x4f12fa=_[_0x3d06('0xb')](_0x2687cf,_0x3d06('0xc'));var _0x526037=[_0x3d06('0xd'),_0x3d06('0xe')];var _0x293e27=[];var _0x3dccf7=[];for(var _0x231c40 in _0x4f12fa){if(_0x4f12fa[_0x3d06('0xf')](_0x231c40)){_0x579f8c[_0x3d06('0x10')]=0x2;_0x579f8c[_0x3d06('0x11')]=[];_0x579f8c[_0x3d06('0x12')]=_[_0x3d06('0x13')](_0x3ce6da,{'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')]});_0x579f8c[_0x3d06('0x11')][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':'Set','appdata':util[_0x3d06('0x16')](_0x3d06('0x17'),_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')]),'context':_0x4f12fa[_0x231c40][0x0]['context'],'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});if(_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')]===_0x3d06('0x19')){_0x579f8c['extensions'][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':_0x3d06('0x1a'),'appdata':'CDR(routeid)='+_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')],'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'priority':_0x579f8c['priority']++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});}else if(_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')]==='outbound'){if(_0x579f8c['extension']){_0x579f8c[_0x3d06('0x11')][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0]['type'],'app':'Set','appdata':_0x3d06('0x1c')+(_0x579f8c[_0x3d06('0x12')]['cutdigits']?_0x3d06('0x1d')+_0x579f8c['extension']['cutdigits']+'}':_0x3d06('0x1e')),'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});}_0x579f8c[_0x3d06('0x11')][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':_0x3d06('0x1a'),'appdata':_0x3d06('0x1f')+_0x4f12fa[_0x231c40][0x0]['VoiceExtensionId'],'context':_0x4f12fa[_0x231c40][0x0]['context'],'exten':_0x4f12fa[_0x231c40][0x0]['exten'],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});var _0x363f75=_0x579f8c['priority']++;_0x579f8c[_0x3d06('0x11')]['push']({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':_0x3d06('0x20'),'appdata':_0x3d06('0x21')+(_0x363f75+0x2)+_0x3d06('0x22')+(_0x363f75+0x1)+')','context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'priority':_0x363f75,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});if(_0x579f8c[_0x3d06('0x12')]){_0x579f8c[_0x3d06('0x11')]['push']({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':_0x3d06('0x1a'),'appdata':_0x579f8c[_0x3d06('0x12')]['cutdigits']?_0x3d06('0x23')+_0x579f8c['extension'][_0x3d06('0x24')]+'}':_0x3d06('0x25'),'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0]['exten'],'priority':_0x579f8c['priority']++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});}_0x579f8c[_0x3d06('0x11')][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0]['type'],'app':_0x3d06('0x1a'),'appdata':_0x3d06('0x26')+_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')],'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0]['exten'],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});if(_0x579f8c['extension']&&_0x579f8c['extension'][_0x3d06('0xf')](_0x3d06('0x27'))&&_0x579f8c[_0x3d06('0x12')]['recordingFormat']!==_0x3d06('0x28')){_0x579f8c[_0x3d06('0x11')][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':_0x3d06('0x1a'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4f12fa[_0x231c40][0x0]['context'],'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'priority':_0x579f8c['priority']++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});_0x579f8c['extensions'][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0]['type'],'app':_0x3d06('0x1a'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x579f8c[_0x3d06('0x12')][_0x3d06('0x27')]||_0x3d06('0x29'),'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0]['exten'],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0]['VoiceExtensionId']});}}_0x579f8c[_0x3d06('0x11')]['push']({'type':_0x4f12fa[_0x231c40][0x0]['type'],'app':_0x3d06('0x1a'),'appdata':_0x3d06('0x2a'),'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});_0x579f8c[_0x3d06('0x11')][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':'Set','appdata':_0x3d06('0x2b'),'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0]['VoiceExtensionId']});_0x579f8c[_0x3d06('0x11')][_0x3d06('0x14')]({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':'Set','appdata':_0x3d06('0x2c'),'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'exten':_0x4f12fa[_0x231c40][0x0]['exten'],'priority':_0x579f8c[_0x3d06('0x10')]++,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0]['VoiceExtensionId']});for(var _0x32cefb=0x0,_0xf06915=0x0;_0x32cefb<_0x4f12fa[_0x231c40][_0x3d06('0x2d')];_0x32cefb+=0x1,_0xf06915=0x0){var _0x28ebf4=_0x4f12fa[_0x231c40][_0x32cefb];if(_0x28ebf4[_0x3d06('0x15')]){_0x28ebf4['type']=_0x28ebf4[_0x3d06('0x15')][_0x3d06('0x2e')]();}var _0x328e2d=[];var _0x134a4d=[];delete _0x28ebf4['id'];delete _0x28ebf4[_0x3d06('0x2f')];delete _0x28ebf4['updatedAt'];var _0x1cbef4=_0x28ebf4[_0x3d06('0x30')]!==_0x3d06('0x31')?[_0x28ebf4[_0x3d06('0x30')]]:_0x28ebf4['IntervalId']?_[_0x3d06('0x8')](_[_0x3d06('0xa')](_0x579f8c[_0x3d06('0x32')],{'IntervalId':_0x28ebf4[_0x3d06('0x33')]}),'interval'):[];if(_0x28ebf4[_0x3d06('0xf')](_0x3d06('0x34'))){if(_0x28ebf4['tag']&&_0x28ebf4[_0x3d06('0x34')]!=='--'){_0x328e2d[_0x3d06('0x14')]({'type':_0x28ebf4[_0x3d06('0x15')],'app':_0x3d06('0x1a'),'appdata':_0x3d06('0x35')+_0x28ebf4['tag'],'context':_0x28ebf4['context'],'exten':_0x28ebf4[_0x3d06('0xc')],'priority':_0x1cbef4['length']+_0x579f8c[_0x3d06('0x10')]+_0xf06915++,'VoiceExtensionId':_0x28ebf4[_0x3d06('0x18')]});}}if(_0x28ebf4[_0x3d06('0x15')]===_0x3d06('0x36')&&_0x28ebf4[_0x3d06('0xf')](_0x3d06('0x37'))){if(_0x28ebf4['callerID']){_0x328e2d[_0x3d06('0x14')]({'type':_0x28ebf4[_0x3d06('0x15')],'app':_0x3d06('0x20'),'appdata':_0x3d06('0x38')+_0x28ebf4[_0x3d06('0x37')]+')','context':_0x28ebf4['context'],'exten':_0x28ebf4[_0x3d06('0xc')],'priority':_0x1cbef4[_0x3d06('0x2d')]+_0x579f8c[_0x3d06('0x10')]+_0xf06915++,'VoiceExtensionId':_0x28ebf4['VoiceExtensionId']});}else{_0x328e2d[_0x3d06('0x14')]({'type':_0x28ebf4[_0x3d06('0x15')],'app':'ExecIf','appdata':_0x3d06('0x39'),'context':_0x28ebf4['context'],'exten':_0x28ebf4['exten'],'priority':_0x1cbef4[_0x3d06('0x2d')]+_0x579f8c[_0x3d06('0x10')]+_0xf06915++,'VoiceExtensionId':_0x28ebf4['VoiceExtensionId']});}}if(_0x28ebf4['hasOwnProperty']('answer')){if(_0x526037[_0x3d06('0x3a')](_0x28ebf4[_0x3d06('0x3b')][_0x3d06('0x2e')]())>=0x0&&_0x28ebf4[_0x3d06('0x3c')]!==_0x3d06('0x3d')){if(_0x28ebf4['answer']){_0x328e2d[_0x3d06('0x14')]({'type':_0x28ebf4[_0x3d06('0x15')],'app':_0x3d06('0x20'),'appdata':_0x3d06('0x3e'),'context':_0x28ebf4['context'],'exten':_0x28ebf4[_0x3d06('0xc')],'priority':_0x1cbef4[_0x3d06('0x2d')]+_0x579f8c['priority']+_0xf06915++,'VoiceExtensionId':_0x28ebf4['VoiceExtensionId']});_0x328e2d[_0x3d06('0x14')]({'type':_0x28ebf4[_0x3d06('0x15')],'app':_0x3d06('0x1a'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x28ebf4['context'],'exten':_0x28ebf4[_0x3d06('0xc')],'priority':_0x1cbef4[_0x3d06('0x2d')]+_0x579f8c['priority']+_0xf06915++,'VoiceExtensionId':_0x28ebf4[_0x3d06('0x18')]});}else{_0x328e2d[_0x3d06('0x14')]({'type':_0x28ebf4['type'],'app':'ExecIf','appdata':_0x3d06('0x3f'),'context':_0x28ebf4[_0x3d06('0x1b')],'exten':_0x28ebf4['exten'],'priority':_0x1cbef4['length']+_0x579f8c[_0x3d06('0x10')]+_0xf06915++,'VoiceExtensionId':_0x28ebf4['VoiceExtensionId']});_0x328e2d[_0x3d06('0x14')]({'type':_0x28ebf4[_0x3d06('0x15')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x28ebf4[_0x3d06('0x1b')],'exten':_0x28ebf4[_0x3d06('0xc')],'priority':_0x1cbef4[_0x3d06('0x2d')]+_0x579f8c[_0x3d06('0x10')]+_0xf06915++,'VoiceExtensionId':_0x28ebf4[_0x3d06('0x18')]});}}}for(var _0x311f45=0x0;_0x311f45<_0x1cbef4[_0x3d06('0x2d')];_0x311f45+=0x1){var _0x4b01f6=_0x579f8c['priority']+_0x1cbef4[_0x3d06('0x2d')];var _0x3f2855=_0x311f45===_0x1cbef4[_0x3d06('0x2d')]-0x1?_0x579f8c[_0x3d06('0x10')]+_0x328e2d[_0x3d06('0x2d')]+_0x134a4d[_0x3d06('0x2d')]+0x2:_0x579f8c['priority']+_0x311f45+0x1;_0x328e2d['splice'](_0x311f45,0x0,{'type':_0x28ebf4[_0x3d06('0x15')],'app':_0x3d06('0x40'),'appdata':_0x1cbef4[_0x311f45]+'?'+_0x28ebf4[_0x3d06('0x1b')]+_0x3d06('0x41')+_0x4b01f6+':'+_0x28ebf4[_0x3d06('0x1b')]+_0x3d06('0x41')+_0x3f2855,'exten':_0x28ebf4[_0x3d06('0xc')],'context':_0x28ebf4[_0x3d06('0x1b')],'priority':_0x579f8c[_0x3d06('0x10')]+_0x311f45,'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});}_0x28ebf4[_0x3d06('0x10')]=_0x328e2d[_0x3d06('0x2d')]?_[_0x3d06('0x42')](_0x328e2d)[_0x3d06('0x10')]+0x1:_0x579f8c[_0x3d06('0x10')];_0x579f8c['priority']=(_0x134a4d[_0x3d06('0x2d')]?_['last'](_0x134a4d)[_0x3d06('0x10')]:_0x28ebf4[_0x3d06('0x10')])+0x1;_0x579f8c['extensions']=_[_0x3d06('0x43')](_0x579f8c['extensions'],_0x328e2d,[_0x28ebf4],_0x134a4d);}_0x579f8c[_0x3d06('0x11')]['push']({'type':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x15')],'app':_0x3d06('0x44'),'exten':_0x4f12fa[_0x231c40][0x0][_0x3d06('0xc')],'context':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x1b')],'priority':_0x579f8c[_0x3d06('0x10')],'VoiceExtensionId':_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]});_0x293e27[_0x3d06('0x14')](_0x4f12fa[_0x231c40][0x0][_0x3d06('0x18')]);_0x3dccf7=_[_0x3d06('0x43')](_0x3dccf7,_0x579f8c[_0x3d06('0x11')]);}}return _0x2d4692[_0x3d06('0x45')](function(_0x22dac9){return _0x2d4692['models'][_0x3d06('0x5')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x293e27}},'transaction':_0x22dac9})['then'](function(_0x4961c9){return _0x2d4692[_0x3d06('0x4')]['VoiceExtension'][_0x3d06('0x46')](_['sortBy'](_0x3dccf7,_0x3d06('0x10')),{'transaction':_0x22dac9});});});})[_0x3d06('0x47')](function(_0x7b20cd){console[_0x3d06('0x48')](_0x7b20cd);});}exports[_0x3d06('0x49')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 851b91f..8d60871 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 _0x16d5=['NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','\x20=\x20?','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','always','push','sequelize','catch','onlyIfOpen','query','VoiceQueueId','all','get','Campaign','Lists','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','resume','resolve','contact:csv_','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','split','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','api','defaults','redis','localhost','../../../api/cmContact/cmContact.socket','argv','undefined','Missing\x20filepath\x20parameter!','null','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','error','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','birthDate','isValid','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','ContactId','ListId','createdAt','updatedAt','select','field'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16d5,0x18a));var _0x516d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16d5[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x516d('0x0'));var util=require(_0x516d('0x1'));var _=require(_0x516d('0x2'));var fs=require('fs');var squel=require(_0x516d('0x3'));var Papa=require(_0x516d('0x4'));var Redis=require('ioredis');var db=require(_0x516d('0x5'))['db'];var config=require(_0x516d('0x6'));var logger=require(_0x516d('0x7'))(_0x516d('0x8'));config['redis']=_[_0x516d('0x9')](config[_0x516d('0xa')],{'host':_0x516d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x516d('0xc'))['register'](socket);try{if(!process[_0x516d('0xd')][0x2]||process[_0x516d('0xd')][0x2]===_0x516d('0xe')||process[_0x516d('0xd')][0x2]==='null'){throw new Error(_0x516d('0xf'));}var FILEPATH=process['argv'][0x2];if(!process[_0x516d('0xd')][0x3]||process[_0x516d('0xd')][0x3]===_0x516d('0xe')||process['argv'][0x3]===_0x516d('0x10')||!process[_0x516d('0xd')][0x4]||process[_0x516d('0xd')][0x4]==='undefined'||process[_0x516d('0xd')][0x4]==='null'){throw new Error(_0x516d('0x11'));}var FIELDS=_[_0x516d('0x12')](process[_0x516d('0xd')][0x3]['split'](','),process[_0x516d('0xd')][0x4]['split'](','));if(!process[_0x516d('0xd')][0x5]||process[_0x516d('0xd')][0x5]===_0x516d('0xe')||process[_0x516d('0xd')][0x5]==='null'){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x516d('0xd')][0x5];var COMPANYID=process[_0x516d('0xd')][0x6]&&process['argv'][0x6]!==_0x516d('0xe')&&process[_0x516d('0xd')][0x6]!==_0x516d('0x10')?process[_0x516d('0xd')][0x6]:null;var DUPLICATES=process[_0x516d('0xd')][0x7]&&process['argv'][0x7]!==_0x516d('0xe')&&process['argv'][0x7]!==_0x516d('0x10')?process[_0x516d('0xd')][0x7]:null;if(!process[_0x516d('0xd')][0x8]||process['argv'][0x8]===_0x516d('0xe')||process[_0x516d('0xd')][0x8]===_0x516d('0x10')){throw new Error(_0x516d('0x13'));}var SOCKET_TIMESTAMP=process[_0x516d('0xd')][0x8];}catch(_0x3f855f){logger['error'](_0x3f855f);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(_0x194631,_0x44491d,_0x27a6f1,_0x2b992d){var _0x507512={'message':_0x44491d};_0x507512[_0x194631]=!![];if(_0x27a6f1){_0x507512[_0x516d('0x14')]=_0x27a6f1;}if(_0x2b992d){_0x507512[_0x516d('0x15')]=_0x2b992d;}return _0x507512;}function isEmail(_0x96b186){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'](_0x96b186);}function checkRow(_0x4c45b1,_0x2563e0,_0x427e0a){return new BPromise(function(_0x525f2b,_0x3f9f50){if(_[_0x516d('0x16')](_0x4c45b1)){return _0x3f9f50(handleCheckRowError('error',_0x516d('0x17'),null,_0x427e0a));}if(_0x4c45b1[_0x516d('0x18')]&&_0x4c45b1[_0x516d('0x18')][_0x516d('0x19')]){var _0x53e4d7=_[_0x516d('0x1a')](_0x4c45b1[_0x516d('0x18')],_0x516d('0x1b'))[_0x516d('0x1c')](';');return _0x3f9f50(handleCheckRowError(_0x516d('0x1d'),_0x53e4d7,null,_0x427e0a));}var _0xab48d7={};for(var _0x25398e in FIELDS){if(FIELDS[_0x516d('0x1e')](_0x25398e)&&FIELDS[_0x25398e]){_0xab48d7[_0x25398e]=_0x4c45b1[_0x516d('0x1f')][0x0][FIELDS[_0x25398e]]||_0x4c45b1[_0x516d('0x1f')][0x0]['\ufeff'+FIELDS[_0x25398e]];}}if(!_0xab48d7[_0x516d('0x20')]){return _0x3f9f50(handleCheckRowError(_0x516d('0x1d'),_0x516d('0x21'),null,_0x427e0a));}if(!_0xab48d7[_0x516d('0x22')]){return _0x3f9f50(handleCheckRowError(_0x516d('0x1d'),'phone\x20not\x20specified!',null,_0x427e0a));}if(_0xab48d7[_0x516d('0x23')]){var _0xd7cafb=moment(_0xab48d7['birthDate'],'YYYY-MM-DD');if(!_0xd7cafb[_0x516d('0x24')]()){return _0x3f9f50(handleCheckRowError(_0x516d('0x1d'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x427e0a));}}if(_0xab48d7[_0x516d('0x25')]){if(!isEmail(_0xab48d7[_0x516d('0x25')])){return _0x3f9f50(handleCheckRowError(_0x516d('0x1d'),_0x516d('0x26'),null,_0x427e0a));}}_0xab48d7['ListId']=LISTID;_0xab48d7[_0x516d('0x27')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x516d('0x19')]&&_0x2563e0){var _0x1390e9={};for(var _0x391478=0x0,_0x5b2b7e=DUPLICATES[_0x516d('0x19')];_0x391478<_0x5b2b7e;_0x391478+=0x1){_0x1390e9[DUPLICATES[_0x391478]]=_0xab48d7[DUPLICATES[_0x391478]];}var _0x41277d=_[_0x516d('0x28')](_0x2563e0,_0x1390e9);if(_0x41277d){return _0x3f9f50(handleCheckRowError(_0x516d('0x29'),_0x516d('0x2a'),_0x41277d,_0x427e0a));}}return db['CmContact'][_0x516d('0x2b')](_0xab48d7,{'raw':!![],'hooks':![],'fields':_[_0x516d('0x2c')](_0xab48d7)})[_0x516d('0x2d')](function(_0x3f8b3c){if(DUPLICATES&&DUPLICATES[_0x516d('0x19')]&&_0x2563e0){_0x2563e0['push'](_[_0x516d('0x2e')](_0xab48d7,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x3f8b3c['id'];return _0x525f2b();})['catch'](function(_0x37cf46){return _0x3f9f50(handleCheckRowError(_0x516d('0x1d'),_0x516d('0x2f')+(_0x37cf46[_0x516d('0x1b')]||JSON[_0x516d('0x30')](_0x37cf46)),null,_0x427e0a));});});}function checkHopper(){function _0x557544(){return function(_0x892f0b){logger[_0x516d('0x1d')](_0x516d('0x31'),_0x516d('0x32'),util[_0x516d('0x33')](_0x892f0b,{'showHidden':![],'depth':null}));};}var _0x56c3e1=function(_0x3801c4,_0x311583){var _0x19ac21=squel[_0x516d('0x34')]()[_0x516d('0x35')](_0x516d('0x36'))[_0x516d('0x37')](['phone','scheduledAt',_0x516d('0x38'),_0x516d('0x39'),_0x311583,_0x516d('0x3a'),_0x516d('0x3b')],squel[_0x516d('0x3c')]()['field']('phone','phone')[_0x516d('0x3d')](_0x516d('0x3e'),_0x516d('0x3f'))[_0x516d('0x3d')]('id',_0x516d('0x38'))['field'](LISTID['toString'](),_0x516d('0x39'))[_0x516d('0x3d')](_0x3801c4['id'][_0x516d('0x40')](),_0x311583)[_0x516d('0x3d')](_0x516d('0x3e'),_0x516d('0x3a'))[_0x516d('0x3d')](_0x516d('0x3e'),_0x516d('0x3b'))[_0x516d('0x41')](_0x516d('0x42'))['where'](_0x516d('0x43'))[_0x516d('0x44')](_0x516d('0x45'),LISTID[_0x516d('0x40')]())[_0x516d('0x44')]('phone\x20IS\x20NOT\x20NULL')[_0x516d('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x516d('0x3d')](_0x516d('0x22'))[_0x516d('0x41')](_0x516d('0x36'))[_0x516d('0x44')](_0x311583+_0x516d('0x46'),_0x3801c4['id'][_0x516d('0x40')]())))['toString']();return _0x19ac21;};var _0x5ce139=function(_0x59d114,_0x1ae29e){var _0x48bfe7=squel[_0x516d('0x34')]()[_0x516d('0x35')](_0x516d('0x36'))['fromQuery']([_0x516d('0x22'),_0x516d('0x3f'),_0x516d('0x38'),'ListId',_0x1ae29e,_0x516d('0x3a'),_0x516d('0x3b')],squel['select']()[_0x516d('0x3d')](_0x516d('0x22'),_0x516d('0x22'))['field']('NOW()','scheduledAt')['field']('id',_0x516d('0x38'))['field'](LISTID[_0x516d('0x40')](),_0x516d('0x39'))[_0x516d('0x3d')](_0x59d114['id'][_0x516d('0x40')](),_0x1ae29e)[_0x516d('0x3d')](_0x516d('0x3e'),_0x516d('0x3a'))['field'](_0x516d('0x3e'),'updatedAt')[_0x516d('0x41')](_0x516d('0x42'))[_0x516d('0x44')](_0x516d('0x43'))[_0x516d('0x44')](_0x516d('0x45'),LISTID[_0x516d('0x40')]())[_0x516d('0x44')](_0x516d('0x47'),squel[_0x516d('0x48')](hopperContacts))['where'](_0x516d('0x49'))[_0x516d('0x44')](_0x516d('0x4a'),squel[_0x516d('0x3c')]()[_0x516d('0x3d')](_0x516d('0x4b'))[_0x516d('0x41')]('cm_hopper_final')[_0x516d('0x44')](_0x1ae29e+'\x20=\x20?',_0x59d114['id'][_0x516d('0x40')]()))['where'](_0x516d('0x4a'),squel[_0x516d('0x3c')]()[_0x516d('0x3d')](_0x516d('0x22'))[_0x516d('0x41')]('cm_hopper')[_0x516d('0x44')](_0x1ae29e+_0x516d('0x46'),_0x59d114['id'][_0x516d('0x40')]())))[_0x516d('0x40')]();return _0x48bfe7;};function _0x2ddae5(_0x5048f7,_0xfb9785){var _0x5cb25b=squel[_0x516d('0x34')]()['into']('cm_hopper')[_0x516d('0x37')]([_0x516d('0x22'),_0x516d('0x3f'),_0x516d('0x38'),_0x516d('0x39'),_0xfb9785,_0x516d('0x3a'),_0x516d('0x3b')],squel['select']()[_0x516d('0x3d')](_0x516d('0x22'),_0x516d('0x22'))[_0x516d('0x3d')](_0x516d('0x3e'),_0x516d('0x3f'))['field']('id',_0x516d('0x38'))[_0x516d('0x3d')](LISTID[_0x516d('0x40')](),_0x516d('0x39'))[_0x516d('0x3d')](_0x5048f7['id']['toString'](),_0xfb9785)[_0x516d('0x3d')]('NOW()',_0x516d('0x3a'))['field'](_0x516d('0x3e'),_0x516d('0x3b'))[_0x516d('0x41')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x516d('0x44')](_0x516d('0x45'),LISTID[_0x516d('0x40')]())[_0x516d('0x44')](_0x516d('0x47'),squel[_0x516d('0x48')](hopperContacts))[_0x516d('0x44')](_0x516d('0x49')))[_0x516d('0x40')]();return _0x5cb25b;}function _0x467307(_0x1b5d65,_0x56a4d1){var _0x1d1ca6=squel[_0x516d('0x34')]()[_0x516d('0x35')](_0x516d('0x4c'))[_0x516d('0x37')]([_0x516d('0x22'),_0x516d('0x38'),_0x516d('0x39'),_0x56a4d1,'createdAt',_0x516d('0x3b')],squel[_0x516d('0x3c')]()[_0x516d('0x3d')]('phone',_0x516d('0x22'))['field']('id',_0x516d('0x38'))[_0x516d('0x3d')](LISTID['toString'](),_0x516d('0x39'))[_0x516d('0x3d')](_0x1b5d65['id'][_0x516d('0x40')](),_0x56a4d1)[_0x516d('0x3d')](_0x516d('0x3e'),_0x516d('0x3a'))['field'](_0x516d('0x3e'),_0x516d('0x3b'))[_0x516d('0x41')](_0x516d('0x42'))[_0x516d('0x44')](_0x516d('0x43'))[_0x516d('0x44')](_0x516d('0x45'),LISTID[_0x516d('0x40')]())[_0x516d('0x44')]('id\x20IN\x20?',squel[_0x516d('0x48')](hopperContacts))['where'](_0x516d('0x49')))[_0x516d('0x40')]();return _0x1d1ca6;}return db[_0x516d('0x4d')][_0x516d('0x4e')]({'where':{'type':_0x516d('0x4f')},'attributes':['id',_0x516d('0x50')],'include':[{'model':db[_0x516d('0x51')],'as':'Lists','where':{'id':LISTID}}]})['then'](function(_0x5194bd){var _0x1608a0=[];if(_0x5194bd){var _0x4e663b;for(var _0x23cf23=0x0,_0x52c591;_0x23cf23<_0x5194bd['length'];_0x23cf23+=0x1){_0x52c591=_0x5194bd[_0x23cf23]['get']({'plain':!![]});switch(_0x52c591[_0x516d('0x50')]){case _0x516d('0x52'):_0x1608a0[_0x516d('0x53')](db[_0x516d('0x54')]['query'](_0x5ce139(_0x52c591,'VoiceQueueId'))[_0x516d('0x2d')](function(){})[_0x516d('0x55')](_0x557544()));break;case _0x516d('0x56'):_0x1608a0[_0x516d('0x53')](db[_0x516d('0x54')][_0x516d('0x57')](_0x56c3e1(_0x52c591,'VoiceQueueId'))[_0x516d('0x2d')](function(){})[_0x516d('0x55')](_0x557544()));break;default:_0x1608a0['push'](db[_0x516d('0x54')][_0x516d('0x57')](_0x2ddae5(_0x52c591,_0x516d('0x58')))[_0x516d('0x2d')](function(){})[_0x516d('0x55')](_0x557544()));}}}return _0x1608a0;})[_0x516d('0x59')]()[_0x516d('0x2d')](function(){return db[_0x516d('0x4d')]['findAll']({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x516d('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x516d('0x2d')](function(_0x32ba04){var _0x2e836a=[];if(_0x32ba04){var _0x8374f0;for(var _0x4d8838=0x0,_0x4a8c30;_0x4d8838<_0x32ba04[_0x516d('0x19')];_0x4d8838+=0x1){_0x4a8c30=_0x32ba04[_0x4d8838][_0x516d('0x5a')]({'plain':!![]});_0x2e836a[_0x516d('0x53')](db[_0x516d('0x54')][_0x516d('0x57')](_0x467307(_0x4a8c30,_0x516d('0x58')))[_0x516d('0x2d')](function(){})['catch'](_0x557544()));}}return _0x2e836a;})[_0x516d('0x59')]();})[_0x516d('0x2d')](function(){return db[_0x516d('0x5b')][_0x516d('0x4e')]({'attributes':['id',_0x516d('0x50')],'include':[{'model':db[_0x516d('0x51')],'as':_0x516d('0x5c'),'where':{'id':LISTID}}]})[_0x516d('0x2d')](function(_0x26b0b6){var _0x3e24af=[];if(_0x26b0b6){for(var _0x1e2192=0x0,_0x5f01cd;_0x1e2192<_0x26b0b6[_0x516d('0x19')];_0x1e2192+=0x1){_0x5f01cd=_0x26b0b6[_0x1e2192]['get']({'plain':!![]});switch(_0x5f01cd[_0x516d('0x50')]){case _0x516d('0x52'):_0x3e24af[_0x516d('0x53')](db[_0x516d('0x54')][_0x516d('0x57')](_0x5ce139(_0x5f01cd,_0x516d('0x5d')))['then'](function(){})[_0x516d('0x55')](_0x557544()));break;case _0x516d('0x56'):_0x3e24af[_0x516d('0x53')](db[_0x516d('0x54')][_0x516d('0x57')](_0x56c3e1(_0x5f01cd,_0x516d('0x5d')))[_0x516d('0x2d')](function(){})[_0x516d('0x55')](_0x557544()));break;default:_0x3e24af[_0x516d('0x53')](db[_0x516d('0x54')]['query'](_0x2ddae5(_0x5f01cd,_0x516d('0x5d')))[_0x516d('0x2d')](function(){})[_0x516d('0x55')](_0x557544()));}}}return _0x3e24af;})[_0x516d('0x59')]();})['then'](function(){return db[_0x516d('0x5b')][_0x516d('0x4e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x516d('0x2d')](function(_0x32584f){var _0x625368=[];if(_0x32584f){for(var _0x3ab11e=0x0,_0x226c0c;_0x3ab11e<_0x32584f['length'];_0x3ab11e+=0x1){_0x226c0c=_0x32584f[_0x3ab11e][_0x516d('0x5a')]({'plain':!![]});_0x625368[_0x516d('0x53')](db[_0x516d('0x54')][_0x516d('0x57')](_0x467307(_0x226c0c,_0x516d('0x5d')))['then'](function(){})[_0x516d('0x55')](_0x557544()));}}return _0x625368;})[_0x516d('0x59')]();})['catch'](function(_0xe0837a){logger[_0x516d('0x1d')](_0x516d('0x5e'),_0x516d('0x5f'),_0xe0837a[_0x516d('0x1b')]);});}var processPromises=function(_0x48de56){return BPromise[_0x516d('0x59')](promises)[_0x516d('0x2d')](function(_0x2673b8){})['catch'](function(_0x35cc44){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x516d('0x30')](_0x35cc44));})[_0x516d('0x60')](function(){socket[_0x516d('0x61')]('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x48de56){return _0x48de56[_0x516d('0x62')]();}});};var endCsv=function(){return BPromise[_0x516d('0x63')]()[_0x516d('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0x516d('0x2d')](function(){socket[_0x516d('0x61')](_0x516d('0x64')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x516d('0x65')](FILEPATH);}catch(_0x62be){logger['error'](_0x516d('0x66'),JSON[_0x516d('0x30')](_0x62be));}finally{process[_0x516d('0x67')](0x0);}});};process['on'](_0x516d('0x68'),function(){logger[_0x516d('0x69')](_0x516d('0x6a'));endCsv();});function main(){return BPromise[_0x516d('0x63')]()[_0x516d('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x516d('0x6b')](',');return db['CmContact'][_0x516d('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x516d('0x2d')](function(_0x2ca00e){var _0x2121ce=fs[_0x516d('0x6c')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x516d('0x6d')](_0x2121ce,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ecf07,_0x5f1bf6){total+=0x1;var _0x4c7a94=total;promises[_0x516d('0x53')](checkRow(_0x1ecf07,_0x2ca00e,_0x4c7a94)['then'](function(){success+=0x1;})[_0x516d('0x55')](function(_0x581590){if(_0x581590[_0x516d('0x1d')]){errors+=0x1;delete _0x581590[_0x516d('0x1d')];}else if(_0x581590[_0x516d('0x29')]){duplicates+=0x1;delete _0x581590[_0x516d('0x29')];}rows[_0x516d('0x53')](_0x581590);}));if(total%0xc8===0x0){_0x5f1bf6[_0x516d('0x6e')]();return processPromises(_0x5f1bf6);}},'complete':function(){return processPromises()['then'](function(){logger[_0x516d('0x69')](_0x516d('0x6f'));endCsv();});},'error':function(_0x67cc6f,_0x1e258e){logger[_0x516d('0x69')](_0x516d('0x70'),JSON['stringify'](_0x67cc6f));endCsv();}});})[_0x516d('0x55')](function(_0x14ecf3){logger[_0x516d('0x1d')](_0x516d('0x71'),JSON[_0x516d('0x30')](_0x14ecf3));});}main(); \ No newline at end of file +var _0x16a7=['ListId','CompanyId','duplicate','Duplicate\x20Contact','create','keys','then','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','cmContact','checkHopper','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','str','id\x20IN\x20?','cm_hopper_black','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','query','VoiceQueueId','onlyIfOpen','sequelize','all','BlackLists','get','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','SIGINT','CmContact','createReadStream','parse','info','CSV\x20parsed\x20correctly!','stringify','Error\x20executing\x20contact\x20csv\x20import:','bluebird','lodash','../../../config/logger','redis','defaults','localhost','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','email'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x16a7,0x1e1));var _0x716a=function(_0x37406a,_0x5bdd74){_0x37406a=_0x37406a-0x0;var _0x2b3e03=_0x16a7[_0x37406a];return _0x2b3e03;};'use strict';var BPromise=require(_0x716a('0x0'));var util=require('util');var _=require(_0x716a('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require('ioredis');var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x716a('0x2'))('api');config[_0x716a('0x3')]=_[_0x716a('0x4')](config[_0x716a('0x3')],{'host':_0x716a('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x716a('0x3')]));require(_0x716a('0x6'))[_0x716a('0x7')](socket);try{if(!process['argv'][0x2]||process[_0x716a('0x8')][0x2]===_0x716a('0x9')||process['argv'][0x2]===_0x716a('0xa')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x716a('0x8')][0x3]===_0x716a('0x9')||process['argv'][0x3]===_0x716a('0xa')||!process[_0x716a('0x8')][0x4]||process[_0x716a('0x8')][0x4]===_0x716a('0x9')||process[_0x716a('0x8')][0x4]===_0x716a('0xa')){throw new Error(_0x716a('0xb'));}var FIELDS=_['zipObject'](process[_0x716a('0x8')][0x3][_0x716a('0xc')](','),process[_0x716a('0x8')][0x4][_0x716a('0xc')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x716a('0x9')||process[_0x716a('0x8')][0x5]===_0x716a('0xa')){throw new Error(_0x716a('0xd'));}var LISTID=process[_0x716a('0x8')][0x5];var COMPANYID=process[_0x716a('0x8')][0x6]&&process['argv'][0x6]!==_0x716a('0x9')&&process[_0x716a('0x8')][0x6]!==_0x716a('0xa')?process[_0x716a('0x8')][0x6]:null;var DUPLICATES=process[_0x716a('0x8')][0x7]&&process[_0x716a('0x8')][0x7]!==_0x716a('0x9')&&process[_0x716a('0x8')][0x7]!=='null'?process[_0x716a('0x8')][0x7]:null;if(!process[_0x716a('0x8')][0x8]||process[_0x716a('0x8')][0x8]===_0x716a('0x9')||process[_0x716a('0x8')][0x8]==='null'){throw new Error(_0x716a('0xe'));}var SOCKET_TIMESTAMP=process[_0x716a('0x8')][0x8];}catch(_0x233de6){logger[_0x716a('0xf')](_0x233de6);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(_0x2b32b4,_0x567311,_0x4e1028,_0x4137cb){var _0x295d15={'message':_0x567311};_0x295d15[_0x2b32b4]=!![];if(_0x4e1028){_0x295d15[_0x716a('0x10')]=_0x4e1028;}if(_0x4137cb){_0x295d15[_0x716a('0x11')]=_0x4137cb;}return _0x295d15;}function isEmail(_0xf94f4d){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))*$/[_0x716a('0x12')](_0xf94f4d);}function checkRow(_0x2fdbc9,_0x2e2941,_0x1d77fe){return new BPromise(function(_0x14ddc0,_0x3acd28){if(_[_0x716a('0x13')](_0x2fdbc9)){return _0x3acd28(handleCheckRowError(_0x716a('0xf'),_0x716a('0x14'),null,_0x1d77fe));}if(_0x2fdbc9[_0x716a('0x15')]&&_0x2fdbc9['errors'][_0x716a('0x16')]){var _0x473647=_[_0x716a('0x17')](_0x2fdbc9['errors'],'message')['join'](';');return _0x3acd28(handleCheckRowError(_0x716a('0xf'),_0x473647,null,_0x1d77fe));}var _0x33f66b={};for(var _0x8a3eb9 in FIELDS){if(FIELDS[_0x716a('0x18')](_0x8a3eb9)&&FIELDS[_0x8a3eb9]){_0x33f66b[_0x8a3eb9]=_0x2fdbc9[_0x716a('0x19')][0x0][FIELDS[_0x8a3eb9]]||_0x2fdbc9[_0x716a('0x19')][0x0]['\ufeff'+FIELDS[_0x8a3eb9]];}}if(!_0x33f66b[_0x716a('0x1a')]){return _0x3acd28(handleCheckRowError('error',_0x716a('0x1b'),null,_0x1d77fe));}if(!_0x33f66b[_0x716a('0x1c')]){return _0x3acd28(handleCheckRowError('error',_0x716a('0x1d'),null,_0x1d77fe));}if(_0x33f66b[_0x716a('0x1e')]){var _0x1fc930=moment(_0x33f66b['birthDate'],_0x716a('0x1f'));if(!_0x1fc930[_0x716a('0x20')]()){return _0x3acd28(handleCheckRowError(_0x716a('0xf'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x1d77fe));}}if(_0x33f66b['email']){if(!isEmail(_0x33f66b[_0x716a('0x21')])){return _0x3acd28(handleCheckRowError(_0x716a('0xf'),'email\x20format\x20is\x20not\x20valid!',null,_0x1d77fe));}}_0x33f66b[_0x716a('0x22')]=LISTID;_0x33f66b[_0x716a('0x23')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x716a('0x16')]&&_0x2e2941){var _0x513609={};for(var _0x33145b=0x0,_0x21ca7a=DUPLICATES[_0x716a('0x16')];_0x33145b<_0x21ca7a;_0x33145b+=0x1){_0x513609[DUPLICATES[_0x33145b]]=_0x33f66b[DUPLICATES[_0x33145b]];}var _0x79c152=_['find'](_0x2e2941,_0x513609);if(_0x79c152){return _0x3acd28(handleCheckRowError(_0x716a('0x24'),_0x716a('0x25'),_0x79c152,_0x1d77fe));}}return db['CmContact'][_0x716a('0x26')](_0x33f66b,{'raw':!![],'hooks':![],'fields':_[_0x716a('0x27')](_0x33f66b)})[_0x716a('0x28')](function(_0x44096a){if(DUPLICATES&&DUPLICATES[_0x716a('0x16')]&&_0x2e2941){_0x2e2941[_0x716a('0x29')](_[_0x716a('0x2a')](_0x33f66b,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x44096a['id'];return _0x14ddc0();})[_0x716a('0x2b')](function(_0xb11c5e){return _0x3acd28(handleCheckRowError('error',_0x716a('0x2c')+(_0xb11c5e['message']||JSON['stringify'](_0xb11c5e)),null,_0x1d77fe));});});}function checkHopper(){function _0x2abeb0(){return function(_0x5cd6e4){logger['error'](_0x716a('0x2d'),_0x716a('0x2e'),util[_0x716a('0x2f')](_0x5cd6e4,{'showHidden':![],'depth':null}));};}var _0x4743b8=function(_0x1e949a,_0x35024e){var _0x5e62d3=squel[_0x716a('0x30')]()[_0x716a('0x31')](_0x716a('0x32'))[_0x716a('0x33')]([_0x716a('0x1c'),_0x716a('0x34'),_0x716a('0x35'),'ListId',_0x35024e,'createdAt',_0x716a('0x36')],squel[_0x716a('0x37')]()[_0x716a('0x38')](_0x716a('0x1c'),_0x716a('0x1c'))['field'](_0x716a('0x39'),_0x716a('0x34'))[_0x716a('0x38')]('id',_0x716a('0x35'))[_0x716a('0x38')](LISTID[_0x716a('0x3a')](),_0x716a('0x22'))[_0x716a('0x38')](_0x1e949a['id'][_0x716a('0x3a')](),_0x35024e)[_0x716a('0x38')](_0x716a('0x39'),_0x716a('0x3b'))[_0x716a('0x38')]('NOW()',_0x716a('0x36'))[_0x716a('0x3c')](_0x716a('0x3d'))[_0x716a('0x3e')](_0x716a('0x3f'))['where'](_0x716a('0x40'),LISTID[_0x716a('0x3a')]())[_0x716a('0x3e')](_0x716a('0x41'))['where'](_0x716a('0x42'),squel[_0x716a('0x37')]()['field'](_0x716a('0x1c'))[_0x716a('0x3c')](_0x716a('0x32'))[_0x716a('0x3e')](_0x35024e+_0x716a('0x43'),_0x1e949a['id'][_0x716a('0x3a')]())))[_0x716a('0x3a')]();return _0x5e62d3;};var _0x5858bc=function(_0x291042,_0x3c0832){var _0x3e19d6=squel[_0x716a('0x30')]()[_0x716a('0x31')](_0x716a('0x32'))[_0x716a('0x33')]([_0x716a('0x1c'),'scheduledAt',_0x716a('0x35'),_0x716a('0x22'),_0x3c0832,'createdAt','updatedAt'],squel['select']()['field'](_0x716a('0x1c'),'phone')['field'](_0x716a('0x39'),_0x716a('0x34'))['field']('id',_0x716a('0x35'))[_0x716a('0x38')](LISTID[_0x716a('0x3a')](),_0x716a('0x22'))[_0x716a('0x38')](_0x291042['id'][_0x716a('0x3a')](),_0x3c0832)[_0x716a('0x38')](_0x716a('0x39'),_0x716a('0x3b'))[_0x716a('0x38')]('NOW()','updatedAt')[_0x716a('0x3c')](_0x716a('0x3d'))[_0x716a('0x3e')](_0x716a('0x3f'))[_0x716a('0x3e')](_0x716a('0x40'),LISTID[_0x716a('0x3a')]())[_0x716a('0x3e')]('id\x20IN\x20?',squel[_0x716a('0x44')](hopperContacts))[_0x716a('0x3e')](_0x716a('0x41'))['where'](_0x716a('0x42'),squel[_0x716a('0x37')]()[_0x716a('0x38')]('calleridnum')[_0x716a('0x3c')]('cm_hopper_final')['where'](_0x3c0832+_0x716a('0x43'),_0x291042['id']['toString']()))[_0x716a('0x3e')](_0x716a('0x42'),squel['select']()[_0x716a('0x38')]('phone')['from'](_0x716a('0x32'))['where'](_0x3c0832+_0x716a('0x43'),_0x291042['id'][_0x716a('0x3a')]())))[_0x716a('0x3a')]();return _0x3e19d6;};function _0x3ae2ba(_0x5e52f8,_0x19da6a){var _0x1ca6dc=squel[_0x716a('0x30')]()[_0x716a('0x31')](_0x716a('0x32'))[_0x716a('0x33')]([_0x716a('0x1c'),_0x716a('0x34'),_0x716a('0x35'),_0x716a('0x22'),_0x19da6a,_0x716a('0x3b'),_0x716a('0x36')],squel[_0x716a('0x37')]()[_0x716a('0x38')](_0x716a('0x1c'),_0x716a('0x1c'))[_0x716a('0x38')](_0x716a('0x39'),'scheduledAt')[_0x716a('0x38')]('id',_0x716a('0x35'))[_0x716a('0x38')](LISTID[_0x716a('0x3a')](),_0x716a('0x22'))[_0x716a('0x38')](_0x5e52f8['id'][_0x716a('0x3a')](),_0x19da6a)[_0x716a('0x38')]('NOW()','createdAt')[_0x716a('0x38')](_0x716a('0x39'),'updatedAt')['from']('cm_contacts')['where'](_0x716a('0x3f'))[_0x716a('0x3e')](_0x716a('0x40'),LISTID[_0x716a('0x3a')]())[_0x716a('0x3e')](_0x716a('0x45'),squel[_0x716a('0x44')](hopperContacts))[_0x716a('0x3e')](_0x716a('0x41')))['toString']();return _0x1ca6dc;}function _0x24644f(_0x174140,_0x5c686f){var _0x5d3aad=squel[_0x716a('0x30')]()[_0x716a('0x31')](_0x716a('0x46'))['fromQuery']([_0x716a('0x1c'),'ContactId',_0x716a('0x22'),_0x5c686f,'createdAt',_0x716a('0x36')],squel['select']()[_0x716a('0x38')](_0x716a('0x1c'),_0x716a('0x1c'))[_0x716a('0x38')]('id',_0x716a('0x35'))[_0x716a('0x38')](LISTID[_0x716a('0x3a')](),_0x716a('0x22'))[_0x716a('0x38')](_0x174140['id']['toString'](),_0x5c686f)[_0x716a('0x38')](_0x716a('0x39'),_0x716a('0x3b'))[_0x716a('0x38')](_0x716a('0x39'),_0x716a('0x36'))[_0x716a('0x3c')](_0x716a('0x3d'))[_0x716a('0x3e')](_0x716a('0x3f'))[_0x716a('0x3e')](_0x716a('0x40'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x716a('0x44')](hopperContacts))['where'](_0x716a('0x41')))[_0x716a('0x3a')]();return _0x5d3aad;}return db['VoiceQueue'][_0x716a('0x47')]({'where':{'type':_0x716a('0x48')},'attributes':['id',_0x716a('0x49')],'include':[{'model':db[_0x716a('0x4a')],'as':_0x716a('0x4b'),'where':{'id':LISTID}}]})[_0x716a('0x28')](function(_0x1c7f12){var _0x428cab=[];if(_0x1c7f12){var _0xa5d39;for(var _0x5cc3fa=0x0,_0x12b00c;_0x5cc3fa<_0x1c7f12[_0x716a('0x16')];_0x5cc3fa+=0x1){_0x12b00c=_0x1c7f12[_0x5cc3fa]['get']({'plain':!![]});switch(_0x12b00c['dialCheckDuplicateType']){case _0x716a('0x4c'):_0x428cab[_0x716a('0x29')](db['sequelize'][_0x716a('0x4d')](_0x5858bc(_0x12b00c,_0x716a('0x4e')))['then'](function(){})[_0x716a('0x2b')](_0x2abeb0()));break;case _0x716a('0x4f'):_0x428cab['push'](db['sequelize'][_0x716a('0x4d')](_0x4743b8(_0x12b00c,_0x716a('0x4e')))[_0x716a('0x28')](function(){})['catch'](_0x2abeb0()));break;default:_0x428cab[_0x716a('0x29')](db[_0x716a('0x50')][_0x716a('0x4d')](_0x3ae2ba(_0x12b00c,_0x716a('0x4e')))[_0x716a('0x28')](function(){})[_0x716a('0x2b')](_0x2abeb0()));}}}return _0x428cab;})[_0x716a('0x51')]()[_0x716a('0x28')](function(){return db['VoiceQueue'][_0x716a('0x47')]({'where':{'type':_0x716a('0x48')},'attributes':['id'],'include':[{'model':db[_0x716a('0x4a')],'as':_0x716a('0x52'),'where':{'id':LISTID}}]})[_0x716a('0x28')](function(_0x125a9f){var _0x400d7c=[];if(_0x125a9f){var _0x65cea0;for(var _0x1fcda6=0x0,_0xbdf5ad;_0x1fcda6<_0x125a9f[_0x716a('0x16')];_0x1fcda6+=0x1){_0xbdf5ad=_0x125a9f[_0x1fcda6][_0x716a('0x53')]({'plain':!![]});_0x400d7c[_0x716a('0x29')](db[_0x716a('0x50')]['query'](_0x24644f(_0xbdf5ad,_0x716a('0x4e')))[_0x716a('0x28')](function(){})[_0x716a('0x2b')](_0x2abeb0()));}}return _0x400d7c;})[_0x716a('0x51')]();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x716a('0x4a')],'as':_0x716a('0x4b'),'where':{'id':LISTID}}]})[_0x716a('0x28')](function(_0x7a01e7){var _0x228398=[];if(_0x7a01e7){for(var _0x8f5d38=0x0,_0x8e4d63;_0x8f5d38<_0x7a01e7['length'];_0x8f5d38+=0x1){_0x8e4d63=_0x7a01e7[_0x8f5d38][_0x716a('0x53')]({'plain':!![]});switch(_0x8e4d63['dialCheckDuplicateType']){case _0x716a('0x4c'):_0x228398[_0x716a('0x29')](db['sequelize']['query'](_0x5858bc(_0x8e4d63,_0x716a('0x54')))[_0x716a('0x28')](function(){})['catch'](_0x2abeb0()));break;case _0x716a('0x4f'):_0x228398[_0x716a('0x29')](db['sequelize'][_0x716a('0x4d')](_0x4743b8(_0x8e4d63,'CampaignId'))[_0x716a('0x28')](function(){})['catch'](_0x2abeb0()));break;default:_0x228398['push'](db['sequelize'][_0x716a('0x4d')](_0x3ae2ba(_0x8e4d63,_0x716a('0x54')))[_0x716a('0x28')](function(){})[_0x716a('0x2b')](_0x2abeb0()));}}}return _0x228398;})[_0x716a('0x51')]();})[_0x716a('0x28')](function(){return db[_0x716a('0x55')][_0x716a('0x47')]({'attributes':['id'],'include':[{'model':db[_0x716a('0x4a')],'as':_0x716a('0x52'),'where':{'id':LISTID}}]})[_0x716a('0x28')](function(_0x1cafdf){var _0xe8c0ea=[];if(_0x1cafdf){for(var _0x4bfc01=0x0,_0x2f7aed;_0x4bfc01<_0x1cafdf['length'];_0x4bfc01+=0x1){_0x2f7aed=_0x1cafdf[_0x4bfc01]['get']({'plain':!![]});_0xe8c0ea[_0x716a('0x29')](db[_0x716a('0x50')][_0x716a('0x4d')](_0x24644f(_0x2f7aed,'CampaignId'))['then'](function(){})[_0x716a('0x2b')](_0x2abeb0()));}}return _0xe8c0ea;})[_0x716a('0x51')]();})[_0x716a('0x2b')](function(_0x2b8a11){logger['error'](_0x716a('0x56'),_0x716a('0x57'),_0x2b8a11['message']);});}var processPromises=function(_0x450079){return BPromise[_0x716a('0x51')](promises)[_0x716a('0x28')](function(_0x3ff33c){})['catch'](function(_0x44c22f){logger['error'](_0x716a('0x58'),JSON['stringify'](_0x44c22f));})['finally'](function(){socket[_0x716a('0x59')](_0x716a('0x5a')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x450079){return _0x450079[_0x716a('0x5b')]();}});};var endCsv=function(){return BPromise[_0x716a('0x5c')]()[_0x716a('0x28')](function(){if(hopperContacts){return checkHopper();}})[_0x716a('0x28')](function(){socket[_0x716a('0x59')](_0x716a('0x5a')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x716a('0x5d')](FILEPATH);}catch(_0x201511){logger[_0x716a('0xf')](_0x716a('0x5e'),JSON['stringify'](_0x201511));}finally{process['exit'](0x0);}});};process['on'](_0x716a('0x5f'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x716a('0x5c')]()[_0x716a('0x28')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x716a('0x60')][_0x716a('0x47')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x1ba5cc){var _0x4e01f1=fs[_0x716a('0x61')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x716a('0x62')](_0x4e01f1,{'header':!![],'skipEmptyLines':!![],'step':function(_0xf0cc71,_0x1afd77){total+=0x1;var _0x4a8d4b=total;promises[_0x716a('0x29')](checkRow(_0xf0cc71,_0x1ba5cc,_0x4a8d4b)[_0x716a('0x28')](function(){success+=0x1;})[_0x716a('0x2b')](function(_0x17511f){if(_0x17511f[_0x716a('0xf')]){errors+=0x1;delete _0x17511f[_0x716a('0xf')];}else if(_0x17511f[_0x716a('0x24')]){duplicates+=0x1;delete _0x17511f['duplicate'];}rows[_0x716a('0x29')](_0x17511f);}));if(total%0xc8===0x0){_0x1afd77['pause']();return processPromises(_0x1afd77);}},'complete':function(){return processPromises()['then'](function(){logger[_0x716a('0x63')](_0x716a('0x64'));endCsv();});},'error':function(_0x14d662,_0xba077d){logger['info']('CSV\x20parse\x20error',JSON[_0x716a('0x65')](_0x14d662));endCsv();}});})['catch'](function(_0x387fd7){logger['error'](_0x716a('0x66'),JSON[_0x716a('0x65')](_0x387fd7));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index fca08b0..b338b58 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 _0x3fb6=['email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','isValid','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','hasOwnProperty','itemTypeId','description','SystemRow','appendFileSync','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','contactId','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns','CampaignId','campaigns_has_cm_blacklists','DROP\x20TABLE\x20','finish','emit','contact:import:','unlink','exit','complete','argv','existsSync','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','CmContact','findAll','AdditionalPhones','then','push','all','split','length','CmContactHasItem','update','updated','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.priority','insert','into','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','priority','select','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','ContactId','ListId','fields','.CmListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','cm_contacts.UserId','UserId','recallme','cm_contacts.createdAt\x20=\x20?','ListId\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','concat','CompanyId','scheduledAt',')\x20NOT\x20IN\x20?','id\x20IN\x20?','min_id','info','Received\x20SIGINT','error','message','sequelize','query','spread','campaigns.id','campaigns.dialTimezone','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues','voice_queues_has_cm_lists','voice_queues_has_cm_lists.CmListId=','timezones','dialTimezone','isNil','utcOffset','set','offset','catch','main','start','clone','root','server/files/tmp','keys','includes','ContactItemType','name','_description','writeFileSync','parse','createReadStream','rows','errors','data','find','trim','replace','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email'];(function(_0x2bc5cc,_0x3eff94){var _0xe3f6d2=function(_0x8313b2){while(--_0x8313b2){_0x2bc5cc['push'](_0x2bc5cc['shift']());}};_0xe3f6d2(++_0x3eff94);}(_0x3fb6,0x19d));var _0x63fb=function(_0x49e34b,_0x44fee9){_0x49e34b=_0x49e34b-0x0;var _0x2d8930=_0x3fb6[_0x49e34b];return _0x2d8930;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x63fb('0x0'));var Papa=require(_0x63fb('0x1'));var util=require(_0x63fb('0x2'));var BPromise=require(_0x63fb('0x3'));var moment=require(_0x63fb('0x4'));var squel=require(_0x63fb('0x5'));var Redis=require(_0x63fb('0x6'));var db=require(_0x63fb('0x7'))['db'];var config=require(_0x63fb('0x8'));var shared=require(_0x63fb('0x9'));var logger=require(_0x63fb('0xa'))('import');config[_0x63fb('0xb')]=_[_0x63fb('0xc')](config[_0x63fb('0xb')],{'host':_0x63fb('0xd'),'port':0x18eb});var socket=require(_0x63fb('0xe'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x63fb('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x63fb('0xf')](_0x63fb('0x10'));function isEmail(_0x5ab29f){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))*$/[_0x63fb('0x11')](_0x5ab29f);}function selectNotIn(_0x3da3b5,_0x1590d5,_0x2d4b34,_0x2bd19d,_0x467da2){return squel['select']()[_0x63fb('0x12')](_0x63fb('0x13'))[_0x63fb('0x14')](_0x2bd19d)[_0x63fb('0x15')](_0x1590d5,null,_0x1590d5+_0x63fb('0x16')+_0x2bd19d+'.'+_0x2d4b34)[_0x63fb('0x17')](_0x2bd19d+'.'+_0x2d4b34+_0x63fb('0x18')+_0x3da3b5+'.'+_0x2d4b34)[_0x63fb('0x17')](_0x1590d5+_0x63fb('0x19')+_0x467da2[_0x63fb('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x1b3bea,_0x197fd9){promisesAdditionalPhones=[];return db[_0x63fb('0x1a')][_0x63fb('0x1b')]({'raw':!![],'attributes':['id',_0x63fb('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x63fb('0x1d')](function(_0x2ded8d){if(_0x2ded8d!==null){var _0x33dd64=[];for(var _0x36cd50=0x0;_0x36cd50<_0x2ded8d['length'];_0x36cd50++){var _0x614ecf=_0x2ded8d[_0x36cd50];_0x33dd64[_0x63fb('0x1e')](insertAdditionalPhones(_0x614ecf));}}Promise[_0x63fb('0x1f')](_0x33dd64)[_0x63fb('0x1d')](function(){_0x1b3bea({'val':0x1});});});});}function insertAdditionalPhones(_0x11f0df){return new Promise(function(_0x1eecb9,_0x4beb24){var _0x225be5=_0x11f0df['AdditionalPhones'];var _0x5675a6=_0x225be5[_0x63fb('0x20')](';');var _0xa21468=[];orderBy=0x0;for(var _0x47a3e2=0x0;_0x47a3e2<_0x5675a6[_0x63fb('0x21')];_0x47a3e2++){_0xa21468[_0x63fb('0x1e')](splitAdditionalPhone(_0x11f0df['id'],_0x5675a6[_0x47a3e2]));}Promise[_0x63fb('0x1f')](_0xa21468)[_0x63fb('0x1d')](function(){_0x1eecb9({'val':_0x5675a6['length']});});});}function splitAdditionalPhone(_0x5c35cc,_0x52f898){return new Promise(function(_0x27e561,_0x2f15dd){var _0x3432d9=_0x52f898[_0x63fb('0x20')](':');var _0x3c47b5=_0x3432d9[0x0];var _0x380ce4=_0x3432d9[0x1];if(!_['isNil'](_0x380ce4)){var _0x4735b1=_0x380ce4[_0x63fb('0x20')]('|');var _0x35bfef=[];for(var _0x596b7a=0x0;_0x596b7a<_0x4735b1['length'];_0x596b7a++){if(_0x4735b1[_0x596b7a]!==''){var _0xda32d8=_['filter'](promisesAdditionalPhones,{'contactId':_0x5c35cc,'phone':_0x4735b1[_0x596b7a]});if(_0xda32d8[_0x63fb('0x21')]==0x0){orderBy++;promisesAdditionalPhones[_0x63fb('0x1e')]({'contactId':_0x5c35cc,'contactTypeId':_0x3c47b5,'phone':_0x4735b1[_0x596b7a],'orderBy':orderBy});}}}_0x27e561({'ok':0x1});}else _0x27e561({'res':0x0});});}function createAdditionalPhone(_0x13681f,_0x3b6a96,_0x30c75b,_0x768c6e){var _0x18e17f='';var _0x57523a='';var _0x2be778=_0x30c75b[_0x63fb('0x20')]('§');_0x18e17f=_0x2be778[0x0];if(_0x2be778[_0x63fb('0x21')]==0x2)_0x57523a=_0x2be778[0x1];return new Promise(function(_0x58b331,_0x305d51){return db[_0x63fb('0x22')]['findOne']({'where':{'CmContactId':_0x13681f,'item':_0x18e17f}})['then'](function(_0x7d1ccc){if(_0x7d1ccc){return db[_0x63fb('0x22')][_0x63fb('0x23')]({'ItemTypeId':_0x3b6a96,'description':_0x57523a,'OrderBy':_0x768c6e},{'where':{'CmContactId':_0x13681f,'item':_0x18e17f}})[_0x63fb('0x1d')](function(_0x871e73){_0x58b331({'res':_0x63fb('0x24')});});}else{return db[_0x63fb('0x22')]['create']({'CmContactId':_0x13681f,'item':_0x18e17f,'description':_0x57523a,'ItemTypeId':_0x3b6a96,'OrderBy':_0x768c6e,'ItemClass':_0x63fb('0x25')})['then'](function(_0x3f77ab){_0x58b331({'res':_0x63fb('0x26')});});}});});}function insertCmHopper(_0x1c52e7,_0x291721,_0x471c2d,_0x436571,_0x175d28){var _0x7f7057=[_0x63fb('0x27'),_0x63fb('0x28'),'cm_contacts.id','cm_contacts.ListId',_0x291721+'.'+_0x436571,_0x63fb('0x29'),'cm_contacts.updatedAt',_0x63fb('0x2a'),'cm_contacts.UserId','\x22'+_0x175d28+'\x22'];return squel[_0x63fb('0x2b')]()[_0x63fb('0x2c')](_0x63fb('0x2d'))[_0x63fb('0x2e')](['phone',_0x63fb('0x2f'),'ContactId','ListId',_0x436571,_0x63fb('0x30'),_0x63fb('0x31'),_0x63fb('0x32'),'UserId','recallme'],squel[_0x63fb('0x33')]()['fields'](_0x7f7057)[_0x63fb('0x14')](_0x291721)[_0x63fb('0x15')](_0x63fb('0x34'),null,_0x63fb('0x35')+_0x291721+_0x63fb('0x36'))[_0x63fb('0x15')](_0x471c2d,null,_0x471c2d+_0x63fb('0x16')+_0x291721+'.'+_0x436571)[_0x63fb('0x17')](_0x291721+'.CmListId\x20=\x20?',_0x1c52e7)[_0x63fb('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x63fb('0x17')](_0x63fb('0x37'),selectNotIn(_0x291721,_0x471c2d,_0x436571,_0x63fb('0x2d'),[_0x63fb('0x38'),_0x63fb('0x39')]))[_0x63fb('0x17')](_0x63fb('0x37'),selectNotIn(_0x291721,_0x471c2d,_0x436571,_0x63fb('0x2d'),[_0x63fb('0x38')])))[_0x63fb('0x3a')]();}function insertCmHopperBlack(_0x1b594a,_0x2428ae,_0x18c98b,_0xa38689){var _0x170f5a=[_0x63fb('0x27'),_0x63fb('0x3b'),_0x63fb('0x3c'),_0x2428ae+'.'+_0xa38689,_0x63fb('0x29'),_0x63fb('0x3d')];return squel['insert']()['into'](_0x63fb('0x3e'))['fromQuery']([_0x63fb('0x13'),_0x63fb('0x3f'),_0x63fb('0x40'),_0xa38689,'createdAt',_0x63fb('0x31')],squel[_0x63fb('0x33')]()[_0x63fb('0x41')](_0x170f5a)['from'](_0x2428ae)[_0x63fb('0x15')]('cm_contacts',null,_0x63fb('0x35')+_0x2428ae+_0x63fb('0x36'))[_0x63fb('0x15')](_0x18c98b,null,_0x18c98b+_0x63fb('0x16')+_0x2428ae+'.'+_0xa38689)[_0x63fb('0x17')](_0x2428ae+_0x63fb('0x42'),_0x1b594a)[_0x63fb('0x17')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x63fb('0x17')](_0x63fb('0x37'),squel[_0x63fb('0x33')]()[_0x63fb('0x12')]('phone')[_0x63fb('0x14')]('cm_hopper_black')[_0x63fb('0x17')]('ListId\x20=\x20?',_0x1b594a)[_0x63fb('0x17')](_0xa38689+_0x63fb('0x18')+_0x2428ae+'.'+_0xa38689)))[_0x63fb('0x3a')]();}function insertTzCmHopper(_0x2f3926,_0x3527d9,_0x5012df,_0x5369e5,_0x5e8fb3,_0x299c4d){var _0x4bd20b=['cm_contacts.phone',_0x63fb('0x43')+_0x299c4d+'.offset-cm_contacts.utcOffset\x20minute)',_0x63fb('0x3b'),_0x63fb('0x3c'),_0x3527d9+'.'+_0x5369e5,'cm_contacts.createdAt',_0x63fb('0x3d'),_0x63fb('0x2a'),_0x63fb('0x44'),'\x22'+_0x5e8fb3+'\x22'];var _0x61ce60=squel[_0x63fb('0x2b')]()[_0x63fb('0x2c')](_0x63fb('0x2d'))[_0x63fb('0x2e')]([_0x63fb('0x13'),'scheduledat',_0x63fb('0x3f'),_0x63fb('0x40'),_0x5369e5,'createdAt',_0x63fb('0x31'),_0x63fb('0x32'),_0x63fb('0x45'),_0x63fb('0x46')],squel[_0x63fb('0x33')]()[_0x63fb('0x41')](_0x4bd20b)[_0x63fb('0x14')](_0x3527d9)[_0x63fb('0x15')](_0x63fb('0x34'),null,_0x63fb('0x35')+_0x3527d9+_0x63fb('0x36'))['join'](_0x5012df,null,_0x5012df+_0x63fb('0x16')+_0x3527d9+'.'+_0x5369e5)['join'](_0x299c4d,null,_0x299c4d+_0x63fb('0x16')+_0x3527d9+'.'+_0x5369e5)[_0x63fb('0x17')](_0x3527d9+_0x63fb('0x42'),_0x2f3926)[_0x63fb('0x17')](_0x63fb('0x47'),NOW)['where'](_0x63fb('0x37'),selectNotIn(_0x3527d9,_0x5012df,_0x5369e5,_0x63fb('0x2d'),[_0x63fb('0x38'),_0x63fb('0x39')]))[_0x63fb('0x17')](_0x63fb('0x37'),selectNotIn(_0x3527d9,_0x5012df,_0x5369e5,_0x63fb('0x2d'),['\x22always\x22'])))[_0x63fb('0x3a')]();return _0x61ce60;}function insertTzCmHopperBlack(_0x1097a7,_0x11c8f5,_0x293932,_0x10d1f0){var _0x15a63e=[_0x63fb('0x27'),_0x63fb('0x3b'),_0x63fb('0x3c'),_0x11c8f5+'.'+_0x10d1f0,_0x63fb('0x29'),'cm_contacts.updatedAt'];return squel[_0x63fb('0x2b')]()[_0x63fb('0x2c')](_0x63fb('0x3e'))[_0x63fb('0x2e')]([_0x63fb('0x13'),_0x63fb('0x3f'),_0x63fb('0x40'),_0x10d1f0,_0x63fb('0x30'),_0x63fb('0x31')],squel[_0x63fb('0x33')]()[_0x63fb('0x41')](_0x15a63e)[_0x63fb('0x14')](_0x11c8f5)[_0x63fb('0x15')](_0x63fb('0x34'),null,_0x63fb('0x35')+_0x11c8f5+_0x63fb('0x36'))[_0x63fb('0x15')](_0x293932,null,_0x293932+_0x63fb('0x16')+_0x11c8f5+'.'+_0x10d1f0)['where'](_0x11c8f5+_0x63fb('0x42'),_0x1097a7)[_0x63fb('0x17')](_0x63fb('0x47'),NOW)[_0x63fb('0x17')](_0x63fb('0x37'),squel[_0x63fb('0x33')]()[_0x63fb('0x12')]('phone')[_0x63fb('0x14')](_0x63fb('0x3e'))[_0x63fb('0x17')](_0x63fb('0x48'),_0x1097a7)['where'](_0x10d1f0+_0x63fb('0x18')+_0x11c8f5+'.'+_0x10d1f0)))[_0x63fb('0x3a')]();}function insertCmHopperAdditionalPhones(_0x3bd930){var _0x1645d6=['cm_hopper.id',_0x63fb('0x49'),_0x63fb('0x4a'),_0x63fb('0x4b'),_0x63fb('0x4c')];return squel[_0x63fb('0x2b')]()[_0x63fb('0x2c')](_0x63fb('0x4d'))[_0x63fb('0x2e')]([_0x63fb('0x4e'),_0x63fb('0x13'),_0x63fb('0x4f'),_0x63fb('0x30'),_0x63fb('0x31')],squel['select']()[_0x63fb('0x41')](_0x1645d6)[_0x63fb('0x14')](_0x63fb('0x2d'))[_0x63fb('0x15')](_0x63fb('0x34'),null,_0x63fb('0x50'))[_0x63fb('0x15')](_0x63fb('0x51'),null,_0x63fb('0x52'))[_0x63fb('0x17')](_0x63fb('0x53'),_0x3bd930)['where'](_0x63fb('0x47'),NOW))['toString']();}function insertCmContact(_0x577b50,_0x426db6,_0x3bdf25,_0x2f67aa){var _0x5b8898=_[_0x63fb('0x54')](_['keys'](_0x2f67aa),['ListId',_0x63fb('0x55'),_0x63fb('0x30'),_0x63fb('0x31'),_0x63fb('0x56')]);return squel[_0x63fb('0x2b')]()[_0x63fb('0x2c')]('cm_contacts')[_0x63fb('0x2e')](_0x5b8898,squel['select']()[_0x63fb('0x41')](_0x5b8898)[_0x63fb('0x14')](_0x426db6)['where']('('+_0x3bdf25['join'](',')+_0x63fb('0x57'),squel['select']()['fields'](_0x3bdf25)[_0x63fb('0x14')]('cm_contacts')[_0x63fb('0x17')]('ListId\x20=\x20?',_0x577b50)[_0x63fb('0x17')]('deletedAt\x20IS\x20NULL'))[_0x63fb('0x17')](_0x63fb('0x58'),squel[_0x63fb('0x33')]()[_0x63fb('0x12')]('MIN(id)',_0x63fb('0x59'))[_0x63fb('0x14')](_0x426db6)['group'](_0x3bdf25['join'](','))))['toString']();}function handleStop(){logger[_0x63fb('0x5a')](_0x63fb('0x5b'));stopped=!![];}function handleUncaughtException(_0x25ff25){logger[_0x63fb('0x5c')](_0x25ff25['message']);process['exit'](0x1);}function handleError(_0x178e5e,_0x19dfd5){stats['errors'][_0x63fb('0x1e')]({'name':_0x19dfd5['code'],'message':_0x19dfd5[_0x63fb('0x5d')],'row':_0x178e5e});}function handleQuery(_0x265433){logger['info'](_0x265433);return db[_0x63fb('0x5e')][_0x63fb('0x5f')](_0x265433)[_0x63fb('0x60')](function(_0x1ef68){results[_0x63fb('0x1e')](_0x1ef68);})['catch'](function(_0x5627b6){logger['error'](_0x5627b6['message']);});}function updateTzCampaigns(_0x4bf655){return new Promise(function(_0x1da727,_0x35d221){var _0x34292f=squel[_0x63fb('0x33')]()[_0x63fb('0x41')]([_0x63fb('0x61'),_0x63fb('0x62')])[_0x63fb('0x14')]('campaigns')[_0x63fb('0x15')](_0x63fb('0x63'),null,_0x63fb('0x64'))[_0x63fb('0x17')](_0x63fb('0x65')+_0x4bf655);db[_0x63fb('0x5e')]['query'](_0x34292f['toString']())['spread'](function(_0x8fad39){var _0x294212=[];for(var _0x12238b=0x0;_0x12238b<_0x8fad39['length'];_0x12238b++){_0x294212[_0x63fb('0x1e')](getTimezoneData(_0x8fad39[_0x12238b],tmp_campaigns));}BPromise[_0x63fb('0x1f')](_0x294212)[_0x63fb('0x1d')](function(){_0x1da727({'val':0x1});});})['catch'](function(_0x4d8bbe){logger[_0x63fb('0x5c')](_0x4d8bbe[_0x63fb('0x5d')]);_0x1da727({'val':0x0});});});}function updateTzVoiceQueues(_0x127a77){return new Promise(function(_0x40f9ad,_0x2a06a5){var _0x5b10f3=squel[_0x63fb('0x33')]()[_0x63fb('0x41')]([_0x63fb('0x66'),'voice_queues.dialTimezone'])['from'](_0x63fb('0x67'))[_0x63fb('0x15')](_0x63fb('0x68'),null,'voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId')['where'](_0x63fb('0x69')+_0x127a77);db[_0x63fb('0x5e')][_0x63fb('0x5f')](_0x5b10f3[_0x63fb('0x3a')]())['spread'](function(_0x5155fc){var _0x447e26=[];for(var _0x545806=0x0;_0x545806<_0x5155fc[_0x63fb('0x21')];_0x545806++){_0x447e26[_0x63fb('0x1e')](getTimezoneData(_0x5155fc[_0x545806],tmp_voice_queues));}BPromise[_0x63fb('0x1f')](_0x447e26)[_0x63fb('0x1d')](function(){_0x40f9ad({'val':0x1});});})['catch'](function(_0x54ee1d){logger[_0x63fb('0x5c')](_0x54ee1d['message']);_0x40f9ad({'val':0x0});});});}function getTimezoneData(_0x14ecb2,_0x3b1617){return new Promise(function(_0x29c78b,_0x477ed5){var _0x3afa53=shared[_0x63fb('0x6a')];var _0x10e89e=_0x3afa53[_0x14ecb2[_0x63fb('0x6b')]];if(_[_0x63fb('0x6c')](_0x10e89e)){_0x29c78b({'ret':0x1});}else{var _0x2ed398=_0x10e89e[_0x63fb('0x6d')];var _0x101b15=squel[_0x63fb('0x2b')]()[_0x63fb('0x2c')](_0x3b1617)[_0x63fb('0x6e')]('id',_0x14ecb2['id'])[_0x63fb('0x6e')](_0x63fb('0x6f'),_0x2ed398)[_0x63fb('0x6e')](_0x63fb('0x6b'),_0x14ecb2[_0x63fb('0x6b')])[_0x63fb('0x3a')]();return db[_0x63fb('0x5e')][_0x63fb('0x5f')](_0x101b15)[_0x63fb('0x60')](function(_0x50ef09){_0x29c78b({'ret':0x1});})[_0x63fb('0x70')](function(_0xba543c){logger[_0x63fb('0x5c')](_0xba543c['message']);_0x477ed5({'ret':0x1});});}});}function handleTZQuery(_0x3109c3){logger[_0x63fb('0x5a')](_0x3109c3);return db[_0x63fb('0x5e')][_0x63fb('0x5f')](_0x3109c3)[_0x63fb('0x60')](function(_0x3f5522){})[_0x63fb('0x70')](function(_0x27f0bd){logger[_0x63fb('0x5c')](_0x27f0bd[_0x63fb('0x5d')]);});}function main(_0x572899,_0x2abb6b,_0xe76d8a,_0x23dccd){logger['info'](_0x63fb('0x71'),_0x572899,JSON['stringify'](_0x2abb6b));process['send'](_0x63fb('0x72'));var _0x531267=_0x2abb6b['binding'];var _0x5699ec=_[_0x63fb('0x73')](_0x531267);var _0x827af6=_0x2abb6b['socket_timestamp'];var _0x3eea4d=path[_0x63fb('0x15')](config[_0x63fb('0x74')],_0x63fb('0x75'),_0x827af6+'.csv');hasTZ=_[_0x63fb('0x76')](_0x531267)[_0x63fb('0x77')](_0x63fb('0x6b'));var _0x156728=_[_0x63fb('0x76')](_0x531267)[_0x63fb('0x15')]();logger['info']('header',_0x156728);db[_0x63fb('0x78')][_0x63fb('0x1b')]({'raw':!![],'attributes':['id',_0x63fb('0x79')]})[_0x63fb('0x1d')](function(_0xfd8f9b){for(var _0x4694a7=0x0;_0x4694a7<_0xfd8f9b[_0x63fb('0x21')];_0x4694a7++){if(_0xfd8f9b[_0x4694a7][_0x63fb('0x79')]in _0x531267){contactItemTypes[_0x63fb('0x1e')](_0xfd8f9b[_0x4694a7]);delete _0x5699ec[_0xfd8f9b[_0x4694a7][_0x63fb('0x79')]];hasAdditionalPhones=!![];}for(var _0x1400c8 in _0x531267){if(_0xfd8f9b[_0x4694a7][_0x63fb('0x79')]+_0x63fb('0x7a')===_0x1400c8){phoneDescriptions[_0x63fb('0x1e')]({'itemTypeId':_0xfd8f9b[_0x4694a7]['id'],'description':_0x1400c8});delete _0x5699ec[_0x1400c8];}}}if(hasAdditionalPhones)_0x5699ec['AdditionalPhones']='';var _0xb25692=_[_0x63fb('0x76')](_0x5699ec)['join']();logger[_0x63fb('0x5a')]('header',_0xb25692);fs[_0x63fb('0x7b')](_0x3eea4d,_0xb25692+'\x0a');Papa[_0x63fb('0x7c')](fs[_0x63fb('0x7d')](_0x572899),{'header':!![],'skipEmptyLines':!![],'step':function(_0x168b55,_0x155a51){try{for(var _0x7960b8=0x0,_0x1388ed=[];_0x7960b8<_0x168b55['data'][_0x63fb('0x21')];_0x7960b8++){stats[_0x63fb('0x7e')]+=0x1;if(_0x168b55[_0x63fb('0x7f')][_0x7960b8]){handleError(_0x168b55[_0x63fb('0x80')][_0x7960b8],_0x168b55['errors'][_0x7960b8]);}else{var _0xe0e117=[];var _0x3f3acd=[];var _0x47daef={};for(var _0x3838f6 in _0x531267){let _0x1a7597=contactItemTypes[_0x63fb('0x81')](_0x36d331=>_0x36d331[_0x63fb('0x79')]===_0x3838f6);let _0x5266d5=contactItemTypes[_0x63fb('0x81')](_0x39ab2a=>_0x39ab2a['name']+'_description'===_0x3838f6);if(_['isNil'](_0x1a7597)&&_[_0x63fb('0x6c')](_0x5266d5)){if(_0x531267['hasOwnProperty'](_0x3838f6)){if(_0x168b55['data'][_0x7960b8][_0x531267[_0x3838f6]]){var _0x5f3e63=_[_0x63fb('0x82')](_0x168b55[_0x63fb('0x80')][_0x7960b8][_0x531267[_0x3838f6]][_0x63fb('0x83')](/"/g,'\x27'));switch(_0x3838f6){case _0x63fb('0x2f'):var _0x1328db=moment(_0x5f3e63,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x1328db['isValid']()){_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x5f3e63+'\x22');}else{_0xe0e117['push'](_0x63fb('0x84'));}break;case _0x63fb('0x32'):var _0x519701=parseInt(_0x5f3e63);_0x5f3e63=_['isNaN'](_0x519701)||_0x519701<0x0||_0x519701>0x4?_0x23dccd?0x3:0x2:_0x519701;_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x5f3e63+'\x22');break;case _0x63fb('0x45'):var _0x45b581=parseInt(_0x5f3e63);if(_[_0x63fb('0x85')](_0x45b581)&&_[_0x63fb('0x77')](_0xe76d8a,_0x45b581)){_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x45b581+'\x22');}else{_0xe0e117[_0x63fb('0x1e')](_0x63fb('0x86'));}break;case _0x63fb('0x87'):if(isEmail(_0x5f3e63)){_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x5f3e63+'\x22');}else{_0xe0e117[_0x63fb('0x1e')](_0x63fb('0x88'));}break;case _0x63fb('0x89'):var _0x2c9b8e=moment(_0x5f3e63,_0x63fb('0x8a'),!![]);if(_0x2c9b8e[_0x63fb('0x8b')]()){_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x5f3e63+'\x22');}else{_0xe0e117[_0x63fb('0x1e')](_0x63fb('0x8c'));}break;case'dialTimezone':var _0x347696=shared[_0x63fb('0x6a')];var _0x165f10=_0x347696[_0x5f3e63];if(!_[_0x63fb('0x6c')](_0x165f10)){var _0x3a3075=_0x165f10[_0x63fb('0x6d')];_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x5f3e63+'\x22');_0x1388ed['push']('\x22'+_0x3a3075+'\x22');}break;default:_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x5f3e63+'\x22');}}else{switch(_0x3838f6){case _0x63fb('0x8d'):case _0x63fb('0x13'):_0xe0e117[_0x63fb('0x1e')](_0x3838f6+'\x20not\x20specified');break;default:_0x1388ed[_0x63fb('0x1e')]('\x22\x22');}}}}else{var _0x4c956d='';if(!_[_0x63fb('0x6c')](_0x1a7597)){if(!_0x47daef[_0x63fb('0x8e')](_0x1a7597['id'])){if(!_[_0x63fb('0x6c')](_0x168b55['data'][_0x7960b8][_0x531267[_0x3838f6]])){var _0x5f3e63=_[_0x63fb('0x82')](_0x168b55['data'][_0x7960b8][_0x531267[_0x3838f6]][_0x63fb('0x83')](/"/g,'\x27'));var _0x282788=phoneDescriptions[_0x63fb('0x81')](_0xf9eef9=>_0xf9eef9[_0x63fb('0x8f')]===_0x1a7597['id']);if(!_['isNil'](_0x282788)){var _0x1a22a1=_[_0x63fb('0x82')](_0x168b55['data'][_0x7960b8][_0x531267[_0x282788[_0x63fb('0x90')]]][_0x63fb('0x83')](/"/g,'\x27'));if(!_[_0x63fb('0x6c')](_0x1a22a1))_0x5f3e63=_0x5f3e63+'§'+_0x1a22a1;}if(_0x4c956d=='')_0x4c956d=_0x5f3e63;else _0x4c956d+='|'+_0x5f3e63;}_0x3f3acd['push'](_0x1a7597['id']+':'+_0x4c956d);_0x47daef[_0x1a7597['id']]=0x1;}}}}if(hasAdditionalPhones){_0x1388ed[_0x63fb('0x1e')]('\x22'+_0x3f3acd[_0x63fb('0x15')](';')+'\x22');}if(_0xe0e117[_0x63fb('0x21')]){handleError(_0x168b55[_0x63fb('0x80')][_0x7960b8],{'code':_0x63fb('0x91'),'message':_0xe0e117[_0x63fb('0x15')]()});}else{fs[_0x63fb('0x92')](_0x3eea4d,_0x1388ed[_0x63fb('0x15')]()+'\x0a');}_0x1388ed=[];}if(!(stats[_0x63fb('0x7e')]%0xc8)){socket['emit']('contact:import:'+_0x827af6,stats);stats['errors']=[];}}if(stopped){logger[_0x63fb('0x5a')](_0x63fb('0x93'));_0x155a51[_0x63fb('0x94')]();}}catch(_0x42693d){handleError(_0x168b55['data'][_0x7960b8],{'code':_0x63fb('0x95'),'message':_0x42693d['message']});logger[_0x63fb('0x5c')](_0x63fb('0x96'),_0x42693d[_0x63fb('0x5d')]);}},'complete':function(){try{var _0x518fa6=[];var _0x4c5c76=[];var _0x2548e8=_0x63fb('0x34');if(_0x2abb6b[_0x63fb('0x97')]&&_0x2abb6b['duplicates']['length']){_0x2548e8=_0x63fb('0x98')+_0x827af6;_0x518fa6['push'](_0x63fb('0x99')+_0x2548e8+'\x20LIKE\x20cm_contacts;');}tmp_campaigns=_0x63fb('0x9a')+_0x827af6;tmp_voice_queues=_0x63fb('0x9b')+_0x827af6;_0x4c5c76[_0x63fb('0x1e')]('CREATE\x20TABLE\x20'+tmp_campaigns+_0x63fb('0x9c'));_0x4c5c76[_0x63fb('0x1e')](_0x63fb('0x99')+tmp_voice_queues+_0x63fb('0x9c'));BPromise[_0x63fb('0x9d')](_0x4c5c76,handleTZQuery)[_0x63fb('0x1d')](function(_0x4e0cff){updateTzCampaigns(_0x2abb6b[_0x63fb('0x40')])['then'](function(_0x452577){updateTzVoiceQueues(_0x2abb6b[_0x63fb('0x40')])['then'](function(_0x124a10){if(hasTZ)_0xb25692=_0xb25692['replace'](_0x63fb('0x6b'),_0x63fb('0x9e'));var _0xd670d7=util['format'](_0x63fb('0x9f'),_0x3eea4d,_0x2548e8,_0xb25692,_0x2abb6b[_0x63fb('0x40')],_0x2abb6b[_0x63fb('0x55')]||null,NOW,NOW);if(_[_0x63fb('0x6c')](_0x531267[_0x63fb('0x2f')])){_0xd670d7+=',\x20scheduledAt\x20=\x20NOW()';}_0x518fa6[_0x63fb('0x1e')](_0xd670d7);if(_0x2abb6b[_0x63fb('0x97')]&&_0x2abb6b[_0x63fb('0x97')][_0x63fb('0x21')]){_0x518fa6['push'](insertCmContact(_0x2abb6b[_0x63fb('0x40')],_0x2548e8,_0x2abb6b['duplicates'],_0x531267));_0x518fa6[_0x63fb('0x1e')]('DROP\x20TABLE\x20'+_0x2548e8+';');}BPromise[_0x63fb('0x9d')](_0x518fa6,handleQuery)[_0x63fb('0x1d')](function(_0x5924df){BPromise[_0x63fb('0x1f')]([handleAdditionalPhones()])[_0x63fb('0x1d')](function(){_0x518fa6=[];for(var _0xd845d9=0x0;_0xd845d9\x20\x20');}var _0x3d1f4c=path[_0x63fb('0x15')](config[_0x63fb('0x74')],'server/files/tmp',process['argv'][0x2]);if(!fs[_0x63fb('0xae')](_0x3d1f4c)){throw new Error(_0x63fb('0xaf'));}var _0xe16a83={};try{_0xe16a83=JSON[_0x63fb('0x7c')](process[_0x63fb('0xad')][0x3]);if(!_0xe16a83[_0x63fb('0xb0')]){throw new Error(_0x63fb('0xb1'));}if(!_0xe16a83['binding']['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0xe16a83[_0x63fb('0xb0')][_0x63fb('0x8d')]){throw new Error('firstName\x20is\x20mandatory');}var _0x47dea6=0x0;if(_0xe16a83[_0x63fb('0xb0')]['UserId']){_0x47dea6=0x1;}if(!_0xe16a83[_0x63fb('0x40')]){throw new Error(_0x63fb('0xb2'));}}catch(_0x969469){throw new Error(_0x63fb('0xb3'));}var _0x2f2f5b=[];try{_0x2f2f5b=_[_0x63fb('0xb4')](JSON[_0x63fb('0x7c')](process[_0x63fb('0xad')][0x4]),'id');}catch(_0x17e145){logger[_0x63fb('0x5a')](_0x63fb('0xb5'));}main(_0x3d1f4c,_0xe16a83,_0x2f2f5b,_0x47dea6);}validate();process['on']('SIGINT',handleStop);process['on'](_0x63fb('0xb6'),handleUncaughtException); \ No newline at end of file +var _0x9dc1=['cm_contacts','cm_contacts.ListId\x20=\x20','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.id','insert','cm_hopper_black','updatedAt','.CmListId','.CmListId\x20=\x20?','priority','ListId\x20=\x20?','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','keys','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','min_id','group','info','Received\x20SIGINT','error','message','errors','code','query','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','campaigns_has_cm_lists.CmListId=','voice_queues.id','voice_queues','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','dialTimezone','utcOffset','set','offset','sequelize','stringify','start','binding','clone','socket_timestamp','includes','header','name','_description','writeFileSync','parse','createReadStream','data','rows','find','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','timezones','firstName','\x20not\x20specified','hasOwnProperty','trim','itemTypeId','description','SystemRow','appendFileSync','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','affectedRows','unlink','exit','complete','argv','arguments\x20\x20\x20','server/files/tmp','existsSync','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','lodash','papaparse','util','moment','squel','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','.id\x20=\x20','\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','findOne','update','updated','CmContactHasItem','PHONE','inserted','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','into','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','UserId','recallme','fields'];(function(_0x51dfb6,_0x1bb779){var _0x36824a=function(_0x266d8e){while(--_0x266d8e){_0x51dfb6['push'](_0x51dfb6['shift']());}};_0x36824a(++_0x1bb779);}(_0x9dc1,0x1d5));var _0x19dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9dc1[_0x3dd15e];return _0x231fd0;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x19dc('0x0'));var Papa=require(_0x19dc('0x1'));var util=require(_0x19dc('0x2'));var BPromise=require('bluebird');var moment=require(_0x19dc('0x3'));var squel=require(_0x19dc('0x4'));var Redis=require('ioredis');var db=require(_0x19dc('0x5'))['db'];var config=require(_0x19dc('0x6'));var shared=require(_0x19dc('0x7'));var logger=require(_0x19dc('0x8'))('import');config['redis']=_[_0x19dc('0x9')](config[_0x19dc('0xa')],{'host':_0x19dc('0xb'),'port':0x18eb});var socket=require(_0x19dc('0xc'))(new Redis(config[_0x19dc('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x19dc('0xd')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()[_0x19dc('0xd')](_0x19dc('0xe'));function isEmail(_0x43f11e){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))*$/[_0x19dc('0xf')](_0x43f11e);}function selectNotIn(_0x383d27,_0x5dcaa1,_0x469930,_0xe08734,_0x10536d){return squel[_0x19dc('0x10')]()[_0x19dc('0x11')]('phone')[_0x19dc('0x12')](_0xe08734)[_0x19dc('0x13')](_0x5dcaa1,null,_0x5dcaa1+_0x19dc('0x14')+_0xe08734+'.'+_0x469930)['where'](_0xe08734+'.'+_0x469930+_0x19dc('0x15')+_0x383d27+'.'+_0x469930)[_0x19dc('0x16')](_0x5dcaa1+_0x19dc('0x17')+_0x10536d['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x505e5c,_0xba8fe7){promisesAdditionalPhones=[];return db['CmContact'][_0x19dc('0x18')]({'raw':!![],'attributes':['id',_0x19dc('0x19')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x19dc('0x1a')](function(_0x3109c7){if(_0x3109c7!==null){var _0xb5dea5=[];for(var _0x1237c1=0x0;_0x1237c1<_0x3109c7[_0x19dc('0x1b')];_0x1237c1++){var _0x59cc3c=_0x3109c7[_0x1237c1];_0xb5dea5[_0x19dc('0x1c')](insertAdditionalPhones(_0x59cc3c));}}Promise[_0x19dc('0x1d')](_0xb5dea5)[_0x19dc('0x1a')](function(){_0x505e5c({'val':0x1});});});});}function insertAdditionalPhones(_0x1c41e0){return new Promise(function(_0x532886,_0xa7453a){var _0xc7fcf6=_0x1c41e0[_0x19dc('0x19')];var _0x5885c6=_0xc7fcf6[_0x19dc('0x1e')](';');var _0x26ded3=[];orderBy=0x0;for(var _0x23c13e=0x0;_0x23c13e<_0x5885c6[_0x19dc('0x1b')];_0x23c13e++){_0x26ded3[_0x19dc('0x1c')](splitAdditionalPhone(_0x1c41e0['id'],_0x5885c6[_0x23c13e]));}Promise[_0x19dc('0x1d')](_0x26ded3)[_0x19dc('0x1a')](function(){_0x532886({'val':_0x5885c6[_0x19dc('0x1b')]});});});}function splitAdditionalPhone(_0x24e4ac,_0x19f61f){return new Promise(function(_0x585984,_0x551a59){var _0x1f1180=_0x19f61f[_0x19dc('0x1e')](':');var _0x282307=_0x1f1180[0x0];var _0x2ed96c=_0x1f1180[0x1];if(!_[_0x19dc('0x1f')](_0x2ed96c)){var _0x42f269=_0x2ed96c[_0x19dc('0x1e')]('|');var _0x1cd844=[];for(var _0x361713=0x0;_0x361713<_0x42f269[_0x19dc('0x1b')];_0x361713++){if(_0x42f269[_0x361713]!==''){var _0x163bdc=_[_0x19dc('0x20')](promisesAdditionalPhones,{'contactId':_0x24e4ac,'phone':_0x42f269[_0x361713]});if(_0x163bdc['length']==0x0){orderBy++;promisesAdditionalPhones[_0x19dc('0x1c')]({'contactId':_0x24e4ac,'contactTypeId':_0x282307,'phone':_0x42f269[_0x361713],'orderBy':orderBy});}}}_0x585984({'ok':0x1});}else _0x585984({'res':0x0});});}function createAdditionalPhone(_0x2c40d9,_0x1c830c,_0xcca96b,_0x3e798f){var _0x5e6597='';var _0x2a0643='';var _0x3db8c3=_0xcca96b['split']('§');_0x5e6597=_0x3db8c3[0x0];if(_0x3db8c3[_0x19dc('0x1b')]==0x2)_0x2a0643=_0x3db8c3[0x1];return new Promise(function(_0x45cbec,_0x51223e){return db['CmContactHasItem'][_0x19dc('0x21')]({'where':{'CmContactId':_0x2c40d9,'item':_0x5e6597}})[_0x19dc('0x1a')](function(_0x3450e4){if(_0x3450e4){return db['CmContactHasItem'][_0x19dc('0x22')]({'ItemTypeId':_0x1c830c,'description':_0x2a0643,'OrderBy':_0x3e798f},{'where':{'CmContactId':_0x2c40d9,'item':_0x5e6597}})[_0x19dc('0x1a')](function(_0x1baffe){_0x45cbec({'res':_0x19dc('0x23')});});}else{return db[_0x19dc('0x24')]['create']({'CmContactId':_0x2c40d9,'item':_0x5e6597,'description':_0x2a0643,'ItemTypeId':_0x1c830c,'OrderBy':_0x3e798f,'ItemClass':_0x19dc('0x25')})[_0x19dc('0x1a')](function(_0x3d0353){_0x45cbec({'res':_0x19dc('0x26')});});}});});}function insertCmHopper(_0x4a0422,_0x79ccc6,_0x51c858,_0x626f8c,_0x539255){var _0x24fc6c=[_0x19dc('0x27'),_0x19dc('0x28'),'cm_contacts.id',_0x19dc('0x29'),_0x79ccc6+'.'+_0x626f8c,_0x19dc('0x2a'),_0x19dc('0x2b'),_0x19dc('0x2c'),'cm_contacts.UserId','\x22'+_0x539255+'\x22'];return squel['insert']()[_0x19dc('0x2d')](_0x19dc('0x2e'))[_0x19dc('0x2f')]([_0x19dc('0x30'),_0x19dc('0x31'),_0x19dc('0x32'),_0x19dc('0x33'),_0x626f8c,_0x19dc('0x34'),'updatedAt','priority',_0x19dc('0x35'),_0x19dc('0x36')],squel[_0x19dc('0x10')]()[_0x19dc('0x37')](_0x24fc6c)['from'](_0x79ccc6)[_0x19dc('0x13')](_0x19dc('0x38'),null,_0x19dc('0x39')+_0x79ccc6+'.CmListId')[_0x19dc('0x13')](_0x51c858,null,_0x51c858+_0x19dc('0x14')+_0x79ccc6+'.'+_0x626f8c)[_0x19dc('0x16')](_0x79ccc6+'.CmListId\x20=\x20?',_0x4a0422)[_0x19dc('0x16')](_0x19dc('0x3a'),NOW)[_0x19dc('0x16')](_0x19dc('0x3b'),selectNotIn(_0x79ccc6,_0x51c858,_0x626f8c,'cm_hopper',[_0x19dc('0x3c'),_0x19dc('0x3d')]))['where'](_0x19dc('0x3b'),selectNotIn(_0x79ccc6,_0x51c858,_0x626f8c,'cm_hopper',[_0x19dc('0x3c')])))[_0x19dc('0x3e')]();}function insertCmHopperBlack(_0x128952,_0xdd437e,_0x340cff,_0x2a5005){var _0xf46b77=[_0x19dc('0x27'),_0x19dc('0x3f'),_0x19dc('0x29'),_0xdd437e+'.'+_0x2a5005,_0x19dc('0x2a'),'cm_contacts.updatedAt'];return squel[_0x19dc('0x40')]()[_0x19dc('0x2d')](_0x19dc('0x41'))[_0x19dc('0x2f')]([_0x19dc('0x30'),_0x19dc('0x32'),_0x19dc('0x33'),_0x2a5005,_0x19dc('0x34'),_0x19dc('0x42')],squel[_0x19dc('0x10')]()[_0x19dc('0x37')](_0xf46b77)[_0x19dc('0x12')](_0xdd437e)[_0x19dc('0x13')]('cm_contacts',null,_0x19dc('0x39')+_0xdd437e+_0x19dc('0x43'))[_0x19dc('0x13')](_0x340cff,null,_0x340cff+_0x19dc('0x14')+_0xdd437e+'.'+_0x2a5005)[_0x19dc('0x16')](_0xdd437e+_0x19dc('0x44'),_0x128952)[_0x19dc('0x16')](_0x19dc('0x3a'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x19dc('0x10')]()[_0x19dc('0x11')](_0x19dc('0x30'))[_0x19dc('0x12')]('cm_hopper_black')['where']('ListId\x20=\x20?',_0x128952)['where'](_0x2a5005+_0x19dc('0x15')+_0xdd437e+'.'+_0x2a5005)))['toString']();}function insertTzCmHopper(_0x2b17ed,_0x43a73a,_0x510e8d,_0x27e202,_0x5e4044,_0x48ad95){var _0x45ac3e=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x48ad95+'.offset-cm_contacts.utcOffset\x20minute)',_0x19dc('0x3f'),_0x19dc('0x29'),_0x43a73a+'.'+_0x27e202,_0x19dc('0x2a'),_0x19dc('0x2b'),_0x19dc('0x2c'),'cm_contacts.UserId','\x22'+_0x5e4044+'\x22'];var _0x53ad0e=squel[_0x19dc('0x40')]()[_0x19dc('0x2d')](_0x19dc('0x2e'))[_0x19dc('0x2f')](['phone',_0x19dc('0x31'),_0x19dc('0x32'),_0x19dc('0x33'),_0x27e202,_0x19dc('0x34'),_0x19dc('0x42'),_0x19dc('0x45'),_0x19dc('0x35'),_0x19dc('0x36')],squel['select']()['fields'](_0x45ac3e)[_0x19dc('0x12')](_0x43a73a)[_0x19dc('0x13')](_0x19dc('0x38'),null,_0x19dc('0x39')+_0x43a73a+_0x19dc('0x43'))[_0x19dc('0x13')](_0x510e8d,null,_0x510e8d+_0x19dc('0x14')+_0x43a73a+'.'+_0x27e202)[_0x19dc('0x13')](_0x48ad95,null,_0x48ad95+_0x19dc('0x14')+_0x43a73a+'.'+_0x27e202)[_0x19dc('0x16')](_0x43a73a+_0x19dc('0x44'),_0x2b17ed)[_0x19dc('0x16')](_0x19dc('0x3a'),NOW)['where'](_0x19dc('0x3b'),selectNotIn(_0x43a73a,_0x510e8d,_0x27e202,_0x19dc('0x2e'),[_0x19dc('0x3c'),'\x22onlyIfOpen\x22']))[_0x19dc('0x16')](_0x19dc('0x3b'),selectNotIn(_0x43a73a,_0x510e8d,_0x27e202,_0x19dc('0x2e'),[_0x19dc('0x3c')])))[_0x19dc('0x3e')]();return _0x53ad0e;}function insertTzCmHopperBlack(_0x3e6a8f,_0x3cee13,_0x25b1bb,_0x104b0e){var _0x2688da=[_0x19dc('0x27'),_0x19dc('0x3f'),_0x19dc('0x29'),_0x3cee13+'.'+_0x104b0e,_0x19dc('0x2a'),_0x19dc('0x2b')];return squel[_0x19dc('0x40')]()[_0x19dc('0x2d')]('cm_hopper_black')[_0x19dc('0x2f')](['phone',_0x19dc('0x32'),_0x19dc('0x33'),_0x104b0e,'createdAt','updatedAt'],squel[_0x19dc('0x10')]()[_0x19dc('0x37')](_0x2688da)['from'](_0x3cee13)['join'](_0x19dc('0x38'),null,_0x19dc('0x39')+_0x3cee13+'.CmListId')['join'](_0x25b1bb,null,_0x25b1bb+'.id\x20=\x20'+_0x3cee13+'.'+_0x104b0e)[_0x19dc('0x16')](_0x3cee13+_0x19dc('0x44'),_0x3e6a8f)[_0x19dc('0x16')](_0x19dc('0x3a'),NOW)[_0x19dc('0x16')](_0x19dc('0x3b'),squel['select']()[_0x19dc('0x11')]('phone')[_0x19dc('0x12')](_0x19dc('0x41'))[_0x19dc('0x16')](_0x19dc('0x46'),_0x3e6a8f)[_0x19dc('0x16')](_0x104b0e+_0x19dc('0x15')+_0x3cee13+'.'+_0x104b0e)))[_0x19dc('0x3e')]();}function insertCmHopperAdditionalPhones(_0x4c3661){var _0x39da98=[_0x19dc('0x47'),_0x19dc('0x48'),_0x19dc('0x49'),_0x19dc('0x4a'),_0x19dc('0x4b')];return squel[_0x19dc('0x40')]()[_0x19dc('0x2d')](_0x19dc('0x4c'))['fromQuery']([_0x19dc('0x4d'),_0x19dc('0x30'),'OrderBy','createdAt',_0x19dc('0x42')],squel[_0x19dc('0x10')]()['fields'](_0x39da98)['from'](_0x19dc('0x2e'))[_0x19dc('0x13')](_0x19dc('0x38'),null,'cm_contacts.id\x20=\x20cm_hopper.ContactId')[_0x19dc('0x13')]('cm_contact_has_items',null,_0x19dc('0x4e'))[_0x19dc('0x16')](_0x19dc('0x4f'),_0x4c3661)[_0x19dc('0x16')](_0x19dc('0x3a'),NOW))[_0x19dc('0x3e')]();}function insertCmContact(_0x4c8af0,_0x56d634,_0x1e90f0,_0xb7650e){var _0x1bb6c7=_['concat'](_[_0x19dc('0x50')](_0xb7650e),[_0x19dc('0x33'),_0x19dc('0x51'),_0x19dc('0x34'),_0x19dc('0x42'),'scheduledAt']);return squel[_0x19dc('0x40')]()[_0x19dc('0x2d')](_0x19dc('0x38'))[_0x19dc('0x2f')](_0x1bb6c7,squel[_0x19dc('0x10')]()[_0x19dc('0x37')](_0x1bb6c7)[_0x19dc('0x12')](_0x56d634)['where']('('+_0x1e90f0['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x19dc('0x10')]()[_0x19dc('0x37')](_0x1e90f0)[_0x19dc('0x12')](_0x19dc('0x38'))['where'](_0x19dc('0x46'),_0x4c8af0)[_0x19dc('0x16')](_0x19dc('0x52')))[_0x19dc('0x16')](_0x19dc('0x53'),squel['select']()[_0x19dc('0x11')]('MIN(id)',_0x19dc('0x54'))[_0x19dc('0x12')](_0x56d634)[_0x19dc('0x55')](_0x1e90f0[_0x19dc('0x13')](','))))[_0x19dc('0x3e')]();}function handleStop(){logger[_0x19dc('0x56')](_0x19dc('0x57'));stopped=!![];}function handleUncaughtException(_0x2fd1b2){logger[_0x19dc('0x58')](_0x2fd1b2[_0x19dc('0x59')]);process['exit'](0x1);}function handleError(_0x44f125,_0x39aa5f){stats[_0x19dc('0x5a')]['push']({'name':_0x39aa5f[_0x19dc('0x5b')],'message':_0x39aa5f['message'],'row':_0x44f125});}function handleQuery(_0x2487a8){logger['info'](_0x2487a8);return db['sequelize'][_0x19dc('0x5c')](_0x2487a8)[_0x19dc('0x5d')](function(_0x4c4fef){results['push'](_0x4c4fef);})[_0x19dc('0x5e')](function(_0x30c7b9){logger[_0x19dc('0x58')](_0x30c7b9[_0x19dc('0x59')]);});}function updateTzCampaigns(_0x407a7e){return new Promise(function(_0x4ab07f,_0xa2820f){var _0x5892f8=squel[_0x19dc('0x10')]()[_0x19dc('0x37')]([_0x19dc('0x5f'),_0x19dc('0x60')])[_0x19dc('0x12')](_0x19dc('0x61'))[_0x19dc('0x13')](_0x19dc('0x62'),null,_0x19dc('0x63'))[_0x19dc('0x16')](_0x19dc('0x64')+_0x407a7e);db['sequelize'][_0x19dc('0x5c')](_0x5892f8[_0x19dc('0x3e')]())[_0x19dc('0x5d')](function(_0x12a5de){var _0x46f108=[];for(var _0x2a0db4=0x0;_0x2a0db4<_0x12a5de['length'];_0x2a0db4++){_0x46f108['push'](getTimezoneData(_0x12a5de[_0x2a0db4],tmp_campaigns));}BPromise[_0x19dc('0x1d')](_0x46f108)[_0x19dc('0x1a')](function(){_0x4ab07f({'val':0x1});});})['catch'](function(_0x55651a){logger['error'](_0x55651a[_0x19dc('0x59')]);_0x4ab07f({'val':0x0});});});}function updateTzVoiceQueues(_0x12d5f7){return new Promise(function(_0x11c520,_0x41e71a){var _0x6f8a73=squel[_0x19dc('0x10')]()['fields']([_0x19dc('0x65'),'voice_queues.dialTimezone'])[_0x19dc('0x12')](_0x19dc('0x66'))['join'](_0x19dc('0x67'),null,_0x19dc('0x68'))['where'](_0x19dc('0x69')+_0x12d5f7);db['sequelize'][_0x19dc('0x5c')](_0x6f8a73[_0x19dc('0x3e')]())[_0x19dc('0x5d')](function(_0x2b0157){var _0x232a26=[];for(var _0xbea920=0x0;_0xbea920<_0x2b0157['length'];_0xbea920++){_0x232a26[_0x19dc('0x1c')](getTimezoneData(_0x2b0157[_0xbea920],tmp_voice_queues));}BPromise[_0x19dc('0x1d')](_0x232a26)[_0x19dc('0x1a')](function(){_0x11c520({'val':0x1});});})[_0x19dc('0x5e')](function(_0x2c50b9){logger[_0x19dc('0x58')](_0x2c50b9['message']);_0x11c520({'val':0x0});});});}function getTimezoneData(_0x41f892,_0x4a4de3){return new Promise(function(_0x2b6861,_0x56307e){var _0x511191=shared['timezones'];var _0x2d6bf5=_0x511191[_0x41f892[_0x19dc('0x6a')]];if(_[_0x19dc('0x1f')](_0x2d6bf5)){_0x2b6861({'ret':0x1});}else{var _0x563256=_0x2d6bf5[_0x19dc('0x6b')];var _0x4f1311=squel['insert']()[_0x19dc('0x2d')](_0x4a4de3)[_0x19dc('0x6c')]('id',_0x41f892['id'])[_0x19dc('0x6c')](_0x19dc('0x6d'),_0x563256)['set'](_0x19dc('0x6a'),_0x41f892[_0x19dc('0x6a')])['toString']();return db['sequelize'][_0x19dc('0x5c')](_0x4f1311)['spread'](function(_0x1897d7){_0x2b6861({'ret':0x1});})[_0x19dc('0x5e')](function(_0x14f614){logger[_0x19dc('0x58')](_0x14f614[_0x19dc('0x59')]);_0x56307e({'ret':0x1});});}});}function handleTZQuery(_0x24cadb){logger[_0x19dc('0x56')](_0x24cadb);return db[_0x19dc('0x6e')][_0x19dc('0x5c')](_0x24cadb)['spread'](function(_0x4a231f){})[_0x19dc('0x5e')](function(_0x33390d){logger['error'](_0x33390d['message']);});}function main(_0x426797,_0x5b54bd,_0x3d0e78,_0x31dad9){logger[_0x19dc('0x56')]('main',_0x426797,JSON[_0x19dc('0x6f')](_0x5b54bd));process['send'](_0x19dc('0x70'));var _0x5d52bd=_0x5b54bd[_0x19dc('0x71')];var _0x339200=_[_0x19dc('0x72')](_0x5d52bd);var _0x67da09=_0x5b54bd[_0x19dc('0x73')];var _0x634c23=path[_0x19dc('0x13')](config['root'],'server/files/tmp',_0x67da09+'.csv');hasTZ=_[_0x19dc('0x50')](_0x5d52bd)[_0x19dc('0x74')](_0x19dc('0x6a'));var _0x1da1a7=_[_0x19dc('0x50')](_0x5d52bd)[_0x19dc('0x13')]();logger[_0x19dc('0x56')](_0x19dc('0x75'),_0x1da1a7);db['ContactItemType']['findAll']({'raw':!![],'attributes':['id','name']})[_0x19dc('0x1a')](function(_0xb43c27){for(var _0x576016=0x0;_0x576016<_0xb43c27['length'];_0x576016++){if(_0xb43c27[_0x576016][_0x19dc('0x76')]in _0x5d52bd){contactItemTypes[_0x19dc('0x1c')](_0xb43c27[_0x576016]);delete _0x339200[_0xb43c27[_0x576016][_0x19dc('0x76')]];hasAdditionalPhones=!![];}for(var _0x1ea693 in _0x5d52bd){if(_0xb43c27[_0x576016][_0x19dc('0x76')]+_0x19dc('0x77')===_0x1ea693){phoneDescriptions[_0x19dc('0x1c')]({'itemTypeId':_0xb43c27[_0x576016]['id'],'description':_0x1ea693});delete _0x339200[_0x1ea693];}}}if(hasAdditionalPhones)_0x339200[_0x19dc('0x19')]='';var _0x123c90=_[_0x19dc('0x50')](_0x339200)[_0x19dc('0x13')]();logger[_0x19dc('0x56')]('header',_0x123c90);fs[_0x19dc('0x78')](_0x634c23,_0x123c90+'\x0a');Papa[_0x19dc('0x79')](fs[_0x19dc('0x7a')](_0x426797),{'header':!![],'skipEmptyLines':!![],'step':function(_0x3b56ed,_0x2e902c){try{for(var _0xe873fe=0x0,_0x2336f6=[];_0xe873fe<_0x3b56ed[_0x19dc('0x7b')][_0x19dc('0x1b')];_0xe873fe++){stats[_0x19dc('0x7c')]+=0x1;if(_0x3b56ed[_0x19dc('0x5a')][_0xe873fe]){handleError(_0x3b56ed['data'][_0xe873fe],_0x3b56ed[_0x19dc('0x5a')][_0xe873fe]);}else{var _0xbed637=[];var _0x543368=[];var _0x1c8f69={};for(var _0x15075c in _0x5d52bd){let _0x3f4909=contactItemTypes[_0x19dc('0x7d')](_0xc8f325=>_0xc8f325[_0x19dc('0x76')]===_0x15075c);let _0xe8141f=contactItemTypes[_0x19dc('0x7d')](_0x24a2b9=>_0x24a2b9['name']+_0x19dc('0x77')===_0x15075c);if(_[_0x19dc('0x1f')](_0x3f4909)&&_[_0x19dc('0x1f')](_0xe8141f)){if(_0x5d52bd['hasOwnProperty'](_0x15075c)){if(_0x3b56ed[_0x19dc('0x7b')][_0xe873fe][_0x5d52bd[_0x15075c]]){var _0x357947=_['trim'](_0x3b56ed[_0x19dc('0x7b')][_0xe873fe][_0x5d52bd[_0x15075c]][_0x19dc('0x7e')](/"/g,'\x27'));switch(_0x15075c){case _0x19dc('0x31'):var _0x34aefb=moment(_0x357947,_0x19dc('0xe'),!![]);if(_0x34aefb[_0x19dc('0x7f')]()){_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x357947+'\x22');}else{_0xbed637['push'](_0x19dc('0x80'));}break;case _0x19dc('0x45'):var _0x5c727a=parseInt(_0x357947);_0x357947=_[_0x19dc('0x81')](_0x5c727a)||_0x5c727a<0x0||_0x5c727a>0x4?_0x31dad9?0x3:0x2:_0x5c727a;_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x357947+'\x22');break;case _0x19dc('0x35'):var _0x5da8c0=parseInt(_0x357947);if(_[_0x19dc('0x82')](_0x5da8c0)&&_['includes'](_0x3d0e78,_0x5da8c0)){_0x2336f6['push']('\x22'+_0x5da8c0+'\x22');}else{_0xbed637[_0x19dc('0x1c')]('agent\x20not\x20exists');}break;case _0x19dc('0x83'):if(isEmail(_0x357947)){_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x357947+'\x22');}else{_0xbed637[_0x19dc('0x1c')](_0x19dc('0x84'));}break;case _0x19dc('0x85'):var _0x2709a8=moment(_0x357947,_0x19dc('0x86'),!![]);if(_0x2709a8[_0x19dc('0x7f')]()){_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x357947+'\x22');}else{_0xbed637['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x19dc('0x6a'):var _0x33a0d2=shared[_0x19dc('0x87')];var _0x2f4f7a=_0x33a0d2[_0x357947];if(!_[_0x19dc('0x1f')](_0x2f4f7a)){var _0x59a553=_0x2f4f7a['utcOffset'];_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x357947+'\x22');_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x59a553+'\x22');}break;default:_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x357947+'\x22');}}else{switch(_0x15075c){case _0x19dc('0x88'):case'phone':_0xbed637[_0x19dc('0x1c')](_0x15075c+_0x19dc('0x89'));break;default:_0x2336f6[_0x19dc('0x1c')]('\x22\x22');}}}}else{var _0x43c323='';if(!_['isNil'](_0x3f4909)){if(!_0x1c8f69[_0x19dc('0x8a')](_0x3f4909['id'])){if(!_[_0x19dc('0x1f')](_0x3b56ed[_0x19dc('0x7b')][_0xe873fe][_0x5d52bd[_0x15075c]])){var _0x357947=_[_0x19dc('0x8b')](_0x3b56ed[_0x19dc('0x7b')][_0xe873fe][_0x5d52bd[_0x15075c]][_0x19dc('0x7e')](/"/g,'\x27'));var _0x3100bd=phoneDescriptions[_0x19dc('0x7d')](_0x247c14=>_0x247c14[_0x19dc('0x8c')]===_0x3f4909['id']);if(!_[_0x19dc('0x1f')](_0x3100bd)){var _0x1db3f3=_['trim'](_0x3b56ed[_0x19dc('0x7b')][_0xe873fe][_0x5d52bd[_0x3100bd[_0x19dc('0x8d')]]][_0x19dc('0x7e')](/"/g,'\x27'));if(!_[_0x19dc('0x1f')](_0x1db3f3))_0x357947=_0x357947+'§'+_0x1db3f3;}if(_0x43c323=='')_0x43c323=_0x357947;else _0x43c323+='|'+_0x357947;}_0x543368[_0x19dc('0x1c')](_0x3f4909['id']+':'+_0x43c323);_0x1c8f69[_0x3f4909['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2336f6[_0x19dc('0x1c')]('\x22'+_0x543368[_0x19dc('0x13')](';')+'\x22');}if(_0xbed637[_0x19dc('0x1b')]){handleError(_0x3b56ed[_0x19dc('0x7b')][_0xe873fe],{'code':_0x19dc('0x8e'),'message':_0xbed637[_0x19dc('0x13')]()});}else{fs[_0x19dc('0x8f')](_0x634c23,_0x2336f6[_0x19dc('0x13')]()+'\x0a');}_0x2336f6=[];}if(!(stats[_0x19dc('0x7c')]%0xc8)){socket['emit']('contact:import:'+_0x67da09,stats);stats['errors']=[];}}if(stopped){logger[_0x19dc('0x56')](_0x19dc('0x90'));_0x2e902c['abort']();}}catch(_0x418df6){handleError(_0x3b56ed[_0x19dc('0x7b')][_0xe873fe],{'code':_0x19dc('0x91'),'message':_0x418df6['message']});logger['error'](_0x19dc('0x92'),_0x418df6['message']);}},'complete':function(){try{var _0x535f3b=[];var _0x4e1ae1=[];var _0x3e5a40=_0x19dc('0x38');if(_0x5b54bd[_0x19dc('0x93')]&&_0x5b54bd[_0x19dc('0x93')][_0x19dc('0x1b')]){_0x3e5a40=_0x19dc('0x94')+_0x67da09;_0x535f3b[_0x19dc('0x1c')](_0x19dc('0x95')+_0x3e5a40+_0x19dc('0x96'));}tmp_campaigns=_0x19dc('0x97')+_0x67da09;tmp_voice_queues=_0x19dc('0x98')+_0x67da09;_0x4e1ae1[_0x19dc('0x1c')](_0x19dc('0x95')+tmp_campaigns+_0x19dc('0x99'));_0x4e1ae1[_0x19dc('0x1c')](_0x19dc('0x95')+tmp_voice_queues+_0x19dc('0x99'));BPromise[_0x19dc('0x9a')](_0x4e1ae1,handleTZQuery)[_0x19dc('0x1a')](function(_0x5d8c4a){updateTzCampaigns(_0x5b54bd[_0x19dc('0x33')])[_0x19dc('0x1a')](function(_0x12fd9a){updateTzVoiceQueues(_0x5b54bd[_0x19dc('0x33')])[_0x19dc('0x1a')](function(_0x46e6e5){if(hasTZ)_0x123c90=_0x123c90[_0x19dc('0x7e')](_0x19dc('0x6a'),'dialTimezone,utcOffset');var _0x4ab088=util[_0x19dc('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x634c23,_0x3e5a40,_0x123c90,_0x5b54bd[_0x19dc('0x33')],_0x5b54bd['CompanyId']||null,NOW,NOW);if(_[_0x19dc('0x1f')](_0x5d52bd[_0x19dc('0x31')])){_0x4ab088+=_0x19dc('0x9b');}_0x535f3b['push'](_0x4ab088);if(_0x5b54bd[_0x19dc('0x93')]&&_0x5b54bd['duplicates'][_0x19dc('0x1b')]){_0x535f3b['push'](insertCmContact(_0x5b54bd[_0x19dc('0x33')],_0x3e5a40,_0x5b54bd['duplicates'],_0x5d52bd));_0x535f3b[_0x19dc('0x1c')](_0x19dc('0x9c')+_0x3e5a40+';');}BPromise[_0x19dc('0x9a')](_0x535f3b,handleQuery)[_0x19dc('0x1a')](function(_0x1b76d4){BPromise[_0x19dc('0x1d')]([handleAdditionalPhones()])[_0x19dc('0x1a')](function(){_0x535f3b=[];for(var _0x5551fd=0x0;_0x5551fd\x20\x20','argv','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','util','moment','squel','ioredis','../../../mysqldb','redis','defaults','socket.io-emitter'];(function(_0x5d9677,_0x53d683){var _0x4f6d23=function(_0x3fb279){while(--_0x3fb279){_0x5d9677['push'](_0x5d9677['shift']());}};_0x4f6d23(++_0x53d683);}(_0xdfb1,0x8c));var _0x1dfb=function(_0x6d79aa,_0x443887){_0x6d79aa=_0x6d79aa-0x0;var _0x130874=_0xdfb1[_0x6d79aa];return _0x130874;};'use strict';var fs=require('fs');var path=require(_0x1dfb('0x0'));var _=require(_0x1dfb('0x1'));var Papa=require(_0x1dfb('0x2'));var util=require(_0x1dfb('0x3'));var BPromise=require('bluebird');var moment=require(_0x1dfb('0x4'));var squel=require(_0x1dfb('0x5'));var Redis=require(_0x1dfb('0x6'));var db=require(_0x1dfb('0x7'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0x1dfb('0x8')]=_[_0x1dfb('0x9')](config[_0x1dfb('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x1dfb('0xa'))(new Redis(config[_0x1dfb('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x1dfb('0xb')](_0x1dfb('0xc'));var tempTableName='cm_contacts_temp_'+moment()[_0x1dfb('0xb')](_0x1dfb('0xd'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x191d87){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'](_0x191d87);}function selectNotIn(_0xd747ac,_0x6a43eb,_0x449e56,_0x224c3c,_0x3a0366){return squel[_0x1dfb('0xe')]()[_0x1dfb('0xf')](_0x1dfb('0x10'))[_0x1dfb('0x11')](_0x224c3c)['join'](_0x6a43eb,null,_0x6a43eb+_0x1dfb('0x12')+_0x224c3c+'.'+_0x449e56)[_0x1dfb('0x13')](_0x224c3c+'.'+_0x449e56+'\x20=\x20'+_0xd747ac+'.'+_0x449e56)[_0x1dfb('0x13')](_0x6a43eb+_0x1dfb('0x14')+_0x3a0366[_0x1dfb('0x15')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x4ea317,_0xd9413b){promisesAdditionalPhones=[];promisesContact=[];return db[_0x1dfb('0x16')][_0x1dfb('0x17')]('select\x20*\x20from\x20'+tempTableName)[_0x1dfb('0x18')](function(_0x2d4287){if(_0x2d4287!==null){var _0x425fa9=[];for(var _0x5535ad=0x0;_0x5535ad<_0x2d4287[_0x1dfb('0x19')];_0x5535ad++){var _0x2a146f=_0x2d4287[_0x5535ad];if(!_[_0x1dfb('0x1a')](_0x2a146f['phone'])){if(!_['isNil'](_0x2a146f[_0x1dfb('0x1b')]))_0x425fa9[_0x1dfb('0x1c')](insertAdditionalPhones(_0x2a146f));promisesContact[_0x1dfb('0x1c')]({'contact':_0x2a146f});}}}Promise[_0x1dfb('0x1d')](_0x425fa9)['then'](function(){_0x4ea317({'val':0x1});});})[_0x1dfb('0x1e')](function(_0x33f6e5){logger[_0x1dfb('0x1f')](_0x33f6e5[_0x1dfb('0x20')]);});});}function insertAdditionalPhones(_0x3fde47){return new Promise(function(_0x4dff46,_0x18ee9a){var _0x5c9f21=_0x3fde47['AdditionalPhones'];if(_['isNil'](_0x5c9f21))_0x18ee9a({'val':0x0});else{var _0x546c06=_0x5c9f21[_0x1dfb('0x21')](';');var _0x3cb51e=[];orderBy=0x0;for(var _0x5ab2f8=0x0;_0x5ab2f8<_0x546c06['length'];_0x5ab2f8++){_0x3cb51e['push'](splitAdditionalPhone(_0x3fde47['id'],_0x546c06[_0x5ab2f8]));}Promise[_0x1dfb('0x1d')](_0x3cb51e)[_0x1dfb('0x22')](function(){_0x4dff46({'val':_0x546c06[_0x1dfb('0x19')]});});}});}function splitAdditionalPhone(_0x1250c4,_0x128cc6){return new Promise(function(_0x55da8b,_0x136a7d){var _0x1162b3=_0x128cc6[_0x1dfb('0x21')](':');var _0x52601a=_0x1162b3[0x0];var _0x5111eb=_0x1162b3[0x1];if(_0x5111eb!==''){var _0x386911=_0x5111eb[_0x1dfb('0x21')]('|');var _0x4c9c81=[];for(var _0x520ac8=0x0;_0x520ac8<_0x386911['length'];_0x520ac8++){if(_0x386911[_0x520ac8]!==''){var _0x36bda8=_[_0x1dfb('0x23')](promisesAdditionalPhones,{'contactId':_0x1250c4,'phone':_0x386911[_0x520ac8]});if(_0x36bda8['length']==0x0){orderBy++;promisesAdditionalPhones[_0x1dfb('0x1c')]({'contactId':_0x1250c4,'contactTypeId':_0x52601a,'phone':_0x386911[_0x520ac8],'orderBy':orderBy});}}}_0x55da8b({'ok':0x1});}else _0x55da8b({'res':0x0});});}function createAdditionalPhone(_0x47be04,_0x47518e,_0x18d254,_0x51b2e9){var _0x1bc2c3='';var _0x417f71='';var _0x292c2d=_0x18d254['split']('§');_0x1bc2c3=_0x292c2d[0x0];if(_0x292c2d[_0x1dfb('0x19')]==0x2)_0x417f71=_0x292c2d[0x1];return new Promise(function(_0x82339a,_0x2dfa60){return db[_0x1dfb('0x24')][_0x1dfb('0x25')]({'where':{'CmContactId':_0x47be04,'item':_0x1bc2c3}})['then'](function(_0x2bcc56){if(_0x2bcc56){return db[_0x1dfb('0x24')]['update']({'ItemTypeId':_0x47518e,'description':_0x417f71,'OrderBy':_0x51b2e9},{'where':{'CmContactId':_0x47be04,'item':_0x1bc2c3}})[_0x1dfb('0x22')](function(_0x2572b7){_0x82339a({'res':'updated'});});}else{return db[_0x1dfb('0x24')][_0x1dfb('0x26')]({'CmContactId':_0x47be04,'item':_0x1bc2c3,'ItemTypeId':_0x47518e,'description':_0x417f71,'OrderBy':_0x51b2e9,'ItemClass':_0x1dfb('0x27')})[_0x1dfb('0x22')](function(_0xdcb715){_0x82339a({'res':_0x1dfb('0x28')});});}});});}function updateContact(_0x1960d0){return new Promise(function(_0x3c6252,_0x193cc8){var _0x8b1da8=_0x1960d0['id'];delete _0x1960d0['id'];return db['CmContact'][_0x1dfb('0x29')](_0x1960d0,{'where':{'id':_0x8b1da8}})[_0x1dfb('0x22')](function(_0x450cec){updatedRows+=0x1;return db['CmHopper'][_0x1dfb('0x29')]({'phone':_0x1960d0[_0x1dfb('0x10')]},{'where':{'ContactId':_0x8b1da8}})[_0x1dfb('0x22')](function(_0x5a614c){_0x3c6252({'ret':'OK'});});});});}function insertCmHopper(_0x4bb473,_0x3deb39,_0x34503c,_0x572423,_0x288254){var _0x2b95d0=[_0x1dfb('0x2a'),'cm_contacts.scheduledat',_0x1dfb('0x2b'),_0x1dfb('0x2c'),_0x3deb39+'.'+_0x572423,_0x1dfb('0x2d'),_0x1dfb('0x2e'),'cm_contacts.priority',_0x1dfb('0x2f'),'\x22'+_0x288254+'\x22'];return squel[_0x1dfb('0x30')]()['into']('cm_hopper')[_0x1dfb('0x31')](['phone',_0x1dfb('0x32'),'ContactId','ListId',_0x572423,_0x1dfb('0x33'),_0x1dfb('0x34'),_0x1dfb('0x35'),_0x1dfb('0x36'),_0x1dfb('0x37')],squel['select']()[_0x1dfb('0x38')](_0x2b95d0)[_0x1dfb('0x11')](_0x3deb39)[_0x1dfb('0x15')](_0x1dfb('0x39'),null,_0x1dfb('0x3a')+_0x3deb39+_0x1dfb('0x3b'))['join'](_0x34503c,null,_0x34503c+'.id\x20=\x20'+_0x3deb39+'.'+_0x572423)[_0x1dfb('0x13')](_0x3deb39+_0x1dfb('0x3c'),_0x4bb473)[_0x1dfb('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)['where'](_0x1dfb('0x3d'),selectNotIn(_0x3deb39,_0x34503c,_0x572423,_0x1dfb('0x3e'),['\x22always\x22',_0x1dfb('0x3f')]))[_0x1dfb('0x13')](_0x1dfb('0x3d'),selectNotIn(_0x3deb39,_0x34503c,_0x572423,_0x1dfb('0x3e'),[_0x1dfb('0x40')])))[_0x1dfb('0x41')]();}function insertCmHopperBlack(_0x477b29,_0x49ed09,_0x42a010,_0x22345e){var _0x36ef53=[_0x1dfb('0x2a'),'cm_contacts.id','cm_contacts.ListId',_0x49ed09+'.'+_0x22345e,_0x1dfb('0x2d'),'cm_contacts.updatedAt'];return squel[_0x1dfb('0x30')]()[_0x1dfb('0x42')]('cm_hopper_black')[_0x1dfb('0x31')](['phone','ContactId','ListId',_0x22345e,_0x1dfb('0x33'),_0x1dfb('0x34')],squel[_0x1dfb('0xe')]()['fields'](_0x36ef53)['from'](_0x49ed09)['join'](_0x1dfb('0x39'),null,_0x1dfb('0x3a')+_0x49ed09+_0x1dfb('0x3b'))[_0x1dfb('0x15')](_0x42a010,null,_0x42a010+_0x1dfb('0x12')+_0x49ed09+'.'+_0x22345e)[_0x1dfb('0x13')](_0x49ed09+_0x1dfb('0x3c'),_0x477b29)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x1dfb('0x13')](_0x1dfb('0x3d'),squel[_0x1dfb('0xe')]()['field'](_0x1dfb('0x10'))[_0x1dfb('0x11')](_0x1dfb('0x43'))[_0x1dfb('0x13')](_0x1dfb('0x44'),_0x477b29)['where'](_0x22345e+_0x1dfb('0x45'),_0x49ed09+'.'+_0x22345e)))[_0x1dfb('0x41')]();}function insertCmHopperAdditionalPhones(_0x49acd1){var _0x370d5e=[_0x1dfb('0x46'),'cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt',_0x1dfb('0x47')];return squel[_0x1dfb('0x30')]()[_0x1dfb('0x42')](_0x1dfb('0x48'))[_0x1dfb('0x31')]([_0x1dfb('0x49'),_0x1dfb('0x10'),'OrderBy',_0x1dfb('0x33'),_0x1dfb('0x34')],squel[_0x1dfb('0xe')]()['fields'](_0x370d5e)[_0x1dfb('0x11')](_0x1dfb('0x3e'))['join'](_0x1dfb('0x39'),null,_0x1dfb('0x4a'))[_0x1dfb('0x15')](_0x1dfb('0x4b'),null,_0x1dfb('0x4c'))[_0x1dfb('0x13')](_0x1dfb('0x4d'),_0x49acd1)[_0x1dfb('0x13')](_0x1dfb('0x4e'),NOW))['toString']();}function insertCmContact(_0x193683,_0x39f405,_0x3f8e55,_0x556de4){var _0x380cc3=_[_0x1dfb('0x4f')](_[_0x1dfb('0x50')](_0x556de4),[_0x1dfb('0x51'),_0x1dfb('0x52'),'createdAt',_0x1dfb('0x34')]);return squel['insert']()['into']('cm_contacts')['fromQuery'](_0x380cc3,squel[_0x1dfb('0xe')]()[_0x1dfb('0x38')](_0x380cc3)[_0x1dfb('0x11')](_0x39f405)[_0x1dfb('0x13')]('('+_0x3f8e55[_0x1dfb('0x15')](',')+_0x1dfb('0x53'),squel[_0x1dfb('0xe')]()[_0x1dfb('0x38')](_0x3f8e55)[_0x1dfb('0x11')](_0x1dfb('0x39'))[_0x1dfb('0x13')]('ListId\x20=\x20?',_0x193683))[_0x1dfb('0x13')](_0x1dfb('0x54'),squel['select']()[_0x1dfb('0xf')](_0x1dfb('0x55'),_0x1dfb('0x56'))[_0x1dfb('0x11')](_0x39f405)[_0x1dfb('0x57')](_0x3f8e55[_0x1dfb('0x15')](','))))['toString']();}function handleStop(){logger['info'](_0x1dfb('0x58'));stopped=!![];}function handleUncaughtException(_0x1d397e){logger['error'](_0x1d397e[_0x1dfb('0x20')]);process['exit'](0x1);}function handleError(_0x3c16b2,_0x555c77){stats[_0x1dfb('0x59')][_0x1dfb('0x1c')]({'name':_0x555c77[_0x1dfb('0x5a')],'message':_0x555c77[_0x1dfb('0x20')],'row':_0x3c16b2});}function handleQuery(_0x452e18){logger[_0x1dfb('0x5b')](_0x452e18);return db[_0x1dfb('0x16')][_0x1dfb('0x17')](_0x452e18)['spread'](function(_0x14a384){results['push'](_0x14a384);})[_0x1dfb('0x1e')](function(_0x123e5e){logger[_0x1dfb('0x1f')](_0x123e5e['message']);});}function main(_0x545f5b,_0x240167,_0xabb993,_0x576c22){logger[_0x1dfb('0x5b')](_0x1dfb('0x5c'),_0x545f5b,JSON[_0x1dfb('0x5d')](_0x240167));process[_0x1dfb('0x5e')](_0x1dfb('0x5f'));var _0x1aea50=_0x240167[_0x1dfb('0x60')];var _0x293522=_['clone'](_0x1aea50);var _0x1d0c6c=_0x240167[_0x1dfb('0x61')];var _0x28176e=path[_0x1dfb('0x15')](config['root'],_0x1dfb('0x62'),_0x1d0c6c+_0x1dfb('0x63'));logger[_0x1dfb('0x5b')](_0x1dfb('0x64'),_0x240167);db[_0x1dfb('0x65')][_0x1dfb('0x66')]({'raw':!![],'attributes':['id','name']})[_0x1dfb('0x22')](function(_0x54356c){for(var _0x36ac8e=0x0;_0x36ac8e<_0x54356c[_0x1dfb('0x19')];_0x36ac8e++){if(_0x54356c[_0x36ac8e][_0x1dfb('0x67')]in _0x1aea50){contactItemTypes[_0x1dfb('0x1c')](_0x54356c[_0x36ac8e]);delete _0x293522[_0x54356c[_0x36ac8e][_0x1dfb('0x67')]];hasAdditionalPhones=!![];}for(var _0x5cb4bd in _0x1aea50){if(_0x54356c[_0x36ac8e]['name']+_0x1dfb('0x68')===_0x5cb4bd){phoneDescriptions['push']({'itemTypeId':_0x54356c[_0x36ac8e]['id'],'description':_0x5cb4bd});delete _0x293522[_0x5cb4bd];}}}if(hasAdditionalPhones)_0x293522[_0x1dfb('0x1b')]='';var _0x548b2c=_[_0x1dfb('0x50')](_0x293522)[_0x1dfb('0x15')]();logger[_0x1dfb('0x5b')]('header',_0x548b2c);fs[_0x1dfb('0x69')](_0x28176e,_0x548b2c+'\x0a');Papa[_0x1dfb('0x6a')](fs[_0x1dfb('0x6b')](_0x545f5b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x160c35,_0x367404){try{for(var _0x135c42=0x0,_0x5488e1=[];_0x135c42<_0x160c35['data'][_0x1dfb('0x19')];_0x135c42++){stats[_0x1dfb('0x6c')]+=0x1;if(_0x160c35[_0x1dfb('0x59')][_0x135c42]){handleError(_0x160c35[_0x1dfb('0x6d')][_0x135c42],_0x160c35[_0x1dfb('0x59')][_0x135c42]);}else{var _0x1ed96c=[];var _0x482ead=[];var _0x498153={};for(var _0x31cfba in _0x1aea50){let _0x36c4da=contactItemTypes['find'](_0x97bd16=>_0x97bd16[_0x1dfb('0x67')]===_0x31cfba);let _0x3b975a=contactItemTypes[_0x1dfb('0x6e')](_0x2b92e5=>_0x2b92e5['name']+_0x1dfb('0x68')===_0x31cfba);if(_[_0x1dfb('0x1a')](_0x36c4da)&&_['isNil'](_0x3b975a)){if(_0x1aea50[_0x1dfb('0x6f')](_0x31cfba)){if(_0x160c35[_0x1dfb('0x6d')][_0x135c42][_0x1aea50[_0x31cfba]]){var _0x48dc86=_[_0x1dfb('0x70')](_0x160c35[_0x1dfb('0x6d')][_0x135c42][_0x1aea50[_0x31cfba]][_0x1dfb('0x71')](/"/g,'\x27'));switch(_0x31cfba){case _0x1dfb('0x32'):var _0x5408fc=moment(_0x48dc86,_0x1dfb('0xc'),!![]);if(_0x5408fc[_0x1dfb('0x72')]()){_0x5488e1[_0x1dfb('0x1c')]('\x22'+_0x48dc86+'\x22');}else{_0x1ed96c[_0x1dfb('0x1c')](_0x1dfb('0x73'));}break;case'priority':var _0x389fc6=parseInt(_0x48dc86);_0x48dc86=_['isNaN'](_0x389fc6)||_0x389fc6<0x0||_0x389fc6>0x4?_0x576c22?0x3:0x2:_0x389fc6;_0x5488e1['push']('\x22'+_0x48dc86+'\x22');break;case'UserId':var _0x991a8c=parseInt(_0x48dc86);if(_['isNumber'](_0x991a8c)&&_[_0x1dfb('0x74')](_0xabb993,_0x991a8c)){_0x5488e1[_0x1dfb('0x1c')]('\x22'+_0x991a8c+'\x22');}else{_0x1ed96c['push']('agent\x20not\x20exists');}break;case _0x1dfb('0x75'):if(isEmail(_0x48dc86)){_0x5488e1[_0x1dfb('0x1c')]('\x22'+_0x48dc86+'\x22');}else{_0x1ed96c[_0x1dfb('0x1c')](_0x1dfb('0x76'));}break;case'dateOfBirth':var _0x484a40=moment(_0x48dc86,'YYYY-MM-DD',!![]);if(_0x484a40[_0x1dfb('0x72')]()){_0x5488e1['push']('\x22'+_0x48dc86+'\x22');}else{_0x1ed96c[_0x1dfb('0x1c')](_0x1dfb('0x77'));}break;default:_0x5488e1[_0x1dfb('0x1c')]('\x22'+_0x48dc86+'\x22');}}else{switch(_0x31cfba){case _0x1dfb('0x78'):case _0x1dfb('0x10'):_0x1ed96c[_0x1dfb('0x1c')](_0x31cfba+_0x1dfb('0x79'));break;default:_0x5488e1[_0x1dfb('0x1c')]('\x22\x22');}}}}else{var _0x2fcf39='';if(!_[_0x1dfb('0x1a')](_0x36c4da)){if(!_0x498153[_0x1dfb('0x6f')](_0x36c4da['id'])){for(var _0x58c5db=0x0;_0x58c5db<_0x1aea50[_0x31cfba]['length'];_0x58c5db++){var _0x48dc86=_[_0x1dfb('0x70')](_0x160c35[_0x1dfb('0x6d')][_0x135c42][_0x1aea50[_0x31cfba][_0x58c5db]][_0x1dfb('0x71')](/"/g,'\x27'));var _0x28202c=phoneDescriptions['find'](_0x19564c=>_0x19564c[_0x1dfb('0x7a')]===_0x36c4da['id']);if(!_[_0x1dfb('0x1a')](_0x28202c)){var _0x2bae51=_['trim'](_0x160c35[_0x1dfb('0x6d')][_0x135c42][_0x1aea50[_0x28202c['description']][0x0]][_0x1dfb('0x71')](/"/g,'\x27'));if(!_['isNil'](_0x2bae51))_0x48dc86=_0x48dc86+'§'+_0x2bae51;}if(_0x2fcf39=='')_0x2fcf39=_0x48dc86;else _0x2fcf39+='|'+_0x48dc86;}_0x482ead[_0x1dfb('0x1c')](_0x36c4da['id']+':'+_0x2fcf39);_0x498153[_0x36c4da['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5488e1['push']('\x22'+_0x482ead['join'](';')+'\x22');}if(_0x1ed96c['length']){handleError(_0x160c35[_0x1dfb('0x6d')][_0x135c42],{'code':_0x1dfb('0x7b'),'message':_0x1ed96c[_0x1dfb('0x15')]()});}else{fs[_0x1dfb('0x7c')](_0x28176e,_0x5488e1[_0x1dfb('0x15')]()+'\x0a');}_0x5488e1=[];}if(!(stats['rows']%0xc8)){socket[_0x1dfb('0x7d')](_0x1dfb('0x7e')+_0x1d0c6c,stats);stats[_0x1dfb('0x59')]=[];}}if(stopped){logger['info'](_0x1dfb('0x7f'));_0x367404[_0x1dfb('0x80')]();}}catch(_0x1181a0){handleError(_0x160c35[_0x1dfb('0x6d')][_0x135c42],{'code':_0x1dfb('0x81'),'message':_0x1181a0[_0x1dfb('0x20')]});logger['error'](_0x1dfb('0x82'),_0x1181a0[_0x1dfb('0x20')]);}},'complete':function(){try{var _0x329ea0=[];var _0x32124a=tempTableName;_0x329ea0[_0x1dfb('0x1c')]('CREATE\x20TABLE\x20'+_0x32124a+_0x1dfb('0x83'));logger[_0x1dfb('0x5b')]('CIS\x20len',contactItemTypes[_0x1dfb('0x19')]);var _0x17af11=util[_0x1dfb('0xb')](_0x1dfb('0x84'),_0x28176e,_0x32124a,_0x548b2c,_0x240167['ListId'],_0x240167[_0x1dfb('0x52')]||null,NOW,NOW);if(_[_0x1dfb('0x1a')](_0x1aea50[_0x1dfb('0x32')])){_0x17af11+=_0x1dfb('0x85');}_0x329ea0[_0x1dfb('0x1c')](_0x17af11);BPromise[_0x1dfb('0x86')](_0x329ea0,handleQuery)['then'](function(_0x2f80a5){BPromise[_0x1dfb('0x1d')]([handleAdditionalPhones()])['then'](function(){_0x329ea0=[];for(var _0x2cd97f=0x0;_0x2cd97f\x20\x20','root','existsSync','parse','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','path','lodash','squel','ioredis','import','localhost','redis','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','test','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','select\x20*\x20from\x20','spread','length','isNil','AdditionalPhones','push','all','catch','error','message','split','then','filter','CmContactHasItem','findOne','update','create','PHONE','inserted','CmHopper','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','into','cm_hopper','phone','scheduledat','ListId','updatedAt','priority','UserId','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','insert','cm_hopper_black','fromQuery','fields','.CmListId','ListId\x20=\x20?','\x20=\x20?','cm_hopper.id','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','toString','concat','keys','CompanyId','createdAt',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','exit','errors','code','sequelize','query','stringify','start','binding','clone','socket_timestamp','server/files/tmp','ContactItemType','findAll','name','_description','header','rows','data','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','itemTypeId','description','appendFileSync','emit','Abort\x20parser','SystemError','step','CREATE\x20TABLE\x20','CIS\x20len','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','each','contact','orderBy'];(function(_0x7962f3,_0x3e996d){var _0x42af33=function(_0x1285f4){while(--_0x1285f4){_0x7962f3['push'](_0x7962f3['shift']());}};_0x42af33(++_0x3e996d);}(_0x4cd3,0x1ca));var _0x34cd=function(_0x3ead55,_0x22bc51){_0x3ead55=_0x3ead55-0x0;var _0x3ea16d=_0x4cd3[_0x3ead55];return _0x3ea16d;};'use strict';var fs=require('fs');var path=require(_0x34cd('0x0'));var _=require(_0x34cd('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require('bluebird');var moment=require('moment');var squel=require(_0x34cd('0x2'));var Redis=require(_0x34cd('0x3'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x34cd('0x4'));config['redis']=_['defaults'](config['redis'],{'host':_0x34cd('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x34cd('0x6')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0x34cd('0x7')](_0x34cd('0x8'));var tempTableName='cm_contacts_temp_'+moment()[_0x34cd('0x7')](_0x34cd('0x9'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0xf91b0c){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))*$/[_0x34cd('0xa')](_0xf91b0c);}function selectNotIn(_0x306a76,_0x2b9e6c,_0x3858c2,_0x1d08c7,_0xf71977){return squel[_0x34cd('0xb')]()[_0x34cd('0xc')]('phone')[_0x34cd('0xd')](_0x1d08c7)[_0x34cd('0xe')](_0x2b9e6c,null,_0x2b9e6c+_0x34cd('0xf')+_0x1d08c7+'.'+_0x3858c2)[_0x34cd('0x10')](_0x1d08c7+'.'+_0x3858c2+_0x34cd('0x11')+_0x306a76+'.'+_0x3858c2)[_0x34cd('0x10')](_0x2b9e6c+_0x34cd('0x12')+_0xf71977['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x2881ba,_0x29db1f){promisesAdditionalPhones=[];promisesContact=[];return db['sequelize']['query'](_0x34cd('0x13')+tempTableName)[_0x34cd('0x14')](function(_0x471982){if(_0x471982!==null){var _0x1e73a5=[];for(var _0x571a28=0x0;_0x571a28<_0x471982[_0x34cd('0x15')];_0x571a28++){var _0xea8261=_0x471982[_0x571a28];if(!_[_0x34cd('0x16')](_0xea8261['phone'])){if(!_['isNil'](_0xea8261[_0x34cd('0x17')]))_0x1e73a5[_0x34cd('0x18')](insertAdditionalPhones(_0xea8261));promisesContact[_0x34cd('0x18')]({'contact':_0xea8261});}}}Promise[_0x34cd('0x19')](_0x1e73a5)['then'](function(){_0x2881ba({'val':0x1});});})[_0x34cd('0x1a')](function(_0xfebf8f){logger[_0x34cd('0x1b')](_0xfebf8f[_0x34cd('0x1c')]);});});}function insertAdditionalPhones(_0x37ba94){return new Promise(function(_0x2ada47,_0x435a24){var _0x395a3c=_0x37ba94[_0x34cd('0x17')];if(_[_0x34cd('0x16')](_0x395a3c))_0x435a24({'val':0x0});else{var _0x1bd1f9=_0x395a3c[_0x34cd('0x1d')](';');var _0x1276aa=[];orderBy=0x0;for(var _0x127169=0x0;_0x127169<_0x1bd1f9[_0x34cd('0x15')];_0x127169++){_0x1276aa[_0x34cd('0x18')](splitAdditionalPhone(_0x37ba94['id'],_0x1bd1f9[_0x127169]));}Promise['all'](_0x1276aa)[_0x34cd('0x1e')](function(){_0x2ada47({'val':_0x1bd1f9[_0x34cd('0x15')]});});}});}function splitAdditionalPhone(_0x4cbf48,_0x5165da){return new Promise(function(_0x2f4396,_0x4b2363){var _0x2e960e=_0x5165da[_0x34cd('0x1d')](':');var _0x45f63f=_0x2e960e[0x0];var _0x43eb88=_0x2e960e[0x1];if(_0x43eb88!==''){var _0x1338e9=_0x43eb88['split']('|');var _0x3a37ed=[];for(var _0x1a580d=0x0;_0x1a580d<_0x1338e9[_0x34cd('0x15')];_0x1a580d++){if(_0x1338e9[_0x1a580d]!==''){var _0x239d54=_[_0x34cd('0x1f')](promisesAdditionalPhones,{'contactId':_0x4cbf48,'phone':_0x1338e9[_0x1a580d]});if(_0x239d54[_0x34cd('0x15')]==0x0){orderBy++;promisesAdditionalPhones['push']({'contactId':_0x4cbf48,'contactTypeId':_0x45f63f,'phone':_0x1338e9[_0x1a580d],'orderBy':orderBy});}}}_0x2f4396({'ok':0x1});}else _0x2f4396({'res':0x0});});}function createAdditionalPhone(_0x8186e5,_0x4566e2,_0x1904b6,_0x2f5b26){var _0x15a8e7='';var _0x2bca91='';var _0xfd718c=_0x1904b6[_0x34cd('0x1d')]('§');_0x15a8e7=_0xfd718c[0x0];if(_0xfd718c[_0x34cd('0x15')]==0x2)_0x2bca91=_0xfd718c[0x1];return new Promise(function(_0x178484,_0x3316b0){return db[_0x34cd('0x20')][_0x34cd('0x21')]({'where':{'CmContactId':_0x8186e5,'item':_0x15a8e7}})['then'](function(_0x1c5dd0){if(_0x1c5dd0){return db[_0x34cd('0x20')][_0x34cd('0x22')]({'ItemTypeId':_0x4566e2,'description':_0x2bca91,'OrderBy':_0x2f5b26},{'where':{'CmContactId':_0x8186e5,'item':_0x15a8e7}})[_0x34cd('0x1e')](function(_0x1dbee5){_0x178484({'res':'updated'});});}else{return db[_0x34cd('0x20')][_0x34cd('0x23')]({'CmContactId':_0x8186e5,'item':_0x15a8e7,'ItemTypeId':_0x4566e2,'description':_0x2bca91,'OrderBy':_0x2f5b26,'ItemClass':_0x34cd('0x24')})[_0x34cd('0x1e')](function(_0x238678){_0x178484({'res':_0x34cd('0x25')});});}});});}function updateContact(_0x192ddb){return new Promise(function(_0x18e05b,_0x10e056){var _0x5a225d=_0x192ddb['id'];delete _0x192ddb['id'];return db['CmContact'][_0x34cd('0x22')](_0x192ddb,{'where':{'id':_0x5a225d}})[_0x34cd('0x1e')](function(_0x6b15d6){updatedRows+=0x1;return db[_0x34cd('0x26')][_0x34cd('0x22')]({'phone':_0x192ddb['phone']},{'where':{'ContactId':_0x5a225d}})['then'](function(_0x3b0c28){_0x18e05b({'ret':'OK'});});});});}function insertCmHopper(_0x271cb9,_0x214437,_0x51464d,_0x155ca8,_0xf1d437){var _0x25e32e=[_0x34cd('0x27'),_0x34cd('0x28'),_0x34cd('0x29'),_0x34cd('0x2a'),_0x214437+'.'+_0x155ca8,_0x34cd('0x2b'),_0x34cd('0x2c'),'cm_contacts.priority',_0x34cd('0x2d'),'\x22'+_0xf1d437+'\x22'];return squel['insert']()[_0x34cd('0x2e')](_0x34cd('0x2f'))['fromQuery']([_0x34cd('0x30'),_0x34cd('0x31'),'ContactId',_0x34cd('0x32'),_0x155ca8,'createdAt',_0x34cd('0x33'),_0x34cd('0x34'),_0x34cd('0x35'),'recallme'],squel['select']()['fields'](_0x25e32e)[_0x34cd('0xd')](_0x214437)[_0x34cd('0xe')](_0x34cd('0x36'),null,_0x34cd('0x37')+_0x214437+'.CmListId')[_0x34cd('0xe')](_0x51464d,null,_0x51464d+_0x34cd('0xf')+_0x214437+'.'+_0x155ca8)[_0x34cd('0x10')](_0x214437+_0x34cd('0x38'),_0x271cb9)['where'](_0x34cd('0x39'),NOW)[_0x34cd('0x10')](_0x34cd('0x3a'),selectNotIn(_0x214437,_0x51464d,_0x155ca8,_0x34cd('0x2f'),[_0x34cd('0x3b'),_0x34cd('0x3c')]))[_0x34cd('0x10')](_0x34cd('0x3a'),selectNotIn(_0x214437,_0x51464d,_0x155ca8,_0x34cd('0x2f'),[_0x34cd('0x3b')])))['toString']();}function insertCmHopperBlack(_0x3f852b,_0x9629e4,_0x31f8c5,_0x5d387b){var _0x128938=[_0x34cd('0x27'),_0x34cd('0x29'),'cm_contacts.ListId',_0x9629e4+'.'+_0x5d387b,_0x34cd('0x2b'),_0x34cd('0x2c')];return squel[_0x34cd('0x3d')]()[_0x34cd('0x2e')](_0x34cd('0x3e'))[_0x34cd('0x3f')]([_0x34cd('0x30'),'ContactId',_0x34cd('0x32'),_0x5d387b,'createdAt',_0x34cd('0x33')],squel[_0x34cd('0xb')]()[_0x34cd('0x40')](_0x128938)[_0x34cd('0xd')](_0x9629e4)[_0x34cd('0xe')]('cm_contacts',null,_0x34cd('0x37')+_0x9629e4+_0x34cd('0x41'))[_0x34cd('0xe')](_0x31f8c5,null,_0x31f8c5+_0x34cd('0xf')+_0x9629e4+'.'+_0x5d387b)[_0x34cd('0x10')](_0x9629e4+_0x34cd('0x38'),_0x3f852b)[_0x34cd('0x10')](_0x34cd('0x39'),NOW)[_0x34cd('0x10')](_0x34cd('0x3a'),squel[_0x34cd('0xb')]()[_0x34cd('0xc')](_0x34cd('0x30'))[_0x34cd('0xd')](_0x34cd('0x3e'))['where'](_0x34cd('0x42'),_0x3f852b)[_0x34cd('0x10')](_0x5d387b+_0x34cd('0x43'),_0x9629e4+'.'+_0x5d387b)))['toString']();}function insertCmHopperAdditionalPhones(_0x57b196){var _0xb15687=[_0x34cd('0x44'),'cm_contact_has_items.item',_0x34cd('0x45'),_0x34cd('0x46'),_0x34cd('0x47')];return squel['insert']()[_0x34cd('0x2e')](_0x34cd('0x48'))[_0x34cd('0x3f')]([_0x34cd('0x49'),_0x34cd('0x30'),'OrderBy','createdAt',_0x34cd('0x33')],squel[_0x34cd('0xb')]()[_0x34cd('0x40')](_0xb15687)['from'](_0x34cd('0x2f'))[_0x34cd('0xe')](_0x34cd('0x36'),null,_0x34cd('0x4a'))[_0x34cd('0xe')](_0x34cd('0x4b'),null,_0x34cd('0x4c'))[_0x34cd('0x10')](_0x34cd('0x4d'),_0x57b196)['where']('cm_contacts.createdAt\x20=\x20?',NOW))[_0x34cd('0x4e')]();}function insertCmContact(_0x353caf,_0x52410d,_0x446975,_0x2d27df){var _0x3283fe=_[_0x34cd('0x4f')](_[_0x34cd('0x50')](_0x2d27df),[_0x34cd('0x32'),_0x34cd('0x51'),_0x34cd('0x52'),_0x34cd('0x33')]);return squel[_0x34cd('0x3d')]()[_0x34cd('0x2e')](_0x34cd('0x36'))[_0x34cd('0x3f')](_0x3283fe,squel[_0x34cd('0xb')]()['fields'](_0x3283fe)[_0x34cd('0xd')](_0x52410d)[_0x34cd('0x10')]('('+_0x446975['join'](',')+_0x34cd('0x53'),squel[_0x34cd('0xb')]()[_0x34cd('0x40')](_0x446975)[_0x34cd('0xd')](_0x34cd('0x36'))[_0x34cd('0x10')]('ListId\x20=\x20?',_0x353caf))[_0x34cd('0x10')]('id\x20IN\x20?',squel[_0x34cd('0xb')]()[_0x34cd('0xc')](_0x34cd('0x54'),_0x34cd('0x55'))[_0x34cd('0xd')](_0x52410d)[_0x34cd('0x56')](_0x446975[_0x34cd('0xe')](','))))[_0x34cd('0x4e')]();}function handleStop(){logger[_0x34cd('0x57')](_0x34cd('0x58'));stopped=!![];}function handleUncaughtException(_0x5d28b3){logger[_0x34cd('0x1b')](_0x5d28b3[_0x34cd('0x1c')]);process[_0x34cd('0x59')](0x1);}function handleError(_0x4bc687,_0xf52a17){stats[_0x34cd('0x5a')][_0x34cd('0x18')]({'name':_0xf52a17[_0x34cd('0x5b')],'message':_0xf52a17[_0x34cd('0x1c')],'row':_0x4bc687});}function handleQuery(_0x48efc0){logger[_0x34cd('0x57')](_0x48efc0);return db[_0x34cd('0x5c')][_0x34cd('0x5d')](_0x48efc0)[_0x34cd('0x14')](function(_0x1369b7){results[_0x34cd('0x18')](_0x1369b7);})['catch'](function(_0x367304){logger[_0x34cd('0x1b')](_0x367304[_0x34cd('0x1c')]);});}function main(_0x4f196a,_0x343582,_0x1ef52b,_0xca5e15){logger[_0x34cd('0x57')]('main',_0x4f196a,JSON[_0x34cd('0x5e')](_0x343582));process['send'](_0x34cd('0x5f'));var _0x13c4a2=_0x343582[_0x34cd('0x60')];var _0x40a7f6=_[_0x34cd('0x61')](_0x13c4a2);var _0x3ea76d=_0x343582[_0x34cd('0x62')];var _0x504281=path['join'](config['root'],_0x34cd('0x63'),_0x3ea76d+'.csv');logger[_0x34cd('0x57')]('body',_0x343582);db[_0x34cd('0x64')][_0x34cd('0x65')]({'raw':!![],'attributes':['id',_0x34cd('0x66')]})[_0x34cd('0x1e')](function(_0x26c38c){for(var _0xc0cbf0=0x0;_0xc0cbf0<_0x26c38c[_0x34cd('0x15')];_0xc0cbf0++){if(_0x26c38c[_0xc0cbf0][_0x34cd('0x66')]in _0x13c4a2){contactItemTypes[_0x34cd('0x18')](_0x26c38c[_0xc0cbf0]);delete _0x40a7f6[_0x26c38c[_0xc0cbf0][_0x34cd('0x66')]];hasAdditionalPhones=!![];}for(var _0x3bed1b in _0x13c4a2){if(_0x26c38c[_0xc0cbf0][_0x34cd('0x66')]+_0x34cd('0x67')===_0x3bed1b){phoneDescriptions[_0x34cd('0x18')]({'itemTypeId':_0x26c38c[_0xc0cbf0]['id'],'description':_0x3bed1b});delete _0x40a7f6[_0x3bed1b];}}}if(hasAdditionalPhones)_0x40a7f6['AdditionalPhones']='';var _0x5862c8=_[_0x34cd('0x50')](_0x40a7f6)[_0x34cd('0xe')]();logger[_0x34cd('0x57')](_0x34cd('0x68'),_0x5862c8);fs['writeFileSync'](_0x504281,_0x5862c8+'\x0a');Papa['parse'](fs['createReadStream'](_0x4f196a),{'header':!![],'skipEmptyLines':!![],'step':function(_0x16512e,_0x18eec7){try{for(var _0x102de8=0x0,_0xcc9df=[];_0x102de8<_0x16512e['data']['length'];_0x102de8++){stats[_0x34cd('0x69')]+=0x1;if(_0x16512e[_0x34cd('0x5a')][_0x102de8]){handleError(_0x16512e[_0x34cd('0x6a')][_0x102de8],_0x16512e[_0x34cd('0x5a')][_0x102de8]);}else{var _0x251ec8=[];var _0x153d4b=[];var _0x1bf35c={};for(var _0x23b93d in _0x13c4a2){let _0x4935db=contactItemTypes['find'](_0x236dc4=>_0x236dc4[_0x34cd('0x66')]===_0x23b93d);let _0x8de903=contactItemTypes['find'](_0x4b9073=>_0x4b9073[_0x34cd('0x66')]+_0x34cd('0x67')===_0x23b93d);if(_[_0x34cd('0x16')](_0x4935db)&&_[_0x34cd('0x16')](_0x8de903)){if(_0x13c4a2[_0x34cd('0x6b')](_0x23b93d)){if(_0x16512e['data'][_0x102de8][_0x13c4a2[_0x23b93d]]){var _0x426fbc=_[_0x34cd('0x6c')](_0x16512e['data'][_0x102de8][_0x13c4a2[_0x23b93d]][_0x34cd('0x6d')](/"/g,'\x27'));switch(_0x23b93d){case _0x34cd('0x31'):var _0x2c3c07=moment(_0x426fbc,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x2c3c07[_0x34cd('0x6e')]()){_0xcc9df[_0x34cd('0x18')]('\x22'+_0x426fbc+'\x22');}else{_0x251ec8[_0x34cd('0x18')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x34cd('0x34'):var _0x1f6123=parseInt(_0x426fbc);_0x426fbc=_[_0x34cd('0x6f')](_0x1f6123)||_0x1f6123<0x0||_0x1f6123>0x4?_0xca5e15?0x3:0x2:_0x1f6123;_0xcc9df['push']('\x22'+_0x426fbc+'\x22');break;case _0x34cd('0x35'):var _0x4d134c=parseInt(_0x426fbc);if(_[_0x34cd('0x70')](_0x4d134c)&&_[_0x34cd('0x71')](_0x1ef52b,_0x4d134c)){_0xcc9df[_0x34cd('0x18')]('\x22'+_0x4d134c+'\x22');}else{_0x251ec8[_0x34cd('0x18')]('agent\x20not\x20exists');}break;case _0x34cd('0x72'):if(isEmail(_0x426fbc)){_0xcc9df[_0x34cd('0x18')]('\x22'+_0x426fbc+'\x22');}else{_0x251ec8[_0x34cd('0x18')](_0x34cd('0x73'));}break;case _0x34cd('0x74'):var _0x1b112f=moment(_0x426fbc,_0x34cd('0x75'),!![]);if(_0x1b112f[_0x34cd('0x6e')]()){_0xcc9df[_0x34cd('0x18')]('\x22'+_0x426fbc+'\x22');}else{_0x251ec8['push'](_0x34cd('0x76'));}break;default:_0xcc9df[_0x34cd('0x18')]('\x22'+_0x426fbc+'\x22');}}else{switch(_0x23b93d){case _0x34cd('0x77'):case'phone':_0x251ec8[_0x34cd('0x18')](_0x23b93d+_0x34cd('0x78'));break;default:_0xcc9df['push']('\x22\x22');}}}}else{var _0x3698e2='';if(!_[_0x34cd('0x16')](_0x4935db)){if(!_0x1bf35c[_0x34cd('0x6b')](_0x4935db['id'])){for(var _0x3eb2e7=0x0;_0x3eb2e7<_0x13c4a2[_0x23b93d][_0x34cd('0x15')];_0x3eb2e7++){var _0x426fbc=_[_0x34cd('0x6c')](_0x16512e[_0x34cd('0x6a')][_0x102de8][_0x13c4a2[_0x23b93d][_0x3eb2e7]][_0x34cd('0x6d')](/"/g,'\x27'));var _0x3d3780=phoneDescriptions['find'](_0xcb1ac3=>_0xcb1ac3[_0x34cd('0x79')]===_0x4935db['id']);if(!_['isNil'](_0x3d3780)){var _0x543a85=_['trim'](_0x16512e[_0x34cd('0x6a')][_0x102de8][_0x13c4a2[_0x3d3780[_0x34cd('0x7a')]][0x0]][_0x34cd('0x6d')](/"/g,'\x27'));if(!_[_0x34cd('0x16')](_0x543a85))_0x426fbc=_0x426fbc+'§'+_0x543a85;}if(_0x3698e2=='')_0x3698e2=_0x426fbc;else _0x3698e2+='|'+_0x426fbc;}_0x153d4b[_0x34cd('0x18')](_0x4935db['id']+':'+_0x3698e2);_0x1bf35c[_0x4935db['id']]=0x1;}}}}if(hasAdditionalPhones){_0xcc9df[_0x34cd('0x18')]('\x22'+_0x153d4b[_0x34cd('0xe')](';')+'\x22');}if(_0x251ec8[_0x34cd('0x15')]){handleError(_0x16512e[_0x34cd('0x6a')][_0x102de8],{'code':'SystemRow','message':_0x251ec8['join']()});}else{fs[_0x34cd('0x7b')](_0x504281,_0xcc9df[_0x34cd('0xe')]()+'\x0a');}_0xcc9df=[];}if(!(stats[_0x34cd('0x69')]%0xc8)){socket[_0x34cd('0x7c')]('contact:import:'+_0x3ea76d,stats);stats[_0x34cd('0x5a')]=[];}}if(stopped){logger[_0x34cd('0x57')](_0x34cd('0x7d'));_0x18eec7['abort']();}}catch(_0x2dca0a){handleError(_0x16512e[_0x34cd('0x6a')][_0x102de8],{'code':_0x34cd('0x7e'),'message':_0x2dca0a['message']});logger['error'](_0x34cd('0x7f'),_0x2dca0a[_0x34cd('0x1c')]);}},'complete':function(){try{var _0xbfa819=[];var _0x2cefb5=tempTableName;_0xbfa819['push'](_0x34cd('0x80')+_0x2cefb5+'\x20LIKE\x20cm_contacts;');logger[_0x34cd('0x57')](_0x34cd('0x81'),contactItemTypes[_0x34cd('0x15')]);var _0x3084d7=util[_0x34cd('0x7')](_0x34cd('0x82'),_0x504281,_0x2cefb5,_0x5862c8,_0x343582[_0x34cd('0x32')],_0x343582[_0x34cd('0x51')]||null,NOW,NOW);if(_[_0x34cd('0x16')](_0x13c4a2['scheduledat'])){_0x3084d7+=',\x20scheduledAt\x20=\x20NOW()';}_0xbfa819[_0x34cd('0x18')](_0x3084d7);BPromise[_0x34cd('0x83')](_0xbfa819,handleQuery)[_0x34cd('0x1e')](function(_0x9232f1){BPromise['all']([handleAdditionalPhones()])[_0x34cd('0x1e')](function(){_0xbfa819=[];for(var _0xb0a859=0x0;_0xb0a859\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.to','i.ContactId','i.MailAccountId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','limit','offset','groupBy','Setting','enableEmailPreview','all','clone','COUNT(*)','isEmpty','t.id\x20IN\x20?','exports'];(function(_0x20936e,_0x4d5283){var _0x50a212=function(_0x467a9a){while(--_0x467a9a){_0x20936e['push'](_0x20936e['shift']());}};_0x50a212(++_0x4d5283);}(_0xf22e,0x13c));var _0xef22=function(_0x333ac8,_0x5ad399){_0x333ac8=_0x333ac8-0x0;var _0x1603a9=_0xf22e[_0x333ac8];return _0x1603a9;};'use strict';var _=require(_0xef22('0x0'));var squel=require(_0xef22('0x1'));var as=require(_0xef22('0x2'));var qs=require(_0xef22('0x3'));var updateInteraction=require(_0xef22('0x4'))['updateInteraction'];var utils=require(_0xef22('0x5'));var db=require(_0xef22('0x6'))['db'];function skipInteractionsQuery(_0x2cc67a,_0x384324,_0x459256){var _0x43a8ea=![];var _0x6335f4=utils[_0xef22('0x7')](_0x2cc67a);if(_0x384324['role']===_0xef22('0x8')&&!_0x459256[_0xef22('0x9')]&&!_0x459256[_0x6335f4]){_0x43a8ea=!![];}return _0x43a8ea;}function getTagsQuery(){return squel[_0xef22('0xa')]()[_0xef22('0xb')]('id')[_0xef22('0xb')](_0xef22('0xc'))[_0xef22('0xb')]('color')[_0xef22('0xd')]('tools_tags');}function getUsersQuery(_0x372d8e,_0x357f0b){var _0x314d35=utils[_0xef22('0xe')](_0x372d8e);var _0x4722c8=_0xef22('0xf')+_0x372d8e+_0xef22('0x10');var _0x18103b=squel[_0xef22('0xa')]()[_0xef22('0xb')]('u.id')[_0xef22('0xb')](_0xef22('0x11'))[_0xef22('0xb')](_0xef22('0x12')+_0x314d35)[_0xef22('0xd')](_0x4722c8,'ui')[_0xef22('0x13')](_0xef22('0x14'),'u','u.id\x20=\x20ui.UserId');if(_0x357f0b['length']>0x0){_0x18103b['where']('ui.'+_0x314d35+_0xef22('0x15'),_[_0xef22('0x16')](_0x357f0b,'id'));}return _0x18103b;}function getInteractionsQuery(_0x50093f){var _0x30e72d=utils['getInteractionsTables'](_0x50093f);var _0x5a4da5=utils[_0xef22('0x7')](_0x50093f);var _0x376ca6=utils[_0xef22('0xe')](_0x50093f);return squel['select']()[_0xef22('0xd')](_0x30e72d['interactions'],'i')[_0xef22('0x13')](_0xef22('0x17'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xef22('0x13')](_0xef22('0x14'),'o',_0xef22('0x18'))[_0xef22('0x13')](_0x30e72d[_0xef22('0x19')],'a','a.id\x20=\x20i.'+_0x5a4da5)[_0xef22('0x13')](_0x30e72d[_0xef22('0x1a')],'me',_0xef22('0x1b')+_0x376ca6+_0xef22('0x1c'))[_0xef22('0x13')](_0x30e72d['interactionsTags'],'it','it.'+_0x376ca6+'\x20=\x20i.id')[_0xef22('0x13')]('tools_tags','t',_0xef22('0x1d'));}function getSqlClauses(){var _0x28047f={'body':squel[_0xef22('0x1e')](),'contact':squel['expr'](),'default':squel[_0xef22('0x1e')](),'fields':squel[_0xef22('0x1e')](),'filter':squel['expr'](),'read':squel[_0xef22('0x1e')](),'tags':{'clause':squel[_0xef22('0x1e')](),'ids':null},'user':squel['expr']()};return _0x28047f;}function parseTagParameter(_0x9e17e1){var _0x1a585a=squel[_0xef22('0x1e')]();if(_0x9e17e1){var _0x3e54a9=utils[_0xef22('0x1f')](_0x9e17e1);_0x3e54a9[_0xef22('0x20')](function(_0x4056b5){_0x1a585a['or'](_0xef22('0x21'),'%,'+_0x4056b5+',%');});}return _0x1a585a;}function parseReadParameter(_0x11d791){var _0x5332fd='';if(_0x11d791){_0x5332fd='unreadMessages\x20{OPERATOR}\x200';if(_0x11d791==='1'){_0x5332fd=_0x5332fd['replace']('{OPERATOR}','=');}else{_0x5332fd=_0x5332fd['replace']('{OPERATOR}','>');}}return _0x5332fd;}function parseSearchFilter(_0x4e9d3b,_0x45505f){var _0x273898=squel[_0xef22('0x1e')]();if(_0x45505f){var _0x2eac97=_0x45505f[_0xef22('0x22')]('\x5c','\x5c\x5c')[_0xef22('0x22')](/'/g,'\x27\x27');if(qs[_0xef22('0x23')](_0x2eac97)){_0x273898['or']('i.id\x20LIKE\x20?',_0x2eac97+'%');if([_0xef22('0x24'),'whatsapp']['includes'](_0x4e9d3b)){_0x273898['or'](_0xef22('0x25'),_0x2eac97+'%');}else if(_0x4e9d3b==='fax'){_0x273898['or'](_0xef22('0x26'),_0x2eac97+'%');}else if(_0x4e9d3b===_0xef22('0x27')){_0x273898['or'](_0xef22('0x28'),_0x2eac97+'%');}}else if(_0x4e9d3b===_0xef22('0x29')&&qs[_0xef22('0x2a')](_0x2eac97)){_0x273898['or'](_0xef22('0x2b'),_0x2eac97+'%');}else{if(_0x4e9d3b===_0xef22('0x29')){_0x273898['or'](_0xef22('0x2c'),qs['getFullTextValue'](_0x2eac97,!![]))['or'](_0xef22('0x2d'),qs[_0xef22('0x2e')](_0x2eac97));}else if(_0x4e9d3b!=='fax'){_0x273898['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xef22('0x2e')](_0x2eac97));}_0x273898['or'](_0xef22('0x2f'),qs['getFullTextValue'](_0x2eac97,!![]),null);}}return _0x273898;}function parseAdvancedSearchFilter(_0x31661d,_0x32da01){var _0x3828ab=getSqlClauses();var _0x5b5e7c=as[_0xef22('0x30')](_0x31661d);var _0x157887=_0x5b5e7c[_0xef22('0x31')];for(var _0x3ebf4d=0x0;_0x3ebf4d<_0x5b5e7c[_0xef22('0x32')][_0xef22('0x33')];_0x3ebf4d++){var _0x2c56c9=_0x5b5e7c['conditions'][_0x3ebf4d];var _0x1b82e7='i';var _0x491703=_[_0xef22('0x34')](_0x32da01,[_0xef22('0xc'),_0x2c56c9['field']]);if(_0x491703){var _0x3cadfa=as[_0xef22('0x35')](_0x1b82e7,_0x491703[_0xef22('0x36')],_0x2c56c9);_0x3828ab[_0xef22('0x37')][_0x157887](_0x3cadfa[_0xef22('0x38')],_0x3cadfa['value'][_0xef22('0x39')],_0x3cadfa[_0xef22('0x3a')]['end']);}else{switch(_0x2c56c9['field']){case _0xef22('0x3b'):var _0x222748=parseReadParameter(_0x2c56c9[_0xef22('0x3a')]);_0x3828ab[_0xef22('0x3c')][_0xef22('0x3d')](_0x222748);break;case _0xef22('0x3e'):if(_0x2c56c9['operator']===_0xef22('0x3f')){if(_0x2c56c9[_0xef22('0x3a')][_0xef22('0x40')]('\x20')['length']>0x1){_0x3828ab[_0xef22('0x41')][_0x157887](_0xef22('0x2f'),qs[_0xef22('0x2e')](_0x2c56c9[_0xef22('0x3a')],!![]),null);}else{var _0x3de275='%'+_0x2c56c9['value']+'%';_0x3828ab[_0xef22('0x41')][_0x157887](_0xef22('0x42'),_0x3de275,_0x3de275,_0x3de275);}}else{_0x491703=_['find'](_0x32da01,[_0xef22('0xc'),'ContactId']);_0x2c56c9[_0xef22('0xb')]=_0xef22('0x43');_0x3cadfa=as[_0xef22('0x35')](_0x1b82e7,_0x491703[_0xef22('0x36')],_0x2c56c9);_0x3828ab[_0xef22('0x41')][_0x157887](_0x3cadfa['text'],_0x3cadfa['value'][_0xef22('0x39')],_0x3cadfa[_0xef22('0x3a')][_0xef22('0x44')]);}break;case'Tag':var _0x303b52=_0x2c56c9[_0xef22('0x3a')][_0xef22('0x40')](',')[_0xef22('0x16')](function(_0x12c38b){return Number(_0x12c38b);});var _0x191f2f=parseTagParameter(_0x303b52);_0x3828ab[_0xef22('0x45')]['clause']['and'](_0x191f2f);_0x3828ab['tags']['ids']=_0x303b52;break;case'User':if(_0x2c56c9[_0xef22('0x46')]===_0xef22('0x3f')){_0x3828ab[_0xef22('0x47')][_0x157887](_0xef22('0x48'),'%'+_0x2c56c9[_0xef22('0x3a')]+'%',null);}else{_0x491703=_['find'](_0x32da01,['name',_0xef22('0x49')]);_0x2c56c9[_0xef22('0xb')]=_0xef22('0x49');_0x3cadfa=as[_0xef22('0x35')](_0x1b82e7,_0x491703['type'],_0x2c56c9);_0x3828ab[_0xef22('0x47')][_0x157887](_0x3cadfa['text'],_0x3cadfa['value']['start'],_0x3cadfa[_0xef22('0x3a')][_0xef22('0x44')]);}break;case _0xef22('0x4a'):case _0xef22('0x4b'):_0x3cadfa=as[_0xef22('0x35')]('me',null,_0x2c56c9);_0x3828ab[_0xef22('0x4a')][_0x157887](_0x3cadfa['text'],_0x3cadfa[_0xef22('0x3a')][_0xef22('0x39')],_0x3cadfa[_0xef22('0x3a')][_0xef22('0x44')]);break;}}}return _0x3828ab;}function parseModelFields(_0x161da4,_0x1f31de,_0x57f0e8){var _0x2d54ef=utils['getAccountFK'](_0x161da4);var _0x1f8ff1=squel[_0xef22('0x1e')]();var _0x494d11=_(_0x1f31de)[_0xef22('0x4c')]()[_0xef22('0x16')](function(_0x1f7057){return _[_0xef22('0x4d')](_0x57f0e8,[_0xef22('0xc'),_0x1f7057])?_0x1f7057:undefined;})[_0xef22('0x4e')]()['value']();if(_0x494d11[_0xef22('0x33')]>0x0){_0x494d11[_0xef22('0x20')](function(_0x471740){if(_0x471740===_0x2d54ef){_0x1f8ff1[_0xef22('0x3d')]('i.'+_0x2d54ef+_0xef22('0x15'),[][_0xef22('0x4f')](_0x1f31de[_0x471740]));}else if(_0x471740===_0xef22('0x50')){var _0x4eb79c=JSON[_0xef22('0x51')](_0x1f31de[_0x471740])[_0xef22('0x52')];var _0x1b3991=JSON['parse'](_0x1f31de[_0x471740])[_0xef22('0x53')];_0x1f8ff1[_0xef22('0x3d')](_0xef22('0x54'),_0x4eb79c,_0x1b3991);}else{if(_0x1f31de[_0x471740]===_0xef22('0x55')){_0x1f8ff1[_0xef22('0x3d')]('i.'+_0x471740+_0xef22('0x56'));}else{_0x1f8ff1[_0xef22('0x3d')]('i.'+_0x471740+'\x20=\x20?',_0x1f31de[_0x471740]);}}});}return _0x1f8ff1;}function parseQueryParameters(_0x2cd951,_0x1d76c1,_0x1cd973){var _0x568ec5=getSqlClauses();return Promise[_0xef22('0x57')]()[_0xef22('0x58')](function(){return parseModelFields(_0x2cd951,_0x1d76c1,_0x1cd973);})[_0xef22('0x58')](function(_0x4ef24f){_0x568ec5[_0xef22('0x59')][_0xef22('0x3d')](_0x4ef24f);return parseReadParameter(_0x1d76c1['read']);})[_0xef22('0x58')](function(_0x295112){_0x568ec5['read']['and'](_0x295112);return parseTagParameter(_0x1d76c1[_0xef22('0x5a')]);})[_0xef22('0x58')](function(_0x4f95dc){_0x568ec5[_0xef22('0x45')][_0xef22('0x5b')]['and'](_0x4f95dc);return parseSearchFilter(_0x2cd951,_0x1d76c1[_0xef22('0x5c')]);})[_0xef22('0x58')](function(_0x1a8e02){_0x568ec5[_0xef22('0x5c')]=_0x1a8e02;return _0x568ec5;});}function checkAccountsRestrictions(_0x5143c3,_0x5929c0,_0x144c5e){var _0x1d6b16=utils[_0xef22('0x7')](_0x5143c3);var _0x796719=_0xef22('0x5d')+_[_0xef22('0x5e')](_0x5143c3)+(_0x5143c3===_0xef22('0x5f')?'Websites':_0xef22('0x60'));var _0x424845=squel[_0xef22('0x1e')]();return Promise[_0xef22('0x57')]()['then'](function(){if(_0x144c5e[_0xef22('0x9')]&&_0x5929c0[_0xef22('0x61')]==='agent'){return _0x5929c0[_0x796719]({'attributes':['id'],'raw':!![]});}})[_0xef22('0x58')](function(_0x1522ed){if(_0x1522ed){if(_0x1522ed[_0xef22('0x33')]===0x0){_0x424845[_0xef22('0x3d')]('i.'+_0x1d6b16+_0xef22('0x56'));}else{_0x424845[_0xef22('0x3d')]('i.'+_0x1d6b16+_0xef22('0x15'),_[_0xef22('0x16')](_0x1522ed,'id'));}}else if(!_0x144c5e[_0x1d6b16]){_0x424845[_0xef22('0x3d')]('i.'+_0x1d6b16+_0xef22('0x62'));}})[_0xef22('0x58')](function(){return _0x424845;});}function getClosedOrderClause(_0x56f1a1,_0x22e291){var _0x272c6c='';var _0x6dd1d2=[_0xef22('0x63'),_0xef22('0x64'),_0xef22('0x65')];if(_0x56f1a1==='mail'){_0x6dd1d2['unshift'](_0xef22('0x66'));}if(_0x22e291[_0xef22('0x67')]==='0'&&_0x56f1a1==='mail'){_0x272c6c='i.substatus';}else{if(_0x22e291[_0xef22('0x67')]==='1'){_0x6dd1d2[_0xef22('0x68')]();}_0x272c6c=_0xef22('0x69')+_0x6dd1d2['join'](',\x20')+')';}return _0x272c6c;}function getFilteredInteractions(_0x266cc0,_0x3a142a,_0x419ec5,_0x141cd8){var _0x4e5123=utils[_0xef22('0xe')](_0x266cc0);var _0x2d983b=_[_0xef22('0x5e')](_0x266cc0)+'Interaction';var _0x3d377e=[];var _0x290e0c=getTagsQuery();var _0x386f42={'type':db[_0xef22('0x6a')][_0xef22('0x6b')][_0xef22('0x6c')],'raw':!![]};var _0x49a100=[];var _0x5b4e83=[];return db[_0xef22('0x6d')][_0xef22('0x6e')](_0x290e0c[_0xef22('0x6f')](),_0x386f42)[_0xef22('0x58')](function(_0x3ffedd){_0x3d377e=_['keyBy'](_0x3ffedd,'id');_0x386f42=_[_0xef22('0x70')](_0x386f42,{'model':db[_0x2d983b],'mapToModel':!![],'nest':!![]});if(_0x419ec5[_0xef22('0x59')]){_0x141cd8[_0xef22('0x71')][_0xef22('0x20')](function(_0x20e360){_0x3a142a[_0xef22('0xb')]('i.'+_0x20e360);});}else{_0x3a142a[_0xef22('0xb')](_0xef22('0x72'),_0xef22('0x3b'));_0x3a142a[_0xef22('0xb')]('a.key',_0xef22('0x73'));_0x3a142a[_0xef22('0xb')]('a.mandatoryDisposition',_0xef22('0x74'));if(_0x266cc0===_0xef22('0x29')){_0x3a142a[_0xef22('0xb')](_0xef22('0x75'),_0xef22('0x76'));_0x3a142a[_0xef22('0xb')](_0xef22('0x77'),_0xef22('0x78'));_0x3a142a[_0xef22('0xb')](_0xef22('0x79'));_0x3a142a[_0xef22('0xb')](_0xef22('0x7a'));_0x3a142a[_0xef22('0xb')](_0xef22('0x7b'));_0x3a142a[_0xef22('0xb')](_0xef22('0x7c'));_0x3a142a[_0xef22('0xb')](_0xef22('0x7d'));_0x3a142a[_0xef22('0xb')](_0xef22('0x7e'));_0x3a142a['field'](_0xef22('0x7f'));_0x3a142a[_0xef22('0xb')](_0xef22('0x80'));_0x3a142a['field'](_0xef22('0x81'));_0x3a142a['field'](_0xef22('0x65'));_0x3a142a['field'](_0xef22('0x64'));_0x3a142a[_0xef22('0xb')]('i.thirdDisposition');_0x3a142a[_0xef22('0xb')](_0xef22('0x66'));_0x3a142a[_0xef22('0xb')](_0xef22('0x82'));_0x3a142a['field'](_0xef22('0x83'));_0x3a142a['field'](_0xef22('0x84'));_0x3a142a[_0xef22('0xb')]('i.UserId');}else if(_0x266cc0===_0xef22('0x27')){_0x3a142a['field'](_0xef22('0x85'),_0xef22('0x78'));}else{_0x3a142a[_0xef22('0xb')]('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',_0xef22('0x78'));}if(_0x266cc0!==_0xef22('0x29')){_0x3a142a[_0xef22('0xb')](_0xef22('0x86'));}_0x3a142a['field'](_0xef22('0x87'),'Contact.firstName');_0x3a142a[_0xef22('0xb')](_0xef22('0x88'),'Contact.lastName');_0x3a142a['field'](_0xef22('0x89'),_0xef22('0x8a'));_0x3a142a[_0xef22('0xb')]('c.phone','Contact.phone');_0x3a142a['field'](_0xef22('0x8b'),_0xef22('0x8c'));_0x3a142a['field'](_0xef22('0x8d'),_0xef22('0x8e'));_0x3a142a[_0xef22('0xb')]('o.fullname',_0xef22('0x8f'));_0x3a142a[_0xef22('0xb')](_0xef22('0x90'),_0xef22('0x91'));_0x3a142a[_0xef22('0xb')](_0xef22('0x92'),'TagIds');}if(_0x141cd8[_0xef22('0x93')]){_0x3a142a['limit'](_0x141cd8[_0xef22('0x93')]);}if(_0x141cd8[_0xef22('0x94')]){_0x3a142a[_0xef22('0x94')](_0x141cd8['offset']);}return db[_0xef22('0x6d')][_0xef22('0x6e')](_0x3a142a['toString'](),_0x386f42);})['then'](function(_0x172624){_0x49a100=_0x172624;var _0x46bae1=getUsersQuery(_0x266cc0,_0x49a100);return db[_0xef22('0x6d')]['query'](_0x46bae1[_0xef22('0x6f')](),_0x386f42);})[_0xef22('0x58')](function(_0x40e5df){_0x5b4e83=_[_0xef22('0x95')](_0x40e5df,_0x4e5123);if(_0x266cc0===_0xef22('0x29')){return db[_0xef22('0x96')]['findOne']({'attributes':[_0xef22('0x97')],'raw':!![]});}})[_0xef22('0x58')](function(_0x1b7441){var _0x50cb2a=_0x1b7441?_0x1b7441[_0xef22('0x97')]:undefined;var _0x223c2a=_0x49a100['map'](function(_0x1245b1){return updateInteraction(_0x1245b1,_0x3d377e,_0x5b4e83,_0x50cb2a);});return Promise[_0xef22('0x98')](_0x223c2a);});}function countFilteredInteractions(_0x1572d7,_0x5c8316){var _0x5cadc0=_0x1572d7[_0xef22('0x99')]();_0x5cadc0[_0xef22('0xb')](_0xef22('0x9a'));_0x5cadc0[_0xef22('0xb')](_0xef22('0x72'),_0xef22('0x3b'));var _0x3455b6=utils[_0xef22('0x1f')](_0x5c8316);if(!_[_0xef22('0x9b')](_0x3455b6)){_0x5cadc0['where'](_0xef22('0x9c'),_0x3455b6);}var _0x5b8e73={'type':db[_0xef22('0x6a')][_0xef22('0x6b')][_0xef22('0x6c')],'raw':!![]};return db[_0xef22('0x6d')][_0xef22('0x6e')](_0x5cadc0[_0xef22('0x6f')](),_0x5b8e73);}module[_0xef22('0x9d')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0x0e74=['operator','$substring','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','contact','Tag','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','getAccountFK','keys','some','compact','createdAt','parse','$gte','null','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','read','tag','filter','get','capitalize','Accounts','\x20IS\x20NOT\x20NULL','i.thirdDisposition','i.secondDisposition','i.disposition','i.substatus','closed','shift','CONCAT_WS(\x27\x27,\x20','join','Interaction','query','toString','merge','attributes','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.subject','i.ContactId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','limit','offset','sequelize','groupBy','Setting','findOne','enableEmailPreview','all','clone','isEmpty','Sequelize','QueryTypes','SELECT','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','./update-interaction','updateInteraction','./utils','../../mysqldb','role','agent','search','select','field','name','color','from','tools_tags','getInteractionFK','user_has_','_interactions','u.id','u.fullname','left_join','users','u.id\x20=\x20ui.UserId','length','where','ui.','\x20IN\x20?','map','getInteractionsTables','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','accounts','a.id\x20=\x20i.','messages','me.','it.','\x20=\x20i.id','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','unreadMessages\x20{OPERATOR}\x200','replace','{OPERATOR}','isNumeric','whatsapp','i.phone\x20LIKE\x20?','fax','i.fax\x20LIKE\x20?','openchannel','mail','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','sqlOperator','conditions','find','buildExpression','type','default','text','value','start','end','unreadMessages','and','Contact'];(function(_0x463458,_0xf3b666){var _0x58e404=function(_0x465693){while(--_0x465693){_0x463458['push'](_0x463458['shift']());}};_0x58e404(++_0xf3b666);}(_0x0e74,0xff));var _0x40e7=function(_0x5b8736,_0x348588){_0x5b8736=_0x5b8736-0x0;var _0x4dfe79=_0x0e74[_0x5b8736];return _0x4dfe79;};'use strict';var _=require(_0x40e7('0x0'));var squel=require(_0x40e7('0x1'));var as=require(_0x40e7('0x2'));var qs=require(_0x40e7('0x3'));var updateInteraction=require(_0x40e7('0x4'))[_0x40e7('0x5')];var utils=require(_0x40e7('0x6'));var db=require(_0x40e7('0x7'))['db'];function skipInteractionsQuery(_0x107c0a,_0x4faef3,_0x2d46d8){var _0x1dea8c=![];var _0xcaec44=utils['getAccountFK'](_0x107c0a);if(_0x4faef3[_0x40e7('0x8')]===_0x40e7('0x9')&&!_0x2d46d8[_0x40e7('0xa')]&&!_0x2d46d8[_0xcaec44]){_0x1dea8c=!![];}return _0x1dea8c;}function getTagsQuery(){return squel[_0x40e7('0xb')]()[_0x40e7('0xc')]('id')[_0x40e7('0xc')](_0x40e7('0xd'))['field'](_0x40e7('0xe'))[_0x40e7('0xf')](_0x40e7('0x10'));}function getUsersQuery(_0x1315e6,_0x786add){var _0x2d67c7=utils[_0x40e7('0x11')](_0x1315e6);var _0x4e0bbf=_0x40e7('0x12')+_0x1315e6+_0x40e7('0x13');var _0x5e77b3=squel[_0x40e7('0xb')]()[_0x40e7('0xc')](_0x40e7('0x14'))[_0x40e7('0xc')](_0x40e7('0x15'))['field']('ui.'+_0x2d67c7)[_0x40e7('0xf')](_0x4e0bbf,'ui')[_0x40e7('0x16')](_0x40e7('0x17'),'u',_0x40e7('0x18'));if(_0x786add[_0x40e7('0x19')]>0x0){_0x5e77b3[_0x40e7('0x1a')](_0x40e7('0x1b')+_0x2d67c7+_0x40e7('0x1c'),_[_0x40e7('0x1d')](_0x786add,'id'));}return _0x5e77b3;}function getInteractionsQuery(_0x1a44a1){var _0x1d3aa3=utils[_0x40e7('0x1e')](_0x1a44a1);var _0x45044b=utils['getAccountFK'](_0x1a44a1);var _0x1774f5=utils['getInteractionFK'](_0x1a44a1);return squel['select']()[_0x40e7('0xf')](_0x1d3aa3['interactions'],'i')[_0x40e7('0x16')](_0x40e7('0x1f'),'c',_0x40e7('0x20'))[_0x40e7('0x16')](_0x40e7('0x17'),'o',_0x40e7('0x21'))['left_join'](_0x1d3aa3[_0x40e7('0x22')],'a',_0x40e7('0x23')+_0x45044b)[_0x40e7('0x16')](_0x1d3aa3[_0x40e7('0x24')],'me',_0x40e7('0x25')+_0x1774f5+'\x20=\x20i.id')[_0x40e7('0x16')](_0x1d3aa3['interactionsTags'],'it',_0x40e7('0x26')+_0x1774f5+_0x40e7('0x27'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');}function getSqlClauses(){var _0x259252={'body':squel[_0x40e7('0x28')](),'contact':squel[_0x40e7('0x28')](),'default':squel[_0x40e7('0x28')](),'fields':squel[_0x40e7('0x28')](),'filter':squel[_0x40e7('0x28')](),'read':squel['expr'](),'tags':{'clause':squel[_0x40e7('0x28')](),'ids':null},'user':squel[_0x40e7('0x28')]()};return _0x259252;}function parseTagParameter(_0x5bd9e0){var _0x2df4a7=squel['expr']();if(_0x5bd9e0){var _0x1c1870=utils[_0x40e7('0x29')](_0x5bd9e0);_0x1c1870[_0x40e7('0x2a')](function(_0x1d49a0){_0x2df4a7['or'](_0x40e7('0x2b'),'%,'+_0x1d49a0+',%');});}return _0x2df4a7;}function parseReadParameter(_0x371987){var _0x167d87='';if(_0x371987){_0x167d87=_0x40e7('0x2c');if(_0x371987==='1'){_0x167d87=_0x167d87[_0x40e7('0x2d')](_0x40e7('0x2e'),'=');}else{_0x167d87=_0x167d87[_0x40e7('0x2d')](_0x40e7('0x2e'),'>');}}return _0x167d87;}function parseSearchFilter(_0x3d8cb2,_0x191972){var _0x3f11c7=squel[_0x40e7('0x28')]();if(_0x191972){var _0x574759=_0x191972[_0x40e7('0x2d')]('\x5c','\x5c\x5c')[_0x40e7('0x2d')](/'/g,'\x27\x27');if(qs[_0x40e7('0x2f')](_0x574759)){_0x3f11c7['or']('i.id\x20LIKE\x20?',_0x574759+'%');if(['sms',_0x40e7('0x30')]['includes'](_0x3d8cb2)){_0x3f11c7['or'](_0x40e7('0x31'),_0x574759+'%');}else if(_0x3d8cb2===_0x40e7('0x32')){_0x3f11c7['or'](_0x40e7('0x33'),_0x574759+'%');}else if(_0x3d8cb2===_0x40e7('0x34')){_0x3f11c7['or']('i.from\x20LIKE\x20?',_0x574759+'%');}}else if(_0x3d8cb2===_0x40e7('0x35')&&qs[_0x40e7('0x36')](_0x574759)){_0x3f11c7['or'](_0x40e7('0x37'),_0x574759+'%');}else{if(_0x3d8cb2==='mail'){_0x3f11c7['or'](_0x40e7('0x38'),qs[_0x40e7('0x39')](_0x574759,!![]))['or'](_0x40e7('0x3a'),qs[_0x40e7('0x39')](_0x574759));}else if(_0x3d8cb2!==_0x40e7('0x32')){_0x3f11c7['or'](_0x40e7('0x3b'),qs[_0x40e7('0x39')](_0x574759));}_0x3f11c7['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x40e7('0x39')](_0x574759,!![]),null);}}return _0x3f11c7;}function parseAdvancedSearchFilter(_0x52ea59,_0x22836b){var _0x1d9b78=getSqlClauses();var _0x497e33=as['parseSearch'](_0x52ea59);var _0x3c3339=_0x497e33[_0x40e7('0x3c')];for(var _0xc72380=0x0;_0xc72380<_0x497e33[_0x40e7('0x3d')][_0x40e7('0x19')];_0xc72380++){var _0x493121=_0x497e33[_0x40e7('0x3d')][_0xc72380];var _0x33a215='i';var _0x4d8326=_[_0x40e7('0x3e')](_0x22836b,[_0x40e7('0xd'),_0x493121[_0x40e7('0xc')]]);if(_0x4d8326){var _0x7a5cad=as[_0x40e7('0x3f')](_0x33a215,_0x4d8326[_0x40e7('0x40')],_0x493121);_0x1d9b78[_0x40e7('0x41')][_0x3c3339](_0x7a5cad[_0x40e7('0x42')],_0x7a5cad[_0x40e7('0x43')][_0x40e7('0x44')],_0x7a5cad['value'][_0x40e7('0x45')]);}else{switch(_0x493121[_0x40e7('0xc')]){case _0x40e7('0x46'):var _0x2805ff=parseReadParameter(_0x493121[_0x40e7('0x43')]);_0x1d9b78['read'][_0x40e7('0x47')](_0x2805ff);break;case _0x40e7('0x48'):if(_0x493121[_0x40e7('0x49')]===_0x40e7('0x4a')){if(_0x493121['value'][_0x40e7('0x4b')]('\x20')['length']>0x1){_0x1d9b78['contact'][_0x3c3339](_0x40e7('0x4c'),qs['getFullTextValue'](_0x493121[_0x40e7('0x43')],!![]),null);}else{var _0x5d6dc6='%'+_0x493121['value']+'%';_0x1d9b78['contact'][_0x3c3339](_0x40e7('0x4d'),_0x5d6dc6,_0x5d6dc6,_0x5d6dc6);}}else{_0x4d8326=_[_0x40e7('0x3e')](_0x22836b,[_0x40e7('0xd'),'ContactId']);_0x493121[_0x40e7('0xc')]=_0x40e7('0x4e');_0x7a5cad=as[_0x40e7('0x3f')](_0x33a215,_0x4d8326[_0x40e7('0x40')],_0x493121);_0x1d9b78[_0x40e7('0x4f')][_0x3c3339](_0x7a5cad[_0x40e7('0x42')],_0x7a5cad[_0x40e7('0x43')]['start'],_0x7a5cad[_0x40e7('0x43')][_0x40e7('0x45')]);}break;case _0x40e7('0x50'):var _0x3fa559=_0x493121['value'][_0x40e7('0x4b')](',')['map'](function(_0x4a2300){return Number(_0x4a2300);});var _0x428bbd=parseTagParameter(_0x3fa559);_0x1d9b78[_0x40e7('0x51')][_0x40e7('0x52')][_0x40e7('0x47')](_0x428bbd);_0x1d9b78[_0x40e7('0x51')][_0x40e7('0x53')]=_0x3fa559;break;case _0x40e7('0x54'):if(_0x493121[_0x40e7('0x49')]==='$substring'){_0x1d9b78[_0x40e7('0x55')][_0x3c3339](_0x40e7('0x56'),'%'+_0x493121[_0x40e7('0x43')]+'%',null);}else{_0x4d8326=_[_0x40e7('0x3e')](_0x22836b,[_0x40e7('0xd'),_0x40e7('0x57')]);_0x493121[_0x40e7('0xc')]=_0x40e7('0x57');_0x7a5cad=as[_0x40e7('0x3f')](_0x33a215,_0x4d8326[_0x40e7('0x40')],_0x493121);_0x1d9b78[_0x40e7('0x55')][_0x3c3339](_0x7a5cad[_0x40e7('0x42')],_0x7a5cad[_0x40e7('0x43')]['start'],_0x7a5cad[_0x40e7('0x43')][_0x40e7('0x45')]);}break;case _0x40e7('0x58'):case'plainBody':_0x7a5cad=as[_0x40e7('0x3f')]('me',null,_0x493121);_0x1d9b78['body'][_0x3c3339](_0x7a5cad[_0x40e7('0x42')],_0x7a5cad[_0x40e7('0x43')][_0x40e7('0x44')],_0x7a5cad['value'][_0x40e7('0x45')]);break;}}}return _0x1d9b78;}function parseModelFields(_0x280957,_0x46966b,_0x26b3d4){var _0x5f2d52=utils[_0x40e7('0x59')](_0x280957);var _0x48e832=squel[_0x40e7('0x28')]();var _0x10554a=_(_0x46966b)[_0x40e7('0x5a')]()[_0x40e7('0x1d')](function(_0x34448d){return _[_0x40e7('0x5b')](_0x26b3d4,['name',_0x34448d])?_0x34448d:undefined;})[_0x40e7('0x5c')]()[_0x40e7('0x43')]();if(_0x10554a[_0x40e7('0x19')]>0x0){_0x10554a[_0x40e7('0x2a')](function(_0x3dbc81){if(_0x3dbc81===_0x5f2d52){_0x48e832[_0x40e7('0x47')]('i.'+_0x5f2d52+_0x40e7('0x1c'),[]['concat'](_0x46966b[_0x3dbc81]));}else if(_0x3dbc81===_0x40e7('0x5d')){var _0x306113=JSON[_0x40e7('0x5e')](_0x46966b[_0x3dbc81])[_0x40e7('0x5f')];var _0x4a1ae5=JSON[_0x40e7('0x5e')](_0x46966b[_0x3dbc81])['$lte'];_0x48e832['and']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x306113,_0x4a1ae5);}else{if(_0x46966b[_0x3dbc81]===_0x40e7('0x60')){_0x48e832[_0x40e7('0x47')]('i.'+_0x3dbc81+_0x40e7('0x61'));}else{_0x48e832[_0x40e7('0x47')]('i.'+_0x3dbc81+_0x40e7('0x62'),_0x46966b[_0x3dbc81]);}}});}return _0x48e832;}function parseQueryParameters(_0x3e3040,_0x177581,_0x2372ee){var _0x104642=getSqlClauses();return Promise[_0x40e7('0x63')]()[_0x40e7('0x64')](function(){return parseModelFields(_0x3e3040,_0x177581,_0x2372ee);})[_0x40e7('0x64')](function(_0xb3c878){_0x104642[_0x40e7('0x65')][_0x40e7('0x47')](_0xb3c878);return parseReadParameter(_0x177581[_0x40e7('0x66')]);})[_0x40e7('0x64')](function(_0x175fbf){_0x104642[_0x40e7('0x66')][_0x40e7('0x47')](_0x175fbf);return parseTagParameter(_0x177581[_0x40e7('0x67')]);})[_0x40e7('0x64')](function(_0x30e0eb){_0x104642[_0x40e7('0x51')]['clause'][_0x40e7('0x47')](_0x30e0eb);return parseSearchFilter(_0x3e3040,_0x177581[_0x40e7('0x68')]);})['then'](function(_0x1453b3){_0x104642[_0x40e7('0x68')]=_0x1453b3;return _0x104642;});}function checkAccountsRestrictions(_0x3f0f58,_0x3b3e6f,_0x271cd3){var _0x3c62e8=utils['getAccountFK'](_0x3f0f58);var _0x2f4e15=_0x40e7('0x69')+_[_0x40e7('0x6a')](_0x3f0f58)+(_0x3f0f58==='chat'?'Websites':_0x40e7('0x6b'));var _0x4da2ae=squel[_0x40e7('0x28')]();return Promise['resolve']()[_0x40e7('0x64')](function(){if(_0x271cd3[_0x40e7('0xa')]&&_0x3b3e6f['role']==='agent'){return _0x3b3e6f[_0x2f4e15]({'attributes':['id'],'raw':!![]});}})[_0x40e7('0x64')](function(_0x2fbb88){if(_0x2fbb88){if(_0x2fbb88[_0x40e7('0x19')]===0x0){_0x4da2ae[_0x40e7('0x47')]('i.'+_0x3c62e8+_0x40e7('0x61'));}else{_0x4da2ae[_0x40e7('0x47')]('i.'+_0x3c62e8+_0x40e7('0x1c'),_[_0x40e7('0x1d')](_0x2fbb88,'id'));}}else if(!_0x271cd3[_0x3c62e8]){_0x4da2ae['and']('i.'+_0x3c62e8+_0x40e7('0x6c'));}})[_0x40e7('0x64')](function(){return _0x4da2ae;});}function getClosedOrderClause(_0x25257f,_0x11bcc5){var _0x4ca4e9='';var _0x582040=[_0x40e7('0x6d'),_0x40e7('0x6e'),_0x40e7('0x6f')];if(_0x25257f===_0x40e7('0x35')){_0x582040['unshift'](_0x40e7('0x70'));}if(_0x11bcc5[_0x40e7('0x71')]==='0'&&_0x25257f===_0x40e7('0x35')){_0x4ca4e9=_0x40e7('0x70');}else{if(_0x11bcc5[_0x40e7('0x71')]==='1'){_0x582040[_0x40e7('0x72')]();}_0x4ca4e9=_0x40e7('0x73')+_0x582040[_0x40e7('0x74')](',\x20')+')';}return _0x4ca4e9;}function getFilteredInteractions(_0x21ad52,_0x3d9786,_0x383549,_0x3450c5){var _0x1afcad=utils[_0x40e7('0x11')](_0x21ad52);var _0xdeb9=_[_0x40e7('0x6a')](_0x21ad52)+_0x40e7('0x75');var _0x46c46c=[];var _0x484f47=getTagsQuery();var _0xe288b0={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x4941c2=[];var _0x412dd0=[];return db['sequelize'][_0x40e7('0x76')](_0x484f47[_0x40e7('0x77')](),_0xe288b0)[_0x40e7('0x64')](function(_0x32f3b6){_0x46c46c=_['keyBy'](_0x32f3b6,'id');_0xe288b0=_[_0x40e7('0x78')](_0xe288b0,{'model':db[_0xdeb9],'mapToModel':!![],'nest':!![]});if(_0x383549['fields']){_0x3450c5[_0x40e7('0x79')]['forEach'](function(_0x228d23){_0x3d9786[_0x40e7('0xc')]('i.'+_0x228d23);});}else{_0x3d9786[_0x40e7('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3d9786['field'](_0x40e7('0x7a'),_0x40e7('0x7b'));_0x3d9786['field'](_0x40e7('0x7c'),_0x40e7('0x7d'));if(_0x21ad52===_0x40e7('0x35')){_0x3d9786[_0x40e7('0xc')]('a.email',_0x40e7('0x7e'));_0x3d9786['field'](_0x40e7('0x7f'),_0x40e7('0x80'));_0x3d9786[_0x40e7('0xc')]('i.id');_0x3d9786[_0x40e7('0xc')](_0x40e7('0x81'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x82'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x83'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x84'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x85'));_0x3d9786['field'](_0x40e7('0x86'));_0x3d9786[_0x40e7('0xc')]('i.lastMsgDirection');_0x3d9786[_0x40e7('0xc')](_0x40e7('0x87'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x6f'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x6e'));_0x3d9786['field'](_0x40e7('0x6d'));_0x3d9786['field'](_0x40e7('0x70'));_0x3d9786[_0x40e7('0xc')]('i.to');_0x3d9786[_0x40e7('0xc')](_0x40e7('0x88'));_0x3d9786['field']('i.MailAccountId');_0x3d9786[_0x40e7('0xc')]('i.UserId');}else if(_0x21ad52===_0x40e7('0x34')){_0x3d9786[_0x40e7('0xc')](_0x40e7('0x89'),_0x40e7('0x80'));}else{_0x3d9786[_0x40e7('0xc')]('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');}if(_0x21ad52!==_0x40e7('0x35')){_0x3d9786['field'](_0x40e7('0x8a'));}_0x3d9786[_0x40e7('0xc')](_0x40e7('0x8b'),_0x40e7('0x8c'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x8d'),'Contact.lastName');_0x3d9786['field'](_0x40e7('0x8e'),_0x40e7('0x8f'));_0x3d9786[_0x40e7('0xc')]('c.phone',_0x40e7('0x90'));_0x3d9786[_0x40e7('0xc')]('c.mobile',_0x40e7('0x91'));_0x3d9786[_0x40e7('0xc')]('c.fax','Contact.fax');_0x3d9786['field'](_0x40e7('0x92'),_0x40e7('0x93'));_0x3d9786[_0x40e7('0xc')](_0x40e7('0x94'),_0x40e7('0x95'));_0x3d9786[_0x40e7('0xc')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x3450c5[_0x40e7('0x96')]){_0x3d9786['limit'](_0x3450c5[_0x40e7('0x96')]);}if(_0x3450c5[_0x40e7('0x97')]){_0x3d9786[_0x40e7('0x97')](_0x3450c5[_0x40e7('0x97')]);}return db[_0x40e7('0x98')][_0x40e7('0x76')](_0x3d9786[_0x40e7('0x77')](),_0xe288b0);})[_0x40e7('0x64')](function(_0x492dc8){_0x4941c2=_0x492dc8;var _0x3ff287=getUsersQuery(_0x21ad52,_0x4941c2);return db[_0x40e7('0x98')][_0x40e7('0x76')](_0x3ff287[_0x40e7('0x77')](),_0xe288b0);})['then'](function(_0x13abdb){_0x412dd0=_[_0x40e7('0x99')](_0x13abdb,_0x1afcad);if(_0x21ad52===_0x40e7('0x35')){return db[_0x40e7('0x9a')][_0x40e7('0x9b')]({'attributes':[_0x40e7('0x9c')],'raw':!![]});}})[_0x40e7('0x64')](function(_0x2449c5){var _0x58a082=_0x2449c5?_0x2449c5['enableEmailPreview']:undefined;var _0xb85463=_0x4941c2[_0x40e7('0x1d')](function(_0xd54672){return updateInteraction(_0xd54672,_0x46c46c,_0x412dd0,_0x58a082);});return Promise[_0x40e7('0x9d')](_0xb85463);});}function countFilteredInteractions(_0x346eea,_0x1ad91d){var _0x414e32=_0x346eea[_0x40e7('0x9e')]();_0x414e32[_0x40e7('0xc')]('COUNT(*)');_0x414e32[_0x40e7('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x40e7('0x46'));var _0x264789=utils[_0x40e7('0x29')](_0x1ad91d);if(!_[_0x40e7('0x9f')](_0x264789)){_0x414e32[_0x40e7('0x1a')]('t.id\x20IN\x20?',_0x264789);}var _0x36598e={'type':db[_0x40e7('0xa0')][_0x40e7('0xa1')][_0x40e7('0xa2')],'raw':!![]};return db['sequelize']['query'](_0x414e32[_0x40e7('0x77')](),_0x36598e);}module[_0x40e7('0xa3')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 96864b8..de010ad 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c44=['MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','then','Users','TagIds','Tags','catch','fullname','split','forEach','waiting','talking','answered','unmanaged','abandoned','total','closed','disposition','UserId'];(function(_0x374714,_0x5503a2){var _0x398a37=function(_0x39a431){while(--_0x39a431){_0x374714['push'](_0x374714['shift']());}};_0x398a37(++_0x5503a2);}(_0x5c44,0xfc));var _0x45c4=function(_0x230d8b,_0x4db6a8){_0x230d8b=_0x230d8b-0x0;var _0x4bea06=_0x5c44[_0x230d8b];return _0x4bea06;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x497f7f,_0x5e2df0){return new Promise(function(_0x17534b,_0x4695a6){try{var _0xd18125=[];if(_0x5e2df0[_0x497f7f]){_0xd18125=_0x5e2df0[_0x497f7f]['map'](function(_0x22f919){return{'id':_0x22f919['id'],'fullname':_0x22f919[_0x45c4('0x0')]};});}return _0x17534b(_0xd18125);}catch(_0x413c88){_0x4695a6(_0x413c88);}});}function getInteractionTags(_0x1028ad,_0x2cf5bb){var _0x174d1e=[];if(_0x1028ad){_0x1028ad[_0x45c4('0x1')](',')[_0x45c4('0x2')](function(_0x4de4ad){_0x174d1e['push'](_0x2cf5bb[_0x4de4ad]);});}return _0x174d1e;}function updateWaitingCounter(_0x72704d){if(_0x72704d[_0x45c4('0x3')]){_0x72704d[_0x45c4('0x3')]-=0x1;}}function updateInteractionCounters(_0x1cfac9){_0x1cfac9[_0x45c4('0x3')]=0x0;_0x1cfac9[_0x45c4('0x4')]=0x0;_0x1cfac9[_0x45c4('0x5')]=0x0;_0x1cfac9[_0x45c4('0x6')]=0x0;_0x1cfac9[_0x45c4('0x7')]=0x0;_0x1cfac9[_0x45c4('0x8')]=0x0;if(_0x1cfac9[_0x45c4('0x9')]){if(_0x1cfac9[_0x45c4('0xa')]==='abandoned'){_0x1cfac9[_0x45c4('0x7')]+=0x1;updateWaitingCounter(_0x1cfac9);}if(_0x1cfac9[_0x45c4('0xb')]){_0x1cfac9[_0x45c4('0x5')]+=0x1;if(_0x1cfac9[_0x45c4('0x4')]){_0x1cfac9[_0x45c4('0x4')]-=0x1;}}else{if(_0x1cfac9[_0x45c4('0xa')]){_0x1cfac9[_0x45c4('0x6')]+=0x1;updateWaitingCounter(_0x1cfac9);}}}else{if(!_0x1cfac9['UserId']){_0x1cfac9['waiting']+=0x1;}if(_0x1cfac9[_0x45c4('0xb')]){_0x1cfac9[_0x45c4('0x4')]+=0x1;updateWaitingCounter(_0x1cfac9);}}_0x1cfac9['total']+=0x1;return _0x1cfac9;}function getLastMessageText(_0x4404ee){return db[_0x45c4('0xc')][_0x45c4('0xd')]({'where':{'$and':[{'MailInteractionId':_0x4404ee['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x45c4('0xe')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x45c4('0xf'),'raw':!![]})['then'](function(_0x4e71d3){if(_0x4e71d3&&_0x4e71d3[_0x45c4('0x10')]){_0x4404ee[_0x45c4('0x11')]=_[_0x45c4('0x12')](_0x4e71d3[_0x45c4('0x10')]);}return _0x4404ee;})['catch'](function(_0x19643f){throw _0x19643f;});}exports['updateInteraction']=function(_0x4d7183,_0x3c76be,_0x5a2b9d,_0x3f328e){return new Promise(function(_0x24e1da,_0xef4932){return getInteractionUsers(_0x4d7183['id'],_0x5a2b9d)[_0x45c4('0x13')](function(_0x24e419){_0x4d7183[_0x45c4('0x14')]=_0x24e419;return getInteractionTags(_0x4d7183[_0x45c4('0x15')],_0x3c76be);})['then'](function(_0x3007b6){_0x4d7183[_0x45c4('0x16')]=_0x3007b6;delete _0x4d7183[_0x45c4('0x15')];return updateInteractionCounters(_0x4d7183);})['then'](function(_0x291bf0){if(_0x3f328e){return getLastMessageText(_0x291bf0);}else{return _0x291bf0;}})[_0x45c4('0x13')](function(_0x34e44b){_0x24e1da(_0x34e44b);})[_0x45c4('0x17')](function(_0x58046a){_0xef4932(_0x58046a);});});}; \ No newline at end of file +var _0x8bd0=['waiting','unmanaged','disposition','abandoned','UserId','answered','talking','total','findOne','plainBody','-id','then','lastMsgText','trimStart','catch','updateInteraction','Users','TagIds','lodash','map','fullname','split','forEach','push'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8bd0,0x132));var _0x08bd=function(_0x3880a9,_0xff5b2c){_0x3880a9=_0x3880a9-0x0;var _0x23f9d7=_0x8bd0[_0x3880a9];return _0x23f9d7;};'use strict';var _=require(_0x08bd('0x0'));var db=require('../../mysqldb')['db'];function getInteractionUsers(_0x21c850,_0x1ee8fc){return new Promise(function(_0x583593,_0x4e565e){try{var _0x3863b3=[];if(_0x1ee8fc[_0x21c850]){_0x3863b3=_0x1ee8fc[_0x21c850][_0x08bd('0x1')](function(_0x5517bc){return{'id':_0x5517bc['id'],'fullname':_0x5517bc[_0x08bd('0x2')]};});}return _0x583593(_0x3863b3);}catch(_0xd878e){_0x4e565e(_0xd878e);}});}function getInteractionTags(_0x2b9be1,_0x8f500a){var _0x3fc4fe=[];if(_0x2b9be1){_0x2b9be1[_0x08bd('0x3')](',')[_0x08bd('0x4')](function(_0x49801f){_0x3fc4fe[_0x08bd('0x5')](_0x8f500a[_0x49801f]);});}return _0x3fc4fe;}function updateWaitingCounter(_0xd194cd){if(_0xd194cd['waiting']){_0xd194cd[_0x08bd('0x6')]-=0x1;}}function updateInteractionCounters(_0xdebd39){_0xdebd39[_0x08bd('0x6')]=0x0;_0xdebd39['talking']=0x0;_0xdebd39['answered']=0x0;_0xdebd39[_0x08bd('0x7')]=0x0;_0xdebd39['abandoned']=0x0;_0xdebd39['total']=0x0;if(_0xdebd39['closed']){if(_0xdebd39[_0x08bd('0x8')]===_0x08bd('0x9')){_0xdebd39[_0x08bd('0x9')]+=0x1;updateWaitingCounter(_0xdebd39);}if(_0xdebd39[_0x08bd('0xa')]){_0xdebd39[_0x08bd('0xb')]+=0x1;if(_0xdebd39['talking']){_0xdebd39['talking']-=0x1;}}else{if(_0xdebd39[_0x08bd('0x8')]){_0xdebd39[_0x08bd('0x7')]+=0x1;updateWaitingCounter(_0xdebd39);}}}else{if(!_0xdebd39[_0x08bd('0xa')]){_0xdebd39[_0x08bd('0x6')]+=0x1;}if(_0xdebd39[_0x08bd('0xa')]){_0xdebd39[_0x08bd('0xc')]+=0x1;updateWaitingCounter(_0xdebd39);}}_0xdebd39[_0x08bd('0xd')]+=0x1;return _0xdebd39;}function getLastMessageText(_0x37daf0){return db['MailMessage'][_0x08bd('0xe')]({'where':{'$and':[{'MailInteractionId':_0x37daf0['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x08bd('0xf')],'order':_0x08bd('0x10'),'raw':!![]})[_0x08bd('0x11')](function(_0x551596){if(_0x551596&&_0x551596[_0x08bd('0xf')]){_0x37daf0[_0x08bd('0x12')]=_[_0x08bd('0x13')](_0x551596[_0x08bd('0xf')]);}return _0x37daf0;})[_0x08bd('0x14')](function(_0x307f4e){throw _0x307f4e;});}exports[_0x08bd('0x15')]=function(_0x5cba3c,_0x2c19c6,_0x3bc0ec,_0x549e3c){return new Promise(function(_0x10aead,_0x39fb7d){return getInteractionUsers(_0x5cba3c['id'],_0x3bc0ec)[_0x08bd('0x11')](function(_0x505818){_0x5cba3c[_0x08bd('0x16')]=_0x505818;return getInteractionTags(_0x5cba3c[_0x08bd('0x17')],_0x2c19c6);})[_0x08bd('0x11')](function(_0x55fc8){_0x5cba3c['Tags']=_0x55fc8;delete _0x5cba3c['TagIds'];return updateInteractionCounters(_0x5cba3c);})[_0x08bd('0x11')](function(_0x3330c0){if(_0x549e3c){return getLastMessageText(_0x3330c0);}else{return _0x3330c0;}})[_0x08bd('0x11')](function(_0x531374){_0x10aead(_0x531374);})[_0x08bd('0x14')](function(_0xae09e1){_0x39fb7d(_0xae09e1);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 9ca5688..eb466aa 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x72f5=['[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','Account','InteractionId','upperFirst','chat','websites','accounts','_interactions','_interaction_has_tags','user_has_','isArray','toLowerCase'];(function(_0x2170e4,_0x5b969e){var _0xec86f5=function(_0x44e53e){while(--_0x44e53e){_0x2170e4['push'](_0x2170e4['shift']());}};_0xec86f5(++_0x5b969e);}(_0x72f5,0x114));var _0x572f=function(_0x27da7e,_0x51bb5f){_0x27da7e=_0x27da7e-0x0;var _0x2dcfc8=_0x72f5[_0x27da7e];return _0x2dcfc8;};'use strict';var _=require(_0x572f('0x0'));var db=require(_0x572f('0x1'))['db'];var loggers={'openchannel':require(_0x572f('0x2'))(_0x572f('0x3')),'mail':require(_0x572f('0x2'))(_0x572f('0x4')),'fax':require(_0x572f('0x2'))(_0x572f('0x5')),'sms':require(_0x572f('0x2'))(_0x572f('0x6')),'chat':require('../../config/logger')(_0x572f('0x7')),'whatsapp':require(_0x572f('0x2'))(_0x572f('0x8'))};function getAccountFK(_0x37db83){return _[_0x572f('0x9')](_0x37db83)+(_0x37db83==='chat'?'Website':_0x572f('0xa'))+'Id';}function getInteractionFK(_0x16050d){return _[_0x572f('0x9')](_0x16050d)+_0x572f('0xb');}function getInteractionId(_0x83ee15,_0x366427,_0x3911f3){if(_0x83ee15&&_0x83ee15[_[_0x572f('0xc')](_0x3911f3)+_0x572f('0xb')]){return _0x83ee15[_[_0x572f('0xc')](_0x3911f3)+_0x572f('0xb')];}else if(_0x83ee15&&_0x83ee15['id']){return _0x83ee15['id'];}else if(_0x366427&&_0x366427['id']){return _0x366427['id'];}else{return'unknown';}}function getInteractionsTables(_0x196981){return{'accounts':_0x196981+'_'+(_0x196981===_0x572f('0xd')?_0x572f('0xe'):_0x572f('0xf')),'interactions':_0x196981+_0x572f('0x10'),'interactionsTags':_0x196981+_0x572f('0x11'),'messages':_0x196981+'_messages','userInteractions':_0x572f('0x12')+_0x196981+_0x572f('0x10')};}function getSelectedTags(_0x1ff05b){var _0xcfe36e=[];if(_0x1ff05b){_0xcfe36e=Array[_0x572f('0x13')](_0x1ff05b)?_0x1ff05b:[_0x1ff05b];}return _0xcfe36e;}function log(_0x206bda,_0x5b2d0f,_0x32462f,_0x4aa215,_0x59b633,_0x515c4e){loggers[_0x59b633[_0x572f('0x14')]()][_0x206bda](_0x572f('0x15'),_0x515c4e[_0x572f('0x16')](),_0x5b2d0f?_0x5b2d0f['id']:null,_0x5b2d0f?_0x5b2d0f[_0x572f('0x17')]:null,_0x5b2d0f?_0x5b2d0f[_0x572f('0x18')]:null,getInteractionId(_0x32462f,_0x4aa215,_0x59b633),_0x32462f?JSON[_0x572f('0x19')](_0x32462f):_0x572f('0x1a'));}function updateUser(_0xec04ea,_0x55723c,_0x16364b,_0xb13e8d,_0x302e6d){db[_['upperFirst'](_0xb13e8d)+_0x572f('0x1b')][_0x572f('0x1c')]({'where':{'id':getInteractionId(_0x55723c,_0x16364b,_0xb13e8d)}})[_0x572f('0x1d')](function(_0x5d946b){if(_0x5d946b){return _0x5d946b['update']({'UserId':_0xec04ea?_0xec04ea['id']:null});}})[_0x572f('0x1d')](function(_0x221aa3){if(_0x221aa3){log('info',_0xec04ea,_0x55723c,_0x16364b,_0xb13e8d,_0x302e6d);}})[_0x572f('0x1e')](function(){log(_0x572f('0x1f'),_0xec04ea,_0x55723c,_0x16364b,_0xb13e8d,_0x302e6d);});}module[_0x572f('0x20')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x93b0=['InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','isArray','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','findOne','then','info','catch','error','exports','lodash','../../mysqldb','../../config/logger','openchannel-interactions','fax-interactions','sms-interactions','chat-interactions','whatsapp-interactions','capitalize','chat','Website','Account'];(function(_0x1df2fe,_0x494dd5){var _0x4ca0ed=function(_0x25d378){while(--_0x25d378){_0x1df2fe['push'](_0x1df2fe['shift']());}};_0x4ca0ed(++_0x494dd5);}(_0x93b0,0x148));var _0x093b=function(_0x47b48c,_0xf95a71){_0x47b48c=_0x47b48c-0x0;var _0x2d03ff=_0x93b0[_0x47b48c];return _0x2d03ff;};'use strict';var _=require(_0x093b('0x0'));var db=require(_0x093b('0x1'))['db'];var loggers={'openchannel':require(_0x093b('0x2'))(_0x093b('0x3')),'mail':require(_0x093b('0x2'))('mail-interactions'),'fax':require(_0x093b('0x2'))(_0x093b('0x4')),'sms':require('../../config/logger')(_0x093b('0x5')),'chat':require(_0x093b('0x2'))(_0x093b('0x6')),'whatsapp':require('../../config/logger')(_0x093b('0x7'))};function getAccountFK(_0xa6a4b2){return _[_0x093b('0x8')](_0xa6a4b2)+(_0xa6a4b2===_0x093b('0x9')?_0x093b('0xa'):_0x093b('0xb'))+'Id';}function getInteractionFK(_0x134498){return _['capitalize'](_0x134498)+_0x093b('0xc');}function getInteractionId(_0x169203,_0x5f4e7e,_0x5a5077){if(_0x169203&&_0x169203[_[_0x093b('0xd')](_0x5a5077)+_0x093b('0xc')]){return _0x169203[_[_0x093b('0xd')](_0x5a5077)+_0x093b('0xc')];}else if(_0x169203&&_0x169203['id']){return _0x169203['id'];}else if(_0x5f4e7e&&_0x5f4e7e['id']){return _0x5f4e7e['id'];}else{return _0x093b('0xe');}}function getInteractionsTables(_0x5b37fc){return{'accounts':_0x5b37fc+'_'+(_0x5b37fc===_0x093b('0x9')?_0x093b('0xf'):_0x093b('0x10')),'interactions':_0x5b37fc+_0x093b('0x11'),'interactionsTags':_0x5b37fc+_0x093b('0x12'),'messages':_0x5b37fc+_0x093b('0x13'),'userInteractions':_0x093b('0x14')+_0x5b37fc+_0x093b('0x11')};}function getSelectedTags(_0x3e7f6a){var _0x500e27=[];if(_0x3e7f6a){_0x500e27=Array[_0x093b('0x15')](_0x3e7f6a)?_0x3e7f6a:[_0x3e7f6a];}return _0x500e27;}function log(_0xe5dbfa,_0x407a44,_0x1e74d0,_0xb37825,_0x28192c,_0x280c8c){loggers[_0x28192c[_0x093b('0x16')]()][_0xe5dbfa](_0x093b('0x17'),_0x280c8c[_0x093b('0x18')](),_0x407a44?_0x407a44['id']:null,_0x407a44?_0x407a44[_0x093b('0x19')]:null,_0x407a44?_0x407a44[_0x093b('0x1a')]:null,getInteractionId(_0x1e74d0,_0xb37825,_0x28192c),_0x1e74d0?JSON[_0x093b('0x1b')](_0x1e74d0):'null');}function updateUser(_0x5a526b,_0x253605,_0x1735e5,_0x3a1e9b,_0xbe9ac7){db[_[_0x093b('0xd')](_0x3a1e9b)+'Interaction'][_0x093b('0x1c')]({'where':{'id':getInteractionId(_0x253605,_0x1735e5,_0x3a1e9b)}})[_0x093b('0x1d')](function(_0x4910f1){if(_0x4910f1){return _0x4910f1['update']({'UserId':_0x5a526b?_0x5a526b['id']:null});}})[_0x093b('0x1d')](function(_0x303051){if(_0x303051){log(_0x093b('0x1e'),_0x5a526b,_0x253605,_0x1735e5,_0x3a1e9b,_0xbe9ac7);}})[_0x093b('0x1f')](function(){log(_0x093b('0x20'),_0x5a526b,_0x253605,_0x1735e5,_0x3a1e9b,_0xbe9ac7);});}module[_0x093b('0x21')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 0e73fc6..dcff946 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 _0xa53f=['User','admin','user','isUserLimit','crypto','util','../../mysqldb','data1','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users'];(function(_0x36583a,_0xa5eb9){var _0x1bd4a1=function(_0x1de2c){while(--_0x1de2c){_0x36583a['push'](_0x36583a['shift']());}};_0x1bd4a1(++_0xa5eb9);}(_0xa53f,0xf7));var _0xfa53=function(_0x220eea,_0x3023eb){_0x220eea=_0x220eea-0x0;var _0x40c2c4=_0xa53f[_0x220eea];return _0x40c2c4;};'use strict';var crypto=require(_0xfa53('0x0'));var util=require(_0xfa53('0x1'));var compose=require('composable-middleware');var db=require(_0xfa53('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x2f9166,_0x23e7fb){if(_0x2f9166&&_0x23e7fb){if(_0x23e7fb[_0xfa53('0x3')]&&_0x23e7fb[_0xfa53('0x4')]){var _0x307221=_0x23e7fb[_0xfa53('0x3')];var _0xbd28cc=_0x23e7fb[_0xfa53('0x4')];var _0x482acb=_0x307221[_0xfa53('0x5')]('-')[0x4];var _0x541115=_0x307221[_0xfa53('0x5')]('-')[0x0];var _0x2eb9ae=crypto[_0xfa53('0x6')](_0xfa53('0x7'),util[_0xfa53('0x8')](_0xfa53('0x9'),_0x482acb,_0x307221,_0x541115));var _0x3dbbd5=_0x2eb9ae['update'](_0xbd28cc,'base64','utf8');_0x3dbbd5+=_0x2eb9ae[_0xfa53('0xa')]('utf8');var _0x5c9ea9=JSON[_0xfa53('0xb')](_0x3dbbd5);return _0x5c9ea9[_0xfa53('0xc')](_0x2f9166)?_0x5c9ea9[_0x2f9166]:null;}}return null;}function isLimit(_0x6ba58e,_0x432a67,_0x5cd38,_0x44ac5f){var _0x56b042=_0x432a67;return compose()[_0xfa53('0xd')](function(_0x1d7f31,_0x5bded2,_0x282a){return db[_0xfa53('0xe')][_0xfa53('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x1af2e3){var _0x274678=getValueFromLicense(_0x6ba58e,_0x1af2e3);return _0x274678?_0x274678:_0x56b042;})[_0xfa53('0x10')](function(_0x1d5588){_0x56b042=_0x1d5588;return _0x5cd38[_0xfa53('0x11')](_0x44ac5f);})[_0xfa53('0x10')](function(_0x3b93a6){if(_0x3b93a6>=_0x56b042){return _0x5bded2[_0xfa53('0x12')](0x193)[_0xfa53('0x13')]({'message':util[_0xfa53('0x8')](_0xfa53('0x14'),_0x6ba58e)});}_0x282a();})[_0xfa53('0x15')](function(_0x10dad7){_0x282a(_0x10dad7);});});}function isUserLimit(){return isLimit(_0xfa53('0x16'),0x1,db[_0xfa53('0x17')],{'where':{'$or':[{'role':_0xfa53('0x18')},{'role':_0xfa53('0x19')}]}});}exports[_0xfa53('0x1a')]=isUserLimit; \ No newline at end of file +var _0x27f4=['parse','hasOwnProperty','use','License','findOne','then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','isUserLimit','util','composable-middleware','license','data1','split','createDecipher','aes-256-ctr','%s:%s:%s','utf8'];(function(_0x9d2167,_0x87cfb6){var _0x9520ff=function(_0x33d37b){while(--_0x33d37b){_0x9d2167['push'](_0x9d2167['shift']());}};_0x9520ff(++_0x87cfb6);}(_0x27f4,0x87));var _0x427f=function(_0x582598,_0x311dc5){_0x582598=_0x582598-0x0;var _0x1de137=_0x27f4[_0x582598];return _0x1de137;};'use strict';var crypto=require('crypto');var util=require(_0x427f('0x0'));var compose=require(_0x427f('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');function getValueFromLicense(_0x225959,_0x2f0a81){if(_0x225959&&_0x2f0a81){if(_0x2f0a81['data1']&&_0x2f0a81[_0x427f('0x2')]){var _0x1c585c=_0x2f0a81[_0x427f('0x3')];var _0x20d011=_0x2f0a81['license'];var _0x50839c=_0x1c585c[_0x427f('0x4')]('-')[0x4];var _0x2db84d=_0x1c585c[_0x427f('0x4')]('-')[0x0];var _0xc9bda9=crypto[_0x427f('0x5')](_0x427f('0x6'),util['format'](_0x427f('0x7'),_0x50839c,_0x1c585c,_0x2db84d));var _0x3e635e=_0xc9bda9['update'](_0x20d011,'base64',_0x427f('0x8'));_0x3e635e+=_0xc9bda9['final'](_0x427f('0x8'));var _0x10a662=JSON[_0x427f('0x9')](_0x3e635e);return _0x10a662[_0x427f('0xa')](_0x225959)?_0x10a662[_0x225959]:null;}}return null;}function isLimit(_0x14a939,_0x50f87f,_0xe86d6c,_0x3910ce){var _0x565622=_0x50f87f;return compose()[_0x427f('0xb')](function(_0x163ea7,_0x124140,_0x51e27c){return db[_0x427f('0xc')][_0x427f('0xd')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3d6982){var _0x31194c=getValueFromLicense(_0x14a939,_0x3d6982);return _0x31194c?_0x31194c:_0x565622;})[_0x427f('0xe')](function(_0xf444f){_0x565622=_0xf444f;return _0xe86d6c[_0x427f('0xf')](_0x3910ce);})[_0x427f('0xe')](function(_0x340819){if(_0x340819>=_0x565622){return _0x124140['status'](0x193)[_0x427f('0x10')]({'message':util[_0x427f('0x11')](_0x427f('0x12'),_0x14a939)});}_0x51e27c();})[_0x427f('0x13')](function(_0x861300){_0x51e27c(_0x861300);});});}function isUserLimit(){return isLimit(_0x427f('0x14'),0x1,db[_0x427f('0x15')],{'where':{'$or':[{'role':_0x427f('0x16')},{'role':'user'}]}});}exports[_0x427f('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index dd961f7..bb6d389 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 _0xe23f=['<>\x20?','$substring','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','>\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','$startsWith','utcOffset','add','hours','moment','parseSearch','sqlOperator','startsWith','[$or]','replace','[$and]','split','forEach','shift','match','filter','indexOf','conditions','push','DATE','operator','value','includes','$lte','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','\x20OR\x20','\x20IS\x20NULL)','$in','$notIn','NOT\x20IN\x20?','$eq','=\x20?','$ne'];(function(_0x3a1d87,_0x503488){var _0x5973d2=function(_0x1bcdd7){while(--_0x1bcdd7){_0x3a1d87['push'](_0x3a1d87['shift']());}};_0x5973d2(++_0x503488);}(_0xe23f,0x11a));var _0xfe23=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe23f[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var moment=require(_0xfe23('0x0'));exports[_0xfe23('0x1')]=function(_0xe0e72a){var _0x4172f7={'conditions':[]};_0x4172f7[_0xfe23('0x2')]=_[_0xfe23('0x3')](_0xe0e72a,_0xfe23('0x4'))?'or':'and';var _0x1d2eab=_0xe0e72a[_0xfe23('0x5')](_0xfe23('0x6'),'')['replace'](_0xfe23('0x4'),'')[_0xfe23('0x7')]('||');for(var _0x27fb85=0x0;_0x27fb85<_0x1d2eab['length'];_0x27fb85++){var _0x285150=_0x1d2eab[_0x27fb85][_0xfe23('0x7')](':=');var _0x586992=_0x285150[0x0];var _0x143b83=_0x285150['slice'](0x1);_0x143b83[_0xfe23('0x8')](function(_0x4a7347){var _0x464db3=_0x4a7347['split']('[')[_0xfe23('0x9')]();var _0x537f7a=_0x4a7347[_0xfe23('0xa')](/\[(.*?)\]/g);_0x537f7a['forEach'](function(_0x48d3ee){var _0x20282a=_0x48d3ee[_0xfe23('0x7')]('[')[_0xfe23('0xb')](function(_0x92c447){return _0x92c447[_0xfe23('0xc')](']')>-0x1;})['map'](function(_0x2d9998){return _0x2d9998['split'](']')[0x0];})[0x0];_0x4172f7[_0xfe23('0xd')][_0xfe23('0xe')]({'field':_0x586992,'operator':_0x464db3,'value':_0x20282a});});});}return _0x4172f7;};exports['buildExpression']=function(_0x14caff,_0x18ab63,_0x14bee9){var _0x3834cb={};if(_0x18ab63===_0xfe23('0xf')){if(_0x14bee9[_0xfe23('0x10')]==='$eq'){_0x14bee9[_0xfe23('0x10')]='$between';_0x14bee9[_0xfe23('0x11')]+=','+_0x14bee9[_0xfe23('0x11')];}else if(_[_0xfe23('0x12')](['$gt',_0xfe23('0x13')],_0x14bee9[_0xfe23('0x10')])){_0x14bee9[_0xfe23('0x11')]=moment(_0x14bee9['value'])['add'](0x1,_0xfe23('0x14'))[_0xfe23('0x15')](_0xfe23('0x16'));}}if(_0x14bee9[_0xfe23('0x17')]){_0x18ab63=_0x14bee9['castTo'];_0x3834cb[_0xfe23('0x18')]=_0xfe23('0x19')+_0x14caff+'.'+_0x14bee9[_0xfe23('0x1a')]+_0xfe23('0x1b')+_0x14bee9[_0xfe23('0x17')]+')\x20'+parseOperator(_0x14bee9[_0xfe23('0x10')]);}else{_0x3834cb[_0xfe23('0x18')]=_0x14caff+'.'+_0x14bee9['field']+'\x20'+parseOperator(_0x14bee9[_0xfe23('0x10')]);}if(_['includes'](['$ne','$notIn'],_0x14bee9[_0xfe23('0x10')]))_0x3834cb[_0xfe23('0x18')]='('+_0x3834cb['text']+_0xfe23('0x1c')+_0x14caff+'.'+_0x14bee9[_0xfe23('0x1a')]+_0xfe23('0x1d');_0x3834cb[_0xfe23('0x11')]=parseValue(_0x18ab63,_0x14bee9[_0xfe23('0x10')],_0x14bee9['value']);return _0x3834cb;};function parseOperator(_0x333326){var _0x32a020;switch(_0x333326){case _0xfe23('0x1e'):_0x32a020='IN\x20?';break;case _0xfe23('0x1f'):_0x32a020=_0xfe23('0x20');break;case _0xfe23('0x21'):_0x32a020=_0xfe23('0x22');break;case _0xfe23('0x23'):_0x32a020=_0xfe23('0x24');break;case _0xfe23('0x25'):case'$startsWith':case _0xfe23('0x26'):_0x32a020=_0xfe23('0x27');break;case _0xfe23('0x28'):_0x32a020=_0xfe23('0x29');break;case _0xfe23('0x2a'):_0x32a020=_0xfe23('0x2b');break;case _0xfe23('0x13'):_0x32a020='<=\x20?';break;case _0xfe23('0x2c'):_0x32a020=_0xfe23('0x2d');break;case _0xfe23('0x2e'):_0x32a020=_0xfe23('0x2f');break;}return _0x32a020;}function parseValue(_0x10fec4,_0x54a75a,_0x49a640){var _0x431d41={'start':undefined,'end':undefined};switch(_0x54a75a){case _0xfe23('0x1e'):case _0xfe23('0x1f'):_0x431d41[_0xfe23('0x30')]=_0x49a640[_0xfe23('0x7')](',');break;case _0xfe23('0x25'):_0x431d41[_0xfe23('0x30')]='%'+_0x49a640+'%';break;case _0xfe23('0x31'):_0x431d41[_0xfe23('0x30')]=_0x49a640+'%';break;case _0xfe23('0x26'):_0x431d41['start']='%'+_0x49a640;break;case _0xfe23('0x2e'):var _0xf87740=_0x49a640[_0xfe23('0x7')](',');var _0x49a640=_0xf87740[_0xfe23('0x9')]();var _0x21c629=_0xf87740['pop']();if(_0x10fec4===_0xfe23('0xf')){_0x49a640=moment(_0x49a640)[_0xfe23('0x32')](0x0,!![])[_0xfe23('0x15')]();_0x21c629=moment(_0x21c629)[_0xfe23('0x32')](0x0,!![])[_0xfe23('0x33')](0x17,_0xfe23('0x34'))['add'](0x3b,'minutes')[_0xfe23('0x33')](0x3b,'seconds')[_0xfe23('0x15')]();}_0x431d41={'start':_0x49a640,'end':_0x21c629};break;default:_0x431d41[_0xfe23('0x30')]=_0x49a640;break;}return _0x431d41;} \ No newline at end of file +var _0xc916=['sqlOperator','startsWith','[$or]','and','replace','[$and]','split','length','slice','shift','match','forEach','filter','map','push','DATE','$eq','operator','$between','value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','minutes','lodash','moment','parseSearch'];(function(_0x3dc2b3,_0x2ede51){var _0x204240=function(_0x4d0ef8){while(--_0x4d0ef8){_0x3dc2b3['push'](_0x3dc2b3['shift']());}};_0x204240(++_0x2ede51);}(_0xc916,0xd1));var _0x6c91=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0xc916[_0x212bf5];return _0xfcad21;};'use strict';var _=require(_0x6c91('0x0'));var moment=require(_0x6c91('0x1'));exports[_0x6c91('0x2')]=function(_0x444bab){var _0x2fe936={'conditions':[]};_0x2fe936[_0x6c91('0x3')]=_[_0x6c91('0x4')](_0x444bab,_0x6c91('0x5'))?'or':_0x6c91('0x6');var _0x77882e=_0x444bab[_0x6c91('0x7')](_0x6c91('0x8'),'')['replace'](_0x6c91('0x5'),'')[_0x6c91('0x9')]('||');for(var _0x59ba59=0x0;_0x59ba59<_0x77882e[_0x6c91('0xa')];_0x59ba59++){var _0x509980=_0x77882e[_0x59ba59][_0x6c91('0x9')](':=');var _0x12a64f=_0x509980[0x0];var _0x15cd75=_0x509980[_0x6c91('0xb')](0x1);_0x15cd75['forEach'](function(_0x271aa0){var _0x2fc80f=_0x271aa0[_0x6c91('0x9')]('[')[_0x6c91('0xc')]();var _0x1f5d6f=_0x271aa0[_0x6c91('0xd')](/\[(.*?)\]/g);_0x1f5d6f[_0x6c91('0xe')](function(_0xc8e891){var _0x58fe13=_0xc8e891[_0x6c91('0x9')]('[')[_0x6c91('0xf')](function(_0x3ead5d){return _0x3ead5d['indexOf'](']')>-0x1;})[_0x6c91('0x10')](function(_0x5cbc35){return _0x5cbc35[_0x6c91('0x9')](']')[0x0];})[0x0];_0x2fe936['conditions'][_0x6c91('0x11')]({'field':_0x12a64f,'operator':_0x2fc80f,'value':_0x58fe13});});});}return _0x2fe936;};exports['buildExpression']=function(_0x3161a6,_0x2abe8d,_0xefc13e){var _0x587360={};if(_0x2abe8d===_0x6c91('0x12')){if(_0xefc13e['operator']===_0x6c91('0x13')){_0xefc13e[_0x6c91('0x14')]=_0x6c91('0x15');_0xefc13e[_0x6c91('0x16')]+=','+_0xefc13e[_0x6c91('0x16')];}else if(_[_0x6c91('0x17')]([_0x6c91('0x18'),_0x6c91('0x19')],_0xefc13e['operator'])){_0xefc13e[_0x6c91('0x16')]=moment(_0xefc13e[_0x6c91('0x16')])[_0x6c91('0x1a')](0x1,_0x6c91('0x1b'))[_0x6c91('0x1c')]('YYYY-MM-DD');}}if(_0xefc13e['castTo']){_0x2abe8d=_0xefc13e[_0x6c91('0x1d')];_0x587360[_0x6c91('0x1e')]=_0x6c91('0x1f')+_0x3161a6+'.'+_0xefc13e[_0x6c91('0x20')]+'\x20AS\x20'+_0xefc13e[_0x6c91('0x1d')]+')\x20'+parseOperator(_0xefc13e[_0x6c91('0x14')]);}else{_0x587360[_0x6c91('0x1e')]=_0x3161a6+'.'+_0xefc13e[_0x6c91('0x20')]+'\x20'+parseOperator(_0xefc13e[_0x6c91('0x14')]);}if(_[_0x6c91('0x17')](['$ne',_0x6c91('0x21')],_0xefc13e['operator']))_0x587360['text']='('+_0x587360[_0x6c91('0x1e')]+'\x20OR\x20'+_0x3161a6+'.'+_0xefc13e['field']+_0x6c91('0x22');_0x587360[_0x6c91('0x16')]=parseValue(_0x2abe8d,_0xefc13e['operator'],_0xefc13e['value']);return _0x587360;};function parseOperator(_0x416702){var _0x4dd90d;switch(_0x416702){case _0x6c91('0x23'):_0x4dd90d=_0x6c91('0x24');break;case _0x6c91('0x21'):_0x4dd90d=_0x6c91('0x25');break;case _0x6c91('0x13'):_0x4dd90d=_0x6c91('0x26');break;case _0x6c91('0x27'):_0x4dd90d=_0x6c91('0x28');break;case _0x6c91('0x29'):case _0x6c91('0x2a'):case _0x6c91('0x2b'):_0x4dd90d=_0x6c91('0x2c');break;case'$lt':_0x4dd90d='<\x20?';break;case _0x6c91('0x18'):_0x4dd90d='>\x20?';break;case _0x6c91('0x19'):_0x4dd90d=_0x6c91('0x2d');break;case _0x6c91('0x2e'):_0x4dd90d=_0x6c91('0x2f');break;case _0x6c91('0x15'):_0x4dd90d=_0x6c91('0x30');break;}return _0x4dd90d;}function parseValue(_0x34be85,_0x52e82f,_0x4edbac){var _0x21f02d={'start':undefined,'end':undefined};switch(_0x52e82f){case'$in':case _0x6c91('0x21'):_0x21f02d[_0x6c91('0x31')]=_0x4edbac[_0x6c91('0x9')](',');break;case _0x6c91('0x29'):_0x21f02d[_0x6c91('0x31')]='%'+_0x4edbac+'%';break;case _0x6c91('0x2a'):_0x21f02d[_0x6c91('0x31')]=_0x4edbac+'%';break;case _0x6c91('0x2b'):_0x21f02d['start']='%'+_0x4edbac;break;case _0x6c91('0x15'):var _0x4ef230=_0x4edbac[_0x6c91('0x9')](',');var _0x4edbac=_0x4ef230['shift']();var _0x51cea3=_0x4ef230['pop']();if(_0x34be85===_0x6c91('0x12')){_0x4edbac=moment(_0x4edbac)[_0x6c91('0x32')](0x0,!![])[_0x6c91('0x1c')]();_0x51cea3=moment(_0x51cea3)['utcOffset'](0x0,!![])['add'](0x17,_0x6c91('0x33'))[_0x6c91('0x1a')](0x3b,_0x6c91('0x34'))[_0x6c91('0x1a')](0x3b,'seconds')[_0x6c91('0x1c')]();}_0x21f02d={'start':_0x4edbac,'end':_0x51cea3};break;default:_0x21f02d[_0x6c91('0x31')]=_0x4edbac;break;}return _0x21f02d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index d356a0c..ea5a009 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 _0x2a2f=['cast','ASC','length','omit','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','\x22{EXPR}\x22','forEach','replace','{EXPR}','join','getOptions','query','$id','intersection','attributes','order','sort','where','pick','filter','object','includes','columns','value','merge','type','VIRTUAL','lower','options','include','includeAll','push','lodash','sequelize','parse','keys','model','alias','fields','raw','split','filters','find','DATE','isPlainObject','format','YYYY-MM-DD','$lte','utc','subtract','name','uniqueid','isArray','limit','offset','map','indexOf','priority','col','substr','DESC'];(function(_0x1385fa,_0x23aed6){var _0x8f3a83=function(_0x5f2d22){while(--_0x5f2d22){_0x1385fa['push'](_0x1385fa['shift']());}};_0x8f3a83(++_0x23aed6);}(_0x2a2f,0x1c6));var _0xf2a2=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x2a2f[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0xf2a2('0x0'));var sequelize=require(_0xf2a2('0x1'));var moment=require('moment');var db=require('../../mysqldb')['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3550e3){var _0x2d53ad=['ne'];try{var _0x116b44=JSON[_0xf2a2('0x2')](_0x3550e3);var _0x4233dd=Object[_0xf2a2('0x3')](_0x116b44)[0x0];return _0x2d53ad['includes'](_0x4233dd);}catch(_0x389185){return![];}}function getOperatorValue(_0x5c0310){var _0x4dc1a7=JSON[_0xf2a2('0x2')](_0x5c0310);var _0x273acc=Object[_0xf2a2('0x3')](_0x4dc1a7)[0x0];var _0x4f4bda=_0x4dc1a7[_0x273acc];return{['$'+_0x273acc]:_0x4f4bda};}function parseIncludeModel(_0x1aef52){var _0x1da0db=JSON[_0xf2a2('0x2')](_0x1aef52);return{'model':db[_0x1da0db[_0xf2a2('0x4')]],'as':_0x1da0db[_0xf2a2('0x5')],'attributes':_0x1da0db[_0xf2a2('0x6')],'raw':_0x1da0db[_0xf2a2('0x7')]};}exports['fields']=function(_0x1a40c2){var _0x55f403=null;if(_0x1a40c2){_0x55f403=_0x1a40c2[_0xf2a2('0x8')](',');}return _0x55f403;};exports[_0xf2a2('0x9')]=function(_0x1127b7,_0x14af8a){var _0xf85e={};if(!_['isEmpty'](_0x1127b7)){_['forOwn'](_0x1127b7,function(_0x203596,_0x446286){try{if(_0x14af8a){var _0x4e0c8a=_[_0xf2a2('0xa')](_0x14af8a,{'name':_0x446286})||{};if(hasSequelizeOperator(_0x203596)){_0xf85e[_0x446286]=getOperatorValue(_0x203596);}else if(_0x4e0c8a['type']===_0xf2a2('0xb')&&_[_0xf2a2('0xc')](_0x203596)){var _0x4e8198=JSON[_0xf2a2('0x2')](_0x203596);var _0x1c8df8={'$gte':moment(moment(_0x4e8198['$gte'])[_0xf2a2('0xd')](_0xf2a2('0xe')))['utc']()[_0xf2a2('0xd')](),'$lte':moment(moment(_0x4e8198[_0xf2a2('0xf')])[_0xf2a2('0xd')](_0xf2a2('0xe')))[_0xf2a2('0x10')]()[_0xf2a2('0x11')](0x1,'s')[_0xf2a2('0xd')]()};_0xf85e[_0x446286]=_0x1c8df8;}else if(_0x4e0c8a[_0xf2a2('0x12')]===_0xf2a2('0x13')){_0xf85e[_0x446286]=_0x203596;}else{_0xf85e[_0x446286]=_[_0xf2a2('0x14')](_0x203596)?_0x203596:JSON[_0xf2a2('0x2')](_0x203596);}}else{_0xf85e[_0x446286]=_[_0xf2a2('0x14')](_0x203596)?_0x203596:JSON[_0xf2a2('0x2')](_0x203596);}}catch(_0x58a597){_0xf85e[_0x446286]=_0x203596['split'](',');}});}return _0xf85e;};exports[_0xf2a2('0x15')]=function(_0x53bad6){_0x53bad6=parseInt(_0x53bad6,0xa);if(!_0x53bad6||_0x53bad6<0x0){_0x53bad6=LIMIT_VALUE;}return _0x53bad6;};exports[_0xf2a2('0x16')]=function(_0x55317c){_0x55317c=parseInt(_0x55317c,0xa);if(!_0x55317c||_0x55317c<0x0){_0x55317c=0x0;}return _0x55317c;};exports['sort']=function(_0x575146){var _0x518010,_0x49a46c=null;if(_0x575146){_0x518010=_0x575146[_0xf2a2('0x8')](',');_0x49a46c=_[_0xf2a2('0x17')](_0x518010,function(_0x259ee1){if(_0x259ee1[_0xf2a2('0x18')]('-')===0x0){return[_0x259ee1===_0xf2a2('0x19')?sequelize['cast'](sequelize[_0xf2a2('0x1a')]('priority'),'unsigned'):_0x259ee1[_0xf2a2('0x1b')](0x1),_0xf2a2('0x1c')];}else{return[_0x259ee1==='priority'?sequelize[_0xf2a2('0x1d')](sequelize[_0xf2a2('0x1a')](_0xf2a2('0x19')),'unsigned'):_0x259ee1,_0xf2a2('0x1e')];}});}return _0x49a46c;};exports['omit']=function(_0x43b4fc,_0x32225f){if(_['isEmpty'](_0x43b4fc)){return _0x43b4fc;}if(_[_0xf2a2('0x14')](_0x43b4fc)){for(var _0x8bda7=0x0;_0x8bda7<_0x43b4fc[_0xf2a2('0x1f')];_0x8bda7+=0x1){_0x43b4fc[_0x8bda7]=this[_0xf2a2('0x20')](_0x43b4fc[_0x8bda7],_0x32225f);}return _0x43b4fc;}if(!_[_0xf2a2('0x21')](_0x43b4fc)){return _0x43b4fc;}if(_[_0xf2a2('0x22')](_0x32225f)){_0x32225f=[_0x32225f];}if(!_['isArray'](_0x32225f)){return _0x43b4fc;}for(var _0x521d42=0x0;_0x521d42<_0x32225f['length'];_0x521d42+=0x1){_[_0xf2a2('0x23')](_0x43b4fc,_0x32225f[_0x521d42]);}for(var _0x466360 in _0x43b4fc){if(_0x43b4fc[_0xf2a2('0x24')](_0x466360)){_0x43b4fc[_0x466360]=this[_0xf2a2('0x20')](_0x43b4fc[_0x466360],_0x32225f);}}return _0x43b4fc;};exports[_0xf2a2('0x25')]=function(_0x3084c5){return _0x3084c5[_0xf2a2('0x26')](RegExp(_0xf2a2('0x27')))?!![]:![];};exports[_0xf2a2('0x28')]=function(_0x5305ba){return _0x5305ba[_0xf2a2('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0xf2a2('0x29')]=function(_0x5ba4f0,_0x8d74ad){var _0x180f09=[];var _0x4d8ff0=/[ `!@#$%^&*()_\-?~]/;var _0xfc7b3=_0x8d74ad?_0xf2a2('0x2a'):'{EXPR}';_0x5ba4f0[_0xf2a2('0x8')](/[ ,]+/)[_0xf2a2('0x2b')](function(_0x53c739){_0x53c739=_0x53c739[_0xf2a2('0x2c')](/([^:]")"+/g,'$1');_0x53c739='+'+_0x53c739+'*';var _0x3f4c9f=_0x53c739[_0xf2a2('0x26')](_0x4d8ff0);if(_0x3f4c9f){_0x53c739='\x22'+_0x53c739+'\x22';}_0x180f09['push'](_0x53c739);});_0xfc7b3=_0xfc7b3['replace'](_0xf2a2('0x2d'),_0x180f09[_0xf2a2('0x2e')]('\x20'));return _0xfc7b3;};exports[_0xf2a2('0x2f')]=function(_0x455a04,_0x54ec3c,_0xb01b67){var _0x56add9={},_0x408744={};if(_0x54ec3c[_0xf2a2('0x30')]['$id']){_0x54ec3c[_0xf2a2('0x30')]['id']=_0x54ec3c[_0xf2a2('0x30')][_0xf2a2('0x31')];delete _0x54ec3c['query'][_0xf2a2('0x31')];}_0x56add9[_0xf2a2('0x4')]=_[_0xf2a2('0x17')](_0x455a04,_0xf2a2('0x12'));_0x56add9[_0xf2a2('0x30')]=_[_0xf2a2('0x3')](_0x54ec3c['query']);_0x56add9[_0xf2a2('0x9')]=_[_0xf2a2('0x32')](_0x56add9[_0xf2a2('0x4')],_0x56add9['query']);_0x408744[_0xf2a2('0x33')]=_['intersection'](_0x56add9[_0xf2a2('0x4')],this['fields'](_0x54ec3c[_0xf2a2('0x30')]['fields']));_0x408744[_0xf2a2('0x33')]=_0x408744[_0xf2a2('0x33')][_0xf2a2('0x1f')]?_0x408744['attributes']:_0x56add9[_0xf2a2('0x4')];if(!_0x54ec3c['query'][_0xf2a2('0x24')]('nolimit')){_0x408744[_0xf2a2('0x15')]=this['limit'](_0x54ec3c['query']['limit']);_0x408744[_0xf2a2('0x16')]=this[_0xf2a2('0x16')](_0x54ec3c[_0xf2a2('0x30')][_0xf2a2('0x16')]);}_0x408744[_0xf2a2('0x34')]=this[_0xf2a2('0x35')](_0x54ec3c[_0xf2a2('0x30')][_0xf2a2('0x35')]);_0x408744[_0xf2a2('0x36')]=this['filters'](_[_0xf2a2('0x37')](_0x54ec3c['query'],_0x56add9[_0xf2a2('0x9')]),_0x455a04);if(_0x54ec3c[_0xf2a2('0x30')][_0xf2a2('0x38')]){var _0x98122e=_0x455a04;var _0x556d98=_0x54ec3c[_0xf2a2('0x30')]['filter'];if(typeof _0x556d98===_0xf2a2('0x39')){_0x98122e=_[_0xf2a2('0x38')](_0x455a04,function(_0x1f51a0){return _[_0xf2a2('0x3a')](_0x556d98[_0xf2a2('0x3b')],_0x1f51a0[_0xf2a2('0x12')]);});_0x556d98=_0x556d98[_0xf2a2('0x3c')];}_0x408744[_0xf2a2('0x36')]=_[_0xf2a2('0x3d')](_0x408744[_0xf2a2('0x36')],{'$or':_[_0xf2a2('0x17')](_0x98122e,function(_0x425e7a){if(_0x425e7a[_0xf2a2('0x3e')]!==_0xf2a2('0x3f')){if(_0xb01b67){return sequelize['where'](sequelize['fn'](_0xf2a2('0x40'),sequelize[_0xf2a2('0x1a')](_0x425e7a[_0xf2a2('0x12')])),{'$like':sequelize['fn'](_0xf2a2('0x40'),'%'+_0x54ec3c[_0xf2a2('0x30')][_0xf2a2('0x38')]+'%')});}else{var _0x345920={};_0x345920[_0x425e7a[_0xf2a2('0x12')]]={'$like':'%'+_0x54ec3c[_0xf2a2('0x30')][_0xf2a2('0x38')]+'%'};return _0x345920;}}})});}_0x408744=_[_0xf2a2('0x3d')]({},_0x408744,_0x54ec3c[_0xf2a2('0x41')]);return _0x408744;};exports[_0xf2a2('0x42')]=function(_0x146b24){var _0xd38d76=[];if(_0x146b24[_0xf2a2('0x43')]){_0xd38d76[_0xf2a2('0x44')]({'all':!![]});}else if(_0x146b24[_0xf2a2('0x42')]){if(Array[_0xf2a2('0x14')](_0x146b24['include'])){_0xd38d76=Object[_0xf2a2('0x3')](_0x146b24['include'])[_0xf2a2('0x17')](function(_0x5bfe26){return parseIncludeModel(_0x146b24[_0xf2a2('0x42')][_0x5bfe26]);});}else{var _0x134176=parseIncludeModel(_0x146b24[_0xf2a2('0x42')]);_0xd38d76[_0xf2a2('0x44')](_0x134176);}}return _0xd38d76;}; \ No newline at end of file +var _0xf163=['length','isObject','isString','unset','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','\x22{EXPR}\x22','{EXPR}','forEach','replace','push','join','getOptions','query','$id','model','intersection','attributes','hasOwnProperty','nolimit','limit','order','where','pick','filter','includes','columns','merge','lower','include','lodash','moment','../../mysqldb','keys','parse','alias','fields','raw','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','format','YYYY-MM-DD','utc','$lte','subtract','name','uniqueid','isArray','split','offset','sort','map','indexOf','priority','cast','col','substr','omit'];(function(_0x42a40d,_0x4d0c7a){var _0x2d4d7d=function(_0x160d48){while(--_0x160d48){_0x42a40d['push'](_0x42a40d['shift']());}};_0x2d4d7d(++_0x4d0c7a);}(_0xf163,0x129));var _0x3f16=function(_0x1ee62e,_0x159bb2){_0x1ee62e=_0x1ee62e-0x0;var _0x27c6c8=_0xf163[_0x1ee62e];return _0x27c6c8;};'use strict';var _=require(_0x3f16('0x0'));var sequelize=require('sequelize');var moment=require(_0x3f16('0x1'));var db=require(_0x3f16('0x2'))['db'];var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x3ccaa4){var _0x335c2b=['ne'];try{var _0x3b5045=JSON['parse'](_0x3ccaa4);var _0xb7e352=Object[_0x3f16('0x3')](_0x3b5045)[0x0];return _0x335c2b['includes'](_0xb7e352);}catch(_0x1bd04f){return![];}}function getOperatorValue(_0x1307b7){var _0x6d1be=JSON[_0x3f16('0x4')](_0x1307b7);var _0x401a6c=Object[_0x3f16('0x3')](_0x6d1be)[0x0];var _0x3b3a9c=_0x6d1be[_0x401a6c];return{['$'+_0x401a6c]:_0x3b3a9c};}function parseIncludeModel(_0x258189){var _0x28eaae=JSON[_0x3f16('0x4')](_0x258189);return{'model':db[_0x28eaae['model']],'as':_0x28eaae[_0x3f16('0x5')],'attributes':_0x28eaae[_0x3f16('0x6')],'raw':_0x28eaae[_0x3f16('0x7')]};}exports[_0x3f16('0x6')]=function(_0x1ef5ea){var _0x2ac491=null;if(_0x1ef5ea){_0x2ac491=_0x1ef5ea['split'](',');}return _0x2ac491;};exports[_0x3f16('0x8')]=function(_0x4d4f83,_0x33d611){var _0x254ca7={};if(!_[_0x3f16('0x9')](_0x4d4f83)){_[_0x3f16('0xa')](_0x4d4f83,function(_0x1e7330,_0x200cc5){try{if(_0x33d611){var _0x52175d=_[_0x3f16('0xb')](_0x33d611,{'name':_0x200cc5})||{};if(hasSequelizeOperator(_0x1e7330)){_0x254ca7[_0x200cc5]=getOperatorValue(_0x1e7330);}else if(_0x52175d[_0x3f16('0xc')]===_0x3f16('0xd')&&_[_0x3f16('0xe')](_0x1e7330)){var _0xb28281=JSON['parse'](_0x1e7330);var _0x461d4e={'$gte':moment(moment(_0xb28281['$gte'])[_0x3f16('0xf')](_0x3f16('0x10')))[_0x3f16('0x11')]()[_0x3f16('0xf')](),'$lte':moment(moment(_0xb28281[_0x3f16('0x12')])[_0x3f16('0xf')](_0x3f16('0x10')))[_0x3f16('0x11')]()[_0x3f16('0x13')](0x1,'s')[_0x3f16('0xf')]()};_0x254ca7[_0x200cc5]=_0x461d4e;}else if(_0x52175d[_0x3f16('0x14')]===_0x3f16('0x15')){_0x254ca7[_0x200cc5]=_0x1e7330;}else{_0x254ca7[_0x200cc5]=_[_0x3f16('0x16')](_0x1e7330)?_0x1e7330:JSON[_0x3f16('0x4')](_0x1e7330);}}else{_0x254ca7[_0x200cc5]=_[_0x3f16('0x16')](_0x1e7330)?_0x1e7330:JSON[_0x3f16('0x4')](_0x1e7330);}}catch(_0x4cb533){_0x254ca7[_0x200cc5]=_0x1e7330[_0x3f16('0x17')](',');}});}return _0x254ca7;};exports['limit']=function(_0x27166c){_0x27166c=parseInt(_0x27166c,0xa);if(!_0x27166c||_0x27166c<0x0){_0x27166c=LIMIT_VALUE;}return _0x27166c;};exports[_0x3f16('0x18')]=function(_0x1e9ac9){_0x1e9ac9=parseInt(_0x1e9ac9,0xa);if(!_0x1e9ac9||_0x1e9ac9<0x0){_0x1e9ac9=0x0;}return _0x1e9ac9;};exports[_0x3f16('0x19')]=function(_0x4e76de){var _0x27bba9,_0xd451c6=null;if(_0x4e76de){_0x27bba9=_0x4e76de[_0x3f16('0x17')](',');_0xd451c6=_[_0x3f16('0x1a')](_0x27bba9,function(_0x18a18a){if(_0x18a18a[_0x3f16('0x1b')]('-')===0x0){return[_0x18a18a===_0x3f16('0x1c')?sequelize[_0x3f16('0x1d')](sequelize[_0x3f16('0x1e')](_0x3f16('0x1c')),'unsigned'):_0x18a18a[_0x3f16('0x1f')](0x1),'DESC'];}else{return[_0x18a18a===_0x3f16('0x1c')?sequelize[_0x3f16('0x1d')](sequelize[_0x3f16('0x1e')](_0x3f16('0x1c')),'unsigned'):_0x18a18a,'ASC'];}});}return _0xd451c6;};exports[_0x3f16('0x20')]=function(_0x20261f,_0x1f18eb){if(_[_0x3f16('0x9')](_0x20261f)){return _0x20261f;}if(_[_0x3f16('0x16')](_0x20261f)){for(var _0x3d6ddd=0x0;_0x3d6ddd<_0x20261f[_0x3f16('0x21')];_0x3d6ddd+=0x1){_0x20261f[_0x3d6ddd]=this['omit'](_0x20261f[_0x3d6ddd],_0x1f18eb);}return _0x20261f;}if(!_[_0x3f16('0x22')](_0x20261f)){return _0x20261f;}if(_[_0x3f16('0x23')](_0x1f18eb)){_0x1f18eb=[_0x1f18eb];}if(!_['isArray'](_0x1f18eb)){return _0x20261f;}for(var _0x5ee64e=0x0;_0x5ee64e<_0x1f18eb[_0x3f16('0x21')];_0x5ee64e+=0x1){_[_0x3f16('0x24')](_0x20261f,_0x1f18eb[_0x5ee64e]);}for(var _0x5eff4f in _0x20261f){if(_0x20261f['hasOwnProperty'](_0x5eff4f)){_0x20261f[_0x5eff4f]=this[_0x3f16('0x20')](_0x20261f[_0x5eff4f],_0x1f18eb);}}return _0x20261f;};exports[_0x3f16('0x25')]=function(_0x52a045){return _0x52a045['match'](RegExp(_0x3f16('0x26')))?!![]:![];};exports[_0x3f16('0x27')]=function(_0xf1c937){return _0xf1c937[_0x3f16('0x28')](/^\S+@\S+$/)?!![]:![];};exports[_0x3f16('0x29')]=function(_0xe368de,_0x5ad909){var _0x264b9e=[];var _0x28f23c=/[ `!@#$%^&*()_\-?~]/;var _0x1e19bb=_0x5ad909?_0x3f16('0x2a'):_0x3f16('0x2b');_0xe368de[_0x3f16('0x17')](/[ ,]+/)[_0x3f16('0x2c')](function(_0x308752){_0x308752=_0x308752[_0x3f16('0x2d')](/([^:]")"+/g,'$1');_0x308752='+'+_0x308752+'*';var _0x5654b5=_0x308752['match'](_0x28f23c);if(_0x5654b5){_0x308752='\x22'+_0x308752+'\x22';}_0x264b9e[_0x3f16('0x2e')](_0x308752);});_0x1e19bb=_0x1e19bb[_0x3f16('0x2d')]('{EXPR}',_0x264b9e[_0x3f16('0x2f')]('\x20'));return _0x1e19bb;};exports[_0x3f16('0x30')]=function(_0x420c85,_0x1faaba,_0x297d61){var _0x112a92={},_0x4b3814={};if(_0x1faaba[_0x3f16('0x31')][_0x3f16('0x32')]){_0x1faaba[_0x3f16('0x31')]['id']=_0x1faaba[_0x3f16('0x31')][_0x3f16('0x32')];delete _0x1faaba[_0x3f16('0x31')][_0x3f16('0x32')];}_0x112a92[_0x3f16('0x33')]=_[_0x3f16('0x1a')](_0x420c85,_0x3f16('0x14'));_0x112a92[_0x3f16('0x31')]=_[_0x3f16('0x3')](_0x1faaba['query']);_0x112a92[_0x3f16('0x8')]=_[_0x3f16('0x34')](_0x112a92[_0x3f16('0x33')],_0x112a92[_0x3f16('0x31')]);_0x4b3814[_0x3f16('0x35')]=_[_0x3f16('0x34')](_0x112a92[_0x3f16('0x33')],this[_0x3f16('0x6')](_0x1faaba['query'][_0x3f16('0x6')]));_0x4b3814[_0x3f16('0x35')]=_0x4b3814[_0x3f16('0x35')][_0x3f16('0x21')]?_0x4b3814[_0x3f16('0x35')]:_0x112a92['model'];if(!_0x1faaba[_0x3f16('0x31')][_0x3f16('0x36')](_0x3f16('0x37'))){_0x4b3814[_0x3f16('0x38')]=this['limit'](_0x1faaba[_0x3f16('0x31')][_0x3f16('0x38')]);_0x4b3814[_0x3f16('0x18')]=this[_0x3f16('0x18')](_0x1faaba['query']['offset']);}_0x4b3814[_0x3f16('0x39')]=this[_0x3f16('0x19')](_0x1faaba[_0x3f16('0x31')][_0x3f16('0x19')]);_0x4b3814[_0x3f16('0x3a')]=this[_0x3f16('0x8')](_[_0x3f16('0x3b')](_0x1faaba['query'],_0x112a92[_0x3f16('0x8')]),_0x420c85);if(_0x1faaba['query'][_0x3f16('0x3c')]){var _0x13de11=_0x420c85;var _0x3d1403=_0x1faaba[_0x3f16('0x31')][_0x3f16('0x3c')];if(typeof _0x3d1403==='object'){_0x13de11=_[_0x3f16('0x3c')](_0x420c85,function(_0x3a65bc){return _[_0x3f16('0x3d')](_0x3d1403[_0x3f16('0x3e')],_0x3a65bc[_0x3f16('0x14')]);});_0x3d1403=_0x3d1403['value'];}_0x4b3814[_0x3f16('0x3a')]=_[_0x3f16('0x3f')](_0x4b3814[_0x3f16('0x3a')],{'$or':_['map'](_0x13de11,function(_0x4aa94a){if(_0x4aa94a[_0x3f16('0xc')]!=='VIRTUAL'){if(_0x297d61){return sequelize[_0x3f16('0x3a')](sequelize['fn'](_0x3f16('0x40'),sequelize[_0x3f16('0x1e')](_0x4aa94a[_0x3f16('0x14')])),{'$like':sequelize['fn']('lower','%'+_0x1faaba[_0x3f16('0x31')]['filter']+'%')});}else{var _0x35a895={};_0x35a895[_0x4aa94a['name']]={'$like':'%'+_0x1faaba[_0x3f16('0x31')][_0x3f16('0x3c')]+'%'};return _0x35a895;}}})});}_0x4b3814=_['merge']({},_0x4b3814,_0x1faaba['options']);return _0x4b3814;};exports[_0x3f16('0x41')]=function(_0x3d5e55){var _0x238b39=[];if(_0x3d5e55['includeAll']){_0x238b39[_0x3f16('0x2e')]({'all':!![]});}else if(_0x3d5e55[_0x3f16('0x41')]){if(Array[_0x3f16('0x16')](_0x3d5e55[_0x3f16('0x41')])){_0x238b39=Object[_0x3f16('0x3')](_0x3d5e55['include'])[_0x3f16('0x1a')](function(_0x4ebd04){return parseIncludeModel(_0x3d5e55['include'][_0x4ebd04]);});}else{var _0x59d583=parseIncludeModel(_0x3d5e55['include']);_0x238b39[_0x3f16('0x2e')](_0x59d583);}}return _0x238b39;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 8fe5451..2840da2 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f8a=['includes','order','startsWith','DESC','getUpdatedSortOptions','substring','indexOf','internal','sort','globalStatus','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','smsStatus','chatStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','role','openchannelStatusTime','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','../../mysqldb','client','http','chatPause','faxPause','mailPause','openchannelPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','unavailable','isNil','voiceStatus','pause','chatStatus','faxStatus','mailStatus','openchannelStatus','whatsappStatus','request','Agents','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','then','merge','catch','getRealtimeAgents','busy','getAgentStatus','isArray','startCase','map','findOne','getAgents','all','flatten','uniq','getAgentIdsByQueues','getAgentIdsByStatus','resolve','User','name','fullname','pauseType','find','getSortedAgentsIdsByStatus','split','fields'];(function(_0x1a5a53,_0x598a8c){var _0xf75355=function(_0x454fe5){while(--_0x454fe5){_0x1a5a53['push'](_0x1a5a53['shift']());}};_0xf75355(++_0x598a8c);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x551165,_0x627ee9){_0x551165=_0x551165-0x0;var _0x5dde2f=_0x3f8a[_0x551165];return _0x5dde2f;};'use strict';var _=require(_0xa3f8('0x0'));var jayson=require(_0xa3f8('0x1'));var db=require(_0xa3f8('0x2'))['db'];var amiClient=jayson[_0xa3f8('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xa3f8('0x3')][_0xa3f8('0x4')]({'port':0x232c});function isAgentPaused(_0x928738,_0x15b6aa){var _0x2553fd=[_0x928738[_0xa3f8('0x5')],_0x928738[_0xa3f8('0x6')],_0x928738[_0xa3f8('0x7')],_0x928738[_0xa3f8('0x8')],_0x928738[_0xa3f8('0x9')],_0x928738[_0xa3f8('0xa')],_0x928738[_0xa3f8('0xb')]];if(!_0x15b6aa)return _[_0xa3f8('0xc')](_0x2553fd);var _0x2448de=_[_0xa3f8('0xd')](_0x2553fd);return _0x2448de[_0xa3f8('0xe')]>0x0&&_0x2448de[_0xa3f8('0xe')]<_0x2553fd['length']?!![]:![];}function isIdle(_0x47496a){return _0x47496a===_0xa3f8('0xf')||_0x47496a===_0xa3f8('0x10')||_0x47496a===_0xa3f8('0x11')||_0x47496a==='ringing'||_[_0xa3f8('0x12')](_0x47496a);}function isAgentIdle(_0x26f0a0){if(_0x26f0a0[_0xa3f8('0x13')]!==_0xa3f8('0xf')&&_0x26f0a0[_0xa3f8('0xa')]){_0x26f0a0[_0xa3f8('0x13')]=_0xa3f8('0x14');return![];}return _[_0xa3f8('0xc')]([_0x26f0a0[_0xa3f8('0x15')],_0x26f0a0[_0xa3f8('0x16')],_0x26f0a0[_0xa3f8('0x17')],_0x26f0a0[_0xa3f8('0x18')],_0x26f0a0['smsStatus'],_0x26f0a0[_0xa3f8('0x13')],_0x26f0a0[_0xa3f8('0x19')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa3f8('0x1a')](_0xa3f8('0x1b'),{})['then'](function(_0x39c450){if(_0x39c450[_0xa3f8('0x1c')]){throw new Error(_0xa3f8('0x1d'));}var _0x8cd130=_0x39c450[_0xa3f8('0x1e')];return routingClient[_0xa3f8('0x1a')](_0xa3f8('0x1b'),{})[_0xa3f8('0x1f')](function(_0x2cb49f){if(_0x2cb49f[_0xa3f8('0x1c')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x3ad8cd=_0x2cb49f['result'];return _[_0xa3f8('0x20')]({},_0x8cd130,_0x3ad8cd);});})[_0xa3f8('0x21')](function(_0x191f99){throw _0x191f99;});}exports[_0xa3f8('0x22')]=getRealtimeAgents;function getAgentStatus(_0x5c916e){var _0x1f0bb8='unknown';if(isAgentPaused(_0x5c916e))_0x1f0bb8=_0xa3f8('0x14');else if(isAgentPaused(_0x5c916e,!![]))_0x1f0bb8='*pause';else if(isAgentIdle(_0x5c916e))_0x1f0bb8=_0xa3f8('0xf');else _0x1f0bb8=_0xa3f8('0x23');return _0x1f0bb8;}exports[_0xa3f8('0x24')]=getAgentStatus;function getAgentIdsByQueues(_0x474893,_0x3a6a57){var _0x1e5f30=_[_0xa3f8('0x25')](_0x474893)?_0x474893:[_0x474893];var _0x490717=_[_0xa3f8('0x26')](_0x3a6a57)+'Queue';var _0x3ce57b=_[_0xa3f8('0x27')](_0x1e5f30,function(_0x24985a){return db[_0x490717][_0xa3f8('0x28')]({'where':{'id':_0x24985a}})[_0xa3f8('0x1f')](function(_0x2c5d10){if(!_0x2c5d10)return[];return _0x2c5d10[_0xa3f8('0x29')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa3f8('0x2a')](_0x3ce57b)[_0xa3f8('0x1f')](function(_0x1eb2b9){var _0x545a28=_(_0x1eb2b9)[_0xa3f8('0x2b')]()[_0xa3f8('0x27')]('id')[_0xa3f8('0x2c')]()['value']();return _0x545a28;});}exports[_0xa3f8('0x2d')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x57f6be,_0xbad6a6,_0x3a3746){try{if(_0xbad6a6[_0xa3f8('0xe')]>0x0){_0x57f6be=_0x57f6be['filter'](function(_0x458824){return _0xbad6a6['includes'](_0x458824['id']);});}var _0x21c57e=_0x57f6be[_0xa3f8('0xd')](function(_0x226153){var _0x406140=_0xa3f8('0x23');if(isAgentIdle(_0x226153)){_0x406140=_0xa3f8('0xf');}return _0x406140===_0x3a3746;});return _[_0xa3f8('0x27')](_0x21c57e,'id');}catch(_0x424a3e){throw _0x424a3e;}}exports[_0xa3f8('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x290a4e,_0x6e83b0,_0x57c465){return Promise[_0xa3f8('0x2f')]()[_0xa3f8('0x1f')](function(){if(_0x6e83b0[_0xa3f8('0xe')]>0x0){_0x290a4e=_0x290a4e[_0xa3f8('0xd')](function(_0x3bb4b0){return _0x6e83b0['includes'](_0x3bb4b0['id']);});}return _0x290a4e;})[_0xa3f8('0x1f')](function(){return db[_0xa3f8('0x30')]['findAll']({'attributes':['id',_0xa3f8('0x31'),_0xa3f8('0x32'),'chatPause',_0xa3f8('0x6'),'mailPause','openchannelPause',_0xa3f8('0x9'),_0xa3f8('0xa'),'whatsappPause',_0xa3f8('0x33')],'where':{'id':{'$in':_['map'](_0x290a4e,'id')}},'raw':!![]});})[_0xa3f8('0x1f')](function(_0x30a972){return _0x30a972[_0xa3f8('0x27')](function(_0x22e8ea){var _0x52a80b=_[_0xa3f8('0x34')](_0x290a4e,['id',_0x22e8ea['id']]);var _0x53c7b2=filterAgentAttributes(_0x52a80b);_[_0xa3f8('0x20')](_0x22e8ea,_0x53c7b2);_0x22e8ea['globalStatus']=getAgentStatus(_0x22e8ea);return _0x22e8ea;});})[_0xa3f8('0x1f')](function(_0x5f459a){var _0x5eca3c=sortAgentsByStatus(_0x5f459a,_0x57c465);return _['map'](_0x5eca3c,'id');})[_0xa3f8('0x21')](function(_0x1674f1){throw _0x1674f1;});}exports[_0xa3f8('0x35')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x2ffeb3){var _0x4b93ba={'fields':[],'order':null};var _0x447824=_0x2ffeb3[_0xa3f8('0x36')](',');_0x4b93ba[_0xa3f8('0x37')]=_[_0xa3f8('0xd')](_0x447824,function(_0x238da1){if(!_0x238da1[_0xa3f8('0x38')]('globalStatus')){return!![];}_0x4b93ba[_0xa3f8('0x39')]=_[_0xa3f8('0x3a')](_0x238da1,'-')?_0xa3f8('0x3b'):'ASC';return![];});return _0x4b93ba;}exports[_0xa3f8('0x3c')]=getUpdatedSortOptions;function validateSortParameter(_0x110b23){if(!_0x110b23){_0x110b23='fullname,internal';}if(_0x110b23[_0xa3f8('0x38')]('fullname')&&!_0x110b23[_0xa3f8('0x38')]('internal')){var _0x9ede8d=_0x110b23[_0xa3f8('0x3d')](0x0,_0x110b23[_0xa3f8('0x3e')](_0xa3f8('0x32')));_0x110b23+=','+_0x9ede8d+_0xa3f8('0x3f');}return _0x110b23;}exports['validateSortParameter']=validateSortParameter;function sortAgentsByStatus(_0xa6f0a4,_0x88108){var _0x4db9c5=_0xa6f0a4[_0xa3f8('0x40')](function(_0x4e13f1,_0x6ff4d4){if(_0x4e13f1[_0xa3f8('0x41')]===_0x6ff4d4[_0xa3f8('0x41')]){if(_0x4e13f1[_0xa3f8('0x41')]===_0xa3f8('0x14')){if(_0x88108==='DESC'){return(_0x4e13f1[_0xa3f8('0x33')]||'')<(_0x6ff4d4[_0xa3f8('0x33')]||'')||_0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()>_0x6ff4d4[_0xa3f8('0x32')]['toLowerCase']()?0x1:-0x1;}else{return(_0x4e13f1[_0xa3f8('0x33')]||'')<(_0x6ff4d4[_0xa3f8('0x33')]||'')||_0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()>_0x6ff4d4[_0xa3f8('0x32')][_0xa3f8('0x42')]()?-0x1:0x1;}}else{if(_0x88108===_0xa3f8('0x3b')){return _0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()<_0x6ff4d4[_0xa3f8('0x32')][_0xa3f8('0x42')]()?0x1:-0x1;}else{return _0x4e13f1[_0xa3f8('0x32')][_0xa3f8('0x42')]()<_0x6ff4d4['fullname']['toLowerCase']()?-0x1:0x1;}}}else{if(_0x88108==='DESC'){return _0x4e13f1[_0xa3f8('0x41')]<_0x6ff4d4[_0xa3f8('0x41')]?0x1:-0x1;}else{return _0x4e13f1[_0xa3f8('0x41')]<_0x6ff4d4[_0xa3f8('0x41')]?-0x1:0x1;}}});return _0x4db9c5;}exports[_0xa3f8('0x43')]=sortAgentsByStatus;function filterAgentAttributes(_0x33a141){var _0x4a751f=[_0xa3f8('0x44'),_0xa3f8('0x45'),_0xa3f8('0x46'),_0xa3f8('0x47'),'pauseType',_0xa3f8('0x47'),_0xa3f8('0x3f'),_0xa3f8('0x48'),'chatPause','openchannelPause','mailPause',_0xa3f8('0x9'),_0xa3f8('0xb'),'faxPause',_0xa3f8('0xa'),_0xa3f8('0x49'),_0xa3f8('0x4a'),_0xa3f8('0x4b'),_0xa3f8('0x4c'),_0xa3f8('0x4d'),_0xa3f8('0x4e'),_0xa3f8('0x4f'),_0xa3f8('0x50'),_0xa3f8('0x51'),_0xa3f8('0x52'),_0xa3f8('0x53'),_0xa3f8('0x54'),_0xa3f8('0x15'),_0xa3f8('0x18'),_0xa3f8('0x17'),_0xa3f8('0x55'),'whatsappStatus','faxStatus',_0xa3f8('0x13'),_0xa3f8('0x56'),'openchannelStatusTime',_0xa3f8('0x57'),_0xa3f8('0x58'),_0xa3f8('0x59'),_0xa3f8('0x5a'),_0xa3f8('0x5b'),_0xa3f8('0x5c'),_0xa3f8('0x5d'),_0xa3f8('0x5e'),_0xa3f8('0x5f'),_0xa3f8('0x60'),_0xa3f8('0x61')];var _0x3752fa=[_0xa3f8('0x5'),_0xa3f8('0x8'),_0xa3f8('0x7'),_0xa3f8('0x9'),'whatsappPause','faxPause',_0xa3f8('0xa'),'online'];var _0x2410aa=_(_0x33a141)[_0xa3f8('0x62')](_0x3752fa)[_0xa3f8('0x63')](_0x4a751f)['value']();return _0x2410aa;}exports[_0xa3f8('0x64')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id',_0xa3f8('0x31'),_0xa3f8('0x32'),_0xa3f8('0x65'),'internal',_0xa3f8('0x45'),'globalStatus',_0xa3f8('0x44'),_0xa3f8('0x46'),_0xa3f8('0x33'),'lastPauseAt','faxPause',_0xa3f8('0x5'),_0xa3f8('0x7'),_0xa3f8('0x8'),_0xa3f8('0x9'),'voicePause',_0xa3f8('0xb'),_0xa3f8('0x15'),_0xa3f8('0x16'),_0xa3f8('0x17'),_0xa3f8('0x18'),'smsStatus','voiceStatus',_0xa3f8('0x19'),_0xa3f8('0x56'),_0xa3f8('0x5a'),_0xa3f8('0x57'),_0xa3f8('0x66'),_0xa3f8('0x58'),_0xa3f8('0x5b'),'whatsappStatusTime','chatCapacity','faxCapacity',_0xa3f8('0x4b'),_0xa3f8('0x4a'),_0xa3f8('0x4c'),_0xa3f8('0x4d'),_0xa3f8('0x4f'),_0xa3f8('0x54'),_0xa3f8('0x51'),_0xa3f8('0x50'),'smsCurrentCapacity',_0xa3f8('0x53'),_0xa3f8('0x5f'),_0xa3f8('0x60'),_0xa3f8('0x5d'),_0xa3f8('0x67'),_0xa3f8('0x5c'),_0xa3f8('0x61'),'screenrecording'];}exports[_0xa3f8('0x68')]=getRealtimeAgentsQueryFields; \ No newline at end of file +var _0x9c5a=['getAgents','all','value','getAgentIdsByQueues','filter','includes','resolve','findAll','name','fullname','chatPause','mailPause','pauseType','globalStatus','getSortedAgentsIdsByStatus','split','fields','startsWith','DESC','ASC','getUpdatedSortOptions','fullname,internal','internal','substring','indexOf','validateSortParameter','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','mailCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','mailStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','omit','pick','filterAgentAttributes','role','faxStatus','voiceStatusTime','chatCapacity','faxCapacity','chatCurrentCapacity','onhold','getRealtimeAgentsQueryFields','lodash','jayson/promise','client','http','faxPause','openchannelPause','smsPause','every','length','idle','ringing','isNil','voiceStatus','voicePause','pause','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents','then','error','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','getRealtimeAgents','*pause','getAgentStatus','isArray','map','findOne'];(function(_0xfa4aa2,_0x2f92b6){var _0x228b11=function(_0x3a991f){while(--_0x3a991f){_0xfa4aa2['push'](_0xfa4aa2['shift']());}};_0x228b11(++_0x2f92b6);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4a60bc,_0x1bc067){_0x4a60bc=_0x4a60bc-0x0;var _0x179938=_0x9c5a[_0x4a60bc];return _0x179938;};'use strict';var _=require(_0xa9c5('0x0'));var jayson=require(_0xa9c5('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0xa9c5('0x2')][_0xa9c5('0x3')]({'port':0x232a});var routingClient=jayson[_0xa9c5('0x2')][_0xa9c5('0x3')]({'port':0x232c});function isAgentPaused(_0x4f5552,_0x2acfaf){var _0x3051b1=[_0x4f5552['chatPause'],_0x4f5552[_0xa9c5('0x4')],_0x4f5552['mailPause'],_0x4f5552[_0xa9c5('0x5')],_0x4f5552[_0xa9c5('0x6')],_0x4f5552['voicePause'],_0x4f5552['whatsappPause']];if(!_0x2acfaf)return _[_0xa9c5('0x7')](_0x3051b1);var _0x16f331=_['filter'](_0x3051b1);return _0x16f331[_0xa9c5('0x8')]>0x0&&_0x16f331[_0xa9c5('0x8')]<_0x3051b1['length']?!![]:![];}function isIdle(_0x2e4f45){return _0x2e4f45===_0xa9c5('0x9')||_0x2e4f45==='unknown'||_0x2e4f45==='unavailable'||_0x2e4f45===_0xa9c5('0xa')||_[_0xa9c5('0xb')](_0x2e4f45);}function isAgentIdle(_0x45f8d8){if(_0x45f8d8[_0xa9c5('0xc')]!==_0xa9c5('0x9')&&_0x45f8d8[_0xa9c5('0xd')]){_0x45f8d8[_0xa9c5('0xc')]=_0xa9c5('0xe');return![];}return _[_0xa9c5('0x7')]([_0x45f8d8[_0xa9c5('0xf')],_0x45f8d8['faxStatus'],_0x45f8d8[_0xa9c5('0x10')],_0x45f8d8[_0xa9c5('0x11')],_0x45f8d8[_0xa9c5('0x12')],_0x45f8d8[_0xa9c5('0xc')],_0x45f8d8[_0xa9c5('0x13')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xa9c5('0x14')](_0xa9c5('0x15'),{})[_0xa9c5('0x16')](function(_0x19a43e){if(_0x19a43e[_0xa9c5('0x17')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)');}var _0x2b0d73=_0x19a43e[_0xa9c5('0x18')];return routingClient[_0xa9c5('0x14')]('Agents',{})[_0xa9c5('0x16')](function(_0x1142d9){if(_0x1142d9[_0xa9c5('0x17')]){throw new Error(_0xa9c5('0x19'));}var _0x452a9b=_0x1142d9[_0xa9c5('0x18')];return _[_0xa9c5('0x1a')]({},_0x2b0d73,_0x452a9b);});})[_0xa9c5('0x1b')](function(_0x2c7cd5){throw _0x2c7cd5;});}exports[_0xa9c5('0x1c')]=getRealtimeAgents;function getAgentStatus(_0x113c8f){var _0x2d95f8='unknown';if(isAgentPaused(_0x113c8f))_0x2d95f8=_0xa9c5('0xe');else if(isAgentPaused(_0x113c8f,!![]))_0x2d95f8=_0xa9c5('0x1d');else if(isAgentIdle(_0x113c8f))_0x2d95f8='idle';else _0x2d95f8='busy';return _0x2d95f8;}exports[_0xa9c5('0x1e')]=getAgentStatus;function getAgentIdsByQueues(_0x366f5c,_0x10b208){var _0x3b497a=_[_0xa9c5('0x1f')](_0x366f5c)?_0x366f5c:[_0x366f5c];var _0xd4b8a1=_['startCase'](_0x10b208)+'Queue';var _0x3d4e1b=_[_0xa9c5('0x20')](_0x3b497a,function(_0x4b0f05){return db[_0xd4b8a1][_0xa9c5('0x21')]({'where':{'id':_0x4b0f05}})[_0xa9c5('0x16')](function(_0x306c9b){if(!_0x306c9b)return[];return _0x306c9b[_0xa9c5('0x22')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xa9c5('0x23')](_0x3d4e1b)[_0xa9c5('0x16')](function(_0xe44e6d){var _0x51b64a=_(_0xe44e6d)['flatten']()[_0xa9c5('0x20')]('id')['uniq']()[_0xa9c5('0x24')]();return _0x51b64a;});}exports[_0xa9c5('0x25')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x4caefa,_0x11a723,_0x320dc0){try{if(_0x11a723['length']>0x0){_0x4caefa=_0x4caefa[_0xa9c5('0x26')](function(_0x32baf9){return _0x11a723[_0xa9c5('0x27')](_0x32baf9['id']);});}var _0x185eb8=_0x4caefa[_0xa9c5('0x26')](function(_0x4f6e70){var _0x36f267='busy';if(isAgentIdle(_0x4f6e70)){_0x36f267=_0xa9c5('0x9');}return _0x36f267===_0x320dc0;});return _[_0xa9c5('0x20')](_0x185eb8,'id');}catch(_0x2eeed1){throw _0x2eeed1;}}exports['getAgentIdsByStatus']=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0xc6d0c1,_0xbe29c5,_0x5bc9bb){return Promise[_0xa9c5('0x28')]()[_0xa9c5('0x16')](function(){if(_0xbe29c5[_0xa9c5('0x8')]>0x0){_0xc6d0c1=_0xc6d0c1[_0xa9c5('0x26')](function(_0x22ee21){return _0xbe29c5[_0xa9c5('0x27')](_0x22ee21['id']);});}return _0xc6d0c1;})[_0xa9c5('0x16')](function(){return db['User'][_0xa9c5('0x29')]({'attributes':['id',_0xa9c5('0x2a'),_0xa9c5('0x2b'),_0xa9c5('0x2c'),_0xa9c5('0x4'),_0xa9c5('0x2d'),_0xa9c5('0x5'),_0xa9c5('0x6'),'voicePause','whatsappPause',_0xa9c5('0x2e')],'where':{'id':{'$in':_[_0xa9c5('0x20')](_0xc6d0c1,'id')}},'raw':!![]});})[_0xa9c5('0x16')](function(_0x1313b2){return _0x1313b2[_0xa9c5('0x20')](function(_0x25121e){var _0x4dfdb5=_['find'](_0xc6d0c1,['id',_0x25121e['id']]);var _0x517b9a=filterAgentAttributes(_0x4dfdb5);_[_0xa9c5('0x1a')](_0x25121e,_0x517b9a);_0x25121e[_0xa9c5('0x2f')]=getAgentStatus(_0x25121e);return _0x25121e;});})['then'](function(_0x13a1f5){var _0x56eb82=sortAgentsByStatus(_0x13a1f5,_0x5bc9bb);return _[_0xa9c5('0x20')](_0x56eb82,'id');})[_0xa9c5('0x1b')](function(_0x2567be){throw _0x2567be;});}exports[_0xa9c5('0x30')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x593be8){var _0x675588={'fields':[],'order':null};var _0x2cd721=_0x593be8[_0xa9c5('0x31')](',');_0x675588[_0xa9c5('0x32')]=_[_0xa9c5('0x26')](_0x2cd721,function(_0x17ef8e){if(!_0x17ef8e[_0xa9c5('0x27')](_0xa9c5('0x2f'))){return!![];}_0x675588['order']=_[_0xa9c5('0x33')](_0x17ef8e,'-')?_0xa9c5('0x34'):_0xa9c5('0x35');return![];});return _0x675588;}exports[_0xa9c5('0x36')]=getUpdatedSortOptions;function validateSortParameter(_0x1132e0){if(!_0x1132e0){_0x1132e0=_0xa9c5('0x37');}if(_0x1132e0['includes'](_0xa9c5('0x2b'))&&!_0x1132e0['includes'](_0xa9c5('0x38'))){var _0x5c89e7=_0x1132e0[_0xa9c5('0x39')](0x0,_0x1132e0[_0xa9c5('0x3a')](_0xa9c5('0x2b')));_0x1132e0+=','+_0x5c89e7+'internal';}return _0x1132e0;}exports[_0xa9c5('0x3b')]=validateSortParameter;function sortAgentsByStatus(_0x1ddd72,_0x3a2b67){var _0x26dd0c=_0x1ddd72['sort'](function(_0x2dbb48,_0x97803f){if(_0x2dbb48[_0xa9c5('0x2f')]===_0x97803f[_0xa9c5('0x2f')]){if(_0x2dbb48[_0xa9c5('0x2f')]==='pause'){if(_0x3a2b67===_0xa9c5('0x34')){return(_0x2dbb48['pauseType']||'')<(_0x97803f[_0xa9c5('0x2e')]||'')||_0x2dbb48[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()>_0x97803f[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()?0x1:-0x1;}else{return(_0x2dbb48[_0xa9c5('0x2e')]||'')<(_0x97803f[_0xa9c5('0x2e')]||'')||_0x2dbb48[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()>_0x97803f[_0xa9c5('0x2b')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3a2b67===_0xa9c5('0x34')){return _0x2dbb48[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()<_0x97803f[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()?0x1:-0x1;}else{return _0x2dbb48[_0xa9c5('0x2b')]['toLowerCase']()<_0x97803f[_0xa9c5('0x2b')][_0xa9c5('0x3c')]()?-0x1:0x1;}}}else{if(_0x3a2b67==='DESC'){return _0x2dbb48['globalStatus']<_0x97803f['globalStatus']?0x1:-0x1;}else{return _0x2dbb48['globalStatus']<_0x97803f['globalStatus']?-0x1:0x1;}}});return _0x26dd0c;}exports[_0xa9c5('0x3d')]=sortAgentsByStatus;function filterAgentAttributes(_0x569185){var _0x245f9d=[_0xa9c5('0x3e'),_0xa9c5('0x3f'),_0xa9c5('0x40'),_0xa9c5('0x41'),_0xa9c5('0x2e'),_0xa9c5('0x41'),_0xa9c5('0x38'),_0xa9c5('0x42'),_0xa9c5('0x2c'),_0xa9c5('0x5'),'mailPause',_0xa9c5('0x6'),'whatsappPause',_0xa9c5('0x4'),_0xa9c5('0xd'),'chatCapacity','openchannelCapacity',_0xa9c5('0x43'),_0xa9c5('0x44'),_0xa9c5('0x45'),'faxCapacity','chatCurrentCapacity',_0xa9c5('0x46'),_0xa9c5('0x47'),'smsCurrentCapacity',_0xa9c5('0x48'),_0xa9c5('0x49'),_0xa9c5('0xf'),_0xa9c5('0x11'),_0xa9c5('0x10'),_0xa9c5('0x12'),'whatsappStatus','faxStatus','voiceStatus',_0xa9c5('0x4a'),_0xa9c5('0x4b'),_0xa9c5('0x4c'),_0xa9c5('0x4d'),_0xa9c5('0x4e'),_0xa9c5('0x4f'),'voiceStatusTime',_0xa9c5('0x50'),_0xa9c5('0x51'),_0xa9c5('0x52'),_0xa9c5('0x53'),_0xa9c5('0x54'),_0xa9c5('0x55')];var _0x547654=['chatPause',_0xa9c5('0x5'),'mailPause',_0xa9c5('0x6'),'whatsappPause',_0xa9c5('0x4'),_0xa9c5('0xd'),_0xa9c5('0x3f')];var _0x5c7d7c=_(_0x569185)[_0xa9c5('0x56')](_0x547654)[_0xa9c5('0x57')](_0x245f9d)[_0xa9c5('0x24')]();return _0x5c7d7c;}exports[_0xa9c5('0x58')]=filterAgentAttributes;function getRealtimeAgentsQueryFields(){return['id','name','fullname',_0xa9c5('0x59'),_0xa9c5('0x38'),_0xa9c5('0x3f'),'globalStatus',_0xa9c5('0x3e'),_0xa9c5('0x40'),_0xa9c5('0x2e'),_0xa9c5('0x41'),_0xa9c5('0x4'),_0xa9c5('0x2c'),_0xa9c5('0x2d'),_0xa9c5('0x5'),'smsPause',_0xa9c5('0xd'),'whatsappPause',_0xa9c5('0xf'),_0xa9c5('0x5a'),_0xa9c5('0x10'),'openchannelStatus',_0xa9c5('0x12'),_0xa9c5('0xc'),'whatsappStatus',_0xa9c5('0x4a'),_0xa9c5('0x4f'),_0xa9c5('0x4c'),_0xa9c5('0x4b'),'smsStatusTime',_0xa9c5('0x5b'),_0xa9c5('0x4e'),_0xa9c5('0x5c'),_0xa9c5('0x5d'),'mailCapacity','openchannelCapacity',_0xa9c5('0x44'),_0xa9c5('0x45'),_0xa9c5('0x5e'),_0xa9c5('0x49'),_0xa9c5('0x47'),_0xa9c5('0x46'),'smsCurrentCapacity',_0xa9c5('0x48'),_0xa9c5('0x53'),_0xa9c5('0x54'),_0xa9c5('0x51'),_0xa9c5('0x5f'),_0xa9c5('0x50'),_0xa9c5('0x55'),_0xa9c5('0x52')];}exports[_0xa9c5('0x60')]=getRealtimeAgentsQueryFields; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 8282b5f..3a2dc78 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2491=['dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','request','startCase','Queues','then','error','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','getRealtimeQueues','voice','concat','map','loggedInDb','available','talking','pTalking','find','merge','pick','initializeQueues','lodash','jayson/promise','client','http','loggedIn','paused','waiting','busy','inUse','notInUse','onHold','ringing','unavailable','unknown','originated','message','statusMessage','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond'];(function(_0x241ff8,_0x6ce6de){var _0x5d24df=function(_0x2d3a9b){while(--_0x2d3a9b){_0x241ff8['push'](_0x241ff8['shift']());}};_0x5d24df(++_0x6ce6de);}(_0x2491,0x1b4));var _0x1249=function(_0x575b65,_0x2c90e0){_0x575b65=_0x575b65-0x0;var _0x2555be=_0x2491[_0x575b65];return _0x2555be;};'use strict';var _=require(_0x1249('0x0'));var jayson=require(_0x1249('0x1'));var util=require('util');var amiClient=jayson[_0x1249('0x2')][_0x1249('0x3')]({'port':0x232a});var routingClient=jayson[_0x1249('0x2')]['http']({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=['available',_0x1249('0x4'),_0x1249('0x5'),_0x1249('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x1249('0x7'),_0x1249('0x8'),'invalid','loggedInDb',_0x1249('0x9'),_0x1249('0xa'),_0x1249('0xb'),'ringInUse','talking',_0x1249('0xc'),_0x1249('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=['pTalking',_0x1249('0xe'),_0x1249('0xf'),_0x1249('0x10'),'dialActive',_0x1249('0x11'),_0x1249('0x12'),_0x1249('0x13'),_0x1249('0x14'),_0x1249('0x15'),_0x1249('0x16'),'erlangAbandonmentRate','erlangBusyFactor',_0x1249('0x17'),_0x1249('0x18'),_0x1249('0x19'),_0x1249('0x1a'),'predictiveIntervalTotalCalls',_0x1249('0x1b'),_0x1249('0x1c'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime',_0x1249('0x1d')];function getRealtimeQueues(_0x1c11df,_0x45cccc){var _0x48d16b=_0x45cccc==='voice'?amiClient:routingClient;return _0x48d16b[_0x1249('0x1e')](_[_0x1249('0x1f')](_0x45cccc)+_0x1249('0x20'),_0x1c11df)[_0x1249('0x21')](function(_0x290318){if(_0x290318[_0x1249('0x22')])throw new Error(util[_0x1249('0x23')](_0x1249('0x24'),_0x45cccc));return _0x290318[_0x1249('0x25')];})[_0x1249('0x26')](function(_0x53f07a){throw _0x53f07a;});}exports[_0x1249('0x27')]=getRealtimeQueues;function initializeQueues(_0x182e8a,_0x405ef6,_0x3f0653,_0xe06c23){var _0x33f59c=DEFAULT_QUEUE_ATTRIBUTES;if(_0x3f0653===_0x1249('0x28')){if(_0xe06c23==='inbound'){_0x33f59c=_0x33f59c[_0x1249('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0xe06c23==='outbound'){_0x33f59c=_0x33f59c[_0x1249('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x182e8a[_0x1249('0x2a')](function(_0x6493fe){var _0xf67793=_0x6493fe['get']({'plain':!![]});_0xf67793[_0x1249('0x5')]=0x0;_0xf67793[_0x1249('0x2b')]=0x0;_0xf67793[_0x1249('0x4')]=0x0;_0xf67793[_0x1249('0x2c')]=0x0;_0xf67793[_0x1249('0x6')]=0x0;if(_0x3f0653===_0x1249('0x28')){_0xf67793[_0x1249('0x2d')]=0x0;_0xf67793[_0x1249('0x7')]=0x0;if(_0xe06c23==='outbound'){_0xf67793[_0x1249('0x2e')]=0x0;_0xf67793['originated']=0x0;}}var _0x171789=_[_0x1249('0x2f')](_0x405ef6,['id',_0xf67793['id']]);if(_0x171789){_[_0x1249('0x30')](_0xf67793,_[_0x1249('0x31')](_0x171789,_0x33f59c));}return _0xf67793;});}exports[_0x1249('0x32')]=initializeQueues; \ No newline at end of file +var _0x1336=['onHold','ringing','talking','unavailable','pTalking','message','statusMessage','dialActive','Trunk','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','voice','startCase','Queues','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','getRealtimeQueues','inbound','concat','map','outbound','originated','find','merge','pick','initializeQueues','jayson/promise','util','client','http','available','paused','waiting','busy','invalid','loggedInDb','notInUse'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1336,0x175));var _0x6133=function(_0x1af776,_0x1c4d12){_0x1af776=_0x1af776-0x0;var _0x4c4cde=_0x1336[_0x1af776];return _0x4c4cde;};'use strict';var _=require('lodash');var jayson=require(_0x6133('0x0'));var util=require(_0x6133('0x1'));var amiClient=jayson[_0x6133('0x2')][_0x6133('0x3')]({'port':0x232a});var routingClient=jayson[_0x6133('0x2')][_0x6133('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x6133('0x4'),'loggedIn',_0x6133('0x5'),_0x6133('0x6')];var VOICE_QUEUE_ATTRIBUTES=[_0x6133('0x7'),'inUse',_0x6133('0x8'),_0x6133('0x9'),_0x6133('0xa'),_0x6133('0xb'),_0x6133('0xc'),'ringInUse',_0x6133('0xd'),_0x6133('0xe'),'unknown'];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x6133('0xf'),'originated',_0x6133('0x10'),_0x6133('0x11'),_0x6133('0x12'),'dialMethod',_0x6133('0x13'),'startPredictive','startProgressive',_0x6133('0x14'),_0x6133('0x15'),_0x6133('0x16'),_0x6133('0x17'),_0x6133('0x18'),'dialPredictiveIntervalMaxThreshold',_0x6133('0x19'),_0x6133('0x1a'),_0x6133('0x1b'),_0x6133('0x1c'),_0x6133('0x1d'),_0x6133('0x1e'),_0x6133('0x1f'),'predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x323803,_0x1eb143){var _0x1bfd16=_0x1eb143===_0x6133('0x20')?amiClient:routingClient;return _0x1bfd16['request'](_[_0x6133('0x21')](_0x1eb143)+_0x6133('0x22'),_0x323803)['then'](function(_0x6d41ec){if(_0x6d41ec[_0x6133('0x23')])throw new Error(util['format'](_0x6133('0x24'),_0x1eb143));return _0x6d41ec[_0x6133('0x25')];})['catch'](function(_0x9eccba){throw _0x9eccba;});}exports[_0x6133('0x26')]=getRealtimeQueues;function initializeQueues(_0x3241cd,_0x2b8375,_0x504c7e,_0x134b6b){var _0x12f6e2=DEFAULT_QUEUE_ATTRIBUTES;if(_0x504c7e==='voice'){if(_0x134b6b===_0x6133('0x27')){_0x12f6e2=_0x12f6e2[_0x6133('0x28')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x134b6b==='outbound'){_0x12f6e2=_0x12f6e2[_0x6133('0x28')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x3241cd[_0x6133('0x29')](function(_0x30bb99){var _0x41b63e=_0x30bb99['get']({'plain':!![]});_0x41b63e['paused']=0x0;_0x41b63e['loggedInDb']=0x0;_0x41b63e['loggedIn']=0x0;_0x41b63e[_0x6133('0x4')]=0x0;_0x41b63e['waiting']=0x0;if(_0x504c7e===_0x6133('0x20')){_0x41b63e['talking']=0x0;_0x41b63e[_0x6133('0x7')]=0x0;if(_0x134b6b===_0x6133('0x2a')){_0x41b63e[_0x6133('0xf')]=0x0;_0x41b63e[_0x6133('0x2b')]=0x0;}}var _0x40912e=_[_0x6133('0x2c')](_0x2b8375,['id',_0x41b63e['id']]);if(_0x40912e){_[_0x6133('0x2d')](_0x41b63e,_[_0x6133('0x2e')](_0x40912e,_0x12f6e2));}return _0x41b63e;});}exports[_0x6133('0x2f')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 7a02c38..cbe8730 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x561432,_0x21ec65){var _0x3485b6=function(_0x3e022f){while(--_0x3e022f){_0x561432['push'](_0x561432['shift']());}};_0x3485b6(++_0x21ec65);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file +var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x3ed1c1,_0x45fe0a){var _0x11797d=function(_0x26bad3){while(--_0x26bad3){_0x3ed1c1['push'](_0x3ed1c1['shift']());}};_0x11797d(++_0x45fe0a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 00e1d69..73ab7a5 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 _0x280e=['orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','model','join','createHash','md5','update','digest','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces'];(function(_0x433b79,_0x3f6978){var _0x75a784=function(_0x2f0dfd){while(--_0x2f0dfd){_0x433b79['push'](_0x433b79['shift']());}};_0x75a784(++_0x3f6978);}(_0x280e,0x118));var _0xe280=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x280e[_0x9aada2];return _0x196dff;};'use strict';var _=require(_0xe280('0x0'));var os=require('os');var crypto=require(_0xe280('0x1'));var machine=require(_0xe280('0x2'));var exec=require(_0xe280('0x3'))[_0xe280('0x4')];var config=require(_0xe280('0x5'));function getInterfaces(){var _0xfdab45=[];var _0x16909f=os[_0xe280('0x6')]();var _0x31ec32=_[_0xe280('0x7')](_[_0xe280('0x8')](_0x16909f));for(var _0x1b2e4a=0x0;_0x1b2e4a<_0x31ec32[_0xe280('0x9')];_0x1b2e4a++){var _0x1b7af6=_0x16909f[_0x31ec32[_0x1b2e4a]][_0xe280('0xa')](function(_0x1f294f){return _0x1f294f[_0xe280('0xb')]===_0xe280('0xc')&&_0x1f294f[_0xe280('0xd')]===![];});_0xfdab45=_0xfdab45[_0xe280('0xe')](_0x1b7af6);}return _0xfdab45;}function getFirstInterface(){var _0x51e1be=_[_0xe280('0xf')](getInterfaces());return{'macAddress':_0x51e1be&&_0x51e1be[_0xe280('0x10')]?_0x51e1be[_0xe280('0x10')]:_0xe280('0x11'),'ipAddress':_0x51e1be&&_0x51e1be[_0xe280('0x12')]?_0x51e1be[_0xe280('0x12')]:_0xe280('0x13')};}exports[_0xe280('0x14')]=getFirstInterface;function getCPUhash(){var _0x290f2f=_[_0xe280('0x7')](os[_0xe280('0x15')]()['map'](function(_0x1b5293){return _0x1b5293[_0xe280('0x16')];}))[_0xe280('0x17')](':');return crypto[_0xe280('0x18')](_0xe280('0x19'))[_0xe280('0x1a')](_0x290f2f)[_0xe280('0x1b')](_0xe280('0x1c'));}exports[_0xe280('0x1d')]=function(){var _0x3b303e=os[_0xe280('0x1e')]();var _0x589bf1=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x589bf1[_0xe280('0x1f')](config[_0xe280('0x20')])){return config[_0xe280('0x20')];}else if(_0x3b303e===_0xe280('0x21')){return exec(_0xe280('0x22'),{'encoding':_0xe280('0x23')})[_0xe280('0x24')]('\x0d\x0a','');}else{var _0x27ed67=getFirstInterface();var _0x4ee08c=getCPUhash();var _0x3ddee8=_0x4ee08c+'|'+os[_0xe280('0x25')]()+'|'+_0x27ed67[_0xe280('0x26')]+'|'+_0x27ed67[_0xe280('0x27')];var _0x4fda6a=crypto['createHash']('md5')[_0xe280('0x1a')](_0x3ddee8)[_0xe280('0x1b')]('hex');return _0x4fda6a[_0xe280('0x28')](0x0,0x8)+'-'+_0x4fda6a[_0xe280('0x28')](0x8,0xc)+'-'+_0x4fda6a[_0xe280('0x28')](0xc,0x10)+'-'+_0x4fda6a['substring'](0x10,0x14)+'-'+_0x4fda6a[_0xe280('0x28')](0x14);}}; \ No newline at end of file +var _0x4b22=['getFirstInterface','map','join','createHash','md5','digest','hex','getUuid','platform','licenseToken','win32','utf8','replace','ipAddress','update','substring','lodash','crypto','child_process','execSync','networkInterfaces','orderBy','keys','filter','IPv4','internal','head','mac','00:00:00:00:00:00','address'];(function(_0x41a6c9,_0x288c65){var _0x4de8d3=function(_0xd1b16e){while(--_0xd1b16e){_0x41a6c9['push'](_0x41a6c9['shift']());}};_0x4de8d3(++_0x288c65);}(_0x4b22,0x196));var _0x24b2=function(_0x184a5f,_0x30896e){_0x184a5f=_0x184a5f-0x0;var _0x5cacbc=_0x4b22[_0x184a5f];return _0x5cacbc;};'use strict';var _=require(_0x24b2('0x0'));var os=require('os');var crypto=require(_0x24b2('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x24b2('0x2'))[_0x24b2('0x3')];var config=require('../environment');function getInterfaces(){var _0x542e62=[];var _0x333c1e=os[_0x24b2('0x4')]();var _0x13d470=_[_0x24b2('0x5')](_[_0x24b2('0x6')](_0x333c1e));for(var _0x123dd9=0x0;_0x123dd9<_0x13d470['length'];_0x123dd9++){var _0x5ed86c=_0x333c1e[_0x13d470[_0x123dd9]][_0x24b2('0x7')](function(_0xc2ab23){return _0xc2ab23['family']===_0x24b2('0x8')&&_0xc2ab23[_0x24b2('0x9')]===![];});_0x542e62=_0x542e62['concat'](_0x5ed86c);}return _0x542e62;}function getFirstInterface(){var _0x4f9a86=_[_0x24b2('0xa')](getInterfaces());return{'macAddress':_0x4f9a86&&_0x4f9a86[_0x24b2('0xb')]?_0x4f9a86['mac']:_0x24b2('0xc'),'ipAddress':_0x4f9a86&&_0x4f9a86[_0x24b2('0xd')]?_0x4f9a86[_0x24b2('0xd')]:'127.0.0.1'};}exports[_0x24b2('0xe')]=getFirstInterface;function getCPUhash(){var _0x5b9b1e=_['orderBy'](os['cpus']()[_0x24b2('0xf')](function(_0x2e629c){return _0x2e629c['model'];}))[_0x24b2('0x10')](':');return crypto[_0x24b2('0x11')](_0x24b2('0x12'))['update'](_0x5b9b1e)[_0x24b2('0x13')](_0x24b2('0x14'));}exports[_0x24b2('0x15')]=function(){var _0xc3675f=os[_0x24b2('0x16')]();var _0x49e757=/[0-9a-f-]{36}/;if(config[_0x24b2('0x17')]&&_0x49e757['test'](config['licenseToken'])){return config[_0x24b2('0x17')];}else if(_0xc3675f===_0x24b2('0x18')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x24b2('0x19')})[_0x24b2('0x1a')]('\x0d\x0a','');}else{var _0x4947af=getFirstInterface();var _0x4f828e=getCPUhash();var _0x3eb262=_0x4f828e+'|'+os['hostname']()+'|'+_0x4947af['macAddress']+'|'+_0x4947af[_0x24b2('0x1b')];var _0x45f99c=crypto['createHash'](_0x24b2('0x12'))[_0x24b2('0x1c')](_0x3eb262)[_0x24b2('0x13')](_0x24b2('0x14'));return _0x45f99c[_0x24b2('0x1d')](0x0,0x8)+'-'+_0x45f99c[_0x24b2('0x1d')](0x8,0xc)+'-'+_0x45f99c[_0x24b2('0x1d')](0xc,0x10)+'-'+_0x45f99c['substring'](0x10,0x14)+'-'+_0x45f99c[_0x24b2('0x1d')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index e10d1ac..e240863 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 _0x23ba=['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','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','moment','request-promise','version','../../mysqldb','../../components/encryptor','./hardware','../logger','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','exports','GET','then','catch','get','data1','data2','active','license','info','update'];(function(_0x3a531c,_0x1d083e){var _0x317870=function(_0x14cac5){while(--_0x14cac5){_0x3a531c['push'](_0x3a531c['shift']());}};_0x317870(++_0x1d083e);}(_0x23ba,0xbb));var _0xa23b=function(_0x9bcf7c,_0x29ecfe){_0x9bcf7c=_0x9bcf7c-0x0;var _0x34fa5f=_0x23ba[_0x9bcf7c];return _0x34fa5f;};'use strict';var util=require(_0xa23b('0x0'));var moment=require(_0xa23b('0x1'));var rp=require(_0xa23b('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xa23b('0x3'));var db=require(_0xa23b('0x4'))['db'];var encryptor=require(_0xa23b('0x5'));var hardware=require(_0xa23b('0x6'));var logger=require(_0xa23b('0x7'))('license');var HOST=_0xa23b('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x328189){return new BPromise(function(_0x168e8a,_0x107002){var _0x533d52=util['format'](_0xa23b('0x9'),HOST,_0x328189,module['exports'][_0xa23b('0x3')]);if(oldToken){_0x533d52=util[_0xa23b('0xa')](_0xa23b('0xb'),HOST,_0x328189,module[_0xa23b('0xc')][_0xa23b('0x3')],oldToken);}var _0x4bbcd9={'uri':_0x533d52,'method':_0xa23b('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x4bbcd9)[_0xa23b('0xe')](function(_0x5bd752){_0x168e8a(_0x5bd752);})[_0xa23b('0xf')](function(_0x1d4ecf){_0x107002(_0x1d4ecf);});});}function manageLicense(_0xace888,_0xfa67d1){var _0x2b0a58=_0xfa67d1[_0xa23b('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x2b0a58[_0xa23b('0x11')]!==_0xace888&&!_0x2b0a58[_0xa23b('0x12')]){oldToken=_0x2b0a58[_0xa23b('0x11')];}httpRequest(_0xace888)['then'](function(_0x53454d){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x53454d[_0xa23b('0x13')]){isOldTokenSent=![];if(!_0x2b0a58[_0xa23b('0x14')]&&_0x2b0a58['license']!=_0x53454d[_0xa23b('0x14')]||_0x2b0a58[_0xa23b('0x14')]&&_0x2b0a58[_0xa23b('0x12')]){logger[_0xa23b('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x2b0a58[_0xa23b('0x14')]&&!_0x2b0a58[_0xa23b('0x12')]&&_0x2b0a58[_0xa23b('0x14')]!=_0x53454d[_0xa23b('0x14')]){logger[_0xa23b('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x2b0a58[_0xa23b('0x14')]&&!_0x2b0a58[_0xa23b('0x12')]&&_0x2b0a58[_0xa23b('0x14')]==_0x53454d[_0xa23b('0x14')]){return _0xfa67d1;}return _0xfa67d1[_0xa23b('0x16')]({'data1':_0xace888,'data2':null,'license':_0x53454d[_0xa23b('0x14')]});}else{if(_0x53454d[_0xa23b('0x14')]||_0x2b0a58['license']){if(!_0x2b0a58[_0xa23b('0x12')]){if(_0x2b0a58[_0xa23b('0x11')]==_0xace888){GRAY_PERIOD_REASON=_0xa23b('0x17');logger[_0xa23b('0x15')](_0xa23b('0x18'));}else{GRAY_PERIOD_REASON=_0xa23b('0x19');logger[_0xa23b('0x15')](_0xa23b('0x1a'),_0x2b0a58['data1'],_0xace888);}logger[_0xa23b('0x15')](_0xa23b('0x1b'),GRAY_PERIOD_REASON[_0xa23b('0x1c')](),moment()['format'](_0xa23b('0x1d')));return _0xfa67d1['update']({'data2':encryptor[_0xa23b('0x1e')](moment()[_0xa23b('0xa')](_0xa23b('0x1d')))});}else{if(moment()[_0xa23b('0x1f')](encryptor[_0xa23b('0x20')](_0x2b0a58[_0xa23b('0x12')]),_0xa23b('0x21'))>DAYS){logger[_0xa23b('0x15')](_0xa23b('0x22'),moment()[_0xa23b('0xa')](_0xa23b('0x1d')));isOldTokenSent=![];return _0xfa67d1['update']({'data1':_0xace888,'data2':null,'license':null});}}}else{if(_0x2b0a58[_0xa23b('0x11')]!=_0xace888){logger[_0xa23b('0x15')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2b0a58['data1'],_0xace888);return _0xfa67d1['update']({'data1':_0xace888,'data2':null,'license':null});}}}return _0xfa67d1;})['then'](function(_0x15b631){_0xfa67d1=_0x15b631;})[_0xa23b('0xf')](function(_0x2aec29){logger[_0xa23b('0x23')](_0x2aec29[_0xa23b('0x24')]);})[_0xa23b('0x25')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0xfa67d1);},TIME);});}function defaultLicense(){var _0x11eb3b=hardware['getUuid']();if(_0x11eb3b){return db['License'][_0xa23b('0x26')]({'where':{'id':0x1},'defaults':{'data1':_0x11eb3b}})[_0xa23b('0x27')](function(_0x2d4d5a,_0x3af9f7){logger[_0xa23b('0x15')](_0xa23b('0x28'),_0x11eb3b);manageLicense(_0x11eb3b,_0x2d4d5a);})['catch'](function(_0x2f1752){logger['error'](_0x2f1752[_0xa23b('0x24')]);});}}exports[_0xa23b('0x29')]=defaultLicense; \ No newline at end of file +var _0x25aa=['active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data2','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','util','moment','request-promise','bluebird','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1'];(function(_0x347ea8,_0x2ac098){var _0x2e83f4=function(_0x430d5f){while(--_0x430d5f){_0x347ea8['push'](_0x347ea8['shift']());}};_0x2e83f4(++_0x2ac098);}(_0x25aa,0x15d));var _0xa25a=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x25aa[_0xda464c];return _0x19e222;};'use strict';var util=require(_0xa25a('0x0'));var moment=require(_0xa25a('0x1'));var rp=require(_0xa25a('0x2'));var BPromise=require(_0xa25a('0x3'));var pkginfo=require('pkginfo')(module,_0xa25a('0x4'));var db=require(_0xa25a('0x5'))['db'];var encryptor=require(_0xa25a('0x6'));var hardware=require(_0xa25a('0x7'));var logger=require(_0xa25a('0x8'))(_0xa25a('0x9'));var HOST=_0xa25a('0xa');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x5aab07){return new BPromise(function(_0x4bdddf,_0xa658c8){var _0x1ebf16=util[_0xa25a('0xb')](_0xa25a('0xc'),HOST,_0x5aab07,module[_0xa25a('0xd')]['version']);if(oldToken){_0x1ebf16=util[_0xa25a('0xb')](_0xa25a('0xe'),HOST,_0x5aab07,module[_0xa25a('0xd')]['version'],oldToken);}var _0x26a8d5={'uri':_0x1ebf16,'method':_0xa25a('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x26a8d5)[_0xa25a('0x10')](function(_0x53ac1d){_0x4bdddf(_0x53ac1d);})[_0xa25a('0x11')](function(_0x326d00){_0xa658c8(_0x326d00);});});}function manageLicense(_0xfd0552,_0x57aacd){var _0x46e65e=_0x57aacd[_0xa25a('0x12')]({'plain':!![]});if(!isOldTokenSent&&_0x46e65e[_0xa25a('0x13')]!==_0xfd0552&&!_0x46e65e['data2']){oldToken=_0x46e65e[_0xa25a('0x13')];}httpRequest(_0xfd0552)['then'](function(_0x1101a9){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1101a9[_0xa25a('0x14')]){isOldTokenSent=![];if(!_0x46e65e['license']&&_0x46e65e[_0xa25a('0x9')]!=_0x1101a9[_0xa25a('0x9')]||_0x46e65e[_0xa25a('0x9')]&&_0x46e65e['data2']){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x46e65e[_0xa25a('0x9')]&&!_0x46e65e['data2']&&_0x46e65e[_0xa25a('0x9')]!=_0x1101a9['license']){logger[_0xa25a('0x15')](_0xa25a('0x16'));}if(_0x46e65e[_0xa25a('0x9')]&&!_0x46e65e[_0xa25a('0x17')]&&_0x46e65e[_0xa25a('0x9')]==_0x1101a9[_0xa25a('0x9')]){return _0x57aacd;}return _0x57aacd[_0xa25a('0x18')]({'data1':_0xfd0552,'data2':null,'license':_0x1101a9[_0xa25a('0x9')]});}else{if(_0x1101a9['license']||_0x46e65e[_0xa25a('0x9')]){if(!_0x46e65e[_0xa25a('0x17')]){if(_0x46e65e[_0xa25a('0x13')]==_0xfd0552){GRAY_PERIOD_REASON=_0xa25a('0x19');logger[_0xa25a('0x15')](_0xa25a('0x1a'));}else{GRAY_PERIOD_REASON=_0xa25a('0x1b');logger[_0xa25a('0x15')](_0xa25a('0x1c'),_0x46e65e[_0xa25a('0x13')],_0xfd0552);}logger[_0xa25a('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xa25a('0x1d')));return _0x57aacd[_0xa25a('0x18')]({'data2':encryptor[_0xa25a('0x1e')](moment()[_0xa25a('0xb')](_0xa25a('0x1d')))});}else{if(moment()['diff'](encryptor[_0xa25a('0x1f')](_0x46e65e[_0xa25a('0x17')]),_0xa25a('0x20'))>DAYS){logger[_0xa25a('0x15')](_0xa25a('0x21'),moment()[_0xa25a('0xb')](_0xa25a('0x1d')));isOldTokenSent=![];return _0x57aacd['update']({'data1':_0xfd0552,'data2':null,'license':null});}}}else{if(_0x46e65e[_0xa25a('0x13')]!=_0xfd0552){logger[_0xa25a('0x15')](_0xa25a('0x1c'),_0x46e65e[_0xa25a('0x13')],_0xfd0552);return _0x57aacd[_0xa25a('0x18')]({'data1':_0xfd0552,'data2':null,'license':null});}}}return _0x57aacd;})[_0xa25a('0x10')](function(_0x1a0b84){_0x57aacd=_0x1a0b84;})[_0xa25a('0x11')](function(_0x3abc77){logger[_0xa25a('0x22')](_0x3abc77[_0xa25a('0x23')]);})[_0xa25a('0x24')](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x57aacd);},TIME);});}function defaultLicense(){var _0x2aa10b=hardware[_0xa25a('0x25')]();if(_0x2aa10b){return db[_0xa25a('0x26')][_0xa25a('0x27')]({'where':{'id':0x1},'defaults':{'data1':_0x2aa10b}})[_0xa25a('0x28')](function(_0x457eeb,_0xf6a3f2){logger['info']('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2aa10b);manageLicense(_0x2aa10b,_0x457eeb);})[_0xa25a('0x11')](function(_0x36ca82){logger[_0xa25a('0x22')](_0x36ca82[_0xa25a('0x23')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 26145b4..d3d0c02 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 _0xca31=['disabled','User','role','sequelize','COUNT','col','count','admin','user','telephone','users','forEach','catch','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','add','days','grayReason'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xca31,0x143));var _0x1ca3=function(_0x543bd8,_0x1382c2){_0x543bd8=_0x543bd8-0x0;var _0x31ad82=_0xca31[_0x543bd8];return _0x31ad82;};'use strict';var util=require('util');var _=require(_0x1ca3('0x0'));var moment=require(_0x1ca3('0x1'));var BPromise=require(_0x1ca3('0x2'));var hardware=require(_0x1ca3('0x3'));var encryptor=require(_0x1ca3('0x4'));var db=require(_0x1ca3('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x1ca3('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x1ca3('0x7'),'machineUuid':hardware[_0x1ca3('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':_0x1ca3('0x9'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x40350a){return new BPromise(function(_0x348ac8,_0x810ee6){return db['License']['find'](_[_0x1ca3('0xa')](_0x40350a,{'raw':!![],'where':{'id':0x1}}))[_0x1ca3('0xb')](function(_0x5d1365){return checkLicense(_0x5d1365,null);})[_0x1ca3('0xb')](function(_0x448e96){_0x348ac8(_0x448e96);return;})['catch'](function(_0x5331a6){_0x810ee6(_0x5331a6);});});}function checkLicense(_0x49b48d,_0x340da6){if(!_0x49b48d){demoLicense[_0x1ca3('0xc')]=_0x49b48d[_0x1ca3('0xd')];return demoLicense;}try{var _0xbf528b=_0x340da6||_0x49b48d[_0x1ca3('0xe')];if(_[_0x1ca3('0xf')](_0xbf528b)){throw new Error(_0x1ca3('0x10'));}var _0x4a69b9=_0x49b48d['data1'];var _0x49d472=_0x49b48d[_0x1ca3('0x11')];var _0x5596a6=_0x4a69b9['split']('-')[0x4];var _0x3e41d6=_0x4a69b9[_0x1ca3('0x12')]('-')[0x0];var _0x47530f=encryptor[_0x1ca3('0x13')](_0xbf528b,util[_0x1ca3('0x14')](_0x1ca3('0x15'),_0x5596a6,_0x4a69b9,_0x3e41d6));var _0x3c3bdf=JSON[_0x1ca3('0x16')](_0x47530f);_0x3c3bdf[_0x1ca3('0x17')]=![];_0x3c3bdf[_0x1ca3('0xc')]=_0x4a69b9;_0x3c3bdf[_0x1ca3('0x18')]=hardware[_0x1ca3('0x8')]();if(_0x49d472){var _0x35d272=encryptor['decryptString'](_0x49d472);_0x3c3bdf[_0x1ca3('0x19')]=_0x35d272;_0x3c3bdf['deadline']=moment(_0x35d272)[_0x1ca3('0x1a')](0x7,_0x1ca3('0x1b'))[_0x1ca3('0x14')]();_0x3c3bdf[_0x1ca3('0x1c')]=_0x3c3bdf[_0x1ca3('0xc')]!=_0x3c3bdf[_0x1ca3('0x18')]?'changed':_0x1ca3('0x1d');}return _0x3c3bdf;}catch(_0x36925f){breakingLicense[_0x1ca3('0xc')]=_0x49b48d[_0x1ca3('0xd')];breakingLicense['message']=_0x36925f['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4bf022,_0x5631fa){getLicense()[_0x1ca3('0xb')](function(_0x1c7e29){return db[_0x1ca3('0x1e')]['findAll']({'attributes':[_0x1ca3('0x1f'),[db[_0x1ca3('0x20')]['fn'](_0x1ca3('0x21'),db[_0x1ca3('0x20')][_0x1ca3('0x22')](_0x1ca3('0x1f'))),_0x1ca3('0x23')]],'group':_0x1ca3('0x1f'),'where':{'role':{'$or':[_0x1ca3('0x24'),_0x1ca3('0x25'),_0x1ca3('0x26')]}},'raw':!![]})[_0x1ca3('0xb')](function(_0x2f9b91){var _0x49300e={'user':_0x1c7e29[_0x1ca3('0x27')]||0x0,'telephone':_0x1c7e29['telephones']||0x0};_0x2f9b91[_0x1ca3('0x28')](function(_0x1729c1){var _0x2e679c=_0x1729c1[_0x1ca3('0x1f')]==='admin'?_0x1ca3('0x25'):_0x1729c1[_0x1ca3('0x1f')];_0x49300e[_0x2e679c]-=_0x1729c1['count'];if(_0x49300e[_0x2e679c]<0x0)_0x49300e[_0x2e679c]=0x0;});_0x4bf022(_0x49300e);return;});})[_0x1ca3('0x29')](function(_0xff52ba){_0x5631fa(_0xff52ba);});});}function checkUserLimits(_0x400a66){return new BPromise(function(_0x2e2dae,_0x3ed5d8){getLimits()[_0x1ca3('0xb')](function(_0x20c5f3){var _0x4abbe1=_['pick'](_['countBy'](_0x400a66,_0x1ca3('0x1f')),['admin',_0x1ca3('0x25'),_0x1ca3('0x26')]);var _0x4a5cad=(_0x4abbe1[_0x1ca3('0x24')]||0x0)+(_0x4abbe1[_0x1ca3('0x25')]||0x0);var _0x401e4b=_0x4abbe1[_0x1ca3('0x26')]||0x0;if(_0x4a5cad>_0x20c5f3['user'])return _0x3ed5d8('License\x20limit\x20reached\x20for\x20users');if(_0x401e4b>_0x20c5f3['telephone'])return _0x3ed5d8(_0x1ca3('0x2a'));return _0x2e2dae();})[_0x1ca3('0x29')](function(_0x568dce){_0x3ed5d8(_0x568dce);});});}module[_0x1ca3('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xa089=['lodash','moment','../../mysqldb','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','License','find','then','uuid','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','add','grayReason','changed','disabled','message','User','findAll','sequelize','col','role','count','user','telephone','users','telephones','admin','catch','License\x20limit\x20reached\x20for\x20users','exports','util'];(function(_0x21a848,_0x5ce41a){var _0x5aaf99=function(_0x342593){while(--_0x342593){_0x21a848['push'](_0x21a848['shift']());}};_0x5aaf99(++_0x5ce41a);}(_0xa089,0xfb));var _0x9a08=function(_0x43ea20,_0x3b25e1){_0x43ea20=_0x43ea20-0x0;var _0x179562=_0xa089[_0x43ea20];return _0x179562;};'use strict';var util=require(_0x9a08('0x0'));var _=require(_0x9a08('0x1'));var moment=require(_0x9a08('0x2'));var BPromise=require('bluebird');var hardware=require('./hardware');var encryptor=require('../../components/encryptor');var db=require(_0x9a08('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x9a08('0x4'),'machineUuid':hardware[_0x9a08('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x9a08('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x9a08('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x58968b){return new BPromise(function(_0x41ae44,_0x218d3c){return db[_0x9a08('0x7')][_0x9a08('0x8')](_['defaults'](_0x58968b,{'raw':!![],'where':{'id':0x1}}))[_0x9a08('0x9')](function(_0x224312){return checkLicense(_0x224312,null);})[_0x9a08('0x9')](function(_0x49f891){_0x41ae44(_0x49f891);return;})['catch'](function(_0x4ecc15){_0x218d3c(_0x4ecc15);});});}function checkLicense(_0xc576b5,_0x54424d){if(!_0xc576b5){demoLicense[_0x9a08('0xa')]=_0xc576b5['data1'];return demoLicense;}try{var _0x46ee8f=_0x54424d||_0xc576b5[_0x9a08('0xb')];if(_[_0x9a08('0xc')](_0x46ee8f)){throw new Error(_0x9a08('0xd'));}var _0x3da91f=_0xc576b5[_0x9a08('0xe')];var _0x4c1f68=_0xc576b5[_0x9a08('0xf')];var _0x2c2e0b=_0x3da91f['split']('-')[0x4];var _0x35b715=_0x3da91f[_0x9a08('0x10')]('-')[0x0];var _0x684245=encryptor['decryptString'](_0x46ee8f,util[_0x9a08('0x11')](_0x9a08('0x12'),_0x2c2e0b,_0x3da91f,_0x35b715));var _0x3ba05f=JSON[_0x9a08('0x13')](_0x684245);_0x3ba05f[_0x9a08('0x14')]=![];_0x3ba05f[_0x9a08('0xa')]=_0x3da91f;_0x3ba05f[_0x9a08('0x15')]=hardware[_0x9a08('0x5')]();if(_0x4c1f68){var _0x387f73=encryptor[_0x9a08('0x16')](_0x4c1f68);_0x3ba05f['gray']=_0x387f73;_0x3ba05f['deadline']=moment(_0x387f73)[_0x9a08('0x17')](0x7,'days')[_0x9a08('0x11')]();_0x3ba05f[_0x9a08('0x18')]=_0x3ba05f[_0x9a08('0xa')]!=_0x3ba05f[_0x9a08('0x15')]?_0x9a08('0x19'):_0x9a08('0x1a');}return _0x3ba05f;}catch(_0x5a6098){breakingLicense[_0x9a08('0xa')]=_0xc576b5[_0x9a08('0xe')];breakingLicense['message']=_0x5a6098[_0x9a08('0x1b')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x4dddac,_0x4de033){getLicense()[_0x9a08('0x9')](function(_0x4f5b7a){return db[_0x9a08('0x1c')][_0x9a08('0x1d')]({'attributes':['role',[db[_0x9a08('0x1e')]['fn']('COUNT',db['sequelize'][_0x9a08('0x1f')](_0x9a08('0x20'))),_0x9a08('0x21')]],'group':'role','where':{'role':{'$or':['admin',_0x9a08('0x22'),_0x9a08('0x23')]}},'raw':!![]})[_0x9a08('0x9')](function(_0x2824fc){var _0x574fe4={'user':_0x4f5b7a[_0x9a08('0x24')]||0x0,'telephone':_0x4f5b7a[_0x9a08('0x25')]||0x0};_0x2824fc['forEach'](function(_0x2473a0){var _0x281eec=_0x2473a0['role']===_0x9a08('0x26')?_0x9a08('0x22'):_0x2473a0['role'];_0x574fe4[_0x281eec]-=_0x2473a0['count'];if(_0x574fe4[_0x281eec]<0x0)_0x574fe4[_0x281eec]=0x0;});_0x4dddac(_0x574fe4);return;});})[_0x9a08('0x27')](function(_0x129ec9){_0x4de033(_0x129ec9);});});}function checkUserLimits(_0x4b8e9e){return new BPromise(function(_0x183ca1,_0x2497ad){getLimits()[_0x9a08('0x9')](function(_0x160d04){var _0x4f1f43=_['pick'](_['countBy'](_0x4b8e9e,_0x9a08('0x20')),[_0x9a08('0x26'),'user',_0x9a08('0x23')]);var _0x22ced2=(_0x4f1f43[_0x9a08('0x26')]||0x0)+(_0x4f1f43[_0x9a08('0x22')]||0x0);var _0x2140a2=_0x4f1f43['telephone']||0x0;if(_0x22ced2>_0x160d04[_0x9a08('0x22')])return _0x2497ad(_0x9a08('0x28'));if(_0x2140a2>_0x160d04[_0x9a08('0x23')])return _0x2497ad('License\x20limit\x20reached\x20for\x20telephones');return _0x183ca1();})[_0x9a08('0x27')](function(_0x22c4eb){_0x2497ad(_0x22c4eb);});});}module[_0x9a08('0x29')]={'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 7ee963e..50ebfca 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 _0xe5af=['http://localhost:9000','myappanuglar-secret','secret'];(function(_0x4b5550,_0x56d806){var _0x417ef9=function(_0x20a06a){while(--_0x20a06a){_0x4b5550['push'](_0x4b5550['shift']());}};_0x417ef9(++_0x56d806);}(_0xe5af,0x9c));var _0xfe5a=function(_0xf66af0,_0x49ab12){_0xf66af0=_0xf66af0-0x0;var _0x266397=_0xe5af[_0xf66af0];return _0x266397;};'use strict';module['exports']={'DOMAIN':_0xfe5a('0x0'),'SESSION_SECRET':_0xfe5a('0x1'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xfe5a('0x2'),'DEBUG':''}; \ No newline at end of file +var _0x5f2f=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x429b7c,_0x31ba9b){var _0x113a3e=function(_0x13905f){while(--_0x13905f){_0x429b7c['push'](_0x429b7c['shift']());}};_0x113a3e(++_0x31ba9b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x976b53,_0x4489a6){_0x976b53=_0x976b53-0x0;var _0x5daab6=_0x5f2f[_0x976b53];return _0x5daab6;};'use strict';module[_0xf5f2('0x0')]={'DOMAIN':_0xf5f2('0x1'),'SESSION_SECRET':_0xf5f2('0x2'),'GOOGLE_ID':_0xf5f2('0x3'),'GOOGLE_SECRET':_0xf5f2('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index aceef77..1f20f66 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6361=['exports'];(function(_0x5cc80d,_0x2deed5){var _0x1e143f=function(_0x4857ef){while(--_0x4857ef){_0x5cc80d['push'](_0x5cc80d['shift']());}};_0x1e143f(++_0x2deed5);}(_0x6361,0x198));var _0x1636=function(_0x2db8ae,_0x2d58c3){_0x2db8ae=_0x2db8ae-0x0;var _0xb2738=_0x6361[_0x2db8ae];return _0xb2738;};'use strict';var fileLogger=require('../utils/loggers')['fileLogger'];module[_0x1636('0x0')]=fileLogger; \ No newline at end of file +var _0xdfdb=['fileLogger','exports'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0xdfdb,0x11a));var _0xbdfd=function(_0x3d66f0,_0x3f4e63){_0x3d66f0=_0x3d66f0-0x0;var _0x4164f3=_0xdfdb[_0x3d66f0];return _0x4164f3;};'use strict';var fileLogger=require('../utils/loggers')[_0xbdfd('0x0')];module[_0xbdfd('0x1')]=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 728608a..31e5dbe 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 _0x12c5=['../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','resolve','join','root','legacy-libs','express','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js','routing'];(function(_0x2de2b4,_0x83884){var _0x24b4d9=function(_0x3b5e30){while(--_0x3b5e30){_0x2de2b4['push'](_0x2de2b4['shift']());}};_0x24b4d9(++_0x83884);}(_0x12c5,0x134));var _0x512c=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x12c5[_0xfae23b];return _0x200640;};'use strict';var path=require('path');var cfg=require('../../config/environment');var env={'NODE_PATH':path[_0x512c('0x0')](path[_0x512c('0x1')](cfg[_0x512c('0x2')],_0x512c('0x3')))};var pm2config={'apps':[{'name':_0x512c('0x4'),'script':path[_0x512c('0x1')](__dirname,_0x512c('0x5')),'env':env},{'name':_0x512c('0x6'),'script':path[_0x512c('0x1')](__dirname,_0x512c('0x7')),'env':env},{'name':_0x512c('0x8'),'script':path[_0x512c('0x1')](__dirname,_0x512c('0x9')),'env':env},{'name':'email','script':path[_0x512c('0x1')](__dirname,_0x512c('0xa')),'env':env},{'name':_0x512c('0xb'),'script':path[_0x512c('0x1')](__dirname,_0x512c('0xc')),'env':env},{'name':_0x512c('0xd'),'script':path[_0x512c('0x1')](__dirname,_0x512c('0xe')),'env':env}]};module[_0x512c('0xf')]=pm2config; \ No newline at end of file +var _0x4c34=['join','legacy-libs','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','routing','xdr','../../services/xdr/index.js','exports','path','../../config/environment','resolve'];(function(_0x2c7b86,_0x59ef3c){var _0x256735=function(_0x352e33){while(--_0x352e33){_0x2c7b86['push'](_0x2c7b86['shift']());}};_0x256735(++_0x59ef3c);}(_0x4c34,0xa5));var _0x44c3=function(_0x2ad52d,_0x1b4b9c){_0x2ad52d=_0x2ad52d-0x0;var _0x37b18c=_0x4c34[_0x2ad52d];return _0x37b18c;};'use strict';var path=require(_0x44c3('0x0'));var cfg=require(_0x44c3('0x1'));var env={'NODE_PATH':path[_0x44c3('0x2')](path[_0x44c3('0x3')](cfg['root'],_0x44c3('0x4')))};var pm2config={'apps':[{'name':'express','script':path[_0x44c3('0x3')](__dirname,_0x44c3('0x5')),'env':env},{'name':_0x44c3('0x6'),'script':path['join'](__dirname,_0x44c3('0x7')),'env':env},{'name':_0x44c3('0x8'),'script':path[_0x44c3('0x3')](__dirname,_0x44c3('0x9')),'env':env},{'name':'email','script':path[_0x44c3('0x3')](__dirname,'../../services/email/index.js'),'env':env},{'name':_0x44c3('0xa'),'script':path[_0x44c3('0x3')](__dirname,'../../services/routing/index.js'),'env':env},{'name':_0x44c3('0xb'),'script':path['join'](__dirname,_0x44c3('0xc')),'env':env}]};module[_0x44c3('0xd')]=pm2config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 7a13e20..49c1de4 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 _0x1a19=['pm2','bluebird','connect','connected','start','then','stop','disconnect','restart','list','describe','dump','saved'];(function(_0x54a770,_0x27eb16){var _0x47d8ac=function(_0x4efcd3){while(--_0x4efcd3){_0x54a770['push'](_0x54a770['shift']());}};_0x47d8ac(++_0x27eb16);}(_0x1a19,0x1ba));var _0x91a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a19[_0x3dd15e];return _0x231fd0;};'use strict';var pm2=require(_0x91a1('0x0'));var BPromise=require(_0x91a1('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0xfdc31f,_0x182ab7){return pm2[_0x91a1('0x2')](function(_0x14334e){if(_0x14334e){return _0x182ab7(_0x14334e);}return _0xfdc31f(_0x91a1('0x3'));});});};exports[_0x91a1('0x4')]=function(_0x5e5c02){return connect()[_0x91a1('0x5')](function(){return new BPromise(function(_0x43ea4d,_0x5a3836){return pm2[_0x91a1('0x4')](_0x5e5c02,function(_0x552287,_0x32eeb8){if(_0x552287){return _0x5a3836(_0x552287);}pm2['disconnect']();return _0x43ea4d(_0x32eeb8);});});});};exports['stop']=function(_0x1ad96c){return connect()[_0x91a1('0x5')](function(){return new BPromise(function(_0x2e2d1d,_0x52cc59){return pm2[_0x91a1('0x6')](_0x1ad96c,function(_0x45e933,_0x4d3b54){if(_0x45e933){return _0x52cc59(_0x45e933);}pm2[_0x91a1('0x7')]();return _0x2e2d1d(_0x4d3b54);});});});};exports['restart']=function(_0x50772e){return connect()[_0x91a1('0x5')](function(){return new BPromise(function(_0x2a5bb8,_0x304a57){return pm2[_0x91a1('0x8')](_0x50772e,function(_0x52aa69,_0x13ef4c){if(_0x52aa69){return _0x304a57(_0x52aa69);}pm2[_0x91a1('0x7')]();return _0x2a5bb8(_0x13ef4c);});});});};exports[_0x91a1('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x508a83,_0x5bb896){return pm2[_0x91a1('0x9')](function(_0x209b29,_0x5ef6af){if(_0x209b29){return _0x5bb896(_0x209b29);}pm2['disconnect']();return _0x508a83(_0x5ef6af);});});});};exports[_0x91a1('0xa')]=function(_0x356682){return connect()[_0x91a1('0x5')](function(){return new BPromise(function(_0x5a23f0,_0x4608f8){return pm2[_0x91a1('0xa')](_0x356682,function(_0x509e75,_0x816ae8){if(_0x509e75){return _0x4608f8(_0x509e75);}pm2[_0x91a1('0x7')]();return _0x5a23f0(_0x816ae8);});});});};exports['delete']=function(_0x28de4a){return connect()[_0x91a1('0x5')](function(){return new BPromise(function(_0xba14e7,_0x493228){return pm2['delete'](_0x28de4a,function(_0x1f2eb1,_0x535d44){if(_0x1f2eb1){return _0x493228(_0x1f2eb1);}pm2[_0x91a1('0x7')]();return _0xba14e7(_0x535d44);});});});};exports['dump']=function(){return connect()[_0x91a1('0x5')](function(){return new BPromise(function(_0x417d54,_0x4c55e2){return pm2[_0x91a1('0xb')](function(_0x116567){if(_0x116567){return _0x4c55e2(_0x116567);}return _0x417d54(_0x91a1('0xc'));});});});}; \ No newline at end of file +var _0x0e53=['stop','restart','list','delete','dump','saved','bluebird','connect','then','start','disconnect'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0e53,0x15b));var _0x30e5=function(_0x26fb64,_0x20b9a6){_0x26fb64=_0x26fb64-0x0;var _0x4267bc=_0x0e53[_0x26fb64];return _0x4267bc;};'use strict';var pm2=require('pm2');var BPromise=require(_0x30e5('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x15c7d0,_0x55400d){return pm2[_0x30e5('0x1')](function(_0x304d48){if(_0x304d48){return _0x55400d(_0x304d48);}return _0x15c7d0('connected');});});};exports['start']=function(_0x13d6e3){return connect()[_0x30e5('0x2')](function(){return new BPromise(function(_0x489685,_0x3bdf13){return pm2[_0x30e5('0x3')](_0x13d6e3,function(_0x41c8c3,_0x3f002d){if(_0x41c8c3){return _0x3bdf13(_0x41c8c3);}pm2[_0x30e5('0x4')]();return _0x489685(_0x3f002d);});});});};exports[_0x30e5('0x5')]=function(_0x4e8f9e){return connect()[_0x30e5('0x2')](function(){return new BPromise(function(_0x2c7c1c,_0x23ef42){return pm2['stop'](_0x4e8f9e,function(_0x2b8438,_0x589895){if(_0x2b8438){return _0x23ef42(_0x2b8438);}pm2[_0x30e5('0x4')]();return _0x2c7c1c(_0x589895);});});});};exports['restart']=function(_0x5526f2){return connect()[_0x30e5('0x2')](function(){return new BPromise(function(_0x39b9d3,_0x250f9b){return pm2[_0x30e5('0x6')](_0x5526f2,function(_0x2f72b6,_0x32526e){if(_0x2f72b6){return _0x250f9b(_0x2f72b6);}pm2[_0x30e5('0x4')]();return _0x39b9d3(_0x32526e);});});});};exports[_0x30e5('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x4f0fd3,_0x3ba1f3){return pm2[_0x30e5('0x7')](function(_0x10728e,_0x3ffc20){if(_0x10728e){return _0x3ba1f3(_0x10728e);}pm2[_0x30e5('0x4')]();return _0x4f0fd3(_0x3ffc20);});});});};exports['describe']=function(_0x465a70){return connect()[_0x30e5('0x2')](function(){return new BPromise(function(_0x540735,_0x73a04e){return pm2['describe'](_0x465a70,function(_0x36e599,_0x13b051){if(_0x36e599){return _0x73a04e(_0x36e599);}pm2[_0x30e5('0x4')]();return _0x540735(_0x13b051);});});});};exports[_0x30e5('0x8')]=function(_0x17106d){return connect()[_0x30e5('0x2')](function(){return new BPromise(function(_0x36197d,_0x2c723a){return pm2[_0x30e5('0x8')](_0x17106d,function(_0x422c24,_0x538286){if(_0x422c24){return _0x2c723a(_0x422c24);}pm2['disconnect']();return _0x36197d(_0x538286);});});});};exports['dump']=function(){return connect()[_0x30e5('0x2')](function(){return new BPromise(function(_0x26dad4,_0x306157){return pm2[_0x30e5('0x9')](function(_0x1dceca){if(_0x1dceca){return _0x306157(_0x1dceca);}return _0x26dad4(_0x30e5('0xa'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 3b38d71..a8563bf 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 _0x6f2a=['lastMsgAt','subtract','minutes','length','map','info','join','update','system','format','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../mysqldb','schedule','redis','defaults','localhost','Setting','chatTimeout','then'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0x6f2a,0xf0));var _0xa6f2=function(_0x384fc9,_0x5e6b83){_0x384fc9=_0x384fc9-0x0;var _0xa8323d=_0x6f2a[_0x384fc9];return _0xa8323d;};'use strict';var _=require(_0xa6f2('0x0'));var moment=require(_0xa6f2('0x1'));var Redis=require(_0xa6f2('0x2'));var util=require(_0xa6f2('0x3'));var config=require('../../config/environment');var db=require(_0xa6f2('0x4'))['db'];var logger=require('../logger')(_0xa6f2('0x5'));config[_0xa6f2('0x6')]=_[_0xa6f2('0x7')](config['redis'],{'host':_0xa6f2('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x42954=0x0;var _0x479a2f=[];return db[_0xa6f2('0x9')]['find']({'raw':!![],'attributes':['id',_0xa6f2('0xa')],'where':{'id':0x1}})[_0xa6f2('0xb')](function(_0x5742db){_0x42954=_0x5742db[_0xa6f2('0xa')];if(_0x42954){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0xa6f2('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa6f2('0xd')](_0x5742db['chatTimeout'],_0xa6f2('0xe'))}}});}else{return[];}})[_0xa6f2('0xb')](function(_0x249bf0){if(_0x249bf0&&_0x249bf0[_0xa6f2('0xf')]){_0x479a2f=_[_0xa6f2('0x10')](_0x249bf0||[],'id');logger[_0xa6f2('0x11')]('[CHAT]\x20Interactions\x20to\x20close:',_0x479a2f[_0xa6f2('0x12')]());return db['ChatInteraction'][_0xa6f2('0x13')]({'closeReason':_0xa6f2('0x14'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0xa6f2('0x15')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x479a2f}});}})[_0xa6f2('0xb')](function(){if(_0x479a2f&&_0x479a2f[_0xa6f2('0xf')]){logger[_0xa6f2('0x11')](_0xa6f2('0x16'),_0x479a2f[_0xa6f2('0x12')]());for(var _0x112636=0x0;_0x112636<_0x479a2f['length'];_0x112636++){io['emit'](_0xa6f2('0x17'),{'id':_0x479a2f[_0x112636],'closed':!![]});}}})['catch'](function(_0xb31ad){logger[_0xa6f2('0x18')](_0xa6f2('0x19'),_0xb31ad?util[_0xa6f2('0x1a')](_0xb31ad,{'showHidden':![],'depth':null}):'');});}exports[_0xa6f2('0x1b')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xc20b=['ioredis','../../config/environment','schedule','redis','defaults','localhost','Setting','chatTimeout','then','findAll','minutes','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','timeout','format','length','emit','chatInteraction:update','error','start','lodash','moment'];(function(_0xf33eef,_0x528409){var _0x2a4da1=function(_0x338dd9){while(--_0x338dd9){_0xf33eef['push'](_0xf33eef['shift']());}};_0x2a4da1(++_0x528409);}(_0xc20b,0xc6));var _0xbc20=function(_0x4951a0,_0x479e9e){_0x4951a0=_0x4951a0-0x0;var _0x4d3e3c=_0xc20b[_0x4951a0];return _0x4d3e3c;};'use strict';var _=require(_0xbc20('0x0'));var moment=require(_0xbc20('0x1'));var Redis=require(_0xbc20('0x2'));var util=require('util');var config=require(_0xbc20('0x3'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xbc20('0x4'));config[_0xbc20('0x5')]=_[_0xbc20('0x6')](config[_0xbc20('0x5')],{'host':_0xbc20('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbc20('0x5')]));function closeInteractions(){var _0x4aea19=0x0;var _0x204afb=[];return db[_0xbc20('0x8')]['find']({'raw':!![],'attributes':['id',_0xbc20('0x9')],'where':{'id':0x1}})[_0xbc20('0xa')](function(_0x35e0f1){_0x4aea19=_0x35e0f1[_0xbc20('0x9')];if(_0x4aea19){return db['ChatInteraction'][_0xbc20('0xb')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x35e0f1[_0xbc20('0x9')],_0xbc20('0xc'))}}});}else{return[];}})['then'](function(_0x2f49bd){if(_0x2f49bd&&_0x2f49bd['length']){_0x204afb=_['map'](_0x2f49bd||[],'id');logger[_0xbc20('0xd')](_0xbc20('0xe'),_0x204afb[_0xbc20('0xf')]());return db[_0xbc20('0x10')][_0xbc20('0x11')]({'closeReason':'system','disposition':_0xbc20('0x12'),'closed':!![],'closedAt':moment()[_0xbc20('0x13')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x204afb}});}})[_0xbc20('0xa')](function(){if(_0x204afb&&_0x204afb[_0xbc20('0x14')]){logger[_0xbc20('0xd')]('[CHAT]\x20Sending\x20updates\x20for\x20interactions:',_0x204afb[_0xbc20('0xf')]());for(var _0x2e19b8=0x0;_0x2e19b8<_0x204afb[_0xbc20('0x14')];_0x2e19b8++){io[_0xbc20('0x15')](_0xbc20('0x16'),{'id':_0x204afb[_0x2e19b8],'closed':!![]});}}})['catch'](function(_0x55b5ce){logger[_0xbc20('0x17')]('[CHAT]\x20Error\x20closing\x20interactions',_0x55b5ce?util['inspect'](_0x55b5ce,{'showHidden':![],'depth':null}):'');});}exports[_0xbc20('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index c965bf3..e8a4f0e 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9d06=['startAllRefreshIntervals','exports','../../api/cloudProvider/cloudProvider.oauth.js'];(function(_0x44fb3d,_0x206053){var _0x3bdaed=function(_0x5a9e96){while(--_0x5a9e96){_0x44fb3d['push'](_0x44fb3d['shift']());}};_0x3bdaed(++_0x206053);}(_0x9d06,0x191));var _0x69d0=function(_0x51ad14,_0x4b5838){_0x51ad14=_0x51ad14-0x0;var _0x242b53=_0x9d06[_0x51ad14];return _0x242b53;};'use strict';function start(){var _0x50ffd9=require(_0x69d0('0x0'));return _0x50ffd9[_0x69d0('0x1')]();}module[_0x69d0('0x2')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xc1a0=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x3c8828,_0x2b7afd){var _0x41e0ba=function(_0x5cbe4f){while(--_0x5cbe4f){_0x3c8828['push'](_0x3c8828['shift']());}};_0x41e0ba(++_0x2b7afd);}(_0xc1a0,0x1e6));var _0x0c1a=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0xc1a0[_0x1e6659];return _0x4d16e4;};'use strict';function start(){var _0x3b019c=require(_0x0c1a('0x0'));return _0x3b019c[_0x0c1a('0x1')]();}module[_0x0c1a('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index f7991f9..ebf5424 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 _0x0af8=['../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','%s.%s','basename','savename','extname','zip','join','existsSync','status','message','attachments','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','Sent','text','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','stringify','email\x20sent','data','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','runReport','catch','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','isBetween','startAt','endAt','add','add\x20cron','exists','stop\x20cron','update','update\x20cron','run','start','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule'];(function(_0x4b25c0,_0x510e80){var _0x550875=function(_0x5aa17d){while(--_0x5aa17d){_0x4b25c0['push'](_0x4b25c0['shift']());}};_0x550875(++_0x510e80);}(_0x0af8,0xac));var _0x80af=function(_0xc0f0e2,_0x2c5a5c){_0xc0f0e2=_0xc0f0e2-0x0;var _0x46df16=_0x0af8[_0xc0f0e2];return _0x46df16;};'use strict';var fs=require('fs');var util=require(_0x80af('0x0'));var path=require(_0x80af('0x1'));var _=require(_0x80af('0x2'));var moment=require(_0x80af('0x3'));var CronJobManager=require(_0x80af('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x80af('0x5'));var logger=require(_0x80af('0x6'))(_0x80af('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x80af('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x80af('0x9')][_0x80af('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x42ff67,_0x30ec11){return function(){logger[_0x80af('0xb')](_0x80af('0xc'),_0x42ff67[_0x80af('0xd')]);var _0x9c876=!![];var _0x1a2581=_0x42ff67[_0x80af('0xe')][_0x80af('0xf')]();var _0x10a673={'account':_0x1a2581,'message':{'from':util[_0x80af('0x10')](_0x80af('0x11'),_0x42ff67[_0x80af('0xe')][_0x80af('0x12')],_0x42ff67['MailAccount'][_0x80af('0xd')]||_0x42ff67['MailAccount']['Smtp'][_0x80af('0x13')]),'to':_0x42ff67[_0x80af('0xd')],'cc':_0x42ff67['cc'],'bcc':_0x42ff67[_0x80af('0x14')],'subject':util[_0x80af('0x10')](_0x80af('0x15'),_0x30ec11[_0x80af('0x12')],_0x42ff67[_0x80af('0x16')],_0x42ff67[_0x80af('0x17')])}};var _0x34535f=path['join'](__dirname,_0x80af('0x18'));var _0x3f9e99=_0x30ec11['savename'];var _0x2187fc=util[_0x80af('0x10')](_0x80af('0x19'),path[_0x80af('0x1a')](_0x30ec11[_0x80af('0x1b')],path[_0x80af('0x1c')](_0x30ec11[_0x80af('0x1b')])),_0x80af('0x1d'));var _0x526600=path[_0x80af('0x1e')](_0x34535f,_0x3f9e99);var _0x236f8b=path[_0x80af('0x1e')](_0x34535f,_0x2187fc);if(fs[_0x80af('0x1f')](_0x526600)){_0x30ec11[_0x80af('0x20')]='Sent';_0x10a673[_0x80af('0x21')][_0x80af('0x22')]=[{'filename':_0x3f9e99,'path':_0x526600}];_0x10a673['message']['text']=util['format'](_0x80af('0x23'),JSON['stringify'](_0x30ec11,null,0x2));}else if(fs['existsSync'](_0x236f8b)){_0x30ec11[_0x80af('0x20')]=_0x80af('0x24');_0x10a673[_0x80af('0x21')][_0x80af('0x22')]=[{'filename':_0x2187fc,'path':_0x236f8b}];}else{_0x10a673[_0x80af('0x21')][_0x80af('0x25')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x42ff67[_0x80af('0x26')]){_0x9c876=![];logger[_0x80af('0xb')](_0x80af('0x27'));}}if(_0x9c876){return client[_0x80af('0x28')](_0x80af('0x29'),_0x10a673)[_0x80af('0x2a')](function(_0x13edaa){if(_0x13edaa[_0x80af('0x2b')]){return logger[_0x80af('0x2b')](_0x80af('0x2c'),JSON[_0x80af('0x2d')](_0x13edaa));}return logger['info'](_0x80af('0x2e'));})['catch'](function(_0x7b473){return logger[_0x80af('0x2b')](_0x80af('0x2c'),JSON[_0x80af('0x2d')](_0x7b473));});}};}function handleError(){return function(_0x444eb5){return logger[_0x80af('0x2b')](JSON[_0x80af('0x2d')](_0x444eb5));};}function handleResult(_0x3aa0a1){return function(_0x4f32d8){logger['info'](_0x80af('0x2f'),JSON[_0x80af('0x2d')](_0x4f32d8));if(_0x3aa0a1[_0x80af('0xe')]&&_0x3aa0a1['MailAccount'][_0x80af('0x30')]&&!_[_0x80af('0x31')](_0x3aa0a1[_0x80af('0xd')])){setTimeout(handleSendEmail(_0x3aa0a1,_0x4f32d8),0x3c*0x3e8);}};}function handleJob(_0x344416){return function(){try{if(_[_0x80af('0x31')](_0x344416['subtractNumber'])){return logger[_0x80af('0xb')](_0x80af('0x32'));}if(_[_0x80af('0x31')](_0x344416['subtractUnit'])){return logger[_0x80af('0xb')](_0x80af('0x33'));}var _0x31f8ff={'startDate':moment()[_0x80af('0x34')](_0x344416['subtractNumber'],_0x344416['subtractUnit'])[_0x80af('0x10')](_0x80af('0x35')),'endDate':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x344416[_0x80af('0x36')],'name':_0x344416[_0x80af('0x12')]};if(!_[_0x80af('0x31')](_0x344416[_0x80af('0x37')])){logger[_0x80af('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x344416['DefaultReportId']);return analyticDefaultReportController[_0x80af('0x38')]({'id':_0x344416[_0x80af('0x37')]},_0x31f8ff)[_0x80af('0x2a')](handleResult(_0x344416))[_0x80af('0x39')](handleError());}if(!_['isNil'](_0x344416[_0x80af('0x3a')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x344416[_0x80af('0x3a')]);return analyticCustomReportController[_0x80af('0x38')]({'id':_0x344416['CustomReportId']},_0x31f8ff)[_0x80af('0x2a')](handleResult(_0x344416))[_0x80af('0x39')](handleError());}}catch(_0x1dbf28){logger[_0x80af('0x2b')](JSON[_0x80af('0x2d')](_0x1dbf28));}return logger[_0x80af('0xb')](_0x80af('0x3b'));};}function getJobs(_0x8f4c76){var _0x3182ac={};if(_0x8f4c76){_0x3182ac['id']=_0x8f4c76;}return db[_0x80af('0x3c')][_0x80af('0x3d')]({'where':_0x3182ac,'include':[{'model':db[_0x80af('0xe')],'attributes':['id','name','email'],'include':[{'model':db[_0x80af('0x3e')],'as':_0x80af('0x30'),'include':[{'model':db[_0x80af('0x3f')],'as':'CloudProvider'}]}]}]})[_0x80af('0x2a')](function(_0x47bb37){var _0x5e5872=_[_0x80af('0x40')](manager['jobs']);var _0x2b5fa1=_['map'](_0x47bb37,function(_0x180def){return _0x180def['id'][_0x80af('0x41')]();});var _0x5c44d7=_[_0x80af('0x42')](_0x47bb37,function(_0x5e1481){return _0x5e1481['id'][_0x80af('0x41')]();});var _0xa4dc87=_0x8f4c76?_0x2b5fa1:_[_0x80af('0x43')](_0x2b5fa1,_0x5e5872);var _0x591901=_[_0x80af('0x44')](_0x2b5fa1,_0x5e5872);var _0x2b1005=_[_0x80af('0x43')](_0x5e5872,_0x2b5fa1);var _0x471b21;var _0x20f5b3;for(_0x471b21=0x0;_0x471b21<_0x2b1005[_0x80af('0x45')]&&!_0x8f4c76;_0x471b21+=0x1){_0x20f5b3=_0x2b1005[_0x471b21][_0x80af('0x41')]();if(manager['exists'](_0x20f5b3)){manager[_0x80af('0x46')](_0x20f5b3);manager[_0x80af('0x47')](_0x20f5b3);logger[_0x80af('0xb')](_0x80af('0x48'),_0x20f5b3);}}logger['info'](_0x80af('0x49'),JSON[_0x80af('0x2d')](_0xa4dc87));for(_0x471b21=0x0;_0x471b21<_0xa4dc87[_0x80af('0x45')];_0x471b21+=0x1){_0x20f5b3=_0xa4dc87[_0x471b21][_0x80af('0x41')]();logger[_0x80af('0xb')](_0x80af('0x4a'),_0x20f5b3);if(_0x8f4c76){logger[_0x80af('0xb')](_0x80af('0x4b'),_0x8f4c76);logger[_0x80af('0xb')](JSON[_0x80af('0x2d')](_0x5c44d7[_0x20f5b3]));BPromise[_0x80af('0x4c')]()['then'](handleJob(_0x5c44d7[_0x20f5b3]));logger[_0x80af('0xb')](_0x80af('0x4d'),_0x5c44d7[_0x20f5b3][_0x80af('0x12')],_0x5c44d7[_0x20f5b3][_0x80af('0x4e')]);}else if(_0x5c44d7[_0x20f5b3][_0x80af('0x4e')]&&_0x5c44d7[_0x20f5b3]['active']&&moment()[_0x80af('0x4f')](_0x5c44d7[_0x20f5b3][_0x80af('0x50')],_0x5c44d7[_0x20f5b3][_0x80af('0x51')])){manager[_0x80af('0x52')](_0x20f5b3,_0x5c44d7[_0x20f5b3][_0x80af('0x4e')],handleJob(_0x5c44d7[_0x20f5b3]));manager['start'](_0x20f5b3);logger[_0x80af('0xb')](_0x80af('0x53'),_0x5c44d7[_0x20f5b3][_0x80af('0x12')],_0x5c44d7[_0x20f5b3][_0x80af('0x4e')]);}else if(manager[_0x80af('0x54')](_0x20f5b3)){manager[_0x80af('0x46')](_0x20f5b3);manager['deleteJob'](_0x20f5b3);logger[_0x80af('0xb')](_0x80af('0x55'),_0x5c44d7[_0x20f5b3][_0x80af('0x12')],_0x5c44d7[_0x20f5b3][_0x80af('0x4e')]);}}for(_0x471b21=0x0,_0x20f5b3;_0x471b21<_0x591901['length']&&!_0x8f4c76;_0x471b21+=0x1){_0x20f5b3=_0x591901[_0x471b21][_0x80af('0x41')]();if(manager['exists'](_0x20f5b3)){if(_0x5c44d7[_0x20f5b3][_0x80af('0x4e')]&&_0x5c44d7[_0x20f5b3]['active']&&moment()['isBetween'](_0x5c44d7[_0x20f5b3][_0x80af('0x50')],_0x5c44d7[_0x20f5b3][_0x80af('0x51')])){manager[_0x80af('0x56')](_0x20f5b3,_0x5c44d7[_0x20f5b3]['cron'],handleJob(_0x5c44d7[_0x20f5b3]));logger[_0x80af('0xb')](_0x80af('0x57'),_0x5c44d7[_0x20f5b3][_0x80af('0x12')],_0x5c44d7[_0x20f5b3]['cron']);}else{manager['stop'](_0x20f5b3);manager[_0x80af('0x47')](_0x20f5b3);logger[_0x80af('0xb')](_0x80af('0x55'),_0x5c44d7[_0x20f5b3][_0x80af('0x12')],_0x5c44d7[_0x20f5b3][_0x80af('0x4e')]);}}}})['catch'](function(_0x240095){logger[_0x80af('0x2b')](JSON[_0x80af('0x2d')](_0x240095));});}exports[_0x80af('0x58')]=function(_0x3a187e){return getJobs(_0x3a187e);};exports[_0x80af('0x59')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x7500=['attachments','stringify','text','empty\x20file,\x20email\x20not\x20sent','then','error','error\x20mail','email\x20sent','catch','Smtp','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','Schedule','findAll','email','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','update','update\x20cron','run','start','path','lodash','moment','cron-job-manager','jayson/promise','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','%s.%s','basename','extname','savename','zip','existsSync','status','Sent','message'];(function(_0x2c4046,_0x96834e){var _0x5b2979=function(_0xa6d4f6){while(--_0xa6d4f6){_0x2c4046['push'](_0x2c4046['shift']());}};_0x5b2979(++_0x96834e);}(_0x7500,0xdd));var _0x0750=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x7500[_0x413feb];return _0x40ee88;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x0750('0x0'));var _=require(_0x0750('0x1'));var moment=require(_0x0750('0x2'));var CronJobManager=require(_0x0750('0x3'));var jayson=require(_0x0750('0x4'));var BPromise=require('bluebird');var logger=require('../logger')(_0x0750('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x0750('0x6'));var analyticDefaultReportController=require(_0x0750('0x7'));var client=jayson['client'][_0x0750('0x8')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5718d5,_0xa0946a){return function(){logger[_0x0750('0x9')](_0x0750('0xa'),_0x5718d5['email']);var _0x388d07=!![];var _0x128cf6=_0x5718d5[_0x0750('0xb')][_0x0750('0xc')]();var _0x13e6cd={'account':_0x128cf6,'message':{'from':util[_0x0750('0xd')](_0x0750('0xe'),_0x5718d5['MailAccount'][_0x0750('0xf')],_0x5718d5[_0x0750('0xb')]['email']||_0x5718d5['MailAccount']['Smtp'][_0x0750('0x10')]),'to':_0x5718d5['email'],'cc':_0x5718d5['cc'],'bcc':_0x5718d5[_0x0750('0x11')],'subject':util[_0x0750('0xd')](_0x0750('0x12'),_0xa0946a[_0x0750('0xf')],_0x5718d5[_0x0750('0x13')],_0x5718d5[_0x0750('0x14')])}};var _0x450a43=path[_0x0750('0x15')](__dirname,'../../files/reports');var _0x1ae079=_0xa0946a['savename'];var _0x10b2f1=util['format'](_0x0750('0x16'),path[_0x0750('0x17')](_0xa0946a['savename'],path[_0x0750('0x18')](_0xa0946a[_0x0750('0x19')])),_0x0750('0x1a'));var _0x493361=path['join'](_0x450a43,_0x1ae079);var _0x5d36a1=path[_0x0750('0x15')](_0x450a43,_0x10b2f1);if(fs[_0x0750('0x1b')](_0x493361)){_0xa0946a[_0x0750('0x1c')]=_0x0750('0x1d');_0x13e6cd[_0x0750('0x1e')][_0x0750('0x1f')]=[{'filename':_0x1ae079,'path':_0x493361}];_0x13e6cd[_0x0750('0x1e')]['text']=util[_0x0750('0xd')]('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x0750('0x20')](_0xa0946a,null,0x2));}else if(fs[_0x0750('0x1b')](_0x5d36a1)){_0xa0946a['status']=_0x0750('0x1d');_0x13e6cd['message'][_0x0750('0x1f')]=[{'filename':_0x10b2f1,'path':_0x5d36a1}];}else{_0x13e6cd[_0x0750('0x1e')][_0x0750('0x21')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x5718d5['sendIfEmpty']){_0x388d07=![];logger[_0x0750('0x9')](_0x0750('0x22'));}}if(_0x388d07){return client['request']('SendMail',_0x13e6cd)[_0x0750('0x23')](function(_0x59a690){if(_0x59a690['error']){return logger[_0x0750('0x24')](_0x0750('0x25'),JSON['stringify'](_0x59a690));}return logger[_0x0750('0x9')](_0x0750('0x26'));})[_0x0750('0x27')](function(_0x2fd40d){return logger[_0x0750('0x24')]('error\x20mail',JSON[_0x0750('0x20')](_0x2fd40d));});}};}function handleError(){return function(_0x3d7399){return logger[_0x0750('0x24')](JSON['stringify'](_0x3d7399));};}function handleResult(_0x410361){return function(_0x25d4f2){logger[_0x0750('0x9')]('data',JSON['stringify'](_0x25d4f2));if(_0x410361['MailAccount']&&_0x410361[_0x0750('0xb')][_0x0750('0x28')]&&!_[_0x0750('0x29')](_0x410361['email'])){setTimeout(handleSendEmail(_0x410361,_0x25d4f2),0x3c*0x3e8);}};}function handleJob(_0x97a5e3){return function(){try{if(_['isNil'](_0x97a5e3[_0x0750('0x13')])){return logger[_0x0750('0x9')](_0x0750('0x2a'));}if(_[_0x0750('0x29')](_0x97a5e3[_0x0750('0x14')])){return logger[_0x0750('0x9')](_0x0750('0x2b'));}var _0x4b7993={'startDate':moment()[_0x0750('0x2c')](_0x97a5e3[_0x0750('0x13')],_0x97a5e3[_0x0750('0x14')])[_0x0750('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x0750('0xd')](_0x0750('0x2d')),'type':'scheduled','output':_0x97a5e3[_0x0750('0x2e')],'name':_0x97a5e3['name']};if(!_[_0x0750('0x29')](_0x97a5e3[_0x0750('0x2f')])){logger[_0x0750('0x9')](_0x0750('0x30'),_0x97a5e3[_0x0750('0x2f')]);return analyticDefaultReportController['runReport']({'id':_0x97a5e3[_0x0750('0x2f')]},_0x4b7993)['then'](handleResult(_0x97a5e3))[_0x0750('0x27')](handleError());}if(!_[_0x0750('0x29')](_0x97a5e3[_0x0750('0x31')])){logger[_0x0750('0x9')](_0x0750('0x32'),_0x97a5e3[_0x0750('0x31')]);return analyticCustomReportController[_0x0750('0x33')]({'id':_0x97a5e3[_0x0750('0x31')]},_0x4b7993)[_0x0750('0x23')](handleResult(_0x97a5e3))[_0x0750('0x27')](handleError());}}catch(_0x53a7a9){logger['error'](JSON[_0x0750('0x20')](_0x53a7a9));}return logger[_0x0750('0x9')]('no\x20report\x20id');};}function getJobs(_0x370b23){var _0x2e1212={};if(_0x370b23){_0x2e1212['id']=_0x370b23;}return db[_0x0750('0x34')][_0x0750('0x35')]({'where':_0x2e1212,'include':[{'model':db['MailAccount'],'attributes':['id',_0x0750('0xf'),_0x0750('0x36')],'include':[{'model':db[_0x0750('0x37')],'as':_0x0750('0x28'),'include':[{'model':db[_0x0750('0x38')],'as':_0x0750('0x38')}]}]}]})[_0x0750('0x23')](function(_0x1b23c5){var _0x4aaae5=_[_0x0750('0x39')](manager[_0x0750('0x3a')]);var _0xfa3c2f=_[_0x0750('0x3b')](_0x1b23c5,function(_0x417546){return _0x417546['id'][_0x0750('0x3c')]();});var _0x57d685=_[_0x0750('0x3d')](_0x1b23c5,function(_0x31abdb){return _0x31abdb['id'][_0x0750('0x3c')]();});var _0x1cfe5b=_0x370b23?_0xfa3c2f:_[_0x0750('0x3e')](_0xfa3c2f,_0x4aaae5);var _0x428997=_[_0x0750('0x3f')](_0xfa3c2f,_0x4aaae5);var _0x5a61cb=_['difference'](_0x4aaae5,_0xfa3c2f);var _0x5e33e7;var _0x4b1b20;for(_0x5e33e7=0x0;_0x5e33e7<_0x5a61cb[_0x0750('0x40')]&&!_0x370b23;_0x5e33e7+=0x1){_0x4b1b20=_0x5a61cb[_0x5e33e7][_0x0750('0x3c')]();if(manager['exists'](_0x4b1b20)){manager[_0x0750('0x41')](_0x4b1b20);manager[_0x0750('0x42')](_0x4b1b20);logger[_0x0750('0x9')](_0x0750('0x43'),_0x4b1b20);}}logger['info']('toRun',JSON[_0x0750('0x20')](_0x1cfe5b));for(_0x5e33e7=0x0;_0x5e33e7<_0x1cfe5b[_0x0750('0x40')];_0x5e33e7+=0x1){_0x4b1b20=_0x1cfe5b[_0x5e33e7][_0x0750('0x3c')]();logger[_0x0750('0x9')](_0x0750('0x44'),_0x4b1b20);if(_0x370b23){logger[_0x0750('0x9')](_0x0750('0x45'),_0x370b23);logger[_0x0750('0x9')](JSON[_0x0750('0x20')](_0x57d685[_0x4b1b20]));BPromise[_0x0750('0x46')]()[_0x0750('0x23')](handleJob(_0x57d685[_0x4b1b20]));logger[_0x0750('0x9')](_0x0750('0x47'),_0x57d685[_0x4b1b20][_0x0750('0xf')],_0x57d685[_0x4b1b20][_0x0750('0x48')]);}else if(_0x57d685[_0x4b1b20][_0x0750('0x48')]&&_0x57d685[_0x4b1b20][_0x0750('0x49')]&&moment()[_0x0750('0x4a')](_0x57d685[_0x4b1b20][_0x0750('0x4b')],_0x57d685[_0x4b1b20][_0x0750('0x4c')])){manager[_0x0750('0x4d')](_0x4b1b20,_0x57d685[_0x4b1b20]['cron'],handleJob(_0x57d685[_0x4b1b20]));manager['start'](_0x4b1b20);logger[_0x0750('0x9')](_0x0750('0x4e'),_0x57d685[_0x4b1b20][_0x0750('0xf')],_0x57d685[_0x4b1b20][_0x0750('0x48')]);}else if(manager['exists'](_0x4b1b20)){manager[_0x0750('0x41')](_0x4b1b20);manager[_0x0750('0x42')](_0x4b1b20);logger[_0x0750('0x9')](_0x0750('0x4f'),_0x57d685[_0x4b1b20][_0x0750('0xf')],_0x57d685[_0x4b1b20][_0x0750('0x48')]);}}for(_0x5e33e7=0x0,_0x4b1b20;_0x5e33e7<_0x428997[_0x0750('0x40')]&&!_0x370b23;_0x5e33e7+=0x1){_0x4b1b20=_0x428997[_0x5e33e7]['toString']();if(manager['exists'](_0x4b1b20)){if(_0x57d685[_0x4b1b20][_0x0750('0x48')]&&_0x57d685[_0x4b1b20][_0x0750('0x49')]&&moment()[_0x0750('0x4a')](_0x57d685[_0x4b1b20][_0x0750('0x4b')],_0x57d685[_0x4b1b20][_0x0750('0x4c')])){manager[_0x0750('0x50')](_0x4b1b20,_0x57d685[_0x4b1b20][_0x0750('0x48')],handleJob(_0x57d685[_0x4b1b20]));logger[_0x0750('0x9')](_0x0750('0x51'),_0x57d685[_0x4b1b20][_0x0750('0xf')],_0x57d685[_0x4b1b20]['cron']);}else{manager['stop'](_0x4b1b20);manager['deleteJob'](_0x4b1b20);logger['info']('stop\x20cron',_0x57d685[_0x4b1b20][_0x0750('0xf')],_0x57d685[_0x4b1b20][_0x0750('0x48')]);}}}})['catch'](function(_0x3a34e3){logger[_0x0750('0x24')](JSON[_0x0750('0x20')](_0x3a34e3));});}exports[_0x0750('0x52')]=function(_0xbfcadd){return getJobs(_0xbfcadd);};exports[_0x0750('0x53')]=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 ed8e200..a57d770 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 _0x7072=['Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Positive','SentimentScore','Mixed','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','bucket','Sentiment\x20Analysis\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','Negative','Neutral','catch','name','error','inspect','VoiceRecording','IN_PROGRESS','findOne','forEach','push','all','SequelizeValidationError','aws-sdk','request-promise','util','bluebird','../../mysqldb','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','tempSentiment','Sequelize','ValidationError','sentiment','sentimentAccountId','language','Transcript\x20not\x20available','CloudProvider'];(function(_0x467e61,_0x387c3d){var _0x2eab8f=function(_0x10999b){while(--_0x10999b){_0x467e61['push'](_0x467e61['shift']());}};_0x2eab8f(++_0x387c3d);}(_0x7072,0x138));var _0x2707=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x7072[_0x5608a3];return _0x1ed50a;};var _=require('lodash');var AWS=require(_0x2707('0x0'));var rp=require(_0x2707('0x1'));var util=require(_0x2707('0x2'));var BPromise=require(_0x2707('0x3'));var db=require(_0x2707('0x4'))['db'];var logger=require('../../config/logger')('transcribe');function getTranscriptionJob(_0xfdfa7a,_0x5f3c1c,_0xd36287,_0x3572cf){return new Promise(function(_0x1e86f2,_0x194132){var _0x2fd8ff=new AWS[(_0x2707('0x5'))]({'accessKeyId':_0x5f3c1c,'secretAccessKey':_0xfdfa7a,'region':_0xd36287});_0x2fd8ff[_0x2707('0x6')]({'TranscriptionJobName':_0x3572cf},function(_0x745cfd,_0x4062b6){if(_0x745cfd){return _0x194132(_0x745cfd);}else{return _0x1e86f2(_0x4062b6);}});});}function sentiment(_0x2820ef,_0x51ffc4,_0x597ff9,_0x380339,_0x179cef){return new Promise(function(_0x379ac5,_0x56406b){var _0x30090e=new AWS[(_0x2707('0x7'))]({'accessKeyId':_0x51ffc4,'secretAccessKey':_0x2820ef,'region':_0x597ff9});_0x30090e[_0x2707('0x8')]({'Text':_0x380339,'LanguageCode':_0x179cef[_0x2707('0x9')](0x0,0x2)},function(_0x115535,_0x478717){if(_0x115535){return _0x56406b(_0x115535);}else{return _0x379ac5(_0x478717);}});});}function checkTranscribeJob(_0x2b769c,_0x32d4bd,_0x40d370){var _0x5bf16e;return new BPromise(function(_0x44c1d7,_0x590152){logger[_0x2707('0xa')](util[_0x2707('0xb')](_0x2707('0xc'),_0x2b769c['id'],_0x2b769c[_0x2707('0xd')]));return getTranscriptionJob(_0x40d370[_0x2707('0xe')],_0x40d370['data2'],_0x32d4bd[_0x2707('0xf')],_0x2b769c[_0x2707('0xd')])[_0x2707('0x10')](function(_0x5d523f){logger[_0x2707('0xa')](util[_0x2707('0xb')](_0x2707('0x11'),_0x2b769c['id'],_0x2b769c[_0x2707('0xd')],_0x5d523f[_0x2707('0x12')][_0x2707('0x13')]));if(!_0x2b769c['fileText']){switch(_0x5d523f[_0x2707('0x12')][_0x2707('0x13')]){case _0x2707('0x14'):var _0x518262={'transcribeStatus':_0x5d523f['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x5d523f[_0x2707('0x12')][_0x2707('0x15')][_0x2707('0x16')]};logger[_0x2707('0xa')](util[_0x2707('0xb')](_0x2707('0x17'),_0x2b769c['id']));return rp({'uri':_0x5d523f[_0x2707('0x12')][_0x2707('0x15')][_0x2707('0x16')],'json':!![]})[_0x2707('0x10')](function(_0x37c475){logger[_0x2707('0xa')](util[_0x2707('0xb')](_0x2707('0x18'),_0x2b769c['id']));if(_0x37c475&&_0x37c475['results']&&_0x37c475[_0x2707('0x19')][_0x2707('0x1a')]&&_0x37c475[_0x2707('0x19')][_0x2707('0x1a')][_0x2707('0x1b')]){_0x518262[_0x2707('0x1c')]='';for(var _0x4831ed=0x0;_0x4831ed<_0x37c475[_0x2707('0x19')][_0x2707('0x1a')][_0x2707('0x1b')];_0x4831ed++){_0x518262[_0x2707('0x1c')]+=_0x37c475[_0x2707('0x19')]['transcripts'][_0x4831ed][_0x2707('0x1d')]+'';}}return _0x2b769c['update'](_0x518262);})[_0x2707('0x10')](function(){logger[_0x2707('0xa')](util[_0x2707('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x2b769c['id']));if(!_0x2b769c[_0x2707('0x1e')]){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x32d4bd[_0x2707('0x21')]||!_0x32d4bd[_0x2707('0x22')]||!_0x32d4bd['sentimentRegion']||!_0x32d4bd[_0x2707('0x23')]||!_0x32d4bd['bucket']){throw new db['Sequelize'][(_0x2707('0x20'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x518262[_0x2707('0x1c')]){throw new Error(_0x2707('0x24'));}if(_0x32d4bd[_0x2707('0x22')]===_0x40d370['id']){return _0x40d370;}else{return db[_0x2707('0x25')]['findOne']({'where':{'id':_settings[_0x2707('0x22')]}});}})[_0x2707('0x10')](function(_0x2c7ecb){if(!_0x2c7ecb){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))](_0x2707('0x26'));}if(!_0x2c7ecb[_0x2707('0xe')]||!_0x2c7ecb[_0x2707('0x27')]){throw new db[(_0x2707('0x1f'))]['ValidationError'](_0x2707('0x28'));}_0x5bf16e=_0x2c7ecb;logger[_0x2707('0xa')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x2b769c['id']));return sentiment(_0x5bf16e['data1'],_0x5bf16e['data2'],_0x32d4bd['sentimentRegion'],_0x518262[_0x2707('0x1c')],_0x32d4bd['language']);})['then'](function(_0x4558bb){logger[_0x2707('0xa')](util['format'](_0x2707('0x29'),_0x2b769c['id']));return _0x2b769c[_0x2707('0x2a')]({'sentiment':_0x4558bb['Sentiment'],'sPositive':_0x4558bb['SentimentScore'][_0x2707('0x2b')],'sNegative':_0x4558bb[_0x2707('0x2c')]['Negative'],'sMixed':_0x4558bb['SentimentScore'][_0x2707('0x2d')],'sNeutral':_0x4558bb[_0x2707('0x2c')]['Neutral']});})[_0x2707('0x10')](function(){logger[_0x2707('0xa')](util[_0x2707('0xb')](_0x2707('0x2e'),_0x2b769c['id']));_0x44c1d7();});case _0x2707('0x2f'):return _0x2b769c[_0x2707('0x2a')]({'transcribeStatus':'FAILED','failureReason':_0x5d523f[_0x2707('0x12')][_0x2707('0x30')]})[_0x2707('0x10')](function(){logger[_0x2707('0xa')](util[_0x2707('0xb')](_0x2707('0x2e'),_0x2b769c['id']));_0x44c1d7();});default:logger[_0x2707('0xa')](util['format'](_0x2707('0x31'),_0x2b769c['id']));break;}}else{return BPromise[_0x2707('0x32')]()[_0x2707('0x10')](function(){if(!_0x2b769c[_0x2707('0x1e')]){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))](_0x2707('0x33'));}if(!_0x32d4bd[_0x2707('0x21')]||!_0x32d4bd[_0x2707('0x22')]||!_0x32d4bd[_0x2707('0x34')]||!_0x32d4bd[_0x2707('0x23')]||!_0x32d4bd[_0x2707('0x35')]){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))](_0x2707('0x36'));}if(!_0x2b769c[_0x2707('0x1c')]){throw new Error('Transcript\x20not\x20available');}if(_0x32d4bd[_0x2707('0x22')]===_0x40d370['id']){return _0x40d370;}else{return db[_0x2707('0x25')]['findOne']({'where':{'id':_settings[_0x2707('0x22')]}});}})['then'](function(_0x14f5dc){if(!_0x14f5dc){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))](_0x2707('0x26'));}if(!_0x14f5dc[_0x2707('0xe')]||!_0x14f5dc[_0x2707('0x27')]){throw new db[(_0x2707('0x1f'))]['ValidationError'](_0x2707('0x28'));}_0x5bf16e=_0x14f5dc;logger[_0x2707('0xa')](util['format'](_0x2707('0x37'),_0x2b769c['id']));return sentiment(_0x5bf16e[_0x2707('0xe')],_0x5bf16e[_0x2707('0x27')],_0x32d4bd['sentimentRegion'],_0x2b769c['fileText'],_0x32d4bd[_0x2707('0x23')]);})[_0x2707('0x10')](function(_0x53f345){logger[_0x2707('0xa')](util['format'](_0x2707('0x29'),_0x2b769c['id']));return _0x2b769c[_0x2707('0x2a')]({'sentiment':_0x53f345[_0x2707('0x38')],'sPositive':_0x53f345[_0x2707('0x2c')]['Positive'],'sNegative':_0x53f345[_0x2707('0x2c')][_0x2707('0x39')],'sMixed':_0x53f345[_0x2707('0x2c')][_0x2707('0x2d')],'sNeutral':_0x53f345[_0x2707('0x2c')][_0x2707('0x3a')],'transcribeStatus':_0x2707('0x14')});})['then'](function(){logger[_0x2707('0xa')](util[_0x2707('0xb')](_0x2707('0x2e'),_0x2b769c['id']));_0x44c1d7();});}})[_0x2707('0x3b')](function(_0x449738){if(_0x449738){if(!_0x449738['name']||_0x449738[_0x2707('0x3c')]!=='SequelizeValidationError'){logger[_0x2707('0x3d')](util[_0x2707('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x2b769c['id']),util[_0x2707('0x3e')](_0x449738,{'showHidden':![],'depth':null}));}}_0x44c1d7();});});}function checkTranscribe(){var _0x42e524;var _0x2cba43;var _0x4ae196;return db[_0x2707('0x3f')]['findAll']({'where':{'transcribeStatus':_0x2707('0x40')}})[_0x2707('0x10')](function(_0x559255){if(!_0x559255||!_0x559255[_0x2707('0x1b')]){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))]('No\x20transcribe\x20job\x20to\x20check');}_0x42e524=_0x559255;return db['Setting'][_0x2707('0x41')]({'where':{'id':0x1}});})[_0x2707('0x10')](function(_0x292b44){if(!_0x292b44){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))]('Settings\x20not\x20available');}_0x2cba43=_0x292b44;if(!_0x2cba43['transcribe']||!_0x2cba43['transcribeAccountId']||!_0x2cba43[_0x2707('0xf')]||!_0x2cba43[_0x2707('0x23')]||!_0x2cba43[_0x2707('0x35')]){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))]('Transcribe\x20not\x20configured');}return db[_0x2707('0x25')][_0x2707('0x41')]({'where':{'id':_0x2cba43['transcribeAccountId']}});})['then'](function(_0x3b41b2){if(!_0x3b41b2){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x3b41b2[_0x2707('0xe')]||!_0x3b41b2[_0x2707('0x27')]){throw new db[(_0x2707('0x1f'))][(_0x2707('0x20'))]('Cloud\x20Provider\x20not\x20configured');}_0x4ae196=_0x3b41b2;var _0x1251cf=[];_0x42e524[_0x2707('0x42')](function(_0x28a80e){_0x1251cf[_0x2707('0x43')](checkTranscribeJob(_0x28a80e,_0x2cba43,_0x4ae196));});return BPromise[_0x2707('0x44')](_0x1251cf);})[_0x2707('0x3b')](function(_0xd2bd1a){if(_0xd2bd1a){if(!_0xd2bd1a[_0x2707('0x3c')]||_0xd2bd1a[_0x2707('0x3c')]!==_0x2707('0x45')){logger['error'](util[_0x2707('0x3e')](_0xd2bd1a,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x38d0=['error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','IN_PROGRESS','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','aws-sdk','request-promise','util','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','transcribeName','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED','Transcript','[RECORDING:%d]\x20Get\x20transcript','TranscriptFileUri','then','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','sentiment','sentimentAccountId','sentimentRegion','bucket','Transcript\x20not\x20available','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','ValidationError','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Negative','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','Sentiment\x20Analysis\x20not\x20configured','findOne','Mixed','catch','name','SequelizeValidationError'];(function(_0x43cf13,_0x4de48e){var _0x16a178=function(_0x434bd0){while(--_0x434bd0){_0x43cf13['push'](_0x43cf13['shift']());}};_0x16a178(++_0x4de48e);}(_0x38d0,0x123));var _0x038d=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x38d0[_0x342baa];return _0x1208f3;};var _=require('lodash');var AWS=require(_0x038d('0x0'));var rp=require(_0x038d('0x1'));var util=require(_0x038d('0x2'));var BPromise=require('bluebird');var db=require(_0x038d('0x3'))['db'];var logger=require(_0x038d('0x4'))('transcribe');function getTranscriptionJob(_0x52b2f8,_0xfff18,_0x53b1b4,_0x26ae55){return new Promise(function(_0x2dd6b0,_0x5914cb){var _0x10dca5=new AWS[(_0x038d('0x5'))]({'accessKeyId':_0xfff18,'secretAccessKey':_0x52b2f8,'region':_0x53b1b4});_0x10dca5[_0x038d('0x6')]({'TranscriptionJobName':_0x26ae55},function(_0x76bc10,_0x22d8ab){if(_0x76bc10){return _0x5914cb(_0x76bc10);}else{return _0x2dd6b0(_0x22d8ab);}});});}function sentiment(_0x1f8f2a,_0x113aec,_0x353806,_0x4689dc,_0xd38e5e){return new Promise(function(_0xf2147f,_0x41ffe0){var _0x56ba0e=new AWS[(_0x038d('0x7'))]({'accessKeyId':_0x113aec,'secretAccessKey':_0x1f8f2a,'region':_0x353806});_0x56ba0e[_0x038d('0x8')]({'Text':_0x4689dc,'LanguageCode':_0xd38e5e[_0x038d('0x9')](0x0,0x2)},function(_0x5b6439,_0x292b7f){if(_0x5b6439){return _0x41ffe0(_0x5b6439);}else{return _0xf2147f(_0x292b7f);}});});}function checkTranscribeJob(_0x36ef7c,_0x1be329,_0x225683){var _0x12c34d;return new BPromise(function(_0x114250,_0x12c302){logger[_0x038d('0xa')](util[_0x038d('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x36ef7c['id'],_0x36ef7c['transcribeName']));return getTranscriptionJob(_0x225683['data1'],_0x225683[_0x038d('0xc')],_0x1be329[_0x038d('0xd')],_0x36ef7c['transcribeName'])['then'](function(_0x4e4960){logger['info'](util[_0x038d('0xb')](_0x038d('0xe'),_0x36ef7c['id'],_0x36ef7c[_0x038d('0xf')],_0x4e4960[_0x038d('0x10')][_0x038d('0x11')]));if(!_0x36ef7c[_0x038d('0x12')]){switch(_0x4e4960[_0x038d('0x10')][_0x038d('0x11')]){case _0x038d('0x13'):var _0x46a9c2={'transcribeStatus':_0x4e4960[_0x038d('0x10')][_0x038d('0x11')],'fileUri':_0x4e4960[_0x038d('0x10')][_0x038d('0x14')]['TranscriptFileUri']};logger['info'](util[_0x038d('0xb')](_0x038d('0x15'),_0x36ef7c['id']));return rp({'uri':_0x4e4960[_0x038d('0x10')][_0x038d('0x14')][_0x038d('0x16')],'json':!![]})[_0x038d('0x17')](function(_0x40586e){logger['info'](util[_0x038d('0xb')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x36ef7c['id']));if(_0x40586e&&_0x40586e[_0x038d('0x18')]&&_0x40586e[_0x038d('0x18')]['transcripts']&&_0x40586e[_0x038d('0x18')][_0x038d('0x19')][_0x038d('0x1a')]){_0x46a9c2[_0x038d('0x12')]='';for(var _0xdeab55=0x0;_0xdeab55<_0x40586e['results'][_0x038d('0x19')][_0x038d('0x1a')];_0xdeab55++){_0x46a9c2[_0x038d('0x12')]+=_0x40586e['results']['transcripts'][_0xdeab55]['transcript']+'';}}return _0x36ef7c[_0x038d('0x1b')](_0x46a9c2);})[_0x038d('0x17')](function(){logger[_0x038d('0xa')](util[_0x038d('0xb')](_0x038d('0x1c'),_0x36ef7c['id']));if(!_0x36ef7c[_0x038d('0x1d')]){throw new db[(_0x038d('0x1e'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1be329[_0x038d('0x1f')]||!_0x1be329[_0x038d('0x20')]||!_0x1be329[_0x038d('0x21')]||!_0x1be329['language']||!_0x1be329[_0x038d('0x22')]){throw new db[(_0x038d('0x1e'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x46a9c2[_0x038d('0x12')]){throw new Error(_0x038d('0x23'));}if(_0x1be329[_0x038d('0x20')]===_0x225683['id']){return _0x225683;}else{return db[_0x038d('0x24')]['findOne']({'where':{'id':_settings[_0x038d('0x20')]}});}})['then'](function(_0x1ea796){if(!_0x1ea796){throw new db[(_0x038d('0x1e'))]['ValidationError'](_0x038d('0x25'));}if(!_0x1ea796[_0x038d('0x26')]||!_0x1ea796[_0x038d('0xc')]){throw new db['Sequelize'][(_0x038d('0x27'))](_0x038d('0x28'));}_0x12c34d=_0x1ea796;logger['info'](util[_0x038d('0xb')](_0x038d('0x29'),_0x36ef7c['id']));return sentiment(_0x12c34d[_0x038d('0x26')],_0x12c34d['data2'],_0x1be329[_0x038d('0x21')],_0x46a9c2[_0x038d('0x12')],_0x1be329[_0x038d('0x2a')]);})[_0x038d('0x17')](function(_0x5f30e7){logger[_0x038d('0xa')](util[_0x038d('0xb')](_0x038d('0x2b'),_0x36ef7c['id']));return _0x36ef7c[_0x038d('0x1b')]({'sentiment':_0x5f30e7[_0x038d('0x2c')],'sPositive':_0x5f30e7['SentimentScore'][_0x038d('0x2d')],'sNegative':_0x5f30e7[_0x038d('0x2e')][_0x038d('0x2f')],'sMixed':_0x5f30e7[_0x038d('0x2e')]['Mixed'],'sNeutral':_0x5f30e7[_0x038d('0x2e')][_0x038d('0x30')]});})[_0x038d('0x17')](function(){logger[_0x038d('0xa')](util['format'](_0x038d('0x1c'),_0x36ef7c['id']));_0x114250();});case _0x038d('0x31'):return _0x36ef7c['update']({'transcribeStatus':_0x038d('0x31'),'failureReason':_0x4e4960['TranscriptionJob'][_0x038d('0x32')]})[_0x038d('0x17')](function(){logger['info'](util['format']('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x36ef7c['id']));_0x114250();});default:logger[_0x038d('0xa')](util[_0x038d('0xb')](_0x038d('0x33'),_0x36ef7c['id']));break;}}else{return BPromise['resolve']()['then'](function(){if(!_0x36ef7c['tempSentiment']){throw new db[(_0x038d('0x1e'))][(_0x038d('0x27'))](_0x038d('0x34'));}if(!_0x1be329[_0x038d('0x1f')]||!_0x1be329['sentimentAccountId']||!_0x1be329[_0x038d('0x21')]||!_0x1be329[_0x038d('0x2a')]||!_0x1be329[_0x038d('0x22')]){throw new db[(_0x038d('0x1e'))][(_0x038d('0x27'))](_0x038d('0x35'));}if(!_0x36ef7c[_0x038d('0x12')]){throw new Error(_0x038d('0x23'));}if(_0x1be329[_0x038d('0x20')]===_0x225683['id']){return _0x225683;}else{return db[_0x038d('0x24')][_0x038d('0x36')]({'where':{'id':_settings[_0x038d('0x20')]}});}})[_0x038d('0x17')](function(_0x3051a2){if(!_0x3051a2){throw new db[(_0x038d('0x1e'))][(_0x038d('0x27'))](_0x038d('0x25'));}if(!_0x3051a2[_0x038d('0x26')]||!_0x3051a2[_0x038d('0xc')]){throw new db[(_0x038d('0x1e'))][(_0x038d('0x27'))](_0x038d('0x28'));}_0x12c34d=_0x3051a2;logger[_0x038d('0xa')](util['format'](_0x038d('0x29'),_0x36ef7c['id']));return sentiment(_0x12c34d['data1'],_0x12c34d['data2'],_0x1be329[_0x038d('0x21')],_0x36ef7c[_0x038d('0x12')],_0x1be329[_0x038d('0x2a')]);})[_0x038d('0x17')](function(_0x299e94){logger[_0x038d('0xa')](util[_0x038d('0xb')](_0x038d('0x2b'),_0x36ef7c['id']));return _0x36ef7c[_0x038d('0x1b')]({'sentiment':_0x299e94[_0x038d('0x2c')],'sPositive':_0x299e94[_0x038d('0x2e')][_0x038d('0x2d')],'sNegative':_0x299e94[_0x038d('0x2e')]['Negative'],'sMixed':_0x299e94[_0x038d('0x2e')][_0x038d('0x37')],'sNeutral':_0x299e94[_0x038d('0x2e')][_0x038d('0x30')],'transcribeStatus':_0x038d('0x13')});})[_0x038d('0x17')](function(){logger[_0x038d('0xa')](util[_0x038d('0xb')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x36ef7c['id']));_0x114250();});}})[_0x038d('0x38')](function(_0x2162ee){if(_0x2162ee){if(!_0x2162ee[_0x038d('0x39')]||_0x2162ee[_0x038d('0x39')]!==_0x038d('0x3a')){logger[_0x038d('0x3b')](util[_0x038d('0xb')](_0x038d('0x3c'),_0x36ef7c['id']),util[_0x038d('0x3d')](_0x2162ee,{'showHidden':![],'depth':null}));}}_0x114250();});});}function checkTranscribe(){var _0xb11206;var _0x55bcd6;var _0x2df566;return db[_0x038d('0x3e')]['findAll']({'where':{'transcribeStatus':_0x038d('0x3f')}})[_0x038d('0x17')](function(_0x11b2a1){if(!_0x11b2a1||!_0x11b2a1[_0x038d('0x1a')]){throw new db[(_0x038d('0x1e'))][(_0x038d('0x27'))]('No\x20transcribe\x20job\x20to\x20check');}_0xb11206=_0x11b2a1;return db['Setting']['findOne']({'where':{'id':0x1}});})[_0x038d('0x17')](function(_0x3d7dcd){if(!_0x3d7dcd){throw new db['Sequelize'][(_0x038d('0x27'))](_0x038d('0x40'));}_0x55bcd6=_0x3d7dcd;if(!_0x55bcd6['transcribe']||!_0x55bcd6[_0x038d('0x41')]||!_0x55bcd6['transcribeRegion']||!_0x55bcd6[_0x038d('0x2a')]||!_0x55bcd6[_0x038d('0x22')]){throw new db['Sequelize'][(_0x038d('0x27'))](_0x038d('0x42'));}return db[_0x038d('0x24')][_0x038d('0x36')]({'where':{'id':_0x55bcd6[_0x038d('0x41')]}});})[_0x038d('0x17')](function(_0x55f50f){if(!_0x55f50f){throw new db[(_0x038d('0x1e'))][(_0x038d('0x27'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x55f50f[_0x038d('0x26')]||!_0x55f50f[_0x038d('0xc')]){throw new db[(_0x038d('0x1e'))]['ValidationError'](_0x038d('0x28'));}_0x2df566=_0x55f50f;var _0x408119=[];_0xb11206[_0x038d('0x43')](function(_0x3d30c4){_0x408119[_0x038d('0x44')](checkTranscribeJob(_0x3d30c4,_0x55bcd6,_0x2df566));});return BPromise[_0x038d('0x45')](_0x408119);})[_0x038d('0x38')](function(_0x50f1f2){if(_0x50f1f2){if(!_0x50f1f2[_0x038d('0x39')]||_0x50f1f2[_0x038d('0x39')]!==_0x038d('0x3a')){logger[_0x038d('0x3b')](util[_0x038d('0x3d')](_0x50f1f2,{'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 5588cf1..2124bde 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 _0xd2d2=['[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','moment','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','findAll','subtract','hours','then','join','update','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info'];(function(_0x5823bc,_0x1398f0){var _0x2d31d5=function(_0x4b9792){while(--_0x4b9792){_0x5823bc['push'](_0x5823bc['shift']());}};_0x2d31d5(++_0x1398f0);}(_0xd2d2,0x101));var _0x2d2d=function(_0x65adea,_0xa7be87){_0x65adea=_0x65adea-0x0;var _0xee7730=_0xd2d2[_0x65adea];return _0xee7730;};'use strict';var _=require('lodash');var moment=require(_0x2d2d('0x0'));var Redis=require(_0x2d2d('0x1'));var util=require('util');var config=require(_0x2d2d('0x2'));var db=require(_0x2d2d('0x3'))['db'];var logger=require(_0x2d2d('0x4'))('schedule');config[_0x2d2d('0x5')]=_[_0x2d2d('0x6')](config['redis'],{'host':_0x2d2d('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d2d('0x5')]));function closeInteractions(){var _0x2ec80d=[];return db['WhatsappInteraction'][_0x2d2d('0x8')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x2d2d('0x9')](0x18,_0x2d2d('0xa'))}}})[_0x2d2d('0xb')](function(_0x12b2c7){if(_0x12b2c7&&_0x12b2c7['length']){_0x2ec80d=_['map'](_0x12b2c7||[],'id');logger['info']('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x2ec80d[_0x2d2d('0xc')]());return db['WhatsappInteraction'][_0x2d2d('0xd')]({'closeReason':'system','disposition':_0x2d2d('0xe'),'closed':!![],'closedAt':moment()[_0x2d2d('0xf')](_0x2d2d('0x10'))},{'where':{'id':_0x2ec80d}});}})['then'](function(){if(_0x2ec80d&&_0x2ec80d['length']){logger[_0x2d2d('0x11')](_0x2d2d('0x12'),_0x2ec80d[_0x2d2d('0xc')]());for(var _0x46b4ef=0x0;_0x46b4ef<_0x2ec80d['length'];_0x46b4ef++){io[_0x2d2d('0x13')]('whatsappInteraction:update',{'id':_0x2ec80d[_0x46b4ef],'closed':!![]});}}})[_0x2d2d('0x14')](function(_0x4a22eb){logger[_0x2d2d('0x15')](_0x2d2d('0x16'),_0x4a22eb?util[_0x2d2d('0x17')](_0x4a22eb,{'showHidden':![],'depth':null}):'');});}exports[_0x2d2d('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4ac9=['../../mysqldb','../logger','schedule','redis','defaults','localhost','lastMsgAt','map','info','join','WhatsappInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','whatsappInteraction:update','catch','error','start','lodash','ioredis','util','../../config/environment'];(function(_0x30dea6,_0x45559f){var _0x1a70bd=function(_0x52a805){while(--_0x52a805){_0x30dea6['push'](_0x30dea6['shift']());}};_0x1a70bd(++_0x45559f);}(_0x4ac9,0xab));var _0x94ac=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0x4ac9[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0x94ac('0x0'));var moment=require('moment');var Redis=require(_0x94ac('0x1'));var util=require(_0x94ac('0x2'));var config=require(_0x94ac('0x3'));var db=require(_0x94ac('0x4'))['db'];var logger=require(_0x94ac('0x5'))(_0x94ac('0x6'));config[_0x94ac('0x7')]=_[_0x94ac('0x8')](config[_0x94ac('0x7')],{'host':_0x94ac('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x94ac('0x7')]));function closeInteractions(){var _0x14c39f=[];return db['WhatsappInteraction']['findAll']({'raw':!![],'attributes':['id',_0x94ac('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,'hours')}}})['then'](function(_0x5ca0c7){if(_0x5ca0c7&&_0x5ca0c7['length']){_0x14c39f=_[_0x94ac('0xb')](_0x5ca0c7||[],'id');logger[_0x94ac('0xc')]('[WHATSAPP]\x20Interactions\x20to\x20close:',_0x14c39f[_0x94ac('0xd')]());return db[_0x94ac('0xe')][_0x94ac('0xf')]({'closeReason':_0x94ac('0x10'),'disposition':_0x94ac('0x11'),'closed':!![],'closedAt':moment()['format'](_0x94ac('0x12'))},{'where':{'id':_0x14c39f}});}})['then'](function(){if(_0x14c39f&&_0x14c39f[_0x94ac('0x13')]){logger[_0x94ac('0xc')](_0x94ac('0x14'),_0x14c39f['join']());for(var _0x4e27a9=0x0;_0x4e27a9<_0x14c39f['length'];_0x4e27a9++){io['emit'](_0x94ac('0x15'),{'id':_0x14c39f[_0x4e27a9],'closed':!![]});}}})[_0x94ac('0x16')](function(_0x4cd92a){logger[_0x94ac('0x17')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x4cd92a?util['inspect'](_0x4cd92a,{'showHidden':![],'depth':null}):'');});}exports[_0x94ac('0x18')]=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 31d3402..f7c50e6 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa389=['Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','bulkCreate','then','log','contacts1','destroy','finished\x20populating','CmHopper','hopper2','catch','../mysqldb','push'];(function(_0x38569a,_0x1279f2){var _0x5aa538=function(_0xc7747f){while(--_0xc7747f){_0x38569a['push'](_0x38569a['shift']());}};_0x5aa538(++_0x1279f2);}(_0xa389,0x75));var _0x9a38=function(_0xd795c0,_0x578724){_0xd795c0=_0xd795c0-0x0;var _0x830b6f=_0xa389[_0xd795c0];return _0x830b6f;};'use strict';var util=require('util');var db=require(_0x9a38('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x9a38('0x1')]({'id':i,'firstName':_0x9a38('0x2')+i,'lastName':_0x9a38('0x3')+i,'phone':0xf879fb460+i,'email':_0x9a38('0x4')+i+_0x9a38('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9a38('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x9a38('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9a38('0x6')](),'updatedAt':Date[_0x9a38('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9a38('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x9a38('0x3')+i,'phone':0xf879fb460+i,'email':_0x9a38('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x9a38('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9a38('0x6')](),'updatedAt':Date[_0x9a38('0x6')]()});}db[_0x9a38('0x7')]['destroy']({'where':{}})['then'](function(){return db[_0x9a38('0x7')][_0x9a38('0x8')](contacts);})[_0x9a38('0x9')](function(){console[_0x9a38('0xa')]('finished\x20populating',_0x9a38('0xb'));return db['CmHopper'][_0x9a38('0xc')]({'where':{}});})[_0x9a38('0x9')](function(){return db['CmHopper'][_0x9a38('0x8')](hopper);})[_0x9a38('0x9')](function(){console[_0x9a38('0xa')](_0x9a38('0xd'),'hopper1');return db[_0x9a38('0x7')][_0x9a38('0x8')](contacts2);})['then'](function(){console[_0x9a38('0xa')](_0x9a38('0xd'),'contacts2');return db[_0x9a38('0xe')][_0x9a38('0x8')](hopper2);})[_0x9a38('0x9')](function(){console['log']('finished\x20populating',_0x9a38('0xf'));})[_0x9a38('0x10')](function(_0x305ba2){console[_0x9a38('0xa')](_0x305ba2);}); \ No newline at end of file +var _0xa670=['now','innocenzo.biondo','CmContact','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','destroy','hopper1','contacts2','hopper2','catch','util','../mysqldb','Innocenzo','Biondo','@xcally.com','push'];(function(_0x58c338,_0x1955c6){var _0x5c3133=function(_0xa79a6c){while(--_0xa79a6c){_0x58c338['push'](_0x58c338['shift']());}};_0x5c3133(++_0x1955c6);}(_0xa670,0x86));var _0x0a67=function(_0x5b266e,_0x156efd){_0x5b266e=_0x5b266e-0x0;var _0x39ca67=_0xa670[_0x5b266e];return _0x39ca67;};'use strict';var util=require(_0x0a67('0x0'));var db=require(_0x0a67('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x0a67('0x2')+i,'lastName':_0x0a67('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x0a67('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0a67('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x0a67('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0a67('0x6')](),'updatedAt':Date[_0x0a67('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x0a67('0x5')]({'id':i,'firstName':_0x0a67('0x2')+i,'lastName':_0x0a67('0x3')+i,'phone':0xf879fb460+i,'email':_0x0a67('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0a67('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x0a67('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0a67('0x6')](),'updatedAt':Date[_0x0a67('0x6')]()});}db[_0x0a67('0x8')]['destroy']({'where':{}})[_0x0a67('0x9')](function(){return db[_0x0a67('0x8')][_0x0a67('0xa')](contacts);})[_0x0a67('0x9')](function(){console[_0x0a67('0xb')](_0x0a67('0xc'),_0x0a67('0xd'));return db[_0x0a67('0xe')][_0x0a67('0xf')]({'where':{}});})[_0x0a67('0x9')](function(){return db[_0x0a67('0xe')]['bulkCreate'](hopper);})[_0x0a67('0x9')](function(){console[_0x0a67('0xb')]('finished\x20populating',_0x0a67('0x10'));return db[_0x0a67('0x8')][_0x0a67('0xa')](contacts2);})['then'](function(){console[_0x0a67('0xb')](_0x0a67('0xc'),_0x0a67('0x11'));return db[_0x0a67('0xe')][_0x0a67('0xa')](hopper2);})[_0x0a67('0x9')](function(){console[_0x0a67('0xb')](_0x0a67('0xc'),_0x0a67('0x12'));})[_0x0a67('0x13')](function(_0x37dd3f){console[_0x0a67('0xb')](_0x37dd3f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 0b7084b..2b5ae25 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81d1=['agent','format','%s%s@xcally.com','password','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','%s%s'];(function(_0x1be6fd,_0x1d70a4){var _0x3ec8f6=function(_0x2c1d4c){while(--_0x2c1d4c){_0x1be6fd['push'](_0x1be6fd['shift']());}};_0x3ec8f6(++_0x1d70a4);}(_0x81d1,0x1a0));var _0x181d=function(_0x1bb6aa,_0x40fe82){_0x1bb6aa=_0x1bb6aa-0x0;var _0x2ef28e=_0x81d1[_0x1bb6aa];return _0x2ef28e;};'use strict';var util=require(_0x181d('0x0'));var db=require(_0x181d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x181d('0x2')]({'name':util['format'](_0x181d('0x3'),_0x181d('0x4'),i),'fullname':util[_0x181d('0x5')](_0x181d('0x3'),'agent',i),'email':util[_0x181d('0x5')](_0x181d('0x6'),_0x181d('0x4'),i),'role':_0x181d('0x4'),'password':_0x181d('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0x181d('0x8'),'ws','wss'],'disallow':[_0x181d('0x9')],'allow':[_0x181d('0xa')],'defaultuser':util[_0x181d('0x5')](_0x181d('0x3'),_0x181d('0x4'),i),'encryption':_0x181d('0xb'),'avpf':_0x181d('0xb'),'force_avp':_0x181d('0xb'),'icesupport':_0x181d('0xb'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0x181d('0xc'),'dtlsprivatekey':_0x181d('0xd'),'dtlssetup':_0x181d('0xe'),'callerid':util[_0x181d('0x5')](_0x181d('0xf'),util[_0x181d('0x5')](_0x181d('0x3'),_0x181d('0x4'),i),0xfa0+i)});}db['User'][_0x181d('0x10')](users)[_0x181d('0x11')](function(){console[_0x181d('0x12')](_0x181d('0x13'));})[_0x181d('0x14')](function(_0xa7c636){console[_0x181d('0x12')](_0xa7c636);}); \ No newline at end of file +var _0x230d=['%s%s@xcally.com','password','wss','all','yes','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','util','../mysqldb','push','format','agent','%s%s'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x230d,0x108));var _0xd230=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x230d[_0x19950b];return _0x3c6b41;};'use strict';var util=require(_0xd230('0x0'));var db=require(_0xd230('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd230('0x2')]({'name':util[_0xd230('0x3')]('%s%s',_0xd230('0x4'),i),'fullname':util[_0xd230('0x3')](_0xd230('0x5'),_0xd230('0x4'),i),'email':util[_0xd230('0x3')](_0xd230('0x6'),_0xd230('0x4'),i),'role':_0xd230('0x4'),'password':_0xd230('0x7'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0xd230('0x8')],'disallow':[_0xd230('0x9')],'allow':['ulaw'],'defaultuser':util[_0xd230('0x3')](_0xd230('0x5'),_0xd230('0x4'),i),'encryption':_0xd230('0xa'),'avpf':_0xd230('0xa'),'force_avp':_0xd230('0xa'),'icesupport':_0xd230('0xa'),'dtlsenable':_0xd230('0xa'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xd230('0xb'),'callerid':util['format'](_0xd230('0xc'),util[_0xd230('0x3')](_0xd230('0x5'),_0xd230('0x4'),i),0xfa0+i)});}db[_0xd230('0xd')][_0xd230('0xe')](users)[_0xd230('0xf')](function(){console[_0xd230('0x10')](_0xd230('0x11'));})['catch'](function(_0x3cfeea){console[_0xd230('0x10')](_0x3cfeea);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index c77ba17..274a724 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa5d7=['handshake','ChatInteractions','MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','user','FaxQueue','MailQueue','Trunks','Trunk','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','length','voice','fax','sms','openchannel','telephone:%s','type','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','user_has_whatsapp_interactions:remove','join','default','request','connection','remotePort','log','nsp','address','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','name','User','role','telephone','agent','ivr','UserProfileSection','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','UserProfileResource','resourceId','map','where','Campaign','format','%s:queue:%s','Agents','user:%s','query','find','userProfileId'];(function(_0x5ce21e,_0xc6f46f){var _0x50d681=function(_0x4f7f7e){while(--_0x4f7f7e){_0x5ce21e['push'](_0x5ce21e['shift']());}};_0x50d681(++_0xc6f46f);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x57bbd4,_0x5e6767){_0x57bbd4=_0x57bbd4-0x0;var _0x5ed203=_0xa5d7[_0x57bbd4];return _0x5ed203;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var BPromise=require(_0x7a5d('0x2'));var db=require(_0x7a5d('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x7a5d('0x4')],'include':[{'as':'Agents','model':db[_0x7a5d('0x5')],'attributes':['id','name',_0x7a5d('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x7a5d('0x4')],'where':{'role':_0x7a5d('0x7')}};var queryTrunks={'raw':!![],'attributes':['id',_0x7a5d('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x7a5d('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x7a5d('0x4'),'type'],'where':{'type':_0x7a5d('0x9')}};function getAssociatedResources(_0x5d793f,_0x42b9ed,_0x1057e5){return db[_0x7a5d('0xa')]['findOne']({'where':{'name':_0x5d793f,'userProfileId':_0x42b9ed},'raw':!![]})[_0x7a5d('0xb')](function(_0x8f88a8){if(_0x8f88a8){if(_0x8f88a8[_0x7a5d('0xc')]){switch(_0x5d793f){case _0x7a5d('0xd'):case _0x7a5d('0xe'):case _0x7a5d('0xf'):case _0x7a5d('0x10'):case _0x7a5d('0x11'):case _0x7a5d('0x12'):case _0x7a5d('0x13'):return db[_0x1057e5][_0x7a5d('0x14')](queryQueues);case _0x7a5d('0x15'):return db[_0x1057e5]['findAll'](queryTelephones);case'Trunks':return db[_0x1057e5][_0x7a5d('0x14')](queryTrunks);case'IvrCampaigns':return db[_0x1057e5][_0x7a5d('0x14')](queryCampaigns);}}else{return db[_0x7a5d('0x16')][_0x7a5d('0x14')]({'attributes':[_0x7a5d('0x17')],'where':{'sectionId':_0x8f88a8['id']},'raw':!![]})[_0x7a5d('0xb')](function(_0x342f63){if(_0x342f63){var _0x50070a={'where':{'id':_[_0x7a5d('0x18')](_0x342f63,_0x7a5d('0x17'))},'raw':!![]};switch(_0x1057e5){case _0x7a5d('0x5'):_0x50070a[_0x7a5d('0x19')][_0x7a5d('0x6')]='telephone';break;case _0x7a5d('0x1a'):_0x50070a[_0x7a5d('0x19')]['type']='ivr';break;}return db[_0x1057e5][_0x7a5d('0x14')](_0x50070a);}else{return[];}});}}else{return[];}})[_0x7a5d('0xb')](function(_0x55fac7){return _0x55fac7;});}function joinOrLeaveQueues(_0x1dea47,_0x4a02f2,_0x1fd82e,_0x4a0d27){_0x1dea47[_0x4a02f2](util[_0x7a5d('0x1b')](_0x7a5d('0x1c'),_0x1fd82e,_0x4a0d27['name']));if(_0x4a0d27[_0x7a5d('0x1d')]){for(var _0x4faec5=0x0;_0x4faec5<_0x4a0d27[_0x7a5d('0x1d')]['length'];_0x4faec5+=0x1){_0x1dea47[_0x4a02f2](util['format'](_0x7a5d('0x1e'),_0x4a0d27[_0x7a5d('0x1d')][_0x4faec5][_0x7a5d('0x4')]));}}}function joinOrLeave(_0x48da22,_0x7b8ce1,_0x45377a){var _0x1bd069;if(_0x48da22['handshake'][_0x7a5d('0x1f')]['id']){db['User'][_0x7a5d('0x20')]({'attributes':['id',_0x7a5d('0x4'),_0x7a5d('0x6'),_0x7a5d('0x21')],'where':{'id':_0x48da22[_0x7a5d('0x22')][_0x7a5d('0x1f')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0x7a5d('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x7a5d('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x7a5d('0x25')],'as':_0x7a5d('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x7a5d('0x27')],'as':_0x7a5d('0x28'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x7a5d('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x7a5d('0x2a')],'as':_0x7a5d('0x2b'),'attributes':['id'],'raw':!![]}]})[_0x7a5d('0xb')](function(_0x3975){if(_0x3975){_0x1bd069=_0x3975;_0x48da22[_0x7b8ce1](util[_0x7a5d('0x1b')](_0x7a5d('0x1e'),_0x3975[_0x7a5d('0x4')]));var _0x586e77=[];switch(_0x3975[_0x7a5d('0x6')]){case _0x7a5d('0x2c'):_0x48da22[_0x7b8ce1](_0x7a5d('0x2d'));_0x48da22[_0x7b8ce1](_0x7a5d('0x2e'));if(queryQueues[_0x7a5d('0x2f')](_0x7a5d('0x30'))){delete queryQueues[_0x7a5d('0x30')];}_0x586e77[_0x7a5d('0x31')](db[_0x7a5d('0x32')][_0x7a5d('0x14')](queryQueues));_0x586e77[_0x7a5d('0x31')](db[_0x7a5d('0x33')][_0x7a5d('0x14')](queryQueues));_0x586e77[_0x7a5d('0x31')](db['FaxQueue'][_0x7a5d('0x14')](queryQueues));_0x586e77['push'](db[_0x7a5d('0x34')][_0x7a5d('0x14')](queryQueues));_0x586e77[_0x7a5d('0x31')](db['MailQueue'][_0x7a5d('0x14')](queryQueues));_0x586e77[_0x7a5d('0x31')](db[_0x7a5d('0x35')][_0x7a5d('0x14')](queryQueues));_0x586e77['push'](db[_0x7a5d('0x36')][_0x7a5d('0x14')](queryQueues));_0x586e77[_0x7a5d('0x31')](db[_0x7a5d('0x5')][_0x7a5d('0x14')](queryTelephones));_0x586e77[_0x7a5d('0x31')](db['Trunk'][_0x7a5d('0x14')](queryTrunks));_0x586e77[_0x7a5d('0x31')](db[_0x7a5d('0x1a')]['findAll'](queryCampaigns));_0x586e77[_0x7a5d('0x31')](db[_0x7a5d('0x5')][_0x7a5d('0x14')](queryAgents));break;case _0x7a5d('0x37'):_0x48da22[_0x7b8ce1](_0x7a5d('0x2d'));_0x48da22[_0x7b8ce1](_0x7a5d('0x2e'));_0x586e77[_0x7a5d('0x31')](getAssociatedResources(_0x7a5d('0xd'),_0x3975[_0x7a5d('0x21')],_0x7a5d('0x32')));_0x586e77[_0x7a5d('0x31')](getAssociatedResources(_0x7a5d('0xe'),_0x3975[_0x7a5d('0x21')],_0x7a5d('0x33')));_0x586e77['push'](getAssociatedResources(_0x7a5d('0xf'),_0x3975[_0x7a5d('0x21')],_0x7a5d('0x38')));_0x586e77[_0x7a5d('0x31')](getAssociatedResources(_0x7a5d('0x10'),_0x3975[_0x7a5d('0x21')],_0x7a5d('0x34')));_0x586e77[_0x7a5d('0x31')](getAssociatedResources(_0x7a5d('0x11'),_0x3975['userProfileId'],_0x7a5d('0x39')));_0x586e77['push'](getAssociatedResources(_0x7a5d('0x12'),_0x3975['userProfileId'],_0x7a5d('0x35')));_0x586e77[_0x7a5d('0x31')](getAssociatedResources(_0x7a5d('0x13'),_0x3975['userProfileId'],_0x7a5d('0x36')));_0x586e77['push'](getAssociatedResources('Telephones',_0x3975[_0x7a5d('0x21')],_0x7a5d('0x5')));_0x586e77['push'](getAssociatedResources(_0x7a5d('0x3a'),_0x3975[_0x7a5d('0x21')],_0x7a5d('0x3b')));_0x586e77['push'](getAssociatedResources(_0x7a5d('0x3c'),_0x3975[_0x7a5d('0x21')],'Campaign'));_0x586e77[_0x7a5d('0x31')](db[_0x7a5d('0x5')][_0x7a5d('0x14')](queryAgents));break;case _0x7a5d('0x8'):_0x48da22[_0x7b8ce1](_0x7a5d('0x2d'));_0x48da22[_0x7b8ce1](_0x7a5d('0x2e'));_0x586e77[_0x7a5d('0x31')](_0x3975['getVoiceQueues']({'attributes':['id',_0x7a5d('0x4')]}));_0x586e77[_0x7a5d('0x31')](_0x3975[_0x7a5d('0x3d')]({'attributes':['id',_0x7a5d('0x4')]}));_0x586e77[_0x7a5d('0x31')](_0x3975[_0x7a5d('0x3e')]({'attributes':['id',_0x7a5d('0x4')]}));_0x586e77[_0x7a5d('0x31')](_0x3975[_0x7a5d('0x3f')]({'attributes':['id','name']}));_0x586e77[_0x7a5d('0x31')](_0x3975[_0x7a5d('0x40')]({'attributes':['id',_0x7a5d('0x4')]}));_0x586e77[_0x7a5d('0x31')](_0x3975[_0x7a5d('0x41')]({'attributes':['id',_0x7a5d('0x4')]}));_0x586e77['push'](_0x3975[_0x7a5d('0x42')]({'attributes':['id',_0x7a5d('0x4')]}));break;}return BPromise[_0x7a5d('0x43')](_0x586e77);}})['then'](function(_0x15ca33){if(_0x15ca33&&_0x15ca33[_0x7a5d('0x44')]){for(var _0x5095a8=0x0;_0x5095a8<_0x15ca33[_0x7a5d('0x44')];_0x5095a8+=0x1){for(var _0x3d0a2f=0x0;_0x3d0a2f<_0x15ca33[_0x5095a8]['length'];_0x3d0a2f+=0x1){switch(_0x5095a8){case 0x0:joinOrLeaveQueues(_0x48da22,_0x7b8ce1,_0x7a5d('0x45'),_0x15ca33[_0x5095a8][_0x3d0a2f]);break;case 0x1:joinOrLeaveQueues(_0x48da22,_0x7b8ce1,'chat',_0x15ca33[_0x5095a8][_0x3d0a2f]);break;case 0x2:joinOrLeaveQueues(_0x48da22,_0x7b8ce1,_0x7a5d('0x46'),_0x15ca33[_0x5095a8][_0x3d0a2f]);break;case 0x3:joinOrLeaveQueues(_0x48da22,_0x7b8ce1,_0x7a5d('0x47'),_0x15ca33[_0x5095a8][_0x3d0a2f]);break;case 0x4:joinOrLeaveQueues(_0x48da22,_0x7b8ce1,'mail',_0x15ca33[_0x5095a8][_0x3d0a2f]);break;case 0x5:joinOrLeaveQueues(_0x48da22,_0x7b8ce1,_0x7a5d('0x48'),_0x15ca33[_0x5095a8][_0x3d0a2f]);break;case 0x6:joinOrLeaveQueues(_0x48da22,_0x7b8ce1,'whatsapp',_0x15ca33[_0x5095a8][_0x3d0a2f]);break;case 0x7:if(_0x1bd069[_0x7a5d('0x6')]!==_0x7a5d('0x8'))_0x48da22[_0x7b8ce1](util[_0x7a5d('0x1b')](_0x7a5d('0x49'),_0x15ca33[_0x5095a8][_0x3d0a2f][_0x7a5d('0x4')]));break;case 0x8:if(_0x1bd069[_0x7a5d('0x6')]!==_0x7a5d('0x8'))_0x48da22[_0x7b8ce1](util[_0x7a5d('0x1b')]('trunk:%s',_0x15ca33[_0x5095a8][_0x3d0a2f][_0x7a5d('0x4')]));break;case 0x9:if(_0x1bd069[_0x7a5d('0x6')]!==_0x7a5d('0x8'))_0x48da22[_0x7b8ce1](util[_0x7a5d('0x1b')]('campaign:%s:%s',_0x15ca33[_0x5095a8][_0x3d0a2f][_0x7a5d('0x4a')],_0x15ca33[_0x5095a8][_0x3d0a2f][_0x7a5d('0x4')]));break;case 0xa:_0x48da22[_0x7b8ce1](util[_0x7a5d('0x1b')](_0x7a5d('0x1e'),_0x15ca33[_0x5095a8][_0x3d0a2f]['name']));break;}}}}})[_0x7a5d('0xb')](function(){if(_0x7b8ce1==='leave'){var _0x1bea47=_[_0x7a5d('0x18')](_0x1bd069['ChatInteractions'],'id');return _0x1bd069['removeChatInteractions'](_0x1bea47)[_0x7a5d('0xb')](function(){for(var _0x1ded06=0x0;_0x1ded06<_0x1bea47[_0x7a5d('0x44')];_0x1ded06+=0x1){_0x45377a[_0x7a5d('0x4b')](_0x7a5d('0x4c'),{'ChatInteractionId':Number(_0x1bea47[_0x1ded06]),'UserId':Number(_0x1bd069['id'])});}});}})['then'](function(){if(_0x7b8ce1===_0x7a5d('0x4d')){var _0x5d0262=_[_0x7a5d('0x18')](_0x1bd069[_0x7a5d('0x4e')],'id');return _0x1bd069[_0x7a5d('0x4f')](_0x5d0262)[_0x7a5d('0xb')](function(){for(var _0x13f598=0x0;_0x13f598<_0x5d0262[_0x7a5d('0x44')];_0x13f598+=0x1){_0x45377a[_0x7a5d('0x4b')](_0x7a5d('0x50'),{'MailInteractionId':Number(_0x5d0262[_0x13f598]),'UserId':Number(_0x1bd069['id'])});}});}})['then'](function(){if(_0x7b8ce1==='leave'){var _0x3863ef=_[_0x7a5d('0x18')](_0x1bd069['FaxInteractions'],'id');return _0x1bd069[_0x7a5d('0x51')](_0x3863ef)[_0x7a5d('0xb')](function(){for(var _0x410e26=0x0;_0x410e26<_0x3863ef[_0x7a5d('0x44')];_0x410e26+=0x1){_0x45377a[_0x7a5d('0x4b')](_0x7a5d('0x52'),{'FaxInteractionId':Number(_0x3863ef[_0x410e26]),'UserId':Number(_0x1bd069['id'])});}});}})['then'](function(){if(_0x7b8ce1===_0x7a5d('0x4d')){var _0xc05cda=_['map'](_0x1bd069[_0x7a5d('0x28')],'id');return _0x1bd069[_0x7a5d('0x53')](_0xc05cda)['then'](function(){for(var _0x290459=0x0;_0x290459<_0xc05cda['length'];_0x290459+=0x1){_0x45377a['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0xc05cda[_0x290459]),'UserId':Number(_0x1bd069['id'])});}});}})[_0x7a5d('0xb')](function(){if(_0x7b8ce1===_0x7a5d('0x4d')){var _0x413f68=_['map'](_0x1bd069[_0x7a5d('0x29')],'id');return _0x1bd069[_0x7a5d('0x54')](_0x413f68)[_0x7a5d('0xb')](function(){for(var _0x3a9cd6=0x0;_0x3a9cd6<_0x413f68['length'];_0x3a9cd6+=0x1){_0x45377a['emit'](_0x7a5d('0x55'),{'OpenchannelInteractionId':Number(_0x413f68[_0x3a9cd6]),'UserId':Number(_0x1bd069['id'])});}});}})[_0x7a5d('0xb')](function(){if(_0x7b8ce1===_0x7a5d('0x4d')){var _0x3eb989=_[_0x7a5d('0x18')](_0x1bd069[_0x7a5d('0x2b')],'id');return _0x1bd069['removeWhatsappInteractions'](_0x3eb989)[_0x7a5d('0xb')](function(){for(var _0x34d739=0x0;_0x34d739<_0x3eb989[_0x7a5d('0x44')];_0x34d739+=0x1){_0x45377a[_0x7a5d('0x4b')](_0x7a5d('0x56'),{'WhatsappInteractionId':Number(_0x3eb989[_0x34d739]),'UserId':Number(_0x1bd069['id'])});}});}})['catch'](function(_0x2e0d1e){_0x48da22['log'](_0x2e0d1e);});}}function onDisconnect(_0x2907e7,_0x50b91e){joinOrLeave(_0x2907e7,'leave',_0x50b91e);}function onConnect(_0x44f1ce){joinOrLeave(_0x44f1ce,_0x7a5d('0x57'));}exports[_0x7a5d('0x58')]=function(_0x6cb78f){_0x6cb78f['on']('connection',function(_0x29c236){_0x29c236['setMaxListeners'](0x0);_0x29c236['address']=_0x29c236[_0x7a5d('0x59')][_0x7a5d('0x5a')]['remoteAddress']+':'+_0x29c236[_0x7a5d('0x59')]['connection'][_0x7a5d('0x5b')];_0x29c236['connectedAt']=new Date();_0x29c236['log']=function(_0x59cdbb){console[_0x7a5d('0x5c')]('SocketIO\x20'+_0x29c236[_0x7a5d('0x5d')][_0x7a5d('0x4')]+'['+_0x29c236[_0x7a5d('0x5e')]+']',_0x59cdbb);};_0x29c236['on']('disconnect',function(){onDisconnect(_0x29c236,_0x6cb78f);_0x29c236[_0x7a5d('0x5c')](_0x7a5d('0x5f'));});onConnect(_0x29c236);_0x29c236[_0x7a5d('0x5c')](_0x7a5d('0x60'));});}; \ No newline at end of file +var _0x4c84=['getChatQueues','getFaxQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','trunk:%s','campaign:%s:%s','leave','map','removeChatInteractions','MailInteractions','removeMailInteractions','emit','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','util','bluebird','../mysqldb','./environment','name','User','role','agent','type','ivr','UserProfileSection','findOne','then','VoiceQueues','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','IvrCampaigns','UserProfileResource','resourceId','where','telephone','Campaign','format','%s:queue:%s','Agents','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:inbound','voice:outbound','include','push','ChatQueue','FaxQueue','SmsQueue','WhatsappQueue','Trunk','user','VoiceQueue','FaxQueues','MailQueue','Telephones','Trunks','getVoiceQueues'];(function(_0x46b8aa,_0x246d21){var _0x5a3d61=function(_0x5c748d){while(--_0x5c748d){_0x46b8aa['push'](_0x46b8aa['shift']());}};_0x5a3d61(++_0x246d21);}(_0x4c84,0x14d));var _0x44c8=function(_0x34f8a0,_0x29483c){_0x34f8a0=_0x34f8a0-0x0;var _0x513be8=_0x4c84[_0x34f8a0];return _0x513be8;};'use strict';var _=require('lodash');var util=require(_0x44c8('0x0'));var BPromise=require(_0x44c8('0x1'));var db=require(_0x44c8('0x2'))['db'];var config=require(_0x44c8('0x3'));var queryQueues={'attributes':['id',_0x44c8('0x4')],'include':[{'as':'Agents','model':db[_0x44c8('0x5')],'attributes':['id',_0x44c8('0x4'),_0x44c8('0x6')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x44c8('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x44c8('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x44c8('0x4'),_0x44c8('0x8')],'where':{'type':_0x44c8('0x9')}};function getAssociatedResources(_0x31a428,_0xb4fe3b,_0x1aa0b1){return db[_0x44c8('0xa')][_0x44c8('0xb')]({'where':{'name':_0x31a428,'userProfileId':_0xb4fe3b},'raw':!![]})[_0x44c8('0xc')](function(_0x1f7371){if(_0x1f7371){if(_0x1f7371['autoAssociation']){switch(_0x31a428){case _0x44c8('0xd'):case _0x44c8('0xe'):case'FaxQueues':case _0x44c8('0xf'):case _0x44c8('0x10'):case _0x44c8('0x11'):case _0x44c8('0x12'):return db[_0x1aa0b1][_0x44c8('0x13')](queryQueues);case'Telephones':return db[_0x1aa0b1][_0x44c8('0x13')](queryTelephones);case'Trunks':return db[_0x1aa0b1][_0x44c8('0x13')](queryTrunks);case _0x44c8('0x14'):return db[_0x1aa0b1]['findAll'](queryCampaigns);}}else{return db[_0x44c8('0x15')][_0x44c8('0x13')]({'attributes':[_0x44c8('0x16')],'where':{'sectionId':_0x1f7371['id']},'raw':!![]})[_0x44c8('0xc')](function(_0x28f849){if(_0x28f849){var _0x1c641b={'where':{'id':_['map'](_0x28f849,_0x44c8('0x16'))},'raw':!![]};switch(_0x1aa0b1){case _0x44c8('0x5'):_0x1c641b[_0x44c8('0x17')]['role']=_0x44c8('0x18');break;case _0x44c8('0x19'):_0x1c641b[_0x44c8('0x17')][_0x44c8('0x8')]=_0x44c8('0x9');break;}return db[_0x1aa0b1][_0x44c8('0x13')](_0x1c641b);}else{return[];}});}}else{return[];}})['then'](function(_0x50a564){return _0x50a564;});}function joinOrLeaveQueues(_0x18bbf9,_0x2e5e8e,_0x2293a8,_0x19e649){_0x18bbf9[_0x2e5e8e](util[_0x44c8('0x1a')](_0x44c8('0x1b'),_0x2293a8,_0x19e649[_0x44c8('0x4')]));if(_0x19e649[_0x44c8('0x1c')]){for(var _0x3d7d0f=0x0;_0x3d7d0f<_0x19e649[_0x44c8('0x1c')][_0x44c8('0x1d')];_0x3d7d0f+=0x1){_0x18bbf9[_0x2e5e8e](util[_0x44c8('0x1a')](_0x44c8('0x1e'),_0x19e649[_0x44c8('0x1c')][_0x3d7d0f][_0x44c8('0x4')]));}}}function joinOrLeave(_0x5f10ec,_0x380859,_0x58298b){var _0x327afd;if(_0x5f10ec['handshake'][_0x44c8('0x1f')]['id']){db[_0x44c8('0x5')][_0x44c8('0x20')]({'attributes':['id',_0x44c8('0x4'),_0x44c8('0x6'),_0x44c8('0x21')],'where':{'id':_0x5f10ec[_0x44c8('0x22')]['query']['id']},'include':[{'model':db[_0x44c8('0x23')],'as':_0x44c8('0x24'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x44c8('0x25')],'as':_0x44c8('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x44c8('0x27')],'as':_0x44c8('0x28'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0x44c8('0x29'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x19df7e){if(_0x19df7e){_0x327afd=_0x19df7e;_0x5f10ec[_0x380859](util[_0x44c8('0x1a')]('user:%s',_0x19df7e['name']));var _0x4c410e=[];switch(_0x19df7e[_0x44c8('0x6')]){case _0x44c8('0x2a'):_0x5f10ec[_0x380859](_0x44c8('0x2b'));_0x5f10ec[_0x380859](_0x44c8('0x2c'));if(queryQueues['hasOwnProperty'](_0x44c8('0x2d'))){delete queryQueues['include'];}_0x4c410e[_0x44c8('0x2e')](db['VoiceQueue'][_0x44c8('0x13')](queryQueues));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x2f')][_0x44c8('0x13')](queryQueues));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x30')]['findAll'](queryQueues));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x31')]['findAll'](queryQueues));_0x4c410e[_0x44c8('0x2e')](db['MailQueue'][_0x44c8('0x13')](queryQueues));_0x4c410e[_0x44c8('0x2e')](db['OpenchannelQueue']['findAll'](queryQueues));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x32')]['findAll'](queryQueues));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x5')]['findAll'](queryTelephones));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x33')][_0x44c8('0x13')](queryTrunks));_0x4c410e['push'](db[_0x44c8('0x19')][_0x44c8('0x13')](queryCampaigns));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x5')][_0x44c8('0x13')](queryAgents));break;case _0x44c8('0x34'):_0x5f10ec[_0x380859](_0x44c8('0x2b'));_0x5f10ec[_0x380859]('voice:outbound');_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0xd'),_0x19df7e['userProfileId'],_0x44c8('0x35')));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0xe'),_0x19df7e[_0x44c8('0x21')],_0x44c8('0x2f')));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0x36'),_0x19df7e[_0x44c8('0x21')],_0x44c8('0x30')));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0xf'),_0x19df7e[_0x44c8('0x21')],_0x44c8('0x31')));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0x10'),_0x19df7e[_0x44c8('0x21')],_0x44c8('0x37')));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0x11'),_0x19df7e[_0x44c8('0x21')],'OpenchannelQueue'));_0x4c410e['push'](getAssociatedResources('WhatsappQueues',_0x19df7e[_0x44c8('0x21')],'WhatsappQueue'));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0x38'),_0x19df7e['userProfileId'],_0x44c8('0x5')));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0x39'),_0x19df7e[_0x44c8('0x21')],_0x44c8('0x33')));_0x4c410e[_0x44c8('0x2e')](getAssociatedResources(_0x44c8('0x14'),_0x19df7e[_0x44c8('0x21')],'Campaign'));_0x4c410e[_0x44c8('0x2e')](db[_0x44c8('0x5')][_0x44c8('0x13')](queryAgents));break;case _0x44c8('0x7'):_0x5f10ec[_0x380859](_0x44c8('0x2b'));_0x5f10ec[_0x380859](_0x44c8('0x2c'));_0x4c410e[_0x44c8('0x2e')](_0x19df7e[_0x44c8('0x3a')]({'attributes':['id','name']}));_0x4c410e[_0x44c8('0x2e')](_0x19df7e[_0x44c8('0x3b')]({'attributes':['id',_0x44c8('0x4')]}));_0x4c410e[_0x44c8('0x2e')](_0x19df7e[_0x44c8('0x3c')]({'attributes':['id',_0x44c8('0x4')]}));_0x4c410e[_0x44c8('0x2e')](_0x19df7e['getSmsQueues']({'attributes':['id','name']}));_0x4c410e[_0x44c8('0x2e')](_0x19df7e[_0x44c8('0x3d')]({'attributes':['id',_0x44c8('0x4')]}));_0x4c410e[_0x44c8('0x2e')](_0x19df7e[_0x44c8('0x3e')]({'attributes':['id','name']}));_0x4c410e[_0x44c8('0x2e')](_0x19df7e['getWhatsappQueues']({'attributes':['id',_0x44c8('0x4')]}));break;}return BPromise[_0x44c8('0x3f')](_0x4c410e);}})[_0x44c8('0xc')](function(_0x2a593f){if(_0x2a593f&&_0x2a593f[_0x44c8('0x1d')]){for(var _0x6d025=0x0;_0x6d025<_0x2a593f[_0x44c8('0x1d')];_0x6d025+=0x1){for(var _0x1cfd5b=0x0;_0x1cfd5b<_0x2a593f[_0x6d025][_0x44c8('0x1d')];_0x1cfd5b+=0x1){switch(_0x6d025){case 0x0:joinOrLeaveQueues(_0x5f10ec,_0x380859,_0x44c8('0x40'),_0x2a593f[_0x6d025][_0x1cfd5b]);break;case 0x1:joinOrLeaveQueues(_0x5f10ec,_0x380859,_0x44c8('0x41'),_0x2a593f[_0x6d025][_0x1cfd5b]);break;case 0x2:joinOrLeaveQueues(_0x5f10ec,_0x380859,_0x44c8('0x42'),_0x2a593f[_0x6d025][_0x1cfd5b]);break;case 0x3:joinOrLeaveQueues(_0x5f10ec,_0x380859,_0x44c8('0x43'),_0x2a593f[_0x6d025][_0x1cfd5b]);break;case 0x4:joinOrLeaveQueues(_0x5f10ec,_0x380859,_0x44c8('0x44'),_0x2a593f[_0x6d025][_0x1cfd5b]);break;case 0x5:joinOrLeaveQueues(_0x5f10ec,_0x380859,_0x44c8('0x45'),_0x2a593f[_0x6d025][_0x1cfd5b]);break;case 0x6:joinOrLeaveQueues(_0x5f10ec,_0x380859,'whatsapp',_0x2a593f[_0x6d025][_0x1cfd5b]);break;case 0x7:if(_0x327afd['role']!==_0x44c8('0x7'))_0x5f10ec[_0x380859](util[_0x44c8('0x1a')]('telephone:%s',_0x2a593f[_0x6d025][_0x1cfd5b][_0x44c8('0x4')]));break;case 0x8:if(_0x327afd[_0x44c8('0x6')]!==_0x44c8('0x7'))_0x5f10ec[_0x380859](util[_0x44c8('0x1a')](_0x44c8('0x46'),_0x2a593f[_0x6d025][_0x1cfd5b][_0x44c8('0x4')]));break;case 0x9:if(_0x327afd[_0x44c8('0x6')]!=='agent')_0x5f10ec[_0x380859](util[_0x44c8('0x1a')](_0x44c8('0x47'),_0x2a593f[_0x6d025][_0x1cfd5b][_0x44c8('0x8')],_0x2a593f[_0x6d025][_0x1cfd5b][_0x44c8('0x4')]));break;case 0xa:_0x5f10ec[_0x380859](util[_0x44c8('0x1a')]('user:%s',_0x2a593f[_0x6d025][_0x1cfd5b][_0x44c8('0x4')]));break;}}}}})['then'](function(){if(_0x380859===_0x44c8('0x48')){var _0x33455d=_[_0x44c8('0x49')](_0x327afd[_0x44c8('0x24')],'id');return _0x327afd[_0x44c8('0x4a')](_0x33455d)[_0x44c8('0xc')](function(){for(var _0x1287c6=0x0;_0x1287c6<_0x33455d[_0x44c8('0x1d')];_0x1287c6+=0x1){_0x58298b['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x33455d[_0x1287c6]),'UserId':Number(_0x327afd['id'])});}});}})[_0x44c8('0xc')](function(){if(_0x380859===_0x44c8('0x48')){var _0x4fdceb=_[_0x44c8('0x49')](_0x327afd[_0x44c8('0x4b')],'id');return _0x327afd[_0x44c8('0x4c')](_0x4fdceb)[_0x44c8('0xc')](function(){for(var _0x223a83=0x0;_0x223a83<_0x4fdceb[_0x44c8('0x1d')];_0x223a83+=0x1){_0x58298b[_0x44c8('0x4d')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x4fdceb[_0x223a83]),'UserId':Number(_0x327afd['id'])});}});}})[_0x44c8('0xc')](function(){if(_0x380859===_0x44c8('0x48')){var _0x23f7fe=_[_0x44c8('0x49')](_0x327afd[_0x44c8('0x26')],'id');return _0x327afd[_0x44c8('0x4e')](_0x23f7fe)[_0x44c8('0xc')](function(){for(var _0x278e52=0x0;_0x278e52<_0x23f7fe['length'];_0x278e52+=0x1){_0x58298b[_0x44c8('0x4d')](_0x44c8('0x4f'),{'FaxInteractionId':Number(_0x23f7fe[_0x278e52]),'UserId':Number(_0x327afd['id'])});}});}})['then'](function(){if(_0x380859==='leave'){var _0x7eeeac=_[_0x44c8('0x49')](_0x327afd['SmsInteractions'],'id');return _0x327afd[_0x44c8('0x50')](_0x7eeeac)[_0x44c8('0xc')](function(){for(var _0x47d865=0x0;_0x47d865<_0x7eeeac[_0x44c8('0x1d')];_0x47d865+=0x1){_0x58298b[_0x44c8('0x4d')](_0x44c8('0x51'),{'SmsInteractionId':Number(_0x7eeeac[_0x47d865]),'UserId':Number(_0x327afd['id'])});}});}})['then'](function(){if(_0x380859==='leave'){var _0x49adef=_[_0x44c8('0x49')](_0x327afd[_0x44c8('0x28')],'id');return _0x327afd['removeOpenchannelInteractions'](_0x49adef)[_0x44c8('0xc')](function(){for(var _0x78ee24=0x0;_0x78ee24<_0x49adef[_0x44c8('0x1d')];_0x78ee24+=0x1){_0x58298b['emit'](_0x44c8('0x52'),{'OpenchannelInteractionId':Number(_0x49adef[_0x78ee24]),'UserId':Number(_0x327afd['id'])});}});}})[_0x44c8('0xc')](function(){if(_0x380859===_0x44c8('0x48')){var _0x4eee16=_[_0x44c8('0x49')](_0x327afd[_0x44c8('0x29')],'id');return _0x327afd[_0x44c8('0x53')](_0x4eee16)['then'](function(){for(var _0x299c55=0x0;_0x299c55<_0x4eee16[_0x44c8('0x1d')];_0x299c55+=0x1){_0x58298b['emit'](_0x44c8('0x54'),{'WhatsappInteractionId':Number(_0x4eee16[_0x299c55]),'UserId':Number(_0x327afd['id'])});}});}})['catch'](function(_0x45eb19){_0x5f10ec[_0x44c8('0x55')](_0x45eb19);});}}function onDisconnect(_0x407639,_0x4381e2){joinOrLeave(_0x407639,'leave',_0x4381e2);}function onConnect(_0x3d5c48){joinOrLeave(_0x3d5c48,_0x44c8('0x56'));}exports[_0x44c8('0x57')]=function(_0x3711a4){_0x3711a4['on'](_0x44c8('0x58'),function(_0x5cba52){_0x5cba52[_0x44c8('0x59')](0x0);_0x5cba52[_0x44c8('0x5a')]=_0x5cba52[_0x44c8('0x5b')][_0x44c8('0x58')][_0x44c8('0x5c')]+':'+_0x5cba52[_0x44c8('0x5b')]['connection'][_0x44c8('0x5d')];_0x5cba52['connectedAt']=new Date();_0x5cba52[_0x44c8('0x55')]=function(_0x2292cb){console[_0x44c8('0x55')](_0x44c8('0x5e')+_0x5cba52['nsp'][_0x44c8('0x4')]+'['+_0x5cba52[_0x44c8('0x5a')]+']',_0x2292cb);};_0x5cba52['on'](_0x44c8('0x5f'),function(){onDisconnect(_0x5cba52,_0x3711a4);_0x5cba52[_0x44c8('0x55')](_0x44c8('0x60'));});onConnect(_0x5cba52);_0x5cba52[_0x44c8('0x55')](_0x44c8('0x61'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 3a3140d..cb29d9e 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 _0xd08d=['QueryTypes','SELECT','contact','UserId','interface','format','name','agent','channel','outgoingmessage','AfterCreateMessage','event','offlineMessage','get','opened','SIP/%s','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','fullname','email','length','hasOwnProperty','model','hook','callback','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','afterCreate','newinteraction','Chat','afterUpdate','ChatMessage','newmessage','ChatOfflineMessage','Sms','SmsInteraction','closedinteraction','Whatsapp','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','then','info','Trigger,\x20%s','error','code','EventManager','catch','motionChannel','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','query','Sequelize'];(function(_0x536992,_0x635302){var _0xf1cd4e=function(_0x471c6a){while(--_0x471c6a){_0x536992['push'](_0x536992['shift']());}};_0xf1cd4e(++_0x635302);}(_0xd08d,0x1d5));var _0xdd08=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0xd08d[_0xb1cf84];return _0x4bad2e;};'use strict';var util=require(_0xdd08('0x0'));var db=require(_0xdd08('0x1'))['db'];var jayson=require(_0xdd08('0x2'));var logger=require(_0xdd08('0x3'))(_0xdd08('0x4'));var client=jayson[_0xdd08('0x5')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0xdd08('0x6'),'condition':_0xdd08('0x7'),'callback':afterCreate},{'channel':_0xdd08('0x8'),'model':'ChatInteraction','event':_0xdd08('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdd08('0x8'),'model':_0xdd08('0xa'),'event':'afterCreate','condition':_0xdd08('0xb'),'callback':afterCreateMessage},{'channel':_0xdd08('0x8'),'model':_0xdd08('0xc'),'event':_0xdd08('0x6'),'condition':_0xdd08('0xb'),'callback':afterCreateOfflineMessage},{'channel':_0xdd08('0xd'),'model':_0xdd08('0xe'),'event':'afterCreate','condition':_0xdd08('0x7'),'callback':afterCreate},{'channel':_0xdd08('0xd'),'model':_0xdd08('0xe'),'event':'afterUpdate','condition':_0xdd08('0xf'),'callback':afterUpdate},{'channel':_0xdd08('0xd'),'model':'SmsMessage','event':_0xdd08('0x6'),'condition':_0xdd08('0xb'),'callback':afterCreateMessage},{'channel':_0xdd08('0x10'),'model':'WhatsappInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xdd08('0x10'),'model':_0xdd08('0x11'),'event':_0xdd08('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xdd08('0x10'),'model':'WhatsappMessage','event':_0xdd08('0x6'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xdd08('0x12'),'model':_0xdd08('0x13'),'event':_0xdd08('0x6'),'condition':_0xdd08('0x7'),'callback':afterCreate},{'channel':_0xdd08('0x12'),'model':_0xdd08('0x13'),'event':_0xdd08('0x9'),'condition':_0xdd08('0xf'),'callback':afterUpdate},{'channel':_0xdd08('0x12'),'model':_0xdd08('0x14'),'event':_0xdd08('0x6'),'condition':_0xdd08('0xb'),'callback':afterCreateMessage},{'channel':_0xdd08('0x15'),'model':_0xdd08('0x16'),'event':_0xdd08('0x6'),'condition':_0xdd08('0x7'),'callback':afterCreate},{'channel':'Mail','model':_0xdd08('0x16'),'event':_0xdd08('0x9'),'condition':_0xdd08('0xf'),'callback':afterUpdate},{'channel':_0xdd08('0x15'),'model':_0xdd08('0x17'),'event':_0xdd08('0x6'),'condition':_0xdd08('0xb'),'callback':afterCreateMessage},{'channel':_0xdd08('0x18'),'model':_0xdd08('0x19'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xdd08('0x18'),'model':_0xdd08('0x19'),'event':'afterUpdate','condition':_0xdd08('0xf'),'callback':afterUpdate},{'channel':'Openchannel','model':_0xdd08('0x1a'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage}];function request(_0x25f7f5){return client['request']('EventManager',_0x25f7f5)[_0xdd08('0x1b')](function(_0x2e46c8){logger[_0xdd08('0x1c')](_0xdd08('0x1d'),'EventManager',_0x2e46c8);if(_0x2e46c8['error']){if(_0x2e46c8[_0xdd08('0x1e')][_0xdd08('0x1f')]===0x1f4){logger[_0xdd08('0x1e')](_0xdd08('0x1d'),_0xdd08('0x20'),_0x2e46c8[_0xdd08('0x1e')]);}}})[_0xdd08('0x21')](function(_0x47649d){logger[_0xdd08('0x1e')]('Trigger,\x20%s',_0xdd08('0x20'),_0x47649d);});}function afterCreateMessage(_0x5bf5a7){return function(_0x35d84a){_0x35d84a=_0x35d84a['get']({'plain':!![]});_0x35d84a['channel']=_0x5bf5a7;_0x35d84a[_0xdd08('0x22')]=_0x5bf5a7;_0x35d84a['event']=_0x35d84a['direction'];Promise[_0xdd08('0x23')]()[_0xdd08('0x1b')](function(){if(typeof _0x35d84a[_0xdd08('0x24')]===_0xdd08('0x25'))return null;var _0x179f20=_0xdd08('0x26')+_0x35d84a[_0xdd08('0x24')];return db[_0xdd08('0x27')][_0xdd08('0x28')](_0x179f20,{'type':db[_0xdd08('0x29')][_0xdd08('0x2a')][_0xdd08('0x2b')],'raw':!![]});})[_0xdd08('0x1b')](function(_0xf57a84){if(_0xf57a84){_0x35d84a[_0xdd08('0x2c')]=_0xf57a84[0x0];}if(typeof _0x35d84a[_0xdd08('0x2d')]===_0xdd08('0x25'))return;return getAgent(_0x35d84a[_0xdd08('0x2d')]);})[_0xdd08('0x1b')](function(_0x49dea0){if(_0x49dea0){_0x35d84a[_0xdd08('0x2e')]=util[_0xdd08('0x2f')]('SIP/%s',_0x49dea0[_0xdd08('0x30')]);_0x35d84a[_0xdd08('0x31')]=_0x49dea0;_0x35d84a[_0xdd08('0x32')]=_0x5bf5a7;return request({'event':'incomingmessage','message':_0x35d84a});}else{return request({'event':_0xdd08('0x33'),'message':_0x35d84a});}})['catch'](function(_0x51b8c9){logger[_0xdd08('0x1e')](_0xdd08('0x1d'),_0xdd08('0x34'),_0x51b8c9);});};}function afterCreateOfflineMessage(_0x44917d){return function(_0x560ced){_0x560ced=_0x560ced['get']({'plain':!![]});_0x560ced['channel']=_0x44917d;_0x560ced[_0xdd08('0x22')]=_0x44917d;_0x560ced[_0xdd08('0x35')]=_0xdd08('0x36');return request({'event':_0x560ced[_0xdd08('0x35')],'message':_0x560ced});};}function afterCreate(_0x3a3feb,_0x3a0d75){return function(_0x2d1681){_0x2d1681=_0x2d1681[_0xdd08('0x37')]({'plain':!![]});_0x2d1681['channel']=_0x3a3feb;_0x2d1681[_0xdd08('0x22')]=_0x3a3feb;_0x2d1681[_0xdd08('0x35')]=_0xdd08('0x38');Promise[_0xdd08('0x23')]()[_0xdd08('0x1b')](function(){var _0x392afa=_0xdd08('0x26')+_0x2d1681[_0xdd08('0x24')];return db[_0xdd08('0x27')][_0xdd08('0x28')](_0x392afa,{'type':db[_0xdd08('0x29')][_0xdd08('0x2a')]['SELECT'],'raw':!![]});})[_0xdd08('0x1b')](function(_0x15eaa9){if(_0x15eaa9){_0x2d1681[_0xdd08('0x2c')]=_0x15eaa9[0x0];}if(typeof _0x2d1681[_0xdd08('0x2d')]===_0xdd08('0x25'))return;return getAgent(_0x2d1681[_0xdd08('0x2d')]);})['then'](function(_0x3cff0d){if(_0x3cff0d){_0x2d1681['interface']=util[_0xdd08('0x2f')](_0xdd08('0x39'),_0x3cff0d[_0xdd08('0x30')]);_0x2d1681['agent']=_0x3cff0d;}return request({'event':_0x3a0d75,'message':_0x2d1681});})[_0xdd08('0x21')](function(_0x1b03e9){logger[_0xdd08('0x1e')](_0xdd08('0x1d'),_0xdd08('0x3a'),_0x1b03e9);});};}function afterUpdate(_0x4f6db5){return function(_0x1db824){var _0x21f878=_0x1db824[_0xdd08('0x3b')](_0xdd08('0x3c'))&&_0x1db824[_0xdd08('0x3c')];var _0x30d29b=_0x1db824['changed'](_0xdd08('0x3d'));if(_0x21f878||_0x30d29b){var _0x5b8e2a=_0x21f878?'closedinteraction':_0xdd08('0x3d');var _0x457405=_0x1db824[_0xdd08('0x37')]({'plain':!![]});_0x457405[_0xdd08('0x32')]=_0x4f6db5;_0x457405[_0xdd08('0x22')]=_0x4f6db5;_0x457405[_0xdd08('0x35')]=_0x21f878?_0xdd08('0x3c'):_0xdd08('0x3d');var _0x57b1cd=_0xdd08('0x26')+_0x457405[_0xdd08('0x24')];return db[_0xdd08('0x27')]['query'](_0x57b1cd,{'type':db[_0xdd08('0x29')]['QueryTypes'][_0xdd08('0x2b')],'raw':!![]})[_0xdd08('0x1b')](function(_0x24fd92){if(_0x24fd92){_0x457405[_0xdd08('0x2c')]=_0x24fd92[0x0];}if(typeof _0x457405['UserId']==='undefined')return;return getAgent(_0x457405[_0xdd08('0x2d')]);})[_0xdd08('0x1b')](function(_0x19dcf3){if(_0x19dcf3){_0x457405['interface']=util[_0xdd08('0x2f')](_0xdd08('0x39'),_0x19dcf3[_0xdd08('0x30')]);_0x457405[_0xdd08('0x31')]=_0x19dcf3;}return request({'event':_0x5b8e2a,'message':_0x457405});})[_0xdd08('0x21')](function(_0x6f7d66){logger['error'](_0xdd08('0x1d'),_0xdd08('0x3e'),_0x6f7d66);});}};}function getAgent(_0x374dbe){return db[_0xdd08('0x3f')][_0xdd08('0x40')]({'where':{'id':_0x374dbe},'attributes':['id','name',_0xdd08('0x41'),_0xdd08('0x42'),'internal'],'raw':!![]})[_0xdd08('0x1b')](function(_0x48c82e){return _0x48c82e;});}exports['default']=function(){for(var _0x556210=0x0;_0x556210=_0x1b22a8[_0x8dfb('0x14')]){throw Error(_0x8dfb('0x15'));}_0x7fbe7(_0x309fa9);})[_0x8dfb('0x16')](function(_0x269aaf){_0x339dd9(_0x269aaf);});});}; \ No newline at end of file +var _0xd10d=['role','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','bluebird','../mysqldb','voice','mail','chat','whatsapp','openchannel','getChannels','isValidChannel','clearBlockUser','isUndefined','updateAttributes','getLicense'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xd10d,0x10b));var _0xdd10=function(_0x305117,_0x289f1a){_0x305117=_0x305117-0x0;var _0x184cb7=_0xd10d[_0x305117];return _0x184cb7;};'use strict';var _=require('lodash');var BPromise=require(_0xdd10('0x0'));var db=require(_0xdd10('0x1'))['db'];var util=require('./license/util');var channels=[_0xdd10('0x2'),_0xdd10('0x3'),_0xdd10('0x4'),'fax','sms',_0xdd10('0x5'),_0xdd10('0x6')];exports[_0xdd10('0x7')]=function(){return channels;};exports[_0xdd10('0x8')]=function(_0x49e70a){_0x49e70a=_0x49e70a['toLowerCase']();return _['includes'](channels,_0x49e70a);};exports[_0xdd10('0x9')]=function(_0x30885,_0x58094d,_0x1b4e40,_0x1c376f){var _0x2f2401={'loginAttempts':_0x58094d,'blocked':_0x1b4e40};if(!_[_0xdd10('0xa')](_0x1c376f)){_0x2f2401['blockedAt']=_0x1c376f;}return _0x30885[_0xdd10('0xb')](_0x2f2401);};exports[_0xdd10('0xc')]=function(_0x41521f){return new BPromise(function(_0x245f60,_0x50be56){var _0x33d041=0x0;if(_0x41521f[_0xdd10('0xd')]!=='agent'){_0x245f60(_0x41521f);}db[_0xdd10('0xe')][_0xdd10('0xf')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x41521f['id']}}})[_0xdd10('0x10')](function(_0x360b88){_0x33d041=_0x360b88;return util[_0xdd10('0xc')]();})[_0xdd10('0x10')](function(_0xa59517){if(_0xa59517&&_0xa59517[_0xdd10('0x11')]&&_0x33d041>=_0xa59517[_0xdd10('0x11')]){throw Error(_0xdd10('0x12'));}_0x245f60(_0x41521f);})[_0xdd10('0x13')](function(_0x5c4a10){_0x50be56(_0x5c4a10);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 1d9a91c..59c2e6e 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4274=['Not\x20Found','Message\x20sent\x20outside\x20a\x20valid\x20interval','Out\x20Of\x20Interval','code','details','OutOfInterval','Conflict','error','stack','statusMessage','status','send','exports','util','api','message','Internal\x20Server\x20Error','name','inherits','Bad\x20Request','Forbidden','Entity\x20not\x20found'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4274,0xe9));var _0x4427=function(_0xa9d560,_0x2f615e){_0xa9d560=_0xa9d560-0x0;var _0x48d8c2=_0x4274[_0xa9d560];return _0x48d8c2;};'use strict';var util=require(_0x4427('0x0'));var logger=require('../config/logger')(_0x4427('0x1'));var APIError=function(_0x427d4e,_0x45bc4b){this[_0x4427('0x2')]=_0x427d4e||_0x4427('0x3');this[_0x4427('0x4')]=_0x45bc4b||'Error';util[_0x4427('0x5')](APIError,Error);};var APIBadRequestError=function(_0x240351){this[_0x4427('0x2')]=_0x240351||_0x4427('0x6');this[_0x4427('0x4')]=_0x4427('0x6');util[_0x4427('0x5')](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x24aac8){this[_0x4427('0x2')]=_0x24aac8||_0x4427('0x7');this[_0x4427('0x4')]=_0x4427('0x7');util[_0x4427('0x5')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x213e7c){this[_0x4427('0x2')]=_0x213e7c||_0x4427('0x8');this[_0x4427('0x4')]=_0x4427('0x9');util[_0x4427('0x5')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x19e2f6){this['message']=_0x19e2f6||_0x4427('0xa');this[_0x4427('0x4')]=_0x4427('0xb');this[_0x4427('0xc')]=0x193;this[_0x4427('0xd')]={'type':_0x4427('0xe')};util[_0x4427('0x5')](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x3fc0c5){this['message']=_0x3fc0c5||'Resource\x20Conflict';this[_0x4427('0x4')]=_0x4427('0xf');util['inherits'](APIBadRequestError,APIError);};function getStatusCode(_0x3de919){switch(_0x3de919){case _0x4427('0x6'):return 0x190;case'Forbidden',_0x4427('0xb'):return 0x193;case _0x4427('0x9'):return 0x194;case'Conflict':return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x3422b8){if(_0x3422b8==='Out\x20Of\x20Interval')return _0x3422b8;return null;}function handleError(_0x762728){return function(_0xd26701){logger[_0x4427('0x10')](_0xd26701[_0x4427('0x11')]);var _0x13a576=getStatusCode(_0xd26701['name']);var _0x3e193f=getCustomStatusMessage(_0xd26701['name']);if(_0xd26701[_0x4427('0x4')]){delete _0xd26701[_0x4427('0x4')];}if(_0x3e193f){_0x762728[_0x4427('0x12')]=_0x3e193f;}return _0x762728[_0x4427('0x13')](_0x13a576)[_0x4427('0x14')](_0xd26701);};}module[_0x4427('0x15')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file +var _0xa77f=['Not\x20Found','Out\x20Of\x20Interval','OutOfInterval','Conflict','error','statusMessage','exports','../config/logger','api','message','Internal\x20Server\x20Error','Error','Bad\x20Request','name','Forbidden','inherits','Entity\x20not\x20found'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa77f,0x106));var _0xfa77=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xa77f[_0xa464c9];return _0x3d73c4;};'use strict';var util=require('util');var logger=require(_0xfa77('0x0'))(_0xfa77('0x1'));var APIError=function(_0x3c02f7,_0x5d57ff){this[_0xfa77('0x2')]=_0x3c02f7||_0xfa77('0x3');this['name']=_0x5d57ff||_0xfa77('0x4');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x59a1e3){this[_0xfa77('0x2')]=_0x59a1e3||_0xfa77('0x5');this[_0xfa77('0x6')]=_0xfa77('0x5');util['inherits'](APIBadRequestError,APIError);};var APIForbiddenError=function(_0x1a97ea){this[_0xfa77('0x2')]=_0x1a97ea||_0xfa77('0x7');this[_0xfa77('0x6')]='Forbidden';util[_0xfa77('0x8')](APIForbiddenError,APIError);};var APINotFoundError=function(_0x553b71){this[_0xfa77('0x2')]=_0x553b71||_0xfa77('0x9');this[_0xfa77('0x6')]=_0xfa77('0xa');util[_0xfa77('0x8')](APINotFoundError,APIError);};var APIOutOfIntervalError=function(_0x309698){this[_0xfa77('0x2')]=_0x309698||'Message\x20sent\x20outside\x20a\x20valid\x20interval';this[_0xfa77('0x6')]=_0xfa77('0xb');this['code']=0x193;this['details']={'type':_0xfa77('0xc')};util['inherits'](APIOutOfIntervalError,APIError);};var APIConflictError=function(_0x56bd9e){this[_0xfa77('0x2')]=_0x56bd9e||'Resource\x20Conflict';this['name']=_0xfa77('0xd');util[_0xfa77('0x8')](APIBadRequestError,APIError);};function getStatusCode(_0xf5b97a){switch(_0xf5b97a){case _0xfa77('0x5'):return 0x190;case'Forbidden',_0xfa77('0xb'):return 0x193;case _0xfa77('0xa'):return 0x194;case _0xfa77('0xd'):return 0x199;default:return 0x1f4;}}function getCustomStatusMessage(_0x4f7356){if(_0x4f7356==='Out\x20Of\x20Interval')return _0x4f7356;return null;}function handleError(_0x115206){return function(_0x3fb737){logger[_0xfa77('0xe')](_0x3fb737['stack']);var _0x3753ce=getStatusCode(_0x3fb737[_0xfa77('0x6')]);var _0x17923c=getCustomStatusMessage(_0x3fb737[_0xfa77('0x6')]);if(_0x3fb737[_0xfa77('0x6')]){delete _0x3fb737[_0xfa77('0x6')];}if(_0x17923c){_0x115206[_0xfa77('0xf')]=_0x17923c;}return _0x115206['status'](_0x3753ce)['send'](_0x3fb737);};}module[_0xfa77('0x10')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APIForbiddenError':APIForbiddenError,'APINotFoundError':APINotFoundError,'APIOutOfIntervalError':APIOutOfIntervalError,'APIConflict':APIConflictError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 30e7eca..40a1ed1 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf3=['status','render','send','exports'];(function(_0x2d7d2b,_0x208ac6){var _0x4491a0=function(_0x1632d3){while(--_0x1632d3){_0x2d7d2b['push'](_0x2d7d2b['shift']());}};_0x4491a0(++_0x208ac6);}(_0xbaf3,0x1df));var _0x3baf=function(_0x48910d,_0xe8d0e1){_0x48910d=_0x48910d-0x0;var _0x1b4c22=_0xbaf3[_0x48910d];return _0x1b4c22;};'use strict';module[_0x3baf('0x0')][0x194]=function pageNotFound(_0x41666e,_0x439648){var _0x1baf7f='404';var _0x23c030=0x194;var _0x2168db={'status':_0x23c030};_0x439648[_0x3baf('0x1')](_0x2168db['status']);_0x439648[_0x3baf('0x2')](_0x1baf7f,{},function(_0x331ece,_0x228d33){if(_0x331ece){return _0x439648[_0x3baf('0x1')](_0x2168db[_0x3baf('0x1')])['json'](_0x2168db);}_0x439648[_0x3baf('0x3')](_0x228d33);});}; \ No newline at end of file +var _0xfb71=['render','json','send','exports','404','status'];(function(_0x46afc8,_0x833bc1){var _0x1dc057=function(_0x3109e7){while(--_0x3109e7){_0x46afc8['push'](_0x46afc8['shift']());}};_0x1dc057(++_0x833bc1);}(_0xfb71,0x1ef));var _0x1fb7=function(_0x45a289,_0x3cba96){_0x45a289=_0x45a289-0x0;var _0x126361=_0xfb71[_0x45a289];return _0x126361;};'use strict';module[_0x1fb7('0x0')][0x194]=function pageNotFound(_0x413c41,_0x1affc7){var _0x6e642c=_0x1fb7('0x1');var _0x5077d8=0x194;var _0x58b7c1={'status':_0x5077d8};_0x1affc7[_0x1fb7('0x2')](_0x58b7c1[_0x1fb7('0x2')]);_0x1affc7[_0x1fb7('0x3')](_0x6e642c,{},function(_0x4b9066,_0x45ed1c){if(_0x4b9066){return _0x1affc7[_0x1fb7('0x2')](_0x58b7c1[_0x1fb7('0x2')])[_0x1fb7('0x4')](_0x58b7c1);}_0x1affc7[_0x1fb7('0x5')](_0x45ed1c);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 3542b09..9cb0038 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb5b2=['../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','hasOne','VoiceMail','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','SenderId','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueues','VoicePrefixes','UserVoicePrefix','ChatQueue','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','WhatsappQueues','ChatWebsite','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccount','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','VoiceContext','Sounds','Members','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','Agents','Teams','TeamVoiceQueue','voice_queues_has_cm_blacklists','ScreenRecording','Messages','mailboxuser','mailbox','VoiceCallReport','QueueCalls','uniqueid','Contact','ContactId','MailServerIn','CloudProviderId','Imap','Smtp','Disposition','Dispositions','MailAccountId','Answers','Interactions','MailApplication','TemplateId','mandatoryDispositionPauseId','team_has_mail_queues','MailInteractionId','Owner','Tag','mail_interaction_has_tags','Tags','Users','Attachments','Interaction','Account','ChatOfflineMessageId','restrict','TagId','List','ListId','FaxAccountId','Applications','Exntensions','fax_interaction_has_tags','ThroughTags','FaxInteractionId','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Contacts','CompanyId','Phones','cm_contact_has_tags','CmHopperAdditionalPhone','AdditionalPhones','CmHopperId','OwnerId','CampaignId','Condition','OneAll','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','Mohs','moh_has_sounds','ItemTypeId','CmContactId','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','AnalyticMetric','MetricId','SalesforceAccount','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','Configurations','SugarcrmField','int_desk_configuration_has_tags','ZohoField','ZendeskField','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowAccount','ToId','SessionId','JscriptyAnswerReport','ProjectId','MailQueues','team_has_sms_queues','team_has_openchannel_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','FaxTransferReport','FromAccount','ToAgent','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','whatsapp_interaction_has_tags','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','exports','../config/environment','sequelize','jstz','determine','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','database','username','password','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','VoiceMailMessage','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailSubstatus','MailInteraction','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','OpenchannelQueueReport','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','Automation','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','Sound','../api/sound/sound.model','../api/tag/tag.model','ContactItemType','../api/contactItemType/contactItemType.model','CmContactHasItem','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticFieldReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','Integration','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','SquareDetailsReport','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','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin'];(function(_0x2b8437,_0x5a2cae){var _0x5e508f=function(_0x521fb7){while(--_0x521fb7){_0x2b8437['push'](_0x2b8437['shift']());}};_0x5e508f(++_0x5a2cae);}(_0xb5b2,0x10f));var _0x2b5b=function(_0x3b7578,_0x2ea38c){_0x3b7578=_0x3b7578-0x0;var _0x5e1dff=_0xb5b2[_0x3b7578];return _0x5e1dff;};'use strict';var config=require(_0x2b5b('0x0'));var Sequelize=require(_0x2b5b('0x1'));var _=require('lodash');var jstz=require(_0x2b5b('0x2'));var timezone=jstz[_0x2b5b('0x3')]();config[_0x2b5b('0x1')]=_['defaultsDeep'](config[_0x2b5b('0x1')],{'database':_0x2b5b('0x4'),'username':_0x2b5b('0x5'),'password':_0x2b5b('0x6'),'options':{'host':_0x2b5b('0x7'),'port':0xcea,'dialect':_0x2b5b('0x8'),'dialectOptions':{'charset':_0x2b5b('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x2b5b('0xa'),'collate':_0x2b5b('0xb')}}});config[_0x2b5b('0xc')]=_[_0x2b5b('0xd')](config[_0x2b5b('0xc')],{'database':'motion2','username':_0x2b5b('0x5'),'password':_0x2b5b('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x2b5b('0x8'),'dialectOptions':{'charset':_0x2b5b('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':'utf8','collate':_0x2b5b('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2b5b('0x1')][_0x2b5b('0xe')],config['sequelize'][_0x2b5b('0xf')],config['sequelize'][_0x2b5b('0x10')],config[_0x2b5b('0x1')][_0x2b5b('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2b5b('0xc')][_0x2b5b('0xe')],config['sequelizeHistory'][_0x2b5b('0xf')],config['sequelizeHistory'][_0x2b5b('0x10')],config[_0x2b5b('0xc')][_0x2b5b('0x11')])};db[_0x2b5b('0x12')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x14'));db[_0x2b5b('0x15')]=db['sequelize']['import'](_0x2b5b('0x16'));db['VoiceContext']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x17'));db[_0x2b5b('0x18')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x19'));db[_0x2b5b('0x1a')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x2b5b('0x1b')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x1c'));db[_0x2b5b('0x1d')]=db[_0x2b5b('0x1')]['import']('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x1e'));db['VoiceMail']=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/voiceMail/voiceMail.model');db[_0x2b5b('0x1f')]=db[_0x2b5b('0x1')]['import']('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x20'));db[_0x2b5b('0x21')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x22'));db[_0x2b5b('0x23')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x24'));db[_0x2b5b('0x25')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0x2b5b('0x26')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x27'));db[_0x2b5b('0x28')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x29'));db[_0x2b5b('0x2a')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x2b'));db[_0x2b5b('0x2c')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x2d'));db[_0x2b5b('0x2e')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x2b5b('0x2f')]=db[_0x2b5b('0x1')]['import']('../api/userChatQueue/userChatQueue.model');db[_0x2b5b('0x30')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x31'));db['UserFaxQueue']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x32'));db[_0x2b5b('0x33')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x34'));db[_0x2b5b('0x35')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x36'));db[_0x2b5b('0x37')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x38'));db['MailServerIn']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x39'));db[_0x2b5b('0x3a')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x3b'));db['MailAccount']=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x3c'));db[_0x2b5b('0x3d')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x3e'));db[_0x2b5b('0x3f')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/mailSubstatus/mailSubstatus.model');db[_0x2b5b('0x40')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0x2b5b('0x41')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x42'));db[_0x2b5b('0x43')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x44'));db[_0x2b5b('0x45')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x46'));db[_0x2b5b('0x47')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x48'));db['FaxAccount']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x49'));db[_0x2b5b('0x4a')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/faxApplication/faxApplication.model');db[_0x2b5b('0x4b')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x4c'));db[_0x2b5b('0x4d')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x4e'));db[_0x2b5b('0x4f')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x50'));db['FaxQueueReport']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x51'));db['SmsAccount']=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/smsAccount/smsAccount.model');db[_0x2b5b('0x52')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x53'));db[_0x2b5b('0x54')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x55'));db[_0x2b5b('0x56')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x57'));db[_0x2b5b('0x58')]=db['sequelize']['import'](_0x2b5b('0x59'));db[_0x2b5b('0x5a')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x5b'));db[_0x2b5b('0x5c')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x5d'));db[_0x2b5b('0x5e')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x5f'));db[_0x2b5b('0x60')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x61'));db[_0x2b5b('0x62')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x63'));db['ChatWebsite']=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x2b5b('0x64')]=db['sequelize'][_0x2b5b('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x2b5b('0x65')]=db['sequelize'][_0x2b5b('0x13')]('../api/chatApplication/chatApplication.model');db[_0x2b5b('0x66')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x67'));db[_0x2b5b('0x68')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x69'));db[_0x2b5b('0x6a')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x6b'));db['ChatQueue']=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x6c'));db[_0x2b5b('0x6d')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x6e'));db[_0x2b5b('0x6f')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x2b5b('0x70')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x71'));db[_0x2b5b('0x72')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/cmContact/cmContact.model');db[_0x2b5b('0x73')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x74'));db[_0x2b5b('0x75')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x76'));db[_0x2b5b('0x77')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x78'));db[_0x2b5b('0x79')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x7a'));db[_0x2b5b('0x7b')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x7c'));db['CmCustomField']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x7d'));db[_0x2b5b('0x7e')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/action/action.model');db[_0x2b5b('0x7f')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/automation/automation.model');db[_0x2b5b('0x80')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x81'));db['Disposition']=db['sequelize'][_0x2b5b('0x13')]('../api/disposition/disposition.model');db['Condition']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x82'));db[_0x2b5b('0x83')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x84'));db['Pause']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x85'));db[_0x2b5b('0x86')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/cdr/cdr.model');db['VoiceQueuesLog']=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x87'));db[_0x2b5b('0x88')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/schedule/schedule.model');db[_0x2b5b('0x89')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x8a'));db['Tag']=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x8b'));db[_0x2b5b('0x8c')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x8d'));db[_0x2b5b('0x8e')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x8f'));db['CmHopperAdditionalPhone']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x90'));db[_0x2b5b('0x91')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x92'));db[_0x2b5b('0x93')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x94'));db[_0x2b5b('0x95')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/variable/variable.model');db['Integration']=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x96'));db[_0x2b5b('0x97')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/integrationReport/integrationReport.model');db[_0x2b5b('0x98')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x2b5b('0x99')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x9a'));db['AnalyticExtractedReport']=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x9b'));db['AnalyticMetric']=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/analyticMetric/analyticMetric.model');db[_0x2b5b('0x9c')]=db[_0x2b5b('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db['AnalyticTreeReport']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x9d'));db['SalesforceAccount']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x9e'));db[_0x2b5b('0x9f')]=db[_0x2b5b('0x1')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0x2b5b('0xa0')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xa1'));db[_0x2b5b('0xa2')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0xa3'));db[_0x2b5b('0xa4')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0xa5'));db['SugarcrmField']=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0xa6'));db[_0x2b5b('0xa7')]=db['sequelize']['import'](_0x2b5b('0xa8'));db[_0x2b5b('0xa9')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xaa'));db[_0x2b5b('0xab')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xac'));db[_0x2b5b('0xad')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xae'));db[_0x2b5b('0xaf')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xb0'));db['ZohoField']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xb1'));db[_0x2b5b('0xb2')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xb3'));db[_0x2b5b('0xb4')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xb5'));db['ZendeskField']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xb6'));db['FreshdeskAccount']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xb7'));db[_0x2b5b('0xb8')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xb9'));db[_0x2b5b('0xba')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xbb'));db[_0x2b5b('0xbc')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xbd'));db[_0x2b5b('0xbe')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xbf'));db[_0x2b5b('0xc0')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xc1'));db['ServicenowAccount']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xc2'));db[_0x2b5b('0xc3')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x2b5b('0xc4')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0xc5'));db[_0x2b5b('0xc6')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0xc7'));db[_0x2b5b('0xc8')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xc9'));db[_0x2b5b('0xca')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xcb'));db[_0x2b5b('0xcc')]=db[_0x2b5b('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0x2b5b('0xcd')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xce'));db[_0x2b5b('0xcf')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x2b5b('0xd0')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x96'));db[_0x2b5b('0xd1')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xd2'));db[_0x2b5b('0xd3')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xd4'));db[_0x2b5b('0xd5')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0xd6'));db['JscriptyAnswerReport']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xd7'));db[_0x2b5b('0xd8')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xd9'));db[_0x2b5b('0xda')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xdb'));db[_0x2b5b('0xdc')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xdd'));db['SquareReport']=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xde'));db[_0x2b5b('0xdf')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0x2b5b('0xe0')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xe1'));db[_0x2b5b('0xe2')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xe3'));db[_0x2b5b('0xe4')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xe5'));db[_0x2b5b('0xe6')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xe7'));db[_0x2b5b('0xe8')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xe9'));db[_0x2b5b('0xea')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xeb'));db[_0x2b5b('0xec')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/team/team.model');db[_0x2b5b('0xed')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/license/license.model');db[_0x2b5b('0xee')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xef'));db[_0x2b5b('0xf0')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xf1'));db[_0x2b5b('0xf2')]=db['sequelize']['import'](_0x2b5b('0xf3'));db[_0x2b5b('0xf4')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xf5'));db[_0x2b5b('0xf6')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xf7'));db[_0x2b5b('0xf8')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0xf9'));db['FaxTransferReport']=db['sequelize']['import']('../api/faxTransferReport/faxTransferReport.model');db[_0x2b5b('0xfa')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xfb'));db[_0x2b5b('0xfc')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0xfd'));db[_0x2b5b('0xfe')]=db['sequelize'][_0x2b5b('0x13')]('../api/cmList/cmList.model');db[_0x2b5b('0xff')]=db[_0x2b5b('0x1')]['import']('../api/voicePrefix/voicePrefix.model');db[_0x2b5b('0x100')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x101'));db[_0x2b5b('0x102')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x103'));db[_0x2b5b('0x104')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/userProfileResource/userProfileResource.model');db[_0x2b5b('0x105')]=db['sequelize'][_0x2b5b('0x13')](_0x2b5b('0x106'));db['WhatsappAccount']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x107'));db[_0x2b5b('0x108')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/whatsappApplication/whatsappApplication.model');db[_0x2b5b('0x109')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x10a'));db[_0x2b5b('0x10b')]=db[_0x2b5b('0x1')]['import'](_0x2b5b('0x10c'));db[_0x2b5b('0x10d')]=db['sequelize']['import']('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x2b5b('0x10e')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x10f'));db[_0x2b5b('0x110')]=db['sequelize']['import'](_0x2b5b('0x111'));db[_0x2b5b('0x112')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x113'));db['TeamVoiceQueue']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x114'));db[_0x2b5b('0x115')]=db[_0x2b5b('0x1')]['import']('../api/teamVoicePrefix/teamVoicePrefix.model');db['UserVoicePrefix']=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x116'));db[_0x2b5b('0x117')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')]('../api/user-setting/user-setting.model');db[_0x2b5b('0x118')]=db[_0x2b5b('0x1')][_0x2b5b('0x13')](_0x2b5b('0x119'));db[_0x2b5b('0x12')][_0x2b5b('0x11a')](db['VoiceMail'],{'as':_0x2b5b('0x11b'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')][_0x2b5b('0x11a')](db[_0x2b5b('0x117')],{'as':_0x2b5b('0x11e'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x11d')});db['User'][_0x2b5b('0x11f')](db[_0x2b5b('0x1d')],{'as':_0x2b5b('0x120'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db[_0x2b5b('0x2c')],{'as':_0x2b5b('0x121'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db[_0x2b5b('0x18')],{'as':_0x2b5b('0x122'),'onDelete':_0x2b5b('0x11c'),'hooks':!![]});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db[_0x2b5b('0x77')],{'as':_0x2b5b('0x123'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db[_0x2b5b('0x79')],{'as':_0x2b5b('0x124'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db[_0x2b5b('0x5e')],{'as':_0x2b5b('0x125'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')]['hasMany'](db[_0x2b5b('0x66')],{'as':_0x2b5b('0x126'),'foreignKey':'UserId'});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db['SmsInteraction'],{'as':_0x2b5b('0x127'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db[_0x2b5b('0x4b')],{'as':_0x2b5b('0x128'),'foreignKey':'UserId'});db['User'][_0x2b5b('0x11f')](db[_0x2b5b('0x40')],{'as':_0x2b5b('0x129'),'foreignKey':_0x2b5b('0x11d')});db['User'][_0x2b5b('0x11f')](db[_0x2b5b('0x109')],{'as':_0x2b5b('0x12a'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db[_0x2b5b('0x105')],{'as':'UserNotifications','foreignKey':_0x2b5b('0x12b')});db[_0x2b5b('0x12')][_0x2b5b('0x11f')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x2b5b('0x11d'),'onDelete':'SET\x20NULL'});db['User'][_0x2b5b('0x12c')](db['UserProfile'],{'as':_0x2b5b('0x100'),'foreignKey':_0x2b5b('0x12d')});db[_0x2b5b('0x12')]['belongsToMany'](db[_0x2b5b('0x6d')],{'as':_0x2b5b('0x12e'),'through':_0x2b5b('0x12f')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x72')],{'as':'Contacts','through':_0x2b5b('0x131')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db['CmList'],{'as':_0x2b5b('0x132'),'through':_0x2b5b('0x133')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0xec')],{'through':_0x2b5b('0x134')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db['MailInteraction'],{'as':_0x2b5b('0x129'),'through':_0x2b5b('0x135')});db['User'][_0x2b5b('0x130')](db['ChatInteraction'],{'as':_0x2b5b('0x126'),'through':_0x2b5b('0x136')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x4b')],{'as':_0x2b5b('0x128'),'through':'user_has_fax_interactions'});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x54')],{'as':'SmsInteractions','through':_0x2b5b('0x137')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x5e')],{'as':_0x2b5b('0x125'),'through':_0x2b5b('0x138')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db['WhatsappInteraction'],{'as':_0x2b5b('0x12a'),'through':_0x2b5b('0x139')});db[_0x2b5b('0x12')]['belongsToMany'](db['VoiceQueue'],{'as':_0x2b5b('0x13a'),'through':_0x2b5b('0x2e'),'required':![]});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0xff')],{'as':_0x2b5b('0x13b'),'through':_0x2b5b('0x13c'),'required':![]});db[_0x2b5b('0x12')]['belongsToMany'](db[_0x2b5b('0x3d')],{'as':'MailQueues','through':_0x2b5b('0x30'),'required':![]});db[_0x2b5b('0x12')]['belongsToMany'](db[_0x2b5b('0x13d')],{'as':_0x2b5b('0x13e'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db['FaxQueue'],{'as':_0x2b5b('0x13f'),'through':_0x2b5b('0x140'),'required':![]});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x58')],{'as':_0x2b5b('0x141'),'through':_0x2b5b('0x33'),'required':![]});db['User'][_0x2b5b('0x130')](db[_0x2b5b('0x62')],{'as':'OpenchannelQueues','through':_0x2b5b('0x35'),'required':![]});db[_0x2b5b('0x12')]['belongsToMany'](db[_0x2b5b('0x110')],{'as':_0x2b5b('0x142'),'through':_0x2b5b('0x37'),'required':![]});db['User'][_0x2b5b('0x130')](db['CmList'],{'through':_0x2b5b('0x133')});db['User']['belongsToMany'](db[_0x2b5b('0x143')],{'as':_0x2b5b('0x144'),'through':_0x2b5b('0x145')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x146')],{'as':_0x2b5b('0x147'),'through':_0x2b5b('0x148')});db[_0x2b5b('0x12')]['belongsToMany'](db[_0x2b5b('0x149')],{'as':'MailAccounts','through':_0x2b5b('0x14a')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x5a')],{'as':_0x2b5b('0x14b'),'through':_0x2b5b('0x14c')});db[_0x2b5b('0x12')][_0x2b5b('0x130')](db[_0x2b5b('0x14d')],{'as':_0x2b5b('0x14e'),'through':_0x2b5b('0x14f')});db['User'][_0x2b5b('0x130')](db[_0x2b5b('0x150')],{'as':_0x2b5b('0x151'),'through':_0x2b5b('0x152')});db[_0x2b5b('0x15')][_0x2b5b('0x11f')](db[_0x2b5b('0x18')],{'as':_0x2b5b('0x153'),'onDelete':_0x2b5b('0x11c'),'foreignKey':'ChanSpyId'});db[_0x2b5b('0x154')][_0x2b5b('0x11f')](db['VoiceExtension'],{'onDelete':'cascade'});db[_0x2b5b('0x18')][_0x2b5b('0x11f')](db[_0x2b5b('0x18')],{'as':'Applications','onDelete':_0x2b5b('0x11c')});db['VoiceMusicOnHold'][_0x2b5b('0x130')](db[_0x2b5b('0x89')],{'as':_0x2b5b('0x155'),'through':'moh_has_sounds'});db[_0x2b5b('0x1b')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0x2b5b('0x156'),'foreignKey':_0x2b5b('0x157')});db['VoiceQueue'][_0x2b5b('0x11f')](db[_0x2b5b('0x73')],{'as':_0x2b5b('0x158'),'foreignKey':_0x2b5b('0x157')});db[_0x2b5b('0x1b')][_0x2b5b('0x11f')](db[_0x2b5b('0x77')],{'as':_0x2b5b('0x123'),'foreignKey':_0x2b5b('0x157')});db[_0x2b5b('0x1b')][_0x2b5b('0x11f')](db[_0x2b5b('0x79')],{'as':_0x2b5b('0x159'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x2b5b('0x7b')],{'as':_0x2b5b('0x7b'),'foreignKey':_0x2b5b('0x157')});db[_0x2b5b('0x1b')][_0x2b5b('0x11f')](db['CmHopperBlack'],{'as':_0x2b5b('0x15a'),'foreignKey':_0x2b5b('0x157')});db[_0x2b5b('0x1b')][_0x2b5b('0x11f')](db[_0x2b5b('0xda')],{'as':_0x2b5b('0x15b'),'foreignKey':_0x2b5b('0x157')});db['VoiceQueue'][_0x2b5b('0x12c')](db['Trunk'],{'as':_0x2b5b('0x28'),'foreignKey':_0x2b5b('0x15c')});db[_0x2b5b('0x1b')]['belongsTo'](db[_0x2b5b('0x28')],{'as':_0x2b5b('0x15d'),'foreignKey':_0x2b5b('0x15e')});db[_0x2b5b('0x1b')][_0x2b5b('0x12c')](db[_0x2b5b('0x83')],{'as':_0x2b5b('0x83'),'foreignKey':_0x2b5b('0x15f')});db[_0x2b5b('0x1b')][_0x2b5b('0x12c')](db[_0x2b5b('0x160')],{'as':_0x2b5b('0x161'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2b5b('0x1b')][_0x2b5b('0x130')](db[_0x2b5b('0xfe')],{'as':_0x2b5b('0x132'),'through':'voice_queues_has_cm_lists'});db[_0x2b5b('0x1b')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':_0x2b5b('0x2e')});db['VoiceQueue'][_0x2b5b('0x130')](db['Team'],{'as':_0x2b5b('0x163'),'through':_0x2b5b('0x164')});db['VoiceQueue']['belongsToMany'](db[_0x2b5b('0xfe')],{'as':'BlackLists','through':_0x2b5b('0x165')});db[_0x2b5b('0x1d')][_0x2b5b('0x12c')](db['User'],{'as':_0x2b5b('0x12'),'foreignKey':'UserId'});db[_0x2b5b('0x166')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x12'),'foreignKey':_0x2b5b('0x11d')});db['VoiceMail'][_0x2b5b('0x11f')](db[_0x2b5b('0x1f')],{'as':_0x2b5b('0x167'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x168'),'sourceKey':_0x2b5b('0x169')});db['VoiceMailMessage'][_0x2b5b('0x12c')](db[_0x2b5b('0x11b')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0x2b5b('0x16a')]['hasMany'](db[_0x2b5b('0x25')],{'as':_0x2b5b('0x16b'),'foreignKey':_0x2b5b('0x16c'),'constraints':![]});db[_0x2b5b('0x16a')][_0x2b5b('0x11f')](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x2b5b('0x16c'),'constraints':![]});db[_0x2b5b('0x16a')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x12'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x16a')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x16f')][_0x2b5b('0x12c')](db[_0x2b5b('0x149')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x2b5b('0x16f')][_0x2b5b('0x12c')](db[_0x2b5b('0x112')],{'as':_0x2b5b('0x112'),'foreignKey':_0x2b5b('0x170'),'onDelete':'restrict'});db[_0x2b5b('0x3a')][_0x2b5b('0x12c')](db[_0x2b5b('0x149')],{'as':_0x2b5b('0x149'),'foreignKey':'MailAccountId'});db[_0x2b5b('0x3a')][_0x2b5b('0x12c')](db[_0x2b5b('0x112')],{'as':_0x2b5b('0x112'),'foreignKey':_0x2b5b('0x170'),'onDelete':'restrict'});db[_0x2b5b('0x149')][_0x2b5b('0x11a')](db[_0x2b5b('0x16f')],{'as':_0x2b5b('0x171'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x149')]['hasOne'](db[_0x2b5b('0x3a')],{'as':_0x2b5b('0x172'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x149')][_0x2b5b('0x11f')](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x175'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x149')][_0x2b5b('0x11f')](db[_0x2b5b('0x80')],{'as':_0x2b5b('0x176'),'foreignKey':_0x2b5b('0x175')});db[_0x2b5b('0x149')][_0x2b5b('0x11f')](db[_0x2b5b('0x41')],{'as':_0x2b5b('0x167'),'foreignKey':_0x2b5b('0x175')});db[_0x2b5b('0x149')][_0x2b5b('0x11f')](db[_0x2b5b('0x40')],{'as':_0x2b5b('0x177')});db['MailAccount'][_0x2b5b('0x11f')](db[_0x2b5b('0x178')],{'as':'Applications','foreignKey':_0x2b5b('0x175'),'onDelete':'cascade'});db[_0x2b5b('0x149')][_0x2b5b('0x12c')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x2b5b('0x149')][_0x2b5b('0x12c')](db[_0x2b5b('0x91')],{'as':_0x2b5b('0x91'),'foreignKey':_0x2b5b('0x179')});db[_0x2b5b('0x149')][_0x2b5b('0x12c')](db['Pause'],{'as':_0x2b5b('0x161'),'foreignKey':_0x2b5b('0x17a')});db['MailAccount']['belongsToMany'](db[_0x2b5b('0x12')],{'as':'Agents','through':_0x2b5b('0x14a')});db[_0x2b5b('0x3d')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':'UserMailQueue'});db[_0x2b5b('0x3d')][_0x2b5b('0x130')](db[_0x2b5b('0xec')],{'through':_0x2b5b('0x17b'),'as':'Teams'});db[_0x2b5b('0x40')][_0x2b5b('0x11f')](db[_0x2b5b('0x41')],{'as':'Messages','onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x17c')});db[_0x2b5b('0x40')][_0x2b5b('0x12c')](db[_0x2b5b('0x149')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x2b5b('0x40')][_0x2b5b('0x12c')](db['CmContact'],{'as':_0x2b5b('0x16d'),'foreignKey':'ContactId'});db['MailInteraction'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x17d'),'foreignKey':'UserId'});db[_0x2b5b('0x40')]['belongsToMany'](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x17f'),'as':_0x2b5b('0x180')});db[_0x2b5b('0x40')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x17f'),'as':'ThroughTags'});db[_0x2b5b('0x40')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x181'),'through':'user_has_mail_interactions','foreignKey':_0x2b5b('0x17c')});db[_0x2b5b('0x41')][_0x2b5b('0x11f')](db[_0x2b5b('0xf2')],{'as':_0x2b5b('0x182'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x41')][_0x2b5b('0x12c')](db['User'],{'as':_0x2b5b('0x12')});db[_0x2b5b('0x41')]['belongsTo'](db[_0x2b5b('0x72')],{'onDelete':_0x2b5b('0x11c'),'as':_0x2b5b('0x16d')});db['MailMessage'][_0x2b5b('0x12c')](db['MailInteraction'],{'as':_0x2b5b('0x183'),'foreignKey':'MailInteractionId'});db[_0x2b5b('0x41')][_0x2b5b('0x12c')](db[_0x2b5b('0x149')],{'as':_0x2b5b('0x184'),'foreignKey':'MailAccountId'});db['MailMessage'][_0x2b5b('0x12c')](db[_0x2b5b('0x143')],{'as':_0x2b5b('0x143'),'foreignKey':'ChatWebsiteId'});db[_0x2b5b('0x41')][_0x2b5b('0x12c')](db['ChatOfflineMessage'],{'as':_0x2b5b('0x6a'),'foreignKey':_0x2b5b('0x185')});db['MailApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'onDelete':_0x2b5b('0x186')});db['MailApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x3d')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x178')][_0x2b5b('0x12c')](db[_0x2b5b('0x149')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x178')]['belongsTo'](db[_0x2b5b('0x83')],{'onDelete':'restrict','foreignKey':_0x2b5b('0x15f')});db['MailApplication'][_0x2b5b('0x12c')](db['Tag'],{'onDelete':_0x2b5b('0x186'),'foreignKey':_0x2b5b('0x187')});db[_0x2b5b('0x43')][_0x2b5b('0x12c')](db[_0x2b5b('0x149')],{});db[_0x2b5b('0x43')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':_0x2b5b('0x188'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x43')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2b5b('0x43')][_0x2b5b('0x12c')](db[_0x2b5b('0x40')],{});db[_0x2b5b('0x43')][_0x2b5b('0x12c')](db['MailMessage'],{});db[_0x2b5b('0x43')]['belongsTo'](db['User'],{});db[_0x2b5b('0x43')][_0x2b5b('0x12c')](db[_0x2b5b('0x3d')],{});db[_0x2b5b('0x45')][_0x2b5b('0x11f')](db[_0x2b5b('0x47')],{'as':'Items','onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x146')][_0x2b5b('0x11f')](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x18a'),'onDelete':_0x2b5b('0x11c')});db['FaxAccount']['hasMany'](db[_0x2b5b('0x80')],{'as':_0x2b5b('0x176'),'foreignKey':_0x2b5b('0x18a')});db[_0x2b5b('0x146')][_0x2b5b('0x11f')](db[_0x2b5b('0x4b')],{'as':_0x2b5b('0x177')});db[_0x2b5b('0x146')][_0x2b5b('0x11f')](db['FaxApplication'],{'as':_0x2b5b('0x18b'),'foreignKey':'FaxAccountId','onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x146')]['hasMany'](db[_0x2b5b('0x18')],{'as':_0x2b5b('0x18c'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x146')][_0x2b5b('0x11f')](db[_0x2b5b('0x4d')],{'as':_0x2b5b('0x167')});db[_0x2b5b('0x146')][_0x2b5b('0x12c')](db[_0x2b5b('0x28')],{'as':'Trunk'});db['FaxAccount']['belongsTo'](db[_0x2b5b('0xfe')],{'as':_0x2b5b('0x188'),'foreignKey':'ListId'});db['FaxAccount'][_0x2b5b('0x12c')](db[_0x2b5b('0x160')],{'as':_0x2b5b('0x161'),'foreignKey':_0x2b5b('0x17a')});db['FaxAccount'][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':_0x2b5b('0x148')});db['FaxApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'onDelete':_0x2b5b('0x186')});db['FaxApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x4f')],{'onDelete':_0x2b5b('0x186')});db['FaxApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x146')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x4a')][_0x2b5b('0x12c')](db[_0x2b5b('0x17e')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x2b5b('0x4b')][_0x2b5b('0x11f')](db['FaxMessage'],{'as':'Messages','onDelete':_0x2b5b('0x11c'),'foreignKey':'FaxInteractionId'});db[_0x2b5b('0x4b')][_0x2b5b('0x12c')](db[_0x2b5b('0x146')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x2b5b('0x4b')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x4b')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x17d'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x4b')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x18d'),'as':'Tags'});db[_0x2b5b('0x4b')]['belongsToMany'](db[_0x2b5b('0x17e')],{'through':'fax_interaction_has_tags','as':_0x2b5b('0x18e')});db['FaxInteraction'][_0x2b5b('0x130')](db['User'],{'as':_0x2b5b('0x181'),'through':'user_has_fax_interactions','foreignKey':_0x2b5b('0x18f')});db[_0x2b5b('0x4d')]['belongsTo'](db['User'],{'onDelete':_0x2b5b('0x11c'),'as':'User'});db[_0x2b5b('0x4d')][_0x2b5b('0x12c')](db[_0x2b5b('0x4b')],{'as':'Interaction','foreignKey':_0x2b5b('0x18f')});db[_0x2b5b('0x4d')]['belongsTo'](db[_0x2b5b('0x72')],{'onDelete':_0x2b5b('0x11c'),'as':_0x2b5b('0x16d')});db[_0x2b5b('0x4d')][_0x2b5b('0x12c')](db[_0x2b5b('0xf2')],{'as':_0x2b5b('0xf2'),'foreignKey':_0x2b5b('0x190')});db['FaxMessage'][_0x2b5b('0x12c')](db[_0x2b5b('0x146')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x18a')});db[_0x2b5b('0x4f')][_0x2b5b('0x130')](db['User'],{'as':_0x2b5b('0x162'),'through':_0x2b5b('0x140')});db[_0x2b5b('0x4f')]['belongsToMany'](db[_0x2b5b('0xec')],{'through':_0x2b5b('0x191'),'as':_0x2b5b('0x163')});db['FaxQueueReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x146')],{});db[_0x2b5b('0x192')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':'List','foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x192')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2b5b('0x192')][_0x2b5b('0x12c')](db[_0x2b5b('0x4b')],{});db[_0x2b5b('0x192')][_0x2b5b('0x12c')](db[_0x2b5b('0x4d')],{});db[_0x2b5b('0x192')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{});db[_0x2b5b('0x192')][_0x2b5b('0x12c')](db[_0x2b5b('0x4f')],{});db[_0x2b5b('0x14d')][_0x2b5b('0x11f')](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x193'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x14d')][_0x2b5b('0x11f')](db[_0x2b5b('0x80')],{'as':_0x2b5b('0x176'),'foreignKey':'SmsAccountId'});db[_0x2b5b('0x14d')]['hasMany'](db[_0x2b5b('0x56')],{'as':_0x2b5b('0x167'),'foreignKey':_0x2b5b('0x193')});db[_0x2b5b('0x14d')]['hasMany'](db[_0x2b5b('0x54')],{'as':_0x2b5b('0x177')});db[_0x2b5b('0x14d')]['hasMany'](db['SmsApplication'],{'as':_0x2b5b('0x18b'),'foreignKey':_0x2b5b('0x193'),'onDelete':'cascade'});db[_0x2b5b('0x14d')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':_0x2b5b('0x188'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x14d')]['belongsTo'](db[_0x2b5b('0x160')],{'as':_0x2b5b('0x161'),'foreignKey':_0x2b5b('0x17a')});db[_0x2b5b('0x14d')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x2b5b('0x14f')});db[_0x2b5b('0x52')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'onDelete':'restrict'});db[_0x2b5b('0x52')][_0x2b5b('0x12c')](db[_0x2b5b('0x58')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x52')]['belongsTo'](db[_0x2b5b('0x14d')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x52')][_0x2b5b('0x12c')](db[_0x2b5b('0x83')],{'onDelete':_0x2b5b('0x186'),'foreignKey':'IntervalId'});db[_0x2b5b('0x52')][_0x2b5b('0x12c')](db[_0x2b5b('0x17e')],{'onDelete':_0x2b5b('0x186'),'foreignKey':_0x2b5b('0x187')});db['SmsInteraction'][_0x2b5b('0x11f')](db[_0x2b5b('0x56')],{'as':_0x2b5b('0x167'),'onDelete':'cascade','foreignKey':'SmsInteractionId'});db[_0x2b5b('0x54')][_0x2b5b('0x12c')](db['SmsAccount'],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x193')});db[_0x2b5b('0x54')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':'Contact','foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x54')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x17d'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x54')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x194'),'as':_0x2b5b('0x180')});db[_0x2b5b('0x54')]['belongsToMany'](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x194'),'as':_0x2b5b('0x18e')});db[_0x2b5b('0x54')][_0x2b5b('0x130')](db['User'],{'as':_0x2b5b('0x181'),'through':_0x2b5b('0x137'),'foreignKey':_0x2b5b('0x195')});db[_0x2b5b('0x56')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x12')});db[_0x2b5b('0x56')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'onDelete':'cascade','as':_0x2b5b('0x16d')});db[_0x2b5b('0x56')]['belongsTo'](db[_0x2b5b('0x54')],{'onDelete':_0x2b5b('0x11c'),'as':'Interaction','foreignKey':_0x2b5b('0x195')});db[_0x2b5b('0x56')][_0x2b5b('0x12c')](db[_0x2b5b('0x14d')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x193')});db[_0x2b5b('0x58')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':'UserSmsQueue','foreignKey':_0x2b5b('0x196')});db[_0x2b5b('0x58')]['belongsToMany'](db['Team'],{'through':'team_has_sms_queues','as':_0x2b5b('0x163')});db['OpenchannelAccount']['hasMany'](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x197'),'onDelete':_0x2b5b('0x11c')});db['OpenchannelAccount']['hasMany'](db[_0x2b5b('0x80')],{'as':_0x2b5b('0x176'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x2b5b('0x11f')](db[_0x2b5b('0x5e')],{'as':_0x2b5b('0x177'),'foreignKey':_0x2b5b('0x197')});db[_0x2b5b('0x5a')][_0x2b5b('0x11f')](db[_0x2b5b('0x60')],{'as':'Messages','foreignKey':_0x2b5b('0x197')});db[_0x2b5b('0x5a')]['hasMany'](db[_0x2b5b('0x5c')],{'as':'Applications','foreignKey':_0x2b5b('0x197'),'onDelete':_0x2b5b('0x11c')});db['OpenchannelAccount'][_0x2b5b('0x12c')](db['CmList'],{'as':_0x2b5b('0x188'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x5a')][_0x2b5b('0x12c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x2b5b('0x17a')});db['OpenchannelAccount'][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':_0x2b5b('0x14c')});db[_0x2b5b('0x5c')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x5c')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0x2b5b('0x186'),'foreignKey':_0x2b5b('0x198')});db[_0x2b5b('0x5c')][_0x2b5b('0x12c')](db[_0x2b5b('0x5a')],{'onDelete':'restrict','foreignKey':'OpenchannelAccountId'});db[_0x2b5b('0x5c')][_0x2b5b('0x12c')](db[_0x2b5b('0x83')],{'onDelete':_0x2b5b('0x186'),'foreignKey':'IntervalId'});db[_0x2b5b('0x5c')][_0x2b5b('0x12c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x2b5b('0x187')});db['OpenchannelInteraction'][_0x2b5b('0x11f')](db[_0x2b5b('0x60')],{'as':_0x2b5b('0x167'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x199')});db[_0x2b5b('0x5e')][_0x2b5b('0x12c')](db[_0x2b5b('0x5a')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x197')});db[_0x2b5b('0x5e')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':'Contact','foreignKey':_0x2b5b('0x16e')});db['OpenchannelInteraction'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x17d'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x5e')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x19a'),'as':'Tags'});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x2b5b('0x18e')});db[_0x2b5b('0x5e')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':'OpenchannelInteractionId'});db[_0x2b5b('0x60')][_0x2b5b('0x12c')](db['User'],{'onDelete':_0x2b5b('0x11c'),'as':'User'});db[_0x2b5b('0x60')][_0x2b5b('0x12c')](db['CmContact'],{'onDelete':_0x2b5b('0x11c'),'as':_0x2b5b('0x16d')});db[_0x2b5b('0x60')]['belongsTo'](db[_0x2b5b('0x5e')],{'onDelete':_0x2b5b('0x11c'),'as':_0x2b5b('0x183'),'foreignKey':'OpenchannelInteractionId'});db[_0x2b5b('0x60')]['belongsTo'](db[_0x2b5b('0xf2')],{'as':_0x2b5b('0xf2'),'foreignKey':_0x2b5b('0x190')});db[_0x2b5b('0x60')][_0x2b5b('0x12c')](db[_0x2b5b('0x5a')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x197')});db[_0x2b5b('0x62')][_0x2b5b('0x130')](db['User'],{'as':'Agents','through':'UserOpenchannelQueue','foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue']['belongsToMany'](db[_0x2b5b('0xec')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0x2b5b('0x143')]['hasMany'](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x19b'),'onDelete':'cascade'});db[_0x2b5b('0x143')][_0x2b5b('0x11f')](db['CannedAnswer'],{'as':_0x2b5b('0x176'),'foreignKey':_0x2b5b('0x19b')});db[_0x2b5b('0x143')][_0x2b5b('0x11f')](db[_0x2b5b('0x6f')],{'as':_0x2b5b('0x19c')});db[_0x2b5b('0x143')]['hasMany'](db[_0x2b5b('0x66')],{'as':'Interactions'});db[_0x2b5b('0x143')]['hasMany'](db[_0x2b5b('0x65')],{'as':_0x2b5b('0x18b'),'foreignKey':'ChatWebsiteId','onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x143')]['hasMany'](db[_0x2b5b('0x68')],{'as':_0x2b5b('0x167')});db[_0x2b5b('0x143')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':_0x2b5b('0x188'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x143')]['belongsTo'](db[_0x2b5b('0x83')],{'as':_0x2b5b('0x83'),'foreignKey':'IntervalId'});db[_0x2b5b('0x143')]['belongsTo'](db[_0x2b5b('0x149')],{'as':_0x2b5b('0x149'),'foreignKey':'MailAccountId'});db[_0x2b5b('0x143')]['belongsTo'](db[_0x2b5b('0x160')],{'as':_0x2b5b('0x161'),'foreignKey':_0x2b5b('0x17a')});db[_0x2b5b('0x143')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x2b5b('0x145')});db[_0x2b5b('0x64')]['belongsTo'](db[_0x2b5b('0x5a')],{});db[_0x2b5b('0x64')]['belongsTo'](db['CmList'],{'as':_0x2b5b('0x188'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x64')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x64')]['belongsTo'](db[_0x2b5b('0x5e')],{});db[_0x2b5b('0x64')]['belongsTo'](db[_0x2b5b('0x60')],{});db[_0x2b5b('0x64')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{});db[_0x2b5b('0x64')][_0x2b5b('0x12c')](db['OpenchannelQueue'],{});db[_0x2b5b('0x65')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x19d'),'foreignKey':'UserId','onDelete':_0x2b5b('0x186')});db['ChatApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x13d')],{'as':_0x2b5b('0x19e'),'foreignKey':'ChatQueueId','onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x65')][_0x2b5b('0x12c')](db[_0x2b5b('0x143')],{'as':_0x2b5b('0x19f'),'foreignKey':_0x2b5b('0x19b'),'onDelete':'restrict'});db['ChatApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x17e')],{'onDelete':_0x2b5b('0x186'),'foreignKey':_0x2b5b('0x187')});db[_0x2b5b('0x66')][_0x2b5b('0x11f')](db[_0x2b5b('0x68')],{'as':_0x2b5b('0x167'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1a0')});db[_0x2b5b('0x66')][_0x2b5b('0x12c')](db['ChatWebsite'],{'as':_0x2b5b('0x184'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x16d'),'foreignKey':'ContactId'});db[_0x2b5b('0x66')]['belongsTo'](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x17d'),'foreignKey':'UserId'});db[_0x2b5b('0x66')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':'chat_interaction_has_tags','as':_0x2b5b('0x180')});db[_0x2b5b('0x66')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x1a1'),'as':'ThroughTags'});db['ChatInteraction'][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':'Users','through':_0x2b5b('0x136'),'foreignKey':_0x2b5b('0x1a0')});db['ChatMessage'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'onDelete':'cascade','as':_0x2b5b('0x12')});db['ChatMessage'][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'onDelete':_0x2b5b('0x11c'),'as':'Contact','foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x68')][_0x2b5b('0x12c')](db[_0x2b5b('0x66')],{'onDelete':'cascade','as':_0x2b5b('0x183'),'foreignKey':_0x2b5b('0x1a0')});db[_0x2b5b('0x68')]['belongsTo'](db['Attachment'],{'as':_0x2b5b('0xf2'),'foreignKey':_0x2b5b('0x190')});db[_0x2b5b('0x68')]['belongsTo'](db[_0x2b5b('0x143')],{'as':'Account','foreignKey':_0x2b5b('0x19b')});db['ChatOfflineMessage'][_0x2b5b('0x11f')](db[_0x2b5b('0xf2')],{'as':_0x2b5b('0x182'),'foreignKey':'ChatOfflineMessageId','onDelete':_0x2b5b('0x11c'),'hooks':!![]});db[_0x2b5b('0x6a')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'onDelete':'cascade','as':'Contact','foreignKey':'ContactId'});db[_0x2b5b('0x6a')]['belongsTo'](db[_0x2b5b('0x143')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x19b')});db[_0x2b5b('0x13d')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':_0x2b5b('0x2f'),'hooks':!![]});db['ChatQueue'][_0x2b5b('0x130')](db['Team'],{'through':_0x2b5b('0x1a2'),'as':_0x2b5b('0x163')});db['ChatGroup']['hasMany'](db[_0x2b5b('0xd5')],{'as':'Messages','foreignKey':_0x2b5b('0x1a3'),'onDelete':_0x2b5b('0x11c')});db['ChatGroup'][_0x2b5b('0x130')](db['User'],{'as':'Members','through':'chat_group_has_users'});db[_0x2b5b('0x6f')]['belongsTo'](db[_0x2b5b('0x143')],{'as':_0x2b5b('0x19f'),'foreignKey':_0x2b5b('0x19b')});db['CmCompany'][_0x2b5b('0x11f')](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x1a4'),'foreignKey':_0x2b5b('0x1a5')});db['CmContact'][_0x2b5b('0x11f')](db[_0x2b5b('0x8e')],{'as':_0x2b5b('0x1a6'),'foreignKey':'CmContactId'});db[_0x2b5b('0x72')][_0x2b5b('0x11f')](db[_0x2b5b('0x73')],{'as':_0x2b5b('0x158'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x72')][_0x2b5b('0x11f')](db[_0x2b5b('0x77')],{'as':_0x2b5b('0x123'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x72')][_0x2b5b('0x11f')](db['CmHopperHistory'],{'as':_0x2b5b('0x159'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x72')][_0x2b5b('0x11f')](db[_0x2b5b('0x7b')],{'as':'ReportAgentPreview','foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x72')]['hasMany'](db[_0x2b5b('0xda')],{'as':_0x2b5b('0x15b'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x72')]['hasMany'](db[_0x2b5b('0x5e')],{'as':'OpenchannelInteractions','foreignKey':_0x2b5b('0x16e'),'onDelete':'restrict'});db['CmContact'][_0x2b5b('0x11f')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x2b5b('0x16e'),'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x72')][_0x2b5b('0x11f')](db[_0x2b5b('0x54')],{'as':_0x2b5b('0x127'),'foreignKey':'ContactId','onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x72')][_0x2b5b('0x11f')](db[_0x2b5b('0x4b')],{'as':_0x2b5b('0x128'),'foreignKey':_0x2b5b('0x16e'),'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x72')][_0x2b5b('0x11f')](db[_0x2b5b('0x40')],{'as':'MailInteractions','foreignKey':_0x2b5b('0x16e'),'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x72')][_0x2b5b('0x12c')](db[_0x2b5b('0x70')],{'as':'Company','foreignKey':_0x2b5b('0x1a5')});db[_0x2b5b('0x72')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':'List','foreignKey':_0x2b5b('0x189'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x72')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x181'),'through':_0x2b5b('0x131')});db[_0x2b5b('0x72')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'as':'Tags','through':_0x2b5b('0x1a7')});db[_0x2b5b('0x72')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':'cm_contact_has_tags','as':_0x2b5b('0x18e')});db[_0x2b5b('0x73')][_0x2b5b('0x11f')](db[_0x2b5b('0x1a8')],{'as':_0x2b5b('0x1a9'),'foreignKey':_0x2b5b('0x1aa')});db[_0x2b5b('0x73')][_0x2b5b('0x12c')](db['CmContact'],{'as':'Contact','foreignKey':_0x2b5b('0x16e'),'onDelete':'cascade'});db[_0x2b5b('0x73')][_0x2b5b('0x12c')](db['CmList'],{'as':_0x2b5b('0x188'),'foreignKey':_0x2b5b('0x189'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x73')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x19d'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x73')][_0x2b5b('0x12c')](db[_0x2b5b('0x1b')],{'as':_0x2b5b('0x19e'),'foreignKey':'VoiceQueueId','onDelete':_0x2b5b('0x11c')});db['CmHopper']['belongsTo'](db[_0x2b5b('0xee')],{'as':_0x2b5b('0xee'),'foreignKey':'CampaignId','onDelete':_0x2b5b('0x11c')});db['CmHopper'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x17d'),'foreignKey':_0x2b5b('0x1ab')});db['CmHopperBlack'][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x16e'),'onDelete':'cascade'});db[_0x2b5b('0x75')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':'List','foreignKey':_0x2b5b('0x189'),'onDelete':'cascade'});db['CmHopperBlack'][_0x2b5b('0x12c')](db['VoiceQueue'],{'as':_0x2b5b('0x19e'),'foreignKey':_0x2b5b('0x157'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x75')][_0x2b5b('0x12c')](db[_0x2b5b('0xee')],{'as':_0x2b5b('0xee'),'foreignKey':_0x2b5b('0x1ac'),'onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0x7f')][_0x2b5b('0x11f')](db[_0x2b5b('0x1ad')],{'as':{'plural':'All','singular':_0x2b5b('0x1ae')},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x2b5b('0x7f')]['hasMany'](db[_0x2b5b('0x1ad')],{'as':{'plural':_0x2b5b('0x1af'),'singular':'OneAny'},'foreignKey':_0x2b5b('0x1b0'),'onDelete':_0x2b5b('0x11c'),'hooks':!![]});db[_0x2b5b('0x7f')]['hasMany'](db[_0x2b5b('0x7e')],{'as':_0x2b5b('0x1b1'),'foreignKey':_0x2b5b('0x1b2'),'onDelete':_0x2b5b('0x11c'),'hooks':!![]});db[_0x2b5b('0x173')][_0x2b5b('0x11f')](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x1b3'),'onDelete':'cascade'});db[_0x2b5b('0x83')]['hasMany'](db[_0x2b5b('0x83')],{'as':_0x2b5b('0x1b4'),'foreignKey':_0x2b5b('0x15f'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x2b5b('0x83')]['hasMany'](db[_0x2b5b('0x18')],{'as':'Extensions','foreignKey':_0x2b5b('0x15f'),'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x83')][_0x2b5b('0x11f')](db['MailApplication'],{'as':_0x2b5b('0x1b5'),'foreignKey':_0x2b5b('0x15f')});db[_0x2b5b('0x83')][_0x2b5b('0x11f')](db[_0x2b5b('0x65')],{'as':_0x2b5b('0x1b6'),'foreignKey':_0x2b5b('0x15f')});db[_0x2b5b('0x83')]['hasMany'](db[_0x2b5b('0x4a')],{'as':_0x2b5b('0x1b7'),'foreignKey':_0x2b5b('0x15f')});db['Interval'][_0x2b5b('0x11f')](db[_0x2b5b('0x52')],{'as':'SmsApplications','foreignKey':_0x2b5b('0x15f')});db[_0x2b5b('0x88')][_0x2b5b('0x12c')](db['MailAccount'],{});db[_0x2b5b('0x88')][_0x2b5b('0x12c')](db[_0x2b5b('0x99')],{'foreignKey':_0x2b5b('0x1b8')});db[_0x2b5b('0x88')][_0x2b5b('0x12c')](db[_0x2b5b('0x98')],{'foreignKey':'CustomReportId'});db['Sound'][_0x2b5b('0x130')](db[_0x2b5b('0x1a')],{'as':_0x2b5b('0x1b9'),'through':_0x2b5b('0x1ba'),'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x17e')][_0x2b5b('0x130')](db[_0x2b5b('0x72')],{'through':'cm_contact_has_tags'});db[_0x2b5b('0x17e')][_0x2b5b('0x130')](db[_0x2b5b('0x66')],{'through':_0x2b5b('0x1a1')});db[_0x2b5b('0x17e')][_0x2b5b('0x130')](db[_0x2b5b('0x40')],{'through':_0x2b5b('0x17f')});db[_0x2b5b('0x17e')][_0x2b5b('0x130')](db['SmsInteraction'],{'through':_0x2b5b('0x194')});db[_0x2b5b('0x17e')]['belongsToMany'](db['FaxInteraction'],{'through':_0x2b5b('0x18d')});db[_0x2b5b('0x17e')][_0x2b5b('0x130')](db['OpenchannelInteraction'],{'through':_0x2b5b('0x19a')});db[_0x2b5b('0x17e')][_0x2b5b('0x130')](db[_0x2b5b('0x109')],{'through':'whatsapp_interaction_has_tags'});db['CmContactHasItem']['belongsTo'](db['ContactItemType'],{'as':'ItemType','foreignKey':_0x2b5b('0x1bb')});db[_0x2b5b('0x1a8')][_0x2b5b('0x12c')](db[_0x2b5b('0x73')],{'as':'Hopper','foreignKey':_0x2b5b('0x1aa')});db[_0x2b5b('0x8e')][_0x2b5b('0x12c')](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x1bc')});db[_0x2b5b('0x93')][_0x2b5b('0x11f')](db[_0x2b5b('0x1ad')],{'as':{'plural':'AllConditions','singular':_0x2b5b('0x1bd')},'foreignKey':_0x2b5b('0x1be'),'onDelete':_0x2b5b('0x11c'),'hooks':!![]});db[_0x2b5b('0x93')][_0x2b5b('0x11f')](db[_0x2b5b('0x1ad')],{'as':{'plural':_0x2b5b('0x1bf'),'singular':'AnyCondition'},'foreignKey':_0x2b5b('0x1c0'),'onDelete':_0x2b5b('0x11c'),'hooks':!![]});db[_0x2b5b('0x93')][_0x2b5b('0x11f')](db[_0x2b5b('0x7e')],{'as':'Actions','foreignKey':_0x2b5b('0x1c1'),'onDelete':_0x2b5b('0x11c'),'hooks':!![]});db['AnalyticCustomReport'][_0x2b5b('0x11f')](db[_0x2b5b('0x9c')],{'as':_0x2b5b('0x1c2'),'onDelete':_0x2b5b('0x11c'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0x2b5b('0x11f')](db[_0x2b5b('0x9c')],{'as':_0x2b5b('0x1c2'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1b8')});db[_0x2b5b('0x1c3')][_0x2b5b('0x11f')](db[_0x2b5b('0x9c')],{'as':_0x2b5b('0x1c2'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c4')});db[_0x2b5b('0x9c')]['belongsTo'](db[_0x2b5b('0x1c3')],{'foreignKey':_0x2b5b('0x1c4')});db[_0x2b5b('0x1c5')][_0x2b5b('0x11f')](db[_0x2b5b('0x9f')],{'as':'Configurations','onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db['SalesforceConfiguration'][_0x2b5b('0x11f')](db[_0x2b5b('0xa0')],{'as':_0x2b5b('0x1c7'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c8')});db[_0x2b5b('0x9f')][_0x2b5b('0x11f')](db[_0x2b5b('0xa0')],{'as':_0x2b5b('0x1c9'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1ca')});db['SalesforceConfiguration'][_0x2b5b('0x11f')](db[_0x2b5b('0xa0')],{'as':_0x2b5b('0x1c2'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1cb')});db['SalesforceConfiguration']['belongsTo'](db['SalesforceAccount'],{'as':_0x2b5b('0x184'),'foreignKey':'AccountId'});db[_0x2b5b('0xa0')][_0x2b5b('0x11f')](db[_0x2b5b('0xa0')],{'as':_0x2b5b('0x1cc'),'foreignKey':'SubjectId'});db[_0x2b5b('0xa0')][_0x2b5b('0x11f')](db[_0x2b5b('0xa0')],{'as':_0x2b5b('0x1cd'),'foreignKey':_0x2b5b('0x1ca')});db['SalesforceField'][_0x2b5b('0x11f')](db[_0x2b5b('0xa0')],{'as':_0x2b5b('0x1ce'),'foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0xa0')][_0x2b5b('0x12c')](db[_0x2b5b('0x95')],{'as':'Variable','foreignKey':_0x2b5b('0x1cf')});db[_0x2b5b('0xa2')][_0x2b5b('0x11f')](db[_0x2b5b('0xa4')],{'as':_0x2b5b('0x1d0'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xa4')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d1')],{'as':_0x2b5b('0x1c7'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2b5b('0xa4')][_0x2b5b('0x11f')](db['SugarcrmField'],{'as':_0x2b5b('0x1c9'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1ca')});db['SugarcrmConfiguration']['hasMany'](db[_0x2b5b('0x1d1')],{'as':'Fields','onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1cb')});db['SugarcrmConfiguration'][_0x2b5b('0x12c')](db[_0x2b5b('0xa2')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0x1d1')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d1')],{'as':'Subject','foreignKey':'SubjectId'});db['SugarcrmField'][_0x2b5b('0x11f')](db['SugarcrmField'],{'as':_0x2b5b('0x1cd'),'foreignKey':'DescriptionId'});db[_0x2b5b('0x1d1')]['hasMany'](db['SugarcrmField'],{'as':_0x2b5b('0x1ce'),'foreignKey':'FieldId'});db['SugarcrmField'][_0x2b5b('0x12c')](db['Variable'],{'as':_0x2b5b('0x95'),'foreignKey':_0x2b5b('0x1cf')});db['DeskAccount'][_0x2b5b('0x11f')](db[_0x2b5b('0xa9')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['DeskConfiguration'][_0x2b5b('0x11f')](db['DeskField'],{'as':_0x2b5b('0x1c7'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c8')});db[_0x2b5b('0xa9')]['hasMany'](db[_0x2b5b('0xab')],{'as':_0x2b5b('0x1c9'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0xa9')][_0x2b5b('0x11f')](db[_0x2b5b('0xab')],{'as':_0x2b5b('0x1c2'),'onDelete':_0x2b5b('0x11c'),'foreignKey':'FieldId'});db[_0x2b5b('0xa9')][_0x2b5b('0x12c')](db[_0x2b5b('0xa7')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xa9')]['belongsToMany'](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x1d2')});db[_0x2b5b('0xab')]['hasMany'](db['DeskField'],{'as':_0x2b5b('0x1cc'),'foreignKey':_0x2b5b('0x1c8')});db['DeskField'][_0x2b5b('0x11f')](db[_0x2b5b('0xab')],{'as':_0x2b5b('0x1cd'),'foreignKey':_0x2b5b('0x1ca')});db['DeskField']['hasMany'](db[_0x2b5b('0xab')],{'as':'Field','foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0xab')][_0x2b5b('0x12c')](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':_0x2b5b('0x1cf')});db[_0x2b5b('0xad')][_0x2b5b('0x11f')](db[_0x2b5b('0xaf')],{'as':_0x2b5b('0x1d0'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xaf')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d3')],{'as':'Subjects','onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c8')});db['ZohoConfiguration'][_0x2b5b('0x11f')](db[_0x2b5b('0x1d3')],{'as':'Descriptions','onDelete':_0x2b5b('0x11c'),'foreignKey':'DescriptionId'});db[_0x2b5b('0xaf')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d3')],{'as':_0x2b5b('0x1c2'),'onDelete':_0x2b5b('0x11c'),'foreignKey':'FieldId'});db[_0x2b5b('0xaf')][_0x2b5b('0x12c')](db['ZohoAccount'],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db['ZohoField'][_0x2b5b('0x11f')](db[_0x2b5b('0x1d3')],{'as':_0x2b5b('0x1cc'),'foreignKey':'SubjectId'});db[_0x2b5b('0x1d3')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d3')],{'as':_0x2b5b('0x1cd'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0x1d3')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d3')],{'as':'Field','foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0x1d3')]['belongsTo'](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':_0x2b5b('0x1cf')});db[_0x2b5b('0xb2')][_0x2b5b('0x11f')](db['ZendeskConfiguration'],{'as':_0x2b5b('0x1d0'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xb4')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d4')],{'as':_0x2b5b('0x1c7'),'foreignKey':'SubjectId'});db[_0x2b5b('0xb4')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d4')],{'as':_0x2b5b('0x1c9'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0xb4')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d4')],{'as':_0x2b5b('0x1c2'),'foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0xb4')]['belongsTo'](db['ZendeskAccount'],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xb4')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':'int_zendesk_configuration_has_tags'});db['ZendeskField'][_0x2b5b('0x11f')](db[_0x2b5b('0x1d4')],{'as':'Subject','foreignKey':_0x2b5b('0x1c8')});db[_0x2b5b('0x1d4')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d4')],{'as':_0x2b5b('0x1cd'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0x1d4')][_0x2b5b('0x11f')](db[_0x2b5b('0x1d4')],{'as':_0x2b5b('0x1ce'),'foreignKey':_0x2b5b('0x1cb')});db['ZendeskField'][_0x2b5b('0x12c')](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':_0x2b5b('0x1cf')});db[_0x2b5b('0x1d5')][_0x2b5b('0x11f')](db[_0x2b5b('0xb8')],{'as':_0x2b5b('0x1d0'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xb8')]['hasMany'](db['FreshdeskField'],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db[_0x2b5b('0xb8')]['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0xb8')]['hasMany'](db[_0x2b5b('0xba')],{'as':_0x2b5b('0x1c2'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1cb')});db['FreshdeskConfiguration'][_0x2b5b('0x12c')](db[_0x2b5b('0x1d5')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xb8')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x1d6')});db[_0x2b5b('0xba')][_0x2b5b('0x11f')](db[_0x2b5b('0xba')],{'as':_0x2b5b('0x1cc'),'foreignKey':'SubjectId'});db['FreshdeskField'][_0x2b5b('0x11f')](db[_0x2b5b('0xba')],{'as':_0x2b5b('0x1cd'),'foreignKey':'DescriptionId'});db[_0x2b5b('0xba')][_0x2b5b('0x11f')](db[_0x2b5b('0xba')],{'as':_0x2b5b('0x1ce'),'foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0xba')][_0x2b5b('0x12c')](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':_0x2b5b('0x1cf')});db[_0x2b5b('0xbc')][_0x2b5b('0x11f')](db[_0x2b5b('0xbe')],{'as':_0x2b5b('0x1d0'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xbe')]['hasMany'](db[_0x2b5b('0xc0')],{'as':_0x2b5b('0x1c7'),'foreignKey':_0x2b5b('0x1c8')});db[_0x2b5b('0xbe')][_0x2b5b('0x11f')](db[_0x2b5b('0xc0')],{'as':_0x2b5b('0x1c9'),'foreignKey':_0x2b5b('0x1ca')});db['VtigerConfiguration'][_0x2b5b('0x11f')](db[_0x2b5b('0xc0')],{'as':_0x2b5b('0x1c2'),'foreignKey':_0x2b5b('0x1cb')});db['VtigerConfiguration'][_0x2b5b('0x12c')](db[_0x2b5b('0xbc')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xc0')][_0x2b5b('0x11f')](db[_0x2b5b('0xc0')],{'as':'Subject','foreignKey':_0x2b5b('0x1c8')});db['VtigerField'][_0x2b5b('0x11f')](db[_0x2b5b('0xc0')],{'as':_0x2b5b('0x1cd'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0xc0')][_0x2b5b('0x11f')](db['VtigerField'],{'as':_0x2b5b('0x1ce'),'foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0xc0')][_0x2b5b('0x12c')](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':_0x2b5b('0x1cf')});db['ServicenowAccount']['hasMany'](db['ServicenowConfiguration'],{'as':_0x2b5b('0x1d0'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xc3')][_0x2b5b('0x11f')](db[_0x2b5b('0xc4')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x2b5b('0xc3')][_0x2b5b('0x11f')](db['ServicenowField'],{'as':_0x2b5b('0x1c9'),'foreignKey':_0x2b5b('0x1ca')});db['ServicenowConfiguration']['hasMany'](db[_0x2b5b('0xc4')],{'as':_0x2b5b('0x1c2'),'foreignKey':'FieldId'});db[_0x2b5b('0xc3')][_0x2b5b('0x12c')](db[_0x2b5b('0x1d7')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db['ServicenowField']['hasMany'](db[_0x2b5b('0xc4')],{'as':'Subject','foreignKey':'SubjectId'});db['ServicenowField'][_0x2b5b('0x11f')](db[_0x2b5b('0xc4')],{'as':_0x2b5b('0x1cd'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0xc4')][_0x2b5b('0x11f')](db[_0x2b5b('0xc4')],{'as':'Field','foreignKey':_0x2b5b('0x1cb')});db['ServicenowField']['belongsTo'](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':'VariableId'});db[_0x2b5b('0xc6')][_0x2b5b('0x11f')](db[_0x2b5b('0xc8')],{'as':'Configurations','onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db['Dynamics365Account'][_0x2b5b('0x12c')](db['CloudProvider'],{'as':_0x2b5b('0x112'),'foreignKey':_0x2b5b('0x170')});db[_0x2b5b('0xc8')]['hasMany'](db[_0x2b5b('0xca')],{'as':'Subjects','onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c8')});db[_0x2b5b('0xc8')]['hasMany'](db[_0x2b5b('0xca')],{'as':_0x2b5b('0x1c9'),'onDelete':_0x2b5b('0x11c'),'foreignKey':'DescriptionId'});db[_0x2b5b('0xc8')][_0x2b5b('0x11f')](db[_0x2b5b('0xca')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0xc8')][_0x2b5b('0x12c')](db[_0x2b5b('0xc6')],{'as':'Account','foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xca')][_0x2b5b('0x11f')](db[_0x2b5b('0xca')],{'as':_0x2b5b('0x1cc'),'foreignKey':'SubjectId'});db[_0x2b5b('0xca')][_0x2b5b('0x11f')](db[_0x2b5b('0xca')],{'as':'Description','foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0xca')][_0x2b5b('0x11f')](db[_0x2b5b('0xca')],{'as':_0x2b5b('0x1ce'),'foreignKey':'FieldId'});db[_0x2b5b('0xca')][_0x2b5b('0x12c')](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':'VariableId'});db[_0x2b5b('0xcc')]['hasMany'](db[_0x2b5b('0xcd')],{'as':_0x2b5b('0x1d0'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1c6')});db['FreshsalesConfiguration']['hasMany'](db[_0x2b5b('0xcf')],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x2b5b('0xcd')][_0x2b5b('0x11f')](db[_0x2b5b('0xcf')],{'as':_0x2b5b('0x1c9'),'foreignKey':_0x2b5b('0x1ca')});db['FreshsalesConfiguration'][_0x2b5b('0x11f')](db[_0x2b5b('0xcf')],{'as':'Fields','foreignKey':_0x2b5b('0x1cb')});db['FreshsalesConfiguration'][_0x2b5b('0x12c')](db[_0x2b5b('0xcc')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1c6')});db[_0x2b5b('0xcf')][_0x2b5b('0x11f')](db[_0x2b5b('0xcf')],{'as':_0x2b5b('0x1cc'),'foreignKey':_0x2b5b('0x1c8')});db['FreshsalesField'][_0x2b5b('0x11f')](db[_0x2b5b('0xcf')],{'as':_0x2b5b('0x1cd'),'foreignKey':_0x2b5b('0x1ca')});db[_0x2b5b('0xcf')][_0x2b5b('0x11f')](db[_0x2b5b('0xcf')],{'as':'Field','foreignKey':_0x2b5b('0x1cb')});db[_0x2b5b('0xcf')][_0x2b5b('0x12c')](db[_0x2b5b('0x95')],{'as':_0x2b5b('0x95'),'foreignKey':'VariableId'});db[_0x2b5b('0xd3')]['belongsTo'](db[_0x2b5b('0x143')],{});db['ChatQueueReport'][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':'List','foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0xd3')]['belongsTo'](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0xd3')][_0x2b5b('0x12c')](db[_0x2b5b('0x66')],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db[_0x2b5b('0xd3')]['belongsTo'](db[_0x2b5b('0x12')],{});db[_0x2b5b('0xd3')][_0x2b5b('0x12c')](db[_0x2b5b('0x13d')],{});db[_0x2b5b('0xd5')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'onDelete':_0x2b5b('0x11c'),'foreignKey':'FromId'});db[_0x2b5b('0xd5')][_0x2b5b('0x12c')](db['User'],{'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1d8')});db[_0x2b5b('0xda')][_0x2b5b('0x11f')](db[_0x2b5b('0xd8')],{'foreignKey':_0x2b5b('0x1d9'),'onDelete':'cascade'});db['JscriptySessionReport'][_0x2b5b('0x11f')](db[_0x2b5b('0x1da')],{'foreignKey':'SessionId','onDelete':_0x2b5b('0x11c')});db[_0x2b5b('0xdc')][_0x2b5b('0x12c')](db[_0x2b5b('0x14d')],{});db[_0x2b5b('0xdc')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':_0x2b5b('0x188'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0xdc')]['belongsTo'](db[_0x2b5b('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2b5b('0xdc')][_0x2b5b('0x12c')](db['SmsInteraction'],{});db[_0x2b5b('0xdc')][_0x2b5b('0x12c')](db['SmsMessage'],{});db[_0x2b5b('0xdc')]['belongsTo'](db[_0x2b5b('0x12')],{});db[_0x2b5b('0xdc')]['belongsTo'](db[_0x2b5b('0x58')],{});db[_0x2b5b('0xe0')][_0x2b5b('0x11f')](db[_0x2b5b('0xda')],{'foreignKey':_0x2b5b('0x1db')});db[_0x2b5b('0xe0')][_0x2b5b('0x11f')](db[_0x2b5b('0xd8')],{'foreignKey':_0x2b5b('0x1db')});db['JscriptyProject'][_0x2b5b('0x11f')](db[_0x2b5b('0x1da')],{'foreignKey':'ProjectId'});db[_0x2b5b('0xec')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x2b5b('0x134')});db['Team']['belongsToMany'](db[_0x2b5b('0x1b')],{'through':_0x2b5b('0x164'),'as':_0x2b5b('0x13a')});db[_0x2b5b('0xec')][_0x2b5b('0x130')](db[_0x2b5b('0x3d')],{'through':_0x2b5b('0x17b'),'as':_0x2b5b('0x1dc')});db['Team']['belongsToMany'](db[_0x2b5b('0x13d')],{'through':_0x2b5b('0x1a2'),'as':_0x2b5b('0x13e')});db[_0x2b5b('0xec')][_0x2b5b('0x130')](db[_0x2b5b('0x4f')],{'through':_0x2b5b('0x191'),'as':_0x2b5b('0x13f')});db[_0x2b5b('0xec')][_0x2b5b('0x130')](db[_0x2b5b('0x58')],{'through':_0x2b5b('0x1dd'),'as':'SmsQueues'});db['Team'][_0x2b5b('0x130')](db['OpenchannelQueue'],{'through':_0x2b5b('0x1de'),'as':'OpenchannelQueues'});db[_0x2b5b('0xec')][_0x2b5b('0x130')](db[_0x2b5b('0x110')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x2b5b('0xec')][_0x2b5b('0x130')](db[_0x2b5b('0xff')],{'through':_0x2b5b('0x115'),'as':_0x2b5b('0x13b')});db[_0x2b5b('0xee')][_0x2b5b('0x11f')](db[_0x2b5b('0x73')],{'as':_0x2b5b('0x158'),'foreignKey':'CampaignId'});db[_0x2b5b('0xee')][_0x2b5b('0x11f')](db['CmHopperFinal'],{'as':_0x2b5b('0x123'),'foreignKey':_0x2b5b('0x1ac')});db[_0x2b5b('0xee')][_0x2b5b('0x11f')](db[_0x2b5b('0x79')],{'as':_0x2b5b('0x159'),'foreignKey':'CampaignId'});db['Campaign'][_0x2b5b('0x11f')](db['CmHopperBlack'],{'as':_0x2b5b('0x15a'),'foreignKey':_0x2b5b('0x1ac')});db[_0x2b5b('0xee')]['belongsTo'](db['Trunk'],{'as':'Trunk','foreignKey':_0x2b5b('0x15c')});db[_0x2b5b('0xee')][_0x2b5b('0x12c')](db[_0x2b5b('0x28')],{'as':_0x2b5b('0x15d'),'foreignKey':_0x2b5b('0x15e')});db[_0x2b5b('0xee')][_0x2b5b('0x12c')](db[_0x2b5b('0x83')],{'as':_0x2b5b('0x83'),'foreignKey':_0x2b5b('0x15f')});db[_0x2b5b('0xee')][_0x2b5b('0x12c')](db[_0x2b5b('0xe6')],{'as':_0x2b5b('0xe6'),'foreignKey':_0x2b5b('0x1df')});db['Campaign'][_0x2b5b('0x130')](db['CmList'],{'as':'Lists','through':_0x2b5b('0x1e0')});db[_0x2b5b('0xee')][_0x2b5b('0x130')](db[_0x2b5b('0xfe')],{'as':_0x2b5b('0x1e1'),'through':_0x2b5b('0x1e2')});db['Attachment'][_0x2b5b('0x12c')](db[_0x2b5b('0x6a')],{'as':_0x2b5b('0x6a'),'foreignKey':_0x2b5b('0x185')});db[_0x2b5b('0xf6')][_0x2b5b('0x12c')](db[_0x2b5b('0x41')],{});db[_0x2b5b('0xf6')]['belongsTo'](db['MailInteraction'],{});db[_0x2b5b('0xf6')]['belongsTo'](db[_0x2b5b('0x149')],{'foreignKey':_0x2b5b('0x1e3'),'as':'FromAccount'});db[_0x2b5b('0xf6')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e4'),'as':_0x2b5b('0x1e5')});db[_0x2b5b('0xf6')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e6'),'as':'ToAgent'});db['MailTransferReport']['belongsTo'](db[_0x2b5b('0x3d')],{'foreignKey':'ToMailQueueId','as':_0x2b5b('0x1e7')});db[_0x2b5b('0xf6')][_0x2b5b('0x12c')](db[_0x2b5b('0x149')],{'foreignKey':_0x2b5b('0x1e8'),'as':_0x2b5b('0x1e9')});db[_0x2b5b('0xf8')][_0x2b5b('0x12c')](db[_0x2b5b('0x68')],{});db[_0x2b5b('0xf8')][_0x2b5b('0x12c')](db[_0x2b5b('0x66')],{});db['ChatTransferReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x143')],{'foreignKey':_0x2b5b('0x1ea'),'as':'FromAccount'});db[_0x2b5b('0xf8')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e4'),'as':'FromAgent'});db[_0x2b5b('0xf8')]['belongsTo'](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e6'),'as':'ToAgent'});db['ChatTransferReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x13d')],{'foreignKey':_0x2b5b('0x1eb'),'as':_0x2b5b('0x1e7')});db[_0x2b5b('0xf8')]['belongsTo'](db['ChatWebsite'],{'foreignKey':'ToChatWebsiteId','as':_0x2b5b('0x1e9')});db[_0x2b5b('0x1ec')][_0x2b5b('0x12c')](db[_0x2b5b('0x4d')],{});db[_0x2b5b('0x1ec')][_0x2b5b('0x12c')](db[_0x2b5b('0x4b')],{});db[_0x2b5b('0x1ec')][_0x2b5b('0x12c')](db[_0x2b5b('0x146')],{'foreignKey':'FromFaxAccountId','as':_0x2b5b('0x1ed')});db[_0x2b5b('0x1ec')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e4'),'as':_0x2b5b('0x1e5')});db[_0x2b5b('0x1ec')]['belongsTo'](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e6'),'as':_0x2b5b('0x1ee')});db[_0x2b5b('0x1ec')][_0x2b5b('0x12c')](db[_0x2b5b('0x4f')],{'foreignKey':_0x2b5b('0x1ef'),'as':'ToQueue'});db['FaxTransferReport']['belongsTo'](db[_0x2b5b('0x146')],{'foreignKey':_0x2b5b('0x1f0'),'as':_0x2b5b('0x1e9')});db[_0x2b5b('0xfa')]['belongsTo'](db[_0x2b5b('0x60')],{});db[_0x2b5b('0xfa')][_0x2b5b('0x12c')](db[_0x2b5b('0x5e')],{});db['OpenchannelTransferReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x5a')],{'foreignKey':_0x2b5b('0x1f1'),'as':_0x2b5b('0x1ed')});db['OpenchannelTransferReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e4'),'as':_0x2b5b('0x1e5')});db[_0x2b5b('0xfa')][_0x2b5b('0x12c')](db['User'],{'foreignKey':_0x2b5b('0x1e6'),'as':_0x2b5b('0x1ee')});db[_0x2b5b('0xfa')][_0x2b5b('0x12c')](db[_0x2b5b('0x62')],{'foreignKey':_0x2b5b('0x1f2'),'as':'ToQueue'});db['OpenchannelTransferReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x5a')],{'foreignKey':_0x2b5b('0x1f3'),'as':'ToAccount'});db[_0x2b5b('0xfc')][_0x2b5b('0x12c')](db['SmsMessage'],{});db[_0x2b5b('0xfc')][_0x2b5b('0x12c')](db[_0x2b5b('0x54')],{});db[_0x2b5b('0xfc')]['belongsTo'](db[_0x2b5b('0x14d')],{'foreignKey':'FromSmsAccountId','as':_0x2b5b('0x1ed')});db[_0x2b5b('0xfc')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e4'),'as':_0x2b5b('0x1e5')});db[_0x2b5b('0xfc')]['belongsTo'](db[_0x2b5b('0x12')],{'foreignKey':'ToUserId','as':_0x2b5b('0x1ee')});db[_0x2b5b('0xfc')][_0x2b5b('0x12c')](db[_0x2b5b('0x58')],{'foreignKey':_0x2b5b('0x1f4'),'as':'ToQueue'});db[_0x2b5b('0xfc')][_0x2b5b('0x12c')](db[_0x2b5b('0x14d')],{'foreignKey':_0x2b5b('0x1f5'),'as':_0x2b5b('0x1e9')});db['CmList']['hasMany'](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x189'),'onDelete':'cascade'});db[_0x2b5b('0xfe')][_0x2b5b('0x11f')](db[_0x2b5b('0x1f6')],{'as':_0x2b5b('0x1f7'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0xfe')]['hasMany'](db[_0x2b5b('0x72')],{'as':_0x2b5b('0x1a4'),'onDelete':'cascade','foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0xfe')][_0x2b5b('0x11f')](db[_0x2b5b('0x77')],{'as':_0x2b5b('0x123'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0xfe')][_0x2b5b('0x11f')](db[_0x2b5b('0x79')],{'as':_0x2b5b('0x124'),'foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0xfe')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x2b5b('0xfe')][_0x2b5b('0x130')](db['VoiceQueue'],{'as':_0x2b5b('0x1f8'),'through':_0x2b5b('0x1f9')});db[_0x2b5b('0xfe')]['belongsToMany'](db[_0x2b5b('0x12')],{'as':'Agents','through':'cm_user_has_lists'});db[_0x2b5b('0xff')]['hasMany'](db['VoiceExtension'],{'as':_0x2b5b('0x122'),'onDelete':_0x2b5b('0x11c')});db['VoicePrefix'][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':_0x2b5b('0x13c')});db[_0x2b5b('0xff')]['belongsToMany'](db[_0x2b5b('0xec')],{'through':_0x2b5b('0x115'),'as':'Teams'});db[_0x2b5b('0x100')][_0x2b5b('0x11f')](db['User'],{'as':_0x2b5b('0x181'),'foreignKey':_0x2b5b('0x12d')});db[_0x2b5b('0x100')][_0x2b5b('0x11f')](db[_0x2b5b('0x102')],{'as':_0x2b5b('0x1fa'),'foreignKey':_0x2b5b('0x12d'),'onDelete':'cascade'});db[_0x2b5b('0x102')][_0x2b5b('0x11f')](db['UserProfileResource'],{'as':_0x2b5b('0x1fb'),'foreignKey':_0x2b5b('0x1fc'),'onDelete':'cascade'});db[_0x2b5b('0x150')][_0x2b5b('0x11f')](db[_0x2b5b('0x173')],{'as':_0x2b5b('0x174'),'foreignKey':_0x2b5b('0x1fd'),'onDelete':_0x2b5b('0x11c')});db['WhatsappAccount'][_0x2b5b('0x11f')](db[_0x2b5b('0x80')],{'as':_0x2b5b('0x176'),'foreignKey':'WhatsappAccountId'});db[_0x2b5b('0x150')]['hasMany'](db[_0x2b5b('0x10b')],{'as':_0x2b5b('0x167'),'foreignKey':'WhatsappAccountId'});db[_0x2b5b('0x150')][_0x2b5b('0x11f')](db['WhatsappInteraction'],{'as':_0x2b5b('0x177')});db[_0x2b5b('0x150')][_0x2b5b('0x11f')](db[_0x2b5b('0x108')],{'as':_0x2b5b('0x18b'),'foreignKey':'WhatsappAccountId','onDelete':_0x2b5b('0x11c')});db['WhatsappAccount'][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':'List','foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x150')]['belongsTo'](db[_0x2b5b('0x160')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x2b5b('0x150')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':'Agents','through':_0x2b5b('0x152')});db[_0x2b5b('0x108')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x108')][_0x2b5b('0x12c')](db[_0x2b5b('0x110')],{'onDelete':_0x2b5b('0x186')});db['WhatsappApplication'][_0x2b5b('0x12c')](db[_0x2b5b('0x150')],{'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x108')][_0x2b5b('0x12c')](db[_0x2b5b('0x83')],{'onDelete':_0x2b5b('0x186'),'foreignKey':_0x2b5b('0x15f')});db[_0x2b5b('0x108')][_0x2b5b('0x12c')](db[_0x2b5b('0x17e')],{'onDelete':_0x2b5b('0x186'),'foreignKey':_0x2b5b('0x187')});db['WhatsappInteraction'][_0x2b5b('0x11f')](db[_0x2b5b('0x10b')],{'as':_0x2b5b('0x167'),'onDelete':_0x2b5b('0x11c'),'foreignKey':_0x2b5b('0x1fe')});db[_0x2b5b('0x109')]['belongsTo'](db[_0x2b5b('0x150')],{'as':'Account','foreignKey':_0x2b5b('0x1fd')});db[_0x2b5b('0x109')]['belongsTo'](db['CmContact'],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x109')][_0x2b5b('0x12c')](db['User'],{'as':_0x2b5b('0x17d'),'foreignKey':_0x2b5b('0x11d')});db[_0x2b5b('0x109')]['belongsToMany'](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x1ff'),'as':'Tags'});db[_0x2b5b('0x109')][_0x2b5b('0x130')](db[_0x2b5b('0x17e')],{'through':_0x2b5b('0x1ff'),'as':_0x2b5b('0x18e')});db[_0x2b5b('0x109')][_0x2b5b('0x130')](db['User'],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0x2b5b('0x10b')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x12')});db[_0x2b5b('0x10b')][_0x2b5b('0x12c')](db['CmContact'],{'onDelete':_0x2b5b('0x11c'),'as':_0x2b5b('0x16d')});db[_0x2b5b('0x10b')][_0x2b5b('0x12c')](db[_0x2b5b('0x109')],{'onDelete':'cascade','as':_0x2b5b('0x183'),'foreignKey':'WhatsappInteractionId'});db[_0x2b5b('0x10b')]['belongsTo'](db[_0x2b5b('0x150')],{'as':_0x2b5b('0x184'),'foreignKey':_0x2b5b('0x1fd')});db['WhatsappQueueReport']['belongsTo'](db[_0x2b5b('0x150')],{});db[_0x2b5b('0x10d')][_0x2b5b('0x12c')](db[_0x2b5b('0xfe')],{'as':'List','foreignKey':_0x2b5b('0x189')});db[_0x2b5b('0x10d')][_0x2b5b('0x12c')](db['CmContact'],{'as':_0x2b5b('0x16d'),'foreignKey':_0x2b5b('0x16e')});db[_0x2b5b('0x10d')][_0x2b5b('0x12c')](db[_0x2b5b('0x109')],{});db['WhatsappQueueReport']['belongsTo'](db[_0x2b5b('0x110')],{});db['WhatsappQueueReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x10b')],{});db['WhatsappQueueReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{});db[_0x2b5b('0x10e')]['belongsTo'](db[_0x2b5b('0x10b')],{});db[_0x2b5b('0x10e')]['belongsTo'](db[_0x2b5b('0x109')],{});db['WhatsappTransferReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x150')],{'foreignKey':_0x2b5b('0x200'),'as':_0x2b5b('0x1ed')});db['WhatsappTransferReport'][_0x2b5b('0x12c')](db[_0x2b5b('0x150')],{'foreignKey':_0x2b5b('0x201'),'as':'ToAccount'});db['WhatsappTransferReport'][_0x2b5b('0x12c')](db['WhatsappQueue'],{'foreignKey':_0x2b5b('0x202'),'as':_0x2b5b('0x1e7')});db[_0x2b5b('0x10e')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':_0x2b5b('0x1e4'),'as':_0x2b5b('0x1e5')});db[_0x2b5b('0x10e')][_0x2b5b('0x12c')](db[_0x2b5b('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x2b5b('0x110')][_0x2b5b('0x130')](db[_0x2b5b('0x12')],{'as':_0x2b5b('0x162'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0x2b5b('0x130')](db[_0x2b5b('0xec')],{'through':'team_has_whatsapp_queues','as':_0x2b5b('0x163')});db[_0x2b5b('0x117')]['belongsTo'](db['User'],{'as':'user','foreignKey':_0x2b5b('0x11d'),'onDelete':_0x2b5b('0x11c'),'hooks':!![]});db[_0x2b5b('0x112')]['hasOne'](db[_0x2b5b('0xc6')],{'as':'Dynamics365Account','onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x112')][_0x2b5b('0x11a')](db[_0x2b5b('0x16f')],{'as':_0x2b5b('0x171'),'onDelete':_0x2b5b('0x186')});db[_0x2b5b('0x112')][_0x2b5b('0x11a')](db[_0x2b5b('0x3a')],{'as':_0x2b5b('0x172'),'onDelete':'restrict'});module[_0x2b5b('0x203')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xebd3=['CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/network/network.model','ChatQueueReport','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','MailInteractionHasTag','../api/mailInteractionHasTag/mailInteractionHasTag.model','User','hasOne','VoiceMail','cascade','UserId','hasMany','Recordings','VoiceExtension','CmHopperFinal','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','SenderId','userProfileId','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','belongsToMany','Lists','cm_user_has_lists','user_has_teams','MailInteraction','MailInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_sms_interactions','user_has_whatsapp_interactions','UserVoiceQueue','VoicePrefixes','UserVoicePrefix','MailQueue','MailQueues','ChatQueue','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','ChanSpyId','Applications','VoiceMusicOnHold','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperHistory','JscriptySessionReport','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','Messages','mailbox','QueueCalls','uniqueid','ContactId','MailAccountId','restrict','MailServerOut','CloudProviderId','Imap','Smtp','Dispositions','Interactions','MailApplication','List','TemplateId','Agents','user_has_mail_accounts','team_has_mail_queues','Contact','Owner','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','MailInteractionId','Attachments','Interaction','Account','ChatWebsiteId','MailQueueReport','ListId','Items','Answers','FaxAccountId','Exntensions','TagId','fax_interaction_has_tags','FaxInteractionId','AttachmentId','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','Tags','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','Phones','CmContactId','JscriptySessions','CmCompany','Company','CompanyId','cm_contact_has_tags','CmHopperAdditionalPhone','CmHopperId','CampaignId','OwnerId','All','OneAll','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','CmContactHasItem','ContactItemType','Hopper','AllConditions','AllCondition','TriggerAllId','Condition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','SalesforceField','FieldId','SalesforceAccount','Subject','Description','Field','VariableId','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZohoField','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Account','FreshsalesField','ChatInternalMessage','FromId','SessionId','JscriptyProject','ProjectId','VoiceQueues','team_has_fax_queues','team_has_sms_queues','team_has_whatsapp_queues','HopperHistories','HopperBlacks','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromUserId','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToQueue','ToSmsAccountId','CustomFields','Queues','UserProfileSections','Resources','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','user','exports','../config/environment','lodash','determine','sequelize','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','defaultsDeep','motion2','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceExtension/voiceExtension.model','VoiceQueue','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','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','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xebd3,0x194));var _0x3ebd=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0xebd3[_0x296754];return _0x1d9f1d;};'use strict';var config=require(_0x3ebd('0x0'));var Sequelize=require('sequelize');var _=require(_0x3ebd('0x1'));var jstz=require('jstz');var timezone=jstz[_0x3ebd('0x2')]();config[_0x3ebd('0x3')]=_['defaultsDeep'](config['sequelize'],{'database':'motion2','username':_0x3ebd('0x4'),'password':_0x3ebd('0x5'),'options':{'host':_0x3ebd('0x6'),'port':0xcea,'dialect':_0x3ebd('0x7'),'dialectOptions':{'charset':_0x3ebd('0x8')},'logging':![],'timezone':timezone[_0x3ebd('0x9')](),'define':{'charset':_0x3ebd('0xa'),'collate':_0x3ebd('0xb')}}});config[_0x3ebd('0xc')]=_[_0x3ebd('0xd')](config['sequelizeHistory'],{'database':_0x3ebd('0xe'),'username':'xcall','password':_0x3ebd('0x5'),'options':{'host':_0x3ebd('0x6'),'port':0xcea,'dialect':_0x3ebd('0x7'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x3ebd('0x9')](),'define':{'charset':'utf8','collate':_0x3ebd('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x3ebd('0xf')],config[_0x3ebd('0x3')][_0x3ebd('0x10')],config[_0x3ebd('0x3')][_0x3ebd('0x11')],config['sequelize'][_0x3ebd('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x3ebd('0xc')]['database'],config[_0x3ebd('0xc')][_0x3ebd('0x10')],config[_0x3ebd('0xc')]['password'],config['sequelizeHistory'][_0x3ebd('0x12')])};db['User']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x14'));db[_0x3ebd('0x15')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x16'));db[_0x3ebd('0x17')]=db[_0x3ebd('0x3')]['import']('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x18'));db['VoiceMusicOnHold']=db['sequelize']['import']('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x3ebd('0x19')]=db[_0x3ebd('0x3')]['import']('../api/voiceQueue/voiceQueue.model');db[_0x3ebd('0x1a')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/voiceRecording/voiceRecording.model');db[_0x3ebd('0x1b')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x1c'));db['VoiceMail']=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/voiceMail/voiceMail.model');db['VoiceMailMessage']=db['sequelize']['import'](_0x3ebd('0x1d'));db[_0x3ebd('0x1e')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x1f'));db[_0x3ebd('0x20')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x21'));db[_0x3ebd('0x22')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x23'));db[_0x3ebd('0x24')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x25'));db[_0x3ebd('0x26')]=db['sequelize'][_0x3ebd('0x13')]('../api/trunk/trunk.model');db[_0x3ebd('0x27')]=db['sequelize']['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0x3ebd('0x28')]=db['sequelize']['import'](_0x3ebd('0x29'));db['UserVoiceQueue']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x2a'));db[_0x3ebd('0x2b')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/userChatQueue/userChatQueue.model');db[_0x3ebd('0x2c')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x2d'));db[_0x3ebd('0x2e')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x2f'));db[_0x3ebd('0x30')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x31'));db[_0x3ebd('0x32')]=db['sequelize']['import'](_0x3ebd('0x33'));db[_0x3ebd('0x34')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x3ebd('0x35')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x36'));db['MailServerOut']=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0x37'));db[_0x3ebd('0x38')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x39'));db['MailQueue']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x3a'));db[_0x3ebd('0x3b')]=db['sequelize']['import'](_0x3ebd('0x3c'));db['MailInteraction']=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0x3d'));db[_0x3ebd('0x3e')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x3f'));db['MailApplication']=db[_0x3ebd('0x3')]['import']('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x40'));db[_0x3ebd('0x41')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0x42'));db[_0x3ebd('0x43')]=db[_0x3ebd('0x3')]['import']('../api/dashboardItem/dashboardItem.model');db[_0x3ebd('0x44')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/faxAccount/faxAccount.model');db[_0x3ebd('0x45')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x46'));db[_0x3ebd('0x47')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x48'));db[_0x3ebd('0x49')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0x4a'));db[_0x3ebd('0x4b')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x4c'));db['FaxQueueReport']=db['sequelize'][_0x3ebd('0x13')]('../api/faxQueueReport/faxQueueReport.model');db['SmsAccount']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x4d'));db[_0x3ebd('0x4e')]=db['sequelize'][_0x3ebd('0x13')]('../api/smsApplication/smsApplication.model');db[_0x3ebd('0x4f')]=db['sequelize']['import'](_0x3ebd('0x50'));db[_0x3ebd('0x51')]=db['sequelize']['import']('../api/smsMessage/smsMessage.model');db[_0x3ebd('0x52')]=db['sequelize'][_0x3ebd('0x13')]('../api/smsQueue/smsQueue.model');db[_0x3ebd('0x53')]=db['sequelize']['import']('../api/openchannelAccount/openchannelAccount.model');db[_0x3ebd('0x54')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x55'));db[_0x3ebd('0x56')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x57'));db[_0x3ebd('0x58')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x59'));db[_0x3ebd('0x5a')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0x3ebd('0x5b')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/chatWebsite/chatWebsite.model');db[_0x3ebd('0x5c')]=db['sequelize'][_0x3ebd('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0x3ebd('0x5d')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x5e'));db[_0x3ebd('0x5f')]=db[_0x3ebd('0x3')]['import']('../api/chatInteraction/chatInteraction.model');db[_0x3ebd('0x60')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x61'));db[_0x3ebd('0x62')]=db[_0x3ebd('0x3')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/chatQueue/chatQueue.model');db[_0x3ebd('0x63')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x64'));db[_0x3ebd('0x65')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x66'));db['CmCompany']=db['sequelize'][_0x3ebd('0x13')]('../api/cmCompany/cmCompany.model');db[_0x3ebd('0x67')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x68'));db[_0x3ebd('0x69')]=db['sequelize']['import'](_0x3ebd('0x6a'));db[_0x3ebd('0x6b')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x6c'));db['CmHopperFinal']=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db['sequelize'][_0x3ebd('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x6d'));db[_0x3ebd('0x6e')]=db[_0x3ebd('0x3')]['import']('../api/cmCustomField/cmCustomField.model');db[_0x3ebd('0x6f')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x70'));db[_0x3ebd('0x71')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x72'));db[_0x3ebd('0x73')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x74'));db[_0x3ebd('0x75')]=db['sequelize']['import'](_0x3ebd('0x76'));db['Condition']=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0x77'));db[_0x3ebd('0x78')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x79'));db[_0x3ebd('0x7a')]=db['sequelize']['import'](_0x3ebd('0x7b'));db[_0x3ebd('0x7c')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x7d'));db[_0x3ebd('0x7e')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x7f'));db[_0x3ebd('0x80')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x81'));db[_0x3ebd('0x82')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x83'));db[_0x3ebd('0x84')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x85'));db['ContactItemType']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x86'));db['CmContactHasItem']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x87'));db['CmHopperAdditionalPhone']=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0x88'));db[_0x3ebd('0x89')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x8a'));db[_0x3ebd('0x8b')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x8c'));db[_0x3ebd('0x8d')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0x8e'));db[_0x3ebd('0x8f')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x90'));db[_0x3ebd('0x91')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x92'));db[_0x3ebd('0x93')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x3ebd('0x94')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x95'));db[_0x3ebd('0x96')]=db[_0x3ebd('0x3')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db[_0x3ebd('0x97')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x98'));db['AnalyticFieldReport']=db['sequelize']['import'](_0x3ebd('0x99'));db[_0x3ebd('0x9a')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x9b'));db['SalesforceAccount']=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x9c'));db['SalesforceConfiguration']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x9d'));db['SalesforceField']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x9e'));db[_0x3ebd('0x9f')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x3ebd('0xa0')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xa1'));db[_0x3ebd('0xa2')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xa3'));db[_0x3ebd('0xa4')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xa5'));db[_0x3ebd('0xa6')]=db[_0x3ebd('0x3')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db['DeskField']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xa7'));db[_0x3ebd('0xa8')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xa9'));db['ZohoConfiguration']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xaa'));db['ZohoField']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xab'));db[_0x3ebd('0xac')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x3ebd('0xad')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xae'));db[_0x3ebd('0xaf')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xb0'));db[_0x3ebd('0xb1')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0x3ebd('0xb2')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xb3'));db[_0x3ebd('0xb4')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xb5'));db[_0x3ebd('0xb6')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xb7'));db[_0x3ebd('0xb8')]=db['sequelize'][_0x3ebd('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x3ebd('0xb9')]=db['sequelize']['import']('../api/intVtigerField/intVtigerField.model');db[_0x3ebd('0xba')]=db['sequelize']['import'](_0x3ebd('0xbb'));db[_0x3ebd('0xbc')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xbd'));db[_0x3ebd('0xbe')]=db['sequelize'][_0x3ebd('0x13')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xbf'));db[_0x3ebd('0xc0')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xc1'));db[_0x3ebd('0xc2')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xc3'));db[_0x3ebd('0xc4')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xc5'));db[_0x3ebd('0xc6')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xc7'));db['FreshsalesField']=db['sequelize'][_0x3ebd('0x13')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x3ebd('0x8f')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/integration/integration.model');db['Network']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xc8'));db[_0x3ebd('0xc9')]=db['sequelize'][_0x3ebd('0x13')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xca'));db[_0x3ebd('0xcb')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xcc'));db[_0x3ebd('0xcd')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xce'));db['JscriptySessionReport']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xcf'));db[_0x3ebd('0xd0')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xd1'));db[_0x3ebd('0xd2')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/squareReport/squareReport.model');db[_0x3ebd('0xd3')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xd4'));db['JscriptyProject']=db['sequelize'][_0x3ebd('0x13')]('../api/jscriptyProject/jscriptyProject.model');db[_0x3ebd('0xd5')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xd6'));db['SquareOdbc']=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xd7'));db[_0x3ebd('0xd8')]=db[_0x3ebd('0x3')]['import']('../api/squareProject/squareProject.model');db[_0x3ebd('0xd9')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xda'));db[_0x3ebd('0xdb')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xdc'));db[_0x3ebd('0xdd')]=db['sequelize']['import'](_0x3ebd('0xde'));db['License']=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xdf'));db[_0x3ebd('0xe0')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xe1'));db['Migration']=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xe2'));db[_0x3ebd('0xe3')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/attachment/attachment.model');db[_0x3ebd('0xe4')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xe5'));db[_0x3ebd('0xe6')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xe7'));db[_0x3ebd('0xe8')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xe9'));db[_0x3ebd('0xea')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xeb'));db[_0x3ebd('0xec')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x3ebd('0xed')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/smsTransferReport/smsTransferReport.model');db[_0x3ebd('0xee')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xef'));db[_0x3ebd('0xf0')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/voicePrefix/voicePrefix.model');db[_0x3ebd('0xf1')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xf2'));db[_0x3ebd('0xf3')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')]('../api/userProfileSection/userProfileSection.model');db[_0x3ebd('0xf4')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xf5'));db[_0x3ebd('0xf6')]=db['sequelize'][_0x3ebd('0x13')]('../api/userNotification/userNotification.model');db[_0x3ebd('0xf7')]=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xf8'));db[_0x3ebd('0xf9')]=db['sequelize'][_0x3ebd('0x13')](_0x3ebd('0xfa'));db[_0x3ebd('0xfb')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xfc'));db['WhatsappMessage']=db[_0x3ebd('0x3')]['import'](_0x3ebd('0xfd'));db[_0x3ebd('0xfe')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0xff'));db[_0x3ebd('0x100')]=db['sequelize'][_0x3ebd('0x13')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0x3ebd('0x101')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x102'));db[_0x3ebd('0x103')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x104'));db[_0x3ebd('0x105')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x106'));db[_0x3ebd('0x107')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x108'));db['UserVoicePrefix']=db[_0x3ebd('0x3')]['import'](_0x3ebd('0x109'));db[_0x3ebd('0x10a')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x10b'));db[_0x3ebd('0x10c')]=db[_0x3ebd('0x3')][_0x3ebd('0x13')](_0x3ebd('0x10d'));db[_0x3ebd('0x10e')][_0x3ebd('0x10f')](db[_0x3ebd('0x110')],{'as':_0x3ebd('0x110'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x10f')](db[_0x3ebd('0x10a')],{'as':'userSetting','onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x112')});db['User'][_0x3ebd('0x113')](db[_0x3ebd('0x1a')],{'as':_0x3ebd('0x114'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db[_0x3ebd('0x28')],{'as':'VoiceQueuesRt','foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db[_0x3ebd('0x115')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db[_0x3ebd('0x116')],{'as':_0x3ebd('0x117'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db['CmHopperHistory'],{'as':_0x3ebd('0x118'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db['ReportAgentPreview'],{'as':_0x3ebd('0x119'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')]['hasMany'](db[_0x3ebd('0x56')],{'as':_0x3ebd('0x11a'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db['ChatInteraction'],{'as':_0x3ebd('0x11b'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db[_0x3ebd('0x4f')],{'as':_0x3ebd('0x11c'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')]['hasMany'](db[_0x3ebd('0x47')],{'as':_0x3ebd('0x11d'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db[_0x3ebd('0xfb')],{'as':_0x3ebd('0x11e'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x10e')][_0x3ebd('0x113')](db[_0x3ebd('0xf6')],{'as':'UserNotifications','foreignKey':_0x3ebd('0x11f')});db[_0x3ebd('0x10e')]['hasMany'](db[_0x3ebd('0x69')],{'as':'Hoppers','foreignKey':_0x3ebd('0x112'),'onDelete':'SET\x20NULL'});db['User']['belongsTo'](db[_0x3ebd('0xf1')],{'as':_0x3ebd('0xf1'),'foreignKey':_0x3ebd('0x120')});db[_0x3ebd('0x10e')]['belongsToMany'](db['ChatGroup'],{'as':_0x3ebd('0x121'),'through':_0x3ebd('0x122')});db[_0x3ebd('0x10e')]['belongsToMany'](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x123'),'through':_0x3ebd('0x124')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x126'),'through':_0x3ebd('0x127')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0xdd')],{'through':_0x3ebd('0x128')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x129')],{'as':_0x3ebd('0x12a'),'through':'user_has_mail_interactions'});db[_0x3ebd('0x10e')]['belongsToMany'](db[_0x3ebd('0x5f')],{'as':_0x3ebd('0x11b'),'through':_0x3ebd('0x12b')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x47')],{'as':'FaxInteractions','through':_0x3ebd('0x12c')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x4f')],{'as':_0x3ebd('0x11c'),'through':_0x3ebd('0x12d')});db['User']['belongsToMany'](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x3ebd('0x10e')]['belongsToMany'](db[_0x3ebd('0xfb')],{'as':'WhatsappInteractions','through':_0x3ebd('0x12e')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x19')],{'as':'VoiceQueues','through':_0x3ebd('0x12f'),'required':![]});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db['VoicePrefix'],{'as':_0x3ebd('0x130'),'through':_0x3ebd('0x131'),'required':![]});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x132')],{'as':_0x3ebd('0x133'),'through':_0x3ebd('0x2c'),'required':![]});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x134')],{'as':_0x3ebd('0x135'),'through':_0x3ebd('0x2b'),'required':![],'hooks':!![]});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x4b')],{'as':_0x3ebd('0x136'),'through':_0x3ebd('0x2e'),'required':![]});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db['SmsQueue'],{'as':_0x3ebd('0x137'),'through':'UserSmsQueue','required':![]});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db['OpenchannelQueue'],{'as':_0x3ebd('0x138'),'through':_0x3ebd('0x32'),'required':![]});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x101')],{'as':_0x3ebd('0x139'),'through':_0x3ebd('0x34'),'required':![]});db['User'][_0x3ebd('0x125')](db[_0x3ebd('0xee')],{'through':_0x3ebd('0x127')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db['ChatWebsite'],{'as':_0x3ebd('0x13a'),'through':_0x3ebd('0x13b')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db['FaxAccount'],{'as':_0x3ebd('0x13c'),'through':_0x3ebd('0x13d')});db['User'][_0x3ebd('0x125')](db[_0x3ebd('0x38')],{'as':_0x3ebd('0x13e'),'through':'user_has_mail_accounts'});db['User']['belongsToMany'](db[_0x3ebd('0x53')],{'as':'OpenchannelAccounts','through':_0x3ebd('0x13f')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0x140')],{'as':'SmsAccounts','through':_0x3ebd('0x141')});db[_0x3ebd('0x10e')][_0x3ebd('0x125')](db[_0x3ebd('0xf7')],{'as':_0x3ebd('0x142'),'through':_0x3ebd('0x143')});db[_0x3ebd('0x15')][_0x3ebd('0x113')](db[_0x3ebd('0x115')],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0x3ebd('0x144')});db[_0x3ebd('0x17')][_0x3ebd('0x113')](db[_0x3ebd('0x115')],{'onDelete':_0x3ebd('0x111')});db['VoiceExtension'][_0x3ebd('0x113')](db[_0x3ebd('0x115')],{'as':_0x3ebd('0x145'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x146')][_0x3ebd('0x125')](db['Sound'],{'as':_0x3ebd('0x147'),'through':_0x3ebd('0x148')});db[_0x3ebd('0x19')][_0x3ebd('0x113')](db[_0x3ebd('0x28')],{'as':_0x3ebd('0x149'),'foreignKey':_0x3ebd('0x14a')});db['VoiceQueue']['hasMany'](db['CmHopper'],{'as':_0x3ebd('0x14b'),'foreignKey':_0x3ebd('0x14a')});db[_0x3ebd('0x19')][_0x3ebd('0x113')](db[_0x3ebd('0x116')],{'as':_0x3ebd('0x117'),'foreignKey':'VoiceQueueId'});db[_0x3ebd('0x19')]['hasMany'](db[_0x3ebd('0x14c')],{'as':'HopperHistories','foreignKey':_0x3ebd('0x14a')});db[_0x3ebd('0x19')][_0x3ebd('0x113')](db[_0x3ebd('0x119')],{'as':_0x3ebd('0x119'),'foreignKey':'VoiceQueueId'});db[_0x3ebd('0x19')][_0x3ebd('0x113')](db[_0x3ebd('0x6b')],{'as':'HopperBlacks','foreignKey':_0x3ebd('0x14a')});db[_0x3ebd('0x19')][_0x3ebd('0x113')](db[_0x3ebd('0x14d')],{'as':'JscriptySessions','foreignKey':_0x3ebd('0x14a')});db[_0x3ebd('0x19')][_0x3ebd('0x14e')](db['Trunk'],{'as':_0x3ebd('0x26'),'foreignKey':_0x3ebd('0x14f')});db[_0x3ebd('0x19')][_0x3ebd('0x14e')](db[_0x3ebd('0x26')],{'as':_0x3ebd('0x150'),'foreignKey':_0x3ebd('0x151')});db[_0x3ebd('0x19')][_0x3ebd('0x14e')](db[_0x3ebd('0x78')],{'as':_0x3ebd('0x78'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x19')][_0x3ebd('0x14e')](db[_0x3ebd('0x7a')],{'as':_0x3ebd('0x153'),'foreignKey':_0x3ebd('0x154')});db[_0x3ebd('0x19')][_0x3ebd('0x125')](db[_0x3ebd('0xee')],{'as':'Lists','through':_0x3ebd('0x155')});db['VoiceQueue'][_0x3ebd('0x125')](db['User'],{'as':'Agents','through':'UserVoiceQueue'});db['VoiceQueue']['belongsToMany'](db[_0x3ebd('0xdd')],{'as':_0x3ebd('0x156'),'through':_0x3ebd('0x105')});db['VoiceQueue'][_0x3ebd('0x125')](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x157'),'through':_0x3ebd('0x158')});db[_0x3ebd('0x1a')]['belongsTo'](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x10e'),'foreignKey':'UserId'});db['ScreenRecording'][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x10e'),'foreignKey':'UserId'});db[_0x3ebd('0x110')][_0x3ebd('0x113')](db[_0x3ebd('0x159')],{'as':_0x3ebd('0x15a'),'onDelete':'cascade','foreignKey':'mailboxuser','sourceKey':_0x3ebd('0x15b')});db[_0x3ebd('0x159')]['belongsTo'](db[_0x3ebd('0x110')],{'foreignKey':'mailboxuser','targetKey':_0x3ebd('0x15b')});db['VoiceCallReport']['hasMany'](db['VoiceQueueReport'],{'as':_0x3ebd('0x15c'),'foreignKey':_0x3ebd('0x15d'),'constraints':![]});db[_0x3ebd('0x1e')][_0x3ebd('0x113')](db[_0x3ebd('0x22')],{'as':'AgentReports','foreignKey':_0x3ebd('0x15d'),'constraints':![]});db[_0x3ebd('0x1e')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x10e'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x1e')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':'Contact','foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x35')][_0x3ebd('0x14e')](db[_0x3ebd('0x38')],{'as':_0x3ebd('0x38'),'foreignKey':_0x3ebd('0x15f')});db[_0x3ebd('0x35')][_0x3ebd('0x14e')](db[_0x3ebd('0x103')],{'as':_0x3ebd('0x103'),'foreignKey':'CloudProviderId','onDelete':_0x3ebd('0x160')});db['MailServerOut'][_0x3ebd('0x14e')](db[_0x3ebd('0x38')],{'as':'MailAccount','foreignKey':_0x3ebd('0x15f')});db[_0x3ebd('0x161')][_0x3ebd('0x14e')](db[_0x3ebd('0x103')],{'as':_0x3ebd('0x103'),'foreignKey':_0x3ebd('0x162'),'onDelete':_0x3ebd('0x160')});db['MailAccount'][_0x3ebd('0x10f')](db[_0x3ebd('0x35')],{'as':_0x3ebd('0x163'),'onDelete':_0x3ebd('0x111')});db['MailAccount']['hasOne'](db[_0x3ebd('0x161')],{'as':_0x3ebd('0x164'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x38')][_0x3ebd('0x113')](db[_0x3ebd('0x75')],{'as':_0x3ebd('0x165'),'foreignKey':_0x3ebd('0x15f'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x38')][_0x3ebd('0x113')](db[_0x3ebd('0x73')],{'as':'Answers','foreignKey':'MailAccountId'});db[_0x3ebd('0x38')][_0x3ebd('0x113')](db[_0x3ebd('0x3e')],{'as':_0x3ebd('0x15a'),'foreignKey':_0x3ebd('0x15f')});db['MailAccount']['hasMany'](db[_0x3ebd('0x129')],{'as':_0x3ebd('0x166')});db['MailAccount'][_0x3ebd('0x113')](db[_0x3ebd('0x167')],{'as':_0x3ebd('0x145'),'foreignKey':_0x3ebd('0x15f'),'onDelete':'cascade'});db[_0x3ebd('0x38')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x168'),'foreignKey':'ListId'});db[_0x3ebd('0x38')][_0x3ebd('0x14e')](db[_0x3ebd('0x89')],{'as':'Template','foreignKey':_0x3ebd('0x169')});db[_0x3ebd('0x38')]['belongsTo'](db[_0x3ebd('0x7a')],{'as':_0x3ebd('0x153'),'foreignKey':_0x3ebd('0x154')});db[_0x3ebd('0x38')]['belongsToMany'](db['User'],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x16b')});db[_0x3ebd('0x132')]['belongsToMany'](db[_0x3ebd('0x10e')],{'as':'Agents','through':_0x3ebd('0x2c')});db['MailQueue'][_0x3ebd('0x125')](db[_0x3ebd('0xdd')],{'through':_0x3ebd('0x16c'),'as':_0x3ebd('0x156')});db['MailInteraction'][_0x3ebd('0x113')](db['MailMessage'],{'as':_0x3ebd('0x15a'),'onDelete':_0x3ebd('0x111'),'foreignKey':'MailInteractionId'});db['MailInteraction'][_0x3ebd('0x14e')](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db[_0x3ebd('0x129')][_0x3ebd('0x14e')](db['CmContact'],{'as':_0x3ebd('0x16d'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x129')][_0x3ebd('0x14e')](db['User'],{'as':_0x3ebd('0x16e'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x129')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x16f'),'as':'Tags'});db[_0x3ebd('0x129')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x16f'),'as':_0x3ebd('0x170')});db[_0x3ebd('0x129')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x171'),'through':_0x3ebd('0x172'),'foreignKey':_0x3ebd('0x173')});db[_0x3ebd('0x3e')][_0x3ebd('0x113')](db[_0x3ebd('0xe3')],{'as':_0x3ebd('0x174'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x3e')][_0x3ebd('0x14e')](db['User'],{'as':'User'});db['MailMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x16d')});db[_0x3ebd('0x3e')]['belongsTo'](db[_0x3ebd('0x129')],{'as':_0x3ebd('0x175'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0x38')],{'as':_0x3ebd('0x176'),'foreignKey':'MailAccountId'});db[_0x3ebd('0x3e')][_0x3ebd('0x14e')](db[_0x3ebd('0x5b')],{'as':_0x3ebd('0x5b'),'foreignKey':_0x3ebd('0x177')});db[_0x3ebd('0x3e')]['belongsTo'](db['ChatOfflineMessage'],{'as':_0x3ebd('0x62'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x3ebd('0x14e')](db['User'],{'onDelete':_0x3ebd('0x160')});db['MailApplication'][_0x3ebd('0x14e')](db[_0x3ebd('0x132')],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x167')][_0x3ebd('0x14e')](db['MailAccount'],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x167')][_0x3ebd('0x14e')](db[_0x3ebd('0x78')],{'onDelete':_0x3ebd('0x160'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x167')][_0x3ebd('0x14e')](db[_0x3ebd('0x84')],{'onDelete':_0x3ebd('0x160'),'foreignKey':'TagId'});db[_0x3ebd('0x178')][_0x3ebd('0x14e')](db[_0x3ebd('0x38')],{});db[_0x3ebd('0x178')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x168'),'foreignKey':_0x3ebd('0x179')});db[_0x3ebd('0x178')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':'Contact','foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x178')][_0x3ebd('0x14e')](db[_0x3ebd('0x129')],{});db[_0x3ebd('0x178')][_0x3ebd('0x14e')](db['MailMessage'],{});db[_0x3ebd('0x178')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{});db[_0x3ebd('0x178')]['belongsTo'](db[_0x3ebd('0x132')],{});db[_0x3ebd('0x41')][_0x3ebd('0x113')](db[_0x3ebd('0x43')],{'as':_0x3ebd('0x17a'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x44')][_0x3ebd('0x113')](db[_0x3ebd('0x75')],{'as':'Dispositions','foreignKey':'FaxAccountId','onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x44')]['hasMany'](db[_0x3ebd('0x73')],{'as':_0x3ebd('0x17b'),'foreignKey':_0x3ebd('0x17c')});db[_0x3ebd('0x44')]['hasMany'](db[_0x3ebd('0x47')],{'as':_0x3ebd('0x166')});db[_0x3ebd('0x44')][_0x3ebd('0x113')](db[_0x3ebd('0x45')],{'as':'Applications','foreignKey':_0x3ebd('0x17c'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x44')][_0x3ebd('0x113')](db[_0x3ebd('0x115')],{'as':_0x3ebd('0x17d'),'onDelete':'cascade'});db['FaxAccount'][_0x3ebd('0x113')](db[_0x3ebd('0x49')],{'as':_0x3ebd('0x15a')});db[_0x3ebd('0x44')][_0x3ebd('0x14e')](db[_0x3ebd('0x26')],{'as':_0x3ebd('0x26')});db['FaxAccount'][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x168'),'foreignKey':'ListId'});db[_0x3ebd('0x44')]['belongsTo'](db[_0x3ebd('0x7a')],{'as':_0x3ebd('0x153'),'foreignKey':_0x3ebd('0x154')});db[_0x3ebd('0x44')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':'Agents','through':_0x3ebd('0x13d')});db[_0x3ebd('0x45')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x45')][_0x3ebd('0x14e')](db[_0x3ebd('0x4b')],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x45')][_0x3ebd('0x14e')](db['FaxAccount'],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x45')]['belongsTo'](db[_0x3ebd('0x84')],{'onDelete':'restrict','foreignKey':_0x3ebd('0x17e')});db[_0x3ebd('0x47')][_0x3ebd('0x113')](db[_0x3ebd('0x49')],{'as':_0x3ebd('0x15a'),'onDelete':_0x3ebd('0x111'),'foreignKey':'FaxInteractionId'});db['FaxInteraction'][_0x3ebd('0x14e')](db[_0x3ebd('0x44')],{'as':_0x3ebd('0x176'),'foreignKey':'FaxAccountId'});db[_0x3ebd('0x47')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x16d'),'foreignKey':'ContactId'});db[_0x3ebd('0x47')][_0x3ebd('0x14e')](db['User'],{'as':_0x3ebd('0x16e'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x47')][_0x3ebd('0x125')](db['Tag'],{'through':_0x3ebd('0x17f'),'as':'Tags'});db[_0x3ebd('0x47')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':'fax_interaction_has_tags','as':_0x3ebd('0x170')});db[_0x3ebd('0x47')][_0x3ebd('0x125')](db['User'],{'as':'Users','through':'user_has_fax_interactions','foreignKey':_0x3ebd('0x180')});db[_0x3ebd('0x49')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x10e')});db[_0x3ebd('0x49')][_0x3ebd('0x14e')](db[_0x3ebd('0x47')],{'as':_0x3ebd('0x175'),'foreignKey':_0x3ebd('0x180')});db['FaxMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x16d')});db['FaxMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0xe3')],{'as':_0x3ebd('0xe3'),'foreignKey':_0x3ebd('0x181')});db[_0x3ebd('0x49')]['belongsTo'](db[_0x3ebd('0x44')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x17c')});db[_0x3ebd('0x4b')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x2e')});db[_0x3ebd('0x4b')]['belongsToMany'](db[_0x3ebd('0xdd')],{'through':'team_has_fax_queues','as':'Teams'});db[_0x3ebd('0x182')]['belongsTo'](db['FaxAccount'],{});db[_0x3ebd('0x182')][_0x3ebd('0x14e')](db['CmList'],{'as':_0x3ebd('0x168'),'foreignKey':_0x3ebd('0x179')});db[_0x3ebd('0x182')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':'Contact','foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x182')][_0x3ebd('0x14e')](db['FaxInteraction'],{});db[_0x3ebd('0x182')][_0x3ebd('0x14e')](db[_0x3ebd('0x49')],{});db[_0x3ebd('0x182')][_0x3ebd('0x14e')](db['User'],{});db[_0x3ebd('0x182')][_0x3ebd('0x14e')](db['FaxQueue'],{});db[_0x3ebd('0x140')]['hasMany'](db[_0x3ebd('0x75')],{'as':'Dispositions','foreignKey':_0x3ebd('0x183'),'onDelete':_0x3ebd('0x111')});db['SmsAccount'][_0x3ebd('0x113')](db[_0x3ebd('0x73')],{'as':_0x3ebd('0x17b'),'foreignKey':'SmsAccountId'});db[_0x3ebd('0x140')][_0x3ebd('0x113')](db['SmsMessage'],{'as':_0x3ebd('0x15a'),'foreignKey':_0x3ebd('0x183')});db[_0x3ebd('0x140')][_0x3ebd('0x113')](db[_0x3ebd('0x4f')],{'as':_0x3ebd('0x166')});db[_0x3ebd('0x140')][_0x3ebd('0x113')](db[_0x3ebd('0x4e')],{'as':_0x3ebd('0x145'),'foreignKey':_0x3ebd('0x183'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x140')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':'List','foreignKey':_0x3ebd('0x179')});db[_0x3ebd('0x140')][_0x3ebd('0x14e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x141')});db['SmsApplication'][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x4e')][_0x3ebd('0x14e')](db[_0x3ebd('0x52')],{'onDelete':'restrict'});db[_0x3ebd('0x4e')][_0x3ebd('0x14e')](db['SmsAccount'],{'onDelete':_0x3ebd('0x160')});db['SmsApplication'][_0x3ebd('0x14e')](db['Interval'],{'onDelete':_0x3ebd('0x160'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x4e')][_0x3ebd('0x14e')](db[_0x3ebd('0x84')],{'onDelete':_0x3ebd('0x160'),'foreignKey':_0x3ebd('0x17e')});db[_0x3ebd('0x4f')][_0x3ebd('0x113')](db['SmsMessage'],{'as':'Messages','onDelete':_0x3ebd('0x111'),'foreignKey':'SmsInteractionId'});db[_0x3ebd('0x4f')]['belongsTo'](db[_0x3ebd('0x140')],{'as':'Account','foreignKey':_0x3ebd('0x183')});db[_0x3ebd('0x4f')]['belongsTo'](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x16d'),'foreignKey':'ContactId'});db[_0x3ebd('0x4f')]['belongsTo'](db['User'],{'as':_0x3ebd('0x16e'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x4f')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x184'),'as':_0x3ebd('0x185')});db[_0x3ebd('0x4f')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x184'),'as':'ThroughTags'});db[_0x3ebd('0x4f')][_0x3ebd('0x125')](db['User'],{'as':_0x3ebd('0x171'),'through':_0x3ebd('0x12d'),'foreignKey':'SmsInteractionId'});db[_0x3ebd('0x51')][_0x3ebd('0x14e')](db['User'],{'as':_0x3ebd('0x10e')});db[_0x3ebd('0x51')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x16d')});db['SmsMessage'][_0x3ebd('0x14e')](db['SmsInteraction'],{'onDelete':_0x3ebd('0x111'),'as':'Interaction','foreignKey':'SmsInteractionId'});db['SmsMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0x140')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x183')});db['SmsQueue'][_0x3ebd('0x125')](db['User'],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x30'),'foreignKey':'SmsQueueId'});db[_0x3ebd('0x52')][_0x3ebd('0x125')](db['Team'],{'through':'team_has_sms_queues','as':'Teams'});db[_0x3ebd('0x53')]['hasMany'](db[_0x3ebd('0x75')],{'as':_0x3ebd('0x165'),'foreignKey':'OpenchannelAccountId','onDelete':_0x3ebd('0x111')});db['OpenchannelAccount'][_0x3ebd('0x113')](db[_0x3ebd('0x73')],{'as':'Answers','foreignKey':'OpenchannelAccountId'});db[_0x3ebd('0x53')][_0x3ebd('0x113')](db[_0x3ebd('0x56')],{'as':_0x3ebd('0x166'),'foreignKey':'OpenchannelAccountId'});db[_0x3ebd('0x53')][_0x3ebd('0x113')](db[_0x3ebd('0x58')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x3ebd('0x113')](db[_0x3ebd('0x54')],{'as':_0x3ebd('0x145'),'foreignKey':_0x3ebd('0x186'),'onDelete':_0x3ebd('0x111')});db['OpenchannelAccount'][_0x3ebd('0x14e')](db['CmList'],{'as':_0x3ebd('0x168'),'foreignKey':_0x3ebd('0x179')});db['OpenchannelAccount'][_0x3ebd('0x14e')](db[_0x3ebd('0x7a')],{'as':_0x3ebd('0x153'),'foreignKey':_0x3ebd('0x154')});db[_0x3ebd('0x53')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x16a'),'through':'user_has_openchannel_accounts'});db[_0x3ebd('0x54')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x54')][_0x3ebd('0x14e')](db['OpenchannelQueue'],{'onDelete':_0x3ebd('0x160'),'foreignKey':_0x3ebd('0x187')});db[_0x3ebd('0x54')][_0x3ebd('0x14e')](db[_0x3ebd('0x53')],{'onDelete':_0x3ebd('0x160'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication']['belongsTo'](db[_0x3ebd('0x78')],{'onDelete':'restrict','foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x54')][_0x3ebd('0x14e')](db[_0x3ebd('0x84')],{'onDelete':'restrict','foreignKey':_0x3ebd('0x17e')});db[_0x3ebd('0x56')]['hasMany'](db[_0x3ebd('0x58')],{'as':'Messages','onDelete':_0x3ebd('0x111'),'foreignKey':'OpenchannelInteractionId'});db[_0x3ebd('0x56')][_0x3ebd('0x14e')](db['OpenchannelAccount'],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x186')});db[_0x3ebd('0x56')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':'Contact','foreignKey':_0x3ebd('0x15e')});db['OpenchannelInteraction']['belongsTo'](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x16e'),'foreignKey':_0x3ebd('0x112')});db[_0x3ebd('0x56')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x188'),'as':'Tags'});db[_0x3ebd('0x56')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x188'),'as':_0x3ebd('0x170')});db[_0x3ebd('0x56')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x171'),'through':'user_has_openchannel_interactions','foreignKey':_0x3ebd('0x189')});db[_0x3ebd('0x58')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x111'),'as':'User'});db[_0x3ebd('0x58')]['belongsTo'](db[_0x3ebd('0x67')],{'onDelete':_0x3ebd('0x111'),'as':'Contact'});db['OpenchannelMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0x56')],{'onDelete':'cascade','as':_0x3ebd('0x175'),'foreignKey':_0x3ebd('0x189')});db[_0x3ebd('0x58')][_0x3ebd('0x14e')](db[_0x3ebd('0xe3')],{'as':'Attachment','foreignKey':_0x3ebd('0x181')});db[_0x3ebd('0x58')][_0x3ebd('0x14e')](db[_0x3ebd('0x53')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x186')});db[_0x3ebd('0x5a')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':'Agents','through':_0x3ebd('0x32'),'foreignKey':_0x3ebd('0x187')});db['OpenchannelQueue'][_0x3ebd('0x125')](db[_0x3ebd('0xdd')],{'through':_0x3ebd('0x18a'),'as':_0x3ebd('0x156')});db[_0x3ebd('0x5b')]['hasMany'](db[_0x3ebd('0x75')],{'as':_0x3ebd('0x165'),'foreignKey':_0x3ebd('0x177'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x5b')]['hasMany'](db[_0x3ebd('0x73')],{'as':_0x3ebd('0x17b'),'foreignKey':_0x3ebd('0x177')});db[_0x3ebd('0x5b')]['hasMany'](db['ChatProactiveAction'],{'as':_0x3ebd('0x18b')});db['ChatWebsite'][_0x3ebd('0x113')](db[_0x3ebd('0x5f')],{'as':_0x3ebd('0x166')});db[_0x3ebd('0x5b')]['hasMany'](db['ChatApplication'],{'as':_0x3ebd('0x145'),'foreignKey':_0x3ebd('0x177'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x5b')][_0x3ebd('0x113')](db[_0x3ebd('0x60')],{'as':_0x3ebd('0x15a')});db[_0x3ebd('0x5b')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':'List','foreignKey':_0x3ebd('0x179')});db[_0x3ebd('0x5b')][_0x3ebd('0x14e')](db[_0x3ebd('0x78')],{'as':_0x3ebd('0x78'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x5b')][_0x3ebd('0x14e')](db[_0x3ebd('0x38')],{'as':_0x3ebd('0x38'),'foreignKey':_0x3ebd('0x15f')});db[_0x3ebd('0x5b')][_0x3ebd('0x14e')](db[_0x3ebd('0x7a')],{'as':_0x3ebd('0x153'),'foreignKey':_0x3ebd('0x154')});db['ChatWebsite']['belongsToMany'](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x13b')});db[_0x3ebd('0x5c')][_0x3ebd('0x14e')](db['OpenchannelAccount'],{});db[_0x3ebd('0x5c')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':'List','foreignKey':_0x3ebd('0x179')});db['OpenchannelQueueReport'][_0x3ebd('0x14e')](db['CmContact'],{'as':'Contact','foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x5c')][_0x3ebd('0x14e')](db[_0x3ebd('0x56')],{});db['OpenchannelQueueReport']['belongsTo'](db['OpenchannelMessage'],{});db['OpenchannelQueueReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{});db[_0x3ebd('0x5c')][_0x3ebd('0x14e')](db[_0x3ebd('0x5a')],{});db['ChatApplication'][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x18c'),'foreignKey':_0x3ebd('0x112'),'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x5d')][_0x3ebd('0x14e')](db[_0x3ebd('0x134')],{'as':_0x3ebd('0x18d'),'foreignKey':_0x3ebd('0x18e'),'onDelete':_0x3ebd('0x160')});db['ChatApplication'][_0x3ebd('0x14e')](db[_0x3ebd('0x5b')],{'as':_0x3ebd('0x18f'),'foreignKey':'ChatWebsiteId','onDelete':_0x3ebd('0x160')});db['ChatApplication'][_0x3ebd('0x14e')](db[_0x3ebd('0x84')],{'onDelete':_0x3ebd('0x160'),'foreignKey':'TagId'});db[_0x3ebd('0x5f')][_0x3ebd('0x113')](db[_0x3ebd('0x60')],{'as':'Messages','onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x190')});db['ChatInteraction'][_0x3ebd('0x14e')](db[_0x3ebd('0x5b')],{'as':_0x3ebd('0x176'),'foreignKey':'ChatWebsiteId'});db[_0x3ebd('0x5f')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x16d'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x5f')][_0x3ebd('0x14e')](db['User'],{'as':_0x3ebd('0x16e'),'foreignKey':_0x3ebd('0x112')});db['ChatInteraction']['belongsToMany'](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x191'),'as':_0x3ebd('0x185')});db[_0x3ebd('0x5f')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x191'),'as':_0x3ebd('0x170')});db[_0x3ebd('0x5f')][_0x3ebd('0x125')](db['User'],{'as':_0x3ebd('0x171'),'through':_0x3ebd('0x12b'),'foreignKey':_0x3ebd('0x190')});db[_0x3ebd('0x60')][_0x3ebd('0x14e')](db['User'],{'onDelete':'cascade','as':_0x3ebd('0x10e')});db[_0x3ebd('0x60')]['belongsTo'](db[_0x3ebd('0x67')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x16d'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x60')][_0x3ebd('0x14e')](db[_0x3ebd('0x5f')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x175'),'foreignKey':_0x3ebd('0x190')});db[_0x3ebd('0x60')][_0x3ebd('0x14e')](db[_0x3ebd('0xe3')],{'as':_0x3ebd('0xe3'),'foreignKey':_0x3ebd('0x181')});db['ChatMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0x5b')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x177')});db[_0x3ebd('0x62')][_0x3ebd('0x113')](db['Attachment'],{'as':_0x3ebd('0x174'),'foreignKey':_0x3ebd('0x192'),'onDelete':_0x3ebd('0x111'),'hooks':!![]});db[_0x3ebd('0x62')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'onDelete':'cascade','as':_0x3ebd('0x16d'),'foreignKey':_0x3ebd('0x15e')});db['ChatOfflineMessage'][_0x3ebd('0x14e')](db[_0x3ebd('0x5b')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x177')});db[_0x3ebd('0x134')][_0x3ebd('0x125')](db['User'],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x2b'),'hooks':!![]});db[_0x3ebd('0x134')][_0x3ebd('0x125')](db[_0x3ebd('0xdd')],{'through':_0x3ebd('0x193'),'as':_0x3ebd('0x156')});db[_0x3ebd('0x63')][_0x3ebd('0x113')](db['ChatInternalMessage'],{'as':_0x3ebd('0x15a'),'foreignKey':_0x3ebd('0x194'),'onDelete':'cascade'});db[_0x3ebd('0x63')]['belongsToMany'](db[_0x3ebd('0x10e')],{'as':'Members','through':_0x3ebd('0x122')});db[_0x3ebd('0x65')][_0x3ebd('0x14e')](db[_0x3ebd('0x5b')],{'as':_0x3ebd('0x18f'),'foreignKey':_0x3ebd('0x177')});db['CmCompany']['hasMany'](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x123'),'foreignKey':'CompanyId'});db[_0x3ebd('0x67')][_0x3ebd('0x113')](db['CmContactHasItem'],{'as':_0x3ebd('0x195'),'foreignKey':_0x3ebd('0x196')});db[_0x3ebd('0x67')][_0x3ebd('0x113')](db[_0x3ebd('0x69')],{'as':_0x3ebd('0x14b'),'foreignKey':'ContactId'});db[_0x3ebd('0x67')]['hasMany'](db['CmHopperFinal'],{'as':_0x3ebd('0x117'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x67')]['hasMany'](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x67')][_0x3ebd('0x113')](db[_0x3ebd('0x119')],{'as':_0x3ebd('0x119'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x67')][_0x3ebd('0x113')](db[_0x3ebd('0x14d')],{'as':_0x3ebd('0x197'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0x67')]['hasMany'](db[_0x3ebd('0x56')],{'as':_0x3ebd('0x11a'),'foreignKey':_0x3ebd('0x15e'),'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x67')]['hasMany'](db[_0x3ebd('0x5f')],{'as':_0x3ebd('0x11b'),'foreignKey':_0x3ebd('0x15e'),'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x67')][_0x3ebd('0x113')](db[_0x3ebd('0x4f')],{'as':'SmsInteractions','foreignKey':_0x3ebd('0x15e'),'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x67')][_0x3ebd('0x113')](db['FaxInteraction'],{'as':_0x3ebd('0x11d'),'foreignKey':'ContactId','onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x67')][_0x3ebd('0x113')](db['MailInteraction'],{'as':_0x3ebd('0x12a'),'foreignKey':_0x3ebd('0x15e'),'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x67')][_0x3ebd('0x14e')](db[_0x3ebd('0x198')],{'as':_0x3ebd('0x199'),'foreignKey':_0x3ebd('0x19a')});db[_0x3ebd('0x67')][_0x3ebd('0x14e')](db['CmList'],{'as':_0x3ebd('0x168'),'foreignKey':'ListId','onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x67')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':'Users','through':'cm_user_has_contacts'});db['CmContact'][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'as':_0x3ebd('0x185'),'through':_0x3ebd('0x19b')});db[_0x3ebd('0x67')]['belongsToMany'](db['Tag'],{'through':_0x3ebd('0x19b'),'as':'ThroughTags'});db[_0x3ebd('0x69')][_0x3ebd('0x113')](db[_0x3ebd('0x19c')],{'as':'AdditionalPhones','foreignKey':_0x3ebd('0x19d')});db[_0x3ebd('0x69')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x16d'),'foreignKey':'ContactId','onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x69')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':'List','foreignKey':'ListId','onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x69')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'as':'Agent','foreignKey':'UserId'});db[_0x3ebd('0x69')][_0x3ebd('0x14e')](db['VoiceQueue'],{'as':_0x3ebd('0x18d'),'foreignKey':_0x3ebd('0x14a'),'onDelete':_0x3ebd('0x111')});db['CmHopper'][_0x3ebd('0x14e')](db[_0x3ebd('0xe0')],{'as':_0x3ebd('0xe0'),'foreignKey':_0x3ebd('0x19e'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0x69')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x16e'),'foreignKey':_0x3ebd('0x19f')});db[_0x3ebd('0x6b')]['belongsTo'](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x16d'),'foreignKey':'ContactId','onDelete':_0x3ebd('0x111')});db['CmHopperBlack']['belongsTo'](db[_0x3ebd('0xee')],{'as':'List','foreignKey':_0x3ebd('0x179'),'onDelete':'cascade'});db[_0x3ebd('0x6b')][_0x3ebd('0x14e')](db[_0x3ebd('0x19')],{'as':_0x3ebd('0x18d'),'foreignKey':_0x3ebd('0x14a'),'onDelete':_0x3ebd('0x111')});db['CmHopperBlack']['belongsTo'](db[_0x3ebd('0xe0')],{'as':_0x3ebd('0xe0'),'foreignKey':_0x3ebd('0x19e'),'onDelete':'cascade'});db[_0x3ebd('0x71')][_0x3ebd('0x113')](db['Condition'],{'as':{'plural':_0x3ebd('0x1a0'),'singular':_0x3ebd('0x1a1')},'foreignKey':'AutomationAllId','onDelete':_0x3ebd('0x111'),'hooks':!![]});db[_0x3ebd('0x71')][_0x3ebd('0x113')](db['Condition'],{'as':{'plural':_0x3ebd('0x1a2'),'singular':_0x3ebd('0x1a3')},'foreignKey':_0x3ebd('0x1a4'),'onDelete':_0x3ebd('0x111'),'hooks':!![]});db['Automation'][_0x3ebd('0x113')](db['Action'],{'as':_0x3ebd('0x1a5'),'foreignKey':_0x3ebd('0x1a6'),'onDelete':_0x3ebd('0x111'),'hooks':!![]});db[_0x3ebd('0x75')][_0x3ebd('0x113')](db[_0x3ebd('0x75')],{'as':'Dispositions','foreignKey':_0x3ebd('0x1a7'),'onDelete':'cascade'});db[_0x3ebd('0x78')][_0x3ebd('0x113')](db['Interval'],{'as':_0x3ebd('0x1a8'),'foreignKey':_0x3ebd('0x152'),'onDelete':_0x3ebd('0x111'),'hooks':!![],'required':![]});db[_0x3ebd('0x78')]['hasMany'](db[_0x3ebd('0x115')],{'as':_0x3ebd('0x1a9'),'foreignKey':_0x3ebd('0x152'),'onDelete':_0x3ebd('0x160')});db['Interval']['hasMany'](db['MailApplication'],{'as':'MailApplications','foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x78')]['hasMany'](db['ChatApplication'],{'as':_0x3ebd('0x1aa'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x78')][_0x3ebd('0x113')](db[_0x3ebd('0x45')],{'as':'FaxApplications','foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x78')]['hasMany'](db[_0x3ebd('0x4e')],{'as':_0x3ebd('0x1ab'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0x80')][_0x3ebd('0x14e')](db[_0x3ebd('0x38')],{});db[_0x3ebd('0x80')][_0x3ebd('0x14e')](db[_0x3ebd('0x94')],{'foreignKey':_0x3ebd('0x1ac')});db[_0x3ebd('0x80')][_0x3ebd('0x14e')](db[_0x3ebd('0x93')],{'foreignKey':_0x3ebd('0x1ad')});db[_0x3ebd('0x82')][_0x3ebd('0x125')](db[_0x3ebd('0x146')],{'as':_0x3ebd('0x1ae'),'through':'moh_has_sounds','onDelete':_0x3ebd('0x160')});db['Tag']['belongsToMany'](db[_0x3ebd('0x67')],{'through':'cm_contact_has_tags'});db[_0x3ebd('0x84')][_0x3ebd('0x125')](db[_0x3ebd('0x5f')],{'through':_0x3ebd('0x191')});db[_0x3ebd('0x84')][_0x3ebd('0x125')](db[_0x3ebd('0x129')],{'through':'mail_interaction_has_tags'});db[_0x3ebd('0x84')][_0x3ebd('0x125')](db[_0x3ebd('0x4f')],{'through':_0x3ebd('0x184')});db[_0x3ebd('0x84')]['belongsToMany'](db[_0x3ebd('0x47')],{'through':_0x3ebd('0x17f')});db[_0x3ebd('0x84')][_0x3ebd('0x125')](db['OpenchannelInteraction'],{'through':_0x3ebd('0x188')});db[_0x3ebd('0x84')][_0x3ebd('0x125')](db[_0x3ebd('0xfb')],{'through':_0x3ebd('0x1af')});db[_0x3ebd('0x1b0')]['belongsTo'](db[_0x3ebd('0x1b1')],{'as':'ItemType','foreignKey':'ItemTypeId'});db[_0x3ebd('0x19c')][_0x3ebd('0x14e')](db['CmHopper'],{'as':_0x3ebd('0x1b2'),'foreignKey':_0x3ebd('0x19d')});db[_0x3ebd('0x1b0')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':'Contact','foreignKey':'CmContactId'});db['Trigger'][_0x3ebd('0x113')](db['Condition'],{'as':{'plural':_0x3ebd('0x1b3'),'singular':_0x3ebd('0x1b4')},'foreignKey':_0x3ebd('0x1b5'),'onDelete':_0x3ebd('0x111'),'hooks':!![]});db[_0x3ebd('0x8b')][_0x3ebd('0x113')](db[_0x3ebd('0x1b6')],{'as':{'plural':_0x3ebd('0x1b7'),'singular':_0x3ebd('0x1b8')},'foreignKey':_0x3ebd('0x1b9'),'onDelete':_0x3ebd('0x111'),'hooks':!![]});db[_0x3ebd('0x8b')][_0x3ebd('0x113')](db[_0x3ebd('0x6f')],{'as':_0x3ebd('0x1a5'),'foreignKey':_0x3ebd('0x1ba'),'onDelete':_0x3ebd('0x111'),'hooks':!![]});db[_0x3ebd('0x93')][_0x3ebd('0x113')](db[_0x3ebd('0x1bb')],{'as':_0x3ebd('0x1bc'),'onDelete':_0x3ebd('0x111'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x3ebd('0x94')][_0x3ebd('0x113')](db[_0x3ebd('0x1bb')],{'as':'Fields','onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1ac')});db['AnalyticMetric'][_0x3ebd('0x113')](db[_0x3ebd('0x1bb')],{'as':'Fields','onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1bd')});db[_0x3ebd('0x1bb')][_0x3ebd('0x14e')](db['AnalyticMetric'],{'foreignKey':_0x3ebd('0x1bd')});db['SalesforceAccount']['hasMany'](db[_0x3ebd('0x1be')],{'as':_0x3ebd('0x1bf'),'onDelete':'cascade','foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0x1be')][_0x3ebd('0x113')](db['SalesforceField'],{'as':_0x3ebd('0x1c1'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0x1be')][_0x3ebd('0x113')](db['SalesforceField'],{'as':_0x3ebd('0x1c3'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0x1be')][_0x3ebd('0x113')](db[_0x3ebd('0x1c5')],{'as':_0x3ebd('0x1bc'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0x1be')][_0x3ebd('0x14e')](db[_0x3ebd('0x1c7')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0x1c5')][_0x3ebd('0x113')](db[_0x3ebd('0x1c5')],{'as':_0x3ebd('0x1c8'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0x1c5')][_0x3ebd('0x113')](db[_0x3ebd('0x1c5')],{'as':_0x3ebd('0x1c9'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0x1c5')]['hasMany'](db[_0x3ebd('0x1c5')],{'as':_0x3ebd('0x1ca'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0x1c5')][_0x3ebd('0x14e')](db['Variable'],{'as':_0x3ebd('0x8d'),'foreignKey':'VariableId'});db['SugarcrmAccount']['hasMany'](db['SugarcrmConfiguration'],{'as':_0x3ebd('0x1bf'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c0')});db['SugarcrmConfiguration'][_0x3ebd('0x113')](db[_0x3ebd('0xa2')],{'as':_0x3ebd('0x1c1'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xa0')][_0x3ebd('0x113')](db[_0x3ebd('0xa2')],{'as':_0x3ebd('0x1c3'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c4')});db['SugarcrmConfiguration'][_0x3ebd('0x113')](db[_0x3ebd('0xa2')],{'as':_0x3ebd('0x1bc'),'onDelete':'cascade','foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xa0')][_0x3ebd('0x14e')](db['SugarcrmAccount'],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xa2')]['hasMany'](db[_0x3ebd('0xa2')],{'as':_0x3ebd('0x1c8'),'foreignKey':'SubjectId'});db[_0x3ebd('0xa2')][_0x3ebd('0x113')](db[_0x3ebd('0xa2')],{'as':'Description','foreignKey':'DescriptionId'});db[_0x3ebd('0xa2')][_0x3ebd('0x113')](db['SugarcrmField'],{'as':_0x3ebd('0x1ca'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xa2')][_0x3ebd('0x14e')](db[_0x3ebd('0x8d')],{'as':_0x3ebd('0x8d'),'foreignKey':_0x3ebd('0x1cb')});db[_0x3ebd('0xa4')]['hasMany'](db['DeskConfiguration'],{'as':_0x3ebd('0x1bf'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xa6')][_0x3ebd('0x113')](db[_0x3ebd('0x1cc')],{'as':'Subjects','onDelete':_0x3ebd('0x111'),'foreignKey':'SubjectId'});db[_0x3ebd('0xa6')]['hasMany'](db['DeskField'],{'as':'Descriptions','onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0xa6')][_0x3ebd('0x113')](db[_0x3ebd('0x1cc')],{'as':'Fields','onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xa6')][_0x3ebd('0x14e')](db['DeskAccount'],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xa6')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x1cd')});db['DeskField'][_0x3ebd('0x113')](db[_0x3ebd('0x1cc')],{'as':_0x3ebd('0x1c8'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0x1cc')][_0x3ebd('0x113')](db[_0x3ebd('0x1cc')],{'as':_0x3ebd('0x1c9'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0x1cc')][_0x3ebd('0x113')](db[_0x3ebd('0x1cc')],{'as':_0x3ebd('0x1ca'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0x1cc')][_0x3ebd('0x14e')](db[_0x3ebd('0x8d')],{'as':'Variable','foreignKey':_0x3ebd('0x1cb')});db[_0x3ebd('0xa8')][_0x3ebd('0x113')](db[_0x3ebd('0x1ce')],{'as':'Configurations','onDelete':_0x3ebd('0x111'),'foreignKey':'AccountId'});db[_0x3ebd('0x1ce')][_0x3ebd('0x113')](db[_0x3ebd('0x1cf')],{'as':_0x3ebd('0x1c1'),'onDelete':'cascade','foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0x1ce')][_0x3ebd('0x113')](db['ZohoField'],{'as':_0x3ebd('0x1c3'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x3ebd('0x1ce')][_0x3ebd('0x113')](db[_0x3ebd('0x1cf')],{'as':_0x3ebd('0x1bc'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0x1ce')][_0x3ebd('0x14e')](db[_0x3ebd('0xa8')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0x1cf')][_0x3ebd('0x113')](db[_0x3ebd('0x1cf')],{'as':_0x3ebd('0x1c8'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0x1cf')][_0x3ebd('0x113')](db[_0x3ebd('0x1cf')],{'as':_0x3ebd('0x1c9'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0x1cf')][_0x3ebd('0x113')](db[_0x3ebd('0x1cf')],{'as':_0x3ebd('0x1ca'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0x1cf')]['belongsTo'](db[_0x3ebd('0x8d')],{'as':_0x3ebd('0x8d'),'foreignKey':_0x3ebd('0x1cb')});db[_0x3ebd('0xac')][_0x3ebd('0x113')](db[_0x3ebd('0xad')],{'as':_0x3ebd('0x1bf'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xad')]['hasMany'](db[_0x3ebd('0xaf')],{'as':_0x3ebd('0x1c1'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xad')][_0x3ebd('0x113')](db[_0x3ebd('0xaf')],{'as':'Descriptions','foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0xad')][_0x3ebd('0x113')](db[_0x3ebd('0xaf')],{'as':'Fields','foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db['ZendeskAccount'],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xad')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x1d0')});db['ZendeskField']['hasMany'](db[_0x3ebd('0xaf')],{'as':_0x3ebd('0x1c8'),'foreignKey':'SubjectId'});db[_0x3ebd('0xaf')][_0x3ebd('0x113')](db['ZendeskField'],{'as':_0x3ebd('0x1c9'),'foreignKey':'DescriptionId'});db[_0x3ebd('0xaf')][_0x3ebd('0x113')](db[_0x3ebd('0xaf')],{'as':'Field','foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xaf')][_0x3ebd('0x14e')](db[_0x3ebd('0x8d')],{'as':_0x3ebd('0x8d'),'foreignKey':'VariableId'});db['FreshdeskAccount'][_0x3ebd('0x113')](db['FreshdeskConfiguration'],{'as':_0x3ebd('0x1bf'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c0')});db['FreshdeskConfiguration'][_0x3ebd('0x113')](db['FreshdeskField'],{'as':_0x3ebd('0x1c1'),'onDelete':'cascade','foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xb2')][_0x3ebd('0x113')](db[_0x3ebd('0xb4')],{'as':_0x3ebd('0x1c3'),'onDelete':'cascade','foreignKey':'DescriptionId'});db['FreshdeskConfiguration']['hasMany'](db[_0x3ebd('0xb4')],{'as':_0x3ebd('0x1bc'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xb2')][_0x3ebd('0x14e')](db[_0x3ebd('0xb1')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xb2')]['belongsToMany'](db[_0x3ebd('0x84')],{'through':_0x3ebd('0x1d1')});db[_0x3ebd('0xb4')]['hasMany'](db[_0x3ebd('0xb4')],{'as':'Subject','foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xb4')]['hasMany'](db[_0x3ebd('0xb4')],{'as':'Description','foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0xb4')]['hasMany'](db[_0x3ebd('0xb4')],{'as':'Field','foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xb4')][_0x3ebd('0x14e')](db[_0x3ebd('0x8d')],{'as':_0x3ebd('0x8d'),'foreignKey':_0x3ebd('0x1cb')});db[_0x3ebd('0xb6')]['hasMany'](db[_0x3ebd('0xb8')],{'as':_0x3ebd('0x1bf'),'onDelete':'cascade','foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xb8')][_0x3ebd('0x113')](db[_0x3ebd('0xb9')],{'as':_0x3ebd('0x1c1'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xb8')][_0x3ebd('0x113')](db[_0x3ebd('0xb9')],{'as':_0x3ebd('0x1c3'),'foreignKey':_0x3ebd('0x1c4')});db['VtigerConfiguration']['hasMany'](db[_0x3ebd('0xb9')],{'as':'Fields','foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xb8')][_0x3ebd('0x14e')](db[_0x3ebd('0xb6')],{'as':_0x3ebd('0x176'),'foreignKey':'AccountId'});db[_0x3ebd('0xb9')][_0x3ebd('0x113')](db[_0x3ebd('0xb9')],{'as':_0x3ebd('0x1c8'),'foreignKey':'SubjectId'});db[_0x3ebd('0xb9')]['hasMany'](db['VtigerField'],{'as':_0x3ebd('0x1c9'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0xb9')][_0x3ebd('0x113')](db[_0x3ebd('0xb9')],{'as':_0x3ebd('0x1ca'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xb9')][_0x3ebd('0x14e')](db[_0x3ebd('0x8d')],{'as':_0x3ebd('0x8d'),'foreignKey':'VariableId'});db[_0x3ebd('0xba')][_0x3ebd('0x113')](db[_0x3ebd('0xbc')],{'as':_0x3ebd('0x1bf'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c0')});db['ServicenowConfiguration'][_0x3ebd('0x113')](db[_0x3ebd('0xbe')],{'as':_0x3ebd('0x1c1'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xbc')][_0x3ebd('0x113')](db[_0x3ebd('0xbe')],{'as':_0x3ebd('0x1c3'),'foreignKey':'DescriptionId'});db[_0x3ebd('0xbc')]['hasMany'](db['ServicenowField'],{'as':_0x3ebd('0x1bc'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xbc')][_0x3ebd('0x14e')](db[_0x3ebd('0xba')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xbe')][_0x3ebd('0x113')](db[_0x3ebd('0xbe')],{'as':_0x3ebd('0x1c8'),'foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xbe')][_0x3ebd('0x113')](db['ServicenowField'],{'as':_0x3ebd('0x1c9'),'foreignKey':_0x3ebd('0x1c4')});db['ServicenowField'][_0x3ebd('0x113')](db[_0x3ebd('0xbe')],{'as':_0x3ebd('0x1ca'),'foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xbe')]['belongsTo'](db[_0x3ebd('0x8d')],{'as':'Variable','foreignKey':'VariableId'});db[_0x3ebd('0x1d2')][_0x3ebd('0x113')](db[_0x3ebd('0xc0')],{'as':_0x3ebd('0x1bf'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0x1d2')][_0x3ebd('0x14e')](db[_0x3ebd('0x103')],{'as':_0x3ebd('0x103'),'foreignKey':_0x3ebd('0x162')});db[_0x3ebd('0xc0')][_0x3ebd('0x113')](db['Dynamics365Field'],{'as':_0x3ebd('0x1c1'),'onDelete':'cascade','foreignKey':_0x3ebd('0x1c2')});db[_0x3ebd('0xc0')][_0x3ebd('0x113')](db['Dynamics365Field'],{'as':'Descriptions','onDelete':_0x3ebd('0x111'),'foreignKey':'DescriptionId'});db[_0x3ebd('0xc0')][_0x3ebd('0x113')](db[_0x3ebd('0xc2')],{'as':_0x3ebd('0x1bc'),'onDelete':'cascade','foreignKey':_0x3ebd('0x1c6')});db[_0x3ebd('0xc0')][_0x3ebd('0x14e')](db['Dynamics365Account'],{'as':_0x3ebd('0x176'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x3ebd('0x113')](db['Dynamics365Field'],{'as':'Subject','foreignKey':_0x3ebd('0x1c2')});db['Dynamics365Field'][_0x3ebd('0x113')](db[_0x3ebd('0xc2')],{'as':_0x3ebd('0x1c9'),'foreignKey':'DescriptionId'});db[_0x3ebd('0xc2')][_0x3ebd('0x113')](db[_0x3ebd('0xc2')],{'as':'Field','foreignKey':'FieldId'});db[_0x3ebd('0xc2')][_0x3ebd('0x14e')](db[_0x3ebd('0x8d')],{'as':_0x3ebd('0x8d'),'foreignKey':_0x3ebd('0x1cb')});db[_0x3ebd('0xc4')]['hasMany'](db[_0x3ebd('0xc6')],{'as':_0x3ebd('0x1bf'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1c0')});db[_0x3ebd('0xc6')]['hasMany'](db['FreshsalesField'],{'as':_0x3ebd('0x1c1'),'foreignKey':'SubjectId'});db[_0x3ebd('0xc6')][_0x3ebd('0x113')](db[_0x3ebd('0x1d3')],{'as':_0x3ebd('0x1c3'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0xc6')]['hasMany'](db[_0x3ebd('0x1d3')],{'as':_0x3ebd('0x1bc'),'foreignKey':_0x3ebd('0x1c6')});db['FreshsalesConfiguration'][_0x3ebd('0x14e')](db[_0x3ebd('0xc4')],{'as':'Account','foreignKey':_0x3ebd('0x1c0')});db['FreshsalesField'][_0x3ebd('0x113')](db[_0x3ebd('0x1d3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x3ebd('0x1d3')][_0x3ebd('0x113')](db[_0x3ebd('0x1d3')],{'as':_0x3ebd('0x1c9'),'foreignKey':_0x3ebd('0x1c4')});db[_0x3ebd('0x1d3')][_0x3ebd('0x113')](db[_0x3ebd('0x1d3')],{'as':'Field','foreignKey':_0x3ebd('0x1c6')});db['FreshsalesField'][_0x3ebd('0x14e')](db['Variable'],{'as':_0x3ebd('0x8d'),'foreignKey':'VariableId'});db[_0x3ebd('0xc9')]['belongsTo'](db[_0x3ebd('0x5b')],{});db[_0x3ebd('0xc9')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x168'),'foreignKey':_0x3ebd('0x179')});db[_0x3ebd('0xc9')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':'Contact','foreignKey':'ContactId'});db['ChatQueueReport']['belongsTo'](db[_0x3ebd('0x5f')],{});db['ChatQueueReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x60')],{});db[_0x3ebd('0xc9')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{});db['ChatQueueReport']['belongsTo'](db[_0x3ebd('0x134')],{});db[_0x3ebd('0x1d4')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1d5')});db[_0x3ebd('0x1d4')]['belongsTo'](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x111'),'foreignKey':'ToId'});db[_0x3ebd('0x14d')][_0x3ebd('0x113')](db['JscriptyQuestionReport'],{'foreignKey':_0x3ebd('0x1d6'),'onDelete':'cascade'});db[_0x3ebd('0x14d')][_0x3ebd('0x113')](db[_0x3ebd('0xcb')],{'foreignKey':_0x3ebd('0x1d6'),'onDelete':_0x3ebd('0x111')});db['SmsQueueReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x140')],{});db[_0x3ebd('0xd0')][_0x3ebd('0x14e')](db[_0x3ebd('0xee')],{'as':'List','foreignKey':_0x3ebd('0x179')});db['SmsQueueReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x16d'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0xd0')]['belongsTo'](db[_0x3ebd('0x4f')],{});db[_0x3ebd('0xd0')][_0x3ebd('0x14e')](db[_0x3ebd('0x51')],{});db['SmsQueueReport'][_0x3ebd('0x14e')](db['User'],{});db['SmsQueueReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x52')],{});db['JscriptyProject'][_0x3ebd('0x113')](db[_0x3ebd('0x14d')],{'foreignKey':'ProjectId'});db[_0x3ebd('0x1d7')][_0x3ebd('0x113')](db[_0x3ebd('0xcd')],{'foreignKey':_0x3ebd('0x1d8')});db['JscriptyProject']['hasMany'](db[_0x3ebd('0xcb')],{'foreignKey':'ProjectId'});db[_0x3ebd('0xdd')]['belongsToMany'](db['User'],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x128')});db[_0x3ebd('0xdd')]['belongsToMany'](db['VoiceQueue'],{'through':_0x3ebd('0x105'),'as':_0x3ebd('0x1d9')});db[_0x3ebd('0xdd')][_0x3ebd('0x125')](db[_0x3ebd('0x132')],{'through':_0x3ebd('0x16c'),'as':_0x3ebd('0x133')});db[_0x3ebd('0xdd')][_0x3ebd('0x125')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x3ebd('0x135')});db['Team']['belongsToMany'](db[_0x3ebd('0x4b')],{'through':_0x3ebd('0x1da'),'as':'FaxQueues'});db[_0x3ebd('0xdd')][_0x3ebd('0x125')](db[_0x3ebd('0x52')],{'through':_0x3ebd('0x1db'),'as':_0x3ebd('0x137')});db[_0x3ebd('0xdd')][_0x3ebd('0x125')](db['OpenchannelQueue'],{'through':_0x3ebd('0x18a'),'as':'OpenchannelQueues'});db['Team'][_0x3ebd('0x125')](db[_0x3ebd('0x101')],{'through':_0x3ebd('0x1dc'),'as':_0x3ebd('0x139')});db['Team'][_0x3ebd('0x125')](db[_0x3ebd('0xf0')],{'through':_0x3ebd('0x107'),'as':_0x3ebd('0x130')});db[_0x3ebd('0xe0')][_0x3ebd('0x113')](db['CmHopper'],{'as':_0x3ebd('0x14b'),'foreignKey':_0x3ebd('0x19e')});db[_0x3ebd('0xe0')][_0x3ebd('0x113')](db[_0x3ebd('0x116')],{'as':'HopperFinals','foreignKey':'CampaignId'});db['Campaign']['hasMany'](db[_0x3ebd('0x14c')],{'as':_0x3ebd('0x1dd'),'foreignKey':_0x3ebd('0x19e')});db[_0x3ebd('0xe0')][_0x3ebd('0x113')](db[_0x3ebd('0x6b')],{'as':_0x3ebd('0x1de'),'foreignKey':_0x3ebd('0x19e')});db[_0x3ebd('0xe0')][_0x3ebd('0x14e')](db[_0x3ebd('0x26')],{'as':_0x3ebd('0x26'),'foreignKey':'TrunkId'});db[_0x3ebd('0xe0')]['belongsTo'](db[_0x3ebd('0x26')],{'as':_0x3ebd('0x150'),'foreignKey':_0x3ebd('0x151')});db[_0x3ebd('0xe0')][_0x3ebd('0x14e')](db[_0x3ebd('0x78')],{'as':_0x3ebd('0x78'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0xe0')][_0x3ebd('0x14e')](db[_0x3ebd('0xd8')],{'as':'SquareProject','foreignKey':_0x3ebd('0x1df')});db[_0x3ebd('0xe0')]['belongsToMany'](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x126'),'through':_0x3ebd('0x1e0')});db[_0x3ebd('0xe0')][_0x3ebd('0x125')](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x157'),'through':_0x3ebd('0x1e1')});db[_0x3ebd('0xe3')]['belongsTo'](db[_0x3ebd('0x62')],{'as':'ChatOfflineMessage','foreignKey':_0x3ebd('0x192')});db['MailTransferReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x3e')],{});db[_0x3ebd('0xe6')][_0x3ebd('0x14e')](db[_0x3ebd('0x129')],{});db[_0x3ebd('0xe6')]['belongsTo'](db[_0x3ebd('0x38')],{'foreignKey':'FromMailAccountId','as':_0x3ebd('0x1e2')});db['MailTransferReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'foreignKey':'FromUserId','as':_0x3ebd('0x1e3')});db[_0x3ebd('0xe6')]['belongsTo'](db[_0x3ebd('0x10e')],{'foreignKey':_0x3ebd('0x1e4'),'as':_0x3ebd('0x1e5')});db['MailTransferReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x132')],{'foreignKey':_0x3ebd('0x1e6'),'as':'ToQueue'});db[_0x3ebd('0xe6')][_0x3ebd('0x14e')](db[_0x3ebd('0x38')],{'foreignKey':_0x3ebd('0x1e7'),'as':_0x3ebd('0x1e8')});db[_0x3ebd('0xe8')][_0x3ebd('0x14e')](db[_0x3ebd('0x60')],{});db[_0x3ebd('0xe8')][_0x3ebd('0x14e')](db[_0x3ebd('0x5f')],{});db['ChatTransferReport'][_0x3ebd('0x14e')](db['ChatWebsite'],{'foreignKey':_0x3ebd('0x1e9'),'as':_0x3ebd('0x1e2')});db[_0x3ebd('0xe8')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'foreignKey':_0x3ebd('0x1ea'),'as':'FromAgent'});db[_0x3ebd('0xe8')][_0x3ebd('0x14e')](db['User'],{'foreignKey':_0x3ebd('0x1e4'),'as':_0x3ebd('0x1e5')});db['ChatTransferReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x134')],{'foreignKey':_0x3ebd('0x1eb'),'as':'ToQueue'});db[_0x3ebd('0xe8')][_0x3ebd('0x14e')](db[_0x3ebd('0x5b')],{'foreignKey':_0x3ebd('0x1ec'),'as':_0x3ebd('0x1e8')});db[_0x3ebd('0xea')]['belongsTo'](db[_0x3ebd('0x49')],{});db['FaxTransferReport'][_0x3ebd('0x14e')](db['FaxInteraction'],{});db[_0x3ebd('0xea')]['belongsTo'](db[_0x3ebd('0x44')],{'foreignKey':'FromFaxAccountId','as':_0x3ebd('0x1e2')});db[_0x3ebd('0xea')][_0x3ebd('0x14e')](db['User'],{'foreignKey':_0x3ebd('0x1ea'),'as':_0x3ebd('0x1e3')});db[_0x3ebd('0xea')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'foreignKey':_0x3ebd('0x1e4'),'as':'ToAgent'});db[_0x3ebd('0xea')][_0x3ebd('0x14e')](db[_0x3ebd('0x4b')],{'foreignKey':_0x3ebd('0x1ed'),'as':'ToQueue'});db[_0x3ebd('0xea')][_0x3ebd('0x14e')](db[_0x3ebd('0x44')],{'foreignKey':'ToFaxAccountId','as':_0x3ebd('0x1e8')});db[_0x3ebd('0xec')][_0x3ebd('0x14e')](db[_0x3ebd('0x58')],{});db['OpenchannelTransferReport'][_0x3ebd('0x14e')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x53')],{'foreignKey':_0x3ebd('0x1ee'),'as':_0x3ebd('0x1e2')});db['OpenchannelTransferReport']['belongsTo'](db[_0x3ebd('0x10e')],{'foreignKey':'FromUserId','as':_0x3ebd('0x1e3')});db[_0x3ebd('0xec')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'foreignKey':_0x3ebd('0x1e4'),'as':'ToAgent'});db[_0x3ebd('0xec')][_0x3ebd('0x14e')](db[_0x3ebd('0x5a')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x3ebd('0xec')][_0x3ebd('0x14e')](db[_0x3ebd('0x53')],{'foreignKey':_0x3ebd('0x1ef'),'as':_0x3ebd('0x1e8')});db[_0x3ebd('0xed')][_0x3ebd('0x14e')](db[_0x3ebd('0x51')],{});db[_0x3ebd('0xed')][_0x3ebd('0x14e')](db[_0x3ebd('0x4f')],{});db[_0x3ebd('0xed')]['belongsTo'](db[_0x3ebd('0x140')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x3ebd('0xed')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'foreignKey':_0x3ebd('0x1ea'),'as':_0x3ebd('0x1e3')});db[_0x3ebd('0xed')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'foreignKey':_0x3ebd('0x1e4'),'as':_0x3ebd('0x1e5')});db[_0x3ebd('0xed')]['belongsTo'](db[_0x3ebd('0x52')],{'foreignKey':'ToSmsQueueId','as':_0x3ebd('0x1f0')});db[_0x3ebd('0xed')][_0x3ebd('0x14e')](db[_0x3ebd('0x140')],{'foreignKey':_0x3ebd('0x1f1'),'as':'ToAccount'});db[_0x3ebd('0xee')][_0x3ebd('0x113')](db[_0x3ebd('0x75')],{'as':'Dispositions','foreignKey':'ListId','onDelete':_0x3ebd('0x111')});db['CmList']['hasMany'](db[_0x3ebd('0x6e')],{'as':_0x3ebd('0x1f2'),'foreignKey':_0x3ebd('0x179')});db[_0x3ebd('0xee')][_0x3ebd('0x113')](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x123'),'onDelete':'cascade','foreignKey':'ListId'});db['CmList'][_0x3ebd('0x113')](db['CmHopperFinal'],{'as':_0x3ebd('0x117'),'foreignKey':'ListId'});db[_0x3ebd('0xee')][_0x3ebd('0x113')](db[_0x3ebd('0x14c')],{'as':_0x3ebd('0x118'),'foreignKey':_0x3ebd('0x179')});db[_0x3ebd('0xee')]['hasMany'](db[_0x3ebd('0x119')],{'as':_0x3ebd('0x119'),'foreignKey':_0x3ebd('0x179')});db['CmList'][_0x3ebd('0x125')](db[_0x3ebd('0x19')],{'as':_0x3ebd('0x1f3'),'through':_0x3ebd('0x155')});db[_0x3ebd('0xee')][_0x3ebd('0x125')](db['User'],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x127')});db[_0x3ebd('0xf0')][_0x3ebd('0x113')](db['VoiceExtension'],{'as':_0x3ebd('0x1a9'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0xf0')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':'Agents','through':'UserVoicePrefix'});db[_0x3ebd('0xf0')][_0x3ebd('0x125')](db[_0x3ebd('0xdd')],{'through':_0x3ebd('0x107'),'as':_0x3ebd('0x156')});db[_0x3ebd('0xf1')][_0x3ebd('0x113')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x171'),'foreignKey':_0x3ebd('0x120')});db[_0x3ebd('0xf1')]['hasMany'](db[_0x3ebd('0xf3')],{'as':_0x3ebd('0x1f4'),'foreignKey':_0x3ebd('0x120'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0xf3')][_0x3ebd('0x113')](db[_0x3ebd('0xf4')],{'as':_0x3ebd('0x1f5'),'foreignKey':'sectionId','onDelete':_0x3ebd('0x111')});db[_0x3ebd('0xf7')]['hasMany'](db[_0x3ebd('0x75')],{'as':_0x3ebd('0x165'),'foreignKey':_0x3ebd('0x1f6'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0xf7')][_0x3ebd('0x113')](db[_0x3ebd('0x73')],{'as':_0x3ebd('0x17b'),'foreignKey':_0x3ebd('0x1f6')});db['WhatsappAccount'][_0x3ebd('0x113')](db[_0x3ebd('0x1f7')],{'as':'Messages','foreignKey':_0x3ebd('0x1f6')});db[_0x3ebd('0xf7')][_0x3ebd('0x113')](db['WhatsappInteraction'],{'as':'Interactions'});db[_0x3ebd('0xf7')][_0x3ebd('0x113')](db[_0x3ebd('0xf9')],{'as':_0x3ebd('0x145'),'foreignKey':_0x3ebd('0x1f6'),'onDelete':_0x3ebd('0x111')});db[_0x3ebd('0xf7')]['belongsTo'](db[_0x3ebd('0xee')],{'as':_0x3ebd('0x168'),'foreignKey':'ListId'});db['WhatsappAccount']['belongsTo'](db[_0x3ebd('0x7a')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount']['belongsToMany'](db[_0x3ebd('0x10e')],{'as':'Agents','through':_0x3ebd('0x143')});db[_0x3ebd('0xf9')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'onDelete':_0x3ebd('0x160')});db['WhatsappApplication'][_0x3ebd('0x14e')](db[_0x3ebd('0x101')],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0xf9')][_0x3ebd('0x14e')](db[_0x3ebd('0xf7')],{'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0xf9')][_0x3ebd('0x14e')](db[_0x3ebd('0x78')],{'onDelete':_0x3ebd('0x160'),'foreignKey':_0x3ebd('0x152')});db[_0x3ebd('0xf9')][_0x3ebd('0x14e')](db[_0x3ebd('0x84')],{'onDelete':_0x3ebd('0x160'),'foreignKey':_0x3ebd('0x17e')});db[_0x3ebd('0xfb')][_0x3ebd('0x113')](db[_0x3ebd('0x1f7')],{'as':_0x3ebd('0x15a'),'onDelete':_0x3ebd('0x111'),'foreignKey':_0x3ebd('0x1f8')});db[_0x3ebd('0xfb')][_0x3ebd('0x14e')](db[_0x3ebd('0xf7')],{'as':_0x3ebd('0x176'),'foreignKey':_0x3ebd('0x1f6')});db[_0x3ebd('0xfb')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'as':_0x3ebd('0x16d'),'foreignKey':_0x3ebd('0x15e')});db['WhatsappInteraction'][_0x3ebd('0x14e')](db['User'],{'as':_0x3ebd('0x16e'),'foreignKey':'UserId'});db[_0x3ebd('0xfb')][_0x3ebd('0x125')](db['Tag'],{'through':_0x3ebd('0x1af'),'as':_0x3ebd('0x185')});db[_0x3ebd('0xfb')][_0x3ebd('0x125')](db[_0x3ebd('0x84')],{'through':'whatsapp_interaction_has_tags','as':_0x3ebd('0x170')});db[_0x3ebd('0xfb')][_0x3ebd('0x125')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x171'),'through':_0x3ebd('0x12e'),'foreignKey':'WhatsappInteractionId'});db[_0x3ebd('0x1f7')][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x10e')});db[_0x3ebd('0x1f7')][_0x3ebd('0x14e')](db[_0x3ebd('0x67')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x16d')});db[_0x3ebd('0x1f7')]['belongsTo'](db[_0x3ebd('0xfb')],{'onDelete':_0x3ebd('0x111'),'as':_0x3ebd('0x175'),'foreignKey':'WhatsappInteractionId'});db[_0x3ebd('0x1f7')][_0x3ebd('0x14e')](db[_0x3ebd('0xf7')],{'as':'Account','foreignKey':_0x3ebd('0x1f6')});db[_0x3ebd('0xfe')][_0x3ebd('0x14e')](db['WhatsappAccount'],{});db[_0x3ebd('0xfe')][_0x3ebd('0x14e')](db['CmList'],{'as':'List','foreignKey':_0x3ebd('0x179')});db['WhatsappQueueReport'][_0x3ebd('0x14e')](db['CmContact'],{'as':_0x3ebd('0x16d'),'foreignKey':_0x3ebd('0x15e')});db[_0x3ebd('0xfe')]['belongsTo'](db['WhatsappInteraction'],{});db[_0x3ebd('0xfe')]['belongsTo'](db[_0x3ebd('0x101')],{});db[_0x3ebd('0xfe')]['belongsTo'](db['WhatsappMessage'],{});db['WhatsappQueueReport']['belongsTo'](db[_0x3ebd('0x10e')],{});db[_0x3ebd('0x100')][_0x3ebd('0x14e')](db[_0x3ebd('0x1f7')],{});db['WhatsappTransferReport']['belongsTo'](db[_0x3ebd('0xfb')],{});db[_0x3ebd('0x100')][_0x3ebd('0x14e')](db[_0x3ebd('0xf7')],{'foreignKey':_0x3ebd('0x1f9'),'as':_0x3ebd('0x1e2')});db[_0x3ebd('0x100')][_0x3ebd('0x14e')](db['WhatsappAccount'],{'foreignKey':_0x3ebd('0x1fa'),'as':'ToAccount'});db[_0x3ebd('0x100')][_0x3ebd('0x14e')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':'ToQueue'});db['WhatsappTransferReport'][_0x3ebd('0x14e')](db[_0x3ebd('0x10e')],{'foreignKey':'FromUserId','as':_0x3ebd('0x1e3')});db['WhatsappTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x3ebd('0x1e4'),'as':'ToAgent'});db['WhatsappQueue']['belongsToMany'](db[_0x3ebd('0x10e')],{'as':_0x3ebd('0x16a'),'through':_0x3ebd('0x34'),'foreignKey':'WhatsappQueueId'});db[_0x3ebd('0x101')][_0x3ebd('0x125')](db['Team'],{'through':_0x3ebd('0x1dc'),'as':_0x3ebd('0x156')});db['UserSetting'][_0x3ebd('0x14e')](db['User'],{'as':_0x3ebd('0x1fb'),'foreignKey':'UserId','onDelete':_0x3ebd('0x111'),'hooks':!![]});db[_0x3ebd('0x103')][_0x3ebd('0x10f')](db['Dynamics365Account'],{'as':_0x3ebd('0x1d2'),'onDelete':_0x3ebd('0x160')});db['CloudProvider'][_0x3ebd('0x10f')](db[_0x3ebd('0x35')],{'as':_0x3ebd('0x163'),'onDelete':_0x3ebd('0x160')});db[_0x3ebd('0x103')][_0x3ebd('0x10f')](db[_0x3ebd('0x161')],{'as':_0x3ebd('0x164'),'onDelete':_0x3ebd('0x160')});module[_0x3ebd('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index dc6d1eb..0185380 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5440=['./api/chatTransferReport','./api/faxTransferReport','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','/api/realtime','./api/realtime','./api/user-setting','/api/mail_interaction_has_tags','./api/mailInteractionHasTag','./api/authGoogle','/api/auth/activedirectory','/api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/api/logs','/apidoc','root','/www','static','join','/demo','/snippet','snippet','3.9.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','./api/client-side-logs','default','then','use','/api/users','./api/user','/api/voice/chanspy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/chat/websites','/api/openchannel/reports/queue','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/sound','/api/tags','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/desk/accounts','./api/intDeskAccount','./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/teams','/api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer'];(function(_0x5ba3ac,_0x2d26d9){var _0x18b913=function(_0x51e3e2){while(--_0x51e3e2){_0x5ba3ac['push'](_0x5ba3ac['shift']());}};_0x18b913(++_0x2d26d9);}(_0x5440,0x14b));var _0x0544=function(_0x20a7ed,_0x3d946c){_0x20a7ed=_0x20a7ed-0x0;var _0x4ce6ab=_0x5440[_0x20a7ed];return _0x4ce6ab;};'use strict';var path=require(_0x0544('0x0'));var express=require(_0x0544('0x1'));var errors=require(_0x0544('0x2'));var config=require(_0x0544('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0x0544('0x4')];var clientSideLogs=require(_0x0544('0x5'));exports[_0x0544('0x6')]=function(_0x4de390){return setupLoggers(_0x4de390)[_0x0544('0x7')](function(){_0x4de390[_0x0544('0x8')](_0x0544('0x9'),require(_0x0544('0xa')));_0x4de390[_0x0544('0x8')](_0x0544('0xb'),require('./api/voiceChanSpy'));_0x4de390[_0x0544('0x8')](_0x0544('0xc'),require('./api/voiceContext'));_0x4de390[_0x0544('0x8')](_0x0544('0xd'),require('./api/voiceExtension'));_0x4de390[_0x0544('0x8')](_0x0544('0xe'),require(_0x0544('0xf')));_0x4de390[_0x0544('0x8')](_0x0544('0x10'),require(_0x0544('0x11')));_0x4de390['use'](_0x0544('0x12'),require(_0x0544('0x13')));_0x4de390[_0x0544('0x8')](_0x0544('0x14'),require(_0x0544('0x15')));_0x4de390[_0x0544('0x8')](_0x0544('0x16'),require(_0x0544('0x17')));_0x4de390[_0x0544('0x8')](_0x0544('0x18'),require('./api/voiceMailMessage'));_0x4de390[_0x0544('0x8')]('/api/voice/calls/reports',require(_0x0544('0x19')));_0x4de390[_0x0544('0x8')](_0x0544('0x1a'),require(_0x0544('0x1b')));_0x4de390[_0x0544('0x8')](_0x0544('0x1c'),require(_0x0544('0x1d')));_0x4de390[_0x0544('0x8')](_0x0544('0x1e'),require(_0x0544('0x1f')));_0x4de390['use'](_0x0544('0x20'),require(_0x0544('0x21')));_0x4de390[_0x0544('0x8')]('/api/trunks',require(_0x0544('0x22')));_0x4de390[_0x0544('0x8')](_0x0544('0x23'),require(_0x0544('0x24')));_0x4de390['use'](_0x0544('0x25'),require(_0x0544('0x26')));_0x4de390[_0x0544('0x8')](_0x0544('0x27'),require(_0x0544('0x28')));_0x4de390[_0x0544('0x8')](_0x0544('0x29'),require(_0x0544('0x2a')));_0x4de390[_0x0544('0x8')](_0x0544('0x2b'),require(_0x0544('0x2c')));_0x4de390[_0x0544('0x8')]('/api/mail/interactions',require(_0x0544('0x2d')));_0x4de390['use'](_0x0544('0x2e'),require(_0x0544('0x2f')));_0x4de390[_0x0544('0x8')](_0x0544('0x30'),require(_0x0544('0x31')));_0x4de390['use'](_0x0544('0x32'),require(_0x0544('0x33')));_0x4de390[_0x0544('0x8')]('/api/dashboards',require(_0x0544('0x34')));_0x4de390['use'](_0x0544('0x35'),require(_0x0544('0x36')));_0x4de390[_0x0544('0x8')](_0x0544('0x37'),require('./api/faxAccount'));_0x4de390['use'](_0x0544('0x38'),require(_0x0544('0x39')));_0x4de390[_0x0544('0x8')](_0x0544('0x3a'),require(_0x0544('0x3b')));_0x4de390[_0x0544('0x8')](_0x0544('0x3c'),require(_0x0544('0x3d')));_0x4de390[_0x0544('0x8')](_0x0544('0x3e'),require('./api/faxQueue'));_0x4de390['use'](_0x0544('0x3f'),require('./api/faxQueueReport'));_0x4de390[_0x0544('0x8')](_0x0544('0x40'),require('./api/smsAccount'));_0x4de390[_0x0544('0x8')](_0x0544('0x41'),require(_0x0544('0x42')));_0x4de390[_0x0544('0x8')](_0x0544('0x43'),require(_0x0544('0x44')));_0x4de390[_0x0544('0x8')]('/api/sms/messages',require(_0x0544('0x45')));_0x4de390[_0x0544('0x8')](_0x0544('0x46'),require(_0x0544('0x47')));_0x4de390[_0x0544('0x8')](_0x0544('0x48'),require(_0x0544('0x49')));_0x4de390[_0x0544('0x8')](_0x0544('0x4a'),require('./api/openchannelApplication'));_0x4de390[_0x0544('0x8')]('/api/openchannel/interactions',require(_0x0544('0x4b')));_0x4de390['use'](_0x0544('0x4c'),require(_0x0544('0x4d')));_0x4de390[_0x0544('0x8')]('/api/openchannel/queues',require('./api/openchannelQueue'));_0x4de390['use'](_0x0544('0x4e'),require('./api/chatWebsite'));_0x4de390['use'](_0x0544('0x4f'),require('./api/openchannelQueueReport'));_0x4de390['use'](_0x0544('0x50'),require(_0x0544('0x51')));_0x4de390['use']('/api/chat/interactions',require(_0x0544('0x52')));_0x4de390[_0x0544('0x8')](_0x0544('0x53'),require(_0x0544('0x54')));_0x4de390['use'](_0x0544('0x55'),require('./api/chatOfflineMessage'));_0x4de390[_0x0544('0x8')](_0x0544('0x56'),require('./api/chatQueue'));_0x4de390['use'](_0x0544('0x57'),require(_0x0544('0x58')));_0x4de390[_0x0544('0x8')](_0x0544('0x59'),require(_0x0544('0x5a')));_0x4de390[_0x0544('0x8')]('/api/cm/companies',require('./api/cmCompany'));_0x4de390[_0x0544('0x8')](_0x0544('0x5b'),require(_0x0544('0x5c')));_0x4de390[_0x0544('0x8')](_0x0544('0x5d'),require(_0x0544('0x5e')));_0x4de390[_0x0544('0x8')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4de390[_0x0544('0x8')](_0x0544('0x5f'),require(_0x0544('0x60')));_0x4de390[_0x0544('0x8')](_0x0544('0x61'),require(_0x0544('0x62')));_0x4de390[_0x0544('0x8')](_0x0544('0x63'),require(_0x0544('0x64')));_0x4de390[_0x0544('0x8')](_0x0544('0x65'),require(_0x0544('0x66')));_0x4de390[_0x0544('0x8')]('/api/automations',require('./api/automation'));_0x4de390['use']('/api/canned_answers',require(_0x0544('0x67')));_0x4de390[_0x0544('0x8')](_0x0544('0x68'),require(_0x0544('0x69')));_0x4de390[_0x0544('0x8')](_0x0544('0x6a'),require(_0x0544('0x6b')));_0x4de390[_0x0544('0x8')](_0x0544('0x6c'),require(_0x0544('0x6d')));_0x4de390[_0x0544('0x8')](_0x0544('0x6e'),require(_0x0544('0x6f')));_0x4de390[_0x0544('0x8')](_0x0544('0x70'),require(_0x0544('0x71')));_0x4de390['use'](_0x0544('0x72'),require(_0x0544('0x73')));_0x4de390[_0x0544('0x8')]('/api/schedules',require('./api/schedule'));_0x4de390[_0x0544('0x8')]('/api/sounds',require(_0x0544('0x74')));_0x4de390['use'](_0x0544('0x75'),require(_0x0544('0x76')));_0x4de390[_0x0544('0x8')](_0x0544('0x77'),require(_0x0544('0x78')));_0x4de390['use'](_0x0544('0x79'),require(_0x0544('0x7a')));_0x4de390[_0x0544('0x8')](_0x0544('0x7b'),require(_0x0544('0x7c')));_0x4de390[_0x0544('0x8')]('/api/templates',require(_0x0544('0x7d')));_0x4de390['use'](_0x0544('0x7e'),require(_0x0544('0x7f')));_0x4de390['use']('/api/variables',require(_0x0544('0x80')));_0x4de390[_0x0544('0x8')](_0x0544('0x81'),require(_0x0544('0x82')));_0x4de390[_0x0544('0x8')](_0x0544('0x83'),require(_0x0544('0x84')));_0x4de390['use'](_0x0544('0x85'),require(_0x0544('0x86')));_0x4de390[_0x0544('0x8')](_0x0544('0x87'),require(_0x0544('0x88')));_0x4de390['use']('/api/analytics/extracted_reports',require(_0x0544('0x89')));_0x4de390[_0x0544('0x8')](_0x0544('0x8a'),require(_0x0544('0x8b')));_0x4de390[_0x0544('0x8')](_0x0544('0x8c'),require('./api/analyticFieldReport'));_0x4de390['use'](_0x0544('0x8d'),require(_0x0544('0x8e')));_0x4de390['use']('/api/integrations/salesforce/accounts',require(_0x0544('0x8f')));_0x4de390['use'](_0x0544('0x90'),require(_0x0544('0x91')));_0x4de390[_0x0544('0x8')]('/api/integrations/salesforce/fields',require(_0x0544('0x92')));_0x4de390[_0x0544('0x8')]('/api/integrations/sugarcrm/accounts',require(_0x0544('0x93')));_0x4de390[_0x0544('0x8')](_0x0544('0x94'),require(_0x0544('0x95')));_0x4de390['use']('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x4de390['use'](_0x0544('0x96'),require(_0x0544('0x97')));_0x4de390[_0x0544('0x8')]('/api/integrations/desk/configurations',require(_0x0544('0x98')));_0x4de390[_0x0544('0x8')]('/api/integrations/desk/fields',require(_0x0544('0x99')));_0x4de390['use']('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x4de390['use'](_0x0544('0x9a'),require(_0x0544('0x9b')));_0x4de390[_0x0544('0x8')]('/api/integrations/zoho/fields',require(_0x0544('0x9c')));_0x4de390[_0x0544('0x8')](_0x0544('0x9d'),require(_0x0544('0x9e')));_0x4de390[_0x0544('0x8')](_0x0544('0x9f'),require(_0x0544('0xa0')));_0x4de390[_0x0544('0x8')](_0x0544('0xa1'),require(_0x0544('0xa2')));_0x4de390[_0x0544('0x8')](_0x0544('0xa3'),require('./api/intFreshdeskAccount'));_0x4de390[_0x0544('0x8')](_0x0544('0xa4'),require('./api/intFreshdeskConfiguration'));_0x4de390['use'](_0x0544('0xa5'),require(_0x0544('0xa6')));_0x4de390['use'](_0x0544('0xa7'),require('./api/intVtigerAccount'));_0x4de390['use'](_0x0544('0xa8'),require(_0x0544('0xa9')));_0x4de390[_0x0544('0x8')](_0x0544('0xaa'),require('./api/intVtigerField'));_0x4de390[_0x0544('0x8')](_0x0544('0xab'),require(_0x0544('0xac')));_0x4de390[_0x0544('0x8')]('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x4de390[_0x0544('0x8')](_0x0544('0xad'),require(_0x0544('0xae')));_0x4de390[_0x0544('0x8')](_0x0544('0xaf'),require(_0x0544('0xb0')));_0x4de390[_0x0544('0x8')](_0x0544('0xb1'),require(_0x0544('0xb2')));_0x4de390[_0x0544('0x8')](_0x0544('0xb3'),require('./api/intDynamics365Field'));_0x4de390[_0x0544('0x8')](_0x0544('0xb4'),require(_0x0544('0xb5')));_0x4de390[_0x0544('0x8')](_0x0544('0xb6'),require('./api/intFreshsalesConfiguration'));_0x4de390[_0x0544('0x8')](_0x0544('0xb7'),require(_0x0544('0xb8')));_0x4de390[_0x0544('0x8')]('/api/networks',require(_0x0544('0xb9')));_0x4de390[_0x0544('0x8')]('/api/chat/reports/queue',require('./api/chatQueueReport'));_0x4de390['use'](_0x0544('0xba'),require(_0x0544('0xbb')));_0x4de390[_0x0544('0x8')](_0x0544('0xbc'),require(_0x0544('0xbd')));_0x4de390['use'](_0x0544('0xbe'),require('./api/jscriptyQuestionReport'));_0x4de390['use']('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x4de390[_0x0544('0x8')](_0x0544('0xbf'),require(_0x0544('0xc0')));_0x4de390[_0x0544('0x8')]('/api/square/reports',require('./api/squareReport'));_0x4de390['use'](_0x0544('0xc1'),require('./api/squareReportDetail'));_0x4de390['use'](_0x0544('0xc2'),require(_0x0544('0xc3')));_0x4de390[_0x0544('0x8')](_0x0544('0xc4'),require(_0x0544('0xc5')));_0x4de390[_0x0544('0x8')](_0x0544('0xc6'),require(_0x0544('0xc7')));_0x4de390[_0x0544('0x8')](_0x0544('0xc8'),require(_0x0544('0xc9')));_0x4de390[_0x0544('0x8')](_0x0544('0xca'),require(_0x0544('0xcb')));_0x4de390[_0x0544('0x8')]('/api/square/messages',require('./api/squareMessage'));_0x4de390[_0x0544('0x8')](_0x0544('0xcc'),require('./api/team'));_0x4de390[_0x0544('0x8')](_0x0544('0xcd'),require('./api/license'));_0x4de390[_0x0544('0x8')](_0x0544('0xce'),require('./api/campaign'));_0x4de390[_0x0544('0x8')](_0x0544('0xcf'),require(_0x0544('0xd0')));_0x4de390[_0x0544('0x8')](_0x0544('0xd1'),require(_0x0544('0xd2')));_0x4de390[_0x0544('0x8')](_0x0544('0xd3'),require(_0x0544('0xd4')));_0x4de390[_0x0544('0x8')]('/api/mail/reports/transfer',require(_0x0544('0xd5')));_0x4de390[_0x0544('0x8')](_0x0544('0xd6'),require(_0x0544('0xd7')));_0x4de390[_0x0544('0x8')]('/api/fax/reports/transfer',require(_0x0544('0xd8')));_0x4de390['use']('/api/openchannel/reports/transfer',require('./api/openchannelTransferReport'));_0x4de390[_0x0544('0x8')]('/api/sms/reports/transfer',require(_0x0544('0xd9')));_0x4de390['use'](_0x0544('0xda'),require('./api/cmList'));_0x4de390[_0x0544('0x8')]('/api/voice/prefixes',require(_0x0544('0xdb')));_0x4de390['use'](_0x0544('0xdc'),require('./api/userProfile'));_0x4de390['use'](_0x0544('0xdd'),require('./api/userProfileSection'));_0x4de390[_0x0544('0x8')](_0x0544('0xde'),require(_0x0544('0xdf')));_0x4de390['use'](_0x0544('0xe0'),require('./api/userNotification'));_0x4de390[_0x0544('0x8')]('/api/whatsapp/accounts',require(_0x0544('0xe1')));_0x4de390[_0x0544('0x8')](_0x0544('0xe2'),require('./api/whatsappApplication'));_0x4de390['use']('/api/whatsapp/interactions',require(_0x0544('0xe3')));_0x4de390[_0x0544('0x8')](_0x0544('0xe4'),require(_0x0544('0xe5')));_0x4de390[_0x0544('0x8')](_0x0544('0xe6'),require(_0x0544('0xe7')));_0x4de390[_0x0544('0x8')](_0x0544('0xe8'),require(_0x0544('0xe9')));_0x4de390[_0x0544('0x8')](_0x0544('0xea'),require(_0x0544('0xeb')));_0x4de390[_0x0544('0x8')](_0x0544('0xec'),require('./api/cloudProvider'));_0x4de390[_0x0544('0x8')](_0x0544('0xed'),require(_0x0544('0xee')));_0x4de390[_0x0544('0x8')]('/api/user-settings',require(_0x0544('0xef')));_0x4de390[_0x0544('0x8')](_0x0544('0xf0'),require(_0x0544('0xf1')));_0x4de390[_0x0544('0x8')]('/api/auth/local',require('./api/authLocal'));_0x4de390[_0x0544('0x8')]('/api/auth/google',require(_0x0544('0xf2')));_0x4de390['use'](_0x0544('0xf3'),require('./api/authActiveDirectory'));_0x4de390[_0x0544('0x8')](_0x0544('0xf4'),require('./api/jira'));_0x4de390[_0x0544('0x8')](_0x0544('0xf5'),require(_0x0544('0xf6')));_0x4de390[_0x0544('0x8')](_0x0544('0xf7'),require('./api/version'));_0x4de390[_0x0544('0x8')](_0x0544('0xf8'),require(_0x0544('0xf9')));_0x4de390[_0x0544('0x8')](_0x0544('0xfa'),require(_0x0544('0xfb')));_0x4de390[_0x0544('0x8')](_0x0544('0xfc'),require(_0x0544('0xfd')));_0x4de390['use'](_0x0544('0xfe'),clientSideLogs);_0x4de390['use'](_0x0544('0xff'),express['static'](path['join'](config[_0x0544('0x100')],_0x0544('0xff'))));_0x4de390[_0x0544('0x8')](_0x0544('0x101'),express[_0x0544('0x102')](path[_0x0544('0x103')](config[_0x0544('0x100')],_0x0544('0x101'))));_0x4de390[_0x0544('0x8')](_0x0544('0x104'),express['static'](path[_0x0544('0x103')](config['root'],'/demo')));_0x4de390['use'](_0x0544('0x105'),express['static'](path[_0x0544('0x103')](config[_0x0544('0x100')],_0x0544('0x106'),_0x0544('0x107'))));_0x4de390['use'](_0x0544('0x108'),express[_0x0544('0x102')](path['join'](config[_0x0544('0x100')],_0x0544('0x109'))));_0x4de390[_0x0544('0x10a')](_0x0544('0x10b'))[_0x0544('0x10c')](errors[0x194]);_0x4de390['route']('/*')['get'](function(_0x1c7845,_0x473eb2){_0x473eb2[_0x0544('0x10d')](path[_0x0544('0x10e')](_0x4de390[_0x0544('0x10c')](_0x0544('0x10f'))+_0x0544('0x110')));});return _0x4de390;});}; \ No newline at end of file +var _0xb1fb=['./api/intDynamics365Account','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./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/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/chat/reports/transfer','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/mail_interaction_has_tags','/api/auth/local','/api/auth/google','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','/api/logs','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.9.0','/server/files/plugins','route','get','sendFile','appPath','path','express','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','default','then','./api/user','use','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/accounts','./api/mailAccount','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboard','./api/dashboardItem','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','/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/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/configurations','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','/api/integrations/dynamics365/accounts'];(function(_0x5804c8,_0x57af4d){var _0x33d432=function(_0x3510ac){while(--_0x3510ac){_0x5804c8['push'](_0x5804c8['shift']());}};_0x33d432(++_0x57af4d);}(_0xb1fb,0x69));var _0xbb1f=function(_0x466e21,_0x44d30c){_0x466e21=_0x466e21-0x0;var _0x80c484=_0xb1fb[_0x466e21];return _0x80c484;};'use strict';var path=require(_0xbb1f('0x0'));var express=require(_0xbb1f('0x1'));var errors=require(_0xbb1f('0x2'));var config=require(_0xbb1f('0x3'));var setupLoggers=require(_0xbb1f('0x4'))[_0xbb1f('0x5')];var clientSideLogs=require(_0xbb1f('0x6'));exports[_0xbb1f('0x7')]=function(_0x510582){return setupLoggers(_0x510582)[_0xbb1f('0x8')](function(){_0x510582['use']('/api/users',require(_0xbb1f('0x9')));_0x510582[_0xbb1f('0xa')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xb'),require(_0xbb1f('0xc')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xd'),require(_0xbb1f('0xe')));_0x510582['use']('/api/voice/mohs',require(_0xbb1f('0xf')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x10'),require(_0xbb1f('0x11')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x12'),require(_0xbb1f('0x13')));_0x510582[_0xbb1f('0xa')]('/api/screen/recordings',require(_0xbb1f('0x14')));_0x510582[_0xbb1f('0xa')]('/api/voice/mails',require(_0xbb1f('0x15')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x16'),require(_0xbb1f('0x17')));_0x510582['use'](_0xbb1f('0x18'),require(_0xbb1f('0x19')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x1a'),require('./api/voiceDialReport'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x1b'),require(_0xbb1f('0x1c')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x1d'),require(_0xbb1f('0x1e')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x1f'),require(_0xbb1f('0x20')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x21'),require(_0xbb1f('0x22')));_0x510582[_0xbb1f('0xa')]('/api/voice/transfers/reports',require(_0xbb1f('0x23')));_0x510582[_0xbb1f('0xa')]('/api/mail/out_servers',require('./api/mailServerOut'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x24'),require(_0xbb1f('0x25')));_0x510582[_0xbb1f('0xa')]('/api/mail/queues',require('./api/mailQueue'));_0x510582[_0xbb1f('0xa')]('/api/mail/substatuses',require(_0xbb1f('0x26')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x27'),require(_0xbb1f('0x28')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x29'),require('./api/mailMessage'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x2a'),require(_0xbb1f('0x2b')));_0x510582['use']('/api/mail/reports/queue',require(_0xbb1f('0x2c')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x2d'),require(_0xbb1f('0x2e')));_0x510582[_0xbb1f('0xa')]('/api/dashboards/items',require(_0xbb1f('0x2f')));_0x510582[_0xbb1f('0xa')]('/api/fax/accounts',require('./api/faxAccount'));_0x510582['use'](_0xbb1f('0x30'),require('./api/faxApplication'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x31'),require(_0xbb1f('0x32')));_0x510582['use'](_0xbb1f('0x33'),require('./api/faxMessage'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x34'),require(_0xbb1f('0x35')));_0x510582['use']('/api/fax/reports/queue',require(_0xbb1f('0x36')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x37'),require(_0xbb1f('0x38')));_0x510582['use'](_0xbb1f('0x39'),require(_0xbb1f('0x3a')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x3b'),require(_0xbb1f('0x3c')));_0x510582[_0xbb1f('0xa')]('/api/sms/messages',require(_0xbb1f('0x3d')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x3e'),require('./api/smsQueue'));_0x510582['use'](_0xbb1f('0x3f'),require(_0xbb1f('0x40')));_0x510582['use'](_0xbb1f('0x41'),require(_0xbb1f('0x42')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x43'),require(_0xbb1f('0x44')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x45'),require(_0xbb1f('0x46')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x47'),require(_0xbb1f('0x48')));_0x510582[_0xbb1f('0xa')]('/api/chat/websites',require('./api/chatWebsite'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x49'),require(_0xbb1f('0x4a')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x4b'),require(_0xbb1f('0x4c')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x4d'),require('./api/chatInteraction'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x4e'),require(_0xbb1f('0x4f')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x50'),require('./api/chatOfflineMessage'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x51'),require(_0xbb1f('0x52')));_0x510582[_0xbb1f('0xa')]('/api/chat/groups',require('./api/chatGroup'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x53'),require('./api/chatProactiveAction'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x54'),require(_0xbb1f('0x55')));_0x510582[_0xbb1f('0xa')]('/api/cm/contacts',require(_0xbb1f('0x56')));_0x510582['use'](_0xbb1f('0x57'),require('./api/cmHopper'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x58'),require(_0xbb1f('0x59')));_0x510582['use']('/api/cm/hopper_final',require(_0xbb1f('0x5a')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x5b'),require(_0xbb1f('0x5c')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x5d'),require(_0xbb1f('0x5e')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x5f'),require(_0xbb1f('0x60')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x61'),require(_0xbb1f('0x62')));_0x510582['use'](_0xbb1f('0x63'),require(_0xbb1f('0x64')));_0x510582['use']('/api/dispositions',require(_0xbb1f('0x65')));_0x510582['use'](_0xbb1f('0x66'),require(_0xbb1f('0x67')));_0x510582['use'](_0xbb1f('0x68'),require('./api/interval'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x69'),require(_0xbb1f('0x6a')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x6b'),require('./api/cdr'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x6c'),require('./api/voiceQueuesLog'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x6d'),require(_0xbb1f('0x6e')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x6f'),require(_0xbb1f('0x70')));_0x510582[_0xbb1f('0xa')]('/api/tags',require(_0xbb1f('0x71')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x72'),require(_0xbb1f('0x73')));_0x510582['use'](_0xbb1f('0x74'),require(_0xbb1f('0x75')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x76'),require(_0xbb1f('0x77')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x78'),require(_0xbb1f('0x79')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x7a'),require(_0xbb1f('0x7b')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x7c'),require(_0xbb1f('0x7d')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x7e'),require(_0xbb1f('0x7f')));_0x510582['use'](_0xbb1f('0x80'),require(_0xbb1f('0x81')));_0x510582[_0xbb1f('0xa')]('/api/analytics/custom_reports',require(_0xbb1f('0x82')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x83'),require('./api/analyticDefaultReport'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x84'),require(_0xbb1f('0x85')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x86'),require('./api/analyticMetric'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x87'),require(_0xbb1f('0x88')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x89'),require('./api/analyticTreeReport'));_0x510582[_0xbb1f('0xa')]('/api/integrations/salesforce/accounts',require(_0xbb1f('0x8a')));_0x510582['use'](_0xbb1f('0x8b'),require(_0xbb1f('0x8c')));_0x510582[_0xbb1f('0xa')]('/api/integrations/salesforce/fields',require(_0xbb1f('0x8d')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x8e'),require('./api/intSugarcrmAccount'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x8f'),require(_0xbb1f('0x90')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x91'),require(_0xbb1f('0x92')));_0x510582['use']('/api/integrations/desk/accounts',require('./api/intDeskAccount'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x93'),require('./api/intDeskConfiguration'));_0x510582[_0xbb1f('0xa')]('/api/integrations/desk/fields',require(_0xbb1f('0x94')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x95'),require(_0xbb1f('0x96')));_0x510582[_0xbb1f('0xa')]('/api/integrations/zoho/configurations',require(_0xbb1f('0x97')));_0x510582[_0xbb1f('0xa')]('/api/integrations/zoho/fields',require(_0xbb1f('0x98')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x99'),require(_0xbb1f('0x9a')));_0x510582[_0xbb1f('0xa')]('/api/integrations/zendesk/configurations',require(_0xbb1f('0x9b')));_0x510582['use'](_0xbb1f('0x9c'),require('./api/intZendeskField'));_0x510582['use']('/api/integrations/freshdesk/accounts',require(_0xbb1f('0x9d')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x9e'),require(_0xbb1f('0x9f')));_0x510582['use'](_0xbb1f('0xa0'),require(_0xbb1f('0xa1')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xa2'),require(_0xbb1f('0xa3')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xa4'),require(_0xbb1f('0xa5')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xa6'),require(_0xbb1f('0xa7')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xa8'),require(_0xbb1f('0xa9')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xaa'),require(_0xbb1f('0xab')));_0x510582[_0xbb1f('0xa')]('/api/integrations/servicenow/fields',require(_0xbb1f('0xac')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xad'),require(_0xbb1f('0xae')));_0x510582['use']('/api/integrations/dynamics365/configurations',require(_0xbb1f('0xaf')));_0x510582[_0xbb1f('0xa')]('/api/integrations/dynamics365/fields',require(_0xbb1f('0xb0')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xb1'),require('./api/intFreshsalesAccount'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xb2'),require(_0xbb1f('0xb3')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xb4'),require(_0xbb1f('0xb5')));_0x510582['use']('/api/networks',require(_0xbb1f('0xb6')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xb7'),require(_0xbb1f('0xb8')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xb9'),require(_0xbb1f('0xba')));_0x510582['use'](_0xbb1f('0xbb'),require(_0xbb1f('0xbc')));_0x510582['use'](_0xbb1f('0xbd'),require(_0xbb1f('0xbe')));_0x510582['use'](_0xbb1f('0xbf'),require(_0xbb1f('0xc0')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xc1'),require(_0xbb1f('0xc2')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xc3'),require(_0xbb1f('0xc4')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xc5'),require('./api/squareReportDetail'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xc6'),require(_0xbb1f('0xc7')));_0x510582['use'](_0xbb1f('0xc8'),require(_0xbb1f('0xc9')));_0x510582['use']('/api/square/odbc',require(_0xbb1f('0xca')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xcb'),require(_0xbb1f('0xcc')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xcd'),require(_0xbb1f('0xce')));_0x510582[_0xbb1f('0xa')]('/api/square/messages',require(_0xbb1f('0xcf')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xd0'),require(_0xbb1f('0xd1')));_0x510582['use'](_0xbb1f('0xd2'),require(_0xbb1f('0xd3')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xd4'),require('./api/campaign'));_0x510582['use'](_0xbb1f('0xd5'),require(_0xbb1f('0xd6')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xd7'),require(_0xbb1f('0xd8')));_0x510582[_0xbb1f('0xa')]('/api/plugins',require('./api/plugin'));_0x510582[_0xbb1f('0xa')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xd9'),require('./api/chatTransferReport'));_0x510582['use'](_0xbb1f('0xda'),require(_0xbb1f('0xdb')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xdc'),require(_0xbb1f('0xdd')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xde'),require('./api/smsTransferReport'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xdf'),require('./api/cmList'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xe0'),require(_0xbb1f('0xe1')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xe2'),require(_0xbb1f('0xe3')));_0x510582[_0xbb1f('0xa')]('/api/userProfile/sections',require(_0xbb1f('0xe4')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xe5'),require(_0xbb1f('0xe6')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xe7'),require(_0xbb1f('0xe8')));_0x510582['use'](_0xbb1f('0xe9'),require(_0xbb1f('0xea')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xeb'),require(_0xbb1f('0xec')));_0x510582['use'](_0xbb1f('0xed'),require(_0xbb1f('0xee')));_0x510582[_0xbb1f('0xa')]('/api/whatsapp/messages',require(_0xbb1f('0xef')));_0x510582[_0xbb1f('0xa')]('/api/whatsapp/reports/queue',require(_0xbb1f('0xf0')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xf1'),require('./api/whatsappTransferReport'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xf2'),require(_0xbb1f('0xf3')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xf4'),require(_0xbb1f('0xf5')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xf6'),require(_0xbb1f('0xf7')));_0x510582['use'](_0xbb1f('0xf8'),require(_0xbb1f('0xf9')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xfa'),require('./api/mailInteractionHasTag'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xfb'),require('./api/authLocal'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xfc'),require('./api/authGoogle'));_0x510582['use']('/api/auth/activedirectory',require(_0xbb1f('0xfd')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0xfe'),require(_0xbb1f('0xff')));_0x510582['use'](_0xbb1f('0x100'),require(_0xbb1f('0x101')));_0x510582['use'](_0xbb1f('0x102'),require(_0xbb1f('0x103')));_0x510582[_0xbb1f('0xa')]('/api/system',require(_0xbb1f('0x104')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x105'),require(_0xbb1f('0x106')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x107'),require('./api/webbar'));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x108'),clientSideLogs);_0x510582[_0xbb1f('0xa')](_0xbb1f('0x109'),express[_0xbb1f('0x10a')](path[_0xbb1f('0x10b')](config[_0xbb1f('0x10c')],'/apidoc')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x10d'),express[_0xbb1f('0x10a')](path['join'](config[_0xbb1f('0x10c')],'/www')));_0x510582[_0xbb1f('0xa')](_0xbb1f('0x10e'),express['static'](path[_0xbb1f('0x10b')](config['root'],_0xbb1f('0x10e'))));_0x510582['use'](_0xbb1f('0x10f'),express[_0xbb1f('0x10a')](path[_0xbb1f('0x10b')](config[_0xbb1f('0x10c')],_0xbb1f('0x110'),_0xbb1f('0x111'))));_0x510582[_0xbb1f('0xa')]('/plugins',express['static'](path[_0xbb1f('0x10b')](config[_0xbb1f('0x10c')],_0xbb1f('0x112'))));_0x510582[_0xbb1f('0x113')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xbb1f('0x114')](errors[0x194]);_0x510582['route']('/*')[_0xbb1f('0x114')](function(_0x57ec43,_0x5df6ef){_0x5df6ef[_0xbb1f('0x115')](path['resolve'](_0x510582[_0xbb1f('0x114')](_0xbb1f('0x116'))+'/index.html'));});return _0x510582;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 1180d78..2200b57 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0127=['../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc'];(function(_0x129fae,_0x30c943){var _0x5758c0=function(_0x17e561){while(--_0x17e561){_0x129fae['push'](_0x129fae['shift']());}};_0x5758c0(++_0x30c943);}(_0x0127,0xa0));var _0x7012=function(_0x2ecf8d,_0x5bc157){_0x2ecf8d=_0x2ecf8d-0x0;var _0x391a1e=_0x0127[_0x2ecf8d];return _0x391a1e;};'use strict';var jayson=require(_0x7012('0x0'));var _=require('lodash');var config=require(_0x7012('0x1'));exports[_0x7012('0x2')]=function(){return new Promise(function(_0x4a6b99,_0x467838){var _0x2c65bc={};_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x3')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x5')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x6')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x7')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x8')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x9')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0xa')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0xb')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0xc')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0xd')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0xe')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0xf')));_0x2c65bc=_['merge'](_0x2c65bc,require('../api/mailQueue/mailQueue.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x10')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x11')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x12')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x13')));_0x2c65bc=_['merge'](_0x2c65bc,require('../api/faxAccount/faxAccount.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x14')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x15')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x16')));_0x2c65bc=_['merge'](_0x2c65bc,require('../api/faxQueue/faxQueue.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x17')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x18')));_0x2c65bc=_['merge'](_0x2c65bc,require('../api/smsInteraction/smsInteraction.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x19')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x1a')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x1b')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x1c')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x1d')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x1e')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/chatInteraction/chatInteraction.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x1f')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x20')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x21')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x22')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x23')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x24')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x25')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x26')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x27')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/pause/pause.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/sound/sound.rpc'));_0x2c65bc=_['merge'](_0x2c65bc,require('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc'));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x28')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/trigger/trigger.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/variable/variable.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x29')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x2a')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x2b')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x2c')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x2d')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x2e')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x2f')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x30')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x31')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x32')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/squareReport/squareReport.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x33')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/setting/setting.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x34')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x35')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/squareRecording/squareRecording.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x36')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x37')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x38')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x39')));_0x2c65bc=_['merge'](_0x2c65bc,require(_0x7012('0x3a')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x3b')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x3c')));_0x2c65bc=_[_0x7012('0x4')](_0x2c65bc,require(_0x7012('0x3d')));var _0x2551f8=jayson['server'](_0x2c65bc)['http']();var _0x4533c6=config[_0x7012('0x3e')][_0x7012('0x3f')]||config[_0x7012('0x3f')]+0x1;var _0x2d3443=config['rpc']['ip']||_0x7012('0x40');_0x2551f8['on'](_0x7012('0x41'),function(_0x304eb0){return _0x467838(_0x304eb0);});_0x2551f8[_0x7012('0x2')](_0x4533c6,_0x2d3443,function(){console[_0x7012('0x42')](_0x7012('0x43'),_0x2d3443,_0x4533c6);require('../config/triggers')[_0x7012('0x44')]();return _0x4a6b99(_0x7012('0x45')+_0x2d3443+':'+_0x4533c6);});});}; \ No newline at end of file +var _0x83b3=['../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/cmHopperAdditionalPhone/cmHopperAdditionalPhone.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/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x51f156,_0x4ca398){var _0x21a5f7=function(_0x391a90){while(--_0x391a90){_0x51f156['push'](_0x51f156['shift']());}};_0x21a5f7(++_0x4ca398);}(_0x83b3,0x147));var _0x383b=function(_0x3694fb,_0x3d8f22){_0x3694fb=_0x3694fb-0x0;var _0x3e8f42=_0x83b3[_0x3694fb];return _0x3e8f42;};'use strict';var jayson=require(_0x383b('0x0'));var _=require(_0x383b('0x1'));var config=require(_0x383b('0x2'));exports[_0x383b('0x3')]=function(){return new Promise(function(_0x18acbd,_0x439bad){var _0x35c94b={};_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x5')));_0x35c94b=_['merge'](_0x35c94b,require('../api/voiceExtension/voiceExtension.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x6')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x7')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x8')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x9')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0xa')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0xb')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0xc')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/mailServerIn/mailServerIn.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0xd')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0xe')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/mailInteraction/mailInteraction.rpc'));_0x35c94b=_['merge'](_0x35c94b,require(_0x383b('0xf')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x10')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x11')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x12')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x13')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x14')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x15')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x16')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/smsAccount/smsAccount.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x17')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x18')));_0x35c94b=_['merge'](_0x35c94b,require(_0x383b('0x19')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x1a')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x1b')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x1c')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x1d')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x1e')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x1f')));_0x35c94b=_['merge'](_0x35c94b,require('../api/chatMessage/chatMessage.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x20')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x21')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x22')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x23')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x24')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x25')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x26')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/pause/pause.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x27')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x28')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/template/template.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x29')));_0x35c94b=_['merge'](_0x35c94b,require(_0x383b('0x2a')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x2b')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x2c')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x2d')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x2e')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x2f')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x30')));_0x35c94b=_['merge'](_0x35c94b,require(_0x383b('0x31')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x32')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x33')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x34')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x35')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x36')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x37')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x38')));_0x35c94b=_['merge'](_0x35c94b,require(_0x383b('0x39')));_0x35c94b=_['merge'](_0x35c94b,require(_0x383b('0x3a')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x3b')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/attachment/attachment.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x3c')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x3d')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require(_0x383b('0x3e')));_0x35c94b=_[_0x383b('0x4')](_0x35c94b,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x420f2d=jayson[_0x383b('0x3f')](_0x35c94b)['http']();var _0x2aa654=config[_0x383b('0x40')][_0x383b('0x41')]||config[_0x383b('0x41')]+0x1;var _0x4f1f73=config[_0x383b('0x40')]['ip']||_0x383b('0x42');_0x420f2d['on'](_0x383b('0x43'),function(_0x4c2e3b){return _0x439bad(_0x4c2e3b);});_0x420f2d[_0x383b('0x3')](_0x2aa654,_0x4f1f73,function(){console['log'](_0x383b('0x44'),_0x4f1f73,_0x2aa654);require(_0x383b('0x45'))[_0x383b('0x46')]();return _0x18acbd(_0x383b('0x47')+_0x4f1f73+':'+_0x2aa654);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 6fcd275..e2a43e8 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 _0xfb67=['./reply','./error','call','setEncoding','setTimeout','utf8','ready','line','hangup','substring','520-Invalid','search','function','indexOf','substr','startsWith','split','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','sync','answer','sendRequest','ANSWER','prototype','getData','beep','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter'];(function(_0x291449,_0x2d5766){var _0x5d8e50=function(_0x43501c){while(--_0x43501c){_0x291449['push'](_0x291449['shift']());}};_0x5d8e50(++_0x2d5766);}(_0xfb67,0xdd));var _0x7fb6=function(_0x180e67,_0x1fbfb5){_0x180e67=_0x180e67-0x0;var _0x8c2e7=_0xfb67[_0x180e67];return _0x8c2e7;};'use strict';var util=require(_0x7fb6('0x0'));var _=require(_0x7fb6('0x1'));var EventEmitter=require(_0x7fb6('0x2'))[_0x7fb6('0x3')];var AGIReply=require(_0x7fb6('0x4'));var AGIError=require(_0x7fb6('0x5'));function AGIChannel(_0x41724d){var _0x5db5cf=this,_0x40c3ce=new AGIReply(),_0x29dadc=![],_0x1c528e={};EventEmitter[_0x7fb6('0x6')](_0x5db5cf);_0x41724d[_0x7fb6('0x7')]('utf8');_0x41724d[_0x7fb6('0x8')](0x8*0x3c*0x3c*0x3e8);_0x40c3ce[_0x7fb6('0x7')](_0x7fb6('0x9'));_0x40c3ce['on']('headers',function(_0x168ebb){for(var _0x696959 in _0x168ebb){_0x5db5cf[_0x696959]=_0x168ebb[_0x696959];}_0x5db5cf['emit'](_0x7fb6('0xa'));});_0x40c3ce['on'](_0x7fb6('0xb'),function(_0x46cd91){if(_0x46cd91['toLowerCase']()==_0x7fb6('0xc')){_0x5db5cf['emit'](_0x7fb6('0xc'));return;}if(_0x46cd91[_0x7fb6('0xd')](0x0,0xb)==_0x7fb6('0xe')){_0x29dadc=!![];}if(_0x29dadc){_0x1c528e['rx']+=_0x46cd91+'\x0a';if(_0x46cd91[_0x7fb6('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x29dadc=![];}}else{_0x1c528e['rx']=_0x46cd91;}if(_0x29dadc){return;}if(typeof _0x1c528e['cb']==_0x7fb6('0x10')){var _0x1b6ac7=_0x1c528e['rx']['substring'](0x0,0x3),_0x3c594f=null,_0x549370=null;_0x1b6ac7=parseInt(_0x1b6ac7);if(isNaN(_0x1b6ac7)){_0x1c528e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x1b6ac7!=0xc8){_0x1c528e['cb'](null,{'code':_0x1b6ac7,'result':-0x1,'extra':'KO'});return;}_0x3c594f=_0x1c528e['rx']['substring'](0x4)['replace']('result=','');if(_0x3c594f[_0x7fb6('0x11')]('\x20')!=-0x1){_0x3c594f=_0x3c594f[_0x7fb6('0x12')](0x0,_0x3c594f['indexOf']('\x20'));}if(_[_0x7fb6('0x13')](_0x3c594f,'-1')){_0x3c594f=parseInt(_0x3c594f);}_0x549370=_0x1c528e['rx'][_0x7fb6('0x14')]('\x20');if(_0x549370[_0x7fb6('0x15')]==0x3){_0x549370=_0x549370[0x2][_0x7fb6('0xd')](0x1,_0x549370[0x2][_0x7fb6('0x15')]-0x1);}else if(_0x549370[_0x7fb6('0x15')]>0x3){var _0x3e89c7=/\((.+)\)/;var _0x33fb18=_0x1c528e['rx'][_0x7fb6('0x16')](_0x3e89c7);if(_0x33fb18){_0x549370=_0x33fb18[0x1];}else{_0x549370=null;}}else{_0x549370=null;}_0x1c528e['cb'](null,{'code':_0x1b6ac7,'result':_0x3c594f,'extra':_0x549370});}});_0x41724d['on'](_0x7fb6('0x17'),function(_0x3ef701){_0x5db5cf[_0x7fb6('0x18')]('error',new AGIError(_0x7fb6('0x19'),_0x3ef701[_0x7fb6('0x1a')]));});_0x41724d['on'](_0x7fb6('0x1b'),function(){_0x5db5cf[_0x7fb6('0x18')](_0x7fb6('0x1b'),new AGIError(_0x7fb6('0x1c')));});_0x41724d['on'](_0x7fb6('0x1d'),function(){_0x5db5cf['emit']('timeout',new AGIError(_0x7fb6('0x1e')));_0x41724d[_0x7fb6('0x1f')]();});_0x41724d[_0x7fb6('0x20')](_0x40c3ce);this[_0x7fb6('0x21')]=function(_0x5ceef5,_0xc44cf5){var _0x5ceef5=_0x5ceef5||'',_0xc44cf5=typeof _0xc44cf5==_0x7fb6('0x10')?_0xc44cf5:new Function();_0x1c528e={'tx':_0x5ceef5,'rx':'','cb':_0xc44cf5};_0x41724d['write'](_0x5ceef5+'\x0a');},this['close']=function(){_0x41724d[_0x7fb6('0x1f')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x455916){return this['command'][_0x7fb6('0x22')](this,_0x455916);};AGIChannel['prototype'][_0x7fb6('0x23')]=function(){return this[_0x7fb6('0x24')](_0x7fb6('0x25'));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x27')]=function(_0x4c9b90,_0x46e9dd,_0x4c7df4){_0x4c9b90=_0x4c9b90===undefined?_0x7fb6('0x28'):_0x4c9b90;_0x46e9dd=_0x46e9dd===undefined?'5':_0x46e9dd;_0x4c7df4=_0x4c7df4===undefined?'1':_0x4c7df4;return this[_0x7fb6('0x24')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4c9b90,_0x46e9dd*0x3e8,_0x4c7df4));};AGIChannel['prototype'][_0x7fb6('0x29')]=function(_0x440a04){_0x440a04=_0x440a04||_0x7fb6('0x2a');return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x2c'),_0x440a04));};AGIChannel['prototype'][_0x7fb6('0x2d')]=function(_0x5251ab,_0x4221c3){if(_[_0x7fb6('0x2e')](_0x4221c3)){return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x2f'),_0x5251ab,_0x4221c3[_0x7fb6('0x30')](',')));}return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x2f'),_0x5251ab,_0x4221c3));};AGIChannel['prototype'][_0x7fb6('0x31')]=function(_0x3c12b5){return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x32'),_0x3c12b5));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x33')]=function(_0x2aa952){return this[_0x7fb6('0x24')](util['format'](_0x7fb6('0x34'),_0x2aa952));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x35')]=function(_0x3cc10d){return this['sendRequest'](util['format'](_0x7fb6('0x36'),_0x3cc10d));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0xc')]=function(){return this[_0x7fb6('0x24')](_0x7fb6('0x37'));};AGIChannel['prototype'][_0x7fb6('0x38')]=function(_0x2cbc80,_0x29c43f){var _0x3ebe3=_['isBoolean'](_0x29c43f)||_[_0x7fb6('0x39')](_0x29c43f)?_0x29c43f[_0x7fb6('0x3a')]():_0x29c43f;return this['sendRequest'](util[_0x7fb6('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x2cbc80,_0x3ebe3?_0x3ebe3[_0x7fb6('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x7fb6('0x26')]['sayNumber']=function(_0x274726,_0x356a50){return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x3b'),_0x274726,_0x356a50));};AGIChannel[_0x7fb6('0x26')]['sayDigits']=function(_0x5e63c2,_0x5d237){return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x3c'),_0x5e63c2,_0x5d237));};AGIChannel['prototype']['sayPhonetic']=function(_0x213e6a,_0x49ff5f){return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x3d'),_0x213e6a,_0x49ff5f));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x3e')]=function(_0x368893,_0xa90e5e,_0x2809bf){_0xa90e5e=_0xa90e5e||this['extension'];_0x2809bf=_0x2809bf||0x1;this['setContext'](_0x368893);this[_0x7fb6('0x33')](_0xa90e5e);this['setPriority'](_0x2809bf);return this[_0x7fb6('0x29')](util[_0x7fb6('0x2b')](_0x7fb6('0x3f'),_0x368893,_0xa90e5e,_0x2809bf));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x40')]=function(_0x3b77ba){return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3b77ba));};AGIChannel['prototype'][_0x7fb6('0x41')]=function(_0x5859e2,_0x39480c,_0x5bf770,_0x348b46,_0x23be92,_0x4a2344){_0x39480c=_0x39480c||_0x7fb6('0x42');_0x5bf770=_0x5bf770||'';_0x348b46=_0x348b46===undefined?-0x1:_0x348b46==='-1'?-0x1:_0x348b46*0x3e8;_0x23be92=_0x23be92===undefined?'':'s='+_0x23be92;_0x4a2344=_0x4a2344?_0x7fb6('0x43'):'';return this[_0x7fb6('0x24')](util[_0x7fb6('0x2b')](_0x7fb6('0x44'),_0x5859e2,_0x39480c,_0x5bf770,_0x348b46,_0x4a2344,_0x23be92));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x45')]=function(_0x11db7c,_0x34532f){_0x34532f=_0x34532f||'';return this['sendRequest'](util[_0x7fb6('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x11db7c,_0x34532f));};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x46')]=function(_0x58f4b7){return this[_0x7fb6('0x2d')](_0x7fb6('0x47'),_0x58f4b7);};AGIChannel[_0x7fb6('0x26')]['wait']=function(_0x3179af){return this[_0x7fb6('0x2d')](_0x7fb6('0x48'),_0x3179af);};AGIChannel[_0x7fb6('0x26')][_0x7fb6('0x17')]=function(_0x257ad4,_0x363564){this[_0x7fb6('0x29')](util[_0x7fb6('0x2b')](_0x7fb6('0x49'),_0x257ad4['id'],_0x257ad4['label'],_0x363564));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x7fb6('0x4a')]=AGIChannel; \ No newline at end of file +var _0x5396=['RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','no\x20code','replace','result=','substr','indexOf','startsWith','length','match','error','E_AGI_SOCKET_ERROR','code','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','close','inherits','sendRequest','prototype','ANSWER','beep','format','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','SAY\x20NUMBER\x20%s\x20%s','sayDigits','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'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x5396,0x134));var _0x6539=function(_0x47d10f,_0x44846c){_0x47d10f=_0x47d10f-0x0;var _0x1f06ac=_0x5396[_0x47d10f];return _0x1f06ac;};'use strict';var util=require(_0x6539('0x0'));var _=require(_0x6539('0x1'));var EventEmitter=require(_0x6539('0x2'))[_0x6539('0x3')];var AGIReply=require(_0x6539('0x4'));var AGIError=require(_0x6539('0x5'));function AGIChannel(_0x40a594){var _0x58a35f=this,_0x5bea39=new AGIReply(),_0x574389=![],_0x27972e={};EventEmitter[_0x6539('0x6')](_0x58a35f);_0x40a594[_0x6539('0x7')](_0x6539('0x8'));_0x40a594[_0x6539('0x9')](0x8*0x3c*0x3c*0x3e8);_0x5bea39[_0x6539('0x7')](_0x6539('0x8'));_0x5bea39['on'](_0x6539('0xa'),function(_0x2da1c8){for(var _0x4b9e75 in _0x2da1c8){_0x58a35f[_0x4b9e75]=_0x2da1c8[_0x4b9e75];}_0x58a35f[_0x6539('0xb')](_0x6539('0xc'));});_0x5bea39['on'](_0x6539('0xd'),function(_0xe7eeb0){if(_0xe7eeb0[_0x6539('0xe')]()=='hangup'){_0x58a35f[_0x6539('0xb')](_0x6539('0xf'));return;}if(_0xe7eeb0[_0x6539('0x10')](0x0,0xb)==_0x6539('0x11')){_0x574389=!![];}if(_0x574389){_0x27972e['rx']+=_0xe7eeb0+'\x0a';if(_0xe7eeb0[_0x6539('0x12')]('520\x20End\x20of\x20proper')!=-0x1){_0x574389=![];}}else{_0x27972e['rx']=_0xe7eeb0;}if(_0x574389){return;}if(typeof _0x27972e['cb']=='function'){var _0x470294=_0x27972e['rx'][_0x6539('0x10')](0x0,0x3),_0x438312=null,_0x50bb16=null;_0x470294=parseInt(_0x470294);if(isNaN(_0x470294)){_0x27972e['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x6539('0x13')});return;}if(_0x470294!=0xc8){_0x27972e['cb'](null,{'code':_0x470294,'result':-0x1,'extra':'KO'});return;}_0x438312=_0x27972e['rx'][_0x6539('0x10')](0x4)[_0x6539('0x14')](_0x6539('0x15'),'');if(_0x438312['indexOf']('\x20')!=-0x1){_0x438312=_0x438312[_0x6539('0x16')](0x0,_0x438312[_0x6539('0x17')]('\x20'));}if(_[_0x6539('0x18')](_0x438312,'-1')){_0x438312=parseInt(_0x438312);}_0x50bb16=_0x27972e['rx']['split']('\x20');if(_0x50bb16[_0x6539('0x19')]==0x3){_0x50bb16=_0x50bb16[0x2][_0x6539('0x10')](0x1,_0x50bb16[0x2][_0x6539('0x19')]-0x1);}else if(_0x50bb16[_0x6539('0x19')]>0x3){var _0x6150f9=/\((.+)\)/;var _0x4b66e5=_0x27972e['rx'][_0x6539('0x1a')](_0x6150f9);if(_0x4b66e5){_0x50bb16=_0x4b66e5[0x1];}else{_0x50bb16=null;}}else{_0x50bb16=null;}_0x27972e['cb'](null,{'code':_0x470294,'result':_0x438312,'extra':_0x50bb16});}});_0x40a594['on'](_0x6539('0x1b'),function(_0x559a9e){_0x58a35f[_0x6539('0xb')](_0x6539('0x1b'),new AGIError(_0x6539('0x1c'),_0x559a9e[_0x6539('0x1d')]));});_0x40a594['on']('close',function(){_0x58a35f[_0x6539('0xb')]('close',new AGIError(_0x6539('0x1e')));});_0x40a594['on'](_0x6539('0x1f'),function(){_0x58a35f[_0x6539('0xb')]('timeout',new AGIError(_0x6539('0x20')));_0x40a594[_0x6539('0x21')]();});_0x40a594[_0x6539('0x22')](_0x5bea39);this['command']=function(_0x4c4c0b,_0x2b3409){var _0x4c4c0b=_0x4c4c0b||'',_0x2b3409=typeof _0x2b3409=='function'?_0x2b3409:new Function();_0x27972e={'tx':_0x4c4c0b,'rx':'','cb':_0x2b3409};_0x40a594[_0x6539('0x23')](_0x4c4c0b+'\x0a');},this[_0x6539('0x24')]=function(){_0x40a594[_0x6539('0x21')]();};}util[_0x6539('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x6539('0x26')]=function(_0x3721b6){return this['command']['sync'](this,_0x3721b6);};AGIChannel[_0x6539('0x27')]['answer']=function(){return this[_0x6539('0x26')](_0x6539('0x28'));};AGIChannel['prototype']['getData']=function(_0x54b51f,_0x1a626d,_0x6b9a7a){_0x54b51f=_0x54b51f===undefined?_0x6539('0x29'):_0x54b51f;_0x1a626d=_0x1a626d===undefined?'5':_0x1a626d;_0x6b9a7a=_0x6b9a7a===undefined?'1':_0x6b9a7a;return this[_0x6539('0x26')](util[_0x6539('0x2a')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x54b51f,_0x1a626d*0x3e8,_0x6b9a7a));};AGIChannel['prototype'][_0x6539('0x2b')]=function(_0x1805d4){_0x1805d4=_0x1805d4||_0x6539('0x2c');return this['sendRequest'](util[_0x6539('0x2a')]('VERBOSE\x20\x22%s\x22',_0x1805d4));};AGIChannel[_0x6539('0x27')][_0x6539('0x2d')]=function(_0x5db5b6,_0x97f996){if(_[_0x6539('0x2e')](_0x97f996)){return this[_0x6539('0x26')](util[_0x6539('0x2a')](_0x6539('0x2f'),_0x5db5b6,_0x97f996[_0x6539('0x30')](',')));}return this['sendRequest'](util[_0x6539('0x2a')]('EXEC\x20%s\x20%s',_0x5db5b6,_0x97f996));};AGIChannel['prototype'][_0x6539('0x31')]=function(_0x51d36e){return this[_0x6539('0x26')](util[_0x6539('0x2a')]('SET\x20CONTEXT\x20%s',_0x51d36e));};AGIChannel['prototype'][_0x6539('0x32')]=function(_0xb86d94){return this['sendRequest'](util[_0x6539('0x2a')](_0x6539('0x33'),_0xb86d94));};AGIChannel[_0x6539('0x27')][_0x6539('0x34')]=function(_0x1f3e2f){return this[_0x6539('0x26')](util['format'](_0x6539('0x35'),_0x1f3e2f));};AGIChannel[_0x6539('0x27')]['hangup']=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x6539('0x27')]['setVariable']=function(_0x2bb7d2,_0x2189ca){var _0x43695d=_[_0x6539('0x36')](_0x2189ca)||_[_0x6539('0x37')](_0x2189ca)?_0x2189ca[_0x6539('0x38')]():_0x2189ca;return this[_0x6539('0x26')](util[_0x6539('0x2a')](_0x6539('0x39'),_0x2bb7d2,_0x43695d?_0x43695d[_0x6539('0x38')]()[_0x6539('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x6539('0x27')]['sayNumber']=function(_0x588195,_0x413e48){return this[_0x6539('0x26')](util[_0x6539('0x2a')](_0x6539('0x3a'),_0x588195,_0x413e48));};AGIChannel[_0x6539('0x27')][_0x6539('0x3b')]=function(_0x37ec63,_0x25247c){return this[_0x6539('0x26')](util[_0x6539('0x2a')]('SAY\x20DIGITS\x20%s\x20%s',_0x37ec63,_0x25247c));};AGIChannel['prototype']['sayPhonetic']=function(_0x7b9cf0,_0x8fd3d9){return this[_0x6539('0x26')](util[_0x6539('0x2a')](_0x6539('0x3c'),_0x7b9cf0,_0x8fd3d9));};AGIChannel[_0x6539('0x27')][_0x6539('0x3d')]=function(_0x56e233,_0x9b7ead,_0x24a5b3){_0x9b7ead=_0x9b7ead||this[_0x6539('0x3e')];_0x24a5b3=_0x24a5b3||0x1;this[_0x6539('0x31')](_0x56e233);this[_0x6539('0x32')](_0x9b7ead);this[_0x6539('0x34')](_0x24a5b3);return this[_0x6539('0x2b')](util[_0x6539('0x2a')](_0x6539('0x3f'),_0x56e233,_0x9b7ead,_0x24a5b3));};AGIChannel[_0x6539('0x27')][_0x6539('0x40')]=function(_0x581d91){return this[_0x6539('0x26')](util['format'](_0x6539('0x41'),_0x581d91));};AGIChannel[_0x6539('0x27')][_0x6539('0x42')]=function(_0xd4aae1,_0x4925df,_0x41c731,_0x2618fd,_0x34cb4f,_0x21629b){_0x4925df=_0x4925df||'wav';_0x41c731=_0x41c731||'';_0x2618fd=_0x2618fd===undefined?-0x1:_0x2618fd==='-1'?-0x1:_0x2618fd*0x3e8;_0x34cb4f=_0x34cb4f===undefined?'':'s='+_0x34cb4f;_0x21629b=_0x21629b?'BEEP':'';return this[_0x6539('0x26')](util[_0x6539('0x2a')](_0x6539('0x43'),_0xd4aae1,_0x4925df,_0x41c731,_0x2618fd,_0x21629b,_0x34cb4f));};AGIChannel[_0x6539('0x27')][_0x6539('0x44')]=function(_0x310898,_0x4cf0dc){_0x4cf0dc=_0x4cf0dc||'';return this[_0x6539('0x26')](util[_0x6539('0x2a')](_0x6539('0x45'),_0x310898,_0x4cf0dc));};AGIChannel[_0x6539('0x27')][_0x6539('0x46')]=function(_0x46e016){return this[_0x6539('0x2d')](_0x6539('0x47'),_0x46e016);};AGIChannel[_0x6539('0x27')][_0x6539('0x48')]=function(_0x29e361){return this[_0x6539('0x2d')]('WAIT',_0x29e361);};AGIChannel[_0x6539('0x27')][_0x6539('0x1b')]=function(_0x58d5be,_0x45b298){this[_0x6539('0x2b')](util[_0x6539('0x2a')](_0x6539('0x49'),_0x58d5be['id'],_0x58d5be[_0x6539('0x4a')],_0x45b298));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 8038dca..f83841b 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 _0x1922=['[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x126206,_0x46f8df){var _0x528c90=function(_0x215a63){while(--_0x215a63){_0x126206['push'](_0x126206['shift']());}};_0x528c90(++_0x46f8df);}(_0x1922,0x127));var _0x2192=function(_0x301ff3,_0x1ae56e){_0x301ff3=_0x301ff3-0x0;var _0x11f57a=_0x1922[_0x301ff3];return _0x11f57a;};'use strict';var util=require(_0x2192('0x0'));var error={'E_AGI_UNDEFINED':_0x2192('0x1'),'E_AGI_ARGUMENT_PORT':_0x2192('0x2'),'E_AGI_SERVER_ERROR':_0x2192('0x3'),'E_AGI_SERVER_CLOSE':_0x2192('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x2192('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x2192('0x6'),'E_AGI_SOCKET_ERROR':_0x2192('0x7'),'E_AGI_SOCKET_CLOSE':_0x2192('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x2192('0x9'),'E_AGI_COMMAND_EMPTY':_0x2192('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x2192('0xb'),'E_AGI_IVR_ENTRY':_0x2192('0xc')};function AGIError(_0x26a42f){var _0x26a42f=_0x26a42f||null,_0x237586=_0x237586||[],_0x4192de=0x1,_0x517a14='';if(!error[_0x26a42f]){_0x26a42f=_0x2192('0xd');}_0x237586[_0x2192('0xe')](error[_0x26a42f]);while(arguments[_0x4192de]){_0x237586['push'](arguments[_0x4192de]);_0x4192de++;}_0x517a14=util[_0x2192('0xf')][_0x2192('0x10')](util,_0x237586);this[_0x2192('0x11')]=_0x517a14;this[_0x2192('0x12')]=_0x26a42f;}module[_0x2192('0x13')]=AGIError; \ No newline at end of file +var _0x172a=['push','format','apply','message','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED'];(function(_0x3c8be9,_0x278c00){var _0x302bfa=function(_0x445d38){while(--_0x445d38){_0x3c8be9['push'](_0x3c8be9['shift']());}};_0x302bfa(++_0x278c00);}(_0x172a,0x91));var _0xa172=function(_0x2e913b,_0x4b7071){_0x2e913b=_0x2e913b-0x0;var _0x173899=_0x172a[_0x2e913b];return _0x173899;};'use strict';var util=require(_0xa172('0x0'));var error={'E_AGI_UNDEFINED':_0xa172('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0xa172('0x2'),'E_AGI_SERVER_CLOSE':_0xa172('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xa172('0x4'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xa172('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa172('0x6'),'E_AGI_IVR_ENTRY':_0xa172('0x7')};function AGIError(_0x597f45){var _0x597f45=_0x597f45||null,_0x5d0256=_0x5d0256||[],_0x3c8cf8=0x1,_0x33bff9='';if(!error[_0x597f45]){_0x597f45=_0xa172('0x8');}_0x5d0256[_0xa172('0x9')](error[_0x597f45]);while(arguments[_0x3c8cf8]){_0x5d0256[_0xa172('0x9')](arguments[_0x3c8cf8]);_0x3c8cf8++;}_0x33bff9=util[_0xa172('0xa')][_0xa172('0xb')](util,_0x5d0256);this[_0xa172('0xc')]=_0x33bff9;this[_0xa172('0xd')]=_0x597f45;}module['exports']=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index b1ff714..ba7a7f6 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4250=['redis','defaults','localhost','subscribe','agi','emit','error','E_AGI_SERVER_ERROR','message','parse','projectUpdate','exports','events','EventEmitter','ioredis','../../config/environment'];(function(_0x26cba0,_0x242857){var _0x10c6b1=function(_0x5e6a45){while(--_0x5e6a45){_0x26cba0['push'](_0x26cba0['shift']());}};_0x10c6b1(++_0x242857);}(_0x4250,0x8c));var _0x0425=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x4250[_0x2bf141];return _0x48277b;};'use strict';var _=require('lodash');var EventEmitter=require(_0x0425('0x0'))[_0x0425('0x1')];var Redis=require(_0x0425('0x2'));var AGIError=require('./error');var config=require(_0x0425('0x3'));config[_0x0425('0x4')]=_[_0x0425('0x5')](config[_0x0425('0x4')],{'host':_0x0425('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x0425('0x4')]);sub[_0x0425('0x7')](_0x0425('0x8'),function(_0x18cec7){if(_0x18cec7)return eventEmitter[_0x0425('0x9')](_0x0425('0xa'),new AGIError(_0x0425('0xb'),_0x18cec7));});sub['on'](_0x0425('0xc'),function(_0x5bc29b,_0x476c16){if(_0x5bc29b!=='agi')return;try{var _0x3f4858=JSON[_0x0425('0xd')](_0x476c16);eventEmitter['emit'](_0x0425('0xe'),_0x3f4858);}catch(_0x3463c){eventEmitter[_0x0425('0x9')](_0x0425('0xa'),new AGIError(_0x0425('0xb'),_0x3463c));}});module[_0x0425('0xf')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0xe9b2=['EventEmitter','./error','../../config/environment','redis','defaults','localhost','subscribe','agi','message','emit','projectUpdate','exports','lodash','events'];(function(_0x1992a4,_0x2ec180){var _0x501797=function(_0x56ae44){while(--_0x56ae44){_0x1992a4['push'](_0x1992a4['shift']());}};_0x501797(++_0x2ec180);}(_0xe9b2,0x7c));var _0x2e9b=function(_0x2644dd,_0x39d79e){_0x2644dd=_0x2644dd-0x0;var _0x4dad81=_0xe9b2[_0x2644dd];return _0x4dad81;};'use strict';var _=require(_0x2e9b('0x0'));var EventEmitter=require(_0x2e9b('0x1'))[_0x2e9b('0x2')];var Redis=require('ioredis');var AGIError=require(_0x2e9b('0x3'));var config=require(_0x2e9b('0x4'));config[_0x2e9b('0x5')]=_[_0x2e9b('0x6')](config[_0x2e9b('0x5')],{'host':_0x2e9b('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x2e9b('0x5')]);sub[_0x2e9b('0x8')](_0x2e9b('0x9'),function(_0x114167){if(_0x114167)return eventEmitter['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0x114167));});sub['on'](_0x2e9b('0xa'),function(_0x3f2a6e,_0x7d7caa){if(_0x3f2a6e!==_0x2e9b('0x9'))return;try{var _0x21e059=JSON['parse'](_0x7d7caa);eventEmitter[_0x2e9b('0xb')](_0x2e9b('0xc'),_0x21e059);}catch(_0x13339c){eventEmitter[_0x2e9b('0xb')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x13339c));}});module[_0x2e9b('0xd')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 95d8016..9662a05 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 _0x76d2=['condition','agicommand','vswitch','target','invalid','default\x20on\x20switch\x20not\x20found','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','menu','vertices','edges','push','numberOfEdges','prototype','size','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','length','info'];(function(_0x2a3374,_0x9e53f8){var _0x53a019=function(_0xce5dec){while(--_0xce5dec){_0x2a3374['push'](_0x2a3374['shift']());}};_0x53a019(++_0x9e53f8);}(_0x76d2,0x6e));var _0x276d=function(_0x5c2d78,_0x1683c8){_0x5c2d78=_0x5c2d78-0x0;var _0x3ff753=_0x76d2[_0x5c2d78];return _0x3ff753;};'use strict';var _=require('lodash');var logger=require(_0x276d('0x0'))(_0x276d('0x1'));var verticesWithRetry=[_0x276d('0x2'),'getdigits','getsecretdigits'];var Graph=function(){this[_0x276d('0x3')]={};this[_0x276d('0x4')]={};this['numberOfEdges']=0x0;};Graph['prototype']['addVertex']=function(_0xba071c){this[_0x276d('0x3')][_0xba071c['id']]=_0xba071c;this['edges'][_0xba071c['id']]=[];};Graph['prototype']['addEdge']=function(_0xd67f4,_0x1b2d7c,_0xd15767){this[_0x276d('0x4')][_0xd67f4][_0x276d('0x5')]({'target':_0x1b2d7c,'condition':_0xd15767});this[_0x276d('0x6')]+=0x1;};Graph[_0x276d('0x7')][_0x276d('0x8')]=function(){return _[_0x276d('0x8')](this[_0x276d('0x3')]);};Graph['prototype']['relations']=function(){return this[_0x276d('0x6')];};Graph[_0x276d('0x7')][_0x276d('0x9')]=function(_0x43c7bf){return this[_0x276d('0x3')][_0x43c7bf];};Graph['prototype'][_0x276d('0xa')]=function(_0x4e0ee8,_0x5dd962){if(!this[_0x276d('0x3')][_0x4e0ee8]){return logger['info'](_0x276d('0xb'));}var _0x445010=_0x5dd962(this[_0x276d('0x3')][_0x4e0ee8]);if(!_0x445010){return logger['info'](_0x276d('0xc'));}if(this[_0x276d('0x4')][_0x4e0ee8][_0x276d('0xd')]===0x0){return logger[_0x276d('0xe')]('no\x20edge/s\x20available');}for(var _0xe7e153=0x0,_0x143a77=[],_0x4310f4=![];_0xe7e153\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','then','catch','hasOwnProperty','indexOf','agi_','substring','variables','close','timeout','hangup','find','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','syncho','../../config/environment','../../config/logger','agi','./project','defaults','127.0.0.1','projectUpdate','nextTick','error','findIndex','deleted','splice','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b07,0x159));var _0x74b0=function(_0x3de96c,_0x16d992){_0x3de96c=_0x3de96c-0x0;var _0x2db40e=_0x4b07[_0x3de96c];return _0x2db40e;};'use strict';var _=require('lodash');var syncho=require(_0x74b0('0x0'));var util=require('util');var config=require(_0x74b0('0x1'));var logger=require(_0x74b0('0x2'))(_0x74b0('0x3'));var utilLicense=require('../../config/license/util');var rpc=require('./rpc');var Project=require(_0x74b0('0x4'));var AGIEmitter=require('./events')['EventEmitter'];var projects=[];config[_0x74b0('0x3')]=_[_0x74b0('0x5')](config[_0x74b0('0x3')],{'ip':_0x74b0('0x6'),'port':0x11dd});AGIEmitter['on'](_0x74b0('0x7'),projectUpdateHandler);function connectionHandler(_0x11223e){process[_0x74b0('0x8')](function(){syncho(function(){try{setChannelVariables(_0x11223e);agiHandler(_0x11223e);}catch(_0x58ea33){logger[_0x74b0('0x9')](_0x58ea33['stack']);}});});}function projectUpdateHandler(_0x16093a){try{var _0xe549ed=_[_0x74b0('0xa')](projects,['id',_0x16093a['id']]);if(_0xe549ed>-0x1){if(_0x16093a[_0x74b0('0xb')]===!![]){projects[_0x74b0('0xc')](_0xe549ed,0x1);}else{projects[_0xe549ed]=_0x16093a;}}else{projects['push'](_0x16093a);}}catch(_0x2edbd8){logger[_0x74b0('0x9')](_0x2edbd8[_0x74b0('0xd')]);}}function listeningHandler(){console[_0x74b0('0xe')](_0x74b0('0xf'),config[_0x74b0('0x3')][_0x74b0('0x10')]);logger['info'](util[_0x74b0('0x11')](_0x74b0('0x12'),config['agi']['ip'],config['agi'][_0x74b0('0x10')]));}function errorHandler(_0x5ce8b1){if(_0x5ce8b1&&_0x5ce8b1[_0x74b0('0x13')]&&_0x5ce8b1['message']){logger[_0x74b0('0x9')](util[_0x74b0('0x11')]('[%s]\x20%s',_0x5ce8b1['name'],_0x5ce8b1[_0x74b0('0x14')]));}else{logger[_0x74b0('0x9')](util[_0x74b0('0x11')](_0x74b0('0x15'),_0x5ce8b1[_0x74b0('0xd')]));}}function closeHandler(){logger[_0x74b0('0x16')](util[_0x74b0('0x11')](_0x74b0('0x17'),this[_0x74b0('0x18')],this['calleridname'],this[_0x74b0('0x19')],this[_0x74b0('0x1a')],this[_0x74b0('0x1b')]));try{createSquareReport(this);}catch(_0xfbb5b){logger['error'](_0xfbb5b[_0x74b0('0xd')]);}}function timeoutHandler(){logger[_0x74b0('0x16')](util[_0x74b0('0x11')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x74b0('0x18')],this[_0x74b0('0x1c')],this[_0x74b0('0x19')],this[_0x74b0('0x1a')],this[_0x74b0('0x1b')]));}function hangupHandler(){logger[_0x74b0('0x16')](util['format'](_0x74b0('0x1d'),this[_0x74b0('0x18')],this[_0x74b0('0x1c')],this[_0x74b0('0x19')],this['dnid'],this[_0x74b0('0x1b')]));this[_0x74b0('0x1e')]=!![];}function createSquareReport(_0x11ab7e,_0x3ebbec){rpc['createSquareReport'](_0x11ab7e)[_0x74b0('0x1f')](function(_0x205e4b){if(_0x3ebbec){_0x3ebbec(null,_0x205e4b);}})[_0x74b0('0x20')](function(_0x219fed){if(_0x3ebbec){_0x3ebbec(null,_0x219fed);}});}function setChannelVariables(_0x145488){for(var _0x28975a in _0x145488){if(_0x145488[_0x74b0('0x21')](_0x28975a)){if(_0x28975a[_0x74b0('0x22')](_0x74b0('0x23'))===0x0){_0x145488[_0x28975a[_0x74b0('0x24')](0x4)]=_0x145488[_0x28975a];delete _0x145488[_0x28975a];}}}}function agiHandler(_0x94280b){logger['debug'](_0x74b0('0x25'),JSON['stringify'](_0x94280b,null,0x2));logger[_0x74b0('0x16')](util[_0x74b0('0x11')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x94280b[_0x74b0('0x18')],_0x94280b[_0x74b0('0x1c')],_0x94280b[_0x74b0('0x19')],_0x94280b[_0x74b0('0x1a')],_0x94280b[_0x74b0('0x1b')]));_0x94280b['on'](_0x74b0('0x9'),errorHandler);_0x94280b['on'](_0x74b0('0x26'),closeHandler);_0x94280b['on'](_0x74b0('0x27'),timeoutHandler);_0x94280b[_0x74b0('0x1e')]=![];_0x94280b['on'](_0x74b0('0x28'),hangupHandler);var _0x2c6a19=_[_0x74b0('0x29')](projects,['name',_0x94280b['arg_1']]);if(!_0x2c6a19)return Project['handleNotFound'](_0x94280b);if(!_0x2c6a19['production'])return Project['handleUnpublished'](_0x94280b);return Project['initialize'](_0x2c6a19,_0x94280b);}function main(){var _0x5ecbce;return utilLicense[_0x74b0('0x2a')]()[_0x74b0('0x1f')](function(_0x1d9c93){if(!_0x1d9c93)return;if(_0x1d9c93[_0x74b0('0x2b')]){if(_0x1d9c93['callysquare']&&_0x1d9c93[_0x74b0('0x2c')]>0x0){logger[_0x74b0('0x16')](util[_0x74b0('0x11')](_0x74b0('0x2d'),_0x1d9c93['callysquare']));_0x5ecbce=_0x1d9c93[_0x74b0('0x2c')];}else{logger['info'](_0x74b0('0x2e'));}}else{logger['info'](_0x74b0('0x2f'));_0x5ecbce=-0x1;}})[_0x74b0('0x1f')](function(){return Project['getAll']();})[_0x74b0('0x1f')](function(_0x2b5dea){projects=_0x2b5dea;return;})[_0x74b0('0x20')](function(_0x13a1c8){logger[_0x74b0('0x9')](_0x74b0('0x30'),_0x13a1c8['stack']);})['finally'](function(){var _0x4351d8=require(_0x74b0('0x31'))(config[_0x74b0('0x3')][_0x74b0('0x10')],config[_0x74b0('0x3')]['ip'],_0x5ecbce);_0x4351d8['on']('error',errorHandler);_0x4351d8['on'](_0x74b0('0x32'),listeningHandler);_0x4351d8['on'](_0x74b0('0x33'),connectionHandler);_0x4351d8['on'](_0x74b0('0x26'),closeHandler);});}main(); \ No newline at end of file +var _0x6149=['then','[LICENSE]\x20CHANNELS:\x20%s','callysquare','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','./server','listening','connection','close','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events','defaults','projectUpdate','nextTick','stack','findIndex','splice','push','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','format','calleridname','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','catch','hasOwnProperty','substring','debug','stringify','hangup','handleNotFound','production','handleUnpublished','initialize','getLicense'];(function(_0x4c1ec2,_0x4f42b7){var _0x3f6f1c=function(_0xc82652){while(--_0xc82652){_0x4c1ec2['push'](_0x4c1ec2['shift']());}};_0x3f6f1c(++_0x4f42b7);}(_0x6149,0x1a1));var _0x9614=function(_0x58d349,_0x3f80e3){_0x58d349=_0x58d349-0x0;var _0x531639=_0x6149[_0x58d349];return _0x531639;};'use strict';var _=require(_0x9614('0x0'));var syncho=require(_0x9614('0x1'));var util=require(_0x9614('0x2'));var config=require(_0x9614('0x3'));var logger=require(_0x9614('0x4'))(_0x9614('0x5'));var utilLicense=require(_0x9614('0x6'));var rpc=require('./rpc');var Project=require(_0x9614('0x7'));var AGIEmitter=require(_0x9614('0x8'))['EventEmitter'];var projects=[];config[_0x9614('0x5')]=_[_0x9614('0x9')](config[_0x9614('0x5')],{'ip':'127.0.0.1','port':0x11dd});AGIEmitter['on'](_0x9614('0xa'),projectUpdateHandler);function connectionHandler(_0x54a778){process[_0x9614('0xb')](function(){syncho(function(){try{setChannelVariables(_0x54a778);agiHandler(_0x54a778);}catch(_0xd9fb79){logger['error'](_0xd9fb79[_0x9614('0xc')]);}});});}function projectUpdateHandler(_0x368597){try{var _0x35e723=_[_0x9614('0xd')](projects,['id',_0x368597['id']]);if(_0x35e723>-0x1){if(_0x368597['deleted']===!![]){projects[_0x9614('0xe')](_0x35e723,0x1);}else{projects[_0x35e723]=_0x368597;}}else{projects[_0x9614('0xf')](_0x368597);}}catch(_0x36a0fd){logger[_0x9614('0x10')](_0x36a0fd[_0x9614('0xc')]);}}function listeningHandler(){console[_0x9614('0x11')](_0x9614('0x12'),config[_0x9614('0x5')][_0x9614('0x13')]);logger[_0x9614('0x14')](util['format'](_0x9614('0x15'),config[_0x9614('0x5')]['ip'],config['agi']['port']));}function errorHandler(_0xbd28cb){if(_0xbd28cb&&_0xbd28cb[_0x9614('0x16')]&&_0xbd28cb[_0x9614('0x17')]){logger[_0x9614('0x10')](util['format'](_0x9614('0x18'),_0xbd28cb[_0x9614('0x16')],_0xbd28cb[_0x9614('0x17')]));}else{logger[_0x9614('0x10')](util['format'](_0x9614('0x19'),_0xbd28cb[_0x9614('0xc')]));}}function closeHandler(){logger[_0x9614('0x14')](util[_0x9614('0x1a')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x9614('0x1b')],this[_0x9614('0x1c')],this[_0x9614('0x1d')],this['uniqueid']));try{createSquareReport(this);}catch(_0x567adf){logger[_0x9614('0x10')](_0x567adf['stack']);}}function timeoutHandler(){logger[_0x9614('0x14')](util['format'](_0x9614('0x1e'),this[_0x9614('0x1f')],this[_0x9614('0x1b')],this[_0x9614('0x1c')],this[_0x9614('0x1d')],this[_0x9614('0x20')]));}function hangupHandler(){logger[_0x9614('0x14')](util['format'](_0x9614('0x21'),this[_0x9614('0x1f')],this[_0x9614('0x1b')],this[_0x9614('0x1c')],this['dnid'],this[_0x9614('0x20')]));this[_0x9614('0x22')]=!![];}function createSquareReport(_0x51e05f,_0x35d794){rpc[_0x9614('0x23')](_0x51e05f)['then'](function(_0x44c73e){if(_0x35d794){_0x35d794(null,_0x44c73e);}})[_0x9614('0x24')](function(_0x5b9bf9){if(_0x35d794){_0x35d794(null,_0x5b9bf9);}});}function setChannelVariables(_0x3d9c0a){for(var _0x2ce73a in _0x3d9c0a){if(_0x3d9c0a[_0x9614('0x25')](_0x2ce73a)){if(_0x2ce73a['indexOf']('agi_')===0x0){_0x3d9c0a[_0x2ce73a[_0x9614('0x26')](0x4)]=_0x3d9c0a[_0x2ce73a];delete _0x3d9c0a[_0x2ce73a];}}}}function agiHandler(_0x51b65f){logger[_0x9614('0x27')]('variables',JSON[_0x9614('0x28')](_0x51b65f,null,0x2));logger[_0x9614('0x14')](util[_0x9614('0x1a')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x51b65f[_0x9614('0x1f')],_0x51b65f['calleridname'],_0x51b65f[_0x9614('0x1c')],_0x51b65f['dnid'],_0x51b65f[_0x9614('0x20')]));_0x51b65f['on'](_0x9614('0x10'),errorHandler);_0x51b65f['on']('close',closeHandler);_0x51b65f['on']('timeout',timeoutHandler);_0x51b65f[_0x9614('0x22')]=![];_0x51b65f['on'](_0x9614('0x29'),hangupHandler);var _0x52e0de=_['find'](projects,[_0x9614('0x16'),_0x51b65f[_0x9614('0x1f')]]);if(!_0x52e0de)return Project[_0x9614('0x2a')](_0x51b65f);if(!_0x52e0de[_0x9614('0x2b')])return Project[_0x9614('0x2c')](_0x51b65f);return Project[_0x9614('0x2d')](_0x52e0de,_0x51b65f);}function main(){var _0x1b2bec;return utilLicense[_0x9614('0x2e')]()[_0x9614('0x2f')](function(_0x5a3670){if(!_0x5a3670)return;if(_0x5a3670['voice']){if(_0x5a3670['callysquare']&&_0x5a3670['callysquare']>0x0){logger[_0x9614('0x14')](util[_0x9614('0x1a')](_0x9614('0x30'),_0x5a3670[_0x9614('0x31')]));_0x1b2bec=_0x5a3670['callysquare'];}else{logger[_0x9614('0x14')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x9614('0x14')](_0x9614('0x32'));_0x1b2bec=-0x1;}})['then'](function(){return Project[_0x9614('0x33')]();})[_0x9614('0x2f')](function(_0x6e57f4){projects=_0x6e57f4;return;})[_0x9614('0x24')](function(_0x2cd087){logger[_0x9614('0x10')](_0x9614('0x34'),_0x2cd087['stack']);})[_0x9614('0x35')](function(){var _0xe9b1cd=require(_0x9614('0x36'))(config['agi'][_0x9614('0x13')],config[_0x9614('0x5')]['ip'],_0x1b2bec);_0xe9b1cd['on'](_0x9614('0x10'),errorHandler);_0xe9b1cd['on'](_0x9614('0x37'),listeningHandler);_0xe9b1cd['on'](_0x9614('0x38'),connectionHandler);_0xe9b1cd['on'](_0x9614('0x39'),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 21dcafa..ae58153 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 _0x2a71=['sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message','result','catch'];(function(_0x4d7c8a,_0x3d3a0b){var _0x9c077=function(_0x9a582c){while(--_0x9a582c){_0x4d7c8a['push'](_0x4d7c8a['shift']());}};_0x9c077(++_0x3d3a0b);}(_0x2a71,0x120));var _0x12a7=function(_0x4361b6,_0x29e3fe){_0x4361b6=_0x4361b6-0x0;var _0x477231=_0x2a71[_0x4361b6];return _0x477231;};'use strict';var BPromise=require(_0x12a7('0x0'));var jayson=require(_0x12a7('0x1'));var client=jayson[_0x12a7('0x2')][_0x12a7('0x3')]({'port':0x232b});function request(_0x542be2,_0x333b6c){return new BPromise(function(_0x1e48b4,_0xe4c38c){return client[_0x12a7('0x4')](_0x542be2,_0x333b6c)['then'](function(_0x53c749){if(_0x53c749[_0x12a7('0x5')]){return _0xe4c38c(_0x53c749[_0x12a7('0x5')][_0x12a7('0x6')]);}else{return _0x1e48b4(_0x53c749[_0x12a7('0x7')]);}})[_0x12a7('0x8')](function(_0x27bf69){return _0xe4c38c(_0x27bf69);});});}exports[_0x12a7('0x9')]=function(_0x53833e,_0x4b691b){return request(_0x12a7('0xa'),{'account':_0x53833e,'message':_0x4b691b});}; \ No newline at end of file +var _0xa19b=['http','request','error','message','result','catch','sendMailMessage','bluebird','jayson/promise','client'];(function(_0x250b29,_0x1d0a9f){var _0x173414=function(_0x159010){while(--_0x159010){_0x250b29['push'](_0x250b29['shift']());}};_0x173414(++_0x1d0a9f);}(_0xa19b,0x13d));var _0xba19=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa19b[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0xba19('0x0'));var jayson=require(_0xba19('0x1'));var client=jayson[_0xba19('0x2')][_0xba19('0x3')]({'port':0x232b});function request(_0x59b922,_0x117432){return new BPromise(function(_0x1902f5,_0xd5cae1){return client[_0xba19('0x4')](_0x59b922,_0x117432)['then'](function(_0x4eba2d){if(_0x4eba2d[_0xba19('0x5')]){return _0xd5cae1(_0x4eba2d[_0xba19('0x5')][_0xba19('0x6')]);}else{return _0x1902f5(_0x4eba2d[_0xba19('0x7')]);}})[_0xba19('0x8')](function(_0x4edb8c){return _0xd5cae1(_0x4edb8c);});});}exports[_0xba19('0x9')]=function(_0xd752c1,_0x485154){return request('SendMail',{'account':_0xd752c1,'message':_0x485154});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 2aeda30..6ee1f0b 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbc6=['toJson','mxGraphModel','root','inspect','production','start','stringify','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','info','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','debug','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','agicommand','response','code','result','toString','agicommand\x20not\x20found','stack','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','finally','clear','isUndefined','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','Project\x20%s\x20not\x20found','continueAt','close','Project\x20%s\x20not\x20published','xml2json','../../config/logger','agi','./mailRpc','./graph','getSquareProjects','catch','error','Unable\x20to\x20download\x20CallySquare\x20projects','hasOwnProperty','retry','maxRetry','omit','mxCell','isArray','length','source','target','addEdge','value'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0xcbc6,0x118));var _0x6cbc=function(_0x36b530,_0x48d775){_0x36b530=_0x36b530-0x0;var _0x5a46f0=_0xcbc6[_0x36b530];return _0x5a46f0;};'use strict';var _=require('lodash');var moment=require('moment');var parser=require(_0x6cbc('0x0'));var util=require('util');var logger=require(_0x6cbc('0x1'))(_0x6cbc('0x2'));var rpc=require('./rpc');var mailRpc=require(_0x6cbc('0x3'));var Graph=require(_0x6cbc('0x4'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x6cbc('0x5')]()[_0x6cbc('0x6')](function(_0x5c42e3){logger[_0x6cbc('0x7')](_0x6cbc('0x8'),_0x5c42e3['stack']);return[];});}function addVertex(_0x290205,_0x5552da,_0x3b2fca){_0x5552da['agicommand']=_0x3b2fca;if(_0x5552da[_0x6cbc('0x9')](_0x6cbc('0xa'))){_0x5552da[_0x6cbc('0xb')]=parseInt(_0x5552da[_0x6cbc('0xa')],0xa);}_0x290205['addVertex'](_[_0x6cbc('0xc')](_0x5552da,_0x6cbc('0xd')));}function initGraph(_0x41a0c5,_0x4cc3ff){var _0x1dd110=new Graph();for(var _0x1fc299 in _0x41a0c5){if(_0x41a0c5['hasOwnProperty'](_0x1fc299)){if(_[_0x6cbc('0xe')](_0x41a0c5[_0x1fc299])){for(var _0x4f1ee1=0x0;_0x4f1ee1<_0x41a0c5[_0x1fc299][_0x6cbc('0xf')];_0x4f1ee1+=0x1){addVertex(_0x1dd110,_0x41a0c5[_0x1fc299][_0x4f1ee1],_0x1fc299);}}else{addVertex(_0x1dd110,_0x41a0c5[_0x1fc299],_0x1fc299);}}}for(var _0x54da5e=0x0;_0x54da5e<_0x4cc3ff[_0x6cbc('0xf')];_0x54da5e+=0x1){if(_0x4cc3ff[_0x54da5e][_0x6cbc('0x10')]&&_0x4cc3ff[_0x54da5e][_0x6cbc('0x11')]){_0x1dd110[_0x6cbc('0x12')](_0x4cc3ff[_0x54da5e][_0x6cbc('0x10')],_0x4cc3ff[_0x54da5e][_0x6cbc('0x11')],_0x4cc3ff[_0x54da5e][_0x6cbc('0x13')]);}}return _0x1dd110;}function getRoot(_0x4b4e4d){return parser[_0x6cbc('0x14')](_0x4b4e4d,{'object':!![]})[_0x6cbc('0x15')][_0x6cbc('0x16')];}function inspect(_0x3aa9cb){return util[_0x6cbc('0x17')](_0x3aa9cb,{'showHidden':![],'depth':null});}function initialize(_0x887165,_0x3cd6a0){var _0x52f4da=getRoot(_0x887165[_0x6cbc('0x18')]);if(!_0x52f4da||!_0x52f4da[_0x6cbc('0x19')])return;var _0xfc4219,_0x28b74c,_0x7f56af;logger['debug']('root',JSON[_0x6cbc('0x1a')](_0x52f4da,null,0x2));_0x3cd6a0[_0x6cbc('0x1b')]=moment()[_0x6cbc('0x1c')](_0x6cbc('0x1d'));_0xfc4219=initGraph(_[_0x6cbc('0xc')](_0x52f4da,_0x6cbc('0xd')),_0x52f4da[_0x6cbc('0xd')]);_0x28b74c=new Vertices(_0x3cd6a0,rpc,mailRpc);logger[_0x6cbc('0x1e')](util['format'](_0x6cbc('0x1f'),_0x3cd6a0[_0x6cbc('0x20')],_0x3cd6a0[_0x6cbc('0x21')],_0x3cd6a0[_0x6cbc('0x22')],_0x3cd6a0[_0x6cbc('0x23')],_0x3cd6a0[_0x6cbc('0x24')]));_0xfc4219['traverseBFS'](_0x52f4da[_0x6cbc('0x19')]['id'],function(_0x148590){try{_0x148590=_0x28b74c['clear'](_0x148590);logger[_0x6cbc('0x25')](_0x6cbc('0x26'),JSON[_0x6cbc('0x1a')](_0x148590,null,0x2));if(_0x148590['agicommand']==='gotoc'){logger[_0x6cbc('0x1e')](_0x6cbc('0x27'));_0x3cd6a0[_0x6cbc('0x28')]=_0x148590['context']||_0x3cd6a0[_0x6cbc('0x28')];_0x3cd6a0['extension']=_0x148590['extension'];_0x3cd6a0[_0x6cbc('0x29')]=_0x148590[_0x6cbc('0x29')]?_0x148590[_0x6cbc('0x29')]-0x1:0x1;return null;}else if(_0x148590&&_0x28b74c[_0x148590[_0x6cbc('0x2a')]]){_0x7f56af=_0x28b74c[_0x148590[_0x6cbc('0x2a')]](_0x148590);logger[_0x6cbc('0x1e')](_0x6cbc('0x2b'),JSON[_0x6cbc('0x1a')](_0x7f56af,null,0x2));if(_0x7f56af&&_0x7f56af[_0x6cbc('0x2c')]===AGI_CODE_SUCCESS&&_0x7f56af[_0x6cbc('0x2d')]!==AGI_RESULT_ERROR&&!_0x3cd6a0['evtHangup']){logger[_0x6cbc('0x25')](_0x6cbc('0x2b'),inspect(_0x7f56af));return _['isUndefined'](_0x7f56af[_0x6cbc('0x2d')])?null:_0x7f56af[_0x6cbc('0x2d')][_0x6cbc('0x2e')]();}else{logger[_0x6cbc('0x7')]('response',inspect(_0x7f56af));return null;}}else{logger[_0x6cbc('0x7')](_0x6cbc('0x2f'));return null;}}catch(_0x4a0011){logger[_0x6cbc('0x7')](_0x4a0011[_0x6cbc('0x30')]);return null;}});if(_0x52f4da['finally']){logger[_0x6cbc('0x1e')](util['format'](_0x6cbc('0x31'),_0x3cd6a0['arg_1'],_0x3cd6a0[_0x6cbc('0x21')],_0x3cd6a0[_0x6cbc('0x22')],_0x3cd6a0[_0x6cbc('0x23')],_0x3cd6a0[_0x6cbc('0x24')]));_0xfc4219[_0x6cbc('0x32')](_0x52f4da[_0x6cbc('0x33')]['id'],function(_0x2d9564){try{_0x2d9564=_0x28b74c[_0x6cbc('0x34')](_0x2d9564);logger[_0x6cbc('0x25')](_0x6cbc('0x26'),JSON[_0x6cbc('0x1a')](_0x2d9564,null,0x2));if(_0x2d9564&&_0x28b74c[_0x2d9564['agicommand']]){_0x7f56af=_0x28b74c[_0x2d9564['agicommand']](_0x2d9564);if(_0x7f56af){logger[_0x6cbc('0x25')](_0x6cbc('0x2b'),inspect(_0x7f56af));return _[_0x6cbc('0x35')](_0x7f56af[_0x6cbc('0x2d')])?null:_0x7f56af[_0x6cbc('0x2d')][_0x6cbc('0x2e')]();}else{logger[_0x6cbc('0x7')](_0x6cbc('0x2b'),inspect(_0x7f56af));return null;}}else{logger[_0x6cbc('0x7')](_0x6cbc('0x2f'));return null;}}catch(_0x4a2294){logger[_0x6cbc('0x7')](_0x4a2294[_0x6cbc('0x30')]);return null;}});}logger[_0x6cbc('0x1e')](util[_0x6cbc('0x1c')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3cd6a0[_0x6cbc('0x20')],_0x3cd6a0[_0x6cbc('0x21')],_0x3cd6a0[_0x6cbc('0x22')],_0x3cd6a0[_0x6cbc('0x23')],_0x3cd6a0['uniqueid']));logger[_0x6cbc('0x1e')](util['format'](_0x6cbc('0x36'),_0x3cd6a0[_0x6cbc('0x28')],_0x3cd6a0['extension'],parseInt(_0x3cd6a0[_0x6cbc('0x29')],0xa)+0x1));_0x3cd6a0['continueAt'](_0x3cd6a0[_0x6cbc('0x28')],_0x3cd6a0[_0x6cbc('0x37')],parseInt(_0x3cd6a0['priority'],0xa)+0x1);_0x3cd6a0['close']();}function handleNotFound(_0x1c86a0){logger[_0x6cbc('0x7')](util['format'](_0x6cbc('0x38'),_0x1c86a0['arg_1']));_0x1c86a0[_0x6cbc('0x39')](_0x1c86a0[_0x6cbc('0x28')],_0x1c86a0[_0x6cbc('0x37')],parseInt(_0x1c86a0[_0x6cbc('0x29')],0xa)+0x1);_0x1c86a0[_0x6cbc('0x3a')]();}function handleUnpublished(_0x4ccd2c){logger[_0x6cbc('0x7')](util['format'](_0x6cbc('0x3b'),_0x4ccd2c[_0x6cbc('0x20')]));_0x4ccd2c[_0x6cbc('0x39')](_0x4ccd2c[_0x6cbc('0x28')],_0x4ccd2c['extension'],parseInt(_0x4ccd2c['priority'],0xa)+0x1);_0x4ccd2c[_0x6cbc('0x3a')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0xe89e=['addEdge','value','mxGraphModel','inspect','production','start','debug','root','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','traverseBFS','clear','vertex','agicommand','gotoc','context','extension','priority','response','code','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20found','continueAt','Project\x20%s\x20not\x20published','exports','lodash','xml2json','util','../../config/logger','agi','./rpc','./mailRpc','./graph','./vertices','getSquareProjects','error','stack','retry','maxRetry','addVertex','omit','hasOwnProperty','isArray','length','source','target'];(function(_0x48da6a,_0xb5c722){var _0x5470f5=function(_0x17dafd){while(--_0x17dafd){_0x48da6a['push'](_0x48da6a['shift']());}};_0x5470f5(++_0xb5c722);}(_0xe89e,0x121));var _0xee89=function(_0x38a581,_0x4a71bb){_0x38a581=_0x38a581-0x0;var _0x349907=_0xe89e[_0x38a581];return _0x349907;};'use strict';var _=require(_0xee89('0x0'));var moment=require('moment');var parser=require(_0xee89('0x1'));var util=require(_0xee89('0x2'));var logger=require(_0xee89('0x3'))(_0xee89('0x4'));var rpc=require(_0xee89('0x5'));var mailRpc=require(_0xee89('0x6'));var Graph=require(_0xee89('0x7'));var Vertices=require(_0xee89('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xee89('0x9')]()['catch'](function(_0x4ef028){logger[_0xee89('0xa')]('Unable\x20to\x20download\x20CallySquare\x20projects',_0x4ef028[_0xee89('0xb')]);return[];});}function addVertex(_0x265450,_0xaa7bb7,_0x4971ac){_0xaa7bb7['agicommand']=_0x4971ac;if(_0xaa7bb7['hasOwnProperty'](_0xee89('0xc'))){_0xaa7bb7[_0xee89('0xd')]=parseInt(_0xaa7bb7[_0xee89('0xc')],0xa);}_0x265450[_0xee89('0xe')](_[_0xee89('0xf')](_0xaa7bb7,'mxCell'));}function initGraph(_0x2d89f9,_0x23060b){var _0x8864e7=new Graph();for(var _0x1a5543 in _0x2d89f9){if(_0x2d89f9[_0xee89('0x10')](_0x1a5543)){if(_[_0xee89('0x11')](_0x2d89f9[_0x1a5543])){for(var _0x13b74c=0x0;_0x13b74c<_0x2d89f9[_0x1a5543][_0xee89('0x12')];_0x13b74c+=0x1){addVertex(_0x8864e7,_0x2d89f9[_0x1a5543][_0x13b74c],_0x1a5543);}}else{addVertex(_0x8864e7,_0x2d89f9[_0x1a5543],_0x1a5543);}}}for(var _0x4b7b75=0x0;_0x4b7b75<_0x23060b[_0xee89('0x12')];_0x4b7b75+=0x1){if(_0x23060b[_0x4b7b75][_0xee89('0x13')]&&_0x23060b[_0x4b7b75][_0xee89('0x14')]){_0x8864e7[_0xee89('0x15')](_0x23060b[_0x4b7b75]['source'],_0x23060b[_0x4b7b75][_0xee89('0x14')],_0x23060b[_0x4b7b75][_0xee89('0x16')]);}}return _0x8864e7;}function getRoot(_0x938ded){return parser['toJson'](_0x938ded,{'object':!![]})[_0xee89('0x17')]['root'];}function inspect(_0x12aa0d){return util[_0xee89('0x18')](_0x12aa0d,{'showHidden':![],'depth':null});}function initialize(_0x2146b6,_0x319875){var _0x322c40=getRoot(_0x2146b6[_0xee89('0x19')]);if(!_0x322c40||!_0x322c40[_0xee89('0x1a')])return;var _0x423c33,_0x24d55a,_0x2287b7;logger[_0xee89('0x1b')](_0xee89('0x1c'),JSON[_0xee89('0x1d')](_0x322c40,null,0x2));_0x319875[_0xee89('0x1e')]=moment()['format'](_0xee89('0x1f'));_0x423c33=initGraph(_[_0xee89('0xf')](_0x322c40,'mxCell'),_0x322c40['mxCell']);_0x24d55a=new Vertices(_0x319875,rpc,mailRpc);logger[_0xee89('0x20')](util[_0xee89('0x21')](_0xee89('0x22'),_0x319875[_0xee89('0x23')],_0x319875['calleridname'],_0x319875[_0xee89('0x24')],_0x319875[_0xee89('0x25')],_0x319875[_0xee89('0x26')]));_0x423c33[_0xee89('0x27')](_0x322c40['start']['id'],function(_0x342a9f){try{_0x342a9f=_0x24d55a[_0xee89('0x28')](_0x342a9f);logger['debug'](_0xee89('0x29'),JSON[_0xee89('0x1d')](_0x342a9f,null,0x2));if(_0x342a9f[_0xee89('0x2a')]===_0xee89('0x2b')){logger['info']('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x319875[_0xee89('0x2c')]=_0x342a9f['context']||_0x319875[_0xee89('0x2c')];_0x319875[_0xee89('0x2d')]=_0x342a9f['extension'];_0x319875[_0xee89('0x2e')]=_0x342a9f[_0xee89('0x2e')]?_0x342a9f[_0xee89('0x2e')]-0x1:0x1;return null;}else if(_0x342a9f&&_0x24d55a[_0x342a9f['agicommand']]){_0x2287b7=_0x24d55a[_0x342a9f[_0xee89('0x2a')]](_0x342a9f);logger['info'](_0xee89('0x2f'),JSON[_0xee89('0x1d')](_0x2287b7,null,0x2));if(_0x2287b7&&_0x2287b7[_0xee89('0x30')]===AGI_CODE_SUCCESS&&_0x2287b7[_0xee89('0x31')]!==AGI_RESULT_ERROR&&!_0x319875[_0xee89('0x32')]){logger['debug'](_0xee89('0x2f'),inspect(_0x2287b7));return _[_0xee89('0x33')](_0x2287b7[_0xee89('0x31')])?null:_0x2287b7['result'][_0xee89('0x34')]();}else{logger[_0xee89('0xa')](_0xee89('0x2f'),inspect(_0x2287b7));return null;}}else{logger[_0xee89('0xa')](_0xee89('0x35'));return null;}}catch(_0x31abf3){logger['error'](_0x31abf3[_0xee89('0xb')]);return null;}});if(_0x322c40[_0xee89('0x36')]){logger[_0xee89('0x20')](util['format'](_0xee89('0x37'),_0x319875['arg_1'],_0x319875['calleridname'],_0x319875['callerid'],_0x319875[_0xee89('0x25')],_0x319875[_0xee89('0x26')]));_0x423c33[_0xee89('0x27')](_0x322c40[_0xee89('0x36')]['id'],function(_0x2a04df){try{_0x2a04df=_0x24d55a[_0xee89('0x28')](_0x2a04df);logger['debug']('vertex',JSON[_0xee89('0x1d')](_0x2a04df,null,0x2));if(_0x2a04df&&_0x24d55a[_0x2a04df[_0xee89('0x2a')]]){_0x2287b7=_0x24d55a[_0x2a04df['agicommand']](_0x2a04df);if(_0x2287b7){logger[_0xee89('0x1b')](_0xee89('0x2f'),inspect(_0x2287b7));return _[_0xee89('0x33')](_0x2287b7[_0xee89('0x31')])?null:_0x2287b7[_0xee89('0x31')]['toString']();}else{logger[_0xee89('0xa')](_0xee89('0x2f'),inspect(_0x2287b7));return null;}}else{logger[_0xee89('0xa')](_0xee89('0x35'));return null;}}catch(_0x551d55){logger[_0xee89('0xa')](_0x551d55[_0xee89('0xb')]);return null;}});}logger[_0xee89('0x20')](util[_0xee89('0x21')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x319875[_0xee89('0x23')],_0x319875['calleridname'],_0x319875[_0xee89('0x24')],_0x319875['dnid'],_0x319875['uniqueid']));logger['info'](util[_0xee89('0x21')](_0xee89('0x38'),_0x319875[_0xee89('0x2c')],_0x319875[_0xee89('0x2d')],parseInt(_0x319875[_0xee89('0x2e')],0xa)+0x1));_0x319875['continueAt'](_0x319875[_0xee89('0x2c')],_0x319875[_0xee89('0x2d')],parseInt(_0x319875['priority'],0xa)+0x1);_0x319875[_0xee89('0x39')]();}function handleNotFound(_0x5909d5){logger[_0xee89('0xa')](util[_0xee89('0x21')](_0xee89('0x3a'),_0x5909d5['arg_1']));_0x5909d5[_0xee89('0x3b')](_0x5909d5[_0xee89('0x2c')],_0x5909d5[_0xee89('0x2d')],parseInt(_0x5909d5[_0xee89('0x2e')],0xa)+0x1);_0x5909d5[_0xee89('0x39')]();}function handleUnpublished(_0x154da8){logger[_0xee89('0xa')](util[_0xee89('0x21')](_0xee89('0x3c'),_0x154da8['arg_1']));_0x154da8['continueAt'](_0x154da8[_0xee89('0x2c')],_0x154da8['extension'],parseInt(_0x154da8[_0xee89('0x2e')],0xa)+0x1);_0x154da8['close']();}module[_0xee89('0x3d')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index e63f8dc..37331bd 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 _0xfde6=['_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','slice','trim','length','emit','headers','line','stream','Transform','call','_inBody','inherits'];(function(_0x397cfb,_0xb8f317){var _0x15fed9=function(_0x3eba43){while(--_0x3eba43){_0x397cfb['push'](_0x397cfb['shift']());}};_0x15fed9(++_0xb8f317);}(_0xfde6,0xaf));var _0x6fde=function(_0x2d28f3,_0x3288ef){_0x2d28f3=_0x2d28f3-0x0;var _0x3d2382=_0xfde6[_0x2d28f3];return _0x3d2382;};'use strict';var util=require('util');var Transform=require(_0x6fde('0x0'))[_0x6fde('0x1')];function AGIReply(_0x4f5f65){Transform[_0x6fde('0x2')](this,_0x4f5f65);this['_localBuffer']='';this[_0x6fde('0x3')]=![];}util[_0x6fde('0x4')](AGIReply,Transform);AGIReply['prototype'][_0x6fde('0x5')]=function(_0x43e3b6,_0xd3f939,_0x21d9d3){var _0x4823f0='\x0a',_0x5c3453=['\x0a\x0a',_0x6fde('0x6')],_0x4442fc=-0x1,_0x5df454=-0x1,_0x45a5aa='',_0xa1089a=0x0,_0x52f86a='',_0x42a6c6='';this[_0x6fde('0x7')]+=_0x43e3b6[_0x6fde('0x8')]();_0x52f86a=this[_0x6fde('0x7')];if(!this[_0x6fde('0x3')]){_0xa1089a=0x0;while(_0x5c3453[_0xa1089a]){while((_0x5df454=_0x52f86a[_0x6fde('0x9')](_0x5c3453[_0xa1089a]))!=-0x1){_0x45a5aa=_0x5c3453[_0xa1089a];_0x42a6c6=_0x52f86a[_0x6fde('0xa')](0x0,_0x5df454);_0x52f86a=_0x52f86a[_0x6fde('0xa')](_0x5df454+_0x45a5aa['length']);var _0x2845a5=_0x42a6c6[_0x6fde('0xb')](_0x4823f0),_0x40b713=0x0,_0x5ba24c={},_0x23d3d6='',_0x36cb33='',_0x5cc0a3=-0x1;while(_0x2845a5[_0x40b713]){_0x5cc0a3=_0x2845a5[_0x40b713][_0x6fde('0x9')](':');if(_0x5cc0a3!=-0x1){_0x23d3d6=_0x2845a5[_0x40b713][_0x6fde('0xc')](0x0,_0x5cc0a3)[_0x6fde('0xd')]();_0x36cb33=_0x2845a5[_0x40b713][_0x6fde('0xc')](_0x5cc0a3+0x1)['trim']();if(_0x23d3d6[_0x6fde('0xe')]>0x0){_0x5ba24c[_0x23d3d6]=_0x36cb33;}}else{}_0x40b713++;}this[_0x6fde('0xf')](_0x6fde('0x10'),_0x5ba24c);this['_inBody']=!![];}_0xa1089a++;}this[_0x6fde('0x7')]=_0x52f86a;}else{while((_0x4442fc=_0x52f86a[_0x6fde('0x9')](_0x4823f0))!=-0x1){_0x42a6c6=_0x52f86a[_0x6fde('0xa')](0x0,_0x4442fc);this['emit'](_0x6fde('0x11'),_0x42a6c6);_0x52f86a=_0x52f86a[_0x6fde('0xa')](_0x4442fc+_0x4823f0[_0x6fde('0xe')]);}this['_localBuffer']=_0x52f86a;}_0x21d9d3();};module['exports']=AGIReply; \ No newline at end of file +var _0xbacf=['prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','_inBody','indexOf','substring','length','trim','slice','emit','headers','line','exports','stream','Transform','call'];(function(_0x28a433,_0x53d91b){var _0x2d7b59=function(_0x37a2d4){while(--_0x37a2d4){_0x28a433['push'](_0x28a433['shift']());}};_0x2d7b59(++_0x53d91b);}(_0xbacf,0xf9));var _0xfbac=function(_0x2baca1,_0x2f3557){_0x2baca1=_0x2baca1-0x0;var _0x9aa62a=_0xbacf[_0x2baca1];return _0x9aa62a;};'use strict';var util=require('util');var Transform=require(_0xfbac('0x0'))[_0xfbac('0x1')];function AGIReply(_0x306d5c){Transform[_0xfbac('0x2')](this,_0x306d5c);this['_localBuffer']='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xfbac('0x3')][_0xfbac('0x4')]=function(_0x2d75e0,_0x1e7b89,_0x2e4915){var _0x21746a='\x0a',_0x32a173=['\x0a\x0a',_0xfbac('0x5')],_0x31ff42=-0x1,_0x5880c9=-0x1,_0x38c928='',_0x35d67f=0x0,_0x150e8a='',_0x14b7e6='';this[_0xfbac('0x6')]+=_0x2d75e0[_0xfbac('0x7')]();_0x150e8a=this['_localBuffer'];if(!this[_0xfbac('0x8')]){_0x35d67f=0x0;while(_0x32a173[_0x35d67f]){while((_0x5880c9=_0x150e8a[_0xfbac('0x9')](_0x32a173[_0x35d67f]))!=-0x1){_0x38c928=_0x32a173[_0x35d67f];_0x14b7e6=_0x150e8a[_0xfbac('0xa')](0x0,_0x5880c9);_0x150e8a=_0x150e8a[_0xfbac('0xa')](_0x5880c9+_0x38c928[_0xfbac('0xb')]);var _0x2e54d5=_0x14b7e6['split'](_0x21746a),_0x4d311e=0x0,_0x11d9b1={},_0x4a064f='',_0x428383='',_0x32eb83=-0x1;while(_0x2e54d5[_0x4d311e]){_0x32eb83=_0x2e54d5[_0x4d311e][_0xfbac('0x9')](':');if(_0x32eb83!=-0x1){_0x4a064f=_0x2e54d5[_0x4d311e]['slice'](0x0,_0x32eb83)[_0xfbac('0xc')]();_0x428383=_0x2e54d5[_0x4d311e][_0xfbac('0xd')](_0x32eb83+0x1)['trim']();if(_0x4a064f[_0xfbac('0xb')]>0x0){_0x11d9b1[_0x4a064f]=_0x428383;}}else{}_0x4d311e++;}this[_0xfbac('0xe')](_0xfbac('0xf'),_0x11d9b1);this['_inBody']=!![];}_0x35d67f++;}this[_0xfbac('0x6')]=_0x150e8a;}else{while((_0x31ff42=_0x150e8a[_0xfbac('0x9')](_0x21746a))!=-0x1){_0x14b7e6=_0x150e8a[_0xfbac('0xa')](0x0,_0x31ff42);this[_0xfbac('0xe')](_0xfbac('0x10'),_0x14b7e6);_0x150e8a=_0x150e8a[_0xfbac('0xa')](_0x31ff42+_0x21746a['length']);}this['_localBuffer']=_0x150e8a;}_0x2e4915();};module[_0xfbac('0x11')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 9955e64..86e0b63 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 _0xb492=['production','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','ShowSquareProject','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','phone','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','getSquareProject'];(function(_0x37b272,_0x4c5d71){var _0x5d8072=function(_0x60458e){while(--_0x60458e){_0x37b272['push'](_0x37b272['shift']());}};_0x5d8072(++_0x4c5d71);}(_0xb492,0x172));var _0x2b49=function(_0x37682e,_0x30b5ed){_0x37682e=_0x37682e-0x0;var _0x2d38a4=_0xb492[_0x37682e];return _0x2d38a4;};'use strict';var _=require('lodash');var moment=require(_0x2b49('0x0'));var jayson=require(_0x2b49('0x1'));var client=jayson[_0x2b49('0x2')][_0x2b49('0x3')]({'port':0x2329});function request(_0x51fad7,_0x522210){return new Promise(function(_0x31a7e5,_0x340296){return client[_0x2b49('0x4')](_0x51fad7,_0x522210)[_0x2b49('0x5')](function(_0x54327a){if(_0x54327a['error']){return _0x340296(_0x54327a[_0x2b49('0x6')][_0x2b49('0x7')]);}else{return _0x31a7e5(_0x54327a[_0x2b49('0x8')]);}})[_0x2b49('0x9')](function(_0x1b06c2){return _0x340296(_0x1b06c2);});});}exports[_0x2b49('0xa')]=function(){return request(_0x2b49('0xb'),{'options':{'raw':![],'attributes':['id',_0x2b49('0xc'),'production']}});};exports[_0x2b49('0xd')]=function(_0x39b1b5){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x39b1b5},'attributes':[_0x2b49('0xe')]}});};exports[_0x2b49('0xf')]=function(_0x448e41){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x448e41},'include':[{'model':_0x2b49('0x10'),'as':_0x2b49('0x11'),'include':[{'model':_0x2b49('0x12'),'as':_0x2b49('0x12')}]}],'attributes':['id',_0x2b49('0xc'),_0x2b49('0x13')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x5f3d88){return request(_0x2b49('0x14'),{'options':{'where':{'id':_0x5f3d88},'attributes':[_0x2b49('0xc')]}});};exports['getVoiceQueueById']=function(_0x4dec02){return request(_0x2b49('0x15'),{'options':{'where':{'id':_0x4dec02},'attributes':[_0x2b49('0xc')]}});};exports[_0x2b49('0x16')]=function(_0x4d114b){return request(_0x2b49('0x17'),{'options':{'where':{'id':_0x4d114b},'attributes':[_0x2b49('0xc')]}});};exports['getSquareOdbcById']=function(_0x4ff6a8){return request(_0x2b49('0x18'),{'options':{'where':{'id':_0x4ff6a8},'attributes':[_0x2b49('0x19')]}});};exports[_0x2b49('0x1a')]=function(_0x14359f){return request(_0x2b49('0x1b'),{'options':{'where':{'id':_0x14359f},'attributes':[_0x2b49('0xc')]}});};exports[_0x2b49('0x1c')]=function(_0x25f0d8){return request(_0x2b49('0x1d'),{'options':{'where':{'phone':_0x25f0d8[_0x2b49('0x1e')]},'attributes':['id']}});};exports['getTrunkById']=function(_0x37b4ae){return request('ShowTrunk',{'options':{'where':{'id':_0x37b4ae},'attributes':[_0x2b49('0xc')]}});};exports[_0x2b49('0x1f')]=function(_0x3050a6){return request(_0x2b49('0x20'),{'options':{'where':{'id':_0x3050a6},'attributes':[_0x2b49('0x21')]}});};exports[_0x2b49('0x22')]=function(_0x5d33f8){return request(_0x2b49('0x23'),{'options':{'raw':![],'where':{'id':_0x5d33f8},'include':[{'model':_0x2b49('0x24'),'as':_0x2b49('0x25')}]}});};exports['getSmsAccountById']=function(_0x8e4c){return request('ShowSmsAccount',{'options':{'where':{'id':_0x8e4c},'attributes':['id','name']}});};exports[_0x2b49('0x26')]=function(_0x1242bb){return request(_0x2b49('0x27'),{'body':_0x1242bb});};exports[_0x2b49('0x28')]=function(_0x1b59cd){return request('CreateSquareDetailsReport',{'body':_0x1b59cd});};exports[_0x2b49('0x29')]=function(_0x52c8f7){return request(_0x2b49('0x2a'),{'body':_[_0x2b49('0x2b')](_0x52c8f7,{'project_name':_0x52c8f7[_0x2b49('0x2c')],'prev_project_name':_0x52c8f7[_0x2b49('0x2d')]||'','is_subproject':_0x52c8f7['arg_2']?!![]:![],'leaveAt':moment()[_0x2b49('0x2e')](_0x2b49('0x2f'))})});};exports[_0x2b49('0x30')]=function(_0x70fa33){return request(_0x2b49('0x31'),{'body':_0x70fa33});};exports[_0x2b49('0x32')]=function(_0x480814){return request(_0x2b49('0x33'),{'body':_0x480814});};exports[_0x2b49('0x34')]=function(_0x237233){return request(_0x2b49('0x35'),{'options':{'raw':![],'where':{'phone':_0x237233[_0x2b49('0x1e')],'ListId':_0x237233[_0x2b49('0x36')]}}})[_0x2b49('0x5')](function(_0x44c80b){if(_0x44c80b){return _0x44c80b;}return request(_0x2b49('0x37'),{'body':_0x237233});});};exports['getPauseById']=function(_0x117bed){return request(_0x2b49('0x38'),{'options':{'where':{'id':_0x117bed},'attributes':[_0x2b49('0xc')]}});};exports['agentLogin']=function(_0x59f8e5,_0x4cd74b){return request(_0x2b49('0x39'),{'body':{'interface':_0x4cd74b},'options':{'where':_0x59f8e5}});};exports[_0x2b49('0x3a')]=function(_0x14f4f8,_0x80f27a,_0x28b5b2){return request(_0x2b49('0x3b'),{'body':{'type':_0x80f27a,'uniqueid':_0x28b5b2},'options':{'where':_0x14f4f8}});};exports[_0x2b49('0x3c')]=function(_0x4f389a){return request(_0x2b49('0x3d'),{'body':{},'options':{'where':_0x4f389a}});};exports[_0x2b49('0x3e')]=function(_0x51b432){return request(_0x2b49('0x3f'),{'body':{},'options':{'where':_0x51b432}});}; \ No newline at end of file +var _0xbe45=['createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','lodash','moment','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','name','production','getSquareProject','ShowSquareProject','MailServerOut','Smtp','CloudProvider','email','getVoiceQueueById','ShowVoiceQueue','getVariableById','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','phone','getTrunkById','ShowTrunk','ShowSound','save_name','ShowInterval','Interval','Intervals','getSmsAccountById','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','CreateSquareRecording'];(function(_0x571559,_0x23ae55){var _0x55eec2=function(_0x362683){while(--_0x362683){_0x571559['push'](_0x571559['shift']());}};_0x55eec2(++_0x23ae55);}(_0xbe45,0xf0));var _0x5be4=function(_0x50fa8b,_0x2bf038){_0x50fa8b=_0x50fa8b-0x0;var _0x1dc2a7=_0xbe45[_0x50fa8b];return _0x1dc2a7;};'use strict';var _=require(_0x5be4('0x0'));var moment=require(_0x5be4('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x5be4('0x2')][_0x5be4('0x3')]({'port':0x2329});function request(_0x3e60c5,_0x1bf021){return new Promise(function(_0x67400b,_0x106b95){return client['request'](_0x3e60c5,_0x1bf021)[_0x5be4('0x4')](function(_0x1ddd74){if(_0x1ddd74[_0x5be4('0x5')]){return _0x106b95(_0x1ddd74[_0x5be4('0x5')][_0x5be4('0x6')]);}else{return _0x67400b(_0x1ddd74[_0x5be4('0x7')]);}})[_0x5be4('0x8')](function(_0x2301ae){return _0x106b95(_0x2301ae);});});}exports[_0x5be4('0x9')]=function(){return request(_0x5be4('0xa'),{'options':{'raw':![],'attributes':['id',_0x5be4('0xb'),_0x5be4('0xc')]}});};exports[_0x5be4('0xd')]=function(_0x4abb5d){return request(_0x5be4('0xe'),{'options':{'raw':![],'where':{'name':_0x4abb5d},'attributes':['production']}});};exports['getMailAccountById']=function(_0x35662a){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x35662a},'include':[{'model':_0x5be4('0xf'),'as':_0x5be4('0x10'),'include':[{'model':'CloudProvider','as':_0x5be4('0x11')}]}],'attributes':['id',_0x5be4('0xb'),_0x5be4('0x12')],'smtp':!![]}});};exports['getSquareProjectById']=function(_0x349610){return request('ShowSquareProject',{'options':{'where':{'id':_0x349610},'attributes':[_0x5be4('0xb')]}});};exports[_0x5be4('0x13')]=function(_0x2dd93e){return request(_0x5be4('0x14'),{'options':{'where':{'id':_0x2dd93e},'attributes':[_0x5be4('0xb')]}});};exports[_0x5be4('0x15')]=function(_0x3980fc){return request('ShowVariable',{'options':{'where':{'id':_0x3980fc},'attributes':[_0x5be4('0xb')]}});};exports[_0x5be4('0x16')]=function(_0x1d7db7){return request(_0x5be4('0x17'),{'options':{'where':{'id':_0x1d7db7},'attributes':[_0x5be4('0x18')]}});};exports[_0x5be4('0x19')]=function(_0x94f434){return request(_0x5be4('0x1a'),{'options':{'where':{'id':_0x94f434},'attributes':['name']}});};exports[_0x5be4('0x1b')]=function(_0x50b970){return request('GetContactByPhone',{'options':{'where':{'phone':_0x50b970[_0x5be4('0x1c')]},'attributes':['id']}});};exports[_0x5be4('0x1d')]=function(_0x4cce93){return request(_0x5be4('0x1e'),{'options':{'where':{'id':_0x4cce93},'attributes':[_0x5be4('0xb')]}});};exports['getSoundById']=function(_0x4af89d){return request(_0x5be4('0x1f'),{'options':{'where':{'id':_0x4af89d},'attributes':[_0x5be4('0x20')]}});};exports['getIntervalById']=function(_0x553f59){return request(_0x5be4('0x21'),{'options':{'raw':![],'where':{'id':_0x553f59},'include':[{'model':_0x5be4('0x22'),'as':_0x5be4('0x23')}]}});};exports[_0x5be4('0x24')]=function(_0xa20552){return request('ShowSmsAccount',{'options':{'where':{'id':_0xa20552},'attributes':['id',_0x5be4('0xb')]}});};exports['createSmsMessage']=function(_0x242005){return request(_0x5be4('0x25'),{'body':_0x242005});};exports['createSquareDetailsReport']=function(_0xf74e0c){return request(_0x5be4('0x26'),{'body':_0xf74e0c});};exports['createSquareReport']=function(_0x211ec7){return request(_0x5be4('0x27'),{'body':_[_0x5be4('0x28')](_0x211ec7,{'project_name':_0x211ec7[_0x5be4('0x29')],'prev_project_name':_0x211ec7[_0x5be4('0x2a')]||'','is_subproject':_0x211ec7[_0x5be4('0x2a')]?!![]:![],'leaveAt':moment()[_0x5be4('0x2b')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x51584f){return request(_0x5be4('0x2c'),{'body':_0x51584f});};exports[_0x5be4('0x2d')]=function(_0x5c489e){return request(_0x5be4('0x2e'),{'body':_0x5c489e});};exports[_0x5be4('0x2f')]=function(_0x3bd842){return request(_0x5be4('0x30'),{'options':{'raw':![],'where':{'phone':_0x3bd842[_0x5be4('0x1c')],'ListId':_0x3bd842[_0x5be4('0x31')]}}})['then'](function(_0x1661c2){if(_0x1661c2){return _0x1661c2;}return request(_0x5be4('0x32'),{'body':_0x3bd842});});};exports['getPauseById']=function(_0x3a36cd){return request('ShowPause',{'options':{'where':{'id':_0x3a36cd},'attributes':[_0x5be4('0xb')]}});};exports[_0x5be4('0x33')]=function(_0x47ecca,_0x33aacb){return request('LoginUser',{'body':{'interface':_0x33aacb},'options':{'where':_0x47ecca}});};exports['agentPause']=function(_0x11929e,_0x337ca1,_0x6e2def){return request(_0x5be4('0x34'),{'body':{'type':_0x337ca1,'uniqueid':_0x6e2def},'options':{'where':_0x11929e}});};exports[_0x5be4('0x35')]=function(_0x23775c){return request(_0x5be4('0x36'),{'body':{},'options':{'where':_0x23775c}});};exports[_0x5be4('0x37')]=function(_0x1fc0bd){return request(_0x5be4('0x38'),{'body':{},'options':{'where':_0x1fc0bd}});}; \ 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 6fa95d7..548ea2d 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 _0xab36=['./lex','exports','./polly'];(function(_0x352d28,_0x444033){var _0x387d7e=function(_0x40be0e){while(--_0x40be0e){_0x352d28['push'](_0x352d28['shift']());}};_0x387d7e(++_0x444033);}(_0xab36,0x1df));var _0x6ab3=function(_0x2c9bd2,_0x1f03ea){_0x2c9bd2=_0x2c9bd2-0x0;var _0x5626f2=_0xab36[_0x2c9bd2];return _0x5626f2;};var polly=require(_0x6ab3('0x0'));var lex=require(_0x6ab3('0x1'));module[_0x6ab3('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x2cd0=['exports','./polly','./lex'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2cd0,0x10f));var _0x02cd=function(_0x1353bc,_0x432b07){_0x1353bc=_0x1353bc-0x0;var _0x3097a6=_0x2cd0[_0x1353bc];return _0x3097a6;};var polly=require(_0x02cd('0x0'));var lex=require(_0x02cd('0x1'));module[_0x02cd('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index bd169ab..5d9137c 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 _0x0bb5=['./lib/api','exports'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x0bb5,0x148));var _0x50bb=function(_0x1a4aaf,_0x3b4f32){_0x1a4aaf=_0x1a4aaf-0x0;var _0x5234de=_0x0bb5[_0x1a4aaf];return _0x5234de;};'use strict';var lex=require(_0x50bb('0x0'));module[_0x50bb('0x1')]=function(_0x5e61cf,_0x5a12b6,_0x348380,_0x1aaa37,_0x6b7575,_0x117e36){return lex(_0x5e61cf,_0x5a12b6,_0x348380,_0x1aaa37,_0x6b7575,_0x117e36);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x1c27bb,_0x4a4906,_0x3f643d,_0x306b6e,_0x2221f1,_0x10d2c4){return lex(_0x1c27bb,_0x4a4906,_0x3f643d,_0x306b6e,_0x2221f1,_0x10d2c4);}; \ 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 90dbe60..860d408 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(_0x4a8e3d,_0x2e5a9c){var _0x12239c=function(_0x8677b){while(--_0x8677b){_0x4a8e3d['push'](_0x4a8e3d['shift']());}};_0x12239c(++_0x2e5a9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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(_0x491f87,_0x18f826){var _0x4e696f=function(_0x29f455){while(--_0x29f455){_0x491f87['push'](_0x491f87['shift']());}};_0x4e696f(++_0x18f826);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 d66e87b..a9a210d 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 _0xbb98=['exports','./lib/api'];(function(_0x585458,_0xea62cc){var _0x227a4e=function(_0x4e4055){while(--_0x4e4055){_0x585458['push'](_0x585458['shift']());}};_0x227a4e(++_0xea62cc);}(_0xbb98,0x1a7));var _0x8bb9=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0xbb98[_0x1969a7];return _0x3d665f;};'use strict';var polly=require(_0x8bb9('0x0'));module[_0x8bb9('0x1')]=function(_0x1b0712,_0x32c73e,_0x2df679,_0x281b46,_0x4ebe54,_0x499609,_0x5f3f4b){return polly(_0x1b0712,_0x32c73e,_0x2df679,_0x281b46,_0x4ebe54,_0x499609,_0x5f3f4b);}; \ No newline at end of file +var _0x7194=['exports'];(function(_0x682687,_0x13282a){var _0x33e469=function(_0x5091f2){while(--_0x5091f2){_0x682687['push'](_0x682687['shift']());}};_0x33e469(++_0x13282a);}(_0x7194,0x192));var _0x4719=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x7194[_0x20a584];return _0x4b41a8;};'use strict';var polly=require('./lib/api');module[_0x4719('0x0')]=function(_0x52a3ec,_0x55e182,_0x432fa6,_0x357083,_0x1b7e54,_0x1ec568,_0xb7a7db){return polly(_0x52a3ec,_0x55e182,_0x432fa6,_0x357083,_0x1b7e54,_0x1ec568,_0xb7a7db);}; \ 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 9aefa04..2dbee0e 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 _0x5e94=['bluebird','synthesizeSpeech','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path'];(function(_0x240a94,_0x3a2009){var _0x4aee95=function(_0x40fb6d){while(--_0x40fb6d){_0x240a94['push'](_0x240a94['shift']());}};_0x4aee95(++_0x3a2009);}(_0x5e94,0x196));var _0x45e9=function(_0x2ab0cf,_0x2469fb){_0x2ab0cf=_0x2ab0cf-0x0;var _0x2b7455=_0x5e94[_0x2ab0cf];return _0x2b7455;};'use strict';var fs=require('fs');var path=require(_0x45e9('0x0'));var BPromise=require(_0x45e9('0x1'));var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x13f4a0,_0x223391,_0x43f44e){return new BPromise(function(_0x288cdf,_0x5de91b){_0x13f4a0[_0x45e9('0x2')](_0x223391,function(_0x3ed8d5,_0x3fefd5){if(_0x3ed8d5){_0x5de91b(_0x3ed8d5);}else if(_0x3fefd5){if(_0x3fefd5['AudioStream']instanceof Buffer){fs[_0x45e9('0x3')](_0x43f44e,_0x3fefd5[_0x45e9('0x4')],function(_0x17f279){if(_0x17f279){_0x5de91b(_0x17f279);}else{_0x288cdf();}});}else{_0x5de91b(new Error(_0x45e9('0x5')));}}else{_0x5de91b(new Error(_0x45e9('0x6')));}});});}module[_0x45e9('0x7')]=function(_0x939241,_0x342acc,_0x1e2d92,_0x4fe388,_0x122320,_0x19cc13,_0x1cac69){var _0x57c538=new AWS[(_0x45e9('0x8'))]({'accessKeyId':_0x939241,'secretAccessKey':_0x342acc,'region':_0x1e2d92});var _0x348205={'Text':_0x122320,'TextType':_0x19cc13||_0x45e9('0x9'),'OutputFormat':_0x45e9('0xa'),'VoiceId':_0x4fe388};return pollyResult(_0x57c538,_0x348205,_0x1cac69);}; \ No newline at end of file +var _0xb08a=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','path','bluebird'];(function(_0x512f81,_0x4a7986){var _0xa15099=function(_0x1f7371){while(--_0x1f7371){_0x512f81['push'](_0x512f81['shift']());}};_0xa15099(++_0x4a7986);}(_0xb08a,0x1a2));var _0xab08=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xb08a[_0x34bf97];return _0x292719;};'use strict';var fs=require('fs');var path=require(_0xab08('0x0'));var BPromise=require(_0xab08('0x1'));var rs=require(_0xab08('0x2'));var AWS=require(_0xab08('0x3'));function pollyResult(_0x58c7d8,_0x197d14,_0x191444){return new BPromise(function(_0x348671,_0x4a76b7){_0x58c7d8[_0xab08('0x4')](_0x197d14,function(_0x17dd51,_0x2405cf){if(_0x17dd51){_0x4a76b7(_0x17dd51);}else if(_0x2405cf){if(_0x2405cf[_0xab08('0x5')]instanceof Buffer){fs[_0xab08('0x6')](_0x191444,_0x2405cf[_0xab08('0x5')],function(_0x1f3024){if(_0x1f3024){_0x4a76b7(_0x1f3024);}else{_0x348671();}});}else{_0x4a76b7(new Error(_0xab08('0x7')));}}else{_0x4a76b7(new Error(_0xab08('0x8')));}});});}module[_0xab08('0x9')]=function(_0x185401,_0x3e3def,_0x337ac1,_0xe98362,_0x646645,_0x2cc719,_0x37c896){var _0x54f521=new AWS['Polly']({'accessKeyId':_0x185401,'secretAccessKey':_0x3e3def,'region':_0x337ac1});var _0x2cab78={'Text':_0x646645,'TextType':_0x2cc719||_0xab08('0xa'),'OutputFormat':_0xab08('0xb'),'VoiceId':_0xe98362};return pollyResult(_0x54f521,_0x2cab78,_0x37c896);}; \ 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 2dc2aef..15c5177 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 _0x6aa4=['exports','./lib/api'];(function(_0x1e4bb4,_0x3b42f4){var _0x353e4e=function(_0xf93d8f){while(--_0xf93d8f){_0x1e4bb4['push'](_0x1e4bb4['shift']());}};_0x353e4e(++_0x3b42f4);}(_0x6aa4,0x101));var _0x46aa=function(_0x410a52,_0x578d83){_0x410a52=_0x410a52-0x0;var _0x317c5a=_0x6aa4[_0x410a52];return _0x317c5a;};'use strict';var asr=require(_0x46aa('0x0'));module[_0x46aa('0x1')]=function(_0x66df9,_0x187ab8,_0x1392d5,_0x14b273){return asr(_0x66df9,_0x187ab8,_0x1392d5);}; \ No newline at end of file +var _0xfb18=['exports','./lib/api'];(function(_0x1685e9,_0x40d849){var _0x1cade1=function(_0x4dff8d){while(--_0x4dff8d){_0x1685e9['push'](_0x1685e9['shift']());}};_0x1cade1(++_0x40d849);}(_0xfb18,0xfd));var _0x8fb1=function(_0x43dc7e,_0x49a390){_0x43dc7e=_0x43dc7e-0x0;var _0x21e12d=_0xfb18[_0x43dc7e];return _0x21e12d;};'use strict';var asr=require(_0x8fb1('0x0'));module[_0x8fb1('0x1')]=function(_0x4c11db,_0x45a3b7,_0x533198,_0x17994c){return asr(_0x4c11db,_0x45a3b7,_0x533198);}; \ 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 276e04e..85c9a57 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 _0x593e=['key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string'];(function(_0x1f2550,_0x4873a6){var _0x2744fe=function(_0x4c6bb5){while(--_0x4c6bb5){_0x1f2550['push'](_0x1f2550['shift']());}};_0x2744fe(++_0x4873a6);}(_0x593e,0xcb));var _0xe593=function(_0x3ae31d,_0x4e25be){_0x3ae31d=_0x3ae31d-0x0;var _0x1861cb=_0x593e[_0x3ae31d];return _0x1861cb;};'use strict';var url=require(_0xe593('0x0'));var BPromise=require(_0xe593('0x1'));var fs=require('fs');var host=_0xe593('0x2');module[_0xe593('0x3')]=function(_0x43dabb,_0x184a6b,_0x2c7c48){return new BPromise(function(_0x2fa3a7,_0x550574){var _0x8a87e8;if(typeof _0x43dabb!==_0xe593('0x4')||_0x43dabb[_0xe593('0x5')]===0x0){return _0x550574(_0xe593('0x6'));}if(typeof _0x184a6b!==_0xe593('0x4')||_0x184a6b[_0xe593('0x5')]===0x0){return _0x550574(_0xe593('0x7'));}if(typeof _0x2c7c48!==_0xe593('0x8')&&(typeof _0x2c7c48!==_0xe593('0x4')||_0x2c7c48[_0xe593('0x5')]===0x0)){return _0x550574('lang\x20should\x20be\x20a\x20string');}try{_0x8a87e8=fs[_0xe593('0x9')](_0x43dabb)[_0xe593('0xa')](_0xe593('0xb'));}catch(_0x5ba75c){return _0x550574(_0x5ba75c);}return _0x2fa3a7({'method':'POST','uri':host+_0xe593('0xc')+_0x184a6b,'body':{'config':{'encoding':_0xe593('0xd'),'sampleRateHertz':_0xe593('0xe'),'languageCode':_0x2c7c48},'audio':{'content':_0x8a87e8}},'json':!![]});});}; \ No newline at end of file +var _0xb377=['string','length','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports'];(function(_0x1b08b1,_0x249597){var _0x16e073=function(_0x3535e9){while(--_0x3535e9){_0x1b08b1['push'](_0x1b08b1['shift']());}};_0x16e073(++_0x249597);}(_0xb377,0x1b6));var _0x7b37=function(_0x32f73e,_0x232d84){_0x32f73e=_0x32f73e-0x0;var _0x198d1e=_0xb377[_0x32f73e];return _0x198d1e;};'use strict';var url=require(_0x7b37('0x0'));var BPromise=require(_0x7b37('0x1'));var fs=require('fs');var host=_0x7b37('0x2');module[_0x7b37('0x3')]=function(_0xbcbce6,_0x36868b,_0x15bc68){return new BPromise(function(_0x3c4851,_0x2018bd){var _0x13f4c4;if(typeof _0xbcbce6!==_0x7b37('0x4')||_0xbcbce6[_0x7b37('0x5')]===0x0){return _0x2018bd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x36868b!=='string'||_0x36868b[_0x7b37('0x5')]===0x0){return _0x2018bd('key\x20should\x20be\x20a\x20string');}if(typeof _0x15bc68!=='undefined'&&(typeof _0x15bc68!==_0x7b37('0x4')||_0x15bc68[_0x7b37('0x5')]===0x0)){return _0x2018bd(_0x7b37('0x6'));}try{_0x13f4c4=fs[_0x7b37('0x7')](_0xbcbce6)[_0x7b37('0x8')](_0x7b37('0x9'));}catch(_0x4610cd){return _0x2018bd(_0x4610cd);}return _0x3c4851({'method':_0x7b37('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x36868b,'body':{'config':{'encoding':_0x7b37('0xb'),'sampleRateHertz':_0x7b37('0xc'),'languageCode':_0x15bc68},'audio':{'content':_0x13f4c4}},'json':!![]});});}; \ No newline at end of file diff --git a/server/services/agi/scripts/google/index.js b/server/services/agi/scripts/google/index.js index 10cb4be..da95580 100644 --- a/server/services/agi/scripts/google/index.js +++ b/server/services/agi/scripts/google/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x1f8e=['exports','./asr'];(function(_0x491780,_0x2bfddc){var _0x56e231=function(_0x216bd5){while(--_0x216bd5){_0x491780['push'](_0x491780['shift']());}};_0x56e231(++_0x2bfddc);}(_0x1f8e,0xdd));var _0xe1f8=function(_0x2555d0,_0x4150a6){_0x2555d0=_0x2555d0-0x0;var _0x3bb486=_0x1f8e[_0x2555d0];return _0x3bb486;};var asr=require(_0xe1f8('0x0'));module[_0xe1f8('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 2eca1ce..228596e 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 _0xa2fd=['http','md5','randomstring','sox','url','parse','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','https:','path','WHAT_EVER','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','statusCode','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','protocol','data','end','wav','error\x20convert','finish\x20to\x20convert','tmp','generate','.wav','writeFileSync','base64','then','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','POST','.mp3','from','audioContent','chmodSync','777','resolve','googleCloudTTS\x20path','googleTTS','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','length','\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','catch','name','googleDialogflow','textRequest','result','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','responseId','tildeASR','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','ispeechASR','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts'];(function(_0x1e1c66,_0x42676d){var _0x3b9348=function(_0x57e682){while(--_0x57e682){_0x1e1c66['push'](_0x1e1c66['shift']());}};_0x3b9348(++_0x42676d);}(_0xa2fd,0x1e8));var _0xda2f=function(_0x2efba2,_0x3ca7cb){_0x2efba2=_0x2efba2-0x0;var _0x479bd9=_0xa2fd[_0x2efba2];return _0x479bd9;};'use strict';var apiai=require('apiai-promise');var BPromise=require('bluebird');var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0xda2f('0x0'));var https=require('https');var md5=require(_0xda2f('0x1'));var path=require('path');var querystring=require('querystring');var rp=require('request-promise');var rs=require(_0xda2f('0x2'));var sox=require(_0xda2f('0x3'));var tts=require('google-tts-api');var urlParse=require(_0xda2f('0x4'))[_0xda2f('0x5')];var util=require(_0xda2f('0x6'));var aws=require(_0xda2f('0x7'));var google=require(_0xda2f('0x8'));var sestek=require(_0xda2f('0x9'));var tilde=require(_0xda2f('0xa'));var logger=require('../../../config/logger')(_0xda2f('0xb'));var ISPEECH_API=_0xda2f('0xc');function downloadFile(_0x4e76b6,_0x5d8c04){return new BPromise(function(_0x11dc86,_0x4c4909){var _0x45a6b8=urlParse(_0x4e76b6);var _0x580dbc=_0x45a6b8['protocol']===_0xda2f('0xd')?https:http;var _0x3defee={'host':_0x45a6b8['host'],'path':_0x45a6b8[_0xda2f('0xe')],'headers':{'user-agent':_0xda2f('0xf')}};_0x580dbc['get'](_0x3defee,function(_0x1d5dd8){if(_0x1d5dd8['statusCode']!==0xc8){logger[_0xda2f('0x10')](_0xda2f('0x11')+_0x4e76b6+_0xda2f('0x12')+_0x1d5dd8['statusCode']+'\x20('+_0x1d5dd8[_0xda2f('0x13')]+')');_0x4c4909(new Error(_0xda2f('0x11')+_0x4e76b6+_0xda2f('0x12')+_0x1d5dd8[_0xda2f('0x14')]+'\x20('+_0x1d5dd8[_0xda2f('0x13')]+')'));return;}var _0x56d72a=fs[_0xda2f('0x15')](_0x5d8c04);_0x56d72a['on'](_0xda2f('0x16'),function(){logger[_0xda2f('0x17')](_0xda2f('0x18'));_0x56d72a[_0xda2f('0x19')](_0x11dc86);});_0x56d72a['on'](_0xda2f('0x10'),function(_0x535755){fs[_0xda2f('0x1a')](_0x5d8c04);logger['error'](_0xda2f('0x1b'),_0x535755);_0x4c4909(_0x535755);});_0x1d5dd8[_0xda2f('0x1c')](_0x56d72a);})['on']('error',function(_0x4e8070){logger['error'](_0x4e8070);_0x4c4909(_0x4e8070);})['end']();});}function uploadFile(_0x4a8890){return new BPromise(function(_0x577596,_0x46859b){var _0x455526=urlParse(_0x4a8890);var _0x40fdc9=_0x455526[_0xda2f('0x1d')]===_0xda2f('0xd')?https:http;var _0x40ae5c={'host':_0x455526['host'],'path':_0x455526[_0xda2f('0xe')],'headers':{'user-agent':'WHAT_EVER'}};_0x40fdc9['get'](_0x40ae5c,function(_0x4ae6ba){if(_0x4ae6ba[_0xda2f('0x14')]!==0xc8){_0x46859b(new Error('request\x20to\x20'+_0x4a8890+_0xda2f('0x12')+_0x4ae6ba['statusCode']+'\x20('+_0x4ae6ba[_0xda2f('0x13')]+')'));return;}var _0x520ab9='';_0x4ae6ba['on'](_0xda2f('0x1e'),function(_0x1d3b2b){_0x520ab9+=_0x1d3b2b;});_0x4ae6ba['on']('end',function(){_0x577596(_0x520ab9);});})['on'](_0xda2f('0x10'),function(_0x36a533){_0x46859b(_0x36a533);})[_0xda2f('0x1f')]();});}function convertFile(_0x2b0f2c,_0x22af0e){return new BPromise(function(_0x39e4b5,_0x8a8fdb){var _0x479767=sox['transcode'](_0x2b0f2c,_0x22af0e,{'sampleRate':0x1f40,'format':_0xda2f('0x20'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x479767['on'](_0xda2f('0x10'),function(_0x43f274){logger[_0xda2f('0x10')](_0xda2f('0x21'),_0x43f274);_0x8a8fdb(_0x43f274);});_0x479767['on'](_0xda2f('0x1f'),function(){logger[_0xda2f('0x17')](_0xda2f('0x22'));_0x39e4b5();});_0x479767['start']();});}function base64Decode(_0x1747ee,_0x2a3020){var _0x28adb8=path['resolve'](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+_0xda2f('0x25'));fs[_0xda2f('0x26')](_0x28adb8,_0x1747ee,_0xda2f('0x27'));return convertFile(_0x28adb8,_0x2a3020)[_0xda2f('0x28')](function(){try{fs[_0xda2f('0x1a')](_0x28adb8);fs['chmodSync'](_0x2a3020,'777');}catch(_0x3280b9){logger[_0xda2f('0x10')](_0x3280b9);}return _0x2a3020[_0xda2f('0x29')]('.')[0x0];});}function base64Encode(_0xbebf65){var _0x3bb020=fs[_0xda2f('0x2a')](_0xbebf65);return new Buffer(_0x3bb020)[_0xda2f('0x2b')](_0xda2f('0x27'));}exports['googleCloudTTS']=function(_0x482b90,_0x91b938,_0x38cff0,_0x528522,_0x35002b,_0x35eac6){var _0x7c3fa3,_0x171bff;var _0x11c6c9=_0xda2f('0x2c');var _0x5f1236=_0xda2f('0x2d')+_0x482b90;var _0x25fbcf={};if(_0x91b938==='ssml'){_0x25fbcf['input']={'ssml':_0x38cff0};}else{_0x25fbcf[_0xda2f('0x2e')]={'text':_0x38cff0};};_0x25fbcf[_0xda2f('0x2f')]={'languageCode':_0x528522,'ssmlGender':_0x35002b};_0x25fbcf[_0xda2f('0x30')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x580faa={'url':_0x11c6c9+'text:synthesize'+_0x5f1236,'method':_0xda2f('0x31'),'json':!![],'body':_0x25fbcf};return rp(_0x580faa)[_0xda2f('0x28')](function(_0x5f5ed6){return new BPromise(function(_0x31e7c8,_0x4262f5){_0x7c3fa3=path['resolve'](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+_0xda2f('0x32'));var _0x890deb=Buffer[_0xda2f('0x33')](_0x5f5ed6[_0xda2f('0x34')],_0xda2f('0x27'));return fs['writeFile'](_0x7c3fa3,_0x890deb,function(_0x52fa99){_0x4262f5(_0x52fa99);},function(_0x2bea1f){fs[_0xda2f('0x35')](_0x7c3fa3,_0xda2f('0x36'));_0x31e7c8(_0x2bea1f);});});})[_0xda2f('0x28')](function(_0x1f3e94){_0x171bff=path[_0xda2f('0x37')](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+_0xda2f('0x25'));return convertFile(_0x7c3fa3,_0x171bff);})['then'](function(){try{fs[_0xda2f('0x1a')](_0x7c3fa3);fs[_0xda2f('0x35')](_0x171bff,'777');}catch(_0x3474ee){logger['error'](_0x3474ee);}logger[_0xda2f('0x17')](_0xda2f('0x38'),_0x171bff[_0xda2f('0x29')]('.')[0x0]);return _0x171bff[_0xda2f('0x29')]('.')[0x0];});};exports[_0xda2f('0x39')]=function(_0x34462f,_0x1aa580){var _0x35f8b6='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x91ba3f,_0xc8051f;var _0x2dfc13;var _0x3ede8b={'encoding':_0xda2f('0x3a'),'method':_0xda2f('0x31'),'timeout':0x2710,'url':_0x35f8b6,'headers':{'Content-Type':_0xda2f('0x3b')},'body':_0xda2f('0x3c')+encodeURIComponent(JSON[_0xda2f('0x3d')]([[['jQ1olc',JSON[_0xda2f('0x3d')]([_0x34462f,_0x1aa580||'en',![],_0xda2f('0x3e')]),null,'generic']]]))};return rp(_0x3ede8b)[_0xda2f('0x28')](function(_0xa4eb68){try{_0x2dfc13=eval(_0xa4eb68['slice'](0x5))[0x0][0x2];}catch(_0x51a132){throw new Error('parse\x20response\x20failed:\x0a'+_0xa4eb68[_0xda2f('0x1e')]);}if(!_0x2dfc13){if(_0x34462f[_0xda2f('0x3f')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x1aa580+_0xda2f('0x40'));}}try{_0x2dfc13=eval(_0x2dfc13)[0x0];}catch(_0x7ec749){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xda2f('0x1e')]);}const _0x34f3b8=_0x2dfc13;_0x91ba3f=path['resolve'](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+_0xda2f('0x32'));fs[_0xda2f('0x26')](_0x91ba3f,_0x2dfc13,{'encoding':_0xda2f('0x27')});_0xc8051f=path[_0xda2f('0x37')](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+_0xda2f('0x25'));return convertFile(_0x91ba3f,_0xc8051f);})['then'](function(){try{fs[_0xda2f('0x1a')](_0x91ba3f);fs['chmodSync'](_0xc8051f,_0xda2f('0x36'));}catch(_0x4513f1){logger[_0xda2f('0x10')](_0x4513f1);}logger[_0xda2f('0x17')](_0xda2f('0x41'),_0xc8051f['split']('.')[0x0]);return _0xc8051f[_0xda2f('0x29')]('.')[0x0];});};exports[_0xda2f('0x42')]=function(_0x1f3c7a,_0x2c39ab,_0x3b8e4c){return google[_0xda2f('0x43')](_0x1f3c7a,_0x2c39ab,_0x3b8e4c)[_0xda2f('0x28')](function(_0x2445bd){logger[_0xda2f('0x17')](_0x2445bd[_0xda2f('0x44')]);return rp(_0x2445bd);})[_0xda2f('0x28')](function(_0x4f4551){var _0x25bf52='';var _0x10e106=0x0;try{fs['unlink'](_0x1f3c7a);}catch(_0x455fe0){logger[_0xda2f('0x10')](_0x455fe0);}if(_0x4f4551&&_0x4f4551[_0xda2f('0x45')]){_0x25bf52=_0x4f4551['results'][_0xda2f('0x46')](function(_0x5e815f){return _0x5e815f&&_0x5e815f['alternatives'][0x0]&&_0x5e815f[_0xda2f('0x47')][0x0][_0xda2f('0x48')]?_0x5e815f[_0xda2f('0x47')][0x0][_0xda2f('0x48')]:'';})[_0xda2f('0x49')]('\x0a');_0x10e106=_0x4f4551[_0xda2f('0x45')][_0xda2f('0x46')](function(_0x3dfa2a){return _0x3dfa2a&&_0x3dfa2a[_0xda2f('0x47')][0x0]&&_0x3dfa2a['alternatives'][0x0][_0xda2f('0x4a')]?_0x3dfa2a['alternatives'][0x0][_0xda2f('0x4a')]:0x0;})[_0xda2f('0x49')]('\x0a');}logger[_0xda2f('0x17')](_0xda2f('0x4b'),_0x25bf52);logger[_0xda2f('0x17')]('googleASR\x20confidence',_0x10e106);return{'transcript':_0x25bf52,'confidence':_0x10e106};})[_0xda2f('0x4c')](function(_0x1bc8b8){logger[_0xda2f('0x10')]('[%s]\x20%s:%s',_0x1bc8b8[_0xda2f('0x14')],_0x1bc8b8[_0xda2f('0x4d')],_0x1bc8b8['message']);});};exports[_0xda2f('0x4e')]=function(_0x5a755c,_0x4e5857,_0x4dae6a,_0x316c78){var _0x2db882=apiai(_0x4e5857,{'language':_0x316c78||'en'});return _0x2db882[_0xda2f('0x4f')](_0x4dae6a,{'sessionId':md5(_0x5a755c)})[_0xda2f('0x28')](function(_0x1f4309){logger[_0xda2f('0x17')](JSON[_0xda2f('0x3d')](_0x1f4309));return{'source':_0x1f4309[_0xda2f('0x50')]['source'],'resolvedQuery':_0x1f4309[_0xda2f('0x50')]['resolvedQuery'],'action':_0x1f4309[_0xda2f('0x50')]['action'],'actionIncomplete':_0x1f4309[_0xda2f('0x50')][_0xda2f('0x51')],'speech':_0x1f4309[_0xda2f('0x50')][_0xda2f('0x52')][_0xda2f('0x53')],'score':_0x1f4309['result'][_0xda2f('0x54')],'statusCode':_0x1f4309[_0xda2f('0x55')][_0xda2f('0x56')],'endConversation':_0x1f4309[_0xda2f('0x50')][_0xda2f('0x57')][_0xda2f('0x58')]||![],'isFallbackIntent':_0x1f4309[_0xda2f('0x50')][_0xda2f('0x57')][_0xda2f('0x59')]};});};exports[_0xda2f('0x5a')]=function(_0x54b9f5,_0xd2c1af,_0x482343,_0x3169f1,_0x577617,_0x182a00){var _0x174f42=_0x3169f1[_0xda2f('0x5b')](/\\n/g,'\x0a');var _0x166630={'credentials':{'private_key':_0x174f42,'client_email':_0x482343}};var _0x415b18=new dialogflow[(_0xda2f('0x5c'))](_0x166630);var _0xc3572f=_0x415b18[_0xda2f('0x5d')](_0xd2c1af,md5(_0x54b9f5));var _0x468642={'session':_0xc3572f,'queryInput':{'text':{'text':_0x577617,'languageCode':_0x182a00}}};return _0x415b18[_0xda2f('0x5e')](_0x468642)[_0xda2f('0x28')](function(_0x3c5190){if(_0x3c5190&&_0x3c5190['length']){logger[_0xda2f('0x17')](_0xda2f('0x5f'),JSON[_0xda2f('0x3d')](_0x3c5190));var _0x1ac325=_0x3c5190[0x0];if(_0x1ac325){var _0x1bb364={'action':_0x1ac325[_0xda2f('0x60')][_0xda2f('0x61')],'allRequiredParamsPresent':_0x1ac325['queryResult'][_0xda2f('0x62')],'endConversation':_0x1ac325[_0xda2f('0x60')][_0xda2f('0x63')]&&_0x1ac325[_0xda2f('0x60')]['diagnosticInfo']['fields']?_0x1ac325[_0xda2f('0x60')][_0xda2f('0x63')]['fields'][_0xda2f('0x64')][_0xda2f('0x65')]:![],'fulfillmentText':_0x1ac325['queryResult'][_0xda2f('0x66')],'intentName':_0x1ac325['queryResult'][_0xda2f('0x67')][_0xda2f('0x4d')],'intentDisplayName':_0x1ac325[_0xda2f('0x60')][_0xda2f('0x67')][_0xda2f('0x68')],'isFallbackIntent':_0x1ac325['queryResult'][_0xda2f('0x67')][_0xda2f('0x69')],'languageCode':_0x1ac325[_0xda2f('0x60')]['languageCode'],'queryText':_0x1ac325[_0xda2f('0x60')]['queryText'],'responseId':_0x1ac325[_0xda2f('0x6a')],'score':_0x1ac325[_0xda2f('0x60')]['intentDetectionConfidence'],'speech':_0x1ac325[_0xda2f('0x60')][_0xda2f('0x66')],'providerResponse':JSON[_0xda2f('0x3d')](_0x3c5190)};return _0x1bb364;}}});};exports[_0xda2f('0x6b')]=function(_0x3d503a,_0x3567f3,_0x10c5dd,_0xada5de){return tilde[_0xda2f('0x43')](_0x3d503a,_0x3567f3,_0x10c5dd,_0xada5de)['then'](function(_0xe3e67f){try{fs[_0xda2f('0x1a')](_0x3d503a);}catch(_0x2cb3d2){logger[_0xda2f('0x10')](_0x2cb3d2);}logger[_0xda2f('0x17')]('Tilde\x20ASR\x20transcription',_0xe3e67f['transcript']);logger['info'](_0xda2f('0x6c'),_0xe3e67f[_0xda2f('0x4a')]);return _0xe3e67f;});};exports[_0xda2f('0x6d')]=function(_0x55922b,_0x557f4f,_0x4d9495,_0x4e5a46,_0x15aed5,_0x1eabf6){var _0x29ec7a=path[_0xda2f('0x37')](__dirname,'tmp',rs[_0xda2f('0x24')](0x4)+_0xda2f('0x32'));var _0x3dd791;return aws['polly'](_0x55922b,_0x557f4f,_0x4d9495,_0x4e5a46,_0x15aed5,_0x1eabf6,_0x29ec7a)[_0xda2f('0x28')](function(){_0x3dd791=path[_0xda2f('0x37')](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+_0xda2f('0x25'));return convertFile(_0x29ec7a,_0x3dd791);})[_0xda2f('0x28')](function(){try{fs[_0xda2f('0x1a')](_0x29ec7a);fs[_0xda2f('0x35')](_0x3dd791,_0xda2f('0x36'));}catch(_0x45a500){logger[_0xda2f('0x10')](_0x45a500);}return _0x3dd791[_0xda2f('0x29')]('.')[0x0];});};exports[_0xda2f('0x6e')]=function(_0x126efc,_0x87cc9a,_0x425e27,_0xe4ecad,_0xc785d6,_0x16321b){return aws[_0xda2f('0x6f')](_0x126efc,_0x87cc9a,_0x425e27,_0xe4ecad,_0xc785d6,_0x16321b)['then'](function(_0x1d7581){logger[_0xda2f('0x17')](JSON['stringify'](_0x1d7581));return _0x1d7581;});};exports[_0xda2f('0x70')]=function(_0x14b6db,_0x4546a5,_0x3317e2,_0x189ac7){var _0x5427d2=util[_0xda2f('0x71')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x14b6db,encodeURIComponent(_0x4546a5),_0x3317e2,_0x189ac7);var _0xbb9de3=path[_0xda2f('0x37')](__dirname,_0xda2f('0x23'),rs['generate'](0x4)+_0xda2f('0x32'));var _0x5273c9;return downloadFile(_0x5427d2,_0xbb9de3)[_0xda2f('0x28')](function(){_0x5273c9=path[_0xda2f('0x37')](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+'.wav');return convertFile(_0xbb9de3,_0x5273c9);})['then'](function(){try{fs[_0xda2f('0x1a')](_0xbb9de3);fs['chmodSync'](_0x5273c9,_0xda2f('0x36'));}catch(_0x39f4ca){logger[_0xda2f('0x10')](_0x39f4ca);}return _0x5273c9[_0xda2f('0x29')]('.')[0x0];});};exports[_0xda2f('0x72')]=function(_0x2b2c34,_0x2a0b02,_0x2c5a0d,_0x1beb89){var _0x325e3d=util['format']('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x2a0b02,_0x2c5a0d,base64Encode(_0x2b2c34),_0x1beb89?util['format']('model=%s',encodeURIComponent(_0x1beb89)):_0xda2f('0x73'));return uploadFile(_0x325e3d)[_0xda2f('0x28')](function(_0x2a01fb){return querystring[_0xda2f('0x5')](_0x2a01fb);});};exports[_0xda2f('0x74')]=function(_0x242c71,_0x4c6121){return sestek[_0xda2f('0x75')](_0x242c71,_0x4c6121)[_0xda2f('0x28')](function(_0x106542){logger[_0xda2f('0x17')](JSON['stringify'](_0x106542));var _0x528d12={'speech':_0x106542['text'],'action':_0x106542[_0xda2f('0x76')]?_0x106542['channelData'][_0xda2f('0x77')]:undefined,'actiondata':_0x106542[_0xda2f('0x76')]?_0x106542['channelData'][_0xda2f('0x78')]:undefined};if(_0x106542[_0xda2f('0x76')]&&_0x106542[_0xda2f('0x76')][_0xda2f('0x79')]){return base64Decode(_0x106542[_0xda2f('0x76')][_0xda2f('0x79')]['Data'],path[_0xda2f('0x37')](__dirname,_0xda2f('0x23'),rs[_0xda2f('0x24')](0x4)+_0xda2f('0x25')))['then'](function(_0xc75101){_0x528d12['audiofile']=_0xc75101;return _0x528d12;});}return _0x528d12;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x2d1e=['pipe','end','protocol','data','transcode','error\x20convert','finish\x20to\x20convert','start','tmp','.wav','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','POST','resolve','generate','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','null','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','result','source','resolvedQuery','action','fulfillment','speech','score','status','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','dialogflow','http','https','md5','path','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error'];(function(_0x462f5c,_0xd41889){var _0x52df33=function(_0x54f23a){while(--_0x54f23a){_0x462f5c['push'](_0x462f5c['shift']());}};_0x52df33(++_0xd41889);}(_0x2d1e,0x101));var _0xe2d1=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2d1e[_0x5ddb1c];return _0x354adc;};'use strict';var apiai=require(_0xe2d1('0x0'));var BPromise=require(_0xe2d1('0x1'));var dialogflow=require(_0xe2d1('0x2'));var fs=require('fs');var http=require(_0xe2d1('0x3'));var https=require(_0xe2d1('0x4'));var md5=require(_0xe2d1('0x5'));var path=require(_0xe2d1('0x6'));var querystring=require('querystring');var rp=require(_0xe2d1('0x7'));var rs=require(_0xe2d1('0x8'));var sox=require(_0xe2d1('0x9'));var tts=require(_0xe2d1('0xa'));var urlParse=require(_0xe2d1('0xb'))[_0xe2d1('0xc')];var util=require(_0xe2d1('0xd'));var aws=require(_0xe2d1('0xe'));var google=require(_0xe2d1('0xf'));var sestek=require(_0xe2d1('0x10'));var tilde=require('./tilde');var logger=require(_0xe2d1('0x11'))(_0xe2d1('0x12'));var ISPEECH_API=_0xe2d1('0x13');function downloadFile(_0x1ed75b,_0x3e719f){return new BPromise(function(_0x3ea656,_0x45750e){var _0x3b59fc=urlParse(_0x1ed75b);var _0x54f21b=_0x3b59fc['protocol']===_0xe2d1('0x14')?https:http;var _0x2327bf={'host':_0x3b59fc[_0xe2d1('0x15')],'path':_0x3b59fc[_0xe2d1('0x6')],'headers':{'user-agent':_0xe2d1('0x16')}};_0x54f21b[_0xe2d1('0x17')](_0x2327bf,function(_0xf372b5){if(_0xf372b5['statusCode']!==0xc8){logger[_0xe2d1('0x18')](_0xe2d1('0x19')+_0x1ed75b+_0xe2d1('0x1a')+_0xf372b5[_0xe2d1('0x1b')]+'\x20('+_0xf372b5[_0xe2d1('0x1c')]+')');_0x45750e(new Error(_0xe2d1('0x19')+_0x1ed75b+_0xe2d1('0x1a')+_0xf372b5[_0xe2d1('0x1b')]+'\x20('+_0xf372b5['statusMessage']+')'));return;}var _0x3388be=fs['createWriteStream'](_0x3e719f);_0x3388be['on'](_0xe2d1('0x1d'),function(){logger[_0xe2d1('0x1e')](_0xe2d1('0x1f'));_0x3388be[_0xe2d1('0x20')](_0x3ea656);});_0x3388be['on'](_0xe2d1('0x18'),function(_0x219423){fs[_0xe2d1('0x21')](_0x3e719f);logger[_0xe2d1('0x18')](_0xe2d1('0x22'),_0x219423);_0x45750e(_0x219423);});_0xf372b5[_0xe2d1('0x23')](_0x3388be);})['on']('error',function(_0xad3c68){logger[_0xe2d1('0x18')](_0xad3c68);_0x45750e(_0xad3c68);})[_0xe2d1('0x24')]();});}function uploadFile(_0xbeb3cc){return new BPromise(function(_0x3dc282,_0x44970a){var _0x7af2d=urlParse(_0xbeb3cc);var _0x56ce57=_0x7af2d[_0xe2d1('0x25')]===_0xe2d1('0x14')?https:http;var _0x526d45={'host':_0x7af2d['host'],'path':_0x7af2d[_0xe2d1('0x6')],'headers':{'user-agent':_0xe2d1('0x16')}};_0x56ce57[_0xe2d1('0x17')](_0x526d45,function(_0x23eaab){if(_0x23eaab[_0xe2d1('0x1b')]!==0xc8){_0x44970a(new Error(_0xe2d1('0x19')+_0xbeb3cc+_0xe2d1('0x1a')+_0x23eaab[_0xe2d1('0x1b')]+'\x20('+_0x23eaab[_0xe2d1('0x1c')]+')'));return;}var _0x194a7f='';_0x23eaab['on'](_0xe2d1('0x26'),function(_0x1769ac){_0x194a7f+=_0x1769ac;});_0x23eaab['on'](_0xe2d1('0x24'),function(){_0x3dc282(_0x194a7f);});})['on'](_0xe2d1('0x18'),function(_0x5b1bed){_0x44970a(_0x5b1bed);})[_0xe2d1('0x24')]();});}function convertFile(_0x20455e,_0x5c0b33){return new BPromise(function(_0x4505aa,_0x1c1e20){var _0x25ad16=sox[_0xe2d1('0x27')](_0x20455e,_0x5c0b33,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x25ad16['on'](_0xe2d1('0x18'),function(_0x34d6c3){logger['error'](_0xe2d1('0x28'),_0x34d6c3);_0x1c1e20(_0x34d6c3);});_0x25ad16['on'](_0xe2d1('0x24'),function(){logger[_0xe2d1('0x1e')](_0xe2d1('0x29'));_0x4505aa();});_0x25ad16[_0xe2d1('0x2a')]();});}function base64Decode(_0x5b2c07,_0x1a52e1){var _0x103635=path['resolve'](__dirname,_0xe2d1('0x2b'),rs['generate'](0x4)+_0xe2d1('0x2c'));fs['writeFileSync'](_0x103635,_0x5b2c07,_0xe2d1('0x2d'));return convertFile(_0x103635,_0x1a52e1)[_0xe2d1('0x2e')](function(){try{fs[_0xe2d1('0x21')](_0x103635);fs[_0xe2d1('0x2f')](_0x1a52e1,'777');}catch(_0x58bbaa){logger[_0xe2d1('0x18')](_0x58bbaa);}return _0x1a52e1[_0xe2d1('0x30')]('.')[0x0];});}function base64Encode(_0x237e40){var _0x29b852=fs[_0xe2d1('0x31')](_0x237e40);return new Buffer(_0x29b852)[_0xe2d1('0x32')]('base64');}exports[_0xe2d1('0x33')]=function(_0x420669,_0x833c1a,_0x2df2d4,_0x575337,_0x5b8da6,_0x3f3413){var _0x115ed5,_0x337b06;var _0x123de8=_0xe2d1('0x34');var _0x313555=_0xe2d1('0x35')+_0x420669;var _0x334e7b={};if(_0x833c1a===_0xe2d1('0x36')){_0x334e7b[_0xe2d1('0x37')]={'ssml':_0x2df2d4};}else{_0x334e7b[_0xe2d1('0x37')]={'text':_0x2df2d4};};_0x334e7b[_0xe2d1('0x38')]={'languageCode':_0x575337,'ssmlGender':_0x5b8da6};_0x334e7b[_0xe2d1('0x39')]={'audioEncoding':_0xe2d1('0x3a'),'sampleRateHertz':0x1f40};var _0x3b6f8e={'url':_0x123de8+_0xe2d1('0x3b')+_0x313555,'method':_0xe2d1('0x3c'),'json':!![],'body':_0x334e7b};return rp(_0x3b6f8e)[_0xe2d1('0x2e')](function(_0x49ff32){return new BPromise(function(_0x340614,_0x13fa27){_0x115ed5=path[_0xe2d1('0x3d')](__dirname,_0xe2d1('0x2b'),rs[_0xe2d1('0x3e')](0x4)+_0xe2d1('0x3f'));var _0x452cfc=Buffer[_0xe2d1('0x40')](_0x49ff32[_0xe2d1('0x41')],_0xe2d1('0x2d'));return fs[_0xe2d1('0x42')](_0x115ed5,_0x452cfc,function(_0x50414a){_0x13fa27(_0x50414a);},function(_0x2cf328){fs[_0xe2d1('0x2f')](_0x115ed5,_0xe2d1('0x43'));_0x340614(_0x2cf328);});});})[_0xe2d1('0x2e')](function(_0x2b8586){_0x337b06=path[_0xe2d1('0x3d')](__dirname,_0xe2d1('0x2b'),rs[_0xe2d1('0x3e')](0x4)+_0xe2d1('0x2c'));return convertFile(_0x115ed5,_0x337b06);})['then'](function(){try{fs[_0xe2d1('0x21')](_0x115ed5);fs[_0xe2d1('0x2f')](_0x337b06,_0xe2d1('0x43'));}catch(_0x50971a){logger[_0xe2d1('0x18')](_0x50971a);}logger[_0xe2d1('0x1e')](_0xe2d1('0x44'),_0x337b06[_0xe2d1('0x30')]('.')[0x0]);return _0x337b06[_0xe2d1('0x30')]('.')[0x0];});};exports['googleTTS']=function(_0xa03257,_0x12173f){var _0x1011f1=_0xe2d1('0x45');var _0x27ba55,_0x3a6b48;var _0x42cdac;var _0x66c3af={'encoding':_0xe2d1('0x46'),'method':_0xe2d1('0x3c'),'timeout':0x2710,'url':_0x1011f1,'headers':{'Content-Type':_0xe2d1('0x47')},'body':_0xe2d1('0x48')+encodeURIComponent(JSON['stringify']([[['jQ1olc',JSON[_0xe2d1('0x49')]([_0xa03257,_0x12173f||'en',![],_0xe2d1('0x4a')]),null,'generic']]]))};return rp(_0x66c3af)['then'](function(_0x229f6b){try{_0x42cdac=eval(_0x229f6b['slice'](0x5))[0x0][0x2];}catch(_0x1237ca){throw new Error(_0xe2d1('0x4b')+_0x229f6b[_0xe2d1('0x26')]);}if(!_0x42cdac){if(_0xa03257[_0xe2d1('0x4c')]>0xc8){throw new Error(_0xe2d1('0x4d'));}else{throw new Error(_0xe2d1('0x4e')+_0x12173f+_0xe2d1('0x4f'));}}try{_0x42cdac=eval(_0x42cdac)[0x0];}catch(_0x522f4f){throw new Error('parse\x20response\x20failed:\x0a'+res[_0xe2d1('0x26')]);}const _0x8ae003=_0x42cdac;_0x27ba55=path[_0xe2d1('0x3d')](__dirname,_0xe2d1('0x2b'),rs['generate'](0x4)+_0xe2d1('0x3f'));fs[_0xe2d1('0x50')](_0x27ba55,_0x42cdac,{'encoding':'base64'});_0x3a6b48=path['resolve'](__dirname,_0xe2d1('0x2b'),rs[_0xe2d1('0x3e')](0x4)+_0xe2d1('0x2c'));return convertFile(_0x27ba55,_0x3a6b48);})[_0xe2d1('0x2e')](function(){try{fs[_0xe2d1('0x21')](_0x27ba55);fs[_0xe2d1('0x2f')](_0x3a6b48,_0xe2d1('0x43'));}catch(_0x3308a1){logger['error'](_0x3308a1);}logger['info'](_0xe2d1('0x51'),_0x3a6b48[_0xe2d1('0x30')]('.')[0x0]);return _0x3a6b48['split']('.')[0x0];});};exports[_0xe2d1('0x52')]=function(_0xe3705a,_0x3e1478,_0x376b5f){return google[_0xe2d1('0x53')](_0xe3705a,_0x3e1478,_0x376b5f)[_0xe2d1('0x2e')](function(_0x1d4cca){logger[_0xe2d1('0x1e')](_0x1d4cca[_0xe2d1('0x54')]);return rp(_0x1d4cca);})['then'](function(_0x298e42){var _0x5bd10d='';var _0x1cbb7b=0x0;try{fs[_0xe2d1('0x21')](_0xe3705a);}catch(_0x54b9aa){logger[_0xe2d1('0x18')](_0x54b9aa);}if(_0x298e42&&_0x298e42['results']){_0x5bd10d=_0x298e42[_0xe2d1('0x55')][_0xe2d1('0x56')](function(_0x1a39f0){return _0x1a39f0&&_0x1a39f0[_0xe2d1('0x57')][0x0]&&_0x1a39f0[_0xe2d1('0x57')][0x0][_0xe2d1('0x58')]?_0x1a39f0[_0xe2d1('0x57')][0x0]['transcript']:'';})[_0xe2d1('0x59')]('\x0a');_0x1cbb7b=_0x298e42[_0xe2d1('0x55')]['map'](function(_0x5ce165){return _0x5ce165&&_0x5ce165[_0xe2d1('0x57')][0x0]&&_0x5ce165['alternatives'][0x0]['confidence']?_0x5ce165['alternatives'][0x0][_0xe2d1('0x5a')]:0x0;})[_0xe2d1('0x59')]('\x0a');}logger[_0xe2d1('0x1e')](_0xe2d1('0x5b'),_0x5bd10d);logger[_0xe2d1('0x1e')](_0xe2d1('0x5c'),_0x1cbb7b);return{'transcript':_0x5bd10d,'confidence':_0x1cbb7b};})[_0xe2d1('0x5d')](function(_0x1bb9eb){logger[_0xe2d1('0x18')](_0xe2d1('0x5e'),_0x1bb9eb[_0xe2d1('0x1b')],_0x1bb9eb[_0xe2d1('0x5f')],_0x1bb9eb[_0xe2d1('0x60')]);});};exports['googleDialogflow']=function(_0x441ece,_0x31f618,_0x533061,_0x3ebb75){var _0x436bc3=apiai(_0x31f618,{'language':_0x3ebb75||'en'});return _0x436bc3[_0xe2d1('0x61')](_0x533061,{'sessionId':md5(_0x441ece)})[_0xe2d1('0x2e')](function(_0x2f84e9){logger[_0xe2d1('0x1e')](JSON['stringify'](_0x2f84e9));return{'source':_0x2f84e9[_0xe2d1('0x62')][_0xe2d1('0x63')],'resolvedQuery':_0x2f84e9[_0xe2d1('0x62')][_0xe2d1('0x64')],'action':_0x2f84e9[_0xe2d1('0x62')][_0xe2d1('0x65')],'actionIncomplete':_0x2f84e9['result']['actionIncomplete'],'speech':_0x2f84e9[_0xe2d1('0x62')][_0xe2d1('0x66')][_0xe2d1('0x67')],'score':_0x2f84e9['result'][_0xe2d1('0x68')],'statusCode':_0x2f84e9[_0xe2d1('0x69')]['code'],'endConversation':_0x2f84e9[_0xe2d1('0x62')][_0xe2d1('0x6a')]['endConversation']||![],'isFallbackIntent':_0x2f84e9[_0xe2d1('0x62')]['metadata']['isFallbackIntent']};});};exports[_0xe2d1('0x6b')]=function(_0x22d441,_0x28bfe7,_0x29bedb,_0x3c1baa,_0x5a0232,_0x1a539d){var _0x74d4fe=_0x3c1baa[_0xe2d1('0x6c')](/\\n/g,'\x0a');var _0x4aa157={'credentials':{'private_key':_0x74d4fe,'client_email':_0x29bedb}};var _0x25890f=new dialogflow[(_0xe2d1('0x6d'))](_0x4aa157);var _0x16f236=_0x25890f[_0xe2d1('0x6e')](_0x28bfe7,md5(_0x22d441));var _0x419108={'session':_0x16f236,'queryInput':{'text':{'text':_0x5a0232,'languageCode':_0x1a539d}}};return _0x25890f[_0xe2d1('0x6f')](_0x419108)['then'](function(_0x1b6858){if(_0x1b6858&&_0x1b6858['length']){logger[_0xe2d1('0x1e')](_0xe2d1('0x70'),JSON[_0xe2d1('0x49')](_0x1b6858));var _0x496884=_0x1b6858[0x0];if(_0x496884){var _0x13b53f={'action':_0x496884[_0xe2d1('0x71')][_0xe2d1('0x65')],'allRequiredParamsPresent':_0x496884['queryResult'][_0xe2d1('0x72')],'endConversation':_0x496884[_0xe2d1('0x71')][_0xe2d1('0x73')]&&_0x496884[_0xe2d1('0x71')][_0xe2d1('0x73')][_0xe2d1('0x74')]?_0x496884[_0xe2d1('0x71')]['diagnosticInfo'][_0xe2d1('0x74')]['end_conversation'][_0xe2d1('0x75')]:![],'fulfillmentText':_0x496884[_0xe2d1('0x71')][_0xe2d1('0x76')],'intentName':_0x496884['queryResult'][_0xe2d1('0x77')][_0xe2d1('0x5f')],'intentDisplayName':_0x496884[_0xe2d1('0x71')][_0xe2d1('0x77')][_0xe2d1('0x78')],'isFallbackIntent':_0x496884[_0xe2d1('0x71')]['intent'][_0xe2d1('0x79')],'languageCode':_0x496884[_0xe2d1('0x71')][_0xe2d1('0x7a')],'queryText':_0x496884[_0xe2d1('0x71')]['queryText'],'responseId':_0x496884[_0xe2d1('0x7b')],'score':_0x496884[_0xe2d1('0x71')][_0xe2d1('0x7c')],'speech':_0x496884[_0xe2d1('0x71')][_0xe2d1('0x76')],'providerResponse':JSON[_0xe2d1('0x49')](_0x1b6858)};return _0x13b53f;}}});};exports['tildeASR']=function(_0x490f35,_0x41c858,_0x298ae5,_0x1c6271){return tilde['asr'](_0x490f35,_0x41c858,_0x298ae5,_0x1c6271)[_0xe2d1('0x2e')](function(_0x391b66){try{fs['unlink'](_0x490f35);}catch(_0x491be7){logger[_0xe2d1('0x18')](_0x491be7);}logger[_0xe2d1('0x1e')](_0xe2d1('0x7d'),_0x391b66[_0xe2d1('0x58')]);logger[_0xe2d1('0x1e')](_0xe2d1('0x7e'),_0x391b66[_0xe2d1('0x5a')]);return _0x391b66;});};exports[_0xe2d1('0x7f')]=function(_0xe092d0,_0x46533b,_0xa9c01d,_0x51247c,_0x1f677b,_0x45a5b4){var _0x5c16a1=path['resolve'](__dirname,_0xe2d1('0x2b'),rs[_0xe2d1('0x3e')](0x4)+_0xe2d1('0x3f'));var _0x4f663b;return aws[_0xe2d1('0x80')](_0xe092d0,_0x46533b,_0xa9c01d,_0x51247c,_0x1f677b,_0x45a5b4,_0x5c16a1)[_0xe2d1('0x2e')](function(){_0x4f663b=path[_0xe2d1('0x3d')](__dirname,_0xe2d1('0x2b'),rs['generate'](0x4)+'.wav');return convertFile(_0x5c16a1,_0x4f663b);})[_0xe2d1('0x2e')](function(){try{fs['unlink'](_0x5c16a1);fs[_0xe2d1('0x2f')](_0x4f663b,_0xe2d1('0x43'));}catch(_0x33b7ae){logger[_0xe2d1('0x18')](_0x33b7ae);}return _0x4f663b[_0xe2d1('0x30')]('.')[0x0];});};exports[_0xe2d1('0x81')]=function(_0x1cf8d6,_0x3a24ef,_0x10375a,_0x507f81,_0x536f49,_0x376eec){return aws[_0xe2d1('0x82')](_0x1cf8d6,_0x3a24ef,_0x10375a,_0x507f81,_0x536f49,_0x376eec)[_0xe2d1('0x2e')](function(_0x572e17){logger[_0xe2d1('0x1e')](JSON[_0xe2d1('0x49')](_0x572e17));return _0x572e17;});};exports['ispeechTTS']=function(_0x5bbf26,_0x425648,_0x54db20,_0x460e1b){var _0x59bffa=util[_0xe2d1('0x83')](_0xe2d1('0x84'),ISPEECH_API,_0x5bbf26,encodeURIComponent(_0x425648),_0x54db20,_0x460e1b);var _0x6c374b=path['resolve'](__dirname,_0xe2d1('0x2b'),rs[_0xe2d1('0x3e')](0x4)+_0xe2d1('0x3f'));var _0x949c2b;return downloadFile(_0x59bffa,_0x6c374b)['then'](function(){_0x949c2b=path[_0xe2d1('0x3d')](__dirname,_0xe2d1('0x2b'),rs['generate'](0x4)+_0xe2d1('0x2c'));return convertFile(_0x6c374b,_0x949c2b);})[_0xe2d1('0x2e')](function(){try{fs['unlink'](_0x6c374b);fs[_0xe2d1('0x2f')](_0x949c2b,'777');}catch(_0x449091){logger['error'](_0x449091);}return _0x949c2b[_0xe2d1('0x30')]('.')[0x0];});};exports[_0xe2d1('0x85')]=function(_0x24f84d,_0x29d616,_0x4a63ef,_0x216f1d){var _0xbd92fd=util[_0xe2d1('0x83')](_0xe2d1('0x86'),ISPEECH_API,_0x29d616,_0x4a63ef,base64Encode(_0x24f84d),_0x216f1d?util[_0xe2d1('0x83')]('model=%s',encodeURIComponent(_0x216f1d)):_0xe2d1('0x87'));return uploadFile(_0xbd92fd)[_0xe2d1('0x2e')](function(_0x15b354){return querystring[_0xe2d1('0xc')](_0x15b354);});};exports[_0xe2d1('0x88')]=function(_0x484622,_0x353c6f){return sestek[_0xe2d1('0x89')](_0x484622,_0x353c6f)[_0xe2d1('0x2e')](function(_0x38b90b){logger['info'](JSON[_0xe2d1('0x49')](_0x38b90b));var _0x39bb55={'speech':_0x38b90b[_0xe2d1('0x8a')],'action':_0x38b90b['channelData']?_0x38b90b[_0xe2d1('0x8b')][_0xe2d1('0x8c')]:undefined,'actiondata':_0x38b90b['channelData']?_0x38b90b[_0xe2d1('0x8b')][_0xe2d1('0x8d')]:undefined};if(_0x38b90b[_0xe2d1('0x8b')]&&_0x38b90b[_0xe2d1('0x8b')][_0xe2d1('0x8e')]){return base64Decode(_0x38b90b['channelData'][_0xe2d1('0x8e')][_0xe2d1('0x8f')],path[_0xe2d1('0x3d')](__dirname,_0xe2d1('0x2b'),rs['generate'](0x4)+_0xe2d1('0x2c')))[_0xe2d1('0x2e')](function(_0x3cc4ee){_0x39bb55[_0xe2d1('0x90')]=_0x3cc4ee;return _0x39bb55;});}return _0x39bb55;});};exports[_0xe2d1('0x91')]=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 762e7ce..6378569 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 _0xa9f2=['./nda'];(function(_0x378891,_0x4e3e16){var _0xfbfda2=function(_0x3b7681){while(--_0x3b7681){_0x378891['push'](_0x378891['shift']());}};_0xfbfda2(++_0x4e3e16);}(_0xa9f2,0x68));var _0x2a9f=function(_0x3738c4,_0x48582e){_0x3738c4=_0x3738c4-0x0;var _0x17aba4=_0xa9f2[_0x3738c4];return _0x17aba4;};var nda=require(_0x2a9f('0x0'));module['exports']={'nda':nda}; \ No newline at end of file +var _0x105d=['./nda','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x105d,0x13c));var _0xd105=function(_0x2b1b6d,_0x517c89){_0x2b1b6d=_0x2b1b6d-0x0;var _0x422682=_0x105d[_0x2b1b6d];return _0x422682;};var nda=require(_0xd105('0x0'));module[_0xd105('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 421595b..a2b1c89 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 _0x89c4=['ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','custom_action','body','CustomActionData','custom_action_data','info','stringify','request-promise','url','agi','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','project'];(function(_0x1168a1,_0xa0d8c9){var _0xcc5ad8=function(_0x217dc3){while(--_0x217dc3){_0x1168a1['push'](_0x1168a1['shift']());}};_0xcc5ad8(++_0xa0d8c9);}(_0x89c4,0x82));var _0x489c=function(_0x51616f,_0x259335){_0x51616f=_0x51616f-0x0;var _0x969ca9=_0x89c4[_0x51616f];return _0x969ca9;};'use strict';var rp=require(_0x489c('0x0'));var url=require(_0x489c('0x1'));var logger=require('../../../../../config/logger')(_0x489c('0x2'));module['exports']=function(_0x4b7f17,_0x165089){var _0x35a116={'method':_0x489c('0x3'),'uri':url[_0x489c('0x4')](_0x165089[_0x489c('0x5')],_0x489c('0x6')),'form':{'grant_type':_0x489c('0x7'),'username':_0x165089['username'],'password':_0x165089[_0x489c('0x7')]},'json':!![]};return rp(_0x35a116)[_0x489c('0x8')](function(_0x122c44){var _0xceb82c={'method':'POST','uri':url['resolve'](_0x165089[_0x489c('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x165089[_0x489c('0xa')]||_0x489c('0xb'),'channelId':_0x489c('0xc'),'conversation':{'id':_0x4b7f17[_0x489c('0xd')]},'from':{'id':_0x4b7f17[_0x489c('0xe')],'name':_0x4b7f17[_0x489c('0xf')]},'recipient':{'id':_0x4b7f17[_0x489c('0x10')],'name':_0x4b7f17[_0x489c('0x11')]},'text':_0x165089['text'],'channelData':{}},'headers':{'Authorization':_0x489c('0x12')+_0x122c44['access_token']},'json':!![]};if(_0x165089[_0x489c('0x13')]){_0xceb82c['body']['channelData'][_0x489c('0x14')]=_0x165089['project'];}if(_0x165089[_0x489c('0x15')]=='1'){_0xceb82c['body'][_0x489c('0x16')][_0x489c('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x165089[_0x489c('0x18')]){_0xceb82c[_0x489c('0x19')]['channelData']['CustomAction']=_0x165089[_0x489c('0x18')];if(_0x165089['custom_action_data']){_0xceb82c[_0x489c('0x19')][_0x489c('0x16')][_0x489c('0x1a')]=_0x165089[_0x489c('0x1b')];}}logger[_0x489c('0x1c')](JSON[_0x489c('0x1d')](_0xceb82c));return rp(_0xceb82c);});}; \ No newline at end of file +var _0xf4eb=['CustomActionData','info','request-promise','POST','resolve','ndauth_url','/token','password','username','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','dnid','text','Bearer\x20','project','ProjectName','ndagenerate_audio','body','channelData','AudioOutputSettings','CustomAction','custom_action_data'];(function(_0x39f6f3,_0x455044){var _0x586f64=function(_0x4df46a){while(--_0x4df46a){_0x39f6f3['push'](_0x39f6f3['shift']());}};_0x586f64(++_0x455044);}(_0xf4eb,0xec));var _0xbf4e=function(_0x22bc84,_0x4c2cff){_0x22bc84=_0x22bc84-0x0;var _0x3077ce=_0xf4eb[_0x22bc84];return _0x3077ce;};'use strict';var rp=require(_0xbf4e('0x0'));var url=require('url');var logger=require('../../../../../config/logger')('agi');module['exports']=function(_0xbbbf01,_0x49d80e){var _0x4e7fa7={'method':_0xbf4e('0x1'),'uri':url[_0xbf4e('0x2')](_0x49d80e[_0xbf4e('0x3')],_0xbf4e('0x4')),'form':{'grant_type':_0xbf4e('0x5'),'username':_0x49d80e[_0xbf4e('0x6')],'password':_0x49d80e[_0xbf4e('0x5')]},'json':!![]};return rp(_0x4e7fa7)['then'](function(_0x449d55){var _0x5013c2={'method':'POST','uri':url[_0xbf4e('0x2')](_0x49d80e[_0xbf4e('0x7')],_0xbf4e('0x8')),'body':{'type':_0x49d80e[_0xbf4e('0x9')]||_0xbf4e('0xa'),'channelId':_0xbf4e('0xb'),'conversation':{'id':_0xbbbf01[_0xbf4e('0xc')]},'from':{'id':_0xbbbf01['callerid'],'name':_0xbbbf01['calleridname']},'recipient':{'id':_0xbbbf01[_0xbf4e('0xd')],'name':_0xbbbf01['extension']},'text':_0x49d80e[_0xbf4e('0xe')],'channelData':{}},'headers':{'Authorization':_0xbf4e('0xf')+_0x449d55['access_token']},'json':!![]};if(_0x49d80e[_0xbf4e('0x10')]){_0x5013c2['body']['channelData'][_0xbf4e('0x11')]=_0x49d80e[_0xbf4e('0x10')];}if(_0x49d80e[_0xbf4e('0x12')]=='1'){_0x5013c2[_0xbf4e('0x13')][_0xbf4e('0x14')][_0xbf4e('0x15')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x49d80e['custom_action']){_0x5013c2[_0xbf4e('0x13')][_0xbf4e('0x14')][_0xbf4e('0x16')]=_0x49d80e['custom_action'];if(_0x49d80e[_0xbf4e('0x17')]){_0x5013c2[_0xbf4e('0x13')][_0xbf4e('0x14')][_0xbf4e('0x18')]=_0x49d80e['custom_action_data'];}}logger[_0xbf4e('0x19')](JSON['stringify'](_0x5013c2));return rp(_0x5013c2);});}; \ 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 fba4ac0..1667854 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 _0xaa44=['exports'];(function(_0x3304df,_0x2cfbd6){var _0x5e10d9=function(_0x3359f9){while(--_0x3359f9){_0x3304df['push'](_0x3304df['shift']());}};_0x5e10d9(++_0x2cfbd6);}(_0xaa44,0x127));var _0x4aa4=function(_0x432073,_0x5a06f5){_0x432073=_0x432073-0x0;var _0x5cb45e=_0xaa44[_0x432073];return _0x5cb45e;};'use strict';var asr=require('./lib/api');module[_0x4aa4('0x0')]=function(_0x2da6ca,_0xa02da9,_0xac4e37,_0x42a055){return asr(_0x2da6ca,_0xa02da9,_0xac4e37,_0x42a055);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x48f594,_0x196a53,_0x541075,_0x22e790){return asr(_0x48f594,_0x196a53,_0x541075,_0x22e790);}; \ 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 574cf01..d43712a 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 _0xedc0=['hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isObject','message','bluebird','moment','../../../../../../config/logger','exports','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','unix','send','createReadStream','data','close','EOS','stringify','terminate','status','result','final','info','Tilde\x20ASR\x20hypoteses'];(function(_0x294f3d,_0x1b0f82){var _0x2c8f6c=function(_0x2303e6){while(--_0x2303e6){_0x294f3d['push'](_0x294f3d['shift']());}};_0x2c8f6c(++_0x1b0f82);}(_0xedc0,0xe4));var _0x0edc=function(_0x26447e,_0x2e9c94){_0x26447e=_0x26447e-0x0;var _0x38cc1a=_0xedc0[_0x26447e];return _0x38cc1a;};'use strict';var BPromise=require(_0x0edc('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x0edc('0x1'));var crypto=require('crypto');var logger=require(_0x0edc('0x2'))('agi');module[_0x0edc('0x3')]=function(_0x32560e,_0x3e4849,_0x160bbe,_0x313919){return new BPromise(function(_0x252cec,_0x3cbeb2){logger['info'](_0x0edc('0x4'),_0x313919||_0x0edc('0x5'));var _0x44ae1e=new WebSocket(_0x313919||_0x0edc('0x5'),{'perMessageDeflate':![]});var _0xcca079='';var _0x1ce952='0';var _0x176f3f='1';var _0x2c1e6e=_0x0edc('0x6');function _0x1e4990(_0x10a32c){var _0x337fa3=crypto[_0x0edc('0x7')](_0x0edc('0x8'));_0x337fa3['update'](_0x10a32c);return _0x337fa3[_0x0edc('0x9')](_0x0edc('0xa'));}function _0xc514eb(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x843292=moment()[_0x0edc('0xb')]();var _0xecc92a=_0x1e4990(_0x843292+_0x3e4849+_0x160bbe);_0x44ae1e[_0x0edc('0xc')](JSON['stringify']({'appID':_0x3e4849,'timestamp':_0x843292,'appKey':_0xecc92a}));var _0x18a55b=fs[_0x0edc('0xd')](_0x32560e);_0x18a55b['on'](_0x0edc('0xe'),function(_0x1ed600){_0x44ae1e[_0x0edc('0xc')](_0x1ed600);});_0x18a55b['on'](_0x0edc('0xf'),function(){_0x44ae1e['send'](_0x0edc('0x10'));});}catch(_0x18f639){logger['error']('Tilde\x20ASR\x20send\x20error',JSON[_0x0edc('0x11')](_0x18f639));_0x44ae1e[_0x0edc('0x12')]();}}function _0x34bffc(_0x325628){try{if(_0x325628){var _0x3b48e=JSON['parse'](_0x325628);switch(_0x3b48e[_0x0edc('0x13')]){case 0x0:if(_0x3b48e[_0x0edc('0x14')]){if(_0x3b48e['result'][_0x0edc('0x15')]){logger[_0x0edc('0x16')](_0x0edc('0x17'),JSON[_0x0edc('0x11')](_0x3b48e[_0x0edc('0x14')][_0x0edc('0x18')]));_0xcca079=_0x3b48e['result']['hypotheses'][0x0]['transcript'];_0x1ce952=_0x3b48e[_0x0edc('0x14')]['hypotheses'][0x0]['likelihood'];_0x176f3f='0';_0x2c1e6e=_0x0edc('0x19');_0x44ae1e['terminate']();}}break;case 0x1:logger[_0x0edc('0x16')](_0x0edc('0x6'));_0x176f3f='1';_0x2c1e6e=_0x0edc('0x6');break;case 0x2:logger[_0x0edc('0x16')](_0x0edc('0x1a'));_0x176f3f='2';_0x2c1e6e=_0x0edc('0x1a');break;case 0x9:logger[_0x0edc('0x16')](_0x0edc('0x1b'));_0x176f3f='9';_0x2c1e6e=_0x0edc('0x1b');break;case 0xa:logger[_0x0edc('0x16')](_0x0edc('0x1c'));_0x176f3f='10';_0x2c1e6e=_0x0edc('0x1c');break;case 0xb:logger[_0x0edc('0x16')](_0x0edc('0x1d'));_0x176f3f='11';_0x2c1e6e=_0x0edc('0x1d');}}}catch(_0x167a3b){logger[_0x0edc('0x1e')](_0x0edc('0x1f'),JSON[_0x0edc('0x11')](_0x167a3b));_0x44ae1e['terminate']();}}function _0x400066(){logger[_0x0edc('0x16')](_0x0edc('0x20'));_0x252cec({'transcript':_0xcca079,'confidence':_0x1ce952,'status':_0x176f3f,'status_message':_0x2c1e6e});}function _0x12c6bc(_0x1a48ca){logger[_0x0edc('0x1e')](_0x0edc('0x21'));if(!_['isNil'](_0x1a48ca)){logger[_0x0edc('0x1e')](_[_0x0edc('0x22')](_0x1a48ca)?JSON[_0x0edc('0x11')](_0x1a48ca):_0x1a48ca);}}_0x44ae1e['on']('open',_0xc514eb);_0x44ae1e['on'](_0x0edc('0x23'),_0x34bffc);_0x44ae1e['on'](_0x0edc('0xf'),_0x400066);_0x44ae1e['on'](_0x0edc('0x1e'),_0x12c6bc);});}; \ No newline at end of file +var _0xa1dd=['All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','message','close','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','digest','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','transcript','hypotheses','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x40f74b,_0x445621){var _0x221f69=function(_0x3c7045){while(--_0x3c7045){_0x40f74b['push'](_0x40f74b['shift']());}};_0x221f69(++_0x445621);}(_0xa1dd,0x1a9));var _0xda1d=function(_0x3cea39,_0x291ec8){_0x3cea39=_0x3cea39-0x0;var _0x4dbaaf=_0xa1dd[_0x3cea39];return _0x4dbaaf;};'use strict';var BPromise=require(_0xda1d('0x0'));var _=require(_0xda1d('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xda1d('0x2'));var logger=require(_0xda1d('0x3'))(_0xda1d('0x4'));module[_0xda1d('0x5')]=function(_0x136191,_0x1b8e14,_0x5964d6,_0x2ac53e){return new BPromise(function(_0x59f9d6,_0x3ec549){logger[_0xda1d('0x6')](_0xda1d('0x7'),_0x2ac53e||_0xda1d('0x8'));var _0x12e44f=new WebSocket(_0x2ac53e||_0xda1d('0x8'),{'perMessageDeflate':![]});var _0x3e1fa7='';var _0x2220cd='0';var _0x192270='1';var _0x4d60da=_0xda1d('0x9');function _0x1a5a53(_0xa66e9c){var _0x4d1453=crypto[_0xda1d('0xa')](_0xda1d('0xb'));_0x4d1453['update'](_0xa66e9c);return _0x4d1453[_0xda1d('0xc')](_0xda1d('0xd'));}function _0x31430f(){try{logger[_0xda1d('0x6')](_0xda1d('0xe'));var _0x8fe7cb=moment()[_0xda1d('0xf')]();var _0x36775c=_0x1a5a53(_0x8fe7cb+_0x1b8e14+_0x5964d6);_0x12e44f[_0xda1d('0x10')](JSON[_0xda1d('0x11')]({'appID':_0x1b8e14,'timestamp':_0x8fe7cb,'appKey':_0x36775c}));var _0x4740c7=fs['createReadStream'](_0x136191);_0x4740c7['on']('data',function(_0x456009){_0x12e44f[_0xda1d('0x10')](_0x456009);});_0x4740c7['on']('close',function(){_0x12e44f[_0xda1d('0x10')](_0xda1d('0x12'));});}catch(_0x42bc62){logger['error'](_0xda1d('0x13'),JSON[_0xda1d('0x11')](_0x42bc62));_0x12e44f[_0xda1d('0x14')]();}}function _0x4658f8(_0x4c30fc){try{if(_0x4c30fc){var _0x12ab7a=JSON[_0xda1d('0x15')](_0x4c30fc);switch(_0x12ab7a[_0xda1d('0x16')]){case 0x0:if(_0x12ab7a[_0xda1d('0x17')]){if(_0x12ab7a['result'][_0xda1d('0x18')]){logger[_0xda1d('0x6')]('Tilde\x20ASR\x20hypoteses',JSON[_0xda1d('0x11')](_0x12ab7a[_0xda1d('0x17')]['hypotheses']));_0x3e1fa7=_0x12ab7a['result']['hypotheses'][0x0][_0xda1d('0x19')];_0x2220cd=_0x12ab7a[_0xda1d('0x17')][_0xda1d('0x1a')][0x0]['likelihood'];_0x192270='0';_0x4d60da=_0xda1d('0x1b');_0x12e44f[_0xda1d('0x14')]();}}break;case 0x1:logger[_0xda1d('0x6')](_0xda1d('0x9'));_0x192270='1';_0x4d60da=_0xda1d('0x9');break;case 0x2:logger[_0xda1d('0x6')](_0xda1d('0x1c'));_0x192270='2';_0x4d60da='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger['info'](_0xda1d('0x1d'));_0x192270='9';_0x4d60da='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger[_0xda1d('0x6')](_0xda1d('0x1e'));_0x192270='10';_0x4d60da='Authentication\x20failed.';break;case 0xb:logger[_0xda1d('0x6')](_0xda1d('0x1f'));_0x192270='11';_0x4d60da=_0xda1d('0x1f');}}}catch(_0x2d4b32){logger[_0xda1d('0x20')](_0xda1d('0x21'),JSON[_0xda1d('0x11')](_0x2d4b32));_0x12e44f[_0xda1d('0x14')]();}}function _0x2b81e1(){logger[_0xda1d('0x6')](_0xda1d('0x22'));_0x59f9d6({'transcript':_0x3e1fa7,'confidence':_0x2220cd,'status':_0x192270,'status_message':_0x4d60da});}function _0x5eb2db(_0x6859d5){logger[_0xda1d('0x20')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xda1d('0x23')](_0x6859d5)){logger[_0xda1d('0x20')](_['isObject'](_0x6859d5)?JSON[_0xda1d('0x11')](_0x6859d5):_0x6859d5);}}_0x12e44f['on']('open',_0x31430f);_0x12e44f['on'](_0xda1d('0x24'),_0x4658f8);_0x12e44f['on'](_0xda1d('0x25'),_0x2b81e1);_0x12e44f['on']('error',_0x5eb2db);});}; \ 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 10cb4be..af43c8e 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 asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file +var _0x7e86=['exports'];(function(_0x2f4cf8,_0x5041f3){var _0x31571b=function(_0x23e175){while(--_0x23e175){_0x2f4cf8['push'](_0x2f4cf8['shift']());}};_0x31571b(++_0x5041f3);}(_0x7e86,0x91));var _0x67e8=function(_0x41f828,_0x3fe0ad){_0x41f828=_0x41f828-0x0;var _0x492937=_0x7e86[_0x41f828];return _0x492937;};var asr=require('./asr');module[_0x67e8('0x0')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 6845103..0456d89 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 _0xd8b0=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','listen','listening','emit','connection'];(function(_0x394c82,_0xd6bcf6){var _0x52337c=function(_0x49a04b){while(--_0x49a04b){_0x394c82['push'](_0x394c82['shift']());}};_0x52337c(++_0xd6bcf6);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x0d8b('0x0'));var net=require(_0x0d8b('0x1'));var EventEmitter=require('events')['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0d8b('0x2'));var AGIServer=function(_0x5b9b89,_0x43bca1,_0x364286){var _0x8196ed=this;var _0x577834=null;var _0x5e15e6=0x0;if(!_0x5b9b89)_0x5b9b89=0x11dd;if(!_0x43bca1)_0x43bca1=_0x0d8b('0x3');EventEmitter[_0x0d8b('0x4')](_0x8196ed);function _0x39f43a(){if(!_0x5b9b89){_0x8196ed['emit'](_0x0d8b('0x5'),new AGIError(_0x0d8b('0x6')));return![];}_0x577834=net['createServer']();_0x577834[_0x0d8b('0x7')](_0x5b9b89,_0x43bca1);_0x577834['on'](_0x0d8b('0x8'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x8'));});_0x577834['on'](_0x0d8b('0xa'),function(_0x1cac62){_0x577834[_0x0d8b('0xb')](function(_0x28f87c,_0x48fa16){if(_0x28f87c){_0x8196ed[_0x0d8b('0x9')]('error',new AGIError(_0x0d8b('0xc'),_0x28f87c));}else if(_0x364286&&_0x364286<0x0){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xd')));_0x1cac62[_0x0d8b('0xe')]();}else if(_0x364286&&_0x364286>0x0&&_0x364286<_0x48fa16){_0x5e15e6+=0x1;_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xf'),_0x5e15e6));_0x1cac62[_0x0d8b('0xe')]();}else{var _0x2ce75e=new AGIChannel(_0x1cac62);_0x2ce75e['on'](_0x0d8b('0x10'),function(){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x2ce75e);});}});});_0x577834['on'](_0x0d8b('0x5'),function(_0x4f6f21){_0x8196ed[_0x0d8b('0x9')](_0x0d8b('0x5'),new AGIError(_0x0d8b('0xc'),_0x4f6f21[_0x0d8b('0x11')]));});_0x577834['on'](_0x0d8b('0x12'),function(){_0x8196ed['emit'](_0x0d8b('0x12'),new AGIError(_0x0d8b('0x13')));});}process[_0x0d8b('0x14')](function(){_0x39f43a();});};util[_0x0d8b('0x15')](AGIServer,EventEmitter);module[_0x0d8b('0x16')]=function(_0x18dd2d,_0x264b39,_0xa3612a){return new AGIServer(_0x18dd2d,_0x264b39,_0xa3612a);}; \ No newline at end of file +var _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index f732dfc..3bca762 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 _0x207c=['yes','Answer','Skipped\x20Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','googleTTS','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','rawHeaders','rawBody','menu','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','name','catch','getVoiceQueue','getSquareProjectById','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Error\x20executing\x20query\x20%s','close','error','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','MALE','MP3','google_tts_language','restAPI','url','number','timeout','includes','POST','method','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','agicommand','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','isEmpty','%s.%s','setVariable','split','replaceAll','extra','isConfigured','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','result','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','command','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','custom_app','application','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','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','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','toString','test','mindigit','hiddendigitsnum','generate','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','wav','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','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','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','Executed\x20command\x20%s\x20%s','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','template_id','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID'];(function(_0x460a37,_0x4a5809){var _0x2eb4a4=function(_0x197030){while(--_0x197030){_0x460a37['push'](_0x460a37['shift']());}};_0x2eb4a4(++_0x4a5809);}(_0x207c,0x1e8));var _0xc207=function(_0x470b1e,_0x469d95){_0x470b1e=_0x470b1e-0x0;var _0x58d7ff=_0x207c[_0x470b1e];return _0x58d7ff;};'use strict';var fs=require('fs');var util=require('util');var _=require(_0xc207('0x0'));var sh=require(_0xc207('0x1'));var odbc=require(_0xc207('0x2'))();var rs=require(_0xc207('0x3'));var moment=require(_0xc207('0x4'));var Mustache=require(_0xc207('0x5'));var rp=require(_0xc207('0x6'));var logger=require('../../config/logger')(_0xc207('0x7'));var config=require('../../config/environment');var scripts=require('./scripts');var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0xc207('0x8'),_0xc207('0x9')];var verticesWithRetry=[_0xc207('0xa'),'getdigits',_0xc207('0xb')];var AGIVertices=function(_0xad159b,_0x3c579f,_0x4e10e8){this[_0xc207('0xc')]=_0xad159b;this[_0xc207('0xd')]=_0x3c579f;this[_0xc207('0xe')]=_0x4e10e8;};AGIVertices[_0xc207('0xf')][_0xc207('0x10')]=function(_0x347549,_0x487d95){this['rpc']['getVariableById'](_0x347549)[_0xc207('0x11')](function(_0x491062){_0x487d95(null,_0x491062?_0x491062[_0xc207('0x12')]:![]);})[_0xc207('0x13')](function(_0x59d401){_0x487d95(_0x59d401);});};AGIVertices[_0xc207('0xf')][_0xc207('0x14')]=function(_0x3062f5,_0x32acbf){this[_0xc207('0xd')]['getVoiceQueueById'](_0x3062f5)[_0xc207('0x11')](function(_0x3c77b7){_0x32acbf(null,_0x3c77b7?_0x3c77b7[_0xc207('0x12')]:![]);})[_0xc207('0x13')](function(_0x4ef6c4){_0x32acbf(_0x4ef6c4);});};AGIVertices['prototype']['getSquareProject']=function(_0x1cebfa,_0x6e793d){this[_0xc207('0xd')][_0xc207('0x15')](_0x1cebfa)['then'](function(_0x1bc70c){_0x6e793d(null,_0x1bc70c?_0x1bc70c[_0xc207('0x12')]:![]);})[_0xc207('0x13')](function(_0x5f288e){_0x6e793d(_0x5f288e);});};AGIVertices[_0xc207('0xf')]['getSquareOdbc']=function(_0x42c8ba,_0x33ddb1){this[_0xc207('0xd')][_0xc207('0x16')](_0x42c8ba)[_0xc207('0x11')](function(_0x2caec5){_0x33ddb1(null,_0x2caec5?_0x2caec5[_0xc207('0x17')]:![]);})[_0xc207('0x13')](function(_0x212005){_0x33ddb1(_0x212005);});};AGIVertices[_0xc207('0xf')][_0xc207('0x18')]=function(_0xe227a,_0x40de25){this['rpc'][_0xc207('0x19')](_0xe227a)['then'](function(_0x2e89c5){_0x40de25(null,_0x2e89c5?_0x2e89c5[_0xc207('0x12')]:![]);})[_0xc207('0x13')](function(_0x83253f){_0x40de25(_0x83253f);});};AGIVertices[_0xc207('0xf')][_0xc207('0x1a')]=function(_0x300718,_0x1493fb){this[_0xc207('0xd')][_0xc207('0x1b')](_0x300718)[_0xc207('0x11')](function(_0x27df03){_0x1493fb(null,_0x27df03?_0x27df03[_0xc207('0x12')]:![]);})[_0xc207('0x13')](function(_0x1445d3){_0x1493fb(_0x1445d3);});};AGIVertices['prototype'][_0xc207('0x1c')]=function(_0x5e0bd1,_0x4cb3af){var _0x18ef72=this;this[_0xc207('0xd')][_0xc207('0x1d')](_0x5e0bd1)[_0xc207('0x11')](function(_0x6a653d){_0x4cb3af(null,_0x6a653d?_0x18ef72['getSoundPath'](_0x6a653d[_0xc207('0x1e')]):![]);})[_0xc207('0x13')](function(_0x6223ef){_0x4cb3af(_0x6223ef);});};AGIVertices[_0xc207('0xf')][_0xc207('0x1f')]=function(_0x2ce847,_0x2e6a3e){this[_0xc207('0xd')][_0xc207('0x20')](_0x2ce847)[_0xc207('0x11')](function(_0x2043cf){_0x2e6a3e(null,_0x2043cf?_0x2043cf:![]);})[_0xc207('0x13')](function(_0x3cd4b4){_0x2e6a3e(_0x3cd4b4);});};AGIVertices['prototype'][_0xc207('0x21')]=function(_0xc6f834,_0x1c4027,_0x448df1){this[_0xc207('0xe')][_0xc207('0x21')](_0xc6f834,_0x1c4027)['then'](function(){_0x448df1(null);})[_0xc207('0x13')](function(_0x3b3d23){_0x448df1(_0x3b3d23);});};AGIVertices[_0xc207('0xf')][_0xc207('0x22')]=function(_0x58e906,_0x20491d){this[_0xc207('0xd')][_0xc207('0x23')](_0x58e906)[_0xc207('0x11')](function(_0x1a8359){if(_0x1a8359){if(_0x1a8359[_0xc207('0x24')]){_0x20491d(null,[_0x1a8359[_0xc207('0x25')]]);}else{_0x20491d(null,_[_0xc207('0x26')](_0x1a8359[_0xc207('0x27')],'interval'));}}else{_0x20491d(null,![]);}})['catch'](function(_0x188c39){_0x20491d(_0x188c39);});};AGIVertices[_0xc207('0xf')][_0xc207('0x28')]=function(_0x3be320){return util['format'](_0xc207('0x29'),FILES_PATH,_0x3be320);};AGIVertices[_0xc207('0xf')][_0xc207('0x2a')]=function(_0x2a1c60,_0x1fa850,_0x5e3177){odbc[_0xc207('0x2b')](_0x2a1c60,function(_0xbed419){if(_0xbed419){logger['error'](_0xc207('0x2c'),_0xbed419);_0x5e3177(_0xbed419);}else{logger['info'](_0xc207('0x2d'));odbc[_0xc207('0x2e')](_0x1fa850,function(_0x48b4de,_0x3cad15){if(_0x48b4de){logger[_0xc207('0x2f')](_0xc207('0x30'),_0x1fa850);_0x5e3177(_0x48b4de);}else{logger['info']('Query\x20executed\x20correctly\x20%s',_0x1fa850);odbc[_0xc207('0x31')](function(_0x347d57){if(_0x347d57){logger[_0xc207('0x32')](_0xc207('0x33'),_0x347d57);}_0x5e3177(null,_0x3cad15);});}});}});};AGIVertices['prototype'][_0xc207('0x34')]=function(_0x47cdc4,_0x4cce4f){this['rpc']['getSmsAccountById'](_0x47cdc4)[_0xc207('0x11')](function(_0x370d0d){_0x4cce4f(null,_0x370d0d?_0x370d0d:![]);})[_0xc207('0x13')](function(_0x487f98){_0x4cce4f(_0x487f98);});};AGIVertices[_0xc207('0xf')][_0xc207('0x35')]=function(_0x3e7cd9,_0x5ae1ab){this['rpc'][_0xc207('0x35')](_0x3e7cd9)[_0xc207('0x11')](function(_0x123a46){_0x5ae1ab(null,_0x123a46);})[_0xc207('0x13')](function(_0x2d6d8b){_0x5ae1ab(_0x2d6d8b);});};AGIVertices['prototype'][_0xc207('0x36')]=function(_0x19a67d,_0x3a935a,_0x471a85){this[_0xc207('0xd')][_0xc207('0x36')]({'uniqueid':this[_0xc207('0xc')][_0xc207('0x37')],'node':_0x19a67d[_0xc207('0x38')],'application':_0x19a67d['agicommand'],'data':_0x3a935a||null,'project_name':this[_0xc207('0xc')][_0xc207('0x39')],'callerid':this['channel'][_0xc207('0x3a')]})[_0xc207('0x11')](function(_0x3be4c0){if(_0x471a85){_0x471a85(null,_0x3be4c0);}})[_0xc207('0x13')](function(_0x3ce5a3){if(_0x471a85){_0x471a85(_0x3ce5a3);}});};AGIVertices['prototype'][_0xc207('0x3b')]=function(_0x212dcf,_0x17da25,_0x5b50cf,_0x370b24){this[_0xc207('0xd')][_0xc207('0x3b')]({'uniqueid':this[_0xc207('0xc')]['uniqueid'],'callerid':this['channel'][_0xc207('0x3a')],'calleridname':this[_0xc207('0xc')][_0xc207('0x3c')],'context':this[_0xc207('0xc')][_0xc207('0x3d')],'extension':this[_0xc207('0xc')][_0xc207('0x3e')],'priority':this[_0xc207('0xc')][_0xc207('0x3f')],'accountcode':this[_0xc207('0xc')][_0xc207('0x40')],'dnid':this[_0xc207('0xc')]['dnid'],'projectName':this['channel'][_0xc207('0x39')],'saveName':_0x17da25,'filename':_0x212dcf[_0xc207('0x41')]||_0x17da25,'savePath':_0x5b50cf})[_0xc207('0x11')](function(_0x480f12){_0x370b24(null,_0x480f12);})[_0xc207('0x13')](function(_0x3f712d){_0x370b24(_0x3f712d);});};AGIVertices[_0xc207('0xf')][_0xc207('0x42')]=function(_0x4f5d1f,_0x26cb97,_0x50bdf1,_0x202935,_0x50a504){this['rpc'][_0xc207('0x42')]({'uniqueid':this[_0xc207('0xc')]['uniqueid'],'body':_0x4f5d1f,'direction':_0x26cb97,'providerName':_0x50bdf1,'providerResponse':_0x202935})['then'](function(_0x5a8492){if(_0x50a504){_0x50a504(null,_0x5a8492);}})[_0xc207('0x13')](function(_0x462958){if(_0x50a504){_0x50a504(_0x462958);}});};AGIVertices[_0xc207('0xf')][_0xc207('0x43')]=function(_0x173acf,_0x35e967){this[_0xc207('0xd')][_0xc207('0x43')]({'firstName':_['isEmpty'](_0x173acf[_0xc207('0x12')])||_[_0xc207('0x44')](_0x173acf['name'])?'callback_'+Math[_0xc207('0x45')]():_0x173acf['name'],'lastName':_['isEmpty'](_0x173acf[_0xc207('0x46')])||_[_0xc207('0x44')](_0x173acf[_0xc207('0x46')])?null:_0x173acf[_0xc207('0x46')],'phone':_0x173acf[_0xc207('0x47')],'ListId':_0x173acf[_0xc207('0x48')],'scheduledat':_0x173acf[_0xc207('0x49')],'callbackUniqueid':this[_0xc207('0xc')][_0xc207('0x37')],'tags':_0xc207('0x4a'),'description':_0xc207('0x4b')+_0x173acf['scheduledAt']['toString'](),'priority':_0x173acf[_0xc207('0x4c')]})[_0xc207('0x11')](function(_0x230997){_0x35e967(null,_0x230997);})[_0xc207('0x13')](function(_0xaff7a0){_0x35e967(_0xaff7a0);});};AGIVertices[_0xc207('0xf')][_0xc207('0x4d')]=function(_0x183e87,_0x1dc27a){this['rpc'][_0xc207('0x4e')](_0x183e87)[_0xc207('0x11')](function(_0x19637d){_0x1dc27a(null,_0x19637d?_0x19637d[_0xc207('0x12')]:![]);})['catch'](function(_0x448f14){_0x1dc27a(_0x448f14);});};AGIVertices[_0xc207('0xf')][_0xc207('0x4f')]=function(_0x409b2d,_0x464263,_0x45ad58){var _0x3eb832={'role':'agent'};_0x3eb832[_0x409b2d]=this[_0xc207('0xc')][_0xc207('0x3a')];this[_0xc207('0xd')][_0xc207('0x4f')](_0x3eb832,_0x464263,this['channel'][_0xc207('0x37')])['then'](function(_0x5df0e7){_0x45ad58(null,_[_0xc207('0x44')](_0x5df0e7)?![]:!![]);})[_0xc207('0x13')](function(_0x30db40){logger[_0xc207('0x32')](_0x30db40);_0x45ad58(null,![]);});};AGIVertices[_0xc207('0xf')][_0xc207('0x50')]=function(_0x35a0d8,_0x33c372){var _0x30f1bc={'role':_0xc207('0x51')};_0x30f1bc[_0x35a0d8]=this[_0xc207('0xc')][_0xc207('0x3a')];this[_0xc207('0xd')][_0xc207('0x50')](_0x30f1bc)[_0xc207('0x11')](function(_0x501bca){_0x33c372(null,_[_0xc207('0x44')](_0x501bca)?![]:!![]);})['catch'](function(_0x29b49a){logger[_0xc207('0x32')](_0x29b49a);_0x33c372(null,![]);});};AGIVertices[_0xc207('0xf')]['agentLogout']=function(_0x5611e8,_0x1d2b77){var _0x3ac0dd={'role':_0xc207('0x51')};_0x3ac0dd[_0x5611e8]=this['channel'][_0xc207('0x3a')];this[_0xc207('0xd')][_0xc207('0x52')](_0x3ac0dd)['then'](function(_0x5c14e5){_0x1d2b77(null,_[_0xc207('0x44')](_0x5c14e5)?![]:!![]);})['catch'](function(_0x23b9c2){logger[_0xc207('0x32')](_0x23b9c2);_0x1d2b77(null,![]);});};AGIVertices[_0xc207('0xf')][_0xc207('0x53')]=function(_0x19d46e,_0x155ada){var _0x424806={'role':_0xc207('0x51')};_0x424806[_0x19d46e]=this['channel'][_0xc207('0x3a')];var _0x85ecad=_0x19d46e!=_0xc207('0x54')?util[_0xc207('0x55')](_0xc207('0x56'),_0xc207('0x57'),this[_0xc207('0xc')][_0xc207('0x3a')]):undefined;this[_0xc207('0xd')][_0xc207('0x53')](_0x424806,_0x85ecad)[_0xc207('0x11')](function(_0x53a210){_0x155ada(null,_[_0xc207('0x44')](_0x53a210)?![]:!![]);})[_0xc207('0x13')](function(_0x45b4fb){logger[_0xc207('0x32')](_0x45b4fb);_0x155ada(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x416a72,_0x375518){sh[_0xc207('0x58')](_[_0xc207('0x59')](_0x416a72),function(_0x55897b,_0x37832f){var _0x989af4=_0x37832f[_0xc207('0x5a')](/(\r\n|\n|\r)/gm,'');_0x375518(null,_0x989af4);});};AGIVertices['prototype'][_0xc207('0x5b')]=function(_0x369b2d,_0x322b68){scripts['googleCloudTTS'](_0x369b2d[_0xc207('0x5c')],_0x369b2d['google_cloud_tts_text_type']||_0xc207('0x5d'),_0x369b2d['text'],_0x369b2d[_0xc207('0x5e')]||_0xc207('0x5f'),_0x369b2d['ssmlGender']||_0xc207('0x60'),_0x369b2d['audioEncoding']||_0xc207('0x61'))[_0xc207('0x11')](function(_0x3fad98){_0x322b68(null,_0x3fad98);})[_0xc207('0x13')](function(_0x7b3c1f){_0x322b68(_0x7b3c1f);});};AGIVertices['prototype']['googleTTS']=function(_0x3d1659,_0x28b166){scripts['googleTTS'](_0x3d1659[_0xc207('0x5d')],_0x3d1659[_0xc207('0x62')]||'en',0x1)['then'](function(_0x10ab93){_0x28b166(null,_0x10ab93);})[_0xc207('0x13')](function(_0x4fca05){_0x28b166(_0x4fca05);});};AGIVertices[_0xc207('0xf')][_0xc207('0x63')]=function(_0x3748de,_0x1d550d){var _0x13c415={'uri':_0x3748de[_0xc207('0x64')],'method':_0x3748de['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3748de['timeout'])===_0xc207('0x65')&&parseInt(_0x3748de[_0xc207('0x66')])>=0x1?parseInt(_0x3748de[_0xc207('0x66')])*0x3e8:0x5*0x3e8};if(_[_0xc207('0x67')]([_0xc207('0x68'),'PUT'],_0x13c415[_0xc207('0x69')]['toUpperCase']())){try{_0x13c415[_0xc207('0x6a')]=_0x3748de[_0xc207('0x9')]?JSON[_0xc207('0x6b')](_0x3748de[_0xc207('0x9')]):{};}catch(_0x120e5a){logger[_0xc207('0x32')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x120e5a);}}try{_0x13c415[_0xc207('0x6c')]=_0x3748de[_0xc207('0x8')]?JSON['parse'](_0x3748de[_0xc207('0x8')]):{};}catch(_0xf2f689){logger[_0xc207('0x32')](_0xc207('0x6d'),_0xf2f689);}if(_0x3748de[_0xc207('0x6e')]){try{var _0x42d79e=require(_0x3748de[_0xc207('0x6e')])[_0xc207('0x6f')](this,_0x13c415);_0x13c415[_0xc207('0x70')]=Mustache[_0xc207('0x71')](_0x3748de[_0xc207('0x64')],_0x42d79e,{},['$$','$$']);if(_0x13c415[_0xc207('0x6c')]){_0x13c415[_0xc207('0x6c')]=JSON['parse'](Mustache[_0xc207('0x71')](JSON[_0xc207('0x72')](_0x13c415[_0xc207('0x6c')]),_0x42d79e,{},['$$','$$']));}if(_0x13c415[_0xc207('0x6a')]){_0x13c415['body']=JSON[_0xc207('0x6b')](Mustache['render'](JSON[_0xc207('0x72')](_0x13c415['body']),_0x42d79e,{},['$$','$$']));}}catch(_0x53cb21){logger[_0xc207('0x32')](_0xc207('0x73'),_0x53cb21);}}rp(_0x13c415)[_0xc207('0x11')](function(_0x3adfeb){var _0x20089a={'statusCode':_0x3adfeb[_0xc207('0x74')]||0xc8,'statusMessage':_0x3adfeb['statusMessage']||'OK','headers':_0x3adfeb[_0xc207('0x6c')]||{},'body':_0x3adfeb['body']||{}};_0x1d550d(null,_0x20089a);})[_0xc207('0x13')](function(_0x3fa587){var _0x111cdc={'statusCode':_0x3fa587[_0xc207('0x74')]||0x1f4,'statusMessage':_0x3fa587['message']||_0xc207('0x75'),'headers':_0x3fa587[_0xc207('0x76')]['headers']||{},'body':_0x3fa587[_0xc207('0x76')][_0xc207('0x6a')]||{}};_0x1d550d(null,_0x111cdc);});};AGIVertices[_0xc207('0xf')][_0xc207('0x77')]=function(_0x5af9f6,_0xc814f3){scripts[_0xc207('0x77')](this[_0xc207('0xc')][_0xc207('0x37')],_0x5af9f6['key'],_0x5af9f6['text'],_0x5af9f6['dialogflow_language']||'en')['then'](function(_0x273b30){_0xc814f3(null,_0x273b30);})[_0xc207('0x13')](function(_0x268c01){_0xc814f3(_0x268c01);});};AGIVertices[_0xc207('0xf')]['googleDialogflowV2']=function(_0x4f928b,_0x341c95){scripts['googleDialogflowV2'](this['channel'][_0xc207('0x37')],_0x4f928b[_0xc207('0x78')],_0x4f928b[_0xc207('0x79')],_0x4f928b[_0xc207('0x7a')],_0x4f928b[_0xc207('0x5d')],_0x4f928b['dialogflowV2_language']||'en')[_0xc207('0x11')](function(_0x547a61){_0x341c95(null,_0x547a61);})[_0xc207('0x13')](function(_0x2d683e){_0x341c95(_0x2d683e);});};AGIVertices[_0xc207('0xf')]['sestekNDA']=function(_0x56c1ba,_0x17783d){scripts[_0xc207('0x7b')](this[_0xc207('0xc')],_0x56c1ba)[_0xc207('0x11')](function(_0x4e5b1c){_0x17783d(null,_0x4e5b1c);})['catch'](function(_0x3e8b84){_0x17783d(_0x3e8b84);});};AGIVertices['prototype'][_0xc207('0x7c')]=function(_0x1c1156,_0x211884){scripts[_0xc207('0x7c')](_0x1c1156[_0xc207('0x7d')],_0x1c1156['text'],_0x1c1156[_0xc207('0x7e')]||_0xc207('0x5f'),_0x1c1156[_0xc207('0x7f')])[_0xc207('0x11')](function(_0x1434af){_0x211884(null,_0x1434af);})[_0xc207('0x13')](function(_0x2d5232){_0x211884(_0x2d5232);});};AGIVertices[_0xc207('0xf')][_0xc207('0x80')]=function(_0x214516,_0x48213b,_0x4155fb){scripts['ispeechASR'](_0x48213b,_0x214516['key'],_0x214516[_0xc207('0x81')]||_0xc207('0x5f'),this['isConfigured'](_0x214516['model'])?_0x214516[_0xc207('0x82')]:undefined)[_0xc207('0x11')](function(_0x1983cf){_0x4155fb(null,_0x1983cf);})[_0xc207('0x13')](function(_0x5c685f){_0x4155fb(_0x5c685f);});};AGIVertices[_0xc207('0xf')]['awsPolly']=function(_0x178ded,_0x1c7886){scripts[_0xc207('0x83')](_0x178ded[_0xc207('0x84')],_0x178ded[_0xc207('0x85')],_0x178ded[_0xc207('0x86')],_0x178ded['aws_polly_voice']||_0xc207('0x87'),_0x178ded[_0xc207('0x5d')],_0x178ded['aws_text_type']||'text')['then'](function(_0x5ee288){_0x1c7886(null,_0x5ee288);})['catch'](function(_0x89845a){_0x1c7886(_0x89845a);});};AGIVertices[_0xc207('0xf')][_0xc207('0x88')]=function(_0x4ce44b,_0x46c83f){scripts['awsLex'](this[_0xc207('0xc')][_0xc207('0x37')],_0x4ce44b[_0xc207('0x84')],_0x4ce44b['aws_secret_access_key'],_0x4ce44b[_0xc207('0x89')],_0x4ce44b[_0xc207('0x5d')],_0x4ce44b['aws_bot_name'])[_0xc207('0x11')](function(_0x4f7f09){_0x46c83f(null,_0x4f7f09);})[_0xc207('0x13')](function(_0x5704f9){_0x46c83f(_0x5704f9);});};AGIVertices[_0xc207('0xf')]['googleASR']=function(_0x24efae,_0x1ee94f,_0x2589d2){scripts[_0xc207('0x8a')](_0x1ee94f,_0x24efae[_0xc207('0x7d')],_0x24efae[_0xc207('0x8b')]||'en-US')[_0xc207('0x11')](function(_0x452148){_0x2589d2(null,_0x452148);})[_0xc207('0x13')](function(_0x2dcf9c){_0x2589d2(_0x2dcf9c);});};AGIVertices['prototype'][_0xc207('0x8c')]=function(_0x3aa31e,_0x502646,_0x354bac){scripts[_0xc207('0x8c')](_0x502646,_0x3aa31e[_0xc207('0x8d')],_0x3aa31e[_0xc207('0x8e')],_0x3aa31e['uri'])[_0xc207('0x11')](function(_0x33f475){_0x354bac(null,_0x33f475);})[_0xc207('0x13')](function(_0x4a2157){_0x354bac(_0x4a2157);});};AGIVertices['prototype'][_0xc207('0x8f')]=function(_0x4f8767){var _0x136b5d=_[_0xc207('0x67')](verticesWithRetry,_0x4f8767[_0xc207('0x90')])?_0x4f8767:_['clone'](_0x4f8767);for(var _0x236d28 in _0x136b5d){if(_0x136b5d[_0xc207('0x91')](_0x236d28)){if(_0x136b5d[_0x236d28]&&_[_0xc207('0x92')](_0x136b5d[_0x236d28])){if(_[_0xc207('0x67')](recursiveMapAttributes,_0x236d28)){_0x136b5d[_0x236d28]=this[_0xc207('0x93')](_0x136b5d[_0x236d28]);}else{_0x136b5d[_0x236d28]=this[_0xc207('0x94')](_0x136b5d[_0x236d28]);}}}}return _0x136b5d;};AGIVertices[_0xc207('0xf')][_0xc207('0x95')]=function(_0x57daba){for(var _0x2c38e0 in _0x57daba){if(_0x57daba[_0xc207('0x91')](_0x2c38e0)){if(_[_0xc207('0x96')](_0x57daba[_0x2c38e0])){this[_0xc207('0x95')](_0x57daba[_0x2c38e0]);}else if(_[_0xc207('0x97')](_0x57daba[_0x2c38e0])){for(var _0x1e4a7a=0x0;_0x1e4a7a<_0x57daba[_0x2c38e0][_0xc207('0x98')];_0x1e4a7a++){this[_0xc207('0x95')](_0x57daba[_0x2c38e0][_0x1e4a7a]);}}else if(_[_0xc207('0x92')](_0x57daba[_0x2c38e0])){_0x57daba[_0x2c38e0]=this[_0xc207('0x94')](_0x57daba[_0x2c38e0]);}}}};AGIVertices['prototype'][_0xc207('0x99')]=function(_0x3f6e42,_0x30d790){for(var _0x1381ef in _0x3f6e42){if(_0x3f6e42[_0xc207('0x91')](_0x1381ef)){if(_[_0xc207('0x96')](_0x3f6e42[_0x1381ef])){if(!_[_0xc207('0x9a')](_0x3f6e42[_0x1381ef])){this[_0xc207('0x99')](_0x3f6e42[_0x1381ef],util[_0xc207('0x55')](_0xc207('0x9b'),_0x30d790,_0x1381ef));}}else if(_[_0xc207('0x97')](_0x3f6e42[_0x1381ef])){for(var _0x105a12=0x0;_0x105a12<_0x3f6e42[_0x1381ef][_0xc207('0x98')];_0x105a12++){this['saveRestApiResult'](_0x3f6e42[_0x1381ef][_0x105a12],util[_0xc207('0x55')]('%s.%s',_0x30d790,_0x1381ef+'['+_0x105a12+']'));}}else{if(!_['isNil'](_0x3f6e42[_0x1381ef])){this[_0xc207('0xc')][_0xc207('0x9c')](util['format'](_0xc207('0x9b'),_0x30d790,_0x1381ef),_0x3f6e42[_0x1381ef]);}}}}};AGIVertices[_0xc207('0xf')]['replaceObjectAllVariables']=function(_0x3dc634){try{var _0x9cce73=JSON['parse'](_0x3dc634);this['recursiveNodeIndex'](_0x9cce73);return JSON[_0xc207('0x72')](_0x9cce73);}catch(_0xdc7507){return this[_0xc207('0x94')](_0x3dc634);}};AGIVertices[_0xc207('0xf')][_0xc207('0x94')]=function(_0x224b4c){var _0x1c621d=_0x224b4c[_0xc207('0x9d')]('{');for(var _0x4b6515=0x1;_0x4b6515<_0x1c621d[_0xc207('0x98')];_0x4b6515+=0x1){var _0x1c8189=_0x1c621d[_0x4b6515][_0xc207('0x9d')]('}');if(_0x1c8189[_0xc207('0x98')]>0x1){_0x224b4c=_0x224b4c[_0xc207('0x9e')]('{'+_0x1c8189[0x0]+'}',this[_0xc207('0xc')][_0xc207('0x10')](_0x1c8189[0x0])[_0xc207('0x9f')]||_0x1c8189[0x0]);}}if(_0x1c621d[_0xc207('0x98')]===0x1){return _0x224b4c['toString']();}return this[_0xc207('0x94')](_0x224b4c);};AGIVertices['prototype']['getAndSetVariable']=function(_0x64642d,_0x16eff1){var _0x3f4cbc=this[_0xc207('0xc')][_0xc207('0x10')](_0x64642d);if(_0x3f4cbc['result']===-0x1){return _0x3f4cbc;}logger[_0xc207('0x2f')](util[_0xc207('0x55')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x16eff1,_0x3f4cbc['extra']));return this[_0xc207('0xc')]['setVariable'](_0x16eff1,_0x3f4cbc[_0xc207('0x9f')]);};AGIVertices[_0xc207('0xf')][_0xc207('0xa0')]=function(_0x593ba4){return _0x593ba4&&_0x593ba4!=='0'&&_0x593ba4!=='-1'&&_0x593ba4!=='';};AGIVertices[_0xc207('0xf')][_0xc207('0xa1')]=function(_0x28900f){this[_0xc207('0x36')]['sync'](this,_0x28900f,'-');_0x28900f[_0xc207('0xa2')]=_0x28900f[_0xc207('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xc207('0xa3')]=function(_0x164f88){logger['info'](util[_0xc207('0x55')](_0xc207('0xa4'),_0x164f88[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x164f88[_0xc207('0x5d')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xa6'));}var _0x25f408='\x22'+_0x164f88['text']+'\x22';if(this[_0xc207('0xa0')](_0x164f88[_0xc207('0x76')])){_0x25f408+=','+_0x164f88[_0xc207('0x76')];}var _0x38b43a=this[_0xc207('0xc')][_0xc207('0x58')](_0xc207('0xa7'),_0x25f408);if(_0x38b43a[_0xc207('0xa8')]===-0x1){return _0x38b43a;}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')]('Executed\x20command\x20MRCPSynth\x20%s',_0x25f408));};AGIVertices[_0xc207('0xf')]['mrcprecog']=function(_0x2414cc){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0xa9'),_0x2414cc['label']));if(!this['isConfigured'](_0x2414cc[_0xc207('0xaa')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xab'));}var _0x150ed9=_0x2414cc[_0xc207('0xaa')];if(this[_0xc207('0xa0')](_0x2414cc[_0xc207('0x76')])){_0x150ed9+=','+_0x2414cc[_0xc207('0x76')];}var _0x462677=this[_0xc207('0xc')][_0xc207('0x58')](_0xc207('0xac'),_0x150ed9);if(_0x462677[_0xc207('0xa8')]===-0x1){return _0x462677;}var _0x42cf3c=this[_0xc207('0xad')](_0xc207('0xae'),_0xc207('0xaf'));if(_0x42cf3c[_0xc207('0xa8')]===-0x1){return _0x42cf3c;}var _0x218620=this[_0xc207('0xad')](_0xc207('0xb0'),'MRCP_RECOG_TRANSCRIPT');if(_0x218620[_0xc207('0xa8')]===-0x1){return _0x218620;}var _0x344ebe=this['getAndSetVariable'](_0xc207('0xb1'),_0xc207('0xb2'));if(_0x344ebe[_0xc207('0xa8')]===-0x1){return _0x344ebe;}return this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xb3'),_0x150ed9));};AGIVertices[_0xc207('0xf')][_0xc207('0x7')]=function(_0xab9ee1){logger[_0xc207('0x2f')](util[_0xc207('0x55')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0xab9ee1[_0xc207('0x38')]));return this[_0xc207('0xc')][_0xc207('0x7')]([_0xab9ee1[_0xc207('0xb4')],_0xab9ee1['args']]);};AGIVertices[_0xc207('0xf')]['answer']=function(_0x2ddd75){logger[_0xc207('0x2f')](util[_0xc207('0x55')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2ddd75[_0xc207('0x38')]));if(this[_0xc207('0xa0')](_0x2ddd75[_0xc207('0x66')])){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0xb5'),_0x2ddd75[_0xc207('0x66')]));var _0x41bd5d=this[_0xc207('0xc')][_0xc207('0xb6')](_0x2ddd75[_0xc207('0x66')]);if(_0x41bd5d['result']===-0x1){return _0x41bd5d;}}return this['channel'][_0xc207('0xb7')]();};AGIVertices[_0xc207('0xf')][_0xc207('0x4a')]=function(_0x4c55be){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0xb8'),_0x4c55be[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x4c55be[_0xc207('0x48')])){return this[_0xc207('0xc')]['error'](_0x4c55be,_0xc207('0xb9'));}_0x4c55be[_0xc207('0x49')]=moment();if(this['isConfigured'](_0x4c55be[_0xc207('0xba')])){_0x4c55be['scheduledAt']=moment()[_0xc207('0xbb')](_0x4c55be['delay'],'minutes');}if(!this['isConfigured'](_0x4c55be['callback_priority'])){_0x4c55be[_0xc207('0x4c')]=0x2;}this[_0xc207('0x43')][_0xc207('0x6f')](this,_0x4c55be);return this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x4c55be[_0xc207('0x47')],_0x4c55be[_0xc207('0x48')],_0x4c55be[_0xc207('0x49')]));};AGIVertices['prototype'][_0xc207('0xbc')]=function(_0x4fa937){logger[_0xc207('0x2f')](util[_0xc207('0x55')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x4fa937[_0xc207('0x38')]));var _0x59c81a=this[_0xc207('0xc')]['exec'](_0x4fa937['application'],_0x4fa937[_0xc207('0x76')]);if(_0x59c81a[_0xc207('0xa8')]===-0x1){return _0x59c81a;}return this[_0xc207('0xc')][_0xc207('0xa5')](util['format']('Executed\x20command\x20%s\x20%s',_0x4fa937[_0xc207('0xbd')],_0x4fa937[_0xc207('0x76')]));};AGIVertices[_0xc207('0xf')][_0xc207('0xbe')]=function(_0x164ab4){logger['info'](util[_0xc207('0x55')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x164ab4['label']));if(!this[_0xc207('0xa0')](_0x164ab4[_0xc207('0x5d')])){return this['channel']['noop']('no\x20text\x20configured');}var _0x1e8695='\x22'+_0x164ab4[_0xc207('0x5d')]+'\x22';if(this[_0xc207('0xa0')](_0x164ab4[_0xc207('0x76')])){_0x1e8695+=','+_0x164ab4['options'];}var _0x3325c6=this[_0xc207('0xc')]['exec'](_0xc207('0xa7'),_0x1e8695);if(_0x3325c6[_0xc207('0xa8')]===-0x1){return _0x3325c6;}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xbf'),_0x1e8695));};AGIVertices[_0xc207('0xf')][_0xc207('0xc0')]=function(_0x3e0480){logger['info'](util['format'](_0xc207('0xc1'),_0x3e0480[_0xc207('0x38')]));if(!this['isConfigured'](_0x3e0480['text'])){return this[_0xc207('0xc')]['noop'](_0xc207('0xa6'));}var _0x300d79='\x22'+_0x3e0480['text']+'\x22';if(this[_0xc207('0xa0')](_0x3e0480[_0xc207('0x76')])){_0x300d79+=','+_0x3e0480['options'];}var _0x581d54=this[_0xc207('0xc')][_0xc207('0x58')](_0xc207('0xa7'),_0x300d79);if(_0x581d54['result']===-0x1){return _0x581d54;}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xbf'),_0x300d79));};AGIVertices['prototype'][_0xc207('0xc2')]=function(_0x32c0cd){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0xc3'),_0x32c0cd[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x32c0cd[_0xc207('0xaa')])){return this['channel'][_0xc207('0xa5')]('no\x20grammar\x20configured');}var _0xba73a4=_0x32c0cd[_0xc207('0xaa')];if(this[_0xc207('0xa0')](_0x32c0cd['options'])){_0xba73a4+=','+_0x32c0cd[_0xc207('0x76')];}var _0x418178=this['channel']['exec']('MRCPRecog',_0xba73a4);if(_0x418178[_0xc207('0xa8')]===-0x1){return _0x418178;}var _0xe374b1=this[_0xc207('0xad')](_0xc207('0xae'),_0xc207('0xc4'));if(_0xe374b1[_0xc207('0xa8')]===-0x1){return _0xe374b1;}var _0x351f73=this[_0xc207('0xad')](_0xc207('0xb0'),_0xc207('0xc5'));if(_0x351f73[_0xc207('0xa8')]===-0x1){return _0x351f73;}var _0x79eb6d=this[_0xc207('0xad')](_0xc207('0xb1'),_0xc207('0xc6'));if(_0x79eb6d[_0xc207('0xa8')]===-0x1){return _0x79eb6d;}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xb3'),_0xba73a4));};AGIVertices['prototype'][_0xc207('0xc7')]=function(_0x43b61d){logger[_0xc207('0x2f')](util['format'](_0xc207('0xc8'),_0x43b61d['label']));if(!this[_0xc207('0xa0')](_0x43b61d[_0xc207('0xaa')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xab'));}var _0x5dadbb=_0x43b61d[_0xc207('0xaa')];if(this[_0xc207('0xa0')](_0x43b61d[_0xc207('0x76')])){_0x5dadbb+=','+_0x43b61d[_0xc207('0x76')];}var _0x5c65db=this['channel'][_0xc207('0x58')](_0xc207('0xac'),_0x5dadbb);if(_0x5c65db[_0xc207('0xa8')]===-0x1){return _0x5c65db;}var _0x29cc26=this[_0xc207('0xad')](_0xc207('0xae'),_0xc207('0xc9'));if(_0x29cc26[_0xc207('0xa8')]===-0x1){return _0x29cc26;}var _0x1ccb0b=this[_0xc207('0xad')](_0xc207('0xb0'),_0xc207('0xca'));if(_0x1ccb0b[_0xc207('0xa8')]===-0x1){return _0x1ccb0b;}var _0x101510=this['getAndSetVariable']('RECOG_INSTANCE()',_0xc207('0xcb'));if(_0x101510[_0xc207('0xa8')]===-0x1){return _0x101510;}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xb3'),_0x5dadbb));};AGIVertices['prototype']['database']=function(_0x5e29c2){logger['info'](util[_0xc207('0x55')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x5e29c2[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x5e29c2[_0xc207('0xcc')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x5e29c2,_0xc207('0xcd'));}var _0x896bba=this[_0xc207('0xce')][_0xc207('0x6f')](this,_0x5e29c2['odbc_id']);if(!_0x896bba){return this['channel'][_0xc207('0x32')](_0x5e29c2,'no\x20odbc\x20database\x20found');}if(!this[_0xc207('0xa0')](_0x5e29c2['query'])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x5e29c2,_0xc207('0xcf'));}var _0x25332e=_0x5e29c2['query']['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0xc207('0xc')][_0xc207('0xa5')](util['format'](_0xc207('0xd0'),_0x25332e));var _0x2158c8=this[_0xc207('0x2a')]['sync'](this,_0x896bba,_0x25332e);this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x5e29c2,_0x25332e);if(!this[_0xc207('0xa0')](_0x5e29c2[_0xc207('0xd1')])){return this['channel'][_0xc207('0xa5')](_0xc207('0xd2'));}var _0x3fe3a1=this[_0xc207('0x10')][_0xc207('0x6f')](this,_0x5e29c2['variable_id']);if(!_0x3fe3a1){return this[_0xc207('0xc')][_0xc207('0x32')](_0x5e29c2,_0xc207('0xd3'));}var _0x8d71fa=this;_0x2158c8['forEach'](function(_0x31c419,_0x53f657){Object[_0xc207('0xd4')](_0x31c419)[_0xc207('0xd5')](function(_0x49a727){_0x8d71fa[_0xc207('0xc')][_0xc207('0x9c')](util[_0xc207('0x55')]('%s[%s][%s]',_0x3fe3a1,_0x53f657,_0x49a727),_0x31c419[_0x49a727]);});});this[_0xc207('0xc')][_0xc207('0x9c')](util['format']('%s_ROWS_COUNT',_0x3fe3a1),_0x2158c8['length']);return this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xd6'),_0x3fe3a1));};AGIVertices['prototype']['dial']=function(_0x4d28b1){logger[_0xc207('0xd7')](util['format'](_0xc207('0xd8'),_0x4d28b1[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x4d28b1['sip_id'])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x4d28b1,_0xc207('0xd9'));}var _0xe5a2c0=this['getUser'][_0xc207('0x6f')](this,_0x4d28b1['sip_id']);if(!_0xe5a2c0){return this['channel'][_0xc207('0x32')](_0x4d28b1,_0xc207('0xda'));}var _0x446bee=this[_0xc207('0xc')][_0xc207('0x58')](_0xc207('0xdb'),[util[_0xc207('0x55')](_0xc207('0xdc'),_0xe5a2c0),_0x4d28b1[_0xc207('0x66')],_0x4d28b1['opts'],_0x4d28b1[_0xc207('0x64')]]);if(_0x446bee['result']===-0x1){return _0x446bee;}return this[_0xc207('0xc')]['noop'](util[_0xc207('0x55')](_0xc207('0xdd'),_0xc207('0xdb')));};AGIVertices[_0xc207('0xf')][_0xc207('0xde')]=function(_0x3be7b1){logger[_0xc207('0x2f')](util[_0xc207('0x55')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x3be7b1['label']));if(!this[_0xc207('0xa0')](_0x3be7b1['key'])){return this[_0xc207('0xc')]['noop'](_0xc207('0xdf'));}if(!this[_0xc207('0xa0')](_0x3be7b1['text'])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20text\x20configured');}this[_0xc207('0xc')][_0xc207('0xe0')]=!![];this['createSquareDetailsReport'](_0x3be7b1);this[_0xc207('0x42')](_0x3be7b1['text'],'in','','');this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')]('Trying\x20Dialogflow:\x20%s',_0x3be7b1[_0xc207('0x5d')]));var _0x14bc44=this[_0xc207('0x77')][_0xc207('0x6f')](this,_0x3be7b1);if(_0x14bc44){for(var _0x2a87ec in _0x14bc44){if(_0x14bc44['hasOwnProperty'](_0x2a87ec)){this[_0xc207('0xc')]['setVariable'](util[_0xc207('0x55')]('DIALOGFLOW_%s',_0x2a87ec[_0xc207('0xe1')]()),_0x14bc44[_0x2a87ec]);}}this[_0xc207('0x42')](_0x14bc44[_0xc207('0xe2')],_0xc207('0xe3'),_0xc207('0xde'),'');return this['channel'][_0xc207('0xa5')](util['format']('Dialogflow\x20Result\x20%s',_0x14bc44['speech']));}return this[_0xc207('0xc')][_0xc207('0x32')](_0x3be7b1,_0xc207('0xe4'));};AGIVertices[_0xc207('0xf')][_0xc207('0xe5')]=function(_0x254458){logger['info'](util[_0xc207('0x55')](_0xc207('0xe6'),_0x254458[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x254458[_0xc207('0x78')])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20project_id\x20configured');}if(!this['isConfigured'](_0x254458['client_email'])){return this['channel'][_0xc207('0xa5')]('no\x20client_email\x20configured');}if(!this[_0xc207('0xa0')](_0x254458['private_key'])){return this['channel'][_0xc207('0xa5')]('no\x20private_key\x20configured');}if(!this[_0xc207('0xa0')](_0x254458[_0xc207('0xe7')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xe8'));}if(!this[_0xc207('0xa0')](_0x254458[_0xc207('0x5d')])){return this[_0xc207('0xc')]['noop'](_0xc207('0xa6'));}this[_0xc207('0xc')][_0xc207('0xe0')]=!![];this['createSquareDetailsReport'](_0x254458);this[_0xc207('0x42')](_0x254458[_0xc207('0x5d')],'in','','');this[_0xc207('0xc')]['noop'](util[_0xc207('0x55')](_0xc207('0xe9'),_0x254458[_0xc207('0x5d')]));var _0x9fedbb=this['googleDialogflowV2'][_0xc207('0x6f')](this,_0x254458);if(_0x9fedbb){for(var _0x49f869 in _0x9fedbb){if(_0x9fedbb[_0xc207('0x91')](_0x49f869)){if(_0x49f869!==_0xc207('0xea')){this['channel'][_0xc207('0x9c')](util[_0xc207('0x55')](_0xc207('0xeb'),_0x49f869[_0xc207('0xe1')]()),_0x9fedbb[_0x49f869]);}}}this[_0xc207('0x42')](_0x9fedbb[_0xc207('0xe2')],_0xc207('0xe3'),_0xc207('0xe5'),_0x9fedbb[_0xc207('0xea')]);return this['channel'][_0xc207('0xa5')](util['format'](_0xc207('0xec'),_0x9fedbb[_0xc207('0xe2')]));}return this[_0xc207('0xc')][_0xc207('0x32')](_0x254458,_0xc207('0xed'));};AGIVertices[_0xc207('0xf')][_0xc207('0xee')]=function(_0x56d47d){logger[_0xc207('0x2f')](util['format'](_0xc207('0xef'),_0x56d47d[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x56d47d[_0xc207('0xf0')])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20ndauth\x20url\x20configured');}if(!this[_0xc207('0xa0')](_0x56d47d[_0xc207('0xf1')])){return this['channel'][_0xc207('0xa5')](_0xc207('0xf2'));}if(!this[_0xc207('0xa0')](_0x56d47d[_0xc207('0xf3')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xf4'));}if(!this['isConfigured'](_0x56d47d[_0xc207('0xf5')])){return this['channel'][_0xc207('0xa5')]('no\x20text\x20configured');}this['channel'][_0xc207('0xe0')]=!![];this[_0xc207('0x36')](_0x56d47d);this['createSquareMessage'](_0x56d47d['text'],'in','','');this['channel']['noop'](util['format'](_0xc207('0xf6'),_0x56d47d[_0xc207('0x5d')]));var _0x36d0c7=this[_0xc207('0x7b')][_0xc207('0x6f')](this,_0x56d47d);if(_0x36d0c7){for(var _0x1ebd12 in _0x36d0c7){if(_0x36d0c7[_0xc207('0x91')](_0x1ebd12)){this[_0xc207('0xc')][_0xc207('0x9c')](util[_0xc207('0x55')]('SESTEK_NDA_%s',_0x1ebd12[_0xc207('0xe1')]()),_0x36d0c7[_0x1ebd12]);}}this[_0xc207('0x42')](_0x36d0c7[_0xc207('0xe2')],_0xc207('0xe3'),'sesteknda','');if(_0x36d0c7['audiofile']){this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xf7'),_0x36d0c7[_0xc207('0xf8')]));var _0x18d21b=this[_0xc207('0xc')][_0xc207('0xf9')](_0x36d0c7[_0xc207('0xf8')]);try{fs[_0xc207('0xfa')](_0x36d0c7[_0xc207('0xf8')]+_0xc207('0xfb'));}catch(_0x5766f4){logger[_0xc207('0x32')](_0x5766f4);}return _0x18d21b;}else{return this[_0xc207('0xc')][_0xc207('0xa5')](util['format'](_0xc207('0xfc'),_0x36d0c7[_0xc207('0xe2')]));}}return this['channel']['error'](_0x56d47d,_0xc207('0xfd'));};AGIVertices[_0xc207('0xf')][_0xc207('0xfe')]=function(_0x30bb29){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0xff'),_0x30bb29['label']));return this[_0xc207('0xc')]['noop'](_0xc207('0xfe'));};AGIVertices[_0xc207('0xf')][_0xc207('0x100')]=function(_0xb7e057){logger[_0xc207('0x2f')](util['format'](_0xc207('0x101'),_0xb7e057['label']));var _0x379fee='';if(_0xb7e057[_0xc207('0x102')]){if(!this[_0xc207('0xa0')](_0xb7e057['trunk_id'])){return this['channel'][_0xc207('0x32')](_0xb7e057,_0xc207('0x103'));}else{var _0x1eb32b=parseInt(_0xb7e057[_0xc207('0x102')],0xa);if(isNaN(_0x1eb32b)){_0x379fee=_0xb7e057['trunk_id'];}else{_0x379fee=this[_0xc207('0x1a')][_0xc207('0x6f')](this,_0xb7e057[_0xc207('0x102')]);if(!_0x379fee){return this[_0xc207('0xc')][_0xc207('0x32')](_0xb7e057,_0xc207('0x104'));}}}}else if(_0xb7e057[_0xc207('0x105')]){_0x379fee=_0xb7e057[_0xc207('0x105')];}else{return this[_0xc207('0xc')][_0xc207('0x32')](_0xb7e057,_0xc207('0x103'));}var _0x5000e6=this[_0xc207('0xc')][_0xc207('0x58')](_0xc207('0xdb'),[util[_0xc207('0x55')](_0xc207('0x106'),_0x379fee,_0xb7e057['phone']),_0xb7e057[_0xc207('0x66')],_0xb7e057['opts'],_0xb7e057[_0xc207('0x64')]]);if(_0x5000e6[_0xc207('0xa8')]===-0x1){return _0x5000e6;}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0xdd'),'DIAL'));};AGIVertices[_0xc207('0xf')][_0xc207('0x107')]=function(_0x49663d){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x108'),_0x49663d[_0xc207('0x38')]));return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0x107'));};AGIVertices[_0xc207('0xf')][_0xc207('0x109')]=function(_0x8f0385){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x10a'),_0x8f0385['label']));if(_0x8f0385[_0xc207('0xa2')]===0x0){return this[_0xc207('0xa1')](_0x8f0385);}_0x8f0385['retry']-=0x1;if(!this[_0xc207('0xa0')](_0x8f0385[_0xc207('0x10b')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x8f0385,_0xc207('0x10c'));}var _0x4bc749=this[_0xc207('0x1c')]['sync'](this,_0x8f0385[_0xc207('0x10b')]);if(!_0x4bc749){return this[_0xc207('0xc')]['error'](_0x8f0385,_0xc207('0x10d'));}if(!this['isConfigured'](_0x8f0385[_0xc207('0xd1')])){return this['channel'][_0xc207('0x32')](_0xc207('0xd2'));}var _0x31fa46=this[_0xc207('0xc')][_0xc207('0x10e')](_0x4bc749,_0x8f0385[_0xc207('0x10f')],_0x8f0385[_0xc207('0x110')]);var _0x472dd9=_0x31fa46['result']?_0x31fa46[_0xc207('0xa8')][_0xc207('0x111')]():'';logger[_0xc207('0x2f')](_0xc207('0x112'),JSON[_0xc207('0x72')](_0x31fa46));if(_0x31fa46['result']===-0x1){this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x8f0385,_0x472dd9);return _0x31fa46;}else if(_0x31fa46['extra']===_0xc207('0x66')){_0x31fa46[_0xc207('0xa8')]=_0x472dd9[_0xc207('0x98')]>=parseInt(_0x8f0385[_0xc207('0x113')])?'x':'i';}else{_0x31fa46[_0xc207('0xa8')]=_0x472dd9[_0xc207('0x98')]>=parseInt(_0x8f0385[_0xc207('0x113')])&&_0x472dd9[_0xc207('0x98')]<=parseInt(_0x8f0385[_0xc207('0x110')])?'x':'i';}var _0x2ab285=this['getVariable'][_0xc207('0x6f')](this,_0x8f0385['variable_id']);if(!_0x2ab285){return this['channel'][_0xc207('0x32')](_0x8f0385,_0xc207('0xd3'));}this[_0xc207('0xc')][_0xc207('0x9c')](_0x2ab285,_0x472dd9);if(this[_0xc207('0xa0')](_0x8f0385[_0xc207('0x114')])){var _0x9c5d3b=parseInt(_0x8f0385[_0xc207('0x114')],0xa);var _0xac29c4=rs[_0xc207('0x115')]({'charset':'*','length':_0x9c5d3b});var _0x2a2b6a=_0x472dd9[_0xc207('0x98')];if(_0x2a2b6a>0x0){if(_0x2a2b6a>_0x9c5d3b){this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x8f0385,_0x8f0385['hiddendigitspos']==='first'?_0xac29c4+_0x472dd9[_0xc207('0x116')](_0x9c5d3b):_0x472dd9[_0xc207('0x116')](0x0,_0x2a2b6a-_0x9c5d3b)+_0xac29c4);}else{this['createSquareDetailsReport'][_0xc207('0x6f')](this,_0x8f0385,rs[_0xc207('0x115')]({'charset':'*','length':_0x2a2b6a}));}}else{this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x8f0385,'');}}else{this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x8f0385,_0x472dd9);}return _0x31fa46;};AGIVertices['prototype'][_0xc207('0xb')]=function(_0x5f088){logger[_0xc207('0x2f')](util['format'](_0xc207('0x117'),_0x5f088[_0xc207('0x38')]));return this['getdigits'](_0x5f088);};AGIVertices[_0xc207('0xf')][_0xc207('0x118')]=function(_0x2eab5d){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x119'),_0x2eab5d[_0xc207('0x38')]));this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x2eab5d,_0x2eab5d[_0xc207('0x11a')]);return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')]('GOAL\x20%s',_0x2eab5d[_0xc207('0x11a')]));};AGIVertices['prototype'][_0xc207('0x11b')]=function(_0x561ff2){logger['info'](util[_0xc207('0x55')](_0xc207('0x11c'),_0x561ff2['label']));if(!this[_0xc207('0xa0')](_0x561ff2[_0xc207('0x84')])||!this[_0xc207('0xa0')](_0x561ff2[_0xc207('0x85')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0x11d'));}if(!this[_0xc207('0xa0')](_0x561ff2['text'])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xa6'));}this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x11e'),_0x561ff2[_0xc207('0x5d')]));var _0x4f941a=this[_0xc207('0x83')]['sync'](this,_0x561ff2);if(_0x4f941a){this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')]('aws\x20Polly\x20%s\x20file\x20created',_0x4f941a));var _0x19f148=this[_0xc207('0xc')][_0xc207('0xf9')](_0x4f941a);try{fs[_0xc207('0xfa')](_0x4f941a+_0xc207('0xfb'));}catch(_0x542d33){logger['error'](_0x542d33);}return _0x19f148;}return this[_0xc207('0xc')][_0xc207('0x32')](_0x561ff2,_0xc207('0x11f'));};AGIVertices[_0xc207('0xf')][_0xc207('0x120')]=function(_0x2cc5b5){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x121'),_0x2cc5b5[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x2cc5b5[_0xc207('0x84')])||!this[_0xc207('0xa0')](_0x2cc5b5[_0xc207('0x85')])){return this[_0xc207('0xc')]['noop'](_0xc207('0x11d'));}if(!this[_0xc207('0xa0')](_0x2cc5b5[_0xc207('0x122')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0x123'));}if(!this[_0xc207('0xa0')](_0x2cc5b5[_0xc207('0x5d')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xa6'));}this[_0xc207('0xc')][_0xc207('0xe0')]=!![];this[_0xc207('0x36')](_0x2cc5b5);this[_0xc207('0x42')](_0x2cc5b5[_0xc207('0x5d')],'in','','');this[_0xc207('0xc')][_0xc207('0xa5')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0x2cc5b5[_0xc207('0x5d')]));var _0x5008ed=this[_0xc207('0x88')][_0xc207('0x6f')](this,_0x2cc5b5);if(_0x5008ed){for(var _0x2f5bf5 in _0x5008ed){if(_0x5008ed[_0xc207('0x91')](_0x2f5bf5)&&_[_0xc207('0x92')](_0x5008ed[_0x2f5bf5])){this['channel'][_0xc207('0x9c')](util['format'](_0xc207('0x124'),_0x2f5bf5[_0xc207('0xe1')]()),_0x5008ed[_0x2f5bf5]);}}if(_[_0xc207('0x44')](_0x5008ed[_0xc207('0x125')])){return this[_0xc207('0xc')][_0xc207('0xa5')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xc207('0x42')](_0x5008ed[_0xc207('0x125')],_0xc207('0xe3'),_0xc207('0x126'),'');return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')]('Amazon\x20Lex\x20Result\x20%s',_0x5008ed['message']));}}return this[_0xc207('0xc')][_0xc207('0x32')](_0x2cc5b5,_0xc207('0x127'));};AGIVertices[_0xc207('0xf')]['googleasr']=function(_0x5af605){logger[_0xc207('0x2f')](util['format'](_0xc207('0x128'),_0x5af605[_0xc207('0x38')],_0x5af605[_0xc207('0x66')]));if(!this[_0xc207('0xa0')](_0x5af605['key'])){return this[_0xc207('0xc')]['noop'](_0xc207('0xdf'));}var _0x85ac7d='wav';var _0x146dcb=util[_0xc207('0x55')](_0xc207('0x129'),FILES_PATH,rs[_0xc207('0x115')](0x4));var _0x358b1f=util[_0xc207('0x55')](_0xc207('0x9b'),_0x146dcb,_0x85ac7d);var _0x2e0ace=!![];if(_0x5af605[_0xc207('0x12a')]===_0xc207('0x12b')){_0x2e0ace=![];}var _0x151684=this['channel'][_0xc207('0x12c')](_0x146dcb,_0x85ac7d,_0x5af605[_0xc207('0x12d')],_0x5af605[_0xc207('0x66')],undefined,_0x2e0ace);if(_0x151684[_0xc207('0xa8')]!==-0x1){this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x12e'),_0x358b1f));var _0x4805da=this[_0xc207('0x8a')][_0xc207('0x6f')](this,_0x5af605,_0x358b1f);if(_0x4805da){for(var _0xda73f8 in _0x4805da){if(_0x4805da[_0xc207('0x91')](_0xda73f8)){this[_0xc207('0xc')]['setVariable'](util[_0xc207('0x55')]('GOOGLE_ASR_%s',_0xda73f8[_0xc207('0xe1')]()),_0x4805da[_0xda73f8]);}}return this['channel'][_0xc207('0xa5')](util['format'](_0xc207('0x12f'),JSON[_0xc207('0x72')](_0x4805da)));}}return _0x151684;};AGIVertices[_0xc207('0xf')][_0xc207('0x130')]=function(_0xfde265){logger['info'](util[_0xc207('0x55')](_0xc207('0x131'),_0xfde265[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0xfde265[_0xc207('0x8d')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0x132'));}if(!this[_0xc207('0xa0')](_0xfde265[_0xc207('0x8e')])){return this[_0xc207('0xc')]['noop'](_0xc207('0x133'));}var _0x2c549a=_0xc207('0x134');var _0x2b9b2d=util['format'](_0xc207('0x129'),FILES_PATH,rs['generate'](0x4));var _0x24db3f=util[_0xc207('0x55')]('%s.%s',_0x2b9b2d,_0x2c549a);var _0xcb500d=!![];if(_0xfde265[_0xc207('0x12a')]===_0xc207('0x12b')){_0xcb500d=![];}var _0x661d3=this[_0xc207('0xc')][_0xc207('0x12c')](_0x2b9b2d,_0x2c549a,_0xfde265['intKey'],_0xfde265['timeout'],undefined,_0xcb500d);if(_0x661d3[_0xc207('0xa8')]!==-0x1){this[_0xc207('0xc')]['noop'](util[_0xc207('0x55')](_0xc207('0x135'),_0x24db3f));var _0x58dfc9=this[_0xc207('0x8c')][_0xc207('0x6f')](this,_0xfde265,_0x24db3f);if(_0x58dfc9){for(var _0xa8612d in _0x58dfc9){if(_0x58dfc9[_0xc207('0x91')](_0xa8612d)){this[_0xc207('0xc')][_0xc207('0x9c')](util[_0xc207('0x55')]('TILDE_ASR_%s',_0xa8612d[_0xc207('0xe1')]()),_0x58dfc9[_0xa8612d]);}}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x136'),JSON['stringify'](_0x58dfc9)));}}return _0x661d3;};AGIVertices[_0xc207('0xf')]['gotoc']=function(_0x5da583){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x137'),_0x5da583[_0xc207('0x38')]));return this['channel']['continueAt'](_0x5da583[_0xc207('0x3d')],_0x5da583[_0xc207('0x3e')],_0x5da583['priority']);};AGIVertices[_0xc207('0xf')][_0xc207('0x138')]=function(_0x51f85d){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x139'),_0x51f85d[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x51f85d[_0xc207('0x13a')])){return this['channel']['error'](_0x51f85d,_0xc207('0x13b'));}try{var _0x120970=eval(_0x51f85d['condition'])?_0xc207('0x13c'):_0xc207('0x13d');this[_0xc207('0xc')]['noop'](util[_0xc207('0x55')](_0xc207('0x13e'),_0x51f85d[_0xc207('0x13a')],_0x120970));return{'code':0xc8,'result':_0x120970};}catch(_0x5587d6){return{'code':0xc8,'result':_0xc207('0x13d')};}};AGIVertices[_0xc207('0xf')]['gotoiftime']=function(_0x55cf9e){logger['info'](util[_0xc207('0x55')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x55cf9e[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x55cf9e['interval_id'])){return this['channel'][_0xc207('0x32')](_0x55cf9e,_0xc207('0x13f'));}var _0x1ba592=this[_0xc207('0x22')][_0xc207('0x6f')](this,_0x55cf9e[_0xc207('0x140')]);if(!_0x1ba592){return this[_0xc207('0xc')]['error'](_0x55cf9e,_0xc207('0x141'));}for(var _0x54b4ca=0x0;_0x54b4ca<_0x1ba592['length'];_0x54b4ca+=0x1){var _0x1e243a=this['channel'][_0xc207('0x10')](util['format'](_0xc207('0x142'),_0x1ba592[_0x54b4ca]));if(_0x1e243a[_0xc207('0xa8')]===-0x1){return _0x1e243a;}logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x143'),_0x1ba592[_0x54b4ca],_0x1e243a[_0xc207('0x9f')]));if(_0x1e243a[_0xc207('0x9f')]==='true'){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x143'),_0x1ba592[_0x54b4ca],_0xc207('0x13c')));this['channel'][_0xc207('0xa5')](util['format']('IFTIME\x20%s\x20%s',_0x1ba592[_0x54b4ca],_0xc207('0x13c')));return{'code':0xc8,'result':'true'};}else{logger['info'](util[_0xc207('0x55')](_0xc207('0x143'),_0x1ba592[_0x54b4ca],_0xc207('0x13d')));this[_0xc207('0xc')]['noop'](util['format'](_0xc207('0x143'),_0x1ba592[_0x54b4ca],_0xc207('0x13d')));}}return{'code':0xc8,'result':_0xc207('0x13d')};};AGIVertices['prototype']['hangup']=function(_0x36cc89){logger['info'](util[_0xc207('0x55')](_0xc207('0x144'),_0x36cc89['label']));return this[_0xc207('0xc')][_0xc207('0x145')]();};AGIVertices['prototype'][_0xc207('0x146')]=function(_0x2ebbb0){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x147'),_0x2ebbb0[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x2ebbb0[_0xc207('0x7d')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xdf'));}var _0x438e94=_0xc207('0x134');var _0x193cc5=util[_0xc207('0x55')](_0xc207('0x129'),FILES_PATH,rs[_0xc207('0x115')](0x4));var _0x43755b=util['format'](_0xc207('0x9b'),_0x193cc5,_0x438e94);var _0x3ed4cc=!![];if(_0x2ebbb0['beep']===_0xc207('0x12b')){_0x3ed4cc=![];}var _0x1c1130=this[_0xc207('0xc')][_0xc207('0x12c')](_0x193cc5,_0x438e94,_0x2ebbb0[_0xc207('0x12d')],_0x2ebbb0[_0xc207('0x66')],undefined,_0x3ed4cc);if(_0x1c1130[_0xc207('0xa8')]!==-0x1){this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x148'),_0x43755b));var _0x2cbad0=this['ispeechASR'][_0xc207('0x6f')](this,_0x2ebbb0,_0x43755b);if(_0x2cbad0){for(var _0x116346 in _0x2cbad0){if(_0x2cbad0['hasOwnProperty'](_0x116346)){this[_0xc207('0xc')][_0xc207('0x9c')](util[_0xc207('0x55')](_0xc207('0x149'),_0x116346[_0xc207('0xe1')]()),_0x2cbad0[_0x116346]);}}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x14a'),JSON[_0xc207('0x72')](_0x2cbad0)));}}return _0x1c1130;};AGIVertices[_0xc207('0xf')][_0xc207('0x14b')]=function(_0x4c61e5){logger['info'](util[_0xc207('0x55')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x4c61e5[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x4c61e5[_0xc207('0x7d')])){return this['channel']['noop'](_0xc207('0xdf'));}if(!this['isConfigured'](_0x4c61e5[_0xc207('0x5d')])){return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xa6'));}this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x14c'),_0x4c61e5[_0xc207('0x5d')]));var _0x2a949d=this[_0xc207('0x7c')]['sync'](this,_0x4c61e5);if(_0x2a949d){this[_0xc207('0xc')]['noop'](util[_0xc207('0x55')]('ispeech\x20%s\x20file\x20created',_0x2a949d));var _0x7a1983=this['channel'][_0xc207('0xf9')](_0x2a949d,_0x4c61e5[_0xc207('0x12d')]);try{fs[_0xc207('0xfa')](_0x2a949d+_0xc207('0xfb'));}catch(_0x2c4a6d){logger[_0xc207('0x32')](_0x2c4a6d);}return _0x7a1983;}return this[_0xc207('0xc')][_0xc207('0x32')](_0x4c61e5,_0xc207('0x14d'));};AGIVertices['prototype'][_0xc207('0x14e')]=function(_0x44900a){logger['info'](util[_0xc207('0x55')](_0xc207('0x14f'),_0x44900a[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x44900a[_0xc207('0x150')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x44900a,_0xc207('0x151'));}logger[_0xc207('0x2f')](util[_0xc207('0x55')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc207('0xc')][_0xc207('0x3a')],_0x44900a[_0xc207('0x150')]));var _0x143c94=this[_0xc207('0x53')]['sync'](this,_0x44900a[_0xc207('0x150')]);if(_0x143c94){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x152'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x44900a['findBy']));this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0xc207('0x3a')],_0x44900a['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x153'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x44900a['findBy']));this[_0xc207('0xc')][_0xc207('0xa5')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xc207('0xc')][_0xc207('0x3a')],_0x44900a['findBy']));return{'code':0xc8,'result':_0xc207('0x154')};}};AGIVertices[_0xc207('0xf')]['logout']=function(_0x4f6c63){logger['info'](util[_0xc207('0x55')](_0xc207('0x155'),_0x4f6c63[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x4f6c63['findBy'])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x4f6c63,_0xc207('0x151'));}logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x156'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x4f6c63[_0xc207('0x150')]));var _0x5c3c4e=this['agentLogout'][_0xc207('0x6f')](this,_0x4f6c63[_0xc207('0x150')]);if(_0x5c3c4e){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x152'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x4f6c63[_0xc207('0x150')]));this[_0xc207('0xc')][_0xc207('0xa5')](util['format'](_0xc207('0x152'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x4f6c63[_0xc207('0x150')]));return{'code':0xc8,'result':_0xc207('0x157')};}else{logger['info'](util[_0xc207('0x55')](_0xc207('0x153'),this[_0xc207('0xc')]['callerid'],_0x4f6c63['findBy']));this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x153'),this[_0xc207('0xc')]['callerid'],_0x4f6c63[_0xc207('0x150')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xc207('0xf')][_0xc207('0x158')]=function(_0x38d601){logger['info'](util[_0xc207('0x55')](_0xc207('0x159'),_0x38d601[_0xc207('0x38')]));if(!this['isConfigured'](_0x38d601[_0xc207('0x15a')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x38d601,_0xc207('0x15b'));}this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')]('math\x20%s',_0x38d601[_0xc207('0x15a')]));var _0x181035=eval(_0x38d601[_0xc207('0x15a')]);if(!this[_0xc207('0xa0')](_0x38d601[_0xc207('0xd1')])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x17835d=this[_0xc207('0x10')]['sync'](this,_0x38d601['variable_id']);if(!_0x17835d){return this['channel']['error'](_0x38d601,_0xc207('0xd3'));}if(_[_0xc207('0x97')](_0x181035)){var _0x506790=this;_0x181035[_0xc207('0xd5')](function(_0x67d08e,_0x116c3c){_0x506790['channel'][_0xc207('0x9c')](util[_0xc207('0x55')]('%s[%s]',_0x17835d,_0x116c3c),_0x67d08e);});return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x15c'),_0x17835d));}else{return this[_0xc207('0xc')][_0xc207('0x9c')](_0x17835d,_0x181035);}};AGIVertices[_0xc207('0xf')][_0xc207('0xa')]=function(_0x26ed71){logger['info'](util[_0xc207('0x55')](_0xc207('0x15d'),_0x26ed71['label']));if(_0x26ed71['retry']===0x0){return this[_0xc207('0xa1')](_0x26ed71);}_0x26ed71['retry']-=0x1;if(!this[_0xc207('0xa0')](_0x26ed71[_0xc207('0x10b')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x26ed71,_0xc207('0x10c'));}var _0x60cd9f=this[_0xc207('0x1c')]['sync'](this,_0x26ed71[_0xc207('0x10b')]);if(!_0x60cd9f){return this[_0xc207('0xc')][_0xc207('0x32')](_0x26ed71,'no\x20file\x20audio\x20found');}var _0x331e5a=this['channel'][_0xc207('0x10e')](_0x60cd9f,_0x26ed71[_0xc207('0x10f')],_0x26ed71['digit']);var _0x374019=_0x331e5a[_0xc207('0xa8')];if(_0x331e5a['result']===-0x1){this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x26ed71,'-1');return _0x331e5a;}else if(_0x331e5a[_0xc207('0x9f')]===_0xc207('0x66')){_0x331e5a[_0xc207('0xa8')]=_0x331e5a[_0xc207('0xa8')][_0xc207('0x98')]>0x0?_0x331e5a['result']:'t';}else if(_[_0xc207('0x9a')](_0x331e5a[_0xc207('0xa8')])){_0x331e5a[_0xc207('0xa8')]='#';_0x374019='#';}if(!this[_0xc207('0xa0')](_0x26ed71[_0xc207('0xd1')])){this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0xd2'));}else{var _0x3b220d=this['getVariable'][_0xc207('0x6f')](this,_0x26ed71['variable_id']);if(!_0x3b220d){return this['channel'][_0xc207('0x32')](_0x26ed71,_0xc207('0xd3'));}this[_0xc207('0xc')][_0xc207('0x9c')](_0x3b220d,_0x374019);}this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x26ed71,_0x374019);return _0x331e5a;};AGIVertices[_0xc207('0xf')]['noop']=function(_0x3d471c){logger[_0xc207('0x2f')](util[_0xc207('0x55')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x3d471c['label']));return this[_0xc207('0xc')][_0xc207('0xa5')](_0x3d471c[_0xc207('0x15e')]||_0x3d471c['label']);};AGIVertices[_0xc207('0xf')][_0xc207('0x15f')]=function(_0x64238d){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x160'),_0x64238d[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x64238d['findBy'])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x64238d,_0xc207('0x151'));}logger[_0xc207('0x2f')](util[_0xc207('0x55')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xc207('0xc')]['callerid'],_0x64238d['findBy']));var _0x16d856=this[_0xc207('0x4d')][_0xc207('0x6f')](this,_0x64238d['pause_id']);var _0x373d00=this['agentPause'][_0xc207('0x6f')](this,_0x64238d[_0xc207('0x150')],_0x16d856);if(_0x373d00){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x152'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x64238d['findBy']));this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x152'),this['channel']['callerid'],_0x64238d['findBy']));return{'code':0xc8,'result':_0xc207('0x157')};}else{logger[_0xc207('0x2f')](util['format'](_0xc207('0x153'),this['channel'][_0xc207('0x3a')],_0x64238d['findBy']));this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xc207('0xc')][_0xc207('0x3a')],_0x64238d[_0xc207('0x150')]));return{'code':0xc8,'result':_0xc207('0x154')};}};AGIVertices[_0xc207('0xf')][_0xc207('0x161')]=function(_0x5c83df){logger[_0xc207('0x2f')](util['format'](_0xc207('0x162'),_0x5c83df[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x5c83df[_0xc207('0x10b')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x5c83df,_0xc207('0x10c'));}var _0x35af1b=this[_0xc207('0x1c')][_0xc207('0x6f')](this,_0x5c83df[_0xc207('0x10b')]);if(!_0x35af1b){return this[_0xc207('0xc')][_0xc207('0x32')](_0x5c83df,_0xc207('0x10d'));}var _0x1c5698=this[_0xc207('0xc')][_0xc207('0x58')](_0xc207('0x163'),[_0x35af1b,_0x5c83df[_0xc207('0x164')]]);if(_0x1c5698[_0xc207('0xa8')]===-0x1){return _0x1c5698;}return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x165'),'PLAYBACK',_0x35af1b));};AGIVertices[_0xc207('0xf')]['queue']=function(_0xe41fb2){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x166'),_0xe41fb2[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0xe41fb2[_0xc207('0x167')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0xe41fb2,_0xc207('0x168'));}var _0x5019cb='';var _0x31ab42=parseInt(_0xe41fb2[_0xc207('0x167')],0xa);if(isNaN(_0x31ab42)){_0x5019cb=_0xe41fb2[_0xc207('0x167')];}else{_0x5019cb=this[_0xc207('0x14')][_0xc207('0x6f')](this,_0xe41fb2['queue_id']);if(!_0x5019cb){return this[_0xc207('0xc')][_0xc207('0x32')](_0xe41fb2,'no\x20queue\x20found');}}var _0x4fde09='';if(this[_0xc207('0xa0')](_0xe41fb2[_0xc207('0x10b')])){var _0x397acc=this[_0xc207('0x1c')][_0xc207('0x6f')](this,_0xe41fb2[_0xc207('0x10b')]);if(_0x397acc){_0x4fde09=_0x397acc;}}this['createSquareDetailsReport'][_0xc207('0x6f')](this,_0xe41fb2,_0x5019cb);if(_0xe41fb2['opts'][_0xc207('0x169')]('x')<0x0){_0xe41fb2[_0xc207('0x164')]+='x';}if(_0xe41fb2[_0xc207('0x164')][_0xc207('0x169')]('X')<0x0){_0xe41fb2['opts']+='X';}this[_0xc207('0xc')]['setVariable']('XMCS-QUEUE',_0x5019cb?_0x5019cb[_0xc207('0x16a')]():'');var _0x2ffa68=this[_0xc207('0xc')]['exec'](_0xc207('0x16b'),[_0x5019cb,_0xe41fb2[_0xc207('0x164')],_0xe41fb2[_0xc207('0x64')],_0x4fde09,_0xe41fb2[_0xc207('0x66')],_0xe41fb2[_0xc207('0x7')],_0xe41fb2[_0xc207('0x16c')],_0xe41fb2[_0xc207('0x16d')],'',_0xe41fb2[_0xc207('0x16e')]]);if(_0x2ffa68[_0xc207('0xa8')]===-0x1){return _0x2ffa68;}return this[_0xc207('0xc')]['noop'](util['format'](_0xc207('0x165'),'QUEUE',_0x5019cb));};AGIVertices['prototype'][_0xc207('0x16f')]=function(_0x40eeae){logger[_0xc207('0x2f')](util['format'](_0xc207('0x170'),_0x40eeae[_0xc207('0x38')]));var _0x28cc99=_0x40eeae[_0xc207('0x171')]||_0xc207('0x134');var _0x26f570=util[_0xc207('0x55')](_0xc207('0x172'),this['channel'][_0xc207('0x37')],rs[_0xc207('0x115')](0x5));var _0x80cc4a=util[_0xc207('0x55')](_0xc207('0x173'),FILES_PATH,_0x26f570,_0x28cc99);var _0x3e4226=util[_0xc207('0x55')](_0xc207('0x129'),FILES_PATH,_0x26f570);this[_0xc207('0x3b')]['sync'](this,_0x40eeae,_0x26f570,_0x80cc4a);this[_0xc207('0xc')][_0xc207('0x9c')](_0xc207('0x174'),_0x26f570);logger[_0xc207('0x2f')](_0xc207('0x175'),_0x3e4226,_0x28cc99,_0x40eeae[_0xc207('0x176')],_0x40eeae[_0xc207('0x66')]);return this['channel']['recordFile'](_0x3e4226,_0x28cc99,_0x40eeae[_0xc207('0x176')],_0x40eeae['timeout'],undefined,!![]);};AGIVertices[_0xc207('0xf')][_0xc207('0x177')]=function(_0x367dd9){logger[_0xc207('0x2f')](util['format'](_0xc207('0x178'),_0x367dd9[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x367dd9['url'])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20url\x20configured');}var _0x44e4dc=this[_0xc207('0x63')][_0xc207('0x6f')](this,_0x367dd9);logger['info'](util[_0xc207('0x55')](_0xc207('0x179'),util[_0xc207('0x17a')](_0x44e4dc,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x367dd9[_0xc207('0xd1')])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x109bb6=this[_0xc207('0x10')]['sync'](this,_0x367dd9[_0xc207('0xd1')]);if(!_0x109bb6){return this[_0xc207('0xc')]['error'](_0x367dd9,'no\x20variable\x20found');}this[_0xc207('0xc')][_0xc207('0x9c')](util[_0xc207('0x55')]('%s_STATUS_CODE',_0x109bb6),_0x44e4dc[_0xc207('0x74')]?_0x44e4dc['statusCode']:'200');this['channel']['setVariable'](util['format']('%s_STATUS_MESSAGE',_0x109bb6),_0x44e4dc[_0xc207('0x17b')]?_0x44e4dc[_0xc207('0x17b')]:'OK');if(_0x44e4dc[_0xc207('0x6a')]){try{this[_0xc207('0x99')](_0x44e4dc[_0xc207('0x6a')],_0x109bb6);}catch(_0x233e23){logger[_0xc207('0x32')](util[_0xc207('0x55')](_0xc207('0x17c'),_0x109bb6));}}return this['channel']['noop'](util[_0xc207('0x55')](_0xc207('0xd6'),_0x109bb6));};AGIVertices[_0xc207('0xf')][_0xc207('0x17d')]=function(_0xb790cd){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x17e'),_0xb790cd[_0xc207('0x38')]));return this['channel'][_0xc207('0x17f')](_0xb790cd['digits'][_0xc207('0x5a')](/\s+/g,''),_0xb790cd['escape_digits']);};AGIVertices['prototype']['saynumber']=function(_0xe2969e){logger[_0xc207('0x2f')](util['format'](_0xc207('0x180'),_0xe2969e['label']));return this[_0xc207('0xc')][_0xc207('0x181')](_0xe2969e[_0xc207('0x65')][_0xc207('0x5a')](/\s+/g,''),_0xe2969e[_0xc207('0x176')]);};AGIVertices[_0xc207('0xf')]['sayphonetic']=function(_0x465233){logger['info'](util[_0xc207('0x55')](_0xc207('0x182'),_0x465233[_0xc207('0x38')]));return this[_0xc207('0xc')]['sayPhonetic'](_0x465233[_0xc207('0x5d')],_0x465233[_0xc207('0x176')]);};AGIVertices['prototype']['sendMail']=function(_0x42fa85){logger[_0xc207('0x2f')](util[_0xc207('0x55')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x42fa85['label']));if(!this[_0xc207('0xa0')](_0x42fa85[_0xc207('0x183')])){return this['channel'][_0xc207('0xa5')](_0xc207('0x184'));}var _0x32c253=this[_0xc207('0x1f')][_0xc207('0x6f')](this,_0x42fa85[_0xc207('0x183')]);if(!_0x32c253||!_0x32c253[_0xc207('0x185')]){return this['channel'][_0xc207('0x32')](_0x42fa85,_0xc207('0x186'));}var _0xf9bd33={'from':util[_0xc207('0x55')](_0xc207('0x187'),_0x32c253[_0xc207('0x12')],_0x32c253[_0xc207('0x188')]||_0x32c253['Smtp'][_0xc207('0x189')]),'to':_0x42fa85['to']||'','cc':_0x42fa85['cc']||'','bcc':_0x42fa85[_0xc207('0x18a')]||'','subject':_0x42fa85[_0xc207('0x18b')],'html':_0x42fa85['text'],'text':_0x42fa85[_0xc207('0x5d')]};if(this['isConfigured'](_0x42fa85[_0xc207('0x18c')])){}logger[_0xc207('0xd7')]('sendMail\x20message',JSON[_0xc207('0x72')](_0xf9bd33));this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x42fa85,_0x42fa85[_0xc207('0x183')]);this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x18d'),_0x32c253[_0xc207('0x12')]));this['sendMailMessage']['sync'](this,_0x32c253['smtpOptions'],_0xf9bd33);return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0x18e'));};AGIVertices[_0xc207('0xf')]['sendFax']=function(_0x3b3929){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x18f'),_0x3b3929[_0xc207('0x38')]));return this['channel'][_0xc207('0xa5')](_0xc207('0x190'));};AGIVertices[_0xc207('0xf')][_0xc207('0x191')]=function(_0x5005b1){logger['info'](util[_0xc207('0x55')](_0xc207('0x192'),_0x5005b1[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x5005b1[_0xc207('0x193')])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20sms\x20account\x20configured');}var _0x5a7a36=this[_0xc207('0x34')][_0xc207('0x6f')](this,_0x5005b1[_0xc207('0x193')]);if(!_0x5a7a36){return this[_0xc207('0xc')][_0xc207('0x32')](_0x5005b1,'no\x20sms\x20account\x20found');}var _0x458492={'body':_0x5005b1[_0xc207('0x194')],'phone':_0x5005b1['to']||'','SmsAccountId':_0x5a7a36['id']};logger[_0xc207('0xd7')](_0xc207('0x195'),JSON[_0xc207('0x72')](_0x458492));this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x5005b1,_0x5005b1[_0xc207('0x193')]);this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x196'),_0x5a7a36['name']));this[_0xc207('0x35')][_0xc207('0x6f')](this,_0x458492);return this[_0xc207('0xc')][_0xc207('0xa5')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0xc207('0xf')][_0xc207('0x197')]=function(_0x882575){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x198'),_0x882575[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x882575[_0xc207('0xd1')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x882575,_0xc207('0x199'));}var _0x14c326=this[_0xc207('0x10')]['sync'](this,_0x882575[_0xc207('0xd1')]);if(!_0x14c326){return this[_0xc207('0xc')]['error'](_0x882575,'no\x20variable\x20found');}return this['channel'][_0xc207('0x9c')](_0x14c326,_0x882575['variable_value']);};AGIVertices[_0xc207('0xf')][_0xc207('0x19a')]=function(_0x2119d2){logger['info'](util[_0xc207('0x55')](_0xc207('0x19b'),_0x2119d2[_0xc207('0x38')]));this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0x19c'));var _0x3415e9=this[_0xc207('0xc')][_0xc207('0x10')](_0xc207('0x19d'));if(!_[_0xc207('0x9a')](_0x3415e9[_0xc207('0x9f')])){this[_0xc207('0xc')][_0xc207('0x37')]=_0x3415e9[_0xc207('0x9f')];}if(_0x2119d2['answer']===_0xc207('0x19e')){this[_0xc207('0xc')]['noop'](_0xc207('0x19f'));return this['channel']['answer']();}return this[_0xc207('0xc')][_0xc207('0xa5')](_0xc207('0x1a0'));};AGIVertices['prototype']['subproject']=function(_0x18da06){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x1a1'),_0x18da06[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x18da06[_0xc207('0x1a2')])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x18da06,_0xc207('0x1a3'));}var _0x3e3167=this[_0xc207('0x1a4')][_0xc207('0x6f')](this,_0x18da06[_0xc207('0x1a2')]);if(!this[_0xc207('0xa0')](_0x3e3167)){return this['channel'][_0xc207('0x32')](_0x18da06,util[_0xc207('0x55')](_0xc207('0x1a5'),_0x18da06[_0xc207('0x1a2')]));}if(_0x3e3167===this[_0xc207('0xc')][_0xc207('0x39')]){return this[_0xc207('0xc')]['error'](_0x18da06,_0xc207('0x1a6'));}this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x18da06,_0x3e3167);var _0x4c95ac=this[_0xc207('0xc')]['exec'](_0xc207('0x1a7'),util['format'](_0xc207('0x1a8'),config['agi'][_0xc207('0x1a9')]||_0xc207('0x1aa'),_0x3e3167,this[_0xc207('0xc')][_0xc207('0x39')]));if(_0x4c95ac['result']===-0x1){return _0x4c95ac;}return this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x165'),'AGI',_0x3e3167));};AGIVertices[_0xc207('0xf')][_0xc207('0x1ab')]=function(_0x1c76f5){logger['info'](util['format'](_0xc207('0x1ac'),_0x1c76f5['label']));var _0x3e330e=this[_0xc207('0x1ad')][_0xc207('0x6f')](this,_0x1c76f5[_0xc207('0xb4')]);this[_0xc207('0x36')][_0xc207('0x6f')](this,_0x1c76f5,_0x1c76f5[_0xc207('0xb4')]);if(this[_0xc207('0xa0')](_0x1c76f5[_0xc207('0xd1')])){var _0x153eba=this[_0xc207('0x10')][_0xc207('0x6f')](this,_0x1c76f5[_0xc207('0xd1')]);if(_0x153eba){this[_0xc207('0xc')][_0xc207('0x9c')](_0x153eba,_0x3e330e);return this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x1ae'),_0x1c76f5[_0xc207('0xb4')],_0x153eba));}}return this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x1af'),_0x1c76f5[_0xc207('0xb4')]));};AGIVertices[_0xc207('0xf')]['google_cloud_tts']=function(_0x545e56){logger[_0xc207('0x2f')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x545e56[_0xc207('0x38')]));_0x545e56['text']=_0x545e56[_0xc207('0x5d')][_0xc207('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc207('0xa0')](_0x545e56[_0xc207('0x5c')])){return this['channel']['noop'](_0xc207('0x1b0'));}if(!this[_0xc207('0xa0')](_0x545e56[_0xc207('0x5d')])){return this[_0xc207('0xc')]['noop'](_0xc207('0xa6'));}this['channel']['noop'](util[_0xc207('0x55')](_0xc207('0x1b1'),_0x545e56['text']));var _0x45f957=this[_0xc207('0x5b')][_0xc207('0x6f')](this,_0x545e56);if(_0x45f957){this[_0xc207('0xc')][_0xc207('0xa5')](util['format'](_0xc207('0x1b2'),_0x45f957));var _0x4a4c02=this[_0xc207('0xc')][_0xc207('0xf9')](_0x45f957);try{fs[_0xc207('0xfa')](_0x45f957+_0xc207('0xfb'));}catch(_0xa7843c){logger[_0xc207('0x32')](_0xa7843c);}return _0x4a4c02;}return this[_0xc207('0xc')]['error'](_0x545e56,_0xc207('0x1b3'));};AGIVertices['prototype'][_0xc207('0x1b4')]=function(_0x2b59fe){logger['info'](util[_0xc207('0x55')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x2b59fe[_0xc207('0x38')]));_0x2b59fe[_0xc207('0x5d')]=_0x2b59fe[_0xc207('0x5d')][_0xc207('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xc207('0xa0')](_0x2b59fe[_0xc207('0x5d')])){return this[_0xc207('0xc')][_0xc207('0xa5')]('no\x20text\x20configured');}this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x1b5'),_0x2b59fe[_0xc207('0x5d')]));var _0x489938=this[_0xc207('0x1b6')]['sync'](this,_0x2b59fe);if(_0x489938){this['channel'][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x1b7'),_0x489938));var _0x25cd19=this['channel']['streamFile'](_0x489938);try{fs[_0xc207('0xfa')](_0x489938+_0xc207('0xfb'));}catch(_0x382db6){logger['error'](_0x382db6);}return _0x25cd19;}return this[_0xc207('0xc')][_0xc207('0x32')](_0x2b59fe,_0xc207('0x1b8'));};AGIVertices[_0xc207('0xf')][_0xc207('0x1b9')]=function(_0x1a05da){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x1ba'),_0x1a05da[_0xc207('0x38')]));if(!this['isConfigured'](_0x1a05da[_0xc207('0x150')])){return this['channel']['error'](_0x1a05da,'no\x20find\x20by\x20configured');}logger['info'](util[_0xc207('0x55')](_0xc207('0x156'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x1a05da[_0xc207('0x150')]));var _0x30dc99=this[_0xc207('0x50')][_0xc207('0x6f')](this,_0x1a05da[_0xc207('0x150')]);if(_0x30dc99){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x152'),this['channel'][_0xc207('0x3a')],_0x1a05da[_0xc207('0x150')]));this[_0xc207('0xc')][_0xc207('0xa5')](util[_0xc207('0x55')](_0xc207('0x152'),this['channel']['callerid'],_0x1a05da[_0xc207('0x150')]));return{'code':0xc8,'result':_0xc207('0x157')};}else{logger[_0xc207('0x2f')](util['format'](_0xc207('0x153'),this[_0xc207('0xc')]['callerid'],_0x1a05da['findBy']));this['channel'][_0xc207('0xa5')](util['format'](_0xc207('0x153'),this[_0xc207('0xc')][_0xc207('0x3a')],_0x1a05da[_0xc207('0x150')]));return{'code':0xc8,'result':_0xc207('0x154')};}};AGIVertices[_0xc207('0xf')][_0xc207('0x1bb')]=function(_0x355f2b){logger[_0xc207('0x2f')](util[_0xc207('0x55')](_0xc207('0x1bc'),_0x355f2b[_0xc207('0x38')]));var _0x4177f6=this[_0xc207('0xc')][_0xc207('0x58')](_0xc207('0x1bd'),[_0x355f2b[_0xc207('0x1be')],_0x355f2b['options']]);if(_0x4177f6[_0xc207('0xa8')]===-0x1){return _0x4177f6;}return this[_0xc207('0xc')]['noop'](util[_0xc207('0x55')](_0xc207('0x165'),_0xc207('0x1bd'),_0x355f2b[_0xc207('0x1be')]));};AGIVertices[_0xc207('0xf')][_0xc207('0x1bf')]=function(_0x199c2d){logger[_0xc207('0x2f')](util['format'](_0xc207('0x1c0'),_0x199c2d[_0xc207('0x38')]));if(!this[_0xc207('0xa0')](_0x199c2d['variable_id'])){return this[_0xc207('0xc')][_0xc207('0x32')](_0x199c2d,_0xc207('0x199'));}var _0x44b136=this['getVariable']['sync'](this,_0x199c2d[_0xc207('0xd1')]);if(!_0x44b136){return this[_0xc207('0xc')][_0xc207('0x32')](_0x199c2d,_0xc207('0xd3'));}var _0x335134=this[_0xc207('0xc')][_0xc207('0x10')](_0x44b136);return{'code':0xc8,'result':_0x335134[_0xc207('0x9f')]?_0x335134['extra']:'-'};};String[_0xc207('0xf')][_0xc207('0x9e')]=function(_0x7a7fd0,_0x492c6e){return this[_0xc207('0x9d')](_0x7a7fd0)[_0xc207('0x1c1')](_0x492c6e);};module[_0xc207('0x1c2')]=AGIVertices; \ No newline at end of file +var _0x0ba7=['MP3','googleTTS','restAPI','method','timeout','number','POST','body','parse','headers','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','aws_text_type','awsLex','aws_secret_access_key','aws_bot_name','googleASR','tildeASR','appsecret','uri','clear','clone','hasOwnProperty','isString','includes','replaceAllVariables','recursiveNodeIndex','isArray','saveRestApiResult','%s.%s','length','setVariable','replaceObjectAllVariables','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','getAndSetVariable','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','list_id','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','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','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','getQueryOdbc','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','sip_id','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','client_email','private_key','no\x20private_key\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','toString','test','mindigit','hiddendigitsnum','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','generate','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','NOBEEP','intKey','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','false','no\x20interval\x20configured','interval_id','no\x20intervals\x20found','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','getData','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','url','macro','gosub','QUEUE','record','recordingFormat','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusCode','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sms_account_id','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','XMCS-UNIQUEID','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','util','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','mailRpc','getVariable','rpc','catch','prototype','getVoiceQueue','getVoiceQueueById','then','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','IntervalId','map','getSoundPath','format','%s/sounds/converted/%s','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','lastName','phone','callback','Callback\x20scheduled\x20at\x20','scheduledAt','callback_priority','getPauseById','agentPause','agentUnpause','agent','internal','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','MALE','audioEncoding'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0ba7,0x16d));var _0x70ba=function(_0x4a20d4,_0x5dde24){_0x4a20d4=_0x4a20d4-0x0;var _0x37b32b=_0x0ba7[_0x4a20d4];return _0x37b32b;};'use strict';var fs=require('fs');var util=require(_0x70ba('0x0'));var _=require('lodash');var sh=require(_0x70ba('0x1'));var odbc=require(_0x70ba('0x2'))();var rs=require(_0x70ba('0x3'));var moment=require(_0x70ba('0x4'));var Mustache=require('mustache');var rp=require(_0x70ba('0x5'));var logger=require(_0x70ba('0x6'))(_0x70ba('0x7'));var config=require(_0x70ba('0x8'));var scripts=require(_0x70ba('0x9'));var FILES_PATH=_0x70ba('0xa');var recursiveMapAttributes=[_0x70ba('0xb'),_0x70ba('0xc')];var verticesWithRetry=[_0x70ba('0xd'),_0x70ba('0xe'),_0x70ba('0xf')];var AGIVertices=function(_0x41cd10,_0x1264b0,_0x371629){this[_0x70ba('0x10')]=_0x41cd10;this['rpc']=_0x1264b0;this[_0x70ba('0x11')]=_0x371629;};AGIVertices['prototype'][_0x70ba('0x12')]=function(_0x258604,_0xfc4de3){this[_0x70ba('0x13')]['getVariableById'](_0x258604)['then'](function(_0x12cea8){_0xfc4de3(null,_0x12cea8?_0x12cea8['name']:![]);})[_0x70ba('0x14')](function(_0x5e94c7){_0xfc4de3(_0x5e94c7);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x16')]=function(_0x4df1e3,_0x1d674b){this['rpc'][_0x70ba('0x17')](_0x4df1e3)[_0x70ba('0x18')](function(_0x211b0e){_0x1d674b(null,_0x211b0e?_0x211b0e[_0x70ba('0x19')]:![]);})[_0x70ba('0x14')](function(_0x29734b){_0x1d674b(_0x29734b);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1a')]=function(_0x18334a,_0x3e27e8){this[_0x70ba('0x13')][_0x70ba('0x1b')](_0x18334a)[_0x70ba('0x18')](function(_0xb6d69a){_0x3e27e8(null,_0xb6d69a?_0xb6d69a['name']:![]);})['catch'](function(_0x489cf9){_0x3e27e8(_0x489cf9);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1c')]=function(_0x20c2aa,_0xb4dad){this[_0x70ba('0x13')][_0x70ba('0x1d')](_0x20c2aa)[_0x70ba('0x18')](function(_0x2763f3){_0xb4dad(null,_0x2763f3?_0x2763f3[_0x70ba('0x1e')]:![]);})[_0x70ba('0x14')](function(_0x26c039){_0xb4dad(_0x26c039);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1f')]=function(_0x4570b0,_0x273ce4){this['rpc'][_0x70ba('0x20')](_0x4570b0)[_0x70ba('0x18')](function(_0x52accf){_0x273ce4(null,_0x52accf?_0x52accf[_0x70ba('0x19')]:![]);})['catch'](function(_0x4868a1){_0x273ce4(_0x4868a1);});};AGIVertices[_0x70ba('0x15')]['getTrunk']=function(_0x45bbf2,_0x304a41){this['rpc'][_0x70ba('0x21')](_0x45bbf2)['then'](function(_0x5ad828){_0x304a41(null,_0x5ad828?_0x5ad828[_0x70ba('0x19')]:![]);})['catch'](function(_0x230d11){_0x304a41(_0x230d11);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x22')]=function(_0x33e218,_0x2c6d18){var _0x265423=this;this['rpc'][_0x70ba('0x23')](_0x33e218)[_0x70ba('0x18')](function(_0x797467){_0x2c6d18(null,_0x797467?_0x265423['getSoundPath'](_0x797467[_0x70ba('0x24')]):![]);})['catch'](function(_0x5955dc){_0x2c6d18(_0x5955dc);});};AGIVertices['prototype'][_0x70ba('0x25')]=function(_0x345edd,_0x5b6e6e){this['rpc'][_0x70ba('0x26')](_0x345edd)['then'](function(_0x102661){_0x5b6e6e(null,_0x102661?_0x102661:![]);})[_0x70ba('0x14')](function(_0x46b7e3){_0x5b6e6e(_0x46b7e3);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x27')]=function(_0x269943,_0x1f86cf,_0x9bafd){this[_0x70ba('0x11')][_0x70ba('0x27')](_0x269943,_0x1f86cf)[_0x70ba('0x18')](function(){_0x9bafd(null);})['catch'](function(_0x576ec4){_0x9bafd(_0x576ec4);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x28')]=function(_0x943e49,_0x563f68){this['rpc']['getIntervalById'](_0x943e49)[_0x70ba('0x18')](function(_0x806866){if(_0x806866){if(_0x806866[_0x70ba('0x29')]){_0x563f68(null,[_0x806866['interval']]);}else{_0x563f68(null,_[_0x70ba('0x2a')](_0x806866['Intervals'],'interval'));}}else{_0x563f68(null,![]);}})[_0x70ba('0x14')](function(_0x591596){_0x563f68(_0x591596);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x2b')]=function(_0x4f3d6f){return util[_0x70ba('0x2c')](_0x70ba('0x2d'),FILES_PATH,_0x4f3d6f);};AGIVertices[_0x70ba('0x15')]['getQueryOdbc']=function(_0x1402b2,_0x20c3fd,_0xbb0c72){odbc[_0x70ba('0x2e')](_0x1402b2,function(_0x5245f7){if(_0x5245f7){logger[_0x70ba('0x2f')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x5245f7);_0xbb0c72(_0x5245f7);}else{logger[_0x70ba('0x30')](_0x70ba('0x31'));odbc[_0x70ba('0x32')](_0x20c3fd,function(_0x450eb3,_0x16ce39){if(_0x450eb3){logger[_0x70ba('0x30')](_0x70ba('0x33'),_0x20c3fd);_0xbb0c72(_0x450eb3);}else{logger['info'](_0x70ba('0x34'),_0x20c3fd);odbc[_0x70ba('0x35')](function(_0x31e713){if(_0x31e713){logger[_0x70ba('0x2f')](_0x70ba('0x36'),_0x31e713);}_0xbb0c72(null,_0x16ce39);});}});}});};AGIVertices[_0x70ba('0x15')]['getSmsAccount']=function(_0x452208,_0x175152){this[_0x70ba('0x13')]['getSmsAccountById'](_0x452208)['then'](function(_0x5ee9b1){_0x175152(null,_0x5ee9b1?_0x5ee9b1:![]);})[_0x70ba('0x14')](function(_0x59044){_0x175152(_0x59044);});};AGIVertices[_0x70ba('0x15')]['createSmsMessage']=function(_0x24a8c3,_0x27203b){this[_0x70ba('0x13')][_0x70ba('0x37')](_0x24a8c3)[_0x70ba('0x18')](function(_0x54e732){_0x27203b(null,_0x54e732);})['catch'](function(_0x7b0436){_0x27203b(_0x7b0436);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x38')]=function(_0x5a1edb,_0x595645,_0x2fc262){this['rpc'][_0x70ba('0x38')]({'uniqueid':this[_0x70ba('0x10')][_0x70ba('0x39')],'node':_0x5a1edb[_0x70ba('0x3a')],'application':_0x5a1edb[_0x70ba('0x3b')],'data':_0x595645||null,'project_name':this['channel'][_0x70ba('0x3c')],'callerid':this[_0x70ba('0x10')][_0x70ba('0x3d')]})[_0x70ba('0x18')](function(_0x817e59){if(_0x2fc262){_0x2fc262(null,_0x817e59);}})[_0x70ba('0x14')](function(_0x900910){if(_0x2fc262){_0x2fc262(_0x900910);}});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x3e')]=function(_0x1f804b,_0x389571,_0x349059,_0x3e3ce5){this[_0x70ba('0x13')][_0x70ba('0x3e')]({'uniqueid':this['channel'][_0x70ba('0x39')],'callerid':this[_0x70ba('0x10')]['callerid'],'calleridname':this[_0x70ba('0x10')][_0x70ba('0x3f')],'context':this[_0x70ba('0x10')][_0x70ba('0x40')],'extension':this[_0x70ba('0x10')][_0x70ba('0x41')],'priority':this[_0x70ba('0x10')]['priority'],'accountcode':this[_0x70ba('0x10')][_0x70ba('0x42')],'dnid':this[_0x70ba('0x10')][_0x70ba('0x43')],'projectName':this[_0x70ba('0x10')][_0x70ba('0x3c')],'saveName':_0x389571,'filename':_0x1f804b[_0x70ba('0x44')]||_0x389571,'savePath':_0x349059})[_0x70ba('0x18')](function(_0xc574b){_0x3e3ce5(null,_0xc574b);})[_0x70ba('0x14')](function(_0x3a4247){_0x3e3ce5(_0x3a4247);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x45')]=function(_0x16af4d,_0x25f68a,_0x2536cd,_0x9f97c5,_0x4a848b){this[_0x70ba('0x13')][_0x70ba('0x45')]({'uniqueid':this[_0x70ba('0x10')][_0x70ba('0x39')],'body':_0x16af4d,'direction':_0x25f68a,'providerName':_0x2536cd,'providerResponse':_0x9f97c5})['then'](function(_0x47c40c){if(_0x4a848b){_0x4a848b(null,_0x47c40c);}})['catch'](function(_0x471d19){if(_0x4a848b){_0x4a848b(_0x471d19);}});};AGIVertices[_0x70ba('0x15')]['createCmContact']=function(_0x572834,_0x6a3dc6){this[_0x70ba('0x13')][_0x70ba('0x46')]({'firstName':_[_0x70ba('0x47')](_0x572834[_0x70ba('0x19')])||_[_0x70ba('0x48')](_0x572834[_0x70ba('0x19')])?'callback_'+Math['random']():_0x572834[_0x70ba('0x19')],'lastName':_[_0x70ba('0x47')](_0x572834[_0x70ba('0x49')])||_[_0x70ba('0x48')](_0x572834['lastName'])?null:_0x572834[_0x70ba('0x49')],'phone':_0x572834[_0x70ba('0x4a')],'ListId':_0x572834['list_id'],'scheduledat':_0x572834['scheduledAt'],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0x70ba('0x4b'),'description':_0x70ba('0x4c')+_0x572834[_0x70ba('0x4d')]['toString'](),'priority':_0x572834[_0x70ba('0x4e')]})[_0x70ba('0x18')](function(_0x29bb0b){_0x6a3dc6(null,_0x29bb0b);})['catch'](function(_0x1bdcd4){_0x6a3dc6(_0x1bdcd4);});};AGIVertices[_0x70ba('0x15')]['getPause']=function(_0x49f89a,_0x2ccfd4){this[_0x70ba('0x13')][_0x70ba('0x4f')](_0x49f89a)[_0x70ba('0x18')](function(_0x10e824){_0x2ccfd4(null,_0x10e824?_0x10e824[_0x70ba('0x19')]:![]);})[_0x70ba('0x14')](function(_0x5e7a92){_0x2ccfd4(_0x5e7a92);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x50')]=function(_0x4de412,_0x508da6,_0x137b7d){var _0x26c5a7={'role':'agent'};_0x26c5a7[_0x4de412]=this['channel'][_0x70ba('0x3d')];this['rpc']['agentPause'](_0x26c5a7,_0x508da6,this[_0x70ba('0x10')][_0x70ba('0x39')])[_0x70ba('0x18')](function(_0xb03649){_0x137b7d(null,_[_0x70ba('0x48')](_0xb03649)?![]:!![]);})[_0x70ba('0x14')](function(_0xeac8a8){logger['error'](_0xeac8a8);_0x137b7d(null,![]);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x51')]=function(_0x16e607,_0xaad21){var _0x355df4={'role':_0x70ba('0x52')};_0x355df4[_0x16e607]=this['channel'][_0x70ba('0x3d')];this['rpc'][_0x70ba('0x51')](_0x355df4)['then'](function(_0x3badfd){_0xaad21(null,_[_0x70ba('0x48')](_0x3badfd)?![]:!![]);})[_0x70ba('0x14')](function(_0x305df9){logger[_0x70ba('0x2f')](_0x305df9);_0xaad21(null,![]);});};AGIVertices[_0x70ba('0x15')]['agentLogout']=function(_0x2a46cd,_0x4d7e67){var _0x490948={'role':_0x70ba('0x52')};_0x490948[_0x2a46cd]=this[_0x70ba('0x10')]['callerid'];this[_0x70ba('0x13')]['agentLogout'](_0x490948)[_0x70ba('0x18')](function(_0x2a8aa9){_0x4d7e67(null,_[_0x70ba('0x48')](_0x2a8aa9)?![]:!![]);})['catch'](function(_0x327219){logger['error'](_0x327219);_0x4d7e67(null,![]);});};AGIVertices[_0x70ba('0x15')]['agentLogin']=function(_0x2ee3d0,_0x3e0aeb){var _0x1bd96e={'role':_0x70ba('0x52')};_0x1bd96e[_0x2ee3d0]=this['channel'][_0x70ba('0x3d')];var _0x530324=_0x2ee3d0!=_0x70ba('0x53')?util[_0x70ba('0x2c')](_0x70ba('0x54'),_0x70ba('0x55'),this['channel'][_0x70ba('0x3d')]):undefined;this[_0x70ba('0x13')][_0x70ba('0x56')](_0x1bd96e,_0x530324)[_0x70ba('0x18')](function(_0x14c761){_0x3e0aeb(null,_[_0x70ba('0x48')](_0x14c761)?![]:!![]);})[_0x70ba('0x14')](function(_0x2e0f08){logger['error'](_0x2e0f08);_0x3e0aeb(null,![]);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x57')]=function(_0x28294e,_0x157404){sh[_0x70ba('0x58')](_[_0x70ba('0x59')](_0x28294e),function(_0xb2276e,_0x4d83ab){var _0x1bc8c6=_0x4d83ab[_0x70ba('0x5a')](/(\r\n|\n|\r)/gm,'');_0x157404(null,_0x1bc8c6);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x5b')]=function(_0x30fad7,_0x67628f){scripts[_0x70ba('0x5b')](_0x30fad7[_0x70ba('0x5c')],_0x30fad7['google_cloud_tts_text_type']||'text',_0x30fad7[_0x70ba('0x5d')],_0x30fad7[_0x70ba('0x5e')]||_0x70ba('0x5f'),_0x30fad7['ssmlGender']||_0x70ba('0x60'),_0x30fad7[_0x70ba('0x61')]||_0x70ba('0x62'))['then'](function(_0x3e341a){_0x67628f(null,_0x3e341a);})[_0x70ba('0x14')](function(_0xa9009d){_0x67628f(_0xa9009d);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x63')]=function(_0x3184cc,_0x22e520){scripts['googleTTS'](_0x3184cc[_0x70ba('0x5d')],_0x3184cc['google_tts_language']||'en',0x1)['then'](function(_0x12f420){_0x22e520(null,_0x12f420);})[_0x70ba('0x14')](function(_0x13cb22){_0x22e520(_0x13cb22);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x64')]=function(_0x408f46,_0x36eb0f){var _0x315ed4={'uri':_0x408f46['url'],'method':_0x408f46[_0x70ba('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x408f46[_0x70ba('0x66')])===_0x70ba('0x67')&&parseInt(_0x408f46['timeout'])>=0x1?parseInt(_0x408f46['timeout'])*0x3e8:0x5*0x3e8};if(_['includes']([_0x70ba('0x68'),'PUT'],_0x315ed4['method']['toUpperCase']())){try{_0x315ed4[_0x70ba('0x69')]=_0x408f46[_0x70ba('0xc')]?JSON[_0x70ba('0x6a')](_0x408f46[_0x70ba('0xc')]):{};}catch(_0xe214a7){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe214a7);}}try{_0x315ed4[_0x70ba('0x6b')]=_0x408f46[_0x70ba('0xb')]?JSON['parse'](_0x408f46[_0x70ba('0xb')]):{};}catch(_0x3ba6c3){logger[_0x70ba('0x2f')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x3ba6c3);}if(_0x408f46[_0x70ba('0x6c')]){try{var _0x534ea9=require(_0x408f46[_0x70ba('0x6c')])[_0x70ba('0x6d')](this,_0x315ed4);_0x315ed4['uri']=Mustache[_0x70ba('0x6e')](_0x408f46['url'],_0x534ea9,{},['$$','$$']);if(_0x315ed4[_0x70ba('0x6b')]){_0x315ed4[_0x70ba('0x6b')]=JSON['parse'](Mustache[_0x70ba('0x6e')](JSON[_0x70ba('0x6f')](_0x315ed4[_0x70ba('0x6b')]),_0x534ea9,{},['$$','$$']));}if(_0x315ed4[_0x70ba('0x69')]){_0x315ed4[_0x70ba('0x69')]=JSON[_0x70ba('0x6a')](Mustache[_0x70ba('0x6e')](JSON[_0x70ba('0x6f')](_0x315ed4[_0x70ba('0x69')]),_0x534ea9,{},['$$','$$']));}}catch(_0xc4c5d3){logger['error'](_0x70ba('0x70'),_0xc4c5d3);}}rp(_0x315ed4)[_0x70ba('0x18')](function(_0x46e1f1){var _0x313a9a={'statusCode':_0x46e1f1['statusCode']||0xc8,'statusMessage':_0x46e1f1[_0x70ba('0x71')]||'OK','headers':_0x46e1f1['headers']||{},'body':_0x46e1f1[_0x70ba('0x69')]||{}};_0x36eb0f(null,_0x313a9a);})['catch'](function(_0x44b3ad){var _0x18d129={'statusCode':_0x44b3ad['statusCode']||0x1f4,'statusMessage':_0x44b3ad[_0x70ba('0x72')]||_0x70ba('0x73'),'headers':_0x44b3ad[_0x70ba('0x74')][_0x70ba('0x6b')]||{},'body':_0x44b3ad[_0x70ba('0x74')][_0x70ba('0x69')]||{}};_0x36eb0f(null,_0x18d129);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x75')]=function(_0x58e514,_0x3b4036){scripts[_0x70ba('0x75')](this[_0x70ba('0x10')][_0x70ba('0x39')],_0x58e514[_0x70ba('0x76')],_0x58e514[_0x70ba('0x5d')],_0x58e514[_0x70ba('0x77')]||'en')[_0x70ba('0x18')](function(_0x57ec44){_0x3b4036(null,_0x57ec44);})[_0x70ba('0x14')](function(_0x3b4ee6){_0x3b4036(_0x3b4ee6);});};AGIVertices[_0x70ba('0x15')]['googleDialogflowV2']=function(_0x271b69,_0x1a037e){scripts[_0x70ba('0x78')](this['channel']['uniqueid'],_0x271b69[_0x70ba('0x79')],_0x271b69['client_email'],_0x271b69['private_key'],_0x271b69[_0x70ba('0x5d')],_0x271b69[_0x70ba('0x7a')]||'en')[_0x70ba('0x18')](function(_0x10282f){_0x1a037e(null,_0x10282f);})[_0x70ba('0x14')](function(_0x239265){_0x1a037e(_0x239265);});};AGIVertices['prototype']['sestekNDA']=function(_0xa0f12b,_0x312048){scripts[_0x70ba('0x7b')](this[_0x70ba('0x10')],_0xa0f12b)['then'](function(_0x3e4ec7){_0x312048(null,_0x3e4ec7);})[_0x70ba('0x14')](function(_0x459128){_0x312048(_0x459128);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x7c')]=function(_0x3e3e45,_0x132ff1){scripts[_0x70ba('0x7c')](_0x3e3e45[_0x70ba('0x76')],_0x3e3e45[_0x70ba('0x5d')],_0x3e3e45[_0x70ba('0x7d')]||_0x70ba('0x5f'),_0x3e3e45[_0x70ba('0x7e')])[_0x70ba('0x18')](function(_0x53df7a){_0x132ff1(null,_0x53df7a);})[_0x70ba('0x14')](function(_0x24328e){_0x132ff1(_0x24328e);});};AGIVertices[_0x70ba('0x15')]['ispeechASR']=function(_0x5f2e0a,_0x54849c,_0x1e9f8a){scripts[_0x70ba('0x7f')](_0x54849c,_0x5f2e0a[_0x70ba('0x76')],_0x5f2e0a[_0x70ba('0x80')]||'en-US',this[_0x70ba('0x81')](_0x5f2e0a[_0x70ba('0x82')])?_0x5f2e0a[_0x70ba('0x82')]:undefined)[_0x70ba('0x18')](function(_0x5445e7){_0x1e9f8a(null,_0x5445e7);})['catch'](function(_0x4875e6){_0x1e9f8a(_0x4875e6);});};AGIVertices[_0x70ba('0x15')]['awsPolly']=function(_0x363fa4,_0x5e2822){scripts[_0x70ba('0x83')](_0x363fa4[_0x70ba('0x84')],_0x363fa4['aws_secret_access_key'],_0x363fa4['aws_polly_region'],_0x363fa4[_0x70ba('0x85')]||'Amy',_0x363fa4['text'],_0x363fa4[_0x70ba('0x86')]||_0x70ba('0x5d'))[_0x70ba('0x18')](function(_0x374ed7){_0x5e2822(null,_0x374ed7);})[_0x70ba('0x14')](function(_0x130029){_0x5e2822(_0x130029);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x87')]=function(_0x152fdb,_0x26c4a7){scripts[_0x70ba('0x87')](this[_0x70ba('0x10')][_0x70ba('0x39')],_0x152fdb[_0x70ba('0x84')],_0x152fdb[_0x70ba('0x88')],_0x152fdb['aws_lex_region'],_0x152fdb[_0x70ba('0x5d')],_0x152fdb[_0x70ba('0x89')])[_0x70ba('0x18')](function(_0x5441f9){_0x26c4a7(null,_0x5441f9);})[_0x70ba('0x14')](function(_0x2fbf2b){_0x26c4a7(_0x2fbf2b);});};AGIVertices['prototype'][_0x70ba('0x8a')]=function(_0x490b96,_0x4cf238,_0xb13413){scripts['googleASR'](_0x4cf238,_0x490b96[_0x70ba('0x76')],_0x490b96['google_asr_language']||_0x70ba('0x5f'))[_0x70ba('0x18')](function(_0x3386fd){_0xb13413(null,_0x3386fd);})[_0x70ba('0x14')](function(_0x365faf){_0xb13413(_0x365faf);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x8b')]=function(_0x360b23,_0x5a1e70,_0x541fb6){scripts[_0x70ba('0x8b')](_0x5a1e70,_0x360b23['appid'],_0x360b23[_0x70ba('0x8c')],_0x360b23[_0x70ba('0x8d')])[_0x70ba('0x18')](function(_0x1359cc){_0x541fb6(null,_0x1359cc);})[_0x70ba('0x14')](function(_0xa0e34d){_0x541fb6(_0xa0e34d);});};AGIVertices[_0x70ba('0x15')][_0x70ba('0x8e')]=function(_0x1e537b){var _0x5ebb9a=_['includes'](verticesWithRetry,_0x1e537b['agicommand'])?_0x1e537b:_[_0x70ba('0x8f')](_0x1e537b);for(var _0x556c20 in _0x5ebb9a){if(_0x5ebb9a[_0x70ba('0x90')](_0x556c20)){if(_0x5ebb9a[_0x556c20]&&_[_0x70ba('0x91')](_0x5ebb9a[_0x556c20])){if(_[_0x70ba('0x92')](recursiveMapAttributes,_0x556c20)){_0x5ebb9a[_0x556c20]=this['replaceObjectAllVariables'](_0x5ebb9a[_0x556c20]);}else{_0x5ebb9a[_0x556c20]=this[_0x70ba('0x93')](_0x5ebb9a[_0x556c20]);}}}}return _0x5ebb9a;};AGIVertices[_0x70ba('0x15')][_0x70ba('0x94')]=function(_0x363aad){for(var _0x21dff6 in _0x363aad){if(_0x363aad[_0x70ba('0x90')](_0x21dff6)){if(_['isPlainObject'](_0x363aad[_0x21dff6])){this['recursiveNodeIndex'](_0x363aad[_0x21dff6]);}else if(_[_0x70ba('0x95')](_0x363aad[_0x21dff6])){for(var _0x4302e6=0x0;_0x4302e6<_0x363aad[_0x21dff6]['length'];_0x4302e6++){this[_0x70ba('0x94')](_0x363aad[_0x21dff6][_0x4302e6]);}}else if(_['isString'](_0x363aad[_0x21dff6])){_0x363aad[_0x21dff6]=this[_0x70ba('0x93')](_0x363aad[_0x21dff6]);}}}};AGIVertices[_0x70ba('0x15')]['saveRestApiResult']=function(_0x3b3c28,_0x1dc7db){for(var _0x814ec6 in _0x3b3c28){if(_0x3b3c28[_0x70ba('0x90')](_0x814ec6)){if(_['isPlainObject'](_0x3b3c28[_0x814ec6])){if(!_[_0x70ba('0x47')](_0x3b3c28[_0x814ec6])){this[_0x70ba('0x96')](_0x3b3c28[_0x814ec6],util[_0x70ba('0x2c')](_0x70ba('0x97'),_0x1dc7db,_0x814ec6));}}else if(_['isArray'](_0x3b3c28[_0x814ec6])){for(var _0x10acf1=0x0;_0x10acf1<_0x3b3c28[_0x814ec6][_0x70ba('0x98')];_0x10acf1++){this[_0x70ba('0x96')](_0x3b3c28[_0x814ec6][_0x10acf1],util[_0x70ba('0x2c')]('%s.%s',_0x1dc7db,_0x814ec6+'['+_0x10acf1+']'));}}else{if(!_['isNil'](_0x3b3c28[_0x814ec6])){this[_0x70ba('0x10')][_0x70ba('0x99')](util['format'](_0x70ba('0x97'),_0x1dc7db,_0x814ec6),_0x3b3c28[_0x814ec6]);}}}}};AGIVertices[_0x70ba('0x15')][_0x70ba('0x9a')]=function(_0xcdd6c4){try{var _0x2cfbd8=JSON[_0x70ba('0x6a')](_0xcdd6c4);this[_0x70ba('0x94')](_0x2cfbd8);return JSON[_0x70ba('0x6f')](_0x2cfbd8);}catch(_0x1536d6){return this[_0x70ba('0x93')](_0xcdd6c4);}};AGIVertices[_0x70ba('0x15')][_0x70ba('0x93')]=function(_0x1d90be){var _0xa83ff8=_0x1d90be[_0x70ba('0x9b')]('{');for(var _0x203622=0x1;_0x203622<_0xa83ff8[_0x70ba('0x98')];_0x203622+=0x1){var _0x53e87f=_0xa83ff8[_0x203622][_0x70ba('0x9b')]('}');if(_0x53e87f[_0x70ba('0x98')]>0x1){_0x1d90be=_0x1d90be[_0x70ba('0x9c')]('{'+_0x53e87f[0x0]+'}',this[_0x70ba('0x10')][_0x70ba('0x12')](_0x53e87f[0x0])[_0x70ba('0x9d')]||_0x53e87f[0x0]);}}if(_0xa83ff8[_0x70ba('0x98')]===0x1){return _0x1d90be['toString']();}return this['replaceAllVariables'](_0x1d90be);};AGIVertices[_0x70ba('0x15')]['getAndSetVariable']=function(_0x18db80,_0x1a23d9){var _0x12329d=this[_0x70ba('0x10')][_0x70ba('0x12')](_0x18db80);if(_0x12329d[_0x70ba('0x9e')]===-0x1){return _0x12329d;}logger[_0x70ba('0x30')](util['format'](_0x70ba('0x9f'),_0x1a23d9,_0x12329d[_0x70ba('0x9d')]));return this[_0x70ba('0x10')][_0x70ba('0x99')](_0x1a23d9,_0x12329d[_0x70ba('0x9d')]);};AGIVertices[_0x70ba('0x15')]['isConfigured']=function(_0x610164){return _0x610164&&_0x610164!=='0'&&_0x610164!=='-1'&&_0x610164!=='';};AGIVertices[_0x70ba('0x15')][_0x70ba('0xa0')]=function(_0x408378){this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x408378,'-');_0x408378[_0x70ba('0xa1')]=_0x408378['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x70ba('0xa2')]=function(_0x312626){logger['info'](util[_0x70ba('0x2c')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x312626[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x312626[_0x70ba('0x5d')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xa4'));}var _0x375b6d='\x22'+_0x312626[_0x70ba('0x5d')]+'\x22';if(this[_0x70ba('0x81')](_0x312626['options'])){_0x375b6d+=','+_0x312626[_0x70ba('0x74')];}var _0x237d3b=this[_0x70ba('0x10')]['exec'](_0x70ba('0xa5'),_0x375b6d);if(_0x237d3b[_0x70ba('0x9e')]===-0x1){return _0x237d3b;}return this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xa6'),_0x375b6d));};AGIVertices[_0x70ba('0x15')][_0x70ba('0xa7')]=function(_0x3016dd){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xa8'),_0x3016dd[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x3016dd[_0x70ba('0xa9')])){return this[_0x70ba('0x10')]['noop'](_0x70ba('0xaa'));}var _0x491471=_0x3016dd[_0x70ba('0xa9')];if(this[_0x70ba('0x81')](_0x3016dd['options'])){_0x491471+=','+_0x3016dd['options'];}var _0x5e5e6b=this[_0x70ba('0x10')][_0x70ba('0x58')](_0x70ba('0xab'),_0x491471);if(_0x5e5e6b[_0x70ba('0x9e')]===-0x1){return _0x5e5e6b;}var _0x226f09=this['getAndSetVariable']('RECOG_CONFIDENCE()',_0x70ba('0xac'));if(_0x226f09['result']===-0x1){return _0x226f09;}var _0xb1be95=this[_0x70ba('0xad')](_0x70ba('0xae'),_0x70ba('0xaf'));if(_0xb1be95[_0x70ba('0x9e')]===-0x1){return _0xb1be95;}var _0x6b82ab=this[_0x70ba('0xad')](_0x70ba('0xb0'),_0x70ba('0xb1'));if(_0x6b82ab[_0x70ba('0x9e')]===-0x1){return _0x6b82ab;}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xb2'),_0x491471));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x7')]=function(_0x569c8a){logger[_0x70ba('0x30')](util['format'](_0x70ba('0xb3'),_0x569c8a['label']));return this[_0x70ba('0x10')][_0x70ba('0x7')]([_0x569c8a['command'],_0x569c8a[_0x70ba('0xb4')]]);};AGIVertices[_0x70ba('0x15')][_0x70ba('0xb5')]=function(_0x2e6661){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xb6'),_0x2e6661[_0x70ba('0x3a')]));if(this[_0x70ba('0x81')](_0x2e6661[_0x70ba('0x66')])){logger[_0x70ba('0x30')](util['format'](_0x70ba('0xb7'),_0x2e6661[_0x70ba('0x66')]));var _0x1e1133=this['channel'][_0x70ba('0xb8')](_0x2e6661['timeout']);if(_0x1e1133[_0x70ba('0x9e')]===-0x1){return _0x1e1133;}}return this['channel'][_0x70ba('0xb5')]();};AGIVertices[_0x70ba('0x15')][_0x70ba('0x4b')]=function(_0x264058){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xb9'),_0x264058[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x264058[_0x70ba('0xba')])){return this['channel']['error'](_0x264058,'no\x20list\x20selected');}_0x264058[_0x70ba('0x4d')]=moment();if(this[_0x70ba('0x81')](_0x264058[_0x70ba('0xbb')])){_0x264058[_0x70ba('0x4d')]=moment()['add'](_0x264058[_0x70ba('0xbb')],_0x70ba('0xbc'));}if(!this[_0x70ba('0x81')](_0x264058[_0x70ba('0x4e')])){_0x264058['callback_priority']=0x2;}this[_0x70ba('0x46')][_0x70ba('0x6d')](this,_0x264058);return this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x264058[_0x70ba('0x4a')],_0x264058['list_id'],_0x264058[_0x70ba('0x4d')]));};AGIVertices[_0x70ba('0x15')][_0x70ba('0xbd')]=function(_0x43b8d4){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0xbe'),_0x43b8d4[_0x70ba('0x3a')]));var _0x357fc2=this[_0x70ba('0x10')]['exec'](_0x43b8d4[_0x70ba('0xbf')],_0x43b8d4[_0x70ba('0x74')]);if(_0x357fc2['result']===-0x1){return _0x357fc2;}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xc0'),_0x43b8d4[_0x70ba('0xbf')],_0x43b8d4['options']));};AGIVertices[_0x70ba('0x15')]['lumenvoxtts']=function(_0x5a22b1){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5a22b1[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x5a22b1['text'])){return this['channel'][_0x70ba('0xa3')]('no\x20text\x20configured');}var _0x5f5831='\x22'+_0x5a22b1[_0x70ba('0x5d')]+'\x22';if(this[_0x70ba('0x81')](_0x5a22b1[_0x70ba('0x74')])){_0x5f5831+=','+_0x5a22b1['options'];}var _0x29e322=this[_0x70ba('0x10')][_0x70ba('0x58')](_0x70ba('0xa5'),_0x5f5831);if(_0x29e322[_0x70ba('0x9e')]===-0x1){return _0x29e322;}return this['channel'][_0x70ba('0xa3')](util['format'](_0x70ba('0xa6'),_0x5f5831));};AGIVertices[_0x70ba('0x15')]['sestektts']=function(_0x4fb1f0){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xc1'),_0x4fb1f0[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x4fb1f0[_0x70ba('0x5d')])){return this['channel'][_0x70ba('0xa3')](_0x70ba('0xa4'));}var _0x29b478='\x22'+_0x4fb1f0[_0x70ba('0x5d')]+'\x22';if(this[_0x70ba('0x81')](_0x4fb1f0[_0x70ba('0x74')])){_0x29b478+=','+_0x4fb1f0['options'];}var _0xd4eb4e=this[_0x70ba('0x10')][_0x70ba('0x58')](_0x70ba('0xa5'),_0x29b478);if(_0xd4eb4e['result']===-0x1){return _0xd4eb4e;}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xa6'),_0x29b478));};AGIVertices[_0x70ba('0x15')]['lumenvoxasr']=function(_0x3cefff){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xc2'),_0x3cefff[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x3cefff[_0x70ba('0xa9')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xaa'));}var _0x4f9305=_0x3cefff['grammar'];if(this[_0x70ba('0x81')](_0x3cefff[_0x70ba('0x74')])){_0x4f9305+=','+_0x3cefff['options'];}var _0x55c471=this[_0x70ba('0x10')][_0x70ba('0x58')](_0x70ba('0xab'),_0x4f9305);if(_0x55c471['result']===-0x1){return _0x55c471;}var _0x138ae3=this['getAndSetVariable'](_0x70ba('0xc3'),_0x70ba('0xc4'));if(_0x138ae3[_0x70ba('0x9e')]===-0x1){return _0x138ae3;}var _0x1ea5b8=this[_0x70ba('0xad')](_0x70ba('0xae'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x1ea5b8[_0x70ba('0x9e')]===-0x1){return _0x1ea5b8;}var _0x5be21f=this[_0x70ba('0xad')](_0x70ba('0xb0'),_0x70ba('0xc5'));if(_0x5be21f[_0x70ba('0x9e')]===-0x1){return _0x5be21f;}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xb2'),_0x4f9305));};AGIVertices[_0x70ba('0x15')][_0x70ba('0xc6')]=function(_0xd1f4fc){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xc7'),_0xd1f4fc[_0x70ba('0x3a')]));if(!this['isConfigured'](_0xd1f4fc['grammar'])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xaa'));}var _0x34e82d=_0xd1f4fc[_0x70ba('0xa9')];if(this[_0x70ba('0x81')](_0xd1f4fc[_0x70ba('0x74')])){_0x34e82d+=','+_0xd1f4fc[_0x70ba('0x74')];}var _0x88e63d=this[_0x70ba('0x10')]['exec'](_0x70ba('0xab'),_0x34e82d);if(_0x88e63d[_0x70ba('0x9e')]===-0x1){return _0x88e63d;}var _0x1bdae4=this[_0x70ba('0xad')](_0x70ba('0xc3'),_0x70ba('0xc8'));if(_0x1bdae4[_0x70ba('0x9e')]===-0x1){return _0x1bdae4;}var _0x1d7db7=this[_0x70ba('0xad')](_0x70ba('0xae'),_0x70ba('0xc9'));if(_0x1d7db7[_0x70ba('0x9e')]===-0x1){return _0x1d7db7;}var _0x1f9bfc=this[_0x70ba('0xad')]('RECOG_INSTANCE()',_0x70ba('0xca'));if(_0x1f9bfc[_0x70ba('0x9e')]===-0x1){return _0x1f9bfc;}return this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0xb2'),_0x34e82d));};AGIVertices[_0x70ba('0x15')][_0x70ba('0xcb')]=function(_0x43a456){logger['info'](util['format'](_0x70ba('0xcc'),_0x43a456[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x43a456[_0x70ba('0xcd')])){return this[_0x70ba('0x10')]['error'](_0x43a456,_0x70ba('0xce'));}var _0x3ab9d8=this[_0x70ba('0x1c')]['sync'](this,_0x43a456[_0x70ba('0xcd')]);if(!_0x3ab9d8){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x43a456,_0x70ba('0xcf'));}if(!this['isConfigured'](_0x43a456[_0x70ba('0x32')])){return this['channel']['error'](_0x43a456,_0x70ba('0xd0'));}var _0x3d10d8=_0x43a456[_0x70ba('0x32')][_0x70ba('0x5a')](/(\r\n|\n|\r)/gm,'\x20');this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xd1'),_0x3d10d8));var _0x5c0407=this[_0x70ba('0xd2')][_0x70ba('0x6d')](this,_0x3ab9d8,_0x3d10d8);this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x43a456,_0x3d10d8);if(!this['isConfigured'](_0x43a456[_0x70ba('0xd3')])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4eb230=this[_0x70ba('0x12')][_0x70ba('0x6d')](this,_0x43a456['variable_id']);if(!_0x4eb230){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x43a456,_0x70ba('0xd4'));}var _0x36f3ed=this;_0x5c0407[_0x70ba('0xd5')](function(_0x217f66,_0x5d0ac3){Object[_0x70ba('0xd6')](_0x217f66)[_0x70ba('0xd5')](function(_0x39ea4d){_0x36f3ed[_0x70ba('0x10')]['setVariable'](util['format'](_0x70ba('0xd7'),_0x4eb230,_0x5d0ac3,_0x39ea4d),_0x217f66[_0x39ea4d]);});});this[_0x70ba('0x10')][_0x70ba('0x99')](util[_0x70ba('0x2c')](_0x70ba('0xd8'),_0x4eb230),_0x5c0407['length']);return this['channel'][_0x70ba('0xa3')](util['format']('variable\x20%s\x20set',_0x4eb230));};AGIVertices[_0x70ba('0x15')][_0x70ba('0xd9')]=function(_0x1e0375){logger['debug'](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x1e0375[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x1e0375[_0x70ba('0xda')])){return this[_0x70ba('0x10')]['error'](_0x1e0375,'no\x20user\x20selected');}var _0x4eed89=this[_0x70ba('0x1f')]['sync'](this,_0x1e0375['sip_id']);if(!_0x4eed89){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x1e0375,'no\x20user\x20found');}var _0x4909d3=this[_0x70ba('0x10')][_0x70ba('0x58')](_0x70ba('0xdb'),[util['format'](_0x70ba('0xdc'),_0x4eed89),_0x1e0375[_0x70ba('0x66')],_0x1e0375['opts'],_0x1e0375['url']]);if(_0x4909d3[_0x70ba('0x9e')]===-0x1){return _0x4909d3;}return this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xdd'),'DIAL'));};AGIVertices[_0x70ba('0x15')][_0x70ba('0xde')]=function(_0xed07e2){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xdf'),_0xed07e2[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0xed07e2[_0x70ba('0x76')])){return this['channel'][_0x70ba('0xa3')]('no\x20key\x20configured');}if(!this[_0x70ba('0x81')](_0xed07e2['text'])){return this['channel']['noop'](_0x70ba('0xa4'));}this[_0x70ba('0x10')][_0x70ba('0xe0')]=!![];this[_0x70ba('0x38')](_0xed07e2);this[_0x70ba('0x45')](_0xed07e2[_0x70ba('0x5d')],'in','','');this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0xe1'),_0xed07e2[_0x70ba('0x5d')]));var _0x401556=this['googleDialogflow'][_0x70ba('0x6d')](this,_0xed07e2);if(_0x401556){for(var _0x1a63b7 in _0x401556){if(_0x401556[_0x70ba('0x90')](_0x1a63b7)){this[_0x70ba('0x10')]['setVariable'](util[_0x70ba('0x2c')](_0x70ba('0xe2'),_0x1a63b7[_0x70ba('0xe3')]()),_0x401556[_0x1a63b7]);}}this['createSquareMessage'](_0x401556[_0x70ba('0xe4')],_0x70ba('0xe5'),_0x70ba('0xde'),'');return this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')]('Dialogflow\x20Result\x20%s',_0x401556[_0x70ba('0xe4')]));}return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0xed07e2,_0x70ba('0xe6'));};AGIVertices['prototype'][_0x70ba('0xe7')]=function(_0x11efa8){logger[_0x70ba('0x30')](util['format'](_0x70ba('0xe8'),_0x11efa8[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x11efa8[_0x70ba('0x79')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xe9'));}if(!this[_0x70ba('0x81')](_0x11efa8[_0x70ba('0xea')])){return this['channel'][_0x70ba('0xa3')]('no\x20client_email\x20configured');}if(!this[_0x70ba('0x81')](_0x11efa8[_0x70ba('0xeb')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xec'));}if(!this[_0x70ba('0x81')](_0x11efa8[_0x70ba('0x7a')])){return this['channel']['noop'](_0x70ba('0xed'));}if(!this[_0x70ba('0x81')](_0x11efa8[_0x70ba('0x5d')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')]('no\x20text\x20configured');}this[_0x70ba('0x10')]['bot']=!![];this['createSquareDetailsReport'](_0x11efa8);this[_0x70ba('0x45')](_0x11efa8[_0x70ba('0x5d')],'in','','');this['channel'][_0x70ba('0xa3')](util['format'](_0x70ba('0xee'),_0x11efa8[_0x70ba('0x5d')]));var _0x29fd70=this['googleDialogflowV2'][_0x70ba('0x6d')](this,_0x11efa8);if(_0x29fd70){for(var _0x32b3b9 in _0x29fd70){if(_0x29fd70[_0x70ba('0x90')](_0x32b3b9)){if(_0x32b3b9!==_0x70ba('0xef')){this[_0x70ba('0x10')][_0x70ba('0x99')](util['format']('DIALOGFLOW_%s',_0x32b3b9[_0x70ba('0xe3')]()),_0x29fd70[_0x32b3b9]);}}}this[_0x70ba('0x45')](_0x29fd70[_0x70ba('0xe4')],_0x70ba('0xe5'),_0x70ba('0xe7'),_0x29fd70[_0x70ba('0xef')]);return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')]('DialogflowV2\x20Result\x20%s',_0x29fd70[_0x70ba('0xe4')]));}return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x11efa8,_0x70ba('0xf0'));};AGIVertices[_0x70ba('0x15')][_0x70ba('0xf1')]=function(_0x1c0bfa){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0xf2'),_0x1c0bfa[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x1c0bfa[_0x70ba('0xf3')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xf4'));}if(!this[_0x70ba('0x81')](_0x1c0bfa[_0x70ba('0xf5')])){return this['channel']['noop'](_0x70ba('0xf6'));}if(!this[_0x70ba('0x81')](_0x1c0bfa[_0x70ba('0xf7')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xf8'));}if(!this[_0x70ba('0x81')](_0x1c0bfa['ndassistant_url'])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xa4'));}this[_0x70ba('0x10')][_0x70ba('0xe0')]=!![];this[_0x70ba('0x38')](_0x1c0bfa);this[_0x70ba('0x45')](_0x1c0bfa[_0x70ba('0x5d')],'in','','');this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format']('Trying\x20SestekNDA:\x20%s',_0x1c0bfa[_0x70ba('0x5d')]));var _0x652fe7=this[_0x70ba('0x7b')][_0x70ba('0x6d')](this,_0x1c0bfa);if(_0x652fe7){for(var _0x2b08c9 in _0x652fe7){if(_0x652fe7[_0x70ba('0x90')](_0x2b08c9)){this[_0x70ba('0x10')][_0x70ba('0x99')](util[_0x70ba('0x2c')](_0x70ba('0xf9'),_0x2b08c9['toUpperCase']()),_0x652fe7[_0x2b08c9]);}}this[_0x70ba('0x45')](_0x652fe7[_0x70ba('0xe4')],_0x70ba('0xe5'),_0x70ba('0xf1'),'');if(_0x652fe7['audiofile']){this['channel'][_0x70ba('0xa3')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x652fe7[_0x70ba('0xfa')]));var _0x1232b9=this['channel']['streamFile'](_0x652fe7[_0x70ba('0xfa')]);try{fs[_0x70ba('0xfb')](_0x652fe7[_0x70ba('0xfa')]+_0x70ba('0xfc'));}catch(_0x8d2d41){logger[_0x70ba('0x2f')](_0x8d2d41);}return _0x1232b9;}else{return this['channel']['noop'](util[_0x70ba('0x2c')](_0x70ba('0xfd'),_0x652fe7['speech']));}}return this['channel'][_0x70ba('0x2f')](_0x1c0bfa,_0x70ba('0xfe'));};AGIVertices['prototype']['end']=function(_0x3f65c3){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0xff'),_0x3f65c3['label']));return this[_0x70ba('0x10')]['noop'](_0x70ba('0x100'));};AGIVertices['prototype'][_0x70ba('0x101')]=function(_0xe2926f){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0xe2926f[_0x70ba('0x3a')]));var _0x48014f='';if(_0xe2926f[_0x70ba('0x102')]){if(!this[_0x70ba('0x81')](_0xe2926f[_0x70ba('0x102')])){return this['channel']['error'](_0xe2926f,'no\x20trunk\x20selected');}else{var _0x7a9fdf=parseInt(_0xe2926f['trunk_id'],0xa);if(isNaN(_0x7a9fdf)){_0x48014f=_0xe2926f[_0x70ba('0x102')];}else{_0x48014f=this[_0x70ba('0x103')][_0x70ba('0x6d')](this,_0xe2926f[_0x70ba('0x102')]);if(!_0x48014f){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0xe2926f,_0x70ba('0x104'));}}}}else if(_0xe2926f[_0x70ba('0x105')]){_0x48014f=_0xe2926f[_0x70ba('0x105')];}else{return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0xe2926f,_0x70ba('0x106'));}var _0x24ae91=this[_0x70ba('0x10')]['exec'](_0x70ba('0xdb'),[util[_0x70ba('0x2c')](_0x70ba('0x107'),_0x48014f,_0xe2926f[_0x70ba('0x4a')]),_0xe2926f[_0x70ba('0x66')],_0xe2926f[_0x70ba('0x108')],_0xe2926f['url']]);if(_0x24ae91[_0x70ba('0x9e')]===-0x1){return _0x24ae91;}return this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0xdd'),_0x70ba('0xdb')));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x109')]=function(_0x473f0f){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x10a'),_0x473f0f[_0x70ba('0x3a')]));return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x109'));};AGIVertices[_0x70ba('0x15')]['getdigits']=function(_0x19459b){logger['info'](util['format'](_0x70ba('0x10b'),_0x19459b['label']));if(_0x19459b[_0x70ba('0xa1')]===0x0){return this[_0x70ba('0xa0')](_0x19459b);}_0x19459b[_0x70ba('0xa1')]-=0x1;if(!this[_0x70ba('0x81')](_0x19459b[_0x70ba('0x10c')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x19459b,_0x70ba('0x10d'));}var _0x2742fe=this[_0x70ba('0x22')][_0x70ba('0x6d')](this,_0x19459b['file_id']);if(!_0x2742fe){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x19459b,_0x70ba('0x10e'));}if(!this['isConfigured'](_0x19459b[_0x70ba('0xd3')])){return this['channel']['error'](_0x70ba('0x10f'));}var _0x330f9f=this[_0x70ba('0x10')]['getData'](_0x2742fe,_0x19459b[_0x70ba('0x110')],_0x19459b[_0x70ba('0x111')]);var _0x3c0a25=_0x330f9f[_0x70ba('0x9e')]?_0x330f9f['result'][_0x70ba('0x112')]():'';logger[_0x70ba('0x30')](_0x70ba('0x113'),JSON['stringify'](_0x330f9f));if(_0x330f9f[_0x70ba('0x9e')]===-0x1){this[_0x70ba('0x38')]['sync'](this,_0x19459b,_0x3c0a25);return _0x330f9f;}else if(_0x330f9f[_0x70ba('0x9d')]==='timeout'){_0x330f9f['result']=_0x3c0a25[_0x70ba('0x98')]>=parseInt(_0x19459b['mindigit'])?'x':'i';}else{_0x330f9f[_0x70ba('0x9e')]=_0x3c0a25[_0x70ba('0x98')]>=parseInt(_0x19459b[_0x70ba('0x114')])&&_0x3c0a25[_0x70ba('0x98')]<=parseInt(_0x19459b[_0x70ba('0x111')])?'x':'i';}var _0x46fc83=this['getVariable'][_0x70ba('0x6d')](this,_0x19459b[_0x70ba('0xd3')]);if(!_0x46fc83){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x19459b,'no\x20variable\x20found');}this[_0x70ba('0x10')][_0x70ba('0x99')](_0x46fc83,_0x3c0a25);if(this['isConfigured'](_0x19459b['hiddendigitsnum'])){var _0x1cecde=parseInt(_0x19459b[_0x70ba('0x115')],0xa);var _0x344d78=rs['generate']({'charset':'*','length':_0x1cecde});var _0x316cdf=_0x3c0a25['length'];if(_0x316cdf>0x0){if(_0x316cdf>_0x1cecde){this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x19459b,_0x19459b['hiddendigitspos']===_0x70ba('0x116')?_0x344d78+_0x3c0a25[_0x70ba('0x117')](_0x1cecde):_0x3c0a25['substr'](0x0,_0x316cdf-_0x1cecde)+_0x344d78);}else{this['createSquareDetailsReport']['sync'](this,_0x19459b,rs['generate']({'charset':'*','length':_0x316cdf}));}}else{this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x19459b,'');}}else{this[_0x70ba('0x38')]['sync'](this,_0x19459b,_0x3c0a25);}return _0x330f9f;};AGIVertices[_0x70ba('0x15')]['getsecretdigits']=function(_0x34649b){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x118'),_0x34649b[_0x70ba('0x3a')]));return this['getdigits'](_0x34649b);};AGIVertices[_0x70ba('0x15')]['goal']=function(_0x5567ce){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x119'),_0x5567ce[_0x70ba('0x3a')]));this['createSquareDetailsReport'][_0x70ba('0x6d')](this,_0x5567ce,_0x5567ce[_0x70ba('0x11a')]);return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x11b'),_0x5567ce[_0x70ba('0x11a')]));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x11c')]=function(_0x33ef13){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x11d'),_0x33ef13[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x33ef13[_0x70ba('0x84')])||!this['isConfigured'](_0x33ef13[_0x70ba('0x88')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')]('no\x20valid\x20credentials\x20configured');}if(!this[_0x70ba('0x81')](_0x33ef13[_0x70ba('0x5d')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')]('no\x20text\x20configured');}this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x11e'),_0x33ef13[_0x70ba('0x5d')]));var _0x1c47c0=this['awsPolly'][_0x70ba('0x6d')](this,_0x33ef13);if(_0x1c47c0){this[_0x70ba('0x10')]['noop'](util['format']('aws\x20Polly\x20%s\x20file\x20created',_0x1c47c0));var _0xb8eda0=this['channel'][_0x70ba('0x11f')](_0x1c47c0);try{fs['unlink'](_0x1c47c0+'.wav');}catch(_0x2e49be){logger[_0x70ba('0x2f')](_0x2e49be);}return _0xb8eda0;}return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x33ef13,_0x70ba('0x120'));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x121')]=function(_0x3f736a){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x122'),_0x3f736a[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x3f736a[_0x70ba('0x84')])||!this[_0x70ba('0x81')](_0x3f736a[_0x70ba('0x88')])){return this['channel']['noop'](_0x70ba('0x123'));}if(!this['isConfigured'](_0x3f736a[_0x70ba('0x89')])){return this[_0x70ba('0x10')]['noop'](_0x70ba('0x124'));}if(!this[_0x70ba('0x81')](_0x3f736a[_0x70ba('0x5d')])){return this[_0x70ba('0x10')]['noop'](_0x70ba('0xa4'));}this[_0x70ba('0x10')][_0x70ba('0xe0')]=!![];this[_0x70ba('0x38')](_0x3f736a);this['createSquareMessage'](_0x3f736a[_0x70ba('0x5d')],'in','','');this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x125'),_0x3f736a[_0x70ba('0x5d')]));var _0x3637a7=this['awsLex'][_0x70ba('0x6d')](this,_0x3f736a);if(_0x3637a7){for(var _0x4912cb in _0x3637a7){if(_0x3637a7[_0x70ba('0x90')](_0x4912cb)&&_[_0x70ba('0x91')](_0x3637a7[_0x4912cb])){this[_0x70ba('0x10')][_0x70ba('0x99')](util['format']('AWS_LEX_%s',_0x4912cb[_0x70ba('0xe3')]()),_0x3637a7[_0x4912cb]);}}if(_[_0x70ba('0x48')](_0x3637a7[_0x70ba('0x72')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x70ba('0x45')](_0x3637a7[_0x70ba('0x72')],_0x70ba('0xe5'),_0x70ba('0x126'),'');return this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0x127'),_0x3637a7[_0x70ba('0x72')]));}}return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x3f736a,_0x70ba('0x128'));};AGIVertices['prototype'][_0x70ba('0x129')]=function(_0x2be697){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x12a'),_0x2be697[_0x70ba('0x3a')],_0x2be697[_0x70ba('0x66')]));if(!this[_0x70ba('0x81')](_0x2be697[_0x70ba('0x76')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x12b'));}var _0x27c559=_0x70ba('0x12c');var _0x5996f8=util[_0x70ba('0x2c')]('%s/recordings/%s',FILES_PATH,rs[_0x70ba('0x12d')](0x4));var _0x1c3dca=util['format']('%s.%s',_0x5996f8,_0x27c559);var _0x5a3c96=!![];if(_0x2be697[_0x70ba('0x12e')]==='NOBEEP'){_0x5a3c96=![];}var _0xea2416=this[_0x70ba('0x10')][_0x70ba('0x12f')](_0x5996f8,_0x27c559,_0x2be697['intKey'],_0x2be697['timeout'],undefined,_0x5a3c96);if(_0xea2416[_0x70ba('0x9e')]!==-0x1){this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x130'),_0x1c3dca));var _0x27a850=this[_0x70ba('0x8a')][_0x70ba('0x6d')](this,_0x2be697,_0x1c3dca);if(_0x27a850){for(var _0x43e2a7 in _0x27a850){if(_0x27a850[_0x70ba('0x90')](_0x43e2a7)){this['channel']['setVariable'](util[_0x70ba('0x2c')](_0x70ba('0x131'),_0x43e2a7[_0x70ba('0xe3')]()),_0x27a850[_0x43e2a7]);}}return this['channel'][_0x70ba('0xa3')](util['format'](_0x70ba('0x132'),JSON[_0x70ba('0x6f')](_0x27a850)));}}return _0xea2416;};AGIVertices['prototype'][_0x70ba('0x133')]=function(_0x255d7e){logger[_0x70ba('0x30')](util['format'](_0x70ba('0x134'),_0x255d7e[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x255d7e[_0x70ba('0x135')])){return this[_0x70ba('0x10')]['noop'](_0x70ba('0x136'));}if(!this[_0x70ba('0x81')](_0x255d7e[_0x70ba('0x8c')])){return this['channel'][_0x70ba('0xa3')](_0x70ba('0x137'));}var _0x5a36df='wav';var _0x5b2da3=util[_0x70ba('0x2c')](_0x70ba('0x138'),FILES_PATH,rs[_0x70ba('0x12d')](0x4));var _0x4cbd35=util[_0x70ba('0x2c')]('%s.%s',_0x5b2da3,_0x5a36df);var _0xc333d1=!![];if(_0x255d7e[_0x70ba('0x12e')]===_0x70ba('0x139')){_0xc333d1=![];}var _0x2e2856=this['channel']['recordFile'](_0x5b2da3,_0x5a36df,_0x255d7e[_0x70ba('0x13a')],_0x255d7e[_0x70ba('0x66')],undefined,_0xc333d1);if(_0x2e2856[_0x70ba('0x9e')]!==-0x1){this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x13b'),_0x4cbd35));var _0x34589c=this['tildeASR'][_0x70ba('0x6d')](this,_0x255d7e,_0x4cbd35);if(_0x34589c){for(var _0x44d4e6 in _0x34589c){if(_0x34589c[_0x70ba('0x90')](_0x44d4e6)){this[_0x70ba('0x10')][_0x70ba('0x99')](util[_0x70ba('0x2c')](_0x70ba('0x13c'),_0x44d4e6[_0x70ba('0xe3')]()),_0x34589c[_0x44d4e6]);}}return this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0x13d'),JSON[_0x70ba('0x6f')](_0x34589c)));}}return _0x2e2856;};AGIVertices[_0x70ba('0x15')][_0x70ba('0x13e')]=function(_0x15461f){logger[_0x70ba('0x30')](util['format'](_0x70ba('0x13f'),_0x15461f[_0x70ba('0x3a')]));return this['channel'][_0x70ba('0x140')](_0x15461f[_0x70ba('0x40')],_0x15461f[_0x70ba('0x41')],_0x15461f[_0x70ba('0x141')]);};AGIVertices[_0x70ba('0x15')]['gotoif']=function(_0x3d39a9){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x142'),_0x3d39a9[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x3d39a9[_0x70ba('0x143')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x3d39a9,_0x70ba('0x144'));}try{var _0x36a943=eval(_0x3d39a9[_0x70ba('0x143')])?_0x70ba('0x145'):'false';this['channel'][_0x70ba('0xa3')](util['format'](_0x70ba('0x146'),_0x3d39a9[_0x70ba('0x143')],_0x36a943));return{'code':0xc8,'result':_0x36a943};}catch(_0x124177){return{'code':0xc8,'result':_0x70ba('0x147')};}};AGIVertices[_0x70ba('0x15')]['gotoiftime']=function(_0x4e46e3){logger['info'](util[_0x70ba('0x2c')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x4e46e3[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x4e46e3['interval_id'])){return this[_0x70ba('0x10')]['error'](_0x4e46e3,_0x70ba('0x148'));}var _0x183749=this[_0x70ba('0x28')][_0x70ba('0x6d')](this,_0x4e46e3[_0x70ba('0x149')]);if(!_0x183749){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x4e46e3,_0x70ba('0x14a'));}for(var _0x228aa5=0x0;_0x228aa5<_0x183749['length'];_0x228aa5+=0x1){var _0x291d2d=this[_0x70ba('0x10')]['getVariable'](util[_0x70ba('0x2c')]('IFTIME(%s?true:false)',_0x183749[_0x228aa5]));if(_0x291d2d[_0x70ba('0x9e')]===-0x1){return _0x291d2d;}logger['info'](util[_0x70ba('0x2c')]('IFTIME\x20%s\x20%s',_0x183749[_0x228aa5],_0x291d2d['extra']));if(_0x291d2d['extra']===_0x70ba('0x145')){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x14b'),_0x183749[_0x228aa5],_0x70ba('0x145')));this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0x14b'),_0x183749[_0x228aa5],'true'));return{'code':0xc8,'result':_0x70ba('0x145')};}else{logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x14b'),_0x183749[_0x228aa5],_0x70ba('0x147')));this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format']('IFTIME\x20%s\x20%s',_0x183749[_0x228aa5],_0x70ba('0x147')));}}return{'code':0xc8,'result':_0x70ba('0x147')};};AGIVertices[_0x70ba('0x15')]['hangup']=function(_0x5b86b0){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x14c'),_0x5b86b0[_0x70ba('0x3a')]));return this['channel']['hangup']();};AGIVertices[_0x70ba('0x15')][_0x70ba('0x14d')]=function(_0xf966b8){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x14e'),_0xf966b8[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0xf966b8[_0x70ba('0x76')])){return this['channel'][_0x70ba('0xa3')](_0x70ba('0x12b'));}var _0x14a6ec=_0x70ba('0x12c');var _0x54b253=util[_0x70ba('0x2c')](_0x70ba('0x138'),FILES_PATH,rs['generate'](0x4));var _0x148c21=util['format'](_0x70ba('0x97'),_0x54b253,_0x14a6ec);var _0x3d1cf0=!![];if(_0xf966b8[_0x70ba('0x12e')]===_0x70ba('0x139')){_0x3d1cf0=![];}var _0x2a590a=this['channel'][_0x70ba('0x12f')](_0x54b253,_0x14a6ec,_0xf966b8['intKey'],_0xf966b8['timeout'],undefined,_0x3d1cf0);if(_0x2a590a[_0x70ba('0x9e')]!==-0x1){this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format']('ispeech\x20%s\x20file\x20created',_0x148c21));var _0x3cf5a7=this['ispeechASR'][_0x70ba('0x6d')](this,_0xf966b8,_0x148c21);if(_0x3cf5a7){for(var _0x37b72b in _0x3cf5a7){if(_0x3cf5a7[_0x70ba('0x90')](_0x37b72b)){this[_0x70ba('0x10')][_0x70ba('0x99')](util[_0x70ba('0x2c')]('ISPEECH_ASR_%s',_0x37b72b[_0x70ba('0xe3')]()),_0x3cf5a7[_0x37b72b]);}}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x14f'),JSON[_0x70ba('0x6f')](_0x3cf5a7)));}}return _0x2a590a;};AGIVertices['prototype']['ispeechtts']=function(_0x36afbb){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x150'),_0x36afbb[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x36afbb[_0x70ba('0x76')])){return this['channel']['noop'](_0x70ba('0x12b'));}if(!this['isConfigured'](_0x36afbb[_0x70ba('0x5d')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')]('no\x20text\x20configured');}this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x151'),_0x36afbb[_0x70ba('0x5d')]));var _0x49293b=this[_0x70ba('0x7c')][_0x70ba('0x6d')](this,_0x36afbb);if(_0x49293b){this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')]('ispeech\x20%s\x20file\x20created',_0x49293b));var _0x3e6d49=this[_0x70ba('0x10')][_0x70ba('0x11f')](_0x49293b,_0x36afbb['intKey']);try{fs[_0x70ba('0xfb')](_0x49293b+_0x70ba('0xfc'));}catch(_0x43a5ec){logger[_0x70ba('0x2f')](_0x43a5ec);}return _0x3e6d49;}return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x36afbb,_0x70ba('0x152'));};AGIVertices['prototype'][_0x70ba('0x153')]=function(_0xf4c0f){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0xf4c0f[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0xf4c0f[_0x70ba('0x154')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0xf4c0f,_0x70ba('0x155'));}logger['info'](util['format'](_0x70ba('0x156'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0xf4c0f[_0x70ba('0x154')]));var _0x34832e=this[_0x70ba('0x56')]['sync'](this,_0xf4c0f[_0x70ba('0x154')]);if(_0x34832e){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x70ba('0x10')][_0x70ba('0x3d')],_0xf4c0f[_0x70ba('0x154')]));this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0x157'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0xf4c0f[_0x70ba('0x154')]));return{'code':0xc8,'result':_0x70ba('0x158')};}else{logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x159'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0xf4c0f[_0x70ba('0x154')]));this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0x159'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0xf4c0f[_0x70ba('0x154')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x70ba('0x15')][_0x70ba('0x15a')]=function(_0x11d626){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x15b'),_0x11d626[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x11d626[_0x70ba('0x154')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x11d626,_0x70ba('0x155'));}logger[_0x70ba('0x30')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x11d626[_0x70ba('0x154')]));var _0x481ba6=this[_0x70ba('0x15c')][_0x70ba('0x6d')](this,_0x11d626[_0x70ba('0x154')]);if(_0x481ba6){logger[_0x70ba('0x30')](util['format'](_0x70ba('0x157'),this[_0x70ba('0x10')]['callerid'],_0x11d626[_0x70ba('0x154')]));this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x11d626[_0x70ba('0x154')]));return{'code':0xc8,'result':_0x70ba('0x158')};}else{logger['info'](util[_0x70ba('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x11d626[_0x70ba('0x154')]));this['channel'][_0x70ba('0xa3')](util['format'](_0x70ba('0x159'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x11d626['findBy']));return{'code':0xc8,'result':_0x70ba('0x15d')};}};AGIVertices[_0x70ba('0x15')][_0x70ba('0x15e')]=function(_0x551a95){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x15f'),_0x551a95[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x551a95[_0x70ba('0x160')])){return this[_0x70ba('0x10')]['error'](_0x551a95,_0x70ba('0x161'));}this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x162'),_0x551a95[_0x70ba('0x160')]));var _0x40a429=eval(_0x551a95[_0x70ba('0x160')]);if(!this[_0x70ba('0x81')](_0x551a95['variable_id'])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x10f'));}var _0x5a7bb7=this[_0x70ba('0x12')][_0x70ba('0x6d')](this,_0x551a95[_0x70ba('0xd3')]);if(!_0x5a7bb7){return this['channel'][_0x70ba('0x2f')](_0x551a95,'no\x20variable\x20found');}if(_['isArray'](_0x40a429)){var _0x58f5d7=this;_0x40a429[_0x70ba('0xd5')](function(_0x223c10,_0x4bab7f){_0x58f5d7[_0x70ba('0x10')]['setVariable'](util['format'](_0x70ba('0x163'),_0x5a7bb7,_0x4bab7f),_0x223c10);});return this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x164'),_0x5a7bb7));}else{return this[_0x70ba('0x10')]['setVariable'](_0x5a7bb7,_0x40a429);}};AGIVertices[_0x70ba('0x15')][_0x70ba('0xd')]=function(_0x247767){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x247767[_0x70ba('0x3a')]));if(_0x247767['retry']===0x0){return this[_0x70ba('0xa0')](_0x247767);}_0x247767[_0x70ba('0xa1')]-=0x1;if(!this[_0x70ba('0x81')](_0x247767[_0x70ba('0x10c')])){return this[_0x70ba('0x10')]['error'](_0x247767,_0x70ba('0x10d'));}var _0x19e17f=this[_0x70ba('0x22')][_0x70ba('0x6d')](this,_0x247767[_0x70ba('0x10c')]);if(!_0x19e17f){return this['channel'][_0x70ba('0x2f')](_0x247767,_0x70ba('0x10e'));}var _0x1932a4=this[_0x70ba('0x10')][_0x70ba('0x165')](_0x19e17f,_0x247767['response'],_0x247767['digit']);var _0x2cae5f=_0x1932a4[_0x70ba('0x9e')];if(_0x1932a4['result']===-0x1){this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x247767,'-1');return _0x1932a4;}else if(_0x1932a4[_0x70ba('0x9d')]===_0x70ba('0x66')){_0x1932a4[_0x70ba('0x9e')]=_0x1932a4[_0x70ba('0x9e')]['length']>0x0?_0x1932a4[_0x70ba('0x9e')]:'t';}else if(_[_0x70ba('0x47')](_0x1932a4['result'])){_0x1932a4['result']='#';_0x2cae5f='#';}if(!this[_0x70ba('0x81')](_0x247767['variable_id'])){this['channel'][_0x70ba('0xa3')](_0x70ba('0x10f'));}else{var _0x45b259=this[_0x70ba('0x12')][_0x70ba('0x6d')](this,_0x247767[_0x70ba('0xd3')]);if(!_0x45b259){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x247767,'no\x20variable\x20found');}this[_0x70ba('0x10')][_0x70ba('0x99')](_0x45b259,_0x2cae5f);}this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x247767,_0x2cae5f);return _0x1932a4;};AGIVertices[_0x70ba('0x15')]['noop']=function(_0x3600ff){logger[_0x70ba('0x30')](util['format'](_0x70ba('0x166'),_0x3600ff[_0x70ba('0x3a')]));return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x3600ff[_0x70ba('0x167')]||_0x3600ff[_0x70ba('0x3a')]);};AGIVertices[_0x70ba('0x15')][_0x70ba('0x168')]=function(_0x249a43){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x169'),_0x249a43['label']));if(!this[_0x70ba('0x81')](_0x249a43['findBy'])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x249a43,_0x70ba('0x155'));}logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x156'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x249a43[_0x70ba('0x154')]));var _0x5b7268=this[_0x70ba('0x16a')][_0x70ba('0x6d')](this,_0x249a43[_0x70ba('0x16b')]);var _0x204f52=this[_0x70ba('0x50')]['sync'](this,_0x249a43[_0x70ba('0x154')],_0x5b7268);if(_0x204f52){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x157'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x249a43[_0x70ba('0x154')]));this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x157'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x249a43[_0x70ba('0x154')]));return{'code':0xc8,'result':'success'};}else{logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x159'),this[_0x70ba('0x10')]['callerid'],_0x249a43[_0x70ba('0x154')]));this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x157'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x249a43[_0x70ba('0x154')]));return{'code':0xc8,'result':_0x70ba('0x15d')};}};AGIVertices['prototype'][_0x70ba('0x16c')]=function(_0x48135d){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x16d'),_0x48135d[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x48135d[_0x70ba('0x10c')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x48135d,_0x70ba('0x10d'));}var _0x111c22=this[_0x70ba('0x22')][_0x70ba('0x6d')](this,_0x48135d[_0x70ba('0x10c')]);if(!_0x111c22){return this[_0x70ba('0x10')]['error'](_0x48135d,'no\x20file\x20audio\x20found');}var _0x4101f7=this[_0x70ba('0x10')][_0x70ba('0x58')](_0x70ba('0x16e'),[_0x111c22,_0x48135d[_0x70ba('0x108')]]);if(_0x4101f7[_0x70ba('0x9e')]===-0x1){return _0x4101f7;}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0x111c22));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x16f')]=function(_0x4ff4d6){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4ff4d6[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x4ff4d6[_0x70ba('0x170')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x4ff4d6,_0x70ba('0x171'));}var _0xd51ae3='';var _0x1617a4=parseInt(_0x4ff4d6[_0x70ba('0x170')],0xa);if(isNaN(_0x1617a4)){_0xd51ae3=_0x4ff4d6[_0x70ba('0x170')];}else{_0xd51ae3=this[_0x70ba('0x16')]['sync'](this,_0x4ff4d6['queue_id']);if(!_0xd51ae3){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x4ff4d6,'no\x20queue\x20found');}}var _0x1b9173='';if(this[_0x70ba('0x81')](_0x4ff4d6[_0x70ba('0x10c')])){var _0x4fa5ca=this[_0x70ba('0x22')][_0x70ba('0x6d')](this,_0x4ff4d6[_0x70ba('0x10c')]);if(_0x4fa5ca){_0x1b9173=_0x4fa5ca;}}this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x4ff4d6,_0xd51ae3);if(_0x4ff4d6[_0x70ba('0x108')][_0x70ba('0x172')]('x')<0x0){_0x4ff4d6[_0x70ba('0x108')]+='x';}if(_0x4ff4d6[_0x70ba('0x108')][_0x70ba('0x172')]('X')<0x0){_0x4ff4d6[_0x70ba('0x108')]+='X';}this[_0x70ba('0x10')]['setVariable'](_0x70ba('0x173'),_0xd51ae3?_0xd51ae3['toLowerCase']():'');var _0x24101b=this['channel'][_0x70ba('0x58')]('QUEUE',[_0xd51ae3,_0x4ff4d6[_0x70ba('0x108')],_0x4ff4d6[_0x70ba('0x174')],_0x1b9173,_0x4ff4d6[_0x70ba('0x66')],_0x4ff4d6[_0x70ba('0x7')],_0x4ff4d6[_0x70ba('0x175')],_0x4ff4d6[_0x70ba('0x176')],'',_0x4ff4d6['position']]);if(_0x24101b[_0x70ba('0x9e')]===-0x1){return _0x24101b;}return this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0xc0'),_0x70ba('0x177'),_0xd51ae3));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x178')]=function(_0x3e5a68){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x3e5a68[_0x70ba('0x3a')]));var _0x3e4e26=_0x3e5a68[_0x70ba('0x179')]||_0x70ba('0x12c');var _0x3f239d=util['format']('%s_%s',this['channel']['uniqueid'],rs[_0x70ba('0x12d')](0x5));var _0xdc0f1b=util[_0x70ba('0x2c')](_0x70ba('0x17a'),FILES_PATH,_0x3f239d,_0x3e4e26);var _0x5171fd=util[_0x70ba('0x2c')]('%s/recordings/%s',FILES_PATH,_0x3f239d);this[_0x70ba('0x3e')][_0x70ba('0x6d')](this,_0x3e5a68,_0x3f239d,_0xdc0f1b);this[_0x70ba('0x10')][_0x70ba('0x99')]('RECORDING_SAVENAME',_0x3f239d);logger[_0x70ba('0x30')](_0x70ba('0x17b'),_0x5171fd,_0x3e4e26,_0x3e5a68['escape_digits'],_0x3e5a68['timeout']);return this[_0x70ba('0x10')][_0x70ba('0x12f')](_0x5171fd,_0x3e4e26,_0x3e5a68[_0x70ba('0x17c')],_0x3e5a68[_0x70ba('0x66')],undefined,!![]);};AGIVertices[_0x70ba('0x15')]['restapi']=function(_0x5eb281){logger[_0x70ba('0x30')](util['format'](_0x70ba('0x17d'),_0x5eb281[_0x70ba('0x3a')]));if(!this['isConfigured'](_0x5eb281[_0x70ba('0x174')])){return this['channel'][_0x70ba('0xa3')](_0x70ba('0x17e'));}var _0x1f3ce8=this['restAPI'][_0x70ba('0x6d')](this,_0x5eb281);logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x17f'),util[_0x70ba('0x180')](_0x1f3ce8,{'showHidden':![],'depth':null})));if(!this[_0x70ba('0x81')](_0x5eb281['variable_id'])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x181'));}var _0x4fda0a=this[_0x70ba('0x12')]['sync'](this,_0x5eb281[_0x70ba('0xd3')]);if(!_0x4fda0a){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x5eb281,_0x70ba('0xd4'));}this[_0x70ba('0x10')][_0x70ba('0x99')](util['format'](_0x70ba('0x182'),_0x4fda0a),_0x1f3ce8[_0x70ba('0x183')]?_0x1f3ce8[_0x70ba('0x183')]:_0x70ba('0x184'));this[_0x70ba('0x10')][_0x70ba('0x99')](util[_0x70ba('0x2c')]('%s_STATUS_MESSAGE',_0x4fda0a),_0x1f3ce8[_0x70ba('0x71')]?_0x1f3ce8[_0x70ba('0x71')]:'OK');if(_0x1f3ce8[_0x70ba('0x69')]){try{this[_0x70ba('0x96')](_0x1f3ce8[_0x70ba('0x69')],_0x4fda0a);}catch(_0x2434fd){logger['error'](util[_0x70ba('0x2c')](_0x70ba('0x185'),_0x4fda0a));}}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x186'),_0x4fda0a));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x187')]=function(_0x16b083){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x188'),_0x16b083['label']));return this[_0x70ba('0x10')][_0x70ba('0x189')](_0x16b083[_0x70ba('0x18a')][_0x70ba('0x5a')](/\s+/g,''),_0x16b083[_0x70ba('0x17c')]);};AGIVertices['prototype'][_0x70ba('0x18b')]=function(_0x14e8f6){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x18c'),_0x14e8f6['label']));return this['channel'][_0x70ba('0x18d')](_0x14e8f6[_0x70ba('0x67')][_0x70ba('0x5a')](/\s+/g,''),_0x14e8f6['escape_digits']);};AGIVertices['prototype']['sayphonetic']=function(_0x486e9f){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x18e'),_0x486e9f[_0x70ba('0x3a')]));return this['channel'][_0x70ba('0x18f')](_0x486e9f[_0x70ba('0x5d')],_0x486e9f[_0x70ba('0x17c')]);};AGIVertices[_0x70ba('0x15')][_0x70ba('0x190')]=function(_0x1dc3c0){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x1dc3c0[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x1dc3c0[_0x70ba('0x191')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x192'));}var _0x293b23=this[_0x70ba('0x25')][_0x70ba('0x6d')](this,_0x1dc3c0['account_id']);if(!_0x293b23||!_0x293b23['Smtp']){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x1dc3c0,_0x70ba('0x193'));}var _0x29fbff={'from':util[_0x70ba('0x2c')](_0x70ba('0x194'),_0x293b23['name'],_0x293b23[_0x70ba('0x195')]||_0x293b23[_0x70ba('0x196')][_0x70ba('0x197')]),'to':_0x1dc3c0['to']||'','cc':_0x1dc3c0['cc']||'','bcc':_0x1dc3c0['bcc']||'','subject':_0x1dc3c0[_0x70ba('0x198')],'html':_0x1dc3c0[_0x70ba('0x5d')],'text':_0x1dc3c0[_0x70ba('0x5d')]};if(this[_0x70ba('0x81')](_0x1dc3c0[_0x70ba('0x199')])){}logger[_0x70ba('0x19a')](_0x70ba('0x19b'),JSON['stringify'](_0x29fbff));this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x1dc3c0,_0x1dc3c0['account_id']);this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format'](_0x70ba('0x19c'),_0x293b23[_0x70ba('0x19')]));this[_0x70ba('0x27')][_0x70ba('0x6d')](this,_0x293b23[_0x70ba('0x19d')],_0x29fbff);return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x19e'));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x19f')]=function(_0x4fe497){logger[_0x70ba('0x30')](util['format'](_0x70ba('0x1a0'),_0x4fe497[_0x70ba('0x3a')]));return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x1a1'));};AGIVertices['prototype'][_0x70ba('0x1a2')]=function(_0x175bf6){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x175bf6[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x175bf6['sms_account_id'])){return this[_0x70ba('0x10')][_0x70ba('0xa3')]('no\x20sms\x20account\x20configured');}var _0xff896a=this[_0x70ba('0x1a3')][_0x70ba('0x6d')](this,_0x175bf6['sms_account_id']);if(!_0xff896a){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x175bf6,_0x70ba('0x1a4'));}var _0x52fd64={'body':_0x175bf6[_0x70ba('0x1a5')],'phone':_0x175bf6['to']||'','SmsAccountId':_0xff896a['id']};logger[_0x70ba('0x19a')]('sendSMS\x20message',JSON[_0x70ba('0x6f')](_0x52fd64));this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x175bf6,_0x175bf6[_0x70ba('0x1a6')]);this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format'](_0x70ba('0x1a7'),_0xff896a[_0x70ba('0x19')]));this[_0x70ba('0x37')][_0x70ba('0x6d')](this,_0x52fd64);return this['channel']['noop'](_0x70ba('0x1a8'));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1a9')]=function(_0x4c97fc){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x1aa'),_0x4c97fc[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x4c97fc[_0x70ba('0xd3')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x4c97fc,_0x70ba('0x1ab'));}var _0x2f2c95=this['getVariable'][_0x70ba('0x6d')](this,_0x4c97fc[_0x70ba('0xd3')]);if(!_0x2f2c95){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x4c97fc,_0x70ba('0xd4'));}return this[_0x70ba('0x10')][_0x70ba('0x99')](_0x2f2c95,_0x4c97fc[_0x70ba('0x1ac')]);};AGIVertices[_0x70ba('0x15')]['start']=function(_0xea2390){logger[_0x70ba('0x30')](util['format'](_0x70ba('0x1ad'),_0xea2390[_0x70ba('0x3a')]));this[_0x70ba('0x10')]['noop'](_0x70ba('0x1ae'));var _0x5ae974=this[_0x70ba('0x10')][_0x70ba('0x12')](_0x70ba('0x1af'));if(!_['isEmpty'](_0x5ae974['extra'])){this[_0x70ba('0x10')][_0x70ba('0x39')]=_0x5ae974[_0x70ba('0x9d')];}if(_0xea2390['answer']==='yes'){this[_0x70ba('0x10')]['noop'](_0x70ba('0x1b0'));return this[_0x70ba('0x10')][_0x70ba('0xb5')]();}return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0x1b1'));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1b2')]=function(_0xbf1224){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x1b3'),_0xbf1224[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0xbf1224[_0x70ba('0x1b4')])){return this[_0x70ba('0x10')]['error'](_0xbf1224,_0x70ba('0x1b5'));}var _0x1a6410=this[_0x70ba('0x1a')][_0x70ba('0x6d')](this,_0xbf1224[_0x70ba('0x1b4')]);if(!this[_0x70ba('0x81')](_0x1a6410)){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0xbf1224,util[_0x70ba('0x2c')](_0x70ba('0x1b6'),_0xbf1224[_0x70ba('0x1b4')]));}if(_0x1a6410===this[_0x70ba('0x10')][_0x70ba('0x3c')]){return this['channel']['error'](_0xbf1224,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this['createSquareDetailsReport'][_0x70ba('0x6d')](this,_0xbf1224,_0x1a6410);var _0x5a41e1=this[_0x70ba('0x10')][_0x70ba('0x58')](_0x70ba('0x1b7'),util[_0x70ba('0x2c')](_0x70ba('0x1b8'),config['agi'][_0x70ba('0x1b9')]||_0x70ba('0x1ba'),_0x1a6410,this[_0x70ba('0x10')]['arg_1']));if(_0x5a41e1['result']===-0x1){return _0x5a41e1;}return this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0xc0'),'AGI',_0x1a6410));};AGIVertices['prototype'][_0x70ba('0x1bb')]=function(_0x53dcf7){logger['info'](util[_0x70ba('0x2c')](_0x70ba('0x1bc'),_0x53dcf7[_0x70ba('0x3a')]));var _0x5c7ca8=this[_0x70ba('0x57')][_0x70ba('0x6d')](this,_0x53dcf7['command']);this[_0x70ba('0x38')][_0x70ba('0x6d')](this,_0x53dcf7,_0x53dcf7[_0x70ba('0x1bd')]);if(this[_0x70ba('0x81')](_0x53dcf7[_0x70ba('0xd3')])){var _0x53647d=this[_0x70ba('0x12')]['sync'](this,_0x53dcf7['variable_id']);if(_0x53647d){this['channel'][_0x70ba('0x99')](_0x53647d,_0x5c7ca8);return this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x1be'),_0x53dcf7[_0x70ba('0x1bd')],_0x53647d));}}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x1bf'),_0x53dcf7[_0x70ba('0x1bd')]));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1c0')]=function(_0x4936a3){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x1c1'),_0x4936a3[_0x70ba('0x3a')]));_0x4936a3['text']=_0x4936a3[_0x70ba('0x5d')][_0x70ba('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x70ba('0x81')](_0x4936a3[_0x70ba('0x5c')])){return this[_0x70ba('0x10')]['noop'](_0x70ba('0x1c2'));}if(!this['isConfigured'](_0x4936a3[_0x70ba('0x5d')])){return this[_0x70ba('0x10')]['noop'](_0x70ba('0xa4'));}this[_0x70ba('0x10')]['noop'](util[_0x70ba('0x2c')](_0x70ba('0x1c3'),_0x4936a3[_0x70ba('0x5d')]));var _0x8b1cbe=this[_0x70ba('0x5b')][_0x70ba('0x6d')](this,_0x4936a3);if(_0x8b1cbe){this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format']('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x8b1cbe));var _0x38fa5f=this[_0x70ba('0x10')]['streamFile'](_0x8b1cbe);try{fs[_0x70ba('0xfb')](_0x8b1cbe+_0x70ba('0xfc'));}catch(_0x1af05e){logger[_0x70ba('0x2f')](_0x1af05e);}return _0x38fa5f;}return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x4936a3,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1c4')]=function(_0x1dbdca){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x1c5'),_0x1dbdca['label']));_0x1dbdca[_0x70ba('0x5d')]=_0x1dbdca[_0x70ba('0x5d')][_0x70ba('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1dbdca[_0x70ba('0x5d')])){return this[_0x70ba('0x10')][_0x70ba('0xa3')](_0x70ba('0xa4'));}this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x1c6'),_0x1dbdca[_0x70ba('0x5d')]));var _0x4306e0=this[_0x70ba('0x63')][_0x70ba('0x6d')](this,_0x1dbdca);if(_0x4306e0){this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x1c7'),_0x4306e0));var _0x1d31ce=this['channel']['streamFile'](_0x4306e0);try{fs[_0x70ba('0xfb')](_0x4306e0+'.wav');}catch(_0x4a4436){logger[_0x70ba('0x2f')](_0x4a4436);}return _0x1d31ce;}return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x1dbdca,_0x70ba('0x1c8'));};AGIVertices[_0x70ba('0x15')]['unpause']=function(_0x3cc12a){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x3cc12a[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x3cc12a[_0x70ba('0x154')])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x3cc12a,_0x70ba('0x155'));}logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x156'),this[_0x70ba('0x10')]['callerid'],_0x3cc12a[_0x70ba('0x154')]));var _0x57ae81=this[_0x70ba('0x51')][_0x70ba('0x6d')](this,_0x3cc12a[_0x70ba('0x154')]);if(_0x57ae81){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x157'),this[_0x70ba('0x10')]['callerid'],_0x3cc12a[_0x70ba('0x154')]));this[_0x70ba('0x10')][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x157'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x3cc12a[_0x70ba('0x154')]));return{'code':0xc8,'result':_0x70ba('0x158')};}else{logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x159'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x3cc12a[_0x70ba('0x154')]));this['channel'][_0x70ba('0xa3')](util[_0x70ba('0x2c')](_0x70ba('0x159'),this[_0x70ba('0x10')][_0x70ba('0x3d')],_0x3cc12a[_0x70ba('0x154')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x70ba('0x15')]['voicemail']=function(_0x11ab41){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')](_0x70ba('0x1c9'),_0x11ab41[_0x70ba('0x3a')]));var _0x131c12=this[_0x70ba('0x10')]['exec'](_0x70ba('0x1ca'),[_0x11ab41[_0x70ba('0x1cb')],_0x11ab41[_0x70ba('0x74')]]);if(_0x131c12['result']===-0x1){return _0x131c12;}return this[_0x70ba('0x10')][_0x70ba('0xa3')](util['format'](_0x70ba('0xc0'),_0x70ba('0x1ca'),_0x11ab41['mailbox']));};AGIVertices[_0x70ba('0x15')][_0x70ba('0x1cc')]=function(_0x14578f){logger[_0x70ba('0x30')](util[_0x70ba('0x2c')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x14578f[_0x70ba('0x3a')]));if(!this[_0x70ba('0x81')](_0x14578f['variable_id'])){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x14578f,_0x70ba('0x1ab'));}var _0x4ea88c=this[_0x70ba('0x12')][_0x70ba('0x6d')](this,_0x14578f[_0x70ba('0xd3')]);if(!_0x4ea88c){return this[_0x70ba('0x10')][_0x70ba('0x2f')](_0x14578f,_0x70ba('0xd4'));}var _0x550887=this['channel'][_0x70ba('0x12')](_0x4ea88c);return{'code':0xc8,'result':_0x550887[_0x70ba('0x9d')]?_0x550887[_0x70ba('0x9d')]:'-'};};String[_0x70ba('0x15')][_0x70ba('0x9c')]=function(_0x19ab44,_0xbb007c){return this['split'](_0x19ab44)[_0x70ba('0x1cd')](_0xbb007c);};module[_0x70ba('0x1ce')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 55638d6..40b5e8b 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 _0xc807=['uniqueid','then','info','catch','error','[%s][UPDATE][ERRORS:%s]','finally','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','YYYY-MM-DD\x20HH:mm:ss','message','[%s][TIMER][STOP][AGENT:%s]','pauseType','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','attended','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','../ami','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update'];(function(_0x811740,_0x470ef0){var _0x4bb1fa=function(_0x55d4b5){while(--_0x55d4b5){_0x811740['push'](_0x811740['shift']());}};_0x4bb1fa(++_0x470ef0);}(_0xc807,0x94));var _0x7c80=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xc807[_0x9aada2];return _0x196dff;};'use strict';var _=require('lodash');var moment=require('moment');var ami=require(_0x7c80('0x0'));var logger=require('../../../config/logger')(_0x7c80('0x1'));var RpcUser=require(_0x7c80('0x2'));var RpcVoiceAgentReport=require(_0x7c80('0x3'));function Acw(_0x52c6ad){this[_0x7c80('0x4')]=_0x52c6ad[_0x7c80('0x4')];this[_0x7c80('0x5')]=_0x52c6ad[_0x7c80('0x5')];this[_0x7c80('0x6')]=_0x52c6ad['timers'];this[_0x7c80('0x7')]={};ami['on']('agentconnect',this[_0x7c80('0x8')][_0x7c80('0x9')](this));ami['on'](_0x7c80('0xa'),this[_0x7c80('0xb')][_0x7c80('0x9')](this));ami['on']('hangup',this['syncHangup'][_0x7c80('0x9')](this));ami['on']('agentringnoanswer',this[_0x7c80('0xc')][_0x7c80('0x9')](this));ami['on'](_0x7c80('0xd'),this[_0x7c80('0xe')][_0x7c80('0x9')](this));ami['on']('blindtransfer',this[_0x7c80('0xf')]['bind'](this));ami['on'](_0x7c80('0x10'),this[_0x7c80('0x11')]['bind'](this));}function getDiff(_0x4e0a9c){var _0x46ac56=moment()[_0x7c80('0x12')](0x0);var _0xf9327f=moment(_0x4e0a9c)['milliseconds'](0x0);return _0x46ac56[_0x7c80('0x13')](_0xf9327f,_0x7c80('0x14'));}Acw[_0x7c80('0x15')][_0x7c80('0x16')]=function(_0xd2d0b4,_0xaa98c0){var _0x2ecbbe=this;var _0x4f500f=getDiff(_0x2ecbbe[_0x7c80('0x6')][_0xd2d0b4][_0x7c80('0x17')]);clearTimeout(_0x2ecbbe[_0x7c80('0x6')][_0xd2d0b4][_0x7c80('0x18')]);_0x2ecbbe['timers'][_0xd2d0b4][_0x7c80('0x18')]=![];return RpcVoiceAgentReport[_0x7c80('0x19')]({'acwtime':_0x4f500f},_0x2ecbbe[_0x7c80('0x6')][_0xd2d0b4][_0x7c80('0x1a')],_0xd2d0b4)[_0x7c80('0x1b')](function(_0x5ddf13){logger[_0x7c80('0x1c')]('[%s][UPDATE][ACWTIME:%s]',_0xaa98c0,_0x4f500f,_0x5ddf13);})[_0x7c80('0x1d')](function(_0x2a0d1a){logger[_0x7c80('0x1e')](_0x7c80('0x1f'),_0xaa98c0,_0x2a0d1a);})[_0x7c80('0x20')](function(){delete _0x2ecbbe[_0x7c80('0x6')][_0xd2d0b4];});};Acw['prototype']['startAcw']=function(_0x1b89fe){try{var _0x11a7e2=this;var _0x53af1a=this[_0x7c80('0x7')][_0x1b89fe]['interface'];var _0x12a9e5=this['channels'][_0x1b89fe][_0x7c80('0x21')];var _0x4f5614=this[_0x7c80('0x4')][_0x12a9e5];var _0x4d070a=![];var _0x48bef7=_0x7c80('0x22');if(_0x4f5614[_0x7c80('0x23')]&&_0x4f5614[_0x7c80('0x24')][_0x7c80('0x25')]){_0x4d070a=!![];_0x48bef7=_0x4f5614[_0x7c80('0x24')][_0x7c80('0x25')];}if(!_0x11a7e2[_0x7c80('0x5')][_0x53af1a]){return Promise[_0x7c80('0x26')]();}return RpcUser[_0x7c80('0x27')](_0x11a7e2['agents'][_0x53af1a]['id'])['then'](function(_0xcbea54){if(!_0xcbea54||_0xcbea54[_0x7c80('0x28')]){logger[_0x7c80('0x1c')](_0x7c80('0x29'),_0x1b89fe,_0x53af1a,_0x12a9e5);return;}logger[_0x7c80('0x1c')](_0x7c80('0x2a'),_0x1b89fe,_0x53af1a,_0x12a9e5);var _0x51ba21=_0x11a7e2['channels'][_0x1b89fe]['attended']&&_0x11a7e2['channels'][_0x1b89fe][_0x7c80('0x2b')]?_0x11a7e2[_0x7c80('0x7')][_0x1b89fe][_0x7c80('0x2b')]:_0x1b89fe;return RpcUser[_0x7c80('0x2c')](_0x11a7e2[_0x7c80('0x5')][_0x53af1a],_0x48bef7,_0x51ba21)['then'](function(_0xd04890){_0x11a7e2[_0x7c80('0x4')][_0x12a9e5][_0x7c80('0x2d')]-=0x1;_0x11a7e2[_0x7c80('0x4')][_0x12a9e5][_0x7c80('0x2e')]+=0x1;return _0xd04890;});})[_0x7c80('0x1b')](function(_0x4dea00){if(_0x4d070a||!_0x4dea00){return;}_0x11a7e2[_0x7c80('0x6')][_0x53af1a]={};logger[_0x7c80('0x1c')](_0x7c80('0x2f'),_0x1b89fe,_0x11a7e2[_0x7c80('0x4')][_0x12a9e5][_0x7c80('0x30')],_0x53af1a,_0x12a9e5);_0x11a7e2[_0x7c80('0x6')][_0x53af1a]['timer']=setTimeout(_0x11a7e2[_0x7c80('0x31')][_0x7c80('0x9')](_0x11a7e2,_0x53af1a),_0x11a7e2[_0x7c80('0x4')][_0x12a9e5]['acwTimeout']*0x3e8);_0x11a7e2['timers'][_0x53af1a][_0x7c80('0x17')]=moment()['format'](_0x7c80('0x32'));_0x11a7e2['timers'][_0x53af1a][_0x7c80('0x1a')]=_0x1b89fe;_0x11a7e2[_0x7c80('0x6')][_0x53af1a][_0x7c80('0x21')]=_0x12a9e5;_0x11a7e2[_0x7c80('0x6')][_0x53af1a]['updateAcw']=_0x11a7e2['updateAcw']['bind'](_0x11a7e2,_0x53af1a,_0x1b89fe);})['catch'](function(){logger[_0x7c80('0x1e')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x1b89fe,_0x11a7e2[_0x7c80('0x4')][_0x12a9e5][_0x7c80('0x30')],_0x53af1a,_0x12a9e5);})[_0x7c80('0x20')](function(){delete _0x11a7e2[_0x7c80('0x7')][_0x1b89fe];});}catch(_0x56cfea){logger[_0x7c80('0x1e')]('[ACW][START]\x20%s',_0x56cfea[_0x7c80('0x33')]);}};Acw[_0x7c80('0x15')]['stopAcw']=function(_0x133864){try{var _0x430bba=this;if(_0x430bba[_0x7c80('0x6')][_0x133864]){_0x430bba['timers'][_0x133864][_0x7c80('0x18')]=![];var _0x567972=_0x430bba[_0x7c80('0x6')][_0x133864][_0x7c80('0x1a')];var _0x368009=_0x430bba['timers'][_0x133864][_0x7c80('0x21')];var _0x36be3d=_0x430bba[_0x7c80('0x4')][_0x368009]['acwTimeout'];logger[_0x7c80('0x1c')](_0x7c80('0x34'),_0x567972,_0x133864);RpcUser['getAgent'](this[_0x7c80('0x5')][_0x133864]['id'])[_0x7c80('0x1b')](function(_0x2f6136){if(_0x2f6136[_0x7c80('0x35')]===_0x7c80('0x22')){return RpcUser[_0x7c80('0x36')](_0x430bba[_0x7c80('0x5')][_0x133864]);}});RpcVoiceAgentReport[_0x7c80('0x19')]({'acwtime':_0x36be3d,'agentacw':!![]},_0x567972,_0x133864)[_0x7c80('0x1b')](function(_0x3f6506){logger['info'](_0x7c80('0x37'),_0x567972,_0x36be3d,_0x3f6506);})[_0x7c80('0x1d')](function(_0x7fea21){logger[_0x7c80('0x1e')](_0x7c80('0x1f'),_0x567972,_0x7fea21);});}else{logger[_0x7c80('0x1e')](_0x7c80('0x38'),_0x133864);if(_0x430bba[_0x7c80('0x6')]){logger[_0x7c80('0x1c')](_0x7c80('0x39'),JSON['stringify'](_0x430bba[_0x7c80('0x6')]));}}}catch(_0x11841a){logger[_0x7c80('0x1e')]('[ACW][STOP]\x20%s',_0x11841a['message']);}};Acw['prototype'][_0x7c80('0x8')]=function(_0x795ce){try{if(this['voiceQueues'][_0x795ce[_0x7c80('0x21')]]&&(this[_0x7c80('0x4')][_0x795ce[_0x7c80('0x21')]][_0x7c80('0x1')]||this[_0x7c80('0x4')][_0x795ce['queue']][_0x7c80('0x23')])){if(this[_0x7c80('0x5')][_0x795ce[_0x7c80('0x3a')]]){this[_0x7c80('0x7')][_0x795ce['uniqueid']]={'queue':_0x795ce[_0x7c80('0x21')],'interface':_0x795ce[_0x7c80('0x3a')],'destlinkedid':_0x795ce[_0x7c80('0x2b')]};}}}catch(_0x3e781e){logger[_0x7c80('0x1e')](_0x7c80('0x3b'),_0x3e781e[_0x7c80('0x33')]);}};Acw['prototype'][_0x7c80('0x11')]=function(_0x1c8ea6){try{if(this['voiceQueues'][_0x1c8ea6['queue']]&&(this[_0x7c80('0x4')][_0x1c8ea6[_0x7c80('0x21')]][_0x7c80('0x1')]||this[_0x7c80('0x4')][_0x1c8ea6['queue']][_0x7c80('0x23')])){if(this[_0x7c80('0x5')][_0x1c8ea6[_0x7c80('0x3a')]]){this['channels'][_0x1c8ea6[_0x7c80('0x1a')]]={'queue':_0x1c8ea6[_0x7c80('0x21')],'interface':_0x1c8ea6['interface']};}}}catch(_0x13ad31){logger[_0x7c80('0x1e')](_0x7c80('0x3c'),_0x13ad31['message']);}};Acw['prototype'][_0x7c80('0xb')]=function(_0x5201df){try{if(this[_0x7c80('0x7')][_0x5201df[_0x7c80('0x1a')]]&&_[_0x7c80('0x3d')](this['channels'][_0x5201df[_0x7c80('0x1a')]]['attended'])){logger[_0x7c80('0x1c')](_0x7c80('0x3e'),_0x5201df[_0x7c80('0x1a')]);this[_0x7c80('0x3f')](_0x5201df[_0x7c80('0x1a')]);}else if(this['channels'][_0x5201df['linkedid']]&&_[_0x7c80('0x3d')](this[_0x7c80('0x7')][_0x5201df[_0x7c80('0x40')]][_0x7c80('0x41')])){logger[_0x7c80('0x1c')](_0x7c80('0x42'),_0x5201df[_0x7c80('0x40')]);this[_0x7c80('0x3f')](_0x5201df[_0x7c80('0x40')]);}}catch(_0x35ca42){logger['error'](_0x7c80('0x43'),_0x35ca42[_0x7c80('0x33')]);}};Acw['prototype'][_0x7c80('0x44')]=function(_0x16e29a){try{if(this[_0x7c80('0x7')][_0x16e29a[_0x7c80('0x1a')]]&&this[_0x7c80('0x7')][_0x16e29a[_0x7c80('0x1a')]][_0x7c80('0x41')]){logger['info'](_0x7c80('0x45'),_0x16e29a[_0x7c80('0x1a')]);this[_0x7c80('0x3f')](_0x16e29a[_0x7c80('0x1a')]);}else if(this[_0x7c80('0x7')][_0x16e29a['linkedid']]&&this[_0x7c80('0x7')][_0x16e29a[_0x7c80('0x40')]][_0x7c80('0x41')]){logger[_0x7c80('0x1c')](_0x7c80('0x46'),_0x16e29a[_0x7c80('0x40')]);this['startAcw'](_0x16e29a['linkedid']);}}catch(_0x4526a5){logger[_0x7c80('0x1e')](_0x7c80('0x47'),_0x4526a5['message']);}};Acw[_0x7c80('0x15')][_0x7c80('0xe')]=function(_0x31b9e3){try{if(!_['isNil'](this['channels'][_0x31b9e3[_0x7c80('0x48')]])){this[_0x7c80('0x3f')](_0x31b9e3[_0x7c80('0x48')]);if(this[_0x7c80('0x7')][_0x31b9e3[_0x7c80('0x49')]]){this[_0x7c80('0x7')][_0x31b9e3[_0x7c80('0x49')]][_0x7c80('0x41')]=!![];this[_0x7c80('0x7')][_0x31b9e3[_0x7c80('0x4a')]]=this['channels'][_0x31b9e3[_0x7c80('0x49')]];delete this['channels'][_0x31b9e3[_0x7c80('0x49')]];}}else if(!_[_0x7c80('0x4b')](this[_0x7c80('0x7')][_0x31b9e3[_0x7c80('0x4a')]])){this[_0x7c80('0x3f')](_0x31b9e3[_0x7c80('0x4a')]);if(this[_0x7c80('0x7')][_0x31b9e3[_0x7c80('0x4c')]]){this['channels'][_0x31b9e3['origtransfereruniqueid']][_0x7c80('0x41')]=!![];this[_0x7c80('0x7')][_0x31b9e3[_0x7c80('0x48')]]=this[_0x7c80('0x7')][_0x31b9e3['origtransfereruniqueid']];delete this['channels'][_0x31b9e3[_0x7c80('0x4c')]];}}}catch(_0x4dec76){logger[_0x7c80('0x1e')](_0x7c80('0x4d'),_0x4dec76[_0x7c80('0x33')]);}};Acw[_0x7c80('0x15')][_0x7c80('0xf')]=function(_0x4f8db5){try{if(this[_0x7c80('0x7')][_0x4f8db5[_0x7c80('0x4e')]]){logger[_0x7c80('0x1c')](_0x7c80('0x4f'),JSON[_0x7c80('0x50')](_0x4f8db5['transfereruniqueid']));this['startAcw'](_0x4f8db5[_0x7c80('0x4e')]);}else if(this[_0x7c80('0x7')][_0x4f8db5[_0x7c80('0x51')]]){logger['info'](_0x7c80('0x52'),JSON[_0x7c80('0x50')](_0x4f8db5[_0x7c80('0x51')]));this[_0x7c80('0x3f')](_0x4f8db5[_0x7c80('0x51')]);}}catch(_0x132e92){logger['error'](_0x7c80('0x53'),_0x132e92[_0x7c80('0x33')]);}};Acw[_0x7c80('0x15')]['syncAgentRingNoAnswer']=function(_0x8de1af){try{if(this['voiceQueues'][_0x8de1af[_0x7c80('0x21')]]&&this[_0x7c80('0x4')][_0x8de1af[_0x7c80('0x21')]][_0x7c80('0x54')]===_0x7c80('0x55')){if(this[_0x7c80('0x5')][_0x8de1af[_0x7c80('0x3a')]]){logger[_0x7c80('0x1c')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x8de1af[_0x7c80('0x1a')],_0x8de1af[_0x7c80('0x3a')],_0x8de1af[_0x7c80('0x21')]);return RpcUser[_0x7c80('0x2c')](this[_0x7c80('0x5')][_0x8de1af['interface']],_0x7c80('0x56'),_0x8de1af[_0x7c80('0x1a')]);}}}catch(_0x5ca1b9){logger[_0x7c80('0x1e')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x5ca1b9[_0x7c80('0x33')]);}};module['exports']=Acw; \ No newline at end of file +var _0xf188=['syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timer','update','uniqueid','info','[%s][UPDATE][ACWTIME:%s]','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','then','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','format','YYYY-MM-DD\x20HH:mm:ss','error','[ACW][START]\x20%s','message','pauseType','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereeuniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','syncHangupRequest','bind','hangup','syncHangup','blindtransfer'];(function(_0x30bf8e,_0x145794){var _0x2bf17e=function(_0x447ba1){while(--_0x447ba1){_0x30bf8e['push'](_0x30bf8e['shift']());}};_0x2bf17e(++_0x145794);}(_0xf188,0x187));var _0x8f18=function(_0xcf7ca,_0x54e647){_0xcf7ca=_0xcf7ca-0x0;var _0x259582=_0xf188[_0xcf7ca];return _0x259582;};'use strict';var _=require('lodash');var moment=require('moment');var ami=require('../ami');var logger=require(_0x8f18('0x0'))('acw');var RpcUser=require(_0x8f18('0x1'));var RpcVoiceAgentReport=require(_0x8f18('0x2'));function Acw(_0x30da46){this['voiceQueues']=_0x30da46[_0x8f18('0x3')];this[_0x8f18('0x4')]=_0x30da46[_0x8f18('0x4')];this['timers']=_0x30da46[_0x8f18('0x5')];this[_0x8f18('0x6')]={};ami['on'](_0x8f18('0x7'),this[_0x8f18('0x8')]['bind'](this));ami['on']('hanguprequest',this[_0x8f18('0x9')][_0x8f18('0xa')](this));ami['on'](_0x8f18('0xb'),this[_0x8f18('0xc')][_0x8f18('0xa')](this));ami['on']('agentringnoanswer',this['syncAgentRingNoAnswer'][_0x8f18('0xa')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on'](_0x8f18('0xd'),this[_0x8f18('0xe')][_0x8f18('0xa')](this));ami['on']('custom:agentConnectPreview',this[_0x8f18('0xf')][_0x8f18('0xa')](this));}function getDiff(_0x3ecd55){var _0x436c4e=moment()[_0x8f18('0x10')](0x0);var _0x1d14b5=moment(_0x3ecd55)[_0x8f18('0x10')](0x0);return _0x436c4e[_0x8f18('0x11')](_0x1d14b5,_0x8f18('0x12'));}Acw[_0x8f18('0x13')][_0x8f18('0x14')]=function(_0x22154a,_0x246e27){var _0xafadb7=this;var _0x439c81=getDiff(_0xafadb7['timers'][_0x22154a]['lastPauseAt']);clearTimeout(_0xafadb7[_0x8f18('0x5')][_0x22154a][_0x8f18('0x15')]);_0xafadb7[_0x8f18('0x5')][_0x22154a][_0x8f18('0x15')]=![];return RpcVoiceAgentReport[_0x8f18('0x16')]({'acwtime':_0x439c81},_0xafadb7[_0x8f18('0x5')][_0x22154a][_0x8f18('0x17')],_0x22154a)['then'](function(_0x2c4cd9){logger[_0x8f18('0x18')](_0x8f18('0x19'),_0x246e27,_0x439c81,_0x2c4cd9);})['catch'](function(_0x4082c5){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x246e27,_0x4082c5);})['finally'](function(){delete _0xafadb7[_0x8f18('0x5')][_0x22154a];});};Acw[_0x8f18('0x13')][_0x8f18('0x1a')]=function(_0x5795eb){try{var _0x4194c0=this;var _0xa4515=this[_0x8f18('0x6')][_0x5795eb][_0x8f18('0x1b')];var _0x4ea8ee=this[_0x8f18('0x6')][_0x5795eb][_0x8f18('0x1c')];var _0x34bf99=this[_0x8f18('0x3')][_0x4ea8ee];var _0x29e788=![];var _0x359fad=_0x8f18('0x1d');if(_0x34bf99[_0x8f18('0x1e')]&&_0x34bf99[_0x8f18('0x1f')]['name']){_0x29e788=!![];_0x359fad=_0x34bf99[_0x8f18('0x1f')][_0x8f18('0x20')];}if(!_0x4194c0[_0x8f18('0x4')][_0xa4515]){return Promise[_0x8f18('0x21')]();}return RpcUser[_0x8f18('0x22')](_0x4194c0['agents'][_0xa4515]['id'])[_0x8f18('0x23')](function(_0x2537a8){if(!_0x2537a8||_0x2537a8[_0x8f18('0x24')]){logger[_0x8f18('0x18')](_0x8f18('0x25'),_0x5795eb,_0xa4515,_0x4ea8ee);return;}logger[_0x8f18('0x18')](_0x8f18('0x26'),_0x5795eb,_0xa4515,_0x4ea8ee);var _0x2e0fb6=_0x4194c0[_0x8f18('0x6')][_0x5795eb][_0x8f18('0x27')]&&_0x4194c0[_0x8f18('0x6')][_0x5795eb][_0x8f18('0x28')]?_0x4194c0[_0x8f18('0x6')][_0x5795eb][_0x8f18('0x28')]:_0x5795eb;return RpcUser[_0x8f18('0x29')](_0x4194c0[_0x8f18('0x4')][_0xa4515],_0x359fad,_0x2e0fb6)[_0x8f18('0x23')](function(_0x2b8518){_0x4194c0['voiceQueues'][_0x4ea8ee][_0x8f18('0x2a')]-=0x1;_0x4194c0['voiceQueues'][_0x4ea8ee][_0x8f18('0x2b')]+=0x1;return _0x2b8518;});})[_0x8f18('0x23')](function(_0x27e925){if(_0x29e788||!_0x27e925){return;}_0x4194c0[_0x8f18('0x5')][_0xa4515]={};logger[_0x8f18('0x18')](_0x8f18('0x2c'),_0x5795eb,_0x4194c0[_0x8f18('0x3')][_0x4ea8ee][_0x8f18('0x2d')],_0xa4515,_0x4ea8ee);_0x4194c0[_0x8f18('0x5')][_0xa4515][_0x8f18('0x15')]=setTimeout(_0x4194c0[_0x8f18('0x2e')][_0x8f18('0xa')](_0x4194c0,_0xa4515),_0x4194c0[_0x8f18('0x3')][_0x4ea8ee][_0x8f18('0x2d')]*0x3e8);_0x4194c0[_0x8f18('0x5')][_0xa4515]['lastPauseAt']=moment()[_0x8f18('0x2f')](_0x8f18('0x30'));_0x4194c0[_0x8f18('0x5')][_0xa4515][_0x8f18('0x17')]=_0x5795eb;_0x4194c0['timers'][_0xa4515][_0x8f18('0x1c')]=_0x4ea8ee;_0x4194c0[_0x8f18('0x5')][_0xa4515]['updateAcw']=_0x4194c0[_0x8f18('0x14')][_0x8f18('0xa')](_0x4194c0,_0xa4515,_0x5795eb);})['catch'](function(){logger[_0x8f18('0x31')](_0x8f18('0x2c'),_0x5795eb,_0x4194c0[_0x8f18('0x3')][_0x4ea8ee][_0x8f18('0x2d')],_0xa4515,_0x4ea8ee);})['finally'](function(){delete _0x4194c0['channels'][_0x5795eb];});}catch(_0x54c78c){logger['error'](_0x8f18('0x32'),_0x54c78c[_0x8f18('0x33')]);}};Acw[_0x8f18('0x13')][_0x8f18('0x2e')]=function(_0x332468){try{var _0xa531f=this;if(_0xa531f[_0x8f18('0x5')][_0x332468]){_0xa531f[_0x8f18('0x5')][_0x332468][_0x8f18('0x15')]=![];var _0x5d61d8=_0xa531f[_0x8f18('0x5')][_0x332468]['uniqueid'];var _0x4b449e=_0xa531f[_0x8f18('0x5')][_0x332468][_0x8f18('0x1c')];var _0x4bf8de=_0xa531f[_0x8f18('0x3')][_0x4b449e][_0x8f18('0x2d')];logger[_0x8f18('0x18')]('[%s][TIMER][STOP][AGENT:%s]',_0x5d61d8,_0x332468);RpcUser['getAgent'](this[_0x8f18('0x4')][_0x332468]['id'])[_0x8f18('0x23')](function(_0x1a3547){if(_0x1a3547[_0x8f18('0x34')]===_0x8f18('0x1d')){return RpcUser[_0x8f18('0x35')](_0xa531f[_0x8f18('0x4')][_0x332468]);}});RpcVoiceAgentReport['update']({'acwtime':_0x4bf8de,'agentacw':!![]},_0x5d61d8,_0x332468)['then'](function(_0x2e2b8f){logger['info'](_0x8f18('0x19'),_0x5d61d8,_0x4bf8de,_0x2e2b8f);})['catch'](function(_0x34ef66){logger[_0x8f18('0x31')](_0x8f18('0x36'),_0x5d61d8,_0x34ef66);});}else{logger['error'](_0x8f18('0x37'),_0x332468);if(_0xa531f[_0x8f18('0x5')]){logger[_0x8f18('0x18')](_0x8f18('0x38'),JSON[_0x8f18('0x39')](_0xa531f['timers']));}}}catch(_0x65f533){logger[_0x8f18('0x31')]('[ACW][STOP]\x20%s',_0x65f533['message']);}};Acw[_0x8f18('0x13')][_0x8f18('0x8')]=function(_0x2bffe7){try{if(this[_0x8f18('0x3')][_0x2bffe7[_0x8f18('0x1c')]]&&(this[_0x8f18('0x3')][_0x2bffe7[_0x8f18('0x1c')]]['acw']||this['voiceQueues'][_0x2bffe7[_0x8f18('0x1c')]][_0x8f18('0x1e')])){if(this[_0x8f18('0x4')][_0x2bffe7[_0x8f18('0x1b')]]){this['channels'][_0x2bffe7[_0x8f18('0x17')]]={'queue':_0x2bffe7[_0x8f18('0x1c')],'interface':_0x2bffe7[_0x8f18('0x1b')],'destlinkedid':_0x2bffe7[_0x8f18('0x28')]};}}}catch(_0x1d495b){logger[_0x8f18('0x31')]('[ACW][syncAgentConnect]\x20%s',_0x1d495b[_0x8f18('0x33')]);}};Acw[_0x8f18('0x13')][_0x8f18('0xf')]=function(_0x1f36f2){try{if(this[_0x8f18('0x3')][_0x1f36f2['queue']]&&(this[_0x8f18('0x3')][_0x1f36f2[_0x8f18('0x1c')]][_0x8f18('0x3a')]||this[_0x8f18('0x3')][_0x1f36f2['queue']][_0x8f18('0x1e')])){if(this[_0x8f18('0x4')][_0x1f36f2[_0x8f18('0x1b')]]){this['channels'][_0x1f36f2[_0x8f18('0x17')]]={'queue':_0x1f36f2[_0x8f18('0x1c')],'interface':_0x1f36f2[_0x8f18('0x1b')]};}}}catch(_0x385397){logger[_0x8f18('0x31')](_0x8f18('0x3b'),_0x385397[_0x8f18('0x33')]);}};Acw[_0x8f18('0x13')][_0x8f18('0x9')]=function(_0x11aaea){try{if(this[_0x8f18('0x6')][_0x11aaea[_0x8f18('0x17')]]&&_[_0x8f18('0x3c')](this[_0x8f18('0x6')][_0x11aaea[_0x8f18('0x17')]]['attended'])){logger[_0x8f18('0x18')](_0x8f18('0x3d'),_0x11aaea[_0x8f18('0x17')]);this['startAcw'](_0x11aaea[_0x8f18('0x17')]);}else if(this[_0x8f18('0x6')][_0x11aaea[_0x8f18('0x3e')]]&&_['isUndefined'](this['channels'][_0x11aaea[_0x8f18('0x3e')]]['attended'])){logger[_0x8f18('0x18')]('[%s][HANGUP:LINKEDID]',_0x11aaea[_0x8f18('0x3e')]);this[_0x8f18('0x1a')](_0x11aaea[_0x8f18('0x3e')]);}}catch(_0x1b1cba){logger['error'](_0x8f18('0x3f'),_0x1b1cba[_0x8f18('0x33')]);}};Acw[_0x8f18('0x13')][_0x8f18('0xc')]=function(_0x32a827){try{if(this[_0x8f18('0x6')][_0x32a827[_0x8f18('0x17')]]&&this[_0x8f18('0x6')][_0x32a827[_0x8f18('0x17')]][_0x8f18('0x27')]){logger['info'](_0x8f18('0x40'),_0x32a827[_0x8f18('0x17')]);this[_0x8f18('0x1a')](_0x32a827['uniqueid']);}else if(this['channels'][_0x32a827[_0x8f18('0x3e')]]&&this['channels'][_0x32a827[_0x8f18('0x3e')]][_0x8f18('0x27')]){logger[_0x8f18('0x18')](_0x8f18('0x41'),_0x32a827[_0x8f18('0x3e')]);this[_0x8f18('0x1a')](_0x32a827[_0x8f18('0x3e')]);}}catch(_0x191fc4){logger['error']('[ACW][syncHangup]\x20%s',_0x191fc4[_0x8f18('0x33')]);}};Acw[_0x8f18('0x13')]['syncAttendedTransfer']=function(_0x4a80be){try{if(!_[_0x8f18('0x42')](this['channels'][_0x4a80be['transfereeuniqueid']])){this[_0x8f18('0x1a')](_0x4a80be['transfereeuniqueid']);if(this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x43')]]){this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x43')]][_0x8f18('0x27')]=!![];this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x44')]]=this['channels'][_0x4a80be['secondtransfereruniqueid']];delete this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x43')]];}}else if(!_[_0x8f18('0x42')](this['channels'][_0x4a80be['transfertargetuniqueid']])){this[_0x8f18('0x1a')](_0x4a80be[_0x8f18('0x44')]);if(this[_0x8f18('0x6')][_0x4a80be['origtransfereruniqueid']]){this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x45')]]['attended']=!![];this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x46')]]=this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x45')]];delete this[_0x8f18('0x6')][_0x4a80be[_0x8f18('0x45')]];}}}catch(_0x307896){logger[_0x8f18('0x31')](_0x8f18('0x47'),_0x307896['message']);}};Acw[_0x8f18('0x13')][_0x8f18('0xe')]=function(_0x37c8d0){try{if(this[_0x8f18('0x6')][_0x37c8d0[_0x8f18('0x48')]]){logger['info'](_0x8f18('0x49'),JSON['stringify'](_0x37c8d0[_0x8f18('0x48')]));this[_0x8f18('0x1a')](_0x37c8d0['transfereruniqueid']);}else if(this[_0x8f18('0x6')][_0x37c8d0[_0x8f18('0x4a')]]){logger[_0x8f18('0x18')](_0x8f18('0x4b'),JSON[_0x8f18('0x39')](_0x37c8d0[_0x8f18('0x4a')]));this['startAcw'](_0x37c8d0[_0x8f18('0x4a')]);}}catch(_0x23758c){logger[_0x8f18('0x31')](_0x8f18('0x4c'),_0x23758c[_0x8f18('0x33')]);}};Acw[_0x8f18('0x13')][_0x8f18('0x4d')]=function(_0x43043d){try{if(this['voiceQueues'][_0x43043d[_0x8f18('0x1c')]]&&this[_0x8f18('0x3')][_0x43043d[_0x8f18('0x1c')]]['autopause']==='all'){if(this[_0x8f18('0x4')][_0x43043d[_0x8f18('0x1b')]]){logger['info'](_0x8f18('0x4e'),_0x43043d['uniqueid'],_0x43043d[_0x8f18('0x1b')],_0x43043d[_0x8f18('0x1c')]);return RpcUser[_0x8f18('0x29')](this[_0x8f18('0x4')][_0x43043d['interface']],_0x8f18('0x4f'),_0x43043d[_0x8f18('0x17')]);}}}catch(_0x30036b){logger[_0x8f18('0x31')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x30036b['message']);}};module[_0x8f18('0x50')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 4b54f1d..f8c16f8 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 _0xffbd=['[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','asterisk','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','once','close','shutdown','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','then','actionDeviceStateList','actionCoreShowChannels','catch'];(function(_0x57a4d0,_0xa6e6b){var _0xaaadee=function(_0x544da2){while(--_0x544da2){_0x57a4d0['push'](_0x57a4d0['shift']());}};_0xaaadee(++_0xa6e6b);}(_0xffbd,0x199));var _0xdffb=function(_0xa9671b,_0x11378d){_0xa9671b=_0xa9671b-0x0;var _0x205591=_0xffbd[_0xa9671b];return _0x205591;};'use strict';var Manager=require(_0xdffb('0x0'));var BPromise=require(_0xdffb('0x1'));var util=require('util');var logger=require(_0xdffb('0x2'))(_0xdffb('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0xdffb('0x4')]['port'],config['asterisk']['ip'],config[_0xdffb('0x4')]['username'],config['asterisk'][_0xdffb('0x5')],!![]);ami[_0xdffb('0x6')]();ami[_0xdffb('0x7')]=BPromise[_0xdffb('0x8')](ami[_0xdffb('0x9')]);function error(_0x59ca69){logger[_0xdffb('0xa')](util[_0xdffb('0xb')](_0xdffb('0xc'),config[_0xdffb('0x4')]['username'],config[_0xdffb('0x4')]['ip'],config[_0xdffb('0x4')][_0xdffb('0xd')],util[_0xdffb('0xe')](_0x59ca69,![],null)));}function close(){logger[_0xdffb('0xa')](util['format'](_0xdffb('0xf'),config[_0xdffb('0x4')][_0xdffb('0x10')],config[_0xdffb('0x4')]['ip'],config['asterisk'][_0xdffb('0xd')]));}ami[_0xdffb('0x11')]=function(){return function(){return ami['Action']({'action':_0xdffb('0x12')});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xdffb('0x13')});};};ami[_0xdffb('0x14')]=function(){return function(){return ami[_0xdffb('0x7')]({'action':_0xdffb('0x15')});};};ami[_0xdffb('0x16')]=function(){return function(){return ami['Action']({'action':_0xdffb('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xdffb('0x7')]({'action':_0xdffb('0x18')});};};function connect(){logger[_0xdffb('0x19')](util[_0xdffb('0xb')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0xdffb('0x4')][_0xdffb('0x10')],config[_0xdffb('0x4')]['ip'],config['asterisk'][_0xdffb('0xd')]));ami[_0xdffb('0x1a')](_0xdffb('0xa'),error);ami['once'](_0xdffb('0x1b'),close);}ami['on']('connect',connect);ami['on'](_0xdffb('0x1c'),function(_0x3046ca){logger[_0xdffb('0x19')](util[_0xdffb('0xb')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0xdffb('0x4')]['username'],config[_0xdffb('0x4')]['ip'],config[_0xdffb('0x4')][_0xdffb('0xd')],util['inspect'](_0x3046ca,![],null)));});ami['on'](_0xdffb('0x1d'),function(){logger[_0xdffb('0x19')](util[_0xdffb('0xb')](_0xdffb('0x1e'),config[_0xdffb('0x4')]['username'],config['asterisk']['ip'],config[_0xdffb('0x4')][_0xdffb('0xd')]));return Promise['resolve']()[_0xdffb('0x1f')](ami[_0xdffb('0x11')]())[_0xdffb('0x1f')](ami[_0xdffb('0x20')]())[_0xdffb('0x1f')](ami[_0xdffb('0x14')]())['then'](ami[_0xdffb('0x16')]())[_0xdffb('0x1f')](ami[_0xdffb('0x21')]())[_0xdffb('0x22')](function(_0x28bbe5){logger[_0xdffb('0xa')](_0xdffb('0x23'),util[_0xdffb('0xe')](_0x28bbe5,{'showHidden':![],'depth':null}));});});ami[_0xdffb('0x1a')](_0xdffb('0xa'),error);ami[_0xdffb('0x1a')](_0xdffb('0x1b'),close);module[_0xdffb('0x24')]=ami; \ No newline at end of file +var _0x38dd=['sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','util','../../config/logger','ami','../../config/environment','asterisk','username','password','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','Action','devicestatelist','actionSipPeerStatus'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x38dd,0x8e));var _0xd38d=function(_0x5a2d3f,_0x27b04e){_0x5a2d3f=_0x5a2d3f-0x0;var _0x5c65d8=_0x38dd[_0x5a2d3f];return _0x5c65d8;};'use strict';var Manager=require(_0xd38d('0x0'));var BPromise=require(_0xd38d('0x1'));var util=require(_0xd38d('0x2'));var logger=require(_0xd38d('0x3'))(_0xd38d('0x4'));var config=require(_0xd38d('0x5'));var ami=new Manager(config[_0xd38d('0x6')]['port'],config[_0xd38d('0x6')]['ip'],config[_0xd38d('0x6')][_0xd38d('0x7')],config[_0xd38d('0x6')][_0xd38d('0x8')],!![]);ami['keepConnected']();ami['Action']=BPromise[_0xd38d('0x9')](ami['action']);function error(_0x34a009){logger[_0xd38d('0xa')](util[_0xd38d('0xb')](_0xd38d('0xc'),config[_0xd38d('0x6')][_0xd38d('0x7')],config[_0xd38d('0x6')]['ip'],config[_0xd38d('0x6')][_0xd38d('0xd')],util[_0xd38d('0xe')](_0x34a009,![],null)));}function close(){logger[_0xd38d('0xa')](util['format'](_0xd38d('0xf'),config[_0xd38d('0x6')][_0xd38d('0x7')],config[_0xd38d('0x6')]['ip'],config['asterisk'][_0xd38d('0xd')]));}ami[_0xd38d('0x10')]=function(){return function(){return ami['Action']({'action':_0xd38d('0x11')});};};ami[_0xd38d('0x12')]=function(){return function(){return ami[_0xd38d('0x13')]({'action':_0xd38d('0x14')});};};ami[_0xd38d('0x15')]=function(){return function(){return ami[_0xd38d('0x13')]({'action':_0xd38d('0x16')});};};ami[_0xd38d('0x17')]=function(){return function(){return ami[_0xd38d('0x13')]({'action':_0xd38d('0x18')});};};ami[_0xd38d('0x19')]=function(){return function(){return ami[_0xd38d('0x13')]({'action':_0xd38d('0x1a')});};};function connect(){logger['info'](util[_0xd38d('0xb')](_0xd38d('0x1b'),config[_0xd38d('0x6')][_0xd38d('0x7')],config[_0xd38d('0x6')]['ip'],config[_0xd38d('0x6')][_0xd38d('0xd')]));ami[_0xd38d('0x1c')]('error',error);ami[_0xd38d('0x1c')](_0xd38d('0x1d'),close);}ami['on'](_0xd38d('0x1e'),connect);ami['on'](_0xd38d('0x1f'),function(_0x5d2245){logger[_0xd38d('0x20')](util[_0xd38d('0xb')](_0xd38d('0x21'),config['asterisk'][_0xd38d('0x7')],config[_0xd38d('0x6')]['ip'],config['asterisk']['port'],util['inspect'](_0x5d2245,![],null)));});ami['on'](_0xd38d('0x22'),function(){logger[_0xd38d('0x20')](util[_0xd38d('0xb')](_0xd38d('0x23'),config[_0xd38d('0x6')][_0xd38d('0x7')],config['asterisk']['ip'],config[_0xd38d('0x6')][_0xd38d('0xd')]));return Promise[_0xd38d('0x24')]()[_0xd38d('0x25')](ami[_0xd38d('0x10')]())[_0xd38d('0x25')](ami['actionDeviceStateList']())['then'](ami[_0xd38d('0x15')]())['then'](ami['actionQueueSummary']())[_0xd38d('0x25')](ami[_0xd38d('0x19')]())[_0xd38d('0x26')](function(_0x213d7e){logger['error'](_0xd38d('0x27'),util[_0xd38d('0xe')](_0x213d7e,{'showHidden':![],'depth':null}));});});ami['once']('error',error);ami['once']('close',close);module[_0xd38d('0x28')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index b41979d..58fd114 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 _0x9ffd=['catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','then','debug','rpc','memberReport','error','result'];(function(_0x4a4190,_0x5807b8){var _0x29bfb0=function(_0x4e1014){while(--_0x4e1014){_0x4a4190['push'](_0x4a4190['shift']());}};_0x29bfb0(++_0x5807b8);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x164265,_0x53cbfe){_0x164265=_0x164265-0x0;var _0x3e3472=_0x9ffd[_0x164265];return _0x3e3472;};'use strict';var jayson=require(_0xd9ff('0x0'));var BPromise=require(_0xd9ff('0x1'));var logger=require(_0xd9ff('0x2'))('ami');var client=jayson[_0xd9ff('0x3')][_0xd9ff('0x4')]({'port':0x2329});client[_0xd9ff('0x5')]=function(_0x5493ae,_0x53e962){return new BPromise(function(_0x1c9460,_0x111697){return client['request'](_0x5493ae,_0x53e962)[_0xd9ff('0x6')](function(_0x2982c3){logger[_0xd9ff('0x7')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x53e962,_0x2982c3);if(_0x2982c3[_0xd9ff('0xa')]){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x2982c3['error']['message'],_0x53e962);return _0x111697(_0x2982c3['error']['message']);}else{return _0x1c9460(_0x2982c3[_0xd9ff('0xb')]);}})[_0xd9ff('0xc')](function(_0x193537){logger[_0xd9ff('0xa')](_0xd9ff('0x8'),_0xd9ff('0x9'),_0x5493ae,_0x193537,_0x53e962);return _0x111697(_0x193537);});});};module[_0xd9ff('0xd')]=client; \ No newline at end of file +var _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe706,0xa3));var _0x6e70=function(_0x1c9093,_0x31eb87){_0x1c9093=_0x1c9093-0x0;var _0x32dd36=_0xe706[_0x1c9093];return _0x32dd36;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index cc3faa1..00bd2a1 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 _0x50d2=['variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','amd','saveInDb','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','outboundAnswerCallsDay','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','dialMachineMaxRetry','value','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','buildObj','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','[syncHangupIvr][createHistory]','moveContactManagedDialer','dialQueueProject','Normal\x20Clearing','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','assign','throttle','filter','dialPreviewRecallmeReminder','map','user:%s','user:dialPreviewRecallReminder','checkPreviewRecallReminder','loopClearZombieChannels','[uniqueid]','[actions]','clearZombieChannels','enqueue','No\x20such\x20channel','[Dialer][checkChannel]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','notFound','UserId','[emptyContact][createHistory]','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','handlePreviewRecallNotifications','Agent','handleIvr','actionOriginate','object','originate','phone','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','dialQueueOptions','dialQueueTimeout','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','setXMDContactVariables','Contact','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','getCallerId','TrunkBackup','XMD-ORIGINATECALLERIDNAME','extractCalleridName','XMD-ORIGINATECALLERIDNUM','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','dialCongestionMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','callAdditionalPhoneAfterMin','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','dialCongestionRetryFrequency','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','round','available','predictiveIntervalHitRate','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','dialPredictiveInterval','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalAnsweredCalls','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','floor','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','voicePause','unlockContact','outboundReCallsDay','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','checkIsBlackListIvr','loggerHandler','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','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]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','[busyFactor]','p\x20=\x20','exports','util','lodash','uuid','moment','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','syncQueueSummary','defaults','redis','socket.io-emitter','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','prototype','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','loopCampaigns','then','previewRecallmeReminderInterval','isUndefined','inspect','format','name','voice_queue:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','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','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','getSeconds','debug','startPredictive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','CAMPAIGN_STATUS','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','starttime','queueStatusComplete','[booked][unlockQueueStatus]','stringify','pick','Interval','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','isEmpty','INACTIVE','\x20NOT\x20Active','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','Error','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','checkIsTrunkReachable','Trunk','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','interval','indexOf','true','command','content','catch','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','resetActiveCalls','undefined','isIVRCampaign','resolve','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','dialPowerLevel','predictive','handlePower','Queue','method\x20not\x20recognized','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','queue','uniqueid','type','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','droptime','responsetime','outboundDropCallsDayTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','TIMEOUT','dialQueueProject2','countdropretry','countglobal','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','dialDropRetryFrequency','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','createHistory','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','dropreason','CALLEREXIT','countabandonedretry','dialAbandonedRetryFrequency','dialAbandonedMaxRetry','CampaignId','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','rrmemory','roundrobin','isNil','paused','stateinterface','locked','idHopper','syncQueueStatusComplete','strategy','preview','run','[Catch][Preview][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','response','Success','callProgressDetecting','[callProgressDetecting]\x20'];(function(_0xac3a28,_0x5adfe2){var _0x1c69c6=function(_0x2db28f){while(--_0x2db28f){_0xac3a28['push'](_0xac3a28['shift']());}};_0x1c69c6(++_0x5adfe2);}(_0x50d2,0x118));var _0x250d=function(_0x11c584,_0x21bc3a){_0x11c584=_0x11c584-0x0;var _0x3d0954=_0x50d2[_0x11c584];return _0x3d0954;};'use strict';var util=require(_0x250d('0x0'));var _=require(_0x250d('0x1'));var uuid=require(_0x250d('0x2'));var moment=require(_0x250d('0x3'));var rr=require('rr');var Redis=require('ioredis');var utils=require('./utils');var hopperUtils=require('./utils/hopper');var ut=require(_0x250d('0x4'));var config=require(_0x250d('0x5'));var logger=require('../../../config/logger')(_0x250d('0x6'));var loggerBooked=require(_0x250d('0x7'))('booked');var loggerPredictive=require(_0x250d('0x7'))('predictive');var loggerPredictiveCalls=require(_0x250d('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x250d('0x7'))(_0x250d('0x8'));var ami=require('../ami');config['redis']=_[_0x250d('0x9')](config[_0x250d('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x250d('0xb'))(new Redis(config[_0x250d('0xa')]));var cmHopper=require(_0x250d('0xc'));var voiceQueueRt=require(_0x250d('0xd'));var RpcSetting=require('../rpc/setting');var Interval=require(_0x250d('0xe'));var Action=require(_0x250d('0xf'));var History=require(_0x250d('0x10'));var Final=require('./models/final');var AgentComplete=require('./models/agentComplete');var QueueCallerAbandon=require(_0x250d('0x11'));var Hangup=require('./models/hangup');var ipAgi=process[_0x250d('0x12')][_0x250d('0x13')]||_0x250d('0x14');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence[_0x250d('0x15')]['enqueue']=function(_0x21d443){this['tail']=this['tail']?this[_0x250d('0x16')][_0x250d('0x17')](_0x21d443):_0x21d443();};function Dialer(_0x496c54,_0x2118c5){this[_0x250d('0x18')]=new Sequence();this['preview']=_0x2118c5;this[_0x250d('0x19')]=_0x496c54[_0x250d('0x19')];this['campaigns']=_0x496c54[_0x250d('0x1a')];this[_0x250d('0x1b')]=_0x496c54[_0x250d('0x1b')];this[_0x250d('0x1c')]=_0x496c54[_0x250d('0x1c')];this[_0x250d('0x1d')]=config[_0x250d('0x1d')]||0x2;this['channels']={};this[_0x250d('0x1e')]={};this['contactsId']={};this[_0x250d('0x1f')]={};this[_0x250d('0x20')]={};this[_0x250d('0x21')]={};this[_0x250d('0x22')]={};this[_0x250d('0x23')]={};this[_0x250d('0x24')]={};this[_0x250d('0x25')]={};this[_0x250d('0x26')]={};ami['on'](_0x250d('0x27'),this[_0x250d('0x28')][_0x250d('0x29')](this));ami['on'](_0x250d('0x2a'),this[_0x250d('0x2b')][_0x250d('0x29')](this));ami['on'](_0x250d('0x2c'),this[_0x250d('0x2d')][_0x250d('0x29')](this));ami['on'](_0x250d('0x2e'),this[_0x250d('0x2f')][_0x250d('0x29')](this));ami['on'](_0x250d('0x30'),this[_0x250d('0x8')][_0x250d('0x29')](this));ami['on']('custom:queuesummarycomplete',this[_0x250d('0x31')][_0x250d('0x29')](this));ami['on'](_0x250d('0x32'),this[_0x250d('0x33')][_0x250d('0x29')](this));ami['on'](_0x250d('0x34'),this[_0x250d('0x35')][_0x250d('0x29')](this));ami['on'](_0x250d('0x36'),this[_0x250d('0x37')][_0x250d('0x29')](this));ami['on']('queuemember',this[_0x250d('0x38')][_0x250d('0x29')](this));ami['on'](_0x250d('0x39'),this['syncQueueStatusComplete'][_0x250d('0x29')](this));this[_0x250d('0x3a')]();this['loopClearZombieChannels']();RpcSetting['getSettings']()[_0x250d('0x3b')](function(_0x2a1cd2){previewRecallmeReminderInterval=_0x2a1cd2[_0x250d('0x3c')];});}function isNotNull(_0x23a13a){return _0x23a13a!==null&&!_[_0x250d('0x3d')](_0x23a13a);}function msgResponse(_0xb28335,_0x2fb98b,_0x376246){return{'action':_0xb28335,'response':_0x2fb98b,'message':_0x376246,'stack':_0x376246};}function emit(_0x5e25b2,_0x6174b1,_0xb8f014){io['to'](_0x5e25b2)['emit'](_0x6174b1,_0xb8f014);}function emitOutboundVoiceQueueSummary(_0x507bd1){if(_0x507bd1['type']==='outbound'){logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x250d('0x3e')](_0x507bd1,{'showHidden':![],'depth':null}));emit(util[_0x250d('0x3f')]('voice:queue:%s',_0x507bd1[_0x250d('0x40')]),_0x250d('0x41'),_0x507bd1);}}function checkGetDataPredictive(_0x10df7b){if(isNotNull(_0x10df7b)&&!_['isEmpty'](_0x10df7b)){loggerPredictive[_0x250d('0x42')](_0x250d('0x43'));loggerPredictive[_0x250d('0x42')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x10df7b[_0x250d('0x44')]);loggerPredictive[_0x250d('0x42')](_0x250d('0x45'),_0x10df7b['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x250d('0x46'),_0x10df7b[_0x250d('0x47')]);loggerPredictive['info'](_0x250d('0x48'),_0x10df7b[_0x250d('0x49')]);loggerPredictive[_0x250d('0x42')](_0x250d('0x4a'),_0x10df7b[_0x250d('0x4b')]);loggerPredictive[_0x250d('0x42')](_0x250d('0x4c'),_0x10df7b[_0x250d('0x4d')]);loggerPredictive[_0x250d('0x42')]('---------------------------');if(_0x10df7b[_0x250d('0x44')]>0x0){if(!_[_0x250d('0x3d')](_0x10df7b[_0x250d('0x4d')])&&_0x10df7b[_0x250d('0x4d')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x250d('0x3d')](_0x10df7b[_0x250d('0x4b')])&&_0x10df7b[_0x250d('0x4b')]>0x0){return!![];}loggerPredictive[_0x250d('0x42')](_0x250d('0x4e'));}else{loggerPredictive[_0x250d('0x42')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info'](_0x250d('0x4f'));}return![];}function mergeDataErlangB(_0x4e5ea3){return function(_0x46d9a6){loggerPredictive[_0x250d('0x42')](_0x250d('0x50'));loggerPredictive[_0x250d('0x42')](_0x250d('0x51'),_0x46d9a6[_0x250d('0x52')]);loggerPredictive['info'](_0x250d('0x53'),_0x46d9a6[_0x250d('0x54')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46d9a6[_0x250d('0x55')]);loggerPredictive['info'](_0x250d('0x56'),_0x46d9a6[_0x250d('0x57')]);loggerPredictive[_0x250d('0x42')](_0x250d('0x58'),_0x46d9a6[_0x250d('0x55')]);loggerPredictive['info']('---------------------------');_[_0x250d('0x59')](_0x4e5ea3,_0x46d9a6);};}function ifInterval(_0x1bf35c,_0x3aba5b){if(_[_0x250d('0x3d')](_0x3aba5b)){return![];}return utils[_0x250d('0x5a')](undefined,_0x3aba5b)<_0x1bf35c*0x3c;}function clearPredictiveAttributes(_0x4a06d5){if(_0x4a06d5[_0x250d('0x22')]){_0x4a06d5[_0x250d('0x22')]=undefined;loggerPredictive[_0x250d('0x5b')](_0x4a06d5[_0x250d('0x40')],'startProgressive\x20value\x20cleared');}if(_0x4a06d5['startPredictive']){_0x4a06d5[_0x250d('0x21')]=undefined;loggerPredictive[_0x250d('0x5b')](_0x4a06d5[_0x250d('0x40')],_0x250d('0x5c'));}if(_0x4a06d5[_0x250d('0x5d')]){clearInterval(_0x4a06d5[_0x250d('0x5d')]);_0x4a06d5['handlePredictive']=undefined;loggerPredictive[_0x250d('0x5b')](_0x4a06d5[_0x250d('0x40')],_0x250d('0x5e'));}}function loggerCatchPredictive(_0x46d61d,_0x407aaa){return function(_0x6672ba){loggerPredictive[_0x250d('0x5f')](_0x407aaa[_0x250d('0x40')],_0x46d61d);loggerPredictive[_0x250d('0x5f')](_0x6672ba[_0x250d('0x60')]);clearPredictiveAttributes(_0x407aaa);};}function loggerCatch(_0x1a4156){return function(_0x3c4a6b){logger[_0x250d('0x5f')](_0x1a4156,util[_0x250d('0x3e')](_0x3c4a6b,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x21ff45,_0x4d9d18,_0x263a17){return function(_0x44acde){utils[_0x250d('0x61')](_0x4d9d18,_0x263a17,0x0);_0x4d9d18[_0x250d('0x62')]=0x0;logger[_0x250d('0x5f')](_0x21ff45,util[_0x250d('0x3e')](_0x44acde,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x574e73){return function(_0x3882ab){if(isNotNull(_0x3882ab)&&isNotNull(_0x3882ab[0x0])){if(_0x3882ab[0x0][_0x250d('0x63')]>0x0){_0x574e73[_0x250d('0x64')]=utils['CAMPAIGN_STATUS'][_0x250d('0x65')];logger[_0x250d('0x42')](_0x250d('0x66')+_0x574e73[_0x250d('0x40')],_0x3882ab[0x0][_0x250d('0x63')],'contacts');}else{_0x574e73[_0x250d('0x64')]=utils[_0x250d('0x67')][_0x250d('0x68')];logger[_0x250d('0x42')](_0x250d('0x69')+_0x574e73[_0x250d('0x40')]);}}};}function createObjHistory(_0x549f5d,_0x559581,_0x44061b,_0x4f23aa,_0x5b186b){_0x549f5d['message']=_0x44061b;var _0x24820a=new Action(_0x549f5d,_0x559581);var _0x594f2a=new History(_0x24820a);_0x594f2a[_0x250d('0x6a')]=_0x4f23aa;_0x594f2a[_0x250d('0x6b')]=_0x5b186b;_0x594f2a['endtime']=_0x24820a[_0x250d('0x6c')];return _0x594f2a;}function unlockQueueStatus(_0x11360a,_0x10e2cc){setTimeout(function(){if(_[_0x250d('0x3d')](_0x11360a[_0x250d('0x6d')])){loggerBooked[_0x250d('0x5f')]('[unlockQueueStatus][undefined]',_0x10e2cc);}_0x11360a[_0x250d('0x6d')]=!![];loggerBooked[_0x250d('0x42')](_0x250d('0x6e'),_0x10e2cc,JSON[_0x250d('0x6f')](_[_0x250d('0x70')](_0x11360a,[_0x250d('0x40'),_0x250d('0x6d')])));},0x1f3);}function checkInterval(_0x1904d4){return function(){if(!isNotNull(_0x1904d4[_0x250d('0x71')])){_0x1904d4[_0x250d('0x64')]=utils['CAMPAIGN_STATUS']['NULL_INTERVAL'];throw _0x1904d4[_0x250d('0x40')]+_0x250d('0x72');}if(!isNotNull(_0x1904d4[_0x250d('0x71')][_0x250d('0x73')])){_0x1904d4['message']=utils[_0x250d('0x67')][_0x250d('0x74')];throw _0x1904d4[_0x250d('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x250d('0x75')](_0x1904d4[_0x250d('0x71')][_0x250d('0x73')]))){_0x1904d4['message']=utils[_0x250d('0x67')][_0x250d('0x74')];throw _0x1904d4[_0x250d('0x40')]+_0x250d('0x72');}};}function checkIsIVRCampaignActive(_0xee29dd){return function(){if(!utils['isIVRCampaignActive'](_0xee29dd)){_0xee29dd['message']=utils[_0x250d('0x67')][_0x250d('0x76')];throw _0xee29dd['name']+_0x250d('0x77');}};}function emitCampaignSummary(_0x1680b5){if(utils['isIVRCampaign'](_0x1680b5)){emit(util['format'](_0x250d('0x78'),_0x1680b5[_0x250d('0x40')]),_0x250d('0x79'),_0x1680b5);}}function loggerCatchQueueSummary(_0x811f81,_0x4ca6f1){return function(_0x34a938){clearPredictiveAttributes(_0x4ca6f1);emitCampaignSummary(_0x4ca6f1);loggerSyncQueueSummary[_0x250d('0x5b')](_0x811f81,util[_0x250d('0x3e')](_0x34a938,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x3c92a3){if(_0x3c92a3[_0x250d('0x7a')]){if(_0x3c92a3[_0x250d('0x7b')]===0x0){_0x3c92a3[_0x250d('0x7a')]=![];_0x3c92a3[_0x250d('0x64')]=utils[_0x250d('0x67')][_0x250d('0x76')];loggerSyncQueueSummary[_0x250d('0x5b')](_0x250d('0x7c'),_0x3c92a3['name'],_0x250d('0x7d'));}else{_0x3c92a3[_0x250d('0x64')]=utils[_0x250d('0x67')][_0x250d('0x7e')];loggerSyncQueueSummary[_0x250d('0x5b')](_0x250d('0x7c'),_0x3c92a3[_0x250d('0x40')],_0x250d('0x7f'));}emitCampaignSummary(_0x3c92a3);}}function myreject(_0x1cae65){return function(_0x57dce8){return _0x1cae65(msgResponse(_0x250d('0x80'),_0x250d('0x81'),JSON['stringify'](_0x57dce8)));};}Dialer[_0x250d('0x15')][_0x250d('0x82')]=function(_0x136070){return!_[_0x250d('0x3d')](_0x136070)&&_0x136070&&!_[_0x250d('0x3d')](_0x136070[_0x250d('0x40')])&&!_[_0x250d('0x3d')](_0x136070['active'])&&_0x136070[_0x250d('0x83')]&&(this[_0x250d('0x1c')][util[_0x250d('0x3f')]('SIP/%s',_0x136070[_0x250d('0x40')])][_0x250d('0x84')]===_0x250d('0x85')||this[_0x250d('0x1c')][util[_0x250d('0x3f')](_0x250d('0x86'),_0x136070[_0x250d('0x40')])][_0x250d('0x84')]===_0x250d('0x87'));};Dialer[_0x250d('0x15')][_0x250d('0x88')]=function(_0x80bc6){var _0x253b07=this;return function(){if(!_0x253b07['isTrunkReachable'](_0x80bc6[_0x250d('0x89')])){if(!_0x253b07[_0x250d('0x82')](_0x80bc6['TrunkBackup'])){_0x80bc6['message']=utils['CAMPAIGN_STATUS'][_0x250d('0x8a')];throw _0x80bc6[_0x250d('0x40')]+_0x250d('0x8b');}}};};Dialer[_0x250d('0x15')][_0x250d('0x8c')]=function(_0x4af433,_0x4223d2,_0x51c38b,_0x146707){var _0x4f1acc=this;return function(){var _0x73c3f1=!![];return _0x4f1acc[_0x250d('0x8d')](_0x4af433,_0x4223d2,_0x51c38b,_0x146707,_0x73c3f1);};};Dialer['prototype']['checkIfTimeIntervals']=function(_0x201155,_0x1e3c1d,_0x3cffde,_0x498923){var _0x322a8d=this;return function(){var _0x2d279c=![];return _0x322a8d['ifTimeIvr'](_0x201155[_0x250d('0x73')],_0x1e3c1d,_0x3cffde,_0x498923,_0x2d279c);};};Dialer[_0x250d('0x15')][_0x250d('0x8d')]=function(_0xd84200,_0x5d41e0,_0x33bd5c,_0x16107f,_0x5ac6ee){var _0x5c61b3=[];return new Promise(function(_0x3bfe76,_0x33537a){if(!isNotNull(_0xd84200)){_0x16107f[_0x250d('0x64')]=utils[_0x250d('0x67')][_0x250d('0x74')];return _0x33537a(msgResponse(_0x250d('0x8e'),_0x250d('0x8f'),_0x33bd5c+_0x250d('0x90')));}if(_[_0x250d('0x75')](_0xd84200)){_0x16107f[_0x250d('0x64')]=utils[_0x250d('0x67')][_0x250d('0x91')];return _0x33537a(msgResponse(_0x250d('0x8e'),_0x250d('0x8f'),_0x33bd5c+_0x250d('0x92')));}if(_0x5d41e0&&_[_0x250d('0x3d')](config[_0x250d('0x93')][_0x5d41e0])){_0x16107f['message']=utils['CAMPAIGN_STATUS'][_0x250d('0x94')];return _0x33537a(msgResponse('ifTime',_0x250d('0x8f'),_0x33bd5c+_0x250d('0x95')+_0x5d41e0));}if(_[_0x250d('0x96')](_0xd84200)){for(var _0x23f5e9=0x0;_0x23f5e9<_0xd84200[_0x250d('0x97')];_0x23f5e9+=0x1){_0x5c61b3[_0x250d('0x98')](ami[_0x250d('0x99')]({'action':'command','command':util[_0x250d('0x3f')](_0x250d('0x9a'),_0xd84200[_0x23f5e9][_0x250d('0x9b')],!_[_0x250d('0x3d')](config[_0x250d('0x93')][_0x5d41e0])?_0x5d41e0:'')})[_0x250d('0x3b')](function(_0x38d027){return _0x38d027['content'][_0x250d('0x9c')](_0x250d('0x9d'))>=0x0;})['catch'](myreject(_0x33537a)));}}else{_0x5c61b3[_0x250d('0x98')](ami[_0x250d('0x99')]({'action':_0x250d('0x9e'),'command':util[_0x250d('0x3f')](_0x250d('0x9a'),_0xd84200,!_[_0x250d('0x3d')](config['timezones'][_0x5d41e0])?_0x5d41e0:'')})['then'](function(_0x382a9e){return _0x382a9e[_0x250d('0x9f')][_0x250d('0x9c')]('true')>=0x0;})[_0x250d('0xa0')](myreject(_0x33537a)));}Promise['all'](_0x5c61b3)['then'](function(_0x1ce767){var _0x3963cf=_[_0x250d('0xa1')](_0x1ce767);if(_0x3963cf){return _0x3bfe76(_0x3963cf);}else{_0x16107f['message']=_0x5ac6ee?utils[_0x250d('0x67')][_0x250d('0xa2')]:utils[_0x250d('0x67')][_0x250d('0xa3')];return _0x33537a(msgResponse(_0x250d('0xa4'),'Failure',_0x250d('0xa5')+_0x5ac6ee+'\x20'+_0x33bd5c+_0x250d('0xa6')+util['inspect'](_0xd84200,{'showHidden':![],'depth':null})+_0x250d('0xa7')+_0x5d41e0));}})['catch'](function(_0x275e0e){return _0x33537a(msgResponse(_0x250d('0x8e'),_0x250d('0x8f'),JSON[_0x250d('0x6f')](_0x275e0e)));});});};Dialer[_0x250d('0x15')]['loopCampaigns']=function(){var _0x1bc4ab=this;return cmHopper[_0x250d('0xa8')]({'active':![]},{'where':{'active':!![]}})[_0x250d('0x3b')](function(){setInterval(function(){_0x1bc4ab['syncCampaigns']();},0x3e8);});};Dialer['prototype']['syncCampaigns']=function(){var _0xed5209=this;var _0x3244c3;for(var _0x1a2935 in this[_0x250d('0x1a')]){if(typeof this[_0x250d('0x1a')][_0x1a2935]!==_0x250d('0xa9')){_0x3244c3=this['campaigns'][_0x1a2935];if(utils[_0x250d('0xaa')](_0x3244c3)&&utils['isIVRCampaignActive'](_0x3244c3)){_0x3244c3[_0x250d('0x7a')]=!![];Promise[_0x250d('0xab')]()[_0x250d('0x3b')](checkIsIVRCampaignActive(_0x3244c3))[_0x250d('0x3b')](checkInterval(_0x3244c3))[_0x250d('0x3b')](_0xed5209[_0x250d('0x88')](_0x3244c3))[_0x250d('0x3b')](_0xed5209['checkIfTime'](_0x3244c3[_0x250d('0xac')],_0x3244c3[_0x250d('0xad')],_0x3244c3[_0x250d('0x40')],_0x3244c3))['then'](_0xed5209['checkIfTimeIntervals'](_0x3244c3[_0x250d('0x71')],_0x3244c3[_0x250d('0xad')],_0x3244c3['name'],_0x3244c3))[_0x250d('0x3b')](_0xed5209[_0x250d('0xae')](_0x3244c3))[_0x250d('0xa0')](loggerCatchQueueSummary('[syncCampaigns]',_0x3244c3));}else{notSendMessagesCampaign(_0x3244c3);}}}};Dialer[_0x250d('0x15')][_0x250d('0xaf')]=function(_0x57667a){if(_0x57667a[_0x250d('0xb0')]!=='predictive'){clearPredictiveAttributes(_0x57667a);}switch(_0x57667a[_0x250d('0xb0')]){case _0x250d('0xb1'):this['handlePower'](_0x57667a,0x1);break;case'power':this['handlePower'](_0x57667a,_0x57667a[_0x250d('0xb2')]);break;case _0x250d('0xb3'):this[_0x250d('0xb3')](_0x57667a);break;case'booked':this[_0x250d('0xb4')](_0x57667a,0x1);break;default:logger[_0x250d('0x5f')](_0x250d('0xb5'),_0x57667a['name'],_0x250d('0xb6'));}};Dialer[_0x250d('0x15')][_0x250d('0x8e')]=function(_0xfa9edc,_0x4f6ed7){var _0x4aec75=_0xfa9edc[_0x250d('0xad')];var _0x20c376=_0x4f6ed7?_0xfa9edc['dialGlobalInterval']:_0xfa9edc[_0x250d('0x71')][_0x250d('0x73')];logger['silly'](_0x250d('0xb7'),_0x20c376,_0x4aec75,_0xfa9edc[_0x250d('0x40')],util[_0x250d('0x3f')](_0x250d('0xb8'),_0xfa9edc[_0x250d('0x40')],_0xfa9edc['id']));var _0x5f2b43=null;return Interval[_0x250d('0xb9')](_0x20c376,_0x4aec75)[_0x250d('0x3b')](function(_0x562912){if(_0x562912===!![]){return _0x562912;}else{_0xfa9edc[_0x250d('0x64')]=_0x4f6ed7?utils[_0x250d('0x67')][_0x250d('0xa2')]:utils[_0x250d('0x67')]['OVERTIME_INTERVAL'];_0x5f2b43=msgResponse(_0x250d('0xa4'),_0x250d('0x8f'),_0x250d('0xa5')+_0x4f6ed7+'\x20'+_0xfa9edc[_0x250d('0x40')]+_0x250d('0xa6')+util[_0x250d('0x3e')](_0x20c376,{'showHidden':![],'depth':null})+_0x250d('0xa7')+_0x4aec75);}if(_0x5f2b43!==null){logger['silly']('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0x5f2b43);_0x5f2b43[_0x250d('0xba')]=_0x4f6ed7;throw _0x5f2b43;}})['catch'](function(_0x1e9502){logger[_0x250d('0x5f')](_0x250d('0xbb'),_0x1e9502);throw msgResponse(_0x250d('0x80'),_0x250d('0x81'),util[_0x250d('0x3e')](_0x1e9502,{'showHidden':![],'depth':null}));});};Dialer[_0x250d('0x15')]['syncAgentConnect']=function(_0x32c2a5){if(this[_0x250d('0x19')][_0x32c2a5[_0x250d('0xbc')]]){if(this['uniqueId'][_0x32c2a5[_0x250d('0xbd')]]&&this[_0x250d('0x1f')][_0x32c2a5[_0x250d('0xbd')]][_0x250d('0xbe')]!==_0x250d('0xbf')){this[_0x250d('0xc0')](this[_0x250d('0x19')][_0x32c2a5['queue']]);this['uniqueId'][_0x32c2a5[_0x250d('0xbd')]]['answertime']=moment()[_0x250d('0x3f')](_0x250d('0xc1'));}}};Dialer['prototype']['syncAgentComplete']=function(_0x5d4e8b){var _0x1117c2=this['uniqueId'][_0x5d4e8b[_0x250d('0xbd')]];if(this['voiceQueues'][_0x5d4e8b[_0x250d('0xbc')]]){if(_0x1117c2&&_0x1117c2['type']!==_0x250d('0xbf')){delete this[_0x250d('0x1f')][_0x5d4e8b[_0x250d('0xbd')]];this['voiceQueues'][_0x5d4e8b[_0x250d('0xbc')]]['outboundAnswerCallsDay']+=0x1;var _0x2da1d8=new AgentComplete(_0x1117c2,_0x5d4e8b);if(_0x5d4e8b['reason']==='agent'){_0x2da1d8[_0x250d('0xc2')]=this[_0x250d('0x19')][_0x5d4e8b['queue']]['dialQueueProject2']&&this[_0x250d('0x19')][_0x5d4e8b[_0x250d('0xbc')]][_0x250d('0xc3')]?moment()[_0x250d('0x3f')](_0x250d('0xc1')):undefined;}hopperUtils['createHistory'](_0x2da1d8)[_0x250d('0xa0')](loggerCatch(_0x250d('0xc4')));hopperUtils['moveContactManagedDialer'](_0x2da1d8)[_0x250d('0xa0')](loggerCatch(_0x250d('0xc5')));}}};Dialer[_0x250d('0x15')][_0x250d('0x2b')]=function(_0x12de75){var _0x2a0149=this['uniqueId'][_0x12de75['uniqueid']];var _0x7d027=this;var _0xae2ccf=![];var _0x24a337;var _0x3ced02;if(this['voiceQueues'][_0x12de75['queue']]){if(_0x2a0149&&_0x2a0149['type']!==_0x250d('0xbf')){delete this[_0x250d('0x1f')][_0x12de75[_0x250d('0xbd')]];this[_0x250d('0xc0')](this['voiceQueues'][_0x12de75[_0x250d('0xbc')]]);_0x2a0149[_0x250d('0xc6')]=moment()[_0x250d('0x3f')](_0x250d('0xc1'));var _0x294fa0=new QueueCallerAbandon(_0x2a0149,_0x12de75);if(utils['getSeconds'](_0x2a0149['droptime'],_0x2a0149[_0x250d('0xc7')])>=_0x2a0149['dialQueueTimeout']){this[_0x250d('0x19')][_0x12de75['queue']]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x250d('0x19')][_0x12de75[_0x250d('0xbc')]][_0x250d('0xc8')]+=0x1;this[_0x250d('0x19')][_0x12de75[_0x250d('0xbc')]][_0x250d('0xc9')]+=0x1;_0x294fa0[_0x250d('0x6a')]=0xa;_0x294fa0[_0x250d('0x6b')]=_0x250d('0xca');_0x294fa0['dropreason']=_0x250d('0xcb');_0x294fa0['agiafterat']=this[_0x250d('0x19')][_0x12de75['queue']][_0x250d('0xcc')]?moment()[_0x250d('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x294fa0[_0x250d('0xcd')]+=0x1;_0x294fa0[_0x250d('0xce')]+=0x1;_0x24a337=this[_0x250d('0x19')][_0x12de75['queue']]['dialDropRetryFrequency'];_0x3ced02=this[_0x250d('0x19')][_0x12de75['queue']]['callAdditionalPhoneAfterMin'];hopperUtils[_0x250d('0xcf')](_0x294fa0,_0x294fa0[_0x250d('0x6a')],_0x2a0149[_0x250d('0xd0')])[_0x250d('0x3b')](function(_0x22bd84){_0xae2ccf=_0x22bd84[_0x250d('0xd1')]==0x1;if(_0x294fa0['countdropretry']>=_0x7d027[_0x250d('0x19')][_0x12de75[_0x250d('0xbc')]][_0x250d('0xd2')]){_0x7d027[_0x250d('0xd3')](_0x294fa0,_0x22bd84[_0x250d('0xd1')]);}else{hopperUtils[_0x250d('0xd4')]({'active':![],'countdropretry':_0x294fa0['countdropretry'],'scheduledat':moment()[_0x250d('0xd5')](_0x7d027[_0x250d('0x19')][_0x12de75[_0x250d('0xbc')]][_0x250d('0xd6')],_0x250d('0xd7'))[_0x250d('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2a0149[_0x250d('0xd8')],'ListId':_0x2a0149[_0x250d('0xd9')],'VoiceQueueId':_0x2a0149[_0x250d('0xda')]||undefined,'CampaignId':_0x2a0149['CampaignId']||undefined})[_0x250d('0xa0')](loggerCatch(_0x250d('0xdb')));var _0x4c6207=new History(_0x294fa0);_0x4c6207[_0x250d('0x6a')]=0xa;_0x4c6207[_0x250d('0x6b')]='Drop';_0x4c6207['starttime']=moment()[_0x250d('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4c6207[_0x250d('0xdc')]=_0x4c6207[_0x250d('0x6c')];_0x4c6207['calleridname']=_0x294fa0[_0x250d('0xdd')];_0x4c6207[_0x250d('0xde')]=_0x294fa0[_0x250d('0xde')];hopperUtils[_0x250d('0xdf')](_0x4c6207)[_0x250d('0xa0')](loggerCatch(_0x250d('0xe0')));}})['then'](function(){if(_0xae2ccf)hopperUtils[_0x250d('0xe1')](_0x294fa0,_0x24a337,_0x3ced02)[_0x250d('0x3b')](function(){return 0x1;});});}else{this['voiceQueues'][_0x12de75[_0x250d('0xbc')]][_0x250d('0x49')]+=0x1;this['voiceQueues'][_0x12de75[_0x250d('0xbc')]][_0x250d('0xe2')]+=0x1;_0x294fa0[_0x250d('0x6a')]=0xb;_0x294fa0['statedesc']='Abandoned';_0x294fa0[_0x250d('0xe3')]=_0x250d('0xe4');_0x294fa0[_0x250d('0xe5')]+=0x1;_0x294fa0[_0x250d('0xce')]+=0x1;_0x24a337=this[_0x250d('0x19')][_0x12de75['queue']][_0x250d('0xe6')];_0x3ced02=this[_0x250d('0x19')][_0x12de75[_0x250d('0xbc')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0x250d('0xcf')](_0x294fa0,_0x294fa0[_0x250d('0x6a')],_0x2a0149['voiceQueue'])[_0x250d('0x3b')](function(_0x121162){if(_0x294fa0[_0x250d('0xe5')]>=_0x7d027[_0x250d('0x19')][_0x12de75[_0x250d('0xbc')]][_0x250d('0xe7')]){_0x7d027[_0x250d('0xd3')](_0x294fa0,_0x121162['additional']);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x294fa0[_0x250d('0xe5')],'scheduledat':moment()[_0x250d('0xd5')](_0x7d027[_0x250d('0x19')][_0x12de75[_0x250d('0xbc')]][_0x250d('0xe6')],_0x250d('0xd7'))[_0x250d('0x3f')](_0x250d('0xc1')),'ContactId':_0x2a0149[_0x250d('0xd8')],'ListId':_0x2a0149[_0x250d('0xd9')],'VoiceQueueId':_0x2a0149['VoiceQueueId']||undefined,'CampaignId':_0x2a0149[_0x250d('0xe8')]||undefined})['catch'](loggerCatch(_0x250d('0xe9')));var _0x5477c9=new History(_0x294fa0);_0x5477c9[_0x250d('0x6a')]=0xb;_0x5477c9['statedesc']='Abandoned';_0x5477c9[_0x250d('0x6c')]=moment()[_0x250d('0x3f')](_0x250d('0xc1'));_0x5477c9[_0x250d('0xdc')]=_0x5477c9[_0x250d('0x6c')];_0x5477c9[_0x250d('0xdd')]=_0x294fa0[_0x250d('0xdd')];_0x5477c9[_0x250d('0xde')]=_0x294fa0['calleridnum'];hopperUtils[_0x250d('0xdf')](_0x5477c9)[_0x250d('0xa0')](loggerCatch(_0x250d('0xea')));}})[_0x250d('0x3b')](function(){if(_0xae2ccf)hopperUtils[_0x250d('0xe1')](_0x294fa0,_0x24a337,_0x3ced02)[_0x250d('0x3b')](function(){return 0x1;});});}}}};Dialer['prototype'][_0x250d('0x35')]=function(_0x706f49){if(this[_0x250d('0x1e')][_0x706f49[_0x250d('0xbd')]]){this['actions'][_0x706f49[_0x250d('0xbd')]]['channel']=_0x706f49[_0x250d('0xeb')];}if(this['uniqueId'][_0x706f49[_0x250d('0xbd')]]){this[_0x250d('0x1f')][_0x706f49[_0x250d('0xbd')]]['channel']=_0x706f49['channel'];}};Dialer[_0x250d('0x15')]['syncQueueMember']=function(_0x264cf5){if(!this[_0x250d('0x1e')][_0x264cf5[_0x250d('0xec')]]){return;}var _0x231f65=this[_0x250d('0x19')][this[_0x250d('0x1e')][_0x264cf5[_0x250d('0xec')]][_0x250d('0xbc')]]['strategy']||_0x250d('0xed');if(_0x231f65===_0x250d('0xee')){if(this['actions'][_0x264cf5[_0x250d('0xec')]]&&_[_0x250d('0xef')](this[_0x250d('0x1e')][_0x264cf5[_0x250d('0xec')]]['locked'])&&_0x264cf5[_0x250d('0x84')]==='1'&&_0x264cf5[_0x250d('0xf0')]==='0'){if(this['agents'][_0x264cf5['stateinterface']]){if(!this['agents'][_0x264cf5[_0x250d('0xf1')]]['locked']){this[_0x250d('0x1b')][_0x264cf5[_0x250d('0xf1')]][_0x250d('0xf2')]=!![];this[_0x250d('0x1e')][_0x264cf5[_0x250d('0xec')]][_0x250d('0xf2')]=!![];this[_0x250d('0x1e')][_0x264cf5[_0x250d('0xec')]][_0x250d('0xf1')]=_0x264cf5[_0x250d('0xf1')];}}}}else if(_0x231f65===_0x250d('0xed')){if(this['actions'][_0x264cf5['actionid']]){if(this[_0x250d('0x1b')][_0x264cf5[_0x250d('0xf1')]]){this[_0x250d('0x1e')][_0x264cf5['actionid']][_0x250d('0xf1')]=_0x264cf5[_0x250d('0xf1')];if(_[_0x250d('0xef')](this[_0x250d('0x24')][this[_0x250d('0x1e')][_0x264cf5[_0x250d('0xec')]][_0x250d('0xbc')]])){this[_0x250d('0x24')][this['actions'][_0x264cf5['actionid']][_0x250d('0xbc')]]=[];}this[_0x250d('0x24')][this['actions'][_0x264cf5[_0x250d('0xec')]][_0x250d('0xbc')]][_0x250d('0x98')](_[_0x250d('0x59')](_[_0x250d('0x70')](this[_0x250d('0x1e')][_0x264cf5[_0x250d('0xec')]],[_0x250d('0xf3'),'stateinterface']),{'status':_0x264cf5[_0x250d('0x84')],'paused':_0x264cf5[_0x250d('0xf0')]}));}}}};Dialer[_0x250d('0x15')][_0x250d('0xf4')]=function(_0x3e3247){if(!this[_0x250d('0x1e')][_0x3e3247['actionid']]){return;}var _0x543e12=this;var _0x52703c=this[_0x250d('0x19')][this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]];var _0x4c7f7f=_0x52703c[_0x250d('0xf5')]||_0x250d('0xed');if(_0x4c7f7f===_0x250d('0xee')){if(this['actions'][_0x3e3247[_0x250d('0xec')]]&&this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]]['stateinterface']){this[_0x250d('0xf6')][_0x250d('0xf7')](this[_0x250d('0x1e')][_0x3e3247['actionid']]['idHopper'],this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xf1')])[_0x250d('0xa0')](function(_0x1a452f){logger[_0x250d('0x5f')](_0x250d('0xf8'),util['inspect'](_0x1a452f,{'showHidden':![],'depth':null}));})[_0x250d('0x17')](function(){_0x543e12[_0x250d('0xc0')](_0x543e12[_0x250d('0x19')][_0x543e12[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]]);_0x543e12[_0x250d('0x1b')][_0x543e12[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xf1')]]['locked']=![];delete _0x543e12[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]];unlockQueueStatus(_0x52703c);});}else{this[_0x250d('0xc0')](this[_0x250d('0x19')][this['actions'][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]]);hopperUtils[_0x250d('0xd4')]({'active':![],'ContactId':this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]]['ContactId'],'ListId':this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]]['ListId'],'VoiceQueueId':this[_0x250d('0x1e')][_0x3e3247['actionid']][_0x250d('0xda')]||undefined,'CampaignId':this['actions'][_0x3e3247[_0x250d('0xec')]][_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x3e3247[_0x250d('0xec')]];unlockQueueStatus(_0x52703c);}}else if(_0x4c7f7f==='rrmemory'){var _0x31b1dd;if(this['actions'][_0x3e3247[_0x250d('0xec')]]&&!_[_0x250d('0x75')](this[_0x250d('0x24')][this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]]['queue']])){if(this['queueBookedRR'][_0x543e12[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]]){this[_0x250d('0x25')][_0x543e12[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]]=this[_0x250d('0x25')][this['actions'][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]]?this['queueBookedRR'][this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]]:this[_0x250d('0x24')][this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]]?this['queueBooked'][this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]][_0x250d('0xf9')]||0x0:0x0;}this['queueBooked'][this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]][_0x250d('0xf9')]=this[_0x250d('0x25')][this[_0x250d('0x1e')][_0x3e3247[_0x250d('0xec')]][_0x250d('0xbc')]];for(var _0x229ca9=0x0;_0x229ca9=_0x526080[_0x250d('0x11e')]){_0x119f09[_0x250d('0x11f')](_0x393294,_0x14a6d4,_0x192c38,'reason19\x20machine....');}else{if(_0x393294[_0x250d('0x118')]>=_0x526080[_0x250d('0x120')]){_0x119f09['createStateFinal'](_0x393294,_0x14a6d4,_0x192c38,'reason\x2019\x20machine....');}else{hopperUtils[_0x250d('0xd4')]({'active':![],'countmachineretry':_0x393294[_0x250d('0x118')],'scheduledat':moment()[_0x250d('0xd5')](_0x526080['dialMachineRetryFrequency'],_0x250d('0xd7'))['format'](_0x250d('0xc1')),'ContactId':_0x393294[_0x250d('0xd8')],'ListId':_0x393294[_0x250d('0xd9')],'VoiceQueueId':_0x393294['VoiceQueueId']||undefined,'CampaignId':_0x393294[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch('[rescheduleContact][Machine]'));_0x14a6d4({'reschedule':0x1});}}});}if(_0x441e39[_0x250d('0xbe')]===_0x250d('0xbf')&&this[_0x250d('0x1a')][_0x441e39[_0x250d('0xbc')]][_0x250d('0x10b')]&&_0x16f2f0[_0x250d('0x121')]===_0x250d('0x10c')){delete this[_0x250d('0x1f')][_0x16f2f0[_0x250d('0xbd')]];this[_0x250d('0xc0')](this[_0x250d('0x1a')][_0x441e39['queue']]);_0x23048f=new Hangup(_0x441e39,_0x16f2f0);_0x23048f[_0x250d('0x6a')]=0x12;_0x23048f['statedesc']=_0x250d('0x10e');_0x23048f[_0x250d('0x10f')]=_0x250d('0x110');ami['emit'](_0x250d('0x112'),ut['buildObj'](_0x23048f,_0x250d('0x113')));this[_0x250d('0x114')](_0x23048f,_0x250d('0x122'),_0x250d('0x123'));}if(_0x441e39['type']===_0x250d('0xbf')&&this[_0x250d('0x1a')][_0x441e39[_0x250d('0xbc')]][_0x250d('0x10b')]&&_0x16f2f0[_0x250d('0x121')]===_0x250d('0x124')){return new Promise(function(_0x435c39,_0x330d47){delete _0x119f09[_0x250d('0x1f')][_0x16f2f0['uniqueid']];_0x119f09[_0x250d('0xc0')](_0x119f09[_0x250d('0x1a')][_0x441e39[_0x250d('0xbc')]]);_0x119f09[_0x250d('0x1a')][_0x441e39[_0x250d('0xbc')]][_0x250d('0x117')]+=0x1;_0x119f09[_0x250d('0x1a')][_0x441e39[_0x250d('0xbc')]][_0x250d('0x10d')]+=0x1;var _0x5909b9=_0x119f09[_0x250d('0x1a')][_0x441e39[_0x250d('0xbc')]];var _0x42889a=new Hangup(_0x441e39,_0x16f2f0);_0x42889a[_0x250d('0x6a')]=0x13;_0x42889a[_0x250d('0x6b')]=_0x250d('0x125');_0x42889a[_0x250d('0x10f')]='AMD';_0x42889a[_0x250d('0x118')]+=0x1;_0x42889a[_0x250d('0xce')]+=0x1;_0x42889a[_0x250d('0x113')]=!![];ami[_0x250d('0x111')](_0x250d('0x112'),ut[_0x250d('0x126')](_0x42889a,'amd'));hopperUtils[_0x250d('0xdf')](_0x42889a)[_0x250d('0xa0')](loggerCatch(_0x250d('0x119')));if(_0x42889a[_0x250d('0x11a')]+_0x42889a[_0x250d('0x11b')]+_0x42889a[_0x250d('0x11c')]+_0x42889a[_0x250d('0x11d')]+_0x42889a['countdropretry']+_0x42889a[_0x250d('0xe5')]+_0x42889a[_0x250d('0x118')]+_0x42889a['countagentrejectretry']>=_0x5909b9[_0x250d('0x11e')]){_0x119f09[_0x250d('0x11f')](_0x42889a,_0x435c39,_0x330d47,_0x250d('0x127'));}else{if(_0x42889a[_0x250d('0x118')]>=_0x5909b9[_0x250d('0x120')]){_0x119f09[_0x250d('0x128')](_0x42889a,_0x435c39,_0x330d47,_0x250d('0x129'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x42889a[_0x250d('0x118')],'scheduledat':moment()[_0x250d('0xd5')](_0x5909b9[_0x250d('0x12a')],_0x250d('0xd7'))[_0x250d('0x3f')](_0x250d('0xc1')),'ContactId':_0x42889a[_0x250d('0xd8')],'ListId':_0x42889a['ListId'],'VoiceQueueId':_0x42889a['VoiceQueueId']||undefined,'CampaignId':_0x42889a[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch(_0x250d('0x12b')));_0x435c39({'reschedule':0x1});}}});}}};Dialer[_0x250d('0x15')][_0x250d('0x33')]=function(_0x58667c){var _0x29c51b=this[_0x250d('0x1f')][_0x58667c[_0x250d('0xbd')]];var _0xb39172;if(_0x29c51b&&_0x29c51b['type']===_0x250d('0xbf')){delete this[_0x250d('0x1f')][_0x58667c[_0x250d('0xbd')]];this[_0x250d('0xc0')](this[_0x250d('0x1a')][_0x29c51b[_0x250d('0xbc')]]);this[_0x250d('0x1a')][_0x29c51b['queue']][_0x250d('0x12c')]+=0x1;_0xb39172=new Hangup(_0x29c51b,_0x58667c);hopperUtils['createHistory'](_0xb39172)[_0x250d('0xa0')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0xb39172)[_0x250d('0xa0')](loggerCatch(_0x250d('0x12d')));}if(_0x29c51b&&_0x29c51b[_0x250d('0xbe')]!==_0x250d('0xbf')&&isNotNull(this['voiceQueues'][_0x29c51b[_0x250d('0xbc')]]['dialQueueProject'])){delete this[_0x250d('0x1f')][_0x58667c[_0x250d('0xbd')]];this[_0x250d('0xc0')](this['voiceQueues'][_0x29c51b['queue']]);this[_0x250d('0x19')][_0x29c51b[_0x250d('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0x250d('0x19')][_0x29c51b['queue']][_0x250d('0x10d')]+=0x1;_0xb39172=new Hangup(_0x29c51b,_0x58667c);_0xb39172[_0x250d('0x6a')]=0x10;_0xb39172['statedesc']=_0x250d('0x12e');_0xb39172[_0x250d('0x10f')]='AGI';hopperUtils['createHistory'](_0xb39172)[_0x250d('0xa0')](loggerCatch(_0x250d('0x12f')));hopperUtils[_0x250d('0x130')](_0xb39172)[_0x250d('0xa0')](loggerCatch(_0x250d('0x12d')));}if(_0x29c51b&&_0x29c51b[_0x250d('0xbe')]!==_0x250d('0xbf')&&!isNotNull(this[_0x250d('0x19')][_0x29c51b[_0x250d('0xbc')]][_0x250d('0x131')])){if(_0x58667c['cause-txt']===_0x250d('0x132')){delete this['uniqueId'][_0x58667c[_0x250d('0xbd')]];this[_0x250d('0x19')][_0x29c51b[_0x250d('0xbc')]][_0x250d('0x117')]+=0x1;const _0x238c99=new AgentComplete(_0x29c51b,_0x58667c);_0x238c99[_0x250d('0xe8')]=this[_0x250d('0x19')][_0x29c51b['queue']]['id'];hopperUtils[_0x250d('0xdf')](_0x238c99)[_0x250d('0xa0')](loggerCatch(_0x250d('0xc4')));hopperUtils[_0x250d('0x130')](_0x238c99)[_0x250d('0xa0')](loggerCatch(_0x250d('0xc5')));}else{delete this['uniqueId'][_0x58667c[_0x250d('0xbd')]];this[_0x250d('0xc0')](this[_0x250d('0x19')][_0x29c51b['queue']]);this[_0x250d('0x19')][_0x29c51b[_0x250d('0xbc')]][_0x250d('0x133')]+=0x1;_0xb39172=new Hangup(_0x29c51b,_0x58667c);_0xb39172[_0x250d('0x6a')]=0xc;_0xb39172[_0x250d('0x6b')]=_0x58667c[_0x250d('0x134')];_0xb39172[_0x250d('0x10f')]=_0x250d('0x135');hopperUtils[_0x250d('0xdf')](_0xb39172)[_0x250d('0xa0')](loggerCatch(_0x250d('0x12f')));hopperUtils[_0x250d('0x130')](_0xb39172)[_0x250d('0xa0')](loggerCatch(_0x250d('0x12d')));}}};Dialer[_0x250d('0x15')][_0x250d('0x8')]=function(_0x1de5eb){var _0x11a5c2=this;if(!_0x11a5c2[_0x250d('0x26')][_0x1de5eb['name']]){_0x11a5c2[_0x250d('0x26')][_0x1de5eb[_0x250d('0x40')]]={'running':![]};}else if(_0x11a5c2[_0x250d('0x26')][_0x1de5eb[_0x250d('0x40')]][_0x250d('0x136')]===!![]){return;}else if(_0x11a5c2['queuesSummary'][_0x1de5eb['name']]['running']===![]){_0x11a5c2[_0x250d('0x26')][_0x1de5eb[_0x250d('0x40')]][_0x250d('0x136')]=!![];}var _0xd1a0ba=_0x11a5c2[_0x250d('0x19')][_0x1de5eb[_0x250d('0x40')]];var _0x4e0c7b=_0xd1a0ba['message']!==utils[_0x250d('0x67')]['INACTIVE'];var _0x1cc4d3=utils[_0x250d('0x137')](_0xd1a0ba);_0xd1a0ba['statusMessage']=utils['getQueueCampaignStatusMessage'](_0xd1a0ba,_0x11a5c2[_0x250d('0x1c')]);Promise[_0x250d('0xab')]()[_0x250d('0x3b')](function(){if(_0xd1a0ba[_0x250d('0x138')]===utils['CAMPAIGN_STATUS'][_0x250d('0x76')]){if(_0x4e0c7b){clearPredictiveAttributes(_0xd1a0ba);_0x1de5eb[_0x250d('0x21')]=undefined;_0x1de5eb[_0x250d('0x22')]=undefined;}if(_0xd1a0ba[_0x250d('0x138')]===utils[_0x250d('0x67')][_0x250d('0x76')]){_0x1de5eb['available']=0x0;_0x1de5eb[_0x250d('0xf0')]=0x0;_0x1de5eb[_0x250d('0x139')]=0x0;_0x1de5eb[_0x250d('0x13a')]=0x0;_0x1de5eb[_0x250d('0x13b')]=0x0;}}else if(_0xd1a0ba[_0x250d('0x138')]===utils[_0x250d('0x67')][_0x250d('0x13c')]&&!_0x1cc4d3){return _0x11a5c2['ifTime'](_0xd1a0ba,!![])['then'](function(){return _0x11a5c2[_0x250d('0x8e')](_0xd1a0ba,![]);})[_0x250d('0x3b')](function(){return _0x11a5c2[_0x250d('0xaf')](_0xd1a0ba);})[_0x250d('0xa0')](function(_0x5a87a3){loggerSyncQueueSummary['debug'](_0x250d('0x13d'),util[_0x250d('0x3e')](_0x5a87a3,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0xd1a0ba);});}else{clearPredictiveAttributes(_0xd1a0ba);}})[_0x250d('0x3b')](function(){var _0x282919=_0x1de5eb[_0x250d('0x13e')](_0xd1a0ba);if(_0x282919||_0xd1a0ba[_0x250d('0x13f')]){_0xd1a0ba[_0x250d('0x13f')]=![];_0x1de5eb['updateReportFromOutboundQueue'](_0xd1a0ba);Object[_0x250d('0x140')](_0xd1a0ba,_0x1de5eb);emitOutboundVoiceQueueSummary(_0x1de5eb);}_0x11a5c2[_0x250d('0x26')][_0xd1a0ba['name']][_0x250d('0x136')]=![];})[_0x250d('0xa0')](function(_0x3c224d){logger[_0x250d('0x5f')](_0x250d('0x13d'),util['inspect'](_0x3c224d,{'showHidden':![],'depth':null}));_0x11a5c2[_0x250d('0x26')][_0xd1a0ba[_0x250d('0x40')]]['running']=![];});};Dialer['prototype'][_0x250d('0x31')]=_[_0x250d('0x141')](function(){var _0x43fdaa=_[_0x250d('0x142')](this[_0x250d('0x19')],function(_0x56f0b5){return _0x56f0b5[_0x250d('0x143')];});var _0x9e2033=_['filter'](this[_0x250d('0x1b')],function(_0x10c277){return _0x10c277['online']&&_0x10c277[_0x250d('0x84')]===_0x250d('0x85');});if(_0x43fdaa[_0x250d('0x97')]>0x0&&_0x9e2033[_0x250d('0x97')]>0x0){return Promise['resolve']()[_0x250d('0x3b')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x43fdaa,'id'),previewRecallmeReminderInterval,_[_0x250d('0x144')](_0x9e2033,'id')))[_0x250d('0x3b')](function(_0x2d968b){for(var _0x1abf92=0x0;_0x1abf92<_0x2d968b['length'];_0x1abf92++){var _0x889f76=_0x2d968b[_0x1abf92]['Agent'][_0x250d('0x40')];if(_0x889f76)io['to'](util[_0x250d('0x3f')](_0x250d('0x145'),_0x889f76))[_0x250d('0x111')](_0x250d('0x146'),{'hopper':_0x2d968b[_0x1abf92]});}})[_0x250d('0xa0')](function(_0x26229b){logger[_0x250d('0x5f')](_0x250d('0x147'),_0x26229b);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0x250d('0x148')]=function(){var _0x262519=this;setInterval(function(){_0x262519['clearZombieChannels'](_0x262519[_0x250d('0x1f')],_0x250d('0x149'));_0x262519['clearZombieChannels'](_0x262519[_0x250d('0x1e')],_0x250d('0x14a'));},0x32c8);};Dialer[_0x250d('0x15')][_0x250d('0x14b')]=function(_0x347078,_0x3c8716){var _0x58186a=this;for(var _0x485a60 in _0x347078){if(typeof _0x347078[_0x485a60]!=='undefined'){this['sequence'][_0x250d('0x14c')](function(){if(!_[_0x250d('0xef')](_0x347078[_0x485a60])){return ami['Action']({'action':'status','channel':_0x347078[_0x485a60][_0x250d('0xeb')]})['catch'](function(_0x3d10f7){if(_0x3d10f7[_0x250d('0x64')]===_0x250d('0x14d')){setTimeout(function(){if(_0x347078[_0x485a60]&&_0x347078[_0x485a60][_0x250d('0xbe')]!=='ivr'){_0x58186a[_0x250d('0xc0')](_0x58186a['voiceQueues'][_0x347078[_0x485a60][_0x250d('0xbc')]]);logger[_0x250d('0x5f')](_0x250d('0x14e'),_0x3c8716,_0x485a60,_0x347078[_0x485a60]['queue']);delete _0x347078[_0x485a60];}if(_0x347078[_0x485a60]&&_0x347078[_0x485a60]['type']==='ivr'){_0x58186a['updateOriginated'](_0x58186a[_0x250d('0x1a')][_0x347078[_0x485a60]['queue']]);logger[_0x250d('0x5f')]('[Dialer][checkChannel][ivr]',_0x3c8716,_0x485a60,_0x347078[_0x485a60][_0x250d('0xbc')]);delete _0x347078[_0x485a60];}},0x2328);}});}});}}};Dialer[_0x250d('0x15')][_0x250d('0x14f')]=function(_0x1fcfad){return Promise[_0x250d('0xab')]()[_0x250d('0x3b')](voiceQueueRt[_0x250d('0x14f')](_0x1fcfad))[_0x250d('0xa0')](loggerCatch(_0x250d('0x150')));};Dialer[_0x250d('0x15')][_0x250d('0xc0')]=function(_0x3b1db4){if(!_[_0x250d('0x3d')](_0x3b1db4)&&_0x3b1db4!==null){if(typeof _0x3b1db4[_0x250d('0x7b')]!=='undefined'){if(_0x3b1db4[_0x250d('0x7b')]>0x0){_0x3b1db4['originated']-=0x1;}else{logger['error'](_0x250d('0x151'));}}}else{logger[_0x250d('0x5f')](_0x250d('0x152'));}};Dialer[_0x250d('0x15')]['loggerHandler']=function(_0x4aaea5,_0xa9ed56){var _0x554167=this;return function(_0x54b9bc){_0x554167[_0x250d('0xc0')](_0xa9ed56);logger['error'](_0x4aaea5,util[_0x250d('0x3e')](_0x54b9bc,{'showHidden':![],'depth':null}));};};Dialer[_0x250d('0x15')]['emptyContact']=function(_0x586923,_0x2f8dcb,_0x4047ae){var _0x358945={'state':0x19,'statedesc':_0x250d('0x153')};this[_0x250d('0xc0')](_0x2f8dcb);this[_0x250d('0x114')](_[_0x250d('0x59')](_0x358945,_['pick'](_0x4047ae,[_0x250d('0xd8'),_0x250d('0xd9'),_0x250d('0x154'),_0x250d('0xda'),_0x250d('0xe8')])),_0x250d('0x155'),_0x250d('0x156'));logger[_0x250d('0x5f')](_0x586923);};Dialer['prototype'][_0x250d('0x114')]=function(_0x4789b0,_0x2295bd,_0x25ab2c){hopperUtils[_0x250d('0xdf')](_0x4789b0)[_0x250d('0xa0')](loggerCatch(_0x2295bd));hopperUtils[_0x250d('0x130')](_0x4789b0)[_0x250d('0xa0')](loggerCatch(_0x25ab2c));};Dialer[_0x250d('0x15')][_0x250d('0xd3')]=function(_0x38d2a0,_0x22c6ec){hopperUtils[_0x250d('0xdf')](_0x38d2a0)['catch'](loggerCatch(_0x250d('0xc4')));if(_0x22c6ec==0x0){hopperUtils[_0x250d('0x130')](_0x38d2a0)[_0x250d('0xa0')](loggerCatch(_0x250d('0x157')));}};Dialer['prototype'][_0x250d('0x147')]=function(_0x547743){return Promise[_0x250d('0xab')]()[_0x250d('0x3b')](cmHopper[_0x250d('0x158')](_0x547743['id'],previewRecallmeReminderInterval))[_0x250d('0x3b')](function(_0x4533a0){for(var _0x1dd132=0x0;_0x1dd132<_0x4533a0['length'];_0x1dd132++){var _0x34dc4c=_0x4533a0[_0x1dd132][_0x250d('0x159')][_0x250d('0x40')];if(_0x34dc4c)io['to'](util['format']('user:%s',_0x34dc4c))['emit'](_0x250d('0x146'),{'hopper':_0x4533a0[_0x1dd132]});}})[_0x250d('0xa0')](function(){});};Dialer[_0x250d('0x15')]['launchHandleIvr']=function(_0x2981be){var _0x2ad99f=this;return function(){_0x2ad99f[_0x250d('0x15a')](_0x2981be);};};Dialer[_0x250d('0x15')][_0x250d('0x15b')]=function(_0x3d240f,_0x1e8bf1){var _0x2ef307=this;var _0x28f92e=uuid['v4']();this[_0x250d('0x1e')][_0x28f92e]=new Action(_0x3d240f,_0x1e8bf1,_0x28f92e);return new Promise(function(_0x586f1c,_0x562566){if(_[_0x250d('0x3d')](_0x3d240f)&&typeof _0x3d240f!==_0x250d('0x15c')){return _0x562566(msgResponse(_0x250d('0x15d'),'Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x250d('0x3d')](_0x1e8bf1[_0x250d('0x15e')])||_0x1e8bf1['phone']===null){return _0x562566(msgResponse(_0x250d('0x15d'),'Failure','contact\x20is\x20undefine'));}var _0x568a72={'XMD-CALLERID':_0x2ef307['actions'][_0x28f92e][_0x250d('0x15f')](),'XMD-AGI':_0x3d240f[_0x250d('0x131')]?util[_0x250d('0x3f')]('\x22agi://%s/square,%s\x22',ipAgi,_0x3d240f[_0x250d('0x131')]):_0x250d('0x160'),'XMD-AGIAFTER':_0x3d240f[_0x250d('0xcc')]?util[_0x250d('0x3f')](_0x250d('0x161'),ipAgi,_0x3d240f[_0x250d('0xcc')]):'NONE','XMD-QUEUE':utils[_0x250d('0x162')](_0x3d240f)?util[_0x250d('0x3f')]('\x22%s,%s%s,,,%s\x22',_0x3d240f['name'],_0x3d240f[_0x250d('0x163')]||'',_0x3d240f[_0x250d('0xc3')]?'c':'',_0x3d240f[_0x250d('0x164')]||0x3):_0x250d('0x160'),'XMD-CONTACTID':_0x1e8bf1[_0x250d('0xd8')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x2ef307[_0x250d('0x1e')][_0x28f92e][_0x250d('0x15f')](),'XMD-AMD':_0x3d240f[_0x250d('0x10b')]?_0x250d('0x13c'):_0x250d('0x160'),'XMD-DESTINATION':_0x250d('0x10a')};if(_0x3d240f[_0x250d('0x10b')]){_0x568a72[_0x250d('0x165')]=_0x3d240f['dialAMDInitialSilence']||0x9c4;_0x568a72['XMD-AMDGREETING']=_0x3d240f[_0x250d('0x166')]||0x5dc;_0x568a72[_0x250d('0x167')]=_0x3d240f[_0x250d('0x168')]||0x320;_0x568a72[_0x250d('0x169')]=_0x3d240f[_0x250d('0x16a')]||0x1388;_0x568a72[_0x250d('0x16b')]=_0x3d240f[_0x250d('0x16c')]||0x64;_0x568a72['XMD-AMDBETWEENWORDSSILENCE']=_0x3d240f[_0x250d('0x16d')]||0x32;_0x568a72['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x3d240f[_0x250d('0x16e')]||0x3;_0x568a72[_0x250d('0x16f')]=_0x3d240f[_0x250d('0x170')]||0x100;_0x568a72[_0x250d('0x171')]=_0x3d240f[_0x250d('0x172')]||0x1388;}if(utils[_0x250d('0x162')](_0x3d240f)){_0x568a72[_0x250d('0x173')]=_0x1e8bf1['VoiceQueueId'];}else{_0x568a72[_0x250d('0x174')]=_0x1e8bf1[_0x250d('0xe8')];}var _0x14bdc2=utils[_0x250d('0x175')](_0x1e8bf1[_0x250d('0x176')]);Object[_0x250d('0x140')](_0x568a72,_0x14bdc2);var _0x410755=_0x2ef307[_0x250d('0x82')](_0x3d240f[_0x250d('0x89')])?utils['getCallerId'](_0x3d240f[_0x250d('0x89')][_0x250d('0x177')],_0x3d240f[_0x250d('0x178')],_0x3d240f['dialRandomLastDigitCallerIdNumber']>0x0?utils[_0x250d('0x179')](_0x3d240f['dialOriginateCallerIdNumber'],_0x3d240f[_0x250d('0x17a')]):_0x3d240f[_0x250d('0x17b')]):utils[_0x250d('0x17c')](_[_0x250d('0xef')](_0x3d240f[_0x250d('0x17d')])?_0x3d240f[_0x250d('0x89')]['callerid']:_0x3d240f[_0x250d('0x17d')]['callerid'],_0x3d240f['dialOriginateCallerIdName'],_0x3d240f[_0x250d('0x17a')]>0x0?utils[_0x250d('0x179')](_0x3d240f[_0x250d('0x17b')],_0x3d240f[_0x250d('0x17a')]):_0x3d240f[_0x250d('0x17b')]);if(_0x410755){_0x568a72[_0x250d('0x17e')]=_0x2ef307['actions'][_0x28f92e]['originatecalleridname']=utils[_0x250d('0x17f')](_0x410755);_0x568a72[_0x250d('0x180')]=_0x1e8bf1[_0x250d('0x15e')];}_0x3d240f['variables']=_0x568a72;return ami[_0x250d('0x99')]({'actionid':_0x28f92e,'action':_0x250d('0x15d'),'channel':_0x2ef307[_0x250d('0x82')](_0x3d240f[_0x250d('0x89')])?util[_0x250d('0x3f')](_0x250d('0x181'),_0x3d240f['Trunk'][_0x250d('0x40')],isNotNull(_0x3d240f['dialPrefix'])?_0x3d240f[_0x250d('0x182')][_0x250d('0x183')]()||'':'',_0x3d240f[_0x250d('0x184')]>0x0?_0x1e8bf1[_0x250d('0x15e')][_0x250d('0x185')](_0x3d240f['dialCutDigit']):_0x1e8bf1['phone']):util['format'](_0x250d('0x181'),_['isNil'](_0x3d240f[_0x250d('0x17d')])?_0x3d240f[_0x250d('0x89')][_0x250d('0x40')]:_0x3d240f['TrunkBackup']['name'],isNotNull(_0x3d240f[_0x250d('0x182')])?_0x3d240f[_0x250d('0x182')]['trim']()||'':'',_0x3d240f[_0x250d('0x184')]>0x0?_0x1e8bf1['phone'][_0x250d('0x185')](_0x3d240f[_0x250d('0x184')]):_0x1e8bf1['phone']),'callerid':_0x410755,'Exten':_0x250d('0x10a'),'Context':_0x250d('0x186'),'Priority':'1','variable':_0x568a72,'timeout':(_0x3d240f[_0x250d('0x187')]||0x1e)*0x3e8,'async':!![],'channelid':_0x28f92e})[_0x250d('0x3b')](function(_0x3e4186){return _0x586f1c(_0x3e4186);})[_0x250d('0xa0')](function(_0x1ca313){_0x3d240f['outboundOriginateFailureCallsDay']+=0x1;var _0x48d901=new History(_0x2ef307[_0x250d('0x1e')][_0x28f92e]);logger['error'](util[_0x250d('0x3f')](_0x250d('0x188'),JSON['stringify'](_0x1ca313)));_0x48d901[_0x250d('0x6a')]=0xe;_0x48d901['statedesc']=_0x250d('0x189');_0x48d901[_0x250d('0x6c')]=moment()['format'](_0x250d('0xc1'));_0x48d901['endtime']=_0x48d901[_0x250d('0x6c')];hopperUtils[_0x250d('0xdf')](_0x48d901)['catch'](loggerCatch(_0x250d('0x18a')));_0x2ef307['moveContactManagedDialer'](_0x48d901)[_0x250d('0xa0')](loggerCatch(_0x250d('0x18a')))[_0x250d('0x17')](function(){delete _0x2ef307[_0x250d('0x1e')][_0x28f92e];return _0x562566(msgResponse(_0x250d('0x15d'),_0x250d('0x81'),_0x250d('0x18b')));});});});};Dialer[_0x250d('0x15')][_0x250d('0x18c')]=function(_0x4f26fc,_0x141fb1,_0x20175b){var _0x40781d=new History(_0x141fb1);if(_0x40781d['countbusyretry']+_0x40781d['countcongestionretry']+_0x40781d[_0x250d('0x11c')]+_0x40781d[_0x250d('0x11d')]+_0x40781d[_0x250d('0xcd')]+_0x40781d[_0x250d('0xe5')]+_0x40781d['countmachineretry']+_0x40781d[_0x250d('0x18d')]>=_0x20175b[_0x250d('0x11e')]-0x1){return!![];}switch(_0x4f26fc){case 0x3:if(_0x40781d[_0x250d('0x11c')]>=_0x20175b[_0x250d('0x18e')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x40781d[_0x250d('0x11c')]+=0x1,'scheduledat':moment()[_0x250d('0xd5')](_0x20175b['dialNoAnswerRetryFrequency'],_0x250d('0xd7'))[_0x250d('0x3f')](_0x250d('0xc1')),'ContactId':_0x40781d[_0x250d('0xd8')],'ListId':_0x40781d['ListId'],'VoiceQueueId':_0x40781d['VoiceQueueId']||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})['catch'](loggerCatch(_0x250d('0x18f')));break;case 0x5:if(_0x40781d['countbusyretry']>=_0x20175b[_0x250d('0x190')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x40781d[_0x250d('0x11a')]+=0x1,'scheduledat':moment()[_0x250d('0xd5')](_0x20175b[_0x250d('0x191')],_0x250d('0xd7'))[_0x250d('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40781d['ContactId'],'ListId':_0x40781d[_0x250d('0xd9')],'VoiceQueueId':_0x40781d[_0x250d('0xda')]||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x40781d[_0x250d('0x11b')]>=_0x20175b[_0x250d('0x192')]-0x1){return!![];}hopperUtils[_0x250d('0xd4')]({'active':![],'countcongestionretry':_0x40781d[_0x250d('0x11b')]+=0x1,'scheduledat':moment()[_0x250d('0xd5')](_0x20175b['dialCongestionRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40781d[_0x250d('0xd8')],'ListId':_0x40781d['ListId'],'VoiceQueueId':_0x40781d[_0x250d('0xda')]||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x40781d['countnosuchnumberretry']>=_0x20175b[_0x250d('0x193')]-0x1){return!![];}else{hopperUtils['rescheduleContact']({'active':![],'countnosuchnumberretry':_0x40781d[_0x250d('0x11d')]+=0x1,'scheduledat':moment()[_0x250d('0xd5')](_0x20175b[_0x250d('0x194')],_0x250d('0xd7'))[_0x250d('0x3f')](_0x250d('0xc1')),'ContactId':_0x40781d[_0x250d('0xd8')],'ListId':_0x40781d[_0x250d('0xd9')],'VoiceQueueId':_0x40781d[_0x250d('0xda')]||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch(_0x250d('0x195')));}break;case 0xa:if(_0x40781d[_0x250d('0xcd')]>=_0x20175b[_0x250d('0xd2')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x40781d['countdropretry']+=0x1,'scheduledat':moment()['add'](_0x20175b[_0x250d('0xd6')],_0x250d('0xd7'))[_0x250d('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40781d['ContactId'],'ListId':_0x40781d[_0x250d('0xd9')],'VoiceQueueId':_0x40781d[_0x250d('0xda')]||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch(_0x250d('0xdb')));break;case 0xb:if(_0x40781d[_0x250d('0xe5')]>=_0x20175b[_0x250d('0xe7')]-0x1){return!![];}hopperUtils[_0x250d('0xd4')]({'active':![],'countabandonedretry':_0x40781d[_0x250d('0xe5')]+=0x1,'scheduledat':moment()[_0x250d('0xd5')](_0x20175b[_0x250d('0xe6')],'minutes')[_0x250d('0x3f')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40781d['ContactId'],'ListId':_0x40781d[_0x250d('0xd9')],'VoiceQueueId':_0x40781d[_0x250d('0xda')]||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})['catch'](loggerCatch(_0x250d('0xe9')));break;case 0x13:if(_0x40781d[_0x250d('0x118')]>=_0x20175b[_0x250d('0x120')]-0x1){return!![];}hopperUtils[_0x250d('0xd4')]({'active':![],'countmachineretry':_0x40781d['countmachineretry']+=0x1,'scheduledat':moment()[_0x250d('0xd5')](_0x20175b[_0x250d('0x12a')],_0x250d('0xd7'))['format'](_0x250d('0xc1')),'ContactId':_0x40781d[_0x250d('0xd8')],'ListId':_0x40781d[_0x250d('0xd9')],'VoiceQueueId':_0x40781d[_0x250d('0xda')]||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch(_0x250d('0x12b')));break;case 0x14:if(_0x40781d['countagentrejectretry']>=_0x20175b[_0x250d('0x196')]-0x1){return!![];}hopperUtils[_0x250d('0xd4')]({'active':![],'countagentrejectretry':_0x40781d[_0x250d('0x18d')]+=0x1,'scheduledat':moment()['add'](_0x20175b[_0x250d('0x197')],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x40781d[_0x250d('0xd8')],'ListId':_0x40781d[_0x250d('0xd9')],'VoiceQueueId':_0x40781d[_0x250d('0xda')]||undefined,'CampaignId':_0x40781d[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch(_0x250d('0x198')));break;default:return!![];}};Dialer[_0x250d('0x15')][_0x250d('0x106')]=function(_0x384913,_0x176df8,_0x2e2f1e){var _0x1c5ef3=this;var _0x18a656=new History(_0x384913);var _0x433836=![];var _0xe28a89;var _0x1ffe56;return new Promise(function(_0x4118c7,_0x174a9a){if(_[_0x250d('0x3d')](_0x176df8)&&typeof _0x176df8!==_0x250d('0x15c')){return _0x174a9a(msgResponse(_0x250d('0x199'),'Failure',_0x250d('0x19a')));}if(_[_0x250d('0x3d')](_0x2e2f1e)&&typeof _0x2e2f1e!=='object'){return _0x174a9a(msgResponse(_0x250d('0x199'),_0x250d('0x8f'),_0x250d('0x19b')));}hopperUtils['verifyAdditionalPhones'](_0x18a656,_0x2e2f1e[_0x250d('0x19c')],_0x176df8)[_0x250d('0x3b')](function(_0x28f079){if(_0x28f079['additional']==0x1)_0x433836=!![];switch(_0x2e2f1e[_0x250d('0x19c')]){case'0':_0x176df8[_0x250d('0x19d')]+=0x1;_0x18a656[_0x250d('0x6a')]=0x0;_0x18a656[_0x250d('0x6b')]=_0x250d('0x19e');_0x18a656[_0x250d('0x11d')]+=0x1;_0x18a656[_0x250d('0xce')]+=0x1;ami['emit'](_0x250d('0x19f'),ut[_0x250d('0x126')](_0x384913,_0x250d('0x1a0')));_0xe28a89=_0x176df8[_0x250d('0x194')];_0x1ffe56=_0x176df8[_0x250d('0x1a1')];hopperUtils[_0x250d('0xdf')](_0x18a656)[_0x250d('0xa0')](loggerCatch(_0x250d('0x119')));if(_0x1c5ef3['checkRetriveMax'](0x0,_0x384913,_0x176df8)&&!_0x433836){if(_0x18a656[_0x250d('0x11d')]>=_0x176df8[_0x250d('0x193')]){_0x1c5ef3[_0x250d('0x128')](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1a2'));}else{_0x1c5ef3[_0x250d('0x11f')](_0x18a656,_0x4118c7,_0x174a9a,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x176df8[_0x250d('0x1a3')]+=0x1;_0x18a656[_0x250d('0x6a')]=0x3;_0x18a656[_0x250d('0x6b')]='NoAnswer';_0x18a656[_0x250d('0x11c')]+=0x1;_0x18a656['countglobal']+=0x1;var _0x12019b=ut['buildNoAnswerEventPayload'](_0x384913,_0x176df8);ami['emit'](_0x250d('0x1a4'),_0x12019b);_0xe28a89=_0x176df8[_0x250d('0x1a5')];_0x1ffe56=_0x176df8[_0x250d('0x1a1')];hopperUtils[_0x250d('0xdf')](_0x18a656)[_0x250d('0xa0')](loggerCatch(_0x250d('0x1a6')));if(_0x1c5ef3[_0x250d('0x18c')](0x3,_0x384913,_0x176df8)&&!_0x433836){if(_0x18a656[_0x250d('0x11c')]>=_0x176df8['dialNoAnswerMaxRetry']){_0x1c5ef3[_0x250d('0x128')](_0x18a656,_0x4118c7,_0x174a9a,'reason\x203\x20ringing\x20no\x20answer');}else{_0x1c5ef3[_0x250d('0x11f')](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1a7'));}}break;case'5':_0x176df8[_0x250d('0x1a8')]+=0x1;_0x18a656['state']=0x5;_0x18a656['statedesc']=_0x250d('0x1a9');_0x18a656['countbusyretry']+=0x1;_0x18a656[_0x250d('0xce')]+=0x1;ami[_0x250d('0x111')](_0x250d('0x1aa'),ut[_0x250d('0x126')](_0x384913,_0x250d('0x1ab')));_0xe28a89=_0x176df8['dialBusyRetryFrequency'];_0x1ffe56=_0x176df8['callAdditionalPhoneAfterMin'];hopperUtils[_0x250d('0xdf')](_0x18a656)[_0x250d('0xa0')](loggerCatch(_0x250d('0x1ac')));if(_0x1c5ef3['checkRetriveMax'](0x5,_0x384913,_0x176df8)&&!_0x433836){if(_0x18a656[_0x250d('0x11a')]>=_0x176df8[_0x250d('0x190')]){_0x1c5ef3[_0x250d('0x128')](_0x18a656,_0x4118c7,_0x174a9a,'reason\x205\x20busy');}else{_0x1c5ef3[_0x250d('0x11f')](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1ad'));}}break;case'8':_0x176df8[_0x250d('0x1ae')]+=0x1;_0x18a656[_0x250d('0x6a')]=0x8;_0x18a656[_0x250d('0x6b')]=_0x250d('0x1af');_0x18a656['countcongestionretry']+=0x1;_0x18a656['countglobal']+=0x1;_0xe28a89=_0x176df8[_0x250d('0x1b0')];_0x1ffe56=_0x176df8[_0x250d('0x1a1')];ami[_0x250d('0x111')]('custom:agentcongestion',ut[_0x250d('0x126')](_0x384913,_0x250d('0x1b1')));hopperUtils[_0x250d('0xdf')](_0x18a656)[_0x250d('0xa0')](loggerCatch(_0x250d('0x1b2')));if(_0x1c5ef3[_0x250d('0x18c')](0x8,_0x384913,_0x176df8)&&!_0x433836){if(_0x18a656[_0x250d('0x11b')]>=_0x176df8[_0x250d('0x192')]){_0x1c5ef3[_0x250d('0x128')](_0x18a656,_0x4118c7,_0x174a9a,'reason\x208\x20congestion');}else{_0x1c5ef3[_0x250d('0x11f')](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1b3'));}}break;case'11':_0x176df8['outboundAbandonedCallsDay']+=0x1;_0x18a656[_0x250d('0x6a')]=0xb;_0x18a656[_0x250d('0x6b')]='Abandoned';_0x18a656[_0x250d('0xe5')]+=0x1;_0x18a656[_0x250d('0xce')]+=0x1;_0xe28a89=_0x176df8[_0x250d('0xe6')];_0x1ffe56=_0x176df8['callAdditionalPhoneAfterMin'];hopperUtils[_0x250d('0xdf')](_0x18a656)[_0x250d('0xa0')](loggerCatch(_0x250d('0xea')));if(_0x1c5ef3[_0x250d('0x18c')](0xb,_0x384913,_0x176df8)&&!_0x433836){if(_0x18a656[_0x250d('0xe5')]>=_0x176df8['dialAbandonedMaxRetry']){_0x1c5ef3[_0x250d('0x128')](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1b4'));}else{_0x1c5ef3['stateGlobal'](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1b4'));}}break;case'20':_0x176df8[_0x250d('0x1b5')]+=0x1;_0x18a656['state']=0x14;_0x18a656[_0x250d('0x6b')]=_0x250d('0x1b6');_0x18a656['countagentrejectretry']+=0x1;_0x18a656[_0x250d('0xce')]+=0x1;_0xe28a89=_0x176df8['dialAgentRejectRetryFrequency'];_0x1ffe56=_0x176df8['callAdditionalPhoneAfterMin'];ami[_0x250d('0x111')]('custom:agentreject',ut[_0x250d('0x126')](_0x384913,_0x250d('0x1b7')));hopperUtils['createHistory'](_0x18a656)['catch'](loggerCatch(_0x250d('0x1b8')));if(_0x1c5ef3[_0x250d('0x18c')](0x14,_0x384913,_0x176df8)&&!_0x433836){if(_0x18a656[_0x250d('0x18d')]>=_0x176df8[_0x250d('0x196')]){_0x1c5ef3[_0x250d('0x128')](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1b9'));}else{_0x1c5ef3[_0x250d('0x11f')](_0x18a656,_0x4118c7,_0x174a9a,_0x250d('0x1b9'));}}break;default:_0x176df8[_0x250d('0x133')]+=0x1;_0x18a656[_0x250d('0x6a')]=0xc;_0x18a656[_0x250d('0x6b')]=_0x2e2f1e['reason'];_0xe28a89=_0x176df8[_0x250d('0x197')];_0x1ffe56=_0x176df8[_0x250d('0x1a1')];hopperUtils['createHistory'](_0x18a656)[_0x250d('0xa0')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x1c5ef3['checkRetriveMax'](_0x2e2f1e[_0x250d('0x19c')],_0x384913,_0x176df8)&&!_0x433836){if(_0x18a656[_0x250d('0x11a')]+_0x18a656[_0x250d('0x11b')]+_0x18a656[_0x250d('0x11c')]+_0x18a656['countnosuchnumberretry']+_0x18a656[_0x250d('0xcd')]+_0x18a656[_0x250d('0xe5')]+_0x18a656[_0x250d('0x118')]+_0x18a656[_0x250d('0x18d')]>=_0x176df8[_0x250d('0x11e')]){_0x1c5ef3[_0x250d('0x11f')](_0x18a656,_0x4118c7,_0x174a9a,_0x2e2f1e[_0x250d('0x19c')]);}else{_0x1c5ef3[_0x250d('0x128')](_0x18a656,_0x4118c7,_0x174a9a,_0x2e2f1e[_0x250d('0x19c')]);}}}})[_0x250d('0x3b')](function(){if(_0x433836){hopperUtils[_0x250d('0xe1')](_0x18a656,_0xe28a89,_0x1ffe56)[_0x250d('0x3b')](function(){return _0x4118c7(0x1);});}});});};Dialer[_0x250d('0x15')][_0x250d('0x11f')]=function(_0x529cbb,_0x5b009e,_0x5f588a,_0x171934){var _0x5f5a4f=new Final(_0x529cbb);_0x5f5a4f['state']=0xf;_0x5f5a4f[_0x250d('0x6b')]=_0x250d('0x1ba');this[_0x250d('0x128')](_0x5f5a4f,_0x5b009e,_0x5f588a,_0x171934);};Dialer[_0x250d('0x15')][_0x250d('0x128')]=function(_0x136754,_0x2ea60a,_0x51ecb0,_0x4a9c2b){hopperUtils[_0x250d('0x130')](_0x136754)['then'](function(){return _0x2ea60a(msgResponse('[callProgressDetecting]',_0x250d('0x105'),_0x4a9c2b));})[_0x250d('0xa0')](function(){return _0x51ecb0(msgResponse('[moveContactManagedDialer][0]',_0x250d('0x8f'),'contact\x20not\x20moved'));});};Dialer[_0x250d('0x15')][_0x250d('0xb3')]=function(_0x487be1){var _0x4a43f8=_0x487be1['dialPredictiveOptimizationPercentage']/0x64;var _0x50e3cf=_0x487be1[_0x250d('0xc8')]/(_0x487be1[_0x250d('0xc8')]+_0x487be1[_0x250d('0x117')]);var _0x528bc7=Math['round'](_0x487be1[_0x250d('0x1bb')]*(_0x487be1[_0x250d('0x1bc')]/0x64));var _0x3475e8=Math[_0x250d('0x1bd')](_0x487be1[_0x250d('0x1bb')]*(_0x487be1['predictiveIntervalMinThreshold']/0x64));var _0x2ebc0b=_0x487be1[_0x250d('0x1be')]+_0x487be1[_0x250d('0x13a')];var _0x3df047=Math['floor'](_0x487be1[_0x250d('0x52')]*_0x487be1[_0x250d('0x55')]*_0x487be1[_0x250d('0x1bf')]*_0x487be1[_0x250d('0x1c0')]);if(_[_0x250d('0x3d')](_0x487be1[_0x250d('0x22')])){if(!_[_0x250d('0x3d')](_0x487be1['startPredictive'])){_0x487be1[_0x250d('0x21')]=undefined;loggerPredictive[_0x250d('0x5f')](_0x250d('0x1c1'),_0x250d('0x1c2'));}if(!_['isUndefined'](_0x487be1[_0x250d('0x5d')])){loggerPredictive[_0x250d('0x5f')](_0x250d('0x1c1'),_0x250d('0x1c3'));clearInterval(_0x487be1[_0x250d('0x5d')]);_0x487be1[_0x250d('0x5d')]=undefined;}_0x487be1[_0x250d('0x22')]=moment()[_0x250d('0x3f')](_0x250d('0xc1'));loggerPredictive[_0x250d('0x42')](_0x487be1[_0x250d('0x40')],_0x250d('0x1c4'),_0x487be1[_0x250d('0x22')]);this[_0x250d('0xb4')](_0x487be1,0x1);}else if(ifInterval(_0x487be1['dialPredictiveInterval'],_0x487be1[_0x250d('0x22')])){this[_0x250d('0xb4')](_0x487be1,0x1);loggerPredictiveCalls['info'](_0x250d('0x1c5'),_0x487be1['startProgressive'],_0x487be1[_0x250d('0x40')]);_0x487be1[_0x250d('0x52')]=0x0;_0x487be1[_0x250d('0xc9')]=0x0;}else if(_0x4a43f8<_0x50e3cf&&_0x487be1[_0x250d('0x1c6')]===_0x250d('0x1c7')){clearPredictiveAttributes(_0x487be1);loggerPredictive[_0x250d('0x42')](_0x250d('0x1c8'),_0x250d('0x1c9'),_0x50e3cf,'startProgressive',_0x487be1[_0x250d('0x40')]);}else if(_0x3df047<_0x487be1[_0x250d('0xc9')]&&_0x487be1['dialPredictiveOptimization']===_0x250d('0x1c7')){clearPredictiveAttributes(_0x487be1);loggerPredictive[_0x250d('0x42')](_0x250d('0x1ca'),_0x250d('0x1cb'),_0x3df047,'Drop\x20in\x20this\x20interval',_0x487be1[_0x250d('0xc9')],_0x250d('0x22'),_0x487be1[_0x250d('0x40')]);}else if(!ifInterval(_0x487be1[_0x250d('0x1cc')],_0x487be1[_0x250d('0x22')])&&_['isUndefined'](_0x487be1[_0x250d('0x21')])&&!_[_0x250d('0x3d')](_0x487be1['startProgressive'])){_0x487be1[_0x250d('0x21')]=moment()[_0x250d('0x3f')](_0x250d('0xc1'));loggerPredictive[_0x250d('0x42')](_0x487be1[_0x250d('0x40')],'started\x20in\x20predictive\x20at',_0x487be1[_0x250d('0x21')]);hopperUtils[_0x250d('0x1cd')](_0x487be1[_0x250d('0x1cc')])['then'](this[_0x250d('0x1ce')](_0x487be1))[_0x250d('0x3b')](mergeDataErlangB(_0x487be1))[_0x250d('0x3b')](this[_0x250d('0x1cf')](_0x487be1))['catch'](loggerCatchPredictive(_0x250d('0x1d0'),_0x487be1));}else if(!ifInterval(_0x487be1[_0x250d('0x1cc')],_0x487be1[_0x250d('0x21')])){_0x487be1[_0x250d('0xc9')]=0x0;_0x487be1[_0x250d('0x21')]=moment()[_0x250d('0x3f')](_0x250d('0xc1'));loggerPredictive[_0x250d('0x42')](_0x487be1[_0x250d('0x40')],_0x250d('0x1d1'),_0x487be1['startPredictive']);clearInterval(_0x487be1['handlePredictive']);_0x487be1['handlePredictive']=undefined;hopperUtils['avgHandleTime'](_0x487be1[_0x250d('0x1cc')])[_0x250d('0x3b')](this[_0x250d('0x1ce')](_0x487be1))['then'](mergeDataErlangB(_0x487be1))['then'](this[_0x250d('0x1cf')](_0x487be1))[_0x250d('0xa0')](loggerCatchPredictive(_0x250d('0x1d2'),_0x487be1));}else if(_0x487be1['predictiveIntervalAvailable']&&_0x2ebc0b<_0x487be1[_0x250d('0x1bb')]-_0x3475e8){clearPredictiveAttributes(_0x487be1);loggerPredictive[_0x250d('0x42')](_0x487be1[_0x250d('0x40')],_0x250d('0x1d3'),_0x2ebc0b,_0x250d('0x1d4'),_0x487be1[_0x250d('0x1bb')],'-',_0x3475e8,'=',_0x487be1[_0x250d('0x1bb')]-_0x3475e8,')');}else if(_0x487be1[_0x250d('0x1bb')]&&_0x2ebc0b>_0x487be1[_0x250d('0x1bb')]+_0x528bc7){clearPredictiveAttributes(_0x487be1);loggerPredictive[_0x250d('0x42')](_0x487be1['name'],_0x250d('0x1d3'),_0x2ebc0b,')\x20are\x20more\x20than\x20threshold\x20(',_0x487be1['predictiveIntervalAvailable'],'+',_0x528bc7,'=',_0x487be1['predictiveIntervalAvailable']+_0x528bc7,')');}};Dialer[_0x250d('0x15')]['getDataPredictive']=function(_0x4852c6){var _0x3b6f42=this;return function(_0xf762a9){return new Promise(function(_0x575b68,_0x2da3f1){_[_0x250d('0x59')](_0x4852c6,_0xf762a9[0x0]);if(checkGetDataPredictive(_0xf762a9[0x0])){var _0xfa5b31=_0x4852c6['predictiveIntervalAvailable']=_0x4852c6[_0x250d('0x13a')]+_0x4852c6[_0x250d('0x1be')];var _0x3011c8=_0x4852c6[_0x250d('0x1cc')]*0x3c;var _0x4ce2d1=_0xf762a9[0x0]['predictiveIntervalAvgTalktime']+_0xf762a9[0x0][_0x250d('0x4b')];var _0xee82ae=(_0xf762a9[0x0][_0x250d('0x1d5')]+_0xf762a9[0x0]['predictiveIntervalDroppedCallsTimeout']+_0xf762a9[0x0][_0x250d('0x49')])/_0xf762a9[0x0][_0x250d('0x44')];_0x4852c6[_0x250d('0x1bf')]=_0xee82ae>0x0?_0xee82ae:0x1;switch(_0x4852c6['dialPredictiveOptimization']){case _0x250d('0x1c7'):var _0x4f344d=_0x4852c6[_0x250d('0x1d6')]/0x64;return _0x3b6f42[_0x250d('0x1d7')](_0xfa5b31,_0x3011c8,_0x4ce2d1,_0xee82ae,_0x4f344d)['then'](function(_0x1d0463){return _0x575b68(_0x1d0463);});case _0x250d('0x1d8'):var _0x306c40=_0x4852c6['dialPredictiveOptimizationPercentage']/0x64;return _0x3b6f42[_0x250d('0x1d9')](_0xfa5b31,_0x3011c8,_0x4ce2d1,_0xee82ae,_0x306c40)[_0x250d('0x3b')](function(_0x2136ac){return _0x575b68(_0x2136ac);});default:return _0x2da3f1(msgResponse(_0x250d('0x1da'),'Failure',_0x250d('0x1db')));}}else{return _0x2da3f1(msgResponse('[getDataPredictive]',_0x250d('0x8f'),'check\x20failure'));}});};};Dialer[_0x250d('0x15')]['getDataPredictiveOld']=function(_0x8dfd15){var _0x70582f=this;return function(_0x597643){return new Promise(function(_0x43f87c,_0x55b361){_['merge'](_0x8dfd15,_0x597643[0x0]);if(checkGetDataPredictive(_0x597643[0x0])){loggerPredictive[_0x250d('0x42')](JSON[_0x250d('0x6f')](_0x597643[0x0]));if(_0x8dfd15[_0x250d('0x1c6')]==='dropRate'){return _0x70582f['getVoiceQueueRtPauses'](_0x8dfd15['id'])[_0x250d('0x3b')](function(_0x546cf3){var _0x545e62=_0x8dfd15[_0x250d('0x1dc')]-_0x546cf3[0x0][_0x250d('0x1dd')];var _0xf5b3ae=_0x8dfd15[_0x250d('0x1cc')]*0x3c;var _0x4b2d06=_0x597643[0x0][_0x250d('0x4d')]+_0x597643[0x0][_0x250d('0x4b')];var _0x2dce48=(_0x597643[0x0][_0x250d('0x1d5')]+_0x597643[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x597643[0x0][_0x250d('0x49')])/_0x597643[0x0][_0x250d('0x44')];var _0x15ae51=_0x8dfd15[_0x250d('0x1d6')]/0x64;_0x8dfd15[_0x250d('0x1de')]=_0x546cf3[0x0][_0x250d('0x1dd')]||0x0;_0x8dfd15['predictiveIntervalHitRate']=_0x2dce48>0x0?_0x2dce48:0x1;return _0x70582f[_0x250d('0x1d7')](_0x545e62,_0xf5b3ae,_0x4b2d06,_0x2dce48,_0x15ae51);})[_0x250d('0x3b')](function(_0x152c07){return _0x43f87c(_0x152c07);})[_0x250d('0xa0')](function(_0x4c5833){return _0x55b361(msgResponse(_0x250d('0x1df'),_0x250d('0x8f'),JSON[_0x250d('0x6f')](_0x4c5833)));});}if(_0x8dfd15[_0x250d('0x1c6')]===_0x250d('0x1d8')){return _0x70582f[_0x250d('0x14f')](_0x8dfd15['id'])[_0x250d('0x3b')](function(_0x5747cd){var _0x3956bb=_0x8dfd15['loggedIn']-_0x5747cd[0x0][_0x250d('0x1dd')];var _0x396e4d=_0x8dfd15[_0x250d('0x1cc')]*0x3c;var _0x26d5dd=_0x597643[0x0]['predictiveIntervalAvgTalktime']+_0x597643[0x0][_0x250d('0x4b')];var _0x449203=(_0x597643[0x0][_0x250d('0x1d5')]+_0x597643[0x0][_0x250d('0x47')]+_0x597643[0x0][_0x250d('0x49')])/_0x597643[0x0][_0x250d('0x44')];var _0xa70b28=_0x8dfd15['dialPredictiveOptimizationPercentage']/0x64;_0x8dfd15['predictiveIntervalPauses']=_0x5747cd[0x0][_0x250d('0x1dd')]||0x0;_0x8dfd15[_0x250d('0x1bf')]=_0x449203>0x0?_0x449203:0x1;return _0x70582f[_0x250d('0x1d9')](_0x3956bb,_0x396e4d,_0x26d5dd,_0x449203,_0xa70b28);})[_0x250d('0x3b')](function(_0x859504){return _0x43f87c(_0x859504);})[_0x250d('0xa0')](function(_0x4303cb){return _0x55b361(msgResponse(_0x250d('0x1df'),_0x250d('0x8f'),JSON['stringify'](_0x4303cb)));});}}else{return _0x55b361(msgResponse(_0x250d('0x1da'),_0x250d('0x8f'),'check\x20failure'));}});};};Dialer[_0x250d('0x15')][_0x250d('0x1cf')]=function(_0x2c9369){var _0x9385e2=this;return function(){var _0x3c7e92=0x0;var _0x5848cf=Math[_0x250d('0x1e0')](_0x2c9369[_0x250d('0x54')]*0x3e8);if(_0x5848cf>0x0){_0x5848cf=_0x5848cf<0x64?0x64:_0x5848cf;loggerPredictive['info'](_0x2c9369[_0x250d('0x40')],_0x250d('0x1e1'),_0x5848cf,_0x250d('0x1e2'));_0x2c9369[_0x250d('0x5d')]=setInterval(function(){_0x9385e2[_0x250d('0x5d')](_0x2c9369);loggerPredictiveCalls[_0x250d('0x42')](_0x250d('0x1e3'),_0x3c7e92+=0x1);},_0x5848cf);}else{loggerPredictive[_0x250d('0x42')](_0x2c9369[_0x250d('0x40')],_0x250d('0x1e4'));}};};Dialer[_0x250d('0x15')][_0x250d('0x1e5')]=function(_0x12ef74,_0x4f669f){var _0x5de0f5=this;return function(_0x225bd4){if(_['isEmpty'](_0x225bd4)){if(_[_0x250d('0xef')](_0x4f669f['UserId'])||!_0x4f669f[_0x250d('0x1e6')]){if(_0x12ef74[_0x250d('0xb0')]===_0x250d('0x1e7')){_0x12ef74['queueStatusComplete']=_['isUndefined'](_0x12ef74[_0x250d('0x6d')])?!![]:_0x12ef74[_0x250d('0x6d')];var _0x39c959=uuid['v4']();_0x5de0f5[_0x250d('0x1e')][_0x39c959]=new Action(_0x12ef74,_0x4f669f,_0x39c959);loggerBooked[_0x250d('0x42')](_0x250d('0x1e8'),_0x39c959,_0x250d('0x1e9'),JSON[_0x250d('0x6f')](_0x12ef74[_0x250d('0x6d')]),_0x250d('0x1ea'),_0x12ef74[_0x250d('0x40')]);if(_0x12ef74['queueStatusComplete']){_0x12ef74[_0x250d('0x6d')]=![];_0x5de0f5[_0x250d('0x24')][_0x5de0f5[_0x250d('0x1e')][_0x39c959][_0x250d('0xbc')]]=[];ami[_0x250d('0x99')]({'actionid':_0x39c959,'action':'queuestatus','queue':_0x12ef74[_0x250d('0x40')]})[_0x250d('0xa0')](function(){_0x5de0f5[_0x250d('0xc0')](_0x12ef74);hopperUtils[_0x250d('0xd4')]({'active':![],'ContactId':_0x5de0f5['actions'][_0x39c959]['ContactId'],'ListId':_0x5de0f5['actions'][_0x39c959][_0x250d('0xd9')],'VoiceQueueId':_0x5de0f5[_0x250d('0x1e')][_0x39c959]['VoiceQueueId']||undefined,'CampaignId':_0x5de0f5[_0x250d('0x1e')][_0x39c959][_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5de0f5[_0x250d('0x1e')][_0x39c959];});}else{loggerBooked['info'](_0x250d('0x1eb'),JSON[_0x250d('0x6f')](_0x12ef74['queueStatusComplete']),'Queue:\x20',_0x12ef74['name']);_0x5de0f5[_0x250d('0xc0')](_0x12ef74);hopperUtils[_0x250d('0xd4')]({'active':![],'ContactId':_0x5de0f5['actions'][_0x39c959][_0x250d('0xd8')],'ListId':_0x5de0f5[_0x250d('0x1e')][_0x39c959][_0x250d('0xd9')],'VoiceQueueId':_0x5de0f5[_0x250d('0x1e')][_0x39c959]['VoiceQueueId']||undefined,'CampaignId':_0x5de0f5[_0x250d('0x1e')][_0x39c959][_0x250d('0xe8')]||undefined})['catch'](loggerCatch(_0x250d('0x1ec')));delete _0x5de0f5['actions'][_0x39c959];}}else{return _0x5de0f5[_0x250d('0x15b')](_0x12ef74,_0x4f669f);}}else{if(utils['getSeconds'](undefined,_0x4f669f[_0x250d('0x1ed')])<_0x12ef74[_0x250d('0x1ee')]*0x3c){if(_0x4f669f[_0x250d('0x159')]&&!_0x4f669f[_0x250d('0x159')][_0x250d('0x1ef')]){_0x5de0f5[_0x250d('0xf6')]['run'](_0x4f669f['id'])[_0x250d('0x17')](function(){_0x5de0f5[_0x250d('0xc0')](_0x12ef74);});}else{hopperUtils[_0x250d('0x1f0')]({'active':![]},_0x4f669f['id'],0x1)[_0x250d('0x17')](function(){_0x5de0f5[_0x250d('0xc0')](_0x12ef74);});}}else{_0x12ef74[_0x250d('0x1f1')]+=0x1;_0x5de0f5[_0x250d('0xc0')](_0x12ef74);if(_0x12ef74['dialRecallInQueue']){hopperUtils[_0x250d('0xd4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4f669f[_0x250d('0xd8')],'ListId':_0x4f669f[_0x250d('0xd9')],'VoiceQueueId':_0x4f669f[_0x250d('0xda')]||undefined,'CampaignId':_0x4f669f[_0x250d('0xe8')]||undefined})[_0x250d('0xa0')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x250d('0xdf')](createObjHistory(_0x12ef74,_0x4f669f,utils[_0x250d('0x67')]['QUEUE_RECALL'],0x17,_0x250d('0x1f2')))['catch'](loggerCatch(_0x250d('0x1f3')));}else{_0x5de0f5[_0x250d('0x114')](createObjHistory(_0x12ef74,_0x4f669f,utils[_0x250d('0x67')][_0x250d('0x1f4')],0x16,_0x250d('0x1f5')),_0x250d('0x1f6'),_0x250d('0x1f7'));}}}}else{_0x12ef74[_0x250d('0x1f8')]+=0x1;_0x5de0f5[_0x250d('0x114')](createObjHistory(_0x12ef74,_0x4f669f,utils[_0x250d('0x67')][_0x250d('0x1f9')],0xd,'Blacklist'),_0x250d('0x1fa'),_0x250d('0x1fb'));throw'inBlackList';}};};Dialer[_0x250d('0x15')]['handleIvr']=function(_0x468fd1){var _0x463d77=this;var _0x3aa471=_0x468fd1['limitCalls']-_0x468fd1[_0x250d('0x7b')];emitCampaignSummary(_0x468fd1);if(_0x3aa471>0x0&&_0x468fd1['temp']==0x0){if(_0x3aa471>this[_0x250d('0x1d')]){_0x3aa471=this[_0x250d('0x1d')];}_0x468fd1[_0x250d('0x62')]=0x1;hopperUtils['getContactDialerIvr'](_0x468fd1,_0x3aa471)['then'](function(_0x1e54fb){_0x468fd1[_0x250d('0x62')]=0x0;if(_0x1e54fb){if(!utils[_0x250d('0x1fc')](_0x1e54fb)){_0x468fd1[_0x250d('0x64')]=utils[_0x250d('0x67')][_0x250d('0x68')];logger['info'](_0x250d('0x1fd')+_0x468fd1[_0x250d('0x40')]);}else{_0x468fd1[_0x250d('0x7b')]+=_0x1e54fb['length'];_0x468fd1[_0x250d('0x64')]=utils[_0x250d('0x67')][_0x250d('0x1fe')];for(var _0x414041=0x0;_0x414041<_0x1e54fb[_0x250d('0x97')];_0x414041+=0x1){_0x468fd1[_0x250d('0x1ff')]+=0x1;if(_[_0x250d('0xef')](_0x1e54fb[_0x414041])||_[_0x250d('0xef')](_0x1e54fb[_0x414041][_0x250d('0x176')])||_[_0x250d('0xef')](_0x1e54fb[_0x414041][_0x250d('0x15e')])){_0x463d77[_0x250d('0x200')](_0x250d('0x201'),_0x468fd1,_0x1e54fb[_0x414041]);}else{hopperUtils[_0x250d('0x202')](_[_0x250d('0x70')](_0x1e54fb[_0x414041],[_0x250d('0xe8'),_0x250d('0x15e')]))[_0x250d('0x3b')](_0x463d77['checkContactBlack'](_0x468fd1,_0x1e54fb[_0x414041]))[_0x250d('0xa0')](_0x463d77[_0x250d('0x203')]('[actionOriginateIvr]\x20',_0x468fd1));}}}}})[_0x250d('0xa0')](loggerGetContactDialer(_0x250d('0x204'),_0x468fd1,_0x3aa471));}};Dialer[_0x250d('0x15')][_0x250d('0xb4')]=function(_0x5a5934,_0x48f9ee){var _0x3c215b=this;var _0x1d56e7=[];if(_0x48f9ee<0x1||_0x5a5934[_0x250d('0xb0')]===_0x250d('0x1e7')){_0x48f9ee=0x1;}var _0x321a9=Math['floor'](_0x5a5934['available']*_0x48f9ee)-_0x5a5934[_0x250d('0x7b')];if(_0x5a5934[_0x250d('0x205')]>0x0){var _0x43a0d8=_0x5a5934[_0x250d('0x205')]-_0x5a5934['originated']-_0x5a5934[_0x250d('0x13a')]-_0x5a5934[_0x250d('0x13b')];if(_0x321a9>_0x43a0d8){_0x321a9=_0x43a0d8;}}if(_0x321a9>0x0&&_0x5a5934[_0x250d('0x62')]==0x0){if(_0x5a5934[_0x250d('0xb0')]===_0x250d('0x1e7')){_0x321a9=0x1;}if(_0x321a9>this[_0x250d('0x1d')]){_0x321a9=this[_0x250d('0x1d')];}for(var _0x1c9504 in this['agents']){if(typeof this[_0x250d('0x1b')][_0x1c9504]!==_0x250d('0xa9')){if(this['agents'][_0x1c9504][_0x250d('0x6a')]===_0x250d('0x206')&&this[_0x250d('0x1b')][_0x1c9504][_0x250d('0x84')]===_0x250d('0x85')){_0x1d56e7[_0x250d('0x98')](this[_0x250d('0x1b')][_0x1c9504]['id']);}}}_0x5a5934[_0x250d('0x62')]=0x1;hopperUtils[_0x250d('0x207')](_0x5a5934,_0x1d56e7,_0x321a9)['then'](function(_0x3558ef){_0x5a5934[_0x250d('0x62')]=0x0;if(_0x3558ef){if(!utils[_0x250d('0x1fc')](_0x3558ef)){hopperUtils[_0x250d('0x208')](_0x5a5934)[_0x250d('0x3b')](sendMessageReschedule(_0x5a5934))[_0x250d('0xa0')](loggerCatch(_0x250d('0x209')));}else{_0x5a5934['originated']+=_0x3558ef[_0x250d('0x97')];_0x5a5934[_0x250d('0x64')]=_0x5a5934[_0x250d('0xb0')]==='booked'?utils[_0x250d('0x67')][_0x250d('0x13c')]:utils[_0x250d('0x67')][_0x250d('0x1fe')];for(var _0x3cc0da=0x0;_0x3cc0da<_0x3558ef[_0x250d('0x97')];_0x3cc0da+=0x1){if(_[_0x250d('0xef')](_0x3558ef[_0x3cc0da])||_['isNil'](_0x3558ef[_0x3cc0da][_0x250d('0x176')])||_[_0x250d('0xef')](_0x3558ef[_0x3cc0da]['phone'])){_0x3c215b[_0x250d('0x200')](_0x250d('0x201'),_0x5a5934,_0x3558ef[_0x3cc0da]);}else{hopperUtils[_0x250d('0x20a')](_[_0x250d('0x70')](_0x3558ef[_0x3cc0da],[_0x250d('0xda'),_0x250d('0x15e')]))[_0x250d('0x3b')](_0x3c215b[_0x250d('0x1e5')](_0x5a5934,_0x3558ef[_0x3cc0da]))[_0x250d('0xa0')](_0x3c215b[_0x250d('0x203')](_0x250d('0x201'),_0x5a5934));}}}}})[_0x250d('0xa0')](loggerGetContactDialer(_0x250d('0x20b'),_0x5a5934,_0x321a9));}};Dialer[_0x250d('0x15')][_0x250d('0x5d')]=function(_0x45a212){if(_0x45a212[_0x250d('0x205')]>0x0){var _0x346ef9=_0x45a212[_0x250d('0x205')]-_0x45a212[_0x250d('0x7b')]-_0x45a212[_0x250d('0x13a')];if(_0x346ef9>0x0&&_0x45a212[_0x250d('0x62')]==0x0){this[_0x250d('0x20c')](_0x45a212);}else{loggerPredictiveCalls['info'](_0x250d('0x20d'));}}else{this[_0x250d('0x20c')](_0x45a212);}};Dialer[_0x250d('0x15')][_0x250d('0x20c')]=function(_0x3c4df4){var _0x337447=this;var _0x5889aa=[];_0x3c4df4[_0x250d('0x7b')]+=0x1;for(var _0x2e3b2a in this[_0x250d('0x1b')]){if(typeof this[_0x250d('0x1b')][_0x2e3b2a]!==_0x250d('0xa9')){if(this[_0x250d('0x1b')][_0x2e3b2a][_0x250d('0x6a')]===_0x250d('0x206')&&this[_0x250d('0x1b')][_0x2e3b2a][_0x250d('0x84')]===_0x250d('0x85')){_0x5889aa[_0x250d('0x98')](this[_0x250d('0x1b')][_0x2e3b2a]['id']);}}}_0x3c4df4['temp']=0x1;return this[_0x250d('0x207')](_0x3c4df4['id'],_0x5889aa,0x1,_0x3c4df4[_0x250d('0x20e')],_0x3c4df4)[_0x250d('0x3b')](function(_0x54e05b){_0x3c4df4[_0x250d('0x62')]=0x1;if(_0x54e05b){if(!utils[_0x250d('0x1fc')](_0x54e05b)){utils['checkContactLowerLimitOriginate'](_0x3c4df4,0x1,0x0);return hopperUtils[_0x250d('0x208')](_0x3c4df4)[_0x250d('0x3b')](sendMessageReschedule(_0x3c4df4))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x3c4df4['message']=utils[_0x250d('0x67')][_0x250d('0x1fe')];if(_[_0x250d('0xef')](_0x54e05b[0x0])||_[_0x250d('0xef')](_0x54e05b[0x0][_0x250d('0x176')])||_['isNil'](_0x54e05b[0x0][_0x250d('0x15e')])){_0x337447[_0x250d('0x200')](_0x250d('0x201'),_0x3c4df4,_0x54e05b[0x0]);}else{return hopperUtils['checkIsBlackList'](_['pick'](_0x54e05b[0x0],[_0x250d('0xda'),_0x250d('0x15e')]))[_0x250d('0x3b')](_0x337447[_0x250d('0x1e5')](_0x3c4df4,_0x54e05b[0x0]))['catch'](_0x337447[_0x250d('0x203')](_0x250d('0x20f'),_0x3c4df4));}}}})[_0x250d('0xa0')](loggerGetContactDialer(_0x250d('0x210'),_0x3c4df4,0x1));};Dialer[_0x250d('0x15')][_0x250d('0x1d7')]=function(_0x2dfc1b,_0x328247,_0x35858f,_0x53998d,_0x2f08e2,_0x3fc42b){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x250d('0x42')]('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',_0x2dfc1b);loggerPredictive['info'](_0x250d('0x211'),_0x328247);loggerPredictive[_0x250d('0x42')](_0x250d('0x212'),_0x35858f);loggerPredictive[_0x250d('0x42')](_0x250d('0x213'),_0x53998d);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',_0x2f08e2);loggerPredictive[_0x250d('0x42')]('---------------------------');return new Promise(function(_0x2694b7,_0x2c7c91){if(_0x2dfc1b<=0x0||isNaN(_0x2dfc1b)){return _0x2c7c91(msgResponse(_0x250d('0x214'),_0x250d('0x81'),_0x250d('0x215')+_0x2dfc1b));}if(_0x35858f<=0x0||isNaN(_0x35858f)){return _0x2c7c91(msgResponse('[abandonmentRate]','Error',_0x250d('0x216')+_0x35858f));}if(_0x53998d<=0x0||isNaN(_0x53998d)){return _0x2c7c91(msgResponse(_0x250d('0x214'),_0x250d('0x81'),'p\x20=\x20'+_0x53998d));}if(_0x328247<=0x0||isNaN(_0x328247)){return _0x2c7c91(msgResponse('[abandonmentRate]',_0x250d('0x81'),_0x250d('0x217')+_0x328247));}if(_0x2f08e2<=0x0||isNaN(_0x2f08e2)){return _0x2c7c91(msgResponse('[abandonmentRate]','Error',_0x250d('0x218')+_0x2f08e2));}_0x3fc42b=_0x3fc42b||0x0;var _0x34d31f=0x1/_0x35858f;var _0x541a99=0x0;var _0xbf6f6a=0x0;var _0x2024f3=0x0;var _0x2ddb32=0x0;for(var _0x2d15c7=0x0;_0x2024f3<_0x2f08e2;_0x2d15c7+=0x1){_0xbf6f6a=_0x2d15c7/_0x328247;_0x541a99=(_0x53998d*_0xbf6f6a+_0x3fc42b)/_0x34d31f;_0x2024f3=utils[_0x250d('0x219')](_0x541a99,_0x2dfc1b);_0x2ddb32=_0x541a99/_0x2dfc1b*(0x1-utils[_0x250d('0x219')](_0x541a99,_0x2dfc1b));}return _0x2694b7({'erlangCalls':_0x2d15c7,'erlangCallToSecond':_0x328247/_0x2d15c7,'erlangAbandonmentRate':_0x2024f3,'erlangBusyFactor':_0x2ddb32});});};Dialer['prototype']['busyFactor']=function(_0xd97821,_0x1119b1,_0x48285e,_0x35800b,_0x4b5ffa,_0x125863){loggerPredictive[_0x250d('0x42')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x250d('0x42')](_0x250d('0x21a'),_0xd97821);loggerPredictive[_0x250d('0x42')](_0x250d('0x211'),_0x1119b1);loggerPredictive['info'](_0x250d('0x212'),_0x48285e);loggerPredictive[_0x250d('0x42')]('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',_0x35800b);loggerPredictive[_0x250d('0x42')](_0x250d('0x21b'),_0x4b5ffa);loggerPredictive['info'](_0x250d('0x21c'));return new Promise(function(_0x353cbc,_0x1c2dc9){if(_0xd97821<=0x0||isNaN(_0xd97821)){return _0x1c2dc9(msgResponse('[busyFactor]','Error',_0x250d('0x215')+_0xd97821));}if(_0x48285e<=0x0||isNaN(_0x48285e)){return _0x1c2dc9(msgResponse('[busyFactor]',_0x250d('0x81'),_0x250d('0x216')+_0x48285e));}if(_0x35800b<=0x0||isNaN(_0x35800b)){return _0x1c2dc9(msgResponse(_0x250d('0x21d'),'Error',_0x250d('0x21e')+_0x35800b));}if(_0x1119b1<=0x0||isNaN(_0x1119b1)){return _0x1c2dc9(msgResponse(_0x250d('0x21d'),'Error',_0x250d('0x217')+_0x1119b1));}if(_0x4b5ffa<=0x0||isNaN(_0x4b5ffa)){return _0x1c2dc9(msgResponse('[busyFactor]',_0x250d('0x81'),'Umin\x20=\x20'+_0x4b5ffa));}_0x125863=_0x125863||0x0;var _0x414df6=0x1/_0x48285e;var _0x58fe89=0x0;var _0xce7681=0x0;var _0x1d0aba=0x0;var _0x14dd4b=0x0;for(var _0x4833d9=0x0;_0x14dd4b<_0x4b5ffa;_0x4833d9+=0x1){_0xce7681=_0x4833d9/_0x1119b1;_0x58fe89=(_0x35800b*_0xce7681+_0x125863)/_0x414df6;_0x1d0aba=utils['erlangb'](_0x58fe89,_0xd97821);_0x14dd4b=_0x58fe89/_0xd97821*(0x1-utils[_0x250d('0x219')](_0x58fe89,_0xd97821));}return _0x353cbc({'erlangCalls':_0x4833d9,'erlangCallToSecond':_0x1119b1/_0x4833d9,'erlangAbandonmentRate':_0x1d0aba,'erlangBusyFactor':_0x14dd4b});});};module[_0x250d('0x21f')]=Dialer; \ No newline at end of file +var _0x9cbf=['custom:queuesummary','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopClearZombieChannels','getSettings','then','isUndefined','emit','debug','voice:queue:%s','voice_queue:save','isEmpty','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','getSeconds','startProgressive\x20value\x20cleared','name','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','inspect','checkContactLowerLimitOriginate','temp','contactsRescheduled','message','CAMPAIGN_STATUS','[getContactDialer2][ReScheduled]','contacts','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','queueStatusComplete','stringify','pick','\x20INTERVAL_IS_NULL','Intervals','NULL_INTERVAL','Interval','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','format','campaign:ivr:%s','sendMessageOneNotActive','originated','DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20disactive','[ifTime][Action]','Error','prototype','isTrunkReachable','active','SIP/%s','reachable','status','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','checkIfTime','ifTimeIvr','checkIfTimeIntervals','ifTime','\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','Failure','\x20Intervals\x20is\x20empty\x20','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','push','Action','iftime\x20%s,%s','interval','timezones','content','indexOf','true','catch','command','all','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','undefined','dialGlobalInterval','dialTimezone','launchHandleIvr','dialMethod','progressive','handlePower','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','silly','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','isGlobal','AMI\x20IfTime','syncAgentConnect','queue','uniqueId','uniqueid','type','ivr','YYYY-MM-DD\x20HH:mm:ss','outboundAnswerCallsDay','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','droptime','responsetime','dropreason','countdropretry','countglobal','dialDropRetryFrequency','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','VoiceQueueId','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','callAdditionalPhoneAfterMin','voiceQueue','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','Abandoned','[syncAgentComplete][createHistory][11]','syncNewExten','actions','channel','actionid','isNil','locked','paused','stateinterface','merge','rrmemory','roundrobin','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','updateOriginated','CampaignId','queueBookedRR','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','preview','[booked][RR][finaly]','Agent:\x20','[booked][unlock]','[unlock][syncQueueStatusComplete]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','response','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','membername','AMD','custom:amd','buildObj','saveInDb','[syncHangupInAMD][createHistory]','dialAMDActive','Machine','countmachineretry','amd','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','HangupInAMD','[syncHangupInAMDIvr]','MACHINE','outboundAnswerAgiCallsDay','[rescheduleContact][Machine]','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','[syncHangupIvr][createHistory]','dialQueueProject','cause-txt','Normal\x20Clearing','moveContactManagedDialer','[syncAgentComplete]','outboundUnknownCallsDay','Unknow','running','statusMessage','getQueueCampaignStatusMessage','resolve','available','inUse','talking','pTalking','ACTIVE','checkDialMethod','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','filter','dialPreviewRecallmeReminder','online','map','Agent','user:%s','user:dialPreviewRecallReminder','[uniqueid]','clearZombieChannels','[actions]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','loggerHandler','notFound','UserId','checkPreviewRecallReminder','handleIvr','actionOriginate','object','originate','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAMDInitialSilence','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','isOutboundQueue','XMD-VOICEQUEUEID','Contact','getCallerId','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','callerid','XMD-ORIGINATECALLERIDNAME','originatecalleridname','extractCalleridName','XMD-ORIGINATECALLERIDNUM','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','from-sip','dialOriginateTimeout','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','checkRetriveMax','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','buildNoAnswerEventPayload','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','[moveContactManagedDialer][0]','contact\x20not\x20moved','outboundDropCallsDayTimeout','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','avgHandleTime','startMethodPredictive','recalculate\x20predictive\x20at','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','Queue:\x20','scheduledat','voicePause','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','getContactDialerIvr','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','[getContactCampaign2]','not_inuse','countReScheduled','emptyContact','checkIsBlackList','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','getContactDialer','dialOrderByScheduledAt','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','lodash','moment','ioredis','./utils/hopper','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','redis','localhost','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/interval','./models/action','./models/history','./models/final','./models/agentComplete','./models/queueCallerAbandon','./models/hangup','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queuesSummary','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete'];(function(_0x3213e1,_0x3bdf0f){var _0x32898c=function(_0x2919f0){while(--_0x2919f0){_0x3213e1['push'](_0x3213e1['shift']());}};_0x32898c(++_0x3bdf0f);}(_0x9cbf,0x1e5));var _0xf9cb=function(_0x536181,_0x5f1860){_0x536181=_0x536181-0x0;var _0x4ea8f1=_0x9cbf[_0x536181];return _0x4ea8f1;};'use strict';var util=require(_0xf9cb('0x0'));var _=require(_0xf9cb('0x1'));var uuid=require('uuid');var moment=require(_0xf9cb('0x2'));var rr=require('rr');var Redis=require(_0xf9cb('0x3'));var utils=require('./utils');var hopperUtils=require(_0xf9cb('0x4'));var ut=require('../preview/util/util');var config=require(_0xf9cb('0x5'));var logger=require(_0xf9cb('0x6'))(_0xf9cb('0x7'));var loggerBooked=require(_0xf9cb('0x6'))(_0xf9cb('0x8'));var loggerPredictive=require(_0xf9cb('0x6'))(_0xf9cb('0x9'));var loggerPredictiveCalls=require('../../../config/logger')(_0xf9cb('0xa'));var loggerSyncQueueSummary=require(_0xf9cb('0x6'))(_0xf9cb('0xb'));var ami=require('../ami');config[_0xf9cb('0xc')]=_['defaults'](config[_0xf9cb('0xc')],{'host':_0xf9cb('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf9cb('0xc')]));var cmHopper=require(_0xf9cb('0xe'));var voiceQueueRt=require(_0xf9cb('0xf'));var RpcSetting=require('../rpc/setting');var Interval=require(_0xf9cb('0x10'));var Action=require(_0xf9cb('0x11'));var History=require(_0xf9cb('0x12'));var Final=require(_0xf9cb('0x13'));var AgentComplete=require(_0xf9cb('0x14'));var QueueCallerAbandon=require(_0xf9cb('0x15'));var Hangup=require(_0xf9cb('0x16'));var ipAgi=process[_0xf9cb('0x17')][_0xf9cb('0x18')]||_0xf9cb('0x19');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xf9cb('0x1a')]=function(_0x3d6cb8){this[_0xf9cb('0x1b')]=this['tail']?this['tail'][_0xf9cb('0x1c')](_0x3d6cb8):_0x3d6cb8();};function Dialer(_0x318e33,_0x4ade1c){this[_0xf9cb('0x1d')]=new Sequence();this['preview']=_0x4ade1c;this[_0xf9cb('0x1e')]=_0x318e33[_0xf9cb('0x1e')];this[_0xf9cb('0x1f')]=_0x318e33[_0xf9cb('0x1f')];this[_0xf9cb('0x20')]=_0x318e33[_0xf9cb('0x20')];this[_0xf9cb('0x21')]=_0x318e33[_0xf9cb('0x21')];this[_0xf9cb('0x22')]=config['maxNumberOriginate']||0x2;this[_0xf9cb('0x23')]={};this['actions']={};this[_0xf9cb('0x24')]={};this['uniqueId']={};this[_0xf9cb('0x25')]={};this[_0xf9cb('0x26')]={};this[_0xf9cb('0x27')]={};this[_0xf9cb('0x28')]={};this[_0xf9cb('0x29')]={};this['queueBookedRR']={};this[_0xf9cb('0x2a')]={};ami['on'](_0xf9cb('0x2b'),this['syncAgentConnect'][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x2d'),this[_0xf9cb('0x2e')][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x2f'),this['syncOriginateResponse'][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x30'),this[_0xf9cb('0x31')][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x32'),this[_0xf9cb('0xb')][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x33'),this[_0xf9cb('0x34')][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x35'),this[_0xf9cb('0x36')]['bind'](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on']('varset',this[_0xf9cb('0x37')][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x38'),this[_0xf9cb('0x39')][_0xf9cb('0x2c')](this));ami['on'](_0xf9cb('0x3a'),this['syncQueueStatusComplete']['bind'](this));this['loopCampaigns']();this[_0xf9cb('0x3b')]();RpcSetting[_0xf9cb('0x3c')]()[_0xf9cb('0x3d')](function(_0x5c1403){previewRecallmeReminderInterval=_0x5c1403['previewRecallmeReminderInterval'];});}function isNotNull(_0x3cd1e3){return _0x3cd1e3!==null&&!_[_0xf9cb('0x3e')](_0x3cd1e3);}function msgResponse(_0x208a26,_0x1f6373,_0x27bf1b){return{'action':_0x208a26,'response':_0x1f6373,'message':_0x27bf1b,'stack':_0x27bf1b};}function emit(_0x54e71e,_0x2729d5,_0x597955){io['to'](_0x54e71e)[_0xf9cb('0x3f')](_0x2729d5,_0x597955);}function emitOutboundVoiceQueueSummary(_0x23da76){if(_0x23da76['type']==='outbound'){logger[_0xf9cb('0x40')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x23da76,{'showHidden':![],'depth':null}));emit(util['format'](_0xf9cb('0x41'),_0x23da76['name']),_0xf9cb('0x42'),_0x23da76);}}function checkGetDataPredictive(_0x49c5ed){if(isNotNull(_0x49c5ed)&&!_[_0xf9cb('0x43')](_0x49c5ed)){loggerPredictive[_0xf9cb('0x44')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xf9cb('0x44')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x49c5ed['predictiveIntervalTotalCalls']);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x45'),_0x49c5ed[_0xf9cb('0x46')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x47'),_0x49c5ed[_0xf9cb('0x48')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x49'),_0x49c5ed[_0xf9cb('0x4a')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x4b'),_0x49c5ed[_0xf9cb('0x4c')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x4d'),_0x49c5ed[_0xf9cb('0x4e')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x4f'));if(_0x49c5ed[_0xf9cb('0x50')]>0x0){if(!_['isUndefined'](_0x49c5ed['predictiveIntervalAvgTalktime'])&&_0x49c5ed[_0xf9cb('0x4e')]>0x0){return!![];}loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x51'));if(!_[_0xf9cb('0x3e')](_0x49c5ed[_0xf9cb('0x4c')])&&_0x49c5ed[_0xf9cb('0x4c')]>0x0){return!![];}loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x52'));}else{loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x53'));}}else{loggerPredictive[_0xf9cb('0x44')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x597ff4){return function(_0x5e0887){loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x54'));loggerPredictive['info'](_0xf9cb('0x55'),_0x5e0887['erlangCalls']);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x56'),_0x5e0887[_0xf9cb('0x57')]);loggerPredictive[_0xf9cb('0x44')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5e0887[_0xf9cb('0x58')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x59'),_0x5e0887[_0xf9cb('0x5a')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x5b'),_0x5e0887[_0xf9cb('0x58')]);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x4f'));_['merge'](_0x597ff4,_0x5e0887);};}function ifInterval(_0x571c65,_0x403798){if(_['isUndefined'](_0x403798)){return![];}return utils[_0xf9cb('0x5c')](undefined,_0x403798)<_0x571c65*0x3c;}function clearPredictiveAttributes(_0x8ccd79){if(_0x8ccd79[_0xf9cb('0x27')]){_0x8ccd79[_0xf9cb('0x27')]=undefined;loggerPredictive[_0xf9cb('0x40')](_0x8ccd79['name'],_0xf9cb('0x5d'));}if(_0x8ccd79[_0xf9cb('0x26')]){_0x8ccd79[_0xf9cb('0x26')]=undefined;loggerPredictive[_0xf9cb('0x40')](_0x8ccd79[_0xf9cb('0x5e')],'startPredictive\x20value\x20cleared');}if(_0x8ccd79[_0xf9cb('0x5f')]){clearInterval(_0x8ccd79[_0xf9cb('0x5f')]);_0x8ccd79[_0xf9cb('0x5f')]=undefined;loggerPredictive[_0xf9cb('0x40')](_0x8ccd79['name'],_0xf9cb('0x60'));}}function loggerCatchPredictive(_0x53b977,_0xc315d7){return function(_0x28412d){loggerPredictive[_0xf9cb('0x61')](_0xc315d7[_0xf9cb('0x5e')],_0x53b977);loggerPredictive['error'](_0x28412d[_0xf9cb('0x62')]);clearPredictiveAttributes(_0xc315d7);};}function loggerCatch(_0x5c10e5){return function(_0x2c780f){logger[_0xf9cb('0x61')](_0x5c10e5,util[_0xf9cb('0x63')](_0x2c780f,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x225b9a,_0xe88670,_0x31d5a1){return function(_0x286e62){utils[_0xf9cb('0x64')](_0xe88670,_0x31d5a1,0x0);_0xe88670[_0xf9cb('0x65')]=0x0;logger[_0xf9cb('0x61')](_0x225b9a,util[_0xf9cb('0x63')](_0x286e62,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x30c026){return function(_0x200536){if(isNotNull(_0x200536)&&isNotNull(_0x200536[0x0])){if(_0x200536[0x0][_0xf9cb('0x66')]>0x0){_0x30c026[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')]['CONTACTS_RESCHEDULED'];logger['info'](_0xf9cb('0x69')+_0x30c026[_0xf9cb('0x5e')],_0x200536[0x0][_0xf9cb('0x66')],_0xf9cb('0x6a'));}else{_0x30c026[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x6b')];logger[_0xf9cb('0x44')](_0xf9cb('0x6c')+_0x30c026[_0xf9cb('0x5e')]);}}};}function createObjHistory(_0x3b156d,_0x166006,_0x69b340,_0x5aa4a7,_0x46ae42){_0x3b156d[_0xf9cb('0x67')]=_0x69b340;var _0x3dadba=new Action(_0x3b156d,_0x166006);var _0x154823=new History(_0x3dadba);_0x154823[_0xf9cb('0x6d')]=_0x5aa4a7;_0x154823[_0xf9cb('0x6e')]=_0x46ae42;_0x154823[_0xf9cb('0x6f')]=_0x3dadba['starttime'];return _0x154823;}function unlockQueueStatus(_0x7884d3,_0x2eff23){setTimeout(function(){if(_[_0xf9cb('0x3e')](_0x7884d3['queueStatusComplete'])){loggerBooked[_0xf9cb('0x61')]('[unlockQueueStatus][undefined]',_0x2eff23);}_0x7884d3[_0xf9cb('0x70')]=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x2eff23,JSON[_0xf9cb('0x71')](_[_0xf9cb('0x72')](_0x7884d3,[_0xf9cb('0x5e'),_0xf9cb('0x70')])));},0x1f3);}function checkInterval(_0x129fce){return function(){if(!isNotNull(_0x129fce['Interval'])){_0x129fce[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')]['NULL_INTERVAL'];throw _0x129fce[_0xf9cb('0x5e')]+_0xf9cb('0x73');}if(!isNotNull(_0x129fce['Interval'][_0xf9cb('0x74')])){_0x129fce[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x75')];throw _0x129fce['name']+_0xf9cb('0x73');}if(!isNotNull(_['isEmpty'](_0x129fce[_0xf9cb('0x76')]['Intervals']))){_0x129fce['message']=utils[_0xf9cb('0x68')][_0xf9cb('0x75')];throw _0x129fce[_0xf9cb('0x5e')]+_0xf9cb('0x73');}};}function checkIsIVRCampaignActive(_0x4c4530){return function(){if(!utils[_0xf9cb('0x77')](_0x4c4530)){_0x4c4530[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x78')];throw _0x4c4530[_0xf9cb('0x5e')]+_0xf9cb('0x79');}};}function emitCampaignSummary(_0x1de7ca){if(utils[_0xf9cb('0x7a')](_0x1de7ca)){emit(util[_0xf9cb('0x7b')](_0xf9cb('0x7c'),_0x1de7ca[_0xf9cb('0x5e')]),'campaign:save',_0x1de7ca);}}function loggerCatchQueueSummary(_0x2f9375,_0x137dc3){return function(_0x329f64){clearPredictiveAttributes(_0x137dc3);emitCampaignSummary(_0x137dc3);loggerSyncQueueSummary[_0xf9cb('0x40')](_0x2f9375,util[_0xf9cb('0x63')](_0x329f64,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x1b061e){if(_0x1b061e[_0xf9cb('0x7d')]){if(_0x1b061e[_0xf9cb('0x7e')]===0x0){_0x1b061e[_0xf9cb('0x7d')]=![];_0x1b061e[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x78')];loggerSyncQueueSummary[_0xf9cb('0x40')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x1b061e['name'],'is\x20not\x20active');}else{_0x1b061e['message']=utils['CAMPAIGN_STATUS'][_0xf9cb('0x7f')];loggerSyncQueueSummary[_0xf9cb('0x40')](_0xf9cb('0x80'),_0x1b061e['name'],_0xf9cb('0x81'));}emitCampaignSummary(_0x1b061e);}}function myreject(_0x47a2d2){return function(_0x5a634f){return _0x47a2d2(msgResponse(_0xf9cb('0x82'),_0xf9cb('0x83'),JSON[_0xf9cb('0x71')](_0x5a634f)));};}Dialer[_0xf9cb('0x84')][_0xf9cb('0x85')]=function(_0x298d0f){return!_[_0xf9cb('0x3e')](_0x298d0f)&&_0x298d0f&&!_[_0xf9cb('0x3e')](_0x298d0f[_0xf9cb('0x5e')])&&!_[_0xf9cb('0x3e')](_0x298d0f['active'])&&_0x298d0f[_0xf9cb('0x86')]&&(this[_0xf9cb('0x21')][util['format'](_0xf9cb('0x87'),_0x298d0f[_0xf9cb('0x5e')])]['status']===_0xf9cb('0x88')||this[_0xf9cb('0x21')][util['format'](_0xf9cb('0x87'),_0x298d0f['name'])][_0xf9cb('0x89')]===_0xf9cb('0x8a'));};Dialer['prototype'][_0xf9cb('0x8b')]=function(_0x42ece3){var _0x388523=this;return function(){if(!_0x388523[_0xf9cb('0x85')](_0x42ece3[_0xf9cb('0x8c')])){if(!_0x388523[_0xf9cb('0x85')](_0x42ece3[_0xf9cb('0x8d')])){_0x42ece3[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x8e')];throw _0x42ece3[_0xf9cb('0x5e')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer['prototype'][_0xf9cb('0x8f')]=function(_0x25e9c3,_0x82021b,_0xb7d88f,_0x5755b5){var _0x3639d7=this;return function(){var _0x3b2d9a=!![];return _0x3639d7[_0xf9cb('0x90')](_0x25e9c3,_0x82021b,_0xb7d88f,_0x5755b5,_0x3b2d9a);};};Dialer[_0xf9cb('0x84')][_0xf9cb('0x91')]=function(_0x47799f,_0x224e6e,_0x3ac8e1,_0x1bcc9a){var _0x2fe90b=this;return function(){var _0x42a2b3=![];return _0x2fe90b[_0xf9cb('0x90')](_0x47799f['Intervals'],_0x224e6e,_0x3ac8e1,_0x1bcc9a,_0x42a2b3);};};Dialer[_0xf9cb('0x84')][_0xf9cb('0x90')]=function(_0x45003e,_0x593970,_0x2c56b3,_0x5b1765,_0x239f8b){var _0x2fc277=[];return new Promise(function(_0x46a3b4,_0x500d9d){if(!isNotNull(_0x45003e)){_0x5b1765[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x75')];return _0x500d9d(msgResponse(_0xf9cb('0x92'),'Failure',_0x2c56b3+_0xf9cb('0x93')));}if(_['isEmpty'](_0x45003e)){_0x5b1765[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x94')];return _0x500d9d(msgResponse(_0xf9cb('0x92'),_0xf9cb('0x95'),_0x2c56b3+_0xf9cb('0x96')));}if(_0x593970&&_[_0xf9cb('0x3e')](config['timezones'][_0x593970])){_0x5b1765['message']=utils[_0xf9cb('0x68')][_0xf9cb('0x97')];return _0x500d9d(msgResponse(_0xf9cb('0x92'),_0xf9cb('0x95'),_0x2c56b3+_0xf9cb('0x98')+_0x593970));}if(_[_0xf9cb('0x99')](_0x45003e)){for(var _0x317ccd=0x0;_0x317ccd<_0x45003e[_0xf9cb('0x9a')];_0x317ccd+=0x1){_0x2fc277[_0xf9cb('0x9b')](ami[_0xf9cb('0x9c')]({'action':'command','command':util['format'](_0xf9cb('0x9d'),_0x45003e[_0x317ccd][_0xf9cb('0x9e')],!_[_0xf9cb('0x3e')](config[_0xf9cb('0x9f')][_0x593970])?_0x593970:'')})[_0xf9cb('0x3d')](function(_0x5068d1){return _0x5068d1[_0xf9cb('0xa0')][_0xf9cb('0xa1')](_0xf9cb('0xa2'))>=0x0;})[_0xf9cb('0xa3')](myreject(_0x500d9d)));}}else{_0x2fc277[_0xf9cb('0x9b')](ami['Action']({'action':_0xf9cb('0xa4'),'command':util['format']('iftime\x20%s,%s',_0x45003e,!_[_0xf9cb('0x3e')](config[_0xf9cb('0x9f')][_0x593970])?_0x593970:'')})[_0xf9cb('0x3d')](function(_0x11b5b2){return _0x11b5b2['content'][_0xf9cb('0xa1')](_0xf9cb('0xa2'))>=0x0;})[_0xf9cb('0xa3')](myreject(_0x500d9d)));}Promise[_0xf9cb('0xa5')](_0x2fc277)['then'](function(_0x4e6ea1){var _0x46fc37=_['some'](_0x4e6ea1);if(_0x46fc37){return _0x46a3b4(_0x46fc37);}else{_0x5b1765[_0xf9cb('0x67')]=_0x239f8b?utils[_0xf9cb('0x68')]['OVERTIME_GLOBAL_INTERVAL']:utils[_0xf9cb('0x68')][_0xf9cb('0xa6')];return _0x500d9d(msgResponse(_0xf9cb('0xa7'),'Failure',_0xf9cb('0xa8')+_0x239f8b+'\x20'+_0x2c56b3+_0xf9cb('0xa9')+util['inspect'](_0x45003e,{'showHidden':![],'depth':null})+_0xf9cb('0xaa')+_0x593970));}})[_0xf9cb('0xa3')](function(_0x3bd36b){return _0x500d9d(msgResponse(_0xf9cb('0x92'),_0xf9cb('0x95'),JSON['stringify'](_0x3bd36b)));});});};Dialer[_0xf9cb('0x84')][_0xf9cb('0xab')]=function(){var _0x15ae59=this;return cmHopper[_0xf9cb('0xac')]({'active':![]},{'where':{'active':!![]}})[_0xf9cb('0x3d')](function(){setInterval(function(){_0x15ae59['syncCampaigns']();},0x3e8);});};Dialer[_0xf9cb('0x84')][_0xf9cb('0xad')]=function(){var _0x4d0254=this;var _0x228fa1;for(var _0x412158 in this[_0xf9cb('0x1f')]){if(typeof this[_0xf9cb('0x1f')][_0x412158]!==_0xf9cb('0xae')){_0x228fa1=this[_0xf9cb('0x1f')][_0x412158];if(utils[_0xf9cb('0x7a')](_0x228fa1)&&utils['isIVRCampaignActive'](_0x228fa1)){_0x228fa1['sendMessageOneNotActive']=!![];Promise['resolve']()[_0xf9cb('0x3d')](checkIsIVRCampaignActive(_0x228fa1))[_0xf9cb('0x3d')](checkInterval(_0x228fa1))[_0xf9cb('0x3d')](_0x4d0254[_0xf9cb('0x8b')](_0x228fa1))[_0xf9cb('0x3d')](_0x4d0254[_0xf9cb('0x8f')](_0x228fa1[_0xf9cb('0xaf')],_0x228fa1['dialTimezone'],_0x228fa1[_0xf9cb('0x5e')],_0x228fa1))[_0xf9cb('0x3d')](_0x4d0254[_0xf9cb('0x91')](_0x228fa1[_0xf9cb('0x76')],_0x228fa1[_0xf9cb('0xb0')],_0x228fa1[_0xf9cb('0x5e')],_0x228fa1))[_0xf9cb('0x3d')](_0x4d0254[_0xf9cb('0xb1')](_0x228fa1))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x228fa1));}else{notSendMessagesCampaign(_0x228fa1);}}}};Dialer['prototype']['checkDialMethod']=function(_0x16bcff){if(_0x16bcff[_0xf9cb('0xb2')]!==_0xf9cb('0x9')){clearPredictiveAttributes(_0x16bcff);}switch(_0x16bcff[_0xf9cb('0xb2')]){case _0xf9cb('0xb3'):this['handlePower'](_0x16bcff,0x1);break;case'power':this[_0xf9cb('0xb4')](_0x16bcff,_0x16bcff['dialPowerLevel']);break;case _0xf9cb('0x9'):this['predictive'](_0x16bcff);break;case _0xf9cb('0x8'):this[_0xf9cb('0xb4')](_0x16bcff,0x1);break;default:logger[_0xf9cb('0x61')]('Queue',_0x16bcff['name'],'method\x20not\x20recognized');}};Dialer[_0xf9cb('0x84')][_0xf9cb('0x92')]=function(_0xcce9f,_0xe27778){var _0x6afdef=_0xcce9f['dialTimezone'];var _0x38c55c=_0xe27778?_0xcce9f['dialGlobalInterval']:_0xcce9f[_0xf9cb('0x76')][_0xf9cb('0x74')];logger['silly'](_0xf9cb('0xb5'),_0x38c55c,_0x6afdef,_0xcce9f[_0xf9cb('0x5e')],util['format'](_0xf9cb('0xb6'),_0xcce9f['name'],_0xcce9f['id']));var _0x35fe80=null;return Interval[_0xf9cb('0xb7')](_0x38c55c,_0x6afdef)[_0xf9cb('0x3d')](function(_0x209a31){if(_0x209a31===!![]){return _0x209a31;}else{_0xcce9f[_0xf9cb('0x67')]=_0xe27778?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils[_0xf9cb('0x68')]['OVERTIME_INTERVAL'];_0x35fe80=msgResponse(_0xf9cb('0xa7'),_0xf9cb('0x95'),'Global:\x20'+_0xe27778+'\x20'+_0xcce9f[_0xf9cb('0x5e')]+_0xf9cb('0xa9')+util['inspect'](_0x38c55c,{'showHidden':![],'depth':null})+_0xf9cb('0xaa')+_0x6afdef);}if(_0x35fe80!==null){logger[_0xf9cb('0xb8')](_0xf9cb('0xb9'),_0x35fe80);_0x35fe80[_0xf9cb('0xba')]=_0xe27778;throw _0x35fe80;}})[_0xf9cb('0xa3')](function(_0x547359){logger[_0xf9cb('0x61')](_0xf9cb('0xbb'),_0x547359);throw msgResponse(_0xf9cb('0x82'),_0xf9cb('0x83'),util[_0xf9cb('0x63')](_0x547359,{'showHidden':![],'depth':null}));});};Dialer[_0xf9cb('0x84')][_0xf9cb('0xbc')]=function(_0x117f39){if(this['voiceQueues'][_0x117f39[_0xf9cb('0xbd')]]){if(this[_0xf9cb('0xbe')][_0x117f39[_0xf9cb('0xbf')]]&&this[_0xf9cb('0xbe')][_0x117f39[_0xf9cb('0xbf')]][_0xf9cb('0xc0')]!==_0xf9cb('0xc1')){this['updateOriginated'](this[_0xf9cb('0x1e')][_0x117f39[_0xf9cb('0xbd')]]);this[_0xf9cb('0xbe')][_0x117f39[_0xf9cb('0xbf')]]['answertime']=moment()[_0xf9cb('0x7b')](_0xf9cb('0xc2'));}}};Dialer[_0xf9cb('0x84')][_0xf9cb('0x31')]=function(_0x80e3a6){var _0xabc0b=this[_0xf9cb('0xbe')][_0x80e3a6[_0xf9cb('0xbf')]];if(this[_0xf9cb('0x1e')][_0x80e3a6[_0xf9cb('0xbd')]]){if(_0xabc0b&&_0xabc0b[_0xf9cb('0xc0')]!==_0xf9cb('0xc1')){delete this[_0xf9cb('0xbe')][_0x80e3a6[_0xf9cb('0xbf')]];this[_0xf9cb('0x1e')][_0x80e3a6[_0xf9cb('0xbd')]][_0xf9cb('0xc3')]+=0x1;var _0x3dbc83=new AgentComplete(_0xabc0b,_0x80e3a6);if(_0x80e3a6[_0xf9cb('0xc4')]===_0xf9cb('0xc5')){_0x3dbc83[_0xf9cb('0xc6')]=this[_0xf9cb('0x1e')][_0x80e3a6[_0xf9cb('0xbd')]][_0xf9cb('0xc7')]&&this['voiceQueues'][_0x80e3a6['queue']][_0xf9cb('0xc8')]?moment()['format'](_0xf9cb('0xc2')):undefined;}hopperUtils[_0xf9cb('0xc9')](_0x3dbc83)['catch'](loggerCatch(_0xf9cb('0xca')));hopperUtils['moveContactManagedDialer'](_0x3dbc83)[_0xf9cb('0xa3')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xf9cb('0x84')][_0xf9cb('0x2e')]=function(_0x58961f){var _0x402a48=this[_0xf9cb('0xbe')][_0x58961f[_0xf9cb('0xbf')]];var _0x130a50=this;var _0x240c0f=![];var _0x4f53e5;var _0x1bf370;if(this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]]){if(_0x402a48&&_0x402a48['type']!==_0xf9cb('0xc1')){delete this[_0xf9cb('0xbe')][_0x58961f[_0xf9cb('0xbf')]];this['updateOriginated'](this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]]);_0x402a48['droptime']=moment()['format'](_0xf9cb('0xc2'));var _0x40b7c2=new QueueCallerAbandon(_0x402a48,_0x58961f);if(utils[_0xf9cb('0x5c')](_0x402a48[_0xf9cb('0xcb')],_0x402a48[_0xf9cb('0xcc')])>=_0x402a48['dialQueueTimeout']){this['voiceQueues'][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0x48')]+=0x1;this['voiceQueues'][_0x58961f[_0xf9cb('0xbd')]]['outboundDropCallsDayTimeout']+=0x1;this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x40b7c2[_0xf9cb('0x6d')]=0xa;_0x40b7c2['statedesc']='Drop';_0x40b7c2[_0xf9cb('0xcd')]='TIMEOUT';_0x40b7c2['agiafterat']=this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0xc7')]?moment()[_0xf9cb('0x7b')](_0xf9cb('0xc2')):undefined;_0x40b7c2[_0xf9cb('0xce')]+=0x1;_0x40b7c2[_0xf9cb('0xcf')]+=0x1;_0x4f53e5=this['voiceQueues'][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0xd0')];_0x1bf370=this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xf9cb('0xd1')](_0x40b7c2,_0x40b7c2[_0xf9cb('0x6d')],_0x402a48['voiceQueue'])[_0xf9cb('0x3d')](function(_0x12e5d5){_0x240c0f=_0x12e5d5[_0xf9cb('0xd2')]==0x1;if(_0x40b7c2[_0xf9cb('0xce')]>=_0x130a50[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0xd3')]){_0x130a50[_0xf9cb('0xd4')](_0x40b7c2,_0x12e5d5['additional']);}else{hopperUtils[_0xf9cb('0xd5')]({'active':![],'countdropretry':_0x40b7c2['countdropretry'],'scheduledat':moment()[_0xf9cb('0xd6')](_0x130a50[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0xd0')],_0xf9cb('0xd7'))[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x402a48[_0xf9cb('0xd8')],'ListId':_0x402a48[_0xf9cb('0xd9')],'VoiceQueueId':_0x402a48[_0xf9cb('0xda')]||undefined,'CampaignId':_0x402a48['CampaignId']||undefined})['catch'](loggerCatch(_0xf9cb('0xdb')));var _0x50da42=new History(_0x40b7c2);_0x50da42[_0xf9cb('0x6d')]=0xa;_0x50da42[_0xf9cb('0x6e')]='Drop';_0x50da42[_0xf9cb('0xdc')]=moment()[_0xf9cb('0x7b')](_0xf9cb('0xc2'));_0x50da42[_0xf9cb('0x6f')]=_0x50da42[_0xf9cb('0xdc')];_0x50da42[_0xf9cb('0xdd')]=_0x40b7c2[_0xf9cb('0xdd')];_0x50da42[_0xf9cb('0xde')]=_0x40b7c2['calleridnum'];hopperUtils[_0xf9cb('0xc9')](_0x50da42)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0xdf')));}})[_0xf9cb('0x3d')](function(){if(_0x240c0f)hopperUtils[_0xf9cb('0xe0')](_0x40b7c2,_0x4f53e5,_0x1bf370)[_0xf9cb('0x3d')](function(){return 0x1;});});}else{this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0xe1')]+=0x1;_0x40b7c2[_0xf9cb('0x6d')]=0xb;_0x40b7c2[_0xf9cb('0x6e')]='Abandoned';_0x40b7c2[_0xf9cb('0xcd')]=_0xf9cb('0xe2');_0x40b7c2[_0xf9cb('0xe3')]+=0x1;_0x40b7c2[_0xf9cb('0xcf')]+=0x1;_0x4f53e5=this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]]['dialAbandonedRetryFrequency'];_0x1bf370=this[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0xe4')];hopperUtils[_0xf9cb('0xd1')](_0x40b7c2,_0x40b7c2['state'],_0x402a48[_0xf9cb('0xe5')])[_0xf9cb('0x3d')](function(_0x546928){if(_0x40b7c2[_0xf9cb('0xe3')]>=_0x130a50[_0xf9cb('0x1e')][_0x58961f[_0xf9cb('0xbd')]][_0xf9cb('0xe6')]){_0x130a50[_0xf9cb('0xd4')](_0x40b7c2,_0x546928[_0xf9cb('0xd2')]);}else{hopperUtils[_0xf9cb('0xd5')]({'active':![],'countabandonedretry':_0x40b7c2['countabandonedretry'],'scheduledat':moment()[_0xf9cb('0xd6')](_0x130a50['voiceQueues'][_0x58961f['queue']][_0xf9cb('0xe7')],_0xf9cb('0xd7'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x402a48['ContactId'],'ListId':_0x402a48[_0xf9cb('0xd9')],'VoiceQueueId':_0x402a48[_0xf9cb('0xda')]||undefined,'CampaignId':_0x402a48['CampaignId']||undefined})[_0xf9cb('0xa3')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x58006a=new History(_0x40b7c2);_0x58006a[_0xf9cb('0x6d')]=0xb;_0x58006a[_0xf9cb('0x6e')]=_0xf9cb('0xe8');_0x58006a[_0xf9cb('0xdc')]=moment()[_0xf9cb('0x7b')](_0xf9cb('0xc2'));_0x58006a[_0xf9cb('0x6f')]=_0x58006a['starttime'];_0x58006a[_0xf9cb('0xdd')]=_0x40b7c2[_0xf9cb('0xdd')];_0x58006a[_0xf9cb('0xde')]=_0x40b7c2[_0xf9cb('0xde')];hopperUtils[_0xf9cb('0xc9')](_0x58006a)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0xe9')));}})[_0xf9cb('0x3d')](function(){if(_0x240c0f)hopperUtils[_0xf9cb('0xe0')](_0x40b7c2,_0x4f53e5,_0x1bf370)['then'](function(){return 0x1;});});}}}};Dialer[_0xf9cb('0x84')][_0xf9cb('0xea')]=function(_0x17ee87){if(this[_0xf9cb('0xeb')][_0x17ee87[_0xf9cb('0xbf')]]){this['actions'][_0x17ee87[_0xf9cb('0xbf')]]['channel']=_0x17ee87[_0xf9cb('0xec')];}if(this['uniqueId'][_0x17ee87['uniqueid']]){this[_0xf9cb('0xbe')][_0x17ee87[_0xf9cb('0xbf')]][_0xf9cb('0xec')]=_0x17ee87[_0xf9cb('0xec')];}};Dialer[_0xf9cb('0x84')]['syncQueueMember']=function(_0xa671a9){if(!this['actions'][_0xa671a9[_0xf9cb('0xed')]]){return;}var _0x24b6bc=this[_0xf9cb('0x1e')][this[_0xf9cb('0xeb')][_0xa671a9['actionid']][_0xf9cb('0xbd')]]['strategy']||'rrmemory';if(_0x24b6bc==='roundrobin'){if(this[_0xf9cb('0xeb')][_0xa671a9['actionid']]&&_[_0xf9cb('0xee')](this[_0xf9cb('0xeb')][_0xa671a9['actionid']][_0xf9cb('0xef')])&&_0xa671a9[_0xf9cb('0x89')]==='1'&&_0xa671a9[_0xf9cb('0xf0')]==='0'){if(this[_0xf9cb('0x20')][_0xa671a9[_0xf9cb('0xf1')]]){if(!this[_0xf9cb('0x20')][_0xa671a9[_0xf9cb('0xf1')]][_0xf9cb('0xef')]){this[_0xf9cb('0x20')][_0xa671a9[_0xf9cb('0xf1')]]['locked']=!![];this[_0xf9cb('0xeb')][_0xa671a9['actionid']]['locked']=!![];this['actions'][_0xa671a9[_0xf9cb('0xed')]][_0xf9cb('0xf1')]=_0xa671a9['stateinterface'];}}}}else if(_0x24b6bc==='rrmemory'){if(this['actions'][_0xa671a9[_0xf9cb('0xed')]]){if(this[_0xf9cb('0x20')][_0xa671a9[_0xf9cb('0xf1')]]){this[_0xf9cb('0xeb')][_0xa671a9[_0xf9cb('0xed')]][_0xf9cb('0xf1')]=_0xa671a9['stateinterface'];if(_['isNil'](this[_0xf9cb('0x29')][this[_0xf9cb('0xeb')][_0xa671a9[_0xf9cb('0xed')]]['queue']])){this['queueBooked'][this[_0xf9cb('0xeb')][_0xa671a9[_0xf9cb('0xed')]][_0xf9cb('0xbd')]]=[];}this['queueBooked'][this[_0xf9cb('0xeb')][_0xa671a9[_0xf9cb('0xed')]][_0xf9cb('0xbd')]][_0xf9cb('0x9b')](_[_0xf9cb('0xf2')](_['pick'](this[_0xf9cb('0xeb')][_0xa671a9['actionid']],['idHopper',_0xf9cb('0xf1')]),{'status':_0xa671a9[_0xf9cb('0x89')],'paused':_0xa671a9['paused']}));}}}};Dialer[_0xf9cb('0x84')]['syncQueueStatusComplete']=function(_0x15680e){if(!this[_0xf9cb('0xeb')][_0x15680e['actionid']]){return;}var _0x1cde4e=this;var _0x33e18c=this[_0xf9cb('0x1e')][this['actions'][_0x15680e['actionid']][_0xf9cb('0xbd')]];var _0x525220=_0x33e18c['strategy']||_0xf9cb('0xf3');if(_0x525220===_0xf9cb('0xf4')){if(this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]]&&this['actions'][_0x15680e[_0xf9cb('0xed')]]['stateinterface']){this['preview'][_0xf9cb('0xf5')](this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xf6')],this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xf1')])[_0xf9cb('0xa3')](function(_0x1cbced){logger[_0xf9cb('0x61')](_0xf9cb('0xf7'),util[_0xf9cb('0x63')](_0x1cbced,{'showHidden':![],'depth':null}));})[_0xf9cb('0x1c')](function(){_0x1cde4e['updateOriginated'](_0x1cde4e[_0xf9cb('0x1e')][_0x1cde4e[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]]['queue']]);_0x1cde4e['agents'][_0x1cde4e[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]]['stateinterface']][_0xf9cb('0xef')]=![];delete _0x1cde4e[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]];unlockQueueStatus(_0x33e18c);});}else{this[_0xf9cb('0xf8')](this['voiceQueues'][this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]]['queue']]);hopperUtils[_0xf9cb('0xd5')]({'active':![],'ContactId':this[_0xf9cb('0xeb')][_0x15680e['actionid']][_0xf9cb('0xd8')],'ListId':this['actions'][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xd9')],'VoiceQueueId':this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xda')]||undefined,'CampaignId':this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xf9')]||undefined})[_0xf9cb('0xa3')](loggerCatch('[unlock][syncQueueStatusComplete]'));delete this['actions'][_0x15680e[_0xf9cb('0xed')]];unlockQueueStatus(_0x33e18c);}}else if(_0x525220===_0xf9cb('0xf3')){var _0x4b2124;if(this['actions'][_0x15680e[_0xf9cb('0xed')]]&&!_[_0xf9cb('0x43')](this[_0xf9cb('0x29')][this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xbd')]])){if(this['queueBookedRR'][_0x1cde4e[_0xf9cb('0xeb')][_0x15680e['actionid']]['queue']]){this[_0xf9cb('0xfa')][_0x1cde4e[_0xf9cb('0xeb')][_0x15680e['actionid']][_0xf9cb('0xbd')]]=this[_0xf9cb('0xfa')][this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]]['queue']]?this[_0xf9cb('0xfa')][this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xbd')]]:this['queueBooked'][this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]]['queue']]?this[_0xf9cb('0x29')][this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xbd')]]['_rr']||0x0:0x0;}this['queueBooked'][this[_0xf9cb('0xeb')][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xbd')]]['_rr']=this[_0xf9cb('0xfa')][this['actions'][_0x15680e[_0xf9cb('0xed')]][_0xf9cb('0xbd')]];for(var _0x5f3c17=0x0;_0x5f3c17=_0x24f31a[_0xf9cb('0x122')]){_0x1171c5[_0xf9cb('0x123')](_0x367c7a,_0x23edcb,_0x338c7f,_0xf9cb('0x124'));}else{if(_0x367c7a['countmachineretry']>=_0x24f31a[_0xf9cb('0x125')]){_0x1171c5[_0xf9cb('0x126')](_0x367c7a,_0x23edcb,_0x338c7f,_0xf9cb('0x127'));}else{hopperUtils[_0xf9cb('0xd5')]({'active':![],'countmachineretry':_0x367c7a[_0xf9cb('0x11a')],'scheduledat':moment()[_0xf9cb('0xd6')](_0x24f31a[_0xf9cb('0x128')],_0xf9cb('0xd7'))['format'](_0xf9cb('0xc2')),'ContactId':_0x367c7a[_0xf9cb('0xd8')],'ListId':_0x367c7a['ListId'],'VoiceQueueId':_0x367c7a[_0xf9cb('0xda')]||undefined,'CampaignId':_0x367c7a[_0xf9cb('0xf9')]||undefined})[_0xf9cb('0xa3')](loggerCatch('[rescheduleContact][Machine]'));_0x23edcb({'reschedule':0x1});}}});}if(_0x365d40[_0xf9cb('0xc0')]===_0xf9cb('0xc1')&&this[_0xf9cb('0x1f')][_0x365d40['queue']][_0xf9cb('0x118')]&&_0x198ab9['value']==='HANGUP'){delete this[_0xf9cb('0xbe')][_0x198ab9['uniqueid']];this[_0xf9cb('0xf8')](this[_0xf9cb('0x1f')][_0x365d40[_0xf9cb('0xbd')]]);_0x490fd6=new Hangup(_0x365d40,_0x198ab9);_0x490fd6['state']=0x12;_0x490fd6[_0xf9cb('0x6e')]=_0xf9cb('0x129');_0x490fd6['membername']=_0xf9cb('0x113');ami[_0xf9cb('0x3f')](_0xf9cb('0x114'),ut[_0xf9cb('0x115')](_0x490fd6,_0xf9cb('0x11b')));this[_0xf9cb('0x116')](_0x490fd6,'[syncHangupInAMDIvr][createHistory]',_0xf9cb('0x12a'));}if(_0x365d40['type']==='ivr'&&this[_0xf9cb('0x1f')][_0x365d40['queue']]['dialAMDActive']&&_0x198ab9['value']===_0xf9cb('0x12b')){return new Promise(function(_0x53ca5e,_0x1b6e0f){delete _0x1171c5['uniqueId'][_0x198ab9[_0xf9cb('0xbf')]];_0x1171c5[_0xf9cb('0xf8')](_0x1171c5[_0xf9cb('0x1f')][_0x365d40[_0xf9cb('0xbd')]]);_0x1171c5[_0xf9cb('0x1f')][_0x365d40[_0xf9cb('0xbd')]][_0xf9cb('0xc3')]+=0x1;_0x1171c5[_0xf9cb('0x1f')][_0x365d40[_0xf9cb('0xbd')]][_0xf9cb('0x12c')]+=0x1;var _0x3a0804=_0x1171c5[_0xf9cb('0x1f')][_0x365d40['queue']];var _0x2ecbf4=new Hangup(_0x365d40,_0x198ab9);_0x2ecbf4['state']=0x13;_0x2ecbf4[_0xf9cb('0x6e')]=_0xf9cb('0x119');_0x2ecbf4[_0xf9cb('0x112')]=_0xf9cb('0x113');_0x2ecbf4[_0xf9cb('0x11a')]+=0x1;_0x2ecbf4[_0xf9cb('0xcf')]+=0x1;_0x2ecbf4[_0xf9cb('0x11b')]=!![];ami['emit'](_0xf9cb('0x114'),ut[_0xf9cb('0x115')](_0x2ecbf4,_0xf9cb('0x11b')));hopperUtils['createHistory'](_0x2ecbf4)[_0xf9cb('0xa3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x2ecbf4[_0xf9cb('0x11d')]+_0x2ecbf4[_0xf9cb('0x11e')]+_0x2ecbf4[_0xf9cb('0x11f')]+_0x2ecbf4[_0xf9cb('0x120')]+_0x2ecbf4[_0xf9cb('0xce')]+_0x2ecbf4[_0xf9cb('0xe3')]+_0x2ecbf4[_0xf9cb('0x11a')]+_0x2ecbf4[_0xf9cb('0x121')]>=_0x3a0804[_0xf9cb('0x122')]){_0x1171c5[_0xf9cb('0x123')](_0x2ecbf4,_0x53ca5e,_0x1b6e0f,_0xf9cb('0x124'));}else{if(_0x2ecbf4[_0xf9cb('0x11a')]>=_0x3a0804[_0xf9cb('0x125')]){_0x1171c5[_0xf9cb('0x126')](_0x2ecbf4,_0x53ca5e,_0x1b6e0f,_0xf9cb('0x127'));}else{hopperUtils[_0xf9cb('0xd5')]({'active':![],'countmachineretry':_0x2ecbf4[_0xf9cb('0x11a')],'scheduledat':moment()[_0xf9cb('0xd6')](_0x3a0804[_0xf9cb('0x128')],_0xf9cb('0xd7'))['format'](_0xf9cb('0xc2')),'ContactId':_0x2ecbf4[_0xf9cb('0xd8')],'ListId':_0x2ecbf4[_0xf9cb('0xd9')],'VoiceQueueId':_0x2ecbf4[_0xf9cb('0xda')]||undefined,'CampaignId':_0x2ecbf4[_0xf9cb('0xf9')]||undefined})[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x12d')));_0x53ca5e({'reschedule':0x1});}}});}}};Dialer[_0xf9cb('0x84')][_0xf9cb('0x36')]=function(_0x5a9be9){var _0x485d7d=this[_0xf9cb('0xbe')][_0x5a9be9[_0xf9cb('0xbf')]];var _0x465e36;if(_0x485d7d&&_0x485d7d[_0xf9cb('0xc0')]===_0xf9cb('0xc1')){delete this[_0xf9cb('0xbe')][_0x5a9be9[_0xf9cb('0xbf')]];this['updateOriginated'](this[_0xf9cb('0x1f')][_0x485d7d[_0xf9cb('0xbd')]]);this[_0xf9cb('0x1f')][_0x485d7d[_0xf9cb('0xbd')]][_0xf9cb('0x12e')]+=0x1;_0x465e36=new Hangup(_0x485d7d,_0x5a9be9);hopperUtils[_0xf9cb('0xc9')](_0x465e36)[_0xf9cb('0xa3')](loggerCatch('[syncHangupIvr][createHistory]'));hopperUtils['moveContactManagedDialer'](_0x465e36)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x12f')));}if(_0x485d7d&&_0x485d7d[_0xf9cb('0xc0')]!==_0xf9cb('0xc1')&&isNotNull(this[_0xf9cb('0x1e')][_0x485d7d[_0xf9cb('0xbd')]]['dialQueueProject'])){delete this[_0xf9cb('0xbe')][_0x5a9be9[_0xf9cb('0xbf')]];this['updateOriginated'](this[_0xf9cb('0x1e')][_0x485d7d[_0xf9cb('0xbd')]]);this[_0xf9cb('0x1e')][_0x485d7d[_0xf9cb('0xbd')]][_0xf9cb('0xc3')]+=0x1;this['voiceQueues'][_0x485d7d[_0xf9cb('0xbd')]][_0xf9cb('0x12c')]+=0x1;_0x465e36=new Hangup(_0x485d7d,_0x5a9be9);_0x465e36[_0xf9cb('0x6d')]=0x10;_0x465e36[_0xf9cb('0x6e')]=_0xf9cb('0x130');_0x465e36[_0xf9cb('0x112')]=_0xf9cb('0x131');hopperUtils[_0xf9cb('0xc9')](_0x465e36)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x132')));hopperUtils['moveContactManagedDialer'](_0x465e36)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x12f')));}if(_0x485d7d&&_0x485d7d[_0xf9cb('0xc0')]!=='ivr'&&!isNotNull(this[_0xf9cb('0x1e')][_0x485d7d[_0xf9cb('0xbd')]][_0xf9cb('0x133')])){if(_0x5a9be9[_0xf9cb('0x134')]===_0xf9cb('0x135')){delete this['uniqueId'][_0x5a9be9[_0xf9cb('0xbf')]];this['voiceQueues'][_0x485d7d[_0xf9cb('0xbd')]][_0xf9cb('0xc3')]+=0x1;const _0x5acfa9=new AgentComplete(_0x485d7d,_0x5a9be9);_0x5acfa9[_0xf9cb('0xf9')]=this[_0xf9cb('0x1e')][_0x485d7d[_0xf9cb('0xbd')]]['id'];hopperUtils['createHistory'](_0x5acfa9)['catch'](loggerCatch(_0xf9cb('0xca')));hopperUtils[_0xf9cb('0x136')](_0x5acfa9)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x137')));}else{delete this['uniqueId'][_0x5a9be9[_0xf9cb('0xbf')]];this[_0xf9cb('0xf8')](this[_0xf9cb('0x1e')][_0x485d7d['queue']]);this[_0xf9cb('0x1e')][_0x485d7d[_0xf9cb('0xbd')]][_0xf9cb('0x138')]+=0x1;_0x465e36=new Hangup(_0x485d7d,_0x5a9be9);_0x465e36[_0xf9cb('0x6d')]=0xc;_0x465e36[_0xf9cb('0x6e')]=_0x5a9be9[_0xf9cb('0x134')];_0x465e36['membername']=_0xf9cb('0x139');hopperUtils[_0xf9cb('0xc9')](_0x465e36)['catch'](loggerCatch(_0xf9cb('0x132')));hopperUtils[_0xf9cb('0x136')](_0x465e36)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x12f')));}}};Dialer['prototype'][_0xf9cb('0xb')]=function(_0x139ae6){var _0x433b07=this;if(!_0x433b07[_0xf9cb('0x2a')][_0x139ae6['name']]){_0x433b07['queuesSummary'][_0x139ae6[_0xf9cb('0x5e')]]={'running':![]};}else if(_0x433b07[_0xf9cb('0x2a')][_0x139ae6[_0xf9cb('0x5e')]]['running']===!![]){return;}else if(_0x433b07['queuesSummary'][_0x139ae6[_0xf9cb('0x5e')]][_0xf9cb('0x13a')]===![]){_0x433b07[_0xf9cb('0x2a')][_0x139ae6[_0xf9cb('0x5e')]][_0xf9cb('0x13a')]=!![];}var _0x4e2a78=_0x433b07[_0xf9cb('0x1e')][_0x139ae6['name']];var _0x264a73=_0x4e2a78[_0xf9cb('0x67')]!==utils[_0xf9cb('0x68')][_0xf9cb('0x78')];var _0x6f121b=utils['isPreviewCampaign'](_0x4e2a78);_0x4e2a78[_0xf9cb('0x13b')]=utils[_0xf9cb('0x13c')](_0x4e2a78,_0x433b07[_0xf9cb('0x21')]);Promise[_0xf9cb('0x13d')]()[_0xf9cb('0x3d')](function(){if(_0x4e2a78[_0xf9cb('0x13b')]===utils[_0xf9cb('0x68')]['INACTIVE']){if(_0x264a73){clearPredictiveAttributes(_0x4e2a78);_0x139ae6[_0xf9cb('0x26')]=undefined;_0x139ae6['startProgressive']=undefined;}if(_0x4e2a78['statusMessage']===utils[_0xf9cb('0x68')]['INACTIVE']){_0x139ae6[_0xf9cb('0x13e')]=0x0;_0x139ae6[_0xf9cb('0xf0')]=0x0;_0x139ae6[_0xf9cb('0x13f')]=0x0;_0x139ae6[_0xf9cb('0x140')]=0x0;_0x139ae6[_0xf9cb('0x141')]=0x0;}}else if(_0x4e2a78[_0xf9cb('0x13b')]===utils[_0xf9cb('0x68')][_0xf9cb('0x142')]&&!_0x6f121b){return _0x433b07[_0xf9cb('0x92')](_0x4e2a78,!![])['then'](function(){return _0x433b07[_0xf9cb('0x92')](_0x4e2a78,![]);})[_0xf9cb('0x3d')](function(){return _0x433b07[_0xf9cb('0x143')](_0x4e2a78);})[_0xf9cb('0xa3')](function(_0x472b08){loggerSyncQueueSummary['debug']('[syncQueueSummary]',util['inspect'](_0x472b08,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x4e2a78);});}else{clearPredictiveAttributes(_0x4e2a78);}})[_0xf9cb('0x3d')](function(){var _0x1c15d7=_0x139ae6['compareToOutboundQueue'](_0x4e2a78);if(_0x1c15d7||_0x4e2a78['queueSummaryCountersUpdated']){_0x4e2a78[_0xf9cb('0x144')]=![];_0x139ae6[_0xf9cb('0x145')](_0x4e2a78);Object[_0xf9cb('0x146')](_0x4e2a78,_0x139ae6);emitOutboundVoiceQueueSummary(_0x139ae6);}_0x433b07['queuesSummary'][_0x4e2a78[_0xf9cb('0x5e')]][_0xf9cb('0x13a')]=![];})[_0xf9cb('0xa3')](function(_0x3168ec){logger[_0xf9cb('0x61')]('[syncQueueSummary]',util[_0xf9cb('0x63')](_0x3168ec,{'showHidden':![],'depth':null}));_0x433b07[_0xf9cb('0x2a')][_0x4e2a78[_0xf9cb('0x5e')]][_0xf9cb('0x13a')]=![];});};Dialer[_0xf9cb('0x84')][_0xf9cb('0x34')]=_[_0xf9cb('0x147')](function(){var _0x12c2fb=_[_0xf9cb('0x148')](this['voiceQueues'],function(_0xe01bec){return _0xe01bec[_0xf9cb('0x149')];});var _0x39d70f=_[_0xf9cb('0x148')](this[_0xf9cb('0x20')],function(_0x4aa39a){return _0x4aa39a[_0xf9cb('0x14a')]&&_0x4aa39a[_0xf9cb('0x89')]==='reachable';});if(_0x12c2fb[_0xf9cb('0x9a')]>0x0&&_0x39d70f[_0xf9cb('0x9a')]>0x0){return Promise[_0xf9cb('0x13d')]()[_0xf9cb('0x3d')](cmHopper['handlePreviewRecallNotifications'](_['map'](_0x12c2fb,'id'),previewRecallmeReminderInterval,_[_0xf9cb('0x14b')](_0x39d70f,'id')))['then'](function(_0xc8e997){for(var _0x9ffc59=0x0;_0x9ffc59<_0xc8e997[_0xf9cb('0x9a')];_0x9ffc59++){var _0x15f1be=_0xc8e997[_0x9ffc59][_0xf9cb('0x14c')][_0xf9cb('0x5e')];if(_0x15f1be)io['to'](util[_0xf9cb('0x7b')](_0xf9cb('0x14d'),_0x15f1be))['emit'](_0xf9cb('0x14e'),{'hopper':_0xc8e997[_0x9ffc59]});}})[_0xf9cb('0xa3')](function(_0x31c197){logger[_0xf9cb('0x61')]('checkPreviewRecallReminder',_0x31c197);});}},0x3c*0x3e8,{'leading':!![]});Dialer['prototype'][_0xf9cb('0x3b')]=function(){var _0x505287=this;setInterval(function(){_0x505287['clearZombieChannels'](_0x505287[_0xf9cb('0xbe')],_0xf9cb('0x14f'));_0x505287[_0xf9cb('0x150')](_0x505287[_0xf9cb('0xeb')],_0xf9cb('0x151'));},0x32c8);};Dialer['prototype'][_0xf9cb('0x150')]=function(_0x2e40c9,_0x102744){var _0x3bc66f=this;for(var _0x3a899c in _0x2e40c9){if(typeof _0x2e40c9[_0x3a899c]!==_0xf9cb('0xae')){this[_0xf9cb('0x1d')][_0xf9cb('0x1a')](function(){if(!_[_0xf9cb('0xee')](_0x2e40c9[_0x3a899c])){return ami[_0xf9cb('0x9c')]({'action':_0xf9cb('0x89'),'channel':_0x2e40c9[_0x3a899c][_0xf9cb('0xec')]})[_0xf9cb('0xa3')](function(_0x39dc97){if(_0x39dc97[_0xf9cb('0x67')]===_0xf9cb('0x152')){setTimeout(function(){if(_0x2e40c9[_0x3a899c]&&_0x2e40c9[_0x3a899c][_0xf9cb('0xc0')]!==_0xf9cb('0xc1')){_0x3bc66f[_0xf9cb('0xf8')](_0x3bc66f[_0xf9cb('0x1e')][_0x2e40c9[_0x3a899c][_0xf9cb('0xbd')]]);logger['error'](_0xf9cb('0x153'),_0x102744,_0x3a899c,_0x2e40c9[_0x3a899c][_0xf9cb('0xbd')]);delete _0x2e40c9[_0x3a899c];}if(_0x2e40c9[_0x3a899c]&&_0x2e40c9[_0x3a899c][_0xf9cb('0xc0')]===_0xf9cb('0xc1')){_0x3bc66f[_0xf9cb('0xf8')](_0x3bc66f[_0xf9cb('0x1f')][_0x2e40c9[_0x3a899c]['queue']]);logger['error'](_0xf9cb('0x154'),_0x102744,_0x3a899c,_0x2e40c9[_0x3a899c]['queue']);delete _0x2e40c9[_0x3a899c];}},0x2328);}});}});}}};Dialer[_0xf9cb('0x84')][_0xf9cb('0x155')]=function(_0x4cfe5d){return Promise[_0xf9cb('0x13d')]()[_0xf9cb('0x3d')](voiceQueueRt[_0xf9cb('0x155')](_0x4cfe5d))['catch'](loggerCatch(_0xf9cb('0x156')));};Dialer[_0xf9cb('0x84')][_0xf9cb('0xf8')]=function(_0x598d47){if(!_['isUndefined'](_0x598d47)&&_0x598d47!==null){if(typeof _0x598d47[_0xf9cb('0x7e')]!==_0xf9cb('0xae')){if(_0x598d47[_0xf9cb('0x7e')]>0x0){_0x598d47[_0xf9cb('0x7e')]-=0x1;}else{logger[_0xf9cb('0x61')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xf9cb('0x61')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0xf9cb('0x157')]=function(_0x441f0f,_0xaa5e78){var _0x5d39b2=this;return function(_0x3b9a86){_0x5d39b2[_0xf9cb('0xf8')](_0xaa5e78);logger['error'](_0x441f0f,util[_0xf9cb('0x63')](_0x3b9a86,{'showHidden':![],'depth':null}));};};Dialer[_0xf9cb('0x84')]['emptyContact']=function(_0x3450c0,_0x8608bd,_0x298e40){var _0x43ad00={'state':0x19,'statedesc':_0xf9cb('0x158')};this['updateOriginated'](_0x8608bd);this[_0xf9cb('0x116')](_[_0xf9cb('0xf2')](_0x43ad00,_[_0xf9cb('0x72')](_0x298e40,['ContactId','ListId',_0xf9cb('0x159'),_0xf9cb('0xda'),_0xf9cb('0xf9')])),'[emptyContact][createHistory]','[emptyContact]');logger['error'](_0x3450c0);};Dialer[_0xf9cb('0x84')]['saveInDb']=function(_0x16ea49,_0x247cfa,_0x45b160){hopperUtils[_0xf9cb('0xc9')](_0x16ea49)['catch'](loggerCatch(_0x247cfa));hopperUtils['moveContactManagedDialer'](_0x16ea49)['catch'](loggerCatch(_0x45b160));};Dialer['prototype'][_0xf9cb('0xd4')]=function(_0x2671d5,_0x2194ec){hopperUtils[_0xf9cb('0xc9')](_0x2671d5)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0xca')));if(_0x2194ec==0x0){hopperUtils['moveContactManagedDialer'](_0x2671d5)[_0xf9cb('0xa3')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));}};Dialer[_0xf9cb('0x84')][_0xf9cb('0x15a')]=function(_0x823a1b){return Promise[_0xf9cb('0x13d')]()[_0xf9cb('0x3d')](cmHopper['handlePreviewRecallNotifications'](_0x823a1b['id'],previewRecallmeReminderInterval))['then'](function(_0x737ac5){for(var _0x457c04=0x0;_0x457c04<_0x737ac5[_0xf9cb('0x9a')];_0x457c04++){var _0x8693fb=_0x737ac5[_0x457c04]['Agent'][_0xf9cb('0x5e')];if(_0x8693fb)io['to'](util[_0xf9cb('0x7b')]('user:%s',_0x8693fb))[_0xf9cb('0x3f')](_0xf9cb('0x14e'),{'hopper':_0x737ac5[_0x457c04]});}})[_0xf9cb('0xa3')](function(){});};Dialer[_0xf9cb('0x84')][_0xf9cb('0xb1')]=function(_0x45de16){var _0x2fc4f2=this;return function(){_0x2fc4f2[_0xf9cb('0x15b')](_0x45de16);};};Dialer[_0xf9cb('0x84')][_0xf9cb('0x15c')]=function(_0x20605c,_0x35978b){var _0x23ba82=this;var _0x2c578d=uuid['v4']();this[_0xf9cb('0xeb')][_0x2c578d]=new Action(_0x20605c,_0x35978b,_0x2c578d);return new Promise(function(_0x281d8f,_0x262c16){if(_['isUndefined'](_0x20605c)&&typeof _0x20605c!==_0xf9cb('0x15d')){return _0x262c16(msgResponse(_0xf9cb('0x15e'),_0xf9cb('0x95'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x35978b[_0xf9cb('0x15f')])||_0x35978b[_0xf9cb('0x15f')]===null){return _0x262c16(msgResponse(_0xf9cb('0x15e'),'Failure',_0xf9cb('0x160')));}var _0x37f790={'XMD-CALLERID':_0x23ba82[_0xf9cb('0xeb')][_0x2c578d][_0xf9cb('0x161')](),'XMD-AGI':_0x20605c[_0xf9cb('0x133')]?util[_0xf9cb('0x7b')](_0xf9cb('0x162'),ipAgi,_0x20605c[_0xf9cb('0x133')]):_0xf9cb('0x163'),'XMD-AGIAFTER':_0x20605c['dialQueueProject2']?util[_0xf9cb('0x7b')](_0xf9cb('0x162'),ipAgi,_0x20605c['dialQueueProject2']):_0xf9cb('0x163'),'XMD-QUEUE':utils['isOutboundQueue'](_0x20605c)?util['format'](_0xf9cb('0x164'),_0x20605c['name'],_0x20605c[_0xf9cb('0x165')]||'',_0x20605c[_0xf9cb('0xc8')]?'c':'',_0x20605c['dialQueueTimeout']||0x3):'NONE','XMD-CONTACTID':_0x35978b[_0xf9cb('0xd8')],'XMD-CDRTYPE':_0xf9cb('0x7'),'CALLERID(all)':_0x23ba82[_0xf9cb('0xeb')][_0x2c578d][_0xf9cb('0x161')](),'XMD-AMD':_0x20605c[_0xf9cb('0x118')]?'ACTIVE':'NONE','XMD-DESTINATION':'xcally-motion-dialer'};if(_0x20605c[_0xf9cb('0x118')]){_0x37f790['XMD-AMDINITIALSILENCE']=_0x20605c[_0xf9cb('0x166')]||0x9c4;_0x37f790[_0xf9cb('0x167')]=_0x20605c['dialAMDGreeting']||0x5dc;_0x37f790[_0xf9cb('0x168')]=_0x20605c['dialAMDAfterGreetingSilence']||0x320;_0x37f790[_0xf9cb('0x169')]=_0x20605c[_0xf9cb('0x16a')]||0x1388;_0x37f790['XMD-AMDMINWORDLENGTH']=_0x20605c[_0xf9cb('0x16b')]||0x64;_0x37f790[_0xf9cb('0x16c')]=_0x20605c[_0xf9cb('0x16d')]||0x32;_0x37f790[_0xf9cb('0x16e')]=_0x20605c[_0xf9cb('0x16f')]||0x3;_0x37f790['XMD-AMDSILENCETHRESHOLD']=_0x20605c['dialAMDSilenceThreshold']||0x100;_0x37f790[_0xf9cb('0x170')]=_0x20605c[_0xf9cb('0x171')]||0x1388;}if(utils[_0xf9cb('0x172')](_0x20605c)){_0x37f790[_0xf9cb('0x173')]=_0x35978b[_0xf9cb('0xda')];}else{_0x37f790['XMD-CAMPAIGNID']=_0x35978b[_0xf9cb('0xf9')];}var _0x4b8514=utils['setXMDContactVariables'](_0x35978b[_0xf9cb('0x174')]);Object[_0xf9cb('0x146')](_0x37f790,_0x4b8514);var _0x3af312=_0x23ba82[_0xf9cb('0x85')](_0x20605c[_0xf9cb('0x8c')])?utils[_0xf9cb('0x175')](_0x20605c[_0xf9cb('0x8c')]['callerid'],_0x20605c[_0xf9cb('0x176')],_0x20605c[_0xf9cb('0x177')]>0x0?utils[_0xf9cb('0x178')](_0x20605c[_0xf9cb('0x179')],_0x20605c['dialRandomLastDigitCallerIdNumber']):_0x20605c[_0xf9cb('0x179')]):utils[_0xf9cb('0x175')](_[_0xf9cb('0xee')](_0x20605c[_0xf9cb('0x8d')])?_0x20605c['Trunk'][_0xf9cb('0x17a')]:_0x20605c[_0xf9cb('0x8d')]['callerid'],_0x20605c[_0xf9cb('0x176')],_0x20605c[_0xf9cb('0x177')]>0x0?utils[_0xf9cb('0x178')](_0x20605c[_0xf9cb('0x179')],_0x20605c['dialRandomLastDigitCallerIdNumber']):_0x20605c[_0xf9cb('0x179')]);if(_0x3af312){_0x37f790[_0xf9cb('0x17b')]=_0x23ba82[_0xf9cb('0xeb')][_0x2c578d][_0xf9cb('0x17c')]=utils[_0xf9cb('0x17d')](_0x3af312);_0x37f790[_0xf9cb('0x17e')]=_0x35978b['phone'];}_0x20605c[_0xf9cb('0x17f')]=_0x37f790;return ami[_0xf9cb('0x9c')]({'actionid':_0x2c578d,'action':'originate','channel':_0x23ba82[_0xf9cb('0x85')](_0x20605c[_0xf9cb('0x8c')])?util[_0xf9cb('0x7b')](_0xf9cb('0x180'),_0x20605c[_0xf9cb('0x8c')][_0xf9cb('0x5e')],isNotNull(_0x20605c[_0xf9cb('0x181')])?_0x20605c[_0xf9cb('0x181')][_0xf9cb('0x182')]()||'':'',_0x20605c[_0xf9cb('0x183')]>0x0?_0x35978b['phone']['substring'](_0x20605c['dialCutDigit']):_0x35978b[_0xf9cb('0x15f')]):util['format'](_0xf9cb('0x180'),_['isNil'](_0x20605c[_0xf9cb('0x8d')])?_0x20605c[_0xf9cb('0x8c')][_0xf9cb('0x5e')]:_0x20605c[_0xf9cb('0x8d')]['name'],isNotNull(_0x20605c[_0xf9cb('0x181')])?_0x20605c[_0xf9cb('0x181')]['trim']()||'':'',_0x20605c[_0xf9cb('0x183')]>0x0?_0x35978b[_0xf9cb('0x15f')]['substring'](_0x20605c['dialCutDigit']):_0x35978b[_0xf9cb('0x15f')]),'callerid':_0x3af312,'Exten':_0xf9cb('0x10f'),'Context':_0xf9cb('0x184'),'Priority':'1','variable':_0x37f790,'timeout':(_0x20605c[_0xf9cb('0x185')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2c578d})[_0xf9cb('0x3d')](function(_0xa1f449){return _0x281d8f(_0xa1f449);})[_0xf9cb('0xa3')](function(_0x57c954){_0x20605c[_0xf9cb('0x186')]+=0x1;var _0x4cd232=new History(_0x23ba82[_0xf9cb('0xeb')][_0x2c578d]);logger[_0xf9cb('0x61')](util[_0xf9cb('0x7b')](_0xf9cb('0x187'),JSON[_0xf9cb('0x71')](_0x57c954)));_0x4cd232[_0xf9cb('0x6d')]=0xe;_0x4cd232['statedesc']=_0xf9cb('0x188');_0x4cd232[_0xf9cb('0xdc')]=moment()['format'](_0xf9cb('0xc2'));_0x4cd232[_0xf9cb('0x6f')]=_0x4cd232[_0xf9cb('0xdc')];hopperUtils['createHistory'](_0x4cd232)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x189')));_0x23ba82[_0xf9cb('0x136')](_0x4cd232)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x189')))[_0xf9cb('0x1c')](function(){delete _0x23ba82['actions'][_0x2c578d];return _0x262c16(msgResponse(_0xf9cb('0x15e'),_0xf9cb('0x83'),'originate\x20action\x20Error'));});});});};Dialer[_0xf9cb('0x84')][_0xf9cb('0x18a')]=function(_0x543780,_0x5cf0d5,_0x1d1643){var _0x26e66b=new History(_0x5cf0d5);if(_0x26e66b[_0xf9cb('0x11d')]+_0x26e66b['countcongestionretry']+_0x26e66b[_0xf9cb('0x11f')]+_0x26e66b['countnosuchnumberretry']+_0x26e66b[_0xf9cb('0xce')]+_0x26e66b[_0xf9cb('0xe3')]+_0x26e66b[_0xf9cb('0x11a')]+_0x26e66b[_0xf9cb('0x121')]>=_0x1d1643[_0xf9cb('0x122')]-0x1){return!![];}switch(_0x543780){case 0x3:if(_0x26e66b[_0xf9cb('0x11f')]>=_0x1d1643[_0xf9cb('0x18b')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countnoanswerretry':_0x26e66b[_0xf9cb('0x11f')]+=0x1,'scheduledat':moment()[_0xf9cb('0xd6')](_0x1d1643['dialNoAnswerRetryFrequency'],_0xf9cb('0xd7'))[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b[_0xf9cb('0xd8')],'ListId':_0x26e66b['ListId'],'VoiceQueueId':_0x26e66b[_0xf9cb('0xda')]||undefined,'CampaignId':_0x26e66b['CampaignId']||undefined})['catch'](loggerCatch(_0xf9cb('0x18c')));break;case 0x5:if(_0x26e66b[_0xf9cb('0x11d')]>=_0x1d1643[_0xf9cb('0x18d')]-0x1){return!![];}hopperUtils[_0xf9cb('0xd5')]({'active':![],'countbusyretry':_0x26e66b[_0xf9cb('0x11d')]+=0x1,'scheduledat':moment()[_0xf9cb('0xd6')](_0x1d1643[_0xf9cb('0x18e')],'minutes')[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b[_0xf9cb('0xd8')],'ListId':_0x26e66b['ListId'],'VoiceQueueId':_0x26e66b[_0xf9cb('0xda')]||undefined,'CampaignId':_0x26e66b[_0xf9cb('0xf9')]||undefined})[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x18f')));break;case 0x8:if(_0x26e66b[_0xf9cb('0x11e')]>=_0x1d1643[_0xf9cb('0x190')]-0x1){return!![];}hopperUtils[_0xf9cb('0xd5')]({'active':![],'countcongestionretry':_0x26e66b[_0xf9cb('0x11e')]+=0x1,'scheduledat':moment()[_0xf9cb('0xd6')](_0x1d1643[_0xf9cb('0x191')],'minutes')[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b[_0xf9cb('0xd8')],'ListId':_0x26e66b[_0xf9cb('0xd9')],'VoiceQueueId':_0x26e66b['VoiceQueueId']||undefined,'CampaignId':_0x26e66b['CampaignId']||undefined})['catch'](loggerCatch(_0xf9cb('0x192')));break;case 0x0:if(_0x26e66b[_0xf9cb('0x120')]>=_0x1d1643['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{hopperUtils[_0xf9cb('0xd5')]({'active':![],'countnosuchnumberretry':_0x26e66b[_0xf9cb('0x120')]+=0x1,'scheduledat':moment()[_0xf9cb('0xd6')](_0x1d1643['dialNoSuchNumberRetryFrequency'],'minutes')[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b['ContactId'],'ListId':_0x26e66b[_0xf9cb('0xd9')],'VoiceQueueId':_0x26e66b['VoiceQueueId']||undefined,'CampaignId':_0x26e66b['CampaignId']||undefined})[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x193')));}break;case 0xa:if(_0x26e66b[_0xf9cb('0xce')]>=_0x1d1643[_0xf9cb('0xd3')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countdropretry':_0x26e66b[_0xf9cb('0xce')]+=0x1,'scheduledat':moment()[_0xf9cb('0xd6')](_0x1d1643[_0xf9cb('0xd0')],'minutes')[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b['ContactId'],'ListId':_0x26e66b[_0xf9cb('0xd9')],'VoiceQueueId':_0x26e66b[_0xf9cb('0xda')]||undefined,'CampaignId':_0x26e66b[_0xf9cb('0xf9')]||undefined})['catch'](loggerCatch(_0xf9cb('0xdb')));break;case 0xb:if(_0x26e66b['countabandonedretry']>=_0x1d1643[_0xf9cb('0xe6')]-0x1){return!![];}hopperUtils[_0xf9cb('0xd5')]({'active':![],'countabandonedretry':_0x26e66b[_0xf9cb('0xe3')]+=0x1,'scheduledat':moment()[_0xf9cb('0xd6')](_0x1d1643['dialAbandonedRetryFrequency'],'minutes')[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b['ContactId'],'ListId':_0x26e66b[_0xf9cb('0xd9')],'VoiceQueueId':_0x26e66b[_0xf9cb('0xda')]||undefined,'CampaignId':_0x26e66b[_0xf9cb('0xf9')]||undefined})[_0xf9cb('0xa3')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x26e66b[_0xf9cb('0x11a')]>=_0x1d1643[_0xf9cb('0x125')]-0x1){return!![];}hopperUtils[_0xf9cb('0xd5')]({'active':![],'countmachineretry':_0x26e66b[_0xf9cb('0x11a')]+=0x1,'scheduledat':moment()['add'](_0x1d1643[_0xf9cb('0x128')],_0xf9cb('0xd7'))[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b[_0xf9cb('0xd8')],'ListId':_0x26e66b[_0xf9cb('0xd9')],'VoiceQueueId':_0x26e66b[_0xf9cb('0xda')]||undefined,'CampaignId':_0x26e66b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x26e66b[_0xf9cb('0x121')]>=_0x1d1643[_0xf9cb('0x194')]-0x1){return!![];}hopperUtils[_0xf9cb('0xd5')]({'active':![],'countagentrejectretry':_0x26e66b['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xf9cb('0xd6')](_0x1d1643[_0xf9cb('0x195')],_0xf9cb('0xd7'))[_0xf9cb('0x7b')](_0xf9cb('0xc2')),'ContactId':_0x26e66b[_0xf9cb('0xd8')],'ListId':_0x26e66b[_0xf9cb('0xd9')],'VoiceQueueId':_0x26e66b[_0xf9cb('0xda')]||undefined,'CampaignId':_0x26e66b[_0xf9cb('0xf9')]||undefined})[_0xf9cb('0xa3')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0xf9cb('0x84')]['callProgressDetecting']=function(_0x458c3d,_0xa5e4cb,_0x3e7f9a){var _0x45a54d=this;var _0x297c65=new History(_0x458c3d);var _0x470b84=![];var _0x2488f1;var _0x14d6ef;return new Promise(function(_0x203fd3,_0x1f09c1){if(_[_0xf9cb('0x3e')](_0xa5e4cb)&&typeof _0xa5e4cb!==_0xf9cb('0x15d')){return _0x1f09c1(msgResponse(_0xf9cb('0x196'),_0xf9cb('0x95'),_0xf9cb('0x197')));}if(_['isUndefined'](_0x3e7f9a)&&typeof _0x3e7f9a!=='object'){return _0x1f09c1(msgResponse(_0xf9cb('0x196'),_0xf9cb('0x95'),_0xf9cb('0x198')));}hopperUtils['verifyAdditionalPhones'](_0x297c65,_0x3e7f9a[_0xf9cb('0xc4')],_0xa5e4cb)[_0xf9cb('0x3d')](function(_0x4806ec){if(_0x4806ec['additional']==0x1)_0x470b84=!![];switch(_0x3e7f9a['reason']){case'0':_0xa5e4cb[_0xf9cb('0x199')]+=0x1;_0x297c65[_0xf9cb('0x6d')]=0x0;_0x297c65[_0xf9cb('0x6e')]=_0xf9cb('0x19a');_0x297c65[_0xf9cb('0x120')]+=0x1;_0x297c65[_0xf9cb('0xcf')]+=0x1;ami[_0xf9cb('0x3f')](_0xf9cb('0x19b'),ut['buildObj'](_0x458c3d,'nosuchnumber'));_0x2488f1=_0xa5e4cb['dialNoSuchNumberRetryFrequency'];_0x14d6ef=_0xa5e4cb['callAdditionalPhoneAfterMin'];hopperUtils[_0xf9cb('0xc9')](_0x297c65)[_0xf9cb('0xa3')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x45a54d['checkRetriveMax'](0x0,_0x458c3d,_0xa5e4cb)&&!_0x470b84){if(_0x297c65['countnosuchnumberretry']>=_0xa5e4cb[_0xf9cb('0x19c')]){_0x45a54d['createStateFinal'](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x19d'));}else{_0x45a54d[_0xf9cb('0x123')](_0x297c65,_0x203fd3,_0x1f09c1,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0xa5e4cb[_0xf9cb('0x19e')]+=0x1;_0x297c65[_0xf9cb('0x6d')]=0x3;_0x297c65[_0xf9cb('0x6e')]=_0xf9cb('0x19f');_0x297c65[_0xf9cb('0x11f')]+=0x1;_0x297c65[_0xf9cb('0xcf')]+=0x1;var _0x3f1899=ut[_0xf9cb('0x1a0')](_0x458c3d,_0xa5e4cb);ami[_0xf9cb('0x3f')]('custom:agentnoanswer',_0x3f1899);_0x2488f1=_0xa5e4cb['dialNoAnswerRetryFrequency'];_0x14d6ef=_0xa5e4cb['callAdditionalPhoneAfterMin'];hopperUtils[_0xf9cb('0xc9')](_0x297c65)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x1a1')));if(_0x45a54d[_0xf9cb('0x18a')](0x3,_0x458c3d,_0xa5e4cb)&&!_0x470b84){if(_0x297c65[_0xf9cb('0x11f')]>=_0xa5e4cb[_0xf9cb('0x18b')]){_0x45a54d[_0xf9cb('0x126')](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1a2'));}else{_0x45a54d['stateGlobal'](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1a2'));}}break;case'5':_0xa5e4cb['outboundBusyCallsDay']+=0x1;_0x297c65[_0xf9cb('0x6d')]=0x5;_0x297c65[_0xf9cb('0x6e')]=_0xf9cb('0x1a3');_0x297c65['countbusyretry']+=0x1;_0x297c65['countglobal']+=0x1;ami[_0xf9cb('0x3f')](_0xf9cb('0x1a4'),ut[_0xf9cb('0x115')](_0x458c3d,_0xf9cb('0x1a5')));_0x2488f1=_0xa5e4cb[_0xf9cb('0x18e')];_0x14d6ef=_0xa5e4cb[_0xf9cb('0xe4')];hopperUtils['createHistory'](_0x297c65)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x1a6')));if(_0x45a54d[_0xf9cb('0x18a')](0x5,_0x458c3d,_0xa5e4cb)&&!_0x470b84){if(_0x297c65['countbusyretry']>=_0xa5e4cb['dialBusyMaxRetry']){_0x45a54d[_0xf9cb('0x126')](_0x297c65,_0x203fd3,_0x1f09c1,'reason\x205\x20busy');}else{_0x45a54d[_0xf9cb('0x123')](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1a7'));}}break;case'8':_0xa5e4cb[_0xf9cb('0x1a8')]+=0x1;_0x297c65[_0xf9cb('0x6d')]=0x8;_0x297c65[_0xf9cb('0x6e')]=_0xf9cb('0x1a9');_0x297c65[_0xf9cb('0x11e')]+=0x1;_0x297c65[_0xf9cb('0xcf')]+=0x1;_0x2488f1=_0xa5e4cb[_0xf9cb('0x191')];_0x14d6ef=_0xa5e4cb['callAdditionalPhoneAfterMin'];ami[_0xf9cb('0x3f')]('custom:agentcongestion',ut[_0xf9cb('0x115')](_0x458c3d,_0xf9cb('0x1aa')));hopperUtils['createHistory'](_0x297c65)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x1ab')));if(_0x45a54d[_0xf9cb('0x18a')](0x8,_0x458c3d,_0xa5e4cb)&&!_0x470b84){if(_0x297c65[_0xf9cb('0x11e')]>=_0xa5e4cb[_0xf9cb('0x190')]){_0x45a54d[_0xf9cb('0x126')](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1ac'));}else{_0x45a54d['stateGlobal'](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1ac'));}}break;case'11':_0xa5e4cb[_0xf9cb('0x1ad')]+=0x1;_0x297c65[_0xf9cb('0x6d')]=0xb;_0x297c65['statedesc']=_0xf9cb('0xe8');_0x297c65[_0xf9cb('0xe3')]+=0x1;_0x297c65['countglobal']+=0x1;_0x2488f1=_0xa5e4cb['dialAbandonedRetryFrequency'];_0x14d6ef=_0xa5e4cb[_0xf9cb('0xe4')];hopperUtils[_0xf9cb('0xc9')](_0x297c65)[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0xe9')));if(_0x45a54d[_0xf9cb('0x18a')](0xb,_0x458c3d,_0xa5e4cb)&&!_0x470b84){if(_0x297c65['countabandonedretry']>=_0xa5e4cb['dialAbandonedMaxRetry']){_0x45a54d[_0xf9cb('0x126')](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1ae'));}else{_0x45a54d['stateGlobal'](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1ae'));}}break;case'20':_0xa5e4cb[_0xf9cb('0x1af')]+=0x1;_0x297c65[_0xf9cb('0x6d')]=0x14;_0x297c65['statedesc']=_0xf9cb('0x1b0');_0x297c65[_0xf9cb('0x121')]+=0x1;_0x297c65[_0xf9cb('0xcf')]+=0x1;_0x2488f1=_0xa5e4cb[_0xf9cb('0x195')];_0x14d6ef=_0xa5e4cb[_0xf9cb('0xe4')];ami[_0xf9cb('0x3f')](_0xf9cb('0x1b1'),ut[_0xf9cb('0x115')](_0x458c3d,_0xf9cb('0x1b2')));hopperUtils[_0xf9cb('0xc9')](_0x297c65)[_0xf9cb('0xa3')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x45a54d[_0xf9cb('0x18a')](0x14,_0x458c3d,_0xa5e4cb)&&!_0x470b84){if(_0x297c65[_0xf9cb('0x121')]>=_0xa5e4cb[_0xf9cb('0x194')]){_0x45a54d[_0xf9cb('0x126')](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1b3'));}else{_0x45a54d[_0xf9cb('0x123')](_0x297c65,_0x203fd3,_0x1f09c1,_0xf9cb('0x1b3'));}}break;default:_0xa5e4cb['outboundUnknownCallsDay']+=0x1;_0x297c65[_0xf9cb('0x6d')]=0xc;_0x297c65[_0xf9cb('0x6e')]=_0x3e7f9a['reason'];_0x2488f1=_0xa5e4cb[_0xf9cb('0x195')];_0x14d6ef=_0xa5e4cb[_0xf9cb('0xe4')];hopperUtils[_0xf9cb('0xc9')](_0x297c65)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x45a54d[_0xf9cb('0x18a')](_0x3e7f9a['reason'],_0x458c3d,_0xa5e4cb)&&!_0x470b84){if(_0x297c65[_0xf9cb('0x11d')]+_0x297c65[_0xf9cb('0x11e')]+_0x297c65['countnoanswerretry']+_0x297c65[_0xf9cb('0x120')]+_0x297c65[_0xf9cb('0xce')]+_0x297c65[_0xf9cb('0xe3')]+_0x297c65[_0xf9cb('0x11a')]+_0x297c65[_0xf9cb('0x121')]>=_0xa5e4cb[_0xf9cb('0x122')]){_0x45a54d[_0xf9cb('0x123')](_0x297c65,_0x203fd3,_0x1f09c1,_0x3e7f9a[_0xf9cb('0xc4')]);}else{_0x45a54d[_0xf9cb('0x126')](_0x297c65,_0x203fd3,_0x1f09c1,_0x3e7f9a[_0xf9cb('0xc4')]);}}}})[_0xf9cb('0x3d')](function(){if(_0x470b84){hopperUtils['swapAdditionalPhones'](_0x297c65,_0x2488f1,_0x14d6ef)['then'](function(){return _0x203fd3(0x1);});}});});};Dialer['prototype'][_0xf9cb('0x123')]=function(_0x5d6b40,_0x59848b,_0x3c143c,_0x4e99fd){var _0xc69a36=new Final(_0x5d6b40);_0xc69a36[_0xf9cb('0x6d')]=0xf;_0xc69a36[_0xf9cb('0x6e')]='Global';this[_0xf9cb('0x126')](_0xc69a36,_0x59848b,_0x3c143c,_0x4e99fd);};Dialer[_0xf9cb('0x84')]['createStateFinal']=function(_0x185a1f,_0x38375f,_0x595ef1,_0x267472){hopperUtils[_0xf9cb('0x136')](_0x185a1f)[_0xf9cb('0x3d')](function(){return _0x38375f(msgResponse('[callProgressDetecting]','Success',_0x267472));})[_0xf9cb('0xa3')](function(){return _0x595ef1(msgResponse(_0xf9cb('0x1b4'),_0xf9cb('0x95'),_0xf9cb('0x1b5')));});};Dialer['prototype'][_0xf9cb('0x9')]=function(_0xd691bd){var _0x4cba01=_0xd691bd['dialPredictiveOptimizationPercentage']/0x64;var _0x4718b7=_0xd691bd['outboundDropCallsDayTimeout']/(_0xd691bd[_0xf9cb('0x1b6')]+_0xd691bd[_0xf9cb('0xc3')]);var _0x588bdd=Math[_0xf9cb('0x1b7')](_0xd691bd[_0xf9cb('0x1b8')]*(_0xd691bd['predictiveIntervalMaxThreshold']/0x64));var _0x3811ca=Math['round'](_0xd691bd[_0xf9cb('0x1b8')]*(_0xd691bd[_0xf9cb('0x1b9')]/0x64));var _0x145c6d=_0xd691bd[_0xf9cb('0x13e')]+_0xd691bd[_0xf9cb('0x140')];var _0x4b95e5=Math[_0xf9cb('0x1ba')](_0xd691bd['erlangCalls']*_0xd691bd[_0xf9cb('0x58')]*_0xd691bd[_0xf9cb('0x1bb')]*_0xd691bd[_0xf9cb('0x1bc')]);if(_['isUndefined'](_0xd691bd[_0xf9cb('0x27')])){if(!_[_0xf9cb('0x3e')](_0xd691bd[_0xf9cb('0x26')])){_0xd691bd[_0xf9cb('0x26')]=undefined;loggerPredictive[_0xf9cb('0x61')](_0xf9cb('0x1bd'),_0xf9cb('0x1be'));}if(!_[_0xf9cb('0x3e')](_0xd691bd[_0xf9cb('0x5f')])){loggerPredictive['error'](_0xf9cb('0x1bd'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0xd691bd[_0xf9cb('0x5f')]);_0xd691bd['handlePredictive']=undefined;}_0xd691bd[_0xf9cb('0x27')]=moment()['format'](_0xf9cb('0xc2'));loggerPredictive[_0xf9cb('0x44')](_0xd691bd[_0xf9cb('0x5e')],_0xf9cb('0x1bf'),_0xd691bd['startProgressive']);this[_0xf9cb('0xb4')](_0xd691bd,0x1);}else if(ifInterval(_0xd691bd[_0xf9cb('0x1c0')],_0xd691bd['startProgressive'])){this[_0xf9cb('0xb4')](_0xd691bd,0x1);loggerPredictiveCalls['info'](_0xf9cb('0x1c1'),_0xd691bd['startProgressive'],_0xd691bd[_0xf9cb('0x5e')]);_0xd691bd['erlangCalls']=0x0;_0xd691bd[_0xf9cb('0x1c2')]=0x0;}else if(_0x4cba01<_0x4718b7&&_0xd691bd[_0xf9cb('0x1c3')]===_0xf9cb('0x1c4')){clearPredictiveAttributes(_0xd691bd);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x1c5'),_0xf9cb('0x1c6'),_0x4718b7,'startProgressive',_0xd691bd[_0xf9cb('0x5e')]);}else if(_0x4b95e5<_0xd691bd[_0xf9cb('0x1c2')]&&_0xd691bd['dialPredictiveOptimization']===_0xf9cb('0x1c4')){clearPredictiveAttributes(_0xd691bd);loggerPredictive[_0xf9cb('0x44')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0xf9cb('0x1c7'),_0x4b95e5,_0xf9cb('0x1c8'),_0xd691bd[_0xf9cb('0x1c2')],_0xf9cb('0x27'),_0xd691bd['name']);}else if(!ifInterval(_0xd691bd[_0xf9cb('0x1c0')],_0xd691bd['startProgressive'])&&_['isUndefined'](_0xd691bd[_0xf9cb('0x26')])&&!_['isUndefined'](_0xd691bd[_0xf9cb('0x27')])){_0xd691bd[_0xf9cb('0x26')]=moment()[_0xf9cb('0x7b')](_0xf9cb('0xc2'));loggerPredictive['info'](_0xd691bd[_0xf9cb('0x5e')],'started\x20in\x20predictive\x20at',_0xd691bd[_0xf9cb('0x26')]);hopperUtils[_0xf9cb('0x1c9')](_0xd691bd[_0xf9cb('0x1c0')])[_0xf9cb('0x3d')](this['getDataPredictive'](_0xd691bd))[_0xf9cb('0x3d')](mergeDataErlangB(_0xd691bd))[_0xf9cb('0x3d')](this[_0xf9cb('0x1ca')](_0xd691bd))[_0xf9cb('0xa3')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0xd691bd));}else if(!ifInterval(_0xd691bd[_0xf9cb('0x1c0')],_0xd691bd['startPredictive'])){_0xd691bd[_0xf9cb('0x1c2')]=0x0;_0xd691bd[_0xf9cb('0x26')]=moment()[_0xf9cb('0x7b')](_0xf9cb('0xc2'));loggerPredictive[_0xf9cb('0x44')](_0xd691bd[_0xf9cb('0x5e')],_0xf9cb('0x1cb'),_0xd691bd[_0xf9cb('0x26')]);clearInterval(_0xd691bd[_0xf9cb('0x5f')]);_0xd691bd[_0xf9cb('0x5f')]=undefined;hopperUtils[_0xf9cb('0x1c9')](_0xd691bd[_0xf9cb('0x1c0')])['then'](this[_0xf9cb('0x1cc')](_0xd691bd))[_0xf9cb('0x3d')](mergeDataErlangB(_0xd691bd))['then'](this[_0xf9cb('0x1ca')](_0xd691bd))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0xd691bd));}else if(_0xd691bd[_0xf9cb('0x1b8')]&&_0x145c6d<_0xd691bd[_0xf9cb('0x1b8')]-_0x3811ca){clearPredictiveAttributes(_0xd691bd);loggerPredictive[_0xf9cb('0x44')](_0xd691bd['name'],_0xf9cb('0x1cd'),_0x145c6d,_0xf9cb('0x1ce'),_0xd691bd[_0xf9cb('0x1b8')],'-',_0x3811ca,'=',_0xd691bd['predictiveIntervalAvailable']-_0x3811ca,')');}else if(_0xd691bd['predictiveIntervalAvailable']&&_0x145c6d>_0xd691bd[_0xf9cb('0x1b8')]+_0x588bdd){clearPredictiveAttributes(_0xd691bd);loggerPredictive[_0xf9cb('0x44')](_0xd691bd[_0xf9cb('0x5e')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x145c6d,')\x20are\x20more\x20than\x20threshold\x20(',_0xd691bd[_0xf9cb('0x1b8')],'+',_0x588bdd,'=',_0xd691bd[_0xf9cb('0x1b8')]+_0x588bdd,')');}};Dialer['prototype'][_0xf9cb('0x1cc')]=function(_0xf3eb6e){var _0x2b3bec=this;return function(_0x490ecd){return new Promise(function(_0x950ff8,_0x2bc8ce){_[_0xf9cb('0xf2')](_0xf3eb6e,_0x490ecd[0x0]);if(checkGetDataPredictive(_0x490ecd[0x0])){var _0x47d6c0=_0xf3eb6e[_0xf9cb('0x1b8')]=_0xf3eb6e[_0xf9cb('0x140')]+_0xf3eb6e[_0xf9cb('0x13e')];var _0x42523f=_0xf3eb6e[_0xf9cb('0x1c0')]*0x3c;var _0x34d8ca=_0x490ecd[0x0][_0xf9cb('0x4e')]+_0x490ecd[0x0][_0xf9cb('0x4c')];var _0x37fea4=(_0x490ecd[0x0]['predictiveIntervalAnsweredCalls']+_0x490ecd[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x490ecd[0x0][_0xf9cb('0x4a')])/_0x490ecd[0x0][_0xf9cb('0x50')];_0xf3eb6e['predictiveIntervalHitRate']=_0x37fea4>0x0?_0x37fea4:0x1;switch(_0xf3eb6e[_0xf9cb('0x1c3')]){case'dropRate':var _0x4346c2=_0xf3eb6e[_0xf9cb('0x1cf')]/0x64;return _0x2b3bec[_0xf9cb('0x1d0')](_0x47d6c0,_0x42523f,_0x34d8ca,_0x37fea4,_0x4346c2)[_0xf9cb('0x3d')](function(_0x11c6eb){return _0x950ff8(_0x11c6eb);});case _0xf9cb('0x1d1'):var _0xc56fe5=_0xf3eb6e[_0xf9cb('0x1cf')]/0x64;return _0x2b3bec[_0xf9cb('0x1d2')](_0x47d6c0,_0x42523f,_0x34d8ca,_0x37fea4,_0xc56fe5)[_0xf9cb('0x3d')](function(_0x203575){return _0x950ff8(_0x203575);});default:return _0x2bc8ce(msgResponse(_0xf9cb('0x1d3'),_0xf9cb('0x95'),_0xf9cb('0x1d4')));}}else{return _0x2bc8ce(msgResponse(_0xf9cb('0x1d3'),'Failure',_0xf9cb('0x1d5')));}});};};Dialer[_0xf9cb('0x84')]['getDataPredictiveOld']=function(_0x2edab2){var _0x4111e0=this;return function(_0x4350e){return new Promise(function(_0x9cfe6e,_0x31f0ee){_[_0xf9cb('0xf2')](_0x2edab2,_0x4350e[0x0]);if(checkGetDataPredictive(_0x4350e[0x0])){loggerPredictive['info'](JSON[_0xf9cb('0x71')](_0x4350e[0x0]));if(_0x2edab2['dialPredictiveOptimization']===_0xf9cb('0x1c4')){return _0x4111e0['getVoiceQueueRtPauses'](_0x2edab2['id'])[_0xf9cb('0x3d')](function(_0x2639f7){var _0x27b6d0=_0x2edab2[_0xf9cb('0x1d6')]-_0x2639f7[0x0][_0xf9cb('0x1d7')];var _0x882751=_0x2edab2[_0xf9cb('0x1c0')]*0x3c;var _0x138bab=_0x4350e[0x0][_0xf9cb('0x4e')]+_0x4350e[0x0][_0xf9cb('0x4c')];var _0x660754=(_0x4350e[0x0][_0xf9cb('0x46')]+_0x4350e[0x0][_0xf9cb('0x48')]+_0x4350e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4350e[0x0]['predictiveIntervalTotalCalls'];var _0x2427d9=_0x2edab2[_0xf9cb('0x1cf')]/0x64;_0x2edab2[_0xf9cb('0x1d8')]=_0x2639f7[0x0][_0xf9cb('0x1d7')]||0x0;_0x2edab2['predictiveIntervalHitRate']=_0x660754>0x0?_0x660754:0x1;return _0x4111e0['abandonmentRate'](_0x27b6d0,_0x882751,_0x138bab,_0x660754,_0x2427d9);})[_0xf9cb('0x3d')](function(_0x3b1c1d){return _0x9cfe6e(_0x3b1c1d);})[_0xf9cb('0xa3')](function(_0x557ad2){return _0x31f0ee(msgResponse('[CatchErlangB]',_0xf9cb('0x95'),JSON[_0xf9cb('0x71')](_0x557ad2)));});}if(_0x2edab2['dialPredictiveOptimization']===_0xf9cb('0x1d1')){return _0x4111e0[_0xf9cb('0x155')](_0x2edab2['id'])[_0xf9cb('0x3d')](function(_0x3ab358){var _0x28f1ae=_0x2edab2['loggedIn']-_0x3ab358[0x0][_0xf9cb('0x1d7')];var _0x16e76c=_0x2edab2[_0xf9cb('0x1c0')]*0x3c;var _0x1d3d29=_0x4350e[0x0]['predictiveIntervalAvgTalktime']+_0x4350e[0x0]['predictiveIntervalAvgHoldtime'];var _0xeaa174=(_0x4350e[0x0][_0xf9cb('0x46')]+_0x4350e[0x0][_0xf9cb('0x48')]+_0x4350e[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x4350e[0x0][_0xf9cb('0x50')];var _0x1a54b9=_0x2edab2['dialPredictiveOptimizationPercentage']/0x64;_0x2edab2['predictiveIntervalPauses']=_0x3ab358[0x0]['outboundQueuePauses']||0x0;_0x2edab2['predictiveIntervalHitRate']=_0xeaa174>0x0?_0xeaa174:0x1;return _0x4111e0[_0xf9cb('0x1d2')](_0x28f1ae,_0x16e76c,_0x1d3d29,_0xeaa174,_0x1a54b9);})['then'](function(_0xe98409){return _0x9cfe6e(_0xe98409);})[_0xf9cb('0xa3')](function(_0x2c42a1){return _0x31f0ee(msgResponse(_0xf9cb('0x1d9'),'Failure',JSON[_0xf9cb('0x71')](_0x2c42a1)));});}}else{return _0x31f0ee(msgResponse(_0xf9cb('0x1d3'),'Failure','check\x20failure'));}});};};Dialer['prototype'][_0xf9cb('0x1ca')]=function(_0x334555){var _0x503549=this;return function(){var _0x33661f=0x0;var _0x3392e2=Math[_0xf9cb('0x1ba')](_0x334555[_0xf9cb('0x57')]*0x3e8);if(_0x3392e2>0x0){_0x3392e2=_0x3392e2<0x64?0x64:_0x3392e2;loggerPredictive[_0xf9cb('0x44')](_0x334555[_0xf9cb('0x5e')],_0xf9cb('0x1da'),_0x3392e2,_0xf9cb('0x1db'));_0x334555[_0xf9cb('0x5f')]=setInterval(function(){_0x503549['handlePredictive'](_0x334555);loggerPredictiveCalls[_0xf9cb('0x44')](_0xf9cb('0x1dc'),_0x33661f+=0x1);},_0x3392e2);}else{loggerPredictive[_0xf9cb('0x44')](_0x334555[_0xf9cb('0x5e')],_0xf9cb('0x1dd'));}};};Dialer[_0xf9cb('0x84')][_0xf9cb('0x1de')]=function(_0x56be9d,_0x26b6a3){var _0x458f10=this;return function(_0x116e43){if(_[_0xf9cb('0x43')](_0x116e43)){if(_[_0xf9cb('0xee')](_0x26b6a3[_0xf9cb('0x159')])||!_0x26b6a3[_0xf9cb('0x1df')]){if(_0x56be9d[_0xf9cb('0xb2')]==='booked'){_0x56be9d[_0xf9cb('0x70')]=_[_0xf9cb('0x3e')](_0x56be9d[_0xf9cb('0x70')])?!![]:_0x56be9d['queueStatusComplete'];var _0xee29d5=uuid['v4']();_0x458f10[_0xf9cb('0xeb')][_0xee29d5]=new Action(_0x56be9d,_0x26b6a3,_0xee29d5);loggerBooked[_0xf9cb('0x44')](_0xf9cb('0x1e0'),_0xee29d5,_0xf9cb('0x1e1'),JSON[_0xf9cb('0x71')](_0x56be9d[_0xf9cb('0x70')]),'Queue:\x20',_0x56be9d[_0xf9cb('0x5e')]);if(_0x56be9d['queueStatusComplete']){_0x56be9d[_0xf9cb('0x70')]=![];_0x458f10[_0xf9cb('0x29')][_0x458f10[_0xf9cb('0xeb')][_0xee29d5][_0xf9cb('0xbd')]]=[];ami[_0xf9cb('0x9c')]({'actionid':_0xee29d5,'action':'queuestatus','queue':_0x56be9d[_0xf9cb('0x5e')]})['catch'](function(){_0x458f10[_0xf9cb('0xf8')](_0x56be9d);hopperUtils[_0xf9cb('0xd5')]({'active':![],'ContactId':_0x458f10[_0xf9cb('0xeb')][_0xee29d5]['ContactId'],'ListId':_0x458f10[_0xf9cb('0xeb')][_0xee29d5]['ListId'],'VoiceQueueId':_0x458f10['actions'][_0xee29d5][_0xf9cb('0xda')]||undefined,'CampaignId':_0x458f10[_0xf9cb('0xeb')][_0xee29d5]['CampaignId']||undefined})[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x1e2')));delete _0x458f10[_0xf9cb('0xeb')][_0xee29d5];});}else{loggerBooked[_0xf9cb('0x44')]('[booked][checkContactBlack][else]',JSON['stringify'](_0x56be9d[_0xf9cb('0x70')]),_0xf9cb('0x1e3'),_0x56be9d[_0xf9cb('0x5e')]);_0x458f10[_0xf9cb('0xf8')](_0x56be9d);hopperUtils[_0xf9cb('0xd5')]({'active':![],'ContactId':_0x458f10[_0xf9cb('0xeb')][_0xee29d5][_0xf9cb('0xd8')],'ListId':_0x458f10[_0xf9cb('0xeb')][_0xee29d5][_0xf9cb('0xd9')],'VoiceQueueId':_0x458f10['actions'][_0xee29d5][_0xf9cb('0xda')]||undefined,'CampaignId':_0x458f10['actions'][_0xee29d5]['CampaignId']||undefined})[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x1e2')));delete _0x458f10['actions'][_0xee29d5];}}else{return _0x458f10[_0xf9cb('0x15c')](_0x56be9d,_0x26b6a3);}}else{if(utils[_0xf9cb('0x5c')](undefined,_0x26b6a3[_0xf9cb('0x1e4')])<_0x56be9d['dialRecallMeTimeout']*0x3c){if(_0x26b6a3[_0xf9cb('0x14c')]&&!_0x26b6a3[_0xf9cb('0x14c')][_0xf9cb('0x1e5')]){_0x458f10[_0xf9cb('0xfe')][_0xf9cb('0xf5')](_0x26b6a3['id'])[_0xf9cb('0x1c')](function(){_0x458f10[_0xf9cb('0xf8')](_0x56be9d);});}else{hopperUtils['unlockContact']({'active':![]},_0x26b6a3['id'],0x1)['finally'](function(){_0x458f10[_0xf9cb('0xf8')](_0x56be9d);});}}else{_0x56be9d['outboundReCallsDay']+=0x1;_0x458f10[_0xf9cb('0xf8')](_0x56be9d);if(_0x56be9d['dialRecallInQueue']){hopperUtils[_0xf9cb('0xd5')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x26b6a3['ContactId'],'ListId':_0x26b6a3[_0xf9cb('0xd9')],'VoiceQueueId':_0x26b6a3[_0xf9cb('0xda')]||undefined,'CampaignId':_0x26b6a3[_0xf9cb('0xf9')]||undefined})['catch'](loggerCatch(_0xf9cb('0x1e6')));hopperUtils[_0xf9cb('0xc9')](createObjHistory(_0x56be9d,_0x26b6a3,utils[_0xf9cb('0x68')][_0xf9cb('0x1e7')],0x17,_0xf9cb('0x1e8')))[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x1e9')));}else{_0x458f10[_0xf9cb('0x116')](createObjHistory(_0x56be9d,_0x26b6a3,utils[_0xf9cb('0x68')][_0xf9cb('0x1ea')],0x16,_0xf9cb('0x1eb')),_0xf9cb('0x1ec'),_0xf9cb('0x1ed'));}}}}else{_0x56be9d[_0xf9cb('0x1ee')]+=0x1;_0x458f10[_0xf9cb('0x116')](createObjHistory(_0x56be9d,_0x26b6a3,utils[_0xf9cb('0x68')][_0xf9cb('0x1ef')],0xd,'Blacklist'),_0xf9cb('0x1f0'),_0xf9cb('0x1f1'));throw _0xf9cb('0x1f2');}};};Dialer[_0xf9cb('0x84')][_0xf9cb('0x15b')]=function(_0x4de2b7){var _0x1152b5=this;var _0x93a08e=_0x4de2b7[_0xf9cb('0x1f3')]-_0x4de2b7[_0xf9cb('0x7e')];emitCampaignSummary(_0x4de2b7);if(_0x93a08e>0x0&&_0x4de2b7[_0xf9cb('0x65')]==0x0){if(_0x93a08e>this[_0xf9cb('0x22')]){_0x93a08e=this['maxNumberOriginate'];}_0x4de2b7[_0xf9cb('0x65')]=0x1;hopperUtils[_0xf9cb('0x1f4')](_0x4de2b7,_0x93a08e)[_0xf9cb('0x3d')](function(_0x6d98b){_0x4de2b7[_0xf9cb('0x65')]=0x0;if(_0x6d98b){if(!utils[_0xf9cb('0x1f5')](_0x6d98b)){_0x4de2b7['message']=utils[_0xf9cb('0x68')][_0xf9cb('0x6b')];logger[_0xf9cb('0x44')](_0xf9cb('0x1f6')+_0x4de2b7[_0xf9cb('0x5e')]);}else{_0x4de2b7[_0xf9cb('0x7e')]+=_0x6d98b[_0xf9cb('0x9a')];_0x4de2b7[_0xf9cb('0x67')]=utils['CAMPAIGN_STATUS'][_0xf9cb('0x1f7')];for(var _0x5dd7bb=0x0;_0x5dd7bb<_0x6d98b[_0xf9cb('0x9a')];_0x5dd7bb+=0x1){_0x4de2b7[_0xf9cb('0x1f8')]+=0x1;if(_[_0xf9cb('0xee')](_0x6d98b[_0x5dd7bb])||_[_0xf9cb('0xee')](_0x6d98b[_0x5dd7bb][_0xf9cb('0x174')])||_['isNil'](_0x6d98b[_0x5dd7bb]['phone'])){_0x1152b5['emptyContact'](_0xf9cb('0x1f9'),_0x4de2b7,_0x6d98b[_0x5dd7bb]);}else{hopperUtils['checkIsBlackListIvr'](_[_0xf9cb('0x72')](_0x6d98b[_0x5dd7bb],[_0xf9cb('0xf9'),_0xf9cb('0x15f')]))['then'](_0x1152b5[_0xf9cb('0x1de')](_0x4de2b7,_0x6d98b[_0x5dd7bb]))[_0xf9cb('0xa3')](_0x1152b5[_0xf9cb('0x157')]('[actionOriginateIvr]\x20',_0x4de2b7));}}}}})['catch'](loggerGetContactDialer(_0xf9cb('0x1fa'),_0x4de2b7,_0x93a08e));}};Dialer['prototype']['handlePower']=function(_0x23d574,_0x5927d2){var _0x27aae=this;var _0x550592=[];if(_0x5927d2<0x1||_0x23d574['dialMethod']===_0xf9cb('0x8')){_0x5927d2=0x1;}var _0x1c32f2=Math['floor'](_0x23d574[_0xf9cb('0x13e')]*_0x5927d2)-_0x23d574[_0xf9cb('0x7e')];if(_0x23d574['dialLimitQueue']>0x0){var _0x50a030=_0x23d574['dialLimitQueue']-_0x23d574[_0xf9cb('0x7e')]-_0x23d574[_0xf9cb('0x140')]-_0x23d574[_0xf9cb('0x141')];if(_0x1c32f2>_0x50a030){_0x1c32f2=_0x50a030;}}if(_0x1c32f2>0x0&&_0x23d574[_0xf9cb('0x65')]==0x0){if(_0x23d574[_0xf9cb('0xb2')]===_0xf9cb('0x8')){_0x1c32f2=0x1;}if(_0x1c32f2>this[_0xf9cb('0x22')]){_0x1c32f2=this[_0xf9cb('0x22')];}for(var _0x292c63 in this[_0xf9cb('0x20')]){if(typeof this[_0xf9cb('0x20')][_0x292c63]!=='undefined'){if(this['agents'][_0x292c63]['state']===_0xf9cb('0x1fb')&&this[_0xf9cb('0x20')][_0x292c63][_0xf9cb('0x89')]==='reachable'){_0x550592[_0xf9cb('0x9b')](this[_0xf9cb('0x20')][_0x292c63]['id']);}}}_0x23d574[_0xf9cb('0x65')]=0x1;hopperUtils['getContactDialer'](_0x23d574,_0x550592,_0x1c32f2)['then'](function(_0x1e0228){_0x23d574[_0xf9cb('0x65')]=0x0;if(_0x1e0228){if(!utils[_0xf9cb('0x1f5')](_0x1e0228)){hopperUtils[_0xf9cb('0x1fc')](_0x23d574)[_0xf9cb('0x3d')](sendMessageReschedule(_0x23d574))[_0xf9cb('0xa3')](loggerCatch('[countReScheduled]\x20'));}else{_0x23d574['originated']+=_0x1e0228[_0xf9cb('0x9a')];_0x23d574[_0xf9cb('0x67')]=_0x23d574[_0xf9cb('0xb2')]==='booked'?utils[_0xf9cb('0x68')][_0xf9cb('0x142')]:utils[_0xf9cb('0x68')][_0xf9cb('0x1f7')];for(var _0x2a5964=0x0;_0x2a5964<_0x1e0228['length'];_0x2a5964+=0x1){if(_['isNil'](_0x1e0228[_0x2a5964])||_[_0xf9cb('0xee')](_0x1e0228[_0x2a5964][_0xf9cb('0x174')])||_[_0xf9cb('0xee')](_0x1e0228[_0x2a5964]['phone'])){_0x27aae[_0xf9cb('0x1fd')](_0xf9cb('0x1f9'),_0x23d574,_0x1e0228[_0x2a5964]);}else{hopperUtils[_0xf9cb('0x1fe')](_[_0xf9cb('0x72')](_0x1e0228[_0x2a5964],[_0xf9cb('0xda'),'phone']))[_0xf9cb('0x3d')](_0x27aae['checkContactBlack'](_0x23d574,_0x1e0228[_0x2a5964]))['catch'](_0x27aae[_0xf9cb('0x157')]('[actionOriginate]\x20',_0x23d574));}}}}})[_0xf9cb('0xa3')](loggerGetContactDialer('[getContactDialer2]',_0x23d574,_0x1c32f2));}};Dialer['prototype'][_0xf9cb('0x5f')]=function(_0x2eca3e){if(_0x2eca3e['dialLimitQueue']>0x0){var _0x3feafb=_0x2eca3e[_0xf9cb('0x1ff')]-_0x2eca3e[_0xf9cb('0x7e')]-_0x2eca3e[_0xf9cb('0x140')];if(_0x3feafb>0x0&&_0x2eca3e[_0xf9cb('0x65')]==0x0){this[_0xf9cb('0x200')](_0x2eca3e);}else{loggerPredictiveCalls[_0xf9cb('0x44')](_0xf9cb('0x201'));}}else{this[_0xf9cb('0x200')](_0x2eca3e);}};Dialer[_0xf9cb('0x84')]['tryOriginatePredictive']=function(_0x5b0500){var _0x4b0cd0=this;var _0x46965e=[];_0x5b0500['originated']+=0x1;for(var _0x73c389 in this[_0xf9cb('0x20')]){if(typeof this['agents'][_0x73c389]!==_0xf9cb('0xae')){if(this[_0xf9cb('0x20')][_0x73c389][_0xf9cb('0x6d')]==='not_inuse'&&this[_0xf9cb('0x20')][_0x73c389][_0xf9cb('0x89')]===_0xf9cb('0x88')){_0x46965e[_0xf9cb('0x9b')](this[_0xf9cb('0x20')][_0x73c389]['id']);}}}_0x5b0500[_0xf9cb('0x65')]=0x1;return this[_0xf9cb('0x202')](_0x5b0500['id'],_0x46965e,0x1,_0x5b0500[_0xf9cb('0x203')],_0x5b0500)[_0xf9cb('0x3d')](function(_0x182c76){_0x5b0500['temp']=0x1;if(_0x182c76){if(!utils[_0xf9cb('0x1f5')](_0x182c76)){utils[_0xf9cb('0x64')](_0x5b0500,0x1,0x0);return hopperUtils[_0xf9cb('0x1fc')](_0x5b0500)['then'](sendMessageReschedule(_0x5b0500))[_0xf9cb('0xa3')](loggerCatch(_0xf9cb('0x204')));}else{_0x5b0500[_0xf9cb('0x67')]=utils[_0xf9cb('0x68')][_0xf9cb('0x1f7')];if(_[_0xf9cb('0xee')](_0x182c76[0x0])||_[_0xf9cb('0xee')](_0x182c76[0x0][_0xf9cb('0x174')])||_[_0xf9cb('0xee')](_0x182c76[0x0][_0xf9cb('0x15f')])){_0x4b0cd0[_0xf9cb('0x1fd')]('[actionOriginate]\x20',_0x5b0500,_0x182c76[0x0]);}else{return hopperUtils[_0xf9cb('0x1fe')](_['pick'](_0x182c76[0x0],[_0xf9cb('0xda'),_0xf9cb('0x15f')]))['then'](_0x4b0cd0[_0xf9cb('0x1de')](_0x5b0500,_0x182c76[0x0]))[_0xf9cb('0xa3')](_0x4b0cd0[_0xf9cb('0x157')](_0xf9cb('0x205'),_0x5b0500));}}}})[_0xf9cb('0xa3')](loggerGetContactDialer(_0xf9cb('0x206'),_0x5b0500,0x1));};Dialer['prototype']['abandonmentRate']=function(_0x38a954,_0x1ac456,_0x1c2e40,_0x1a8b11,_0x263577,_0x20735c){loggerPredictive['info'](_0xf9cb('0x207'));loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x208'),_0x38a954);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x209'),_0x1ac456);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x20a'),_0x1c2e40);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x20b'),_0x1a8b11);loggerPredictive[_0xf9cb('0x44')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x263577);loggerPredictive['info'](_0xf9cb('0x4f'));return new Promise(function(_0x5952ac,_0xb03083){if(_0x38a954<=0x0||isNaN(_0x38a954)){return _0xb03083(msgResponse(_0xf9cb('0x20c'),_0xf9cb('0x83'),'m\x20=\x20'+_0x38a954));}if(_0x1c2e40<=0x0||isNaN(_0x1c2e40)){return _0xb03083(msgResponse(_0xf9cb('0x20c'),_0xf9cb('0x83'),'Ts\x20=\x20'+_0x1c2e40));}if(_0x1a8b11<=0x0||isNaN(_0x1a8b11)){return _0xb03083(msgResponse(_0xf9cb('0x20c'),_0xf9cb('0x83'),_0xf9cb('0x20d')+_0x1a8b11));}if(_0x1ac456<=0x0||isNaN(_0x1ac456)){return _0xb03083(msgResponse(_0xf9cb('0x20c'),_0xf9cb('0x83'),_0xf9cb('0x20e')+_0x1ac456));}if(_0x263577<=0x0||isNaN(_0x263577)){return _0xb03083(msgResponse(_0xf9cb('0x20c'),_0xf9cb('0x83'),_0xf9cb('0x20f')+_0x263577));}_0x20735c=_0x20735c||0x0;var _0x4e11f7=0x1/_0x1c2e40;var _0x12c12a=0x0;var _0x4caf47=0x0;var _0xa04422=0x0;var _0x4fc82b=0x0;for(var _0x2e6bb3=0x0;_0xa04422<_0x263577;_0x2e6bb3+=0x1){_0x4caf47=_0x2e6bb3/_0x1ac456;_0x12c12a=(_0x1a8b11*_0x4caf47+_0x20735c)/_0x4e11f7;_0xa04422=utils[_0xf9cb('0x210')](_0x12c12a,_0x38a954);_0x4fc82b=_0x12c12a/_0x38a954*(0x1-utils[_0xf9cb('0x210')](_0x12c12a,_0x38a954));}return _0x5952ac({'erlangCalls':_0x2e6bb3,'erlangCallToSecond':_0x1ac456/_0x2e6bb3,'erlangAbandonmentRate':_0xa04422,'erlangBusyFactor':_0x4fc82b});});};Dialer[_0xf9cb('0x84')][_0xf9cb('0x1d2')]=function(_0x197df2,_0x52e5f6,_0x329fb3,_0x334cc2,_0x28e421,_0x4f7771){loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x211'));loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x208'),_0x197df2);loggerPredictive['info'](_0xf9cb('0x209'),_0x52e5f6);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x20a'),_0x329fb3);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x20b'),_0x334cc2);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x212'),_0x28e421);loggerPredictive[_0xf9cb('0x44')](_0xf9cb('0x4f'));return new Promise(function(_0x2a4974,_0x37995d){if(_0x197df2<=0x0||isNaN(_0x197df2)){return _0x37995d(msgResponse(_0xf9cb('0x213'),_0xf9cb('0x83'),_0xf9cb('0x214')+_0x197df2));}if(_0x329fb3<=0x0||isNaN(_0x329fb3)){return _0x37995d(msgResponse(_0xf9cb('0x213'),_0xf9cb('0x83'),'Ts\x20=\x20'+_0x329fb3));}if(_0x334cc2<=0x0||isNaN(_0x334cc2)){return _0x37995d(msgResponse('[busyFactor]',_0xf9cb('0x83'),_0xf9cb('0x20d')+_0x334cc2));}if(_0x52e5f6<=0x0||isNaN(_0x52e5f6)){return _0x37995d(msgResponse('[busyFactor]','Error',_0xf9cb('0x20e')+_0x52e5f6));}if(_0x28e421<=0x0||isNaN(_0x28e421)){return _0x37995d(msgResponse('[busyFactor]',_0xf9cb('0x83'),_0xf9cb('0x215')+_0x28e421));}_0x4f7771=_0x4f7771||0x0;var _0x490658=0x1/_0x329fb3;var _0x596fa1=0x0;var _0x13f03d=0x0;var _0x26a982=0x0;var _0x27be86=0x0;for(var _0xdeef2a=0x0;_0x27be86<_0x28e421;_0xdeef2a+=0x1){_0x13f03d=_0xdeef2a/_0x52e5f6;_0x596fa1=(_0x334cc2*_0x13f03d+_0x4f7771)/_0x490658;_0x26a982=utils[_0xf9cb('0x210')](_0x596fa1,_0x197df2);_0x27be86=_0x596fa1/_0x197df2*(0x1-utils[_0xf9cb('0x210')](_0x596fa1,_0x197df2));}return _0x2a4974({'erlangCalls':_0xdeef2a,'erlangCallToSecond':_0x52e5f6/_0xdeef2a,'erlangAbandonmentRate':_0x26a982,'erlangBusyFactor':_0x27be86});});};module[_0xf9cb('0x216')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index 8d1d3a0..7f65510 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5d78=['callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','substring','getQueue','exports','lodash','moment','isNil','string','voiceQueue','phone','Contact','firstName','lastName','number','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','VoiceQueueId','CampaignId','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x982593,_0x291d34){var _0x16923e=function(_0x9e6d1f){while(--_0x9e6d1f){_0x982593['push'](_0x982593['shift']());}};_0x16923e(++_0x291d34);}(_0x5d78,0x8d));var _0x85d7=function(_0x420836,_0xaa0e07){_0x420836=_0x420836-0x0;var _0x49dc8a=_0x5d78[_0x420836];return _0x49dc8a;};'use strict';var util=require('util');var _=require(_0x85d7('0x0'));var moment=require(_0x85d7('0x1'));function checkNameSurname(_0x22cc41,_0x5ed33a,_0x2dd8d8){var _0x5ae52a='';if(!_[_0x85d7('0x2')](_0x5ed33a)&&_0x85d7('0x3')===typeof _0x5ed33a){_0x5ae52a+=_0x5ed33a;}if(!_[_0x85d7('0x2')](_0x2dd8d8)&&_0x85d7('0x3')===typeof _0x2dd8d8){_0x5ae52a+='\x20'+_0x2dd8d8;}if(_0x5ae52a!==''){return _0x5ae52a;}return _0x22cc41;}function Action(_0x31af74,_0x3a016b,_0x11546f){this[_0x85d7('0x4')]=_0x31af74;this['uniqueid']=_0x11546f||undefined;this['name']=checkNameSurname(_0x3a016b['Contact'][_0x85d7('0x5')],_0x3a016b[_0x85d7('0x6')][_0x85d7('0x7')],_0x3a016b['Contact'][_0x85d7('0x8')]);this[_0x85d7('0x9')]=_0x3a016b[_0x85d7('0x5')];this[_0x85d7('0xa')]=_0x31af74[_0x85d7('0xb')];this[_0x85d7('0xc')]=_0x3a016b[_0x85d7('0xc')]||![];this[_0x85d7('0xd')]=_0x31af74[_0x85d7('0xd')];this[_0x85d7('0xe')]=_0x31af74['dialQueueTimeout']||0x3;this[_0x85d7('0xf')]=_0x3a016b[_0x85d7('0xf')];this[_0x85d7('0x10')]=_0x3a016b[_0x85d7('0x10')];this[_0x85d7('0x11')]=_0x3a016b['countcongestionretry'];this[_0x85d7('0x12')]=_0x3a016b[_0x85d7('0x12')];this[_0x85d7('0x13')]=_0x3a016b['countnosuchnumberretry'];this['countdropretry']=_0x3a016b[_0x85d7('0x14')];this[_0x85d7('0x15')]=_0x3a016b[_0x85d7('0x15')];this[_0x85d7('0x16')]=_0x3a016b[_0x85d7('0x16')];this[_0x85d7('0x17')]=_0x3a016b[_0x85d7('0x17')];this[_0x85d7('0x18')]=_0x3a016b[_0x85d7('0x18')];this[_0x85d7('0x19')]=_0x3a016b[_0x85d7('0x19')];this['UserId']=_0x3a016b['UserId'];this[_0x85d7('0x1a')]=_0x3a016b[_0x85d7('0x1a')];this[_0x85d7('0x1b')]=_0x3a016b[_0x85d7('0x1b')];this['idHopper']=_0x3a016b['id'];this['ContactFirstName']=_0x3a016b[_0x85d7('0x6')]['firstName']||'';this[_0x85d7('0x1c')]=moment()[_0x85d7('0x1d')](_0x85d7('0x1e'));this[_0x85d7('0x1f')]=_0x3a016b[_0x85d7('0x1f')];this[_0x85d7('0x20')]=_0x3a016b['callbackuniqueid'];this['callbackat']=_0x3a016b[_0x85d7('0x21')];this[_0x85d7('0x22')]=_0x3a016b[_0x85d7('0x22')];this['originatecalleridnum']='';this[_0x85d7('0x23')]='';}Action[_0x85d7('0x24')][_0x85d7('0x25')]=function(){return util['format'](_0x85d7('0x26'),this[_0x85d7('0xb')],this[_0x85d7('0x4')][_0x85d7('0x27')]>0x0?this[_0x85d7('0x9')][_0x85d7('0x28')](this[_0x85d7('0x4')][_0x85d7('0x27')]):this[_0x85d7('0x9')]);};Action['prototype'][_0x85d7('0x29')]=function(){return this['queue'];};module[_0x85d7('0x2a')]=Action; \ No newline at end of file +var _0x650b=['ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','getQueue','exports','util','lodash','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x4d9107,_0x387fb0){var _0x1f1bc8=function(_0x206993){while(--_0x206993){_0x4d9107['push'](_0x4d9107['shift']());}};_0x1f1bc8(++_0x387fb0);}(_0x650b,0xee));var _0xb650=function(_0x5a06f8,_0x1ca6ae){_0x5a06f8=_0x5a06f8-0x0;var _0x5695ae=_0x650b[_0x5a06f8];return _0x5695ae;};'use strict';var util=require(_0xb650('0x0'));var _=require(_0xb650('0x1'));var moment=require(_0xb650('0x2'));function checkNameSurname(_0x13f7b9,_0x4dc7ad,_0x2c59af){var _0x2259b8='';if(!_[_0xb650('0x3')](_0x4dc7ad)&&_0xb650('0x4')===typeof _0x4dc7ad){_0x2259b8+=_0x4dc7ad;}if(!_[_0xb650('0x3')](_0x2c59af)&&'string'===typeof _0x2c59af){_0x2259b8+='\x20'+_0x2c59af;}if(_0x2259b8!==''){return _0x2259b8;}return _0x13f7b9;}function Action(_0x15a26e,_0x521c23,_0x4651ff){this[_0xb650('0x5')]=_0x15a26e;this[_0xb650('0x6')]=_0x4651ff||undefined;this[_0xb650('0x7')]=checkNameSurname(_0x521c23[_0xb650('0x8')][_0xb650('0x9')],_0x521c23[_0xb650('0x8')][_0xb650('0xa')],_0x521c23['Contact'][_0xb650('0xb')]);this[_0xb650('0xc')]=_0x521c23['phone'];this[_0xb650('0xd')]=_0x15a26e[_0xb650('0x7')];this[_0xb650('0xe')]=_0x521c23['active']||![];this['type']=_0x15a26e[_0xb650('0xf')];this[_0xb650('0x10')]=_0x15a26e['dialQueueTimeout']||0x3;this['scheduledat']=_0x521c23[_0xb650('0x11')];this[_0xb650('0x12')]=_0x521c23[_0xb650('0x12')];this[_0xb650('0x13')]=_0x521c23[_0xb650('0x13')];this[_0xb650('0x14')]=_0x521c23[_0xb650('0x14')];this[_0xb650('0x15')]=_0x521c23[_0xb650('0x15')];this[_0xb650('0x16')]=_0x521c23['countdropretry'];this[_0xb650('0x17')]=_0x521c23[_0xb650('0x17')];this[_0xb650('0x18')]=_0x521c23[_0xb650('0x18')];this[_0xb650('0x19')]=_0x521c23[_0xb650('0x19')];this[_0xb650('0x1a')]=_0x521c23['ContactId'];this['ListId']=_0x521c23[_0xb650('0x1b')];this[_0xb650('0x1c')]=_0x521c23[_0xb650('0x1c')];this[_0xb650('0x1d')]=_0x521c23[_0xb650('0x1d')];this['CampaignId']=_0x521c23['CampaignId'];this[_0xb650('0x1e')]=_0x521c23['id'];this[_0xb650('0x1f')]=_0x521c23['Contact'][_0xb650('0xa')]||'';this['starttime']=moment()[_0xb650('0x20')](_0xb650('0x21'));this['callback']=_0x521c23[_0xb650('0x22')];this[_0xb650('0x23')]=_0x521c23[_0xb650('0x23')];this[_0xb650('0x24')]=_0x521c23[_0xb650('0x24')];this[_0xb650('0x25')]=_0x521c23[_0xb650('0x25')];this[_0xb650('0x26')]='';this[_0xb650('0x27')]='';}Action[_0xb650('0x28')][_0xb650('0x29')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0xb650('0x7')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xb650('0xc')]['substring'](this[_0xb650('0x5')]['dialCutDigit']):this[_0xb650('0xc')]);};Action[_0xb650('0x28')][_0xb650('0x2a')]=function(){return this['queue'];};module[_0xb650('0x2b')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 3d75249..df080ae 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf59b=['ringtime','holdtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state','statedesc','Answer','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countnoanswerretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x50f9ab,_0x5009b4){var _0x58dda4=function(_0x5f1ff5){while(--_0x5f1ff5){_0x50f9ab['push'](_0x50f9ab['shift']());}};_0x58dda4(++_0x5009b4);}(_0xf59b,0xee));var _0xbf59=function(_0x53bfdb,_0x8ecab3){_0x53bfdb=_0x53bfdb-0x0;var _0x469b15=_0xf59b[_0x53bfdb];return _0x469b15;};'use strict';var moment=require('moment');var utils=require(_0xbf59('0x0'));function AgentComplete(_0x1a8291,_0x486e8b){this[_0xbf59('0x1')]=0x4;this[_0xbf59('0x2')]=_0xbf59('0x3');this[_0xbf59('0x4')]=_0x1a8291[_0xbf59('0x4')];this['type']=_0x1a8291['type'];this[_0xbf59('0x5')]=_0x1a8291[_0xbf59('0x6')]===_0xbf59('0x7')?_0xbf59('0x8'):_0x1a8291[_0xbf59('0x6')];this[_0xbf59('0x9')]=_0x1a8291[_0xbf59('0x9')];this['countcongestionretry']=_0x1a8291['countcongestionretry'];this['countnoanswerretry']=_0x1a8291[_0xbf59('0xa')];this['countglobal']=_0x1a8291[_0xbf59('0x9')]+_0x1a8291[_0xbf59('0xb')]+_0x1a8291[_0xbf59('0xa')]+_0x1a8291['countnosuchnumberretry']+_0x1a8291[_0xbf59('0xc')]+_0x1a8291[_0xbf59('0xd')]+_0x1a8291[_0xbf59('0xe')]+_0x1a8291[_0xbf59('0xf')];this[_0xbf59('0x10')]=_0x1a8291[_0xbf59('0x10')];this['countdropretry']=_0x1a8291[_0xbf59('0xc')];this[_0xbf59('0xd')]=_0x1a8291[_0xbf59('0xd')];this[_0xbf59('0xe')]=_0x1a8291['countmachineretry'];this[_0xbf59('0xf')]=_0x1a8291[_0xbf59('0xf')];this[_0xbf59('0x11')]=_0x486e8b[_0xbf59('0x11')];this[_0xbf59('0x12')]=_0x1a8291[_0xbf59('0x13')];this[_0xbf59('0x14')]=_0x1a8291['number'];this[_0xbf59('0x15')]=_0x1a8291[_0xbf59('0x15')];this[_0xbf59('0x16')]=_0x1a8291[_0xbf59('0x16')];this[_0xbf59('0x17')]=_0x1a8291['answertime'];this[_0xbf59('0x18')]=moment()['format'](_0xbf59('0x19'));this[_0xbf59('0x1a')]=utils['getSeconds'](_0x1a8291[_0xbf59('0x16')],_0x1a8291[_0xbf59('0x15')]);this[_0xbf59('0x1b')]=utils[_0xbf59('0x1c')](_0x1a8291[_0xbf59('0x17')],_0x1a8291['responsetime']);this[_0xbf59('0x1d')]=utils['getSeconds'](this[_0xbf59('0x18')],_0x1a8291[_0xbf59('0x17')]);this['queue']=_0x486e8b[_0xbf59('0x8')];this[_0xbf59('0x1e')]=_0x486e8b[_0xbf59('0x1e')];this[_0xbf59('0x1f')]=_0x486e8b[_0xbf59('0x1f')];this['callback']=_0x1a8291[_0xbf59('0x20')];this[_0xbf59('0x21')]=_0x1a8291[_0xbf59('0x21')];this[_0xbf59('0x22')]=_0x1a8291['callbackat'];this[_0xbf59('0x23')]=_0x1a8291[_0xbf59('0x23')];this['ContactId']=_0x1a8291['ContactId'];this[_0xbf59('0x24')]=_0x1a8291[_0xbf59('0x24')];this['UserId']=_0x1a8291[_0xbf59('0x25')];this['VoiceQueueId']=_0x1a8291[_0xbf59('0x26')];this[_0xbf59('0x27')]=_0x1a8291[_0xbf59('0x27')];this[_0xbf59('0x28')]=_0x1a8291['originatecalleridnum']||'';this[_0xbf59('0x29')]=_0x1a8291[_0xbf59('0x29')]||'';this[_0xbf59('0x2a')]=_0x1a8291[_0xbf59('0x2a')];}module[_0xbf59('0x2b')]=AgentComplete; \ No newline at end of file +var _0x3b10=['ringtime','getSeconds','holdtime','answertime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','../utils','state','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4c3206,_0x58cd5){var _0x4b97bb=function(_0x24c452){while(--_0x24c452){_0x4c3206['push'](_0x4c3206['shift']());}};_0x4b97bb(++_0x58cd5);}(_0x3b10,0x194));var _0x03b1=function(_0x709aac,_0xbb49f8){_0x709aac=_0x709aac-0x0;var _0x41f12a=_0x3b10[_0x709aac];return _0x41f12a;};'use strict';var moment=require('moment');var utils=require(_0x03b1('0x0'));function AgentComplete(_0x141731,_0x279db2){this[_0x03b1('0x1')]=0x4;this[_0x03b1('0x2')]=_0x03b1('0x3');this['scheduledat']=_0x141731[_0x03b1('0x4')];this['type']=_0x141731[_0x03b1('0x5')];this[_0x03b1('0x6')]=_0x141731[_0x03b1('0x5')]==='outbound'?_0x03b1('0x7'):_0x141731[_0x03b1('0x5')];this[_0x03b1('0x8')]=_0x141731['countbusyretry'];this[_0x03b1('0x9')]=_0x141731[_0x03b1('0x9')];this[_0x03b1('0xa')]=_0x141731[_0x03b1('0xa')];this[_0x03b1('0xb')]=_0x141731[_0x03b1('0x8')]+_0x141731[_0x03b1('0x9')]+_0x141731[_0x03b1('0xa')]+_0x141731[_0x03b1('0xc')]+_0x141731[_0x03b1('0xd')]+_0x141731[_0x03b1('0xe')]+_0x141731[_0x03b1('0xf')]+_0x141731[_0x03b1('0x10')];this[_0x03b1('0xc')]=_0x141731[_0x03b1('0xc')];this[_0x03b1('0xd')]=_0x141731[_0x03b1('0xd')];this[_0x03b1('0xe')]=_0x141731[_0x03b1('0xe')];this[_0x03b1('0xf')]=_0x141731[_0x03b1('0xf')];this[_0x03b1('0x10')]=_0x141731[_0x03b1('0x10')];this['uniqueid']=_0x279db2['uniqueid'];this[_0x03b1('0x11')]=_0x141731[_0x03b1('0x12')];this[_0x03b1('0x13')]=_0x141731[_0x03b1('0x14')];this[_0x03b1('0x15')]=_0x141731[_0x03b1('0x15')];this['responsetime']=_0x141731[_0x03b1('0x16')];this['answertime']=_0x141731['answertime'];this[_0x03b1('0x17')]=moment()[_0x03b1('0x18')](_0x03b1('0x19'));this[_0x03b1('0x1a')]=utils[_0x03b1('0x1b')](_0x141731[_0x03b1('0x16')],_0x141731[_0x03b1('0x15')]);this[_0x03b1('0x1c')]=utils[_0x03b1('0x1b')](_0x141731[_0x03b1('0x1d')],_0x141731[_0x03b1('0x16')]);this['talktime']=utils['getSeconds'](this['endtime'],_0x141731[_0x03b1('0x1d')]);this[_0x03b1('0x7')]=_0x279db2[_0x03b1('0x7')];this['membername']=_0x279db2['membername'];this[_0x03b1('0x1e')]=_0x279db2[_0x03b1('0x1e')];this[_0x03b1('0x1f')]=_0x141731[_0x03b1('0x1f')];this[_0x03b1('0x20')]=_0x141731[_0x03b1('0x20')];this[_0x03b1('0x21')]=_0x141731['callbackat'];this[_0x03b1('0x22')]=_0x141731[_0x03b1('0x22')];this[_0x03b1('0x23')]=_0x141731[_0x03b1('0x23')];this['ListId']=_0x141731[_0x03b1('0x24')];this['UserId']=_0x141731[_0x03b1('0x25')];this[_0x03b1('0x26')]=_0x141731[_0x03b1('0x26')];this[_0x03b1('0x27')]=_0x141731['CampaignId'];this[_0x03b1('0x28')]=_0x141731[_0x03b1('0x28')]||'';this[_0x03b1('0x29')]=_0x141731[_0x03b1('0x29')]||'';this[_0x03b1('0x2a')]=_0x141731[_0x03b1('0x2a')];}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index 4f0cba4..0957914 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad4d=['statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','state'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xad4d,0xe9));var _0xdad4=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xad4d[_0x2070da];return _0x4f9fe1;};'use strict';function Final(_0x462f55){this[_0xdad4('0x0')]=_0x462f55[_0xdad4('0x0')];this[_0xdad4('0x1')]=_0x462f55['scheduledat'];this[_0xdad4('0x2')]=_0x462f55[_0xdad4('0x2')];this[_0xdad4('0x3')]=_0x462f55['type']===_0xdad4('0x4')?_0xdad4('0x5'):_0x462f55[_0xdad4('0x2')];this['countbusyretry']=_0x462f55['countbusyretry'];this[_0xdad4('0x6')]=_0x462f55['countcongestionretry'];this['countnoanswerretry']=_0x462f55['countnoanswerretry'];this[_0xdad4('0x7')]=_0x462f55[_0xdad4('0x8')]+_0x462f55[_0xdad4('0x6')]+_0x462f55['countnoanswerretry']+_0x462f55[_0xdad4('0x9')]+_0x462f55[_0xdad4('0xa')]+_0x462f55['countabandonedretry']+_0x462f55[_0xdad4('0xb')]+_0x462f55[_0xdad4('0xc')];this[_0xdad4('0x9')]=_0x462f55[_0xdad4('0x9')];this['countdropretry']=_0x462f55[_0xdad4('0xa')];this['countabandonedretry']=_0x462f55[_0xdad4('0xd')];this[_0xdad4('0xb')]=_0x462f55[_0xdad4('0xb')];this[_0xdad4('0xc')]=_0x462f55[_0xdad4('0xc')];this[_0xdad4('0x5')]=_0x462f55[_0xdad4('0x5')];this[_0xdad4('0xe')]=_0x462f55['calleridname'];this[_0xdad4('0xf')]=_0x462f55[_0xdad4('0xf')];this['starttime']=_0x462f55[_0xdad4('0x10')];this['responsetime']=_0x462f55[_0xdad4('0x11')];this['endtime']=_0x462f55[_0xdad4('0x11')];this['ringtime']=_0x462f55['ringtime']||0x0;this[_0xdad4('0x12')]=_0x462f55[_0xdad4('0x12')]||0x0;this[_0xdad4('0x13')]=_0x462f55[_0xdad4('0x13')]||0x0;this['callback']=_0x462f55[_0xdad4('0x14')];this[_0xdad4('0x15')]=_0x462f55[_0xdad4('0x15')];this[_0xdad4('0x16')]=_0x462f55[_0xdad4('0x16')];this['recallme']=_0x462f55[_0xdad4('0x17')];this[_0xdad4('0x18')]=_0x462f55['ContactId'];this['ListId']=_0x462f55[_0xdad4('0x19')];this[_0xdad4('0x1a')]=_0x462f55[_0xdad4('0x1a')];this['VoiceQueueId']=_0x462f55['VoiceQueueId'];this[_0xdad4('0x1b')]=_0x462f55[_0xdad4('0x1b')];this[_0xdad4('0x1c')]=_0x462f55[_0xdad4('0x1c')]||'';this['originatecalleridname']=_0x462f55[_0xdad4('0x1d')]||'';this[_0xdad4('0x1e')]=_0x462f55[_0xdad4('0x1e')];this['statedesc']=_0x462f55[_0xdad4('0x1f')];}module[_0xdad4('0x20')]=Final; \ No newline at end of file +var _0x406d=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','type','campaigntype','outbound'];(function(_0x15a8fa,_0xde3e6){var _0x3bbd4d=function(_0x59b7c9){while(--_0x59b7c9){_0x15a8fa['push'](_0x15a8fa['shift']());}};_0x3bbd4d(++_0xde3e6);}(_0x406d,0x83));var _0xd406=function(_0x3a5ea9,_0x13fb5e){_0x3a5ea9=_0x3a5ea9-0x0;var _0x14f566=_0x406d[_0x3a5ea9];return _0x14f566;};'use strict';function Final(_0x354743){this[_0xd406('0x0')]=_0x354743['uniqueid'];this[_0xd406('0x1')]=_0x354743[_0xd406('0x1')];this[_0xd406('0x2')]=_0x354743[_0xd406('0x2')];this[_0xd406('0x3')]=_0x354743['type']===_0xd406('0x4')?_0xd406('0x5'):_0x354743[_0xd406('0x2')];this[_0xd406('0x6')]=_0x354743[_0xd406('0x6')];this[_0xd406('0x7')]=_0x354743[_0xd406('0x7')];this[_0xd406('0x8')]=_0x354743['countnoanswerretry'];this['countglobal']=_0x354743[_0xd406('0x6')]+_0x354743[_0xd406('0x7')]+_0x354743[_0xd406('0x8')]+_0x354743[_0xd406('0x9')]+_0x354743[_0xd406('0xa')]+_0x354743['countabandonedretry']+_0x354743[_0xd406('0xb')]+_0x354743[_0xd406('0xc')];this[_0xd406('0x9')]=_0x354743[_0xd406('0x9')];this[_0xd406('0xa')]=_0x354743[_0xd406('0xa')];this['countabandonedretry']=_0x354743[_0xd406('0xd')];this[_0xd406('0xb')]=_0x354743[_0xd406('0xb')];this[_0xd406('0xc')]=_0x354743[_0xd406('0xc')];this['queue']=_0x354743['queue'];this['calleridname']=_0x354743[_0xd406('0xe')];this[_0xd406('0xf')]=_0x354743[_0xd406('0xf')];this[_0xd406('0x10')]=_0x354743[_0xd406('0x10')];this[_0xd406('0x11')]=_0x354743['responsetime'];this[_0xd406('0x12')]=_0x354743[_0xd406('0x11')];this[_0xd406('0x13')]=_0x354743[_0xd406('0x13')]||0x0;this['holdtime']=_0x354743[_0xd406('0x14')]||0x0;this['talktime']=_0x354743['talktime']||0x0;this[_0xd406('0x15')]=_0x354743['callback'];this[_0xd406('0x16')]=_0x354743[_0xd406('0x16')];this[_0xd406('0x17')]=_0x354743[_0xd406('0x17')];this['recallme']=_0x354743[_0xd406('0x18')];this[_0xd406('0x19')]=_0x354743[_0xd406('0x19')];this[_0xd406('0x1a')]=_0x354743[_0xd406('0x1a')];this['UserId']=_0x354743['UserId'];this[_0xd406('0x1b')]=_0x354743[_0xd406('0x1b')];this[_0xd406('0x1c')]=_0x354743[_0xd406('0x1c')];this[_0xd406('0x1d')]=_0x354743[_0xd406('0x1d')]||'';this[_0xd406('0x1e')]=_0x354743[_0xd406('0x1e')]||'';this['state']=_0x354743[_0xd406('0x1f')];this['statedesc']=_0x354743[_0xd406('0x20')];}module[_0xd406('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 59a996e..bdeb78b 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x283c=['uniqueid','calleridname','calleridnum','number','starttime','responsetime','endtime','format','ringtime','getSeconds','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','moment','state','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry'];(function(_0x4f3d00,_0x188abc){var _0x484889=function(_0x13eb9c){while(--_0x13eb9c){_0x4f3d00['push'](_0x4f3d00['shift']());}};_0x484889(++_0x188abc);}(_0x283c,0x1dc));var _0xc283=function(_0x11aa09,_0x504728){_0x11aa09=_0x11aa09-0x0;var _0x45b455=_0x283c[_0x11aa09];return _0x45b455;};'use strict';var moment=require(_0xc283('0x0'));var utils=require('../utils');function Hangup(_0x5db70a,_0x58f5fa){this[_0xc283('0x1')]=0x4;this['statedesc']='Answer';this[_0xc283('0x2')]=_0x5db70a[_0xc283('0x2')];this[_0xc283('0x3')]=_0x5db70a['type'];this[_0xc283('0x4')]=_0x5db70a[_0xc283('0x3')]===_0xc283('0x5')?_0xc283('0x6'):_0x5db70a[_0xc283('0x3')];this['amd']=_0x5db70a['amd']||![];this['countbusyretry']=_0x5db70a[_0xc283('0x7')];this[_0xc283('0x8')]=_0x5db70a['countcongestionretry'];this[_0xc283('0x9')]=_0x5db70a[_0xc283('0x9')];this[_0xc283('0xa')]=_0x5db70a['countbusyretry']+_0x5db70a['countcongestionretry']+_0x5db70a['countnoanswerretry']+_0x5db70a[_0xc283('0xb')]+_0x5db70a[_0xc283('0xc')]+_0x5db70a[_0xc283('0xd')]+_0x5db70a['countmachineretry']+_0x5db70a[_0xc283('0xe')];this[_0xc283('0xb')]=_0x5db70a[_0xc283('0xb')];this[_0xc283('0xc')]=_0x5db70a[_0xc283('0xc')];this['countabandonedretry']=_0x5db70a['countabandonedretry'];this['countmachineretry']=_0x5db70a[_0xc283('0xf')];this['countagentrejectretry']=_0x5db70a[_0xc283('0xe')];this[_0xc283('0x10')]=_0x58f5fa[_0xc283('0x10')];this[_0xc283('0x11')]=_0x5db70a['name'];this[_0xc283('0x12')]=_0x5db70a[_0xc283('0x13')];this[_0xc283('0x14')]=_0x5db70a[_0xc283('0x14')];this[_0xc283('0x15')]=_0x5db70a[_0xc283('0x15')];this[_0xc283('0x16')]=moment()[_0xc283('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc283('0x18')]=utils[_0xc283('0x19')](_0x5db70a[_0xc283('0x15')],_0x5db70a[_0xc283('0x14')]);this['holdtime']=0x0;this[_0xc283('0x1a')]=utils[_0xc283('0x19')](this['endtime'],_0x5db70a[_0xc283('0x15')]);this[_0xc283('0x6')]=_0x5db70a[_0xc283('0x6')];this[_0xc283('0x1b')]=_0xc283('0x1c');this[_0xc283('0x1d')]=_0x58f5fa[_0xc283('0x1e')];this[_0xc283('0x1f')]=_0x5db70a[_0xc283('0x1f')];this[_0xc283('0x20')]=_0x5db70a[_0xc283('0x20')];this[_0xc283('0x21')]=_0x5db70a[_0xc283('0x21')];this['recallme']=_0x5db70a[_0xc283('0x22')];this['ContactId']=_0x5db70a[_0xc283('0x23')];this[_0xc283('0x24')]=_0x5db70a[_0xc283('0x24')];this['UserId']=_0x5db70a[_0xc283('0x25')];this[_0xc283('0x26')]=_0x5db70a[_0xc283('0x26')];this['CampaignId']=_0x5db70a[_0xc283('0x27')];}module[_0xc283('0x28')]=Hangup; \ No newline at end of file +var _0x7191=['queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','holdtime','talktime','endtime','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','exports','moment','../utils','state','statedesc','Answer','scheduledat','campaigntype','type'];(function(_0xd2709e,_0x27a3b1){var _0x11fda3=function(_0x4d4314){while(--_0x4d4314){_0xd2709e['push'](_0xd2709e['shift']());}};_0x11fda3(++_0x27a3b1);}(_0x7191,0x1bb));var _0x1719=function(_0x2170aa,_0x3b50f0){_0x2170aa=_0x2170aa-0x0;var _0x41ec22=_0x7191[_0x2170aa];return _0x41ec22;};'use strict';var moment=require(_0x1719('0x0'));var utils=require(_0x1719('0x1'));function Hangup(_0x798c3a,_0x59d246){this[_0x1719('0x2')]=0x4;this[_0x1719('0x3')]=_0x1719('0x4');this[_0x1719('0x5')]=_0x798c3a[_0x1719('0x5')];this['type']=_0x798c3a['type'];this[_0x1719('0x6')]=_0x798c3a[_0x1719('0x7')]==='outbound'?_0x1719('0x8'):_0x798c3a[_0x1719('0x7')];this['amd']=_0x798c3a[_0x1719('0x9')]||![];this[_0x1719('0xa')]=_0x798c3a[_0x1719('0xa')];this['countcongestionretry']=_0x798c3a[_0x1719('0xb')];this[_0x1719('0xc')]=_0x798c3a[_0x1719('0xc')];this[_0x1719('0xd')]=_0x798c3a['countbusyretry']+_0x798c3a[_0x1719('0xb')]+_0x798c3a['countnoanswerretry']+_0x798c3a[_0x1719('0xe')]+_0x798c3a[_0x1719('0xf')]+_0x798c3a[_0x1719('0x10')]+_0x798c3a[_0x1719('0x11')]+_0x798c3a[_0x1719('0x12')];this[_0x1719('0xe')]=_0x798c3a[_0x1719('0xe')];this[_0x1719('0xf')]=_0x798c3a[_0x1719('0xf')];this[_0x1719('0x10')]=_0x798c3a[_0x1719('0x10')];this[_0x1719('0x11')]=_0x798c3a[_0x1719('0x11')];this['countagentrejectretry']=_0x798c3a[_0x1719('0x12')];this[_0x1719('0x13')]=_0x59d246[_0x1719('0x13')];this['calleridname']=_0x798c3a[_0x1719('0x14')];this['calleridnum']=_0x798c3a[_0x1719('0x15')];this['starttime']=_0x798c3a[_0x1719('0x16')];this[_0x1719('0x17')]=_0x798c3a[_0x1719('0x17')];this['endtime']=moment()[_0x1719('0x18')](_0x1719('0x19'));this[_0x1719('0x1a')]=utils[_0x1719('0x1b')](_0x798c3a[_0x1719('0x17')],_0x798c3a[_0x1719('0x16')]);this[_0x1719('0x1c')]=0x0;this[_0x1719('0x1d')]=utils['getSeconds'](this[_0x1719('0x1e')],_0x798c3a[_0x1719('0x17')]);this['queue']=_0x798c3a[_0x1719('0x8')];this['membername']='IVR';this['reason']=_0x59d246[_0x1719('0x1f')];this[_0x1719('0x20')]=_0x798c3a['callback'];this['callbackuniqueid']=_0x798c3a[_0x1719('0x21')];this['callbackat']=_0x798c3a[_0x1719('0x22')];this[_0x1719('0x23')]=_0x798c3a[_0x1719('0x23')];this[_0x1719('0x24')]=_0x798c3a[_0x1719('0x24')];this['ListId']=_0x798c3a[_0x1719('0x25')];this['UserId']=_0x798c3a[_0x1719('0x26')];this['VoiceQueueId']=_0x798c3a['VoiceQueueId'];this[_0x1719('0x27')]=_0x798c3a['CampaignId'];}module[_0x1719('0x28')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index 90c4087..226209f 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d0b=['countabandonedretry','countdropretry','countmachineretry','countagentrejectretry','queue','name','starttime','responsetime','endtime','ringtime','getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','uniqueid','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x2f192b,_0xa2fa34){var _0x1c981f=function(_0x50d904){while(--_0x50d904){_0x2f192b['push'](_0x2f192b['shift']());}};_0x1c981f(++_0xa2fa34);}(_0x6d0b,0x11e));var _0xb6d0=function(_0x11cc46,_0x62fd01){_0x11cc46=_0x11cc46-0x0;var _0x38f87c=_0x6d0b[_0x11cc46];return _0x38f87c;};'use strict';var utils=require(_0xb6d0('0x0'));function History(_0x4afbe4){this[_0xb6d0('0x1')]=_0x4afbe4[_0xb6d0('0x1')];this['scheduledat']=_0x4afbe4['scheduledat']||undefined;this['type']=_0x4afbe4[_0xb6d0('0x2')];this[_0xb6d0('0x3')]=_0x4afbe4[_0xb6d0('0x2')]===_0xb6d0('0x4')?'queue':_0x4afbe4[_0xb6d0('0x2')];this[_0xb6d0('0x5')]=_0x4afbe4[_0xb6d0('0x5')];this[_0xb6d0('0x6')]=_0x4afbe4[_0xb6d0('0x6')];this['countnoanswerretry']=_0x4afbe4[_0xb6d0('0x7')];this[_0xb6d0('0x8')]=_0x4afbe4['countbusyretry']+_0x4afbe4[_0xb6d0('0x6')]+_0x4afbe4['countnoanswerretry']+_0x4afbe4[_0xb6d0('0x9')]+_0x4afbe4['countdropretry']+_0x4afbe4[_0xb6d0('0xa')]+_0x4afbe4['countmachineretry']+_0x4afbe4['countagentrejectretry'];this['countnosuchnumberretry']=_0x4afbe4['countnosuchnumberretry'];this['countdropretry']=_0x4afbe4[_0xb6d0('0xb')];this[_0xb6d0('0xa')]=_0x4afbe4[_0xb6d0('0xa')];this[_0xb6d0('0xc')]=_0x4afbe4[_0xb6d0('0xc')];this[_0xb6d0('0xd')]=_0x4afbe4['countagentrejectretry'];this[_0xb6d0('0xe')]=_0x4afbe4[_0xb6d0('0xe')];this['calleridname']=_0x4afbe4[_0xb6d0('0xf')];this['calleridnum']=_0x4afbe4['number'];this[_0xb6d0('0x10')]=_0x4afbe4['starttime'];this[_0xb6d0('0x11')]=_0x4afbe4[_0xb6d0('0x11')];this[_0xb6d0('0x12')]=_0x4afbe4[_0xb6d0('0x11')];this[_0xb6d0('0x13')]=utils[_0xb6d0('0x14')](_0x4afbe4['responsetime'],_0x4afbe4[_0xb6d0('0x10')]);this[_0xb6d0('0x15')]=0x0;this[_0xb6d0('0x16')]=0x0;this[_0xb6d0('0x17')]=_0x4afbe4[_0xb6d0('0x17')];this[_0xb6d0('0x18')]=_0x4afbe4[_0xb6d0('0x18')];this[_0xb6d0('0x19')]=_0x4afbe4[_0xb6d0('0x19')];this[_0xb6d0('0x1a')]=_0x4afbe4[_0xb6d0('0x1a')];this[_0xb6d0('0x1b')]=_0x4afbe4[_0xb6d0('0x1b')];this[_0xb6d0('0x1c')]=_0x4afbe4[_0xb6d0('0x1c')];this[_0xb6d0('0x1d')]=_0x4afbe4[_0xb6d0('0x1d')];this[_0xb6d0('0x1e')]=_0x4afbe4[_0xb6d0('0x1e')];this['CampaignId']=_0x4afbe4[_0xb6d0('0x1f')];this[_0xb6d0('0x20')]=_0x4afbe4['originatecalleridnum']||'';this[_0xb6d0('0x21')]=_0x4afbe4[_0xb6d0('0x21')]||'';this['state']=_0x4afbe4[_0xb6d0('0x22')];this[_0xb6d0('0x23')]=_0x4afbe4[_0xb6d0('0x23')];}module[_0xb6d0('0x24')]=History; \ No newline at end of file +var _0x9cc8=['getSeconds','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','queue','name','calleridnum','number','starttime','ringtime'];(function(_0x189b3b,_0x484de8){var _0x7c4721=function(_0x1ca32b){while(--_0x1ca32b){_0x189b3b['push'](_0x189b3b['shift']());}};_0x7c4721(++_0x484de8);}(_0x9cc8,0xc5));var _0x89cc=function(_0x56a825,_0x78fe73){_0x56a825=_0x56a825-0x0;var _0x480149=_0x9cc8[_0x56a825];return _0x480149;};'use strict';var utils=require(_0x89cc('0x0'));function History(_0x4523eb){this['uniqueid']=_0x4523eb['uniqueid'];this['scheduledat']=_0x4523eb[_0x89cc('0x1')]||undefined;this['type']=_0x4523eb[_0x89cc('0x2')];this[_0x89cc('0x3')]=_0x4523eb[_0x89cc('0x2')]===_0x89cc('0x4')?'queue':_0x4523eb[_0x89cc('0x2')];this[_0x89cc('0x5')]=_0x4523eb[_0x89cc('0x5')];this[_0x89cc('0x6')]=_0x4523eb['countcongestionretry'];this[_0x89cc('0x7')]=_0x4523eb[_0x89cc('0x7')];this['countglobal']=_0x4523eb[_0x89cc('0x5')]+_0x4523eb[_0x89cc('0x6')]+_0x4523eb[_0x89cc('0x7')]+_0x4523eb[_0x89cc('0x8')]+_0x4523eb[_0x89cc('0x9')]+_0x4523eb[_0x89cc('0xa')]+_0x4523eb[_0x89cc('0xb')]+_0x4523eb[_0x89cc('0xc')];this[_0x89cc('0x8')]=_0x4523eb['countnosuchnumberretry'];this[_0x89cc('0x9')]=_0x4523eb[_0x89cc('0x9')];this[_0x89cc('0xa')]=_0x4523eb['countabandonedretry'];this[_0x89cc('0xb')]=_0x4523eb[_0x89cc('0xb')];this[_0x89cc('0xc')]=_0x4523eb[_0x89cc('0xc')];this[_0x89cc('0xd')]=_0x4523eb[_0x89cc('0xd')];this['calleridname']=_0x4523eb[_0x89cc('0xe')];this[_0x89cc('0xf')]=_0x4523eb[_0x89cc('0x10')];this['starttime']=_0x4523eb[_0x89cc('0x11')];this['responsetime']=_0x4523eb['responsetime'];this['endtime']=_0x4523eb['responsetime'];this[_0x89cc('0x12')]=utils[_0x89cc('0x13')](_0x4523eb['responsetime'],_0x4523eb[_0x89cc('0x11')]);this[_0x89cc('0x14')]=0x0;this[_0x89cc('0x15')]=0x0;this[_0x89cc('0x16')]=_0x4523eb[_0x89cc('0x16')];this[_0x89cc('0x17')]=_0x4523eb['callbackuniqueid'];this[_0x89cc('0x18')]=_0x4523eb[_0x89cc('0x18')];this[_0x89cc('0x19')]=_0x4523eb[_0x89cc('0x19')];this[_0x89cc('0x1a')]=_0x4523eb['ContactId'];this[_0x89cc('0x1b')]=_0x4523eb[_0x89cc('0x1b')];this['UserId']=_0x4523eb[_0x89cc('0x1c')];this[_0x89cc('0x1d')]=_0x4523eb['VoiceQueueId'];this[_0x89cc('0x1e')]=_0x4523eb['CampaignId'];this['originatecalleridnum']=_0x4523eb[_0x89cc('0x1f')]||'';this[_0x89cc('0x20')]=_0x4523eb[_0x89cc('0x20')]||'';this['state']=_0x4523eb[_0x89cc('0x21')];this[_0x89cc('0x22')]=_0x4523eb[_0x89cc('0x22')];}module[_0x89cc('0x23')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 9c2342b..2149325 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfd70=['queue','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','../utils','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','dropreason','holdtime','talktime'];(function(_0x3f0bd7,_0x16284c){var _0x1cbb2f=function(_0x4888d3){while(--_0x4888d3){_0x3f0bd7['push'](_0x3f0bd7['shift']());}};_0x1cbb2f(++_0x16284c);}(_0xfd70,0x195));var _0x0fd7=function(_0x589aee,_0x140a03){_0x589aee=_0x589aee-0x0;var _0x2f5ed4=_0xfd70[_0x589aee];return _0x2f5ed4;};'use strict';var utils=require(_0x0fd7('0x0'));function QueueCallerAbandon(_0x208fd4,_0x207801){this[_0x0fd7('0x1')]=_0x208fd4[_0x0fd7('0x1')];this[_0x0fd7('0x2')]=_0x208fd4[_0x0fd7('0x2')];this[_0x0fd7('0x3')]=_0x208fd4[_0x0fd7('0x2')]===_0x0fd7('0x4')?'queue':_0x208fd4[_0x0fd7('0x2')];this[_0x0fd7('0x5')]=_0x208fd4[_0x0fd7('0x5')];this[_0x0fd7('0x6')]=_0x208fd4[_0x0fd7('0x6')];this[_0x0fd7('0x7')]=_0x208fd4[_0x0fd7('0x7')];this['countglobal']=_0x208fd4['countbusyretry']+_0x208fd4[_0x0fd7('0x6')]+_0x208fd4[_0x0fd7('0x7')]+_0x208fd4[_0x0fd7('0x8')]+_0x208fd4[_0x0fd7('0x9')]+_0x208fd4[_0x0fd7('0xa')]+_0x208fd4['countmachineretry']+_0x208fd4[_0x0fd7('0xb')];this['countnosuchnumberretry']=_0x208fd4[_0x0fd7('0x8')];this[_0x0fd7('0x9')]=_0x208fd4[_0x0fd7('0x9')];this[_0x0fd7('0xa')]=_0x208fd4[_0x0fd7('0xa')];this[_0x0fd7('0xc')]=_0x208fd4['countmachineretry'];this[_0x0fd7('0xb')]=_0x208fd4['countagentrejectretry'];this[_0x0fd7('0xd')]=_0x207801[_0x0fd7('0xd')];this[_0x0fd7('0xe')]=_0x208fd4[_0x0fd7('0xf')];this[_0x0fd7('0x10')]=_0x208fd4[_0x0fd7('0x11')];this['starttime']=_0x208fd4[_0x0fd7('0x12')];this[_0x0fd7('0x13')]=_0x208fd4[_0x0fd7('0x13')];this[_0x0fd7('0x14')]=_0x208fd4[_0x0fd7('0x14')];this[_0x0fd7('0x15')]=_0x208fd4[_0x0fd7('0x15')];this['endtime']=this[_0x0fd7('0x14')];this['ringtime']=utils['getSeconds'](_0x208fd4[_0x0fd7('0x13')],_0x208fd4[_0x0fd7('0x12')]);this[_0x0fd7('0x16')]=utils['getSeconds'](this[_0x0fd7('0x14')],_0x208fd4[_0x0fd7('0x13')]);this[_0x0fd7('0x17')]=0x0;this[_0x0fd7('0x18')]=_0x207801[_0x0fd7('0x18')];this[_0x0fd7('0x19')]=_0x207801['connectedlinename'];this[_0x0fd7('0x1a')]=_0x207801[_0x0fd7('0x1a')];this[_0x0fd7('0x1b')]=_0x208fd4[_0x0fd7('0x1b')];this[_0x0fd7('0x1c')]=_0x208fd4[_0x0fd7('0x1c')];this['callbackat']=_0x208fd4[_0x0fd7('0x1d')];this['recallme']=_0x208fd4['recallme'];this['ContactId']=_0x208fd4[_0x0fd7('0x1e')];this[_0x0fd7('0x1f')]=_0x208fd4[_0x0fd7('0x1f')];this['UserId']=_0x208fd4['UserId'];this[_0x0fd7('0x20')]=_0x208fd4['VoiceQueueId'];this[_0x0fd7('0x21')]=_0x208fd4[_0x0fd7('0x21')];this[_0x0fd7('0x22')]=_0x208fd4[_0x0fd7('0x22')]||'';this[_0x0fd7('0x23')]=_0x208fd4['originatecalleridname']||'';this[_0x0fd7('0x24')]=_0x208fd4['agiafterat'];this[_0x0fd7('0x25')]=_0x208fd4[_0x0fd7('0x25')];this[_0x0fd7('0x26')]=_0x208fd4['statedesc'];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x2f59=['countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','dropreason','ringtime','holdtime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2f59,0x157));var _0x92f5=function(_0x33968f,_0x19e029){_0x33968f=_0x33968f-0x0;var _0x3ca1e5=_0x2f59[_0x33968f];return _0x3ca1e5;};'use strict';var utils=require(_0x92f5('0x0'));function QueueCallerAbandon(_0x1cd5f8,_0x4906cc){this[_0x92f5('0x1')]=_0x1cd5f8[_0x92f5('0x1')];this['type']=_0x1cd5f8[_0x92f5('0x2')];this[_0x92f5('0x3')]=_0x1cd5f8['type']===_0x92f5('0x4')?_0x92f5('0x5'):_0x1cd5f8[_0x92f5('0x2')];this['countbusyretry']=_0x1cd5f8[_0x92f5('0x6')];this[_0x92f5('0x7')]=_0x1cd5f8[_0x92f5('0x7')];this[_0x92f5('0x8')]=_0x1cd5f8['countnoanswerretry'];this[_0x92f5('0x9')]=_0x1cd5f8[_0x92f5('0x6')]+_0x1cd5f8[_0x92f5('0x7')]+_0x1cd5f8[_0x92f5('0x8')]+_0x1cd5f8[_0x92f5('0xa')]+_0x1cd5f8[_0x92f5('0xb')]+_0x1cd5f8['countabandonedretry']+_0x1cd5f8[_0x92f5('0xc')]+_0x1cd5f8[_0x92f5('0xd')];this[_0x92f5('0xa')]=_0x1cd5f8['countnosuchnumberretry'];this[_0x92f5('0xb')]=_0x1cd5f8['countdropretry'];this[_0x92f5('0xe')]=_0x1cd5f8['countabandonedretry'];this['countmachineretry']=_0x1cd5f8[_0x92f5('0xc')];this[_0x92f5('0xd')]=_0x1cd5f8[_0x92f5('0xd')];this[_0x92f5('0xf')]=_0x4906cc['uniqueid'];this[_0x92f5('0x10')]=_0x1cd5f8['name'];this[_0x92f5('0x11')]=_0x1cd5f8[_0x92f5('0x12')];this[_0x92f5('0x13')]=_0x1cd5f8['starttime'];this['responsetime']=_0x1cd5f8[_0x92f5('0x14')];this[_0x92f5('0x15')]=_0x1cd5f8[_0x92f5('0x15')];this[_0x92f5('0x16')]=_0x1cd5f8[_0x92f5('0x16')];this['endtime']=this[_0x92f5('0x15')];this[_0x92f5('0x17')]=utils['getSeconds'](_0x1cd5f8['responsetime'],_0x1cd5f8[_0x92f5('0x13')]);this[_0x92f5('0x18')]=utils[_0x92f5('0x19')](this[_0x92f5('0x15')],_0x1cd5f8['responsetime']);this[_0x92f5('0x1a')]=0x0;this[_0x92f5('0x5')]=_0x4906cc[_0x92f5('0x5')];this[_0x92f5('0x1b')]=_0x4906cc[_0x92f5('0x1c')];this[_0x92f5('0x1d')]=_0x4906cc[_0x92f5('0x1d')];this[_0x92f5('0x1e')]=_0x1cd5f8[_0x92f5('0x1e')];this['callbackuniqueid']=_0x1cd5f8[_0x92f5('0x1f')];this[_0x92f5('0x20')]=_0x1cd5f8['callbackat'];this['recallme']=_0x1cd5f8[_0x92f5('0x21')];this['ContactId']=_0x1cd5f8['ContactId'];this[_0x92f5('0x22')]=_0x1cd5f8[_0x92f5('0x22')];this[_0x92f5('0x23')]=_0x1cd5f8[_0x92f5('0x23')];this[_0x92f5('0x24')]=_0x1cd5f8[_0x92f5('0x24')];this[_0x92f5('0x25')]=_0x1cd5f8[_0x92f5('0x25')];this[_0x92f5('0x26')]=_0x1cd5f8[_0x92f5('0x26')]||'';this[_0x92f5('0x27')]=_0x1cd5f8[_0x92f5('0x27')]||'';this['agiafterat']=_0x1cd5f8[_0x92f5('0x28')];this[_0x92f5('0x29')]=_0x1cd5f8[_0x92f5('0x29')];this['statedesc']=_0x1cd5f8[_0x92f5('0x2a')];}module[_0x92f5('0x2b')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index d4ec640..45fe84b 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['countReScheduled','[countReScheduled]','rescheduleContact','unlockContact','[unlockContact]','moveContactManagedDialer','[checkIsBlackList]','checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','../../../../config/logger','../../rpc/cmHopper','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperBlack','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]'];(function(_0x5e18c1,_0x1af0ee){var _0x265be5=function(_0x2f4a36){while(--_0x2f4a36){_0x5e18c1['push'](_0x5e18c1['shift']());}};_0x265be5(++_0x1af0ee);}(_0xadb5,0xad));var _0x5adb=function(_0x51e937,_0x40087b){_0x51e937=_0x51e937-0x0;var _0x1ac29e=_0xadb5[_0x51e937];return _0x1ac29e;};'use strict';var util=require('util');var logger=require(_0x5adb('0x0'))('dialer');var cmHopper=require(_0x5adb('0x1'));var cmHopperAdditionalPhone=require(_0x5adb('0x2'));var cmHopperBlack=require(_0x5adb('0x3'));var cmHopperHistory=require('../../rpc/cmHopperHistory');function inspectError(_0x248dc6){return util[_0x5adb('0x4')](_0x248dc6,{'showHidden':![],'depth':null});}function getContactDialer(_0x2e3ef4,_0x4cb1d1,_0x35a5d3){return cmHopper[_0x5adb('0x5')](_0x2e3ef4['id'],_0x4cb1d1,_0x35a5d3,_0x2e3ef4[_0x5adb('0x6')])[_0x5adb('0x7')](function(_0xdf3776){_0x2e3ef4[_0x5adb('0x8')]=0x0;logger[_0x5adb('0x9')](_0x5adb('0xa'),inspectError(_0xdf3776));});}exports[_0x5adb('0x5')]=getContactDialer;function getContactDialerIvr(_0x7293ab,_0x34f59d){return cmHopper[_0x5adb('0xb')](_0x7293ab['id'],_0x34f59d,_0x7293ab[_0x5adb('0x6')])[_0x5adb('0x7')](function(_0x563d86){_0x7293ab['temp']=0x0;logger[_0x5adb('0x9')](_0x5adb('0xc'),inspectError(_0x563d86));});}exports[_0x5adb('0xb')]=getContactDialerIvr;function countReScheduled(_0x53b772){return cmHopper[_0x5adb('0xd')](_0x53b772)['catch'](function(_0x2a0b70){logger['error'](_0x5adb('0xe'),inspectError(_0x2a0b70));});}exports[_0x5adb('0xd')]=countReScheduled;function rescheduleContact(_0x44abe3){return cmHopper['rescheduleContact'](_0x44abe3)[_0x5adb('0x7')](function(_0x34af2c){logger[_0x5adb('0x9')]('[rescheduleContact]',inspectError(_0x34af2c));});}exports[_0x5adb('0xf')]=rescheduleContact;function unlockContact(_0x518823,_0x367d82,_0x42a482){return cmHopper[_0x5adb('0x10')](_0x518823,_0x367d82,_0x42a482)[_0x5adb('0x7')](function(_0x1c0f97){logger[_0x5adb('0x9')](_0x5adb('0x11'),inspectError(_0x1c0f97));});}exports[_0x5adb('0x10')]=unlockContact;function moveContactManagedDialer(_0xb953a6){return cmHopper['moveContactManagedDialer'](_0xb953a6)[_0x5adb('0x7')](function(_0x5de028){logger[_0x5adb('0x9')]('[moveContactManagedDialer]',inspectError(_0x5de028));});}exports[_0x5adb('0x12')]=moveContactManagedDialer;function checkIsBlackList(_0x50e84f){return cmHopperBlack['checkIsBlackList'](_0x50e84f)[_0x5adb('0x7')](function(_0x1bed20){logger[_0x5adb('0x9')](_0x5adb('0x13'),inspectError(_0x1bed20));});}exports[_0x5adb('0x14')]=checkIsBlackList;function checkIsBlackListIvr(_0x5af69d){return cmHopperBlack[_0x5adb('0x15')](_0x5af69d)['catch'](function(_0x4e9f16){logger[_0x5adb('0x9')](_0x5adb('0x16'),inspectError(_0x4e9f16));});}exports[_0x5adb('0x15')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x1a8014,_0x1e9ccf,_0x413911){return cmHopperAdditionalPhone[_0x5adb('0x17')](_0x1a8014,_0x1e9ccf,_0x413911)['catch'](function(_0x4b1957){logger[_0x5adb('0x9')](_0x5adb('0x18'),inspectError(_0x4b1957));});}exports[_0x5adb('0x17')]=verifyAdditionalPhones;function swapAdditionalPhones(_0xeb556c,_0x49f203,_0x2fee18){return cmHopperAdditionalPhone[_0x5adb('0x19')](_0xeb556c,_0x49f203,_0x2fee18)['catch'](function(_0x1feecf){logger[_0x5adb('0x9')](_0x5adb('0x1a'),inspectError(_0x1feecf));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x13ad1d){return cmHopperHistory[_0x5adb('0x1b')](_0x13ad1d)[_0x5adb('0x7')](function(_0x2c64a3){logger[_0x5adb('0x9')](_0x5adb('0x1c'),inspectError(_0x2c64a3));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x49992e){return cmHopperHistory['createHistory'](_0x49992e)[_0x5adb('0x7')](function(_0x1eac55){logger[_0x5adb('0x9')](_0x5adb('0x1d'),inspectError(_0x1eac55));});}exports[_0x5adb('0x1e')]=createHistory; \ No newline at end of file +var _0x6d11=['checkIsBlackList','checkIsBlackListIvr','[checkIsBlackListIvr]','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','createHistory','[createHistory]','util','../../../../config/logger','dialer','../../rpc/cmHopperAdditionalPhone','../../rpc/cmHopperHistory','getContactDialer','dialOrderByScheduledAt','catch','temp','getContactDialerIvr','error','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','moveContactManagedDialer','[moveContactManagedDialer]'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6d11,0xbf));var _0x16d1=function(_0x52d4ee,_0x64e207){_0x52d4ee=_0x52d4ee-0x0;var _0x51d053=_0x6d11[_0x52d4ee];return _0x51d053;};'use strict';var util=require(_0x16d1('0x0'));var logger=require(_0x16d1('0x1'))(_0x16d1('0x2'));var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require(_0x16d1('0x3'));var cmHopperBlack=require('../../rpc/cmHopperBlack');var cmHopperHistory=require(_0x16d1('0x4'));function inspectError(_0x2e1a35){return util['inspect'](_0x2e1a35,{'showHidden':![],'depth':null});}function getContactDialer(_0x48754e,_0x3e0e86,_0x46f7d7){return cmHopper[_0x16d1('0x5')](_0x48754e['id'],_0x3e0e86,_0x46f7d7,_0x48754e[_0x16d1('0x6')])[_0x16d1('0x7')](function(_0x150217){_0x48754e[_0x16d1('0x8')]=0x0;logger['error']('[getContactDialer]',inspectError(_0x150217));});}exports['getContactDialer']=getContactDialer;function getContactDialerIvr(_0x3275c8,_0xcfbb15){return cmHopper[_0x16d1('0x9')](_0x3275c8['id'],_0xcfbb15,_0x3275c8[_0x16d1('0x6')])['catch'](function(_0x265a84){_0x3275c8[_0x16d1('0x8')]=0x0;logger[_0x16d1('0xa')](_0x16d1('0xb'),inspectError(_0x265a84));});}exports[_0x16d1('0x9')]=getContactDialerIvr;function countReScheduled(_0x20edf8){return cmHopper[_0x16d1('0xc')](_0x20edf8)[_0x16d1('0x7')](function(_0x4de260){logger[_0x16d1('0xa')](_0x16d1('0xd'),inspectError(_0x4de260));});}exports[_0x16d1('0xc')]=countReScheduled;function rescheduleContact(_0x32351b){return cmHopper[_0x16d1('0xe')](_0x32351b)['catch'](function(_0xc034b7){logger[_0x16d1('0xa')](_0x16d1('0xf'),inspectError(_0xc034b7));});}exports[_0x16d1('0xe')]=rescheduleContact;function unlockContact(_0x29ebba,_0x173e16,_0x2d7e8a){return cmHopper['unlockContact'](_0x29ebba,_0x173e16,_0x2d7e8a)[_0x16d1('0x7')](function(_0x2b399c){logger['error']('[unlockContact]',inspectError(_0x2b399c));});}exports[_0x16d1('0x10')]=unlockContact;function moveContactManagedDialer(_0x47c245){return cmHopper[_0x16d1('0x11')](_0x47c245)['catch'](function(_0x1da1b8){logger['error'](_0x16d1('0x12'),inspectError(_0x1da1b8));});}exports[_0x16d1('0x11')]=moveContactManagedDialer;function checkIsBlackList(_0x48cd70){return cmHopperBlack['checkIsBlackList'](_0x48cd70)['catch'](function(_0x5b9599){logger[_0x16d1('0xa')]('[checkIsBlackList]',inspectError(_0x5b9599));});}exports[_0x16d1('0x13')]=checkIsBlackList;function checkIsBlackListIvr(_0x7887d5){return cmHopperBlack[_0x16d1('0x14')](_0x7887d5)[_0x16d1('0x7')](function(_0x54b3a6){logger[_0x16d1('0xa')](_0x16d1('0x15'),inspectError(_0x54b3a6));});}exports[_0x16d1('0x14')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x585ce5,_0x3fc99e,_0x8c7266){return cmHopperAdditionalPhone[_0x16d1('0x16')](_0x585ce5,_0x3fc99e,_0x8c7266)[_0x16d1('0x7')](function(_0x215c23){logger[_0x16d1('0xa')](_0x16d1('0x17'),inspectError(_0x215c23));});}exports[_0x16d1('0x16')]=verifyAdditionalPhones;function swapAdditionalPhones(_0x3f8436,_0x335c24,_0x4b2b5c){return cmHopperAdditionalPhone[_0x16d1('0x18')](_0x3f8436,_0x335c24,_0x4b2b5c)[_0x16d1('0x7')](function(_0x262f89){logger[_0x16d1('0xa')](_0x16d1('0x19'),inspectError(_0x262f89));});}exports['swapAdditionalPhones']=swapAdditionalPhones;function avgHandleTime(_0x25ae4e){return cmHopperHistory[_0x16d1('0x1a')](_0x25ae4e)[_0x16d1('0x7')](function(_0x49fc1b){logger[_0x16d1('0xa')](_0x16d1('0x1b'),inspectError(_0x49fc1b));});}exports[_0x16d1('0x1a')]=avgHandleTime;function createHistory(_0x22e5b3){return cmHopperHistory[_0x16d1('0x1c')](_0x22e5b3)[_0x16d1('0x7')](function(_0x1dd574){logger['error'](_0x16d1('0x1d'),inspectError(_0x1dd574));});}exports[_0x16d1('0x1c')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index a23c62f..bc6a924 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52c3=['lodash','util','../../../../config/logger','dialer','../../../../config/environment/shared','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','type','ivr','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','isIVRCampaignActive','milliseconds','diff','seconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','isNil','Interval','Intervals','NULL_INTERVAL','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','status','TrunkBackup','ACTIVE','INACTIVE','DISACTIVED','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','getCallerId','pow','replace','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','length','checkContactEmpty','erlangb','tags','updatedAt','undefined','description','XMD-','toUpperCase','setXMDContactVariables'];(function(_0x342696,_0x146f50){var _0x15b8e4=function(_0x591e2a){while(--_0x591e2a){_0x342696['push'](_0x342696['shift']());}};_0x15b8e4(++_0x146f50);}(_0x52c3,0xaa));var _0x352c=function(_0x2f0057,_0x448b27){_0x2f0057=_0x2f0057-0x0;var _0x17f2c3=_0x52c3[_0x2f0057];return _0x17f2c3;};'use strict';var _=require(_0x352c('0x0'));var moment=require('moment');var util=require(_0x352c('0x1'));var logger=require(_0x352c('0x2'))(_0x352c('0x3'));var timezones=require(_0x352c('0x4'))['timezones'];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x352c('0x5'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x352c('0x6'),'DISACTIVED':_0x352c('0x7'),'EMPTY_INTERVAL':_0x352c('0x8'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x352c('0x9'),'NULL_INTERVAL':_0x352c('0xa'),'OVERTIME_INTERVAL':_0x352c('0xb'),'OVERTIME_GLOBAL_INTERVAL':_0x352c('0xc'),'QUEUE_RECALL':'RECALLINQUEUE','RECALL_TIMEOUT':_0x352c('0xd'),'RUNNING':_0x352c('0xe'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0x352c('0xf')};exports[_0x352c('0x10')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x14c7f8){return _0x14c7f8[_0x352c('0x11')]===_0x352c('0x12');}exports['isPreviewCampaign']=isPreviewCampaign;function isIVRCampaign(_0x500763){return _0x500763[_0x352c('0x13')]===_0x352c('0x14');}exports['isIVRCampaign']=isIVRCampaign;function isOutboundQueue(_0x320d06){return _0x320d06['type']===_0x352c('0x15');}exports[_0x352c('0x16')]=isOutboundQueue;function isQueueCampaignActive(_0x31cb80){return _0x31cb80[_0x352c('0x17')];}exports[_0x352c('0x18')]=isQueueCampaignActive;function isIVRCampaignActive(_0x4ea42c){return _0x4ea42c[_0x352c('0x19')];}exports[_0x352c('0x1a')]=isIVRCampaignActive;function getSeconds(_0x538e64,_0x2c6644){var _0x151252=moment(_0x538e64)[_0x352c('0x1b')](0x0);var _0xa2d03f=moment(_0x2c6644)[_0x352c('0x1b')](0x0);return _0x151252[_0x352c('0x1c')](_0xa2d03f,_0x352c('0x1d'));}exports['getSeconds']=getSeconds;function hasQueueCampaignDataChanged(_0x21bd9d,_0x5a6235){var _0x3f1f0d=![];var _0x25d4c4=_0x21bd9d[_0x352c('0x11')]!==_0x5a6235[_0x352c('0x11')]||_0x21bd9d['dialActive']!==_0x5a6235[_0x352c('0x17')]||_0x21bd9d[_0x352c('0x1e')]!==_0x5a6235['message'];var _0x47faf9=_0x21bd9d[_0x352c('0x1f')]!==_0x5a6235['available']||_0x21bd9d[_0x352c('0x20')]!==_0x5a6235['loggedIn']||_0x21bd9d['loggedInDb']!==_0x5a6235[_0x352c('0x21')]||_0x21bd9d[_0x352c('0x22')]!==_0x5a6235[_0x352c('0x22')]||_0x21bd9d[_0x352c('0x23')]!==_0x5a6235[_0x352c('0x23')]||_0x21bd9d[_0x352c('0x24')]!==_0x5a6235['pTalking']||_0x21bd9d[_0x352c('0x25')]!==_0x5a6235[_0x352c('0x25')]||_0x21bd9d[_0x352c('0x26')]!==_0x5a6235[_0x352c('0x26')]||_0x21bd9d[_0x352c('0x27')]!==_0x5a6235[_0x352c('0x27')];if(_0x21bd9d[_0x352c('0x28')]&&_0x5a6235[_0x352c('0x28')]){_0x3f1f0d=_0x21bd9d[_0x352c('0x28')]['name']!==_0x5a6235[_0x352c('0x28')][_0x352c('0x29')]||_0x21bd9d[_0x352c('0x28')][_0x352c('0x19')]!==_0x5a6235[_0x352c('0x28')][_0x352c('0x19')];}return _0x25d4c4||_0x47faf9||_0x3f1f0d;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x22e35f){var _0x14cfe9=null;var _0x2e4827=_0x22e35f['dialTimezone'];if(_['isNil'](_0x22e35f['dialGlobalInterval'])||_[_0x352c('0x2a')](_0x22e35f[_0x352c('0x2b')])||_['isNil'](_0x22e35f[_0x352c('0x2b')][_0x352c('0x2c')])){_0x14cfe9=CAMPAIGN_STATUS[_0x352c('0x2d')];}else if(_['isEmpty'](_0x22e35f[_0x352c('0x2e')])||_['isEmpty'](_0x22e35f[_0x352c('0x2b')][_0x352c('0x2c')])){_0x14cfe9=CAMPAIGN_STATUS[_0x352c('0x2f')];}else if(_0x2e4827&&!timezones[_0x2e4827]){_0x14cfe9=CAMPAIGN_STATUS[_0x352c('0x30')];}return _0x14cfe9;}function checkAnyValidTrunk(_0x22c1ea,_0x2e0131){var _0x4f72ed=null;var _0x56d7b4=_0x352c('0x31');var _0x41ef99=[_0x352c('0x32'),_0x352c('0x33')];var _0x515466=!![];if(_0x22c1ea[_0x352c('0x28')]&&_0x22c1ea[_0x352c('0x28')][_0x352c('0x19')]){_0x56d7b4+=_0x22c1ea[_0x352c('0x28')]['name'];_0x4f72ed=_0x2e0131[_0x56d7b4];_0x515466=_0x41ef99[_0x352c('0x34')](_0x4f72ed[_0x352c('0x35')]);}else if(_0x22c1ea[_0x352c('0x36')]&&_0x22c1ea[_0x352c('0x36')][_0x352c('0x19')]){_0x56d7b4+=_0x22c1ea[_0x352c('0x36')]['name'];_0x4f72ed=_0x2e0131[_0x56d7b4];_0x515466=_0x41ef99[_0x352c('0x34')](_0x4f72ed['status']);}return _0x515466;}function getQueueCampaignStatusMessage(_0x500d95,_0x58e139){var _0x433bf8=CAMPAIGN_STATUS[_0x352c('0x37')];var _0xb12b69=isPreviewCampaign(_0x500d95);if(!isQueueCampaignActive(_0x500d95)){if(_0xb12b69){_0x433bf8=CAMPAIGN_STATUS[_0x352c('0x38')];}else{if(_0x500d95['originated']===0x0&&_0x500d95[_0x352c('0x23')]===0x0&&_0x500d95['waiting']===0x0&&(_0x500d95[_0x352c('0x24')]||0x0)===0x0){_0x433bf8=CAMPAIGN_STATUS[_0x352c('0x38')];}else{_0x433bf8=CAMPAIGN_STATUS[_0x352c('0x39')];}}}else if(_0x500d95[_0x352c('0x20')]===0x0){_0x433bf8=CAMPAIGN_STATUS[_0x352c('0x3a')];}else if(!checkAnyValidTrunk(_0x500d95,_0x58e139)){_0x433bf8=CAMPAIGN_STATUS[_0x352c('0x3b')];}else if(!isPreviewCampaign(_0x500d95)){var _0x303acf=checkAnyValidQueueCampaignInterval(_0x500d95);if(_0x303acf){_0x433bf8=_0x303acf;}}return _0x433bf8;}exports[_0x352c('0x3c')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2e1532){var _0x28c877=CAMPAIGN_STATUS[_0x352c('0x39')];if(_0x2e1532[_0x352c('0x27')]===0x0&&_0x2e1532[_0x352c('0x23')]===0x0&&_0x2e1532['waiting']===0x0&&(_0x2e1532['pTalking']||0x0)===0x0){_0x28c877=CAMPAIGN_STATUS[_0x352c('0x38')];}return _0x28c877;}exports[_0x352c('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x3c4320){var _0xc58a8a=_0x3c4320['match'](/"(.*?)"/);return _0xc58a8a?_0xc58a8a[0x1]:_0x3c4320;}exports[_0x352c('0x3e')]=extractCalleridName;function getCallerId(_0x119539,_0x19eee4,_0x1073d1){if(!_[_0x352c('0x3f')](_0x1073d1)&&typeof _0x1073d1===_0x352c('0x40')&&!_[_0x352c('0x41')](_0x1073d1)){if(!_[_0x352c('0x3f')](_0x19eee4)&&typeof _0x19eee4===_0x352c('0x40')&&!_[_0x352c('0x41')](_0x19eee4)){return util[_0x352c('0x42')](_0x352c('0x43'),_0x19eee4,_0x1073d1);}return util[_0x352c('0x42')]('\x22%s\x22\x20<%s>',_0x1073d1,_0x1073d1);}if(!_[_0x352c('0x3f')](_0x119539)&&typeof _0x119539==='string'&&!_[_0x352c('0x41')](_0x119539)){return _0x119539;}return _0x352c('0x44');}exports[_0x352c('0x45')]=getCallerId;function getCallerIdRandom(_0x3b1902,_0x67b27c){var _0x5811ae;var _0x14f5f8;var _0x33c53b;if(_0x67b27c<=0x0){_0x67b27c=0x1;}_0x5811ae=new RegExp('\x5cw{0,'+_0x67b27c+'}$');_0x14f5f8=Math[_0x352c('0x46')](0xa,_0x67b27c-0x1);_0x33c53b=Math[_0x352c('0x46')](0xa,_0x67b27c)-0x1;return util[_0x352c('0x42')]('%s',_[_0x352c('0x47')](_0x3b1902,_0x5811ae,_['random'](_0x14f5f8,_0x33c53b)[_0x352c('0x48')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x42e1ab){if(_0x42e1ab['originated']&&_0x42e1ab[_0x352c('0x27')]>0x0){_0x42e1ab[_0x352c('0x27')]-=0x1;}else{logger[_0x352c('0x49')](_0x352c('0x4a'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x5dd363){return _0x5dd363&&_0x5dd363[_0x352c('0x4b')]>0x0;}exports[_0x352c('0x4c')]=checkContactEmpty;function erlangb(_0x440f77,_0x15e34c){if(_0x15e34c===0x0){return 0x0;}var _0x53fe7a=0x1;for(var _0x585f6a=0x1;_0x585f6a<=_0x15e34c;_0x585f6a+=0x1){_0x53fe7a=0x1+_0x53fe7a*_0x585f6a/_0x440f77;}return 0x1/_0x53fe7a;}exports[_0x352c('0x4d')]=erlangb;function checkContactLowerLimitOriginate(_0x1f1bf0,_0x50912b,_0x104210){if(_0x50912b>_0x104210){for(var _0x5a8a42=0x0;_0x5a8a42<_0x50912b-_0x104210;_0x5a8a42+=0x1){decrementOriginate(_0x1f1bf0);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x10da65){var _0x51e076={};var _0x4fe82e=['id','createdAt',_0x352c('0x4e'),_0x352c('0x4f')];const _0x4b3174=0xfa;if(_0x10da65){for(var _0x4a33a9 in _0x10da65){if(typeof _0x10da65[_0x4a33a9]!==_0x352c('0x50')){if(!_[_0x352c('0x2a')](_0x10da65[_0x4a33a9])&&!_0x4fe82e[_0x352c('0x34')](_0x4a33a9)){if(_0x4a33a9===_0x352c('0x51')&&_0x10da65[_0x4a33a9][_0x352c('0x4b')]>_0x4b3174){_0x51e076[_0x352c('0x52')+_0x4a33a9[_0x352c('0x53')]()]=_0x10da65[_0x4a33a9]['toString']()['substring'](0x0,_0x4b3174);}else{_0x51e076[_0x352c('0x52')+_0x4a33a9['toUpperCase']()]=_0x10da65[_0x4a33a9];}}}}}return _0x51e076;}exports[_0x352c('0x54')]=setXMDContactVariables; \ No newline at end of file +var _0x3bd8=['name','hasQueueCampaignDataChanged','isNil','dialGlobalInterval','Interval','Intervals','NULL_INTERVAL','isEmpty','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','includes','TrunkBackup','status','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','getQueueCampaignActiveStatusMessage','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','random','toString','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','checkContactEmpty','checkContactLowerLimitOriginate','createdAt','tags','undefined','description','length','toUpperCase','substring','XMD-','lodash','moment','util','../../../../config/logger','../../../../config/environment/shared','timezones','BLACKLIST','DEACTIVATED','IS_DISACTIVED','INTERVAL_IS_EMPTY','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_OVERTIME','RECALLINQUEUE','RUNNING','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','isIVRCampaign','outbound','isOutboundQueue','dialActive','isQueueCampaignActive','active','milliseconds','diff','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk'];(function(_0x55df6c,_0x3a6851){var _0x7c9e7e=function(_0xb1e15f){while(--_0xb1e15f){_0x55df6c['push'](_0x55df6c['shift']());}};_0x7c9e7e(++_0x3a6851);}(_0x3bd8,0xd4));var _0x83bd=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x3bd8[_0x299784];return _0x5ab008;};'use strict';var _=require(_0x83bd('0x0'));var moment=require(_0x83bd('0x1'));var util=require(_0x83bd('0x2'));var logger=require(_0x83bd('0x3'))('dialer');var timezones=require(_0x83bd('0x4'))[_0x83bd('0x5')];var CAMPAIGN_STATUS={'ACTIVE':'ACTIVE','BLACKLIST':_0x83bd('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0x83bd('0x7'),'DISACTIVED':_0x83bd('0x8'),'EMPTY_INTERVAL':_0x83bd('0x9'),'INACTIVE':'NOT_ACTIVE','NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0x83bd('0xa'),'NULL_INTERVAL':'INTERVAL_IS_NULL','OVERTIME_INTERVAL':_0x83bd('0xb'),'OVERTIME_GLOBAL_INTERVAL':'GLOBAL_INTERVAL_IS_OVERTIME','QUEUE_RECALL':_0x83bd('0xc'),'RECALL_TIMEOUT':'RECALLFAILEDTIMEOUT','RUNNING':_0x83bd('0xd'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':'TRUNK_IS_NOT_REACHABLE'};exports[_0x83bd('0xe')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x1461b6){return _0x1461b6[_0x83bd('0xf')]===_0x83bd('0x10');}exports[_0x83bd('0x11')]=isPreviewCampaign;function isIVRCampaign(_0xbd1819){return _0xbd1819[_0x83bd('0x12')]==='ivr';}exports[_0x83bd('0x13')]=isIVRCampaign;function isOutboundQueue(_0x5d865a){return _0x5d865a[_0x83bd('0x12')]===_0x83bd('0x14');}exports[_0x83bd('0x15')]=isOutboundQueue;function isQueueCampaignActive(_0x5a382a){return _0x5a382a[_0x83bd('0x16')];}exports[_0x83bd('0x17')]=isQueueCampaignActive;function isIVRCampaignActive(_0x5b375f){return _0x5b375f[_0x83bd('0x18')];}exports['isIVRCampaignActive']=isIVRCampaignActive;function getSeconds(_0x220885,_0x515ca4){var _0x59bfce=moment(_0x220885)[_0x83bd('0x19')](0x0);var _0x32ea33=moment(_0x515ca4)[_0x83bd('0x19')](0x0);return _0x59bfce[_0x83bd('0x1a')](_0x32ea33,_0x83bd('0x1b'));}exports[_0x83bd('0x1c')]=getSeconds;function hasQueueCampaignDataChanged(_0x51c785,_0x119bf2){var _0x112df7=![];var _0x43369b=_0x51c785[_0x83bd('0xf')]!==_0x119bf2[_0x83bd('0xf')]||_0x51c785[_0x83bd('0x16')]!==_0x119bf2['dialActive']||_0x51c785[_0x83bd('0x1d')]!==_0x119bf2['message'];var _0x4a1455=_0x51c785['available']!==_0x119bf2[_0x83bd('0x1e')]||_0x51c785[_0x83bd('0x1f')]!==_0x119bf2['loggedIn']||_0x51c785['loggedInDb']!==_0x119bf2[_0x83bd('0x20')]||_0x51c785[_0x83bd('0x21')]!==_0x119bf2[_0x83bd('0x21')]||_0x51c785['talking']!==_0x119bf2[_0x83bd('0x22')]||_0x51c785[_0x83bd('0x23')]!==_0x119bf2[_0x83bd('0x23')]||_0x51c785[_0x83bd('0x24')]!==_0x119bf2[_0x83bd('0x24')]||_0x51c785[_0x83bd('0x25')]!==_0x119bf2[_0x83bd('0x25')]||_0x51c785[_0x83bd('0x26')]!==_0x119bf2['originated'];if(_0x51c785['Trunk']&&_0x119bf2[_0x83bd('0x27')]){_0x112df7=_0x51c785['Trunk'][_0x83bd('0x28')]!==_0x119bf2[_0x83bd('0x27')][_0x83bd('0x28')]||_0x51c785[_0x83bd('0x27')][_0x83bd('0x18')]!==_0x119bf2[_0x83bd('0x27')][_0x83bd('0x18')];}return _0x43369b||_0x4a1455||_0x112df7;}exports[_0x83bd('0x29')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x16575f){var _0x19d893=null;var _0x33a4fc=_0x16575f['dialTimezone'];if(_[_0x83bd('0x2a')](_0x16575f[_0x83bd('0x2b')])||_[_0x83bd('0x2a')](_0x16575f[_0x83bd('0x2c')])||_['isNil'](_0x16575f[_0x83bd('0x2c')][_0x83bd('0x2d')])){_0x19d893=CAMPAIGN_STATUS[_0x83bd('0x2e')];}else if(_['isEmpty'](_0x16575f[_0x83bd('0x2b')])||_[_0x83bd('0x2f')](_0x16575f[_0x83bd('0x2c')][_0x83bd('0x2d')])){_0x19d893=CAMPAIGN_STATUS[_0x83bd('0x30')];}else if(_0x33a4fc&&!timezones[_0x33a4fc]){_0x19d893=CAMPAIGN_STATUS[_0x83bd('0x31')];}return _0x19d893;}function checkAnyValidTrunk(_0x37a595,_0x4d708a){var _0x17c52=null;var _0x7481f3=_0x83bd('0x32');var _0x589c9a=[_0x83bd('0x33'),_0x83bd('0x34')];var _0x1380ae=!![];if(_0x37a595['Trunk']&&_0x37a595[_0x83bd('0x27')]['active']){_0x7481f3+=_0x37a595[_0x83bd('0x27')][_0x83bd('0x28')];_0x17c52=_0x4d708a[_0x7481f3];_0x1380ae=_0x589c9a[_0x83bd('0x35')](_0x17c52['status']);}else if(_0x37a595[_0x83bd('0x36')]&&_0x37a595[_0x83bd('0x36')]['active']){_0x7481f3+=_0x37a595[_0x83bd('0x36')][_0x83bd('0x28')];_0x17c52=_0x4d708a[_0x7481f3];_0x1380ae=_0x589c9a[_0x83bd('0x35')](_0x17c52[_0x83bd('0x37')]);}return _0x1380ae;}function getQueueCampaignStatusMessage(_0x14f858,_0x2deb12){var _0x21b4b6=CAMPAIGN_STATUS['ACTIVE'];var _0x4978e7=isPreviewCampaign(_0x14f858);if(!isQueueCampaignActive(_0x14f858)){if(_0x4978e7){_0x21b4b6=CAMPAIGN_STATUS['INACTIVE'];}else{if(_0x14f858[_0x83bd('0x26')]===0x0&&_0x14f858['talking']===0x0&&_0x14f858[_0x83bd('0x24')]===0x0&&(_0x14f858[_0x83bd('0x23')]||0x0)===0x0){_0x21b4b6=CAMPAIGN_STATUS[_0x83bd('0x38')];}else{_0x21b4b6=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x14f858[_0x83bd('0x1f')]===0x0){_0x21b4b6=CAMPAIGN_STATUS[_0x83bd('0x39')];}else if(!checkAnyValidTrunk(_0x14f858,_0x2deb12)){_0x21b4b6=CAMPAIGN_STATUS[_0x83bd('0x3a')];}else if(!isPreviewCampaign(_0x14f858)){var _0x135384=checkAnyValidQueueCampaignInterval(_0x14f858);if(_0x135384){_0x21b4b6=_0x135384;}}return _0x21b4b6;}exports[_0x83bd('0x3b')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x22b304){var _0x16495b=CAMPAIGN_STATUS[_0x83bd('0x3c')];if(_0x22b304[_0x83bd('0x26')]===0x0&&_0x22b304[_0x83bd('0x22')]===0x0&&_0x22b304[_0x83bd('0x24')]===0x0&&(_0x22b304[_0x83bd('0x23')]||0x0)===0x0){_0x16495b=CAMPAIGN_STATUS[_0x83bd('0x38')];}return _0x16495b;}exports[_0x83bd('0x3d')]=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x6e3908){var _0x15670b=_0x6e3908['match'](/"(.*?)"/);return _0x15670b?_0x15670b[0x1]:_0x6e3908;}exports[_0x83bd('0x3e')]=extractCalleridName;function getCallerId(_0x42b4d1,_0x12fe91,_0x8a8ef8){if(!_[_0x83bd('0x3f')](_0x8a8ef8)&&typeof _0x8a8ef8==='string'&&!_[_0x83bd('0x2f')](_0x8a8ef8)){if(!_[_0x83bd('0x3f')](_0x12fe91)&&typeof _0x12fe91===_0x83bd('0x40')&&!_['isEmpty'](_0x12fe91)){return util[_0x83bd('0x41')](_0x83bd('0x42'),_0x12fe91,_0x8a8ef8);}return util[_0x83bd('0x41')](_0x83bd('0x42'),_0x8a8ef8,_0x8a8ef8);}if(!_[_0x83bd('0x3f')](_0x42b4d1)&&typeof _0x42b4d1===_0x83bd('0x40')&&!_[_0x83bd('0x2f')](_0x42b4d1)){return _0x42b4d1;}return'\x22\x22\x20<>';}exports[_0x83bd('0x43')]=getCallerId;function getCallerIdRandom(_0x19b148,_0x32da19){var _0x3582ac;var _0x3e3d3f;var _0x23cf98;if(_0x32da19<=0x0){_0x32da19=0x1;}_0x3582ac=new RegExp(_0x83bd('0x44')+_0x32da19+'}$');_0x3e3d3f=Math['pow'](0xa,_0x32da19-0x1);_0x23cf98=Math[_0x83bd('0x45')](0xa,_0x32da19)-0x1;return util[_0x83bd('0x41')]('%s',_['replace'](_0x19b148,_0x3582ac,_[_0x83bd('0x46')](_0x3e3d3f,_0x23cf98)[_0x83bd('0x47')]()));}exports['getCallerIdRandom']=getCallerIdRandom;function decrementOriginate(_0x4c41fd){if(_0x4c41fd[_0x83bd('0x26')]&&_0x4c41fd[_0x83bd('0x26')]>0x0){_0x4c41fd[_0x83bd('0x26')]-=0x1;}else{logger[_0x83bd('0x48')](_0x83bd('0x49'));}}exports['decrementOriginate']=decrementOriginate;function checkContactEmpty(_0x5d7320){return _0x5d7320&&_0x5d7320['length']>0x0;}exports[_0x83bd('0x4a')]=checkContactEmpty;function erlangb(_0x21c828,_0x445d42){if(_0x445d42===0x0){return 0x0;}var _0x12b693=0x1;for(var _0x3ca8f0=0x1;_0x3ca8f0<=_0x445d42;_0x3ca8f0+=0x1){_0x12b693=0x1+_0x12b693*_0x3ca8f0/_0x21c828;}return 0x1/_0x12b693;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x33f67a,_0x429535,_0x291312){if(_0x429535>_0x291312){for(var _0x441bc2=0x0;_0x441bc2<_0x429535-_0x291312;_0x441bc2+=0x1){decrementOriginate(_0x33f67a);}}}exports[_0x83bd('0x4b')]=checkContactLowerLimitOriginate;function setXMDContactVariables(_0x117d59){var _0x6fa015={};var _0x274a52=['id',_0x83bd('0x4c'),_0x83bd('0x4d'),'updatedAt'];const _0x1cf17e=0xfa;if(_0x117d59){for(var _0x14ed63 in _0x117d59){if(typeof _0x117d59[_0x14ed63]!==_0x83bd('0x4e')){if(!_[_0x83bd('0x2a')](_0x117d59[_0x14ed63])&&!_0x274a52[_0x83bd('0x35')](_0x14ed63)){if(_0x14ed63===_0x83bd('0x4f')&&_0x117d59[_0x14ed63][_0x83bd('0x50')]>_0x1cf17e){_0x6fa015['XMD-'+_0x14ed63[_0x83bd('0x51')]()]=_0x117d59[_0x14ed63][_0x83bd('0x47')]()[_0x83bd('0x52')](0x0,_0x1cf17e);}else{_0x6fa015[_0x83bd('0x53')+_0x14ed63[_0x83bd('0x51')]()]=_0x117d59[_0x14ed63];}}}}}return _0x6fa015;}exports['setXMDContactVariables']=setXMDContactVariables; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 360695f..31d9a52 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(_0x16be86,_0x2f2d10){var _0x3c118f=function(_0x3bd8c6){while(--_0x3bd8c6){_0x16be86['push'](_0x16be86['shift']());}};_0x3c118f(++_0x2f2d10);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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(_0x13aa55,_0x5d6228){var _0x47d9fd=function(_0x2e7cc0){while(--_0x2e7cc0){_0x13aa55['push'](_0x13aa55['shift']());}};_0x47d9fd(++_0x5d6228);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'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 9899eb3..aba759e 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 _0x6625=['\x20notify\x20','stringify','\x20receiveFax\x20','response','reason','AttachmentId','update','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','message','Fax\x20received','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Is\x20Valid','exports','util','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','syncNewState','newexten','syncNewExten','faxstatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','channels','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','create','parse','.pdf','application/pdf','then','notify','catch','error'];(function(_0x40ce01,_0x1e39c8){var _0xa0f16e=function(_0x2356ad){while(--_0x2356ad){_0x40ce01['push'](_0x40ce01['shift']());}};_0xa0f16e(++_0x1e39c8);}(_0x6625,0x11b));var _0x5662=function(_0x452f2e,_0x4b90aa){_0x452f2e=_0x452f2e-0x0;var _0xba0230=_0x6625[_0x452f2e];return _0xba0230;};'use strict';var util=require(_0x5662('0x0'));var _=require(_0x5662('0x1'));var BPromise=require(_0x5662('0x2'));var uuid=require('uuid');var moment=require(_0x5662('0x3'));var path=require(_0x5662('0x4'));var tiff2pdf=require(_0x5662('0x5'));var gs=require(_0x5662('0x6'));var logger=require(_0x5662('0x7'))(_0x5662('0x8'));var ami=require(_0x5662('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x5662('0xa'));var ut=require('./util/util');var Action=require('./action');var faxAccount=require(_0x5662('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x5662('0xc'));function Fax(_0x576290){this['channels']={};this[_0x5662('0xd')]=_0x576290['faxAccounts'];this[_0x5662('0xe')]=_0x576290[_0x5662('0xe')];this['actions']={};ami['on'](_0x5662('0xf'),this[_0x5662('0x10')][_0x5662('0x11')](this));ami['on'](_0x5662('0x12'),this[_0x5662('0x13')][_0x5662('0x11')](this));ami['on']('newstate',this[_0x5662('0x14')][_0x5662('0x11')](this));ami['on'](_0x5662('0x15'),this[_0x5662('0x16')][_0x5662('0x11')](this));ami['on'](_0x5662('0x17'),this['syncFaxStatus'][_0x5662('0x11')](this));ami['on'](_0x5662('0x18'),this[_0x5662('0x19')][_0x5662('0x11')](this));ami['on'](_0x5662('0x1a'),this[_0x5662('0x1b')][_0x5662('0x11')](this));ami['on'](_0x5662('0x1c'),this[_0x5662('0x1d')][_0x5662('0x11')](this));}Fax[_0x5662('0x1e')]['syncNewchannel']=function(_0x58c84d){if(_0x58c84d[_0x5662('0x1f')]===_0x5662('0x20')){for(var _0x47f3cd in this[_0x5662('0xd')]){if(this[_0x5662('0xd')][_0x5662('0x21')](_0x47f3cd)){if(_0x58c84d[_0x5662('0x22')]===this[_0x5662('0xd')][_0x47f3cd][_0x5662('0x23')]){this[_0x5662('0x24')][_0x58c84d[_0x5662('0x25')]]={};this['channels'][_0x58c84d['uniqueid']][_0x5662('0x26')]=_0x58c84d[_0x5662('0x26')];this[_0x5662('0x24')][_0x58c84d[_0x5662('0x25')]]['id']=this[_0x5662('0xd')][_0x47f3cd]['id'];this[_0x5662('0x24')][_0x58c84d['uniqueid']]['name']=this[_0x5662('0xd')][_0x47f3cd][_0x5662('0x27')];logger[_0x5662('0x28')](_0x58c84d[_0x5662('0x25')],_0x5662('0x29'));}}}}if(this[_0x5662('0x2a')][_0x58c84d[_0x5662('0x25')]]){this[_0x5662('0x24')][_0x58c84d[_0x5662('0x25')]]={};this[_0x5662('0x24')][_0x58c84d[_0x5662('0x25')]][_0x5662('0x26')]=_0x58c84d['channel'];logger[_0x5662('0x28')](_0x58c84d[_0x5662('0x25')],_0x5662('0x29'));}};Fax[_0x5662('0x1e')][_0x5662('0x13')]=function(_0x2c833b){if(this[_0x5662('0x24')][_0x2c833b[_0x5662('0x25')]]){for(var _0x529d19 in _0x2c833b[_0x5662('0x2b')]){if(_0x2c833b[_0x5662('0x2b')][_0x5662('0x21')](_0x529d19)){this[_0x5662('0x24')][_0x2c833b['uniqueid']][_0x529d19]=_0x2c833b[_0x5662('0x2c')];}}}};Fax[_0x5662('0x1e')]['syncNewState']=function(_0x5b3e1c){if(this[_0x5662('0x24')][_0x5b3e1c[_0x5662('0x25')]]){this['channels'][_0x5b3e1c[_0x5662('0x25')]][_0x5662('0x2d')]=_0x5b3e1c[_0x5662('0x2d')];this[_0x5662('0x24')][_0x5b3e1c[_0x5662('0x25')]][_0x5662('0x2e')]=_0x5b3e1c[_0x5662('0x2e')];}};Fax[_0x5662('0x1e')]['syncNewExten']=function(_0x441846){if(this[_0x5662('0x24')][_0x441846[_0x5662('0x25')]]){for(var _0x5e39b0 in _0x441846[_0x5662('0x2b')]){if(_0x441846[_0x5662('0x2b')][_0x5662('0x21')](_0x5e39b0)){this[_0x5662('0x24')][_0x441846[_0x5662('0x25')]][_0x5e39b0]=_0x441846[_0x5662('0x2c')];}}}};Fax['prototype']['syncFaxStatus']=function(_0x1b6d14){if(this[_0x5662('0x24')][_0x1b6d14[_0x5662('0x25')]]){this[_0x5662('0x24')][_0x1b6d14['uniqueid']][_0x5662('0x2f')]=_0x1b6d14[_0x5662('0x2f')];this[_0x5662('0x24')][_0x1b6d14['uniqueid']][_0x5662('0x30')]=_0x1b6d14[_0x5662('0x30')];this[_0x5662('0x24')][_0x1b6d14[_0x5662('0x25')]]['localstationid']=_0x1b6d14[_0x5662('0x23')];this[_0x5662('0x24')][_0x1b6d14[_0x5662('0x25')]]['filename']=_0x1b6d14[_0x5662('0x31')];logger['info'](_0x1b6d14['uniqueid'],_0x5662('0x32'));}};Fax['prototype'][_0x5662('0x19')]=function(_0x329941){var _0x1714aa=this;if(this[_0x5662('0x24')][_0x329941[_0x5662('0x25')]]){var _0x2388f0=this[_0x5662('0x24')][_0x329941[_0x5662('0x25')]]['id'];this[_0x5662('0x24')][_0x329941[_0x5662('0x25')]]['remotestationid']=_0x329941[_0x5662('0x33')];this[_0x5662('0x24')][_0x329941[_0x5662('0x25')]][_0x5662('0x34')]=_0x329941[_0x5662('0x34')];this['channels'][_0x329941[_0x5662('0x25')]][_0x5662('0x23')]=_0x329941[_0x5662('0x23')];this[_0x5662('0x24')][_0x329941['uniqueid']][_0x5662('0x35')]=_0x329941[_0x5662('0x35')];this[_0x5662('0x24')][_0x329941['uniqueid']][_0x5662('0x36')]=_0x329941[_0x5662('0x36')];this[_0x5662('0x24')][_0x329941[_0x5662('0x25')]]['filename']=_0x329941[_0x5662('0x31')];this[_0x5662('0x24')][_0x329941['uniqueid']]['calleridnum']=_0x329941[_0x5662('0x37')];if(this[_0x5662('0x24')][_0x329941['uniqueid']][_0x5662('0x34')]>0x0){tiff2pdf(_0x329941['filename'],_0x5662('0x38'),function(_0x5856d0){logger[_0x5662('0x28')](_0x329941['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x5856d0['message']);attachment[_0x5662('0x39')]({'name':path[_0x5662('0x3a')](_0x329941[_0x5662('0x31')])['name'],'basename':path['parse'](_0x329941['filename'])['name']+_0x5662('0x3b'),'type':_0x5662('0x3c')})[_0x5662('0x3d')](function(_0x5a2eaf){faxAccount[_0x5662('0x3e')](_0x2388f0,{'from':_0x329941[_0x5662('0x37')],'mapKey':_0x5662('0x8'),'body':path[_0x5662('0x3a')](_0x329941[_0x5662('0x31')])[_0x5662('0x27')]+_0x5662('0x3b'),'AttachmentId':_0x5a2eaf['id']})[_0x5662('0x3f')](function(_0x4410a0){logger[_0x5662('0x40')](_0x329941[_0x5662('0x25')],_0x5662('0x41'),JSON[_0x5662('0x42')](_0x4410a0));});})[_0x5662('0x3f')](function(_0x2f8e3e){logger[_0x5662('0x40')](_0x329941[_0x5662('0x25')],_0x5662('0x43'),JSON[_0x5662('0x42')](_0x2f8e3e));});});}logger['info'](_0x329941[_0x5662('0x25')],_0x5662('0x43'));}};Fax[_0x5662('0x1e')][_0x5662('0x1d')]=function(_0x53ac1a){if(this[_0x5662('0x2a')][_0x53ac1a['uniqueid']]){_['merge'](this['channels'][_0x53ac1a[_0x5662('0x25')]],_['pick'](_0x53ac1a,[_0x5662('0x44'),_0x5662('0x45')]));}};function updateStatus(_0xfa130f){if(_0xfa130f[_0x5662('0x46')]){faxMessage[_0x5662('0x47')](_0xfa130f['AttachmentId'],{'failMessage':'SENDING\x20FAILED\x20'})['then'](function(_0x33d8fb){ut[_0x5662('0x48')](_0x5662('0x49'),_0x33d8fb);})['catch'](function(_0x3933d9){ut[_0x5662('0x48')](_0x5662('0x4a'),_0x3933d9);});}else{ut['logger'](_0x5662('0x4b'));}}Fax[_0x5662('0x1e')][_0x5662('0x4c')]=function(_0x197a47,_0x21d71e,_0x15d53b){var _0x253755=this;var _0x1c3f63={};if(_0x21d71e){_0x1c3f63={'read':_0x21d71e};}else{_0x1c3f63={'failMessage':_0x15d53b};}if(this['actions'][_0x197a47][_0x5662('0x46')]){faxMessage[_0x5662('0x47')](this[_0x5662('0x2a')][_0x197a47][_0x5662('0x46')],_0x1c3f63)[_0x5662('0x3d')](function(_0x225862){ut[_0x5662('0x48')](_0x5662('0x4d'),_0x225862);})[_0x5662('0x3f')](function(_0x88d5eb){ut['logger'](_0x5662('0x4e'),_0x88d5eb);})[_0x5662('0x4f')](function(){delete _0x253755[_0x5662('0x24')][_0x197a47];delete _0x253755[_0x5662('0x2a')][_0x197a47];});}else{ut[_0x5662('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x5662('0x24')][_0x197a47];delete this['actions'][_0x197a47];}};Fax[_0x5662('0x1e')][_0x5662('0x1b')]=function(_0x38d76e){var _0x2c67b5=this;if(this['channels'][_0x38d76e[_0x5662('0x25')]]){if(this[_0x5662('0x2a')][_0x38d76e[_0x5662('0x25')]]){this[_0x5662('0x24')][_0x38d76e[_0x5662('0x25')]]['id']=this[_0x5662('0x2a')][_0x38d76e['uniqueid']]['id'];this[_0x5662('0x24')][_0x38d76e[_0x5662('0x25')]][_0x5662('0x27')]=this[_0x5662('0x2a')][_0x38d76e['uniqueid']]['name'];}logger['info'](_0x38d76e[_0x5662('0x25')],this[_0x5662('0x2a')][_0x38d76e[_0x5662('0x25')]]?_0x5662('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x5662('0x42')](this[_0x5662('0x24')][_0x38d76e[_0x5662('0x25')]]));if(this['actions'][_0x38d76e['uniqueid']]){if(this['channels'][_0x38d76e[_0x5662('0x25')]][_0x5662('0x51')]>0x0&&this[_0x5662('0x24')][_0x38d76e[_0x5662('0x25')]][_0x5662('0x17')]==='SUCCESS'){this['updateStatus'](_0x38d76e[_0x5662('0x25')],!![]);}else{this[_0x5662('0x4c')](_0x38d76e[_0x5662('0x25')],![],this[_0x5662('0x24')][_0x38d76e[_0x5662('0x25')]][_0x5662('0x52')]?_0x5662('0x53')+this[_0x5662('0x24')][_0x38d76e[_0x5662('0x25')]][_0x5662('0x52')]:'SENDING\x20FAILED');}}}};Fax[_0x5662('0x1e')][_0x5662('0x54')]=function(_0x156b7b){var _0x129a3a=this;return new BPromise(function(_0x2327dd,_0x4a17cd){_0x129a3a[_0x5662('0x55')](_0x156b7b,_0x129a3a['faxAccounts'][_0x156b7b[_0x5662('0x56')]])['then'](function(_0x3adbe1){ut[_0x5662('0x48')]('[Fax][execOriginate][success]',_0x3adbe1);_0x2327dd(ut[_0x5662('0x57')](_0x5662('0x58')));})[_0x5662('0x3f')](function(_0x121e9a){ut[_0x5662('0x48')]('[Fax][execOriginate][failure]',_0x121e9a);updateStatus(_0x156b7b);_0x4a17cd(ut[_0x5662('0x57')](_0x5662('0x59')));});});};Fax[_0x5662('0x1e')][_0x5662('0x5a')]=function(_0x2c983c){var _0x11c3e2=this;return new BPromise(function(_0x49408b,_0x81162b){var _0x241060=_0x11c3e2[_0x5662('0x5b')](_0x11c3e2[_0x5662('0xd')][_0x2c983c[_0x5662('0x56')]][_0x5662('0x5c')],_0x2c983c);if(_0x241060[_0x5662('0x5d')]){_0x49408b(ut[_0x5662('0x57')](_0x5662('0x5e')));}else{_0x81162b(ut['message'](_0x241060[_0x5662('0x57')]));}});};function originate(_0x12a6e8,_0x221fab,_0x46140f){return new BPromise(function(_0x5704d1,_0x4c9fc5){if(_0x46140f){var _0x704486=util[_0x5662('0x5f')](_0x5662('0x60'),path['parse'](_0x12a6e8[_0x5662('0x4')])[_0x5662('0x27')],_0x12a6e8[_0x5662('0x4')]);gs[_0x5662('0x61')](_0x704486)[_0x5662('0x3d')](function(){_0x12a6e8['path']=util[_0x5662('0x5f')]('%s/%s.tif',path[_0x5662('0x3a')](_0x12a6e8[_0x5662('0x4')])[_0x5662('0x62')],path['parse'](_0x12a6e8[_0x5662('0x4')])[_0x5662('0x27')]);_0x221fab[_0x5662('0x63')]=_0x12a6e8[_0x5662('0x4')];ut[_0x5662('0x48')](_0x5662('0x64'),'');ami['Action'](ut[_0x5662('0x65')](_0x12a6e8,_0x221fab))[_0x5662('0x3d')](function(_0x135074){_0x5704d1(_0x135074);})['catch'](function(_0x358ca6){_0x4c9fc5(_0x358ca6);});})[_0x5662('0x3f')](function(_0x172cc2){_0x4c9fc5(_0x172cc2);});}else{ami['Action'](ut[_0x5662('0x65')](_0x12a6e8,_0x221fab))[_0x5662('0x3d')](function(_0x53fb30){_0x5704d1(_0x53fb30);})[_0x5662('0x3f')](function(_0x574830){_0x4c9fc5(_0x574830);});}});}Fax['prototype'][_0x5662('0x55')]=function(_0x27ac7a,_0x4415f9){var _0x5e081=this;return new BPromise(function(_0x5ee830,_0x16624f){var _0x2175bb=uuid['v4']();var _0x12e521=ut[_0x5662('0x66')](_0x27ac7a,_0x4415f9);_0x5e081[_0x5662('0x2a')][_0x2175bb]=new Action(_0x2175bb,_0x4415f9,_0x27ac7a);var _0x593fce=_0x5e081[_0x5662('0x2a')][_0x2175bb];if(path['parse'](_0x27ac7a[_0x5662('0x4')])[_0x5662('0x67')]===_0x5662('0x3b')){originate(_0x593fce,_0x12e521,!![])[_0x5662('0x3d')](function(_0x557eae){_0x5ee830(_0x557eae);})[_0x5662('0x3f')](function(_0x1747c6){_0x16624f(_0x1747c6);});}else{originate(_0x593fce,_0x12e521,![])[_0x5662('0x3d')](function(_0x1ea0bd){_0x5ee830(_0x1ea0bd);})[_0x5662('0x3f')](function(_0x19d68f){_0x16624f(_0x19d68f);});}});};Fax['prototype'][_0x5662('0x68')]=function(_0x3cf651){return!_[_0x5662('0x69')](_0x3cf651)&&!_[_0x5662('0x69')](_0x3cf651['name'])&&!_[_0x5662('0x69')](_0x3cf651[_0x5662('0x6a')])&&_0x3cf651['active']&&!_[_0x5662('0x69')](this[_0x5662('0xe')][util[_0x5662('0x5f')](_0x5662('0x6b'),_0x3cf651[_0x5662('0x27')])])&&!_[_0x5662('0x69')](this[_0x5662('0xe')][util['format'](_0x5662('0x6b'),_0x3cf651[_0x5662('0x27')])][_0x5662('0x30')])&&(this[_0x5662('0xe')][util['format'](_0x5662('0x6b'),_0x3cf651[_0x5662('0x27')])][_0x5662('0x30')]===_0x5662('0x6c')||this['trunks'][util['format']('SIP/%s',_0x3cf651[_0x5662('0x27')])]['status']===_0x5662('0x6d'));};Fax[_0x5662('0x1e')][_0x5662('0x5b')]=function(_0x126c07,_0x2d85cf){if(!this[_0x5662('0x68')](_0x126c07)){ut['logger'](_0x5662('0x6e'),_[_0x5662('0x69')](_0x126c07)?'':_0x126c07[_0x5662('0x27')]+_0x5662('0x6f'));return{'isValid':![],'message':_0x5662('0x70')};}if(_[_0x5662('0x69')](_0x2d85cf[_0x5662('0x8')])){ut['logger'](_0x5662('0x71'),JSON[_0x5662('0x42')](_0x2d85cf));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x5662('0x69')](_0x2d85cf[_0x5662('0x4')])){ut[_0x5662('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x5662('0x42')](_0x2d85cf));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x5662('0x72')};};module[_0x5662('0x73')]=Fax; \ No newline at end of file +var _0x2a84=['status','filename','\x20syncFaxStatus\x20','syncReceiveFax','pagestransferred','resolution','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','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','isNil','active','SIP/%s','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','uuid','path','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','syncNewState','channelstate','channelstatedesc','operation'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2a84,0x194));var _0x42a8=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2a84[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x42a8('0x0'));var _=require('lodash');var BPromise=require('bluebird');var uuid=require(_0x42a8('0x1'));var moment=require('moment');var path=require(_0x42a8('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require('./util/gs');var logger=require(_0x42a8('0x3'))(_0x42a8('0x4'));var ami=require(_0x42a8('0x5'));var rpcDb=require(_0x42a8('0x6'));var Channel=require(_0x42a8('0x7'));var ut=require(_0x42a8('0x8'));var Action=require(_0x42a8('0x9'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x42a8('0xa'));var faxMessage=require(_0x42a8('0xb'));function Fax(_0x1b0dca){this[_0x42a8('0xc')]={};this[_0x42a8('0xd')]=_0x1b0dca[_0x42a8('0xd')];this['trunks']=_0x1b0dca[_0x42a8('0xe')];this[_0x42a8('0xf')]={};ami['on'](_0x42a8('0x10'),this[_0x42a8('0x11')][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x13'),this['syncVarSet']['bind'](this));ami['on'](_0x42a8('0x14'),this['syncNewState'][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x15'),this[_0x42a8('0x16')][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x17'),this[_0x42a8('0x18')][_0x42a8('0x12')](this));ami['on'](_0x42a8('0x19'),this['syncReceiveFax'][_0x42a8('0x12')](this));ami['on']('hangup',this[_0x42a8('0x1a')]['bind'](this));ami['on']('originateresponse',this[_0x42a8('0x1b')]['bind'](this));}Fax[_0x42a8('0x1c')][_0x42a8('0x11')]=function(_0x583738){if(_0x583738[_0x42a8('0x1d')]===_0x42a8('0x1e')){for(var _0xda70ab in this[_0x42a8('0xd')]){if(this[_0x42a8('0xd')][_0x42a8('0x1f')](_0xda70ab)){if(_0x583738['exten']===this[_0x42a8('0xd')][_0xda70ab][_0x42a8('0x20')]){this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]]={};this[_0x42a8('0xc')][_0x583738['uniqueid']][_0x42a8('0x22')]=_0x583738[_0x42a8('0x22')];this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]]['id']=this[_0x42a8('0xd')][_0xda70ab]['id'];this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]][_0x42a8('0x23')]=this[_0x42a8('0xd')][_0xda70ab][_0x42a8('0x23')];logger[_0x42a8('0x24')](_0x583738[_0x42a8('0x21')],'\x20syncNewchannel\x20');}}}}if(this[_0x42a8('0xf')][_0x583738['uniqueid']]){this[_0x42a8('0xc')][_0x583738['uniqueid']]={};this[_0x42a8('0xc')][_0x583738[_0x42a8('0x21')]]['channel']=_0x583738[_0x42a8('0x22')];logger[_0x42a8('0x24')](_0x583738[_0x42a8('0x21')],_0x42a8('0x25'));}};Fax[_0x42a8('0x1c')]['syncVarSet']=function(_0x3f25df){if(this[_0x42a8('0xc')][_0x3f25df[_0x42a8('0x21')]]){for(var _0x33380b in _0x3f25df[_0x42a8('0x26')]){if(_0x3f25df['variable'][_0x42a8('0x1f')](_0x33380b)){this['channels'][_0x3f25df[_0x42a8('0x21')]][_0x33380b]=_0x3f25df[_0x42a8('0x27')];}}}};Fax[_0x42a8('0x1c')][_0x42a8('0x28')]=function(_0xed09a5){if(this[_0x42a8('0xc')][_0xed09a5[_0x42a8('0x21')]]){this['channels'][_0xed09a5['uniqueid']]['channelstate']=_0xed09a5[_0x42a8('0x29')];this[_0x42a8('0xc')][_0xed09a5[_0x42a8('0x21')]][_0x42a8('0x2a')]=_0xed09a5[_0x42a8('0x2a')];}};Fax[_0x42a8('0x1c')][_0x42a8('0x16')]=function(_0x5c4fc3){if(this['channels'][_0x5c4fc3['uniqueid']]){for(var _0x206463 in _0x5c4fc3[_0x42a8('0x26')]){if(_0x5c4fc3['variable'][_0x42a8('0x1f')](_0x206463)){this[_0x42a8('0xc')][_0x5c4fc3['uniqueid']][_0x206463]=_0x5c4fc3[_0x42a8('0x27')];}}}};Fax[_0x42a8('0x1c')][_0x42a8('0x18')]=function(_0x25c17e){if(this[_0x42a8('0xc')][_0x25c17e['uniqueid']]){this[_0x42a8('0xc')][_0x25c17e[_0x42a8('0x21')]][_0x42a8('0x2b')]=_0x25c17e[_0x42a8('0x2b')];this[_0x42a8('0xc')][_0x25c17e['uniqueid']][_0x42a8('0x2c')]=_0x25c17e[_0x42a8('0x2c')];this['channels'][_0x25c17e[_0x42a8('0x21')]][_0x42a8('0x20')]=_0x25c17e[_0x42a8('0x20')];this[_0x42a8('0xc')][_0x25c17e[_0x42a8('0x21')]][_0x42a8('0x2d')]=_0x25c17e[_0x42a8('0x2d')];logger[_0x42a8('0x24')](_0x25c17e['uniqueid'],_0x42a8('0x2e'));}};Fax[_0x42a8('0x1c')][_0x42a8('0x2f')]=function(_0x6c3c33){var _0x41e162=this;if(this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]]){var _0x186fd7=this['channels'][_0x6c3c33['uniqueid']]['id'];this[_0x42a8('0xc')][_0x6c3c33['uniqueid']]['remotestationid']=_0x6c3c33['remotestationid'];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]][_0x42a8('0x30')]=_0x6c3c33[_0x42a8('0x30')];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]]['localstationid']=_0x6c3c33[_0x42a8('0x20')];this[_0x42a8('0xc')][_0x6c3c33['uniqueid']][_0x42a8('0x31')]=_0x6c3c33[_0x42a8('0x31')];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]]['transferrate']=_0x6c3c33['transferrate'];this[_0x42a8('0xc')][_0x6c3c33['uniqueid']][_0x42a8('0x2d')]=_0x6c3c33[_0x42a8('0x2d')];this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]][_0x42a8('0x32')]=_0x6c3c33['calleridnum'];if(this[_0x42a8('0xc')][_0x6c3c33[_0x42a8('0x21')]][_0x42a8('0x30')]>0x0){tiff2pdf(_0x6c3c33[_0x42a8('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x24e101){logger[_0x42a8('0x24')](_0x6c3c33['uniqueid'],_0x42a8('0x33'),_0x24e101[_0x42a8('0x34')]);attachment[_0x42a8('0x35')]({'name':path['parse'](_0x6c3c33[_0x42a8('0x2d')])[_0x42a8('0x23')],'basename':path[_0x42a8('0x36')](_0x6c3c33[_0x42a8('0x2d')])['name']+_0x42a8('0x37'),'type':'application/pdf'})[_0x42a8('0x38')](function(_0x35c91b){faxAccount[_0x42a8('0x39')](_0x186fd7,{'from':_0x6c3c33['calleridnum'],'mapKey':_0x42a8('0x4'),'body':path[_0x42a8('0x36')](_0x6c3c33[_0x42a8('0x2d')])[_0x42a8('0x23')]+_0x42a8('0x37'),'AttachmentId':_0x35c91b['id']})[_0x42a8('0x3a')](function(_0x1d4da1){logger[_0x42a8('0x3b')](_0x6c3c33[_0x42a8('0x21')],_0x42a8('0x3c'),JSON[_0x42a8('0x3d')](_0x1d4da1));});})[_0x42a8('0x3a')](function(_0x2582b5){logger[_0x42a8('0x3b')](_0x6c3c33['uniqueid'],'\x20receiveFax\x20',JSON[_0x42a8('0x3d')](_0x2582b5));});});}logger[_0x42a8('0x24')](_0x6c3c33[_0x42a8('0x21')],_0x42a8('0x3e'));}};Fax[_0x42a8('0x1c')][_0x42a8('0x1b')]=function(_0x20904){if(this[_0x42a8('0xf')][_0x20904[_0x42a8('0x21')]]){_[_0x42a8('0x3f')](this[_0x42a8('0xc')][_0x20904[_0x42a8('0x21')]],_[_0x42a8('0x40')](_0x20904,[_0x42a8('0x41'),'reason']));}};function updateStatus(_0xe80246){if(_0xe80246[_0x42a8('0x42')]){faxMessage['update'](_0xe80246[_0x42a8('0x42')],{'failMessage':_0x42a8('0x43')})[_0x42a8('0x38')](function(_0x38e4e7){ut[_0x42a8('0x44')](_0x42a8('0x45'),_0x38e4e7);})[_0x42a8('0x3a')](function(_0x5b7a8d){ut['logger']('[Fax][Message][Error][NoUpdate1]',_0x5b7a8d);});}else{ut[_0x42a8('0x44')](_0x42a8('0x46'));}}Fax[_0x42a8('0x1c')][_0x42a8('0x47')]=function(_0x28bd9f,_0xc99e87,_0x440eff){var _0x584db2=this;var _0x4c3499={};if(_0xc99e87){_0x4c3499={'read':_0xc99e87};}else{_0x4c3499={'failMessage':_0x440eff};}if(this['actions'][_0x28bd9f][_0x42a8('0x42')]){faxMessage[_0x42a8('0x48')](this[_0x42a8('0xf')][_0x28bd9f][_0x42a8('0x42')],_0x4c3499)[_0x42a8('0x38')](function(_0x12b22e){ut[_0x42a8('0x44')](_0x42a8('0x49'),_0x12b22e);})[_0x42a8('0x3a')](function(_0x2f3d5c){ut[_0x42a8('0x44')](_0x42a8('0x4a'),_0x2f3d5c);})['finally'](function(){delete _0x584db2[_0x42a8('0xc')][_0x28bd9f];delete _0x584db2[_0x42a8('0xf')][_0x28bd9f];});}else{ut['logger']('[Fax][Message][NoUpdate2]');delete this['channels'][_0x28bd9f];delete this['actions'][_0x28bd9f];}};Fax[_0x42a8('0x1c')][_0x42a8('0x1a')]=function(_0x1d1268){var _0x574552=this;if(this['channels'][_0x1d1268[_0x42a8('0x21')]]){if(this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]]){this[_0x42a8('0xc')][_0x1d1268[_0x42a8('0x21')]]['id']=this[_0x42a8('0xf')][_0x1d1268['uniqueid']]['id'];this['channels'][_0x1d1268['uniqueid']]['name']=this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x23')];}logger[_0x42a8('0x24')](_0x1d1268[_0x42a8('0x21')],this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]]?_0x42a8('0x4b'):_0x42a8('0x4c'),JSON[_0x42a8('0x3d')](this[_0x42a8('0xc')][_0x1d1268['uniqueid']]));if(this[_0x42a8('0xf')][_0x1d1268[_0x42a8('0x21')]]){if(this[_0x42a8('0xc')][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x4d')]>0x0&&this['channels'][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x17')]==='SUCCESS'){this[_0x42a8('0x47')](_0x1d1268[_0x42a8('0x21')],!![]);}else{this['updateStatus'](_0x1d1268[_0x42a8('0x21')],![],this[_0x42a8('0xc')][_0x1d1268['uniqueid']][_0x42a8('0x4e')]?_0x42a8('0x4f')+this[_0x42a8('0xc')][_0x1d1268[_0x42a8('0x21')]][_0x42a8('0x4e')]:_0x42a8('0x50'));}}}};Fax[_0x42a8('0x1c')][_0x42a8('0x51')]=function(_0x1347e1){var _0x54e339=this;return new BPromise(function(_0x1f0008,_0x5e56b1){_0x54e339[_0x42a8('0x52')](_0x1347e1,_0x54e339['faxAccounts'][_0x1347e1[_0x42a8('0x53')]])[_0x42a8('0x38')](function(_0x4a2f70){ut[_0x42a8('0x44')](_0x42a8('0x54'),_0x4a2f70);_0x1f0008(ut[_0x42a8('0x34')](_0x42a8('0x55')));})[_0x42a8('0x3a')](function(_0x2cc767){ut[_0x42a8('0x44')]('[Fax][execOriginate][failure]',_0x2cc767);updateStatus(_0x1347e1);_0x5e56b1(ut['message'](_0x42a8('0x56')));});});};Fax[_0x42a8('0x1c')][_0x42a8('0x57')]=function(_0x1e51a5){var _0x4cf0a6=this;return new BPromise(function(_0x46d682,_0x3b04a2){var _0x19bcc0=_0x4cf0a6[_0x42a8('0x58')](_0x4cf0a6[_0x42a8('0xd')][_0x1e51a5[_0x42a8('0x53')]][_0x42a8('0x59')],_0x1e51a5);if(_0x19bcc0['isValid']){_0x46d682(ut[_0x42a8('0x34')]('Trunk\x20Reachable'));}else{_0x3b04a2(ut['message'](_0x19bcc0[_0x42a8('0x34')]));}});};function originate(_0xb85b98,_0x56b15b,_0x17a09d){return new BPromise(function(_0x44f5bd,_0x539763){if(_0x17a09d){var _0x66cbbe=util[_0x42a8('0x5a')](_0x42a8('0x5b'),path[_0x42a8('0x36')](_0xb85b98[_0x42a8('0x2')])[_0x42a8('0x23')],_0xb85b98[_0x42a8('0x2')]);gs[_0x42a8('0x5c')](_0x66cbbe)[_0x42a8('0x38')](function(){_0xb85b98[_0x42a8('0x2')]=util[_0x42a8('0x5a')](_0x42a8('0x5d'),path[_0x42a8('0x36')](_0xb85b98[_0x42a8('0x2')])[_0x42a8('0x5e')],path[_0x42a8('0x36')](_0xb85b98[_0x42a8('0x2')])[_0x42a8('0x23')]);_0x56b15b[_0x42a8('0x5f')]=_0xb85b98['path'];ut['logger'](_0x42a8('0x60'),'');ami[_0x42a8('0x61')](ut[_0x42a8('0x62')](_0xb85b98,_0x56b15b))[_0x42a8('0x38')](function(_0x56b046){_0x44f5bd(_0x56b046);})[_0x42a8('0x3a')](function(_0x34e94f){_0x539763(_0x34e94f);});})[_0x42a8('0x3a')](function(_0x90da34){_0x539763(_0x90da34);});}else{ami[_0x42a8('0x61')](ut[_0x42a8('0x62')](_0xb85b98,_0x56b15b))['then'](function(_0x41c233){_0x44f5bd(_0x41c233);})[_0x42a8('0x3a')](function(_0x161244){_0x539763(_0x161244);});}});}Fax['prototype'][_0x42a8('0x52')]=function(_0x59d292,_0x2c99c6){var _0x1a5bbf=this;return new BPromise(function(_0x10575a,_0x1e71bb){var _0x3c62c7=uuid['v4']();var _0x1f7270=ut[_0x42a8('0x63')](_0x59d292,_0x2c99c6);_0x1a5bbf[_0x42a8('0xf')][_0x3c62c7]=new Action(_0x3c62c7,_0x2c99c6,_0x59d292);var _0x5d3a56=_0x1a5bbf['actions'][_0x3c62c7];if(path[_0x42a8('0x36')](_0x59d292[_0x42a8('0x2')])['ext']===_0x42a8('0x37')){originate(_0x5d3a56,_0x1f7270,!![])[_0x42a8('0x38')](function(_0x4a86b7){_0x10575a(_0x4a86b7);})[_0x42a8('0x3a')](function(_0x3c16af){_0x1e71bb(_0x3c16af);});}else{originate(_0x5d3a56,_0x1f7270,![])['then'](function(_0x472b27){_0x10575a(_0x472b27);})[_0x42a8('0x3a')](function(_0x547381){_0x1e71bb(_0x547381);});}});};Fax[_0x42a8('0x1c')]['isTrunkReachable']=function(_0x2f8c1c){return!_['isNil'](_0x2f8c1c)&&!_['isNil'](_0x2f8c1c['name'])&&!_[_0x42a8('0x64')](_0x2f8c1c['active'])&&_0x2f8c1c[_0x42a8('0x65')]&&!_[_0x42a8('0x64')](this[_0x42a8('0xe')][util[_0x42a8('0x5a')](_0x42a8('0x66'),_0x2f8c1c[_0x42a8('0x23')])])&&!_[_0x42a8('0x64')](this[_0x42a8('0xe')][util['format']('SIP/%s',_0x2f8c1c[_0x42a8('0x23')])][_0x42a8('0x2c')])&&(this[_0x42a8('0xe')][util['format'](_0x42a8('0x66'),_0x2f8c1c[_0x42a8('0x23')])][_0x42a8('0x2c')]==='reachable'||this[_0x42a8('0xe')][util[_0x42a8('0x5a')](_0x42a8('0x66'),_0x2f8c1c[_0x42a8('0x23')])]['status']===_0x42a8('0x67'));};Fax['prototype'][_0x42a8('0x58')]=function(_0xacf8db,_0x178f09){if(!this[_0x42a8('0x68')](_0xacf8db)){ut['logger'](_0x42a8('0x69'),_[_0x42a8('0x64')](_0xacf8db)?'':_0xacf8db[_0x42a8('0x23')]+_0x42a8('0x6a'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}if(_['isNil'](_0x178f09['fax'])){ut[_0x42a8('0x44')](_0x42a8('0x6b'),JSON[_0x42a8('0x3d')](_0x178f09));return{'isValid':![],'message':_0x42a8('0x6c')};}if(_[_0x42a8('0x64')](_0x178f09[_0x42a8('0x2')])){ut[_0x42a8('0x44')](_0x42a8('0x6d'),JSON[_0x42a8('0x3d')](_0x178f09));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0x42a8('0x6e')};};module[_0x42a8('0x6f')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index f960090..3357938 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 _0x1d80=['error','inspect','notify','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','../rpc/faxAccount'];(function(_0x30260a,_0x3ec46a){var _0x24c3d4=function(_0x2c8e13){while(--_0x2c8e13){_0x30260a['push'](_0x30260a['shift']());}};_0x24c3d4(++_0x3ec46a);}(_0x1d80,0xe2));var _0x01d8=function(_0x5def84,_0x293c0b){_0x5def84=_0x5def84-0x0;var _0x4baae1=_0x1d80[_0x5def84];return _0x4baae1;};'use strict';var util=require(_0x01d8('0x0'));var BPromise=require(_0x01d8('0x1'));var logger=require(_0x01d8('0x2'))('preview');var _=require('lodash');var faxAccount=require(_0x01d8('0x3'));function loggerCatch(_0x2f5609){return function(_0x4b6d9e){logger[_0x01d8('0x4')](_0x2f5609,util[_0x01d8('0x5')](_0x4b6d9e,{'showHidden':![],'depth':null}));};}exports[_0x01d8('0x6')]=function(_0x977afc,_0x5bc23a){return BPromise['resolve']()[_0x01d8('0x7')](faxAccount[_0x01d8('0x6')](_0x977afc,_0x5bc23a))[_0x01d8('0x8')](loggerCatch(_0x01d8('0x9')));}; \ No newline at end of file +var _0xd6de=['../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','bluebird','preview','lodash'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0xd6de,0x126));var _0xed6d=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xd6de[_0x4f9b18];return _0x29f20c;};'use strict';var util=require('util');var BPromise=require(_0xed6d('0x0'));var logger=require('../../../config/logger')(_0xed6d('0x1'));var _=require(_0xed6d('0x2'));var faxAccount=require(_0xed6d('0x3'));function loggerCatch(_0x50511e){return function(_0x4d0acf){logger[_0xed6d('0x4')](_0x50511e,util[_0xed6d('0x5')](_0x4d0acf,{'showHidden':![],'depth':null}));};}exports[_0xed6d('0x6')]=function(_0x5ff6dc,_0x32e8a1){return BPromise[_0xed6d('0x7')]()[_0xed6d('0x8')](faxAccount[_0xed6d('0x6')](_0x5ff6dc,_0x32e8a1))[_0xed6d('0x9')](loggerCatch(_0xed6d('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index adb4471..bb42277 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 _0x388d=['Exec\x20gs','\x20Error\x20:','inspect','fax','bluebird','child_process','exec','execute','info'];(function(_0x14fa6c,_0x4d0dc5){var _0x286e55=function(_0x4e03d0){while(--_0x4e03d0){_0x14fa6c['push'](_0x14fa6c['shift']());}};_0x286e55(++_0x4d0dc5);}(_0x388d,0xc9));var _0xd388=function(_0x20a771,_0x27358c){_0x20a771=_0x20a771-0x0;var _0x2f9240=_0x388d[_0x20a771];return _0x2f9240;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0xd388('0x0'));var BPromise=require(_0xd388('0x1'));var exec=require(_0xd388('0x2'))[_0xd388('0x3')];exports[_0xd388('0x4')]=function(_0x442aa0){return new BPromise(function(_0x3fec6e,_0x4db1c3){exec(_0x442aa0,function(_0x59ce31,_0x18071a,_0x1dc71b){logger[_0xd388('0x5')]('Exec\x20gs',_0x18071a);if(_0x59ce31){logger[_0xd388('0x5')](_0xd388('0x6'),_0xd388('0x7'),util[_0xd388('0x8')](_0x59ce31,{'showHidden':![],'depth':null}),_0x18071a,_0x1dc71b);_0x4db1c3(_0x59ce31);}_0x3fec6e(_0x18071a);});});}; \ No newline at end of file +var _0xf1ab=['inspect','../../../../config/logger','fax','bluebird','child_process','execute','info','Exec\x20gs','\x20Error\x20:'];(function(_0x47c28c,_0x52f17e){var _0x13c2ec=function(_0xf21752){while(--_0xf21752){_0x47c28c['push'](_0x47c28c['shift']());}};_0x13c2ec(++_0x52f17e);}(_0xf1ab,0xe2));var _0xbf1a=function(_0x4ec4eb,_0x1a3d64){_0x4ec4eb=_0x4ec4eb-0x0;var _0x2fbd23=_0xf1ab[_0x4ec4eb];return _0x2fbd23;};'use strict';var util=require('util');var logger=require(_0xbf1a('0x0'))(_0xbf1a('0x1'));var BPromise=require(_0xbf1a('0x2'));var exec=require(_0xbf1a('0x3'))['exec'];exports[_0xbf1a('0x4')]=function(_0x450a9e){return new BPromise(function(_0x221fa9,_0x158204){exec(_0x450a9e,function(_0x2bea54,_0x54d491,_0x5b9b37){logger[_0xbf1a('0x5')](_0xbf1a('0x6'),_0x54d491);if(_0x2bea54){logger['info'](_0xbf1a('0x6'),_0xbf1a('0x7'),util[_0xbf1a('0x8')](_0x2bea54,{'showHidden':![],'depth':null}),_0x54d491,_0x5b9b37);_0x158204(_0x2bea54);}_0x221fa9(_0x54d491);});});}; \ 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 257f0b8..a864f98 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 _0x7cba=['variablesAction','uniqueid','originate','xcally-motion-fax','format','\x22%s\x22\x20<%s>','headerinfo','moment','../../../../config/logger','message','logger','info','inspect','addVariables','ecm','minrate','maxrate','gateway','faxdetect','localstationid','path'];(function(_0x5662a4,_0x31a75a){var _0x136525=function(_0x4a2e7a){while(--_0x4a2e7a){_0x5662a4['push'](_0x5662a4['shift']());}};_0x136525(++_0x31a75a);}(_0x7cba,0x1d5));var _0xa7cb=function(_0x403e6b,_0x3855c0){_0x403e6b=_0x403e6b-0x0;var _0x5d6768=_0x7cba[_0x403e6b];return _0x5d6768;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xa7cb('0x0'));var logger=require(_0xa7cb('0x1'))('fax');exports[_0xa7cb('0x2')]=function(_0x538ac2){return{'message':_0x538ac2};};exports[_0xa7cb('0x3')]=function(_0x2d94d1,_0x5ba9cd){logger[_0xa7cb('0x4')](_0x2d94d1,util[_0xa7cb('0x5')](_0x5ba9cd,{'showHidden':![],'depth':null}));};exports[_0xa7cb('0x6')]=function(_0x4df6de,_0x4dae37){var _0x3f1bf3={'XMF-ECM':_0x4dae37[_0xa7cb('0x7')],'XMF-HEADERINFO':_0x4dae37['headerinfo'],'XMF-MINRATE':_0x4dae37[_0xa7cb('0x8')],'XMF-MAXRATE':_0x4dae37[_0xa7cb('0x9')],'XMF-MODEM':util['format']('\x22%s\x22',_0x4dae37['modem']),'XMF-GATEWAY':_0x4dae37[_0xa7cb('0xa')],'XMF-FAXDETECT':_0x4dae37[_0xa7cb('0xb')],'XMF-T38TIMEOUT':_0x4dae37['t38timeout'],'XMF-LOCALSTATIONID':_0x4dae37[_0xa7cb('0xc')],'XMF-PATH':_0x4df6de[_0xa7cb('0xd')]};return _0x3f1bf3;};exports[_0xa7cb('0xe')]=function(_0x412696,_0x40ece2){return{'actionid':_0x412696[_0xa7cb('0xf')],'action':_0xa7cb('0x10'),'channel':_0x412696['channel'],'Exten':_0xa7cb('0x11'),'Context':'from-sip','Priority':'1','callerid':util[_0xa7cb('0x12')](_0xa7cb('0x13'),_0x412696[_0xa7cb('0x14')]?_0x412696['headerinfo']:'',_0x412696[_0xa7cb('0xc')]),'variable':_0x40ece2,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x412696['uniqueid']};}; \ No newline at end of file +var _0x1803=['maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','\x22%s\x22\x20<%s>','localstationid','lodash','moment','../../../../config/logger','fax','message','logger','info','addVariables','headerinfo','minrate'];(function(_0x2e18d7,_0x16c3e6){var _0x59ae50=function(_0x22d744){while(--_0x22d744){_0x2e18d7['push'](_0x2e18d7['shift']());}};_0x59ae50(++_0x16c3e6);}(_0x1803,0x146));var _0x3180=function(_0x19f451,_0x4b5e9b){_0x19f451=_0x19f451-0x0;var _0x376db5=_0x1803[_0x19f451];return _0x376db5;};'use strict';var util=require('util');var _=require(_0x3180('0x0'));var moment=require(_0x3180('0x1'));var logger=require(_0x3180('0x2'))(_0x3180('0x3'));exports[_0x3180('0x4')]=function(_0x5162b3){return{'message':_0x5162b3};};exports[_0x3180('0x5')]=function(_0x42d5ed,_0x546980){logger[_0x3180('0x6')](_0x42d5ed,util['inspect'](_0x546980,{'showHidden':![],'depth':null}));};exports[_0x3180('0x7')]=function(_0x4a6d90,_0x58c06f){var _0x527c84={'XMF-ECM':_0x58c06f['ecm'],'XMF-HEADERINFO':_0x58c06f[_0x3180('0x8')],'XMF-MINRATE':_0x58c06f[_0x3180('0x9')],'XMF-MAXRATE':_0x58c06f[_0x3180('0xa')],'XMF-MODEM':util[_0x3180('0xb')](_0x3180('0xc'),_0x58c06f[_0x3180('0xd')]),'XMF-GATEWAY':_0x58c06f['gateway'],'XMF-FAXDETECT':_0x58c06f[_0x3180('0xe')],'XMF-T38TIMEOUT':_0x58c06f[_0x3180('0xf')],'XMF-LOCALSTATIONID':_0x58c06f['localstationid'],'XMF-PATH':_0x4a6d90[_0x3180('0x10')]};return _0x527c84;};exports[_0x3180('0x11')]=function(_0x1602dc,_0x4e92d0){return{'actionid':_0x1602dc[_0x3180('0x12')],'action':_0x3180('0x13'),'channel':_0x1602dc[_0x3180('0x14')],'Exten':_0x3180('0x15'),'Context':'from-sip','Priority':'1','callerid':util['format'](_0x3180('0x16'),_0x1602dc[_0x3180('0x8')]?_0x1602dc[_0x3180('0x8')]:'',_0x1602dc[_0x3180('0x17')]),'variable':_0x4e92d0,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1602dc[_0x3180('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index adda563..40d181d 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 _0x0397=['./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','[index.js][initParams]','listen','sync','catch','error','[index.js][main]','inspect','util','./report','./acw','./trigger','./dialer','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk'];(function(_0x3ea78e,_0x263523){var _0x738a8=function(_0x52fe65){while(--_0x52fe65){_0x3ea78e['push'](_0x3ea78e['shift']());}};_0x738a8(++_0x263523);}(_0x0397,0x1cc));var _0x7039=function(_0x390e6c,_0x4d7d42){_0x390e6c=_0x390e6c-0x0;var _0x596b05=_0x0397[_0x390e6c];return _0x596b05;};'use strict';var util=require(_0x7039('0x0'));var moment=require('moment');var server=require('./server');var Realtime=require('./realtime');var Report=require(_0x7039('0x1'));var Acw=require(_0x7039('0x2'));var Trigger=require(_0x7039('0x3'));var Dialer=require(_0x7039('0x4'));var Preview=require(_0x7039('0x5'));var Fax=require('./fax');var user=require(_0x7039('0x6'));var voiceQueue=require(_0x7039('0x7'));var voiceQueueReport=require(_0x7039('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x7039('0x9'));var template=require(_0x7039('0xa'));var cmHopperHistory=require(_0x7039('0xb'));var campaign=require('./rpc/campaign');var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0x7039('0xc'));var zendesk=require(_0x7039('0xd'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x7039('0xe'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x7039('0xf'));var zoho=require(_0x7039('0x10'));var vtiger=require(_0x7039('0x11'));var freshsales=require(_0x7039('0x12'));var servicenow=require(_0x7039('0x13'));var dynamics365=require(_0x7039('0x14'));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(_0x7039('0x15'))(_0x7039('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x7039('0x17')](_0x7039('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x7039('0x17')](_0x7039('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x7039('0x19')]()[_0x7039('0x1a')](user['getAgents']())['then'](realtime[_0x7039('0x1b')]())[_0x7039('0x1a')](user[_0x7039('0x1c')]())[_0x7039('0x1a')](realtime[_0x7039('0x1d')]())[_0x7039('0x1a')](trunk[_0x7039('0x1e')]())['then'](realtime[_0x7039('0x1f')]())[_0x7039('0x1a')](voiceQueue[_0x7039('0x20')]())[_0x7039('0x1a')](realtime[_0x7039('0x21')]())[_0x7039('0x1a')](trigger[_0x7039('0x22')]())[_0x7039('0x1a')](realtime[_0x7039('0x23')]())[_0x7039('0x1a')](template[_0x7039('0x24')]())[_0x7039('0x1a')](realtime[_0x7039('0x25')]())[_0x7039('0x1a')](zendesk[_0x7039('0x26')]())['then'](realtime[_0x7039('0x27')]())[_0x7039('0x1a')](salesforce[_0x7039('0x28')]())[_0x7039('0x1a')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0x7039('0x29')]())[_0x7039('0x1a')](realtime[_0x7039('0x2a')]())[_0x7039('0x1a')](freshdesk['getFreshdeskAccounts']())[_0x7039('0x1a')](realtime[_0x7039('0x2b')]())[_0x7039('0x1a')](desk['getDeskAccounts']())[_0x7039('0x1a')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())['then'](realtime[_0x7039('0x2c')]())['then'](vtiger[_0x7039('0x2d')]())[_0x7039('0x1a')](realtime[_0x7039('0x2e')]())[_0x7039('0x1a')](freshsales[_0x7039('0x2f')]())['then'](realtime[_0x7039('0x30')]())['then'](servicenow['getServicenowAccounts']())[_0x7039('0x1a')](realtime[_0x7039('0x31')]())[_0x7039('0x1a')](dynamics365['getDynamics365Accounts']())[_0x7039('0x1a')](realtime[_0x7039('0x32')]())[_0x7039('0x1a')](campaign[_0x7039('0x33')]())[_0x7039('0x1a')](realtime['initCampaigns']())['then'](voiceExtension[_0x7039('0x34')]())[_0x7039('0x1a')](realtime[_0x7039('0x35')]())[_0x7039('0x1a')](faxAccount[_0x7039('0x36')]())[_0x7039('0x1a')](realtime[_0x7039('0x37')]())[_0x7039('0x1a')](function(){return realtime;});}function initParams(){return Promise[_0x7039('0x19')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0x7039('0x38')]())[_0x7039('0x1a')](cmHopperHistory['getVoiceQueueHopperHistory']())['then'](realtime[_0x7039('0x39')]())['then'](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0x7039('0x3a')]())[_0x7039('0x1a')](voiceCallReport[_0x7039('0x3b')]())[_0x7039('0x1a')](realtime[_0x7039('0x3c')]())['catch'](function(_0xdf8dee){logger['error'](_0x7039('0x3d'),util['inspect'](_0xdf8dee,{'showHidden':![],'depth':null}));});}function main(){return server[_0x7039('0x3e')](realtime,preview,fax)[_0x7039('0x1a')](function(){return initRealtime();})[_0x7039('0x1a')](function(){return initParams();})[_0x7039('0x1a')](function(){report[_0x7039('0x3f')]();setInterval(initRealtime,0x1388);})[_0x7039('0x40')](function(_0x3bc9bf){logger[_0x7039('0x41')](_0x7039('0x42'),util[_0x7039('0x43')](_0x3bc9bf,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x0de6=['getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]','inspect','sync','[index.js][main]','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','../../config/logger','ami','get','hour','resolve','then','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory'];(function(_0x111912,_0x427d64){var _0x2215a8=function(_0x4ea4f9){while(--_0x4ea4f9){_0x111912['push'](_0x111912['shift']());}};_0x2215a8(++_0x427d64);}(_0x0de6,0x99));var _0x60de=function(_0x1afa89,_0xd81c5a){_0x1afa89=_0x1afa89-0x0;var _0xf4e084=_0x0de6[_0x1afa89];return _0xf4e084;};'use strict';var util=require('util');var moment=require(_0x60de('0x0'));var server=require(_0x60de('0x1'));var Realtime=require(_0x60de('0x2'));var Report=require(_0x60de('0x3'));var Acw=require(_0x60de('0x4'));var Trigger=require(_0x60de('0x5'));var Dialer=require(_0x60de('0x6'));var Preview=require('./preview');var Fax=require(_0x60de('0x7'));var user=require(_0x60de('0x8'));var voiceQueue=require(_0x60de('0x9'));var voiceQueueReport=require(_0x60de('0xa'));var voiceCallReport=require(_0x60de('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0x60de('0xc'));var template=require(_0x60de('0xd'));var cmHopperHistory=require(_0x60de('0xe'));var campaign=require(_0x60de('0xf'));var voiceExtension=require(_0x60de('0x10'));var faxAccount=require(_0x60de('0x11'));var zendesk=require(_0x60de('0x12'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x60de('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x60de('0x14'));var zoho=require(_0x60de('0x15'));var vtiger=require(_0x60de('0x16'));var freshsales=require(_0x60de('0x17'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0x60de('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0x60de('0x19'))(_0x60de('0x1a'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x60de('0x1b')](_0x60de('0x1c'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0x60de('0x1d')]()[_0x60de('0x1e')](user['getAgents']())[_0x60de('0x1e')](realtime[_0x60de('0x1f')]())[_0x60de('0x1e')](user[_0x60de('0x20')]())['then'](realtime[_0x60de('0x21')]())[_0x60de('0x1e')](trunk[_0x60de('0x22')]())[_0x60de('0x1e')](realtime['initTrunks']())['then'](voiceQueue[_0x60de('0x23')]())[_0x60de('0x1e')](realtime[_0x60de('0x24')]())[_0x60de('0x1e')](trigger[_0x60de('0x25')]())[_0x60de('0x1e')](realtime[_0x60de('0x26')]())[_0x60de('0x1e')](template['getTemplates']())[_0x60de('0x1e')](realtime[_0x60de('0x27')]())[_0x60de('0x1e')](zendesk['getZendeskAccounts']())['then'](realtime[_0x60de('0x28')]())[_0x60de('0x1e')](salesforce['getSalesforceAccounts']())['then'](realtime[_0x60de('0x29')]())['then'](sugarcrm[_0x60de('0x2a')]())['then'](realtime['initSugarcrmAccounts']())[_0x60de('0x1e')](freshdesk['getFreshdeskAccounts']())[_0x60de('0x1e')](realtime[_0x60de('0x2b')]())['then'](desk[_0x60de('0x2c')]())[_0x60de('0x1e')](realtime[_0x60de('0x2d')]())[_0x60de('0x1e')](zoho['getZohoAccounts']())[_0x60de('0x1e')](realtime[_0x60de('0x2e')]())[_0x60de('0x1e')](vtiger[_0x60de('0x2f')]())[_0x60de('0x1e')](realtime[_0x60de('0x30')]())[_0x60de('0x1e')](freshsales[_0x60de('0x31')]())['then'](realtime[_0x60de('0x32')]())[_0x60de('0x1e')](servicenow[_0x60de('0x33')]())[_0x60de('0x1e')](realtime[_0x60de('0x34')]())[_0x60de('0x1e')](dynamics365[_0x60de('0x35')]())[_0x60de('0x1e')](realtime[_0x60de('0x36')]())[_0x60de('0x1e')](campaign[_0x60de('0x37')]())['then'](realtime[_0x60de('0x38')]())[_0x60de('0x1e')](voiceExtension['getVoiceExtensions']())[_0x60de('0x1e')](realtime[_0x60de('0x39')]())[_0x60de('0x1e')](faxAccount[_0x60de('0x3a')]())[_0x60de('0x1e')](realtime[_0x60de('0x3b')]())['then'](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0x60de('0x1e')](voiceQueueReport[_0x60de('0x3c')]())['then'](realtime[_0x60de('0x3d')]())['then'](cmHopperHistory[_0x60de('0x3e')]())[_0x60de('0x1e')](realtime['initVoiceQueueHopperHistory']())[_0x60de('0x1e')](cmHopperHistory[_0x60de('0x3f')]())[_0x60de('0x1e')](realtime[_0x60de('0x40')]())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0x60de('0x41')]())[_0x60de('0x42')](function(_0x549607){logger[_0x60de('0x43')](_0x60de('0x44'),util[_0x60de('0x45')](_0x549607,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x60de('0x1e')](function(){return initRealtime();})[_0x60de('0x1e')](function(){return initParams();})[_0x60de('0x1e')](function(){report[_0x60de('0x46')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x52d689){logger[_0x60de('0x43')](_0x60de('0x47'),util[_0x60de('0x45')](_0x52d689,{'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 897e916..1a77300 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 _0xbecc=['state','toLowerCase','idle','inuse','talking','statePause','voiceStatusTime','toNumber','format','voiceStatus','user:%s','emit','user:ami:update','omit','user:presence','lodash','util','md5','ioredis','../../../config/environment','defaults','redis','localhost','name','email','accountcode','fullname','unknown','status','address','phone','mobile','interface','online','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime'];(function(_0x5d2fc6,_0x3d3e5d){var _0x17c572=function(_0x1b650d){while(--_0x1b650d){_0x5d2fc6['push'](_0x5d2fc6['shift']());}};_0x17c572(++_0x3d3e5d);}(_0xbecc,0xaf));var _0xcbec=function(_0x344ab1,_0x39cd22){_0x344ab1=_0x344ab1-0x0;var _0x1dbea1=_0xbecc[_0x344ab1];return _0x1dbea1;};'use strict';var _=require(_0xcbec('0x0'));var util=require(_0xcbec('0x1'));var moment=require('moment');var md5=require(_0xcbec('0x2'));var Redis=require(_0xcbec('0x3'));var config=require(_0xcbec('0x4'));config['redis']=_[_0xcbec('0x5')](config[_0xcbec('0x6')],{'host':_0xcbec('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x56b4a5){this['id']=_0x56b4a5['id']||0x0;this[_0xcbec('0x8')]=_0x56b4a5[_0xcbec('0x8')]||'';this[_0xcbec('0x9')]=_0x56b4a5[_0xcbec('0x9')]||'';this['accountcode']=_0x56b4a5[_0xcbec('0xa')]||'';this['fullname']=_0x56b4a5[_0xcbec('0xb')]||'';this['state']=_0xcbec('0xc');this['stateTime']=0x0;this[_0xcbec('0xd')]=_0xcbec('0xc');this[_0xcbec('0xe')]='';this[_0xcbec('0xf')]='';this[_0xcbec('0x10')]='';this[_0xcbec('0x11')]='';this[_0xcbec('0x12')]=_0x56b4a5[_0xcbec('0x12')]||![];this['voiceStatus']='unknown';this['voiceStatusTime']=0x0;this[_0xcbec('0x13')]='';this[_0xcbec('0x14')]='';this[_0xcbec('0x15')]=![];this[_0xcbec('0x16')]=![];this['md5']='';}Agent[_0xcbec('0x17')][_0xcbec('0x18')]=function(_0x40822f){var _0x26a9fc;if(_0x40822f&&_0x40822f[_0xcbec('0x19')]){_0x26a9fc=_0x40822f['state'][_0xcbec('0x1a')]();switch(_0x26a9fc){case'not_inuse':_0x26a9fc=_0xcbec('0x1b');break;case _0xcbec('0x1c'):_0x26a9fc=_0xcbec('0x1d');break;}}if(_0x26a9fc&&this['voiceStatus']!==_0x26a9fc||_0x40822f[_0xcbec('0x1e')]){this[_0xcbec('0x1f')]=_[_0xcbec('0x20')](moment()[_0xcbec('0x21')]('x'));}if(_0x26a9fc){this[_0xcbec('0x22')]=_0x26a9fc;}var _0x56c278={'id':this['id'],'name':this[_0xcbec('0x8')],'email':this[_0xcbec('0x9')],'accountcode':this[_0xcbec('0xa')],'fullname':this[_0xcbec('0xb')],'state':this[_0xcbec('0x19')],'stateTime':this['stateTime'],'status':this[_0xcbec('0xd')],'address':this[_0xcbec('0xe')],'online':this[_0xcbec('0x12')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0xcbec('0x1f')],'voiceStatusCallerIdNumber':this[_0xcbec('0x13')],'voiceStatusQueue':this[_0xcbec('0x14')],'interface':this[_0xcbec('0x11')],'onhold':this[_0xcbec('0x15')]};var _0x53f670=md5(JSON['stringify'](_0x56c278));if(this['md5']!==_0x53f670){this[_0xcbec('0x2')]=_0x53f670;io['to'](util[_0xcbec('0x21')](_0xcbec('0x23'),_0x56c278[_0xcbec('0x8')]))[_0xcbec('0x24')](_0xcbec('0x25'),_[_0xcbec('0x26')](_0x56c278,['online']));io[_0xcbec('0x24')](_0xcbec('0x27'),_0x56c278);}};module['exports']=Agent; \ No newline at end of file +var _0xf804=['redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','phone','mobile','interface','online','voiceStatus','voiceStatusTime','onhold','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','status','address','voiceStatusQueue','stringify','user:%s','omit','emit','exports','lodash','util','moment','md5','ioredis','../../../config/environment'];(function(_0x5c830f,_0x3ea7cc){var _0x33ec0e=function(_0x157cea){while(--_0x157cea){_0x5c830f['push'](_0x5c830f['shift']());}};_0x33ec0e(++_0x3ea7cc);}(_0xf804,0x1f2));var _0x4f80=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf804[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x4f80('0x0'));var util=require(_0x4f80('0x1'));var moment=require(_0x4f80('0x2'));var md5=require(_0x4f80('0x3'));var Redis=require(_0x4f80('0x4'));var config=require(_0x4f80('0x5'));config[_0x4f80('0x6')]=_[_0x4f80('0x7')](config[_0x4f80('0x6')],{'host':_0x4f80('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4f80('0x6')]));function Agent(_0x1ca02f){this['id']=_0x1ca02f['id']||0x0;this['name']=_0x1ca02f[_0x4f80('0x9')]||'';this['email']=_0x1ca02f[_0x4f80('0xa')]||'';this[_0x4f80('0xb')]=_0x1ca02f[_0x4f80('0xb')]||'';this[_0x4f80('0xc')]=_0x1ca02f[_0x4f80('0xc')]||'';this[_0x4f80('0xd')]=_0x4f80('0xe');this[_0x4f80('0xf')]=0x0;this['status']=_0x4f80('0xe');this['address']='';this[_0x4f80('0x10')]='';this[_0x4f80('0x11')]='';this[_0x4f80('0x12')]='';this[_0x4f80('0x13')]=_0x1ca02f['online']||![];this[_0x4f80('0x14')]=_0x4f80('0xe');this[_0x4f80('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this['voiceStatusQueue']='';this[_0x4f80('0x16')]=![];this[_0x4f80('0x17')]=![];this[_0x4f80('0x3')]='';}Agent[_0x4f80('0x18')][_0x4f80('0x19')]=function(_0x450e0a){var _0x2ad05d;if(_0x450e0a&&_0x450e0a[_0x4f80('0xd')]){_0x2ad05d=_0x450e0a[_0x4f80('0xd')][_0x4f80('0x1a')]();switch(_0x2ad05d){case _0x4f80('0x1b'):_0x2ad05d=_0x4f80('0x1c');break;case _0x4f80('0x1d'):_0x2ad05d=_0x4f80('0x1e');break;}}if(_0x2ad05d&&this[_0x4f80('0x14')]!==_0x2ad05d||_0x450e0a[_0x4f80('0x1f')]){this['voiceStatusTime']=_[_0x4f80('0x20')](moment()[_0x4f80('0x21')]('x'));}if(_0x2ad05d){this[_0x4f80('0x14')]=_0x2ad05d;}var _0x2ca8ef={'id':this['id'],'name':this[_0x4f80('0x9')],'email':this['email'],'accountcode':this[_0x4f80('0xb')],'fullname':this[_0x4f80('0xc')],'state':this[_0x4f80('0xd')],'stateTime':this[_0x4f80('0xf')],'status':this[_0x4f80('0x22')],'address':this[_0x4f80('0x23')],'online':this[_0x4f80('0x13')],'voiceStatus':this[_0x4f80('0x14')],'voiceStatusTime':this[_0x4f80('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x4f80('0x24')],'interface':this[_0x4f80('0x12')],'onhold':this[_0x4f80('0x16')]};var _0x1bfbeb=md5(JSON[_0x4f80('0x25')](_0x2ca8ef));if(this[_0x4f80('0x3')]!==_0x1bfbeb){this[_0x4f80('0x3')]=_0x1bfbeb;io['to'](util[_0x4f80('0x21')](_0x4f80('0x26'),_0x2ca8ef[_0x4f80('0x9')]))['emit']('user:ami:update',_[_0x4f80('0x27')](_0x2ca8ef,[_0x4f80('0x13')]));io[_0x4f80('0x28')]('user:presence',_0x2ca8ef);}};module[_0x4f80('0x29')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index b5a9724..8bea605 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 _0x0f55=['dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','active','limitCalls'];(function(_0x1f5c10,_0xa42c7d){var _0x40dc26=function(_0x108cb6){while(--_0x108cb6){_0x1f5c10['push'](_0x1f5c10['shift']());}};_0x40dc26(++_0xa42c7d);}(_0x0f55,0x178));var _0x50f5=function(_0x455e82,_0x522f6f){_0x455e82=_0x455e82-0x0;var _0x2d0520=_0x0f55[_0x455e82];return _0x2d0520;};'use strict';function Campaign(_0x5885af){this['id']=_0x5885af['id']||0x0;this[_0x50f5('0x0')]=_0x5885af[_0x50f5('0x0')]||'';this['type']=_0x5885af['type']||'campaign';this[_0x50f5('0x1')]=0x0;this[_0x50f5('0x2')]=0x0;this[_0x50f5('0x3')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0x50f5('0x4')]='';this[_0x50f5('0x5')]=!![];this[_0x50f5('0x6')]=_0x5885af[_0x50f5('0x6')];this[_0x50f5('0x7')]=_0x5885af[_0x50f5('0x7')];this['dialTimezone']=_0x5885af[_0x50f5('0x8')]||null;this[_0x50f5('0x9')]=_0x5885af[_0x50f5('0x9')]?_0x5885af['dialGlobalInterval']:null;this[_0x50f5('0xa')]=_0x5885af[_0x50f5('0xa')];this[_0x50f5('0xb')]=_0x5885af[_0x50f5('0xb')];this[_0x50f5('0xc')]=_0x5885af[_0x50f5('0xc')]||0x1e;this[_0x50f5('0xd')]=_0x5885af['dialCongestionMaxRetry'];this[_0x50f5('0xe')]=_0x5885af[_0x50f5('0xe')];this[_0x50f5('0xf')]=_0x5885af['dialBusyMaxRetry'];this[_0x50f5('0x10')]=_0x5885af[_0x50f5('0x10')];this[_0x50f5('0x11')]=_0x5885af[_0x50f5('0x11')];this[_0x50f5('0x12')]=_0x5885af[_0x50f5('0x12')];this[_0x50f5('0x13')]=_0x5885af['dialGlobalMaxRetry'];this[_0x50f5('0x14')]=_0x5885af['dialNoSuchNumberMaxRetry']||0x3;this[_0x50f5('0x15')]=_0x5885af['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x5885af[_0x50f5('0x16')]||0x3;this[_0x50f5('0x17')]=_0x5885af['dialDropRetryFrequency']||0x96;this[_0x50f5('0x18')]=_0x5885af['dialAbandonedMaxRetry']||0x3;this[_0x50f5('0x19')]=_0x5885af['dialAbandonedRetryFrequency']||0x96;this[_0x50f5('0x1a')]=_0x5885af[_0x50f5('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x5885af[_0x50f5('0x1b')]||0x96;this[_0x50f5('0x1c')]=_0x5885af[_0x50f5('0x1c')]||0x3;this[_0x50f5('0x1d')]=_0x5885af['dialAgentRejectRetryFrequency']||0x96;this[_0x50f5('0x1e')]=_0x5885af[_0x50f5('0x1e')]||'DESC';this[_0x50f5('0x1f')]=_0x5885af[_0x50f5('0x1f')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x5885af[_0x50f5('0x20')]||undefined;this[_0x50f5('0x21')]=_0x5885af['dialCutDigit']||undefined;this[_0x50f5('0x22')]=_0x5885af[_0x50f5('0x22')]?_0x5885af[_0x50f5('0x22')]:undefined;this[_0x50f5('0x23')]=_0x5885af[_0x50f5('0x23')]?_0x5885af[_0x50f5('0x23')]:undefined;this[_0x50f5('0x24')]=_0x5885af[_0x50f5('0x24')]?_0x5885af[_0x50f5('0x24')]:undefined;this[_0x50f5('0x25')]=_0x5885af[_0x50f5('0x25')]?_0x5885af[_0x50f5('0x25')]:undefined;this['dialQueueProject']=_0x5885af[_0x50f5('0x25')]?_0x5885af['SquareProject'][_0x50f5('0x0')]:undefined;this['dialAMDActive']=_0x5885af[_0x50f5('0x26')]||![];this[_0x50f5('0x27')]=_0x5885af[_0x50f5('0x27')];this[_0x50f5('0x28')]=_0x5885af['dialAMDGreeting'];this[_0x50f5('0x29')]=_0x5885af[_0x50f5('0x29')];this['dialAMDTotalAnalysisTime']=_0x5885af[_0x50f5('0x2a')];this[_0x50f5('0x2b')]=_0x5885af['dialAMDMinWordLength'];this[_0x50f5('0x2c')]=_0x5885af[_0x50f5('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x5885af[_0x50f5('0x2d')];this[_0x50f5('0x2e')]=_0x5885af[_0x50f5('0x2e')];this[_0x50f5('0x2f')]=_0x5885af['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x2a2d=['dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2a2d,0x1c7));var _0xd2a2=function(_0x9d39e9,_0x3aebc9){_0x9d39e9=_0x9d39e9-0x0;var _0x4ac75b=_0x2a2d[_0x9d39e9];return _0x4ac75b;};'use strict';function Campaign(_0x4babd6){this['id']=_0x4babd6['id']||0x0;this[_0xd2a2('0x0')]=_0x4babd6[_0xd2a2('0x0')]||'';this[_0xd2a2('0x1')]=_0x4babd6[_0xd2a2('0x1')]||_0xd2a2('0x2');this[_0xd2a2('0x3')]=0x0;this[_0xd2a2('0x4')]=0x0;this[_0xd2a2('0x5')]=0x0;this[_0xd2a2('0x6')]=0x0;this[_0xd2a2('0x7')]='';this[_0xd2a2('0x8')]=!![];this[_0xd2a2('0x9')]=_0x4babd6[_0xd2a2('0x9')];this[_0xd2a2('0xa')]=_0x4babd6['limitCalls'];this['dialTimezone']=_0x4babd6[_0xd2a2('0xb')]||null;this[_0xd2a2('0xc')]=_0x4babd6[_0xd2a2('0xc')]?_0x4babd6[_0xd2a2('0xc')]:null;this['dialOriginateCallerIdName']=_0x4babd6[_0xd2a2('0xd')];this['dialOriginateCallerIdNumber']=_0x4babd6[_0xd2a2('0xe')];this[_0xd2a2('0xf')]=_0x4babd6[_0xd2a2('0xf')]||0x1e;this[_0xd2a2('0x10')]=_0x4babd6[_0xd2a2('0x10')];this[_0xd2a2('0x11')]=_0x4babd6[_0xd2a2('0x11')];this[_0xd2a2('0x12')]=_0x4babd6['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x4babd6[_0xd2a2('0x13')];this['dialNoAnswerMaxRetry']=_0x4babd6[_0xd2a2('0x14')];this[_0xd2a2('0x15')]=_0x4babd6[_0xd2a2('0x15')];this[_0xd2a2('0x16')]=_0x4babd6['dialGlobalMaxRetry'];this[_0xd2a2('0x17')]=_0x4babd6['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x4babd6['dialNoSuchNumberRetryFrequency']||0x96;this[_0xd2a2('0x18')]=_0x4babd6[_0xd2a2('0x18')]||0x3;this[_0xd2a2('0x19')]=_0x4babd6[_0xd2a2('0x19')]||0x96;this[_0xd2a2('0x1a')]=_0x4babd6[_0xd2a2('0x1a')]||0x3;this[_0xd2a2('0x1b')]=_0x4babd6['dialAbandonedRetryFrequency']||0x96;this[_0xd2a2('0x1c')]=_0x4babd6[_0xd2a2('0x1c')]||0x3;this[_0xd2a2('0x1d')]=_0x4babd6[_0xd2a2('0x1d')]||0x96;this[_0xd2a2('0x1e')]=_0x4babd6[_0xd2a2('0x1e')]||0x3;this[_0xd2a2('0x1f')]=_0x4babd6[_0xd2a2('0x1f')]||0x96;this[_0xd2a2('0x20')]=_0x4babd6['dialOrderByScheduledAt']||_0xd2a2('0x21');this['dialPrefix']=_0x4babd6[_0xd2a2('0x22')]||undefined;this[_0xd2a2('0x23')]=_0x4babd6[_0xd2a2('0x23')]||undefined;this[_0xd2a2('0x24')]=_0x4babd6[_0xd2a2('0x24')]||undefined;this[_0xd2a2('0x25')]=_0x4babd6[_0xd2a2('0x25')]?_0x4babd6[_0xd2a2('0x25')]:undefined;this[_0xd2a2('0x26')]=_0x4babd6[_0xd2a2('0x26')]?_0x4babd6[_0xd2a2('0x26')]:undefined;this['Interval']=_0x4babd6[_0xd2a2('0x27')]?_0x4babd6[_0xd2a2('0x27')]:undefined;this[_0xd2a2('0x28')]=_0x4babd6[_0xd2a2('0x28')]?_0x4babd6[_0xd2a2('0x28')]:undefined;this[_0xd2a2('0x29')]=_0x4babd6[_0xd2a2('0x28')]?_0x4babd6[_0xd2a2('0x28')][_0xd2a2('0x0')]:undefined;this[_0xd2a2('0x2a')]=_0x4babd6['dialAMDActive']||![];this[_0xd2a2('0x2b')]=_0x4babd6[_0xd2a2('0x2b')];this[_0xd2a2('0x2c')]=_0x4babd6[_0xd2a2('0x2c')];this[_0xd2a2('0x2d')]=_0x4babd6['dialAMDAfterGreetingSilence'];this[_0xd2a2('0x2e')]=_0x4babd6[_0xd2a2('0x2e')];this['dialAMDMinWordLength']=_0x4babd6[_0xd2a2('0x2f')];this[_0xd2a2('0x30')]=_0x4babd6[_0xd2a2('0x30')];this[_0xd2a2('0x31')]=_0x4babd6[_0xd2a2('0x31')];this[_0xd2a2('0x32')]=_0x4babd6[_0xd2a2('0x32')];this[_0xd2a2('0x33')]=_0x4babd6[_0xd2a2('0x33')];}module[_0xd2a2('0x34')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 22d6316..addaa0c 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 _0x88c3=['exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','disposition','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','connectedlinenum','context','uniqueid','linkedid'];(function(_0x1a0daa,_0x2a4634){var _0x1dbe15=function(_0xa8ab22){while(--_0xa8ab22){_0x1a0daa['push'](_0x1a0daa['shift']());}};_0x1dbe15(++_0x2a4634);}(_0x88c3,0x1ee));var _0x388c=function(_0x2bacd1,_0x1efeed){_0x2bacd1=_0x2bacd1-0x0;var _0x5c93d9=_0x88c3[_0x2bacd1];return _0x5c93d9;};'use strict';function Channel(){this[_0x388c('0x0')]=null;this['channel']='';this[_0x388c('0x1')]='';this['calleridnum']=0x0;this['calleridname']='';this[_0x388c('0x2')]=undefined;this['connectedlinename']=undefined;this['accountcode']=0x0;this[_0x388c('0x3')]='';this[_0x388c('0x4')]=0x0;this[_0x388c('0x5')]=0x0;this[_0x388c('0x6')]=0x0;this[_0x388c('0x7')]=![];this[_0x388c('0x8')]=null;this['endtime']=null;this[_0x388c('0x9')]=![];this[_0x388c('0xa')]=![];this[_0x388c('0xb')]='';this[_0x388c('0xc')]='';this[_0x388c('0xd')]=0x0;this[_0x388c('0xe')]=0x0;this[_0x388c('0xf')]=0x0;this[_0x388c('0x10')]=null;this['tag']=null;this[_0x388c('0x11')]=null;this['monitor']=![];this['monitorFilename']=null;this[_0x388c('0x12')]=null;this[_0x388c('0x13')]=[];this[_0x388c('0x14')]=undefined;this[_0x388c('0x15')]=undefined;this[_0x388c('0x16')]=undefined;this[_0x388c('0x17')]=0x0;}module[_0x388c('0x18')]=Channel; \ No newline at end of file +var _0x0abf=['monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','destinationchannel','calleridnum','connectedlinename','context','uniqueid','linkedid','exten','answered','answertime','endtime','abandoned','lastapplication','lastdata','duration','holdtime','type','tag'];(function(_0x69b0bf,_0x248a70){var _0x53a201=function(_0x5d1c3f){while(--_0x5d1c3f){_0x69b0bf['push'](_0x69b0bf['shift']());}};_0x53a201(++_0x248a70);}(_0x0abf,0xe8));var _0xf0ab=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0abf[_0x14add3];return _0x4a174f;};'use strict';function Channel(){this[_0xf0ab('0x0')]=null;this['channel']='';this[_0xf0ab('0x1')]='';this[_0xf0ab('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0xf0ab('0x3')]=undefined;this['accountcode']=0x0;this[_0xf0ab('0x4')]='';this[_0xf0ab('0x5')]=0x0;this[_0xf0ab('0x6')]=0x0;this[_0xf0ab('0x7')]=0x0;this[_0xf0ab('0x8')]=![];this[_0xf0ab('0x9')]=null;this[_0xf0ab('0xa')]=null;this['unmanaged']=![];this[_0xf0ab('0xb')]=![];this[_0xf0ab('0xc')]='';this[_0xf0ab('0xd')]='';this[_0xf0ab('0xe')]=0x0;this['billableseconds']=0x0;this[_0xf0ab('0xf')]=0x0;this[_0xf0ab('0x10')]=null;this[_0xf0ab('0x11')]=null;this['disposition']=null;this['monitor']=![];this[_0xf0ab('0x12')]=null;this['queue']=null;this[_0xf0ab('0x13')]=[];this[_0xf0ab('0x14')]=undefined;this[_0xf0ab('0x15')]=undefined;this[_0xf0ab('0x16')]=undefined;this[_0xf0ab('0x17')]=0x0;}module[_0xf0ab('0x18')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index dd1149e..898de77 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 _0xdb2f=['exports','name','username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x101cb3,_0x3607db){var _0x3a6d75=function(_0x34e5ac){while(--_0x34e5ac){_0x101cb3['push'](_0x101cb3['shift']());}};_0x3a6d75(++_0x3607db);}(_0xdb2f,0xcd));var _0xfdb2=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xdb2f[_0x4fc9e6];return _0x551d28;};'use strict';function DeskAccount(_0x5af6cc){this['id']=_0x5af6cc['id']||0x0;this[_0xfdb2('0x0')]=_0x5af6cc['name']||'';this[_0xfdb2('0x1')]=_0x5af6cc['username']||'';this[_0xfdb2('0x2')]=_0x5af6cc[_0xfdb2('0x2')]||'';this['authType']=_0x5af6cc['authType']||'';this[_0xfdb2('0x3')]=_0x5af6cc['password']||'';this['consumerKey']=_0x5af6cc[_0xfdb2('0x4')]||'';this['consumerSecret']=_0x5af6cc[_0xfdb2('0x5')]||'';this['token']=_0x5af6cc[_0xfdb2('0x6')]||'';this[_0xfdb2('0x7')]=_0x5af6cc[_0xfdb2('0x7')]||'';this[_0xfdb2('0x8')]=_0x5af6cc[_0xfdb2('0x8')]||'';this[_0xfdb2('0x9')]=_0x5af6cc[_0xfdb2('0x9')]||'';this[_0xfdb2('0xa')]=_0x5af6cc[_0xfdb2('0xa')]||{};}module[_0xfdb2('0xb')]=DeskAccount; \ No newline at end of file +var _0xad07=['username','remoteUri','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xad07,0xbf));var _0x7ad0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xad07[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x218471){this['id']=_0x218471['id']||0x0;this[_0x7ad0('0x0')]=_0x218471[_0x7ad0('0x0')]||'';this[_0x7ad0('0x1')]=_0x218471[_0x7ad0('0x1')]||'';this[_0x7ad0('0x2')]=_0x218471[_0x7ad0('0x2')]||'';this['authType']=_0x218471['authType']||'';this[_0x7ad0('0x3')]=_0x218471[_0x7ad0('0x3')]||'';this[_0x7ad0('0x4')]=_0x218471[_0x7ad0('0x4')]||'';this[_0x7ad0('0x5')]=_0x218471[_0x7ad0('0x5')]||'';this['token']=_0x218471[_0x7ad0('0x6')]||'';this[_0x7ad0('0x7')]=_0x218471[_0x7ad0('0x7')]||'';this[_0x7ad0('0x8')]=_0x218471[_0x7ad0('0x8')]||'';this[_0x7ad0('0x9')]=_0x218471[_0x7ad0('0x9')]||'';this[_0x7ad0('0xa')]=_0x218471['Configurations']||{};}module[_0x7ad0('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 411bf28..e2debcb 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 _0xdbf8=['serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x1719cf,_0x7f59e6){var _0x461917=function(_0x4fdb19){while(--_0x4fdb19){_0x1719cf['push'](_0x1719cf['shift']());}};_0x461917(++_0x7f59e6);}(_0xdbf8,0x1c1));var _0x8dbf=function(_0x15315b,_0x7c1073){_0x15315b=_0x15315b-0x0;var _0x654bac=_0xdbf8[_0x15315b];return _0x654bac;};'use strict';function Dynamics365Account(_0x399fd6){this['id']=_0x399fd6['id']||0x0;this[_0x8dbf('0x0')]=_0x399fd6[_0x8dbf('0x0')]||'';this[_0x8dbf('0x1')]=_0x399fd6[_0x8dbf('0x1')]||'';this[_0x8dbf('0x2')]=_0x399fd6[_0x8dbf('0x2')]||'';this[_0x8dbf('0x3')]=_0x399fd6[_0x8dbf('0x3')]||'';this[_0x8dbf('0x4')]=_0x399fd6[_0x8dbf('0x4')]||'';this[_0x8dbf('0x5')]=_0x399fd6['clientId']||'';this[_0x8dbf('0x6')]=_0x399fd6['clientSecret']||{};this[_0x8dbf('0x7')]=_0x399fd6[_0x8dbf('0x7')]||'';this[_0x8dbf('0x8')]=_0x399fd6['modernAuthentication']||![];this[_0x8dbf('0x9')]=_0x399fd6[_0x8dbf('0x9')]||{};this[_0x8dbf('0xa')]=_0x399fd6[_0x8dbf('0xa')]||{};}module[_0x8dbf('0xb')]=Dynamics365Account; \ No newline at end of file +var _0x2737=['exports','username','password','remoteUri','tenantId','clientId','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x27b283,_0x8bb83b){var _0x4dcaf3=function(_0x526743){while(--_0x526743){_0x27b283['push'](_0x27b283['shift']());}};_0x4dcaf3(++_0x8bb83b);}(_0x2737,0xdd));var _0x7273=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2737[_0xbca1b1];return _0x4e1686;};'use strict';function Dynamics365Account(_0x16985d){this['id']=_0x16985d['id']||0x0;this['name']=_0x16985d['name']||'';this[_0x7273('0x0')]=_0x16985d[_0x7273('0x0')]||'';this[_0x7273('0x1')]=_0x16985d[_0x7273('0x1')]||'';this[_0x7273('0x2')]=_0x16985d[_0x7273('0x2')]||'';this[_0x7273('0x3')]=_0x16985d[_0x7273('0x3')]||'';this[_0x7273('0x4')]=_0x16985d[_0x7273('0x4')]||'';this['clientSecret']=_0x16985d['clientSecret']||{};this[_0x7273('0x5')]=_0x16985d[_0x7273('0x5')]||'';this[_0x7273('0x6')]=_0x16985d['modernAuthentication']||![];this['Configurations']=_0x16985d[_0x7273('0x7')]||{};this['CloudProvider']=_0x16985d[_0x7273('0x8')]||{};}module[_0x7273('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 2683f38..8f3b252 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 _0x19ba=['ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','description'];(function(_0x49b59f,_0x1f3a28){var _0x46f0de=function(_0x3841f1){while(--_0x3841f1){_0x49b59f['push'](_0x49b59f['shift']());}};_0x46f0de(++_0x1f3a28);}(_0x19ba,0xfe));var _0xa19b=function(_0x41b8f9,_0x2e5a01){_0x41b8f9=_0x41b8f9-0x0;var _0x5145d1=_0x19ba[_0x41b8f9];return _0x5145d1;};'use strict';function FaxAccount(_0x496741){this['id']=_0x496741['id']||0x0;this['name']=_0x496741['name']||'';this['description']=_0x496741[_0xa19b('0x0')];this[_0xa19b('0x1')]=_0x496741[_0xa19b('0x1')];this['headerinfo']=_0x496741[_0xa19b('0x2')];this['localstationid']=_0x496741[_0xa19b('0x3')];this[_0xa19b('0x4')]=_0x496741[_0xa19b('0x4')]||0x960;this[_0xa19b('0x5')]=_0x496741[_0xa19b('0x5')]||0x3840;this['modem']=_0x496741['modem']||_0xa19b('0x6');this[_0xa19b('0x7')]=_0x496741['gateway']||'no';this['faxdetect']=_0x496741[_0xa19b('0x8')]||'no';this[_0xa19b('0x9')]=_0x496741[_0xa19b('0x9')]||0x1388;this['tech']=_0x496741[_0xa19b('0xa')]||_0xa19b('0xb');this[_0xa19b('0xc')]=_0x496741[_0xa19b('0xc')]?_0x496741[_0xa19b('0xc')]:undefined;this[_0xa19b('0xd')]=_0x496741[_0xa19b('0xd')];this[_0xa19b('0xe')]=_0x496741['key'];}module['exports']=FaxAccount; \ No newline at end of file +var _0xd012=['Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x2fdf6a,_0x11071a){var _0x3a53f8=function(_0x442686){while(--_0x442686){_0x2fdf6a['push'](_0x2fdf6a['shift']());}};_0x3a53f8(++_0x11071a);}(_0xd012,0xe3));var _0x2d01=function(_0x4c1c2f,_0x541c58){_0x4c1c2f=_0x4c1c2f-0x0;var _0x25d783=_0xd012[_0x4c1c2f];return _0x25d783;};'use strict';function FaxAccount(_0x45a8e0){this['id']=_0x45a8e0['id']||0x0;this[_0x2d01('0x0')]=_0x45a8e0[_0x2d01('0x0')]||'';this[_0x2d01('0x1')]=_0x45a8e0[_0x2d01('0x1')];this[_0x2d01('0x2')]=_0x45a8e0[_0x2d01('0x2')];this[_0x2d01('0x3')]=_0x45a8e0[_0x2d01('0x3')];this[_0x2d01('0x4')]=_0x45a8e0[_0x2d01('0x4')];this[_0x2d01('0x5')]=_0x45a8e0[_0x2d01('0x5')]||0x960;this[_0x2d01('0x6')]=_0x45a8e0['maxrate']||0x3840;this[_0x2d01('0x7')]=_0x45a8e0[_0x2d01('0x7')]||'v17,v27,v29';this['gateway']=_0x45a8e0[_0x2d01('0x8')]||'no';this['faxdetect']=_0x45a8e0[_0x2d01('0x9')]||'no';this[_0x2d01('0xa')]=_0x45a8e0[_0x2d01('0xa')]||0x1388;this[_0x2d01('0xb')]=_0x45a8e0[_0x2d01('0xb')]||_0x2d01('0xc');this[_0x2d01('0xd')]=_0x45a8e0['Trunk']?_0x45a8e0[_0x2d01('0xd')]:undefined;this[_0x2d01('0xe')]=_0x45a8e0[_0x2d01('0xe')];this[_0x2d01('0xf')]=_0x45a8e0[_0x2d01('0xf')];}module['exports']=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 4114895..98d385c 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 _0x5738=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5738,0x18b));var _0x8573=function(_0x35731c,_0x5ab1d1){_0x35731c=_0x35731c-0x0;var _0x2f2957=_0x5738[_0x35731c];return _0x2f2957;};'use strict';function FreshdeskAccount(_0x25ed65){this['id']=_0x25ed65['id']||0x0;this[_0x8573('0x0')]=_0x25ed65['name']||'';this[_0x8573('0x1')]=_0x25ed65[_0x8573('0x1')]||'';this[_0x8573('0x2')]=_0x25ed65[_0x8573('0x3')]||'';this[_0x8573('0x4')]=_0x25ed65[_0x8573('0x4')]||'';this[_0x8573('0x5')]=_0x25ed65[_0x8573('0x5')]||'';this[_0x8573('0x6')]=_0x25ed65[_0x8573('0x6')]||{};}module[_0x8573('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xc1ac=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x4aadab,_0x378b5c){var _0x1f99a0=function(_0x7d36f9){while(--_0x7d36f9){_0x4aadab['push'](_0x4aadab['shift']());}};_0x1f99a0(++_0x378b5c);}(_0xc1ac,0xde));var _0xcc1a=function(_0x58822b,_0x2fa6c3){_0x58822b=_0x58822b-0x0;var _0x48a8c8=_0xc1ac[_0x58822b];return _0x48a8c8;};'use strict';function FreshdeskAccount(_0x53955c){this['id']=_0x53955c['id']||0x0;this[_0xcc1a('0x0')]=_0x53955c['name']||'';this[_0xcc1a('0x1')]=_0x53955c[_0xcc1a('0x1')]||'';this[_0xcc1a('0x2')]=_0x53955c['token']||'';this[_0xcc1a('0x3')]=_0x53955c[_0xcc1a('0x3')]||'';this[_0xcc1a('0x4')]=_0x53955c[_0xcc1a('0x4')]||'';this[_0xcc1a('0x5')]=_0x53955c['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 74c829c..99359f8 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 _0x7b27=['name','username','apiKey','remoteUri','serverUrl','Configurations'];(function(_0x5131ca,_0x5a31db){var _0x51cb56=function(_0x1e5db9){while(--_0x1e5db9){_0x5131ca['push'](_0x5131ca['shift']());}};_0x51cb56(++_0x5a31db);}(_0x7b27,0x186));var _0x77b2=function(_0x1235a6,_0x52bcac){_0x1235a6=_0x1235a6-0x0;var _0x387652=_0x7b27[_0x1235a6];return _0x387652;};'use strict';function FreshsalesAccount(_0x24c18e){this['id']=_0x24c18e['id']||0x0;this['name']=_0x24c18e[_0x77b2('0x0')]||'';this[_0x77b2('0x1')]=_0x24c18e[_0x77b2('0x1')]||'';this[_0x77b2('0x2')]=_0x24c18e['token']||'';this[_0x77b2('0x3')]=_0x24c18e[_0x77b2('0x3')]||'';this['serverUrl']=_0x24c18e[_0x77b2('0x4')]||'';this[_0x77b2('0x5')]=_0x24c18e[_0x77b2('0x5')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file +var _0x4006=['name','username','remoteUri','serverUrl','Configurations'];(function(_0x655268,_0x90fd8){var _0x2840c8=function(_0x20a984){while(--_0x20a984){_0x655268['push'](_0x655268['shift']());}};_0x2840c8(++_0x90fd8);}(_0x4006,0x1c7));var _0x6400=function(_0x1583fa,_0x201e17){_0x1583fa=_0x1583fa-0x0;var _0x11b21a=_0x4006[_0x1583fa];return _0x11b21a;};'use strict';function FreshsalesAccount(_0x2ed8d6){this['id']=_0x2ed8d6['id']||0x0;this[_0x6400('0x0')]=_0x2ed8d6[_0x6400('0x0')]||'';this[_0x6400('0x1')]=_0x2ed8d6[_0x6400('0x1')]||'';this['apiKey']=_0x2ed8d6['token']||'';this[_0x6400('0x2')]=_0x2ed8d6['remoteUri']||'';this[_0x6400('0x3')]=_0x2ed8d6['serverUrl']||'';this['Configurations']=_0x2ed8d6[_0x6400('0x4')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 6d313b3..e0c31a3 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 _0xd7e8=['originalposition','channel','connectedlinenum','connectedlinename','context','exten','priority','holdtime','lastAssignedTo','voice','routealias','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','queuecallerexit'];(function(_0x22dcca,_0x441b6e){var _0x714bd=function(_0x4b9b82){while(--_0x4b9b82){_0x22dcca['push'](_0x22dcca['shift']());}};_0x714bd(++_0x441b6e);}(_0xd7e8,0xe6));var _0x8d7e=function(_0x1f40c8,_0x252145){_0x1f40c8=_0x1f40c8-0x0;var _0x50a5b7=_0xd7e8[_0x1f40c8];return _0x50a5b7;};'use strict';function QueueReport(){this[_0x8d7e('0x0')]=_0x8d7e('0x1');this['uniqueid']='';this[_0x8d7e('0x2')]='';this[_0x8d7e('0x3')]='';this[_0x8d7e('0x4')]='';this[_0x8d7e('0x5')]=null;this[_0x8d7e('0x6')]=null;this[_0x8d7e('0x7')]=0x1;this[_0x8d7e('0x8')]=0x1;this[_0x8d7e('0x9')]=![];this['queuecallerabandonAt']=null;this[_0x8d7e('0xa')]=![];this[_0x8d7e('0xb')]=null;this[_0x8d7e('0xc')]=![];this['queuecallerexitAt']=null;this[_0x8d7e('0xd')]=0x1;this[_0x8d7e('0xe')]='';this[_0x8d7e('0xf')]='';this[_0x8d7e('0x10')]='';this['accountcode']='';this[_0x8d7e('0x11')]='';this[_0x8d7e('0x12')]='';this[_0x8d7e('0x13')]='';this[_0x8d7e('0x14')]=0x0;this['assigned']=![];this[_0x8d7e('0x15')]='';this['motionChannel']=_0x8d7e('0x16');this[_0x8d7e('0x17')]=null;this[_0x8d7e('0x18')]=0x0;this[_0x8d7e('0x19')]={};}module[_0x8d7e('0x1a')]=QueueReport; \ No newline at end of file +var _0xc3e0=['queue','queuecallerjoinAt','queuecallerleaveAt','count','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','exten','priority','assigned','voice','routealias','mohtime','variables','exports','type','inbound','uniqueid','calleridnum'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xc3e0,0xf6));var _0x0c3e=function(_0x3101e2,_0x1dcacc){_0x3101e2=_0x3101e2-0x0;var _0xef19b6=_0xc3e0[_0x3101e2];return _0xef19b6;};'use strict';function QueueReport(){this[_0x0c3e('0x0')]=_0x0c3e('0x1');this[_0x0c3e('0x2')]='';this[_0x0c3e('0x3')]='';this['calleridname']='';this[_0x0c3e('0x4')]='';this[_0x0c3e('0x5')]=null;this[_0x0c3e('0x6')]=null;this['position']=0x1;this[_0x0c3e('0x7')]=0x1;this['queuecallerabandon']=![];this[_0x0c3e('0x8')]=null;this['queuecallercomplete']=![];this[_0x0c3e('0x9')]=null;this[_0x0c3e('0xa')]=![];this[_0x0c3e('0xb')]=null;this[_0x0c3e('0xc')]=0x1;this[_0x0c3e('0xd')]='';this[_0x0c3e('0xe')]='';this[_0x0c3e('0xf')]='';this[_0x0c3e('0x10')]='';this['context']='';this[_0x0c3e('0x11')]='';this[_0x0c3e('0x12')]='';this['holdtime']=0x0;this[_0x0c3e('0x13')]=![];this['lastAssignedTo']='';this['motionChannel']=_0x0c3e('0x14');this[_0x0c3e('0x15')]=null;this[_0x0c3e('0x16')]=0x0;this[_0x0c3e('0x17')]={};}module[_0x0c3e('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index eb6d577..7d8adc4 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 _0x945c=['securityToken','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x7d3716,_0x581db3){var _0x2a0869=function(_0x10682e){while(--_0x10682e){_0x7d3716['push'](_0x7d3716['shift']());}};_0x2a0869(++_0x581db3);}(_0x945c,0x165));var _0xc945=function(_0x2f9f8a,_0x553a25){_0x2f9f8a=_0x2f9f8a-0x0;var _0x1a78eb=_0x945c[_0x2f9f8a];return _0x1a78eb;};'use strict';function SalesforceAccount(_0x5de590){this['id']=_0x5de590['id']||0x0;this[_0xc945('0x0')]=_0x5de590[_0xc945('0x0')]||'';this['username']=_0x5de590[_0xc945('0x1')]||'';this['remoteUri']=_0x5de590[_0xc945('0x2')]||'';this[_0xc945('0x3')]=_0x5de590[_0xc945('0x3')]||'';this['clientId']=_0x5de590[_0xc945('0x4')]||'';this[_0xc945('0x5')]=_0x5de590[_0xc945('0x5')]||'';this[_0xc945('0x6')]=_0x5de590[_0xc945('0x6')]||'';this[_0xc945('0x7')]=_0x5de590['type']||_0xc945('0x8');this[_0xc945('0x9')]=_0x5de590[_0xc945('0x9')]||'';this['Configurations']=_0x5de590[_0xc945('0xa')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file +var _0x1baf=['type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password','clientId','clientSecret'];(function(_0x2aaf7d,_0x4d4084){var _0x3d177d=function(_0x3c2295){while(--_0x3c2295){_0x2aaf7d['push'](_0x2aaf7d['shift']());}};_0x3d177d(++_0x4d4084);}(_0x1baf,0x14e));var _0xf1ba=function(_0x1ac823,_0x3ff2e5){_0x1ac823=_0x1ac823-0x0;var _0x53f19d=_0x1baf[_0x1ac823];return _0x53f19d;};'use strict';function SalesforceAccount(_0x2a75fa){this['id']=_0x2a75fa['id']||0x0;this[_0xf1ba('0x0')]=_0x2a75fa[_0xf1ba('0x0')]||'';this['username']=_0x2a75fa[_0xf1ba('0x1')]||'';this[_0xf1ba('0x2')]=_0x2a75fa[_0xf1ba('0x2')]||'';this[_0xf1ba('0x3')]=_0x2a75fa[_0xf1ba('0x3')]||'';this[_0xf1ba('0x4')]=_0x2a75fa['clientId']||'';this[_0xf1ba('0x5')]=_0x2a75fa[_0xf1ba('0x5')]||'';this['securityToken']=_0x2a75fa['securityToken']||'';this[_0xf1ba('0x6')]=_0x2a75fa[_0xf1ba('0x6')]||_0xf1ba('0x7');this[_0xf1ba('0x8')]=_0x2a75fa[_0xf1ba('0x8')]||'';this[_0xf1ba('0x9')]=_0x2a75fa[_0xf1ba('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 94bb8a5..67e2103 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 _0x1a64=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x47470f,_0x411315){var _0x5b16a4=function(_0x781291){while(--_0x781291){_0x47470f['push'](_0x47470f['shift']());}};_0x5b16a4(++_0x411315);}(_0x1a64,0x149));var _0x41a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a64[_0x3dd15e];return _0x231fd0;};'use strict';function ServicenowAccount(_0x457443){this['id']=_0x457443['id']||0x0;this[_0x41a6('0x0')]=_0x457443['name']||'';this[_0x41a6('0x1')]=_0x457443[_0x41a6('0x1')]||'';this[_0x41a6('0x2')]=_0x457443[_0x41a6('0x2')]||'';this['remoteUri']=_0x457443[_0x41a6('0x3')]||'';this[_0x41a6('0x4')]=_0x457443[_0x41a6('0x4')]||'';this[_0x41a6('0x5')]=_0x457443[_0x41a6('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x01c9=['name','username','remoteUri','serverUrl','Configurations','exports'];(function(_0x1e7077,_0x3e57b3){var _0x2bb221=function(_0x4452e2){while(--_0x4452e2){_0x1e7077['push'](_0x1e7077['shift']());}};_0x2bb221(++_0x3e57b3);}(_0x01c9,0x16e));var _0x901c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01c9[_0x20a584];return _0x4b41a8;};'use strict';function ServicenowAccount(_0x1265f7){this['id']=_0x1265f7['id']||0x0;this['name']=_0x1265f7[_0x901c('0x0')]||'';this[_0x901c('0x1')]=_0x1265f7[_0x901c('0x1')]||'';this['password']=_0x1265f7['password']||'';this['remoteUri']=_0x1265f7[_0x901c('0x2')]||'';this['serverUrl']=_0x1265f7[_0x901c('0x3')]||'';this[_0x901c('0x4')]=_0x1265f7[_0x901c('0x4')]||{};}module[_0x901c('0x5')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index ca3048e..b614bc1 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 _0x61ca=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x322dac,_0xa46f61){var _0x561bf1=function(_0x4bd1c4){while(--_0x4bd1c4){_0x322dac['push'](_0x322dac['shift']());}};_0x561bf1(++_0xa46f61);}(_0x61ca,0x1b0));var _0xa61c=function(_0xa5b19d,_0x4b4750){_0xa5b19d=_0xa5b19d-0x0;var _0x28049e=_0x61ca[_0xa5b19d];return _0x28049e;};'use strict';function SugarcrmAccount(_0x278871){this['id']=_0x278871['id']||0x0;this[_0xa61c('0x0')]=_0x278871[_0xa61c('0x0')]||'';this[_0xa61c('0x1')]=_0x278871['username']||'';this[_0xa61c('0x2')]=_0x278871[_0xa61c('0x2')]||'';this[_0xa61c('0x3')]=_0x278871[_0xa61c('0x3')]||'';this[_0xa61c('0x4')]=_0x278871['serverUrl']||'';this[_0xa61c('0x5')]=_0x278871[_0xa61c('0x5')]||{};}module[_0xa61c('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xb786=['serverUrl','Configurations','username','password','remoteUri'];(function(_0x44fef1,_0x132cf4){var _0x3c3a04=function(_0x175a90){while(--_0x175a90){_0x44fef1['push'](_0x44fef1['shift']());}};_0x3c3a04(++_0x132cf4);}(_0xb786,0x179));var _0x6b78=function(_0x58a4b5,_0x182439){_0x58a4b5=_0x58a4b5-0x0;var _0x51821d=_0xb786[_0x58a4b5];return _0x51821d;};'use strict';function SugarcrmAccount(_0x42f64a){this['id']=_0x42f64a['id']||0x0;this['name']=_0x42f64a['name']||'';this[_0x6b78('0x0')]=_0x42f64a[_0x6b78('0x0')]||'';this[_0x6b78('0x1')]=_0x42f64a['password']||'';this['remoteUri']=_0x42f64a[_0x6b78('0x2')]||'';this[_0x6b78('0x3')]=_0x42f64a['serverUrl']||'';this[_0x6b78('0x4')]=_0x42f64a[_0x6b78('0x4')]||{};}module['exports']=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index e31a5d5..78626f2 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 _0xb1a4=['name','accountcode','state','unknown','stateTime','status','address','exports'];(function(_0x23f19e,_0x4d583b){var _0x2a95d4=function(_0x5bb558){while(--_0x5bb558){_0x23f19e['push'](_0x23f19e['shift']());}};_0x2a95d4(++_0x4d583b);}(_0xb1a4,0x80));var _0x4b1a=function(_0x2478cc,_0x2dbfa0){_0x2478cc=_0x2478cc-0x0;var _0x1266a7=_0xb1a4[_0x2478cc];return _0x1266a7;};'use strict';function Telephone(_0x38a38){this['id']=_0x38a38['id']||0x0;this[_0x4b1a('0x0')]=_0x38a38[_0x4b1a('0x0')]||'';this[_0x4b1a('0x1')]=_0x38a38[_0x4b1a('0x1')]||'';this[_0x4b1a('0x2')]=_0x4b1a('0x3');this[_0x4b1a('0x4')]=0x0;this[_0x4b1a('0x5')]=_0x4b1a('0x3');this[_0x4b1a('0x6')]='';}module[_0x4b1a('0x7')]=Telephone; \ No newline at end of file +var _0xb10d=['accountcode','state','unknown','stateTime','status','address','exports','name'];(function(_0x1f31c3,_0x5bef05){var _0x46ed9c=function(_0x257201){while(--_0x257201){_0x1f31c3['push'](_0x1f31c3['shift']());}};_0x46ed9c(++_0x5bef05);}(_0xb10d,0x17f));var _0xdb10=function(_0x20a930,_0x1f2361){_0x20a930=_0x20a930-0x0;var _0x594268=_0xb10d[_0x20a930];return _0x594268;};'use strict';function Telephone(_0x27394b){this['id']=_0x27394b['id']||0x0;this['name']=_0x27394b[_0xdb10('0x0')]||'';this[_0xdb10('0x1')]=_0x27394b[_0xdb10('0x1')]||'';this[_0xdb10('0x2')]=_0xdb10('0x3');this[_0xdb10('0x4')]=0x0;this[_0xdb10('0x5')]=_0xdb10('0x3');this[_0xdb10('0x6')]='';}module[_0xdb10('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 cf0eefd..353ad8c 100644 --- a/server/services/ami/model/template.js +++ b/server/services/ami/model/template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['exports','name'];(function(_0x17f833,_0x33833f){var _0x45201b=function(_0x91ecd1){while(--_0x91ecd1){_0x17f833['push'](_0x17f833['shift']());}};_0x45201b(++_0x33833f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xa9e0=['exports','name'];(function(_0x1f4cce,_0x201785){var _0x1418b5=function(_0x62e456){while(--_0x62e456){_0x1f4cce['push'](_0x1f4cce['shift']());}};_0x1418b5(++_0x201785);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'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 ffed4df..8abd051 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x4e82d3,_0x452400){var _0x441fc2=function(_0x582de9){while(--_0x582de9){_0x4e82d3['push'](_0x4e82d3['shift']());}};_0x441fc2(++_0x452400);}(_0x4fc2,0x111));var _0x24fc=function(_0x4d4a06,_0x30289a){_0x4d4a06=_0x4d4a06-0x0;var _0x1dbcd8=_0x4fc2[_0x4d4a06];return _0x1dbcd8;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xbaf0=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x4e697a,_0x56a14b){var _0x88850c=function(_0x4e368a){while(--_0x4e368a){_0x4e697a['push'](_0x4e697a['shift']());}};_0x88850c(++_0x56a14b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';function Trigger(_0x61caa9){this['id']=_0x61caa9['id']||0x0;this[_0x0baf('0x0')]=_0x61caa9[_0x0baf('0x0')]||'';this[_0x0baf('0x1')]=_0x61caa9[_0x0baf('0x1')]||_0x0baf('0x2');this[_0x0baf('0x3')]=_0x61caa9['status']||![];this[_0x0baf('0x4')]=_0x61caa9[_0x0baf('0x4')]||[];this[_0x0baf('0x5')]=_0x61caa9[_0x0baf('0x5')]||[];this[_0x0baf('0x6')]=_0x61caa9[_0x0baf('0x6')]||[];}module[_0x0baf('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 311e0be..831981c 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 _0xd503=['domainport','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host'];(function(_0x261e29,_0x10fffd){var _0x25ef43=function(_0x21b8e7){while(--_0x21b8e7){_0x261e29['push'](_0x261e29['shift']());}};_0x25ef43(++_0x10fffd);}(_0xd503,0xb9));var _0x3d50=function(_0x105d1f,_0x428c21){_0x105d1f=_0x105d1f-0x0;var _0x404d82=_0xd503[_0x105d1f];return _0x404d82;};'use strict';function Trunk(_0x1c4fd0){this['id']=_0x1c4fd0['id']||0x0;this['active']=_0x1c4fd0[_0x3d50('0x0')]||![];this[_0x3d50('0x1')]=_0x1c4fd0['name']||'';this[_0x3d50('0x2')]=_0x3d50('0x3');this[_0x3d50('0x4')]=0x0;this[_0x3d50('0x5')]=_0x3d50('0x3');this[_0x3d50('0x6')]=_0x1c4fd0[_0x3d50('0x6')]&&_0x1c4fd0[_0x3d50('0x6')][_0x3d50('0x7')](':')?_0x1c4fd0[_0x3d50('0x6')][_0x3d50('0x8')](':')[0x0]:'';this[_0x3d50('0x9')]='';this['port']='';this['domain']='';this[_0x3d50('0xa')]='';this['refresh']='';this['stateRegistry']='unknown';this[_0x3d50('0xb')]='';this[_0x3d50('0xc')]='';this[_0x3d50('0xd')]=_0x1c4fd0[_0x3d50('0xd')]||'';}module[_0x3d50('0xe')]=Trunk; \ No newline at end of file +var _0x7bf2=['port','domain','domainport','refresh','registrationtime','address','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','split','host'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x7bf2,0xd4));var _0x27bf=function(_0x1dffc4,_0x3ab29e){_0x1dffc4=_0x1dffc4-0x0;var _0xb878c6=_0x7bf2[_0x1dffc4];return _0xb878c6;};'use strict';function Trunk(_0x25129e){this['id']=_0x25129e['id']||0x0;this[_0x27bf('0x0')]=_0x25129e[_0x27bf('0x0')]||![];this[_0x27bf('0x1')]=_0x25129e[_0x27bf('0x1')]||'';this[_0x27bf('0x2')]=_0x27bf('0x3');this[_0x27bf('0x4')]=0x0;this[_0x27bf('0x5')]=_0x27bf('0x3');this['registry']=_0x25129e[_0x27bf('0x6')]&&_0x25129e[_0x27bf('0x6')]['indexOf'](':')?_0x25129e[_0x27bf('0x6')][_0x27bf('0x7')](':')[0x0]:'';this[_0x27bf('0x8')]='';this[_0x27bf('0x9')]='';this[_0x27bf('0xa')]='';this[_0x27bf('0xb')]='';this[_0x27bf('0xc')]='';this['stateRegistry']=_0x27bf('0x3');this[_0x27bf('0xd')]='';this[_0x27bf('0xe')]='';this[_0x27bf('0xf')]=_0x25129e[_0x27bf('0xf')]||'';}module[_0x27bf('0x10')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index c199c56..8b55f14 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 _0x32f2=['none','mandatoryDisposition','exports','exten','recordingFormat'];(function(_0x41f3a1,_0x2a2e47){var _0x2573f7=function(_0x44cf3a){while(--_0x44cf3a){_0x41f3a1['push'](_0x41f3a1['shift']());}};_0x2573f7(++_0x2a2e47);}(_0x32f2,0x7b));var _0x232f=function(_0x4853d7,_0x2dc076){_0x4853d7=_0x4853d7-0x0;var _0x285853=_0x32f2[_0x4853d7];return _0x285853;};'use strict';function voiceExtension(_0x1094a4){this['id']=_0x1094a4['id']||0x0;this['exten']=_0x1094a4[_0x232f('0x0')]||'';this[_0x232f('0x1')]=_0x1094a4['recordingFormat']||_0x232f('0x2');this[_0x232f('0x3')]=_0x1094a4['mandatoryDisposition']||![];}module[_0x232f('0x4')]=voiceExtension; \ No newline at end of file +var _0xbd00=['recordingFormat','mandatoryDisposition','exports','exten'];(function(_0xa9e7f6,_0x3b6a74){var _0x17c7a4=function(_0x3b0de9){while(--_0x3b0de9){_0xa9e7f6['push'](_0xa9e7f6['shift']());}};_0x17c7a4(++_0x3b6a74);}(_0xbd00,0x147));var _0x0bd0=function(_0x1e441f,_0x51dcad){_0x1e441f=_0x1e441f-0x0;var _0x5dc8d4=_0xbd00[_0x1e441f];return _0x5dc8d4;};'use strict';function voiceExtension(_0x578088){this['id']=_0x578088['id']||0x0;this['exten']=_0x578088[_0x0bd0('0x0')]||'';this[_0x0bd0('0x1')]=_0x578088[_0x0bd0('0x1')]||'none';this[_0x0bd0('0x2')]=_0x578088[_0x0bd0('0x2')]||![];}module[_0x0bd0('0x3')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 5c1da2c..e420e0c 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 _0x7bd0=['fewestcalls','leastrecent','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','waiting','total','sumDuration','sumHoldTime','sumBillable','unmanaged','available','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','talking','unavailable','unknown','acw','acwTimeout','autopause','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','anonymous','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav','wav49','gsm'];(function(_0x30414a,_0x3c8ed5){var _0x77ca87=function(_0x2f53a7){while(--_0x2f53a7){_0x30414a['push'](_0x30414a['shift']());}};_0x77ca87(++_0x3c8ed5);}(_0x7bd0,0x111));var _0x07bd=function(_0x87506e,_0x5680ec){_0x87506e=_0x87506e-0x0;var _0x5496a4=_0x7bd0[_0x87506e];return _0x5496a4;};'use strict';var monitorFormat={'wav':_0x07bd('0x0'),'wav49':_0x07bd('0x1'),'gsm':_0x07bd('0x2')};var strategy={'fewestcalls':_0x07bd('0x3'),'leastrecent':_0x07bd('0x4'),'linear':_0x07bd('0x5'),'random':_0x07bd('0x6'),'ringall':_0x07bd('0x7'),'rr':'roundrobin','rrmemory':_0x07bd('0x8'),'rrordered':_0x07bd('0x9'),'wrandom':_0x07bd('0xa')};function VoiceQueue(_0x313548){this['id']=_0x313548['id']||0x0;this[_0x07bd('0xb')]=_0x313548[_0x07bd('0xb')]||'';this[_0x07bd('0xc')]=_0x313548['monitor_format']||'';this[_0x07bd('0xd')]=_0x313548['type']||_0x07bd('0xe');this[_0x07bd('0xf')]=0x0;this[_0x07bd('0x10')]=0x0;this['answered']=0x0;this[_0x07bd('0x11')]=0x0;this[_0x07bd('0x12')]=0x0;this[_0x07bd('0x13')]=0x0;this[_0x07bd('0x14')]=0x0;this['abandoned']=0x0;this[_0x07bd('0x15')]=0x0;this[_0x07bd('0x16')]=0x0;this[_0x07bd('0x17')]=0x0;this[_0x07bd('0x18')]=0x0;this[_0x07bd('0x19')]=0x0;this[_0x07bd('0x1a')]=0x0;this[_0x07bd('0x1b')]=0x0;this[_0x07bd('0x1c')]=0x0;this['ringing']=0x0;this['ringInUse']=0x0;this[_0x07bd('0x1d')]=0x0;this[_0x07bd('0x1e')]=0x0;this[_0x07bd('0x1f')]=0x0;this[_0x07bd('0x20')]=_0x313548[_0x07bd('0x20')]||![];this[_0x07bd('0x21')]=_0x313548[_0x07bd('0x21')]||0xa;this['autopause']=_0x313548[_0x07bd('0x22')]||'no';this['sendMessageOneNotActive']=!![];this[_0x07bd('0x23')]='';this[_0x07bd('0x24')]='';this[_0x07bd('0x25')]=0x0;this[_0x07bd('0x26')]=0x0;this[_0x07bd('0x27')]=_0x313548['dialTimezone']||null;this[_0x07bd('0x28')]=_0x313548[_0x07bd('0x28')]?_0x313548['dialGlobalInterval']:null;this[_0x07bd('0x29')]=_0x313548[_0x07bd('0x29')];this[_0x07bd('0x2a')]=_0x313548[_0x07bd('0x2a')]||_0x07bd('0x2b');this[_0x07bd('0x2c')]=_0x313548[_0x07bd('0x2c')]||0x0;this[_0x07bd('0x2d')]=_0x313548[_0x07bd('0x2d')]||0x0;this['dialPowerLevel']=_0x313548[_0x07bd('0x2e')]||0x1;this[_0x07bd('0x2f')]=_0x313548[_0x07bd('0x2f')]||_0x07bd('0x30');this[_0x07bd('0x31')]=_0x313548['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x313548[_0x07bd('0x32')]||0x258;this['dialOriginateCallerIdName']=_0x313548[_0x07bd('0x33')]||'anonymous';this['dialOriginateCallerIdNumber']=_0x313548[_0x07bd('0x34')]||_0x07bd('0x35');this[_0x07bd('0x36')]=_0x313548[_0x07bd('0x36')]||0x1e;this[_0x07bd('0x37')]=_0x313548[_0x07bd('0x37')]||'tTxX';this[_0x07bd('0x38')]=_0x313548[_0x07bd('0x38')]||0x3;this[_0x07bd('0x39')]=_0x313548[_0x07bd('0x39')]||undefined;this[_0x07bd('0x3a')]=_0x313548[_0x07bd('0x3a')]||0x3;this['dialCongestionRetryFrequency']=_0x313548['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x313548[_0x07bd('0x3b')]||0x3;this[_0x07bd('0x3c')]=_0x313548[_0x07bd('0x3c')]||0x96;this['dialNoAnswerMaxRetry']=_0x313548[_0x07bd('0x3d')]||0x3;this[_0x07bd('0x3e')]=_0x313548[_0x07bd('0x3e')]||0x96;this[_0x07bd('0x3f')]=_0x313548[_0x07bd('0x3f')]||0x3;this[_0x07bd('0x40')]=_0x313548['dialNoSuchNumberRetryFrequency']||0x96;this[_0x07bd('0x41')]=_0x313548[_0x07bd('0x41')]||0x3;this[_0x07bd('0x42')]=_0x313548[_0x07bd('0x42')]||0x96;this[_0x07bd('0x43')]=_0x313548[_0x07bd('0x43')]||0x3;this[_0x07bd('0x44')]=_0x313548[_0x07bd('0x44')]||0x96;this['dialMachineMaxRetry']=_0x313548['dialMachineMaxRetry']||0x3;this[_0x07bd('0x45')]=_0x313548[_0x07bd('0x45')]||0x96;this[_0x07bd('0x46')]=_0x313548['dialAgentRejectMaxRetry']||0x3;this[_0x07bd('0x47')]=_0x313548[_0x07bd('0x47')]||0x96;this[_0x07bd('0x48')]=_0x313548['callAdditionalPhoneAfterMin']||0x3;this['dialGlobalMaxRetry']=_0x313548[_0x07bd('0x49')]||0x4;this[_0x07bd('0x4a')]=_0x313548[_0x07bd('0x4a')]?_0x313548[_0x07bd('0x4a')]:undefined;this['TrunkBackup']=_0x313548[_0x07bd('0x4b')]?_0x313548[_0x07bd('0x4b')]:undefined;this[_0x07bd('0x4c')]=_0x313548['dialPrefix']||undefined;this[_0x07bd('0x4d')]=_0x313548[_0x07bd('0x4d')]?_0x313548['Interval']:undefined;this[_0x07bd('0x4e')]=_0x313548[_0x07bd('0x4e')]||_0x07bd('0x4f');this[_0x07bd('0x50')]=_0x313548['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x313548[_0x07bd('0x51')]||undefined;this['strategy']=strategy[_0x313548[_0x07bd('0x52')]];this[_0x07bd('0x53')]=!![];this[_0x07bd('0x54')]=_0x313548[_0x07bd('0x54')]||![];this[_0x07bd('0x55')]=_0x313548[_0x07bd('0x55')];this[_0x07bd('0x56')]=_0x313548[_0x07bd('0x56')];this[_0x07bd('0x57')]=_0x313548[_0x07bd('0x57')];this[_0x07bd('0x58')]=_0x313548[_0x07bd('0x58')];this[_0x07bd('0x59')]=_0x313548['dialAMDMinWordLength'];this[_0x07bd('0x5a')]=_0x313548[_0x07bd('0x5a')];this[_0x07bd('0x5b')]=_0x313548[_0x07bd('0x5b')];this['dialAMDSilenceThreshold']=_0x313548[_0x07bd('0x5c')];this[_0x07bd('0x5d')]=_0x313548[_0x07bd('0x5d')];this[_0x07bd('0x5e')]=0x0;this[_0x07bd('0x5f')]=0x0;this['timeout']=_0x313548['timeout'];this[_0x07bd('0x60')]=0x0;this[_0x07bd('0x61')]=0x0;this[_0x07bd('0x62')]=0x0;this[_0x07bd('0x63')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x07bd('0x64')]=0x0;this[_0x07bd('0x65')]=0x0;this[_0x07bd('0x66')]=0x0;this[_0x07bd('0x67')]=0x0;this[_0x07bd('0x68')]=0x0;this[_0x07bd('0x69')]=0x0;this[_0x07bd('0x6a')]=0x0;this['outboundReCallsDay']=0x0;this[_0x07bd('0x6b')]=0x0;this[_0x07bd('0x6c')]=undefined;this[_0x07bd('0x6d')]=undefined;this[_0x07bd('0x6e')]=undefined;this[_0x07bd('0x6f')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x07bd('0x70')]=0x0;this[_0x07bd('0x71')]=0x0;this[_0x07bd('0x72')]=0x0;this[_0x07bd('0x73')]=0x0;this[_0x07bd('0x74')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x07bd('0x75')]=0x0;this[_0x07bd('0x76')]=_0x313548[_0x07bd('0x77')]||0x14;this[_0x07bd('0x78')]=_0x313548['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x07bd('0x79')]=0x0;this[_0x07bd('0x7a')]=0x1;this[_0x07bd('0x7b')]=0x0;this[_0x07bd('0x7c')]=0x0;this[_0x07bd('0x7d')]=0x0;this[_0x07bd('0x7e')]=0x0;this[_0x07bd('0x7f')]=_0x313548[_0x07bd('0x7f')]||0x1e;this[_0x07bd('0x80')]=_0x313548['dialRecallInQueue']||![];this['dialPreviewAutoRecallMe']=!!_0x313548[_0x07bd('0x81')]||![];this[_0x07bd('0x82')]=!!_0x313548[_0x07bd('0x82')]||![];this[_0x07bd('0x83')]=_0x313548[_0x07bd('0x83')]||undefined;this[_0x07bd('0x84')]=_0x313548['dialAgiAfterHangupClient']||![];this[_0x07bd('0x85')]=_0x313548[_0x07bd('0x85')]||![];this[_0x07bd('0xc')]=monitorFormat[_0x313548[_0x07bd('0xc')]]?monitorFormat[_0x313548[_0x07bd('0xc')]]:undefined;this[_0x07bd('0x86')]=_0x313548['mandatoryDisposition']||![];this[_0x07bd('0x87')]=_0x313548[_0x07bd('0x87')]?_0x313548[_0x07bd('0x87')]:undefined;this[_0x07bd('0x88')]=![];}module[_0x07bd('0x89')]=VoiceQueue; \ No newline at end of file +var _0x4da5=['dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','exports','wav49','gsm','fewestcalls','linear','ringall','roundrobin','rrmemory','rrordered','name','monitor_format','type','waiting','total','answered','sumHoldTime','abandoned','available','busy','inUse','invalid','loggedIn','notInUse','onHold','paused','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency'];(function(_0x13ba93,_0x37c9e4){var _0x407f56=function(_0x3b7879){while(--_0x3b7879){_0x13ba93['push'](_0x13ba93['shift']());}};_0x407f56(++_0x37c9e4);}(_0x4da5,0x1b7));var _0x54da=function(_0x48bec2,_0x42c34c){_0x48bec2=_0x48bec2-0x0;var _0x53e3c5=_0x4da5[_0x48bec2];return _0x53e3c5;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x54da('0x0'),'gsm':_0x54da('0x1')};var strategy={'fewestcalls':_0x54da('0x2'),'leastrecent':'leastrecent','linear':_0x54da('0x3'),'random':'random','ringall':_0x54da('0x4'),'rr':_0x54da('0x5'),'rrmemory':_0x54da('0x6'),'rrordered':_0x54da('0x7'),'wrandom':'wrandom'};function VoiceQueue(_0x200b6c){this['id']=_0x200b6c['id']||0x0;this[_0x54da('0x8')]=_0x200b6c[_0x54da('0x8')]||'';this[_0x54da('0x9')]=_0x200b6c[_0x54da('0x9')]||'';this[_0x54da('0xa')]=_0x200b6c[_0x54da('0xa')]||'inbound';this[_0x54da('0xb')]=0x0;this[_0x54da('0xc')]=0x0;this[_0x54da('0xd')]=0x0;this['sumDuration']=0x0;this[_0x54da('0xe')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0x54da('0xf')]=0x0;this[_0x54da('0x10')]=0x0;this[_0x54da('0x11')]=0x0;this[_0x54da('0x12')]=0x0;this[_0x54da('0x13')]=0x0;this[_0x54da('0x14')]=0x0;this[_0x54da('0x15')]=0x0;this[_0x54da('0x16')]=0x0;this[_0x54da('0x17')]=0x0;this[_0x54da('0x18')]=0x0;this[_0x54da('0x19')]=0x0;this[_0x54da('0x1a')]=0x0;this[_0x54da('0x1b')]=0x0;this['unknown']=0x0;this[_0x54da('0x1c')]=_0x200b6c[_0x54da('0x1c')]||![];this[_0x54da('0x1d')]=_0x200b6c[_0x54da('0x1d')]||0xa;this['autopause']=_0x200b6c[_0x54da('0x1e')]||'no';this[_0x54da('0x1f')]=!![];this[_0x54da('0x20')]='';this[_0x54da('0x21')]='';this[_0x54da('0x22')]=0x0;this[_0x54da('0x23')]=0x0;this['dialTimezone']=_0x200b6c[_0x54da('0x24')]||null;this[_0x54da('0x25')]=_0x200b6c['dialGlobalInterval']?_0x200b6c[_0x54da('0x25')]:null;this[_0x54da('0x26')]=_0x200b6c['dialActive'];this['dialMethod']=_0x200b6c[_0x54da('0x27')]||'progressive';this[_0x54da('0x28')]=_0x200b6c[_0x54da('0x28')]||0x0;this['dialLimitQueue']=_0x200b6c[_0x54da('0x29')]||0x0;this[_0x54da('0x2a')]=_0x200b6c[_0x54da('0x2a')]||0x1;this[_0x54da('0x2b')]=_0x200b6c[_0x54da('0x2b')]||_0x54da('0x2c');this[_0x54da('0x2d')]=_0x200b6c[_0x54da('0x2d')]||0.03;this[_0x54da('0x2e')]=_0x200b6c[_0x54da('0x2e')]||0x258;this['dialOriginateCallerIdName']=_0x200b6c[_0x54da('0x2f')]||_0x54da('0x30');this[_0x54da('0x31')]=_0x200b6c[_0x54da('0x31')]||_0x54da('0x30');this[_0x54da('0x32')]=_0x200b6c['dialOriginateTimeout']||0x1e;this[_0x54da('0x33')]=_0x200b6c[_0x54da('0x33')]||_0x54da('0x34');this[_0x54da('0x35')]=_0x200b6c[_0x54da('0x35')]||0x3;this[_0x54da('0x36')]=_0x200b6c['dialQueueProject']||undefined;this[_0x54da('0x37')]=_0x200b6c['dialCongestionMaxRetry']||0x3;this[_0x54da('0x38')]=_0x200b6c[_0x54da('0x38')]||0x96;this[_0x54da('0x39')]=_0x200b6c['dialBusyMaxRetry']||0x3;this['dialBusyRetryFrequency']=_0x200b6c[_0x54da('0x3a')]||0x96;this[_0x54da('0x3b')]=_0x200b6c[_0x54da('0x3b')]||0x3;this['dialNoAnswerRetryFrequency']=_0x200b6c[_0x54da('0x3c')]||0x96;this[_0x54da('0x3d')]=_0x200b6c['dialNoSuchNumberMaxRetry']||0x3;this[_0x54da('0x3e')]=_0x200b6c[_0x54da('0x3e')]||0x96;this[_0x54da('0x3f')]=_0x200b6c['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x200b6c[_0x54da('0x40')]||0x96;this['dialAbandonedMaxRetry']=_0x200b6c[_0x54da('0x41')]||0x3;this[_0x54da('0x42')]=_0x200b6c[_0x54da('0x42')]||0x96;this[_0x54da('0x43')]=_0x200b6c[_0x54da('0x43')]||0x3;this[_0x54da('0x44')]=_0x200b6c[_0x54da('0x44')]||0x96;this[_0x54da('0x45')]=_0x200b6c['dialAgentRejectMaxRetry']||0x3;this[_0x54da('0x46')]=_0x200b6c[_0x54da('0x46')]||0x96;this['callAdditionalPhoneAfterMin']=_0x200b6c['callAdditionalPhoneAfterMin']||0x3;this[_0x54da('0x47')]=_0x200b6c[_0x54da('0x47')]||0x4;this[_0x54da('0x48')]=_0x200b6c[_0x54da('0x48')]?_0x200b6c[_0x54da('0x48')]:undefined;this[_0x54da('0x49')]=_0x200b6c[_0x54da('0x49')]?_0x200b6c[_0x54da('0x49')]:undefined;this[_0x54da('0x4a')]=_0x200b6c[_0x54da('0x4a')]||undefined;this[_0x54da('0x4b')]=_0x200b6c[_0x54da('0x4b')]?_0x200b6c['Interval']:undefined;this[_0x54da('0x4c')]=_0x200b6c[_0x54da('0x4c')]||'DESC';this[_0x54da('0x4d')]=_0x200b6c[_0x54da('0x4d')]||undefined;this[_0x54da('0x4e')]=_0x200b6c[_0x54da('0x4e')]||undefined;this[_0x54da('0x4f')]=strategy[_0x200b6c['strategy']];this['queueStatusComplete']=!![];this[_0x54da('0x50')]=_0x200b6c['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x200b6c['dialAMDInitialSilence'];this[_0x54da('0x51')]=_0x200b6c[_0x54da('0x51')];this[_0x54da('0x52')]=_0x200b6c[_0x54da('0x52')];this[_0x54da('0x53')]=_0x200b6c[_0x54da('0x53')];this[_0x54da('0x54')]=_0x200b6c[_0x54da('0x54')];this[_0x54da('0x55')]=_0x200b6c[_0x54da('0x55')];this[_0x54da('0x56')]=_0x200b6c[_0x54da('0x56')];this[_0x54da('0x57')]=_0x200b6c[_0x54da('0x57')];this[_0x54da('0x58')]=_0x200b6c[_0x54da('0x58')];this[_0x54da('0x59')]=0x0;this[_0x54da('0x5a')]=0x0;this['timeout']=_0x200b6c[_0x54da('0x5b')];this['outboundAnswerCallsDay']=0x0;this[_0x54da('0x5c')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x54da('0x5d')]=0x0;this[_0x54da('0x5e')]=0x0;this[_0x54da('0x5f')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x54da('0x60')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x54da('0x61')]=0x0;this[_0x54da('0x62')]=0x0;this[_0x54da('0x63')]=0x0;this['outboundReCallsDay']=0x0;this[_0x54da('0x64')]=0x0;this[_0x54da('0x65')]=undefined;this[_0x54da('0x66')]=undefined;this[_0x54da('0x67')]=undefined;this[_0x54da('0x68')]=1.05;this[_0x54da('0x69')]=0x0;this[_0x54da('0x6a')]=0x0;this[_0x54da('0x6b')]=0x0;this[_0x54da('0x6c')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0x54da('0x6d')]=0x0;this[_0x54da('0x6e')]=0x0;this[_0x54da('0x6f')]=0x0;this['predictiveIntervalMaxThreshold']=_0x200b6c[_0x54da('0x70')]||0x14;this['predictiveIntervalMinThreshold']=_0x200b6c[_0x54da('0x70')]||0xa;this[_0x54da('0x71')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x54da('0x72')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x54da('0x73')]=0x0;this['erlangBusyFactor']=0x0;this[_0x54da('0x74')]=_0x200b6c['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x200b6c[_0x54da('0x75')]||![];this[_0x54da('0x76')]=!!_0x200b6c[_0x54da('0x76')]||![];this[_0x54da('0x77')]=!!_0x200b6c[_0x54da('0x77')]||![];this['dialQueueProject2']=_0x200b6c[_0x54da('0x78')]||undefined;this[_0x54da('0x79')]=_0x200b6c[_0x54da('0x79')]||![];this[_0x54da('0x7a')]=_0x200b6c[_0x54da('0x7a')]||![];this[_0x54da('0x9')]=monitorFormat[_0x200b6c['monitor_format']]?monitorFormat[_0x200b6c[_0x54da('0x9')]]:undefined;this[_0x54da('0x7b')]=_0x200b6c[_0x54da('0x7b')]||![];this['mandatoryDispositionPause']=_0x200b6c[_0x54da('0x7c')]?_0x200b6c['mandatoryDispositionPause']:undefined;this[_0x54da('0x7d')]=![];}module[_0x54da('0x7e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index b4196d6..4e0750a 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5e11=['predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','loggedin','length','incall','status','booked','keys','queue','exten','xcally-motion-preview','compareToInboundQueue','some','active','updateReportFromOutboundQueue','preview','exports','available','loggedInDb','paused','ringing','talking','waiting','inUse','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','pTalking','sumBillable','sumDuration','total','name','strategy','abandoned','answered','busy','invalid','loggedIn','onHold','notInUse','ringInUse','sumHoldTime','type','unavailable','unknown','unmanaged','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0x5e11,0x1c3));var _0x15e1=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x5e11[_0x5f309e];return _0x487b5e;};'use strict';var INBOUND_COUNTERS=[_0x15e1('0x0'),'loggedIn',_0x15e1('0x1'),_0x15e1('0x2'),_0x15e1('0x3'),_0x15e1('0x4'),_0x15e1('0x5')];var OUTBOUND_COUNTERS=[_0x15e1('0x0'),'answered',_0x15e1('0x6'),'loggedIn',_0x15e1('0x1'),_0x15e1('0x7'),_0x15e1('0x8'),_0x15e1('0x9'),_0x15e1('0xa'),'outboundBusyCallsDay',_0x15e1('0xb'),_0x15e1('0xc'),_0x15e1('0xd'),_0x15e1('0xe'),'outboundRejectCallsDay',_0x15e1('0xf'),_0x15e1('0x2'),_0x15e1('0x10'),'talking',_0x15e1('0x11'),_0x15e1('0x12'),_0x15e1('0x13'),_0x15e1('0x5')];function VoiceQueueSummary(_0x260165){this['id']=_0x260165['id'];this[_0x15e1('0x14')]=_0x260165[_0x15e1('0x14')];this[_0x15e1('0x15')]=_0x260165[_0x15e1('0x15')];this[_0x15e1('0x16')]=_0x260165[_0x15e1('0x16')]||0x0;this[_0x15e1('0x17')]=_0x260165['answered']||0x0;this[_0x15e1('0x0')]=_0x260165[_0x15e1('0x0')]||0x0;this[_0x15e1('0x18')]=_0x260165['busy']||0x0;this[_0x15e1('0x6')]=_0x260165[_0x15e1('0x6')]||0x0;this['invalid']=_0x260165[_0x15e1('0x19')]||0x0;this[_0x15e1('0x1a')]=_0x260165[_0x15e1('0x1a')]||0x0;this[_0x15e1('0x1')]=_0x260165[_0x15e1('0x1')]||0x0;this[_0x15e1('0x1b')]=_0x260165[_0x15e1('0x1b')]||0x0;this[_0x15e1('0x1c')]=_0x260165[_0x15e1('0x1c')]||0x0;this[_0x15e1('0x2')]=_0x260165[_0x15e1('0x2')]||0x0;this[_0x15e1('0x3')]=_0x260165[_0x15e1('0x3')]||0x0;this[_0x15e1('0x1d')]=_0x260165[_0x15e1('0x1d')];this[_0x15e1('0x11')]=_0x260165['sumBillable'];this[_0x15e1('0x12')]=_0x260165[_0x15e1('0x12')];this['sumHoldTime']=_0x260165[_0x15e1('0x1e')]||0x0;this[_0x15e1('0x4')]=_0x260165[_0x15e1('0x4')]||0x0;this[_0x15e1('0x13')]=_0x260165['total']||0x0;this['type']=_0x260165[_0x15e1('0x1f')];this[_0x15e1('0x20')]=_0x260165[_0x15e1('0x20')]||0x0;this[_0x15e1('0x21')]=_0x260165[_0x15e1('0x21')]||0x0;this[_0x15e1('0x22')]=_0x260165[_0x15e1('0x22')]||0x0;this['waiting']=_0x260165['waiting']||0x0;if(_0x260165[_0x15e1('0x1f')]===_0x15e1('0x23')){this['pTalking']=_0x260165['pTalking']||0x0;this[_0x15e1('0x24')]=_0x260165[_0x15e1('0x24')];this['dialMethod']=_0x260165[_0x15e1('0x25')];this[_0x15e1('0x26')]=_0x260165[_0x15e1('0x26')];this[_0x15e1('0x27')]=_0x260165[_0x15e1('0x27')];this['dialOriginateTimeout']=_0x260165['dialOriginateTimeout'];this['dialPrefix']=_0x260165[_0x15e1('0x28')];this['temp']=_0x260165[_0x15e1('0x29')];this[_0x15e1('0x2a')]=_0x260165[_0x15e1('0x2a')];this[_0x15e1('0x9')]=_0x260165[_0x15e1('0x9')];this['outboundBlacklistCallsDay']=_0x260165[_0x15e1('0xa')];this['outboundBusyCallsDay']=_0x260165[_0x15e1('0x2b')];this['outboundCongestionCallsDay']=_0x260165['outboundCongestionCallsDay'];this[_0x15e1('0x2c')]=_0x260165['outboundDropCallsDayACS'];this['outboundDropCallsDayCallersExit']=_0x260165['outboundDropCallsDayCallersExit'];this[_0x15e1('0x2d')]=_0x260165[_0x15e1('0x2d')];this['outboundNoAnswerCallsDay']=_0x260165[_0x15e1('0xc')];this[_0x15e1('0xd')]=_0x260165['outboundNoSuchCallsDay'];this[_0x15e1('0x2e')]=_0x260165[_0x15e1('0x2e')];this[_0x15e1('0xe')]=_0x260165[_0x15e1('0xe')];this['outboundRejectCallsDay']=_0x260165[_0x15e1('0x2f')];this[_0x15e1('0xf')]=_0x260165['outboundUnknownCallsDay'];this['predictiveIntervalAnsweredCalls']=_0x260165[_0x15e1('0x30')];this['predictiveIntervalAvgHoldtime']=_0x260165['predictiveIntervalAvgHoldtime'];this['predictiveIntervalAvgTalktime']=_0x260165[_0x15e1('0x31')];this[_0x15e1('0x32')]=_0x260165[_0x15e1('0x32')];this[_0x15e1('0x33')]=_0x260165[_0x15e1('0x33')];this[_0x15e1('0x34')]=_0x260165[_0x15e1('0x34')];this[_0x15e1('0x35')]=_0x260165[_0x15e1('0x35')];this[_0x15e1('0x36')]=_0x260165[_0x15e1('0x36')];this[_0x15e1('0x37')]=_0x260165['predictiveIntervalMultiplicativeFactor'];this['predictiveIntervalPauses']=_0x260165['predictiveIntervalPauses'];this[_0x15e1('0x38')]=_0x260165['predictiveIntervalAvailable'];this[_0x15e1('0x39')]=_0x260165['predictiveIntervalTotalCalls'];this['originated']=_0x260165[_0x15e1('0x7')];this[_0x15e1('0x3a')]=_0x260165[_0x15e1('0x3a')];this[_0x15e1('0x3b')]=_0x260165[_0x15e1('0x3b')];this[_0x15e1('0x3c')]=_0x260165['erlangAbandonmentRate'];this[_0x15e1('0x3d')]=_0x260165[_0x15e1('0x3d')];this['startPredictive']=_0x260165['startPredictive'];this['startProgressive']=_0x260165[_0x15e1('0x3e')];this[_0x15e1('0x3f')]=_0x260165[_0x15e1('0x3f')];this[_0x15e1('0x40')]=_0x260165[_0x15e1('0x40')];}if(_0x260165[_0x15e1('0x41')]){this[_0x15e1('0x41')]={'id':_0x260165['Trunk']['id'],'name':_0x260165[_0x15e1('0x41')][_0x15e1('0x14')],'active':_0x260165[_0x15e1('0x41')]['active'],'callerid':_0x260165[_0x15e1('0x41')][_0x15e1('0x42')]};}}VoiceQueueSummary[_0x15e1('0x43')][_0x15e1('0x44')]=function(_0x43cca4,_0xcd727f,_0x4c0997,_0x46281e){this['loggedInDb']=0x0;this['talking']=0x0;this[_0x15e1('0x2')]=0x0;this['unknown']=0x0;this[_0x15e1('0x1c')]=0x0;this[_0x15e1('0x6')]=0x0;this[_0x15e1('0x18')]=0x0;this['invalid']=0x0;this[_0x15e1('0x20')]=0x0;this[_0x15e1('0x3')]=0x0;this[_0x15e1('0x1d')]=0x0;this[_0x15e1('0x1b')]=0x0;if(_0x4c0997){if(_0x4c0997[_0x15e1('0x0')]){this[_0x15e1('0x0')]=Number(_0x4c0997[_0x15e1('0x0')]);}if(_0x4c0997['loggedin']){this[_0x15e1('0x1a')]=Number(_0x4c0997[_0x15e1('0x45')]);}if(_0x4c0997['callers']){this[_0x15e1('0x5')]=Number(_0x4c0997['callers']);}}for(var _0xd0127a=0x0;_0xd0127a<_0x43cca4[_0x15e1('0x46')];_0xd0127a++){var _0x36c5c4=_0xcd727f['SIP/'+_0x43cca4[_0xd0127a][_0x15e1('0x14')]];if(_0x36c5c4&&_0x36c5c4['online']){this[_0x15e1('0x1')]+=0x1;}if(_0x43cca4[_0xd0127a][_0x15e1('0x47')]==='1'){this[_0x15e1('0x4')]+=0x1;}if(_0x43cca4[_0xd0127a][_0x15e1('0x2')]==='1'&&!['2','7','8']['includes'](_0x43cca4[_0xd0127a][_0x15e1('0x48')])){this[_0x15e1('0x2')]+=0x1;}switch(_0x43cca4[_0xd0127a][_0x15e1('0x48')]){case'0':this[_0x15e1('0x21')]+=0x1;break;case'1':this[_0x15e1('0x1c')]+=0x1;break;case'2':this[_0x15e1('0x6')]+=0x1;break;case'3':this[_0x15e1('0x18')]+=0x1;break;case'4':this[_0x15e1('0x19')]+=0x1;break;case'5':this['unavailable']+=0x1;break;case'6':this['ringing']+=0x1;break;case'7':this[_0x15e1('0x1d')]+=0x1;break;case'8':this[_0x15e1('0x1b')]+=0x1;break;}}if(this[_0x15e1('0x25')]===_0x15e1('0x49')){var _0x2c7391=Object[_0x15e1('0x4a')](_0x46281e);for(var _0x40a4f2=0x0;_0x40a4f2<_0x2c7391[_0x15e1('0x46')];_0x40a4f2++){var _0x429a23=_0x2c7391[_0x40a4f2];var _0x2d958d=_0x46281e[_0x429a23];if(_0x2d958d[_0x15e1('0x4b')]===this[_0x15e1('0x14')]&&_0x2d958d[_0x15e1('0x1f')]==='dialer'&&_0x2d958d[_0x15e1('0x4c')]===_0x15e1('0x4d')){this['talking']+=0x1;}}if(this[_0x15e1('0x4')]>this[_0x15e1('0x6')]){this[_0x15e1('0x4')]=this[_0x15e1('0x6')];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0x15e1('0x43')][_0x15e1('0x4e')]=function(_0x35ea1f){var _0xeff5fb=![];if(_0x35ea1f){_0xeff5fb=INBOUND_COUNTERS[_0x15e1('0x4f')](function(_0x5e9b69){return this[_0x5e9b69]!==_0x35ea1f[_0x5e9b69];},this);}return _0xeff5fb;};VoiceQueueSummary[_0x15e1('0x43')]['compareToOutboundQueue']=function(_0x4405b2){var _0x3ca955=![];var _0x209444=![];var _0x133921=![];if(_0x4405b2){_0x3ca955=this['dialMethod']!==_0x4405b2[_0x15e1('0x25')]||this['dialActive']!==_0x4405b2['dialActive']||this[_0x15e1('0x3f')]!==_0x4405b2[_0x15e1('0x3f')]||this[_0x15e1('0x40')]!==_0x4405b2[_0x15e1('0x40')];_0x209444=OUTBOUND_COUNTERS[_0x15e1('0x4f')](function(_0x25a1f9){return this[_0x25a1f9]!==_0x4405b2[_0x25a1f9];},this);if(this['Trunk']&&_0x4405b2[_0x15e1('0x41')]){_0x133921=this[_0x15e1('0x41')]['name']!==_0x4405b2[_0x15e1('0x41')][_0x15e1('0x14')]||this[_0x15e1('0x41')][_0x15e1('0x50')]!==_0x4405b2[_0x15e1('0x41')]['active'];}}return _0x3ca955||_0x209444||_0x133921;};VoiceQueueSummary['prototype'][_0x15e1('0x51')]=function(_0x355803){this[_0x15e1('0x17')]=_0x355803[_0x15e1('0x17')];this[_0x15e1('0x3f')]=_0x355803[_0x15e1('0x3f')];this[_0x15e1('0x40')]=_0x355803['statusMessage'];this[_0x15e1('0x7')]=_0x355803[_0x15e1('0x7')];this['outboundAbandonedCallsDay']=_0x355803[_0x15e1('0x8')];this[_0x15e1('0x9')]=_0x355803['outboundAnswerCallsDay'];this[_0x15e1('0xa')]=_0x355803[_0x15e1('0xa')];this[_0x15e1('0x2b')]=_0x355803[_0x15e1('0x2b')];this[_0x15e1('0xb')]=_0x355803['outboundCongestionCallsDay'];this[_0x15e1('0xc')]=_0x355803['outboundNoAnswerCallsDay'];this[_0x15e1('0xd')]=_0x355803[_0x15e1('0xd')];this[_0x15e1('0xe')]=_0x355803['outboundReCallsDay'];this[_0x15e1('0x2f')]=_0x355803[_0x15e1('0x2f')];this[_0x15e1('0xf')]=_0x355803[_0x15e1('0xf')];this[_0x15e1('0x11')]=_0x355803[_0x15e1('0x11')];this[_0x15e1('0x12')]=_0x355803[_0x15e1('0x12')];this[_0x15e1('0x13')]=_0x355803[_0x15e1('0x13')];if(this[_0x15e1('0x25')]===_0x15e1('0x52')){this[_0x15e1('0x10')]=_0x355803[_0x15e1('0x10')];}};module[_0x15e1('0x53')]=VoiceQueueSummary; \ No newline at end of file +var _0xaf79=['predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','unknown','callers','length','SIP/','online','incall','includes','status','dialMethod','keys','queue','dialer','exten','xcally-motion-preview','compareToInboundQueue','some','compareToOutboundQueue','updateReportFromOutboundQueue','outboundAbandonedCallsDay','preview','loggedIn','loggedInDb','paused','ringing','talking','waiting','answered','inUse','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','total','name','strategy','available','busy','invalid','onHold','notInUse','ringInUse','sumBillable','type','unavailable','unmanaged','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime'];(function(_0xeedf1c,_0x5968dd){var _0x4986fa=function(_0xa8226d){while(--_0xa8226d){_0xeedf1c['push'](_0xeedf1c['shift']());}};_0x4986fa(++_0x5968dd);}(_0xaf79,0x82));var _0x9af7=function(_0x488243,_0x361cfa){_0x488243=_0x488243-0x0;var _0x5220bd=_0xaf79[_0x488243];return _0x5220bd;};'use strict';var INBOUND_COUNTERS=['available',_0x9af7('0x0'),_0x9af7('0x1'),_0x9af7('0x2'),_0x9af7('0x3'),_0x9af7('0x4'),_0x9af7('0x5')];var OUTBOUND_COUNTERS=['available',_0x9af7('0x6'),_0x9af7('0x7'),_0x9af7('0x0'),_0x9af7('0x1'),'originated','outboundAbandonedCallsDay',_0x9af7('0x8'),_0x9af7('0x9'),_0x9af7('0xa'),_0x9af7('0xb'),_0x9af7('0xc'),_0x9af7('0xd'),_0x9af7('0xe'),_0x9af7('0xf'),_0x9af7('0x10'),_0x9af7('0x2'),_0x9af7('0x11'),_0x9af7('0x4'),'sumBillable',_0x9af7('0x12'),_0x9af7('0x13'),_0x9af7('0x5')];function VoiceQueueSummary(_0x45c53d){this['id']=_0x45c53d['id'];this[_0x9af7('0x14')]=_0x45c53d[_0x9af7('0x14')];this[_0x9af7('0x15')]=_0x45c53d[_0x9af7('0x15')];this['abandoned']=_0x45c53d['abandoned']||0x0;this[_0x9af7('0x6')]=_0x45c53d[_0x9af7('0x6')]||0x0;this[_0x9af7('0x16')]=_0x45c53d[_0x9af7('0x16')]||0x0;this[_0x9af7('0x17')]=_0x45c53d[_0x9af7('0x17')]||0x0;this[_0x9af7('0x7')]=_0x45c53d['inUse']||0x0;this['invalid']=_0x45c53d[_0x9af7('0x18')]||0x0;this[_0x9af7('0x0')]=_0x45c53d['loggedIn']||0x0;this[_0x9af7('0x1')]=_0x45c53d[_0x9af7('0x1')]||0x0;this[_0x9af7('0x19')]=_0x45c53d[_0x9af7('0x19')]||0x0;this[_0x9af7('0x1a')]=_0x45c53d[_0x9af7('0x1a')]||0x0;this['paused']=_0x45c53d['paused']||0x0;this['ringing']=_0x45c53d[_0x9af7('0x3')]||0x0;this[_0x9af7('0x1b')]=_0x45c53d['ringInUse'];this[_0x9af7('0x1c')]=_0x45c53d[_0x9af7('0x1c')];this[_0x9af7('0x12')]=_0x45c53d[_0x9af7('0x12')];this['sumHoldTime']=_0x45c53d['sumHoldTime']||0x0;this[_0x9af7('0x4')]=_0x45c53d[_0x9af7('0x4')]||0x0;this[_0x9af7('0x13')]=_0x45c53d[_0x9af7('0x13')]||0x0;this[_0x9af7('0x1d')]=_0x45c53d['type'];this[_0x9af7('0x1e')]=_0x45c53d[_0x9af7('0x1e')]||0x0;this['unknown']=_0x45c53d['unknown']||0x0;this[_0x9af7('0x1f')]=_0x45c53d['unmanaged']||0x0;this[_0x9af7('0x5')]=_0x45c53d[_0x9af7('0x5')]||0x0;if(_0x45c53d['type']==='outbound'){this['pTalking']=_0x45c53d[_0x9af7('0x11')]||0x0;this[_0x9af7('0x20')]=_0x45c53d['dialActive'];this['dialMethod']=_0x45c53d['dialMethod'];this[_0x9af7('0x21')]=_0x45c53d['dialOriginateCallerIdName'];this[_0x9af7('0x22')]=_0x45c53d['dialOriginateCallerIdNumber'];this[_0x9af7('0x23')]=_0x45c53d[_0x9af7('0x23')];this[_0x9af7('0x24')]=_0x45c53d[_0x9af7('0x24')];this[_0x9af7('0x25')]=_0x45c53d['temp'];this[_0x9af7('0x26')]=_0x45c53d[_0x9af7('0x26')];this['outboundAnswerCallsDay']=_0x45c53d[_0x9af7('0x8')];this[_0x9af7('0x9')]=_0x45c53d['outboundBlacklistCallsDay'];this['outboundBusyCallsDay']=_0x45c53d['outboundBusyCallsDay'];this['outboundCongestionCallsDay']=_0x45c53d[_0x9af7('0xb')];this[_0x9af7('0x27')]=_0x45c53d['outboundDropCallsDayACS'];this[_0x9af7('0x28')]=_0x45c53d[_0x9af7('0x28')];this[_0x9af7('0x29')]=_0x45c53d[_0x9af7('0x29')];this['outboundNoAnswerCallsDay']=_0x45c53d[_0x9af7('0xc')];this['outboundNoSuchCallsDay']=_0x45c53d['outboundNoSuchCallsDay'];this['outboundOriginateFailureCallsDay']=_0x45c53d['outboundOriginateFailureCallsDay'];this[_0x9af7('0xe')]=_0x45c53d['outboundReCallsDay'];this[_0x9af7('0xf')]=_0x45c53d['outboundRejectCallsDay'];this['outboundUnknownCallsDay']=_0x45c53d[_0x9af7('0x10')];this[_0x9af7('0x2a')]=_0x45c53d['predictiveIntervalAnsweredCalls'];this[_0x9af7('0x2b')]=_0x45c53d[_0x9af7('0x2b')];this['predictiveIntervalAvgTalktime']=_0x45c53d[_0x9af7('0x2c')];this['predictiveIntervalDroppedCallsCallersExit']=_0x45c53d[_0x9af7('0x2d')];this[_0x9af7('0x2e')]=_0x45c53d['predictiveIntervalDroppedCallsTimeout'];this[_0x9af7('0x2f')]=_0x45c53d[_0x9af7('0x2f')];this[_0x9af7('0x30')]=_0x45c53d[_0x9af7('0x30')];this[_0x9af7('0x31')]=_0x45c53d[_0x9af7('0x31')];this['predictiveIntervalMultiplicativeFactor']=_0x45c53d[_0x9af7('0x32')];this[_0x9af7('0x33')]=_0x45c53d[_0x9af7('0x33')];this[_0x9af7('0x34')]=_0x45c53d['predictiveIntervalAvailable'];this['predictiveIntervalTotalCalls']=_0x45c53d[_0x9af7('0x35')];this[_0x9af7('0x36')]=_0x45c53d[_0x9af7('0x36')];this['erlangCalls']=_0x45c53d['erlangCalls'];this[_0x9af7('0x37')]=_0x45c53d['erlangCallToSecond'];this[_0x9af7('0x38')]=_0x45c53d[_0x9af7('0x38')];this['erlangBusyFactor']=_0x45c53d[_0x9af7('0x39')];this['startPredictive']=_0x45c53d[_0x9af7('0x3a')];this[_0x9af7('0x3b')]=_0x45c53d[_0x9af7('0x3b')];this['message']=_0x45c53d[_0x9af7('0x3c')];this[_0x9af7('0x3d')]=_0x45c53d[_0x9af7('0x3d')];}if(_0x45c53d['Trunk']){this[_0x9af7('0x3e')]={'id':_0x45c53d[_0x9af7('0x3e')]['id'],'name':_0x45c53d[_0x9af7('0x3e')][_0x9af7('0x14')],'active':_0x45c53d[_0x9af7('0x3e')][_0x9af7('0x3f')],'callerid':_0x45c53d[_0x9af7('0x3e')][_0x9af7('0x40')]};}}VoiceQueueSummary[_0x9af7('0x41')][_0x9af7('0x42')]=function(_0x48de57,_0x1ad12d,_0x42c83b,_0x3c35c4){this[_0x9af7('0x1')]=0x0;this[_0x9af7('0x4')]=0x0;this[_0x9af7('0x2')]=0x0;this[_0x9af7('0x43')]=0x0;this[_0x9af7('0x1a')]=0x0;this[_0x9af7('0x7')]=0x0;this[_0x9af7('0x17')]=0x0;this[_0x9af7('0x18')]=0x0;this['unavailable']=0x0;this[_0x9af7('0x3')]=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x42c83b){if(_0x42c83b[_0x9af7('0x16')]){this[_0x9af7('0x16')]=Number(_0x42c83b[_0x9af7('0x16')]);}if(_0x42c83b['loggedin']){this['loggedIn']=Number(_0x42c83b['loggedin']);}if(_0x42c83b[_0x9af7('0x44')]){this[_0x9af7('0x5')]=Number(_0x42c83b['callers']);}}for(var _0x24ad42=0x0;_0x24ad42<_0x48de57[_0x9af7('0x45')];_0x24ad42++){var _0x6aae6b=_0x1ad12d[_0x9af7('0x46')+_0x48de57[_0x24ad42]['name']];if(_0x6aae6b&&_0x6aae6b[_0x9af7('0x47')]){this['loggedInDb']+=0x1;}if(_0x48de57[_0x24ad42][_0x9af7('0x48')]==='1'){this['talking']+=0x1;}if(_0x48de57[_0x24ad42][_0x9af7('0x2')]==='1'&&!['2','7','8'][_0x9af7('0x49')](_0x48de57[_0x24ad42][_0x9af7('0x4a')])){this[_0x9af7('0x2')]+=0x1;}switch(_0x48de57[_0x24ad42][_0x9af7('0x4a')]){case'0':this[_0x9af7('0x43')]+=0x1;break;case'1':this['notInUse']+=0x1;break;case'2':this[_0x9af7('0x7')]+=0x1;break;case'3':this[_0x9af7('0x17')]+=0x1;break;case'4':this[_0x9af7('0x18')]+=0x1;break;case'5':this[_0x9af7('0x1e')]+=0x1;break;case'6':this[_0x9af7('0x3')]+=0x1;break;case'7':this[_0x9af7('0x1b')]+=0x1;break;case'8':this[_0x9af7('0x19')]+=0x1;break;}}if(this[_0x9af7('0x4b')]==='booked'){var _0x560862=Object[_0x9af7('0x4c')](_0x3c35c4);for(var _0x2e2e9c=0x0;_0x2e2e9c<_0x560862[_0x9af7('0x45')];_0x2e2e9c++){var _0x54f257=_0x560862[_0x2e2e9c];var _0x136de7=_0x3c35c4[_0x54f257];if(_0x136de7[_0x9af7('0x4d')]===this[_0x9af7('0x14')]&&_0x136de7[_0x9af7('0x1d')]===_0x9af7('0x4e')&&_0x136de7[_0x9af7('0x4f')]===_0x9af7('0x50')){this['talking']+=0x1;}}if(this[_0x9af7('0x4')]>this[_0x9af7('0x7')]){this[_0x9af7('0x4')]=this[_0x9af7('0x7')];}this[_0x9af7('0x11')]=0x0;}return this;};VoiceQueueSummary['prototype'][_0x9af7('0x51')]=function(_0x459eac){var _0xdd2854=![];if(_0x459eac){_0xdd2854=INBOUND_COUNTERS[_0x9af7('0x52')](function(_0x560181){return this[_0x560181]!==_0x459eac[_0x560181];},this);}return _0xdd2854;};VoiceQueueSummary[_0x9af7('0x41')][_0x9af7('0x53')]=function(_0x19628a){var _0x2ef41d=![];var _0x2942b0=![];var _0x311ac0=![];if(_0x19628a){_0x2ef41d=this[_0x9af7('0x4b')]!==_0x19628a[_0x9af7('0x4b')]||this[_0x9af7('0x20')]!==_0x19628a['dialActive']||this[_0x9af7('0x3c')]!==_0x19628a[_0x9af7('0x3c')]||this['statusMessage']!==_0x19628a[_0x9af7('0x3d')];_0x2942b0=OUTBOUND_COUNTERS[_0x9af7('0x52')](function(_0x1fe141){return this[_0x1fe141]!==_0x19628a[_0x1fe141];},this);if(this[_0x9af7('0x3e')]&&_0x19628a['Trunk']){_0x311ac0=this[_0x9af7('0x3e')][_0x9af7('0x14')]!==_0x19628a[_0x9af7('0x3e')][_0x9af7('0x14')]||this[_0x9af7('0x3e')][_0x9af7('0x3f')]!==_0x19628a[_0x9af7('0x3e')]['active'];}}return _0x2ef41d||_0x2942b0||_0x311ac0;};VoiceQueueSummary[_0x9af7('0x41')][_0x9af7('0x54')]=function(_0x58957a){this[_0x9af7('0x6')]=_0x58957a['answered'];this[_0x9af7('0x3c')]=_0x58957a[_0x9af7('0x3c')];this[_0x9af7('0x3d')]=_0x58957a['statusMessage'];this['originated']=_0x58957a[_0x9af7('0x36')];this[_0x9af7('0x55')]=_0x58957a[_0x9af7('0x55')];this[_0x9af7('0x8')]=_0x58957a[_0x9af7('0x8')];this['outboundBlacklistCallsDay']=_0x58957a[_0x9af7('0x9')];this['outboundBusyCallsDay']=_0x58957a[_0x9af7('0xa')];this[_0x9af7('0xb')]=_0x58957a[_0x9af7('0xb')];this['outboundNoAnswerCallsDay']=_0x58957a[_0x9af7('0xc')];this[_0x9af7('0xd')]=_0x58957a[_0x9af7('0xd')];this[_0x9af7('0xe')]=_0x58957a[_0x9af7('0xe')];this[_0x9af7('0xf')]=_0x58957a[_0x9af7('0xf')];this[_0x9af7('0x10')]=_0x58957a['outboundUnknownCallsDay'];this['sumBillable']=_0x58957a[_0x9af7('0x1c')];this['sumDuration']=_0x58957a[_0x9af7('0x12')];this[_0x9af7('0x13')]=_0x58957a[_0x9af7('0x13')];if(this[_0x9af7('0x4b')]===_0x9af7('0x56')){this[_0x9af7('0x11')]=_0x58957a[_0x9af7('0x11')];}};module['exports']=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index c34abb4..6780c90 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 _0xd959=['remoteUri','Configurations','exports','name','username','accessKey'];(function(_0x3f036d,_0x53a9d9){var _0xd148f6=function(_0x48fbc4){while(--_0x48fbc4){_0x3f036d['push'](_0x3f036d['shift']());}};_0xd148f6(++_0x53a9d9);}(_0xd959,0x75));var _0x9d95=function(_0x1f8dc1,_0x4653fa){_0x1f8dc1=_0x1f8dc1-0x0;var _0x229325=_0xd959[_0x1f8dc1];return _0x229325;};'use strict';function VtigerAccount(_0x270216){this['id']=_0x270216['id']||0x0;this[_0x9d95('0x0')]=_0x270216['name']||'';this[_0x9d95('0x1')]=_0x270216['username']||'';this[_0x9d95('0x2')]=_0x270216[_0x9d95('0x2')]||'';this[_0x9d95('0x3')]=_0x270216[_0x9d95('0x3')]||'';this['serverUrl']=_0x270216['serverUrl']||'';this['Configurations']=_0x270216[_0x9d95('0x4')]||{};}module[_0x9d95('0x5')]=VtigerAccount; \ No newline at end of file +var _0x7107=['remoteUri','serverUrl','Configurations','name','username'];(function(_0x363441,_0x288e66){var _0x30f706=function(_0x1479ff){while(--_0x1479ff){_0x363441['push'](_0x363441['shift']());}};_0x30f706(++_0x288e66);}(_0x7107,0x17a));var _0x7710=function(_0x452849,_0x4aeb7f){_0x452849=_0x452849-0x0;var _0x43dd13=_0x7107[_0x452849];return _0x43dd13;};'use strict';function VtigerAccount(_0x4e377d){this['id']=_0x4e377d['id']||0x0;this[_0x7710('0x0')]=_0x4e377d[_0x7710('0x0')]||'';this['username']=_0x4e377d[_0x7710('0x1')]||'';this['accessKey']=_0x4e377d['accessKey']||'';this[_0x7710('0x2')]=_0x4e377d[_0x7710('0x2')]||'';this[_0x7710('0x3')]=_0x4e377d[_0x7710('0x3')]||'';this[_0x7710('0x4')]=_0x4e377d[_0x7710('0x4')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 34a1385..a9ffb37 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 _0xb1e6=['authType','type','serverUrl','Configurations','exports','name','username','password','token','remoteUri'];(function(_0x4fc2a0,_0x4a0791){var _0x22d7e8=function(_0xcb9eb0){while(--_0xcb9eb0){_0x4fc2a0['push'](_0x4fc2a0['shift']());}};_0x22d7e8(++_0x4a0791);}(_0xb1e6,0x87));var _0x6b1e=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0xb1e6[_0x5b3b9b];return _0x47c1d7;};'use strict';function ZendeskAccount(_0x46d8b3){this['id']=_0x46d8b3['id']||0x0;this[_0x6b1e('0x0')]=_0x46d8b3[_0x6b1e('0x0')]||'';this[_0x6b1e('0x1')]=_0x46d8b3[_0x6b1e('0x1')]||'';this['password']=_0x46d8b3[_0x6b1e('0x2')]||'';this[_0x6b1e('0x3')]=_0x46d8b3[_0x6b1e('0x3')]||'';this[_0x6b1e('0x4')]=_0x46d8b3[_0x6b1e('0x4')]||'';this[_0x6b1e('0x5')]=_0x46d8b3['authType']||'';this[_0x6b1e('0x6')]=_0x46d8b3[_0x6b1e('0x6')]||'integrationTab';this[_0x6b1e('0x7')]=_0x46d8b3['serverUrl']||'';this[_0x6b1e('0x8')]=_0x46d8b3[_0x6b1e('0x8')]||{};}module[_0x6b1e('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xb75a=['exports','name','password','token','remoteUri','authType','type','Configurations'];(function(_0x5b5ed5,_0x5ea1c0){var _0x448ea9=function(_0x4b24ba){while(--_0x4b24ba){_0x5b5ed5['push'](_0x5b5ed5['shift']());}};_0x448ea9(++_0x5ea1c0);}(_0xb75a,0xc9));var _0xab75=function(_0x3f4098,_0x3365b2){_0x3f4098=_0x3f4098-0x0;var _0x3d5d0c=_0xb75a[_0x3f4098];return _0x3d5d0c;};'use strict';function ZendeskAccount(_0x21b5ba){this['id']=_0x21b5ba['id']||0x0;this[_0xab75('0x0')]=_0x21b5ba[_0xab75('0x0')]||'';this['username']=_0x21b5ba['username']||'';this[_0xab75('0x1')]=_0x21b5ba[_0xab75('0x1')]||'';this[_0xab75('0x2')]=_0x21b5ba[_0xab75('0x2')]||'';this['remoteUri']=_0x21b5ba[_0xab75('0x3')]||'';this[_0xab75('0x4')]=_0x21b5ba[_0xab75('0x4')]||'';this['type']=_0x21b5ba[_0xab75('0x5')]||'integrationTab';this['serverUrl']=_0x21b5ba['serverUrl']||'';this['Configurations']=_0x21b5ba[_0xab75('0x6')]||{};}module[_0xab75('0x7')]=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 85cd064..97d742b 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 _0xdbfb=['clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','host','zone'];(function(_0x104a3a,_0x53553e){var _0xf48aa7=function(_0x1d55d2){while(--_0x1d55d2){_0x104a3a['push'](_0x104a3a['shift']());}};_0xf48aa7(++_0x53553e);}(_0xdbfb,0xcf));var _0xbdbf=function(_0x58114c,_0x5b2d85){_0x58114c=_0x58114c-0x0;var _0xe2f3c5=_0xdbfb[_0x58114c];return _0xe2f3c5;};'use strict';function ZohoAccount(_0x47442c){this['id']=_0x47442c['id']||0x0;this[_0xbdbf('0x0')]=_0x47442c[_0xbdbf('0x0')]||'';this['description']=_0x47442c['description']||'';this['host']=_0x47442c[_0xbdbf('0x1')]||'';this[_0xbdbf('0x2')]=_0x47442c[_0xbdbf('0x2')]||'';this[_0xbdbf('0x3')]=_0x47442c[_0xbdbf('0x3')]||'';this[_0xbdbf('0x4')]=_0x47442c[_0xbdbf('0x4')]||'';this[_0xbdbf('0x5')]=_0x47442c[_0xbdbf('0x5')]||'';this[_0xbdbf('0x6')]=_0x47442c[_0xbdbf('0x6')]||'';this[_0xbdbf('0x7')]=_0x47442c['refreshToken']||'';this[_0xbdbf('0x8')]=_0x47442c['Configurations']||{};}module[_0xbdbf('0x9')]=ZohoAccount; \ No newline at end of file +var _0xdd1d=['zone','clientId','clientSecret','serverUrl','code','refreshToken','exports','name','description','host'];(function(_0x386709,_0x49f5e3){var _0x4fbe5b=function(_0x114249){while(--_0x114249){_0x386709['push'](_0x386709['shift']());}};_0x4fbe5b(++_0x49f5e3);}(_0xdd1d,0xc5));var _0xddd1=function(_0x335cfa,_0x1e7634){_0x335cfa=_0x335cfa-0x0;var _0xb7a81b=_0xdd1d[_0x335cfa];return _0xb7a81b;};'use strict';function ZohoAccount(_0x5c5dbc){this['id']=_0x5c5dbc['id']||0x0;this[_0xddd1('0x0')]=_0x5c5dbc[_0xddd1('0x0')]||'';this[_0xddd1('0x1')]=_0x5c5dbc['description']||'';this[_0xddd1('0x2')]=_0x5c5dbc[_0xddd1('0x2')]||'';this[_0xddd1('0x3')]=_0x5c5dbc[_0xddd1('0x3')]||'';this['clientId']=_0x5c5dbc[_0xddd1('0x4')]||'';this['clientSecret']=_0x5c5dbc[_0xddd1('0x5')]||'';this[_0xddd1('0x6')]=_0x5c5dbc[_0xddd1('0x6')]||'';this['code']=_0x5c5dbc[_0xddd1('0x7')]||'';this[_0xddd1('0x8')]=_0x5c5dbc[_0xddd1('0x8')]||'';this['Configurations']=_0x5c5dbc['Configurations']||{};}module[_0xddd1('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 9e77304..006b22b 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 _0x5204=['isNil','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','exports','util','lodash'];(function(_0x242b75,_0x294f5f){var _0x4218e2=function(_0x130694){while(--_0x130694){_0x242b75['push'](_0x242b75['shift']());}};_0x4218e2(++_0x294f5f);}(_0x5204,0xdf));var _0x4520=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0x5204[_0x2bc1fe];return _0x1a47a5;};'use strict';var util=require(_0x4520('0x0'));var _=require(_0x4520('0x1'));var moment=require('moment');function checkNameSurname(_0x12a3a1,_0x3bf0b1,_0x10cbc2){var _0x36caca='';if(!_[_0x4520('0x2')](_0x3bf0b1)&&'string'===typeof _0x3bf0b1){_0x36caca+=_0x3bf0b1;}if(!_[_0x4520('0x2')](_0x10cbc2)&&'string'===typeof _0x10cbc2){_0x36caca+='\x20'+_0x10cbc2;}if(_0x36caca!==''){return _0x36caca;}return _0x12a3a1;}function Action(_0x180174,_0x209381,_0xe0a256,_0xe741c2,_0x396d29){this[_0x4520('0x3')]=_0xe0a256||undefined;this[_0x4520('0x4')]=_0x180174['id'];this['queue']=_0x209381[_0x4520('0x5')];this['type']=_0x209381[_0x4520('0x6')];this[_0x4520('0x7')]=_0x4520('0x8');this[_0x4520('0x9')]=![];this[_0x4520('0xa')]=_[_0x4520('0x2')](_0x180174[_0x4520('0xb')])?undefined:_0x180174[_0x4520('0xb')][_0x4520('0x5')];this[_0x4520('0xc')]=this[_0x4520('0xa')]?util[_0x4520('0xd')](_0x4520('0xe'),this[_0x4520('0xa')]):_0xe741c2||undefined;this[_0x4520('0xf')]=checkNameSurname(_0x180174[_0x4520('0x10')][_0x4520('0x11')],_0x180174[_0x4520('0x10')][_0x4520('0x12')],_0x180174[_0x4520('0x10')][_0x4520('0x13')]);this['active']=_0x180174[_0x4520('0x14')]||![];this[_0x4520('0x15')]=_0x180174[_0x4520('0x11')];this[_0x4520('0x16')]=_0x180174[_0x4520('0x16')];this['countbusyretry']=_0x180174[_0x4520('0x17')]||0x0;this[_0x4520('0x18')]=_0x180174[_0x4520('0x18')]||0x0;this[_0x4520('0x19')]=_0x180174[_0x4520('0x19')]||0x0;this[_0x4520('0x1a')]=(_0x180174[_0x4520('0x17')]||0x0)+(_0x180174[_0x4520('0x18')]||0x0)+(_0x180174[_0x4520('0x19')]||0x0)+(_0x180174[_0x4520('0x1b')]||0x0)+(_0x180174[_0x4520('0x1c')]||0x0)+(_0x180174[_0x4520('0x1d')]||0x0)+(_0x180174['countmachineretry']||0x0)+(_0x180174[_0x4520('0x1e')]||0x0);this['countnosuchnumberretry']=_0x180174['countnosuchnumberretry']||0x0;this['countdropretry']=_0x180174[_0x4520('0x1c')]||0x0;this['countabandonedretry']=_0x180174[_0x4520('0x1d')]||0x0;this[_0x4520('0x1f')]=_0x180174[_0x4520('0x1f')]||0x0;this['countagentrejectretry']=_0x180174[_0x4520('0x1e')]||0x0;this[_0x4520('0x20')]=_0x180174[_0x4520('0x20')];this['callbackuniqueid']=_0x180174[_0x4520('0x21')];this[_0x4520('0x22')]=_0x180174[_0x4520('0x22')];this[_0x4520('0x23')]=_0x180174[_0x4520('0x23')];this['ContactId']=_0x180174[_0x4520('0x24')];this[_0x4520('0x25')]=_0x180174[_0x4520('0x25')];this[_0x4520('0x26')]=_['isNil'](_0x180174[_0x4520('0xb')])?_0x180174[_0x4520('0x26')]:_0x180174[_0x4520('0xb')]['id'];this[_0x4520('0x27')]=_0x180174[_0x4520('0x27')];this[_0x4520('0x28')]='';this[_0x4520('0x29')]='';}Action[_0x4520('0x2a')][_0x4520('0x2b')]=function(){return util[_0x4520('0xd')]('\x22%s\x22\x20<%s>',this[_0x4520('0xf')],this['number']);};module[_0x4520('0x2c')]=Action; \ No newline at end of file +var _0x0598=['Contact','phone','firstName','lastName','active','calleridnum','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','\x22%s\x22\x20<%s>','number','exports','util','lodash','isNil','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent','name','SIP/%s','calleridname'];(function(_0x5f57a2,_0xabf9ef){var _0x2c23ec=function(_0x4c09fd){while(--_0x4c09fd){_0x5f57a2['push'](_0x5f57a2['shift']());}};_0x2c23ec(++_0xabf9ef);}(_0x0598,0x92));var _0x8059=function(_0x1aa284,_0x104b75){_0x1aa284=_0x1aa284-0x0;var _0x43d7d5=_0x0598[_0x1aa284];return _0x43d7d5;};'use strict';var util=require(_0x8059('0x0'));var _=require(_0x8059('0x1'));var moment=require('moment');function checkNameSurname(_0x3386f0,_0x52c9bf,_0x4dad54){var _0x14109c='';if(!_[_0x8059('0x2')](_0x52c9bf)&&'string'===typeof _0x52c9bf){_0x14109c+=_0x52c9bf;}if(!_['isNil'](_0x4dad54)&&'string'===typeof _0x4dad54){_0x14109c+='\x20'+_0x4dad54;}if(_0x14109c!==''){return _0x14109c;}return _0x3386f0;}function Action(_0x467206,_0xa7d7c1,_0x512c0f,_0x5996d7,_0x248273){this[_0x8059('0x3')]=_0x512c0f||undefined;this[_0x8059('0x4')]=_0x467206['id'];this[_0x8059('0x5')]=_0xa7d7c1['name'];this['type']=_0xa7d7c1[_0x8059('0x6')];this[_0x8059('0x7')]=_0x8059('0x5');this[_0x8059('0x8')]=![];this[_0x8059('0x9')]=_['isNil'](_0x467206['Agent'])?undefined:_0x467206[_0x8059('0xa')][_0x8059('0xb')];this['channelAgent']=this['membername']?util['format'](_0x8059('0xc'),this[_0x8059('0x9')]):_0x5996d7||undefined;this[_0x8059('0xd')]=checkNameSurname(_0x467206[_0x8059('0xe')][_0x8059('0xf')],_0x467206['Contact'][_0x8059('0x10')],_0x467206['Contact'][_0x8059('0x11')]);this['active']=_0x467206[_0x8059('0x12')]||![];this[_0x8059('0x13')]=_0x467206[_0x8059('0xf')];this['scheduledat']=_0x467206['scheduledat'];this['countbusyretry']=_0x467206[_0x8059('0x14')]||0x0;this[_0x8059('0x15')]=_0x467206[_0x8059('0x15')]||0x0;this[_0x8059('0x16')]=_0x467206[_0x8059('0x16')]||0x0;this['countglobal']=(_0x467206[_0x8059('0x14')]||0x0)+(_0x467206[_0x8059('0x15')]||0x0)+(_0x467206[_0x8059('0x16')]||0x0)+(_0x467206[_0x8059('0x17')]||0x0)+(_0x467206['countdropretry']||0x0)+(_0x467206[_0x8059('0x18')]||0x0)+(_0x467206['countmachineretry']||0x0)+(_0x467206[_0x8059('0x19')]||0x0);this['countnosuchnumberretry']=_0x467206[_0x8059('0x17')]||0x0;this['countdropretry']=_0x467206[_0x8059('0x1a')]||0x0;this[_0x8059('0x18')]=_0x467206[_0x8059('0x18')]||0x0;this['countmachineretry']=_0x467206['countmachineretry']||0x0;this[_0x8059('0x19')]=_0x467206[_0x8059('0x19')]||0x0;this[_0x8059('0x1b')]=_0x467206[_0x8059('0x1b')];this['callbackuniqueid']=_0x467206[_0x8059('0x1c')];this[_0x8059('0x1d')]=_0x467206[_0x8059('0x1d')];this['recallme']=_0x467206[_0x8059('0x1e')];this[_0x8059('0x1f')]=_0x467206[_0x8059('0x1f')];this[_0x8059('0x20')]=_0x467206['ListId'];this[_0x8059('0x21')]=_[_0x8059('0x2')](_0x467206[_0x8059('0xa')])?_0x467206[_0x8059('0x21')]:_0x467206[_0x8059('0xa')]['id'];this['VoiceQueueId']=_0x467206[_0x8059('0x22')];this[_0x8059('0x23')]='';this[_0x8059('0x24')]='';}Action['prototype']['getCaller']=function(){return util['format'](_0x8059('0x25'),this[_0x8059('0xd')],this[_0x8059('0x26')]);};module[_0x8059('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 35e7694..14c7d7c 100644 --- a/server/services/ami/preview/index.js +++ b/server/services/ami/preview/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x124d0c,_0x27ef04){var _0x5df97f=function(_0xc1d771){while(--_0xc1d771){_0x124d0c['push'](_0x124d0c['shift']());}};_0x5df97f(++_0x27ef04);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file +var _0xa9e0=['varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','info','format','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','CAMPAIGN_STATUS','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20deactivated','syncCampaigns','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','recallMe','clearZombieChannel','sequence','isNil','Queue','queue','originated:\x20','stringify','pick','UserId','VoiceQueueId','ListId','channel','message','No\x20such\x20channel','dialAnswer','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','size','getContactRecallMe','then','length','getDiff','scheduledat','Agent','voicePause','run','[RecallMe]','catch','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[getContactRecallMe]','IsNotLoggedIn','NO_AGENTS_LOGGED','isActive','isTrunkReachable','UNREACHABLE_TRUNK','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','cloneAction','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','activeContact','linkedid','idContact','incrementPreviewCounters','ANSWER','answertime','[syncHangup][talking][increment]','pTalking:\x20','custom:agentconnect','connect','acw','mandatoryDisposition','custom:agentConnectPreview','channelAgent','uniqueid','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[16]','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','callAdditionalPhoneAfterMin','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','unlockAgent','NOANSWER','countnoanswerretry','dialNoAnswerRetryFrequency','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','outboundCongestionCallsDay','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','swapAdditionalPhones','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','countmachineretry','cause-txt','custom:amd','[callProgressDetectingCustomer][hangupInAMD]','outboundUnknownCallsDay','dialstatus','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','updateOriginated','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','resolve','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','[Preview][execCall][success]','custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','unmonitored','execRun','unlock','unlockContact','recallme','validateContact','checkIsBlackList','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','TrunkBackup','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variables','variablesAction','Action','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','response','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncHangupRequest','addVariable','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','uuid','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','../dialer/utils','redis','prototype','enqueue','tail','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncDialEnd','syncNewExten'];(function(_0x1a818e,_0x1ad18b){var _0x1f0b8e=function(_0x120ec3){while(--_0x120ec3){_0x1a818e['push'](_0x1a818e['shift']());}};_0x1f0b8e(++_0x1ad18b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var uuid=require(_0x0a9e('0x2'));var moment=require('moment');var Redis=require('ioredis');var config=require(_0x0a9e('0x3'));var logger=require('../../../config/logger')(_0x0a9e('0x4'));var loggerAction=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var ami=require(_0x0a9e('0x7'));var rpcDb=require(_0x0a9e('0x8'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x0a9e('0x9'));var ut=require(_0x0a9e('0xa'));var utils=require(_0x0a9e('0xb'));config['redis']=_['defaults'](config[_0x0a9e('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0a9e('0xc')]));var Sequence=function(){};Sequence[_0x0a9e('0xd')][_0x0a9e('0xe')]=function(_0x3ab53f){this[_0x0a9e('0xf')]=this[_0x0a9e('0xf')]?this['tail']['finally'](_0x3ab53f):_0x3ab53f();};function Preview(_0x527cdd){this['sequence']=new Sequence();this[_0x0a9e('0x10')]=_0x527cdd[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x527cdd[_0x0a9e('0x12')];this[_0x0a9e('0x13')]={};this[_0x0a9e('0x14')]=_0x527cdd['agents'];this[_0x0a9e('0x15')]=0x0;ami['on'](_0x0a9e('0x16'),this[_0x0a9e('0x17')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x19'),this[_0x0a9e('0x1a')]['bind'](this));ami['on'](_0x0a9e('0x1b'),this['syncHangupRequest'][_0x0a9e('0x18')](this));ami['on']('dialend',this[_0x0a9e('0x1c')][_0x0a9e('0x18')](this));ami['on']('newexten',this[_0x0a9e('0x1d')]['bind'](this));ami['on'](_0x0a9e('0x1e'),this[_0x0a9e('0x1f')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x20'),this[_0x0a9e('0x21')][_0x0a9e('0x18')](this));ami['on'](_0x0a9e('0x22'),this[_0x0a9e('0x23')][_0x0a9e('0x18')](this));this[_0x0a9e('0x24')](this[_0x0a9e('0x10')]);}function emit(_0x105080,_0x4bb1e3,_0x2c3407){io['to'](_0x105080)[_0x0a9e('0x25')](_0x4bb1e3,_0x2c3407);}function emitVoiceQueueChannelRemove(_0x53682f){logger[_0x0a9e('0x26')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON['stringify'](_0x53682f));emit(util[_0x0a9e('0x27')](_0x0a9e('0x28'),_0x53682f[_0x0a9e('0x29')]),_0x0a9e('0x2a'),_0x53682f);io['emit'](_0x0a9e('0x2b'),_0x53682f);}function notSendMessagesQueue(_0x2fb0e4){if(_0x2fb0e4[_0x0a9e('0x2c')]){if(_0x2fb0e4[_0x0a9e('0x2d')]===0x0&&_0x2fb0e4[_0x0a9e('0x2e')]===0x0){_0x2fb0e4[_0x0a9e('0x2c')]=![];_0x2fb0e4[_0x0a9e('0x2f')]=0x0;_0x2fb0e4['paused']=0x0;_0x2fb0e4['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4['name']+_0x0a9e('0x34'));}else{_0x2fb0e4['message']=utils[_0x0a9e('0x30')]['DEACTIVATED'];ut[_0x0a9e('0x32')](_0x0a9e('0x33'),_0x2fb0e4[_0x0a9e('0x29')]+_0x0a9e('0x35'));}}}Preview[_0x0a9e('0xd')][_0x0a9e('0x24')]=function(){var _0x11c3b6=this;setInterval(function(){_0x11c3b6[_0x0a9e('0x36')]();},0x7cf);};Preview['prototype'][_0x0a9e('0x36')]=function(){var _0x468813=this[_0x0a9e('0x10')];this[_0x0a9e('0x15')]+=0x1;for(var _0x5c877d in _0x468813){if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&(_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x4')||_0x468813[_0x5c877d][_0x0a9e('0x38')]===_0x0a9e('0x39'))&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(this[_0x0a9e('0x15')]>0x7){this[_0x0a9e('0x15')]=0x0;this['clearZombieChannels']();}}if(_0x468813[_0x0a9e('0x37')](_0x5c877d)&&_0x468813[_0x5c877d]['dialMethod']===_0x0a9e('0x4')&&_0x468813[_0x5c877d][_0x0a9e('0x3a')]===_0x0a9e('0x3b')){if(_0x468813[_0x5c877d][_0x0a9e('0x3c')]){this[_0x0a9e('0x3d')](_0x468813[_0x5c877d]);if(_0x468813[_0x5c877d]['dialPreviewAutoRecallMe'])this[_0x0a9e('0x3e')](_0x468813[_0x5c877d]);}else{notSendMessagesQueue(_0x468813[_0x5c877d]);}}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3f')]=function(_0x2da5c0){var _0x2b45ea=this;this[_0x0a9e('0x40')][_0x0a9e('0xe')](function(){if(!_[_0x0a9e('0x41')](_0x2b45ea['actions'][_0x2da5c0])){loggerAction[_0x0a9e('0x26')]('[clearZombieChannels][talking]',_0x2da5c0,_0x0a9e('0x42'),_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')],_0x0a9e('0x44'),JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2d')]),'pTalking:\x20',JSON['stringify'](_0x2b45ea[_0x0a9e('0x10')][_0x2b45ea['actions'][_0x2da5c0][_0x0a9e('0x43')]][_0x0a9e('0x2e')]),JSON[_0x0a9e('0x45')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]['dialAnswer']),JSON[_0x0a9e('0x45')](_[_0x0a9e('0x46')](_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0],['contactId',_0x0a9e('0x47'),_0x0a9e('0x48'),_0x0a9e('0x49')])));return ami['Action']({'action':'status','channel':_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4a')]})['catch'](function(_0x2b814e){if(_0x2b814e[_0x0a9e('0x4b')]===_0x0a9e('0x4c')){setTimeout(function(){if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0]){ut['updateOriginated'](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],'[clearZombieChannel]');if(_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x4d')]===!![]){ut[_0x0a9e('0x4e')](_0x2b45ea['campaignsPreview'][_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]],_0x0a9e('0x4f'));ut[_0x0a9e('0x50')](_0x0a9e('0x51')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);}ut[_0x0a9e('0x50')](_0x0a9e('0x52')+_0x2da5c0,_0x2b45ea[_0x0a9e('0x13')][_0x2da5c0][_0x0a9e('0x43')]);delete _0x2b45ea[_0x0a9e('0x13')][_0x2da5c0];}},0x2328);}});}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x53')]=function(){var _0x37f6cc=this;loggerAction['info']('[action]',_[_0x0a9e('0x54')](this[_0x0a9e('0x13')]));for(var _0x405c8f in this[_0x0a9e('0x13')]){if(_0x37f6cc[_0x0a9e('0x13')][_0x0a9e('0x37')](_0x405c8f)){_0x37f6cc[_0x0a9e('0x3f')](_0x405c8f);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x3e')]=function(_0x25c6e6){var _0x2c2cb0=this;rpcDb[_0x0a9e('0x55')](_0x25c6e6['id'],ut['agentReadyId'](this[_0x0a9e('0x14')]))[_0x0a9e('0x56')](function(_0xdd268f){if(!_[_0x0a9e('0x41')](_0xdd268f)){for(var _0x2e8caf=0x0;_0x2e8caf<_0xdd268f[_0x0a9e('0x57')];_0x2e8caf+=0x1){if(ut[_0x0a9e('0x58')](_0xdd268f[_0x2e8caf][_0x0a9e('0x59')])<_0x25c6e6['dialRecallMeTimeout']*0x3c){if(_0xdd268f[_0x2e8caf][_0x0a9e('0x5a')]&&!_0xdd268f[_0x2e8caf]['Agent'][_0x0a9e('0x5b')]){_0x2c2cb0[_0x0a9e('0x5c')](_0xdd268f[_0x2e8caf]['id'])[_0x0a9e('0x56')](ut['logger2'](_0x0a9e('0x5d')))[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x5d')));}else{rpcDb[_0x0a9e('0x60')](_0xdd268f[_0x2e8caf]['id']);}}else{var _0x37be73=new Action(_0xdd268f[_0x2e8caf],_0x25c6e6);_0x37be73[_0x0a9e('0x61')]=moment()['format'](_0x0a9e('0x62'));_0x25c6e6[_0x0a9e('0x63')]+=0x1;ut[_0x0a9e('0x64')](_0x37be73,0x17,_0x0a9e('0x65'));if(_0x25c6e6[_0x0a9e('0x66')]){rpcDb[_0x0a9e('0x67')](ut[_0x0a9e('0x68')](_0xdd268f[_0x2e8caf]));rpcDb[_0x0a9e('0x69')](_0x37be73,_0x0a9e('0x6a'));}else{ut['logCustomer'](_0x37be73,0x16,_0x0a9e('0x6b'));rpcDb[_0x0a9e('0x69')](_0x37be73,'[HistoryRecallClose]');rpcDb['createCustomerFinal'](_0x37be73,'[HistoryRecallClose]');}}}}})[_0x0a9e('0x5e')](ut[_0x0a9e('0x5f')](_0x0a9e('0x6c')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x3d')]=function(_0x30decb){_0x30decb[_0x0a9e('0x2c')]=!![];if(ut[_0x0a9e('0x6d')](_0x30decb['loggedIn'])){_0x30decb['message']=utils['CAMPAIGN_STATUS'][_0x0a9e('0x6e')];}else if(!ut[_0x0a9e('0x6f')](_0x30decb[_0x0a9e('0x3c')])){_0x30decb['message']=utils[_0x0a9e('0x30')][_0x0a9e('0x31')];}else if(!this['isTrunkReachable'](_0x30decb['Trunk'])){if(!this[_0x0a9e('0x70')](_0x30decb['TrunkBackup'])){_0x30decb[_0x0a9e('0x4b')]=utils['CAMPAIGN_STATUS'][_0x0a9e('0x71')];}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}}else{_0x30decb[_0x0a9e('0x4b')]=utils[_0x0a9e('0x30')]['ACTIVE'];}};Preview['prototype'][_0x0a9e('0x72')]=function(_0x3aedd0,_0x49c095,_0x145931){var _0x5ce9ac=this;var _0x211ef9=this['actions'][_0x49c095];var _0xe22ccc=this['campaignsPreview'][_0x211ef9['queue']];var _0x5df0ad;var _0x2da03c=![];var _0x47de4c=0x2;var _0x2f7092=0x3;if(_0xe22ccc){switch(_0x145931){case'1':_0xe22ccc[_0x0a9e('0x73')]+=0x1;_0x211ef9[_0x0a9e('0x74')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x0,_0x0a9e('0x77'));ami[_0x0a9e('0x25')]('custom:agentnosuchnumber',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x79')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0x7a'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'0',_0xe22ccc)[_0x0a9e('0x56')](function(_0x5d86e9){_0x2da03c=_0x5d86e9[_0x0a9e('0x7c')]==0x1;_0x47de4c=_0xe22ccc[_0x0a9e('0x7d')];_0x2f7092=_0xe22ccc['callAdditionalPhoneAfterMin'];if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc['dialGlobalMaxRetry']){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb['createCustomerFinal'](_0x5df0ad,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x211ef9[_0x0a9e('0x74')]>=_0xe22ccc['dialNoSuchNumberMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x80'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0x74'),_0xe22ccc[_0x0a9e('0x7d')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}delete this['actions'][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x211ef9[_0x0a9e('0x74')]++;logger[_0x0a9e('0x26')]('actioncountonusuch',_0x211ef9[_0x0a9e('0x74')]);logger[_0x0a9e('0x26')]('id',_0x211ef9[_0x0a9e('0x85')]);_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnosuchnumberretry':_0x211ef9[_0x0a9e('0x74')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0x87'):var _0x88dcbf=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x211ef9['responsetime']=_0x88dcbf;_0x211ef9[_0x0a9e('0x88')]=_0x88dcbf;_0x211ef9[_0x0a9e('0x4d')]=!![];_0xe22ccc[_0x0a9e('0x2e')]+=0x1;logger['info'](_0x0a9e('0x89'),_0x211ef9['uniqueid'],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0xe22ccc[_0x0a9e('0x2e')]);ami[_0x0a9e('0x25')](_0x0a9e('0x8b'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0x8c'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));if(_0xe22ccc[_0x0a9e('0x8d')]||_0xe22ccc[_0x0a9e('0x8e')]){ami[_0x0a9e('0x25')](_0x0a9e('0x8f'),{'queue':_0x211ef9[_0x0a9e('0x43')],'interface':_0x211ef9[_0x0a9e('0x90')],'uniqueid':_0x211ef9[_0x0a9e('0x91')]});}break;case'16':ami[_0x0a9e('0x25')](_0x0a9e('0x92'),ut['buildObj'](_0x211ef9,_0x0a9e('0x93'),this[_0x0a9e('0x10')][_0x211ef9[_0x0a9e('0x43')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x211ef9,_0x0a9e('0x93')));_0xe22ccc[_0x0a9e('0x94')]+=0x1;_0xe22ccc['total']+=0x1;_0xe22ccc[_0x0a9e('0x95')]+=0x1;ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0x96'));_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x4,'Answer');rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0x97'));rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0x98'));rpcDb[_0x0a9e('0x99')](_0x211ef9);_0xe22ccc[_0x0a9e('0x9a')]+=_0x211ef9[_0x0a9e('0x9b')];_0xe22ccc[_0x0a9e('0x9c')]+=_0x211ef9[_0x0a9e('0x9b')];logger['info'](_0x0a9e('0x9d'),_0x211ef9[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0xe22ccc['name'],_0x0a9e('0x8a'),_0xe22ccc['pTalking']);delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'BUSY':_0xe22ccc[_0x0a9e('0x9f')]+=0x1;_0x211ef9[_0x0a9e('0xa0')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x5,_0x0a9e('0xa1'));_0x47de4c=_0xe22ccc[_0x0a9e('0xa2')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')]('custom:agentbusy',ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xa4')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xa5'));_0x5ce9ac['verifyAdditionalPhones'](_0x211ef9,'5',_0xe22ccc)[_0x0a9e('0x56')](function(_0x3511c9){_0x2da03c=_0x3511c9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xa8'));}else{if(_0x211ef9[_0x0a9e('0xa0')]>=_0xe22ccc[_0x0a9e('0xa9')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xa5'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xa0'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xa0')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countbusyretry':_0x211ef9[_0x0a9e('0xa0')]}})['then'](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xab'):_0xe22ccc['outboundNoAnswerCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xac')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x3,'NoAnswer');_0x47de4c=_0xe22ccc[_0x0a9e('0xad')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];var _0x2d2286=ut[_0x0a9e('0xae')](_0x211ef9,_0xe22ccc);ami[_0x0a9e('0x25')](_0x0a9e('0xaf'),_0x2d2286);rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logNoAnswer]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'3',_0xe22ccc)[_0x0a9e('0x56')](function(_0x45c109){_0x2da03c=_0x45c109[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,'Global');rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x211ef9[_0x0a9e('0xac')]>=_0xe22ccc[_0x0a9e('0xb0')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xb1'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xac'),_0xe22ccc[_0x0a9e('0xad')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9['idContact'],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'CONGESTION':_0xe22ccc[_0x0a9e('0xb2')]+=0x1;_0x211ef9[_0x0a9e('0xb3')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x8,_0x0a9e('0xb4'));_0x47de4c=_0xe22ccc['dialCongestionRetryFrequency'];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami['emit'](_0x0a9e('0xb5'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xb6')));rpcDb[_0x0a9e('0x69')](_0x211ef9,'[callProgressDetectingCustomer][logCongestion]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'8',_0xe22ccc)[_0x0a9e('0x56')](function(_0x1d4877){_0x2da03c=_0x1d4877['additional']==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xb7'));}else{if(_0x211ef9[_0x0a9e('0xb3')]>=_0xe22ccc[_0x0a9e('0xb8')]){rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xb9'));}else{rpcDb[_0x0a9e('0x81')](ut['scheduledAt'](_0x211ef9,_0x0a9e('0xb3'),_0xe22ccc[_0x0a9e('0xa2')]),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xb3')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countcongestionretry':_0x211ef9[_0x0a9e('0xb3')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case _0x0a9e('0xbb'):_0xe22ccc[_0x0a9e('0xbc')]+=0x1;_0x211ef9[_0x0a9e('0xbd')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0x14,_0x0a9e('0xbe'));_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];ami[_0x0a9e('0x25')](_0x0a9e('0xc0'),ut[_0x0a9e('0x78')](_0x211ef9,_0x0a9e('0xc1')));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc2'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)[_0x0a9e('0x56')](function(_0x4989f9){_0x2da03c=_0x4989f9[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut[_0x0a9e('0x76')](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x14,_0x0a9e('0xbe'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xc3'));}else{if(_0x211ef9[_0x0a9e('0xbd')]>=_0xe22ccc['dialAgentRejectMaxRetry']){rpcDb[_0x0a9e('0x7f')](_0x211ef9,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,_0x0a9e('0xbd'),_0xe22ccc[_0x0a9e('0xbf')]),_0x211ef9['unlockAgent'],_0x211ef9[_0x0a9e('0x83')]);}}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9['countnoanswerretry']}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});break;case'ABANDONED':_0xe22ccc['outboundAbandonedCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc4')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xb,_0x0a9e('0xc5'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xc6'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'11',_0xe22ccc)[_0x0a9e('0x56')](function(_0x586510){_0x2da03c=_0x586510[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xc6'));}else{if(_0x211ef9['countabandonedetry']>=_0xe22ccc[_0x0a9e('0xc7')]){rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xc6'));}else{rpcDb[_0x0a9e('0x81')](ut[_0x0a9e('0x82')](_0x211ef9,'countabandonedretry',_0xe22ccc['dialAbandonedRetryFrequency']),_0x211ef9[_0x0a9e('0xaa')],_0x211ef9['activeContact']);}}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});break;case'18':_0xe22ccc['outboundUnknownCallsDay']+=0x1;_0x211ef9[_0x0a9e('0xc8')]+=0x1;_0x211ef9['countglobal']=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x12,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0['dialstatus']);ami['emit'](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb[_0x0a9e('0x69')](_0x211ef9,_0x0a9e('0xcb'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2eb028){_0x2da03c=_0x2eb028['additional']==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0x12,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,_0x0a9e('0xcb'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xcb'));}}else{_0x211ef9[_0x0a9e('0xac')]++;_0x5ce9ac['incrementPreviewCounters']({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})[_0x0a9e('0x56')](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;case'19':_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut['logCustomer'](_0x211ef9,0x13,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);ami[_0x0a9e('0x25')](_0x0a9e('0xca'),ut[_0x0a9e('0x78')](_0x211ef9,'amd'));rpcDb['createCustomerHistory'](_0x211ef9,_0x0a9e('0xce'));_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'18',_0xe22ccc)[_0x0a9e('0x56')](function(_0x2fea95){_0x2da03c=_0x2fea95[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb['createCustomerFinal'](_0x5df0ad,_0x0a9e('0xce'));}else{rpcDb['createCustomerFinal'](_0x211ef9,_0x0a9e('0xce'));}}else{_0x211ef9['countnoanswerretry']++;_0x5ce9ac[_0x0a9e('0x86')]({'id':_0x211ef9[_0x0a9e('0x85')],'field':{'countnoanswerretry':_0x211ef9[_0x0a9e('0xac')]}})['then'](function(){_0x5ce9ac[_0x0a9e('0xba')](_0x211ef9,_0x47de4c,_0x2f7092)['then'](function(){});});}});delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];break;default:if(_0x211ef9[_0x0a9e('0x4d')]){ut[_0x0a9e('0x4e')](_0xe22ccc,_0x0a9e('0xcf'));ut[_0x0a9e('0x50')](_0x0a9e('0xd0')+_0xe22ccc[_0x0a9e('0x29')],_0x3aedd0);}_0xe22ccc[_0x0a9e('0xcc')]+=0x1;_0x211ef9[_0x0a9e('0x75')]=ut[_0x0a9e('0x76')](_0x211ef9);ut[_0x0a9e('0x64')](_0x211ef9,0xc,_0x3aedd0[_0x0a9e('0xc9')]||_0x3aedd0[_0x0a9e('0xcd')]);_0x47de4c=_0xe22ccc[_0x0a9e('0xbf')];_0x2f7092=_0xe22ccc[_0x0a9e('0xa3')];rpcDb['createCustomerHistory'](_0x211ef9,'[callProgressDetectingCustomer][logUnknown]');_0x5ce9ac[_0x0a9e('0x7b')](_0x211ef9,'20',_0xe22ccc)['then'](function(_0x1d999b){_0x2da03c=_0x1d999b[_0x0a9e('0x7c')]==0x1;if(!_0x2da03c){if(ut['totalGlobal'](_0x211ef9)>=_0xe22ccc[_0x0a9e('0xa6')]){_0x5df0ad=ut[_0x0a9e('0x7e')](_0x211ef9,0xf,_0x0a9e('0xa7'));rpcDb[_0x0a9e('0x7f')](_0x5df0ad,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x0a9e('0x7f')](_0x211ef9,_0x0a9e('0xd1'));}delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0x84')]];}else{_0x5ce9ac['swapAdditionalPhones'](_0x211ef9,_0x47de4c,_0x2f7092)[_0x0a9e('0x56')](function(){});}});}if(!(_0x211ef9[_0x0a9e('0x4d')]&&_0x145931==='16')){ut[_0x0a9e('0xd2')](_0xe22ccc,'[callProgressDetectingCustomer]');logger[_0x0a9e('0x26')](_0x0a9e('0xd3'),_0x211ef9[_0x0a9e('0x91')],'\x20Queue',_0xe22ccc[_0x0a9e('0x29')],_0x0a9e('0x44'),_0xe22ccc[_0x0a9e('0x2d')]);}if(_0x145931!==_0x0a9e('0x87')){delete this[_0x0a9e('0x13')][_0x3aedd0['linkedid']];delete this[_0x0a9e('0x13')][_0x3aedd0[_0x0a9e('0xd4')]];}_0xe22ccc['queueSummaryCountersUpdated']=!![];}};Preview[_0x0a9e('0xd')][_0x0a9e('0xd5')]=function(_0x1f6f1c,_0x5822a7,_0x5c3b6f){if(_['isUndefined'](_0x5822a7)&&_0x0a9e('0xd6')!==typeof _0x5822a7){return;}if(_[_0x0a9e('0xd7')](_0x5c3b6f)&&'object'!==typeof _0x5c3b6f){return;}switch(_0x5c3b6f[_0x0a9e('0xd8')]){case'0':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x0,_0x0a9e('0x77'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xda'));break;case'3':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x3,_0x0a9e('0xdb'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdd'));break;case'5':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x5,_0x0a9e('0xa1'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xde'));break;case'8':ut['logAgent'](_0x1f6f1c,0x8,_0x0a9e('0xb4'));rpcDb['createAgentHistory'](_0x1f6f1c,_0x0a9e('0xdf'));break;case'22':ut[_0x0a9e('0xd9')](_0x1f6f1c,0x16,_0x0a9e('0xe0'));rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xe1'));break;default:ut[_0x0a9e('0xd9')](_0x1f6f1c,0xc,_0x5c3b6f['reason']);rpcDb[_0x0a9e('0xdc')](_0x1f6f1c,_0x0a9e('0xdf'));}ut[_0x0a9e('0xd2')](_0x5822a7,_0x0a9e('0xe2'));logger['info'](_0x0a9e('0xe3'),_0x1f6f1c[_0x0a9e('0x91')],_0x0a9e('0x9e'),_0x5822a7[_0x0a9e('0x29')],_0x0a9e('0x44'),_0x5822a7[_0x0a9e('0x2d')]);delete this[_0x0a9e('0x13')][_0x1f6f1c[_0x0a9e('0x91')]];};Preview[_0x0a9e('0xd')][_0x0a9e('0x7b')]=function(_0x57f0ad,_0x2272bc,_0x88b25f){return cmHopperAdditionalPhone[_0x0a9e('0x7b')](_0x57f0ad,_0x2272bc,_0x88b25f)[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')](_0x0a9e('0xe4')));};Preview[_0x0a9e('0xd')][_0x0a9e('0xba')]=function(_0x566b90,_0x3b581c,_0xd2391){return cmHopperAdditionalPhone[_0x0a9e('0xba')](_0x566b90,_0x3b581c,_0xd2391)['catch'](logger[_0x0a9e('0x26')](_0x0a9e('0xe5')));};Preview[_0x0a9e('0xd')][_0x0a9e('0x86')]=function(_0x370b5e){return Promise[_0x0a9e('0xe6')]()[_0x0a9e('0x56')](cmHopperAdditionalPhone[_0x0a9e('0x86')](_0x370b5e))[_0x0a9e('0x5e')](logger[_0x0a9e('0x26')]('[incrementPreviewCounters]\x20'));};Preview[_0x0a9e('0xd')][_0x0a9e('0xe7')]=function(_0x15a9ed,_0x3db98f,_0x2b624e,_0x3942fd,_0x5cb48d){var _0x382687=this;return new Promise(function(_0x4f854b,_0x5bd139){if(_['isNil'](_0x3db98f)||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe8')])||_[_0x0a9e('0x41')](_0x3db98f[_0x0a9e('0xe9')])||_['isNil'](_0x3db98f[_0x0a9e('0x48')])){_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xea'),_0x3942fd,_0x5cb48d));return;}var _0x1fdb10=uuid['v4']();var _0x2c8d1d=_0x382687['campaignsPreview'][_0x3db98f['Queue'][_0x0a9e('0x29')]];var _0x33bcb2=_0x2b624e?_0x382687[_0x0a9e('0x14')][_0x2b624e]['id']:undefined;_0x382687['actions'][_0x1fdb10]=new Action(_0x3db98f,_0x2c8d1d,_0x1fdb10,_0x2b624e,_0x33bcb2);var _0x319752=_0x382687[_0x0a9e('0x13')][_0x1fdb10];_0x319752[_0x0a9e('0xaa')]=_0x3942fd;_0x319752['activeContact']=_0x5cb48d;_0x319752[_0x0a9e('0xeb')]=_0x2b624e;if(_[_0x0a9e('0xec')](_0x15a9ed)){_0x382687[_0x0a9e('0xed')](_0x319752,_0x2c8d1d,_0x3db98f,_0x2b624e)['then'](function(_0x272291){logger[_0x0a9e('0x26')](_0x0a9e('0xee'),'Queue:\x20'+_0x319752['queue']+'\x20IdHopper:\x20'+_0x319752[_0x0a9e('0x85')],JSON[_0x0a9e('0x45')](_0x272291));ami[_0x0a9e('0x25')](_0x0a9e('0xef'),ut['buildObj'](_0x319752,_0x0a9e('0xf0'),_0x382687['campaignsPreview'][_0x319752[_0x0a9e('0x43')]]));_0x4f854b(ut[_0x0a9e('0x4b')](_0x0a9e('0xf1')));})['catch'](function(_0x33b4b3){ut[_0x0a9e('0x32')](_0x0a9e('0xf2'),_0x33b4b3);_0x5bd139(ut['message'](_0x0a9e('0xf3'),_0x3942fd,_0x5cb48d));});}else{_0x2c8d1d['outboundBlacklistCallsDay']+=0x1;ut[_0x0a9e('0xf4')](_0x319752);rpcDb['createHistory'](_0x319752,_0x0a9e('0xf5'));delete _0x382687['actions'][_0x1fdb10];_0x5bd139(ut[_0x0a9e('0x4b')](_0x0a9e('0xf6'),_0x3942fd,_0x5cb48d));}});};Preview[_0x0a9e('0xd')][_0x0a9e('0x70')]=function(_0x1e306c){return!_[_0x0a9e('0x41')](_0x1e306c)&&!_[_0x0a9e('0x41')](_0x1e306c['name'])&&!_[_0x0a9e('0x41')](_0x1e306c[_0x0a9e('0xf7')])&&_0x1e306c['active']&&!_[_0x0a9e('0x41')](this[_0x0a9e('0x12')][util['format'](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])])&&!_[_0x0a9e('0x41')](this['trunks'][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')])&&(this[_0x0a9e('0x12')][util[_0x0a9e('0x27')](_0x0a9e('0xf8'),_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfa')||this['trunks'][util[_0x0a9e('0x27')]('SIP/%s',_0x1e306c[_0x0a9e('0x29')])][_0x0a9e('0xf9')]===_0x0a9e('0xfb'));};Preview[_0x0a9e('0xd')][_0x0a9e('0x5c')]=function(_0x2d45db,_0x5691ac){return this[_0x0a9e('0xfc')](_0x2d45db,_0x5691ac)[_0x0a9e('0x56')](function(_0x2977a7){return _['pick'](_0x2977a7,[_0x0a9e('0x4b')]);})[_0x0a9e('0x5e')](function(_0x4435d2){if(_0x4435d2[_0x0a9e('0xfd')]){rpcDb[_0x0a9e('0xfe')](_0x2d45db);}if(_0x4435d2[_0x0a9e('0xf7')]){rpcDb[_0x0a9e('0x60')](_0x2d45db);}throw _['pick'](_0x4435d2,[_0x0a9e('0x4b')]);});};Preview[_0x0a9e('0xd')][_0x0a9e('0xfc')]=function(_0x2ce3be,_0x3de77e){var _0x241404=this;var _0x8120e,_0x5d6a48;return rpcDb['getContactPreview'](_0x2ce3be)[_0x0a9e('0x56')](function(_0x3f507c){if(!_[_0x0a9e('0x41')](_0x3f507c[0x0])){_0x5d6a48=_0x3f507c[0x0][_0x0a9e('0xff')]?![]:!![];_0x8120e=_0x3f507c[0x0][_0x0a9e('0xff')]?!![]:![];_0x8120e=_0x3de77e?!![]:_0x8120e;}var _0x131da8=_0x241404[_0x0a9e('0x100')](_0x3f507c);if(_0x131da8['isValid']){rpcDb[_0x0a9e('0x101')](_[_0x0a9e('0x46')](_0x3f507c[0x0],[_0x0a9e('0x48'),_0x0a9e('0xe9')]))[_0x0a9e('0x56')](function(_0x3c6082){_0x241404[_0x0a9e('0xe7')](_0x3c6082,_0x3f507c[0x0],_0x3de77e,_0x5d6a48,_0x8120e)['then'](function(_0x311288){return _0x311288;})[_0x0a9e('0x5e')](function(_0x231826){throw _0x231826;});})['catch'](function(_0x2b8ad4){ut[_0x0a9e('0x32')](_0x0a9e('0x102'),_0x2b8ad4);throw ut[_0x0a9e('0x4b')]('Call\x20unsuccessful',_0x5d6a48,_0x8120e);});}else{throw ut[_0x0a9e('0x4b')](_0x131da8[_0x0a9e('0x4b')],_0x5d6a48,_0x8120e);}})[_0x0a9e('0x5e')](function(_0x93d953){ut[_0x0a9e('0x32')](_0x0a9e('0x103'),_0x93d953);throw ut[_0x0a9e('0x4b')](_0x0a9e('0x104'),![],!![]);});};Preview['prototype'][_0x0a9e('0x100')]=function(_0x266aa1){if(_[_0x0a9e('0x41')](_0x266aa1)||_[_0x0a9e('0xec')](_0x266aa1)||!_['isNil'](_0x266aa1[0x0]['Agent'])&&_[_0x0a9e('0x41')](_0x266aa1[0x0][_0x0a9e('0x5a')][_0x0a9e('0x29')])){ut['logger'](_0x0a9e('0x105'),_0x266aa1);return{'isValid':![],'message':_0x0a9e('0x106')};}var _0x4d8a67=this[_0x0a9e('0x10')][_0x266aa1[0x0]['Queue'][_0x0a9e('0x29')]];_0x4d8a67['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];if(_[_0x0a9e('0x41')](_0x4d8a67)){ut[_0x0a9e('0x32')](_0x0a9e('0x107'),_0x4d8a67);return{'isValid':![],'message':_0x0a9e('0x108')};}if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x109')])){ut['logger'](_0x0a9e('0x10a'),_0x0a9e('0x10b')+_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x10c'));if(!this[_0x0a9e('0x70')](_0x4d8a67[_0x0a9e('0x10d')])){ut[_0x0a9e('0x32')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x4d8a67['name']+_0x0a9e('0x10e'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x0a9e('0x6f')](_0x4d8a67[_0x0a9e('0x3c')])){ut[_0x0a9e('0x32')](_0x0a9e('0x10f'),_0x4d8a67[_0x0a9e('0x29')]+_0x0a9e('0x110'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4d8a67[_0x0a9e('0x29')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview[_0x0a9e('0xd')]['execCall']=function(_0x38dceb,_0x5dc978,_0x550cbf,_0x26223f){var _0x4a7a3c=this;return new Promise(function(_0x24470a,_0x142e53){var _0xe1ab0d=_0x38dceb['uniqueid'];var _0x4152cd=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?util['format']('SIP/%s/%s%s',_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978[_0x0a9e('0x111')][_0x0a9e('0x112')]()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')][_0x0a9e('0x114')](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf['phone']):util['format']('SIP/%s/%s%s',_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x29')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x29')],_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x111')])?'':_0x5dc978['dialPrefix']['trim']()||'',_0x5dc978[_0x0a9e('0x113')]>0x0?_0x550cbf[_0x0a9e('0xe9')]['substring'](_0x5dc978[_0x0a9e('0x113')]):_0x550cbf[_0x0a9e('0xe9')]);var _0x2e2280=_0x4a7a3c[_0x0a9e('0x70')](_0x5dc978[_0x0a9e('0x109')])?ut[_0x0a9e('0x115')](_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978[_0x0a9e('0x11a')]):ut[_0x0a9e('0x115')](_[_0x0a9e('0x41')](_0x5dc978[_0x0a9e('0x10d')])?_0x5dc978[_0x0a9e('0x109')][_0x0a9e('0x116')]:_0x5dc978[_0x0a9e('0x10d')][_0x0a9e('0x116')],_0x5dc978[_0x0a9e('0x117')],_0x5dc978[_0x0a9e('0x118')]>0x0?ut[_0x0a9e('0x119')](_0x5dc978[_0x0a9e('0x11a')],_0x5dc978['dialRandomLastDigitCallerIdNumber']):_0x5dc978['dialOriginateCallerIdNumber']);if(_0x2e2280){_0x38dceb[_0x0a9e('0x11b')]=ut[_0x0a9e('0x11c')](_0x2e2280);_0x38dceb[_0x0a9e('0x11d')]=ut[_0x0a9e('0x11e')](_0x2e2280);}var _0x33359a=ut[_0x0a9e('0x11f')](_0x5dc978,_0x550cbf,_0x4152cd,_0x2e2280,_0xe1ab0d,_0x38dceb);var _0xa8b5de=utils['setXMDContactVariables'](_0x550cbf[_0x0a9e('0xe8')]);Object['assign'](_0x33359a,_0xa8b5de);_[_0x0a9e('0x120')](_0x38dceb,ut[_0x0a9e('0x121')](_0x33359a));_0x38dceb[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));_0x5dc978[_0x0a9e('0x122')]=_0x33359a;var _0x465003=ut[_0x0a9e('0x123')](_0x38dceb,_0x5dc978,_0x33359a,_0x38dceb[_0x0a9e('0x83')],_0x26223f);return ami[_0x0a9e('0x124')](_0x465003)[_0x0a9e('0x56')](function(_0x8231e5){_0x5dc978[_0x0a9e('0x2d')]+=0x1;logger[_0x0a9e('0x26')](_0x0a9e('0x125'),_0xe1ab0d,_0x0a9e('0x9e'),_0x5dc978['name'],'originated:\x20',_0x5dc978[_0x0a9e('0x2d')]);_0x24470a(_0x8231e5);})[_0x0a9e('0x5e')](function(_0x52b365){ut['logAgent'](_0x38dceb,0xe,_0x0a9e('0x126'));rpcDb[_0x0a9e('0xdc')](_0x38dceb,_0x0a9e('0x127'));_0x142e53(_0x52b365);});});};Preview['prototype'][_0x0a9e('0x1d')]=function(_0x5b6447){if(this[_0x0a9e('0x13')][_0x5b6447['linkedid']]){this[_0x0a9e('0x13')][_0x5b6447['linkedid']][_0x0a9e('0x4a')]=_0x5b6447[_0x0a9e('0x4a')];}};Preview[_0x0a9e('0xd')]['syncOriginateResponse']=function(_0x316b51){var _0x497fda=this;var _0x505ffd=this[_0x0a9e('0x13')][_0x316b51[_0x0a9e('0x128')]];if(_0x505ffd){if(_0x505ffd[_0x0a9e('0xeb')]&&this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]){ut[_0x0a9e('0x129')](_0x505ffd,this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]][_0x0a9e('0x29')],this[_0x0a9e('0x14')][_0x505ffd[_0x0a9e('0xeb')]]['id']);}var _0x98bf26=_[_0x0a9e('0x12a')](_0x505ffd);_0x98bf26[_0x0a9e('0x12b')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));var _0x310026=_0x497fda[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]];if(ut['isFailure'](_0x316b51[_0x0a9e('0x12c')])){if(_0x505ffd[_0x0a9e('0xaa')]){rpcDb[_0x0a9e('0xfe')](_0x505ffd[_0x0a9e('0x85')]);}if(_0x505ffd['activeContact']){rpcDb['disableContact'](_0x505ffd['idContact']);}ami[_0x0a9e('0x25')]('custom:agentringnoanswer',ut[_0x0a9e('0x78')](_0x505ffd,_0x0a9e('0x12d'),this[_0x0a9e('0x10')][_0x505ffd[_0x0a9e('0x43')]]));this[_0x0a9e('0xd5')](_0x98bf26,_0x310026,_0x316b51);}else{_0x505ffd[_0x0a9e('0x61')]=moment()[_0x0a9e('0x27')](_0x0a9e('0x62'));ut[_0x0a9e('0xd9')](_0x98bf26,0x4,_0x0a9e('0x12e'));rpcDb['createAgentHistory'](_0x98bf26,_0x0a9e('0x12f'));}}};Preview['prototype'][_0x0a9e('0x1a')]=function(_0x586d2f){var _0xf4de86=this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]];var _0x556bb7;if(_0xf4de86){_0x556bb7=this[_0x0a9e('0x10')][_0xf4de86[_0x0a9e('0x43')]];logger['info']('[syncHangup][talking]',_0x586d2f[_0x0a9e('0x84')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],'pTalking:\x20',_0x556bb7['pTalking']);}if(this['actions'][_0x586d2f[_0x0a9e('0x84')]]&&_0x586d2f[_0x0a9e('0x84')]!==_0x586d2f[_0x0a9e('0x91')]){if(_0x586d2f[_0x0a9e('0x130')]==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')](_0x0a9e('0x131'),_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}}else if(_0xf4de86&&_[_0x0a9e('0x41')](_0xf4de86['statedesc'])&&_0x556bb7[_0x0a9e('0x132')]&&_0x586d2f[_0x0a9e('0x84')]===_0x586d2f[_0x0a9e('0x91')]&&_[_0x0a9e('0x41')](_0x586d2f[_0x0a9e('0xd8')])&&_0x586d2f[_0x0a9e('0x130')]==='16'&&_0x586d2f[_0x0a9e('0x133')]==='6'&&_[_0x0a9e('0xd7')](_0xf4de86[_0x0a9e('0x134')])){if(_0xf4de86['unlockAgent']){rpcDb['unlockContact'](_0xf4de86[_0x0a9e('0x85')]);}if(_0xf4de86[_0x0a9e('0x83')]){rpcDb['disableContact'](_0xf4de86[_0x0a9e('0x85')]);}_0x586d2f[_0x0a9e('0xd8')]='22';this['callProgressDetectingAgent'](_0xf4de86,_0x556bb7,_0x586d2f);}else if(_0xf4de86&&_0xf4de86[_0x0a9e('0x134')]){if(_0x586d2f['cause']==='16'&&this[_0x0a9e('0x13')][_0x586d2f[_0x0a9e('0x84')]]['dialAnswer']){logger[_0x0a9e('0x26')](_0x0a9e('0x135'),_0x586d2f['linkedid'],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7['name'],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')]);}else if(this[_0x0a9e('0x13')][_0x586d2f['linkedid']][_0x0a9e('0x4d')]){logger[_0x0a9e('0x26')]('[syncHangup][talking][cause]',_0x586d2f[_0x0a9e('0x84')],_0x586d2f[_0x0a9e('0x130')],_0x0a9e('0x9e'),_0x556bb7[_0x0a9e('0x29')],_0x0a9e('0x8a'),_0x556bb7[_0x0a9e('0x2e')]);this[_0x0a9e('0x72')](_0x586d2f,_0x586d2f['linkedid'],_0x586d2f['cause']);}}};Preview['prototype']['syncDialEnd']=function(_0x5e9817){if(this[_0x0a9e('0x13')][_0x5e9817[_0x0a9e('0xd4')]]&&_0x5e9817['destlinkedid']!==_0x5e9817['destuniqueid']){this[_0x0a9e('0x72')](_0x5e9817,_0x5e9817['destlinkedid'],_0x5e9817[_0x0a9e('0xcd')]);}};Preview[_0x0a9e('0xd')][_0x0a9e('0x136')]=function(_0x175c97){if(this[_0x0a9e('0x13')][_0x175c97[_0x0a9e('0x84')]]&&_0x175c97['linkedid']!==_0x175c97[_0x0a9e('0x91')]&&!this[_0x0a9e('0x13')][_0x175c97['linkedid']][_0x0a9e('0x4d')]){if(_0x175c97[_0x0a9e('0x130')]==='1'){this[_0x0a9e('0x72')](_0x175c97,_0x175c97[_0x0a9e('0x84')],_0x175c97[_0x0a9e('0x130')]);}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x137')]=function(_0x4a36df,_0x331216,_0x508395){if(this[_0x0a9e('0x13')][_0x4a36df]){if(_[_0x0a9e('0x41')](this['actions'][_0x4a36df][_0x0a9e('0x122')])){this[_0x0a9e('0x13')][_0x4a36df]['variables']={};}this[_0x0a9e('0x13')][_0x4a36df]['variables'][_0x331216]=_0x508395;}};Preview[_0x0a9e('0xd')][_0x0a9e('0x1f')]=function(_0x5d0620){try{if(!_[_0x0a9e('0x41')](_0x5d0620)){if(ut['filterKey'](_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0])){this[_0x0a9e('0x137')](_0x5d0620[_0x0a9e('0x91')],_[_0x0a9e('0x138')](_0x5d0620[_0x0a9e('0x139')])[0x0],_0x5d0620[_0x0a9e('0x13a')]);}}}catch(_0x53b5c2){logger[_0x0a9e('0x13b')](_0x0a9e('0x13c'),util[_0x0a9e('0x13d')](_0x53b5c2,{'showHidden':![],'depth':null}));}};Preview[_0x0a9e('0xd')][_0x0a9e('0x21')]=function(_0x5932ad){if(_0x5932ad){if(this[_0x0a9e('0x13')][_0x5932ad['transfertargetlinkedid']]){this['actions'][_0x5932ad[_0x0a9e('0x13e')]]['transfer']=!![];}}};Preview[_0x0a9e('0xd')][_0x0a9e('0x23')]=function(_0x58d5fd){if(_0x58d5fd){if(this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]]){this[_0x0a9e('0x13')][_0x58d5fd[_0x0a9e('0x13f')]][_0x0a9e('0x134')]=!![];}}};module[_0x0a9e('0x140')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 6364422..24d61a6 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 _0x2aaa=['queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','from-sip','exten','holdtime','assigned','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','error','inspect','createHistory','catch','[createHistory]\x20','resolve','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','then','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0x2aaa,0xac));var _0xa2aa=function(_0x2a8668,_0x57d82d){_0x2a8668=_0x2a8668-0x0;var _0x27b8a3=_0x2aaa[_0x2a8668];return _0x27b8a3;};'use strict';var util=require(_0xa2aa('0x0'));var BPromise=require(_0xa2aa('0x1'));var logger=require(_0xa2aa('0x2'))(_0xa2aa('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0xa2aa('0x4'));var cmHopperBlack=require(_0xa2aa('0x5'));var agentReportPreview=require(_0xa2aa('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x37a9a2){return function(_0x3f9f2e){logger[_0xa2aa('0x7')](_0x37a9a2,util[_0xa2aa('0x8')](_0x3f9f2e,{'showHidden':![],'depth':null}));};}function create(_0x3931e3){return cmHopperHistory[_0xa2aa('0x9')](_0x3931e3)[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0xb')));}function createAgent(_0x152ac0){return BPromise[_0xa2aa('0xc')]()['then'](agentReportPreview[_0xa2aa('0x9')](_0x152ac0))[_0xa2aa('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x36bd83){return cmHopper['moveContactManagedDialer'](_0x36bd83,!![])[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0xd')));}exports['checkIsBlackList']=function(_0x11b9c7){return cmHopperBlack[_0xa2aa('0xe')](_0x11b9c7)['catch'](loggerCatch(_0xa2aa('0xf')));};exports['getContactPreview']=function(_0x2f143a){return BPromise[_0xa2aa('0xc')]()[_0xa2aa('0x10')](cmHopper[_0xa2aa('0x11')](_0x2f143a))[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0x12')));};exports[_0xa2aa('0x9')]=function(_0x22a692,_0x2aae35){create(_0x22a692)['catch'](loggerCatch(_0x2aae35));moveContact(_0x22a692)[_0xa2aa('0xa')](loggerCatch(_0x2aae35));};exports[_0xa2aa('0x13')]=function(_0x4bd6ab,_0x45d66f){createAgent(_0x4bd6ab)['catch'](loggerCatch(_0x45d66f));};exports[_0xa2aa('0x14')]=function(_0x104a4e,_0x17a986){create(_0x104a4e)[_0xa2aa('0xa')](loggerCatch(_0x17a986));};exports['createCustomerFinal']=function(_0x14db37,_0x47d6a2){moveContact(_0x14db37)[_0xa2aa('0xa')](loggerCatch(_0x47d6a2));};exports[_0xa2aa('0x15')]=function(_0x245486,_0x5486b0,_0x38fb80){if(_0x5486b0){_0x245486[_0xa2aa('0x16')]=null;}if(_0x38fb80){_0x245486['active']=![];}return cmHopper['rescheduleContact'](_0x245486)[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0x17')));};exports['countReScheduled']=function(_0xd1b0fd){return cmHopper[_0xa2aa('0x18')](_0xd1b0fd)[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0x19')));};exports['unlockContact']=function(_0x43374e){return cmHopper['unlockContact']({'UserId':null},_0x43374e,0x1)['catch'](loggerCatch(_0xa2aa('0x1a')));};exports['disableContact']=function(_0x2b2b78){return cmHopper['unlockContact']({'active':![]},_0x2b2b78,0x1)['catch'](loggerCatch(_0xa2aa('0x1b')));};exports[_0xa2aa('0x1c')]=function(_0x1efcbd){var _0xe6e887={};_0xe6e887[_0xa2aa('0x1d')]=_0x1efcbd['type'];_0xe6e887[_0xa2aa('0x1e')]=_0x1efcbd[_0xa2aa('0x1e')];_0xe6e887[_0xa2aa('0x1f')]=_0x1efcbd[_0xa2aa('0x1f')];_0xe6e887[_0xa2aa('0x20')]=_0x1efcbd[_0xa2aa('0x20')];_0xe6e887[_0xa2aa('0x21')]=_0x1efcbd[_0xa2aa('0x21')];_0xe6e887[_0xa2aa('0x22')]=_0x1efcbd[_0xa2aa('0x23')];_0xe6e887[_0xa2aa('0x24')]=_0x1efcbd[_0xa2aa('0x23')];_0xe6e887[_0xa2aa('0x25')]=0x1;_0xe6e887['queuecallercompleteAt']=_0x1efcbd[_0xa2aa('0x26')];_0xe6e887[_0xa2aa('0x27')]=_0x1efcbd[_0xa2aa('0x28')];_0xe6e887['context']=_0xa2aa('0x29');_0xe6e887[_0xa2aa('0x2a')]='xcally-motion-preview';_0xe6e887[_0xa2aa('0x2b')]=0x0;_0xe6e887[_0xa2aa('0x2c')]=0x1;_0xe6e887['lastAssignedTo']=_0x1efcbd['membername'];_0xe6e887[_0xa2aa('0x2d')]=_0xa2aa('0x2e');return BPromise[_0xa2aa('0xc')]()[_0xa2aa('0x10')](voiceQueueReport['create'](_0xe6e887))[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0x2f')));};exports[_0xa2aa('0x30')]=function(_0x55c37e,_0x5114ee){return BPromise[_0xa2aa('0xc')]()['then'](cmHopper[_0xa2aa('0x30')](_0x55c37e,_0x5114ee))[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0x31')));};exports[_0xa2aa('0x32')]=function(_0x260bc7){return cmHopper[_0xa2aa('0x15')](_0x260bc7,!![],!![])[_0xa2aa('0xa')](loggerCatch(_0xa2aa('0x33')));}; \ No newline at end of file +var _0xea79=['catch','resolve','then','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','UserId','active','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','from-sip','xcally-motion-preview','assigned','queuecallerexitreason','COMPLETED','create','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','../../../config/logger','preview','../rpc/cmHopper','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','createHistory'];(function(_0x5d46fa,_0x472f27){var _0x5b49ec=function(_0x1205b8){while(--_0x1205b8){_0x5d46fa['push'](_0x5d46fa['shift']());}};_0x5b49ec(++_0x472f27);}(_0xea79,0x8a));var _0x9ea7=function(_0x103466,_0x190bb5){_0x103466=_0x103466-0x0;var _0x416ba8=_0xea79[_0x103466];return _0x416ba8;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x9ea7('0x0'))(_0x9ea7('0x1'));var cmHopper=require(_0x9ea7('0x2'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x9ea7('0x3'));var agentReportPreview=require(_0x9ea7('0x4'));var voiceQueueReport=require(_0x9ea7('0x5'));function loggerCatch(_0x569931){return function(_0x3599a9){logger[_0x9ea7('0x6')](_0x569931,util[_0x9ea7('0x7')](_0x3599a9,{'showHidden':![],'depth':null}));};}function create(_0x52cee4){return cmHopperHistory[_0x9ea7('0x8')](_0x52cee4)[_0x9ea7('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0xc2a7f4){return BPromise[_0x9ea7('0xa')]()[_0x9ea7('0xb')](agentReportPreview['createHistory'](_0xc2a7f4))[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0xc')));}function moveContact(_0x183bfd){return cmHopper[_0x9ea7('0xd')](_0x183bfd,!![])[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0xe')));}exports[_0x9ea7('0xf')]=function(_0x2534f9){return cmHopperBlack[_0x9ea7('0xf')](_0x2534f9)['catch'](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x9ea7('0x10')]=function(_0x40cc7a){return BPromise[_0x9ea7('0xa')]()[_0x9ea7('0xb')](cmHopper[_0x9ea7('0x10')](_0x40cc7a))[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0x11')));};exports[_0x9ea7('0x8')]=function(_0x596471,_0x4d9c62){create(_0x596471)[_0x9ea7('0x9')](loggerCatch(_0x4d9c62));moveContact(_0x596471)['catch'](loggerCatch(_0x4d9c62));};exports[_0x9ea7('0x12')]=function(_0x3ca9b7,_0x338a37){createAgent(_0x3ca9b7)[_0x9ea7('0x9')](loggerCatch(_0x338a37));};exports[_0x9ea7('0x13')]=function(_0x44899b,_0x285485){create(_0x44899b)[_0x9ea7('0x9')](loggerCatch(_0x285485));};exports['createCustomerFinal']=function(_0x5720f5,_0x9434f6){moveContact(_0x5720f5)[_0x9ea7('0x9')](loggerCatch(_0x9434f6));};exports['rescheduleContact']=function(_0x56b4c0,_0x14e126,_0x2b5fb7){if(_0x14e126){_0x56b4c0[_0x9ea7('0x14')]=null;}if(_0x2b5fb7){_0x56b4c0[_0x9ea7('0x15')]=![];}return cmHopper['rescheduleContact'](_0x56b4c0)[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0x16')));};exports['countReScheduled']=function(_0x28216c){return cmHopper['countReScheduled'](_0x28216c)[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0x17')));};exports[_0x9ea7('0x18')]=function(_0x1ee146){return cmHopper['unlockContact']({'UserId':null},_0x1ee146,0x1)[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0x19')));};exports[_0x9ea7('0x1a')]=function(_0x5e8da2){return cmHopper[_0x9ea7('0x18')]({'active':![]},_0x5e8da2,0x1)[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0x1b')));};exports[_0x9ea7('0x1c')]=function(_0x465787){var _0x4531ce={};_0x4531ce[_0x9ea7('0x1d')]=_0x465787['type'];_0x4531ce['uniqueid']=_0x465787['uniqueid'];_0x4531ce[_0x9ea7('0x1e')]=_0x465787[_0x9ea7('0x1e')];_0x4531ce[_0x9ea7('0x1f')]=_0x465787[_0x9ea7('0x1f')];_0x4531ce['queue']=_0x465787[_0x9ea7('0x20')];_0x4531ce['queuecallerjoinAt']=_0x465787[_0x9ea7('0x21')];_0x4531ce[_0x9ea7('0x22')]=_0x465787['answertime'];_0x4531ce[_0x9ea7('0x23')]=0x1;_0x4531ce[_0x9ea7('0x24')]=_0x465787[_0x9ea7('0x25')];_0x4531ce[_0x9ea7('0x26')]=_0x465787['membername'];_0x4531ce[_0x9ea7('0x27')]=_0x9ea7('0x28');_0x4531ce['exten']=_0x9ea7('0x29');_0x4531ce['holdtime']=0x0;_0x4531ce[_0x9ea7('0x2a')]=0x1;_0x4531ce['lastAssignedTo']=_0x465787['membername'];_0x4531ce[_0x9ea7('0x2b')]=_0x9ea7('0x2c');return BPromise[_0x9ea7('0xa')]()[_0x9ea7('0xb')](voiceQueueReport[_0x9ea7('0x2d')](_0x4531ce))[_0x9ea7('0x9')](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x2c1d7e,_0x38b9f2){return BPromise[_0x9ea7('0xa')]()['then'](cmHopper['getContactRecallMe'](_0x2c1d7e,_0x38b9f2))[_0x9ea7('0x9')](loggerCatch(_0x9ea7('0x2e')));};exports[_0x9ea7('0x2f')]=function(_0x39700d){return cmHopper['rescheduleContact'](_0x39700d,!![],!![])['catch'](loggerCatch(_0x9ea7('0x30')));}; \ 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 d4d44d9..49ea45f 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 _0xb799=['inspect','logger','loggerError','logger2','info','message','getCallerId','isUndefined','string','format','\x22%s\x22\x20<%s>','isEmpty','isNil','addVariables','Queue','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','statedesc','Blacklist','starttime','responsetime','endtime','ringtime','getSeconds','logLookAgent','membername','logCustomer','YYYY-MM-DD\x20HH:mm:ss','state','talktime','answertime','isFailure','Failure','variablesAction','calleridname','BOOKED','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','lastevent','queue','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','push','getDiff','milliseconds','diff','seconds','CampaignId','filterKey','campaigntype','dialAnswer','scheduledat','callback','callbackuniqueid','callbackat','UserId','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','noanswer','keys','variables','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','env','XCALLY_IP_AGI','127.0.0.1','loggerCatch','error'];(function(_0x1ea002,_0x33c605){var _0x584919=function(_0x36ca1a){while(--_0x36ca1a){_0x1ea002['push'](_0x1ea002['shift']());}};_0x584919(++_0x33c605);}(_0xb799,0x18c));var _0x9b79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb799[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x9b79('0x0'));var _=require(_0x9b79('0x1'));var moment=require(_0x9b79('0x2'));var logger=require(_0x9b79('0x3'))('preview');var ipAgi=process[_0x9b79('0x4')][_0x9b79('0x5')]||_0x9b79('0x6');var utils=require('../../dialer/utils');exports[_0x9b79('0x7')]=function(_0x4c5517){return function(_0x5cd68b){logger[_0x9b79('0x8')](_0x4c5517,util[_0x9b79('0x9')](_0x5cd68b,{'showHidden':![],'depth':null}));};};exports[_0x9b79('0xa')]=function(_0x4e9e9e,_0x1b26b9){logger['info'](_0x4e9e9e,util[_0x9b79('0x9')](_0x1b26b9,{'showHidden':![],'depth':null}));};exports[_0x9b79('0xb')]=function(_0x414dc5,_0xd8b7c0){logger[_0x9b79('0x8')](_0x414dc5,util[_0x9b79('0x9')](_0xd8b7c0,{'showHidden':![],'depth':null}));};exports[_0x9b79('0xc')]=function(_0x4e1b9e){return function(_0x5606df){logger[_0x9b79('0xd')](_0x4e1b9e,util[_0x9b79('0x9')](_0x5606df,{'showHidden':![],'depth':null}));};};exports[_0x9b79('0xe')]=function(_0x479ddf,_0x15e87f,_0x245d5a){return{'message':_0x479ddf,'unlock':_0x15e87f,'active':_0x245d5a};};exports[_0x9b79('0xf')]=function(_0x159edd,_0x450b56,_0x3bc07b){if(!_[_0x9b79('0x10')](_0x3bc07b)&&_0x9b79('0x11')===typeof _0x3bc07b&&!_['isEmpty'](_0x3bc07b)){if(!_[_0x9b79('0x10')](_0x450b56)&&'string'===typeof _0x450b56&&!_['isEmpty'](_0x450b56)){return util[_0x9b79('0x12')](_0x9b79('0x13'),_0x450b56,_0x3bc07b);}return util[_0x9b79('0x12')]('\x22%s\x22\x20<%s>',_0x3bc07b,_0x3bc07b);}if(!_[_0x9b79('0x10')](_0x159edd)&&'string'===typeof _0x159edd&&!_[_0x9b79('0x14')](_0x159edd)){return _0x159edd;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x240d76){if(_[_0x9b79('0x15')](_0x240d76)){return![];}return _0x240d76;};exports[_0x9b79('0x16')]=function(_0x1a1c7d,_0x2c9f12,_0x3ba141,_0x234166,_0x35deba,_0x416e3c){var _0x3e833b={'XMD-QUEUE':_0x2c9f12[_0x9b79('0x17')]?_0x2c9f12['Queue']['name']:'','XMD-CALLERID':_0x234166,'XMD-CALLERID-PREVIEW':_0x416e3c?util[_0x9b79('0x12')](_0x9b79('0x13'),_0x416e3c['calleridname'],_0x416e3c[_0x9b79('0x18')]):_0x234166,'XMD-DIALID':_0x35deba,'XMD-CONTACTID':_0x2c9f12[_0x9b79('0x19')],'XMD-CDRTYPE':_0x9b79('0x1a'),'CALLERID(all)':_0x234166,'XMD-VOICEQUEUEID':_0x2c9f12[_0x9b79('0x1b')],'XMD-DIALCHANNEL':_0x3ba141,'XMD-DIALTIMEOUT':_0x1a1c7d[_0x9b79('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x9b79('0x12')]('\x22rtTxX%s%s\x22',_0x1a1c7d[_0x9b79('0x1d')]?'g':'',_[_0x9b79('0x14')](_0x1a1c7d[_0x9b79('0x1e')])?'':_0x9b79('0x1f')),'XMD-DIALURL':_0x1a1c7d[_0x9b79('0x20')]||'','XMD-AGI':_0x1a1c7d['dialQueueProject']?util[_0x9b79('0x12')](_0x9b79('0x21'),ipAgi,_0x1a1c7d['dialQueueProject']):_0x9b79('0x22'),'XMD-AGIAFTER':_0x1a1c7d[_0x9b79('0x1d')]?util[_0x9b79('0x12')](_0x9b79('0x21'),ipAgi,_0x1a1c7d['dialQueueProject2']):_0x9b79('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x416e3c?_0x416e3c['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x416e3c?_0x416e3c[_0x9b79('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x9b79('0x24')};if(!_[_0x9b79('0x14')](_0x1a1c7d[_0x9b79('0x1e')])){_0x3e833b[util[_0x9b79('0x12')]('%s',_0x9b79('0x25'))]=_0x1a1c7d[_0x9b79('0x1e')];_0x3e833b[util['format']('%s',_0x9b79('0x26'))]=_0x35deba;}return _0x3e833b;};exports[_0x9b79('0x27')]=function(_0x1d75f2){var _0x154918={};for(var _0x4b38bc in _0x1d75f2){if(_0x1d75f2[_0x9b79('0x28')](_0x4b38bc)){_0x154918[util[_0x9b79('0x12')]('%s',_[_0x9b79('0x29')](_0x4b38bc))]=_0x1d75f2[_0x4b38bc];}}return{'variables':_0x154918};};exports[_0x9b79('0x2a')]=function(_0x31b1e6,_0x593e9d){if(!_[_0x9b79('0x15')](_0x31b1e6)){if(_0x31b1e6[_0x9b79('0x28')](_0x9b79('0x2b'))){if(_0x31b1e6[_0x9b79('0x2b')]>0x0){_0x31b1e6[_0x9b79('0x2b')]-=0x1;}else{logger['error'](_0x9b79('0x2c'),_0x593e9d);}}}else{logger[_0x9b79('0x8')](_0x9b79('0x2d'),_0x593e9d);}};exports[_0x9b79('0x2e')]=function(_0x4b9bdd){var _0x5b7512=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4b9bdd['state']=0xd;_0x4b9bdd[_0x9b79('0x2f')]=_0x9b79('0x30');_0x4b9bdd[_0x9b79('0x31')]=_0x5b7512;_0x4b9bdd[_0x9b79('0x32')]=_0x5b7512;_0x4b9bdd[_0x9b79('0x33')]=_0x5b7512;};exports['logAgent']=function(_0x335f13,_0xcf17b1,_0x302950){var _0x57a20e=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x335f13['state']=_0xcf17b1;_0x335f13[_0x9b79('0x2f')]=_0x302950;_0x335f13[_0x9b79('0x32')]=_0x57a20e;_0x335f13[_0x9b79('0x34')]=utils[_0x9b79('0x35')](_0x335f13[_0x9b79('0x32')],_0x335f13['starttime']);};exports[_0x9b79('0x36')]=function(_0x1e77e2,_0x50c4a5,_0x5cab3c){_0x1e77e2[_0x9b79('0x37')]=_0x50c4a5;_0x1e77e2['UserId']=_0x5cab3c;};exports[_0x9b79('0x38')]=function(_0x2d108d,_0x1ec6b8,_0x823337){var _0x244cc6=moment()[_0x9b79('0x12')](_0x9b79('0x39'));_0x2d108d[_0x9b79('0x3a')]=_0x1ec6b8;_0x2d108d[_0x9b79('0x2f')]=_0x823337;_0x2d108d[_0x9b79('0x32')]=_0x2d108d[_0x9b79('0x32')]?_0x2d108d[_0x9b79('0x32')]:_0x244cc6;_0x2d108d[_0x9b79('0x33')]=_0x2d108d[_0x9b79('0x33')]?_0x2d108d['endtime']:_0x244cc6;_0x2d108d[_0x9b79('0x34')]=utils[_0x9b79('0x35')](_0x2d108d[_0x9b79('0x32')]||0x0,_0x2d108d[_0x9b79('0x31')]||0x0);_0x2d108d[_0x9b79('0x3b')]=_0x2d108d[_0x9b79('0x3c')]?utils[_0x9b79('0x35')](_0x2d108d['endtime'],_0x2d108d[_0x9b79('0x3c')]):0x0;};exports[_0x9b79('0x3d')]=function(_0x3f3138){return _0x3f3138===_0x9b79('0x3e');};exports[_0x9b79('0x3f')]=function(_0x32afff,_0x4702ee,_0x431f5e,_0x48625d,_0x3ca0df){var _0x2de7b6=_0x48625d?'RECALL':_0x32afff[_0x9b79('0x40')];_0x2de7b6=_0x3ca0df?_0x9b79('0x41'):_0x2de7b6;return{'actionid':_0x32afff['uniqueid'],'action':'originate','channel':_0x32afff[_0x9b79('0x42')],'callerid':util['format'](_0x9b79('0x13'),_0x2de7b6,_0x32afff[_0x9b79('0x18')]),'Exten':'xcally-motion-preview','Context':_0x9b79('0x43'),'Priority':'1','variable':_0x431f5e,'timeout':(_0x4702ee['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x32afff['uniqueid']};};exports[_0x9b79('0x44')]=function(_0x432f63){return _0x432f63[_0x9b79('0x45')]+_0x432f63[_0x9b79('0x46')]+_0x432f63[_0x9b79('0x47')]+_0x432f63[_0x9b79('0x48')]+_0x432f63['countnosuchnumberretry'];};exports[_0x9b79('0x49')]=function(_0x44b8f8){var _0x5e53b7=_[_0x9b79('0x4a')](_0x44b8f8);_0x5e53b7[_0x9b79('0x3a')]=0xf;_0x5e53b7[_0x9b79('0x2f')]='Global';return _0x5e53b7;};exports[_0x9b79('0x4b')]=function(_0x5747e4,_0x4ff603,_0x32340e){var _0x1f4961={};_0x1f4961[_0x4ff603]=_0x5747e4[_0x4ff603];_0x1f4961[_0x9b79('0x4c')]=![];_0x1f4961['scheduledat']=moment()[_0x9b79('0x4d')](_0x32340e,_0x9b79('0x4e'))[_0x9b79('0x12')](_0x9b79('0x39'));_0x1f4961['ContactId']=_0x5747e4[_0x9b79('0x19')];_0x1f4961[_0x9b79('0x4f')]=_0x5747e4[_0x9b79('0x4f')];_0x1f4961['VoiceQueueId']=_0x5747e4['VoiceQueueId']||undefined;return _0x1f4961;};exports[_0x9b79('0x50')]=function(_0x2f9ded,_0x4152b3){if(!_[_0x9b79('0x15')](_0x2f9ded)){if(_0x2f9ded[_0x9b79('0x51')]>0x0){_0x2f9ded[_0x9b79('0x51')]-=0x1;}else{logger[_0x9b79('0x8')](_0x4152b3,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x9b79('0x8')](_0x4152b3,_0x9b79('0x52'));}};exports['IsNotLoggedIn']=function(_0x23c774){if(_0x23c774<=0x0){return!![];}return![];};function buildObj(_0x352a00,_0x457e40,_0x518924){_0x352a00[_0x9b79('0x53')]=_0x457e40;_0x352a00['name']=_0x352a00[_0x9b79('0x54')];_0x352a00['interface']=_0x352a00['channelAgent'];_0x352a00[_0x9b79('0x55')]=_0x9b79('0x56');if(_0x518924){_0x352a00[_0x9b79('0x57')]=_0x518924['mandatoryDisposition'];}return _0x352a00;}exports['buildObj']=buildObj;exports[_0x9b79('0x58')]=function(_0x3017ac){var _0x41fe9d=[];for(var _0x320526 in _0x3017ac){if(_0x3017ac[_0x9b79('0x28')](_0x320526)){if(!_[_0x9b79('0x15')](_0x3017ac[_0x320526])&&_0x3017ac[_0x320526][_0x9b79('0x3a')]===_0x9b79('0x59')&&_0x3017ac[_0x320526][_0x9b79('0x5a')]==='reachable'){_0x41fe9d[_0x9b79('0x5b')](_0x3017ac[_0x320526]['id']);}}}return _0x41fe9d;};exports[_0x9b79('0x5c')]=function(_0x27055c){var _0x5bc745=moment()[_0x9b79('0x5d')](0x0);var _0x1d4614=moment(_0x27055c)['milliseconds'](0x0);return _0x5bc745[_0x9b79('0x5e')](_0x1d4614,_0x9b79('0x5f'));};exports['createBody']=function(_0x201479){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x201479['ContactId'],'ListId':_0x201479[_0x9b79('0x4f')],'VoiceQueueId':_0x201479[_0x9b79('0x1b')]||undefined,'CampaignId':_0x201479[_0x9b79('0x60')]||undefined};};exports[_0x9b79('0x61')]=function(_0x4a6251){if(_0x4a6251==='uniqueid'||_0x4a6251==='idContact'||_0x4a6251===_0x9b79('0x54')||_0x4a6251==='type'||_0x4a6251===_0x9b79('0x62')||_0x4a6251===_0x9b79('0x63')||_0x4a6251===_0x9b79('0x37')||_0x4a6251===_0x9b79('0x42')||_0x4a6251==='calleridname'||_0x4a6251==='active'||_0x4a6251==='calleridnum'||_0x4a6251===_0x9b79('0x64')||_0x4a6251===_0x9b79('0x45')||_0x4a6251===_0x9b79('0x46')||_0x4a6251===_0x9b79('0x47')||_0x4a6251==='countglobal'||_0x4a6251===_0x9b79('0x65')||_0x4a6251===_0x9b79('0x66')||_0x4a6251===_0x9b79('0x67')||_0x4a6251==='recallme'||_0x4a6251===_0x9b79('0x19')||_0x4a6251===_0x9b79('0x4f')||_0x4a6251===_0x9b79('0x68')||_0x4a6251===_0x9b79('0x1b')||_0x4a6251==='sipcallid'||_0x4a6251===_0x9b79('0x69')||_0x4a6251===_0x9b79('0x6a')||_0x4a6251===_0x9b79('0x6b')||_0x4a6251==='xmd-listid'||_0x4a6251==='xmd-dialurl'||_0x4a6251===_0x9b79('0x6c')||_0x4a6251===_0x9b79('0x6d')||_0x4a6251===_0x9b79('0x6e')||_0x4a6251===_0x9b79('0x6f')||_0x4a6251==='xmd-contactid'||_0x4a6251===_0x9b79('0x70')||_0x4a6251==='xmd-callerid'||_0x4a6251===_0x9b79('0x71')||_0x4a6251==='xmd-agi'||_0x4a6251===_0x9b79('0x72')||_0x4a6251===_0x9b79('0x73')||_0x4a6251===_0x9b79('0x74')||_0x4a6251===_0x9b79('0x75')||_0x4a6251===_0x9b79('0x76')||_0x4a6251===_0x9b79('0x77')||_0x4a6251===_0x9b79('0x78')||_0x4a6251===_0x9b79('0x79')||_0x4a6251===_0x9b79('0x72')||_0x4a6251===_0x9b79('0x73')||_0x4a6251===_0x9b79('0x74')||_0x4a6251===_0x9b79('0x75')||_0x4a6251===_0x9b79('0x76')||_0x4a6251===_0x9b79('0x77')||_0x4a6251===_0x9b79('0x78')||_0x4a6251===_0x9b79('0x79')||_0x4a6251==='bridgepeer'||_0x4a6251==='bridgepvtcallid'||_0x4a6251==='state'||_0x4a6251==='statedesc'){return![];}return!![];};exports[_0x9b79('0x7a')]=function(_0x528306,_0x4674b2){var _0x3bd496,_0x1b350b,_0x5a025c;if(_0x4674b2<=0x0){_0x4674b2=0x1;}_0x3bd496=new RegExp(_0x9b79('0x7b')+_0x4674b2+'}$');_0x1b350b=Math['pow'](0xa,_0x4674b2-0x1);_0x5a025c=Math[_0x9b79('0x7c')](0xa,_0x4674b2)-0x1;return util[_0x9b79('0x12')]('%s',_[_0x9b79('0x7d')](_0x528306,_0x3bd496,_[_0x9b79('0x7e')](_0x1b350b,_0x5a025c)));};exports[_0x9b79('0x7f')]=function(_0x5bcde8){var _0x2034f3=_0x5bcde8[_0x9b79('0x80')](/"(.*?)"/);return _0x2034f3?_0x2034f3[0x1]:_0x5bcde8;};exports[_0x9b79('0x81')]=function(_0x5f5c03){var _0x4493d3=_0x5f5c03[_0x9b79('0x80')](/<(.*?)>/);return _0x4493d3?_0x4493d3[0x1]:_0x5f5c03;};function buildNoAnswerEventPayload(_0x43d789,_0xbf388f){var _0x448925=buildObj(_0x43d789,_0x9b79('0x82'));if(!_[_0x9b79('0x14')](_0xbf388f['variables'])){Object[_0x9b79('0x83')](_0xbf388f[_0x9b79('0x84')])[_0x9b79('0x85')](function(_0x592cc5){_0x448925[_0x592cc5[_0x9b79('0x86')]()]=_0xbf388f['variables'][_0x592cc5];});}return _0x448925;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0x6cb8=['VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','name','motionChannel','voice','mandatoryDisposition','not_inuse','status','reachable','push','getDiff','diff','seconds','createBody','CampaignId','filterKey','idContact','queue','campaigntype','countbusyretry','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosloss','bridgepvtcallid','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','variables','keys','forEach','toLowerCase','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','loggerCatch','error','logger','inspect','loggerError','info','string','isEmpty','isUndefined','format','\x22\x22\x20<>','isActive','addVariables','Queue','\x22%s\x22\x20<%s>','calleridname','calleridnum','ContactId','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','toLowerVariables','hasOwnProperty','toLower','updateOriginated','isNil','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','responsetime','endtime','statedesc','ringtime','starttime','logLookAgent','membername','UserId','logCustomer','getSeconds','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','from-sip','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','scheduledAt','active','scheduledat','add','minutes','ListId'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x6cb8,0x1e2));var _0x86cb=function(_0x41856a,_0x54b172){_0x41856a=_0x41856a-0x0;var _0x55fd58=_0x6cb8[_0x41856a];return _0x55fd58;};'use strict';var util=require(_0x86cb('0x0'));var _=require(_0x86cb('0x1'));var moment=require(_0x86cb('0x2'));var logger=require(_0x86cb('0x3'))(_0x86cb('0x4'));var ipAgi=process[_0x86cb('0x5')][_0x86cb('0x6')]||_0x86cb('0x7');var utils=require(_0x86cb('0x8'));exports[_0x86cb('0x9')]=function(_0x300572){return function(_0x1d66ca){logger[_0x86cb('0xa')](_0x300572,util['inspect'](_0x1d66ca,{'showHidden':![],'depth':null}));};};exports[_0x86cb('0xb')]=function(_0x3f1d11,_0x22fd75){logger['info'](_0x3f1d11,util[_0x86cb('0xc')](_0x22fd75,{'showHidden':![],'depth':null}));};exports[_0x86cb('0xd')]=function(_0x4f3f5b,_0x3c454a){logger[_0x86cb('0xa')](_0x4f3f5b,util['inspect'](_0x3c454a,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x260dfb){return function(_0x49bbd2){logger[_0x86cb('0xe')](_0x260dfb,util[_0x86cb('0xc')](_0x49bbd2,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x3cc857,_0x4b7e76,_0x392cf0){return{'message':_0x3cc857,'unlock':_0x4b7e76,'active':_0x392cf0};};exports['getCallerId']=function(_0x29a7dd,_0x4d2fc7,_0x4c7e19){if(!_['isUndefined'](_0x4c7e19)&&_0x86cb('0xf')===typeof _0x4c7e19&&!_[_0x86cb('0x10')](_0x4c7e19)){if(!_[_0x86cb('0x11')](_0x4d2fc7)&&_0x86cb('0xf')===typeof _0x4d2fc7&&!_['isEmpty'](_0x4d2fc7)){return util[_0x86cb('0x12')]('\x22%s\x22\x20<%s>',_0x4d2fc7,_0x4c7e19);}return util[_0x86cb('0x12')]('\x22%s\x22\x20<%s>',_0x4c7e19,_0x4c7e19);}if(!_[_0x86cb('0x11')](_0x29a7dd)&&_0x86cb('0xf')===typeof _0x29a7dd&&!_[_0x86cb('0x10')](_0x29a7dd)){return _0x29a7dd;}return _0x86cb('0x13');};exports[_0x86cb('0x14')]=function(_0x46e3a7){if(_['isNil'](_0x46e3a7)){return![];}return _0x46e3a7;};exports[_0x86cb('0x15')]=function(_0x565c16,_0x46a7b5,_0x581dac,_0x31d8d7,_0xa47812,_0x25cfae){var _0x25e44f={'XMD-QUEUE':_0x46a7b5[_0x86cb('0x16')]?_0x46a7b5[_0x86cb('0x16')]['name']:'','XMD-CALLERID':_0x31d8d7,'XMD-CALLERID-PREVIEW':_0x25cfae?util['format'](_0x86cb('0x17'),_0x25cfae[_0x86cb('0x18')],_0x25cfae[_0x86cb('0x19')]):_0x31d8d7,'XMD-DIALID':_0xa47812,'XMD-CONTACTID':_0x46a7b5[_0x86cb('0x1a')],'XMD-CDRTYPE':_0x86cb('0x1b'),'CALLERID(all)':_0x31d8d7,'XMD-VOICEQUEUEID':_0x46a7b5['VoiceQueueId'],'XMD-DIALCHANNEL':_0x581dac,'XMD-DIALTIMEOUT':_0x565c16[_0x86cb('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0x86cb('0x12')](_0x86cb('0x1d'),_0x565c16['dialQueueProject2']?'g':'',_['isEmpty'](_0x565c16[_0x86cb('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x565c16[_0x86cb('0x1f')]||'','XMD-AGI':_0x565c16[_0x86cb('0x20')]?util['format'](_0x86cb('0x21'),ipAgi,_0x565c16['dialQueueProject']):_0x86cb('0x22'),'XMD-AGIAFTER':_0x565c16['dialQueueProject2']?util[_0x86cb('0x12')](_0x86cb('0x21'),ipAgi,_0x565c16[_0x86cb('0x23')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x25cfae?_0x25cfae[_0x86cb('0x24')]:'','XMD-ORIGINATECALLERIDNAME':_0x25cfae?_0x25cfae[_0x86cb('0x25')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0x86cb('0x26')};if(!_[_0x86cb('0x10')](_0x565c16[_0x86cb('0x1e')])){_0x25e44f[util['format']('%s',_0x86cb('0x27'))]=_0x565c16[_0x86cb('0x1e')];_0x25e44f[util[_0x86cb('0x12')]('%s',_0x86cb('0x28'))]=_0xa47812;}return _0x25e44f;};exports[_0x86cb('0x29')]=function(_0x330feb){var _0x26e2f9={};for(var _0x3b5c79 in _0x330feb){if(_0x330feb[_0x86cb('0x2a')](_0x3b5c79)){_0x26e2f9[util['format']('%s',_[_0x86cb('0x2b')](_0x3b5c79))]=_0x330feb[_0x3b5c79];}}return{'variables':_0x26e2f9};};exports[_0x86cb('0x2c')]=function(_0x562e1a,_0x5de6c2){if(!_[_0x86cb('0x2d')](_0x562e1a)){if(_0x562e1a[_0x86cb('0x2a')](_0x86cb('0x2e'))){if(_0x562e1a[_0x86cb('0x2e')]>0x0){_0x562e1a[_0x86cb('0x2e')]-=0x1;}else{logger[_0x86cb('0xa')](_0x86cb('0x2f'),_0x5de6c2);}}}else{logger[_0x86cb('0xa')](_0x86cb('0x30'),_0x5de6c2);}};exports[_0x86cb('0x31')]=function(_0x745b19){var _0xa73ed9=moment()['format'](_0x86cb('0x32'));_0x745b19[_0x86cb('0x33')]=0xd;_0x745b19['statedesc']=_0x86cb('0x34');_0x745b19['starttime']=_0xa73ed9;_0x745b19[_0x86cb('0x35')]=_0xa73ed9;_0x745b19[_0x86cb('0x36')]=_0xa73ed9;};exports['logAgent']=function(_0x42013a,_0x2657a3,_0x4fd40d){var _0x36fee1=moment()[_0x86cb('0x12')](_0x86cb('0x32'));_0x42013a['state']=_0x2657a3;_0x42013a[_0x86cb('0x37')]=_0x4fd40d;_0x42013a[_0x86cb('0x35')]=_0x36fee1;_0x42013a[_0x86cb('0x38')]=utils['getSeconds'](_0x42013a['responsetime'],_0x42013a[_0x86cb('0x39')]);};exports[_0x86cb('0x3a')]=function(_0x11cc16,_0x550741,_0x55fb38){_0x11cc16[_0x86cb('0x3b')]=_0x550741;_0x11cc16[_0x86cb('0x3c')]=_0x55fb38;};exports[_0x86cb('0x3d')]=function(_0x1f3d07,_0x29966a,_0x56e941){var _0x1427da=moment()['format'](_0x86cb('0x32'));_0x1f3d07[_0x86cb('0x33')]=_0x29966a;_0x1f3d07['statedesc']=_0x56e941;_0x1f3d07[_0x86cb('0x35')]=_0x1f3d07['responsetime']?_0x1f3d07[_0x86cb('0x35')]:_0x1427da;_0x1f3d07['endtime']=_0x1f3d07['endtime']?_0x1f3d07[_0x86cb('0x36')]:_0x1427da;_0x1f3d07[_0x86cb('0x38')]=utils[_0x86cb('0x3e')](_0x1f3d07[_0x86cb('0x35')]||0x0,_0x1f3d07['starttime']||0x0);_0x1f3d07[_0x86cb('0x3f')]=_0x1f3d07[_0x86cb('0x40')]?utils['getSeconds'](_0x1f3d07[_0x86cb('0x36')],_0x1f3d07[_0x86cb('0x40')]):0x0;};exports['isFailure']=function(_0x39b79f){return _0x39b79f===_0x86cb('0x41');};exports[_0x86cb('0x42')]=function(_0xdee206,_0x283ab5,_0x3993d2,_0x45c1f4,_0x4b606c){var _0xfa5c87=_0x45c1f4?_0x86cb('0x43'):_0xdee206[_0x86cb('0x18')];_0xfa5c87=_0x4b606c?_0x86cb('0x44'):_0xfa5c87;return{'actionid':_0xdee206[_0x86cb('0x45')],'action':_0x86cb('0x46'),'channel':_0xdee206[_0x86cb('0x47')],'callerid':util[_0x86cb('0x12')]('\x22%s\x22\x20<%s>',_0xfa5c87,_0xdee206[_0x86cb('0x19')]),'Exten':_0x86cb('0x48'),'Context':_0x86cb('0x49'),'Priority':'1','variable':_0x3993d2,'timeout':(_0x283ab5[_0x86cb('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0xdee206[_0x86cb('0x45')]};};exports['totalGlobal']=function(_0x4adcc2){return _0x4adcc2['countbusyretry']+_0x4adcc2[_0x86cb('0x4b')]+_0x4adcc2[_0x86cb('0x4c')]+_0x4adcc2[_0x86cb('0x4d')]+_0x4adcc2['countnosuchnumberretry'];};exports[_0x86cb('0x4e')]=function(_0x530920){var _0x5c5f95=_[_0x86cb('0x4f')](_0x530920);_0x5c5f95[_0x86cb('0x33')]=0xf;_0x5c5f95[_0x86cb('0x37')]='Global';return _0x5c5f95;};exports[_0x86cb('0x50')]=function(_0x3d4e30,_0x3b3dbf,_0x648dbb){var _0x1e7642={};_0x1e7642[_0x3b3dbf]=_0x3d4e30[_0x3b3dbf];_0x1e7642[_0x86cb('0x51')]=![];_0x1e7642[_0x86cb('0x52')]=moment()[_0x86cb('0x53')](_0x648dbb,_0x86cb('0x54'))['format'](_0x86cb('0x32'));_0x1e7642[_0x86cb('0x1a')]=_0x3d4e30[_0x86cb('0x1a')];_0x1e7642[_0x86cb('0x55')]=_0x3d4e30['ListId'];_0x1e7642[_0x86cb('0x56')]=_0x3d4e30[_0x86cb('0x56')]||undefined;return _0x1e7642;};exports[_0x86cb('0x57')]=function(_0x28b555,_0x5aab82){if(!_[_0x86cb('0x2d')](_0x28b555)){if(_0x28b555['pTalking']>0x0){_0x28b555[_0x86cb('0x58')]-=0x1;}else{logger[_0x86cb('0xa')](_0x5aab82,_0x86cb('0x59'));}}else{logger[_0x86cb('0xa')](_0x5aab82,_0x86cb('0x5a'));}};exports[_0x86cb('0x5b')]=function(_0x3e7a00){if(_0x3e7a00<=0x0){return!![];}return![];};function buildObj(_0x1a96d7,_0x817f90,_0x28b675){_0x1a96d7['lastevent']=_0x817f90;_0x1a96d7[_0x86cb('0x5c')]=_0x1a96d7['queue'];_0x1a96d7['interface']=_0x1a96d7[_0x86cb('0x47')];_0x1a96d7[_0x86cb('0x5d')]=_0x86cb('0x5e');if(_0x28b675){_0x1a96d7['mandatoryDisposition']=_0x28b675[_0x86cb('0x5f')];}return _0x1a96d7;}exports['buildObj']=buildObj;exports['agentReadyId']=function(_0x24eb49){var _0x314782=[];for(var _0x5cd7ff in _0x24eb49){if(_0x24eb49['hasOwnProperty'](_0x5cd7ff)){if(!_[_0x86cb('0x2d')](_0x24eb49[_0x5cd7ff])&&_0x24eb49[_0x5cd7ff]['state']===_0x86cb('0x60')&&_0x24eb49[_0x5cd7ff][_0x86cb('0x61')]===_0x86cb('0x62')){_0x314782[_0x86cb('0x63')](_0x24eb49[_0x5cd7ff]['id']);}}}return _0x314782;};exports[_0x86cb('0x64')]=function(_0x4cce5d){var _0x3c5c33=moment()['milliseconds'](0x0);var _0x1d5f9f=moment(_0x4cce5d)['milliseconds'](0x0);return _0x3c5c33[_0x86cb('0x65')](_0x1d5f9f,_0x86cb('0x66'));};exports[_0x86cb('0x67')]=function(_0xabbf54){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xabbf54[_0x86cb('0x1a')],'ListId':_0xabbf54[_0x86cb('0x55')],'VoiceQueueId':_0xabbf54['VoiceQueueId']||undefined,'CampaignId':_0xabbf54[_0x86cb('0x68')]||undefined};};exports[_0x86cb('0x69')]=function(_0x3fe616){if(_0x3fe616===_0x86cb('0x45')||_0x3fe616===_0x86cb('0x6a')||_0x3fe616===_0x86cb('0x6b')||_0x3fe616==='type'||_0x3fe616===_0x86cb('0x6c')||_0x3fe616==='dialAnswer'||_0x3fe616==='membername'||_0x3fe616==='channelAgent'||_0x3fe616===_0x86cb('0x18')||_0x3fe616===_0x86cb('0x51')||_0x3fe616==='calleridnum'||_0x3fe616==='scheduledat'||_0x3fe616===_0x86cb('0x6d')||_0x3fe616===_0x86cb('0x4b')||_0x3fe616==='countnoanswerretry'||_0x3fe616===_0x86cb('0x6e')||_0x3fe616===_0x86cb('0x6f')||_0x3fe616===_0x86cb('0x70')||_0x3fe616===_0x86cb('0x71')||_0x3fe616==='recallme'||_0x3fe616===_0x86cb('0x1a')||_0x3fe616==='ListId'||_0x3fe616===_0x86cb('0x3c')||_0x3fe616==='VoiceQueueId'||_0x3fe616===_0x86cb('0x72')||_0x3fe616==='xmd-voicequeueid'||_0x3fe616===_0x86cb('0x73')||_0x3fe616===_0x86cb('0x74')||_0x3fe616===_0x86cb('0x75')||_0x3fe616==='xmd-dialurl'||_0x3fe616===_0x86cb('0x76')||_0x3fe616===_0x86cb('0x77')||_0x3fe616==='xmd-dialid'||_0x3fe616===_0x86cb('0x78')||_0x3fe616==='xmd-contactid'||_0x3fe616===_0x86cb('0x79')||_0x3fe616==='xmd-callerid'||_0x3fe616===_0x86cb('0x7a')||_0x3fe616===_0x86cb('0x7b')||_0x3fe616===_0x86cb('0x7c')||_0x3fe616===_0x86cb('0x7d')||_0x3fe616===_0x86cb('0x7e')||_0x3fe616===_0x86cb('0x7f')||_0x3fe616==='rtpaudioqosloss'||_0x3fe616===_0x86cb('0x80')||_0x3fe616==='rtpaudioqosrtt'||_0x3fe616==='rtpaudioqosrttbridged'||_0x3fe616===_0x86cb('0x7c')||_0x3fe616===_0x86cb('0x7d')||_0x3fe616===_0x86cb('0x7e')||_0x3fe616==='rtpaudioqosjitterbridged'||_0x3fe616===_0x86cb('0x81')||_0x3fe616==='rtpaudioqoslossbridged'||_0x3fe616==='rtpaudioqosrtt'||_0x3fe616==='rtpaudioqosrttbridged'||_0x3fe616==='bridgepeer'||_0x3fe616===_0x86cb('0x82')||_0x3fe616==='state'||_0x3fe616===_0x86cb('0x37')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x5d5789,_0x1693d2){var _0x2e1c05,_0x161e7a,_0x43e9f4;if(_0x1693d2<=0x0){_0x1693d2=0x1;}_0x2e1c05=new RegExp(_0x86cb('0x83')+_0x1693d2+'}$');_0x161e7a=Math[_0x86cb('0x84')](0xa,_0x1693d2-0x1);_0x43e9f4=Math[_0x86cb('0x84')](0xa,_0x1693d2)-0x1;return util[_0x86cb('0x12')]('%s',_[_0x86cb('0x85')](_0x5d5789,_0x2e1c05,_[_0x86cb('0x86')](_0x161e7a,_0x43e9f4)));};exports[_0x86cb('0x87')]=function(_0x2c220b){var _0x42d3ba=_0x2c220b[_0x86cb('0x88')](/"(.*?)"/);return _0x42d3ba?_0x42d3ba[0x1]:_0x2c220b;};exports[_0x86cb('0x89')]=function(_0x5355f9){var _0x3772a4=_0x5355f9[_0x86cb('0x88')](/<(.*?)>/);return _0x3772a4?_0x3772a4[0x1]:_0x5355f9;};function buildNoAnswerEventPayload(_0x26ee35,_0x130538){var _0x5c01f1=buildObj(_0x26ee35,'noanswer');if(!_['isEmpty'](_0x130538[_0x86cb('0x8a')])){Object[_0x86cb('0x8b')](_0x130538['variables'])[_0x86cb('0x8c')](function(_0x537a48){_0x5c01f1[_0x537a48[_0x86cb('0x8d')]()]=_0x130538[_0x86cb('0x8a')][_0x537a48];});}return _0x5c01f1;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 0532991..7b1979f 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 _0xd9ce=['queuepause','reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove'];(function(_0x88a170,_0x570911){var _0x171401=function(_0x375835){while(--_0x375835){_0x88a170['push'](_0x88a170['shift']());}};_0x171401(++_0x570911);}(_0xd9ce,0xeb));var _0xed9c=function(_0x3a2269,_0x3ef598){_0x3a2269=_0x3a2269-0x0;var _0x34b10b=_0xd9ce[_0x3a2269];return _0x34b10b;};'use strict';exports[_0xed9c('0x0')]={'queue':{'type':_0xed9c('0x1'),'required':!![]},'interface':{'type':_0xed9c('0x1'),'required':!![]},'membername':{'type':_0xed9c('0x1'),'required':!![]},'penalty':{'type':_0xed9c('0x2'),'required':![]},'paused':{'type':_0xed9c('0x3'),'required':![]}};exports[_0xed9c('0x4')]={'queue':{'type':_0xed9c('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0xed9c('0x5')]={'interface':{'type':_0xed9c('0x1'),'required':!![]},'paused':{'type':_0xed9c('0x3')},'reason':{'type':_0xed9c('0x1'),'required':![]}};exports[_0xed9c('0x6')]={'module':{'type':_0xed9c('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xed9c('0x1'),'required':!![]}};exports[_0xed9c('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0xed9c('0x1')},'mixmonitorid':{'type':'string'}};exports[_0xed9c('0x8')]={'uniqueid':{'type':_0xed9c('0x1'),'required':!![]}};exports[_0xed9c('0x9')]={'uniqueid':{'type':_0xed9c('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':_0xed9c('0x1')}}; \ No newline at end of file +var _0x0236=['number','boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string'];(function(_0x58277a,_0x3509d0){var _0xca9bc3=function(_0x1a2698){while(--_0x1a2698){_0x58277a['push'](_0x58277a['shift']());}};_0xca9bc3(++_0x3509d0);}(_0x0236,0x9f));var _0x6023=function(_0x13e11a,_0xe0fc7){_0x13e11a=_0x13e11a-0x0;var _0xd7f115=_0x0236[_0x13e11a];return _0xd7f115;};'use strict';exports['queueadd']={'queue':{'type':_0x6023('0x0'),'required':!![]},'interface':{'type':_0x6023('0x0'),'required':!![]},'membername':{'type':_0x6023('0x0'),'required':!![]},'penalty':{'type':_0x6023('0x1'),'required':![]},'paused':{'type':_0x6023('0x2'),'required':![]}};exports[_0x6023('0x3')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x6023('0x0'),'required':!![]}};exports[_0x6023('0x4')]={'interface':{'type':_0x6023('0x0'),'required':!![]},'paused':{'type':'boolean'},'reason':{'type':'string','required':![]}};exports[_0x6023('0x5')]={'module':{'type':_0x6023('0x0'),'required':![]}};exports[_0x6023('0x6')]={'uniqueid':{'type':_0x6023('0x0'),'required':!![]}};exports[_0x6023('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0x6023('0x0')},'format':{'type':_0x6023('0x0')},'mixmonitorid':{'type':_0x6023('0x0')}};exports[_0x6023('0x8')]={'uniqueid':{'type':_0x6023('0x0'),'required':!![]}};exports[_0x6023('0x9')]={'uniqueid':{'type':_0x6023('0x0'),'required':!![]},'exten':{'type':_0x6023('0x0'),'required':!![]},'context':{'type':_0x6023('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 5da6438..6f830a6 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 _0xb10b=['../model/voiceExtension','../model/zendeskAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','triggers','campaigns','templates','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','SIP/%s','name','interface','format','total','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','isEmpty','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','length','isNil','isUndefined','initTelephones','trunks','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','initVoiceQueueHopperHistory','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','queuecallercomplete','initVoiceCallReports','outbound','duration','billableseconds','initCampaigns','dialQueueProject','initCampaignHopperHistory','merge','initFaxAccounts','initVoiceQueues','lodash','util','../model/agent','../model/telephone','../model/voiceQueue','../model/trigger','../model/template','../model/campaign'];(function(_0xbcaf81,_0x387277){var _0x4f4e1e=function(_0x3daa06){while(--_0x3daa06){_0xbcaf81['push'](_0xbcaf81['shift']());}};_0x4f4e1e(++_0x387277);}(_0xb10b,0x12a));var _0xbb10=function(_0x329d13,_0x1aff27){_0x329d13=_0x329d13-0x0;var _0x33efd9=_0xb10b[_0x329d13];return _0x33efd9;};'use strict';var _=require(_0xbb10('0x0'));var moment=require('moment');var util=require(_0xbb10('0x1'));var Agent=require(_0xbb10('0x2'));var Telephone=require(_0xbb10('0x3'));var Trunk=require('../model/trunk');var VoiceQueue=require(_0xbb10('0x4'));var Trigger=require(_0xbb10('0x5'));var Template=require(_0xbb10('0x6'));var Campaign=require(_0xbb10('0x7'));var VoiceExtension=require(_0xbb10('0x8'));var ZendeskAccount=require(_0xbb10('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xbb10('0xa'));var SugarcrmAccount=require(_0xbb10('0xb'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0xbb10('0xc'));var VtigerAccount=require(_0xbb10('0xd'));var ServicenowAccount=require(_0xbb10('0xe'));var Dynamics365Account=require(_0xbb10('0xf'));var FreshsalesAccount=require(_0xbb10('0x10'));var FaxAccount=require(_0xbb10('0x11'));function Realtime(){this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['trunks']={};this['voiceQueues']={};this[_0xbb10('0x14')]={};this[_0xbb10('0x15')]={};this[_0xbb10('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xbb10('0x17')]={};this['channels']={};this[_0xbb10('0x18')]={};this[_0xbb10('0x19')]={};this[_0xbb10('0x1a')]={};this[_0xbb10('0x1b')]={};this[_0xbb10('0x1c')]={};this[_0xbb10('0x1d')]={};this['sugarcrmAccounts']={};this[_0xbb10('0x1e')]={};this[_0xbb10('0x1f')]={};this[_0xbb10('0x20')]={};this[_0xbb10('0x21')]={};this[_0xbb10('0x22')]={};this[_0xbb10('0x23')]={};this[_0xbb10('0x24')]={};this[_0xbb10('0x25')]={};}function freeIsNotKey(_0x3e26f4,_0x2b184e,_0x4a2bfc){var _0x2eca0f=_[_0xbb10('0x26')](_0x3e26f4,function(_0x133ac2){return _0x133ac2[_0x4a2bfc];});for(var _0x42db98 in _0x2b184e){if(_0x2b184e[_0xbb10('0x27')](_0x42db98)){if(!_0x2eca0f[_0x42db98]){delete _0x2b184e[_0x42db98];}}}}function freeIsNotKeySip(_0x1682a4,_0x575cca){var _0x30efc6=_[_0xbb10('0x26')](_0x1682a4,function(_0xe1c665){return util['format'](_0xbb10('0x28'),_0xe1c665[_0xbb10('0x29')]);});for(var _0x388fab in _0x575cca){if(_0x575cca[_0xbb10('0x27')](_0x388fab)){if(!_0x30efc6[_0x388fab]){delete _0x575cca[_0x388fab];}}}}function freeIsNotKeyAgent(_0xdf237d,_0x44e563){var _0x4deb49=_[_0xbb10('0x26')](_0xdf237d,function(_0x12ef77){var _0x50aea1=_['isNil'](_0x12ef77[_0xbb10('0x2a')])?util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x12ef77[_0xbb10('0x29')]):_0x12ef77[_0xbb10('0x2a')];return _0x50aea1;});for(var _0x1824b7 in _0x44e563){if(_0x44e563[_0xbb10('0x27')](_0x1824b7)){if(!_0x4deb49[_0x1824b7]){delete _0x44e563[_0x1824b7];}}}}function clearVoiceCallReports(_0x436104){_0x436104[_0xbb10('0x2c')]=0x0;_0x436104[_0xbb10('0x2d')]=0x0;_0x436104[_0xbb10('0x2e')]=0x0;_0x436104[_0xbb10('0x2f')]=0x0;_0x436104['sumBillable']=0x0;}function clearCampaigns(_0x4fedac){if(!_['isEmpty'](_0x4fedac)){for(var _0xc93a04 in _0x4fedac){if(_0x4fedac[_0xbb10('0x27')](_0xc93a04)){_0x4fedac[_0xc93a04][_0xbb10('0x30')]=0x0;_0x4fedac[_0xc93a04]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x2fdde9){if(!_[_0xbb10('0x31')](_0x2fdde9)){for(var _0x6ed43b in _0x2fdde9){if(_0x2fdde9[_0xbb10('0x27')](_0x6ed43b)){_0x2fdde9[_0x6ed43b][_0xbb10('0x2c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2d')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x32')]=0x0;_0x2fdde9[_0x6ed43b]['abandoned']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2e')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x2f')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x33')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x34')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x35')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x36')]=0x0;_0x2fdde9[_0x6ed43b]['outboundCongestionCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x37')]=0x0;_0x2fdde9[_0x6ed43b]['outboundUnknownCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x38')]=0x0;_0x2fdde9[_0x6ed43b]['outboundDropCallsDayCallersExit']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x39')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3a')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3b')]=0x0;_0x2fdde9[_0x6ed43b]['outboundReCallsDay']=0x0;_0x2fdde9[_0x6ed43b]['outboundAnswerAgiCallsDay']=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3c')]=0x0;_0x2fdde9[_0x6ed43b][_0xbb10('0x3d')]=!![];}}}}Realtime['prototype'][_0xbb10('0x3e')]=function(_0x37dde7,_0x2f653f){for(var _0x1c0b57 in _0x2f653f){if(_0x37dde7[_0xbb10('0x27')](_0x1c0b57)){_0x37dde7[_0x1c0b57]=_0x2f653f[_0x1c0b57];}}};Realtime[_0xbb10('0x3f')][_0xbb10('0x40')]=function(){var _0x4975f5=this;return function(_0x25acb3){if(_0x25acb3){freeIsNotKeyAgent(_0x25acb3,_0x4975f5[_0xbb10('0x12')]);for(var _0x441d15=0x0,_0x8c1ce6={};_0x441d15<_0x25acb3[_0xbb10('0x41')];_0x441d15+=0x1){_0x8c1ce6=_0x25acb3[_0x441d15];var _0x9de708=_[_0xbb10('0x42')](_0x8c1ce6[_0xbb10('0x2a')])?util[_0xbb10('0x2b')]('SIP/%s',_0x8c1ce6[_0xbb10('0x29')]):_0x8c1ce6[_0xbb10('0x2a')];if(_[_0xbb10('0x43')](_0x4975f5[_0xbb10('0x12')][_0x9de708])){_0x4975f5['agents'][_0x9de708]=new Agent(_0x8c1ce6);}else{_0x4975f5[_0xbb10('0x3e')](_0x4975f5['agents'][_0x9de708],_0x8c1ce6);}}}return _0x4975f5['agents'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x44')]=function(){var _0x26e76a=this;return function(_0x120d21){if(_0x120d21){freeIsNotKeySip(_0x120d21,_0x26e76a[_0xbb10('0x13')]);for(var _0x29d11a=0x0,_0x547062={};_0x29d11a<_0x120d21[_0xbb10('0x41')];_0x29d11a+=0x1){_0x547062=_0x120d21[_0x29d11a];if(_[_0xbb10('0x43')](_0x26e76a['telephones'][util['format']('SIP/%s',_0x547062[_0xbb10('0x29')])])){_0x26e76a[_0xbb10('0x13')][util[_0xbb10('0x2b')]('SIP/%s',_0x547062[_0xbb10('0x29')])]=new Telephone(_0x547062);}else{_0x26e76a[_0xbb10('0x3e')](_0x26e76a[_0xbb10('0x13')][util['format'](_0xbb10('0x28'),_0x547062[_0xbb10('0x29')])],_0x547062);}}}return _0x26e76a[_0xbb10('0x13')];};};Realtime[_0xbb10('0x3f')]['initTrunks']=function(){var _0xd238e9=this;return function(_0x110eb5){if(_0x110eb5){freeIsNotKeySip(_0x110eb5,_0xd238e9['trunks']);for(var _0xe2040f=0x0,_0x2e3214={};_0xe2040f<_0x110eb5[_0xbb10('0x41')];_0xe2040f+=0x1){_0x2e3214=_0x110eb5[_0xe2040f];if(_[_0xbb10('0x43')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')]('SIP/%s',_0x2e3214[_0xbb10('0x29')])])){_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])]=new Trunk(_0x2e3214);}else{_0xd238e9[_0xbb10('0x3e')](_0xd238e9[_0xbb10('0x45')][util[_0xbb10('0x2b')](_0xbb10('0x28'),_0x2e3214['name'])],_0x2e3214);}}}return _0xd238e9[_0xbb10('0x45')];};};Realtime[_0xbb10('0x3f')]['initTriggers']=function(){var _0x5d9a4f=this;return function(_0x38d78f){if(_0x38d78f){freeIsNotKey(_0x38d78f,_0x5d9a4f['triggers'],'id');for(var _0x318984=0x0,_0x180933={};_0x318984<_0x38d78f['length'];_0x318984+=0x1){_0x180933=_0x38d78f[_0x318984];if(_[_0xbb10('0x43')](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']])){_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']]=new Trigger(_0x180933);}else{_0x5d9a4f['mergeFromDatabase'](_0x5d9a4f[_0xbb10('0x14')][_0x180933['id']],_0x180933);}}}return _0x5d9a4f[_0xbb10('0x14')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x46')]=function(){var _0x36e1fa=this;return function(_0x19f94d){if(_0x19f94d){freeIsNotKey(_0x19f94d,_0x36e1fa[_0xbb10('0x16')],'id');for(var _0x3efa96=0x0,_0x205bb4={};_0x3efa96<_0x19f94d[_0xbb10('0x41')];_0x3efa96+=0x1){_0x205bb4=_0x19f94d[_0x3efa96];if(_[_0xbb10('0x43')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']])){_0x36e1fa['templates'][_0x205bb4['id']]=new Template(_0x205bb4);}else{_0x36e1fa[_0xbb10('0x3e')](_0x36e1fa[_0xbb10('0x16')][_0x205bb4['id']],_0x205bb4);}}}return _0x36e1fa['templates'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x47')]=function(){var _0x1a7df6=this;return function(_0x5a5226){if(_0x5a5226){freeIsNotKey(_0x5a5226,_0x1a7df6[_0xbb10('0x1c')],'id');for(var _0x39f0de=0x0,_0x3e06b0={};_0x39f0de<_0x5a5226['length'];_0x39f0de+=0x1){_0x3e06b0=_0x5a5226[_0x39f0de];if(_['isUndefined'](_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']])){_0x1a7df6[_0xbb10('0x1c')][_0x3e06b0['id']]=new ZendeskAccount(_0x3e06b0);}else{_0x1a7df6[_0xbb10('0x3e')](_0x1a7df6['zendeskAccounts'][_0x3e06b0['id']],_0x3e06b0);}}}return _0x1a7df6['zendeskAccounts'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x48')]=function(){var _0x1bd054=this;return function(_0xf820fe){if(_0xf820fe){freeIsNotKey(_0xf820fe,_0x1bd054[_0xbb10('0x1d')],'id');for(var _0x22b315=0x0,_0x2f2552={};_0x22b315<_0xf820fe[_0xbb10('0x41')];_0x22b315+=0x1){_0x2f2552=_0xf820fe[_0x22b315];if(_[_0xbb10('0x43')](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']])){_0x1bd054['salesforceAccounts'][_0x2f2552['id']]=new SalesforceAccount(_0x2f2552);}else{_0x1bd054['mergeFromDatabase'](_0x1bd054[_0xbb10('0x1d')][_0x2f2552['id']],_0x2f2552);}}}return _0x1bd054[_0xbb10('0x1d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x49')]=function(){var _0x36aa7d=this;return function(_0x440f9e){if(_0x440f9e){freeIsNotKey(_0x440f9e,_0x36aa7d[_0xbb10('0x1e')],'id');for(var _0x445870=0x0,_0x1c0d8f={};_0x445870<_0x440f9e[_0xbb10('0x41')];_0x445870+=0x1){_0x1c0d8f=_0x440f9e[_0x445870];if(_[_0xbb10('0x43')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']])){_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']]=new FreshdeskAccount(_0x1c0d8f);}else{_0x36aa7d[_0xbb10('0x3e')](_0x36aa7d[_0xbb10('0x1e')][_0x1c0d8f['id']],_0x1c0d8f);}}}return _0x36aa7d['freshdeskAccounts'];};};Realtime[_0xbb10('0x3f')]['initZohoAccounts']=function(){var _0x33d60a=this;return function(_0x2e21a0){if(_0x2e21a0){freeIsNotKey(_0x2e21a0,_0x33d60a[_0xbb10('0x1f')],'id');for(var _0x3f27ce=0x0,_0x26e66e={};_0x3f27ce<_0x2e21a0[_0xbb10('0x41')];_0x3f27ce+=0x1){_0x26e66e=_0x2e21a0[_0x3f27ce];if(_[_0xbb10('0x43')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']])){_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']]=new ZohoAccount(_0x26e66e);}else{_0x33d60a[_0xbb10('0x3e')](_0x33d60a[_0xbb10('0x1f')][_0x26e66e['id']],_0x26e66e);}}}return _0x33d60a[_0xbb10('0x1f')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4a')]=function(){var _0x4475e1=this;return function(_0x5de0cc){if(_0x5de0cc){freeIsNotKey(_0x5de0cc,_0x4475e1[_0xbb10('0x20')],'id');for(var _0x466eb7=0x0,_0x1b83a9={};_0x466eb7<_0x5de0cc[_0xbb10('0x41')];_0x466eb7+=0x1){_0x1b83a9=_0x5de0cc[_0x466eb7];if(_[_0xbb10('0x43')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']])){_0x4475e1['deskAccounts'][_0x1b83a9['id']]=new DeskAccount(_0x1b83a9);}else{_0x4475e1[_0xbb10('0x3e')](_0x4475e1[_0xbb10('0x20')][_0x1b83a9['id']],_0x1b83a9);}}}return _0x4475e1[_0xbb10('0x20')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4b')]=function(){var _0x22de7f=this;return function(_0x175872){if(_0x175872){freeIsNotKey(_0x175872,_0x22de7f[_0xbb10('0x4c')],'id');for(var _0x205e01=0x0,_0x40c4fb={};_0x205e01<_0x175872[_0xbb10('0x41')];_0x205e01+=0x1){_0x40c4fb=_0x175872[_0x205e01];if(_[_0xbb10('0x43')](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']])){_0x22de7f['sugarcrmAccounts'][_0x40c4fb['id']]=new SugarcrmAccount(_0x40c4fb);}else{_0x22de7f['mergeFromDatabase'](_0x22de7f[_0xbb10('0x4c')][_0x40c4fb['id']],_0x40c4fb);}}}return _0x22de7f[_0xbb10('0x4c')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4d')]=function(){var _0x5573bb=this;return function(_0x506498){if(_0x506498){freeIsNotKey(_0x506498,_0x5573bb[_0xbb10('0x21')],'id');for(var _0xaf2cc3=0x0,_0x410bef={};_0xaf2cc3<_0x506498[_0xbb10('0x41')];_0xaf2cc3+=0x1){_0x410bef=_0x506498[_0xaf2cc3];if(_[_0xbb10('0x43')](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']])){_0x5573bb[_0xbb10('0x21')][_0x410bef['id']]=new VtigerAccount(_0x410bef);}else{_0x5573bb['mergeFromDatabase'](_0x5573bb[_0xbb10('0x21')][_0x410bef['id']],_0x410bef);}}}return _0x5573bb[_0xbb10('0x21')];};};Realtime['prototype']['initServicenowAccounts']=function(){var _0x5a231f=this;return function(_0x32c1e8){if(_0x32c1e8){freeIsNotKey(_0x32c1e8,_0x5a231f[_0xbb10('0x22')],'id');for(var _0x155dc5=0x0,_0x5bd1c0={};_0x155dc5<_0x32c1e8['length'];_0x155dc5+=0x1){_0x5bd1c0=_0x32c1e8[_0x155dc5];if(_['isUndefined'](_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']])){_0x5a231f[_0xbb10('0x22')][_0x5bd1c0['id']]=new ServicenowAccount(_0x5bd1c0);}else{_0x5a231f[_0xbb10('0x3e')](_0x5a231f['servicenowAccounts'][_0x5bd1c0['id']],_0x5bd1c0);}}}return _0x5a231f[_0xbb10('0x22')];};};Realtime[_0xbb10('0x3f')]['initDynamics365Accounts']=function(){var _0x4a560c=this;return function(_0x27d7b9){if(_0x27d7b9){freeIsNotKey(_0x27d7b9,_0x4a560c[_0xbb10('0x23')],'id');for(var _0xd77753=0x0,_0x237246={};_0xd77753<_0x27d7b9['length'];_0xd77753+=0x1){_0x237246=_0x27d7b9[_0xd77753];if(_[_0xbb10('0x43')](_0x4a560c[_0xbb10('0x23')][_0x237246['id']])){_0x4a560c[_0xbb10('0x23')][_0x237246['id']]=new Dynamics365Account(_0x237246);}else{_0x4a560c['mergeFromDatabase'](_0x4a560c[_0xbb10('0x23')][_0x237246['id']],_0x237246);}}}return _0x4a560c[_0xbb10('0x23')];};};Realtime[_0xbb10('0x3f')]['initFreshsalesAccounts']=function(){var _0x2ca491=this;return function(_0x31e85e){if(_0x31e85e){freeIsNotKey(_0x31e85e,_0x2ca491[_0xbb10('0x24')],'id');for(var _0x37b65f=0x0,_0x5e4a6e={};_0x37b65f<_0x31e85e[_0xbb10('0x41')];_0x37b65f+=0x1){_0x5e4a6e=_0x31e85e[_0x37b65f];if(_[_0xbb10('0x43')](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']])){_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']]=new FreshsalesAccount(_0x5e4a6e);}else{_0x2ca491['mergeFromDatabase'](_0x2ca491[_0xbb10('0x24')][_0x5e4a6e['id']],_0x5e4a6e);}}}return _0x2ca491[_0xbb10('0x24')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x4e')]=function(){var _0x12f750=this;return function(_0x17807e){for(var _0x1e4694=0x0;_0x1e4694<_0x17807e['length'];_0x1e4694+=0x1){_['merge'](_0x12f750['voiceQueues'][_0x17807e[_0x1e4694][_0xbb10('0x29')]],_0x17807e[_0x1e4694]);}return _0x12f750[_0xbb10('0x4f')];};};Realtime[_0xbb10('0x3f')]['initVoiceQueueReports']=function(){var _0x5cd089=this;return function(_0x46f462){clearVoiceQueues(_0x5cd089[_0xbb10('0x4f')]);if(_0x46f462){_0x46f462=_[_0xbb10('0x50')](_0x46f462,_0xbb10('0x51'));for(var _0x260e06 in _0x46f462){if(_0x46f462[_0xbb10('0x27')](_0x260e06)){for(var _0x4cf2f3=0x0;_0x4cf2f3<_0x46f462[_0x260e06][_0xbb10('0x41')];_0x4cf2f3+=0x1){var _0x15fae2=_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x52')];if(_0x5cd089[_0xbb10('0x4f')][_0x15fae2]){if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x53')]){_0x5cd089['voiceQueues'][_0x15fae2]['unmanaged']+=0x1;}if(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerabandon']){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x54')]+=0x1;}_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;if(_0x4cf2f3===_0x46f462[_0x260e06]['length']-0x1){_0x5cd089['voiceQueues'][_0x15fae2]['sumDuration']+=moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x58')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x59')]||_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5a')])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallerjoinAt']),_0xbb10('0x57'))||0x0;_0x5cd089['voiceQueues'][_0x15fae2]['total']+=0x1;if(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x5b')]){_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2d')]+=0x1;_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x33')]+=moment(_0x46f462[_0x260e06][_0x4cf2f3]['queuecallercompleteAt'])[_0xbb10('0x56')](moment(_0x46f462[_0x260e06][_0x4cf2f3][_0xbb10('0x55')]),_0xbb10('0x57'))||0x0;}}else{_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2f')]+=_0x5cd089[_0xbb10('0x4f')][_0x15fae2][_0xbb10('0x2e')]||0x0;}}}}}}return _0x5cd089['voiceQueues'];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x5c')]=function(){var _0x30f3ea=this;return function(_0x322b41){clearVoiceCallReports(_0x30f3ea[_0xbb10('0x5d')]);if(_0x322b41){for(var _0x172be3=0x0;_0x172be3<_0x322b41[_0xbb10('0x41')];_0x172be3+=0x1){_0x30f3ea[_0xbb10('0x5d')]['total']+=0x1;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x2f')]+=_0x322b41[_0x172be3][_0xbb10('0x5e')];if(_0x322b41[_0x172be3]['disposition']==='ANSWERED'){_0x30f3ea['outbound'][_0xbb10('0x2d')]+=0x1;_0x30f3ea['outbound']['sumHoldTime']+=_0x322b41[_0x172be3][_0xbb10('0x5e')]-_0x322b41[_0x172be3][_0xbb10('0x5f')]||0x0;_0x30f3ea[_0xbb10('0x5d')][_0xbb10('0x33')]+=_0x322b41[_0x172be3][_0xbb10('0x5f')];}}}return _0x30f3ea[_0xbb10('0x5d')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x60')]=function(){var _0x188b97=this;return function(_0x5206e1){if(_0x5206e1){freeIsNotKey(_0x5206e1,_0x188b97[_0xbb10('0x15')],_0xbb10('0x29'));for(var _0x46b6d2=0x0,_0x35b811={};_0x46b6d2<_0x5206e1['length'];_0x46b6d2+=0x1){_0x35b811=_0x5206e1[_0x46b6d2];if(_['isUndefined'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]])){_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]]=new Campaign(_0x35b811);}else{_0x188b97['mergeFromDatabase'](_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]],_0x35b811);_0x188b97[_0xbb10('0x15')][_0x35b811[_0xbb10('0x29')]][_0xbb10('0x61')]=_0x35b811['SquareProject']?_0x35b811['SquareProject'][_0xbb10('0x29')]:undefined;}}}return _0x188b97[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')]['initVoiceExtensions']=function(){var _0x256b35=this;return function(_0x13e2ab){if(_0x13e2ab){freeIsNotKey(_0x13e2ab,_0x256b35['voiceExtensions'],'id');for(var _0x5caa06=0x0,_0x2f667f={};_0x5caa06<_0x13e2ab[_0xbb10('0x41')];_0x5caa06+=0x1){_0x2f667f=_0x13e2ab[_0x5caa06];if(_[_0xbb10('0x43')](_0x256b35['voiceExtensions'][_0x2f667f['id']])){_0x256b35[_0xbb10('0x17')][_0x2f667f['id']]=new VoiceExtension(_0x2f667f);}else{_0x256b35[_0xbb10('0x3e')](_0x256b35[_0xbb10('0x17')][_0x2f667f['id']],_0x2f667f);}}}return _0x256b35[_0xbb10('0x17')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x62')]=function(){var _0x45bd4e=this;return function(_0x226363){clearCampaigns(_0x45bd4e[_0xbb10('0x15')]);for(var _0x479d51=0x0;_0x479d51<_0x226363[_0xbb10('0x41')];_0x479d51+=0x1){_[_0xbb10('0x63')](_0x45bd4e[_0xbb10('0x15')][_0x226363[_0x479d51][_0xbb10('0x29')]],_0x226363[_0x479d51]);}return _0x45bd4e[_0xbb10('0x15')];};};Realtime[_0xbb10('0x3f')][_0xbb10('0x64')]=function(){var _0x305d52=this;return function(_0x17ed20){if(_0x17ed20){freeIsNotKey(_0x17ed20,_0x305d52[_0xbb10('0x25')],'id');for(var _0x15e043=0x0,_0x2a4278={};_0x15e043<_0x17ed20['length'];_0x15e043+=0x1){_0x2a4278=_0x17ed20[_0x15e043];if(_['isUndefined'](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']])){_0x305d52[_0xbb10('0x25')][_0x2a4278['id']]=new FaxAccount(_0x2a4278);}else{_0x305d52[_0xbb10('0x3e')](_0x305d52[_0xbb10('0x25')][_0x2a4278['id']],_0x2a4278);}}}return _0x305d52[_0xbb10('0x25')];};};Realtime['prototype'][_0xbb10('0x65')]=function(){var _0x332fbe=this;return function(_0x3b4d0b){if(_0x3b4d0b){freeIsNotKey(_0x3b4d0b,_0x332fbe[_0xbb10('0x4f')],_0xbb10('0x29'));for(var _0x379d49=0x0,_0x546db5={};_0x379d49<_0x3b4d0b[_0xbb10('0x41')];_0x379d49+=0x1){_0x546db5=_0x3b4d0b[_0x379d49];if(_[_0xbb10('0x43')](_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]])){_0x332fbe['voiceQueues'][_0x546db5[_0xbb10('0x29')]]=new VoiceQueue(_0x546db5);}else{_0x332fbe[_0xbb10('0x3e')](_0x332fbe[_0xbb10('0x4f')][_0x546db5[_0xbb10('0x29')]],_0x546db5);}}}return _0x332fbe[_0xbb10('0x4f')];};};module['exports']=Realtime; \ No newline at end of file +var _0x0b0e=['total','sumHoldTime','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','initAgents','length','isNil','SIP/%s','isUndefined','prototype','initTelephones','initTrunks','trunks','initTriggers','initTemplates','salesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','queue','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','answered','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','campaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','initVoiceQueues','exports','lodash','util','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','voiceQueues','triggers','templates','outbound','voiceExtensions','queueChannels','outboundChannels','timers','settings','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','name','hasOwnProperty','format','interface'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0x0b0e[_0x13137e];return _0x346261;};'use strict';var _=require(_0xe0b0('0x0'));var moment=require('moment');var util=require(_0xe0b0('0x1'));var Agent=require('../model/agent');var Telephone=require(_0xe0b0('0x2'));var Trunk=require(_0xe0b0('0x3'));var VoiceQueue=require(_0xe0b0('0x4'));var Trigger=require(_0xe0b0('0x5'));var Template=require(_0xe0b0('0x6'));var Campaign=require(_0xe0b0('0x7'));var VoiceExtension=require(_0xe0b0('0x8'));var ZendeskAccount=require(_0xe0b0('0x9'));var SalesforceAccount=require(_0xe0b0('0xa'));var FreshdeskAccount=require(_0xe0b0('0xb'));var SugarcrmAccount=require(_0xe0b0('0xc'));var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xe0b0('0xd'));var ServicenowAccount=require(_0xe0b0('0xe'));var Dynamics365Account=require(_0xe0b0('0xf'));var FreshsalesAccount=require(_0xe0b0('0x10'));var FaxAccount=require('../model/faxAccount');function Realtime(){this[_0xe0b0('0x11')]={};this[_0xe0b0('0x12')]={};this['trunks']={};this[_0xe0b0('0x13')]={};this[_0xe0b0('0x14')]={};this['campaigns']={};this[_0xe0b0('0x15')]={};this[_0xe0b0('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xe0b0('0x17')]={};this['channels']={};this[_0xe0b0('0x18')]={};this[_0xe0b0('0x19')]={};this[_0xe0b0('0x1a')]={};this[_0xe0b0('0x1b')]={};this[_0xe0b0('0x1c')]={};this['salesforceAccounts']={};this[_0xe0b0('0x1d')]={};this[_0xe0b0('0x1e')]={};this[_0xe0b0('0x1f')]={};this[_0xe0b0('0x20')]={};this[_0xe0b0('0x21')]={};this['servicenowAccounts']={};this[_0xe0b0('0x22')]={};this['freshsalesAccounts']={};this[_0xe0b0('0x23')]={};}function freeIsNotKey(_0xadee6e,_0x519ae8,_0x11fdca){var _0x4a4cc0=_[_0xe0b0('0x24')](_0xadee6e,function(_0x100204){return _0x100204[_0x11fdca];});for(var _0x56bcc7 in _0x519ae8){if(_0x519ae8['hasOwnProperty'](_0x56bcc7)){if(!_0x4a4cc0[_0x56bcc7]){delete _0x519ae8[_0x56bcc7];}}}}function freeIsNotKeySip(_0x46bb44,_0x50a441){var _0x4df8da=_['mapKeys'](_0x46bb44,function(_0x1920ee){return util['format']('SIP/%s',_0x1920ee[_0xe0b0('0x25')]);});for(var _0x59dff5 in _0x50a441){if(_0x50a441[_0xe0b0('0x26')](_0x59dff5)){if(!_0x4df8da[_0x59dff5]){delete _0x50a441[_0x59dff5];}}}}function freeIsNotKeyAgent(_0x5dba2f,_0x2c84cc){var _0x1cd7c4=_[_0xe0b0('0x24')](_0x5dba2f,function(_0x310a6d){var _0x2cf6a1=_['isNil'](_0x310a6d['interface'])?util[_0xe0b0('0x27')]('SIP/%s',_0x310a6d[_0xe0b0('0x25')]):_0x310a6d[_0xe0b0('0x28')];return _0x2cf6a1;});for(var _0x513e63 in _0x2c84cc){if(_0x2c84cc[_0xe0b0('0x26')](_0x513e63)){if(!_0x1cd7c4[_0x513e63]){delete _0x2c84cc[_0x513e63];}}}}function clearVoiceCallReports(_0x503883){_0x503883[_0xe0b0('0x29')]=0x0;_0x503883['answered']=0x0;_0x503883[_0xe0b0('0x2a')]=0x0;_0x503883['sumDuration']=0x0;_0x503883[_0xe0b0('0x2b')]=0x0;}function clearCampaigns(_0x4de537){if(!_[_0xe0b0('0x2c')](_0x4de537)){for(var _0x4aafbe in _0x4de537){if(_0x4de537[_0xe0b0('0x26')](_0x4aafbe)){_0x4de537[_0x4aafbe]['ivrTotalCallsDays']=0x0;_0x4de537[_0x4aafbe][_0xe0b0('0x2d')]=0x0;}}}}function clearVoiceQueues(_0x3c3bc2){if(!_[_0xe0b0('0x2c')](_0x3c3bc2)){for(var _0x1d91ad in _0x3c3bc2){if(_0x3c3bc2[_0xe0b0('0x26')](_0x1d91ad)){_0x3c3bc2[_0x1d91ad][_0xe0b0('0x29')]=0x0;_0x3c3bc2[_0x1d91ad]['answered']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2e')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2f')]=0x0;_0x3c3bc2[_0x1d91ad]['sumHoldTime']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x30')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x2b')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x32')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x33')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x34')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x35')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundUnknownCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x36')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x37')]=0x0;_0x3c3bc2[_0x1d91ad]['outboundBlacklistCallsDay']=0x0;_0x3c3bc2[_0x1d91ad]['outboundOriginateFailureCallsDay']=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x38')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x39')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x31')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3a')]=0x0;_0x3c3bc2[_0x1d91ad][_0xe0b0('0x3b')]=!![];}}}}Realtime['prototype'][_0xe0b0('0x3c')]=function(_0x3231fc,_0x7867c4){for(var _0x29d725 in _0x7867c4){if(_0x3231fc[_0xe0b0('0x26')](_0x29d725)){_0x3231fc[_0x29d725]=_0x7867c4[_0x29d725];}}};Realtime['prototype'][_0xe0b0('0x3d')]=function(){var _0x208945=this;return function(_0xfc51d3){if(_0xfc51d3){freeIsNotKeyAgent(_0xfc51d3,_0x208945[_0xe0b0('0x11')]);for(var _0x3575bc=0x0,_0x12eeb8={};_0x3575bc<_0xfc51d3[_0xe0b0('0x3e')];_0x3575bc+=0x1){_0x12eeb8=_0xfc51d3[_0x3575bc];var _0x20908f=_[_0xe0b0('0x3f')](_0x12eeb8[_0xe0b0('0x28')])?util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x12eeb8[_0xe0b0('0x25')]):_0x12eeb8[_0xe0b0('0x28')];if(_[_0xe0b0('0x41')](_0x208945['agents'][_0x20908f])){_0x208945[_0xe0b0('0x11')][_0x20908f]=new Agent(_0x12eeb8);}else{_0x208945[_0xe0b0('0x3c')](_0x208945[_0xe0b0('0x11')][_0x20908f],_0x12eeb8);}}}return _0x208945[_0xe0b0('0x11')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x43')]=function(){var _0x12024d=this;return function(_0x533fc7){if(_0x533fc7){freeIsNotKeySip(_0x533fc7,_0x12024d['telephones']);for(var _0x549d9a=0x0,_0x5317df={};_0x549d9a<_0x533fc7[_0xe0b0('0x3e')];_0x549d9a+=0x1){_0x5317df=_0x533fc7[_0x549d9a];if(_[_0xe0b0('0x41')](_0x12024d[_0xe0b0('0x12')][util['format'](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])])){_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')]('SIP/%s',_0x5317df[_0xe0b0('0x25')])]=new Telephone(_0x5317df);}else{_0x12024d[_0xe0b0('0x3c')](_0x12024d[_0xe0b0('0x12')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x5317df[_0xe0b0('0x25')])],_0x5317df);}}}return _0x12024d[_0xe0b0('0x12')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x44')]=function(){var _0x54f251=this;return function(_0x3e349b){if(_0x3e349b){freeIsNotKeySip(_0x3e349b,_0x54f251['trunks']);for(var _0x34178d=0x0,_0x2d5f47={};_0x34178d<_0x3e349b[_0xe0b0('0x3e')];_0x34178d+=0x1){_0x2d5f47=_0x3e349b[_0x34178d];if(_[_0xe0b0('0x41')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])])){_0x54f251[_0xe0b0('0x45')][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47[_0xe0b0('0x25')])]=new Trunk(_0x2d5f47);}else{_0x54f251[_0xe0b0('0x3c')](_0x54f251['trunks'][util[_0xe0b0('0x27')](_0xe0b0('0x40'),_0x2d5f47['name'])],_0x2d5f47);}}}return _0x54f251['trunks'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x46')]=function(){var _0x56e7df=this;return function(_0x18a59d){if(_0x18a59d){freeIsNotKey(_0x18a59d,_0x56e7df[_0xe0b0('0x14')],'id');for(var _0x6bca5c=0x0,_0x1c869d={};_0x6bca5c<_0x18a59d[_0xe0b0('0x3e')];_0x6bca5c+=0x1){_0x1c869d=_0x18a59d[_0x6bca5c];if(_['isUndefined'](_0x56e7df['triggers'][_0x1c869d['id']])){_0x56e7df['triggers'][_0x1c869d['id']]=new Trigger(_0x1c869d);}else{_0x56e7df[_0xe0b0('0x3c')](_0x56e7df[_0xe0b0('0x14')][_0x1c869d['id']],_0x1c869d);}}}return _0x56e7df['triggers'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x47')]=function(){var _0x14197b=this;return function(_0x5f037d){if(_0x5f037d){freeIsNotKey(_0x5f037d,_0x14197b[_0xe0b0('0x15')],'id');for(var _0x5c6f94=0x0,_0x57d4b0={};_0x5c6f94<_0x5f037d[_0xe0b0('0x3e')];_0x5c6f94+=0x1){_0x57d4b0=_0x5f037d[_0x5c6f94];if(_[_0xe0b0('0x41')](_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']])){_0x14197b[_0xe0b0('0x15')][_0x57d4b0['id']]=new Template(_0x57d4b0);}else{_0x14197b[_0xe0b0('0x3c')](_0x14197b['templates'][_0x57d4b0['id']],_0x57d4b0);}}}return _0x14197b[_0xe0b0('0x15')];};};Realtime[_0xe0b0('0x42')]['initZendeskAccounts']=function(){var _0x50c805=this;return function(_0x5ddad1){if(_0x5ddad1){freeIsNotKey(_0x5ddad1,_0x50c805[_0xe0b0('0x1c')],'id');for(var _0x2184d3=0x0,_0x2419ce={};_0x2184d3<_0x5ddad1[_0xe0b0('0x3e')];_0x2184d3+=0x1){_0x2419ce=_0x5ddad1[_0x2184d3];if(_['isUndefined'](_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']])){_0x50c805[_0xe0b0('0x1c')][_0x2419ce['id']]=new ZendeskAccount(_0x2419ce);}else{_0x50c805['mergeFromDatabase'](_0x50c805['zendeskAccounts'][_0x2419ce['id']],_0x2419ce);}}}return _0x50c805[_0xe0b0('0x1c')];};};Realtime[_0xe0b0('0x42')]['initSalesforceAccounts']=function(){var _0x2b1917=this;return function(_0x27fd31){if(_0x27fd31){freeIsNotKey(_0x27fd31,_0x2b1917['salesforceAccounts'],'id');for(var _0x5cb2b6=0x0,_0x123ad2={};_0x5cb2b6<_0x27fd31['length'];_0x5cb2b6+=0x1){_0x123ad2=_0x27fd31[_0x5cb2b6];if(_[_0xe0b0('0x41')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']])){_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']]=new SalesforceAccount(_0x123ad2);}else{_0x2b1917[_0xe0b0('0x3c')](_0x2b1917[_0xe0b0('0x48')][_0x123ad2['id']],_0x123ad2);}}}return _0x2b1917[_0xe0b0('0x48')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x2ef908=this;return function(_0x5d380a){if(_0x5d380a){freeIsNotKey(_0x5d380a,_0x2ef908['freshdeskAccounts'],'id');for(var _0x249d9a=0x0,_0x222174={};_0x249d9a<_0x5d380a['length'];_0x249d9a+=0x1){_0x222174=_0x5d380a[_0x249d9a];if(_['isUndefined'](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']])){_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']]=new FreshdeskAccount(_0x222174);}else{_0x2ef908[_0xe0b0('0x3c')](_0x2ef908[_0xe0b0('0x1e')][_0x222174['id']],_0x222174);}}}return _0x2ef908[_0xe0b0('0x1e')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x49')]=function(){var _0x4ebb0f=this;return function(_0x22c7bc){if(_0x22c7bc){freeIsNotKey(_0x22c7bc,_0x4ebb0f['zohoAccounts'],'id');for(var _0x17b3d4=0x0,_0x54106c={};_0x17b3d4<_0x22c7bc['length'];_0x17b3d4+=0x1){_0x54106c=_0x22c7bc[_0x17b3d4];if(_[_0xe0b0('0x41')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']])){_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']]=new ZohoAccount(_0x54106c);}else{_0x4ebb0f[_0xe0b0('0x3c')](_0x4ebb0f[_0xe0b0('0x1f')][_0x54106c['id']],_0x54106c);}}}return _0x4ebb0f[_0xe0b0('0x1f')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4a')]=function(){var _0x2e1c9b=this;return function(_0x4e0d87){if(_0x4e0d87){freeIsNotKey(_0x4e0d87,_0x2e1c9b[_0xe0b0('0x20')],'id');for(var _0x57ccc9=0x0,_0x2b5553={};_0x57ccc9<_0x4e0d87[_0xe0b0('0x3e')];_0x57ccc9+=0x1){_0x2b5553=_0x4e0d87[_0x57ccc9];if(_[_0xe0b0('0x41')](_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']])){_0x2e1c9b[_0xe0b0('0x20')][_0x2b5553['id']]=new DeskAccount(_0x2b5553);}else{_0x2e1c9b[_0xe0b0('0x3c')](_0x2e1c9b['deskAccounts'][_0x2b5553['id']],_0x2b5553);}}}return _0x2e1c9b[_0xe0b0('0x20')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4b')]=function(){var _0x271445=this;return function(_0x3bb6d6){if(_0x3bb6d6){freeIsNotKey(_0x3bb6d6,_0x271445[_0xe0b0('0x1d')],'id');for(var _0x234cb7=0x0,_0x1a60d2={};_0x234cb7<_0x3bb6d6[_0xe0b0('0x3e')];_0x234cb7+=0x1){_0x1a60d2=_0x3bb6d6[_0x234cb7];if(_[_0xe0b0('0x41')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']])){_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']]=new SugarcrmAccount(_0x1a60d2);}else{_0x271445[_0xe0b0('0x3c')](_0x271445[_0xe0b0('0x1d')][_0x1a60d2['id']],_0x1a60d2);}}}return _0x271445[_0xe0b0('0x1d')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4c')]=function(){var _0x155738=this;return function(_0x5aa79b){if(_0x5aa79b){freeIsNotKey(_0x5aa79b,_0x155738[_0xe0b0('0x21')],'id');for(var _0xe7fbac=0x0,_0x1182dc={};_0xe7fbac<_0x5aa79b[_0xe0b0('0x3e')];_0xe7fbac+=0x1){_0x1182dc=_0x5aa79b[_0xe7fbac];if(_[_0xe0b0('0x41')](_0x155738[_0xe0b0('0x21')][_0x1182dc['id']])){_0x155738[_0xe0b0('0x21')][_0x1182dc['id']]=new VtigerAccount(_0x1182dc);}else{_0x155738['mergeFromDatabase'](_0x155738['vtigerAccounts'][_0x1182dc['id']],_0x1182dc);}}}return _0x155738[_0xe0b0('0x21')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4d')]=function(){var _0x47ecc1=this;return function(_0x117d20){if(_0x117d20){freeIsNotKey(_0x117d20,_0x47ecc1[_0xe0b0('0x4e')],'id');for(var _0x309efb=0x0,_0x3d820c={};_0x309efb<_0x117d20[_0xe0b0('0x3e')];_0x309efb+=0x1){_0x3d820c=_0x117d20[_0x309efb];if(_['isUndefined'](_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']])){_0x47ecc1[_0xe0b0('0x4e')][_0x3d820c['id']]=new ServicenowAccount(_0x3d820c);}else{_0x47ecc1[_0xe0b0('0x3c')](_0x47ecc1['servicenowAccounts'][_0x3d820c['id']],_0x3d820c);}}}return _0x47ecc1[_0xe0b0('0x4e')];};};Realtime[_0xe0b0('0x42')]['initDynamics365Accounts']=function(){var _0x1bd249=this;return function(_0x4c5478){if(_0x4c5478){freeIsNotKey(_0x4c5478,_0x1bd249['dynamics365Accounts'],'id');for(var _0x4474ac=0x0,_0x57b51e={};_0x4474ac<_0x4c5478['length'];_0x4474ac+=0x1){_0x57b51e=_0x4c5478[_0x4474ac];if(_[_0xe0b0('0x41')](_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']])){_0x1bd249[_0xe0b0('0x22')][_0x57b51e['id']]=new Dynamics365Account(_0x57b51e);}else{_0x1bd249[_0xe0b0('0x3c')](_0x1bd249['dynamics365Accounts'][_0x57b51e['id']],_0x57b51e);}}}return _0x1bd249[_0xe0b0('0x22')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x4f')]=function(){var _0x41ec8e=this;return function(_0x1b29c){if(_0x1b29c){freeIsNotKey(_0x1b29c,_0x41ec8e[_0xe0b0('0x50')],'id');for(var _0xc5e88c=0x0,_0x224f1e={};_0xc5e88c<_0x1b29c['length'];_0xc5e88c+=0x1){_0x224f1e=_0x1b29c[_0xc5e88c];if(_['isUndefined'](_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']])){_0x41ec8e[_0xe0b0('0x50')][_0x224f1e['id']]=new FreshsalesAccount(_0x224f1e);}else{_0x41ec8e[_0xe0b0('0x3c')](_0x41ec8e['freshsalesAccounts'][_0x224f1e['id']],_0x224f1e);}}}return _0x41ec8e['freshsalesAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x51')]=function(){var _0x5d7cf4=this;return function(_0x5eca3d){for(var _0x691136=0x0;_0x691136<_0x5eca3d[_0xe0b0('0x3e')];_0x691136+=0x1){_[_0xe0b0('0x52')](_0x5d7cf4[_0xe0b0('0x13')][_0x5eca3d[_0x691136][_0xe0b0('0x25')]],_0x5eca3d[_0x691136]);}return _0x5d7cf4[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x53')]=function(){var _0x51f209=this;return function(_0x1daff7){clearVoiceQueues(_0x51f209[_0xe0b0('0x13')]);if(_0x1daff7){_0x1daff7=_[_0xe0b0('0x54')](_0x1daff7,'uniqueid');for(var _0x4fbf44 in _0x1daff7){if(_0x1daff7['hasOwnProperty'](_0x4fbf44)){for(var _0x56ee83=0x0;_0x56ee83<_0x1daff7[_0x4fbf44]['length'];_0x56ee83+=0x1){var _0x567c06=_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x55')];if(_0x51f209['voiceQueues'][_0x567c06]){if(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexit']){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2e')]+=0x1;}if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x56')]){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2f')]+=0x1;}_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')])['diff'](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x58')]),_0xe0b0('0x59'))||0x0;if(_0x56ee83===_0x1daff7[_0x4fbf44][_0xe0b0('0x3e')]-0x1){_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5a')]||_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5b')]||_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerexitAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallerjoinAt']),_0xe0b0('0x59'))||0x0;_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x29')]+=0x1;if(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x5d')]){_0x51f209['voiceQueues'][_0x567c06][_0xe0b0('0x5e')]+=0x1;_0x51f209[_0xe0b0('0x13')][_0x567c06]['sumBillable']+=moment(_0x1daff7[_0x4fbf44][_0x56ee83]['queuecallercompleteAt'])[_0xe0b0('0x5c')](moment(_0x1daff7[_0x4fbf44][_0x56ee83][_0xe0b0('0x57')]),_0xe0b0('0x59'))||0x0;}}else{_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x30')]+=_0x51f209[_0xe0b0('0x13')][_0x567c06][_0xe0b0('0x2a')]||0x0;}}}}}}return _0x51f209[_0xe0b0('0x13')];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x5f')]=function(){var _0x5a63e6=this;return function(_0x4c512b){clearVoiceCallReports(_0x5a63e6[_0xe0b0('0x16')]);if(_0x4c512b){for(var _0x4880d5=0x0;_0x4880d5<_0x4c512b['length'];_0x4880d5+=0x1){_0x5a63e6['outbound']['total']+=0x1;_0x5a63e6[_0xe0b0('0x16')]['sumDuration']+=_0x4c512b[_0x4880d5][_0xe0b0('0x60')];if(_0x4c512b[_0x4880d5][_0xe0b0('0x61')]===_0xe0b0('0x62')){_0x5a63e6[_0xe0b0('0x16')]['answered']+=0x1;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2a')]+=_0x4c512b[_0x4880d5]['duration']-_0x4c512b[_0x4880d5][_0xe0b0('0x63')]||0x0;_0x5a63e6[_0xe0b0('0x16')][_0xe0b0('0x2b')]+=_0x4c512b[_0x4880d5][_0xe0b0('0x63')];}}}return _0x5a63e6[_0xe0b0('0x16')];};};Realtime['prototype']['initCampaigns']=function(){var _0x55aef7=this;return function(_0x545694){if(_0x545694){freeIsNotKey(_0x545694,_0x55aef7['campaigns'],_0xe0b0('0x25'));for(var _0x567e1a=0x0,_0x3c09af={};_0x567e1a<_0x545694['length'];_0x567e1a+=0x1){_0x3c09af=_0x545694[_0x567e1a];if(_[_0xe0b0('0x41')](_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]])){_0x55aef7[_0xe0b0('0x64')][_0x3c09af[_0xe0b0('0x25')]]=new Campaign(_0x3c09af);}else{_0x55aef7[_0xe0b0('0x3c')](_0x55aef7['campaigns'][_0x3c09af['name']],_0x3c09af);_0x55aef7['campaigns'][_0x3c09af['name']][_0xe0b0('0x65')]=_0x3c09af[_0xe0b0('0x66')]?_0x3c09af[_0xe0b0('0x66')][_0xe0b0('0x25')]:undefined;}}}return _0x55aef7[_0xe0b0('0x64')];};};Realtime['prototype'][_0xe0b0('0x67')]=function(){var _0x39a07b=this;return function(_0xf77616){if(_0xf77616){freeIsNotKey(_0xf77616,_0x39a07b[_0xe0b0('0x17')],'id');for(var _0x154e6d=0x0,_0x2a5082={};_0x154e6d<_0xf77616[_0xe0b0('0x3e')];_0x154e6d+=0x1){_0x2a5082=_0xf77616[_0x154e6d];if(_[_0xe0b0('0x41')](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']])){_0x39a07b['voiceExtensions'][_0x2a5082['id']]=new VoiceExtension(_0x2a5082);}else{_0x39a07b['mergeFromDatabase'](_0x39a07b[_0xe0b0('0x17')][_0x2a5082['id']],_0x2a5082);}}}return _0x39a07b[_0xe0b0('0x17')];};};Realtime['prototype'][_0xe0b0('0x68')]=function(){var _0x4593f1=this;return function(_0x44c475){clearCampaigns(_0x4593f1[_0xe0b0('0x64')]);for(var _0x7358ce=0x0;_0x7358ce<_0x44c475[_0xe0b0('0x3e')];_0x7358ce+=0x1){_[_0xe0b0('0x52')](_0x4593f1[_0xe0b0('0x64')][_0x44c475[_0x7358ce]['name']],_0x44c475[_0x7358ce]);}return _0x4593f1['campaigns'];};};Realtime['prototype'][_0xe0b0('0x69')]=function(){var _0x90d471=this;return function(_0x5d2365){if(_0x5d2365){freeIsNotKey(_0x5d2365,_0x90d471[_0xe0b0('0x23')],'id');for(var _0x448694=0x0,_0x396eec={};_0x448694<_0x5d2365[_0xe0b0('0x3e')];_0x448694+=0x1){_0x396eec=_0x5d2365[_0x448694];if(_['isUndefined'](_0x90d471['faxAccounts'][_0x396eec['id']])){_0x90d471['faxAccounts'][_0x396eec['id']]=new FaxAccount(_0x396eec);}else{_0x90d471[_0xe0b0('0x3c')](_0x90d471[_0xe0b0('0x23')][_0x396eec['id']],_0x396eec);}}}return _0x90d471['faxAccounts'];};};Realtime[_0xe0b0('0x42')][_0xe0b0('0x6a')]=function(){var _0x5547ee=this;return function(_0x576482){if(_0x576482){freeIsNotKey(_0x576482,_0x5547ee[_0xe0b0('0x13')],'name');for(var _0x251195=0x0,_0x5f06c0={};_0x251195<_0x576482[_0xe0b0('0x3e')];_0x251195+=0x1){_0x5f06c0=_0x576482[_0x251195];if(_[_0xe0b0('0x41')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]])){_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]]=new VoiceQueue(_0x5f06c0);}else{_0x5547ee[_0xe0b0('0x3c')](_0x5547ee[_0xe0b0('0x13')][_0x5f06c0[_0xe0b0('0x25')]],_0x5f06c0);}}}return _0x5547ee['voiceQueues'];};};module[_0xe0b0('0x6b')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 50ae1c0..106a5a7 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf81d=['hasOwnProperty','assign'];(function(_0x57d628,_0xda6747){var _0x2f8486=function(_0x5f2cba){while(--_0x5f2cba){_0x57d628['push'](_0x57d628['shift']());}};_0x2f8486(++_0xda6747);}(_0xf81d,0x1c5));var _0xdf81=function(_0x4dafdf,_0x4942d7){_0x4dafdf=_0x4dafdf-0x0;var _0x277794=_0xf81d[_0x4dafdf];return _0x277794;};'use strict';function mergeDBDataToRealtime(_0x2e8e8d,_0x76cb55){var _0x542263=Object[_0xdf81('0x0')]({},_0x2e8e8d);for(var _0x59f4c2 in _0x76cb55){if(_0x542263[_0xdf81('0x1')](_0x59f4c2)){_0x542263[_0x59f4c2]=_0x76cb55[_0x59f4c2];}}return _0x542263;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x096c=['hasOwnProperty','mergeDBDataToRealtime','assign'];(function(_0x2968d0,_0x286634){var _0x3b86df=function(_0x2bb442){while(--_0x2bb442){_0x2968d0['push'](_0x2968d0['shift']());}};_0x3b86df(++_0x286634);}(_0x096c,0x1a0));var _0xc096=function(_0x586479,_0x5736fa){_0x586479=_0x586479-0x0;var _0x2f3973=_0x096c[_0x586479];return _0x2f3973;};'use strict';function mergeDBDataToRealtime(_0x2b4a45,_0x1f2095){var _0x3021d0=Object[_0xc096('0x0')]({},_0x2b4a45);for(var _0x52faba in _0x1f2095){if(_0x3021d0[_0xc096('0x1')](_0x52faba)){_0x3021d0[_0x52faba]=_0x1f2095[_0x52faba];}}return _0x3021d0;}exports[_0xc096('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index d0789d1..1907770 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 _0x7eb7=['disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','attendedTransfer','agents','accountcode','name','isNil','find','telephones','interface','format','SIP/%s','findAgent','assigned','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','length','keys','getCallType','split','calleridnum','outbound','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','xcally-motion-preview','calleridpreview','destinationchannel','channel','disposition','ANSWERED','connectedlinenum','calleridname','transfers','linkedid','transfereelinkedid','blindTransfer','UserId','membername','monitor','monitors','monitorFilename','createdAt','connectedlinename','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','prototype','realtime','xdr'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x7eb7,0xa8));var _0x77eb=function(_0x59aeb8,_0x5e9372){_0x59aeb8=_0x59aeb8-0x0;var _0x1920ef=_0x7eb7[_0x59aeb8];return _0x1920ef;};'use strict';var _=require(_0x77eb('0x0'));var moment=require(_0x77eb('0x1'));var util=require(_0x77eb('0x2'));var config=require(_0x77eb('0x3'));var ami=require(_0x77eb('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x77eb('0x5'));var RpcVoiceDialReport=require(_0x77eb('0x6'));var RpcMemberReport=require(_0x77eb('0x7'));var RpcVoiceQueueReport=require(_0x77eb('0x8'));var RpcVoiceRecording=require(_0x77eb('0x9'));var RpcVoiceTransferReport=require(_0x77eb('0xa'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x77eb('0xb'));var VoiceAgentReport=require(_0x77eb('0xc'));var VoiceDialReport=require(_0x77eb('0xd'));var UserReport=require(_0x77eb('0xe'));function Report(_0xeaa204){this['realtime']=_0xeaa204;this['agents']=_0xeaa204['agents'];this['telephones']=_0xeaa204['telephones'];}Report[_0x77eb('0xf')]['sync']=function(_0x3c3300){var _0x310e6c=new VoiceQueueReport(this[_0x77eb('0x10')]);var _0x134c88=new VoiceAgentReport(this[_0x77eb('0x10')]);var _0x1f668a=new VoiceDialReport(this[_0x77eb('0x10')]);var _0x4459a9=new VoiceCallReport(this[_0x77eb('0x10')]);var _0x2cb7d7=new UserReport(this[_0x77eb('0x10')]);if(config['xdr']&&config[_0x77eb('0x11')][_0x77eb('0x12')]){ami['on'](_0x77eb('0x13'),this[_0x77eb('0x14')][_0x77eb('0x15')](this));ami['on'](_0x77eb('0x16'),this['voiceCallReport'][_0x77eb('0x15')](this));ami['on']('custom:voiceAgentReport',this[_0x77eb('0x17')]['bind'](this));ami['on'](_0x77eb('0x18'),this[_0x77eb('0x19')][_0x77eb('0x15')](this));ami['on']('blindtransfer',this['blindTransfer'][_0x77eb('0x15')](this));ami['on']('attendedtransfer',this[_0x77eb('0x1a')][_0x77eb('0x15')](this));}};Report[_0x77eb('0xf')]['findAgent']=function(_0x3629fa){var _0x2daecd;_0x2daecd=_['find'](this[_0x77eb('0x1b')],function(_0x237813){return _0x237813[_0x77eb('0x1c')]==_0x3629fa||_0x237813[_0x77eb('0x1d')]==_0x3629fa;});if(_[_0x77eb('0x1e')](_0x2daecd)){var _0x5ab01f=_[_0x77eb('0x1f')](this[_0x77eb('0x20')],function(_0x3dff29){return _0x3dff29[_0x77eb('0x1c')]==_0x3629fa||_0x3dff29[_0x77eb('0x1d')]==_0x3629fa;});if(_0x5ab01f){_0x2daecd=_[_0x77eb('0x1f')](this[_0x77eb('0x1b')],function(_0x309af5){return _0x309af5[_0x77eb('0x21')]==util[_0x77eb('0x22')](_0x77eb('0x23'),_0x5ab01f[_0x77eb('0x1d')]);});}}return _0x2daecd;};Report[_0x77eb('0xf')][_0x77eb('0x14')]=function(_0x4e7318){for(var _0x28cce3=0x0;_0x28cce3<_0x4e7318['length'];_0x28cce3+=0x1){var _0x1c7b0b=this[_0x77eb('0x24')](_0x4e7318[_0x28cce3]['connectedlinenum']);if(_0x1c7b0b){_0x4e7318[_0x28cce3][_0x77eb('0x1c')]=_0x1c7b0b['accountcode'];_0x4e7318[_0x28cce3][_0x77eb('0x25')]=!![];_0x4e7318[_0x28cce3]['lastAssignedTo']=_0x1c7b0b[_0x77eb('0x1d')];_0x4e7318[_0x28cce3][_0x77eb('0x21')]=_[_0x77eb('0x1e')](_0x1c7b0b[_0x77eb('0x21')])?util['format'](_0x77eb('0x23'),_0x1c7b0b[_0x77eb('0x1d')]):_0x1c7b0b[_0x77eb('0x21')];if(_0x4e7318[_0x28cce3]['queuecallercomplete']){_0x4e7318[_0x28cce3]['queuecallercompleteAt']=moment()['format'](_0x77eb('0x26'));}if(_0x4e7318[_0x28cce3][_0x77eb('0x27')]){_0x4e7318[_0x28cce3][_0x77eb('0x28')]=moment()['format'](_0x77eb('0x26'));}RpcMemberReport['voiceQueueReport'](_0x4e7318[_0x28cce3]);}RpcVoiceQueueReport[_0x77eb('0x29')](_0x4e7318[_0x28cce3]);}};function extractCalleridNumber(_0x149171){var _0x59520d=_0x149171[_0x77eb('0x2a')](/<(.*?)>/);return _0x59520d?_0x59520d[0x1]:_0x149171;}Report['prototype'][_0x77eb('0x2b')]=function(_0x172c76){for(var _0x1b945e=0x0;_0x1b945e',_0x31fe0e[_0x77eb('0x45')],_0x31fe0e[_0x77eb('0x30')]);}if(RpcVoiceTransferReport[_0x77eb('0x46')][_0x31fe0e[_0x77eb('0x47')]]){var _0x37eb68=RpcVoiceTransferReport[_0x77eb('0x46')][_0x31fe0e[_0x77eb('0x47')]];_0x37eb68[_0x77eb('0x48')]=_0x31fe0e['uniqueid'];RpcVoiceTransferReport[_0x77eb('0x49')](_0x37eb68);delete RpcVoiceTransferReport[_0x77eb('0x46')][_0x31fe0e[_0x77eb('0x47')]];}if(_[_0x77eb('0x1e')](_0x31fe0e[_0x77eb('0x35')])){_0x31fe0e[_0x77eb('0x35')]=this[_0x77eb('0x2e')](_0x31fe0e);}if(_[_0x77eb('0x1e')](_0x31fe0e[_0x77eb('0x4a')])){var _0x123fde=_0x31fe0e[_0x77eb('0x41')][_0x77eb('0x2f')]('-')[0x0];var _0x513c3a=this[_0x77eb('0x1b')][_0x123fde];if(!_0x513c3a)_0x513c3a=this['getAgentByInternal'](_0x31fe0e[_0x77eb('0x1c')]);if(_0x513c3a){_0x31fe0e['UserId']=_0x513c3a['id'];_0x31fe0e[_0x77eb('0x4b')]=_0x513c3a['name'];}}RpcVoiceCallReport[_0x77eb('0x29')](_0x31fe0e);if(_0x31fe0e[_0x77eb('0x4c')]){for(var _0x9337ce=0x0;_0x9337ce<_0x31fe0e[_0x77eb('0x4d')][_0x77eb('0x2c')];_0x9337ce+=0x1){_0x31fe0e[_0x77eb('0x4e')]=_0x31fe0e[_0x77eb('0x4d')][_0x9337ce]['filename'];_0x31fe0e[_0x77eb('0x4f')]=_0x31fe0e[_0x77eb('0x4d')][_0x9337ce][_0x77eb('0x4f')];if(_0x31fe0e['exten']=='xcally-motion-preview'){_0x31fe0e[_0x77eb('0x30')]=_0x31fe0e[_0x77eb('0x44')];_0x31fe0e[_0x77eb('0x45')]=_0x31fe0e[_0x77eb('0x50')];_0x31fe0e[_0x77eb('0x44')]=_0x31fe0e[_0x77eb('0x1c')];_0x31fe0e['connectedlinename']=_0x31fe0e[_0x77eb('0x4b')];_0x31fe0e['exten']=_0x31fe0e[_0x77eb('0x51')];}else if(_0x31fe0e[_0x77eb('0x34')]==_0x77eb('0x52')){_0x31fe0e[_0x77eb('0x30')]=_0x31fe0e['destination'];_0x31fe0e[_0x77eb('0x34')]=_0x31fe0e[_0x77eb('0x51')];}RpcVoiceRecording['create'](_0x31fe0e);}}};Report['prototype']['voiceAgentReport']=function(_0x5c0cf2){if(_[_0x77eb('0x53')](_0x5c0cf2)){_0x5c0cf2[_0x77eb('0x54')](function(_0x39d18a){RpcVoiceAgentReport[_0x77eb('0x29')](_0x39d18a);});}else{RpcVoiceAgentReport[_0x77eb('0x29')](_0x5c0cf2);}};Report[_0x77eb('0xf')]['voiceDialReport']=function(_0x3cd3e0){RpcVoiceDialReport[_0x77eb('0x29')](_0x3cd3e0);var _0x546536;var _0x18615f;var _0x493546=_0x3cd3e0['channel'];if(_[_0x77eb('0x55')](_0x493546,_0x77eb('0x56'))){_0x18615f=_0x493546[_0x77eb('0x57')](_0x493546[_0x77eb('0x58')]('/')+0x1,_0x493546['indexOf']('@'));_0x546536=_[_0x77eb('0x1f')](this[_0x77eb('0x1b')],function(_0x1fc0ad){return _0x1fc0ad[_0x77eb('0x59')]==_0x18615f||_0x1fc0ad[_0x77eb('0x5a')]==_0x18615f||_0x1fc0ad[_0x77eb('0x1c')]==_0x18615f;});}else{_0x18615f=_0x493546[_0x77eb('0x57')](_0x493546['indexOf']('/')+0x1,_0x493546[_0x77eb('0x5b')]('-'));_0x546536=this[_0x77eb('0x24')](_0x18615f);}if(_0x546536){_0x3cd3e0['interface']=_[_0x77eb('0x1e')](_0x546536[_0x77eb('0x21')])?util[_0x77eb('0x22')]('SIP/%s',_0x546536[_0x77eb('0x1d')]):_0x546536[_0x77eb('0x21')];_0x3cd3e0[_0x77eb('0x4b')]=_0x546536[_0x77eb('0x1d')];_0x3cd3e0['accountcode']=_0x546536[_0x77eb('0x1c')];RpcMemberReport[_0x77eb('0x19')](_0x3cd3e0);}};Report['prototype'][_0x77eb('0x49')]=function(_0x3e5b01){RpcVoiceTransferReport['transfers'][_0x3e5b01['transfererlinkedid']]=_0x3e5b01;};Report[_0x77eb('0xf')]['attendedTransfer']=function(_0x11dc1e){RpcVoiceTransferReport[_0x77eb('0x1a')](_0x11dc1e);};module[_0x77eb('0x5c')]=Report; \ No newline at end of file +var _0x034c=['length','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','create','match','keys','getCallType','channel','split','getAgentByInternal','calleridnum','outbound','internal','destination','type','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','originatecalleridnum','destinationchannel','calleridpreview','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','UserId','membername','monitor','monitors','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','indexOf','mobile','phone','substring','transfererlinkedid','moment','util','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','voiceQueueReport'];(function(_0x63179d,_0x41f5b1){var _0x7746be=function(_0x526a28){while(--_0x526a28){_0x63179d['push'](_0x63179d['shift']());}};_0x7746be(++_0x41f5b1);}(_0x034c,0xf2));var _0xc034=function(_0x36ebb3,_0x3a7e09){_0x36ebb3=_0x36ebb3-0x0;var _0x2a2e29=_0x034c[_0x36ebb3];return _0x2a2e29;};'use strict';var _=require('lodash');var moment=require(_0xc034('0x0'));var util=require(_0xc034('0x1'));var config=require(_0xc034('0x2'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xc034('0x3'));var RpcVoiceCallReport=require(_0xc034('0x4'));var RpcVoiceDialReport=require(_0xc034('0x5'));var RpcMemberReport=require(_0xc034('0x6'));var RpcVoiceQueueReport=require(_0xc034('0x7'));var RpcVoiceRecording=require(_0xc034('0x8'));var RpcVoiceTransferReport=require(_0xc034('0x9'));var VoiceQueueReport=require(_0xc034('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xc034('0xb'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0xc034('0xc'));function Report(_0x2c6f37){this[_0xc034('0xd')]=_0x2c6f37;this[_0xc034('0xe')]=_0x2c6f37['agents'];this[_0xc034('0xf')]=_0x2c6f37['telephones'];}Report[_0xc034('0x10')][_0xc034('0x11')]=function(_0x374ff0){var _0x2271e3=new VoiceQueueReport(this[_0xc034('0xd')]);var _0x3e8012=new VoiceAgentReport(this[_0xc034('0xd')]);var _0x32eec3=new VoiceDialReport(this['realtime']);var _0x41a610=new VoiceCallReport(this['realtime']);var _0x5f3cac=new UserReport(this[_0xc034('0xd')]);if(config[_0xc034('0x12')]&&config['xdr']['disabled']){ami['on'](_0xc034('0x13'),this['voiceQueueReport'][_0xc034('0x14')](this));ami['on'](_0xc034('0x15'),this[_0xc034('0x16')][_0xc034('0x14')](this));ami['on'](_0xc034('0x17'),this[_0xc034('0x18')][_0xc034('0x14')](this));ami['on'](_0xc034('0x19'),this['voiceDialReport'][_0xc034('0x14')](this));ami['on'](_0xc034('0x1a'),this['blindTransfer'][_0xc034('0x14')](this));ami['on'](_0xc034('0x1b'),this[_0xc034('0x1c')]['bind'](this));}};Report[_0xc034('0x10')][_0xc034('0x1d')]=function(_0xb45240){var _0x1b533c;_0x1b533c=_[_0xc034('0x1e')](this['agents'],function(_0x5afece){return _0x5afece[_0xc034('0x1f')]==_0xb45240||_0x5afece[_0xc034('0x20')]==_0xb45240;});if(_[_0xc034('0x21')](_0x1b533c)){var _0x5897ba=_['find'](this[_0xc034('0xf')],function(_0xa92741){return _0xa92741[_0xc034('0x1f')]==_0xb45240||_0xa92741[_0xc034('0x20')]==_0xb45240;});if(_0x5897ba){_0x1b533c=_[_0xc034('0x1e')](this['agents'],function(_0x56b04a){return _0x56b04a[_0xc034('0x22')]==util['format'](_0xc034('0x23'),_0x5897ba[_0xc034('0x20')]);});}}return _0x1b533c;};Report[_0xc034('0x10')][_0xc034('0x24')]=function(_0x244dfb){for(var _0x534cb8=0x0;_0x534cb8<_0x244dfb[_0xc034('0x25')];_0x534cb8+=0x1){var _0x1e7a56=this[_0xc034('0x1d')](_0x244dfb[_0x534cb8]['connectedlinenum']);if(_0x1e7a56){_0x244dfb[_0x534cb8]['accountcode']=_0x1e7a56[_0xc034('0x1f')];_0x244dfb[_0x534cb8][_0xc034('0x26')]=!![];_0x244dfb[_0x534cb8][_0xc034('0x27')]=_0x1e7a56[_0xc034('0x20')];_0x244dfb[_0x534cb8][_0xc034('0x22')]=_[_0xc034('0x21')](_0x1e7a56[_0xc034('0x22')])?util[_0xc034('0x28')](_0xc034('0x23'),_0x1e7a56[_0xc034('0x20')]):_0x1e7a56[_0xc034('0x22')];if(_0x244dfb[_0x534cb8][_0xc034('0x29')]){_0x244dfb[_0x534cb8][_0xc034('0x2a')]=moment()[_0xc034('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x244dfb[_0x534cb8]['queuecallerexit']){_0x244dfb[_0x534cb8][_0xc034('0x2b')]=moment()[_0xc034('0x28')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0xc034('0x24')](_0x244dfb[_0x534cb8]);}RpcVoiceQueueReport[_0xc034('0x2c')](_0x244dfb[_0x534cb8]);}};function extractCalleridNumber(_0x21c196){var _0x2f1ea9=_0x21c196[_0xc034('0x2d')](/<(.*?)>/);return _0x2f1ea9?_0x2f1ea9[0x1]:_0x21c196;}Report[_0xc034('0x10')]['getAgentByInternal']=function(_0x59bd30){for(var _0x3b4377=0x0;_0x3b43770x0?!![]:![];if(!_0x1a04b0){return this[_0x3e33('0x1a')](this[_0x3e33('0x50')][_0x3e33('0x73')]);}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0x1c')]=function(_0x5262a6){var _0x4fc001=this[_0x3e33('0x50')]['id'];if(this[_0x3e33('0x50')][_0x3e33('0x69')][_0x4fc001]&&this[_0x3e33('0x50')][_0x3e33('0x69')][_0x4fc001][_0x5262a6['actionid']]){this['summary'][_0x3e33('0x69')][_0x4fc001][_0x5262a6[_0x3e33('0x68')]]['agents'][_0x3e33('0x74')](_0x5262a6);}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0x17')]=function(_0x1a0e2a){var _0x3a43ad=this;try{if(this[_0x3e33('0x64')](_0x1a0e2a)&&this[_0x3e33('0x64')](_0x1a0e2a['queue'])){logger['debug'](_0x3e33('0x75'),util[_0x3e33('0x49')](_0x1a0e2a,{'showHidden':![],'depth':null}));var _0x27aaef=this[_0x3e33('0x15')][_0x1a0e2a[_0x3e33('0x5a')]];if(_0x27aaef){logger[_0x3e33('0x53')](_0x3e33('0x76'),_0x27aaef['name']);this[_0x3e33('0x50')][_0x3e33('0x6b')][_0x27aaef[_0x3e33('0x63')]]={'summaryEvent':_0x1a0e2a};this[_0x3e33('0x50')]['statusRequests']+=0x1;return ami[_0x3e33('0x44')]({'action':_0x3e33('0x69'),'queue':_0x27aaef[_0x3e33('0x63')]})['then'](function(_0x1a1eef){if(!_0x3a43ad[_0x3e33('0x50')][_0x3e33('0x69')][_0x1a0e2a[_0x3e33('0x68')]]){_0x3a43ad[_0x3e33('0x50')]['queuestatus'][_0x1a0e2a[_0x3e33('0x68')]]={};}_0x3a43ad[_0x3e33('0x50')][_0x3e33('0x69')][_0x1a0e2a[_0x3e33('0x68')]][_0x1a1eef['actionid']]={'queue':_0x27aaef[_0x3e33('0x63')],'agents':[]};})['catch'](function(_0x16d5c9){throw _0x16d5c9;});}}}catch(_0x1cbd98){logger[_0x3e33('0x4b')](_0x3e33('0x6a'),util[_0x3e33('0x49')](_0x1cbd98,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0x1a')]=function(_0x48f954){if(this['summary']['statusRequests']>0x0){this[_0x3e33('0x50')][_0x3e33('0x73')]=_0x48f954;return;}logger['debug'](_0x3e33('0x77'),util['inspect'](_0x48f954,{'showHidden':![],'depth':null}));this[_0x3e33('0x50')]=initializeSummary();ami['emit'](_0x3e33('0x78'),{});};VoiceQueueReport['prototype'][_0x3e33('0x20')]=function(_0x252c3f){try{if(this['isNotNull'](_0x252c3f)){logger[_0x3e33('0x53')]('[%s][voiceQueueReport][queuecallerjoin]',_0x252c3f[_0x3e33('0x56')],util[_0x3e33('0x49')](_0x252c3f,{'showHidden':![],'depth':null}));if(_[_0x3e33('0x65')](this['queueReports'][_0x252c3f[_0x3e33('0x56')]])){this[_0x3e33('0x4a')][_0x252c3f['uniqueid']]=[];}if(_[_0x3e33('0x65')](this['channels'][_0x252c3f[_0x3e33('0x56')]])){this[_0x3e33('0x13')][_0x252c3f[_0x3e33('0x56')]]={};}var _0x533b93=new QueueReport();_0x533b93['queue']=_0x252c3f[_0x3e33('0x5a')];_0x533b93['type']=this['voiceQueues'][_0x533b93[_0x3e33('0x5a')]]&&this[_0x3e33('0x15')][_0x533b93[_0x3e33('0x5a')]]['type']?this[_0x3e33('0x15')][_0x533b93[_0x3e33('0x5a')]][_0x3e33('0x60')]||_0x3e33('0x61'):_0x3e33('0x61');_0x533b93[_0x3e33('0x79')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x533b93[_0x3e33('0x7a')]=_0x252c3f['position'];_0x533b93[_0x3e33('0x7b')]=_0x252c3f[_0x3e33('0x7b')];_0x533b93[_0x3e33('0x56')]=_0x252c3f[_0x3e33('0x56')];_0x533b93[_0x3e33('0x7c')]=this['channels'][_0x252c3f[_0x3e33('0x56')]][_0x3e33('0x7c')];logger[_0x3e33('0x7d')](_0x3e33('0x7e'),_0x533b93[_0x3e33('0x5a')],_0x533b93['type']);Object[_0x3e33('0x7f')](_0x533b93,_[_0x3e33('0x80')](_0x252c3f,_[_0x3e33('0x81')](_0x533b93)));this[_0x3e33('0x4a')][_0x252c3f[_0x3e33('0x56')]][_0x3e33('0x74')](_0x533b93);this['channels'][_0x252c3f[_0x3e33('0x56')]]=_0x533b93;this['emitVoiceQueueChannelSave'](_0x533b93,'queuecallerjoin');}}catch(_0x10b65e){logger[_0x3e33('0x4b')](_0x3e33('0x82'),_0x252c3f[_0x3e33('0x56')],util[_0x3e33('0x49')](_0x10b65e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3e33('0x22')]=function(_0x2200dd){try{if(this['isNotNull'](_0x2200dd)){logger[_0x3e33('0x53')](_0x3e33('0x83'),_0x2200dd['uniqueid'],util['inspect'](_0x2200dd,{'showHidden':![],'depth':null}));if(this[_0x3e33('0x4a')][_0x2200dd[_0x3e33('0x56')]]){var _0x334202=_[_0x3e33('0x84')](this[_0x3e33('0x4a')][_0x2200dd[_0x3e33('0x56')]]);_0x334202['queuecallercomplete']=![];_0x334202['queuecallercompleteAt']=null;_0x334202[_0x3e33('0x85')]=_0x2200dd['holdtime'];_0x334202[_0x3e33('0x86')]=_0x2200dd[_0x3e33('0x86')];_0x334202[_0x3e33('0x21')]=!![];_0x334202[_0x3e33('0x87')]=moment()[_0x3e33('0x58')](_0x3e33('0x88'));_0x334202[_0x3e33('0x5d')]='ABANDONED';_0x334202[_0x3e33('0x89')]=null;logger[_0x3e33('0x7d')](_0x3e33('0x8a'),_0x334202[_0x3e33('0x5a')],_0x334202[_0x3e33('0x60')]);this[_0x3e33('0x13')][_0x2200dd['uniqueid']]=_0x334202;this[_0x3e33('0x8b')](_0x334202,_0x3e33('0x21'));}}}catch(_0x5b8b06){logger[_0x3e33('0x4b')](_0x3e33('0x83'),_0x2200dd['uniqueid'],util[_0x3e33('0x49')](_0x5b8b06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0x24')]=function(_0x523cf5){try{if(this[_0x3e33('0x64')](_0x523cf5)){logger[_0x3e33('0x53')](_0x3e33('0x8c'),_0x523cf5['uniqueid'],util[_0x3e33('0x49')](_0x523cf5,{'showHidden':![],'depth':null}));if(this[_0x3e33('0x4a')][_0x523cf5['uniqueid']]){var _0x45cdce=_[_0x3e33('0x84')](this['queueReports'][_0x523cf5[_0x3e33('0x56')]]);_0x45cdce['queuecallerleaveAt']=moment()[_0x3e33('0x58')](_0x3e33('0x88'));_0x45cdce[_0x3e33('0x8d')]=_0x523cf5[_0x3e33('0x8d')];_0x45cdce[_0x3e33('0x8e')]=_0x523cf5[_0x3e33('0x8e')];logger[_0x3e33('0x7d')](_0x3e33('0x8f'),_0x45cdce[_0x3e33('0x5a')],_0x45cdce['type'],_0x523cf5[_0x3e33('0x8d')],_0x523cf5[_0x3e33('0x8e')]);this[_0x3e33('0x13')][_0x523cf5['uniqueid']]=_0x45cdce;this['emitVoiceQueueChannelSave'](_0x45cdce,_0x3e33('0x23'));}}}catch(_0x3dad06){logger[_0x3e33('0x4b')](_0x3e33('0x8c'),_0x523cf5['uniqueid'],util[_0x3e33('0x49')](_0x3dad06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0x28')]=function(_0x256ad6){try{if(this['isNotNull'](_0x256ad6)){logger['debug'](_0x3e33('0x90'),_0x256ad6[_0x3e33('0x56')],util[_0x3e33('0x49')](_0x256ad6,{'showHidden':![],'depth':null}));if(this[_0x3e33('0x4a')][_0x256ad6[_0x3e33('0x56')]]){var _0xcfd036=_[_0x3e33('0x84')](this[_0x3e33('0x4a')][_0x256ad6['uniqueid']]);_0xcfd036[_0x3e33('0x91')]=!![];_0xcfd036[_0x3e33('0x5d')]=_0x3e33('0x92');logger[_0x3e33('0x7d')](_0x3e33('0x93'),_0xcfd036[_0x3e33('0x5a')],_0xcfd036[_0x3e33('0x60')]);}}}catch(_0x2a0f65){logger['error'](_0x3e33('0x90'),_0x256ad6['uniqueid'],util[_0x3e33('0x49')](_0x2a0f65,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0x26')]=function(_0x32d393){try{if(this[_0x3e33('0x64')](_0x32d393)){logger['debug'](_0x3e33('0x94'),_0x32d393['uniqueid'],util[_0x3e33('0x49')](_0x32d393,{'showHidden':![],'depth':null}));if(this[_0x3e33('0x4a')][_0x32d393[_0x3e33('0x56')]]){var _0x4eee92=_[_0x3e33('0x84')](this['queueReports'][_0x32d393[_0x3e33('0x56')]]);_0x4eee92[_0x3e33('0x21')]=![];_0x4eee92[_0x3e33('0x87')]=null;_0x4eee92['assigned']=!![];_0x4eee92[_0x3e33('0x89')]=_0x32d393[_0x3e33('0x95')];_0x4eee92[_0x3e33('0x85')]=_0x32d393[_0x3e33('0x85')];_0x4eee92['queuecallercomplete']=!![];_0x4eee92[_0x3e33('0x40')]=![];_0x4eee92[_0x3e33('0x96')]=null;if(!_0x4eee92[_0x3e33('0x97')]){if(_0x32d393[_0x3e33('0x98')]==_0x3e33('0x97')){_0x4eee92[_0x3e33('0x5d')]='COMPLETED';logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x4eee92[_0x3e33('0x5a')],_0x4eee92['type']);}else{if(_[_0x3e33('0x99')](_0x32d393[_0x3e33('0x45')][_0x3e33('0x9a')](),_0x3e33('0x9b'))){if(this[_0x3e33('0x4a')][_0x32d393[_0x3e33('0x9c')]]){var _0x382141=_['last'](this[_0x3e33('0x4a')][_0x32d393[_0x3e33('0x9c')]]);_0x382141[_0x3e33('0x91')]=![];_0x382141[_0x3e33('0x40')]=!![];_0x382141[_0x3e33('0x96')]=moment(_0x4eee92[_0x3e33('0x79')])[_0x3e33('0x9d')](_0x32d393[_0x3e33('0x85')],_0x3e33('0x9e'))['format'](_0x3e33('0x88'));_0x382141[_0x3e33('0x5d')]=_0x3e33('0x9f');_0x382141[_0x3e33('0x97')]=!![];_0x382141[_0x3e33('0xa0')]='FORWARD';_0x382141['transferexten']=_0x32d393['destexten'];_0x382141[_0x3e33('0xa1')]=_0x32d393[_0x3e33('0x56')];logger[_0x3e33('0x7d')](_0x3e33('0xa2'),_0x382141[_0x3e33('0x5a')],_0x382141[_0x3e33('0x60')]);var _0x457d5e=this['queueReports'][_0x32d393[_0x3e33('0x9c')]];this[_0x3e33('0x4a')][_0x32d393['linkedid']]=this[_0x3e33('0x4a')][_0x32d393[_0x3e33('0x56')]];this['queueReports'][_0x32d393[_0x3e33('0x56')]]=_0x457d5e;}}else{_0x4eee92['queuecallerexitreason']=_0x3e33('0xa3')+_0x32d393[_0x3e33('0x98')][_0x3e33('0xa4')]();logger[_0x3e33('0x7d')](_0x3e33('0xa5'),_0x4eee92[_0x3e33('0x5a')],_0x4eee92[_0x3e33('0x60')],_0x4eee92[_0x3e33('0x5d')]);}}}this[_0x3e33('0x13')][_0x32d393[_0x3e33('0x56')]]=_0x4eee92;}}}catch(_0x1e761d){logger[_0x3e33('0x4b')](_0x3e33('0x94'),_0x32d393[_0x3e33('0x56')],util[_0x3e33('0x49')](_0x1e761d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0x2a')]=function(_0x15130a){try{if(this['isNotNull'](_0x15130a)){logger['debug'](_0x3e33('0xa6'),_0x15130a['uniqueid'],util[_0x3e33('0x49')](_0x15130a,{'showHidden':![],'depth':null}));this[_0x3e33('0xa7')](_0x15130a[_0x3e33('0x56')],_['keys'](_0x15130a[_0x3e33('0xa8')])[0x0],_0x15130a[_0x3e33('0xa9')]);if(this[_0x3e33('0x4a')][_0x15130a[_0x3e33('0x56')]]){var _0x5ce1f7=_['last'](this[_0x3e33('0x4a')][_0x15130a[_0x3e33('0x56')]]);if(_0x5ce1f7){if(this['isNotNull'](_0x15130a[_0x3e33('0xa8')])&&this['isNotNull'](_0x15130a['variable'][_0x3e33('0x69')])){switch(_0x15130a['value']){case _0x3e33('0xaa'):_0x5ce1f7[_0x3e33('0x40')]=![];_0x5ce1f7[_0x3e33('0x96')]=null;break;case _0x3e33('0xab'):_0x5ce1f7['lastevent']='timeout';_0x5ce1f7[_0x3e33('0x40')]=!![];_0x5ce1f7['queuecallerexitAt']=moment()[_0x3e33('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ce1f7[_0x3e33('0xac')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x3e33('0x53')](_0x3e33('0xad'),_0x15130a[_0x3e33('0x56')],util[_0x3e33('0x49')](_0x5ce1f7,{'showHidden':![],'depth':null}));ami[_0x3e33('0x57')]('custom:timeout',_0x5ce1f7);break;default:_0x5ce1f7[_0x3e33('0x40')]=!![];_0x5ce1f7['queuecallerexitAt']=moment()[_0x3e33('0x58')](_0x3e33('0x88'));_0x5ce1f7[_0x3e33('0xac')]=moment()[_0x3e33('0x58')](_0x3e33('0x88'));}_0x5ce1f7[_0x3e33('0x21')]=![];_0x5ce1f7[_0x3e33('0x87')]=null;_0x5ce1f7['queuecallerexitreason']=_0x15130a['value'];this[_0x3e33('0x13')][_0x15130a[_0x3e33('0x56')]]=_0x5ce1f7;this['emitVoiceQueueChannelRemove'](_0x5ce1f7,_0x3e33('0x29'));}else if(this[_0x3e33('0x64')](_0x15130a[_0x3e33('0xa8')])&&this[_0x3e33('0x64')](_0x15130a['variable'][_0x3e33('0xae')])){if(!_0x5ce1f7[_0x3e33('0x21')]){_0x5ce1f7['queuecallerexit']=!![];_0x5ce1f7['queuecallerexitAt']=moment()[_0x3e33('0x58')](_0x3e33('0x88'));_0x5ce1f7[_0x3e33('0x5d')]='EXITWITHKEY';_0x5ce1f7['queuecallerleaveAt']=moment()[_0x3e33('0x58')](_0x3e33('0x88'));this[_0x3e33('0x13')][_0x15130a['uniqueid']]=_0x5ce1f7;}}logger[_0x3e33('0x7d')](_0x3e33('0xaf'),_0x15130a[_0x3e33('0x56')],_0x5ce1f7[_0x3e33('0x5a')],_0x5ce1f7['type'],_['keys'](_0x15130a[_0x3e33('0xa8')])[0x0],_0x15130a[_0x3e33('0xa9')]);_0x5ce1f7[_0x3e33('0x4d')]=this[_0x3e33('0x4d')][_0x15130a[_0x3e33('0x56')]];}}}}catch(_0xab00c7){logger['error'](_0x3e33('0xa6'),_0x15130a[_0x3e33('0x56')],util[_0x3e33('0x49')](_0xab00c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3e33('0xa7')]=function(_0x501e74,_0x408e96,_0x30030c){var _0x3700cd=[_0x3e33('0xb0'),'rtpaudioqosbridged',_0x3e33('0xb1'),_0x3e33('0xb2'),_0x3e33('0xb3'),_0x3e33('0xb4'),_0x3e33('0xb5'),_0x3e33('0xb6'),_0x3e33('0xb7'),_0x3e33('0xb8'),_0x3e33('0xb9'),'bridgepvtcallid',_0x3e33('0xba'),_0x3e33('0xbb'),'memberinterface',_0x3e33('0xbc'),_0x3e33('0x95'),'memberpenalty',_0x3e33('0xbd')];if(!_[_0x3e33('0x43')](_0x408e96)&&!_['includes'](_0x3700cd,_0x408e96)){if(_[_0x3e33('0x65')](this[_0x3e33('0x4d')][_0x501e74])){this['variables'][_0x501e74]={};}this[_0x3e33('0x4d')][_0x501e74][_0x408e96]=_0x30030c;}};VoiceQueueReport[_0x3e33('0xe')][_0x3e33('0xbe')]=function(_0x58fced,_0x11dbe6,_0xe09286){try{var _0x31949c={};if(this[_0x3e33('0x4a')][_0x58fced]){for(var _0x1818a0=0x0;_0x1818a00x0?!![]:![];if(!_0x5a3bf7){return this[_0x4bb3('0x6e')](this[_0x4bb3('0x17')]['completeEvent']);}};VoiceQueueReport[_0x4bb3('0xc')]['syncQueueMember']=function(_0x362326){var _0x519173=this['summary']['id'];if(this[_0x4bb3('0x17')][_0x4bb3('0x61')][_0x519173]&&this['summary']['queuestatus'][_0x519173][_0x362326['actionid']]){this[_0x4bb3('0x17')][_0x4bb3('0x61')][_0x519173][_0x362326['actionid']][_0x4bb3('0x12')][_0x4bb3('0x6f')](_0x362326);}};VoiceQueueReport[_0x4bb3('0xc')][_0x4bb3('0x19')]=function(_0x113a5e){var _0x498922=this;try{if(this['isNotNull'](_0x113a5e)&&this[_0x4bb3('0x5b')](_0x113a5e[_0x4bb3('0x56')])){logger[_0x4bb3('0x4c')](_0x4bb3('0x70'),util[_0x4bb3('0x45')](_0x113a5e,{'showHidden':![],'depth':null}));var _0x332802=this['voiceQueues'][_0x113a5e[_0x4bb3('0x56')]];if(_0x332802){logger[_0x4bb3('0x4c')](_0x4bb3('0x71'),_0x332802[_0x4bb3('0x5a')]);this[_0x4bb3('0x17')]['queues'][_0x332802['name']]={'summaryEvent':_0x113a5e};this[_0x4bb3('0x17')][_0x4bb3('0x6d')]+=0x1;return ami['Action']({'action':_0x4bb3('0x61'),'queue':_0x332802['name']})[_0x4bb3('0x5f')](function(_0x41d2cd){if(!_0x498922[_0x4bb3('0x17')][_0x4bb3('0x61')][_0x113a5e[_0x4bb3('0x60')]]){_0x498922[_0x4bb3('0x17')][_0x4bb3('0x61')][_0x113a5e[_0x4bb3('0x60')]]={};}_0x498922[_0x4bb3('0x17')][_0x4bb3('0x61')][_0x113a5e['actionid']][_0x41d2cd['actionid']]={'queue':_0x332802[_0x4bb3('0x5a')],'agents':[]};})[_0x4bb3('0x40')](function(_0x1b843a){throw _0x1b843a;});}}}catch(_0x109b26){logger[_0x4bb3('0x42')](_0x4bb3('0x62'),util['inspect'](_0x109b26,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4bb3('0x6e')]=function(_0x339e4c){if(this[_0x4bb3('0x17')][_0x4bb3('0x6d')]>0x0){this[_0x4bb3('0x17')][_0x4bb3('0x72')]=_0x339e4c;return;}logger[_0x4bb3('0x4c')](_0x4bb3('0x73'),util[_0x4bb3('0x45')](_0x339e4c,{'showHidden':![],'depth':null}));this[_0x4bb3('0x17')]=initializeSummary();ami[_0x4bb3('0x4a')](_0x4bb3('0x74'),{});};VoiceQueueReport['prototype'][_0x4bb3('0x21')]=function(_0x1e2253){try{if(this[_0x4bb3('0x5b')](_0x1e2253)){logger[_0x4bb3('0x4c')](_0x4bb3('0x75'),_0x1e2253[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x1e2253,{'showHidden':![],'depth':null}));if(_[_0x4bb3('0x5c')](this[_0x4bb3('0x10')][_0x1e2253['uniqueid']])){this[_0x4bb3('0x10')][_0x1e2253[_0x4bb3('0x4e')]]=[];}if(_[_0x4bb3('0x5c')](this[_0x4bb3('0x13')][_0x1e2253[_0x4bb3('0x4e')]])){this[_0x4bb3('0x13')][_0x1e2253[_0x4bb3('0x4e')]]={};}var _0x16a8da=new QueueReport();_0x16a8da[_0x4bb3('0x56')]=_0x1e2253['queue'];_0x16a8da[_0x4bb3('0x6a')]=this['voiceQueues'][_0x16a8da['queue']]&&this[_0x4bb3('0x15')][_0x16a8da['queue']][_0x4bb3('0x6a')]?this[_0x4bb3('0x15')][_0x16a8da[_0x4bb3('0x56')]][_0x4bb3('0x6a')]||_0x4bb3('0x6b'):_0x4bb3('0x6b');_0x16a8da[_0x4bb3('0x76')]=moment()[_0x4bb3('0x4f')](_0x4bb3('0x77'));_0x16a8da['position']=_0x1e2253[_0x4bb3('0x78')];_0x16a8da['count']=_0x1e2253[_0x4bb3('0x79')];_0x16a8da['uniqueid']=_0x1e2253[_0x4bb3('0x4e')];_0x16a8da[_0x4bb3('0x7a')]=this['channels'][_0x1e2253['uniqueid']][_0x4bb3('0x7a')];logger[_0x4bb3('0x7b')](_0x4bb3('0x7c'),_0x16a8da[_0x4bb3('0x56')],_0x16a8da[_0x4bb3('0x6a')]);Object['assign'](_0x16a8da,_[_0x4bb3('0x7d')](_0x1e2253,_[_0x4bb3('0x7e')](_0x16a8da)));this[_0x4bb3('0x10')][_0x1e2253[_0x4bb3('0x4e')]]['push'](_0x16a8da);this[_0x4bb3('0x13')][_0x1e2253[_0x4bb3('0x4e')]]=_0x16a8da;this[_0x4bb3('0x4b')](_0x16a8da,_0x4bb3('0x20'));}}catch(_0x5cc977){logger[_0x4bb3('0x42')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1e2253[_0x4bb3('0x4e')],util['inspect'](_0x5cc977,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0xf2dae7){try{if(this[_0x4bb3('0x5b')](_0xf2dae7)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0xf2dae7['uniqueid'],util['inspect'](_0xf2dae7,{'showHidden':![],'depth':null}));if(this[_0x4bb3('0x10')][_0xf2dae7[_0x4bb3('0x4e')]]){var _0x5228d3=_[_0x4bb3('0x7f')](this['queueReports'][_0xf2dae7[_0x4bb3('0x4e')]]);_0x5228d3[_0x4bb3('0x80')]=![];_0x5228d3[_0x4bb3('0x81')]=null;_0x5228d3[_0x4bb3('0x82')]=_0xf2dae7['holdtime'];_0x5228d3[_0x4bb3('0x83')]=_0xf2dae7[_0x4bb3('0x83')];_0x5228d3[_0x4bb3('0x22')]=!![];_0x5228d3['queuecallerabandonAt']=moment()[_0x4bb3('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5228d3[_0x4bb3('0x54')]=_0x4bb3('0x84');_0x5228d3[_0x4bb3('0x85')]=null;logger[_0x4bb3('0x7b')](_0x4bb3('0x86'),_0x5228d3['queue'],_0x5228d3['type']);this[_0x4bb3('0x13')][_0xf2dae7[_0x4bb3('0x4e')]]=_0x5228d3;this[_0x4bb3('0x48')](_0x5228d3,_0x4bb3('0x22'));}}}catch(_0x471e29){logger[_0x4bb3('0x42')](_0x4bb3('0x87'),_0xf2dae7[_0x4bb3('0x4e')],util['inspect'](_0x471e29,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bb3('0xc')][_0x4bb3('0x23')]=function(_0x1a76d1){try{if(this[_0x4bb3('0x5b')](_0x1a76d1)){logger[_0x4bb3('0x4c')](_0x4bb3('0x88'),_0x1a76d1[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x1a76d1,{'showHidden':![],'depth':null}));if(this[_0x4bb3('0x10')][_0x1a76d1[_0x4bb3('0x4e')]]){var _0x2cb6a2=_[_0x4bb3('0x7f')](this[_0x4bb3('0x10')][_0x1a76d1[_0x4bb3('0x4e')]]);_0x2cb6a2[_0x4bb3('0x89')]=moment()[_0x4bb3('0x4f')](_0x4bb3('0x77'));_0x2cb6a2[_0x4bb3('0x8a')]=_0x1a76d1['connectedlinenum'];_0x2cb6a2['connectedlinename']=_0x1a76d1[_0x4bb3('0x8b')];logger[_0x4bb3('0x7b')](_0x4bb3('0x8c'),_0x2cb6a2['queue'],_0x2cb6a2['type'],_0x1a76d1[_0x4bb3('0x8a')],_0x1a76d1[_0x4bb3('0x8b')]);this['channels'][_0x1a76d1['uniqueid']]=_0x2cb6a2;this['emitVoiceQueueChannelSave'](_0x2cb6a2,'queuecallerleave');}}}catch(_0x5ba3a3){logger['error'](_0x4bb3('0x88'),_0x1a76d1[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x5ba3a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bb3('0xc')]['syncAgentConnect']=function(_0x2e8fc6){try{if(this[_0x4bb3('0x5b')](_0x2e8fc6)){logger['debug'](_0x4bb3('0x8d'),_0x2e8fc6[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x2e8fc6,{'showHidden':![],'depth':null}));if(this[_0x4bb3('0x10')][_0x2e8fc6['uniqueid']]){var _0x423ac5=_['last'](this[_0x4bb3('0x10')][_0x2e8fc6['uniqueid']]);_0x423ac5[_0x4bb3('0x80')]=!![];_0x423ac5[_0x4bb3('0x54')]=_0x4bb3('0x8e');logger[_0x4bb3('0x7b')](_0x4bb3('0x8f'),_0x423ac5[_0x4bb3('0x56')],_0x423ac5[_0x4bb3('0x6a')]);}}}catch(_0x32f0f6){logger['error'](_0x4bb3('0x8d'),_0x2e8fc6[_0x4bb3('0x4e')],util['inspect'](_0x32f0f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bb3('0xc')]['syncAgentComplete']=function(_0x3c27fe){try{if(this[_0x4bb3('0x5b')](_0x3c27fe)){logger[_0x4bb3('0x4c')](_0x4bb3('0x90'),_0x3c27fe[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x3c27fe,{'showHidden':![],'depth':null}));if(this[_0x4bb3('0x10')][_0x3c27fe['uniqueid']]){var _0x2f5cdb=_[_0x4bb3('0x7f')](this[_0x4bb3('0x10')][_0x3c27fe[_0x4bb3('0x4e')]]);_0x2f5cdb[_0x4bb3('0x22')]=![];_0x2f5cdb[_0x4bb3('0x91')]=null;_0x2f5cdb[_0x4bb3('0x92')]=!![];_0x2f5cdb[_0x4bb3('0x85')]=_0x3c27fe[_0x4bb3('0x93')];_0x2f5cdb[_0x4bb3('0x82')]=_0x3c27fe[_0x4bb3('0x82')];_0x2f5cdb['queuecallercomplete']=!![];_0x2f5cdb[_0x4bb3('0x39')]=![];_0x2f5cdb[_0x4bb3('0x94')]=null;if(!_0x2f5cdb['transfer']){if(_0x3c27fe[_0x4bb3('0x95')]=='transfer'){_0x2f5cdb['queuecallerexitreason']='COMPLETED';logger['info'](_0x4bb3('0x96'),_0x2f5cdb[_0x4bb3('0x56')],_0x2f5cdb[_0x4bb3('0x6a')]);}else{if(_['startsWith'](_0x3c27fe[_0x4bb3('0x3f')][_0x4bb3('0x97')](),_0x4bb3('0x98'))){if(this['queueReports'][_0x3c27fe['linkedid']]){var _0x4745a4=_[_0x4bb3('0x7f')](this[_0x4bb3('0x10')][_0x3c27fe[_0x4bb3('0x99')]]);_0x4745a4[_0x4bb3('0x80')]=![];_0x4745a4[_0x4bb3('0x39')]=!![];_0x4745a4['queuecallerexitAt']=moment(_0x2f5cdb['queuecallerjoinAt'])['add'](_0x3c27fe[_0x4bb3('0x82')],'seconds')[_0x4bb3('0x4f')](_0x4bb3('0x77'));_0x4745a4[_0x4bb3('0x54')]=_0x4bb3('0x9a');_0x4745a4[_0x4bb3('0x9b')]=!![];_0x4745a4[_0x4bb3('0x9c')]=_0x4bb3('0x9d');_0x4745a4[_0x4bb3('0x9e')]=_0x3c27fe[_0x4bb3('0x9f')];_0x4745a4['transferuniqueid']=_0x3c27fe[_0x4bb3('0x4e')];logger['info'](_0x4bb3('0xa0'),_0x4745a4[_0x4bb3('0x56')],_0x4745a4['type']);var _0x380620=this[_0x4bb3('0x10')][_0x3c27fe[_0x4bb3('0x99')]];this['queueReports'][_0x3c27fe[_0x4bb3('0x99')]]=this[_0x4bb3('0x10')][_0x3c27fe[_0x4bb3('0x4e')]];this['queueReports'][_0x3c27fe[_0x4bb3('0x4e')]]=_0x380620;}}else{_0x2f5cdb[_0x4bb3('0x54')]=_0x4bb3('0xa1')+_0x3c27fe[_0x4bb3('0x95')][_0x4bb3('0xa2')]();logger[_0x4bb3('0x7b')](_0x4bb3('0xa3'),_0x2f5cdb[_0x4bb3('0x56')],_0x2f5cdb[_0x4bb3('0x6a')],_0x2f5cdb[_0x4bb3('0x54')]);}}}this['channels'][_0x3c27fe[_0x4bb3('0x4e')]]=_0x2f5cdb;}}}catch(_0x4ed7b7){logger[_0x4bb3('0x42')](_0x4bb3('0x90'),_0x3c27fe[_0x4bb3('0x4e')],util['inspect'](_0x4ed7b7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x4bb3('0xa4')]=function(_0x24d992){try{if(this[_0x4bb3('0x5b')](_0x24d992)){logger[_0x4bb3('0x4c')](_0x4bb3('0xa5'),_0x24d992[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x24d992,{'showHidden':![],'depth':null}));this['addVariable'](_0x24d992[_0x4bb3('0x4e')],_[_0x4bb3('0x7e')](_0x24d992[_0x4bb3('0xa6')])[0x0],_0x24d992[_0x4bb3('0xa7')]);if(this[_0x4bb3('0x10')][_0x24d992[_0x4bb3('0x4e')]]){var _0x84f400=_[_0x4bb3('0x7f')](this[_0x4bb3('0x10')][_0x24d992['uniqueid']]);if(_0x84f400){if(this[_0x4bb3('0x5b')](_0x24d992['variable'])&&this[_0x4bb3('0x5b')](_0x24d992[_0x4bb3('0xa6')][_0x4bb3('0x61')])){switch(_0x24d992[_0x4bb3('0xa7')]){case'CONTINUE':_0x84f400['queuecallerexit']=![];_0x84f400[_0x4bb3('0x94')]=null;break;case _0x4bb3('0xa8'):_0x84f400[_0x4bb3('0xa9')]=_0x4bb3('0xaa');_0x84f400['queuecallerexit']=!![];_0x84f400['queuecallerexitAt']=moment()[_0x4bb3('0x4f')](_0x4bb3('0x77'));_0x84f400[_0x4bb3('0x89')]=moment()[_0x4bb3('0x4f')](_0x4bb3('0x77'));logger['debug'](_0x4bb3('0xab'),_0x24d992[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x84f400,{'showHidden':![],'depth':null}));ami[_0x4bb3('0x4a')](_0x4bb3('0xac'),_0x84f400);break;default:_0x84f400['queuecallerexit']=!![];_0x84f400[_0x4bb3('0x94')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x84f400[_0x4bb3('0x89')]=moment()[_0x4bb3('0x4f')](_0x4bb3('0x77'));}_0x84f400['queuecallerabandon']=![];_0x84f400[_0x4bb3('0x91')]=null;_0x84f400[_0x4bb3('0x54')]=_0x24d992[_0x4bb3('0xa7')];this[_0x4bb3('0x13')][_0x24d992[_0x4bb3('0x4e')]]=_0x84f400;this['emitVoiceQueueChannelRemove'](_0x84f400,_0x4bb3('0x28'));}else if(this[_0x4bb3('0x5b')](_0x24d992['variable'])&&this['isNotNull'](_0x24d992['variable']['queueposition'])){if(!_0x84f400[_0x4bb3('0x22')]){_0x84f400[_0x4bb3('0x39')]=!![];_0x84f400['queuecallerexitAt']=moment()['format'](_0x4bb3('0x77'));_0x84f400['queuecallerexitreason']='EXITWITHKEY';_0x84f400['queuecallerleaveAt']=moment()[_0x4bb3('0x4f')](_0x4bb3('0x77'));this[_0x4bb3('0x13')][_0x24d992[_0x4bb3('0x4e')]]=_0x84f400;}}logger[_0x4bb3('0x7b')](_0x4bb3('0xad'),_0x24d992[_0x4bb3('0x4e')],_0x84f400['queue'],_0x84f400[_0x4bb3('0x6a')],_[_0x4bb3('0x7e')](_0x24d992[_0x4bb3('0xa6')])[0x0],_0x24d992['value']);_0x84f400[_0x4bb3('0xae')]=this[_0x4bb3('0xae')][_0x24d992[_0x4bb3('0x4e')]];}}}}catch(_0x22ce67){logger[_0x4bb3('0x42')](_0x4bb3('0xa5'),_0x24d992[_0x4bb3('0x4e')],util[_0x4bb3('0x45')](_0x22ce67,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x4bb3('0xc')]['addVariable']=function(_0x5ba3ec,_0x9b007d,_0x4ef53b){var _0xb2812d=['rtpaudioqos','rtpaudioqosbridged',_0x4bb3('0xaf'),'rtpaudioqosjitterbridged','rtpaudioqosloss',_0x4bb3('0xb0'),_0x4bb3('0xb1'),_0x4bb3('0xb2'),_0x4bb3('0xb3'),_0x4bb3('0xb4'),_0x4bb3('0xb5'),_0x4bb3('0xb6'),_0x4bb3('0xb7'),_0x4bb3('0xb8'),_0x4bb3('0xb9'),_0x4bb3('0xba'),'membername','memberpenalty',_0x4bb3('0xbb')];if(!_[_0x4bb3('0x3c')](_0x9b007d)&&!_['includes'](_0xb2812d,_0x9b007d)){if(_[_0x4bb3('0x5c')](this[_0x4bb3('0xae')][_0x5ba3ec])){this[_0x4bb3('0xae')][_0x5ba3ec]={};}this[_0x4bb3('0xae')][_0x5ba3ec][_0x9b007d]=_0x4ef53b;}};VoiceQueueReport[_0x4bb3('0xc')][_0x4bb3('0xbc')]=function(_0x45584f,_0x26f8b3,_0x594ef9){try{var _0x1a3baf={};if(this[_0x4bb3('0x10')][_0x45584f]){for(var _0x5134c2=0x0;_0x5134c2=0x0?moment(_0x58527e[_0x57b2('0x19')])[_0x57b2('0xf')](_0x58527e[_0x57b2('0x1a')],_0x57b2('0x1b')):null,'data1':'outbound','data2':_0x58527e[_0x57b2('0x13')],'data3':_0x58527e[_0x57b2('0x11')],'data4':_0x58527e[_0x57b2('0x1c')]||null,'role':_0x57b2('0x12'),'internal':_0x58527e[_0x57b2('0x13')]?_[_0x57b2('0x14')](_0x58527e[_0x57b2('0x13')]):undefined,'uniqueid':_0x58527e[_0x57b2('0x15')]},'log':_0x57b2('0x6')});}; \ No newline at end of file +var _0xab88=['../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','CreateMemberReport','lastAssignedTo','isNil','interface','format','SIP/%s','queuecallerleaveAt','seconds','exten','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','Request','voice','membername','starttime','endtime','diff','dialstring','moment','lodash'];(function(_0x251813,_0x50e435){var _0x2c6af2=function(_0x4e5643){while(--_0x4e5643){_0x251813['push'](_0x251813['shift']());}};_0x2c6af2(++_0x50e435);}(_0xab88,0x1a2));var _0x8ab8=function(_0x508926,_0xa05b4f){_0x508926=_0x508926-0x0;var _0x49ab00=_0xab88[_0x508926];return _0x49ab00;};'use strict';var moment=require(_0x8ab8('0x0'));var _=require(_0x8ab8('0x1'));var util=require('util');var client=require(_0x8ab8('0x2'));exports[_0x8ab8('0x3')]=function(_0x22ec5c){var _0x31990a=_0x22ec5c[_0x8ab8('0x4')]||_0x22ec5c[_0x8ab8('0x5')];return client['Request'](_0x8ab8('0x6'),{'body':{'channel':'voice','membername':_0x22ec5c[_0x8ab8('0x7')],'interface':_[_0x8ab8('0x8')](_0x22ec5c[_0x8ab8('0x9')])?util[_0x8ab8('0xa')](_0x8ab8('0xb'),_0x22ec5c[_0x8ab8('0x7')]):_0x22ec5c[_0x8ab8('0x9')],'type':'TALKING','enterAt':_0x22ec5c[_0x8ab8('0xc')],'exitAt':_0x31990a,'duration':moment(_0x31990a)['diff'](_0x22ec5c[_0x8ab8('0xc')],_0x8ab8('0xd')),'data1':'inbound','data2':_0x22ec5c['calleridnum'],'data3':_0x22ec5c[_0x8ab8('0xe')],'data4':null,'data5':_0x22ec5c[_0x8ab8('0xf')],'role':_0x8ab8('0x10'),'internal':_0x22ec5c[_0x8ab8('0x11')]?_[_0x8ab8('0x12')](_0x22ec5c['accountcode']):undefined,'uniqueid':_0x22ec5c[_0x8ab8('0x13')]},'log':_0x8ab8('0x6')});};exports[_0x8ab8('0x14')]=function(_0x386b7c){return client[_0x8ab8('0x15')](_0x8ab8('0x6'),{'body':{'channel':_0x8ab8('0x16'),'membername':_0x386b7c[_0x8ab8('0x17')],'interface':_0x386b7c[_0x8ab8('0x9')],'type':'TALKING','enterAt':_0x386b7c[_0x8ab8('0x18')],'exitAt':_0x386b7c['endtime'],'duration':moment(_0x386b7c[_0x8ab8('0x19')])[_0x8ab8('0x1a')](_0x386b7c[_0x8ab8('0x18')],_0x8ab8('0xd'))>=0x0?moment(_0x386b7c[_0x8ab8('0x19')])[_0x8ab8('0x1a')](_0x386b7c[_0x8ab8('0x18')],'seconds'):null,'data1':'outbound','data2':_0x386b7c[_0x8ab8('0x11')],'data3':_0x386b7c['exten'],'data4':_0x386b7c[_0x8ab8('0x1b')]||null,'role':'agent','internal':_0x386b7c[_0x8ab8('0x11')]?_['toNumber'](_0x386b7c[_0x8ab8('0x11')]):undefined,'uniqueid':_0x386b7c[_0x8ab8('0x13')]},'log':_0x8ab8('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 6863a4e..6fd8ae6 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 _0xbb84=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xbb84,0x158));var _0x4bb8=function(_0x590deb,_0x249ee5){_0x590deb=_0x590deb-0x0;var _0x1b0022=_0xbb84[_0x590deb];return _0x1b0022;};'use strict';var client=require(_0x4bb8('0x0'));exports[_0x4bb8('0x1')]=function(){return client[_0x4bb8('0x2')](_0x4bb8('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x4bb8('0x4')]},'log':_0x4bb8('0x5')});}; \ No newline at end of file +var _0x96f9=['previewRecallmeReminderInterval','GetSettings','../client','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2947d1,_0x5e70b0){var _0x2b36a5=function(_0x37637c){while(--_0x37637c){_0x2947d1['push'](_0x2947d1['shift']());}};_0x2b36a5(++_0x5e70b0);}(_0x96f9,0x64));var _0x996f=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x96f9[_0x17d9e3];return _0x14192d;};'use strict';var client=require(_0x996f('0x0'));exports[_0x996f('0x1')]=function(){return client[_0x996f('0x2')](_0x996f('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x996f('0x4'),_0x996f('0x5')]},'log':_0x996f('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 3bdfdde..ffd43cd 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 _0x0729=['html','GetTemplate','getTemplates','Request','name'];(function(_0x462bff,_0x151a16){var _0x27229a=function(_0x223b61){while(--_0x223b61){_0x462bff['push'](_0x462bff['shift']());}};_0x27229a(++_0x151a16);}(_0x0729,0x98));var _0x9072=function(_0x508823,_0x316707){_0x508823=_0x508823-0x0;var _0x13523b=_0x0729[_0x508823];return _0x13523b;};'use strict';var client=require('../client');exports[_0x9072('0x0')]=function(_0x2aa9dc){return function(_0x4142e1){return client[_0x9072('0x1')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x9072('0x2'),_0x9072('0x3')]},'log':_0x9072('0x4')});};}; \ No newline at end of file +var _0x73aa=['GetTemplate','name','Request'];(function(_0x4acb39,_0x3cdf16){var _0x18d1fd=function(_0x4da001){while(--_0x4da001){_0x4acb39['push'](_0x4acb39['shift']());}};_0x18d1fd(++_0x3cdf16);}(_0x73aa,0x1eb));var _0xa73a=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x73aa[_0x42f009];return _0x22a1e0;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x3ad4c0){return function(_0x408f02){return client[_0xa73a('0x0')](_0xa73a('0x1'),{'options':{'raw':!![],'attributes':['id',_0xa73a('0x2'),'html']},'log':_0xa73a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3869d82..c07dd3b 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 _0x1713=['field','operator','value','AnyConditions','Action','Actions','data2','data3','data5','data6','data7','GetTrigger','../client','getTriggers','Request','name','status','Condition'];(function(_0x7d56e8,_0x47517f){var _0x24ee69=function(_0x4440ad){while(--_0x4440ad){_0x7d56e8['push'](_0x7d56e8['shift']());}};_0x24ee69(++_0x47517f);}(_0x1713,0x174));var _0x3171=function(_0x544e42,_0x560987){_0x544e42=_0x544e42-0x0;var _0x3bbe4d=_0x1713[_0x544e42];return _0x3bbe4d;};'use strict';var client=require(_0x3171('0x0'));exports[_0x3171('0x1')]=function(_0x4d0c9a){return function(_0x4aba81){return client[_0x3171('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x3171('0x3'),'channel',_0x3171('0x4')],'include':[{'model':_0x3171('0x5'),'as':'AllConditions','attributes':['id',_0x3171('0x6'),_0x3171('0x7'),_0x3171('0x8')]},{'model':_0x3171('0x5'),'as':_0x3171('0x9'),'attributes':['id','field','operator','value']},{'model':_0x3171('0xa'),'as':_0x3171('0xb'),'attributes':['id','action','data1',_0x3171('0xc'),_0x3171('0xd'),'data4',_0x3171('0xe'),_0x3171('0xf'),_0x3171('0x10')]}]},'log':_0x3171('0x11')});};}; \ No newline at end of file +var _0x224e=['channel','Condition','operator','value','AnyConditions','field','Action','Actions','data1','data2','data3','data4','data5','data6','GetTrigger','../client','getTriggers','Request','name'];(function(_0x4b5d8d,_0x61becb){var _0x2c91d4=function(_0x36e7f0){while(--_0x36e7f0){_0x4b5d8d['push'](_0x4b5d8d['shift']());}};_0x2c91d4(++_0x61becb);}(_0x224e,0x1b1));var _0xe224=function(_0x57f7dd,_0x24647b){_0x57f7dd=_0x57f7dd-0x0;var _0x483894=_0x224e[_0x57f7dd];return _0x483894;};'use strict';var client=require(_0xe224('0x0'));exports[_0xe224('0x1')]=function(_0x3b7c16){return function(_0x5d9e27){return client[_0xe224('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xe224('0x3'),_0xe224('0x4'),'status'],'include':[{'model':_0xe224('0x5'),'as':'AllConditions','attributes':['id','field',_0xe224('0x6'),_0xe224('0x7')]},{'model':_0xe224('0x5'),'as':_0xe224('0x8'),'attributes':['id',_0xe224('0x9'),_0xe224('0x6'),_0xe224('0x7')]},{'model':_0xe224('0xa'),'as':_0xe224('0xb'),'attributes':['id','action',_0xe224('0xc'),_0xe224('0xd'),_0xe224('0xe'),_0xe224('0xf'),_0xe224('0x10'),_0xe224('0x11'),'data7']}]},'log':_0xe224('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e48197e..4ca6f63 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 _0x9831=['../client','getTrunks','Request','name','registry','defaultuser','GetTrunk'];(function(_0x3d9092,_0x5f13bf){var _0x10840c=function(_0x26ddf1){while(--_0x26ddf1){_0x3d9092['push'](_0x3d9092['shift']());}};_0x10840c(++_0x5f13bf);}(_0x9831,0xfc));var _0x1983=function(_0x3cdaca,_0x3306b8){_0x3cdaca=_0x3cdaca-0x0;var _0x52b784=_0x9831[_0x3cdaca];return _0x52b784;};'use strict';var client=require(_0x1983('0x0'));exports[_0x1983('0x1')]=function(_0x182798){return function(_0x6ae3eb){return client[_0x1983('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x1983('0x3'),_0x1983('0x4'),_0x1983('0x5')]},'log':_0x1983('0x6')});};}; \ No newline at end of file +var _0x9f3c=['getTrunks','Request','GetTrunk','registry','defaultuser','../client'];(function(_0x5e4278,_0x53ed71){var _0x2b35fe=function(_0x172b6f){while(--_0x172b6f){_0x5e4278['push'](_0x5e4278['shift']());}};_0x2b35fe(++_0x53ed71);}(_0x9f3c,0x12b));var _0xc9f3=function(_0x1ec7ba,_0x13ab92){_0x1ec7ba=_0x1ec7ba-0x0;var _0x2dee18=_0x9f3c[_0x1ec7ba];return _0x2dee18;};'use strict';var client=require(_0xc9f3('0x0'));exports[_0xc9f3('0x1')]=function(_0x1a88be){return function(_0x496a87){return client[_0xc9f3('0x2')](_0xc9f3('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xc9f3('0x4'),_0xc9f3('0x5')]},'log':_0xc9f3('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 065bed4..a637f41 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(_0x394477,_0x2a8978){var _0x40ae46=function(_0x22d6ac){while(--_0x22d6ac){_0x394477['push'](_0x394477['shift']());}};_0x40ae46(++_0x2a8978);}(_0x70e0,0x17b));var _0x070e=function(_0x5a94e6,_0x15bc3f){_0x5a94e6=_0x5a94e6-0x0;var _0x5b9e01=_0x70e0[_0x5a94e6];return _0x5b9e01;};'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(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xe706,0xa3));var _0x6e70=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0xe706[_0x1aab74];return _0x396af2;};'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 e95bc2f..aa04ac3 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 _0xca6e=['update','../client','CreateVoiceAgentReport'];(function(_0x4dab17,_0x26ca58){var _0x386cc8=function(_0x3c4582){while(--_0x3c4582){_0x4dab17['push'](_0x4dab17['shift']());}};_0x386cc8(++_0x26ca58);}(_0xca6e,0x1e4));var _0xeca6=function(_0x1330ca,_0x1b6437){_0x1330ca=_0x1330ca-0x0;var _0x3c1c5c=_0xca6e[_0x1330ca];return _0x3c1c5c;};'use strict';var client=require(_0xeca6('0x0'));exports['create']=function(_0x1b4f68){return client['Request'](_0xeca6('0x1'),{'body':_0x1b4f68,'log':_0xeca6('0x1')});};exports[_0xeca6('0x2')]=function(_0x3bce05,_0x53ea95,_0x16a7e0){return client['Request']('UpdateVoiceAgentReport',{'body':_0x3bce05,'options':{'where':{'uniqueid':_0x53ea95,'interface':_0x16a7e0,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x658f=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0xecdc8,_0x37baa2){var _0x494fab=function(_0x3bf51e){while(--_0x3bf51e){_0xecdc8['push'](_0xecdc8['shift']());}};_0x494fab(++_0x37baa2);}(_0x658f,0x153));var _0xf658=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x658f[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xf658('0x0'));exports['create']=function(_0x2581fd){return client[_0xf658('0x1')]('CreateVoiceAgentReport',{'body':_0x2581fd,'log':_0xf658('0x2')});};exports['update']=function(_0x5657a2,_0x16a8b0,_0x575279){return client['Request'](_0xf658('0x3'),{'body':_0x5657a2,'options':{'where':{'uniqueid':_0x16a8b0,'interface':_0x575279,'agentcomplete':!![]}},'log':_0xf658('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 9f8a77a..6a6b914 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 _0x3014=['callerid','DOCUMENTATION','CreateVoiceCallReport','Request','GetVoiceCallReport','outbound','startOf','day','format','endOf','type','disposition','billableseconds','GetVoiceCallReports','util','lodash','../client','create','merge','calleridnum','context'];(function(_0x443a50,_0x58d8df){var _0x1c98f3=function(_0x38dd1e){while(--_0x38dd1e){_0x443a50['push'](_0x443a50['shift']());}};_0x1c98f3(++_0x58d8df);}(_0x3014,0x19d));var _0x4301=function(_0x25bb8d,_0x3c93d3){_0x25bb8d=_0x25bb8d-0x0;var _0x3c6213=_0x3014[_0x25bb8d];return _0x3c6213;};'use strict';var moment=require('moment');var util=require(_0x4301('0x0'));var _=require(_0x4301('0x1'));var client=require(_0x4301('0x2'));exports[_0x4301('0x3')]=function(_0x5e868b){return client['Request']('CreateVoiceCallReport',{'body':_[_0x4301('0x4')](_0x5e868b,{'source':_0x5e868b[_0x4301('0x5')],'destinationcontext':_0x5e868b[_0x4301('0x6')],'callerid':_0x5e868b[_0x4301('0x7')],'amaflags':_0x4301('0x8')}),'log':_0x4301('0x9')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x4301('0xa')](_0x4301('0xb'),{'options':{'where':{'type':[_0x4301('0xc')],'createdAt':{'$between':[moment()[_0x4301('0xd')](_0x4301('0xe'))[_0x4301('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x4301('0x10')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x4301('0x11'),_0x4301('0x12'),'duration',_0x4301('0x13')]},'log':_0x4301('0x14')});};}; \ No newline at end of file +var _0x4958=['billableseconds','GetVoiceCallReports','moment','util','create','Request','CreateVoiceCallReport','merge','context','callerid','getVoiceCallReports','GetVoiceCallReport','day','endOf','type','disposition'];(function(_0x153075,_0xe98537){var _0x594ae9=function(_0xc79fed){while(--_0xc79fed){_0x153075['push'](_0x153075['shift']());}};_0x594ae9(++_0xe98537);}(_0x4958,0x82));var _0x8495=function(_0x5dbff5,_0x5153c9){_0x5dbff5=_0x5dbff5-0x0;var _0xfbd3f5=_0x4958[_0x5dbff5];return _0xfbd3f5;};'use strict';var moment=require(_0x8495('0x0'));var util=require(_0x8495('0x1'));var _=require('lodash');var client=require('../client');exports[_0x8495('0x2')]=function(_0x48a071){return client[_0x8495('0x3')](_0x8495('0x4'),{'body':_[_0x8495('0x5')](_0x48a071,{'source':_0x48a071['calleridnum'],'destinationcontext':_0x48a071[_0x8495('0x6')],'callerid':_0x48a071[_0x8495('0x7')],'amaflags':'DOCUMENTATION'}),'log':_0x8495('0x4')});};exports[_0x8495('0x8')]=function(){return function(){return client['Request'](_0x8495('0x9'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0x8495('0xa'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x8495('0xb')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0x8495('0xc'),_0x8495('0xd'),'duration',_0x8495('0xe')]},'log':_0x8495('0xf')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index c5c36d2..3b959f9 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 _0xdf70=['CreateVoiceDialReport','../client','create'];(function(_0x368d10,_0x37c81c){var _0x1eb59e=function(_0x2c64f3){while(--_0x2c64f3){_0x368d10['push'](_0x368d10['shift']());}};_0x1eb59e(++_0x37c81c);}(_0xdf70,0xd9));var _0x0df7=function(_0x2bd453,_0x322572){_0x2bd453=_0x2bd453-0x0;var _0x36c295=_0xdf70[_0x2bd453];return _0x36c295;};'use strict';var client=require(_0x0df7('0x0'));exports[_0x0df7('0x1')]=function(_0x26ecd8){return client['Request'](_0x0df7('0x2'),{'body':_0x26ecd8,'log':_0x0df7('0x2')});}; \ No newline at end of file +var _0x7017=['CreateVoiceDialReport','create','Request'];(function(_0x20d337,_0x496f31){var _0x3e1243=function(_0x4e3f3b){while(--_0x4e3f3b){_0x20d337['push'](_0x20d337['shift']());}};_0x3e1243(++_0x496f31);}(_0x7017,0xd0));var _0x7701=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x7017[_0x1cc8fe];return _0x230054;};'use strict';var client=require('../client');exports[_0x7701('0x0')]=function(_0x50a4c3){return client[_0x7701('0x1')]('CreateVoiceDialReport',{'body':_0x50a4c3,'log':_0x7701('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index f3c37c6..696bfe1 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 _0xa74d=['GetVoiceExtension','exten','recordingFormat','getVoiceExtensions','Request'];(function(_0x48dd5b,_0x38667e){var _0x332e5e=function(_0x58b917){while(--_0x58b917){_0x48dd5b['push'](_0x48dd5b['shift']());}};_0x332e5e(++_0x38667e);}(_0xa74d,0x1cf));var _0xda74=function(_0x5eeb84,_0x253810){_0x5eeb84=_0x5eeb84-0x0;var _0x4b8b8a=_0xa74d[_0x5eeb84];return _0x4b8b8a;};'use strict';var client=require('../client');exports[_0xda74('0x0')]=function(){return function(){return client[_0xda74('0x1')](_0xda74('0x2'),{'options':{'raw':!![],'attributes':['id',_0xda74('0x3'),_0xda74('0x4')],'where':{'VoiceExtensionId':null}},'log':_0xda74('0x0')});};}; \ No newline at end of file +var _0x74f4=['GetVoiceExtension','exten','../client','getVoiceExtensions'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x74f4,0xaa));var _0x474f=function(_0x35db17,_0x8d64da){_0x35db17=_0x35db17-0x0;var _0x73f088=_0x74f4[_0x35db17];return _0x73f088;};'use strict';var client=require(_0x474f('0x0'));exports[_0x474f('0x1')]=function(){return function(){return client['Request'](_0x474f('0x2'),{'options':{'raw':!![],'attributes':['id',_0x474f('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x474f('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index b702fce..8315130 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 _0xb299=['dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialCheckDuplicateType','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','name','Interval','Intervals','getVoiceQueues','../client','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimizationPercentage'];(function(_0xc63e7b,_0x3bea6b){var _0x4d7dc5=function(_0x4d6f2c){while(--_0x4d6f2c){_0xc63e7b['push'](_0xc63e7b['shift']());}};_0x4d7dc5(++_0x3bea6b);}(_0xb299,0x1c0));var _0x9b29=function(_0x27accc,_0x434437){_0x27accc=_0x27accc-0x0;var _0x10e847=_0xb299[_0x27accc];return _0x10e847;};'use strict';var client=require(_0x9b29('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x9b29('0x1')](_0x9b29('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x9b29('0x3'),_0x9b29('0x4'),_0x9b29('0x5'),_0x9b29('0x6'),_0x9b29('0x7'),_0x9b29('0x8'),_0x9b29('0x9'),_0x9b29('0xa'),_0x9b29('0xb'),_0x9b29('0xc'),'dialPredictiveOptimization',_0x9b29('0xd'),_0x9b29('0xe'),'dialOriginateCallerIdName',_0x9b29('0xf'),_0x9b29('0x10'),_0x9b29('0x11'),_0x9b29('0x12'),_0x9b29('0x13'),_0x9b29('0x14'),_0x9b29('0x15'),_0x9b29('0x16'),_0x9b29('0x17'),_0x9b29('0x18'),_0x9b29('0x19'),_0x9b29('0x1a'),'dialTimezone','dialGlobalInterval','dialPrefix',_0x9b29('0x1b'),_0x9b29('0x1c'),'dialAMDInitialSilence',_0x9b29('0x1d'),_0x9b29('0x1e'),_0x9b29('0x1f'),_0x9b29('0x20'),_0x9b29('0x21'),_0x9b29('0x22'),_0x9b29('0x23'),_0x9b29('0x24'),_0x9b29('0x25'),_0x9b29('0x26'),_0x9b29('0x27'),_0x9b29('0x28'),_0x9b29('0x29'),'dialAgiAfterHangupClient','dialQueueProject2',_0x9b29('0x6'),_0x9b29('0x2a'),_0x9b29('0x2b'),_0x9b29('0x2c'),_0x9b29('0x2d'),_0x9b29('0x2e'),'dialDropMaxRetry',_0x9b29('0x2f'),_0x9b29('0x30'),_0x9b29('0x31'),'dialMachineMaxRetry',_0x9b29('0x32'),_0x9b29('0x33'),_0x9b29('0x34'),'mandatoryDisposition',_0x9b29('0x35'),_0x9b29('0x36'),_0x9b29('0x37'),_0x9b29('0x38')],'include':[{'model':_0x9b29('0x39'),'as':'Trunk','attributes':['id','name',_0x9b29('0x3a'),_0x9b29('0x3b')]},{'model':_0x9b29('0x3c'),'as':_0x9b29('0x3d'),'attributes':['id',_0x9b29('0x3e')]},{'model':_0x9b29('0x39'),'as':'TrunkBackup','attributes':['id',_0x9b29('0x3e'),_0x9b29('0x3a'),'active']},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':_0x9b29('0x3f'),'as':_0x9b29('0x40'),'attributes':['id',_0x9b29('0x3e'),'interval']}]}]},'log':_0x9b29('0x41')});};}; \ No newline at end of file +var _0x2fe7=['dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','getVoiceQueues','Request','name','acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt'];(function(_0x39d92c,_0x5da592){var _0x47065f=function(_0x246a91){while(--_0x246a91){_0x39d92c['push'](_0x39d92c['shift']());}};_0x47065f(++_0x5da592);}(_0x2fe7,0x1cb));var _0x72fe=function(_0x4e7dc4,_0x72f324){_0x4e7dc4=_0x4e7dc4-0x0;var _0x4d81aa=_0x2fe7[_0x4e7dc4];return _0x4d81aa;};'use strict';var client=require('../client');exports[_0x72fe('0x0')]=function(){return function(){return client[_0x72fe('0x1')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x72fe('0x2'),'acw',_0x72fe('0x3'),_0x72fe('0x4'),_0x72fe('0x5'),'type',_0x72fe('0x6'),_0x72fe('0x7'),_0x72fe('0x8'),_0x72fe('0x9'),_0x72fe('0xa'),_0x72fe('0xb'),_0x72fe('0xc'),_0x72fe('0xd'),'dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout',_0x72fe('0xe'),_0x72fe('0xf'),'dialQueueProject',_0x72fe('0x10'),_0x72fe('0x11'),_0x72fe('0x12'),_0x72fe('0x13'),_0x72fe('0x14'),_0x72fe('0x15'),'dialGlobalMaxRetry',_0x72fe('0x16'),_0x72fe('0x17'),_0x72fe('0x18'),_0x72fe('0x19'),_0x72fe('0x1a'),_0x72fe('0x1b'),_0x72fe('0x1c'),_0x72fe('0x1d'),_0x72fe('0x1e'),'dialAMDMinWordLength',_0x72fe('0x1f'),_0x72fe('0x20'),_0x72fe('0x21'),'dialAMDMaximumWordLength',_0x72fe('0x22'),'dialRecallMeTimeout',_0x72fe('0x23'),_0x72fe('0x24'),_0x72fe('0x25'),_0x72fe('0x26'),_0x72fe('0x27'),_0x72fe('0x5'),_0x72fe('0x28'),_0x72fe('0x29'),_0x72fe('0x2a'),_0x72fe('0x2b'),_0x72fe('0x2c'),_0x72fe('0x2d'),_0x72fe('0x2e'),_0x72fe('0x2f'),_0x72fe('0x30'),_0x72fe('0x31'),_0x72fe('0x32'),_0x72fe('0x33'),'dialAgentRejectRetryFrequency',_0x72fe('0x34'),_0x72fe('0x35'),_0x72fe('0x36'),'dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x72fe('0x2'),'callerid',_0x72fe('0x37')]},{'model':_0x72fe('0x38'),'as':_0x72fe('0x39'),'attributes':['id',_0x72fe('0x2')]},{'model':'Trunk','as':_0x72fe('0x3a'),'attributes':['id',_0x72fe('0x2'),_0x72fe('0x3b'),_0x72fe('0x37')]},{'model':_0x72fe('0x3c'),'as':_0x72fe('0x3c'),'attributes':['id',_0x72fe('0x2')],'include':[{'model':_0x72fe('0x3c'),'as':_0x72fe('0x3d'),'attributes':['id',_0x72fe('0x2'),'interval']}]}]},'log':_0x72fe('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 4ed4504..f94c66b 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(_0x18f347,_0x25ac56){var _0x128e20=function(_0x4de68e){while(--_0x4de68e){_0x18f347['push'](_0x18f347['shift']());}};_0x128e20(++_0x25ac56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x6541aa,_0x561678){var _0x4f52d0=function(_0x33fc6e){while(--_0x33fc6e){_0x6541aa['push'](_0x6541aa['shift']());}};_0x4f52d0(++_0x561678);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 4186eff..f274347 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 _0x9245=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x9245,0x141));var _0x5924=function(_0x4873b7,_0x1ab923){_0x4873b7=_0x4873b7-0x0;var _0x1e2569=_0x9245[_0x4873b7];return _0x1e2569;};'use strict';var client=require(_0x5924('0x0'));exports[_0x5924('0x1')]=function(_0xd5ffb0){return function(){return client['Request'](_0x5924('0x2'),{'options':{'where':{'VoiceQueueId':_0xd5ffb0,'paused':!![]},'raw':!![]},'log':'getVoiceQueueRtPauses'});};}; \ No newline at end of file +var _0xe7a9=['getVoiceQueueRtPauses','Request','../client'];(function(_0x5bca34,_0x34625c){var _0x3f3581=function(_0x38e50e){while(--_0x38e50e){_0x5bca34['push'](_0x5bca34['shift']());}};_0x3f3581(++_0x34625c);}(_0xe7a9,0x1eb));var _0x9e7a=function(_0x2d8670,_0x547868){_0x2d8670=_0x2d8670-0x0;var _0x6609f4=_0xe7a9[_0x2d8670];return _0x6609f4;};'use strict';var client=require(_0x9e7a('0x0'));exports[_0x9e7a('0x1')]=function(_0x4f98ec){return function(){return client[_0x9e7a('0x2')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4f98ec,'paused':!![]},'raw':!![]},'log':_0x9e7a('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index f858e2b..7db9418 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(_0x256c1c,_0x4b6d89){var _0x2ed7e5=function(_0x43b74b){while(--_0x43b74b){_0x256c1c['push'](_0x256c1c['shift']());}};_0x2ed7e5(++_0x4b6d89);}(_0x7a54,0x106));var _0x47a5=function(_0x5d3592,_0x2daebb){_0x5d3592=_0x5d3592-0x0;var _0xa6b682=_0x7a54[_0x5d3592];return _0xa6b682;};'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(_0x1bb0f0,_0x404032){var _0xa5c62f=function(_0x5e0860){while(--_0x5e0860){_0x1bb0f0['push'](_0x1bb0f0['shift']());}};_0xa5c62f(++_0x404032);}(_0x7a54,0x106));var _0x47a5=function(_0x2fa617,_0x31a970){_0x2fa617=_0x2fa617-0x0;var _0x37b35c=_0x7a54[_0x2fa617];return _0x37b35c;};'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 bd67f0e..34cc243 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 _0x260e=['origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfererexten','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetconnectedlinenum','transfertargetexten','isexternal'];(function(_0x197394,_0x32e35f){var _0x3091da=function(_0x12f576){while(--_0x12f576){_0x197394['push'](_0x197394['shift']());}};_0x3091da(++_0x32e35f);}(_0x260e,0x106));var _0xe260=function(_0x363dba,_0x16551f){_0x363dba=_0x363dba-0x0;var _0x1ac756=_0x260e[_0x363dba];return _0x1ac756;};'use strict';var client=require('../client');exports[_0xe260('0x0')]={};exports[_0xe260('0x1')]=function(_0x23e248){return client['Request'](_0xe260('0x2'),{'body':{'result':_0x23e248['result'],'transfererchannel':_0x23e248[_0xe260('0x3')],'transferercalleridnum':_0x23e248[_0xe260('0x4')],'transferercalleridname':_0x23e248[_0xe260('0x5')],'transfererconnectedlinenum':_0x23e248[_0xe260('0x6')],'transfererconnectedlinename':_0x23e248[_0xe260('0x7')],'transfereraccountcode':_0x23e248[_0xe260('0x8')],'transferercontext':_0x23e248['transferercontext'],'transfererexten':_0x23e248[_0xe260('0x9')],'transfererlinkedid':_0x23e248['transfererlinkedid'],'transfereechannel':_0x23e248['transfereechannel'],'transfereecalleridnum':_0x23e248[_0xe260('0xa')],'transfereecalleridname':_0x23e248[_0xe260('0xb')],'transfereeconnectedlinenum':_0x23e248[_0xe260('0xc')],'transfereeconnectedlinename':_0x23e248[_0xe260('0xd')],'transfereeaccountcode':_0x23e248[_0xe260('0xe')],'transfereecontext':_0x23e248[_0xe260('0xf')],'transfereeexten':_0x23e248[_0xe260('0x10')],'transfereelinkedid':_0x23e248[_0xe260('0x11')],'isexternal':_0x23e248['isexternal'],'context':_0x23e248['context'],'extension':_0x23e248[_0xe260('0x12')],'type':_0xe260('0x13')},'log':_0xe260('0x2')});};exports[_0xe260('0x14')]=function(_0x1ca7b6){return client['Request'](_0xe260('0x2'),{'body':{'result':_0x1ca7b6[_0xe260('0x15')],'transfererchannel':_0x1ca7b6[_0xe260('0x16')],'transferercalleridnum':_0x1ca7b6[_0xe260('0x17')],'transferercalleridname':_0x1ca7b6[_0xe260('0x18')],'transfererconnectedlinenum':_0x1ca7b6['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x1ca7b6[_0xe260('0x19')],'transfereraccountcode':_0x1ca7b6[_0xe260('0x1a')],'transferercontext':_0x1ca7b6[_0xe260('0x1b')],'transfererexten':_0x1ca7b6[_0xe260('0x1c')],'transfererlinkedid':_0x1ca7b6[_0xe260('0x1d')],'transfereechannel':_0x1ca7b6[_0xe260('0x1e')],'transfereecalleridnum':_0x1ca7b6['transfertargetcalleridnum'],'transfereecalleridname':_0x1ca7b6['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x1ca7b6[_0xe260('0x1f')],'transfereeconnectedlinename':_0x1ca7b6['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1ca7b6['transfertargetaccountcode'],'transfereecontext':_0x1ca7b6['transfertargetcontext'],'transfereeexten':_0x1ca7b6[_0xe260('0x20')],'transfereelinkedid':_0x1ca7b6['transfertargetlinkedid'],'isexternal':_0x1ca7b6[_0xe260('0x21')],'context':_0x1ca7b6[_0xe260('0x22')],'extension':_0x1ca7b6[_0xe260('0x23')],'type':_0xe260('0x24')},'log':_0xe260('0x2')});}; \ No newline at end of file +var _0x7959=['isexternal','context','blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid'];(function(_0x1b892b,_0x4efe48){var _0xa99e57=function(_0x3f957a){while(--_0x3f957a){_0x1b892b['push'](_0x1b892b['shift']());}};_0xa99e57(++_0x4efe48);}(_0x7959,0xf9));var _0x9795=function(_0x150d49,_0x1ac7ac){_0x150d49=_0x150d49-0x0;var _0x3a0efa=_0x7959[_0x150d49];return _0x3a0efa;};'use strict';var client=require('../client');exports['transfers']={};exports[_0x9795('0x0')]=function(_0x3fb881){return client[_0x9795('0x1')](_0x9795('0x2'),{'body':{'result':_0x3fb881['result'],'transfererchannel':_0x3fb881['transfererchannel'],'transferercalleridnum':_0x3fb881[_0x9795('0x3')],'transferercalleridname':_0x3fb881[_0x9795('0x4')],'transfererconnectedlinenum':_0x3fb881[_0x9795('0x5')],'transfererconnectedlinename':_0x3fb881['transfererconnectedlinename'],'transfereraccountcode':_0x3fb881[_0x9795('0x6')],'transferercontext':_0x3fb881[_0x9795('0x7')],'transfererexten':_0x3fb881[_0x9795('0x8')],'transfererlinkedid':_0x3fb881[_0x9795('0x9')],'transfereechannel':_0x3fb881[_0x9795('0xa')],'transfereecalleridnum':_0x3fb881['transfereecalleridnum'],'transfereecalleridname':_0x3fb881[_0x9795('0xb')],'transfereeconnectedlinenum':_0x3fb881['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x3fb881[_0x9795('0xc')],'transfereeaccountcode':_0x3fb881[_0x9795('0xd')],'transfereecontext':_0x3fb881[_0x9795('0xe')],'transfereeexten':_0x3fb881[_0x9795('0xf')],'transfereelinkedid':_0x3fb881[_0x9795('0x10')],'isexternal':_0x3fb881[_0x9795('0x11')],'context':_0x3fb881[_0x9795('0x12')],'extension':_0x3fb881['extension'],'type':_0x9795('0x13')},'log':_0x9795('0x2')});};exports[_0x9795('0x14')]=function(_0x145638){return client[_0x9795('0x1')](_0x9795('0x2'),{'body':{'result':_0x145638['result'],'transfererchannel':_0x145638[_0x9795('0x15')],'transferercalleridnum':_0x145638[_0x9795('0x16')],'transferercalleridname':_0x145638[_0x9795('0x17')],'transfererconnectedlinenum':_0x145638[_0x9795('0x18')],'transfererconnectedlinename':_0x145638['secondtransfererconnectedlinename'],'transfereraccountcode':_0x145638[_0x9795('0x19')],'transferercontext':_0x145638[_0x9795('0x1a')],'transfererexten':_0x145638['secondtransfererexten'],'transfererlinkedid':_0x145638[_0x9795('0x1b')],'transfereechannel':_0x145638['transfertargetchannel'],'transfereecalleridnum':_0x145638[_0x9795('0x1c')],'transfereecalleridname':_0x145638[_0x9795('0x1d')],'transfereeconnectedlinenum':_0x145638[_0x9795('0x1e')],'transfereeconnectedlinename':_0x145638['transfertargetconnectedlinename'],'transfereeaccountcode':_0x145638[_0x9795('0x1f')],'transfereecontext':_0x145638[_0x9795('0x20')],'transfereeexten':_0x145638[_0x9795('0x21')],'transfereelinkedid':_0x145638[_0x9795('0x22')],'isexternal':_0x145638[_0x9795('0x11')],'context':_0x145638[_0x9795('0x23')],'extension':_0x145638[_0x9795('0x24')],'type':_0x9795('0x25')},'log':_0x9795('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 401fa73..0a32804 100644 --- a/server/services/ami/server/index.js +++ b/server/services/ami/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0xd1a0a3,_0x54ab29){var _0x41d030=function(_0x32c03c){while(--_0x32c03c){_0xd1a0a3['push'](_0xd1a0a3['shift']());}};_0x41d030(++_0x54ab29);}(_0xb10b,0x12a));var _0xbb10=function(_0x2c2980,_0x34282a){_0x2c2980=_0x2c2980-0x0;var _0x2a20a9=_0xb10b[_0x2c2980];return _0x2a20a9;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file +var _0xb10b=['type','Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','telephones','trunks','run','event','Event\x20name\x20mandatory','faxAccounts','send','checkAfterSend','server','http','127.0.0.1','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','moment','../properties','../ami','../model/voiceQueueSummary','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','voiceStatus','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','command','Command','content','voiceQueues','hasOwnProperty','push','length','find','omit','undefined','values','voicechannel','map','channels','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','monitors','stop','queueChannels','inbound','outbound','includes'];(function(_0x461a5f,_0x4b573d){var _0x5d5d8a=function(_0x15c9c4){while(--_0x15c9c4){_0x461a5f['push'](_0x461a5f['shift']());}};_0x5d5d8a(++_0x4b573d);}(_0xb10b,0x12a));var _0xbb10=function(_0x41094d,_0x4ca21d){_0x41094d=_0x41094d-0x0;var _0x503ee1=_0xb10b[_0x41094d];return _0x503ee1;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var jayson=require(_0xbb10('0x1'));var schema=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var config=require('../../../config/environment');var properties=require(_0xbb10('0x4'));var ami=require(_0xbb10('0x5'));var VoiceQueueSummary=require(_0xbb10('0x6'));exports[_0xbb10('0x7')]=function(_0x49baf4,_0x312b72,_0x481979){return new Promise(function(_0x328583,_0x3cdd53){var _0x513741={'QueuePause':function(_0x1b9e94){return new Promise(function(_0x3fb675){var _0x21370f=util[_0xbb10('0x8')](_0xbb10('0x9'),_0xbb10('0xa'),_0x1b9e94[_0xbb10('0xb')]);if(_0x49baf4[_0xbb10('0xc')]&&_0x49baf4['timers'][_0x21370f]&&_0x49baf4['timers'][_0x21370f][_0xbb10('0xd')]){_0x49baf4[_0xbb10('0xc')][_0x21370f][_0xbb10('0xe')]();}if(_0x49baf4['agents'][_0x21370f]){_0x49baf4[_0xbb10('0xf')][_0x21370f]['updateStatusRealtime']({'state':_0x49baf4[_0xbb10('0xf')][_0x21370f][_0xbb10('0x10')],'statePause':_0x1b9e94[_0xbb10('0x11')]?!![]:![]});}_0x3fb675({'code':0xc8,'message':_0xbb10('0x12')});});},'Reload':function(_0x442548){var _0x147230=this;return new Promise(function(_0x58a612,_0x26e021){if(ami[_0xbb10('0x13')]()==![]){return _0x26e021(_0x147230[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}_0x442548=_[_0xbb10('0x19')](_0x442548,_[_0xbb10('0x1a')](properties['reload'][_0xbb10('0x1b')]));_0x442548[_0xbb10('0x1c')]=_0xbb10('0x1d');return ami[_0xbb10('0x1e')](_0x442548)[_0xbb10('0x1f')](function(_0x1682a4){_0x58a612({'code':0xc8,'message':_0x1682a4[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xbf2906){_0x26e021(_0x147230[_0xbb10('0x14')](0x1f5,_0xbf2906['message']));});});},'Command':function(_0x5ff0cf){var _0x19f48d=this;return new Promise(function(_0x388fab,_0x109908){if(ami[_0xbb10('0x13')]()==![]){return _0x109908(_0x19f48d[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected']['join']('\x20')));}_0x5ff0cf=_[_0xbb10('0x19')](_0x5ff0cf,_0xbb10('0x22'));_0x5ff0cf[_0xbb10('0x1c')]=_0xbb10('0x23');return ami[_0xbb10('0x1e')](_0x5ff0cf)[_0xbb10('0x1f')](function(_0x407cb4){_0x388fab({'code':0xc8,'message':_0x407cb4[_0xbb10('0x24')]});})[_0xbb10('0x21')](function(_0x395404){_0x109908(_0x19f48d[_0xbb10('0x14')](0x1f5,_0x395404[_0xbb10('0x20')]));});});},'VoiceQueues':function(){return new Promise(function(_0x537898){var _0x4fedac=[];for(var _0x4fb5e0 in _0x49baf4[_0xbb10('0x25')]){if(_0x49baf4[_0xbb10('0x25')][_0xbb10('0x26')](_0x4fb5e0)){var _0x4e25ff=_0x49baf4[_0xbb10('0x25')][_0x4fb5e0];var _0x24d586=new VoiceQueueSummary(_0x4e25ff);_0x4fedac[_0xbb10('0x27')](_0x24d586);}}_0x537898({'count':_0x4fedac[_0xbb10('0x28')],'rows':_0x4fedac});});},'UpdateVoiceQueue':function(_0x1acce9){return new Promise(function(_0x20d946,_0x2a0e8b){var _0x4aabb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x25')],{'id':parseInt(_0x1acce9['id'])});var _0xfc3595=_[_0xbb10('0x2a')](_0x1acce9,['id']);if(_0x4aabb9){for(var _0x1d30aa in _0xfc3595){if(typeof _0xfc3595[_0x1d30aa]!==_0xbb10('0x2b')&&typeof _0x4aabb9[_0x1d30aa]!=='undefined'){_0x4aabb9[_0x1d30aa]=_0xfc3595[_0x1d30aa];}}_0x20d946(_0x4aabb9);}else{_0x2a0e8b();}});},'VoiceChannels':function(){return new Promise(function(_0x221624){var _0x4ee02e=_[_0xbb10('0x2c')](_0x49baf4['channels']);_0x221624({'count':_0x4ee02e[_0xbb10('0x28')],'rows':_0x4ee02e});});},'VoiceChannelMixMonitor':function(_0x1dcc9c){var _0x1b59f9=this;return new Promise(function(_0x491db4,_0x518d47){if(ami[_0xbb10('0x13')]()==![]){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,[config['asterisk']['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x37a83f=schema(properties[_0xbb10('0x2d')])[_0xbb10('0x2')](_0x1dcc9c);if(_0x37a83f['length']>0x0){return _0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x37a83f,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0xfb2c5e=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x2f')],{'uniqueid':_0x1dcc9c[_0xbb10('0x30')]});if(_0xfb2c5e&&_0xfb2c5e[_0xbb10('0x31')]){var _0x56943c=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1dcc9c[_0xbb10('0x33')]||_0x1dcc9c[_0xbb10('0x30')],_0x1dcc9c['format']||_0xbb10('0x34'));return ami['Action']({'action':'MixMonitor','channel':_0xfb2c5e[_0xbb10('0x31')],'file':_0x56943c,'options':_0xbb10('0x35')})[_0xbb10('0x1f')](function(_0x120d21){var _0x15d895=_[_0xbb10('0x29')](_0xfb2c5e['monitors'],{'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')]()});if(_['isNil'](_0x15d895)){_0xfb2c5e['monitors']['push']({'filename':_0xbb10('0x36')+_0x56943c[_0xbb10('0x37')](),'createdAt':moment()[_0xbb10('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x120d21[_0xbb10('0x38')],'status':_0xbb10('0x39')});}else{_0x15d895[_0xbb10('0x38')]=_0x120d21['mixmonitorid'];_0x15d895[_0xbb10('0x3a')]=_0xbb10('0x39');}_0x491db4({'code':0xc8,'message':[_0x1dcc9c[_0xbb10('0x30')],_0xbb10('0x3b'),_0x120d21['mixmonitorid']][_0xbb10('0x18')]('\x20'),'mixmonitorid':_0x120d21[_0xbb10('0x38')]});})['catch'](function(_0xe2040f){_0x518d47(_0x1b59f9[_0xbb10('0x14')](0x1f5,[_0x1dcc9c[_0xbb10('0x30')],_0xe2040f[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x518d47(_0x1b59f9['error'](0x1f5,_0xbb10('0x3c')));}});},'VoiceChannelStopMixMonitor':function(_0x1c7fae){var _0x3e7b4c=this;return new Promise(function(_0x3d3c41,_0x4943d9){if(ami[_0xbb10('0x13')]()==![]){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')]['username'],_0xbb10('0x17')][_0xbb10('0x18')]('\x20')));}var _0x54ac18=schema(properties['voicechannel'])[_0xbb10('0x2')](_0x1c7fae);if(_0x54ac18['length']>0x0){return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x54ac18,'message')[_0xbb10('0x18')](',\x20')));}var _0x1d82bf=_[_0xbb10('0x29')](_0x49baf4['channels'],{'uniqueid':_0x1c7fae[_0xbb10('0x30')]});if(_0x1d82bf){return Promise[_0xbb10('0x3d')]()[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x3e'),'channel':_0x1d82bf[_0xbb10('0x31')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})[_0xbb10('0x21')](function(){});}})[_0xbb10('0x1f')](function(){if(_0x1d82bf[_0xbb10('0x3f')]){return ami[_0xbb10('0x1e')]({'action':'StopMixMonitor','channel':_0x1d82bf[_0xbb10('0x3f')],'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]})['catch'](function(){});}})[_0xbb10('0x1f')](function(){var _0x2f5027=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'mixmonitorid':_0x1c7fae[_0xbb10('0x38')]});if(_0x2f5027){_0x2f5027[_0xbb10('0x3a')]=_0xbb10('0x41');}})['then'](function(){var _0x4a9793=util[_0xbb10('0x8')](_0xbb10('0x32'),_0x1c7fae[_0xbb10('0x33')]||_0x1c7fae['uniqueid'],_0x1c7fae['format']||_0xbb10('0x34'));var _0x34cf4e=_[_0xbb10('0x29')](_0x1d82bf[_0xbb10('0x40')],{'filename':_0xbb10('0x36')+_0x4a9793[_0xbb10('0x37')]()});if(_0x34cf4e){_0x34cf4e[_0xbb10('0x3a')]=_0xbb10('0x41');}})[_0xbb10('0x1f')](function(){_0x3d3c41({'code':0xc8,'message':[_0x1c7fae[_0xbb10('0x30')],'StopMixMonitor\x20Success']['join']('\x20')});})[_0xbb10('0x21')](function(_0x467dba){_0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,[_0x1c7fae[_0xbb10('0x30')],_0x467dba[_0xbb10('0x20')][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')));});}else{return _0x4943d9(_0x3e7b4c[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannels':function(_0x1214f7){var _0x19ca3e=this;return new Promise(function(_0x20e18a){var _0x61e689=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x42')]);var _0x547a7a={'count':_0x61e689[_0xbb10('0x28')],'rows':_0x61e689};if(_0x1214f7&&_0x1214f7['type']){if(![_0xbb10('0x43'),_0xbb10('0x44')][_0xbb10('0x45')](_0x1214f7[_0xbb10('0x46')])){return _0x3cdd53(_0x19ca3e[_0xbb10('0x14')](0x190,_0xbb10('0x47')));}var _0x2e3326=_[_0xbb10('0x48')](_0x61e689,function(_0x180400){return _0x180400[_0xbb10('0x46')]===_0x1214f7[_0xbb10('0x46')];});_0x547a7a[_0xbb10('0x49')]=_0x2e3326[_0xbb10('0x28')];_0x547a7a[_0xbb10('0x4a')]=_0x2e3326;}_0x20e18a(_0x547a7a);});},'VoiceQueuesChannel':function(_0x4475e1){var _0x5de0cc=this;return new Promise(function(_0x4571b6,_0x466eb7){var _0x1b83a9=schema(properties[_0xbb10('0x4b')])[_0xbb10('0x2')](_0x4475e1);if(_0x1b83a9[_0xbb10('0x28')]>0x0){return _0x466eb7(_0x5de0cc['error'](0x1f4,_[_0xbb10('0x2e')](_0x1b83a9,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x14fed3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x4475e1[_0xbb10('0x30')]});if(_0x14fed3){_0x4571b6(_0x14fed3);}else{return _0x466eb7(_0x5de0cc[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelHangup':function(_0x40c4fb){var _0x2eb05a=this;return new Promise(function(_0x2a1ce1,_0x16932f){if(ami['isConnected']()==![]){return _0x16932f(_0x2eb05a['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],_0xbb10('0x17')]['join']('\x20')));}var _0x506498=schema(properties[_0xbb10('0x4c')])[_0xbb10('0x2')](_0x40c4fb);if(_0x506498[_0xbb10('0x28')]>0x0){return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x506498,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x4a5fb9=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x40c4fb['uniqueid']});if(_0x4a5fb9&&_0x4a5fb9['channel']){return ami['Action']({'action':_0xbb10('0x4d'),'channel':_0x4a5fb9[_0xbb10('0x31')]})[_0xbb10('0x1f')](function(_0x5bd1c0){_0x2a1ce1({'code':0xc8,'message':[_0x40c4fb['uniqueid'],_0x5bd1c0['message'][_0xbb10('0x37')]()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0x4e9fbd){_0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,[_0x40c4fb[_0xbb10('0x30')],_0x4e9fbd['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0x16932f(_0x2eb05a[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'VoiceQueuesChannelRedirect':function(_0x237246){var _0x54b7c5=this;return new Promise(function(_0x43eaec,_0xec48ac){if(ami[_0xbb10('0x13')]()==![]){return _0xec48ac(_0x54b7c5['error'](0x1f4,[config[_0xbb10('0x15')]['ip'],config[_0xbb10('0x15')][_0xbb10('0x16')],'ami\x20disconnected'][_0xbb10('0x18')]('\x20')));}var _0x31e85e=schema(properties[_0xbb10('0x4e')])[_0xbb10('0x2')](_0x237246);if(_0x31e85e['length']>0x0){return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f4,_[_0xbb10('0x2e')](_0x31e85e,_0xbb10('0x20'))[_0xbb10('0x18')](',\x20')));}var _0x56b3a3=_[_0xbb10('0x29')](_0x49baf4[_0xbb10('0x42')],{'uniqueid':_0x237246[_0xbb10('0x30')]});if(_0x56b3a3&&_0x56b3a3[_0xbb10('0x31')]){return ami[_0xbb10('0x1e')]({'action':_0xbb10('0x4f'),'channel':_0x56b3a3[_0xbb10('0x31')],'exten':_0x237246['exten'],'context':_0x237246['context']||_0x56b3a3['context'],'priority':0x1})[_0xbb10('0x1f')](function(_0x9c672d){_0x43eaec({'code':0xc8,'message':[_0x237246[_0xbb10('0x30')],_0x9c672d['message']['toLowerCase']()][_0xbb10('0x18')]('\x20')});})[_0xbb10('0x21')](function(_0xd9e743){_0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,[_0x237246[_0xbb10('0x30')],_0xd9e743[_0xbb10('0x20')]['toLowerCase']()][_0xbb10('0x18')]('\x20')));});}else{return _0xec48ac(_0x54b7c5[_0xbb10('0x14')](0x1f5,_0xbb10('0x3c')));}});},'Agents':function(_0x14f16b){return new Promise(function(_0x2aaaa6){var _0x5bfc68=_['values'](_0x49baf4['agents']);if(_0x14f16b&&_0x14f16b['id']){var _0x329da7=_[_0xbb10('0x29')](_0x5bfc68,function(_0x36917f){return _0x36917f['id']===_0x14f16b['id'];});_0x2aaaa6(_0x329da7);}else{_0x2aaaa6({'count':_0x5bfc68[_0xbb10('0x28')],'rows':_0x5bfc68});}});},'Telephones':function(){return new Promise(function(_0x2f7d2a){var _0x1d40b8=_['values'](_0x49baf4[_0xbb10('0x50')]);_0x2f7d2a({'count':_0x1d40b8['length'],'rows':_0x1d40b8});});},'Trunks':function(){return new Promise(function(_0x4fe3b5){var _0x519a54=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x51')]);_0x4fe3b5({'count':_0x519a54[_0xbb10('0x28')],'rows':_0x519a54});});},'OutboundChannels':function(){return new Promise(function(_0x108f99){var _0x5ce94f=_[_0xbb10('0x2c')](_0x49baf4['outboundChannels']);_0x108f99({'count':_0x5ce94f['length'],'rows':_0x5ce94f});});},'Outbound':function(){return new Promise(function(_0x165fe9){_0x165fe9(_0x49baf4[_0xbb10('0x44')]);});},'Campaigns':function(){return new Promise(function(_0x29529c){var _0x2bd2ab=_[_0xbb10('0x2c')](_0x49baf4['campaigns']);_0x29529c({'count':_0x2bd2ab[_0xbb10('0x28')],'rows':_0x2bd2ab});});},'VoiceQueuesPreview':function(_0x19fcec){var _0x2c6429=this;return new Promise(function(_0x3f3d38,_0x43cdb7){_0x312b72[_0xbb10('0x52')](_0x19fcec['id'])[_0xbb10('0x1f')](function(_0x53fa98){_0x3f3d38({'code':0xc8,'message':_0x53fa98[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x30f3ea){_0x43cdb7(_0x2c6429[_0xbb10('0x14')](0x1f4,_0x30f3ea[_0xbb10('0x20')]));});});},'EventManager':function(_0x172be3){var _0xa3b23=this;return new Promise(function(_0x312a08,_0x5a4429){if(!_0x172be3[_0xbb10('0x53')]){return _0x5a4429(_0xa3b23[_0xbb10('0x14')](0x1f4,_0xbb10('0x54')));}ami['emit']('custom:'+_0x172be3['event'],_0x172be3[_0xbb10('0x20')]);_0x312a08({'code':0xc8,'message':_0x172be3});});},'FaxAccounts':function(){return new Promise(function(_0x5a3c44){var _0x4e3d6a=_[_0xbb10('0x2c')](_0x49baf4[_0xbb10('0x55')]);_0x5a3c44({'count':_0x4e3d6a[_0xbb10('0x28')],'rows':_0x4e3d6a});});},'SendFax':function(_0x12ed63){var _0x32ec27=this;return new Promise(function(_0x24dca6,_0x33116){_0x481979[_0xbb10('0x56')](_0x12ed63)[_0xbb10('0x1f')](function(_0x5206e1){_0x24dca6({'code':0xc8,'message':_0x5206e1[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0x46b6d2){_0x33116(_0x32ec27[_0xbb10('0x14')](0x1f4,_0x46b6d2['message']));});});},'CheckAfterSend':function(_0x4c0795){var _0x3547a3=this;return new Promise(function(_0x2280bd,_0x30f0a4){_0x481979[_0xbb10('0x57')](_0x4c0795)['then'](function(_0x17d596){_0x2280bd({'code':0xc8,'message':_0x17d596[_0xbb10('0x20')]});})[_0xbb10('0x21')](function(_0xf7b3e1){_0x30f0a4(_0x3547a3[_0xbb10('0x14')](0x1f4,_0xf7b3e1['message']));});});}};var _0x5f0691=jayson[_0xbb10('0x58')](_0x513741)[_0xbb10('0x59')]();_0x5f0691['on'](_0xbb10('0x14'),function(_0x5239da){return _0x3cdd53(_0x5239da);});_0x5f0691[_0xbb10('0x7')](0x232a,_0xbb10('0x5a'),function(){console['log']('AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232a);return _0x328583(_0xbb10('0x5b')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 276a463..52c037a 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 _0x9173=['createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','merge','lodash','bluebird','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','defaults','localhost','redis','info','stringify','emit','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','calleridnum','destcalleridnum','firstName','lastName','mobile','fax','createdAt','updatedAt','union','resolve','then','getContacts','isEmpty','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','routeId','calleridname','','Unknown','destcalleridname'];(function(_0x188d31,_0x576e87){var _0x30ed33=function(_0x15f9a5){while(--_0x15f9a5){_0x188d31['push'](_0x188d31['shift']());}};_0x30ed33(++_0x576e87);}(_0x9173,0x7e));var _0x3917=function(_0x1e11b1,_0x11380c){_0x1e11b1=_0x1e11b1-0x0;var _0x3c24bb=_0x9173[_0x1e11b1];return _0x3c24bb;};'use strict';var _=require(_0x3917('0x0'));var BPromise=require(_0x3917('0x1'));var Redis=require(_0x3917('0x2'));var util=require(_0x3917('0x3'));var config=require(_0x3917('0x4'));var logger=require('../../../../config/logger')(_0x3917('0x5'));var cmContactRpc=require(_0x3917('0x6'));config['redis']=_[_0x3917('0x7')](config['redis'],{'host':_0x3917('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3917('0x9')]));function emit(_0x280d8f,_0xe3dcdb,_0x448429,_0x558e86,_0x4284c1){logger[_0x3917('0xa')]('[CM][%s][%s]',_0x280d8f,_0xe3dcdb['id'],_0x448429,_0x558e86,JSON[_0x3917('0xb')](_0x4284c1));io['to'](_0x448429)[_0x3917('0xc')](_0x558e86,_0x4284c1);}exports[_0x3917('0xd')]=function(_0x3e4878,_0x12bef0,_0x4f9c92,_0x2d6931){var _0x513fdc,_0x5aa562;var _0x526499={};var _0x9fc640;var _0x587d05=Number(_0x4f9c92[_0x3917('0xe')]);var _0x3069df=_0x4f9c92[_0x3917('0xf')]?Boolean(Number(_0x4f9c92[_0x3917('0xf')])):![];var _0x399bf7;var _0x3c382e=![];if(!_[_0x3917('0x10')](_0x4f9c92[_0x3917('0x11')])){if(_0x4f9c92[_0x3917('0x11')]=='1')_0x3c382e=!![];}if(!_0x3c382e){if(_0x2d6931[_0x3917('0x12')]){_0x526499['id']=_0x2d6931[_0x3917('0x12')];}}if(!_0x526499['id']){_0x526499[_0x3917('0x13')]=_0x587d05;_0x399bf7=_0x4f9c92[_0x3917('0x14')]&&_0x4f9c92['data3']!=='0'?_0x4f9c92[_0x3917('0x14')][_0x3917('0x15')](','):[_0x3917('0x16')];_0x526499[_0x3917('0x17')]=_[_0x3917('0x18')](_0x399bf7,function(_0x4ea91e){var _0x3cc689={};_0x3cc689[_0x4ea91e]=_0x2d6931['routeId']?_0x2d6931['destcalleridnum']:_0x2d6931[_0x3917('0x19')];return _0x3cc689;});_0x9fc640=_0x2d6931['routeId']?_0x2d6931[_0x3917('0x1a')]:_0x2d6931[_0x3917('0x19')];}var _0x2d1492=['id',_0x3917('0x1b'),_0x3917('0x1c'),_0x3917('0x16'),_0x3917('0x1d'),_0x3917('0x1e'),'ListId',_0x3917('0x1f'),'scheduledAt',_0x3917('0x20')];var _0x3c7908=_[_0x3917('0x21')](_0x2d1492,_0x399bf7);BPromise[_0x3917('0x22')]()[_0x3917('0x23')](cmContactRpc[_0x3917('0x24')]({'attributes':_0x3c7908,'where':_0x526499,'phone':_0x9fc640}))['then'](function(_0x52abc2){_0x5aa562=_0x52abc2;if(!_[_0x3917('0x25')](_0x5aa562)){if(_0x5aa562[_0x3917('0x26')]===0x1){_0x513fdc=_0x5aa562[0x0];logger['info'](_0x3917('0x27'),_0x2d6931[_0x3917('0x28')],_0x12bef0['id'],_0x513fdc['id']);}else{logger['info'](_0x3917('0x29'),_0x2d6931[_0x3917('0x28')],_0x12bef0['id'],_[_0x3917('0x18')](_0x5aa562,'id')[_0x3917('0x2a')](','));}return;}else{logger[_0x3917('0xa')](_0x3917('0x2b'),_0x2d6931['uniqueid'],_0x12bef0['id']);var _0x2a6a25={'ListId':_0x587d05};var _0x255ee8=_0x4f9c92['data4']&&_0x4f9c92[_0x3917('0x2c')]!=='0'?_0x4f9c92[_0x3917('0x2c')]:_0x3917('0x16');if(_0x3069df){logger[_0x3917('0xa')](_0x3917('0x2d'),_0x2d6931[_0x3917('0x28')],_0x12bef0['id']);_0x2a6a25[_0x255ee8]=_[_0x3917('0x10')](_0x2d6931[_0x3917('0x2e')])?_0x2d6931['calleridnum']:_0x2d6931[_0x3917('0x1a')];if(_[_0x3917('0x10')](_0x2d6931[_0x3917('0x2e')])){_0x2a6a25[_0x3917('0x1b')]=_0x2d6931[_0x3917('0x2f')]&&_0x2d6931['calleridname']!==_0x3917('0x30')?_0x2d6931['calleridname']:_0x3917('0x31');}else{_0x2a6a25[_0x3917('0x1b')]=_0x2d6931['destcalleridname']&&_0x2d6931[_0x3917('0x32')]!==_0x3917('0x30')?_0x2d6931[_0x3917('0x32')]:'Unknown';}return BPromise['resolve']()[_0x3917('0x23')](cmContactRpc[_0x3917('0x33')](_0x2a6a25))[_0x3917('0x23')](function(_0x1fa66d){_0x513fdc=_0x1fa66d;_0x5aa562[_0x3917('0x34')](_0x1fa66d);if(_0x513fdc){logger[_0x3917('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x2d6931[_0x3917('0x28')],_0x12bef0['id'],_0x513fdc['id']);}return;});}else{logger[_0x3917('0xa')](_0x3917('0x35'),_0x2d6931[_0x3917('0x28')],_0x12bef0['id']);_0x2a6a25[_0x255ee8]=_[_0x3917('0x10')](_0x2d6931[_0x3917('0x2e')])?_0x2d6931['calleridnum']:_0x2d6931[_0x3917('0x1a')];if(_['isNil'](_0x2d6931['routeId'])){_0x2a6a25[_0x3917('0x1b')]=_0x2d6931[_0x3917('0x2f')]&&_0x2d6931['calleridname']!==_0x3917('0x30')?_0x2d6931[_0x3917('0x2f')]:'Unknown';}else{_0x2a6a25['firstName']=_0x2d6931[_0x3917('0x32')]&&_0x2d6931['destcalleridname']!==_0x3917('0x30')?_0x2d6931['destcalleridname']:_0x3917('0x31');}_0x513fdc=_0x2a6a25;_0x5aa562['push'](_0x2a6a25);return;}}})[_0x3917('0x23')](function(){if(_0x3e4878){emit(_0x2d6931['uniqueid'],_0x12bef0,util[_0x3917('0x36')](_0x3917('0x37'),_0x3e4878[_0x3917('0x38')]),util['format'](_0x3917('0x39'),_0x4f9c92['action']['toLowerCase']()),{'evt':_[_0x3917('0x3a')](_0x2d6931,{'autoCreate':_0x3069df}),'contact':_0x513fdc===undefined?{}:_0x513fdc,'contacts':_0x5aa562[_0x3917('0x26')]===0x0?undefined:_0x5aa562});}});}; \ No newline at end of file +var _0x7d90=['info','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','','calleridname','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','Unknown','format','user:%s','name','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','stringify','emit','exec','data1','data2','data5','xmd-contactid','ListId','data3','phone','$or','map','routeId','calleridnum','firstName','lastName','mobile','fax','createdAt','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','length'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0x7d90,0x1ab));var _0x07d9=function(_0x581771,_0x5bff80){_0x581771=_0x581771-0x0;var _0x1b9f6d=_0x7d90[_0x581771];return _0x1b9f6d;};'use strict';var _=require(_0x07d9('0x0'));var BPromise=require(_0x07d9('0x1'));var Redis=require(_0x07d9('0x2'));var util=require('util');var config=require(_0x07d9('0x3'));var logger=require(_0x07d9('0x4'))(_0x07d9('0x5'));var cmContactRpc=require('../../rpc/cmContact');config[_0x07d9('0x6')]=_[_0x07d9('0x7')](config[_0x07d9('0x6')],{'host':_0x07d9('0x8'),'port':0x18eb});var io=require(_0x07d9('0x9'))(new Redis(config[_0x07d9('0x6')]));function emit(_0x17bd3b,_0x3f5307,_0x839973,_0x151d03,_0x2ba4e5){logger['info']('[CM][%s][%s]',_0x17bd3b,_0x3f5307['id'],_0x839973,_0x151d03,JSON[_0x07d9('0xa')](_0x2ba4e5));io['to'](_0x839973)[_0x07d9('0xb')](_0x151d03,_0x2ba4e5);}exports[_0x07d9('0xc')]=function(_0x24ffbf,_0x4fd9c0,_0x373447,_0x171a77){var _0x219d9f,_0x49c548;var _0x312c7={};var _0x1c012e;var _0x249d8a=Number(_0x373447[_0x07d9('0xd')]);var _0x4767d=_0x373447[_0x07d9('0xe')]?Boolean(Number(_0x373447[_0x07d9('0xe')])):![];var _0x42c303;var _0x2221b0=![];if(!_['isNil'](_0x373447[_0x07d9('0xf')])){if(_0x373447[_0x07d9('0xf')]=='1')_0x2221b0=!![];}if(!_0x2221b0){if(_0x171a77[_0x07d9('0x10')]){_0x312c7['id']=_0x171a77[_0x07d9('0x10')];}}if(!_0x312c7['id']){_0x312c7[_0x07d9('0x11')]=_0x249d8a;_0x42c303=_0x373447[_0x07d9('0x12')]&&_0x373447['data3']!=='0'?_0x373447[_0x07d9('0x12')]['split'](','):[_0x07d9('0x13')];_0x312c7[_0x07d9('0x14')]=_[_0x07d9('0x15')](_0x42c303,function(_0x4c4e3d){var _0x1e0cc7={};_0x1e0cc7[_0x4c4e3d]=_0x171a77[_0x07d9('0x16')]?_0x171a77['destcalleridnum']:_0x171a77[_0x07d9('0x17')];return _0x1e0cc7;});_0x1c012e=_0x171a77[_0x07d9('0x16')]?_0x171a77['destcalleridnum']:_0x171a77[_0x07d9('0x17')];}var _0x1cdc50=['id',_0x07d9('0x18'),_0x07d9('0x19'),_0x07d9('0x13'),_0x07d9('0x1a'),_0x07d9('0x1b'),'ListId',_0x07d9('0x1c'),_0x07d9('0x1d'),_0x07d9('0x1e')];var _0x51787d=_[_0x07d9('0x1f')](_0x1cdc50,_0x42c303);BPromise[_0x07d9('0x20')]()[_0x07d9('0x21')](cmContactRpc[_0x07d9('0x22')]({'attributes':_0x51787d,'where':_0x312c7,'phone':_0x1c012e}))[_0x07d9('0x21')](function(_0x50ebb6){_0x49c548=_0x50ebb6;if(!_[_0x07d9('0x23')](_0x49c548)){if(_0x49c548[_0x07d9('0x24')]===0x1){_0x219d9f=_0x49c548[0x0];logger[_0x07d9('0x25')](_0x07d9('0x26'),_0x171a77['uniqueid'],_0x4fd9c0['id'],_0x219d9f['id']);}else{logger[_0x07d9('0x25')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x171a77[_0x07d9('0x27')],_0x4fd9c0['id'],_[_0x07d9('0x15')](_0x49c548,'id')[_0x07d9('0x28')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x171a77[_0x07d9('0x27')],_0x4fd9c0['id']);var _0x17b7d1={'ListId':_0x249d8a};var _0x549b44=_0x373447[_0x07d9('0x29')]&&_0x373447['data4']!=='0'?_0x373447[_0x07d9('0x29')]:_0x07d9('0x13');if(_0x4767d){logger[_0x07d9('0x25')](_0x07d9('0x2a'),_0x171a77[_0x07d9('0x27')],_0x4fd9c0['id']);_0x17b7d1[_0x549b44]=_[_0x07d9('0x2b')](_0x171a77[_0x07d9('0x16')])?_0x171a77['calleridnum']:_0x171a77['destcalleridnum'];if(_[_0x07d9('0x2b')](_0x171a77[_0x07d9('0x16')])){_0x17b7d1[_0x07d9('0x18')]=_0x171a77['calleridname']&&_0x171a77['calleridname']!==_0x07d9('0x2c')?_0x171a77[_0x07d9('0x2d')]:'Unknown';}else{_0x17b7d1[_0x07d9('0x18')]=_0x171a77[_0x07d9('0x2e')]&&_0x171a77[_0x07d9('0x2e')]!==''?_0x171a77[_0x07d9('0x2e')]:'Unknown';}return BPromise['resolve']()[_0x07d9('0x21')](cmContactRpc[_0x07d9('0x2f')](_0x17b7d1))[_0x07d9('0x21')](function(_0x123417){_0x219d9f=_0x123417;_0x49c548[_0x07d9('0x30')](_0x123417);if(_0x219d9f){logger['info'](_0x07d9('0x31'),_0x171a77[_0x07d9('0x27')],_0x4fd9c0['id'],_0x219d9f['id']);}return;});}else{logger[_0x07d9('0x25')](_0x07d9('0x32'),_0x171a77[_0x07d9('0x27')],_0x4fd9c0['id']);_0x17b7d1[_0x549b44]=_['isNil'](_0x171a77['routeId'])?_0x171a77['calleridnum']:_0x171a77['destcalleridnum'];if(_[_0x07d9('0x2b')](_0x171a77[_0x07d9('0x16')])){_0x17b7d1['firstName']=_0x171a77[_0x07d9('0x2d')]&&_0x171a77['calleridname']!==''?_0x171a77[_0x07d9('0x2d')]:_0x07d9('0x33');}else{_0x17b7d1['firstName']=_0x171a77[_0x07d9('0x2e')]&&_0x171a77[_0x07d9('0x2e')]!==_0x07d9('0x2c')?_0x171a77[_0x07d9('0x2e')]:'Unknown';}_0x219d9f=_0x17b7d1;_0x49c548[_0x07d9('0x30')](_0x17b7d1);return;}}})[_0x07d9('0x21')](function(){if(_0x24ffbf){emit(_0x171a77['uniqueid'],_0x4fd9c0,util[_0x07d9('0x34')](_0x07d9('0x35'),_0x24ffbf[_0x07d9('0x36')]),util[_0x07d9('0x34')](_0x07d9('0x37'),_0x373447[_0x07d9('0x38')][_0x07d9('0x39')]()),{'evt':_['merge'](_0x171a77,{'autoCreate':_0x4767d}),'contact':_0x219d9f===undefined?{}:_0x219d9f,'contacts':_0x49c548['length']===0x0?undefined:_0x49c548});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 0255787..8be352f 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 _0x3333=['custom:dialconnect','custom:dialend','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:rejectmessage','custom:offlineMessage','emit','stringify','clone','motionChannel','undefined','inspect','checkTriggers','prototype','hasOwnProperty','status','checkTrigger','variables','Actions','action','toLowerCase','contactmanager','browser','data1','popup','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','data5','800','windowHeight','data6','600','winArguments','format','user:%s','interface','trigger:%s:%s','merge','name','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','search','channel','every','AllConditions','AnyConditions','some','checkTrigger:\x20trigger','evt','checkConditions','account','chat','ChatWebsiteId','operator','upperFirst','value','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','offlineMessage','created','equals','exports','util','lodash','url','mustache','ioredis','./integration','./cmContact','./script','../../../config/environment','../../../config/logger','../ami','defaults','redis','socket.io-emitter','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','bind','custom:agentconnect','custom:agentringnoanswer','syncCustomEvent','custom:agentcomplete','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','custom:dialbegin'];(function(_0x3f651b,_0x41e753){var _0x1fe705=function(_0x575588){while(--_0x575588){_0x3f651b['push'](_0x3f651b['shift']());}};_0x1fe705(++_0x41e753);}(_0x3333,0x1dd));var _0x3333=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0x3333[_0x34bf97];return _0x292719;};'use strict';var util=require(_0x3333('0x0'));var _=require(_0x3333('0x1'));var url=require(_0x3333('0x2'));var Mustache=require(_0x3333('0x3'));var Redis=require(_0x3333('0x4'));var urlforward=require('./urlforward');var integration=require(_0x3333('0x5'));var cmContact=require(_0x3333('0x6'));var script=require(_0x3333('0x7'));var config=require(_0x3333('0x8'));var logger=require(_0x3333('0x9'))('trigger');var ami=require(_0x3333('0xa'));config['redis']=_[_0x3333('0xb')](config[_0x3333('0xc')],{'host':'localhost','port':0x18eb});var io=require(_0x3333('0xd'))(new Redis(config[_0x3333('0xc')]));var operators={'equals':function(_0x39ebd2,_0x19d247){return _0x39ebd2==_0x19d247;},'not_equals':function(_0x17e324,_0x3ef33f){return _0x17e324!=_0x3ef33f;}};var barAndWebActions=['popup',_0x3333('0x2'),_0x3333('0xe')];function Trigger(_0x1473dc){this[_0x3333('0xf')]=_0x1473dc['triggers'];this['agents']=_0x1473dc[_0x3333('0x10')];this[_0x3333('0x11')]=_0x1473dc[_0x3333('0x11')];this[_0x3333('0x12')]=_0x1473dc[_0x3333('0x12')];this[_0x3333('0x13')]=_0x1473dc['voiceExtensions'];this['zendeskAccounts']=_0x1473dc[_0x3333('0x14')];this[_0x3333('0x15')]=_0x1473dc[_0x3333('0x15')];this[_0x3333('0x16')]=_0x1473dc[_0x3333('0x16')];this[_0x3333('0x17')]=_0x1473dc[_0x3333('0x17')];this[_0x3333('0x18')]=_0x1473dc['zohoAccounts'];this['deskAccounts']=_0x1473dc[_0x3333('0x19')];this[_0x3333('0x1a')]=_0x1473dc[_0x3333('0x1a')];this[_0x3333('0x1b')]=_0x1473dc[_0x3333('0x1b')];this[_0x3333('0x1c')]=_0x1473dc[_0x3333('0x1c')];this[_0x3333('0x1d')]=_0x1473dc[_0x3333('0x1d')];this[_0x3333('0x1e')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x3333('0x16')],'freshdesk':this[_0x3333('0x15')],'sugarcrm':this[_0x3333('0x17')],'zoho':this[_0x3333('0x18')],'desk':this[_0x3333('0x19')],'vtiger':this[_0x3333('0x1a')],'dynamics365':this[_0x3333('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x3333('0x1b')]};ami['on'](_0x3333('0x1f'),this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x21'),this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x22'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x24'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x25'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x26'),this[_0x3333('0x23')]['bind'](this));ami['on'](_0x3333('0x27'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on']('custom:agentcongestion',this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0x3333('0x20')](this));ami['on']('custom:amd',this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x28'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x29'),this[_0x3333('0x23')]['bind'](this));ami['on'](_0x3333('0x2a'),this['syncAgentDial'][_0x3333('0x20')](this));ami['on'](_0x3333('0x2b'),this['syncAgentDial'][_0x3333('0x20')](this));ami['on'](_0x3333('0x2c'),this[_0x3333('0x2d')]['bind'](this));ami['on'](_0x3333('0x2e'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x2f'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x30'),this['syncCustomEvent'][_0x3333('0x20')](this));ami['on'](_0x3333('0x31'),this[_0x3333('0x23')]['bind'](this));ami['on']('custom:acceptmessage',this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x32'),this[_0x3333('0x23')][_0x3333('0x20')](this));ami['on'](_0x3333('0x33'),this[_0x3333('0x23')][_0x3333('0x20')](this));}Trigger['prototype'][_0x3333('0x34')]=function(_0x801bef,_0x2d6617,_0x17e5ac){logger['info'](_0x801bef,_0x2d6617,JSON[_0x3333('0x35')](_0x17e5ac));io['to'](_0x801bef)['emit'](_0x2d6617,_0x17e5ac);};Trigger['prototype'][_0x3333('0x23')]=function(_0x1defe7){var _0x5527b3=_[_0x3333('0x36')](_0x1defe7);if(typeof _0x5527b3[_0x3333('0x37')]===_0x3333('0x38')){_0x5527b3['motionChannel']='voice';}logger['debug'](_0x3333('0x23'),util[_0x3333('0x39')](_0x5527b3,{'showHidden':!![],'depth':null}));this[_0x3333('0x3a')](_0x5527b3);};Trigger[_0x3333('0x3b')][_0x3333('0x2d')]=function(_0x4501ca){if(this[_0x3333('0x10')][_0x4501ca['interface']]){this['syncCustomEvent'](_0x4501ca);}};Trigger[_0x3333('0x3b')]['checkTriggers']=function(_0x536b2c){var _0x26a1a8;for(var _0x37928e in this['triggers']){if(this[_0x3333('0xf')][_0x3333('0x3c')](_0x37928e)){if(this[_0x3333('0xf')][_0x37928e][_0x3333('0x3d')]){_0x26a1a8=this[_0x3333('0x3e')](this[_0x3333('0xf')][_0x37928e],_0x536b2c);if(_0x26a1a8){_['merge'](_0x536b2c,_0x536b2c[_0x3333('0x3f')]);for(var _0xf1a583=0x0,_0x46906c,_0x4a8241,_0xddfb56;_0xf1a5830x0){_0x57001c=_[_0x35fc('0x26')](_0x274208,_0x1a5d92);}return _0x57001c;}function getCustomFields(_0x383837,_0x9f3c8a){var _0x3735da=[];var _0x134dfa={'custom_fields':{}};if(_0x383837[_0x35fc('0x25')]>0x0){_[_0x35fc('0x27')](_0x383837,function(_0x54aedc){if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc['type'])&&_0x54aedc[_0x35fc('0x2b')]&&!_0x54aedc[_0x35fc('0x2c')]){_0x134dfa[_0x54aedc[_0x35fc('0x2b')][_0x35fc('0x2d')]()]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_[_0x35fc('0x28')]([_0x35fc('0x29'),_0x35fc('0x2a')],_0x54aedc[_0x35fc('0x2f')])&&_0x54aedc['idField']&&_0x54aedc['customField']){_0x134dfa[_0x35fc('0x30')][_0x54aedc['idField']]=_0x54aedc[_0x35fc('0x2e')][_0x35fc('0x1e')]();}else if(_0x54aedc[_0x35fc('0x2f')]===_0x35fc('0x31')&&_0x54aedc[_0x35fc('0x32')]&&_0x54aedc[_0x35fc('0x33')]&&_0x54aedc['customField']){_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc[_0x35fc('0x32')]][_0x35fc('0x1e')]());}else if(_0x54aedc[_0x35fc('0x2f')]==='customVariable'&&_0x54aedc[_0x35fc('0x34')]&&_0x54aedc[_0x35fc('0x34')][_0x35fc('0x35')]&&_0x54aedc['idField']&&_0x54aedc[_0x35fc('0x2c')]){_0x9f3c8a[_0x54aedc['Variable'][_0x35fc('0x35')][_0x35fc('0x2d')]()]&&(_0x134dfa[_0x35fc('0x30')][_0x54aedc[_0x35fc('0x33')]]=_0x9f3c8a[_0x54aedc['Variable']['name']['toLowerCase']()][_0x35fc('0x1e')]());}});}if(_0x134dfa['priority']){_0x134dfa[_0x35fc('0x36')]=Number(_0x134dfa['priority']);}return _0x134dfa;}function getTicket(_0x9c6b65,_0x1f2d66,_0x2ca9ac,_0x22b724,_0x1c10e0){logger[_0x35fc('0xb')](_0x35fc('0x37'));var _0x4ec0dc=_[_0x35fc('0x38')]({'subject':intUtil[_0x35fc('0x39')](_0x22b724['Subjects'],_0x1c10e0,'\x20'),'type':_0x35fc('0x3a'),'status':_0x35fc('0x3b'),'labels':[_0x35fc('0x3c'),_0x35fc('0x3d'),_0x35fc('0x3e')][_0x35fc('0x3f')](getTags(_0x22b724['Tags'],_0x35fc('0x35'))),'description':intUtil[_0x35fc('0x39')](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a'),'_links':{'assigned_user':{'href':util['format'](_0x35fc('0x41'),_0x1f2d66['id']),'class':_0x35fc('0x42')}},'message':{'direction':'in','body':intUtil['getString'](_0x22b724[_0x35fc('0x40')],_0x1c10e0,'\x0a')}},getCustomFields(_0x22b724[_0x35fc('0x43')],_0x1c10e0));return request({'uri':util[_0x35fc('0x14')](_0x35fc('0x44'),_0x9c6b65[_0x35fc('0xe')],_0x2ca9ac['id']),'method':_0x35fc('0x24'),'body':_0x4ec0dc});}exports[_0x35fc('0x45')]=function(_0x3ec51f,_0x5a7e9e,_0x596e83,_0x210d5d,_0x36fcf9,_0x4fdc6d){var _0x5c2e5c,_0x4ff202;_0x4fdc6d[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x4fdc6d['remoteUri']);_0x4fdc6d[_0x35fc('0x47')]=intUtil[_0x35fc('0x46')](_0x4fdc6d[_0x35fc('0x47')]);if(_0x36fcf9&&_0x36fcf9[_0x35fc('0x48')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x5a7e9e['recordingURL']=util['format'](_0x35fc('0x49'),_0x4fdc6d[_0x35fc('0x47')],_0x5a7e9e['uniqueid'],md5(_0x5a7e9e[_0x35fc('0x4a')]));}else{_0x5a7e9e['recordingURL']='';}headers[_0x35fc('0x4b')]=getAuth(_0x4fdc6d);return getUser(_0x4fdc6d,_0x210d5d[_0x35fc('0x4c')])[_0x35fc('0x21')](function(_0x2de5d1){_0x5c2e5c=_0x2de5d1;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x5c2e5c['id']);return getEndUser(_0x4fdc6d,_0x5a7e9e[_0x35fc('0x4d')],_0x5a7e9e[_0x35fc('0x4e')]);})['then'](function(_0x18181b){_0x4ff202=_0x18181b;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x4ff202['id']);return getTicket(_0x4fdc6d,_0x5c2e5c,_0x4ff202,_0x596e83,_0x5a7e9e);})[_0x35fc('0x21')](function(_0x5bc8c3){if(_0x5bc8c3){logger[_0x35fc('0xb')]('Ticket\x20created!');logger['info'](_0x35fc('0x50'),_0x5bc8c3['id']);switch(_0x4fdc6d[_0x35fc('0x2f')]){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x53'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d['name']),_0x35fc('0x55'),{'recordId':_0x5bc8c3['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')](_0x35fc('0x54'),_0x210d5d[_0x35fc('0x35')]),_0x35fc('0x58'),{'uri':util[_0x35fc('0x14')](_0x35fc('0x59'),_0x5bc8c3['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x52'),_0x35fc('0x5b'));}}})['catch'](function(_0x553ed6){console[_0x35fc('0x5a')](_0x553ed6);logger[_0x35fc('0x5a')](_0x35fc('0x52'),JSON[_0x35fc('0x17')](_0x553ed6));});};exports[_0x35fc('0x5c')]=function(_0x3e6494,_0x4a4798,_0x4f024c,_0x388521,_0x19b2ce,_0x395d63,_0x38bc78){var _0x5b2595,_0x467980;_0x395d63[_0x35fc('0xe')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0xe')]);_0x395d63[_0x35fc('0x47')]=intUtil['stripTrailingSlash'](_0x395d63[_0x35fc('0x47')]);if(_0x38bc78&&_0x38bc78[_0x35fc('0x5d')]&&_0x38bc78[_0x35fc('0x5d')]!==_0x35fc('0x5e')){logger['info']('[OUTBOUND]','Recording\x20is\x20enabled!');_0x4a4798[_0x35fc('0x5f')]=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x395d63[_0x35fc('0x47')],_0x4a4798[_0x35fc('0x4a')],md5(_0x4a4798[_0x35fc('0x4a')]));}headers[_0x35fc('0x4b')]=getAuth(_0x395d63);return getUser(_0x395d63,_0x388521[_0x35fc('0x4c')])['then'](function(_0x2d9d45){_0x5b2595=_0x2d9d45;logger[_0x35fc('0xb')](_0x35fc('0x60'),_0x5b2595['id']);return getEndUser(_0x395d63,_0x4a4798['destcalleridname'],_0x4a4798[_0x35fc('0x61')]);})[_0x35fc('0x21')](function(_0x47fb1a){_0x467980=_0x47fb1a;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0x467980['id']);return getTicket(_0x395d63,_0x5b2595,_0x467980,_0x4f024c,_0x4a4798);})[_0x35fc('0x21')](function(_0x1c4c33){if(_0x1c4c33){logger[_0x35fc('0xb')](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x1c4c33['id']);switch(_0x395d63['type']){case _0x35fc('0x51'):logger[_0x35fc('0xb')](_0x35fc('0x52'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:desk:display',{'recordId':_0x1c4c33['id']});break;case _0x35fc('0x56'):logger[_0x35fc('0xb')](_0x35fc('0x52'),_0x35fc('0x57'));emit(util[_0x35fc('0x14')]('user:%s',_0x388521['name']),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x395d63[_0x35fc('0xe')],_0x1c4c33['id'])});break;default:logger[_0x35fc('0x5a')](_0x35fc('0x63'),_0x35fc('0x5b'));}}})['catch'](function(_0x458eb8){logger[_0x35fc('0x5a')](_0x35fc('0x63'),JSON[_0x35fc('0x17')](_0x458eb8));});};exports[_0x35fc('0x64')]=function(_0x1d0e53,_0x27071b,_0x2127e0,_0x462ceb,_0x4c3ace,_0x35d7c8){var _0x47c75f,_0xfbd737;_0x35d7c8[_0x35fc('0xe')]=intUtil[_0x35fc('0x46')](_0x35d7c8[_0x35fc('0xe')]);_0x35d7c8['serverUrl']=intUtil[_0x35fc('0x46')](_0x35d7c8['serverUrl']);if(_0x4c3ace&&_0x4c3ace['monitor_format']){logger['info']('['+_0x27071b[_0x35fc('0x65')]['toUpperCase']()+']',_0x35fc('0x66'));_0x27071b['recordingURL']=util[_0x35fc('0x14')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x35d7c8[_0x35fc('0x47')],_0x27071b[_0x35fc('0x4a')],md5(_0x27071b[_0x35fc('0x4a')]));}else{_0x27071b[_0x35fc('0x5f')]='';}headers['Authorization']=getAuth(_0x35d7c8);return getUser(_0x35d7c8)[_0x35fc('0x21')](function(_0x1e2214){_0x47c75f=_0x1e2214;logger[_0x35fc('0xb')]('The\x20User\x20ID\x20is:',_0x47c75f['id']);return getEndUser(_0x35d7c8,_0x27071b[_0x35fc('0x4d')],_0x27071b[_0x35fc('0x4e')]);})[_0x35fc('0x21')](function(_0x3c1b56){_0xfbd737=_0x3c1b56;logger[_0x35fc('0xb')](_0x35fc('0x4f'),_0xfbd737['id']);return getTicket(_0x35d7c8,_0x47c75f,_0xfbd737,_0x2127e0,_0x27071b);})[_0x35fc('0x21')](function(_0x4464d5){if(_0x4464d5){logger['info'](_0x35fc('0x62'));logger[_0x35fc('0xb')](_0x35fc('0x50'),_0x4464d5['id']);}})['catch'](function(_0x1c88d8){logger[_0x35fc('0x5a')]('['+_0x27071b['lastevent']['toUpperCase']()+']',JSON[_0x35fc('0x17')](_0x1c88d8));});}; \ No newline at end of file +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(_0x1c52be,_0x343637){var _0x20dbf7=function(_0x109c17){while(--_0x109c17){_0x1c52be['push'](_0x1c52be['shift']());}};_0x20dbf7(++_0x343637);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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 d6906a6..5e862ab 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 _0xa1b7=['ticketType','phonecall','queue','callDirection','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','outbound','%s/api/data/v9.0/','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','unmanaged','openNewTab','name',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','ioredis','../../../../config/environment','redis','defaults','localhost','modernAuthentication','remoteUri','CloudProvider','data7','tenantId','data2','data5','POST','clientId','username','password','then','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','internalemailaddress','catch','toLowerCase','destcalleridnum','calleridnum','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','picklist','nameField','customField','indexOf','content','incidents','assign','Subjects','getString','Descriptions','enduserId','/contacts(','Fields'];(function(_0x1058db,_0x7e3063){var _0x195b98=function(_0x1db9ce){while(--_0x1db9ce){_0x1058db['push'](_0x1058db['shift']());}};_0x195b98(++_0x7e3063);}(_0xa1b7,0xfd));var _0x7a1b=function(_0x782bde,_0x1e5fc3){_0x782bde=_0x782bde-0x0;var _0x39d671=_0xa1b7[_0x782bde];return _0x39d671;};'use strict';var _=require(_0x7a1b('0x0'));var rp=require(_0x7a1b('0x1'));var util=require('util');var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x7a1b('0x2'));var logger=require('../../../../config/logger')('dynamics365');var config=require(_0x7a1b('0x3'));config[_0x7a1b('0x4')]=_[_0x7a1b('0x5')](config['redis'],{'host':_0x7a1b('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7a1b('0x4')]));function getAuthToken(_0x5f5727,_0x34cb76,_0x41dbc5){if(_0x5f5727[_0x7a1b('0x7')]){_0x5f5727[_0x7a1b('0x8')]=_0x5f5727[_0x7a1b('0x9')][_0x7a1b('0xa')];_0x5f5727[_0x7a1b('0xb')]=_0x5f5727['CloudProvider'][_0x7a1b('0xc')];return Promise['resolve'](_0x5f5727[_0x7a1b('0x9')][_0x7a1b('0xd')]);}var _0x2ba85b={'method':_0x7a1b('0xe'),'uri':_0x34cb76,'form':{'client_id':_0x5f5727[_0x7a1b('0xf')],'resource':_0x5f5727[_0x7a1b('0x8')],'username':_0x5f5727[_0x7a1b('0x10')],'password':_0x5f5727[_0x7a1b('0x11')],'grant_type':_0x7a1b('0x11'),'client_secret':_0x5f5727['clientSecret']},'json':!![]};return rp(_0x2ba85b)[_0x7a1b('0x12')](function(_0x41218e){return _0x41218e[_0x7a1b('0x13')];})['catch'](function(_0x58f6f9){logger[_0x7a1b('0x14')]('['+[_0x41dbc5[_0x7a1b('0x15')]()]+_0x7a1b('0x16'));return _0x58f6f9[_0x7a1b('0x17')];});}function getUser(_0x44a722,_0xbf410c,_0x12a73d,_0x5f1340,_0x4742ef,_0xb2369b){return new Promise(function(_0x39dcc1,_0x18023d){return getAuthToken(_0xbf410c,_0x5f1340,_0xb2369b)[_0x7a1b('0x12')](function(_0x41338d){var _0x4404f5={'method':_0x7a1b('0x18'),'uri':_0x4742ef+_0x7a1b('0x19'),'headers':{'Authorization':'Bearer\x20'+_0x41338d,'OData-Version':_0x7a1b('0x1a')},'json':!![]};return rp(_0x4404f5);})[_0x7a1b('0x12')](function(_0x4de122){var _0x56156b=_0x4de122[_0x7a1b('0x1b')];var _0x21afae=![];var _0x43c097=null;if(!_[_0x7a1b('0x1c')](_0x12a73d)){if(intUtil[_0x7a1b('0x1d')](_0x12a73d[_0x7a1b('0x1e')])){_0x44a722['userEmail']=_0x12a73d[_0x7a1b('0x1e')];for(_0x43c097=0x0;_0x43c097<_0x56156b[_0x7a1b('0x1f')];_0x43c097++){if(_0x56156b[_0x43c097]['internalemailaddress']===_0x12a73d['email']&&!_0x56156b[_0x43c097][_0x7a1b('0x20')]){_0x21afae=!![];logger[_0x7a1b('0x21')]('['+[_0xb2369b[_0x7a1b('0x15')]()]+_0x7a1b('0x22')+_0x56156b[_0x43c097][_0x7a1b('0x23')]+'!');_0x44a722[_0x7a1b('0x24')]=_0x56156b[_0x43c097][_0x7a1b('0x23')];}}}}if(!_0x21afae){logger['info']('['+[_0xb2369b['toUpperCase']()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x44a722[_0x7a1b('0x25')]=_0xbf410c[_0x7a1b('0x10')];for(_0x43c097=0x0;_0x43c097<_0x56156b[_0x7a1b('0x1f')];_0x43c097++){if(_0x56156b[_0x43c097][_0x7a1b('0x26')]===_0xbf410c[_0x7a1b('0x10')]){_0x44a722[_0x7a1b('0x24')]=_0x56156b[_0x43c097]['systemuserid'];}}}_0x39dcc1(_0x44a722);})[_0x7a1b('0x27')](function(_0x3dd1fb){_0x18023d(_0x3dd1fb[_0x7a1b('0x17')]);});});}function createEndUser(_0x389a3f,_0x2f9d69,_0x4054ec,_0x50dba6,_0x5b377d,_0x2a8451,_0x333c56){return new Promise(function(_0xcc810d,_0x3de84b){return getAuthToken(_0x2f9d69,_0x4054ec,_0x2a8451)['then'](function(_0x17c026){var _0x573db9=_0x2a8451[_0x7a1b('0x28')]()==='outbound'?_0x5b377d[_0x7a1b('0x29')]:_0x5b377d[_0x7a1b('0x2a')];var _0x557312={'method':_0x7a1b('0xe'),'uri':_0x50dba6+'contacts','body':{'fullname':_0x573db9,'firstname':_0x573db9,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x7a1b('0x2b')+_0x389a3f[_0x7a1b('0x24')]+')'},'headers':{'Authorization':_0x7a1b('0x2c')+_0x17c026,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x557312['body'][_0x333c56]=_0x573db9;return rp(_0x557312);})[_0x7a1b('0x12')](function(_0x5b3c4c){var _0x4f75d0=_0x5b3c4c[_0x7a1b('0x2d')][_0x7a1b('0x2e')];var _0x45876e=_0x4f75d0[_0x7a1b('0x2f')](_0x4f75d0[_0x7a1b('0x30')]('(')+0x1,_0x4f75d0[_0x7a1b('0x30')](')'));_0x389a3f['enduserId']=_0x45876e;_0xcc810d(_0x389a3f);})[_0x7a1b('0x27')](function(_0x2de4b4){_0x3de84b(_0x2de4b4[_0x7a1b('0x17')]);});});}function getEndUser(_0x3fcc65,_0x1f0da7,_0x2e5d97,_0x2608d0,_0x4846ce,_0x269fce,_0xda1cf9,_0x1d7138){var _0x500e89=_0x269fce[_0x7a1b('0x28')]()==='outbound'?_0x4846ce[_0x7a1b('0x29')]:_0x4846ce[_0x7a1b('0x2a')];return getAuthToken(_0x1f0da7,_0x2e5d97,_0x269fce)[_0x7a1b('0x12')](function(_0x54137e){_0x1d7138=_0x1d7138?_0x1d7138:_0x7a1b('0x31');var _0x18b4db={'method':_0x7a1b('0x18'),'uri':_0x2608d0+_0x7a1b('0x32')+_0x1d7138+_0x7a1b('0x33')+_0x1d7138+_0x7a1b('0x34')+_0x500e89[_0x7a1b('0x35')]('+','%2b')+'\x27','headers':{'Authorization':_0x7a1b('0x2c')+_0x54137e,'If-None-Match':null,'OData-Version':_0x7a1b('0x1a')},'json':!![]};return rp(_0x18b4db);})[_0x7a1b('0x12')](function(_0x4de630){var _0x49c0c9=![];if(!_0x4de630)return _0x49c0c9;var _0xe344d1=_0x4de630['value'];for(var _0xbfeae5=0x0;_0xbfeae5<_0xe344d1[_0x7a1b('0x1f')];_0xbfeae5++){if(_0xe344d1[_0xbfeae5][_0x1d7138]===_0x500e89){_0x49c0c9=!![];_0x3fcc65['enduserId']=_0xe344d1[_0xbfeae5][_0x7a1b('0x36')];}}return _0x49c0c9;})[_0x7a1b('0x12')](function(_0x32b58e){if(_0x32b58e)return _0x3fcc65;if(_0xda1cf9===_0x7a1b('0x37')){logger[_0x7a1b('0x21')]('['+[_0x269fce['toUpperCase']()]+_0x7a1b('0x38'));return _0x3fcc65;}return createEndUser(_0x3fcc65,_0x1f0da7,_0x2e5d97,_0x2608d0,_0x4846ce,_0x269fce,_0x1d7138)[_0x7a1b('0x12')](function(_0x20d3a4){logger[_0x7a1b('0x21')]('['+[_0x269fce[_0x7a1b('0x15')]()]+_0x7a1b('0x39'),_0x20d3a4['enduserId']);return _0x20d3a4;});});}function getCustomFields(_0x2e2024,_0x141cbd,_0x50887f){var _0x1f6700={};if(_0x2e2024['length']>0x0){_[_0x7a1b('0x3a')](_0x2e2024,function(_0x122212){if(_[_0x7a1b('0x3b')]([_0x7a1b('0x3c'),_0x7a1b('0x3d')],_0x122212['type'])&&_0x122212[_0x7a1b('0x3e')]&&!_0x122212[_0x7a1b('0x3f')]){var _0x27cb16=_0x122212['idField']['toLowerCase']();var _0x982897=_0x27cb16[_0x7a1b('0x2f')](0x0,_0x27cb16[_0x7a1b('0x40')]('_'));var _0xc19450=_0x27cb16[_0x7a1b('0x2f')](_0x27cb16[_0x7a1b('0x40')]('_')+0x1);if(_0x982897===_0x50887f){_0x1f6700[_0xc19450]=_0x122212[_0x7a1b('0x41')];}}});}return _0x1f6700;}function getTicket(_0x2d55df,_0x384657,_0x428273,_0x330e74,_0x5f062d,_0x1e8554,_0x3e0f90){return new Promise(function(_0x15cc1c,_0x3a7d77){var _0x108b1c;return getAuthToken(_0x384657,_0x428273,_0x3e0f90)[_0x7a1b('0x12')](function(_0x1b703c){if(_0x1e8554['ticketType']==='incident'){_0x108b1c={'method':_0x7a1b('0xe'),'uri':_0x330e74+_0x7a1b('0x42'),'body':Object[_0x7a1b('0x43')]({},{'title':intUtil['getString'](_0x1e8554[_0x7a1b('0x44')],_0x5f062d,'\x20'),'description':intUtil[_0x7a1b('0x45')](_0x1e8554[_0x7a1b('0x46')],_0x5f062d,'\x0a'),'customerid_contact@odata.bind':_0x2d55df[_0x7a1b('0x47')]?_0x7a1b('0x48')+_0x2d55df[_0x7a1b('0x47')]+')':undefined,'ownerid@odata.bind':_0x7a1b('0x2b')+_0x2d55df['userId']+')','caseorigincode':'1'},getCustomFields(_0x1e8554[_0x7a1b('0x49')],_0x5f062d,_0x1e8554['ticketType'])),'headers':{'Authorization':_0x7a1b('0x2c')+_0x1b703c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1e8554[_0x7a1b('0x4a')]===_0x7a1b('0x4b')){var _0x277d54=_0x2d55df[_0x7a1b('0x47')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2d55df['userId']+')','participationtypemask':_0x2d55df['callDirection']===_0x7a1b('0x4c')?0x2:0x1},{'partyid_contact@odata.bind':_0x7a1b('0x48')+_0x2d55df[_0x7a1b('0x47')]+')','participationtypemask':_0x2d55df[_0x7a1b('0x4d')]===_0x7a1b('0x4c')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x2d55df[_0x7a1b('0x24')]+')','participationtypemask':_0x2d55df[_0x7a1b('0x4d')]===_0x7a1b('0x4c')?0x2:0x1}];_0x108b1c={'method':'POST','uri':_0x330e74+_0x7a1b('0x4e'),'body':Object['assign']({},{'subject':intUtil['getString'](_0x1e8554['Subjects'],_0x5f062d,'\x20'),'phonenumber':String(_0x5f062d[_0x7a1b('0x2a')]),'description':intUtil[_0x7a1b('0x45')](_0x1e8554[_0x7a1b('0x46')],_0x5f062d,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2d55df[_0x7a1b('0x47')]?_0x7a1b('0x48')+_0x2d55df[_0x7a1b('0x47')]+')':undefined,'ownerid@odata.bind':_0x7a1b('0x2b')+_0x2d55df[_0x7a1b('0x24')]+')','directioncode':_0x2d55df['callDirection']===_0x7a1b('0x4c')?![]:!![],'phonecall_activity_parties':_0x277d54},getCustomFields(_0x1e8554[_0x7a1b('0x49')],_0x5f062d,_0x1e8554['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x1b703c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x108b1c);})[_0x7a1b('0x12')](function(_0x17025a){var _0x5ebb38=_0x17025a[_0x7a1b('0x2d')][_0x7a1b('0x2e')];var _0x1aceac=_0x5ebb38[_0x7a1b('0x2f')](_0x5ebb38[_0x7a1b('0x30')]('(')+0x1,_0x5ebb38[_0x7a1b('0x30')](')'));_0x2d55df['ticketId']=_0x1aceac;_0x15cc1c(_0x2d55df);})[_0x7a1b('0x27')](function(_0x561e41){_0x3a7d77(_0x561e41[_0x7a1b('0x17')]);});});}function emit(_0xa30bb7,_0x28b186,_0x28981f,_0xde84eb){var _0x5a64d2={'uri':util[_0x7a1b('0x4f')](_0x7a1b('0x50'),_0xa30bb7,_0x28981f,_0xde84eb)};io['to'](util[_0x7a1b('0x4f')](_0x7a1b('0x51'),_0x28b186))[_0x7a1b('0x52')](_0x7a1b('0x53'),_0x5a64d2);}exports['cs']=function(_0x365d4b,_0x473ae4,_0x360282,_0x36fed4,_0xa28864,_0x1d14db,_0xbb8f97,_0x5f2e30){var _0x44b34b={};_0x1d14db[_0x7a1b('0x8')]=_0x1d14db['modernAuthentication']?intUtil['stripTrailingSlash'](_0x1d14db[_0x7a1b('0x9')][_0x7a1b('0xa')]):intUtil[_0x7a1b('0x54')](_0x1d14db[_0x7a1b('0x8')]);_0x1d14db[_0x7a1b('0x55')]=intUtil[_0x7a1b('0x54')](_0x1d14db[_0x7a1b('0x55')]);_0x44b34b[_0x7a1b('0x4d')]=_0x5f2e30===_0x7a1b('0x4c')||_0x5f2e30==='unmanaged'?_0x7a1b('0x4c'):_0x7a1b('0x56');var _0x2cce2c=_0x1d14db['modernAuthentication']?util[_0x7a1b('0x4f')](_0x7a1b('0x57'),_0x1d14db[_0x7a1b('0x9')]['data7']):util[_0x7a1b('0x4f')](_0x7a1b('0x57'),_0x1d14db['remoteUri']);var _0x545383=util['format']('https://login.microsoftonline.com/%s/oauth2/token',_0x1d14db[_0x7a1b('0xb')]);var _0x290add=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d14db[_0x7a1b('0x55')],_0x473ae4[_0x7a1b('0x58')],md5(_0x473ae4[_0x7a1b('0x58')]));if(_0xa28864&&_0xa28864[_0x7a1b('0x59')]){logger[_0x7a1b('0x21')](_0x7a1b('0x5a'),_0x7a1b('0x5b'));_0x473ae4[_0x7a1b('0x5c')]=_0x290add;}else if(_0xbb8f97&&_0xbb8f97[_0x7a1b('0x5d')]&&_0xbb8f97[_0x7a1b('0x5d')]!==_0x7a1b('0x5e')){logger['info'](_0x7a1b('0x5f'),_0x7a1b('0x5b'));_0x473ae4[_0x7a1b('0x5c')]=_0x290add;}else{_0x473ae4[_0x7a1b('0x5c')]='';}return getUser(_0x44b34b,_0x1d14db,_0x36fed4,_0x545383,_0x2cce2c,_0x5f2e30)[_0x7a1b('0x12')](function(_0x18e3da){logger['info']('['+_0x5f2e30[_0x7a1b('0x15')]()+_0x7a1b('0x60'),_0x18e3da[_0x7a1b('0x24')]);logger[_0x7a1b('0x21')]('['+_0x5f2e30[_0x7a1b('0x15')]()+_0x7a1b('0x61'),_0x18e3da['userEmail']);return getEndUser(_0x18e3da,_0x1d14db,_0x545383,_0x2cce2c,_0x473ae4,_0x5f2e30,_0x360282[_0x7a1b('0x62')],_0x360282[_0x7a1b('0x63')]);})[_0x7a1b('0x12')](function(_0x3b62b5){logger['info']('['+_0x5f2e30[_0x7a1b('0x15')]()+_0x7a1b('0x64'),_0x3b62b5['enduserId']);logger[_0x7a1b('0x21')]('['+_0x5f2e30[_0x7a1b('0x15')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x473ae4['calleridnum']);return getTicket(_0x3b62b5,_0x1d14db,_0x545383,_0x2cce2c,_0x473ae4,_0x360282,_0x5f2e30);})[_0x7a1b('0x12')](function(_0xad87ef){logger[_0x7a1b('0x21')](util[_0x7a1b('0x4f')]('['+_0x5f2e30['toUpperCase']()+_0x7a1b('0x65'),_0x360282['ticketType'],_0xad87ef[_0x7a1b('0x66')]));logger['info'](util['format']('['+_0x5f2e30[_0x7a1b('0x15')]()+_0x7a1b('0x67'),_0x5f2e30));if(_0x5f2e30!==_0x7a1b('0x68')&&_0x360282[_0x7a1b('0x69')]){logger[_0x7a1b('0x21')]('['+_0x5f2e30[_0x7a1b('0x15')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x1d14db[_0x7a1b('0x8')],_0x36fed4[_0x7a1b('0x6a')],_0x360282['ticketType'],_0xad87ef[_0x7a1b('0x66')]);}})[_0x7a1b('0x27')](function(_0x1f5ad8){logger['error']('['+_0x5f2e30[_0x7a1b('0x15')]()+_0x7a1b('0x6b'),_0x1f5ad8['message']);console[_0x7a1b('0x14')](_0x7a1b('0x6c'),_0x1f5ad8);});}; \ No newline at end of file +var _0xb289=['%2b','value','contactid',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','string','customField','idField','indexOf','ticketType','assign','getString','Subjects','Descriptions','Fields','phonecall','/systemusers(','callDirection','/contacts(','queue','phonecalls','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','request-promise','util','ioredis','../../../../config/logger','dynamics365','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','data5','POST','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase','GET','Bearer\x20','4.0','validateEmail','userEmail','length','email','isdisabled','info','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','username','message','toLowerCase','outbound','destcalleridnum','contacts','body','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace'];(function(_0x4326a3,_0x5d713c){var _0x26e30a=function(_0x216943){while(--_0x216943){_0x4326a3['push'](_0x4326a3['shift']());}};_0x26e30a(++_0x5d713c);}(_0xb289,0x101));var _0x9b28=function(_0x1ed6d6,_0x1756cf){_0x1ed6d6=_0x1ed6d6-0x0;var _0x42e416=_0xb289[_0x1ed6d6];return _0x42e416;};'use strict';var _=require(_0x9b28('0x0'));var rp=require(_0x9b28('0x1'));var util=require(_0x9b28('0x2'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x9b28('0x3'));var logger=require(_0x9b28('0x4'))(_0x9b28('0x5'));var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x9b28('0x6')],{'host':_0x9b28('0x7'),'port':0x18eb});var io=require(_0x9b28('0x8'))(new Redis(config['redis']));function getAuthToken(_0x562087,_0x4eb1b8,_0x1afc1a){if(_0x562087['modernAuthentication']){_0x562087[_0x9b28('0x9')]=_0x562087[_0x9b28('0xa')][_0x9b28('0xb')];_0x562087[_0x9b28('0xc')]=_0x562087[_0x9b28('0xa')][_0x9b28('0xd')];return Promise['resolve'](_0x562087[_0x9b28('0xa')][_0x9b28('0xe')]);}var _0x3d48b2={'method':_0x9b28('0xf'),'uri':_0x4eb1b8,'form':{'client_id':_0x562087[_0x9b28('0x10')],'resource':_0x562087['remoteUri'],'username':_0x562087['username'],'password':_0x562087[_0x9b28('0x11')],'grant_type':'password','client_secret':_0x562087[_0x9b28('0x12')]},'json':!![]};return rp(_0x3d48b2)[_0x9b28('0x13')](function(_0x5ac25b){return _0x5ac25b[_0x9b28('0x14')];})[_0x9b28('0x15')](function(_0x274f23){logger[_0x9b28('0x16')]('['+[_0x1afc1a[_0x9b28('0x17')]()]+']\x20Wrong\x20credentials!');return _0x274f23['message'];});}function getUser(_0x4476ce,_0x1a4103,_0x4b32e1,_0xd35801,_0x26ba5b,_0x19eb36){return new Promise(function(_0x51f99d,_0x374c13){return getAuthToken(_0x1a4103,_0xd35801,_0x19eb36)['then'](function(_0x19fad8){var _0x598dae={'method':_0x9b28('0x18'),'uri':_0x26ba5b+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x9b28('0x19')+_0x19fad8,'OData-Version':_0x9b28('0x1a')},'json':!![]};return rp(_0x598dae);})[_0x9b28('0x13')](function(_0x21eed1){var _0x1f15e1=_0x21eed1['value'];var _0x380ac2=![];var _0x5640fa=null;if(!_['isNil'](_0x4b32e1)){if(intUtil[_0x9b28('0x1b')](_0x4b32e1['email'])){_0x4476ce[_0x9b28('0x1c')]=_0x4b32e1['email'];for(_0x5640fa=0x0;_0x5640fa<_0x1f15e1[_0x9b28('0x1d')];_0x5640fa++){if(_0x1f15e1[_0x5640fa]['internalemailaddress']===_0x4b32e1[_0x9b28('0x1e')]&&!_0x1f15e1[_0x5640fa][_0x9b28('0x1f')]){_0x380ac2=!![];logger[_0x9b28('0x20')]('['+[_0x19eb36[_0x9b28('0x17')]()]+']\x20Agent\x20found\x20'+_0x1f15e1[_0x5640fa]['systemuserid']+'!');_0x4476ce[_0x9b28('0x21')]=_0x1f15e1[_0x5640fa][_0x9b28('0x22')];}}}}if(!_0x380ac2){logger[_0x9b28('0x20')]('['+[_0x19eb36[_0x9b28('0x17')]()]+_0x9b28('0x23'));_0x4476ce[_0x9b28('0x1c')]=_0x1a4103['username'];for(_0x5640fa=0x0;_0x5640fa<_0x1f15e1[_0x9b28('0x1d')];_0x5640fa++){if(_0x1f15e1[_0x5640fa][_0x9b28('0x24')]===_0x1a4103[_0x9b28('0x25')]){_0x4476ce[_0x9b28('0x21')]=_0x1f15e1[_0x5640fa][_0x9b28('0x22')];}}}_0x51f99d(_0x4476ce);})[_0x9b28('0x15')](function(_0x48dd1d){_0x374c13(_0x48dd1d[_0x9b28('0x26')]);});});}function createEndUser(_0x30afbd,_0x23027b,_0x460a6a,_0x3e6e5e,_0x5d43b8,_0x4fdd2f,_0x18bcbc){return new Promise(function(_0x3e12e5,_0x4bbd57){return getAuthToken(_0x23027b,_0x460a6a,_0x4fdd2f)[_0x9b28('0x13')](function(_0x428566){var _0x4205e3=_0x4fdd2f[_0x9b28('0x27')]()===_0x9b28('0x28')?_0x5d43b8[_0x9b28('0x29')]:_0x5d43b8['calleridnum'];var _0x43ad04={'method':_0x9b28('0xf'),'uri':_0x3e6e5e+_0x9b28('0x2a'),'body':{'fullname':_0x4205e3,'firstname':_0x4205e3,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x30afbd[_0x9b28('0x21')]+')'},'headers':{'Authorization':_0x9b28('0x19')+_0x428566,'OData-Version':_0x9b28('0x1a')},'json':!![],'resolveWithFullResponse':!![]};_0x43ad04[_0x9b28('0x2b')][_0x18bcbc]=_0x4205e3;return rp(_0x43ad04);})[_0x9b28('0x13')](function(_0x782eab){var _0x1ddbb7=_0x782eab[_0x9b28('0x2c')][_0x9b28('0x2d')];var _0x4741fd=_0x1ddbb7[_0x9b28('0x2e')](_0x1ddbb7[_0x9b28('0x2f')]('(')+0x1,_0x1ddbb7[_0x9b28('0x2f')](')'));_0x30afbd[_0x9b28('0x30')]=_0x4741fd;_0x3e12e5(_0x30afbd);})[_0x9b28('0x15')](function(_0x29c98b){_0x4bbd57(_0x29c98b[_0x9b28('0x26')]);});});}function getEndUser(_0x4d6919,_0x326ec0,_0x1d42ae,_0x5a631a,_0x14a4cc,_0x2ec55f,_0x5bd6db,_0x1c94df){var _0x31f441=_0x2ec55f['toLowerCase']()===_0x9b28('0x28')?_0x14a4cc['destcalleridnum']:_0x14a4cc[_0x9b28('0x31')];return getAuthToken(_0x326ec0,_0x1d42ae,_0x2ec55f)[_0x9b28('0x13')](function(_0x566cca){_0x1c94df=_0x1c94df?_0x1c94df:_0x9b28('0x32');var _0x32b0aa={'method':_0x9b28('0x18'),'uri':_0x5a631a+_0x9b28('0x33')+_0x1c94df+_0x9b28('0x34')+_0x1c94df+_0x9b28('0x35')+_0x31f441[_0x9b28('0x36')]('+',_0x9b28('0x37'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x566cca,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x32b0aa);})[_0x9b28('0x13')](function(_0x630fb){var _0x492f8b=![];if(!_0x630fb)return _0x492f8b;var _0x30f63e=_0x630fb[_0x9b28('0x38')];for(var _0x187e79=0x0;_0x187e79<_0x30f63e[_0x9b28('0x1d')];_0x187e79++){if(_0x30f63e[_0x187e79][_0x1c94df]===_0x31f441){_0x492f8b=!![];_0x4d6919['enduserId']=_0x30f63e[_0x187e79][_0x9b28('0x39')];}}return _0x492f8b;})[_0x9b28('0x13')](function(_0x337cc2){if(_0x337cc2)return _0x4d6919;if(_0x5bd6db==='nothing'){logger['info']('['+[_0x2ec55f[_0x9b28('0x17')]()]+_0x9b28('0x3a'));return _0x4d6919;}return createEndUser(_0x4d6919,_0x326ec0,_0x1d42ae,_0x5a631a,_0x14a4cc,_0x2ec55f,_0x1c94df)['then'](function(_0x36e712){logger[_0x9b28('0x20')]('['+[_0x2ec55f[_0x9b28('0x17')]()]+_0x9b28('0x3b'),_0x36e712[_0x9b28('0x30')]);return _0x36e712;});});}function getCustomFields(_0x404c18,_0x2503df,_0x4d58f7){var _0x2f876d={};if(_0x404c18[_0x9b28('0x1d')]>0x0){_[_0x9b28('0x3c')](_0x404c18,function(_0x5c2696){if(_[_0x9b28('0x3d')]([_0x9b28('0x3e'),'picklist'],_0x5c2696['type'])&&_0x5c2696['nameField']&&!_0x5c2696[_0x9b28('0x3f')]){var _0x930692=_0x5c2696[_0x9b28('0x40')][_0x9b28('0x27')]();var _0x246072=_0x930692['substring'](0x0,_0x930692[_0x9b28('0x41')]('_'));var _0x3ddf83=_0x930692[_0x9b28('0x2e')](_0x930692[_0x9b28('0x41')]('_')+0x1);if(_0x246072===_0x4d58f7){_0x2f876d[_0x3ddf83]=_0x5c2696['content'];}}});}return _0x2f876d;}function getTicket(_0x1f009e,_0x5b0f7f,_0xeeb30f,_0xc8b510,_0x23e1ec,_0x1daa7a,_0x137711){return new Promise(function(_0x730333,_0x418b97){var _0x323783;return getAuthToken(_0x5b0f7f,_0xeeb30f,_0x137711)[_0x9b28('0x13')](function(_0x4ca3a5){if(_0x1daa7a[_0x9b28('0x42')]==='incident'){_0x323783={'method':_0x9b28('0xf'),'uri':_0xc8b510+'incidents','body':Object[_0x9b28('0x43')]({},{'title':intUtil[_0x9b28('0x44')](_0x1daa7a[_0x9b28('0x45')],_0x23e1ec,'\x20'),'description':intUtil[_0x9b28('0x44')](_0x1daa7a[_0x9b28('0x46')],_0x23e1ec,'\x0a'),'customerid_contact@odata.bind':_0x1f009e['enduserId']?'/contacts('+_0x1f009e[_0x9b28('0x30')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x1f009e[_0x9b28('0x21')]+')','caseorigincode':'1'},getCustomFields(_0x1daa7a[_0x9b28('0x47')],_0x23e1ec,_0x1daa7a[_0x9b28('0x42')])),'headers':{'Authorization':'Bearer\x20'+_0x4ca3a5,'OData-Version':_0x9b28('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x1daa7a['ticketType']===_0x9b28('0x48')){var _0x185ac8=_0x1f009e[_0x9b28('0x30')]?[{'partyid_systemuser@odata.bind':_0x9b28('0x49')+_0x1f009e['userId']+')','participationtypemask':_0x1f009e[_0x9b28('0x4a')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x9b28('0x4b')+_0x1f009e[_0x9b28('0x30')]+')','participationtypemask':_0x1f009e['callDirection']==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1f009e[_0x9b28('0x21')]+')','participationtypemask':_0x1f009e[_0x9b28('0x4a')]===_0x9b28('0x4c')?0x2:0x1}];_0x323783={'method':_0x9b28('0xf'),'uri':_0xc8b510+_0x9b28('0x4d'),'body':Object[_0x9b28('0x43')]({},{'subject':intUtil['getString'](_0x1daa7a[_0x9b28('0x45')],_0x23e1ec,'\x20'),'phonenumber':String(_0x23e1ec[_0x9b28('0x31')]),'description':intUtil[_0x9b28('0x44')](_0x1daa7a['Descriptions'],_0x23e1ec,'\x0a'),'regardingobjectid_contact@odata.bind':_0x1f009e[_0x9b28('0x30')]?_0x9b28('0x4b')+_0x1f009e[_0x9b28('0x30')]+')':undefined,'ownerid@odata.bind':_0x9b28('0x49')+_0x1f009e[_0x9b28('0x21')]+')','directioncode':_0x1f009e[_0x9b28('0x4a')]===_0x9b28('0x4c')?![]:!![],'phonecall_activity_parties':_0x185ac8},getCustomFields(_0x1daa7a['Fields'],_0x23e1ec,_0x1daa7a['ticketType'])),'headers':{'Authorization':_0x9b28('0x19')+_0x4ca3a5,'OData-Version':_0x9b28('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x323783);})[_0x9b28('0x13')](function(_0x248da1){var _0x2ef9c2=_0x248da1[_0x9b28('0x2c')][_0x9b28('0x2d')];var _0x435ce8=_0x2ef9c2[_0x9b28('0x2e')](_0x2ef9c2['lastIndexOf']('(')+0x1,_0x2ef9c2[_0x9b28('0x2f')](')'));_0x1f009e['ticketId']=_0x435ce8;_0x730333(_0x1f009e);})['catch'](function(_0x45c68c){_0x418b97(_0x45c68c['message']);});});}function emit(_0x5f2f7d,_0x309b45,_0x4a7ad3,_0x5e01d8){var _0x4ab913={'uri':util[_0x9b28('0x4e')](_0x9b28('0x4f'),_0x5f2f7d,_0x4a7ad3,_0x5e01d8)};io['to'](util[_0x9b28('0x4e')]('user:%s',_0x309b45))[_0x9b28('0x50')]('trigger:browser:url',_0x4ab913);}exports['cs']=function(_0x4ef812,_0x29e13d,_0x48b77c,_0x20a414,_0x5c1c8c,_0x215d3c,_0xfdcf4,_0x5c906f){var _0x7eb8b2={};_0x215d3c[_0x9b28('0x9')]=_0x215d3c[_0x9b28('0x51')]?intUtil[_0x9b28('0x52')](_0x215d3c[_0x9b28('0xa')][_0x9b28('0xb')]):intUtil['stripTrailingSlash'](_0x215d3c[_0x9b28('0x9')]);_0x215d3c[_0x9b28('0x53')]=intUtil[_0x9b28('0x52')](_0x215d3c['serverUrl']);_0x7eb8b2[_0x9b28('0x4a')]=_0x5c906f==='queue'||_0x5c906f===_0x9b28('0x54')?_0x9b28('0x4c'):_0x9b28('0x28');var _0x4e3433=_0x215d3c[_0x9b28('0x51')]?util[_0x9b28('0x4e')](_0x9b28('0x55'),_0x215d3c['CloudProvider'][_0x9b28('0xb')]):util[_0x9b28('0x4e')](_0x9b28('0x55'),_0x215d3c[_0x9b28('0x9')]);var _0x1bde12=util[_0x9b28('0x4e')](_0x9b28('0x56'),_0x215d3c[_0x9b28('0xc')]);var _0x139565=util[_0x9b28('0x4e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x215d3c[_0x9b28('0x53')],_0x29e13d[_0x9b28('0x57')],md5(_0x29e13d['uniqueid']));if(_0x5c1c8c&&_0x5c1c8c['monitor_format']){logger['info'](_0x9b28('0x58'),_0x9b28('0x59'));_0x29e13d[_0x9b28('0x5a')]=_0x139565;}else if(_0xfdcf4&&_0xfdcf4['recordingFormat']&&_0xfdcf4[_0x9b28('0x5b')]!==_0x9b28('0x5c')){logger[_0x9b28('0x20')](_0x9b28('0x5d'),_0x9b28('0x59'));_0x29e13d[_0x9b28('0x5a')]=_0x139565;}else{_0x29e13d[_0x9b28('0x5a')]='';}return getUser(_0x7eb8b2,_0x215d3c,_0x20a414,_0x1bde12,_0x4e3433,_0x5c906f)['then'](function(_0xa7098){logger[_0x9b28('0x20')]('['+_0x5c906f[_0x9b28('0x17')]()+_0x9b28('0x5e'),_0xa7098[_0x9b28('0x21')]);logger[_0x9b28('0x20')]('['+_0x5c906f[_0x9b28('0x17')]()+_0x9b28('0x5f'),_0xa7098['userEmail']);return getEndUser(_0xa7098,_0x215d3c,_0x1bde12,_0x4e3433,_0x29e13d,_0x5c906f,_0x48b77c[_0x9b28('0x60')],_0x48b77c[_0x9b28('0x61')]);})[_0x9b28('0x13')](function(_0x4925f7){logger['info']('['+_0x5c906f[_0x9b28('0x17')]()+_0x9b28('0x62'),_0x4925f7[_0x9b28('0x30')]);logger[_0x9b28('0x20')]('['+_0x5c906f[_0x9b28('0x17')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x29e13d[_0x9b28('0x31')]);return getTicket(_0x4925f7,_0x215d3c,_0x1bde12,_0x4e3433,_0x29e13d,_0x48b77c,_0x5c906f);})[_0x9b28('0x13')](function(_0x14a94d){logger[_0x9b28('0x20')](util[_0x9b28('0x4e')]('['+_0x5c906f['toUpperCase']()+_0x9b28('0x63'),_0x48b77c[_0x9b28('0x42')],_0x14a94d[_0x9b28('0x64')]));logger[_0x9b28('0x20')](util[_0x9b28('0x4e')]('['+_0x5c906f[_0x9b28('0x17')]()+_0x9b28('0x65'),_0x5c906f));if(_0x5c906f!=='unmanaged'&&_0x48b77c['openNewTab']){logger[_0x9b28('0x20')]('['+_0x5c906f[_0x9b28('0x17')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x215d3c[_0x9b28('0x9')],_0x20a414[_0x9b28('0x66')],_0x48b77c[_0x9b28('0x42')],_0x14a94d[_0x9b28('0x64')]);}})[_0x9b28('0x15')](function(_0x17c02b){logger[_0x9b28('0x16')]('['+_0x5c906f[_0x9b28('0x17')]()+_0x9b28('0x67'),_0x17c02b[_0x9b28('0x26')]);console[_0x9b28('0x16')]('Error\x20running\x20Dynamics365\x20integration',_0x17c02b);});}; \ 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 671cf36..9871385 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 _0x34b5=['monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','stringify','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','user:%s','catch','error','lastevent','Ticket\x20created!','lodash','md5','util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','Subjects','getString','Descriptions','
','name','Fields','custom_fields','mapValues','keyBy','value','POST','then','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','remoteUri','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','includes','string','picklist','type','nameField','customField','toLowerCase','push','idField','variableName','Variable','queue','serverUrl','stripTrailingSlash'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x34b5,0x16d));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x534b('0x0'));var rp=require('request-promise');var md5=require(_0x534b('0x1'));var util=require(_0x534b('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x534b('0x3'));var logger=require(_0x534b('0x4'))('freshdesk');config['redis']=_[_0x534b('0x5')](config[_0x534b('0x6')],{'host':_0x534b('0x7'),'port':0x18eb});var io=require(_0x534b('0x8'))(new Redis(config[_0x534b('0x6')]));var headers={'Content-Type':_0x534b('0x9'),'Accept':'application/json'};function emit(_0x1cc62e,_0x5057a3,_0x56318c){io['to'](_0x1cc62e)['emit'](_0x5057a3,_0x56318c);}function getTicket(_0xc6c015,_0x5539fa,_0x363075,_0x1a0abd,_0x52056a){logger[_0x534b('0xa')](_0x534b('0xb'));var _0x43cdf0=_['merge']({'responder_id':_0x5539fa['id'],'requester_id':_0x363075['id'],'name':util[_0x534b('0xc')](_0x534b('0xd'),_0x52056a['calleridname']),'phone':_0x52056a[_0x534b('0xe')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x1a0abd[_0x534b('0xf')],_0x52056a,'\x20'),'description':intUtil[_0x534b('0x10')](_0x1a0abd[_0x534b('0x11')],_0x52056a,_0x534b('0x12')),'tags':getTags(_0x1a0abd['Tags'],_0x534b('0x13'))},getCustomFields(_0x1a0abd[_0x534b('0x14')],_0x52056a));_0x43cdf0[_0x534b('0x15')]=_[_0x534b('0x16')](_[_0x534b('0x17')](_0x43cdf0[_0x534b('0x15')],'id'),_0x534b('0x18'));return request({'uri':util[_0x534b('0xc')]('%s/api/v2/tickets',_0xc6c015['remoteUri']),'method':_0x534b('0x19'),'body':_0x43cdf0})[_0x534b('0x1a')](function(_0x38d776){logger[_0x534b('0xa')]('Ticket\x20created!');return _0x38d776;});}function getUser(_0x348ec4,_0x50dde7){if(intUtil[_0x534b('0x1b')](_0x50dde7)){return request({'uri':util[_0x534b('0xc')](_0x534b('0x1c'),_0x348ec4['remoteUri']),'qs':{'email':_0x50dde7}})['then'](function(_0x2eeb35){if(_0x2eeb35[_0x534b('0x1d')]){logger[_0x534b('0xa')](_0x534b('0x1e'));return _[_0x534b('0x1f')](_0x2eeb35,function(_0x21386d){return _0x21386d['contact']['email']===_0x50dde7;});}else{logger[_0x534b('0xa')](_0x534b('0x20'));return request({'uri':util[_0x534b('0xc')](_0x534b('0x21'),_0x348ec4[_0x534b('0x22')])})[_0x534b('0x1a')](function(_0x4f3a4a){logger[_0x534b('0xa')](_0x534b('0x23'));return _0x4f3a4a;});}});}else{logger[_0x534b('0xa')](_0x534b('0x24'));return request({'uri':util[_0x534b('0xc')](_0x534b('0x21'),_0x348ec4[_0x534b('0x22')])})[_0x534b('0x1a')](function(_0x28c268){logger[_0x534b('0xa')](_0x534b('0x23'));return _0x28c268;});}}function getEndUser(_0x40080a,_0xaf848e,_0x247fb3){logger['info']('Searching\x20enduser\x20with\x20phone',_0x247fb3);return request({'uri':util['format'](_0x534b('0x25'),_0x40080a[_0x534b('0x22')]),'qs':{'phone':_0x247fb3}})[_0x534b('0x1a')](function(_0x2192dd){if(_0x2192dd[_0x534b('0x1d')]){logger['info'](_0x534b('0x26'));return _[_0x534b('0x1f')](_0x2192dd,{'phone':_0x247fb3});}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x534b('0x25'),_0x40080a[_0x534b('0x22')]),'method':_0x534b('0x19'),'body':{'name':_0xaf848e,'phone':_0x247fb3}})[_0x534b('0x1a')](function(_0xf0b95){logger[_0x534b('0xa')]('Enduser\x20created.');return _0xf0b95;});}});}function getAuth(_0x7e8049){return util[_0x534b('0xc')](_0x534b('0x27'),new Buffer(_0x7e8049[_0x534b('0x28')]+':X')[_0x534b('0x29')](_0x534b('0x2a')));}function request(_0x108df4){logger[_0x534b('0x2b')](_0x534b('0x2c'),JSON['stringify'](_0x108df4));return rp(_[_0x534b('0x5')](_0x108df4,{'method':_0x534b('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x5bf0ee,_0x2f36d1){var _0x72758e=[];if(_0x5bf0ee&&_0x5bf0ee[_0x534b('0x1d')]>0x0){_0x72758e=_['map'](_0x5bf0ee,_0x2f36d1);}return _0x72758e;}function getCustomFields(_0x3560d9,_0x58dc63){var _0x3aecaf=[];var _0x5950a8={'custom_fields':[]};if(_0x3560d9[_0x534b('0x1d')]>0x0){_['forEach'](_0x3560d9,function(_0xa4d3d3){if(_[_0x534b('0x2e')]([_0x534b('0x2f'),_0x534b('0x30')],_0xa4d3d3[_0x534b('0x31')])&&_0xa4d3d3[_0x534b('0x32')]&&!_0xa4d3d3[_0x534b('0x33')]){_0x5950a8[_0xa4d3d3[_0x534b('0x32')][_0x534b('0x34')]()]=_0xa4d3d3['content']['toString']();}else if(_[_0x534b('0x2e')]([_0x534b('0x2f'),'picklist'],_0xa4d3d3[_0x534b('0x31')])&&_0xa4d3d3['idField']&&_0xa4d3d3[_0x534b('0x33')]){_0x5950a8[_0x534b('0x15')][_0x534b('0x35')]({'id':_0xa4d3d3[_0x534b('0x36')],'value':_0xa4d3d3['content'][_0x534b('0x29')]()});}else if(_0xa4d3d3['type']==='variable'&&_0xa4d3d3[_0x534b('0x37')]&&_0xa4d3d3[_0x534b('0x36')]&&_0xa4d3d3[_0x534b('0x33')]){_0x58dc63[_0xa4d3d3[_0x534b('0x37')]]&&_0x5950a8[_0x534b('0x15')]['push']({'id':_0xa4d3d3[_0x534b('0x36')],'value':_0x58dc63[_0xa4d3d3[_0x534b('0x37')]]['toString']()});}else if(_0xa4d3d3[_0x534b('0x31')]==='customVariable'&&_0xa4d3d3[_0x534b('0x38')]&&_0xa4d3d3[_0x534b('0x38')][_0x534b('0x13')]&&_0xa4d3d3[_0x534b('0x36')]&&_0xa4d3d3[_0x534b('0x33')]){_0x58dc63[_0xa4d3d3[_0x534b('0x38')][_0x534b('0x13')][_0x534b('0x34')]()]&&_0x5950a8[_0x534b('0x15')][_0x534b('0x35')]({'id':_0xa4d3d3[_0x534b('0x36')],'value':_0x58dc63[_0xa4d3d3['Variable']['name']['toLowerCase']()]['toString']()});}});}return _0x5950a8;}exports[_0x534b('0x39')]=function(_0x2c9cdd,_0x329faf,_0x2eb525,_0x2c5c3f,_0x3e97a3,_0x507932){var _0xbd8797,_0x4dc86c;_0x507932[_0x534b('0x22')]=intUtil['stripTrailingSlash'](_0x507932['remoteUri']);_0x507932[_0x534b('0x3a')]=intUtil[_0x534b('0x3b')](_0x507932[_0x534b('0x3a')]);if(_0x3e97a3&&_0x3e97a3[_0x534b('0x3c')]){logger[_0x534b('0xa')](_0x534b('0x3d'),'Recording\x20is\x20enabled!');_0x329faf[_0x534b('0x3e')]=util[_0x534b('0xc')](_0x534b('0x3f'),_0x507932[_0x534b('0x3a')],_0x329faf['uniqueid'],md5(_0x329faf[_0x534b('0x40')]));}else{_0x329faf[_0x534b('0x3e')]='';}headers[_0x534b('0x41')]=getAuth(_0x507932);return getUser(_0x507932,_0x2c5c3f[_0x534b('0x42')])[_0x534b('0x1a')](function(_0x825efe){_0xbd8797=_0x825efe;logger[_0x534b('0xa')](_0x534b('0x43'),_0xbd8797['id']);return getEndUser(_0x507932,_0x329faf[_0x534b('0x44')],_0x329faf[_0x534b('0xe')]);})[_0x534b('0x1a')](function(_0x4fba1d){_0x4dc86c=_0x4fba1d;logger[_0x534b('0xa')](_0x534b('0x45'),_0x4dc86c['id']);return getTicket(_0x507932,_0xbd8797,_0x4dc86c,_0x2eb525,_0x329faf);})[_0x534b('0x1a')](function(_0x24dfcb){if(_0x24dfcb&&_0x24dfcb['id']){logger[_0x534b('0xa')]('Ticket\x20created!');logger['info'](_0x534b('0x46'),_0x24dfcb['id']);logger[_0x534b('0xa')]('[QUEUE]',_0x534b('0x47'));emit(util['format']('user:%s',_0x2c5c3f['name']),_0x534b('0x48'),{'uri':util[_0x534b('0xc')](_0x534b('0x49'),_0x507932[_0x534b('0x22')],_0x24dfcb['id'])});}})['catch'](function(_0x3a68af){logger['error'](_0x534b('0x3d'),JSON[_0x534b('0x4a')](_0x3a68af));});};exports['outbound']=function(_0x5df782,_0x504c64,_0x4a371c,_0x41e1d1,_0x55663b,_0x170283,_0x2de3ba){var _0x34ce8e,_0x1e979d;_0x170283[_0x534b('0x22')]=intUtil[_0x534b('0x3b')](_0x170283[_0x534b('0x22')]);_0x170283[_0x534b('0x3a')]=intUtil[_0x534b('0x3b')](_0x170283[_0x534b('0x3a')]);if(_0x2de3ba&&_0x2de3ba['recordingFormat']&&_0x2de3ba['recordingFormat']!==_0x534b('0x4b')){logger[_0x534b('0xa')](_0x534b('0x4c'),_0x534b('0x4d'));_0x504c64['recordingURL']=util['format'](_0x534b('0x3f'),_0x170283[_0x534b('0x3a')],_0x504c64[_0x534b('0x40')],md5(_0x504c64[_0x534b('0x40')]));}headers[_0x534b('0x41')]=getAuth(_0x170283);return getUser(_0x170283,_0x41e1d1[_0x534b('0x42')])[_0x534b('0x1a')](function(_0x4b82b2){_0x34ce8e=_0x4b82b2;logger[_0x534b('0xa')](_0x534b('0x43'),_0x34ce8e['id']);return getEndUser(_0x170283,_0x504c64[_0x534b('0x4e')],_0x504c64[_0x534b('0x4f')]);})['then'](function(_0x77bad6){_0x1e979d=_0x77bad6;logger[_0x534b('0xa')](_0x534b('0x45'),_0x1e979d['id']);return getTicket(_0x170283,_0x34ce8e,_0x1e979d,_0x4a371c,_0x504c64);})[_0x534b('0x1a')](function(_0x3dfcd5){if(_0x3dfcd5&&_0x3dfcd5['id']){logger[_0x534b('0xa')]('Ticket\x20created!');logger[_0x534b('0xa')](_0x534b('0x46'),_0x3dfcd5['id']);logger['info'](_0x534b('0x4c'),_0x534b('0x47'));emit(util[_0x534b('0xc')](_0x534b('0x50'),_0x41e1d1['name']),_0x534b('0x48'),{'uri':util[_0x534b('0xc')](_0x534b('0x49'),_0x170283['remoteUri'],_0x3dfcd5['id'])});}})[_0x534b('0x51')](function(_0x3a203e){logger[_0x534b('0x52')](_0x534b('0x4c'),JSON[_0x534b('0x4a')](_0x3a203e));});};exports['unmanaged']=function(_0x2a9ea3,_0x508a35,_0x36d066,_0x5471cb,_0x1a7b0b,_0x52481b){var _0x309662,_0x2febe4;_0x52481b[_0x534b('0x22')]=intUtil[_0x534b('0x3b')](_0x52481b[_0x534b('0x22')]);_0x52481b[_0x534b('0x3a')]=intUtil[_0x534b('0x3b')](_0x52481b['serverUrl']);if(_0x1a7b0b&&_0x1a7b0b[_0x534b('0x3c')]){logger[_0x534b('0xa')]('['+_0x508a35[_0x534b('0x53')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x508a35[_0x534b('0x3e')]=util[_0x534b('0xc')](_0x534b('0x3f'),_0x52481b[_0x534b('0x3a')],_0x508a35[_0x534b('0x40')],md5(_0x508a35[_0x534b('0x40')]));}else{_0x508a35['recordingURL']='';}headers[_0x534b('0x41')]=getAuth(_0x52481b);return getUser(_0x52481b,'')['then'](function(_0x3b4cb2){_0x309662=_0x3b4cb2;logger[_0x534b('0xa')](_0x534b('0x43'),_0x309662['id']);return getEndUser(_0x52481b,_0x508a35[_0x534b('0x44')],_0x508a35[_0x534b('0xe')]);})[_0x534b('0x1a')](function(_0x36dba3){_0x2febe4=_0x36dba3;logger[_0x534b('0xa')](_0x534b('0x45'),_0x2febe4['id']);return getTicket(_0x52481b,_0x309662,_0x2febe4,_0x36d066,_0x508a35);})[_0x534b('0x1a')](function(_0x1e97d1){if(_0x1e97d1){logger[_0x534b('0xa')](_0x534b('0x54'));logger[_0x534b('0xa')]('The\x20Ticket\x20ID\x20is:',_0x1e97d1['id']);}})[_0x534b('0x51')](function(_0x4aa77e){logger[_0x534b('0x52')]('['+_0x508a35[_0x534b('0x53')]['toUpperCase']()+']',JSON['stringify'](_0x4aa77e));});}; \ No newline at end of file +var _0x9bdc=['format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','Fields','custom_fields','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','%s/api/v2/agents/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','[HTTP]','stringify','GET','map','forEach','string','picklist','type','customField','nameField','content','idField','push','variableName','customVariable','Variable','name','toLowerCase','queue','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','The\x20Ticket\x20ID\x20is:','catch','unmanaged','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','defaults','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge'];(function(_0x5bc6a6,_0x158e11){var _0x312c55=function(_0x439cdd){while(--_0x439cdd){_0x5bc6a6['push'](_0x5bc6a6['shift']());}};_0x312c55(++_0x158e11);}(_0x9bdc,0x1c6));var _0xc9bd=function(_0x39495e,_0x520bdb){_0x39495e=_0x39495e-0x0;var _0x16691c=_0x9bdc[_0x39495e];return _0x16691c;};'use strict';var _=require(_0xc9bd('0x0'));var rp=require(_0xc9bd('0x1'));var md5=require(_0xc9bd('0x2'));var util=require(_0xc9bd('0x3'));var Redis=require(_0xc9bd('0x4'));var intUtil=require(_0xc9bd('0x5'));var config=require(_0xc9bd('0x6'));var logger=require('../../../../config/logger')(_0xc9bd('0x7'));config['redis']=_[_0xc9bd('0x8')](config[_0xc9bd('0x9')],{'host':_0xc9bd('0xa'),'port':0x18eb});var io=require(_0xc9bd('0xb'))(new Redis(config[_0xc9bd('0x9')]));var headers={'Content-Type':'application/json','Accept':_0xc9bd('0xc')};function emit(_0x4b4d16,_0x3f3f40,_0x1de118){io['to'](_0x4b4d16)['emit'](_0x3f3f40,_0x1de118);}function getTicket(_0x5e1235,_0x55858c,_0x1940eb,_0x28f447,_0x1478de){logger[_0xc9bd('0xd')](_0xc9bd('0xe'));var _0x186bc3=_[_0xc9bd('0xf')]({'responder_id':_0x55858c['id'],'requester_id':_0x1940eb['id'],'name':util[_0xc9bd('0x10')](_0xc9bd('0x11'),_0x1478de[_0xc9bd('0x12')]),'phone':_0x1478de[_0xc9bd('0x13')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xc9bd('0x14')](_0x28f447[_0xc9bd('0x15')],_0x1478de,'\x20'),'description':intUtil[_0xc9bd('0x14')](_0x28f447[_0xc9bd('0x16')],_0x1478de,_0xc9bd('0x17')),'tags':getTags(_0x28f447[_0xc9bd('0x18')],'name')},getCustomFields(_0x28f447[_0xc9bd('0x19')],_0x1478de));_0x186bc3[_0xc9bd('0x1a')]=_['mapValues'](_['keyBy'](_0x186bc3[_0xc9bd('0x1a')],'id'),'value');return request({'uri':util[_0xc9bd('0x10')]('%s/api/v2/tickets',_0x5e1235['remoteUri']),'method':_0xc9bd('0x1b'),'body':_0x186bc3})[_0xc9bd('0x1c')](function(_0x48f58f){logger[_0xc9bd('0xd')](_0xc9bd('0x1d'));return _0x48f58f;});}function getUser(_0x354bc7,_0x5ddb4d){if(intUtil[_0xc9bd('0x1e')](_0x5ddb4d)){return request({'uri':util[_0xc9bd('0x10')](_0xc9bd('0x1f'),_0x354bc7['remoteUri']),'qs':{'email':_0x5ddb4d}})[_0xc9bd('0x1c')](function(_0x282434){if(_0x282434[_0xc9bd('0x20')]){logger['info'](_0xc9bd('0x21'));return _[_0xc9bd('0x22')](_0x282434,function(_0x34b6e5){return _0x34b6e5[_0xc9bd('0x23')][_0xc9bd('0x24')]===_0x5ddb4d;});}else{logger[_0xc9bd('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xc9bd('0x10')](_0xc9bd('0x25'),_0x354bc7[_0xc9bd('0x26')])})[_0xc9bd('0x1c')](function(_0x28440c){logger[_0xc9bd('0xd')]('Admin\x20account\x20selected.');return _0x28440c;});}});}else{logger[_0xc9bd('0xd')](_0xc9bd('0x27'));return request({'uri':util[_0xc9bd('0x10')](_0xc9bd('0x25'),_0x354bc7['remoteUri'])})[_0xc9bd('0x1c')](function(_0x3744e8){logger['info'](_0xc9bd('0x28'));return _0x3744e8;});}}function getEndUser(_0x37000d,_0x3f41e5,_0x359d5d){logger['info'](_0xc9bd('0x29'),_0x359d5d);return request({'uri':util[_0xc9bd('0x10')]('%s/api/v2/contacts',_0x37000d[_0xc9bd('0x26')]),'qs':{'phone':_0x359d5d}})[_0xc9bd('0x1c')](function(_0x1b9c00){if(_0x1b9c00['length']){logger[_0xc9bd('0xd')](_0xc9bd('0x2a'));return _['find'](_0x1b9c00,{'phone':_0x359d5d});}else{logger[_0xc9bd('0xd')](_0xc9bd('0x2b'));return request({'uri':util[_0xc9bd('0x10')](_0xc9bd('0x2c'),_0x37000d['remoteUri']),'method':_0xc9bd('0x1b'),'body':{'name':_0x3f41e5,'phone':_0x359d5d}})[_0xc9bd('0x1c')](function(_0xfdbf96){logger['info'](_0xc9bd('0x2d'));return _0xfdbf96;});}});}function getAuth(_0x569068){return util[_0xc9bd('0x10')](_0xc9bd('0x2e'),new Buffer(_0x569068[_0xc9bd('0x2f')]+':X')[_0xc9bd('0x30')](_0xc9bd('0x31')));}function request(_0x4c539a){logger['debug'](_0xc9bd('0x32'),JSON[_0xc9bd('0x33')](_0x4c539a));return rp(_['defaults'](_0x4c539a,{'method':_0xc9bd('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x1d06c1,_0x450127){var _0x2d3bce=[];if(_0x1d06c1&&_0x1d06c1[_0xc9bd('0x20')]>0x0){_0x2d3bce=_[_0xc9bd('0x35')](_0x1d06c1,_0x450127);}return _0x2d3bce;}function getCustomFields(_0x3eb1e5,_0x5eb94f){var _0x2c30f4=[];var _0x55c163={'custom_fields':[]};if(_0x3eb1e5[_0xc9bd('0x20')]>0x0){_[_0xc9bd('0x36')](_0x3eb1e5,function(_0x396735){if(_['includes']([_0xc9bd('0x37'),_0xc9bd('0x38')],_0x396735[_0xc9bd('0x39')])&&_0x396735['nameField']&&!_0x396735[_0xc9bd('0x3a')]){_0x55c163[_0x396735[_0xc9bd('0x3b')]['toLowerCase']()]=_0x396735[_0xc9bd('0x3c')][_0xc9bd('0x30')]();}else if(_['includes']([_0xc9bd('0x37'),'picklist'],_0x396735['type'])&&_0x396735[_0xc9bd('0x3d')]&&_0x396735[_0xc9bd('0x3a')]){_0x55c163[_0xc9bd('0x1a')][_0xc9bd('0x3e')]({'id':_0x396735['idField'],'value':_0x396735['content'][_0xc9bd('0x30')]()});}else if(_0x396735[_0xc9bd('0x39')]==='variable'&&_0x396735[_0xc9bd('0x3f')]&&_0x396735[_0xc9bd('0x3d')]&&_0x396735[_0xc9bd('0x3a')]){_0x5eb94f[_0x396735[_0xc9bd('0x3f')]]&&_0x55c163['custom_fields'][_0xc9bd('0x3e')]({'id':_0x396735[_0xc9bd('0x3d')],'value':_0x5eb94f[_0x396735[_0xc9bd('0x3f')]][_0xc9bd('0x30')]()});}else if(_0x396735[_0xc9bd('0x39')]===_0xc9bd('0x40')&&_0x396735['Variable']&&_0x396735[_0xc9bd('0x41')]['name']&&_0x396735[_0xc9bd('0x3d')]&&_0x396735[_0xc9bd('0x3a')]){_0x5eb94f[_0x396735[_0xc9bd('0x41')][_0xc9bd('0x42')][_0xc9bd('0x43')]()]&&_0x55c163[_0xc9bd('0x1a')][_0xc9bd('0x3e')]({'id':_0x396735[_0xc9bd('0x3d')],'value':_0x5eb94f[_0x396735[_0xc9bd('0x41')][_0xc9bd('0x42')][_0xc9bd('0x43')]()][_0xc9bd('0x30')]()});}});}return _0x55c163;}exports[_0xc9bd('0x44')]=function(_0x39783d,_0x36ff7c,_0xd7f837,_0x189eb2,_0x4360e7,_0x1a8bf1){var _0xeb287a,_0x313b15;_0x1a8bf1[_0xc9bd('0x26')]=intUtil['stripTrailingSlash'](_0x1a8bf1[_0xc9bd('0x26')]);_0x1a8bf1[_0xc9bd('0x45')]=intUtil[_0xc9bd('0x46')](_0x1a8bf1[_0xc9bd('0x45')]);if(_0x4360e7&&_0x4360e7[_0xc9bd('0x47')]){logger[_0xc9bd('0xd')](_0xc9bd('0x48'),'Recording\x20is\x20enabled!');_0x36ff7c[_0xc9bd('0x49')]=util[_0xc9bd('0x10')](_0xc9bd('0x4a'),_0x1a8bf1['serverUrl'],_0x36ff7c['uniqueid'],md5(_0x36ff7c[_0xc9bd('0x4b')]));}else{_0x36ff7c[_0xc9bd('0x49')]='';}headers[_0xc9bd('0x4c')]=getAuth(_0x1a8bf1);return getUser(_0x1a8bf1,_0x189eb2[_0xc9bd('0x24')])[_0xc9bd('0x1c')](function(_0x184b9d){_0xeb287a=_0x184b9d;logger[_0xc9bd('0xd')](_0xc9bd('0x4d'),_0xeb287a['id']);return getEndUser(_0x1a8bf1,_0x36ff7c[_0xc9bd('0x12')],_0x36ff7c[_0xc9bd('0x13')]);})[_0xc9bd('0x1c')](function(_0x5991d6){_0x313b15=_0x5991d6;logger[_0xc9bd('0xd')](_0xc9bd('0x4e'),_0x313b15['id']);return getTicket(_0x1a8bf1,_0xeb287a,_0x313b15,_0xd7f837,_0x36ff7c);})[_0xc9bd('0x1c')](function(_0x4d9b87){if(_0x4d9b87&&_0x4d9b87['id']){logger[_0xc9bd('0xd')](_0xc9bd('0x1d'));logger[_0xc9bd('0xd')]('The\x20Ticket\x20ID\x20is:',_0x4d9b87['id']);logger[_0xc9bd('0xd')]('[QUEUE]',_0xc9bd('0x4f'));emit(util[_0xc9bd('0x10')](_0xc9bd('0x50'),_0x189eb2[_0xc9bd('0x42')]),_0xc9bd('0x51'),{'uri':util['format'](_0xc9bd('0x52'),_0x1a8bf1[_0xc9bd('0x26')],_0x4d9b87['id'])});}})['catch'](function(_0x9a1d9e){logger[_0xc9bd('0x53')]('[QUEUE]',JSON[_0xc9bd('0x33')](_0x9a1d9e));});};exports[_0xc9bd('0x54')]=function(_0x2fbc0b,_0x538b82,_0x199bac,_0x2982f3,_0x20a15f,_0xb8018,_0x58d653){var _0x20904a,_0x59c11c;_0xb8018['remoteUri']=intUtil[_0xc9bd('0x46')](_0xb8018[_0xc9bd('0x26')]);_0xb8018[_0xc9bd('0x45')]=intUtil['stripTrailingSlash'](_0xb8018[_0xc9bd('0x45')]);if(_0x58d653&&_0x58d653['recordingFormat']&&_0x58d653[_0xc9bd('0x55')]!==_0xc9bd('0x56')){logger[_0xc9bd('0xd')](_0xc9bd('0x57'),'Recording\x20is\x20enabled!');_0x538b82[_0xc9bd('0x49')]=util[_0xc9bd('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xb8018[_0xc9bd('0x45')],_0x538b82[_0xc9bd('0x4b')],md5(_0x538b82['uniqueid']));}headers[_0xc9bd('0x4c')]=getAuth(_0xb8018);return getUser(_0xb8018,_0x2982f3[_0xc9bd('0x24')])['then'](function(_0xaf503f){_0x20904a=_0xaf503f;logger[_0xc9bd('0xd')]('The\x20User\x20ID\x20is:',_0x20904a['id']);return getEndUser(_0xb8018,_0x538b82['destcalleridname'],_0x538b82['destcalleridnum']);})['then'](function(_0x4c3d98){_0x59c11c=_0x4c3d98;logger[_0xc9bd('0xd')](_0xc9bd('0x4e'),_0x59c11c['id']);return getTicket(_0xb8018,_0x20904a,_0x59c11c,_0x199bac,_0x538b82);})[_0xc9bd('0x1c')](function(_0x3bca41){if(_0x3bca41&&_0x3bca41['id']){logger[_0xc9bd('0xd')]('Ticket\x20created!');logger[_0xc9bd('0xd')](_0xc9bd('0x58'),_0x3bca41['id']);logger[_0xc9bd('0xd')](_0xc9bd('0x57'),_0xc9bd('0x4f'));emit(util[_0xc9bd('0x10')]('user:%s',_0x2982f3[_0xc9bd('0x42')]),'trigger:browser:url',{'uri':util[_0xc9bd('0x10')](_0xc9bd('0x52'),_0xb8018[_0xc9bd('0x26')],_0x3bca41['id'])});}})[_0xc9bd('0x59')](function(_0x45da08){logger[_0xc9bd('0x53')](_0xc9bd('0x57'),JSON[_0xc9bd('0x33')](_0x45da08));});};exports[_0xc9bd('0x5a')]=function(_0x39fd11,_0x418e7a,_0x347c20,_0x5059c4,_0xe7b4b7,_0x25ba95){var _0x4fe164,_0xf43f32;_0x25ba95[_0xc9bd('0x26')]=intUtil[_0xc9bd('0x46')](_0x25ba95[_0xc9bd('0x26')]);_0x25ba95['serverUrl']=intUtil[_0xc9bd('0x46')](_0x25ba95[_0xc9bd('0x45')]);if(_0xe7b4b7&&_0xe7b4b7[_0xc9bd('0x47')]){logger[_0xc9bd('0xd')]('['+_0x418e7a[_0xc9bd('0x5b')][_0xc9bd('0x5c')]()+']',_0xc9bd('0x5d'));_0x418e7a['recordingURL']=util[_0xc9bd('0x10')](_0xc9bd('0x4a'),_0x25ba95['serverUrl'],_0x418e7a[_0xc9bd('0x4b')],md5(_0x418e7a[_0xc9bd('0x4b')]));}else{_0x418e7a[_0xc9bd('0x49')]='';}headers[_0xc9bd('0x4c')]=getAuth(_0x25ba95);return getUser(_0x25ba95,'')[_0xc9bd('0x1c')](function(_0x1542d4){_0x4fe164=_0x1542d4;logger[_0xc9bd('0xd')]('The\x20User\x20ID\x20is:',_0x4fe164['id']);return getEndUser(_0x25ba95,_0x418e7a[_0xc9bd('0x12')],_0x418e7a[_0xc9bd('0x13')]);})[_0xc9bd('0x1c')](function(_0x5a8aac){_0xf43f32=_0x5a8aac;logger[_0xc9bd('0xd')]('The\x20Enduser\x20ID\x20is:',_0xf43f32['id']);return getTicket(_0x25ba95,_0x4fe164,_0xf43f32,_0x347c20,_0x418e7a);})[_0xc9bd('0x1c')](function(_0x18f19c){if(_0x18f19c){logger[_0xc9bd('0xd')]('Ticket\x20created!');logger[_0xc9bd('0xd')]('The\x20Ticket\x20ID\x20is:',_0x18f19c['id']);}})[_0xc9bd('0x59')](function(_0x30a0ed){logger[_0xc9bd('0x53')]('['+_0x418e7a[_0xc9bd('0x5b')]['toUpperCase']()+']',JSON[_0xc9bd('0x33')](_0x30a0ed));});}; \ 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 3681b67..451c8cb 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 _0x19ee=['%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','util','bluebird','ioredis','./util','../../../../config/environment','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','headers','Getting\x20user\x20list','agentEmail','userEmail','userId','User\x20found:','Admin\x20selected','toUpperCase','/api/lookup?q=','&f=','find','contacts','format','contactNumber','mobile_number','Contact\x20found\x20mobile_number:','endUserId','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','getString','Subjects','Contact','ticketId','Task\x20created:','/contacts/','emit','trigger:browser:url','apiKey','stripTrailingSlash','remoteUri','serverUrl','outbound','destcalleridnum','callDirection'];(function(_0x5d4ede,_0x5493cd){var _0x3eef04=function(_0x572892){while(--_0x572892){_0x5d4ede['push'](_0x5d4ede['shift']());}};_0x3eef04(++_0x5493cd);}(_0x19ee,0xa4));var _0xe19e=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x19ee[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require('md5');var util=require(_0xe19e('0x0'));var moment=require('moment');var Promise=require(_0xe19e('0x1'));var Redis=require(_0xe19e('0x2'));var intUtil=require(_0xe19e('0x3'));var config=require(_0xe19e('0x4'));var logger=require('../../../../config/logger')(_0xe19e('0x5'));config[_0xe19e('0x6')]=_[_0xe19e('0x7')](config[_0xe19e('0x6')],{'host':_0xe19e('0x8'),'port':0x18eb});var io=require(_0xe19e('0x9'))(new Redis(config[_0xe19e('0x6')]));function getAdminId(_0x3d18bd,_0x48bee0,_0x4a3f0d,_0x4d8187){return new Promise(function(_0x45df2b,_0x521e80){var _0x488251=![];var _0x51ab00={'method':_0xe19e('0xa'),'uri':_0x4d8187+_0xe19e('0xb'),'json':!![]};_0x51ab00['headers']=_0x4a3f0d;logger[_0xe19e('0xc')](_0xe19e('0xd'));return rp(_0x51ab00)[_0xe19e('0xe')](function(_0x9a3408){if(_0x9a3408){var _0x3f0ce2=_0x9a3408['users'];var _0x41f7f8=null;for(_0x41f7f8=0x0;_0x41f7f8<_0x3f0ce2['length'];_0x41f7f8++){if(_0x3f0ce2[_0x41f7f8][_0xe19e('0xf')]===_0x3d18bd[_0xe19e('0x10')]){_0x3d18bd['adminId']=_0x3f0ce2[_0x41f7f8]['id'];_0x488251=!![];}}if(_0x488251){logger[_0xe19e('0xc')]('Admin\x20found:',_0x3d18bd[_0xe19e('0x11')]);_0x45df2b(_0x3d18bd);}else{_0x521e80({'statusCode':0x194,'message':_0xe19e('0x12')});}}else{_0x521e80({'statusCode':0x194,'message':_0xe19e('0x12')});}})[_0xe19e('0x13')](function(_0x1f8ace){logger[_0xe19e('0x14')]('['+[_0x48bee0['toUpperCase']()]+']',_0x1f8ace[_0xe19e('0x15')]);_0x521e80(_0x1f8ace);});});}function getUser(_0x136466,_0x5ba584,_0x46a3df){return function(_0x1bafea){return new Promise(function(_0x36009b,_0x1b4c81){var _0x325f34={'method':_0xe19e('0xa'),'uri':_0x46a3df+_0xe19e('0xb'),'json':!![]};_0x325f34[_0xe19e('0x16')]=_0x5ba584;logger[_0xe19e('0xc')](_0xe19e('0x17'));return rp(_0x325f34)[_0xe19e('0xe')](function(_0x5504c7){if(_0x5504c7){var _0x1aa961=_0x5504c7['users'];var _0x162b3d=![];var _0x22891d=null;if(_0x1bafea[_0xe19e('0x18')]!==null){logger[_0xe19e('0xc')]('Getting\x20user\x20with\x20email',_0x1bafea[_0xe19e('0x18')]);_0x1bafea[_0xe19e('0x19')]=_0x1bafea[_0xe19e('0x18')];for(_0x22891d=0x0;_0x22891d<_0x1aa961['length'];_0x22891d++){if(_0x1aa961[_0x22891d][_0xe19e('0xf')]===_0x1bafea[_0xe19e('0x18')]){_0x162b3d=!![];_0x1bafea[_0xe19e('0x1a')]=_0x1aa961[_0x22891d]['id'];logger['info'](_0xe19e('0x1b'),_0x1bafea[_0xe19e('0x1a')]);}}}if(!_0x162b3d){logger[_0xe19e('0xc')](_0xe19e('0x1c'));_0x1bafea[_0xe19e('0x19')]=_0x1bafea[_0xe19e('0x10')];_0x1bafea[_0xe19e('0x1a')]=_0x1bafea[_0xe19e('0x11')];_0x162b3d=!![];}if(_0x162b3d){_0x36009b(_0x1bafea);}else{_0x1b4c81({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x1b4c81({'statusCode':0x194,'message':_0xe19e('0x12')});}})[_0xe19e('0x13')](function(_0x16653d){logger[_0xe19e('0x14')]('['+[_0x136466[_0xe19e('0x1d')]()]+']',_0x16653d[_0xe19e('0x15')]);_0x1b4c81(_0x16653d);});});};}function searchContact(_0x2569ea,_0x558f66,_0x5aa9ce,_0x316d5c){return new Promise(function(_0x13bd90,_0x40852b){var _0x2eb8ae={'method':_0xe19e('0xa'),'headers':_0x558f66,'uri':_0x2569ea+_0xe19e('0x1e')+_0x316d5c+_0xe19e('0x1f')+_0x5aa9ce+'&entities=contact','json':!![]};rp(_0x2eb8ae)[_0xe19e('0xe')](function(_0x2a534a){var _0x36d651=_[_0xe19e('0x20')](_0x2a534a['contacts'][_0xe19e('0x21')],[_0x5aa9ce,_0x316d5c]);_0x13bd90(_0x36d651);})[_0xe19e('0x13')](function(_0x475f2d){_0x40852b(_0x475f2d);});});}function getEndUser(_0x4e1733,_0x2c60e8,_0xb045b3){return function(_0x412c53){return new Promise(function(_0x576f86,_0x1314f0){logger[_0xe19e('0xc')](util[_0xe19e('0x22')]('Searching\x20contact\x20with\x20phone\x20%s',_0x412c53[_0xe19e('0x23')]));searchContact(_0xb045b3,_0x2c60e8,_0xe19e('0x24'),_0x412c53['contactNumber'])[_0xe19e('0xe')](function(_0x175247){if(_0x175247){_0x412c53['endUserId']=_0x175247['id'];logger['info'](_0xe19e('0x25'),_0x412c53[_0xe19e('0x26')]);return _0x576f86(_0x412c53);}searchContact(_0xb045b3,_0x2c60e8,_0xe19e('0x27'),_0x412c53[_0xe19e('0x23')])[_0xe19e('0xe')](function(_0x28c517){if(_0x28c517){_0x412c53[_0xe19e('0x26')]=_0x28c517['id'];logger[_0xe19e('0xc')]('Contact\x20found\x20work_number:',_0x412c53[_0xe19e('0x26')]);return _0x576f86(_0x412c53);}createEndUser(_0x412c53,_0x4e1733,_0x2c60e8,_0xb045b3)[_0xe19e('0xe')](function(_0x30ce6e){logger[_0xe19e('0xc')](_0xe19e('0x28'),_0x30ce6e[_0xe19e('0x26')]);return _0x576f86(_0x30ce6e);});});})[_0xe19e('0x13')](function(_0x3a384d){_0x1314f0(_0x3a384d);});});};}function createEndUser(_0x216d5a,_0x28d61d,_0x461ff7,_0x5b96e0){return new Promise(function(_0x309b3b,_0xd34818){var _0x86549f=moment();var _0x404096={'method':_0xe19e('0x29'),'uri':_0x5b96e0+_0xe19e('0x2a'),'body':{'contact':{'last_name':_0x216d5a[_0xe19e('0x23')],'work_number':_0x216d5a[_0xe19e('0x23')],'mobile_number':_0x216d5a['contactNumber'],'owner_id':_0x216d5a[_0xe19e('0x1a')],'created_at':_0x86549f[_0xe19e('0x22')](_0xe19e('0x2b'))}},'json':!![]};_0x404096[_0xe19e('0x16')]=_0x461ff7;logger[_0xe19e('0xc')](_0xe19e('0x2c'));return rp(_0x404096)['then'](function(_0x3e8ff9){_0x216d5a[_0xe19e('0x26')]=_0x3e8ff9[_0xe19e('0x2d')]['id'];_0x309b3b(_0x216d5a);})[_0xe19e('0x13')](function(_0xbe9de7){logger[_0xe19e('0x14')]('['+[_0x28d61d['toUpperCase']()]+']',_0xbe9de7[_0xe19e('0x15')]);_0xd34818(_0xbe9de7[_0xe19e('0x15')]);});});}function getTicket(_0x55dc0d,_0x3b7df5,_0x4772b2,_0x27daaf,_0x3cc660){return function(_0x4b0460){logger[_0xe19e('0xc')]('Creating\x20new\x20task');return new Promise(function(_0x17122c,_0x50b80d){var _0x3588be=moment();var _0x5b0784={'method':_0xe19e('0x29'),'uri':_0x4772b2+'/api/tasks','body':{'title':intUtil[_0xe19e('0x2e')](_0x27daaf[_0xe19e('0x2f')],_0x3cc660,'\x20'),'description':intUtil[_0xe19e('0x2e')](_0x27daaf['Descriptions'],_0x3cc660,'\x0a'),'owner_id':_0x4b0460['userId'],'creater_id':_0x4b0460['adminId'],'targetable_id':_0x4b0460[_0xe19e('0x26')],'targetable_type':_0xe19e('0x30'),'created_at':_0x3588be['format'](_0xe19e('0x2b')),'due_date':_0x3588be['add'](0x1e,'m')[_0xe19e('0x22')](_0xe19e('0x2b'))},'json':!![]};_0x5b0784['headers']=_0x3b7df5;return rp(_0x5b0784)[_0xe19e('0xe')](function(_0xc2bb3d){_0x4b0460[_0xe19e('0x31')]=_0xc2bb3d['task']['id'];logger[_0xe19e('0xc')](_0xe19e('0x32'),_0x4b0460['ticketId']);_0x17122c(_0x4b0460);})['catch'](function(_0x139f3c){logger[_0xe19e('0x14')]('['+[_0x55dc0d['toUpperCase']()]+']',_0x139f3c['message']);_0x50b80d(_0x139f3c[_0xe19e('0x15')]);});});};}function emit(_0x407745,_0x516217,_0x4501d7){var _0x44ab8a={'uri':_0x407745+_0xe19e('0x33')+_0x4501d7};io['to'](util[_0xe19e('0x22')]('user:%s',_0x516217))[_0xe19e('0x34')](_0xe19e('0x35'),_0x44ab8a);}exports['cs']=function(_0x201a91,_0x362f3b,_0x17f6aa,_0x2cef18,_0x54ddd0,_0x495ddf,_0x5f47f2,_0x26b510){var _0x5c21c3={};var _0x3dc191={'Authorization':'Token\x20token='+_0x495ddf[_0xe19e('0x36')]};_0x495ddf['remoteUri']=intUtil[_0xe19e('0x37')](_0x495ddf[_0xe19e('0x38')]);_0x495ddf[_0xe19e('0x39')]=intUtil[_0xe19e('0x37')](_0x495ddf[_0xe19e('0x39')]);var _0x26ea0d=_0x495ddf[_0xe19e('0x38')];_0x5c21c3[_0xe19e('0x10')]=_0x495ddf['username'];_0x5c21c3[_0xe19e('0x23')]=_0x26b510['toLowerCase']()===_0xe19e('0x3a')?_0x362f3b[_0xe19e('0x3b')]:_0x362f3b['calleridnum'];_0x5c21c3[_0xe19e('0x3c')]=_0x26b510==='queue'||_0x26b510==='unmanaged'?'queue':_0xe19e('0x3a');if(_0x2cef18){_0x5c21c3['agentEmail']=_0x2cef18[_0xe19e('0xf')];}var _0x161b45=util[_0xe19e('0x22')](_0xe19e('0x3d'),_0x495ddf[_0xe19e('0x39')],_0x362f3b[_0xe19e('0x3e')],md5(_0x362f3b['uniqueid']));if(_0x54ddd0&&_0x54ddd0[_0xe19e('0x3f')]){logger[_0xe19e('0xc')](_0xe19e('0x40'),_0xe19e('0x41'));_0x362f3b[_0xe19e('0x42')]=_0x161b45;}else if(_0x5f47f2&&_0x5f47f2['recordingFormat']&&_0x5f47f2['recordingFormat']!==_0xe19e('0x43')){logger[_0xe19e('0xc')](_0xe19e('0x44'),_0xe19e('0x41'));_0x362f3b[_0xe19e('0x42')]=_0x161b45;}else{_0x362f3b[_0xe19e('0x42')]='';}return getAdminId(_0x5c21c3,_0x26b510,_0x3dc191,_0x26ea0d)[_0xe19e('0xe')](getUser(_0x26b510,_0x3dc191,_0x26ea0d))['then'](getEndUser(_0x26b510,_0x3dc191,_0x26ea0d))['then'](getTicket(_0x26b510,_0x3dc191,_0x26ea0d,_0x17f6aa,_0x362f3b))['then'](function(_0x1a7e1c){logger[_0xe19e('0xc')](util[_0xe19e('0x22')](_0xe19e('0x45'),_0x1a7e1c[_0xe19e('0x31')]));if(_0x26b510!==_0xe19e('0x46')){logger['info']('['+[_0x26b510[_0xe19e('0x1d')]()]+']',_0xe19e('0x47'));emit(_0x26ea0d,_0x2cef18[_0xe19e('0x48')],_0x1a7e1c[_0xe19e('0x26')]);}})[_0xe19e('0x13')](function(_0x3270be){logger[_0xe19e('0x14')]('['+[_0x26b510[_0xe19e('0x1d')]()]+_0xe19e('0x49'),util[_0xe19e('0x4a')](_0x3270be,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9348=['apiKey','remoteUri','stripTrailingSlash','serverUrl','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','redis','defaults','socket.io-emitter','GET','/api/selector/owners','info','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','User\x20found:','userId','Admin\x20selected','&f=','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','mobile_number','contactNumber','endUserId','work_number','Contact\x20found\x20work_number:','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','headers','toUpperCase','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','Token\x20token='];(function(_0x33b627,_0xcd64e0){var _0x531df0=function(_0x46db94){while(--_0x46db94){_0x33b627['push'](_0x33b627['shift']());}};_0x531df0(++_0xcd64e0);}(_0x9348,0xb4));var _0x8934=function(_0xe4bb3f,_0x2c3774){_0xe4bb3f=_0xe4bb3f-0x0;var _0x4eec9b=_0x9348[_0xe4bb3f];return _0x4eec9b;};'use strict';var _=require(_0x8934('0x0'));var rp=require(_0x8934('0x1'));var md5=require('md5');var util=require('util');var moment=require(_0x8934('0x2'));var Promise=require(_0x8934('0x3'));var Redis=require(_0x8934('0x4'));var intUtil=require(_0x8934('0x5'));var config=require('../../../../config/environment');var logger=require(_0x8934('0x6'))(_0x8934('0x7'));config[_0x8934('0x8')]=_[_0x8934('0x9')](config[_0x8934('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x8934('0xa'))(new Redis(config[_0x8934('0x8')]));function getAdminId(_0x147d8c,_0xf581eb,_0x2aaf22,_0x3fc9b5){return new Promise(function(_0x33fac1,_0x114665){var _0x33fba4=![];var _0x6e8b9={'method':_0x8934('0xb'),'uri':_0x3fc9b5+_0x8934('0xc'),'json':!![]};_0x6e8b9['headers']=_0x2aaf22;logger[_0x8934('0xd')](_0x8934('0xe'));return rp(_0x6e8b9)[_0x8934('0xf')](function(_0x441798){if(_0x441798){var _0x1e9aaa=_0x441798[_0x8934('0x10')];var _0x13f55e=null;for(_0x13f55e=0x0;_0x13f55e<_0x1e9aaa['length'];_0x13f55e++){if(_0x1e9aaa[_0x13f55e][_0x8934('0x11')]===_0x147d8c[_0x8934('0x12')]){_0x147d8c[_0x8934('0x13')]=_0x1e9aaa[_0x13f55e]['id'];_0x33fba4=!![];}}if(_0x33fba4){logger[_0x8934('0xd')]('Admin\x20found:',_0x147d8c[_0x8934('0x13')]);_0x33fac1(_0x147d8c);}else{_0x114665({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x114665({'statusCode':0x194,'message':_0x8934('0x14')});}})[_0x8934('0x15')](function(_0x178b47){logger[_0x8934('0x16')]('['+[_0xf581eb['toUpperCase']()]+']',_0x178b47[_0x8934('0x17')]);_0x114665(_0x178b47);});});}function getUser(_0x43330c,_0x4fd6ef,_0x162edb){return function(_0x95a287){return new Promise(function(_0x34518e,_0x5215e6){var _0x173235={'method':_0x8934('0xb'),'uri':_0x162edb+_0x8934('0xc'),'json':!![]};_0x173235['headers']=_0x4fd6ef;logger[_0x8934('0xd')](_0x8934('0x18'));return rp(_0x173235)[_0x8934('0xf')](function(_0x27e1bd){if(_0x27e1bd){var _0x5dda40=_0x27e1bd['users'];var _0x229545=![];var _0x183f32=null;if(_0x95a287[_0x8934('0x19')]!==null){logger[_0x8934('0xd')](_0x8934('0x1a'),_0x95a287[_0x8934('0x19')]);_0x95a287[_0x8934('0x1b')]=_0x95a287['agentEmail'];for(_0x183f32=0x0;_0x183f32<_0x5dda40[_0x8934('0x1c')];_0x183f32++){if(_0x5dda40[_0x183f32][_0x8934('0x11')]===_0x95a287[_0x8934('0x19')]){_0x229545=!![];_0x95a287['userId']=_0x5dda40[_0x183f32]['id'];logger[_0x8934('0xd')](_0x8934('0x1d'),_0x95a287[_0x8934('0x1e')]);}}}if(!_0x229545){logger[_0x8934('0xd')](_0x8934('0x1f'));_0x95a287[_0x8934('0x1b')]=_0x95a287['adminEmail'];_0x95a287[_0x8934('0x1e')]=_0x95a287[_0x8934('0x13')];_0x229545=!![];}if(_0x229545){_0x34518e(_0x95a287);}else{_0x5215e6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x5215e6({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x8934('0x15')](function(_0x4f5af4){logger[_0x8934('0x16')]('['+[_0x43330c['toUpperCase']()]+']',_0x4f5af4[_0x8934('0x17')]);_0x5215e6(_0x4f5af4);});});};}function searchContact(_0x4218b0,_0x449899,_0x31c357,_0x113b48){return new Promise(function(_0x205180,_0x43f8e8){var _0x5a00dc={'method':_0x8934('0xb'),'headers':_0x449899,'uri':_0x4218b0+'/api/lookup?q='+_0x113b48+_0x8934('0x20')+_0x31c357+'&entities=contact','json':!![]};rp(_0x5a00dc)[_0x8934('0xf')](function(_0x34eb35){var _0xba67a5=_[_0x8934('0x21')](_0x34eb35[_0x8934('0x22')][_0x8934('0x22')],[_0x31c357,_0x113b48]);_0x205180(_0xba67a5);})['catch'](function(_0x685717){_0x43f8e8(_0x685717);});});}function getEndUser(_0x1cb740,_0x12bf06,_0x39d350){return function(_0x3e33c3){return new Promise(function(_0xdab650,_0x35c70a){logger['info'](util[_0x8934('0x23')](_0x8934('0x24'),_0x3e33c3['contactNumber']));searchContact(_0x39d350,_0x12bf06,_0x8934('0x25'),_0x3e33c3[_0x8934('0x26')])['then'](function(_0x3bac35){if(_0x3bac35){_0x3e33c3[_0x8934('0x27')]=_0x3bac35['id'];logger[_0x8934('0xd')]('Contact\x20found\x20mobile_number:',_0x3e33c3[_0x8934('0x27')]);return _0xdab650(_0x3e33c3);}searchContact(_0x39d350,_0x12bf06,_0x8934('0x28'),_0x3e33c3[_0x8934('0x26')])[_0x8934('0xf')](function(_0x389ac1){if(_0x389ac1){_0x3e33c3[_0x8934('0x27')]=_0x389ac1['id'];logger[_0x8934('0xd')](_0x8934('0x29'),_0x3e33c3['endUserId']);return _0xdab650(_0x3e33c3);}createEndUser(_0x3e33c3,_0x1cb740,_0x12bf06,_0x39d350)[_0x8934('0xf')](function(_0x25974a){logger['info'](_0x8934('0x2a'),_0x25974a[_0x8934('0x27')]);return _0xdab650(_0x25974a);});});})['catch'](function(_0x3fd6a8){_0x35c70a(_0x3fd6a8);});});};}function createEndUser(_0x4366c0,_0x124f8c,_0x4f4f59,_0x50e9ea){return new Promise(function(_0xd6e913,_0x41ab4a){var _0xbe9029=moment();var _0x2690c9={'method':_0x8934('0x2b'),'uri':_0x50e9ea+_0x8934('0x2c'),'body':{'contact':{'last_name':_0x4366c0[_0x8934('0x26')],'work_number':_0x4366c0[_0x8934('0x26')],'mobile_number':_0x4366c0[_0x8934('0x26')],'owner_id':_0x4366c0['userId'],'created_at':_0xbe9029['format'](_0x8934('0x2d'))}},'json':!![]};_0x2690c9[_0x8934('0x2e')]=_0x4f4f59;logger[_0x8934('0xd')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x2690c9)[_0x8934('0xf')](function(_0x51364f){_0x4366c0[_0x8934('0x27')]=_0x51364f['contact']['id'];_0xd6e913(_0x4366c0);})[_0x8934('0x15')](function(_0x58426a){logger['error']('['+[_0x124f8c[_0x8934('0x2f')]()]+']',_0x58426a[_0x8934('0x17')]);_0x41ab4a(_0x58426a[_0x8934('0x17')]);});});}function getTicket(_0x8fea03,_0x587d5a,_0x50ece4,_0x45c308,_0x471547){return function(_0x231e1f){logger['info'](_0x8934('0x30'));return new Promise(function(_0x1ecb3a,_0xcc0e1b){var _0x488cf2=moment();var _0x11f636={'method':_0x8934('0x2b'),'uri':_0x50ece4+_0x8934('0x31'),'body':{'title':intUtil['getString'](_0x45c308[_0x8934('0x32')],_0x471547,'\x20'),'description':intUtil[_0x8934('0x33')](_0x45c308[_0x8934('0x34')],_0x471547,'\x0a'),'owner_id':_0x231e1f['userId'],'creater_id':_0x231e1f[_0x8934('0x13')],'targetable_id':_0x231e1f[_0x8934('0x27')],'targetable_type':'Contact','created_at':_0x488cf2[_0x8934('0x23')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x488cf2[_0x8934('0x35')](0x1e,'m')[_0x8934('0x23')](_0x8934('0x2d'))},'json':!![]};_0x11f636[_0x8934('0x2e')]=_0x587d5a;return rp(_0x11f636)['then'](function(_0x27eeef){_0x231e1f[_0x8934('0x36')]=_0x27eeef['task']['id'];logger[_0x8934('0xd')](_0x8934('0x37'),_0x231e1f[_0x8934('0x36')]);_0x1ecb3a(_0x231e1f);})[_0x8934('0x15')](function(_0x4ae16b){logger[_0x8934('0x16')]('['+[_0x8fea03['toUpperCase']()]+']',_0x4ae16b[_0x8934('0x17')]);_0xcc0e1b(_0x4ae16b[_0x8934('0x17')]);});});};}function emit(_0x3c6b9d,_0x480533,_0x1a49f4){var _0x2ca4cc={'uri':_0x3c6b9d+_0x8934('0x38')+_0x1a49f4};io['to'](util['format'](_0x8934('0x39'),_0x480533))[_0x8934('0x3a')]('trigger:browser:url',_0x2ca4cc);}exports['cs']=function(_0x1a3a01,_0x51fc56,_0x45faea,_0x2967ba,_0x46d130,_0x2d937f,_0x105f62,_0x15279f){var _0x3b2cf2={};var _0x28f530={'Authorization':_0x8934('0x3b')+_0x2d937f[_0x8934('0x3c')]};_0x2d937f[_0x8934('0x3d')]=intUtil[_0x8934('0x3e')](_0x2d937f[_0x8934('0x3d')]);_0x2d937f[_0x8934('0x3f')]=intUtil['stripTrailingSlash'](_0x2d937f[_0x8934('0x3f')]);var _0x4e484e=_0x2d937f['remoteUri'];_0x3b2cf2[_0x8934('0x12')]=_0x2d937f['username'];_0x3b2cf2[_0x8934('0x26')]=_0x15279f['toLowerCase']()==='outbound'?_0x51fc56[_0x8934('0x40')]:_0x51fc56[_0x8934('0x41')];_0x3b2cf2[_0x8934('0x42')]=_0x15279f===_0x8934('0x43')||_0x15279f===_0x8934('0x44')?_0x8934('0x43'):'outbound';if(_0x2967ba){_0x3b2cf2[_0x8934('0x19')]=_0x2967ba['email'];}var _0x51ee04=util[_0x8934('0x23')](_0x8934('0x45'),_0x2d937f[_0x8934('0x3f')],_0x51fc56[_0x8934('0x46')],md5(_0x51fc56[_0x8934('0x46')]));if(_0x46d130&&_0x46d130[_0x8934('0x47')]){logger['info']('[QUEUE]',_0x8934('0x48'));_0x51fc56[_0x8934('0x49')]=_0x51ee04;}else if(_0x105f62&&_0x105f62[_0x8934('0x4a')]&&_0x105f62['recordingFormat']!=='none'){logger[_0x8934('0xd')](_0x8934('0x4b'),'Recording\x20is\x20enabled!');_0x51fc56[_0x8934('0x49')]=_0x51ee04;}else{_0x51fc56['recordingURL']='';}return getAdminId(_0x3b2cf2,_0x15279f,_0x28f530,_0x4e484e)[_0x8934('0xf')](getUser(_0x15279f,_0x28f530,_0x4e484e))[_0x8934('0xf')](getEndUser(_0x15279f,_0x28f530,_0x4e484e))[_0x8934('0xf')](getTicket(_0x15279f,_0x28f530,_0x4e484e,_0x45faea,_0x51fc56))['then'](function(_0x3f27de){logger[_0x8934('0xd')](util['format'](_0x8934('0x4c'),_0x3f27de[_0x8934('0x36')]));if(_0x15279f!=='unmanaged'){logger[_0x8934('0xd')]('['+[_0x15279f[_0x8934('0x2f')]()]+']',_0x8934('0x4d'));emit(_0x4e484e,_0x2967ba[_0x8934('0x4e')],_0x3f27de[_0x8934('0x27')]);}})[_0x8934('0x15')](function(_0x1570b5){logger[_0x8934('0x16')]('['+[_0x15279f[_0x8934('0x2f')]()]+_0x8934('0x4f'),util['inspect'](_0x1570b5,{'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 bc92824..9461025 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 _0x5d79=['find','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger','freshsales','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','data3','format','%s\x20account\x20#%s\x20not\x20found','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','servicenow','exec','includes','data1','toLowerCase','data2'];(function(_0x15e938,_0x125c2f){var _0x801bed=function(_0x20380f){while(--_0x20380f){_0x15e938['push'](_0x15e938['shift']());}};_0x801bed(++_0x125c2f);}(_0x5d79,0x1bf));var _0x95d7=function(_0x17fbc2,_0x1f2de7){_0x17fbc2=_0x17fbc2-0x0;var _0x38b500=_0x5d79[_0x17fbc2];return _0x38b500;};'use strict';var _=require('lodash');var util=require('util');var zendesk=require('./zendesk');var salesforce=require(_0x95d7('0x0'));var sugarcrm=require(_0x95d7('0x1'));var freshdesk=require(_0x95d7('0x2'));var zoho=require(_0x95d7('0x3'));var desk=require(_0x95d7('0x4'));var vtiger=require(_0x95d7('0x5'));var servicenow=require(_0x95d7('0x6'));var dynamics365=require('./dynamics365');var freshsales=require(_0x95d7('0x7'));var integrations=[_0x95d7('0x8'),_0x95d7('0x9'),_0x95d7('0xa'),_0x95d7('0xb'),_0x95d7('0xc'),_0x95d7('0xd'),'vtiger',_0x95d7('0xe'),'freshsales',_0x95d7('0xf')];exports[_0x95d7('0x10')]=function(_0x53445f,_0x2b898c,_0x208293,_0x1acf9d,_0x185f4c,_0x106c14){if(_0x208293){if(_[_0x95d7('0x11')](integrations,_0x53445f[_0x95d7('0x12')][_0x95d7('0x13')]())){try{var _0x133de5=null;var _0x36cf79='';var _0x396aae=_0x208293[_0x53445f['data1'][_0x95d7('0x13')]()];if(_0x396aae){var _0x12c737=_0x396aae[_0x53445f[_0x95d7('0x14')]];if(_0x12c737){var _0x383d73=_[_0x95d7('0x15')](_0x12c737['Configurations'],{'id':parseInt(_0x53445f['data3'],0xa)});if(_0x383d73){if(_0x1acf9d){if(_0x185f4c&&_0x2b898c[_0x95d7('0x16')]){_0x36cf79=_0x95d7('0x16');}else if(_0x2b898c[_0x95d7('0x17')]){_0x36cf79=_0x95d7('0x18');}else{console[_0x95d7('0x19')](_0x95d7('0x1a'),_0x2b898c);}}else{_0x36cf79=_0x95d7('0x1b');}switch(_0x53445f[_0x95d7('0x12')][_0x95d7('0x13')]()){case _0x95d7('0x8'):zendesk[_0x36cf79](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14);break;case _0x95d7('0x9'):salesforce[_0x36cf79](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14);break;case _0x95d7('0xa'):sugarcrm[_0x36cf79](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14);break;case _0x95d7('0xb'):freshdesk[_0x36cf79](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14);break;case _0x95d7('0xc'):zoho[_0x36cf79](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14);break;case _0x95d7('0xd'):desk[_0x36cf79](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14);break;case _0x95d7('0x1c'):vtiger[_0x36cf79](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14);break;case _0x95d7('0x1d'):freshsales['cs'](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14,_0x36cf79);break;case'servicenow':servicenow['cs'](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14,_0x36cf79);break;case _0x95d7('0xe'):dynamics365['cs'](_0x53445f,_0x2b898c,_0x383d73,_0x1acf9d,_0x185f4c,_0x12c737,_0x106c14,_0x36cf79);break;default:console[_0x95d7('0x19')]('unknown\x20integration');}}else{_0x133de5=require('../../../../config/logger')(_0x53445f[_0x95d7('0x12')]['toLowerCase']());_0x133de5[_0x95d7('0x1e')](_0x95d7('0x1f'),util['format'](_0x95d7('0x20'),_0x53445f[_0x95d7('0x12')][_0x95d7('0x13')](),_0x53445f[_0x95d7('0x21')]));}}else{_0x133de5=require('../../../../config/logger')(_0x53445f[_0x95d7('0x12')][_0x95d7('0x13')]());_0x133de5[_0x95d7('0x1e')](_0x95d7('0x1f'),util[_0x95d7('0x22')](_0x95d7('0x23'),_0x53445f[_0x95d7('0x12')][_0x95d7('0x13')](),_0x53445f[_0x95d7('0x14')]));}}else{}}catch(_0x12003f){console[_0x95d7('0x1e')](_0x12003f);}}}}; \ No newline at end of file +var _0xb261=['toLowerCase','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','salesforce','desk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20account\x20#%s\x20not\x20found','data2','lodash','util','./zendesk','./salesforce','./zoho','./desk','./vtiger','./servicenow','./dynamics365','./freshsales','sugarcrm','freshdesk','zoho','vtiger','dynamics365','freshsales','servicenow','exec','data1'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xb261,0x85));var _0x1b26=function(_0x225737,_0x28110b){_0x225737=_0x225737-0x0;var _0x4c5156=_0xb261[_0x225737];return _0x4c5156;};'use strict';var _=require(_0x1b26('0x0'));var util=require(_0x1b26('0x1'));var zendesk=require(_0x1b26('0x2'));var salesforce=require(_0x1b26('0x3'));var sugarcrm=require('./sugarcrm');var freshdesk=require('./freshdesk');var zoho=require(_0x1b26('0x4'));var desk=require(_0x1b26('0x5'));var vtiger=require(_0x1b26('0x6'));var servicenow=require(_0x1b26('0x7'));var dynamics365=require(_0x1b26('0x8'));var freshsales=require(_0x1b26('0x9'));var integrations=['zendesk','salesforce',_0x1b26('0xa'),_0x1b26('0xb'),_0x1b26('0xc'),'desk',_0x1b26('0xd'),_0x1b26('0xe'),_0x1b26('0xf'),_0x1b26('0x10')];exports[_0x1b26('0x11')]=function(_0x300166,_0xcd0f87,_0x43cbba,_0x3b1d9f,_0x480ffe,_0x3e1234){if(_0x43cbba){if(_['includes'](integrations,_0x300166[_0x1b26('0x12')][_0x1b26('0x13')]())){try{var _0x54af38=null;var _0x465c4e='';var _0x3bbf23=_0x43cbba[_0x300166['data1']['toLowerCase']()];if(_0x3bbf23){var _0x131ca3=_0x3bbf23[_0x300166['data2']];if(_0x131ca3){var _0x3cc412=_[_0x1b26('0x14')](_0x131ca3[_0x1b26('0x15')],{'id':parseInt(_0x300166[_0x1b26('0x16')],0xa)});if(_0x3cc412){if(_0x3b1d9f){if(_0x480ffe&&_0xcd0f87[_0x1b26('0x17')]){_0x465c4e=_0x1b26('0x17');}else if(_0xcd0f87['routeId']){_0x465c4e=_0x1b26('0x18');}else{console[_0x1b26('0x19')](_0x1b26('0x1a'),_0xcd0f87);}}else{_0x465c4e=_0x1b26('0x1b');}switch(_0x300166[_0x1b26('0x12')][_0x1b26('0x13')]()){case _0x1b26('0x1c'):zendesk[_0x465c4e](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234);break;case _0x1b26('0x1d'):salesforce[_0x465c4e](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234);break;case'sugarcrm':sugarcrm[_0x465c4e](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234);break;case _0x1b26('0xb'):freshdesk[_0x465c4e](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234);break;case'zoho':zoho[_0x465c4e](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234);break;case _0x1b26('0x1e'):desk[_0x465c4e](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234);break;case _0x1b26('0xd'):vtiger[_0x465c4e](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234);break;case _0x1b26('0xf'):freshsales['cs'](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234,_0x465c4e);break;case _0x1b26('0x10'):servicenow['cs'](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234,_0x465c4e);break;case _0x1b26('0xe'):dynamics365['cs'](_0x300166,_0xcd0f87,_0x3cc412,_0x3b1d9f,_0x480ffe,_0x131ca3,_0x3e1234,_0x465c4e);break;default:console['log'](_0x1b26('0x1f'));}}else{_0x54af38=require(_0x1b26('0x20'))(_0x300166[_0x1b26('0x12')][_0x1b26('0x13')]());_0x54af38[_0x1b26('0x21')](_0x1b26('0x22'),util[_0x1b26('0x23')]('%s\x20configuration\x20#%s\x20not\x20found',_0x300166[_0x1b26('0x12')][_0x1b26('0x13')](),_0x300166['data3']));}}else{_0x54af38=require(_0x1b26('0x20'))(_0x300166['data1']['toLowerCase']());_0x54af38[_0x1b26('0x21')](_0x1b26('0x22'),util[_0x1b26('0x23')](_0x1b26('0x24'),_0x300166[_0x1b26('0x12')][_0x1b26('0x13')](),_0x300166[_0x1b26('0x25')]));}}else{}}catch(_0x3aa548){console[_0x1b26('0x21')](_0x3aa548);}}}}; \ 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 223229c..39589f3 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 _0xac04=['Company','upperFirst','string','picklist','idField','toString','variable','variableName','customVariable','Variable','name','password','concat','remoteUri','https://login.salesforce.com','clientSecret','login','username','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','Fields','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','toUpperCase','isNil','calleridnum','lastevent',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','assign','getString','Subjects','Descriptions','ticketType','utc','IsReminderSet','endUserType','contact','lead','WhoId','account','WhatId','Case','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','additionalSearchContact','merge','$or','Contact','cloneDeep','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s'];(function(_0x5a585b,_0x3e0674){var _0x4cd398=function(_0x32fbb5){while(--_0x32fbb5){_0x5a585b['push'](_0x5a585b['shift']());}};_0x4cd398(++_0x3e0674);}(_0xac04,0x141));var _0x4ac0=function(_0x428d9b,_0xbd748c){_0x428d9b=_0x428d9b-0x0;var _0x2b434b=_0xac04[_0x428d9b];return _0x2b434b;};'use strict';var _=require(_0x4ac0('0x0'));var rp=require(_0x4ac0('0x1'));var moment=require(_0x4ac0('0x2'));var BPromise=require(_0x4ac0('0x3'));var md5=require(_0x4ac0('0x4'));var jsforce=require(_0x4ac0('0x5'));var util=require(_0x4ac0('0x6'));var Redis=require(_0x4ac0('0x7'));var intUtil=require(_0x4ac0('0x8'));var config=require(_0x4ac0('0x9'));var logger=require(_0x4ac0('0xa'))(_0x4ac0('0xb'));config[_0x4ac0('0xc')]=_[_0x4ac0('0xd')](config[_0x4ac0('0xc')],{'host':_0x4ac0('0xe'),'port':0x18eb});var io=require(_0x4ac0('0xf'))(new Redis(config[_0x4ac0('0xc')]));function emit(_0x3e5858,_0x47c52c,_0x30f988){io['to'](_0x3e5858)['emit'](_0x47c52c,_0x30f988);}function getTicket(_0x145a30,_0x3eb28a,_0x389875,_0xc38ed2,_0x4ba26d,_0x2774da,_0x5df878,_0x54fa99){var _0x5772ff=Object[_0x4ac0('0x10')]({},{'OwnerId':_0x3eb28a['id'],'Subject':intUtil[_0x4ac0('0x11')](_0xc38ed2[_0x4ac0('0x12')],_0x4ba26d,'\x20'),'Description':intUtil[_0x4ac0('0x11')](_0xc38ed2[_0x4ac0('0x13')],_0x4ba26d,'\x0a')},getCustomFields(_0x2774da,_0x4ba26d));if(_0x389875){if(_0xc38ed2[_0x4ac0('0x14')]==='Task'){_0x5772ff['ActivityDate']=moment[_0x4ac0('0x15')]();_0x5772ff[_0x4ac0('0x16')]=![];_0x5772ff['IsRecurrence']=![];if(_0x389875[_0x4ac0('0x17')]===_0x4ac0('0x18')||_0x389875[_0x4ac0('0x17')]===_0x4ac0('0x19')){_0x5772ff[_0x4ac0('0x1a')]=_0x389875['id'];}else if(_0x389875['endUserType']===_0x4ac0('0x1b')){_0x5772ff[_0x4ac0('0x1c')]=_0x389875['id'];}}else if(_0xc38ed2[_0x4ac0('0x14')]===_0x4ac0('0x1d')){if(_0x389875[_0x4ac0('0x17')]===_0x4ac0('0x18')){_0x5772ff[_0x4ac0('0x1e')]=_0x389875['id'];}else if(_0x389875[_0x4ac0('0x17')]===_0x4ac0('0x1b')){_0x5772ff[_0x4ac0('0x1f')]=_0x389875['id'];}else if(_0x389875[_0x4ac0('0x17')]===_0x4ac0('0x19')&&_0xc38ed2[_0x4ac0('0x20')]){_0x5772ff[_0xc38ed2['leadId']]=_0x389875['id'];}else{logger['info'](_0x4ac0('0x21'));}}}return _0x5df878[_0x4ac0('0x22')](_0xc38ed2[_0x4ac0('0x14')])[_0x4ac0('0x23')](_0x5772ff);}function getUser(_0x24c3c4,_0xe1ca5e,_0x55325c){if(!_['isNil'](_0xe1ca5e)&&intUtil[_0x4ac0('0x24')](_0xe1ca5e)){var _0x47a723={'Email':_0xe1ca5e};var _0x424cae={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x55325c[_0x4ac0('0x22')](_0x4ac0('0x25'))[_0x4ac0('0x26')](_0x47a723,_0x424cae)[_0x4ac0('0x27')]()[_0x4ac0('0x28')](function(_0x1525a8){if(_0x1525a8[_0x4ac0('0x29')]){var _0x11e881=_[_0x4ac0('0x26')](_0x1525a8,function(_0x3bf449){return _0x3bf449[_0x4ac0('0x2a')]===_0xe1ca5e;});if(_0x11e881){logger[_0x4ac0('0x2b')](_0x4ac0('0x2c'),_0xe1ca5e);return BPromise[_0x4ac0('0x2d')]({'id':_0x11e881['Id'],'name':_0x11e881[_0x4ac0('0x2e')]});}}else{logger[_0x4ac0('0x2b')](_0x4ac0('0x2f'),_0xe1ca5e);return _0x55325c['identity']()[_0x4ac0('0x28')](function(_0x56cbed){return BPromise[_0x4ac0('0x2d')]({'id':_0x56cbed['user_id'],'name':_0x56cbed[_0x4ac0('0x30')]});});}});}else{logger[_0x4ac0('0x2b')](_0x4ac0('0x2f'),_0xe1ca5e);return _0x55325c['identity']()[_0x4ac0('0x28')](function(_0xb0b7a5){return BPromise['resolve']({'id':_0xb0b7a5[_0x4ac0('0x31')],'name':_0xb0b7a5['display_name']});});}}function getEndUser(_0x19e409,_0x16a9ea,_0x19c0a6,_0x48c598,_0x2f86c5){var _0x1d7233={'$or':{'Phone':_0x48c598}};var _0x3937a1={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4ac0('0x2d')]()['then'](function(){logger['info'](_0x4ac0('0x32'),_0x48c598,_0x16a9ea['moduleSearch']);switch(_0x16a9ea['moduleSearch']){case _0x4ac0('0x33'):var _0x445638=_['cloneDeep'](_0x1d7233);if(_0x16a9ea[_0x4ac0('0x34')]){var _0x10d5a4={};_0x10d5a4[_0x16a9ea[_0x4ac0('0x34')]]=_0x48c598;_[_0x4ac0('0x35')](_0x445638[_0x4ac0('0x36')],_0x10d5a4);}return _0x2f86c5[_0x4ac0('0x22')](_0x4ac0('0x37'))[_0x4ac0('0x26')](_0x445638,_0x3937a1)[_0x4ac0('0x27')]()[_0x4ac0('0x28')](function(_0x17a8bb){if(_0x17a8bb&&_0x17a8bb[_0x4ac0('0x29')]){return _0x17a8bb;}else{var _0x3da611=_[_0x4ac0('0x38')](_0x1d7233);if(_0x16a9ea[_0x4ac0('0x39')]){var _0x112012={};_0x112012[_0x16a9ea['additionalSearchLead']]=_0x48c598;_[_0x4ac0('0x35')](_0x3da611[_0x4ac0('0x36')],_0x112012);}return _0x2f86c5[_0x4ac0('0x22')](_0x4ac0('0x3a'))[_0x4ac0('0x26')](_0x3da611,_0x3937a1);}});case _0x4ac0('0x3b'):var _0x2e6d3c=_[_0x4ac0('0x38')](_0x1d7233);if(_0x16a9ea['additionalSearchAccount']){var _0x10d5a4={};_0x10d5a4[_0x16a9ea[_0x4ac0('0x3c')]]=_0x48c598;_[_0x4ac0('0x35')](_0x2e6d3c['$or'],_0x10d5a4);}return _0x2f86c5[_0x4ac0('0x22')]('Account')[_0x4ac0('0x26')](_0x2e6d3c,_0x3937a1)[_0x4ac0('0x27')]()[_0x4ac0('0x28')](function(_0x1ebf43){if(_0x1ebf43&&_0x1ebf43[_0x4ac0('0x29')]){return _0x1ebf43;}else{var _0x10d084=_[_0x4ac0('0x38')](_0x1d7233);if(_0x16a9ea['additionalSearchContact']){var _0x409dbd={};_0x409dbd[_0x16a9ea[_0x4ac0('0x34')]]=_0x48c598;_[_0x4ac0('0x35')](_0x10d084['$or'],_0x409dbd);}return _0x2f86c5['sobject'](_0x4ac0('0x37'))[_0x4ac0('0x26')](_0x10d084,_0x3937a1)[_0x4ac0('0x28')](function(_0x3c64ac){if(_0x3c64ac&&_0x3c64ac['length']){return _0x3c64ac;}else{var _0x76d764=_[_0x4ac0('0x38')](_0x1d7233);if(_0x16a9ea['additionalSearchLead']){var _0x50c208={};_0x50c208[_0x16a9ea[_0x4ac0('0x39')]]=_0x48c598;_[_0x4ac0('0x35')](_0x76d764[_0x4ac0('0x36')],_0x50c208);}return _0x2f86c5[_0x4ac0('0x22')](_0x4ac0('0x3a'))['find'](_0x76d764,_0x3937a1);}});}});case _0x4ac0('0x18'):var _0x445638=_[_0x4ac0('0x38')](_0x1d7233);if(_0x16a9ea['additionalSearchContact']){var _0x10d5a4={};_0x10d5a4[_0x16a9ea[_0x4ac0('0x34')]]=_0x48c598;_[_0x4ac0('0x35')](_0x445638['$or'],_0x10d5a4);}return _0x2f86c5[_0x4ac0('0x22')](_0x4ac0('0x37'))[_0x4ac0('0x26')](_0x445638,_0x3937a1)[_0x4ac0('0x27')]();case _0x4ac0('0x19'):var _0x24a857=_[_0x4ac0('0x38')](_0x1d7233);if(_0x16a9ea[_0x4ac0('0x39')]){var _0x10d5a4={};_0x10d5a4[_0x16a9ea[_0x4ac0('0x39')]]=_0x48c598;_['merge'](_0x24a857[_0x4ac0('0x36')],_0x10d5a4);}return _0x2f86c5[_0x4ac0('0x22')](_0x4ac0('0x3a'))['find'](_0x24a857,_0x3937a1);case _0x4ac0('0x1b'):var _0x2e6d3c=_['cloneDeep'](_0x1d7233);if(_0x16a9ea[_0x4ac0('0x3c')]){var _0x10d5a4={};_0x10d5a4[_0x16a9ea[_0x4ac0('0x3c')]]=_0x48c598;_['merge'](_0x2e6d3c[_0x4ac0('0x36')],_0x10d5a4);}return _0x2f86c5[_0x4ac0('0x22')](_0x4ac0('0x3d'))[_0x4ac0('0x26')](_0x2e6d3c,_0x3937a1);default:return null;}})[_0x4ac0('0x28')](function(_0x2d5568){if(_0x2d5568&&_0x2d5568[_0x4ac0('0x29')]){var _0x1e51da=_[_0x4ac0('0x3e')](_0x2d5568);if(_0x1e51da){return BPromise['resolve']({'id':_0x1e51da['Id'],'name':_0x1e51da[_0x4ac0('0x2e')],'phone':_0x1e51da[_0x4ac0('0x3f')],'endUserType':_0x1e51da[_0x4ac0('0x40')][_0x4ac0('0x41')][_0x4ac0('0x42')]()});}}})['then'](function(_0x110202){if(_0x110202){logger[_0x4ac0('0x2b')](_0x4ac0('0x43'),_0x110202[_0x4ac0('0x17')],_0x48c598);return BPromise[_0x4ac0('0x2d')](_0x110202);}else{logger[_0x4ac0('0x2b')](_0x4ac0('0x44'),_0x48c598);var _0x34c5de={'Phone':_0x48c598};if(_0x16a9ea[_0x4ac0('0x45')]){if(_0x16a9ea[_0x4ac0('0x45')]===_0x4ac0('0x18')){logger[_0x4ac0('0x2b')](_0x4ac0('0x46'),_0x48c598,_0x16a9ea[_0x4ac0('0x45')]);_0x34c5de[_0x4ac0('0x47')]=_0x19c0a6!==_0x4ac0('0x48')?_0x19c0a6:util[_0x4ac0('0x49')](_0x4ac0('0x4a'),_0x48c598);}else if(_0x16a9ea[_0x4ac0('0x45')]===_0x4ac0('0x19')){logger[_0x4ac0('0x2b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x48c598,_0x16a9ea[_0x4ac0('0x45')]);_0x34c5de['LastName']=_0x19c0a6!==_0x4ac0('0x48')?_0x19c0a6:util[_0x4ac0('0x49')]('Caller\x20-\x20%s',_0x48c598);_0x34c5de[_0x4ac0('0x4b')]='No\x20Company';}else if(_0x16a9ea[_0x4ac0('0x45')]==='account'){logger['info'](_0x4ac0('0x46'),_0x48c598,_0x16a9ea[_0x4ac0('0x45')]);_0x34c5de[_0x4ac0('0x2e')]=_0x19c0a6!==''?_0x19c0a6:util[_0x4ac0('0x49')](_0x4ac0('0x4a'),_0x48c598);}else{return null;}}return _0x2f86c5[_0x4ac0('0x22')](_[_0x4ac0('0x4c')](_0x16a9ea[_0x4ac0('0x45')]))['create'](_0x34c5de)[_0x4ac0('0x28')](function(_0x34b932){return BPromise[_0x4ac0('0x2d')]({'id':_0x34b932['id'],'endUserType':_0x16a9ea[_0x4ac0('0x45')]});});}});}function getCustomFields(_0x3baaea,_0x1cc72d){var _0x193fbb={};if(_0x3baaea[_0x4ac0('0x29')]>0x0){_['forEach'](_0x3baaea,function(_0xa865f){if(_['includes']([_0x4ac0('0x4d'),_0x4ac0('0x4e')],_0xa865f[_0x4ac0('0x41')])&&_0xa865f['idField']){_0x193fbb[_0xa865f[_0x4ac0('0x4f')]]=_0xa865f['content'][_0x4ac0('0x50')]();}else if(_0xa865f[_0x4ac0('0x41')]===_0x4ac0('0x51')&&_0xa865f[_0x4ac0('0x52')]&&_0xa865f['idField']){_0x1cc72d[_0xa865f['variableName']]&&(_0x193fbb[_0xa865f[_0x4ac0('0x4f')]]=_0x1cc72d[_0xa865f[_0x4ac0('0x52')]][_0x4ac0('0x50')]());}else if(_0xa865f[_0x4ac0('0x41')]===_0x4ac0('0x53')&&_0xa865f['Variable']&&_0xa865f[_0x4ac0('0x54')]['name']&&_0xa865f[_0x4ac0('0x4f')]){_0x1cc72d[_0xa865f['Variable']['name'][_0x4ac0('0x42')]()]&&(_0x193fbb[_0xa865f[_0x4ac0('0x4f')]]=_0x1cc72d[_0xa865f[_0x4ac0('0x54')][_0x4ac0('0x55')][_0x4ac0('0x42')]()][_0x4ac0('0x50')]());}});}return _0x193fbb;}function getConnection(_0xb61b98){var _0x28f7db=_0xb61b98[_0x4ac0('0x56')][_0x4ac0('0x57')](_0xb61b98['securityToken']);var _0xdab958=new jsforce['Connection']({'oauth2':{'loginUrl':_0xb61b98[_0x4ac0('0x58')]||_0x4ac0('0x59'),'clientId':_0xb61b98['clientId'],'clientSecret':_0xb61b98[_0x4ac0('0x5a')]}});return _0xdab958[_0x4ac0('0x5b')](_0xb61b98[_0x4ac0('0x5c')],_0x28f7db)[_0x4ac0('0x28')](function(){logger['info']('Connection\x20established.');return _0xdab958;});}exports[_0x4ac0('0x5d')]=function(_0x315590,_0x10dc27,_0x590579,_0x8be1a6,_0xb8cf35,_0x4803cd){var _0x40d283,_0x324efa,_0x4b027f,_0x5014eb;_0x4803cd['serverUrl']=intUtil[_0x4ac0('0x5e')](_0x4803cd[_0x4ac0('0x5f')]);_0x4803cd[_0x4ac0('0x58')]=intUtil['stripTrailingSlash'](_0x4803cd['remoteUri']);if(_0xb8cf35&&_0xb8cf35['monitor_format']){logger[_0x4ac0('0x2b')](_0x4ac0('0x60'),_0x4ac0('0x61'));_0x10dc27[_0x4ac0('0x62')]=util['format'](_0x4ac0('0x63'),_0x4803cd['serverUrl'],_0x10dc27[_0x4ac0('0x64')],md5(_0x10dc27[_0x4ac0('0x64')]));}else{_0x10dc27['recordingURL']='';}return getConnection(_0x4803cd)[_0x4ac0('0x28')](function(_0xc99df){_0x5014eb=_0xc99df;return getUser(_0x4803cd,_0x8be1a6[_0x4ac0('0x65')],_0x5014eb);})[_0x4ac0('0x28')](function(_0x2c82ab){_0x40d283=_0x2c82ab;return getEndUser(_0x4803cd,_0x590579,_0x10dc27[_0x4ac0('0x66')],_0x10dc27['calleridnum'],_0x5014eb);})[_0x4ac0('0x28')](function(_0x11e286){_0x324efa=_0x11e286;return getTicket(_0x4803cd,_0x40d283,_0x324efa,_0x590579,_0x10dc27,_0x590579['Fields'],_0x5014eb,_0x4ac0('0x5d'));})[_0x4ac0('0x28')](function(_0x3dd6f9){_0x4b027f=_0x3dd6f9;logger[_0x4ac0('0x2b')](_0x4ac0('0x67'),_0x4b027f['id']);logger[_0x4ac0('0x2b')](_0x4ac0('0x68'),_0x4b027f['id'],_0x8be1a6[_0x4ac0('0x55')],_0x4803cd['type']);switch(_0x4803cd[_0x4ac0('0x41')]){case _0x4ac0('0x69'):emit(util[_0x4ac0('0x49')](_0x4ac0('0x6a'),_0x8be1a6[_0x4ac0('0x55')]),_0x4ac0('0x6b'),{'recordId':_0x4b027f['id']});break;case _0x4ac0('0x6c'):emit(util[_0x4ac0('0x49')](_0x4ac0('0x6a'),_0x8be1a6[_0x4ac0('0x55')]),_0x4ac0('0x6d'),{'uri':util[_0x4ac0('0x49')](_0x4ac0('0x6e'),_0x5014eb[_0x4ac0('0x6f')],_0x4b027f['id'])});break;default:logger[_0x4ac0('0x70')](_0x4ac0('0x71'));}})[_0x4ac0('0x72')](function(_0x12f6a5){logger[_0x4ac0('0x70')]('[QUEUE]',_0x12f6a5);});};exports[_0x4ac0('0x73')]=function(_0x524172,_0x351520,_0x155fc9,_0x2cb4ca,_0x4e4823,_0x187e6d,_0x127a2b){var _0x3d5de4,_0x418be9,_0x421036,_0x3a44c9;_0x187e6d['serverUrl']=intUtil[_0x4ac0('0x5e')](_0x187e6d[_0x4ac0('0x5f')]);_0x187e6d[_0x4ac0('0x58')]=intUtil[_0x4ac0('0x5e')](_0x187e6d['remoteUri']);if(_0x127a2b&&_0x127a2b['recordingFormat']&&_0x127a2b[_0x4ac0('0x74')]!==_0x4ac0('0x75')){logger[_0x4ac0('0x2b')](_0x4ac0('0x76'),_0x4ac0('0x61'));_0x351520[_0x4ac0('0x62')]=util[_0x4ac0('0x49')](_0x4ac0('0x63'),_0x187e6d[_0x4ac0('0x5f')],_0x351520[_0x4ac0('0x64')],md5(_0x351520[_0x4ac0('0x64')]));}return getConnection(_0x187e6d)[_0x4ac0('0x28')](function(_0x1f1aab){_0x3a44c9=_0x1f1aab;return getUser(_0x187e6d,_0x2cb4ca[_0x4ac0('0x65')],_0x3a44c9);})['then'](function(_0x54ed61){_0x3d5de4=_0x54ed61;return getEndUser(_0x187e6d,_0x155fc9,_0x351520[_0x4ac0('0x77')],_0x351520[_0x4ac0('0x78')],_0x3a44c9);})['then'](function(_0x4f50d0){_0x418be9=_0x4f50d0;return getTicket(_0x187e6d,_0x3d5de4,_0x418be9,_0x155fc9,_0x351520,_0x155fc9[_0x4ac0('0x79')],_0x3a44c9,'outbound');})[_0x4ac0('0x28')](function(_0x41efb4){_0x421036=_0x41efb4;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x421036['id']);logger[_0x4ac0('0x2b')](_0x4ac0('0x7a'),_0x421036['id'],_0x2cb4ca['name'],_0x187e6d[_0x4ac0('0x41')]);switch(_0x187e6d[_0x4ac0('0x41')]){case _0x4ac0('0x69'):emit(util[_0x4ac0('0x49')](_0x4ac0('0x6a'),_0x2cb4ca[_0x4ac0('0x55')]),_0x4ac0('0x6b'),{'recordId':_0x421036['id']});break;case _0x4ac0('0x6c'):emit(util['format']('user:%s',_0x2cb4ca['name']),_0x4ac0('0x6d'),{'uri':util[_0x4ac0('0x49')](_0x4ac0('0x6e'),_0x3a44c9['instanceUrl'],_0x421036['id'])});break;default:logger[_0x4ac0('0x70')](_0x4ac0('0x76'),_0x4ac0('0x7b'));}})[_0x4ac0('0x72')](function(_0x22ac83){logger[_0x4ac0('0x70')](_0x4ac0('0x76'),_0x22ac83);});};exports[_0x4ac0('0x7c')]=function(_0xeadb18,_0x160d6a,_0x31fabe,_0x3bda52,_0x47f438,_0x1ba2dd){var _0xa7ea60,_0x410be1,_0x42df6e,_0x1400ba;_0x1ba2dd[_0x4ac0('0x5f')]=intUtil[_0x4ac0('0x5e')](_0x1ba2dd['serverUrl']);_0x1ba2dd[_0x4ac0('0x58')]=intUtil[_0x4ac0('0x5e')](_0x1ba2dd[_0x4ac0('0x58')]);if(_0x47f438&&_0x47f438[_0x4ac0('0x7d')]){logger[_0x4ac0('0x2b')]('['+_0x160d6a['lastevent'][_0x4ac0('0x7e')]()+']',_0x4ac0('0x61'));_0x160d6a[_0x4ac0('0x62')]=util[_0x4ac0('0x49')](_0x4ac0('0x63'),_0x1ba2dd[_0x4ac0('0x5f')],_0x160d6a[_0x4ac0('0x64')],md5(_0x160d6a[_0x4ac0('0x64')]));}else{_0x160d6a[_0x4ac0('0x62')]='';}return getConnection(_0x1ba2dd)[_0x4ac0('0x28')](function(_0x48de45){_0x1400ba=_0x48de45;if(!_[_0x4ac0('0x7f')](_0x3bda52)){return getUser(_0x1ba2dd,_0x3bda52['name'],_0x1400ba);}else{return getUser(_0x1ba2dd,null,_0x1400ba);}})[_0x4ac0('0x28')](function(_0x17e0c7){_0xa7ea60=_0x17e0c7;return getEndUser(_0x1ba2dd,_0x31fabe,_0x160d6a[_0x4ac0('0x66')],_0x160d6a[_0x4ac0('0x80')],_0x1400ba);})['then'](function(_0x110d88){_0x410be1=_0x110d88;return getTicket(_0x1ba2dd,_0xa7ea60,_0x410be1,_0x31fabe,_0x160d6a,_0x31fabe['Fields'],_0x1400ba);})[_0x4ac0('0x28')](function(_0x2c84d2){_0x42df6e=_0x2c84d2;logger[_0x4ac0('0x2b')]('['+_0x160d6a[_0x4ac0('0x81')][_0x4ac0('0x7e')]()+_0x4ac0('0x82'),_0x42df6e['id']);logger['info']('['+_0x160d6a[_0x4ac0('0x81')]['toUpperCase']()+_0x4ac0('0x83'),_0x1ba2dd['type']);})[_0x4ac0('0x72')](function(_0x4b43c0){logger['error']('['+_0x160d6a['lastevent'][_0x4ac0('0x7e')]()+']',_0x4b43c0);});}; \ No newline at end of file +var _0xeb6a=['destcalleridnum','integrationTab','user:%s','newTab','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','jsforce','util','ioredis','../../../../config/logger','salesforce','redis','defaults','localhost','emit','getString','Subjects','ticketType','Task','ActivityDate','utc','IsReminderSet','endUserType','contact','WhoId','account','WhatId','Case','ContactId','lead','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','additionalSearchLead','Lead','additionalSearchAccount','Contact','Account','first','Phone','attributes','type','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','create','forEach','idField','content','toString','variableName','Variable','name','toLowerCase','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','Connection\x20established.','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','trigger:browser:url','%s/%s/e','instanceUrl','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeb6a,0x185));var _0xaeb6=function(_0x60146f,_0x5cd85c){_0x60146f=_0x60146f-0x0;var _0x147552=_0xeb6a[_0x60146f];return _0x147552;};'use strict';var _=require(_0xaeb6('0x0'));var rp=require(_0xaeb6('0x1'));var moment=require(_0xaeb6('0x2'));var BPromise=require(_0xaeb6('0x3'));var md5=require('md5');var jsforce=require(_0xaeb6('0x4'));var util=require(_0xaeb6('0x5'));var Redis=require(_0xaeb6('0x6'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xaeb6('0x7'))(_0xaeb6('0x8'));config[_0xaeb6('0x9')]=_[_0xaeb6('0xa')](config[_0xaeb6('0x9')],{'host':_0xaeb6('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xaeb6('0x9')]));function emit(_0x45b19e,_0x3a735c,_0x4745ad){io['to'](_0x45b19e)[_0xaeb6('0xc')](_0x3a735c,_0x4745ad);}function getTicket(_0x2334d2,_0x48d140,_0x220955,_0x23f5a9,_0x3d581b,_0x4cb1cb,_0x2be865,_0x15adfa){var _0x3c26a3=Object['assign']({},{'OwnerId':_0x48d140['id'],'Subject':intUtil[_0xaeb6('0xd')](_0x23f5a9[_0xaeb6('0xe')],_0x3d581b,'\x20'),'Description':intUtil[_0xaeb6('0xd')](_0x23f5a9['Descriptions'],_0x3d581b,'\x0a')},getCustomFields(_0x4cb1cb,_0x3d581b));if(_0x220955){if(_0x23f5a9[_0xaeb6('0xf')]===_0xaeb6('0x10')){_0x3c26a3[_0xaeb6('0x11')]=moment[_0xaeb6('0x12')]();_0x3c26a3[_0xaeb6('0x13')]=![];_0x3c26a3['IsRecurrence']=![];if(_0x220955[_0xaeb6('0x14')]===_0xaeb6('0x15')||_0x220955['endUserType']==='lead'){_0x3c26a3[_0xaeb6('0x16')]=_0x220955['id'];}else if(_0x220955['endUserType']===_0xaeb6('0x17')){_0x3c26a3[_0xaeb6('0x18')]=_0x220955['id'];}}else if(_0x23f5a9[_0xaeb6('0xf')]===_0xaeb6('0x19')){if(_0x220955[_0xaeb6('0x14')]===_0xaeb6('0x15')){_0x3c26a3[_0xaeb6('0x1a')]=_0x220955['id'];}else if(_0x220955[_0xaeb6('0x14')]===_0xaeb6('0x17')){_0x3c26a3['AccountId']=_0x220955['id'];}else if(_0x220955[_0xaeb6('0x14')]===_0xaeb6('0x1b')&&_0x23f5a9['leadId']){_0x3c26a3[_0x23f5a9[_0xaeb6('0x1c')]]=_0x220955['id'];}else{logger[_0xaeb6('0x1d')](_0xaeb6('0x1e'));}}}return _0x2be865[_0xaeb6('0x1f')](_0x23f5a9[_0xaeb6('0xf')])['create'](_0x3c26a3);}function getUser(_0x10ce86,_0x569338,_0x36c0c4){if(!_[_0xaeb6('0x20')](_0x569338)&&intUtil[_0xaeb6('0x21')](_0x569338)){var _0x15f522={'Email':_0x569338};var _0x3ae0f4={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x36c0c4['sobject'](_0xaeb6('0x22'))[_0xaeb6('0x23')](_0x15f522,_0x3ae0f4)[_0xaeb6('0x24')]()[_0xaeb6('0x25')](function(_0x4accfd){if(_0x4accfd[_0xaeb6('0x26')]){var _0x187011=_['find'](_0x4accfd,function(_0x1ee0f5){return _0x1ee0f5[_0xaeb6('0x27')]===_0x569338;});if(_0x187011){logger[_0xaeb6('0x1d')](_0xaeb6('0x28'),_0x569338);return BPromise[_0xaeb6('0x29')]({'id':_0x187011['Id'],'name':_0x187011[_0xaeb6('0x2a')]});}}else{logger['info'](_0xaeb6('0x2b'),_0x569338);return _0x36c0c4[_0xaeb6('0x2c')]()[_0xaeb6('0x25')](function(_0xb5501f){return BPromise[_0xaeb6('0x29')]({'id':_0xb5501f[_0xaeb6('0x2d')],'name':_0xb5501f[_0xaeb6('0x2e')]});});}});}else{logger['info'](_0xaeb6('0x2b'),_0x569338);return _0x36c0c4[_0xaeb6('0x2c')]()[_0xaeb6('0x25')](function(_0x4d7542){return BPromise[_0xaeb6('0x29')]({'id':_0x4d7542['user_id'],'name':_0x4d7542['display_name']});});}}function getEndUser(_0x4dee93,_0x4f73ae,_0xfad076,_0x3b11cf,_0x5ac200){var _0x1205d0={'$or':{'Phone':_0x3b11cf}};var _0x520237={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xaeb6('0x25')](function(){logger[_0xaeb6('0x1d')](_0xaeb6('0x2f'),_0x3b11cf,_0x4f73ae['moduleSearch']);switch(_0x4f73ae[_0xaeb6('0x30')]){case _0xaeb6('0x31'):var _0x41e10b=_[_0xaeb6('0x32')](_0x1205d0);if(_0x4f73ae[_0xaeb6('0x33')]){var _0x5caa19={};_0x5caa19[_0x4f73ae[_0xaeb6('0x33')]]=_0x3b11cf;_[_0xaeb6('0x34')](_0x41e10b[_0xaeb6('0x35')],_0x5caa19);}return _0x5ac200['sobject']('Contact')[_0xaeb6('0x23')](_0x41e10b,_0x520237)[_0xaeb6('0x24')]()['then'](function(_0xbb8afa){if(_0xbb8afa&&_0xbb8afa[_0xaeb6('0x26')]){return _0xbb8afa;}else{var _0x50a573=_[_0xaeb6('0x32')](_0x1205d0);if(_0x4f73ae[_0xaeb6('0x36')]){var _0x95333f={};_0x95333f[_0x4f73ae['additionalSearchLead']]=_0x3b11cf;_['merge'](_0x50a573['$or'],_0x95333f);}return _0x5ac200['sobject'](_0xaeb6('0x37'))[_0xaeb6('0x23')](_0x50a573,_0x520237);}});case'account_contact_lead':var _0x45fd0f=_[_0xaeb6('0x32')](_0x1205d0);if(_0x4f73ae[_0xaeb6('0x38')]){var _0x5caa19={};_0x5caa19[_0x4f73ae[_0xaeb6('0x38')]]=_0x3b11cf;_[_0xaeb6('0x34')](_0x45fd0f[_0xaeb6('0x35')],_0x5caa19);}return _0x5ac200[_0xaeb6('0x1f')]('Account')[_0xaeb6('0x23')](_0x45fd0f,_0x520237)[_0xaeb6('0x24')]()[_0xaeb6('0x25')](function(_0x4aa825){if(_0x4aa825&&_0x4aa825['length']){return _0x4aa825;}else{var _0x227e5e=_[_0xaeb6('0x32')](_0x1205d0);if(_0x4f73ae[_0xaeb6('0x33')]){var _0x118af1={};_0x118af1[_0x4f73ae[_0xaeb6('0x33')]]=_0x3b11cf;_[_0xaeb6('0x34')](_0x227e5e[_0xaeb6('0x35')],_0x118af1);}return _0x5ac200['sobject']('Contact')[_0xaeb6('0x23')](_0x227e5e,_0x520237)[_0xaeb6('0x25')](function(_0x58219c){if(_0x58219c&&_0x58219c[_0xaeb6('0x26')]){return _0x58219c;}else{var _0x3517f6=_['cloneDeep'](_0x1205d0);if(_0x4f73ae[_0xaeb6('0x36')]){var _0x5e0c7f={};_0x5e0c7f[_0x4f73ae[_0xaeb6('0x36')]]=_0x3b11cf;_['merge'](_0x3517f6[_0xaeb6('0x35')],_0x5e0c7f);}return _0x5ac200['sobject'](_0xaeb6('0x37'))[_0xaeb6('0x23')](_0x3517f6,_0x520237);}});}});case'contact':var _0x41e10b=_[_0xaeb6('0x32')](_0x1205d0);if(_0x4f73ae['additionalSearchContact']){var _0x5caa19={};_0x5caa19[_0x4f73ae[_0xaeb6('0x33')]]=_0x3b11cf;_[_0xaeb6('0x34')](_0x41e10b[_0xaeb6('0x35')],_0x5caa19);}return _0x5ac200['sobject'](_0xaeb6('0x39'))[_0xaeb6('0x23')](_0x41e10b,_0x520237)['execute']();case _0xaeb6('0x1b'):var _0x4aa762=_[_0xaeb6('0x32')](_0x1205d0);if(_0x4f73ae[_0xaeb6('0x36')]){var _0x5caa19={};_0x5caa19[_0x4f73ae[_0xaeb6('0x36')]]=_0x3b11cf;_[_0xaeb6('0x34')](_0x4aa762[_0xaeb6('0x35')],_0x5caa19);}return _0x5ac200[_0xaeb6('0x1f')](_0xaeb6('0x37'))['find'](_0x4aa762,_0x520237);case _0xaeb6('0x17'):var _0x45fd0f=_[_0xaeb6('0x32')](_0x1205d0);if(_0x4f73ae[_0xaeb6('0x38')]){var _0x5caa19={};_0x5caa19[_0x4f73ae[_0xaeb6('0x38')]]=_0x3b11cf;_[_0xaeb6('0x34')](_0x45fd0f['$or'],_0x5caa19);}return _0x5ac200[_0xaeb6('0x1f')](_0xaeb6('0x3a'))['find'](_0x45fd0f,_0x520237);default:return null;}})['then'](function(_0x3d1582){if(_0x3d1582&&_0x3d1582[_0xaeb6('0x26')]){var _0x2c8dfa=_[_0xaeb6('0x3b')](_0x3d1582);if(_0x2c8dfa){return BPromise[_0xaeb6('0x29')]({'id':_0x2c8dfa['Id'],'name':_0x2c8dfa[_0xaeb6('0x2a')],'phone':_0x2c8dfa[_0xaeb6('0x3c')],'endUserType':_0x2c8dfa[_0xaeb6('0x3d')][_0xaeb6('0x3e')]['toLowerCase']()});}}})['then'](function(_0x2c916b){if(_0x2c916b){logger[_0xaeb6('0x1d')](_0xaeb6('0x3f'),_0x2c916b[_0xaeb6('0x14')],_0x3b11cf);return BPromise[_0xaeb6('0x29')](_0x2c916b);}else{logger[_0xaeb6('0x1d')](_0xaeb6('0x40'),_0x3b11cf);var _0x4a79dd={'Phone':_0x3b11cf};if(_0x4f73ae[_0xaeb6('0x41')]){if(_0x4f73ae[_0xaeb6('0x41')]===_0xaeb6('0x15')){logger['info'](_0xaeb6('0x42'),_0x3b11cf,_0x4f73ae[_0xaeb6('0x41')]);_0x4a79dd[_0xaeb6('0x43')]=_0xfad076!==''?_0xfad076:util[_0xaeb6('0x44')](_0xaeb6('0x45'),_0x3b11cf);}else if(_0x4f73ae[_0xaeb6('0x41')]===_0xaeb6('0x1b')){logger[_0xaeb6('0x1d')](_0xaeb6('0x42'),_0x3b11cf,_0x4f73ae[_0xaeb6('0x41')]);_0x4a79dd['LastName']=_0xfad076!==''?_0xfad076:util['format']('Caller\x20-\x20%s',_0x3b11cf);_0x4a79dd[_0xaeb6('0x46')]=_0xaeb6('0x47');}else if(_0x4f73ae['moduleCreate']===_0xaeb6('0x17')){logger[_0xaeb6('0x1d')](_0xaeb6('0x42'),_0x3b11cf,_0x4f73ae['moduleCreate']);_0x4a79dd['Name']=_0xfad076!==''?_0xfad076:util[_0xaeb6('0x44')](_0xaeb6('0x45'),_0x3b11cf);}else{return null;}}return _0x5ac200[_0xaeb6('0x1f')](_['upperFirst'](_0x4f73ae[_0xaeb6('0x41')]))[_0xaeb6('0x48')](_0x4a79dd)['then'](function(_0x2b2877){return BPromise[_0xaeb6('0x29')]({'id':_0x2b2877['id'],'endUserType':_0x4f73ae[_0xaeb6('0x41')]});});}});}function getCustomFields(_0x3ee598,_0x3a070f){var _0x55936e={};if(_0x3ee598['length']>0x0){_[_0xaeb6('0x49')](_0x3ee598,function(_0x2ef5de){if(_['includes'](['string','picklist'],_0x2ef5de[_0xaeb6('0x3e')])&&_0x2ef5de[_0xaeb6('0x4a')]){_0x55936e[_0x2ef5de[_0xaeb6('0x4a')]]=_0x2ef5de[_0xaeb6('0x4b')][_0xaeb6('0x4c')]();}else if(_0x2ef5de['type']==='variable'&&_0x2ef5de[_0xaeb6('0x4d')]&&_0x2ef5de[_0xaeb6('0x4a')]){_0x3a070f[_0x2ef5de[_0xaeb6('0x4d')]]&&(_0x55936e[_0x2ef5de[_0xaeb6('0x4a')]]=_0x3a070f[_0x2ef5de['variableName']][_0xaeb6('0x4c')]());}else if(_0x2ef5de[_0xaeb6('0x3e')]==='customVariable'&&_0x2ef5de['Variable']&&_0x2ef5de[_0xaeb6('0x4e')]['name']&&_0x2ef5de['idField']){_0x3a070f[_0x2ef5de[_0xaeb6('0x4e')][_0xaeb6('0x4f')][_0xaeb6('0x50')]()]&&(_0x55936e[_0x2ef5de[_0xaeb6('0x4a')]]=_0x3a070f[_0x2ef5de['Variable']['name'][_0xaeb6('0x50')]()][_0xaeb6('0x4c')]());}});}return _0x55936e;}function getConnection(_0x248729){var _0x131d6e=_0x248729[_0xaeb6('0x51')][_0xaeb6('0x52')](_0x248729['securityToken']);var _0x101a35=new jsforce[(_0xaeb6('0x53'))]({'oauth2':{'loginUrl':_0x248729[_0xaeb6('0x54')]||_0xaeb6('0x55'),'clientId':_0x248729[_0xaeb6('0x56')],'clientSecret':_0x248729[_0xaeb6('0x57')]}});return _0x101a35['login'](_0x248729['username'],_0x131d6e)[_0xaeb6('0x25')](function(){logger['info'](_0xaeb6('0x58'));return _0x101a35;});}exports['queue']=function(_0x2e1330,_0x55284,_0x4a68f5,_0x48117e,_0x450ced,_0x1bd99f){var _0x2be0a7,_0x231d51,_0x34dcdf,_0x237c90;_0x1bd99f['serverUrl']=intUtil[_0xaeb6('0x59')](_0x1bd99f['serverUrl']);_0x1bd99f['remoteUri']=intUtil[_0xaeb6('0x59')](_0x1bd99f['remoteUri']);if(_0x450ced&&_0x450ced['monitor_format']){logger[_0xaeb6('0x1d')](_0xaeb6('0x5a'),_0xaeb6('0x5b'));_0x55284[_0xaeb6('0x5c')]=util['format'](_0xaeb6('0x5d'),_0x1bd99f[_0xaeb6('0x5e')],_0x55284[_0xaeb6('0x5f')],md5(_0x55284['uniqueid']));}else{_0x55284['recordingURL']='';}return getConnection(_0x1bd99f)[_0xaeb6('0x25')](function(_0x26ac7a){_0x237c90=_0x26ac7a;return getUser(_0x1bd99f,_0x48117e[_0xaeb6('0x60')],_0x237c90);})['then'](function(_0x58e210){_0x2be0a7=_0x58e210;return getEndUser(_0x1bd99f,_0x4a68f5,_0x55284[_0xaeb6('0x61')],_0x55284[_0xaeb6('0x62')],_0x237c90);})[_0xaeb6('0x25')](function(_0x26746){_0x231d51=_0x26746;return getTicket(_0x1bd99f,_0x2be0a7,_0x231d51,_0x4a68f5,_0x55284,_0x4a68f5[_0xaeb6('0x63')],_0x237c90,_0xaeb6('0x64'));})[_0xaeb6('0x25')](function(_0x3e730c){_0x34dcdf=_0x3e730c;logger[_0xaeb6('0x1d')](_0xaeb6('0x65'),_0x34dcdf['id']);logger[_0xaeb6('0x1d')](_0xaeb6('0x66'),_0x34dcdf['id'],_0x48117e[_0xaeb6('0x4f')],_0x1bd99f['type']);switch(_0x1bd99f['type']){case'integrationTab':emit(util[_0xaeb6('0x44')]('user:%s',_0x48117e[_0xaeb6('0x4f')]),_0xaeb6('0x67'),{'recordId':_0x34dcdf['id']});break;case'newTab':emit(util['format']('user:%s',_0x48117e[_0xaeb6('0x4f')]),_0xaeb6('0x68'),{'uri':util['format'](_0xaeb6('0x69'),_0x237c90[_0xaeb6('0x6a')],_0x34dcdf['id'])});break;default:logger['error'](_0xaeb6('0x6b'));}})[_0xaeb6('0x6c')](function(_0x52c249){logger[_0xaeb6('0x6d')](_0xaeb6('0x5a'),_0x52c249);});};exports[_0xaeb6('0x6e')]=function(_0x3d6b0f,_0x37871e,_0xe5cc85,_0x9c547d,_0x5d61fc,_0x1d1ab8,_0x186b3f){var _0x50b9d5,_0xe61da1,_0x554363,_0x194666;_0x1d1ab8[_0xaeb6('0x5e')]=intUtil[_0xaeb6('0x59')](_0x1d1ab8[_0xaeb6('0x5e')]);_0x1d1ab8['remoteUri']=intUtil[_0xaeb6('0x59')](_0x1d1ab8[_0xaeb6('0x54')]);if(_0x186b3f&&_0x186b3f[_0xaeb6('0x6f')]&&_0x186b3f['recordingFormat']!==_0xaeb6('0x70')){logger['info'](_0xaeb6('0x71'),_0xaeb6('0x5b'));_0x37871e[_0xaeb6('0x5c')]=util[_0xaeb6('0x44')](_0xaeb6('0x5d'),_0x1d1ab8[_0xaeb6('0x5e')],_0x37871e[_0xaeb6('0x5f')],md5(_0x37871e[_0xaeb6('0x5f')]));}return getConnection(_0x1d1ab8)[_0xaeb6('0x25')](function(_0x4c7600){_0x194666=_0x4c7600;return getUser(_0x1d1ab8,_0x9c547d[_0xaeb6('0x60')],_0x194666);})[_0xaeb6('0x25')](function(_0x1b8e2b){_0x50b9d5=_0x1b8e2b;return getEndUser(_0x1d1ab8,_0xe5cc85,_0x37871e[_0xaeb6('0x72')],_0x37871e[_0xaeb6('0x73')],_0x194666);})['then'](function(_0x2be06b){_0xe61da1=_0x2be06b;return getTicket(_0x1d1ab8,_0x50b9d5,_0xe61da1,_0xe5cc85,_0x37871e,_0xe5cc85['Fields'],_0x194666,'outbound');})['then'](function(_0x1fe145){_0x554363=_0x1fe145;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x554363['id']);logger[_0xaeb6('0x1d')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x554363['id'],_0x9c547d['name'],_0x1d1ab8[_0xaeb6('0x3e')]);switch(_0x1d1ab8[_0xaeb6('0x3e')]){case _0xaeb6('0x74'):emit(util[_0xaeb6('0x44')](_0xaeb6('0x75'),_0x9c547d[_0xaeb6('0x4f')]),_0xaeb6('0x67'),{'recordId':_0x554363['id']});break;case _0xaeb6('0x76'):emit(util[_0xaeb6('0x44')]('user:%s',_0x9c547d[_0xaeb6('0x4f')]),'trigger:browser:url',{'uri':util[_0xaeb6('0x44')](_0xaeb6('0x69'),_0x194666['instanceUrl'],_0x554363['id'])});break;default:logger[_0xaeb6('0x6d')]('[OUTBOUND]',_0xaeb6('0x77'));}})[_0xaeb6('0x6c')](function(_0xf7d956){logger[_0xaeb6('0x6d')](_0xaeb6('0x71'),_0xf7d956);});};exports[_0xaeb6('0x78')]=function(_0x2214d3,_0x56c1f0,_0x5ea4d6,_0x1f2919,_0x21d3f1,_0x1fbe5d){var _0x25f444,_0x14edab,_0x1bc960,_0x4ec104;_0x1fbe5d[_0xaeb6('0x5e')]=intUtil[_0xaeb6('0x59')](_0x1fbe5d[_0xaeb6('0x5e')]);_0x1fbe5d['remoteUri']=intUtil[_0xaeb6('0x59')](_0x1fbe5d[_0xaeb6('0x54')]);if(_0x21d3f1&&_0x21d3f1[_0xaeb6('0x79')]){logger[_0xaeb6('0x1d')]('['+_0x56c1f0[_0xaeb6('0x7a')][_0xaeb6('0x7b')]()+']',_0xaeb6('0x5b'));_0x56c1f0[_0xaeb6('0x5c')]=util[_0xaeb6('0x44')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1fbe5d[_0xaeb6('0x5e')],_0x56c1f0['uniqueid'],md5(_0x56c1f0[_0xaeb6('0x5f')]));}else{_0x56c1f0[_0xaeb6('0x5c')]='';}return getConnection(_0x1fbe5d)[_0xaeb6('0x25')](function(_0x2a3419){_0x4ec104=_0x2a3419;if(!_[_0xaeb6('0x20')](_0x1f2919)){return getUser(_0x1fbe5d,_0x1f2919[_0xaeb6('0x4f')],_0x4ec104);}else{return getUser(_0x1fbe5d,null,_0x4ec104);}})[_0xaeb6('0x25')](function(_0x56acf7){_0x25f444=_0x56acf7;return getEndUser(_0x1fbe5d,_0x5ea4d6,_0x56c1f0[_0xaeb6('0x61')],_0x56c1f0[_0xaeb6('0x62')],_0x4ec104);})[_0xaeb6('0x25')](function(_0x18d4eb){_0x14edab=_0x18d4eb;return getTicket(_0x1fbe5d,_0x25f444,_0x14edab,_0x5ea4d6,_0x56c1f0,_0x5ea4d6['Fields'],_0x4ec104);})[_0xaeb6('0x25')](function(_0x395ca9){_0x1bc960=_0x395ca9;logger[_0xaeb6('0x1d')]('['+_0x56c1f0[_0xaeb6('0x7a')][_0xaeb6('0x7b')]()+_0xaeb6('0x7c'),_0x1bc960['id']);logger['info']('['+_0x56c1f0[_0xaeb6('0x7a')]['toUpperCase']()+_0xaeb6('0x7d'),_0x1fbe5d[_0xaeb6('0x3e')]);})[_0xaeb6('0x6c')](function(_0x406cb7){logger[_0xaeb6('0x6d')]('['+_0x56c1f0[_0xaeb6('0x7a')][_0xaeb6('0x7b')]()+']',_0x406cb7);});}; \ 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 32c0603..2221046 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 _0x7a65=['monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','length','adminId','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','true','userId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','toLowerCase','content','toString','includes','customField','idField','variable','variableName','Variable','name','outbound','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','username','password','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x167060,_0x592c2d){var _0x5b1baa=function(_0x283b26){while(--_0x283b26){_0x167060['push'](_0x167060['shift']());}};_0x5b1baa(++_0x592c2d);}(_0x7a65,0x1c3));var _0x57a6=function(_0x3c66ee,_0x410d31){_0x3c66ee=_0x3c66ee-0x0;var _0x32c7c4=_0x7a65[_0x3c66ee];return _0x32c7c4;};'use strict';var _=require(_0x57a6('0x0'));var Promise=require(_0x57a6('0x1'));var rp=require(_0x57a6('0x2'));var util=require(_0x57a6('0x3'));var md5=require(_0x57a6('0x4'));var Redis=require(_0x57a6('0x5'));var intUtil=require(_0x57a6('0x6'));var config=require(_0x57a6('0x7'));var logger=require(_0x57a6('0x8'))(_0x57a6('0x9'));config[_0x57a6('0xa')]=_[_0x57a6('0xb')](config[_0x57a6('0xa')],{'host':_0x57a6('0xc'),'port':0x18eb});var io=require(_0x57a6('0xd'))(new Redis(config[_0x57a6('0xa')]));function getAdminUser(_0x33e345,_0x2e8233,_0x30bb26,_0x195d16,_0x4e1801,_0x2d7f16){return new Promise(function(_0x2912c1,_0x24f426){var _0x4d30a9={'method':_0x57a6('0xe'),'uri':_0x195d16+_0x57a6('0xf')+'&'+_0x4e1801+'&'+_0x2d7f16,'auth':_0x2e8233,'json':!![]};return rp(_0x4d30a9)['then'](function(_0xfeee8f){if(_0xfeee8f[_0x57a6('0x10')][_0x57a6('0x11')]>0x0){_0x30bb26[_0x57a6('0x12')]=_0xfeee8f['result'][0x0][_0x57a6('0x13')];}logger[_0x57a6('0x14')]('['+[_0x33e345[_0x57a6('0x15')]()]+_0x57a6('0x16'),_0x30bb26);_0x2912c1(_0x30bb26);})[_0x57a6('0x17')](function(_0x5413b3){logger[_0x57a6('0x18')]('['+[_0x33e345[_0x57a6('0x15')]()]+']',_0x5413b3[_0x57a6('0x19')]);_0x24f426(_0x5413b3['message']);});});}function getUser(_0x46d043,_0x2c48e8,_0x1a55e8,_0x270676,_0x42b1b1){return function(_0x160aae){logger[_0x57a6('0x14')]('['+[_0x46d043['toUpperCase']()]+_0x57a6('0x1a'),_0x160aae);return new Promise(function(_0x592e45,_0x3bb044){if(intUtil['validateEmail'](_0x160aae[_0x57a6('0x1b')])){var _0x266e4b={'method':_0x57a6('0xe'),'uri':_0x1a55e8+'sys_user?sysparm_query=email%3D'+_0x160aae[_0x57a6('0x1b')]+'&'+_0x270676+'&'+_0x42b1b1,'auth':_0x2c48e8,'json':!![]};logger['info']('['+[_0x46d043['toUpperCase']()]+_0x57a6('0x1c'),_0x266e4b);return rp(_0x266e4b)[_0x57a6('0x1d')](function(_0x300024){logger[_0x57a6('0x14')]('['+[_0x46d043[_0x57a6('0x15')]()]+_0x57a6('0x1e'),_0x300024);if(_0x300024['result']['length']>0x0&&String(_0x300024['result'][0x0]['active'])===_0x57a6('0x1f')){_0x160aae[_0x57a6('0x20')]=_0x300024['result'][0x0][_0x57a6('0x13')];}else{_0x160aae[_0x57a6('0x20')]=_0x160aae['adminId'];_0x160aae[_0x57a6('0x1b')]=_0x160aae[_0x57a6('0x21')];}logger[_0x57a6('0x14')]('['+[_0x46d043[_0x57a6('0x15')]()]+_0x57a6('0x22'),_0x160aae);_0x592e45(_0x160aae);})[_0x57a6('0x17')](function(_0x308b66){logger[_0x57a6('0x18')]('['+[_0x46d043[_0x57a6('0x15')]()]+']',_0x308b66[_0x57a6('0x19')]);_0x3bb044(_0x308b66[_0x57a6('0x19')]);});}else{logger[_0x57a6('0x14')]('['+[_0x46d043['toUpperCase']()]+_0x57a6('0x23'));_0x160aae[_0x57a6('0x20')]=_0x160aae[_0x57a6('0x12')];_0x160aae['userEmail']=_0x160aae[_0x57a6('0x21')];_0x592e45(_0x160aae);}});};}function createEndUser(_0x35e47c,_0x1cb0c9,_0x507321,_0x588106,_0x3d53dc){logger[_0x57a6('0x14')]('['+[_0x35e47c[_0x57a6('0x15')]()]+_0x57a6('0x24'),_0x507321);return new Promise(function(_0x9dde22,_0x4f89bc){var _0x10d4da={'method':_0x57a6('0x25'),'uri':_0x588106+_0x57a6('0x26')+_0x3d53dc,'body':{'user_name':_0x507321[_0x57a6('0x27')],'roles':'user','first_name':_0x507321['endUserNumber'],'active':'true','date_format':_0x57a6('0x28'),'phone':_0x507321[_0x57a6('0x27')]},'auth':_0x1cb0c9,'json':!![]};return rp(_0x10d4da)[_0x57a6('0x1d')](function(_0x1bb66e){logger[_0x57a6('0x14')]('['+[_0x35e47c['toUpperCase']()]+'],\x20EndUser\x20schema',_0x1bb66e[_0x57a6('0x10')]);_0x507321[_0x57a6('0x29')]=_0x1bb66e[_0x57a6('0x10')][_0x57a6('0x13')];_0x9dde22(_0x507321);})[_0x57a6('0x17')](function(_0x1ad1cf){logger[_0x57a6('0x18')]('['+[_0x35e47c['toUpperCase']()]+']',_0x1ad1cf[_0x57a6('0x19')]);_0x4f89bc(_0x1ad1cf[_0x57a6('0x19')]);});});}function getEndUser(_0x3335c7,_0x6ac419,_0x5e5dfc,_0x364444,_0x38efb2){return function(_0x42cd1a){logger[_0x57a6('0x14')]('['+[_0x3335c7[_0x57a6('0x15')]()]+_0x57a6('0x2a'),_0x42cd1a);return new Promise(function(_0x5ae9a0,_0x24043d){var _0xbe8cb6={'method':'GET','uri':_0x5e5dfc+_0x57a6('0x2b')+_0x42cd1a[_0x57a6('0x27')]+'&'+_0x364444+'&'+_0x38efb2,'auth':_0x6ac419,'json':!![]};return rp(_0xbe8cb6)[_0x57a6('0x1d')](function(_0x3a0078){if(_0x3a0078[_0x57a6('0x10')][_0x57a6('0x11')]>0x0){_0x42cd1a['endUserId']=_0x3a0078[_0x57a6('0x10')][0x0][_0x57a6('0x13')];logger['info']('['+[_0x3335c7[_0x57a6('0x15')]()]+'],\x20getEndUser\x20crm',_0x42cd1a);_0x5ae9a0(_0x42cd1a);}else{return createEndUser(_0x3335c7,_0x6ac419,_0x42cd1a,_0x5e5dfc,_0x364444)[_0x57a6('0x1d')](function(_0x3c8091){logger['info']('['+[_0x3335c7[_0x57a6('0x15')]()]+_0x57a6('0x2c'),_0x3c8091);_0x5ae9a0(_0x3c8091);});}})['catch'](function(_0x4773fd){logger['error']('['+[_0x3335c7[_0x57a6('0x15')]()]+']',_0x4773fd[_0x57a6('0x19')]);_0x24043d(_0x4773fd[_0x57a6('0x19')]);});});};}function getCustomFields(_0x295877,_0x396dbb){var _0x2e9927={};if(_0x295877[_0x57a6('0x11')]>0x0){_[_0x57a6('0x2d')](_0x295877,function(_0x45c628){if(_['includes']([_0x57a6('0x2e'),_0x57a6('0x2f')],_0x45c628[_0x57a6('0x30')])&&_0x45c628[_0x57a6('0x31')]&&!_0x45c628['customField']){_0x2e9927[_0x45c628[_0x57a6('0x31')][_0x57a6('0x32')]()]=_0x45c628[_0x57a6('0x33')][_0x57a6('0x34')]();}else if(_[_0x57a6('0x35')]([_0x57a6('0x2e'),_0x57a6('0x2f')],_0x45c628[_0x57a6('0x30')])&&_0x45c628['idField']&&_0x45c628[_0x57a6('0x36')]){_0x2e9927[_0x45c628[_0x57a6('0x37')][_0x57a6('0x32')]()]=_0x45c628['content'][_0x57a6('0x34')]();}else if(_0x45c628[_0x57a6('0x30')]===_0x57a6('0x38')&&_0x45c628['variableName']&&_0x45c628[_0x57a6('0x37')]&&_0x45c628[_0x57a6('0x36')]){_0x2e9927[_0x45c628[_0x57a6('0x37')][_0x57a6('0x32')]()]=_0x396dbb[_0x45c628[_0x57a6('0x39')]][_0x57a6('0x34')]();}else if(_0x45c628[_0x57a6('0x30')]==='customVariable'&&_0x45c628[_0x57a6('0x3a')]&&_0x45c628[_0x57a6('0x3a')][_0x57a6('0x3b')]&&_0x45c628[_0x57a6('0x37')]&&_0x45c628[_0x57a6('0x36')]){_0x2e9927[_0x45c628['idField'][_0x57a6('0x32')]()]=_0x396dbb[_0x45c628[_0x57a6('0x3a')][_0x57a6('0x3b')][_0x57a6('0x32')]()][_0x57a6('0x34')]();}});}return _0x2e9927;}function getTicket(_0x13077d,_0x367c0d,_0x4f2b15,_0x464564,_0x36cf45,_0x56ec93){return function(_0x16f350){logger[_0x57a6('0x14')]('['+[_0x13077d[_0x57a6('0x15')]()]+']\x20getTicket\x20input\x20crm',_0x16f350);return new Promise(function(_0x57b5f9,_0x5e1aa0){var _0x22c19b=_0x13077d['toLowerCase']()===_0x57a6('0x3c')?_0x16f350[_0x57a6('0x20')]:_0x16f350[_0x57a6('0x29')];var _0x30337e={'method':_0x57a6('0x25'),'uri':_0x4f2b15+_0x57a6('0x3d')+'?'+_0x56ec93,'body':Object[_0x57a6('0x3e')]({},{'active':_0x57a6('0x1f'),'caller_id':_0x22c19b,'assigned_to':_0x16f350[_0x57a6('0x20')],'short_description':intUtil[_0x57a6('0x3f')](_0x464564[_0x57a6('0x40')],_0x36cf45,'\x20'),'description':intUtil[_0x57a6('0x3f')](_0x464564[_0x57a6('0x41')],_0x36cf45,'\x0a')},getCustomFields(_0x464564['Fields'],_0x36cf45)),'auth':_0x367c0d,'json':!![]};return rp(_0x30337e)[_0x57a6('0x1d')](function(_0x251952){logger[_0x57a6('0x14')]('['+[_0x13077d['toUpperCase']()]+_0x57a6('0x42'),_0x251952[_0x57a6('0x10')]);_0x16f350[_0x57a6('0x43')]=_0x251952[_0x57a6('0x10')][_0x57a6('0x13')];_0x16f350[_0x57a6('0x44')]=_0x251952[_0x57a6('0x10')][_0x57a6('0x45')];logger[_0x57a6('0x14')]('['+[_0x13077d[_0x57a6('0x15')]()]+_0x57a6('0x46'),_0x16f350);_0x57b5f9(_0x16f350);})[_0x57a6('0x17')](function(_0x4d841e){logger[_0x57a6('0x18')]('['+[_0x13077d[_0x57a6('0x15')]()]+']',_0x4d841e[_0x57a6('0x19')]);_0x5e1aa0(_0x4d841e[_0x57a6('0x19')]);});});};}function createRemoteTag(_0x1fe12a,_0x24d7b8,_0x221acd,_0x593938){return new Promise(function(_0x3e196f,_0x5b1527){var _0x287e01={'method':'POST','uri':_0x221acd+_0x57a6('0x47')+'?'+_0x593938,'body':{'short_description':_0x1fe12a,'global':!![],'active':!![],'name':_0x1fe12a},'auth':_0x24d7b8,'json':!![]};return rp(_0x287e01)[_0x57a6('0x1d')](function(_0x2b4169){var _0x359f6e=_0x2b4169[_0x57a6('0x10')][_0x57a6('0x13')];_0x3e196f(_0x359f6e);});});}function getRemoteTag(_0x38a29e,_0x3d6b6f,_0x4c3d26,_0x3a30d1,_0x3b50ca){return new Promise(function(_0xad4cb3,_0xb52279){var _0x35157a={'method':_0x57a6('0xe'),'uri':_0x4c3d26+_0x57a6('0x47')+_0x57a6('0x48')+_0x38a29e+'&'+_0x3a30d1,'auth':_0x3d6b6f,'json':!![]};return rp(_0x35157a)[_0x57a6('0x1d')](function(_0x479d9a){if(_0x479d9a[_0x57a6('0x10')]['length']>0x0){var _0x3937d0=_0x479d9a[_0x57a6('0x10')][0x0]['sys_id'];_0xad4cb3(_0x3937d0);}else{return createRemoteTag(_0x38a29e,_0x3d6b6f,_0x4c3d26,_0x3a30d1)['then'](function(_0x1623bf){_0xad4cb3(_0x1623bf);});}});});}function assignTagToIncident(_0x360c51,_0x5dac38,_0x44e479,_0x2824c0,_0x35afb8){return new Promise(function(_0x77696,_0x461c3b){var _0x5b200c={'method':'POST','uri':_0x44e479+_0x57a6('0x49')+'?'+_0x35afb8,'body':{'label':_0x360c51,'table':_0x57a6('0x3d'),'id_type':_0x57a6('0x4a'),'table_key':_0x2824c0[_0x57a6('0x43')],'title':'Incident\x20-\x20'+_0x2824c0[_0x57a6('0x44')],'id_display':_0x2824c0[_0x57a6('0x44')]},'auth':_0x5dac38,'json':!![]};return rp(_0x5b200c)[_0x57a6('0x1d')](function(_0x286191){_0x77696();})['catch'](function(){_0x77696();});});}function manageTags(_0x5dcff9,_0x27279d,_0x411916,_0xf7df25,_0xb6aadf,_0x55e5a3,_0x4f54a5){return new Promise(function(_0x58c1fb,_0x298b9b){var _0x17769a=[];_0x27279d[_0x57a6('0x2d')](function(_0x355eb3){_0x17769a[_0x57a6('0x4b')](getRemoteTag(_0x355eb3,_0x411916,_0xf7df25,_0x55e5a3,_0x4f54a5));});return Promise[_0x57a6('0x4c')](_0x17769a)[_0x57a6('0x1d')](function(_0x55c27c){if(_0x55c27c['length']){logger[_0x57a6('0x14')]('['+[_0x5dcff9['toUpperCase']()]+_0x57a6('0x4d'),_0x55c27c);var _0xc24d8c=[];_0x55c27c[_0x57a6('0x2d')](function(_0x2202fc){_0xc24d8c[_0x57a6('0x4b')](assignTagToIncident(_0x2202fc,_0x411916,_0xf7df25,_0xb6aadf,_0x55e5a3));});return Promise[_0x57a6('0x4c')](_0xc24d8c)['then'](function(){_0x58c1fb();})[_0x57a6('0x17')](function(){_0x58c1fb();});}else{_0x58c1fb();}});});}function getTags(_0xe44a31,_0x51033c,_0x5f4c29,_0x173955,_0x516e94,_0x41f0d5){return function(_0xd3111b){return new Promise(function(_0x50edf1,_0x29cf4c){var _0x3b6adc=[];var _0xdd86bb=_0x173955[_0x57a6('0x4e')];if(_0xdd86bb&&_0xdd86bb['length']>0x0){_0x3b6adc=_['map'](_0xdd86bb,_0x57a6('0x3b'));}if(_0x3b6adc[_0x57a6('0x11')]>0x0){return manageTags(_0xe44a31,_0x3b6adc,_0x51033c,_0x5f4c29,_0xd3111b,_0x516e94,_0x41f0d5)[_0x57a6('0x1d')](function(){_0x50edf1(_0xd3111b);});}else{_0x50edf1(_0xd3111b);}});};}function emit(_0x5c4cf5,_0x42dcf2,_0xf0009d){var _0x4718a1=_0x57a6('0x4f')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x57a6('0x50')+_0x57a6('0x51');var _0x5bd45a={'uri':_0x5c4cf5+_0x57a6('0x52')+_0xf0009d+_0x4718a1};io['to'](util['format'](_0x57a6('0x53'),_0x42dcf2))['emit']('trigger:browser:url',_0x5bd45a);}exports['cs']=function(_0x30c3a7,_0x5dfe93,_0x3ac365,_0x23f9dc,_0x353385,_0x347e22,_0x11136f,_0x48c5fa){var _0x27070a={};var _0x35004f={'user':_0x347e22[_0x57a6('0x54')],'pass':_0x347e22[_0x57a6('0x55')]};var _0x4ff601='sysparm_limit=1';var _0x2e133e=_0x57a6('0x56');_0x347e22[_0x57a6('0x57')]=intUtil[_0x57a6('0x58')](_0x347e22['remoteUri']);_0x347e22[_0x57a6('0x59')]=intUtil[_0x57a6('0x58')](_0x347e22[_0x57a6('0x59')]);var _0x219823=util[_0x57a6('0x5a')](_0x57a6('0x5b'),_0x347e22['remoteUri']);_0x27070a[_0x57a6('0x1b')]=!_[_0x57a6('0x5c')](_0x23f9dc)?_0x23f9dc[_0x57a6('0x5d')]:null;_0x27070a['adminEmail']=_0x347e22['email'];_0x27070a[_0x57a6('0x27')]=_0x48c5fa[_0x57a6('0x32')]()===_0x57a6('0x3c')?_0x5dfe93[_0x57a6('0x5e')]:_0x5dfe93['calleridnum'];_0x27070a[_0x57a6('0x5f')]=_0x48c5fa===_0x57a6('0x60')||_0x48c5fa==='unmanaged'?'queue':'outbound';var _0xaac158=util['format'](_0x57a6('0x61'),_0x347e22[_0x57a6('0x59')],_0x5dfe93['uniqueid'],md5(_0x5dfe93[_0x57a6('0x62')]));if(_0x353385&&_0x353385[_0x57a6('0x63')]){logger['info'](_0x57a6('0x64'),_0x57a6('0x65'));_0x5dfe93[_0x57a6('0x66')]=_0xaac158;}else if(_0x11136f&&_0x11136f[_0x57a6('0x67')]&&_0x11136f['recordingFormat']!=='none'){logger['info'](_0x57a6('0x68'),_0x57a6('0x65'));_0x5dfe93[_0x57a6('0x66')]=_0xaac158;}else{_0x5dfe93[_0x57a6('0x66')]='';}return getAdminUser(_0x48c5fa,_0x35004f,_0x27070a,_0x219823,_0x2e133e,_0x4ff601)[_0x57a6('0x1d')](getUser(_0x48c5fa,_0x35004f,_0x219823,_0x2e133e,_0x4ff601))[_0x57a6('0x1d')](getEndUser(_0x48c5fa,_0x35004f,_0x219823,_0x2e133e,_0x4ff601))[_0x57a6('0x1d')](getTicket(_0x48c5fa,_0x35004f,_0x219823,_0x3ac365,_0x5dfe93,_0x2e133e))[_0x57a6('0x1d')](function(_0x51ec25){logger[_0x57a6('0x14')](util[_0x57a6('0x5a')]('The\x20ticket\x20ID\x20is:\x20%s',_0x51ec25[_0x57a6('0x43')]));logger['info'](util[_0x57a6('0x5a')](_0x57a6('0x69'),_0x48c5fa));if(_0x48c5fa!==_0x57a6('0x6a')){logger[_0x57a6('0x14')]('['+[_0x48c5fa[_0x57a6('0x15')]()]+']',_0x57a6('0x6b'));emit(_0x347e22['remoteUri'],_0x23f9dc[_0x57a6('0x3b')],_0x51ec25[_0x57a6('0x43')]);}})[_0x57a6('0x17')](function(_0x2c163d){logger[_0x57a6('0x18')]('['+[_0x48c5fa[_0x57a6('0x15')]()]+_0x57a6('0x6c'),util[_0x57a6('0x6d')](_0x2c163d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5da3=[']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','md5','ioredis','./util','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','info','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','],\x20getUser\x20entity','active','true','userId','sys_id','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','user','endUserNumber','System','],\x20EndUser\x20schema','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','includes','string','type','customField','nameField','toLowerCase','content','toString','picklist','idField','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','endUserId','POST','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','ticketNumber','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','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','remoteUri','serverUrl','stripTrailingSlash','format','%s/api/now/table/','isNil','email','outbound','destcalleridnum','calleridnum','callDirection','queue','unmanaged','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0x5da3,0xe2));var _0x35da=function(_0x34ba14,_0x3db2af){_0x34ba14=_0x34ba14-0x0;var _0x288a36=_0x5da3[_0x34ba14];return _0x288a36;};'use strict';var _=require(_0x35da('0x0'));var Promise=require(_0x35da('0x1'));var rp=require('request-promise');var util=require('util');var md5=require(_0x35da('0x2'));var Redis=require(_0x35da('0x3'));var intUtil=require(_0x35da('0x4'));var config=require(_0x35da('0x5'));var logger=require('../../../../config/logger')(_0x35da('0x6'));config[_0x35da('0x7')]=_[_0x35da('0x8')](config[_0x35da('0x7')],{'host':_0x35da('0x9'),'port':0x18eb});var io=require(_0x35da('0xa'))(new Redis(config[_0x35da('0x7')]));function getAdminUser(_0x54ab90,_0x13642c,_0x1e8fb0,_0x4dab56,_0x2ede96,_0x4bfe34){return new Promise(function(_0x244894,_0x3bd6e6){var _0x505c7e={'method':_0x35da('0xb'),'uri':_0x4dab56+_0x35da('0xc')+'&'+_0x2ede96+'&'+_0x4bfe34,'auth':_0x13642c,'json':!![]};return rp(_0x505c7e)[_0x35da('0xd')](function(_0x508c07){if(_0x508c07['result'][_0x35da('0xe')]>0x0){_0x1e8fb0[_0x35da('0xf')]=_0x508c07[_0x35da('0x10')][0x0]['sys_id'];}logger[_0x35da('0x11')]('['+[_0x54ab90['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x1e8fb0);_0x244894(_0x1e8fb0);})['catch'](function(_0x58a3f2){logger[_0x35da('0x12')]('['+[_0x54ab90[_0x35da('0x13')]()]+']',_0x58a3f2[_0x35da('0x14')]);_0x3bd6e6(_0x58a3f2[_0x35da('0x14')]);});});}function getUser(_0x3a0fec,_0x4559bd,_0x626af6,_0x5cdb58,_0x16c689){return function(_0x5a0259){logger[_0x35da('0x11')]('['+[_0x3a0fec['toUpperCase']()]+_0x35da('0x15'),_0x5a0259);return new Promise(function(_0x57a7df,_0x508927){if(intUtil[_0x35da('0x16')](_0x5a0259[_0x35da('0x17')])){var _0x1b579d={'method':_0x35da('0xb'),'uri':_0x626af6+'sys_user?sysparm_query=email%3D'+_0x5a0259[_0x35da('0x17')]+'&'+_0x5cdb58+'&'+_0x16c689,'auth':_0x4559bd,'json':!![]};logger[_0x35da('0x11')]('['+[_0x3a0fec[_0x35da('0x13')]()]+'],\x20getUser\x20rp\x20obj',_0x1b579d);return rp(_0x1b579d)['then'](function(_0x2a2a6f){logger[_0x35da('0x11')]('['+[_0x3a0fec['toUpperCase']()]+_0x35da('0x18'),_0x2a2a6f);if(_0x2a2a6f[_0x35da('0x10')][_0x35da('0xe')]>0x0&&String(_0x2a2a6f[_0x35da('0x10')][0x0][_0x35da('0x19')])===_0x35da('0x1a')){_0x5a0259[_0x35da('0x1b')]=_0x2a2a6f[_0x35da('0x10')][0x0][_0x35da('0x1c')];}else{_0x5a0259[_0x35da('0x1b')]=_0x5a0259[_0x35da('0xf')];_0x5a0259[_0x35da('0x17')]=_0x5a0259[_0x35da('0x1d')];}logger[_0x35da('0x11')]('['+[_0x3a0fec[_0x35da('0x13')]()]+_0x35da('0x1e'),_0x5a0259);_0x57a7df(_0x5a0259);})[_0x35da('0x1f')](function(_0x354cf7){logger[_0x35da('0x12')]('['+[_0x3a0fec[_0x35da('0x13')]()]+']',_0x354cf7[_0x35da('0x14')]);_0x508927(_0x354cf7[_0x35da('0x14')]);});}else{logger[_0x35da('0x11')]('['+[_0x3a0fec[_0x35da('0x13')]()]+']\x20using\x20admin\x20profile');_0x5a0259['userId']=_0x5a0259[_0x35da('0xf')];_0x5a0259[_0x35da('0x17')]=_0x5a0259['adminEmail'];_0x57a7df(_0x5a0259);}});};}function createEndUser(_0x3535db,_0x3af924,_0x443978,_0x571457,_0x24cbad){logger[_0x35da('0x11')]('['+[_0x3535db[_0x35da('0x13')]()]+_0x35da('0x20'),_0x443978);return new Promise(function(_0x3830b8,_0x570065){var _0x24c624={'method':'POST','uri':_0x571457+'sys_user?'+_0x24cbad,'body':{'user_name':_0x443978['endUserNumber'],'roles':_0x35da('0x21'),'first_name':_0x443978[_0x35da('0x22')],'active':'true','date_format':_0x35da('0x23'),'phone':_0x443978['endUserNumber']},'auth':_0x3af924,'json':!![]};return rp(_0x24c624)[_0x35da('0xd')](function(_0xf47eb3){logger[_0x35da('0x11')]('['+[_0x3535db[_0x35da('0x13')]()]+_0x35da('0x24'),_0xf47eb3[_0x35da('0x10')]);_0x443978['endUserId']=_0xf47eb3[_0x35da('0x10')][_0x35da('0x1c')];_0x3830b8(_0x443978);})['catch'](function(_0x4d5d26){logger[_0x35da('0x12')]('['+[_0x3535db['toUpperCase']()]+']',_0x4d5d26[_0x35da('0x14')]);_0x570065(_0x4d5d26['message']);});});}function getEndUser(_0x2f1351,_0x46fea4,_0x10c718,_0x33d43e,_0x196d22){return function(_0x3f4789){logger[_0x35da('0x11')]('['+[_0x2f1351['toUpperCase']()]+_0x35da('0x25'),_0x3f4789);return new Promise(function(_0x151f89,_0x36fa2e){var _0x4a7723={'method':_0x35da('0xb'),'uri':_0x10c718+_0x35da('0x26')+_0x3f4789['endUserNumber']+'&'+_0x33d43e+'&'+_0x196d22,'auth':_0x46fea4,'json':!![]};return rp(_0x4a7723)[_0x35da('0xd')](function(_0x194cb6){if(_0x194cb6[_0x35da('0x10')][_0x35da('0xe')]>0x0){_0x3f4789['endUserId']=_0x194cb6[_0x35da('0x10')][0x0]['sys_id'];logger['info']('['+[_0x2f1351['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x3f4789);_0x151f89(_0x3f4789);}else{return createEndUser(_0x2f1351,_0x46fea4,_0x3f4789,_0x10c718,_0x33d43e)[_0x35da('0xd')](function(_0x408eae){logger[_0x35da('0x11')]('['+[_0x2f1351[_0x35da('0x13')]()]+_0x35da('0x27'),_0x408eae);_0x151f89(_0x408eae);});}})[_0x35da('0x1f')](function(_0x65ded6){logger[_0x35da('0x12')]('['+[_0x2f1351[_0x35da('0x13')]()]+']',_0x65ded6['message']);_0x36fa2e(_0x65ded6[_0x35da('0x14')]);});});};}function getCustomFields(_0xf88449,_0x3e4154){var _0xadd992={};if(_0xf88449[_0x35da('0xe')]>0x0){_[_0x35da('0x28')](_0xf88449,function(_0x200e8f){if(_[_0x35da('0x29')]([_0x35da('0x2a'),'picklist'],_0x200e8f[_0x35da('0x2b')])&&_0x200e8f['nameField']&&!_0x200e8f[_0x35da('0x2c')]){_0xadd992[_0x200e8f[_0x35da('0x2d')][_0x35da('0x2e')]()]=_0x200e8f[_0x35da('0x2f')][_0x35da('0x30')]();}else if(_[_0x35da('0x29')]([_0x35da('0x2a'),_0x35da('0x31')],_0x200e8f[_0x35da('0x2b')])&&_0x200e8f[_0x35da('0x32')]&&_0x200e8f[_0x35da('0x2c')]){_0xadd992[_0x200e8f[_0x35da('0x32')][_0x35da('0x2e')]()]=_0x200e8f[_0x35da('0x2f')][_0x35da('0x30')]();}else if(_0x200e8f[_0x35da('0x2b')]===_0x35da('0x33')&&_0x200e8f['variableName']&&_0x200e8f['idField']&&_0x200e8f[_0x35da('0x2c')]){_0xadd992[_0x200e8f[_0x35da('0x32')][_0x35da('0x2e')]()]=_0x3e4154[_0x200e8f[_0x35da('0x34')]][_0x35da('0x30')]();}else if(_0x200e8f[_0x35da('0x2b')]===_0x35da('0x35')&&_0x200e8f[_0x35da('0x36')]&&_0x200e8f[_0x35da('0x36')]['name']&&_0x200e8f[_0x35da('0x32')]&&_0x200e8f[_0x35da('0x2c')]){_0xadd992[_0x200e8f[_0x35da('0x32')][_0x35da('0x2e')]()]=_0x3e4154[_0x200e8f[_0x35da('0x36')][_0x35da('0x37')][_0x35da('0x2e')]()][_0x35da('0x30')]();}});}return _0xadd992;}function getTicket(_0x3940ee,_0x4161d7,_0x570af0,_0x269cde,_0xfc8b72,_0x17a60b){return function(_0x1e74be){logger[_0x35da('0x11')]('['+[_0x3940ee[_0x35da('0x13')]()]+_0x35da('0x38'),_0x1e74be);return new Promise(function(_0xae0b73,_0x1b8006){var _0x179843=_0x3940ee[_0x35da('0x2e')]()==='outbound'?_0x1e74be[_0x35da('0x1b')]:_0x1e74be[_0x35da('0x39')];var _0x56fcb2={'method':_0x35da('0x3a'),'uri':_0x570af0+'incident'+'?'+_0x17a60b,'body':Object[_0x35da('0x3b')]({},{'active':_0x35da('0x1a'),'caller_id':_0x179843,'assigned_to':_0x1e74be[_0x35da('0x1b')],'short_description':intUtil[_0x35da('0x3c')](_0x269cde[_0x35da('0x3d')],_0xfc8b72,'\x20'),'description':intUtil[_0x35da('0x3c')](_0x269cde[_0x35da('0x3e')],_0xfc8b72,'\x0a')},getCustomFields(_0x269cde[_0x35da('0x3f')],_0xfc8b72)),'auth':_0x4161d7,'json':!![]};return rp(_0x56fcb2)[_0x35da('0xd')](function(_0x381c80){logger['info']('['+[_0x3940ee[_0x35da('0x13')]()]+_0x35da('0x40'),_0x381c80[_0x35da('0x10')]);_0x1e74be[_0x35da('0x41')]=_0x381c80[_0x35da('0x10')][_0x35da('0x1c')];_0x1e74be['ticketNumber']=_0x381c80[_0x35da('0x10')][_0x35da('0x42')];logger['info']('['+[_0x3940ee['toUpperCase']()]+_0x35da('0x43'),_0x1e74be);_0xae0b73(_0x1e74be);})[_0x35da('0x1f')](function(_0x47825b){logger[_0x35da('0x12')]('['+[_0x3940ee['toUpperCase']()]+']',_0x47825b['message']);_0x1b8006(_0x47825b[_0x35da('0x14')]);});});};}function createRemoteTag(_0x5c2951,_0x3c677e,_0x56f421,_0x28d971){return new Promise(function(_0x151164,_0x5d9919){var _0x36e2b8={'method':_0x35da('0x3a'),'uri':_0x56f421+_0x35da('0x44')+'?'+_0x28d971,'body':{'short_description':_0x5c2951,'global':!![],'active':!![],'name':_0x5c2951},'auth':_0x3c677e,'json':!![]};return rp(_0x36e2b8)[_0x35da('0xd')](function(_0x3929a8){var _0x38a137=_0x3929a8['result']['sys_id'];_0x151164(_0x38a137);});});}function getRemoteTag(_0x2e8ed9,_0xd79404,_0x321a49,_0x29fdb4,_0x5c19b6){return new Promise(function(_0x4c5305,_0x4282ae){var _0x5bc5b4={'method':_0x35da('0xb'),'uri':_0x321a49+_0x35da('0x44')+_0x35da('0x45')+_0x2e8ed9+'&'+_0x29fdb4,'auth':_0xd79404,'json':!![]};return rp(_0x5bc5b4)[_0x35da('0xd')](function(_0x5e5971){if(_0x5e5971[_0x35da('0x10')][_0x35da('0xe')]>0x0){var _0xbed8c7=_0x5e5971[_0x35da('0x10')][0x0][_0x35da('0x1c')];_0x4c5305(_0xbed8c7);}else{return createRemoteTag(_0x2e8ed9,_0xd79404,_0x321a49,_0x29fdb4)[_0x35da('0xd')](function(_0xa0a576){_0x4c5305(_0xa0a576);});}});});}function assignTagToIncident(_0x3d6530,_0x717a6b,_0x22b30c,_0x293517,_0x227925){return new Promise(function(_0x49946d,_0x3506fe){var _0xeb1f1f={'method':_0x35da('0x3a'),'uri':_0x22b30c+_0x35da('0x46')+'?'+_0x227925,'body':{'label':_0x3d6530,'table':_0x35da('0x47'),'id_type':_0x35da('0x48'),'table_key':_0x293517[_0x35da('0x41')],'title':'Incident\x20-\x20'+_0x293517['ticketNumber'],'id_display':_0x293517[_0x35da('0x49')]},'auth':_0x717a6b,'json':!![]};return rp(_0xeb1f1f)[_0x35da('0xd')](function(_0x1b30fe){_0x49946d();})[_0x35da('0x1f')](function(){_0x49946d();});});}function manageTags(_0x1e3f3f,_0x350af8,_0x4c4975,_0x2cf6ea,_0x14303a,_0x44776c,_0x86b685){return new Promise(function(_0x282acd,_0x1e6ba1){var _0xf68e53=[];_0x350af8[_0x35da('0x28')](function(_0x141089){_0xf68e53[_0x35da('0x4a')](getRemoteTag(_0x141089,_0x4c4975,_0x2cf6ea,_0x44776c,_0x86b685));});return Promise[_0x35da('0x4b')](_0xf68e53)[_0x35da('0xd')](function(_0x1c86ca){if(_0x1c86ca[_0x35da('0xe')]){logger[_0x35da('0x11')]('['+[_0x1e3f3f[_0x35da('0x13')]()]+_0x35da('0x4c'),_0x1c86ca);var _0x4a3ff4=[];_0x1c86ca['forEach'](function(_0x3f8768){_0x4a3ff4[_0x35da('0x4a')](assignTagToIncident(_0x3f8768,_0x4c4975,_0x2cf6ea,_0x14303a,_0x44776c));});return Promise[_0x35da('0x4b')](_0x4a3ff4)['then'](function(){_0x282acd();})[_0x35da('0x1f')](function(){_0x282acd();});}else{_0x282acd();}});});}function getTags(_0x2946,_0x42bda3,_0x3b64be,_0x135332,_0x3da947,_0x7fc014){return function(_0x58a1a4){return new Promise(function(_0x4c3289,_0x3ed4eb){var _0x44e2f6=[];var _0x234d61=_0x135332[_0x35da('0x4d')];if(_0x234d61&&_0x234d61[_0x35da('0xe')]>0x0){_0x44e2f6=_[_0x35da('0x4e')](_0x234d61,_0x35da('0x37'));}if(_0x44e2f6[_0x35da('0xe')]>0x0){return manageTags(_0x2946,_0x44e2f6,_0x42bda3,_0x3b64be,_0x58a1a4,_0x3da947,_0x7fc014)[_0x35da('0xd')](function(){_0x4c3289(_0x58a1a4);});}else{_0x4c3289(_0x58a1a4);}});};}function emit(_0x358d70,_0x8c329a,_0x500c7f){var _0x5ad43b=_0x35da('0x4f')+_0x35da('0x50')+_0x35da('0x51')+_0x35da('0x52');var _0x1ff2bb={'uri':_0x358d70+_0x35da('0x53')+_0x500c7f+_0x5ad43b};io['to'](util['format'](_0x35da('0x54'),_0x8c329a))[_0x35da('0x55')](_0x35da('0x56'),_0x1ff2bb);}exports['cs']=function(_0x37a14e,_0x27767a,_0x58f3a7,_0x3fede3,_0x947de6,_0x56ea98,_0x1fad0b,_0x30f2c2){var _0x23d99c={};var _0x1f3e2a={'user':_0x56ea98[_0x35da('0x57')],'pass':_0x56ea98[_0x35da('0x58')]};var _0x519ebd=_0x35da('0x59');var _0x2ff34d='sysparm_display_value=true';_0x56ea98[_0x35da('0x5a')]=intUtil['stripTrailingSlash'](_0x56ea98['remoteUri']);_0x56ea98[_0x35da('0x5b')]=intUtil[_0x35da('0x5c')](_0x56ea98[_0x35da('0x5b')]);var _0x3eaa0b=util[_0x35da('0x5d')](_0x35da('0x5e'),_0x56ea98[_0x35da('0x5a')]);_0x23d99c['userEmail']=!_[_0x35da('0x5f')](_0x3fede3)?_0x3fede3['email']:null;_0x23d99c[_0x35da('0x1d')]=_0x56ea98[_0x35da('0x60')];_0x23d99c[_0x35da('0x22')]=_0x30f2c2[_0x35da('0x2e')]()===_0x35da('0x61')?_0x27767a[_0x35da('0x62')]:_0x27767a[_0x35da('0x63')];_0x23d99c[_0x35da('0x64')]=_0x30f2c2===_0x35da('0x65')||_0x30f2c2===_0x35da('0x66')?'queue':'outbound';var _0x42ed9d=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x56ea98[_0x35da('0x5b')],_0x27767a[_0x35da('0x67')],md5(_0x27767a[_0x35da('0x67')]));if(_0x947de6&&_0x947de6['monitor_format']){logger[_0x35da('0x11')](_0x35da('0x68'),_0x35da('0x69'));_0x27767a['recordingURL']=_0x42ed9d;}else if(_0x1fad0b&&_0x1fad0b[_0x35da('0x6a')]&&_0x1fad0b[_0x35da('0x6a')]!=='none'){logger['info']('[OUTBOUND]',_0x35da('0x69'));_0x27767a['recordingURL']=_0x42ed9d;}else{_0x27767a[_0x35da('0x6b')]='';}return getAdminUser(_0x30f2c2,_0x1f3e2a,_0x23d99c,_0x3eaa0b,_0x2ff34d,_0x519ebd)[_0x35da('0xd')](getUser(_0x30f2c2,_0x1f3e2a,_0x3eaa0b,_0x2ff34d,_0x519ebd))[_0x35da('0xd')](getEndUser(_0x30f2c2,_0x1f3e2a,_0x3eaa0b,_0x2ff34d,_0x519ebd))[_0x35da('0xd')](getTicket(_0x30f2c2,_0x1f3e2a,_0x3eaa0b,_0x58f3a7,_0x27767a,_0x2ff34d))[_0x35da('0xd')](function(_0x4cd963){logger[_0x35da('0x11')](util[_0x35da('0x5d')](_0x35da('0x6c'),_0x4cd963[_0x35da('0x41')]));logger[_0x35da('0x11')](util[_0x35da('0x5d')]('call\x20direction:\x20%s',_0x30f2c2));if(_0x30f2c2!==_0x35da('0x66')){logger[_0x35da('0x11')]('['+[_0x30f2c2[_0x35da('0x13')]()]+']',_0x35da('0x6d'));emit(_0x56ea98[_0x35da('0x5a')],_0x3fede3[_0x35da('0x37')],_0x4cd963[_0x35da('0x41')]);}})[_0x35da('0x1f')](function(_0xa0e4be){logger[_0x35da('0x12')]('['+[_0x30f2c2[_0x35da('0x13')]()]+_0x35da('0x6e'),util[_0x35da('0x6f')](_0xa0e4be,{'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 2d5fc75..b5a4c13 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 _0x1366=['uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error','outbound','recordingFormat','none','destcalleridnum','The\x20Enduser\x20ID\x20is:','Outbound','contacts','version','user:%s','lastevent','toUpperCase','isNil','Ticket\x20created!','bluebird','md5','ioredis','../../../../config/environment','sugarcrm','defaults','localhost','redis','emit','info','Creating\x20new\x20ticket...','name','Subjects','description','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','forEach','push','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','length','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','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','debug','[HTTP]','merge','map','string','nameField','toLowerCase','content','toString','type','idField','customField','variable','custom_fields','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl'];(function(_0x4575ce,_0x465644){var _0x27bbf9=function(_0x475448){while(--_0x475448){_0x4575ce['push'](_0x4575ce['shift']());}};_0x27bbf9(++_0x465644);}(_0x1366,0x1f3));var _0x6136=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1366[_0x59ee6f];return _0x4c0979;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x6136('0x0'));var md5=require(_0x6136('0x1'));var util=require('util');var Redis=require(_0x6136('0x2'));var intUtil=require('./util');var config=require(_0x6136('0x3'));var logger=require('../../../../config/logger')(_0x6136('0x4'));config['redis']=_[_0x6136('0x5')](config['redis'],{'host':_0x6136('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6136('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x58b932,_0x46e0e7,_0x39e062){io['to'](_0x58b932)[_0x6136('0x8')](_0x46e0e7,_0x39e062);}function getTicket(_0x472573,_0x9f6adf,_0xb5997c,_0x3ed925,_0x176d5b,_0x1216a9,_0x19adf1,_0x155533){logger[_0x6136('0x9')](_0x6136('0xa'));var _0x3164c0=new Date();var _0x53134b=[{'name':_0x6136('0xb'),'value':intUtil['getString'](_0x3ed925[_0x6136('0xc')],_0x176d5b,'\x20')},{'name':'assigned_user_id','value':_0x9f6adf['id']},{'name':'created_by','value':_0x9f6adf['id']},{'name':_0x6136('0xd'),'value':intUtil['getString'](_0x3ed925[_0x6136('0xe')],_0x176d5b,'\x0a')},{'name':_0x6136('0xf'),'value':_0x3164c0[_0x6136('0x10')]()[_0x6136('0x11')](0x0,0x13)['replace']('T','\x20')},{'name':_0x6136('0x12'),'value':'0'},{'name':_0x6136('0x13'),'value':'15'},{'name':_0x6136('0x14'),'value':_0xb5997c['id']},{'name':_0x6136('0x15'),'value':_0x6136('0x16')},{'name':_0x6136('0x17'),'value':_0xb5997c['name']},{'name':_0x6136('0x18'),'value':_0x155533}];if(_0x1216a9['length']){_[_0x6136('0x19')](_0x1216a9,function(_0x3e0e4e){if(_0x176d5b[_0x3e0e4e['variableName']]){_0x53134b[_0x6136('0x1a')]({'name':_0x3e0e4e['idField'],'value':_0x176d5b[_0x3e0e4e[_0x6136('0x1b')]]});}});}return request({'form':{'method':_0x6136('0x1c'),'input_type':_0x6136('0x1d'),'response_type':_0x6136('0x1d'),'rest_data':JSON[_0x6136('0x1e')]({'session':_0x19adf1['id'],'module_name':_0x6136('0x1f'),'name_value_list':_0x53134b})}});}function getAuth(_0x119583){return util[_0x6136('0x20')](_0x6136('0x21'),new Buffer(_0x119583['apiKey']+':X')['toString']('base64'));}function getServerInfo(_0x1c687c){return request({'form':{'method':'get_server_info','input_type':_0x6136('0x1d'),'response_type':_0x6136('0x1d'),'rest_data':JSON[_0x6136('0x1e')]({'session':_0x1c687c['id']})}});}function getUser(_0x202e9e,_0x29cc1d,_0x302b71){if(!_['isNil'](_0x29cc1d)){logger['info'](_0x6136('0x22'),_0x29cc1d);return request({'form':{'method':_0x6136('0x23'),'input_type':_0x6136('0x1d'),'response_type':'JSON','rest_data':JSON[_0x6136('0x1e')]({'session':_0x302b71['id'],'module_name':'Employees','query':util[_0x6136('0x20')](_0x6136('0x24'),_0x29cc1d),'order_by':'','offset':'0','select_fields':['id',_0x6136('0xb'),_0x6136('0x25')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6136('0x26')](function(_0x448792){if(_0x448792[_0x6136('0x27')][_0x6136('0x28')]){var _0x2297e3=_['find'](_0x448792[_0x6136('0x27')],function(_0x3c2339){return _0x3c2339[_0x6136('0x29')][_0x6136('0x25')][_0x6136('0x2a')]===_0x29cc1d;});if(_0x2297e3){logger[_0x6136('0x9')](_0x6136('0x2b'));return BPromise[_0x6136('0x2c')]({'id':_0x2297e3[_0x6136('0x29')]['id'][_0x6136('0x2a')],'name':_0x2297e3[_0x6136('0x29')][_0x6136('0xb')]['value']});}}logger[_0x6136('0x9')](_0x6136('0x2d'));return BPromise[_0x6136('0x2c')]({'id':_0x302b71[_0x6136('0x29')][_0x6136('0x2e')][_0x6136('0x2a')],'name':_0x302b71['name_value_list']['user_name'][_0x6136('0x2a')]});});}else{logger[_0x6136('0x9')](_0x6136('0x2f'));return BPromise[_0x6136('0x2c')]({'id':_0x302b71[_0x6136('0x29')][_0x6136('0x2e')][_0x6136('0x2a')],'name':_0x302b71['name_value_list'][_0x6136('0x25')][_0x6136('0x2a')]});}}function getEndUser(_0x4cd8ab,_0x404c6f,_0x3518a4,_0x997925){logger[_0x6136('0x9')](_0x6136('0x30'),_0x3518a4);return request({'form':{'method':'get_entry_list','input_type':_0x6136('0x1d'),'response_type':_0x6136('0x1d'),'rest_data':JSON[_0x6136('0x1e')]({'session':_0x997925['id'],'module_name':'Contacts','query':util[_0x6136('0x20')](_0x6136('0x31'),_0x3518a4),'order_by':'','offset':'0','select_fields':['id',_0x6136('0xb'),_0x6136('0x32')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x288ce7){if(_0x288ce7[_0x6136('0x27')]['length']){var _0x49c027=_[_0x6136('0x33')](_0x288ce7[_0x6136('0x27')],function(_0x10b7bd){return _0x10b7bd[_0x6136('0x29')][_0x6136('0x32')][_0x6136('0x2a')]===_0x3518a4;});if(_0x49c027){logger['info'](_0x6136('0x34'));return BPromise['resolve']({'id':_0x49c027['name_value_list']['id'][_0x6136('0x2a')],'name':_0x49c027[_0x6136('0x29')][_0x6136('0xb')]['value'],'phone':_0x49c027[_0x6136('0x29')][_0x6136('0x32')]['value']});}}else{logger['info'](_0x6136('0x35'));return request({'form':{'method':_0x6136('0x1c'),'input_type':_0x6136('0x1d'),'response_type':_0x6136('0x1d'),'rest_data':JSON[_0x6136('0x1e')]({'session':_0x997925['id'],'module_name':_0x6136('0x16'),'name_value_list':[{'name':'first_name','value':_0x404c6f!==''?_0x404c6f:util['format']('Caller\x20-\x20%s',_0x3518a4)},{'name':'phone_home','value':_0x3518a4}]})}})[_0x6136('0x26')](function(_0x66b67f){logger['info']('Enduser\x20created.');return BPromise[_0x6136('0x2c')]({'id':_0x66b67f['id'],'name':_0x66b67f[_0x6136('0x27')]['first_name']['value'],'phone':_0x66b67f[_0x6136('0x27')]['phone_home'][_0x6136('0x2a')]});});}});}function request(_0x402a98){logger[_0x6136('0x36')](_0x6136('0x37'),JSON['stringify'](_0x402a98));return rp(_[_0x6136('0x38')](def,_0x402a98));}function getTags(_0x2b0c38,_0x2d5050){var _0x410bf2=[];if(_0x2b0c38&&_0x2b0c38[_0x6136('0x28')]>0x0){_0x410bf2=_[_0x6136('0x39')](_0x2b0c38,_0x2d5050);}return _0x410bf2;}function getCustomFields(_0x505e3a,_0x5b5e38){var _0x28fcd4=[];var _0x4cb55a={'custom_fields':[]};if(_0x505e3a['length']>0x0){_[_0x6136('0x19')](_0x505e3a,function(_0x1b4fc9){if(_0x1b4fc9['type']===_0x6136('0x3a')&&_0x1b4fc9[_0x6136('0x3b')]&&!_0x1b4fc9['customField']){_0x4cb55a[_0x1b4fc9[_0x6136('0x3b')][_0x6136('0x3c')]()]=_0x1b4fc9[_0x6136('0x3d')][_0x6136('0x3e')]();}else if(_0x1b4fc9[_0x6136('0x3f')]==='string'&&_0x1b4fc9[_0x6136('0x40')]&&_0x1b4fc9[_0x6136('0x41')]){_0x4cb55a['custom_fields'][_0x6136('0x1a')]({'id':_0x1b4fc9[_0x6136('0x40')],'value':_0x1b4fc9[_0x6136('0x3d')][_0x6136('0x3e')]()});}else if(_0x1b4fc9[_0x6136('0x3f')]===_0x6136('0x42')&&_0x1b4fc9['variableName']&&_0x1b4fc9[_0x6136('0x40')]&&_0x1b4fc9[_0x6136('0x41')]){_0x5b5e38[_0x1b4fc9['variableName']]&&_0x4cb55a[_0x6136('0x43')][_0x6136('0x1a')]({'id':_0x1b4fc9['idField'],'value':_0x5b5e38[_0x1b4fc9[_0x6136('0x1b')]][_0x6136('0x3e')]()});}else if(_0x1b4fc9[_0x6136('0x3f')]===_0x6136('0x44')&&_0x1b4fc9['Variable']&&_0x1b4fc9['Variable'][_0x6136('0xb')]&&_0x1b4fc9['idField']&&_0x1b4fc9[_0x6136('0x41')]){_0x5b5e38[_0x1b4fc9[_0x6136('0x45')][_0x6136('0xb')]['toLowerCase']()]&&_0x4cb55a[_0x6136('0x43')][_0x6136('0x1a')]({'id':_0x1b4fc9[_0x6136('0x40')],'value':_0x5b5e38[_0x1b4fc9['Variable'][_0x6136('0xb')][_0x6136('0x3c')]()][_0x6136('0x3e')]()});}});}return _0x4cb55a;}function getConnection(_0x51ee12){return request({'method':'POST','form':{'method':_0x6136('0x46'),'input_type':_0x6136('0x1d'),'response_type':_0x6136('0x1d'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x51ee12[_0x6136('0x47')],'password':_0x51ee12[_0x6136('0x48')],'encryption':'PLAIN'},'application':_0x6136('0x49')})}})[_0x6136('0x26')](function(_0x1a1585){var _0x1566ff=_0x1a1585;if(_0x1566ff['id']){def[_0x6136('0x4a')]=_0x1566ff['id'];return BPromise['resolve'](_0x1566ff);}else{throw new Error(util['format'](_0x6136('0x4b'),_0x51ee12['id']));}});}function setRelationship(_0x223632,_0x30deee,_0x157045,_0x9207c0){return request({'form':{'method':_0x6136('0x4c'),'input_type':_0x6136('0x1d'),'response_type':_0x6136('0x1d'),'rest_data':JSON[_0x6136('0x1e')]({'session':_0x223632['id'],'module_name':_0x6136('0x1f'),'module_id':_0x157045['id'],'link_field_name':_0x9207c0,'related_ids':[_0x30deee['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6136('0x4d')]=function(_0x13ca43,_0x3962f8,_0x3f8218,_0x48bb67,_0x63d0ec,_0x28b4f7){var _0x5ebd41,_0x1ae448,_0x582de3,_0x33e872;_0x28b4f7[_0x6136('0x4e')]=intUtil[_0x6136('0x4f')](_0x28b4f7[_0x6136('0x4e')]);_0x28b4f7[_0x6136('0x50')]=intUtil[_0x6136('0x4f')](_0x28b4f7[_0x6136('0x50')]);def[_0x6136('0x51')]=util[_0x6136('0x20')](_0x6136('0x52'),_0x28b4f7[_0x6136('0x4e')]);if(_0x63d0ec&&_0x63d0ec[_0x6136('0x53')]){logger[_0x6136('0x9')]('[QUEUE]',_0x6136('0x54'));_0x3962f8[_0x6136('0x55')]=util[_0x6136('0x20')](_0x6136('0x56'),_0x28b4f7[_0x6136('0x50')],_0x3962f8[_0x6136('0x57')],md5(_0x3962f8[_0x6136('0x57')]));}else{_0x3962f8[_0x6136('0x55')]='';}return getConnection(_0x28b4f7)[_0x6136('0x26')](function(_0x30b646){_0x33e872=_0x30b646;return getUser(_0x28b4f7,_0x48bb67[_0x6136('0xb')],_0x33e872);})['then'](function(_0x486634){_0x5ebd41=_0x486634;logger[_0x6136('0x9')](_0x6136('0x58'),_0x5ebd41['id']);return getEndUser(_0x28b4f7,_0x3962f8[_0x6136('0x59')],_0x3962f8[_0x6136('0x5a')],_0x33e872);})[_0x6136('0x26')](function(_0x50ebbb){_0x1ae448=_0x50ebbb;logger[_0x6136('0x9')]('The\x20Enduser\x20ID\x20is:',_0x1ae448['id']);return getTicket(_0x28b4f7,_0x5ebd41,_0x1ae448,_0x3f8218,_0x3962f8,_0x3f8218[_0x6136('0x5b')],_0x33e872,_0x6136('0x5c'));})['then'](function(_0x1bb1bb){_0x582de3=_0x1bb1bb;logger[_0x6136('0x9')]('Ticket\x20created!');logger['info'](_0x6136('0x5d'),_0x582de3['id']);return setRelationship(_0x33e872,_0x5ebd41,_0x582de3,_0x6136('0x5e'));})[_0x6136('0x26')](function(){return setRelationship(_0x33e872,_0x1ae448,_0x582de3,'contacts');})['then'](function(){return getServerInfo(_0x33e872);})[_0x6136('0x26')](function(_0x55aef1){var _0x271542=parseInt(_0x55aef1['version'][_0x6136('0x5f')](0x0));var _0x8fd7d=util[_0x6136('0x20')](_0x6136('0x60'),_0x28b4f7[_0x6136('0x4e')],_0x582de3['id']);if(_0x271542>0x6){_0x8fd7d=util['format'](_0x6136('0x61'),_0x28b4f7['remoteUri'],_0x582de3['id']);}logger['info'](_0x6136('0x62'),_0x6136('0x63'));emit(util[_0x6136('0x20')]('user:%s',_0x48bb67[_0x6136('0xb')]),_0x6136('0x64'),{'uri':_0x8fd7d});})[_0x6136('0x65')](function(_0x3128f2){logger[_0x6136('0x66')](_0x6136('0x62'),JSON[_0x6136('0x1e')](_0x3128f2));});};exports[_0x6136('0x67')]=function(_0x4612fb,_0x55289c,_0x8e5c47,_0x50e6ee,_0x1b3652,_0x474b92,_0x3300d8){var _0x583986,_0x304f96,_0x2267ec,_0x543507;_0x474b92[_0x6136('0x4e')]=intUtil['stripTrailingSlash'](_0x474b92[_0x6136('0x4e')]);_0x474b92['serverUrl']=intUtil[_0x6136('0x4f')](_0x474b92[_0x6136('0x50')]);def[_0x6136('0x51')]=util[_0x6136('0x20')](_0x6136('0x52'),_0x474b92[_0x6136('0x4e')]);if(_0x3300d8&&_0x3300d8['recordingFormat']&&_0x3300d8[_0x6136('0x68')]!==_0x6136('0x69')){logger['info']('[OUTBOUND]',_0x6136('0x54'));_0x55289c[_0x6136('0x55')]=util['format'](_0x6136('0x56'),_0x474b92[_0x6136('0x50')],_0x55289c[_0x6136('0x57')],md5(_0x55289c['uniqueid']));}return getConnection(_0x474b92)['then'](function(_0x4d007a){_0x543507=_0x4d007a;return getUser(_0x474b92,_0x50e6ee[_0x6136('0xb')],_0x543507);})[_0x6136('0x26')](function(_0x4b5f01){_0x583986=_0x4b5f01;logger[_0x6136('0x9')]('The\x20User\x20ID\x20is:',_0x583986['id']);return getEndUser(_0x474b92,_0x55289c['destcalleridname'],_0x55289c[_0x6136('0x6a')],_0x543507);})[_0x6136('0x26')](function(_0x31a78f){_0x304f96=_0x31a78f;logger[_0x6136('0x9')](_0x6136('0x6b'),_0x304f96['id']);return getTicket(_0x474b92,_0x583986,_0x304f96,_0x8e5c47,_0x55289c,_0x8e5c47['Fields'],_0x543507,_0x6136('0x6c'));})[_0x6136('0x26')](function(_0x25fb2a){_0x2267ec=_0x25fb2a;logger[_0x6136('0x9')]('Ticket\x20created!');logger[_0x6136('0x9')](_0x6136('0x5d'),_0x2267ec['id']);return setRelationship(_0x543507,_0x583986,_0x2267ec,_0x6136('0x5e'));})[_0x6136('0x26')](function(){return setRelationship(_0x543507,_0x304f96,_0x2267ec,_0x6136('0x6d'));})[_0x6136('0x26')](function(){return getServerInfo(_0x543507);})[_0x6136('0x26')](function(_0x4bb8ba){var _0x212868=parseInt(_0x4bb8ba[_0x6136('0x6e')][_0x6136('0x5f')](0x0));var _0x2c7fd9=util[_0x6136('0x20')](_0x6136('0x60'),_0x474b92[_0x6136('0x4e')],_0x2267ec['id']);if(_0x212868>0x6){_0x2c7fd9=util[_0x6136('0x20')](_0x6136('0x61'),_0x474b92[_0x6136('0x4e')],_0x2267ec['id']);}logger[_0x6136('0x9')]('[OUTBOUND]',_0x6136('0x63'));emit(util[_0x6136('0x20')](_0x6136('0x6f'),_0x50e6ee[_0x6136('0xb')]),_0x6136('0x64'),{'uri':_0x2c7fd9});})[_0x6136('0x65')](function(_0x1152d6){logger[_0x6136('0x66')]('[OUTBOUND]',JSON['stringify'](_0x1152d6));});};exports['unmanaged']=function(_0x38c4dc,_0x27d256,_0x4e4dd3,_0xe26183,_0x5dcd8f,_0x47d148){var _0x45ff94,_0x48c7de,_0x4dfa76,_0x58e98f;_0x47d148[_0x6136('0x4e')]=intUtil[_0x6136('0x4f')](_0x47d148[_0x6136('0x4e')]);_0x47d148[_0x6136('0x50')]=intUtil[_0x6136('0x4f')](_0x47d148[_0x6136('0x50')]);def['uri']=util[_0x6136('0x20')](_0x6136('0x52'),_0x47d148[_0x6136('0x4e')]);if(_0x5dcd8f&&_0x5dcd8f[_0x6136('0x53')]){logger['info']('['+_0x27d256[_0x6136('0x70')][_0x6136('0x71')]()+']',_0x6136('0x54'));_0x27d256[_0x6136('0x55')]=util['format'](_0x6136('0x56'),_0x47d148[_0x6136('0x50')],_0x27d256[_0x6136('0x57')],md5(_0x27d256['uniqueid']));}else{_0x27d256[_0x6136('0x55')]='';}return getConnection(_0x47d148)[_0x6136('0x26')](function(_0x45ce76){_0x58e98f=_0x45ce76;if(!_[_0x6136('0x72')](_0xe26183)){return getUser(_0x47d148,_0xe26183['name'],_0x58e98f);}else{return getUser(_0x47d148,null,_0x58e98f);}})[_0x6136('0x26')](function(_0x547c0d){_0x45ff94=_0x547c0d;logger[_0x6136('0x9')](_0x6136('0x58'),_0x45ff94['id']);return getEndUser(_0x47d148,_0x27d256[_0x6136('0x59')],_0x27d256[_0x6136('0x5a')],_0x58e98f);})['then'](function(_0xc3e38e){_0x48c7de=_0xc3e38e;logger['info'](_0x6136('0x6b'),_0x48c7de['id']);return getTicket(_0x47d148,_0x45ff94,_0x48c7de,_0x4e4dd3,_0x27d256,_0x4e4dd3[_0x6136('0x5b')],_0x58e98f,'Inbound');})['then'](function(_0x373b1a){_0x4dfa76=_0x373b1a;logger[_0x6136('0x9')](_0x6136('0x73'));logger['info'](_0x6136('0x5d'),_0x4dfa76['id']);return setRelationship(_0x58e98f,_0x45ff94,_0x4dfa76,_0x6136('0x5e'));})['then'](function(){return setRelationship(_0x58e98f,_0x48c7de,_0x4dfa76,'contacts');})['then'](function(){return getServerInfo(_0x58e98f);})[_0x6136('0x65')](function(_0x30f9bf){logger[_0x6136('0x66')]('['+_0x27d256['lastevent'][_0x6136('0x71')]()+']',JSON[_0x6136('0x1e')](_0x30f9bf));});}; \ No newline at end of file +var _0x1e6b=['apiKey','base64','get_server_info','info','Getting\x20agent\x20with\x20name','Employees','user_name','entry_list','find','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','get_entry_list','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','customField','nameField','toLowerCase','content','string','custom_fields','toString','type','variable','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','unmanaged','lastevent','isNil','Fields','Inbound','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','defaults','localhost','socket.io-emitter','redis','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','description','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','Contacts','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s'];(function(_0x5887d7,_0x424837){var _0x3e2ed2=function(_0x261cac){while(--_0x261cac){_0x5887d7['push'](_0x5887d7['shift']());}};_0x3e2ed2(++_0x424837);}(_0x1e6b,0xd0));var _0xb1e6=function(_0x144595,_0x13a043){_0x144595=_0x144595-0x0;var _0x4c8788=_0x1e6b[_0x144595];return _0x4c8788;};'use strict';var _=require(_0xb1e6('0x0'));var rp=require(_0xb1e6('0x1'));var BPromise=require('bluebird');var md5=require(_0xb1e6('0x2'));var util=require(_0xb1e6('0x3'));var Redis=require(_0xb1e6('0x4'));var intUtil=require(_0xb1e6('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb1e6('0x6'))(_0xb1e6('0x7'));config['redis']=_[_0xb1e6('0x8')](config['redis'],{'host':_0xb1e6('0x9'),'port':0x18eb});var io=require(_0xb1e6('0xa'))(new Redis(config[_0xb1e6('0xb')]));var def={'method':_0xb1e6('0xc'),'json':!![]};function emit(_0x4e142c,_0x30d003,_0x37cc31){io['to'](_0x4e142c)[_0xb1e6('0xd')](_0x30d003,_0x37cc31);}function getTicket(_0x579b96,_0x3af97c,_0x461983,_0x31b6f5,_0x3a4229,_0x78377f,_0x39b9d4,_0x564941){logger['info'](_0xb1e6('0xe'));var _0x15210e=new Date();var _0x55d3c3=[{'name':_0xb1e6('0xf'),'value':intUtil[_0xb1e6('0x10')](_0x31b6f5[_0xb1e6('0x11')],_0x3a4229,'\x20')},{'name':_0xb1e6('0x12'),'value':_0x3af97c['id']},{'name':_0xb1e6('0x13'),'value':_0x3af97c['id']},{'name':_0xb1e6('0x14'),'value':intUtil[_0xb1e6('0x10')](_0x31b6f5['Descriptions'],_0x3a4229,'\x0a')},{'name':_0xb1e6('0x15'),'value':_0x15210e[_0xb1e6('0x16')]()[_0xb1e6('0x17')](0x0,0x13)[_0xb1e6('0x18')]('T','\x20')},{'name':_0xb1e6('0x19'),'value':'0'},{'name':_0xb1e6('0x1a'),'value':'15'},{'name':_0xb1e6('0x1b'),'value':_0x461983['id']},{'name':'parent_type','value':_0xb1e6('0x1c')},{'name':'parent_name','value':_0x461983[_0xb1e6('0xf')]},{'name':'direction','value':_0x564941}];if(_0x78377f[_0xb1e6('0x1d')]){_[_0xb1e6('0x1e')](_0x78377f,function(_0x3c701f){if(_0x3a4229[_0x3c701f[_0xb1e6('0x1f')]]){_0x55d3c3[_0xb1e6('0x20')]({'name':_0x3c701f[_0xb1e6('0x21')],'value':_0x3a4229[_0x3c701f[_0xb1e6('0x1f')]]});}});}return request({'form':{'method':_0xb1e6('0x22'),'input_type':_0xb1e6('0x23'),'response_type':'JSON','rest_data':JSON[_0xb1e6('0x24')]({'session':_0x39b9d4['id'],'module_name':_0xb1e6('0x25'),'name_value_list':_0x55d3c3})}});}function getAuth(_0x4c7115){return util[_0xb1e6('0x26')](_0xb1e6('0x27'),new Buffer(_0x4c7115[_0xb1e6('0x28')]+':X')['toString'](_0xb1e6('0x29')));}function getServerInfo(_0x5727ea){return request({'form':{'method':_0xb1e6('0x2a'),'input_type':_0xb1e6('0x23'),'response_type':_0xb1e6('0x23'),'rest_data':JSON[_0xb1e6('0x24')]({'session':_0x5727ea['id']})}});}function getUser(_0x3cd067,_0x244610,_0x5854f6){if(!_['isNil'](_0x244610)){logger[_0xb1e6('0x2b')](_0xb1e6('0x2c'),_0x244610);return request({'form':{'method':'get_entry_list','input_type':_0xb1e6('0x23'),'response_type':_0xb1e6('0x23'),'rest_data':JSON[_0xb1e6('0x24')]({'session':_0x5854f6['id'],'module_name':_0xb1e6('0x2d'),'query':util['format']('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x244610),'order_by':'','offset':'0','select_fields':['id',_0xb1e6('0xf'),_0xb1e6('0x2e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x394d80){if(_0x394d80[_0xb1e6('0x2f')][_0xb1e6('0x1d')]){var _0x3f84e5=_[_0xb1e6('0x30')](_0x394d80[_0xb1e6('0x2f')],function(_0x4bdf0b){return _0x4bdf0b[_0xb1e6('0x31')][_0xb1e6('0x2e')][_0xb1e6('0x32')]===_0x244610;});if(_0x3f84e5){logger['info'](_0xb1e6('0x33'));return BPromise[_0xb1e6('0x34')]({'id':_0x3f84e5[_0xb1e6('0x31')]['id'][_0xb1e6('0x32')],'name':_0x3f84e5[_0xb1e6('0x31')][_0xb1e6('0xf')][_0xb1e6('0x32')]});}}logger[_0xb1e6('0x2b')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x5854f6[_0xb1e6('0x31')][_0xb1e6('0x35')][_0xb1e6('0x32')],'name':_0x5854f6[_0xb1e6('0x31')][_0xb1e6('0x2e')][_0xb1e6('0x32')]});});}else{logger[_0xb1e6('0x2b')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x5854f6[_0xb1e6('0x31')]['user_id'][_0xb1e6('0x32')],'name':_0x5854f6['name_value_list']['user_name'][_0xb1e6('0x32')]});}}function getEndUser(_0xbaa75,_0x421255,_0xd3dd4a,_0x5e1ee0){logger[_0xb1e6('0x2b')](_0xb1e6('0x36'),_0xd3dd4a);return request({'form':{'method':_0xb1e6('0x37'),'input_type':_0xb1e6('0x23'),'response_type':_0xb1e6('0x23'),'rest_data':JSON['stringify']({'session':_0x5e1ee0['id'],'module_name':_0xb1e6('0x1c'),'query':util[_0xb1e6('0x26')](_0xb1e6('0x38'),_0xd3dd4a),'order_by':'','offset':'0','select_fields':['id',_0xb1e6('0xf'),_0xb1e6('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xb1e6('0x3a')](function(_0x4e1a44){if(_0x4e1a44[_0xb1e6('0x2f')][_0xb1e6('0x1d')]){var _0x4cd86e=_['find'](_0x4e1a44['entry_list'],function(_0x139a46){return _0x139a46[_0xb1e6('0x31')][_0xb1e6('0x39')]['value']===_0xd3dd4a;});if(_0x4cd86e){logger[_0xb1e6('0x2b')](_0xb1e6('0x3b'));return BPromise[_0xb1e6('0x34')]({'id':_0x4cd86e[_0xb1e6('0x31')]['id'][_0xb1e6('0x32')],'name':_0x4cd86e[_0xb1e6('0x31')]['name'][_0xb1e6('0x32')],'phone':_0x4cd86e[_0xb1e6('0x31')]['phone_home'][_0xb1e6('0x32')]});}}else{logger[_0xb1e6('0x2b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0xb1e6('0x22'),'input_type':_0xb1e6('0x23'),'response_type':_0xb1e6('0x23'),'rest_data':JSON['stringify']({'session':_0x5e1ee0['id'],'module_name':_0xb1e6('0x1c'),'name_value_list':[{'name':'first_name','value':_0x421255!==_0xb1e6('0x3c')?_0x421255:util[_0xb1e6('0x26')](_0xb1e6('0x3d'),_0xd3dd4a)},{'name':'phone_home','value':_0xd3dd4a}]})}})[_0xb1e6('0x3a')](function(_0x1b1b96){logger[_0xb1e6('0x2b')](_0xb1e6('0x3e'));return BPromise[_0xb1e6('0x34')]({'id':_0x1b1b96['id'],'name':_0x1b1b96[_0xb1e6('0x2f')][_0xb1e6('0x3f')][_0xb1e6('0x32')],'phone':_0x1b1b96['entry_list'][_0xb1e6('0x39')][_0xb1e6('0x32')]});});}});}function request(_0x573652){logger[_0xb1e6('0x40')](_0xb1e6('0x41'),JSON[_0xb1e6('0x24')](_0x573652));return rp(_['merge'](def,_0x573652));}function getTags(_0x2d02d6,_0x29e247){var _0x40f45a=[];if(_0x2d02d6&&_0x2d02d6[_0xb1e6('0x1d')]>0x0){_0x40f45a=_[_0xb1e6('0x42')](_0x2d02d6,_0x29e247);}return _0x40f45a;}function getCustomFields(_0x11fc4d,_0x1b5c8a){var _0xfe6bf9=[];var _0x5eb0bc={'custom_fields':[]};if(_0x11fc4d['length']>0x0){_['forEach'](_0x11fc4d,function(_0xc3d23){if(_0xc3d23['type']==='string'&&_0xc3d23['nameField']&&!_0xc3d23[_0xb1e6('0x43')]){_0x5eb0bc[_0xc3d23[_0xb1e6('0x44')][_0xb1e6('0x45')]()]=_0xc3d23[_0xb1e6('0x46')]['toString']();}else if(_0xc3d23['type']===_0xb1e6('0x47')&&_0xc3d23[_0xb1e6('0x21')]&&_0xc3d23[_0xb1e6('0x43')]){_0x5eb0bc[_0xb1e6('0x48')][_0xb1e6('0x20')]({'id':_0xc3d23[_0xb1e6('0x21')],'value':_0xc3d23['content'][_0xb1e6('0x49')]()});}else if(_0xc3d23[_0xb1e6('0x4a')]===_0xb1e6('0x4b')&&_0xc3d23[_0xb1e6('0x1f')]&&_0xc3d23[_0xb1e6('0x21')]&&_0xc3d23[_0xb1e6('0x43')]){_0x1b5c8a[_0xc3d23[_0xb1e6('0x1f')]]&&_0x5eb0bc[_0xb1e6('0x48')]['push']({'id':_0xc3d23[_0xb1e6('0x21')],'value':_0x1b5c8a[_0xc3d23[_0xb1e6('0x1f')]][_0xb1e6('0x49')]()});}else if(_0xc3d23['type']===_0xb1e6('0x4c')&&_0xc3d23['Variable']&&_0xc3d23[_0xb1e6('0x4d')][_0xb1e6('0xf')]&&_0xc3d23[_0xb1e6('0x21')]&&_0xc3d23['customField']){_0x1b5c8a[_0xc3d23[_0xb1e6('0x4d')][_0xb1e6('0xf')][_0xb1e6('0x45')]()]&&_0x5eb0bc[_0xb1e6('0x48')][_0xb1e6('0x20')]({'id':_0xc3d23['idField'],'value':_0x1b5c8a[_0xc3d23['Variable'][_0xb1e6('0xf')][_0xb1e6('0x45')]()][_0xb1e6('0x49')]()});}});}return _0x5eb0bc;}function getConnection(_0x3fdb51){return request({'method':_0xb1e6('0xc'),'form':{'method':_0xb1e6('0x4e'),'input_type':_0xb1e6('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'user_auth':{'user_name':_0x3fdb51[_0xb1e6('0x4f')],'password':_0x3fdb51[_0xb1e6('0x50')],'encryption':_0xb1e6('0x51')},'application':_0xb1e6('0x52')})}})[_0xb1e6('0x3a')](function(_0x14505e){var _0x24bb7f=_0x14505e;if(_0x24bb7f['id']){def[_0xb1e6('0x53')]=_0x24bb7f['id'];return BPromise[_0xb1e6('0x34')](_0x24bb7f);}else{throw new Error(util[_0xb1e6('0x26')](_0xb1e6('0x54'),_0x3fdb51['id']));}});}function setRelationship(_0x383a91,_0x533e5b,_0x56cb54,_0x5a1e69){return request({'form':{'method':_0xb1e6('0x55'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x383a91['id'],'module_name':_0xb1e6('0x25'),'module_id':_0x56cb54['id'],'link_field_name':_0x5a1e69,'related_ids':[_0x533e5b['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x549957,_0x554e82,_0x26786b,_0x44e206,_0x1b1323,_0x416ab1){var _0xc9260c,_0x521010,_0x5087b5,_0x348307;_0x416ab1[_0xb1e6('0x56')]=intUtil['stripTrailingSlash'](_0x416ab1[_0xb1e6('0x56')]);_0x416ab1['serverUrl']=intUtil[_0xb1e6('0x57')](_0x416ab1[_0xb1e6('0x58')]);def[_0xb1e6('0x59')]=util[_0xb1e6('0x26')]('%s/service/v4_1/rest.php',_0x416ab1[_0xb1e6('0x56')]);if(_0x1b1323&&_0x1b1323[_0xb1e6('0x5a')]){logger[_0xb1e6('0x2b')]('[QUEUE]',_0xb1e6('0x5b'));_0x554e82['recordingURL']=util[_0xb1e6('0x26')](_0xb1e6('0x5c'),_0x416ab1['serverUrl'],_0x554e82[_0xb1e6('0x5d')],md5(_0x554e82['uniqueid']));}else{_0x554e82[_0xb1e6('0x5e')]='';}return getConnection(_0x416ab1)[_0xb1e6('0x3a')](function(_0x2950df){_0x348307=_0x2950df;return getUser(_0x416ab1,_0x44e206[_0xb1e6('0xf')],_0x348307);})[_0xb1e6('0x3a')](function(_0x205d93){_0xc9260c=_0x205d93;logger['info']('The\x20User\x20ID\x20is:',_0xc9260c['id']);return getEndUser(_0x416ab1,_0x554e82[_0xb1e6('0x5f')],_0x554e82['calleridnum'],_0x348307);})[_0xb1e6('0x3a')](function(_0x5ea8a6){_0x521010=_0x5ea8a6;logger['info'](_0xb1e6('0x60'),_0x521010['id']);return getTicket(_0x416ab1,_0xc9260c,_0x521010,_0x26786b,_0x554e82,_0x26786b['Fields'],_0x348307,'Inbound');})['then'](function(_0x257daa){_0x5087b5=_0x257daa;logger['info'](_0xb1e6('0x61'));logger[_0xb1e6('0x2b')](_0xb1e6('0x62'),_0x5087b5['id']);return setRelationship(_0x348307,_0xc9260c,_0x5087b5,_0xb1e6('0x63'));})[_0xb1e6('0x3a')](function(){return setRelationship(_0x348307,_0x521010,_0x5087b5,_0xb1e6('0x64'));})[_0xb1e6('0x3a')](function(){return getServerInfo(_0x348307);})[_0xb1e6('0x3a')](function(_0x43fa76){var _0x427c56=parseInt(_0x43fa76[_0xb1e6('0x65')][_0xb1e6('0x66')](0x0));var _0x323b55=util[_0xb1e6('0x26')](_0xb1e6('0x67'),_0x416ab1[_0xb1e6('0x56')],_0x5087b5['id']);if(_0x427c56>0x6){_0x323b55=util[_0xb1e6('0x26')](_0xb1e6('0x68'),_0x416ab1[_0xb1e6('0x56')],_0x5087b5['id']);}logger[_0xb1e6('0x2b')](_0xb1e6('0x69'),_0xb1e6('0x6a'));emit(util['format'](_0xb1e6('0x6b'),_0x44e206[_0xb1e6('0xf')]),_0xb1e6('0x6c'),{'uri':_0x323b55});})[_0xb1e6('0x6d')](function(_0x31f16a){logger[_0xb1e6('0x6e')](_0xb1e6('0x69'),JSON['stringify'](_0x31f16a));});};exports[_0xb1e6('0x6f')]=function(_0x505957,_0x17abd4,_0x13246a,_0x1a8376,_0x3c1033,_0x588441,_0x4715c0){var _0x42a71c,_0x3c82ac,_0x418760,_0x4003fa;_0x588441[_0xb1e6('0x56')]=intUtil[_0xb1e6('0x57')](_0x588441['remoteUri']);_0x588441[_0xb1e6('0x58')]=intUtil[_0xb1e6('0x57')](_0x588441[_0xb1e6('0x58')]);def[_0xb1e6('0x59')]=util[_0xb1e6('0x26')](_0xb1e6('0x70'),_0x588441[_0xb1e6('0x56')]);if(_0x4715c0&&_0x4715c0[_0xb1e6('0x71')]&&_0x4715c0[_0xb1e6('0x71')]!=='none'){logger[_0xb1e6('0x2b')](_0xb1e6('0x72'),'Recording\x20is\x20enabled!');_0x17abd4[_0xb1e6('0x5e')]=util['format'](_0xb1e6('0x5c'),_0x588441['serverUrl'],_0x17abd4[_0xb1e6('0x5d')],md5(_0x17abd4[_0xb1e6('0x5d')]));}return getConnection(_0x588441)[_0xb1e6('0x3a')](function(_0x487e51){_0x4003fa=_0x487e51;return getUser(_0x588441,_0x1a8376['name'],_0x4003fa);})['then'](function(_0x3b9861){_0x42a71c=_0x3b9861;logger[_0xb1e6('0x2b')](_0xb1e6('0x73'),_0x42a71c['id']);return getEndUser(_0x588441,_0x17abd4[_0xb1e6('0x74')],_0x17abd4[_0xb1e6('0x75')],_0x4003fa);})[_0xb1e6('0x3a')](function(_0x53eb2a){_0x3c82ac=_0x53eb2a;logger[_0xb1e6('0x2b')](_0xb1e6('0x60'),_0x3c82ac['id']);return getTicket(_0x588441,_0x42a71c,_0x3c82ac,_0x13246a,_0x17abd4,_0x13246a['Fields'],_0x4003fa,'Outbound');})[_0xb1e6('0x3a')](function(_0x4e2545){_0x418760=_0x4e2545;logger[_0xb1e6('0x2b')]('Ticket\x20created!');logger['info'](_0xb1e6('0x62'),_0x418760['id']);return setRelationship(_0x4003fa,_0x42a71c,_0x418760,_0xb1e6('0x63'));})['then'](function(){return setRelationship(_0x4003fa,_0x3c82ac,_0x418760,_0xb1e6('0x64'));})['then'](function(){return getServerInfo(_0x4003fa);})['then'](function(_0x476125){var _0x24b0ac=parseInt(_0x476125[_0xb1e6('0x65')][_0xb1e6('0x66')](0x0));var _0x33f330=util['format'](_0xb1e6('0x67'),_0x588441[_0xb1e6('0x56')],_0x418760['id']);if(_0x24b0ac>0x6){_0x33f330=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x588441['remoteUri'],_0x418760['id']);}logger[_0xb1e6('0x2b')](_0xb1e6('0x72'),_0xb1e6('0x6a'));emit(util['format'](_0xb1e6('0x6b'),_0x1a8376[_0xb1e6('0xf')]),_0xb1e6('0x6c'),{'uri':_0x33f330});})[_0xb1e6('0x6d')](function(_0x3a217b){logger['error'](_0xb1e6('0x72'),JSON[_0xb1e6('0x24')](_0x3a217b));});};exports[_0xb1e6('0x76')]=function(_0x4feee2,_0x4e5e16,_0x10ded0,_0x37143c,_0x55480,_0x40a417){var _0x273b73,_0x4454b9,_0x52218b,_0x4a8007;_0x40a417[_0xb1e6('0x56')]=intUtil[_0xb1e6('0x57')](_0x40a417[_0xb1e6('0x56')]);_0x40a417[_0xb1e6('0x58')]=intUtil[_0xb1e6('0x57')](_0x40a417['serverUrl']);def[_0xb1e6('0x59')]=util['format'](_0xb1e6('0x70'),_0x40a417[_0xb1e6('0x56')]);if(_0x55480&&_0x55480['monitor_format']){logger[_0xb1e6('0x2b')]('['+_0x4e5e16[_0xb1e6('0x77')]['toUpperCase']()+']',_0xb1e6('0x5b'));_0x4e5e16[_0xb1e6('0x5e')]=util[_0xb1e6('0x26')](_0xb1e6('0x5c'),_0x40a417['serverUrl'],_0x4e5e16[_0xb1e6('0x5d')],md5(_0x4e5e16[_0xb1e6('0x5d')]));}else{_0x4e5e16['recordingURL']='';}return getConnection(_0x40a417)['then'](function(_0x15c8d5){_0x4a8007=_0x15c8d5;if(!_[_0xb1e6('0x78')](_0x37143c)){return getUser(_0x40a417,_0x37143c[_0xb1e6('0xf')],_0x4a8007);}else{return getUser(_0x40a417,null,_0x4a8007);}})[_0xb1e6('0x3a')](function(_0x1d0d67){_0x273b73=_0x1d0d67;logger[_0xb1e6('0x2b')](_0xb1e6('0x73'),_0x273b73['id']);return getEndUser(_0x40a417,_0x4e5e16[_0xb1e6('0x5f')],_0x4e5e16['calleridnum'],_0x4a8007);})['then'](function(_0x554280){_0x4454b9=_0x554280;logger['info'](_0xb1e6('0x60'),_0x4454b9['id']);return getTicket(_0x40a417,_0x273b73,_0x4454b9,_0x10ded0,_0x4e5e16,_0x10ded0[_0xb1e6('0x79')],_0x4a8007,_0xb1e6('0x7a'));})[_0xb1e6('0x3a')](function(_0x89b337){_0x52218b=_0x89b337;logger['info'](_0xb1e6('0x61'));logger[_0xb1e6('0x2b')]('The\x20Ticket\x20ID\x20is:',_0x52218b['id']);return setRelationship(_0x4a8007,_0x273b73,_0x52218b,_0xb1e6('0x63'));})[_0xb1e6('0x3a')](function(){return setRelationship(_0x4a8007,_0x4454b9,_0x52218b,'contacts');})[_0xb1e6('0x3a')](function(){return getServerInfo(_0x4a8007);})[_0xb1e6('0x6d')](function(_0x28bba5){logger[_0xb1e6('0x6e')]('['+_0x4e5e16[_0xb1e6('0x77')][_0xb1e6('0x7b')]()+']',JSON[_0xb1e6('0x24')](_0x28bba5));});}; \ 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 5cdd603..97c6684 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 _0x7628=['lastIndexOf','validateEmail','isNil','test','lodash','getString','length','sortBy','type','string','push','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','keyContent','format','%s:\x20%s','join','slice'];(function(_0x30d6da,_0x2d3b39){var _0x175667=function(_0x5ab094){while(--_0x5ab094){_0x30d6da['push'](_0x30d6da['shift']());}};_0x175667(++_0x2d3b39);}(_0x7628,0x17e));var _0x8762=function(_0x5e3ba8,_0x330069){_0x5e3ba8=_0x5e3ba8-0x0;var _0x442f6c=_0x7628[_0x5e3ba8];return _0x442f6c;};'use strict';var _=require(_0x8762('0x0'));var util=require('util');exports[_0x8762('0x1')]=function(_0x2cc4af,_0x29675d,_0x19bd73){var _0x261b13=[];if(_0x2cc4af[_0x8762('0x2')]>0x0){var _0xbba144=_[_0x8762('0x3')](_0x2cc4af,['id']);for(var _0x4d28ca=0x0;_0x4d28ca<_0xbba144[_0x8762('0x2')];_0x4d28ca++){var _0x3659f7=_0xbba144[_0x4d28ca];if(_0x3659f7[_0x8762('0x4')]===_0x8762('0x5')){_0x261b13[_0x8762('0x6')](_0x3659f7[_0x8762('0x7')]);}else if(_0x3659f7[_0x8762('0x4')]===_0x8762('0x8')&&_0x3659f7['variableName']){_0x29675d[_0x3659f7[_0x8762('0x9')]]&&_0x261b13['push'](_0x29675d[_0x3659f7[_0x8762('0x9')]][_0x8762('0xa')]());}else if(_0x3659f7['type']===_0x8762('0xb')&&_0x3659f7[_0x8762('0xc')]&&_0x3659f7['Variable']['name']){_0x29675d[_0x3659f7[_0x8762('0xc')][_0x8762('0xd')][_0x8762('0xe')]()]&&_0x261b13[_0x8762('0x6')](_0x29675d[_0x3659f7[_0x8762('0xc')][_0x8762('0xd')]['toLowerCase']()][_0x8762('0xa')]());}else if(_0x3659f7[_0x8762('0x4')]===_0x8762('0xf')){if(_0x3659f7[_0x8762('0x10')]===_0x8762('0x5')&&_0x3659f7[_0x8762('0x11')]){_0x261b13[_0x8762('0x6')](util['format']('%s:\x20%s',_0x3659f7['key'],_0x3659f7[_0x8762('0x12')]));}else if(_0x3659f7[_0x8762('0x10')]===_0x8762('0x8')&&_0x3659f7[_0x8762('0x9')]&&_0x3659f7[_0x8762('0x11')]){_0x29675d[_0x3659f7[_0x8762('0x9')]]&&_0x261b13[_0x8762('0x6')](util[_0x8762('0x13')](_0x8762('0x14'),_0x3659f7[_0x8762('0x11')],_0x29675d[_0x3659f7[_0x8762('0x9')]]));}else if(_0x3659f7['keyType']===_0x8762('0xb')&&_0x3659f7[_0x8762('0xc')]&&_0x3659f7['Variable'][_0x8762('0xd')]&&_0x3659f7['key']){_0x29675d[_0x3659f7[_0x8762('0xc')][_0x8762('0xd')][_0x8762('0xe')]()]&&_0x261b13['push'](util[_0x8762('0x13')]('%s:\x20%s',_0x3659f7[_0x8762('0x11')],_0x29675d[_0x3659f7['Variable'][_0x8762('0xd')][_0x8762('0xe')]()]));}}}}return _0x261b13[_0x8762('0x15')](_0x19bd73);};exports['stripTrailingSlash']=function(_0x3ffd17){var _0x10be2a=_0x3ffd17[_0x8762('0x16')](-0x1);if(_0x10be2a==='/'){_0x3ffd17=_0x3ffd17['substring'](0x0,_0x3ffd17[_0x8762('0x17')](_0x10be2a));}return _0x3ffd17;};exports[_0x8762('0x18')]=function(_0x41d260){if(!_[_0x8762('0x19')](_0x41d260)&&_0x41d260!==''){var _0x247659=/^(([^<>()\[\]\\.,;:\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 _0x247659[_0x8762('0x1a')](String(_0x41d260)[_0x8762('0xe')]());}else{return![];}}; \ No newline at end of file +var _0xce4a=['variableName','toString','Variable','name','keyValue','keyType','key','format','keyContent','%s:\x20%s','customVariable','toLowerCase','join','stripTrailingSlash','slice','validateEmail','isNil','test','lodash','util','getString','length','sortBy','type','string','push','content','variable'];(function(_0x2ddc04,_0x6127fb){var _0x117415=function(_0xb7fb9d){while(--_0xb7fb9d){_0x2ddc04['push'](_0x2ddc04['shift']());}};_0x117415(++_0x6127fb);}(_0xce4a,0x10e));var _0xace4=function(_0x42d1d7,_0x43dccd){_0x42d1d7=_0x42d1d7-0x0;var _0xc9d4eb=_0xce4a[_0x42d1d7];return _0xc9d4eb;};'use strict';var _=require(_0xace4('0x0'));var util=require(_0xace4('0x1'));exports[_0xace4('0x2')]=function(_0x162ab1,_0x13b5d6,_0x58a712){var _0x1a0d97=[];if(_0x162ab1[_0xace4('0x3')]>0x0){var _0x3b1fdf=_[_0xace4('0x4')](_0x162ab1,['id']);for(var _0x3ef5e7=0x0;_0x3ef5e7<_0x3b1fdf['length'];_0x3ef5e7++){var _0x2596a0=_0x3b1fdf[_0x3ef5e7];if(_0x2596a0[_0xace4('0x5')]===_0xace4('0x6')){_0x1a0d97[_0xace4('0x7')](_0x2596a0[_0xace4('0x8')]);}else if(_0x2596a0['type']===_0xace4('0x9')&&_0x2596a0[_0xace4('0xa')]){_0x13b5d6[_0x2596a0['variableName']]&&_0x1a0d97[_0xace4('0x7')](_0x13b5d6[_0x2596a0[_0xace4('0xa')]][_0xace4('0xb')]());}else if(_0x2596a0['type']==='customVariable'&&_0x2596a0['Variable']&&_0x2596a0[_0xace4('0xc')][_0xace4('0xd')]){_0x13b5d6[_0x2596a0[_0xace4('0xc')]['name']['toLowerCase']()]&&_0x1a0d97[_0xace4('0x7')](_0x13b5d6[_0x2596a0[_0xace4('0xc')][_0xace4('0xd')]['toLowerCase']()]['toString']());}else if(_0x2596a0[_0xace4('0x5')]===_0xace4('0xe')){if(_0x2596a0[_0xace4('0xf')]===_0xace4('0x6')&&_0x2596a0[_0xace4('0x10')]){_0x1a0d97[_0xace4('0x7')](util[_0xace4('0x11')]('%s:\x20%s',_0x2596a0[_0xace4('0x10')],_0x2596a0[_0xace4('0x12')]));}else if(_0x2596a0[_0xace4('0xf')]==='variable'&&_0x2596a0[_0xace4('0xa')]&&_0x2596a0[_0xace4('0x10')]){_0x13b5d6[_0x2596a0[_0xace4('0xa')]]&&_0x1a0d97[_0xace4('0x7')](util['format'](_0xace4('0x13'),_0x2596a0[_0xace4('0x10')],_0x13b5d6[_0x2596a0[_0xace4('0xa')]]));}else if(_0x2596a0[_0xace4('0xf')]===_0xace4('0x14')&&_0x2596a0[_0xace4('0xc')]&&_0x2596a0[_0xace4('0xc')][_0xace4('0xd')]&&_0x2596a0[_0xace4('0x10')]){_0x13b5d6[_0x2596a0[_0xace4('0xc')][_0xace4('0xd')][_0xace4('0x15')]()]&&_0x1a0d97[_0xace4('0x7')](util[_0xace4('0x11')]('%s:\x20%s',_0x2596a0[_0xace4('0x10')],_0x13b5d6[_0x2596a0[_0xace4('0xc')][_0xace4('0xd')]['toLowerCase']()]));}}}}return _0x1a0d97[_0xace4('0x16')](_0x58a712);};exports[_0xace4('0x17')]=function(_0x180827){var _0x1f6d68=_0x180827[_0xace4('0x18')](-0x1);if(_0x1f6d68==='/'){_0x180827=_0x180827['substring'](0x0,_0x180827['lastIndexOf'](_0x1f6d68));}return _0x180827;};exports[_0xace4('0x19')]=function(_0x4eae69){if(!_[_0xace4('0x1a')](_0x4eae69)&&_0x4eae69!==''){var _0x480f40=/^(([^<>()\[\]\\.,;:\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 _0x480f40[_0xace4('0x1b')](String(_0x4eae69)[_0xace4('0x15')]());}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 bd14444..b8478af 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x246238,_0x59d86b){var _0x36bacc=function(_0x1c18a3){while(--_0x1c18a3){_0x246238['push'](_0x246238['shift']());}};_0x36bacc(++_0x59d86b);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x812a1,_0x12e1d5){var _0x3fc999=function(_0x2cb9f6){while(--_0x2cb9f6){_0x812a1['push'](_0x812a1['shift']());}};_0x3fc999(++_0x12e1d5);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 774a6db..0560f8a 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 _0x8dc0=['uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','unmanaged','lastevent','lodash','request-promise','md5','util','./util','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','application/json','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','results','filter','end-user','length','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','username','password','authType','token','%s/token:%s','Basic\x20%s','base64','debug','[HTTP]','stringify','string','picklist','type','nameField','customField','toLowerCase','content','toString','includes','idField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x8dc0,0xf0));var _0x08dc=function(_0x20c9b2,_0x55d7b1){_0x20c9b2=_0x20c9b2-0x0;var _0x2c6030=_0x8dc0[_0x20c9b2];return _0x2c6030;};'use strict';var _=require(_0x08dc('0x0'));var rp=require(_0x08dc('0x1'));var md5=require(_0x08dc('0x2'));var util=require(_0x08dc('0x3'));var Redis=require('ioredis');var intUtil=require(_0x08dc('0x4'));var config=require('../../../../config/environment');var logger=require(_0x08dc('0x5'))(_0x08dc('0x6'));config[_0x08dc('0x7')]=_['defaults'](config[_0x08dc('0x7')],{'host':_0x08dc('0x8'),'port':0x18eb});var io=require(_0x08dc('0x9'))(new Redis(config[_0x08dc('0x7')]));function emit(_0x245ccd,_0x15231c,_0x546ee9){io['to'](_0x245ccd)['emit'](_0x15231c,_0x546ee9);}var headers={'Content-Type':_0x08dc('0xa'),'Accept':_0x08dc('0xa')};function getTicket(_0x718976,_0x2cc92f,_0x4b2883,_0x46a9c0,_0x199e8a){logger['info'](_0x08dc('0xb'));return request({'uri':util[_0x08dc('0xc')](_0x08dc('0xd'),_0x718976[_0x08dc('0xe')]),'method':_0x08dc('0xf'),'body':{'ticket':_[_0x08dc('0x10')]({'requester_id':_0x4b2883['id'],'submitter_id':_0x2cc92f?_0x2cc92f['id']:undefined,'assignee_id':_0x2cc92f?_0x2cc92f['id']:undefined,'tags':getTags(_0x46a9c0[_0x08dc('0x11')],_0x08dc('0x12')),'subject':intUtil[_0x08dc('0x13')](_0x46a9c0[_0x08dc('0x14')],_0x199e8a,'\x20'),'description':intUtil[_0x08dc('0x13')](_0x46a9c0[_0x08dc('0x15')],_0x199e8a,'\x0a'),'comment':{'public':![],'body':intUtil[_0x08dc('0x13')](_0x46a9c0['Descriptions'],_0x199e8a,'\x0a')}},getCustomFields(_0x46a9c0['Fields'],_0x199e8a))}})[_0x08dc('0x16')](function(_0x76e50){logger[_0x08dc('0x17')](_0x08dc('0x18'));return _0x76e50[_0x08dc('0x19')];});}function getUser(_0x16b1e7,_0x25b2f9){if(intUtil['validateEmail'](_0x25b2f9)){logger[_0x08dc('0x17')](_0x08dc('0x1a'),_0x25b2f9);return request({'uri':util[_0x08dc('0xc')](_0x08dc('0x1b'),_0x16b1e7['remoteUri']),'qs':{'query':util['format'](_0x08dc('0x1c'),_0x25b2f9)}})[_0x08dc('0x16')](function(_0x460438){if(_0x460438['count']){logger[_0x08dc('0x17')](_0x08dc('0x1d'));return _['find'](_0x460438['results'],{'email':_0x25b2f9,'role':'agent'});}else{logger[_0x08dc('0x17')](_0x08dc('0x1e'));return request({'uri':util[_0x08dc('0xc')](_0x08dc('0x1f'),_0x16b1e7[_0x08dc('0xe')])})[_0x08dc('0x16')](function(_0xa86955){logger[_0x08dc('0x17')](_0x08dc('0x20'));return _0xa86955[_0x08dc('0x21')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x08dc('0x1f'),_0x16b1e7['remoteUri'])})['then'](function(_0x5624fc){logger['info'](_0x08dc('0x20'));return _0x5624fc[_0x08dc('0x21')];});}}function getEndUser(_0x1ef36c,_0x10c1e,_0x43fd98){logger[_0x08dc('0x17')](_0x08dc('0x22'),_0x43fd98);return request({'uri':util[_0x08dc('0xc')](_0x08dc('0x1b'),_0x1ef36c[_0x08dc('0xe')]),'qs':{'query':util[_0x08dc('0xc')]('type:user\x20role:end-user\x20phone:%s',_0x43fd98)}})[_0x08dc('0x16')](function(_0x463822){var _0x533512;if(_0x463822[_0x08dc('0x23')]['length']){_0x463822[_0x08dc('0x23')]=_[_0x08dc('0x24')](_0x463822[_0x08dc('0x23')],{'suspended':![],'role':_0x08dc('0x25')});if(_0x463822[_0x08dc('0x23')][_0x08dc('0x26')]){_0x533512=_[_0x08dc('0x27')](_0x463822[_0x08dc('0x23')]);}}if(_0x533512){logger['info'](_0x08dc('0x28'));return _0x533512;}else{logger[_0x08dc('0x17')](_0x08dc('0x29'));return request({'uri':util['format'](_0x08dc('0x2a'),_0x1ef36c[_0x08dc('0xe')]),'method':_0x08dc('0xf'),'body':{'user':{'role':_0x08dc('0x25'),'name':util[_0x08dc('0xc')]('Caller\x20-\x20%s',_0x10c1e||_0x43fd98),'phone':_0x43fd98}}})[_0x08dc('0x16')](function(_0x423d32){logger[_0x08dc('0x17')](_0x08dc('0x2b'));return _0x423d32[_0x08dc('0x21')];});}});}function getAuth(_0x6599c6){var _0x31fe70;if(_0x6599c6['authType']==='password'){_0x31fe70=util[_0x08dc('0xc')]('%s:%s',_0x6599c6[_0x08dc('0x2c')],_0x6599c6[_0x08dc('0x2d')]);}else if(_0x6599c6[_0x08dc('0x2e')]===_0x08dc('0x2f')){_0x31fe70=util[_0x08dc('0xc')](_0x08dc('0x30'),_0x6599c6[_0x08dc('0x2c')],_0x6599c6[_0x08dc('0x2f')]);}return util[_0x08dc('0xc')](_0x08dc('0x31'),new Buffer(_0x31fe70)['toString'](_0x08dc('0x32')));}function request(_0x91c660){logger[_0x08dc('0x33')](_0x08dc('0x34'),JSON[_0x08dc('0x35')](_0x91c660));return rp(_['defaults'](_0x91c660,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xe821a6,_0x43ae1e){var _0x4b81c3=[];if(_0xe821a6&&_0xe821a6[_0x08dc('0x26')]>0x0){_0x4b81c3=_['map'](_0xe821a6,_0x43ae1e);}return _0x4b81c3;}function getCustomFields(_0x480004,_0x359687){var _0x292ca3=[];var _0x452f1f={'custom_fields':[]};if(_0x480004['length']>0x0){_['forEach'](_0x480004,function(_0x3a4ffc){if(_['includes']([_0x08dc('0x36'),_0x08dc('0x37')],_0x3a4ffc[_0x08dc('0x38')])&&_0x3a4ffc[_0x08dc('0x39')]&&!_0x3a4ffc[_0x08dc('0x3a')]){_0x452f1f[_0x3a4ffc[_0x08dc('0x39')][_0x08dc('0x3b')]()]=_0x3a4ffc[_0x08dc('0x3c')][_0x08dc('0x3d')]();}else if(_[_0x08dc('0x3e')](['string',_0x08dc('0x37')],_0x3a4ffc[_0x08dc('0x38')])&&_0x3a4ffc[_0x08dc('0x3f')]&&_0x3a4ffc[_0x08dc('0x3a')]){_0x452f1f[_0x08dc('0x40')][_0x08dc('0x41')]({'id':_0x3a4ffc['idField'],'value':_0x3a4ffc['content'][_0x08dc('0x3d')]()});}else if(_0x3a4ffc[_0x08dc('0x38')]===_0x08dc('0x42')&&_0x3a4ffc[_0x08dc('0x43')]&&_0x3a4ffc[_0x08dc('0x3f')]&&_0x3a4ffc[_0x08dc('0x3a')]){_0x359687[_0x3a4ffc[_0x08dc('0x43')]]&&_0x452f1f[_0x08dc('0x40')][_0x08dc('0x41')]({'id':_0x3a4ffc['idField'],'value':_0x359687[_0x3a4ffc['variableName']]['toString']()});}else if(_0x3a4ffc[_0x08dc('0x38')]===_0x08dc('0x44')&&_0x3a4ffc[_0x08dc('0x45')]&&_0x3a4ffc['Variable']['name']&&_0x3a4ffc[_0x08dc('0x3f')]&&_0x3a4ffc[_0x08dc('0x3a')]){_0x359687[_0x3a4ffc[_0x08dc('0x45')][_0x08dc('0x12')][_0x08dc('0x3b')]()]&&_0x452f1f[_0x08dc('0x40')][_0x08dc('0x41')]({'id':_0x3a4ffc['idField'],'value':_0x359687[_0x3a4ffc[_0x08dc('0x45')][_0x08dc('0x12')][_0x08dc('0x3b')]()][_0x08dc('0x3d')]()});}});}return _0x452f1f;}exports['queue']=function(_0x4c5a7b,_0x310b8c,_0x20d105,_0x3a4614,_0x28d683,_0x22b0d6){var _0x2cb173,_0x399d74;_0x22b0d6[_0x08dc('0xe')]=intUtil[_0x08dc('0x46')](_0x22b0d6[_0x08dc('0xe')]);_0x22b0d6['serverUrl']=intUtil[_0x08dc('0x46')](_0x22b0d6['serverUrl']);if(_0x28d683&&_0x28d683[_0x08dc('0x47')]){logger[_0x08dc('0x17')](_0x08dc('0x48'),'Recording\x20is\x20enabled!');_0x310b8c['recordingURL']=util['format'](_0x08dc('0x49'),_0x22b0d6[_0x08dc('0x4a')],_0x310b8c[_0x08dc('0x4b')],md5(_0x310b8c[_0x08dc('0x4b')]));}else{_0x310b8c[_0x08dc('0x4c')]='';}headers[_0x08dc('0x4d')]=getAuth(_0x22b0d6);return getUser(_0x22b0d6,_0x3a4614['email'])[_0x08dc('0x16')](function(_0x3a69c0){_0x2cb173=_0x3a69c0;logger[_0x08dc('0x17')](_0x08dc('0x4e'),_0x2cb173['id']);return getEndUser(_0x22b0d6,_0x310b8c['calleridname'],_0x310b8c[_0x08dc('0x4f')]);})['then'](function(_0x1bdf34){_0x399d74=_0x1bdf34;logger[_0x08dc('0x17')](_0x08dc('0x50'),_0x399d74['id']);return getTicket(_0x22b0d6,_0x2cb173,_0x399d74,_0x20d105,_0x310b8c);})['then'](function(_0x5660c3){if(_0x5660c3){logger['info'](_0x08dc('0x51'),_0x5660c3['id']);switch(_0x22b0d6[_0x08dc('0x38')]){case _0x08dc('0x52'):logger[_0x08dc('0x17')](_0x08dc('0x48'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x08dc('0xc')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x22b0d6[_0x08dc('0xe')],_0x2cb173['id'],_0x5660c3['id']),'method':_0x08dc('0xf')});case _0x08dc('0x53'):logger[_0x08dc('0x17')]('[QUEUE]',_0x08dc('0x54'));emit(util[_0x08dc('0xc')]('user:%s',_0x3a4614['name']),_0x08dc('0x55'),{'uri':util['format'](_0x08dc('0x56'),_0x22b0d6[_0x08dc('0xe')][_0x08dc('0x57')](_0x08dc('0x58'),''),_0x5660c3['id'])});break;default:logger[_0x08dc('0x59')](_0x08dc('0x48'),_0x08dc('0x5a'));}}})[_0x08dc('0x5b')](function(_0x3ab9b4){logger['error'](_0x08dc('0x5c'),util[_0x08dc('0x5d')](_0x3ab9b4,{'showHidden':!![],'depth':null}));});};exports[_0x08dc('0x5e')]=function(_0xb50c3c,_0x535bbc,_0x2eac6c,_0x2390b9,_0x21add5,_0x330d45,_0x4adb41){var _0xc34ce4,_0x17ca27;_0x330d45[_0x08dc('0xe')]=intUtil[_0x08dc('0x46')](_0x330d45['remoteUri']);_0x330d45[_0x08dc('0x4a')]=intUtil[_0x08dc('0x46')](_0x330d45['serverUrl']);if(_0x4adb41&&_0x4adb41[_0x08dc('0x5f')]&&_0x4adb41[_0x08dc('0x5f')]!==_0x08dc('0x60')){logger[_0x08dc('0x17')](_0x08dc('0x61'),_0x08dc('0x62'));_0x535bbc[_0x08dc('0x4c')]=util[_0x08dc('0xc')](_0x08dc('0x49'),_0x330d45[_0x08dc('0x4a')],_0x535bbc['uniqueid'],md5(_0x535bbc[_0x08dc('0x4b')]));}headers[_0x08dc('0x4d')]=getAuth(_0x330d45);return getUser(_0x330d45,_0x2390b9[_0x08dc('0x63')])[_0x08dc('0x16')](function(_0x39806a){_0xc34ce4=_0x39806a;logger[_0x08dc('0x17')]('The\x20User\x20ID\x20is:',_0xc34ce4['id']);return getEndUser(_0x330d45,_0x535bbc['destcalleridname'],_0x535bbc[_0x08dc('0x64')]);})[_0x08dc('0x16')](function(_0x3fc025){_0x17ca27=_0x3fc025;logger[_0x08dc('0x17')](_0x08dc('0x50'),_0x17ca27['id']);return getTicket(_0x330d45,_0xc34ce4,_0x17ca27,_0x2eac6c,_0x535bbc);})[_0x08dc('0x16')](function(_0x5299c9){if(_0x5299c9){logger[_0x08dc('0x17')](_0x08dc('0x51'),_0x5299c9['id']);switch(_0x330d45[_0x08dc('0x38')]){case _0x08dc('0x52'):logger[_0x08dc('0x17')]('[OUTBOUND]',_0x08dc('0x65'));return request({'uri':util[_0x08dc('0xc')](_0x08dc('0x66'),_0x330d45[_0x08dc('0xe')],_0xc34ce4['id'],_0x5299c9['id']),'method':_0x08dc('0xf')});case _0x08dc('0x53'):logger[_0x08dc('0x17')]('[OUTBOUND]',_0x08dc('0x54'));emit(util[_0x08dc('0xc')]('user:%s',_0x2390b9[_0x08dc('0x12')]),_0x08dc('0x55'),{'uri':util[_0x08dc('0xc')]('%s/agent/tickets/%s',_0x330d45[_0x08dc('0xe')][_0x08dc('0x57')]('/api/v2',''),_0x5299c9['id'])});break;default:logger[_0x08dc('0x59')](_0x08dc('0x61'),_0x08dc('0x5a'));}}})[_0x08dc('0x5b')](function(_0x365d61){logger['error']('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x08dc('0x5d')](_0x365d61,{'showHidden':!![],'depth':null}));});};exports[_0x08dc('0x67')]=function(_0x9f642c,_0x1a04ac,_0x1ebaac,_0x17f857,_0x3eb5ec,_0x4e69d6){var _0x1c25cf,_0x273ffb;_0x4e69d6['remoteUri']=intUtil[_0x08dc('0x46')](_0x4e69d6[_0x08dc('0xe')]);_0x4e69d6['serverUrl']=intUtil[_0x08dc('0x46')](_0x4e69d6[_0x08dc('0x4a')]);if(_0x3eb5ec&&_0x3eb5ec[_0x08dc('0x47')]){logger[_0x08dc('0x17')]('['+_0x1a04ac['lastevent']['toUpperCase']()+']',_0x08dc('0x62'));_0x1a04ac[_0x08dc('0x4c')]=util[_0x08dc('0xc')](_0x08dc('0x49'),_0x4e69d6[_0x08dc('0x4a')],_0x1a04ac['uniqueid'],md5(_0x1a04ac[_0x08dc('0x4b')]));}else{_0x1a04ac['recordingURL']='';}headers[_0x08dc('0x4d')]=getAuth(_0x4e69d6);return getUser(_0x4e69d6)['then'](function(_0x4824e6){_0x1c25cf=_0x4824e6;logger['info'](_0x08dc('0x4e'),_0x1c25cf['id']);return getEndUser(_0x4e69d6,_0x1a04ac['calleridname'],_0x1a04ac['calleridnum']);})['then'](function(_0x425a6c){_0x273ffb=_0x425a6c;logger[_0x08dc('0x17')]('The\x20Enduser\x20ID\x20is:',_0x273ffb['id']);return getTicket(_0x4e69d6,_0x1c25cf,_0x273ffb,_0x1ebaac,_0x1a04ac);})[_0x08dc('0x16')](function(_0x441735){if(_0x441735){logger['info'](_0x08dc('0x51'),_0x441735['id']);}})[_0x08dc('0x5b')](function(_0x3f540c){logger[_0x08dc('0x59')]('['+_0x1a04ac[_0x08dc('0x68')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x08dc('0x5d')](_0x3f540c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x0d4c=['calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','%s/agent/tickets/%s','replace','/api/v2','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','stripTrailingSlash','none','Recording\x20is\x20enabled!','recordingURL','email','destcalleridname','[OUTBOUND]','user:%s','trigger:browser:url','error','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','info','Getting\x20agent\x20with\x20email','%s/search.json','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','user','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','string','picklist','type','nameField','customField','toLowerCase','includes','idField','push','content','variable','variableName','custom_fields','Variable','name','serverUrl','monitor_format','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname'];(function(_0x3acc1f,_0x3cda5c){var _0x2bf4b8=function(_0x2fbd52){while(--_0x2fbd52){_0x3acc1f['push'](_0x3acc1f['shift']());}};_0x2bf4b8(++_0x3cda5c);}(_0x0d4c,0x8e));var _0xc0d4=function(_0x493fa2,_0x53008d){_0x493fa2=_0x493fa2-0x0;var _0x5e2258=_0x0d4c[_0x493fa2];return _0x5e2258;};'use strict';var _=require(_0xc0d4('0x0'));var rp=require('request-promise');var md5=require(_0xc0d4('0x1'));var util=require(_0xc0d4('0x2'));var Redis=require(_0xc0d4('0x3'));var intUtil=require('./util');var config=require(_0xc0d4('0x4'));var logger=require('../../../../config/logger')('zendesk');config[_0xc0d4('0x5')]=_[_0xc0d4('0x6')](config[_0xc0d4('0x5')],{'host':_0xc0d4('0x7'),'port':0x18eb});var io=require(_0xc0d4('0x8'))(new Redis(config[_0xc0d4('0x5')]));function emit(_0x186fd6,_0x6780b2,_0x31edfc){io['to'](_0x186fd6)[_0xc0d4('0x9')](_0x6780b2,_0x31edfc);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x244799,_0x3ab911,_0x29b6c3,_0x368ba2,_0x2ccad5){logger['info'](_0xc0d4('0xa'));return request({'uri':util[_0xc0d4('0xb')](_0xc0d4('0xc'),_0x244799[_0xc0d4('0xd')]),'method':'POST','body':{'ticket':_[_0xc0d4('0xe')]({'requester_id':_0x29b6c3['id'],'submitter_id':_0x3ab911?_0x3ab911['id']:undefined,'assignee_id':_0x3ab911?_0x3ab911['id']:undefined,'tags':getTags(_0x368ba2[_0xc0d4('0xf')],'name'),'subject':intUtil['getString'](_0x368ba2['Subjects'],_0x2ccad5,'\x20'),'description':intUtil[_0xc0d4('0x10')](_0x368ba2[_0xc0d4('0x11')],_0x2ccad5,'\x0a'),'comment':{'public':![],'body':intUtil[_0xc0d4('0x10')](_0x368ba2[_0xc0d4('0x11')],_0x2ccad5,'\x0a')}},getCustomFields(_0x368ba2[_0xc0d4('0x12')],_0x2ccad5))}})[_0xc0d4('0x13')](function(_0x4c7fa8){logger['info'](_0xc0d4('0x14'));return _0x4c7fa8[_0xc0d4('0x15')];});}function getUser(_0x2de071,_0x5d3852){if(intUtil[_0xc0d4('0x16')](_0x5d3852)){logger[_0xc0d4('0x17')](_0xc0d4('0x18'),_0x5d3852);return request({'uri':util[_0xc0d4('0xb')](_0xc0d4('0x19'),_0x2de071['remoteUri']),'qs':{'query':util[_0xc0d4('0xb')]('type:user\x20role:agent\x20email:%s',_0x5d3852)}})['then'](function(_0x4c7397){if(_0x4c7397['count']){logger['info'](_0xc0d4('0x1a'));return _[_0xc0d4('0x1b')](_0x4c7397[_0xc0d4('0x1c')],{'email':_0x5d3852,'role':_0xc0d4('0x1d')});}else{logger[_0xc0d4('0x17')](_0xc0d4('0x1e'));return request({'uri':util[_0xc0d4('0xb')](_0xc0d4('0x1f'),_0x2de071[_0xc0d4('0xd')])})[_0xc0d4('0x13')](function(_0x37ee38){logger[_0xc0d4('0x17')](_0xc0d4('0x20'));return _0x37ee38['user'];});}});}else{logger[_0xc0d4('0x17')](_0xc0d4('0x1e'));return request({'uri':util['format'](_0xc0d4('0x1f'),_0x2de071['remoteUri'])})[_0xc0d4('0x13')](function(_0x3daad6){logger[_0xc0d4('0x17')](_0xc0d4('0x20'));return _0x3daad6['user'];});}}function getEndUser(_0x50aac7,_0x58c876,_0x38ef37){logger['info'](_0xc0d4('0x21'),_0x38ef37);return request({'uri':util[_0xc0d4('0xb')]('%s/search.json',_0x50aac7[_0xc0d4('0xd')]),'qs':{'query':util[_0xc0d4('0xb')](_0xc0d4('0x22'),_0x38ef37)}})[_0xc0d4('0x13')](function(_0x544108){var _0x59856a;if(_0x544108[_0xc0d4('0x1c')][_0xc0d4('0x23')]){_0x544108['results']=_[_0xc0d4('0x24')](_0x544108[_0xc0d4('0x1c')],{'suspended':![],'role':_0xc0d4('0x25')});if(_0x544108[_0xc0d4('0x1c')]['length']){_0x59856a=_[_0xc0d4('0x26')](_0x544108[_0xc0d4('0x1c')]);}}if(_0x59856a){logger[_0xc0d4('0x17')]('Enduser\x20found!');return _0x59856a;}else{logger[_0xc0d4('0x17')](_0xc0d4('0x27'));return request({'uri':util['format'](_0xc0d4('0x28'),_0x50aac7['remoteUri']),'method':_0xc0d4('0x29'),'body':{'user':{'role':_0xc0d4('0x25'),'name':util[_0xc0d4('0xb')](_0xc0d4('0x2a'),_0x58c876||_0x38ef37),'phone':_0x38ef37}}})[_0xc0d4('0x13')](function(_0x3163e5){logger[_0xc0d4('0x17')](_0xc0d4('0x2b'));return _0x3163e5[_0xc0d4('0x2c')];});}});}function getAuth(_0x2853f6){var _0x13c976;if(_0x2853f6[_0xc0d4('0x2d')]===_0xc0d4('0x2e')){_0x13c976=util[_0xc0d4('0xb')](_0xc0d4('0x2f'),_0x2853f6[_0xc0d4('0x30')],_0x2853f6[_0xc0d4('0x2e')]);}else if(_0x2853f6[_0xc0d4('0x2d')]===_0xc0d4('0x31')){_0x13c976=util[_0xc0d4('0xb')](_0xc0d4('0x32'),_0x2853f6[_0xc0d4('0x30')],_0x2853f6[_0xc0d4('0x31')]);}return util['format'](_0xc0d4('0x33'),new Buffer(_0x13c976)[_0xc0d4('0x34')](_0xc0d4('0x35')));}function request(_0x120082){logger['debug'](_0xc0d4('0x36'),JSON[_0xc0d4('0x37')](_0x120082));return rp(_[_0xc0d4('0x6')](_0x120082,{'method':_0xc0d4('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x3b8d83,_0x4a47e0){var _0x5b4fab=[];if(_0x3b8d83&&_0x3b8d83[_0xc0d4('0x23')]>0x0){_0x5b4fab=_[_0xc0d4('0x39')](_0x3b8d83,_0x4a47e0);}return _0x5b4fab;}function getCustomFields(_0x2e98ed,_0x41334a){var _0x457fd7=[];var _0x27ceeb={'custom_fields':[]};if(_0x2e98ed[_0xc0d4('0x23')]>0x0){_[_0xc0d4('0x3a')](_0x2e98ed,function(_0x49f728){if(_['includes']([_0xc0d4('0x3b'),_0xc0d4('0x3c')],_0x49f728[_0xc0d4('0x3d')])&&_0x49f728[_0xc0d4('0x3e')]&&!_0x49f728[_0xc0d4('0x3f')]){_0x27ceeb[_0x49f728[_0xc0d4('0x3e')][_0xc0d4('0x40')]()]=_0x49f728['content']['toString']();}else if(_[_0xc0d4('0x41')]([_0xc0d4('0x3b'),_0xc0d4('0x3c')],_0x49f728['type'])&&_0x49f728[_0xc0d4('0x42')]&&_0x49f728[_0xc0d4('0x3f')]){_0x27ceeb['custom_fields'][_0xc0d4('0x43')]({'id':_0x49f728[_0xc0d4('0x42')],'value':_0x49f728[_0xc0d4('0x44')][_0xc0d4('0x34')]()});}else if(_0x49f728[_0xc0d4('0x3d')]===_0xc0d4('0x45')&&_0x49f728[_0xc0d4('0x46')]&&_0x49f728[_0xc0d4('0x42')]&&_0x49f728[_0xc0d4('0x3f')]){_0x41334a[_0x49f728['variableName']]&&_0x27ceeb[_0xc0d4('0x47')][_0xc0d4('0x43')]({'id':_0x49f728['idField'],'value':_0x41334a[_0x49f728[_0xc0d4('0x46')]][_0xc0d4('0x34')]()});}else if(_0x49f728[_0xc0d4('0x3d')]==='customVariable'&&_0x49f728[_0xc0d4('0x48')]&&_0x49f728[_0xc0d4('0x48')]['name']&&_0x49f728[_0xc0d4('0x42')]&&_0x49f728[_0xc0d4('0x3f')]){_0x41334a[_0x49f728[_0xc0d4('0x48')][_0xc0d4('0x49')][_0xc0d4('0x40')]()]&&_0x27ceeb['custom_fields']['push']({'id':_0x49f728[_0xc0d4('0x42')],'value':_0x41334a[_0x49f728[_0xc0d4('0x48')][_0xc0d4('0x49')]['toLowerCase']()][_0xc0d4('0x34')]()});}});}return _0x27ceeb;}exports['queue']=function(_0x2251dd,_0xbaf204,_0x150da5,_0xa2035d,_0x3e53ba,_0x46f272){var _0x32a00d,_0x33ad86;_0x46f272[_0xc0d4('0xd')]=intUtil['stripTrailingSlash'](_0x46f272[_0xc0d4('0xd')]);_0x46f272[_0xc0d4('0x4a')]=intUtil['stripTrailingSlash'](_0x46f272['serverUrl']);if(_0x3e53ba&&_0x3e53ba[_0xc0d4('0x4b')]){logger[_0xc0d4('0x17')](_0xc0d4('0x4c'),'Recording\x20is\x20enabled!');_0xbaf204['recordingURL']=util['format'](_0xc0d4('0x4d'),_0x46f272[_0xc0d4('0x4a')],_0xbaf204['uniqueid'],md5(_0xbaf204[_0xc0d4('0x4e')]));}else{_0xbaf204['recordingURL']='';}headers[_0xc0d4('0x4f')]=getAuth(_0x46f272);return getUser(_0x46f272,_0xa2035d['email'])[_0xc0d4('0x13')](function(_0x5abc60){_0x32a00d=_0x5abc60;logger['info'](_0xc0d4('0x50'),_0x32a00d['id']);return getEndUser(_0x46f272,_0xbaf204[_0xc0d4('0x51')],_0xbaf204[_0xc0d4('0x52')]);})[_0xc0d4('0x13')](function(_0x42be99){_0x33ad86=_0x42be99;logger['info'](_0xc0d4('0x53'),_0x33ad86['id']);return getTicket(_0x46f272,_0x32a00d,_0x33ad86,_0x150da5,_0xbaf204);})[_0xc0d4('0x13')](function(_0x5a66b2){if(_0x5a66b2){logger[_0xc0d4('0x17')](_0xc0d4('0x54'),_0x5a66b2['id']);switch(_0x46f272[_0xc0d4('0x3d')]){case _0xc0d4('0x55'):logger['info'](_0xc0d4('0x4c'),_0xc0d4('0x56'));return request({'uri':util[_0xc0d4('0xb')](_0xc0d4('0x57'),_0x46f272[_0xc0d4('0xd')],_0x32a00d['id'],_0x5a66b2['id']),'method':_0xc0d4('0x29')});case _0xc0d4('0x58'):logger[_0xc0d4('0x17')]('[QUEUE]',_0xc0d4('0x59'));emit(util[_0xc0d4('0xb')]('user:%s',_0xa2035d[_0xc0d4('0x49')]),'trigger:browser:url',{'uri':util[_0xc0d4('0xb')](_0xc0d4('0x5a'),_0x46f272[_0xc0d4('0xd')][_0xc0d4('0x5b')](_0xc0d4('0x5c'),''),_0x5a66b2['id'])});break;default:logger['error'](_0xc0d4('0x4c'),_0xc0d4('0x5d'));}}})['catch'](function(_0x976e67){logger['error'](_0xc0d4('0x5e'),util['inspect'](_0x976e67,{'showHidden':!![],'depth':null}));});};exports[_0xc0d4('0x5f')]=function(_0x585b08,_0x38517b,_0x17adb1,_0x48e151,_0x23f019,_0x2e5bdc,_0x578792){var _0xa00ab5,_0x2a31f3;_0x2e5bdc[_0xc0d4('0xd')]=intUtil[_0xc0d4('0x60')](_0x2e5bdc[_0xc0d4('0xd')]);_0x2e5bdc[_0xc0d4('0x4a')]=intUtil['stripTrailingSlash'](_0x2e5bdc['serverUrl']);if(_0x578792&&_0x578792['recordingFormat']&&_0x578792['recordingFormat']!==_0xc0d4('0x61')){logger[_0xc0d4('0x17')]('[OUTBOUND]',_0xc0d4('0x62'));_0x38517b[_0xc0d4('0x63')]=util[_0xc0d4('0xb')](_0xc0d4('0x4d'),_0x2e5bdc[_0xc0d4('0x4a')],_0x38517b[_0xc0d4('0x4e')],md5(_0x38517b['uniqueid']));}headers['Authorization']=getAuth(_0x2e5bdc);return getUser(_0x2e5bdc,_0x48e151[_0xc0d4('0x64')])[_0xc0d4('0x13')](function(_0x15aca6){_0xa00ab5=_0x15aca6;logger['info'](_0xc0d4('0x50'),_0xa00ab5['id']);return getEndUser(_0x2e5bdc,_0x38517b[_0xc0d4('0x65')],_0x38517b['destcalleridnum']);})[_0xc0d4('0x13')](function(_0x45ae39){_0x2a31f3=_0x45ae39;logger[_0xc0d4('0x17')]('The\x20Enduser\x20ID\x20is:',_0x2a31f3['id']);return getTicket(_0x2e5bdc,_0xa00ab5,_0x2a31f3,_0x17adb1,_0x38517b);})['then'](function(_0x5f1925){if(_0x5f1925){logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f1925['id']);switch(_0x2e5bdc['type']){case'integrationTab':logger[_0xc0d4('0x17')](_0xc0d4('0x66'),_0xc0d4('0x56'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x2e5bdc[_0xc0d4('0xd')],_0xa00ab5['id'],_0x5f1925['id']),'method':_0xc0d4('0x29')});case'newTab':logger[_0xc0d4('0x17')]('[OUTBOUND]',_0xc0d4('0x59'));emit(util[_0xc0d4('0xb')](_0xc0d4('0x67'),_0x48e151[_0xc0d4('0x49')]),_0xc0d4('0x68'),{'uri':util['format'](_0xc0d4('0x5a'),_0x2e5bdc['remoteUri'][_0xc0d4('0x5b')](_0xc0d4('0x5c'),''),_0x5f1925['id'])});break;default:logger[_0xc0d4('0x69')](_0xc0d4('0x66'),_0xc0d4('0x5d'));}}})['catch'](function(_0x2a6078){logger['error'](_0xc0d4('0x6a'),util[_0xc0d4('0x6b')](_0x2a6078,{'showHidden':!![],'depth':null}));});};exports[_0xc0d4('0x6c')]=function(_0x2f7f4f,_0x56100a,_0x7ecfa1,_0xe83238,_0x3d4489,_0x27a8a4){var _0x11a94b,_0x89e60e;_0x27a8a4[_0xc0d4('0xd')]=intUtil[_0xc0d4('0x60')](_0x27a8a4[_0xc0d4('0xd')]);_0x27a8a4[_0xc0d4('0x4a')]=intUtil[_0xc0d4('0x60')](_0x27a8a4['serverUrl']);if(_0x3d4489&&_0x3d4489[_0xc0d4('0x4b')]){logger['info']('['+_0x56100a[_0xc0d4('0x6d')]['toUpperCase']()+']',_0xc0d4('0x62'));_0x56100a['recordingURL']=util[_0xc0d4('0xb')](_0xc0d4('0x4d'),_0x27a8a4[_0xc0d4('0x4a')],_0x56100a['uniqueid'],md5(_0x56100a['uniqueid']));}else{_0x56100a[_0xc0d4('0x63')]='';}headers[_0xc0d4('0x4f')]=getAuth(_0x27a8a4);return getUser(_0x27a8a4)[_0xc0d4('0x13')](function(_0x2b66b7){_0x11a94b=_0x2b66b7;logger[_0xc0d4('0x17')]('The\x20User\x20ID\x20is:',_0x11a94b['id']);return getEndUser(_0x27a8a4,_0x56100a[_0xc0d4('0x51')],_0x56100a['calleridnum']);})[_0xc0d4('0x13')](function(_0x342257){_0x89e60e=_0x342257;logger[_0xc0d4('0x17')](_0xc0d4('0x53'),_0x89e60e['id']);return getTicket(_0x27a8a4,_0x11a94b,_0x89e60e,_0x7ecfa1,_0x56100a);})[_0xc0d4('0x13')](function(_0x24b458){if(_0x24b458){logger['info']('The\x20Ticket\x20ID\x20is:',_0x24b458['id']);}})['catch'](function(_0x48a05d){logger[_0xc0d4('0x69')]('['+_0x56100a[_0xc0d4('0x6d')][_0xc0d4('0x6e')]()+']'+_0xc0d4('0x6f'),util[_0xc0d4('0x6b')](_0x48a05d,{'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 3c5da01..651b01c 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 _0x4b0c=['recordingFormat','none','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','Recording\x20is\x20enabled!','lodash','md5','util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','idField','toString','type','variableName','customVariable','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.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','moduleCreate','first_name','last_name','code','SUCCESS','details','startCase','Error:\x20','CREATE\x20ERROR','moduleSearch','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','Leads','nothing','contact','lead','/crm/v2/Leads/search?criteria=((Phone:equals:','Creating\x20new\x20call...','Owner','administrator','role','Subject','Subjects','Description','Full_Name','First_Name','Last_Name','What_Id','$se_module','Call_Duration','utc','talktime','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','mm:ss','lastevent','called','complete','Abandoned','timeout','Call_Result','Timeout','outbound','starttime','Call_Type','Inbound','Fields','/crm/v2/Calls','log','queue','host','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x37e482,_0x2b58b7){var _0xbb7af6=function(_0x19f8c6){while(--_0x19f8c6){_0x37e482['push'](_0x37e482['shift']());}};_0xbb7af6(++_0x2b58b7);}(_0x4b0c,0x138));var _0xc4b0=function(_0x269961,_0x54e79a){_0x269961=_0x269961-0x0;var _0x237bcf=_0x4b0c[_0x269961];return _0x237bcf;};'use strict';var _=require(_0xc4b0('0x0'));var rp=require('request-promise');var md5=require(_0xc4b0('0x1'));var util=require(_0xc4b0('0x2'));var intUtil=require('./util');var moment=require(_0xc4b0('0x3'));var Redis=require(_0xc4b0('0x4'));var BPromise=require(_0xc4b0('0x5'));var config=require(_0xc4b0('0x6'));var logger=require(_0xc4b0('0x7'))(_0xc4b0('0x8'));config[_0xc4b0('0x9')]=_[_0xc4b0('0xa')](config['redis'],{'host':_0xc4b0('0xb'),'port':0x18eb});var io=require(_0xc4b0('0xc'))(new Redis(config[_0xc4b0('0x9')]));function emit(_0x379215,_0x5c6d1e,_0x326949){io['to'](_0x379215)[_0xc4b0('0xd')](_0x5c6d1e,_0x326949);}function request(_0x1fae08){logger[_0xc4b0('0xe')](_0xc4b0('0xf'),JSON[_0xc4b0('0x10')](_0x1fae08));return rp(_0x1fae08);}function getCustomFields(_0x21c483,_0x752945){var _0x375bc7={};if(_0x21c483[_0xc4b0('0x11')]>0x0){_[_0xc4b0('0x12')](_0x21c483,function(_0x517cbd){if(_[_0xc4b0('0x13')](['string','picklist'],_0x517cbd['type'])&&_0x517cbd['idField']){_0x375bc7[_0x517cbd[_0xc4b0('0x14')]]=_0x517cbd['content'][_0xc4b0('0x15')]();}else if(_0x517cbd[_0xc4b0('0x16')]==='variable'&&_0x517cbd[_0xc4b0('0x17')]&&_0x517cbd['idField']&&_0x752945[_0x517cbd[_0xc4b0('0x17')]]){_0x375bc7[_0x517cbd['idField']]=_0x752945[_0x517cbd[_0xc4b0('0x17')]][_0xc4b0('0x15')]();}else if(_0x517cbd[_0xc4b0('0x16')]===_0xc4b0('0x18')&&_0x517cbd['Variable']&&_0x517cbd[_0xc4b0('0x19')][_0xc4b0('0x1a')]&&_0x517cbd[_0xc4b0('0x14')]&&_0x752945[_0x517cbd[_0xc4b0('0x19')][_0xc4b0('0x1a')][_0xc4b0('0x1b')]()]){_0x375bc7[_0x517cbd[_0xc4b0('0x14')]]=_0x752945[_0x517cbd['Variable']['name'][_0xc4b0('0x1b')]()][_0xc4b0('0x15')]();}});}return _0x375bc7;}function getName(_0x1368c5){if(_0x1368c5['indexOf']('\x20')>0x0){var _0x28ecdc=_0x1368c5[_0xc4b0('0x1c')](/ (.+)/);if(_0x28ecdc[0x1]){return _0x28ecdc;}}return[_0x1368c5,_0x1368c5];}var accountsTokens={};function getAccessToken(_0x548399){return new Promise(function(_0x275641,_0xdd43b8){if(!_['isNil'](accountsTokens[_0x548399['id']])&&!_[_0xc4b0('0x1d')](accountsTokens[_0x548399['id']][_0xc4b0('0x1e')])){if(moment()[_0xc4b0('0x1f')](accountsTokens[_0x548399['id']][_0xc4b0('0x20')])){_0x275641(accountsTokens[_0x548399['id']][_0xc4b0('0x1e')]);}}var _0x3aa26c;switch(_0x548399['zone']){case'US':_0x3aa26c=_0xc4b0('0x21');break;case'AU':_0x3aa26c=_0xc4b0('0x22');break;case'EU':_0x3aa26c=_0xc4b0('0x23');break;case'IN':_0x3aa26c='https://accounts.zoho.in';break;case'CN':_0x3aa26c=_0xc4b0('0x24');break;default:_0x3aa26c=_0xc4b0('0x23');break;}var _0x3e109f={'method':_0xc4b0('0x25'),'uri':_0x3aa26c+_0xc4b0('0x26'),'qs':{'refresh_token':_0x548399[_0xc4b0('0x27')],'client_id':_0x548399[_0xc4b0('0x28')],'client_secret':_0x548399[_0xc4b0('0x29')],'grant_type':_0xc4b0('0x2a')},'json':!![]};return rp(_0x3e109f)[_0xc4b0('0x2b')](function(_0x31379f){accountsTokens[_0x548399['id']]={'access_token':_0x31379f[_0xc4b0('0x1e')],'expires_in':moment()[_0xc4b0('0x2c')](_0x31379f['expires_in'],_0xc4b0('0x2d'))};_0x275641(_0x31379f[_0xc4b0('0x1e')]);})[_0xc4b0('0x2e')](function(_0xcc5e4e){logger[_0xc4b0('0x2f')](_0xc4b0('0x30'),_0xcc5e4e[_0xc4b0('0x31')]);_0xdd43b8(_0xcc5e4e);});});}function getUser(_0x245f6f,_0x1b1228,_0x45b88c,_0x278ca7){logger[_0xc4b0('0x32')](_0xc4b0('0x33'));return request({'method':'GET','uri':util[_0xc4b0('0x34')](_0xc4b0('0x35'),_0x1b1228),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xc4b0('0x36')+_0x245f6f},'json':!![]})[_0xc4b0('0x2b')](function(_0x5219cc){if(_0x5219cc['users']){var _0xcdf329=-0x1;if(_[_0xc4b0('0x37')](_0x5219cc[_0xc4b0('0x38')])){if(!_[_0xc4b0('0x1d')](_0x278ca7)){_0xcdf329=_[_0xc4b0('0x39')](_0x5219cc['users'],function(_0x4b89a0){return _0x4b89a0['email']===_0x278ca7;});}if(_0xcdf329>=0x0){logger[_0xc4b0('0x32')](_0xc4b0('0x3a'));}else{logger['info'](_0xc4b0('0x3b'));_0xcdf329=_[_0xc4b0('0x39')](_0x5219cc[_0xc4b0('0x38')],function(_0x46bcbd){return _0x46bcbd[_0xc4b0('0x3c')][_0xc4b0('0x1a')]==='Administrator';});}return _0x5219cc[_0xc4b0('0x38')][_0xcdf329];}else{if(_0x5219cc[_0xc4b0('0x3d')][_0xc4b0('0x3c')][_0xc4b0('0x1a')]===_0xc4b0('0x3e')){logger[_0xc4b0('0x32')]('Using\x20the\x20admin\x20account!');user=_0x5219cc[_0xc4b0('0x3d')];return user;}else{logger[_0xc4b0('0x2f')]('The\x20failing\x20result\x20is',JSON[_0xc4b0('0x10')](_0x5219cc));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xc4b0('0x10')](_0x5219cc));}}}else{logger[_0xc4b0('0x2f')](_0xc4b0('0x3f'),JSON[_0xc4b0('0x10')](_0x5219cc));throw new Error(_0xc4b0('0x40')+JSON[_0xc4b0('0x10')](_0x5219cc));}})[_0xc4b0('0x2e')](function(_0x1f68f3){console[_0xc4b0('0x2f')](_0x1f68f3);});}function getZohoUser(_0x4d809f,_0x4d6a4a){return new BPromise(function(_0x6d8d84,_0x156e99){request(_0x4d809f)[_0xc4b0('0x2b')](function(_0x2516f0){var _0x22c9b9=null;if(_0x2516f0){_0x22c9b9=_0x2516f0[_0xc4b0('0x41')][0x0];_0x22c9b9[_0xc4b0('0x42')]=_0x4d6a4a;}_0x6d8d84(_0x22c9b9);})[_0xc4b0('0x2e')](function(_0x379eff){_0x156e99(_0x379eff);});});}function createEndUser(_0xf95cf2,_0x1bb8eb,_0x17bf8c,_0x4ab737,_0x246f35,_0x1c2e03){var _0x17bf8c=getName(_0x17bf8c);return request({'method':'POST','uri':_0xc4b0('0x43')+_0x1bb8eb+_0xc4b0('0x44')+_['startCase'](_0x1c2e03[_0xc4b0('0x45')])+'s','body':{'data':[{'Last_Name':_0x17bf8c[0x1],'First_Name':_0x17bf8c[0x0],'Phone':_0x4ab737,'Owner':{'name':!_['isNil'](_0x246f35['role'][_0xc4b0('0x1a')])?_0x246f35['role'][_0xc4b0('0x1a')]:!_[_0xc4b0('0x1d')](_0x246f35['first_name'])?_0x246f35[_0xc4b0('0x46')]+'\x20'+_0x246f35[_0xc4b0('0x47')]:_0x246f35[_0xc4b0('0x47')],'id':_0x246f35['id']}}]},'headers':{'Authorization':_0xc4b0('0x36')+_0xf95cf2},'json':!![]})['then'](function(_0x3d5f67){if(_0x3d5f67&&_0x3d5f67['data'][0x0][_0xc4b0('0x48')]===_0xc4b0('0x49')){var _0x48bf7e=_0x3d5f67[_0xc4b0('0x41')][0x0][_0xc4b0('0x4a')];_0x48bf7e[_0xc4b0('0x42')]=_[_0xc4b0('0x4b')](_0x1c2e03[_0xc4b0('0x45')])+'s';return _0x48bf7e;}logger[_0xc4b0('0x2f')](_0xc4b0('0x3f'),JSON['stringify'](data));throw new Error(_0xc4b0('0x4c')+JSON['stringify'](data));})[_0xc4b0('0x2e')](function(_0x3aa480){console['log'](_0xc4b0('0x4d'),_0x3aa480);});}function getEndUser(_0x3e762a,_0x13a0af,_0x49bf3e,_0x4767a0,_0x2f3af0,_0x3ede05,_0x4fbc85){var _0x2792d9={'method':'GET','uri':'','headers':{'Authorization':_0xc4b0('0x36')+_0x3e762a},'json':!![]};switch(_0x4fbc85[_0xc4b0('0x4e')]){case'contact_lead':_0x2792d9['uri']=_0xc4b0('0x43')+_0x13a0af+_0xc4b0('0x4f')+_0x2f3af0+'))';return getZohoUser(_0x2792d9,_0xc4b0('0x50'))['then'](function(_0x5c5784){if(_0x5c5784)return _0x5c5784;_0x2792d9[_0xc4b0('0x51')]=_0xc4b0('0x43')+_0x13a0af+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x2f3af0+'))';return getZohoUser(_0x2792d9,_0xc4b0('0x52'))['then'](function(_0x4a982b){if(_0x4a982b)return _0x4a982b;if(_0x4fbc85[_0xc4b0('0x45')]!=_0xc4b0('0x53')){return createEndUser(_0x3e762a,_0x13a0af,_0x4767a0,_0x2f3af0,_0x3ede05,_0x4fbc85);}else{return{};}});});break;case _0xc4b0('0x54'):_0x2792d9['uri']='https://www.zohoapis.'+_0x13a0af+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x2f3af0+'))';return getZohoUser(_0x2792d9,_0xc4b0('0x50'))['then'](function(_0x28fcd9){if(_0x28fcd9)return _0x28fcd9;if(_0x4fbc85[_0xc4b0('0x45')]!=_0xc4b0('0x53')){return createEndUser(_0x3e762a,_0x13a0af,_0x4767a0,_0x2f3af0,_0x3ede05,_0x4fbc85);}else{return{};}});break;case _0xc4b0('0x55'):_0x2792d9['uri']='https://www.zohoapis.'+_0x13a0af+_0xc4b0('0x56')+_0x2f3af0+'))';return getZohoUser(_0x2792d9,'Leads')[_0xc4b0('0x2b')](function(_0x4ba94d){if(_0x4ba94d)return _0x4ba94d;if(_0x4fbc85['moduleCreate']!=_0xc4b0('0x53')){return createEndUser(_0x3e762a,_0x13a0af,_0x4767a0,_0x2f3af0,_0x3ede05,_0x4fbc85);}else{return{};}});break;}}function getCall(_0x1131f3,_0x3de769,_0x31e92f,_0x382314,_0x7bc1d9,_0x1e7bf2,_0x571c7f,_0x22a544){logger['info'](_0xc4b0('0x57'));var _0x912c9e={};_0x912c9e[_0xc4b0('0x58')]={'name':!_[_0xc4b0('0x1d')](_0x382314['role']['name'])&&!_[_0xc4b0('0x1d')](_0x382314[_0xc4b0('0x3c')][_0xc4b0('0x1a')])&&_0x382314[_0xc4b0('0x3c')][_0xc4b0('0x1a')]===_0xc4b0('0x59')?_0x382314[_0xc4b0('0x5a')][_0xc4b0('0x1a')]:!_['isNil'](_0x382314['first_name'])?_0x382314[_0xc4b0('0x46')]+'\x20'+_0x382314[_0xc4b0('0x47')]:_0x382314[_0xc4b0('0x47')],'id':_0x382314['id']};_0x912c9e[_0xc4b0('0x5b')]=intUtil['getString'](_0x1e7bf2[_0xc4b0('0x5c')],_0x571c7f,'\x20');_0x912c9e[_0xc4b0('0x5d')]=intUtil['getString'](_0x1e7bf2['Descriptions'],_0x571c7f,'\x0a');if(_0x7bc1d9['enduserType']==='Contacts'){_0x912c9e['Who_Id']={'name':!_[_0xc4b0('0x1d')](_0x7bc1d9[_0xc4b0('0x5e')])?_0x7bc1d9[_0xc4b0('0x5e')]:!_[_0xc4b0('0x1d')](_0x7bc1d9['First_Name'])?_0x7bc1d9[_0xc4b0('0x5f')]+'\x20'+_0x7bc1d9[_0xc4b0('0x60')]:_0x7bc1d9[_0xc4b0('0x60')],'id':_0x7bc1d9['id']};}if(_0x7bc1d9[_0xc4b0('0x42')]==='Leads'){_0x912c9e[_0xc4b0('0x61')]={'name':!_['isNil'](_0x7bc1d9['Full_Name'])?_0x7bc1d9['Full_Name']:!_[_0xc4b0('0x1d')](_0x7bc1d9['First_Name'])?_0x7bc1d9[_0xc4b0('0x5f')]+'\x20'+_0x7bc1d9['Last_Name']:_0x7bc1d9[_0xc4b0('0x60')],'id':_0x7bc1d9['id']};_0x912c9e[_0xc4b0('0x62')]=_[_0xc4b0('0x4b')](_0x7bc1d9[_0xc4b0('0x42')]);}if(_0x571c7f['talktime']){_0x912c9e[_0xc4b0('0x63')]=moment[_0xc4b0('0x64')](parseInt(_0x571c7f[_0xc4b0('0x65')])*0x3e8)[_0xc4b0('0x34')]('mm:ss');}else if(_0x571c7f[_0xc4b0('0x66')]&&_0x571c7f[_0xc4b0('0x67')]){_0x912c9e[_0xc4b0('0x63')]=moment[_0xc4b0('0x64')](moment(_0x571c7f['endtime'],_0xc4b0('0x68'))[_0xc4b0('0x69')](moment(_0x571c7f['starttime'],_0xc4b0('0x68'))))[_0xc4b0('0x34')](_0xc4b0('0x6a'));}switch(_0x571c7f[_0xc4b0('0x6b')]){case _0xc4b0('0x6c'):_0x912c9e['Call_Result']='Called';break;case _0xc4b0('0x6d'):case'connect':_0x912c9e['Call_Result']='Answered';break;case'rejected':_0x912c9e['Call_Result']='Rejected';break;case'abandoned':_0x912c9e['Call_Result']=_0xc4b0('0x6e');break;case _0xc4b0('0x6f'):_0x912c9e[_0xc4b0('0x70')]=_0xc4b0('0x71');default:}_0x912c9e['Call_Start_Time']=(_0x22a544===_0xc4b0('0x72')?moment(_0x571c7f[_0xc4b0('0x73')])[_0xc4b0('0x34')](_0xc4b0('0x68')):moment(_0x571c7f['agentcalledAt'])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xc4b0('0x34')]('YYYY-MM-DDTHH:mm:ss');_0x912c9e[_0xc4b0('0x74')]=_0x22a544||_0xc4b0('0x75');_0x912c9e=_['merge'](_0x912c9e,getCustomFields(_0x1e7bf2[_0xc4b0('0x76')],_0x571c7f));return request({'method':_0xc4b0('0x25'),'uri':'https://www.zohoapis.'+_0x3de769+_0xc4b0('0x77'),'headers':{'Authorization':_0xc4b0('0x36')+_0x1131f3},'body':{'data':[_0x912c9e]},'json':!![]})[_0xc4b0('0x2b')](function(_0x34d8f8){if(_0x34d8f8&&_0x34d8f8[_0xc4b0('0x41')][0x0]['code']===_0xc4b0('0x49')){logger[_0xc4b0('0x32')]('Call\x20created!');return{'id':_0x34d8f8[_0xc4b0('0x41')][0x0][_0xc4b0('0x4a')]['id']};}})[_0xc4b0('0x2e')](function(_0x457f32){logger[_0xc4b0('0x32')]('err',_0x457f32[_0xc4b0('0x31')]);console[_0xc4b0('0x78')]('err',_0x457f32);});}exports[_0xc4b0('0x79')]=function(_0x2c374b,_0xdb7229,_0x468a06,_0x379a33,_0x2183a7,_0x426520){var _0xc4b6d7,_0x4e461b,_0x2587ce;_0x426520['host']=intUtil['stripTrailingSlash'](_0x426520[_0xc4b0('0x7a')]);_0x426520[_0xc4b0('0x7b')]=intUtil[_0xc4b0('0x7c')](_0x426520[_0xc4b0('0x7b')]);if(_0x2183a7&&_0x2183a7[_0xc4b0('0x7d')]){logger['info'](_0xc4b0('0x7e'),'Recording\x20is\x20enabled!');_0xdb7229[_0xc4b0('0x7f')]=_0x426520['serverUrl']+_0xc4b0('0x80')+_0xdb7229[_0xc4b0('0x81')]+_0xc4b0('0x82')+md5(_0xdb7229[_0xc4b0('0x81')]);}else{_0xdb7229[_0xc4b0('0x7f')]='';}var _0x31826d=_0x426520[_0xc4b0('0x7a')]==='zoho.eu'?'eu':_0xc4b0('0x83');return getAccessToken(_0x426520)[_0xc4b0('0x2b')](function(_0x3c83e){_0x2587ce=_0x3c83e;return getUser(_0x2587ce,_0x31826d,_0x426520,_0x379a33[_0xc4b0('0x84')]);})[_0xc4b0('0x2b')](function(_0x45bdc2){_0xc4b6d7=_0x45bdc2;logger['info'](_0xc4b0('0x85'),_0xc4b6d7['id']);return getEndUser(_0x2587ce,_0x31826d,_0x426520,_0xdb7229[_0xc4b0('0x86')],_0xdb7229[_0xc4b0('0x87')],_0xc4b6d7,_0x468a06);})[_0xc4b0('0x2b')](function(_0x4ce0d1){_0x4e461b=_0x4ce0d1;return getCall(_0x2587ce,_0x31826d,_0x426520,_0xc4b6d7,_0x4e461b,_0x468a06,_0xdb7229,_0xc4b0('0x75'));})[_0xc4b0('0x2b')](function(_0x44567e){if(_0x44567e){logger[_0xc4b0('0x32')](_0xc4b0('0x88'),_0x44567e['id']);logger[_0xc4b0('0x32')](_0xc4b0('0x7e'),_0xc4b0('0x89'));emit(util[_0xc4b0('0x34')]('user:%s',_0x379a33[_0xc4b0('0x1a')]),'trigger:browser:url',{'uri':'https://crm.'+_0x426520[_0xc4b0('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x44567e['id']});}})[_0xc4b0('0x2e')](function(_0x3c8c32){logger['error'](_0xc4b0('0x7e'),JSON['stringify'](_0x3c8c32));});};exports[_0xc4b0('0x72')]=function(_0x455034,_0x19b65e,_0x45cb9a,_0x203c00,_0x3d7921,_0x45bdef,_0x15eb29){var _0x589b2f,_0x3ad3fb,_0x3c4028;_0x45bdef['host']=intUtil[_0xc4b0('0x7c')](_0x45bdef[_0xc4b0('0x7a')]);_0x45bdef[_0xc4b0('0x7b')]=intUtil[_0xc4b0('0x7c')](_0x45bdef['serverUrl']);if(_0x15eb29&&_0x15eb29[_0xc4b0('0x8a')]&&_0x15eb29[_0xc4b0('0x8a')]!==_0xc4b0('0x8b')){logger['info'](_0xc4b0('0x8c'),'Recording\x20is\x20enabled!');_0x19b65e[_0xc4b0('0x7f')]=_0x45bdef['serverUrl']+_0xc4b0('0x80')+_0x19b65e[_0xc4b0('0x81')]+_0xc4b0('0x82')+md5(_0x19b65e[_0xc4b0('0x81')]);}var _0x40bc4d=_0x45bdef['host']===_0xc4b0('0x8d')?'eu':_0xc4b0('0x83');return getAccessToken(_0x45bdef)[_0xc4b0('0x2b')](function(_0x158a38){_0x3c4028=_0x158a38;return getUser(_0x3c4028,_0x40bc4d,_0x45bdef,_0x203c00[_0xc4b0('0x84')]);})['then'](function(_0x444a9c){_0x589b2f=_0x444a9c;logger[_0xc4b0('0x32')](_0xc4b0('0x85'),_0x589b2f['id']);return getEndUser(_0x3c4028,_0x40bc4d,_0x45bdef,_0x19b65e[_0xc4b0('0x8e')],_0x19b65e[_0xc4b0('0x8f')],_0x589b2f,_0x45cb9a);})[_0xc4b0('0x2b')](function(_0x1d830e){_0x3ad3fb=_0x1d830e;return getCall(_0x3c4028,_0x40bc4d,_0x45bdef,_0x589b2f,_0x3ad3fb,_0x45cb9a,_0x19b65e,'Outbound');})[_0xc4b0('0x2b')](function(_0x45d27b){if(_0x45d27b){logger['info'](_0xc4b0('0x88'),_0x45d27b['id']);logger['info']('[OUTBOUND]',_0xc4b0('0x89'));emit(util[_0xc4b0('0x34')](_0xc4b0('0x90'),_0x203c00[_0xc4b0('0x1a')]),_0xc4b0('0x91'),{'uri':'https://crm.'+_0x45bdef[_0xc4b0('0x7a')]+_0xc4b0('0x92')+_0x45d27b['id']});}})[_0xc4b0('0x2e')](function(_0x48316c){logger[_0xc4b0('0x2f')](_0xc4b0('0x8c'),JSON[_0xc4b0('0x10')](_0x48316c));});};exports[_0xc4b0('0x93')]=function(_0x481bfc,_0x11a770,_0x27bb8e,_0x2a51db,_0x3f86be,_0x1e56b6){var _0x2153e4,_0x5ba96f,_0x3ea648;_0x1e56b6[_0xc4b0('0x7a')]=intUtil['stripTrailingSlash'](_0x1e56b6['host']);_0x1e56b6[_0xc4b0('0x7b')]=intUtil['stripTrailingSlash'](_0x1e56b6[_0xc4b0('0x7b')]);if(_0x3f86be&&_0x3f86be[_0xc4b0('0x7d')]){logger[_0xc4b0('0x32')]('['+_0x11a770['lastevent'][_0xc4b0('0x94')]()+']',_0xc4b0('0x95'));_0x11a770['recordingURL']=_0x1e56b6[_0xc4b0('0x7b')]+_0xc4b0('0x80')+_0x11a770[_0xc4b0('0x81')]+_0xc4b0('0x82')+md5(_0x11a770[_0xc4b0('0x81')]);}else{_0x11a770['recordingURL']='';}var _0x391bea=_0x1e56b6[_0xc4b0('0x7a')]===_0xc4b0('0x8d')?'eu':_0xc4b0('0x83');return getAccessToken(_0x1e56b6)[_0xc4b0('0x2b')](function(_0x3aca39){_0x3ea648=_0x3aca39;return getUser(_0x3ea648,_0x391bea,_0x1e56b6);})['then'](function(_0x34fcbe){_0x2153e4=_0x34fcbe;logger['info'](_0xc4b0('0x85'),_0x2153e4['id']);return getEndUser(_0x3ea648,_0x391bea,_0x1e56b6,_0x11a770[_0xc4b0('0x86')],_0x11a770['calleridnum'],_0x2153e4,_0x27bb8e);})[_0xc4b0('0x2b')](function(_0x284fbf){_0x5ba96f=_0x284fbf;return getCall(_0x3ea648,_0x391bea,_0x1e56b6,_0x2153e4,_0x5ba96f,_0x27bb8e,_0x11a770,_0xc4b0('0x75'));})[_0xc4b0('0x2b')](function(_0x3694f){if(_0x3694f){logger['info'](_0xc4b0('0x88'),_0x3694f['id']);}})[_0xc4b0('0x2e')](function(_0xf984cc){logger[_0xc4b0('0x2f')]('['+_0x11a770[_0xc4b0('0x6b')][_0xc4b0('0x94')]()+']',JSON['stringify'](_0xf984cc));});}; \ No newline at end of file +var _0xa67b=['recordingURL','uniqueid','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://crm.','none','Recording\x20is\x20enabled!','/api/voice/recordings/','/downloads?type=uniqueid&token=','destcalleridname','destcalleridnum','Outbound','user:%s','trigger:browser:url','/crm/EntityInfo.do?module=Calls&id=','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','moment','bluebird','../../../../config/environment','zoho','defaults','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','string','picklist','type','idField','content','variableName','customVariable','Variable','name','toLowerCase','toString','access_token','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','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','isNil','findIndex','email','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','/crm/v2/','startCase','moduleCreate','role','first_name','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','GET','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','uri','https://www.zohoapis.','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','contact','nothing','Creating\x20new\x20call...','Owner','administrator','last_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','mm:ss','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]'];(function(_0xa0195,_0x1eac94){var _0x21755e=function(_0x4caccf){while(--_0x4caccf){_0xa0195['push'](_0xa0195['shift']());}};_0x21755e(++_0x1eac94);}(_0xa67b,0x14a));var _0xba67=function(_0x653c85,_0x2e09e2){_0x653c85=_0x653c85-0x0;var _0x1d6296=_0xa67b[_0x653c85];return _0x1d6296;};'use strict';var _=require(_0xba67('0x0'));var rp=require(_0xba67('0x1'));var md5=require(_0xba67('0x2'));var util=require(_0xba67('0x3'));var intUtil=require(_0xba67('0x4'));var moment=require(_0xba67('0x5'));var Redis=require('ioredis');var BPromise=require(_0xba67('0x6'));var config=require(_0xba67('0x7'));var logger=require('../../../../config/logger')(_0xba67('0x8'));config['redis']=_[_0xba67('0x9')](config[_0xba67('0xa')],{'host':_0xba67('0xb'),'port':0x18eb});var io=require(_0xba67('0xc'))(new Redis(config[_0xba67('0xa')]));function emit(_0x26e7f2,_0x1a3c93,_0x3fd8d5){io['to'](_0x26e7f2)[_0xba67('0xd')](_0x1a3c93,_0x3fd8d5);}function request(_0x507e0e){logger['debug'](_0xba67('0xe'),JSON[_0xba67('0xf')](_0x507e0e));return rp(_0x507e0e);}function getCustomFields(_0x573ce4,_0x358e5c){var _0x31dc86={};if(_0x573ce4['length']>0x0){_['forEach'](_0x573ce4,function(_0x221033){if(_['includes']([_0xba67('0x10'),_0xba67('0x11')],_0x221033[_0xba67('0x12')])&&_0x221033[_0xba67('0x13')]){_0x31dc86[_0x221033[_0xba67('0x13')]]=_0x221033[_0xba67('0x14')]['toString']();}else if(_0x221033[_0xba67('0x12')]==='variable'&&_0x221033[_0xba67('0x15')]&&_0x221033['idField']&&_0x358e5c[_0x221033['variableName']]){_0x31dc86[_0x221033[_0xba67('0x13')]]=_0x358e5c[_0x221033[_0xba67('0x15')]]['toString']();}else if(_0x221033['type']===_0xba67('0x16')&&_0x221033['Variable']&&_0x221033[_0xba67('0x17')][_0xba67('0x18')]&&_0x221033['idField']&&_0x358e5c[_0x221033[_0xba67('0x17')][_0xba67('0x18')][_0xba67('0x19')]()]){_0x31dc86[_0x221033[_0xba67('0x13')]]=_0x358e5c[_0x221033[_0xba67('0x17')][_0xba67('0x18')]['toLowerCase']()][_0xba67('0x1a')]();}});}return _0x31dc86;}function getName(_0x52e40a){if(_0x52e40a['indexOf']('\x20')>0x0){var _0x2cf2a5=_0x52e40a['split'](/ (.+)/);if(_0x2cf2a5[0x1]){return _0x2cf2a5;}}return[_0x52e40a,_0x52e40a];}var accountsTokens={};function getAccessToken(_0x300ccb){return new Promise(function(_0x32a706,_0x3e9c0b){if(!_['isNil'](accountsTokens[_0x300ccb['id']])&&!_['isNil'](accountsTokens[_0x300ccb['id']][_0xba67('0x1b')])){if(moment()['isBefore'](accountsTokens[_0x300ccb['id']][_0xba67('0x1c')])){_0x32a706(accountsTokens[_0x300ccb['id']][_0xba67('0x1b')]);}}var _0x5094de;switch(_0x300ccb[_0xba67('0x1d')]){case'US':_0x5094de=_0xba67('0x1e');break;case'AU':_0x5094de=_0xba67('0x1f');break;case'EU':_0x5094de=_0xba67('0x20');break;case'IN':_0x5094de=_0xba67('0x21');break;case'CN':_0x5094de=_0xba67('0x22');break;default:_0x5094de=_0xba67('0x20');break;}var _0x1140a7={'method':'POST','uri':_0x5094de+_0xba67('0x23'),'qs':{'refresh_token':_0x300ccb[_0xba67('0x24')],'client_id':_0x300ccb[_0xba67('0x25')],'client_secret':_0x300ccb[_0xba67('0x26')],'grant_type':_0xba67('0x27')},'json':!![]};return rp(_0x1140a7)[_0xba67('0x28')](function(_0x13dd5f){accountsTokens[_0x300ccb['id']]={'access_token':_0x13dd5f['access_token'],'expires_in':moment()[_0xba67('0x29')](_0x13dd5f[_0xba67('0x1c')],_0xba67('0x2a'))};_0x32a706(_0x13dd5f[_0xba67('0x1b')]);})[_0xba67('0x2b')](function(_0x2e9a62){logger[_0xba67('0x2c')](_0xba67('0x2d'),_0x2e9a62[_0xba67('0x2e')]);_0x3e9c0b(_0x2e9a62);});});}function getUser(_0x29d426,_0x46e600,_0x30d7d0,_0x458ff1){logger[_0xba67('0x2f')](_0xba67('0x30'));return request({'method':'GET','uri':util[_0xba67('0x31')](_0xba67('0x32'),_0x46e600),'qs':{'type':_0xba67('0x33')},'headers':{'Authorization':_0xba67('0x34')+_0x29d426},'json':!![]})[_0xba67('0x28')](function(_0x4c54d3){if(_0x4c54d3['users']){var _0x53fce7=-0x1;if(_[_0xba67('0x35')](_0x4c54d3[_0xba67('0x36')])){if(!_[_0xba67('0x37')](_0x458ff1)){_0x53fce7=_[_0xba67('0x38')](_0x4c54d3[_0xba67('0x36')],function(_0xe259a7){return _0xe259a7[_0xba67('0x39')]===_0x458ff1;});}if(_0x53fce7>=0x0){logger[_0xba67('0x2f')]('Agent\x20found!');}else{logger[_0xba67('0x2f')](_0xba67('0x3a'));_0x53fce7=_['findIndex'](_0x4c54d3['users'],function(_0x2a0d66){return _0x2a0d66[_0xba67('0x3b')][_0xba67('0x18')]===_0xba67('0x3c');});}return _0x4c54d3['users'][_0x53fce7];}else{if(_0x4c54d3[_0xba67('0x3d')]['profile'][_0xba67('0x18')]===_0xba67('0x3c')){logger[_0xba67('0x2f')](_0xba67('0x3a'));user=_0x4c54d3[_0xba67('0x3d')];return user;}else{logger[_0xba67('0x2c')](_0xba67('0x3e'),JSON[_0xba67('0xf')](_0x4c54d3));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xba67('0xf')](_0x4c54d3));}}}else{logger[_0xba67('0x2c')](_0xba67('0x3e'),JSON[_0xba67('0xf')](_0x4c54d3));throw new Error(_0xba67('0x3f')+JSON[_0xba67('0xf')](_0x4c54d3));}})['catch'](function(_0x62679e){console[_0xba67('0x2c')](_0x62679e);});}function getZohoUser(_0xbb9700,_0x519b71){return new BPromise(function(_0x486688,_0x1d90ec){request(_0xbb9700)[_0xba67('0x28')](function(_0x17ac79){var _0x1c2663=null;if(_0x17ac79){_0x1c2663=_0x17ac79[_0xba67('0x40')][0x0];_0x1c2663[_0xba67('0x41')]=_0x519b71;}_0x486688(_0x1c2663);})['catch'](function(_0x195939){_0x1d90ec(_0x195939);});});}function createEndUser(_0x4781d4,_0x356daf,_0x2f5a1f,_0x5f9bc,_0x448741,_0x178fd5){var _0x2f5a1f=getName(_0x2f5a1f);return request({'method':_0xba67('0x42'),'uri':'https://www.zohoapis.'+_0x356daf+_0xba67('0x43')+_[_0xba67('0x44')](_0x178fd5[_0xba67('0x45')])+'s','body':{'data':[{'Last_Name':_0x2f5a1f[0x1],'First_Name':_0x2f5a1f[0x0],'Phone':_0x5f9bc,'Owner':{'name':!_[_0xba67('0x37')](_0x448741[_0xba67('0x46')][_0xba67('0x18')])?_0x448741[_0xba67('0x46')][_0xba67('0x18')]:!_[_0xba67('0x37')](_0x448741[_0xba67('0x47')])?_0x448741[_0xba67('0x47')]+'\x20'+_0x448741['last_name']:_0x448741['last_name'],'id':_0x448741['id']}}]},'headers':{'Authorization':_0xba67('0x34')+_0x4781d4},'json':!![]})[_0xba67('0x28')](function(_0x1e937b){if(_0x1e937b&&_0x1e937b['data'][0x0][_0xba67('0x48')]===_0xba67('0x49')){var _0x3cb0b3=_0x1e937b['data'][0x0][_0xba67('0x4a')];_0x3cb0b3[_0xba67('0x41')]=_[_0xba67('0x44')](_0x178fd5[_0xba67('0x45')])+'s';return _0x3cb0b3;}logger[_0xba67('0x2c')](_0xba67('0x3e'),JSON[_0xba67('0xf')](data));throw new Error(_0xba67('0x4b')+JSON['stringify'](data));})['catch'](function(_0x2f2cdd){console[_0xba67('0x4c')](_0xba67('0x4d'),_0x2f2cdd);});}function getEndUser(_0x3729c8,_0x2b5b9e,_0x2c896f,_0x10c2ac,_0x1e04aa,_0x53ddae,_0x68ee67){var _0x32ff8a={'method':_0xba67('0x4e'),'uri':'','headers':{'Authorization':_0xba67('0x34')+_0x3729c8},'json':!![]};switch(_0x68ee67[_0xba67('0x4f')]){case _0xba67('0x50'):_0x32ff8a['uri']='https://www.zohoapis.'+_0x2b5b9e+_0xba67('0x51')+_0x1e04aa+'))';return getZohoUser(_0x32ff8a,_0xba67('0x52'))[_0xba67('0x28')](function(_0xc188e1){if(_0xc188e1)return _0xc188e1;_0x32ff8a[_0xba67('0x53')]=_0xba67('0x54')+_0x2b5b9e+_0xba67('0x55')+_0x1e04aa+'))';return getZohoUser(_0x32ff8a,_0xba67('0x56'))['then'](function(_0x108964){if(_0x108964)return _0x108964;if(_0x68ee67[_0xba67('0x45')]!='nothing'){return createEndUser(_0x3729c8,_0x2b5b9e,_0x10c2ac,_0x1e04aa,_0x53ddae,_0x68ee67);}else{return{};}});});break;case _0xba67('0x57'):_0x32ff8a[_0xba67('0x53')]=_0xba67('0x54')+_0x2b5b9e+_0xba67('0x51')+_0x1e04aa+'))';return getZohoUser(_0x32ff8a,_0xba67('0x52'))[_0xba67('0x28')](function(_0x12bf00){if(_0x12bf00)return _0x12bf00;if(_0x68ee67['moduleCreate']!='nothing'){return createEndUser(_0x3729c8,_0x2b5b9e,_0x10c2ac,_0x1e04aa,_0x53ddae,_0x68ee67);}else{return{};}});break;case'lead':_0x32ff8a[_0xba67('0x53')]=_0xba67('0x54')+_0x2b5b9e+_0xba67('0x55')+_0x1e04aa+'))';return getZohoUser(_0x32ff8a,_0xba67('0x56'))[_0xba67('0x28')](function(_0x5689df){if(_0x5689df)return _0x5689df;if(_0x68ee67['moduleCreate']!=_0xba67('0x58')){return createEndUser(_0x3729c8,_0x2b5b9e,_0x10c2ac,_0x1e04aa,_0x53ddae,_0x68ee67);}else{return{};}});break;}}function getCall(_0xf2b255,_0x57579a,_0x9a87cd,_0x13bb95,_0x521457,_0x440e08,_0x2d783,_0x11848b){logger[_0xba67('0x2f')](_0xba67('0x59'));var _0x169438={};_0x169438[_0xba67('0x5a')]={'name':!_[_0xba67('0x37')](_0x13bb95[_0xba67('0x46')][_0xba67('0x18')])&&!_[_0xba67('0x37')](_0x13bb95[_0xba67('0x3b')][_0xba67('0x18')])&&_0x13bb95[_0xba67('0x3b')]['name']===_0xba67('0x5b')?_0x13bb95['role'][_0xba67('0x18')]:!_[_0xba67('0x37')](_0x13bb95[_0xba67('0x47')])?_0x13bb95['first_name']+'\x20'+_0x13bb95[_0xba67('0x5c')]:_0x13bb95[_0xba67('0x5c')],'id':_0x13bb95['id']};_0x169438[_0xba67('0x5d')]=intUtil[_0xba67('0x5e')](_0x440e08[_0xba67('0x5f')],_0x2d783,'\x20');_0x169438[_0xba67('0x60')]=intUtil[_0xba67('0x5e')](_0x440e08[_0xba67('0x61')],_0x2d783,'\x0a');if(_0x521457['enduserType']===_0xba67('0x52')){_0x169438[_0xba67('0x62')]={'name':!_[_0xba67('0x37')](_0x521457[_0xba67('0x63')])?_0x521457[_0xba67('0x63')]:!_[_0xba67('0x37')](_0x521457[_0xba67('0x64')])?_0x521457['First_Name']+'\x20'+_0x521457['Last_Name']:_0x521457['Last_Name'],'id':_0x521457['id']};}if(_0x521457[_0xba67('0x41')]===_0xba67('0x56')){_0x169438['What_Id']={'name':!_[_0xba67('0x37')](_0x521457[_0xba67('0x63')])?_0x521457['Full_Name']:!_['isNil'](_0x521457[_0xba67('0x64')])?_0x521457[_0xba67('0x64')]+'\x20'+_0x521457[_0xba67('0x65')]:_0x521457['Last_Name'],'id':_0x521457['id']};_0x169438[_0xba67('0x66')]=_['startCase'](_0x521457[_0xba67('0x41')]);}if(_0x2d783[_0xba67('0x67')]){_0x169438['Call_Duration']=moment['utc'](parseInt(_0x2d783[_0xba67('0x67')])*0x3e8)['format'](_0xba67('0x68'));}else if(_0x2d783['answertime']&&_0x2d783[_0xba67('0x69')]){_0x169438['Call_Duration']=moment['utc'](moment(_0x2d783[_0xba67('0x69')],'YYYY-MM-DDTHH:mm:ss')[_0xba67('0x6a')](moment(_0x2d783[_0xba67('0x6b')],_0xba67('0x6c'))))[_0xba67('0x31')](_0xba67('0x68'));}switch(_0x2d783[_0xba67('0x6d')]){case _0xba67('0x6e'):_0x169438[_0xba67('0x6f')]=_0xba67('0x70');break;case _0xba67('0x71'):case _0xba67('0x72'):_0x169438['Call_Result']=_0xba67('0x73');break;case'rejected':_0x169438['Call_Result']='Rejected';break;case'abandoned':_0x169438[_0xba67('0x6f')]='Abandoned';break;case _0xba67('0x74'):_0x169438[_0xba67('0x6f')]='Timeout';default:}_0x169438[_0xba67('0x75')]=(_0x11848b===_0xba67('0x76')?moment(_0x2d783[_0xba67('0x6b')])[_0xba67('0x31')](_0xba67('0x6c')):moment(_0x2d783[_0xba67('0x77')])['format'](_0xba67('0x6c')))||moment()['format']('YYYY-MM-DDTHH:mm:ss');_0x169438[_0xba67('0x78')]=_0x11848b||_0xba67('0x79');_0x169438=_[_0xba67('0x7a')](_0x169438,getCustomFields(_0x440e08[_0xba67('0x7b')],_0x2d783));return request({'method':_0xba67('0x42'),'uri':_0xba67('0x54')+_0x57579a+_0xba67('0x7c'),'headers':{'Authorization':_0xba67('0x34')+_0xf2b255},'body':{'data':[_0x169438]},'json':!![]})[_0xba67('0x28')](function(_0x2487e2){if(_0x2487e2&&_0x2487e2[_0xba67('0x40')][0x0][_0xba67('0x48')]===_0xba67('0x49')){logger[_0xba67('0x2f')](_0xba67('0x7d'));return{'id':_0x2487e2['data'][0x0]['details']['id']};}})[_0xba67('0x2b')](function(_0xef7f8f){logger[_0xba67('0x2f')](_0xba67('0x7e'),_0xef7f8f[_0xba67('0x2e')]);console['log']('err',_0xef7f8f);});}exports['queue']=function(_0x1755b3,_0x220e66,_0x12f206,_0x578c9c,_0x132528,_0x1fca10){var _0x1caa9b,_0x56652d,_0x22616f;_0x1fca10['host']=intUtil[_0xba67('0x7f')](_0x1fca10[_0xba67('0x80')]);_0x1fca10[_0xba67('0x81')]=intUtil[_0xba67('0x7f')](_0x1fca10[_0xba67('0x81')]);if(_0x132528&&_0x132528[_0xba67('0x82')]){logger[_0xba67('0x2f')](_0xba67('0x83'),'Recording\x20is\x20enabled!');_0x220e66[_0xba67('0x84')]=_0x1fca10['serverUrl']+'/api/voice/recordings/'+_0x220e66['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x220e66[_0xba67('0x85')]);}else{_0x220e66['recordingURL']='';}var _0x229ec1=_0x1fca10['host']===_0xba67('0x86')?'eu':_0xba67('0x87');return getAccessToken(_0x1fca10)[_0xba67('0x28')](function(_0x3c9cf7){_0x22616f=_0x3c9cf7;return getUser(_0x22616f,_0x229ec1,_0x1fca10,_0x578c9c[_0xba67('0x39')]);})[_0xba67('0x28')](function(_0x51a580){_0x1caa9b=_0x51a580;logger['info'](_0xba67('0x88'),_0x1caa9b['id']);return getEndUser(_0x22616f,_0x229ec1,_0x1fca10,_0x220e66[_0xba67('0x89')],_0x220e66[_0xba67('0x8a')],_0x1caa9b,_0x12f206);})[_0xba67('0x28')](function(_0x1c3783){_0x56652d=_0x1c3783;return getCall(_0x22616f,_0x229ec1,_0x1fca10,_0x1caa9b,_0x56652d,_0x12f206,_0x220e66,_0xba67('0x79'));})[_0xba67('0x28')](function(_0x167be3){if(_0x167be3){logger[_0xba67('0x2f')](_0xba67('0x8b'),_0x167be3['id']);logger[_0xba67('0x2f')](_0xba67('0x83'),_0xba67('0x8c'));emit(util[_0xba67('0x31')]('user:%s',_0x578c9c[_0xba67('0x18')]),'trigger:browser:url',{'uri':_0xba67('0x8d')+_0x1fca10[_0xba67('0x80')]+'/crm/EntityInfo.do?module=Calls&id='+_0x167be3['id']});}})[_0xba67('0x2b')](function(_0x21965d){logger['error'](_0xba67('0x83'),JSON['stringify'](_0x21965d));});};exports[_0xba67('0x76')]=function(_0x220538,_0x1a7ccc,_0x50f2ab,_0x18c7f2,_0x22b15a,_0x20e383,_0x4739d1){var _0x4848f3,_0x207d75,_0x584a8c;_0x20e383[_0xba67('0x80')]=intUtil['stripTrailingSlash'](_0x20e383[_0xba67('0x80')]);_0x20e383[_0xba67('0x81')]=intUtil[_0xba67('0x7f')](_0x20e383['serverUrl']);if(_0x4739d1&&_0x4739d1['recordingFormat']&&_0x4739d1['recordingFormat']!==_0xba67('0x8e')){logger['info']('[OUTBOUND]',_0xba67('0x8f'));_0x1a7ccc[_0xba67('0x84')]=_0x20e383[_0xba67('0x81')]+_0xba67('0x90')+_0x1a7ccc['uniqueid']+_0xba67('0x91')+md5(_0x1a7ccc[_0xba67('0x85')]);}var _0x1c8275=_0x20e383['host']===_0xba67('0x86')?'eu':'com';return getAccessToken(_0x20e383)['then'](function(_0x3bd285){_0x584a8c=_0x3bd285;return getUser(_0x584a8c,_0x1c8275,_0x20e383,_0x18c7f2['email']);})['then'](function(_0x3f41f0){_0x4848f3=_0x3f41f0;logger[_0xba67('0x2f')](_0xba67('0x88'),_0x4848f3['id']);return getEndUser(_0x584a8c,_0x1c8275,_0x20e383,_0x1a7ccc[_0xba67('0x92')],_0x1a7ccc[_0xba67('0x93')],_0x4848f3,_0x50f2ab);})[_0xba67('0x28')](function(_0x4cbe05){_0x207d75=_0x4cbe05;return getCall(_0x584a8c,_0x1c8275,_0x20e383,_0x4848f3,_0x207d75,_0x50f2ab,_0x1a7ccc,_0xba67('0x94'));})['then'](function(_0x544747){if(_0x544747){logger[_0xba67('0x2f')](_0xba67('0x8b'),_0x544747['id']);logger[_0xba67('0x2f')]('[OUTBOUND]',_0xba67('0x8c'));emit(util[_0xba67('0x31')](_0xba67('0x95'),_0x18c7f2[_0xba67('0x18')]),_0xba67('0x96'),{'uri':'https://crm.'+_0x20e383[_0xba67('0x80')]+_0xba67('0x97')+_0x544747['id']});}})[_0xba67('0x2b')](function(_0x3e771c){logger[_0xba67('0x2c')]('[OUTBOUND]',JSON[_0xba67('0xf')](_0x3e771c));});};exports[_0xba67('0x98')]=function(_0x575dcc,_0x7896c9,_0x53b144,_0x46abe9,_0x14fb83,_0x48551f){var _0x9f628e,_0x41017f,_0x4ef821;_0x48551f[_0xba67('0x80')]=intUtil[_0xba67('0x7f')](_0x48551f['host']);_0x48551f[_0xba67('0x81')]=intUtil[_0xba67('0x7f')](_0x48551f[_0xba67('0x81')]);if(_0x14fb83&&_0x14fb83['monitor_format']){logger[_0xba67('0x2f')]('['+_0x7896c9[_0xba67('0x6d')][_0xba67('0x99')]()+']',_0xba67('0x8f'));_0x7896c9[_0xba67('0x84')]=_0x48551f[_0xba67('0x81')]+_0xba67('0x90')+_0x7896c9[_0xba67('0x85')]+_0xba67('0x91')+md5(_0x7896c9[_0xba67('0x85')]);}else{_0x7896c9[_0xba67('0x84')]='';}var _0x278c11=_0x48551f['host']===_0xba67('0x86')?'eu':_0xba67('0x87');return getAccessToken(_0x48551f)['then'](function(_0x39073d){_0x4ef821=_0x39073d;return getUser(_0x4ef821,_0x278c11,_0x48551f);})[_0xba67('0x28')](function(_0x2d96d1){_0x9f628e=_0x2d96d1;logger[_0xba67('0x2f')](_0xba67('0x88'),_0x9f628e['id']);return getEndUser(_0x4ef821,_0x278c11,_0x48551f,_0x7896c9[_0xba67('0x89')],_0x7896c9[_0xba67('0x8a')],_0x9f628e,_0x53b144);})[_0xba67('0x28')](function(_0x326737){_0x41017f=_0x326737;return getCall(_0x4ef821,_0x278c11,_0x48551f,_0x9f628e,_0x41017f,_0x53b144,_0x7896c9,'Inbound');})[_0xba67('0x28')](function(_0x63b2ef){if(_0x63b2ef){logger[_0xba67('0x2f')]('The\x20Call\x20ID\x20is:',_0x63b2ef['id']);}})['catch'](function(_0x510d3f){logger[_0xba67('0x2c')]('['+_0x7896c9[_0xba67('0x6d')][_0xba67('0x99')]()+']',JSON[_0xba67('0xf')](_0x510d3f));});}; \ 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 f433081..2d42b3a 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 _0xdeec=['util','mustache','../../../../config/logger','trigger','exec','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x2088e1,_0x59bf32){var _0x412588=function(_0x3b04e0){while(--_0x3b04e0){_0x2088e1['push'](_0x2088e1['shift']());}};_0x412588(++_0x59bf32);}(_0xdeec,0x179));var _0xcdee=function(_0x5864b7,_0x59bdb5){_0x5864b7=_0x5864b7-0x0;var _0x5453c1=_0xdeec[_0x5864b7];return _0x5453c1;};'use strict';var util=require(_0xcdee('0x0'));var sh=require('shelljs');var Mustache=require(_0xcdee('0x1'));var logger=require(_0xcdee('0x2'))(_0xcdee('0x3'));exports[_0xcdee('0x4')]=function(_0x5dc826,_0x5118c4){var _0x1aeee1=_0x5dc826[_0xcdee('0x5')]?_0x5dc826['data2']:_0xcdee('0x6');var _0x30e13f=_0x5dc826[_0xcdee('0x7')]?Mustache[_0xcdee('0x8')](_0x5dc826[_0xcdee('0x7')],_0x5118c4):_0x5118c4;sh[_0xcdee('0x4')](_0x30e13f,function(_0x4afb5f,_0x310c2c,_0x170bd6){if(_0x4afb5f!==0x0){logger[_0xcdee('0x9')](util[_0xcdee('0xa')](_0xcdee('0xb'),_0x1aeee1,_0x30e13f,_0x4afb5f,_0x170bd6));}else{logger[_0xcdee('0xc')](util[_0xcdee('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x1aeee1,_0x30e13f,_0x310c2c));}});}; \ No newline at end of file +var _0x3864=['data2','Script','data3','render','exec','format','info','util','shelljs','mustache'];(function(_0x515cff,_0x4fb356){var _0x128bf4=function(_0x2805c1){while(--_0x2805c1){_0x515cff['push'](_0x515cff['shift']());}};_0x128bf4(++_0x4fb356);}(_0x3864,0xf7));var _0x4386=function(_0x330213,_0x1192d7){_0x330213=_0x330213-0x0;var _0x58e5e1=_0x3864[_0x330213];return _0x58e5e1;};'use strict';var util=require(_0x4386('0x0'));var sh=require(_0x4386('0x1'));var Mustache=require(_0x4386('0x2'));var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x3237df,_0x3feec3){var _0x24dacb=_0x3237df[_0x4386('0x3')]?_0x3237df[_0x4386('0x3')]:_0x4386('0x4');var _0x257058=_0x3237df[_0x4386('0x5')]?Mustache[_0x4386('0x6')](_0x3237df[_0x4386('0x5')],_0x3feec3):_0x3feec3;sh[_0x4386('0x7')](_0x257058,function(_0x2c7146,_0x36b49a,_0x4315cf){if(_0x2c7146!==0x0){logger['error'](util[_0x4386('0x8')]('%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s',_0x24dacb,_0x257058,_0x2c7146,_0x4315cf));}else{logger[_0x4386('0x9')](util['format']('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x24dacb,_0x257058,_0x36b49a));}});}; \ 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 a4a2ced..f484a1f 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 _0x70ed=['statusCode','message','request-promise','lodash','../../../../config/logger','exec','data1','toUpperCase','render','data2','data5','data6','parse','error','stack','GET','DELETE','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','format','stringify','then','isNil',',\x20request\x20body:\x20','object','info','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x4ed089,_0x5d4f26){var _0x4a0b02=function(_0x4ee6f8){while(--_0x4ee6f8){_0x4ed089['push'](_0x4ed089['shift']());}};_0x4a0b02(++_0x5d4f26);}(_0x70ed,0x1e2));var _0xd70e=function(_0x13342f,_0x3d6303){_0x13342f=_0x13342f-0x0;var _0x2fc1fc=_0x70ed[_0x13342f];return _0x2fc1fc;};'use strict';var rp=require(_0xd70e('0x0'));var util=require('util');var _=require(_0xd70e('0x1'));var Mustache=require('mustache');var logger=require(_0xd70e('0x2'))('trigger');exports[_0xd70e('0x3')]=function(_0x4eb721,_0x1b4d9f){var _0x5eeab6,_0x33361c;var _0x592202={'method':_0x4eb721[_0xd70e('0x4')][_0xd70e('0x5')](),'uri':Mustache[_0xd70e('0x6')](_0x4eb721[_0xd70e('0x7')],_0x1b4d9f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x4eb721[_0xd70e('0x8')])==='number'&&parseInt(_0x4eb721[_0xd70e('0x8')])>=0x1&&parseInt(_0x4eb721[_0xd70e('0x8')])<=0xa?parseInt(_0x4eb721[_0xd70e('0x8')])*0x3e8:0x5*0x3e8};try{_0x592202['headers']=_0x4eb721[_0xd70e('0x9')]?JSON[_0xd70e('0xa')](Mustache[_0xd70e('0x6')](_0x4eb721[_0xd70e('0x9')],_0x1b4d9f)):{};}catch(_0x6380da){logger[_0xd70e('0xb')](_0x6380da[_0xd70e('0xc')]);}switch(_0x4eb721[_0xd70e('0x4')][_0xd70e('0x5')]()){case _0xd70e('0xd'):case _0xd70e('0xe'):_0x5eeab6=null;_0x592202['qs']=_0x1b4d9f;break;case'POST':case'PUT':if(_0x4eb721['data7']){try{_0x5eeab6=JSON[_0xd70e('0xa')](Mustache[_0xd70e('0x6')](_0x4eb721[_0xd70e('0xf')],_0x1b4d9f));_0x592202[_0xd70e('0x10')]=_0x5eeab6;}catch(_0x18cf27){logger[_0xd70e('0xb')](_0x18cf27[_0xd70e('0xc')]);logger[_0xd70e('0xb')](_0xd70e('0x11'));}}else{_0x5eeab6=_0x1b4d9f;_0x592202[_0xd70e('0x10')]=_0x5eeab6;}break;}logger['info'](util[_0xd70e('0x12')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x4eb721[_0xd70e('0x4')],_0x4eb721[_0xd70e('0x7')],JSON[_0xd70e('0x13')](_0x592202)));rp(_0x592202)[_0xd70e('0x14')](function(_0x2b48ca){_0x5eeab6=!_[_0xd70e('0x15')](_0x5eeab6)?_0xd70e('0x16')+_0x5eeab6:'';_0x33361c=typeof _0x2b48ca[_0xd70e('0x10')]===_0xd70e('0x17')?JSON[_0xd70e('0x13')](_0x2b48ca[_0xd70e('0x10')]):_0x2b48ca[_0xd70e('0x10')];logger[_0xd70e('0x18')](util[_0xd70e('0x12')](_0xd70e('0x19'),_0x4eb721[_0xd70e('0x4')],_0x4eb721[_0xd70e('0x7')],_0x2b48ca['statusCode'],_0x33361c));})[_0xd70e('0x1a')](function(_0x3f200b){logger[_0xd70e('0xb')](util[_0xd70e('0x12')](_0xd70e('0x1b'),_0x4eb721[_0xd70e('0x4')],_0x4eb721[_0xd70e('0x7')],_0x3f200b[_0xd70e('0x1c')],_0x3f200b['name'],_0x3f200b[_0xd70e('0x1d')]));});}; \ No newline at end of file +var _0x95ad=['object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','request-promise','util','lodash','mustache','../../../../config/logger','data1','toUpperCase','render','data5','number','headers','parse','data6','stack','GET','DELETE','POST','PUT','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20'];(function(_0x44bfb4,_0x2010d8){var _0x4e38c1=function(_0x559cd2){while(--_0x559cd2){_0x44bfb4['push'](_0x44bfb4['shift']());}};_0x4e38c1(++_0x2010d8);}(_0x95ad,0xaf));var _0xd95a=function(_0x5a0491,_0x3cfad9){_0x5a0491=_0x5a0491-0x0;var _0x3664cd=_0x95ad[_0x5a0491];return _0x3664cd;};'use strict';var rp=require(_0xd95a('0x0'));var util=require(_0xd95a('0x1'));var _=require(_0xd95a('0x2'));var Mustache=require(_0xd95a('0x3'));var logger=require(_0xd95a('0x4'))('trigger');exports['exec']=function(_0x2c132a,_0x59771a){var _0x4f6936,_0x38a722;var _0xe72701={'method':_0x2c132a[_0xd95a('0x5')][_0xd95a('0x6')](),'uri':Mustache[_0xd95a('0x7')](_0x2c132a['data2'],_0x59771a),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2c132a[_0xd95a('0x8')])===_0xd95a('0x9')&&parseInt(_0x2c132a[_0xd95a('0x8')])>=0x1&&parseInt(_0x2c132a[_0xd95a('0x8')])<=0xa?parseInt(_0x2c132a['data5'])*0x3e8:0x5*0x3e8};try{_0xe72701[_0xd95a('0xa')]=_0x2c132a['data6']?JSON[_0xd95a('0xb')](Mustache[_0xd95a('0x7')](_0x2c132a[_0xd95a('0xc')],_0x59771a)):{};}catch(_0xd8ba39){logger['error'](_0xd8ba39[_0xd95a('0xd')]);}switch(_0x2c132a['data1'][_0xd95a('0x6')]()){case _0xd95a('0xe'):case _0xd95a('0xf'):_0x4f6936=null;_0xe72701['qs']=_0x59771a;break;case _0xd95a('0x10'):case _0xd95a('0x11'):if(_0x2c132a['data7']){try{_0x4f6936=JSON[_0xd95a('0xb')](Mustache['render'](_0x2c132a['data7'],_0x59771a));_0xe72701[_0xd95a('0x12')]=_0x4f6936;}catch(_0x1b9e62){logger[_0xd95a('0x13')](_0x1b9e62[_0xd95a('0xd')]);logger[_0xd95a('0x13')](_0xd95a('0x14'));}}else{_0x4f6936=_0x59771a;_0xe72701[_0xd95a('0x12')]=_0x4f6936;}break;}logger[_0xd95a('0x15')](util[_0xd95a('0x16')](_0xd95a('0x17'),_0x2c132a[_0xd95a('0x5')],_0x2c132a[_0xd95a('0x18')],JSON[_0xd95a('0x19')](_0xe72701)));rp(_0xe72701)[_0xd95a('0x1a')](function(_0x5e2a17){_0x4f6936=!_[_0xd95a('0x1b')](_0x4f6936)?_0xd95a('0x1c')+_0x4f6936:'';_0x38a722=typeof _0x5e2a17[_0xd95a('0x12')]===_0xd95a('0x1d')?JSON['stringify'](_0x5e2a17[_0xd95a('0x12')]):_0x5e2a17['body'];logger['info'](util[_0xd95a('0x16')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x2c132a[_0xd95a('0x5')],_0x2c132a[_0xd95a('0x18')],_0x5e2a17['statusCode'],_0x38a722));})[_0xd95a('0x1e')](function(_0xb4e2dd){logger['error'](util[_0xd95a('0x16')](_0xd95a('0x1f'),_0x2c132a[_0xd95a('0x5')],_0x2c132a[_0xd95a('0x18')],_0xb4e2dd[_0xd95a('0x20')],_0xb4e2dd[_0xd95a('0x21')],_0xb4e2dd['message']));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 70c722b..e9dbd75 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 _0xafe8=['rpc','routing','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafe8,0x1b7));var _0x8afe=function(_0xc8a02c,_0x4809d3){_0xc8a02c=_0xc8a02c-0x0;var _0x3d89da=_0xafe8[_0xc8a02c];return _0x3d89da;};'use strict';var jayson=require(_0x8afe('0x0'));var BPromise=require(_0x8afe('0x1'));var logger=require(_0x8afe('0x2'))('routing');var client=jayson[_0x8afe('0x3')][_0x8afe('0x4')]({'port':0x2329});client[_0x8afe('0x5')]=function(_0x142c5b,_0x24bf40){return new BPromise(function(_0x4552e5,_0x559025){return client[_0x8afe('0x6')](_0x142c5b,_0x24bf40)[_0x8afe('0x7')](function(_0x367ddc){logger[_0x8afe('0x8')](_0x8afe('0x9'),_0x8afe('0xa'),_0x142c5b,_0x24bf40,_0x367ddc);if(_0x367ddc[_0x8afe('0xb')]){logger[_0x8afe('0xb')]('rpc',_0x8afe('0xa'),_0x142c5b,_0x367ddc['error'][_0x8afe('0xc')],_0x24bf40);return _0x559025(_0x367ddc['error']['message']);}else{return _0x4552e5(_0x367ddc[_0x8afe('0xd')]);}})[_0x8afe('0xe')](function(_0x208570){logger[_0x8afe('0xb')](_0x8afe('0x9'),_0x8afe('0xa'),_0x142c5b,_0x208570,_0x24bf40);return _0x559025(_0x208570);});});};module[_0x8afe('0xf')]=client; \ No newline at end of file +var _0x5e67=['debug','rpc','error','result','exports','jayson/promise','bluebird','routing','client','request','then'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x5e67,0x191));var _0x75e6=function(_0x206037,_0x4ddf97){_0x206037=_0x206037-0x0;var _0x58b1e9=_0x5e67[_0x206037];return _0x58b1e9;};'use strict';var jayson=require(_0x75e6('0x0'));var BPromise=require(_0x75e6('0x1'));var logger=require('../../config/logger')(_0x75e6('0x2'));var client=jayson[_0x75e6('0x3')]['http']({'port':0x2329});client['Request']=function(_0x12b51b,_0x503cb3){return new BPromise(function(_0xd3be94,_0x3cb2f4){return client[_0x75e6('0x4')](_0x12b51b,_0x503cb3)[_0x75e6('0x5')](function(_0x397bc2){logger[_0x75e6('0x6')](_0x75e6('0x7'),_0x75e6('0x2'),_0x12b51b,_0x503cb3,_0x397bc2);if(_0x397bc2[_0x75e6('0x8')]){logger[_0x75e6('0x8')]('rpc',_0x75e6('0x2'),_0x12b51b,_0x397bc2['error']['message'],_0x503cb3);return _0x3cb2f4(_0x397bc2['error']['message']);}else{return _0xd3be94(_0x397bc2[_0x75e6('0x9')]);}})['catch'](function(_0x1892e9){logger[_0x75e6('0x8')](_0x75e6('0x7'),_0x75e6('0x2'),_0x12b51b,_0x1892e9,_0x503cb3);return _0x3cb2f4(_0x1892e9);});});};module[_0x75e6('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 8f51fd8..3616f2d 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 _0x9095=['mailAccounts','getSettings','loginMailFrequency','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve','then','initMailAccounts','refresh'];(function(_0x4f12d1,_0x25c655){var _0x35a2bb=function(_0x24b4f5){while(--_0x24b4f5){_0x4f12d1['push'](_0x4f12d1['shift']());}};_0x35a2bb(++_0x25c655);}(_0x9095,0x161));var _0x5909=function(_0x3e6729,_0x16d4af){_0x3e6729=_0x3e6729-0x0;var _0x535bcd=_0x9095[_0x3e6729];return _0x535bcd;};'use strict';var server=require(_0x5909('0x0'));var Realtime=require(_0x5909('0x1'));var EmailChannel=require(_0x5909('0x2'));var mailAccount=require(_0x5909('0x3'));var setting=require(_0x5909('0x4'));var logger=require(_0x5909('0x5'))(_0x5909('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x5909('0x7')]()['then'](mailAccount['getMailAccounts']())[_0x5909('0x8')](realtime[_0x5909('0x9')]())['then'](function(){email[_0x5909('0xa')](realtime[_0x5909('0xb')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x5909('0x8')](function(){return initRealtime();})[_0x5909('0x8')](function(){return setting[_0x5909('0xc')]();})[_0x5909('0x8')](function(_0x1138b0){return setInterval(initRealtime,_0x1138b0[_0x5909('0xd')]*0x3e8);})['catch'](function(_0x432f60){logger['error']('Email\x20service\x20initialization',_0x432f60);});}main(); \ No newline at end of file +var _0x6a7e=['listen','loginMailFrequency','catch','Email\x20service\x20initialization','./server','./realtime','./lib/email','./rpc/setting','../../config/logger','resolve','getMailAccounts','initMailAccounts','then','refresh'];(function(_0x1a957b,_0x3a5dca){var _0x2b79f4=function(_0x113582){while(--_0x113582){_0x1a957b['push'](_0x1a957b['shift']());}};_0x2b79f4(++_0x3a5dca);}(_0x6a7e,0x138));var _0xe6a7=function(_0x50507f,_0x5e29e9){_0x50507f=_0x50507f-0x0;var _0x242b06=_0x6a7e[_0x50507f];return _0x242b06;};'use strict';var server=require(_0xe6a7('0x0'));var Realtime=require(_0xe6a7('0x1'));var EmailChannel=require(_0xe6a7('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require(_0xe6a7('0x3'));var logger=require(_0xe6a7('0x4'))('email');var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe6a7('0x5')]()['then'](mailAccount[_0xe6a7('0x6')]())['then'](realtime[_0xe6a7('0x7')]())[_0xe6a7('0x8')](function(){email[_0xe6a7('0x9')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0xe6a7('0xa')](realtime,email)[_0xe6a7('0x8')](function(){return initRealtime();})['then'](function(){return setting['getSettings']();})[_0xe6a7('0x8')](function(_0x5d1e53){return setInterval(initRealtime,_0x5d1e53[_0xe6a7('0xb')]*0x3e8);})[_0xe6a7('0xc')](function(_0x130c98){logger['error'](_0xe6a7('0xd'),_0x130c98);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 0bc69f7..e03068a 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 _0xda0d=['bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','status','messageStatus','Imap','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','custom','service','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','disabled','connected','name','messages','total','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','lodash','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xda0d,0x125));var _0xdda0=function(_0x32da48,_0x485299){_0x32da48=_0x32da48-0x0;var _0x181fc0=_0xda0d[_0x32da48];return _0x181fc0;};'use strict';var _=require(_0xdda0('0x0'));var moment=require(_0xdda0('0x1'));var BPromise=require(_0xdda0('0x2'));var md5=require(_0xdda0('0x3'));var Redis=require(_0xdda0('0x4'));var config=require(_0xdda0('0x5'));var logger=require(_0xdda0('0x6'))(_0xdda0('0x7'));config[_0xdda0('0x8')]=_[_0xdda0('0x9')](config[_0xdda0('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xdda0('0xa'))(new Redis(config['redis']));var EmailImap=require(_0xdda0('0xb'));var EmailSmtp=require(_0xdda0('0xc'));var mailAccount=require(_0xdda0('0xd'));var md5Accounts={};function EmailChannel(_0x32fb1c){logger[_0xdda0('0xe')](_0xdda0('0xf'));this[_0xdda0('0x10')]=_0x32fb1c[_0xdda0('0x10')];this[_0xdda0('0x11')]={};this[_0xdda0('0x12')]=new EmailSmtp();}EmailChannel[_0xdda0('0x13')][_0xdda0('0x14')]=function(_0x346d3f){var _0x129e56=this[_0xdda0('0x10')][_0x346d3f];var _0x59445a={'id':_0x129e56['id'],'name':_0x129e56['name'],'key':_0x129e56[_0xdda0('0x15')],'active':_0x129e56[_0xdda0('0x16')],'Imap':{'status':_0x129e56['Imap'][_0xdda0('0x17')],'messageStatus':_0x129e56['Imap'][_0xdda0('0x18')],'total':_0x129e56[_0xdda0('0x19')]['total']}};if(_[_0xdda0('0x1a')](md5Accounts[_0x346d3f])){md5Accounts[_0x346d3f]={};}var _0x164121=md5(JSON[_0xdda0('0x1b')](_0x59445a));if(md5Accounts[_0x346d3f][_0xdda0('0x3')]!==_0x164121){md5Accounts[_0x346d3f]['md5']=_0x164121;io[_0xdda0('0x14')](_0xdda0('0x1c'),_0x59445a);}};EmailChannel[_0xdda0('0x13')][_0xdda0('0x1d')]=function(_0x48dbec){for(var _0x38cad0 in _0x48dbec){if(_0x48dbec[_0xdda0('0x1e')](_0x38cad0)){if(_0x48dbec[_0x38cad0][_0xdda0('0x19')]&&_0x48dbec[_0x38cad0]['active']){var _0x263deb=_0x48dbec[_0x38cad0][_0xdda0('0x19')];if(!_0x263deb['service']&&_0x48dbec[_0x38cad0]['provider']!==_0xdda0('0x1f'))_0x263deb[_0xdda0('0x20')]=_0x48dbec[_0x38cad0]['provider'];if(!this[_0xdda0('0x11')][_0xdda0('0x1e')](_0x263deb['id'])){this[_0xdda0('0x11')][_0x263deb['id']]=new EmailImap(_0x263deb,_0x48dbec[_0x38cad0]['email']);this[_0xdda0('0x11')][_0x263deb['id']]['on']('box',this[_0xdda0('0x21')][_0xdda0('0x22')](this,_0x38cad0));this[_0xdda0('0x11')][_0x263deb['id']]['on'](_0xdda0('0x7'),this[_0xdda0('0x23')][_0xdda0('0x22')](this,_0x38cad0));this['imapAccounts'][_0x263deb['id']]['on'](_0xdda0('0x24'),this[_0xdda0('0x25')][_0xdda0('0x22')](this,_0x38cad0));this[_0xdda0('0x11')][_0x263deb['id']]['on']('error',this[_0xdda0('0x26')][_0xdda0('0x22')](this,_0x38cad0));}}else{if(_[_0xdda0('0x1a')](this[_0xdda0('0x10')][_0x38cad0][_0xdda0('0x19')])){this[_0xdda0('0x10')][_0x38cad0][_0xdda0('0x19')]={};}this[_0xdda0('0x10')][_0x38cad0][_0xdda0('0x19')][_0xdda0('0x17')]=_0xdda0('0x27');this[_0xdda0('0x10')][_0x38cad0][_0xdda0('0x19')][_0xdda0('0x18')]='';this['emit'](_0x38cad0);}}}};EmailChannel[_0xdda0('0x13')]['handleImapBox']=function(_0x2c6aa6,_0x31d267){if(this['mailAccounts'][_0x2c6aa6]){this['mailAccounts'][_0x2c6aa6][_0xdda0('0x19')][_0xdda0('0x17')]=_0xdda0('0x28');this[_0xdda0('0x10')][_0x2c6aa6]['Imap']['messageStatus']=_0x31d267[_0xdda0('0x29')];if(_0x31d267[_0xdda0('0x2a')]){this[_0xdda0('0x10')][_0x2c6aa6][_0xdda0('0x19')][_0xdda0('0x2b')]=_0x31d267[_0xdda0('0x2a')][_0xdda0('0x2b')];}return this['emit'](_0x2c6aa6);}};EmailChannel['prototype']['handleImapEmail']=function(_0x53b93e,_0x280973){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x280973['firstName'],_0x280973[_0xdda0('0x2c')],_0x280973[_0xdda0('0x2d')],_0x53b93e);if(this[_0xdda0('0x10')][_0x53b93e]){return mailAccount[_0xdda0('0x2e')](_0x53b93e,_0x280973)[_0xdda0('0x2f')](function(_0x37e2c1){if(_0x37e2c1){logger[_0xdda0('0xe')](_0xdda0('0x30'));}})[_0xdda0('0x31')](function(_0x34dda6){logger[_0xdda0('0x32')](_0xdda0('0x33'),JSON['stringify'](_0x34dda6));});}};EmailChannel[_0xdda0('0x13')]['handleImapEnd']=function(_0x129a22){if(this[_0xdda0('0x10')][_0x129a22]&&this[_0xdda0('0x10')][_0x129a22][_0xdda0('0x19')]){if(this['imapAccounts'][this[_0xdda0('0x10')][_0x129a22][_0xdda0('0x19')]['id']]){delete this['imapAccounts'][this[_0xdda0('0x10')][_0x129a22][_0xdda0('0x19')]['id']];}this[_0xdda0('0x10')][_0x129a22][_0xdda0('0x19')][_0xdda0('0x34')]=moment();this[_0xdda0('0x14')](_0x129a22);}};EmailChannel['prototype'][_0xdda0('0x26')]=function(_0x7aba5f,_0x3c611e){if(this[_0xdda0('0x10')][_0x7aba5f]){this[_0xdda0('0x10')][_0x7aba5f][_0xdda0('0x19')][_0xdda0('0x17')]=_0xdda0('0x32');this[_0xdda0('0x10')][_0x7aba5f][_0xdda0('0x19')][_0xdda0('0x18')]=_0x3c611e;return this['emit'](_0x7aba5f);}};EmailChannel[_0xdda0('0x13')][_0xdda0('0x35')]=function(_0xb488ef,_0x323209){return this[_0xdda0('0x12')][_0xdda0('0x36')](_0xb488ef,_0x323209);};EmailChannel[_0xdda0('0x13')][_0xdda0('0x37')]=function(_0x3bc1fd){var _0x5eb1df=this;if(this[_0xdda0('0x10')][_0x3bc1fd['id']]){if(_[_0xdda0('0x1a')](this[_0xdda0('0x10')][_0x3bc1fd['id']][_0xdda0('0x38')])){this[_0xdda0('0x10')][_0x3bc1fd['id']][_0xdda0('0x38')]={};}this[_0xdda0('0x10')][_0x3bc1fd['id']][_0xdda0('0x38')][_0xdda0('0x34')]=moment();return new BPromise(function(_0x231b7f,_0x4f1a49){return _0x5eb1df[_0xdda0('0x12')][_0xdda0('0x39')](_0x3bc1fd)[_0xdda0('0x2f')](function(_0x401c6d){_0x5eb1df[_0xdda0('0x10')][_0x3bc1fd['id']]['Smtp'][_0xdda0('0x17')]=_0xdda0('0x3a');_0x5eb1df[_0xdda0('0x10')][_0x3bc1fd['id']][_0xdda0('0x38')][_0xdda0('0x18')]='';_0x5eb1df['emit'](_0x3bc1fd['id']);_0x231b7f(_0x401c6d);})[_0xdda0('0x31')](function(_0x3bee40){_0x5eb1df['mailAccounts'][_0x3bc1fd['id']][_0xdda0('0x38')]['status']='error';_0x5eb1df['mailAccounts'][_0x3bc1fd['id']]['Smtp'][_0xdda0('0x18')]=_0x3bee40;_0x5eb1df[_0xdda0('0x14')](_0x3bc1fd['id']);_0x4f1a49(_0x3bee40);});});}return this[_0xdda0('0x12')][_0xdda0('0x39')](_0x3bc1fd);};module['exports']=EmailChannel; \ No newline at end of file +var _0xa71e=['handleImapEmail','firstName','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','error','send','verifySmtp','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','./imap','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','key','active','Imap','status','messageStatus','isNil','stringify','mailAccount:update','service','provider','custom','hasOwnProperty','email','box','handleImapBox','bind','end','handleImapEnd','handleImapError','disabled','connected','name','messages','total'];(function(_0x455959,_0x27e796){var _0x1e54c2=function(_0x30a0a7){while(--_0x30a0a7){_0x455959['push'](_0x455959['shift']());}};_0x1e54c2(++_0x27e796);}(_0xa71e,0x1e8));var _0xea71=function(_0x17823f,_0xffd807){_0x17823f=_0x17823f-0x0;var _0x51fc21=_0xa71e[_0x17823f];return _0x51fc21;};'use strict';var _=require(_0xea71('0x0'));var moment=require(_0xea71('0x1'));var BPromise=require(_0xea71('0x2'));var md5=require(_0xea71('0x3'));var Redis=require(_0xea71('0x4'));var config=require(_0xea71('0x5'));var logger=require(_0xea71('0x6'))('email');config['redis']=_[_0xea71('0x7')](config[_0xea71('0x8')],{'host':_0xea71('0x9'),'port':0x18eb});var io=require(_0xea71('0xa'))(new Redis(config[_0xea71('0x8')]));var EmailImap=require(_0xea71('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x41fcfa){logger[_0xea71('0xc')](_0xea71('0xd'));this[_0xea71('0xe')]=_0x41fcfa[_0xea71('0xe')];this[_0xea71('0xf')]={};this[_0xea71('0x10')]=new EmailSmtp();}EmailChannel[_0xea71('0x11')][_0xea71('0x12')]=function(_0x56cd97){var _0x179070=this[_0xea71('0xe')][_0x56cd97];var _0x1fb309={'id':_0x179070['id'],'name':_0x179070['name'],'key':_0x179070[_0xea71('0x13')],'active':_0x179070[_0xea71('0x14')],'Imap':{'status':_0x179070[_0xea71('0x15')][_0xea71('0x16')],'messageStatus':_0x179070[_0xea71('0x15')][_0xea71('0x17')],'total':_0x179070[_0xea71('0x15')]['total']}};if(_[_0xea71('0x18')](md5Accounts[_0x56cd97])){md5Accounts[_0x56cd97]={};}var _0x1a7599=md5(JSON[_0xea71('0x19')](_0x1fb309));if(md5Accounts[_0x56cd97]['md5']!==_0x1a7599){md5Accounts[_0x56cd97]['md5']=_0x1a7599;io[_0xea71('0x12')](_0xea71('0x1a'),_0x1fb309);}};EmailChannel[_0xea71('0x11')]['refresh']=function(_0x3a0596){for(var _0x4ed2c1 in _0x3a0596){if(_0x3a0596['hasOwnProperty'](_0x4ed2c1)){if(_0x3a0596[_0x4ed2c1][_0xea71('0x15')]&&_0x3a0596[_0x4ed2c1][_0xea71('0x14')]){var _0x5a9004=_0x3a0596[_0x4ed2c1][_0xea71('0x15')];if(!_0x5a9004[_0xea71('0x1b')]&&_0x3a0596[_0x4ed2c1][_0xea71('0x1c')]!==_0xea71('0x1d'))_0x5a9004[_0xea71('0x1b')]=_0x3a0596[_0x4ed2c1]['provider'];if(!this[_0xea71('0xf')][_0xea71('0x1e')](_0x5a9004['id'])){this['imapAccounts'][_0x5a9004['id']]=new EmailImap(_0x5a9004,_0x3a0596[_0x4ed2c1][_0xea71('0x1f')]);this[_0xea71('0xf')][_0x5a9004['id']]['on'](_0xea71('0x20'),this[_0xea71('0x21')][_0xea71('0x22')](this,_0x4ed2c1));this['imapAccounts'][_0x5a9004['id']]['on'](_0xea71('0x1f'),this['handleImapEmail']['bind'](this,_0x4ed2c1));this[_0xea71('0xf')][_0x5a9004['id']]['on'](_0xea71('0x23'),this[_0xea71('0x24')][_0xea71('0x22')](this,_0x4ed2c1));this[_0xea71('0xf')][_0x5a9004['id']]['on']('error',this[_0xea71('0x25')][_0xea71('0x22')](this,_0x4ed2c1));}}else{if(_['isNil'](this[_0xea71('0xe')][_0x4ed2c1]['Imap'])){this[_0xea71('0xe')][_0x4ed2c1][_0xea71('0x15')]={};}this[_0xea71('0xe')][_0x4ed2c1]['Imap'][_0xea71('0x16')]=_0xea71('0x26');this[_0xea71('0xe')][_0x4ed2c1][_0xea71('0x15')]['messageStatus']='';this[_0xea71('0x12')](_0x4ed2c1);}}}};EmailChannel['prototype']['handleImapBox']=function(_0x401119,_0x25558e){if(this[_0xea71('0xe')][_0x401119]){this[_0xea71('0xe')][_0x401119][_0xea71('0x15')][_0xea71('0x16')]=_0xea71('0x27');this[_0xea71('0xe')][_0x401119][_0xea71('0x15')][_0xea71('0x17')]=_0x25558e[_0xea71('0x28')];if(_0x25558e[_0xea71('0x29')]){this['mailAccounts'][_0x401119][_0xea71('0x15')][_0xea71('0x2a')]=_0x25558e['messages'][_0xea71('0x2a')];}return this[_0xea71('0x12')](_0x401119);}};EmailChannel[_0xea71('0x11')][_0xea71('0x2b')]=function(_0x45a13a,_0x4c6d48){logger[_0xea71('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x4c6d48[_0xea71('0x2c')],_0x4c6d48[_0xea71('0x2d')],_0x4c6d48[_0xea71('0x2e')],_0x45a13a);if(this['mailAccounts'][_0x45a13a]){return mailAccount[_0xea71('0x2f')](_0x45a13a,_0x4c6d48)[_0xea71('0x30')](function(_0x2973c5){if(_0x2973c5){logger[_0xea71('0xc')]('Mail\x20accepted\x20from\x20routing');}})[_0xea71('0x31')](function(_0x36eeb1){logger['error'](_0xea71('0x32'),JSON[_0xea71('0x19')](_0x36eeb1));});}};EmailChannel[_0xea71('0x11')]['handleImapEnd']=function(_0x9271bb){if(this[_0xea71('0xe')][_0x9271bb]&&this[_0xea71('0xe')][_0x9271bb][_0xea71('0x15')]){if(this['imapAccounts'][this[_0xea71('0xe')][_0x9271bb]['Imap']['id']]){delete this[_0xea71('0xf')][this[_0xea71('0xe')][_0x9271bb][_0xea71('0x15')]['id']];}this[_0xea71('0xe')][_0x9271bb][_0xea71('0x15')][_0xea71('0x33')]=moment();this[_0xea71('0x12')](_0x9271bb);}};EmailChannel[_0xea71('0x11')][_0xea71('0x25')]=function(_0x3a9865,_0xbfd5ee){if(this[_0xea71('0xe')][_0x3a9865]){this[_0xea71('0xe')][_0x3a9865][_0xea71('0x15')][_0xea71('0x16')]=_0xea71('0x34');this[_0xea71('0xe')][_0x3a9865]['Imap'][_0xea71('0x17')]=_0xbfd5ee;return this['emit'](_0x3a9865);}};EmailChannel[_0xea71('0x11')]['sendMail']=function(_0xf8c91b,_0x29f902){return this['smtp'][_0xea71('0x35')](_0xf8c91b,_0x29f902);};EmailChannel[_0xea71('0x11')][_0xea71('0x36')]=function(_0x3356d1){var _0x4d1afc=this;if(this[_0xea71('0xe')][_0x3356d1['id']]){if(_[_0xea71('0x18')](this[_0xea71('0xe')][_0x3356d1['id']]['Smtp'])){this[_0xea71('0xe')][_0x3356d1['id']][_0xea71('0x37')]={};}this[_0xea71('0xe')][_0x3356d1['id']][_0xea71('0x37')][_0xea71('0x33')]=moment();return new BPromise(function(_0x326b46,_0x2f9500){return _0x4d1afc[_0xea71('0x10')][_0xea71('0x38')](_0x3356d1)[_0xea71('0x30')](function(_0x476dee){_0x4d1afc[_0xea71('0xe')][_0x3356d1['id']][_0xea71('0x37')][_0xea71('0x16')]=_0xea71('0x39');_0x4d1afc[_0xea71('0xe')][_0x3356d1['id']][_0xea71('0x37')]['messageStatus']='';_0x4d1afc[_0xea71('0x12')](_0x3356d1['id']);_0x326b46(_0x476dee);})[_0xea71('0x31')](function(_0x486861){_0x4d1afc['mailAccounts'][_0x3356d1['id']][_0xea71('0x37')][_0xea71('0x16')]=_0xea71('0x34');_0x4d1afc[_0xea71('0xe')][_0x3356d1['id']][_0xea71('0x37')][_0xea71('0x17')]=_0x486861;_0x4d1afc[_0xea71('0x12')](_0x3356d1['id']);_0x2f9500(_0x486861);});});}return this[_0xea71('0x10')][_0xea71('0x38')](_0x3356d1);};module[_0xea71('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 124df8b..ebceb7c 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 _0xf902=['imap','mailparser','Iconv','events','EventEmitter','./utils','email','mailbox','getAccount','account','once','handleReady','bind','end','handleEnd','error','handleError','connect','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','host','port','tls','autotls','required','openBox','prototype','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleMessageBody','handleMessageAttributes','handleSimpleParser','handleMessageEnd','stringify','textCode','hasOwnProperty','upperFirst','util'];(function(_0x42d65a,_0x5a9d5f){var _0x530d1f=function(_0x268f1f){while(--_0x268f1f){_0x42d65a['push'](_0x42d65a['shift']());}};_0x530d1f(++_0x5a9d5f);}(_0xf902,0x12b));var _0x2f90=function(_0xd6b767,_0x214503){_0xd6b767=_0xd6b767-0x0;var _0x5bfb6b=_0xf902[_0xd6b767];return _0x5bfb6b;};'use strict';var _=require('lodash');var util=require(_0x2f90('0x0'));var Imap=require(_0x2f90('0x1'));var simpleParser=require(_0x2f90('0x2'))['simpleParser'];var Iconv=require('iconv')[_0x2f90('0x3')];var EventEmitter=require(_0x2f90('0x4'))[_0x2f90('0x5')];var utils=require(_0x2f90('0x6'));var logger=require('../../../config/logger')(_0x2f90('0x7'));function EmailImap(_0x232f26,_0x365102){this[_0x2f90('0x8')]=_0x232f26[_0x2f90('0x8')];this['account']=this[_0x2f90('0x9')](_0x232f26,_0x365102);this[_0x2f90('0x1')]=new Imap(this[_0x2f90('0xa')]);this['imap'][_0x2f90('0xb')]('ready',this[_0x2f90('0xc')][_0x2f90('0xd')](this));this['imap'][_0x2f90('0xb')](_0x2f90('0xe'),this[_0x2f90('0xf')][_0x2f90('0xd')](this));this['imap']['on'](_0x2f90('0x10'),this[_0x2f90('0x11')][_0x2f90('0xd')](this));this['imap'][_0x2f90('0x12')]();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype'][_0x2f90('0x9')]=function(_0x1521be,_0x5e1cae){var _0x241b20={'connTimeout':_0x1521be[_0x2f90('0x13')]?_0x1521be[_0x2f90('0x13')]*0x3e8:0x2710,'authTimeout':_0x1521be[_0x2f90('0x14')]?_0x1521be[_0x2f90('0x14')]*0x3e8:0x1388};if(_0x1521be[_0x2f90('0x15')]){_0x241b20[_0x2f90('0x16')]=_0x1521be[_0x2f90('0x16')];if(_0x1521be[_0x2f90('0x17')]){_0x241b20[_0x2f90('0x18')]=utils[_0x2f90('0x19')](_0x1521be[_0x2f90('0x1a')][_0x2f90('0x1b')],_0x1521be[_0x2f90('0x16')]);}else{_0x241b20[_0x2f90('0x1c')]=_0x1521be[_0x2f90('0x1c')];}}else{if(_0x1521be[_0x2f90('0x1d')]){_0x241b20['user']=_0x1521be[_0x2f90('0x16')];_0x241b20[_0x2f90('0x1c')]=_0x1521be[_0x2f90('0x1c')];}}_0x241b20[_0x2f90('0x7')]=_0x5e1cae||_0x1521be['user']||'anonymous@xcally.com';_0x241b20['host']=_0x1521be[_0x2f90('0x1e')];_0x241b20[_0x2f90('0x1f')]=_0x1521be['port']||0x3e1;if(_0x1521be[_0x2f90('0x20')]){_0x241b20[_0x2f90('0x20')]=!![];}else{_0x241b20['tls']=![];_0x241b20[_0x2f90('0x21')]=_0x2f90('0x22');}return _0x241b20;};EmailImap['prototype'][_0x2f90('0xc')]=function(){this[_0x2f90('0x1')][_0x2f90('0x23')](this[_0x2f90('0x8')],![],this['handleOpenBox']['bind'](this));};EmailImap[_0x2f90('0x24')][_0x2f90('0x25')]=function(_0x498541,_0x2678fe){if(_0x498541){this[_0x2f90('0x11')](_0x498541,!![]);}else{this[_0x2f90('0x26')](_0x2f90('0x27'),_0x2678fe);this[_0x2f90('0x28')]();}};EmailImap['prototype'][_0x2f90('0x29')]=function(_0x409685){if(_0x409685){this[_0x2f90('0x11')](_0x409685,!![]);}else{this['imap'][_0x2f90('0xe')]();}};EmailImap[_0x2f90('0x24')]['readUnseen']=function(){this['imap'][_0x2f90('0x2a')]([_0x2f90('0x2b')],this[_0x2f90('0x2c')][_0x2f90('0xd')](this));};EmailImap[_0x2f90('0x24')][_0x2f90('0x2c')]=function(_0x7790c5,_0x54b64e){if(_0x7790c5){this[_0x2f90('0x11')](_0x7790c5,!![]);}else{if(_0x54b64e[_0x2f90('0x2d')]){try{var _0x1cc32e=this[_0x2f90('0x1')][_0x2f90('0x2e')](_0x54b64e,{'bodies':'','markSeen':!![]});_0x1cc32e['on'](_0x2f90('0x2f'),this[_0x2f90('0x30')][_0x2f90('0xd')](this));_0x1cc32e['once'](_0x2f90('0x10'),this[_0x2f90('0x31')]['bind'](this));_0x1cc32e['once'](_0x2f90('0xe'),this[_0x2f90('0x32')][_0x2f90('0xd')](this));}catch(_0x1c46e1){logger['error'](_0x1c46e1);}}else{this[_0x2f90('0x1')][_0x2f90('0x33')](!![],this[_0x2f90('0x29')][_0x2f90('0xd')](this));}}};EmailImap[_0x2f90('0x24')][_0x2f90('0x30')]=function(_0x45e9fd){_0x45e9fd['on']('body',this[_0x2f90('0x34')][_0x2f90('0xd')](this));_0x45e9fd[_0x2f90('0xb')]('attributes',this[_0x2f90('0x35')][_0x2f90('0xd')](this));_0x45e9fd[_0x2f90('0xb')](_0x2f90('0xe'),this['handleMessageEnd'][_0x2f90('0xd')](this));};EmailImap[_0x2f90('0x24')][_0x2f90('0x34')]=function(_0x1416c7){simpleParser(_0x1416c7,{'Iconv':Iconv},this[_0x2f90('0x36')][_0x2f90('0xd')](this));};EmailImap['prototype'][_0x2f90('0x35')]=function(){};EmailImap[_0x2f90('0x24')][_0x2f90('0x37')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x4d215c,_0xe96a82){if(_0x4d215c){logger['error'](_0x4d215c);}else{var _0x40ceb2=this;utils['parser'](this['account'],_0xe96a82,function(_0x5303b5){_0x40ceb2[_0x2f90('0x26')](_0x2f90('0x7'),_0x5303b5);});}};EmailImap['prototype'][_0x2f90('0x32')]=function(){this[_0x2f90('0x1')]['closeBox'](!![],this[_0x2f90('0x29')][_0x2f90('0xd')](this));};EmailImap[_0x2f90('0x24')][_0x2f90('0x31')]=function(_0x95dac6){this[_0x2f90('0x11')](_0x95dac6);this[_0x2f90('0x1')]['closeBox'](!![],this[_0x2f90('0x29')][_0x2f90('0xd')](this));};EmailImap[_0x2f90('0x24')][_0x2f90('0xf')]=function(){this[_0x2f90('0x26')]('end');};EmailImap[_0x2f90('0x24')][_0x2f90('0x11')]=function(_0x49260d,_0x39ac0d){logger[_0x2f90('0x10')](_0x2f90('0x11'),this[_0x2f90('0xa')][_0x2f90('0x7')],JSON[_0x2f90('0x38')](_0x49260d));var _0x1a2bfd='';if(_0x49260d){if(_0x49260d[_0x2f90('0x39')]){_0x1a2bfd=_0x49260d[_0x2f90('0x39')];}else{for(var _0xc25cf1 in _0x49260d){if(_0x49260d[_0x2f90('0x3a')](_0xc25cf1)){_0x1a2bfd+=_[_0x2f90('0x3b')](_0xc25cf1)+':\x20'+_0x49260d[_0xc25cf1]+'\x0a';}}}}if(_0x39ac0d){this[_0x2f90('0x1')][_0x2f90('0xe')]();}else{this[_0x2f90('0x26')]('error',_0x1a2bfd);this[_0x2f90('0x26')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0xcd27=['events','EventEmitter','account','getAccount','ready','bind','once','end','handleEnd','error','handleError','inherits','prototype','connTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider','data5','password','authentication','email','anonymous@xcally.com','host','port','tls','required','handleReady','mailbox','handleOpenBox','emit','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','closeBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleCloseBox','stringify','textCode','upperFirst','lodash','imap','Iconv'];(function(_0x519380,_0x7f196){var _0x60ba2c=function(_0x5b2110){while(--_0x5b2110){_0x519380['push'](_0x519380['shift']());}};_0x60ba2c(++_0x7f196);}(_0xcd27,0x1c5));var _0x7cd2=function(_0x412ac1,_0x84ea47){_0x412ac1=_0x412ac1-0x0;var _0xe6c244=_0xcd27[_0x412ac1];return _0xe6c244;};'use strict';var _=require(_0x7cd2('0x0'));var util=require('util');var Imap=require(_0x7cd2('0x1'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require('iconv')[_0x7cd2('0x2')];var EventEmitter=require(_0x7cd2('0x3'))[_0x7cd2('0x4')];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0xddc48c,_0x1ee163){this['mailbox']=_0xddc48c['mailbox'];this[_0x7cd2('0x5')]=this[_0x7cd2('0x6')](_0xddc48c,_0x1ee163);this[_0x7cd2('0x1')]=new Imap(this[_0x7cd2('0x5')]);this[_0x7cd2('0x1')]['once'](_0x7cd2('0x7'),this['handleReady'][_0x7cd2('0x8')](this));this[_0x7cd2('0x1')][_0x7cd2('0x9')](_0x7cd2('0xa'),this[_0x7cd2('0xb')][_0x7cd2('0x8')](this));this[_0x7cd2('0x1')]['on'](_0x7cd2('0xc'),this[_0x7cd2('0xd')]['bind'](this));this['imap']['connect']();}util[_0x7cd2('0xe')](EmailImap,EventEmitter);EmailImap[_0x7cd2('0xf')]['getAccount']=function(_0x239024,_0x4746ef){var _0x4980f8={'connTimeout':_0x239024[_0x7cd2('0x10')]?_0x239024['connTimeout']*0x3e8:0x2710,'authTimeout':_0x239024['authTimeout']?_0x239024['authTimeout']*0x3e8:0x1388};if(_0x239024[_0x7cd2('0x11')]){_0x4980f8[_0x7cd2('0x12')]=_0x239024['user'];if(_0x239024[_0x7cd2('0x13')]){_0x4980f8[_0x7cd2('0x14')]=utils[_0x7cd2('0x15')](_0x239024[_0x7cd2('0x16')][_0x7cd2('0x17')],_0x239024[_0x7cd2('0x12')]);}else{_0x4980f8[_0x7cd2('0x18')]=_0x239024[_0x7cd2('0x18')];}}else{if(_0x239024[_0x7cd2('0x19')]){_0x4980f8['user']=_0x239024[_0x7cd2('0x12')];_0x4980f8[_0x7cd2('0x18')]=_0x239024[_0x7cd2('0x18')];}}_0x4980f8[_0x7cd2('0x1a')]=_0x4746ef||_0x239024[_0x7cd2('0x12')]||_0x7cd2('0x1b');_0x4980f8['host']=_0x239024[_0x7cd2('0x1c')];_0x4980f8[_0x7cd2('0x1d')]=_0x239024[_0x7cd2('0x1d')]||0x3e1;if(_0x239024[_0x7cd2('0x1e')]){_0x4980f8[_0x7cd2('0x1e')]=!![];}else{_0x4980f8[_0x7cd2('0x1e')]=![];_0x4980f8['autotls']=_0x7cd2('0x1f');}return _0x4980f8;};EmailImap[_0x7cd2('0xf')][_0x7cd2('0x20')]=function(){this[_0x7cd2('0x1')]['openBox'](this[_0x7cd2('0x21')],![],this[_0x7cd2('0x22')]['bind'](this));};EmailImap[_0x7cd2('0xf')][_0x7cd2('0x22')]=function(_0x4ed383,_0x33d824){if(_0x4ed383){this[_0x7cd2('0xd')](_0x4ed383,!![]);}else{this[_0x7cd2('0x23')]('box',_0x33d824);this[_0x7cd2('0x24')]();}};EmailImap[_0x7cd2('0xf')]['handleCloseBox']=function(_0xf93f01){if(_0xf93f01){this[_0x7cd2('0xd')](_0xf93f01,!![]);}else{this['imap'][_0x7cd2('0xa')]();}};EmailImap[_0x7cd2('0xf')]['readUnseen']=function(){this[_0x7cd2('0x1')][_0x7cd2('0x25')]([_0x7cd2('0x26')],this[_0x7cd2('0x27')][_0x7cd2('0x8')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x4ff85a,_0x5e85f7){if(_0x4ff85a){this[_0x7cd2('0xd')](_0x4ff85a,!![]);}else{if(_0x5e85f7[_0x7cd2('0x28')]){try{var _0x5c4bdc=this[_0x7cd2('0x1')][_0x7cd2('0x29')](_0x5e85f7,{'bodies':'','markSeen':!![]});_0x5c4bdc['on'](_0x7cd2('0x2a'),this[_0x7cd2('0x2b')]['bind'](this));_0x5c4bdc[_0x7cd2('0x9')](_0x7cd2('0xc'),this[_0x7cd2('0x2c')][_0x7cd2('0x8')](this));_0x5c4bdc[_0x7cd2('0x9')](_0x7cd2('0xa'),this['handleFetchEnd'][_0x7cd2('0x8')](this));}catch(_0x430faa){logger[_0x7cd2('0xc')](_0x430faa);}}else{this[_0x7cd2('0x1')][_0x7cd2('0x2d')](!![],this['handleCloseBox'][_0x7cd2('0x8')](this));}}};EmailImap[_0x7cd2('0xf')][_0x7cd2('0x2b')]=function(_0x2b4e95){_0x2b4e95['on'](_0x7cd2('0x2e'),this['handleMessageBody'][_0x7cd2('0x8')](this));_0x2b4e95['once'](_0x7cd2('0x2f'),this[_0x7cd2('0x30')][_0x7cd2('0x8')](this));_0x2b4e95[_0x7cd2('0x9')](_0x7cd2('0xa'),this[_0x7cd2('0x31')][_0x7cd2('0x8')](this));};EmailImap[_0x7cd2('0xf')][_0x7cd2('0x32')]=function(_0xc4456a){simpleParser(_0xc4456a,{'Iconv':Iconv},this['handleSimpleParser'][_0x7cd2('0x8')](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0x7cd2('0xf')][_0x7cd2('0x31')]=function(){};EmailImap[_0x7cd2('0xf')][_0x7cd2('0x33')]=function(_0x3d4fdf,_0x53e58e){if(_0x3d4fdf){logger[_0x7cd2('0xc')](_0x3d4fdf);}else{var _0x2e40a3=this;utils[_0x7cd2('0x34')](this[_0x7cd2('0x5')],_0x53e58e,function(_0x3aedb0){_0x2e40a3['emit'](_0x7cd2('0x1a'),_0x3aedb0);});}};EmailImap[_0x7cd2('0xf')]['handleFetchEnd']=function(){this[_0x7cd2('0x1')]['closeBox'](!![],this[_0x7cd2('0x35')][_0x7cd2('0x8')](this));};EmailImap[_0x7cd2('0xf')]['handleFetchError']=function(_0xc8cfac){this[_0x7cd2('0xd')](_0xc8cfac);this[_0x7cd2('0x1')]['closeBox'](!![],this[_0x7cd2('0x35')][_0x7cd2('0x8')](this));};EmailImap[_0x7cd2('0xf')][_0x7cd2('0xb')]=function(){this[_0x7cd2('0x23')](_0x7cd2('0xa'));};EmailImap['prototype'][_0x7cd2('0xd')]=function(_0x4ff911,_0xd27d64){logger[_0x7cd2('0xc')](_0x7cd2('0xd'),this[_0x7cd2('0x5')]['email'],JSON[_0x7cd2('0x36')](_0x4ff911));var _0xe7aee1='';if(_0x4ff911){if(_0x4ff911[_0x7cd2('0x37')]){_0xe7aee1=_0x4ff911[_0x7cd2('0x37')];}else{for(var _0x2697a7 in _0x4ff911){if(_0x4ff911['hasOwnProperty'](_0x2697a7)){_0xe7aee1+=_[_0x7cd2('0x38')](_0x2697a7)+':\x20'+_0x4ff911[_0x2697a7]+'\x0a';}}}}if(_0xd27d64){this['imap']['end']();}else{this[_0x7cd2('0x23')](_0x7cd2('0xc'),_0xe7aee1);this[_0x7cd2('0x23')]('end');}};module['exports']=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index dd01dcb..fbdd10a 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 _0xfbe7=['use','compile','toString','prototype','verify','Not\x20verifired','nodemailer','nodemailer-plugin-inline-base64','send','createTransport'];(function(_0x2c505d,_0x454428){var _0x1cbffc=function(_0x4d131c){while(--_0x4d131c){_0x2c505d['push'](_0x2c505d['shift']());}};_0x1cbffc(++_0x454428);}(_0xfbe7,0x100));var _0x7fbe=function(_0x38c407,_0x2999ed){_0x38c407=_0x38c407-0x0;var _0x3e27e6=_0xfbe7[_0x38c407];return _0x3e27e6;};'use strict';var nodemailer=require(_0x7fbe('0x0'));var inlineBase64=require(_0x7fbe('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x7fbe('0x2')]=function(_0x59f761,_0x40e6e3){return new Promise(function(_0x3e3ecb,_0x45430d){var _0x1f184e=nodemailer[_0x7fbe('0x3')](_0x59f761);_0x1f184e[_0x7fbe('0x4')](_0x7fbe('0x5'),inlineBase64());_0x1f184e['sendMail'](_0x40e6e3,function(_0x245843,_0x13bbc8){if(_0x245843){_0x45430d(_0x245843[_0x7fbe('0x6')]());}else{_0x3e3ecb(_0x13bbc8);}});});};EmailSmtp[_0x7fbe('0x7')][_0x7fbe('0x8')]=function(_0x4c217c){return new Promise(function(_0x2e4004,_0x41c333){var _0x109300=nodemailer['createTransport'](_0x4c217c);_0x109300[_0x7fbe('0x8')](function(_0x1ff1b0,_0x2c4b92){if(_0x1ff1b0){_0x41c333(_0x1ff1b0[_0x7fbe('0x6')]());}else{if(_0x2c4b92){_0x2e4004(_0x2c4b92);}else{_0x41c333(_0x7fbe('0x9'));}}});});};module['exports']=EmailSmtp; \ No newline at end of file +var _0x7348=['nodemailer','nodemailer-plugin-inline-base64','prototype','compile','toString','createTransport','verify','Not\x20verifired','exports'];(function(_0x2a8396,_0x2a9470){var _0x2b1db3=function(_0x4f3ac5){while(--_0x4f3ac5){_0x2a8396['push'](_0x2a8396['shift']());}};_0x2b1db3(++_0x2a9470);}(_0x7348,0x195));var _0x8734=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7348[_0x2641f9];return _0x585741;};'use strict';var nodemailer=require(_0x8734('0x0'));var inlineBase64=require(_0x8734('0x1'));function EmailSmtp(){}EmailSmtp[_0x8734('0x2')]['send']=function(_0x57e297,_0x247414){return new Promise(function(_0x3cf21f,_0x2e9fd1){var _0x3b0b52=nodemailer['createTransport'](_0x57e297);_0x3b0b52['use'](_0x8734('0x3'),inlineBase64());_0x3b0b52['sendMail'](_0x247414,function(_0x5e3930,_0x27c1ae){if(_0x5e3930){_0x2e9fd1(_0x5e3930[_0x8734('0x4')]());}else{_0x3cf21f(_0x27c1ae);}});});};EmailSmtp[_0x8734('0x2')]['verify']=function(_0x25a63a){return new Promise(function(_0x577290,_0x2267e6){var _0x23ac75=nodemailer[_0x8734('0x5')](_0x25a63a);_0x23ac75[_0x8734('0x6')](function(_0x523dac,_0x25763e){if(_0x523dac){_0x2267e6(_0x523dac[_0x8734('0x4')]());}else{if(_0x25763e){_0x577290(_0x25763e);}else{_0x2267e6(_0x8734('0x7'));}}});});};module[_0x8734('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index f2d3440..833ed5e 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 _0x3313=['address','anonymous','generate','@xcally.com','name','substring','split','length','slice','join','Anonymous','pop','isEmpty','html','test','replace','','body','textAsHtml','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','utf-8','toString','base64','lodash','path','../../../config/logger','email','head','value'];(function(_0x4409e7,_0x307f17){var _0x24c751=function(_0x3a7d33){while(--_0x3a7d33){_0x4409e7['push'](_0x4409e7['shift']());}};_0x24c751(++_0x307f17);}(_0x3313,0x122));var _0x3331=function(_0x1accd6,_0x239330){_0x1accd6=_0x1accd6-0x0;var _0x3925f3=_0x3313[_0x1accd6];return _0x3925f3;};'use strict';var _=require(_0x3331('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0x3331('0x1'));var util=require('util');var tnef=require('node-tnef');var logger=require(_0x3331('0x2'))(_0x3331('0x3'));var config=require('../../../config/environment');function getAddress(_0x353537){var _0x969b92=_[_0x3331('0x4')](_0x353537[_0x3331('0x5')]);return _0x969b92&&_0x969b92[_0x3331('0x6')]?_0x969b92['address']:_0x3331('0x7')+random[_0x3331('0x8')](0x6)+_0x3331('0x9');}function getFirstName(_0x94e325){var _0x3f29aa=_[_0x3331('0x4')](_0x94e325[_0x3331('0x5')]);if(_0x3f29aa&&_0x3f29aa[_0x3331('0xa')]){if(_0x3f29aa[_0x3331('0xa')]==_0x3f29aa[_0x3331('0x6')]){return _0x3f29aa[_0x3331('0xa')][_0x3331('0xb')](0x0,_0x3f29aa[_0x3331('0xa')]['indexOf']('@'));}var _0x37d1e5=_0x3f29aa[_0x3331('0xa')][_0x3331('0xc')](/\s+/);return _0x37d1e5[_0x3331('0xd')]>0x1?_0x37d1e5[_0x3331('0xe')](0x0,-0x1)[_0x3331('0xf')]('\x20'):_0x3f29aa[_0x3331('0xa')];}return _0x3331('0x10');}function getLastName(_0x25b261){var _0x2d56ae=_[_0x3331('0x4')](_0x25b261[_0x3331('0x5')]);if(_0x2d56ae&&_0x2d56ae['name']){var _0x16a134=_0x2d56ae[_0x3331('0xa')][_0x3331('0xc')](/\s+/);return _0x16a134[_0x3331('0xd')]>0x1?_0x16a134[_0x3331('0x11')]():'';}return'';}function getMails(_0x2df2de,_0x53a759){var _0xacf296='';for(var _0x1e9d81=0x0;_0x1e9d81<_0x53a759[_0x3331('0x5')][_0x3331('0xd')];_0x1e9d81+=0x1){if(_0x53a759['value'][_0x1e9d81][_0x3331('0x6')]!==_0x2df2de){if(!_[_0x3331('0x12')](_0xacf296)){_0xacf296+=',';}_0xacf296+=_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0xa')]||_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0x6')]||'';_0xacf296+='\x20<';_0xacf296+=_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0x6')]?_0x53a759[_0x3331('0x5')][_0x1e9d81][_0x3331('0x6')]:_0x3331('0x7')+random['generate'](0x6)+_0x3331('0x9');_0xacf296+='>';}}return _0xacf296;}function parseEmail(_0x46c0e5,_0x147939,_0x4e9dc3){if(_0x147939[_0x3331('0x13')]){var _0x2723cb=/)<[^<]*)*<\/script>/gi;while(_0x2723cb[_0x3331('0x14')](_0x147939[_0x3331('0x13')])){_0x147939[_0x3331('0x13')]=_0x147939[_0x3331('0x13')][_0x3331('0x15')](_0x2723cb,'');}if(_0x147939[_0x3331('0x13')]['includes'](_0x3331('0x16'))){var _0x526706=[];_0x147939[_0x3331('0x17')][_0x3331('0x18')](_0xc83eaf=>{_0x526706[_0x3331('0x19')](_0xc83eaf[_0x3331('0x1a')]);});var _0x2b1e6d=/]+>/g;var _0x4842e4=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2a55f6=_0x147939[_0x3331('0x13')][_0x3331('0x15')](_0x4842e4,_0x3331('0x1b'));var _0x1fa04b=_0x2a55f6[_0x3331('0x15')](_0x2b1e6d,_0x3331('0x1c'));for(let _0x1b1e86=0x0;_0x1b1e86<_0x526706[_0x3331('0xd')];_0x1b1e86++){var _0x5079c7=_0x1fa04b[_0x3331('0x15')](_0x3331('0x1c'),'\x20[Attachment:\x20'+_0x526706[_0x1b1e86]+_0x3331('0x1d'));_0x1fa04b=_0x5079c7;}_0x147939[_0x3331('0x13')]=_0x1fa04b;}_0x4e9dc3[_0x3331('0x1e')]=_0x147939[_0x3331('0x13')];}else{_0x4e9dc3[_0x3331('0x1e')]=_0x147939[_0x3331('0x1f')];}if(_0x4e9dc3[_0x3331('0x1e')]){_0x4e9dc3[_0x3331('0x1e')]=_0x4e9dc3[_0x3331('0x1e')]['replace'](/0x0){var _0x4aac52=[_0x3331('0x30'),_0x3331('0x31'),_0x3331('0x32')];for(var _0x1ff037=0x0;_0x1ff037<_0x147939[_0x3331('0x2f')]['length'];_0x1ff037++){var _0x124203=_[_0x3331('0x33')](_0x4aac52,_0x147939[_0x3331('0x2f')][_0x1ff037][_0x3331('0x34')]);if(_0x124203>=0x0){_0x4e9dc3[_0x3331('0x35')]=!![];}}}return _0x4e9dc3;}exports[_0x3331('0x36')]=function(_0x15da20,_0x6b198d,_0x39816b){var _0x147b68={'from':getAddress(_0x6b198d[_0x3331('0x37')]),'firstName':getFirstName(_0x6b198d[_0x3331('0x37')]),'lastName':getLastName(_0x6b198d[_0x3331('0x37')]),'mapKey':'email','message':{'from':getMails(_0x15da20[_0x3331('0x3')],_0x6b198d['from']),'to':_0x15da20['email'],'cc':'','subject':_0x6b198d[_0x3331('0x38')]||'','messageId':_0x6b198d[_0x3331('0x39')],'inReplyTo':_0x6b198d[_0x3331('0x3a')],'sentAt':moment(_0x6b198d[_0x3331('0x3b')])[_0x3331('0x3c')]('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x6b198d[_0x3331('0x13')]&&!_0x6b198d[_0x3331('0x1f')]){var _0x84816e=_[_0x3331('0x3d')](_0x6b198d[_0x3331('0x17')],{'contentType':_0x3331('0x3e')});if(_0x84816e[_0x3331('0xd')]){logger[_0x3331('0x3f')](util[_0x3331('0x3c')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x6b198d[_0x3331('0x39')]));tnef[_0x3331('0x40')](_['first'](_0x84816e)[_0x3331('0x2d')],function(_0x26a2bb,_0x2e6d8b){if(_0x2e6d8b){_0x6b198d[_0x3331('0x13')]=_0x2e6d8b[_0x3331('0x41')]||_0x3331('0x42');if(_0x2e6d8b[_0x3331('0x43')]){for(var _0x342f12=0x0;_0x342f12<_0x2e6d8b[_0x3331('0x43')][_0x3331('0xd')];_0x342f12++){var _0x1910b6=_0x2e6d8b['Attachments'][_0x342f12];_0x147b68[_0x3331('0x21')][_0x3331('0x17')][_0x3331('0x19')]({'filename':_0x1910b6[_0x3331('0x44')],'content':Buffer[_0x3331('0x37')](_0x1910b6[_0x3331('0x45')])});}}}_0x39816b(parseEmail(_0x15da20,_0x6b198d,_0x147b68));});}else{_0x6b198d[_0x3331('0x13')]=_0x3331('0x42');_0x39816b(parseEmail(_0x15da20,_0x6b198d,_0x147b68));}}else{_0x39816b(parseEmail(_0x15da20,_0x6b198d,_0x147b68));}};exports[_0x3331('0x46')]=function(_0x19eac4,_0x46617e){var _0xa0d689=['user='+(_0x46617e||''),'auth=Bearer\x20'+_0x19eac4,'',''];return Buffer['from'](_0xa0d689['join'](''),_0x3331('0x47'))[_0x3331('0x48')](_0x3331('0x49'));}; \ No newline at end of file +var _0xec13=['\x20]','body','textAsHtml','message','originTo','email','originCc','bcc','attach','type','attachment','format','%s-%s','now','root','server/files/attachments/','content','contentType','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','indexOf','line','isAutoreply','parser','from','subject','date','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','user=','utf-8','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','../../../config/environment','head','value','address','generate','@xcally.com','name','substring','join','Anonymous','split','length','isEmpty','anonymous','html','replace','includes','\x20[Attachment:\x20'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0xec13,0x109));var _0x3ec1=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xec13[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x3ec1('0x0'));var moment=require(_0x3ec1('0x1'));var random=require(_0x3ec1('0x2'));var fs=require('fs');var path=require(_0x3ec1('0x3'));var util=require(_0x3ec1('0x4'));var tnef=require(_0x3ec1('0x5'));var logger=require(_0x3ec1('0x6'))('email');var config=require(_0x3ec1('0x7'));function getAddress(_0x39f072){var _0x46e62f=_[_0x3ec1('0x8')](_0x39f072[_0x3ec1('0x9')]);return _0x46e62f&&_0x46e62f[_0x3ec1('0xa')]?_0x46e62f[_0x3ec1('0xa')]:'anonymous'+random[_0x3ec1('0xb')](0x6)+_0x3ec1('0xc');}function getFirstName(_0xd69459){var _0x39cf0a=_[_0x3ec1('0x8')](_0xd69459[_0x3ec1('0x9')]);if(_0x39cf0a&&_0x39cf0a[_0x3ec1('0xd')]){if(_0x39cf0a[_0x3ec1('0xd')]==_0x39cf0a[_0x3ec1('0xa')]){return _0x39cf0a[_0x3ec1('0xd')][_0x3ec1('0xe')](0x0,_0x39cf0a[_0x3ec1('0xd')]['indexOf']('@'));}var _0x31b407=_0x39cf0a[_0x3ec1('0xd')]['split'](/\s+/);return _0x31b407['length']>0x1?_0x31b407['slice'](0x0,-0x1)[_0x3ec1('0xf')]('\x20'):_0x39cf0a['name'];}return _0x3ec1('0x10');}function getLastName(_0x433139){var _0x2eec76=_[_0x3ec1('0x8')](_0x433139[_0x3ec1('0x9')]);if(_0x2eec76&&_0x2eec76[_0x3ec1('0xd')]){var _0xfe40da=_0x2eec76[_0x3ec1('0xd')][_0x3ec1('0x11')](/\s+/);return _0xfe40da['length']>0x1?_0xfe40da['pop']():'';}return'';}function getMails(_0x2da518,_0x1a6fc5){var _0x358430='';for(var _0x6cd993=0x0;_0x6cd993<_0x1a6fc5['value'][_0x3ec1('0x12')];_0x6cd993+=0x1){if(_0x1a6fc5[_0x3ec1('0x9')][_0x6cd993][_0x3ec1('0xa')]!==_0x2da518){if(!_[_0x3ec1('0x13')](_0x358430)){_0x358430+=',';}_0x358430+=_0x1a6fc5[_0x3ec1('0x9')][_0x6cd993]['name']||_0x1a6fc5[_0x3ec1('0x9')][_0x6cd993][_0x3ec1('0xa')]||'';_0x358430+='\x20<';_0x358430+=_0x1a6fc5[_0x3ec1('0x9')][_0x6cd993]['address']?_0x1a6fc5[_0x3ec1('0x9')][_0x6cd993][_0x3ec1('0xa')]:_0x3ec1('0x14')+random[_0x3ec1('0xb')](0x6)+_0x3ec1('0xc');_0x358430+='>';}}return _0x358430;}function parseEmail(_0x3e7d2e,_0x561e2f,_0x39c6b3){if(_0x561e2f[_0x3ec1('0x15')]){var _0x1357de=/)<[^<]*)*<\/script>/gi;while(_0x1357de['test'](_0x561e2f[_0x3ec1('0x15')])){_0x561e2f['html']=_0x561e2f[_0x3ec1('0x15')][_0x3ec1('0x16')](_0x1357de,'');}if(_0x561e2f[_0x3ec1('0x15')][_0x3ec1('0x17')](_0x3ec1('0x18'))){var _0x29fcf7=[];_0x561e2f[_0x3ec1('0x19')]['forEach'](_0x3918ed=>{_0x29fcf7[_0x3ec1('0x1a')](_0x3918ed[_0x3ec1('0x1b')]);});var _0x4c772c=/]+>/g;var _0x52e544=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x663cc6=_0x561e2f['html'][_0x3ec1('0x16')](_0x52e544,_0x3ec1('0x1c'));var _0x373b93=_0x663cc6[_0x3ec1('0x16')](_0x4c772c,_0x3ec1('0x1d'));for(let _0x53a522=0x0;_0x53a522<_0x29fcf7[_0x3ec1('0x12')];_0x53a522++){var _0x3fe403=_0x373b93[_0x3ec1('0x16')](_0x3ec1('0x1d'),_0x3ec1('0x1e')+_0x29fcf7[_0x53a522]+_0x3ec1('0x1f'));_0x373b93=_0x3fe403;}_0x561e2f['html']=_0x373b93;}_0x39c6b3[_0x3ec1('0x20')]=_0x561e2f[_0x3ec1('0x15')];}else{_0x39c6b3['body']=_0x561e2f[_0x3ec1('0x21')];}if(_0x39c6b3[_0x3ec1('0x20')]){_0x39c6b3[_0x3ec1('0x20')]=_0x39c6b3[_0x3ec1('0x20')][_0x3ec1('0x16')](/0x0){var _0x271c96=[_0x3ec1('0x32'),_0x3ec1('0x33'),_0x3ec1('0x34')];for(var _0xd23d1e=0x0;_0xd23d1e<_0x561e2f['headerLines']['length'];_0xd23d1e++){var _0x3f63a8=_[_0x3ec1('0x35')](_0x271c96,_0x561e2f[_0x3ec1('0x31')][_0xd23d1e][_0x3ec1('0x36')]);if(_0x3f63a8>=0x0){_0x39c6b3[_0x3ec1('0x37')]=!![];}}}return _0x39c6b3;}exports[_0x3ec1('0x38')]=function(_0x33ef75,_0x13eb36,_0x5a2a7b){var _0x460e1a={'from':getAddress(_0x13eb36[_0x3ec1('0x39')]),'firstName':getFirstName(_0x13eb36[_0x3ec1('0x39')]),'lastName':getLastName(_0x13eb36[_0x3ec1('0x39')]),'mapKey':'email','message':{'from':getMails(_0x33ef75[_0x3ec1('0x24')],_0x13eb36[_0x3ec1('0x39')]),'to':_0x33ef75['email'],'cc':'','subject':_0x13eb36[_0x3ec1('0x3a')]||'','messageId':_0x13eb36['messageId'],'inReplyTo':_0x13eb36['inReplyTo'],'sentAt':moment(_0x13eb36[_0x3ec1('0x3b')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x13eb36[_0x3ec1('0x15')]&&!_0x13eb36[_0x3ec1('0x21')]){var _0x1280eb=_[_0x3ec1('0x3c')](_0x13eb36['attachments'],{'contentType':'application/ms-tnef'});if(_0x1280eb[_0x3ec1('0x12')]){logger['info'](util[_0x3ec1('0x2a')](_0x3ec1('0x3d'),_0x13eb36[_0x3ec1('0x3e')]));tnef[_0x3ec1('0x3f')](_[_0x3ec1('0x40')](_0x1280eb)[_0x3ec1('0x2f')],function(_0x5eb4c0,_0xc6e1b7){if(_0xc6e1b7){_0x13eb36['html']=_0xc6e1b7[_0x3ec1('0x41')]||'

Empty\x20message

';if(_0xc6e1b7[_0x3ec1('0x42')]){for(var _0x47ccf0=0x0;_0x47ccf0<_0xc6e1b7[_0x3ec1('0x42')][_0x3ec1('0x12')];_0x47ccf0++){var _0x5cf491=_0xc6e1b7[_0x3ec1('0x42')][_0x47ccf0];_0x460e1a[_0x3ec1('0x22')][_0x3ec1('0x19')]['push']({'filename':_0x5cf491[_0x3ec1('0x43')],'content':Buffer[_0x3ec1('0x39')](_0x5cf491[_0x3ec1('0x44')])});}}}_0x5a2a7b(parseEmail(_0x33ef75,_0x13eb36,_0x460e1a));});}else{_0x13eb36[_0x3ec1('0x15')]=_0x3ec1('0x45');_0x5a2a7b(parseEmail(_0x33ef75,_0x13eb36,_0x460e1a));}}else{_0x5a2a7b(parseEmail(_0x33ef75,_0x13eb36,_0x460e1a));}};exports[_0x3ec1('0x46')]=function(_0x4b1926,_0x2d8582){var _0x5582d2=[_0x3ec1('0x47')+(_0x2d8582||''),'auth=Bearer\x20'+_0x4b1926,'',''];return Buffer[_0x3ec1('0x39')](_0x5582d2[_0x3ec1('0xf')](''),_0x3ec1('0x48'))['toString'](_0x3ec1('0x49'));}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index 799f3bf..c820722 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 _0x953e=['SERV','active','Imap','Smtp','exports','name','Service','key'];(function(_0xbea881,_0x376b80){var _0x538419=function(_0x50933c){while(--_0x50933c){_0xbea881['push'](_0xbea881['shift']());}};_0x538419(++_0x376b80);}(_0x953e,0x17d));var _0xe953=function(_0x55ed1,_0x474997){_0x55ed1=_0x55ed1-0x0;var _0x191d60=_0x953e[_0x55ed1];return _0x191d60;};'use strict';var _=require('lodash');function MailAccount(_0x2cc734){this['id']=_0x2cc734['id']||0x0;this[_0xe953('0x0')]=_0x2cc734[_0xe953('0x0')]||_0xe953('0x1');this[_0xe953('0x2')]=_0x2cc734[_0xe953('0x2')]||_0xe953('0x3');this[_0xe953('0x4')]=_0x2cc734['active']||![];this[_0xe953('0x5')]=_0x2cc734[_0xe953('0x5')]||[];this[_0xe953('0x6')]=_0x2cc734['Smtp']||[];}module[_0xe953('0x7')]=MailAccount; \ No newline at end of file +var _0xc7ea=['exports','name','Service','key','SERV','active','Imap'];(function(_0x307e23,_0x81517b){var _0x3f13b9=function(_0x367e){while(--_0x367e){_0x307e23['push'](_0x307e23['shift']());}};_0x3f13b9(++_0x81517b);}(_0xc7ea,0x13c));var _0xac7e=function(_0x2e3084,_0x170398){_0x2e3084=_0x2e3084-0x0;var _0x233549=_0xc7ea[_0x2e3084];return _0x233549;};'use strict';var _=require('lodash');function MailAccount(_0x106213){this['id']=_0x106213['id']||0x0;this[_0xac7e('0x0')]=_0x106213['name']||_0xac7e('0x1');this[_0xac7e('0x2')]=_0x106213[_0xac7e('0x2')]||_0xac7e('0x3');this['active']=_0x106213[_0xac7e('0x4')]||![];this[_0xac7e('0x5')]=_0x106213['Imap']||[];this['Smtp']=_0x106213['Smtp']||[];}module[_0xac7e('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 3f7df26..010083a 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 _0x242b=['mergeFromDatabase','mailAccounts','length','isUndefined','merge','exports','../model/mailAccount','mapKeys','hasOwnProperty','prototype'];(function(_0x2bf6f9,_0x14c39b){var _0xe910af=function(_0x4f7533){while(--_0x4f7533){_0x2bf6f9['push'](_0x2bf6f9['shift']());}};_0xe910af(++_0x14c39b);}(_0x242b,0x114));var _0xb242=function(_0x47b2dc,_0x52af9f){_0x47b2dc=_0x47b2dc-0x0;var _0x14daa3=_0x242b[_0x47b2dc];return _0x14daa3;};'use strict';var _=require('lodash');var MailAccount=require(_0xb242('0x0'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x35dbdd,_0x4a1ed4,_0x494817){var _0x433053=_[_0xb242('0x1')](_0x35dbdd,function(_0x3a3629,_0x4cf554){return _0x3a3629[_0x494817];});for(var _0x3a6070 in _0x4a1ed4){if(_0x4a1ed4[_0xb242('0x2')](_0x3a6070)){if(!_0x433053[_0x3a6070]){delete _0x4a1ed4[_0x3a6070];}}}}Realtime[_0xb242('0x3')][_0xb242('0x4')]=function(_0xf986ae,_0x554f0d){for(var _0x26babe in _0x554f0d){if(_0xf986ae['hasOwnProperty'](_0x26babe)){_0xf986ae[_0x26babe]=_0x554f0d[_0x26babe];}}};Realtime[_0xb242('0x3')]['initMailAccounts']=function(){var _0x5726a2=this;return function(_0x34dcf2){if(_0x34dcf2){freeIsNotKey(_0x34dcf2,_0x5726a2[_0xb242('0x5')],'id');for(var _0x321fd8=0x0,_0xcb188c={},_0x26e2f1={};_0x321fd8<_0x34dcf2[_0xb242('0x6')];_0x321fd8+=0x1){_0xcb188c=_0x34dcf2[_0x321fd8];if(_[_0xb242('0x7')](_0x5726a2[_0xb242('0x5')][_0xcb188c['id']])){_0x5726a2[_0xb242('0x5')][_0xcb188c['id']]=new MailAccount(_0xcb188c);}else{_[_0xb242('0x8')](_0x5726a2[_0xb242('0x5')][_0xcb188c['id']],_0xcb188c);}}}return _0x5726a2[_0xb242('0x5')];};};module[_0xb242('0x9')]=Realtime; \ No newline at end of file +var _0x6bc5=['mapKeys','hasOwnProperty','prototype','mergeFromDatabase','mailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6bc5,0x11c));var _0x56bc=function(_0x5cfac5,_0x3ea499){_0x5cfac5=_0x5cfac5-0x0;var _0x4c4b2d=_0x6bc5[_0x5cfac5];return _0x4c4b2d;};'use strict';var _=require(_0x56bc('0x0'));var MailAccount=require(_0x56bc('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x4eac99,_0x5244a8,_0x4a1bac){var _0x44eec0=_[_0x56bc('0x2')](_0x4eac99,function(_0x20a3ed,_0x5e42c9){return _0x20a3ed[_0x4a1bac];});for(var _0x4a8d4e in _0x5244a8){if(_0x5244a8[_0x56bc('0x3')](_0x4a8d4e)){if(!_0x44eec0[_0x4a8d4e]){delete _0x5244a8[_0x4a8d4e];}}}}Realtime[_0x56bc('0x4')][_0x56bc('0x5')]=function(_0x23ad75,_0x32c791){for(var _0x52d960 in _0x32c791){if(_0x23ad75[_0x56bc('0x3')](_0x52d960)){_0x23ad75[_0x52d960]=_0x32c791[_0x52d960];}}};Realtime['prototype']['initMailAccounts']=function(){var _0x4938ad=this;return function(_0x2ac061){if(_0x2ac061){freeIsNotKey(_0x2ac061,_0x4938ad[_0x56bc('0x6')],'id');for(var _0x41c6fa=0x0,_0x50981c={},_0x2021a8={};_0x41c6fa<_0x2ac061[_0x56bc('0x7')];_0x41c6fa+=0x1){_0x50981c=_0x2ac061[_0x41c6fa];if(_[_0x56bc('0x8')](_0x4938ad['mailAccounts'][_0x50981c['id']])){_0x4938ad['mailAccounts'][_0x50981c['id']]=new MailAccount(_0x50981c);}else{_[_0x56bc('0x9')](_0x4938ad[_0x56bc('0x6')][_0x50981c['id']],_0x50981c);}}}return _0x4938ad[_0x56bc('0x6')];};};module[_0x56bc('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index fa08261..1a72252 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 _0xc0a4=['GetMailAccount','provider','service','email','active','key','ListId','TemplateId','MailServerIn','Imap','CloudProvider','type','MailServerOut','data5','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts'];(function(_0x22c362,_0x275177){var _0x127aa1=function(_0x3a029b){while(--_0x3a029b){_0x22c362['push'](_0x22c362['shift']());}};_0x127aa1(++_0x275177);}(_0xc0a4,0xc6));var _0x4c0a=function(_0x1f4d0f,_0x596b2f){_0x1f4d0f=_0x1f4d0f-0x0;var _0x4e0a9e=_0xc0a4[_0x1f4d0f];return _0x4e0a9e;};'use strict';var client=require(_0x4c0a('0x0'));exports[_0x4c0a('0x1')]=function(){return function(){return client['Request'](_0x4c0a('0x2'),{'options':{'attributes':['id','name',_0x4c0a('0x3'),_0x4c0a('0x4'),_0x4c0a('0x5'),_0x4c0a('0x6'),_0x4c0a('0x7'),_0x4c0a('0x8'),_0x4c0a('0x9')],'raw':![],'include':[{'model':_0x4c0a('0xa'),'as':_0x4c0a('0xb'),'include':[{'model':_0x4c0a('0xc'),'attributes':['id','name',_0x4c0a('0x4'),_0x4c0a('0xd'),'data5'],'as':_0x4c0a('0xc')}]},{'model':_0x4c0a('0xe'),'as':'Smtp','include':[{'model':_0x4c0a('0xc'),'attributes':['id','name',_0x4c0a('0x4'),_0x4c0a('0xd'),_0x4c0a('0xf')],'as':_0x4c0a('0xc')}]}]},'log':_0x4c0a('0x10')});};};exports[_0x4c0a('0x11')]=function(_0x4e86fc,_0x4b75ee){return client[_0x4c0a('0x12')](_0x4c0a('0x13'),{'account':{'id':_0x4e86fc},'body':_0x4b75ee,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xadbb=['Imap','CloudProvider','data5','MailServerOut','type','Request','NotifyMailAccount','../client','GetMailAccount','name','provider','service','email','active','key','ListId','TemplateId','MailServerIn'];(function(_0x458f8f,_0x405864){var _0x133e2a=function(_0xbae5c3){while(--_0xbae5c3){_0x458f8f['push'](_0x458f8f['shift']());}};_0x133e2a(++_0x405864);}(_0xadbb,0x97));var _0xbadb=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xadbb[_0x2dafbe];return _0x58a45a;};'use strict';var client=require(_0xbadb('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xbadb('0x1'),{'options':{'attributes':['id',_0xbadb('0x2'),_0xbadb('0x3'),_0xbadb('0x4'),_0xbadb('0x5'),_0xbadb('0x6'),_0xbadb('0x7'),_0xbadb('0x8'),_0xbadb('0x9')],'raw':![],'include':[{'model':_0xbadb('0xa'),'as':_0xbadb('0xb'),'include':[{'model':_0xbadb('0xc'),'attributes':['id',_0xbadb('0x2'),_0xbadb('0x4'),'type',_0xbadb('0xd')],'as':_0xbadb('0xc')}]},{'model':_0xbadb('0xe'),'as':'Smtp','include':[{'model':_0xbadb('0xc'),'attributes':['id',_0xbadb('0x2'),_0xbadb('0x4'),_0xbadb('0xf'),_0xbadb('0xd')],'as':_0xbadb('0xc')}]}]},'log':'getMailAccount'});};};exports['notify']=function(_0x46adf9,_0x20cc60){return client[_0xbadb('0x10')](_0xbadb('0x11'),{'account':{'id':_0x46adf9},'body':_0x20cc60,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index a2ba625..5fa2f5f 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 _0x02fb=['../client','getSettings','Request','loginMailFrequency','GetSettings'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x02fb,0x122));var _0xb02f=function(_0x4fe4d3,_0x338e2a){_0x4fe4d3=_0x4fe4d3-0x0;var _0xf18a6b=_0x02fb[_0x4fe4d3];return _0xf18a6b;};'use strict';var client=require(_0xb02f('0x0'));exports[_0xb02f('0x1')]=function(){return client[_0xb02f('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xb02f('0x3')]},'log':_0xb02f('0x4')});}; \ No newline at end of file +var _0x8712=['loginMailFrequency','GetSettings','../client','getSettings','Request','ShowSetting'];(function(_0x2db328,_0xf8e678){var _0x15b8b5=function(_0x1e0447){while(--_0x1e0447){_0x2db328['push'](_0x2db328['shift']());}};_0x15b8b5(++_0xf8e678);}(_0x8712,0x19a));var _0x2871=function(_0x550937,_0x20e57d){_0x550937=_0x550937-0x0;var _0x3b33b7=_0x8712[_0x550937];return _0x3b33b7;};'use strict';var client=require(_0x2871('0x0'));exports[_0x2871('0x1')]=function(){return client[_0x2871('0x2')](_0x2871('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x2871('0x4')]},'log':_0x2871('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 06d5339..9faaf30 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xa9e0[_0x29b609];return _0x54c952;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_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 diff --git a/server/services/express/index.js b/server/services/express/index.js index 20d2c71..665b66d 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 _0xc560=['Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','sticky-session','../../config/environment','createServer','listen','port','socket.io','websocket','redis','localhost','adapter','socket.io-redis','../../config/socketio','../../routes','default','listening'];(function(_0x358b29,_0x218206){var _0x3f5216=function(_0x2d30d2){while(--_0x2d30d2){_0x358b29['push'](_0x358b29['shift']());}};_0x3f5216(++_0x218206);}(_0xc560,0x74));var _0x0c56=function(_0xceaf93,_0xb535fb){_0xceaf93=_0xceaf93-0x0;var _0x5fe486=_0xc560[_0xceaf93];return _0x5fe486;};'use strict';var _=require(_0x0c56('0x0'));var http=require('http');var express=require(_0x0c56('0x1'));var sticky=require(_0x0c56('0x2'));var Redis=require('ioredis');var config=require(_0x0c56('0x3'));var app=express();var server=http[_0x0c56('0x4')](app);server['timeout']=0xdbba0;if(sticky[_0x0c56('0x5')](server,config[_0x0c56('0x6')])){var socketio=require(_0x0c56('0x7'))(server,{'transports':[_0x0c56('0x8'),'polling']});config[_0x0c56('0x9')]=_['defaults'](config[_0x0c56('0x9')],{'host':_0x0c56('0xa'),'port':0x18eb});socketio[_0x0c56('0xb')](require(_0x0c56('0xc'))({'pubClient':new Redis(config[_0x0c56('0x9')]),'subClient':new Redis(config[_0x0c56('0x9')])}));require('../../config/triggers')['default']();require(_0x0c56('0xd'))['default'](socketio);require('../../config/express')['default'](app);require(_0x0c56('0xe'))[_0x0c56('0xf')](app);}else{server['once'](_0x0c56('0x10'),function(){console['log'](_0x0c56('0x11'),config[_0x0c56('0x6')]);});}exports=module[_0x0c56('0x12')]=app; \ No newline at end of file +var _0xdfbc=['port','lodash','http','express','sticky-session','ioredis','../../config/environment','timeout','socket.io','websocket','defaults','redis','localhost','socket.io-redis','../../config/triggers','default','../../config/express','log'];(function(_0x5341ff,_0x1de6df){var _0x53be58=function(_0x4da0da){while(--_0x4da0da){_0x5341ff['push'](_0x5341ff['shift']());}};_0x53be58(++_0x1de6df);}(_0xdfbc,0x145));var _0xcdfb=function(_0x2b8ca3,_0x1bae1f){_0x2b8ca3=_0x2b8ca3-0x0;var _0x3a4027=_0xdfbc[_0x2b8ca3];return _0x3a4027;};'use strict';var _=require(_0xcdfb('0x0'));var http=require(_0xcdfb('0x1'));var express=require(_0xcdfb('0x2'));var sticky=require(_0xcdfb('0x3'));var Redis=require(_0xcdfb('0x4'));var config=require(_0xcdfb('0x5'));var app=express();var server=http['createServer'](app);server[_0xcdfb('0x6')]=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0xcdfb('0x7'))(server,{'transports':[_0xcdfb('0x8'),'polling']});config['redis']=_[_0xcdfb('0x9')](config[_0xcdfb('0xa')],{'host':_0xcdfb('0xb'),'port':0x18eb});socketio['adapter'](require(_0xcdfb('0xc'))({'pubClient':new Redis(config[_0xcdfb('0xa')]),'subClient':new Redis(config[_0xcdfb('0xa')])}));require(_0xcdfb('0xd'))[_0xcdfb('0xe')]();require('../../config/socketio')[_0xcdfb('0xe')](socketio);require(_0xcdfb('0xf'))['default'](app);require('../../routes')[_0xcdfb('0xe')](app);}else{server['once']('listening',function(){console[_0xcdfb('0x10')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0xcdfb('0x11')]);});}exports=module['exports']=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index fcaa2e5..019be5c 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 _0x8db9=['message','result','catch','exports','jayson/promise','bluebird','routing','Request','request','debug','rpc','error'];(function(_0x9dab0d,_0x2bed46){var _0x3c36fa=function(_0x3ebacd){while(--_0x3ebacd){_0x9dab0d['push'](_0x9dab0d['shift']());}};_0x3c36fa(++_0x2bed46);}(_0x8db9,0x160));var _0x98db=function(_0x330ec0,_0x21bcde){_0x330ec0=_0x330ec0-0x0;var _0x561f6e=_0x8db9[_0x330ec0];return _0x561f6e;};'use strict';var jayson=require(_0x98db('0x0'));var BPromise=require(_0x98db('0x1'));var logger=require('../../config/logger')(_0x98db('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x98db('0x3')]=function(_0x513c82,_0xfd1be1){return new BPromise(function(_0x33c191,_0x302423){return client[_0x98db('0x4')](_0x513c82,_0xfd1be1)['then'](function(_0x2cfa9d){logger[_0x98db('0x5')](_0x98db('0x6'),_0x98db('0x2'),_0x513c82,_0xfd1be1,_0x2cfa9d);if(_0x2cfa9d[_0x98db('0x7')]){logger[_0x98db('0x7')](_0x98db('0x6'),_0x98db('0x2'),_0x513c82,_0x2cfa9d['error'][_0x98db('0x8')],_0xfd1be1);return _0x302423(_0x2cfa9d['error'][_0x98db('0x8')]);}else{return _0x33c191(_0x2cfa9d[_0x98db('0x9')]);}})[_0x98db('0xa')](function(_0x1e8e00){logger[_0x98db('0x7')](_0x98db('0x6'),_0x98db('0x2'),_0x513c82,_0x1e8e00,_0xfd1be1);return _0x302423(_0x1e8e00);});});};module[_0x98db('0xb')]=client; \ No newline at end of file +var _0x4d4e=['debug','rpc','error','message','result','catch','jayson/promise','bluebird','../../config/logger','routing','client','http','request','then'];(function(_0x43776a,_0x4eb74c){var _0x18eb8f=function(_0x319afb){while(--_0x319afb){_0x43776a['push'](_0x43776a['shift']());}};_0x18eb8f(++_0x4eb74c);}(_0x4d4e,0x156));var _0xe4d4=function(_0x52bd10,_0x192e9f){_0x52bd10=_0x52bd10-0x0;var _0x457cf2=_0x4d4e[_0x52bd10];return _0x457cf2;};'use strict';var jayson=require(_0xe4d4('0x0'));var BPromise=require(_0xe4d4('0x1'));var logger=require(_0xe4d4('0x2'))(_0xe4d4('0x3'));var client=jayson[_0xe4d4('0x4')][_0xe4d4('0x5')]({'port':0x2329});client['Request']=function(_0x543f10,_0x21d426){return new BPromise(function(_0x3d9f72,_0x57bc2c){return client[_0xe4d4('0x6')](_0x543f10,_0x21d426)[_0xe4d4('0x7')](function(_0x3cfb49){logger[_0xe4d4('0x8')](_0xe4d4('0x9'),_0xe4d4('0x3'),_0x543f10,_0x21d426,_0x3cfb49);if(_0x3cfb49['error']){logger[_0xe4d4('0xa')](_0xe4d4('0x9'),_0xe4d4('0x3'),_0x543f10,_0x3cfb49[_0xe4d4('0xa')][_0xe4d4('0xb')],_0x21d426);return _0x57bc2c(_0x3cfb49[_0xe4d4('0xa')][_0xe4d4('0xb')]);}else{return _0x3d9f72(_0x3cfb49[_0xe4d4('0xc')]);}})[_0xe4d4('0xd')](function(_0x4d3563){logger[_0xe4d4('0xa')](_0xe4d4('0x9'),_0xe4d4('0x3'),_0x543f10,_0x4d3563,_0x21d426);return _0x57bc2c(_0x4d3563);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index ac40c8d..7b8c1e7 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 _0x0839=['getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0x0839,0x125));var _0x9083=function(_0xc16fdc,_0x55c586){_0xc16fdc=_0xc16fdc-0x0;var _0x2b53ca=_0x0839[_0xc16fdc];return _0x2b53ca;};'use strict';var BPromise=require(_0x9083('0x0'));var server=require(_0x9083('0x1'));var Realtime=require(_0x9083('0x2'));var user=require(_0x9083('0x3'));var interval=require(_0x9083('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x9083('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0x9083('0x6'));var whatsappQueue=require(_0x9083('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9083('0x8')]()[_0x9083('0x9')](user[_0x9083('0xa')]())[_0x9083('0x9')](realtime[_0x9083('0xb')]())[_0x9083('0x9')](interval['getIntervals']())['then'](realtime[_0x9083('0xc')]())['then'](openchannelQueue[_0x9083('0xd')]())['then'](realtime[_0x9083('0xe')]())[_0x9083('0x9')](chatQueue[_0x9083('0xf')]())[_0x9083('0x9')](realtime[_0x9083('0x10')]())['then'](smsQueue[_0x9083('0x11')]())[_0x9083('0x9')](realtime[_0x9083('0x12')]())['then'](mailQueue[_0x9083('0x13')]())['then'](realtime[_0x9083('0x14')]())[_0x9083('0x9')](faxQueue[_0x9083('0x15')]())['then'](realtime[_0x9083('0x16')]())[_0x9083('0x9')](whatsappQueue[_0x9083('0x17')]())['then'](realtime[_0x9083('0x18')]())['then'](function(){return realtime;});}function main(){return server[_0x9083('0x19')](realtime)[_0x9083('0x9')](function(_0x3eee47){return initRealtime();})['then'](function(_0xb8824d){return setInterval(initRealtime,0x1388);})[_0x9083('0x1a')](function(_0x73f7b2){console[_0x9083('0x1b')](_0x73f7b2);});}main(); \ No newline at end of file +var _0x1ddc=['getMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0x1ddc,0x110));var _0xc1dd=function(_0x3d7bf8,_0x4f1f4f){_0x3d7bf8=_0x3d7bf8-0x0;var _0x512d3d=_0x1ddc[_0x3d7bf8];return _0x512d3d;};'use strict';var BPromise=require(_0xc1dd('0x0'));var server=require('./server');var Realtime=require(_0xc1dd('0x1'));var user=require(_0xc1dd('0x2'));var interval=require(_0xc1dd('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0xc1dd('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require('./rpc/mailQueue');var faxQueue=require(_0xc1dd('0x5'));var whatsappQueue=require(_0xc1dd('0x6'));var realtime=new Realtime();function initRealtime(){return BPromise[_0xc1dd('0x7')]()[_0xc1dd('0x8')](user['getAgents']())[_0xc1dd('0x8')](realtime['initAgents']())[_0xc1dd('0x8')](interval[_0xc1dd('0x9')]())['then'](realtime[_0xc1dd('0xa')]())[_0xc1dd('0x8')](openchannelQueue[_0xc1dd('0xb')]())[_0xc1dd('0x8')](realtime['initOpenchannelQueues']())[_0xc1dd('0x8')](chatQueue[_0xc1dd('0xc')]())[_0xc1dd('0x8')](realtime[_0xc1dd('0xd')]())[_0xc1dd('0x8')](smsQueue[_0xc1dd('0xe')]())[_0xc1dd('0x8')](realtime[_0xc1dd('0xf')]())[_0xc1dd('0x8')](mailQueue[_0xc1dd('0x10')]())[_0xc1dd('0x8')](realtime['initMailQueues']())[_0xc1dd('0x8')](faxQueue[_0xc1dd('0x11')]())[_0xc1dd('0x8')](realtime[_0xc1dd('0x12')]())[_0xc1dd('0x8')](whatsappQueue[_0xc1dd('0x13')]())[_0xc1dd('0x8')](realtime[_0xc1dd('0x14')]())[_0xc1dd('0x8')](function(){return realtime;});}function main(){return server[_0xc1dd('0x15')](realtime)[_0xc1dd('0x8')](function(_0x49db5b){return initRealtime();})['then'](function(_0x2a81c9){return setInterval(initRealtime,0x1388);})[_0xc1dd('0x16')](function(_0x42dd00){console[_0xc1dd('0x17')](_0x42dd00);});}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 c32fbb0..149e580 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x2c0b0f,_0x1d0f41){var _0x23a9f6=function(_0x23363e){while(--_0x23363e){_0x2c0b0f['push'](_0x2c0b0f['shift']());}};_0x23a9f6(++_0x1d0f41);}(_0xe14b,0x93));var _0xbe14=function(_0x591884,_0x366062){_0x591884=_0x591884-0x0;var _0x2989f6=_0xe14b[_0x591884];return _0x2989f6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine; \ No newline at end of file +var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x488c71,_0x30c149){var _0x3a13ae=function(_0x423146){while(--_0x423146){_0x488c71['push'](_0x488c71['shift']());}};_0x3a13ae(++_0x30c149);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x5fc3[_0x1057a3];return _0x131cdb;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 6ce7d0f..b1e0418 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 _0xcebf=['message','result','sendMailMessage','bluebird','jayson/promise','http','request','then','error'];(function(_0x1aadf9,_0x2a74cd){var _0x3c6f76=function(_0x33f60e){while(--_0x33f60e){_0x1aadf9['push'](_0x1aadf9['shift']());}};_0x3c6f76(++_0x2a74cd);}(_0xcebf,0xa5));var _0xfceb=function(_0x2abf59,_0x25f7ce){_0x2abf59=_0x2abf59-0x0;var _0x51548d=_0xcebf[_0x2abf59];return _0x51548d;};'use strict';var BPromise=require(_0xfceb('0x0'));var jayson=require(_0xfceb('0x1'));var client=jayson['client'][_0xfceb('0x2')]({'port':0x232b});function request(_0x17f5ef,_0x3711d7){return new BPromise(function(_0x1a1631,_0x34ce74){return client[_0xfceb('0x3')](_0x17f5ef,_0x3711d7)[_0xfceb('0x4')](function(_0x576fb0){if(_0x576fb0[_0xfceb('0x5')]){return _0x34ce74(_0x576fb0[_0xfceb('0x5')][_0xfceb('0x6')]);}else{return _0x1a1631(_0x576fb0[_0xfceb('0x7')]);}})['catch'](function(_0x1f3ab8){return _0x34ce74(_0x1f3ab8);});});}exports[_0xfceb('0x8')]=function(_0x2ece51,_0x433958){return request('SendMail',{'account':_0x2ece51,'message':_0x433958});}; \ No newline at end of file +var _0xeaaf=['result','catch','SendMail','bluebird','client','http','then','error','message'];(function(_0x4a9ad7,_0x51f4cd){var _0x10f7cc=function(_0x1259f9){while(--_0x1259f9){_0x4a9ad7['push'](_0x4a9ad7['shift']());}};_0x10f7cc(++_0x51f4cd);}(_0xeaaf,0x1ce));var _0xfeaa=function(_0x3e4f9e,_0x1c573b){_0x3e4f9e=_0x3e4f9e-0x0;var _0x188769=_0xeaaf[_0x3e4f9e];return _0x188769;};'use strict';var BPromise=require(_0xfeaa('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xfeaa('0x1')][_0xfeaa('0x2')]({'port':0x232b});function request(_0x59090e,_0x27c353){return new BPromise(function(_0x5c1619,_0x318fc8){return client['request'](_0x59090e,_0x27c353)[_0xfeaa('0x3')](function(_0x59379d){if(_0x59379d[_0xfeaa('0x4')]){return _0x318fc8(_0x59379d[_0xfeaa('0x4')][_0xfeaa('0x5')]);}else{return _0x5c1619(_0x59379d[_0xfeaa('0x6')]);}})[_0xfeaa('0x7')](function(_0x46e81b){return _0x318fc8(_0x46e81b);});});}exports['sendMailMessage']=function(_0x32deca,_0x1fce12){return request(_0xfeaa('0x8'),{'account':_0x32deca,'message':_0x1fce12});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index a159aac..5881b8e 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 _0xffe9=['md5','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','whatsapp','length','Status','toNumber','online','mailStatusTime','smsStatusTime','whatsappStatus','busyQueue','smsWaitingInteractions','stringify','emit','user:routing:update','omit','exports','lodash','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy'];(function(_0x42c21a,_0x38ff30){var _0x1b07bb=function(_0x27ed44){while(--_0x27ed44){_0x42c21a['push'](_0x42c21a['shift']());}};_0x1b07bb(++_0x38ff30);}(_0xffe9,0x117));var _0x9ffe=function(_0x277721,_0x46971e){_0x277721=_0x277721-0x0;var _0x286051=_0xffe9[_0x277721];return _0x286051;};'use strict';var _=require(_0x9ffe('0x0'));var md5=require('md5');var moment=require('moment');var Redis=require(_0x9ffe('0x1'));var config=require(_0x9ffe('0x2'));config[_0x9ffe('0x3')]=_[_0x9ffe('0x4')](config[_0x9ffe('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x9ffe('0x5'))(new Redis(config[_0x9ffe('0x3')]));function Agent(_0x208ddd){this['id']=_0x208ddd['id']||0x0;this[_0x9ffe('0x6')]=_0x208ddd[_0x9ffe('0x6')]||'';this[_0x9ffe('0x7')]=_0x208ddd[_0x9ffe('0x7')]||![];this['chatPause']=_0x208ddd[_0x9ffe('0x8')]||![];this[_0x9ffe('0x9')]=_0x208ddd[_0x9ffe('0x9')]||![];this[_0x9ffe('0xa')]=_0x208ddd[_0x9ffe('0xa')]||![];this[_0x9ffe('0xb')]=_0x208ddd[_0x9ffe('0xb')]||![];this[_0x9ffe('0xc')]=_0x208ddd[_0x9ffe('0xc')]||![];this[_0x9ffe('0xd')]=_0x9ffe('0xe');this[_0x9ffe('0xf')]=0x0;this[_0x9ffe('0x10')]=_0x208ddd[_0x9ffe('0x10')]||0x0;this[_0x9ffe('0x11')]=0x0;this[_0x9ffe('0x12')]=_0x9ffe('0xe');this['mailStatusTime']=0x0;this[_0x9ffe('0x13')]=_0x208ddd['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x9ffe('0x14')]=_0x9ffe('0xe');this['faxStatusTime']=0x0;this['faxCapacity']=_0x208ddd['faxCapacity']||0x0;this[_0x9ffe('0x15')]=0x0;this[_0x9ffe('0x16')]=_0x9ffe('0xe');this['smsStatusTime']=0x0;this[_0x9ffe('0x17')]=_0x208ddd['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x9ffe('0x18')]=0x0;this[_0x9ffe('0x19')]=_0x208ddd['whatsappCapacity']||0x0;this[_0x9ffe('0x1a')]=0x0;this[_0x9ffe('0x1b')]='unknown';this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x208ddd[_0x9ffe('0x1c')]||0x0;this[_0x9ffe('0x1d')]=0x0;this[_0x9ffe('0x1e')]=![];this['busyQueue']=undefined;this[_0x9ffe('0x1f')]='';this[_0x9ffe('0x20')]={};this[_0x9ffe('0x21')]={};this[_0x9ffe('0x22')]={};this[_0x9ffe('0x23')]={};this['smsWaitingInteractions']={};this[_0x9ffe('0x24')]={};this[_0x9ffe('0x25')]();}Agent[_0x9ffe('0x26')][_0x9ffe('0x27')]=function(_0x4451d2){if(this[_0x4451d2+_0x9ffe('0x28')]>0x0){if(this[_0x4451d2+_0x9ffe('0x29')]>0x0&&this[_0x4451d2+_0x9ffe('0x28')]>=this[_0x4451d2+_0x9ffe('0x29')]){return _0x9ffe('0x2a');}else{return _0x9ffe('0x2b');}}else{return _0x9ffe('0x2c');}};Agent['prototype'][_0x9ffe('0x25')]=function(){var _0x36d7df=[_0x9ffe('0x2d'),'chat',_0x9ffe('0x2e'),'fax','sms',_0x9ffe('0x2f')];for(var _0xe6d824=0x0;_0xe6d824<_0x36d7df[_0x9ffe('0x30')];_0xe6d824+=0x1){var _0x399711=this[_0x9ffe('0x27')](_0x36d7df[_0xe6d824]);if(this[_0x36d7df[_0xe6d824]+_0x9ffe('0x31')]!==_0x399711){this[_0x36d7df[_0xe6d824]+'StatusTime']=_[_0x9ffe('0x32')](moment()['format']('x'));}this[_0x36d7df[_0xe6d824]+_0x9ffe('0x31')]=_0x399711;}var _0xa63ed7={'id':this['id'],'name':this['name'],'online':this[_0x9ffe('0x33')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0x9ffe('0xc')],'chatStatus':this[_0x9ffe('0xd')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0x9ffe('0x10')],'chatCurrentCapacity':this[_0x9ffe('0x11')],'mailStatus':this[_0x9ffe('0x12')],'mailStatusTime':this[_0x9ffe('0x34')],'mailCapacity':this[_0x9ffe('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x9ffe('0x14')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x9ffe('0x15')],'smsStatus':this[_0x9ffe('0x16')],'smsStatusTime':this[_0x9ffe('0x35')],'smsCapacity':this[_0x9ffe('0x17')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x9ffe('0x36')],'whatsappStatusTime':this[_0x9ffe('0x18')],'whatsappCapacity':this[_0x9ffe('0x19')],'whatsappCurrentCapacity':this[_0x9ffe('0x1a')],'openchannelStatus':this[_0x9ffe('0x1b')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this['busy'],'busyQueue':this[_0x9ffe('0x37')],'chatWaitingInteractions':this[_0x9ffe('0x20')],'faxWaitingInteractions':this[_0x9ffe('0x21')],'mailWaitingInteractions':this[_0x9ffe('0x22')],'openchannelWaitingInteractions':this[_0x9ffe('0x23')],'smsWaitingInteractions':this[_0x9ffe('0x38')],'whatsappWaitingInteractions':this[_0x9ffe('0x24')]};var _0x4fd53a=md5(JSON[_0x9ffe('0x39')](_0xa63ed7));if(this[_0x9ffe('0x1f')]!==_0x4fd53a){this[_0x9ffe('0x1f')]=_0x4fd53a;io[_0x9ffe('0x3a')](_0x9ffe('0x3b'),_[_0x9ffe('0x3c')](_0xa63ed7,[_0x9ffe('0x33')]));}};module[_0x9ffe('0x3d')]=Agent; \ No newline at end of file +var _0x3ed5=['redis','localhost','socket.io-emitter','name','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','chatWaitingInteractions','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','prototype','CurrentCapacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','StatusTime','toNumber','Status','chatStatusTime','mailStatus','whatsappStatus','openchannelStatusTime','user:routing:update','omit','exports','md5','ioredis','defaults'];(function(_0x549a38,_0x37e9f8){var _0x44c912=function(_0x1acf2b){while(--_0x1acf2b){_0x549a38['push'](_0x549a38['shift']());}};_0x44c912(++_0x37e9f8);}(_0x3ed5,0x1ed));var _0x53ed=function(_0x118c10,_0x400a43){_0x118c10=_0x118c10-0x0;var _0x57e31b=_0x3ed5[_0x118c10];return _0x57e31b;};'use strict';var _=require('lodash');var md5=require(_0x53ed('0x0'));var moment=require('moment');var Redis=require(_0x53ed('0x1'));var config=require('../../../config/environment');config['redis']=_[_0x53ed('0x2')](config[_0x53ed('0x3')],{'host':_0x53ed('0x4'),'port':0x18eb});var io=require(_0x53ed('0x5'))(new Redis(config[_0x53ed('0x3')]));function Agent(_0x3e1897){this['id']=_0x3e1897['id']||0x0;this[_0x53ed('0x6')]=_0x3e1897[_0x53ed('0x6')]||'';this[_0x53ed('0x7')]=_0x3e1897[_0x53ed('0x7')]||![];this[_0x53ed('0x8')]=_0x3e1897['chatPause']||![];this['mailPause']=_0x3e1897[_0x53ed('0x9')]||![];this[_0x53ed('0xa')]=_0x3e1897['faxPause']||![];this['smsPause']=_0x3e1897[_0x53ed('0xb')]||![];this[_0x53ed('0xc')]=_0x3e1897['openchannelPause']||![];this['chatStatus']=_0x53ed('0xd');this['chatStatusTime']=0x0;this[_0x53ed('0xe')]=_0x3e1897['chatCapacity']||0x0;this[_0x53ed('0xf')]=0x0;this['mailStatus']='unknown';this[_0x53ed('0x10')]=0x0;this[_0x53ed('0x11')]=_0x3e1897[_0x53ed('0x11')]||0x0;this[_0x53ed('0x12')]=0x0;this[_0x53ed('0x13')]=_0x53ed('0xd');this[_0x53ed('0x14')]=0x0;this[_0x53ed('0x15')]=_0x3e1897[_0x53ed('0x15')]||0x0;this[_0x53ed('0x16')]=0x0;this[_0x53ed('0x17')]=_0x53ed('0xd');this[_0x53ed('0x18')]=0x0;this['smsCapacity']=_0x3e1897[_0x53ed('0x19')]||0x0;this[_0x53ed('0x1a')]=0x0;this['whatsappStatus']=_0x53ed('0xd');this[_0x53ed('0x1b')]=0x0;this[_0x53ed('0x1c')]=_0x3e1897[_0x53ed('0x1c')]||0x0;this[_0x53ed('0x1d')]=0x0;this[_0x53ed('0x1e')]='unknown';this['openchannelStatusTime']=0x0;this[_0x53ed('0x1f')]=_0x3e1897[_0x53ed('0x1f')]||0x0;this[_0x53ed('0x20')]=0x0;this[_0x53ed('0x21')]=![];this[_0x53ed('0x22')]=undefined;this[_0x53ed('0x0')]='';this[_0x53ed('0x23')]={};this[_0x53ed('0x24')]={};this[_0x53ed('0x25')]={};this[_0x53ed('0x26')]={};this[_0x53ed('0x27')]={};this[_0x53ed('0x28')]={};this['updateRealtime']();}Agent[_0x53ed('0x29')]['getChannelStatus']=function(_0x5c1f0f){if(this[_0x5c1f0f+_0x53ed('0x2a')]>0x0){if(this[_0x5c1f0f+'Capacity']>0x0&&this[_0x5c1f0f+'CurrentCapacity']>=this[_0x5c1f0f+'Capacity']){return _0x53ed('0x2b');}else{return _0x53ed('0x2c');}}else{return _0x53ed('0x2d');}};Agent[_0x53ed('0x29')]['updateRealtime']=function(){var _0xf204b7=[_0x53ed('0x2e'),_0x53ed('0x2f'),'openchannel',_0x53ed('0x30'),_0x53ed('0x31'),_0x53ed('0x32')];for(var _0x5b828e=0x0;_0x5b828e<_0xf204b7[_0x53ed('0x33')];_0x5b828e+=0x1){var _0x1d3a2b=this['getChannelStatus'](_0xf204b7[_0x5b828e]);if(this[_0xf204b7[_0x5b828e]+'Status']!==_0x1d3a2b){this[_0xf204b7[_0x5b828e]+_0x53ed('0x34')]=_[_0x53ed('0x35')](moment()['format']('x'));}this[_0xf204b7[_0x5b828e]+_0x53ed('0x36')]=_0x1d3a2b;}var _0x3cfdeb={'id':this['id'],'name':this[_0x53ed('0x6')],'online':this['online'],'voicePause':this[_0x53ed('0x7')],'chatPause':this[_0x53ed('0x8')],'mailPause':this[_0x53ed('0x9')],'smsPause':this[_0x53ed('0xb')],'faxPause':this['faxPause'],'openchannelPause':this[_0x53ed('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x53ed('0x37')],'chatCapacity':this[_0x53ed('0xe')],'chatCurrentCapacity':this[_0x53ed('0xf')],'mailStatus':this[_0x53ed('0x38')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x53ed('0x12')],'faxStatus':this[_0x53ed('0x13')],'faxStatusTime':this[_0x53ed('0x14')],'faxCapacity':this[_0x53ed('0x15')],'faxCurrentCapacity':this[_0x53ed('0x16')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x53ed('0x18')],'smsCapacity':this[_0x53ed('0x19')],'smsCurrentCapacity':this[_0x53ed('0x1a')],'whatsappStatus':this[_0x53ed('0x39')],'whatsappStatusTime':this['whatsappStatusTime'],'whatsappCapacity':this[_0x53ed('0x1c')],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x53ed('0x1e')],'openchannelStatusTime':this[_0x53ed('0x3a')],'openchannelCapacity':this[_0x53ed('0x1f')],'openchannelCurrentCapacity':this[_0x53ed('0x20')],'busy':this[_0x53ed('0x21')],'busyQueue':this[_0x53ed('0x22')],'chatWaitingInteractions':this[_0x53ed('0x23')],'faxWaitingInteractions':this[_0x53ed('0x24')],'mailWaitingInteractions':this[_0x53ed('0x25')],'openchannelWaitingInteractions':this[_0x53ed('0x26')],'smsWaitingInteractions':this[_0x53ed('0x27')],'whatsappWaitingInteractions':this[_0x53ed('0x28')]};var _0xc07810=md5(JSON['stringify'](_0x3cfdeb));if(this[_0x53ed('0x0')]!==_0xc07810){this[_0x53ed('0x0')]=_0xc07810;io['emit'](_0x53ed('0x3b'),_[_0x53ed('0x3c')](_0x3cfdeb,['online']));}};module[_0x53ed('0x3d')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 9a8ac6b..23fa718 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 _0x1e72=['chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','length','online'];(function(_0x56936d,_0xfd869d){var _0x2fbd92=function(_0x226bb0){while(--_0x226bb0){_0x56936d['push'](_0x56936d['shift']());}};_0x2fbd92(++_0xfd869d);}(_0x1e72,0x69));var _0x21e7=function(_0x502cf2,_0x427da0){_0x502cf2=_0x502cf2-0x0;var _0x201837=_0x1e72[_0x502cf2];return _0x201837;};'use strict';var _=require(_0x21e7('0x0'));var md5=require(_0x21e7('0x1'));var util=require(_0x21e7('0x2'));var Redis=require(_0x21e7('0x3'));var config=require(_0x21e7('0x4'));config[_0x21e7('0x5')]=_[_0x21e7('0x6')](config[_0x21e7('0x5')],{'host':_0x21e7('0x7'),'port':0x18eb});var io=require(_0x21e7('0x8'))(new Redis(config['redis']));function ChatQueue(_0x1b5e5e){this['id']=_0x1b5e5e['id']||0x0;this[_0x21e7('0x9')]=_0x1b5e5e[_0x21e7('0x9')]||'';this['timeout']=_0x1b5e5e[_0x21e7('0xa')]||0xa;this[_0x21e7('0xb')]=_0x1b5e5e['strategy']||_0x21e7('0xc');this['Agents']=_0x1b5e5e[_0x21e7('0xd')];this[_0x21e7('0xe')]={};this[_0x21e7('0xf')]=0x0;this[_0x21e7('0x1')]='';this[_0x21e7('0x10')]();this['updateRealtime']();}ChatQueue[_0x21e7('0x11')][_0x21e7('0x10')]=function(){var _0x4f810b=this[_0x21e7('0xe')]['_rr'];this[_0x21e7('0xe')]=_[_0x21e7('0x12')](this['Agents'],'id');this['mapAgentsId'][_0x21e7('0x13')]=_0x4f810b;};ChatQueue[_0x21e7('0x11')][_0x21e7('0x14')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x2d81b4=0x0;_0x2d81b4=0x0?this[_0x21e7('0x19')]:0x0;var _0x1c3dbf={'id':this['id'],'available':this[_0x21e7('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this[_0x21e7('0x18')],'waiting':this[_0x21e7('0xf')]};var _0x152406=md5(JSON[_0x21e7('0x1a')](_0x1c3dbf));if(this[_0x21e7('0x1')]!==_0x152406){this['md5']=_0x152406;io['to'](util[_0x21e7('0x1b')](_0x21e7('0x1c'),_0x1c3dbf[_0x21e7('0x9')]))[_0x21e7('0x1d')](_0x21e7('0x1e'),_0x1c3dbf);}};module[_0x21e7('0x1f')]=ChatQueue; \ No newline at end of file +var _0xdb80=['timeout','beepall','Agents','mapAgentsId','md5','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','available','name','waiting','stringify','chat:queue:%s','emit','chat_queue:save','exports','lodash','../../../config/environment','defaults','socket.io-emitter','redis'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0xdb80,0xaa));var _0x0db8=function(_0x494bba,_0x10541e){_0x494bba=_0x494bba-0x0;var _0x3fa4b3=_0xdb80[_0x494bba];return _0x3fa4b3;};'use strict';var _=require(_0x0db8('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x0db8('0x1'));config['redis']=_[_0x0db8('0x2')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x0db8('0x3'))(new Redis(config[_0x0db8('0x4')]));function ChatQueue(_0x51391a){this['id']=_0x51391a['id']||0x0;this['name']=_0x51391a['name']||'';this[_0x0db8('0x5')]=_0x51391a['timeout']||0xa;this['strategy']=_0x51391a['strategy']||_0x0db8('0x6');this[_0x0db8('0x7')]=_0x51391a['Agents'];this[_0x0db8('0x8')]={};this['waiting']=0x0;this[_0x0db8('0x9')]='';this[_0x0db8('0xa')]();this['updateRealtime']();}ChatQueue[_0x0db8('0xb')][_0x0db8('0xa')]=function(){var _0x2a860b=this[_0x0db8('0x8')][_0x0db8('0xc')];this[_0x0db8('0x8')]=_['map'](this[_0x0db8('0x7')],'id');this[_0x0db8('0x8')][_0x0db8('0xc')]=_0x2a860b;};ChatQueue['prototype'][_0x0db8('0xd')]=function(){this[_0x0db8('0xe')]=0x0;this[_0x0db8('0xf')]=0x0;for(var _0x891db9=0x0;_0x891db9=0x0?this[_0x0db8('0x11')]:0x0;var _0x5b9abd={'id':this['id'],'available':this['available'],'loggedIn':this[_0x0db8('0xe')],'name':this[_0x0db8('0x12')],'paused':this[_0x0db8('0xf')],'waiting':this[_0x0db8('0x13')]};var _0x21fdd3=md5(JSON[_0x0db8('0x14')](_0x5b9abd));if(this[_0x0db8('0x9')]!==_0x21fdd3){this[_0x0db8('0x9')]=_0x21fdd3;io['to'](util['format'](_0x0db8('0x15'),_0x5b9abd['name']))[_0x0db8('0x16')](_0x0db8('0x17'),_0x5b9abd);}};module[_0x0db8('0x18')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 16c6794..d961343 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 _0xce7c=['prototype','map','Agents','mapAgentsId','_rr','loggedIn','paused','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','waiting','updateRouting','updateRealtime'];(function(_0x455912,_0x354916){var _0x2b3343=function(_0xe72dcb){while(--_0xe72dcb){_0x455912['push'](_0x455912['shift']());}};_0x2b3343(++_0x354916);}(_0xce7c,0xea));var _0xcce7=function(_0x3cef2a,_0x48bc9d){_0x3cef2a=_0x3cef2a-0x0;var _0x4a303b=_0xce7c[_0x3cef2a];return _0x4a303b;};'use strict';var _=require(_0xcce7('0x0'));var md5=require(_0xcce7('0x1'));var util=require(_0xcce7('0x2'));var Redis=require('ioredis');var config=require(_0xcce7('0x3'));config['redis']=_[_0xcce7('0x4')](config[_0xcce7('0x5')],{'host':_0xcce7('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xcce7('0x5')]));function FaxQueue(_0x524c09){this['id']=_0x524c09['id']||0x0;this['name']=_0x524c09[_0xcce7('0x7')]||'';this['timeout']=_0x524c09[_0xcce7('0x8')]||0xa;this[_0xcce7('0x9')]=_0x524c09['strategy']||_0xcce7('0xa');this['Agents']=_0x524c09['Agents'];this['mapAgentsId']={};this[_0xcce7('0xb')]=0x0;this[_0xcce7('0x1')]='';this[_0xcce7('0xc')]();this[_0xcce7('0xd')]();}FaxQueue[_0xcce7('0xe')][_0xcce7('0xc')]=function(){var _0x531a1c=this['mapAgentsId']['_rr'];this['mapAgentsId']=_[_0xcce7('0xf')](this[_0xcce7('0x10')],'id');this[_0xcce7('0x11')][_0xcce7('0x12')]=_0x531a1c;};FaxQueue[_0xcce7('0xe')][_0xcce7('0xd')]=function(){this[_0xcce7('0x13')]=0x0;this[_0xcce7('0x14')]=0x0;for(var _0x1ab5bd=0x0;_0x1ab5bd=0x0?this['available']:0x0;var _0x3a0bd8={'id':this['id'],'available':this[_0xcce7('0x18')],'loggedIn':this[_0xcce7('0x13')],'name':this[_0xcce7('0x7')],'paused':this['paused'],'waiting':this[_0xcce7('0xb')]};var _0x304a81=md5(JSON[_0xcce7('0x19')](_0x3a0bd8));if(this['md5']!==_0x304a81){this[_0xcce7('0x1')]=_0x304a81;io['to'](util[_0xcce7('0x1a')](_0xcce7('0x1b'),_0x3a0bd8['name']))[_0xcce7('0x1c')](_0xcce7('0x1d'),_0x3a0bd8);}};module[_0xcce7('0x1e')]=FaxQueue; \ No newline at end of file +var _0x2647=['defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','updateRouting','map','_rr','prototype','loggedIn','paused','length','faxPause','available','stringify','md5','format','emit','exports','lodash','util','ioredis','../../../config/environment','redis'];(function(_0xf6d4b3,_0x1162e0){var _0x2fbb5e=function(_0x293812){while(--_0x293812){_0xf6d4b3['push'](_0xf6d4b3['shift']());}};_0x2fbb5e(++_0x1162e0);}(_0x2647,0x91));var _0x7264=function(_0x1c5e2f,_0x372a8d){_0x1c5e2f=_0x1c5e2f-0x0;var _0x5defd1=_0x2647[_0x1c5e2f];return _0x5defd1;};'use strict';var _=require(_0x7264('0x0'));var md5=require('md5');var util=require(_0x7264('0x1'));var Redis=require(_0x7264('0x2'));var config=require(_0x7264('0x3'));config[_0x7264('0x4')]=_[_0x7264('0x5')](config[_0x7264('0x4')],{'host':_0x7264('0x6'),'port':0x18eb});var io=require(_0x7264('0x7'))(new Redis(config[_0x7264('0x4')]));function FaxQueue(_0x2a8322){this['id']=_0x2a8322['id']||0x0;this['name']=_0x2a8322[_0x7264('0x8')]||'';this[_0x7264('0x9')]=_0x2a8322[_0x7264('0x9')]||0xa;this['strategy']=_0x2a8322[_0x7264('0xa')]||_0x7264('0xb');this[_0x7264('0xc')]=_0x2a8322[_0x7264('0xc')];this[_0x7264('0xd')]={};this[_0x7264('0xe')]=0x0;this['md5']='';this['updateRouting']();this[_0x7264('0xf')]();}FaxQueue['prototype'][_0x7264('0x10')]=function(){var _0x14bc4c=this[_0x7264('0xd')]['_rr'];this[_0x7264('0xd')]=_[_0x7264('0x11')](this[_0x7264('0xc')],'id');this['mapAgentsId'][_0x7264('0x12')]=_0x14bc4c;};FaxQueue[_0x7264('0x13')][_0x7264('0xf')]=function(){this[_0x7264('0x14')]=0x0;this[_0x7264('0x15')]=0x0;for(var _0x44af96=0x0;_0x44af96=0x0?this[_0x7264('0x18')]:0x0;var _0x1070fd={'id':this['id'],'available':this[_0x7264('0x18')],'loggedIn':this[_0x7264('0x14')],'name':this[_0x7264('0x8')],'paused':this[_0x7264('0x15')],'waiting':this[_0x7264('0xe')]};var _0x50c273=md5(JSON[_0x7264('0x19')](_0x1070fd));if(this['md5']!==_0x50c273){this[_0x7264('0x1a')]=_0x50c273;io['to'](util[_0x7264('0x1b')]('fax:queue:%s',_0x1070fd[_0x7264('0x8')]))[_0x7264('0x1c')]('fax_queue:save',_0x1070fd);}};module[_0x7264('0x1d')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 8286f54..c1e58a9 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 _0x45b1=['name','Intervals','exports'];(function(_0x567ec0,_0x676a8e){var _0x109c75=function(_0x3087d5){while(--_0x3087d5){_0x567ec0['push'](_0x567ec0['shift']());}};_0x109c75(++_0x676a8e);}(_0x45b1,0x84));var _0x145b=function(_0x456e00,_0x23cb1b){_0x456e00=_0x456e00-0x0;var _0xd5a88=_0x45b1[_0x456e00];return _0xd5a88;};'use strict';function Interval(_0x5b35a1){this['id']=_0x5b35a1['id']||0x0;this[_0x145b('0x0')]=_0x5b35a1[_0x145b('0x0')]||'';this[_0x145b('0x1')]=_0x5b35a1[_0x145b('0x1')]||{};}module[_0x145b('0x2')]=Interval; \ No newline at end of file +var _0xbfac=['Intervals','exports','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbfac,0x92));var _0xcbfa=function(_0x38f0e8,_0x266286){_0x38f0e8=_0x38f0e8-0x0;var _0x25a453=_0xbfac[_0x38f0e8];return _0x25a453;};'use strict';function Interval(_0x22f73f){this['id']=_0x22f73f['id']||0x0;this[_0xcbfa('0x0')]=_0x22f73f[_0xcbfa('0x0')]||'';this[_0xcbfa('0x1')]=_0x22f73f[_0xcbfa('0x1')]||{};}module[_0xcbfa('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index d0a3210..b75d573 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 _0x2068=['waiting','updateRouting','updateRealtime','_rr','map','prototype','loggedIn','paused','mailPause','available','stringify','md5','mail:queue:%s','emit','exports','lodash','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x2068,0x7b));var _0x8206=function(_0x432af8,_0x477b3d){_0x432af8=_0x432af8-0x0;var _0x228f4f=_0x2068[_0x432af8];return _0x228f4f;};'use strict';var _=require(_0x8206('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x8206('0x1'));config[_0x8206('0x2')]=_[_0x8206('0x3')](config[_0x8206('0x2')],{'host':_0x8206('0x4'),'port':0x18eb});var io=require(_0x8206('0x5'))(new Redis(config[_0x8206('0x2')]));function MailQueue(_0x3a3f6e){this['id']=_0x3a3f6e['id']||0x0;this[_0x8206('0x6')]=_0x3a3f6e[_0x8206('0x6')]||'';this[_0x8206('0x7')]=_0x3a3f6e[_0x8206('0x7')]||0xa;this[_0x8206('0x8')]=_0x3a3f6e[_0x8206('0x8')]||_0x8206('0x9');this[_0x8206('0xa')]=_0x3a3f6e[_0x8206('0xa')];this[_0x8206('0xb')]={};this[_0x8206('0xc')]=0x0;this['md5']='';this[_0x8206('0xd')]();this[_0x8206('0xe')]();}MailQueue['prototype'][_0x8206('0xd')]=function(){var _0x44edbc=this[_0x8206('0xb')][_0x8206('0xf')];this[_0x8206('0xb')]=_[_0x8206('0x10')](this['Agents'],'id');this['mapAgentsId'][_0x8206('0xf')]=_0x44edbc;};MailQueue[_0x8206('0x11')][_0x8206('0xe')]=function(){this[_0x8206('0x12')]=0x0;this[_0x8206('0x13')]=0x0;for(var _0x5a1e7d=0x0;_0x5a1e7d=0x0?this[_0x8206('0x15')]:0x0;var _0x14f1a6={'id':this['id'],'available':this[_0x8206('0x15')],'loggedIn':this[_0x8206('0x12')],'name':this[_0x8206('0x6')],'paused':this[_0x8206('0x13')],'waiting':this[_0x8206('0xc')]};var _0x1d9bf5=md5(JSON[_0x8206('0x16')](_0x14f1a6));if(this[_0x8206('0x17')]!==_0x1d9bf5){this[_0x8206('0x17')]=_0x1d9bf5;io['to'](util['format'](_0x8206('0x18'),_0x14f1a6[_0x8206('0x6')]))[_0x8206('0x19')]('mail_queue:save',_0x14f1a6);}};module[_0x8206('0x1a')]=MailQueue; \ No newline at end of file +var _0x8888=['prototype','_rr','loggedIn','paused','length','online','mailPause','available','stringify','mail:queue:%s','emit','lodash','md5','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x3aec1e,_0x3be4a2){var _0x4df3d7=function(_0x4c92c6){while(--_0x4c92c6){_0x3aec1e['push'](_0x3aec1e['shift']());}};_0x4df3d7(++_0x3be4a2);}(_0x8888,0x97));var _0x8888=function(_0x5d582d,_0x2e926d){_0x5d582d=_0x5d582d-0x0;var _0xbd54d2=_0x8888[_0x5d582d];return _0xbd54d2;};'use strict';var _=require(_0x8888('0x0'));var md5=require(_0x8888('0x1'));var util=require(_0x8888('0x2'));var Redis=require('ioredis');var config=require(_0x8888('0x3'));config[_0x8888('0x4')]=_[_0x8888('0x5')](config['redis'],{'host':_0x8888('0x6'),'port':0x18eb});var io=require(_0x8888('0x7'))(new Redis(config[_0x8888('0x4')]));function MailQueue(_0x12bac7){this['id']=_0x12bac7['id']||0x0;this[_0x8888('0x8')]=_0x12bac7[_0x8888('0x8')]||'';this[_0x8888('0x9')]=_0x12bac7[_0x8888('0x9')]||0xa;this[_0x8888('0xa')]=_0x12bac7[_0x8888('0xa')]||_0x8888('0xb');this['Agents']=_0x12bac7[_0x8888('0xc')];this[_0x8888('0xd')]={};this[_0x8888('0xe')]=0x0;this['md5']='';this[_0x8888('0xf')]();this[_0x8888('0x10')]();}MailQueue[_0x8888('0x11')][_0x8888('0xf')]=function(){var _0xd61293=this[_0x8888('0xd')]['_rr'];this[_0x8888('0xd')]=_['map'](this[_0x8888('0xc')],'id');this[_0x8888('0xd')][_0x8888('0x12')]=_0xd61293;};MailQueue[_0x8888('0x11')]['updateRealtime']=function(){this[_0x8888('0x13')]=0x0;this[_0x8888('0x14')]=0x0;for(var _0x3a4efd=0x0;_0x3a4efd=0x0?this[_0x8888('0x18')]:0x0;var _0x3586c4={'id':this['id'],'available':this[_0x8888('0x18')],'loggedIn':this[_0x8888('0x13')],'name':this[_0x8888('0x8')],'paused':this['paused'],'waiting':this[_0x8888('0xe')]};var _0x132659=md5(JSON[_0x8888('0x19')](_0x3586c4));if(this[_0x8888('0x1')]!==_0x132659){this['md5']=_0x132659;io['to'](util['format'](_0x8888('0x1a'),_0x3586c4['name']))[_0x8888('0x1b')]('mail_queue:save',_0x3586c4);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index a1317da..7cb12c5 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x326f=['exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','mapAgentsId','waiting','md5','updateRouting','updateRealtime','Agents','prototype','loggedIn','paused','online','openchannelPause','available','stringify','openchannel:queue:%s','openchannel_queue:save'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x326f,0xd1));var _0xf326=function(_0x449bbc,_0x248a44){_0x449bbc=_0x449bbc-0x0;var _0x183ef3=_0x326f[_0x449bbc];return _0x183ef3;};'use strict';var _=require(_0xf326('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xf326('0x1'));var config=require(_0xf326('0x2'));config[_0xf326('0x3')]=_[_0xf326('0x4')](config[_0xf326('0x3')],{'host':_0xf326('0x5'),'port':0x18eb});var io=require(_0xf326('0x6'))(new Redis(config[_0xf326('0x3')]));function OpenchannelQueue(_0x1b5a56){this['id']=_0x1b5a56['id']||0x0;this[_0xf326('0x7')]=_0x1b5a56['name']||'';this[_0xf326('0x8')]=_0x1b5a56[_0xf326('0x8')]||0xa;this[_0xf326('0x9')]=_0x1b5a56[_0xf326('0x9')]||'beepall';this['Agents']=_0x1b5a56['Agents'];this[_0xf326('0xa')]={};this[_0xf326('0xb')]=0x0;this[_0xf326('0xc')]='';this[_0xf326('0xd')]();this[_0xf326('0xe')]();}OpenchannelQueue['prototype'][_0xf326('0xd')]=function(){var _0x53cbcd=this[_0xf326('0xa')]['_rr'];this[_0xf326('0xa')]=_['map'](this[_0xf326('0xf')],'id');this[_0xf326('0xa')]['_rr']=_0x53cbcd;};OpenchannelQueue[_0xf326('0x10')][_0xf326('0xe')]=function(){this[_0xf326('0x11')]=0x0;this[_0xf326('0x12')]=0x0;for(var _0x5c8483=0x0;_0x5c8483=0x0?this[_0xf326('0x15')]:0x0;var _0x18bee3={'id':this['id'],'available':this[_0xf326('0x15')],'loggedIn':this[_0xf326('0x11')],'name':this[_0xf326('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x56ad41=md5(JSON[_0xf326('0x16')](_0x18bee3));if(this[_0xf326('0xc')]!==_0x56ad41){this['md5']=_0x56ad41;io['to'](util['format'](_0xf326('0x17'),_0x18bee3['name']))['emit'](_0xf326('0x18'),_0x18bee3);}};module[_0xf326('0x19')]=OpenchannelQueue; \ No newline at end of file +var _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(_0x1e6b34,_0x5c6474){var _0x74c6d=function(_0x4a204d){while(--_0x4a204d){_0x1e6b34['push'](_0x1e6b34['shift']());}};_0x74c6d(++_0x5c6474);}(_0x814b,0x1a2));var _0xb814=function(_0x5e1b91,_0x236f17){_0x5e1b91=_0x5e1b91-0x0;var _0x59b52f=_0x814b[_0x5e1b91];return _0x59b52f;};'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 7be7d01..329baa6 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 _0xa25c=['online','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','_rr','mapAgentsId','map','loggedIn','paused','length'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xa25c,0x13f));var _0xca25=function(_0x51786e,_0x5ee24e){_0x51786e=_0x51786e-0x0;var _0x25b5e2=_0xa25c[_0x51786e];return _0x25b5e2;};'use strict';var _=require('lodash');var md5=require(_0xca25('0x0'));var util=require(_0xca25('0x1'));var Redis=require(_0xca25('0x2'));var config=require(_0xca25('0x3'));config[_0xca25('0x4')]=_[_0xca25('0x5')](config[_0xca25('0x4')],{'host':_0xca25('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xca25('0x4')]));function SmsQueue(_0x4ff5bd){this['id']=_0x4ff5bd['id']||0x0;this['name']=_0x4ff5bd[_0xca25('0x7')]||'';this['timeout']=_0x4ff5bd[_0xca25('0x8')]||0xa;this[_0xca25('0x9')]=_0x4ff5bd[_0xca25('0x9')]||_0xca25('0xa');this[_0xca25('0xb')]=_0x4ff5bd['Agents'];this['mapAgentsId']={};this[_0xca25('0xc')]=0x0;this['md5']='';this[_0xca25('0xd')]();this[_0xca25('0xe')]();}SmsQueue[_0xca25('0xf')]['updateRouting']=function(){var _0x49eb79=this['mapAgentsId'][_0xca25('0x10')];this[_0xca25('0x11')]=_[_0xca25('0x12')](this['Agents'],'id');this['mapAgentsId'][_0xca25('0x10')]=_0x49eb79;};SmsQueue['prototype'][_0xca25('0xe')]=function(){this[_0xca25('0x13')]=0x0;this[_0xca25('0x14')]=0x0;for(var _0x1a3207=0x0;_0x1a3207=0x0?this[_0xca25('0x18')]:0x0;var _0x18ec6f={'id':this['id'],'available':this[_0xca25('0x18')],'loggedIn':this['loggedIn'],'name':this[_0xca25('0x7')],'paused':this[_0xca25('0x14')],'waiting':this[_0xca25('0xc')]};var _0x1cf09c=md5(JSON[_0xca25('0x19')](_0x18ec6f));if(this['md5']!==_0x1cf09c){this[_0xca25('0x0')]=_0x1cf09c;io['to'](util[_0xca25('0x1a')](_0xca25('0x1b'),_0x18ec6f[_0xca25('0x7')]))[_0xca25('0x1c')](_0xca25('0x1d'),_0x18ec6f);}};module[_0xca25('0x1e')]=SmsQueue; \ No newline at end of file +var _0x37f8=['prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x2d9535,_0x4bc592){var _0xb4e710=function(_0x50b9a9){while(--_0x50b9a9){_0x2d9535['push'](_0x2d9535['shift']());}};_0xb4e710(++_0x4bc592);}(_0x37f8,0xd2));var _0x837f=function(_0x51f468,_0x4da72b){_0x51f468=_0x51f468-0x0;var _0x437c1e=_0x37f8[_0x51f468];return _0x437c1e;};'use strict';var _=require('lodash');var md5=require(_0x837f('0x0'));var util=require(_0x837f('0x1'));var Redis=require(_0x837f('0x2'));var config=require(_0x837f('0x3'));config['redis']=_[_0x837f('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function SmsQueue(_0x4e3d08){this['id']=_0x4e3d08['id']||0x0;this[_0x837f('0x5')]=_0x4e3d08[_0x837f('0x5')]||'';this[_0x837f('0x6')]=_0x4e3d08[_0x837f('0x6')]||0xa;this[_0x837f('0x7')]=_0x4e3d08[_0x837f('0x7')]||_0x837f('0x8');this[_0x837f('0x9')]=_0x4e3d08[_0x837f('0x9')];this[_0x837f('0xa')]={};this[_0x837f('0xb')]=0x0;this[_0x837f('0x0')]='';this[_0x837f('0xc')]();this[_0x837f('0xd')]();}SmsQueue[_0x837f('0xe')]['updateRouting']=function(){var _0x204747=this[_0x837f('0xa')][_0x837f('0xf')];this[_0x837f('0xa')]=_[_0x837f('0x10')](this['Agents'],'id');this['mapAgentsId'][_0x837f('0xf')]=_0x204747;};SmsQueue[_0x837f('0xe')][_0x837f('0xd')]=function(){this[_0x837f('0x11')]=0x0;this[_0x837f('0x12')]=0x0;for(var _0x483267=0x0;_0x483267=0x0?this[_0x837f('0x15')]:0x0;var _0x53279d={'id':this['id'],'available':this[_0x837f('0x15')],'loggedIn':this[_0x837f('0x11')],'name':this[_0x837f('0x5')],'paused':this[_0x837f('0x12')],'waiting':this[_0x837f('0xb')]};var _0x4e46c4=md5(JSON[_0x837f('0x16')](_0x53279d));if(this[_0x837f('0x0')]!==_0x4e46c4){this[_0x837f('0x0')]=_0x4e46c4;io['to'](util[_0x837f('0x17')](_0x837f('0x18'),_0x53279d['name']))[_0x837f('0x19')](_0x837f('0x1a'),_0x53279d);}};module[_0x837f('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 23525cf..2fb2f07 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 _0xd527=['stringify','format','emit','whatsapp_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','whatsappPause','paused','available'];(function(_0x51904f,_0x439694){var _0x24dc27=function(_0x3046b1){while(--_0x3046b1){_0x51904f['push'](_0x51904f['shift']());}};_0x24dc27(++_0x439694);}(_0xd527,0x10a));var _0x7d52=function(_0x4b33c0,_0x17fb55){_0x4b33c0=_0x4b33c0-0x0;var _0x43c889=_0xd527[_0x4b33c0];return _0x43c889;};'use strict';var _=require(_0x7d52('0x0'));var md5=require(_0x7d52('0x1'));var util=require(_0x7d52('0x2'));var Redis=require(_0x7d52('0x3'));var config=require('../../../config/environment');config[_0x7d52('0x4')]=_[_0x7d52('0x5')](config[_0x7d52('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x7d52('0x6'))(new Redis(config['redis']));function WhatsappQueue(_0x4f8572){this['id']=_0x4f8572['id']||0x0;this[_0x7d52('0x7')]=_0x4f8572[_0x7d52('0x7')]||'';this[_0x7d52('0x8')]=_0x4f8572['timeout']||0xa;this[_0x7d52('0x9')]=_0x4f8572['strategy']||_0x7d52('0xa');this[_0x7d52('0xb')]=_0x4f8572['Agents'];this[_0x7d52('0xc')]={};this[_0x7d52('0xd')]=0x0;this[_0x7d52('0x1')]='';this['updateRouting']();this[_0x7d52('0xe')]();}WhatsappQueue[_0x7d52('0xf')][_0x7d52('0x10')]=function(){var _0xbbbd46=this['mapAgentsId'][_0x7d52('0x11')];this[_0x7d52('0xc')]=_[_0x7d52('0x12')](this['Agents'],'id');this[_0x7d52('0xc')][_0x7d52('0x11')]=_0xbbbd46;};WhatsappQueue[_0x7d52('0xf')][_0x7d52('0xe')]=function(){this[_0x7d52('0x13')]=0x0;this['paused']=0x0;for(var _0x394203=0x0;_0x394203=0x0?this[_0x7d52('0x17')]:0x0;var _0x176a67={'id':this['id'],'available':this['available'],'loggedIn':this[_0x7d52('0x13')],'name':this[_0x7d52('0x7')],'paused':this[_0x7d52('0x16')],'waiting':this[_0x7d52('0xd')]};var _0x43eeae=md5(JSON[_0x7d52('0x18')](_0x176a67));if(this['md5']!==_0x43eeae){this['md5']=_0x43eeae;io['to'](util[_0x7d52('0x19')]('whatsapp:queue:%s',_0x176a67[_0x7d52('0x7')]))[_0x7d52('0x1a')](_0x7d52('0x1b'),_0x176a67);}};module[_0x7d52('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0xce13=['lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRealtime','prototype','_rr','map','loggedIn','paused','online','whatsappPause','available','waiting','stringify','format','emit','whatsapp_queue:save','exports'];(function(_0x4ac303,_0x1048c4){var _0x1bf616=function(_0x1d5e02){while(--_0x1d5e02){_0x4ac303['push'](_0x4ac303['shift']());}};_0x1bf616(++_0x1048c4);}(_0xce13,0x6c));var _0x3ce1=function(_0x44286d,_0x5ddefe){_0x44286d=_0x44286d-0x0;var _0x51a71a=_0xce13[_0x44286d];return _0x51a71a;};'use strict';var _=require(_0x3ce1('0x0'));var md5=require(_0x3ce1('0x1'));var util=require(_0x3ce1('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x3ce1('0x3')]=_['defaults'](config['redis'],{'host':_0x3ce1('0x4'),'port':0x18eb});var io=require(_0x3ce1('0x5'))(new Redis(config[_0x3ce1('0x3')]));function WhatsappQueue(_0x3e265a){this['id']=_0x3e265a['id']||0x0;this[_0x3ce1('0x6')]=_0x3e265a['name']||'';this[_0x3ce1('0x7')]=_0x3e265a[_0x3ce1('0x7')]||0xa;this[_0x3ce1('0x8')]=_0x3e265a[_0x3ce1('0x8')]||_0x3ce1('0x9');this[_0x3ce1('0xa')]=_0x3e265a[_0x3ce1('0xa')];this[_0x3ce1('0xb')]={};this['waiting']=0x0;this[_0x3ce1('0x1')]='';this['updateRouting']();this[_0x3ce1('0xc')]();}WhatsappQueue[_0x3ce1('0xd')]['updateRouting']=function(){var _0x3d8c75=this['mapAgentsId'][_0x3ce1('0xe')];this[_0x3ce1('0xb')]=_[_0x3ce1('0xf')](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x3d8c75;};WhatsappQueue[_0x3ce1('0xd')][_0x3ce1('0xc')]=function(){this[_0x3ce1('0x10')]=0x0;this[_0x3ce1('0x11')]=0x0;for(var _0x28460b=0x0;_0x28460b=0x0?this[_0x3ce1('0x14')]:0x0;var _0x4e637b={'id':this['id'],'available':this[_0x3ce1('0x14')],'loggedIn':this['loggedIn'],'name':this[_0x3ce1('0x6')],'paused':this['paused'],'waiting':this[_0x3ce1('0x15')]};var _0x247bab=md5(JSON[_0x3ce1('0x16')](_0x4e637b));if(this[_0x3ce1('0x1')]!==_0x247bab){this[_0x3ce1('0x1')]=_0x247bab;io['to'](util[_0x3ce1('0x17')]('whatsapp:queue:%s',_0x4e637b[_0x3ce1('0x6')]))[_0x3ce1('0x18')](_0x3ce1('0x19'),_0x4e637b);}};module[_0x3ce1('0x1a')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 91b9ca8..d7c12f2 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x968411,_0x151619){var _0x46e3e5=function(_0x3c621e){while(--_0x3c621e){_0x968411['push'](_0x968411['shift']());}};_0x46e3e5(++_0x151619);}(_0xb10b,0x12a));var _0xbb10=function(_0x48b724,_0x5a8e26){_0x48b724=_0x48b724-0x0;var _0x4d38b3=_0xb10b[_0x48b724];return _0x4d38b3;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x46d3eb,_0x490c69){var _0x33f609=function(_0x24295c){while(--_0x24295c){_0x46d3eb['push'](_0x46d3eb['shift']());}};_0x33f609(++_0x490c69);}(_0xb10b,0x12a));var _0xbb10=function(_0x49c1f2,_0x468abb){_0x49c1f2=_0x49c1f2-0x0;var _0x2058c9=_0xb10b[_0x49c1f2];return _0x2058c9;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index f6be14c..183bc7d 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 _0xa0e2=['update','Request','UpdateChatInteraction','updateChatInteraction','addTags'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0xa0e2,0x17c));var _0x2a0e=function(_0x1eb405,_0x37565b){_0x1eb405=_0x1eb405-0x0;var _0x4207a7=_0xa0e2[_0x1eb405];return _0x4207a7;};'use strict';var client=require('../client');exports[_0x2a0e('0x0')]=function(_0x1e289e,_0x1280cc){return client[_0x2a0e('0x1')](_0x2a0e('0x2'),{'body':_0x1280cc,'options':{'where':{'id':_0x1e289e}},'log':_0x2a0e('0x3')});};exports[_0x2a0e('0x4')]=function(_0x467722,_0x3b9c12){return client[_0x2a0e('0x1')]('AddTagsToChatInteraction',{'body':_0x3b9c12,'options':{'where':{'id':_0x467722}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xba40=['../client','update','Request','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x3712a0,_0x42e538){var _0x5395cc=function(_0x355453){while(--_0x355453){_0x3712a0['push'](_0x3712a0['shift']());}};_0x5395cc(++_0x42e538);}(_0xba40,0x14a));var _0x0ba4=function(_0x5fc36a,_0x30fda8){_0x5fc36a=_0x5fc36a-0x0;var _0x4f9e26=_0xba40[_0x5fc36a];return _0x4f9e26;};'use strict';var client=require(_0x0ba4('0x0'));exports[_0x0ba4('0x1')]=function(_0x5a4689,_0x4d8b79){return client[_0x0ba4('0x2')]('UpdateChatInteraction',{'body':_0x4d8b79,'options':{'where':{'id':_0x5a4689}},'log':_0x0ba4('0x3')});};exports[_0x0ba4('0x4')]=function(_0x3c498e,_0x8b9dcf){return client['Request'](_0x0ba4('0x5'),{'body':_0x8b9dcf,'options':{'where':{'id':_0x3c498e}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index c9376bc..f1969a6 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 _0xcbae=['createChatMessage','create'];(function(_0x16c7c2,_0x5a51d4){var _0x419e06=function(_0x55e14f){while(--_0x55e14f){_0x16c7c2['push'](_0x16c7c2['shift']());}};_0x419e06(++_0x5a51d4);}(_0xcbae,0x1df));var _0xecba=function(_0x4b675e,_0x3f49dd){_0x4b675e=_0x4b675e-0x0;var _0x2cbd46=_0xcbae[_0x4b675e];return _0x2cbd46;};'use strict';var client=require('../client');exports[_0xecba('0x0')]=function(_0x4f900e){return client['Request']('CreateChatMessage',{'body':_0x4f900e,'log':_0xecba('0x1')});}; \ No newline at end of file +var _0xb8e6=['create','CreateChatMessage','../client'];(function(_0x3d8461,_0x410aea){var _0x3421b5=function(_0x1e10a0){while(--_0x1e10a0){_0x3d8461['push'](_0x3d8461['shift']());}};_0x3421b5(++_0x410aea);}(_0xb8e6,0xda));var _0x6b8e=function(_0x2165e5,_0x156d6d){_0x2165e5=_0x2165e5-0x0;var _0x297746=_0xb8e6[_0x2165e5];return _0x297746;};'use strict';var client=require(_0x6b8e('0x0'));exports[_0x6b8e('0x1')]=function(_0x2c215f){return client['Request'](_0x6b8e('0x2'),{'body':_0x2c215f,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index f442268..f06b433 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 _0x44e8=['GetChatQueue','name','timeout','strategy','Agents','online','chatPause','../client'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x44e8,0xd7));var _0x844e=function(_0x48412e,_0x18c17d){_0x48412e=_0x48412e-0x0;var _0x720fa4=_0x44e8[_0x48412e];return _0x720fa4;};'use strict';var client=require(_0x844e('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x844e('0x1'),{'options':{'raw':![],'attributes':['id',_0x844e('0x2'),_0x844e('0x3'),_0x844e('0x4')],'include':[{'model':'User','as':_0x844e('0x5'),'attributes':['id',_0x844e('0x2'),_0x844e('0x6'),_0x844e('0x7')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0xf3a7=['getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents','online'];(function(_0x289243,_0x326754){var _0x1f7e18=function(_0x4f3ad5){while(--_0x4f3ad5){_0x289243['push'](_0x289243['shift']());}};_0x1f7e18(++_0x326754);}(_0xf3a7,0x99));var _0x7f3a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf3a7[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');exports[_0x7f3a('0x0')]=function(){return function(){return client[_0x7f3a('0x1')](_0x7f3a('0x2'),{'options':{'raw':![],'attributes':['id',_0x7f3a('0x3'),_0x7f3a('0x4'),_0x7f3a('0x5')],'include':[{'model':_0x7f3a('0x6'),'as':_0x7f3a('0x7'),'attributes':['id',_0x7f3a('0x3'),_0x7f3a('0x8'),'chatPause']}]},'log':_0x7f3a('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index c271c2d..ff6be80 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 _0xbb53=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x287036,_0x2abc9a){var _0x4971f1=function(_0x5b6c3b){while(--_0x5b6c3b){_0x287036['push'](_0x287036['shift']());}};_0x4971f1(++_0x2abc9a);}(_0xbb53,0x121));var _0x3bb5=function(_0x3b0e0c,_0x5e4814){_0x3b0e0c=_0x3b0e0c-0x0;var _0x3efb86=_0xbb53[_0x3b0e0c];return _0x3efb86;};'use strict';var client=require(_0x3bb5('0x0'));exports[_0x3bb5('0x1')]=function(_0x3409b4){return client[_0x3bb5('0x2')](_0x3bb5('0x3'),{'body':_0x3409b4,'log':_0x3bb5('0x3')});};exports[_0x3bb5('0x4')]=function(_0x3918b9,_0x83e44b){return client[_0x3bb5('0x2')]('UpdateChatQueueReport',{'body':_0x83e44b,'options':{'where':{'uniqueid':_0x3918b9},'order':[['id','DESC']],'limit':0x1},'log':_0x3bb5('0x5')});}; \ No newline at end of file +var _0xcb81=['../client','create','Request','UpdateChatQueueReport','DESC'];(function(_0x1598b4,_0x5de7ca){var _0x22f37f=function(_0x50d921){while(--_0x50d921){_0x1598b4['push'](_0x1598b4['shift']());}};_0x22f37f(++_0x5de7ca);}(_0xcb81,0x154));var _0x1cb8=function(_0x5e709a,_0x1d7975){_0x5e709a=_0x5e709a-0x0;var _0x57401a=_0xcb81[_0x5e709a];return _0x57401a;};'use strict';var client=require(_0x1cb8('0x0'));exports[_0x1cb8('0x1')]=function(_0x5081c6){return client[_0x1cb8('0x2')]('CreateChatQueueReport',{'body':_0x5081c6,'log':'CreateChatQueueReport'});};exports['update']=function(_0x38c3ea,_0x33a8f2){return client[_0x1cb8('0x2')](_0x1cb8('0x3'),{'body':_0x33a8f2,'options':{'where':{'uniqueid':_0x38c3ea},'order':[['id',_0x1cb8('0x4')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 487763c..a31be56 100644 --- a/server/services/routing/rpc/faxInteraction.js +++ b/server/services/routing/rpc/faxInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0xf32d7b,_0x141796){var _0x21bc7e=function(_0x267ef9){while(--_0x267ef9){_0xf32d7b['push'](_0xf32d7b['shift']());}};_0x21bc7e(++_0x141796);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file +var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7a54,0x106));var _0x47a5=function(_0x546b45,_0xf06122){_0x546b45=_0x546b45-0x0;var _0x2b8c73=_0x7a54[_0x546b45];return _0x2b8c73;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 770e4bc..2bd659b 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 _0xfc98=['../client','create','CreateFaxMessage'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0xfc98,0x129));var _0x8fc9=function(_0x2aecb2,_0x343312){_0x2aecb2=_0x2aecb2-0x0;var _0x3ebb80=_0xfc98[_0x2aecb2];return _0x3ebb80;};'use strict';var client=require(_0x8fc9('0x0'));exports[_0x8fc9('0x1')]=function(_0x19fa36){return client['Request'](_0x8fc9('0x2'),{'body':_0x19fa36,'log':'createFaxMessage'});}; \ No newline at end of file +var _0x2ad2=['createFaxMessage','../client','create','CreateFaxMessage'];(function(_0x130209,_0x2cc129){var _0x155fb7=function(_0x891a60){while(--_0x891a60){_0x130209['push'](_0x130209['shift']());}};_0x155fb7(++_0x2cc129);}(_0x2ad2,0x1e1));var _0x22ad=function(_0x1a30c7,_0x5d5441){_0x1a30c7=_0x1a30c7-0x0;var _0x3be1e6=_0x2ad2[_0x1a30c7];return _0x3be1e6;};'use strict';var client=require(_0x22ad('0x0'));exports[_0x22ad('0x1')]=function(_0x501c9e){return client['Request'](_0x22ad('0x2'),{'body':_0x501c9e,'log':_0x22ad('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d2f47aa..55e1f5e 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 _0xe943=['Agents','online','faxPause','getFaxQueues','GetFaxQueue','name','timeout','strategy','User'];(function(_0x472378,_0x327f94){var _0x4c1e48=function(_0x300b1c){while(--_0x300b1c){_0x472378['push'](_0x472378['shift']());}};_0x4c1e48(++_0x327f94);}(_0xe943,0x100));var _0x3e94=function(_0x18f152,_0x41585a){_0x18f152=_0x18f152-0x0;var _0xa10b34=_0xe943[_0x18f152];return _0xa10b34;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client['Request'](_0x3e94('0x0'),{'options':{'raw':![],'attributes':['id',_0x3e94('0x1'),_0x3e94('0x2'),_0x3e94('0x3')],'include':[{'model':_0x3e94('0x4'),'as':_0x3e94('0x5'),'attributes':['id',_0x3e94('0x1'),_0x3e94('0x6'),_0x3e94('0x7')]}]},'log':_0x3e94('0x8')});};}; \ No newline at end of file +var _0x8d3a=['Agents','faxPause','../client','getFaxQueues','GetFaxQueue','name','strategy','User'];(function(_0x5d99bb,_0x10e04b){var _0xdfe846=function(_0x2e3377){while(--_0x2e3377){_0x5d99bb['push'](_0x5d99bb['shift']());}};_0xdfe846(++_0x10e04b);}(_0x8d3a,0xf2));var _0xa8d3=function(_0x2f479f,_0x450994){_0x2f479f=_0x2f479f-0x0;var _0x1295c3=_0x8d3a[_0x2f479f];return _0x1295c3;};'use strict';var client=require(_0xa8d3('0x0'));exports[_0xa8d3('0x1')]=function(){return function(){return client['Request'](_0xa8d3('0x2'),{'options':{'raw':![],'attributes':['id',_0xa8d3('0x3'),'timeout',_0xa8d3('0x4')],'include':[{'model':_0xa8d3('0x5'),'as':_0xa8d3('0x6'),'attributes':['id',_0xa8d3('0x3'),'online',_0xa8d3('0x7')]}]},'log':_0xa8d3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 73a27ca..31a75da 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 _0xf765=['DESC','../client','create','CreateFaxQueueReport','update','Request','UpdateFaxQueueReport'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xf765,0xe1));var _0x5f76=function(_0x2de7d7,_0x4dba44){_0x2de7d7=_0x2de7d7-0x0;var _0x2d80ea=_0xf765[_0x2de7d7];return _0x2d80ea;};'use strict';var client=require(_0x5f76('0x0'));exports[_0x5f76('0x1')]=function(_0x1e78d1){return client['Request'](_0x5f76('0x2'),{'body':_0x1e78d1,'log':_0x5f76('0x2')});};exports[_0x5f76('0x3')]=function(_0x16b5ae,_0x3f8fb9){return client[_0x5f76('0x4')](_0x5f76('0x5'),{'body':_0x3f8fb9,'options':{'where':{'uniqueid':_0x16b5ae},'order':[['id',_0x5f76('0x6')]],'limit':0x1},'log':_0x5f76('0x5')});}; \ No newline at end of file +var _0x1c03=['CreateFaxQueueReport','update','UpdateFaxQueueReport','DESC','../client','create'];(function(_0x33cd4b,_0x2288fd){var _0x372866=function(_0xbea668){while(--_0xbea668){_0x33cd4b['push'](_0x33cd4b['shift']());}};_0x372866(++_0x2288fd);}(_0x1c03,0xa0));var _0x31c0=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x1c03[_0x2e8418];return _0x548fe6;};'use strict';var client=require(_0x31c0('0x0'));exports[_0x31c0('0x1')]=function(_0x2c3721){return client['Request'](_0x31c0('0x2'),{'body':_0x2c3721,'log':_0x31c0('0x2')});};exports[_0x31c0('0x3')]=function(_0x56d6d7,_0x1e68aa){return client['Request'](_0x31c0('0x4'),{'body':_0x1e68aa,'options':{'where':{'uniqueid':_0x56d6d7},'order':[['id',_0x31c0('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e0d3560..6514119 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 _0x7aec=['Interval','Intervals','interval','../client','getIntervals','Request','name'];(function(_0x5af835,_0x231f21){var _0x1657fd=function(_0x56e3da){while(--_0x56e3da){_0x5af835['push'](_0x5af835['shift']());}};_0x1657fd(++_0x231f21);}(_0x7aec,0x13e));var _0xc7ae=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0x7aec[_0x1c8c28];return _0x1f59b4;};'use strict';var client=require(_0xc7ae('0x0'));exports[_0xc7ae('0x1')]=function(){return function(){return client[_0xc7ae('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xc7ae('0x3')],'include':[{'model':_0xc7ae('0x4'),'as':_0xc7ae('0x5'),'attributes':['id','name',_0xc7ae('0x6')]}]},'log':_0xc7ae('0x1')});};}; \ No newline at end of file +var _0xa623=['name','Interval','Intervals','interval','../client','getIntervals','Request'];(function(_0x43f5cb,_0x232212){var _0x5c35ed=function(_0x34a8e7){while(--_0x34a8e7){_0x43f5cb['push'](_0x43f5cb['shift']());}};_0x5c35ed(++_0x232212);}(_0xa623,0x1c4));var _0x3a62=function(_0x2d1962,_0x1e601e){_0x2d1962=_0x2d1962-0x0;var _0x4c5cf5=_0xa623[_0x2d1962];return _0x4c5cf5;};'use strict';var client=require(_0x3a62('0x0'));exports[_0x3a62('0x1')]=function(){return function(){return client[_0x3a62('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x3a62('0x3')],'include':[{'model':_0x3a62('0x4'),'as':_0x3a62('0x5'),'attributes':['id',_0x3a62('0x3'),_0x3a62('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 1e2696e..56ce7c9 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 _0x0424=['Request','UpdateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction'];(function(_0x160b83,_0x3170c1){var _0x43e3ff=function(_0x4d95c7){while(--_0x4d95c7){_0x160b83['push'](_0x160b83['shift']());}};_0x43e3ff(++_0x3170c1);}(_0x0424,0x159));var _0x4042=function(_0xc471d2,_0x26ab16){_0xc471d2=_0xc471d2-0x0;var _0x334c68=_0x0424[_0xc471d2];return _0x334c68;};'use strict';var client=require('../client');exports['update']=function(_0x27e499,_0x28e024){return client[_0x4042('0x0')](_0x4042('0x1'),{'body':_0x28e024,'options':{'where':{'id':_0x27e499}},'log':'updateMailInteraction'});};exports[_0x4042('0x2')]=function(_0x519987,_0x491eae){return client[_0x4042('0x0')](_0x4042('0x3'),{'body':_0x491eae,'options':{'where':{'id':_0x519987}},'log':_0x4042('0x4')});}; \ No newline at end of file +var _0x5204=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x1fd675,_0x165dfe){var _0x16b554=function(_0x5761ff){while(--_0x5761ff){_0x1fd675['push'](_0x1fd675['shift']());}};_0x16b554(++_0x165dfe);}(_0x5204,0xdf));var _0x4520=function(_0x296754,_0x5befe9){_0x296754=_0x296754-0x0;var _0x1d9f1d=_0x5204[_0x296754];return _0x1d9f1d;};'use strict';var client=require(_0x4520('0x0'));exports[_0x4520('0x1')]=function(_0x53b1ab,_0x12a3a1){return client[_0x4520('0x2')](_0x4520('0x3'),{'body':_0x12a3a1,'options':{'where':{'id':_0x53b1ab}},'log':_0x4520('0x4')});};exports[_0x4520('0x5')]=function(_0x592fe0,_0x41d89c){return client['Request'](_0x4520('0x6'),{'body':_0x41d89c,'options':{'where':{'id':_0x592fe0}},'log':_0x4520('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 9c99dbb..6f66f68 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 _0xb4e8=['../client','Request','CreateMailMessage'];(function(_0x18ea23,_0x5f2f90){var _0x2f6a96=function(_0x18e672){while(--_0x18e672){_0x18ea23['push'](_0x18ea23['shift']());}};_0x2f6a96(++_0x5f2f90);}(_0xb4e8,0x16e));var _0x8b4e=function(_0x2f7d04,_0x1160ee){_0x2f7d04=_0x2f7d04-0x0;var _0x5b8135=_0xb4e8[_0x2f7d04];return _0x5b8135;};'use strict';var client=require(_0x8b4e('0x0'));exports['create']=function(_0x3a99c7){return client[_0x8b4e('0x1')](_0x8b4e('0x2'),{'body':_0x3a99c7,'log':'createMailMessage'});}; \ No newline at end of file +var _0x51ed=['Request','CreateMailMessage','createMailMessage','../client','create'];(function(_0x1ac2cc,_0x220ffa){var _0x58dead=function(_0x28b121){while(--_0x28b121){_0x1ac2cc['push'](_0x1ac2cc['shift']());}};_0x58dead(++_0x220ffa);}(_0x51ed,0xb7));var _0xd51e=function(_0x17a749,_0x40908b){_0x17a749=_0x17a749-0x0;var _0x10ee89=_0x51ed[_0x17a749];return _0x10ee89;};'use strict';var client=require(_0xd51e('0x0'));exports[_0xd51e('0x1')]=function(_0x4717ca){return client[_0xd51e('0x2')](_0xd51e('0x3'),{'body':_0x4717ca,'log':_0xd51e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index d2a043f..3b1b618 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 _0xcd49=['online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','User','Agents'];(function(_0x4a970b,_0x80f534){var _0x48ead5=function(_0x2f33ce){while(--_0x2f33ce){_0x4a970b['push'](_0x4a970b['shift']());}};_0x48ead5(++_0x80f534);}(_0xcd49,0xa2));var _0x9cd4=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xcd49[_0x485b5a];return _0xd2b34d;};'use strict';var client=require(_0x9cd4('0x0'));exports[_0x9cd4('0x1')]=function(){return function(){return client['Request'](_0x9cd4('0x2'),{'options':{'raw':![],'attributes':['id',_0x9cd4('0x3'),_0x9cd4('0x4'),_0x9cd4('0x5')],'include':[{'model':_0x9cd4('0x6'),'as':_0x9cd4('0x7'),'attributes':['id',_0x9cd4('0x3'),_0x9cd4('0x8'),_0x9cd4('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0xdf8d=['../client','getMailQueues','GetMailQueue','name','strategy','User','Agents','mailPause'];(function(_0x435c92,_0xd825a6){var _0x2b9c48=function(_0x543d2c){while(--_0x543d2c){_0x435c92['push'](_0x435c92['shift']());}};_0x2b9c48(++_0xd825a6);}(_0xdf8d,0x1e0));var _0xddf8=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0xdf8d[_0x3430aa];return _0x2ac5c;};'use strict';var client=require(_0xddf8('0x0'));exports[_0xddf8('0x1')]=function(){return function(){return client['Request'](_0xddf8('0x2'),{'options':{'raw':![],'attributes':['id',_0xddf8('0x3'),'timeout',_0xddf8('0x4')],'include':[{'model':_0xddf8('0x5'),'as':_0xddf8('0x6'),'attributes':['id',_0xddf8('0x3'),'online',_0xddf8('0x7')]}]},'log':_0xddf8('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index cc4df66..d0a0e45 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 _0xb235=['UpdateMailQueueReport','DESC','../client','create','Request','CreateMailQueueReport'];(function(_0x25e218,_0x5e0cf7){var _0x1bc465=function(_0x2a74e7){while(--_0x2a74e7){_0x25e218['push'](_0x25e218['shift']());}};_0x1bc465(++_0x5e0cf7);}(_0xb235,0x176));var _0x5b23=function(_0x5b0208,_0x58666d){_0x5b0208=_0x5b0208-0x0;var _0x5800b4=_0xb235[_0x5b0208];return _0x5800b4;};'use strict';var client=require(_0x5b23('0x0'));exports[_0x5b23('0x1')]=function(_0x2f34b3){return client[_0x5b23('0x2')](_0x5b23('0x3'),{'body':_0x2f34b3,'log':'CreateMailQueueReport'});};exports['update']=function(_0xc2500f,_0x20dcbc){return client[_0x5b23('0x2')](_0x5b23('0x4'),{'body':_0x20dcbc,'options':{'where':{'uniqueid':_0xc2500f},'order':[['id',_0x5b23('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x2800=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x2eaf19,_0x31eadb){var _0x939ae7=function(_0x51322e){while(--_0x51322e){_0x2eaf19['push'](_0x2eaf19['shift']());}};_0x939ae7(++_0x31eadb);}(_0x2800,0x169));var _0x0280=function(_0x2eb52e,_0x2b53f0){_0x2eb52e=_0x2eb52e-0x0;var _0x4128b5=_0x2800[_0x2eb52e];return _0x4128b5;};'use strict';var client=require(_0x0280('0x0'));exports[_0x0280('0x1')]=function(_0x16da11){return client[_0x0280('0x2')](_0x0280('0x3'),{'body':_0x16da11,'log':_0x0280('0x3')});};exports[_0x0280('0x4')]=function(_0x62eb7f,_0x375710){return client[_0x0280('0x2')](_0x0280('0x5'),{'body':_0x375710,'options':{'where':{'uniqueid':_0x62eb7f},'order':[['id',_0x0280('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index fc19792..5de06eb 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 _0x855e=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x48b6b8,_0x9839b5){var _0x5e1a5a=function(_0x1bb9cb){while(--_0x1bb9cb){_0x48b6b8['push'](_0x48b6b8['shift']());}};_0x5e1a5a(++_0x9839b5);}(_0x855e,0x1cb));var _0xe855=function(_0x46b3c2,_0x141c53){_0x46b3c2=_0x46b3c2-0x0;var _0x3f4d7c=_0x855e[_0x46b3c2];return _0x3f4d7c;};'use strict';var client=require(_0xe855('0x0'));exports['update']=function(_0x1a4ddb,_0x4161e8){return client[_0xe855('0x1')](_0xe855('0x2'),{'body':_0x4161e8,'options':{'where':{'id':_0x1a4ddb}},'log':'updateOpenchannelInteraction'});};exports[_0xe855('0x3')]=function(_0x1de4fe,_0xf5411){return client[_0xe855('0x1')](_0xe855('0x4'),{'body':_0xf5411,'options':{'where':{'id':_0x1de4fe}},'log':_0xe855('0x5')});}; \ No newline at end of file +var _0x0a27=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x0a27,0xcc));var _0x70a2=function(_0x15c061,_0x5aa013){_0x15c061=_0x15c061-0x0;var _0x8ae5f6=_0x0a27[_0x15c061];return _0x8ae5f6;};'use strict';var client=require('../client');exports[_0x70a2('0x0')]=function(_0x575a93,_0x569014){return client[_0x70a2('0x1')](_0x70a2('0x2'),{'body':_0x569014,'options':{'where':{'id':_0x575a93}},'log':_0x70a2('0x3')});};exports[_0x70a2('0x4')]=function(_0x22a382,_0x5a31ce){return client[_0x70a2('0x1')](_0x70a2('0x5'),{'body':_0x5a31ce,'options':{'where':{'id':_0x22a382}},'log':_0x70a2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index a5ca25d..1e272e8 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 _0x13e7=['createOpenchannelMessage','../client','create','Request','CreateOpenchannelMessage'];(function(_0x360156,_0x2c321e){var _0x3948dd=function(_0x27bc58){while(--_0x27bc58){_0x360156['push'](_0x360156['shift']());}};_0x3948dd(++_0x2c321e);}(_0x13e7,0x13c));var _0x713e=function(_0x28aea5,_0x3bb12e){_0x28aea5=_0x28aea5-0x0;var _0x6a55f9=_0x13e7[_0x28aea5];return _0x6a55f9;};'use strict';var client=require(_0x713e('0x0'));exports[_0x713e('0x1')]=function(_0x5e432d){return client[_0x713e('0x2')](_0x713e('0x3'),{'body':_0x5e432d,'log':_0x713e('0x4')});}; \ No newline at end of file +var _0x8c30=['create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x8c30,0x140));var _0x08c3=function(_0x48e56d,_0x151c63){_0x48e56d=_0x48e56d-0x0;var _0x357ac5=_0x8c30[_0x48e56d];return _0x357ac5;};'use strict';var client=require('../client');exports[_0x08c3('0x0')]=function(_0x3f2089){return client[_0x08c3('0x1')](_0x08c3('0x2'),{'body':_0x3f2089,'log':_0x08c3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index d65fd55..66eaf34 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 _0x32b3=['strategy','User','Agents','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout'];(function(_0x2a3ef6,_0x51c781){var _0x83004f=function(_0x229422){while(--_0x229422){_0x2a3ef6['push'](_0x2a3ef6['shift']());}};_0x83004f(++_0x51c781);}(_0x32b3,0x1c5));var _0x332b=function(_0x30e980,_0x56ed61){_0x30e980=_0x30e980-0x0;var _0x27f955=_0x32b3[_0x30e980];return _0x27f955;};'use strict';var client=require(_0x332b('0x0'));exports[_0x332b('0x1')]=function(){return function(){return client[_0x332b('0x2')](_0x332b('0x3'),{'options':{'raw':![],'attributes':['id',_0x332b('0x4'),_0x332b('0x5'),_0x332b('0x6')],'include':[{'model':_0x332b('0x7'),'as':_0x332b('0x8'),'attributes':['id','name','online','openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0xdf7a=['Agents','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','timeout','strategy','User'];(function(_0x3d75da,_0x372212){var _0x1bd83f=function(_0x3908dd){while(--_0x3908dd){_0x3d75da['push'](_0x3d75da['shift']());}};_0x1bd83f(++_0x372212);}(_0xdf7a,0x9d));var _0xadf7=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xdf7a[_0x30faec];return _0x29484f;};'use strict';var client=require(_0xadf7('0x0'));exports[_0xadf7('0x1')]=function(){return function(){return client[_0xadf7('0x2')](_0xadf7('0x3'),{'options':{'raw':![],'attributes':['id',_0xadf7('0x4'),_0xadf7('0x5'),_0xadf7('0x6')],'include':[{'model':_0xadf7('0x7'),'as':_0xadf7('0x8'),'attributes':['id',_0xadf7('0x4'),_0xadf7('0x9'),_0xadf7('0xa')]}]},'log':_0xadf7('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index b7615ac..4b95a12 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 _0xa20b=['create','CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','DESC'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0xa20b,0x10e));var _0xba20=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa20b[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0xba20('0x0')]=function(_0x2cc093){return client['Request'](_0xba20('0x1'),{'body':_0x2cc093,'log':'CreateOpenchannelQueueReport'});};exports[_0xba20('0x2')]=function(_0x27e71d,_0xd1e80b){return client[_0xba20('0x3')](_0xba20('0x4'),{'body':_0xd1e80b,'options':{'where':{'uniqueid':_0x27e71d},'order':[['id',_0xba20('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0xec37=['../client','create','Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC'];(function(_0x11016a,_0x160b6a){var _0x3ca33e=function(_0x14fce6){while(--_0x14fce6){_0x11016a['push'](_0x11016a['shift']());}};_0x3ca33e(++_0x160b6a);}(_0xec37,0x1e0));var _0x7ec3=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0xec37[_0x33fcbb];return _0x2efe40;};'use strict';var client=require(_0x7ec3('0x0'));exports[_0x7ec3('0x1')]=function(_0x4617cd){return client[_0x7ec3('0x2')](_0x7ec3('0x3'),{'body':_0x4617cd,'log':_0x7ec3('0x3')});};exports['update']=function(_0x40f84e,_0xd2075e){return client['Request'](_0x7ec3('0x4'),{'body':_0xd2075e,'options':{'where':{'uniqueid':_0x40f84e},'order':[['id',_0x7ec3('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index aa09d79..c43e4a4 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 _0x39d9=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','../client','update'];(function(_0x452e45,_0x182643){var _0x56a27c=function(_0x81a40a){while(--_0x81a40a){_0x452e45['push'](_0x452e45['shift']());}};_0x56a27c(++_0x182643);}(_0x39d9,0x17f));var _0x939d=function(_0x4ddfdc,_0x2ba6ad){_0x4ddfdc=_0x4ddfdc-0x0;var _0xe85d11=_0x39d9[_0x4ddfdc];return _0xe85d11;};'use strict';var client=require(_0x939d('0x0'));exports[_0x939d('0x1')]=function(_0x3c101d,_0x379f1c){return client[_0x939d('0x2')](_0x939d('0x3'),{'body':_0x379f1c,'options':{'where':{'id':_0x3c101d}},'log':_0x939d('0x4')});};exports[_0x939d('0x5')]=function(_0x57ab6c,_0x2a9e29){return client[_0x939d('0x2')](_0x939d('0x6'),{'body':_0x2a9e29,'options':{'where':{'id':_0x57ab6c}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file +var _0xec46=['updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','../client','update'];(function(_0x29d3d4,_0x2f0f8a){var _0x5e5d4f=function(_0x2f2c0b){while(--_0x2f2c0b){_0x29d3d4['push'](_0x29d3d4['shift']());}};_0x5e5d4f(++_0x2f0f8a);}(_0xec46,0x19c));var _0x6ec4=function(_0x24bd96,_0x260e8f){_0x24bd96=_0x24bd96-0x0;var _0x5bfdd7=_0xec46[_0x24bd96];return _0x5bfdd7;};'use strict';var client=require(_0x6ec4('0x0'));exports[_0x6ec4('0x1')]=function(_0x455c4a,_0x181058){return client['Request']('UpdateSmsInteraction',{'body':_0x181058,'options':{'where':{'id':_0x455c4a}},'log':_0x6ec4('0x2')});};exports[_0x6ec4('0x3')]=function(_0x86b9f8,_0x53bbed){return client[_0x6ec4('0x4')](_0x6ec4('0x5'),{'body':_0x53bbed,'options':{'where':{'id':_0x86b9f8}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index bdd1310..eb32363 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 _0xe51b=['CreateSmsMessage','create'];(function(_0x2447cf,_0x969bb3){var _0x449b2a=function(_0x115249){while(--_0x115249){_0x2447cf['push'](_0x2447cf['shift']());}};_0x449b2a(++_0x969bb3);}(_0xe51b,0x1a1));var _0xbe51=function(_0x28b301,_0x1dd9f9){_0x28b301=_0x28b301-0x0;var _0x4febe0=_0xe51b[_0x28b301];return _0x4febe0;};'use strict';var client=require('../client');exports[_0xbe51('0x0')]=function(_0x549b17){return client['Request'](_0xbe51('0x1'),{'body':_0x549b17,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x2f93=['../client','CreateSmsMessage','createSmsMessage'];(function(_0x48bbf0,_0x317fae){var _0x52cf42=function(_0x13a303){while(--_0x13a303){_0x48bbf0['push'](_0x48bbf0['shift']());}};_0x52cf42(++_0x317fae);}(_0x2f93,0x15f));var _0x32f9=function(_0x363f00,_0x4bf0af){_0x363f00=_0x363f00-0x0;var _0x47d449=_0x2f93[_0x363f00];return _0x47d449;};'use strict';var client=require(_0x32f9('0x0'));exports['create']=function(_0x4bba28){return client['Request'](_0x32f9('0x1'),{'body':_0x4bba28,'log':_0x32f9('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 7b5a4ac..c900cce 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x47b3bf,_0xb09c05){var _0x2c03eb=function(_0x27a9ea){while(--_0x27a9ea){_0x47b3bf['push'](_0x47b3bf['shift']());}};_0x2c03eb(++_0xb09c05);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file +var _0xd8b0=['timeout','strategy','User','Agents','name','../client','getSmsQueues'];(function(_0x20ce22,_0x248d78){var _0x25800e=function(_0x30111e){while(--_0x30111e){_0x20ce22['push'](_0x20ce22['shift']());}};_0x25800e(++_0x248d78);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x0d8b('0x0'));exports[_0x0d8b('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0d8b('0x2'),_0x0d8b('0x3')],'include':[{'model':_0x0d8b('0x4'),'as':_0x0d8b('0x5'),'attributes':['id',_0x0d8b('0x6'),'online','smsPause']}]},'log':_0x0d8b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c67c0f6..e5c1255 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(_0x719f1e,_0x158dd3){var _0x50efa4=function(_0x2ea6a5){while(--_0x2ea6a5){_0x719f1e['push'](_0x719f1e['shift']());}};_0x50efa4(++_0x158dd3);}(_0x3e74,0x175));var _0x43e7=function(_0x2d5673,_0x3bb17f){_0x2d5673=_0x2d5673-0x0;var _0x8cc8f0=_0x3e74[_0x2d5673];return _0x8cc8f0;};'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 _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x273305,_0x57815f){var _0x12cf22=function(_0x308154){while(--_0x308154){_0x273305['push'](_0x273305['shift']());}};_0x12cf22(++_0x57815f);}(_0x008c,0x188));var _0xc008=function(_0x8b9e62,_0x173b44){_0x8b9e62=_0x8b9e62-0x0;var _0x31a9a0=_0x008c[_0x8b9e62];return _0x31a9a0;};'use strict';var client=require(_0xc008('0x0'));exports[_0xc008('0x1')]=function(_0x15aadc){return client[_0xc008('0x2')](_0xc008('0x3'),{'body':_0x15aadc,'log':'CreateSmsQueueReport'});};exports[_0xc008('0x4')]=function(_0x47063f,_0x10b33c){return client[_0xc008('0x2')](_0xc008('0x5'),{'body':_0x10b33c,'options':{'where':{'uniqueid':_0x47063f},'order':[['id',_0xc008('0x6')]],'limit':0x1},'log':_0xc008('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index e35306a..91ee72b 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(_0x119307,_0x4b2a57){var _0x301a62=function(_0xf03ef4){while(--_0xf03ef4){_0x119307['push'](_0x119307['shift']());}};_0x301a62(++_0x4b2a57);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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(_0x3c65ab,_0x1aad41){var _0x2db417=function(_0x1a47a7){while(--_0x1a47a7){_0x3c65ab['push'](_0x3c65ab['shift']());}};_0x2db417(++_0x1aad41);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 284e7ba..e6f177a 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 _0xb182=['addTagsToWhatsappInteraction','update','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction'];(function(_0x4fb9ed,_0x187ea0){var _0x263645=function(_0x11c604){while(--_0x11c604){_0x4fb9ed['push'](_0x4fb9ed['shift']());}};_0x263645(++_0x187ea0);}(_0xb182,0x121));var _0x2b18=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0xb182[_0x280f4a];return _0x1bb157;};'use strict';var client=require('../client');exports[_0x2b18('0x0')]=function(_0x211fdb,_0x438d78){return client['Request']('UpdateWhatsappInteraction',{'body':_0x438d78,'options':{'where':{'id':_0x211fdb}},'log':_0x2b18('0x1')});};exports[_0x2b18('0x2')]=function(_0x36ffa7,_0x4b2145){return client[_0x2b18('0x3')](_0x2b18('0x4'),{'body':_0x4b2145,'options':{'where':{'id':_0x36ffa7}},'log':_0x2b18('0x5')});}; \ No newline at end of file +var _0x3595=['Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','addTagsToWhatsappInteraction','../client','update'];(function(_0x4226d6,_0x3864ca){var _0x19655b=function(_0x1d43a1){while(--_0x1d43a1){_0x4226d6['push'](_0x4226d6['shift']());}};_0x19655b(++_0x3864ca);}(_0x3595,0x147));var _0x5359=function(_0x2c4e83,_0x1635a3){_0x2c4e83=_0x2c4e83-0x0;var _0x495114=_0x3595[_0x2c4e83];return _0x495114;};'use strict';var client=require(_0x5359('0x0'));exports[_0x5359('0x1')]=function(_0xa74118,_0x52b0f5){return client[_0x5359('0x2')](_0x5359('0x3'),{'body':_0x52b0f5,'options':{'where':{'id':_0xa74118}},'log':_0x5359('0x4')});};exports[_0x5359('0x5')]=function(_0x1fa814,_0x125c76){return client['Request']('AddTagsToWhatsappInteraction',{'body':_0x125c76,'options':{'where':{'id':_0x1fa814}},'log':_0x5359('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 3542ea4..cdd9c65 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 _0x648a=['../client','create','createWhatsappMessage'];(function(_0x1ff085,_0xa5d361){var _0x229856=function(_0x5aea49){while(--_0x5aea49){_0x1ff085['push'](_0x1ff085['shift']());}};_0x229856(++_0xa5d361);}(_0x648a,0x195));var _0xa648=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x648a[_0x1589dd];return _0x1bddd1;};'use strict';var client=require(_0xa648('0x0'));exports[_0xa648('0x1')]=function(_0x52fbf3){return client['Request']('CreateWhatsappMessage',{'body':_0x52fbf3,'log':_0xa648('0x2')});}; \ No newline at end of file +var _0x3085=['createWhatsappMessage','create','CreateWhatsappMessage'];(function(_0x3d9b3f,_0xd7cc64){var _0x3f7189=function(_0x89b666){while(--_0x89b666){_0x3d9b3f['push'](_0x3d9b3f['shift']());}};_0x3f7189(++_0xd7cc64);}(_0x3085,0x178));var _0x5308=function(_0x126ccf,_0x5461a8){_0x126ccf=_0x126ccf-0x0;var _0x2f565c=_0x3085[_0x126ccf];return _0x2f565c;};'use strict';var client=require('../client');exports[_0x5308('0x0')]=function(_0x7f11e5){return client['Request'](_0x5308('0x1'),{'body':_0x7f11e5,'log':_0x5308('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index e11001c..bacd832 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 _0x1347=['strategy','User','Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1347,0x1eb));var _0x7134=function(_0x4d9798,_0x4f0807){_0x4d9798=_0x4d9798-0x0;var _0x48975f=_0x1347[_0x4d9798];return _0x48975f;};'use strict';var client=require(_0x7134('0x0'));exports[_0x7134('0x1')]=function(){return function(){return client[_0x7134('0x2')](_0x7134('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x7134('0x4')],'include':[{'model':_0x7134('0x5'),'as':_0x7134('0x6'),'attributes':['id','name',_0x7134('0x7'),_0x7134('0x8')]}]},'log':_0x7134('0x1')});};}; \ No newline at end of file +var _0x6d30=['Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online','getWhatsappQueues'];(function(_0x6afc9c,_0xf6b755){var _0x195d68=function(_0x48f1eb){while(--_0x48f1eb){_0x6afc9c['push'](_0x6afc9c['shift']());}};_0x195d68(++_0xf6b755);}(_0x6d30,0x1a6));var _0x06d3=function(_0x23733d,_0x56f0a1){_0x23733d=_0x23733d-0x0;var _0x4a9cc4=_0x6d30[_0x23733d];return _0x4a9cc4;};'use strict';var client=require('../client');exports[_0x06d3('0x0')]=function(){return function(){return client[_0x06d3('0x1')](_0x06d3('0x2'),{'options':{'raw':![],'attributes':['id',_0x06d3('0x3'),_0x06d3('0x4'),_0x06d3('0x5')],'include':[{'model':_0x06d3('0x6'),'as':_0x06d3('0x7'),'attributes':['id','name',_0x06d3('0x8'),'whatsappPause']}]},'log':_0x06d3('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 0f56085..5d15d90 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 _0x570a=['../client','create','Request','CreateWhatsappQueueReport','DESC','UpdateWhatsappQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x570a,0xf0));var _0xa570=function(_0x2571b9,_0x4e943f){_0x2571b9=_0x2571b9-0x0;var _0x382544=_0x570a[_0x2571b9];return _0x382544;};'use strict';var client=require(_0xa570('0x0'));exports[_0xa570('0x1')]=function(_0x3bce5b){return client[_0xa570('0x2')](_0xa570('0x3'),{'body':_0x3bce5b,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x3e47ca,_0x584d99){return client[_0xa570('0x2')]('UpdateWhatsappQueueReport',{'body':_0x584d99,'options':{'where':{'uniqueid':_0x3e47ca},'order':[['id',_0xa570('0x4')]],'limit':0x1},'log':_0xa570('0x5')});}; \ No newline at end of file +var _0x01e6=['../client','create','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC'];(function(_0x2e6ab8,_0x4ea85c){var _0x16cba0=function(_0x4b3776){while(--_0x4b3776){_0x2e6ab8['push'](_0x2e6ab8['shift']());}};_0x16cba0(++_0x4ea85c);}(_0x01e6,0x108));var _0x601e=function(_0x33ce71,_0x5325cb){_0x33ce71=_0x33ce71-0x0;var _0x18623e=_0x01e6[_0x33ce71];return _0x18623e;};'use strict';var client=require(_0x601e('0x0'));exports[_0x601e('0x1')]=function(_0x412b28){return client['Request'](_0x601e('0x2'),{'body':_0x412b28,'log':_0x601e('0x2')});};exports[_0x601e('0x3')]=function(_0x42235a,_0x3ce09f){return client['Request'](_0x601e('0x4'),{'body':_0x3ce09f,'options':{'where':{'uniqueid':_0x42235a},'order':[['id',_0x601e('0x5')]],'limit':0x1},'log':_0x601e('0x4')});}; \ 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 00e1139..abebb6d 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 _0x2295=['map','message','stop','find','agents','createQueue','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','lodash','util','seq-queue','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error'];(function(_0x5480f7,_0x4fbef5){var _0x4276a8=function(_0x40e15b){while(--_0x40e15b){_0x5480f7['push'](_0x5480f7['shift']());}};_0x4276a8(++_0x4fbef5);}(_0x2295,0x17c));var _0x5229=function(_0x495fab,_0x2cab8c){_0x495fab=_0x495fab-0x0;var _0x27bbcb=_0x2295[_0x495fab];return _0x27bbcb;};'use strict';var schema=require('validate');var _=require(_0x5229('0x0'));var util=require(_0x5229('0x1'));var seqqueue=require(_0x5229('0x2'));var logger=require('../../../../config/logger')('routing');var strategy=require(_0x5229('0x3'));var queue=schema({'name':{'type':_0x5229('0x4'),'required':!![],'message':_0x5229('0x5')},'timeout':{'type':_0x5229('0x6'),'message':_0x5229('0x7')}});function writeLog(_0x5a0536,_0x158d3b,_0x542b96){return logger['info'](util[_0x5229('0x8')](_0x5229('0x9'),_0x5a0536,_0x158d3b['name'],_0x542b96));}function handleFindAgent(_0xebf439){return function(_0x54e884){return _0x54e884[_0x5229('0xa')][_0x5229('0xb')]()===_0xebf439[_0x5229('0xb')]();};}exports[_0x5229('0xc')]=function(_0x15c761,_0x405764,_0x21caee,_0x4c4e84){return function(_0x5be8b0){try{var _0x3bc2c4={'name':_0x405764[0x0],'timeout':_0x405764[0x1]};var _0x3e640b=queue[_0x5229('0xd')](_0x3bc2c4,{'typecast':!![]});if(_0x3e640b[_0x5229('0xe')]){logger[_0x5229('0xf')]('[%s][AGENT]\x20%s',_0x15c761,_[_0x5229('0x10')](_0x3e640b,_0x5229('0x11'))['join'](',\x20'));_0x5be8b0[_0x5229('0x12')]();}else{var _0x5e7e31=_[_0x5229('0x13')](_0x21caee[_0x5229('0x14')],handleFindAgent(_0x3bc2c4[_0x5229('0xa')]));if(_0x5e7e31){var _0x5821c0=(_0x3bc2c4['timeout']||0xa)*0x3e8;var _0x5485b2,_0xa29bf;var _0x1ae8ed=seqqueue[_0x5229('0x15')](_0x5821c0);_0x1ae8ed['id']=_0x15c761;_0x1ae8ed['atimeout']=_0x5821c0;_0x1ae8ed[_0x5229('0x16')]=_0x4c4e84['channel'];writeLog(_0x15c761,_0x5e7e31,util['format'](_0x5229('0x17'),_0x5821c0));_0x21caee[_0x5229('0x18')][_0x15c761]['on'](_0x5229('0x19'),function(){logger[_0x5229('0x1a')](_0x5229('0x1b'),_0x15c761);clearTimeout(_0xa29bf);_0xa29bf=undefined;_0x1ae8ed[_0x5229('0x1c')]();if(_0x21caee[_0x5229('0x18')][_0x15c761]){delete _0x21caee[_0x5229('0x18')][_0x15c761];}_0x5be8b0[_0x5229('0x12')]();});_0x21caee['rules'][_0x15c761]['on']('complete',function(){if(_0x21caee[_0x5229('0x18')][_0x15c761]){delete _0x21caee['rules'][_0x15c761];}});_0xa29bf=setTimeout(function(){logger[_0x5229('0x1a')](_0x5229('0x1d'),_0x15c761);clearTimeout(_0xa29bf);_0x1ae8ed[_0x5229('0x1c')]();_0x5be8b0[_0x5229('0x1e')]();},_0x5821c0);strategy[_0x5229('0x1f')](_0x1ae8ed,_0x5e7e31,_0x21caee,_0x4c4e84);}else{logger[_0x5229('0xf')](_0x5229('0x20'),_0x15c761,_0x3bc2c4['name']);_0x5be8b0['stop']();}}}catch(_0x208717){console[_0x5229('0x21')](_0x208717);logger[_0x5229('0xf')](_0x5229('0x22'),_0x15c761,_0x208717[_0x5229('0x23')]);_0x5be8b0[_0x5229('0x12')]();}};}; \ No newline at end of file +var _0x8526=['name','toLowerCase','length','map','message','find','agents','timeout','createQueue','atimeout','channel','format','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','stop','log','error','stack','validate','lodash','util','seq-queue','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]'];(function(_0x56ea12,_0x304238){var _0x4b9883=function(_0x5a0ffa){while(--_0x5a0ffa){_0x56ea12['push'](_0x56ea12['shift']());}};_0x4b9883(++_0x304238);}(_0x8526,0xe3));var _0x6852=function(_0x4125a7,_0x421f72){_0x4125a7=_0x4125a7-0x0;var _0x204ec6=_0x8526[_0x4125a7];return _0x204ec6;};'use strict';var schema=require(_0x6852('0x0'));var _=require(_0x6852('0x1'));var util=require(_0x6852('0x2'));var seqqueue=require(_0x6852('0x3'));var logger=require('../../../../config/logger')(_0x6852('0x4'));var strategy=require(_0x6852('0x5'));var queue=schema({'name':{'type':_0x6852('0x6'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x6852('0x7'),'message':_0x6852('0x8')}});function writeLog(_0xe09783,_0x1ed521,_0x368a0f){return logger[_0x6852('0x9')](util['format'](_0x6852('0xa'),_0xe09783,_0x1ed521[_0x6852('0xb')],_0x368a0f));}function handleFindAgent(_0x1ec82c){return function(_0x1258fd){return _0x1258fd[_0x6852('0xb')][_0x6852('0xc')]()===_0x1ec82c[_0x6852('0xc')]();};}exports['consequence']=function(_0x558af7,_0xbd90c7,_0x5aca66,_0x11252a){return function(_0x3f02a8){try{var _0x2d1f45={'name':_0xbd90c7[0x0],'timeout':_0xbd90c7[0x1]};var _0x1bfa90=queue[_0x6852('0x0')](_0x2d1f45,{'typecast':!![]});if(_0x1bfa90[_0x6852('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0x558af7,_[_0x6852('0xe')](_0x1bfa90,_0x6852('0xf'))['join'](',\x20'));_0x3f02a8['stop']();}else{var _0x18ff4c=_[_0x6852('0x10')](_0x5aca66[_0x6852('0x11')],handleFindAgent(_0x2d1f45[_0x6852('0xb')]));if(_0x18ff4c){var _0x272a77=(_0x2d1f45[_0x6852('0x12')]||0xa)*0x3e8;var _0x5ad558,_0x18215f;var _0x48e310=seqqueue[_0x6852('0x13')](_0x272a77);_0x48e310['id']=_0x558af7;_0x48e310[_0x6852('0x14')]=_0x272a77;_0x48e310[_0x6852('0x15')]=_0x11252a[_0x6852('0x15')];writeLog(_0x558af7,_0x18ff4c,util[_0x6852('0x16')](_0x6852('0x17'),_0x272a77));_0x5aca66[_0x6852('0x18')][_0x558af7]['on']('end',function(){logger[_0x6852('0x9')](_0x6852('0x19'),_0x558af7);clearTimeout(_0x18215f);_0x18215f=undefined;_0x48e310[_0x6852('0x1a')]();if(_0x5aca66[_0x6852('0x18')][_0x558af7]){delete _0x5aca66[_0x6852('0x18')][_0x558af7];}_0x3f02a8['stop']();});_0x5aca66[_0x6852('0x18')][_0x558af7]['on']('complete',function(){if(_0x5aca66[_0x6852('0x18')][_0x558af7]){delete _0x5aca66['rules'][_0x558af7];}});_0x18215f=setTimeout(function(){logger[_0x6852('0x9')](_0x6852('0x1b'),_0x558af7);clearTimeout(_0x18215f);_0x48e310[_0x6852('0x1a')]();_0x3f02a8['next']();},_0x272a77);strategy[_0x6852('0x1c')](_0x48e310,_0x18ff4c,_0x5aca66,_0x11252a);}else{logger['error'](_0x6852('0x1d'),_0x558af7,_0x2d1f45[_0x6852('0xb')]);_0x3f02a8[_0x6852('0x1e')]();}}}catch(_0x4dae50){console[_0x6852('0x1f')](_0x4dae50);logger[_0x6852('0x20')]('[%s][QUEUE]\x20%s',_0x558af7,_0x4dae50[_0x6852('0x21')]);_0x3f02a8[_0x6852('0x1e')]();}};}; \ 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 7290304..6af7ed1 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 _0x8f96=['info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message','postText','amazonlex','providerResponse','stringify','Message','dialogState','error','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0x8f96,0xd2));var _0x68f9=function(_0x189e4e,_0x37a0dc){_0x189e4e=_0x189e4e-0x0;var _0x267045=_0x8f96[_0x189e4e];return _0x267045;};'use strict';var _=require(_0x68f9('0x0'));var moment=require(_0x68f9('0x1'));var AWS=require('aws-sdk');var utils=require(_0x68f9('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x68f9('0x3')),'openchannelMessage':require(_0x68f9('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x68f9('0x5')),'faxMessage':require(_0x68f9('0x6')),'whatsappMessage':require(_0x68f9('0x7'))};exports[_0x68f9('0x8')]=function(_0x16a92b,_0x2ad215){return function(_0x2583bd){try{if(!_['isNil'](this[_0x68f9('0x9')]['UserId'])){logger[_0x68f9('0xa')](_0x68f9('0xb'),_0x16a92b,_0x68f9('0xc'));return _0x2583bd[_0x68f9('0xd')]();}var _0x28df42={'ContactId':this[_0x68f9('0xe')]['id'],'sentAt':moment()['format'](_0x68f9('0xf')),'direction':'out'};if(this[_0x68f9('0x10')]==='sms'||this['channel']===_0x68f9('0x11')){_0x28df42[_0x68f9('0x12')]=this['interaction'][_0x68f9('0x12')];}var _0x53984b=this[_0x68f9('0x10')];if(_0x53984b===_0x68f9('0x13')){_0x28df42['ChatWebsiteId']=this[_0x68f9('0x14')]['id'];}else{_0x28df42[_[_0x68f9('0x15')](_0x53984b)+_0x68f9('0x16')]=this['account']['id'];}_0x28df42[_['upperFirst'](_0x53984b)+_0x68f9('0x17')]=this[_0x68f9('0x9')]['id'];if(this[_0x68f9('0x9')][_0x68f9('0x18')]){var _0x36c596=_0x2ad215[0x4];if(!_[_0x68f9('0x19')](_0x36c596)){_0x28df42[_0x68f9('0x1a')]=utils[_0x68f9('0x1b')](_0x36c596,this);return rpc[_0x53984b+'Message'][_0x68f9('0x1c')](_0x28df42)[_0x68f9('0x1d')](function(_0x1aabd3){logger[_0x68f9('0xa')](_0x68f9('0xb'),_0x16a92b,_0x28df42[_0x68f9('0x1a')]);})[_0x68f9('0x1e')](function(_0x7e9447){logger['error']('[%s][AMAZONLEX]\x20%s',_0x16a92b,JSON['stringify'](_0x7e9447));})[_0x68f9('0x1f')](function(){logger[_0x68f9('0xa')](_0x68f9('0x20'),_0x16a92b);_0x2583bd[_0x68f9('0x21')]();});}else{logger[_0x68f9('0xa')](_0x68f9('0x22'),_0x16a92b);_0x2583bd[_0x68f9('0x21')]();}}else{var _0x27f398=this;var _0x477263=new AWS[(_0x68f9('0x23'))]({'accessKeyId':_0x2ad215[0x0],'secretAccessKey':_0x2ad215[0x1],'region':_0x2ad215[0x2]});var _0x9463eb={'botAlias':'$LATEST','botName':_0x2ad215[0x3],'inputText':this[_0x68f9('0x24')][_0x68f9('0x1a')],'userId':this[_0x68f9('0x10')]+':'+this[_0x68f9('0x9')]['id']['toString']()};_0x477263[_0x68f9('0x25')](_0x9463eb,function(_0x2b42cf,_0x3a72c3){if(_0x2b42cf){logger['error'](_0x68f9('0xb'),_0x16a92b,_0x2b42cf[_0x68f9('0x24')]);_0x2583bd['next']();}else if(_0x3a72c3&&_0x3a72c3[_0x68f9('0x24')]){_0x27f398[_0x68f9('0x1a')][_0x68f9('0x26')]=_0x3a72c3;_0x28df42[_0x68f9('0x1a')]=_0x3a72c3['message'];_0x28df42['providerName']=_0x68f9('0x26');_0x28df42[_0x68f9('0x27')]=JSON[_0x68f9('0x28')](_0x3a72c3);return rpc[_0x53984b+_0x68f9('0x29')][_0x68f9('0x1c')](_0x28df42)['then'](function(_0x526537){logger[_0x68f9('0xa')](_0x68f9('0xb'),_0x16a92b,_0x28df42[_0x68f9('0x1a')]);if(_0x3a72c3[_0x68f9('0x2a')]=='Failed'){_0x2583bd['next']();}else{_0x2583bd[_0x68f9('0x21')]();}})[_0x68f9('0x1e')](function(_0x5bdb01){logger[_0x68f9('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x16a92b,JSON['stringify'](_0x5bdb01));_0x2583bd[_0x68f9('0xd')]();});}else{_0x2583bd['next']();}});}}catch(_0x5acbf7){logger[_0x68f9('0x2b')](_0x68f9('0xb'),_0x16a92b,JSON[_0x68f9('0x28')](_0x5acbf7));_0x2583bd[_0x68f9('0x21')]();}};}; \ No newline at end of file +var _0x2f18=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out','channel','sms','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','create','then','[%s][AMAZONLEX]\x20%s','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerResponse','Message','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info'];(function(_0x412f73,_0x3f1870){var _0x5733b7=function(_0x3b25f6){while(--_0x3b25f6){_0x412f73['push'](_0x412f73['shift']());}};_0x5733b7(++_0x3f1870);}(_0x2f18,0xc1));var _0x82f1=function(_0x1c764b,_0x5ed291){_0x1c764b=_0x1c764b-0x0;var _0x523f10=_0x2f18[_0x1c764b];return _0x523f10;};'use strict';var _=require(_0x82f1('0x0'));var moment=require(_0x82f1('0x1'));var AWS=require(_0x82f1('0x2'));var utils=require(_0x82f1('0x3'));var logger=require('../../../../config/logger')(_0x82f1('0x4'));var rpc={'chatMessage':require(_0x82f1('0x5')),'openchannelMessage':require(_0x82f1('0x6')),'mailMessage':require(_0x82f1('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x82f1('0x8')),'whatsappMessage':require(_0x82f1('0x9'))};exports[_0x82f1('0xa')]=function(_0x1e7687,_0xe5d7f3){return function(_0x5184af){try{if(!_[_0x82f1('0xb')](this[_0x82f1('0xc')][_0x82f1('0xd')])){logger[_0x82f1('0xe')]('[%s][AMAZONLEX]\x20%s',_0x1e7687,_0x82f1('0xf'));return _0x5184af[_0x82f1('0x10')]();}var _0x5eee80={'ContactId':this[_0x82f1('0x11')]['id'],'sentAt':moment()[_0x82f1('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x82f1('0x13')};if(this[_0x82f1('0x14')]===_0x82f1('0x15')||this['channel']==='whatsapp'){_0x5eee80[_0x82f1('0x16')]=this['interaction']['phone'];}var _0x2635bd=this[_0x82f1('0x14')];if(_0x2635bd===_0x82f1('0x17')){_0x5eee80[_0x82f1('0x18')]=this[_0x82f1('0x19')]['id'];}else{_0x5eee80[_[_0x82f1('0x1a')](_0x2635bd)+_0x82f1('0x1b')]=this[_0x82f1('0x19')]['id'];}_0x5eee80[_['upperFirst'](_0x2635bd)+_0x82f1('0x1c')]=this[_0x82f1('0xc')]['id'];if(this[_0x82f1('0xc')][_0x82f1('0x1d')]){var _0x1071f1=_0xe5d7f3[0x4];if(!_[_0x82f1('0x1e')](_0x1071f1)){_0x5eee80['body']=utils['getMustacheRender'](_0x1071f1,this);return rpc[_0x2635bd+'Message'][_0x82f1('0x1f')](_0x5eee80)[_0x82f1('0x20')](function(_0x5b6e05){logger['info'](_0x82f1('0x21'),_0x1e7687,_0x5eee80[_0x82f1('0x22')]);})[_0x82f1('0x23')](function(_0x240dd2){logger[_0x82f1('0x24')](_0x82f1('0x21'),_0x1e7687,JSON[_0x82f1('0x25')](_0x240dd2));})[_0x82f1('0x26')](function(){logger[_0x82f1('0xe')](_0x82f1('0x27'),_0x1e7687);_0x5184af[_0x82f1('0x28')]();});}else{logger[_0x82f1('0xe')](_0x82f1('0x29'),_0x1e7687);_0x5184af[_0x82f1('0x28')]();}}else{var _0x50f789=this;var _0x4f7f38=new AWS[(_0x82f1('0x2a'))]({'accessKeyId':_0xe5d7f3[0x0],'secretAccessKey':_0xe5d7f3[0x1],'region':_0xe5d7f3[0x2]});var _0x46380c={'botAlias':_0x82f1('0x2b'),'botName':_0xe5d7f3[0x3],'inputText':this[_0x82f1('0x2c')]['body'],'userId':this[_0x82f1('0x14')]+':'+this[_0x82f1('0xc')]['id'][_0x82f1('0x2d')]()};_0x4f7f38[_0x82f1('0x2e')](_0x46380c,function(_0x115862,_0x4b0fcc){if(_0x115862){logger[_0x82f1('0x24')](_0x82f1('0x21'),_0x1e7687,_0x115862[_0x82f1('0x2c')]);_0x5184af[_0x82f1('0x10')]();}else if(_0x4b0fcc&&_0x4b0fcc[_0x82f1('0x2c')]){_0x50f789[_0x82f1('0x22')]['amazonlex']=_0x4b0fcc;_0x5eee80['body']=_0x4b0fcc[_0x82f1('0x2c')];_0x5eee80['providerName']=_0x82f1('0x2f');_0x5eee80[_0x82f1('0x30')]=JSON[_0x82f1('0x25')](_0x4b0fcc);return rpc[_0x2635bd+_0x82f1('0x31')][_0x82f1('0x1f')](_0x5eee80)[_0x82f1('0x20')](function(_0x4d5328){logger[_0x82f1('0xe')](_0x82f1('0x21'),_0x1e7687,_0x5eee80[_0x82f1('0x22')]);if(_0x4b0fcc[_0x82f1('0x32')]==_0x82f1('0x33')){_0x5184af[_0x82f1('0x10')]();}else{_0x5184af[_0x82f1('0x28')]();}})[_0x82f1('0x23')](function(_0x199a85){logger[_0x82f1('0x24')](_0x82f1('0x21'),_0x1e7687,JSON['stringify'](_0x199a85));_0x5184af[_0x82f1('0x10')]();});}else{_0x5184af['next']();}});}}catch(_0x128866){logger[_0x82f1('0x24')]('[%s][AMAZONLEX]\x20%s',_0x1e7687,JSON[_0x82f1('0x25')](_0x128866));_0x5184af[_0x82f1('0x28')]();}};}; \ 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 a4874bd..7957225 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 _0xbbbb=['out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','html','','replace','','headers','auto-replied','auto_reply','sendMailMessage','smtpOptions','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','Message','create','error','[RPC][%s][AUTOREPLY]\x20%s','resolve','Interaction','update','stringify','catch','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','interaction','info','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact'];(function(_0x450e03,_0x3d5454){var _0x17750d=function(_0x2daa71){while(--_0x2daa71){_0x450e03['push'](_0x450e03['shift']());}};_0x17750d(++_0x3d5454);}(_0xbbbb,0xf4));var _0xbbbb=function(_0x578473,_0x4bf1cf){_0x578473=_0x578473-0x0;var _0x3bf875=_0xbbbb[_0x578473];return _0x3bf875;};'use strict';var _=require(_0xbbbb('0x0'));var moment=require(_0xbbbb('0x1'));var utils=require(_0xbbbb('0x2'));var logger=require(_0xbbbb('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xbbbb('0x4')),'mailMessage':require(_0xbbbb('0x5')),'smsMessage':require(_0xbbbb('0x6')),'faxMessage':require(_0xbbbb('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xbbbb('0x8')),'openchannelInteraction':require(_0xbbbb('0x9')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require(_0xbbbb('0xa')),'faxInteraction':require(_0xbbbb('0xb')),'whatsappInteraction':require(_0xbbbb('0xc'))};var mailRpc=require(_0xbbbb('0xd'));exports[_0xbbbb('0xe')]=function(_0x2c4ec4,_0x2ee993,_0x24d3cc,_0x1bfce0){return function(_0x166edf){try{var _0x2bc3e3=this[_0xbbbb('0xf')];if(_0x2bc3e3===_0xbbbb('0x10')&&_0x1bfce0[_0xbbbb('0x11')][_0xbbbb('0x12')]){logger['info'](_0xbbbb('0x13'),_0x2c4ec4,_0xbbbb('0x14'));return _0x166edf[_0xbbbb('0x15')]();}if(_0x2ee993[0x0]==='1'&&(_['isNil'](this[_0xbbbb('0x16')]['created'])||!this['interaction']['created'])){logger[_0xbbbb('0x17')]('[%s][AUTOREPLY]\x20%s',_0x2c4ec4,'Autoreply\x20already\x20sent');return _0x166edf[_0xbbbb('0x15')]();}if(_0x2ee993[0x0]==='2'&&this[_0xbbbb('0x16')][_0xbbbb('0x18')]){logger[_0xbbbb('0x17')](_0xbbbb('0x19'),_0x2c4ec4,_0xbbbb('0x1a'));return _0x166edf[_0xbbbb('0x15')]();}var _0xd9aef3={'ContactId':this[_0xbbbb('0x1b')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xbbbb('0x1c')};if(this[_0xbbbb('0xf')]===_0xbbbb('0x10')){_0xd9aef3[_0xbbbb('0x11')]=utils[_0xbbbb('0x1d')](_0x2ee993[0x2],this);}else{_0xd9aef3[_0xbbbb('0x11')]=utils[_0xbbbb('0x1d')](_0x2ee993[0x1],this);}if(this[_0xbbbb('0x1e')]){_0xd9aef3['to']=this[_0xbbbb('0x1e')][_0xbbbb('0x1f')]||'';if(this[_0xbbbb('0xf')]==='mail'&&_0x2ee993[0x1]==='1'){_0xd9aef3['cc']=this['message']['cc']||'';}_0xd9aef3['from']=this[_0xbbbb('0x1e')]['to']||'';_0xd9aef3['phone']=this[_0xbbbb('0x1e')][_0xbbbb('0x20')]||'';_0xd9aef3[_0xbbbb('0x21')]=!![];if(this[_0xbbbb('0x1e')][_0xbbbb('0x22')]){_0xd9aef3[_0xbbbb('0x22')]='';_0xd9aef3['subject']+=_[_0xbbbb('0x23')](this[_0xbbbb('0x1e')][_0xbbbb('0x22')],'Re:')?'':_0xbbbb('0x24');_0xd9aef3[_0xbbbb('0x22')]+=this['message'][_0xbbbb('0x22')];}}if(this[_0xbbbb('0xf')]===_0xbbbb('0x25')){_0xd9aef3[_0xbbbb('0x26')]=this[_0xbbbb('0x27')]['id'];}else{_0xd9aef3[_[_0xbbbb('0x28')](this['channel'])+_0xbbbb('0x29')]=this[_0xbbbb('0x27')]['id'];}_0xd9aef3[_['upperFirst'](this[_0xbbbb('0xf')])+_0xbbbb('0x2a')]=this[_0xbbbb('0x16')]['id'];var _0x5a92fd=this[_0xbbbb('0x16')];if(rpc[this[_0xbbbb('0xf')]+'Message']){if(this[_0xbbbb('0xf')]===_0xbbbb('0x10')){_0xd9aef3['inReplyTo']=this[_0xbbbb('0x1e')]['messageId'];_0xd9aef3[_0xbbbb('0x2b')]=_0xbbbb('0x2c')+_[_0xbbbb('0x2d')](_0xd9aef3[_0xbbbb('0x11')],_0xbbbb('0x2e'),_0xbbbb('0x2f'))+_0xbbbb('0x30');_0xd9aef3[_0xbbbb('0x31')]={'Auto-Submitted':_0xbbbb('0x32'),'X-Auto-Response-Suppress':'All','Precedence':_0xbbbb('0x33')};return mailRpc[_0xbbbb('0x34')](this[_0xbbbb('0x27')][_0xbbbb('0x35')],_0xd9aef3)[_0xbbbb('0x36')](function(_0x2c2f47){logger[_0xbbbb('0x17')](_0xbbbb('0x37'),_0x2c4ec4);_0xd9aef3[_0xbbbb('0x38')]=_0x2c2f47[_0xbbbb('0x1e')][_0xbbbb('0x38')];return rpc[_0x2bc3e3+_0xbbbb('0x39')][_0xbbbb('0x3a')](_0xd9aef3);})['then'](function(_0x5837b1){logger[_0xbbbb('0x17')](_0xbbbb('0x13'),_0x2c4ec4,JSON['stringify'](_0x5837b1));})['catch'](function(_0x2559f1){logger[_0xbbbb('0x3b')](_0xbbbb('0x3c'),_0x2c4ec4,JSON['stringify'](_0x2559f1));})['finally'](function(){Promise[_0xbbbb('0x3d')]()[_0xbbbb('0x36')](function(){if(_0x2ee993[0x0]!=='2'||_0x5a92fd[_0xbbbb('0x18')])return;return rpc[_0x2bc3e3+_0xbbbb('0x3e')][_0xbbbb('0x3f')](_0x5a92fd['id'],{'autoreplyExecuted':!![]})[_0xbbbb('0x36')](function(_0x578020){logger['info'](_0xbbbb('0x19'),_0x2c4ec4,JSON[_0xbbbb('0x40')](_0x578020));})[_0xbbbb('0x41')](function(_0x55952c){logger[_0xbbbb('0x3b')](_0xbbbb('0x42'),_0x2c4ec4,JSON[_0xbbbb('0x40')](_0x55952c));});})[_0xbbbb('0x36')](function(){_0x166edf[_0xbbbb('0x15')]();});});}else{return rpc[this[_0xbbbb('0xf')]+'Message'][_0xbbbb('0x3a')](_0xd9aef3)[_0xbbbb('0x36')](function(){logger[_0xbbbb('0x17')](_0xbbbb('0x13'),_0x2c4ec4,_0xd9aef3[_0xbbbb('0x11')]);})['catch'](function(_0x1c47fe){logger['error'](_0xbbbb('0x13'),_0x2c4ec4,JSON[_0xbbbb('0x40')](_0x1c47fe));})['finally'](function(){Promise[_0xbbbb('0x3d')]()[_0xbbbb('0x36')](function(){if(_0x2ee993[0x0]!=='2'||_0x5a92fd[_0xbbbb('0x18')])return;return rpc[_0x2bc3e3+_0xbbbb('0x3e')][_0xbbbb('0x3f')](_0x5a92fd['id'],{'autoreplyExecuted':!![]})['then'](function(_0x1dd54e){logger['info'](_0xbbbb('0x19'),_0x2c4ec4,JSON['stringify'](_0x1dd54e));})['catch'](function(_0x309e8e){logger[_0xbbbb('0x3b')](_0xbbbb('0x42'),_0x2c4ec4,JSON[_0xbbbb('0x40')](_0x309e8e));});})[_0xbbbb('0x36')](function(){_0x166edf[_0xbbbb('0x15')]();});});}}}catch(_0x417d0d){logger['error'](_0xbbbb('0x13'),_0x2c4ec4,JSON[_0xbbbb('0x40')](_0x417d0d));_0x166edf[_0xbbbb('0x43')]();}};}; \ No newline at end of file +var _0x6b4f=['[%s][AUTOREPLY][autoreplyExecuted]\x20%s','contact','format','out','channel','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','inReplyTo','messageId','','replace','headers','auto-replied','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','stringify','catch','error','finally','resolve','autoreplyExecuted','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x6b4f,0x6d));var _0xf6b4=function(_0x270c24,_0x3939fa){_0x270c24=_0x270c24-0x0;var _0x41d574=_0x6b4f[_0x270c24];return _0x41d574;};'use strict';var _=require(_0xf6b4('0x0'));var moment=require(_0xf6b4('0x1'));var utils=require(_0xf6b4('0x2'));var logger=require(_0xf6b4('0x3'))(_0xf6b4('0x4'));var rpc={'chatMessage':require(_0xf6b4('0x5')),'openchannelMessage':require(_0xf6b4('0x6')),'mailMessage':require(_0xf6b4('0x7')),'smsMessage':require(_0xf6b4('0x8')),'faxMessage':require(_0xf6b4('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xf6b4('0xa')),'mailInteraction':require(_0xf6b4('0xb')),'smsInteraction':require(_0xf6b4('0xc')),'faxInteraction':require(_0xf6b4('0xd')),'whatsappInteraction':require(_0xf6b4('0xe'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x5376da,_0x35b062,_0x5b7b0e,_0x4be19b){return function(_0x384933){try{var _0x2f4001=this['channel'];if(_0x2f4001===_0xf6b4('0xf')&&_0x4be19b[_0xf6b4('0x10')][_0xf6b4('0x11')]){logger['info'](_0xf6b4('0x12'),_0x5376da,_0xf6b4('0x13'));return _0x384933[_0xf6b4('0x14')]();}if(_0x35b062[0x0]==='1'&&(_[_0xf6b4('0x15')](this[_0xf6b4('0x16')][_0xf6b4('0x17')])||!this[_0xf6b4('0x16')][_0xf6b4('0x17')])){logger[_0xf6b4('0x18')](_0xf6b4('0x12'),_0x5376da,'Autoreply\x20already\x20sent');return _0x384933[_0xf6b4('0x14')]();}if(_0x35b062[0x0]==='2'&&this[_0xf6b4('0x16')]['autoreplyExecuted']){logger[_0xf6b4('0x18')](_0xf6b4('0x19'),_0x5376da,'One\x20Time\x20already\x20sent');return _0x384933['next']();}var _0x289481={'ContactId':this[_0xf6b4('0x1a')]['id'],'sentAt':moment()[_0xf6b4('0x1b')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xf6b4('0x1c')};if(this[_0xf6b4('0x1d')]===_0xf6b4('0xf')){_0x289481[_0xf6b4('0x10')]=utils[_0xf6b4('0x1e')](_0x35b062[0x2],this);}else{_0x289481[_0xf6b4('0x10')]=utils['getMustacheRender'](_0x35b062[0x1],this);}if(this[_0xf6b4('0x1f')]){_0x289481['to']=this[_0xf6b4('0x1f')][_0xf6b4('0x20')]||'';if(this[_0xf6b4('0x1d')]===_0xf6b4('0xf')&&_0x35b062[0x1]==='1'){_0x289481['cc']=this[_0xf6b4('0x1f')]['cc']||'';}_0x289481[_0xf6b4('0x20')]=this[_0xf6b4('0x1f')]['to']||'';_0x289481[_0xf6b4('0x21')]=this[_0xf6b4('0x1f')][_0xf6b4('0x21')]||'';_0x289481[_0xf6b4('0x22')]=!![];if(this[_0xf6b4('0x1f')][_0xf6b4('0x23')]){_0x289481[_0xf6b4('0x23')]='';_0x289481[_0xf6b4('0x23')]+=_[_0xf6b4('0x24')](this[_0xf6b4('0x1f')][_0xf6b4('0x23')],_0xf6b4('0x25'))?'':_0xf6b4('0x26');_0x289481[_0xf6b4('0x23')]+=this['message'][_0xf6b4('0x23')];}}if(this[_0xf6b4('0x1d')]===_0xf6b4('0x27')){_0x289481[_0xf6b4('0x28')]=this[_0xf6b4('0x29')]['id'];}else{_0x289481[_[_0xf6b4('0x2a')](this[_0xf6b4('0x1d')])+_0xf6b4('0x2b')]=this[_0xf6b4('0x29')]['id'];}_0x289481[_['upperFirst'](this[_0xf6b4('0x1d')])+_0xf6b4('0x2c')]=this[_0xf6b4('0x16')]['id'];var _0x3cdd4b=this['interaction'];if(rpc[this[_0xf6b4('0x1d')]+_0xf6b4('0x2d')]){if(this[_0xf6b4('0x1d')]===_0xf6b4('0xf')){_0x289481[_0xf6b4('0x2e')]=this[_0xf6b4('0x1f')][_0xf6b4('0x2f')];_0x289481['html']=_0xf6b4('0x30')+_[_0xf6b4('0x31')](_0x289481[_0xf6b4('0x10')],'';_0x289481[_0xf6b4('0x32')]={'Auto-Submitted':_0xf6b4('0x33'),'X-Auto-Response-Suppress':'All','Precedence':_0xf6b4('0x34')};return mailRpc[_0xf6b4('0x35')](this[_0xf6b4('0x29')]['smtpOptions'],_0x289481)[_0xf6b4('0x36')](function(_0x2f72fd){logger[_0xf6b4('0x18')](_0xf6b4('0x37'),_0x5376da);_0x289481[_0xf6b4('0x2f')]=_0x2f72fd[_0xf6b4('0x1f')]['messageId'];return rpc[_0x2f4001+_0xf6b4('0x2d')][_0xf6b4('0x38')](_0x289481);})[_0xf6b4('0x36')](function(_0x2c7511){logger['info'](_0xf6b4('0x12'),_0x5376da,JSON[_0xf6b4('0x39')](_0x2c7511));})[_0xf6b4('0x3a')](function(_0x322296){logger[_0xf6b4('0x3b')]('[RPC][%s][AUTOREPLY]\x20%s',_0x5376da,JSON[_0xf6b4('0x39')](_0x322296));})[_0xf6b4('0x3c')](function(){Promise[_0xf6b4('0x3d')]()[_0xf6b4('0x36')](function(){if(_0x35b062[0x0]!=='2'||_0x3cdd4b[_0xf6b4('0x3e')])return;return rpc[_0x2f4001+_0xf6b4('0x3f')][_0xf6b4('0x40')](_0x3cdd4b['id'],{'autoreplyExecuted':!![]})[_0xf6b4('0x36')](function(_0x51e9d1){logger['info'](_0xf6b4('0x19'),_0x5376da,JSON[_0xf6b4('0x39')](_0x51e9d1));})[_0xf6b4('0x3a')](function(_0x351904){logger[_0xf6b4('0x3b')](_0xf6b4('0x41'),_0x5376da,JSON[_0xf6b4('0x39')](_0x351904));});})[_0xf6b4('0x36')](function(){_0x384933[_0xf6b4('0x14')]();});});}else{return rpc[this[_0xf6b4('0x1d')]+_0xf6b4('0x2d')][_0xf6b4('0x38')](_0x289481)[_0xf6b4('0x36')](function(){logger[_0xf6b4('0x18')]('[%s][AUTOREPLY]\x20%s',_0x5376da,_0x289481[_0xf6b4('0x10')]);})[_0xf6b4('0x3a')](function(_0x330653){logger[_0xf6b4('0x3b')](_0xf6b4('0x12'),_0x5376da,JSON[_0xf6b4('0x39')](_0x330653));})['finally'](function(){Promise[_0xf6b4('0x3d')]()[_0xf6b4('0x36')](function(){if(_0x35b062[0x0]!=='2'||_0x3cdd4b[_0xf6b4('0x3e')])return;return rpc[_0x2f4001+_0xf6b4('0x3f')]['update'](_0x3cdd4b['id'],{'autoreplyExecuted':!![]})['then'](function(_0x5840bf){logger[_0xf6b4('0x18')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x5376da,JSON[_0xf6b4('0x39')](_0x5840bf));})['catch'](function(_0x319952){logger[_0xf6b4('0x3b')](_0xf6b4('0x41'),_0x5376da,JSON[_0xf6b4('0x39')](_0x319952));});})[_0xf6b4('0x36')](function(){_0x384933[_0xf6b4('0x14')]();});});}}}catch(_0x5bde1a){logger[_0xf6b4('0x3b')](_0xf6b4('0x12'),_0x5376da,JSON[_0xf6b4('0x39')](_0x5bde1a));_0x384933[_0xf6b4('0x42')]();}};}; \ 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 fdf88e6..f103955 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 _0x0185=['update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','finally','stop','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0185,0x6a));var _0x5018=function(_0x4bc65f,_0x39ec43){_0x4bc65f=_0x4bc65f-0x0;var _0x44f85f=_0x0185[_0x4bc65f];return _0x44f85f;};'use strict';var moment=require(_0x5018('0x0'));var logger=require(_0x5018('0x1'))(_0x5018('0x2'));var rpc={'chatInteraction':require(_0x5018('0x3')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x5018('0x4')),'faxInteraction':require(_0x5018('0x5')),'whatsappInteraction':require(_0x5018('0x6'))};exports[_0x5018('0x7')]=function(_0x1a93f7,_0x4f99f4,_0xe14f22,_0x4b0561){return function(_0x3a4a1e){try{logger[_0x5018('0x8')]('[%s][CLOSE]\x20reason\x20%s',_0x1a93f7,_0x4f99f4[0x0]);var _0x288a3e={'closed':0x1,'closedAt':moment()[_0x5018('0x9')](_0x5018('0xa')),'closeReason':_0x5018('0xb'),'disposition':_0x4f99f4[0x0]};if(rpc[_0x4b0561[_0x5018('0xc')]+_0x5018('0xd')]){rpc[_0x4b0561['channel']+_0x5018('0xd')][_0x5018('0xe')](_0x4b0561[_0x5018('0xf')]['id'],_0x288a3e)[_0x5018('0x10')](function(_0x299c9e){logger['info'](_0x5018('0x11'),_0x1a93f7,_0x4b0561[_0x5018('0xf')]['id']);})[_0x5018('0x12')](function(_0x34fb3b){logger[_0x5018('0x13')](_0x5018('0x14'),_0x1a93f7,JSON['stringify'](_0x34fb3b));})[_0x5018('0x15')](function(){_0x3a4a1e[_0x5018('0x16')]();});}}catch(_0x1f36f5){logger[_0x5018('0x13')](_0x5018('0x14'),_0x1a93f7,JSON[_0x5018('0x17')](_0x1f36f5));_0x3a4a1e[_0x5018('0x16')]();}};}; \ No newline at end of file +var _0x3a78=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','Interaction','update','interaction','then','info','catch','error','stringify','finally','stop','[%s][CLOSE]\x20%s','moment','../../../../config/logger','routing'];(function(_0x2f9781,_0x51ffe3){var _0x1707ed=function(_0x1fb98){while(--_0x1fb98){_0x2f9781['push'](_0x2f9781['shift']());}};_0x1707ed(++_0x51ffe3);}(_0x3a78,0x156));var _0x83a7=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x3a78[_0x5ddaac];return _0x2a9c58;};'use strict';var moment=require(_0x83a7('0x0'));var logger=require(_0x83a7('0x1'))(_0x83a7('0x2'));var rpc={'chatInteraction':require(_0x83a7('0x3')),'openchannelInteraction':require(_0x83a7('0x4')),'smsInteraction':require(_0x83a7('0x5')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x83a7('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x83a7('0x7')]=function(_0x574fd4,_0x10c5b6,_0x454d75,_0x2be7ea){return function(_0x204d5a){try{logger['info'](_0x83a7('0x8'),_0x574fd4,_0x10c5b6[0x0]);var _0x4e4368={'closed':0x1,'closedAt':moment()[_0x83a7('0x9')](_0x83a7('0xa')),'closeReason':_0x83a7('0xb'),'disposition':_0x10c5b6[0x0]};if(rpc[_0x2be7ea['channel']+'Interaction']){rpc[_0x2be7ea['channel']+_0x83a7('0xc')][_0x83a7('0xd')](_0x2be7ea[_0x83a7('0xe')]['id'],_0x4e4368)[_0x83a7('0xf')](function(_0x3ccf35){logger[_0x83a7('0x10')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x574fd4,_0x2be7ea[_0x83a7('0xe')]['id']);})[_0x83a7('0x11')](function(_0x34c75d){logger[_0x83a7('0x12')]('[%s][CLOSE]\x20%s',_0x574fd4,JSON[_0x83a7('0x13')](_0x34c75d));})[_0x83a7('0x14')](function(){_0x204d5a[_0x83a7('0x15')]();});}}catch(_0x346846){logger[_0x83a7('0x12')](_0x83a7('0x16'),_0x574fd4,JSON['stringify'](_0x346846));_0x204d5a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 78ee0b9..2e50960 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 _0xe75a=['textRequest','message','result','fulfillment','speech','providerName','dialogflow','providerResponse','metadata','next','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','[%s][DIALOGFLOW]\x20%s','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','interaction','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','create','then','info','body','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe75a,0x1de));var _0xae75=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0xe75a[_0x3e91a9];return _0x25c9ad;};'use strict';var _=require(_0xae75('0x0'));var moment=require(_0xae75('0x1'));var apiai=require('apiai-promise');var md5=require(_0xae75('0x2'));var utils=require(_0xae75('0x3'));var logger=require(_0xae75('0x4'))(_0xae75('0x5'));var rpc={'chatMessage':require(_0xae75('0x6')),'openchannelMessage':require(_0xae75('0x7')),'mailMessage':require(_0xae75('0x8')),'smsMessage':require(_0xae75('0x9')),'faxMessage':require(_0xae75('0xa')),'whatsappMessage':require(_0xae75('0xb'))};exports['consequence']=function(_0x207d6f,_0x55c165){return function(_0x49ae5b){try{if(!_[_0xae75('0xc')](this['interaction']['UserId'])){logger['info'](_0xae75('0xd'),_0x207d6f,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x49ae5b['next']();}var _0x3a7360={'ContactId':this[_0xae75('0xe')]['id'],'sentAt':moment()['format'](_0xae75('0xf')),'direction':_0xae75('0x10')};if(this['channel']===_0xae75('0x11')||this[_0xae75('0x12')]===_0xae75('0x13')){_0x3a7360['phone']=this[_0xae75('0x14')][_0xae75('0x15')];}var _0x3895fe=this[_0xae75('0x12')];if(_0x3895fe===_0xae75('0x16')){_0x3a7360[_0xae75('0x17')]=this[_0xae75('0x18')]['id'];}else{_0x3a7360[_[_0xae75('0x19')](_0x3895fe)+_0xae75('0x1a')]=this[_0xae75('0x18')]['id'];}_0x3a7360[_['upperFirst'](_0x3895fe)+_0xae75('0x1b')]=this[_0xae75('0x14')]['id'];if(this[_0xae75('0x14')][_0xae75('0x1c')]){var _0x1609d1=_0x55c165[0x2];if(!_[_0xae75('0x1d')](_0x1609d1)){_0x3a7360['body']=utils['getMustacheRender'](_0x1609d1,this);return rpc[_0x3895fe+_0xae75('0x1e')][_0xae75('0x1f')](_0x3a7360)[_0xae75('0x20')](function(_0x582740){logger[_0xae75('0x21')](_0xae75('0xd'),_0x207d6f,_0x3a7360[_0xae75('0x22')]);})[_0xae75('0x23')](function(_0x247667){logger[_0xae75('0x24')]('[%s][DIALOGFLOW]\x20%s',_0x207d6f,JSON[_0xae75('0x25')](_0x247667));})[_0xae75('0x26')](function(){logger[_0xae75('0x21')](_0xae75('0x27'),_0x207d6f);_0x49ae5b[_0xae75('0x28')]();});}else{logger[_0xae75('0x21')](_0xae75('0x29'),_0x207d6f);_0x49ae5b[_0xae75('0x28')]();}}else{var _0x33dc4d=this;var _0x56704c=apiai(_0x55c165[0x0],{'language':_0x55c165[0x1]||'en'});return _0x56704c[_0xae75('0x2a')](this[_0xae75('0x2b')][_0xae75('0x22')],{'sessionId':md5(this[_0xae75('0x14')]['id'])})['then'](function(_0x52b6e6){_0x33dc4d[_0xae75('0x22')]['dialogflow']=_0x52b6e6;_0x3a7360[_0xae75('0x22')]=_0x52b6e6[_0xae75('0x2c')][_0xae75('0x2d')][_0xae75('0x2e')];_0x3a7360[_0xae75('0x2f')]=_0xae75('0x30');_0x3a7360[_0xae75('0x31')]=JSON[_0xae75('0x25')](_0x52b6e6);return rpc[_0x3895fe+_0xae75('0x1e')]['create'](_0x3a7360)[_0xae75('0x20')](function(_0x4bf184){logger[_0xae75('0x21')](_0xae75('0xd'),_0x207d6f,_0x3a7360['body']);if(_0x52b6e6['result'][_0xae75('0x32')]['endConversation']){_0x49ae5b[_0xae75('0x33')]();}else{_0x49ae5b[_0xae75('0x28')]();}})[_0xae75('0x23')](function(_0x2579f7){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x207d6f,JSON[_0xae75('0x25')](_0x2579f7));_0x49ae5b['next']();});})[_0xae75('0x23')](function(_0x58104d){logger[_0xae75('0x24')](_0xae75('0xd'),_0x207d6f,_0x58104d[_0xae75('0x2b')]);_0x49ae5b[_0xae75('0x33')]();});}}catch(_0x234d17){logger[_0xae75('0x24')](_0xae75('0xd'),_0x207d6f,JSON['stringify'](_0x234d17));_0x49ae5b[_0xae75('0x28')]();}};}; \ No newline at end of file +var _0x6596=['catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','body','dialogflow','result','fulfillment','speech','providerName','create','metadata','endConversation','error','message','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','Message','then'];(function(_0x5f09be,_0x36d613){var _0x2915fd=function(_0x1f9320){while(--_0x1f9320){_0x5f09be['push'](_0x5f09be['shift']());}};_0x2915fd(++_0x36d613);}(_0x6596,0x1d3));var _0x6659=function(_0x33821e,_0x4424cb){_0x33821e=_0x33821e-0x0;var _0x16de3e=_0x6596[_0x33821e];return _0x16de3e;};'use strict';var _=require(_0x6659('0x0'));var moment=require(_0x6659('0x1'));var apiai=require('apiai-promise');var md5=require(_0x6659('0x2'));var utils=require(_0x6659('0x3'));var logger=require(_0x6659('0x4'))(_0x6659('0x5'));var rpc={'chatMessage':require(_0x6659('0x6')),'openchannelMessage':require(_0x6659('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x6659('0x8')),'whatsappMessage':require(_0x6659('0x9'))};exports[_0x6659('0xa')]=function(_0x1ed458,_0x29292b){return function(_0x4a900d){try{if(!_['isNil'](this[_0x6659('0xb')][_0x6659('0xc')])){logger[_0x6659('0xd')](_0x6659('0xe'),_0x1ed458,_0x6659('0xf'));return _0x4a900d[_0x6659('0x10')]();}var _0x4e5c6c={'ContactId':this[_0x6659('0x11')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x6659('0x12')};if(this['channel']===_0x6659('0x13')||this[_0x6659('0x14')]===_0x6659('0x15')){_0x4e5c6c[_0x6659('0x16')]=this['interaction'][_0x6659('0x16')];}var _0x329ebc=this['channel'];if(_0x329ebc===_0x6659('0x17')){_0x4e5c6c[_0x6659('0x18')]=this[_0x6659('0x19')]['id'];}else{_0x4e5c6c[_[_0x6659('0x1a')](_0x329ebc)+_0x6659('0x1b')]=this[_0x6659('0x19')]['id'];}_0x4e5c6c[_['upperFirst'](_0x329ebc)+_0x6659('0x1c')]=this[_0x6659('0xb')]['id'];if(this[_0x6659('0xb')][_0x6659('0x1d')]){var _0x324fbc=_0x29292b[0x2];if(!_[_0x6659('0x1e')](_0x324fbc)){_0x4e5c6c['body']=utils['getMustacheRender'](_0x324fbc,this);return rpc[_0x329ebc+_0x6659('0x1f')]['create'](_0x4e5c6c)[_0x6659('0x20')](function(_0x38e4d6){logger['info'](_0x6659('0xe'),_0x1ed458,_0x4e5c6c['body']);})[_0x6659('0x21')](function(_0x1dc4f1){logger['error'](_0x6659('0xe'),_0x1ed458,JSON[_0x6659('0x22')](_0x1dc4f1));})[_0x6659('0x23')](function(){logger[_0x6659('0xd')](_0x6659('0x24'),_0x1ed458);_0x4a900d[_0x6659('0x25')]();});}else{logger[_0x6659('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1ed458);_0x4a900d[_0x6659('0x25')]();}}else{var _0x3506fd=this;var _0x314e40=apiai(_0x29292b[0x0],{'language':_0x29292b[0x1]||'en'});return _0x314e40[_0x6659('0x26')](this['message']['body'],{'sessionId':md5(this['interaction']['id'])})['then'](function(_0xbad53f){_0x3506fd[_0x6659('0x27')][_0x6659('0x28')]=_0xbad53f;_0x4e5c6c[_0x6659('0x27')]=_0xbad53f[_0x6659('0x29')][_0x6659('0x2a')][_0x6659('0x2b')];_0x4e5c6c[_0x6659('0x2c')]=_0x6659('0x28');_0x4e5c6c['providerResponse']=JSON[_0x6659('0x22')](_0xbad53f);return rpc[_0x329ebc+_0x6659('0x1f')][_0x6659('0x2d')](_0x4e5c6c)['then'](function(_0x4f6787){logger[_0x6659('0xd')](_0x6659('0xe'),_0x1ed458,_0x4e5c6c['body']);if(_0xbad53f[_0x6659('0x29')][_0x6659('0x2e')][_0x6659('0x2f')]){_0x4a900d[_0x6659('0x10')]();}else{_0x4a900d[_0x6659('0x25')]();}})['catch'](function(_0x23ee05){logger[_0x6659('0x30')](_0x6659('0xe'),_0x1ed458,JSON[_0x6659('0x22')](_0x23ee05));_0x4a900d[_0x6659('0x10')]();});})['catch'](function(_0x32ba2a){logger[_0x6659('0x30')](_0x6659('0xe'),_0x1ed458,_0x32ba2a[_0x6659('0x31')]);_0x4a900d[_0x6659('0x10')]();});}}catch(_0x41094b){logger[_0x6659('0x30')]('[%s][DIALOGFLOW]\x20%s',_0x1ed458,JSON[_0x6659('0x22')](_0x41094b));_0x4a900d[_0x6659('0x25')]();}};}; \ 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 eb54cb5..2329d53 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 _0xa7bf=['../../rpc/whatsappMessage','clone','body','create','info','catch','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','YYYY-MM-DD\x20HH:mm:ss','channel','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','created','Message','then','error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','replace','SessionsClient','message','queryResult','diagnosticInfo','fields','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','end_conversation','intent','name','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','length','fulfillmentText','all','next','stack','lodash','dialogflow','md5','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage'];(function(_0x20025e,_0x44c8e1){var _0x4a5ac4=function(_0x359a69){while(--_0x359a69){_0x20025e['push'](_0x20025e['shift']());}};_0x4a5ac4(++_0x44c8e1);}(_0xa7bf,0x118));var _0xfa7b=function(_0x241732,_0x26bb3e){_0x241732=_0x241732-0x0;var _0x221023=_0xa7bf[_0x241732];return _0x221023;};'use strict';var _=require(_0xfa7b('0x0'));var dialogflow=require(_0xfa7b('0x1'));var md5=require(_0xfa7b('0x2'));var moment=require(_0xfa7b('0x3'));var Promise=require(_0xfa7b('0x4'));var logger=require('../../../../config/logger')(_0xfa7b('0x5'));var utils=require(_0xfa7b('0x6'));var rpc={'chatMessage':require(_0xfa7b('0x7')),'openchannelMessage':require(_0xfa7b('0x8')),'mailMessage':require(_0xfa7b('0x9')),'smsMessage':require(_0xfa7b('0xa')),'faxMessage':require(_0xfa7b('0xb')),'whatsappMessage':require(_0xfa7b('0xc'))};function createMessage(_0x52785e,_0x1e2f5b,_0x4d48f9,_0x2b0baf){return new Promise(function(_0x115ebb,_0x772d1a){var _0x30f830=_[_0xfa7b('0xd')](_0x4d48f9);_0x30f830[_0xfa7b('0xe')]=_0x2b0baf;return rpc[_0x1e2f5b+'Message'][_0xfa7b('0xf')](_0x30f830)['then'](function(){logger[_0xfa7b('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x52785e,_0x30f830[_0xfa7b('0xe')]);_0x115ebb();})[_0xfa7b('0x11')](function(_0x150897){logger['error'](_0xfa7b('0x12'),_0x52785e,JSON[_0xfa7b('0x13')](_0x150897));_0x772d1a(_0x150897);});});}exports[_0xfa7b('0x14')]=function(_0x21f0c2,_0x1ccbbd){return function(_0x304ebd){try{if(!_[_0xfa7b('0x15')](this[_0xfa7b('0x16')]['UserId'])){logger[_0xfa7b('0x10')](_0xfa7b('0x12'),_0x21f0c2,_0xfa7b('0x17'));return _0x304ebd['next']();}var _0x147c3a={'ContactId':this[_0xfa7b('0x18')]['id'],'sentAt':moment()['format'](_0xfa7b('0x19')),'direction':'out'};if(this[_0xfa7b('0x1a')]==='sms'||this[_0xfa7b('0x1a')]===_0xfa7b('0x1b')){_0x147c3a[_0xfa7b('0x1c')]=this[_0xfa7b('0x16')][_0xfa7b('0x1c')];}var _0x45612e=this[_0xfa7b('0x1a')];if(_0x45612e===_0xfa7b('0x1d')){_0x147c3a[_0xfa7b('0x1e')]=this['account']['id'];}else{_0x147c3a[_[_0xfa7b('0x1f')](_0x45612e)+_0xfa7b('0x20')]=this[_0xfa7b('0x21')]['id'];}_0x147c3a[_[_0xfa7b('0x1f')](_0x45612e)+'InteractionId']=this['interaction']['id'];if(this['interaction'][_0xfa7b('0x22')]){var _0x569500=_0x1ccbbd[0x4];if(!_['isEmpty'](_0x569500)){_0x147c3a['body']=utils['getMustacheRender'](_0x569500,this);return rpc[_0x45612e+_0xfa7b('0x23')][_0xfa7b('0xf')](_0x147c3a)[_0xfa7b('0x24')](function(_0x2bdab3){logger['info'](_0xfa7b('0x12'),_0x21f0c2,_0x147c3a[_0xfa7b('0xe')]);})[_0xfa7b('0x11')](function(_0x3c74c9){logger[_0xfa7b('0x25')](_0xfa7b('0x12'),_0x21f0c2,JSON[_0xfa7b('0x13')](_0x3c74c9));})[_0xfa7b('0x26')](function(){logger['info'](_0xfa7b('0x27'),_0x21f0c2);_0x304ebd['stop']();});}else{logger[_0xfa7b('0x10')](_0xfa7b('0x28'),_0x21f0c2);_0x304ebd[_0xfa7b('0x29')]();}}else{var _0x19c8d1=this;var _0x4a89a8=_0x1ccbbd[0x2][_0xfa7b('0x2a')](/\\n/g,'\x0a');var _0xced0c6={'credentials':{'private_key':_0x4a89a8,'client_email':_0x1ccbbd[0x1]}};var _0xfcc695=new dialogflow[(_0xfa7b('0x2b'))](_0xced0c6);var _0x520d11=_0xfcc695['sessionPath'](_0x1ccbbd[0x0],md5(_0x19c8d1[_0xfa7b('0x16')]['id']));var _0x1e62fe={'session':_0x520d11,'queryInput':{'text':{'text':_0x19c8d1[_0xfa7b('0x2c')]['body'],'languageCode':_0x1ccbbd[0x3]||'en'}}};return _0xfcc695['detectIntent'](_0x1e62fe)[_0xfa7b('0x24')](function(_0xa5d4b9){if(_0xa5d4b9&&_0xa5d4b9['length']){_0x19c8d1[_0xfa7b('0xe')]['dialogflowV2']=_0xa5d4b9;var _0x550f05=_0xa5d4b9[0x0];var _0x572239=_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x2e')]&&_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x2e')]['fields']?_0x550f05[_0xfa7b('0x2d')]['diagnosticInfo'][_0xfa7b('0x2f')]['end_conversation'][_0xfa7b('0x30')]:![];_0x19c8d1[_0xfa7b('0xe')][_0xfa7b('0x31')]=_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x32')];_0x19c8d1[_0xfa7b('0xe')][_0xfa7b('0x33')]=_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x34')];_0x19c8d1[_0xfa7b('0xe')][_0xfa7b('0x35')]=_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x2e')]&&_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x2e')][_0xfa7b('0x2f')]?_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x2e')][_0xfa7b('0x2f')][_0xfa7b('0x36')][_0xfa7b('0x30')]:![];_0x19c8d1[_0xfa7b('0xe')]['DIALOGFLOWV2_INTENTNAME']=_0x550f05['queryResult'][_0xfa7b('0x37')][_0xfa7b('0x38')];_0x19c8d1[_0xfa7b('0xe')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x550f05['queryResult'][_0xfa7b('0x37')][_0xfa7b('0x39')];_0x19c8d1['body'][_0xfa7b('0x3a')]=_0x550f05[_0xfa7b('0x2d')]['intent'][_0xfa7b('0x3b')];_0x19c8d1['body'][_0xfa7b('0x3c')]=_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x3d')];_0x19c8d1[_0xfa7b('0xe')]['DIALOGFLOWV2_QUERYTEXT']=_0x550f05[_0xfa7b('0x2d')][_0xfa7b('0x3e')];_0x19c8d1[_0xfa7b('0xe')][_0xfa7b('0x3f')]=_0x550f05['queryResult'][_0xfa7b('0x40')];_0x147c3a[_0xfa7b('0x41')]=_0xfa7b('0x42');_0x147c3a[_0xfa7b('0x43')]=JSON[_0xfa7b('0x13')](_0xa5d4b9);var _0x294bc8=[];for(var _0x1cb3e1=0x0;_0x1cb3e1<_0xa5d4b9[_0xfa7b('0x44')];_0x1cb3e1++){var _0x450e17=_0xa5d4b9[_0x1cb3e1];if(_0x450e17&&_0x450e17['queryResult']&&_0x450e17[_0xfa7b('0x2d')][_0xfa7b('0x45')]){_0x294bc8['push'](createMessage(_0x21f0c2,_0x45612e,_0x147c3a,_0x450e17['queryResult'][_0xfa7b('0x45')]));}}return Promise[_0xfa7b('0x46')](_0x294bc8)['then'](function(){if(_0x572239){_0x304ebd[_0xfa7b('0x47')]();}else{_0x304ebd[_0xfa7b('0x29')]();}})[_0xfa7b('0x11')](function(_0x1d6031){logger[_0xfa7b('0x25')](_0xfa7b('0x12'),_0x21f0c2,JSON[_0xfa7b('0x13')](_0x1d6031));_0x304ebd[_0xfa7b('0x47')]();});}})['catch'](function(_0x15a0ef){logger[_0xfa7b('0x25')](_0xfa7b('0x12'),_0x21f0c2,_0x15a0ef[_0xfa7b('0x2c')],_0x15a0ef[_0xfa7b('0x48')]);_0x304ebd['next']();});}}catch(_0x10c69e){logger[_0xfa7b('0x25')](_0xfa7b('0x12'),_0x21f0c2,JSON['stringify'](_0x10c69e));_0x304ebd[_0xfa7b('0x29')]();}};}; \ No newline at end of file +var _0xfeb9=['message','then','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerResponse','fulfillmentText','all','stack','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','catch','[%s][DIALOGFLOWV2]\x20%s','consequence','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','upperFirst','AccountId','InteractionId','created','isEmpty','create','error','stringify','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace'];(function(_0x59fd5a,_0x544c1c){var _0x50da96=function(_0x390ee1){while(--_0x390ee1){_0x59fd5a['push'](_0x59fd5a['shift']());}};_0x50da96(++_0x544c1c);}(_0xfeb9,0x1c7));var _0x9feb=function(_0x5d7ddd,_0x529ac8){_0x5d7ddd=_0x5d7ddd-0x0;var _0x22483a=_0xfeb9[_0x5d7ddd];return _0x22483a;};'use strict';var _=require(_0x9feb('0x0'));var dialogflow=require(_0x9feb('0x1'));var md5=require('md5');var moment=require(_0x9feb('0x2'));var Promise=require(_0x9feb('0x3'));var logger=require(_0x9feb('0x4'))(_0x9feb('0x5'));var utils=require(_0x9feb('0x6'));var rpc={'chatMessage':require(_0x9feb('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x9feb('0x8')),'smsMessage':require(_0x9feb('0x9')),'faxMessage':require(_0x9feb('0xa')),'whatsappMessage':require(_0x9feb('0xb'))};function createMessage(_0x1cc09c,_0x1ca876,_0xdc85b,_0xb3f3ad){return new Promise(function(_0x530a27,_0x42318a){var _0x4c2847=_['clone'](_0xdc85b);_0x4c2847[_0x9feb('0xc')]=_0xb3f3ad;return rpc[_0x1ca876+'Message']['create'](_0x4c2847)['then'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x1cc09c,_0x4c2847['body']);_0x530a27();})[_0x9feb('0xd')](function(_0x58eb44){logger['error'](_0x9feb('0xe'),_0x1cc09c,JSON['stringify'](_0x58eb44));_0x42318a(_0x58eb44);});});}exports[_0x9feb('0xf')]=function(_0x5d9457,_0x19e167){return function(_0x8ce315){try{if(!_[_0x9feb('0x10')](this[_0x9feb('0x11')][_0x9feb('0x12')])){logger[_0x9feb('0x13')](_0x9feb('0xe'),_0x5d9457,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x8ce315[_0x9feb('0x14')]();}var _0x500252={'ContactId':this[_0x9feb('0x15')]['id'],'sentAt':moment()[_0x9feb('0x16')](_0x9feb('0x17')),'direction':_0x9feb('0x18')};if(this[_0x9feb('0x19')]===_0x9feb('0x1a')||this['channel']===_0x9feb('0x1b')){_0x500252['phone']=this[_0x9feb('0x11')][_0x9feb('0x1c')];}var _0x964e37=this[_0x9feb('0x19')];if(_0x964e37===_0x9feb('0x1d')){_0x500252['ChatWebsiteId']=this['account']['id'];}else{_0x500252[_[_0x9feb('0x1e')](_0x964e37)+_0x9feb('0x1f')]=this['account']['id'];}_0x500252[_[_0x9feb('0x1e')](_0x964e37)+_0x9feb('0x20')]=this[_0x9feb('0x11')]['id'];if(this[_0x9feb('0x11')][_0x9feb('0x21')]){var _0x213ebc=_0x19e167[0x4];if(!_[_0x9feb('0x22')](_0x213ebc)){_0x500252[_0x9feb('0xc')]=utils['getMustacheRender'](_0x213ebc,this);return rpc[_0x964e37+'Message'][_0x9feb('0x23')](_0x500252)['then'](function(_0x30101d){logger[_0x9feb('0x13')](_0x9feb('0xe'),_0x5d9457,_0x500252[_0x9feb('0xc')]);})[_0x9feb('0xd')](function(_0x13db52){logger[_0x9feb('0x24')](_0x9feb('0xe'),_0x5d9457,JSON[_0x9feb('0x25')](_0x13db52));})[_0x9feb('0x26')](function(){logger['info'](_0x9feb('0x27'),_0x5d9457);_0x8ce315[_0x9feb('0x28')]();});}else{logger[_0x9feb('0x13')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x5d9457);_0x8ce315[_0x9feb('0x28')]();}}else{var _0x7d19ce=this;var _0x1b93c8=_0x19e167[0x2][_0x9feb('0x29')](/\\n/g,'\x0a');var _0x165dfa={'credentials':{'private_key':_0x1b93c8,'client_email':_0x19e167[0x1]}};var _0x23f8ca=new dialogflow['SessionsClient'](_0x165dfa);var _0x25b108=_0x23f8ca['sessionPath'](_0x19e167[0x0],md5(_0x7d19ce[_0x9feb('0x11')]['id']));var _0x4dc937={'session':_0x25b108,'queryInput':{'text':{'text':_0x7d19ce[_0x9feb('0x2a')]['body'],'languageCode':_0x19e167[0x3]||'en'}}};return _0x23f8ca['detectIntent'](_0x4dc937)[_0x9feb('0x2b')](function(_0x2319b5){if(_0x2319b5&&_0x2319b5[_0x9feb('0x2c')]){_0x7d19ce[_0x9feb('0xc')][_0x9feb('0x2d')]=_0x2319b5;var _0x2c49c5=_0x2319b5[0x0];var _0x55eeb2=_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x2f')]&&_0x2c49c5['queryResult']['diagnosticInfo'][_0x9feb('0x30')]?_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x2f')][_0x9feb('0x30')][_0x9feb('0x31')][_0x9feb('0x32')]:![];_0x7d19ce[_0x9feb('0xc')][_0x9feb('0x33')]=_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x34')];_0x7d19ce[_0x9feb('0xc')][_0x9feb('0x35')]=_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x36')];_0x7d19ce[_0x9feb('0xc')][_0x9feb('0x37')]=_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x2f')]&&_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x2f')][_0x9feb('0x30')]?_0x2c49c5[_0x9feb('0x2e')]['diagnosticInfo'][_0x9feb('0x30')]['end_conversation'][_0x9feb('0x32')]:![];_0x7d19ce[_0x9feb('0xc')][_0x9feb('0x38')]=_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x39')][_0x9feb('0x3a')];_0x7d19ce[_0x9feb('0xc')][_0x9feb('0x3b')]=_0x2c49c5['queryResult'][_0x9feb('0x39')][_0x9feb('0x3c')];_0x7d19ce[_0x9feb('0xc')][_0x9feb('0x3d')]=_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x39')][_0x9feb('0x3e')];_0x7d19ce['body'][_0x9feb('0x3f')]=_0x2c49c5[_0x9feb('0x2e')]['languageCode'];_0x7d19ce['body'][_0x9feb('0x40')]=_0x2c49c5['queryResult'][_0x9feb('0x41')];_0x7d19ce['body']['DIALOGFLOWV2_SCORE']=_0x2c49c5[_0x9feb('0x2e')][_0x9feb('0x42')];_0x500252['providerName']=_0x9feb('0x2d');_0x500252[_0x9feb('0x43')]=JSON[_0x9feb('0x25')](_0x2319b5);var _0xef7677=[];for(var _0x11255a=0x0;_0x11255a<_0x2319b5['length'];_0x11255a++){var _0x5d1317=_0x2319b5[_0x11255a];if(_0x5d1317&&_0x5d1317[_0x9feb('0x2e')]&&_0x5d1317[_0x9feb('0x2e')][_0x9feb('0x44')]){_0xef7677['push'](createMessage(_0x5d9457,_0x964e37,_0x500252,_0x5d1317[_0x9feb('0x2e')]['fulfillmentText']));}}return Promise[_0x9feb('0x45')](_0xef7677)['then'](function(){if(_0x55eeb2){_0x8ce315[_0x9feb('0x14')]();}else{_0x8ce315['stop']();}})[_0x9feb('0xd')](function(_0x4a3c98){logger['error'](_0x9feb('0xe'),_0x5d9457,JSON[_0x9feb('0x25')](_0x4a3c98));_0x8ce315['next']();});}})[_0x9feb('0xd')](function(_0x2630f9){logger[_0x9feb('0x24')](_0x9feb('0xe'),_0x5d9457,_0x2630f9[_0x9feb('0x2a')],_0x2630f9[_0x9feb('0x46')]);_0x8ce315[_0x9feb('0x14')]();});}}catch(_0x242388){logger[_0x9feb('0x24')](_0x9feb('0xe'),_0x5d9457,JSON['stringify'](_0x242388));_0x8ce315[_0x9feb('0x28')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 76933ec..b5eda78 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 _0x339e=['priorityTrue','priorityFalse','info','next','findIndex','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','routing','string','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition'];(function(_0x16f021,_0x50aa14){var _0x4d0309=function(_0x855c1c){while(--_0x855c1c){_0x16f021['push'](_0x16f021['shift']());}};_0x4d0309(++_0x50aa14);}(_0x339e,0xe0));var _0xe339=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x339e[_0x3947c9];return _0x2e7871;};'use strict';var schema=require(_0xe339('0x0'));var _=require(_0xe339('0x1'));var htmlToText=require(_0xe339('0x2'));var utils=require(_0xe339('0x3'));var logger=require('../../../../config/logger')(_0xe339('0x4'));var gotoif=schema({'condition':{'type':_0xe339('0x5'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':'number','message':_0xe339('0x6')},'priorityFalse':{'type':_0xe339('0x7'),'message':_0xe339('0x8')}});exports['consequence']=function(_0x40e9c1,_0x2700b8){return function(_0x258f41){try{var _0x597bc0={'condition':htmlToText[_0xe339('0x9')](utils[_0xe339('0xa')](_0x2700b8[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2700b8[0x1],'priorityFalse':_0x2700b8[0x2]};var _0xc86d87=gotoif[_0xe339('0x0')](_0x597bc0,{'typecast':!![]});if(_0xc86d87[_0xe339('0xb')]){logger[_0xe339('0xc')](_0xe339('0xd'),_0x40e9c1,_[_0xe339('0xe')](_0xc86d87,_0xe339('0xf'))[_0xe339('0x10')](',\x20'));_0x258f41[_0xe339('0x11')]();}else{try{var _0x2ca484=eval('('+_0x597bc0[_0xe339('0x12')]+')');var _0x4c4147=_0x2ca484?_0x597bc0[_0xe339('0x13')]:_0x597bc0[_0xe339('0x14')];logger[_0xe339('0x15')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x40e9c1,_0x597bc0[_0xe339('0x12')],_0x2ca484,_0x4c4147||_0xe339('0x16'));if(_0x4c4147){var _0x4460b2=_[_0xe339('0x17')](_0x258f41['rules'](),{'p':_0x4c4147});if(_0x4460b2>=0x0){logger['info'](_0xe339('0x18'),_0x40e9c1,_0x4c4147||_0xe339('0x16'),_0x4460b2);_0x258f41[_0xe339('0x16')](_0x4460b2);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x40e9c1,_0x4c4147||_0xe339('0x16'));_0x258f41['stop']();}}else{_0x258f41[_0xe339('0x16')]();}}catch(_0x3ba1d5){logger['error'](_0xe339('0x19'),_0x40e9c1,_0x3ba1d5['message']);_0x258f41[_0xe339('0x11')]();}}}catch(_0xc90341){logger['error'](_0xe339('0xd'),_0x40e9c1,JSON[_0xe339('0x1a')](_0xc90341));_0x258f41[_0xe339('0x11')]();}};}; \ No newline at end of file +var _0xf31b=['lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','next','stringify','validate'];(function(_0x44d693,_0x4a9d83){var _0x3aa5bb=function(_0x3efa06){while(--_0x3efa06){_0x44d693['push'](_0x44d693['shift']());}};_0x3aa5bb(++_0x4a9d83);}(_0xf31b,0x195));var _0xbf31=function(_0x1ac6fc,_0x51a028){_0x1ac6fc=_0x1ac6fc-0x0;var _0x3ece2d=_0xf31b[_0x1ac6fc];return _0x3ece2d;};'use strict';var schema=require(_0xbf31('0x0'));var _=require(_0xbf31('0x1'));var htmlToText=require(_0xbf31('0x2'));var utils=require(_0xbf31('0x3'));var logger=require(_0xbf31('0x4'))(_0xbf31('0x5'));var gotoif=schema({'condition':{'type':_0xbf31('0x6'),'required':!![],'message':_0xbf31('0x7')},'priorityTrue':{'type':_0xbf31('0x8'),'message':_0xbf31('0x9')},'priorityFalse':{'type':_0xbf31('0x8'),'message':_0xbf31('0xa')}});exports[_0xbf31('0xb')]=function(_0x3d7a07,_0x3e538b){return function(_0xbee15c){try{var _0x4fcf8={'condition':htmlToText[_0xbf31('0xc')](utils['getMustacheRender'](_0x3e538b[0x0],this),{'wordwrap':![]})[_0xbf31('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x3e538b[0x1],'priorityFalse':_0x3e538b[0x2]};var _0x480eda=gotoif[_0xbf31('0x0')](_0x4fcf8,{'typecast':!![]});if(_0x480eda[_0xbf31('0xe')]){logger[_0xbf31('0xf')](_0xbf31('0x10'),_0x3d7a07,_['map'](_0x480eda,_0xbf31('0x11'))[_0xbf31('0x12')](',\x20'));_0xbee15c[_0xbf31('0x13')]();}else{try{var _0x299942=eval('('+_0x4fcf8[_0xbf31('0x14')]+')');var _0x2a9f48=_0x299942?_0x4fcf8[_0xbf31('0x15')]:_0x4fcf8[_0xbf31('0x16')];logger[_0xbf31('0x17')](_0xbf31('0x18'),_0x3d7a07,_0x4fcf8[_0xbf31('0x14')],_0x299942,_0x2a9f48||'next');if(_0x2a9f48){var _0x273ef0=_[_0xbf31('0x19')](_0xbee15c[_0xbf31('0x1a')](),{'p':_0x2a9f48});if(_0x273ef0>=0x0){logger[_0xbf31('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3d7a07,_0x2a9f48||_0xbf31('0x1b'),_0x273ef0);_0xbee15c['next'](_0x273ef0);}else{logger[_0xbf31('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3d7a07,_0x2a9f48||_0xbf31('0x1b'));_0xbee15c['stop']();}}else{_0xbee15c[_0xbf31('0x1b')]();}}catch(_0x22c510){logger['error']('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x3d7a07,_0x22c510[_0xbf31('0x11')]);_0xbee15c[_0xbf31('0x13')]();}}}catch(_0x2286fb){logger[_0xbf31('0xf')](_0xbf31('0x10'),_0x3d7a07,JSON[_0xbf31('0x1c')](_0x2286fb));_0xbee15c[_0xbf31('0x13')]();}};}; \ 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 3df51b8..1ebb4e8 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 _0x323b=['../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','validate','lodash'];(function(_0xe234be,_0x3ab2e8){var _0x2bc882=function(_0x1ea7eb){while(--_0x1ea7eb){_0xe234be['push'](_0xe234be['shift']());}};_0x2bc882(++_0x3ab2e8);}(_0x323b,0x116));var _0xb323=function(_0x1cd6d6,_0x2e4fee){_0x1cd6d6=_0x1cd6d6-0x0;var _0x5b02ec=_0x323b[_0x1cd6d6];return _0x5b02ec;};'use strict';var schema=require(_0xb323('0x0'));var _=require(_0xb323('0x1'));var logger=require(_0xb323('0x2'))(_0xb323('0x3'));var gotop=schema({'priority':{'type':_0xb323('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xb323('0x5')]=function(_0x15c92a,_0x2c6a67){return function(_0x4494a6){try{var _0x1f6fae={'priority':_0x2c6a67[0x0]};var _0x48a879=gotop[_0xb323('0x0')](_0x1f6fae,{'typecast':!![]});if(_0x48a879[_0xb323('0x6')]){logger[_0xb323('0x7')](_0xb323('0x8'),_0x15c92a,_[_0xb323('0x9')](_0x48a879,_0xb323('0xa'))['join'](',\x20'));_0x4494a6['stop']();}else{logger[_0xb323('0xb')](_0xb323('0xc'),_0x15c92a,_0x1f6fae[_0xb323('0xd')]);if(_0x1f6fae[_0xb323('0xd')]){var _0x16e646=_[_0xb323('0xe')](_0x4494a6[_0xb323('0xf')](),{'p':_0x1f6fae[_0xb323('0xd')]});if(_0x16e646>=0x0){logger[_0xb323('0xb')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x15c92a,_0x1f6fae[_0xb323('0xd')]||_0xb323('0x10'),_0x16e646);_0x4494a6[_0xb323('0x10')](_0x16e646);}else{logger[_0xb323('0xb')](_0xb323('0x11'),_0x15c92a,_0x1f6fae[_0xb323('0xd')]||_0xb323('0x10'));_0x4494a6[_0xb323('0x12')]();}}else{_0x4494a6[_0xb323('0x10')]();}}}catch(_0x5e50b1){logger[_0xb323('0x7')](_0xb323('0x8'),_0x15c92a,JSON[_0xb323('0x13')](_0x5e50b1));_0x4494a6[_0xb323('0x12')]();}};}; \ No newline at end of file +var _0xd002=['next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s'];(function(_0xd60bf9,_0x4190de){var _0x7de348=function(_0x3b9f5b){while(--_0x3b9f5b){_0xd60bf9['push'](_0xd60bf9['shift']());}};_0x7de348(++_0x4190de);}(_0xd002,0x97));var _0x2d00=function(_0x32158d,_0x4c6085){_0x32158d=_0x32158d-0x0;var _0x1fc3cf=_0xd002[_0x32158d];return _0x1fc3cf;};'use strict';var schema=require(_0x2d00('0x0'));var _=require('lodash');var logger=require(_0x2d00('0x1'))(_0x2d00('0x2'));var gotop=schema({'priority':{'type':_0x2d00('0x3'),'required':!![],'message':_0x2d00('0x4')}});exports[_0x2d00('0x5')]=function(_0x1e797d,_0x550693){return function(_0x599527){try{var _0x3ddeec={'priority':_0x550693[0x0]};var _0x5175b0=gotop[_0x2d00('0x0')](_0x3ddeec,{'typecast':!![]});if(_0x5175b0[_0x2d00('0x6')]){logger[_0x2d00('0x7')]('[%s][GOTOP]\x20%s',_0x1e797d,_[_0x2d00('0x8')](_0x5175b0,'message')[_0x2d00('0x9')](',\x20'));_0x599527[_0x2d00('0xa')]();}else{logger[_0x2d00('0xb')](_0x2d00('0xc'),_0x1e797d,_0x3ddeec[_0x2d00('0xd')]);if(_0x3ddeec['priority']){var _0x1cf5ff=_[_0x2d00('0xe')](_0x599527[_0x2d00('0xf')](),{'p':_0x3ddeec['priority']});if(_0x1cf5ff>=0x0){logger[_0x2d00('0xb')](_0x2d00('0x10'),_0x1e797d,_0x3ddeec[_0x2d00('0xd')]||_0x2d00('0x11'),_0x1cf5ff);_0x599527[_0x2d00('0x11')](_0x1cf5ff);}else{logger[_0x2d00('0xb')](_0x2d00('0x12'),_0x1e797d,_0x3ddeec[_0x2d00('0xd')]||_0x2d00('0x11'));_0x599527[_0x2d00('0xa')]();}}else{_0x599527[_0x2d00('0x11')]();}}}catch(_0x3dd901){logger[_0x2d00('0x7')](_0x2d00('0x13'),_0x1e797d,JSON[_0x2d00('0x14')](_0x3dd901));_0x599527[_0x2d00('0xa')]();}};}; \ 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 ebaabe5..8b0788a 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 _0x945a=['channel','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','interaction','Message','create','then','body','next','catch','error','stringify','stop','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender'];(function(_0x504c91,_0x2eb375){var _0x5c9a68=function(_0x469432){while(--_0x469432){_0x504c91['push'](_0x504c91['shift']());}};_0x5c9a68(++_0x2eb375);}(_0x945a,0x1d2));var _0xa945=function(_0x475d7d,_0x3435c0){_0x475d7d=_0x475d7d-0x0;var _0x4d5492=_0x945a[_0x475d7d];return _0x4d5492;};'use strict';var _=require('lodash');var utils=require(_0xa945('0x0'));var logger=require(_0xa945('0x1'))(_0xa945('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xa945('0x3')),'mailMessage':require(_0xa945('0x4')),'smsMessage':require(_0xa945('0x5')),'faxMessage':require(_0xa945('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xa945('0x7')]=function(_0x3b34a5,_0x24d1ef){return function(_0x26b382){try{var _0x401c7b={'body':utils[_0xa945('0x8')](_0x24d1ef[0x0],this),'ContactId':this['contact']['id']};if(this[_0xa945('0x9')]==='chat'){_0x401c7b[_0xa945('0xa')]=this[_0xa945('0xb')]['id'];}else{_0x401c7b[_['upperFirst'](this[_0xa945('0x9')])+_0xa945('0xc')]=this[_0xa945('0xb')]['id'];}_0x401c7b[_[_0xa945('0xd')](this[_0xa945('0x9')])+_0xa945('0xe')]=this[_0xa945('0xf')]['id'];if(rpc[this['channel']+_0xa945('0x10')]){return rpc[this[_0xa945('0x9')]+_0xa945('0x10')][_0xa945('0x11')](_0x401c7b)[_0xa945('0x12')](function(_0x2ce22b){logger['info']('[%s][MESSAGE]\x20%s',_0x3b34a5,_0x401c7b[_0xa945('0x13')]);_0x26b382[_0xa945('0x14')]();})[_0xa945('0x15')](function(_0x49308e){logger[_0xa945('0x16')]('[%s][MESSAGE]\x20%s',_0x3b34a5,JSON[_0xa945('0x17')](_0x49308e));_0x26b382['stop']();});}}catch(_0x3379e0){logger['error']('[%s][MESSAGE]\x20%s',_0x3b34a5,JSON['stringify'](_0x3379e0));_0x26b382[_0xa945('0x18')]();}};}; \ No newline at end of file +var _0xcc85=['stringify','stop','error','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','chat','upperFirst','channel','AccountId','account','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','catch'];(function(_0x34d1aa,_0x2e1799){var _0x11e755=function(_0x20f464){while(--_0x20f464){_0x34d1aa['push'](_0x34d1aa['shift']());}};_0x11e755(++_0x2e1799);}(_0xcc85,0x121));var _0x5cc8=function(_0x3e85a4,_0x18c3a9){_0x3e85a4=_0x3e85a4-0x0;var _0x21e7d1=_0xcc85[_0x3e85a4];return _0x21e7d1;};'use strict';var _=require('lodash');var utils=require(_0x5cc8('0x0'));var logger=require('../../../../config/logger')(_0x5cc8('0x1'));var rpc={'chatMessage':require(_0x5cc8('0x2')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x5cc8('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x5cc8('0x4')),'whatsappMessage':require(_0x5cc8('0x5'))};exports['consequence']=function(_0x124fa6,_0x531039){return function(_0x576844){try{var _0x25a65d={'body':utils[_0x5cc8('0x6')](_0x531039[0x0],this),'ContactId':this[_0x5cc8('0x7')]['id']};if(this['channel']===_0x5cc8('0x8')){_0x25a65d['ChatWebsiteId']=this['account']['id'];}else{_0x25a65d[_[_0x5cc8('0x9')](this[_0x5cc8('0xa')])+_0x5cc8('0xb')]=this[_0x5cc8('0xc')]['id'];}_0x25a65d[_[_0x5cc8('0x9')](this['channel'])+_0x5cc8('0xd')]=this[_0x5cc8('0xe')]['id'];if(rpc[this[_0x5cc8('0xa')]+_0x5cc8('0xf')]){return rpc[this['channel']+'Message'][_0x5cc8('0x10')](_0x25a65d)[_0x5cc8('0x11')](function(_0x544f9f){logger[_0x5cc8('0x12')](_0x5cc8('0x13'),_0x124fa6,_0x25a65d[_0x5cc8('0x14')]);_0x576844[_0x5cc8('0x15')]();})[_0x5cc8('0x16')](function(_0x5d5ff0){logger['error'](_0x5cc8('0x13'),_0x124fa6,JSON[_0x5cc8('0x17')](_0x5d5ff0));_0x576844[_0x5cc8('0x18')]();});}}catch(_0x82486a){logger[_0x5cc8('0x19')](_0x5cc8('0x13'),_0x124fa6,JSON[_0x5cc8('0x17')](_0x82486a));_0x576844[_0x5cc8('0x18')]();}};}; \ 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 a9d2ca5..b312d46 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 _0x7f65=['[%s][NOOP]\x20%s','next','error','stop','./utils','consequence'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x7f65,0xdc));var _0x57f6=function(_0x5a5d8b,_0x290d27){_0x5a5d8b=_0x5a5d8b-0x0;var _0x5a09b2=_0x7f65[_0x5a5d8b];return _0x5a09b2;};'use strict';var utils=require(_0x57f6('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x57f6('0x1')]=function(_0x2e66ad,_0x4361c5){return function(_0xa8f35c){try{logger['info'](_0x57f6('0x2'),_0x2e66ad,utils['getMustacheRender'](_0x4361c5[0x0],this));_0xa8f35c[_0x57f6('0x3')]();}catch(_0x51c571){logger[_0x57f6('0x4')]('[%s][NOOP]\x20%s',_0x2e66ad,JSON['stringify'](_0x51c571));_0xa8f35c[_0x57f6('0x5')]();}};}; \ No newline at end of file +var _0x9a74=['routing','info','[%s][NOOP]\x20%s','getMustacheRender','error'];(function(_0x48c9dd,_0x3607d3){var _0x514c16=function(_0x47b28b){while(--_0x47b28b){_0x48c9dd['push'](_0x48c9dd['shift']());}};_0x514c16(++_0x3607d3);}(_0x9a74,0x168));var _0x49a7=function(_0x158898,_0x3c8809){_0x158898=_0x158898-0x0;var _0x1001b2=_0x9a74[_0x158898];return _0x1001b2;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x49a7('0x0'));exports['consequence']=function(_0x37f14e,_0x308c86){return function(_0x359d7e){try{logger[_0x49a7('0x1')](_0x49a7('0x2'),_0x37f14e,utils[_0x49a7('0x3')](_0x308c86[0x0],this));_0x359d7e['next']();}catch(_0x3d8528){logger[_0x49a7('0x4')](_0x49a7('0x2'),_0x37f14e,JSON['stringify'](_0x3d8528));_0x359d7e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 571968d..980e676 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 _0xf958=['../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/whatsappQueueReport','../../rpc/chatInteraction','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','QueueId','interaction','MessageId','message','channel','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','then','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','moment','../../../../config/environment','../../../../config/logger','routing','defaults','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','clone','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s_queue_waiting_interaction:%s','save','remove'];(function(_0x3dd727,_0xb7040e){var _0x29c096=function(_0x13b54e){while(--_0x13b54e){_0x3dd727['push'](_0x3dd727['shift']());}};_0x29c096(++_0xb7040e);}(_0xf958,0xe6));var _0x8f95=function(_0x494df4,_0x4f7977){_0x494df4=_0x494df4-0x0;var _0xc6a8a8=_0xf958[_0x494df4];return _0xc6a8a8;};'use strict';var schema=require(_0x8f95('0x0'));var _=require('lodash');var util=require(_0x8f95('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x8f95('0x2'));var Redis=require('ioredis');var config=require(_0x8f95('0x3'));var logger=require(_0x8f95('0x4'))(_0x8f95('0x5'));var strategy=require('./strategy');config['redis']=_[_0x8f95('0x6')](config[_0x8f95('0x7')],{'host':_0x8f95('0x8'),'port':0x18eb});var io=require(_0x8f95('0x9'))(new Redis(config['redis']));var attributes=['id',_0x8f95('0xa'),_0x8f95('0xb'),_0x8f95('0xc'),_0x8f95('0xd'),_0x8f95('0xe')];function emit(_0x585025,_0x378eb1,_0x604646){io['to'](_0x585025)['emit'](_0x378eb1,_0x604646);}function emitChannelQueueInteraction(_0x382f2c,_0x4e97bd,_0x184232,_0x5e2dc4,_0x4192df,_0x3e7423,_0x3ffccb,_0x506b47){var _0x464cff=_[_0x8f95('0xf')](_0x184232);_0x464cff[_0x8f95('0xa')]=_0x506b47;_0x464cff['queue']=_0x4e97bd;_0x464cff[_0x8f95('0xb')]=_0x5e2dc4;_0x464cff['id']=_0x4192df;if(_0x3e7423){attributes[_0x8f95('0x10')](_[_0x8f95('0x11')](_0x382f2c)+_0x8f95('0x12'));_0x3ffccb[util[_0x8f95('0x13')](_0x8f95('0x14'),_0x382f2c)][_0x4192df]=_[_0x8f95('0x15')](_0x464cff,attributes);}else{delete _0x3ffccb[util['format']('%sQueuesWaitingInteractions',_0x382f2c)][_0x4192df];}emit(util['format']('%s:queue:%s',_0x382f2c,_0x4e97bd),util['format'](_0x8f95('0x16'),_0x382f2c,_0x3e7423?_0x8f95('0x17'):_0x8f95('0x18')),_[_0x8f95('0x15')](_0x464cff,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x8f95('0x19')),'smsQueueReport':require(_0x8f95('0x1a')),'faxQueueReport':require('../../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x8f95('0x1b')),'chatInteraction':require(_0x8f95('0x1c')),'faxInteraction':require(_0x8f95('0x1d')),'mailInteraction':require(_0x8f95('0x1e')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x8f95('0x1f')),'whatsappInteraction':require(_0x8f95('0x20'))};var queue=schema({'name':{'type':_0x8f95('0x21'),'required':!![],'message':_0x8f95('0x22')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x314ba6,_0x24474f,_0x13e7c5,_0x1c7a29){if(_0x314ba6&&_0x24474f&&_0x13e7c5){_0x24474f[_0x8f95('0x23')]+=0x1;var _0x5d1edf={'uniqueid':_0x314ba6,'from':_0x13e7c5[_0x8f95('0x24')]?_0x13e7c5[_0x8f95('0x24')]['from']:'','joinAt':moment()[_0x8f95('0x13')](_0x8f95('0x25')),'ContactId':_0x13e7c5['contact']?_0x13e7c5[_0x8f95('0x26')]['id']:null,'ListId':_0x13e7c5[_0x8f95('0x27')]?_0x13e7c5[_0x8f95('0x27')]['id']:null};_0x5d1edf[_[_0x8f95('0x28')](_0x13e7c5['channel'])+_0x8f95('0x29')]=_0x24474f['id']||null;_0x5d1edf[_['upperFirst'](_0x13e7c5['channel'])+_0x8f95('0x12')]=_0x13e7c5['interaction']?_0x13e7c5[_0x8f95('0x2a')]['id']:null;_0x5d1edf[_['upperFirst'](_0x13e7c5['channel'])+_0x8f95('0x2b')]=_0x13e7c5['message']?_0x13e7c5[_0x8f95('0x2c')]['id']:null;_0x5d1edf[_['upperFirst'](_0x13e7c5[_0x8f95('0x2d')])+(_0x13e7c5[_0x8f95('0x2d')]!==_0x8f95('0x2e')?_0x8f95('0x2f'):_0x8f95('0x30'))]=_0x13e7c5[_0x8f95('0xb')]?_0x13e7c5[_0x8f95('0xb')]['id']:null;logger[_0x8f95('0x31')](util[_0x8f95('0x13')](_0x8f95('0x32'),_0x314ba6,_0x24474f[_0x8f95('0x33')]));emitChannelQueueInteraction(_0x13e7c5['channel'],_0x24474f[_0x8f95('0x33')],_0x5d1edf,_0x13e7c5[_0x8f95('0xb')]['name'],_0x13e7c5['message']['id'],!![],_0x1c7a29,_0x24474f['id']);if(rpc[_0x13e7c5['channel']+_0x8f95('0x34')]){return rpc[_0x13e7c5['channel']+_0x8f95('0x34')]['create'](_0x5d1edf)['catch'](function(_0x22490f){logger[_0x8f95('0x35')](_0x8f95('0x36'),_0x22490f);});}}}function stopRouting(_0xb2f392,_0x265fd1,_0x29cd1f,_0x40658a){if(_0xb2f392&&_0x265fd1){_0x265fd1[_0x8f95('0x23')]-=0x1;var _0x2f7ba3={'leaveAt':moment()[_0x8f95('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x8f95('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x8f95('0x37')};logger[_0x8f95('0x31')](util[_0x8f95('0x13')](_0x8f95('0x38'),_0xb2f392,_0x265fd1['name']));emitChannelQueueInteraction(_0x29cd1f[_0x8f95('0x2d')],_0x265fd1[_0x8f95('0x33')],_0x29cd1f[_0x8f95('0x24')],_0x29cd1f['account']['name'],_0x29cd1f[_0x8f95('0x2c')]['id'],![],_0x40658a,_0x265fd1['id']);return rpc[_0x29cd1f[_0x8f95('0x2d')]+'Interaction'][_0x8f95('0x39')](_0x29cd1f[_0x8f95('0x2a')]['id'],{'queueId':_0x265fd1['id']})[_0x8f95('0x3a')](function(){if(rpc[_0x29cd1f[_0x8f95('0x2d')]+_0x8f95('0x34')]){return rpc[_0x29cd1f[_0x8f95('0x2d')]+_0x8f95('0x34')][_0x8f95('0x39')](_0xb2f392,_0x2f7ba3)[_0x8f95('0x3b')](function(_0x363889){logger[_0x8f95('0x35')](_0x8f95('0x3c'),_0x363889);});}});}}function endRouting(_0x1bf4c3,_0x3ebcd6,_0x48efca,_0x9c12d2){if(_0x1bf4c3&&_0x3ebcd6){_0x3ebcd6[_0x8f95('0x23')]-=0x1;var _0x408c6d={'leaveAt':moment()[_0x8f95('0x13')](_0x8f95('0x25')),'exitAt':moment()[_0x8f95('0x13')](_0x8f95('0x25')),'reason':_0x8f95('0x3d')};logger[_0x8f95('0x31')](util[_0x8f95('0x13')](_0x8f95('0x3e'),_0x1bf4c3,_0x3ebcd6[_0x8f95('0x33')]));emitChannelQueueInteraction(_0x48efca[_0x8f95('0x2d')],_0x3ebcd6[_0x8f95('0x33')],_0x48efca['body'],_0x48efca[_0x8f95('0xb')][_0x8f95('0x33')],_0x48efca[_0x8f95('0x2c')]['id'],![],_0x9c12d2);if(rpc[_0x48efca[_0x8f95('0x2d')]+_0x8f95('0x34')]){return rpc[_0x48efca[_0x8f95('0x2d')]+_0x8f95('0x34')][_0x8f95('0x39')](_0x1bf4c3,_0x408c6d)['catch'](function(_0x21e82c){logger[_0x8f95('0x35')](_0x8f95('0x3c'),_0x21e82c);});}}}function handleFindQueue(_0x328a72){return function(_0xc4765f){return _0xc4765f[_0x8f95('0x33')]['toLowerCase']()===_0x328a72[_0x8f95('0x3f')]();};}exports[_0x8f95('0x40')]=function(_0x273fee,_0x2fb5d9,_0x5a3265,_0x59dc71){return function(_0x547c3f){try{var _0x16c97d={'name':_0x2fb5d9[0x0],'timeout':_0x2fb5d9[0x1]};var _0x3b0fab=queue['validate'](_0x16c97d,{'typecast':!![]});if(_0x3b0fab[_0x8f95('0x41')]){logger['error'](_0x8f95('0x42'),_0x273fee,_[_0x8f95('0x43')](_0x3b0fab,'message')[_0x8f95('0x44')](',\x20'));_0x547c3f[_0x8f95('0x45')]();}else{var _0x20dd3a=_[_0x8f95('0x46')](_0x5a3265[_0x59dc71[_0x8f95('0x2d')]+_0x8f95('0x47')],handleFindQueue(_0x16c97d[_0x8f95('0x33')]));if(_0x20dd3a){startRouting(_0x273fee,_0x20dd3a,_0x59dc71,_0x5a3265);var _0x2a342d=(_0x20dd3a[_0x8f95('0x3d')]||0xa)*0x3e8;var _0xd56389=(_0x16c97d['timeout']||0x14)*0x3e8;var _0x32a7c8;if(_0x2a342d>_0xd56389){_0xd56389=_0x2a342d;}var _0x212a91=seqqueue[_0x8f95('0x48')](_0x2a342d);_0x212a91['id']=_0x273fee;_0x212a91[_0x8f95('0x49')]=_0x2a342d;_0x212a91[_0x8f95('0x4a')]=_0xd56389;_0x212a91[_0x8f95('0x2d')]=_0x59dc71[_0x8f95('0x2d')];_0x5a3265[_0x8f95('0x4b')][_0x273fee]['on'](_0x8f95('0x4c'),function(){logger[_0x8f95('0x31')](_0x8f95('0x4d'),_0x273fee);stopRouting(_0x273fee,_0x20dd3a,_0x59dc71,_0x5a3265);clearTimeout(_0x32a7c8);_0x32a7c8=undefined;_0x212a91[_0x8f95('0x4e')](!![]);if(_0x5a3265['rules'][_0x273fee]){delete _0x5a3265[_0x8f95('0x4b')][_0x273fee];}_0x547c3f[_0x8f95('0x45')]();});_0x5a3265[_0x8f95('0x4b')][_0x273fee]['on'](_0x8f95('0x4f'),function(){if(_0x5a3265[_0x8f95('0x4b')][_0x273fee]){delete _0x5a3265[_0x8f95('0x4b')][_0x273fee];}});_0x32a7c8=setTimeout(function(){logger[_0x8f95('0x31')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x273fee);endRouting(_0x273fee,_0x20dd3a,_0x59dc71,_0x5a3265);clearTimeout(_0x32a7c8);_0x212a91[_0x8f95('0x4e')](!![]);_0x547c3f[_0x8f95('0x50')]();},_0xd56389);switch(_0x20dd3a[_0x8f95('0x51')]){case _0x8f95('0x52'):strategy[_0x8f95('0x52')](_0x212a91,_0x20dd3a,_0x5a3265,_0x59dc71);break;default:strategy['beepall'](_0x212a91,_0x20dd3a,_0x5a3265,_0x59dc71);}}else{logger[_0x8f95('0x35')](_0x8f95('0x53'),_0x273fee,_0x16c97d[_0x8f95('0x33')]);_0x547c3f[_0x8f95('0x45')]();}}}catch(_0x5b255b){logger[_0x8f95('0x35')](_0x8f95('0x42'),_0x273fee,_0x5b255b[_0x8f95('0x54')]);_0x547c3f[_0x8f95('0x45')]();}};}; \ No newline at end of file +var _0x65aa=['../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/faxInteraction','../../rpc/mailInteraction','../../rpc/openchannelInteraction','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','accepted','info','Interaction','update','then','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','length','[%s][QUEUE]\x20%s','map','join','stop','Queues','createQueue','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','util','moment','ioredis','../../../../config/environment','routing','./strategy','redis','defaults','localhost','queue','joinAt','emit','queue_id','account','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport'];(function(_0x45416a,_0x50d3ec){var _0x5c24f3=function(_0x902ad4){while(--_0x902ad4){_0x45416a['push'](_0x45416a['shift']());}};_0x5c24f3(++_0x50d3ec);}(_0x65aa,0x142));var _0xa65a=function(_0x1c0b20,_0x249b3e){_0x1c0b20=_0x1c0b20-0x0;var _0x58a367=_0x65aa[_0x1c0b20];return _0x58a367;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0xa65a('0x0'));var seqqueue=require('seq-queue');var moment=require(_0xa65a('0x1'));var Redis=require(_0xa65a('0x2'));var config=require(_0xa65a('0x3'));var logger=require('../../../../config/logger')(_0xa65a('0x4'));var strategy=require(_0xa65a('0x5'));config[_0xa65a('0x6')]=_[_0xa65a('0x7')](config[_0xa65a('0x6')],{'host':_0xa65a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa65a('0x6')]));var attributes=['id','queue_id','account',_0xa65a('0x9'),'from',_0xa65a('0xa')];function emit(_0x292452,_0x1217ce,_0x1b6b19){io['to'](_0x292452)[_0xa65a('0xb')](_0x1217ce,_0x1b6b19);}function emitChannelQueueInteraction(_0x339865,_0xf9d406,_0x443382,_0x35b7b6,_0x17c44f,_0x3a4638,_0x313c60,_0x1bc7a9){var _0x3af206=_['clone'](_0x443382);_0x3af206[_0xa65a('0xc')]=_0x1bc7a9;_0x3af206[_0xa65a('0x9')]=_0xf9d406;_0x3af206[_0xa65a('0xd')]=_0x35b7b6;_0x3af206['id']=_0x17c44f;if(_0x3a4638){attributes[_0xa65a('0xe')](_[_0xa65a('0xf')](_0x339865)+_0xa65a('0x10'));_0x313c60[util[_0xa65a('0x11')](_0xa65a('0x12'),_0x339865)][_0x17c44f]=_['pick'](_0x3af206,attributes);}else{delete _0x313c60[util[_0xa65a('0x11')](_0xa65a('0x12'),_0x339865)][_0x17c44f];}emit(util[_0xa65a('0x11')](_0xa65a('0x13'),_0x339865,_0xf9d406),util[_0xa65a('0x11')](_0xa65a('0x14'),_0x339865,_0x3a4638?_0xa65a('0x15'):_0xa65a('0x16')),_[_0xa65a('0x17')](_0x3af206,attributes));}var rpc={'openchannelQueueReport':require(_0xa65a('0x18')),'mailQueueReport':require(_0xa65a('0x19')),'chatQueueReport':require(_0xa65a('0x1a')),'smsQueueReport':require(_0xa65a('0x1b')),'faxQueueReport':require(_0xa65a('0x1c')),'whatsappQueueReport':require('../../rpc/whatsappQueueReport'),'chatInteraction':require('../../rpc/chatInteraction'),'faxInteraction':require(_0xa65a('0x1d')),'mailInteraction':require(_0xa65a('0x1e')),'openchannelInteraction':require(_0xa65a('0x1f')),'smsInteraction':require('../../rpc/smsInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var queue=schema({'name':{'type':_0xa65a('0x20'),'required':!![],'message':_0xa65a('0x21')},'timeout':{'type':_0xa65a('0x22'),'message':_0xa65a('0x23')}});function startRouting(_0x462a3e,_0x2d8583,_0x33d6b4,_0x11acc1){if(_0x462a3e&&_0x2d8583&&_0x33d6b4){_0x2d8583[_0xa65a('0x24')]+=0x1;var _0x182673={'uniqueid':_0x462a3e,'from':_0x33d6b4[_0xa65a('0x25')]?_0x33d6b4[_0xa65a('0x25')][_0xa65a('0x26')]:'','joinAt':moment()[_0xa65a('0x11')](_0xa65a('0x27')),'ContactId':_0x33d6b4[_0xa65a('0x28')]?_0x33d6b4[_0xa65a('0x28')]['id']:null,'ListId':_0x33d6b4[_0xa65a('0x29')]?_0x33d6b4['list']['id']:null};_0x182673[_['upperFirst'](_0x33d6b4[_0xa65a('0x2a')])+_0xa65a('0x2b')]=_0x2d8583['id']||null;_0x182673[_[_0xa65a('0x2c')](_0x33d6b4[_0xa65a('0x2a')])+'InteractionId']=_0x33d6b4[_0xa65a('0x2d')]?_0x33d6b4[_0xa65a('0x2d')]['id']:null;_0x182673[_[_0xa65a('0x2c')](_0x33d6b4[_0xa65a('0x2a')])+_0xa65a('0x2e')]=_0x33d6b4[_0xa65a('0x2f')]?_0x33d6b4['message']['id']:null;_0x182673[_[_0xa65a('0x2c')](_0x33d6b4['channel'])+(_0x33d6b4[_0xa65a('0x2a')]!==_0xa65a('0x30')?_0xa65a('0x31'):_0xa65a('0x32'))]=_0x33d6b4[_0xa65a('0xd')]?_0x33d6b4[_0xa65a('0xd')]['id']:null;logger['info'](util['format'](_0xa65a('0x33'),_0x462a3e,_0x2d8583[_0xa65a('0x34')]));emitChannelQueueInteraction(_0x33d6b4['channel'],_0x2d8583[_0xa65a('0x34')],_0x182673,_0x33d6b4[_0xa65a('0xd')][_0xa65a('0x34')],_0x33d6b4[_0xa65a('0x2f')]['id'],!![],_0x11acc1,_0x2d8583['id']);if(rpc[_0x33d6b4['channel']+'QueueReport']){return rpc[_0x33d6b4[_0xa65a('0x2a')]+_0xa65a('0x35')][_0xa65a('0x36')](_0x182673)['catch'](function(_0x3d4056){logger[_0xa65a('0x37')]('create\x20queue\x20report',_0x3d4056);});}}}function stopRouting(_0x210a8d,_0x2df86c,_0x207d56,_0x509c0a){if(_0x210a8d&&_0x2df86c){_0x2df86c[_0xa65a('0x24')]-=0x1;var _0x5521f6={'leaveAt':moment()[_0xa65a('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0xa65a('0x11')](_0xa65a('0x27')),'reason':_0xa65a('0x38')};logger[_0xa65a('0x39')](util[_0xa65a('0x11')]('[%s][STOP:QUEUE][NAME:%s]',_0x210a8d,_0x2df86c['name']));emitChannelQueueInteraction(_0x207d56['channel'],_0x2df86c[_0xa65a('0x34')],_0x207d56[_0xa65a('0x25')],_0x207d56[_0xa65a('0xd')][_0xa65a('0x34')],_0x207d56['message']['id'],![],_0x509c0a,_0x2df86c['id']);return rpc[_0x207d56[_0xa65a('0x2a')]+_0xa65a('0x3a')][_0xa65a('0x3b')](_0x207d56[_0xa65a('0x2d')]['id'],{'queueId':_0x2df86c['id']})[_0xa65a('0x3c')](function(){if(rpc[_0x207d56[_0xa65a('0x2a')]+'QueueReport']){return rpc[_0x207d56['channel']+'QueueReport'][_0xa65a('0x3b')](_0x210a8d,_0x5521f6)[_0xa65a('0x3d')](function(_0x5bdffe){logger[_0xa65a('0x37')](_0xa65a('0x3e'),_0x5bdffe);});}});}}function endRouting(_0x58314d,_0x49c234,_0x55daac,_0x9f7174){if(_0x58314d&&_0x49c234){_0x49c234[_0xa65a('0x24')]-=0x1;var _0x5ede66={'leaveAt':moment()['format'](_0xa65a('0x27')),'exitAt':moment()[_0xa65a('0x11')](_0xa65a('0x27')),'reason':_0xa65a('0x3f')};logger[_0xa65a('0x39')](util[_0xa65a('0x11')](_0xa65a('0x40'),_0x58314d,_0x49c234[_0xa65a('0x34')]));emitChannelQueueInteraction(_0x55daac['channel'],_0x49c234[_0xa65a('0x34')],_0x55daac['body'],_0x55daac[_0xa65a('0xd')][_0xa65a('0x34')],_0x55daac[_0xa65a('0x2f')]['id'],![],_0x9f7174);if(rpc[_0x55daac[_0xa65a('0x2a')]+_0xa65a('0x35')]){return rpc[_0x55daac[_0xa65a('0x2a')]+_0xa65a('0x35')][_0xa65a('0x3b')](_0x58314d,_0x5ede66)[_0xa65a('0x3d')](function(_0x4c2b92){logger[_0xa65a('0x37')]('update\x20queue\x20report',_0x4c2b92);});}}}function handleFindQueue(_0x5e08cd){return function(_0x56cc77){return _0x56cc77['name'][_0xa65a('0x41')]()===_0x5e08cd[_0xa65a('0x41')]();};}exports[_0xa65a('0x42')]=function(_0x4bcf66,_0x29a9c7,_0x2ff6e8,_0x28fe07){return function(_0xc0fa30){try{var _0x22a72e={'name':_0x29a9c7[0x0],'timeout':_0x29a9c7[0x1]};var _0x108d99=queue[_0xa65a('0x43')](_0x22a72e,{'typecast':!![]});if(_0x108d99[_0xa65a('0x44')]){logger[_0xa65a('0x37')](_0xa65a('0x45'),_0x4bcf66,_[_0xa65a('0x46')](_0x108d99,_0xa65a('0x2f'))[_0xa65a('0x47')](',\x20'));_0xc0fa30[_0xa65a('0x48')]();}else{var _0x337efa=_['find'](_0x2ff6e8[_0x28fe07['channel']+_0xa65a('0x49')],handleFindQueue(_0x22a72e['name']));if(_0x337efa){startRouting(_0x4bcf66,_0x337efa,_0x28fe07,_0x2ff6e8);var _0xd5618e=(_0x337efa['timeout']||0xa)*0x3e8;var _0x3f7222=(_0x22a72e['timeout']||0x14)*0x3e8;var _0x3ef89d;if(_0xd5618e>_0x3f7222){_0x3f7222=_0xd5618e;}var _0x5b2357=seqqueue[_0xa65a('0x4a')](_0xd5618e);_0x5b2357['id']=_0x4bcf66;_0x5b2357['atimeout']=_0xd5618e;_0x5b2357['qtimeout']=_0x3f7222;_0x5b2357[_0xa65a('0x2a')]=_0x28fe07['channel'];_0x2ff6e8[_0xa65a('0x4b')][_0x4bcf66]['on'](_0xa65a('0x4c'),function(){logger[_0xa65a('0x39')](_0xa65a('0x4d'),_0x4bcf66);stopRouting(_0x4bcf66,_0x337efa,_0x28fe07,_0x2ff6e8);clearTimeout(_0x3ef89d);_0x3ef89d=undefined;_0x5b2357[_0xa65a('0x4e')](!![]);if(_0x2ff6e8[_0xa65a('0x4b')][_0x4bcf66]){delete _0x2ff6e8[_0xa65a('0x4b')][_0x4bcf66];}_0xc0fa30[_0xa65a('0x48')]();});_0x2ff6e8[_0xa65a('0x4b')][_0x4bcf66]['on'](_0xa65a('0x4f'),function(){if(_0x2ff6e8[_0xa65a('0x4b')][_0x4bcf66]){delete _0x2ff6e8[_0xa65a('0x4b')][_0x4bcf66];}});_0x3ef89d=setTimeout(function(){logger[_0xa65a('0x39')](_0xa65a('0x50'),_0x4bcf66);endRouting(_0x4bcf66,_0x337efa,_0x28fe07,_0x2ff6e8);clearTimeout(_0x3ef89d);_0x5b2357['close'](!![]);_0xc0fa30[_0xa65a('0x51')]();},_0x3f7222);switch(_0x337efa[_0xa65a('0x52')]){case _0xa65a('0x53'):strategy[_0xa65a('0x53')](_0x5b2357,_0x337efa,_0x2ff6e8,_0x28fe07);break;default:strategy[_0xa65a('0x54')](_0x5b2357,_0x337efa,_0x2ff6e8,_0x28fe07);}}else{logger[_0xa65a('0x37')](_0xa65a('0x55'),_0x4bcf66,_0x22a72e['name']);_0xc0fa30[_0xa65a('0x48')]();}}}catch(_0x4e69dc){logger[_0xa65a('0x37')](_0xa65a('0x45'),_0x4bcf66,_0x4e69dc[_0xa65a('0x56')]);_0xc0fa30['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 f801010..923dcf2 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 _0x5c12=['squeue','realtime','bind','handleTimeout','timeout','drained','handleDrained','push','handleRun','debug','[%s][AGENT]\x20try\x20with\x20%s','agent','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','agents','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','prototype','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','writeLog','STOP','TIMEOUT','exports','uuid','./util','routing','notificationId'];(function(_0x51667b,_0x4409ec){var _0x3ec7ff=function(_0x265e31){while(--_0x265e31){_0x51667b['push'](_0x51667b['shift']());}};_0x3ec7ff(++_0x4409ec);}(_0x5c12,0x188));var _0x25c1=function(_0x39609a,_0x28a563){_0x39609a=_0x39609a-0x0;var _0xecd92=_0x5c12[_0x39609a];return _0xecd92;};'use strict';var _=require('lodash');var uuid=require(_0x25c1('0x0'));var util=require(_0x25c1('0x1'));var logger=require('../../../../../config/logger')(_0x25c1('0x2'));var Agent=function(_0x1991e5,_0x4042fe,_0x10f10c,_0x2c5df0){this[_0x25c1('0x3')]=uuid['v4']();this[_0x25c1('0x4')]=_0x1991e5;this['agent']=_0x4042fe;this[_0x25c1('0x5')]=_0x10f10c;this[_0x25c1('0x2')]=_0x2c5df0;this[_0x25c1('0x4')]['push'](this['handleRun'][_0x25c1('0x6')](this),this[_0x25c1('0x7')][_0x25c1('0x6')](this));this[_0x25c1('0x4')]['on'](_0x25c1('0x8'),this['handleTimeout'][_0x25c1('0x6')](this));this[_0x25c1('0x4')]['on'](_0x25c1('0x9'),this[_0x25c1('0xa')][_0x25c1('0x6')](this));};Agent['prototype'][_0x25c1('0xb')]=function(){this[_0x25c1('0x4')]['push'](this[_0x25c1('0xc')][_0x25c1('0x6')](this),this[_0x25c1('0x7')][_0x25c1('0x6')](this));};Agent['prototype']['handleDrained']=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x25c1('0xc')]=function(){logger[_0x25c1('0xd')](_0x25c1('0xe'),this[_0x25c1('0x4')]['id'],this[_0x25c1('0xf')]['id']);if(_['isNil'](this[_0x25c1('0x5')]['agents'][this['agent']['id']])){logger['debug'](_0x25c1('0x10'),this[_0x25c1('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x25c1('0x6')](this),0x3e8);}else{if(this['routing'][_0x25c1('0x11')]||util[_0x25c1('0x12')](this['squeue']['id'],this['realtime']['agents'][this[_0x25c1('0xf')]['id']],this[_0x25c1('0x4')][_0x25c1('0x13')],![])){this[_0x25c1('0x5')]['agents'][this[_0x25c1('0xf')]['id']][_0x25c1('0x14')]=!![];this[_0x25c1('0x5')][_0x25c1('0x15')][this['agent']['id']]['busyQueue']=undefined;util[_0x25c1('0x16')](this[_0x25c1('0x5')],this[_0x25c1('0x2')],this[_0x25c1('0xf')],this[_0x25c1('0x4')][_0x25c1('0x13')]);util[_0x25c1('0x17')](this[_0x25c1('0x3')],this[_0x25c1('0x4')]['id'],this[_0x25c1('0x5')][_0x25c1('0x15')][this[_0x25c1('0xf')]['id']],null,this[_0x25c1('0x2')]);util['writeLog'](this[_0x25c1('0x4')]['id'],this[_0x25c1('0x5')][_0x25c1('0x15')][this[_0x25c1('0xf')]['id']],_0x25c1('0x18')+(this[_0x25c1('0x2')]['forcedOwnership']?_0x25c1('0x19'):''));}else{logger[_0x25c1('0xd')](_0x25c1('0x1a'),this[_0x25c1('0x4')]['id'],this[_0x25c1('0xf')]['id']);setTimeout(this[_0x25c1('0xb')]['bind'](this),0x3e8);}}};Agent[_0x25c1('0x1b')]['handleTimeout']=function(_0x76b360){if(_[_0x25c1('0x1c')](this[_0x25c1('0x5')][_0x25c1('0x15')][this[_0x25c1('0xf')]['id']])){return logger[_0x25c1('0xd')](_0x25c1('0x10'),this[_0x25c1('0x4')]['id'],this[_0x25c1('0xf')]['id']);}else{logger['debug'](_0x25c1('0x1d'),this['squeue']['id'],this['agent']['id']);util[_0x25c1('0x1e')](this[_0x25c1('0x3')],this['squeue']['id'],this[_0x25c1('0x5')]['agents'][this[_0x25c1('0xf')]['id']],null,this['routing']);this[_0x25c1('0x5')][_0x25c1('0x15')][this[_0x25c1('0xf')]['id']][_0x25c1('0x14')]=![];this[_0x25c1('0x5')][_0x25c1('0x15')][this[_0x25c1('0xf')]['id']][_0x25c1('0x1f')]=undefined;util['removeWaitingNotification'](this[_0x25c1('0x5')],this['routing'],this[_0x25c1('0xf')],this['squeue'][_0x25c1('0x13')]);util[_0x25c1('0x20')](this[_0x25c1('0x4')]['id'],this[_0x25c1('0x5')][_0x25c1('0x15')][this[_0x25c1('0xf')]['id']],_0x76b360?_0x25c1('0x21'):_0x25c1('0x22'));}if(!_0x76b360){setTimeout(this[_0x25c1('0xb')][_0x25c1('0x6')](this),0x3e8);}};function agent(_0x26ed98,_0x3f02f2,_0x1041a3,_0x1b6e92){return new Agent(_0x26ed98,_0x3f02f2,_0x1041a3,_0x1b6e92);}module[_0x25c1('0x23')]=agent; \ No newline at end of file +var _0xb821=['squeue','agent','routing','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','realtime','channel','agents','busy','busyQueue','saveWaitingNotification','showNotification','forcedOwnership',':FORCED','debug','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','writeLog','STOP','TIMEOUT','exports','uuid','./util','notificationId'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xb821,0xa7));var _0x1b82=function(_0x358f81,_0x445e75){_0x358f81=_0x358f81-0x0;var _0x206e91=_0xb821[_0x358f81];return _0x206e91;};'use strict';var _=require('lodash');var uuid=require(_0x1b82('0x0'));var util=require(_0x1b82('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0xbab478,_0x578a10,_0x4b1809,_0x3b1d14){this[_0x1b82('0x2')]=uuid['v4']();this[_0x1b82('0x3')]=_0xbab478;this[_0x1b82('0x4')]=_0x578a10;this['realtime']=_0x4b1809;this[_0x1b82('0x5')]=_0x3b1d14;this[_0x1b82('0x3')][_0x1b82('0x6')](this[_0x1b82('0x7')][_0x1b82('0x8')](this),this[_0x1b82('0x9')][_0x1b82('0x8')](this));this[_0x1b82('0x3')]['on'](_0x1b82('0xa'),this['handleTimeout'][_0x1b82('0x8')](this));this[_0x1b82('0x3')]['on'](_0x1b82('0xb'),this[_0x1b82('0xc')][_0x1b82('0x8')](this));};Agent[_0x1b82('0xd')][_0x1b82('0x6')]=function(){this[_0x1b82('0x3')]['push'](this[_0x1b82('0x7')][_0x1b82('0x8')](this),this[_0x1b82('0x9')][_0x1b82('0x8')](this));};Agent['prototype'][_0x1b82('0xc')]=function(){this['handleTimeout'](!![]);};Agent['prototype'][_0x1b82('0x7')]=function(){logger['debug'](_0x1b82('0xe'),this[_0x1b82('0x3')]['id'],this['agent']['id']);if(_[_0x1b82('0xf')](this['realtime']['agents'][this[_0x1b82('0x4')]['id']])){logger['debug'](_0x1b82('0x10'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);setTimeout(this['push']['bind'](this),0x3e8);}else{if(this[_0x1b82('0x5')]['forcedOwnership']||util[_0x1b82('0x11')](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')]['agents'][this[_0x1b82('0x4')]['id']],this[_0x1b82('0x3')][_0x1b82('0x13')],![])){this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']][_0x1b82('0x15')]=!![];this[_0x1b82('0x12')][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']][_0x1b82('0x16')]=undefined;util[_0x1b82('0x17')](this[_0x1b82('0x12')],this['routing'],this[_0x1b82('0x4')],this[_0x1b82('0x3')]['channel']);util[_0x1b82('0x18')](this[_0x1b82('0x2')],this[_0x1b82('0x3')]['id'],this['realtime'][_0x1b82('0x14')][this['agent']['id']],null,this['routing']);util['writeLog'](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']],'RINGING'+(this[_0x1b82('0x5')][_0x1b82('0x19')]?_0x1b82('0x1a'):''));}else{logger[_0x1b82('0x1b')](_0x1b82('0x1c'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);setTimeout(this[_0x1b82('0x6')][_0x1b82('0x8')](this),0x3e8);}}};Agent[_0x1b82('0xd')][_0x1b82('0x9')]=function(_0x37275f){if(_[_0x1b82('0xf')](this['realtime'][_0x1b82('0x14')][this[_0x1b82('0x4')]['id']])){return logger[_0x1b82('0x1b')](_0x1b82('0x10'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);}else{logger[_0x1b82('0x1b')](_0x1b82('0x1d'),this[_0x1b82('0x3')]['id'],this[_0x1b82('0x4')]['id']);util['hideNotification'](this[_0x1b82('0x2')],this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']],null,this[_0x1b82('0x5')]);this[_0x1b82('0x12')]['agents'][this[_0x1b82('0x4')]['id']][_0x1b82('0x15')]=![];this[_0x1b82('0x12')]['agents'][this['agent']['id']][_0x1b82('0x16')]=undefined;util['removeWaitingNotification'](this['realtime'],this[_0x1b82('0x5')],this[_0x1b82('0x4')],this[_0x1b82('0x3')]['channel']);util[_0x1b82('0x1e')](this[_0x1b82('0x3')]['id'],this[_0x1b82('0x12')][_0x1b82('0x14')][this['agent']['id']],_0x37275f?_0x1b82('0x1f'):_0x1b82('0x20'));}if(!_0x37275f){setTimeout(this[_0x1b82('0x6')]['bind'](this),0x3e8);}};function agent(_0x48fd54,_0x21e859,_0x5d7e6a,_0x1d3e68){return new Agent(_0x48fd54,_0x21e859,_0x5d7e6a,_0x1d3e68);}module[_0x1b82('0x21')]=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 1578310..b58d71a 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 _0x6b15=['timeout','handleTimeout','drained','handleDrained','prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','RINGING','busy','busyQueue','name','saveWaitingNotification','showNotification','debug','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','TIMEOUT','removeWaitingNotification','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind'];(function(_0x3e29c2,_0x4efe15){var _0x3a3a5a=function(_0x3624b3){while(--_0x3624b3){_0x3e29c2['push'](_0x3e29c2['shift']());}};_0x3a3a5a(++_0x4efe15);}(_0x6b15,0x1b0));var _0x56b1=function(_0x120d25,_0x23f035){_0x120d25=_0x120d25-0x0;var _0x2ddaae=_0x6b15[_0x120d25];return _0x2ddaae;};'use strict';var _=require(_0x56b1('0x0'));var uuid=require(_0x56b1('0x1'));var util=require(_0x56b1('0x2'));var logger=require(_0x56b1('0x3'))(_0x56b1('0x4'));var Beepall=function(_0x1e3933,_0x22f61d,_0x3deaa2,_0x34df21){this[_0x56b1('0x5')]=uuid['v4']();this[_0x56b1('0x6')]=_0x1e3933;this[_0x56b1('0x7')]=_0x22f61d;this[_0x56b1('0x8')]=_0x3deaa2;this[_0x56b1('0x4')]=_0x34df21;this['squeue'][_0x56b1('0x9')](this[_0x56b1('0xa')][_0x56b1('0xb')](this),this['handleTimeout'][_0x56b1('0xb')](this));this[_0x56b1('0x6')]['on'](_0x56b1('0xc'),this[_0x56b1('0xd')][_0x56b1('0xb')](this));this[_0x56b1('0x6')]['on'](_0x56b1('0xe'),this[_0x56b1('0xf')][_0x56b1('0xb')](this));};Beepall[_0x56b1('0x10')]['push']=function(){this[_0x56b1('0x6')]['push'](this[_0x56b1('0xa')]['bind'](this),this['handleTimeout'][_0x56b1('0xb')](this));};Beepall[_0x56b1('0x10')]['handleDrained']=function(){this[_0x56b1('0xd')](!![]);};Beepall['prototype'][_0x56b1('0xa')]=function(){var _0x23a9fa=!![];if(!_[_0x56b1('0x11')](this[_0x56b1('0x7')])&&!_['isNil'](this['queue'][_0x56b1('0x12')])&&this[_0x56b1('0x7')][_0x56b1('0x12')][_0x56b1('0x13')]>0x0){for(var _0x95f815=0x0,_0xcefc41;_0x95f8150x0){for(var _0x31af16=0x0,_0x3f7fba;_0x31af160x0&&_0x3744d2[_0x5c96ad+_0x6093('0x25')]>=_0x3744d2[_0x5c96ad+'Capacity']){writeLog(_0xf9f921,_0x3744d2,_0x5c96ad['toUpperCase']()+_0x6093('0x26'));return![];}}return!![];};exports[_0x6093('0x27')]=function(_0x543aed,_0x45d32a,_0x5703e6,_0x15f926,_0x68ba4){return sendNotification(!![],_0x543aed,_0x45d32a,_0x5703e6,_0x15f926,_0x68ba4);};exports[_0x6093('0x28')]=function(_0x158f62,_0x2dc826,_0x1a4db9,_0x412409,_0x36cc99){return sendNotification(![],_0x158f62,_0x2dc826,_0x1a4db9,_0x412409,_0x36cc99);};exports[_0x6093('0x29')]=function(_0x48a2b2,_0x415054,_0x605f57){var _0x4e582e=_0x415054[_0x6093('0x2a')][_0x6093('0x2b')];if(!_0x4e582e&&_0x605f57){_0x4e582e=_0x605f57['id'];}var _0x472c8a=_[_0x6093('0x2c')](_0x48a2b2[_0x415054[_0x6093('0x2d')]+_0x6093('0x2e')],function(_0x44b238){var _0x1a8939=_['capitalize'](_0x415054[_0x6093('0x2d')])+_0x6093('0x2f');return _0x44b238[_0x1a8939]===_0x415054[_0x6093('0x2a')]['id'];});if(!_0x472c8a&&_0x4e582e&&_0x48a2b2[_0x6093('0x30')][_0x4e582e]){_0x472c8a=_[_0x6093('0x2c')](_0x48a2b2['agents'][_0x4e582e][_0x415054[_0x6093('0x2d')]+_0x6093('0x31')],function(_0x2959a1){return _0x2959a1['id']===_0x415054['interaction']['id'];});}return _0x472c8a;};exports[_0x6093('0x32')]=function(_0x4a7b79,_0x4eb25f,_0x115f56,_0x2f6a35){if(_0x115f56&&_0x115f56['id']&&_0x4a7b79[_0x6093('0x30')]&&_0x4a7b79[_0x6093('0x30')][_0x115f56['id']]){_0x4a7b79[_0x6093('0x30')][_0x115f56['id']][_0x2f6a35+'WaitingInteractions'][_0x4eb25f['message']['id']]={'id':_0x4eb25f[_0x6093('0x2a')]['id']};}};exports[_0x6093('0x33')]=function(_0x1b6ae0,_0xc9ba11,_0xa5a8ba,_0x46df80){if(_0xa5a8ba&&_0xa5a8ba['id']&&_0x1b6ae0[_0x6093('0x30')]&&_0x1b6ae0['agents'][_0xa5a8ba['id']]){delete _0x1b6ae0[_0x6093('0x30')][_0xa5a8ba['id']][_0x46df80+_0x6093('0x31')][_0xc9ba11[_0x6093('0x18')]['id']];}};exports[_0x6093('0x34')]=writeLog; \ No newline at end of file +var _0x3af5=['util','ioredis','../../../../../config/environment','redis','localhost','socket.io-emitter','\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','[%s][QUEUE]\x20%s','user:%s','name','emit','notification:%s','save','debug','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','interaction','UserId','QueuesWaitingInteractions','capitalize','channel','InteractionId','agents','some','WaitingInteractions','saveWaitingNotification','message','removeWaitingNotification','writeLog','lodash'];(function(_0x188af6,_0x3a85bb){var _0x2da464=function(_0x5b1db7){while(--_0x5b1db7){_0x188af6['push'](_0x188af6['shift']());}};_0x2da464(++_0x3a85bb);}(_0x3af5,0x1d3));var _0x53af=function(_0x41930d,_0x478ed3){_0x41930d=_0x41930d-0x0;var _0x455ade=_0x3af5[_0x41930d];return _0x455ade;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var utils=require('../utils');var Redis=require(_0x53af('0x2'));var config=require(_0x53af('0x3'));var logger=require('../../../../../config/logger')('routing');config[_0x53af('0x4')]=_['defaults'](config['redis'],{'host':_0x53af('0x5'),'port':0x18eb});var io=require(_0x53af('0x6'))(new Redis(config['redis']));function sendNotification(_0xba7147,_0x4eb461,_0x3aefaf,_0x27eed3,_0x2875ab,_0x22c0cb){var _0x43f1b4=_0x22c0cb||{};var _0x19215a=_0x3aefaf['split']('.');var _0x52b4d1={'uniqueid':_0x4eb461,'channel':_0x19215a[0x0],'id':_0x19215a[0x1],'title':_0x19215a[0x0]+_0x53af('0x7'),'interactionId':_0x19215a[0x2],'queue':_0x2875ab?_0x2875ab['name']:null,'sound':_0x43f1b4[_0x53af('0x8')][_0x53af('0x9')],'shake':_0x43f1b4['account'][_0x53af('0xa')]};try{if(!_0x43f1b4[_0x53af('0xb')]){_0x43f1b4['body']={};}if(_0x2875ab){_0x43f1b4[_0x53af('0xb')][_0x53af('0xc')]=_0x2875ab;}else if(_0x43f1b4[_0x53af('0xb')]['queue']){delete _0x43f1b4[_0x53af('0xb')]['queue'];}_0x52b4d1[_0x53af('0xd')]=utils[_0x53af('0xe')](_0x43f1b4[_0x53af('0x8')][_0x53af('0xf')],_0x43f1b4);}catch(_0x1dea0a){_0x52b4d1[_0x53af('0xd')]=_0x53af('0x10');logger[_0x53af('0x11')](util[_0x53af('0x12')](_0x53af('0x13'),_0x4eb461,_0x1dea0a['message']));}io['to'](util[_0x53af('0x12')](_0x53af('0x14'),_0x27eed3[_0x53af('0x15')]))[_0x53af('0x16')](util[_0x53af('0x12')](_0x53af('0x17'),_0xba7147?_0x53af('0x18'):'remove'),_0x52b4d1);}function writeLog(_0x207f25,_0x168376,_0xae3142){return logger[_0x53af('0x19')](util['format']('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x207f25,_0x168376[_0x53af('0x15')],_0xae3142));}exports[_0x53af('0x1a')]=function(_0x37ecb3,_0x5a31d6,_0x28e1fb,_0x16473a){if(_0x5a31d6[_0x53af('0x1b')]){writeLog(_0x37ecb3,_0x5a31d6,_0x53af('0x1c'));return![];}if(!_0x5a31d6[_0x53af('0x1d')]){writeLog(_0x37ecb3,_0x5a31d6,_0x53af('0x1e'));return![];}if(_0x5a31d6[_0x28e1fb+_0x53af('0x1f')]){writeLog(_0x37ecb3,_0x5a31d6,_0x53af('0x20'));return![];}if(_0x16473a&&_0x5a31d6['hasOwnProperty'](_0x28e1fb+_0x53af('0x21'))&&_0x5a31d6[_0x53af('0x22')](_0x28e1fb+_0x53af('0x23'))){if(_0x5a31d6[_0x28e1fb+_0x53af('0x21')]>0x0&&_0x5a31d6[_0x28e1fb+_0x53af('0x23')]>=_0x5a31d6[_0x28e1fb+_0x53af('0x21')]){writeLog(_0x37ecb3,_0x5a31d6,_0x28e1fb['toUpperCase']()+_0x53af('0x24'));return![];}}return!![];};exports[_0x53af('0x25')]=function(_0x26a0cf,_0x2b232c,_0x480665,_0x27dbd9,_0x17d47d){return sendNotification(!![],_0x26a0cf,_0x2b232c,_0x480665,_0x27dbd9,_0x17d47d);};exports[_0x53af('0x26')]=function(_0x530e3c,_0x1db2fc,_0x152dcc,_0x474d5f,_0x20449f){return sendNotification(![],_0x530e3c,_0x1db2fc,_0x152dcc,_0x474d5f,_0x20449f);};exports['checkWaitingNotifications']=function(_0x808023,_0x1ec47c,_0xc9b0df){var _0x2c27ba=_0x1ec47c[_0x53af('0x27')][_0x53af('0x28')];if(!_0x2c27ba&&_0xc9b0df){_0x2c27ba=_0xc9b0df['id'];}var _0x154cc2=_['some'](_0x808023[_0x1ec47c['channel']+_0x53af('0x29')],function(_0x490f70){var _0x308819=_[_0x53af('0x2a')](_0x1ec47c[_0x53af('0x2b')])+_0x53af('0x2c');return _0x490f70[_0x308819]===_0x1ec47c['interaction']['id'];});if(!_0x154cc2&&_0x2c27ba&&_0x808023[_0x53af('0x2d')][_0x2c27ba]){_0x154cc2=_[_0x53af('0x2e')](_0x808023['agents'][_0x2c27ba][_0x1ec47c['channel']+_0x53af('0x2f')],function(_0x1fa69c){return _0x1fa69c['id']===_0x1ec47c[_0x53af('0x27')]['id'];});}return _0x154cc2;};exports[_0x53af('0x30')]=function(_0x505003,_0x4ff785,_0x3b7ad0,_0x30e609){if(_0x3b7ad0&&_0x3b7ad0['id']&&_0x505003[_0x53af('0x2d')]&&_0x505003['agents'][_0x3b7ad0['id']]){_0x505003['agents'][_0x3b7ad0['id']][_0x30e609+_0x53af('0x2f')][_0x4ff785[_0x53af('0x31')]['id']]={'id':_0x4ff785[_0x53af('0x27')]['id']};}};exports[_0x53af('0x32')]=function(_0x44e1c4,_0x98e868,_0x34fcb4,_0x4d7741){if(_0x34fcb4&&_0x34fcb4['id']&&_0x44e1c4[_0x53af('0x2d')]&&_0x44e1c4[_0x53af('0x2d')][_0x34fcb4['id']]){delete _0x44e1c4['agents'][_0x34fcb4['id']][_0x4d7741+_0x53af('0x2f')][_0x98e868[_0x53af('0x31')]['id']];}};exports[_0x53af('0x33')]=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 f6d5942..931af62 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 _0x6198=['consequence','length','error','[%s][SYSTEM]\x20%s','message','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','isEmpty','[%s][SYSTEM]\x20no\x20variable','isObject','validate','shelljs','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x5dcc89,_0x25bc24){var _0x35fa12=function(_0x2e184e){while(--_0x2e184e){_0x5dcc89['push'](_0x5dcc89['shift']());}};_0x35fa12(++_0x25bc24);}(_0x6198,0xf3));var _0x8619=function(_0x53aee6,_0x5d0e22){_0x53aee6=_0x53aee6-0x0;var _0x72006e=_0x6198[_0x53aee6];return _0x72006e;};'use strict';var schema=require(_0x8619('0x0'));var sh=require(_0x8619('0x1'));var _=require('lodash');var utils=require(_0x8619('0x2'));var logger=require(_0x8619('0x3'))(_0x8619('0x4'));var system=schema({'command':{'type':_0x8619('0x5'),'required':!![],'message':_0x8619('0x6')}});exports[_0x8619('0x7')]=function(_0x4c8e8a,_0x24c6c4){return function(_0x4d94af){try{var _0x339ae8={'command':_0x24c6c4[0x0]};var _0x424f11=system[_0x8619('0x0')](_0x339ae8,{'typecast':!![]});if(_0x424f11[_0x8619('0x8')]){logger[_0x8619('0x9')](_0x8619('0xa'),_0x4c8e8a,_['map'](_0x424f11,_0x8619('0xb'))[_0x8619('0xc')](',\x20'));logger[_0x8619('0xd')](_0x8619('0xe'),_0x4c8e8a);_0x4d94af[_0x8619('0xf')]();}else{var _0x536dc9=this;var _0x38476b=utils[_0x8619('0x10')](_0x24c6c4[0x0],this);logger[_0x8619('0xd')](_0x8619('0x11'),_0x4c8e8a,_0x38476b);sh['exec'](_[_0x8619('0x12')](_0x38476b),function(_0x42698c,_0x5cb5f3){logger['info'](_0x8619('0x13'),_0x4c8e8a,_0x42698c);if(_0x42698c==0x0){var _0x2d2167=_0x5cb5f3[_0x8619('0x14')](/(\r\n|\n|\r)/gm,'');if(_[_0x8619('0x15')](_0x24c6c4[0x1])||_[_0x8619('0x16')](_0x24c6c4[0x1])){logger[_0x8619('0xd')](_0x8619('0x17'),_0x4c8e8a);_0x536dc9['body'][_0x24c6c4[0x1]]=_0x2d2167;}else{logger[_0x8619('0xd')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x4c8e8a,_0x24c6c4[0x1],_0x2d2167);_0x536dc9['body'][_0x24c6c4[0x1]]=_0x2d2167;}}_0x4d94af[_0x8619('0xf')]();});}}catch(_0x51d1b3){logger['error'](_0x8619('0xa'),_0x4c8e8a,_[_0x8619('0x18')](_0x51d1b3)?JSON['stringify'](_0x51d1b3):_0x51d1b3);logger[_0x8619('0xd')](_0x8619('0xe'),_0x4c8e8a);_0x4d94af[_0x8619('0xf')]();}};}; \ No newline at end of file +var _0x8666=['validate','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','./utils','../../../../config/logger','routing','string','consequence'];(function(_0x407107,_0x791532){var _0xdcbde=function(_0x30b5d7){while(--_0x30b5d7){_0x407107['push'](_0x407107['shift']());}};_0xdcbde(++_0x791532);}(_0x8666,0x174));var _0x6866=function(_0x22d9a2,_0x4ebdf1){_0x22d9a2=_0x22d9a2-0x0;var _0x25877e=_0x8666[_0x22d9a2];return _0x25877e;};'use strict';var schema=require('validate');var sh=require(_0x6866('0x0'));var _=require('lodash');var utils=require(_0x6866('0x1'));var logger=require(_0x6866('0x2'))(_0x6866('0x3'));var system=schema({'command':{'type':_0x6866('0x4'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x6866('0x5')]=function(_0x1b4fe9,_0x466fe2){return function(_0x400e38){try{var _0x39dfb2={'command':_0x466fe2[0x0]};var _0x43f7af=system[_0x6866('0x6')](_0x39dfb2,{'typecast':!![]});if(_0x43f7af[_0x6866('0x7')]){logger[_0x6866('0x8')](_0x6866('0x9'),_0x1b4fe9,_['map'](_0x43f7af,_0x6866('0xa'))[_0x6866('0xb')](',\x20'));logger[_0x6866('0xc')](_0x6866('0xd'),_0x1b4fe9);_0x400e38[_0x6866('0xe')]();}else{var _0x3c5536=this;var _0x16b6e5=utils[_0x6866('0xf')](_0x466fe2[0x0],this);logger[_0x6866('0xc')](_0x6866('0x10'),_0x1b4fe9,_0x16b6e5);sh[_0x6866('0x11')](_['trim'](_0x16b6e5),function(_0xbea7ee,_0x4632f3){logger[_0x6866('0xc')](_0x6866('0x12'),_0x1b4fe9,_0xbea7ee);if(_0xbea7ee==0x0){var _0x312ee1=_0x4632f3[_0x6866('0x13')](/(\r\n|\n|\r)/gm,'');if(_[_0x6866('0x14')](_0x466fe2[0x1])||_[_0x6866('0x15')](_0x466fe2[0x1])){logger[_0x6866('0xc')](_0x6866('0x16'),_0x1b4fe9);_0x3c5536[_0x6866('0x17')][_0x466fe2[0x1]]=_0x312ee1;}else{logger[_0x6866('0xc')](_0x6866('0x18'),_0x1b4fe9,_0x466fe2[0x1],_0x312ee1);_0x3c5536['body'][_0x466fe2[0x1]]=_0x312ee1;}}_0x400e38['next']();});}}catch(_0x2769b4){logger[_0x6866('0x8')](_0x6866('0x9'),_0x1b4fe9,_[_0x6866('0x19')](_0x2769b4)?JSON[_0x6866('0x1a')](_0x2769b4):_0x2769b4);logger[_0x6866('0xc')](_0x6866('0xd'),_0x1b4fe9);_0x400e38['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index b5fd79f..b8af579 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 _0x86dd=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','info','../../rpc/chatInteraction'];(function(_0xbeb597,_0x335ac4){var _0x25f3f7=function(_0x564a58){while(--_0x564a58){_0xbeb597['push'](_0xbeb597['shift']());}};_0x25f3f7(++_0x335ac4);}(_0x86dd,0xd7));var _0xd86d=function(_0x45a9d1,_0x152aa1){_0x45a9d1=_0x45a9d1-0x0;var _0x53a7e0=_0x86dd[_0x45a9d1];return _0x53a7e0;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0xd86d('0x0')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xd86d('0x1')),'mailInteraction':require(_0xd86d('0x2')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xd86d('0x3'))('routing');var tag=schema({'tag':{'type':_0xd86d('0x4'),'required':!![],'message':_0xd86d('0x5')}});exports[_0xd86d('0x6')]=function(_0x3a2182,_0x391cca,_0x86d77,_0x5ce195){return function(_0x51c2dd){try{var _0x5e2011={'tag':_0x391cca[0x0]};var _0x366b81=tag[_0xd86d('0x7')](_0x5e2011,{'typecast':!![]});if(_0x366b81[_0xd86d('0x8')]){logger[_0xd86d('0x9')](_0xd86d('0xa'),_0x3a2182,_[_0xd86d('0xb')](_0x366b81,_0xd86d('0xc'))[_0xd86d('0xd')](',\x20'));logger['info'](_0xd86d('0xe'),_0x3a2182);_0x51c2dd[_0xd86d('0xf')]();}else{var _0x393127={'ids':[_0x391cca[0x0]]};if(rpc[_0x5ce195[_0xd86d('0x10')]+_0xd86d('0x11')]){rpc[_0x5ce195['channel']+_0xd86d('0x11')][_0xd86d('0x12')](_0x5ce195[_0xd86d('0x13')]['id'],_0x393127)[_0xd86d('0x14')](function(_0x1e00dc){logger['info'](_0xd86d('0x15'),_0x3a2182,_0x391cca[0x1],_0x5ce195[_0xd86d('0x10')],_0x5ce195[_0xd86d('0x13')]['id']);})[_0xd86d('0x16')](function(_0x197e00){logger[_0xd86d('0x9')](_0xd86d('0xa'),_0x3a2182,JSON[_0xd86d('0x17')](_0x197e00));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x3a2182);})[_0xd86d('0x18')](function(){_0x51c2dd[_0xd86d('0xf')]();});}}}catch(_0x13ca1a){logger[_0xd86d('0x9')](_0xd86d('0xa'),_0x3a2182,_[_0xd86d('0x19')](_0x13ca1a)?JSON[_0xd86d('0x17')](_0x13ca1a):_0x13ca1a);logger[_0xd86d('0x1a')](_0xd86d('0xe'),_0x3a2182);_0x51c2dd[_0xd86d('0xf')]();}};}; \ No newline at end of file +var _0x81d8=['../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][TAG]\x20%s','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction'];(function(_0x4adc21,_0x55f004){var _0x278123=function(_0x1a9321){while(--_0x1a9321){_0x4adc21['push'](_0x4adc21['shift']());}};_0x278123(++_0x55f004);}(_0x81d8,0xd2));var _0x881d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81d8[_0x14add3];return _0x4a174f;};'use strict';var schema=require(_0x881d('0x0'));var _=require(_0x881d('0x1'));var rpc={'chatInteraction':require(_0x881d('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x881d('0x3')),'mailInteraction':require(_0x881d('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x881d('0x5'))};var logger=require(_0x881d('0x6'))('routing');var tag=schema({'tag':{'type':_0x881d('0x7'),'required':!![],'message':_0x881d('0x8')}});exports['consequence']=function(_0x1a8ae9,_0x2b4c63,_0x2fe88,_0x5cde54){return function(_0x348360){try{var _0x159e53={'tag':_0x2b4c63[0x0]};var _0x1aab94=tag[_0x881d('0x0')](_0x159e53,{'typecast':!![]});if(_0x1aab94[_0x881d('0x9')]){logger[_0x881d('0xa')](_0x881d('0xb'),_0x1a8ae9,_['map'](_0x1aab94,'message')['join'](',\x20'));logger[_0x881d('0xc')](_0x881d('0xd'),_0x1a8ae9);_0x348360[_0x881d('0xe')]();}else{var _0x44d80c={'ids':[_0x2b4c63[0x0]]};if(rpc[_0x5cde54['channel']+'Interaction']){rpc[_0x5cde54[_0x881d('0xf')]+_0x881d('0x10')][_0x881d('0x11')](_0x5cde54[_0x881d('0x12')]['id'],_0x44d80c)['then'](function(_0xdfea22){logger['info'](_0x881d('0x13'),_0x1a8ae9,_0x2b4c63[0x1],_0x5cde54['channel'],_0x5cde54[_0x881d('0x12')]['id']);})[_0x881d('0x14')](function(_0x36a4e3){logger[_0x881d('0xa')](_0x881d('0xb'),_0x1a8ae9,JSON[_0x881d('0x15')](_0x36a4e3));logger[_0x881d('0xc')](_0x881d('0xd'),_0x1a8ae9);})[_0x881d('0x16')](function(){_0x348360[_0x881d('0xe')]();});}}}catch(_0x36a6f6){logger[_0x881d('0xa')](_0x881d('0xb'),_0x1a8ae9,_[_0x881d('0x17')](_0x36a6f6)?JSON[_0x881d('0x15')](_0x36a6f6):_0x36a6f6);logger[_0x881d('0xc')](_0x881d('0xd'),_0x1a8ae9);_0x348360['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index a635d8f..e310e1f 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 _0xfd58=['title','jsonrpc','2.0','method','login','push','params','stringify','POST','application/json-rpc','then','result','&data=','info','stop','catch','error','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params='];(function(_0xff8a43,_0x1550b5){var _0x5d3d4b=function(_0x28d1b7){while(--_0x28d1b7){_0xff8a43['push'](_0xff8a43['shift']());}};_0x5d3d4b(++_0x1550b5);}(_0xfd58,0x170));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var rp=require('request-promise');var logger=require(_0x8fd5('0x0'))(_0x8fd5('0x1'));var _=require(_0x8fd5('0x2'));var arr=[];exports[_0x8fd5('0x3')]=function(_0x5b99ff,_0x5d3086){return function(_0x2a0846){var _0x25baec=_0x5d3086[0xa];var _0x1822b3=_0x5d3086[0xb];var _0x32b514=_0x5d3086[0xc];var _0x2feff6=_0x5d3086[0xd];var _0x39053d=_0x5d3086[0xe];var _0xd17657=_0x5d3086[0xf][_0x8fd5('0x4')](/\n/g,_0x8fd5('0x5'));var _0x53ebf7=_0x5d3086[0x10][_0x8fd5('0x4')](/\n/g,'\x20');if(!arr[_0x8fd5('0x6')](_0x1822b3)){arr['push'](_0x1822b3);var _0x17e2f1=_0x5d3086[0x3];var _0x53a683=_0x5d3086[0x4];var _0x33948a=_0x5d3086[0x1];var _0x4f69ab=_0x5d3086[0x0];var _0x29686e={};_0x29686e[_0x8fd5('0x7')]=_0x5d3086[0x8]+_0x8fd5('0x8')+_0x32b514+'|'+_0x25baec+'|'+_0x2feff6+'|'+_0x1822b3+'|'+_0x39053d;_0x29686e['urlOnRing']=_0x5d3086[0x7]+_0x8fd5('0x8')+_0x32b514+'|'+_0x25baec+'|'+_0x2feff6+'|'+_0x1822b3+'|'+_0x39053d+'|'+_0xd17657+'|'+_0x53ebf7;_0x29686e[_0x8fd5('0x9')]=_0x5d3086[0x9];var _0x3d1c8b={};_0x3d1c8b[_0x8fd5('0xa')]=_0x8fd5('0xb');_0x3d1c8b[_0x8fd5('0xc')]=_0x8fd5('0xd');var _0x4ed051=[];_0x4ed051[_0x8fd5('0xe')](_0x5d3086[0x2]);_0x4ed051['push'](_0x5d3086[0x5]);_0x4ed051[_0x8fd5('0xe')](_0x5d3086[0x6]);_0x3d1c8b[_0x8fd5('0xf')]=_0x4ed051;_0x3d1c8b['id']=0x1;var _0x1917c3=JSON[_0x8fd5('0x10')](_0x3d1c8b);var _0x22d931={'encoding':'utf8','method':_0x8fd5('0x11'),'timeout':0x2710,'url':_0x17e2f1,'headers':{'Content-Type':_0x8fd5('0x12')},'body':_0x1917c3};return rp(_0x22d931)[_0x8fd5('0x13')](function(_0xc57c2){const _0x17170c=JSON['parse'](_0xc57c2);if(!_0x17170c[_0x8fd5('0x14')]['logged']){throw new Error('Unable\x20to\x20login\x20with\x20TVox\x20application');}var _0x4b8aa1=_0x1822b3;var _0x45c9db='channelId='+_0x33948a+'&serviceId='+_0x4f69ab+'&sessionId='+_0x4b8aa1+_0x8fd5('0x15')+JSON[_0x8fd5('0x10')](_0x29686e);var _0x138a56=_0x53a683+'?'+_0x45c9db;return rp(_0x138a56);})[_0x8fd5('0x13')](function(_0x3883f3){logger[_0x8fd5('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x5b99ff,_0x3883f3);_0x2a0846[_0x8fd5('0x17')]();})[_0x8fd5('0x18')](function(_0x5ac0b4){logger[_0x8fd5('0x19')]('[%s][TVOX]\x20%s',_0x5b99ff,_[_0x8fd5('0x1a')](_0x5ac0b4)?JSON[_0x8fd5('0x10')](_0x5ac0b4):_0x5ac0b4);_0x2a0846[_0x8fd5('0x17')]();});}else{logger[_0x8fd5('0x16')](_0x8fd5('0x1b'),_0x5b99ff);_0x2a0846[_0x8fd5('0x1c')]();}};}; \ No newline at end of file +var _0x6252=['?params=','title','jsonrpc','2.0','method','login','stringify','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&sessionId=','info','stop','catch','error','isObject','next','request-promise','consequence','replace','includes','push','urlOnAnswer'];(function(_0x45bc68,_0x25eae1){var _0x3f3062=function(_0x33cb26){while(--_0x33cb26){_0x45bc68['push'](_0x45bc68['shift']());}};_0x3f3062(++_0x25eae1);}(_0x6252,0x6a));var _0x2625=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x6252[_0x1da527];return _0x40fc7c;};'use strict';var rp=require(_0x2625('0x0'));var logger=require('../../../../config/logger')('routing');var _=require('lodash');var arr=[];exports[_0x2625('0x1')]=function(_0x44820d,_0x11e2ae){return function(_0xf04a37){var _0x58165e=_0x11e2ae[0xa];var _0x231515=_0x11e2ae[0xb];var _0x22712c=_0x11e2ae[0xc];var _0x523b6f=_0x11e2ae[0xd];var _0x4cf63a=_0x11e2ae[0xe];var _0x59dd1b=_0x11e2ae[0xf][_0x2625('0x2')](/\n/g,'\x20-\x20');var _0x2d6f6e=_0x11e2ae[0x10][_0x2625('0x2')](/\n/g,'\x20');if(!arr[_0x2625('0x3')](_0x231515)){arr[_0x2625('0x4')](_0x231515);var _0x48d15d=_0x11e2ae[0x3];var _0x1b270a=_0x11e2ae[0x4];var _0x437ae5=_0x11e2ae[0x1];var _0x3a491d=_0x11e2ae[0x0];var _0x26f21a={};_0x26f21a[_0x2625('0x5')]=_0x11e2ae[0x8]+_0x2625('0x6')+_0x22712c+'|'+_0x58165e+'|'+_0x523b6f+'|'+_0x231515+'|'+_0x4cf63a;_0x26f21a['urlOnRing']=_0x11e2ae[0x7]+_0x2625('0x6')+_0x22712c+'|'+_0x58165e+'|'+_0x523b6f+'|'+_0x231515+'|'+_0x4cf63a+'|'+_0x59dd1b+'|'+_0x2d6f6e;_0x26f21a[_0x2625('0x7')]=_0x11e2ae[0x9];var _0x5a287c={};_0x5a287c[_0x2625('0x8')]=_0x2625('0x9');_0x5a287c[_0x2625('0xa')]=_0x2625('0xb');var _0x56ddbb=[];_0x56ddbb['push'](_0x11e2ae[0x2]);_0x56ddbb['push'](_0x11e2ae[0x5]);_0x56ddbb[_0x2625('0x4')](_0x11e2ae[0x6]);_0x5a287c['params']=_0x56ddbb;_0x5a287c['id']=0x1;var _0x319ae0=JSON[_0x2625('0xc')](_0x5a287c);var _0x33e312={'encoding':_0x2625('0xd'),'method':_0x2625('0xe'),'timeout':0x2710,'url':_0x48d15d,'headers':{'Content-Type':_0x2625('0xf')},'body':_0x319ae0};return rp(_0x33e312)[_0x2625('0x10')](function(_0x37229f){const _0xf3a108=JSON[_0x2625('0x11')](_0x37229f);if(!_0xf3a108[_0x2625('0x12')]['logged']){throw new Error(_0x2625('0x13'));}var _0x2c4198=_0x231515;var _0x1ce8a8=_0x2625('0x14')+_0x437ae5+'&serviceId='+_0x3a491d+_0x2625('0x15')+_0x2c4198+'&data='+JSON['stringify'](_0x26f21a);var _0x1fddd1=_0x1b270a+'?'+_0x1ce8a8;return rp(_0x1fddd1);})[_0x2625('0x10')](function(_0x585435){logger[_0x2625('0x16')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x44820d,_0x585435);_0xf04a37[_0x2625('0x17')]();})[_0x2625('0x18')](function(_0x187286){logger[_0x2625('0x19')]('[%s][TVOX]\x20%s',_0x44820d,_[_0x2625('0x1a')](_0x187286)?JSON['stringify'](_0x187286):_0x187286);_0xf04a37[_0x2625('0x17')]();});}else{logger['info']('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x44820d);_0xf04a37[_0x2625('0x1b')]();}};}; \ 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 b05385c..a008c7f 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x5a885c,_0x296bdb){var _0xdd5a5e=function(_0xa40402){while(--_0xa40402){_0x5a885c['push'](_0x5a885c['shift']());}};_0xdd5a5e(++_0x296bdb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x315ba2,_0x410458){var _0x3cee83=function(_0x235175){while(--_0x235175){_0x315ba2['push'](_0x315ba2['shift']());}};_0x3cee83(++_0x410458);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 93d6f27..ea4b742 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 _0x1fa9=['server','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','path','bluebird','./applications/utils','./applications/strategy/util','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','rules','message','interaction','transfer','applications','isArray','length','join','.js','app','appdata','split','channel','mail','push','slice','dialogflow','dialogflowv2','amazonlex','TagId','getMustacheRender','account','notificationTemplate','ChatWebsiteId','ContactId','body','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','stack','message\x20is\x20empty','hasOwnProperty','capacity','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions'];(function(_0xf38492,_0x45d84e){var _0x3e66e3=function(_0xf16ba){while(--_0xf16ba){_0xf38492['push'](_0xf38492['shift']());}};_0x3e66e3(++_0x45d84e);}(_0x1fa9,0x136));var _0x91fa=function(_0x45ab9e,_0x195c25){_0x45ab9e=_0x45ab9e-0x0;var _0x51499d=_0x1fa9[_0x45ab9e];return _0x51499d;};'use strict';var _=require(_0x91fa('0x0'));var util=require('util');var path=require(_0x91fa('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x91fa('0x2'));var utils=require(_0x91fa('0x3'));var sUtils=require(_0x91fa('0x4'));var logger=require('../../../config/logger')(_0x91fa('0x5'));var rpc={'openchannelQueueReport':require(_0x91fa('0x6')),'mailQueueReport':require(_0x91fa('0x7')),'chatQueueReport':require(_0x91fa('0x8')),'smsQueueReport':require(_0x91fa('0x9')),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x91fa('0xa'))};var RuleEngine=require(_0x91fa('0xb'));function getId(_0x483dde,_0x5e30a6,_0xb4a51f){return util[_0x91fa('0xc')](_0x91fa('0xd'),_0x483dde,_0x5e30a6||0x0,_0xb4a51f||0x0);}function getIntervals(_0x34472a,_0x1f246b){var _0x886fc1=[];if(!_[_0x91fa('0xe')](_0x1f246b['IntervalId'])&&!_['isNil'](_0x34472a[_0x1f246b[_0x91fa('0xf')]])&&!_[_0x91fa('0xe')](_0x34472a[_0x1f246b[_0x91fa('0xf')]][_0x91fa('0x10')])){_0x886fc1=_[_0x91fa('0x11')](_0x34472a[_0x1f246b[_0x91fa('0xf')]][_0x91fa('0x10')],'interval');}else if(!_['isNil'](_0x1f246b['interval'])){_0x886fc1=[_0x1f246b[_0x91fa('0x12')]];}return _0x886fc1;}exports['listen']=function(_0x5f215d){_0x5f215d[_0x91fa('0x13')]={};return new BPromise(function(_0x4650bf,_0x2797d2){var _0x5449a7={'Start':function(_0x308812){var _0x252ec7=this;return new Promise(function(_0x74c75d,_0x2667da){if(_0x308812){try{var _0xe9e249=[];var _0x1f43fa=getId(_0x308812['channel'],_0x308812[_0x91fa('0x14')]?_0x308812[_0x91fa('0x14')]['id']:0x0,_0x308812[_0x91fa('0x15')]?_0x308812[_0x91fa('0x15')]['id']:0x0);var _0xd39ff8=sUtils['checkWaitingNotifications'](_0x5f215d,_0x308812);if(_0x308812[_0x91fa('0x16')]||!_0xd39ff8&&_0x308812[_0x91fa('0x17')]&&_[_0x91fa('0x18')](_0x308812[_0x91fa('0x17')])&&_0x308812[_0x91fa('0x17')][_0x91fa('0x19')]){for(var _0xb5109c=0x0;_0xb5109c<_0x308812[_0x91fa('0x17')][_0x91fa('0x19')];_0xb5109c+=0x1){var _0x274d6f=_0x308812[_0x91fa('0x17')][_0xb5109c];if(fs['existsSync'](path[_0x91fa('0x1a')](__dirname,_0x91fa('0x17'),_0x274d6f['app']+_0x91fa('0x1b')))){var _0x50596c=[];switch(_0x274d6f[_0x91fa('0x1c')]['toLowerCase']()){case'autoreply':var _0x5d89f9=_0x274d6f[_0x91fa('0x1d')][_0x91fa('0x1e')](',');if(_0x308812[_0x91fa('0x1f')]===_0x91fa('0x20')){_0x50596c[_0x91fa('0x21')](_0x5d89f9[0x0]);_0x50596c['push'](_0x5d89f9[0x1]);_0x50596c[_0x91fa('0x21')](_0x5d89f9[_0x91fa('0x22')](0x2,_0x5d89f9[_0x91fa('0x19')])[_0x91fa('0x1a')](','));}else{_0x50596c['push'](_0x5d89f9[0x0]);_0x50596c['push'](_0x5d89f9[_0x91fa('0x22')](0x1,_0x5d89f9[_0x91fa('0x19')])[_0x91fa('0x1a')](','));}break;case _0x91fa('0x23'):var _0x1224ef=_0x274d6f['appdata'][_0x91fa('0x1e')](',');_0x50596c[_0x91fa('0x21')](_0x1224ef[0x0]);_0x50596c[_0x91fa('0x21')](_0x1224ef[0x1]);_0x50596c['push'](_0x1224ef['slice'](0x2,_0x1224ef[_0x91fa('0x19')])[_0x91fa('0x1a')](','));break;case _0x91fa('0x24'):var _0x43f529=_0x274d6f[_0x91fa('0x1d')][_0x91fa('0x1e')](',');_0x50596c[_0x91fa('0x21')](_0x43f529[0x0]);_0x50596c[_0x91fa('0x21')](_0x43f529[0x1]);_0x50596c[_0x91fa('0x21')](_0x43f529[0x2]);_0x50596c[_0x91fa('0x21')](_0x43f529[0x3]);_0x50596c[_0x91fa('0x21')](_0x43f529['slice'](0x4,_0x43f529['length'])[_0x91fa('0x1a')](','));break;case _0x91fa('0x25'):var _0x2e5b1f=_0x274d6f[_0x91fa('0x1d')][_0x91fa('0x1e')](',');_0x50596c[_0x91fa('0x21')](_0x2e5b1f[0x0]);_0x50596c['push'](_0x2e5b1f[0x1]);_0x50596c[_0x91fa('0x21')](_0x2e5b1f[0x2]);_0x50596c[_0x91fa('0x21')](_0x2e5b1f[0x3]);_0x50596c[_0x91fa('0x21')](_0x2e5b1f[_0x91fa('0x22')](0x4,_0x2e5b1f[_0x91fa('0x19')])[_0x91fa('0x1a')](','));break;case _0x91fa('0x14'):_0x50596c[_0x91fa('0x21')](_0x274d6f['appdata']);break;case'tag':_0x50596c[_0x91fa('0x21')](_0x274d6f[_0x91fa('0x26')]);_0x50596c['push'](_0x274d6f[_0x91fa('0x1d')]);break;case'tvox':var _0x5c96c0=utils[_0x91fa('0x27')](_0x308812[_0x91fa('0x28')][_0x91fa('0x29')],_0x308812);var _0x58717d=_0x274d6f[_0x91fa('0x1d')][_0x91fa('0x1e')](',');_0x50596c[_0x91fa('0x21')](_0x58717d[0x0]);_0x50596c[_0x91fa('0x21')](_0x58717d[0x1]);_0x50596c[_0x91fa('0x21')](_0x58717d[0x2]);_0x50596c[_0x91fa('0x21')](_0x58717d[0x3]);_0x50596c[_0x91fa('0x21')](_0x58717d[0x4]);_0x50596c['push'](_0x58717d[0x5]);_0x50596c[_0x91fa('0x21')](_0x58717d[0x6]);_0x50596c[_0x91fa('0x21')](_0x58717d[0x7]);_0x50596c['push'](_0x58717d[0x8]);_0x50596c['push'](_0x58717d[0x9]);_0x50596c[_0x91fa('0x21')](_0x58717d[0xa]);_0x50596c[_0x91fa('0x21')](_0x308812['interaction']['id']);_0x50596c[_0x91fa('0x21')](_0x308812[_0x91fa('0x14')]['id']);_0x50596c['push'](_0x274d6f[_0x91fa('0x2a')]);_0x50596c['push'](_0x308812['interaction'][_0x91fa('0x2b')]);_0x50596c[_0x91fa('0x21')](_0x308812['body'][_0x91fa('0x2c')]);_0x50596c[_0x91fa('0x21')](_0x5c96c0);break;default:_0x50596c=_['isNil'](_0x274d6f[_0x91fa('0x1d')])?[]:_0x274d6f['appdata'][_0x91fa('0x1e')](',');}var _0x4a3c54={'id':util[_0x91fa('0xc')]('%s:%s:%s',_0x1f43fa,_0x274d6f['id'],_0x274d6f[_0x91fa('0x1c')]),'condition':require(_0x91fa('0x2d'))[_0x91fa('0x2e')](_0x1f43fa,getIntervals(_0x5f215d[_0x91fa('0x2f')],_0x274d6f),_0x5f215d),'consequence':require('./applications/'+_0x274d6f[_0x91fa('0x1c')])[_0x91fa('0x30')](_0x1f43fa,_0x50596c,_0x5f215d,_0x308812),'p':_0x274d6f[_0x91fa('0x31')]||0x0};logger[_0x91fa('0x32')](_0x91fa('0x33'),_0x4a3c54['id'],_0x91fa('0x34'),getIntervals(_0x5f215d['intervals'],_0x274d6f)[_0x91fa('0x1a')]('\x20|\x20'));_0xe9e249[_0x91fa('0x21')](_0x4a3c54);}else{logger[_0x91fa('0x35')](_0x91fa('0x36'),path[_0x91fa('0x1a')](__dirname,_0x91fa('0x17'),_0x274d6f[_0x91fa('0x1c')]+_0x91fa('0x1b')));}}_0x5f215d[_0x91fa('0x13')][_0x1f43fa]=new RuleEngine(_0xe9e249);_0x5f215d['rules'][_0x1f43fa][_0x91fa('0x37')](_0x308812,function(_0x5e14a4){logger[_0x91fa('0x32')](_0x91fa('0x38'),JSON[_0x91fa('0x39')](_0x5e14a4[_0x91fa('0x3a')]));if(_0x5f215d[_0x91fa('0x13')][_0x1f43fa]){_0x5f215d[_0x91fa('0x13')][_0x1f43fa][_0x91fa('0x3b')](_0x91fa('0x3c'));}});return _0x74c75d({'code':0xc8,'message':_0x308812});}else{if(_0xd39ff8){logger[_0x91fa('0x32')](util[_0x91fa('0xc')](_0x91fa('0x3d'),_0x1f43fa));}else{logger[_0x91fa('0x32')](_0x91fa('0x3e'));}return _0x74c75d({'code':0xc8,'message':_0x308812});}}catch(_0x3bcea9){logger[_0x91fa('0x35')](_0x3bcea9['stack']);return _0x2667da(_0x252ec7[_0x91fa('0x35')](0x1f4,_0x3bcea9));}}return _0x2667da(_0x91fa('0x3f'));});},'AcceptMessage':function(_0x441c0f){var _0x2b9ba9=this;return new Promise(function(_0x3bc598,_0x3b4d60){if(_0x441c0f[_0x91fa('0x40')]&&_0x441c0f[_0x91fa('0x40')]['id']){if(_0x5f215d[_0x91fa('0x41')][_0x441c0f[_0x91fa('0x40')]['id']]){_0x5f215d[_0x91fa('0x41')][_0x441c0f[_0x91fa('0x40')]['id']][_0x91fa('0x42')]=![];_0x5f215d['agents'][_0x441c0f[_0x91fa('0x40')]['id']][_0x91fa('0x43')]=undefined;}}if(_0x441c0f[_0x91fa('0x14')]&&_0x441c0f[_0x91fa('0x14')]['id']){try{var _0x19b3c9=getId(_0x441c0f['channel'],_0x441c0f[_0x91fa('0x14')]?_0x441c0f['message']['id']:0x0,_0x441c0f[_0x91fa('0x15')]?_0x441c0f[_0x91fa('0x15')]['id']:0x0);if(_0x5f215d[_0x91fa('0x13')][_0x19b3c9]){_0x5f215d[_0x91fa('0x13')][_0x19b3c9][_0x91fa('0x3b')](_0x91fa('0x44'));if(rpc[_0x441c0f[_0x91fa('0x1f')]+_0x91fa('0x45')]){rpc[_0x441c0f[_0x91fa('0x1f')]+_0x91fa('0x45')][_0x91fa('0x46')](_0x19b3c9,{'UserId':_0x441c0f['message'][_0x91fa('0x47')]})['catch'](function(){logger['error']('error\x20update\x20queue\x20report');});}}return _0x3bc598({'code':0xc8,'message':_0x441c0f});}catch(_0x49b160){logger['error'](_0x49b160[_0x91fa('0x48')]);return _0x3b4d60(_0x2b9ba9[_0x91fa('0x35')](0x1f4,_0x49b160));}}logger[_0x91fa('0x35')](_0x91fa('0x49'));return _0x3b4d60(_0x2b9ba9[_0x91fa('0x35')](0x1f4,_0x91fa('0x49')));});},'RejectMessage':function(_0x1175b8){var _0x218e87=this;return new Promise(function(_0x4e3251,_0x5ba0c9){if(_0x1175b8['agent']&&_0x1175b8[_0x91fa('0x40')]['id']){try{if(_0x5f215d[_0x91fa('0x41')][_0x1175b8['agent']['id']]){_0x5f215d[_0x91fa('0x41')][_0x1175b8[_0x91fa('0x40')]['id']][_0x91fa('0x42')]=![];_0x5f215d['agents'][_0x1175b8[_0x91fa('0x40')]['id']]['busyQueue']=undefined;}return _0x4e3251({'code':0xc8,'message':_0x1175b8});}catch(_0x37a49f){logger[_0x91fa('0x35')](_0x37a49f[_0x91fa('0x48')]);return _0x5ba0c9(_0x218e87[_0x91fa('0x35')](0x1f4,_0x37a49f));}}logger[_0x91fa('0x35')](_0x91fa('0x49'));return _0x5ba0c9(_0x218e87['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x3ccf45){var _0x16183e=this;return new Promise(function(_0x344418,_0x29bf0a){if(_0x3ccf45[_0x91fa('0x1f')]&&_0x3ccf45['interaction']&&_0x3ccf45[_0x91fa('0x15')]['id']){try{var _0x4358e5=getId(_0x3ccf45[_0x91fa('0x1f')],_0x3ccf45[_0x91fa('0x14')]?_0x3ccf45['message']['id']:0x0,_0x3ccf45[_0x91fa('0x15')]?_0x3ccf45[_0x91fa('0x15')]['id']:0x0);if(_0x5f215d[_0x91fa('0x13')][_0x4358e5]){_0x5f215d[_0x91fa('0x13')][_0x4358e5][_0x91fa('0x3b')](_0x91fa('0x44'));}return _0x344418({'code':0xc8,'message':_0x3ccf45});}catch(_0x664cf1){logger[_0x91fa('0x35')](_0x664cf1['stack']);return _0x29bf0a(_0x16183e['error'](0x1f4,_0x664cf1));}}logger[_0x91fa('0x35')]('message\x20is\x20empty');return _0x29bf0a(_0x16183e[_0x91fa('0x35')](0x1f4,_0x91fa('0x49')));});},'AgentCapacity':function(_0x293929){var _0x5b3712=this;return new Promise(function(_0x1b12e0,_0xda496d){if(_0x5f215d[_0x91fa('0x41')][_0x91fa('0x4a')](_0x293929['id'])){for(var _0x227a67 in _0x293929['capacity']){if(_0x293929[_0x91fa('0x4b')]['hasOwnProperty'](_0x227a67)){if(_0x5f215d[_0x91fa('0x41')][_0x293929['id']][_0x91fa('0x4a')](_0x227a67+'CurrentCapacity')){_0x5f215d['agents'][_0x293929['id']][_0x227a67+'CurrentCapacity']=parseInt(_0x293929['capacity'][_0x227a67],0xa);}}}_0x5f215d[_0x91fa('0x41')][_0x293929['id']]['updateRealtime']();return _0x1b12e0({'code':0xc8,'message':_0x5f215d['agents'][_0x293929['id']]});}else{return _0xda496d(_0x5b3712[_0x91fa('0x35')](0x1f4,_0x91fa('0x4c')));}});},'Agents':function(_0x27797e){return new Promise(function(_0x112dde){var _0x4f8bad=_[_0x91fa('0x4d')](_0x5f215d[_0x91fa('0x41')]);if(_0x27797e&&_0x27797e['id']){var _0x450616=_[_0x91fa('0x4e')](_0x4f8bad,function(_0x4361cf){return _0x4361cf['id']===_0x27797e['id'];});_0x112dde(_0x450616);}else{_0x112dde({'count':_0x4f8bad[_0x91fa('0x19')],'rows':_0x4f8bad});}});},'ChatQueues':function(){return new Promise(function(_0x491f58){var _0x21bd6e=[];for(var _0x53df4a in _0x5f215d[_0x91fa('0x4f')]){if(_0x5f215d[_0x91fa('0x4f')][_0x91fa('0x4a')](_0x53df4a)){var _0x54c734=_0x5f215d['chatQueues'][_0x53df4a];var _0x2a0bac={'id':_0x54c734['id'],'available':_0x54c734[_0x91fa('0x50')],'loggedIn':_0x54c734[_0x91fa('0x51')],'name':_0x54c734[_0x91fa('0x52')],'paused':_0x54c734[_0x91fa('0x53')],'waiting':_0x54c734[_0x91fa('0x54')]};_0x21bd6e[_0x91fa('0x21')](_0x2a0bac);}}_0x491f58({'count':_0x21bd6e[_0x91fa('0x19')],'rows':_0x21bd6e});});},'MailQueues':function(){return new Promise(function(_0x165c6a){var _0x4d7b41=[];for(var _0x22cc1c in _0x5f215d[_0x91fa('0x55')]){if(_0x5f215d[_0x91fa('0x55')][_0x91fa('0x4a')](_0x22cc1c)){var _0x2cc032=_0x5f215d[_0x91fa('0x55')][_0x22cc1c];var _0x1a38ba={'id':_0x2cc032['id'],'available':_0x2cc032['available'],'loggedIn':_0x2cc032[_0x91fa('0x51')],'name':_0x2cc032['name'],'paused':_0x2cc032[_0x91fa('0x53')],'waiting':_0x2cc032[_0x91fa('0x54')]};_0x4d7b41['push'](_0x1a38ba);}}_0x165c6a({'count':_0x4d7b41[_0x91fa('0x19')],'rows':_0x4d7b41});});},'OpenchannelQueues':function(){return new Promise(function(_0x22d45e){var _0x504781=[];for(var _0x61e41 in _0x5f215d[_0x91fa('0x56')]){if(_0x5f215d['openchannelQueues'][_0x91fa('0x4a')](_0x61e41)){var _0x5afebf=_0x5f215d[_0x91fa('0x56')][_0x61e41];var _0x166bbd={'id':_0x5afebf['id'],'available':_0x5afebf['available'],'loggedIn':_0x5afebf[_0x91fa('0x51')],'name':_0x5afebf[_0x91fa('0x52')],'paused':_0x5afebf[_0x91fa('0x53')],'waiting':_0x5afebf[_0x91fa('0x54')]};_0x504781['push'](_0x166bbd);}}_0x22d45e({'count':_0x504781[_0x91fa('0x19')],'rows':_0x504781});});},'SmsQueues':function(){return new Promise(function(_0x17cf19){var _0x1a01c2=[];for(var _0x53b5ad in _0x5f215d[_0x91fa('0x57')]){if(_0x5f215d[_0x91fa('0x57')][_0x91fa('0x4a')](_0x53b5ad)){var _0x2f98ae=_0x5f215d[_0x91fa('0x57')][_0x53b5ad];var _0x234237={'id':_0x2f98ae['id'],'available':_0x2f98ae[_0x91fa('0x50')],'loggedIn':_0x2f98ae[_0x91fa('0x51')],'name':_0x2f98ae[_0x91fa('0x52')],'paused':_0x2f98ae[_0x91fa('0x53')],'waiting':_0x2f98ae['waiting']};_0x1a01c2['push'](_0x234237);}}_0x17cf19({'count':_0x1a01c2[_0x91fa('0x19')],'rows':_0x1a01c2});});},'FaxQueues':function(){return new Promise(function(_0x11d379){var _0x3ed034=[];for(var _0x34fe5e in _0x5f215d[_0x91fa('0x58')]){if(_0x5f215d[_0x91fa('0x58')][_0x91fa('0x4a')](_0x34fe5e)){var _0x3e0dd7=_0x5f215d[_0x91fa('0x58')][_0x34fe5e];var _0x419aac={'id':_0x3e0dd7['id'],'available':_0x3e0dd7[_0x91fa('0x50')],'loggedIn':_0x3e0dd7[_0x91fa('0x51')],'name':_0x3e0dd7[_0x91fa('0x52')],'paused':_0x3e0dd7[_0x91fa('0x53')],'waiting':_0x3e0dd7[_0x91fa('0x54')]};_0x3ed034[_0x91fa('0x21')](_0x419aac);}}_0x11d379({'count':_0x3ed034['length'],'rows':_0x3ed034});});},'WhatsappQueues':function(){return new Promise(function(_0x1866f7){var _0x10f683=[];for(var _0x1924bd in _0x5f215d['whatsappQueues']){if(_0x5f215d[_0x91fa('0x59')][_0x91fa('0x4a')](_0x1924bd)){var _0x51a40d=_0x5f215d[_0x91fa('0x59')][_0x1924bd];var _0x1e5146={'id':_0x51a40d['id'],'available':_0x51a40d[_0x91fa('0x50')],'loggedIn':_0x51a40d['loggedIn'],'name':_0x51a40d[_0x91fa('0x52')],'paused':_0x51a40d[_0x91fa('0x53')],'waiting':_0x51a40d['waiting']};_0x10f683[_0x91fa('0x21')](_0x1e5146);}}_0x1866f7({'count':_0x10f683[_0x91fa('0x19')],'rows':_0x10f683});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2bc0c8){var _0x541d30=_['values'](_0x5f215d['chatQueuesWaitingInteractions']);_0x2bc0c8({'count':_0x541d30[_0x91fa('0x19')],'rows':_0x541d30});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x528252){var _0x54b226=_['values'](_0x5f215d['mailQueuesWaitingInteractions']);_0x528252({'count':_0x54b226[_0x91fa('0x19')],'rows':_0x54b226});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3c3082){var _0x264c11=_[_0x91fa('0x4d')](_0x5f215d[_0x91fa('0x5a')]);_0x3c3082({'count':_0x264c11[_0x91fa('0x19')],'rows':_0x264c11});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x726d43){var _0x107d97=_['values'](_0x5f215d[_0x91fa('0x5b')]);_0x726d43({'count':_0x107d97[_0x91fa('0x19')],'rows':_0x107d97});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x5938d5){var _0x42d7fd=_[_0x91fa('0x4d')](_0x5f215d[_0x91fa('0x5c')]);_0x5938d5({'count':_0x42d7fd[_0x91fa('0x19')],'rows':_0x42d7fd});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x14cbab){var _0x508da5=_[_0x91fa('0x4d')](_0x5f215d[_0x91fa('0x5d')]);_0x14cbab({'count':_0x508da5[_0x91fa('0x19')],'rows':_0x508da5});});}};var _0x230f14=jayson[_0x91fa('0x5e')](_0x5449a7)[_0x91fa('0x5f')]();_0x230f14['on'](_0x91fa('0x35'),function(_0x51e0ab){logger[_0x91fa('0x35')](JSON['stringify'](_0x51e0ab));return _0x2797d2(_0x51e0ab);});_0x230f14[_0x91fa('0x60')](0x232c,_0x91fa('0x61'),function(){console[_0x91fa('0x62')](_0x91fa('0x63'),0x232c);return _0x4650bf(_0x91fa('0x64')+0x232c);});});}; \ No newline at end of file +var _0x684b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','RPC\x20listening\x20on\x20port:','lodash','path','jayson/promise','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','IntervalId','isNil','Intervals','map','interval','listen','channel','message','interaction','transfer','isArray','applications','length','existsSync','join','app','toLowerCase','autoreply','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','appdata','tag','TagId','tvox','ContactId','body','./interval','./applications/','priority','Push\x20new\x20rule','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','info','Applications\x20executed','stringify','matchPath','emit','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','find','chatQueues','available','name','waiting','mailQueues','loggedIn','paused','openchannelQueues','smsQueues'];(function(_0x24a371,_0x48a879){var _0x1b62c5=function(_0x17652b){while(--_0x17652b){_0x24a371['push'](_0x24a371['shift']());}};_0x1b62c5(++_0x48a879);}(_0x684b,0x1a5));var _0xb684=function(_0x49ff9c,_0x1e5268){_0x49ff9c=_0x49ff9c-0x0;var _0x5a9d92=_0x684b[_0x49ff9c];return _0x5a9d92;};'use strict';var _=require(_0xb684('0x0'));var util=require('util');var path=require(_0xb684('0x1'));var fs=require('fs');var jayson=require(_0xb684('0x2'));var BPromise=require('bluebird');var utils=require(_0xb684('0x3'));var sUtils=require(_0xb684('0x4'));var logger=require(_0xb684('0x5'))(_0xb684('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb684('0x7')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0xb684('0x8')),'faxQueueReport':require(_0xb684('0x9')),'whatsappQueueReport':require(_0xb684('0xa'))};var RuleEngine=require(_0xb684('0xb'));function getId(_0x194198,_0x3f2199,_0x627347){return util[_0xb684('0xc')]('%s.%s.%s',_0x194198,_0x3f2199||0x0,_0x627347||0x0);}function getIntervals(_0x59f387,_0x562a09){var _0x500933=[];if(!_['isNil'](_0x562a09[_0xb684('0xd')])&&!_[_0xb684('0xe')](_0x59f387[_0x562a09[_0xb684('0xd')]])&&!_[_0xb684('0xe')](_0x59f387[_0x562a09[_0xb684('0xd')]][_0xb684('0xf')])){_0x500933=_[_0xb684('0x10')](_0x59f387[_0x562a09[_0xb684('0xd')]]['Intervals'],_0xb684('0x11'));}else if(!_['isNil'](_0x562a09[_0xb684('0x11')])){_0x500933=[_0x562a09[_0xb684('0x11')]];}return _0x500933;}exports[_0xb684('0x12')]=function(_0x52d397){_0x52d397['rules']={};return new BPromise(function(_0x2a0bc3,_0x3ede39){var _0x1fd817={'Start':function(_0x332687){var _0x1670c0=this;return new Promise(function(_0x2f105c,_0x1cd422){if(_0x332687){try{var _0x194bf7=[];var _0x218f9d=getId(_0x332687[_0xb684('0x13')],_0x332687['message']?_0x332687[_0xb684('0x14')]['id']:0x0,_0x332687[_0xb684('0x15')]?_0x332687['interaction']['id']:0x0);var _0x2227b4=sUtils['checkWaitingNotifications'](_0x52d397,_0x332687);if(_0x332687[_0xb684('0x16')]||!_0x2227b4&&_0x332687['applications']&&_[_0xb684('0x17')](_0x332687[_0xb684('0x18')])&&_0x332687[_0xb684('0x18')][_0xb684('0x19')]){for(var _0x31a345=0x0;_0x31a345<_0x332687[_0xb684('0x18')][_0xb684('0x19')];_0x31a345+=0x1){var _0x3d17ee=_0x332687[_0xb684('0x18')][_0x31a345];if(fs[_0xb684('0x1a')](path[_0xb684('0x1b')](__dirname,'applications',_0x3d17ee[_0xb684('0x1c')]+'.js'))){var _0x49cc57=[];switch(_0x3d17ee[_0xb684('0x1c')][_0xb684('0x1d')]()){case _0xb684('0x1e'):var _0x3fde39=_0x3d17ee['appdata'][_0xb684('0x1f')](',');if(_0x332687[_0xb684('0x13')]===_0xb684('0x20')){_0x49cc57[_0xb684('0x21')](_0x3fde39[0x0]);_0x49cc57[_0xb684('0x21')](_0x3fde39[0x1]);_0x49cc57[_0xb684('0x21')](_0x3fde39[_0xb684('0x22')](0x2,_0x3fde39[_0xb684('0x19')])['join'](','));}else{_0x49cc57[_0xb684('0x21')](_0x3fde39[0x0]);_0x49cc57[_0xb684('0x21')](_0x3fde39[_0xb684('0x22')](0x1,_0x3fde39[_0xb684('0x19')])[_0xb684('0x1b')](','));}break;case _0xb684('0x23'):var _0x5eb96c=_0x3d17ee['appdata'][_0xb684('0x1f')](',');_0x49cc57['push'](_0x5eb96c[0x0]);_0x49cc57[_0xb684('0x21')](_0x5eb96c[0x1]);_0x49cc57[_0xb684('0x21')](_0x5eb96c[_0xb684('0x22')](0x2,_0x5eb96c[_0xb684('0x19')])[_0xb684('0x1b')](','));break;case _0xb684('0x24'):var _0xc5bece=_0x3d17ee['appdata'][_0xb684('0x1f')](',');_0x49cc57[_0xb684('0x21')](_0xc5bece[0x0]);_0x49cc57[_0xb684('0x21')](_0xc5bece[0x1]);_0x49cc57[_0xb684('0x21')](_0xc5bece[0x2]);_0x49cc57['push'](_0xc5bece[0x3]);_0x49cc57['push'](_0xc5bece[_0xb684('0x22')](0x4,_0xc5bece['length'])['join'](','));break;case _0xb684('0x25'):var _0x3c7855=_0x3d17ee[_0xb684('0x26')][_0xb684('0x1f')](',');_0x49cc57[_0xb684('0x21')](_0x3c7855[0x0]);_0x49cc57[_0xb684('0x21')](_0x3c7855[0x1]);_0x49cc57[_0xb684('0x21')](_0x3c7855[0x2]);_0x49cc57[_0xb684('0x21')](_0x3c7855[0x3]);_0x49cc57[_0xb684('0x21')](_0x3c7855[_0xb684('0x22')](0x4,_0x3c7855[_0xb684('0x19')])[_0xb684('0x1b')](','));break;case _0xb684('0x14'):_0x49cc57[_0xb684('0x21')](_0x3d17ee[_0xb684('0x26')]);break;case _0xb684('0x27'):_0x49cc57[_0xb684('0x21')](_0x3d17ee[_0xb684('0x28')]);_0x49cc57['push'](_0x3d17ee[_0xb684('0x26')]);break;case _0xb684('0x29'):var _0x1a2fbc=utils['getMustacheRender'](_0x332687['account']['notificationTemplate'],_0x332687);var _0xb2030c=_0x3d17ee[_0xb684('0x26')][_0xb684('0x1f')](',');_0x49cc57['push'](_0xb2030c[0x0]);_0x49cc57[_0xb684('0x21')](_0xb2030c[0x1]);_0x49cc57[_0xb684('0x21')](_0xb2030c[0x2]);_0x49cc57[_0xb684('0x21')](_0xb2030c[0x3]);_0x49cc57['push'](_0xb2030c[0x4]);_0x49cc57[_0xb684('0x21')](_0xb2030c[0x5]);_0x49cc57['push'](_0xb2030c[0x6]);_0x49cc57[_0xb684('0x21')](_0xb2030c[0x7]);_0x49cc57[_0xb684('0x21')](_0xb2030c[0x8]);_0x49cc57['push'](_0xb2030c[0x9]);_0x49cc57[_0xb684('0x21')](_0xb2030c[0xa]);_0x49cc57[_0xb684('0x21')](_0x332687['interaction']['id']);_0x49cc57[_0xb684('0x21')](_0x332687[_0xb684('0x14')]['id']);_0x49cc57[_0xb684('0x21')](_0x3d17ee['ChatWebsiteId']);_0x49cc57[_0xb684('0x21')](_0x332687['interaction'][_0xb684('0x2a')]);_0x49cc57[_0xb684('0x21')](_0x332687[_0xb684('0x2b')][_0xb684('0x2b')]);_0x49cc57[_0xb684('0x21')](_0x1a2fbc);break;default:_0x49cc57=_[_0xb684('0xe')](_0x3d17ee[_0xb684('0x26')])?[]:_0x3d17ee[_0xb684('0x26')][_0xb684('0x1f')](',');}var _0x219415={'id':util[_0xb684('0xc')]('%s:%s:%s',_0x218f9d,_0x3d17ee['id'],_0x3d17ee['app']),'condition':require(_0xb684('0x2c'))['condition'](_0x218f9d,getIntervals(_0x52d397['intervals'],_0x3d17ee),_0x52d397),'consequence':require(_0xb684('0x2d')+_0x3d17ee[_0xb684('0x1c')])['consequence'](_0x218f9d,_0x49cc57,_0x52d397,_0x332687),'p':_0x3d17ee[_0xb684('0x2e')]||0x0};logger['info'](_0xb684('0x2f'),_0x219415['id'],'on\x20interval',getIntervals(_0x52d397[_0xb684('0x30')],_0x3d17ee)['join'](_0xb684('0x31')));_0x194bf7['push'](_0x219415);}else{logger[_0xb684('0x32')](_0xb684('0x33'),path[_0xb684('0x1b')](__dirname,_0xb684('0x18'),_0x3d17ee[_0xb684('0x1c')]+_0xb684('0x34')));}}_0x52d397[_0xb684('0x35')][_0x218f9d]=new RuleEngine(_0x194bf7);_0x52d397['rules'][_0x218f9d]['execute'](_0x332687,function(_0x4fb242){logger[_0xb684('0x36')](_0xb684('0x37'),JSON[_0xb684('0x38')](_0x4fb242[_0xb684('0x39')]));if(_0x52d397[_0xb684('0x35')][_0x218f9d]){_0x52d397[_0xb684('0x35')][_0x218f9d][_0xb684('0x3a')](_0xb684('0x3b'));}});return _0x2f105c({'code':0xc8,'message':_0x332687});}else{if(_0x2227b4){logger['info'](util[_0xb684('0xc')](_0xb684('0x3c'),_0x218f9d));}else{logger[_0xb684('0x36')](_0xb684('0x3d'));}return _0x2f105c({'code':0xc8,'message':_0x332687});}}catch(_0x286575){logger[_0xb684('0x32')](_0x286575['stack']);return _0x1cd422(_0x1670c0[_0xb684('0x32')](0x1f4,_0x286575));}}return _0x1cd422(_0xb684('0x3e'));});},'AcceptMessage':function(_0x3ac318){var _0x6e5240=this;return new Promise(function(_0x308de5,_0x118539){if(_0x3ac318[_0xb684('0x3f')]&&_0x3ac318[_0xb684('0x3f')]['id']){if(_0x52d397[_0xb684('0x40')][_0x3ac318[_0xb684('0x3f')]['id']]){_0x52d397[_0xb684('0x40')][_0x3ac318['agent']['id']][_0xb684('0x41')]=![];_0x52d397[_0xb684('0x40')][_0x3ac318[_0xb684('0x3f')]['id']][_0xb684('0x42')]=undefined;}}if(_0x3ac318['message']&&_0x3ac318[_0xb684('0x14')]['id']){try{var _0xe3e717=getId(_0x3ac318[_0xb684('0x13')],_0x3ac318[_0xb684('0x14')]?_0x3ac318['message']['id']:0x0,_0x3ac318[_0xb684('0x15')]?_0x3ac318[_0xb684('0x15')]['id']:0x0);if(_0x52d397[_0xb684('0x35')][_0xe3e717]){_0x52d397[_0xb684('0x35')][_0xe3e717][_0xb684('0x3a')](_0xb684('0x43'));if(rpc[_0x3ac318[_0xb684('0x13')]+_0xb684('0x44')]){rpc[_0x3ac318['channel']+'QueueReport'][_0xb684('0x45')](_0xe3e717,{'UserId':_0x3ac318[_0xb684('0x14')][_0xb684('0x46')]})['catch'](function(){logger[_0xb684('0x32')](_0xb684('0x47'));});}}return _0x308de5({'code':0xc8,'message':_0x3ac318});}catch(_0x1f0ae6){logger['error'](_0x1f0ae6[_0xb684('0x48')]);return _0x118539(_0x6e5240[_0xb684('0x32')](0x1f4,_0x1f0ae6));}}logger[_0xb684('0x32')]('message\x20is\x20empty');return _0x118539(_0x6e5240[_0xb684('0x32')](0x1f4,_0xb684('0x49')));});},'RejectMessage':function(_0x838bb9){var _0x22803a=this;return new Promise(function(_0x37eb11,_0x56340d){if(_0x838bb9[_0xb684('0x3f')]&&_0x838bb9[_0xb684('0x3f')]['id']){try{if(_0x52d397[_0xb684('0x40')][_0x838bb9[_0xb684('0x3f')]['id']]){_0x52d397['agents'][_0x838bb9[_0xb684('0x3f')]['id']][_0xb684('0x41')]=![];_0x52d397[_0xb684('0x40')][_0x838bb9[_0xb684('0x3f')]['id']][_0xb684('0x42')]=undefined;}return _0x37eb11({'code':0xc8,'message':_0x838bb9});}catch(_0x8421ac){logger[_0xb684('0x32')](_0x8421ac[_0xb684('0x48')]);return _0x56340d(_0x22803a[_0xb684('0x32')](0x1f4,_0x8421ac));}}logger[_0xb684('0x32')]('message\x20is\x20empty');return _0x56340d(_0x22803a[_0xb684('0x32')](0x1f4,_0xb684('0x49')));});},'AbandonInteraction':function(_0x2b0325){var _0x5e17e3=this;return new Promise(function(_0x8eda22,_0x40e2e0){if(_0x2b0325[_0xb684('0x13')]&&_0x2b0325[_0xb684('0x15')]&&_0x2b0325[_0xb684('0x15')]['id']){try{var _0x49e187=getId(_0x2b0325[_0xb684('0x13')],_0x2b0325[_0xb684('0x14')]?_0x2b0325[_0xb684('0x14')]['id']:0x0,_0x2b0325['interaction']?_0x2b0325[_0xb684('0x15')]['id']:0x0);if(_0x52d397['rules'][_0x49e187]){_0x52d397[_0xb684('0x35')][_0x49e187]['emit'](_0xb684('0x43'));}return _0x8eda22({'code':0xc8,'message':_0x2b0325});}catch(_0x31a793){logger[_0xb684('0x32')](_0x31a793[_0xb684('0x48')]);return _0x40e2e0(_0x5e17e3[_0xb684('0x32')](0x1f4,_0x31a793));}}logger[_0xb684('0x32')](_0xb684('0x49'));return _0x40e2e0(_0x5e17e3[_0xb684('0x32')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0xc9a26d){var _0x2edab6=this;return new Promise(function(_0x5bd00e,_0x77bdbd){if(_0x52d397['agents'][_0xb684('0x4a')](_0xc9a26d['id'])){for(var _0x55fa4e in _0xc9a26d[_0xb684('0x4b')]){if(_0xc9a26d[_0xb684('0x4b')]['hasOwnProperty'](_0x55fa4e)){if(_0x52d397['agents'][_0xc9a26d['id']][_0xb684('0x4a')](_0x55fa4e+_0xb684('0x4c'))){_0x52d397[_0xb684('0x40')][_0xc9a26d['id']][_0x55fa4e+_0xb684('0x4c')]=parseInt(_0xc9a26d[_0xb684('0x4b')][_0x55fa4e],0xa);}}}_0x52d397[_0xb684('0x40')][_0xc9a26d['id']][_0xb684('0x4d')]();return _0x5bd00e({'code':0xc8,'message':_0x52d397[_0xb684('0x40')][_0xc9a26d['id']]});}else{return _0x77bdbd(_0x2edab6[_0xb684('0x32')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x41ff3c){return new Promise(function(_0x9af582){var _0x334e26=_[_0xb684('0x4e')](_0x52d397[_0xb684('0x40')]);if(_0x41ff3c&&_0x41ff3c['id']){var _0x453b0c=_[_0xb684('0x4f')](_0x334e26,function(_0x255955){return _0x255955['id']===_0x41ff3c['id'];});_0x9af582(_0x453b0c);}else{_0x9af582({'count':_0x334e26[_0xb684('0x19')],'rows':_0x334e26});}});},'ChatQueues':function(){return new Promise(function(_0x22e8db){var _0x24366a=[];for(var _0x2366cf in _0x52d397['chatQueues']){if(_0x52d397[_0xb684('0x50')][_0xb684('0x4a')](_0x2366cf)){var _0x18fb85=_0x52d397[_0xb684('0x50')][_0x2366cf];var _0x1bcaac={'id':_0x18fb85['id'],'available':_0x18fb85[_0xb684('0x51')],'loggedIn':_0x18fb85['loggedIn'],'name':_0x18fb85[_0xb684('0x52')],'paused':_0x18fb85['paused'],'waiting':_0x18fb85[_0xb684('0x53')]};_0x24366a[_0xb684('0x21')](_0x1bcaac);}}_0x22e8db({'count':_0x24366a['length'],'rows':_0x24366a});});},'MailQueues':function(){return new Promise(function(_0x5b84f9){var _0x49ab45=[];for(var _0x18a9d0 in _0x52d397[_0xb684('0x54')]){if(_0x52d397[_0xb684('0x54')][_0xb684('0x4a')](_0x18a9d0)){var _0x2b97f6=_0x52d397['mailQueues'][_0x18a9d0];var _0x25ce26={'id':_0x2b97f6['id'],'available':_0x2b97f6[_0xb684('0x51')],'loggedIn':_0x2b97f6[_0xb684('0x55')],'name':_0x2b97f6[_0xb684('0x52')],'paused':_0x2b97f6[_0xb684('0x56')],'waiting':_0x2b97f6[_0xb684('0x53')]};_0x49ab45[_0xb684('0x21')](_0x25ce26);}}_0x5b84f9({'count':_0x49ab45[_0xb684('0x19')],'rows':_0x49ab45});});},'OpenchannelQueues':function(){return new Promise(function(_0x3dc45d){var _0x47e5d1=[];for(var _0x130c59 in _0x52d397['openchannelQueues']){if(_0x52d397[_0xb684('0x57')]['hasOwnProperty'](_0x130c59)){var _0x3155d9=_0x52d397[_0xb684('0x57')][_0x130c59];var _0x21c595={'id':_0x3155d9['id'],'available':_0x3155d9[_0xb684('0x51')],'loggedIn':_0x3155d9[_0xb684('0x55')],'name':_0x3155d9[_0xb684('0x52')],'paused':_0x3155d9[_0xb684('0x56')],'waiting':_0x3155d9[_0xb684('0x53')]};_0x47e5d1[_0xb684('0x21')](_0x21c595);}}_0x3dc45d({'count':_0x47e5d1['length'],'rows':_0x47e5d1});});},'SmsQueues':function(){return new Promise(function(_0x55bed4){var _0x61116e=[];for(var _0x2bd58a in _0x52d397[_0xb684('0x58')]){if(_0x52d397['smsQueues'][_0xb684('0x4a')](_0x2bd58a)){var _0x1fbb2d=_0x52d397[_0xb684('0x58')][_0x2bd58a];var _0x44109a={'id':_0x1fbb2d['id'],'available':_0x1fbb2d['available'],'loggedIn':_0x1fbb2d[_0xb684('0x55')],'name':_0x1fbb2d[_0xb684('0x52')],'paused':_0x1fbb2d[_0xb684('0x56')],'waiting':_0x1fbb2d[_0xb684('0x53')]};_0x61116e[_0xb684('0x21')](_0x44109a);}}_0x55bed4({'count':_0x61116e['length'],'rows':_0x61116e});});},'FaxQueues':function(){return new Promise(function(_0x1da00f){var _0x5bc1e6=[];for(var _0x2dcfc2 in _0x52d397[_0xb684('0x59')]){if(_0x52d397[_0xb684('0x59')][_0xb684('0x4a')](_0x2dcfc2)){var _0x2359fa=_0x52d397[_0xb684('0x59')][_0x2dcfc2];var _0x284c9={'id':_0x2359fa['id'],'available':_0x2359fa[_0xb684('0x51')],'loggedIn':_0x2359fa[_0xb684('0x55')],'name':_0x2359fa['name'],'paused':_0x2359fa['paused'],'waiting':_0x2359fa[_0xb684('0x53')]};_0x5bc1e6[_0xb684('0x21')](_0x284c9);}}_0x1da00f({'count':_0x5bc1e6[_0xb684('0x19')],'rows':_0x5bc1e6});});},'WhatsappQueues':function(){return new Promise(function(_0x180616){var _0x2d023e=[];for(var _0x1d547c in _0x52d397[_0xb684('0x5a')]){if(_0x52d397['whatsappQueues']['hasOwnProperty'](_0x1d547c)){var _0x45c19e=_0x52d397['whatsappQueues'][_0x1d547c];var _0x55e06d={'id':_0x45c19e['id'],'available':_0x45c19e[_0xb684('0x51')],'loggedIn':_0x45c19e[_0xb684('0x55')],'name':_0x45c19e[_0xb684('0x52')],'paused':_0x45c19e[_0xb684('0x56')],'waiting':_0x45c19e[_0xb684('0x53')]};_0x2d023e[_0xb684('0x21')](_0x55e06d);}}_0x180616({'count':_0x2d023e[_0xb684('0x19')],'rows':_0x2d023e});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x22dc09){var _0x5974de=_[_0xb684('0x4e')](_0x52d397[_0xb684('0x5b')]);_0x22dc09({'count':_0x5974de['length'],'rows':_0x5974de});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x2e067a){var _0x1d79b7=_[_0xb684('0x4e')](_0x52d397[_0xb684('0x5c')]);_0x2e067a({'count':_0x1d79b7['length'],'rows':_0x1d79b7});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x25656d){var _0x13ba11=_[_0xb684('0x4e')](_0x52d397[_0xb684('0x5d')]);_0x25656d({'count':_0x13ba11[_0xb684('0x19')],'rows':_0x13ba11});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x4993a6){var _0x3e4166=_[_0xb684('0x4e')](_0x52d397[_0xb684('0x5e')]);_0x4993a6({'count':_0x3e4166[_0xb684('0x19')],'rows':_0x3e4166});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x33125e){var _0x2f7278=_[_0xb684('0x4e')](_0x52d397[_0xb684('0x5f')]);_0x33125e({'count':_0x2f7278[_0xb684('0x19')],'rows':_0x2f7278});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x13144c){var _0x3682d9=_[_0xb684('0x4e')](_0x52d397[_0xb684('0x60')]);_0x13144c({'count':_0x3682d9[_0xb684('0x19')],'rows':_0x3682d9});});}};var _0x21529b=jayson[_0xb684('0x61')](_0x1fd817)[_0xb684('0x62')]();_0x21529b['on'](_0xb684('0x32'),function(_0x4188e2){logger[_0xb684('0x32')](JSON[_0xb684('0x38')](_0x4188e2));return _0x3ede39(_0x4188e2);});_0x21529b['listen'](0x232c,_0xb684('0x63'),function(){console[_0xb684('0x64')]('Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232c);return _0x2a0bc3(_0xb684('0x65')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 3b22caa..78db2d0 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 _0xa2c3=['../../../config/logger','routing','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','map','info','join','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','\x20|\x20','stop','lodash','../../../utils/iftime','iftime'];(function(_0x2dea24,_0x2fc021){var _0x309d58=function(_0x2eb89f){while(--_0x2eb89f){_0x2dea24['push'](_0x2dea24['shift']());}};_0x309d58(++_0x2fc021);}(_0xa2c3,0x138));var _0x3a2c=function(_0x2dc786,_0x49378d){_0x2dc786=_0x2dc786-0x0;var _0x5f0e7e=_0xa2c3[_0x2dc786];return _0x5f0e7e;};'use strict';var _=require(_0x3a2c('0x0'));var iftime=require(_0x3a2c('0x1'))[_0x3a2c('0x2')];var logger=require(_0x3a2c('0x3'))(_0x3a2c('0x4'));exports[_0x3a2c('0x5')]=function(_0x38b5dc,_0x1afbf5,_0x51ddba){return function(_0x261979){if(_0x51ddba[_0x3a2c('0x6')]&&!_0x51ddba[_0x3a2c('0x6')][_0x38b5dc]){logger['info'](_0x3a2c('0x7'),_0x38b5dc);return _0x261979['stop']();}var _0x31aaf0=_0x1afbf5[_0x3a2c('0x8')](function(_0x51208f){return iftime(_0x51208f);});var _0x375929=_['some'](_0x31aaf0);if(_0x375929){logger[_0x3a2c('0x9')]('[%s][INTERVAL\x20VALID]\x20%s\x20%s',_0x38b5dc,_0x1afbf5[_0x3a2c('0xa')]('\x20|\x20'),_0x375929);_0x261979[_0x3a2c('0xb')](_0x375929);}else{logger[_0x3a2c('0x9')](_0x3a2c('0xc'),_0x38b5dc,_0x1afbf5['join'](_0x3a2c('0xd')));_0x261979[_0x3a2c('0xe')]();}};}; \ No newline at end of file +var _0x1571=['map','some','[%s][INTERVAL\x20VALID]\x20%s\x20%s','join','\x20|\x20','when','[%s][INTERVAL\x20NOT\x20VALID]\x20%s\x20%s','lodash','../../../utils/iftime','iftime','../../../config/logger','routing','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop'];(function(_0x276cfd,_0x177ed5){var _0x5a05e6=function(_0x1f9d1d){while(--_0x1f9d1d){_0x276cfd['push'](_0x276cfd['shift']());}};_0x5a05e6(++_0x177ed5);}(_0x1571,0x18e));var _0x1157=function(_0x179b80,_0x440291){_0x179b80=_0x179b80-0x0;var _0x1e8d03=_0x1571[_0x179b80];return _0x1e8d03;};'use strict';var _=require(_0x1157('0x0'));var iftime=require(_0x1157('0x1'))[_0x1157('0x2')];var logger=require(_0x1157('0x3'))(_0x1157('0x4'));exports[_0x1157('0x5')]=function(_0x47377a,_0x4be1ca,_0x3b5d7e){return function(_0x24ee2a){if(_0x3b5d7e[_0x1157('0x6')]&&!_0x3b5d7e['rules'][_0x47377a]){logger[_0x1157('0x7')](_0x1157('0x8'),_0x47377a);return _0x24ee2a[_0x1157('0x9')]();}var _0x45322b=_0x4be1ca[_0x1157('0xa')](function(_0x3ddec5){return iftime(_0x3ddec5);});var _0x2ff034=_[_0x1157('0xb')](_0x45322b);if(_0x2ff034){logger[_0x1157('0x7')](_0x1157('0xc'),_0x47377a,_0x4be1ca[_0x1157('0xd')](_0x1157('0xe')),_0x2ff034);_0x24ee2a[_0x1157('0xf')](_0x2ff034);}else{logger[_0x1157('0x7')](_0x1157('0x10'),_0x47377a,_0x4be1ca[_0x1157('0xd')](_0x1157('0xe')));_0x24ee2a[_0x1157('0x9')]();}};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 7bed601..6e43ad6 100644 --- a/server/services/xdr/agents.controller.js +++ b/server/services/xdr/agents.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb9a7=['connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diffTime','complete','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','ATTENDED','transfereeuniqueid','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','agentcompleteAt','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','then','agentacw','agentcomplete','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalled','debug','format','agentcalledAt','now','called','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','[%s][agents][agentcalled]','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','ringtime','talktime','queuecallerabandon','forIn','includes','agentringnoanswerAt','abandoned','holdtime','[%s][agents][queuecallerabandon]','agentconnect','agentconnectAt','connectedlinename'];(function(_0x1287f4,_0x2cf7e3){var _0x1da28=function(_0x72dab8){while(--_0x72dab8){_0x1287f4['push'](_0x1287f4['shift']());}};_0x1da28(++_0x2cf7e3);}(_0xb9a7,0x112));var _0x7b9a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xb9a7[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x563857,_0x5f1a52){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x2'),_0x563857[_0x7b9a('0x3')],_0x563857[_0x7b9a('0x4')],_0x563857[_0x7b9a('0x5')],_0x563857[_0x7b9a('0x6')],_0x563857[_0x7b9a('0x7')],_0x563857[_0x7b9a('0x8')],_0x563857[_0x7b9a('0x9')],_0x563857[_0x7b9a('0xa')]));if(_0x563857[_0x7b9a('0x5')]){utils['getVoiceQueueByName'](_0x563857[_0x7b9a('0x5')])[_0x7b9a('0xb')](function(_0x56a199){if(_0x56a199){_0x563857['type']=_0x56a199['type'];_0x563857[_0x7b9a('0xc')]=_0x563857[_0x7b9a('0xd')]?_0x56a199['acw']:![];_0x563857[_0x7b9a('0xe')]=_0x563857['agentacw']?_0x56a199[_0x7b9a('0xf')]:0x0;}utils['request'](_0x7b9a('0x10'),_0x563857);});}else{utils[_0x7b9a('0x11')](_0x7b9a('0x10'),_0x563857);}if(_0x5f1a52){delete transfers[_0x563857['uniqueid']];}else{delete agents[_0x563857[_0x7b9a('0x12')]];}}exports[_0x7b9a('0x13')]=function(_0x5e3875){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentcalled]',_0x5e3875[_0x7b9a('0x3')]),_0x5e3875);agents[_0x5e3875[_0x7b9a('0x12')]]=_0x5e3875;agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x18');agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinenum']=null;agents[_0x5e3875[_0x7b9a('0x12')]]['connectedlinename']=null;utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x19'),_0x5e3875[_0x7b9a('0x3')],agents[_0x5e3875[_0x7b9a('0x12')]][_0x7b9a('0x6')],_0x5e3875[_0x7b9a('0x12')]));}catch(_0x283cc3){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x1b'),_0x5e3875[_0x7b9a('0x3')]),_0x283cc3);}};exports[_0x7b9a('0x1c')]=function(_0x58aed7){try{if(!_[_0x7b9a('0x1d')](agents[_0x58aed7['destuniqueid']])){utils[_0x7b9a('0x14')](util['format'](_0x7b9a('0x1e'),_0x58aed7[_0x7b9a('0x3')]),_0x58aed7);utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x1f'),_0x58aed7[_0x7b9a('0x3')],agents[_0x58aed7['destuniqueid']][_0x7b9a('0x6')],_0x58aed7[_0x7b9a('0x12')]));agents[_0x58aed7[_0x7b9a('0x12')]][_0x7b9a('0x1c')]=!![];agents[_0x58aed7[_0x7b9a('0x12')]]['agentringnoanswerAt']=utils[_0x7b9a('0x17')]();agents[_0x58aed7[_0x7b9a('0x12')]]['lastevent']=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']][_0x7b9a('0x21')]=_0x7b9a('0x20');agents[_0x58aed7['destuniqueid']]['holdtime']=_0x58aed7[_0x7b9a('0x22')]?parseInt(_0x58aed7['ringtime'])/0x3e8:0x0;agents[_0x58aed7['destuniqueid']][_0x7b9a('0x23')]=0x0;unanswered['push'](_0x58aed7['destuniqueid']);}}catch(_0x3847b4){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x1e'),_0x58aed7['uniqueid']),_0x3847b4);}};exports[_0x7b9a('0x24')]=function(_0x2e6144){try{_[_0x7b9a('0x25')](agents,function(_0x5b64d7,_0x45ccf5){if(_0x5b64d7[_0x7b9a('0x3')]==_0x2e6144[_0x7b9a('0x3')]&&!_[_0x7b9a('0x26')](unanswered,_0x5b64d7[_0x7b9a('0x12')])){utils[_0x7b9a('0x14')](util['format']('[%s][agents][queuecallerabandon]',_0x2e6144[_0x7b9a('0x3')]),_0x2e6144);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x2e6144[_0x7b9a('0x3')],_0x5b64d7[_0x7b9a('0x6')],_0x5b64d7['destuniqueid']));_0x5b64d7['agentringnoanswer']=!![];_0x5b64d7[_0x7b9a('0x27')]=utils[_0x7b9a('0x17')]();_0x5b64d7['lastevent']=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x21')]=_0x7b9a('0x28');_0x5b64d7[_0x7b9a('0x29')]=_0x2e6144[_0x7b9a('0x29')];_0x5b64d7['talktime']=0x0;writeDB(_0x5b64d7);}});}catch(_0x46bcd0){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x2a'),_0x2e6144[_0x7b9a('0x3')]),_0x46bcd0);}};exports[_0x7b9a('0x2b')]=function(_0x5f1da4){try{if(agents[_0x5f1da4['destuniqueid']]){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]',_0x5f1da4[_0x7b9a('0x3')]),_0x5f1da4);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x5f1da4[_0x7b9a('0x3')],agents[_0x5f1da4[_0x7b9a('0x12')]]['membername'],_0x5f1da4['destuniqueid']));agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2c')]=utils[_0x7b9a('0x17')]();agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x9')]=_0x5f1da4[_0x7b9a('0x9')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0x2d')]=_0x5f1da4['connectedlinename'];agents[_0x5f1da4[_0x7b9a('0x12')]]['holdtime']=_0x5f1da4[_0x7b9a('0x22')];agents[_0x5f1da4[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x2e');_[_0x7b9a('0x25')](agents,function(_0x89951b,_0x5e504f){if(_0x89951b[_0x7b9a('0x12')]!=_0x5f1da4[_0x7b9a('0x12')]&&_0x89951b[_0x7b9a('0x3')]==_0x5f1da4[_0x7b9a('0x3')]){_0x89951b['talktime']=0x0;_0x89951b[_0x7b9a('0x29')]=_0x5f1da4[_0x7b9a('0x22')];_0x89951b[_0x7b9a('0x1c')]=!![];_0x89951b[_0x7b9a('0x27')]=utils['now']();_0x89951b[_0x7b9a('0xa')]='answered_elsewhere';_0x89951b[_0x7b9a('0x21')]=_0x7b9a('0x2f');_0x89951b[_0x7b9a('0x30')]=_0x5f1da4[_0x7b9a('0x12')];_0x89951b[_0x7b9a('0x31')]=_0x5f1da4[_0x7b9a('0x6')];writeDB(_0x89951b);}});}}catch(_0x56e274){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x32'),_0x5f1da4['uniqueid']),_0x56e274);}};exports['agentcomplete']=function(_0x3724fe){try{if(!_[_0x7b9a('0x1d')](agents[_0x3724fe[_0x7b9a('0x12')]])){utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe['uniqueid']),_0x3724fe);utils['info'](util['format'](_0x7b9a('0x34'),_0x3724fe[_0x7b9a('0x3')],agents[_0x3724fe['destuniqueid']][_0x7b9a('0x6')],_0x3724fe[_0x7b9a('0x12')]));agents[_0x3724fe[_0x7b9a('0x12')]]['agentcomplete']=!![];agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt']=utils[_0x7b9a('0x17')]();agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](agents[_0x3724fe[_0x7b9a('0x12')]]['agentcompleteAt'],agents[_0x3724fe[_0x7b9a('0x12')]]['agentconnectAt']);agents[_0x3724fe[_0x7b9a('0x12')]]['reason']=_0x3724fe['reason'];agents[_0x3724fe[_0x7b9a('0x12')]][_0x7b9a('0xa')]=_0x7b9a('0x36');writeDB(agents[_0x3724fe[_0x7b9a('0x12')]]);}}catch(_0x1cbd5a){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')](_0x7b9a('0x33'),_0x3724fe[_0x7b9a('0x3')]),_0x1cbd5a);}};exports['blindtransfer']=function(_0x1d7957){try{if(!_[_0x7b9a('0x1d')](agents[_0x1d7957['transfereruniqueid']])){utils['debug'](util['format'](_0x7b9a('0x37'),_0x1d7957[_0x7b9a('0x3')]),_0x1d7957);utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x1d7957[_0x7b9a('0x3')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x6')],agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')]));agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x39')]=!![];agents[_0x1d7957['transfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x3b');agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3c')]=_0x1d7957['extension'];agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3d')]=agents[_0x1d7957[_0x7b9a('0x38')]][_0x7b9a('0x3')];}}catch(_0x2b0db5){utils[_0x7b9a('0x1a')](util[_0x7b9a('0x15')]('[%s][agents][blindtransfer]',_0x1d7957['uniqueid']),_0x2b0db5);}};exports['attendedtransfer']=function(_0x12c5bf){try{utils[_0x7b9a('0x14')](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf['origtransfereruniqueid']),_0x12c5bf);if(_0x12c5bf['origtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x3e')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf[_0x7b9a('0x3f')]])){utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x40'),_0x12c5bf[_0x7b9a('0x41')],agents[_0x12c5bf[_0x7b9a('0x3f')]]['membername']));agents[_0x12c5bf[_0x7b9a('0x3f')]]['transfer']=!![];agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x3c')]=_0x12c5bf['origtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x3f')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x41')];}if(_0x12c5bf[_0x7b9a('0x43')]&&agents[_0x12c5bf[_0x7b9a('0x43')]]){agents[_0x12c5bf['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfereeuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x43')]]);transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x8')]=agents[_0x12c5bf['secondtransfereruniqueid']][_0x7b9a('0x8')];transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x44')]=agents[_0x12c5bf[_0x7b9a('0x3f')]][_0x7b9a('0x44')];transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x16')]=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x43')]]['agentconnectAt']=utils['now']();transfers[_0x12c5bf['transfereeuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x43')]][_0x7b9a('0x45')]=0x2;}}else if(_0x12c5bf['secondtransfereruniqueid']==_0x12c5bf[_0x7b9a('0x46')]){if(!_[_0x7b9a('0x1d')](agents[_0x12c5bf['origtransfereruniqueid']])){utils[_0x7b9a('0x1')](util['format'](_0x7b9a('0x40'),_0x12c5bf['origtransfereruniqueid'],agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x6')]));agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x39')]=!![];agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x3a')]=_0x7b9a('0x42');agents[_0x12c5bf[_0x7b9a('0x41')]][_0x7b9a('0x3c')]=_0x12c5bf['secondtransfererexten'];agents[_0x12c5bf[_0x7b9a('0x41')]]['transferuniqueid']=_0x12c5bf[_0x7b9a('0x3f')];}if(_0x12c5bf['transfertargetuniqueid']&&agents[_0x12c5bf[_0x7b9a('0x47')]]){agents[_0x12c5bf['transfertargetuniqueid']]['agententerreason']=0x1;transfers[_0x12c5bf['transfertargetuniqueid']]=_['clone'](agents[_0x12c5bf[_0x7b9a('0x47')]]);transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x8')]=agents[_0x12c5bf[_0x7b9a('0x41')]]['calleridnum'];transfers[_0x12c5bf[_0x7b9a('0x47')]]['calleridname']=agents[_0x12c5bf['origtransfereruniqueid']][_0x7b9a('0x44')];transfers[_0x12c5bf['transfertargetuniqueid']]['agentcalledAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf[_0x7b9a('0x47')]]['agentconnectAt']=utils[_0x7b9a('0x17')]();transfers[_0x12c5bf['transfertargetuniqueid']][_0x7b9a('0x29')]=0x0;transfers[_0x12c5bf[_0x7b9a('0x47')]][_0x7b9a('0x45')]=0x2;}}}catch(_0x5118b3){utils['error'](util['format']('[%s][agents][attendedtransfer]',_0x12c5bf[_0x7b9a('0x41')]),_0x5118b3);}};exports[_0x7b9a('0x48')]=function(_0x3fd697){try{utils[_0x7b9a('0x14')](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3fd697);if(agents[_0x3fd697['uniqueid']]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]==='timeout'){if(_0x3fd697[_0x7b9a('0x4a')]==='21'){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='rejected';agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x4b');}utils['info'](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x21')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);var _0x2090ef=unanswered['indexOf'](_0x3fd697['uniqueid']);if(_0x2090ef>-0x1){unanswered[_0x7b9a('0x4c')](_0x2090ef,0x1);}}if(transfers[_0x3fd697[_0x7b9a('0x3')]]){transfers[_0x3fd697['uniqueid']][_0x7b9a('0xd')]=!![];transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')]=utils['now']();transfers[_0x3fd697['uniqueid']][_0x7b9a('0x23')]=utils[_0x7b9a('0x35')](transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],transfers[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]='agent';transfers[_0x3fd697['uniqueid']][_0x7b9a('0xa')]=_0x7b9a('0x36');utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x3fd697[_0x7b9a('0x3')],transfers[_0x3fd697[_0x7b9a('0x3')]]['membername'],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],transfers[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]));writeDB(transfers[_0x3fd697[_0x7b9a('0x3')]],!![]);}if(agents[_0x3fd697[_0x7b9a('0x3')]]&&agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x2c')]){agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xd')]=!![];agents[_0x3fd697[_0x7b9a('0x3')]]['agentcompleteAt']=utils['now']();agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x23')]=utils['diffTime'](agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x4d')],agents[_0x3fd697['uniqueid']][_0x7b9a('0x2c')]);agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')]=agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x39')]?_0x7b9a('0x39'):_0x7b9a('0x4e');agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0xa')]='complete';utils[_0x7b9a('0x1')](util[_0x7b9a('0x15')](_0x7b9a('0x4f'),_0x3fd697[_0x7b9a('0x3')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x6')],agents[_0x3fd697[_0x7b9a('0x3')]][_0x7b9a('0x21')],agents[_0x3fd697['uniqueid']][_0x7b9a('0xa')]));writeDB(agents[_0x3fd697[_0x7b9a('0x3')]]);}}catch(_0x3022e0){utils['error'](util[_0x7b9a('0x15')](_0x7b9a('0x49'),_0x3fd697[_0x7b9a('0x3')]),_0x3022e0);}}; \ No newline at end of file +var _0x0102=['agentringnoanswerAt','now','reason','timeout','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','ATTENDED','transferexten','origtransfererexten','transfereeuniqueid','agententerreason','calleridname','transfertargetuniqueid','clone','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','util','./utils','queue','membername','interface','calleridnum','lastevent','getVoiceQueueByName','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','format','[%s][agents][agentcalled]','agentcalledAt','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','isNil','debug','[%s][agents][agentringnoanswer]'];(function(_0x41c773,_0x19f46d){var _0xf1e7d2=function(_0x4d1be5){while(--_0x4d1be5){_0x41c773['push'](_0x41c773['shift']());}};_0xf1e7d2(++_0x19f46d);}(_0x0102,0x186));var _0x2010=function(_0x3b751f,_0x51d8e5){_0x3b751f=_0x3b751f-0x0;var _0x2a01c3=_0x0102[_0x3b751f];return _0x2a01c3;};'use strict';var _=require('lodash');var util=require(_0x2010('0x0'));var utils=require(_0x2010('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x34c31e,_0x9ae519){utils['info'](util['format']('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x34c31e['uniqueid'],_0x34c31e['channel'],_0x34c31e[_0x2010('0x2')],_0x34c31e[_0x2010('0x3')],_0x34c31e[_0x2010('0x4')],_0x34c31e[_0x2010('0x5')],_0x34c31e['connectedlinenum'],_0x34c31e[_0x2010('0x6')]));if(_0x34c31e['queue']){utils[_0x2010('0x7')](_0x34c31e[_0x2010('0x2')])['then'](function(_0x1f94ca){if(_0x1f94ca){_0x34c31e[_0x2010('0x8')]=_0x1f94ca[_0x2010('0x8')];_0x34c31e[_0x2010('0x9')]=_0x34c31e[_0x2010('0xa')]?_0x1f94ca[_0x2010('0xb')]:![];_0x34c31e[_0x2010('0xc')]=_0x34c31e[_0x2010('0x9')]?_0x1f94ca[_0x2010('0xd')]:0x0;}utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);});}else{utils[_0x2010('0xe')](_0x2010('0xf'),_0x34c31e);}if(_0x9ae519){delete transfers[_0x34c31e[_0x2010('0x10')]];}else{delete agents[_0x34c31e[_0x2010('0x11')]];}}exports[_0x2010('0x12')]=function(_0x528a38){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38[_0x2010('0x10')]),_0x528a38);agents[_0x528a38[_0x2010('0x11')]]=_0x528a38;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x15')]=utils['now']();agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x6')]='called';agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x16')]=null;agents[_0x528a38[_0x2010('0x11')]][_0x2010('0x17')]=null;utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x19'),_0x528a38[_0x2010('0x10')],agents[_0x528a38[_0x2010('0x11')]]['membername'],_0x528a38['destuniqueid']));}catch(_0x3c72a8){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x14'),_0x528a38['uniqueid']),_0x3c72a8);}};exports['agentringnoanswer']=function(_0x22c252){try{if(!_[_0x2010('0x1b')](agents[_0x22c252[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x1d'),_0x22c252['uniqueid']),_0x22c252);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x22c252['uniqueid'],agents[_0x22c252['destuniqueid']][_0x2010('0x3')],_0x22c252['destuniqueid']));agents[_0x22c252[_0x2010('0x11')]]['agentringnoanswer']=!![];agents[_0x22c252['destuniqueid']][_0x2010('0x1e')]=utils[_0x2010('0x1f')]();agents[_0x22c252['destuniqueid']][_0x2010('0x6')]='timeout';agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x20')]=_0x2010('0x21');agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x22')]=_0x22c252[_0x2010('0x23')]?parseInt(_0x22c252[_0x2010('0x23')])/0x3e8:0x0;agents[_0x22c252[_0x2010('0x11')]][_0x2010('0x24')]=0x0;unanswered[_0x2010('0x25')](_0x22c252[_0x2010('0x11')]);}}catch(_0x2ebdbb){utils['error'](util[_0x2010('0x13')]('[%s][agents][agentringnoanswer]',_0x22c252[_0x2010('0x10')]),_0x2ebdbb);}};exports[_0x2010('0x26')]=function(_0xd16c04){try{_[_0x2010('0x27')](agents,function(_0x564a64,_0x554f66){if(_0x564a64[_0x2010('0x10')]==_0xd16c04['uniqueid']&&!_[_0x2010('0x28')](unanswered,_0x564a64[_0x2010('0x11')])){utils['debug'](util[_0x2010('0x13')](_0x2010('0x29'),_0xd16c04[_0x2010('0x10')]),_0xd16c04);utils[_0x2010('0x18')](util[_0x2010('0x13')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0xd16c04[_0x2010('0x10')],_0x564a64[_0x2010('0x3')],_0x564a64[_0x2010('0x11')]));_0x564a64['agentringnoanswer']=!![];_0x564a64['agentringnoanswerAt']=utils[_0x2010('0x1f')]();_0x564a64[_0x2010('0x6')]=_0x2010('0x2a');_0x564a64['reason']='abandoned';_0x564a64[_0x2010('0x22')]=_0xd16c04[_0x2010('0x22')];_0x564a64[_0x2010('0x24')]=0x0;writeDB(_0x564a64);}});}catch(_0x339fd2){utils[_0x2010('0x1a')](util['format']('[%s][agents][queuecallerabandon]',_0xd16c04['uniqueid']),_0x339fd2);}};exports[_0x2010('0x2b')]=function(_0x447eed){try{if(agents[_0x447eed[_0x2010('0x11')]]){utils['debug'](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x447eed);utils[_0x2010('0x18')](util['format'](_0x2010('0x2d'),_0x447eed[_0x2010('0x10')],agents[_0x447eed[_0x2010('0x11')]]['membername'],_0x447eed[_0x2010('0x11')]));agents[_0x447eed['destuniqueid']][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x16')]=_0x447eed[_0x2010('0x16')];agents[_0x447eed[_0x2010('0x11')]]['connectedlinename']=_0x447eed[_0x2010('0x17')];agents[_0x447eed['destuniqueid']][_0x2010('0x22')]=_0x447eed[_0x2010('0x23')];agents[_0x447eed[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x2f');_[_0x2010('0x27')](agents,function(_0x398f10,_0x36ff3e){if(_0x398f10[_0x2010('0x11')]!=_0x447eed[_0x2010('0x11')]&&_0x398f10[_0x2010('0x10')]==_0x447eed[_0x2010('0x10')]){_0x398f10[_0x2010('0x24')]=0x0;_0x398f10[_0x2010('0x22')]=_0x447eed['ringtime'];_0x398f10['agentringnoanswer']=!![];_0x398f10[_0x2010('0x1e')]=utils[_0x2010('0x1f')]();_0x398f10[_0x2010('0x6')]=_0x2010('0x30');_0x398f10[_0x2010('0x20')]=_0x2010('0x30');_0x398f10[_0x2010('0x31')]=_0x447eed['destuniqueid'];_0x398f10[_0x2010('0x32')]=_0x447eed['membername'];writeDB(_0x398f10);}});}}catch(_0x27fd64){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x2c'),_0x447eed[_0x2010('0x10')]),_0x27fd64);}};exports['agentcomplete']=function(_0x364338){try{if(!_[_0x2010('0x1b')](agents[_0x364338[_0x2010('0x11')]])){utils[_0x2010('0x1c')](util['format'](_0x2010('0x33'),_0x364338['uniqueid']),_0x364338);utils['info'](util['format'](_0x2010('0x34'),_0x364338[_0x2010('0x10')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x3')],_0x364338[_0x2010('0x11')]));agents[_0x364338[_0x2010('0x11')]]['agentcomplete']=!![];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();agents[_0x364338['destuniqueid']]['talktime']=utils[_0x2010('0x36')](agents[_0x364338['destuniqueid']][_0x2010('0x35')],agents[_0x364338[_0x2010('0x11')]][_0x2010('0x2e')]);agents[_0x364338[_0x2010('0x11')]]['reason']=_0x364338[_0x2010('0x20')];agents[_0x364338[_0x2010('0x11')]][_0x2010('0x6')]=_0x2010('0x37');writeDB(agents[_0x364338[_0x2010('0x11')]]);}}catch(_0x2a53b3){utils['error'](util[_0x2010('0x13')](_0x2010('0x33'),_0x364338[_0x2010('0x10')]),_0x2a53b3);}};exports['blindtransfer']=function(_0x30e5d0){try{if(!_[_0x2010('0x1b')](agents[_0x30e5d0['transfereruniqueid']])){utils[_0x2010('0x1c')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x30e5d0);utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x39'),_0x30e5d0[_0x2010('0x10')],agents[_0x30e5d0['transfereruniqueid']]['membername'],agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')]));agents[_0x30e5d0['transfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3c')]=_0x2010('0x3d');agents[_0x30e5d0[_0x2010('0x3a')]]['transferexten']=_0x30e5d0['extension'];agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x3e')]=agents[_0x30e5d0[_0x2010('0x3a')]][_0x2010('0x10')];}}catch(_0x38e596){utils[_0x2010('0x1a')](util[_0x2010('0x13')](_0x2010('0x38'),_0x30e5d0[_0x2010('0x10')]),_0x38e596);}};exports[_0x2010('0x3f')]=function(_0x1cc164){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x40'),_0x1cc164['origtransfereruniqueid']),_0x1cc164);if(_0x1cc164[_0x2010('0x41')]==_0x1cc164[_0x2010('0x42')]){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x43')]])){utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3')]));agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3b')]=!![];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x46')]=_0x1cc164[_0x2010('0x47')];agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x3e')]=_0x1cc164[_0x2010('0x41')];}if(_0x1cc164[_0x2010('0x48')]&&agents[_0x1cc164[_0x2010('0x48')]]){agents[_0x1cc164['transfereeuniqueid']][_0x2010('0x49')]=0x1;transfers[_0x1cc164['transfereeuniqueid']]=_['clone'](agents[_0x1cc164[_0x2010('0x48')]]);transfers[_0x1cc164[_0x2010('0x48')]]['calleridnum']=agents[_0x1cc164[_0x2010('0x43')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x4a')]=agents[_0x1cc164['secondtransfereruniqueid']][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x15')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164['transfereeuniqueid']][_0x2010('0x2e')]=utils['now']();transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x48')]][_0x2010('0x49')]=0x2;}}else if(_0x1cc164['secondtransfereruniqueid']==_0x1cc164['secondtransfererlinkedid']){if(!_[_0x2010('0x1b')](agents[_0x1cc164[_0x2010('0x41')]])){utils['info'](util['format'](_0x2010('0x44'),_0x1cc164[_0x2010('0x41')],agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3')]));agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3b')]=!![];agents[_0x1cc164['origtransfereruniqueid']][_0x2010('0x3c')]=_0x2010('0x45');agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x46')]=_0x1cc164['secondtransfererexten'];agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x3e')]=_0x1cc164['secondtransfereruniqueid'];}if(_0x1cc164[_0x2010('0x4b')]&&agents[_0x1cc164[_0x2010('0x4b')]]){agents[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x49')]=0x1;transfers[_0x1cc164[_0x2010('0x4b')]]=_[_0x2010('0x4c')](agents[_0x1cc164[_0x2010('0x4b')]]);transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x5')]=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x5')];transfers[_0x1cc164[_0x2010('0x4b')]]['calleridname']=agents[_0x1cc164[_0x2010('0x41')]][_0x2010('0x4a')];transfers[_0x1cc164[_0x2010('0x4b')]]['agentcalledAt']=utils['now']();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x2e')]=utils[_0x2010('0x1f')]();transfers[_0x1cc164[_0x2010('0x4b')]][_0x2010('0x22')]=0x0;transfers[_0x1cc164[_0x2010('0x4b')]]['agententerreason']=0x2;}}}catch(_0xe37cef){utils[_0x2010('0x1a')](util[_0x2010('0x13')]('[%s][agents][attendedtransfer]',_0x1cc164[_0x2010('0x41')]),_0xe37cef);}};exports[_0x2010('0x4d')]=function(_0x13d06d){try{utils['debug'](util[_0x2010('0x13')](_0x2010('0x4e'),_0x13d06d['uniqueid']),_0x13d06d);if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]]['reason']==='timeout'){if(_0x13d06d[_0x2010('0x4f')]==='21'){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')]=_0x2010('0x50');agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x50');}utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3')],agents[_0x13d06d['uniqueid']][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d[_0x2010('0x10')]]);var _0x517afa=unanswered[_0x2010('0x52')](_0x13d06d[_0x2010('0x10')]);if(_0x517afa>-0x1){unanswered['splice'](_0x517afa,0x1);}}if(transfers[_0x13d06d['uniqueid']]){transfers[_0x13d06d[_0x2010('0x10')]]['agentcomplete']=!![];transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x35')]=utils[_0x2010('0x1f')]();transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x24')]=utils[_0x2010('0x36')](transfers[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]);transfers[_0x13d06d[_0x2010('0x10')]]['reason']=_0x2010('0x53');transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d[_0x2010('0x10')],transfers[_0x13d06d['uniqueid']][_0x2010('0x3')],transfers[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],transfers[_0x13d06d['uniqueid']][_0x2010('0x6')]));writeDB(transfers[_0x13d06d[_0x2010('0x10')]],!![]);}if(agents[_0x13d06d['uniqueid']]&&agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x2e')]){agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0xa')]=!![];agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt']=utils[_0x2010('0x1f')]();agents[_0x13d06d[_0x2010('0x10')]]['talktime']=utils[_0x2010('0x36')](agents[_0x13d06d[_0x2010('0x10')]]['agentcompleteAt'],agents[_0x13d06d[_0x2010('0x10')]]['agentconnectAt']);agents[_0x13d06d['uniqueid']][_0x2010('0x20')]=agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x3b')]?_0x2010('0x3b'):_0x2010('0x53');agents[_0x13d06d[_0x2010('0x10')]]['lastevent']=_0x2010('0x37');utils[_0x2010('0x18')](util[_0x2010('0x13')](_0x2010('0x51'),_0x13d06d['uniqueid'],agents[_0x13d06d[_0x2010('0x10')]]['membername'],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x20')],agents[_0x13d06d[_0x2010('0x10')]][_0x2010('0x6')]));writeDB(agents[_0x13d06d['uniqueid']]);}}catch(_0x496280){utils['error'](util[_0x2010('0x13')]('[%s][agents][hangup]',_0x13d06d[_0x2010('0x10')]),_0x496280);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index db91212..d2fec54 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 _0x56bf=['[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','lastdata','xmd-contactid','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','[%s][calls][newexten]','util','FAILED','NO\x20ANSWER','ANSWERED','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','accountcode','getUserByInternal','request','CreateVoiceCallReport','debug','format','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','calleridnum','context','now','DOCUMENTATION','error','[%s][calls][newchannel]','newstate','[%s][calls][newstate]','isNil','channelstate','transfer','answertime','disposition','hangup','[%s][calls][hangup]','callerid','calleridname','cause-txt','endtime','duration','diffTime','billableseconds','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','destinationchannel','userfield','_attended','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid'];(function(_0x374ba3,_0x4af646){var _0x51d852=function(_0x131009){while(--_0x131009){_0x374ba3['push'](_0x374ba3['shift']());}};_0x51d852(++_0x4af646);}(_0x56bf,0x1b0));var _0xf56b=function(_0x2bbc07,_0x1e2168){_0x2bbc07=_0x2bbc07-0x0;var _0x6879e4=_0x56bf[_0x2bbc07];return _0x6879e4;};'use strict';var _=require('lodash');var util=require(_0xf56b('0x0'));var utils=require('./utils');var dispositions=['NO\x20ANSWER',_0xf56b('0x1'),_0xf56b('0x1'),'NO\x20ANSWER',_0xf56b('0x2'),_0xf56b('0x2'),_0xf56b('0x3'),'BUSY',_0xf56b('0x1'),_0xf56b('0x1'),_0xf56b('0x1')];var channels={};function writeDB(_0xdd45c1){utils[_0xf56b('0x4')](util['format'](_0xf56b('0x5'),_0xdd45c1[_0xf56b('0x6')],_0xdd45c1[_0xf56b('0x7')],_0xdd45c1[_0xf56b('0x8')],_0xdd45c1[_0xf56b('0x9')],_0xdd45c1[_0xf56b('0xa')],_0xdd45c1['calleridnum'],_0xdd45c1[_0xf56b('0xb')],_0xdd45c1['lastevent']));if(_0xdd45c1[_0xf56b('0xc')]){utils[_0xf56b('0xd')](_0xdd45c1['accountcode'])['then'](function(_0x42e7c7){if(_0x42e7c7){_0xdd45c1['UserId']=_0x42e7c7['id'];}utils[_0xf56b('0xe')](_0xf56b('0xf'),_0xdd45c1);});}else{utils['request'](_0xf56b('0xf'),_0xdd45c1);}if(channels[_0xdd45c1[_0xf56b('0x6')]]){delete channels[_0xdd45c1[_0xf56b('0x6')]];}}exports['newchannel']=function(_0x343458){try{utils[_0xf56b('0x10')](util[_0xf56b('0x11')]('[%s][calls][newchannel]',_0x343458[_0xf56b('0x6')]),_0x343458);if(_0x343458[_0xf56b('0x6')]==_0x343458[_0xf56b('0x12')]&&_0x343458[_0xf56b('0x7')]!=_0xf56b('0x13')){utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x14'),_0x343458[_0xf56b('0x6')],_0x343458['context'],_0x343458[_0xf56b('0x15')]));channels[_0x343458[_0xf56b('0x6')]]={'uniqueid':_0x343458[_0xf56b('0x6')],'accountcode':_0x343458[_0xf56b('0xc')],'source':_0x343458[_0xf56b('0x16')],'destination':_0x343458['exten'],'destinationcontext':_0x343458[_0xf56b('0x17')],'channel':_0x343458[_0xf56b('0x7')],'starttime':utils[_0xf56b('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xf56b('0x2'),'amaflags':_0xf56b('0x19')};}}catch(_0x16c849){utils[_0xf56b('0x1a')](util['format'](_0xf56b('0x1b'),_0x343458[_0xf56b('0x6')]),_0x16c849);}};exports[_0xf56b('0x1c')]=function(_0x1684d){try{utils[_0xf56b('0x10')](util[_0xf56b('0x11')](_0xf56b('0x1d'),_0x1684d['uniqueid']),_0x1684d);if(!_[_0xf56b('0x1e')](channels[_0x1684d[_0xf56b('0x6')]])&&_0x1684d[_0xf56b('0x1f')]==0x6){utils[_0xf56b('0x4')](util[_0xf56b('0x11')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x1684d['uniqueid'],_0x1684d[_0xf56b('0x17')],_0x1684d['channel']));if(_[_0xf56b('0x1e')](channels[_0x1684d[_0xf56b('0x6')]]['systemanswertime'])){channels[_0x1684d['uniqueid']]['systemanswertime']=utils['now']();}}else if(!_[_0xf56b('0x1e')](channels[_0x1684d[_0xf56b('0x12')]])&&_0x1684d[_0xf56b('0x1f')]==0x6&&_0x1684d[_0xf56b('0x17')]!=_0xf56b('0x20')){utils[_0xf56b('0x4')](util[_0xf56b('0x11')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x1684d[_0xf56b('0x6')],_0x1684d[_0xf56b('0x12')],_0x1684d[_0xf56b('0x17')],_0x1684d[_0xf56b('0x7')]));channels[_0x1684d[_0xf56b('0x12')]][_0xf56b('0xc')]=_0x1684d[_0xf56b('0xc')];channels[_0x1684d[_0xf56b('0x12')]]['destinationchannel']=_0x1684d[_0xf56b('0x7')];if(_['isNil'](channels[_0x1684d[_0xf56b('0x12')]][_0xf56b('0x21')])){channels[_0x1684d[_0xf56b('0x12')]][_0xf56b('0x21')]=utils[_0xf56b('0x18')]();}channels[_0x1684d[_0xf56b('0x12')]][_0xf56b('0x22')]=dispositions[_['toNumber'](_0x1684d[_0xf56b('0x1f')])]||_0xf56b('0x3');}}catch(_0x365919){utils['error'](util[_0xf56b('0x11')]('[%s][calls][newstate]',_0x1684d[_0xf56b('0x6')]),_0x365919);}};exports[_0xf56b('0x23')]=function(_0x98d3b8){try{if(!_[_0xf56b('0x1e')](channels[_0x98d3b8[_0xf56b('0x6')]])){utils['debug'](util[_0xf56b('0x11')](_0xf56b('0x24'),_0x98d3b8[_0xf56b('0x6')]),_0x98d3b8);if(_[_0xf56b('0x1e')](channels[_0x98d3b8['uniqueid']][_0xf56b('0x25')])){channels[_0x98d3b8[_0xf56b('0x6')]]['callerid']=_0x98d3b8[_0xf56b('0x26')]+'\x20<'+_0x98d3b8[_0xf56b('0x16')]+'>';}utils[_0xf56b('0x4')](util[_0xf56b('0x11')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x98d3b8[_0xf56b('0x6')],channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x25')],_0x98d3b8[_0xf56b('0x27')]));channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x28')]=utils['now']();channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x29')]=utils[_0xf56b('0x2a')](channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x28')],channels[_0x98d3b8[_0xf56b('0x6')]]['starttime']);channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x2b')]=channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x21')]?utils[_0xf56b('0x2a')](channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x28')],channels[_0x98d3b8[_0xf56b('0x6')]][_0xf56b('0x21')]):0x0;writeDB(channels[_0x98d3b8[_0xf56b('0x6')]]);}}catch(_0x49d108){utils[_0xf56b('0x1a')](util[_0xf56b('0x11')](_0xf56b('0x24'),_0x98d3b8[_0xf56b('0x6')]),_0x49d108);}};exports[_0xf56b('0x2c')]=function(_0xa1c21e){try{if(!_[_0xf56b('0x1e')](channels[_0xa1c21e['localtwolinkedid']])){utils[_0xf56b('0x10')](util[_0xf56b('0x11')](_0xf56b('0x2d'),_0xa1c21e[_0xf56b('0x2e')]),_0xa1c21e);if(channels[_0xa1c21e['localtwolinkedid']]['channel']==_0xa1c21e[_0xf56b('0x2f')]){utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x30'),_0xa1c21e[_0xf56b('0x2e')],_0xa1c21e[_0xf56b('0x31')],_0xa1c21e[_0xf56b('0x32')]));channels[_0xa1c21e[_0xf56b('0x31')]][_0xf56b('0x33')]=_0xa1c21e[_0xf56b('0x32')];channels[_0xa1c21e[_0xf56b('0x31')]][_0xf56b('0x34')]=_0xf56b('0x35');}else if(channels[_0xa1c21e['localtwolinkedid']][_0xf56b('0x7')]=_0xa1c21e['transfertargetchannel']){utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x30'),_0xa1c21e['origtransfereruniqueid'],_0xa1c21e[_0xf56b('0x31')],_0xa1c21e[_0xf56b('0x36')]));channels[_0xa1c21e[_0xf56b('0x31')]][_0xf56b('0x33')]=_0xa1c21e[_0xf56b('0x36')];channels[_0xa1c21e[_0xf56b('0x31')]]['userfield']='_attended';}}}catch(_0x2263da){utils[_0xf56b('0x1a')](util[_0xf56b('0x11')](_0xf56b('0x2d'),_0xa1c21e[_0xf56b('0x2e')]),_0x2263da);}};exports[_0xf56b('0x37')]=function(_0x3a9dac){try{if(!_[_0xf56b('0x1e')](channels[_0x3a9dac[_0xf56b('0x6')]])){utils[_0xf56b('0x10')](util[_0xf56b('0x11')](_0xf56b('0x38'),_0x3a9dac[_0xf56b('0x6')]),_0x3a9dac);channels[_0x3a9dac[_0xf56b('0x6')]][_0xf56b('0x39')]=utils[_0xf56b('0x18')]();utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x3a'),_0x3a9dac[_0xf56b('0x6')],channels[_0x3a9dac[_0xf56b('0x6')]][_0xf56b('0x39')]));}}catch(_0x113e46){utils[_0xf56b('0x1a')](util[_0xf56b('0x11')](_0xf56b('0x38'),_0x3a9dac[_0xf56b('0x6')]),_0x113e46);}};exports[_0xf56b('0x3b')]=function(_0x505ede){try{if(!_[_0xf56b('0x1e')](channels[_0x505ede[_0xf56b('0x6')]])){utils[_0xf56b('0x10')](util[_0xf56b('0x11')](_0xf56b('0x3c'),_0x505ede['uniqueid']),_0x505ede);if(!_[_0xf56b('0x1e')](channels[_0x505ede['uniqueid']][_0xf56b('0x39')])){channels[_0x505ede[_0xf56b('0x6')]][_0xf56b('0x3d')]+=utils[_0xf56b('0x2a')](utils[_0xf56b('0x18')](),channels[_0x505ede['uniqueid']][_0xf56b('0x39')]);utils[_0xf56b('0x4')](util[_0xf56b('0x11')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x505ede[_0xf56b('0x6')],channels[_0x505ede[_0xf56b('0x6')]][_0xf56b('0x3d')]));delete channels[_0x505ede['uniqueid']][_0xf56b('0x39')];}}}catch(_0x4bac09){utils['error'](util[_0xf56b('0x11')](_0xf56b('0x3c'),_0x505ede[_0xf56b('0x6')]),_0x4bac09);}};exports[_0xf56b('0x3e')]=function(_0x1cdd90){try{if(!_[_0xf56b('0x1e')](channels[_0x1cdd90[_0xf56b('0x6')]])){utils[_0xf56b('0x10')](util[_0xf56b('0x11')](_0xf56b('0x3f'),_0x1cdd90[_0xf56b('0x6')]),_0x1cdd90);if(!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x41')])){utils[_0xf56b('0x4')](util['format'](_0xf56b('0x42'),_0x1cdd90[_0xf56b('0x6')],_0x1cdd90[_0xf56b('0x43')]));channels[_0x1cdd90['uniqueid']]['source']=_0x1cdd90[_0xf56b('0x43')];}if(!_['isNil'](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x44')])){utils[_0xf56b('0x4')](util['format'](_0xf56b('0x45'),_0x1cdd90[_0xf56b('0x6')],_0x1cdd90[_0xf56b('0x43')]));channels[_0x1cdd90[_0xf56b('0x6')]]['destination']=_0x1cdd90[_0xf56b('0x43')];channels[_0x1cdd90['uniqueid']]['callerid']='\x22'+_0x1cdd90['value']+_0xf56b('0x46')+_0x1cdd90['value']+'>';}if(!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x47')])||!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x48')])){utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x49'),_0x1cdd90[_0xf56b('0x6')],!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x47')])?'xmd-callerid-preview':'xmd-callerid',_0x1cdd90[_0xf56b('0x43')]));channels[_0x1cdd90[_0xf56b('0x6')]]['callerid']=_0x1cdd90['value'];}if(!_[_0xf56b('0x1e')](_0x1cdd90['variable'][_0xf56b('0x4a')])||!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x4b')])){utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x49'),_0x1cdd90[_0xf56b('0x6')],!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x4a')])?'xmd-queue':_0xf56b('0x4b'),_0x1cdd90[_0xf56b('0x43')]));channels[_0x1cdd90['uniqueid']][_0xf56b('0x4c')]='Queue';channels[_0x1cdd90[_0xf56b('0x6')]][_0xf56b('0x4d')]=_0x1cdd90[_0xf56b('0x43')];channels[_0x1cdd90[_0xf56b('0x6')]][_0xf56b('0x8')]=!![];}if(!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x4e')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x1cdd90['uniqueid'],_0x1cdd90[_0xf56b('0x43')]));channels[_0x1cdd90[_0xf56b('0x6')]]['ContactId']=_0x1cdd90[_0xf56b('0x43')];}if(!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x4f')])){utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x50'),_0x1cdd90['uniqueid'],_0x1cdd90[_0xf56b('0x43')]));channels[_0x1cdd90[_0xf56b('0x6')]][_0xf56b('0x51')]=_0x1cdd90['value'];}if(!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')][_0xf56b('0x52')])){utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x53'),_0x1cdd90[_0xf56b('0x6')],_0x1cdd90[_0xf56b('0x43')]));channels[_0x1cdd90[_0xf56b('0x6')]][_0xf56b('0x54')]=_0x1cdd90[_0xf56b('0x43')];}if(!_[_0xf56b('0x1e')](_0x1cdd90[_0xf56b('0x40')]['sipcallid'])){utils[_0xf56b('0x4')](util[_0xf56b('0x11')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1cdd90['uniqueid'],_0x1cdd90['value']));channels[_0x1cdd90[_0xf56b('0x6')]][_0xf56b('0x55')]=_0x1cdd90[_0xf56b('0x43')];}}}catch(_0x89ca38){utils['error'](util['format'](_0xf56b('0x3f'),_0x1cdd90[_0xf56b('0x6')]),_0x89ca38);}};exports[_0xf56b('0x56')]=function(_0x9c0b10){try{if(!_['isNil'](channels[_0x9c0b10[_0xf56b('0x6')]])){utils['debug'](util['format']('[%s][calls][newexten]',_0x9c0b10[_0xf56b('0x6')]),_0x9c0b10);utils[_0xf56b('0x4')](util[_0xf56b('0x11')](_0xf56b('0x57'),_0x9c0b10[_0xf56b('0x6')],_0x9c0b10['application'],_0x9c0b10[_0xf56b('0x58')]));if(_0x9c0b10[_0xf56b('0x59')][_0xf56b('0x5a')]()==_0xf56b('0x5b')&&_[_0xf56b('0x5c')](_0x9c0b10[_0xf56b('0x58')][_0xf56b('0x5a')](),_0xf56b('0x5d'))){var _0x58a6cd=_0x9c0b10[_0xf56b('0x58')]['split']('=');var _0x4a8ad4=_0x58a6cd[0x0][_0xf56b('0x5e')](_0x58a6cd[0x0][_0xf56b('0x5f')]('(')+0x1,_0x58a6cd[0x0][_0xf56b('0x5f')](')'));var _0x1195f2=_0x58a6cd[0x1];channels[_0x9c0b10[_0xf56b('0x6')]][_0x4a8ad4]=_0x1195f2;}if(!_[_0xf56b('0x60')]([_0xf56b('0x23'),_0xf56b('0x61'),_0xf56b('0x62'),_0xf56b('0x5b'),_0xf56b('0x63')],_0x9c0b10[_0xf56b('0x59')][_0xf56b('0x5a')]())){channels[_0x9c0b10[_0xf56b('0x6')]]['lastapplication']=_0x9c0b10[_0xf56b('0x59')];channels[_0x9c0b10[_0xf56b('0x6')]][_0xf56b('0x4d')]=_0x9c0b10[_0xf56b('0x58')];}}}catch(_0x37989a){utils[_0xf56b('0x1a')](util['format'](_0xf56b('0x64'),_0x9c0b10[_0xf56b('0x6')]),_0x37989a);}}; \ No newline at end of file +var _0xca35=['lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','./utils','FAILED','NO\x20ANSWER','BUSY','info','[%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','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','debug','[%s][calls][newchannel]','format','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','context','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','linkedid','destinationchannel','answertime','ANSWERED','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','duration','diffTime','endtime','starttime','billableseconds','origtransfereruniqueid','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','transfertargetchannel','origtransfererchannel','_attended','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','set','toLowerCase','cdr','substring'];(function(_0x508c10,_0x5a15f0){var _0x3108b5=function(_0x4bccaa){while(--_0x4bccaa){_0x508c10['push'](_0x508c10['shift']());}};_0x3108b5(++_0x5a15f0);}(_0xca35,0x1aa));var _0x5ca3=function(_0x5b34c0,_0x3ad403){_0x5b34c0=_0x5b34c0-0x0;var _0x242bd3=_0xca35[_0x5b34c0];return _0x242bd3;};'use strict';var _=require(_0x5ca3('0x0'));var util=require('util');var utils=require(_0x5ca3('0x1'));var dispositions=['NO\x20ANSWER',_0x5ca3('0x2'),'FAILED',_0x5ca3('0x3'),_0x5ca3('0x3'),_0x5ca3('0x3'),'ANSWERED',_0x5ca3('0x4'),_0x5ca3('0x2'),'FAILED',_0x5ca3('0x2')];var channels={};function writeDB(_0x5f4ee8){utils[_0x5ca3('0x5')](util['format'](_0x5ca3('0x6'),_0x5f4ee8['uniqueid'],_0x5f4ee8[_0x5ca3('0x7')],_0x5f4ee8[_0x5ca3('0x8')],_0x5f4ee8[_0x5ca3('0x9')],_0x5f4ee8[_0x5ca3('0xa')],_0x5f4ee8[_0x5ca3('0xb')],_0x5f4ee8[_0x5ca3('0xc')],_0x5f4ee8[_0x5ca3('0xd')]));if(_0x5f4ee8[_0x5ca3('0xe')]){utils['getUserByInternal'](_0x5f4ee8['accountcode'])[_0x5ca3('0xf')](function(_0x5dd622){if(_0x5dd622){_0x5f4ee8[_0x5ca3('0x10')]=_0x5dd622['id'];}utils[_0x5ca3('0x11')](_0x5ca3('0x12'),_0x5f4ee8);});}else{utils['request'](_0x5ca3('0x12'),_0x5f4ee8);}if(channels[_0x5f4ee8[_0x5ca3('0x13')]]){delete channels[_0x5f4ee8[_0x5ca3('0x13')]];}}exports[_0x5ca3('0x14')]=function(_0x1dbec9){try{utils[_0x5ca3('0x15')](util['format'](_0x5ca3('0x16'),_0x1dbec9[_0x5ca3('0x13')]),_0x1dbec9);if(_0x1dbec9['uniqueid']==_0x1dbec9['linkedid']&&_0x1dbec9[_0x5ca3('0x7')]!='OutgoingSpoolFailed'){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x18'),_0x1dbec9[_0x5ca3('0x13')],_0x1dbec9['context'],_0x1dbec9[_0x5ca3('0x19')]));channels[_0x1dbec9[_0x5ca3('0x13')]]={'uniqueid':_0x1dbec9[_0x5ca3('0x13')],'accountcode':_0x1dbec9[_0x5ca3('0xe')],'source':_0x1dbec9[_0x5ca3('0xb')],'destination':_0x1dbec9[_0x5ca3('0x19')],'destinationcontext':_0x1dbec9['context'],'channel':_0x1dbec9['channel'],'starttime':utils[_0x5ca3('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x5ca3('0x1b')};}}catch(_0x3be43d){utils[_0x5ca3('0x1c')](util[_0x5ca3('0x17')](_0x5ca3('0x16'),_0x1dbec9[_0x5ca3('0x13')]),_0x3be43d);}};exports[_0x5ca3('0x1d')]=function(_0x582a38){try{utils[_0x5ca3('0x15')](util[_0x5ca3('0x17')](_0x5ca3('0x1e'),_0x582a38[_0x5ca3('0x13')]),_0x582a38);if(!_[_0x5ca3('0x1f')](channels[_0x582a38['uniqueid']])&&_0x582a38[_0x5ca3('0x20')]==0x6){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')]('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x582a38[_0x5ca3('0x13')],_0x582a38[_0x5ca3('0x21')],_0x582a38[_0x5ca3('0x7')]));if(_[_0x5ca3('0x1f')](channels[_0x582a38[_0x5ca3('0x13')]][_0x5ca3('0x22')])){channels[_0x582a38[_0x5ca3('0x13')]]['systemanswertime']=utils[_0x5ca3('0x1a')]();}}else if(!_[_0x5ca3('0x1f')](channels[_0x582a38['linkedid']])&&_0x582a38['channelstate']==0x6&&_0x582a38['context']!=_0x5ca3('0x23')){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x24'),_0x582a38[_0x5ca3('0x13')],_0x582a38['linkedid'],_0x582a38['context'],_0x582a38[_0x5ca3('0x7')]));channels[_0x582a38['linkedid']][_0x5ca3('0xe')]=_0x582a38[_0x5ca3('0xe')];channels[_0x582a38[_0x5ca3('0x25')]][_0x5ca3('0x26')]=_0x582a38[_0x5ca3('0x7')];if(_['isNil'](channels[_0x582a38[_0x5ca3('0x25')]][_0x5ca3('0x27')])){channels[_0x582a38[_0x5ca3('0x25')]]['answertime']=utils[_0x5ca3('0x1a')]();}channels[_0x582a38['linkedid']]['disposition']=dispositions[_['toNumber'](_0x582a38[_0x5ca3('0x20')])]||_0x5ca3('0x28');}}catch(_0x28bba7){utils['error'](util[_0x5ca3('0x17')]('[%s][calls][newstate]',_0x582a38['uniqueid']),_0x28bba7);}};exports['hangup']=function(_0x55abd0){try{if(!_['isNil'](channels[_0x55abd0[_0x5ca3('0x13')]])){utils[_0x5ca3('0x15')](util[_0x5ca3('0x17')](_0x5ca3('0x29'),_0x55abd0[_0x5ca3('0x13')]),_0x55abd0);if(_[_0x5ca3('0x1f')](channels[_0x55abd0[_0x5ca3('0x13')]][_0x5ca3('0x2a')])){channels[_0x55abd0[_0x5ca3('0x13')]]['callerid']=_0x55abd0['calleridname']+'\x20<'+_0x55abd0[_0x5ca3('0xb')]+'>';}utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x2b'),_0x55abd0[_0x5ca3('0x13')],channels[_0x55abd0[_0x5ca3('0x13')]][_0x5ca3('0x2a')],_0x55abd0[_0x5ca3('0x2c')]));channels[_0x55abd0[_0x5ca3('0x13')]]['endtime']=utils[_0x5ca3('0x1a')]();channels[_0x55abd0[_0x5ca3('0x13')]][_0x5ca3('0x2d')]=utils[_0x5ca3('0x2e')](channels[_0x55abd0[_0x5ca3('0x13')]][_0x5ca3('0x2f')],channels[_0x55abd0[_0x5ca3('0x13')]][_0x5ca3('0x30')]);channels[_0x55abd0['uniqueid']][_0x5ca3('0x31')]=channels[_0x55abd0[_0x5ca3('0x13')]]['answertime']?utils[_0x5ca3('0x2e')](channels[_0x55abd0[_0x5ca3('0x13')]][_0x5ca3('0x2f')],channels[_0x55abd0[_0x5ca3('0x13')]][_0x5ca3('0x27')]):0x0;writeDB(channels[_0x55abd0[_0x5ca3('0x13')]]);}}catch(_0x74a227){utils[_0x5ca3('0x1c')](util[_0x5ca3('0x17')](_0x5ca3('0x29'),_0x55abd0[_0x5ca3('0x13')]),_0x74a227);}};exports['attendedtransfer']=function(_0x281d31){try{if(!_[_0x5ca3('0x1f')](channels[_0x281d31['localtwolinkedid']])){utils[_0x5ca3('0x15')](util[_0x5ca3('0x17')]('[%s][calls][attendedtransfer]',_0x281d31[_0x5ca3('0x32')]),_0x281d31);if(channels[_0x281d31[_0x5ca3('0x33')]][_0x5ca3('0x7')]==_0x281d31[_0x5ca3('0x34')]){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x35'),_0x281d31['origtransfereruniqueid'],_0x281d31['localtwolinkedid'],_0x281d31[_0x5ca3('0x36')]));channels[_0x281d31[_0x5ca3('0x33')]]['destinationchannel']=_0x281d31['secondtransfererchannel'];channels[_0x281d31[_0x5ca3('0x33')]]['userfield']='_attended';}else if(channels[_0x281d31['localtwolinkedid']][_0x5ca3('0x7')]=_0x281d31[_0x5ca3('0x37')]){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x281d31[_0x5ca3('0x32')],_0x281d31['localtwolinkedid'],_0x281d31[_0x5ca3('0x38')]));channels[_0x281d31[_0x5ca3('0x33')]]['destinationchannel']=_0x281d31[_0x5ca3('0x38')];channels[_0x281d31[_0x5ca3('0x33')]]['userfield']=_0x5ca3('0x39');}}}catch(_0x3668bb){utils[_0x5ca3('0x1c')](util[_0x5ca3('0x17')](_0x5ca3('0x3a'),_0x281d31[_0x5ca3('0x32')]),_0x3668bb);}};exports['musiconholdstart']=function(_0x35ede0){try{if(!_['isNil'](channels[_0x35ede0[_0x5ca3('0x13')]])){utils['debug'](util['format'](_0x5ca3('0x3b'),_0x35ede0[_0x5ca3('0x13')]),_0x35ede0);channels[_0x35ede0[_0x5ca3('0x13')]][_0x5ca3('0x3c')]=utils[_0x5ca3('0x1a')]();utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x3d'),_0x35ede0[_0x5ca3('0x13')],channels[_0x35ede0['uniqueid']][_0x5ca3('0x3c')]));}}catch(_0x54df97){utils[_0x5ca3('0x1c')](util[_0x5ca3('0x17')](_0x5ca3('0x3b'),_0x35ede0[_0x5ca3('0x13')]),_0x54df97);}};exports['musiconholdstop']=function(_0x14e9c){try{if(!_['isNil'](channels[_0x14e9c['uniqueid']])){utils[_0x5ca3('0x15')](util[_0x5ca3('0x17')]('[%s][calls][musiconholdstop]',_0x14e9c[_0x5ca3('0x13')]),_0x14e9c);if(!_['isNil'](channels[_0x14e9c['uniqueid']][_0x5ca3('0x3c')])){channels[_0x14e9c[_0x5ca3('0x13')]][_0x5ca3('0x3e')]+=utils['diffTime'](utils[_0x5ca3('0x1a')](),channels[_0x14e9c['uniqueid']][_0x5ca3('0x3c')]);utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x3f'),_0x14e9c[_0x5ca3('0x13')],channels[_0x14e9c[_0x5ca3('0x13')]]['mohtime']));delete channels[_0x14e9c[_0x5ca3('0x13')]][_0x5ca3('0x3c')];}}}catch(_0x1cc220){utils['error'](util[_0x5ca3('0x17')](_0x5ca3('0x40'),_0x14e9c[_0x5ca3('0x13')]),_0x1cc220);}};exports[_0x5ca3('0x41')]=function(_0x4e2066){try{if(!_[_0x5ca3('0x1f')](channels[_0x4e2066[_0x5ca3('0x13')]])){utils['debug'](util[_0x5ca3('0x17')](_0x5ca3('0x42'),_0x4e2066[_0x5ca3('0x13')]),_0x4e2066);if(!_[_0x5ca3('0x1f')](_0x4e2066['variable'][_0x5ca3('0x43')])){utils[_0x5ca3('0x5')](util['format'](_0x5ca3('0x44'),_0x4e2066[_0x5ca3('0x13')],_0x4e2066[_0x5ca3('0x45')]));channels[_0x4e2066[_0x5ca3('0x13')]][_0x5ca3('0x46')]=_0x4e2066['value'];}if(!_[_0x5ca3('0x1f')](_0x4e2066[_0x5ca3('0x47')][_0x5ca3('0x48')])){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x49'),_0x4e2066[_0x5ca3('0x13')],_0x4e2066[_0x5ca3('0x45')]));channels[_0x4e2066[_0x5ca3('0x13')]][_0x5ca3('0x4a')]=_0x4e2066['value'];channels[_0x4e2066[_0x5ca3('0x13')]]['callerid']='\x22'+_0x4e2066[_0x5ca3('0x45')]+_0x5ca3('0x4b')+_0x4e2066[_0x5ca3('0x45')]+'>';}if(!_['isNil'](_0x4e2066['variable'][_0x5ca3('0x4c')])||!_[_0x5ca3('0x1f')](_0x4e2066[_0x5ca3('0x47')][_0x5ca3('0x4d')])){utils[_0x5ca3('0x5')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x4e2066[_0x5ca3('0x13')],!_[_0x5ca3('0x1f')](_0x4e2066[_0x5ca3('0x47')][_0x5ca3('0x4c')])?_0x5ca3('0x4c'):_0x5ca3('0x4d'),_0x4e2066[_0x5ca3('0x45')]));channels[_0x4e2066[_0x5ca3('0x13')]][_0x5ca3('0x2a')]=_0x4e2066[_0x5ca3('0x45')];}if(!_['isNil'](_0x4e2066['variable'][_0x5ca3('0x4e')])||!_[_0x5ca3('0x1f')](_0x4e2066[_0x5ca3('0x47')][_0x5ca3('0x4f')])){utils[_0x5ca3('0x5')](util['format'](_0x5ca3('0x50'),_0x4e2066[_0x5ca3('0x13')],!_[_0x5ca3('0x1f')](_0x4e2066['variable']['xmd-queue'])?'xmd-queue':'xmcs-queue',_0x4e2066['value']));channels[_0x4e2066[_0x5ca3('0x13')]][_0x5ca3('0x51')]=_0x5ca3('0x52');channels[_0x4e2066[_0x5ca3('0x13')]]['lastdata']=_0x4e2066['value'];channels[_0x4e2066[_0x5ca3('0x13')]]['queue']=!![];}if(!_[_0x5ca3('0x1f')](_0x4e2066['variable'][_0x5ca3('0x53')])){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x54'),_0x4e2066[_0x5ca3('0x13')],_0x4e2066[_0x5ca3('0x45')]));channels[_0x4e2066['uniqueid']]['ContactId']=_0x4e2066['value'];}if(!_[_0x5ca3('0x1f')](_0x4e2066[_0x5ca3('0x47')][_0x5ca3('0x55')])){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x4e2066[_0x5ca3('0x13')],_0x4e2066[_0x5ca3('0x45')]));channels[_0x4e2066[_0x5ca3('0x13')]][_0x5ca3('0x56')]=_0x4e2066[_0x5ca3('0x45')];}if(!_['isNil'](_0x4e2066[_0x5ca3('0x47')][_0x5ca3('0x57')])){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x58'),_0x4e2066[_0x5ca3('0x13')],_0x4e2066[_0x5ca3('0x45')]));channels[_0x4e2066[_0x5ca3('0x13')]]['routeid']=_0x4e2066[_0x5ca3('0x45')];}if(!_[_0x5ca3('0x1f')](_0x4e2066['variable'][_0x5ca3('0x59')])){utils[_0x5ca3('0x5')](util[_0x5ca3('0x17')](_0x5ca3('0x5a'),_0x4e2066['uniqueid'],_0x4e2066['value']));channels[_0x4e2066['uniqueid']][_0x5ca3('0x59')]=_0x4e2066['value'];}}}catch(_0x1a3aaa){utils[_0x5ca3('0x1c')](util[_0x5ca3('0x17')](_0x5ca3('0x42'),_0x4e2066[_0x5ca3('0x13')]),_0x1a3aaa);}};exports[_0x5ca3('0x5b')]=function(_0x1fd9bd){try{if(!_['isNil'](channels[_0x1fd9bd['uniqueid']])){utils[_0x5ca3('0x15')](util[_0x5ca3('0x17')](_0x5ca3('0x5c'),_0x1fd9bd[_0x5ca3('0x13')]),_0x1fd9bd);utils['info'](util[_0x5ca3('0x17')]('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x1fd9bd[_0x5ca3('0x13')],_0x1fd9bd[_0x5ca3('0x5d')],_0x1fd9bd[_0x5ca3('0x5e')]));if(_0x1fd9bd[_0x5ca3('0x5d')]['toLowerCase']()==_0x5ca3('0x5f')&&_['startsWith'](_0x1fd9bd['appdata'][_0x5ca3('0x60')](),_0x5ca3('0x61'))){var _0x332bd9=_0x1fd9bd[_0x5ca3('0x5e')]['split']('=');var _0x11c058=_0x332bd9[0x0][_0x5ca3('0x62')](_0x332bd9[0x0][_0x5ca3('0x63')]('(')+0x1,_0x332bd9[0x0][_0x5ca3('0x63')](')'));var _0x2a75f6=_0x332bd9[0x1];channels[_0x1fd9bd[_0x5ca3('0x13')]][_0x11c058]=_0x2a75f6;}if(!_[_0x5ca3('0x64')]([_0x5ca3('0x65'),_0x5ca3('0x66'),_0x5ca3('0x67'),_0x5ca3('0x5f'),_0x5ca3('0x68')],_0x1fd9bd[_0x5ca3('0x5d')][_0x5ca3('0x60')]())){channels[_0x1fd9bd[_0x5ca3('0x13')]][_0x5ca3('0x51')]=_0x1fd9bd[_0x5ca3('0x5d')];channels[_0x1fd9bd[_0x5ca3('0x13')]]['lastdata']=_0x1fd9bd['appdata'];}}}catch(_0x40f17e){utils[_0x5ca3('0x1c')](util[_0x5ca3('0x17')](_0x5ca3('0x5c'),_0x1fd9bd[_0x5ca3('0x13')]),_0x40f17e);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index e3bc3fa..3bb4dd9 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 _0x161e=['info','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','[core]\x20connected','shutdown'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x161e,0x1e8));var _0xe161=function(_0x11a465,_0x182a91){_0x11a465=_0x11a465-0x0;var _0x50d96a=_0x161e[_0x11a465];return _0x50d96a;};'use strict';var utils=require(_0xe161('0x0'));exports[_0xe161('0x1')]=function(){utils['info'](_0xe161('0x2'));};exports[_0xe161('0x3')]=function(){utils[_0xe161('0x4')](_0xe161('0x5'));};exports[_0xe161('0x6')]=function(){utils['info'](_0xe161('0x7'));};exports[_0xe161('0x8')]=function(_0x2b4f67){utils[_0xe161('0x8')](_0xe161('0x9'),_0x2b4f67);};exports['close']=function(){utils['info'](_0xe161('0xa'));};exports[_0xe161('0xb')]=function(_0x3e002a){}; \ No newline at end of file +var _0x7f53=['./utils','connect','info','[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','managerevent'];(function(_0x9dd96a,_0x2da48b){var _0x579627=function(_0x46fb0d){while(--_0x46fb0d){_0x9dd96a['push'](_0x9dd96a['shift']());}};_0x579627(++_0x2da48b);}(_0x7f53,0x84));var _0x37f5=function(_0xc8a11,_0x347a33){_0xc8a11=_0xc8a11-0x0;var _0x55a500=_0x7f53[_0xc8a11];return _0x55a500;};'use strict';var utils=require(_0x37f5('0x0'));exports[_0x37f5('0x1')]=function(){utils[_0x37f5('0x2')](_0x37f5('0x3'));};exports[_0x37f5('0x4')]=function(){utils[_0x37f5('0x2')](_0x37f5('0x5'));};exports[_0x37f5('0x6')]=function(){utils[_0x37f5('0x2')](_0x37f5('0x7'));};exports[_0x37f5('0x8')]=function(_0x5dd3f3){utils[_0x37f5('0x8')](_0x37f5('0x9'),_0x5dd3f3);};exports[_0x37f5('0xa')]=function(){utils[_0x37f5('0x2')]('[core]\x20close');};exports[_0x37f5('0xb')]=function(_0x19f3d0){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index dce2010..8735b19 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 _0xfeec=['[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialend]','ANSWER','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','calleridname','duration','diffTime','endtime','holdtime','[%s][dials][hangup]','lodash','format','uniqueid','channel','connectedlinenum','dialstatus','request','newexten','[%s][dials][newexten]','info','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','cdr(routeid)','split','error','debug','variable','outboundrouteid'];(function(_0x169baf,_0xea797a){var _0x464830=function(_0x2e1741){while(--_0x2e1741){_0x169baf['push'](_0x169baf['shift']());}};_0x464830(++_0xea797a);}(_0xfeec,0x7a));var _0xcfee=function(_0x626174,_0x5d2ce8){_0x626174=_0x626174-0x0;var _0x1cdf21=_0xfeec[_0x626174];return _0x1cdf21;};'use strict';var _=require(_0xcfee('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x15eae2){utils['info'](util[_0xcfee('0x1')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x15eae2[_0xcfee('0x2')],_0x15eae2[_0xcfee('0x3')],_0x15eae2['dialstring'],_0x15eae2['calleridnum'],_0x15eae2[_0xcfee('0x4')],_0x15eae2[_0xcfee('0x5')]));utils[_0xcfee('0x6')]('CreateVoiceDialReport',_0x15eae2);delete dials[_0x15eae2[_0xcfee('0x2')]];}exports[_0xcfee('0x7')]=function(_0x26ea36){try{utils['debug'](util[_0xcfee('0x1')](_0xcfee('0x8'),_0x26ea36['uniqueid']),_0x26ea36);utils[_0xcfee('0x9')](util[_0xcfee('0x1')](_0xcfee('0xa'),_0x26ea36[_0xcfee('0x2')],_0x26ea36[_0xcfee('0xb')],_0x26ea36[_0xcfee('0xc')]));if(_0x26ea36[_0xcfee('0xb')]['toLowerCase']()==_0xcfee('0xd')&&_[_0xcfee('0xe')](_0x26ea36[_0xcfee('0xc')][_0xcfee('0xf')](),_0xcfee('0x10'))){var _0x37da4d=_0x26ea36[_0xcfee('0xc')][_0xcfee('0x11')]('=');dials[_0x26ea36[_0xcfee('0x2')]]={'routeId':_0x37da4d[0x1]};}}catch(_0x267624){utils[_0xcfee('0x12')](util[_0xcfee('0x1')](_0xcfee('0x8'),_0x26ea36[_0xcfee('0x2')]),_0x267624);}};exports['varset']=function(_0x15f629){try{utils[_0xcfee('0x13')](util[_0xcfee('0x1')]('[%s][dials][varset]',_0x15f629[_0xcfee('0x2')]),_0x15f629);if(!_['isNil'](_0x15f629[_0xcfee('0x14')][_0xcfee('0x15')])){utils['info'](util[_0xcfee('0x1')](_0xcfee('0x16'),_0x15f629[_0xcfee('0x2')],_0x15f629[_0xcfee('0x17')]));dials[_0x15f629[_0xcfee('0x2')]]={'routeId':_0x15f629[_0xcfee('0x17')]};}}catch(_0x2a38da){utils[_0xcfee('0x12')](util[_0xcfee('0x1')]('[%s][dials][varset]',_0x15f629['uniqueid']),_0x2a38da);}};exports[_0xcfee('0x18')]=function(_0x49b138){try{if(!_[_0xcfee('0x19')](dials[_0x49b138[_0xcfee('0x2')]])){utils[_0xcfee('0x13')](util[_0xcfee('0x1')](_0xcfee('0x1a'),_0x49b138['uniqueid']),_0x49b138);dials[_0x49b138[_0xcfee('0x2')]]=_[_0xcfee('0x1b')](dials[_0x49b138[_0xcfee('0x2')]],_0x49b138);dials[_0x49b138['uniqueid']][_0xcfee('0x1c')]=utils['now']();dials[_0x49b138[_0xcfee('0x2')]][_0xcfee('0x1d')]=_0xcfee('0x1e');utils['info'](util['format'](_0xcfee('0x1f'),_0x49b138[_0xcfee('0x2')],dials[_0x49b138[_0xcfee('0x2')]][_0xcfee('0x1c')]));}}catch(_0x2bd714){utils[_0xcfee('0x12')](util['format'](_0xcfee('0x1a'),_0x49b138['uniqueid']),_0x2bd714);}};exports['dialend']=function(_0x23d1fb){try{if(!_['isNil'](dials[_0x23d1fb[_0xcfee('0x2')]])){utils[_0xcfee('0x13')](util[_0xcfee('0x1')](_0xcfee('0x20'),_0x23d1fb[_0xcfee('0x2')]),_0x23d1fb);dials[_0x23d1fb['uniqueid']][_0xcfee('0x5')]=_0x23d1fb[_0xcfee('0x5')];if(_0x23d1fb[_0xcfee('0x5')]==_0xcfee('0x21')){dials[_0x23d1fb[_0xcfee('0x2')]]=_[_0xcfee('0x1b')](dials[_0x23d1fb[_0xcfee('0x2')]],_0x23d1fb);dials[_0x23d1fb[_0xcfee('0x2')]][_0xcfee('0x22')]=utils[_0xcfee('0x23')]();dials[_0x23d1fb['uniqueid']]['lastevent']=_0xcfee('0x24');utils[_0xcfee('0x9')](util[_0xcfee('0x1')](_0xcfee('0x25'),_0x23d1fb['uniqueid'],_0x23d1fb[_0xcfee('0x5')],dials[_0x23d1fb[_0xcfee('0x2')]][_0xcfee('0x22')]));}else{utils[_0xcfee('0x9')](util['format'](_0xcfee('0x26'),_0x23d1fb[_0xcfee('0x2')],_0x23d1fb[_0xcfee('0x5')]));}}}catch(_0x3f40be){utils[_0xcfee('0x12')](util[_0xcfee('0x1')](_0xcfee('0x20'),_0x23d1fb[_0xcfee('0x2')]),_0x3f40be);}};exports[_0xcfee('0x27')]=function(_0x5539c2){try{if(!_['isNil'](dials[_0x5539c2['uniqueid']])){utils['debug'](util[_0xcfee('0x1')]('[%s][dials][hangup]',_0x5539c2[_0xcfee('0x2')]),_0x5539c2);utils[_0xcfee('0x9')](util[_0xcfee('0x1')](_0xcfee('0x28'),_0x5539c2[_0xcfee('0x2')],_0x5539c2[_0xcfee('0x29')],_0x5539c2[_0xcfee('0x2a')],_0x5539c2['cause-txt']));dials[_0x5539c2[_0xcfee('0x2')]]=_[_0xcfee('0x1b')](dials[_0x5539c2[_0xcfee('0x2')]],{'endtime':utils[_0xcfee('0x23')](),'lastevent':'complete'});dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x2b')]=utils[_0xcfee('0x2c')](dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x2d')],dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x1c')]);dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x2e')]=utils[_0xcfee('0x2c')](dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x22')]||dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x2d')],dials[_0x5539c2['uniqueid']][_0xcfee('0x1c')]);dials[_0x5539c2[_0xcfee('0x2')]]['billableseconds']=dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x22')]?utils[_0xcfee('0x2c')](dials[_0x5539c2['uniqueid']][_0xcfee('0x2d')],dials[_0x5539c2[_0xcfee('0x2')]][_0xcfee('0x22')]):0x0;writeDB(dials[_0x5539c2[_0xcfee('0x2')]]);}}catch(_0x3d3d20){utils[_0xcfee('0x12')](util['format'](_0xcfee('0x2f'),_0x5539c2[_0xcfee('0x2')]),_0x3d3d20);}}; \ No newline at end of file +var _0x954e=['channel','dialstring','connectedlinenum','dialstatus','CreateVoiceDialReport','uniqueid','newexten','debug','[%s][dials][newexten]\x20application:%s\x20appdata:%s','appdata','application','toLowerCase','set','startsWith','split','error','[%s][dials][newexten]','varset','[%s][dials][varset]','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','assign','starttime','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','[%s][dials][dialbegin]','isNil','answertime','lastevent','connect','info','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridnum','cause-txt','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','./utils','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s'];(function(_0x228641,_0x25d636){var _0x5d5d78=function(_0x4d5c6c){while(--_0x4d5c6c){_0x228641['push'](_0x228641['shift']());}};_0x5d5d78(++_0x25d636);}(_0x954e,0x1b4));var _0xe954=function(_0x60b4b5,_0x4b9f3c){_0x60b4b5=_0x60b4b5-0x0;var _0x5ce041=_0x954e[_0x60b4b5];return _0x5ce041;};'use strict';var _=require(_0xe954('0x0'));var util=require(_0xe954('0x1'));var utils=require(_0xe954('0x2'));var dials={};function writeDB(_0x11321c){utils['info'](util[_0xe954('0x3')](_0xe954('0x4'),_0x11321c['uniqueid'],_0x11321c[_0xe954('0x5')],_0x11321c[_0xe954('0x6')],_0x11321c['calleridnum'],_0x11321c[_0xe954('0x7')],_0x11321c[_0xe954('0x8')]));utils['request'](_0xe954('0x9'),_0x11321c);delete dials[_0x11321c[_0xe954('0xa')]];}exports[_0xe954('0xb')]=function(_0x5a841a){try{utils[_0xe954('0xc')](util[_0xe954('0x3')]('[%s][dials][newexten]',_0x5a841a[_0xe954('0xa')]),_0x5a841a);utils['info'](util[_0xe954('0x3')](_0xe954('0xd'),_0x5a841a['uniqueid'],_0x5a841a['application'],_0x5a841a[_0xe954('0xe')]));if(_0x5a841a[_0xe954('0xf')][_0xe954('0x10')]()==_0xe954('0x11')&&_[_0xe954('0x12')](_0x5a841a[_0xe954('0xe')]['toLowerCase'](),'cdr(routeid)')){var _0x1f65e7=_0x5a841a[_0xe954('0xe')][_0xe954('0x13')]('=');dials[_0x5a841a[_0xe954('0xa')]]={'routeId':_0x1f65e7[0x1]};}}catch(_0x14c53a){utils[_0xe954('0x14')](util['format'](_0xe954('0x15'),_0x5a841a[_0xe954('0xa')]),_0x14c53a);}};exports[_0xe954('0x16')]=function(_0x127f9d){try{utils[_0xe954('0xc')](util[_0xe954('0x3')](_0xe954('0x17'),_0x127f9d[_0xe954('0xa')]),_0x127f9d);if(!_['isNil'](_0x127f9d['variable'][_0xe954('0x18')])){utils['info'](util[_0xe954('0x3')](_0xe954('0x19'),_0x127f9d[_0xe954('0xa')],_0x127f9d[_0xe954('0x1a')]));dials[_0x127f9d[_0xe954('0xa')]]={'routeId':_0x127f9d[_0xe954('0x1a')]};}}catch(_0xeec64c){utils['error'](util['format'](_0xe954('0x17'),_0x127f9d['uniqueid']),_0xeec64c);}};exports['dialbegin']=function(_0x5bb227){try{if(!_['isNil'](dials[_0x5bb227[_0xe954('0xa')]])){utils[_0xe954('0xc')](util['format']('[%s][dials][dialbegin]',_0x5bb227[_0xe954('0xa')]),_0x5bb227);dials[_0x5bb227[_0xe954('0xa')]]=_[_0xe954('0x1b')](dials[_0x5bb227[_0xe954('0xa')]],_0x5bb227);dials[_0x5bb227[_0xe954('0xa')]][_0xe954('0x1c')]=utils['now']();dials[_0x5bb227['uniqueid']]['lastevent']=_0xe954('0x1d');utils['info'](util[_0xe954('0x3')](_0xe954('0x1e'),_0x5bb227[_0xe954('0xa')],dials[_0x5bb227[_0xe954('0xa')]][_0xe954('0x1c')]));}}catch(_0x216c0d){utils[_0xe954('0x14')](util[_0xe954('0x3')](_0xe954('0x1f'),_0x5bb227[_0xe954('0xa')]),_0x216c0d);}};exports['dialend']=function(_0x32f75b){try{if(!_[_0xe954('0x20')](dials[_0x32f75b[_0xe954('0xa')]])){utils[_0xe954('0xc')](util[_0xe954('0x3')]('[%s][dials][dialend]',_0x32f75b['uniqueid']),_0x32f75b);dials[_0x32f75b[_0xe954('0xa')]][_0xe954('0x8')]=_0x32f75b[_0xe954('0x8')];if(_0x32f75b[_0xe954('0x8')]=='ANSWER'){dials[_0x32f75b['uniqueid']]=_['assign'](dials[_0x32f75b['uniqueid']],_0x32f75b);dials[_0x32f75b[_0xe954('0xa')]][_0xe954('0x21')]=utils['now']();dials[_0x32f75b[_0xe954('0xa')]][_0xe954('0x22')]=_0xe954('0x23');utils[_0xe954('0x24')](util['format'](_0xe954('0x25'),_0x32f75b[_0xe954('0xa')],_0x32f75b[_0xe954('0x8')],dials[_0x32f75b['uniqueid']][_0xe954('0x21')]));}else{utils[_0xe954('0x24')](util[_0xe954('0x3')]('[%s][dials][dialend]\x20dialstatus:%s',_0x32f75b[_0xe954('0xa')],_0x32f75b[_0xe954('0x8')]));}}}catch(_0x4160cf){utils[_0xe954('0x14')](util[_0xe954('0x3')](_0xe954('0x26'),_0x32f75b['uniqueid']),_0x4160cf);}};exports['hangup']=function(_0x1156ea){try{if(!_[_0xe954('0x20')](dials[_0x1156ea[_0xe954('0xa')]])){utils['debug'](util['format'](_0xe954('0x27'),_0x1156ea[_0xe954('0xa')]),_0x1156ea);utils[_0xe954('0x24')](util[_0xe954('0x3')](_0xe954('0x28'),_0x1156ea[_0xe954('0xa')],_0x1156ea[_0xe954('0x29')],_0x1156ea['calleridname'],_0x1156ea[_0xe954('0x2a')]));dials[_0x1156ea[_0xe954('0xa')]]=_[_0xe954('0x1b')](dials[_0x1156ea[_0xe954('0xa')]],{'endtime':utils['now'](),'lastevent':_0xe954('0x2b')});dials[_0x1156ea[_0xe954('0xa')]][_0xe954('0x2c')]=utils[_0xe954('0x2d')](dials[_0x1156ea['uniqueid']][_0xe954('0x2e')],dials[_0x1156ea[_0xe954('0xa')]]['starttime']);dials[_0x1156ea[_0xe954('0xa')]][_0xe954('0x2f')]=utils['diffTime'](dials[_0x1156ea[_0xe954('0xa')]][_0xe954('0x21')]||dials[_0x1156ea[_0xe954('0xa')]][_0xe954('0x2e')],dials[_0x1156ea[_0xe954('0xa')]][_0xe954('0x1c')]);dials[_0x1156ea[_0xe954('0xa')]][_0xe954('0x30')]=dials[_0x1156ea[_0xe954('0xa')]][_0xe954('0x21')]?utils[_0xe954('0x2d')](dials[_0x1156ea['uniqueid']]['endtime'],dials[_0x1156ea['uniqueid']][_0xe954('0x21')]):0x0;writeDB(dials[_0x1156ea[_0xe954('0xa')]]);}}catch(_0x228cd8){utils[_0xe954('0x14')](util['format']('[%s][dials][hangup]',_0x1156ea[_0xe954('0xa')]),_0x228cd8);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 07d2fa7..98f7e77 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 _0x24f0=['[%s][index][newexten]','newchannel','dialbegin','[%s][index][dialbegin]','dialend','[%s][index][dialend]','../../config/environment','util','xdr','disabled','production','local','asterisk','port','username','password','keepConnected','XDR\x20DISABLED','info','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','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','origtransfereruniqueid','[%s][index][attendedtransfer]','varset','[%s][index][varset]','newexten'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x24f0,0x1f0));var _0x024f=function(_0x449ad4,_0x467796){_0x449ad4=_0x449ad4-0x0;var _0x24e020=_0x24f0[_0x449ad4];return _0x24e020;};var AsteriskManager=require('asterisk-manager');var config=require(_0x024f('0x0'));var utils=require('./utils');var util=require(_0x024f('0x1'));var isXDREnabled=config['xdr']&&config[_0x024f('0x2')][_0x024f('0x3')]?!config[_0x024f('0x2')][_0x024f('0x3')]:!![];var isProduction=config['env']===_0x024f('0x4')||![];var isLocalAsterisk=config[_0x024f('0x2')]&&config[_0x024f('0x2')][_0x024f('0x5')]===!![]||![];var ami=new AsteriskManager(config[_0x024f('0x6')][_0x024f('0x7')],config[_0x024f('0x6')]['ip'],config[_0x024f('0x6')][_0x024f('0x8')],config['asterisk'][_0x024f('0x9')],!![]);ami[_0x024f('0xa')]();if(!isXDREnabled){utils['info'](_0x024f('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x024f('0xc')](_0x024f('0xd'));}else{var agents=require(_0x024f('0xe'));var calls=require(_0x024f('0xf'));var queues=require(_0x024f('0x10'));var recordings=require(_0x024f('0x11'));var members=require(_0x024f('0x12'));var dials=require(_0x024f('0x13'));var transfers=require(_0x024f('0x14'));var core=require(_0x024f('0x15'));ami['on'](_0x024f('0x16'),core[_0x024f('0x16')]);ami['on']('shutdown',core[_0x024f('0x17')]);ami['on']('fullybooted',core[_0x024f('0x18')]);ami['on'](_0x024f('0x19'),core[_0x024f('0x19')]);ami['on'](_0x024f('0x1a'),core[_0x024f('0x1a')]);ami['on']('managerevent',core[_0x024f('0x1b')]);ami['on'](_0x024f('0x1c'),function(_0x204fbd){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')](_0x024f('0x1f'),_0x204fbd[_0x024f('0x20')]),_0x204fbd);members[_0x024f('0x1c')](_0x204fbd);}catch(_0x26d5ee){utils[_0x024f('0x19')](util[_0x024f('0x1e')]('[%s][index][devicestatechange]',_0x204fbd[_0x024f('0x20')]),_0x26d5ee);}});ami['on'](_0x024f('0x21'),function(_0x32e781){try{utils['debug'](util[_0x024f('0x1e')]('[%s][index][agentcalled]',_0x32e781[_0x024f('0x22')]),_0x32e781);agents[_0x024f('0x21')](_0x32e781);}catch(_0x3f1460){utils['error'](util[_0x024f('0x1e')](_0x024f('0x23'),_0x32e781[_0x024f('0x22')]),_0x3f1460);}});ami['on'](_0x024f('0x24'),function(_0x33c7f4){try{utils['debug'](util[_0x024f('0x1e')](_0x024f('0x25'),_0x33c7f4[_0x024f('0x22')]),_0x33c7f4);agents[_0x024f('0x24')](_0x33c7f4);}catch(_0x44372c){utils[_0x024f('0x19')](util[_0x024f('0x1e')](_0x024f('0x25'),_0x33c7f4['uniqueid']),_0x44372c);}});ami['on'](_0x024f('0x26'),function(_0x5259de){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')]('[%s][index][agentconnect]',_0x5259de[_0x024f('0x22')]),_0x5259de);agents[_0x024f('0x26')](_0x5259de);queues['agentconnect'](_0x5259de);}catch(_0x74b3c6){utils[_0x024f('0x19')](util[_0x024f('0x1e')]('[%s][index][agentconnect]',_0x5259de[_0x024f('0x22')]),_0x74b3c6);}});ami['on'](_0x024f('0x27'),function(_0x1af7fc){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')](_0x024f('0x28'),_0x1af7fc['uniqueid']),_0x1af7fc);agents['agentcomplete'](_0x1af7fc);queues[_0x024f('0x27')](_0x1af7fc);members['agentcomplete'](_0x1af7fc);}catch(_0x27d085){utils[_0x024f('0x19')](util[_0x024f('0x1e')]('[%s][index][agentcomplete]',_0x1af7fc['uniqueid']),_0x27d085);}});ami['on'](_0x024f('0x29'),function(_0x3889f3){try{utils['debug'](util[_0x024f('0x1e')](_0x024f('0x2a'),_0x3889f3[_0x024f('0x22')]),_0x3889f3);agents[_0x024f('0x29')](_0x3889f3);queues[_0x024f('0x29')](_0x3889f3);}catch(_0x18f916){utils['error'](util[_0x024f('0x1e')](_0x024f('0x2a'),_0x3889f3['uniqueid']),_0x18f916);}});ami['on'](_0x024f('0x2b'),function(_0x4e2fb1){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')](_0x024f('0x2c'),_0x4e2fb1[_0x024f('0x22')]),_0x4e2fb1);queues[_0x024f('0x2b')](_0x4e2fb1);recordings[_0x024f('0x2b')](_0x4e2fb1);}catch(_0x13eb4d){utils['error'](util[_0x024f('0x1e')](_0x024f('0x2c'),_0x4e2fb1[_0x024f('0x22')]),_0x13eb4d);}});ami['on'](_0x024f('0x2d'),function(_0x55acbd){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')]('[%s][index][queuecallerleave]',_0x55acbd['uniqueid']),_0x55acbd);queues[_0x024f('0x2d')](_0x55acbd);}catch(_0x3b8cee){utils[_0x024f('0x19')](util['format']('[%s][index][queuecallerleave]',_0x55acbd['uniqueid']),_0x3b8cee);}});ami['on'](_0x024f('0x2e'),function(_0x1e53fb){try{utils['debug'](util[_0x024f('0x1e')](_0x024f('0x2f'),_0x1e53fb[_0x024f('0x22')]),_0x1e53fb);queues[_0x024f('0x2e')](_0x1e53fb);calls['musiconholdstart'](_0x1e53fb);}catch(_0x226630){utils['error'](util[_0x024f('0x1e')](_0x024f('0x2f'),_0x1e53fb[_0x024f('0x22')]),_0x226630);}});ami['on'](_0x024f('0x30'),function(_0x4f9153){try{utils['debug'](util[_0x024f('0x1e')](_0x024f('0x31'),_0x4f9153[_0x024f('0x22')]),_0x4f9153);queues['musiconholdstop'](_0x4f9153);calls['musiconholdstop'](_0x4f9153);}catch(_0x213e0b){utils[_0x024f('0x19')](util['format'](_0x024f('0x31'),_0x4f9153[_0x024f('0x22')]),_0x213e0b);}});ami['on']('newstate',function(_0x2ddf38){try{utils['debug'](util[_0x024f('0x1e')](_0x024f('0x32'),_0x2ddf38[_0x024f('0x22')]),_0x2ddf38);calls[_0x024f('0x33')](_0x2ddf38);recordings[_0x024f('0x33')](_0x2ddf38);}catch(_0x32b82a){utils[_0x024f('0x19')](util[_0x024f('0x1e')](_0x024f('0x32'),_0x2ddf38['uniqueid']),_0x32b82a);}});ami['on'](_0x024f('0x34'),function(_0x3f1bf4){try{utils['debug'](util[_0x024f('0x1e')](_0x024f('0x35'),_0x3f1bf4['uniqueid']),_0x3f1bf4);calls[_0x024f('0x34')](_0x3f1bf4);recordings[_0x024f('0x34')](_0x3f1bf4);dials[_0x024f('0x34')](_0x3f1bf4);agents[_0x024f('0x34')](_0x3f1bf4);queues[_0x024f('0x34')](_0x3f1bf4);}catch(_0x59a88a){utils[_0x024f('0x19')](util[_0x024f('0x1e')](_0x024f('0x35'),_0x3f1bf4[_0x024f('0x22')]),_0x59a88a);}});ami['on'](_0x024f('0x36'),function(_0x380771){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')](_0x024f('0x37'),_0x380771[_0x024f('0x22')]),_0x380771);members[_0x024f('0x36')](_0x380771);}catch(_0x23c1c8){utils['error'](util[_0x024f('0x1e')](_0x024f('0x37'),_0x380771[_0x024f('0x22')]),_0x23c1c8);}});ami['on'](_0x024f('0x38'),function(_0x29c949){try{utils[_0x024f('0x1d')](util['format']('[%s][index][blindtransfer]',_0x29c949[_0x024f('0x22')]),_0x29c949);queues['blindtransfer'](_0x29c949);agents[_0x024f('0x38')](_0x29c949);transfers[_0x024f('0x38')](_0x29c949);}catch(_0x3f1637){utils[_0x024f('0x19')](util[_0x024f('0x1e')](_0x024f('0x39'),_0x29c949['uniqueid']),_0x3f1637);}});ami['on'](_0x024f('0x3a'),function(_0x54e636){try{utils['debug'](util[_0x024f('0x1e')]('[%s][index][attendedtransfer]',_0x54e636[_0x024f('0x3b')]),_0x54e636);queues[_0x024f('0x3a')](_0x54e636);transfers[_0x024f('0x3a')](_0x54e636);agents['attendedtransfer'](_0x54e636);calls[_0x024f('0x3a')](_0x54e636);}catch(_0x270099){utils['error'](util[_0x024f('0x1e')](_0x024f('0x3c'),_0x54e636['origtransfereruniqueid']),_0x270099);}});ami['on'](_0x024f('0x3d'),function(_0x378ff6){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')](_0x024f('0x3e'),_0x378ff6['uniqueid']),_0x378ff6);queues[_0x024f('0x3d')](_0x378ff6);recordings[_0x024f('0x3d')](_0x378ff6);calls[_0x024f('0x3d')](_0x378ff6);dials[_0x024f('0x3d')](_0x378ff6);}catch(_0x46c274){utils['error'](util[_0x024f('0x1e')](_0x024f('0x3e'),_0x378ff6[_0x024f('0x22')]),_0x46c274);}});ami['on'](_0x024f('0x3f'),function(_0x5481cb){try{utils[_0x024f('0x1d')](util['format'](_0x024f('0x40'),_0x5481cb['uniqueid']),_0x5481cb);calls[_0x024f('0x3f')](_0x5481cb);recordings[_0x024f('0x3f')](_0x5481cb);dials[_0x024f('0x3f')](_0x5481cb);}catch(_0x13d2e1){utils[_0x024f('0x19')](util[_0x024f('0x1e')](_0x024f('0x40'),_0x5481cb['uniqueid']),_0x13d2e1);}});ami['on'](_0x024f('0x41'),function(_0x57eec3){try{utils['debug'](util[_0x024f('0x1e')]('[%s][index][newchannel]',_0x57eec3[_0x024f('0x22')]),_0x57eec3);calls[_0x024f('0x41')](_0x57eec3);recordings['newchannel'](_0x57eec3);}catch(_0x38f537){utils['error'](util['format']('[%s][index][newchannel]',_0x57eec3['uniqueid']),_0x38f537);}});ami['on'](_0x024f('0x42'),function(_0x17940d){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')](_0x024f('0x43'),_0x17940d[_0x024f('0x22')]),_0x17940d);dials[_0x024f('0x42')](_0x17940d);}catch(_0x56cae2){utils['error'](util[_0x024f('0x1e')]('[%s]dialbegin',_0x17940d[_0x024f('0x22')]),_0x56cae2);}});ami['on'](_0x024f('0x44'),function(_0x111166){try{utils[_0x024f('0x1d')](util[_0x024f('0x1e')](_0x024f('0x45'),_0x111166[_0x024f('0x22')]),_0x111166);dials[_0x024f('0x44')](_0x111166);}catch(_0xc4b8fe){utils[_0x024f('0x19')](util[_0x024f('0x1e')]('[%s][index][dialend]',_0x111166[_0x024f('0x22')]),_0xc4b8fe);}});} \ No newline at end of file +var _0x4fb3=['origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','password','keepConnected','info','Asterisk\x20disabled\x20on\x20localhost','./calls.controller','./dials.controller','./transfers.controller','./core.controller','connect','fullybooted','error','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]'];(function(_0x13c3d3,_0x4a5e96){var _0x3cc755=function(_0x3675cd){while(--_0x3675cd){_0x13c3d3['push'](_0x13c3d3['shift']());}};_0x3cc755(++_0x4a5e96);}(_0x4fb3,0x11c));var _0x34fb=function(_0x42c13e,_0x2f0c23){_0x42c13e=_0x42c13e-0x0;var _0x138eaf=_0x4fb3[_0x42c13e];return _0x138eaf;};var AsteriskManager=require(_0x34fb('0x0'));var config=require('../../config/environment');var utils=require(_0x34fb('0x1'));var util=require(_0x34fb('0x2'));var isXDREnabled=config[_0x34fb('0x3')]&&config[_0x34fb('0x3')][_0x34fb('0x4')]?!config[_0x34fb('0x3')][_0x34fb('0x4')]:!![];var isProduction=config[_0x34fb('0x5')]===_0x34fb('0x6')||![];var isLocalAsterisk=config[_0x34fb('0x3')]&&config[_0x34fb('0x3')][_0x34fb('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x34fb('0x8')][_0x34fb('0x9')],config[_0x34fb('0x8')]['ip'],config['asterisk'][_0x34fb('0xa')],config['asterisk'][_0x34fb('0xb')],!![]);ami[_0x34fb('0xc')]();if(!isXDREnabled){utils['info']('XDR\x20DISABLED');}else if(!isProduction&&!isLocalAsterisk){utils[_0x34fb('0xd')](_0x34fb('0xe'));}else{var agents=require('./agents.controller');var calls=require(_0x34fb('0xf'));var queues=require('./queues.controller');var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require(_0x34fb('0x10'));var transfers=require(_0x34fb('0x11'));var core=require(_0x34fb('0x12'));ami['on'](_0x34fb('0x13'),core['connect']);ami['on']('shutdown',core['shutdown']);ami['on'](_0x34fb('0x14'),core['fullybooted']);ami['on'](_0x34fb('0x15'),core[_0x34fb('0x15')]);ami['on']('close',core['close']);ami['on']('managerevent',core[_0x34fb('0x16')]);ami['on'](_0x34fb('0x17'),function(_0x188cc0){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x1a'),_0x188cc0[_0x34fb('0x1b')]),_0x188cc0);members[_0x34fb('0x17')](_0x188cc0);}catch(_0x172d3a){utils[_0x34fb('0x15')](util['format'](_0x34fb('0x1a'),_0x188cc0['device']),_0x172d3a);}});ami['on'](_0x34fb('0x1c'),function(_0x552dc2){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x1d'),_0x552dc2[_0x34fb('0x1e')]),_0x552dc2);agents[_0x34fb('0x1c')](_0x552dc2);}catch(_0x13c3b3){utils[_0x34fb('0x15')](util[_0x34fb('0x19')]('[%s][index][agentcalled]',_0x552dc2['uniqueid']),_0x13c3b3);}});ami['on'](_0x34fb('0x1f'),function(_0x1f9228){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x20'),_0x1f9228[_0x34fb('0x1e')]),_0x1f9228);agents[_0x34fb('0x1f')](_0x1f9228);}catch(_0x204b7e){utils[_0x34fb('0x15')](util['format'](_0x34fb('0x20'),_0x1f9228[_0x34fb('0x1e')]),_0x204b7e);}});ami['on'](_0x34fb('0x21'),function(_0x31e0f6){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x22'),_0x31e0f6[_0x34fb('0x1e')]),_0x31e0f6);agents[_0x34fb('0x21')](_0x31e0f6);queues[_0x34fb('0x21')](_0x31e0f6);}catch(_0x5d2394){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x22'),_0x31e0f6[_0x34fb('0x1e')]),_0x5d2394);}});ami['on'](_0x34fb('0x23'),function(_0x3c16e3){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x24'),_0x3c16e3['uniqueid']),_0x3c16e3);agents[_0x34fb('0x23')](_0x3c16e3);queues[_0x34fb('0x23')](_0x3c16e3);members[_0x34fb('0x23')](_0x3c16e3);}catch(_0x21e8b3){utils['error'](util[_0x34fb('0x19')](_0x34fb('0x24'),_0x3c16e3[_0x34fb('0x1e')]),_0x21e8b3);}});ami['on'](_0x34fb('0x25'),function(_0x350c71){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x26'),_0x350c71[_0x34fb('0x1e')]),_0x350c71);agents['queuecallerabandon'](_0x350c71);queues[_0x34fb('0x25')](_0x350c71);}catch(_0x53defa){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x26'),_0x350c71[_0x34fb('0x1e')]),_0x53defa);}});ami['on'](_0x34fb('0x27'),function(_0x27eed0){try{utils['debug'](util[_0x34fb('0x19')](_0x34fb('0x28'),_0x27eed0[_0x34fb('0x1e')]),_0x27eed0);queues[_0x34fb('0x27')](_0x27eed0);recordings[_0x34fb('0x27')](_0x27eed0);}catch(_0xdf156a){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x28'),_0x27eed0[_0x34fb('0x1e')]),_0xdf156a);}});ami['on'](_0x34fb('0x29'),function(_0xf933a7){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x2a'),_0xf933a7[_0x34fb('0x1e')]),_0xf933a7);queues[_0x34fb('0x29')](_0xf933a7);}catch(_0x876ff9){utils[_0x34fb('0x15')](util['format'](_0x34fb('0x2a'),_0xf933a7[_0x34fb('0x1e')]),_0x876ff9);}});ami['on'](_0x34fb('0x2b'),function(_0x52cbf0){try{utils[_0x34fb('0x18')](util['format'](_0x34fb('0x2c'),_0x52cbf0['uniqueid']),_0x52cbf0);queues[_0x34fb('0x2b')](_0x52cbf0);calls[_0x34fb('0x2b')](_0x52cbf0);}catch(_0x3e4770){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x2c'),_0x52cbf0[_0x34fb('0x1e')]),_0x3e4770);}});ami['on'](_0x34fb('0x2d'),function(_0x2c0006){try{utils['debug'](util[_0x34fb('0x19')](_0x34fb('0x2e'),_0x2c0006['uniqueid']),_0x2c0006);queues[_0x34fb('0x2d')](_0x2c0006);calls[_0x34fb('0x2d')](_0x2c0006);}catch(_0x4c42f0){utils[_0x34fb('0x15')](util['format']('[%s][index][musiconholdstop]',_0x2c0006[_0x34fb('0x1e')]),_0x4c42f0);}});ami['on'](_0x34fb('0x2f'),function(_0x29c6f4){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x30'),_0x29c6f4[_0x34fb('0x1e')]),_0x29c6f4);calls[_0x34fb('0x2f')](_0x29c6f4);recordings['newstate'](_0x29c6f4);}catch(_0x4ad8e1){utils[_0x34fb('0x15')](util[_0x34fb('0x19')]('[%s][index][newstate]',_0x29c6f4[_0x34fb('0x1e')]),_0x4ad8e1);}});ami['on']('hangup',function(_0x36865a){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x31'),_0x36865a[_0x34fb('0x1e')]),_0x36865a);calls[_0x34fb('0x32')](_0x36865a);recordings[_0x34fb('0x32')](_0x36865a);dials[_0x34fb('0x32')](_0x36865a);agents[_0x34fb('0x32')](_0x36865a);queues[_0x34fb('0x32')](_0x36865a);}catch(_0x10e036){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x31'),_0x36865a[_0x34fb('0x1e')]),_0x10e036);}});ami['on']('cdr',function(_0x3c7202){try{utils[_0x34fb('0x18')](util['format']('[%s][index][cdr]',_0x3c7202[_0x34fb('0x1e')]),_0x3c7202);members[_0x34fb('0x33')](_0x3c7202);}catch(_0x4d0f1a){utils['error'](util['format'](_0x34fb('0x34'),_0x3c7202[_0x34fb('0x1e')]),_0x4d0f1a);}});ami['on'](_0x34fb('0x35'),function(_0x3c2c4b){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x36'),_0x3c2c4b[_0x34fb('0x1e')]),_0x3c2c4b);queues['blindtransfer'](_0x3c2c4b);agents[_0x34fb('0x35')](_0x3c2c4b);transfers[_0x34fb('0x35')](_0x3c2c4b);}catch(_0x157c5f){utils[_0x34fb('0x15')](util[_0x34fb('0x19')]('[%s][index][blindtransfer]',_0x3c2c4b[_0x34fb('0x1e')]),_0x157c5f);}});ami['on']('attendedtransfer',function(_0x1a6207){try{utils[_0x34fb('0x18')](util['format'](_0x34fb('0x37'),_0x1a6207[_0x34fb('0x38')]),_0x1a6207);queues[_0x34fb('0x39')](_0x1a6207);transfers[_0x34fb('0x39')](_0x1a6207);agents[_0x34fb('0x39')](_0x1a6207);calls['attendedtransfer'](_0x1a6207);}catch(_0x1b4867){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x37'),_0x1a6207[_0x34fb('0x38')]),_0x1b4867);}});ami['on'](_0x34fb('0x3a'),function(_0x27a6df){try{utils['debug'](util[_0x34fb('0x19')]('[%s][index][varset]',_0x27a6df['uniqueid']),_0x27a6df);queues[_0x34fb('0x3a')](_0x27a6df);recordings[_0x34fb('0x3a')](_0x27a6df);calls[_0x34fb('0x3a')](_0x27a6df);dials[_0x34fb('0x3a')](_0x27a6df);}catch(_0x54c316){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x3b'),_0x27a6df['uniqueid']),_0x54c316);}});ami['on'](_0x34fb('0x3c'),function(_0x3f36c2){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x3d'),_0x3f36c2[_0x34fb('0x1e')]),_0x3f36c2);calls[_0x34fb('0x3c')](_0x3f36c2);recordings[_0x34fb('0x3c')](_0x3f36c2);dials[_0x34fb('0x3c')](_0x3f36c2);}catch(_0x1de796){utils[_0x34fb('0x15')](util[_0x34fb('0x19')](_0x34fb('0x3d'),_0x3f36c2['uniqueid']),_0x1de796);}});ami['on']('newchannel',function(_0xf8932a){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x3e'),_0xf8932a['uniqueid']),_0xf8932a);calls[_0x34fb('0x3f')](_0xf8932a);recordings[_0x34fb('0x3f')](_0xf8932a);}catch(_0x5f027e){utils['error'](util[_0x34fb('0x19')]('[%s][index][newchannel]',_0xf8932a[_0x34fb('0x1e')]),_0x5f027e);}});ami['on']('dialbegin',function(_0xf43c0){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x40'),_0xf43c0['uniqueid']),_0xf43c0);dials['dialbegin'](_0xf43c0);}catch(_0x280194){utils['error'](util[_0x34fb('0x19')](_0x34fb('0x41'),_0xf43c0['uniqueid']),_0x280194);}});ami['on'](_0x34fb('0x42'),function(_0x57f6c9){try{utils[_0x34fb('0x18')](util[_0x34fb('0x19')](_0x34fb('0x43'),_0x57f6c9[_0x34fb('0x1e')]),_0x57f6c9);dials['dialend'](_0x57f6c9);}catch(_0x214579){utils[_0x34fb('0x15')](util['format'](_0x34fb('0x43'),_0x57f6c9['uniqueid']),_0x214579);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index bae91ba..589679f 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 _0x14ef=['data2','membername','type','getUserByInterface','then','name','internal','request','split','CreateMemberReport','error','[%s][members][writeDB]','startsWith','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','TALKING','now','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','debug','[%s][members][agentcomplete]','assign','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel'];(function(_0x516eca,_0x460241){var _0x115880=function(_0x5843c2){while(--_0x5843c2){_0x516eca['push'](_0x516eca['shift']());}};_0x115880(++_0x460241);}(_0x14ef,0xf8));var _0xf14e=function(_0x14bf66,_0x3e1066){_0x14bf66=_0x14bf66-0x0;var _0xaf4bf7=_0x14ef[_0x14bf66];return _0xaf4bf7;};'use strict';var _=require(_0xf14e('0x0'));var util=require(_0xf14e('0x1'));var utils=require('./utils');var members={};var exclude=[_0xf14e('0x2'),_0xf14e('0x3')];function writeDB(_0x4182d2){utils[_0xf14e('0x4')](util[_0xf14e('0x5')](_0xf14e('0x6'),_0x4182d2[_0xf14e('0x7')],_0x4182d2[_0xf14e('0x8')],_0x4182d2[_0xf14e('0x9')],_0x4182d2[_0xf14e('0xa')],_0x4182d2[_0xf14e('0xb')],_0x4182d2[_0xf14e('0xc')]));if(_0x4182d2[_0xf14e('0x8')]){utils[_0xf14e('0xd')](_0x4182d2['interface'])[_0xf14e('0xe')](function(_0x376551){if(_0x376551){_0x4182d2[_0xf14e('0xb')]=_0x376551[_0xf14e('0xf')];_0x4182d2[_0xf14e('0x10')]=_0x376551[_0xf14e('0x10')];utils[_0xf14e('0x11')]('CreateMemberReport',_0x4182d2);}else{utils['getUserByName'](_0x4182d2['interface'][_0xf14e('0x12')]('/')[0x1])[_0xf14e('0xe')](function(_0x361066){if(_0x361066){_0x4182d2[_0xf14e('0xb')]=_0x361066[_0xf14e('0xf')];_0x4182d2[_0xf14e('0x10')]=_0x361066[_0xf14e('0x10')];utils[_0xf14e('0x11')](_0xf14e('0x13'),_0x4182d2);}});}})['catch'](function(_0x49cfda){utils[_0xf14e('0x14')](util[_0xf14e('0x5')](_0xf14e('0x15'),_0x4182d2[_0xf14e('0x7')]),_0x49cfda);});}delete members[_0x4182d2[_0xf14e('0x8')]];}function startsWith(_0x330668,_0x32fe4e){return _['some'](_0x330668,function(_0x981a65){return _[_0xf14e('0x16')](_0x32fe4e,_0x981a65);});}exports['devicestatechange']=function(_0x580f44){try{utils['debug'](util['format']('[%s][members][devicestatechange]',members[_0x580f44[_0xf14e('0x17')]]?members[_0x580f44[_0xf14e('0x17')]][_0xf14e('0x7')]:_0x580f44[_0xf14e('0x17')]),_0x580f44);utils[_0xf14e('0x4')](util['format'](_0xf14e('0x18'),members[_0x580f44['device']]?members[_0x580f44[_0xf14e('0x17')]][_0xf14e('0x7')]:_0x580f44[_0xf14e('0x17')],_0x580f44[_0xf14e('0x19')],_0x580f44[_0xf14e('0x17')]));switch(_0x580f44[_0xf14e('0x19')]){case'INUSE':case _0xf14e('0x1a'):if(!startsWith(exclude,_0x580f44[_0xf14e('0x17')])){members[_0x580f44[_0xf14e('0x17')]]={'channel':'voice','interface':_0x580f44[_0xf14e('0x17')],'type':_0xf14e('0x1b'),'enterAt':utils[_0xf14e('0x1c')](),'role':'agent'};}break;case _0xf14e('0x1d'):if(!_[_0xf14e('0x1e')](members[_0x580f44[_0xf14e('0x17')]])){members[_0x580f44['device']][_0xf14e('0x1f')]=utils[_0xf14e('0x1c')]();members[_0x580f44['device']][_0xf14e('0x20')]=utils[_0xf14e('0x21')](members[_0x580f44[_0xf14e('0x17')]]['exitAt'],members[_0x580f44[_0xf14e('0x17')]][_0xf14e('0x22')]);if(members[_0x580f44[_0xf14e('0x17')]][_0xf14e('0x7')]){writeDB(members[_0x580f44[_0xf14e('0x17')]]);}}break;default:break;}}catch(_0x2f1b44){utils['error'](util[_0xf14e('0x5')](_0xf14e('0x23'),members[_0x580f44[_0xf14e('0x17')]]?members[_0x580f44['device']]['uniqueid']:_0x580f44[_0xf14e('0x17')]),_0x2f1b44);}};exports['agentcomplete']=function(_0x43f38f){try{if(!_[_0xf14e('0x1e')](members[_0x43f38f[_0xf14e('0x8')]])){utils[_0xf14e('0x24')](util['format'](_0xf14e('0x25'),_0x43f38f[_0xf14e('0x7')]),_0x43f38f);utils[_0xf14e('0x4')](util['format']('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x43f38f[_0xf14e('0x7')],_0x43f38f['interface'],_0x43f38f['queue']));members[_0x43f38f[_0xf14e('0x8')]]=_[_0xf14e('0x26')](members[_0x43f38f[_0xf14e('0x8')]],{'data4':_0x43f38f['queue'],'uniqueid':_0x43f38f[_0xf14e('0x7')]});}}catch(_0x57fce4){utils[_0xf14e('0x14')](util['format']('[%s][members][agentcomplete]',_0x43f38f[_0xf14e('0x7')]),_0x57fce4);}};exports['cdr']=function(_0x42a4ff){try{utils['debug'](util[_0xf14e('0x5')]('[%s][members][cdr]',_0x42a4ff['uniqueid']),_0x42a4ff);if(_0x42a4ff[_0xf14e('0x9')]){var _0x280384=_0x42a4ff['channel'][_0xf14e('0x12')]('-')[0x0];if(!_[_0xf14e('0x1e')](members[_0x280384])){members[_0x280384]=_[_0xf14e('0x26')](members[_0x280384],{'data1':members[_0x280384]['data1']||_0x42a4ff['type'],'data2':members[_0x280384][_0xf14e('0xa')]||_0x42a4ff[_0xf14e('0x27')],'data3':members[_0x280384][_0xf14e('0x28')]||_0x42a4ff[_0xf14e('0x29')],'uniqueid':members[_0x280384]['uniqueid']||_0x42a4ff[_0xf14e('0x7')]});utils[_0xf14e('0x4')](util[_0xf14e('0x5')](_0xf14e('0x2a'),_0x42a4ff[_0xf14e('0x7')],members[_0x280384]['data1'],members[_0x280384]['data2'],members[_0x280384][_0xf14e('0x28')]));if(members[_0x280384][_0xf14e('0x1f')]){writeDB(members[_0x280384]);}}}if(_0x42a4ff['destinationchannel']){var _0x2072f1=_0x42a4ff['destinationchannel'][_0xf14e('0x12')]('-')[0x0];if(!_[_0xf14e('0x1e')](members[_0x2072f1])){members[_0x2072f1]=_[_0xf14e('0x26')](members[_0x2072f1],{'data1':members[_0x2072f1]['data1']||_0x42a4ff['type'],'data2':members[_0x2072f1][_0xf14e('0xa')]||_0x42a4ff[_0xf14e('0x27')],'data3':members[_0x2072f1][_0xf14e('0x28')]||_0x42a4ff[_0xf14e('0x29')],'uniqueid':members[_0x2072f1][_0xf14e('0x7')]||_0x42a4ff['uniqueid']});utils['info'](util[_0xf14e('0x5')](_0xf14e('0x2a'),_0x42a4ff[_0xf14e('0x7')],members[_0x2072f1]['data1'],members[_0x2072f1]['data2'],members[_0x2072f1][_0xf14e('0x28')]));if(members[_0x2072f1][_0xf14e('0x1f')]){writeDB(members[_0x2072f1]);}}}}catch(_0x487233){utils['error'](util[_0xf14e('0x5')]('[%s][members][cdr]',_0x42a4ff[_0xf14e('0x7')]),_0x487233);}}; \ No newline at end of file +var _0x1502=['[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','getUserByInterface','name','internal','request','CreateMemberReport','split','then','catch','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','INUSE','BUSY','voice','TALKING','now','isNil','exitAt','duration','enterAt','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','channel','data1','type','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x1502,0x1c3));var _0x2150=function(_0x54fb8e,_0x4c1800){_0x54fb8e=_0x54fb8e-0x0;var _0x5a8fd6=_0x1502[_0x54fb8e];return _0x5a8fd6;};'use strict';var _=require(_0x2150('0x0'));var util=require(_0x2150('0x1'));var utils=require(_0x2150('0x2'));var members={};var exclude=[_0x2150('0x3'),_0x2150('0x4')];function writeDB(_0x208af9){utils['info'](util[_0x2150('0x5')](_0x2150('0x6'),_0x208af9[_0x2150('0x7')],_0x208af9[_0x2150('0x8')],_0x208af9['channel'],_0x208af9[_0x2150('0x9')],_0x208af9[_0x2150('0xa')],_0x208af9['type']));if(_0x208af9[_0x2150('0x8')]){utils[_0x2150('0xb')](_0x208af9[_0x2150('0x8')])['then'](function(_0x31a4f){if(_0x31a4f){_0x208af9[_0x2150('0xa')]=_0x31a4f[_0x2150('0xc')];_0x208af9['internal']=_0x31a4f[_0x2150('0xd')];utils[_0x2150('0xe')](_0x2150('0xf'),_0x208af9);}else{utils['getUserByName'](_0x208af9[_0x2150('0x8')][_0x2150('0x10')]('/')[0x1])[_0x2150('0x11')](function(_0x30975e){if(_0x30975e){_0x208af9['membername']=_0x30975e['name'];_0x208af9[_0x2150('0xd')]=_0x30975e[_0x2150('0xd')];utils['request']('CreateMemberReport',_0x208af9);}});}})[_0x2150('0x12')](function(_0x1536f){utils[_0x2150('0x13')](util['format']('[%s][members][writeDB]',_0x208af9[_0x2150('0x7')]),_0x1536f);});}delete members[_0x208af9[_0x2150('0x8')]];}function startsWith(_0x4beabc,_0x13ad4b){return _[_0x2150('0x14')](_0x4beabc,function(_0x3543a1){return _[_0x2150('0x15')](_0x13ad4b,_0x3543a1);});}exports[_0x2150('0x16')]=function(_0x31b9fb){try{utils[_0x2150('0x17')](util[_0x2150('0x5')](_0x2150('0x18'),members[_0x31b9fb[_0x2150('0x19')]]?members[_0x31b9fb[_0x2150('0x19')]][_0x2150('0x7')]:_0x31b9fb[_0x2150('0x19')]),_0x31b9fb);utils['info'](util['format'](_0x2150('0x1a'),members[_0x31b9fb[_0x2150('0x19')]]?members[_0x31b9fb[_0x2150('0x19')]][_0x2150('0x7')]:_0x31b9fb['device'],_0x31b9fb['state'],_0x31b9fb[_0x2150('0x19')]));switch(_0x31b9fb['state']){case _0x2150('0x1b'):case _0x2150('0x1c'):if(!startsWith(exclude,_0x31b9fb[_0x2150('0x19')])){members[_0x31b9fb[_0x2150('0x19')]]={'channel':_0x2150('0x1d'),'interface':_0x31b9fb['device'],'type':_0x2150('0x1e'),'enterAt':utils[_0x2150('0x1f')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0x2150('0x20')](members[_0x31b9fb[_0x2150('0x19')]])){members[_0x31b9fb[_0x2150('0x19')]][_0x2150('0x21')]=utils[_0x2150('0x1f')]();members[_0x31b9fb[_0x2150('0x19')]][_0x2150('0x22')]=utils['diffTime'](members[_0x31b9fb[_0x2150('0x19')]]['exitAt'],members[_0x31b9fb['device']][_0x2150('0x23')]);if(members[_0x31b9fb[_0x2150('0x19')]]['uniqueid']){writeDB(members[_0x31b9fb['device']]);}}break;default:break;}}catch(_0xabd935){utils['error'](util[_0x2150('0x5')](_0x2150('0x18'),members[_0x31b9fb[_0x2150('0x19')]]?members[_0x31b9fb[_0x2150('0x19')]]['uniqueid']:_0x31b9fb[_0x2150('0x19')]),_0xabd935);}};exports['agentcomplete']=function(_0x1b1d6a){try{if(!_['isNil'](members[_0x1b1d6a[_0x2150('0x8')]])){utils[_0x2150('0x17')](util[_0x2150('0x5')](_0x2150('0x24'),_0x1b1d6a[_0x2150('0x7')]),_0x1b1d6a);utils[_0x2150('0x25')](util[_0x2150('0x5')](_0x2150('0x26'),_0x1b1d6a[_0x2150('0x7')],_0x1b1d6a[_0x2150('0x8')],_0x1b1d6a[_0x2150('0x27')]));members[_0x1b1d6a[_0x2150('0x8')]]=_[_0x2150('0x28')](members[_0x1b1d6a['interface']],{'data4':_0x1b1d6a[_0x2150('0x27')],'uniqueid':_0x1b1d6a[_0x2150('0x7')]});}}catch(_0x656c7f){utils[_0x2150('0x13')](util[_0x2150('0x5')](_0x2150('0x24'),_0x1b1d6a['uniqueid']),_0x656c7f);}};exports['cdr']=function(_0x253c5f){try{utils[_0x2150('0x17')](util[_0x2150('0x5')]('[%s][members][cdr]',_0x253c5f[_0x2150('0x7')]),_0x253c5f);if(_0x253c5f[_0x2150('0x29')]){var _0x2b4050=_0x253c5f['channel']['split']('-')[0x0];if(!_[_0x2150('0x20')](members[_0x2b4050])){members[_0x2b4050]=_[_0x2150('0x28')](members[_0x2b4050],{'data1':members[_0x2b4050][_0x2150('0x2a')]||_0x253c5f[_0x2150('0x2b')],'data2':members[_0x2b4050][_0x2150('0x9')]||_0x253c5f[_0x2150('0x2c')],'data3':members[_0x2b4050][_0x2150('0x2d')]||_0x253c5f[_0x2150('0x2e')],'uniqueid':members[_0x2b4050][_0x2150('0x7')]||_0x253c5f[_0x2150('0x7')]});utils[_0x2150('0x25')](util[_0x2150('0x5')](_0x2150('0x2f'),_0x253c5f[_0x2150('0x7')],members[_0x2b4050][_0x2150('0x2a')],members[_0x2b4050]['data2'],members[_0x2b4050]['data3']));if(members[_0x2b4050]['exitAt']){writeDB(members[_0x2b4050]);}}}if(_0x253c5f[_0x2150('0x30')]){var _0x5b240e=_0x253c5f[_0x2150('0x30')]['split']('-')[0x0];if(!_['isNil'](members[_0x5b240e])){members[_0x5b240e]=_[_0x2150('0x28')](members[_0x5b240e],{'data1':members[_0x5b240e][_0x2150('0x2a')]||_0x253c5f[_0x2150('0x2b')],'data2':members[_0x5b240e][_0x2150('0x9')]||_0x253c5f[_0x2150('0x2c')],'data3':members[_0x5b240e]['data3']||_0x253c5f[_0x2150('0x2e')],'uniqueid':members[_0x5b240e][_0x2150('0x7')]||_0x253c5f[_0x2150('0x7')]});utils['info'](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x253c5f[_0x2150('0x7')],members[_0x5b240e][_0x2150('0x2a')],members[_0x5b240e]['data2'],members[_0x5b240e][_0x2150('0x2d')]));if(members[_0x5b240e][_0x2150('0x21')]){writeDB(members[_0x5b240e]);}}}}catch(_0x555ec6){utils[_0x2150('0x13')](util['format'](_0x2150('0x31'),_0x253c5f['uniqueid']),_0x555ec6);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index ea0d8d4..8a65370 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 _0x1cde=['COMPLETEDBYAGENT','name','varset','isNil','variable','queuestatus','value','CONTINUE','queuecallerabandonAt','queuecallerexitAt','toUpperCase','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][varset]','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleave','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','agentcomplete','assigned','queuecallercompleteAt','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfertype','BLIND','transfereeuniqueid','extension','transferuniqueid','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','origtransfererexten','secondtransfererlinkedid','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','clone','transfertargetuniqueid','calleridnum','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transferexten','secondtransfereruniqueid','transfertargetlinkedid','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','accountcode','queuecallerexitreason','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete'];(function(_0x5e6d65,_0x5db89c){var _0x5e1f75=function(_0x3729a1){while(--_0x3729a1){_0x5e6d65['push'](_0x5e6d65['shift']());}};_0x5e1f75(++_0x5db89c);}(_0x1cde,0xad));var _0xe1cd=function(_0x5c87ee,_0x2ce9cd){_0x5c87ee=_0x5c87ee-0x0;var _0x2a8609=_0x1cde[_0x5c87ee];return _0x2a8609;};'use strict';var _=require(_0xe1cd('0x0'));var util=require(_0xe1cd('0x1'));var utils=require(_0xe1cd('0x2'));var queues={};function writeDB(_0x279993){utils[_0xe1cd('0x3')](util['format'](_0xe1cd('0x4'),_0x279993[_0xe1cd('0x5')],_0x279993['channel'],_0x279993[_0xe1cd('0x6')],_0x279993[_0xe1cd('0x7')],_0x279993['calleridnum'],_0x279993[_0xe1cd('0x8')],_0x279993[_0xe1cd('0x9')]));if(_0x279993['queue']){utils['getVoiceQueueByName'](_0x279993[_0xe1cd('0x6')])[_0xe1cd('0xa')](function(_0x42d32e){if(_0x42d32e){_0x279993['type']=_0x42d32e[_0xe1cd('0xb')];}utils[_0xe1cd('0xc')](_0xe1cd('0xd'),_0x279993);});}else{utils[_0xe1cd('0xc')]('CreateVoiceQueueReport',_0x279993);}if(_0x279993[_0xe1cd('0xe')]){delete queues[_0x279993[_0xe1cd('0xe')]];}else{delete queues[_0x279993[_0xe1cd('0x5')]];}}exports[_0xe1cd('0xf')]=function(_0x38f737){try{utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')](_0xe1cd('0x12'),_0x38f737['uniqueid']),_0x38f737);utils[_0xe1cd('0x3')](util['format'](_0xe1cd('0x13'),_0x38f737[_0xe1cd('0x5')],_0x38f737[_0xe1cd('0x6')],_0x38f737[_0xe1cd('0x14')]));queues[_0x38f737[_0xe1cd('0x5')]]=_[_0xe1cd('0x15')](_0x38f737,{'originalposition':_0x38f737['position'],'queuecallerjoinAt':utils[_0xe1cd('0x16')](),'mohtime':0x0});}catch(_0x5f2233){utils[_0xe1cd('0x17')](util[_0xe1cd('0x11')]('[%s][queues][queuecallerjoin]',_0x38f737[_0xe1cd('0x5')]),_0x5f2233);}};exports[_0xe1cd('0x18')]=function(_0x2ceca3){try{if(!_['isNil'](queues[_0x2ceca3[_0xe1cd('0x5')]])){utils[_0xe1cd('0x10')](util['format']('[%s][queues][hangup]',_0x2ceca3[_0xe1cd('0x5')]),_0x2ceca3);if(queues[_0x2ceca3[_0xe1cd('0x5')]][_0xe1cd('0x19')]){if(!queues[_0x2ceca3[_0xe1cd('0x5')]][_0xe1cd('0x1a')]&&!queues[_0x2ceca3['uniqueid']][_0xe1cd('0x1b')]){queues[_0x2ceca3['uniqueid']][_0xe1cd('0x1c')]=!![];queues[_0x2ceca3[_0xe1cd('0x5')]]['queuecallercompleteAt']=utils[_0xe1cd('0x16')]();queues[_0x2ceca3['uniqueid']][_0xe1cd('0x9')]=_0xe1cd('0x1d');}utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x2ceca3[_0xe1cd('0x5')],queues[_0x2ceca3[_0xe1cd('0x5')]][_0xe1cd('0x1e')],queues[_0x2ceca3[_0xe1cd('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x2ceca3[_0xe1cd('0x5')]]);}else if(queues[_0x2ceca3[_0xe1cd('0x5')]][_0xe1cd('0xe')]){utils['info'](util[_0xe1cd('0x11')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2ceca3[_0xe1cd('0x5')],queues[_0x2ceca3[_0xe1cd('0x5')]][_0xe1cd('0x1e')],queues[_0x2ceca3[_0xe1cd('0x5')]]['transfereduniqueid']));queues[queues[_0x2ceca3['uniqueid']][_0xe1cd('0xe')]]=queues[_0x2ceca3[_0xe1cd('0x5')]];queues[queues[_0x2ceca3[_0xe1cd('0x5')]][_0xe1cd('0xe')]]['queuecallerenterreason']=0x2;delete queues[_0x2ceca3[_0xe1cd('0x5')]];}}}catch(_0x12da7a){utils['error'](util[_0xe1cd('0x11')]('[%s][queues][hangup]',_0x2ceca3[_0xe1cd('0x5')]),_0x12da7a);}};exports[_0xe1cd('0x1f')]=function(_0x4946dc){try{utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')]('[%s][queues][varset]',_0x4946dc[_0xe1cd('0x5')]),_0x4946dc);if(!_[_0xe1cd('0x20')](_0x4946dc[_0xe1cd('0x21')][_0xe1cd('0x22')])&&_0x4946dc[_0xe1cd('0x23')]['toUpperCase']()!==_0xe1cd('0x24')){if(!_[_0xe1cd('0x20')](queues[_0x4946dc[_0xe1cd('0x5')]])){queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x1a')]=![];queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x25')]=null;queues[_0x4946dc['uniqueid']][_0xe1cd('0x1b')]=!![];queues[_0x4946dc['uniqueid']][_0xe1cd('0x26')]=utils['now']();queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x9')]=_0x4946dc['value'][_0xe1cd('0x27')]();utils['info'](util[_0xe1cd('0x11')](_0xe1cd('0x28'),_0x4946dc[_0xe1cd('0x5')],queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x1e')],_0x4946dc[_0xe1cd('0x23')],queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x9')]));writeDB(queues[_0x4946dc[_0xe1cd('0x5')]]);}}else if(!_[_0xe1cd('0x20')](_0x4946dc[_0xe1cd('0x21')][_0xe1cd('0x29')])){if(!_['isNil'](queues[_0x4946dc[_0xe1cd('0x5')]])&&!queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x1a')]){queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x1a')]=![];queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x25')]=null;queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x1b')]=!![];queues[_0x4946dc['uniqueid']][_0xe1cd('0x26')]=utils[_0xe1cd('0x16')]();queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x9')]='EXITWITHKEY';utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x2a'),_0x4946dc[_0xe1cd('0x5')],queues[_0x4946dc['uniqueid']]['name'],_0x4946dc[_0xe1cd('0x23')],queues[_0x4946dc[_0xe1cd('0x5')]][_0xe1cd('0x9')]));}}}catch(_0x1489bb){utils[_0xe1cd('0x17')](util['format'](_0xe1cd('0x2b'),_0x4946dc['uniqueid']),_0x1489bb);}};exports['queuecallerabandon']=function(_0x12c546){try{if(!_['isNil'](queues[_0x12c546[_0xe1cd('0x5')]])){utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')](_0xe1cd('0x2c'),_0x12c546[_0xe1cd('0x5')]),_0x12c546);queues[_0x12c546[_0xe1cd('0x5')]][_0xe1cd('0x1b')]=![];queues[_0x12c546[_0xe1cd('0x5')]][_0xe1cd('0x26')]=null;queues[_0x12c546[_0xe1cd('0x5')]]['queuecallerabandon']=!![];queues[_0x12c546[_0xe1cd('0x5')]][_0xe1cd('0x25')]=utils[_0xe1cd('0x16')]();queues[_0x12c546['uniqueid']][_0xe1cd('0x9')]=_0xe1cd('0x2d');utils[_0xe1cd('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x12c546[_0xe1cd('0x5')],queues[_0x12c546[_0xe1cd('0x5')]][_0xe1cd('0x1e')],queues[_0x12c546[_0xe1cd('0x5')]][_0xe1cd('0x9')]));}}catch(_0x2308c8){utils[_0xe1cd('0x17')](util[_0xe1cd('0x11')](_0xe1cd('0x2c'),_0x12c546['uniqueid']),_0x2308c8);}};exports['queuecallerleave']=function(_0x411e92){try{if(!_[_0xe1cd('0x20')](queues[_0x411e92['uniqueid']])){utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')](_0xe1cd('0x2e'),_0x411e92[_0xe1cd('0x5')]),_0x411e92);utils['info'](util[_0xe1cd('0x11')](_0xe1cd('0x2f'),_0x411e92[_0xe1cd('0x5')],queues[_0x411e92['uniqueid']][_0xe1cd('0x1e')],_0x411e92[_0xe1cd('0x30')],_0x411e92[_0xe1cd('0x31')]));queues[_0x411e92[_0xe1cd('0x5')]][_0xe1cd('0x32')]=!![];queues[_0x411e92[_0xe1cd('0x5')]][_0xe1cd('0x19')]=utils['now']();queues[_0x411e92[_0xe1cd('0x5')]]['holdtime']=utils[_0xe1cd('0x33')](queues[_0x411e92[_0xe1cd('0x5')]][_0xe1cd('0x19')],queues[_0x411e92[_0xe1cd('0x5')]][_0xe1cd('0x34')]);queues[_0x411e92['uniqueid']]['position']=_0x411e92[_0xe1cd('0x14')];queues[_0x411e92['uniqueid']][_0xe1cd('0x35')]=_0x411e92[_0xe1cd('0x35')];queues[_0x411e92[_0xe1cd('0x5')]][_0xe1cd('0x30')]=_0x411e92[_0xe1cd('0x30')];queues[_0x411e92[_0xe1cd('0x5')]][_0xe1cd('0x31')]=_0x411e92['connectedlinename'];}}catch(_0x4f640c){utils[_0xe1cd('0x17')](util[_0xe1cd('0x11')]('[%s][queues][queuecallerleave]',_0x411e92[_0xe1cd('0x5')]),_0x4f640c);}};exports[_0xe1cd('0x36')]=function(_0x150660){try{if(!_[_0xe1cd('0x20')](queues[_0x150660[_0xe1cd('0x5')]])){utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')](_0xe1cd('0x37'),_0x150660['uniqueid']),_0x150660);utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x38'),_0x150660[_0xe1cd('0x5')],queues[_0x150660['uniqueid']][_0xe1cd('0x1e')],_0x150660['membername'],_0x150660['destaccountcode']));queues[_0x150660[_0xe1cd('0x5')]][_0xe1cd('0x1a')]=![];queues[_0x150660['uniqueid']]['queuecallerabandon']=![];queues[_0x150660[_0xe1cd('0x5')]][_0xe1cd('0x25')]=null;queues[_0x150660['uniqueid']][_0xe1cd('0x1b')]=![];queues[_0x150660[_0xe1cd('0x5')]][_0xe1cd('0x9')]=null;queues[_0x150660['uniqueid']]['queuecallerexitAt']=null;queues[_0x150660[_0xe1cd('0x5')]]['assigned']=!![];queues[_0x150660[_0xe1cd('0x5')]][_0xe1cd('0x8')]=_0x150660['destaccountcode'];queues[_0x150660[_0xe1cd('0x5')]]['lastAssignedTo']=_0x150660[_0xe1cd('0x39')];}}catch(_0x538efe){utils[_0xe1cd('0x17')](util[_0xe1cd('0x11')]('[%s][queues][agentconnect]',_0x150660[_0xe1cd('0x5')]),_0x538efe);}};exports[_0xe1cd('0x3a')]=function(_0x4e4555){try{if(!_[_0xe1cd('0x20')](queues[_0x4e4555['uniqueid']])){if(queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x19')]){utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')]('[%s][queues][agentcomplete]',_0x4e4555[_0xe1cd('0x5')]),_0x4e4555);queues[_0x4e4555['uniqueid']][_0xe1cd('0x1a')]=![];queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x1a')]=![];queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x25')]=null;queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x1b')]=![];queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x26')]=null;queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x3b')]=!![];queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x7')]=_0x4e4555[_0xe1cd('0x39')];queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x1c')]=!![];queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x3c')]=utils['now']();if(_0x4e4555['reason']==_0xe1cd('0x3d')){if(!queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x3d')]){queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x9')]=_0xe1cd('0x3e');}}else{queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x9')]='COMPLETEDBY'+_0x4e4555['reason']['toUpperCase']();}utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x3f'),_0x4e4555['uniqueid'],queues[_0x4e4555[_0xe1cd('0x5')]][_0xe1cd('0x1e')],_0x4e4555['membername'],queues[_0x4e4555[_0xe1cd('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x4e4555[_0xe1cd('0x5')]]);}}}catch(_0x3e843c){utils[_0xe1cd('0x17')](util['format'](_0xe1cd('0x40'),_0x4e4555[_0xe1cd('0x5')]),_0x3e843c);}};exports[_0xe1cd('0x41')]=function(_0xdb3f2c){try{if(!_['isNil'](queues[_0xdb3f2c['transfereeuniqueid']])){utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')](_0xe1cd('0x42'),_0xdb3f2c[_0xe1cd('0x5')]),_0xdb3f2c);queues[_0xdb3f2c['transfereeuniqueid']][_0xe1cd('0x3d')]=!![];queues[_0xdb3f2c['transfereeuniqueid']][_0xe1cd('0x43')]=_0xe1cd('0x44');queues[_0xdb3f2c[_0xe1cd('0x45')]]['transferexten']=_0xdb3f2c[_0xe1cd('0x46')];queues[_0xdb3f2c[_0xe1cd('0x45')]][_0xe1cd('0x47')]=_0xdb3f2c['transfereeuniqueid'];queues[_0xdb3f2c[_0xe1cd('0x45')]][_0xe1cd('0x9')]='BLINDTRANSFER';utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x48'),_0xdb3f2c[_0xe1cd('0x5')],queues[_0xdb3f2c[_0xe1cd('0x45')]][_0xe1cd('0x1e')],_0xdb3f2c[_0xe1cd('0x45')],_0xdb3f2c[_0xe1cd('0x46')]));}}catch(_0x151ded){utils[_0xe1cd('0x17')](util[_0xe1cd('0x11')](_0xe1cd('0x42'),_0xdb3f2c[_0xe1cd('0x5')]),_0x151ded);}};exports[_0xe1cd('0x49')]=function(_0x579c40){try{utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')](_0xe1cd('0x4a'),_0x579c40[_0xe1cd('0x4b')]),_0x579c40);if(_0x579c40[_0xe1cd('0x4b')]==_0x579c40[_0xe1cd('0x4c')]){if(!_[_0xe1cd('0x20')](queues[_0x579c40['secondtransfererlinkedid']])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x579c40[_0xe1cd('0x4b')],queues[_0x579c40['secondtransfererlinkedid']]['name'],_0x579c40[_0xe1cd('0x4d')]));queues[_0x579c40[_0xe1cd('0x4e')]][_0xe1cd('0x3d')]=!![];queues[_0x579c40['secondtransfererlinkedid']]['transfertype']=_0xe1cd('0x4f');queues[_0x579c40[_0xe1cd('0x4e')]]['transferexten']=_0x579c40[_0xe1cd('0x4d')];queues[_0x579c40[_0xe1cd('0x4e')]]['transferuniqueid']=_0x579c40['origtransfereruniqueid'];queues[_0x579c40['secondtransfererlinkedid']]['queuecallerexitreason']=_0xe1cd('0x50');}if(!_[_0xe1cd('0x20')](queues[_0x579c40[_0xe1cd('0x4c')]])){if(_0x579c40[_0xe1cd('0x51')]&&queues[_0x579c40['transfereelinkedid']]){queues[_0x579c40[_0xe1cd('0x51')]][_0xe1cd('0x52')]=0x1;queues[_0x579c40[_0xe1cd('0x45')]]=_[_0xe1cd('0x53')](queues[_0x579c40[_0xe1cd('0x51')]]);queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0xe')]=_0x579c40[_0xe1cd('0x54')];queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0x52')]=0x2;queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0x55')]=queues[_0x579c40[_0xe1cd('0x4e')]]['calleridnum'];queues[_0x579c40['transfereeuniqueid']]['calleridname']=queues[_0x579c40[_0xe1cd('0x4e')]][_0xe1cd('0x56')];queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0x34')]=utils['now']();queues[_0x579c40['transfereeuniqueid']][_0xe1cd('0x19')]=utils[_0xe1cd('0x16')]();queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0x57')]=0x0;queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0x58')]=0x0;utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x59'),_0x579c40[_0xe1cd('0x4b')],queues[_0x579c40['transfereeuniqueid']]['name'],queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0x55')],queues[_0x579c40[_0xe1cd('0x45')]][_0xe1cd('0x56')]));}else{utils[_0xe1cd('0x3')](util['format'](_0xe1cd('0x5a'),_0x579c40[_0xe1cd('0x4b')],queues[_0x579c40['origtransfererlinkedid']][_0xe1cd('0x1e')],_0x579c40['secondtransfererlinkedid']));queues[_0x579c40[_0xe1cd('0x4c')]]['transfereduniqueid']=_0x579c40[_0xe1cd('0x4e')];}}}else if(_0x579c40['secondtransfereruniqueid']==_0x579c40[_0xe1cd('0x4e')]){if(!_[_0xe1cd('0x20')](queues[_0x579c40[_0xe1cd('0x4c')]])){utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x5b'),_0x579c40[_0xe1cd('0x4b')],queues[_0x579c40[_0xe1cd('0x4c')]][_0xe1cd('0x1e')],_0x579c40['secondtransfereruniqueid'],_0x579c40[_0xe1cd('0x5c')]));queues[_0x579c40[_0xe1cd('0x4c')]][_0xe1cd('0x3d')]=!![];queues[_0x579c40[_0xe1cd('0x4c')]][_0xe1cd('0x43')]=_0xe1cd('0x4f');queues[_0x579c40[_0xe1cd('0x4c')]][_0xe1cd('0x5d')]=_0x579c40['secondtransfererexten'];queues[_0x579c40[_0xe1cd('0x4c')]][_0xe1cd('0x47')]=_0x579c40[_0xe1cd('0x5e')];queues[_0x579c40['origtransfererlinkedid']][_0xe1cd('0x9')]=_0xe1cd('0x50');}if(!_[_0xe1cd('0x20')](queues[_0x579c40[_0xe1cd('0x4e')]])){if(_0x579c40['transfertargetlinkedid']&&queues[_0x579c40[_0xe1cd('0x5f')]]){queues[_0x579c40['transfertargetlinkedid']][_0xe1cd('0x52')]=0x1;queues[_0x579c40[_0xe1cd('0x54')]]=_[_0xe1cd('0x53')](queues[_0x579c40[_0xe1cd('0x5f')]]);queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0xe')]=_0x579c40['transfertargetuniqueid'];queues[_0x579c40['transfertargetuniqueid']][_0xe1cd('0x52')]=0x2;queues[_0x579c40['transfertargetuniqueid']][_0xe1cd('0x55')]=queues[_0x579c40[_0xe1cd('0x4c')]][_0xe1cd('0x55')];queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0x56')]=queues[_0x579c40[_0xe1cd('0x4c')]][_0xe1cd('0x56')];queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0x34')]=utils[_0xe1cd('0x16')]();queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0x19')]=utils[_0xe1cd('0x16')]();queues[_0x579c40['transfertargetuniqueid']][_0xe1cd('0x57')]=0x0;queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0x58')]=0x0;utils['info'](util[_0xe1cd('0x11')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x579c40[_0xe1cd('0x4b')],queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0x1e')],queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0xe')],queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0x55')],queues[_0x579c40[_0xe1cd('0x54')]][_0xe1cd('0x56')]));}else{utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x5a'),_0x579c40[_0xe1cd('0x4b')],queues[_0x579c40[_0xe1cd('0x4e')]]['name'],_0x579c40['origtransfererlinkedid']));queues[_0x579c40[_0xe1cd('0x4e')]][_0xe1cd('0xe')]=_0x579c40[_0xe1cd('0x4c')];}}}}catch(_0x40c072){utils[_0xe1cd('0x17')](util[_0xe1cd('0x11')](_0xe1cd('0x4a'),_0x579c40[_0xe1cd('0x4b')]),_0x40c072);}};exports['musiconholdstart']=function(_0x116214){try{if(!_[_0xe1cd('0x20')](queues[_0x116214[_0xe1cd('0x5')]])){utils[_0xe1cd('0x10')](util[_0xe1cd('0x11')]('[%s][queues][musiconholdstart]',_0x116214[_0xe1cd('0x5')]),_0x116214);queues[_0x116214[_0xe1cd('0x5')]][_0xe1cd('0x60')]=utils[_0xe1cd('0x16')]();utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')](_0xe1cd('0x61'),_0x116214['uniqueid'],queues[_0x116214[_0xe1cd('0x5')]]['name'],queues[_0x116214[_0xe1cd('0x5')]][_0xe1cd('0x60')]));}}catch(_0x148dab){utils[_0xe1cd('0x17')](util['format'](_0xe1cd('0x62'),_0x116214[_0xe1cd('0x5')]),_0x148dab);}};exports[_0xe1cd('0x63')]=function(_0x2679b4){try{if(!_[_0xe1cd('0x20')](queues[_0x2679b4[_0xe1cd('0x5')]])){if(!_['isNil'](queues[_0x2679b4[_0xe1cd('0x5')]][_0xe1cd('0x60')])){utils[_0xe1cd('0x10')](util['format'](_0xe1cd('0x64'),_0x2679b4[_0xe1cd('0x5')]),_0x2679b4);queues[_0x2679b4[_0xe1cd('0x5')]][_0xe1cd('0x58')]+=utils[_0xe1cd('0x33')](utils[_0xe1cd('0x16')](),queues[_0x2679b4[_0xe1cd('0x5')]][_0xe1cd('0x60')]);utils[_0xe1cd('0x3')](util[_0xe1cd('0x11')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x2679b4[_0xe1cd('0x5')],queues[_0x2679b4[_0xe1cd('0x5')]][_0xe1cd('0x1e')],queues[_0x2679b4[_0xe1cd('0x5')]][_0xe1cd('0x58')]));delete queues[_0x2679b4[_0xe1cd('0x5')]]['musiconholdstartAt'];}}}catch(_0x234ba7){utils[_0xe1cd('0x17')](util[_0xe1cd('0x11')](_0xe1cd('0x64'),_0x2679b4[_0xe1cd('0x5')]),_0x234ba7);}}; \ No newline at end of file +var _0x0d52=['queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','variable','queueposition','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','queuecallerleave','queuecallerleaveAt','holdtime','diffTime','count','connectedlinenum','agentconnect','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','lastAssignedTo','[%s][queues][agentconnect]','agentcomplete','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','origtransfererlinkedid','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','secondtransfereruniqueid','secondtransfererexten','transfertype','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','[%s][queues][musiconholdstop]','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','queuecallerabandon','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','[%s][queues][varset]'];(function(_0x583aa3,_0x16854){var _0x37a92c=function(_0x1a6259){while(--_0x1a6259){_0x583aa3['push'](_0x583aa3['shift']());}};_0x37a92c(++_0x16854);}(_0x0d52,0x1f2));var _0x20d5=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0x0d52[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x20d5('0x0'));var util=require(_0x20d5('0x1'));var utils=require(_0x20d5('0x2'));var queues={};function writeDB(_0x5964ad){utils[_0x20d5('0x3')](util['format'](_0x20d5('0x4'),_0x5964ad[_0x20d5('0x5')],_0x5964ad[_0x20d5('0x6')],_0x5964ad[_0x20d5('0x7')],_0x5964ad['lastAssignedTo'],_0x5964ad[_0x20d5('0x8')],_0x5964ad[_0x20d5('0x9')],_0x5964ad[_0x20d5('0xa')]));if(_0x5964ad['queue']){utils[_0x20d5('0xb')](_0x5964ad['queue'])[_0x20d5('0xc')](function(_0x585bbf){if(_0x585bbf){_0x5964ad[_0x20d5('0xd')]=_0x585bbf['type'];}utils[_0x20d5('0xe')](_0x20d5('0xf'),_0x5964ad);});}else{utils[_0x20d5('0xe')](_0x20d5('0xf'),_0x5964ad);}if(_0x5964ad[_0x20d5('0x10')]){delete queues[_0x5964ad[_0x20d5('0x10')]];}else{delete queues[_0x5964ad['uniqueid']];}}exports[_0x20d5('0x11')]=function(_0x20dd6b){try{utils[_0x20d5('0x12')](util[_0x20d5('0x13')](_0x20d5('0x14'),_0x20dd6b['uniqueid']),_0x20dd6b);utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x15'),_0x20dd6b[_0x20d5('0x5')],_0x20dd6b[_0x20d5('0x7')],_0x20dd6b[_0x20d5('0x16')]));queues[_0x20dd6b[_0x20d5('0x5')]]=_[_0x20d5('0x17')](_0x20dd6b,{'originalposition':_0x20dd6b[_0x20d5('0x16')],'queuecallerjoinAt':utils[_0x20d5('0x18')](),'mohtime':0x0});}catch(_0x117c4e){utils[_0x20d5('0x19')](util[_0x20d5('0x13')](_0x20d5('0x14'),_0x20dd6b[_0x20d5('0x5')]),_0x117c4e);}};exports[_0x20d5('0x1a')]=function(_0x5f10a9){try{if(!_[_0x20d5('0x1b')](queues[_0x5f10a9[_0x20d5('0x5')]])){utils['debug'](util[_0x20d5('0x13')]('[%s][queues][hangup]',_0x5f10a9[_0x20d5('0x5')]),_0x5f10a9);if(queues[_0x5f10a9[_0x20d5('0x5')]]['queuecallerleaveAt']){if(!queues[_0x5f10a9['uniqueid']][_0x20d5('0x1c')]&&!queues[_0x5f10a9['uniqueid']]['queuecallerexit']){queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0x1d')]=!![];queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0x1e')]=utils['now']();queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0xa')]=_0x20d5('0x1f');}utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x20'),_0x5f10a9[_0x20d5('0x5')],queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0x21')],queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0xa')]));writeDB(queues[_0x5f10a9[_0x20d5('0x5')]]);}else if(queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0x10')]){utils[_0x20d5('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5f10a9[_0x20d5('0x5')],queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0x21')],queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0x10')]));queues[queues[_0x5f10a9[_0x20d5('0x5')]]['transfereduniqueid']]=queues[_0x5f10a9[_0x20d5('0x5')]];queues[queues[_0x5f10a9[_0x20d5('0x5')]][_0x20d5('0x10')]][_0x20d5('0x22')]=0x2;delete queues[_0x5f10a9['uniqueid']];}}}catch(_0x5d92c5){utils[_0x20d5('0x19')](util[_0x20d5('0x13')](_0x20d5('0x23'),_0x5f10a9['uniqueid']),_0x5d92c5);}};exports['varset']=function(_0x331ec9){try{utils['debug'](util[_0x20d5('0x13')](_0x20d5('0x24'),_0x331ec9['uniqueid']),_0x331ec9);if(!_[_0x20d5('0x1b')](_0x331ec9['variable'][_0x20d5('0x25')])&&_0x331ec9['value'][_0x20d5('0x26')]()!==_0x20d5('0x27')){if(!_[_0x20d5('0x1b')](queues[_0x331ec9[_0x20d5('0x5')]])){queues[_0x331ec9[_0x20d5('0x5')]][_0x20d5('0x1c')]=![];queues[_0x331ec9[_0x20d5('0x5')]][_0x20d5('0x28')]=null;queues[_0x331ec9[_0x20d5('0x5')]][_0x20d5('0x29')]=!![];queues[_0x331ec9[_0x20d5('0x5')]]['queuecallerexitAt']=utils[_0x20d5('0x18')]();queues[_0x331ec9['uniqueid']][_0x20d5('0xa')]=_0x331ec9['value'][_0x20d5('0x26')]();utils['info'](util['format'](_0x20d5('0x2a'),_0x331ec9[_0x20d5('0x5')],queues[_0x331ec9[_0x20d5('0x5')]]['name'],_0x331ec9[_0x20d5('0x2b')],queues[_0x331ec9['uniqueid']][_0x20d5('0xa')]));writeDB(queues[_0x331ec9['uniqueid']]);}}else if(!_[_0x20d5('0x1b')](_0x331ec9[_0x20d5('0x2c')][_0x20d5('0x2d')])){if(!_[_0x20d5('0x1b')](queues[_0x331ec9[_0x20d5('0x5')]])&&!queues[_0x331ec9['uniqueid']][_0x20d5('0x1c')]){queues[_0x331ec9[_0x20d5('0x5')]]['queuecallerabandon']=![];queues[_0x331ec9[_0x20d5('0x5')]][_0x20d5('0x28')]=null;queues[_0x331ec9[_0x20d5('0x5')]][_0x20d5('0x29')]=!![];queues[_0x331ec9['uniqueid']][_0x20d5('0x2e')]=utils[_0x20d5('0x18')]();queues[_0x331ec9[_0x20d5('0x5')]]['queuecallerexitreason']=_0x20d5('0x2f');utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x30'),_0x331ec9['uniqueid'],queues[_0x331ec9['uniqueid']][_0x20d5('0x21')],_0x331ec9[_0x20d5('0x2b')],queues[_0x331ec9[_0x20d5('0x5')]][_0x20d5('0xa')]));}}}catch(_0x1cc52e){utils[_0x20d5('0x19')](util[_0x20d5('0x13')](_0x20d5('0x24'),_0x331ec9[_0x20d5('0x5')]),_0x1cc52e);}};exports[_0x20d5('0x1c')]=function(_0x536ad5){try{if(!_[_0x20d5('0x1b')](queues[_0x536ad5[_0x20d5('0x5')]])){utils[_0x20d5('0x12')](util[_0x20d5('0x13')](_0x20d5('0x31'),_0x536ad5[_0x20d5('0x5')]),_0x536ad5);queues[_0x536ad5[_0x20d5('0x5')]][_0x20d5('0x29')]=![];queues[_0x536ad5[_0x20d5('0x5')]][_0x20d5('0x2e')]=null;queues[_0x536ad5[_0x20d5('0x5')]]['queuecallerabandon']=!![];queues[_0x536ad5['uniqueid']][_0x20d5('0x28')]=utils[_0x20d5('0x18')]();queues[_0x536ad5[_0x20d5('0x5')]][_0x20d5('0xa')]=_0x20d5('0x32');utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x33'),_0x536ad5[_0x20d5('0x5')],queues[_0x536ad5[_0x20d5('0x5')]][_0x20d5('0x21')],queues[_0x536ad5[_0x20d5('0x5')]]['queuecallerexitreason']));}}catch(_0x1796a4){utils[_0x20d5('0x19')](util['format'](_0x20d5('0x31'),_0x536ad5['uniqueid']),_0x1796a4);}};exports['queuecallerleave']=function(_0x1f371d){try{if(!_[_0x20d5('0x1b')](queues[_0x1f371d[_0x20d5('0x5')]])){utils[_0x20d5('0x12')](util[_0x20d5('0x13')](_0x20d5('0x34'),_0x1f371d[_0x20d5('0x5')]),_0x1f371d);utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x35'),_0x1f371d[_0x20d5('0x5')],queues[_0x1f371d[_0x20d5('0x5')]][_0x20d5('0x21')],_0x1f371d['connectedlinenum'],_0x1f371d[_0x20d5('0x36')]));queues[_0x1f371d[_0x20d5('0x5')]][_0x20d5('0x37')]=!![];queues[_0x1f371d[_0x20d5('0x5')]][_0x20d5('0x38')]=utils['now']();queues[_0x1f371d[_0x20d5('0x5')]][_0x20d5('0x39')]=utils[_0x20d5('0x3a')](queues[_0x1f371d[_0x20d5('0x5')]]['queuecallerleaveAt'],queues[_0x1f371d[_0x20d5('0x5')]]['queuecallerjoinAt']);queues[_0x1f371d[_0x20d5('0x5')]][_0x20d5('0x16')]=_0x1f371d[_0x20d5('0x16')];queues[_0x1f371d['uniqueid']]['count']=_0x1f371d[_0x20d5('0x3b')];queues[_0x1f371d[_0x20d5('0x5')]][_0x20d5('0x3c')]=_0x1f371d[_0x20d5('0x3c')];queues[_0x1f371d[_0x20d5('0x5')]][_0x20d5('0x36')]=_0x1f371d[_0x20d5('0x36')];}}catch(_0x586026){utils['error'](util[_0x20d5('0x13')](_0x20d5('0x34'),_0x1f371d[_0x20d5('0x5')]),_0x586026);}};exports[_0x20d5('0x3d')]=function(_0x4404e1){try{if(!_[_0x20d5('0x1b')](queues[_0x4404e1[_0x20d5('0x5')]])){utils['debug'](util['format']('[%s][queues][agentconnect]',_0x4404e1['uniqueid']),_0x4404e1);utils[_0x20d5('0x3')](util['format'](_0x20d5('0x3e'),_0x4404e1[_0x20d5('0x5')],queues[_0x4404e1[_0x20d5('0x5')]][_0x20d5('0x21')],_0x4404e1[_0x20d5('0x3f')],_0x4404e1[_0x20d5('0x40')]));queues[_0x4404e1['uniqueid']]['queuecallerabandon']=![];queues[_0x4404e1[_0x20d5('0x5')]][_0x20d5('0x1c')]=![];queues[_0x4404e1['uniqueid']]['queuecallerabandonAt']=null;queues[_0x4404e1['uniqueid']][_0x20d5('0x29')]=![];queues[_0x4404e1[_0x20d5('0x5')]][_0x20d5('0xa')]=null;queues[_0x4404e1[_0x20d5('0x5')]][_0x20d5('0x2e')]=null;queues[_0x4404e1[_0x20d5('0x5')]]['assigned']=!![];queues[_0x4404e1[_0x20d5('0x5')]][_0x20d5('0x9')]=_0x4404e1[_0x20d5('0x40')];queues[_0x4404e1['uniqueid']][_0x20d5('0x41')]=_0x4404e1[_0x20d5('0x3f')];}}catch(_0x3f91cd){utils[_0x20d5('0x19')](util['format'](_0x20d5('0x42'),_0x4404e1[_0x20d5('0x5')]),_0x3f91cd);}};exports[_0x20d5('0x43')]=function(_0x2e89c7){try{if(!_[_0x20d5('0x1b')](queues[_0x2e89c7[_0x20d5('0x5')]])){if(queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x38')]){utils[_0x20d5('0x12')](util['format']('[%s][queues][agentcomplete]',_0x2e89c7[_0x20d5('0x5')]),_0x2e89c7);queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x1c')]=![];queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x1c')]=![];queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x28')]=null;queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x29')]=![];queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x2e')]=null;queues[_0x2e89c7[_0x20d5('0x5')]]['assigned']=!![];queues[_0x2e89c7['uniqueid']][_0x20d5('0x41')]=_0x2e89c7[_0x20d5('0x3f')];queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x1d')]=!![];queues[_0x2e89c7[_0x20d5('0x5')]]['queuecallercompleteAt']=utils[_0x20d5('0x18')]();if(_0x2e89c7[_0x20d5('0x44')]==_0x20d5('0x45')){if(!queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0x45')]){queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0xa')]=_0x20d5('0x46');}}else{queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0xa')]='COMPLETEDBY'+_0x2e89c7[_0x20d5('0x44')][_0x20d5('0x26')]();}utils[_0x20d5('0x3')](util['format'](_0x20d5('0x47'),_0x2e89c7[_0x20d5('0x5')],queues[_0x2e89c7['uniqueid']][_0x20d5('0x21')],_0x2e89c7['membername'],queues[_0x2e89c7[_0x20d5('0x5')]][_0x20d5('0xa')]));writeDB(queues[_0x2e89c7[_0x20d5('0x5')]]);}}}catch(_0x513276){utils[_0x20d5('0x19')](util['format'](_0x20d5('0x48'),_0x2e89c7[_0x20d5('0x5')]),_0x513276);}};exports[_0x20d5('0x49')]=function(_0x2bf8b5){try{if(!_[_0x20d5('0x1b')](queues[_0x2bf8b5[_0x20d5('0x4a')]])){utils[_0x20d5('0x12')](util[_0x20d5('0x13')](_0x20d5('0x4b'),_0x2bf8b5[_0x20d5('0x5')]),_0x2bf8b5);queues[_0x2bf8b5['transfereeuniqueid']][_0x20d5('0x45')]=!![];queues[_0x2bf8b5['transfereeuniqueid']]['transfertype']=_0x20d5('0x4c');queues[_0x2bf8b5['transfereeuniqueid']][_0x20d5('0x4d')]=_0x2bf8b5['extension'];queues[_0x2bf8b5[_0x20d5('0x4a')]][_0x20d5('0x4e')]=_0x2bf8b5[_0x20d5('0x4a')];queues[_0x2bf8b5[_0x20d5('0x4a')]][_0x20d5('0xa')]=_0x20d5('0x4f');utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x50'),_0x2bf8b5[_0x20d5('0x5')],queues[_0x2bf8b5['transfereeuniqueid']][_0x20d5('0x21')],_0x2bf8b5[_0x20d5('0x4a')],_0x2bf8b5['extension']));}}catch(_0x5ec2cd){utils[_0x20d5('0x19')](util[_0x20d5('0x13')](_0x20d5('0x4b'),_0x2bf8b5['uniqueid']),_0x5ec2cd);}};exports[_0x20d5('0x51')]=function(_0x1833df){try{utils[_0x20d5('0x12')](util[_0x20d5('0x13')](_0x20d5('0x52'),_0x1833df[_0x20d5('0x53')]),_0x1833df);if(_0x1833df[_0x20d5('0x53')]==_0x1833df['origtransfererlinkedid']){if(!_[_0x20d5('0x1b')](queues[_0x1833df[_0x20d5('0x54')]])){utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x55'),_0x1833df[_0x20d5('0x53')],queues[_0x1833df[_0x20d5('0x54')]][_0x20d5('0x21')],_0x1833df[_0x20d5('0x56')]));queues[_0x1833df['secondtransfererlinkedid']][_0x20d5('0x45')]=!![];queues[_0x1833df[_0x20d5('0x54')]]['transfertype']=_0x20d5('0x57');queues[_0x1833df['secondtransfererlinkedid']]['transferexten']=_0x1833df[_0x20d5('0x56')];queues[_0x1833df[_0x20d5('0x54')]][_0x20d5('0x4e')]=_0x1833df[_0x20d5('0x53')];queues[_0x1833df['secondtransfererlinkedid']][_0x20d5('0xa')]=_0x20d5('0x58');}if(!_['isNil'](queues[_0x1833df[_0x20d5('0x59')]])){if(_0x1833df['transfereelinkedid']&&queues[_0x1833df[_0x20d5('0x5a')]]){queues[_0x1833df['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x1833df[_0x20d5('0x4a')]]=_[_0x20d5('0x5b')](queues[_0x1833df[_0x20d5('0x5a')]]);queues[_0x1833df[_0x20d5('0x4a')]][_0x20d5('0x10')]=_0x1833df[_0x20d5('0x5c')];queues[_0x1833df['transfereeuniqueid']][_0x20d5('0x22')]=0x2;queues[_0x1833df[_0x20d5('0x4a')]][_0x20d5('0x8')]=queues[_0x1833df[_0x20d5('0x54')]][_0x20d5('0x8')];queues[_0x1833df[_0x20d5('0x4a')]][_0x20d5('0x5d')]=queues[_0x1833df[_0x20d5('0x54')]][_0x20d5('0x5d')];queues[_0x1833df[_0x20d5('0x4a')]][_0x20d5('0x5e')]=utils['now']();queues[_0x1833df[_0x20d5('0x4a')]][_0x20d5('0x38')]=utils[_0x20d5('0x18')]();queues[_0x1833df[_0x20d5('0x4a')]][_0x20d5('0x39')]=0x0;queues[_0x1833df[_0x20d5('0x4a')]]['mohtime']=0x0;utils[_0x20d5('0x3')](util[_0x20d5('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x1833df['origtransfereruniqueid'],queues[_0x1833df['transfereeuniqueid']][_0x20d5('0x21')],queues[_0x1833df['transfereeuniqueid']]['calleridnum'],queues[_0x1833df[_0x20d5('0x4a')]][_0x20d5('0x5d')]));}else{utils[_0x20d5('0x3')](util[_0x20d5('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x1833df[_0x20d5('0x53')],queues[_0x1833df[_0x20d5('0x59')]][_0x20d5('0x21')],_0x1833df[_0x20d5('0x54')]));queues[_0x1833df[_0x20d5('0x59')]][_0x20d5('0x10')]=_0x1833df[_0x20d5('0x54')];}}}else if(_0x1833df['secondtransfereruniqueid']==_0x1833df[_0x20d5('0x54')]){if(!_[_0x20d5('0x1b')](queues[_0x1833df['origtransfererlinkedid']])){utils[_0x20d5('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x1833df[_0x20d5('0x53')],queues[_0x1833df[_0x20d5('0x59')]][_0x20d5('0x21')],_0x1833df[_0x20d5('0x5f')],_0x1833df[_0x20d5('0x60')]));queues[_0x1833df[_0x20d5('0x59')]]['transfer']=!![];queues[_0x1833df[_0x20d5('0x59')]][_0x20d5('0x61')]=_0x20d5('0x57');queues[_0x1833df['origtransfererlinkedid']][_0x20d5('0x4d')]=_0x1833df[_0x20d5('0x60')];queues[_0x1833df[_0x20d5('0x59')]][_0x20d5('0x4e')]=_0x1833df[_0x20d5('0x5f')];queues[_0x1833df['origtransfererlinkedid']][_0x20d5('0xa')]=_0x20d5('0x58');}if(!_[_0x20d5('0x1b')](queues[_0x1833df[_0x20d5('0x54')]])){if(_0x1833df['transfertargetlinkedid']&&queues[_0x1833df['transfertargetlinkedid']]){queues[_0x1833df[_0x20d5('0x62')]]['queuecallerenterreason']=0x1;queues[_0x1833df[_0x20d5('0x5c')]]=_[_0x20d5('0x5b')](queues[_0x1833df[_0x20d5('0x62')]]);queues[_0x1833df[_0x20d5('0x5c')]][_0x20d5('0x10')]=_0x1833df[_0x20d5('0x5c')];queues[_0x1833df[_0x20d5('0x5c')]][_0x20d5('0x22')]=0x2;queues[_0x1833df[_0x20d5('0x5c')]][_0x20d5('0x8')]=queues[_0x1833df[_0x20d5('0x59')]]['calleridnum'];queues[_0x1833df[_0x20d5('0x5c')]][_0x20d5('0x5d')]=queues[_0x1833df[_0x20d5('0x59')]][_0x20d5('0x5d')];queues[_0x1833df['transfertargetuniqueid']][_0x20d5('0x5e')]=utils[_0x20d5('0x18')]();queues[_0x1833df[_0x20d5('0x5c')]]['queuecallerleaveAt']=utils[_0x20d5('0x18')]();queues[_0x1833df[_0x20d5('0x5c')]][_0x20d5('0x39')]=0x0;queues[_0x1833df[_0x20d5('0x5c')]]['mohtime']=0x0;utils[_0x20d5('0x3')](util[_0x20d5('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s',_0x1833df[_0x20d5('0x53')],queues[_0x1833df[_0x20d5('0x5c')]][_0x20d5('0x21')],queues[_0x1833df[_0x20d5('0x5c')]]['transfereduniqueid'],queues[_0x1833df['transfertargetuniqueid']][_0x20d5('0x8')],queues[_0x1833df[_0x20d5('0x5c')]][_0x20d5('0x5d')]));}else{utils[_0x20d5('0x3')](util['format'](_0x20d5('0x63'),_0x1833df[_0x20d5('0x53')],queues[_0x1833df[_0x20d5('0x54')]]['name'],_0x1833df[_0x20d5('0x59')]));queues[_0x1833df[_0x20d5('0x54')]][_0x20d5('0x10')]=_0x1833df[_0x20d5('0x59')];}}}}catch(_0x5f34af){utils[_0x20d5('0x19')](util[_0x20d5('0x13')](_0x20d5('0x52'),_0x1833df['origtransfereruniqueid']),_0x5f34af);}};exports[_0x20d5('0x64')]=function(_0xc30db){try{if(!_[_0x20d5('0x1b')](queues[_0xc30db[_0x20d5('0x5')]])){utils[_0x20d5('0x12')](util[_0x20d5('0x13')]('[%s][queues][musiconholdstart]',_0xc30db[_0x20d5('0x5')]),_0xc30db);queues[_0xc30db[_0x20d5('0x5')]][_0x20d5('0x65')]=utils[_0x20d5('0x18')]();utils[_0x20d5('0x3')](util[_0x20d5('0x13')](_0x20d5('0x66'),_0xc30db['uniqueid'],queues[_0xc30db[_0x20d5('0x5')]][_0x20d5('0x21')],queues[_0xc30db['uniqueid']][_0x20d5('0x65')]));}}catch(_0x18c7c6){utils[_0x20d5('0x19')](util['format']('[%s][queues][musiconholdstart]',_0xc30db[_0x20d5('0x5')]),_0x18c7c6);}};exports[_0x20d5('0x67')]=function(_0x52c0a4){try{if(!_[_0x20d5('0x1b')](queues[_0x52c0a4[_0x20d5('0x5')]])){if(!_[_0x20d5('0x1b')](queues[_0x52c0a4[_0x20d5('0x5')]][_0x20d5('0x65')])){utils[_0x20d5('0x12')](util[_0x20d5('0x13')]('[%s][queues][musiconholdstop]',_0x52c0a4['uniqueid']),_0x52c0a4);queues[_0x52c0a4['uniqueid']][_0x20d5('0x68')]+=utils[_0x20d5('0x3a')](utils['now'](),queues[_0x52c0a4[_0x20d5('0x5')]][_0x20d5('0x65')]);utils[_0x20d5('0x3')](util['format'](_0x20d5('0x69'),_0x52c0a4[_0x20d5('0x5')],queues[_0x52c0a4[_0x20d5('0x5')]][_0x20d5('0x21')],queues[_0x52c0a4[_0x20d5('0x5')]][_0x20d5('0x68')]));delete queues[_0x52c0a4[_0x20d5('0x5')]][_0x20d5('0x65')];}}}catch(_0x40b7be){utils[_0x20d5('0x19')](util[_0x20d5('0x13')](_0x20d5('0x6a'),_0x52c0a4['uniqueid']),_0x40b7be);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 55a2a97..895e454 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 _0x35b8=['lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','debug','[%s][recordings][newstate]','isNil','channelstate','info','[%s][recordings][newstate]\x20context:%s\x20channel:%s','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','accountcode','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','.WAV','find','monitors','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring'];(function(_0x1efe4d,_0x47fe94){var _0x12e0a4=function(_0x462885){while(--_0x462885){_0x1efe4d['push'](_0x1efe4d['shift']());}};_0x12e0a4(++_0x47fe94);}(_0x35b8,0x85));var _0x835b=function(_0x911353,_0x1648ed){_0x911353=_0x911353-0x0;var _0x2f05fa=_0x35b8[_0x911353];return _0x2f05fa;};'use strict';var _=require('lodash');var util=require(_0x835b('0x0'));var utils=require(_0x835b('0x1'));var recordings={};function writeDB(_0x201a3b){utils['info'](util[_0x835b('0x2')](_0x835b('0x3'),_0x201a3b[_0x835b('0x4')]));if(_0x201a3b['accountcode']){utils[_0x835b('0x5')](_0x201a3b['accountcode'])[_0x835b('0x6')](function(_0x334e73){if(_0x334e73){_0x201a3b[_0x835b('0x7')]=_0x334e73[_0x835b('0x8')];_0x201a3b[_0x835b('0x9')]=_0x334e73['id'];}utils[_0x835b('0xa')](_0x835b('0xb'),_0x201a3b);});}else{utils['request'](_0x835b('0xb'),_0x201a3b);}}exports['newchannel']=function(_0x3386c9){try{utils['debug'](util['format'](_0x835b('0xc'),_0x3386c9['uniqueid']),_0x3386c9);if(_0x3386c9[_0x835b('0x4')]==_0x3386c9[_0x835b('0xd')]){utils['info'](util[_0x835b('0x2')](_0x835b('0xe'),_0x3386c9[_0x835b('0x4')],_0x3386c9[_0x835b('0xf')],_0x3386c9[_0x835b('0x10')]));recordings[_0x3386c9[_0x835b('0x4')]]={'uniqueid':_0x3386c9['uniqueid'],'accountcode':_0x3386c9['accountcode'],'exten':_0x3386c9[_0x835b('0x10')],'context':_0x3386c9['context'],'channel':_0x3386c9[_0x835b('0x11')],'monitors':[]};}}catch(_0x3fde5f){utils[_0x835b('0x12')](util[_0x835b('0x2')]('[%s][recordings][newchannel]',_0x3386c9['uniqueid']),_0x3fde5f);}};exports['newstate']=function(_0xc28324){try{utils[_0x835b('0x13')](util['format'](_0x835b('0x14'),_0xc28324[_0x835b('0x4')]),_0xc28324);if(!_[_0x835b('0x15')](recordings[_0xc28324[_0x835b('0x4')]])&&_0xc28324[_0x835b('0x16')]==0x6){utils[_0x835b('0x17')](util[_0x835b('0x2')](_0x835b('0x18'),_0xc28324[_0x835b('0x4')],_0xc28324[_0x835b('0xf')],_0xc28324[_0x835b('0x11')]));}else if(!_[_0x835b('0x15')](recordings[_0xc28324[_0x835b('0xd')]])&&_0xc28324[_0x835b('0x16')]==0x6&&_0xc28324[_0x835b('0xf')]!=_0x835b('0x19')){utils[_0x835b('0x17')](util['format'](_0x835b('0x1a'),_0xc28324[_0x835b('0x4')],_0xc28324[_0x835b('0xd')],_0xc28324[_0x835b('0xf')],_0xc28324['channel']));recordings[_0xc28324[_0x835b('0xd')]][_0x835b('0x1b')]=_0xc28324[_0x835b('0x1b')];}}catch(_0x5c94f5){utils[_0x835b('0x12')](util[_0x835b('0x2')](_0x835b('0x14'),_0xc28324[_0x835b('0x4')]),_0x5c94f5);}};exports[_0x835b('0x1c')]=function(_0x720398){try{if(!_[_0x835b('0x15')](_0x720398['variable'])&&!_[_0x835b('0x15')](_0x720398[_0x835b('0x1d')][_0x835b('0x1e')])){utils['debug'](util[_0x835b('0x2')](_0x835b('0x1f'),_0x720398['uniqueid']),_0x720398);utils[_0x835b('0x17')](util[_0x835b('0x2')](_0x835b('0x20'),_0x720398['uniqueid'],_0x720398['variable'],_0x720398[_0x835b('0x21')]));if(_[_0x835b('0x22')](_0x720398[_0x835b('0x21')],_0x835b('0x23'))){_0x720398[_0x835b('0x21')]=_0x720398[_0x835b('0x21')][_0x835b('0x24')](_0x835b('0x23'),_0x835b('0x25'));}if(recordings[_0x720398[_0x835b('0xd')]]){var _0x74081e=_[_0x835b('0x26')](recordings[_0x720398[_0x835b('0xd')]][_0x835b('0x27')],{'value':_0x720398[_0x835b('0x21')]});if(_['isNil'](_0x74081e)){recordings[_0x720398[_0x835b('0xd')]][_0x835b('0x27')]['push']({'value':_0x720398[_0x835b('0x21')]});}}}}catch(_0x4353d2){utils[_0x835b('0x12')](util[_0x835b('0x2')](_0x835b('0x1f'),_0x720398[_0x835b('0x4')]),_0x4353d2);}};exports['hangup']=function(_0x4b08b8){try{if(!_[_0x835b('0x15')](recordings[_0x4b08b8['uniqueid']])){utils[_0x835b('0x13')](util[_0x835b('0x2')](_0x835b('0x28'),_0x4b08b8[_0x835b('0x4')]),_0x4b08b8);utils[_0x835b('0x17')](util[_0x835b('0x2')](_0x835b('0x29'),_0x4b08b8[_0x835b('0x4')],_0x4b08b8[_0x835b('0x2a')],_0x4b08b8['calleridname'],_0x4b08b8[_0x835b('0x2b')]));recordings[_0x4b08b8[_0x835b('0x4')]][_0x835b('0x2a')]=_0x4b08b8['calleridnum'];recordings[_0x4b08b8['uniqueid']][_0x835b('0x2c')]=_0x4b08b8['calleridname'];recordings[_0x4b08b8['uniqueid']][_0x835b('0x2d')]=_0x4b08b8[_0x835b('0x2d')];recordings[_0x4b08b8[_0x835b('0x4')]][_0x835b('0x2e')]=_0x4b08b8[_0x835b('0x2e')];if(recordings[_0x4b08b8[_0x835b('0x4')]]['type']==_0x835b('0x2f')&&recordings[_0x4b08b8[_0x835b('0x4')]][_0x835b('0x1b')]){recordings[_0x4b08b8[_0x835b('0x4')]][_0x835b('0x2d')]=recordings[_0x4b08b8[_0x835b('0x4')]][_0x835b('0x1b')];recordings[_0x4b08b8['uniqueid']]['connectedlinename']='';}recordings[_0x4b08b8['uniqueid']][_0x835b('0x27')]['forEach'](function(_0x5a6f34){var _0x3740ed=_[_0x835b('0x30')](recordings[_0x4b08b8[_0x835b('0x4')]]);_0x3740ed['value']=_0x5a6f34['value'];writeDB(_0x3740ed);});delete recordings[_0x4b08b8[_0x835b('0x4')]];}}catch(_0x35456f){utils['error'](util[_0x835b('0x2')](_0x835b('0x28'),_0x4b08b8['uniqueid']),_0x35456f);}};exports[_0x835b('0x31')]=function(_0x2f06a3){try{if(!_['isNil'](recordings[_0x2f06a3[_0x835b('0x4')]])){utils[_0x835b('0x13')](util[_0x835b('0x2')](_0x835b('0x32'),_0x2f06a3['uniqueid']),_0x2f06a3);utils[_0x835b('0x17')](util[_0x835b('0x2')](_0x835b('0x33'),_0x2f06a3['uniqueid'],_0x2f06a3[_0x835b('0x34')],_0x2f06a3[_0x835b('0x35')]));if(_0x2f06a3[_0x835b('0x34')][_0x835b('0x36')]()==_0x835b('0x37')&&_[_0x835b('0x38')](_0x2f06a3[_0x835b('0x35')][_0x835b('0x36')](),_0x835b('0x39'))){var _0x345b62=_0x2f06a3[_0x835b('0x35')]['split']('=');var _0x377003=_0x345b62[0x0][_0x835b('0x3a')](_0x345b62[0x0][_0x835b('0x3b')]('(')+0x1,_0x345b62[0x0][_0x835b('0x3b')](')'));var _0x4f7e6d=_0x345b62[0x1];recordings[_0x2f06a3[_0x835b('0x4')]][_0x377003]=_0x4f7e6d;}}}catch(_0xe04d30){utils[_0x835b('0x12')](util[_0x835b('0x2')]('[%s][recordings][newexten]',_0x2f06a3[_0x835b('0x4')]),_0xe04d30);}};exports[_0x835b('0x3c')]=function(_0x1f7e56){try{if(!_[_0x835b('0x15')](recordings[_0x1f7e56[_0x835b('0x4')]])){utils[_0x835b('0x13')](util[_0x835b('0x2')](_0x835b('0x3d'),_0x1f7e56[_0x835b('0x4')]),_0x1f7e56);utils[_0x835b('0x17')](util['format'](_0x835b('0x3e'),_0x1f7e56[_0x835b('0x4')],_0x1f7e56['queue']));recordings[_0x1f7e56[_0x835b('0x4')]][_0x835b('0x3f')]=_0x1f7e56[_0x835b('0x3f')];}}catch(_0x4be4db){utils[_0x835b('0x12')](util['format']('[%s][recordings][queuecallerjoin]',_0x1f7e56['uniqueid']),_0x4be4db);}}; \ No newline at end of file +var _0x9e1a=['split','substring','lastIndexOf','[%s][recordings][newexten]','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','util','./utils','info','format','[%s][recordings][writeDB]','uniqueid','getUserByInternal','then','UserId','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','accountcode','context','channel','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','.wav49','replace','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','outbound','clone','newexten','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr'];(function(_0x1e4133,_0x1ad0f4){var _0x4b3b9a=function(_0x3ef530){while(--_0x3ef530){_0x1e4133['push'](_0x1e4133['shift']());}};_0x4b3b9a(++_0x1ad0f4);}(_0x9e1a,0x1ef));var _0xa9e1=function(_0x57d6e4,_0x4e6f53){_0x57d6e4=_0x57d6e4-0x0;var _0x2426f1=_0x9e1a[_0x57d6e4];return _0x2426f1;};'use strict';var _=require('lodash');var util=require(_0xa9e1('0x0'));var utils=require(_0xa9e1('0x1'));var recordings={};function writeDB(_0xf68d4){utils[_0xa9e1('0x2')](util[_0xa9e1('0x3')](_0xa9e1('0x4'),_0xf68d4[_0xa9e1('0x5')]));if(_0xf68d4['accountcode']){utils[_0xa9e1('0x6')](_0xf68d4['accountcode'])[_0xa9e1('0x7')](function(_0xe731c9){if(_0xe731c9){_0xf68d4['membername']=_0xe731c9['name'];_0xf68d4[_0xa9e1('0x8')]=_0xe731c9['id'];}utils['request'](_0xa9e1('0x9'),_0xf68d4);});}else{utils[_0xa9e1('0xa')](_0xa9e1('0x9'),_0xf68d4);}}exports[_0xa9e1('0xb')]=function(_0x592b6c){try{utils[_0xa9e1('0xc')](util[_0xa9e1('0x3')](_0xa9e1('0xd'),_0x592b6c[_0xa9e1('0x5')]),_0x592b6c);if(_0x592b6c[_0xa9e1('0x5')]==_0x592b6c[_0xa9e1('0xe')]){utils['info'](util[_0xa9e1('0x3')](_0xa9e1('0xf'),_0x592b6c[_0xa9e1('0x5')],_0x592b6c['context'],_0x592b6c[_0xa9e1('0x10')]));recordings[_0x592b6c[_0xa9e1('0x5')]]={'uniqueid':_0x592b6c[_0xa9e1('0x5')],'accountcode':_0x592b6c[_0xa9e1('0x11')],'exten':_0x592b6c[_0xa9e1('0x10')],'context':_0x592b6c[_0xa9e1('0x12')],'channel':_0x592b6c[_0xa9e1('0x13')],'monitors':[]};}}catch(_0x3a54ec){utils[_0xa9e1('0x14')](util[_0xa9e1('0x3')](_0xa9e1('0xd'),_0x592b6c[_0xa9e1('0x5')]),_0x3a54ec);}};exports['newstate']=function(_0x325d6c){try{utils[_0xa9e1('0xc')](util[_0xa9e1('0x3')](_0xa9e1('0x15'),_0x325d6c[_0xa9e1('0x5')]),_0x325d6c);if(!_[_0xa9e1('0x16')](recordings[_0x325d6c['uniqueid']])&&_0x325d6c[_0xa9e1('0x17')]==0x6){utils[_0xa9e1('0x2')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x325d6c[_0xa9e1('0x5')],_0x325d6c[_0xa9e1('0x12')],_0x325d6c[_0xa9e1('0x13')]));}else if(!_[_0xa9e1('0x16')](recordings[_0x325d6c[_0xa9e1('0xe')]])&&_0x325d6c['channelstate']==0x6&&_0x325d6c[_0xa9e1('0x12')]!='transfer'){utils['info'](util[_0xa9e1('0x3')](_0xa9e1('0x18'),_0x325d6c[_0xa9e1('0x5')],_0x325d6c[_0xa9e1('0xe')],_0x325d6c[_0xa9e1('0x12')],_0x325d6c['channel']));recordings[_0x325d6c[_0xa9e1('0xe')]][_0xa9e1('0x11')]=_0x325d6c[_0xa9e1('0x11')];}}catch(_0x5dd58a){utils[_0xa9e1('0x14')](util[_0xa9e1('0x3')](_0xa9e1('0x15'),_0x325d6c[_0xa9e1('0x5')]),_0x5dd58a);}};exports[_0xa9e1('0x19')]=function(_0x5931b0){try{if(!_[_0xa9e1('0x16')](_0x5931b0[_0xa9e1('0x1a')])&&!_[_0xa9e1('0x16')](_0x5931b0[_0xa9e1('0x1a')][_0xa9e1('0x1b')])){utils[_0xa9e1('0xc')](util[_0xa9e1('0x3')](_0xa9e1('0x1c'),_0x5931b0['uniqueid']),_0x5931b0);utils['info'](util[_0xa9e1('0x3')](_0xa9e1('0x1d'),_0x5931b0[_0xa9e1('0x5')],_0x5931b0[_0xa9e1('0x1a')],_0x5931b0[_0xa9e1('0x1e')]));if(_['endsWith'](_0x5931b0['value'],_0xa9e1('0x1f'))){_0x5931b0[_0xa9e1('0x1e')]=_0x5931b0['value'][_0xa9e1('0x20')]('.wav49',_0xa9e1('0x21'));}if(recordings[_0x5931b0[_0xa9e1('0xe')]]){var _0x120c6c=_[_0xa9e1('0x22')](recordings[_0x5931b0[_0xa9e1('0xe')]][_0xa9e1('0x23')],{'value':_0x5931b0[_0xa9e1('0x1e')]});if(_['isNil'](_0x120c6c)){recordings[_0x5931b0[_0xa9e1('0xe')]][_0xa9e1('0x23')][_0xa9e1('0x24')]({'value':_0x5931b0[_0xa9e1('0x1e')]});}}}}catch(_0x1eaa8c){utils[_0xa9e1('0x14')](util['format'](_0xa9e1('0x1c'),_0x5931b0[_0xa9e1('0x5')]),_0x1eaa8c);}};exports[_0xa9e1('0x25')]=function(_0x572ced){try{if(!_['isNil'](recordings[_0x572ced['uniqueid']])){utils[_0xa9e1('0xc')](util['format'](_0xa9e1('0x26'),_0x572ced[_0xa9e1('0x5')]),_0x572ced);utils[_0xa9e1('0x2')](util['format'](_0xa9e1('0x27'),_0x572ced[_0xa9e1('0x5')],_0x572ced[_0xa9e1('0x28')],_0x572ced[_0xa9e1('0x29')],_0x572ced[_0xa9e1('0x2a')]));recordings[_0x572ced[_0xa9e1('0x5')]]['calleridnum']=_0x572ced['calleridnum'];recordings[_0x572ced[_0xa9e1('0x5')]][_0xa9e1('0x29')]=_0x572ced['calleridname'];recordings[_0x572ced[_0xa9e1('0x5')]]['connectedlinenum']=_0x572ced[_0xa9e1('0x2b')];recordings[_0x572ced['uniqueid']]['connectedlinename']=_0x572ced[_0xa9e1('0x2c')];if(recordings[_0x572ced[_0xa9e1('0x5')]]['type']==_0xa9e1('0x2d')&&recordings[_0x572ced[_0xa9e1('0x5')]][_0xa9e1('0x11')]){recordings[_0x572ced[_0xa9e1('0x5')]][_0xa9e1('0x2b')]=recordings[_0x572ced['uniqueid']][_0xa9e1('0x11')];recordings[_0x572ced[_0xa9e1('0x5')]][_0xa9e1('0x2c')]='';}recordings[_0x572ced['uniqueid']][_0xa9e1('0x23')]['forEach'](function(_0x26eb14){var _0x434fcf=_[_0xa9e1('0x2e')](recordings[_0x572ced[_0xa9e1('0x5')]]);_0x434fcf[_0xa9e1('0x1e')]=_0x26eb14[_0xa9e1('0x1e')];writeDB(_0x434fcf);});delete recordings[_0x572ced['uniqueid']];}}catch(_0x36fd0e){utils['error'](util[_0xa9e1('0x3')]('[%s][recordings][hangup]',_0x572ced['uniqueid']),_0x36fd0e);}};exports[_0xa9e1('0x2f')]=function(_0xacc9b4){try{if(!_['isNil'](recordings[_0xacc9b4['uniqueid']])){utils[_0xa9e1('0xc')](util[_0xa9e1('0x3')]('[%s][recordings][newexten]',_0xacc9b4['uniqueid']),_0xacc9b4);utils[_0xa9e1('0x2')](util[_0xa9e1('0x3')](_0xa9e1('0x30'),_0xacc9b4[_0xa9e1('0x5')],_0xacc9b4[_0xa9e1('0x31')],_0xacc9b4[_0xa9e1('0x32')]));if(_0xacc9b4[_0xa9e1('0x31')][_0xa9e1('0x33')]()=='set'&&_[_0xa9e1('0x34')](_0xacc9b4['appdata'][_0xa9e1('0x33')](),_0xa9e1('0x35'))){var _0x351331=_0xacc9b4[_0xa9e1('0x32')][_0xa9e1('0x36')]('=');var _0x409d04=_0x351331[0x0][_0xa9e1('0x37')](_0x351331[0x0][_0xa9e1('0x38')]('(')+0x1,_0x351331[0x0]['lastIndexOf'](')'));var _0x43625e=_0x351331[0x1];recordings[_0xacc9b4[_0xa9e1('0x5')]][_0x409d04]=_0x43625e;}}}catch(_0x128b33){utils[_0xa9e1('0x14')](util[_0xa9e1('0x3')](_0xa9e1('0x39'),_0xacc9b4[_0xa9e1('0x5')]),_0x128b33);}};exports['queuecallerjoin']=function(_0x22477f){try{if(!_[_0xa9e1('0x16')](recordings[_0x22477f['uniqueid']])){utils[_0xa9e1('0xc')](util[_0xa9e1('0x3')](_0xa9e1('0x3a'),_0x22477f[_0xa9e1('0x5')]),_0x22477f);utils[_0xa9e1('0x2')](util[_0xa9e1('0x3')](_0xa9e1('0x3b'),_0x22477f[_0xa9e1('0x5')],_0x22477f['queue']));recordings[_0x22477f[_0xa9e1('0x5')]][_0xa9e1('0x3c')]=_0x22477f[_0xa9e1('0x3c')];}}catch(_0x2e7026){utils[_0xa9e1('0x14')](util['format'](_0xa9e1('0x3a'),_0x22477f[_0xa9e1('0x5')]),_0x2e7026);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 36afe8e..bb79e14 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 _0x6bc8=['secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','./utils','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x5dcb3b,_0x3d440d){var _0xdb240f=function(_0x58468d){while(--_0x58468d){_0x5dcb3b['push'](_0x5dcb3b['shift']());}};_0xdb240f(++_0x3d440d);}(_0x6bc8,0x8f));var _0x86bc=function(_0x392e94,_0x38d1bb){_0x392e94=_0x392e94-0x0;var _0x156f8d=_0x6bc8[_0x392e94];return _0x156f8d;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x86bc('0x0'));function writeDB(_0x19e99a){utils['info'](util[_0x86bc('0x1')](_0x86bc('0x2'),_0x19e99a[_0x86bc('0x3')]===_0x86bc('0x4')?_0x19e99a[_0x86bc('0x5')]:_0x19e99a[_0x86bc('0x6')],_0x19e99a[_0x86bc('0x3')]));utils[_0x86bc('0x7')](_0x86bc('0x8'),_0x19e99a);}exports['blindtransfer']=function(_0x3b9e90){try{utils[_0x86bc('0x9')](util['format'](_0x86bc('0xa'),_0x3b9e90['uniqueid']),_0x3b9e90);utils[_0x86bc('0xb')](util[_0x86bc('0x1')](_0x86bc('0xc'),_0x3b9e90[_0x86bc('0x6')],_0x3b9e90[_0x86bc('0xd')],_0x3b9e90[_0x86bc('0xe')],_0x3b9e90[_0x86bc('0xf')],_0x3b9e90[_0x86bc('0x10')]));_0x3b9e90[_0x86bc('0x3')]=_0x86bc('0x11');writeDB(_0x3b9e90);}catch(_0x276214){utils[_0x86bc('0x12')](util[_0x86bc('0x1')]('[%s][transfers][blindtransfer]',_0x3b9e90['uniqueid']),_0x276214);}};exports[_0x86bc('0x13')]=function(_0x3bbd95){try{utils['debug'](util[_0x86bc('0x1')](_0x86bc('0x14'),_0x3bbd95[_0x86bc('0x5')]),_0x3bbd95);utils[_0x86bc('0xb')](util[_0x86bc('0x1')](_0x86bc('0x15'),_0x3bbd95[_0x86bc('0x5')],_0x3bbd95[_0x86bc('0x16')],_0x3bbd95[_0x86bc('0x17')],_0x3bbd95[_0x86bc('0x18')],_0x3bbd95['transfertargetcalleridname']));_0x3bbd95=_[_0x86bc('0x19')](_0x3bbd95,{'transfererchannel':_0x3bbd95['origtransfererchannel'],'transferercalleridnum':_0x3bbd95[_0x86bc('0x16')],'transferercalleridname':_0x3bbd95[_0x86bc('0x17')],'transfererconnectedlinenum':_0x3bbd95[_0x86bc('0x1a')],'transfererconnectedlinename':_0x3bbd95[_0x86bc('0x1b')],'transfereraccountcode':_0x3bbd95[_0x86bc('0x1c')],'transferercontext':_0x3bbd95[_0x86bc('0x1d')],'transfererexten':_0x3bbd95[_0x86bc('0x1e')],'transfererlinkedid':_0x3bbd95[_0x86bc('0x1f')],'context':_0x3bbd95[_0x86bc('0x20')],'extension':_0x3bbd95[_0x86bc('0x21')],'type':'attended'});if(_[_0x86bc('0x22')](_0x3bbd95[_0x86bc('0x23')])){_0x3bbd95=_['assign'](_0x3bbd95,{'transfereechannel':_0x3bbd95[_0x86bc('0x24')],'transfereecalleridnum':_0x3bbd95[_0x86bc('0x18')],'transfereecalleridname':_0x3bbd95[_0x86bc('0x25')],'transfereeconnectedlinenum':_0x3bbd95[_0x86bc('0x26')],'transfereeconnectedlinename':_0x3bbd95[_0x86bc('0x27')],'transfereeaccountcode':_0x3bbd95[_0x86bc('0x28')],'transfereecontext':_0x3bbd95[_0x86bc('0x29')],'transfereeexten':_0x3bbd95[_0x86bc('0x2a')],'transfereelinkedid':_0x3bbd95['transfertargetlinkedid']});}writeDB(_0x3bbd95);}catch(_0x290794){utils[_0x86bc('0x12')](util[_0x86bc('0x1')](_0x86bc('0x14'),_0x3bbd95[_0x86bc('0x5')]),_0x290794);}}; \ No newline at end of file +var _0x6585=['isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','./utils','type','uniqueid','request','CreateVoiceTransferReport','debug','format','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','attendedtransfer','origtransfereruniqueid','info','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext'];(function(_0x585d81,_0xf6d74f){var _0x1aca0d=function(_0x3782d3){while(--_0x3782d3){_0x585d81['push'](_0x585d81['shift']());}};_0x1aca0d(++_0xf6d74f);}(_0x6585,0xc1));var _0x5658=function(_0x38ed42,_0x3d9a37){_0x38ed42=_0x38ed42-0x0;var _0x474931=_0x6585[_0x38ed42];return _0x474931;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x5658('0x0'));function writeDB(_0x4f528c){utils['info'](util['format']('[%s][transfers][writeDB]\x20type:%s',_0x4f528c[_0x5658('0x1')]==='attended'?_0x4f528c['origtransfereruniqueid']:_0x4f528c[_0x5658('0x2')],_0x4f528c[_0x5658('0x1')]));utils[_0x5658('0x3')](_0x5658('0x4'),_0x4f528c);}exports['blindtransfer']=function(_0x16bb23){try{utils[_0x5658('0x5')](util[_0x5658('0x6')](_0x5658('0x7'),_0x16bb23['uniqueid']),_0x16bb23);utils['info'](util[_0x5658('0x6')](_0x5658('0x8'),_0x16bb23[_0x5658('0x2')],_0x16bb23[_0x5658('0x9')],_0x16bb23[_0x5658('0xa')],_0x16bb23[_0x5658('0xb')],_0x16bb23[_0x5658('0xc')]));_0x16bb23['type']=_0x5658('0xd');writeDB(_0x16bb23);}catch(_0x5b938f){utils[_0x5658('0xe')](util[_0x5658('0x6')](_0x5658('0x7'),_0x16bb23[_0x5658('0x2')]),_0x5b938f);}};exports[_0x5658('0xf')]=function(_0x131ffd){try{utils[_0x5658('0x5')](util['format']('[%s][transfers][attendedtransfer]',_0x131ffd[_0x5658('0x10')]),_0x131ffd);utils[_0x5658('0x11')](util[_0x5658('0x6')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x131ffd['origtransfereruniqueid'],_0x131ffd[_0x5658('0x12')],_0x131ffd[_0x5658('0x13')],_0x131ffd[_0x5658('0x14')],_0x131ffd[_0x5658('0x15')]));_0x131ffd=_[_0x5658('0x16')](_0x131ffd,{'transfererchannel':_0x131ffd[_0x5658('0x17')],'transferercalleridnum':_0x131ffd[_0x5658('0x12')],'transferercalleridname':_0x131ffd[_0x5658('0x13')],'transfererconnectedlinenum':_0x131ffd['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x131ffd[_0x5658('0x18')],'transfereraccountcode':_0x131ffd['origtransfereraccountcode'],'transferercontext':_0x131ffd[_0x5658('0x19')],'transfererexten':_0x131ffd[_0x5658('0x1a')],'transfererlinkedid':_0x131ffd[_0x5658('0x1b')],'context':_0x131ffd[_0x5658('0x1c')],'extension':_0x131ffd['origtransfererexten'],'type':'attended'});if(_[_0x5658('0x1d')](_0x131ffd[_0x5658('0x1e')])){_0x131ffd=_[_0x5658('0x16')](_0x131ffd,{'transfereechannel':_0x131ffd[_0x5658('0x1f')],'transfereecalleridnum':_0x131ffd[_0x5658('0x14')],'transfereecalleridname':_0x131ffd[_0x5658('0x15')],'transfereeconnectedlinenum':_0x131ffd['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x131ffd[_0x5658('0x20')],'transfereeaccountcode':_0x131ffd[_0x5658('0x21')],'transfereecontext':_0x131ffd['transfertargetcontext'],'transfereeexten':_0x131ffd[_0x5658('0x22')],'transfereelinkedid':_0x131ffd[_0x5658('0x23')]});}writeDB(_0x131ffd);}catch(_0xce2337){utils[_0x5658('0xe')](util['format'](_0x5658('0x24'),_0x131ffd[_0x5658('0x10')]),_0xce2337);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 96def74..eb1d14f 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 _0xf42e=['add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','moment','client','http','xdr','info','inspect','debug','error','request','then','catch','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime'];(function(_0x4a043d,_0x18853){var _0x1dd281=function(_0x28f20b){while(--_0x28f20b){_0x4a043d['push'](_0x4a043d['shift']());}};_0x1dd281(++_0x18853);}(_0xf42e,0x1ce));var _0xef42=function(_0x4e078e,_0x1814b6){_0x4e078e=_0x4e078e-0x0;var _0x153fed=_0xf42e[_0x4e078e];return _0x153fed;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xef42('0x0'));var moment=require(_0xef42('0x1'));var util=require('util');var client=jayson[_0xef42('0x2')][_0xef42('0x3')]({'port':0x2329});var logger=require('../../config/logger')(_0xef42('0x4'));exports[_0xef42('0x5')]=function(_0x5e2c6a,_0xb017b0){logger['info'](_0x5e2c6a,_0xb017b0?util[_0xef42('0x6')](_0xb017b0,{'showHidden':![],'depth':null}):'');};exports[_0xef42('0x7')]=function(_0x38c2ab,_0xcf7109){logger[_0xef42('0x7')](_0x38c2ab,_0xcf7109?util[_0xef42('0x6')](_0xcf7109,{'showHidden':![],'depth':null}):'');};exports[_0xef42('0x8')]=function(_0x5a1505,_0x482e0d){logger[_0xef42('0x8')](_0x5a1505,_0x482e0d?util[_0xef42('0x6')](_0x482e0d,{'showHidden':![],'depth':null}):'');};exports[_0xef42('0x9')]=function(_0x2b11a6,_0x58abdb){return client[_0xef42('0x9')](_0x2b11a6,{'body':_0x58abdb})[_0xef42('0xa')](function(_0x22f679){logger['debug']('[utils][request]\x20name:%s',_0x2b11a6,_0x22f679?util[_0xef42('0x6')](_0x22f679,{'showHidden':![],'depth':null}):'');})[_0xef42('0xb')](function(_0x2dbe71){logger[_0xef42('0x8')](_0xef42('0xc'),_0x2b11a6,_0x2dbe71?util[_0xef42('0x6')](_0x2dbe71,{'showHidden':![],'depth':null}):'');});};function getUser(_0x189150){return client[_0xef42('0x9')](_0xef42('0xd'),{'options':{'raw':!![],'attributes':['id',_0xef42('0xe'),_0xef42('0xf'),_0xef42('0x10')],'where':_0x189150,'limit':0x1}})['then'](function(_0x5ea5bd){logger[_0xef42('0x7')](_0xef42('0x11'),JSON[_0xef42('0x12')](_0x189150),_0x5ea5bd?util['inspect'](_0x5ea5bd,{'showHidden':![],'depth':null}):'');return _0x5ea5bd[_0xef42('0x13')][_0xef42('0x14')]?_0x5ea5bd['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x10937e){return new BPromise(function(_0x3cea68,_0x56ab68){if(_0x10937e){return getUser({'internal':_0x10937e})[_0xef42('0xa')](function(_0x122eaf){logger[_0xef42('0x5')](_0xef42('0x15'),_0x10937e,_0x122eaf?_0xef42('0x16'):_0xef42('0x17'));return _0x3cea68(_0x122eaf);})[_0xef42('0xb')](function(_0x56a602){logger['error'](_0xef42('0x18'),_0x56a602?util['inspect'](_0x56a602,{'showHidden':![],'depth':null}):'');return _0x3cea68(null);});}return _0x3cea68(null);});};exports[_0xef42('0x19')]=function(_0x58f0c8){return new BPromise(function(_0x5a17c8,_0x18df04){if(_0x58f0c8){return getUser({'interface':_0x58f0c8})['then'](function(_0x5cbece){logger[_0xef42('0x5')](_0xef42('0x1a'),_0x58f0c8,_0x5cbece?_0xef42('0x16'):'notfound');return _0x5a17c8(_0x5cbece);})[_0xef42('0xb')](function(_0x5cc611){logger['error'](_0xef42('0x1b'),_0x5cc611?util['inspect'](_0x5cc611,{'showHidden':![],'depth':null}):'');return _0x5a17c8(null);});}return _0x5a17c8(null);});};exports[_0xef42('0x1c')]=function(_0x12f126){return new BPromise(function(_0xe28349,_0x31d3c8){if(_0x12f126){return getUser({'name':_0x12f126})[_0xef42('0xa')](function(_0x2556d1){logger['info'](_0xef42('0x1d'),_0x12f126,_0x2556d1?_0xef42('0x16'):'notfound');return _0xe28349(_0x2556d1);})[_0xef42('0xb')](function(_0x119bb7){logger[_0xef42('0x8')]('[utils][getUserByName]',_0x119bb7?util['inspect'](_0x119bb7,{'showHidden':![],'depth':null}):'');return _0xe28349(null);});}return _0xe28349(null);});};exports[_0xef42('0x1e')]=function(_0x1b2710){return new BPromise(function(_0x214dcb,_0x757f9c){if(_0x1b2710){return client[_0xef42('0x9')](_0xef42('0x1f'),{'options':{'raw':!![],'attributes':['id','name',_0xef42('0x20'),_0xef42('0x21'),_0xef42('0x22')],'where':{'name':_0x1b2710},'limit':0x1}})[_0xef42('0xa')](function(_0x58583e){logger[_0xef42('0x7')]('[utils][getVoiceQueueByName]\x20name:%s',_0x1b2710,_0x58583e?util[_0xef42('0x6')](_0x58583e,{'showHidden':![],'depth':null}):'');logger['info'](_0xef42('0x23'),_0x1b2710,_0x58583e?_0xef42('0x16'):'notfound');return _0x214dcb(_0x58583e[_0xef42('0x13')][_0xef42('0x14')]?_0x58583e['result'][0x0]:null);})['catch'](function(_0x456bd6){logger[_0xef42('0x8')](_0xef42('0x24'),_0x456bd6?util[_0xef42('0x6')](_0x456bd6,{'showHidden':![],'depth':null}):'');return _0x214dcb(null);});}return _0x214dcb(null);});};exports[_0xef42('0x25')]=function(_0x21f2ee,_0x22cdee){return moment(_0x21f2ee)[_0xef42('0x26')](_0x22cdee,_0xef42('0x27'))[_0xef42('0x28')](_0xef42('0x29'));};exports[_0xef42('0x2a')]=function(_0x2943e5,_0x4421fa){return moment(_0x2943e5)[_0xef42('0x2b')](_0x4421fa,_0xef42('0x27'))[_0xef42('0x28')](_0xef42('0x29'));};exports[_0xef42('0x2c')]=function(_0x4ae0ca,_0x389347){return moment(_0x4ae0ca)[_0xef42('0x2d')](moment(_0x389347),_0xef42('0x27'));};exports[_0xef42('0x2e')]=function(_0x56b58f,_0x4738b8){return parseInt(_0x56b58f,0xa)+parseInt(_0x4738b8,0xa);};exports[_0xef42('0x2f')]=function(){return moment()[_0xef42('0x28')](_0xef42('0x29'));};exports[_0xef42('0x30')]=function(_0x2f954c,_0x379c68){if(_0x379c68){return moment(_0x2f954c)[_0xef42('0x30')](_0x379c68);}return!![];};exports[_0xef42('0x31')]=function(_0x46d8e3,_0x50220a){if(_0x50220a){return moment(_0x46d8e3)[_0xef42('0x31')](_0x50220a);}else if(_0x46d8e3){return!![];}return![];}; \ No newline at end of file +var _0x3c9f=['getUserByName','[utils][getUserByName]\x20name:%s\x20%s','found','getVoiceQueueByName','GetVoiceQueue','name','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','sumTime','now','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','[utils][request]\x20name:%s','catch','internal','interface','then','[utils][getUser]\x20where:%s','result','length','getUserByInternal','notfound','getUserByInterface','[utils][getUserByInterface]'];(function(_0x396588,_0x222305){var _0x408d3b=function(_0x263eb3){while(--_0x263eb3){_0x396588['push'](_0x396588['shift']());}};_0x408d3b(++_0x222305);}(_0x3c9f,0x148));var _0xf3c9=function(_0x41b9ff,_0x5ae1dd){_0x41b9ff=_0x41b9ff-0x0;var _0x5d6352=_0x3c9f[_0x41b9ff];return _0x5d6352;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xf3c9('0x0'));var moment=require(_0xf3c9('0x1'));var util=require(_0xf3c9('0x2'));var client=jayson[_0xf3c9('0x3')][_0xf3c9('0x4')]({'port':0x2329});var logger=require(_0xf3c9('0x5'))(_0xf3c9('0x6'));exports['info']=function(_0x10bc04,_0x1888d1){logger[_0xf3c9('0x7')](_0x10bc04,_0x1888d1?util[_0xf3c9('0x8')](_0x1888d1,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x3ab952,_0x4c25c2){logger[_0xf3c9('0x9')](_0x3ab952,_0x4c25c2?util[_0xf3c9('0x8')](_0x4c25c2,{'showHidden':![],'depth':null}):'');};exports[_0xf3c9('0xa')]=function(_0x29b4af,_0x80858f){logger[_0xf3c9('0xa')](_0x29b4af,_0x80858f?util[_0xf3c9('0x8')](_0x80858f,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x513a95,_0xf4a849){return client[_0xf3c9('0xb')](_0x513a95,{'body':_0xf4a849})['then'](function(_0x34e8e6){logger[_0xf3c9('0x9')](_0xf3c9('0xc'),_0x513a95,_0x34e8e6?util['inspect'](_0x34e8e6,{'showHidden':![],'depth':null}):'');})[_0xf3c9('0xd')](function(_0xba0072){logger[_0xf3c9('0xa')](_0xf3c9('0xc'),_0x513a95,_0xba0072?util[_0xf3c9('0x8')](_0xba0072,{'showHidden':![],'depth':null}):'');});};function getUser(_0x17bcc2){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id',_0xf3c9('0xe'),'name',_0xf3c9('0xf')],'where':_0x17bcc2,'limit':0x1}})[_0xf3c9('0x10')](function(_0x1f26d4){logger['debug'](_0xf3c9('0x11'),JSON['stringify'](_0x17bcc2),_0x1f26d4?util[_0xf3c9('0x8')](_0x1f26d4,{'showHidden':![],'depth':null}):'');return _0x1f26d4[_0xf3c9('0x12')][_0xf3c9('0x13')]?_0x1f26d4[_0xf3c9('0x12')][0x0]:null;});}exports[_0xf3c9('0x14')]=function(_0xc3483d){return new BPromise(function(_0x4ba7e5,_0x871c75){if(_0xc3483d){return getUser({'internal':_0xc3483d})[_0xf3c9('0x10')](function(_0x15921f){logger[_0xf3c9('0x7')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0xc3483d,_0x15921f?'found':_0xf3c9('0x15'));return _0x4ba7e5(_0x15921f);})[_0xf3c9('0xd')](function(_0x1b9c78){logger[_0xf3c9('0xa')]('[utils][getUserByInternal]',_0x1b9c78?util['inspect'](_0x1b9c78,{'showHidden':![],'depth':null}):'');return _0x4ba7e5(null);});}return _0x4ba7e5(null);});};exports[_0xf3c9('0x16')]=function(_0x3bddd0){return new BPromise(function(_0x1a97bc,_0x4cd4f9){if(_0x3bddd0){return getUser({'interface':_0x3bddd0})[_0xf3c9('0x10')](function(_0x4a706c){logger[_0xf3c9('0x7')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x3bddd0,_0x4a706c?'found':'notfound');return _0x1a97bc(_0x4a706c);})[_0xf3c9('0xd')](function(_0x16cd3b){logger['error'](_0xf3c9('0x17'),_0x16cd3b?util[_0xf3c9('0x8')](_0x16cd3b,{'showHidden':![],'depth':null}):'');return _0x1a97bc(null);});}return _0x1a97bc(null);});};exports[_0xf3c9('0x18')]=function(_0x3a1eec){return new BPromise(function(_0x3cb474,_0x49f93a){if(_0x3a1eec){return getUser({'name':_0x3a1eec})[_0xf3c9('0x10')](function(_0x542f60){logger[_0xf3c9('0x7')](_0xf3c9('0x19'),_0x3a1eec,_0x542f60?_0xf3c9('0x1a'):_0xf3c9('0x15'));return _0x3cb474(_0x542f60);})[_0xf3c9('0xd')](function(_0xcc4cbd){logger[_0xf3c9('0xa')]('[utils][getUserByName]',_0xcc4cbd?util[_0xf3c9('0x8')](_0xcc4cbd,{'showHidden':![],'depth':null}):'');return _0x3cb474(null);});}return _0x3cb474(null);});};exports[_0xf3c9('0x1b')]=function(_0x498320){return new BPromise(function(_0x4539c0,_0x4b616d){if(_0x498320){return client[_0xf3c9('0xb')](_0xf3c9('0x1c'),{'options':{'raw':!![],'attributes':['id',_0xf3c9('0x1d'),'type',_0xf3c9('0x1e'),_0xf3c9('0x1f')],'where':{'name':_0x498320},'limit':0x1}})[_0xf3c9('0x10')](function(_0x190b28){logger['debug'](_0xf3c9('0x20'),_0x498320,_0x190b28?util[_0xf3c9('0x8')](_0x190b28,{'showHidden':![],'depth':null}):'');logger[_0xf3c9('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x498320,_0x190b28?_0xf3c9('0x1a'):'notfound');return _0x4539c0(_0x190b28['result']['length']?_0x190b28['result'][0x0]:null);})[_0xf3c9('0xd')](function(_0x3d8853){logger[_0xf3c9('0xa')](_0xf3c9('0x21'),_0x3d8853?util[_0xf3c9('0x8')](_0x3d8853,{'showHidden':![],'depth':null}):'');return _0x4539c0(null);});}return _0x4539c0(null);});};exports['addTime']=function(_0x388697,_0x39a6fc){return moment(_0x388697)['add'](_0x39a6fc,'seconds')[_0xf3c9('0x22')](_0xf3c9('0x23'));};exports[_0xf3c9('0x24')]=function(_0x58f764,_0x2397cb){return moment(_0x58f764)[_0xf3c9('0x25')](_0x2397cb,_0xf3c9('0x26'))[_0xf3c9('0x22')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xf3c9('0x27')]=function(_0x55c887,_0x44cb75){return moment(_0x55c887)['diff'](moment(_0x44cb75),_0xf3c9('0x26'));};exports[_0xf3c9('0x28')]=function(_0x4f56fa,_0x6e272f){return parseInt(_0x4f56fa,0xa)+parseInt(_0x6e272f,0xa);};exports[_0xf3c9('0x29')]=function(){return moment()['format'](_0xf3c9('0x23'));};exports[_0xf3c9('0x2a')]=function(_0x480423,_0x384369){if(_0x384369){return moment(_0x480423)[_0xf3c9('0x2a')](_0x384369);}return!![];};exports[_0xf3c9('0x2b')]=function(_0x58c0ef,_0x270331){if(_0x270331){return moment(_0x58c0ef)[_0xf3c9('0x2b')](_0x270331);}else if(_0x58c0ef){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index 4237b47..167f721 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6d0d=['name','ensureDir','then','catch','user','no-user','data','timestamp','error','api','auth','isEmpty','body','format','headers','x-forwarded-for','connection','url','responseTime','inspect','use','device','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','remoteAddress','statusCode','other','agent_id','agent_name','test','setupLoggers','path','fileLogger','./safe-template','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role'];(function(_0xa36c4d,_0x12d21c){var _0x405afc=function(_0x283948){while(--_0x283948){_0xa36c4d['push'](_0xa36c4d['shift']());}};_0x405afc(++_0x12d21c);}(_0x6d0d,0x73));var _0xd6d0=function(_0x1ffda4,_0x59386b){_0x1ffda4=_0x1ffda4-0x0;var _0x4b6569=_0x6d0d[_0x1ffda4];return _0x4b6569;};var fs=require('fs-extra');var _=require('lodash');var ewinston=require('express-winston');var path=require(_0xd6d0('0x0'));var util=require('util');var fileLogger=require('./loggers')[_0xd6d0('0x1')];var safeTemplate=require(_0xd6d0('0x2'))['safeTemplate'];var maskSensitiveData=require(_0xd6d0('0x3'))[_0xd6d0('0x4')];function ClientSideLogger(){function _0x5e296c(_0x35765d){var _0x310cc3=path[_0xd6d0('0x5')](_0xd6d0('0x6'),_0xd6d0('0x7'),_0xd6d0('0x8'));var _0x38ce68=path[_0xd6d0('0x5')](_0xd6d0('0x9'),_0x35765d[_0xd6d0('0xa')]+'-'+_0x35765d[_0xd6d0('0xb')]);return fs[_0xd6d0('0xc')](path[_0xd6d0('0x5')](_0x310cc3,_0x38ce68))[_0xd6d0('0xd')](function(){var _0x1bb2d5=fileLogger(_0xd6d0('0x9'),path[_0xd6d0('0x5')](_0x310cc3,_0x38ce68));return _0x1bb2d5;})[_0xd6d0('0xe')](function(_0x4fad08){throw _0x4fad08;});}this[_0xd6d0('0x7')]=function(_0x940f48,_0x158e7a,_0x1d3d3b,_0x506134){return _0x5e296c(_0x940f48[_0xd6d0('0xf')])[_0xd6d0('0xd')](function(_0x2f4212){var _0x1feebd=_0x2f4212[_0x158e7a];return _0x1feebd;})[_0xd6d0('0xd')](function(_0x390c70){var _0x5073f=_0x940f48[_0xd6d0('0xf')]?_0x940f48['user']['id']:_0xd6d0('0x10');var _0x16362e=_0x506134[_0xd6d0('0x11')];var _0x15faa8=_0x506134[_0xd6d0('0x12')];var _0x282136=new Date(Number(_0x15faa8));return _0x390c70(_0x5073f,_0x282136,_0x1d3d3b,_0x16362e);})[_0xd6d0('0xe')](function(_0x5d8468){fileLogger(_0xd6d0('0x9'))[_0xd6d0('0x13')](_0x5d8468);});};}function setupLoggers(_0x15dc14){return new Promise(function(_0x1df56e){var _0x4635e6=new ClientSideLogger();var _0x3e5e53=fileLogger(_0xd6d0('0x14'));var _0x46d631=fileLogger(_0xd6d0('0x15'));_0x15dc14['set']('client-side-logger',_0x4635e6);_0x15dc14['use'](ewinston['logger']({'winstonInstance':_0x3e5e53,'meta':![],'statusLevels':!![],'msg':function(_0x3bb367,_0x11db94){var _0x37c0b6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xd6d0('0x16')](_0x3bb367[_0xd6d0('0x17')])){_0x37c0b6+='\x20body=%s';var _0x3cfd2f=_0x3bb367[_0xd6d0('0x17')];maskSensitiveData(_0x3cfd2f);}return safeTemplate(util[_0xd6d0('0x18')](_0x37c0b6,_0x3bb367['method'],_0x3bb367[_0xd6d0('0x19')]['x-forwarded-for']?_0x3bb367['headers'][_0xd6d0('0x1a')]:_0x3bb367[_0xd6d0('0x1b')]['remoteAddress']||_0x3bb367['ip'],_0x3bb367[_0xd6d0('0x1c')],_0x11db94['statusCode'],_0x11db94[_0xd6d0('0x1d')],_0x3bb367[_0xd6d0('0xf')]?_0x3bb367['user']['id']:null,_0x3bb367['user']?_0x3bb367[_0xd6d0('0xf')][_0xd6d0('0xb')]:null,_0x3bb367['user']?_0x3bb367[_0xd6d0('0xf')][_0xd6d0('0xa')]:null,_0x3cfd2f?util[_0xd6d0('0x1e')](_0x3cfd2f,![],null):''));}}));_0x15dc14[_0xd6d0('0x1f')](ewinston['logger']({'winstonInstance':_0x46d631,'meta':![],'statusLevels':!![],'msg':function(_0x41dfec,_0x166fd4){var _0x1c69be='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x41dfec[_0xd6d0('0x17')]&&_0x41dfec[_0xd6d0('0x17')][_0xd6d0('0x20')]&&_0x41dfec['body']['agent_id']){_0x1c69be=_0xd6d0('0x21');}return util['format'](_0x1c69be,_0x41dfec[_0xd6d0('0x22')],_0x41dfec[_0xd6d0('0x19')][_0xd6d0('0x1a')]?_0x41dfec[_0xd6d0('0x19')]['x-forwarded-for']:_0x41dfec[_0xd6d0('0x1b')][_0xd6d0('0x23')]||_0x41dfec['ip'],_0x41dfec[_0xd6d0('0x1c')],_0x166fd4[_0xd6d0('0x24')],_0x166fd4[_0xd6d0('0x1d')],_0x41dfec[_0xd6d0('0xf')]?_0x41dfec[_0xd6d0('0xf')]['id']:null,_0x41dfec['user']?_0x41dfec[_0xd6d0('0xf')][_0xd6d0('0xb')]:null,_0x41dfec[_0xd6d0('0xf')]?_0x41dfec[_0xd6d0('0xf')][_0xd6d0('0xa')]:null,_0x41dfec['body']&&_0x41dfec[_0xd6d0('0x17')][_0xd6d0('0x20')]?_0x41dfec[_0xd6d0('0x17')]['device']:_0xd6d0('0x25'),_0x41dfec[_0xd6d0('0x17')]&&_0x41dfec[_0xd6d0('0x17')][_0xd6d0('0x26')]?_0x41dfec['body'][_0xd6d0('0x26')]:'',_0x41dfec[_0xd6d0('0x17')]&&_0x41dfec[_0xd6d0('0x17')]['agent_name']?_0x41dfec[_0xd6d0('0x17')][_0xd6d0('0x27')]:'');},'ignoreRoute':function(_0x370066){var _0x107f40=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x107f40[_0xd6d0('0x28')](_0x370066[_0xd6d0('0x1c')]);}}));return _0x1df56e();});}exports[_0xd6d0('0x29')]=setupLoggers; \ No newline at end of file +var _0xf91d=['agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','format','url','device','other','lodash','express-winston','path','util','./loggers','./safe-template','./mask-sensitive-data','join','log','client','role','then','user','no-user','data','timestamp','catch','error','auth','client-side-logger','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s'];(function(_0x292236,_0x2c0f0e){var _0x107e37=function(_0xc99bfc){while(--_0xc99bfc){_0x292236['push'](_0x292236['shift']());}};_0x107e37(++_0x2c0f0e);}(_0xf91d,0x1e6));var _0xdf91=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xf91d[_0x40a045];return _0x1a687c;};var fs=require('fs-extra');var _=require(_0xdf91('0x0'));var ewinston=require(_0xdf91('0x1'));var path=require(_0xdf91('0x2'));var util=require(_0xdf91('0x3'));var fileLogger=require(_0xdf91('0x4'))['fileLogger'];var safeTemplate=require(_0xdf91('0x5'))['safeTemplate'];var maskSensitiveData=require(_0xdf91('0x6'))['maskSensitiveData'];function ClientSideLogger(){function _0x2ba60e(_0x308304){var _0x4a8eb8=path[_0xdf91('0x7')]('/var',_0xdf91('0x8'),'xcally');var _0x43f0ce=path[_0xdf91('0x7')](_0xdf91('0x9'),_0x308304[_0xdf91('0xa')]+'-'+_0x308304['name']);return fs['ensureDir'](path[_0xdf91('0x7')](_0x4a8eb8,_0x43f0ce))[_0xdf91('0xb')](function(){var _0x3d0d5c=fileLogger(_0xdf91('0x9'),path[_0xdf91('0x7')](_0x4a8eb8,_0x43f0ce));return _0x3d0d5c;})['catch'](function(_0x4f72c3){throw _0x4f72c3;});}this[_0xdf91('0x8')]=function(_0x5ce0c0,_0xcd1e74,_0x13ad21,_0x2d254c){return _0x2ba60e(_0x5ce0c0[_0xdf91('0xc')])[_0xdf91('0xb')](function(_0x16cd95){var _0x3ff193=_0x16cd95[_0xcd1e74];return _0x3ff193;})[_0xdf91('0xb')](function(_0x4cde8d){var _0x66d4e9=_0x5ce0c0[_0xdf91('0xc')]?_0x5ce0c0[_0xdf91('0xc')]['id']:_0xdf91('0xd');var _0x2a2d85=_0x2d254c[_0xdf91('0xe')];var _0xc1da14=_0x2d254c[_0xdf91('0xf')];var _0x45413a=new Date(Number(_0xc1da14));return _0x4cde8d(_0x66d4e9,_0x45413a,_0x13ad21,_0x2a2d85);})[_0xdf91('0x10')](function(_0x2ab2a5){fileLogger('client')[_0xdf91('0x11')](_0x2ab2a5);});};}function setupLoggers(_0x3fd188){return new Promise(function(_0x416951){var _0x51c285=new ClientSideLogger();var _0xce00fe=fileLogger('api');var _0x7ca0b7=fileLogger(_0xdf91('0x12'));_0x3fd188['set'](_0xdf91('0x13'),_0x51c285);_0x3fd188['use'](ewinston[_0xdf91('0x14')]({'winstonInstance':_0xce00fe,'meta':![],'statusLevels':!![],'msg':function(_0x399e0a,_0xcb77bb){var _0x3ba07c=_0xdf91('0x15');if(!_['isEmpty'](_0x399e0a[_0xdf91('0x16')])){_0x3ba07c+=_0xdf91('0x17');var _0x87be29=_0x399e0a[_0xdf91('0x16')];maskSensitiveData(_0x87be29);}return safeTemplate(util['format'](_0x3ba07c,_0x399e0a[_0xdf91('0x18')],_0x399e0a[_0xdf91('0x19')]['x-forwarded-for']?_0x399e0a[_0xdf91('0x19')][_0xdf91('0x1a')]:_0x399e0a[_0xdf91('0x1b')][_0xdf91('0x1c')]||_0x399e0a['ip'],_0x399e0a['url'],_0xcb77bb[_0xdf91('0x1d')],_0xcb77bb[_0xdf91('0x1e')],_0x399e0a[_0xdf91('0xc')]?_0x399e0a[_0xdf91('0xc')]['id']:null,_0x399e0a[_0xdf91('0xc')]?_0x399e0a[_0xdf91('0xc')][_0xdf91('0x1f')]:null,_0x399e0a[_0xdf91('0xc')]?_0x399e0a['user']['role']:null,_0x87be29?util[_0xdf91('0x20')](_0x87be29,![],null):''));}}));_0x3fd188['use'](ewinston['logger']({'winstonInstance':_0x7ca0b7,'meta':![],'statusLevels':!![],'msg':function(_0xf1e9db,_0x510545){var _0xc88f18=_0xdf91('0x21');if(_0xf1e9db['body']&&_0xf1e9db[_0xdf91('0x16')]['device']&&_0xf1e9db['body'][_0xdf91('0x22')]){_0xc88f18=_0xdf91('0x23');}return util[_0xdf91('0x24')](_0xc88f18,_0xf1e9db['method'],_0xf1e9db[_0xdf91('0x19')]['x-forwarded-for']?_0xf1e9db[_0xdf91('0x19')][_0xdf91('0x1a')]:_0xf1e9db[_0xdf91('0x1b')][_0xdf91('0x1c')]||_0xf1e9db['ip'],_0xf1e9db[_0xdf91('0x25')],_0x510545[_0xdf91('0x1d')],_0x510545[_0xdf91('0x1e')],_0xf1e9db[_0xdf91('0xc')]?_0xf1e9db[_0xdf91('0xc')]['id']:null,_0xf1e9db[_0xdf91('0xc')]?_0xf1e9db['user'][_0xdf91('0x1f')]:null,_0xf1e9db[_0xdf91('0xc')]?_0xf1e9db[_0xdf91('0xc')]['role']:null,_0xf1e9db[_0xdf91('0x16')]&&_0xf1e9db[_0xdf91('0x16')][_0xdf91('0x26')]?_0xf1e9db[_0xdf91('0x16')][_0xdf91('0x26')]:_0xdf91('0x27'),_0xf1e9db[_0xdf91('0x16')]&&_0xf1e9db[_0xdf91('0x16')]['agent_id']?_0xf1e9db[_0xdf91('0x16')][_0xdf91('0x22')]:'',_0xf1e9db[_0xdf91('0x16')]&&_0xf1e9db['body']['agent_name']?_0xf1e9db[_0xdf91('0x16')]['agent_name']:'');},'ignoreRoute':function(_0x4053e9){var _0x159e74=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x159e74['test'](_0x4053e9[_0xdf91('0x25')]);}}));return _0x416951();});}exports['setupLoggers']=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 7962def..bc09220 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9155=['split','locale','indexOf','slice','concat','exports','circularDoWInterval','monthsShort','clone','hours','minutes','isBefore','day','endOf','isBetween','format','ddd','toLowerCase','includes','dowCompare','date','daysInMonth','max','min','domCompare','MMM','monthCompare','guess','test','length','padStart','lodash','moment-timezone','map','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid'];(function(_0x437b02,_0x34b630){var _0xf8c681=function(_0x28f83e){while(--_0x28f83e){_0x437b02['push'](_0x437b02['shift']());}};_0xf8c681(++_0x34b630);}(_0x9155,0x69));var _0x5915=function(_0x4c7935,_0x4a53fb){_0x4c7935=_0x4c7935-0x0;var _0x30651d=_0x9155[_0x4c7935];return _0x30651d;};var _=require(_0x5915('0x0'));var moment=require(_0x5915('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x5915('0x2')](function(_0x5a158d){return _0x5a158d['source'];})[_0x5915('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x5915('0x4');var EINVALID_DATE=_0x5915('0x5');function throwIfDateNotValid(_0x29d96a){if(!_0x29d96a['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3ab6fe){var _0x4d68f6=_0x3ab6fe[_0x5915('0x6')](':')[_0x5915('0x2')](function(_0x57f4bc){return parseInt(_0x57f4bc,0xa);});var _0x13a340=_0x4d68f6[0x0];var _0x1e9023=_0x4d68f6[0x1];if(_0x13a340<0x0||_0x13a340>0x17||_0x1e9023<0x0||_0x1e9023>0x3b){throw new Error(EINVALID_DATE);}return[_0x13a340,_0x1e9023];}function circularDoWInterval(_0x1b74d6,_0x1faa7c){if(_0x1b74d6===_0x1faa7c){return[_0x1b74d6];}else{var _0x1771b2=moment[_0x5915('0x7')]();moment[_0x5915('0x7')]('en');var _0x273846=moment['weekdaysShort']()[_0x5915('0x2')](function(_0x36adc2){return _0x36adc2['toLowerCase']();});moment['locale'](_0x1771b2);var _0x2d0387=_0x273846[_0x5915('0x8')](_0x1b74d6);var _0x3a10b9=_0x273846['indexOf'](_0x1faa7c);if(_0x3a10b9>_0x2d0387){return _0x273846[_0x5915('0x9')](_0x2d0387,_0x3a10b9+0x1);}else{var _0xd6972c=_0x273846[_0x5915('0x9')](0x0,_0x3a10b9+0x1);var _0x548f2c=_0x273846[_0x5915('0x9')](_0x2d0387);return _0x548f2c[_0x5915('0xa')](_0xd6972c);}}}module[_0x5915('0xb')][_0x5915('0xc')]=circularDoWInterval;function circularMonthInterval(_0x309247,_0x4f8754){if(_0x309247===_0x4f8754){return[_0x309247];}else{var _0x2786c7=moment[_0x5915('0x7')]();moment[_0x5915('0x7')]('en');var _0x3163a3=moment[_0x5915('0xd')]()['map'](function(_0x24ceca){return _0x24ceca['toLowerCase']();});moment[_0x5915('0x7')](_0x2786c7);var _0x5155db=_0x3163a3[_0x5915('0x8')](_0x309247);var _0xbd1477=_0x3163a3['indexOf'](_0x4f8754);if(_0xbd1477>_0x5155db){return _0x3163a3[_0x5915('0x9')](_0x5155db,_0xbd1477+0x1);}else{var _0x48707e=_0x3163a3[_0x5915('0x9')](0x0,_0xbd1477+0x1);var _0x36a263=_0x3163a3[_0x5915('0x9')](_0x5155db);return _0x36a263['concat'](_0x48707e);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x37d339){var _0x194f98=parseInt(_0x37d339,0xa);if(_0x194f98<0x1||_0x194f98>0x1f){throw new Error(EINVALID_DATE);}return _0x194f98;}function timeCompare(_0x5503cb,_0x38282b,_0x2b0620){var _0x3826b2=_0x5503cb[_0x5915('0xe')]();var _0x29abae=extractTime(_0x38282b);var _0x5127bd=_0x29abae[0x0];var _0xc265b5=_0x29abae[0x1];var _0x3c827e=_0x5503cb[_0x5915('0xe')]()[_0x5915('0xf')](_0x5127bd)[_0x5915('0x10')](_0xc265b5);throwIfDateNotValid(_0x3c827e);var _0x2b5161=extractTime(_0x2b0620);var _0x1890a2=_0x2b5161[0x0];var _0x295955=_0x2b5161[0x1];var _0x31012c=_0x5503cb['clone']()['hours'](_0x1890a2)[_0x5915('0x10')](_0x295955);throwIfDateNotValid(_0x31012c);if(_0x31012c[_0x5915('0x11')](_0x3c827e)){var _0x2ea5ef=_0x3826b2[_0x5915('0xe')]()['startOf'](_0x5915('0x12'));var _0x2f41e2=_0x3826b2[_0x5915('0xe')]()[_0x5915('0x13')](_0x5915('0x12'));return _0x3826b2[_0x5915('0x14')](_0x3c827e,_0x2f41e2,undefined,'[]')||_0x3826b2[_0x5915('0x14')](_0x2ea5ef,_0x31012c,undefined,'[]');}else{return _0x3826b2[_0x5915('0x14')](_0x3c827e,_0x31012c,undefined,'[]');}}module[_0x5915('0xb')]['timeCompare']=timeCompare;function dowCompare(_0x7c866f,_0x640a15,_0x465ad6){var _0x23e7bb=_0x7c866f[_0x5915('0x7')]('en')[_0x5915('0x15')](_0x5915('0x16'))[_0x5915('0x17')]();return circularDoWInterval(_0x640a15,_0x465ad6)[_0x5915('0x18')](_0x23e7bb);}module['exports'][_0x5915('0x19')]=dowCompare;function domCompare(_0x3123d7,_0x56510e,_0x4c3088){var _0x5271db=_0x3123d7[_0x5915('0x1a')]();if(_0x56510e===_0x4c3088){return _0x5271db===_0x56510e;}else{var _0x2665ee=_0x3123d7[_0x5915('0x1b')]();var _0x18a55d=_0x56510e<_0x4c3088;let _0x7a26b4=![];var _0x54fdb2=0x0;var _0xa99a79=0x0;if(_0x18a55d){_0x54fdb2=Math[_0x5915('0x1c')](0x1,_0x56510e);_0xa99a79=Math['min'](_0x4c3088,_0x2665ee);_0x7a26b4=_0x5271db>=_0x54fdb2&&_0x5271db<=_0xa99a79;}else{_0x54fdb2=Math[_0x5915('0x1d')](_0x56510e,_0x2665ee);_0xa99a79=Math[_0x5915('0x1c')](0x1,_0x4c3088);_0x7a26b4=_0x5271db>=_0x54fdb2||_0x5271db<=_0xa99a79;}return _0x7a26b4;}}module[_0x5915('0xb')][_0x5915('0x1e')]=domCompare;function monthCompare(_0x225216,_0x4abcb4,_0x36c7bf){var _0x114560=_0x225216[_0x5915('0x7')]('en')[_0x5915('0x15')](_0x5915('0x1f'))[_0x5915('0x17')]();return circularMonthInterval(_0x4abcb4,_0x36c7bf)[_0x5915('0x18')](_0x114560);}module[_0x5915('0xb')][_0x5915('0x20')]=monthCompare;function iftime(_0xe2874d,_0x57c729=moment['tz'][_0x5915('0x21')](),_0x6173ee=moment()){if(!validateRx[_0x5915('0x22')](_0xe2874d)){throw new Error(EINVALID_STRING);}else{var _0x3f1662=(moment['isMoment'](_0x6173ee)?_0x6173ee[_0x5915('0xe')]():moment(_0x6173ee))['tz'](_0x57c729)[_0x5915('0x7')]('en');throwIfDateNotValid(_0x3f1662);var _0x42a02b=_0xe2874d[_0x5915('0x6')](',');var _0x22170f=_0x42a02b[0x0];var _0x150bde=_0x42a02b[0x1];var _0x5730a2=_0x42a02b[0x2];var _0x2e1b65=_0x42a02b[0x3];let _0x131cff=!![];if(_0x22170f!=='*'){var _0x563502=_0x22170f[_0x5915('0x6')]('-');var _0x5d6ee9=_['padStart'](_0x563502[0x0],0x5,'0');var _0x451932=_0x563502[_0x5915('0x23')]===0x2?_[_0x5915('0x24')](_0x563502[0x1],0x5,'0'):_0x5d6ee9;_0x131cff=timeCompare(_0x3f1662,_0x5d6ee9,_0x451932);}let _0x1ae863=!![];if(_0x150bde!=='*'){var _0x594284=_0x150bde[_0x5915('0x6')]('-');var _0x17a263=_0x594284[0x0];var _0x3e0b02=_0x594284['length']===0x2?_0x594284[0x1]:_0x17a263;_0x1ae863=dowCompare(_0x3f1662,_0x17a263,_0x3e0b02);}let _0x247363=!![];if(_0x5730a2!=='*'){var _0x4b7078=_0x5730a2[_0x5915('0x6')]('-');var _0x207c3f=parseDom(_0x4b7078[0x0]);var _0x404894=_0x4b7078['length']===0x2?parseDom(_0x4b7078[0x1]):_0x207c3f;_0x247363=domCompare(_0x3f1662,_0x207c3f,_0x404894);}let _0x3ff4cd=!![];if(_0x2e1b65!=='*'){var _0x567e93=_0x2e1b65[_0x5915('0x6')]('-');var _0x5ba20c=_0x567e93[0x0];var _0x1745e9=_0x567e93[_0x5915('0x23')]===0x2?_0x567e93[0x1]:_0x567e93[0x0];_0x3ff4cd=monthCompare(_0x3f1662,_0x5ba20c,_0x1745e9);}return _0x131cff&&_0x1ae863&&_0x247363&&_0x3ff4cd;}}module['exports']['iftime']=iftime; \ No newline at end of file +var _0x9a42=['daysInMonth','min','max','domCompare','monthCompare','guess','test','isMoment','split','padStart','length','iftime','lodash','moment-timezone','map','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','isValid','locale','weekdaysShort','toLowerCase','indexOf','slice','exports','concat','clone','hours','minutes','isBefore','startOf','day','endOf','isBetween','format','ddd','includes','dowCompare','date'];(function(_0x1f2aa4,_0xb618f3){var _0x499e5c=function(_0x287cb8){while(--_0x287cb8){_0x1f2aa4['push'](_0x1f2aa4['shift']());}};_0x499e5c(++_0xb618f3);}(_0x9a42,0xac));var _0x29a4=function(_0x4fd624,_0x48dca4){_0x4fd624=_0x4fd624-0x0;var _0x105239=_0x9a42[_0x4fd624];return _0x105239;};var _=require(_0x29a4('0x0'));var moment=require(_0x29a4('0x1'));var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x29a4('0x2')](function(_0x6859b9){return _0x6859b9[_0x29a4('0x3')];})[_0x29a4('0x4')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x29a4('0x5');var EINVALID_DATE=_0x29a4('0x6');function throwIfDateNotValid(_0x2c3d62){if(!_0x2c3d62[_0x29a4('0x7')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0xe99c90){var _0x24477f=_0xe99c90['split'](':')[_0x29a4('0x2')](function(_0x22f4c){return parseInt(_0x22f4c,0xa);});var _0x2e3f76=_0x24477f[0x0];var _0x2f5825=_0x24477f[0x1];if(_0x2e3f76<0x0||_0x2e3f76>0x17||_0x2f5825<0x0||_0x2f5825>0x3b){throw new Error(EINVALID_DATE);}return[_0x2e3f76,_0x2f5825];}function circularDoWInterval(_0x22852e,_0x5d0871){if(_0x22852e===_0x5d0871){return[_0x22852e];}else{var _0x4fdd6e=moment[_0x29a4('0x8')]();moment[_0x29a4('0x8')]('en');var _0x4a7b59=moment[_0x29a4('0x9')]()[_0x29a4('0x2')](function(_0x117faf){return _0x117faf[_0x29a4('0xa')]();});moment[_0x29a4('0x8')](_0x4fdd6e);var _0x3efaa9=_0x4a7b59[_0x29a4('0xb')](_0x22852e);var _0x3f7f95=_0x4a7b59[_0x29a4('0xb')](_0x5d0871);if(_0x3f7f95>_0x3efaa9){return _0x4a7b59['slice'](_0x3efaa9,_0x3f7f95+0x1);}else{var _0x11aa05=_0x4a7b59[_0x29a4('0xc')](0x0,_0x3f7f95+0x1);var _0x2b92c8=_0x4a7b59['slice'](_0x3efaa9);return _0x2b92c8['concat'](_0x11aa05);}}}module[_0x29a4('0xd')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x442183,_0x57d6c6){if(_0x442183===_0x57d6c6){return[_0x442183];}else{var _0x3b487a=moment['locale']();moment[_0x29a4('0x8')]('en');var _0x113255=moment['monthsShort']()['map'](function(_0x2c3b1d){return _0x2c3b1d[_0x29a4('0xa')]();});moment[_0x29a4('0x8')](_0x3b487a);var _0x170222=_0x113255[_0x29a4('0xb')](_0x442183);var _0x52e671=_0x113255[_0x29a4('0xb')](_0x57d6c6);if(_0x52e671>_0x170222){return _0x113255[_0x29a4('0xc')](_0x170222,_0x52e671+0x1);}else{var _0x5b55b9=_0x113255[_0x29a4('0xc')](0x0,_0x52e671+0x1);var _0x4cb00b=_0x113255[_0x29a4('0xc')](_0x170222);return _0x4cb00b[_0x29a4('0xe')](_0x5b55b9);}}}module[_0x29a4('0xd')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x2b98d1){var _0x346200=parseInt(_0x2b98d1,0xa);if(_0x346200<0x1||_0x346200>0x1f){throw new Error(EINVALID_DATE);}return _0x346200;}function timeCompare(_0x54d7ab,_0x3b6a32,_0x34b4fd){var _0x260831=_0x54d7ab[_0x29a4('0xf')]();var _0x139765=extractTime(_0x3b6a32);var _0x128ecb=_0x139765[0x0];var _0x3bf706=_0x139765[0x1];var _0x2ee0a9=_0x54d7ab[_0x29a4('0xf')]()[_0x29a4('0x10')](_0x128ecb)[_0x29a4('0x11')](_0x3bf706);throwIfDateNotValid(_0x2ee0a9);var _0x5abe03=extractTime(_0x34b4fd);var _0x160f6d=_0x5abe03[0x0];var _0x146e18=_0x5abe03[0x1];var _0x4117a1=_0x54d7ab[_0x29a4('0xf')]()[_0x29a4('0x10')](_0x160f6d)['minutes'](_0x146e18);throwIfDateNotValid(_0x4117a1);if(_0x4117a1[_0x29a4('0x12')](_0x2ee0a9)){var _0x32bcc6=_0x260831['clone']()[_0x29a4('0x13')](_0x29a4('0x14'));var _0x40742f=_0x260831['clone']()[_0x29a4('0x15')]('day');return _0x260831[_0x29a4('0x16')](_0x2ee0a9,_0x40742f,undefined,'[]')||_0x260831[_0x29a4('0x16')](_0x32bcc6,_0x4117a1,undefined,'[]');}else{return _0x260831[_0x29a4('0x16')](_0x2ee0a9,_0x4117a1,undefined,'[]');}}module['exports']['timeCompare']=timeCompare;function dowCompare(_0x246161,_0x103480,_0x177299){var _0xa331dc=_0x246161[_0x29a4('0x8')]('en')[_0x29a4('0x17')](_0x29a4('0x18'))[_0x29a4('0xa')]();return circularDoWInterval(_0x103480,_0x177299)[_0x29a4('0x19')](_0xa331dc);}module[_0x29a4('0xd')][_0x29a4('0x1a')]=dowCompare;function domCompare(_0x440898,_0x399538,_0x7ffbf0){var _0x5ee659=_0x440898[_0x29a4('0x1b')]();if(_0x399538===_0x7ffbf0){return _0x5ee659===_0x399538;}else{var _0x5036c6=_0x440898[_0x29a4('0x1c')]();var _0x4026c2=_0x399538<_0x7ffbf0;let _0x1118be=![];var _0x155198=0x0;var _0x10e0c3=0x0;if(_0x4026c2){_0x155198=Math['max'](0x1,_0x399538);_0x10e0c3=Math['min'](_0x7ffbf0,_0x5036c6);_0x1118be=_0x5ee659>=_0x155198&&_0x5ee659<=_0x10e0c3;}else{_0x155198=Math[_0x29a4('0x1d')](_0x399538,_0x5036c6);_0x10e0c3=Math[_0x29a4('0x1e')](0x1,_0x7ffbf0);_0x1118be=_0x5ee659>=_0x155198||_0x5ee659<=_0x10e0c3;}return _0x1118be;}}module['exports'][_0x29a4('0x1f')]=domCompare;function monthCompare(_0x370b41,_0xbf87f1,_0x2333d6){var _0x3a492d=_0x370b41[_0x29a4('0x8')]('en')[_0x29a4('0x17')]('MMM')[_0x29a4('0xa')]();return circularMonthInterval(_0xbf87f1,_0x2333d6)[_0x29a4('0x19')](_0x3a492d);}module['exports'][_0x29a4('0x20')]=monthCompare;function iftime(_0x5f4ed8,_0x155fc2=moment['tz'][_0x29a4('0x21')](),_0x3fa6c2=moment()){if(!validateRx[_0x29a4('0x22')](_0x5f4ed8)){throw new Error(EINVALID_STRING);}else{var _0x1c1e09=(moment[_0x29a4('0x23')](_0x3fa6c2)?_0x3fa6c2[_0x29a4('0xf')]():moment(_0x3fa6c2))['tz'](_0x155fc2)[_0x29a4('0x8')]('en');throwIfDateNotValid(_0x1c1e09);var _0xda25b4=_0x5f4ed8[_0x29a4('0x24')](',');var _0x41813d=_0xda25b4[0x0];var _0x2bf64a=_0xda25b4[0x1];var _0x4a7625=_0xda25b4[0x2];var _0x608a67=_0xda25b4[0x3];let _0x2405ad=!![];if(_0x41813d!=='*'){var _0x5ae119=_0x41813d[_0x29a4('0x24')]('-');var _0xbbddcf=_[_0x29a4('0x25')](_0x5ae119[0x0],0x5,'0');var _0x3145e6=_0x5ae119[_0x29a4('0x26')]===0x2?_[_0x29a4('0x25')](_0x5ae119[0x1],0x5,'0'):_0xbbddcf;_0x2405ad=timeCompare(_0x1c1e09,_0xbbddcf,_0x3145e6);}let _0x1c45d1=!![];if(_0x2bf64a!=='*'){var _0x3b5b64=_0x2bf64a[_0x29a4('0x24')]('-');var _0x5397da=_0x3b5b64[0x0];var _0xa985e2=_0x3b5b64[_0x29a4('0x26')]===0x2?_0x3b5b64[0x1]:_0x5397da;_0x1c45d1=dowCompare(_0x1c1e09,_0x5397da,_0xa985e2);}let _0x1eeea7=!![];if(_0x4a7625!=='*'){var _0x77fb39=_0x4a7625[_0x29a4('0x24')]('-');var _0x273420=parseDom(_0x77fb39[0x0]);var _0x306756=_0x77fb39[_0x29a4('0x26')]===0x2?parseDom(_0x77fb39[0x1]):_0x273420;_0x1eeea7=domCompare(_0x1c1e09,_0x273420,_0x306756);}let _0x32e316=!![];if(_0x608a67!=='*'){var _0xedf1a8=_0x608a67['split']('-');var _0x3851a4=_0xedf1a8[0x0];var _0x119d79=_0xedf1a8['length']===0x2?_0xedf1a8[0x1]:_0xedf1a8[0x0];_0x32e316=monthCompare(_0x1c1e09,_0x3851a4,_0x119d79);}return _0x2405ad&&_0x1c45d1&&_0x1eeea7&&_0x32e316;}}module['exports'][_0x29a4('0x27')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 1c465ef..94a5f19 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0602=['bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join','format','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','transports','Console','warn','Logger','File','%s-%s','error','consoleLogger','fileLogger','path','winston','debugLevel','toLowerCase','bold\x20yellow'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0602,0xe2));var _0x2060=function(_0x3f010c,_0x4e2db2){_0x3f010c=_0x3f010c-0x0;var _0x2df9df=_0x0602[_0x3f010c];return _0x2df9df;};'use strict';var path=require(_0x2060('0x0'));var util=require('util');var moment=require('moment');var winston=require(_0x2060('0x1'));var config=require('../config/environment');var debugLevel=config[_0x2060('0x2')]?config[_0x2060('0x2')][_0x2060('0x3')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':'redBG\x20white','error':'red','warn':_0x2060('0x4'),'info':'white','print':'bold\x20white','success':_0x2060('0x5'),'http':_0x2060('0x6'),'verbose':'bold\x20magenta','debug':_0x2060('0x7'),'silly':_0x2060('0x8')};winston[_0x2060('0x9')](XC_LOG_COLORS);function getLogFileName(_0x242952,_0x152583,_0x3615d0){var _0x3f574b=_0x242952||_0x2060('0xa');return path[_0x2060('0xb')](_0x3f574b,util[_0x2060('0xc')]('%s-%s.log',_0x152583,_0x3615d0));}function formatter(_0xd2db58,_0x591b90){_0x591b90[_0x2060('0xd')]=_0x591b90['message'][_0x2060('0xe')](/@@{/g,_0x2060('0xf'))[_0x2060('0xe')](/}@@/g,'}}}')[_0x2060('0xe')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0x2060('0xc')](_0x2060('0x10'),moment()[_0x2060('0xc')](_0x2060('0x11')),_0x591b90[_0x2060('0x12')][_0x2060('0x13')](),_0xd2db58,_0x591b90[_0x2060('0xd')]);}function fileFormat(_0xdcf59c,_0x4e9482){_0x4e9482['message']=_0x4e9482[_0x2060('0xd')][_0x2060('0xe')](/@@{/g,'{{{')['replace'](/}@@/g,'}}}')[_0x2060('0xe')](/@{/g,'{{')[_0x2060('0xe')](/}@/g,'}}');var _0x1c13e9=_0x4e9482[_0x2060('0x14')]&&Object[_0x2060('0x15')](_0x4e9482[_0x2060('0x14')])[_0x2060('0x16')]?'\x0a\x09'+JSON['stringify'](_0x4e9482[_0x2060('0x14')]):'';return util[_0x2060('0xc')](_0x2060('0x17'),moment()[_0x2060('0xc')](_0x2060('0x11')),_0x4e9482[_0x2060('0x12')]['toUpperCase'](),_0xdcf59c,_0x4e9482[_0x2060('0xd')],_0x1c13e9);}function consoleLogger(){var _0x462594=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2060('0x18'))][(_0x2060('0x19'))]({'level':_0x2060('0x1a'),'json':![],'formatter':function(_0x4c8b07){return formatter('',_0x4c8b07);}})]});return _0x462594;}function fileLogger(_0xf65d36,_0x2f1c47){var _0x39a13f=new winston[(_0x2060('0x1b'))]({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0x2060('0x1c'))]({'name':util[_0x2060('0xc')](_0x2060('0x1d'),_0xf65d36,_0x2060('0x1e')),'filename':getLogFileName(_0x2f1c47,_0xf65d36,'error'),'level':_0x2060('0x1e'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5f014f){return fileFormat(_0xf65d36,_0x5f014f);}}),new winston['transports'][(_0x2060('0x1c'))]({'name':util['format']('%s-%s',_0xf65d36,debugLevel),'filename':getLogFileName(_0x2f1c47,_0xf65d36,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2b8801){return fileFormat(_0xf65d36,_0x2b8801);}}),new winston['transports'][(_0x2060('0x19'))]({'level':_0x2060('0x1a'),'json':![],'formatter':function(_0x41461a){return fileFormat(_0xf65d36,_0x41461a);}})]});return _0x39a13f;}exports[_0x2060('0x1f')]=consoleLogger;exports[_0x2060('0x20')]=fileLogger; \ No newline at end of file +var _0xeefe=['format','%s-%s.log','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','toUpperCase','}}}','meta','keys','length','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Console','warn','transports','File','%s-%s','error','consoleLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','info','redBG\x20white','red','bold\x20yellow','bold\x20green','gray','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','join'];(function(_0x429dac,_0x4c83e3){var _0x24d7f4=function(_0x4bcf3f){while(--_0x4bcf3f){_0x429dac['push'](_0x429dac['shift']());}};_0x24d7f4(++_0x4c83e3);}(_0xeefe,0xcc));var _0xeeef=function(_0x29584e,_0x387aee){_0x29584e=_0x29584e-0x0;var _0x5df1a2=_0xeefe[_0x29584e];return _0x5df1a2;};'use strict';var path=require(_0xeeef('0x0'));var util=require(_0xeeef('0x1'));var moment=require(_0xeeef('0x2'));var winston=require(_0xeeef('0x3'));var config=require(_0xeeef('0x4'));var debugLevel=config[_0xeeef('0x5')]?config['debugLevel'][_0xeeef('0x6')]():_0xeeef('0x7');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xeeef('0x8'),'error':_0xeeef('0x9'),'warn':_0xeeef('0xa'),'info':'white','print':'bold\x20white','success':_0xeeef('0xb'),'http':_0xeeef('0xc'),'verbose':'bold\x20magenta','debug':_0xeeef('0xd'),'silly':_0xeeef('0xe')};winston[_0xeeef('0xf')](XC_LOG_COLORS);function getLogFileName(_0x13fa69,_0x3846fe,_0x2027fa){var _0x21446b=_0x13fa69||_0xeeef('0x10');return path[_0xeeef('0x11')](_0x21446b,util[_0xeeef('0x12')](_0xeeef('0x13'),_0x3846fe,_0x2027fa));}function formatter(_0x1455d0,_0x37a713){_0x37a713[_0xeeef('0x14')]=_0x37a713[_0xeeef('0x14')][_0xeeef('0x15')](/@@{/g,_0xeeef('0x16'))[_0xeeef('0x15')](/}@@/g,'}}}')[_0xeeef('0x15')](/@{/g,'{{')[_0xeeef('0x15')](/}@/g,'}}');return util[_0xeeef('0x12')](_0xeeef('0x17'),moment()[_0xeeef('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),_0x37a713['level'][_0xeeef('0x18')](),_0x1455d0,_0x37a713[_0xeeef('0x14')]);}function fileFormat(_0x2a3b32,_0x2d6e96){_0x2d6e96['message']=_0x2d6e96[_0xeeef('0x14')][_0xeeef('0x15')](/@@{/g,_0xeeef('0x16'))[_0xeeef('0x15')](/}@@/g,_0xeeef('0x19'))[_0xeeef('0x15')](/@{/g,'{{')['replace'](/}@/g,'}}');var _0x4364b0=_0x2d6e96[_0xeeef('0x1a')]&&Object[_0xeeef('0x1b')](_0x2d6e96['meta'])[_0xeeef('0x1c')]?'\x0a\x09'+JSON['stringify'](_0x2d6e96[_0xeeef('0x1a')]):'';return util[_0xeeef('0x12')](_0xeeef('0x1d'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x2d6e96['level'][_0xeeef('0x18')](),_0x2a3b32,_0x2d6e96[_0xeeef('0x14')],_0x4364b0);}function consoleLogger(){var _0x1471e6=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston['transports'][(_0xeeef('0x1e'))]({'level':_0xeeef('0x1f'),'json':![],'formatter':function(_0x5286a0){return formatter('',_0x5286a0);}})]});return _0x1471e6;}function fileLogger(_0x58b62f,_0x5a0cf1){var _0x5380d9=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xeeef('0x20'))][(_0xeeef('0x21'))]({'name':util[_0xeeef('0x12')](_0xeeef('0x22'),_0x58b62f,_0xeeef('0x23')),'filename':getLogFileName(_0x5a0cf1,_0x58b62f,'error'),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x193d09){return fileFormat(_0x58b62f,_0x193d09);}}),new winston[(_0xeeef('0x20'))][(_0xeeef('0x21'))]({'name':util[_0xeeef('0x12')](_0xeeef('0x22'),_0x58b62f,debugLevel),'filename':getLogFileName(_0x5a0cf1,_0x58b62f,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x198798){return fileFormat(_0x58b62f,_0x198798);}}),new winston[(_0xeeef('0x20'))][(_0xeeef('0x1e'))]({'level':_0xeeef('0x1f'),'json':![],'formatter':function(_0x4e6b85){return fileFormat(_0x58b62f,_0x4e6b85);}})]});return _0x5380d9;}exports[_0xeeef('0x24')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 1f2cf19..ff087c1 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['fax','clientSecret','securityToken','accessKey','tenantId','token','channelSecret','accessToken','authToken','consumerKey','consumerSecret','calleridname','vidaooApiKey','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','oldPassword','length','isPlainObject','replace','@@{','exports','username','password','newPassword','apiKey','firstName','lastName','street','phone','mobile'];(function(_0xeff00e,_0xcc0083){var _0x1d54af=function(_0xfbd1b4){while(--_0xfbd1b4){_0xeff00e['push'](_0xeff00e['shift']());}};_0x1d54af(++_0xcc0083);}(_0x1261,0x144));var _0x1126=function(_0xc5a279,_0x155360){_0xc5a279=_0xc5a279-0x0;var _0xc755d3=_0x1261[_0xc5a279];return _0xc755d3;};var _=require('lodash');var sensitiveFields=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2'),_0x1126('0x3'),_0x1126('0x4'),_0x1126('0x5'),_0x1126('0x6'),_0x1126('0x7'),_0x1126('0x8'),_0x1126('0x9'),'email','clientId',_0x1126('0xa'),_0x1126('0xb'),'code',_0x1126('0xc'),_0x1126('0xd'),_0x1126('0xe'),_0x1126('0xf'),_0x1126('0x10'),'accessTokenSecret',_0x1126('0x11'),_0x1126('0x12'),_0x1126('0x13'),'membername',_0x1126('0x14'),'calleridnum','exten',_0x1126('0x15'),'clientEmail',_0x1126('0x16'),_0x1126('0x17'),_0x1126('0x18'),_0x1126('0x19'),_0x1126('0x1a'),_0x1126('0x1b'),_0x1126('0x1c'),_0x1126('0x1d'),_0x1126('0x1e'),'secret','registry',_0x1126('0x1f')];function maskSensitiveData(_0x154e20){const _0x279455=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x154e20)){for(const _0x45149c in _0x154e20){if(_['isArray'](_0x154e20[_0x45149c])){for(let _0x35fe9f=0x0;_0x35fe9f<_0x154e20[_0x45149c][_0x1126('0x20')];_0x35fe9f++){maskSensitiveData(_0x154e20[_0x45149c][_0x35fe9f]);}}else if(_[_0x1126('0x21')](_0x154e20[_0x45149c])){maskSensitiveData(_0x154e20[_0x45149c]);}else if(_['isString'](_0x154e20[_0x45149c])){_0x154e20[_0x45149c]=_0x154e20[_0x45149c][_0x1126('0x22')](/{{{/g,_0x1126('0x23'))['replace'](/}}}/g,'}@@')[_0x1126('0x22')](/{{/g,'@{')[_0x1126('0x22')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x45149c)){_0x154e20[_0x45149c]=_0x154e20[_0x45149c]['replace'](_0x279455,'*');}}}}}module[_0x1126('0x24')]['maskSensitiveData']=maskSensitiveData; \ No newline at end of file +var _0x0b0e=['}@@','lodash','password','apiKey','firstName','lastName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','tenantId','token','channelSecret','accessToken','authToken','consumerKey','membername','calleridname','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','user','pass','localstationid','dsn','secret','registry','oldPassword','isArray','length','isString','replace'];(function(_0x5ac676,_0x2a6dd9){var _0x139eee=function(_0x388d48){while(--_0x388d48){_0x5ac676['push'](_0x5ac676['shift']());}};_0x139eee(++_0x2a6dd9);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2f37e0,_0x393ef9){_0x2f37e0=_0x2f37e0-0x0;var _0x43ccce=_0x0b0e[_0x2f37e0];return _0x43ccce;};var _=require(_0xe0b0('0x0'));var sensitiveFields=['username',_0xe0b0('0x1'),'newPassword',_0xe0b0('0x2'),_0xe0b0('0x3'),_0xe0b0('0x4'),_0xe0b0('0x5'),_0xe0b0('0x6'),_0xe0b0('0x7'),_0xe0b0('0x8'),_0xe0b0('0x9'),_0xe0b0('0xa'),_0xe0b0('0xb'),_0xe0b0('0xc'),'code','accessKey',_0xe0b0('0xd'),_0xe0b0('0xe'),_0xe0b0('0xf'),_0xe0b0('0x10'),'accessTokenSecret',_0xe0b0('0x11'),_0xe0b0('0x12'),'consumerSecret',_0xe0b0('0x13'),_0xe0b0('0x14'),'calleridnum',_0xe0b0('0x15'),_0xe0b0('0x16'),_0xe0b0('0x17'),'privateKey',_0xe0b0('0x18'),_0xe0b0('0x19'),_0xe0b0('0x1a'),_0xe0b0('0x1b'),_0xe0b0('0x1c'),'accountSid',_0xe0b0('0x1d'),_0xe0b0('0x1e'),_0xe0b0('0x1f'),_0xe0b0('0x20'),_0xe0b0('0x21')];function maskSensitiveData(_0x55d884){const _0x41a7e2=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x55d884)){for(const _0x35cb40 in _0x55d884){if(_[_0xe0b0('0x22')](_0x55d884[_0x35cb40])){for(let _0x519ae8=0x0;_0x519ae8<_0x55d884[_0x35cb40][_0xe0b0('0x23')];_0x519ae8++){maskSensitiveData(_0x55d884[_0x35cb40][_0x519ae8]);}}else if(_['isPlainObject'](_0x55d884[_0x35cb40])){maskSensitiveData(_0x55d884[_0x35cb40]);}else if(_[_0xe0b0('0x24')](_0x55d884[_0x35cb40])){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](/{{{/g,'@@{')['replace'](/}}}/g,_0xe0b0('0x26'))['replace'](/{{/g,'@{')['replace'](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x35cb40)){_0x55d884[_0x35cb40]=_0x55d884[_0x35cb40][_0xe0b0('0x25')](_0x41a7e2,'*');}}}}}module['exports']['maskSensitiveData']=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/misc.js b/server/utils/misc.js index 9832db9..8006496 100644 --- a/server/utils/misc.js +++ b/server/utils/misc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf494=['exports','\x5c$&'];(function(_0x1abd3d,_0x460bfc){var _0x1d9ae0=function(_0x399f5e){while(--_0x399f5e){_0x1abd3d['push'](_0x1abd3d['shift']());}};_0x1d9ae0(++_0x460bfc);}(_0xf494,0x1c6));var _0x4f49=function(_0x428374,_0x1a536a){_0x428374=_0x428374-0x0;var _0x55060e=_0xf494[_0x428374];return _0x55060e;};module[_0x4f49('0x0')]={'escapeRegExp'(_0x32e808,_0x3063f3=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x32e808['replace'](_0x3063f3,_0x4f49('0x1'));}}; \ No newline at end of file +var _0x0295=['exports','replace'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x0295,0x1f0));var _0x5029=function(_0x14d175,_0x230bf7){_0x14d175=_0x14d175-0x0;var _0x2946e9=_0x0295[_0x14d175];return _0x2946e9;};module[_0x5029('0x0')]={'escapeRegExp'(_0x4e737b,_0x5e71d0=/[-[\]{}()*+?.,\\\/^$|#\s]/g){return _0x4e737b[_0x5029('0x1')](_0x5e71d0,'\x5c$&');}}; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index 8dafea4..2933927 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe605=['isArray','map','isPlainObject','keys','reduce','exports','lodash','\x20}\x20}','string','replace'];(function(_0x38a10f,_0x56ef14){var _0x1c03d3=function(_0x30cc61){while(--_0x30cc61){_0x38a10f['push'](_0x38a10f['shift']());}};_0x1c03d3(++_0x56ef14);}(_0xe605,0x92));var _0x5e60=function(_0xc90f96,_0x1f75a3){_0xc90f96=_0xc90f96-0x0;var _0x2859bb=_0xe605[_0xc90f96];return _0x2859bb;};var _=require(_0x5e60('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x455628){return _0x455628==='{{'?'{\x20{\x20':_0x5e60('0x1');}function safeTemplate(_0x455efd){var _0x342132=_0x455efd;if(typeof _0x455efd===_0x5e60('0x2')){_0x342132=_0x455efd[_0x5e60('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5e60('0x4')](_0x455efd)){_0x342132=_0x455efd[_0x5e60('0x5')](function(_0x30d8fb){return safeTemplate(_0x30d8fb);});}else if(_[_0x5e60('0x6')](_0x455efd)){_0x342132=Object[_0x5e60('0x7')](_0x455efd)[_0x5e60('0x8')](function(_0x168a14,_0x4e3501){_0x168a14[_0x4e3501]=safeTemplate(_0x455efd[_0x4e3501]);return _0x168a14;},{});}return _0x342132;}module[_0x5e60('0x9')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0xe605=['isArray','map','isPlainObject','keys','reduce','exports','lodash','\x20}\x20}','string','replace'];(function(_0x5b37ef,_0x32f8ea){var _0x4f5779=function(_0x12b5d2){while(--_0x12b5d2){_0x5b37ef['push'](_0x5b37ef['shift']());}};_0x4f5779(++_0x32f8ea);}(_0xe605,0x92));var _0x5e60=function(_0x2bbf51,_0x4cf88c){_0x2bbf51=_0x2bbf51-0x0;var _0x2f6718=_0xe605[_0x2bbf51];return _0x2f6718;};var _=require(_0x5e60('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x455628){return _0x455628==='{{'?'{\x20{\x20':_0x5e60('0x1');}function safeTemplate(_0x455efd){var _0x342132=_0x455efd;if(typeof _0x455efd===_0x5e60('0x2')){_0x342132=_0x455efd[_0x5e60('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x5e60('0x4')](_0x455efd)){_0x342132=_0x455efd[_0x5e60('0x5')](function(_0x30d8fb){return safeTemplate(_0x30d8fb);});}else if(_[_0x5e60('0x6')](_0x455efd)){_0x342132=Object[_0x5e60('0x7')](_0x455efd)[_0x5e60('0x8')](function(_0x168a14,_0x4e3501){_0x168a14[_0x4e3501]=safeTemplate(_0x455efd[_0x4e3501]);return _0x168a14;},{});}return _0x342132;}module[_0x5e60('0x9')]['safeTemplate']=safeTemplate; \ No newline at end of file diff --git a/server/utils/update-app-config.js b/server/utils/update-app-config.js index 49df6a1..2492dcc 100644 --- a/server/utils/update-app-config.js +++ b/server/utils/update-app-config.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x80b5=['root','server/app.json','resolve','isArray','apps','findIndex','name','motion2','env','then','updated','Updating\x20app.json','exports','fs-extra','path','../config/environment'];(function(_0x489c04,_0x18c675){var _0x25c051=function(_0x127712){while(--_0x127712){_0x489c04['push'](_0x489c04['shift']());}};_0x25c051(++_0x18c675);}(_0x80b5,0xed));var _0x580b=function(_0x261b8a,_0x553ec4){_0x261b8a=_0x261b8a-0x0;var _0x3455e8=_0x80b5[_0x261b8a];return _0x3455e8;};var fs=require(_0x580b('0x0'));var path=require(_0x580b('0x1'));var config=require(_0x580b('0x2'));var root=config[_0x580b('0x3')];var APP_JSON_PATH=path['resolve'](root,_0x580b('0x4'));var NODEPATH=path[_0x580b('0x5')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0xbd582e){let _0x204851=![];if(Array[_0x580b('0x6')](_0xbd582e[_0x580b('0x7')])){var _0x15b594=_0xbd582e[_0x580b('0x7')][_0x580b('0x8')](function(_0x3921dd){return _0x3921dd[_0x580b('0x9')]===_0x580b('0xa');});if(_0x15b594>-0x1){var _0x391053=_0xbd582e[_0x580b('0x7')][_0x15b594];if(typeof _0x391053[_0x580b('0xb')]['NODE_PATH']!=='string'){_0x391053[_0x580b('0xb')]['NODE_PATH']=NODEPATH;_0x204851=!![];}}return{'appConfig':_0xbd582e,'updated':_0x204851};}}function updateAppConfig(_0x19345b){return fs['pathExists'](APP_JSON_PATH)[_0x580b('0xc')](function(_0x26ac6d){if(_0x26ac6d){return fs['readJSON'](APP_JSON_PATH)[_0x580b('0xc')](function(_0x5d44b6){var _0x462286=setLegacyLibsNodeEnvPath(_0x5d44b6);if(_0x462286[_0x580b('0xd')]){_0x19345b['info'](_0x580b('0xe'));return fs['writeJSON'](APP_JSON_PATH,_0x5d44b6,{'spaces':0x2});}else{return Promise[_0x580b('0x5')]();}});}else{return Promise['resolve']();}});}module[_0x580b('0xf')]=updateAppConfig; \ No newline at end of file +var _0x8996=['path','../config/environment','root','resolve','server/app.json','isArray','apps','name','motion2','env','NODE_PATH','string','then','readJSON','info','Updating\x20app.json','writeJSON','exports'];(function(_0x13169e,_0x1cba7c){var _0x3a4f74=function(_0x253625){while(--_0x253625){_0x13169e['push'](_0x13169e['shift']());}};_0x3a4f74(++_0x1cba7c);}(_0x8996,0x1b0));var _0x6899=function(_0x33920e,_0xc28394){_0x33920e=_0x33920e-0x0;var _0x762791=_0x8996[_0x33920e];return _0x762791;};var fs=require('fs-extra');var path=require(_0x6899('0x0'));var config=require(_0x6899('0x1'));var root=config[_0x6899('0x2')];var APP_JSON_PATH=path[_0x6899('0x3')](root,_0x6899('0x4'));var NODEPATH=path[_0x6899('0x3')](root,'legacy-libs');function setLegacyLibsNodeEnvPath(_0x4207f8){let _0x1bef5b=![];if(Array[_0x6899('0x5')](_0x4207f8[_0x6899('0x6')])){var _0x5bf152=_0x4207f8[_0x6899('0x6')]['findIndex'](function(_0x45234){return _0x45234[_0x6899('0x7')]===_0x6899('0x8');});if(_0x5bf152>-0x1){var _0x2b7f91=_0x4207f8[_0x6899('0x6')][_0x5bf152];if(typeof _0x2b7f91[_0x6899('0x9')][_0x6899('0xa')]!==_0x6899('0xb')){_0x2b7f91[_0x6899('0x9')][_0x6899('0xa')]=NODEPATH;_0x1bef5b=!![];}}return{'appConfig':_0x4207f8,'updated':_0x1bef5b};}}function updateAppConfig(_0xed80b){return fs['pathExists'](APP_JSON_PATH)[_0x6899('0xc')](function(_0x4990ad){if(_0x4990ad){return fs[_0x6899('0xd')](APP_JSON_PATH)[_0x6899('0xc')](function(_0x5d20ae){var _0x5610b3=setLegacyLibsNodeEnvPath(_0x5d20ae);if(_0x5610b3['updated']){_0xed80b[_0x6899('0xe')](_0x6899('0xf'));return fs[_0x6899('0x10')](APP_JSON_PATH,_0x5d20ae,{'spaces':0x2});}else{return Promise['resolve']();}});}else{return Promise[_0x6899('0x3')]();}});}module[_0x6899('0x11')]=updateAppConfig; \ No newline at end of file